figpack-spike-sorting 0.1.1__py3-none-any.whl → 0.1.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,5 @@
1
- (function(){"use strict";function SC(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in e)){const i=Object.getOwnPropertyDescriptor(r,a);i&&Object.defineProperty(e,a,i.get?i:{enumerable:!0,get:()=>r[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}function U1(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var L1={exports:{}},_u={};/**
1
+ (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".VerticalToolbar{overflow:hidden;position:absolute}.HorizontalToolbar{display:flex;justify-content:center;align-items:center;overflow:hidden;margin:auto}.compact-table-container{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,sans-serif;font-size:12px;line-height:1;overflow:auto;background:#fff}.compact-table{width:100%;border-collapse:collapse;border-spacing:0;font-size:12px;table-layout:auto;background:#fff}.compact-table-header{background:linear-gradient(135deg,#f8f9fa,#e9ecef);border:1px solid #d1d5db;border-bottom:2px solid #9ca3af;padding:4px 6px;font-size:12px;font-weight:600;text-align:left;height:20px;line-height:1;white-space:nowrap;position:sticky;top:0;z-index:10;color:#374151;text-transform:uppercase;letter-spacing:.025em;user-select:none;transition:all .15s ease}.compact-table-header:hover{background:linear-gradient(135deg,#e9ecef,#dee2e6);transform:translateY(-1px);box-shadow:0 2px 4px #0000001a}.compact-table-cell{border-right:1px solid #e5e7eb;border-bottom:1px solid #f3f4f6;padding:2px 6px;font-size:12px;height:18px;line-height:1;vertical-align:middle;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100px;color:#1f2937;transition:background-color .1s ease}.compact-table-row{height:18px;transition:all .1s ease}.compact-table-row:nth-child(2n){background-color:#fafafa}.compact-table-row:hover{background-color:#f0f9ff!important;transform:scale(1.002);box-shadow:0 1px 3px #0000000d}.compact-table-row.selected{background:linear-gradient(135deg,#dbeafe,#bfdbfe)!important;border-left:3px solid #3b82f6}.compact-table-row.current{background:linear-gradient(135deg,#fef3c7,#fde68a)!important;border-left:3px solid #f59e0b;font-weight:600}.sort-indicator{font-size:12px;margin-left:1px;color:#6b7280;font-weight:700;text-shadow:0 1px 1px rgba(255,255,255,.8)}.compact-table input[type=checkbox]{transform:scale(1);margin:0;padding:0;accent-color:#3b82f6;cursor:pointer}.compact-table-cell>span{font-size:12px!important;line-height:1!important}.compact-table-cell>div{font-size:12px!important;line-height:1!important}.compact-table .unitLabel{width:6px;height:6px;display:inline-block;margin-right:2px;border-radius:1px;box-shadow:0 1px 2px #0000001a}.compact-table *{font-size:12px!important;line-height:1!important}.compact-table-cell:last-child{border-right:none}.compact-table-container{box-shadow:0 1px 3px #0000001a;border-radius:4px;overflow:hidden}.compact-table input[type=checkbox]:checked{background-color:#3b82f6;border-color:#3b82f6}.SortableTableWidget .MuiTableCell-root,.SortableTableWidget .MuiTableRow-root,.SortableTableWidget .MuiTable-root,.SortableTableWidget *{font-size:12px!important;line-height:1!important;padding:2px 6px!important;height:18px!important;min-height:18px!important;max-height:18px!important}.compact-table-container::-webkit-scrollbar{width:8px;height:8px}.compact-table-container::-webkit-scrollbar-track{background:#f1f5f9;border-radius:4px}.compact-table-container::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:4px}.compact-table-container::-webkit-scrollbar-thumb:hover{background:#94a3b8}.NiceTable .MuiTableCell-root{padding:5px}.NiceTable .MuiIconButton-root{padding:1px}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
2
+ (function(){"use strict";function nx(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const a=Object.getOwnPropertyDescriptor(r,i);a&&Object.defineProperty(e,i,a.get?a:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}function rx(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Gm={exports:{}},vl={};/**
2
3
  * @license React
3
4
  * react-jsx-runtime.production.js
4
5
  *
@@ -6,7 +7,7 @@
6
7
  *
7
8
  * This source code is licensed under the MIT license found in the
8
9
  * LICENSE file in the root directory of this source tree.
9
- */var wC=Symbol.for("react.transitional.element"),xC=Symbol.for("react.fragment");function P1(e,t,n){var r=null;if(n!==void 0&&(r=""+n),t.key!==void 0&&(r=""+t.key),"key"in t){n={};for(var a in t)a!=="key"&&(n[a]=t[a])}else n=t;return t=n.ref,{$$typeof:wC,type:e,key:r,ref:t!==void 0?t:null,props:n}}_u.Fragment=xC,_u.jsx=P1,_u.jsxs=P1,L1.exports=_u;var F=L1.exports,j1={exports:{}},Oe={};/**
10
+ */var ix=Symbol.for("react.transitional.element"),ax=Symbol.for("react.fragment");function Ym(e,t,n){var r=null;if(n!==void 0&&(r=""+n),t.key!==void 0&&(r=""+t.key),"key"in t){n={};for(var i in t)i!=="key"&&(n[i]=t[i])}else n=t;return t=n.ref,{$$typeof:ix,type:e,key:r,ref:t!==void 0?t:null,props:n}}vl.Fragment=ax,vl.jsx=Ym,vl.jsxs=Ym,Gm.exports=vl;var B=Gm.exports,Xm={exports:{}},Te={};/**
10
11
  * @license React
11
12
  * react.production.js
12
13
  *
@@ -14,7 +15,7 @@
14
15
  *
15
16
  * This source code is licensed under the MIT license found in the
16
17
  * LICENSE file in the root directory of this source tree.
17
- */var m0=Symbol.for("react.transitional.element"),EC=Symbol.for("react.portal"),AC=Symbol.for("react.fragment"),CC=Symbol.for("react.strict_mode"),TC=Symbol.for("react.profiler"),MC=Symbol.for("react.consumer"),_C=Symbol.for("react.context"),NC=Symbol.for("react.forward_ref"),FC=Symbol.for("react.suspense"),BC=Symbol.for("react.memo"),H1=Symbol.for("react.lazy"),q1=Symbol.iterator;function OC(e){return e===null||typeof e!="object"?null:(e=q1&&e[q1]||e["@@iterator"],typeof e=="function"?e:null)}var Y1={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},G1=Object.assign,V1={};function oo(e,t,n){this.props=e,this.context=t,this.refs=V1,this.updater=n||Y1}oo.prototype.isReactComponent={},oo.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},oo.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function X1(){}X1.prototype=oo.prototype;function p0(e,t,n){this.props=e,this.context=t,this.refs=V1,this.updater=n||Y1}var g0=p0.prototype=new X1;g0.constructor=p0,G1(g0,oo.prototype),g0.isPureReactComponent=!0;var Z1=Array.isArray,St={H:null,A:null,T:null,S:null,V:null},K1=Object.prototype.hasOwnProperty;function v0(e,t,n,r,a,i){return n=i.ref,{$$typeof:m0,type:e,key:t,ref:n!==void 0?n:null,props:i}}function RC(e,t){return v0(e.type,t,void 0,void 0,void 0,e.props)}function y0(e){return typeof e=="object"&&e!==null&&e.$$typeof===m0}function zC(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Q1=/\/+/g;function b0(e,t){return typeof e=="object"&&e!==null&&e.key!=null?zC(""+e.key):t.toString(36)}function W1(){}function kC(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(W1,W1):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function so(e,t,n,r,a){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(i){case"bigint":case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case m0:case EC:o=!0;break;case H1:return o=e._init,so(o(e._payload),t,n,r,a)}}if(o)return a=a(e),o=r===""?"."+b0(e,0):r,Z1(a)?(n="",o!=null&&(n=o.replace(Q1,"$&/")+"/"),so(a,t,n,"",function(u){return u})):a!=null&&(y0(a)&&(a=RC(a,n+(a.key==null||e&&e.key===a.key?"":(""+a.key).replace(Q1,"$&/")+"/")+o)),t.push(a)),1;o=0;var s=r===""?".":r+":";if(Z1(e))for(var l=0;l<e.length;l++)r=e[l],i=s+b0(r,l),o+=so(r,t,n,i,a);else if(l=OC(e),typeof l=="function")for(e=l.call(e),l=0;!(r=e.next()).done;)r=r.value,i=s+b0(r,l++),o+=so(r,t,n,i,a);else if(i==="object"){if(typeof e.then=="function")return so(kC(e),t,n,r,a);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return o}function Nu(e,t,n){if(e==null)return e;var r=[],a=0;return so(e,r,"","",function(i){return t.call(n,i,a++)}),r}function $C(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var J1=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)};function IC(){}Oe.Children={map:Nu,forEach:function(e,t,n){Nu(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Nu(e,function(){t++}),t},toArray:function(e){return Nu(e,function(t){return t})||[]},only:function(e){if(!y0(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},Oe.Component=oo,Oe.Fragment=AC,Oe.Profiler=TC,Oe.PureComponent=p0,Oe.StrictMode=CC,Oe.Suspense=FC,Oe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=St,Oe.__COMPILER_RUNTIME={__proto__:null,c:function(e){return St.H.useMemoCache(e)}},Oe.cache=function(e){return function(){return e.apply(null,arguments)}},Oe.cloneElement=function(e,t,n){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var r=G1({},e.props),a=e.key,i=void 0;if(t!=null)for(o in t.ref!==void 0&&(i=void 0),t.key!==void 0&&(a=""+t.key),t)!K1.call(t,o)||o==="key"||o==="__self"||o==="__source"||o==="ref"&&t.ref===void 0||(r[o]=t[o]);var o=arguments.length-2;if(o===1)r.children=n;else if(1<o){for(var s=Array(o),l=0;l<o;l++)s[l]=arguments[l+2];r.children=s}return v0(e.type,a,void 0,void 0,i,r)},Oe.createContext=function(e){return e={$$typeof:_C,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:MC,_context:e},e},Oe.createElement=function(e,t,n){var r,a={},i=null;if(t!=null)for(r in t.key!==void 0&&(i=""+t.key),t)K1.call(t,r)&&r!=="key"&&r!=="__self"&&r!=="__source"&&(a[r]=t[r]);var o=arguments.length-2;if(o===1)a.children=n;else if(1<o){for(var s=Array(o),l=0;l<o;l++)s[l]=arguments[l+2];a.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)a[r]===void 0&&(a[r]=o[r]);return v0(e,i,void 0,void 0,null,a)},Oe.createRef=function(){return{current:null}},Oe.forwardRef=function(e){return{$$typeof:NC,render:e}},Oe.isValidElement=y0,Oe.lazy=function(e){return{$$typeof:H1,_payload:{_status:-1,_result:e},_init:$C}},Oe.memo=function(e,t){return{$$typeof:BC,type:e,compare:t===void 0?null:t}},Oe.startTransition=function(e){var t=St.T,n={};St.T=n;try{var r=e(),a=St.S;a!==null&&a(n,r),typeof r=="object"&&r!==null&&typeof r.then=="function"&&r.then(IC,J1)}catch(i){J1(i)}finally{St.T=t}},Oe.unstable_useCacheRefresh=function(){return St.H.useCacheRefresh()},Oe.use=function(e){return St.H.use(e)},Oe.useActionState=function(e,t,n){return St.H.useActionState(e,t,n)},Oe.useCallback=function(e,t){return St.H.useCallback(e,t)},Oe.useContext=function(e){return St.H.useContext(e)},Oe.useDebugValue=function(){},Oe.useDeferredValue=function(e,t){return St.H.useDeferredValue(e,t)},Oe.useEffect=function(e,t,n){var r=St.H;if(typeof n=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return r.useEffect(e,t)},Oe.useId=function(){return St.H.useId()},Oe.useImperativeHandle=function(e,t,n){return St.H.useImperativeHandle(e,t,n)},Oe.useInsertionEffect=function(e,t){return St.H.useInsertionEffect(e,t)},Oe.useLayoutEffect=function(e,t){return St.H.useLayoutEffect(e,t)},Oe.useMemo=function(e,t){return St.H.useMemo(e,t)},Oe.useOptimistic=function(e,t){return St.H.useOptimistic(e,t)},Oe.useReducer=function(e,t,n){return St.H.useReducer(e,t,n)},Oe.useRef=function(e){return St.H.useRef(e)},Oe.useState=function(e){return St.H.useState(e)},Oe.useSyncExternalStore=function(e,t,n){return St.H.useSyncExternalStore(e,t,n)},Oe.useTransition=function(){return St.H.useTransition()},Oe.version="19.1.1",j1.exports=Oe;var _=j1.exports;const Rt=U1(_),D0=SC({__proto__:null,default:Rt},[_]);var ev={exports:{}},Fu={},tv={exports:{}},nv={};/**
18
+ */var Of=Symbol.for("react.transitional.element"),ox=Symbol.for("react.portal"),ux=Symbol.for("react.fragment"),lx=Symbol.for("react.strict_mode"),sx=Symbol.for("react.profiler"),cx=Symbol.for("react.consumer"),fx=Symbol.for("react.context"),dx=Symbol.for("react.forward_ref"),hx=Symbol.for("react.suspense"),mx=Symbol.for("react.memo"),Zm=Symbol.for("react.lazy"),Qm=Symbol.iterator;function px(e){return e===null||typeof e!="object"?null:(e=Qm&&e[Qm]||e["@@iterator"],typeof e=="function"?e:null)}var Km={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Wm=Object.assign,Jm={};function pa(e,t,n){this.props=e,this.context=t,this.refs=Jm,this.updater=n||Km}pa.prototype.isReactComponent={},pa.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},pa.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function ep(){}ep.prototype=pa.prototype;function zf(e,t,n){this.props=e,this.context=t,this.refs=Jm,this.updater=n||Km}var Uf=zf.prototype=new ep;Uf.constructor=zf,Wm(Uf,pa.prototype),Uf.isPureReactComponent=!0;var tp=Array.isArray,ct={H:null,A:null,T:null,S:null,V:null},np=Object.prototype.hasOwnProperty;function If(e,t,n,r,i,a){return n=a.ref,{$$typeof:Of,type:e,key:t,ref:n!==void 0?n:null,props:a}}function gx(e,t){return If(e.type,t,void 0,void 0,void 0,e.props)}function $f(e){return typeof e=="object"&&e!==null&&e.$$typeof===Of}function vx(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var rp=/\/+/g;function kf(e,t){return typeof e=="object"&&e!==null&&e.key!=null?vx(""+e.key):t.toString(36)}function ip(){}function yx(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(ip,ip):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function ga(e,t,n,r,i){var a=typeof e;(a==="undefined"||a==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(a){case"bigint":case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Of:case ox:o=!0;break;case Zm:return o=e._init,ga(o(e._payload),t,n,r,i)}}if(o)return i=i(e),o=r===""?"."+kf(e,0):r,tp(i)?(n="",o!=null&&(n=o.replace(rp,"$&/")+"/"),ga(i,t,n,"",function(s){return s})):i!=null&&($f(i)&&(i=gx(i,n+(i.key==null||e&&e.key===i.key?"":(""+i.key).replace(rp,"$&/")+"/")+o)),t.push(i)),1;o=0;var u=r===""?".":r+":";if(tp(e))for(var l=0;l<e.length;l++)r=e[l],a=u+kf(r,l),o+=ga(r,t,n,a,i);else if(l=px(e),typeof l=="function")for(e=l.call(e),l=0;!(r=e.next()).done;)r=r.value,a=u+kf(r,l++),o+=ga(r,t,n,a,i);else if(a==="object"){if(typeof e.then=="function")return ga(yx(e),t,n,r,i);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return o}function yl(e,t,n){if(e==null)return e;var r=[],i=0;return ga(e,r,"","",function(a){return t.call(n,a,i++)}),r}function bx(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var ap=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)};function Dx(){}Te.Children={map:yl,forEach:function(e,t,n){yl(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return yl(e,function(){t++}),t},toArray:function(e){return yl(e,function(t){return t})||[]},only:function(e){if(!$f(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},Te.Component=pa,Te.Fragment=ux,Te.Profiler=sx,Te.PureComponent=zf,Te.StrictMode=lx,Te.Suspense=hx,Te.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=ct,Te.__COMPILER_RUNTIME={__proto__:null,c:function(e){return ct.H.useMemoCache(e)}},Te.cache=function(e){return function(){return e.apply(null,arguments)}},Te.cloneElement=function(e,t,n){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var r=Wm({},e.props),i=e.key,a=void 0;if(t!=null)for(o in t.ref!==void 0&&(a=void 0),t.key!==void 0&&(i=""+t.key),t)!np.call(t,o)||o==="key"||o==="__self"||o==="__source"||o==="ref"&&t.ref===void 0||(r[o]=t[o]);var o=arguments.length-2;if(o===1)r.children=n;else if(1<o){for(var u=Array(o),l=0;l<o;l++)u[l]=arguments[l+2];r.children=u}return If(e.type,i,void 0,void 0,a,r)},Te.createContext=function(e){return e={$$typeof:fx,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:cx,_context:e},e},Te.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=""+t.key),t)np.call(t,r)&&r!=="key"&&r!=="__self"&&r!=="__source"&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var u=Array(o),l=0;l<o;l++)u[l]=arguments[l+2];i.children=u}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return If(e,a,void 0,void 0,null,i)},Te.createRef=function(){return{current:null}},Te.forwardRef=function(e){return{$$typeof:dx,render:e}},Te.isValidElement=$f,Te.lazy=function(e){return{$$typeof:Zm,_payload:{_status:-1,_result:e},_init:bx}},Te.memo=function(e,t){return{$$typeof:mx,type:e,compare:t===void 0?null:t}},Te.startTransition=function(e){var t=ct.T,n={};ct.T=n;try{var r=e(),i=ct.S;i!==null&&i(n,r),typeof r=="object"&&r!==null&&typeof r.then=="function"&&r.then(Dx,ap)}catch(a){ap(a)}finally{ct.T=t}},Te.unstable_useCacheRefresh=function(){return ct.H.useCacheRefresh()},Te.use=function(e){return ct.H.use(e)},Te.useActionState=function(e,t,n){return ct.H.useActionState(e,t,n)},Te.useCallback=function(e,t){return ct.H.useCallback(e,t)},Te.useContext=function(e){return ct.H.useContext(e)},Te.useDebugValue=function(){},Te.useDeferredValue=function(e,t){return ct.H.useDeferredValue(e,t)},Te.useEffect=function(e,t,n){var r=ct.H;if(typeof n=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return r.useEffect(e,t)},Te.useId=function(){return ct.H.useId()},Te.useImperativeHandle=function(e,t,n){return ct.H.useImperativeHandle(e,t,n)},Te.useInsertionEffect=function(e,t){return ct.H.useInsertionEffect(e,t)},Te.useLayoutEffect=function(e,t){return ct.H.useLayoutEffect(e,t)},Te.useMemo=function(e,t){return ct.H.useMemo(e,t)},Te.useOptimistic=function(e,t){return ct.H.useOptimistic(e,t)},Te.useReducer=function(e,t,n){return ct.H.useReducer(e,t,n)},Te.useRef=function(e){return ct.H.useRef(e)},Te.useState=function(e){return ct.H.useState(e)},Te.useSyncExternalStore=function(e,t,n){return ct.H.useSyncExternalStore(e,t,n)},Te.useTransition=function(){return ct.H.useTransition()},Te.version="19.1.1",Xm.exports=Te;var M=Xm.exports;const Nt=rx(M),Lf=nx({__proto__:null,default:Nt},[M]);var op={exports:{}},bl={},up={exports:{}},lp={};/**
18
19
  * @license React
19
20
  * scheduler.production.js
20
21
  *
@@ -22,7 +23,7 @@
22
23
  *
23
24
  * This source code is licensed under the MIT license found in the
24
25
  * LICENSE file in the root directory of this source tree.
25
- */(function(e){function t(B,k){var $=B.length;B.push(k);e:for(;0<$;){var U=$-1>>>1,Y=B[U];if(0<a(Y,k))B[U]=k,B[$]=Y,$=U;else break e}}function n(B){return B.length===0?null:B[0]}function r(B){if(B.length===0)return null;var k=B[0],$=B.pop();if($!==k){B[0]=$;e:for(var U=0,Y=B.length,X=Y>>>1;U<X;){var P=2*(U+1)-1,G=B[P],q=P+1,L=B[q];if(0>a(G,$))q<Y&&0>a(L,G)?(B[U]=L,B[q]=$,U=q):(B[U]=G,B[P]=$,U=P);else if(q<Y&&0>a(L,$))B[U]=L,B[q]=$,U=q;else break e}}return k}function a(B,k){var $=B.sortIndex-k.sortIndex;return $!==0?$:B.id-k.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var l=[],u=[],c=1,f=null,d=3,h=!1,g=!1,m=!1,D=!1,p=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;function w(B){for(var k=n(u);k!==null;){if(k.callback===null)r(u);else if(k.startTime<=B)r(u),k.sortIndex=k.expirationTime,t(l,k);else break;k=n(u)}}function E(B){if(m=!1,w(B),!g)if(n(l)!==null)g=!0,b||(b=!0,x());else{var k=n(u);k!==null&&z(E,k.startTime-B)}}var b=!1,S=-1,A=5,C=-1;function T(){return D?!0:!(e.unstable_now()-C<A)}function M(){if(D=!1,b){var B=e.unstable_now();C=B;var k=!0;try{e:{g=!1,m&&(m=!1,v(S),S=-1),h=!0;var $=d;try{t:{for(w(B),f=n(l);f!==null&&!(f.expirationTime>B&&T());){var U=f.callback;if(typeof U=="function"){f.callback=null,d=f.priorityLevel;var Y=U(f.expirationTime<=B);if(B=e.unstable_now(),typeof Y=="function"){f.callback=Y,w(B),k=!0;break t}f===n(l)&&r(l),w(B)}else r(l);f=n(l)}if(f!==null)k=!0;else{var X=n(u);X!==null&&z(E,X.startTime-B),k=!1}}break e}finally{f=null,d=$,h=!1}k=void 0}}finally{k?x():b=!1}}}var x;if(typeof y=="function")x=function(){y(M)};else if(typeof MessageChannel<"u"){var N=new MessageChannel,O=N.port2;N.port1.onmessage=M,x=function(){O.postMessage(null)}}else x=function(){p(M,0)};function z(B,k){S=p(function(){B(e.unstable_now())},k)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(B){B.callback=null},e.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<B?Math.floor(1e3/B):5},e.unstable_getCurrentPriorityLevel=function(){return d},e.unstable_next=function(B){switch(d){case 1:case 2:case 3:var k=3;break;default:k=d}var $=d;d=k;try{return B()}finally{d=$}},e.unstable_requestPaint=function(){D=!0},e.unstable_runWithPriority=function(B,k){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var $=d;d=B;try{return k()}finally{d=$}},e.unstable_scheduleCallback=function(B,k,$){var U=e.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?U+$:U):$=U,B){case 1:var Y=-1;break;case 2:Y=250;break;case 5:Y=1073741823;break;case 4:Y=1e4;break;default:Y=5e3}return Y=$+Y,B={id:c++,callback:k,priorityLevel:B,startTime:$,expirationTime:Y,sortIndex:-1},$>U?(B.sortIndex=$,t(u,B),n(l)===null&&B===n(u)&&(m?(v(S),S=-1):m=!0,z(E,$-U))):(B.sortIndex=Y,t(l,B),g||h||(g=!0,b||(b=!0,x()))),B},e.unstable_shouldYield=T,e.unstable_wrapCallback=function(B){var k=d;return function(){var $=d;d=k;try{return B.apply(this,arguments)}finally{d=$}}}})(nv),tv.exports=nv;var UC=tv.exports,rv={exports:{}},Dn={};/**
26
+ */(function(e){function t(N,U){var I=N.length;N.push(U);e:for(;0<I;){var L=I-1>>>1,G=N[L];if(0<i(G,U))N[L]=U,N[I]=G,I=L;else break e}}function n(N){return N.length===0?null:N[0]}function r(N){if(N.length===0)return null;var U=N[0],I=N.pop();if(I!==U){N[0]=I;e:for(var L=0,G=N.length,X=G>>>1;L<X;){var P=2*(L+1)-1,j=N[P],H=P+1,k=N[H];if(0>i(j,I))H<G&&0>i(k,j)?(N[L]=k,N[H]=I,L=H):(N[L]=j,N[P]=I,L=P);else if(H<G&&0>i(k,I))N[L]=k,N[H]=I,L=H;else break e}}return U}function i(N,U){var I=N.sortIndex-U.sortIndex;return I!==0?I:N.id-U.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,u=o.now();e.unstable_now=function(){return o.now()-u}}var l=[],s=[],c=1,f=null,d=3,h=!1,v=!1,m=!1,D=!1,p=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;function S(N){for(var U=n(s);U!==null;){if(U.callback===null)r(s);else if(U.startTime<=N)r(s),U.sortIndex=U.expirationTime,t(l,U);else break;U=n(s)}}function w(N){if(m=!1,S(N),!v)if(n(l)!==null)v=!0,b||(b=!0,x());else{var U=n(s);U!==null&&z(w,U.startTime-N)}}var b=!1,E=-1,C=5,A=-1;function T(){return D?!0:!(e.unstable_now()-A<C)}function _(){if(D=!1,b){var N=e.unstable_now();A=N;var U=!0;try{e:{v=!1,m&&(m=!1,g(E),E=-1),h=!0;var I=d;try{t:{for(S(N),f=n(l);f!==null&&!(f.expirationTime>N&&T());){var L=f.callback;if(typeof L=="function"){f.callback=null,d=f.priorityLevel;var G=L(f.expirationTime<=N);if(N=e.unstable_now(),typeof G=="function"){f.callback=G,S(N),U=!0;break t}f===n(l)&&r(l),S(N)}else r(l);f=n(l)}if(f!==null)U=!0;else{var X=n(s);X!==null&&z(w,X.startTime-N),U=!1}}break e}finally{f=null,d=I,h=!1}U=void 0}}finally{U?x():b=!1}}}var x;if(typeof y=="function")x=function(){y(_)};else if(typeof MessageChannel<"u"){var F=new MessageChannel,R=F.port2;F.port1.onmessage=_,x=function(){R.postMessage(null)}}else x=function(){p(_,0)};function z(N,U){E=p(function(){N(e.unstable_now())},U)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(N){N.callback=null},e.unstable_forceFrameRate=function(N){0>N||125<N?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):C=0<N?Math.floor(1e3/N):5},e.unstable_getCurrentPriorityLevel=function(){return d},e.unstable_next=function(N){switch(d){case 1:case 2:case 3:var U=3;break;default:U=d}var I=d;d=U;try{return N()}finally{d=I}},e.unstable_requestPaint=function(){D=!0},e.unstable_runWithPriority=function(N,U){switch(N){case 1:case 2:case 3:case 4:case 5:break;default:N=3}var I=d;d=N;try{return U()}finally{d=I}},e.unstable_scheduleCallback=function(N,U,I){var L=e.unstable_now();switch(typeof I=="object"&&I!==null?(I=I.delay,I=typeof I=="number"&&0<I?L+I:L):I=L,N){case 1:var G=-1;break;case 2:G=250;break;case 5:G=1073741823;break;case 4:G=1e4;break;default:G=5e3}return G=I+G,N={id:c++,callback:U,priorityLevel:N,startTime:I,expirationTime:G,sortIndex:-1},I>L?(N.sortIndex=I,t(s,N),n(l)===null&&N===n(s)&&(m?(g(E),E=-1):m=!0,z(w,I-L))):(N.sortIndex=G,t(l,N),v||h||(v=!0,b||(b=!0,x()))),N},e.unstable_shouldYield=T,e.unstable_wrapCallback=function(N){var U=d;return function(){var I=d;d=U;try{return N.apply(this,arguments)}finally{d=I}}}})(lp),up.exports=lp;var Sx=up.exports,sp={exports:{}},nn={};/**
26
27
  * @license React
27
28
  * react-dom.production.js
28
29
  *
@@ -30,7 +31,7 @@
30
31
  *
31
32
  * This source code is licensed under the MIT license found in the
32
33
  * LICENSE file in the root directory of this source tree.
33
- */var LC=_;function av(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function Fa(){}var Sn={d:{f:Fa,r:function(){throw Error(av(522))},D:Fa,C:Fa,L:Fa,m:Fa,X:Fa,S:Fa,M:Fa},p:0,findDOMNode:null},PC=Symbol.for("react.portal");function jC(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:PC,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}var js=LC.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function Bu(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}Dn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Sn,Dn.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(av(299));return jC(e,t,null,n)},Dn.flushSync=function(e){var t=js.T,n=Sn.p;try{if(js.T=null,Sn.p=2,e)return e()}finally{js.T=t,Sn.p=n,Sn.d.f()}},Dn.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,Sn.d.C(e,t))},Dn.prefetchDNS=function(e){typeof e=="string"&&Sn.d.D(e)},Dn.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var n=t.as,r=Bu(n,t.crossOrigin),a=typeof t.integrity=="string"?t.integrity:void 0,i=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;n==="style"?Sn.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:i}):n==="script"&&Sn.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:i,nonce:typeof t.nonce=="string"?t.nonce:void 0})}},Dn.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var n=Bu(t.as,t.crossOrigin);Sn.d.M(e,{crossOrigin:n,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0})}}else t==null&&Sn.d.M(e)},Dn.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var n=t.as,r=Bu(n,t.crossOrigin);Sn.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,type:typeof t.type=="string"?t.type:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy=="string"?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet=="string"?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes=="string"?t.imageSizes:void 0,media:typeof t.media=="string"?t.media:void 0})}},Dn.preloadModule=function(e,t){if(typeof e=="string")if(t){var n=Bu(t.as,t.crossOrigin);Sn.d.m(e,{as:typeof t.as=="string"&&t.as!=="script"?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity=="string"?t.integrity:void 0})}else Sn.d.m(e)},Dn.requestFormReset=function(e){Sn.d.r(e)},Dn.unstable_batchedUpdates=function(e,t){return e(t)},Dn.useFormState=function(e,t,n){return js.H.useFormState(e,t,n)},Dn.useFormStatus=function(){return js.H.useHostTransitionStatus()},Dn.version="19.1.1";function iv(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(iv)}catch(e){console.error(e)}}iv(),rv.exports=Dn;var HC=rv.exports;/**
34
+ */var xx=M;function cp(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function ei(){}var rn={d:{f:ei,r:function(){throw Error(cp(522))},D:ei,C:ei,L:ei,m:ei,X:ei,S:ei,M:ei},p:0,findDOMNode:null},wx=Symbol.for("react.portal");function Ex(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:wx,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}var Io=xx.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function Dl(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}nn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=rn,nn.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(cp(299));return Ex(e,t,null,n)},nn.flushSync=function(e){var t=Io.T,n=rn.p;try{if(Io.T=null,rn.p=2,e)return e()}finally{Io.T=t,rn.p=n,rn.d.f()}},nn.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,rn.d.C(e,t))},nn.prefetchDNS=function(e){typeof e=="string"&&rn.d.D(e)},nn.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var n=t.as,r=Dl(n,t.crossOrigin),i=typeof t.integrity=="string"?t.integrity:void 0,a=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;n==="style"?rn.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:a}):n==="script"&&rn.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:a,nonce:typeof t.nonce=="string"?t.nonce:void 0})}},nn.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var n=Dl(t.as,t.crossOrigin);rn.d.M(e,{crossOrigin:n,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0})}}else t==null&&rn.d.M(e)},nn.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var n=t.as,r=Dl(n,t.crossOrigin);rn.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,type:typeof t.type=="string"?t.type:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy=="string"?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet=="string"?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes=="string"?t.imageSizes:void 0,media:typeof t.media=="string"?t.media:void 0})}},nn.preloadModule=function(e,t){if(typeof e=="string")if(t){var n=Dl(t.as,t.crossOrigin);rn.d.m(e,{as:typeof t.as=="string"&&t.as!=="script"?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity=="string"?t.integrity:void 0})}else rn.d.m(e)},nn.requestFormReset=function(e){rn.d.r(e)},nn.unstable_batchedUpdates=function(e,t){return e(t)},nn.useFormState=function(e,t,n){return Io.H.useFormState(e,t,n)},nn.useFormStatus=function(){return Io.H.useHostTransitionStatus()},nn.version="19.1.1";function fp(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(fp)}catch(e){console.error(e)}}fp(),sp.exports=nn;var Ax=sp.exports;/**
34
35
  * @license React
35
36
  * react-dom-client.production.js
36
37
  *
@@ -38,51 +39,39 @@
38
39
  *
39
40
  * This source code is licensed under the MIT license found in the
40
41
  * LICENSE file in the root directory of this source tree.
41
- */var Yt=UC,ov=_,qC=HC;function re(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function sv(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Hs(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function lv(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function uv(e){if(Hs(e)!==e)throw Error(re(188))}function YC(e){var t=e.alternate;if(!t){if(t=Hs(e),t===null)throw Error(re(188));return t!==e?null:e}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var i=a.alternate;if(i===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===i.child){for(i=a.child;i;){if(i===n)return uv(a),e;if(i===r)return uv(a),t;i=i.sibling}throw Error(re(188))}if(n.return!==r.return)n=a,r=i;else{for(var o=!1,s=a.child;s;){if(s===n){o=!0,n=a,r=i;break}if(s===r){o=!0,r=a,n=i;break}s=s.sibling}if(!o){for(s=i.child;s;){if(s===n){o=!0,n=i,r=a;break}if(s===r){o=!0,r=i,n=a;break}s=s.sibling}if(!o)throw Error(re(189))}}if(n.alternate!==r)throw Error(re(190))}if(n.tag!==3)throw Error(re(188));return n.stateNode.current===n?e:t}function cv(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=cv(e),t!==null)return t;e=e.sibling}return null}var vt=Object.assign,GC=Symbol.for("react.element"),Ou=Symbol.for("react.transitional.element"),qs=Symbol.for("react.portal"),lo=Symbol.for("react.fragment"),fv=Symbol.for("react.strict_mode"),S0=Symbol.for("react.profiler"),VC=Symbol.for("react.provider"),dv=Symbol.for("react.consumer"),ea=Symbol.for("react.context"),w0=Symbol.for("react.forward_ref"),x0=Symbol.for("react.suspense"),E0=Symbol.for("react.suspense_list"),A0=Symbol.for("react.memo"),Ba=Symbol.for("react.lazy"),C0=Symbol.for("react.activity"),XC=Symbol.for("react.memo_cache_sentinel"),hv=Symbol.iterator;function Ys(e){return e===null||typeof e!="object"?null:(e=hv&&e[hv]||e["@@iterator"],typeof e=="function"?e:null)}var ZC=Symbol.for("react.client.reference");function T0(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ZC?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case lo:return"Fragment";case S0:return"Profiler";case fv:return"StrictMode";case x0:return"Suspense";case E0:return"SuspenseList";case C0:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case qs:return"Portal";case ea:return(e.displayName||"Context")+".Provider";case dv:return(e._context.displayName||"Context")+".Consumer";case w0:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case A0:return t=e.displayName||null,t!==null?t:T0(e.type)||"Memo";case Ba:t=e._payload,e=e._init;try{return T0(e(t))}catch{}}return null}var Gs=Array.isArray,Ce=ov.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ve=qC.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ei={pending:!1,data:null,method:null,action:null},M0=[],uo=-1;function Or(e){return{current:e}}function Zt(e){0>uo||(e.current=M0[uo],M0[uo]=null,uo--)}function wt(e,t){uo++,M0[uo]=e.current,e.current=t}var Rr=Or(null),Vs=Or(null),Oa=Or(null),Ru=Or(null);function zu(e,t){switch(wt(Oa,t),wt(Vs,e),wt(Rr,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?R2(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=R2(t),e=z2(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Zt(Rr),wt(Rr,e)}function co(){Zt(Rr),Zt(Vs),Zt(Oa)}function _0(e){e.memoizedState!==null&&wt(Ru,e);var t=Rr.current,n=z2(t,e.type);t!==n&&(wt(Vs,e),wt(Rr,n))}function ku(e){Vs.current===e&&(Zt(Rr),Zt(Vs)),Ru.current===e&&(Zt(Ru),Ll._currentValue=Ei)}var N0=Object.prototype.hasOwnProperty,F0=Yt.unstable_scheduleCallback,B0=Yt.unstable_cancelCallback,KC=Yt.unstable_shouldYield,QC=Yt.unstable_requestPaint,zr=Yt.unstable_now,WC=Yt.unstable_getCurrentPriorityLevel,mv=Yt.unstable_ImmediatePriority,pv=Yt.unstable_UserBlockingPriority,$u=Yt.unstable_NormalPriority,JC=Yt.unstable_LowPriority,gv=Yt.unstable_IdlePriority,e5=Yt.log,t5=Yt.unstable_setDisableYieldValue,Xs=null,Ln=null;function Ra(e){if(typeof e5=="function"&&t5(e),Ln&&typeof Ln.setStrictMode=="function")try{Ln.setStrictMode(Xs,e)}catch{}}var Pn=Math.clz32?Math.clz32:a5,n5=Math.log,r5=Math.LN2;function a5(e){return e>>>=0,e===0?32:31-(n5(e)/r5|0)|0}var Iu=256,Uu=4194304;function Ai(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Lu(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var a=0,i=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s!==0?(r=s&~i,r!==0?a=Ai(r):(o&=s,o!==0?a=Ai(o):n||(n=s&~e,n!==0&&(a=Ai(n))))):(s=r&~i,s!==0?a=Ai(s):o!==0?a=Ai(o):n||(n=r&~e,n!==0&&(a=Ai(n)))),a===0?0:t!==0&&t!==a&&!(t&i)&&(i=a&-a,n=t&-t,i>=n||i===32&&(n&4194048)!==0)?t:a}function Zs(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function i5(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function vv(){var e=Iu;return Iu<<=1,!(Iu&4194048)&&(Iu=256),e}function yv(){var e=Uu;return Uu<<=1,!(Uu&62914560)&&(Uu=4194304),e}function O0(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ks(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function o5(e,t,n,r,a,i){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,l=e.expirationTimes,u=e.hiddenUpdates;for(n=o&~n;0<n;){var c=31-Pn(n),f=1<<c;s[c]=0,l[c]=-1;var d=u[c];if(d!==null)for(u[c]=null,c=0;c<d.length;c++){var h=d[c];h!==null&&(h.lane&=-536870913)}n&=~f}r!==0&&bv(e,r,0),i!==0&&a===0&&e.tag!==0&&(e.suspendedLanes|=i&~(o&~t))}function bv(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Pn(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&4194090}function Dv(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Pn(n),a=1<<r;a&t|e[r]&t&&(e[r]|=t),n&=~a}}function R0(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function z0(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function Sv(){var e=Ve.p;return e!==0?e:(e=window.event,e===void 0?32:eD(e.type))}function s5(e,t){var n=Ve.p;try{return Ve.p=e,t()}finally{Ve.p=n}}var za=Math.random().toString(36).slice(2),fn="__reactFiber$"+za,Mn="__reactProps$"+za,fo="__reactContainer$"+za,k0="__reactEvents$"+za,l5="__reactListeners$"+za,u5="__reactHandles$"+za,wv="__reactResources$"+za,Qs="__reactMarker$"+za;function $0(e){delete e[fn],delete e[Mn],delete e[k0],delete e[l5],delete e[u5]}function ho(e){var t=e[fn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[fo]||n[fn]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=U2(e);e!==null;){if(n=e[fn])return n;e=U2(e)}return t}e=n,n=e.parentNode}return null}function mo(e){if(e=e[fn]||e[fo]){var t=e.tag;if(t===5||t===6||t===13||t===26||t===27||t===3)return e}return null}function Ws(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(re(33))}function po(e){var t=e[wv];return t||(t=e[wv]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Kt(e){e[Qs]=!0}var xv=new Set,Ev={};function Ci(e,t){go(e,t),go(e+"Capture",t)}function go(e,t){for(Ev[e]=t,e=0;e<t.length;e++)xv.add(t[e])}var c5=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Av={},Cv={};function f5(e){return N0.call(Cv,e)?!0:N0.call(Av,e)?!1:c5.test(e)?Cv[e]=!0:(Av[e]=!0,!1)}function Pu(e,t,n){if(f5(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var r=t.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function ju(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function ta(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+r)}}var I0,Tv;function vo(e){if(I0===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);I0=t&&t[1]||"",Tv=-1<n.stack.indexOf(`
42
+ */var Rt=Sx,dp=M,Cx=Ax;function re(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function hp(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function $o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function mp(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function pp(e){if($o(e)!==e)throw Error(re(188))}function Tx(e){var t=e.alternate;if(!t){if(t=$o(e),t===null)throw Error(re(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var a=i.alternate;if(a===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return pp(i),e;if(a===r)return pp(i),t;a=a.sibling}throw Error(re(188))}if(n.return!==r.return)n=i,r=a;else{for(var o=!1,u=i.child;u;){if(u===n){o=!0,n=i,r=a;break}if(u===r){o=!0,r=i,n=a;break}u=u.sibling}if(!o){for(u=a.child;u;){if(u===n){o=!0,n=a,r=i;break}if(u===r){o=!0,r=a,n=i;break}u=u.sibling}if(!o)throw Error(re(189))}}if(n.alternate!==r)throw Error(re(190))}if(n.tag!==3)throw Error(re(188));return n.stateNode.current===n?e:t}function gp(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=gp(e),t!==null)return t;e=e.sibling}return null}var ut=Object.assign,Mx=Symbol.for("react.element"),Sl=Symbol.for("react.transitional.element"),ko=Symbol.for("react.portal"),va=Symbol.for("react.fragment"),vp=Symbol.for("react.strict_mode"),jf=Symbol.for("react.profiler"),_x=Symbol.for("react.provider"),yp=Symbol.for("react.consumer"),Mr=Symbol.for("react.context"),Hf=Symbol.for("react.forward_ref"),Pf=Symbol.for("react.suspense"),qf=Symbol.for("react.suspense_list"),Vf=Symbol.for("react.memo"),ti=Symbol.for("react.lazy"),Gf=Symbol.for("react.activity"),Bx=Symbol.for("react.memo_cache_sentinel"),bp=Symbol.iterator;function Lo(e){return e===null||typeof e!="object"?null:(e=bp&&e[bp]||e["@@iterator"],typeof e=="function"?e:null)}var Fx=Symbol.for("react.client.reference");function Yf(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Fx?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case va:return"Fragment";case jf:return"Profiler";case vp:return"StrictMode";case Pf:return"Suspense";case qf:return"SuspenseList";case Gf:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case ko:return"Portal";case Mr:return(e.displayName||"Context")+".Provider";case yp:return(e._context.displayName||"Context")+".Consumer";case Hf:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Vf:return t=e.displayName||null,t!==null?t:Yf(e.type)||"Memo";case ti:t=e._payload,e=e._init;try{return Yf(e(t))}catch{}}return null}var jo=Array.isArray,we=dp.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$e=Cx.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ii={pending:!1,data:null,method:null,action:null},Xf=[],ya=-1;function cr(e){return{current:e}}function It(e){0>ya||(e.current=Xf[ya],Xf[ya]=null,ya--)}function ft(e,t){ya++,Xf[ya]=e.current,e.current=t}var fr=cr(null),Ho=cr(null),ni=cr(null),xl=cr(null);function wl(e,t){switch(ft(ni,t),ft(Ho,e),ft(fr,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?L1(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=L1(t),e=j1(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}It(fr),ft(fr,e)}function ba(){It(fr),It(Ho),It(ni)}function Zf(e){e.memoizedState!==null&&ft(xl,e);var t=fr.current,n=j1(t,e.type);t!==n&&(ft(Ho,e),ft(fr,n))}function El(e){Ho.current===e&&(It(fr),It(Ho)),xl.current===e&&(It(xl),zu._currentValue=Ii)}var Qf=Object.prototype.hasOwnProperty,Kf=Rt.unstable_scheduleCallback,Wf=Rt.unstable_cancelCallback,Nx=Rt.unstable_shouldYield,Rx=Rt.unstable_requestPaint,dr=Rt.unstable_now,Ox=Rt.unstable_getCurrentPriorityLevel,Dp=Rt.unstable_ImmediatePriority,Sp=Rt.unstable_UserBlockingPriority,Al=Rt.unstable_NormalPriority,zx=Rt.unstable_LowPriority,xp=Rt.unstable_IdlePriority,Ux=Rt.log,Ix=Rt.unstable_setDisableYieldValue,Po=null,xn=null;function ri(e){if(typeof Ux=="function"&&Ix(e),xn&&typeof xn.setStrictMode=="function")try{xn.setStrictMode(Po,e)}catch{}}var wn=Math.clz32?Math.clz32:Lx,$x=Math.log,kx=Math.LN2;function Lx(e){return e>>>=0,e===0?32:31-($x(e)/kx|0)|0}var Cl=256,Tl=4194304;function $i(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ml(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var u=r&134217727;return u!==0?(r=u&~a,r!==0?i=$i(r):(o&=u,o!==0?i=$i(o):n||(n=u&~e,n!==0&&(i=$i(n))))):(u=r&~a,u!==0?i=$i(u):o!==0?i=$i(o):n||(n=r&~e,n!==0&&(i=$i(n)))),i===0?0:t!==0&&t!==i&&!(t&a)&&(a=i&-i,n=t&-t,a>=n||a===32&&(n&4194048)!==0)?t:i}function qo(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function jx(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function wp(){var e=Cl;return Cl<<=1,!(Cl&4194048)&&(Cl=256),e}function Ep(){var e=Tl;return Tl<<=1,!(Tl&62914560)&&(Tl=4194304),e}function Jf(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Vo(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Hx(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var u=e.entanglements,l=e.expirationTimes,s=e.hiddenUpdates;for(n=o&~n;0<n;){var c=31-wn(n),f=1<<c;u[c]=0,l[c]=-1;var d=s[c];if(d!==null)for(s[c]=null,c=0;c<d.length;c++){var h=d[c];h!==null&&(h.lane&=-536870913)}n&=~f}r!==0&&Ap(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Ap(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-wn(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&4194090}function Cp(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-wn(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function ed(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function td(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function Tp(){var e=$e.p;return e!==0?e:(e=window.event,e===void 0?32:oy(e.type))}function Px(e,t){var n=$e.p;try{return $e.p=e,t()}finally{$e.p=n}}var ii=Math.random().toString(36).slice(2),Qt="__reactFiber$"+ii,ln="__reactProps$"+ii,Da="__reactContainer$"+ii,nd="__reactEvents$"+ii,qx="__reactListeners$"+ii,Vx="__reactHandles$"+ii,Mp="__reactResources$"+ii,Go="__reactMarker$"+ii;function rd(e){delete e[Qt],delete e[ln],delete e[nd],delete e[qx],delete e[Vx]}function Sa(e){var t=e[Qt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Da]||n[Qt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=V1(e);e!==null;){if(n=e[Qt])return n;e=V1(e)}return t}e=n,n=e.parentNode}return null}function xa(e){if(e=e[Qt]||e[Da]){var t=e.tag;if(t===5||t===6||t===13||t===26||t===27||t===3)return e}return null}function Yo(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(re(33))}function wa(e){var t=e[Mp];return t||(t=e[Mp]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function $t(e){e[Go]=!0}var _p=new Set,Bp={};function ki(e,t){Ea(e,t),Ea(e+"Capture",t)}function Ea(e,t){for(Bp[e]=t,e=0;e<t.length;e++)_p.add(t[e])}var Gx=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Fp={},Np={};function Yx(e){return Qf.call(Np,e)?!0:Qf.call(Fp,e)?!1:Gx.test(e)?Np[e]=!0:(Fp[e]=!0,!1)}function _l(e,t,n){if(Yx(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var r=t.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function Bl(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function _r(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+r)}}var id,Rp;function Aa(e){if(id===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);id=t&&t[1]||"",Rp=-1<n.stack.indexOf(`
42
43
  at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
43
- `+I0+e+Tv}var U0=!1;function L0(e,t){if(!e||U0)return"";U0=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var f=function(){throw Error()};if(Object.defineProperty(f.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(f,[])}catch(h){var d=h}Reflect.construct(e,[],f)}else{try{f.call()}catch(h){d=h}e.call(f.prototype)}}else{try{throw Error()}catch(h){d=h}(f=e())&&typeof f.catch=="function"&&f.catch(function(){})}}catch(h){if(h&&d&&typeof h.stack=="string")return[h.stack,d.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var a=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");a&&a.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var i=r.DetermineComponentFrameRoot(),o=i[0],s=i[1];if(o&&s){var l=o.split(`
44
- `),u=s.split(`
45
- `);for(a=r=0;r<l.length&&!l[r].includes("DetermineComponentFrameRoot");)r++;for(;a<u.length&&!u[a].includes("DetermineComponentFrameRoot");)a++;if(r===l.length||a===u.length)for(r=l.length-1,a=u.length-1;1<=r&&0<=a&&l[r]!==u[a];)a--;for(;1<=r&&0<=a;r--,a--)if(l[r]!==u[a]){if(r!==1||a!==1)do if(r--,a--,0>a||l[r]!==u[a]){var c=`
46
- `+l[r].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=r&&0<=a);break}}}finally{U0=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?vo(n):""}function d5(e){switch(e.tag){case 26:case 27:case 5:return vo(e.type);case 16:return vo("Lazy");case 13:return vo("Suspense");case 19:return vo("SuspenseList");case 0:case 15:return L0(e.type,!1);case 11:return L0(e.type.render,!1);case 1:return L0(e.type,!0);case 31:return vo("Activity");default:return""}}function Mv(e){try{var t="";do t+=d5(e),e=e.return;while(e);return t}catch(n){return`
44
+ `+id+e+Rp}var ad=!1;function od(e,t){if(!e||ad)return"";ad=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var f=function(){throw Error()};if(Object.defineProperty(f.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(f,[])}catch(h){var d=h}Reflect.construct(e,[],f)}else{try{f.call()}catch(h){d=h}e.call(f.prototype)}}else{try{throw Error()}catch(h){d=h}(f=e())&&typeof f.catch=="function"&&f.catch(function(){})}}catch(h){if(h&&d&&typeof h.stack=="string")return[h.stack,d.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var a=r.DetermineComponentFrameRoot(),o=a[0],u=a[1];if(o&&u){var l=o.split(`
45
+ `),s=u.split(`
46
+ `);for(i=r=0;r<l.length&&!l[r].includes("DetermineComponentFrameRoot");)r++;for(;i<s.length&&!s[i].includes("DetermineComponentFrameRoot");)i++;if(r===l.length||i===s.length)for(r=l.length-1,i=s.length-1;1<=r&&0<=i&&l[r]!==s[i];)i--;for(;1<=r&&0<=i;r--,i--)if(l[r]!==s[i]){if(r!==1||i!==1)do if(r--,i--,0>i||l[r]!==s[i]){var c=`
47
+ `+l[r].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=r&&0<=i);break}}}finally{ad=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Aa(n):""}function Xx(e){switch(e.tag){case 26:case 27:case 5:return Aa(e.type);case 16:return Aa("Lazy");case 13:return Aa("Suspense");case 19:return Aa("SuspenseList");case 0:case 15:return od(e.type,!1);case 11:return od(e.type.render,!1);case 1:return od(e.type,!0);case 31:return Aa("Activity");default:return""}}function Op(e){try{var t="";do t+=Xx(e),e=e.return;while(e);return t}catch(n){return`
47
48
  Error generating stack: `+n.message+`
48
- `+n.stack}}function tr(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function _v(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function h5(e){var t=_v(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var a=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(o){r=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Hu(e){e._valueTracker||(e._valueTracker=h5(e))}function Nv(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=_v(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function qu(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var m5=/[\n"\\]/g;function nr(e){return e.replace(m5,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function P0(e,t,n,r,a,i,o,s){e.name="",o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?e.type=o:e.removeAttribute("type"),t!=null?o==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+tr(t)):e.value!==""+tr(t)&&(e.value=""+tr(t)):o!=="submit"&&o!=="reset"||e.removeAttribute("value"),t!=null?j0(e,o,tr(t)):n!=null?j0(e,o,tr(n)):r!=null&&e.removeAttribute("value"),a==null&&i!=null&&(e.defaultChecked=!!i),a!=null&&(e.checked=a&&typeof a!="function"&&typeof a!="symbol"),s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"?e.name=""+tr(s):e.removeAttribute("name")}function Fv(e,t,n,r,a,i,o,s){if(i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.type=i),t!=null||n!=null){if(!(i!=="submit"&&i!=="reset"||t!=null))return;n=n!=null?""+tr(n):"",t=t!=null?""+tr(t):n,s||t===e.value||(e.value=t),e.defaultValue=t}r=r??a,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.name=o)}function j0(e,t,n){t==="number"&&qu(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function yo(e,t,n,r){if(e=e.options,t){t={};for(var a=0;a<n.length;a++)t["$"+n[a]]=!0;for(n=0;n<e.length;n++)a=t.hasOwnProperty("$"+e[n].value),e[n].selected!==a&&(e[n].selected=a),a&&r&&(e[n].defaultSelected=!0)}else{for(n=""+tr(n),t=null,a=0;a<e.length;a++){if(e[a].value===n){e[a].selected=!0,r&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function Bv(e,t,n){if(t!=null&&(t=""+tr(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+tr(n):""}function Ov(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(re(92));if(Gs(r)){if(1<r.length)throw Error(re(93));r=r[0]}n=r}n==null&&(n=""),t=n}n=tr(t),e.defaultValue=n,r=e.textContent,r===n&&r!==""&&r!==null&&(e.value=r)}function bo(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var p5=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Rv(e,t,n){var r=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?r?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":r?e.setProperty(t,n):typeof n!="number"||n===0||p5.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function zv(e,t,n){if(t!=null&&typeof t!="object")throw Error(re(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf("--")===0?e.setProperty(r,""):r==="float"?e.cssFloat="":e[r]="");for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Rv(e,a,r)}else for(var i in t)t.hasOwnProperty(i)&&Rv(e,i,t[i])}function H0(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var g5=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["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"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["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"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["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"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),v5=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Yu(e){return v5.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}var q0=null;function Y0(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Do=null,So=null;function kv(e){var t=mo(e);if(t&&(e=t.stateNode)){var n=e[Mn]||null;e:switch(e=t.stateNode,t.type){case"input":if(P0(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+nr(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[Mn]||null;if(!a)throw Error(re(90));P0(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Nv(r)}break e;case"textarea":Bv(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&yo(e,!!n.multiple,t,!1)}}}var G0=!1;function $v(e,t,n){if(G0)return e(t,n);G0=!0;try{var r=e(t);return r}finally{if(G0=!1,(Do!==null||So!==null)&&(Nc(),Do&&(t=Do,e=So,So=Do=null,kv(t),e)))for(t=0;t<e.length;t++)kv(e[t])}}function Js(e,t){var n=e.stateNode;if(n===null)return null;var r=n[Mn]||null;if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(re(231,t,typeof n));return n}var na=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),V0=!1;if(na)try{var el={};Object.defineProperty(el,"passive",{get:function(){V0=!0}}),window.addEventListener("test",el,el),window.removeEventListener("test",el,el)}catch{V0=!1}var ka=null,X0=null,Gu=null;function Iv(){if(Gu)return Gu;var e,t=X0,n=t.length,r,a="value"in ka?ka.value:ka.textContent,i=a.length;for(e=0;e<n&&t[e]===a[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===a[i-r];r++);return Gu=a.slice(e,1<r?1-r:void 0)}function Vu(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Xu(){return!0}function Uv(){return!1}function _n(e){function t(n,r,a,i,o){this._reactName=n,this._targetInst=a,this.type=r,this.nativeEvent=i,this.target=o,this.currentTarget=null;for(var s in e)e.hasOwnProperty(s)&&(n=e[s],this[s]=n?n(i):i[s]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?Xu:Uv,this.isPropagationStopped=Uv,this}return vt(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Xu)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Xu)},persist:function(){},isPersistent:Xu}),t}var Ti={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Zu=_n(Ti),tl=vt({},Ti,{view:0,detail:0}),y5=_n(tl),Z0,K0,nl,Ku=vt({},tl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:W0,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==nl&&(nl&&e.type==="mousemove"?(Z0=e.screenX-nl.screenX,K0=e.screenY-nl.screenY):K0=Z0=0,nl=e),Z0)},movementY:function(e){return"movementY"in e?e.movementY:K0}}),Lv=_n(Ku),b5=vt({},Ku,{dataTransfer:0}),D5=_n(b5),S5=vt({},tl,{relatedTarget:0}),Q0=_n(S5),w5=vt({},Ti,{animationName:0,elapsedTime:0,pseudoElement:0}),x5=_n(w5),E5=vt({},Ti,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),A5=_n(E5),C5=vt({},Ti,{data:0}),Pv=_n(C5),T5={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},M5={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},_5={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function N5(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=_5[e])?!!t[e]:!1}function W0(){return N5}var F5=vt({},tl,{key:function(e){if(e.key){var t=T5[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Vu(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?M5[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:W0,charCode:function(e){return e.type==="keypress"?Vu(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Vu(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),B5=_n(F5),O5=vt({},Ku,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),jv=_n(O5),R5=vt({},tl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:W0}),z5=_n(R5),k5=vt({},Ti,{propertyName:0,elapsedTime:0,pseudoElement:0}),$5=_n(k5),I5=vt({},Ku,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),U5=_n(I5),L5=vt({},Ti,{newState:0,oldState:0}),P5=_n(L5),j5=[9,13,27,32],J0=na&&"CompositionEvent"in window,rl=null;na&&"documentMode"in document&&(rl=document.documentMode);var H5=na&&"TextEvent"in window&&!rl,Hv=na&&(!J0||rl&&8<rl&&11>=rl),qv=" ",Yv=!1;function Gv(e,t){switch(e){case"keyup":return j5.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Vv(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var wo=!1;function q5(e,t){switch(e){case"compositionend":return Vv(t);case"keypress":return t.which!==32?null:(Yv=!0,qv);case"textInput":return e=t.data,e===qv&&Yv?null:e;default:return null}}function Y5(e,t){if(wo)return e==="compositionend"||!J0&&Gv(e,t)?(e=Iv(),Gu=X0=ka=null,wo=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Hv&&t.locale!=="ko"?null:t.data;default:return null}}var G5={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Xv(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!G5[e.type]:t==="textarea"}function Zv(e,t,n,r){Do?So?So.push(r):So=[r]:Do=r,t=kc(t,"onChange"),0<t.length&&(n=new Zu("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var al=null,il=null;function V5(e){_2(e,0)}function Qu(e){var t=Ws(e);if(Nv(t))return e}function Kv(e,t){if(e==="change")return t}var Qv=!1;if(na){var eh;if(na){var th="oninput"in document;if(!th){var Wv=document.createElement("div");Wv.setAttribute("oninput","return;"),th=typeof Wv.oninput=="function"}eh=th}else eh=!1;Qv=eh&&(!document.documentMode||9<document.documentMode)}function Jv(){al&&(al.detachEvent("onpropertychange",ey),il=al=null)}function ey(e){if(e.propertyName==="value"&&Qu(il)){var t=[];Zv(t,il,e,Y0(e)),$v(V5,t)}}function X5(e,t,n){e==="focusin"?(Jv(),al=t,il=n,al.attachEvent("onpropertychange",ey)):e==="focusout"&&Jv()}function Z5(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Qu(il)}function K5(e,t){if(e==="click")return Qu(t)}function Q5(e,t){if(e==="input"||e==="change")return Qu(t)}function W5(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var jn=typeof Object.is=="function"?Object.is:W5;function ol(e,t){if(jn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var a=n[r];if(!N0.call(t,a)||!jn(e[a],t[a]))return!1}return!0}function ty(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ny(e,t){var n=ty(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=ty(n)}}function ry(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ry(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ay(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=qu(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=qu(e.document)}return t}function nh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var J5=na&&"documentMode"in document&&11>=document.documentMode,xo=null,rh=null,sl=null,ah=!1;function iy(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ah||xo==null||xo!==qu(r)||(r=xo,"selectionStart"in r&&nh(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),sl&&ol(sl,r)||(sl=r,r=kc(rh,"onSelect"),0<r.length&&(t=new Zu("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=xo)))}function Mi(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Eo={animationend:Mi("Animation","AnimationEnd"),animationiteration:Mi("Animation","AnimationIteration"),animationstart:Mi("Animation","AnimationStart"),transitionrun:Mi("Transition","TransitionRun"),transitionstart:Mi("Transition","TransitionStart"),transitioncancel:Mi("Transition","TransitionCancel"),transitionend:Mi("Transition","TransitionEnd")},ih={},oy={};na&&(oy=document.createElement("div").style,"AnimationEvent"in window||(delete Eo.animationend.animation,delete Eo.animationiteration.animation,delete Eo.animationstart.animation),"TransitionEvent"in window||delete Eo.transitionend.transition);function _i(e){if(ih[e])return ih[e];if(!Eo[e])return e;var t=Eo[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in oy)return ih[e]=t[n];return e}var sy=_i("animationend"),ly=_i("animationiteration"),uy=_i("animationstart"),e4=_i("transitionrun"),t4=_i("transitionstart"),n4=_i("transitioncancel"),cy=_i("transitionend"),fy=new Map,oh="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");oh.push("scrollEnd");function br(e,t){fy.set(e,t),Ci(t,[e])}var dy=new WeakMap;function rr(e,t){if(typeof e=="object"&&e!==null){var n=dy.get(e);return n!==void 0?n:(t={value:e,source:t,stack:Mv(t)},dy.set(e,t),t)}return{value:e,source:t,stack:Mv(t)}}var ar=[],Ao=0,sh=0;function Wu(){for(var e=Ao,t=sh=Ao=0;t<e;){var n=ar[t];ar[t++]=null;var r=ar[t];ar[t++]=null;var a=ar[t];ar[t++]=null;var i=ar[t];if(ar[t++]=null,r!==null&&a!==null){var o=r.pending;o===null?a.next=a:(a.next=o.next,o.next=a),r.pending=a}i!==0&&hy(n,a,i)}}function Ju(e,t,n,r){ar[Ao++]=e,ar[Ao++]=t,ar[Ao++]=n,ar[Ao++]=r,sh|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function lh(e,t,n,r){return Ju(e,t,n,r),ec(e)}function Co(e,t){return Ju(e,null,null,t),ec(e)}function hy(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var a=!1,i=e.return;i!==null;)i.childLanes|=n,r=i.alternate,r!==null&&(r.childLanes|=n),i.tag===22&&(e=i.stateNode,e===null||e._visibility&1||(a=!0)),e=i,i=i.return;return e.tag===3?(i=e.stateNode,a&&t!==null&&(a=31-Pn(n),e=i.hiddenUpdates,r=e[a],r===null?e[a]=[t]:r.push(t),t.lane=n|536870912),i):null}function ec(e){if(50<Bl)throw Bl=0,mm=null,Error(re(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var To={};function r4(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Hn(e,t,n,r){return new r4(e,t,n,r)}function uh(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ra(e,t){var n=e.alternate;return n===null?(n=Hn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function my(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function tc(e,t,n,r,a,i){var o=0;if(r=e,typeof e=="function")uh(e)&&(o=1);else if(typeof e=="string")o=i6(e,n,Rr.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case C0:return e=Hn(31,n,t,a),e.elementType=C0,e.lanes=i,e;case lo:return Ni(n.children,a,i,t);case fv:o=8,a|=24;break;case S0:return e=Hn(12,n,t,a|2),e.elementType=S0,e.lanes=i,e;case x0:return e=Hn(13,n,t,a),e.elementType=x0,e.lanes=i,e;case E0:return e=Hn(19,n,t,a),e.elementType=E0,e.lanes=i,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case VC:case ea:o=10;break e;case dv:o=9;break e;case w0:o=11;break e;case A0:o=14;break e;case Ba:o=16,r=null;break e}o=29,n=Error(re(130,e===null?"null":typeof e,"")),r=null}return t=Hn(o,n,t,a),t.elementType=e,t.type=r,t.lanes=i,t}function Ni(e,t,n,r){return e=Hn(7,e,r,t),e.lanes=n,e}function ch(e,t,n){return e=Hn(6,e,null,t),e.lanes=n,e}function fh(e,t,n){return t=Hn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Mo=[],_o=0,nc=null,rc=0,ir=[],or=0,Fi=null,aa=1,ia="";function Bi(e,t){Mo[_o++]=rc,Mo[_o++]=nc,nc=e,rc=t}function py(e,t,n){ir[or++]=aa,ir[or++]=ia,ir[or++]=Fi,Fi=e;var r=aa;e=ia;var a=32-Pn(r)-1;r&=~(1<<a),n+=1;var i=32-Pn(t)+a;if(30<i){var o=a-a%5;i=(r&(1<<o)-1).toString(32),r>>=o,a-=o,aa=1<<32-Pn(t)+a|n<<a|r,ia=i+e}else aa=1<<i|n<<a|r,ia=e}function dh(e){e.return!==null&&(Bi(e,1),py(e,1,0))}function hh(e){for(;e===nc;)nc=Mo[--_o],Mo[_o]=null,rc=Mo[--_o],Mo[_o]=null;for(;e===Fi;)Fi=ir[--or],ir[or]=null,ia=ir[--or],ir[or]=null,aa=ir[--or],ir[or]=null}var wn=null,Nt=null,Xe=!1,Oi=null,kr=!1,mh=Error(re(519));function Ri(e){var t=Error(re(418,""));throw cl(rr(t,e)),mh}function gy(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[fn]=e,t[Mn]=r,n){case"dialog":Ue("cancel",t),Ue("close",t);break;case"iframe":case"object":case"embed":Ue("load",t);break;case"video":case"audio":for(n=0;n<Rl.length;n++)Ue(Rl[n],t);break;case"source":Ue("error",t);break;case"img":case"image":case"link":Ue("error",t),Ue("load",t);break;case"details":Ue("toggle",t);break;case"input":Ue("invalid",t),Fv(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0),Hu(t);break;case"select":Ue("invalid",t);break;case"textarea":Ue("invalid",t),Ov(t,r.value,r.defaultValue,r.children),Hu(t)}n=r.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||r.suppressHydrationWarning===!0||O2(t.textContent,n)?(r.popover!=null&&(Ue("beforetoggle",t),Ue("toggle",t)),r.onScroll!=null&&Ue("scroll",t),r.onScrollEnd!=null&&Ue("scrollend",t),r.onClick!=null&&(t.onclick=$c),t=!0):t=!1,t||Ri(e)}function vy(e){for(wn=e.return;wn;)switch(wn.tag){case 5:case 13:kr=!1;return;case 27:case 3:kr=!0;return;default:wn=wn.return}}function ll(e){if(e!==wn)return!1;if(!Xe)return vy(e),Xe=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||Nm(e.type,e.memoizedProps)),n=!n),n&&Nt&&Ri(e),vy(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(re(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8)if(n=e.data,n==="/$"){if(t===0){Nt=Sr(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++;e=e.nextSibling}Nt=null}}else t===27?(t=Nt,Wa(e.type)?(e=Rm,Rm=null,Nt=e):Nt=t):Nt=wn?Sr(e.stateNode.nextSibling):null;return!0}function ul(){Nt=wn=null,Xe=!1}function yy(){var e=Oi;return e!==null&&(Bn===null?Bn=e:Bn.push.apply(Bn,e),Oi=null),e}function cl(e){Oi===null?Oi=[e]:Oi.push(e)}var ph=Or(null),zi=null,oa=null;function $a(e,t,n){wt(ph,t._currentValue),t._currentValue=n}function sa(e){e._currentValue=ph.current,Zt(ph)}function gh(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function vh(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var i=a.dependencies;if(i!==null){var o=a.child;i=i.firstContext;e:for(;i!==null;){var s=i;i=a;for(var l=0;l<t.length;l++)if(s.context===t[l]){i.lanes|=n,s=i.alternate,s!==null&&(s.lanes|=n),gh(i.return,n,e),r||(o=null);break e}i=s.next}}else if(a.tag===18){if(o=a.return,o===null)throw Error(re(341));o.lanes|=n,i=o.alternate,i!==null&&(i.lanes|=n),gh(o,n,e),o=null}else o=a.child;if(o!==null)o.return=a;else for(o=a;o!==null;){if(o===e){o=null;break}if(a=o.sibling,a!==null){a.return=o.return,o=a;break}o=o.return}a=o}}function fl(e,t,n,r){e=null;for(var a=t,i=!1;a!==null;){if(!i){if(a.flags&524288)i=!0;else if(a.flags&262144)break}if(a.tag===10){var o=a.alternate;if(o===null)throw Error(re(387));if(o=o.memoizedProps,o!==null){var s=a.type;jn(a.pendingProps.value,o.value)||(e!==null?e.push(s):e=[s])}}else if(a===Ru.current){if(o=a.alternate,o===null)throw Error(re(387));o.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e!==null?e.push(Ll):e=[Ll])}a=a.return}e!==null&&vh(t,e,n,r),t.flags|=262144}function ac(e){for(e=e.firstContext;e!==null;){if(!jn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ki(e){zi=e,oa=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function dn(e){return by(zi,e)}function ic(e,t){return zi===null&&ki(e),by(e,t)}function by(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},oa===null){if(e===null)throw Error(re(308));oa=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else oa=oa.next=t;return n}var a4=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,r){e.push(r)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},i4=Yt.unstable_scheduleCallback,o4=Yt.unstable_NormalPriority,Gt={$$typeof:ea,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function yh(){return{controller:new a4,data:new Map,refCount:0}}function dl(e){e.refCount--,e.refCount===0&&i4(o4,function(){e.controller.abort()})}var hl=null,bh=0,No=0,Fo=null;function s4(e,t){if(hl===null){var n=hl=[];bh=0,No=Sm(),Fo={status:"pending",value:void 0,then:function(r){n.push(r)}}}return bh++,t.then(Dy,Dy),t}function Dy(){if(--bh===0&&hl!==null){Fo!==null&&(Fo.status="fulfilled");var e=hl;hl=null,No=0,Fo=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function l4(e,t){var n=[],r={status:"pending",value:null,reason:null,then:function(a){n.push(a)}};return e.then(function(){r.status="fulfilled",r.value=t;for(var a=0;a<n.length;a++)(0,n[a])(t)},function(a){for(r.status="rejected",r.reason=a,a=0;a<n.length;a++)(0,n[a])(void 0)}),r}var Sy=Ce.S;Ce.S=function(e,t){typeof t=="object"&&t!==null&&typeof t.then=="function"&&s4(e,t),Sy!==null&&Sy(e,t)};var $i=Or(null);function Dh(){var e=$i.current;return e!==null?e:mt.pooledCache}function oc(e,t){t===null?wt($i,$i.current):wt($i,t.pool)}function wy(){var e=Dh();return e===null?null:{parent:Gt._currentValue,pool:e}}var ml=Error(re(460)),xy=Error(re(474)),sc=Error(re(542)),Sh={then:function(){}};function Ey(e){return e=e.status,e==="fulfilled"||e==="rejected"}function lc(){}function Ay(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(lc,lc),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ty(e),e;default:if(typeof t.status=="string")t.then(lc,lc);else{if(e=mt,e!==null&&100<e.shellSuspendCounter)throw Error(re(482));e=t,e.status="pending",e.then(function(r){if(t.status==="pending"){var a=t;a.status="fulfilled",a.value=r}},function(r){if(t.status==="pending"){var a=t;a.status="rejected",a.reason=r}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ty(e),e}throw pl=t,ml}}var pl=null;function Cy(){if(pl===null)throw Error(re(459));var e=pl;return pl=null,e}function Ty(e){if(e===ml||e===sc)throw Error(re(483))}var Ia=!1;function wh(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function xh(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ua(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function La(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Je&2){var a=r.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),r.pending=t,t=ec(e),hy(e,null,n),t}return Ju(e,r,t,n),ec(e)}function gl(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Dv(e,n)}}function Eh(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var a=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};i===null?a=i=o:i=i.next=o,n=n.next}while(n!==null);i===null?a=i=t:i=i.next=t}else a=i=t;n={baseState:r.baseState,firstBaseUpdate:a,lastBaseUpdate:i,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ah=!1;function vl(){if(Ah){var e=Fo;if(e!==null)throw e}}function yl(e,t,n,r){Ah=!1;var a=e.updateQueue;Ia=!1;var i=a.firstBaseUpdate,o=a.lastBaseUpdate,s=a.shared.pending;if(s!==null){a.shared.pending=null;var l=s,u=l.next;l.next=null,o===null?i=u:o.next=u,o=l;var c=e.alternate;c!==null&&(c=c.updateQueue,s=c.lastBaseUpdate,s!==o&&(s===null?c.firstBaseUpdate=u:s.next=u,c.lastBaseUpdate=l))}if(i!==null){var f=a.baseState;o=0,c=u=l=null,s=i;do{var d=s.lane&-536870913,h=d!==s.lane;if(h?(qe&d)===d:(r&d)===d){d!==0&&d===No&&(Ah=!0),c!==null&&(c=c.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});e:{var g=e,m=s;d=t;var D=n;switch(m.tag){case 1:if(g=m.payload,typeof g=="function"){f=g.call(D,f,d);break e}f=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=m.payload,d=typeof g=="function"?g.call(D,f,d):g,d==null)break e;f=vt({},f,d);break e;case 2:Ia=!0}}d=s.callback,d!==null&&(e.flags|=64,h&&(e.flags|=8192),h=a.callbacks,h===null?a.callbacks=[d]:h.push(d))}else h={lane:d,tag:s.tag,payload:s.payload,callback:s.callback,next:null},c===null?(u=c=h,l=f):c=c.next=h,o|=d;if(s=s.next,s===null){if(s=a.shared.pending,s===null)break;h=s,s=h.next,h.next=null,a.lastBaseUpdate=h,a.shared.pending=null}}while(!0);c===null&&(l=f),a.baseState=l,a.firstBaseUpdate=u,a.lastBaseUpdate=c,i===null&&(a.shared.lanes=0),Xa|=o,e.lanes=o,e.memoizedState=f}}function My(e,t){if(typeof e!="function")throw Error(re(191,e));e.call(t)}function _y(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)My(n[e],t)}var Bo=Or(null),uc=Or(0);function Ny(e,t){e=ma,wt(uc,e),wt(Bo,t),ma=e|t.baseLanes}function Ch(){wt(uc,ma),wt(Bo,Bo.current)}function Th(){ma=uc.current,Zt(Bo),Zt(uc)}var Pa=0,ze=null,it=null,Ut=null,cc=!1,Oo=!1,Ii=!1,fc=0,bl=0,Ro=null,u4=0;function zt(){throw Error(re(321))}function Mh(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!jn(e[n],t[n]))return!1;return!0}function _h(e,t,n,r,a,i){return Pa=i,ze=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ce.H=e===null||e.memoizedState===null?hb:mb,Ii=!1,i=n(r,a),Ii=!1,Oo&&(i=By(t,n,r,a)),Fy(e),i}function Fy(e){Ce.H=vc;var t=it!==null&&it.next!==null;if(Pa=0,Ut=it=ze=null,cc=!1,bl=0,Ro=null,t)throw Error(re(300));e===null||Qt||(e=e.dependencies,e!==null&&ac(e)&&(Qt=!0))}function By(e,t,n,r){ze=e;var a=0;do{if(Oo&&(Ro=null),bl=0,Oo=!1,25<=a)throw Error(re(301));if(a+=1,Ut=it=null,e.updateQueue!=null){var i=e.updateQueue;i.lastEffect=null,i.events=null,i.stores=null,i.memoCache!=null&&(i.memoCache.index=0)}Ce.H=g4,i=t(n,r)}while(Oo);return i}function c4(){var e=Ce.H,t=e.useState()[0];return t=typeof t.then=="function"?Dl(t):t,e=e.useState()[0],(it!==null?it.memoizedState:null)!==e&&(ze.flags|=1024),t}function Nh(){var e=fc!==0;return fc=0,e}function Fh(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Bh(e){if(cc){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}cc=!1}Pa=0,Ut=it=ze=null,Oo=!1,bl=fc=0,Ro=null}function Nn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ut===null?ze.memoizedState=Ut=e:Ut=Ut.next=e,Ut}function Lt(){if(it===null){var e=ze.alternate;e=e!==null?e.memoizedState:null}else e=it.next;var t=Ut===null?ze.memoizedState:Ut.next;if(t!==null)Ut=t,it=e;else{if(e===null)throw ze.alternate===null?Error(re(467)):Error(re(310));it=e,e={memoizedState:it.memoizedState,baseState:it.baseState,baseQueue:it.baseQueue,queue:it.queue,next:null},Ut===null?ze.memoizedState=Ut=e:Ut=Ut.next=e}return Ut}function Oh(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Dl(e){var t=bl;return bl+=1,Ro===null&&(Ro=[]),e=Ay(Ro,e,t),t=ze,(Ut===null?t.memoizedState:Ut.next)===null&&(t=t.alternate,Ce.H=t===null||t.memoizedState===null?hb:mb),e}function dc(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Dl(e);if(e.$$typeof===ea)return dn(e)}throw Error(re(438,String(e)))}function Rh(e){var t=null,n=ze.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=ze.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(a){return a.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=Oh(),ze.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=XC;return t.index++,n}function la(e,t){return typeof t=="function"?t(e):t}function hc(e){var t=Lt();return zh(t,it,e)}function zh(e,t,n){var r=e.queue;if(r===null)throw Error(re(311));r.lastRenderedReducer=n;var a=e.baseQueue,i=r.pending;if(i!==null){if(a!==null){var o=a.next;a.next=i.next,i.next=o}t.baseQueue=a=i,r.pending=null}if(i=e.baseState,a===null)e.memoizedState=i;else{t=a.next;var s=o=null,l=null,u=t,c=!1;do{var f=u.lane&-536870913;if(f!==u.lane?(qe&f)===f:(Pa&f)===f){var d=u.revertLane;if(d===0)l!==null&&(l=l.next={lane:0,revertLane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===No&&(c=!0);else if((Pa&d)===d){u=u.next,d===No&&(c=!0);continue}else f={lane:0,revertLane:u.revertLane,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(s=l=f,o=i):l=l.next=f,ze.lanes|=d,Xa|=d;f=u.action,Ii&&n(i,f),i=u.hasEagerState?u.eagerState:n(i,f)}else d={lane:f,revertLane:u.revertLane,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(s=l=d,o=i):l=l.next=d,ze.lanes|=f,Xa|=f;u=u.next}while(u!==null&&u!==t);if(l===null?o=i:l.next=s,!jn(i,e.memoizedState)&&(Qt=!0,c&&(n=Fo,n!==null)))throw n;e.memoizedState=i,e.baseState=o,e.baseQueue=l,r.lastRenderedState=i}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function kh(e){var t=Lt(),n=t.queue;if(n===null)throw Error(re(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,i=t.memoizedState;if(a!==null){n.pending=null;var o=a=a.next;do i=e(i,o.action),o=o.next;while(o!==a);jn(i,t.memoizedState)||(Qt=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function Oy(e,t,n){var r=ze,a=Lt(),i=Xe;if(i){if(n===void 0)throw Error(re(407));n=n()}else n=t();var o=!jn((it||a).memoizedState,n);o&&(a.memoizedState=n,Qt=!0),a=a.queue;var s=ky.bind(null,r,a,e);if(Sl(2048,8,s,[e]),a.getSnapshot!==t||o||Ut!==null&&Ut.memoizedState.tag&1){if(r.flags|=2048,zo(9,mc(),zy.bind(null,r,a,n,t),null),mt===null)throw Error(re(349));i||Pa&124||Ry(r,t,n)}return n}function Ry(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=ze.updateQueue,t===null?(t=Oh(),ze.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function zy(e,t,n,r){t.value=n,t.getSnapshot=r,$y(t)&&Iy(e)}function ky(e,t,n){return n(function(){$y(t)&&Iy(e)})}function $y(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!jn(e,n)}catch{return!0}}function Iy(e){var t=Co(e,2);t!==null&&Xn(t,e,2)}function $h(e){var t=Nn();if(typeof e=="function"){var n=e;if(e=n(),Ii){Ra(!0);try{n()}finally{Ra(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:la,lastRenderedState:e},t}function Uy(e,t,n,r){return e.baseState=n,zh(e,it,typeof r=="function"?r:la)}function f4(e,t,n,r,a){if(gc(e))throw Error(re(485));if(e=t.action,e!==null){var i={payload:a,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(o){i.listeners.push(o)}};Ce.T!==null?n(!0):i.isTransition=!1,r(i),n=t.pending,n===null?(i.next=t.pending=i,Ly(t,i)):(i.next=n.next,t.pending=n.next=i)}}function Ly(e,t){var n=t.action,r=t.payload,a=e.state;if(t.isTransition){var i=Ce.T,o={};Ce.T=o;try{var s=n(a,r),l=Ce.S;l!==null&&l(o,s),Py(e,t,s)}catch(u){Ih(e,t,u)}finally{Ce.T=i}}else try{i=n(a,r),Py(e,t,i)}catch(u){Ih(e,t,u)}}function Py(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(r){jy(e,t,r)},function(r){return Ih(e,t,r)}):jy(e,t,n)}function jy(e,t,n){t.status="fulfilled",t.value=n,Hy(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Ly(e,n)))}function Ih(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=n,Hy(t),t=t.next;while(t!==r)}e.action=null}function Hy(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function qy(e,t){return t}function Yy(e,t){if(Xe){var n=mt.formState;if(n!==null){e:{var r=ze;if(Xe){if(Nt){t:{for(var a=Nt,i=kr;a.nodeType!==8;){if(!i){a=null;break t}if(a=Sr(a.nextSibling),a===null){a=null;break t}}i=a.data,a=i==="F!"||i==="F"?a:null}if(a){Nt=Sr(a.nextSibling),r=a.data==="F!";break e}}Ri(r)}r=!1}r&&(t=n[0])}}return n=Nn(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:qy,lastRenderedState:t},n.queue=r,n=cb.bind(null,ze,r),r.dispatch=n,r=$h(!1),i=Hh.bind(null,ze,!1,r.queue),r=Nn(),a={state:t,dispatch:null,action:e,pending:null},r.queue=a,n=f4.bind(null,ze,a,i,n),a.dispatch=n,r.memoizedState=e,[t,n,!1]}function Gy(e){var t=Lt();return Vy(t,it,e)}function Vy(e,t,n){if(t=zh(e,t,qy)[0],e=hc(la)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=Dl(t)}catch(o){throw o===ml?sc:o}else r=t;t=Lt();var a=t.queue,i=a.dispatch;return n!==t.memoizedState&&(ze.flags|=2048,zo(9,mc(),d4.bind(null,a,n),null)),[r,i,e]}function d4(e,t){e.action=t}function Xy(e){var t=Lt(),n=it;if(n!==null)return Vy(t,n,e);Lt(),t=t.memoizedState,n=Lt();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function zo(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=ze.updateQueue,t===null&&(t=Oh(),ze.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function mc(){return{destroy:void 0,resource:void 0}}function Zy(){return Lt().memoizedState}function pc(e,t,n,r){var a=Nn();r=r===void 0?null:r,ze.flags|=e,a.memoizedState=zo(1|t,mc(),n,r)}function Sl(e,t,n,r){var a=Lt();r=r===void 0?null:r;var i=a.memoizedState.inst;it!==null&&r!==null&&Mh(r,it.memoizedState.deps)?a.memoizedState=zo(t,i,n,r):(ze.flags|=e,a.memoizedState=zo(1|t,i,n,r))}function Ky(e,t){pc(8390656,8,e,t)}function Qy(e,t){Sl(2048,8,e,t)}function Wy(e,t){return Sl(4,2,e,t)}function Jy(e,t){return Sl(4,4,e,t)}function eb(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function tb(e,t,n){n=n!=null?n.concat([e]):null,Sl(4,4,eb.bind(null,t,e),n)}function Uh(){}function nb(e,t){var n=Lt();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Mh(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function rb(e,t){var n=Lt();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Mh(t,r[1]))return r[0];if(r=e(),Ii){Ra(!0);try{e()}finally{Ra(!1)}}return n.memoizedState=[r,t],r}function Lh(e,t,n){return n===void 0||Pa&1073741824?e.memoizedState=t:(e.memoizedState=n,e=o2(),ze.lanes|=e,Xa|=e,n)}function ab(e,t,n,r){return jn(n,t)?n:Bo.current!==null?(e=Lh(e,n,r),jn(e,t)||(Qt=!0),e):Pa&42?(e=o2(),ze.lanes|=e,Xa|=e,t):(Qt=!0,e.memoizedState=n)}function ib(e,t,n,r,a){var i=Ve.p;Ve.p=i!==0&&8>i?i:8;var o=Ce.T,s={};Ce.T=s,Hh(e,!1,t,n);try{var l=a(),u=Ce.S;if(u!==null&&u(s,l),l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l4(l,r);wl(e,t,c,Vn(e))}else wl(e,t,r,Vn(e))}catch(f){wl(e,t,{then:function(){},status:"rejected",reason:f},Vn())}finally{Ve.p=i,Ce.T=o}}function h4(){}function Ph(e,t,n,r){if(e.tag!==5)throw Error(re(476));var a=ob(e).queue;ib(e,a,t,Ei,n===null?h4:function(){return sb(e),n(r)})}function ob(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Ei,baseState:Ei,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:la,lastRenderedState:Ei},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:la,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function sb(e){var t=ob(e).next.queue;wl(e,t,{},Vn())}function jh(){return dn(Ll)}function lb(){return Lt().memoizedState}function ub(){return Lt().memoizedState}function m4(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Vn();e=Ua(n);var r=La(t,e,n);r!==null&&(Xn(r,t,n),gl(r,t,n)),t={cache:yh()},e.payload=t;return}t=t.return}}function p4(e,t,n){var r=Vn();n={lane:r,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null},gc(e)?fb(t,n):(n=lh(e,t,n,r),n!==null&&(Xn(n,e,r),db(n,t,r)))}function cb(e,t,n){var r=Vn();wl(e,t,n,r)}function wl(e,t,n,r){var a={lane:r,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null};if(gc(e))fb(t,a);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,s=i(o,n);if(a.hasEagerState=!0,a.eagerState=s,jn(s,o))return Ju(e,t,a,0),mt===null&&Wu(),!1}catch{}finally{}if(n=lh(e,t,a,r),n!==null)return Xn(n,e,r),db(n,t,r),!0}return!1}function Hh(e,t,n,r){if(r={lane:2,revertLane:Sm(),action:r,hasEagerState:!1,eagerState:null,next:null},gc(e)){if(t)throw Error(re(479))}else t=lh(e,n,r,2),t!==null&&Xn(t,e,2)}function gc(e){var t=e.alternate;return e===ze||t!==null&&t===ze}function fb(e,t){Oo=cc=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function db(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Dv(e,n)}}var vc={readContext:dn,use:dc,useCallback:zt,useContext:zt,useEffect:zt,useImperativeHandle:zt,useLayoutEffect:zt,useInsertionEffect:zt,useMemo:zt,useReducer:zt,useRef:zt,useState:zt,useDebugValue:zt,useDeferredValue:zt,useTransition:zt,useSyncExternalStore:zt,useId:zt,useHostTransitionStatus:zt,useFormState:zt,useActionState:zt,useOptimistic:zt,useMemoCache:zt,useCacheRefresh:zt},hb={readContext:dn,use:dc,useCallback:function(e,t){return Nn().memoizedState=[e,t===void 0?null:t],e},useContext:dn,useEffect:Ky,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,pc(4194308,4,eb.bind(null,t,e),n)},useLayoutEffect:function(e,t){return pc(4194308,4,e,t)},useInsertionEffect:function(e,t){pc(4,2,e,t)},useMemo:function(e,t){var n=Nn();t=t===void 0?null:t;var r=e();if(Ii){Ra(!0);try{e()}finally{Ra(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Nn();if(n!==void 0){var a=n(t);if(Ii){Ra(!0);try{n(t)}finally{Ra(!1)}}}else a=t;return r.memoizedState=r.baseState=a,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:a},r.queue=e,e=e.dispatch=p4.bind(null,ze,e),[r.memoizedState,e]},useRef:function(e){var t=Nn();return e={current:e},t.memoizedState=e},useState:function(e){e=$h(e);var t=e.queue,n=cb.bind(null,ze,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Uh,useDeferredValue:function(e,t){var n=Nn();return Lh(n,e,t)},useTransition:function(){var e=$h(!1);return e=ib.bind(null,ze,e.queue,!0,!1),Nn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=ze,a=Nn();if(Xe){if(n===void 0)throw Error(re(407));n=n()}else{if(n=t(),mt===null)throw Error(re(349));qe&124||Ry(r,t,n)}a.memoizedState=n;var i={value:n,getSnapshot:t};return a.queue=i,Ky(ky.bind(null,r,i,e),[e]),r.flags|=2048,zo(9,mc(),zy.bind(null,r,i,n,t),null),n},useId:function(){var e=Nn(),t=mt.identifierPrefix;if(Xe){var n=ia,r=aa;n=(r&~(1<<32-Pn(r)-1)).toString(32)+n,t="«"+t+"R"+n,n=fc++,0<n&&(t+="H"+n.toString(32)),t+="»"}else n=u4++,t="«"+t+"r"+n.toString(32)+"»";return e.memoizedState=t},useHostTransitionStatus:jh,useFormState:Yy,useActionState:Yy,useOptimistic:function(e){var t=Nn();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Hh.bind(null,ze,!0,n),n.dispatch=t,[e,t]},useMemoCache:Rh,useCacheRefresh:function(){return Nn().memoizedState=m4.bind(null,ze)}},mb={readContext:dn,use:dc,useCallback:nb,useContext:dn,useEffect:Qy,useImperativeHandle:tb,useInsertionEffect:Wy,useLayoutEffect:Jy,useMemo:rb,useReducer:hc,useRef:Zy,useState:function(){return hc(la)},useDebugValue:Uh,useDeferredValue:function(e,t){var n=Lt();return ab(n,it.memoizedState,e,t)},useTransition:function(){var e=hc(la)[0],t=Lt().memoizedState;return[typeof e=="boolean"?e:Dl(e),t]},useSyncExternalStore:Oy,useId:lb,useHostTransitionStatus:jh,useFormState:Gy,useActionState:Gy,useOptimistic:function(e,t){var n=Lt();return Uy(n,it,e,t)},useMemoCache:Rh,useCacheRefresh:ub},g4={readContext:dn,use:dc,useCallback:nb,useContext:dn,useEffect:Qy,useImperativeHandle:tb,useInsertionEffect:Wy,useLayoutEffect:Jy,useMemo:rb,useReducer:kh,useRef:Zy,useState:function(){return kh(la)},useDebugValue:Uh,useDeferredValue:function(e,t){var n=Lt();return it===null?Lh(n,e,t):ab(n,it.memoizedState,e,t)},useTransition:function(){var e=kh(la)[0],t=Lt().memoizedState;return[typeof e=="boolean"?e:Dl(e),t]},useSyncExternalStore:Oy,useId:lb,useHostTransitionStatus:jh,useFormState:Xy,useActionState:Xy,useOptimistic:function(e,t){var n=Lt();return it!==null?Uy(n,it,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Rh,useCacheRefresh:ub},ko=null,xl=0;function yc(e){var t=xl;return xl+=1,ko===null&&(ko=[]),Ay(ko,e,t)}function El(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function bc(e,t){throw t.$$typeof===GC?Error(re(525)):(e=Object.prototype.toString.call(t),Error(re(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function pb(e){var t=e._init;return t(e._payload)}function gb(e){function t(p,v){if(e){var y=p.deletions;y===null?(p.deletions=[v],p.flags|=16):y.push(v)}}function n(p,v){if(!e)return null;for(;v!==null;)t(p,v),v=v.sibling;return null}function r(p){for(var v=new Map;p!==null;)p.key!==null?v.set(p.key,p):v.set(p.index,p),p=p.sibling;return v}function a(p,v){return p=ra(p,v),p.index=0,p.sibling=null,p}function i(p,v,y){return p.index=y,e?(y=p.alternate,y!==null?(y=y.index,y<v?(p.flags|=67108866,v):y):(p.flags|=67108866,v)):(p.flags|=1048576,v)}function o(p){return e&&p.alternate===null&&(p.flags|=67108866),p}function s(p,v,y,w){return v===null||v.tag!==6?(v=ch(y,p.mode,w),v.return=p,v):(v=a(v,y),v.return=p,v)}function l(p,v,y,w){var E=y.type;return E===lo?c(p,v,y.props.children,w,y.key):v!==null&&(v.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Ba&&pb(E)===v.type)?(v=a(v,y.props),El(v,y),v.return=p,v):(v=tc(y.type,y.key,y.props,null,p.mode,w),El(v,y),v.return=p,v)}function u(p,v,y,w){return v===null||v.tag!==4||v.stateNode.containerInfo!==y.containerInfo||v.stateNode.implementation!==y.implementation?(v=fh(y,p.mode,w),v.return=p,v):(v=a(v,y.children||[]),v.return=p,v)}function c(p,v,y,w,E){return v===null||v.tag!==7?(v=Ni(y,p.mode,w,E),v.return=p,v):(v=a(v,y),v.return=p,v)}function f(p,v,y){if(typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint")return v=ch(""+v,p.mode,y),v.return=p,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Ou:return y=tc(v.type,v.key,v.props,null,p.mode,y),El(y,v),y.return=p,y;case qs:return v=fh(v,p.mode,y),v.return=p,v;case Ba:var w=v._init;return v=w(v._payload),f(p,v,y)}if(Gs(v)||Ys(v))return v=Ni(v,p.mode,y,null),v.return=p,v;if(typeof v.then=="function")return f(p,yc(v),y);if(v.$$typeof===ea)return f(p,ic(p,v),y);bc(p,v)}return null}function d(p,v,y,w){var E=v!==null?v.key:null;if(typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint")return E!==null?null:s(p,v,""+y,w);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Ou:return y.key===E?l(p,v,y,w):null;case qs:return y.key===E?u(p,v,y,w):null;case Ba:return E=y._init,y=E(y._payload),d(p,v,y,w)}if(Gs(y)||Ys(y))return E!==null?null:c(p,v,y,w,null);if(typeof y.then=="function")return d(p,v,yc(y),w);if(y.$$typeof===ea)return d(p,v,ic(p,y),w);bc(p,y)}return null}function h(p,v,y,w,E){if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return p=p.get(y)||null,s(v,p,""+w,E);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Ou:return p=p.get(w.key===null?y:w.key)||null,l(v,p,w,E);case qs:return p=p.get(w.key===null?y:w.key)||null,u(v,p,w,E);case Ba:var b=w._init;return w=b(w._payload),h(p,v,y,w,E)}if(Gs(w)||Ys(w))return p=p.get(y)||null,c(v,p,w,E,null);if(typeof w.then=="function")return h(p,v,y,yc(w),E);if(w.$$typeof===ea)return h(p,v,y,ic(v,w),E);bc(v,w)}return null}function g(p,v,y,w){for(var E=null,b=null,S=v,A=v=0,C=null;S!==null&&A<y.length;A++){S.index>A?(C=S,S=null):C=S.sibling;var T=d(p,S,y[A],w);if(T===null){S===null&&(S=C);break}e&&S&&T.alternate===null&&t(p,S),v=i(T,v,A),b===null?E=T:b.sibling=T,b=T,S=C}if(A===y.length)return n(p,S),Xe&&Bi(p,A),E;if(S===null){for(;A<y.length;A++)S=f(p,y[A],w),S!==null&&(v=i(S,v,A),b===null?E=S:b.sibling=S,b=S);return Xe&&Bi(p,A),E}for(S=r(S);A<y.length;A++)C=h(S,p,A,y[A],w),C!==null&&(e&&C.alternate!==null&&S.delete(C.key===null?A:C.key),v=i(C,v,A),b===null?E=C:b.sibling=C,b=C);return e&&S.forEach(function(M){return t(p,M)}),Xe&&Bi(p,A),E}function m(p,v,y,w){if(y==null)throw Error(re(151));for(var E=null,b=null,S=v,A=v=0,C=null,T=y.next();S!==null&&!T.done;A++,T=y.next()){S.index>A?(C=S,S=null):C=S.sibling;var M=d(p,S,T.value,w);if(M===null){S===null&&(S=C);break}e&&S&&M.alternate===null&&t(p,S),v=i(M,v,A),b===null?E=M:b.sibling=M,b=M,S=C}if(T.done)return n(p,S),Xe&&Bi(p,A),E;if(S===null){for(;!T.done;A++,T=y.next())T=f(p,T.value,w),T!==null&&(v=i(T,v,A),b===null?E=T:b.sibling=T,b=T);return Xe&&Bi(p,A),E}for(S=r(S);!T.done;A++,T=y.next())T=h(S,p,A,T.value,w),T!==null&&(e&&T.alternate!==null&&S.delete(T.key===null?A:T.key),v=i(T,v,A),b===null?E=T:b.sibling=T,b=T);return e&&S.forEach(function(x){return t(p,x)}),Xe&&Bi(p,A),E}function D(p,v,y,w){if(typeof y=="object"&&y!==null&&y.type===lo&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case Ou:e:{for(var E=y.key;v!==null;){if(v.key===E){if(E=y.type,E===lo){if(v.tag===7){n(p,v.sibling),w=a(v,y.props.children),w.return=p,p=w;break e}}else if(v.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Ba&&pb(E)===v.type){n(p,v.sibling),w=a(v,y.props),El(w,y),w.return=p,p=w;break e}n(p,v);break}else t(p,v);v=v.sibling}y.type===lo?(w=Ni(y.props.children,p.mode,w,y.key),w.return=p,p=w):(w=tc(y.type,y.key,y.props,null,p.mode,w),El(w,y),w.return=p,p=w)}return o(p);case qs:e:{for(E=y.key;v!==null;){if(v.key===E)if(v.tag===4&&v.stateNode.containerInfo===y.containerInfo&&v.stateNode.implementation===y.implementation){n(p,v.sibling),w=a(v,y.children||[]),w.return=p,p=w;break e}else{n(p,v);break}else t(p,v);v=v.sibling}w=fh(y,p.mode,w),w.return=p,p=w}return o(p);case Ba:return E=y._init,y=E(y._payload),D(p,v,y,w)}if(Gs(y))return g(p,v,y,w);if(Ys(y)){if(E=Ys(y),typeof E!="function")throw Error(re(150));return y=E.call(y),m(p,v,y,w)}if(typeof y.then=="function")return D(p,v,yc(y),w);if(y.$$typeof===ea)return D(p,v,ic(p,y),w);bc(p,y)}return typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint"?(y=""+y,v!==null&&v.tag===6?(n(p,v.sibling),w=a(v,y),w.return=p,p=w):(n(p,v),w=ch(y,p.mode,w),w.return=p,p=w),o(p)):n(p,v)}return function(p,v,y,w){try{xl=0;var E=D(p,v,y,w);return ko=null,E}catch(S){if(S===ml||S===sc)throw S;var b=Hn(29,S,null,p.mode);return b.lanes=w,b.return=p,b}finally{}}}var $o=gb(!0),vb=gb(!1),sr=Or(null),$r=null;function ja(e){var t=e.alternate;wt(Vt,Vt.current&1),wt(sr,e),$r===null&&(t===null||Bo.current!==null||t.memoizedState!==null)&&($r=e)}function yb(e){if(e.tag===22){if(wt(Vt,Vt.current),wt(sr,e),$r===null){var t=e.alternate;t!==null&&t.memoizedState!==null&&($r=e)}}else Ha()}function Ha(){wt(Vt,Vt.current),wt(sr,sr.current)}function ua(e){Zt(sr),$r===e&&($r=null),Zt(Vt)}var Vt=Or(0);function Dc(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||Om(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function qh(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:vt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Yh={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Vn(),a=Ua(r);a.payload=t,n!=null&&(a.callback=n),t=La(e,a,r),t!==null&&(Xn(t,e,r),gl(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Vn(),a=Ua(r);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=La(e,a,r),t!==null&&(Xn(t,e,r),gl(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Vn(),r=Ua(n);r.tag=2,t!=null&&(r.callback=t),t=La(e,r,n),t!==null&&(Xn(t,e,n),gl(t,e,n))}};function bb(e,t,n,r,a,i,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,o):t.prototype&&t.prototype.isPureReactComponent?!ol(n,r)||!ol(a,i):!0}function Db(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Yh.enqueueReplaceState(t,t.state,null)}function Ui(e,t){var n=t;if("ref"in t){n={};for(var r in t)r!=="ref"&&(n[r]=t[r])}if(e=e.defaultProps){n===t&&(n=vt({},n));for(var a in e)n[a]===void 0&&(n[a]=e[a])}return n}var Sc=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)};function Sb(e){Sc(e)}function wb(e){console.error(e)}function xb(e){Sc(e)}function wc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function Eb(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(a){setTimeout(function(){throw a})}}function Gh(e,t,n){return n=Ua(n),n.tag=3,n.payload={element:null},n.callback=function(){wc(e,t)},n}function Ab(e){return e=Ua(e),e.tag=3,e}function Cb(e,t,n,r){var a=n.type.getDerivedStateFromError;if(typeof a=="function"){var i=r.value;e.payload=function(){return a(i)},e.callback=function(){Eb(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch=="function"&&(e.callback=function(){Eb(t,n,r),typeof a!="function"&&(Za===null?Za=new Set([this]):Za.add(this));var s=r.stack;this.componentDidCatch(r.value,{componentStack:s!==null?s:""})})}function v4(e,t,n,r,a){if(n.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=n.alternate,t!==null&&fl(t,n,a,!0),n=sr.current,n!==null){switch(n.tag){case 13:return $r===null?gm():n.alternate===null&&Ft===0&&(Ft=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Sh?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),ym(e,r,a)),!1;case 22:return n.flags|=65536,r===Sh?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),ym(e,r,a)),!1}throw Error(re(435,n.tag))}return ym(e,r,a),gm(),!1}if(Xe)return t=sr.current,t!==null?(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==mh&&(e=Error(re(422),{cause:r}),cl(rr(e,n)))):(r!==mh&&(t=Error(re(423),{cause:r}),cl(rr(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=rr(r,n),a=Gh(e.stateNode,r,a),Eh(e,a),Ft!==4&&(Ft=2)),!1;var i=Error(re(520),{cause:r});if(i=rr(i,n),Fl===null?Fl=[i]:Fl.push(i),Ft!==4&&(Ft=2),t===null)return!0;r=rr(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Gh(n.stateNode,r,e),Eh(n,e),!1;case 1:if(t=n.type,i=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||i!==null&&typeof i.componentDidCatch=="function"&&(Za===null||!Za.has(i))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Ab(a),Cb(a,e,n,r),Eh(n,a),!1}n=n.return}while(n!==null);return!1}var Tb=Error(re(461)),Qt=!1;function rn(e,t,n,r){t.child=e===null?vb(t,null,n,r):$o(t,e.child,n,r)}function Mb(e,t,n,r,a){n=n.render;var i=t.ref;if("ref"in r){var o={};for(var s in r)s!=="ref"&&(o[s]=r[s])}else o=r;return ki(t),r=_h(e,t,n,o,i,a),s=Nh(),e!==null&&!Qt?(Fh(e,t,a),ca(e,t,a)):(Xe&&s&&dh(t),t.flags|=1,rn(e,t,r,a),t.child)}function _b(e,t,n,r,a){if(e===null){var i=n.type;return typeof i=="function"&&!uh(i)&&i.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=i,Nb(e,t,i,r,a)):(e=tc(n.type,null,r,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!em(e,a)){var o=i.memoizedProps;if(n=n.compare,n=n!==null?n:ol,n(o,r)&&e.ref===t.ref)return ca(e,t,a)}return t.flags|=1,e=ra(i,r),e.ref=t.ref,e.return=t,t.child=e}function Nb(e,t,n,r,a){if(e!==null){var i=e.memoizedProps;if(ol(i,r)&&e.ref===t.ref)if(Qt=!1,t.pendingProps=r=i,em(e,a))e.flags&131072&&(Qt=!0);else return t.lanes=e.lanes,ca(e,t,a)}return Vh(e,t,n,r,a)}function Fb(e,t,n){var r=t.pendingProps,a=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden"){if(t.flags&128){if(r=i!==null?i.baseLanes|n:n,e!==null){for(a=t.child=e.child,i=0;a!==null;)i=i|a.lanes|a.childLanes,a=a.sibling;t.childLanes=i&~r}else t.childLanes=0,t.child=null;return Bb(e,t,r,n)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&oc(t,i!==null?i.cachePool:null),i!==null?Ny(t,i):Ch(),yb(t);else return t.lanes=t.childLanes=536870912,Bb(e,t,i!==null?i.baseLanes|n:n,n)}else i!==null?(oc(t,i.cachePool),Ny(t,i),Ha(),t.memoizedState=null):(e!==null&&oc(t,null),Ch(),Ha());return rn(e,t,a,n),t.child}function Bb(e,t,n,r){var a=Dh();return a=a===null?null:{parent:Gt._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&oc(t,null),Ch(),yb(t),e!==null&&fl(e,t,r,!0),null}function xc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(re(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Vh(e,t,n,r,a){return ki(t),n=_h(e,t,n,r,void 0,a),r=Nh(),e!==null&&!Qt?(Fh(e,t,a),ca(e,t,a)):(Xe&&r&&dh(t),t.flags|=1,rn(e,t,n,a),t.child)}function Ob(e,t,n,r,a,i){return ki(t),t.updateQueue=null,n=By(t,r,n,a),Fy(e),r=Nh(),e!==null&&!Qt?(Fh(e,t,i),ca(e,t,i)):(Xe&&r&&dh(t),t.flags|=1,rn(e,t,n,i),t.child)}function Rb(e,t,n,r,a){if(ki(t),t.stateNode===null){var i=To,o=n.contextType;typeof o=="object"&&o!==null&&(i=dn(o)),i=new n(r,i),t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=Yh,t.stateNode=i,i._reactInternals=t,i=t.stateNode,i.props=r,i.state=t.memoizedState,i.refs={},wh(t),o=n.contextType,i.context=typeof o=="object"&&o!==null?dn(o):To,i.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o=="function"&&(qh(t,n,o,r),i.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(o=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),o!==i.state&&Yh.enqueueReplaceState(i,i.state,null),yl(t,r,i,a),vl(),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308),r=!0}else if(e===null){i=t.stateNode;var s=t.memoizedProps,l=Ui(n,s);i.props=l;var u=i.context,c=n.contextType;o=To,typeof c=="object"&&c!==null&&(o=dn(c));var f=n.getDerivedStateFromProps;c=typeof f=="function"||typeof i.getSnapshotBeforeUpdate=="function",s=t.pendingProps!==s,c||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(s||u!==o)&&Db(t,i,r,o),Ia=!1;var d=t.memoizedState;i.state=d,yl(t,r,i,a),vl(),u=t.memoizedState,s||d!==u||Ia?(typeof f=="function"&&(qh(t,n,f,r),u=t.memoizedState),(l=Ia||bb(t,n,l,r,d,u,o))?(c||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=u),i.props=r,i.state=u,i.context=o,r=l):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{i=t.stateNode,xh(e,t),o=t.memoizedProps,c=Ui(n,o),i.props=c,f=t.pendingProps,d=i.context,u=n.contextType,l=To,typeof u=="object"&&u!==null&&(l=dn(u)),s=n.getDerivedStateFromProps,(u=typeof s=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(o!==f||d!==l)&&Db(t,i,r,l),Ia=!1,d=t.memoizedState,i.state=d,yl(t,r,i,a),vl();var h=t.memoizedState;o!==f||d!==h||Ia||e!==null&&e.dependencies!==null&&ac(e.dependencies)?(typeof s=="function"&&(qh(t,n,s,r),h=t.memoizedState),(c=Ia||bb(t,n,c,r,d,h,l)||e!==null&&e.dependencies!==null&&ac(e.dependencies))?(u||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(r,h,l),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(r,h,l)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=h),i.props=r,i.state=h,i.context=l,r=c):(typeof i.componentDidUpdate!="function"||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),r=!1)}return i=r,xc(e,t),r=(t.flags&128)!==0,i||r?(i=t.stateNode,n=r&&typeof n.getDerivedStateFromError!="function"?null:i.render(),t.flags|=1,e!==null&&r?(t.child=$o(t,e.child,null,a),t.child=$o(t,null,n,a)):rn(e,t,n,a),t.memoizedState=i.state,e=t.child):e=ca(e,t,a),e}function zb(e,t,n,r){return ul(),t.flags|=256,rn(e,t,n,r),t.child}var Xh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Zh(e){return{baseLanes:e,cachePool:wy()}}function Kh(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=lr),e}function kb(e,t,n){var r=t.pendingProps,a=!1,i=(t.flags&128)!==0,o;if((o=i)||(o=e!==null&&e.memoizedState===null?!1:(Vt.current&2)!==0),o&&(a=!0,t.flags&=-129),o=(t.flags&32)!==0,t.flags&=-33,e===null){if(Xe){if(a?ja(t):Ha(),Xe){var s=Nt,l;if(l=s){e:{for(l=s,s=kr;l.nodeType!==8;){if(!s){s=null;break e}if(l=Sr(l.nextSibling),l===null){s=null;break e}}s=l}s!==null?(t.memoizedState={dehydrated:s,treeContext:Fi!==null?{id:aa,overflow:ia}:null,retryLane:536870912,hydrationErrors:null},l=Hn(18,null,null,0),l.stateNode=s,l.return=t,t.child=l,wn=t,Nt=null,l=!0):l=!1}l||Ri(t)}if(s=t.memoizedState,s!==null&&(s=s.dehydrated,s!==null))return Om(s)?t.lanes=32:t.lanes=536870912,null;ua(t)}return s=r.children,r=r.fallback,a?(Ha(),a=t.mode,s=Ec({mode:"hidden",children:s},a),r=Ni(r,a,n,null),s.return=t,r.return=t,s.sibling=r,t.child=s,a=t.child,a.memoizedState=Zh(n),a.childLanes=Kh(e,o,n),t.memoizedState=Xh,r):(ja(t),Qh(t,s))}if(l=e.memoizedState,l!==null&&(s=l.dehydrated,s!==null)){if(i)t.flags&256?(ja(t),t.flags&=-257,t=Wh(e,t,n)):t.memoizedState!==null?(Ha(),t.child=e.child,t.flags|=128,t=null):(Ha(),a=r.fallback,s=t.mode,r=Ec({mode:"visible",children:r.children},s),a=Ni(a,s,n,null),a.flags|=2,r.return=t,a.return=t,r.sibling=a,t.child=r,$o(t,e.child,null,n),r=t.child,r.memoizedState=Zh(n),r.childLanes=Kh(e,o,n),t.memoizedState=Xh,t=a);else if(ja(t),Om(s)){if(o=s.nextSibling&&s.nextSibling.dataset,o)var u=o.dgst;o=u,r=Error(re(419)),r.stack="",r.digest=o,cl({value:r,source:null,stack:null}),t=Wh(e,t,n)}else if(Qt||fl(e,t,n,!1),o=(n&e.childLanes)!==0,Qt||o){if(o=mt,o!==null&&(r=n&-n,r=r&42?1:R0(r),r=r&(o.suspendedLanes|n)?0:r,r!==0&&r!==l.retryLane))throw l.retryLane=r,Co(e,r),Xn(o,e,r),Tb;s.data==="$?"||gm(),t=Wh(e,t,n)}else s.data==="$?"?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Nt=Sr(s.nextSibling),wn=t,Xe=!0,Oi=null,kr=!1,e!==null&&(ir[or++]=aa,ir[or++]=ia,ir[or++]=Fi,aa=e.id,ia=e.overflow,Fi=t),t=Qh(t,r.children),t.flags|=4096);return t}return a?(Ha(),a=r.fallback,s=t.mode,l=e.child,u=l.sibling,r=ra(l,{mode:"hidden",children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u!==null?a=ra(u,a):(a=Ni(a,s,n,null),a.flags|=2),a.return=t,r.return=t,r.sibling=a,t.child=r,r=a,a=t.child,s=e.child.memoizedState,s===null?s=Zh(n):(l=s.cachePool,l!==null?(u=Gt._currentValue,l=l.parent!==u?{parent:u,pool:u}:l):l=wy(),s={baseLanes:s.baseLanes|n,cachePool:l}),a.memoizedState=s,a.childLanes=Kh(e,o,n),t.memoizedState=Xh,r):(ja(t),n=e.child,e=n.sibling,n=ra(n,{mode:"visible",children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function Qh(e,t){return t=Ec({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Ec(e,t){return e=Hn(22,e,null,t),e.lanes=0,e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},e}function Wh(e,t,n){return $o(t,e.child,null,n),e=Qh(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function $b(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),gh(e.return,t,n)}function Jh(e,t,n,r,a){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:a}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=a)}function Ib(e,t,n){var r=t.pendingProps,a=r.revealOrder,i=r.tail;if(rn(e,t,r.children,n),r=Vt.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&$b(e,n,t);else if(e.tag===19)$b(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}switch(wt(Vt,r),a){case"forwards":for(n=t.child,a=null;n!==null;)e=n.alternate,e!==null&&Dc(e)===null&&(a=n),n=n.sibling;n=a,n===null?(a=t.child,t.child=null):(a=n.sibling,n.sibling=null),Jh(t,!1,a,n,i);break;case"backwards":for(n=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&Dc(e)===null){t.child=a;break}e=a.sibling,a.sibling=n,n=a,a=e}Jh(t,!0,n,null,i);break;case"together":Jh(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ca(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Xa|=t.lanes,!(n&t.childLanes))if(e!==null){if(fl(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(re(153));if(t.child!==null){for(e=t.child,n=ra(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ra(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function em(e,t){return e.lanes&t?!0:(e=e.dependencies,!!(e!==null&&ac(e)))}function y4(e,t,n){switch(t.tag){case 3:zu(t,t.stateNode.containerInfo),$a(t,Gt,e.memoizedState.cache),ul();break;case 27:case 5:_0(t);break;case 4:zu(t,t.stateNode.containerInfo);break;case 10:$a(t,t.type,t.memoizedProps.value);break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated!==null?(ja(t),t.flags|=128,null):n&t.child.childLanes?kb(e,t,n):(ja(t),e=ca(e,t,n),e!==null?e.sibling:null);ja(t);break;case 19:var a=(e.flags&128)!==0;if(r=(n&t.childLanes)!==0,r||(fl(e,t,n,!1),r=(n&t.childLanes)!==0),a){if(r)return Ib(e,t,n);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),wt(Vt,Vt.current),r)break;return null;case 22:case 23:return t.lanes=0,Fb(e,t,n);case 24:$a(t,Gt,e.memoizedState.cache)}return ca(e,t,n)}function Ub(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Qt=!0;else{if(!em(e,n)&&!(t.flags&128))return Qt=!1,y4(e,t,n);Qt=!!(e.flags&131072)}else Qt=!1,Xe&&t.flags&1048576&&py(t,rc,t.index);switch(t.lanes=0,t.tag){case 16:e:{e=t.pendingProps;var r=t.elementType,a=r._init;if(r=a(r._payload),t.type=r,typeof r=="function")uh(r)?(e=Ui(r,e),t.tag=1,t=Rb(null,t,r,e,n)):(t.tag=0,t=Vh(null,t,r,e,n));else{if(r!=null){if(a=r.$$typeof,a===w0){t.tag=11,t=Mb(null,t,r,e,n);break e}else if(a===A0){t.tag=14,t=_b(null,t,r,e,n);break e}}throw t=T0(r)||r,Error(re(306,t,""))}}return t;case 0:return Vh(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Ui(r,t.pendingProps),Rb(e,t,r,a,n);case 3:e:{if(zu(t,t.stateNode.containerInfo),e===null)throw Error(re(387));r=t.pendingProps;var i=t.memoizedState;a=i.element,xh(e,t),yl(t,r,null,n);var o=t.memoizedState;if(r=o.cache,$a(t,Gt,r),r!==i.cache&&vh(t,[Gt],n,!0),vl(),r=o.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:o.cache},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){t=zb(e,t,r,n);break e}else if(r!==a){a=rr(Error(re(424)),t),cl(a),t=zb(e,t,r,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Nt=Sr(e.firstChild),wn=t,Xe=!0,Oi=null,kr=!0,n=vb(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(ul(),r===a){t=ca(e,t,n);break e}rn(e,t,r,n)}t=t.child}return t;case 26:return xc(e,t),e===null?(n=H2(t.type,null,t.pendingProps,null))?t.memoizedState=n:Xe||(n=t.type,e=t.pendingProps,r=Ic(Oa.current).createElement(n),r[fn]=t,r[Mn]=e,on(r,n,e),Kt(r),t.stateNode=r):t.memoizedState=H2(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return _0(t),e===null&&Xe&&(r=t.stateNode=L2(t.type,t.pendingProps,Oa.current),wn=t,kr=!0,a=Nt,Wa(t.type)?(Rm=a,Nt=Sr(r.firstChild)):Nt=a),rn(e,t,t.pendingProps.children,n),xc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Xe&&((a=r=Nt)&&(r=G4(r,t.type,t.pendingProps,kr),r!==null?(t.stateNode=r,wn=t,Nt=Sr(r.firstChild),kr=!1,a=!0):a=!1),a||Ri(t)),_0(t),a=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,r=i.children,Nm(a,i)?r=null:o!==null&&Nm(a,o)&&(t.flags|=32),t.memoizedState!==null&&(a=_h(e,t,c4,null,null,n),Ll._currentValue=a),xc(e,t),rn(e,t,r,n),t.child;case 6:return e===null&&Xe&&((e=n=Nt)&&(n=V4(n,t.pendingProps,kr),n!==null?(t.stateNode=n,wn=t,Nt=null,e=!0):e=!1),e||Ri(t)),null;case 13:return kb(e,t,n);case 4:return zu(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=$o(t,null,r,n):rn(e,t,r,n),t.child;case 11:return Mb(e,t,t.type,t.pendingProps,n);case 7:return rn(e,t,t.pendingProps,n),t.child;case 8:return rn(e,t,t.pendingProps.children,n),t.child;case 12:return rn(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,$a(t,t.type,r.value),rn(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,ki(t),a=dn(a),r=r(a),t.flags|=1,rn(e,t,r,n),t.child;case 14:return _b(e,t,t.type,t.pendingProps,n);case 15:return Nb(e,t,t.type,t.pendingProps,n);case 19:return Ib(e,t,n);case 31:return r=t.pendingProps,n=t.mode,r={mode:r.mode,children:r.children},e===null?(n=Ec(r,n),n.ref=t.ref,t.child=n,n.return=t,t=n):(n=ra(e.child,r),n.ref=t.ref,t.child=n,n.return=t,t=n),t;case 22:return Fb(e,t,n);case 24:return ki(t),r=dn(Gt),e===null?(a=Dh(),a===null&&(a=mt,i=yh(),a.pooledCache=i,i.refCount++,i!==null&&(a.pooledCacheLanes|=n),a=i),t.memoizedState={parent:r,cache:a},wh(t),$a(t,Gt,a)):(e.lanes&n&&(xh(e,t),yl(t,null,null,n),vl()),a=e.memoizedState,i=t.memoizedState,a.parent!==r?(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),$a(t,Gt,r)):(r=i.cache,$a(t,Gt,r),r!==a.cache&&vh(t,[Gt],n,!0))),rn(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(re(156,t.tag))}function fa(e){e.flags|=4}function Lb(e,t){if(t.type!=="stylesheet"||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!X2(t)){if(t=sr.current,t!==null&&((qe&4194048)===qe?$r!==null:(qe&62914560)!==qe&&!(qe&536870912)||t!==$r))throw pl=Sh,xy;e.flags|=8192}}function Ac(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?yv():536870912,e.lanes|=t,Po|=t)}function Al(e,t){if(!Xe)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Tt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var a=e.child;a!==null;)n|=a.lanes|a.childLanes,r|=a.subtreeFlags&65011712,r|=a.flags&65011712,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)n|=a.lanes|a.childLanes,r|=a.subtreeFlags,r|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function b4(e,t,n){var r=t.pendingProps;switch(hh(t),t.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Tt(t),null;case 1:return Tt(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),sa(Gt),co(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ll(t)?fa(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,yy())),Tt(t),null;case 26:return n=t.memoizedState,e===null?(fa(t),n!==null?(Tt(t),Lb(t,n)):(Tt(t),t.flags&=-16777217)):n?n!==e.memoizedState?(fa(t),Tt(t),Lb(t,n)):(Tt(t),t.flags&=-16777217):(e.memoizedProps!==r&&fa(t),Tt(t),t.flags&=-16777217),null;case 27:ku(t),n=Oa.current;var a=t.type;if(e!==null&&t.stateNode!=null)e.memoizedProps!==r&&fa(t);else{if(!r){if(t.stateNode===null)throw Error(re(166));return Tt(t),null}e=Rr.current,ll(t)?gy(t):(e=L2(a,r,n),t.stateNode=e,fa(t))}return Tt(t),null;case 5:if(ku(t),n=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&fa(t);else{if(!r){if(t.stateNode===null)throw Error(re(166));return Tt(t),null}if(e=Rr.current,ll(t))gy(t);else{switch(a=Ic(Oa.current),e){case 1:e=a.createElementNS("http://www.w3.org/2000/svg",n);break;case 2:e=a.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;default:switch(n){case"svg":e=a.createElementNS("http://www.w3.org/2000/svg",n);break;case"math":e=a.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;case"script":e=a.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild);break;case"select":e=typeof r.is=="string"?a.createElement("select",{is:r.is}):a.createElement("select"),r.multiple?e.multiple=!0:r.size&&(e.size=r.size);break;default:e=typeof r.is=="string"?a.createElement(n,{is:r.is}):a.createElement(n)}}e[fn]=t,e[Mn]=r;e:for(a=t.child;a!==null;){if(a.tag===5||a.tag===6)e.appendChild(a.stateNode);else if(a.tag!==4&&a.tag!==27&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===t)break e;for(;a.sibling===null;){if(a.return===null||a.return===t)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}t.stateNode=e;e:switch(on(e,n,r),n){case"button":case"input":case"select":case"textarea":e=!!r.autoFocus;break e;case"img":e=!0;break e;default:e=!1}e&&fa(t)}}return Tt(t),t.flags&=-16777217,null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&fa(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(re(166));if(e=Oa.current,ll(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=wn,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[fn]=t,e=!!(e.nodeValue===n||r!==null&&r.suppressHydrationWarning===!0||O2(e.nodeValue,n)),e||Ri(t)}else e=Ic(e).createTextNode(r),e[fn]=t,t.stateNode=e}return Tt(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=ll(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(re(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(re(317));a[fn]=t}else ul(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Tt(t),a=!1}else a=yy(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(ua(t),t):(ua(t),null)}if(ua(t),t.flags&128)return t.lanes=n,t;if(n=r!==null,e=e!==null&&e.memoizedState!==null,n){r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool);var i=null;r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(i=r.memoizedState.cachePool.pool),i!==a&&(r.flags|=2048)}return n!==e&&n&&(t.child.flags|=8192),Ac(t,t.updateQueue),Tt(t),null;case 4:return co(),e===null&&Am(t.stateNode.containerInfo),Tt(t),null;case 10:return sa(t.type),Tt(t),null;case 19:if(Zt(Vt),a=t.memoizedState,a===null)return Tt(t),null;if(r=(t.flags&128)!==0,i=a.rendering,i===null)if(r)Al(a,!1);else{if(Ft!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=Dc(e),i!==null){for(t.flags|=128,Al(a,!1),e=i.updateQueue,t.updateQueue=e,Ac(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)my(n,e),n=n.sibling;return wt(Vt,Vt.current&1|2),t.child}e=e.sibling}a.tail!==null&&zr()>Mc&&(t.flags|=128,r=!0,Al(a,!1),t.lanes=4194304)}else{if(!r)if(e=Dc(i),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,Ac(t,e),Al(a,!0),a.tail===null&&a.tailMode==="hidden"&&!i.alternate&&!Xe)return Tt(t),null}else 2*zr()-a.renderingStartTime>Mc&&n!==536870912&&(t.flags|=128,r=!0,Al(a,!1),t.lanes=4194304);a.isBackwards?(i.sibling=t.child,t.child=i):(e=a.last,e!==null?e.sibling=i:t.child=i,a.last=i)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=zr(),t.sibling=null,e=Vt.current,wt(Vt,r?e&1|2:e&1),t):(Tt(t),null);case 22:case 23:return ua(t),Th(),r=t.memoizedState!==null,e!==null?e.memoizedState!==null!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Tt(t),t.subtreeFlags&6&&(t.flags|=8192)):Tt(t),n=t.updateQueue,n!==null&&Ac(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&Zt($i),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),sa(Gt),Tt(t),null;case 25:return null;case 30:return null}throw Error(re(156,t.tag))}function D4(e,t){switch(hh(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return sa(Gt),co(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ku(t),null;case 13:if(ua(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(re(340));ul()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Zt(Vt),null;case 4:return co(),null;case 10:return sa(t.type),null;case 22:case 23:return ua(t),Th(),e!==null&&Zt($i),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return sa(Gt),null;case 25:return null;default:return null}}function Pb(e,t){switch(hh(t),t.tag){case 3:sa(Gt),co();break;case 26:case 27:case 5:ku(t);break;case 4:co();break;case 13:ua(t);break;case 19:Zt(Vt);break;case 10:sa(t.type);break;case 22:case 23:ua(t),Th(),e!==null&&Zt($i);break;case 24:sa(Gt)}}function Cl(e,t){try{var n=t.updateQueue,r=n!==null?n.lastEffect:null;if(r!==null){var a=r.next;n=a;do{if((n.tag&e)===e){r=void 0;var i=n.create,o=n.inst;r=i(),o.destroy=r}n=n.next}while(n!==a)}}catch(s){ut(t,t.return,s)}}function qa(e,t,n){try{var r=t.updateQueue,a=r!==null?r.lastEffect:null;if(a!==null){var i=a.next;r=i;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,a=t;var l=n,u=s;try{u()}catch(c){ut(a,l,c)}}}r=r.next}while(r!==i)}}catch(c){ut(t,t.return,c)}}function jb(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{_y(t,n)}catch(r){ut(e,e.return,r)}}}function Hb(e,t,n){n.props=Ui(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(r){ut(e,t,r)}}function Tl(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n=="function"?e.refCleanup=n(r):n.current=r}}catch(a){ut(e,t,a)}}function Ir(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r=="function")try{r()}catch(a){ut(e,t,a)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(a){ut(e,t,a)}else n.current=null}function qb(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&r.focus();break e;case"img":n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(a){ut(e,e.return,a)}}function tm(e,t,n){try{var r=e.stateNode;P4(r,e.type,n,t),r[Mn]=t}catch(a){ut(e,e.return,a)}}function Yb(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Wa(e.type)||e.tag===4}function nm(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Yb(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Wa(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function rm(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=$c));else if(r!==4&&(r===27&&Wa(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(rm(e,t,n),e=e.sibling;e!==null;)rm(e,t,n),e=e.sibling}function Cc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Wa(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Cc(e,t,n),e=e.sibling;e!==null;)Cc(e,t,n),e=e.sibling}function Gb(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,a=t.attributes;a.length;)t.removeAttributeNode(a[0]);on(t,r,n),t[fn]=e,t[Mn]=n}catch(i){ut(e,e.return,i)}}var da=!1,kt=!1,am=!1,Vb=typeof WeakSet=="function"?WeakSet:Set,Wt=null;function S4(e,t){if(e=e.containerInfo,Mm=qc,e=ay(e),nh(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var o=0,s=-1,l=-1,u=0,c=0,f=e,d=null;t:for(;;){for(var h;f!==n||a!==0&&f.nodeType!==3||(s=o+a),f!==i||r!==0&&f.nodeType!==3||(l=o+r),f.nodeType===3&&(o+=f.nodeValue.length),(h=f.firstChild)!==null;)d=f,f=h;for(;;){if(f===e)break t;if(d===n&&++u===a&&(s=o),d===i&&++c===r&&(l=o),(h=f.nextSibling)!==null)break;f=d,d=f.parentNode}f=h}n=s===-1||l===-1?null:{start:s,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(_m={focusedElem:e,selectionRange:n},qc=!1,Wt=t;Wt!==null;)if(t=Wt,e=t.child,(t.subtreeFlags&1024)!==0&&e!==null)e.return=t,Wt=e;else for(;Wt!==null;){switch(t=Wt,i=t.alternate,e=t.flags,t.tag){case 0:break;case 11:case 15:break;case 1:if(e&1024&&i!==null){e=void 0,n=t,a=i.memoizedProps,i=i.memoizedState,r=n.stateNode;try{var g=Ui(n.type,a,n.elementType===n.type);e=r.getSnapshotBeforeUpdate(g,i),r.__reactInternalSnapshotBeforeUpdate=e}catch(m){ut(n,n.return,m)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)Bm(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Bm(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(re(163))}if(e=t.sibling,e!==null){e.return=t.return,Wt=e;break}Wt=t.return}}function Xb(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Ya(e,n),r&4&&Cl(5,n);break;case 1:if(Ya(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(o){ut(n,n.return,o)}else{var a=Ui(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(a,t,e.__reactInternalSnapshotBeforeUpdate)}catch(o){ut(n,n.return,o)}}r&64&&jb(n),r&512&&Tl(n,n.return);break;case 3:if(Ya(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{_y(e,t)}catch(o){ut(n,n.return,o)}}break;case 27:t===null&&r&4&&Gb(n);case 26:case 5:Ya(e,n),t===null&&r&4&&qb(n),r&512&&Tl(n,n.return);break;case 12:Ya(e,n);break;case 13:Ya(e,n),r&4&&Qb(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=N4.bind(null,n),X4(e,n))));break;case 22:if(r=n.memoizedState!==null||da,!r){t=t!==null&&t.memoizedState!==null||kt,a=da;var i=kt;da=r,(kt=t)&&!i?Ga(e,n,(n.subtreeFlags&8772)!==0):Ya(e,n),da=a,kt=i}break;case 30:break;default:Ya(e,n)}}function Zb(e){var t=e.alternate;t!==null&&(e.alternate=null,Zb(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&$0(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var xt=null,Fn=!1;function ha(e,t,n){for(n=n.child;n!==null;)Kb(e,t,n),n=n.sibling}function Kb(e,t,n){if(Ln&&typeof Ln.onCommitFiberUnmount=="function")try{Ln.onCommitFiberUnmount(Xs,n)}catch{}switch(n.tag){case 26:kt||Ir(n,t),ha(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:kt||Ir(n,t);var r=xt,a=Fn;Wa(n.type)&&(xt=n.stateNode,Fn=!1),ha(e,t,n),kl(n.stateNode),xt=r,Fn=a;break;case 5:kt||Ir(n,t);case 6:if(r=xt,a=Fn,xt=null,ha(e,t,n),xt=r,Fn=a,xt!==null)if(Fn)try{(xt.nodeType===9?xt.body:xt.nodeName==="HTML"?xt.ownerDocument.body:xt).removeChild(n.stateNode)}catch(i){ut(n,t,i)}else try{xt.removeChild(n.stateNode)}catch(i){ut(n,t,i)}break;case 18:xt!==null&&(Fn?(e=xt,I2(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),ql(e)):I2(xt,n.stateNode));break;case 4:r=xt,a=Fn,xt=n.stateNode.containerInfo,Fn=!0,ha(e,t,n),xt=r,Fn=a;break;case 0:case 11:case 14:case 15:kt||qa(2,n,t),kt||qa(4,n,t),ha(e,t,n);break;case 1:kt||(Ir(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"&&Hb(n,t,r)),ha(e,t,n);break;case 21:ha(e,t,n);break;case 22:kt=(r=kt)||n.memoizedState!==null,ha(e,t,n),kt=r;break;default:ha(e,t,n)}}function Qb(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{ql(e)}catch(n){ut(t,t.return,n)}}function w4(e){switch(e.tag){case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Vb),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Vb),t;default:throw Error(re(435,e.tag))}}function im(e,t){var n=w4(e);t.forEach(function(r){var a=F4.bind(null,e,r);n.has(r)||(n.add(r),r.then(a,a))})}function qn(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],i=e,o=t,s=o;e:for(;s!==null;){switch(s.tag){case 27:if(Wa(s.type)){xt=s.stateNode,Fn=!1;break e}break;case 5:xt=s.stateNode,Fn=!1;break e;case 3:case 4:xt=s.stateNode.containerInfo,Fn=!0;break e}s=s.return}if(xt===null)throw Error(re(160));Kb(i,o,a),xt=null,Fn=!1,i=a.alternate,i!==null&&(i.return=null),a.return=null}if(t.subtreeFlags&13878)for(t=t.child;t!==null;)Wb(t,e),t=t.sibling}var Dr=null;function Wb(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:qn(t,e),Yn(e),r&4&&(qa(3,e,e.return),Cl(3,e),qa(5,e,e.return));break;case 1:qn(t,e),Yn(e),r&512&&(kt||n===null||Ir(n,n.return)),r&64&&da&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=Dr;if(qn(t,e),Yn(e),r&512&&(kt||n===null||Ir(n,n.return)),r&4){var i=n!==null?n.memoizedState:null;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){e:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;t:switch(r){case"title":i=a.getElementsByTagName("title")[0],(!i||i[Qs]||i[fn]||i.namespaceURI==="http://www.w3.org/2000/svg"||i.hasAttribute("itemprop"))&&(i=a.createElement(r),a.head.insertBefore(i,a.querySelector("head > title"))),on(i,r,n),i[fn]=e,Kt(i),r=i;break e;case"link":var o=G2("link","href",a).get(r+(n.href||""));if(o){for(var s=0;s<o.length;s++)if(i=o[s],i.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&i.getAttribute("rel")===(n.rel==null?null:n.rel)&&i.getAttribute("title")===(n.title==null?null:n.title)&&i.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(s,1);break t}}i=a.createElement(r),on(i,r,n),a.head.appendChild(i);break;case"meta":if(o=G2("meta","content",a).get(r+(n.content||""))){for(s=0;s<o.length;s++)if(i=o[s],i.getAttribute("content")===(n.content==null?null:""+n.content)&&i.getAttribute("name")===(n.name==null?null:n.name)&&i.getAttribute("property")===(n.property==null?null:n.property)&&i.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&i.getAttribute("charset")===(n.charSet==null?null:n.charSet)){o.splice(s,1);break t}}i=a.createElement(r),on(i,r,n),a.head.appendChild(i);break;default:throw Error(re(468,r))}i[fn]=e,Kt(i),r=i}e.stateNode=r}else V2(a,e.type,e.stateNode);else e.stateNode=Y2(a,r,e.memoizedProps);else i!==r?(i===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):i.count--,r===null?V2(a,e.type,e.stateNode):Y2(a,r,e.memoizedProps)):r===null&&e.stateNode!==null&&tm(e,e.memoizedProps,n.memoizedProps)}break;case 27:qn(t,e),Yn(e),r&512&&(kt||n===null||Ir(n,n.return)),n!==null&&r&4&&tm(e,e.memoizedProps,n.memoizedProps);break;case 5:if(qn(t,e),Yn(e),r&512&&(kt||n===null||Ir(n,n.return)),e.flags&32){a=e.stateNode;try{bo(a,"")}catch(h){ut(e,e.return,h)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,tm(e,a,n!==null?n.memoizedProps:a)),r&1024&&(am=!0);break;case 6:if(qn(t,e),Yn(e),r&4){if(e.stateNode===null)throw Error(re(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(h){ut(e,e.return,h)}}break;case 3:if(Pc=null,a=Dr,Dr=Uc(t.containerInfo),qn(t,e),Dr=a,Yn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{ql(t.containerInfo)}catch(h){ut(e,e.return,h)}am&&(am=!1,Jb(e));break;case 4:r=Dr,Dr=Uc(e.stateNode.containerInfo),qn(t,e),Yn(e),Dr=r;break;case 12:qn(t,e),Yn(e);break;case 13:qn(t,e),Yn(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(fm=zr()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,im(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=da,c=kt;if(da=u||a,kt=c||l,qn(t,e),kt=c,da=u,Yn(e),r&8192)e:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||da||kt||Li(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(i=l.stateNode,a)o=i.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none";else{s=l.stateNode;var f=l.memoizedProps.style,d=f!=null&&f.hasOwnProperty("display")?f.display:null;s.style.display=d==null||typeof d=="boolean"?"":(""+d).trim()}}catch(h){ut(l,l.return,h)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?"":l.memoizedProps}catch(h){ut(l,l.return,h)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,im(e,n))));break;case 19:qn(t,e),Yn(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,im(e,r)));break;case 30:break;case 21:break;default:qn(t,e),Yn(e)}}function Yn(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Yb(r)){n=r;break}r=r.return}if(n==null)throw Error(re(160));switch(n.tag){case 27:var a=n.stateNode,i=nm(e);Cc(e,i,a);break;case 5:var o=n.stateNode;n.flags&32&&(bo(o,""),n.flags&=-33);var s=nm(e);Cc(e,s,o);break;case 3:case 4:var l=n.stateNode.containerInfo,u=nm(e);rm(e,u,l);break;default:throw Error(re(161))}}catch(c){ut(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Jb(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Jb(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Ya(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Xb(e,t.alternate,t),t=t.sibling}function Li(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:qa(4,t,t.return),Li(t);break;case 1:Ir(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&Hb(t,t.return,n),Li(t);break;case 27:kl(t.stateNode);case 26:case 5:Ir(t,t.return),Li(t);break;case 22:t.memoizedState===null&&Li(t);break;case 30:Li(t);break;default:Li(t)}e=e.sibling}}function Ga(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var r=t.alternate,a=e,i=t,o=i.flags;switch(i.tag){case 0:case 11:case 15:Ga(a,i,n),Cl(4,i);break;case 1:if(Ga(a,i,n),r=i,a=r.stateNode,typeof a.componentDidMount=="function")try{a.componentDidMount()}catch(u){ut(r,r.return,u)}if(r=i,a=r.updateQueue,a!==null){var s=r.stateNode;try{var l=a.shared.hiddenCallbacks;if(l!==null)for(a.shared.hiddenCallbacks=null,a=0;a<l.length;a++)My(l[a],s)}catch(u){ut(r,r.return,u)}}n&&o&64&&jb(i),Tl(i,i.return);break;case 27:Gb(i);case 26:case 5:Ga(a,i,n),n&&r===null&&o&4&&qb(i),Tl(i,i.return);break;case 12:Ga(a,i,n);break;case 13:Ga(a,i,n),n&&o&4&&Qb(a,i);break;case 22:i.memoizedState===null&&Ga(a,i,n),Tl(i,i.return);break;case 30:break;default:Ga(a,i,n)}t=t.sibling}}function om(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&dl(n))}function sm(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&dl(e))}function Ur(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)e2(e,t,n,r),t=t.sibling}function e2(e,t,n,r){var a=t.flags;switch(t.tag){case 0:case 11:case 15:Ur(e,t,n,r),a&2048&&Cl(9,t);break;case 1:Ur(e,t,n,r);break;case 3:Ur(e,t,n,r),a&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&dl(e)));break;case 12:if(a&2048){Ur(e,t,n,r),e=t.stateNode;try{var i=t.memoizedProps,o=i.id,s=i.onPostCommit;typeof s=="function"&&s(o,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(l){ut(t,t.return,l)}}else Ur(e,t,n,r);break;case 13:Ur(e,t,n,r);break;case 23:break;case 22:i=t.stateNode,o=t.alternate,t.memoizedState!==null?i._visibility&2?Ur(e,t,n,r):Ml(e,t):i._visibility&2?Ur(e,t,n,r):(i._visibility|=2,Io(e,t,n,r,(t.subtreeFlags&10256)!==0)),a&2048&&om(o,t);break;case 24:Ur(e,t,n,r),a&2048&&sm(t.alternate,t);break;default:Ur(e,t,n,r)}}function Io(e,t,n,r,a){for(a=a&&(t.subtreeFlags&10256)!==0,t=t.child;t!==null;){var i=e,o=t,s=n,l=r,u=o.flags;switch(o.tag){case 0:case 11:case 15:Io(i,o,s,l,a),Cl(8,o);break;case 23:break;case 22:var c=o.stateNode;o.memoizedState!==null?c._visibility&2?Io(i,o,s,l,a):Ml(i,o):(c._visibility|=2,Io(i,o,s,l,a)),a&&u&2048&&om(o.alternate,o);break;case 24:Io(i,o,s,l,a),a&&u&2048&&sm(o.alternate,o);break;default:Io(i,o,s,l,a)}t=t.sibling}}function Ml(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,a=r.flags;switch(r.tag){case 22:Ml(n,r),a&2048&&om(r.alternate,r);break;case 24:Ml(n,r),a&2048&&sm(r.alternate,r);break;default:Ml(n,r)}t=t.sibling}}var _l=8192;function Uo(e){if(e.subtreeFlags&_l)for(e=e.child;e!==null;)t2(e),e=e.sibling}function t2(e){switch(e.tag){case 26:Uo(e),e.flags&_l&&e.memoizedState!==null&&s6(Dr,e.memoizedState,e.memoizedProps);break;case 5:Uo(e);break;case 3:case 4:var t=Dr;Dr=Uc(e.stateNode.containerInfo),Uo(e),Dr=t;break;case 22:e.memoizedState===null&&(t=e.alternate,t!==null&&t.memoizedState!==null?(t=_l,_l=16777216,Uo(e),_l=t):Uo(e));break;default:Uo(e)}}function n2(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Nl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Wt=r,a2(r,e)}n2(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)r2(e),e=e.sibling}function r2(e){switch(e.tag){case 0:case 11:case 15:Nl(e),e.flags&2048&&qa(9,e,e.return);break;case 3:Nl(e);break;case 12:Nl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Tc(e)):Nl(e);break;default:Nl(e)}}function Tc(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Wt=r,a2(r,e)}n2(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:qa(8,t,t.return),Tc(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Tc(t));break;default:Tc(t)}e=e.sibling}}function a2(e,t){for(;Wt!==null;){var n=Wt;switch(n.tag){case 0:case 11:case 15:qa(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:dl(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,Wt=r;else e:for(n=e;Wt!==null;){r=Wt;var a=r.sibling,i=r.return;if(Zb(r),r===n){Wt=null;break e}if(a!==null){a.return=i,Wt=a;break e}Wt=i}}}var x4={getCacheForType:function(e){var t=dn(Gt),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n}},E4=typeof WeakMap=="function"?WeakMap:Map,Je=0,mt=null,Ie=null,qe=0,et=0,Gn=null,Va=!1,Lo=!1,lm=!1,ma=0,Ft=0,Xa=0,Pi=0,um=0,lr=0,Po=0,Fl=null,Bn=null,cm=!1,fm=0,Mc=1/0,_c=null,Za=null,an=0,Ka=null,jo=null,Ho=0,dm=0,hm=null,i2=null,Bl=0,mm=null;function Vn(){if(Je&2&&qe!==0)return qe&-qe;if(Ce.T!==null){var e=No;return e!==0?e:Sm()}return Sv()}function o2(){lr===0&&(lr=!(qe&536870912)||Xe?vv():536870912);var e=sr.current;return e!==null&&(e.flags|=32),lr}function Xn(e,t,n){(e===mt&&(et===2||et===9)||e.cancelPendingCommit!==null)&&(qo(e,0),Qa(e,qe,lr,!1)),Ks(e,n),(!(Je&2)||e!==mt)&&(e===mt&&(!(Je&2)&&(Pi|=n),Ft===4&&Qa(e,qe,lr,!1)),Lr(e))}function s2(e,t,n){if(Je&6)throw Error(re(327));var r=!n&&(t&124)===0&&(t&e.expiredLanes)===0||Zs(e,t),a=r?T4(e,t):vm(e,t,!0),i=r;do{if(a===0){Lo&&!r&&Qa(e,t,0,!1);break}else{if(n=e.current.alternate,i&&!A4(n)){a=vm(e,t,!1),i=!1;continue}if(a===2){if(i=t,e.errorRecoveryDisabledLanes&i)var o=0;else o=e.pendingLanes&-536870913,o=o!==0?o:o&536870912?536870912:0;if(o!==0){t=o;e:{var s=e;a=Fl;var l=s.current.memoizedState.isDehydrated;if(l&&(qo(s,o).flags|=256),o=vm(s,o,!1),o!==2){if(lm&&!l){s.errorRecoveryDisabledLanes|=i,Pi|=i,a=4;break e}i=Bn,Bn=a,i!==null&&(Bn===null?Bn=i:Bn.push.apply(Bn,i))}a=o}if(i=!1,a!==2)continue}}if(a===1){qo(e,0),Qa(e,t,0,!0);break}e:{switch(r=e,i=a,i){case 0:case 1:throw Error(re(345));case 4:if((t&4194048)!==t)break;case 6:Qa(r,t,lr,!Va);break e;case 2:Bn=null;break;case 3:case 5:break;default:throw Error(re(329))}if((t&62914560)===t&&(a=fm+300-zr(),10<a)){if(Qa(r,t,lr,!Va),Lu(r,0,!0)!==0)break e;r.timeoutHandle=k2(l2.bind(null,r,n,Bn,_c,cm,t,lr,Pi,Po,Va,i,2,-0,0),a);break e}l2(r,n,Bn,_c,cm,t,lr,Pi,Po,Va,i,0,-0,0)}}break}while(!0);Lr(e)}function l2(e,t,n,r,a,i,o,s,l,u,c,f,d,h){if(e.timeoutHandle=-1,f=t.subtreeFlags,(f&8192||(f&16785408)===16785408)&&(Ul={stylesheets:null,count:0,unsuspend:o6},t2(t),f=l6(),f!==null)){e.cancelPendingCommit=f(p2.bind(null,e,t,i,n,r,a,o,s,l,c,1,d,h)),Qa(e,i,o,!u);return}p2(e,t,i,n,r,a,o,s,l)}function A4(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var a=n[r],i=a.getSnapshot;a=a.value;try{if(!jn(i(),a))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Qa(e,t,n,r){t&=~um,t&=~Pi,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var a=t;0<a;){var i=31-Pn(a),o=1<<i;r[i]=-1,a&=~o}n!==0&&bv(e,n,t)}function Nc(){return Je&6?!0:(Ol(0),!1)}function pm(){if(Ie!==null){if(et===0)var e=Ie.return;else e=Ie,oa=zi=null,Bh(e),ko=null,xl=0,e=Ie;for(;e!==null;)Pb(e.alternate,e),e=e.return;Ie=null}}function qo(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,H4(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),pm(),mt=e,Ie=n=ra(e.current,null),qe=t,et=0,Gn=null,Va=!1,Lo=Zs(e,t),lm=!1,Po=lr=um=Pi=Xa=Ft=0,Bn=Fl=null,cm=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var a=31-Pn(r),i=1<<a;t|=e[a],r&=~i}return ma=t,Wu(),n}function u2(e,t){ze=null,Ce.H=vc,t===ml||t===sc?(t=Cy(),et=3):t===xy?(t=Cy(),et=4):et=t===Tb?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Gn=t,Ie===null&&(Ft=1,wc(e,rr(t,e.current)))}function c2(){var e=Ce.H;return Ce.H=vc,e===null?vc:e}function f2(){var e=Ce.A;return Ce.A=x4,e}function gm(){Ft=4,Va||(qe&4194048)!==qe&&sr.current!==null||(Lo=!0),!(Xa&134217727)&&!(Pi&134217727)||mt===null||Qa(mt,qe,lr,!1)}function vm(e,t,n){var r=Je;Je|=2;var a=c2(),i=f2();(mt!==e||qe!==t)&&(_c=null,qo(e,t)),t=!1;var o=Ft;e:do try{if(et!==0&&Ie!==null){var s=Ie,l=Gn;switch(et){case 8:pm(),o=6;break e;case 3:case 2:case 9:case 6:sr.current===null&&(t=!0);var u=et;if(et=0,Gn=null,Yo(e,s,l,u),n&&Lo){o=0;break e}break;default:u=et,et=0,Gn=null,Yo(e,s,l,u)}}C4(),o=Ft;break}catch(c){u2(e,c)}while(!0);return t&&e.shellSuspendCounter++,oa=zi=null,Je=r,Ce.H=a,Ce.A=i,Ie===null&&(mt=null,qe=0,Wu()),o}function C4(){for(;Ie!==null;)d2(Ie)}function T4(e,t){var n=Je;Je|=2;var r=c2(),a=f2();mt!==e||qe!==t?(_c=null,Mc=zr()+500,qo(e,t)):Lo=Zs(e,t);e:do try{if(et!==0&&Ie!==null){t=Ie;var i=Gn;t:switch(et){case 1:et=0,Gn=null,Yo(e,t,i,1);break;case 2:case 9:if(Ey(i)){et=0,Gn=null,h2(t);break}t=function(){et!==2&&et!==9||mt!==e||(et=7),Lr(e)},i.then(t,t);break e;case 3:et=7;break e;case 4:et=5;break e;case 7:Ey(i)?(et=0,Gn=null,h2(t)):(et=0,Gn=null,Yo(e,t,i,7));break;case 5:var o=null;switch(Ie.tag){case 26:o=Ie.memoizedState;case 5:case 27:var s=Ie;if(!o||X2(o)){et=0,Gn=null;var l=s.sibling;if(l!==null)Ie=l;else{var u=s.return;u!==null?(Ie=u,Fc(u)):Ie=null}break t}}et=0,Gn=null,Yo(e,t,i,5);break;case 6:et=0,Gn=null,Yo(e,t,i,6);break;case 8:pm(),Ft=6;break e;default:throw Error(re(462))}}M4();break}catch(c){u2(e,c)}while(!0);return oa=zi=null,Ce.H=r,Ce.A=a,Je=n,Ie!==null?0:(mt=null,qe=0,Wu(),Ft)}function M4(){for(;Ie!==null&&!KC();)d2(Ie)}function d2(e){var t=Ub(e.alternate,e,ma);e.memoizedProps=e.pendingProps,t===null?Fc(e):Ie=t}function h2(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Ob(n,t,t.pendingProps,t.type,void 0,qe);break;case 11:t=Ob(n,t,t.pendingProps,t.type.render,t.ref,qe);break;case 5:Bh(t);default:Pb(n,t),t=Ie=my(t,ma),t=Ub(n,t,ma)}e.memoizedProps=e.pendingProps,t===null?Fc(e):Ie=t}function Yo(e,t,n,r){oa=zi=null,Bh(t),ko=null,xl=0;var a=t.return;try{if(v4(e,a,t,n,qe)){Ft=1,wc(e,rr(n,e.current)),Ie=null;return}}catch(i){if(a!==null)throw Ie=a,i;Ft=1,wc(e,rr(n,e.current)),Ie=null;return}t.flags&32768?(Xe||r===1?e=!0:Lo||qe&536870912?e=!1:(Va=e=!0,(r===2||r===9||r===3||r===6)&&(r=sr.current,r!==null&&r.tag===13&&(r.flags|=16384))),m2(t,e)):Fc(t)}function Fc(e){var t=e;do{if(t.flags&32768){m2(t,Va);return}e=t.return;var n=b4(t.alternate,t,ma);if(n!==null){Ie=n;return}if(t=t.sibling,t!==null){Ie=t;return}Ie=t=e}while(t!==null);Ft===0&&(Ft=5)}function m2(e,t){do{var n=D4(e.alternate,e);if(n!==null){n.flags&=32767,Ie=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Ie=e;return}Ie=e=n}while(e!==null);Ft=6,Ie=null}function p2(e,t,n,r,a,i,o,s,l){e.cancelPendingCommit=null;do Bc();while(an!==0);if(Je&6)throw Error(re(327));if(t!==null){if(t===e.current)throw Error(re(177));if(i=t.lanes|t.childLanes,i|=sh,o5(e,n,i,o,s,l),e===mt&&(Ie=mt=null,qe=0),jo=t,Ka=e,Ho=n,dm=i,hm=a,i2=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,B4($u,function(){return D2(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,t.subtreeFlags&13878||r){r=Ce.T,Ce.T=null,a=Ve.p,Ve.p=2,o=Je,Je|=4;try{S4(e,t,n)}finally{Je=o,Ve.p=a,Ce.T=r}}an=1,g2(),v2(),y2()}}function g2(){if(an===1){an=0;var e=Ka,t=jo,n=(t.flags&13878)!==0;if(t.subtreeFlags&13878||n){n=Ce.T,Ce.T=null;var r=Ve.p;Ve.p=2;var a=Je;Je|=4;try{Wb(t,e);var i=_m,o=ay(e.containerInfo),s=i.focusedElem,l=i.selectionRange;if(o!==s&&s&&s.ownerDocument&&ry(s.ownerDocument.documentElement,s)){if(l!==null&&nh(s)){var u=l.start,c=l.end;if(c===void 0&&(c=u),"selectionStart"in s)s.selectionStart=u,s.selectionEnd=Math.min(c,s.value.length);else{var f=s.ownerDocument||document,d=f&&f.defaultView||window;if(d.getSelection){var h=d.getSelection(),g=s.textContent.length,m=Math.min(l.start,g),D=l.end===void 0?m:Math.min(l.end,g);!h.extend&&m>D&&(o=D,D=m,m=o);var p=ny(s,m),v=ny(s,D);if(p&&v&&(h.rangeCount!==1||h.anchorNode!==p.node||h.anchorOffset!==p.offset||h.focusNode!==v.node||h.focusOffset!==v.offset)){var y=f.createRange();y.setStart(p.node,p.offset),h.removeAllRanges(),m>D?(h.addRange(y),h.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),h.addRange(y))}}}}for(f=[],h=s;h=h.parentNode;)h.nodeType===1&&f.push({element:h,left:h.scrollLeft,top:h.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;s<f.length;s++){var w=f[s];w.element.scrollLeft=w.left,w.element.scrollTop=w.top}}qc=!!Mm,_m=Mm=null}finally{Je=a,Ve.p=r,Ce.T=n}}e.current=t,an=2}}function v2(){if(an===2){an=0;var e=Ka,t=jo,n=(t.flags&8772)!==0;if(t.subtreeFlags&8772||n){n=Ce.T,Ce.T=null;var r=Ve.p;Ve.p=2;var a=Je;Je|=4;try{Xb(e,t.alternate,t)}finally{Je=a,Ve.p=r,Ce.T=n}}an=3}}function y2(){if(an===4||an===3){an=0,QC();var e=Ka,t=jo,n=Ho,r=i2;t.subtreeFlags&10256||t.flags&10256?an=5:(an=0,jo=Ka=null,b2(e,e.pendingLanes));var a=e.pendingLanes;if(a===0&&(Za=null),z0(n),t=t.stateNode,Ln&&typeof Ln.onCommitFiberRoot=="function")try{Ln.onCommitFiberRoot(Xs,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=Ce.T,a=Ve.p,Ve.p=2,Ce.T=null;try{for(var i=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];i(s.value,{componentStack:s.stack})}}finally{Ce.T=t,Ve.p=a}}Ho&3&&Bc(),Lr(e),a=e.pendingLanes,n&4194090&&a&42?e===mm?Bl++:(Bl=0,mm=e):Bl=0,Ol(0)}}function b2(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,dl(t)))}function Bc(e){return g2(),v2(),y2(),D2()}function D2(){if(an!==5)return!1;var e=Ka,t=dm;dm=0;var n=z0(Ho),r=Ce.T,a=Ve.p;try{Ve.p=32>n?32:n,Ce.T=null,n=hm,hm=null;var i=Ka,o=Ho;if(an=0,jo=Ka=null,Ho=0,Je&6)throw Error(re(331));var s=Je;if(Je|=4,r2(i.current),e2(i,i.current,o,n),Je=s,Ol(0,!1),Ln&&typeof Ln.onPostCommitFiberRoot=="function")try{Ln.onPostCommitFiberRoot(Xs,i)}catch{}return!0}finally{Ve.p=a,Ce.T=r,b2(e,t)}}function S2(e,t,n){t=rr(n,t),t=Gh(e.stateNode,t,2),e=La(e,t,2),e!==null&&(Ks(e,2),Lr(e))}function ut(e,t,n){if(e.tag===3)S2(e,e,n);else for(;t!==null;){if(t.tag===3){S2(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Za===null||!Za.has(r))){e=rr(n,e),n=Ab(2),r=La(t,n,2),r!==null&&(Cb(n,r,t,e),Ks(r,2),Lr(r));break}}t=t.return}}function ym(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new E4;var a=new Set;r.set(t,a)}else a=r.get(t),a===void 0&&(a=new Set,r.set(t,a));a.has(n)||(lm=!0,a.add(n),e=_4.bind(null,e,t,n),t.then(e,e))}function _4(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,mt===e&&(qe&n)===n&&(Ft===4||Ft===3&&(qe&62914560)===qe&&300>zr()-fm?!(Je&2)&&qo(e,0):um|=n,Po===qe&&(Po=0)),Lr(e)}function w2(e,t){t===0&&(t=yv()),e=Co(e,t),e!==null&&(Ks(e,t),Lr(e))}function N4(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),w2(e,n)}function F4(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(re(314))}r!==null&&r.delete(t),w2(e,n)}function B4(e,t){return F0(e,t)}var Oc=null,Go=null,bm=!1,Rc=!1,Dm=!1,ji=0;function Lr(e){e!==Go&&e.next===null&&(Go===null?Oc=Go=e:Go=Go.next=e),Rc=!0,bm||(bm=!0,R4())}function Ol(e,t){if(!Dm&&Rc){Dm=!0;do for(var n=!1,r=Oc;r!==null;){if(e!==0){var a=r.pendingLanes;if(a===0)var i=0;else{var o=r.suspendedLanes,s=r.pingedLanes;i=(1<<31-Pn(42|e)+1)-1,i&=a&~(o&~s),i=i&201326741?i&201326741|1:i?i|2:0}i!==0&&(n=!0,C2(r,i))}else i=qe,i=Lu(r,r===mt?i:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(i&3)||Zs(r,i)||(n=!0,C2(r,i));r=r.next}while(n);Dm=!1}}function O4(){x2()}function x2(){Rc=bm=!1;var e=0;ji!==0&&(j4()&&(e=ji),ji=0);for(var t=zr(),n=null,r=Oc;r!==null;){var a=r.next,i=E2(r,t);i===0?(r.next=null,n===null?Oc=a:n.next=a,a===null&&(Go=n)):(n=r,(e!==0||i&3)&&(Rc=!0)),r=a}Ol(e)}function E2(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,a=e.expirationTimes,i=e.pendingLanes&-62914561;0<i;){var o=31-Pn(i),s=1<<o,l=a[o];l===-1?(!(s&n)||s&r)&&(a[o]=i5(s,t)):l<=t&&(e.expiredLanes|=s),i&=~s}if(t=mt,n=qe,n=Lu(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(et===2||et===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&B0(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Zs(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&B0(r),z0(n)){case 2:case 8:n=pv;break;case 32:n=$u;break;case 268435456:n=gv;break;default:n=$u}return r=A2.bind(null,e),n=F0(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&B0(r),e.callbackPriority=2,e.callbackNode=null,2}function A2(e,t){if(an!==0&&an!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Bc()&&e.callbackNode!==n)return null;var r=qe;return r=Lu(e,e===mt?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(s2(e,r,t),E2(e,zr()),e.callbackNode!=null&&e.callbackNode===n?A2.bind(null,e):null)}function C2(e,t){if(Bc())return null;s2(e,t,!0)}function R4(){q4(function(){Je&6?F0(mv,O4):x2()})}function Sm(){return ji===0&&(ji=vv()),ji}function T2(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Yu(""+e)}function M2(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function z4(e,t,n,r,a){if(t==="submit"&&n&&n.stateNode===a){var i=T2((a[Mn]||null).action),o=r.submitter;o&&(t=(t=o[Mn]||null)?T2(t.formAction):o.getAttribute("formAction"),t!==null&&(i=t,o=null));var s=new Zu("action","action",null,r,a);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(ji!==0){var l=o?M2(a,o):new FormData(a);Ph(n,{pending:!0,data:l,method:a.method,action:i},null,l)}}else typeof i=="function"&&(s.preventDefault(),l=o?M2(a,o):new FormData(a),Ph(n,{pending:!0,data:l,method:a.method,action:i},i,l))},currentTarget:a}]})}}for(var wm=0;wm<oh.length;wm++){var xm=oh[wm],k4=xm.toLowerCase(),$4=xm[0].toUpperCase()+xm.slice(1);br(k4,"on"+$4)}br(sy,"onAnimationEnd"),br(ly,"onAnimationIteration"),br(uy,"onAnimationStart"),br("dblclick","onDoubleClick"),br("focusin","onFocus"),br("focusout","onBlur"),br(e4,"onTransitionRun"),br(t4,"onTransitionStart"),br(n4,"onTransitionCancel"),br(cy,"onTransitionEnd"),go("onMouseEnter",["mouseout","mouseover"]),go("onMouseLeave",["mouseout","mouseover"]),go("onPointerEnter",["pointerout","pointerover"]),go("onPointerLeave",["pointerout","pointerover"]),Ci("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ci("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ci("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ci("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ci("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ci("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Rl="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),I4=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Rl));function _2(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],a=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],l=s.instance,u=s.currentTarget;if(s=s.listener,l!==i&&a.isPropagationStopped())break e;i=s,a.currentTarget=u;try{i(a)}catch(c){Sc(c)}a.currentTarget=null,i=l}else for(o=0;o<r.length;o++){if(s=r[o],l=s.instance,u=s.currentTarget,s=s.listener,l!==i&&a.isPropagationStopped())break e;i=s,a.currentTarget=u;try{i(a)}catch(c){Sc(c)}a.currentTarget=null,i=l}}}}function Ue(e,t){var n=t[k0];n===void 0&&(n=t[k0]=new Set);var r=e+"__bubble";n.has(r)||(N2(t,e,2,!1),n.add(r))}function Em(e,t,n){var r=0;t&&(r|=4),N2(n,e,r,t)}var zc="_reactListening"+Math.random().toString(36).slice(2);function Am(e){if(!e[zc]){e[zc]=!0,xv.forEach(function(n){n!=="selectionchange"&&(I4.has(n)||Em(n,!1,e),Em(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[zc]||(t[zc]=!0,Em("selectionchange",!1,t))}}function N2(e,t,n,r){switch(eD(t)){case 2:var a=f6;break;case 8:a=d6;break;default:a=Um}n=a.bind(null,t,n,e),a=void 0,!V0||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(a=!0),r?a!==void 0?e.addEventListener(t,n,{capture:!0,passive:a}):e.addEventListener(t,n,!0):a!==void 0?e.addEventListener(t,n,{passive:a}):e.addEventListener(t,n,!1)}function Cm(e,t,n,r,a){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var s=r.stateNode.containerInfo;if(s===a)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&o.stateNode.containerInfo===a)return;o=o.return}for(;s!==null;){if(o=ho(s),o===null)return;if(l=o.tag,l===5||l===6||l===26||l===27){r=i=o;continue e}s=s.parentNode}}r=r.return}$v(function(){var u=i,c=Y0(n),f=[];e:{var d=fy.get(e);if(d!==void 0){var h=Zu,g=e;switch(e){case"keypress":if(Vu(n)===0)break e;case"keydown":case"keyup":h=B5;break;case"focusin":g="focus",h=Q0;break;case"focusout":g="blur",h=Q0;break;case"beforeblur":case"afterblur":h=Q0;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":h=Lv;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=D5;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=z5;break;case sy:case ly:case uy:h=x5;break;case cy:h=$5;break;case"scroll":case"scrollend":h=y5;break;case"wheel":h=U5;break;case"copy":case"cut":case"paste":h=A5;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=jv;break;case"toggle":case"beforetoggle":h=P5}var m=(t&4)!==0,D=!m&&(e==="scroll"||e==="scrollend"),p=m?d!==null?d+"Capture":null:d;m=[];for(var v=u,y;v!==null;){var w=v;if(y=w.stateNode,w=w.tag,w!==5&&w!==26&&w!==27||y===null||p===null||(w=Js(v,p),w!=null&&m.push(zl(v,w,y))),D)break;v=v.return}0<m.length&&(d=new h(d,g,null,n,c),f.push({event:d,listeners:m}))}}if(!(t&7)){e:{if(d=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",d&&n!==q0&&(g=n.relatedTarget||n.fromElement)&&(ho(g)||g[fo]))break e;if((h||d)&&(d=c.window===c?c:(d=c.ownerDocument)?d.defaultView||d.parentWindow:window,h?(g=n.relatedTarget||n.toElement,h=u,g=g?ho(g):null,g!==null&&(D=Hs(g),m=g.tag,g!==D||m!==5&&m!==27&&m!==6)&&(g=null)):(h=null,g=u),h!==g)){if(m=Lv,w="onMouseLeave",p="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(m=jv,w="onPointerLeave",p="onPointerEnter",v="pointer"),D=h==null?d:Ws(h),y=g==null?d:Ws(g),d=new m(w,v+"leave",h,n,c),d.target=D,d.relatedTarget=y,w=null,ho(c)===u&&(m=new m(p,v+"enter",g,n,c),m.target=y,m.relatedTarget=D,w=m),D=w,h&&g)t:{for(m=h,p=g,v=0,y=m;y;y=Vo(y))v++;for(y=0,w=p;w;w=Vo(w))y++;for(;0<v-y;)m=Vo(m),v--;for(;0<y-v;)p=Vo(p),y--;for(;v--;){if(m===p||p!==null&&m===p.alternate)break t;m=Vo(m),p=Vo(p)}m=null}else m=null;h!==null&&F2(f,d,h,m,!1),g!==null&&D!==null&&F2(f,D,g,m,!0)}}e:{if(d=u?Ws(u):window,h=d.nodeName&&d.nodeName.toLowerCase(),h==="select"||h==="input"&&d.type==="file")var E=Kv;else if(Xv(d))if(Qv)E=Q5;else{E=Z5;var b=X5}else h=d.nodeName,!h||h.toLowerCase()!=="input"||d.type!=="checkbox"&&d.type!=="radio"?u&&H0(u.elementType)&&(E=Kv):E=K5;if(E&&(E=E(e,u))){Zv(f,E,n,c);break e}b&&b(e,d,u),e==="focusout"&&u&&d.type==="number"&&u.memoizedProps.value!=null&&j0(d,"number",d.value)}switch(b=u?Ws(u):window,e){case"focusin":(Xv(b)||b.contentEditable==="true")&&(xo=b,rh=u,sl=null);break;case"focusout":sl=rh=xo=null;break;case"mousedown":ah=!0;break;case"contextmenu":case"mouseup":case"dragend":ah=!1,iy(f,n,c);break;case"selectionchange":if(J5)break;case"keydown":case"keyup":iy(f,n,c)}var S;if(J0)e:{switch(e){case"compositionstart":var A="onCompositionStart";break e;case"compositionend":A="onCompositionEnd";break e;case"compositionupdate":A="onCompositionUpdate";break e}A=void 0}else wo?Gv(e,n)&&(A="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(A="onCompositionStart");A&&(Hv&&n.locale!=="ko"&&(wo||A!=="onCompositionStart"?A==="onCompositionEnd"&&wo&&(S=Iv()):(ka=c,X0="value"in ka?ka.value:ka.textContent,wo=!0)),b=kc(u,A),0<b.length&&(A=new Pv(A,e,null,n,c),f.push({event:A,listeners:b}),S?A.data=S:(S=Vv(n),S!==null&&(A.data=S)))),(S=H5?q5(e,n):Y5(e,n))&&(A=kc(u,"onBeforeInput"),0<A.length&&(b=new Pv("onBeforeInput","beforeinput",null,n,c),f.push({event:b,listeners:A}),b.data=S)),z4(f,e,u,n,c)}_2(f,t)})}function zl(e,t,n){return{instance:e,listener:t,currentTarget:n}}function kc(e,t){for(var n=t+"Capture",r=[];e!==null;){var a=e,i=a.stateNode;if(a=a.tag,a!==5&&a!==26&&a!==27||i===null||(a=Js(e,n),a!=null&&r.unshift(zl(e,a,i)),a=Js(e,t),a!=null&&r.push(zl(e,a,i))),e.tag===3)return r;e=e.return}return[]}function Vo(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function F2(e,t,n,r,a){for(var i=t._reactName,o=[];n!==null&&n!==r;){var s=n,l=s.alternate,u=s.stateNode;if(s=s.tag,l!==null&&l===r)break;s!==5&&s!==26&&s!==27||u===null||(l=u,a?(u=Js(n,i),u!=null&&o.unshift(zl(n,u,l))):a||(u=Js(n,i),u!=null&&o.push(zl(n,u,l)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var U4=/\r\n?/g,L4=/\u0000|\uFFFD/g;function B2(e){return(typeof e=="string"?e:""+e).replace(U4,`
49
- `).replace(L4,"")}function O2(e,t){return t=B2(t),B2(e)===t}function $c(){}function ot(e,t,n,r,a,i){switch(n){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||bo(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&bo(e,""+r);break;case"className":ju(e,"class",r);break;case"tabIndex":ju(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":ju(e,n,r);break;case"style":zv(e,r,i);break;case"data":if(t!=="object"){ju(e,"data",r);break}case"src":case"href":if(r===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(n);break}r=Yu(""+r),e.setAttribute(n,r);break;case"action":case"formAction":if(typeof r=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof i=="function"&&(n==="formAction"?(t!=="input"&&ot(e,t,"name",a.name,a,null),ot(e,t,"formEncType",a.formEncType,a,null),ot(e,t,"formMethod",a.formMethod,a,null),ot(e,t,"formTarget",a.formTarget,a,null)):(ot(e,t,"encType",a.encType,a,null),ot(e,t,"method",a.method,a,null),ot(e,t,"target",a.target,a,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(n);break}r=Yu(""+r),e.setAttribute(n,r);break;case"onClick":r!=null&&(e.onclick=$c);break;case"onScroll":r!=null&&Ue("scroll",e);break;case"onScrollEnd":r!=null&&Ue("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(re(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(re(60));e.innerHTML=n}}break;case"multiple":e.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":e.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){e.removeAttribute("xlink:href");break}n=Yu(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,""+r):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":r&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":r===!0?e.setAttribute(n,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,r):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case"popover":Ue("beforetoggle",e),Ue("toggle",e),Pu(e,"popover",r);break;case"xlinkActuate":ta(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":ta(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":ta(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":ta(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":ta(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":ta(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":ta(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":ta(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":ta(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":Pu(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=g5.get(n)||n,Pu(e,n,r))}}function Tm(e,t,n,r,a,i){switch(n){case"style":zv(e,r,i);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(re(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(re(60));e.innerHTML=n}}break;case"children":typeof r=="string"?bo(e,r):(typeof r=="number"||typeof r=="bigint")&&bo(e,""+r);break;case"onScroll":r!=null&&Ue("scroll",e);break;case"onScrollEnd":r!=null&&Ue("scrollend",e);break;case"onClick":r!=null&&(e.onclick=$c);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ev.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(a=n.endsWith("Capture"),t=n.slice(2,a?n.length-7:void 0),i=e[Mn]||null,i=i!=null?i[n]:null,typeof i=="function"&&e.removeEventListener(t,i,a),typeof r=="function")){typeof i!="function"&&i!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break e}n in e?e[n]=r:r===!0?e.setAttribute(n,""):Pu(e,n,r)}}}function on(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ue("error",e),Ue("load",e);var r=!1,a=!1,i;for(i in n)if(n.hasOwnProperty(i)){var o=n[i];if(o!=null)switch(i){case"src":r=!0;break;case"srcSet":a=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(re(137,t));default:ot(e,t,i,o,n,null)}}a&&ot(e,t,"srcSet",n.srcSet,n,null),r&&ot(e,t,"src",n.src,n,null);return;case"input":Ue("invalid",e);var s=i=o=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var c=n[r];if(c!=null)switch(r){case"name":a=c;break;case"type":o=c;break;case"checked":l=c;break;case"defaultChecked":u=c;break;case"value":i=c;break;case"defaultValue":s=c;break;case"children":case"dangerouslySetInnerHTML":if(c!=null)throw Error(re(137,t));break;default:ot(e,t,r,c,n,null)}}Fv(e,i,s,l,u,o,a,!1),Hu(e);return;case"select":Ue("invalid",e),r=o=i=null;for(a in n)if(n.hasOwnProperty(a)&&(s=n[a],s!=null))switch(a){case"value":i=s;break;case"defaultValue":o=s;break;case"multiple":r=s;default:ot(e,t,a,s,n,null)}t=i,n=o,e.multiple=!!r,t!=null?yo(e,!!r,t,!1):n!=null&&yo(e,!!r,n,!0);return;case"textarea":Ue("invalid",e),i=a=r=null;for(o in n)if(n.hasOwnProperty(o)&&(s=n[o],s!=null))switch(o){case"value":r=s;break;case"defaultValue":a=s;break;case"children":i=s;break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(re(91));break;default:ot(e,t,o,s,n,null)}Ov(e,r,a,i),Hu(e);return;case"option":for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case"selected":e.selected=r&&typeof r!="function"&&typeof r!="symbol";break;default:ot(e,t,l,r,n,null)}return;case"dialog":Ue("beforetoggle",e),Ue("toggle",e),Ue("cancel",e),Ue("close",e);break;case"iframe":case"object":Ue("load",e);break;case"video":case"audio":for(r=0;r<Rl.length;r++)Ue(Rl[r],e);break;case"image":Ue("error",e),Ue("load",e);break;case"details":Ue("toggle",e);break;case"embed":case"source":case"link":Ue("error",e),Ue("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case"children":case"dangerouslySetInnerHTML":throw Error(re(137,t));default:ot(e,t,u,r,n,null)}return;default:if(H0(t)){for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!==void 0&&Tm(e,t,c,r,n,void 0));return}}for(s in n)n.hasOwnProperty(s)&&(r=n[s],r!=null&&ot(e,t,s,r,n,null))}function P4(e,t,n,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var a=null,i=null,o=null,s=null,l=null,u=null,c=null;for(h in n){var f=n[h];if(n.hasOwnProperty(h)&&f!=null)switch(h){case"checked":break;case"value":break;case"defaultValue":l=f;default:r.hasOwnProperty(h)||ot(e,t,h,null,r,f)}}for(var d in r){var h=r[d];if(f=n[d],r.hasOwnProperty(d)&&(h!=null||f!=null))switch(d){case"type":i=h;break;case"name":a=h;break;case"checked":u=h;break;case"defaultChecked":c=h;break;case"value":o=h;break;case"defaultValue":s=h;break;case"children":case"dangerouslySetInnerHTML":if(h!=null)throw Error(re(137,t));break;default:h!==f&&ot(e,t,d,h,r,f)}}P0(e,o,s,l,u,c,i,a);return;case"select":h=o=s=d=null;for(i in n)if(l=n[i],n.hasOwnProperty(i)&&l!=null)switch(i){case"value":break;case"multiple":h=l;default:r.hasOwnProperty(i)||ot(e,t,i,null,r,l)}for(a in r)if(i=r[a],l=n[a],r.hasOwnProperty(a)&&(i!=null||l!=null))switch(a){case"value":d=i;break;case"defaultValue":s=i;break;case"multiple":o=i;default:i!==l&&ot(e,t,a,i,r,l)}t=s,n=o,r=h,d!=null?yo(e,!!n,d,!1):!!r!=!!n&&(t!=null?yo(e,!!n,t,!0):yo(e,!!n,n?[]:"",!1));return;case"textarea":h=d=null;for(s in n)if(a=n[s],n.hasOwnProperty(s)&&a!=null&&!r.hasOwnProperty(s))switch(s){case"value":break;case"children":break;default:ot(e,t,s,null,r,a)}for(o in r)if(a=r[o],i=n[o],r.hasOwnProperty(o)&&(a!=null||i!=null))switch(o){case"value":d=a;break;case"defaultValue":h=a;break;case"children":break;case"dangerouslySetInnerHTML":if(a!=null)throw Error(re(91));break;default:a!==i&&ot(e,t,o,a,r,i)}Bv(e,d,h);return;case"option":for(var g in n)if(d=n[g],n.hasOwnProperty(g)&&d!=null&&!r.hasOwnProperty(g))switch(g){case"selected":e.selected=!1;break;default:ot(e,t,g,null,r,d)}for(l in r)if(d=r[l],h=n[l],r.hasOwnProperty(l)&&d!==h&&(d!=null||h!=null))switch(l){case"selected":e.selected=d&&typeof d!="function"&&typeof d!="symbol";break;default:ot(e,t,l,d,r,h)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var m in n)d=n[m],n.hasOwnProperty(m)&&d!=null&&!r.hasOwnProperty(m)&&ot(e,t,m,null,r,d);for(u in r)if(d=r[u],h=n[u],r.hasOwnProperty(u)&&d!==h&&(d!=null||h!=null))switch(u){case"children":case"dangerouslySetInnerHTML":if(d!=null)throw Error(re(137,t));break;default:ot(e,t,u,d,r,h)}return;default:if(H0(t)){for(var D in n)d=n[D],n.hasOwnProperty(D)&&d!==void 0&&!r.hasOwnProperty(D)&&Tm(e,t,D,void 0,r,d);for(c in r)d=r[c],h=n[c],!r.hasOwnProperty(c)||d===h||d===void 0&&h===void 0||Tm(e,t,c,d,r,h);return}}for(var p in n)d=n[p],n.hasOwnProperty(p)&&d!=null&&!r.hasOwnProperty(p)&&ot(e,t,p,null,r,d);for(f in r)d=r[f],h=n[f],!r.hasOwnProperty(f)||d===h||d==null&&h==null||ot(e,t,f,d,r,h)}var Mm=null,_m=null;function Ic(e){return e.nodeType===9?e:e.ownerDocument}function R2(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function z2(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Nm(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Fm=null;function j4(){var e=window.event;return e&&e.type==="popstate"?e===Fm?!1:(Fm=e,!0):(Fm=null,!1)}var k2=typeof setTimeout=="function"?setTimeout:void 0,H4=typeof clearTimeout=="function"?clearTimeout:void 0,$2=typeof Promise=="function"?Promise:void 0,q4=typeof queueMicrotask=="function"?queueMicrotask:typeof $2<"u"?function(e){return $2.resolve(null).then(e).catch(Y4)}:k2;function Y4(e){setTimeout(function(){throw e})}function Wa(e){return e==="head"}function I2(e,t){var n=t,r=0,a=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(0<r&&8>r){n=r;var o=e.ownerDocument;if(n&1&&kl(o.documentElement),n&2&&kl(o.body),n&4)for(n=o.head,kl(n),o=n.firstChild;o;){var s=o.nextSibling,l=o.nodeName;o[Qs]||l==="SCRIPT"||l==="STYLE"||l==="LINK"&&o.rel.toLowerCase()==="stylesheet"||n.removeChild(o),o=s}}if(a===0){e.removeChild(i),ql(t);return}a--}else n==="$"||n==="$?"||n==="$!"?a++:r=n.charCodeAt(0)-48;else r=0;n=i}while(n);ql(t)}function Bm(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":Bm(n),$0(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function G4(e,t,n,r){for(;e.nodeType===1;){var a=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[Qs])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(i=e.getAttribute("rel"),i==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(i!==a.rel||e.getAttribute("href")!==(a.href==null||a.href===""?null:a.href)||e.getAttribute("crossorigin")!==(a.crossOrigin==null?null:a.crossOrigin)||e.getAttribute("title")!==(a.title==null?null:a.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(i=e.getAttribute("src"),(i!==(a.src==null?null:a.src)||e.getAttribute("type")!==(a.type==null?null:a.type)||e.getAttribute("crossorigin")!==(a.crossOrigin==null?null:a.crossOrigin))&&i&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var i=a.name==null?null:""+a.name;if(a.type==="hidden"&&e.getAttribute("name")===i)return e}else return e;if(e=Sr(e.nextSibling),e===null)break}return null}function V4(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Sr(e.nextSibling),e===null))return null;return e}function Om(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState==="complete"}function X4(e,t){var n=e.ownerDocument;if(e.data!=="$?"||n.readyState==="complete")t();else{var r=function(){t(),n.removeEventListener("DOMContentLoaded",r)};n.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}function Sr(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="F!"||t==="F")break;if(t==="/$")return null}}return e}var Rm=null;function U2(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}function L2(e,t,n){switch(t=Ic(n),e){case"html":if(e=t.documentElement,!e)throw Error(re(452));return e;case"head":if(e=t.head,!e)throw Error(re(453));return e;case"body":if(e=t.body,!e)throw Error(re(454));return e;default:throw Error(re(451))}}function kl(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);$0(e)}var ur=new Map,P2=new Set;function Uc(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var pa=Ve.d;Ve.d={f:Z4,r:K4,D:Q4,C:W4,L:J4,m:e6,X:n6,S:t6,M:r6};function Z4(){var e=pa.f(),t=Nc();return e||t}function K4(e){var t=mo(e);t!==null&&t.tag===5&&t.type==="form"?sb(t):pa.r(e)}var Xo=typeof document>"u"?null:document;function j2(e,t,n){var r=Xo;if(r&&typeof t=="string"&&t){var a=nr(t);a='link[rel="'+e+'"][href="'+a+'"]',typeof n=="string"&&(a+='[crossorigin="'+n+'"]'),P2.has(a)||(P2.add(a),e={rel:e,crossOrigin:n,href:t},r.querySelector(a)===null&&(t=r.createElement("link"),on(t,"link",e),Kt(t),r.head.appendChild(t)))}}function Q4(e){pa.D(e),j2("dns-prefetch",e,null)}function W4(e,t){pa.C(e,t),j2("preconnect",e,t)}function J4(e,t,n){pa.L(e,t,n);var r=Xo;if(r&&e&&t){var a='link[rel="preload"][as="'+nr(t)+'"]';t==="image"&&n&&n.imageSrcSet?(a+='[imagesrcset="'+nr(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(a+='[imagesizes="'+nr(n.imageSizes)+'"]')):a+='[href="'+nr(e)+'"]';var i=a;switch(t){case"style":i=Zo(e);break;case"script":i=Ko(e)}ur.has(i)||(e=vt({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),ur.set(i,e),r.querySelector(a)!==null||t==="style"&&r.querySelector($l(i))||t==="script"&&r.querySelector(Il(i))||(t=r.createElement("link"),on(t,"link",e),Kt(t),r.head.appendChild(t)))}}function e6(e,t){pa.m(e,t);var n=Xo;if(n&&e){var r=t&&typeof t.as=="string"?t.as:"script",a='link[rel="modulepreload"][as="'+nr(r)+'"][href="'+nr(e)+'"]',i=a;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=Ko(e)}if(!ur.has(i)&&(e=vt({rel:"modulepreload",href:e},t),ur.set(i,e),n.querySelector(a)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Il(i)))return}r=n.createElement("link"),on(r,"link",e),Kt(r),n.head.appendChild(r)}}}function t6(e,t,n){pa.S(e,t,n);var r=Xo;if(r&&e){var a=po(r).hoistableStyles,i=Zo(e);t=t||"default";var o=a.get(i);if(!o){var s={loading:0,preload:null};if(o=r.querySelector($l(i)))s.loading=5;else{e=vt({rel:"stylesheet",href:e,"data-precedence":t},n),(n=ur.get(i))&&zm(e,n);var l=o=r.createElement("link");Kt(l),on(l,"link",e),l._p=new Promise(function(u,c){l.onload=u,l.onerror=c}),l.addEventListener("load",function(){s.loading|=1}),l.addEventListener("error",function(){s.loading|=2}),s.loading|=4,Lc(o,t,r)}o={type:"stylesheet",instance:o,count:1,state:s},a.set(i,o)}}}function n6(e,t){pa.X(e,t);var n=Xo;if(n&&e){var r=po(n).hoistableScripts,a=Ko(e),i=r.get(a);i||(i=n.querySelector(Il(a)),i||(e=vt({src:e,async:!0},t),(t=ur.get(a))&&km(e,t),i=n.createElement("script"),Kt(i),on(i,"link",e),n.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},r.set(a,i))}}function r6(e,t){pa.M(e,t);var n=Xo;if(n&&e){var r=po(n).hoistableScripts,a=Ko(e),i=r.get(a);i||(i=n.querySelector(Il(a)),i||(e=vt({src:e,async:!0,type:"module"},t),(t=ur.get(a))&&km(e,t),i=n.createElement("script"),Kt(i),on(i,"link",e),n.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},r.set(a,i))}}function H2(e,t,n,r){var a=(a=Oa.current)?Uc(a):null;if(!a)throw Error(re(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Zo(n.href),n=po(a).hoistableStyles,r=n.get(t),r||(r={type:"style",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Zo(n.href);var i=po(a).hoistableStyles,o=i.get(e);if(o||(a=a.ownerDocument||a,o={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},i.set(e,o),(i=a.querySelector($l(e)))&&!i._p&&(o.instance=i,o.state.loading=5),ur.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},ur.set(e,n),i||a6(a,e,n,o.state))),t&&r===null)throw Error(re(528,""));return o}if(t&&r!==null)throw Error(re(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Ko(n),n=po(a).hoistableScripts,r=n.get(t),r||(r={type:"script",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(re(444,e))}}function Zo(e){return'href="'+nr(e)+'"'}function $l(e){return'link[rel="stylesheet"]['+e+"]"}function q2(e){return vt({},e,{"data-precedence":e.precedence,precedence:null})}function a6(e,t,n,r){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?r.loading=1:(t=e.createElement("link"),r.preload=t,t.addEventListener("load",function(){return r.loading|=1}),t.addEventListener("error",function(){return r.loading|=2}),on(t,"link",n),Kt(t),e.head.appendChild(t))}function Ko(e){return'[src="'+nr(e)+'"]'}function Il(e){return"script[async]"+e}function Y2(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+nr(n.href)+'"]');if(r)return t.instance=r,Kt(r),r;var a=vt({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),Kt(r),on(r,"style",a),Lc(r,n.precedence,e),t.instance=r;case"stylesheet":a=Zo(n.href);var i=e.querySelector($l(a));if(i)return t.state.loading|=4,t.instance=i,Kt(i),i;r=q2(n),(a=ur.get(a))&&zm(r,a),i=(e.ownerDocument||e).createElement("link"),Kt(i);var o=i;return o._p=new Promise(function(s,l){o.onload=s,o.onerror=l}),on(i,"link",r),t.state.loading|=4,Lc(i,n.precedence,e),t.instance=i;case"script":return i=Ko(n.src),(a=e.querySelector(Il(i)))?(t.instance=a,Kt(a),a):(r=n,(a=ur.get(i))&&(r=vt({},n),km(r,a)),e=e.ownerDocument||e,a=e.createElement("script"),Kt(a),on(a,"link",r),e.head.appendChild(a),t.instance=a);case"void":return null;default:throw Error(re(443,t.type))}else t.type==="stylesheet"&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Lc(r,n.precedence,e));return t.instance}function Lc(e,t,n){for(var r=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),a=r.length?r[r.length-1]:null,i=a,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)i=s;else if(i!==a)break}i?i.parentNode.insertBefore(e,i.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function zm(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function km(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Pc=null;function G2(e,t,n){if(Pc===null){var r=new Map,a=Pc=new Map;a.set(n,r)}else a=Pc,r=a.get(n),r||(r=new Map,a.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),a=0;a<n.length;a++){var i=n[a];if(!(i[Qs]||i[fn]||e==="link"&&i.getAttribute("rel")==="stylesheet")&&i.namespaceURI!=="http://www.w3.org/2000/svg"){var o=i.getAttribute(t)||"";o=e+o;var s=r.get(o);s?s.push(i):r.set(o,[i])}}return r}function V2(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function i6(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function X2(e){return!(e.type==="stylesheet"&&!(e.state.loading&3))}var Ul=null;function o6(){}function s6(e,t,n){if(Ul===null)throw Error(re(475));var r=Ul;if(t.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&!(t.state.loading&4)){if(t.instance===null){var a=Zo(n.href),i=e.querySelector($l(a));if(i){e=i._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(r.count++,r=jc.bind(r),e.then(r,r)),t.state.loading|=4,t.instance=i,Kt(i);return}i=e.ownerDocument||e,n=q2(n),(a=ur.get(a))&&zm(n,a),i=i.createElement("link"),Kt(i);var o=i;o._p=new Promise(function(s,l){o.onload=s,o.onerror=l}),on(i,"link",n),t.instance=i}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(t,e),(e=t.state.preload)&&!(t.state.loading&3)&&(r.count++,t=jc.bind(r),e.addEventListener("load",t),e.addEventListener("error",t))}}function l6(){if(Ul===null)throw Error(re(475));var e=Ul;return e.stylesheets&&e.count===0&&$m(e,e.stylesheets),0<e.count?function(t){var n=setTimeout(function(){if(e.stylesheets&&$m(e,e.stylesheets),e.unsuspend){var r=e.unsuspend;e.unsuspend=null,r()}},6e4);return e.unsuspend=t,function(){e.unsuspend=null,clearTimeout(n)}}:null}function jc(){if(this.count--,this.count===0){if(this.stylesheets)$m(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Hc=null;function $m(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Hc=new Map,t.forEach(u6,e),Hc=null,jc.call(e))}function u6(e,t){if(!(t.state.loading&4)){var n=Hc.get(e);if(n)var r=n.get(null);else{n=new Map,Hc.set(e,n);for(var a=e.querySelectorAll("link[data-precedence],style[data-precedence]"),i=0;i<a.length;i++){var o=a[i];(o.nodeName==="LINK"||o.getAttribute("media")!=="not all")&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}a=t.instance,o=a.getAttribute("data-precedence"),i=n.get(o)||r,i===r&&n.set(null,a),n.set(o,a),this.count++,r=jc.bind(this),a.addEventListener("load",r),a.addEventListener("error",r),i?i.parentNode.insertBefore(a,i.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(a,e.firstChild)),t.state.loading|=4}}var Ll={$$typeof:ea,Provider:null,Consumer:null,_currentValue:Ei,_currentValue2:Ei,_threadCount:0};function c6(e,t,n,r,a,i,o,s){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=O0(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=O0(0),this.hiddenUpdates=O0(null),this.identifierPrefix=r,this.onUncaughtError=a,this.onCaughtError=i,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=s,this.incompleteTransitions=new Map}function Z2(e,t,n,r,a,i,o,s,l,u,c,f){return e=new c6(e,t,n,o,s,l,u,f),t=1,i===!0&&(t|=24),i=Hn(3,null,null,t),e.current=i,i.stateNode=e,t=yh(),t.refCount++,e.pooledCache=t,t.refCount++,i.memoizedState={element:r,isDehydrated:n,cache:t},wh(i),e}function K2(e){return e?(e=To,e):To}function Q2(e,t,n,r,a,i){a=K2(a),r.context===null?r.context=a:r.pendingContext=a,r=Ua(t),r.payload={element:n},i=i===void 0?null:i,i!==null&&(r.callback=i),n=La(e,r,t),n!==null&&(Xn(n,e,t),gl(n,e,t))}function W2(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Im(e,t){W2(e,t),(e=e.alternate)&&W2(e,t)}function J2(e){if(e.tag===13){var t=Co(e,67108864);t!==null&&Xn(t,e,67108864),Im(e,67108864)}}var qc=!0;function f6(e,t,n,r){var a=Ce.T;Ce.T=null;var i=Ve.p;try{Ve.p=2,Um(e,t,n,r)}finally{Ve.p=i,Ce.T=a}}function d6(e,t,n,r){var a=Ce.T;Ce.T=null;var i=Ve.p;try{Ve.p=8,Um(e,t,n,r)}finally{Ve.p=i,Ce.T=a}}function Um(e,t,n,r){if(qc){var a=Lm(r);if(a===null)Cm(e,t,r,Yc,n),tD(e,r);else if(m6(a,e,t,n,r))r.stopPropagation();else if(tD(e,r),t&4&&-1<h6.indexOf(e)){for(;a!==null;){var i=mo(a);if(i!==null)switch(i.tag){case 3:if(i=i.stateNode,i.current.memoizedState.isDehydrated){var o=Ai(i.pendingLanes);if(o!==0){var s=i;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var l=1<<31-Pn(o);s.entanglements[1]|=l,o&=~l}Lr(i),!(Je&6)&&(Mc=zr()+500,Ol(0))}}break;case 13:s=Co(i,2),s!==null&&Xn(s,i,2),Nc(),Im(i,2)}if(i=Lm(r),i===null&&Cm(e,t,r,Yc,n),i===a)break;a=i}a!==null&&r.stopPropagation()}else Cm(e,t,r,null,n)}}function Lm(e){return e=Y0(e),Pm(e)}var Yc=null;function Pm(e){if(Yc=null,e=ho(e),e!==null){var t=Hs(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=lv(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Yc=e,null}function eD(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(WC()){case mv:return 2;case pv:return 8;case $u:case JC:return 32;case gv:return 268435456;default:return 32}default:return 32}}var jm=!1,Ja=null,ei=null,ti=null,Pl=new Map,jl=new Map,ni=[],h6="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function tD(e,t){switch(e){case"focusin":case"focusout":Ja=null;break;case"dragenter":case"dragleave":ei=null;break;case"mouseover":case"mouseout":ti=null;break;case"pointerover":case"pointerout":Pl.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":jl.delete(t.pointerId)}}function Hl(e,t,n,r,a,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[a]},t!==null&&(t=mo(t),t!==null&&J2(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function m6(e,t,n,r,a){switch(t){case"focusin":return Ja=Hl(Ja,e,t,n,r,a),!0;case"dragenter":return ei=Hl(ei,e,t,n,r,a),!0;case"mouseover":return ti=Hl(ti,e,t,n,r,a),!0;case"pointerover":var i=a.pointerId;return Pl.set(i,Hl(Pl.get(i)||null,e,t,n,r,a)),!0;case"gotpointercapture":return i=a.pointerId,jl.set(i,Hl(jl.get(i)||null,e,t,n,r,a)),!0}return!1}function nD(e){var t=ho(e.target);if(t!==null){var n=Hs(t);if(n!==null){if(t=n.tag,t===13){if(t=lv(n),t!==null){e.blockedOn=t,s5(e.priority,function(){if(n.tag===13){var r=Vn();r=R0(r);var a=Co(n,r);a!==null&&Xn(a,n,r),Im(n,r)}});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Gc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Lm(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);q0=r,n.target.dispatchEvent(r),q0=null}else return t=mo(n),t!==null&&J2(t),e.blockedOn=n,!1;t.shift()}return!0}function rD(e,t,n){Gc(e)&&n.delete(t)}function p6(){jm=!1,Ja!==null&&Gc(Ja)&&(Ja=null),ei!==null&&Gc(ei)&&(ei=null),ti!==null&&Gc(ti)&&(ti=null),Pl.forEach(rD),jl.forEach(rD)}function Vc(e,t){e.blockedOn===t&&(e.blockedOn=null,jm||(jm=!0,Yt.unstable_scheduleCallback(Yt.unstable_NormalPriority,p6)))}var Xc=null;function aD(e){Xc!==e&&(Xc=e,Yt.unstable_scheduleCallback(Yt.unstable_NormalPriority,function(){Xc===e&&(Xc=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],a=e[t+2];if(typeof r!="function"){if(Pm(r||n)===null)continue;break}var i=mo(n);i!==null&&(e.splice(t,3),t-=3,Ph(i,{pending:!0,data:a,method:n.method,action:r},r,a))}}))}function ql(e){function t(l){return Vc(l,e)}Ja!==null&&Vc(Ja,e),ei!==null&&Vc(ei,e),ti!==null&&Vc(ti,e),Pl.forEach(t),jl.forEach(t);for(var n=0;n<ni.length;n++){var r=ni[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<ni.length&&(n=ni[0],n.blockedOn===null);)nD(n),n.blockedOn===null&&ni.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var a=n[r],i=n[r+1],o=a[Mn]||null;if(typeof i=="function")o||aD(n);else if(o){var s=null;if(i&&i.hasAttribute("formAction")){if(a=i,o=i[Mn]||null)s=o.formAction;else if(Pm(a)!==null)continue}else s=o.action;typeof s=="function"?n[r+1]=s:(n.splice(r,3),r-=3),aD(n)}}}function Hm(e){this._internalRoot=e}Zc.prototype.render=Hm.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(re(409));var n=t.current,r=Vn();Q2(n,r,e,t,null,null)},Zc.prototype.unmount=Hm.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Q2(e.current,2,null,e,null,null),Nc(),t[fo]=null}};function Zc(e){this._internalRoot=e}Zc.prototype.unstable_scheduleHydration=function(e){if(e){var t=Sv();e={blockedOn:null,target:e,priority:t};for(var n=0;n<ni.length&&t!==0&&t<ni[n].priority;n++);ni.splice(n,0,e),n===0&&nD(e)}};var iD=ov.version;if(iD!=="19.1.1")throw Error(re(527,iD,"19.1.1"));Ve.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(re(188)):(e=Object.keys(e).join(","),Error(re(268,e)));return e=YC(t),e=e!==null?cv(e):null,e=e===null?null:e.stateNode,e};var g6={bundleType:0,version:"19.1.1",rendererPackageName:"react-dom",currentDispatcherRef:Ce,reconcilerVersion:"19.1.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Kc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Kc.isDisabled&&Kc.supportsFiber)try{Xs=Kc.inject(g6),Ln=Kc}catch{}}Fu.createRoot=function(e,t){if(!sv(e))throw Error(re(299));var n=!1,r="",a=Sb,i=wb,o=xb,s=null;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(a=t.onUncaughtError),t.onCaughtError!==void 0&&(i=t.onCaughtError),t.onRecoverableError!==void 0&&(o=t.onRecoverableError),t.unstable_transitionCallbacks!==void 0&&(s=t.unstable_transitionCallbacks)),t=Z2(e,1,!1,null,null,n,r,a,i,o,s,null),e[fo]=t.current,Am(e),new Hm(t)},Fu.hydrateRoot=function(e,t,n){if(!sv(e))throw Error(re(299));var r=!1,a="",i=Sb,o=wb,s=xb,l=null,u=null;return n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onUncaughtError!==void 0&&(i=n.onUncaughtError),n.onCaughtError!==void 0&&(o=n.onCaughtError),n.onRecoverableError!==void 0&&(s=n.onRecoverableError),n.unstable_transitionCallbacks!==void 0&&(l=n.unstable_transitionCallbacks),n.formState!==void 0&&(u=n.formState)),t=Z2(e,1,!0,t,n??null,r,a,i,o,s,l,u),t.context=K2(null),n=t.current,r=Vn(),r=R0(r),a=Ua(r),a.callback=null,La(n,a,r),n=r,t.current.lanes=n,Ks(t,n),Lr(t),e[fo]=t.current,Am(e),new Zc(t)},Fu.version="19.1.1";function oD(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(oD)}catch(e){console.error(e)}}oD(),ev.exports=Fu;var v6=ev.exports;const y6=(e,t)=>t.type==="selectUnitMetrics"?{...e,selectedUnitMetrics:t.unitMetrics}:t.type==="initialize"?{...e,allUnitMetrics:[...new Set([...e.allUnitMetrics||[],...t.unitMetrics])].sort()}:e,sD=Rt.createContext({}),qm=()=>{const e=_.useContext(sD),t=_.useMemo(()=>e.unitMetricSelectionDispatch||(()=>{}),[e.unitMetricSelectionDispatch]);return{selectedUnitMetrics:e.unitMetricSelection?.selectedUnitMetrics||[],allUnitMetrics:e.unitMetricSelection?.allUnitMetrics||[],unitMetricSelectionDispatch:t}},$t=e=>{if(typeof e=="number")return e;if(typeof e=="string"){const t=b6(e);try{const n=parseFloat(t);return isNaN(n)?0:n}catch{return 0}}else return 0},b6=e=>{let t=0;for(;t<e.length&&D6(e[t]);)t++;return e.slice(t)},D6=e=>isNaN(parseFloat(e)),Pr=e=>[...e].sort((t,n)=>{if(typeof t=="number"&&typeof n=="number")return t-n;{if(!isNaN(parseInt(t+""))&&!isNaN(parseInt(n+"")))return parseInt(t+"")-parseInt(n+"");const r=(t+"")[0],a=(n+"")[0];if(r===a){const i=(t+"").slice(1),o=(n+"").slice(1);return!isNaN(parseInt(i))&&!isNaN(parseInt(o))?parseInt(i)-parseInt(o):t<n?-1:t>n?1:0}else return t<n?-1:t>n?1:0}}),Qo=(e,t)=>{const{targetUnit:n}=t;if(n===void 0)throw Error("UNIQUE_SELECT for unit selection requires a target unit to be set.");return{...e,lastClickedId:n,selectedUnitIds:new Set(e.selectedUnitIds.has(n)?[]:[n]),currentUnitId:n}},S6=e=>{if(e.lastClickedId===void 0)return e.orderedUnitIds.length===0?e:Qo(e,{targetUnit:e.orderedUnitIds[0]});const t=e.orderedUnitIds.indexOf(e.lastClickedId);if(t<0)return e;const n=e.orderedUnitIds[t+1];return n===void 0?e:Qo(e,{targetUnit:n})},w6=e=>{if(e.lastClickedId===void 0)return e;const t=e.orderedUnitIds.indexOf(e.lastClickedId);if(t<0||t===0)return e;const n=e.orderedUnitIds[t-1];return n===void 0?e:Qo(e,{targetUnit:n})},x6=e=>e.orderedUnitIds.length===0?e:Qo(e,{targetUnit:e.orderedUnitIds[0]}),E6=e=>e.orderedUnitIds.length===0?e:Qo(e,{targetUnit:e.orderedUnitIds[e.orderedUnitIds.length-1]}),A6=(e,t)=>({...e,currentUnitId:(t.incomingSelectedUnitIds||[])[0],selectedUnitIds:new Set(t.incomingSelectedUnitIds??[])}),lD=e=>e.selectedUnitIds.size===0?"none":e.selectedUnitIds.size===e.orderedUnitIds.length?"all":!e.visibleUnitIds||e.visibleUnitIds.length===0||e.selectedUnitIds.size!==e.visibleUnitIds.length||e.visibleUnitIds.some(t=>!e.selectedUnitIds.has(t))?"partial":"all",uD=(e,t)=>{if(t.targetUnit===void 0)throw new Error("Attempt to toggle unit with unset unitid.");const n=new Set([...e.selectedUnitIds]);n.has(t.targetUnit)?n.delete(t.targetUnit):n.add(t.targetUnit);let r=e.currentUnitId;return t.targetUnit===e.currentUnitId&&(r=[...n][0]),[...n].length===1&&(r=[...n][0]),{...e,selectedUnitIds:n,currentUnitId:r,lastClickedId:t.targetUnit}},C6=(e,t)=>{const{selectedUnitIds:n,lastClickedId:r,orderedUnitIds:a}=e,{targetUnit:i}=t;if(a.length===0)throw Error("Attempt to toggle range with no units initialized.");if(!r||!i)return console.warn(`Cannot toggle range with undefined limit: last-clicked ${r}, target ${i}`),e;const o=a.findIndex(u=>u===r),s=a.findIndex(u=>u===i);if(o===-1||s===-1)throw Error(`Requested to toggle unit range from ID ${r} to ID ${i} but one of these was not found.`);const l=a.slice(Math.min(o,s),Math.max(o,s)+1);return n.has(i)?l.forEach(u=>n.delete(u)):l.forEach(u=>n.add(u)),e.currentUnitId?n.has(e.currentUnitId)||(e.currentUnitId=[...n][0]):e.currentUnitId=[...n][0],{...e,lastClickedId:i,selectedUnitIds:new Set(n),currentUnitId:e.currentUnitId}},T6=e=>{const t=lD(e),n=t==="all"||t==="partial"?new Set:new Set(e.orderedUnitIds);return e.currentUnitId?n.has(e.currentUnitId)||(e.currentUnitId=[...n][0]):e.currentUnitId=[...n][0],{...e,selectedUnitIds:n}},M6=e=>t=>n=>{N6(t,e,n)},_6=e=>t=>n=>{F6(t,e,n)},N6=(e,t,n)=>{const r={type:n.ctrlKey?Ym:n.shiftKey?Vm:Gm,targetUnit:e};t(r)},F6=(e,t,n)=>{const r={type:n.shiftKey?Vm:n.ctrlKey?Gm:Ym,targetUnit:e};t(r)},B6=()=>{},Qc=20,O6=(e,t)=>{if(t.newVisibleUnitIds&&t.newVisibleUnitIds.length>0)return{...e,visibleUnitIds:t.newVisibleUnitIds};const n=t.unitsPerPage||e.unitsPerPage||Qc,r=t.pageNumber||e.page||1;if(n===e.unitsPerPage&&r===e.page)return e;const a=r!==e.page?r:1+Math.floor((e.unitsPerPage||Qc)*(r-1)/n),i=n*(a-1);return{...e,page:a,unitsPerPage:n,visibleUnitIds:e.orderedUnitIds.slice(i,i+n)}},R6=(e,t)=>({...e,restrictedUnitIds:t.newRestrictedUnitIds,selectedUnitIds:t.newRestrictedUnitIds!==void 0&&e.selectedUnitIds!==void 0?new Set([...e.selectedUnitIds].filter(n=>!t.newRestrictedUnitIds||t.newRestrictedUnitIds.includes(n))):e.selectedUnitIds}),cD=(e,t)=>{const n=(e.unitsPerPage||Qc)*((e.page||1)-1);return e.visibleUnitIds&&e.visibleUnitIds.length>0?t.slice(n,n+(e.unitsPerPage||Qc)):void 0},z6=(e,t)=>{const{newUnitOrder:n}=t,{orderedUnitIds:r}=e;if(!n||n.length===0)throw Error("Attempt to reset unit ordering to empty set.");const a=new Set(r);if(a.size>0&&(n.length!==a.size||n.some(o=>!a.has(o))))throw Error("Reordering units, but the set of units in the new and old ordering don't match.");if(r.every((o,s)=>o===n[s]))return e;const i=cD(e,n);return{...e,orderedUnitIds:n,lastClickedId:void 0,visibleUnitIds:i,sortRules:[]}},k6=(e,t)=>{const{sortRules:n}=e,{newSortField:r,sortCallback:a}=t;if(r===void 0||a===void 0)throw Error("Attempt to update sort fields with undefined field or callback.");const i=$6(n||[],r,t.ascending),o=a(i),s=cD(e,o);return{...e,sortRules:i,orderedUnitIds:o,visibleUnitIds:s,lastClickedId:void 0}},$6=(e,t,n)=>{const r=e.pop(),a=n===void 0?r?.columnName===t?!r.sortAscending:!0:n;return r&&r.columnName!==t&&e.push(r),[...e.filter(o=>o.columnName!==t),{columnName:t,sortAscending:a}]},I6="SET_SELECTION",Ym="UNIQUE_SELECT",fD="UNIQUE_SELECT_NEXT",dD="UNIQUE_SELECT_PREVIOUS",hD="UNIQUE_SELECT_FIRST",mD="UNIQUE_SELECT_LAST",Gm="TOGGLE_UNIT",Vm="TOGGLE_RANGE",pD="TOGGLE_SELECT_ALL",U6="DESELECT_ALL",Wo="INITIALIZE_UNITS",L6="SET_UNIT_ORDER",gD="UPDATE_SORT_FIELDS",P6="SET_VISIBLE_UNITS",j6="SET_RESTRICTED_UNITS",H6="COPY_STATE",vD={selectedUnitIds:new Set,currentUnitId:void 0,orderedUnitIds:[]},q6=(e,t)=>{const{type:n}=t;switch(n){case Wo:{const r=new Set(e.orderedUnitIds);if((t.newUnitOrder||[]).filter(a=>!r.has(a)).length===0)return e;if(t.newUnitOrder&&t.newUnitOrder.length>=1)return{...e,orderedUnitIds:Pr([...new Set([...t.newUnitOrder,...e.orderedUnitIds])])};throw Error("Attempt to initialize table ordering with no actual units passed.")}case I6:return A6(e,t);case Ym:return Qo(e,t);case fD:return S6(e);case dD:return w6(e);case hD:return x6(e);case mD:return E6(e);case Gm:return uD(e,t);case Vm:return e.lastClickedId?C6(e,t):uD(e,t);case pD:return T6(e);case U6:return{...e,selectedUnitIds:new Set,currentUnitId:void 0};case L6:return z6(e,t);case gD:return k6(e,t);case P6:return O6(e,t);case j6:return R6(e,t);case H6:if(!t.sourceState)throw Error("Attempt to copy state but no source state was provided.");return{...t.sourceState};default:throw Error(`Invalid mode for unit selection reducer: ${n}`)}},Y6=()=>_.useContext(yD),yD=Rt.createContext({unitSelection:vD,unitSelectionDispatch:()=>{}}),ri=()=>{const{unitSelection:e,unitSelectionDispatch:t}=Y6(),n=_.useMemo(()=>M6(t),[t]),r=_.useMemo(()=>_6(t),[t]),a=_.useMemo(()=>G6(e.orderedUnitIds,e.restrictedUnitIds),[e.orderedUnitIds,e.restrictedUnitIds]);return{selectedUnitIds:e.selectedUnitIds,currentUnitId:e.currentUnitId,orderedUnitIds:a,allOrderedUnitIds:e.orderedUnitIds,visibleUnitIds:e.visibleUnitIds,primarySortRule:e.sortRules&&e.sortRules.length>0?e.sortRules[e.sortRules.length-1]:void 0,page:e.page,unitsPerPage:e.unitsPerPage,checkboxClickHandlerGenerator:n,plotClickHandlerGenerator:r,unitIdSelectionDispatch:t,currentState:e,restrictedUnitIds:e.restrictedUnitIds}},G6=(e,t)=>{if(t===void 0)return e;const n=new Set(t);return e.filter(r=>n.has(r))},{min:V6,max:X6}=Math,Hi=(e,t=0,n=1)=>V6(X6(t,e),n),Xm=e=>{e._clipped=!1,e._unclipped=e.slice(0);for(let t=0;t<=3;t++)t<3?((e[t]<0||e[t]>255)&&(e._clipped=!0),e[t]=Hi(e[t],0,255)):t===3&&(e[t]=Hi(e[t],0,1));return e},bD={};for(let e of["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"])bD[`[object ${e}]`]=e.toLowerCase();function $e(e){return bD[Object.prototype.toString.call(e)]||"object"}const Ne=(e,t=null)=>e.length>=3?Array.prototype.slice.call(e):$e(e[0])=="object"&&t?t.split("").filter(n=>e[0][n]!==void 0).map(n=>e[0][n]):e[0].slice(0),Jo=e=>{if(e.length<2)return null;const t=e.length-1;return $e(e[t])=="string"?e[t].toLowerCase():null},{PI:Wc,min:DD,max:SD}=Math,cr=e=>Math.round(e*100)/100,Zm=e=>Math.round(e*100)/100,ga=Wc*2,Km=Wc/3,Z6=Wc/180,K6=180/Wc;function wD(e){return[...e.slice(0,3).reverse(),...e.slice(3)]}const _e={format:{},autodetect:[]};class oe{constructor(...t){const n=this;if($e(t[0])==="object"&&t[0].constructor&&t[0].constructor===this.constructor)return t[0];let r=Jo(t),a=!1;if(!r){a=!0,_e.sorted||(_e.autodetect=_e.autodetect.sort((i,o)=>o.p-i.p),_e.sorted=!0);for(let i of _e.autodetect)if(r=i.test(...t),r)break}if(_e.format[r]){const i=_e.format[r].apply(null,a?t:t.slice(0,-1));n._rgb=Xm(i)}else throw new Error("unknown format: "+t);n._rgb.length===3&&n._rgb.push(1)}toString(){return $e(this.hex)=="function"?this.hex():`[${this._rgb.join(",")}]`}}const Q6="3.1.2",Le=(...e)=>new oe(...e);Le.version=Q6;const es={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",laserlemon:"#ffff54",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrod:"#fafad2",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",maroon2:"#7f0000",maroon3:"#b03060",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",purple2:"#7f007f",purple3:"#a020f0",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},W6=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,J6=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/,xD=e=>{if(e.match(W6)){(e.length===4||e.length===7)&&(e=e.substr(1)),e.length===3&&(e=e.split(""),e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]);const t=parseInt(e,16),n=t>>16,r=t>>8&255,a=t&255;return[n,r,a,1]}if(e.match(J6)){(e.length===5||e.length===9)&&(e=e.substr(1)),e.length===4&&(e=e.split(""),e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]);const t=parseInt(e,16),n=t>>24&255,r=t>>16&255,a=t>>8&255,i=Math.round((t&255)/255*100)/100;return[n,r,a,i]}throw new Error(`unknown hex color: ${e}`)},{round:Jc}=Math,ED=(...e)=>{let[t,n,r,a]=Ne(e,"rgba"),i=Jo(e)||"auto";a===void 0&&(a=1),i==="auto"&&(i=a<1?"rgba":"rgb"),t=Jc(t),n=Jc(n),r=Jc(r);let s="000000"+(t<<16|n<<8|r).toString(16);s=s.substr(s.length-6);let l="0"+Jc(a*255).toString(16);switch(l=l.substr(l.length-2),i.toLowerCase()){case"rgba":return`#${s}${l}`;case"argb":return`#${l}${s}`;default:return`#${s}`}};oe.prototype.name=function(){const e=ED(this._rgb,"rgb");for(let t of Object.keys(es))if(es[t]===e)return t.toLowerCase();return e},_e.format.named=e=>{if(e=e.toLowerCase(),es[e])return xD(es[e]);throw new Error("unknown color name: "+e)},_e.autodetect.push({p:5,test:(e,...t)=>{if(!t.length&&$e(e)==="string"&&es[e.toLowerCase()])return"named"}}),oe.prototype.alpha=function(e,t=!1){return e!==void 0&&$e(e)==="number"?t?(this._rgb[3]=e,this):new oe([this._rgb[0],this._rgb[1],this._rgb[2],e],"rgb"):this._rgb[3]},oe.prototype.clipped=function(){return this._rgb._clipped||!1};const jr={Kn:18,labWhitePoint:"d65",Xn:.95047,Yn:1,Zn:1.08883,kE:216/24389,kKE:8,kK:24389/27,RefWhiteRGB:{X:.95047,Y:1,Z:1.08883},MtxRGB2XYZ:{m00:.4124564390896922,m01:.21267285140562253,m02:.0193338955823293,m10:.357576077643909,m11:.715152155287818,m12:.11919202588130297,m20:.18043748326639894,m21:.07217499330655958,m22:.9503040785363679},MtxXYZ2RGB:{m00:3.2404541621141045,m01:-.9692660305051868,m02:.055643430959114726,m10:-1.5371385127977166,m11:1.8760108454466942,m12:-.2040259135167538,m20:-.498531409556016,m21:.041556017530349834,m22:1.0572251882231791},As:.9414285350000001,Bs:1.040417467,Cs:1.089532651,MtxAdaptMa:{m00:.8951,m01:-.7502,m02:.0389,m10:.2664,m11:1.7135,m12:-.0685,m20:-.1614,m21:.0367,m22:1.0296},MtxAdaptMaI:{m00:.9869929054667123,m01:.43230526972339456,m02:-.008528664575177328,m10:-.14705425642099013,m11:.5183602715367776,m12:.04004282165408487,m20:.15996265166373125,m21:.0492912282128556,m22:.9684866957875502}},eT=new Map([["a",[1.0985,.35585]],["b",[1.0985,.35585]],["c",[.98074,1.18232]],["d50",[.96422,.82521]],["d55",[.95682,.92149]],["d65",[.95047,1.08883]],["e",[1,1,1]],["f2",[.99186,.67393]],["f7",[.95041,1.08747]],["f11",[1.00962,.6435]],["icc",[.96422,.82521]]]);function va(e){const t=eT.get(String(e).toLowerCase());if(!t)throw new Error("unknown Lab illuminant "+e);jr.labWhitePoint=e,jr.Xn=t[0],jr.Zn=t[1]}function Yl(){return jr.labWhitePoint}const Qm=(...e)=>{e=Ne(e,"lab");const[t,n,r]=e,[a,i,o]=tT(t,n,r),[s,l,u]=AD(a,i,o);return[s,l,u,e.length>3?e[3]:1]},tT=(e,t,n)=>{const{kE:r,kK:a,kKE:i,Xn:o,Yn:s,Zn:l}=jr,u=(e+16)/116,c=.002*t+u,f=u-.005*n,d=c*c*c,h=f*f*f,g=d>r?d:(116*c-16)/a,m=e>i?Math.pow((e+16)/116,3):e/a,D=h>r?h:(116*f-16)/a,p=g*o,v=m*s,y=D*l;return[p,v,y]},Wm=e=>{const t=Math.sign(e);return e=Math.abs(e),(e<=.0031308?e*12.92:1.055*Math.pow(e,1/2.4)-.055)*t},AD=(e,t,n)=>{const{MtxAdaptMa:r,MtxAdaptMaI:a,MtxXYZ2RGB:i,RefWhiteRGB:o,Xn:s,Yn:l,Zn:u}=jr,c=s*r.m00+l*r.m10+u*r.m20,f=s*r.m01+l*r.m11+u*r.m21,d=s*r.m02+l*r.m12+u*r.m22,h=o.X*r.m00+o.Y*r.m10+o.Z*r.m20,g=o.X*r.m01+o.Y*r.m11+o.Z*r.m21,m=o.X*r.m02+o.Y*r.m12+o.Z*r.m22,D=(e*r.m00+t*r.m10+n*r.m20)*(h/c),p=(e*r.m01+t*r.m11+n*r.m21)*(g/f),v=(e*r.m02+t*r.m12+n*r.m22)*(m/d),y=D*a.m00+p*a.m10+v*a.m20,w=D*a.m01+p*a.m11+v*a.m21,E=D*a.m02+p*a.m12+v*a.m22,b=Wm(y*i.m00+w*i.m10+E*i.m20),S=Wm(y*i.m01+w*i.m11+E*i.m21),A=Wm(y*i.m02+w*i.m12+E*i.m22);return[b*255,S*255,A*255]},Jm=(...e)=>{const[t,n,r,...a]=Ne(e,"rgb"),[i,o,s]=CD(t,n,r),[l,u,c]=nT(i,o,s);return[l,u,c,...a.length>0&&a[0]<1?[a[0]]:[]]};function nT(e,t,n){const{Xn:r,Yn:a,Zn:i,kE:o,kK:s}=jr,l=e/r,u=t/a,c=n/i,f=l>o?Math.pow(l,1/3):(s*l+16)/116,d=u>o?Math.pow(u,1/3):(s*u+16)/116,h=c>o?Math.pow(c,1/3):(s*c+16)/116;return[116*d-16,500*(f-d),200*(d-h)]}function ep(e){const t=Math.sign(e);return e=Math.abs(e),(e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4))*t}const CD=(e,t,n)=>{e=ep(e/255),t=ep(t/255),n=ep(n/255);const{MtxRGB2XYZ:r,MtxAdaptMa:a,MtxAdaptMaI:i,Xn:o,Yn:s,Zn:l,As:u,Bs:c,Cs:f}=jr;let d=e*r.m00+t*r.m10+n*r.m20,h=e*r.m01+t*r.m11+n*r.m21,g=e*r.m02+t*r.m12+n*r.m22;const m=o*a.m00+s*a.m10+l*a.m20,D=o*a.m01+s*a.m11+l*a.m21,p=o*a.m02+s*a.m12+l*a.m22;let v=d*a.m00+h*a.m10+g*a.m20,y=d*a.m01+h*a.m11+g*a.m21,w=d*a.m02+h*a.m12+g*a.m22;return v*=m/u,y*=D/c,w*=p/f,d=v*i.m00+y*i.m10+w*i.m20,h=v*i.m01+y*i.m11+w*i.m21,g=v*i.m02+y*i.m12+w*i.m22,[d,h,g]};oe.prototype.lab=function(){return Jm(this._rgb)},Object.assign(Le,{lab:(...e)=>new oe(...e,"lab"),getLabWhitePoint:Yl,setLabWhitePoint:va}),_e.format.lab=Qm,_e.autodetect.push({p:2,test:(...e)=>{if(e=Ne(e,"lab"),$e(e)==="array"&&e.length===3)return"lab"}}),oe.prototype.darken=function(e=1){const t=this,n=t.lab();return n[0]-=jr.Kn*e,new oe(n,"lab").alpha(t.alpha(),!0)},oe.prototype.brighten=function(e=1){return this.darken(-e)},oe.prototype.darker=oe.prototype.darken,oe.prototype.brighter=oe.prototype.brighten,oe.prototype.get=function(e){const[t,n]=e.split("."),r=this[t]();if(n){const a=t.indexOf(n)-(t.substr(0,2)==="ok"?2:0);if(a>-1)return r[a];throw new Error(`unknown channel ${n} in mode ${t}`)}else return r};const{pow:rT}=Math,aT=1e-7,iT=20;oe.prototype.luminance=function(e,t="rgb"){if(e!==void 0&&$e(e)==="number"){if(e===0)return new oe([0,0,0,this._rgb[3]],"rgb");if(e===1)return new oe([255,255,255,this._rgb[3]],"rgb");let n=this.luminance(),r=iT;const a=(o,s)=>{const l=o.interpolate(s,.5,t),u=l.luminance();return Math.abs(e-u)<aT||!r--?l:u>e?a(o,l):a(l,s)},i=(n>e?a(new oe([0,0,0]),this):a(this,new oe([255,255,255]))).rgb();return new oe([...i,this._rgb[3]])}return oT(...this._rgb.slice(0,3))};const oT=(e,t,n)=>(e=tp(e),t=tp(t),n=tp(n),.2126*e+.7152*t+.0722*n),tp=e=>(e/=255,e<=.03928?e/12.92:rT((e+.055)/1.055,2.4)),hn={},ts=(e,t,n=.5,...r)=>{let a=r[0]||"lrgb";if(!hn[a]&&!r.length&&(a=Object.keys(hn)[0]),!hn[a])throw new Error(`interpolation mode ${a} is not defined`);return $e(e)!=="object"&&(e=new oe(e)),$e(t)!=="object"&&(t=new oe(t)),hn[a](e,t,n).alpha(e.alpha()+n*(t.alpha()-e.alpha()))};oe.prototype.mix=oe.prototype.interpolate=function(e,t=.5,...n){return ts(this,e,t,...n)},oe.prototype.premultiply=function(e=!1){const t=this._rgb,n=t[3];return e?(this._rgb=[t[0]*n,t[1]*n,t[2]*n,n],this):new oe([t[0]*n,t[1]*n,t[2]*n,n],"rgb")};const{sin:sT,cos:lT}=Math,TD=(...e)=>{let[t,n,r]=Ne(e,"lch");return isNaN(r)&&(r=0),r=r*Z6,[t,lT(r)*n,sT(r)*n]},np=(...e)=>{e=Ne(e,"lch");const[t,n,r]=e,[a,i,o]=TD(t,n,r),[s,l,u]=Qm(a,i,o);return[s,l,u,e.length>3?e[3]:1]},uT=(...e)=>{const t=wD(Ne(e,"hcl"));return np(...t)},{sqrt:cT,atan2:fT,round:dT}=Math,MD=(...e)=>{const[t,n,r]=Ne(e,"lab"),a=cT(n*n+r*r);let i=(fT(r,n)*K6+360)%360;return dT(a*1e4)===0&&(i=Number.NaN),[t,a,i]},rp=(...e)=>{const[t,n,r,...a]=Ne(e,"rgb"),[i,o,s]=Jm(t,n,r),[l,u,c]=MD(i,o,s);return[l,u,c,...a.length>0&&a[0]<1?[a[0]]:[]]};oe.prototype.lch=function(){return rp(this._rgb)},oe.prototype.hcl=function(){return wD(rp(this._rgb))},Object.assign(Le,{lch:(...e)=>new oe(...e,"lch"),hcl:(...e)=>new oe(...e,"hcl")}),_e.format.lch=np,_e.format.hcl=uT,["lch","hcl"].forEach(e=>_e.autodetect.push({p:2,test:(...t)=>{if(t=Ne(t,e),$e(t)==="array"&&t.length===3)return e}})),oe.prototype.saturate=function(e=1){const t=this,n=t.lch();return n[1]+=jr.Kn*e,n[1]<0&&(n[1]=0),new oe(n,"lch").alpha(t.alpha(),!0)},oe.prototype.desaturate=function(e=1){return this.saturate(-e)},oe.prototype.set=function(e,t,n=!1){const[r,a]=e.split("."),i=this[r]();if(a){const o=r.indexOf(a)-(r.substr(0,2)==="ok"?2:0);if(o>-1){if($e(t)=="string")switch(t.charAt(0)){case"+":i[o]+=+t;break;case"-":i[o]+=+t;break;case"*":i[o]*=+t.substr(1);break;case"/":i[o]/=+t.substr(1);break;default:i[o]=+t}else if($e(t)==="number")i[o]=t;else throw new Error("unsupported value for Color.set");const s=new oe(i,r);return n?(this._rgb=s._rgb,this):s}throw new Error(`unknown channel ${a} in mode ${r}`)}else return i},oe.prototype.tint=function(e=.5,...t){return ts(this,"white",e,...t)},oe.prototype.shade=function(e=.5,...t){return ts(this,"black",e,...t)};const hT=(e,t,n)=>{const r=e._rgb,a=t._rgb;return new oe(r[0]+n*(a[0]-r[0]),r[1]+n*(a[1]-r[1]),r[2]+n*(a[2]-r[2]),"rgb")};hn.rgb=hT;const{sqrt:ap,pow:ns}=Math,mT=(e,t,n)=>{const[r,a,i]=e._rgb,[o,s,l]=t._rgb;return new oe(ap(ns(r,2)*(1-n)+ns(o,2)*n),ap(ns(a,2)*(1-n)+ns(s,2)*n),ap(ns(i,2)*(1-n)+ns(l,2)*n),"rgb")};hn.lrgb=mT;const pT=(e,t,n)=>{const r=e.lab(),a=t.lab();return new oe(r[0]+n*(a[0]-r[0]),r[1]+n*(a[1]-r[1]),r[2]+n*(a[2]-r[2]),"lab")};hn.lab=pT;const rs=(e,t,n,r)=>{let a,i;r==="hsl"?(a=e.hsl(),i=t.hsl()):r==="hsv"?(a=e.hsv(),i=t.hsv()):r==="hcg"?(a=e.hcg(),i=t.hcg()):r==="hsi"?(a=e.hsi(),i=t.hsi()):r==="lch"||r==="hcl"?(r="hcl",a=e.hcl(),i=t.hcl()):r==="oklch"&&(a=e.oklch().reverse(),i=t.oklch().reverse());let o,s,l,u,c,f;(r.substr(0,1)==="h"||r==="oklch")&&([o,l,c]=a,[s,u,f]=i);let d,h,g,m;return!isNaN(o)&&!isNaN(s)?(s>o&&s-o>180?m=s-(o+360):s<o&&o-s>180?m=s+360-o:m=s-o,h=o+n*m):isNaN(o)?isNaN(s)?h=Number.NaN:(h=s,(c==1||c==0)&&r!="hsv"&&(d=u)):(h=o,(f==1||f==0)&&r!="hsv"&&(d=l)),d===void 0&&(d=l+n*(u-l)),g=c+n*(f-c),r==="oklch"?new oe([g,d,h],r):new oe([h,d,g],r)},_D=(e,t,n)=>rs(e,t,n,"lch");hn.lch=_D,hn.hcl=_D;const gT=e=>{if($e(e)=="number"&&e>=0&&e<=16777215){const t=e>>16,n=e>>8&255,r=e&255;return[t,n,r,1]}throw new Error("unknown num color: "+e)},vT=(...e)=>{const[t,n,r]=Ne(e,"rgb");return(t<<16)+(n<<8)+r};oe.prototype.num=function(){return vT(this._rgb)},Object.assign(Le,{num:(...e)=>new oe(...e,"num")}),_e.format.num=gT,_e.autodetect.push({p:5,test:(...e)=>{if(e.length===1&&$e(e[0])==="number"&&e[0]>=0&&e[0]<=16777215)return"num"}});const yT=(e,t,n)=>{const r=e.num(),a=t.num();return new oe(r+n*(a-r),"num")};hn.num=yT;const{floor:bT}=Math,DT=(...e)=>{e=Ne(e,"hcg");let[t,n,r]=e,a,i,o;r=r*255;const s=n*255;if(n===0)a=i=o=r;else{t===360&&(t=0),t>360&&(t-=360),t<0&&(t+=360),t/=60;const l=bT(t),u=t-l,c=r*(1-n),f=c+s*(1-u),d=c+s*u,h=c+s;switch(l){case 0:[a,i,o]=[h,d,c];break;case 1:[a,i,o]=[f,h,c];break;case 2:[a,i,o]=[c,h,d];break;case 3:[a,i,o]=[c,f,h];break;case 4:[a,i,o]=[d,c,h];break;case 5:[a,i,o]=[h,c,f];break}}return[a,i,o,e.length>3?e[3]:1]},ST=(...e)=>{const[t,n,r]=Ne(e,"rgb"),a=DD(t,n,r),i=SD(t,n,r),o=i-a,s=o*100/255,l=a/(255-o)*100;let u;return o===0?u=Number.NaN:(t===i&&(u=(n-r)/o),n===i&&(u=2+(r-t)/o),r===i&&(u=4+(t-n)/o),u*=60,u<0&&(u+=360)),[u,s,l]};oe.prototype.hcg=function(){return ST(this._rgb)};const wT=(...e)=>new oe(...e,"hcg");Le.hcg=wT,_e.format.hcg=DT,_e.autodetect.push({p:1,test:(...e)=>{if(e=Ne(e,"hcg"),$e(e)==="array"&&e.length===3)return"hcg"}});const xT=(e,t,n)=>rs(e,t,n,"hcg");hn.hcg=xT;const{cos:as}=Math,ET=(...e)=>{e=Ne(e,"hsi");let[t,n,r]=e,a,i,o;return isNaN(t)&&(t=0),isNaN(n)&&(n=0),t>360&&(t-=360),t<0&&(t+=360),t/=360,t<1/3?(o=(1-n)/3,a=(1+n*as(ga*t)/as(Km-ga*t))/3,i=1-(o+a)):t<2/3?(t-=1/3,a=(1-n)/3,i=(1+n*as(ga*t)/as(Km-ga*t))/3,o=1-(a+i)):(t-=2/3,i=(1-n)/3,o=(1+n*as(ga*t)/as(Km-ga*t))/3,a=1-(i+o)),a=Hi(r*a*3),i=Hi(r*i*3),o=Hi(r*o*3),[a*255,i*255,o*255,e.length>3?e[3]:1]},{min:AT,sqrt:CT,acos:TT}=Math,MT=(...e)=>{let[t,n,r]=Ne(e,"rgb");t/=255,n/=255,r/=255;let a;const i=AT(t,n,r),o=(t+n+r)/3,s=o>0?1-i/o:0;return s===0?a=NaN:(a=(t-n+(t-r))/2,a/=CT((t-n)*(t-n)+(t-r)*(n-r)),a=TT(a),r>n&&(a=ga-a),a/=ga),[a*360,s,o]};oe.prototype.hsi=function(){return MT(this._rgb)};const _T=(...e)=>new oe(...e,"hsi");Le.hsi=_T,_e.format.hsi=ET,_e.autodetect.push({p:2,test:(...e)=>{if(e=Ne(e,"hsi"),$e(e)==="array"&&e.length===3)return"hsi"}});const NT=(e,t,n)=>rs(e,t,n,"hsi");hn.hsi=NT;const ip=(...e)=>{e=Ne(e,"hsl");const[t,n,r]=e;let a,i,o;if(n===0)a=i=o=r*255;else{const s=[0,0,0],l=[0,0,0],u=r<.5?r*(1+n):r+n-r*n,c=2*r-u,f=t/360;s[0]=f+1/3,s[1]=f,s[2]=f-1/3;for(let d=0;d<3;d++)s[d]<0&&(s[d]+=1),s[d]>1&&(s[d]-=1),6*s[d]<1?l[d]=c+(u-c)*6*s[d]:2*s[d]<1?l[d]=u:3*s[d]<2?l[d]=c+(u-c)*(2/3-s[d])*6:l[d]=c;[a,i,o]=[l[0]*255,l[1]*255,l[2]*255]}return e.length>3?[a,i,o,e[3]]:[a,i,o,1]},ND=(...e)=>{e=Ne(e,"rgba");let[t,n,r]=e;t/=255,n/=255,r/=255;const a=DD(t,n,r),i=SD(t,n,r),o=(i+a)/2;let s,l;return i===a?(s=0,l=Number.NaN):s=o<.5?(i-a)/(i+a):(i-a)/(2-i-a),t==i?l=(n-r)/(i-a):n==i?l=2+(r-t)/(i-a):r==i&&(l=4+(t-n)/(i-a)),l*=60,l<0&&(l+=360),e.length>3&&e[3]!==void 0?[l,s,o,e[3]]:[l,s,o]};oe.prototype.hsl=function(){return ND(this._rgb)};const FT=(...e)=>new oe(...e,"hsl");Le.hsl=FT,_e.format.hsl=ip,_e.autodetect.push({p:2,test:(...e)=>{if(e=Ne(e,"hsl"),$e(e)==="array"&&e.length===3)return"hsl"}});const BT=(e,t,n)=>rs(e,t,n,"hsl");hn.hsl=BT;const{floor:OT}=Math,RT=(...e)=>{e=Ne(e,"hsv");let[t,n,r]=e,a,i,o;if(r*=255,n===0)a=i=o=r;else{t===360&&(t=0),t>360&&(t-=360),t<0&&(t+=360),t/=60;const s=OT(t),l=t-s,u=r*(1-n),c=r*(1-n*l),f=r*(1-n*(1-l));switch(s){case 0:[a,i,o]=[r,f,u];break;case 1:[a,i,o]=[c,r,u];break;case 2:[a,i,o]=[u,r,f];break;case 3:[a,i,o]=[u,c,r];break;case 4:[a,i,o]=[f,u,r];break;case 5:[a,i,o]=[r,u,c];break}}return[a,i,o,e.length>3?e[3]:1]},{min:zT,max:kT}=Math,$T=(...e)=>{e=Ne(e,"rgb");let[t,n,r]=e;const a=zT(t,n,r),i=kT(t,n,r),o=i-a;let s,l,u;return u=i/255,i===0?(s=Number.NaN,l=0):(l=o/i,t===i&&(s=(n-r)/o),n===i&&(s=2+(r-t)/o),r===i&&(s=4+(t-n)/o),s*=60,s<0&&(s+=360)),[s,l,u]};oe.prototype.hsv=function(){return $T(this._rgb)};const IT=(...e)=>new oe(...e,"hsv");Le.hsv=IT,_e.format.hsv=RT,_e.autodetect.push({p:2,test:(...e)=>{if(e=Ne(e,"hsv"),$e(e)==="array"&&e.length===3)return"hsv"}});const UT=(e,t,n)=>rs(e,t,n,"hsv");hn.hsv=UT;function ef(e,t){let n=e.length;Array.isArray(e[0])||(e=[e]),Array.isArray(t[0])||(t=t.map(o=>[o]));let r=t[0].length,a=t[0].map((o,s)=>t.map(l=>l[s])),i=e.map(o=>a.map(s=>Array.isArray(o)?o.reduce((l,u,c)=>l+u*(s[c]||0),0):s.reduce((l,u)=>l+u*o,0)));return n===1&&(i=i[0]),r===1?i.map(o=>o[0]):i}const op=(...e)=>{e=Ne(e,"lab");const[t,n,r,...a]=e,[i,o,s]=LT([t,n,r]),[l,u,c]=AD(i,o,s);return[l,u,c,...a.length>0&&a[0]<1?[a[0]]:[]]};function LT(e){var t=[[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],n=[[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]],r=ef(n,e);return ef(t,r.map(a=>a**3))}const sp=(...e)=>{const[t,n,r,...a]=Ne(e,"rgb"),i=CD(t,n,r);return[...PT(i),...a.length>0&&a[0]<1?[a[0]]:[]]};function PT(e){const t=[[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],n=[[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],r=ef(t,e);return ef(n,r.map(a=>Math.cbrt(a)))}oe.prototype.oklab=function(){return sp(this._rgb)},Object.assign(Le,{oklab:(...e)=>new oe(...e,"oklab")}),_e.format.oklab=op,_e.autodetect.push({p:2,test:(...e)=>{if(e=Ne(e,"oklab"),$e(e)==="array"&&e.length===3)return"oklab"}});const jT=(e,t,n)=>{const r=e.oklab(),a=t.oklab();return new oe(r[0]+n*(a[0]-r[0]),r[1]+n*(a[1]-r[1]),r[2]+n*(a[2]-r[2]),"oklab")};hn.oklab=jT;const HT=(e,t,n)=>rs(e,t,n,"oklch");hn.oklch=HT;const{pow:lp,sqrt:up,PI:cp,cos:FD,sin:BD,atan2:qT}=Math,YT=(e,t="lrgb",n=null)=>{const r=e.length;n||(n=Array.from(new Array(r)).map(()=>1));const a=r/n.reduce(function(f,d){return f+d});if(n.forEach((f,d)=>{n[d]*=a}),e=e.map(f=>new oe(f)),t==="lrgb")return GT(e,n);const i=e.shift(),o=i.get(t),s=[];let l=0,u=0;for(let f=0;f<o.length;f++)if(o[f]=(o[f]||0)*n[0],s.push(isNaN(o[f])?0:n[0]),t.charAt(f)==="h"&&!isNaN(o[f])){const d=o[f]/180*cp;l+=FD(d)*n[0],u+=BD(d)*n[0]}let c=i.alpha()*n[0];e.forEach((f,d)=>{const h=f.get(t);c+=f.alpha()*n[d+1];for(let g=0;g<o.length;g++)if(!isNaN(h[g]))if(s[g]+=n[d+1],t.charAt(g)==="h"){const m=h[g]/180*cp;l+=FD(m)*n[d+1],u+=BD(m)*n[d+1]}else o[g]+=h[g]*n[d+1]});for(let f=0;f<o.length;f++)if(t.charAt(f)==="h"){let d=qT(u/s[f],l/s[f])/cp*180;for(;d<0;)d+=360;for(;d>=360;)d-=360;o[f]=d}else o[f]=o[f]/s[f];return c/=r,new oe(o,t).alpha(c>.99999?1:c,!0)},GT=(e,t)=>{const n=e.length,r=[0,0,0,0];for(let a=0;a<e.length;a++){const i=e[a],o=t[a]/n,s=i._rgb;r[0]+=lp(s[0],2)*o,r[1]+=lp(s[1],2)*o,r[2]+=lp(s[2],2)*o,r[3]+=s[3]*o}return r[0]=up(r[0]),r[1]=up(r[1]),r[2]=up(r[2]),r[3]>.9999999&&(r[3]=1),new oe(Xm(r))},{pow:VT}=Math;function tf(e){let t="rgb",n=Le("#ccc"),r=0,a=[0,1],i=[],o=[0,0],s=!1,l=[],u=!1,c=0,f=1,d=!1,h={},g=!0,m=1;const D=function(S){if(S=S||["#fff","#000"],S&&$e(S)==="string"&&Le.brewer&&Le.brewer[S.toLowerCase()]&&(S=Le.brewer[S.toLowerCase()]),$e(S)==="array"){S.length===1&&(S=[S[0],S[0]]),S=S.slice(0);for(let A=0;A<S.length;A++)S[A]=Le(S[A]);i.length=0;for(let A=0;A<S.length;A++)i.push(A/(S.length-1))}return E(),l=S},p=function(S){if(s!=null){const A=s.length-1;let C=0;for(;C<A&&S>=s[C];)C++;return C-1}return 0};let v=S=>S,y=S=>S;const w=function(S,A){let C,T;if(A==null&&(A=!1),isNaN(S)||S===null)return n;A?T=S:s&&s.length>2?T=p(S)/(s.length-2):f!==c?T=(S-c)/(f-c):T=1,T=y(T),A||(T=v(T)),m!==1&&(T=VT(T,m)),T=o[0]+T*(1-o[0]-o[1]),T=Hi(T,0,1);const M=Math.floor(T*1e4);if(g&&h[M])C=h[M];else{if($e(l)==="array")for(let x=0;x<i.length;x++){const N=i[x];if(T<=N){C=l[x];break}if(T>=N&&x===i.length-1){C=l[x];break}if(T>N&&T<i[x+1]){T=(T-N)/(i[x+1]-N),C=Le.interpolate(l[x],l[x+1],T,t);break}}else $e(l)==="function"&&(C=l(T));g&&(h[M]=C)}return C};var E=()=>h={};D(e);const b=function(S){const A=Le(w(S));return u&&A[u]?A[u]():A};return b.classes=function(S){if(S!=null){if($e(S)==="array")s=S,a=[S[0],S[S.length-1]];else{const A=Le.analyze(a);S===0?s=[A.min,A.max]:s=Le.limits(A,"e",S)}return b}return s},b.domain=function(S){if(!arguments.length)return a;c=S[0],f=S[S.length-1],i=[];const A=l.length;if(S.length===A&&c!==f)for(let C of Array.from(S))i.push((C-c)/(f-c));else{for(let C=0;C<A;C++)i.push(C/(A-1));if(S.length>2){const C=S.map((M,x)=>x/(S.length-1)),T=S.map(M=>(M-c)/(f-c));T.every((M,x)=>C[x]===M)||(y=M=>{if(M<=0||M>=1)return M;let x=0;for(;M>=T[x+1];)x++;const N=(M-T[x])/(T[x+1]-T[x]);return C[x]+N*(C[x+1]-C[x])})}}return a=[c,f],b},b.mode=function(S){return arguments.length?(t=S,E(),b):t},b.range=function(S,A){return D(S),b},b.out=function(S){return u=S,b},b.spread=function(S){return arguments.length?(r=S,b):r},b.correctLightness=function(S){return S==null&&(S=!0),d=S,E(),d?v=function(A){const C=w(0,!0).lab()[0],T=w(1,!0).lab()[0],M=C>T;let x=w(A,!0).lab()[0];const N=C+(T-C)*A;let O=x-N,z=0,B=1,k=20;for(;Math.abs(O)>.01&&k-- >0;)(function(){return M&&(O*=-1),O<0?(z=A,A+=(B-A)*.5):(B=A,A+=(z-A)*.5),x=w(A,!0).lab()[0],O=x-N})();return A}:v=A=>A,b},b.padding=function(S){return S!=null?($e(S)==="number"&&(S=[S,S]),o=S,b):o},b.colors=function(S,A){arguments.length<2&&(A="hex");let C=[];if(arguments.length===0)C=l.slice(0);else if(S===1)C=[b(.5)];else if(S>1){const T=a[0],M=a[1]-T;C=XT(0,S).map(x=>b(T+x/(S-1)*M))}else{e=[];let T=[];if(s&&s.length>2)for(let M=1,x=s.length,N=1<=x;N?M<x:M>x;N?M++:M--)T.push((s[M-1]+s[M])*.5);else T=a;C=T.map(M=>b(M))}return Le[A]&&(C=C.map(T=>T[A]())),C},b.cache=function(S){return S!=null?(g=S,b):g},b.gamma=function(S){return S!=null?(m=S,b):m},b.nodata=function(S){return S!=null?(n=Le(S),b):n},b}function XT(e,t,n){let r=[],a=e<t,i=t;for(let o=e;a?o<i:o>i;a?o++:o--)r.push(o);return r}const ZT=function(e){let t=[1,1];for(let n=1;n<e;n++){let r=[1];for(let a=1;a<=t.length;a++)r[a]=(t[a]||0)+t[a-1];t=r}return t},KT=function(e){let t,n,r,a;if(e=e.map(i=>new oe(i)),e.length===2)[n,r]=e.map(i=>i.lab()),t=function(i){const o=[0,1,2].map(s=>n[s]+i*(r[s]-n[s]));return new oe(o,"lab")};else if(e.length===3)[n,r,a]=e.map(i=>i.lab()),t=function(i){const o=[0,1,2].map(s=>(1-i)*(1-i)*n[s]+2*(1-i)*i*r[s]+i*i*a[s]);return new oe(o,"lab")};else if(e.length===4){let i;[n,r,a,i]=e.map(o=>o.lab()),t=function(o){const s=[0,1,2].map(l=>(1-o)*(1-o)*(1-o)*n[l]+3*(1-o)*(1-o)*o*r[l]+3*(1-o)*o*o*a[l]+o*o*o*i[l]);return new oe(s,"lab")}}else if(e.length>=5){let i,o,s;i=e.map(l=>l.lab()),s=e.length-1,o=ZT(s),t=function(l){const u=1-l,c=[0,1,2].map(f=>i.reduce((d,h,g)=>d+o[g]*u**(s-g)*l**g*h[f],0));return new oe(c,"lab")}}else throw new RangeError("No point in running bezier with only one color.");return t},QT=e=>{const t=KT(e);return t.scale=()=>tf(t),t},{round:OD}=Math;oe.prototype.rgb=function(e=!0){return e===!1?this._rgb.slice(0,3):this._rgb.slice(0,3).map(OD)},oe.prototype.rgba=function(e=!0){return this._rgb.slice(0,4).map((t,n)=>n<3?e===!1?t:OD(t):t)},Object.assign(Le,{rgb:(...e)=>new oe(...e,"rgb")}),_e.format.rgb=(...e)=>{const t=Ne(e,"rgba");return t[3]===void 0&&(t[3]=1),t},_e.autodetect.push({p:3,test:(...e)=>{if(e=Ne(e,"rgba"),$e(e)==="array"&&(e.length===3||e.length===4&&$e(e[3])=="number"&&e[3]>=0&&e[3]<=1))return"rgb"}});const wr=(e,t,n)=>{if(!wr[n])throw new Error("unknown blend mode "+n);return wr[n](e,t)},ai=e=>(t,n)=>{const r=Le(n).rgb(),a=Le(t).rgb();return Le.rgb(e(r,a))},ii=e=>(t,n)=>{const r=[];return r[0]=e(t[0],n[0]),r[1]=e(t[1],n[1]),r[2]=e(t[2],n[2]),r},WT=e=>e,JT=(e,t)=>e*t/255,e8=(e,t)=>e>t?t:e,t8=(e,t)=>e>t?e:t,n8=(e,t)=>255*(1-(1-e/255)*(1-t/255)),r8=(e,t)=>t<128?2*e*t/255:255*(1-2*(1-e/255)*(1-t/255)),a8=(e,t)=>255*(1-(1-t/255)/(e/255)),i8=(e,t)=>e===255?255:(e=255*(t/255)/(1-e/255),e>255?255:e);wr.normal=ai(ii(WT)),wr.multiply=ai(ii(JT)),wr.screen=ai(ii(n8)),wr.overlay=ai(ii(r8)),wr.darken=ai(ii(e8)),wr.lighten=ai(ii(t8)),wr.dodge=ai(ii(i8)),wr.burn=ai(ii(a8));const{pow:o8,sin:s8,cos:l8}=Math;function u8(e=300,t=-1.5,n=1,r=1,a=[0,1]){let i=0,o;$e(a)==="array"?o=a[1]-a[0]:(o=0,a=[a,a]);const s=function(l){const u=ga*((e+120)/360+t*l),c=o8(a[0]+o*l,r),d=(i!==0?n[0]+l*i:n)*c*(1-c)/2,h=l8(u),g=s8(u),m=c+d*(-.14861*h+1.78277*g),D=c+d*(-.29227*h-.90649*g),p=c+d*(1.97294*h);return Le(Xm([m*255,D*255,p*255,1]))};return s.start=function(l){return l==null?e:(e=l,s)},s.rotations=function(l){return l==null?t:(t=l,s)},s.gamma=function(l){return l==null?r:(r=l,s)},s.hue=function(l){return l==null?n:(n=l,$e(n)==="array"?(i=n[1]-n[0],i===0&&(n=n[1])):i=0,s)},s.lightness=function(l){return l==null?a:($e(l)==="array"?(a=l,o=l[1]-l[0]):(a=[l,l],o=0),s)},s.scale=()=>Le.scale(s),s.hue(n),s}const c8="0123456789abcdef",{floor:f8,random:d8}=Math,h8=()=>{let e="#";for(let t=0;t<6;t++)e+=c8.charAt(f8(d8()*16));return new oe(e,"hex")},{log:RD,pow:m8,floor:p8,abs:g8}=Math;function zD(e,t=null){const n={min:Number.MAX_VALUE,max:Number.MAX_VALUE*-1,sum:0,values:[],count:0};return $e(e)==="object"&&(e=Object.values(e)),e.forEach(r=>{t&&$e(r)==="object"&&(r=r[t]),r!=null&&!isNaN(r)&&(n.values.push(r),n.sum+=r,r<n.min&&(n.min=r),r>n.max&&(n.max=r),n.count+=1)}),n.domain=[n.min,n.max],n.limits=(r,a)=>kD(n,r,a),n}function kD(e,t="equal",n=7){$e(e)=="array"&&(e=zD(e));const{min:r,max:a}=e,i=e.values.sort((s,l)=>s-l);if(n===1)return[r,a];const o=[];if(t.substr(0,1)==="c"&&(o.push(r),o.push(a)),t.substr(0,1)==="e"){o.push(r);for(let s=1;s<n;s++)o.push(r+s/n*(a-r));o.push(a)}else if(t.substr(0,1)==="l"){if(r<=0)throw new Error("Logarithmic scales are only possible for values > 0");const s=Math.LOG10E*RD(r),l=Math.LOG10E*RD(a);o.push(r);for(let u=1;u<n;u++)o.push(m8(10,s+u/n*(l-s)));o.push(a)}else if(t.substr(0,1)==="q"){o.push(r);for(let s=1;s<n;s++){const l=(i.length-1)*s/n,u=p8(l);if(u===l)o.push(i[u]);else{const c=l-u;o.push(i[u]*(1-c)+i[u+1]*c)}}o.push(a)}else if(t.substr(0,1)==="k"){let s;const l=i.length,u=new Array(l),c=new Array(n);let f=!0,d=0,h=null;h=[],h.push(r);for(let D=1;D<n;D++)h.push(r+D/n*(a-r));for(h.push(a);f;){for(let p=0;p<n;p++)c[p]=0;for(let p=0;p<l;p++){const v=i[p];let y=Number.MAX_VALUE,w;for(let E=0;E<n;E++){const b=g8(h[E]-v);b<y&&(y=b,w=E),c[w]++,u[p]=w}}const D=new Array(n);for(let p=0;p<n;p++)D[p]=null;for(let p=0;p<l;p++)s=u[p],D[s]===null?D[s]=i[p]:D[s]+=i[p];for(let p=0;p<n;p++)D[p]*=1/c[p];f=!1;for(let p=0;p<n;p++)if(D[p]!==h[p]){f=!0;break}h=D,d++,d>200&&(f=!1)}const g={};for(let D=0;D<n;D++)g[D]=[];for(let D=0;D<l;D++)s=u[D],g[s].push(i[D]);let m=[];for(let D=0;D<n;D++)m.push(g[D][0]),m.push(g[D][g[D].length-1]);m=m.sort((D,p)=>D-p),o.push(m[0]);for(let D=1;D<m.length;D+=2){const p=m[D];!isNaN(p)&&o.indexOf(p)===-1&&o.push(p)}}return o}const v8=(e,t)=>{e=new oe(e),t=new oe(t);const n=e.luminance(),r=t.luminance();return n>r?(n+.05)/(r+.05):(r+.05)/(n+.05)};/**
50
- * @license
51
- *
52
- * The APCA contrast prediction algorithm is based of the formulas published
53
- * in the APCA-1.0.98G specification by Myndex. The specification is available at:
54
- * https://raw.githubusercontent.com/Myndex/apca-w3/master/images/APCAw3_0.1.17_APCA0.0.98G.svg
55
- *
56
- * Note that the APCA implementation is still beta, so please update to
57
- * future versions of chroma.js when they become available.
58
- *
59
- * You can read more about the APCA Readability Criterion at
60
- * https://readtech.org/ARC/
61
- */const $D=.027,y8=5e-4,b8=.1,ID=1.14,nf=.022,UD=1.414,D8=(e,t)=>{e=new oe(e),t=new oe(t),e.alpha()<1&&(e=ts(t,e,e.alpha(),"rgb"));const n=LD(...e.rgb()),r=LD(...t.rgb()),a=n>=nf?n:n+Math.pow(nf-n,UD),i=r>=nf?r:r+Math.pow(nf-r,UD),o=Math.pow(i,.56)-Math.pow(a,.57),s=Math.pow(i,.65)-Math.pow(a,.62),l=Math.abs(i-a)<y8?0:a<i?o*ID:s*ID;return(Math.abs(l)<b8?0:l>0?l-$D:l+$D)*100};function LD(e,t,n){return .2126729*Math.pow(e/255,2.4)+.7151522*Math.pow(t/255,2.4)+.072175*Math.pow(n/255,2.4)}const{sqrt:ya,pow:Pt,min:S8,max:w8,atan2:PD,abs:jD,cos:rf,sin:HD,exp:x8,PI:qD}=Math;function E8(e,t,n=1,r=1,a=1){var i=function(G){return 360*G/(2*qD)},o=function(G){return 2*qD*G/360};e=new oe(e),t=new oe(t);const[s,l,u]=Array.from(e.lab()),[c,f,d]=Array.from(t.lab()),h=(s+c)/2,g=ya(Pt(l,2)+Pt(u,2)),m=ya(Pt(f,2)+Pt(d,2)),D=(g+m)/2,p=.5*(1-ya(Pt(D,7)/(Pt(D,7)+Pt(25,7)))),v=l*(1+p),y=f*(1+p),w=ya(Pt(v,2)+Pt(u,2)),E=ya(Pt(y,2)+Pt(d,2)),b=(w+E)/2,S=i(PD(u,v)),A=i(PD(d,y)),C=S>=0?S:S+360,T=A>=0?A:A+360,M=jD(C-T)>180?(C+T+360)/2:(C+T)/2,x=1-.17*rf(o(M-30))+.24*rf(o(2*M))+.32*rf(o(3*M+6))-.2*rf(o(4*M-63));let N=T-C;N=jD(N)<=180?N:T<=C?N+360:N-360,N=2*ya(w*E)*HD(o(N)/2);const O=c-s,z=E-w,B=1+.015*Pt(h-50,2)/ya(20+Pt(h-50,2)),k=1+.045*b,$=1+.015*b*x,U=30*x8(-Pt((M-275)/25,2)),X=-(2*ya(Pt(b,7)/(Pt(b,7)+Pt(25,7))))*HD(2*o(U)),P=ya(Pt(O/(n*B),2)+Pt(z/(r*k),2)+Pt(N/(a*$),2)+X*(z/(r*k))*(N/(a*$)));return w8(0,S8(100,P))}function A8(e,t,n="lab"){e=new oe(e),t=new oe(t);const r=e.get(n),a=t.get(n);let i=0;for(let o in r){const s=(r[o]||0)-(a[o]||0);i+=s*s}return Math.sqrt(i)}const C8=(...e)=>{try{return new oe(...e),!0}catch{return!1}},T8={cool(){return tf([Le.hsl(180,1,.9),Le.hsl(250,.7,.4)])},hot(){return tf(["#000","#f00","#ff0","#fff"]).mode("rgb")}},fp={OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Viridis:["#440154","#482777","#3f4a8a","#31678e","#26838f","#1f9d8a","#6cce5a","#b6de2b","#fee825"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},YD=Object.keys(fp),GD=new Map(YD.map(e=>[e.toLowerCase(),e])),M8=typeof Proxy=="function"?new Proxy(fp,{get(e,t){const n=t.toLowerCase();if(GD.has(n))return e[GD.get(n)]},getOwnPropertyNames(){return Object.getOwnPropertyNames(YD)}}):fp,_8=(...e)=>{e=Ne(e,"cmyk");const[t,n,r,a]=e,i=e.length>4?e[4]:1;return a===1?[0,0,0,i]:[t>=1?0:255*(1-t)*(1-a),n>=1?0:255*(1-n)*(1-a),r>=1?0:255*(1-r)*(1-a),i]},{max:VD}=Math,N8=(...e)=>{let[t,n,r]=Ne(e,"rgb");t=t/255,n=n/255,r=r/255;const a=1-VD(t,VD(n,r)),i=a<1?1/(1-a):0,o=(1-t-a)*i,s=(1-n-a)*i,l=(1-r-a)*i;return[o,s,l,a]};oe.prototype.cmyk=function(){return N8(this._rgb)},Object.assign(Le,{cmyk:(...e)=>new oe(...e,"cmyk")}),_e.format.cmyk=_8,_e.autodetect.push({p:2,test:(...e)=>{if(e=Ne(e,"cmyk"),$e(e)==="array"&&e.length===4)return"cmyk"}});const F8=(...e)=>{const t=Ne(e,"hsla");let n=Jo(e)||"lsa";return t[0]=cr(t[0]||0)+"deg",t[1]=cr(t[1]*100)+"%",t[2]=cr(t[2]*100)+"%",n==="hsla"||t.length>3&&t[3]<1?(t[3]="/ "+(t.length>3?t[3]:1),n="hsla"):t.length=3,`${n.substr(0,3)}(${t.join(" ")})`},B8=(...e)=>{const t=Ne(e,"lab");let n=Jo(e)||"lab";return t[0]=cr(t[0])+"%",t[1]=cr(t[1]),t[2]=cr(t[2]),n==="laba"||t.length>3&&t[3]<1?t[3]="/ "+(t.length>3?t[3]:1):t.length=3,`lab(${t.join(" ")})`},O8=(...e)=>{const t=Ne(e,"lch");let n=Jo(e)||"lab";return t[0]=cr(t[0])+"%",t[1]=cr(t[1]),t[2]=isNaN(t[2])?"none":cr(t[2])+"deg",n==="lcha"||t.length>3&&t[3]<1?t[3]="/ "+(t.length>3?t[3]:1):t.length=3,`lch(${t.join(" ")})`},R8=(...e)=>{const t=Ne(e,"lab");return t[0]=cr(t[0]*100)+"%",t[1]=Zm(t[1]),t[2]=Zm(t[2]),t.length>3&&t[3]<1?t[3]="/ "+(t.length>3?t[3]:1):t.length=3,`oklab(${t.join(" ")})`},XD=(...e)=>{const[t,n,r,...a]=Ne(e,"rgb"),[i,o,s]=sp(t,n,r),[l,u,c]=MD(i,o,s);return[l,u,c,...a.length>0&&a[0]<1?[a[0]]:[]]},z8=(...e)=>{const t=Ne(e,"lch");return t[0]=cr(t[0]*100)+"%",t[1]=Zm(t[1]),t[2]=isNaN(t[2])?"none":cr(t[2])+"deg",t.length>3&&t[3]<1?t[3]="/ "+(t.length>3?t[3]:1):t.length=3,`oklch(${t.join(" ")})`},{round:dp}=Math,k8=(...e)=>{const t=Ne(e,"rgba");let n=Jo(e)||"rgb";if(n.substr(0,3)==="hsl")return F8(ND(t),n);if(n.substr(0,3)==="lab"){const r=Yl();va("d50");const a=B8(Jm(t),n);return va(r),a}if(n.substr(0,3)==="lch"){const r=Yl();va("d50");const a=O8(rp(t),n);return va(r),a}return n.substr(0,5)==="oklab"?R8(sp(t)):n.substr(0,5)==="oklch"?z8(XD(t)):(t[0]=dp(t[0]),t[1]=dp(t[1]),t[2]=dp(t[2]),(n==="rgba"||t.length>3&&t[3]<1)&&(t[3]="/ "+(t.length>3?t[3]:1),n="rgba"),`${n.substr(0,3)}(${t.slice(0,n==="rgb"?3:4).join(" ")})`)},ZD=(...e)=>{e=Ne(e,"lch");const[t,n,r,...a]=e,[i,o,s]=TD(t,n,r),[l,u,c]=op(i,o,s);return[l,u,c,...a.length>0&&a[0]<1?[a[0]]:[]]},ba=/((?:-?\d+)|(?:-?\d+(?:\.\d+)?)%|none)/.source,xr=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)%?)|none)/.source,af=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)%)|none)/.source,fr=/\s*/.source,is=/\s+/.source,hp=/\s*,\s*/.source,of=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)(?:deg)?)|none)/.source,os=/\s*(?:\/\s*((?:[01]|[01]?\.\d+)|\d+(?:\.\d+)?%))?/.source,KD=new RegExp("^rgba?\\("+fr+[ba,ba,ba].join(is)+os+"\\)$"),QD=new RegExp("^rgb\\("+fr+[ba,ba,ba].join(hp)+fr+"\\)$"),WD=new RegExp("^rgba\\("+fr+[ba,ba,ba,xr].join(hp)+fr+"\\)$"),JD=new RegExp("^hsla?\\("+fr+[of,af,af].join(is)+os+"\\)$"),eS=new RegExp("^hsl?\\("+fr+[of,af,af].join(hp)+fr+"\\)$"),tS=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,nS=new RegExp("^lab\\("+fr+[xr,xr,xr].join(is)+os+"\\)$"),rS=new RegExp("^lch\\("+fr+[xr,xr,of].join(is)+os+"\\)$"),aS=new RegExp("^oklab\\("+fr+[xr,xr,xr].join(is)+os+"\\)$"),iS=new RegExp("^oklch\\("+fr+[xr,xr,of].join(is)+os+"\\)$"),{round:oS}=Math,ss=e=>e.map((t,n)=>n<=2?Hi(oS(t),0,255):t),jt=(e,t=0,n=100,r=!1)=>(typeof e=="string"&&e.endsWith("%")&&(e=parseFloat(e.substring(0,e.length-1))/100,r?e=t+(e+1)*.5*(n-t):e=t+e*(n-t)),+e),xn=(e,t)=>e==="none"?t:e,mp=e=>{if(e=e.toLowerCase().trim(),e==="transparent")return[0,0,0,0];let t;if(_e.format.named)try{return _e.format.named(e)}catch{}if((t=e.match(KD))||(t=e.match(QD))){let n=t.slice(1,4);for(let a=0;a<3;a++)n[a]=+jt(xn(n[a],0),0,255);n=ss(n);const r=t[4]!==void 0?+jt(t[4],0,1):1;return n[3]=r,n}if(t=e.match(WD)){const n=t.slice(1,5);for(let r=0;r<4;r++)n[r]=+jt(n[r],0,255);return n}if((t=e.match(JD))||(t=e.match(eS))){const n=t.slice(1,4);n[0]=+xn(n[0].replace("deg",""),0),n[1]=+jt(xn(n[1],0),0,100)*.01,n[2]=+jt(xn(n[2],0),0,100)*.01;const r=ss(ip(n)),a=t[4]!==void 0?+jt(t[4],0,1):1;return r[3]=a,r}if(t=e.match(tS)){const n=t.slice(1,4);n[1]*=.01,n[2]*=.01;const r=ip(n);for(let a=0;a<3;a++)r[a]=oS(r[a]);return r[3]=+t[4],r}if(t=e.match(nS)){const n=t.slice(1,4);n[0]=jt(xn(n[0],0),0,100),n[1]=jt(xn(n[1],0),-125,125,!0),n[2]=jt(xn(n[2],0),-125,125,!0);const r=Yl();va("d50");const a=ss(Qm(n));va(r);const i=t[4]!==void 0?+jt(t[4],0,1):1;return a[3]=i,a}if(t=e.match(rS)){const n=t.slice(1,4);n[0]=jt(n[0],0,100),n[1]=jt(xn(n[1],0),0,150,!1),n[2]=+xn(n[2].replace("deg",""),0);const r=Yl();va("d50");const a=ss(np(n));va(r);const i=t[4]!==void 0?+jt(t[4],0,1):1;return a[3]=i,a}if(t=e.match(aS)){const n=t.slice(1,4);n[0]=jt(xn(n[0],0),0,1),n[1]=jt(xn(n[1],0),-.4,.4,!0),n[2]=jt(xn(n[2],0),-.4,.4,!0);const r=ss(op(n)),a=t[4]!==void 0?+jt(t[4],0,1):1;return r[3]=a,r}if(t=e.match(iS)){const n=t.slice(1,4);n[0]=jt(xn(n[0],0),0,1),n[1]=jt(xn(n[1],0),0,.4,!1),n[2]=+xn(n[2].replace("deg",""),0);const r=ss(ZD(n)),a=t[4]!==void 0?+jt(t[4],0,1):1;return r[3]=a,r}};mp.test=e=>KD.test(e)||JD.test(e)||nS.test(e)||rS.test(e)||aS.test(e)||iS.test(e)||QD.test(e)||WD.test(e)||eS.test(e)||tS.test(e)||e==="transparent",oe.prototype.css=function(e){return k8(this._rgb,e)};const $8=(...e)=>new oe(...e,"css");Le.css=$8,_e.format.css=mp,_e.autodetect.push({p:5,test:(e,...t)=>{if(!t.length&&$e(e)==="string"&&mp.test(e))return"css"}}),_e.format.gl=(...e)=>{const t=Ne(e,"rgba");return t[0]*=255,t[1]*=255,t[2]*=255,t};const I8=(...e)=>new oe(...e,"gl");Le.gl=I8,oe.prototype.gl=function(){const e=this._rgb;return[e[0]/255,e[1]/255,e[2]/255,e[3]]},oe.prototype.hex=function(e){return ED(this._rgb,e)};const U8=(...e)=>new oe(...e,"hex");Le.hex=U8,_e.format.hex=xD,_e.autodetect.push({p:4,test:(e,...t)=>{if(!t.length&&$e(e)==="string"&&[3,4,5,6,7,8,9].indexOf(e.length)>=0)return"hex"}});const{log:sf}=Math,sS=e=>{const t=e/100;let n,r,a;return t<66?(n=255,r=t<6?0:-155.25485562709179-.44596950469579133*(r=t-2)+104.49216199393888*sf(r),a=t<20?0:-254.76935184120902+.8274096064007395*(a=t-10)+115.67994401066147*sf(a)):(n=351.97690566805693+.114206453784165*(n=t-55)-40.25366309332127*sf(n),r=325.4494125711974+.07943456536662342*(r=t-50)-28.0852963507957*sf(r),a=255),[n,r,a,1]},{round:L8}=Math,P8=(...e)=>{const t=Ne(e,"rgb"),n=t[0],r=t[2];let a=1e3,i=4e4;const o=.4;let s;for(;i-a>o;){s=(i+a)*.5;const l=sS(s);l[2]/l[0]>=r/n?i=s:a=s}return L8(s)};oe.prototype.temp=oe.prototype.kelvin=oe.prototype.temperature=function(){return P8(this._rgb)};const pp=(...e)=>new oe(...e,"temp");Object.assign(Le,{temp:pp,kelvin:pp,temperature:pp}),_e.format.temp=_e.format.kelvin=_e.format.temperature=sS,oe.prototype.oklch=function(){return XD(this._rgb)},Object.assign(Le,{oklch:(...e)=>new oe(...e,"oklch")}),_e.format.oklch=ZD,_e.autodetect.push({p:2,test:(...e)=>{if(e=Ne(e,"oklch"),$e(e)==="array"&&e.length===3)return"oklch"}}),Object.assign(Le,{analyze:zD,average:YT,bezier:QT,blend:wr,brewer:M8,Color:oe,colors:es,contrast:v8,contrastAPCA:D8,cubehelix:u8,deltaE:E8,distance:A8,input:_e,interpolate:ts,limits:kD,mix:ts,random:h8,scale:tf,scales:T8,valid:C8});const qi=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],lS=qi.length;for(let e=0;e<lS;e++)qi.push(Le(qi[e]).darken(2).hex());for(let e=0;e<lS;e++)qi.push(Le(qi[e]).brighten(1.5).hex());const gp=e=>qi[e%qi.length],lf=e=>e!==null&&typeof e=="string",j8=e=>e!==null&&typeof e=="function",H8=e=>e!==null&&typeof e=="number",q8=e=>t=>{for(const n of e)if(n(t))return!0;return!1},Y8=e=>t=>t===e,uS=e=>t=>{if(t!==null&&Array.isArray(t)){for(const n of t)if(!e(n))return!1;return!0}else return!1},uf=(e,t,n)=>{const r=n||{};if(!e)return r.callback&&r.callback("x is undefined/null."),!1;if(typeof e!="object")return r.callback&&r.callback("x is not an Object."),!1;for(const a in e)if(!(a in t)&&!r.allowAdditionalFields)return r.callback&&r.callback(`Key not in spec: ${a}`),!1;for(const a in t){const i=t[a];if(j8(i)){if(!i(e[a]))return r.callback&&r.callback(`Problem validating: ${a}`),!1}else{if(!(a in e))return r.callback&&r.callback(`Key not in x: ${a}`),!1;if(!uf(e[a],i,{callback:r.callback}))return r.callback&&r.callback(`Value of key > ${a} < itself failed validation.`),!1}}return!0},G8=(e,t)=>{if(t.type==="DRAG_MOUSE_DOWN"){const{point:n}=t;return{...e,isActive:!1,dragAnchor:n,dragPosition:n,dragRect:void 0}}else{if(t.type==="DRAG_MOUSE_UP")return{...e,isActive:!1,dragAnchor:void 0,dragPosition:void 0,dragRect:void 0};if(t.type==="DRAG_MOUSE_MOVE"){if(!e.dragAnchor)return e;const n=[Math.min(e.dragAnchor[0],t.point[0]),Math.min(e.dragAnchor[1],t.point[1]),Math.abs(e.dragAnchor[0]-t.point[0]),Math.abs(e.dragAnchor[1]-t.point[1])];return e.isActive?{...e,dragRect:n,dragPosition:[t.point[0],t.point[1]]}:n[2]>=10||n[3]>=10?{...e,isActive:!0,dragRect:n,dragPosition:[t.point[0],t.point[1]]}:e}else return t.type==="DRAG_MOUSE_LEAVE"?{...e}:(console.log("Error: unrecognized verb in dragSelectReducer."),e)}},cf=(e,t,n,r)=>{const[a,i]=_.useReducer(G8,{}),o=_.useCallback(f=>{f.buttons&&i({type:"DRAG_MOUSE_MOVE",point:ff(f)})},[]),s=_.useCallback(f=>{i({type:"DRAG_MOUSE_DOWN",point:ff(f)})},[]),l=_.useCallback(f=>{a.isActive&&a.dragRect&&n(a.dragRect,{ctrlKey:f.ctrlKey,shiftKey:f.shiftKey}),a.isActive||r(ff(f),{ctrlKey:f.ctrlKey,shiftKey:f.shiftKey}),i({type:"DRAG_MOUSE_UP",point:ff(f)})},[a,n,r]),u=_.useCallback(()=>{i({type:"DRAG_MOUSE_LEAVE"})},[]),c=_.useCallback(f=>{if(f.clearRect(0,0,e,t),a.isActive&&a.dragRect){const d=a.dragRect;f.fillStyle=V8,f.fillRect(d[0],d[1],d[2],d[3])}},[e,t,a]);return{dragSelectState:a,onMouseDown:s,onMouseMove:o,onMouseUp:l,onMouseLeave:u,paintDragSelectLayer:c}},V8="rgba(196, 196, 196, 0.5)",ff=e=>{const t=e.currentTarget.getBoundingClientRect();return[e.clientX-t.x,e.clientY-t.y]},X8={position:"absolute",left:0,top:0},Z8=e=>{if(!e||typeof e=="function")return;const t=e.current,n=t&&t.getContext("2d");if(n)return n},Er=e=>{const{width:t,height:n,vOffsetPx:r,hOffsetPx:a,draw:i,drawData:o}=e,s=_.useRef(null);_.useEffect(()=>{const f=Z8(s);f&&f.canvas&&i(f,o)},[i,s,o]);const c={...X8,...r?{top:r}:{},...a?{left:a}:{}};return F.jsx("canvas",{ref:s,width:t,height:n,style:c})};function oi(){return oi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},oi.apply(null,arguments)}var cS={relTol:1e-12,absTol:1e-15,matrix:"Matrix",number:"number",numberFallback:"number",precision:64,predictable:!1,randomSeed:null};function K8(e,t){if(df(e,t))return e[t];throw typeof e[t]=="function"&&W8(e,t)?new Error('Cannot access method "'+t+'" as a property'):new Error('No access to property "'+t+'"')}function Q8(e,t,n){if(df(e,t))return e[t]=n,n;throw new Error('No access to property "'+t+'"')}function df(e,t){return!J8(e)&&!Array.isArray(e)?!1:Vl(eM,t)?!0:!(t in Object.prototype||t in Function.prototype)}function W8(e,t){return e==null||typeof e[t]!="function"||Vl(e,t)&&Object.getPrototypeOf&&t in Object.getPrototypeOf(e)?!1:Vl(tM,t)?!0:!(t in Object.prototype||t in Function.prototype)}function J8(e){return typeof e=="object"&&e&&e.constructor===Object}var eM={length:!0,name:!0},tM={toString:!0,valueOf:!0,toLocaleString:!0};class nM{constructor(t){this.wrappedObject=t,this[Symbol.iterator]=this.entries}keys(){return Object.keys(this.wrappedObject).filter(t=>this.has(t)).values()}get(t){return K8(this.wrappedObject,t)}set(t,n){return Q8(this.wrappedObject,t,n),this}has(t){return df(this.wrappedObject,t)&&t in this.wrappedObject}entries(){return rM(this.keys(),t=>[t,this.get(t)])}forEach(t){for(var n of this.keys())t(this.get(n),n,this)}delete(t){df(this.wrappedObject,t)&&delete this.wrappedObject[t]}clear(){for(var t of this.keys())this.delete(t)}get size(){return Object.keys(this.wrappedObject).length}}function rM(e,t){return{next:()=>{var n=e.next();return n.done?n:{value:t(n.value),done:!1}}}}function ct(e){return typeof e=="number"}function Mt(e){return!e||typeof e!="object"||typeof e.constructor!="function"?!1:e.isBigNumber===!0&&typeof e.constructor.prototype=="object"&&e.constructor.prototype.isBigNumber===!0||typeof e.constructor.isDecimal=="function"&&e.constructor.isDecimal(e)===!0}function aM(e){return typeof e=="bigint"}function vp(e){return e&&typeof e=="object"&&Object.getPrototypeOf(e).isComplex===!0||!1}function yp(e){return e&&typeof e=="object"&&Object.getPrototypeOf(e).isFraction===!0||!1}function fS(e){return e&&e.constructor.prototype.isUnit===!0||!1}function Ar(e){return typeof e=="string"}var Et=Array.isArray;function We(e){return e&&e.constructor.prototype.isMatrix===!0||!1}function Gl(e){return Array.isArray(e)||We(e)}function dS(e){return e&&e.isDenseMatrix&&e.constructor.prototype.isMatrix===!0||!1}function hS(e){return e&&e.isSparseMatrix&&e.constructor.prototype.isMatrix===!0||!1}function mS(e){return e&&e.constructor.prototype.isRange===!0||!1}function bp(e){return e&&e.constructor.prototype.isIndex===!0||!1}function iM(e){return typeof e=="boolean"}function oM(e){return e&&e.constructor.prototype.isResultSet===!0||!1}function sM(e){return e&&e.constructor.prototype.isHelp===!0||!1}function lM(e){return typeof e=="function"}function uM(e){return e instanceof Date}function cM(e){return e instanceof RegExp}function Dp(e){return!!(e&&typeof e=="object"&&e.constructor===Object&&!vp(e)&&!yp(e))}function fM(e){return e?e instanceof Map||e instanceof nM||typeof e.set=="function"&&typeof e.get=="function"&&typeof e.keys=="function"&&typeof e.has=="function":!1}function dM(e){return e===null}function hM(e){return e===void 0}function mM(e){return e&&e.isAccessorNode===!0&&e.constructor.prototype.isNode===!0||!1}function pM(e){return e&&e.isArrayNode===!0&&e.constructor.prototype.isNode===!0||!1}function gM(e){return e&&e.isAssignmentNode===!0&&e.constructor.prototype.isNode===!0||!1}function vM(e){return e&&e.isBlockNode===!0&&e.constructor.prototype.isNode===!0||!1}function yM(e){return e&&e.isConditionalNode===!0&&e.constructor.prototype.isNode===!0||!1}function bM(e){return e&&e.isConstantNode===!0&&e.constructor.prototype.isNode===!0||!1}function DM(e){return e&&e.isFunctionAssignmentNode===!0&&e.constructor.prototype.isNode===!0||!1}function SM(e){return e&&e.isFunctionNode===!0&&e.constructor.prototype.isNode===!0||!1}function wM(e){return e&&e.isIndexNode===!0&&e.constructor.prototype.isNode===!0||!1}function xM(e){return e&&e.isNode===!0&&e.constructor.prototype.isNode===!0||!1}function EM(e){return e&&e.isObjectNode===!0&&e.constructor.prototype.isNode===!0||!1}function AM(e){return e&&e.isOperatorNode===!0&&e.constructor.prototype.isNode===!0||!1}function CM(e){return e&&e.isParenthesisNode===!0&&e.constructor.prototype.isNode===!0||!1}function TM(e){return e&&e.isRangeNode===!0&&e.constructor.prototype.isNode===!0||!1}function MM(e){return e&&e.isRelationalNode===!0&&e.constructor.prototype.isNode===!0||!1}function _M(e){return e&&e.isSymbolNode===!0&&e.constructor.prototype.isNode===!0||!1}function NM(e){return e&&e.constructor.prototype.isChain===!0||!1}function Zn(e){var t=typeof e;return t==="object"?e===null?"null":Mt(e)?"BigNumber":e.constructor&&e.constructor.name?e.constructor.name:"Object":t}function Ge(e){var t=typeof e;if(t==="number"||t==="bigint"||t==="string"||t==="boolean"||e===null||e===void 0)return e;if(typeof e.clone=="function")return e.clone();if(Array.isArray(e))return e.map(function(n){return Ge(n)});if(e instanceof Date)return new Date(e.valueOf());if(Mt(e))return e;if(Dp(e))return FM(e,Ge);if(t==="function")return e;throw new TypeError("Cannot clone: unknown type of value (value: ".concat(e,")"))}function FM(e,t){var n={};for(var r in e)Vl(e,r)&&(n[r]=t(e[r]));return n}function pS(e,t){for(var n in t)Vl(t,n)&&(e[n]=t[n]);return e}function si(e,t){var n,r,a;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(r=0,a=e.length;r<a;r++)if(!si(e[r],t[r]))return!1;return!0}else{if(typeof e=="function")return e===t;if(e instanceof Object){if(Array.isArray(t)||!(t instanceof Object))return!1;for(n in e)if(!(n in t)||!si(e[n],t[n]))return!1;for(n in t)if(!(n in e))return!1;return!0}else return e===t}}function Vl(e,t){return e&&Object.hasOwnProperty.call(e,t)}function BM(e,t){for(var n={},r=0;r<t.length;r++){var a=t[r],i=e[a];i!==void 0&&(n[a]=i)}return n}var OM=["Matrix","Array"],RM=["number","BigNumber","Fraction"],mn=function(t){if(t)throw new Error(`The global config is readonly.
49
+ `+n.stack}}function kn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function zp(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Zx(e){var t=zp(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,a.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Fl(e){e._valueTracker||(e._valueTracker=Zx(e))}function Up(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=zp(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Nl(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Qx=/[\n"\\]/g;function Ln(e){return e.replace(Qx,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function ud(e,t,n,r,i,a,o,u){e.name="",o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?e.type=o:e.removeAttribute("type"),t!=null?o==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+kn(t)):e.value!==""+kn(t)&&(e.value=""+kn(t)):o!=="submit"&&o!=="reset"||e.removeAttribute("value"),t!=null?ld(e,o,kn(t)):n!=null?ld(e,o,kn(n)):r!=null&&e.removeAttribute("value"),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!="function"&&typeof i!="symbol"),u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"?e.name=""+kn(u):e.removeAttribute("name")}function Ip(e,t,n,r,i,a,o,u){if(a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"&&(e.type=a),t!=null||n!=null){if(!(a!=="submit"&&a!=="reset"||t!=null))return;n=n!=null?""+kn(n):"",t=t!=null?""+kn(t):n,u||t===e.value||(e.value=t),e.defaultValue=t}r=r??i,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=u?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.name=o)}function ld(e,t,n){t==="number"&&Nl(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Ca(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+kn(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function $p(e,t,n){if(t!=null&&(t=""+kn(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+kn(n):""}function kp(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(re(92));if(jo(r)){if(1<r.length)throw Error(re(93));r=r[0]}n=r}n==null&&(n=""),t=n}n=kn(t),e.defaultValue=n,r=e.textContent,r===n&&r!==""&&r!==null&&(e.value=r)}function Ta(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Kx=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Lp(e,t,n){var r=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?r?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":r?e.setProperty(t,n):typeof n!="number"||n===0||Kx.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function jp(e,t,n){if(t!=null&&typeof t!="object")throw Error(re(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf("--")===0?e.setProperty(r,""):r==="float"?e.cssFloat="":e[r]="");for(var i in t)r=t[i],t.hasOwnProperty(i)&&n[i]!==r&&Lp(e,i,r)}else for(var a in t)t.hasOwnProperty(a)&&Lp(e,a,t[a])}function sd(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Wx=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["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"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["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"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["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"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Jx=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Rl(e){return Jx.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}var cd=null;function fd(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ma=null,_a=null;function Hp(e){var t=xa(e);if(t&&(e=t.stateNode)){var n=e[ln]||null;e:switch(e=t.stateNode,t.type){case"input":if(ud(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+Ln(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=r[ln]||null;if(!i)throw Error(re(90));ud(r,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Up(r)}break e;case"textarea":$p(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Ca(e,!!n.multiple,t,!1)}}}var dd=!1;function Pp(e,t,n){if(dd)return e(t,n);dd=!0;try{var r=e(t);return r}finally{if(dd=!1,(Ma!==null||_a!==null)&&(ys(),Ma&&(t=Ma,e=_a,_a=Ma=null,Hp(t),e)))for(t=0;t<e.length;t++)Hp(e[t])}}function Xo(e,t){var n=e.stateNode;if(n===null)return null;var r=n[ln]||null;if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(re(231,t,typeof n));return n}var Br=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),hd=!1;if(Br)try{var Zo={};Object.defineProperty(Zo,"passive",{get:function(){hd=!0}}),window.addEventListener("test",Zo,Zo),window.removeEventListener("test",Zo,Zo)}catch{hd=!1}var ai=null,md=null,Ol=null;function qp(){if(Ol)return Ol;var e,t=md,n=t.length,r,i="value"in ai?ai.value:ai.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return Ol=i.slice(e,1<r?1-r:void 0)}function zl(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Ul(){return!0}function Vp(){return!1}function sn(e){function t(n,r,i,a,o){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=a,this.target=o,this.currentTarget=null;for(var u in e)e.hasOwnProperty(u)&&(n=e[u],this[u]=n?n(a):a[u]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?Ul:Vp,this.isPropagationStopped=Vp,this}return ut(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Ul)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Ul)},persist:function(){},isPersistent:Ul}),t}var Li={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Il=sn(Li),Qo=ut({},Li,{view:0,detail:0}),ew=sn(Qo),pd,gd,Ko,$l=ut({},Qo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:yd,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Ko&&(Ko&&e.type==="mousemove"?(pd=e.screenX-Ko.screenX,gd=e.screenY-Ko.screenY):gd=pd=0,Ko=e),pd)},movementY:function(e){return"movementY"in e?e.movementY:gd}}),Gp=sn($l),tw=ut({},$l,{dataTransfer:0}),nw=sn(tw),rw=ut({},Qo,{relatedTarget:0}),vd=sn(rw),iw=ut({},Li,{animationName:0,elapsedTime:0,pseudoElement:0}),aw=sn(iw),ow=ut({},Li,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),uw=sn(ow),lw=ut({},Li,{data:0}),Yp=sn(lw),sw={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},cw={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},fw={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function dw(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=fw[e])?!!t[e]:!1}function yd(){return dw}var hw=ut({},Qo,{key:function(e){if(e.key){var t=sw[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=zl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?cw[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:yd,charCode:function(e){return e.type==="keypress"?zl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?zl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),mw=sn(hw),pw=ut({},$l,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Xp=sn(pw),gw=ut({},Qo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:yd}),vw=sn(gw),yw=ut({},Li,{propertyName:0,elapsedTime:0,pseudoElement:0}),bw=sn(yw),Dw=ut({},$l,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Sw=sn(Dw),xw=ut({},Li,{newState:0,oldState:0}),ww=sn(xw),Ew=[9,13,27,32],bd=Br&&"CompositionEvent"in window,Wo=null;Br&&"documentMode"in document&&(Wo=document.documentMode);var Aw=Br&&"TextEvent"in window&&!Wo,Zp=Br&&(!bd||Wo&&8<Wo&&11>=Wo),Qp=" ",Kp=!1;function Wp(e,t){switch(e){case"keyup":return Ew.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Jp(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ba=!1;function Cw(e,t){switch(e){case"compositionend":return Jp(t);case"keypress":return t.which!==32?null:(Kp=!0,Qp);case"textInput":return e=t.data,e===Qp&&Kp?null:e;default:return null}}function Tw(e,t){if(Ba)return e==="compositionend"||!bd&&Wp(e,t)?(e=qp(),Ol=md=ai=null,Ba=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Zp&&t.locale!=="ko"?null:t.data;default:return null}}var Mw={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function eg(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Mw[e.type]:t==="textarea"}function tg(e,t,n,r){Ma?_a?_a.push(r):_a=[r]:Ma=r,t=Es(t,"onChange"),0<t.length&&(n=new Il("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Jo=null,eu=null;function _w(e){z1(e,0)}function kl(e){var t=Yo(e);if(Up(t))return e}function ng(e,t){if(e==="change")return t}var rg=!1;if(Br){var Dd;if(Br){var Sd="oninput"in document;if(!Sd){var ig=document.createElement("div");ig.setAttribute("oninput","return;"),Sd=typeof ig.oninput=="function"}Dd=Sd}else Dd=!1;rg=Dd&&(!document.documentMode||9<document.documentMode)}function ag(){Jo&&(Jo.detachEvent("onpropertychange",og),eu=Jo=null)}function og(e){if(e.propertyName==="value"&&kl(eu)){var t=[];tg(t,eu,e,fd(e)),Pp(_w,t)}}function Bw(e,t,n){e==="focusin"?(ag(),Jo=t,eu=n,Jo.attachEvent("onpropertychange",og)):e==="focusout"&&ag()}function Fw(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return kl(eu)}function Nw(e,t){if(e==="click")return kl(t)}function Rw(e,t){if(e==="input"||e==="change")return kl(t)}function Ow(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var En=typeof Object.is=="function"?Object.is:Ow;function tu(e,t){if(En(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Qf.call(t,i)||!En(e[i],t[i]))return!1}return!0}function ug(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function lg(e,t){var n=ug(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=ug(n)}}function sg(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?sg(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function cg(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Nl(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Nl(e.document)}return t}function xd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var zw=Br&&"documentMode"in document&&11>=document.documentMode,Fa=null,wd=null,nu=null,Ed=!1;function fg(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ed||Fa==null||Fa!==Nl(r)||(r=Fa,"selectionStart"in r&&xd(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),nu&&tu(nu,r)||(nu=r,r=Es(wd,"onSelect"),0<r.length&&(t=new Il("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Fa)))}function ji(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Na={animationend:ji("Animation","AnimationEnd"),animationiteration:ji("Animation","AnimationIteration"),animationstart:ji("Animation","AnimationStart"),transitionrun:ji("Transition","TransitionRun"),transitionstart:ji("Transition","TransitionStart"),transitioncancel:ji("Transition","TransitionCancel"),transitionend:ji("Transition","TransitionEnd")},Ad={},dg={};Br&&(dg=document.createElement("div").style,"AnimationEvent"in window||(delete Na.animationend.animation,delete Na.animationiteration.animation,delete Na.animationstart.animation),"TransitionEvent"in window||delete Na.transitionend.transition);function Hi(e){if(Ad[e])return Ad[e];if(!Na[e])return e;var t=Na[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in dg)return Ad[e]=t[n];return e}var hg=Hi("animationend"),mg=Hi("animationiteration"),pg=Hi("animationstart"),Uw=Hi("transitionrun"),Iw=Hi("transitionstart"),$w=Hi("transitioncancel"),gg=Hi("transitionend"),vg=new Map,Cd="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Cd.push("scrollEnd");function tr(e,t){vg.set(e,t),ki(t,[e])}var yg=new WeakMap;function jn(e,t){if(typeof e=="object"&&e!==null){var n=yg.get(e);return n!==void 0?n:(t={value:e,source:t,stack:Op(t)},yg.set(e,t),t)}return{value:e,source:t,stack:Op(t)}}var Hn=[],Ra=0,Td=0;function Ll(){for(var e=Ra,t=Td=Ra=0;t<e;){var n=Hn[t];Hn[t++]=null;var r=Hn[t];Hn[t++]=null;var i=Hn[t];Hn[t++]=null;var a=Hn[t];if(Hn[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&bg(n,i,a)}}function jl(e,t,n,r){Hn[Ra++]=e,Hn[Ra++]=t,Hn[Ra++]=n,Hn[Ra++]=r,Td|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Md(e,t,n,r){return jl(e,t,n,r),Hl(e)}function Oa(e,t){return jl(e,null,null,t),Hl(e)}function bg(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-wn(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Hl(e){if(50<Tu)throw Tu=0,O0=null,Error(re(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var za={};function kw(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function An(e,t,n,r){return new kw(e,t,n,r)}function _d(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Fr(e,t){var n=e.alternate;return n===null?(n=An(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Dg(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Pl(e,t,n,r,i,a){var o=0;if(r=e,typeof e=="function")_d(e)&&(o=1);else if(typeof e=="string")o=jE(e,n,fr.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case Gf:return e=An(31,n,t,i),e.elementType=Gf,e.lanes=a,e;case va:return Pi(n.children,i,a,t);case vp:o=8,i|=24;break;case jf:return e=An(12,n,t,i|2),e.elementType=jf,e.lanes=a,e;case Pf:return e=An(13,n,t,i),e.elementType=Pf,e.lanes=a,e;case qf:return e=An(19,n,t,i),e.elementType=qf,e.lanes=a,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case _x:case Mr:o=10;break e;case yp:o=9;break e;case Hf:o=11;break e;case Vf:o=14;break e;case ti:o=16,r=null;break e}o=29,n=Error(re(130,e===null?"null":typeof e,"")),r=null}return t=An(o,n,t,i),t.elementType=e,t.type=r,t.lanes=a,t}function Pi(e,t,n,r){return e=An(7,e,r,t),e.lanes=n,e}function Bd(e,t,n){return e=An(6,e,null,t),e.lanes=n,e}function Fd(e,t,n){return t=An(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Ua=[],Ia=0,ql=null,Vl=0,Pn=[],qn=0,qi=null,Nr=1,Rr="";function Vi(e,t){Ua[Ia++]=Vl,Ua[Ia++]=ql,ql=e,Vl=t}function Sg(e,t,n){Pn[qn++]=Nr,Pn[qn++]=Rr,Pn[qn++]=qi,qi=e;var r=Nr;e=Rr;var i=32-wn(r)-1;r&=~(1<<i),n+=1;var a=32-wn(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Nr=1<<32-wn(t)+i|n<<i|r,Rr=a+e}else Nr=1<<a|n<<i|r,Rr=e}function Nd(e){e.return!==null&&(Vi(e,1),Sg(e,1,0))}function Rd(e){for(;e===ql;)ql=Ua[--Ia],Ua[Ia]=null,Vl=Ua[--Ia],Ua[Ia]=null;for(;e===qi;)qi=Pn[--qn],Pn[qn]=null,Rr=Pn[--qn],Pn[qn]=null,Nr=Pn[--qn],Pn[qn]=null}var an=null,bt=null,ke=!1,Gi=null,hr=!1,Od=Error(re(519));function Yi(e){var t=Error(re(418,""));throw au(jn(t,e)),Od}function xg(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[Qt]=e,t[ln]=r,n){case"dialog":Fe("cancel",t),Fe("close",t);break;case"iframe":case"object":case"embed":Fe("load",t);break;case"video":case"audio":for(n=0;n<_u.length;n++)Fe(_u[n],t);break;case"source":Fe("error",t);break;case"img":case"image":case"link":Fe("error",t),Fe("load",t);break;case"details":Fe("toggle",t);break;case"input":Fe("invalid",t),Ip(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0),Fl(t);break;case"select":Fe("invalid",t);break;case"textarea":Fe("invalid",t),kp(t,r.value,r.defaultValue,r.children),Fl(t)}n=r.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||r.suppressHydrationWarning===!0||k1(t.textContent,n)?(r.popover!=null&&(Fe("beforetoggle",t),Fe("toggle",t)),r.onScroll!=null&&Fe("scroll",t),r.onScrollEnd!=null&&Fe("scrollend",t),r.onClick!=null&&(t.onclick=As),t=!0):t=!1,t||Yi(e)}function wg(e){for(an=e.return;an;)switch(an.tag){case 5:case 13:hr=!1;return;case 27:case 3:hr=!0;return;default:an=an.return}}function ru(e){if(e!==an)return!1;if(!ke)return wg(e),ke=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||Q0(e.type,e.memoizedProps)),n=!n),n&&bt&&Yi(e),wg(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(re(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8)if(n=e.data,n==="/$"){if(t===0){bt=rr(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++;e=e.nextSibling}bt=null}}else t===27?(t=bt,Si(e.type)?(e=eh,eh=null,bt=e):bt=t):bt=an?rr(e.stateNode.nextSibling):null;return!0}function iu(){bt=an=null,ke=!1}function Eg(){var e=Gi;return e!==null&&(dn===null?dn=e:dn.push.apply(dn,e),Gi=null),e}function au(e){Gi===null?Gi=[e]:Gi.push(e)}var zd=cr(null),Xi=null,Or=null;function oi(e,t,n){ft(zd,t._currentValue),t._currentValue=n}function zr(e){e._currentValue=zd.current,It(zd)}function Ud(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Id(e,t,n,r){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var a=i.dependencies;if(a!==null){var o=i.child;a=a.firstContext;e:for(;a!==null;){var u=a;a=i;for(var l=0;l<t.length;l++)if(u.context===t[l]){a.lanes|=n,u=a.alternate,u!==null&&(u.lanes|=n),Ud(a.return,n,e),r||(o=null);break e}a=u.next}}else if(i.tag===18){if(o=i.return,o===null)throw Error(re(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),Ud(o,n,e),o=null}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===e){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}}function ou(e,t,n,r){e=null;for(var i=t,a=!1;i!==null;){if(!a){if(i.flags&524288)a=!0;else if(i.flags&262144)break}if(i.tag===10){var o=i.alternate;if(o===null)throw Error(re(387));if(o=o.memoizedProps,o!==null){var u=i.type;En(i.pendingProps.value,o.value)||(e!==null?e.push(u):e=[u])}}else if(i===xl.current){if(o=i.alternate,o===null)throw Error(re(387));o.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e!==null?e.push(zu):e=[zu])}i=i.return}e!==null&&Id(t,e,n,r),t.flags|=262144}function Gl(e){for(e=e.firstContext;e!==null;){if(!En(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Zi(e){Xi=e,Or=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Kt(e){return Ag(Xi,e)}function Yl(e,t){return Xi===null&&Zi(e),Ag(e,t)}function Ag(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Or===null){if(e===null)throw Error(re(308));Or=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Or=Or.next=t;return n}var Lw=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,r){e.push(r)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},jw=Rt.unstable_scheduleCallback,Hw=Rt.unstable_NormalPriority,Ot={$$typeof:Mr,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function $d(){return{controller:new Lw,data:new Map,refCount:0}}function uu(e){e.refCount--,e.refCount===0&&jw(Hw,function(){e.controller.abort()})}var lu=null,kd=0,$a=0,ka=null;function Pw(e,t){if(lu===null){var n=lu=[];kd=0,$a=j0(),ka={status:"pending",value:void 0,then:function(r){n.push(r)}}}return kd++,t.then(Cg,Cg),t}function Cg(){if(--kd===0&&lu!==null){ka!==null&&(ka.status="fulfilled");var e=lu;lu=null,$a=0,ka=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function qw(e,t){var n=[],r={status:"pending",value:null,reason:null,then:function(i){n.push(i)}};return e.then(function(){r.status="fulfilled",r.value=t;for(var i=0;i<n.length;i++)(0,n[i])(t)},function(i){for(r.status="rejected",r.reason=i,i=0;i<n.length;i++)(0,n[i])(void 0)}),r}var Tg=we.S;we.S=function(e,t){typeof t=="object"&&t!==null&&typeof t.then=="function"&&Pw(e,t),Tg!==null&&Tg(e,t)};var Qi=cr(null);function Ld(){var e=Qi.current;return e!==null?e:rt.pooledCache}function Xl(e,t){t===null?ft(Qi,Qi.current):ft(Qi,t.pool)}function Mg(){var e=Ld();return e===null?null:{parent:Ot._currentValue,pool:e}}var su=Error(re(460)),_g=Error(re(474)),Zl=Error(re(542)),jd={then:function(){}};function Bg(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Ql(){}function Fg(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Ql,Ql),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Rg(e),e;default:if(typeof t.status=="string")t.then(Ql,Ql);else{if(e=rt,e!==null&&100<e.shellSuspendCounter)throw Error(re(482));e=t,e.status="pending",e.then(function(r){if(t.status==="pending"){var i=t;i.status="fulfilled",i.value=r}},function(r){if(t.status==="pending"){var i=t;i.status="rejected",i.reason=r}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Rg(e),e}throw cu=t,su}}var cu=null;function Ng(){if(cu===null)throw Error(re(459));var e=cu;return cu=null,e}function Rg(e){if(e===su||e===Zl)throw Error(re(483))}var ui=!1;function Hd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Pd(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function li(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function si(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,qe&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Hl(e),bg(e,null,n),t}return jl(e,r,t,n),Hl(e)}function fu(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Cp(e,n)}}function qd(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Vd=!1;function du(){if(Vd){var e=ka;if(e!==null)throw e}}function hu(e,t,n,r){Vd=!1;var i=e.updateQueue;ui=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,u=i.shared.pending;if(u!==null){i.shared.pending=null;var l=u,s=l.next;l.next=null,o===null?a=s:o.next=s,o=l;var c=e.alternate;c!==null&&(c=c.updateQueue,u=c.lastBaseUpdate,u!==o&&(u===null?c.firstBaseUpdate=s:u.next=s,c.lastBaseUpdate=l))}if(a!==null){var f=i.baseState;o=0,c=s=l=null,u=a;do{var d=u.lane&-536870913,h=d!==u.lane;if(h?(Oe&d)===d:(r&d)===d){d!==0&&d===$a&&(Vd=!0),c!==null&&(c=c.next={lane:0,tag:u.tag,payload:u.payload,callback:null,next:null});e:{var v=e,m=u;d=t;var D=n;switch(m.tag){case 1:if(v=m.payload,typeof v=="function"){f=v.call(D,f,d);break e}f=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=m.payload,d=typeof v=="function"?v.call(D,f,d):v,d==null)break e;f=ut({},f,d);break e;case 2:ui=!0}}d=u.callback,d!==null&&(e.flags|=64,h&&(e.flags|=8192),h=i.callbacks,h===null?i.callbacks=[d]:h.push(d))}else h={lane:d,tag:u.tag,payload:u.payload,callback:u.callback,next:null},c===null?(s=c=h,l=f):c=c.next=h,o|=d;if(u=u.next,u===null){if(u=i.shared.pending,u===null)break;h=u,u=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(!0);c===null&&(l=f),i.baseState=l,i.firstBaseUpdate=s,i.lastBaseUpdate=c,a===null&&(i.shared.lanes=0),vi|=o,e.lanes=o,e.memoizedState=f}}function Og(e,t){if(typeof e!="function")throw Error(re(191,e));e.call(t)}function zg(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Og(n[e],t)}var La=cr(null),Kl=cr(0);function Ug(e,t){e=Hr,ft(Kl,e),ft(La,t),Hr=e|t.baseLanes}function Gd(){ft(Kl,Hr),ft(La,La.current)}function Yd(){Hr=Kl.current,It(La),It(Kl)}var ci=0,_e=null,Qe=null,Mt=null,Wl=!1,ja=!1,Ki=!1,Jl=0,mu=0,Ha=null,Vw=0;function Et(){throw Error(re(321))}function Xd(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!En(e[n],t[n]))return!1;return!0}function Zd(e,t,n,r,i,a){return ci=a,_e=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,we.H=e===null||e.memoizedState===null?bv:Dv,Ki=!1,a=n(r,i),Ki=!1,ja&&(a=$g(t,n,r,i)),Ig(e),a}function Ig(e){we.H=as;var t=Qe!==null&&Qe.next!==null;if(ci=0,Mt=Qe=_e=null,Wl=!1,mu=0,Ha=null,t)throw Error(re(300));e===null||kt||(e=e.dependencies,e!==null&&Gl(e)&&(kt=!0))}function $g(e,t,n,r){_e=e;var i=0;do{if(ja&&(Ha=null),mu=0,ja=!1,25<=i)throw Error(re(301));if(i+=1,Mt=Qe=null,e.updateQueue!=null){var a=e.updateQueue;a.lastEffect=null,a.events=null,a.stores=null,a.memoCache!=null&&(a.memoCache.index=0)}we.H=Ww,a=t(n,r)}while(ja);return a}function Gw(){var e=we.H,t=e.useState()[0];return t=typeof t.then=="function"?pu(t):t,e=e.useState()[0],(Qe!==null?Qe.memoizedState:null)!==e&&(_e.flags|=1024),t}function Qd(){var e=Jl!==0;return Jl=0,e}function Kd(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Wd(e){if(Wl){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Wl=!1}ci=0,Mt=Qe=_e=null,ja=!1,mu=Jl=0,Ha=null}function cn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Mt===null?_e.memoizedState=Mt=e:Mt=Mt.next=e,Mt}function _t(){if(Qe===null){var e=_e.alternate;e=e!==null?e.memoizedState:null}else e=Qe.next;var t=Mt===null?_e.memoizedState:Mt.next;if(t!==null)Mt=t,Qe=e;else{if(e===null)throw _e.alternate===null?Error(re(467)):Error(re(310));Qe=e,e={memoizedState:Qe.memoizedState,baseState:Qe.baseState,baseQueue:Qe.baseQueue,queue:Qe.queue,next:null},Mt===null?_e.memoizedState=Mt=e:Mt=Mt.next=e}return Mt}function Jd(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function pu(e){var t=mu;return mu+=1,Ha===null&&(Ha=[]),e=Fg(Ha,e,t),t=_e,(Mt===null?t.memoizedState:Mt.next)===null&&(t=t.alternate,we.H=t===null||t.memoizedState===null?bv:Dv),e}function es(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return pu(e);if(e.$$typeof===Mr)return Kt(e)}throw Error(re(438,String(e)))}function e0(e){var t=null,n=_e.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=_e.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(i){return i.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=Jd(),_e.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=Bx;return t.index++,n}function Ur(e,t){return typeof t=="function"?t(e):t}function ts(e){var t=_t();return t0(t,Qe,e)}function t0(e,t,n){var r=e.queue;if(r===null)throw Error(re(311));r.lastRenderedReducer=n;var i=e.baseQueue,a=r.pending;if(a!==null){if(i!==null){var o=i.next;i.next=a.next,a.next=o}t.baseQueue=i=a,r.pending=null}if(a=e.baseState,i===null)e.memoizedState=a;else{t=i.next;var u=o=null,l=null,s=t,c=!1;do{var f=s.lane&-536870913;if(f!==s.lane?(Oe&f)===f:(ci&f)===f){var d=s.revertLane;if(d===0)l!==null&&(l=l.next={lane:0,revertLane:0,action:s.action,hasEagerState:s.hasEagerState,eagerState:s.eagerState,next:null}),f===$a&&(c=!0);else if((ci&d)===d){s=s.next,d===$a&&(c=!0);continue}else f={lane:0,revertLane:s.revertLane,action:s.action,hasEagerState:s.hasEagerState,eagerState:s.eagerState,next:null},l===null?(u=l=f,o=a):l=l.next=f,_e.lanes|=d,vi|=d;f=s.action,Ki&&n(a,f),a=s.hasEagerState?s.eagerState:n(a,f)}else d={lane:f,revertLane:s.revertLane,action:s.action,hasEagerState:s.hasEagerState,eagerState:s.eagerState,next:null},l===null?(u=l=d,o=a):l=l.next=d,_e.lanes|=f,vi|=f;s=s.next}while(s!==null&&s!==t);if(l===null?o=a:l.next=u,!En(a,e.memoizedState)&&(kt=!0,c&&(n=ka,n!==null)))throw n;e.memoizedState=a,e.baseState=o,e.baseQueue=l,r.lastRenderedState=a}return i===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function n0(e){var t=_t(),n=t.queue;if(n===null)throw Error(re(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,a=t.memoizedState;if(i!==null){n.pending=null;var o=i=i.next;do a=e(a,o.action),o=o.next;while(o!==i);En(a,t.memoizedState)||(kt=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function kg(e,t,n){var r=_e,i=_t(),a=ke;if(a){if(n===void 0)throw Error(re(407));n=n()}else n=t();var o=!En((Qe||i).memoizedState,n);o&&(i.memoizedState=n,kt=!0),i=i.queue;var u=Hg.bind(null,r,i,e);if(gu(2048,8,u,[e]),i.getSnapshot!==t||o||Mt!==null&&Mt.memoizedState.tag&1){if(r.flags|=2048,Pa(9,ns(),jg.bind(null,r,i,n,t),null),rt===null)throw Error(re(349));a||ci&124||Lg(r,t,n)}return n}function Lg(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=_e.updateQueue,t===null?(t=Jd(),_e.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function jg(e,t,n,r){t.value=n,t.getSnapshot=r,Pg(t)&&qg(e)}function Hg(e,t,n){return n(function(){Pg(t)&&qg(e)})}function Pg(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!En(e,n)}catch{return!0}}function qg(e){var t=Oa(e,2);t!==null&&Bn(t,e,2)}function r0(e){var t=cn();if(typeof e=="function"){var n=e;if(e=n(),Ki){ri(!0);try{n()}finally{ri(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ur,lastRenderedState:e},t}function Vg(e,t,n,r){return e.baseState=n,t0(e,Qe,typeof r=="function"?r:Ur)}function Yw(e,t,n,r,i){if(is(e))throw Error(re(485));if(e=t.action,e!==null){var a={payload:i,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(o){a.listeners.push(o)}};we.T!==null?n(!0):a.isTransition=!1,r(a),n=t.pending,n===null?(a.next=t.pending=a,Gg(t,a)):(a.next=n.next,t.pending=n.next=a)}}function Gg(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=we.T,o={};we.T=o;try{var u=n(i,r),l=we.S;l!==null&&l(o,u),Yg(e,t,u)}catch(s){i0(e,t,s)}finally{we.T=a}}else try{a=n(i,r),Yg(e,t,a)}catch(s){i0(e,t,s)}}function Yg(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(r){Xg(e,t,r)},function(r){return i0(e,t,r)}):Xg(e,t,n)}function Xg(e,t,n){t.status="fulfilled",t.value=n,Zg(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Gg(e,n)))}function i0(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=n,Zg(t),t=t.next;while(t!==r)}e.action=null}function Zg(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Qg(e,t){return t}function Kg(e,t){if(ke){var n=rt.formState;if(n!==null){e:{var r=_e;if(ke){if(bt){t:{for(var i=bt,a=hr;i.nodeType!==8;){if(!a){i=null;break t}if(i=rr(i.nextSibling),i===null){i=null;break t}}a=i.data,i=a==="F!"||a==="F"?i:null}if(i){bt=rr(i.nextSibling),r=i.data==="F!";break e}}Yi(r)}r=!1}r&&(t=n[0])}}return n=cn(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qg,lastRenderedState:t},n.queue=r,n=gv.bind(null,_e,r),r.dispatch=n,r=r0(!1),a=s0.bind(null,_e,!1,r.queue),r=cn(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Yw.bind(null,_e,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Wg(e){var t=_t();return Jg(t,Qe,e)}function Jg(e,t,n){if(t=t0(e,t,Qg)[0],e=ts(Ur)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=pu(t)}catch(o){throw o===su?Zl:o}else r=t;t=_t();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(_e.flags|=2048,Pa(9,ns(),Xw.bind(null,i,n),null)),[r,a,e]}function Xw(e,t){e.action=t}function ev(e){var t=_t(),n=Qe;if(n!==null)return Jg(t,n,e);_t(),t=t.memoizedState,n=_t();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Pa(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=_e.updateQueue,t===null&&(t=Jd(),_e.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function ns(){return{destroy:void 0,resource:void 0}}function tv(){return _t().memoizedState}function rs(e,t,n,r){var i=cn();r=r===void 0?null:r,_e.flags|=e,i.memoizedState=Pa(1|t,ns(),n,r)}function gu(e,t,n,r){var i=_t();r=r===void 0?null:r;var a=i.memoizedState.inst;Qe!==null&&r!==null&&Xd(r,Qe.memoizedState.deps)?i.memoizedState=Pa(t,a,n,r):(_e.flags|=e,i.memoizedState=Pa(1|t,a,n,r))}function nv(e,t){rs(8390656,8,e,t)}function rv(e,t){gu(2048,8,e,t)}function iv(e,t){return gu(4,2,e,t)}function av(e,t){return gu(4,4,e,t)}function ov(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function uv(e,t,n){n=n!=null?n.concat([e]):null,gu(4,4,ov.bind(null,t,e),n)}function a0(){}function lv(e,t){var n=_t();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Xd(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function sv(e,t){var n=_t();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Xd(t,r[1]))return r[0];if(r=e(),Ki){ri(!0);try{e()}finally{ri(!1)}}return n.memoizedState=[r,t],r}function o0(e,t,n){return n===void 0||ci&1073741824?e.memoizedState=t:(e.memoizedState=n,e=d1(),_e.lanes|=e,vi|=e,n)}function cv(e,t,n,r){return En(n,t)?n:La.current!==null?(e=o0(e,n,r),En(e,t)||(kt=!0),e):ci&42?(e=d1(),_e.lanes|=e,vi|=e,t):(kt=!0,e.memoizedState=n)}function fv(e,t,n,r,i){var a=$e.p;$e.p=a!==0&&8>a?a:8;var o=we.T,u={};we.T=u,s0(e,!1,t,n);try{var l=i(),s=we.S;if(s!==null&&s(u,l),l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=qw(l,r);vu(e,t,c,_n(e))}else vu(e,t,r,_n(e))}catch(f){vu(e,t,{then:function(){},status:"rejected",reason:f},_n())}finally{$e.p=a,we.T=o}}function Zw(){}function u0(e,t,n,r){if(e.tag!==5)throw Error(re(476));var i=dv(e).queue;fv(e,i,t,Ii,n===null?Zw:function(){return hv(e),n(r)})}function dv(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Ii,baseState:Ii,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ur,lastRenderedState:Ii},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ur,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function hv(e){var t=dv(e).next.queue;vu(e,t,{},_n())}function l0(){return Kt(zu)}function mv(){return _t().memoizedState}function pv(){return _t().memoizedState}function Qw(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=_n();e=li(n);var r=si(t,e,n);r!==null&&(Bn(r,t,n),fu(r,t,n)),t={cache:$d()},e.payload=t;return}t=t.return}}function Kw(e,t,n){var r=_n();n={lane:r,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null},is(e)?vv(t,n):(n=Md(e,t,n,r),n!==null&&(Bn(n,e,r),yv(n,t,r)))}function gv(e,t,n){var r=_n();vu(e,t,n,r)}function vu(e,t,n,r){var i={lane:r,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null};if(is(e))vv(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,u=a(o,n);if(i.hasEagerState=!0,i.eagerState=u,En(u,o))return jl(e,t,i,0),rt===null&&Ll(),!1}catch{}finally{}if(n=Md(e,t,i,r),n!==null)return Bn(n,e,r),yv(n,t,r),!0}return!1}function s0(e,t,n,r){if(r={lane:2,revertLane:j0(),action:r,hasEagerState:!1,eagerState:null,next:null},is(e)){if(t)throw Error(re(479))}else t=Md(e,n,r,2),t!==null&&Bn(t,e,2)}function is(e){var t=e.alternate;return e===_e||t!==null&&t===_e}function vv(e,t){ja=Wl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function yv(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Cp(e,n)}}var as={readContext:Kt,use:es,useCallback:Et,useContext:Et,useEffect:Et,useImperativeHandle:Et,useLayoutEffect:Et,useInsertionEffect:Et,useMemo:Et,useReducer:Et,useRef:Et,useState:Et,useDebugValue:Et,useDeferredValue:Et,useTransition:Et,useSyncExternalStore:Et,useId:Et,useHostTransitionStatus:Et,useFormState:Et,useActionState:Et,useOptimistic:Et,useMemoCache:Et,useCacheRefresh:Et},bv={readContext:Kt,use:es,useCallback:function(e,t){return cn().memoizedState=[e,t===void 0?null:t],e},useContext:Kt,useEffect:nv,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,rs(4194308,4,ov.bind(null,t,e),n)},useLayoutEffect:function(e,t){return rs(4194308,4,e,t)},useInsertionEffect:function(e,t){rs(4,2,e,t)},useMemo:function(e,t){var n=cn();t=t===void 0?null:t;var r=e();if(Ki){ri(!0);try{e()}finally{ri(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=cn();if(n!==void 0){var i=n(t);if(Ki){ri(!0);try{n(t)}finally{ri(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Kw.bind(null,_e,e),[r.memoizedState,e]},useRef:function(e){var t=cn();return e={current:e},t.memoizedState=e},useState:function(e){e=r0(e);var t=e.queue,n=gv.bind(null,_e,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:a0,useDeferredValue:function(e,t){var n=cn();return o0(n,e,t)},useTransition:function(){var e=r0(!1);return e=fv.bind(null,_e,e.queue,!0,!1),cn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=_e,i=cn();if(ke){if(n===void 0)throw Error(re(407));n=n()}else{if(n=t(),rt===null)throw Error(re(349));Oe&124||Lg(r,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,nv(Hg.bind(null,r,a,e),[e]),r.flags|=2048,Pa(9,ns(),jg.bind(null,r,a,n,t),null),n},useId:function(){var e=cn(),t=rt.identifierPrefix;if(ke){var n=Rr,r=Nr;n=(r&~(1<<32-wn(r)-1)).toString(32)+n,t="«"+t+"R"+n,n=Jl++,0<n&&(t+="H"+n.toString(32)),t+="»"}else n=Vw++,t="«"+t+"r"+n.toString(32)+"»";return e.memoizedState=t},useHostTransitionStatus:l0,useFormState:Kg,useActionState:Kg,useOptimistic:function(e){var t=cn();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=s0.bind(null,_e,!0,n),n.dispatch=t,[e,t]},useMemoCache:e0,useCacheRefresh:function(){return cn().memoizedState=Qw.bind(null,_e)}},Dv={readContext:Kt,use:es,useCallback:lv,useContext:Kt,useEffect:rv,useImperativeHandle:uv,useInsertionEffect:iv,useLayoutEffect:av,useMemo:sv,useReducer:ts,useRef:tv,useState:function(){return ts(Ur)},useDebugValue:a0,useDeferredValue:function(e,t){var n=_t();return cv(n,Qe.memoizedState,e,t)},useTransition:function(){var e=ts(Ur)[0],t=_t().memoizedState;return[typeof e=="boolean"?e:pu(e),t]},useSyncExternalStore:kg,useId:mv,useHostTransitionStatus:l0,useFormState:Wg,useActionState:Wg,useOptimistic:function(e,t){var n=_t();return Vg(n,Qe,e,t)},useMemoCache:e0,useCacheRefresh:pv},Ww={readContext:Kt,use:es,useCallback:lv,useContext:Kt,useEffect:rv,useImperativeHandle:uv,useInsertionEffect:iv,useLayoutEffect:av,useMemo:sv,useReducer:n0,useRef:tv,useState:function(){return n0(Ur)},useDebugValue:a0,useDeferredValue:function(e,t){var n=_t();return Qe===null?o0(n,e,t):cv(n,Qe.memoizedState,e,t)},useTransition:function(){var e=n0(Ur)[0],t=_t().memoizedState;return[typeof e=="boolean"?e:pu(e),t]},useSyncExternalStore:kg,useId:mv,useHostTransitionStatus:l0,useFormState:ev,useActionState:ev,useOptimistic:function(e,t){var n=_t();return Qe!==null?Vg(n,Qe,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:e0,useCacheRefresh:pv},qa=null,yu=0;function os(e){var t=yu;return yu+=1,qa===null&&(qa=[]),Fg(qa,e,t)}function bu(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function us(e,t){throw t.$$typeof===Mx?Error(re(525)):(e=Object.prototype.toString.call(t),Error(re(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Sv(e){var t=e._init;return t(e._payload)}function xv(e){function t(p,g){if(e){var y=p.deletions;y===null?(p.deletions=[g],p.flags|=16):y.push(g)}}function n(p,g){if(!e)return null;for(;g!==null;)t(p,g),g=g.sibling;return null}function r(p){for(var g=new Map;p!==null;)p.key!==null?g.set(p.key,p):g.set(p.index,p),p=p.sibling;return g}function i(p,g){return p=Fr(p,g),p.index=0,p.sibling=null,p}function a(p,g,y){return p.index=y,e?(y=p.alternate,y!==null?(y=y.index,y<g?(p.flags|=67108866,g):y):(p.flags|=67108866,g)):(p.flags|=1048576,g)}function o(p){return e&&p.alternate===null&&(p.flags|=67108866),p}function u(p,g,y,S){return g===null||g.tag!==6?(g=Bd(y,p.mode,S),g.return=p,g):(g=i(g,y),g.return=p,g)}function l(p,g,y,S){var w=y.type;return w===va?c(p,g,y.props.children,S,y.key):g!==null&&(g.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===ti&&Sv(w)===g.type)?(g=i(g,y.props),bu(g,y),g.return=p,g):(g=Pl(y.type,y.key,y.props,null,p.mode,S),bu(g,y),g.return=p,g)}function s(p,g,y,S){return g===null||g.tag!==4||g.stateNode.containerInfo!==y.containerInfo||g.stateNode.implementation!==y.implementation?(g=Fd(y,p.mode,S),g.return=p,g):(g=i(g,y.children||[]),g.return=p,g)}function c(p,g,y,S,w){return g===null||g.tag!==7?(g=Pi(y,p.mode,S,w),g.return=p,g):(g=i(g,y),g.return=p,g)}function f(p,g,y){if(typeof g=="string"&&g!==""||typeof g=="number"||typeof g=="bigint")return g=Bd(""+g,p.mode,y),g.return=p,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case Sl:return y=Pl(g.type,g.key,g.props,null,p.mode,y),bu(y,g),y.return=p,y;case ko:return g=Fd(g,p.mode,y),g.return=p,g;case ti:var S=g._init;return g=S(g._payload),f(p,g,y)}if(jo(g)||Lo(g))return g=Pi(g,p.mode,y,null),g.return=p,g;if(typeof g.then=="function")return f(p,os(g),y);if(g.$$typeof===Mr)return f(p,Yl(p,g),y);us(p,g)}return null}function d(p,g,y,S){var w=g!==null?g.key:null;if(typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint")return w!==null?null:u(p,g,""+y,S);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Sl:return y.key===w?l(p,g,y,S):null;case ko:return y.key===w?s(p,g,y,S):null;case ti:return w=y._init,y=w(y._payload),d(p,g,y,S)}if(jo(y)||Lo(y))return w!==null?null:c(p,g,y,S,null);if(typeof y.then=="function")return d(p,g,os(y),S);if(y.$$typeof===Mr)return d(p,g,Yl(p,y),S);us(p,y)}return null}function h(p,g,y,S,w){if(typeof S=="string"&&S!==""||typeof S=="number"||typeof S=="bigint")return p=p.get(y)||null,u(g,p,""+S,w);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case Sl:return p=p.get(S.key===null?y:S.key)||null,l(g,p,S,w);case ko:return p=p.get(S.key===null?y:S.key)||null,s(g,p,S,w);case ti:var b=S._init;return S=b(S._payload),h(p,g,y,S,w)}if(jo(S)||Lo(S))return p=p.get(y)||null,c(g,p,S,w,null);if(typeof S.then=="function")return h(p,g,y,os(S),w);if(S.$$typeof===Mr)return h(p,g,y,Yl(g,S),w);us(g,S)}return null}function v(p,g,y,S){for(var w=null,b=null,E=g,C=g=0,A=null;E!==null&&C<y.length;C++){E.index>C?(A=E,E=null):A=E.sibling;var T=d(p,E,y[C],S);if(T===null){E===null&&(E=A);break}e&&E&&T.alternate===null&&t(p,E),g=a(T,g,C),b===null?w=T:b.sibling=T,b=T,E=A}if(C===y.length)return n(p,E),ke&&Vi(p,C),w;if(E===null){for(;C<y.length;C++)E=f(p,y[C],S),E!==null&&(g=a(E,g,C),b===null?w=E:b.sibling=E,b=E);return ke&&Vi(p,C),w}for(E=r(E);C<y.length;C++)A=h(E,p,C,y[C],S),A!==null&&(e&&A.alternate!==null&&E.delete(A.key===null?C:A.key),g=a(A,g,C),b===null?w=A:b.sibling=A,b=A);return e&&E.forEach(function(_){return t(p,_)}),ke&&Vi(p,C),w}function m(p,g,y,S){if(y==null)throw Error(re(151));for(var w=null,b=null,E=g,C=g=0,A=null,T=y.next();E!==null&&!T.done;C++,T=y.next()){E.index>C?(A=E,E=null):A=E.sibling;var _=d(p,E,T.value,S);if(_===null){E===null&&(E=A);break}e&&E&&_.alternate===null&&t(p,E),g=a(_,g,C),b===null?w=_:b.sibling=_,b=_,E=A}if(T.done)return n(p,E),ke&&Vi(p,C),w;if(E===null){for(;!T.done;C++,T=y.next())T=f(p,T.value,S),T!==null&&(g=a(T,g,C),b===null?w=T:b.sibling=T,b=T);return ke&&Vi(p,C),w}for(E=r(E);!T.done;C++,T=y.next())T=h(E,p,C,T.value,S),T!==null&&(e&&T.alternate!==null&&E.delete(T.key===null?C:T.key),g=a(T,g,C),b===null?w=T:b.sibling=T,b=T);return e&&E.forEach(function(x){return t(p,x)}),ke&&Vi(p,C),w}function D(p,g,y,S){if(typeof y=="object"&&y!==null&&y.type===va&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case Sl:e:{for(var w=y.key;g!==null;){if(g.key===w){if(w=y.type,w===va){if(g.tag===7){n(p,g.sibling),S=i(g,y.props.children),S.return=p,p=S;break e}}else if(g.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===ti&&Sv(w)===g.type){n(p,g.sibling),S=i(g,y.props),bu(S,y),S.return=p,p=S;break e}n(p,g);break}else t(p,g);g=g.sibling}y.type===va?(S=Pi(y.props.children,p.mode,S,y.key),S.return=p,p=S):(S=Pl(y.type,y.key,y.props,null,p.mode,S),bu(S,y),S.return=p,p=S)}return o(p);case ko:e:{for(w=y.key;g!==null;){if(g.key===w)if(g.tag===4&&g.stateNode.containerInfo===y.containerInfo&&g.stateNode.implementation===y.implementation){n(p,g.sibling),S=i(g,y.children||[]),S.return=p,p=S;break e}else{n(p,g);break}else t(p,g);g=g.sibling}S=Fd(y,p.mode,S),S.return=p,p=S}return o(p);case ti:return w=y._init,y=w(y._payload),D(p,g,y,S)}if(jo(y))return v(p,g,y,S);if(Lo(y)){if(w=Lo(y),typeof w!="function")throw Error(re(150));return y=w.call(y),m(p,g,y,S)}if(typeof y.then=="function")return D(p,g,os(y),S);if(y.$$typeof===Mr)return D(p,g,Yl(p,y),S);us(p,y)}return typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint"?(y=""+y,g!==null&&g.tag===6?(n(p,g.sibling),S=i(g,y),S.return=p,p=S):(n(p,g),S=Bd(y,p.mode,S),S.return=p,p=S),o(p)):n(p,g)}return function(p,g,y,S){try{yu=0;var w=D(p,g,y,S);return qa=null,w}catch(E){if(E===su||E===Zl)throw E;var b=An(29,E,null,p.mode);return b.lanes=S,b.return=p,b}finally{}}}var Va=xv(!0),wv=xv(!1),Vn=cr(null),mr=null;function fi(e){var t=e.alternate;ft(zt,zt.current&1),ft(Vn,e),mr===null&&(t===null||La.current!==null||t.memoizedState!==null)&&(mr=e)}function Ev(e){if(e.tag===22){if(ft(zt,zt.current),ft(Vn,e),mr===null){var t=e.alternate;t!==null&&t.memoizedState!==null&&(mr=e)}}else di()}function di(){ft(zt,zt.current),ft(Vn,Vn.current)}function Ir(e){It(Vn),mr===e&&(mr=null),It(zt)}var zt=cr(0);function ls(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||J0(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function c0(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:ut({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var f0={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=_n(),i=li(r);i.payload=t,n!=null&&(i.callback=n),t=si(e,i,r),t!==null&&(Bn(t,e,r),fu(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=_n(),i=li(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=si(e,i,r),t!==null&&(Bn(t,e,r),fu(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=_n(),r=li(n);r.tag=2,t!=null&&(r.callback=t),t=si(e,r,n),t!==null&&(Bn(t,e,n),fu(t,e,n))}};function Av(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!tu(n,r)||!tu(i,a):!0}function Cv(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&f0.enqueueReplaceState(t,t.state,null)}function Wi(e,t){var n=t;if("ref"in t){n={};for(var r in t)r!=="ref"&&(n[r]=t[r])}if(e=e.defaultProps){n===t&&(n=ut({},n));for(var i in e)n[i]===void 0&&(n[i]=e[i])}return n}var ss=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)};function Tv(e){ss(e)}function Mv(e){console.error(e)}function _v(e){ss(e)}function cs(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function Bv(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(i){setTimeout(function(){throw i})}}function d0(e,t,n){return n=li(n),n.tag=3,n.payload={element:null},n.callback=function(){cs(e,t)},n}function Fv(e){return e=li(e),e.tag=3,e}function Nv(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i=="function"){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Bv(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch=="function"&&(e.callback=function(){Bv(t,n,r),typeof i!="function"&&(yi===null?yi=new Set([this]):yi.add(this));var u=r.stack;this.componentDidCatch(r.value,{componentStack:u!==null?u:""})})}function Jw(e,t,n,r,i){if(n.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=n.alternate,t!==null&&ou(t,n,i,!0),n=Vn.current,n!==null){switch(n.tag){case 13:return mr===null?U0():n.alternate===null&&Dt===0&&(Dt=3),n.flags&=-257,n.flags|=65536,n.lanes=i,r===jd?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),$0(e,r,i)),!1;case 22:return n.flags|=65536,r===jd?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),$0(e,r,i)),!1}throw Error(re(435,n.tag))}return $0(e,r,i),U0(),!1}if(ke)return t=Vn.current,t!==null?(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==Od&&(e=Error(re(422),{cause:r}),au(jn(e,n)))):(r!==Od&&(t=Error(re(423),{cause:r}),au(jn(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,r=jn(r,n),i=d0(e.stateNode,r,i),qd(e,i),Dt!==4&&(Dt=2)),!1;var a=Error(re(520),{cause:r});if(a=jn(a,n),Cu===null?Cu=[a]:Cu.push(a),Dt!==4&&(Dt=2),t===null)return!0;r=jn(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=d0(n.stateNode,r,e),qd(n,e),!1;case 1:if(t=n.type,a=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||a!==null&&typeof a.componentDidCatch=="function"&&(yi===null||!yi.has(a))))return n.flags|=65536,i&=-i,n.lanes|=i,i=Fv(i),Nv(i,e,n,r),qd(n,i),!1}n=n.return}while(n!==null);return!1}var Rv=Error(re(461)),kt=!1;function Vt(e,t,n,r){t.child=e===null?wv(t,null,n,r):Va(t,e.child,n,r)}function Ov(e,t,n,r,i){n=n.render;var a=t.ref;if("ref"in r){var o={};for(var u in r)u!=="ref"&&(o[u]=r[u])}else o=r;return Zi(t),r=Zd(e,t,n,o,a,i),u=Qd(),e!==null&&!kt?(Kd(e,t,i),$r(e,t,i)):(ke&&u&&Nd(t),t.flags|=1,Vt(e,t,r,i),t.child)}function zv(e,t,n,r,i){if(e===null){var a=n.type;return typeof a=="function"&&!_d(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Uv(e,t,a,r,i)):(e=Pl(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!D0(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n!==null?n:tu,n(o,r)&&e.ref===t.ref)return $r(e,t,i)}return t.flags|=1,e=Fr(a,r),e.ref=t.ref,e.return=t,t.child=e}function Uv(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(tu(a,r)&&e.ref===t.ref)if(kt=!1,t.pendingProps=r=a,D0(e,i))e.flags&131072&&(kt=!0);else return t.lanes=e.lanes,$r(e,t,i)}return h0(e,t,n,r,i)}function Iv(e,t,n){var r=t.pendingProps,i=r.children,a=e!==null?e.memoizedState:null;if(r.mode==="hidden"){if(t.flags&128){if(r=a!==null?a.baseLanes|n:n,e!==null){for(i=t.child=e.child,a=0;i!==null;)a=a|i.lanes|i.childLanes,i=i.sibling;t.childLanes=a&~r}else t.childLanes=0,t.child=null;return $v(e,t,r,n)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Xl(t,a!==null?a.cachePool:null),a!==null?Ug(t,a):Gd(),Ev(t);else return t.lanes=t.childLanes=536870912,$v(e,t,a!==null?a.baseLanes|n:n,n)}else a!==null?(Xl(t,a.cachePool),Ug(t,a),di(),t.memoizedState=null):(e!==null&&Xl(t,null),Gd(),di());return Vt(e,t,i,n),t.child}function $v(e,t,n,r){var i=Ld();return i=i===null?null:{parent:Ot._currentValue,pool:i},t.memoizedState={baseLanes:n,cachePool:i},e!==null&&Xl(t,null),Gd(),Ev(t),e!==null&&ou(e,t,r,!0),null}function fs(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(re(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function h0(e,t,n,r,i){return Zi(t),n=Zd(e,t,n,r,void 0,i),r=Qd(),e!==null&&!kt?(Kd(e,t,i),$r(e,t,i)):(ke&&r&&Nd(t),t.flags|=1,Vt(e,t,n,i),t.child)}function kv(e,t,n,r,i,a){return Zi(t),t.updateQueue=null,n=$g(t,r,n,i),Ig(e),r=Qd(),e!==null&&!kt?(Kd(e,t,a),$r(e,t,a)):(ke&&r&&Nd(t),t.flags|=1,Vt(e,t,n,a),t.child)}function Lv(e,t,n,r,i){if(Zi(t),t.stateNode===null){var a=za,o=n.contextType;typeof o=="object"&&o!==null&&(a=Kt(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=f0,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Hd(t),o=n.contextType,a.context=typeof o=="object"&&o!==null?Kt(o):za,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o=="function"&&(c0(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof a.getSnapshotBeforeUpdate=="function"||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(o=a.state,typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount(),o!==a.state&&f0.enqueueReplaceState(a,a.state,null),hu(t,r,a,i),du(),a.state=t.memoizedState),typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var u=t.memoizedProps,l=Wi(n,u);a.props=l;var s=a.context,c=n.contextType;o=za,typeof c=="object"&&c!==null&&(o=Kt(c));var f=n.getDerivedStateFromProps;c=typeof f=="function"||typeof a.getSnapshotBeforeUpdate=="function",u=t.pendingProps!==u,c||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(u||s!==o)&&Cv(t,a,r,o),ui=!1;var d=t.memoizedState;a.state=d,hu(t,r,a,i),du(),s=t.memoizedState,u||d!==s||ui?(typeof f=="function"&&(c0(t,n,f,r),s=t.memoizedState),(l=ui||Av(t,n,l,r,d,s,o))?(c||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=s),a.props=r,a.state=s,a.context=o,r=l):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Pd(e,t),o=t.memoizedProps,c=Wi(n,o),a.props=c,f=t.pendingProps,d=a.context,s=n.contextType,l=za,typeof s=="object"&&s!==null&&(l=Kt(s)),u=n.getDerivedStateFromProps,(s=typeof u=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==f||d!==l)&&Cv(t,a,r,l),ui=!1,d=t.memoizedState,a.state=d,hu(t,r,a,i),du();var h=t.memoizedState;o!==f||d!==h||ui||e!==null&&e.dependencies!==null&&Gl(e.dependencies)?(typeof u=="function"&&(c0(t,n,u,r),h=t.memoizedState),(c=ui||Av(t,n,c,r,d,h,l)||e!==null&&e.dependencies!==null&&Gl(e.dependencies))?(s||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,h,l),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,h,l)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=h),a.props=r,a.state=h,a.context=l,r=c):(typeof a.componentDidUpdate!="function"||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,fs(e,t),r=(t.flags&128)!==0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!="function"?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Va(t,e.child,null,i),t.child=Va(t,null,n,i)):Vt(e,t,n,i),t.memoizedState=a.state,e=t.child):e=$r(e,t,i),e}function jv(e,t,n,r){return iu(),t.flags|=256,Vt(e,t,n,r),t.child}var m0={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function p0(e){return{baseLanes:e,cachePool:Mg()}}function g0(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=Gn),e}function Hv(e,t,n){var r=t.pendingProps,i=!1,a=(t.flags&128)!==0,o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:(zt.current&2)!==0),o&&(i=!0,t.flags&=-129),o=(t.flags&32)!==0,t.flags&=-33,e===null){if(ke){if(i?fi(t):di(),ke){var u=bt,l;if(l=u){e:{for(l=u,u=hr;l.nodeType!==8;){if(!u){u=null;break e}if(l=rr(l.nextSibling),l===null){u=null;break e}}u=l}u!==null?(t.memoizedState={dehydrated:u,treeContext:qi!==null?{id:Nr,overflow:Rr}:null,retryLane:536870912,hydrationErrors:null},l=An(18,null,null,0),l.stateNode=u,l.return=t,t.child=l,an=t,bt=null,l=!0):l=!1}l||Yi(t)}if(u=t.memoizedState,u!==null&&(u=u.dehydrated,u!==null))return J0(u)?t.lanes=32:t.lanes=536870912,null;Ir(t)}return u=r.children,r=r.fallback,i?(di(),i=t.mode,u=ds({mode:"hidden",children:u},i),r=Pi(r,i,n,null),u.return=t,r.return=t,u.sibling=r,t.child=u,i=t.child,i.memoizedState=p0(n),i.childLanes=g0(e,o,n),t.memoizedState=m0,r):(fi(t),v0(t,u))}if(l=e.memoizedState,l!==null&&(u=l.dehydrated,u!==null)){if(a)t.flags&256?(fi(t),t.flags&=-257,t=y0(e,t,n)):t.memoizedState!==null?(di(),t.child=e.child,t.flags|=128,t=null):(di(),i=r.fallback,u=t.mode,r=ds({mode:"visible",children:r.children},u),i=Pi(i,u,n,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,Va(t,e.child,null,n),r=t.child,r.memoizedState=p0(n),r.childLanes=g0(e,o,n),t.memoizedState=m0,t=i);else if(fi(t),J0(u)){if(o=u.nextSibling&&u.nextSibling.dataset,o)var s=o.dgst;o=s,r=Error(re(419)),r.stack="",r.digest=o,au({value:r,source:null,stack:null}),t=y0(e,t,n)}else if(kt||ou(e,t,n,!1),o=(n&e.childLanes)!==0,kt||o){if(o=rt,o!==null&&(r=n&-n,r=r&42?1:ed(r),r=r&(o.suspendedLanes|n)?0:r,r!==0&&r!==l.retryLane))throw l.retryLane=r,Oa(e,r),Bn(o,e,r),Rv;u.data==="$?"||U0(),t=y0(e,t,n)}else u.data==="$?"?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,bt=rr(u.nextSibling),an=t,ke=!0,Gi=null,hr=!1,e!==null&&(Pn[qn++]=Nr,Pn[qn++]=Rr,Pn[qn++]=qi,Nr=e.id,Rr=e.overflow,qi=t),t=v0(t,r.children),t.flags|=4096);return t}return i?(di(),i=r.fallback,u=t.mode,l=e.child,s=l.sibling,r=Fr(l,{mode:"hidden",children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,s!==null?i=Fr(s,i):(i=Pi(i,u,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,u=e.child.memoizedState,u===null?u=p0(n):(l=u.cachePool,l!==null?(s=Ot._currentValue,l=l.parent!==s?{parent:s,pool:s}:l):l=Mg(),u={baseLanes:u.baseLanes|n,cachePool:l}),i.memoizedState=u,i.childLanes=g0(e,o,n),t.memoizedState=m0,r):(fi(t),n=e.child,e=n.sibling,n=Fr(n,{mode:"visible",children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function v0(e,t){return t=ds({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function ds(e,t){return e=An(22,e,null,t),e.lanes=0,e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},e}function y0(e,t,n){return Va(t,e.child,null,n),e=v0(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Pv(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ud(e.return,t,n)}function b0(e,t,n,r,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i)}function qv(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(Vt(e,t,r.children,n),r=zt.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Pv(e,n,t);else if(e.tag===19)Pv(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}switch(ft(zt,r),i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&ls(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),b0(t,!1,i,n,a);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&ls(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}b0(t,!0,n,null,a);break;case"together":b0(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function $r(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),vi|=t.lanes,!(n&t.childLanes))if(e!==null){if(ou(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(re(153));if(t.child!==null){for(e=t.child,n=Fr(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Fr(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function D0(e,t){return e.lanes&t?!0:(e=e.dependencies,!!(e!==null&&Gl(e)))}function eE(e,t,n){switch(t.tag){case 3:wl(t,t.stateNode.containerInfo),oi(t,Ot,e.memoizedState.cache),iu();break;case 27:case 5:Zf(t);break;case 4:wl(t,t.stateNode.containerInfo);break;case 10:oi(t,t.type,t.memoizedProps.value);break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated!==null?(fi(t),t.flags|=128,null):n&t.child.childLanes?Hv(e,t,n):(fi(t),e=$r(e,t,n),e!==null?e.sibling:null);fi(t);break;case 19:var i=(e.flags&128)!==0;if(r=(n&t.childLanes)!==0,r||(ou(e,t,n,!1),r=(n&t.childLanes)!==0),i){if(r)return qv(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),ft(zt,zt.current),r)break;return null;case 22:case 23:return t.lanes=0,Iv(e,t,n);case 24:oi(t,Ot,e.memoizedState.cache)}return $r(e,t,n)}function Vv(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)kt=!0;else{if(!D0(e,n)&&!(t.flags&128))return kt=!1,eE(e,t,n);kt=!!(e.flags&131072)}else kt=!1,ke&&t.flags&1048576&&Sg(t,Vl,t.index);switch(t.lanes=0,t.tag){case 16:e:{e=t.pendingProps;var r=t.elementType,i=r._init;if(r=i(r._payload),t.type=r,typeof r=="function")_d(r)?(e=Wi(r,e),t.tag=1,t=Lv(null,t,r,e,n)):(t.tag=0,t=h0(null,t,r,e,n));else{if(r!=null){if(i=r.$$typeof,i===Hf){t.tag=11,t=Ov(null,t,r,e,n);break e}else if(i===Vf){t.tag=14,t=zv(null,t,r,e,n);break e}}throw t=Yf(r)||r,Error(re(306,t,""))}}return t;case 0:return h0(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,i=Wi(r,t.pendingProps),Lv(e,t,r,i,n);case 3:e:{if(wl(t,t.stateNode.containerInfo),e===null)throw Error(re(387));r=t.pendingProps;var a=t.memoizedState;i=a.element,Pd(e,t),hu(t,r,null,n);var o=t.memoizedState;if(r=o.cache,oi(t,Ot,r),r!==a.cache&&Id(t,[Ot],n,!0),du(),r=o.element,a.isDehydrated)if(a={element:r,isDehydrated:!1,cache:o.cache},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){t=jv(e,t,r,n);break e}else if(r!==i){i=jn(Error(re(424)),t),au(i),t=jv(e,t,r,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(bt=rr(e.firstChild),an=t,ke=!0,Gi=null,hr=!0,n=wv(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(iu(),r===i){t=$r(e,t,n);break e}Vt(e,t,r,n)}t=t.child}return t;case 26:return fs(e,t),e===null?(n=Z1(t.type,null,t.pendingProps,null))?t.memoizedState=n:ke||(n=t.type,e=t.pendingProps,r=Cs(ni.current).createElement(n),r[Qt]=t,r[ln]=e,Yt(r,n,e),$t(r),t.stateNode=r):t.memoizedState=Z1(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Zf(t),e===null&&ke&&(r=t.stateNode=G1(t.type,t.pendingProps,ni.current),an=t,hr=!0,i=bt,Si(t.type)?(eh=i,bt=rr(r.firstChild)):bt=i),Vt(e,t,t.pendingProps.children,n),fs(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ke&&((i=r=bt)&&(r=ME(r,t.type,t.pendingProps,hr),r!==null?(t.stateNode=r,an=t,bt=rr(r.firstChild),hr=!1,i=!0):i=!1),i||Yi(t)),Zf(t),i=t.type,a=t.pendingProps,o=e!==null?e.memoizedProps:null,r=a.children,Q0(i,a)?r=null:o!==null&&Q0(i,o)&&(t.flags|=32),t.memoizedState!==null&&(i=Zd(e,t,Gw,null,null,n),zu._currentValue=i),fs(e,t),Vt(e,t,r,n),t.child;case 6:return e===null&&ke&&((e=n=bt)&&(n=_E(n,t.pendingProps,hr),n!==null?(t.stateNode=n,an=t,bt=null,e=!0):e=!1),e||Yi(t)),null;case 13:return Hv(e,t,n);case 4:return wl(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Va(t,null,r,n):Vt(e,t,r,n),t.child;case 11:return Ov(e,t,t.type,t.pendingProps,n);case 7:return Vt(e,t,t.pendingProps,n),t.child;case 8:return Vt(e,t,t.pendingProps.children,n),t.child;case 12:return Vt(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,oi(t,t.type,r.value),Vt(e,t,r.children,n),t.child;case 9:return i=t.type._context,r=t.pendingProps.children,Zi(t),i=Kt(i),r=r(i),t.flags|=1,Vt(e,t,r,n),t.child;case 14:return zv(e,t,t.type,t.pendingProps,n);case 15:return Uv(e,t,t.type,t.pendingProps,n);case 19:return qv(e,t,n);case 31:return r=t.pendingProps,n=t.mode,r={mode:r.mode,children:r.children},e===null?(n=ds(r,n),n.ref=t.ref,t.child=n,n.return=t,t=n):(n=Fr(e.child,r),n.ref=t.ref,t.child=n,n.return=t,t=n),t;case 22:return Iv(e,t,n);case 24:return Zi(t),r=Kt(Ot),e===null?(i=Ld(),i===null&&(i=rt,a=$d(),i.pooledCache=a,a.refCount++,a!==null&&(i.pooledCacheLanes|=n),i=a),t.memoizedState={parent:r,cache:i},Hd(t),oi(t,Ot,i)):(e.lanes&n&&(Pd(e,t),hu(t,null,null,n),du()),i=e.memoizedState,a=t.memoizedState,i.parent!==r?(i={parent:r,cache:r},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),oi(t,Ot,r)):(r=a.cache,oi(t,Ot,r),r!==i.cache&&Id(t,[Ot],n,!0))),Vt(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(re(156,t.tag))}function kr(e){e.flags|=4}function Gv(e,t){if(t.type!=="stylesheet"||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!ey(t)){if(t=Vn.current,t!==null&&((Oe&4194048)===Oe?mr!==null:(Oe&62914560)!==Oe&&!(Oe&536870912)||t!==mr))throw cu=jd,_g;e.flags|=8192}}function hs(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Ep():536870912,e.lanes|=t,Za|=t)}function Du(e,t){if(!ke)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function gt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function tE(e,t,n){var r=t.pendingProps;switch(Rd(t),t.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return gt(t),null;case 1:return gt(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),zr(Ot),ba(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ru(t)?kr(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Eg())),gt(t),null;case 26:return n=t.memoizedState,e===null?(kr(t),n!==null?(gt(t),Gv(t,n)):(gt(t),t.flags&=-16777217)):n?n!==e.memoizedState?(kr(t),gt(t),Gv(t,n)):(gt(t),t.flags&=-16777217):(e.memoizedProps!==r&&kr(t),gt(t),t.flags&=-16777217),null;case 27:El(t),n=ni.current;var i=t.type;if(e!==null&&t.stateNode!=null)e.memoizedProps!==r&&kr(t);else{if(!r){if(t.stateNode===null)throw Error(re(166));return gt(t),null}e=fr.current,ru(t)?xg(t):(e=G1(i,r,n),t.stateNode=e,kr(t))}return gt(t),null;case 5:if(El(t),n=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&kr(t);else{if(!r){if(t.stateNode===null)throw Error(re(166));return gt(t),null}if(e=fr.current,ru(t))xg(t);else{switch(i=Cs(ni.current),e){case 1:e=i.createElementNS("http://www.w3.org/2000/svg",n);break;case 2:e=i.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;default:switch(n){case"svg":e=i.createElementNS("http://www.w3.org/2000/svg",n);break;case"math":e=i.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;case"script":e=i.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild);break;case"select":e=typeof r.is=="string"?i.createElement("select",{is:r.is}):i.createElement("select"),r.multiple?e.multiple=!0:r.size&&(e.size=r.size);break;default:e=typeof r.is=="string"?i.createElement(n,{is:r.is}):i.createElement(n)}}e[Qt]=t,e[ln]=r;e:for(i=t.child;i!==null;){if(i.tag===5||i.tag===6)e.appendChild(i.stateNode);else if(i.tag!==4&&i.tag!==27&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break e;for(;i.sibling===null;){if(i.return===null||i.return===t)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}t.stateNode=e;e:switch(Yt(e,n,r),n){case"button":case"input":case"select":case"textarea":e=!!r.autoFocus;break e;case"img":e=!0;break e;default:e=!1}e&&kr(t)}}return gt(t),t.flags&=-16777217,null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&kr(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(re(166));if(e=ni.current,ru(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=an,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[Qt]=t,e=!!(e.nodeValue===n||r!==null&&r.suppressHydrationWarning===!0||k1(e.nodeValue,n)),e||Yi(t)}else e=Cs(e).createTextNode(r),e[Qt]=t,t.stateNode=e}return gt(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=ru(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(re(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(re(317));i[Qt]=t}else iu(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;gt(t),i=!1}else i=Eg(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(Ir(t),t):(Ir(t),null)}if(Ir(t),t.flags&128)return t.lanes=n,t;if(n=r!==null,e=e!==null&&e.memoizedState!==null,n){r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool);var a=null;r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(a=r.memoizedState.cachePool.pool),a!==i&&(r.flags|=2048)}return n!==e&&n&&(t.child.flags|=8192),hs(t,t.updateQueue),gt(t),null;case 4:return ba(),e===null&&V0(t.stateNode.containerInfo),gt(t),null;case 10:return zr(t.type),gt(t),null;case 19:if(It(zt),i=t.memoizedState,i===null)return gt(t),null;if(r=(t.flags&128)!==0,a=i.rendering,a===null)if(r)Du(i,!1);else{if(Dt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=ls(e),a!==null){for(t.flags|=128,Du(i,!1),e=a.updateQueue,t.updateQueue=e,hs(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Dg(n,e),n=n.sibling;return ft(zt,zt.current&1|2),t.child}e=e.sibling}i.tail!==null&&dr()>gs&&(t.flags|=128,r=!0,Du(i,!1),t.lanes=4194304)}else{if(!r)if(e=ls(a),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,hs(t,e),Du(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!ke)return gt(t),null}else 2*dr()-i.renderingStartTime>gs&&n!==536870912&&(t.flags|=128,r=!0,Du(i,!1),t.lanes=4194304);i.isBackwards?(a.sibling=t.child,t.child=a):(e=i.last,e!==null?e.sibling=a:t.child=a,i.last=a)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=dr(),t.sibling=null,e=zt.current,ft(zt,r?e&1|2:e&1),t):(gt(t),null);case 22:case 23:return Ir(t),Yd(),r=t.memoizedState!==null,e!==null?e.memoizedState!==null!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(gt(t),t.subtreeFlags&6&&(t.flags|=8192)):gt(t),n=t.updateQueue,n!==null&&hs(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&It(Qi),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),zr(Ot),gt(t),null;case 25:return null;case 30:return null}throw Error(re(156,t.tag))}function nE(e,t){switch(Rd(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return zr(Ot),ba(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return El(t),null;case 13:if(Ir(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(re(340));iu()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return It(zt),null;case 4:return ba(),null;case 10:return zr(t.type),null;case 22:case 23:return Ir(t),Yd(),e!==null&&It(Qi),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return zr(Ot),null;case 25:return null;default:return null}}function Yv(e,t){switch(Rd(t),t.tag){case 3:zr(Ot),ba();break;case 26:case 27:case 5:El(t);break;case 4:ba();break;case 13:Ir(t);break;case 19:It(zt);break;case 10:zr(t.type);break;case 22:case 23:Ir(t),Yd(),e!==null&&It(Qi);break;case 24:zr(Ot)}}function Su(e,t){try{var n=t.updateQueue,r=n!==null?n.lastEffect:null;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(u){Je(t,t.return,u)}}function hi(e,t,n){try{var r=t.updateQueue,i=r!==null?r.lastEffect:null;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,u=o.destroy;if(u!==void 0){o.destroy=void 0,i=t;var l=n,s=u;try{s()}catch(c){Je(i,l,c)}}}r=r.next}while(r!==a)}}catch(c){Je(t,t.return,c)}}function Xv(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{zg(t,n)}catch(r){Je(e,e.return,r)}}}function Zv(e,t,n){n.props=Wi(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(r){Je(e,t,r)}}function xu(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n=="function"?e.refCleanup=n(r):n.current=r}}catch(i){Je(e,t,i)}}function pr(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r=="function")try{r()}catch(i){Je(e,t,i)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(i){Je(e,t,i)}else n.current=null}function Qv(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&r.focus();break e;case"img":n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(i){Je(e,e.return,i)}}function S0(e,t,n){try{var r=e.stateNode;wE(r,e.type,n,t),r[ln]=t}catch(i){Je(e,e.return,i)}}function Kv(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Si(e.type)||e.tag===4}function x0(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Kv(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Si(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function w0(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=As));else if(r!==4&&(r===27&&Si(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(w0(e,t,n),e=e.sibling;e!==null;)w0(e,t,n),e=e.sibling}function ms(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Si(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(ms(e,t,n),e=e.sibling;e!==null;)ms(e,t,n),e=e.sibling}function Wv(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Yt(t,r,n),t[Qt]=e,t[ln]=n}catch(a){Je(e,e.return,a)}}var Lr=!1,At=!1,E0=!1,Jv=typeof WeakSet=="function"?WeakSet:Set,Lt=null;function rE(e,t){if(e=e.containerInfo,X0=Ns,e=cg(e),xd(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var o=0,u=-1,l=-1,s=0,c=0,f=e,d=null;t:for(;;){for(var h;f!==n||i!==0&&f.nodeType!==3||(u=o+i),f!==a||r!==0&&f.nodeType!==3||(l=o+r),f.nodeType===3&&(o+=f.nodeValue.length),(h=f.firstChild)!==null;)d=f,f=h;for(;;){if(f===e)break t;if(d===n&&++s===i&&(u=o),d===a&&++c===r&&(l=o),(h=f.nextSibling)!==null)break;f=d,d=f.parentNode}f=h}n=u===-1||l===-1?null:{start:u,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Z0={focusedElem:e,selectionRange:n},Ns=!1,Lt=t;Lt!==null;)if(t=Lt,e=t.child,(t.subtreeFlags&1024)!==0&&e!==null)e.return=t,Lt=e;else for(;Lt!==null;){switch(t=Lt,a=t.alternate,e=t.flags,t.tag){case 0:break;case 11:case 15:break;case 1:if(e&1024&&a!==null){e=void 0,n=t,i=a.memoizedProps,a=a.memoizedState,r=n.stateNode;try{var v=Wi(n.type,i,n.elementType===n.type);e=r.getSnapshotBeforeUpdate(v,a),r.__reactInternalSnapshotBeforeUpdate=e}catch(m){Je(n,n.return,m)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)W0(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":W0(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(re(163))}if(e=t.sibling,e!==null){e.return=t.return,Lt=e;break}Lt=t.return}}function e1(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:mi(e,n),r&4&&Su(5,n);break;case 1:if(mi(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(o){Je(n,n.return,o)}else{var i=Wi(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(o){Je(n,n.return,o)}}r&64&&Xv(n),r&512&&xu(n,n.return);break;case 3:if(mi(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{zg(e,t)}catch(o){Je(n,n.return,o)}}break;case 27:t===null&&r&4&&Wv(n);case 26:case 5:mi(e,n),t===null&&r&4&&Qv(n),r&512&&xu(n,n.return);break;case 12:mi(e,n);break;case 13:mi(e,n),r&4&&r1(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=dE.bind(null,n),BE(e,n))));break;case 22:if(r=n.memoizedState!==null||Lr,!r){t=t!==null&&t.memoizedState!==null||At,i=Lr;var a=At;Lr=r,(At=t)&&!a?pi(e,n,(n.subtreeFlags&8772)!==0):mi(e,n),Lr=i,At=a}break;case 30:break;default:mi(e,n)}}function t1(e){var t=e.alternate;t!==null&&(e.alternate=null,t1(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&rd(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var dt=null,fn=!1;function jr(e,t,n){for(n=n.child;n!==null;)n1(e,t,n),n=n.sibling}function n1(e,t,n){if(xn&&typeof xn.onCommitFiberUnmount=="function")try{xn.onCommitFiberUnmount(Po,n)}catch{}switch(n.tag){case 26:At||pr(n,t),jr(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:At||pr(n,t);var r=dt,i=fn;Si(n.type)&&(dt=n.stateNode,fn=!1),jr(e,t,n),Fu(n.stateNode),dt=r,fn=i;break;case 5:At||pr(n,t);case 6:if(r=dt,i=fn,dt=null,jr(e,t,n),dt=r,fn=i,dt!==null)if(fn)try{(dt.nodeType===9?dt.body:dt.nodeName==="HTML"?dt.ownerDocument.body:dt).removeChild(n.stateNode)}catch(a){Je(n,t,a)}else try{dt.removeChild(n.stateNode)}catch(a){Je(n,t,a)}break;case 18:dt!==null&&(fn?(e=dt,q1(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),ku(e)):q1(dt,n.stateNode));break;case 4:r=dt,i=fn,dt=n.stateNode.containerInfo,fn=!0,jr(e,t,n),dt=r,fn=i;break;case 0:case 11:case 14:case 15:At||hi(2,n,t),At||hi(4,n,t),jr(e,t,n);break;case 1:At||(pr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"&&Zv(n,t,r)),jr(e,t,n);break;case 21:jr(e,t,n);break;case 22:At=(r=At)||n.memoizedState!==null,jr(e,t,n),At=r;break;default:jr(e,t,n)}}function r1(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{ku(e)}catch(n){Je(t,t.return,n)}}function iE(e){switch(e.tag){case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Jv),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Jv),t;default:throw Error(re(435,e.tag))}}function A0(e,t){var n=iE(e);t.forEach(function(r){var i=hE.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}function Cn(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r],a=e,o=t,u=o;e:for(;u!==null;){switch(u.tag){case 27:if(Si(u.type)){dt=u.stateNode,fn=!1;break e}break;case 5:dt=u.stateNode,fn=!1;break e;case 3:case 4:dt=u.stateNode.containerInfo,fn=!0;break e}u=u.return}if(dt===null)throw Error(re(160));n1(a,o,i),dt=null,fn=!1,a=i.alternate,a!==null&&(a.return=null),i.return=null}if(t.subtreeFlags&13878)for(t=t.child;t!==null;)i1(t,e),t=t.sibling}var nr=null;function i1(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Cn(t,e),Tn(e),r&4&&(hi(3,e,e.return),Su(3,e),hi(5,e,e.return));break;case 1:Cn(t,e),Tn(e),r&512&&(At||n===null||pr(n,n.return)),r&64&&Lr&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var i=nr;if(Cn(t,e),Tn(e),r&512&&(At||n===null||pr(n,n.return)),r&4){var a=n!==null?n.memoizedState:null;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){e:{r=e.type,n=e.memoizedProps,i=i.ownerDocument||i;t:switch(r){case"title":a=i.getElementsByTagName("title")[0],(!a||a[Go]||a[Qt]||a.namespaceURI==="http://www.w3.org/2000/svg"||a.hasAttribute("itemprop"))&&(a=i.createElement(r),i.head.insertBefore(a,i.querySelector("head > title"))),Yt(a,r,n),a[Qt]=e,$t(a),r=a;break e;case"link":var o=W1("link","href",i).get(r+(n.href||""));if(o){for(var u=0;u<o.length;u++)if(a=o[u],a.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&a.getAttribute("rel")===(n.rel==null?null:n.rel)&&a.getAttribute("title")===(n.title==null?null:n.title)&&a.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(u,1);break t}}a=i.createElement(r),Yt(a,r,n),i.head.appendChild(a);break;case"meta":if(o=W1("meta","content",i).get(r+(n.content||""))){for(u=0;u<o.length;u++)if(a=o[u],a.getAttribute("content")===(n.content==null?null:""+n.content)&&a.getAttribute("name")===(n.name==null?null:n.name)&&a.getAttribute("property")===(n.property==null?null:n.property)&&a.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&a.getAttribute("charset")===(n.charSet==null?null:n.charSet)){o.splice(u,1);break t}}a=i.createElement(r),Yt(a,r,n),i.head.appendChild(a);break;default:throw Error(re(468,r))}a[Qt]=e,$t(a),r=a}e.stateNode=r}else J1(i,e.type,e.stateNode);else e.stateNode=K1(i,r,e.memoizedProps);else a!==r?(a===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):a.count--,r===null?J1(i,e.type,e.stateNode):K1(i,r,e.memoizedProps)):r===null&&e.stateNode!==null&&S0(e,e.memoizedProps,n.memoizedProps)}break;case 27:Cn(t,e),Tn(e),r&512&&(At||n===null||pr(n,n.return)),n!==null&&r&4&&S0(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Cn(t,e),Tn(e),r&512&&(At||n===null||pr(n,n.return)),e.flags&32){i=e.stateNode;try{Ta(i,"")}catch(h){Je(e,e.return,h)}}r&4&&e.stateNode!=null&&(i=e.memoizedProps,S0(e,i,n!==null?n.memoizedProps:i)),r&1024&&(E0=!0);break;case 6:if(Cn(t,e),Tn(e),r&4){if(e.stateNode===null)throw Error(re(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(h){Je(e,e.return,h)}}break;case 3:if(_s=null,i=nr,nr=Ts(t.containerInfo),Cn(t,e),nr=i,Tn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{ku(t.containerInfo)}catch(h){Je(e,e.return,h)}E0&&(E0=!1,a1(e));break;case 4:r=nr,nr=Ts(e.stateNode.containerInfo),Cn(t,e),Tn(e),nr=r;break;case 12:Cn(t,e),Tn(e);break;case 13:Cn(t,e),Tn(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(F0=dr()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,A0(e,r)));break;case 22:i=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,s=Lr,c=At;if(Lr=s||i,At=c||l,Cn(t,e),At=c,Lr=s,Tn(e),r&8192)e:for(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,i&&(n===null||l||Lr||At||Ji(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(a=l.stateNode,i)o=a.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none";else{u=l.stateNode;var f=l.memoizedProps.style,d=f!=null&&f.hasOwnProperty("display")?f.display:null;u.style.display=d==null||typeof d=="boolean"?"":(""+d).trim()}}catch(h){Je(l,l.return,h)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=i?"":l.memoizedProps}catch(h){Je(l,l.return,h)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,A0(e,n))));break;case 19:Cn(t,e),Tn(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,A0(e,r)));break;case 30:break;case 21:break;default:Cn(t,e),Tn(e)}}function Tn(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Kv(r)){n=r;break}r=r.return}if(n==null)throw Error(re(160));switch(n.tag){case 27:var i=n.stateNode,a=x0(e);ms(e,a,i);break;case 5:var o=n.stateNode;n.flags&32&&(Ta(o,""),n.flags&=-33);var u=x0(e);ms(e,u,o);break;case 3:case 4:var l=n.stateNode.containerInfo,s=x0(e);w0(e,s,l);break;default:throw Error(re(161))}}catch(c){Je(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function a1(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;a1(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function mi(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)e1(e,t.alternate,t),t=t.sibling}function Ji(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:hi(4,t,t.return),Ji(t);break;case 1:pr(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&Zv(t,t.return,n),Ji(t);break;case 27:Fu(t.stateNode);case 26:case 5:pr(t,t.return),Ji(t);break;case 22:t.memoizedState===null&&Ji(t);break;case 30:Ji(t);break;default:Ji(t)}e=e.sibling}}function pi(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:pi(i,a,n),Su(4,a);break;case 1:if(pi(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount=="function")try{i.componentDidMount()}catch(s){Je(r,r.return,s)}if(r=a,i=r.updateQueue,i!==null){var u=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)Og(l[i],u)}catch(s){Je(r,r.return,s)}}n&&o&64&&Xv(a),xu(a,a.return);break;case 27:Wv(a);case 26:case 5:pi(i,a,n),n&&r===null&&o&4&&Qv(a),xu(a,a.return);break;case 12:pi(i,a,n);break;case 13:pi(i,a,n),n&&o&4&&r1(i,a);break;case 22:a.memoizedState===null&&pi(i,a,n),xu(a,a.return);break;case 30:break;default:pi(i,a,n)}t=t.sibling}}function C0(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&uu(n))}function T0(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&uu(e))}function gr(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)o1(e,t,n,r),t=t.sibling}function o1(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:gr(e,t,n,r),i&2048&&Su(9,t);break;case 1:gr(e,t,n,r);break;case 3:gr(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&uu(e)));break;case 12:if(i&2048){gr(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,u=a.onPostCommit;typeof u=="function"&&u(o,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(l){Je(t,t.return,l)}}else gr(e,t,n,r);break;case 13:gr(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState!==null?a._visibility&2?gr(e,t,n,r):wu(e,t):a._visibility&2?gr(e,t,n,r):(a._visibility|=2,Ga(e,t,n,r,(t.subtreeFlags&10256)!==0)),i&2048&&C0(o,t);break;case 24:gr(e,t,n,r),i&2048&&T0(t.alternate,t);break;default:gr(e,t,n,r)}}function Ga(e,t,n,r,i){for(i=i&&(t.subtreeFlags&10256)!==0,t=t.child;t!==null;){var a=e,o=t,u=n,l=r,s=o.flags;switch(o.tag){case 0:case 11:case 15:Ga(a,o,u,l,i),Su(8,o);break;case 23:break;case 22:var c=o.stateNode;o.memoizedState!==null?c._visibility&2?Ga(a,o,u,l,i):wu(a,o):(c._visibility|=2,Ga(a,o,u,l,i)),i&&s&2048&&C0(o.alternate,o);break;case 24:Ga(a,o,u,l,i),i&&s&2048&&T0(o.alternate,o);break;default:Ga(a,o,u,l,i)}t=t.sibling}}function wu(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:wu(n,r),i&2048&&C0(r.alternate,r);break;case 24:wu(n,r),i&2048&&T0(r.alternate,r);break;default:wu(n,r)}t=t.sibling}}var Eu=8192;function Ya(e){if(e.subtreeFlags&Eu)for(e=e.child;e!==null;)u1(e),e=e.sibling}function u1(e){switch(e.tag){case 26:Ya(e),e.flags&Eu&&e.memoizedState!==null&&PE(nr,e.memoizedState,e.memoizedProps);break;case 5:Ya(e);break;case 3:case 4:var t=nr;nr=Ts(e.stateNode.containerInfo),Ya(e),nr=t;break;case 22:e.memoizedState===null&&(t=e.alternate,t!==null&&t.memoizedState!==null?(t=Eu,Eu=16777216,Ya(e),Eu=t):Ya(e));break;default:Ya(e)}}function l1(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Au(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Lt=r,c1(r,e)}l1(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)s1(e),e=e.sibling}function s1(e){switch(e.tag){case 0:case 11:case 15:Au(e),e.flags&2048&&hi(9,e,e.return);break;case 3:Au(e);break;case 12:Au(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,ps(e)):Au(e);break;default:Au(e)}}function ps(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Lt=r,c1(r,e)}l1(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:hi(8,t,t.return),ps(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,ps(t));break;default:ps(t)}e=e.sibling}}function c1(e,t){for(;Lt!==null;){var n=Lt;switch(n.tag){case 0:case 11:case 15:hi(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:uu(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,Lt=r;else e:for(n=e;Lt!==null;){r=Lt;var i=r.sibling,a=r.return;if(t1(r),r===n){Lt=null;break e}if(i!==null){i.return=a,Lt=i;break e}Lt=a}}}var aE={getCacheForType:function(e){var t=Kt(Ot),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n}},oE=typeof WeakMap=="function"?WeakMap:Map,qe=0,rt=null,Be=null,Oe=0,Ve=0,Mn=null,gi=!1,Xa=!1,M0=!1,Hr=0,Dt=0,vi=0,ea=0,_0=0,Gn=0,Za=0,Cu=null,dn=null,B0=!1,F0=0,gs=1/0,vs=null,yi=null,Gt=0,bi=null,Qa=null,Ka=0,N0=0,R0=null,f1=null,Tu=0,O0=null;function _n(){if(qe&2&&Oe!==0)return Oe&-Oe;if(we.T!==null){var e=$a;return e!==0?e:j0()}return Tp()}function d1(){Gn===0&&(Gn=!(Oe&536870912)||ke?wp():536870912);var e=Vn.current;return e!==null&&(e.flags|=32),Gn}function Bn(e,t,n){(e===rt&&(Ve===2||Ve===9)||e.cancelPendingCommit!==null)&&(Wa(e,0),Di(e,Oe,Gn,!1)),Vo(e,n),(!(qe&2)||e!==rt)&&(e===rt&&(!(qe&2)&&(ea|=n),Dt===4&&Di(e,Oe,Gn,!1)),vr(e))}function h1(e,t,n){if(qe&6)throw Error(re(327));var r=!n&&(t&124)===0&&(t&e.expiredLanes)===0||qo(e,t),i=r?sE(e,t):I0(e,t,!0),a=r;do{if(i===0){Xa&&!r&&Di(e,t,0,!1);break}else{if(n=e.current.alternate,a&&!uE(n)){i=I0(e,t,!1),a=!1;continue}if(i===2){if(a=t,e.errorRecoveryDisabledLanes&a)var o=0;else o=e.pendingLanes&-536870913,o=o!==0?o:o&536870912?536870912:0;if(o!==0){t=o;e:{var u=e;i=Cu;var l=u.current.memoizedState.isDehydrated;if(l&&(Wa(u,o).flags|=256),o=I0(u,o,!1),o!==2){if(M0&&!l){u.errorRecoveryDisabledLanes|=a,ea|=a,i=4;break e}a=dn,dn=i,a!==null&&(dn===null?dn=a:dn.push.apply(dn,a))}i=o}if(a=!1,i!==2)continue}}if(i===1){Wa(e,0),Di(e,t,0,!0);break}e:{switch(r=e,a=i,a){case 0:case 1:throw Error(re(345));case 4:if((t&4194048)!==t)break;case 6:Di(r,t,Gn,!gi);break e;case 2:dn=null;break;case 3:case 5:break;default:throw Error(re(329))}if((t&62914560)===t&&(i=F0+300-dr(),10<i)){if(Di(r,t,Gn,!gi),Ml(r,0,!0)!==0)break e;r.timeoutHandle=H1(m1.bind(null,r,n,dn,vs,B0,t,Gn,ea,Za,gi,a,2,-0,0),i);break e}m1(r,n,dn,vs,B0,t,Gn,ea,Za,gi,a,0,-0,0)}}break}while(!0);vr(e)}function m1(e,t,n,r,i,a,o,u,l,s,c,f,d,h){if(e.timeoutHandle=-1,f=t.subtreeFlags,(f&8192||(f&16785408)===16785408)&&(Ou={stylesheets:null,count:0,unsuspend:HE},u1(t),f=qE(),f!==null)){e.cancelPendingCommit=f(S1.bind(null,e,t,a,n,r,i,o,u,l,c,1,d,h)),Di(e,a,o,!s);return}S1(e,t,a,n,r,i,o,u,l)}function uE(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!En(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Di(e,t,n,r){t&=~_0,t&=~ea,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-wn(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&Ap(e,n,t)}function ys(){return qe&6?!0:(Mu(0),!1)}function z0(){if(Be!==null){if(Ve===0)var e=Be.return;else e=Be,Or=Xi=null,Wd(e),qa=null,yu=0,e=Be;for(;e!==null;)Yv(e.alternate,e),e=e.return;Be=null}}function Wa(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,AE(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),z0(),rt=e,Be=n=Fr(e.current,null),Oe=t,Ve=0,Mn=null,gi=!1,Xa=qo(e,t),M0=!1,Za=Gn=_0=ea=vi=Dt=0,dn=Cu=null,B0=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-wn(r),a=1<<i;t|=e[i],r&=~a}return Hr=t,Ll(),n}function p1(e,t){_e=null,we.H=as,t===su||t===Zl?(t=Ng(),Ve=3):t===_g?(t=Ng(),Ve=4):Ve=t===Rv?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Mn=t,Be===null&&(Dt=1,cs(e,jn(t,e.current)))}function g1(){var e=we.H;return we.H=as,e===null?as:e}function v1(){var e=we.A;return we.A=aE,e}function U0(){Dt=4,gi||(Oe&4194048)!==Oe&&Vn.current!==null||(Xa=!0),!(vi&134217727)&&!(ea&134217727)||rt===null||Di(rt,Oe,Gn,!1)}function I0(e,t,n){var r=qe;qe|=2;var i=g1(),a=v1();(rt!==e||Oe!==t)&&(vs=null,Wa(e,t)),t=!1;var o=Dt;e:do try{if(Ve!==0&&Be!==null){var u=Be,l=Mn;switch(Ve){case 8:z0(),o=6;break e;case 3:case 2:case 9:case 6:Vn.current===null&&(t=!0);var s=Ve;if(Ve=0,Mn=null,Ja(e,u,l,s),n&&Xa){o=0;break e}break;default:s=Ve,Ve=0,Mn=null,Ja(e,u,l,s)}}lE(),o=Dt;break}catch(c){p1(e,c)}while(!0);return t&&e.shellSuspendCounter++,Or=Xi=null,qe=r,we.H=i,we.A=a,Be===null&&(rt=null,Oe=0,Ll()),o}function lE(){for(;Be!==null;)y1(Be)}function sE(e,t){var n=qe;qe|=2;var r=g1(),i=v1();rt!==e||Oe!==t?(vs=null,gs=dr()+500,Wa(e,t)):Xa=qo(e,t);e:do try{if(Ve!==0&&Be!==null){t=Be;var a=Mn;t:switch(Ve){case 1:Ve=0,Mn=null,Ja(e,t,a,1);break;case 2:case 9:if(Bg(a)){Ve=0,Mn=null,b1(t);break}t=function(){Ve!==2&&Ve!==9||rt!==e||(Ve=7),vr(e)},a.then(t,t);break e;case 3:Ve=7;break e;case 4:Ve=5;break e;case 7:Bg(a)?(Ve=0,Mn=null,b1(t)):(Ve=0,Mn=null,Ja(e,t,a,7));break;case 5:var o=null;switch(Be.tag){case 26:o=Be.memoizedState;case 5:case 27:var u=Be;if(!o||ey(o)){Ve=0,Mn=null;var l=u.sibling;if(l!==null)Be=l;else{var s=u.return;s!==null?(Be=s,bs(s)):Be=null}break t}}Ve=0,Mn=null,Ja(e,t,a,5);break;case 6:Ve=0,Mn=null,Ja(e,t,a,6);break;case 8:z0(),Dt=6;break e;default:throw Error(re(462))}}cE();break}catch(c){p1(e,c)}while(!0);return Or=Xi=null,we.H=r,we.A=i,qe=n,Be!==null?0:(rt=null,Oe=0,Ll(),Dt)}function cE(){for(;Be!==null&&!Nx();)y1(Be)}function y1(e){var t=Vv(e.alternate,e,Hr);e.memoizedProps=e.pendingProps,t===null?bs(e):Be=t}function b1(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=kv(n,t,t.pendingProps,t.type,void 0,Oe);break;case 11:t=kv(n,t,t.pendingProps,t.type.render,t.ref,Oe);break;case 5:Wd(t);default:Yv(n,t),t=Be=Dg(t,Hr),t=Vv(n,t,Hr)}e.memoizedProps=e.pendingProps,t===null?bs(e):Be=t}function Ja(e,t,n,r){Or=Xi=null,Wd(t),qa=null,yu=0;var i=t.return;try{if(Jw(e,i,t,n,Oe)){Dt=1,cs(e,jn(n,e.current)),Be=null;return}}catch(a){if(i!==null)throw Be=i,a;Dt=1,cs(e,jn(n,e.current)),Be=null;return}t.flags&32768?(ke||r===1?e=!0:Xa||Oe&536870912?e=!1:(gi=e=!0,(r===2||r===9||r===3||r===6)&&(r=Vn.current,r!==null&&r.tag===13&&(r.flags|=16384))),D1(t,e)):bs(t)}function bs(e){var t=e;do{if(t.flags&32768){D1(t,gi);return}e=t.return;var n=tE(t.alternate,t,Hr);if(n!==null){Be=n;return}if(t=t.sibling,t!==null){Be=t;return}Be=t=e}while(t!==null);Dt===0&&(Dt=5)}function D1(e,t){do{var n=nE(e.alternate,e);if(n!==null){n.flags&=32767,Be=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Be=e;return}Be=e=n}while(e!==null);Dt=6,Be=null}function S1(e,t,n,r,i,a,o,u,l){e.cancelPendingCommit=null;do Ds();while(Gt!==0);if(qe&6)throw Error(re(327));if(t!==null){if(t===e.current)throw Error(re(177));if(a=t.lanes|t.childLanes,a|=Td,Hx(e,n,a,o,u,l),e===rt&&(Be=rt=null,Oe=0),Qa=t,bi=e,Ka=n,N0=a,R0=i,f1=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,mE(Al,function(){return C1(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,t.subtreeFlags&13878||r){r=we.T,we.T=null,i=$e.p,$e.p=2,o=qe,qe|=4;try{rE(e,t,n)}finally{qe=o,$e.p=i,we.T=r}}Gt=1,x1(),w1(),E1()}}function x1(){if(Gt===1){Gt=0;var e=bi,t=Qa,n=(t.flags&13878)!==0;if(t.subtreeFlags&13878||n){n=we.T,we.T=null;var r=$e.p;$e.p=2;var i=qe;qe|=4;try{i1(t,e);var a=Z0,o=cg(e.containerInfo),u=a.focusedElem,l=a.selectionRange;if(o!==u&&u&&u.ownerDocument&&sg(u.ownerDocument.documentElement,u)){if(l!==null&&xd(u)){var s=l.start,c=l.end;if(c===void 0&&(c=s),"selectionStart"in u)u.selectionStart=s,u.selectionEnd=Math.min(c,u.value.length);else{var f=u.ownerDocument||document,d=f&&f.defaultView||window;if(d.getSelection){var h=d.getSelection(),v=u.textContent.length,m=Math.min(l.start,v),D=l.end===void 0?m:Math.min(l.end,v);!h.extend&&m>D&&(o=D,D=m,m=o);var p=lg(u,m),g=lg(u,D);if(p&&g&&(h.rangeCount!==1||h.anchorNode!==p.node||h.anchorOffset!==p.offset||h.focusNode!==g.node||h.focusOffset!==g.offset)){var y=f.createRange();y.setStart(p.node,p.offset),h.removeAllRanges(),m>D?(h.addRange(y),h.extend(g.node,g.offset)):(y.setEnd(g.node,g.offset),h.addRange(y))}}}}for(f=[],h=u;h=h.parentNode;)h.nodeType===1&&f.push({element:h,left:h.scrollLeft,top:h.scrollTop});for(typeof u.focus=="function"&&u.focus(),u=0;u<f.length;u++){var S=f[u];S.element.scrollLeft=S.left,S.element.scrollTop=S.top}}Ns=!!X0,Z0=X0=null}finally{qe=i,$e.p=r,we.T=n}}e.current=t,Gt=2}}function w1(){if(Gt===2){Gt=0;var e=bi,t=Qa,n=(t.flags&8772)!==0;if(t.subtreeFlags&8772||n){n=we.T,we.T=null;var r=$e.p;$e.p=2;var i=qe;qe|=4;try{e1(e,t.alternate,t)}finally{qe=i,$e.p=r,we.T=n}}Gt=3}}function E1(){if(Gt===4||Gt===3){Gt=0,Rx();var e=bi,t=Qa,n=Ka,r=f1;t.subtreeFlags&10256||t.flags&10256?Gt=5:(Gt=0,Qa=bi=null,A1(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(yi=null),td(n),t=t.stateNode,xn&&typeof xn.onCommitFiberRoot=="function")try{xn.onCommitFiberRoot(Po,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=we.T,i=$e.p,$e.p=2,we.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var u=r[o];a(u.value,{componentStack:u.stack})}}finally{we.T=t,$e.p=i}}Ka&3&&Ds(),vr(e),i=e.pendingLanes,n&4194090&&i&42?e===O0?Tu++:(Tu=0,O0=e):Tu=0,Mu(0)}}function A1(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,uu(t)))}function Ds(e){return x1(),w1(),E1(),C1()}function C1(){if(Gt!==5)return!1;var e=bi,t=N0;N0=0;var n=td(Ka),r=we.T,i=$e.p;try{$e.p=32>n?32:n,we.T=null,n=R0,R0=null;var a=bi,o=Ka;if(Gt=0,Qa=bi=null,Ka=0,qe&6)throw Error(re(331));var u=qe;if(qe|=4,s1(a.current),o1(a,a.current,o,n),qe=u,Mu(0,!1),xn&&typeof xn.onPostCommitFiberRoot=="function")try{xn.onPostCommitFiberRoot(Po,a)}catch{}return!0}finally{$e.p=i,we.T=r,A1(e,t)}}function T1(e,t,n){t=jn(n,t),t=d0(e.stateNode,t,2),e=si(e,t,2),e!==null&&(Vo(e,2),vr(e))}function Je(e,t,n){if(e.tag===3)T1(e,e,n);else for(;t!==null;){if(t.tag===3){T1(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(yi===null||!yi.has(r))){e=jn(n,e),n=Fv(2),r=si(t,n,2),r!==null&&(Nv(n,r,t,e),Vo(r,2),vr(r));break}}t=t.return}}function $0(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new oE;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(M0=!0,i.add(n),e=fE.bind(null,e,t,n),t.then(e,e))}function fE(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,rt===e&&(Oe&n)===n&&(Dt===4||Dt===3&&(Oe&62914560)===Oe&&300>dr()-F0?!(qe&2)&&Wa(e,0):_0|=n,Za===Oe&&(Za=0)),vr(e)}function M1(e,t){t===0&&(t=Ep()),e=Oa(e,t),e!==null&&(Vo(e,t),vr(e))}function dE(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),M1(e,n)}function hE(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(re(314))}r!==null&&r.delete(t),M1(e,n)}function mE(e,t){return Kf(e,t)}var Ss=null,eo=null,k0=!1,xs=!1,L0=!1,ta=0;function vr(e){e!==eo&&e.next===null&&(eo===null?Ss=eo=e:eo=eo.next=e),xs=!0,k0||(k0=!0,gE())}function Mu(e,t){if(!L0&&xs){L0=!0;do for(var n=!1,r=Ss;r!==null;){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,u=r.pingedLanes;a=(1<<31-wn(42|e)+1)-1,a&=i&~(o&~u),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,N1(r,a))}else a=Oe,a=Ml(r,r===rt?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||qo(r,a)||(n=!0,N1(r,a));r=r.next}while(n);L0=!1}}function pE(){_1()}function _1(){xs=k0=!1;var e=0;ta!==0&&(EE()&&(e=ta),ta=0);for(var t=dr(),n=null,r=Ss;r!==null;){var i=r.next,a=B1(r,t);a===0?(r.next=null,n===null?Ss=i:n.next=i,i===null&&(eo=n)):(n=r,(e!==0||a&3)&&(xs=!0)),r=i}Mu(e)}function B1(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-wn(a),u=1<<o,l=i[o];l===-1?(!(u&n)||u&r)&&(i[o]=jx(u,t)):l<=t&&(e.expiredLanes|=u),a&=~u}if(t=rt,n=Oe,n=Ml(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Ve===2||Ve===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Wf(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||qo(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Wf(r),td(n)){case 2:case 8:n=Sp;break;case 32:n=Al;break;case 268435456:n=xp;break;default:n=Al}return r=F1.bind(null,e),n=Kf(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Wf(r),e.callbackPriority=2,e.callbackNode=null,2}function F1(e,t){if(Gt!==0&&Gt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Ds()&&e.callbackNode!==n)return null;var r=Oe;return r=Ml(e,e===rt?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(h1(e,r,t),B1(e,dr()),e.callbackNode!=null&&e.callbackNode===n?F1.bind(null,e):null)}function N1(e,t){if(Ds())return null;h1(e,t,!0)}function gE(){CE(function(){qe&6?Kf(Dp,pE):_1()})}function j0(){return ta===0&&(ta=wp()),ta}function R1(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Rl(""+e)}function O1(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function vE(e,t,n,r,i){if(t==="submit"&&n&&n.stateNode===i){var a=R1((i[ln]||null).action),o=r.submitter;o&&(t=(t=o[ln]||null)?R1(t.formAction):o.getAttribute("formAction"),t!==null&&(a=t,o=null));var u=new Il("action","action",null,r,i);e.push({event:u,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(ta!==0){var l=o?O1(i,o):new FormData(i);u0(n,{pending:!0,data:l,method:i.method,action:a},null,l)}}else typeof a=="function"&&(u.preventDefault(),l=o?O1(i,o):new FormData(i),u0(n,{pending:!0,data:l,method:i.method,action:a},a,l))},currentTarget:i}]})}}for(var H0=0;H0<Cd.length;H0++){var P0=Cd[H0],yE=P0.toLowerCase(),bE=P0[0].toUpperCase()+P0.slice(1);tr(yE,"on"+bE)}tr(hg,"onAnimationEnd"),tr(mg,"onAnimationIteration"),tr(pg,"onAnimationStart"),tr("dblclick","onDoubleClick"),tr("focusin","onFocus"),tr("focusout","onBlur"),tr(Uw,"onTransitionRun"),tr(Iw,"onTransitionStart"),tr($w,"onTransitionCancel"),tr(gg,"onTransitionEnd"),Ea("onMouseEnter",["mouseout","mouseover"]),Ea("onMouseLeave",["mouseout","mouseover"]),Ea("onPointerEnter",["pointerout","pointerover"]),Ea("onPointerLeave",["pointerout","pointerover"]),ki("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ki("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ki("onBeforeInput",["compositionend","keypress","textInput","paste"]),ki("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ki("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ki("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var _u="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),DE=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(_u));function z1(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var u=r[o],l=u.instance,s=u.currentTarget;if(u=u.listener,l!==a&&i.isPropagationStopped())break e;a=u,i.currentTarget=s;try{a(i)}catch(c){ss(c)}i.currentTarget=null,a=l}else for(o=0;o<r.length;o++){if(u=r[o],l=u.instance,s=u.currentTarget,u=u.listener,l!==a&&i.isPropagationStopped())break e;a=u,i.currentTarget=s;try{a(i)}catch(c){ss(c)}i.currentTarget=null,a=l}}}}function Fe(e,t){var n=t[nd];n===void 0&&(n=t[nd]=new Set);var r=e+"__bubble";n.has(r)||(U1(t,e,2,!1),n.add(r))}function q0(e,t,n){var r=0;t&&(r|=4),U1(n,e,r,t)}var ws="_reactListening"+Math.random().toString(36).slice(2);function V0(e){if(!e[ws]){e[ws]=!0,_p.forEach(function(n){n!=="selectionchange"&&(DE.has(n)||q0(n,!1,e),q0(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ws]||(t[ws]=!0,q0("selectionchange",!1,t))}}function U1(e,t,n,r){switch(oy(t)){case 2:var i=YE;break;case 8:i=XE;break;default:i=ah}n=i.bind(null,t,n,e),i=void 0,!hd||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function G0(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var u=r.stateNode.containerInfo;if(u===i)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&o.stateNode.containerInfo===i)return;o=o.return}for(;u!==null;){if(o=Sa(u),o===null)return;if(l=o.tag,l===5||l===6||l===26||l===27){r=a=o;continue e}u=u.parentNode}}r=r.return}Pp(function(){var s=a,c=fd(n),f=[];e:{var d=vg.get(e);if(d!==void 0){var h=Il,v=e;switch(e){case"keypress":if(zl(n)===0)break e;case"keydown":case"keyup":h=mw;break;case"focusin":v="focus",h=vd;break;case"focusout":v="blur",h=vd;break;case"beforeblur":case"afterblur":h=vd;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":h=Gp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=nw;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=vw;break;case hg:case mg:case pg:h=aw;break;case gg:h=bw;break;case"scroll":case"scrollend":h=ew;break;case"wheel":h=Sw;break;case"copy":case"cut":case"paste":h=uw;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=Xp;break;case"toggle":case"beforetoggle":h=ww}var m=(t&4)!==0,D=!m&&(e==="scroll"||e==="scrollend"),p=m?d!==null?d+"Capture":null:d;m=[];for(var g=s,y;g!==null;){var S=g;if(y=S.stateNode,S=S.tag,S!==5&&S!==26&&S!==27||y===null||p===null||(S=Xo(g,p),S!=null&&m.push(Bu(g,S,y))),D)break;g=g.return}0<m.length&&(d=new h(d,v,null,n,c),f.push({event:d,listeners:m}))}}if(!(t&7)){e:{if(d=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",d&&n!==cd&&(v=n.relatedTarget||n.fromElement)&&(Sa(v)||v[Da]))break e;if((h||d)&&(d=c.window===c?c:(d=c.ownerDocument)?d.defaultView||d.parentWindow:window,h?(v=n.relatedTarget||n.toElement,h=s,v=v?Sa(v):null,v!==null&&(D=$o(v),m=v.tag,v!==D||m!==5&&m!==27&&m!==6)&&(v=null)):(h=null,v=s),h!==v)){if(m=Gp,S="onMouseLeave",p="onMouseEnter",g="mouse",(e==="pointerout"||e==="pointerover")&&(m=Xp,S="onPointerLeave",p="onPointerEnter",g="pointer"),D=h==null?d:Yo(h),y=v==null?d:Yo(v),d=new m(S,g+"leave",h,n,c),d.target=D,d.relatedTarget=y,S=null,Sa(c)===s&&(m=new m(p,g+"enter",v,n,c),m.target=y,m.relatedTarget=D,S=m),D=S,h&&v)t:{for(m=h,p=v,g=0,y=m;y;y=to(y))g++;for(y=0,S=p;S;S=to(S))y++;for(;0<g-y;)m=to(m),g--;for(;0<y-g;)p=to(p),y--;for(;g--;){if(m===p||p!==null&&m===p.alternate)break t;m=to(m),p=to(p)}m=null}else m=null;h!==null&&I1(f,d,h,m,!1),v!==null&&D!==null&&I1(f,D,v,m,!0)}}e:{if(d=s?Yo(s):window,h=d.nodeName&&d.nodeName.toLowerCase(),h==="select"||h==="input"&&d.type==="file")var w=ng;else if(eg(d))if(rg)w=Rw;else{w=Fw;var b=Bw}else h=d.nodeName,!h||h.toLowerCase()!=="input"||d.type!=="checkbox"&&d.type!=="radio"?s&&sd(s.elementType)&&(w=ng):w=Nw;if(w&&(w=w(e,s))){tg(f,w,n,c);break e}b&&b(e,d,s),e==="focusout"&&s&&d.type==="number"&&s.memoizedProps.value!=null&&ld(d,"number",d.value)}switch(b=s?Yo(s):window,e){case"focusin":(eg(b)||b.contentEditable==="true")&&(Fa=b,wd=s,nu=null);break;case"focusout":nu=wd=Fa=null;break;case"mousedown":Ed=!0;break;case"contextmenu":case"mouseup":case"dragend":Ed=!1,fg(f,n,c);break;case"selectionchange":if(zw)break;case"keydown":case"keyup":fg(f,n,c)}var E;if(bd)e:{switch(e){case"compositionstart":var C="onCompositionStart";break e;case"compositionend":C="onCompositionEnd";break e;case"compositionupdate":C="onCompositionUpdate";break e}C=void 0}else Ba?Wp(e,n)&&(C="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(C="onCompositionStart");C&&(Zp&&n.locale!=="ko"&&(Ba||C!=="onCompositionStart"?C==="onCompositionEnd"&&Ba&&(E=qp()):(ai=c,md="value"in ai?ai.value:ai.textContent,Ba=!0)),b=Es(s,C),0<b.length&&(C=new Yp(C,e,null,n,c),f.push({event:C,listeners:b}),E?C.data=E:(E=Jp(n),E!==null&&(C.data=E)))),(E=Aw?Cw(e,n):Tw(e,n))&&(C=Es(s,"onBeforeInput"),0<C.length&&(b=new Yp("onBeforeInput","beforeinput",null,n,c),f.push({event:b,listeners:C}),b.data=E)),vE(f,e,s,n,c)}z1(f,t)})}function Bu(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Es(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=Xo(e,n),i!=null&&r.unshift(Bu(e,i,a)),i=Xo(e,t),i!=null&&r.push(Bu(e,i,a))),e.tag===3)return r;e=e.return}return[]}function to(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function I1(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var u=n,l=u.alternate,s=u.stateNode;if(u=u.tag,l!==null&&l===r)break;u!==5&&u!==26&&u!==27||s===null||(l=s,i?(s=Xo(n,a),s!=null&&o.unshift(Bu(n,s,l))):i||(s=Xo(n,a),s!=null&&o.push(Bu(n,s,l)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var SE=/\r\n?/g,xE=/\u0000|\uFFFD/g;function $1(e){return(typeof e=="string"?e:""+e).replace(SE,`
50
+ `).replace(xE,"")}function k1(e,t){return t=$1(t),$1(e)===t}function As(){}function Ke(e,t,n,r,i,a){switch(n){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||Ta(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&Ta(e,""+r);break;case"className":Bl(e,"class",r);break;case"tabIndex":Bl(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":Bl(e,n,r);break;case"style":jp(e,r,a);break;case"data":if(t!=="object"){Bl(e,"data",r);break}case"src":case"href":if(r===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(n);break}r=Rl(""+r),e.setAttribute(n,r);break;case"action":case"formAction":if(typeof r=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof a=="function"&&(n==="formAction"?(t!=="input"&&Ke(e,t,"name",i.name,i,null),Ke(e,t,"formEncType",i.formEncType,i,null),Ke(e,t,"formMethod",i.formMethod,i,null),Ke(e,t,"formTarget",i.formTarget,i,null)):(Ke(e,t,"encType",i.encType,i,null),Ke(e,t,"method",i.method,i,null),Ke(e,t,"target",i.target,i,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(n);break}r=Rl(""+r),e.setAttribute(n,r);break;case"onClick":r!=null&&(e.onclick=As);break;case"onScroll":r!=null&&Fe("scroll",e);break;case"onScrollEnd":r!=null&&Fe("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(re(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(re(60));e.innerHTML=n}}break;case"multiple":e.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":e.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){e.removeAttribute("xlink:href");break}n=Rl(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,""+r):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":r&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":r===!0?e.setAttribute(n,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,r):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case"popover":Fe("beforetoggle",e),Fe("toggle",e),_l(e,"popover",r);break;case"xlinkActuate":_r(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":_r(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":_r(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":_r(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":_r(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":_r(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":_r(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":_r(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":_r(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":_l(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=Wx.get(n)||n,_l(e,n,r))}}function Y0(e,t,n,r,i,a){switch(n){case"style":jp(e,r,a);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(re(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(re(60));e.innerHTML=n}}break;case"children":typeof r=="string"?Ta(e,r):(typeof r=="number"||typeof r=="bigint")&&Ta(e,""+r);break;case"onScroll":r!=null&&Fe("scroll",e);break;case"onScrollEnd":r!=null&&Fe("scrollend",e);break;case"onClick":r!=null&&(e.onclick=As);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Bp.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(i=n.endsWith("Capture"),t=n.slice(2,i?n.length-7:void 0),a=e[ln]||null,a=a!=null?a[n]:null,typeof a=="function"&&e.removeEventListener(t,a,i),typeof r=="function")){typeof a!="function"&&a!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,i);break e}n in e?e[n]=r:r===!0?e.setAttribute(n,""):_l(e,n,r)}}}function Yt(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Fe("error",e),Fe("load",e);var r=!1,i=!1,a;for(a in n)if(n.hasOwnProperty(a)){var o=n[a];if(o!=null)switch(a){case"src":r=!0;break;case"srcSet":i=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(re(137,t));default:Ke(e,t,a,o,n,null)}}i&&Ke(e,t,"srcSet",n.srcSet,n,null),r&&Ke(e,t,"src",n.src,n,null);return;case"input":Fe("invalid",e);var u=a=o=i=null,l=null,s=null;for(r in n)if(n.hasOwnProperty(r)){var c=n[r];if(c!=null)switch(r){case"name":i=c;break;case"type":o=c;break;case"checked":l=c;break;case"defaultChecked":s=c;break;case"value":a=c;break;case"defaultValue":u=c;break;case"children":case"dangerouslySetInnerHTML":if(c!=null)throw Error(re(137,t));break;default:Ke(e,t,r,c,n,null)}}Ip(e,a,u,l,s,o,i,!1),Fl(e);return;case"select":Fe("invalid",e),r=o=a=null;for(i in n)if(n.hasOwnProperty(i)&&(u=n[i],u!=null))switch(i){case"value":a=u;break;case"defaultValue":o=u;break;case"multiple":r=u;default:Ke(e,t,i,u,n,null)}t=a,n=o,e.multiple=!!r,t!=null?Ca(e,!!r,t,!1):n!=null&&Ca(e,!!r,n,!0);return;case"textarea":Fe("invalid",e),a=i=r=null;for(o in n)if(n.hasOwnProperty(o)&&(u=n[o],u!=null))switch(o){case"value":r=u;break;case"defaultValue":i=u;break;case"children":a=u;break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(re(91));break;default:Ke(e,t,o,u,n,null)}kp(e,r,i,a),Fl(e);return;case"option":for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case"selected":e.selected=r&&typeof r!="function"&&typeof r!="symbol";break;default:Ke(e,t,l,r,n,null)}return;case"dialog":Fe("beforetoggle",e),Fe("toggle",e),Fe("cancel",e),Fe("close",e);break;case"iframe":case"object":Fe("load",e);break;case"video":case"audio":for(r=0;r<_u.length;r++)Fe(_u[r],e);break;case"image":Fe("error",e),Fe("load",e);break;case"details":Fe("toggle",e);break;case"embed":case"source":case"link":Fe("error",e),Fe("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(s in n)if(n.hasOwnProperty(s)&&(r=n[s],r!=null))switch(s){case"children":case"dangerouslySetInnerHTML":throw Error(re(137,t));default:Ke(e,t,s,r,n,null)}return;default:if(sd(t)){for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!==void 0&&Y0(e,t,c,r,n,void 0));return}}for(u in n)n.hasOwnProperty(u)&&(r=n[u],r!=null&&Ke(e,t,u,r,n,null))}function wE(e,t,n,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var i=null,a=null,o=null,u=null,l=null,s=null,c=null;for(h in n){var f=n[h];if(n.hasOwnProperty(h)&&f!=null)switch(h){case"checked":break;case"value":break;case"defaultValue":l=f;default:r.hasOwnProperty(h)||Ke(e,t,h,null,r,f)}}for(var d in r){var h=r[d];if(f=n[d],r.hasOwnProperty(d)&&(h!=null||f!=null))switch(d){case"type":a=h;break;case"name":i=h;break;case"checked":s=h;break;case"defaultChecked":c=h;break;case"value":o=h;break;case"defaultValue":u=h;break;case"children":case"dangerouslySetInnerHTML":if(h!=null)throw Error(re(137,t));break;default:h!==f&&Ke(e,t,d,h,r,f)}}ud(e,o,u,l,s,c,a,i);return;case"select":h=o=u=d=null;for(a in n)if(l=n[a],n.hasOwnProperty(a)&&l!=null)switch(a){case"value":break;case"multiple":h=l;default:r.hasOwnProperty(a)||Ke(e,t,a,null,r,l)}for(i in r)if(a=r[i],l=n[i],r.hasOwnProperty(i)&&(a!=null||l!=null))switch(i){case"value":d=a;break;case"defaultValue":u=a;break;case"multiple":o=a;default:a!==l&&Ke(e,t,i,a,r,l)}t=u,n=o,r=h,d!=null?Ca(e,!!n,d,!1):!!r!=!!n&&(t!=null?Ca(e,!!n,t,!0):Ca(e,!!n,n?[]:"",!1));return;case"textarea":h=d=null;for(u in n)if(i=n[u],n.hasOwnProperty(u)&&i!=null&&!r.hasOwnProperty(u))switch(u){case"value":break;case"children":break;default:Ke(e,t,u,null,r,i)}for(o in r)if(i=r[o],a=n[o],r.hasOwnProperty(o)&&(i!=null||a!=null))switch(o){case"value":d=i;break;case"defaultValue":h=i;break;case"children":break;case"dangerouslySetInnerHTML":if(i!=null)throw Error(re(91));break;default:i!==a&&Ke(e,t,o,i,r,a)}$p(e,d,h);return;case"option":for(var v in n)if(d=n[v],n.hasOwnProperty(v)&&d!=null&&!r.hasOwnProperty(v))switch(v){case"selected":e.selected=!1;break;default:Ke(e,t,v,null,r,d)}for(l in r)if(d=r[l],h=n[l],r.hasOwnProperty(l)&&d!==h&&(d!=null||h!=null))switch(l){case"selected":e.selected=d&&typeof d!="function"&&typeof d!="symbol";break;default:Ke(e,t,l,d,r,h)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var m in n)d=n[m],n.hasOwnProperty(m)&&d!=null&&!r.hasOwnProperty(m)&&Ke(e,t,m,null,r,d);for(s in r)if(d=r[s],h=n[s],r.hasOwnProperty(s)&&d!==h&&(d!=null||h!=null))switch(s){case"children":case"dangerouslySetInnerHTML":if(d!=null)throw Error(re(137,t));break;default:Ke(e,t,s,d,r,h)}return;default:if(sd(t)){for(var D in n)d=n[D],n.hasOwnProperty(D)&&d!==void 0&&!r.hasOwnProperty(D)&&Y0(e,t,D,void 0,r,d);for(c in r)d=r[c],h=n[c],!r.hasOwnProperty(c)||d===h||d===void 0&&h===void 0||Y0(e,t,c,d,r,h);return}}for(var p in n)d=n[p],n.hasOwnProperty(p)&&d!=null&&!r.hasOwnProperty(p)&&Ke(e,t,p,null,r,d);for(f in r)d=r[f],h=n[f],!r.hasOwnProperty(f)||d===h||d==null&&h==null||Ke(e,t,f,d,r,h)}var X0=null,Z0=null;function Cs(e){return e.nodeType===9?e:e.ownerDocument}function L1(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function j1(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Q0(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var K0=null;function EE(){var e=window.event;return e&&e.type==="popstate"?e===K0?!1:(K0=e,!0):(K0=null,!1)}var H1=typeof setTimeout=="function"?setTimeout:void 0,AE=typeof clearTimeout=="function"?clearTimeout:void 0,P1=typeof Promise=="function"?Promise:void 0,CE=typeof queueMicrotask=="function"?queueMicrotask:typeof P1<"u"?function(e){return P1.resolve(null).then(e).catch(TE)}:H1;function TE(e){setTimeout(function(){throw e})}function Si(e){return e==="head"}function q1(e,t){var n=t,r=0,i=0;do{var a=n.nextSibling;if(e.removeChild(n),a&&a.nodeType===8)if(n=a.data,n==="/$"){if(0<r&&8>r){n=r;var o=e.ownerDocument;if(n&1&&Fu(o.documentElement),n&2&&Fu(o.body),n&4)for(n=o.head,Fu(n),o=n.firstChild;o;){var u=o.nextSibling,l=o.nodeName;o[Go]||l==="SCRIPT"||l==="STYLE"||l==="LINK"&&o.rel.toLowerCase()==="stylesheet"||n.removeChild(o),o=u}}if(i===0){e.removeChild(a),ku(t);return}i--}else n==="$"||n==="$?"||n==="$!"?i++:r=n.charCodeAt(0)-48;else r=0;n=a}while(n);ku(t)}function W0(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":W0(n),rd(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function ME(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[Go])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(a=e.getAttribute("rel"),a==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(a!==i.rel||e.getAttribute("href")!==(i.href==null||i.href===""?null:i.href)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute("title")!==(i.title==null?null:i.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(a=e.getAttribute("src"),(a!==(i.src==null?null:i.src)||e.getAttribute("type")!==(i.type==null?null:i.type)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var a=i.name==null?null:""+i.name;if(i.type==="hidden"&&e.getAttribute("name")===a)return e}else return e;if(e=rr(e.nextSibling),e===null)break}return null}function _E(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=rr(e.nextSibling),e===null))return null;return e}function J0(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState==="complete"}function BE(e,t){var n=e.ownerDocument;if(e.data!=="$?"||n.readyState==="complete")t();else{var r=function(){t(),n.removeEventListener("DOMContentLoaded",r)};n.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}function rr(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="F!"||t==="F")break;if(t==="/$")return null}}return e}var eh=null;function V1(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}function G1(e,t,n){switch(t=Cs(n),e){case"html":if(e=t.documentElement,!e)throw Error(re(452));return e;case"head":if(e=t.head,!e)throw Error(re(453));return e;case"body":if(e=t.body,!e)throw Error(re(454));return e;default:throw Error(re(451))}}function Fu(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);rd(e)}var Yn=new Map,Y1=new Set;function Ts(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Pr=$e.d;$e.d={f:FE,r:NE,D:RE,C:OE,L:zE,m:UE,X:$E,S:IE,M:kE};function FE(){var e=Pr.f(),t=ys();return e||t}function NE(e){var t=xa(e);t!==null&&t.tag===5&&t.type==="form"?hv(t):Pr.r(e)}var no=typeof document>"u"?null:document;function X1(e,t,n){var r=no;if(r&&typeof t=="string"&&t){var i=Ln(t);i='link[rel="'+e+'"][href="'+i+'"]',typeof n=="string"&&(i+='[crossorigin="'+n+'"]'),Y1.has(i)||(Y1.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement("link"),Yt(t,"link",e),$t(t),r.head.appendChild(t)))}}function RE(e){Pr.D(e),X1("dns-prefetch",e,null)}function OE(e,t){Pr.C(e,t),X1("preconnect",e,t)}function zE(e,t,n){Pr.L(e,t,n);var r=no;if(r&&e&&t){var i='link[rel="preload"][as="'+Ln(t)+'"]';t==="image"&&n&&n.imageSrcSet?(i+='[imagesrcset="'+Ln(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(i+='[imagesizes="'+Ln(n.imageSizes)+'"]')):i+='[href="'+Ln(e)+'"]';var a=i;switch(t){case"style":a=ro(e);break;case"script":a=io(e)}Yn.has(a)||(e=ut({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Yn.set(a,e),r.querySelector(i)!==null||t==="style"&&r.querySelector(Nu(a))||t==="script"&&r.querySelector(Ru(a))||(t=r.createElement("link"),Yt(t,"link",e),$t(t),r.head.appendChild(t)))}}function UE(e,t){Pr.m(e,t);var n=no;if(n&&e){var r=t&&typeof t.as=="string"?t.as:"script",i='link[rel="modulepreload"][as="'+Ln(r)+'"][href="'+Ln(e)+'"]',a=i;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":a=io(e)}if(!Yn.has(a)&&(e=ut({rel:"modulepreload",href:e},t),Yn.set(a,e),n.querySelector(i)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Ru(a)))return}r=n.createElement("link"),Yt(r,"link",e),$t(r),n.head.appendChild(r)}}}function IE(e,t,n){Pr.S(e,t,n);var r=no;if(r&&e){var i=wa(r).hoistableStyles,a=ro(e);t=t||"default";var o=i.get(a);if(!o){var u={loading:0,preload:null};if(o=r.querySelector(Nu(a)))u.loading=5;else{e=ut({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Yn.get(a))&&th(e,n);var l=o=r.createElement("link");$t(l),Yt(l,"link",e),l._p=new Promise(function(s,c){l.onload=s,l.onerror=c}),l.addEventListener("load",function(){u.loading|=1}),l.addEventListener("error",function(){u.loading|=2}),u.loading|=4,Ms(o,t,r)}o={type:"stylesheet",instance:o,count:1,state:u},i.set(a,o)}}}function $E(e,t){Pr.X(e,t);var n=no;if(n&&e){var r=wa(n).hoistableScripts,i=io(e),a=r.get(i);a||(a=n.querySelector(Ru(i)),a||(e=ut({src:e,async:!0},t),(t=Yn.get(i))&&nh(e,t),a=n.createElement("script"),$t(a),Yt(a,"link",e),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},r.set(i,a))}}function kE(e,t){Pr.M(e,t);var n=no;if(n&&e){var r=wa(n).hoistableScripts,i=io(e),a=r.get(i);a||(a=n.querySelector(Ru(i)),a||(e=ut({src:e,async:!0,type:"module"},t),(t=Yn.get(i))&&nh(e,t),a=n.createElement("script"),$t(a),Yt(a,"link",e),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},r.set(i,a))}}function Z1(e,t,n,r){var i=(i=ni.current)?Ts(i):null;if(!i)throw Error(re(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=ro(n.href),n=wa(i).hoistableStyles,r=n.get(t),r||(r={type:"style",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=ro(n.href);var a=wa(i).hoistableStyles,o=a.get(e);if(o||(i=i.ownerDocument||i,o={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},a.set(e,o),(a=i.querySelector(Nu(e)))&&!a._p&&(o.instance=a,o.state.loading=5),Yn.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Yn.set(e,n),a||LE(i,e,n,o.state))),t&&r===null)throw Error(re(528,""));return o}if(t&&r!==null)throw Error(re(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=io(n),n=wa(i).hoistableScripts,r=n.get(t),r||(r={type:"script",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(re(444,e))}}function ro(e){return'href="'+Ln(e)+'"'}function Nu(e){return'link[rel="stylesheet"]['+e+"]"}function Q1(e){return ut({},e,{"data-precedence":e.precedence,precedence:null})}function LE(e,t,n,r){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?r.loading=1:(t=e.createElement("link"),r.preload=t,t.addEventListener("load",function(){return r.loading|=1}),t.addEventListener("error",function(){return r.loading|=2}),Yt(t,"link",n),$t(t),e.head.appendChild(t))}function io(e){return'[src="'+Ln(e)+'"]'}function Ru(e){return"script[async]"+e}function K1(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+Ln(n.href)+'"]');if(r)return t.instance=r,$t(r),r;var i=ut({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),$t(r),Yt(r,"style",i),Ms(r,n.precedence,e),t.instance=r;case"stylesheet":i=ro(n.href);var a=e.querySelector(Nu(i));if(a)return t.state.loading|=4,t.instance=a,$t(a),a;r=Q1(n),(i=Yn.get(i))&&th(r,i),a=(e.ownerDocument||e).createElement("link"),$t(a);var o=a;return o._p=new Promise(function(u,l){o.onload=u,o.onerror=l}),Yt(a,"link",r),t.state.loading|=4,Ms(a,n.precedence,e),t.instance=a;case"script":return a=io(n.src),(i=e.querySelector(Ru(a)))?(t.instance=i,$t(i),i):(r=n,(i=Yn.get(a))&&(r=ut({},n),nh(r,i)),e=e.ownerDocument||e,i=e.createElement("script"),$t(i),Yt(i,"link",r),e.head.appendChild(i),t.instance=i);case"void":return null;default:throw Error(re(443,t.type))}else t.type==="stylesheet"&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Ms(r,n.precedence,e));return t.instance}function Ms(e,t,n){for(var r=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var u=r[o];if(u.dataset.precedence===t)a=u;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function th(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function nh(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var _s=null;function W1(e,t,n){if(_s===null){var r=new Map,i=_s=new Map;i.set(n,r)}else i=_s,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[Go]||a[Qt]||e==="link"&&a.getAttribute("rel")==="stylesheet")&&a.namespaceURI!=="http://www.w3.org/2000/svg"){var o=a.getAttribute(t)||"";o=e+o;var u=r.get(o);u?u.push(a):r.set(o,[a])}}return r}function J1(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function jE(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function ey(e){return!(e.type==="stylesheet"&&!(e.state.loading&3))}var Ou=null;function HE(){}function PE(e,t,n){if(Ou===null)throw Error(re(475));var r=Ou;if(t.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&!(t.state.loading&4)){if(t.instance===null){var i=ro(n.href),a=e.querySelector(Nu(i));if(a){e=a._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(r.count++,r=Bs.bind(r),e.then(r,r)),t.state.loading|=4,t.instance=a,$t(a);return}a=e.ownerDocument||e,n=Q1(n),(i=Yn.get(i))&&th(n,i),a=a.createElement("link"),$t(a);var o=a;o._p=new Promise(function(u,l){o.onload=u,o.onerror=l}),Yt(a,"link",n),t.instance=a}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(t,e),(e=t.state.preload)&&!(t.state.loading&3)&&(r.count++,t=Bs.bind(r),e.addEventListener("load",t),e.addEventListener("error",t))}}function qE(){if(Ou===null)throw Error(re(475));var e=Ou;return e.stylesheets&&e.count===0&&rh(e,e.stylesheets),0<e.count?function(t){var n=setTimeout(function(){if(e.stylesheets&&rh(e,e.stylesheets),e.unsuspend){var r=e.unsuspend;e.unsuspend=null,r()}},6e4);return e.unsuspend=t,function(){e.unsuspend=null,clearTimeout(n)}}:null}function Bs(){if(this.count--,this.count===0){if(this.stylesheets)rh(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Fs=null;function rh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Fs=new Map,t.forEach(VE,e),Fs=null,Bs.call(e))}function VE(e,t){if(!(t.state.loading&4)){var n=Fs.get(e);if(n)var r=n.get(null);else{n=new Map,Fs.set(e,n);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),a=0;a<i.length;a++){var o=i[a];(o.nodeName==="LINK"||o.getAttribute("media")!=="not all")&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute("data-precedence"),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=Bs.bind(this),i.addEventListener("load",r),i.addEventListener("error",r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var zu={$$typeof:Mr,Provider:null,Consumer:null,_currentValue:Ii,_currentValue2:Ii,_threadCount:0};function GE(e,t,n,r,i,a,o,u){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Jf(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Jf(0),this.hiddenUpdates=Jf(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=u,this.incompleteTransitions=new Map}function ty(e,t,n,r,i,a,o,u,l,s,c,f){return e=new GE(e,t,n,o,u,l,s,f),t=1,a===!0&&(t|=24),a=An(3,null,null,t),e.current=a,a.stateNode=e,t=$d(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Hd(a),e}function ny(e){return e?(e=za,e):za}function ry(e,t,n,r,i,a){i=ny(i),r.context===null?r.context=i:r.pendingContext=i,r=li(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=si(e,r,t),n!==null&&(Bn(n,e,t),fu(n,e,t))}function iy(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ih(e,t){iy(e,t),(e=e.alternate)&&iy(e,t)}function ay(e){if(e.tag===13){var t=Oa(e,67108864);t!==null&&Bn(t,e,67108864),ih(e,67108864)}}var Ns=!0;function YE(e,t,n,r){var i=we.T;we.T=null;var a=$e.p;try{$e.p=2,ah(e,t,n,r)}finally{$e.p=a,we.T=i}}function XE(e,t,n,r){var i=we.T;we.T=null;var a=$e.p;try{$e.p=8,ah(e,t,n,r)}finally{$e.p=a,we.T=i}}function ah(e,t,n,r){if(Ns){var i=oh(r);if(i===null)G0(e,t,r,Rs,n),uy(e,r);else if(QE(i,e,t,n,r))r.stopPropagation();else if(uy(e,r),t&4&&-1<ZE.indexOf(e)){for(;i!==null;){var a=xa(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=$i(a.pendingLanes);if(o!==0){var u=a;for(u.pendingLanes|=2,u.entangledLanes|=2;o;){var l=1<<31-wn(o);u.entanglements[1]|=l,o&=~l}vr(a),!(qe&6)&&(gs=dr()+500,Mu(0))}}break;case 13:u=Oa(a,2),u!==null&&Bn(u,a,2),ys(),ih(a,2)}if(a=oh(r),a===null&&G0(e,t,r,Rs,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else G0(e,t,r,null,n)}}function oh(e){return e=fd(e),uh(e)}var Rs=null;function uh(e){if(Rs=null,e=Sa(e),e!==null){var t=$o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=mp(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Rs=e,null}function oy(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ox()){case Dp:return 2;case Sp:return 8;case Al:case zx:return 32;case xp:return 268435456;default:return 32}default:return 32}}var lh=!1,xi=null,wi=null,Ei=null,Uu=new Map,Iu=new Map,Ai=[],ZE="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function uy(e,t){switch(e){case"focusin":case"focusout":xi=null;break;case"dragenter":case"dragleave":wi=null;break;case"mouseover":case"mouseout":Ei=null;break;case"pointerover":case"pointerout":Uu.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Iu.delete(t.pointerId)}}function $u(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=xa(t),t!==null&&ay(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function QE(e,t,n,r,i){switch(t){case"focusin":return xi=$u(xi,e,t,n,r,i),!0;case"dragenter":return wi=$u(wi,e,t,n,r,i),!0;case"mouseover":return Ei=$u(Ei,e,t,n,r,i),!0;case"pointerover":var a=i.pointerId;return Uu.set(a,$u(Uu.get(a)||null,e,t,n,r,i)),!0;case"gotpointercapture":return a=i.pointerId,Iu.set(a,$u(Iu.get(a)||null,e,t,n,r,i)),!0}return!1}function ly(e){var t=Sa(e.target);if(t!==null){var n=$o(t);if(n!==null){if(t=n.tag,t===13){if(t=mp(n),t!==null){e.blockedOn=t,Px(e.priority,function(){if(n.tag===13){var r=_n();r=ed(r);var i=Oa(n,r);i!==null&&Bn(i,n,r),ih(n,r)}});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Os(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=oh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);cd=r,n.target.dispatchEvent(r),cd=null}else return t=xa(n),t!==null&&ay(t),e.blockedOn=n,!1;t.shift()}return!0}function sy(e,t,n){Os(e)&&n.delete(t)}function KE(){lh=!1,xi!==null&&Os(xi)&&(xi=null),wi!==null&&Os(wi)&&(wi=null),Ei!==null&&Os(Ei)&&(Ei=null),Uu.forEach(sy),Iu.forEach(sy)}function zs(e,t){e.blockedOn===t&&(e.blockedOn=null,lh||(lh=!0,Rt.unstable_scheduleCallback(Rt.unstable_NormalPriority,KE)))}var Us=null;function cy(e){Us!==e&&(Us=e,Rt.unstable_scheduleCallback(Rt.unstable_NormalPriority,function(){Us===e&&(Us=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!="function"){if(uh(r||n)===null)continue;break}var a=xa(n);a!==null&&(e.splice(t,3),t-=3,u0(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function ku(e){function t(l){return zs(l,e)}xi!==null&&zs(xi,e),wi!==null&&zs(wi,e),Ei!==null&&zs(Ei,e),Uu.forEach(t),Iu.forEach(t);for(var n=0;n<Ai.length;n++){var r=Ai[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ai.length&&(n=Ai[0],n.blockedOn===null);)ly(n),n.blockedOn===null&&Ai.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[ln]||null;if(typeof a=="function")o||cy(n);else if(o){var u=null;if(a&&a.hasAttribute("formAction")){if(i=a,o=a[ln]||null)u=o.formAction;else if(uh(i)!==null)continue}else u=o.action;typeof u=="function"?n[r+1]=u:(n.splice(r,3),r-=3),cy(n)}}}function sh(e){this._internalRoot=e}Is.prototype.render=sh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(re(409));var n=t.current,r=_n();ry(n,r,e,t,null,null)},Is.prototype.unmount=sh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ry(e.current,2,null,e,null,null),ys(),t[Da]=null}};function Is(e){this._internalRoot=e}Is.prototype.unstable_scheduleHydration=function(e){if(e){var t=Tp();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ai.length&&t!==0&&t<Ai[n].priority;n++);Ai.splice(n,0,e),n===0&&ly(e)}};var fy=dp.version;if(fy!=="19.1.1")throw Error(re(527,fy,"19.1.1"));$e.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(re(188)):(e=Object.keys(e).join(","),Error(re(268,e)));return e=Tx(t),e=e!==null?gp(e):null,e=e===null?null:e.stateNode,e};var WE={bundleType:0,version:"19.1.1",rendererPackageName:"react-dom",currentDispatcherRef:we,reconcilerVersion:"19.1.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var $s=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!$s.isDisabled&&$s.supportsFiber)try{Po=$s.inject(WE),xn=$s}catch{}}bl.createRoot=function(e,t){if(!hp(e))throw Error(re(299));var n=!1,r="",i=Tv,a=Mv,o=_v,u=null;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(a=t.onCaughtError),t.onRecoverableError!==void 0&&(o=t.onRecoverableError),t.unstable_transitionCallbacks!==void 0&&(u=t.unstable_transitionCallbacks)),t=ty(e,1,!1,null,null,n,r,i,a,o,u,null),e[Da]=t.current,V0(e),new sh(t)},bl.hydrateRoot=function(e,t,n){if(!hp(e))throw Error(re(299));var r=!1,i="",a=Tv,o=Mv,u=_v,l=null,s=null;return n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onUncaughtError!==void 0&&(a=n.onUncaughtError),n.onCaughtError!==void 0&&(o=n.onCaughtError),n.onRecoverableError!==void 0&&(u=n.onRecoverableError),n.unstable_transitionCallbacks!==void 0&&(l=n.unstable_transitionCallbacks),n.formState!==void 0&&(s=n.formState)),t=ty(e,1,!0,t,n??null,r,i,a,o,u,l,s),t.context=ny(null),n=t.current,r=_n(),r=ed(r),i=li(r),i.callback=null,si(n,i,r),n=r,t.current.lanes=n,Vo(t,n),vr(t),e[Da]=t.current,V0(e),new Is(t)},bl.version="19.1.1";function dy(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(dy)}catch(e){console.error(e)}}dy(),op.exports=bl;var JE=op.exports;const eA=(e,t)=>t.type==="selectUnitMetrics"?{...e,selectedUnitMetrics:t.unitMetrics}:t.type==="initialize"?{...e,allUnitMetrics:[...new Set([...e.allUnitMetrics||[],...t.unitMetrics])].sort()}:e,hy=Nt.createContext({}),ch=()=>{const e=M.useContext(hy),t=M.useMemo(()=>e.unitMetricSelectionDispatch||(()=>{}),[e.unitMetricSelectionDispatch]);return{selectedUnitMetrics:e.unitMetricSelection?.selectedUnitMetrics||[],allUnitMetrics:e.unitMetricSelection?.allUnitMetrics||[],unitMetricSelectionDispatch:t}},Ct=e=>{if(typeof e=="number")return e;if(typeof e=="string"){const t=tA(e);try{const n=parseFloat(t);return isNaN(n)?0:n}catch{return 0}}else return 0},tA=e=>{let t=0;for(;t<e.length&&nA(e[t]);)t++;return e.slice(t)},nA=e=>isNaN(parseFloat(e)),yr=e=>[...e].sort((t,n)=>{if(typeof t=="number"&&typeof n=="number")return t-n;{if(!isNaN(parseInt(t+""))&&!isNaN(parseInt(n+"")))return parseInt(t+"")-parseInt(n+"");const r=(t+"")[0],i=(n+"")[0];if(r===i){const a=(t+"").slice(1),o=(n+"").slice(1);return!isNaN(parseInt(a))&&!isNaN(parseInt(o))?parseInt(a)-parseInt(o):t<n?-1:t>n?1:0}else return t<n?-1:t>n?1:0}}),ao=(e,t)=>{const{targetUnit:n}=t;if(n===void 0)throw Error("UNIQUE_SELECT for unit selection requires a target unit to be set.");return{...e,lastClickedId:n,selectedUnitIds:new Set(e.selectedUnitIds.has(n)?[]:[n]),currentUnitId:n}},rA=e=>{if(e.lastClickedId===void 0)return e.orderedUnitIds.length===0?e:ao(e,{targetUnit:e.orderedUnitIds[0]});const t=e.orderedUnitIds.indexOf(e.lastClickedId);if(t<0)return e;const n=e.orderedUnitIds[t+1];return n===void 0?e:ao(e,{targetUnit:n})},iA=e=>{if(e.lastClickedId===void 0)return e;const t=e.orderedUnitIds.indexOf(e.lastClickedId);if(t<0||t===0)return e;const n=e.orderedUnitIds[t-1];return n===void 0?e:ao(e,{targetUnit:n})},aA=e=>e.orderedUnitIds.length===0?e:ao(e,{targetUnit:e.orderedUnitIds[0]}),oA=e=>e.orderedUnitIds.length===0?e:ao(e,{targetUnit:e.orderedUnitIds[e.orderedUnitIds.length-1]}),uA=(e,t)=>({...e,currentUnitId:(t.incomingSelectedUnitIds||[])[0],selectedUnitIds:new Set(t.incomingSelectedUnitIds??[])}),my=e=>e.selectedUnitIds.size===0?"none":e.selectedUnitIds.size===e.orderedUnitIds.length?"all":!e.visibleUnitIds||e.visibleUnitIds.length===0||e.selectedUnitIds.size!==e.visibleUnitIds.length||e.visibleUnitIds.some(t=>!e.selectedUnitIds.has(t))?"partial":"all",py=(e,t)=>{if(t.targetUnit===void 0)throw new Error("Attempt to toggle unit with unset unitid.");const n=new Set([...e.selectedUnitIds]);n.has(t.targetUnit)?n.delete(t.targetUnit):n.add(t.targetUnit);let r=e.currentUnitId;return t.targetUnit===e.currentUnitId&&(r=[...n][0]),[...n].length===1&&(r=[...n][0]),{...e,selectedUnitIds:n,currentUnitId:r,lastClickedId:t.targetUnit}},lA=(e,t)=>{const{selectedUnitIds:n,lastClickedId:r,orderedUnitIds:i}=e,{targetUnit:a}=t;if(i.length===0)throw Error("Attempt to toggle range with no units initialized.");if(!r||!a)return console.warn(`Cannot toggle range with undefined limit: last-clicked ${r}, target ${a}`),e;const o=i.findIndex(s=>s===r),u=i.findIndex(s=>s===a);if(o===-1||u===-1)throw Error(`Requested to toggle unit range from ID ${r} to ID ${a} but one of these was not found.`);const l=i.slice(Math.min(o,u),Math.max(o,u)+1);return n.has(a)?l.forEach(s=>n.delete(s)):l.forEach(s=>n.add(s)),e.currentUnitId?n.has(e.currentUnitId)||(e.currentUnitId=[...n][0]):e.currentUnitId=[...n][0],{...e,lastClickedId:a,selectedUnitIds:new Set(n),currentUnitId:e.currentUnitId}},sA=e=>{const t=my(e),n=t==="all"||t==="partial"?new Set:new Set(e.orderedUnitIds);return e.currentUnitId?n.has(e.currentUnitId)||(e.currentUnitId=[...n][0]):e.currentUnitId=[...n][0],{...e,selectedUnitIds:n}},cA=e=>t=>n=>{dA(t,e,n)},fA=e=>t=>n=>{hA(t,e,n)},dA=(e,t,n)=>{const r={type:n.ctrlKey?fh:n.shiftKey?hh:dh,targetUnit:e};t(r)},hA=(e,t,n)=>{const r={type:n.shiftKey?hh:n.ctrlKey?dh:fh,targetUnit:e};t(r)},ks=20,mA=(e,t)=>{if(t.newVisibleUnitIds&&t.newVisibleUnitIds.length>0)return{...e,visibleUnitIds:t.newVisibleUnitIds};const n=t.unitsPerPage||e.unitsPerPage||ks,r=t.pageNumber||e.page||1;if(n===e.unitsPerPage&&r===e.page)return e;const i=r!==e.page?r:1+Math.floor((e.unitsPerPage||ks)*(r-1)/n),a=n*(i-1);return{...e,page:i,unitsPerPage:n,visibleUnitIds:e.orderedUnitIds.slice(a,a+n)}},pA=(e,t)=>({...e,restrictedUnitIds:t.newRestrictedUnitIds,selectedUnitIds:t.newRestrictedUnitIds!==void 0&&e.selectedUnitIds!==void 0?new Set([...e.selectedUnitIds].filter(n=>!t.newRestrictedUnitIds||t.newRestrictedUnitIds.includes(n))):e.selectedUnitIds}),gy=(e,t)=>{const n=(e.unitsPerPage||ks)*((e.page||1)-1);return e.visibleUnitIds&&e.visibleUnitIds.length>0?t.slice(n,n+(e.unitsPerPage||ks)):void 0},gA=(e,t)=>{const{newUnitOrder:n}=t,{orderedUnitIds:r}=e;if(!n||n.length===0)throw Error("Attempt to reset unit ordering to empty set.");const i=new Set(r);if(i.size>0&&(n.length!==i.size||n.some(o=>!i.has(o))))throw Error("Reordering units, but the set of units in the new and old ordering don't match.");if(r.every((o,u)=>o===n[u]))return e;const a=gy(e,n);return{...e,orderedUnitIds:n,lastClickedId:void 0,visibleUnitIds:a,sortRules:[]}},vA=(e,t)=>{const{sortRules:n}=e,{newSortField:r,sortCallback:i}=t;if(r===void 0||i===void 0)throw Error("Attempt to update sort fields with undefined field or callback.");const a=yA(n||[],r,t.ascending),o=i(a),u=gy(e,o);return{...e,sortRules:a,orderedUnitIds:o,visibleUnitIds:u,lastClickedId:void 0}},yA=(e,t,n)=>{const r=e.pop(),i=n===void 0?r?.columnName===t?!r.sortAscending:!0:n;return r&&r.columnName!==t&&e.push(r),[...e.filter(o=>o.columnName!==t),{columnName:t,sortAscending:i}]},bA="SET_SELECTION",fh="UNIQUE_SELECT",vy="UNIQUE_SELECT_NEXT",yy="UNIQUE_SELECT_PREVIOUS",by="UNIQUE_SELECT_FIRST",Dy="UNIQUE_SELECT_LAST",dh="TOGGLE_UNIT",hh="TOGGLE_RANGE",DA="TOGGLE_SELECT_ALL",SA="DESELECT_ALL",oo="INITIALIZE_UNITS",xA="SET_UNIT_ORDER",wA="UPDATE_SORT_FIELDS",EA="SET_VISIBLE_UNITS",AA="SET_RESTRICTED_UNITS",CA="COPY_STATE",Sy={selectedUnitIds:new Set,currentUnitId:void 0,orderedUnitIds:[]},TA=(e,t)=>{const{type:n}=t;switch(n){case oo:{const r=new Set(e.orderedUnitIds);if((t.newUnitOrder||[]).filter(i=>!r.has(i)).length===0)return e;if(t.newUnitOrder&&t.newUnitOrder.length>=1)return{...e,orderedUnitIds:yr([...new Set([...t.newUnitOrder,...e.orderedUnitIds])])};throw Error("Attempt to initialize table ordering with no actual units passed.")}case bA:return uA(e,t);case fh:return ao(e,t);case vy:return rA(e);case yy:return iA(e);case by:return aA(e);case Dy:return oA(e);case dh:return py(e,t);case hh:return e.lastClickedId?lA(e,t):py(e,t);case DA:return sA(e);case SA:return{...e,selectedUnitIds:new Set,currentUnitId:void 0};case xA:return gA(e,t);case wA:return vA(e,t);case EA:return mA(e,t);case AA:return pA(e,t);case CA:if(!t.sourceState)throw Error("Attempt to copy state but no source state was provided.");return{...t.sourceState};default:throw Error(`Invalid mode for unit selection reducer: ${n}`)}},MA=()=>M.useContext(xy),xy=Nt.createContext({unitSelection:Sy,unitSelectionDispatch:()=>{}}),qr=()=>{const{unitSelection:e,unitSelectionDispatch:t}=MA(),n=M.useMemo(()=>cA(t),[t]),r=M.useMemo(()=>fA(t),[t]),i=M.useMemo(()=>_A(e.orderedUnitIds,e.restrictedUnitIds),[e.orderedUnitIds,e.restrictedUnitIds]),a=M.useMemo(()=>e.orderedUnitIds.filter(o=>e.selectedUnitIds.has(o)),[e.orderedUnitIds,e.selectedUnitIds]);return{selectedUnitIds:e.selectedUnitIds,currentUnitId:e.currentUnitId,orderedUnitIds:i,allOrderedUnitIds:e.orderedUnitIds,selectedUnitIdsArray:a,visibleUnitIds:e.visibleUnitIds,primarySortRule:e.sortRules&&e.sortRules.length>0?e.sortRules[e.sortRules.length-1]:void 0,page:e.page,unitsPerPage:e.unitsPerPage,checkboxClickHandlerGenerator:n,plotClickHandlerGenerator:r,unitIdSelectionDispatch:t,currentState:e,restrictedUnitIds:e.restrictedUnitIds}},_A=(e,t)=>{if(t===void 0)return e;const n=new Set(t);return e.filter(r=>n.has(r))};function wy(e){const t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(!t)throw new Error(`Invalid hex color: ${e}`);return{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}}function Ey(e,t,n){const r=i=>{const a=Math.round(Math.max(0,Math.min(255,i))).toString(16);return a.length===1?"0"+a:a};return`#${r(e)}${r(t)}${r(n)}`}function BA(e,t){const{r:n,g:r,b:i}=wy(e),a=1/t;return Ey(n*a,r*a,i*a)}function FA(e,t){const{r:n,g:r,b:i}=wy(e),a=t,o=n+(255-n)*(a-1)/a,u=r+(255-r)*(a-1)/a,l=i+(255-i)*(a-1)/a;return Ey(o,u,l)}const na=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],Ay=na.length;for(let e=0;e<Ay;e++)na.push(BA(na[e],2));for(let e=0;e<Ay;e++)na.push(FA(na[e],1.5));const mh=e=>na[e%na.length],Ls=e=>e!==null&&typeof e=="string",NA=e=>e!==null&&typeof e=="function",RA=e=>e!==null&&typeof e=="number",OA=e=>t=>{for(const n of e)if(n(t))return!0;return!1},zA=e=>t=>t===e,Cy=e=>t=>{if(t!==null&&Array.isArray(t)){for(const n of t)if(!e(n))return!1;return!0}else return!1},js=(e,t,n)=>{const r=n||{};if(!e)return r.callback&&r.callback("x is undefined/null."),!1;if(typeof e!="object")return r.callback&&r.callback("x is not an Object."),!1;for(const i in e)if(!(i in t)&&!r.allowAdditionalFields)return r.callback&&r.callback(`Key not in spec: ${i}`),!1;for(const i in t){const a=t[i];if(NA(a)){if(!a(e[i]))return r.callback&&r.callback(`Problem validating: ${i}`),!1}else{if(!(i in e))return r.callback&&r.callback(`Key not in x: ${i}`),!1;if(!js(e[i],a,{callback:r.callback}))return r.callback&&r.callback(`Value of key > ${i} < itself failed validation.`),!1}}return!0},UA=(e,t)=>{if(t.type==="DRAG_MOUSE_DOWN"){const{point:n}=t;return{...e,isActive:!1,dragAnchor:n,dragPosition:n,dragRect:void 0}}else{if(t.type==="DRAG_MOUSE_UP")return{...e,isActive:!1,dragAnchor:void 0,dragPosition:void 0,dragRect:void 0};if(t.type==="DRAG_MOUSE_MOVE"){if(!e.dragAnchor)return e;const n=[Math.min(e.dragAnchor[0],t.point[0]),Math.min(e.dragAnchor[1],t.point[1]),Math.abs(e.dragAnchor[0]-t.point[0]),Math.abs(e.dragAnchor[1]-t.point[1])];return e.isActive?{...e,dragRect:n,dragPosition:[t.point[0],t.point[1]]}:n[2]>=10||n[3]>=10?{...e,isActive:!0,dragRect:n,dragPosition:[t.point[0],t.point[1]]}:e}else return t.type==="DRAG_MOUSE_LEAVE"?{...e}:(console.log("Error: unrecognized verb in dragSelectReducer."),e)}},Hs=(e,t,n,r)=>{const[i,a]=M.useReducer(UA,{}),o=M.useCallback(f=>{f.buttons&&a({type:"DRAG_MOUSE_MOVE",point:Ps(f)})},[]),u=M.useCallback(f=>{a({type:"DRAG_MOUSE_DOWN",point:Ps(f)})},[]),l=M.useCallback(f=>{i.isActive&&i.dragRect&&n(i.dragRect,{ctrlKey:f.ctrlKey,shiftKey:f.shiftKey}),i.isActive||r(Ps(f),{ctrlKey:f.ctrlKey,shiftKey:f.shiftKey}),a({type:"DRAG_MOUSE_UP",point:Ps(f)})},[i,n,r]),s=M.useCallback(()=>{a({type:"DRAG_MOUSE_LEAVE"})},[]),c=M.useCallback(f=>{if(f.clearRect(0,0,e,t),i.isActive&&i.dragRect){const d=i.dragRect;f.fillStyle=IA,f.fillRect(d[0],d[1],d[2],d[3])}},[e,t,i]);return{dragSelectState:i,onMouseDown:u,onMouseMove:o,onMouseUp:l,onMouseLeave:s,paintDragSelectLayer:c}},IA="rgba(196, 196, 196, 0.5)",Ps=e=>{const t=e.currentTarget.getBoundingClientRect();return[e.clientX-t.x,e.clientY-t.y]},$A={position:"absolute",left:0,top:0},kA=e=>{if(!e||typeof e=="function")return;const t=e.current,n=t&&t.getContext("2d");if(n)return n},ir=e=>{const{width:t,height:n,vOffsetPx:r,hOffsetPx:i,draw:a,drawData:o}=e,u=M.useRef(null);M.useEffect(()=>{const f=kA(u);f&&f.canvas&&a(f,o)},[a,u,o]);const c={...$A,...r?{top:r}:{},...i?{left:i}:{}};return B.jsx("canvas",{ref:u,width:t,height:n,style:c})};function Ci(){return Ci=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ci.apply(null,arguments)}var Ty={relTol:1e-12,absTol:1e-15,matrix:"Matrix",number:"number",numberFallback:"number",precision:64,predictable:!1,randomSeed:null};function LA(e,t){if(qs(e,t))return e[t];throw typeof e[t]=="function"&&HA(e,t)?new Error('Cannot access method "'+t+'" as a property'):new Error('No access to property "'+t+'"')}function jA(e,t,n){if(qs(e,t))return e[t]=n,n;throw new Error('No access to property "'+t+'"')}function qs(e,t){return!PA(e)&&!Array.isArray(e)?!1:ju(qA,t)?!0:!(t in Object.prototype||t in Function.prototype)}function HA(e,t){return e==null||typeof e[t]!="function"||ju(e,t)&&Object.getPrototypeOf&&t in Object.getPrototypeOf(e)?!1:ju(VA,t)?!0:!(t in Object.prototype||t in Function.prototype)}function PA(e){return typeof e=="object"&&e&&e.constructor===Object}var qA={length:!0,name:!0},VA={toString:!0,valueOf:!0,toLocaleString:!0};class GA{constructor(t){this.wrappedObject=t,this[Symbol.iterator]=this.entries}keys(){return Object.keys(this.wrappedObject).filter(t=>this.has(t)).values()}get(t){return LA(this.wrappedObject,t)}set(t,n){return jA(this.wrappedObject,t,n),this}has(t){return qs(this.wrappedObject,t)&&t in this.wrappedObject}entries(){return YA(this.keys(),t=>[t,this.get(t)])}forEach(t){for(var n of this.keys())t(this.get(n),n,this)}delete(t){qs(this.wrappedObject,t)&&delete this.wrappedObject[t]}clear(){for(var t of this.keys())this.delete(t)}get size(){return Object.keys(this.wrappedObject).length}}function YA(e,t){return{next:()=>{var n=e.next();return n.done?n:{value:t(n.value),done:!1}}}}function et(e){return typeof e=="number"}function vt(e){return!e||typeof e!="object"||typeof e.constructor!="function"?!1:e.isBigNumber===!0&&typeof e.constructor.prototype=="object"&&e.constructor.prototype.isBigNumber===!0||typeof e.constructor.isDecimal=="function"&&e.constructor.isDecimal(e)===!0}function XA(e){return typeof e=="bigint"}function ph(e){return e&&typeof e=="object"&&Object.getPrototypeOf(e).isComplex===!0||!1}function gh(e){return e&&typeof e=="object"&&Object.getPrototypeOf(e).isFraction===!0||!1}function My(e){return e&&e.constructor.prototype.isUnit===!0||!1}function ar(e){return typeof e=="string"}var ht=Array.isArray;function Pe(e){return e&&e.constructor.prototype.isMatrix===!0||!1}function Lu(e){return Array.isArray(e)||Pe(e)}function _y(e){return e&&e.isDenseMatrix&&e.constructor.prototype.isMatrix===!0||!1}function By(e){return e&&e.isSparseMatrix&&e.constructor.prototype.isMatrix===!0||!1}function Fy(e){return e&&e.constructor.prototype.isRange===!0||!1}function vh(e){return e&&e.constructor.prototype.isIndex===!0||!1}function ZA(e){return typeof e=="boolean"}function QA(e){return e&&e.constructor.prototype.isResultSet===!0||!1}function KA(e){return e&&e.constructor.prototype.isHelp===!0||!1}function WA(e){return typeof e=="function"}function JA(e){return e instanceof Date}function eC(e){return e instanceof RegExp}function yh(e){return!!(e&&typeof e=="object"&&e.constructor===Object&&!ph(e)&&!gh(e))}function tC(e){return e?e instanceof Map||e instanceof GA||typeof e.set=="function"&&typeof e.get=="function"&&typeof e.keys=="function"&&typeof e.has=="function":!1}function nC(e){return e===null}function rC(e){return e===void 0}function iC(e){return e&&e.isAccessorNode===!0&&e.constructor.prototype.isNode===!0||!1}function aC(e){return e&&e.isArrayNode===!0&&e.constructor.prototype.isNode===!0||!1}function oC(e){return e&&e.isAssignmentNode===!0&&e.constructor.prototype.isNode===!0||!1}function uC(e){return e&&e.isBlockNode===!0&&e.constructor.prototype.isNode===!0||!1}function lC(e){return e&&e.isConditionalNode===!0&&e.constructor.prototype.isNode===!0||!1}function sC(e){return e&&e.isConstantNode===!0&&e.constructor.prototype.isNode===!0||!1}function cC(e){return e&&e.isFunctionAssignmentNode===!0&&e.constructor.prototype.isNode===!0||!1}function fC(e){return e&&e.isFunctionNode===!0&&e.constructor.prototype.isNode===!0||!1}function dC(e){return e&&e.isIndexNode===!0&&e.constructor.prototype.isNode===!0||!1}function hC(e){return e&&e.isNode===!0&&e.constructor.prototype.isNode===!0||!1}function mC(e){return e&&e.isObjectNode===!0&&e.constructor.prototype.isNode===!0||!1}function pC(e){return e&&e.isOperatorNode===!0&&e.constructor.prototype.isNode===!0||!1}function gC(e){return e&&e.isParenthesisNode===!0&&e.constructor.prototype.isNode===!0||!1}function vC(e){return e&&e.isRangeNode===!0&&e.constructor.prototype.isNode===!0||!1}function yC(e){return e&&e.isRelationalNode===!0&&e.constructor.prototype.isNode===!0||!1}function bC(e){return e&&e.isSymbolNode===!0&&e.constructor.prototype.isNode===!0||!1}function DC(e){return e&&e.constructor.prototype.isChain===!0||!1}function Fn(e){var t=typeof e;return t==="object"?e===null?"null":vt(e)?"BigNumber":e.constructor&&e.constructor.name?e.constructor.name:"Object":t}function Ie(e){var t=typeof e;if(t==="number"||t==="bigint"||t==="string"||t==="boolean"||e===null||e===void 0)return e;if(typeof e.clone=="function")return e.clone();if(Array.isArray(e))return e.map(function(n){return Ie(n)});if(e instanceof Date)return new Date(e.valueOf());if(vt(e))return e;if(yh(e))return SC(e,Ie);if(t==="function")return e;throw new TypeError("Cannot clone: unknown type of value (value: ".concat(e,")"))}function SC(e,t){var n={};for(var r in e)ju(e,r)&&(n[r]=t(e[r]));return n}function Ny(e,t){for(var n in t)ju(t,n)&&(e[n]=t[n]);return e}function Ti(e,t){var n,r,i;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(r=0,i=e.length;r<i;r++)if(!Ti(e[r],t[r]))return!1;return!0}else{if(typeof e=="function")return e===t;if(e instanceof Object){if(Array.isArray(t)||!(t instanceof Object))return!1;for(n in e)if(!(n in t)||!Ti(e[n],t[n]))return!1;for(n in t)if(!(n in e))return!1;return!0}else return e===t}}function ju(e,t){return e&&Object.hasOwnProperty.call(e,t)}function xC(e,t){for(var n={},r=0;r<t.length;r++){var i=t[r],a=e[i];a!==void 0&&(n[i]=a)}return n}var wC=["Matrix","Array"],EC=["number","BigNumber","Fraction"],Wt=function(t){if(t)throw new Error(`The global config is readonly.
62
51
  Please create a mathjs instance if you want to change the default configuration.
63
52
  Example:
64
53
 
65
54
  import { create, all } from 'mathjs';
66
55
  const mathjs = create(all);
67
56
  mathjs.config({ number: 'BigNumber' });
68
- `);return Object.freeze(cS)};oi(mn,cS,{MATRIX_OPTIONS:OM,NUMBER_OPTIONS:RM});function gS(){return!0}function dr(){return!1}function ls(){}const vS="Argument is not a typed-function.";function yS(){function e(R){return typeof R=="object"&&R!==null&&R.constructor===Object}const t=[{name:"number",test:function(R){return typeof R=="number"}},{name:"string",test:function(R){return typeof R=="string"}},{name:"boolean",test:function(R){return typeof R=="boolean"}},{name:"Function",test:function(R){return typeof R=="function"}},{name:"Array",test:Array.isArray},{name:"Date",test:function(R){return R instanceof Date}},{name:"RegExp",test:function(R){return R instanceof RegExp}},{name:"Object",test:e},{name:"null",test:function(R){return R===null}},{name:"undefined",test:function(R){return R===void 0}}],n={name:"any",test:gS,isAny:!0};let r,a,i=0,o={createCount:0};function s(R){const I=r.get(R);if(I)return I;let H='Unknown type "'+R+'"';const Z=R.toLowerCase();let ie;for(ie of a)if(ie.toLowerCase()===Z){H+='. Did you mean "'+ie+'" ?';break}throw new TypeError(H)}function l(R){let I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"any";const H=I?s(I).index:a.length,Z=[];for(let J=0;J<R.length;++J){if(!R[J]||typeof R[J].name!="string"||typeof R[J].test!="function")throw new TypeError("Object with properties {name: string, test: function} expected");const ge=R[J].name;if(r.has(ge))throw new TypeError('Duplicate type name "'+ge+'"');Z.push(ge),r.set(ge,{name:ge,test:R[J].test,isAny:R[J].isAny,index:H+J,conversionsTo:[]})}const ie=a.slice(H);a=a.slice(0,H).concat(Z).concat(ie);for(let J=H+Z.length;J<a.length;++J)r.get(a[J]).index=J}function u(){r=new Map,a=[],i=0,l([n],!1)}u(),l(t);function c(){let R;for(R of a)r.get(R).conversionsTo=[];i=0}function f(R){const I=a.filter(H=>{const Z=r.get(H);return!Z.isAny&&Z.test(R)});return I.length?I:["any"]}function d(R){return R&&typeof R=="function"&&"_typedFunctionData"in R}function h(R,I,H){if(!d(R))throw new TypeError(vS);const Z=H&&H.exact,ie=Array.isArray(I)?I.join(","):I,J=w(ie),ge=D(J);if(!Z||ge in R.signatures){const lt=R._typedFunctionData.signatureMap.get(ge);if(lt)return lt}const ce=J.length;let pe;if(Z){pe=[];let lt;for(lt in R.signatures)pe.push(R._typedFunctionData.signatureMap.get(lt))}else pe=R._typedFunctionData.signatures;for(let lt=0;lt<ce;++lt){const gt=J[lt],qt=[];let In;for(In of pe){const Tn=A(In.params,lt);if(!(!Tn||gt.restParam&&!Tn.restParam)){if(!Tn.hasAny){const Fr=y(Tn);if(gt.types.some(Br=>!Fr.has(Br.name)))continue}qt.push(In)}}if(pe=qt,pe.length===0)break}let le;for(le of pe)if(le.params.length<=ce)return le;throw new TypeError("Signature not found (signature: "+(R.name||"unnamed")+"("+D(J,", ")+"))")}function g(R,I,H){return h(R,I,H).implementation}function m(R,I){const H=s(I);if(H.test(R))return R;const Z=H.conversionsTo;if(Z.length===0)throw new Error("There are no conversions to "+I+" defined.");for(let ie=0;ie<Z.length;ie++)if(s(Z[ie].from).test(R))return Z[ie].convert(R);throw new Error("Cannot convert "+R+" to "+I)}function D(R){let I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:",";return R.map(H=>H.name).join(I)}function p(R){const I=R.indexOf("...")===0,Z=(I?R.length>3?R.slice(3):"any":R).split("|").map(ce=>s(ce.trim()));let ie=!1,J=I?"...":"";return{types:Z.map(function(ce){return ie=ce.isAny||ie,J+=ce.name+"|",{name:ce.name,typeIndex:ce.index,test:ce.test,isAny:ce.isAny,conversion:null,conversionIndex:-1}}),name:J.slice(0,-1),hasAny:ie,hasConversion:!1,restParam:I}}function v(R){const I=R.types.map(ge=>ge.name),H=k(I);let Z=R.hasAny,ie=R.name;const J=H.map(function(ge){const ce=s(ge.from);return Z=ce.isAny||Z,ie+="|"+ge.from,{name:ge.from,typeIndex:ce.index,test:ce.test,isAny:ce.isAny,conversion:ge,conversionIndex:ge.index}});return{types:R.types.concat(J),name:ie,hasAny:Z,hasConversion:J.length>0,restParam:R.restParam}}function y(R){return R.typeSet||(R.typeSet=new Set,R.types.forEach(I=>R.typeSet.add(I.name))),R.typeSet}function w(R){const I=[];if(typeof R!="string")throw new TypeError("Signatures must be strings");const H=R.trim();if(H==="")return I;const Z=H.split(",");for(let ie=0;ie<Z.length;++ie){const J=p(Z[ie].trim());if(J.restParam&&ie!==Z.length-1)throw new SyntaxError('Unexpected rest parameter "'+Z[ie]+'": only allowed for the last parameter');if(J.types.length===0)return null;I.push(J)}return I}function E(R){const I=ee(R);return I?I.restParam:!1}function b(R){if(!R||R.types.length===0)return gS;if(R.types.length===1)return s(R.types[0].name).test;if(R.types.length===2){const I=s(R.types[0].name).test,H=s(R.types[1].name).test;return function(ie){return I(ie)||H(ie)}}else{const I=R.types.map(function(H){return s(H.name).test});return function(Z){for(let ie=0;ie<I.length;ie++)if(I[ie](Z))return!0;return!1}}}function S(R){let I,H,Z;if(E(R)){I=te(R).map(b);const ie=I.length,J=b(ee(R)),ge=function(ce){for(let pe=ie;pe<ce.length;pe++)if(!J(ce[pe]))return!1;return!0};return function(pe){for(let le=0;le<I.length;le++)if(!I[le](pe[le]))return!1;return ge(pe)&&pe.length>=ie+1}}else return R.length===0?function(J){return J.length===0}:R.length===1?(H=b(R[0]),function(J){return H(J[0])&&J.length===1}):R.length===2?(H=b(R[0]),Z=b(R[1]),function(J){return H(J[0])&&Z(J[1])&&J.length===2}):(I=R.map(b),function(J){for(let ge=0;ge<I.length;ge++)if(!I[ge](J[ge]))return!1;return J.length===I.length})}function A(R,I){return I<R.length?R[I]:E(R)?ee(R):null}function C(R,I){const H=A(R,I);return H?y(H):new Set}function T(R){return R.conversion===null||R.conversion===void 0}function M(R,I){const H=new Set;return R.forEach(Z=>{const ie=C(Z.params,I);let J;for(J of ie)H.add(J)}),H.has("any")?["any"]:Array.from(H)}function x(R,I,H){let Z,ie;const J=R||"unnamed";let ge=H,ce;for(ce=0;ce<I.length;ce++){const gt=[];if(ge.forEach(qt=>{const In=A(qt.params,ce),Tn=b(In);(ce<qt.params.length||E(qt.params))&&Tn(I[ce])&&gt.push(qt)}),gt.length===0){if(ie=M(ge,ce),ie.length>0){const qt=f(I[ce]);return Z=new TypeError("Unexpected type of argument in function "+J+" (expected: "+ie.join(" or ")+", actual: "+qt.join(" | ")+", index: "+ce+")"),Z.data={category:"wrongType",fn:J,index:ce,actual:qt,expected:ie},Z}}else ge=gt}const pe=ge.map(function(gt){return E(gt.params)?1/0:gt.params.length});if(I.length<Math.min.apply(null,pe))return ie=M(ge,ce),Z=new TypeError("Too few arguments in function "+J+" (expected: "+ie.join(" or ")+", index: "+I.length+")"),Z.data={category:"tooFewArgs",fn:J,index:I.length,expected:ie},Z;const le=Math.max.apply(null,pe);if(I.length>le)return Z=new TypeError("Too many arguments in function "+J+" (expected: "+le+", actual: "+I.length+")"),Z.data={category:"tooManyArgs",fn:J,index:I.length,expectedLength:le},Z;const lt=[];for(let gt=0;gt<I.length;++gt)lt.push(f(I[gt]).join("|"));return Z=new TypeError('Arguments of type "'+lt.join(", ")+'" do not match any of the defined signatures of function '+J+"."),Z.data={category:"mismatch",actual:lt},Z}function N(R){let I=a.length+1;for(let H=0;H<R.types.length;H++)T(R.types[H])&&(I=Math.min(I,R.types[H].typeIndex));return I}function O(R){let I=i+1;for(let H=0;H<R.types.length;H++)T(R.types[H])||(I=Math.min(I,R.types[H].conversionIndex));return I}function z(R,I){if(R.hasAny){if(!I.hasAny)return 1}else if(I.hasAny)return-1;if(R.restParam){if(!I.restParam)return 1}else if(I.restParam)return-1;if(R.hasConversion){if(!I.hasConversion)return 1}else if(I.hasConversion)return-1;const H=N(R)-N(I);if(H<0)return-1;if(H>0)return 1;const Z=O(R)-O(I);return Z<0?-1:Z>0?1:0}function B(R,I){const H=R.params,Z=I.params,ie=ee(H),J=ee(Z),ge=E(H),ce=E(Z);if(ge&&ie.hasAny){if(!ce||!J.hasAny)return 1}else if(ce&&J.hasAny)return-1;let pe=0,le=0,lt;for(lt of H)lt.hasAny&&++pe,lt.hasConversion&&++le;let gt=0,qt=0;for(lt of Z)lt.hasAny&&++gt,lt.hasConversion&&++qt;if(pe!==gt)return pe-gt;if(ge&&ie.hasConversion){if(!ce||!J.hasConversion)return 1}else if(ce&&J.hasConversion)return-1;if(le!==qt)return le-qt;if(ge){if(!ce)return 1}else if(ce)return-1;const In=(H.length-Z.length)*(ge?-1:1);if(In!==0)return In;const Tn=[];let Fr=0;for(let Ps=0;Ps<H.length;++Ps){const d0=z(H[Ps],Z[Ps]);Tn.push(d0),Fr+=d0}if(Fr!==0)return Fr;let Br;for(Br of Tn)if(Br!==0)return Br;return 0}function k(R){if(R.length===0)return[];const I=R.map(s);R.length>1&&I.sort((ie,J)=>ie.index-J.index);let H=I[0].conversionsTo;if(R.length===1)return H;H=H.concat([]);const Z=new Set(R);for(let ie=1;ie<I.length;++ie){let J;for(J of I[ie].conversionsTo)Z.has(J.from)||(H.push(J),Z.add(J.from))}return H}function $(R,I){let H=I;if(R.some(ie=>ie.hasConversion)){const ie=E(R),J=R.map(U);H=function(){const ce=[],pe=ie?arguments.length-1:arguments.length;for(let le=0;le<pe;le++)ce[le]=J[le](arguments[le]);return ie&&(ce[pe]=arguments[pe].map(J[pe])),I.apply(this,ce)}}let Z=H;if(E(R)){const ie=R.length-1;Z=function(){return H.apply(this,ne(arguments,0,ie).concat([ne(arguments,ie)]))}}return Z}function U(R){let I,H,Z,ie;const J=[],ge=[];switch(R.types.forEach(function(ce){ce.conversion&&(J.push(s(ce.conversion.from).test),ge.push(ce.conversion.convert))}),ge.length){case 0:return function(pe){return pe};case 1:return I=J[0],Z=ge[0],function(pe){return I(pe)?Z(pe):pe};case 2:return I=J[0],H=J[1],Z=ge[0],ie=ge[1],function(pe){return I(pe)?Z(pe):H(pe)?ie(pe):pe};default:return function(pe){for(let le=0;le<ge.length;le++)if(J[le](pe))return ge[le](pe);return pe}}}function Y(R){function I(H,Z,ie){if(Z<H.length){const J=H[Z];let ge=[];if(J.restParam){const ce=J.types.filter(T);ce.length<J.types.length&&ge.push({types:ce,name:"..."+ce.map(pe=>pe.name).join("|"),hasAny:ce.some(pe=>pe.isAny),hasConversion:!1,restParam:!0}),ge.push(J)}else ge=J.types.map(function(ce){return{types:[ce],name:ce.name,hasAny:ce.isAny,hasConversion:ce.conversion,restParam:!1}});return W(ge,function(ce){return I(H,Z+1,ie.concat([ce]))})}else return[ie]}return I(R,0,[])}function X(R,I){const H=Math.max(R.length,I.length);for(let ce=0;ce<H;ce++){const pe=C(R,ce),le=C(I,ce);let lt=!1,gt;for(gt of le)if(pe.has(gt)){lt=!0;break}if(!lt)return!1}const Z=R.length,ie=I.length,J=E(R),ge=E(I);return J?ge?Z===ie:ie>=Z:ge?Z>=ie:Z===ie}function P(R){return R.map(I=>Ee(I)?be(I.referToSelf.callback):xe(I)?me(I.referTo.references,I.referTo.callback):I)}function G(R,I,H){const Z=[];let ie;for(ie of R){let J=H[ie];if(typeof J!="number")throw new TypeError('No definition for referenced signature "'+ie+'"');if(J=I[J],typeof J!="function")return!1;Z.push(J)}return Z}function q(R,I,H){const Z=P(R),ie=new Array(Z.length).fill(!1);let J=!0;for(;J;){J=!1;let ge=!0;for(let ce=0;ce<Z.length;++ce){if(ie[ce])continue;const pe=Z[ce];if(Ee(pe))Z[ce]=pe.referToSelf.callback(H),Z[ce].referToSelf=pe.referToSelf,ie[ce]=!0,ge=!1;else if(xe(pe)){const le=G(pe.referTo.references,Z,I);le?(Z[ce]=pe.referTo.callback.apply(this,le),Z[ce].referTo=pe.referTo,ie[ce]=!0,ge=!1):J=!0}}if(ge&&J)throw new SyntaxError("Circular reference detected in resolving typed.referTo")}return Z}function L(R){const I=/\bthis(\(|\.signatures\b)/;Object.keys(R).forEach(H=>{const Z=R[H];if(I.test(Z.toString()))throw new SyntaxError("Using `this` to self-reference a function is deprecated since typed-function@3. Use typed.referTo and typed.referToSelf instead.")})}function j(R,I){if(o.createCount++,Object.keys(I).length===0)throw new SyntaxError("No signatures provided");o.warnAgainstDeprecatedThis&&L(I);const H=[],Z=[],ie={},J=[];let ge;for(ge in I){if(!Object.prototype.hasOwnProperty.call(I,ge))continue;const at=w(ge);if(!at)continue;H.forEach(function(Mu){if(X(Mu,at))throw new TypeError('Conflicting signatures "'+D(Mu)+'" and "'+D(at)+'".')}),H.push(at);const Un=Z.length;Z.push(I[ge]);const Lq=at.map(v);let h0;for(h0 of Y(Lq)){const Mu=D(h0);J.push({params:h0,name:Mu,fn:Un}),h0.every(Pq=>!Pq.hasConversion)&&(ie[Mu]=Un)}}J.sort(B);const ce=q(Z,ie,Tu);let pe;for(pe in ie)Object.prototype.hasOwnProperty.call(ie,pe)&&(ie[pe]=ce[ie[pe]]);const le=[],lt=new Map;for(pe of J)lt.has(pe.name)||(pe.fn=ce[pe.fn],le.push(pe),lt.set(pe.name,pe));const gt=le[0]&&le[0].params.length<=2&&!E(le[0].params),qt=le[1]&&le[1].params.length<=2&&!E(le[1].params),In=le[2]&&le[2].params.length<=2&&!E(le[2].params),Tn=le[3]&&le[3].params.length<=2&&!E(le[3].params),Fr=le[4]&&le[4].params.length<=2&&!E(le[4].params),Br=le[5]&&le[5].params.length<=2&&!E(le[5].params),Ps=gt&&qt&&In&&Tn&&Fr&&Br;for(let at=0;at<le.length;++at)le[at].test=S(le[at].params);const d0=gt?b(le[0].params[0]):dr,dq=qt?b(le[1].params[0]):dr,hq=In?b(le[2].params[0]):dr,mq=Tn?b(le[3].params[0]):dr,pq=Fr?b(le[4].params[0]):dr,gq=Br?b(le[5].params[0]):dr,vq=gt?b(le[0].params[1]):dr,yq=qt?b(le[1].params[1]):dr,bq=In?b(le[2].params[1]):dr,Dq=Tn?b(le[3].params[1]):dr,Sq=Fr?b(le[4].params[1]):dr,wq=Br?b(le[5].params[1]):dr;for(let at=0;at<le.length;++at)le[at].implementation=$(le[at].params,le[at].fn);const xq=gt?le[0].implementation:ls,Eq=qt?le[1].implementation:ls,Aq=In?le[2].implementation:ls,Cq=Tn?le[3].implementation:ls,Tq=Fr?le[4].implementation:ls,Mq=Br?le[5].implementation:ls,_q=gt?le[0].params.length:-1,Nq=qt?le[1].params.length:-1,Fq=In?le[2].params.length:-1,Bq=Tn?le[3].params.length:-1,Oq=Fr?le[4].params.length:-1,Rq=Br?le[5].params.length:-1,zq=Ps?6:0,kq=le.length,$q=le.map(at=>at.test),Iq=le.map(at=>at.implementation),Uq=function(){for(let Un=zq;Un<kq;Un++)if($q[Un](arguments))return Iq[Un].apply(this,arguments);return o.onMismatch(R,arguments,le)};function Tu(at,Un){return arguments.length===_q&&d0(at)&&vq(Un)?xq.apply(this,arguments):arguments.length===Nq&&dq(at)&&yq(Un)?Eq.apply(this,arguments):arguments.length===Fq&&hq(at)&&bq(Un)?Aq.apply(this,arguments):arguments.length===Bq&&mq(at)&&Dq(Un)?Cq.apply(this,arguments):arguments.length===Oq&&pq(at)&&Sq(Un)?Tq.apply(this,arguments):arguments.length===Rq&&gq(at)&&wq(Un)?Mq.apply(this,arguments):Uq.apply(this,arguments)}try{Object.defineProperty(Tu,"name",{value:R})}catch{}return Tu.signatures=ie,Tu._typedFunctionData={signatures:le,signatureMap:lt},Tu}function V(R,I,H){throw x(R,I,H)}function te(R){return ne(R,0,R.length-1)}function ee(R){return R[R.length-1]}function ne(R,I,H){return Array.prototype.slice.call(R,I,H)}function se(R,I){for(let H=0;H<R.length;H++)if(I(R[H]))return R[H]}function W(R,I){return Array.prototype.concat.apply([],R.map(I))}function de(){const R=te(arguments).map(H=>D(w(H))),I=ee(arguments);if(typeof I!="function")throw new TypeError("Callback function expected as last argument");return me(R,I)}function me(R,I){return{referTo:{references:R,callback:I}}}function be(R){if(typeof R!="function")throw new TypeError("Callback function expected as first argument");return{referToSelf:{callback:R}}}function xe(R){return R&&typeof R.referTo=="object"&&Array.isArray(R.referTo.references)&&typeof R.referTo.callback=="function"}function Ee(R){return R&&typeof R.referToSelf=="object"&&typeof R.referToSelf.callback=="function"}function Te(R,I){if(!R)return I;if(I&&I!==R){const H=new Error("Function names do not match (expected: "+R+", actual: "+I+")");throw H.data={actual:I,expected:R},H}return R}function He(R){let I;for(const H in R)Object.prototype.hasOwnProperty.call(R,H)&&(d(R[H])||typeof R[H].signature=="string")&&(I=Te(I,R[H].name));return I}function Be(R,I){let H;for(H in I)if(Object.prototype.hasOwnProperty.call(I,H)){if(H in R&&I[H]!==R[H]){const Z=new Error('Signature "'+H+'" is defined twice');throw Z.data={signature:H,sourceFunction:I[H],destFunction:R[H]},Z}R[H]=I[H]}}const Pe=o;o=function(R){const I=typeof R=="string",H=I?1:0;let Z=I?R:"";const ie={};for(let J=H;J<arguments.length;++J){const ge=arguments[J];let ce={},pe;if(typeof ge=="function"?(pe=ge.name,typeof ge.signature=="string"?ce[ge.signature]=ge:d(ge)&&(ce=ge.signatures)):e(ge)&&(ce=ge,I||(pe=He(ge))),Object.keys(ce).length===0){const le=new TypeError("Argument to 'typed' at index "+J+" is not a (typed) function, nor an object with signatures as keys and functions as values.");throw le.data={index:J,argument:ge},le}I||(Z=Te(Z,pe)),Be(ie,ce)}return j(Z||"",ie)},o.create=yS,o.createCount=Pe.createCount,o.onMismatch=V,o.throwMismatchError=V,o.createError=x,o.clear=u,o.clearConversions=c,o.addTypes=l,o._findType=s,o.referTo=de,o.referToSelf=be,o.convert=m,o.findSignature=h,o.find=g,o.isTypedFunction=d,o.warnAgainstDeprecatedThis=!0,o.addType=function(R,I){let H="any";I!==!1&&r.has("Object")&&(H="Object"),o.addTypes([R],H)};function ve(R){if(!R||typeof R.from!="string"||typeof R.to!="string"||typeof R.convert!="function")throw new TypeError("Object with properties {from: string, to: string, convert: function} expected");if(R.to===R.from)throw new SyntaxError('Illegal to define conversion from "'+R.from+'" to itself.')}return o.addConversion=function(R){let I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{override:!1};ve(R);const H=s(R.to),Z=H.conversionsTo.find(ie=>ie.from===R.from);if(Z)if(I&&I.override)o.removeConversion({from:Z.from,to:R.to,convert:Z.convert});else throw new Error('There is already a conversion from "'+R.from+'" to "'+H.name+'"');H.conversionsTo.push({from:R.from,convert:R.convert,index:i++})},o.addConversions=function(R,I){R.forEach(H=>o.addConversion(H,I))},o.removeConversion=function(R){ve(R);const I=s(R.to),H=se(I.conversionsTo,ie=>ie.from===R.from);if(!H)throw new Error("Attempt to remove nonexistent conversion from "+R.from+" to "+R.to);if(H.convert!==R.convert)throw new Error("Conversion to remove does not match existing conversion");const Z=I.conversionsTo.indexOf(H);I.conversionsTo.splice(Z,1)},o.resolve=function(R,I){if(!d(R))throw new TypeError(vS);const H=R._typedFunctionData.signatures;for(let Z=0;Z<H.length;++Z)if(H[Z].test(I))return H[Z];return null},o}const hf=yS();function fe(e,t,n,r){function a(i){var o=BM(i,t.map($M));return zM(e,t,i),n(o)}return a.isFactory=!0,a.fn=e,a.dependencies=t.slice().sort(),r&&(a.meta=r),a}function zM(e,t,n){var r=t.filter(i=>!kM(i)).every(i=>n[i]!==void 0);if(!r){var a=t.filter(i=>n[i]===void 0);throw new Error('Cannot create function "'.concat(e,'", ')+"some dependencies are missing: ".concat(a.map(i=>'"'.concat(i,'"')).join(", "),"."))}}function kM(e){return e&&e[0]==="?"}function $M(e){return e&&e[0]==="?"?e.slice(1):e}function pt(e){return typeof e=="boolean"?!0:isFinite(e)?e===Math.round(e):!1}function IM(e,t){if(t.number==="bigint")try{BigInt(e)}catch{return t.numberFallback}return t.number}var UM=Math.sign||function(e){return e>0?1:e<0?-1:0};function Sp(e,t,n){var r={2:"0b",8:"0o",16:"0x"},a=r[t],i="";if(n){if(n<1)throw new Error("size must be in greater than 0");if(!pt(n))throw new Error("size must be an integer");if(e>2**(n-1)-1||e<-(2**(n-1)))throw new Error("Value must be in range [-2^".concat(n-1,", 2^").concat(n-1,"-1]"));if(!pt(e))throw new Error("Value must be an integer");e<0&&(e=e+2**n),i="i".concat(n)}var o="";return e<0&&(e=-e,o="-"),"".concat(o).concat(a).concat(e.toString(t)).concat(i)}function wp(e,t){if(typeof t=="function")return t(e);if(e===1/0)return"Infinity";if(e===-1/0)return"-Infinity";if(isNaN(e))return"NaN";var{notation:n,precision:r,wordSize:a}=bS(t);switch(n){case"fixed":return PM(e,r);case"exponential":return DS(e,r);case"engineering":return LM(e,r);case"bin":return Sp(e,2,a);case"oct":return Sp(e,8,a);case"hex":return Sp(e,16,a);case"auto":return jM(e,r,t).replace(/((\.\d*?)(0+))($|e)/,function(){var i=arguments[2],o=arguments[4];return i!=="."?i+o:o});default:throw new Error('Unknown notation "'+n+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function bS(e){var t="auto",n,r;if(e!==void 0)if(ct(e))n=e;else if(Mt(e))n=e.toNumber();else if(Dp(e))e.precision!==void 0&&(n=SS(e.precision,()=>{throw new Error('Option "precision" must be a number or BigNumber')})),e.wordSize!==void 0&&(r=SS(e.wordSize,()=>{throw new Error('Option "wordSize" must be a number or BigNumber')})),e.notation&&(t=e.notation);else throw new Error("Unsupported type of options, number, BigNumber, or object expected");return{notation:t,precision:n,wordSize:r}}function mf(e){var t=String(e).toLowerCase().match(/^(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!t)throw new SyntaxError("Invalid number "+e);var n=t[1],r=t[2],a=parseFloat(t[4]||"0"),i=r.indexOf(".");a+=i!==-1?i-1:r.length-1;var o=r.replace(".","").replace(/^0*/,function(s){return a-=s.length,""}).replace(/0*$/,"").split("").map(function(s){return parseInt(s)});return o.length===0&&(o.push(0),a++),{sign:n,coefficients:o,exponent:a}}function LM(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=mf(e),r=pf(n,t),a=r.exponent,i=r.coefficients,o=a%3===0?a:a<0?a-3-a%3:a-a%3;if(ct(t))for(;t>i.length||a-o+1>i.length;)i.push(0);else for(var s=Math.abs(a-o)-(i.length-1),l=0;l<s;l++)i.push(0);for(var u=Math.abs(a-o),c=1;u>0;)c++,u--;var f=i.slice(c).join(""),d=ct(t)&&f.length||f.match(/[1-9]/)?"."+f:"",h=i.slice(0,c).join("")+d+"e"+(a>=0?"+":"")+o.toString();return r.sign+h}function PM(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=mf(e),r=typeof t=="number"?pf(n,n.exponent+1+t):n,a=r.coefficients,i=r.exponent+1,o=i+(t||0);return a.length<o&&(a=a.concat(us(o-a.length))),i<0&&(a=us(-i+1).concat(a),i=1),i<a.length&&a.splice(i,0,i===0?"0.":"."),r.sign+a.join("")}function DS(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=mf(e),r=t?pf(n,t):n,a=r.coefficients,i=r.exponent;a.length<t&&(a=a.concat(us(t-a.length)));var o=a.shift();return r.sign+o+(a.length>0?"."+a.join(""):"")+"e"+(i>=0?"+":"")+i}function jM(e,t,n){if(isNaN(e)||!isFinite(e))return String(e);var r=wS(n?.lowerExp,-3),a=wS(n?.upperExp,5),i=mf(e),o=t?pf(i,t):i;if(o.exponent<r||o.exponent>=a)return DS(e,t);var s=o.coefficients,l=o.exponent;s.length<t&&(s=s.concat(us(t-s.length))),s=s.concat(us(l-s.length+1+(s.length<t?t-s.length:0))),s=us(-l).concat(s);var u=l>0?l:0;return u<s.length-1&&s.splice(u+1,0,"."),o.sign+s.join("")}function pf(e,t){for(var n={sign:e.sign,coefficients:e.coefficients,exponent:e.exponent},r=n.coefficients;t<=0;)r.unshift(0),n.exponent++,t++;if(r.length>t){var a=r.splice(t,r.length-t);if(a[0]>=5){var i=t-1;for(r[i]++;r[i]===10;)r.pop(),i===0&&(r.unshift(0),n.exponent++,i++),i--,r[i]++}}return n}function us(e){for(var t=[],n=0;n<e;n++)t.push(0);return t}function HM(e){return e.toExponential().replace(/e.*$/,"").replace(/^0\.?0*|\./,"").length}function Da(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1e-8,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;if(n<=0)throw new Error("Relative tolerance must be greater than 0");if(r<0)throw new Error("Absolute tolerance must be at least 0");return isNaN(e)||isNaN(t)?!1:!isFinite(e)||!isFinite(t)?e===t:e===t?!0:Math.abs(e-t)<=Math.max(n*Math.max(Math.abs(e),Math.abs(t)),r)}function SS(e,t){if(ct(e))return e;if(Mt(e))return e.toNumber();t()}function wS(e,t){return ct(e)?e:Mt(e)?e.toNumber():t}var xS=function(){return xS=hf.create,hf},qM=["?BigNumber","?Complex","?DenseMatrix","?Fraction"],YM=fe("typed",qM,function(t){var{BigNumber:n,Complex:r,DenseMatrix:a,Fraction:i}=t,o=xS();return o.clear(),o.addTypes([{name:"number",test:ct},{name:"Complex",test:vp},{name:"BigNumber",test:Mt},{name:"bigint",test:aM},{name:"Fraction",test:yp},{name:"Unit",test:fS},{name:"identifier",test:s=>Ar&&/^(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDDC0-\uDDF3\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDD4A-\uDD65\uDD6F-\uDD85\uDE80-\uDEA9\uDEB0\uDEB1\uDEC2-\uDEC4\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61\uDF80-\uDF89\uDF8B\uDF8E\uDF90-\uDFB5\uDFB7\uDFD1\uDFD3]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8\uDFC0-\uDFE0]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD80E\uD80F\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46\uDC60-\uDFFF]|\uD810[\uDC00-\uDFFA]|\uD811[\uDC00-\uDE46]|\uD818[\uDD00-\uDD1D]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDD40-\uDD6C\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDDD0-\uDDED\uDDF0\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])(?:[0-9A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDDC0-\uDDF3\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDD4A-\uDD65\uDD6F-\uDD85\uDE80-\uDEA9\uDEB0\uDEB1\uDEC2-\uDEC4\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61\uDF80-\uDF89\uDF8B\uDF8E\uDF90-\uDFB5\uDFB7\uDFD1\uDFD3]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8\uDFC0-\uDFE0]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD80E\uD80F\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46\uDC60-\uDFFF]|\uD810[\uDC00-\uDFFA]|\uD811[\uDC00-\uDE46]|\uD818[\uDD00-\uDD1D]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDD40-\uDD6C\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDDD0-\uDDED\uDDF0\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])*$/.test(s)},{name:"string",test:Ar},{name:"Chain",test:NM},{name:"Array",test:Et},{name:"Matrix",test:We},{name:"DenseMatrix",test:dS},{name:"SparseMatrix",test:hS},{name:"Range",test:mS},{name:"Index",test:bp},{name:"boolean",test:iM},{name:"ResultSet",test:oM},{name:"Help",test:sM},{name:"function",test:lM},{name:"Date",test:uM},{name:"RegExp",test:cM},{name:"null",test:dM},{name:"undefined",test:hM},{name:"AccessorNode",test:mM},{name:"ArrayNode",test:pM},{name:"AssignmentNode",test:gM},{name:"BlockNode",test:vM},{name:"ConditionalNode",test:yM},{name:"ConstantNode",test:bM},{name:"FunctionNode",test:SM},{name:"FunctionAssignmentNode",test:DM},{name:"IndexNode",test:wM},{name:"Node",test:xM},{name:"ObjectNode",test:EM},{name:"OperatorNode",test:AM},{name:"ParenthesisNode",test:CM},{name:"RangeNode",test:TM},{name:"RelationalNode",test:MM},{name:"SymbolNode",test:_M},{name:"Map",test:fM},{name:"Object",test:Dp}]),o.addConversions([{from:"number",to:"BigNumber",convert:function(l){if(n||gf(l),HM(l)>15)throw new TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: "+l+"). Use function bignumber(x) to convert to BigNumber.");return new n(l)}},{from:"number",to:"Complex",convert:function(l){return r||vf(l),new r(l,0)}},{from:"BigNumber",to:"Complex",convert:function(l){return r||vf(l),new r(l.toNumber(),0)}},{from:"bigint",to:"number",convert:function(l){if(l>Number.MAX_SAFE_INTEGER)throw new TypeError("Cannot implicitly convert bigint to number: value exceeds the max safe integer value (value: "+l+")");return Number(l)}},{from:"bigint",to:"BigNumber",convert:function(l){return n||gf(l),new n(l.toString())}},{from:"bigint",to:"Fraction",convert:function(l){return i||yf(l),new i(l)}},{from:"Fraction",to:"BigNumber",convert:function(l){throw new TypeError("Cannot implicitly convert a Fraction to BigNumber or vice versa. Use function bignumber(x) to convert to BigNumber or fraction(x) to convert to Fraction.")}},{from:"Fraction",to:"Complex",convert:function(l){return r||vf(l),new r(l.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(l){i||yf(l);var u=new i(l);if(u.valueOf()!==l)throw new TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+l+"). Use function fraction(x) to convert to Fraction.");return u}},{from:"string",to:"number",convert:function(l){var u=Number(l);if(isNaN(u))throw new Error('Cannot convert "'+l+'" to a number');return u}},{from:"string",to:"BigNumber",convert:function(l){n||gf(l);try{return new n(l)}catch{throw new Error('Cannot convert "'+l+'" to BigNumber')}}},{from:"string",to:"bigint",convert:function(l){try{return BigInt(l)}catch{throw new Error('Cannot convert "'+l+'" to BigInt')}}},{from:"string",to:"Fraction",convert:function(l){i||yf(l);try{return new i(l)}catch{throw new Error('Cannot convert "'+l+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(l){r||vf(l);try{return new r(l)}catch{throw new Error('Cannot convert "'+l+'" to Complex')}}},{from:"boolean",to:"number",convert:function(l){return+l}},{from:"boolean",to:"BigNumber",convert:function(l){return n||gf(l),new n(+l)}},{from:"boolean",to:"bigint",convert:function(l){return BigInt(+l)}},{from:"boolean",to:"Fraction",convert:function(l){return i||yf(l),new i(+l)}},{from:"boolean",to:"string",convert:function(l){return String(l)}},{from:"Array",to:"Matrix",convert:function(l){return a||GM(),new a(l)}},{from:"Matrix",to:"Array",convert:function(l){return l.valueOf()}}]),o.onMismatch=(s,l,u)=>{var c=o.createError(s,l,u);if(["wrongType","mismatch"].includes(c.data.category)&&l.length===1&&Gl(l[0])&&u.some(d=>!d.params.includes(","))){var f=new TypeError("Function '".concat(s,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(s,")'."));throw f.data=c.data,f}throw c},o.onMismatch=(s,l,u)=>{var c=o.createError(s,l,u);if(["wrongType","mismatch"].includes(c.data.category)&&l.length===1&&Gl(l[0])&&u.some(d=>!d.params.includes(","))){var f=new TypeError("Function '".concat(s,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(s,")'."));throw f.data=c.data,f}throw c},o});function gf(e){throw new Error("Cannot convert value ".concat(e," into a BigNumber: no class 'BigNumber' provided"))}function vf(e){throw new Error("Cannot convert value ".concat(e," into a Complex number: no class 'Complex' provided"))}function GM(){throw new Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}function yf(e){throw new Error("Cannot convert value ".concat(e," into a Fraction, no class 'Fraction' provided."))}/*!
57
+ `);return Object.freeze(Ty)};Ci(Wt,Ty,{MATRIX_OPTIONS:wC,NUMBER_OPTIONS:EC});function Ry(){return!0}function Xn(){return!1}function uo(){}const Oy="Argument is not a typed-function.";function zy(){function e(O){return typeof O=="object"&&O!==null&&O.constructor===Object}const t=[{name:"number",test:function(O){return typeof O=="number"}},{name:"string",test:function(O){return typeof O=="string"}},{name:"boolean",test:function(O){return typeof O=="boolean"}},{name:"Function",test:function(O){return typeof O=="function"}},{name:"Array",test:Array.isArray},{name:"Date",test:function(O){return O instanceof Date}},{name:"RegExp",test:function(O){return O instanceof RegExp}},{name:"Object",test:e},{name:"null",test:function(O){return O===null}},{name:"undefined",test:function(O){return O===void 0}}],n={name:"any",test:Ry,isAny:!0};let r,i,a=0,o={createCount:0};function u(O){const $=r.get(O);if($)return $;let V='Unknown type "'+O+'"';const Z=O.toLowerCase();let ae;for(ae of i)if(ae.toLowerCase()===Z){V+='. Did you mean "'+ae+'" ?';break}throw new TypeError(V)}function l(O){let $=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"any";const V=$?u($).index:i.length,Z=[];for(let J=0;J<O.length;++J){if(!O[J]||typeof O[J].name!="string"||typeof O[J].test!="function")throw new TypeError("Object with properties {name: string, test: function} expected");const me=O[J].name;if(r.has(me))throw new TypeError('Duplicate type name "'+me+'"');Z.push(me),r.set(me,{name:me,test:O[J].test,isAny:O[J].isAny,index:V+J,conversionsTo:[]})}const ae=i.slice(V);i=i.slice(0,V).concat(Z).concat(ae);for(let J=V+Z.length;J<i.length;++J)r.get(i[J]).index=J}function s(){r=new Map,i=[],a=0,l([n],!1)}s(),l(t);function c(){let O;for(O of i)r.get(O).conversionsTo=[];a=0}function f(O){const $=i.filter(V=>{const Z=r.get(V);return!Z.isAny&&Z.test(O)});return $.length?$:["any"]}function d(O){return O&&typeof O=="function"&&"_typedFunctionData"in O}function h(O,$,V){if(!d(O))throw new TypeError(Oy);const Z=V&&V.exact,ae=Array.isArray($)?$.join(","):$,J=S(ae),me=D(J);if(!Z||me in O.signatures){const We=O._typedFunctionData.signatureMap.get(me);if(We)return We}const le=J.length;let he;if(Z){he=[];let We;for(We in O.signatures)he.push(O._typedFunctionData.signatureMap.get(We))}else he=O._typedFunctionData.signatures;for(let We=0;We<le;++We){const ot=J[We],Ft=[];let Dn;for(Dn of he){const un=C(Dn.params,We);if(!(!un||ot.restParam&&!un.restParam)){if(!un.hasAny){const lr=y(un);if(ot.types.some(sr=>!lr.has(sr.name)))continue}Ft.push(Dn)}}if(he=Ft,he.length===0)break}let ue;for(ue of he)if(ue.params.length<=le)return ue;throw new TypeError("Signature not found (signature: "+(O.name||"unnamed")+"("+D(J,", ")+"))")}function v(O,$,V){return h(O,$,V).implementation}function m(O,$){const V=u($);if(V.test(O))return O;const Z=V.conversionsTo;if(Z.length===0)throw new Error("There are no conversions to "+$+" defined.");for(let ae=0;ae<Z.length;ae++)if(u(Z[ae].from).test(O))return Z[ae].convert(O);throw new Error("Cannot convert "+O+" to "+$)}function D(O){let $=arguments.length>1&&arguments[1]!==void 0?arguments[1]:",";return O.map(V=>V.name).join($)}function p(O){const $=O.indexOf("...")===0,Z=($?O.length>3?O.slice(3):"any":O).split("|").map(le=>u(le.trim()));let ae=!1,J=$?"...":"";return{types:Z.map(function(le){return ae=le.isAny||ae,J+=le.name+"|",{name:le.name,typeIndex:le.index,test:le.test,isAny:le.isAny,conversion:null,conversionIndex:-1}}),name:J.slice(0,-1),hasAny:ae,hasConversion:!1,restParam:$}}function g(O){const $=O.types.map(me=>me.name),V=U($);let Z=O.hasAny,ae=O.name;const J=V.map(function(me){const le=u(me.from);return Z=le.isAny||Z,ae+="|"+me.from,{name:me.from,typeIndex:le.index,test:le.test,isAny:le.isAny,conversion:me,conversionIndex:me.index}});return{types:O.types.concat(J),name:ae,hasAny:Z,hasConversion:J.length>0,restParam:O.restParam}}function y(O){return O.typeSet||(O.typeSet=new Set,O.types.forEach($=>O.typeSet.add($.name))),O.typeSet}function S(O){const $=[];if(typeof O!="string")throw new TypeError("Signatures must be strings");const V=O.trim();if(V==="")return $;const Z=V.split(",");for(let ae=0;ae<Z.length;++ae){const J=p(Z[ae].trim());if(J.restParam&&ae!==Z.length-1)throw new SyntaxError('Unexpected rest parameter "'+Z[ae]+'": only allowed for the last parameter');if(J.types.length===0)return null;$.push(J)}return $}function w(O){const $=te(O);return $?$.restParam:!1}function b(O){if(!O||O.types.length===0)return Ry;if(O.types.length===1)return u(O.types[0].name).test;if(O.types.length===2){const $=u(O.types[0].name).test,V=u(O.types[1].name).test;return function(ae){return $(ae)||V(ae)}}else{const $=O.types.map(function(V){return u(V.name).test});return function(Z){for(let ae=0;ae<$.length;ae++)if($[ae](Z))return!0;return!1}}}function E(O){let $,V,Z;if(w(O)){$=ee(O).map(b);const ae=$.length,J=b(te(O)),me=function(le){for(let he=ae;he<le.length;he++)if(!J(le[he]))return!1;return!0};return function(he){for(let ue=0;ue<$.length;ue++)if(!$[ue](he[ue]))return!1;return me(he)&&he.length>=ae+1}}else return O.length===0?function(J){return J.length===0}:O.length===1?(V=b(O[0]),function(J){return V(J[0])&&J.length===1}):O.length===2?(V=b(O[0]),Z=b(O[1]),function(J){return V(J[0])&&Z(J[1])&&J.length===2}):($=O.map(b),function(J){for(let me=0;me<$.length;me++)if(!$[me](J[me]))return!1;return J.length===$.length})}function C(O,$){return $<O.length?O[$]:w(O)?te(O):null}function A(O,$){const V=C(O,$);return V?y(V):new Set}function T(O){return O.conversion===null||O.conversion===void 0}function _(O,$){const V=new Set;return O.forEach(Z=>{const ae=A(Z.params,$);let J;for(J of ae)V.add(J)}),V.has("any")?["any"]:Array.from(V)}function x(O,$,V){let Z,ae;const J=O||"unnamed";let me=V,le;for(le=0;le<$.length;le++){const ot=[];if(me.forEach(Ft=>{const Dn=C(Ft.params,le),un=b(Dn);(le<Ft.params.length||w(Ft.params))&&un($[le])&&ot.push(Ft)}),ot.length===0){if(ae=_(me,le),ae.length>0){const Ft=f($[le]);return Z=new TypeError("Unexpected type of argument in function "+J+" (expected: "+ae.join(" or ")+", actual: "+Ft.join(" | ")+", index: "+le+")"),Z.data={category:"wrongType",fn:J,index:le,actual:Ft,expected:ae},Z}}else me=ot}const he=me.map(function(ot){return w(ot.params)?1/0:ot.params.length});if($.length<Math.min.apply(null,he))return ae=_(me,le),Z=new TypeError("Too few arguments in function "+J+" (expected: "+ae.join(" or ")+", index: "+$.length+")"),Z.data={category:"tooFewArgs",fn:J,index:$.length,expected:ae},Z;const ue=Math.max.apply(null,he);if($.length>ue)return Z=new TypeError("Too many arguments in function "+J+" (expected: "+ue+", actual: "+$.length+")"),Z.data={category:"tooManyArgs",fn:J,index:$.length,expectedLength:ue},Z;const We=[];for(let ot=0;ot<$.length;++ot)We.push(f($[ot]).join("|"));return Z=new TypeError('Arguments of type "'+We.join(", ")+'" do not match any of the defined signatures of function '+J+"."),Z.data={category:"mismatch",actual:We},Z}function F(O){let $=i.length+1;for(let V=0;V<O.types.length;V++)T(O.types[V])&&($=Math.min($,O.types[V].typeIndex));return $}function R(O){let $=a+1;for(let V=0;V<O.types.length;V++)T(O.types[V])||($=Math.min($,O.types[V].conversionIndex));return $}function z(O,$){if(O.hasAny){if(!$.hasAny)return 1}else if($.hasAny)return-1;if(O.restParam){if(!$.restParam)return 1}else if($.restParam)return-1;if(O.hasConversion){if(!$.hasConversion)return 1}else if($.hasConversion)return-1;const V=F(O)-F($);if(V<0)return-1;if(V>0)return 1;const Z=R(O)-R($);return Z<0?-1:Z>0?1:0}function N(O,$){const V=O.params,Z=$.params,ae=te(V),J=te(Z),me=w(V),le=w(Z);if(me&&ae.hasAny){if(!le||!J.hasAny)return 1}else if(le&&J.hasAny)return-1;let he=0,ue=0,We;for(We of V)We.hasAny&&++he,We.hasConversion&&++ue;let ot=0,Ft=0;for(We of Z)We.hasAny&&++ot,We.hasConversion&&++Ft;if(he!==ot)return he-ot;if(me&&ae.hasConversion){if(!le||!J.hasConversion)return 1}else if(le&&J.hasConversion)return-1;if(ue!==Ft)return ue-Ft;if(me){if(!le)return 1}else if(le)return-1;const Dn=(V.length-Z.length)*(me?-1:1);if(Dn!==0)return Dn;const un=[];let lr=0;for(let Uo=0;Uo<V.length;++Uo){const Nf=z(V[Uo],Z[Uo]);un.push(Nf),lr+=Nf}if(lr!==0)return lr;let sr;for(sr of un)if(sr!==0)return sr;return 0}function U(O){if(O.length===0)return[];const $=O.map(u);O.length>1&&$.sort((ae,J)=>ae.index-J.index);let V=$[0].conversionsTo;if(O.length===1)return V;V=V.concat([]);const Z=new Set(O);for(let ae=1;ae<$.length;++ae){let J;for(J of $[ae].conversionsTo)Z.has(J.from)||(V.push(J),Z.add(J.from))}return V}function I(O,$){let V=$;if(O.some(ae=>ae.hasConversion)){const ae=w(O),J=O.map(L);V=function(){const le=[],he=ae?arguments.length-1:arguments.length;for(let ue=0;ue<he;ue++)le[ue]=J[ue](arguments[ue]);return ae&&(le[he]=arguments[he].map(J[he])),$.apply(this,le)}}let Z=V;if(w(O)){const ae=O.length-1;Z=function(){return V.apply(this,ne(arguments,0,ae).concat([ne(arguments,ae)]))}}return Z}function L(O){let $,V,Z,ae;const J=[],me=[];switch(O.types.forEach(function(le){le.conversion&&(J.push(u(le.conversion.from).test),me.push(le.conversion.convert))}),me.length){case 0:return function(he){return he};case 1:return $=J[0],Z=me[0],function(he){return $(he)?Z(he):he};case 2:return $=J[0],V=J[1],Z=me[0],ae=me[1],function(he){return $(he)?Z(he):V(he)?ae(he):he};default:return function(he){for(let ue=0;ue<me.length;ue++)if(J[ue](he))return me[ue](he);return he}}}function G(O){function $(V,Z,ae){if(Z<V.length){const J=V[Z];let me=[];if(J.restParam){const le=J.types.filter(T);le.length<J.types.length&&me.push({types:le,name:"..."+le.map(he=>he.name).join("|"),hasAny:le.some(he=>he.isAny),hasConversion:!1,restParam:!0}),me.push(J)}else me=J.types.map(function(le){return{types:[le],name:le.name,hasAny:le.isAny,hasConversion:le.conversion,restParam:!1}});return W(me,function(le){return $(V,Z+1,ae.concat([le]))})}else return[ae]}return $(O,0,[])}function X(O,$){const V=Math.max(O.length,$.length);for(let le=0;le<V;le++){const he=A(O,le),ue=A($,le);let We=!1,ot;for(ot of ue)if(he.has(ot)){We=!0;break}if(!We)return!1}const Z=O.length,ae=$.length,J=w(O),me=w($);return J?me?Z===ae:ae>=Z:me?Z>=ae:Z===ae}function P(O){return O.map($=>Se($)?ve($.referToSelf.callback):De($)?de($.referTo.references,$.referTo.callback):$)}function j(O,$,V){const Z=[];let ae;for(ae of O){let J=V[ae];if(typeof J!="number")throw new TypeError('No definition for referenced signature "'+ae+'"');if(J=$[J],typeof J!="function")return!1;Z.push(J)}return Z}function H(O,$,V){const Z=P(O),ae=new Array(Z.length).fill(!1);let J=!0;for(;J;){J=!1;let me=!0;for(let le=0;le<Z.length;++le){if(ae[le])continue;const he=Z[le];if(Se(he))Z[le]=he.referToSelf.callback(V),Z[le].referToSelf=he.referToSelf,ae[le]=!0,me=!1;else if(De(he)){const ue=j(he.referTo.references,Z,$);ue?(Z[le]=he.referTo.callback.apply(this,ue),Z[le].referTo=he.referTo,ae[le]=!0,me=!1):J=!0}}if(me&&J)throw new SyntaxError("Circular reference detected in resolving typed.referTo")}return Z}function k(O){const $=/\bthis(\(|\.signatures\b)/;Object.keys(O).forEach(V=>{const Z=O[V];if($.test(Z.toString()))throw new SyntaxError("Using `this` to self-reference a function is deprecated since typed-function@3. Use typed.referTo and typed.referToSelf instead.")})}function q(O,$){if(o.createCount++,Object.keys($).length===0)throw new SyntaxError("No signatures provided");o.warnAgainstDeprecatedThis&&k($);const V=[],Z=[],ae={},J=[];let me;for(me in $){if(!Object.prototype.hasOwnProperty.call($,me))continue;const Ze=S(me);if(!Ze)continue;V.forEach(function(gl){if(X(gl,Ze))throw new TypeError('Conflicting signatures "'+D(gl)+'" and "'+D(Ze)+'".')}),V.push(Ze);const Sn=Z.length;Z.push($[me]);const IR=Ze.map(g);let Rf;for(Rf of G(IR)){const gl=D(Rf);J.push({params:Rf,name:gl,fn:Sn}),Rf.every($R=>!$R.hasConversion)&&(ae[gl]=Sn)}}J.sort(N);const le=H(Z,ae,pl);let he;for(he in ae)Object.prototype.hasOwnProperty.call(ae,he)&&(ae[he]=le[ae[he]]);const ue=[],We=new Map;for(he of J)We.has(he.name)||(he.fn=le[he.fn],ue.push(he),We.set(he.name,he));const ot=ue[0]&&ue[0].params.length<=2&&!w(ue[0].params),Ft=ue[1]&&ue[1].params.length<=2&&!w(ue[1].params),Dn=ue[2]&&ue[2].params.length<=2&&!w(ue[2].params),un=ue[3]&&ue[3].params.length<=2&&!w(ue[3].params),lr=ue[4]&&ue[4].params.length<=2&&!w(ue[4].params),sr=ue[5]&&ue[5].params.length<=2&&!w(ue[5].params),Uo=ot&&Ft&&Dn&&un&&lr&&sr;for(let Ze=0;Ze<ue.length;++Ze)ue[Ze].test=E(ue[Ze].params);const Nf=ot?b(ue[0].params[0]):Xn,sR=Ft?b(ue[1].params[0]):Xn,cR=Dn?b(ue[2].params[0]):Xn,fR=un?b(ue[3].params[0]):Xn,dR=lr?b(ue[4].params[0]):Xn,hR=sr?b(ue[5].params[0]):Xn,mR=ot?b(ue[0].params[1]):Xn,pR=Ft?b(ue[1].params[1]):Xn,gR=Dn?b(ue[2].params[1]):Xn,vR=un?b(ue[3].params[1]):Xn,yR=lr?b(ue[4].params[1]):Xn,bR=sr?b(ue[5].params[1]):Xn;for(let Ze=0;Ze<ue.length;++Ze)ue[Ze].implementation=I(ue[Ze].params,ue[Ze].fn);const DR=ot?ue[0].implementation:uo,SR=Ft?ue[1].implementation:uo,xR=Dn?ue[2].implementation:uo,wR=un?ue[3].implementation:uo,ER=lr?ue[4].implementation:uo,AR=sr?ue[5].implementation:uo,CR=ot?ue[0].params.length:-1,TR=Ft?ue[1].params.length:-1,MR=Dn?ue[2].params.length:-1,_R=un?ue[3].params.length:-1,BR=lr?ue[4].params.length:-1,FR=sr?ue[5].params.length:-1,NR=Uo?6:0,RR=ue.length,OR=ue.map(Ze=>Ze.test),zR=ue.map(Ze=>Ze.implementation),UR=function(){for(let Sn=NR;Sn<RR;Sn++)if(OR[Sn](arguments))return zR[Sn].apply(this,arguments);return o.onMismatch(O,arguments,ue)};function pl(Ze,Sn){return arguments.length===CR&&Nf(Ze)&&mR(Sn)?DR.apply(this,arguments):arguments.length===TR&&sR(Ze)&&pR(Sn)?SR.apply(this,arguments):arguments.length===MR&&cR(Ze)&&gR(Sn)?xR.apply(this,arguments):arguments.length===_R&&fR(Ze)&&vR(Sn)?wR.apply(this,arguments):arguments.length===BR&&dR(Ze)&&yR(Sn)?ER.apply(this,arguments):arguments.length===FR&&hR(Ze)&&bR(Sn)?AR.apply(this,arguments):UR.apply(this,arguments)}try{Object.defineProperty(pl,"name",{value:O})}catch{}return pl.signatures=ae,pl._typedFunctionData={signatures:ue,signatureMap:We},pl}function Y(O,$,V){throw x(O,$,V)}function ee(O){return ne(O,0,O.length-1)}function te(O){return O[O.length-1]}function ne(O,$,V){return Array.prototype.slice.call(O,$,V)}function oe(O,$){for(let V=0;V<O.length;V++)if($(O[V]))return O[V]}function W(O,$){return Array.prototype.concat.apply([],O.map($))}function ce(){const O=ee(arguments).map(V=>D(S(V))),$=te(arguments);if(typeof $!="function")throw new TypeError("Callback function expected as last argument");return de(O,$)}function de(O,$){return{referTo:{references:O,callback:$}}}function ve(O){if(typeof O!="function")throw new TypeError("Callback function expected as first argument");return{referToSelf:{callback:O}}}function De(O){return O&&typeof O.referTo=="object"&&Array.isArray(O.referTo.references)&&typeof O.referTo.callback=="function"}function Se(O){return O&&typeof O.referToSelf=="object"&&typeof O.referToSelf.callback=="function"}function Ee(O,$){if(!O)return $;if($&&$!==O){const V=new Error("Function names do not match (expected: "+O+", actual: "+$+")");throw V.data={actual:$,expected:O},V}return O}function Re(O){let $;for(const V in O)Object.prototype.hasOwnProperty.call(O,V)&&(d(O[V])||typeof O[V].signature=="string")&&($=Ee($,O[V].name));return $}function Ce(O,$){let V;for(V in $)if(Object.prototype.hasOwnProperty.call($,V)){if(V in O&&$[V]!==O[V]){const Z=new Error('Signature "'+V+'" is defined twice');throw Z.data={signature:V,sourceFunction:$[V],destFunction:O[V]},Z}O[V]=$[V]}}const Ne=o;o=function(O){const $=typeof O=="string",V=$?1:0;let Z=$?O:"";const ae={};for(let J=V;J<arguments.length;++J){const me=arguments[J];let le={},he;if(typeof me=="function"?(he=me.name,typeof me.signature=="string"?le[me.signature]=me:d(me)&&(le=me.signatures)):e(me)&&(le=me,$||(he=Re(me))),Object.keys(le).length===0){const ue=new TypeError("Argument to 'typed' at index "+J+" is not a (typed) function, nor an object with signatures as keys and functions as values.");throw ue.data={index:J,argument:me},ue}$||(Z=Ee(Z,he)),Ce(ae,le)}return q(Z||"",ae)},o.create=zy,o.createCount=Ne.createCount,o.onMismatch=Y,o.throwMismatchError=Y,o.createError=x,o.clear=s,o.clearConversions=c,o.addTypes=l,o._findType=u,o.referTo=ce,o.referToSelf=ve,o.convert=m,o.findSignature=h,o.find=v,o.isTypedFunction=d,o.warnAgainstDeprecatedThis=!0,o.addType=function(O,$){let V="any";$!==!1&&r.has("Object")&&(V="Object"),o.addTypes([O],V)};function pe(O){if(!O||typeof O.from!="string"||typeof O.to!="string"||typeof O.convert!="function")throw new TypeError("Object with properties {from: string, to: string, convert: function} expected");if(O.to===O.from)throw new SyntaxError('Illegal to define conversion from "'+O.from+'" to itself.')}return o.addConversion=function(O){let $=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{override:!1};pe(O);const V=u(O.to),Z=V.conversionsTo.find(ae=>ae.from===O.from);if(Z)if($&&$.override)o.removeConversion({from:Z.from,to:O.to,convert:Z.convert});else throw new Error('There is already a conversion from "'+O.from+'" to "'+V.name+'"');V.conversionsTo.push({from:O.from,convert:O.convert,index:a++})},o.addConversions=function(O,$){O.forEach(V=>o.addConversion(V,$))},o.removeConversion=function(O){pe(O);const $=u(O.to),V=oe($.conversionsTo,ae=>ae.from===O.from);if(!V)throw new Error("Attempt to remove nonexistent conversion from "+O.from+" to "+O.to);if(V.convert!==O.convert)throw new Error("Conversion to remove does not match existing conversion");const Z=$.conversionsTo.indexOf(V);$.conversionsTo.splice(Z,1)},o.resolve=function(O,$){if(!d(O))throw new TypeError(Oy);const V=O._typedFunctionData.signatures;for(let Z=0;Z<V.length;++Z)if(V[Z].test($))return V[Z];return null},o}const Vs=zy();function se(e,t,n,r){function i(a){var o=xC(a,t.map(TC));return AC(e,t,a),n(o)}return i.isFactory=!0,i.fn=e,i.dependencies=t.slice().sort(),r&&(i.meta=r),i}function AC(e,t,n){var r=t.filter(a=>!CC(a)).every(a=>n[a]!==void 0);if(!r){var i=t.filter(a=>n[a]===void 0);throw new Error('Cannot create function "'.concat(e,'", ')+"some dependencies are missing: ".concat(i.map(a=>'"'.concat(a,'"')).join(", "),"."))}}function CC(e){return e&&e[0]==="?"}function TC(e){return e&&e[0]==="?"?e.slice(1):e}function it(e){return typeof e=="boolean"?!0:isFinite(e)?e===Math.round(e):!1}function MC(e,t){if(t.number==="bigint")try{BigInt(e)}catch{return t.numberFallback}return t.number}var _C=Math.sign||function(e){return e>0?1:e<0?-1:0};function bh(e,t,n){var r={2:"0b",8:"0o",16:"0x"},i=r[t],a="";if(n){if(n<1)throw new Error("size must be in greater than 0");if(!it(n))throw new Error("size must be an integer");if(e>2**(n-1)-1||e<-(2**(n-1)))throw new Error("Value must be in range [-2^".concat(n-1,", 2^").concat(n-1,"-1]"));if(!it(e))throw new Error("Value must be an integer");e<0&&(e=e+2**n),a="i".concat(n)}var o="";return e<0&&(e=-e,o="-"),"".concat(o).concat(i).concat(e.toString(t)).concat(a)}function Dh(e,t){if(typeof t=="function")return t(e);if(e===1/0)return"Infinity";if(e===-1/0)return"-Infinity";if(isNaN(e))return"NaN";var{notation:n,precision:r,wordSize:i}=Uy(t);switch(n){case"fixed":return FC(e,r);case"exponential":return Iy(e,r);case"engineering":return BC(e,r);case"bin":return bh(e,2,i);case"oct":return bh(e,8,i);case"hex":return bh(e,16,i);case"auto":return NC(e,r,t).replace(/((\.\d*?)(0+))($|e)/,function(){var a=arguments[2],o=arguments[4];return a!=="."?a+o:o});default:throw new Error('Unknown notation "'+n+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function Uy(e){var t="auto",n,r;if(e!==void 0)if(et(e))n=e;else if(vt(e))n=e.toNumber();else if(yh(e))e.precision!==void 0&&(n=$y(e.precision,()=>{throw new Error('Option "precision" must be a number or BigNumber')})),e.wordSize!==void 0&&(r=$y(e.wordSize,()=>{throw new Error('Option "wordSize" must be a number or BigNumber')})),e.notation&&(t=e.notation);else throw new Error("Unsupported type of options, number, BigNumber, or object expected");return{notation:t,precision:n,wordSize:r}}function Gs(e){var t=String(e).toLowerCase().match(/^(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!t)throw new SyntaxError("Invalid number "+e);var n=t[1],r=t[2],i=parseFloat(t[4]||"0"),a=r.indexOf(".");i+=a!==-1?a-1:r.length-1;var o=r.replace(".","").replace(/^0*/,function(u){return i-=u.length,""}).replace(/0*$/,"").split("").map(function(u){return parseInt(u)});return o.length===0&&(o.push(0),i++),{sign:n,coefficients:o,exponent:i}}function BC(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=Gs(e),r=Ys(n,t),i=r.exponent,a=r.coefficients,o=i%3===0?i:i<0?i-3-i%3:i-i%3;if(et(t))for(;t>a.length||i-o+1>a.length;)a.push(0);else for(var u=Math.abs(i-o)-(a.length-1),l=0;l<u;l++)a.push(0);for(var s=Math.abs(i-o),c=1;s>0;)c++,s--;var f=a.slice(c).join(""),d=et(t)&&f.length||f.match(/[1-9]/)?"."+f:"",h=a.slice(0,c).join("")+d+"e"+(i>=0?"+":"")+o.toString();return r.sign+h}function FC(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=Gs(e),r=typeof t=="number"?Ys(n,n.exponent+1+t):n,i=r.coefficients,a=r.exponent+1,o=a+(t||0);return i.length<o&&(i=i.concat(lo(o-i.length))),a<0&&(i=lo(-a+1).concat(i),a=1),a<i.length&&i.splice(a,0,a===0?"0.":"."),r.sign+i.join("")}function Iy(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=Gs(e),r=t?Ys(n,t):n,i=r.coefficients,a=r.exponent;i.length<t&&(i=i.concat(lo(t-i.length)));var o=i.shift();return r.sign+o+(i.length>0?"."+i.join(""):"")+"e"+(a>=0?"+":"")+a}function NC(e,t,n){if(isNaN(e)||!isFinite(e))return String(e);var r=ky(n?.lowerExp,-3),i=ky(n?.upperExp,5),a=Gs(e),o=t?Ys(a,t):a;if(o.exponent<r||o.exponent>=i)return Iy(e,t);var u=o.coefficients,l=o.exponent;u.length<t&&(u=u.concat(lo(t-u.length))),u=u.concat(lo(l-u.length+1+(u.length<t?t-u.length:0))),u=lo(-l).concat(u);var s=l>0?l:0;return s<u.length-1&&u.splice(s+1,0,"."),o.sign+u.join("")}function Ys(e,t){for(var n={sign:e.sign,coefficients:e.coefficients,exponent:e.exponent},r=n.coefficients;t<=0;)r.unshift(0),n.exponent++,t++;if(r.length>t){var i=r.splice(t,r.length-t);if(i[0]>=5){var a=t-1;for(r[a]++;r[a]===10;)r.pop(),a===0&&(r.unshift(0),n.exponent++,a++),a--,r[a]++}}return n}function lo(e){for(var t=[],n=0;n<e;n++)t.push(0);return t}function RC(e){return e.toExponential().replace(/e.*$/,"").replace(/^0\.?0*|\./,"").length}function Vr(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1e-8,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;if(n<=0)throw new Error("Relative tolerance must be greater than 0");if(r<0)throw new Error("Absolute tolerance must be at least 0");return isNaN(e)||isNaN(t)?!1:!isFinite(e)||!isFinite(t)?e===t:e===t?!0:Math.abs(e-t)<=Math.max(n*Math.max(Math.abs(e),Math.abs(t)),r)}function $y(e,t){if(et(e))return e;if(vt(e))return e.toNumber();t()}function ky(e,t){return et(e)?e:vt(e)?e.toNumber():t}var Ly=function(){return Ly=Vs.create,Vs},OC=["?BigNumber","?Complex","?DenseMatrix","?Fraction"],zC=se("typed",OC,function(t){var{BigNumber:n,Complex:r,DenseMatrix:i,Fraction:a}=t,o=Ly();return o.clear(),o.addTypes([{name:"number",test:et},{name:"Complex",test:ph},{name:"BigNumber",test:vt},{name:"bigint",test:XA},{name:"Fraction",test:gh},{name:"Unit",test:My},{name:"identifier",test:u=>ar&&/^(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDDC0-\uDDF3\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDD4A-\uDD65\uDD6F-\uDD85\uDE80-\uDEA9\uDEB0\uDEB1\uDEC2-\uDEC4\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61\uDF80-\uDF89\uDF8B\uDF8E\uDF90-\uDFB5\uDFB7\uDFD1\uDFD3]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8\uDFC0-\uDFE0]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD80E\uD80F\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46\uDC60-\uDFFF]|\uD810[\uDC00-\uDFFA]|\uD811[\uDC00-\uDE46]|\uD818[\uDD00-\uDD1D]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDD40-\uDD6C\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDDD0-\uDDED\uDDF0\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])(?:[0-9A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDDC0-\uDDF3\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDD4A-\uDD65\uDD6F-\uDD85\uDE80-\uDEA9\uDEB0\uDEB1\uDEC2-\uDEC4\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61\uDF80-\uDF89\uDF8B\uDF8E\uDF90-\uDFB5\uDFB7\uDFD1\uDFD3]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8\uDFC0-\uDFE0]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD80E\uD80F\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46\uDC60-\uDFFF]|\uD810[\uDC00-\uDFFA]|\uD811[\uDC00-\uDE46]|\uD818[\uDD00-\uDD1D]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDD40-\uDD6C\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDDD0-\uDDED\uDDF0\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])*$/.test(u)},{name:"string",test:ar},{name:"Chain",test:DC},{name:"Array",test:ht},{name:"Matrix",test:Pe},{name:"DenseMatrix",test:_y},{name:"SparseMatrix",test:By},{name:"Range",test:Fy},{name:"Index",test:vh},{name:"boolean",test:ZA},{name:"ResultSet",test:QA},{name:"Help",test:KA},{name:"function",test:WA},{name:"Date",test:JA},{name:"RegExp",test:eC},{name:"null",test:nC},{name:"undefined",test:rC},{name:"AccessorNode",test:iC},{name:"ArrayNode",test:aC},{name:"AssignmentNode",test:oC},{name:"BlockNode",test:uC},{name:"ConditionalNode",test:lC},{name:"ConstantNode",test:sC},{name:"FunctionNode",test:fC},{name:"FunctionAssignmentNode",test:cC},{name:"IndexNode",test:dC},{name:"Node",test:hC},{name:"ObjectNode",test:mC},{name:"OperatorNode",test:pC},{name:"ParenthesisNode",test:gC},{name:"RangeNode",test:vC},{name:"RelationalNode",test:yC},{name:"SymbolNode",test:bC},{name:"Map",test:tC},{name:"Object",test:yh}]),o.addConversions([{from:"number",to:"BigNumber",convert:function(l){if(n||Xs(l),RC(l)>15)throw new TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: "+l+"). Use function bignumber(x) to convert to BigNumber.");return new n(l)}},{from:"number",to:"Complex",convert:function(l){return r||Zs(l),new r(l,0)}},{from:"BigNumber",to:"Complex",convert:function(l){return r||Zs(l),new r(l.toNumber(),0)}},{from:"bigint",to:"number",convert:function(l){if(l>Number.MAX_SAFE_INTEGER)throw new TypeError("Cannot implicitly convert bigint to number: value exceeds the max safe integer value (value: "+l+")");return Number(l)}},{from:"bigint",to:"BigNumber",convert:function(l){return n||Xs(l),new n(l.toString())}},{from:"bigint",to:"Fraction",convert:function(l){return a||Qs(l),new a(l)}},{from:"Fraction",to:"BigNumber",convert:function(l){throw new TypeError("Cannot implicitly convert a Fraction to BigNumber or vice versa. Use function bignumber(x) to convert to BigNumber or fraction(x) to convert to Fraction.")}},{from:"Fraction",to:"Complex",convert:function(l){return r||Zs(l),new r(l.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(l){a||Qs(l);var s=new a(l);if(s.valueOf()!==l)throw new TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+l+"). Use function fraction(x) to convert to Fraction.");return s}},{from:"string",to:"number",convert:function(l){var s=Number(l);if(isNaN(s))throw new Error('Cannot convert "'+l+'" to a number');return s}},{from:"string",to:"BigNumber",convert:function(l){n||Xs(l);try{return new n(l)}catch{throw new Error('Cannot convert "'+l+'" to BigNumber')}}},{from:"string",to:"bigint",convert:function(l){try{return BigInt(l)}catch{throw new Error('Cannot convert "'+l+'" to BigInt')}}},{from:"string",to:"Fraction",convert:function(l){a||Qs(l);try{return new a(l)}catch{throw new Error('Cannot convert "'+l+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(l){r||Zs(l);try{return new r(l)}catch{throw new Error('Cannot convert "'+l+'" to Complex')}}},{from:"boolean",to:"number",convert:function(l){return+l}},{from:"boolean",to:"BigNumber",convert:function(l){return n||Xs(l),new n(+l)}},{from:"boolean",to:"bigint",convert:function(l){return BigInt(+l)}},{from:"boolean",to:"Fraction",convert:function(l){return a||Qs(l),new a(+l)}},{from:"boolean",to:"string",convert:function(l){return String(l)}},{from:"Array",to:"Matrix",convert:function(l){return i||UC(),new i(l)}},{from:"Matrix",to:"Array",convert:function(l){return l.valueOf()}}]),o.onMismatch=(u,l,s)=>{var c=o.createError(u,l,s);if(["wrongType","mismatch"].includes(c.data.category)&&l.length===1&&Lu(l[0])&&s.some(d=>!d.params.includes(","))){var f=new TypeError("Function '".concat(u,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(u,")'."));throw f.data=c.data,f}throw c},o.onMismatch=(u,l,s)=>{var c=o.createError(u,l,s);if(["wrongType","mismatch"].includes(c.data.category)&&l.length===1&&Lu(l[0])&&s.some(d=>!d.params.includes(","))){var f=new TypeError("Function '".concat(u,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(u,")'."));throw f.data=c.data,f}throw c},o});function Xs(e){throw new Error("Cannot convert value ".concat(e," into a BigNumber: no class 'BigNumber' provided"))}function Zs(e){throw new Error("Cannot convert value ".concat(e," into a Complex number: no class 'Complex' provided"))}function UC(){throw new Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}function Qs(e){throw new Error("Cannot convert value ".concat(e," into a Fraction, no class 'Fraction' provided."))}/*!
69
58
  * decimal.js v10.6.0
70
59
  * An arbitrary-precision Decimal type for JavaScript.
71
60
  * https://github.com/MikeMcl/decimal.js
72
61
  * Copyright (c) 2025 Michael Mclaughlin <M8ch88l@gmail.com>
73
62
  * MIT Licence
74
- */var cs=9e15,li=1e9,xp="0123456789abcdef",bf="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",Df="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Ep={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-cs,maxE:cs,crypto:!1},ES,Sa,Me=!0,Sf="[DecimalError] ",ui=Sf+"Invalid argument: ",AS=Sf+"Precision limit exceeded",CS=Sf+"crypto unavailable",TS="[object Decimal]",pn=Math.floor,Xt=Math.pow,VM=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,XM=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,ZM=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,MS=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Cr=1e7,Ae=7,KM=9007199254740991,QM=bf.length-1,Ap=Df.length-1,ae={toStringTag:TS};ae.absoluteValue=ae.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),Se(e)},ae.ceil=function(){return Se(new this.constructor(this),this.e+1,2)},ae.clampedTo=ae.clamp=function(e,t){var n,r=this,a=r.constructor;if(e=new a(e),t=new a(t),!e.s||!t.s)return new a(NaN);if(e.gt(t))throw Error(ui+t);return n=r.cmp(e),n<0?e:r.cmp(t)>0?t:new a(r)},ae.comparedTo=ae.cmp=function(e){var t,n,r,a,i=this,o=i.d,s=(e=new i.constructor(e)).d,l=i.s,u=e.s;if(!o||!s)return!l||!u?NaN:l!==u?l:o===s?0:!o^l<0?1:-1;if(!o[0]||!s[0])return o[0]?l:s[0]?-u:0;if(l!==u)return l;if(i.e!==e.e)return i.e>e.e^l<0?1:-1;for(r=o.length,a=s.length,t=0,n=r<a?r:a;t<n;++t)if(o[t]!==s[t])return o[t]>s[t]^l<0?1:-1;return r===a?0:r>a^l<0?1:-1},ae.cosine=ae.cos=function(){var e,t,n=this,r=n.constructor;return n.d?n.d[0]?(e=r.precision,t=r.rounding,r.precision=e+Math.max(n.e,n.sd())+Ae,r.rounding=1,n=WM(r,RS(r,n)),r.precision=e,r.rounding=t,Se(Sa==2||Sa==3?n.neg():n,e,t,!0)):new r(1):new r(NaN)},ae.cubeRoot=ae.cbrt=function(){var e,t,n,r,a,i,o,s,l,u,c=this,f=c.constructor;if(!c.isFinite()||c.isZero())return new f(c);for(Me=!1,i=c.s*Xt(c.s*c,1/3),!i||Math.abs(i)==1/0?(n=sn(c.d),e=c.e,(i=(e-n.length+1)%3)&&(n+=i==1||i==-2?"0":"00"),i=Xt(n,1/3),e=pn((e+1)/3)-(e%3==(e<0?-1:2)),i==1/0?n="5e"+e:(n=i.toExponential(),n=n.slice(0,n.indexOf("e")+1)+e),r=new f(n),r.s=c.s):r=new f(i.toString()),o=(e=f.precision)+3;;)if(s=r,l=s.times(s).times(s),u=l.plus(c),r=ft(u.plus(c).times(s),u.plus(l),o+2,1),sn(s.d).slice(0,o)===(n=sn(r.d)).slice(0,o))if(n=n.slice(o-3,o+1),n=="9999"||!a&&n=="4999"){if(!a&&(Se(s,e+1,0),s.times(s).times(s).eq(c))){r=s;break}o+=4,a=1}else{(!+n||!+n.slice(1)&&n.charAt(0)=="5")&&(Se(r,e+1,1),t=!r.times(r).times(r).eq(c));break}return Me=!0,Se(r,e,f.rounding,t)},ae.decimalPlaces=ae.dp=function(){var e,t=this.d,n=NaN;if(t){if(e=t.length-1,n=(e-pn(this.e/Ae))*Ae,e=t[e],e)for(;e%10==0;e/=10)n--;n<0&&(n=0)}return n},ae.dividedBy=ae.div=function(e){return ft(this,new this.constructor(e))},ae.dividedToIntegerBy=ae.divToInt=function(e){var t=this,n=t.constructor;return Se(ft(t,new n(e),0,1,1),n.precision,n.rounding)},ae.equals=ae.eq=function(e){return this.cmp(e)===0},ae.floor=function(){return Se(new this.constructor(this),this.e+1,3)},ae.greaterThan=ae.gt=function(e){return this.cmp(e)>0},ae.greaterThanOrEqualTo=ae.gte=function(e){var t=this.cmp(e);return t==1||t===0},ae.hyperbolicCosine=ae.cosh=function(){var e,t,n,r,a,i=this,o=i.constructor,s=new o(1);if(!i.isFinite())return new o(i.s?1/0:NaN);if(i.isZero())return s;n=o.precision,r=o.rounding,o.precision=n+Math.max(i.e,i.sd())+4,o.rounding=1,a=i.d.length,a<32?(e=Math.ceil(a/3),t=(1/Cf(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),i=fs(o,1,i.times(t),new o(1),!0);for(var l,u=e,c=new o(8);u--;)l=i.times(i),i=s.minus(l.times(c.minus(l.times(c))));return Se(i,o.precision=n,o.rounding=r,!0)},ae.hyperbolicSine=ae.sinh=function(){var e,t,n,r,a=this,i=a.constructor;if(!a.isFinite()||a.isZero())return new i(a);if(t=i.precision,n=i.rounding,i.precision=t+Math.max(a.e,a.sd())+4,i.rounding=1,r=a.d.length,r<3)a=fs(i,2,a,a,!0);else{e=1.4*Math.sqrt(r),e=e>16?16:e|0,a=a.times(1/Cf(5,e)),a=fs(i,2,a,a,!0);for(var o,s=new i(5),l=new i(16),u=new i(20);e--;)o=a.times(a),a=a.times(s.plus(o.times(l.times(o).plus(u))))}return i.precision=t,i.rounding=n,Se(a,t,n,!0)},ae.hyperbolicTangent=ae.tanh=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+7,r.rounding=1,ft(n.sinh(),n.cosh(),r.precision=e,r.rounding=t)):new r(n.s)},ae.inverseCosine=ae.acos=function(){var e=this,t=e.constructor,n=e.abs().cmp(1),r=t.precision,a=t.rounding;return n!==-1?n===0?e.isNeg()?qr(t,r,a):new t(0):new t(NaN):e.isZero()?qr(t,r+4,a).times(.5):(t.precision=r+6,t.rounding=1,e=new t(1).minus(e).div(e.plus(1)).sqrt().atan(),t.precision=r,t.rounding=a,e.times(2))},ae.inverseHyperbolicCosine=ae.acosh=function(){var e,t,n=this,r=n.constructor;return n.lte(1)?new r(n.eq(1)?0:NaN):n.isFinite()?(e=r.precision,t=r.rounding,r.precision=e+Math.max(Math.abs(n.e),n.sd())+4,r.rounding=1,Me=!1,n=n.times(n).minus(1).sqrt().plus(n),Me=!0,r.precision=e,r.rounding=t,n.ln()):new r(n)},ae.inverseHyperbolicSine=ae.asinh=function(){var e,t,n=this,r=n.constructor;return!n.isFinite()||n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+2*Math.max(Math.abs(n.e),n.sd())+6,r.rounding=1,Me=!1,n=n.times(n).plus(1).sqrt().plus(n),Me=!0,r.precision=e,r.rounding=t,n.ln())},ae.inverseHyperbolicTangent=ae.atanh=function(){var e,t,n,r,a=this,i=a.constructor;return a.isFinite()?a.e>=0?new i(a.abs().eq(1)?a.s/0:a.isZero()?a:NaN):(e=i.precision,t=i.rounding,r=a.sd(),Math.max(r,e)<2*-a.e-1?Se(new i(a),e,t,!0):(i.precision=n=r-a.e,a=ft(a.plus(1),new i(1).minus(a),n+e,1),i.precision=e+4,i.rounding=1,a=a.ln(),i.precision=e,i.rounding=t,a.times(.5))):new i(NaN)},ae.inverseSine=ae.asin=function(){var e,t,n,r,a=this,i=a.constructor;return a.isZero()?new i(a):(t=a.abs().cmp(1),n=i.precision,r=i.rounding,t!==-1?t===0?(e=qr(i,n+4,r).times(.5),e.s=a.s,e):new i(NaN):(i.precision=n+6,i.rounding=1,a=a.div(new i(1).minus(a.times(a)).sqrt().plus(1)).atan(),i.precision=n,i.rounding=r,a.times(2)))},ae.inverseTangent=ae.atan=function(){var e,t,n,r,a,i,o,s,l,u=this,c=u.constructor,f=c.precision,d=c.rounding;if(u.isFinite()){if(u.isZero())return new c(u);if(u.abs().eq(1)&&f+4<=Ap)return o=qr(c,f+4,d).times(.25),o.s=u.s,o}else{if(!u.s)return new c(NaN);if(f+4<=Ap)return o=qr(c,f+4,d).times(.5),o.s=u.s,o}for(c.precision=s=f+10,c.rounding=1,n=Math.min(28,s/Ae+2|0),e=n;e;--e)u=u.div(u.times(u).plus(1).sqrt().plus(1));for(Me=!1,t=Math.ceil(s/Ae),r=1,l=u.times(u),o=new c(u),a=u;e!==-1;)if(a=a.times(l),i=o.minus(a.div(r+=2)),a=a.times(l),o=i.plus(a.div(r+=2)),o.d[t]!==void 0)for(e=t;o.d[e]===i.d[e]&&e--;);return n&&(o=o.times(2<<n-1)),Me=!0,Se(o,c.precision=f,c.rounding=d,!0)},ae.isFinite=function(){return!!this.d},ae.isInteger=ae.isInt=function(){return!!this.d&&pn(this.e/Ae)>this.d.length-2},ae.isNaN=function(){return!this.s},ae.isNegative=ae.isNeg=function(){return this.s<0},ae.isPositive=ae.isPos=function(){return this.s>0},ae.isZero=function(){return!!this.d&&this.d[0]===0},ae.lessThan=ae.lt=function(e){return this.cmp(e)<0},ae.lessThanOrEqualTo=ae.lte=function(e){return this.cmp(e)<1},ae.logarithm=ae.log=function(e){var t,n,r,a,i,o,s,l,u=this,c=u.constructor,f=c.precision,d=c.rounding,h=5;if(e==null)e=new c(10),t=!0;else{if(e=new c(e),n=e.d,e.s<0||!n||!n[0]||e.eq(1))return new c(NaN);t=e.eq(10)}if(n=u.d,u.s<0||!n||!n[0]||u.eq(1))return new c(n&&!n[0]?-1/0:u.s!=1?NaN:n?0:1/0);if(t)if(n.length>1)i=!0;else{for(a=n[0];a%10===0;)a/=10;i=a!==1}if(Me=!1,s=f+h,o=fi(u,s),r=t?Ef(c,s+10):fi(e,s),l=ft(o,r,s,1),Xl(l.d,a=f,d))do if(s+=10,o=fi(u,s),r=t?Ef(c,s+10):fi(e,s),l=ft(o,r,s,1),!i){+sn(l.d).slice(a+1,a+15)+1==1e14&&(l=Se(l,f+1,0));break}while(Xl(l.d,a+=10,d));return Me=!0,Se(l,f,d)},ae.minus=ae.sub=function(e){var t,n,r,a,i,o,s,l,u,c,f,d,h=this,g=h.constructor;if(e=new g(e),!h.d||!e.d)return!h.s||!e.s?e=new g(NaN):h.d?e.s=-e.s:e=new g(e.d||h.s!==e.s?h:NaN),e;if(h.s!=e.s)return e.s=-e.s,h.plus(e);if(u=h.d,d=e.d,s=g.precision,l=g.rounding,!u[0]||!d[0]){if(d[0])e.s=-e.s;else if(u[0])e=new g(h);else return new g(l===3?-0:0);return Me?Se(e,s,l):e}if(n=pn(e.e/Ae),c=pn(h.e/Ae),u=u.slice(),i=c-n,i){for(f=i<0,f?(t=u,i=-i,o=d.length):(t=d,n=c,o=u.length),r=Math.max(Math.ceil(s/Ae),o)+2,i>r&&(i=r,t.length=1),t.reverse(),r=i;r--;)t.push(0);t.reverse()}else{for(r=u.length,o=d.length,f=r<o,f&&(o=r),r=0;r<o;r++)if(u[r]!=d[r]){f=u[r]<d[r];break}i=0}for(f&&(t=u,u=d,d=t,e.s=-e.s),o=u.length,r=d.length-o;r>0;--r)u[o++]=0;for(r=d.length;r>i;){if(u[--r]<d[r]){for(a=r;a&&u[--a]===0;)u[a]=Cr-1;--u[a],u[r]+=Cr}u[r]-=d[r]}for(;u[--o]===0;)u.pop();for(;u[0]===0;u.shift())--n;return u[0]?(e.d=u,e.e=xf(u,n),Me?Se(e,s,l):e):new g(l===3?-0:0)},ae.modulo=ae.mod=function(e){var t,n=this,r=n.constructor;return e=new r(e),!n.d||!e.s||e.d&&!e.d[0]?new r(NaN):!e.d||n.d&&!n.d[0]?Se(new r(n),r.precision,r.rounding):(Me=!1,r.modulo==9?(t=ft(n,e.abs(),0,3,1),t.s*=e.s):t=ft(n,e,0,r.modulo,1),t=t.times(e),Me=!0,n.minus(t))},ae.naturalExponential=ae.exp=function(){return Cp(this)},ae.naturalLogarithm=ae.ln=function(){return fi(this)},ae.negated=ae.neg=function(){var e=new this.constructor(this);return e.s=-e.s,Se(e)},ae.plus=ae.add=function(e){var t,n,r,a,i,o,s,l,u,c,f=this,d=f.constructor;if(e=new d(e),!f.d||!e.d)return!f.s||!e.s?e=new d(NaN):f.d||(e=new d(e.d||f.s===e.s?f:NaN)),e;if(f.s!=e.s)return e.s=-e.s,f.minus(e);if(u=f.d,c=e.d,s=d.precision,l=d.rounding,!u[0]||!c[0])return c[0]||(e=new d(f)),Me?Se(e,s,l):e;if(i=pn(f.e/Ae),r=pn(e.e/Ae),u=u.slice(),a=i-r,a){for(a<0?(n=u,a=-a,o=c.length):(n=c,r=i,o=u.length),i=Math.ceil(s/Ae),o=i>o?i+1:o+1,a>o&&(a=o,n.length=1),n.reverse();a--;)n.push(0);n.reverse()}for(o=u.length,a=c.length,o-a<0&&(a=o,n=c,c=u,u=n),t=0;a;)t=(u[--a]=u[a]+c[a]+t)/Cr|0,u[a]%=Cr;for(t&&(u.unshift(t),++r),o=u.length;u[--o]==0;)u.pop();return e.d=u,e.e=xf(u,r),Me?Se(e,s,l):e},ae.precision=ae.sd=function(e){var t,n=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(ui+e);return n.d?(t=_S(n.d),e&&n.e+1>t&&(t=n.e+1)):t=NaN,t},ae.round=function(){var e=this,t=e.constructor;return Se(new t(e),e.e+1,t.rounding)},ae.sine=ae.sin=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+Math.max(n.e,n.sd())+Ae,r.rounding=1,n=e_(r,RS(r,n)),r.precision=e,r.rounding=t,Se(Sa>2?n.neg():n,e,t,!0)):new r(NaN)},ae.squareRoot=ae.sqrt=function(){var e,t,n,r,a,i,o=this,s=o.d,l=o.e,u=o.s,c=o.constructor;if(u!==1||!s||!s[0])return new c(!u||u<0&&(!s||s[0])?NaN:s?o:1/0);for(Me=!1,u=Math.sqrt(+o),u==0||u==1/0?(t=sn(s),(t.length+l)%2==0&&(t+="0"),u=Math.sqrt(t),l=pn((l+1)/2)-(l<0||l%2),u==1/0?t="5e"+l:(t=u.toExponential(),t=t.slice(0,t.indexOf("e")+1)+l),r=new c(t)):r=new c(u.toString()),n=(l=c.precision)+3;;)if(i=r,r=i.plus(ft(o,i,n+2,1)).times(.5),sn(i.d).slice(0,n)===(t=sn(r.d)).slice(0,n))if(t=t.slice(n-3,n+1),t=="9999"||!a&&t=="4999"){if(!a&&(Se(i,l+1,0),i.times(i).eq(o))){r=i;break}n+=4,a=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(Se(r,l+1,1),e=!r.times(r).eq(o));break}return Me=!0,Se(r,l,c.rounding,e)},ae.tangent=ae.tan=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+10,r.rounding=1,n=n.sin(),n.s=1,n=ft(n,new r(1).minus(n.times(n)).sqrt(),e+10,0),r.precision=e,r.rounding=t,Se(Sa==2||Sa==4?n.neg():n,e,t,!0)):new r(NaN)},ae.times=ae.mul=function(e){var t,n,r,a,i,o,s,l,u,c=this,f=c.constructor,d=c.d,h=(e=new f(e)).d;if(e.s*=c.s,!d||!d[0]||!h||!h[0])return new f(!e.s||d&&!d[0]&&!h||h&&!h[0]&&!d?NaN:!d||!h?e.s/0:e.s*0);for(n=pn(c.e/Ae)+pn(e.e/Ae),l=d.length,u=h.length,l<u&&(i=d,d=h,h=i,o=l,l=u,u=o),i=[],o=l+u,r=o;r--;)i.push(0);for(r=u;--r>=0;){for(t=0,a=l+r;a>r;)s=i[a]+h[r]*d[a-r-1]+t,i[a--]=s%Cr|0,t=s/Cr|0;i[a]=(i[a]+t)%Cr|0}for(;!i[--o];)i.pop();return t?++n:i.shift(),e.d=i,e.e=xf(i,n),Me?Se(e,f.precision,f.rounding):e},ae.toBinary=function(e,t){return Tp(this,2,e,t)},ae.toDecimalPlaces=ae.toDP=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(On(e,0,li),t===void 0?t=r.rounding:On(t,0,8),Se(n,e+n.e+1,t))},ae.toExponential=function(e,t){var n,r=this,a=r.constructor;return e===void 0?n=Hr(r,!0):(On(e,0,li),t===void 0?t=a.rounding:On(t,0,8),r=Se(new a(r),e+1,t),n=Hr(r,!0,e+1)),r.isNeg()&&!r.isZero()?"-"+n:n},ae.toFixed=function(e,t){var n,r,a=this,i=a.constructor;return e===void 0?n=Hr(a):(On(e,0,li),t===void 0?t=i.rounding:On(t,0,8),r=Se(new i(a),e+a.e+1,t),n=Hr(r,!1,e+r.e+1)),a.isNeg()&&!a.isZero()?"-"+n:n},ae.toFraction=function(e){var t,n,r,a,i,o,s,l,u,c,f,d,h=this,g=h.d,m=h.constructor;if(!g)return new m(h);if(u=n=new m(1),r=l=new m(0),t=new m(r),i=t.e=_S(g)-h.e-1,o=i%Ae,t.d[0]=Xt(10,o<0?Ae+o:o),e==null)e=i>0?t:u;else{if(s=new m(e),!s.isInt()||s.lt(u))throw Error(ui+s);e=s.gt(t)?i>0?t:u:s}for(Me=!1,s=new m(sn(g)),c=m.precision,m.precision=i=g.length*Ae*2;f=ft(s,t,0,1,1),a=n.plus(f.times(r)),a.cmp(e)!=1;)n=r,r=a,a=u,u=l.plus(f.times(a)),l=a,a=t,t=s.minus(f.times(a)),s=a;return a=ft(e.minus(n),r,0,1,1),l=l.plus(a.times(u)),n=n.plus(a.times(r)),l.s=u.s=h.s,d=ft(u,r,i,1).minus(h).abs().cmp(ft(l,n,i,1).minus(h).abs())<1?[u,r]:[l,n],m.precision=c,Me=!0,d},ae.toHexadecimal=ae.toHex=function(e,t){return Tp(this,16,e,t)},ae.toNearest=function(e,t){var n=this,r=n.constructor;if(n=new r(n),e==null){if(!n.d)return n;e=new r(1),t=r.rounding}else{if(e=new r(e),t===void 0?t=r.rounding:On(t,0,8),!n.d)return e.s?n:e;if(!e.d)return e.s&&(e.s=n.s),e}return e.d[0]?(Me=!1,n=ft(n,e,0,t,1).times(e),Me=!0,Se(n)):(e.s=n.s,n=e),n},ae.toNumber=function(){return+this},ae.toOctal=function(e,t){return Tp(this,8,e,t)},ae.toPower=ae.pow=function(e){var t,n,r,a,i,o,s=this,l=s.constructor,u=+(e=new l(e));if(!s.d||!e.d||!s.d[0]||!e.d[0])return new l(Xt(+s,u));if(s=new l(s),s.eq(1))return s;if(r=l.precision,i=l.rounding,e.eq(1))return Se(s,r,i);if(t=pn(e.e/Ae),t>=e.d.length-1&&(n=u<0?-u:u)<=KM)return a=NS(l,s,n,r),e.s<0?new l(1).div(a):Se(a,r,i);if(o=s.s,o<0){if(t<e.d.length-1)return new l(NaN);if(e.d[t]&1||(o=1),s.e==0&&s.d[0]==1&&s.d.length==1)return s.s=o,s}return n=Xt(+s,u),t=n==0||!isFinite(n)?pn(u*(Math.log("0."+sn(s.d))/Math.LN10+s.e+1)):new l(n+"").e,t>l.maxE+1||t<l.minE-1?new l(t>0?o/0:0):(Me=!1,l.rounding=s.s=1,n=Math.min(12,(t+"").length),a=Cp(e.times(fi(s,r+n)),r),a.d&&(a=Se(a,r+5,1),Xl(a.d,r,i)&&(t=r+10,a=Se(Cp(e.times(fi(s,t+n)),t),t+5,1),+sn(a.d).slice(r+1,r+15)+1==1e14&&(a=Se(a,r+1,0)))),a.s=o,Me=!0,l.rounding=i,Se(a,r,i))},ae.toPrecision=function(e,t){var n,r=this,a=r.constructor;return e===void 0?n=Hr(r,r.e<=a.toExpNeg||r.e>=a.toExpPos):(On(e,1,li),t===void 0?t=a.rounding:On(t,0,8),r=Se(new a(r),e,t),n=Hr(r,e<=r.e||r.e<=a.toExpNeg,e)),r.isNeg()&&!r.isZero()?"-"+n:n},ae.toSignificantDigits=ae.toSD=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(On(e,1,li),t===void 0?t=r.rounding:On(t,0,8)),Se(new r(n),e,t)},ae.toString=function(){var e=this,t=e.constructor,n=Hr(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+n:n},ae.truncated=ae.trunc=function(){return Se(new this.constructor(this),this.e+1,1)},ae.valueOf=ae.toJSON=function(){var e=this,t=e.constructor,n=Hr(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+n:n};function sn(e){var t,n,r,a=e.length-1,i="",o=e[0];if(a>0){for(i+=o,t=1;t<a;t++)r=e[t]+"",n=Ae-r.length,n&&(i+=ci(n)),i+=r;o=e[t],r=o+"",n=Ae-r.length,n&&(i+=ci(n))}else if(o===0)return"0";for(;o%10===0;)o/=10;return i+o}function On(e,t,n){if(e!==~~e||e<t||e>n)throw Error(ui+e)}function Xl(e,t,n,r){var a,i,o,s;for(i=e[0];i>=10;i/=10)--t;return--t<0?(t+=Ae,a=0):(a=Math.ceil((t+1)/Ae),t%=Ae),i=Xt(10,Ae-t),s=e[a]%i|0,r==null?t<3?(t==0?s=s/100|0:t==1&&(s=s/10|0),o=n<4&&s==99999||n>3&&s==49999||s==5e4||s==0):o=(n<4&&s+1==i||n>3&&s+1==i/2)&&(e[a+1]/i/100|0)==Xt(10,t-2)-1||(s==i/2||s==0)&&(e[a+1]/i/100|0)==0:t<4?(t==0?s=s/1e3|0:t==1?s=s/100|0:t==2&&(s=s/10|0),o=(r||n<4)&&s==9999||!r&&n>3&&s==4999):o=((r||n<4)&&s+1==i||!r&&n>3&&s+1==i/2)&&(e[a+1]/i/1e3|0)==Xt(10,t-3)-1,o}function wf(e,t,n){for(var r,a=[0],i,o=0,s=e.length;o<s;){for(i=a.length;i--;)a[i]*=t;for(a[0]+=xp.indexOf(e.charAt(o++)),r=0;r<a.length;r++)a[r]>n-1&&(a[r+1]===void 0&&(a[r+1]=0),a[r+1]+=a[r]/n|0,a[r]%=n)}return a.reverse()}function WM(e,t){var n,r,a;if(t.isZero())return t;r=t.d.length,r<32?(n=Math.ceil(r/3),a=(1/Cf(4,n)).toString()):(n=16,a="2.3283064365386962890625e-10"),e.precision+=n,t=fs(e,1,t.times(a),new e(1));for(var i=n;i--;){var o=t.times(t);t=o.times(o).minus(o).times(8).plus(1)}return e.precision-=n,t}var ft=function(){function e(r,a,i){var o,s=0,l=r.length;for(r=r.slice();l--;)o=r[l]*a+s,r[l]=o%i|0,s=o/i|0;return s&&r.unshift(s),r}function t(r,a,i,o){var s,l;if(i!=o)l=i>o?1:-1;else for(s=l=0;s<i;s++)if(r[s]!=a[s]){l=r[s]>a[s]?1:-1;break}return l}function n(r,a,i,o){for(var s=0;i--;)r[i]-=s,s=r[i]<a[i]?1:0,r[i]=s*o+r[i]-a[i];for(;!r[0]&&r.length>1;)r.shift()}return function(r,a,i,o,s,l){var u,c,f,d,h,g,m,D,p,v,y,w,E,b,S,A,C,T,M,x,N=r.constructor,O=r.s==a.s?1:-1,z=r.d,B=a.d;if(!z||!z[0]||!B||!B[0])return new N(!r.s||!a.s||(z?B&&z[0]==B[0]:!B)?NaN:z&&z[0]==0||!B?O*0:O/0);for(l?(h=1,c=r.e-a.e):(l=Cr,h=Ae,c=pn(r.e/h)-pn(a.e/h)),M=B.length,C=z.length,p=new N(O),v=p.d=[],f=0;B[f]==(z[f]||0);f++);if(B[f]>(z[f]||0)&&c--,i==null?(b=i=N.precision,o=N.rounding):s?b=i+(r.e-a.e)+1:b=i,b<0)v.push(1),g=!0;else{if(b=b/h+2|0,f=0,M==1){for(d=0,B=B[0],b++;(f<C||d)&&b--;f++)S=d*l+(z[f]||0),v[f]=S/B|0,d=S%B|0;g=d||f<C}else{for(d=l/(B[0]+1)|0,d>1&&(B=e(B,d,l),z=e(z,d,l),M=B.length,C=z.length),A=M,y=z.slice(0,M),w=y.length;w<M;)y[w++]=0;x=B.slice(),x.unshift(0),T=B[0],B[1]>=l/2&&++T;do d=0,u=t(B,y,M,w),u<0?(E=y[0],M!=w&&(E=E*l+(y[1]||0)),d=E/T|0,d>1?(d>=l&&(d=l-1),m=e(B,d,l),D=m.length,w=y.length,u=t(m,y,D,w),u==1&&(d--,n(m,M<D?x:B,D,l))):(d==0&&(u=d=1),m=B.slice()),D=m.length,D<w&&m.unshift(0),n(y,m,w,l),u==-1&&(w=y.length,u=t(B,y,M,w),u<1&&(d++,n(y,M<w?x:B,w,l))),w=y.length):u===0&&(d++,y=[0]),v[f++]=d,u&&y[0]?y[w++]=z[A]||0:(y=[z[A]],w=1);while((A++<C||y[0]!==void 0)&&b--);g=y[0]!==void 0}v[0]||v.shift()}if(h==1)p.e=c,ES=g;else{for(f=1,d=v[0];d>=10;d/=10)f++;p.e=f+c*h-1,Se(p,s?i+p.e+1:i,o,g)}return p}}();function Se(e,t,n,r){var a,i,o,s,l,u,c,f,d,h=e.constructor;e:if(t!=null){if(f=e.d,!f)return e;for(a=1,s=f[0];s>=10;s/=10)a++;if(i=t-a,i<0)i+=Ae,o=t,c=f[d=0],l=c/Xt(10,a-o-1)%10|0;else if(d=Math.ceil((i+1)/Ae),s=f.length,d>=s)if(r){for(;s++<=d;)f.push(0);c=l=0,a=1,i%=Ae,o=i-Ae+1}else break e;else{for(c=s=f[d],a=1;s>=10;s/=10)a++;i%=Ae,o=i-Ae+a,l=o<0?0:c/Xt(10,a-o-1)%10|0}if(r=r||t<0||f[d+1]!==void 0||(o<0?c:c%Xt(10,a-o-1)),u=n<4?(l||r)&&(n==0||n==(e.s<0?3:2)):l>5||l==5&&(n==4||r||n==6&&(i>0?o>0?c/Xt(10,a-o):0:f[d-1])%10&1||n==(e.s<0?8:7)),t<1||!f[0])return f.length=0,u?(t-=e.e+1,f[0]=Xt(10,(Ae-t%Ae)%Ae),e.e=-t||0):f[0]=e.e=0,e;if(i==0?(f.length=d,s=1,d--):(f.length=d+1,s=Xt(10,Ae-i),f[d]=o>0?(c/Xt(10,a-o)%Xt(10,o)|0)*s:0),u)for(;;)if(d==0){for(i=1,o=f[0];o>=10;o/=10)i++;for(o=f[0]+=s,s=1;o>=10;o/=10)s++;i!=s&&(e.e++,f[0]==Cr&&(f[0]=1));break}else{if(f[d]+=s,f[d]!=Cr)break;f[d--]=0,s=1}for(i=f.length;f[--i]===0;)f.pop()}return Me&&(e.e>h.maxE?(e.d=null,e.e=NaN):e.e<h.minE&&(e.e=0,e.d=[0])),e}function Hr(e,t,n){if(!e.isFinite())return OS(e);var r,a=e.e,i=sn(e.d),o=i.length;return t?(n&&(r=n-o)>0?i=i.charAt(0)+"."+i.slice(1)+ci(r):o>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(e.e<0?"e":"e+")+e.e):a<0?(i="0."+ci(-a-1)+i,n&&(r=n-o)>0&&(i+=ci(r))):a>=o?(i+=ci(a+1-o),n&&(r=n-a-1)>0&&(i=i+"."+ci(r))):((r=a+1)<o&&(i=i.slice(0,r)+"."+i.slice(r)),n&&(r=n-o)>0&&(a+1===o&&(i+="."),i+=ci(r))),i}function xf(e,t){var n=e[0];for(t*=Ae;n>=10;n/=10)t++;return t}function Ef(e,t,n){if(t>QM)throw Me=!0,n&&(e.precision=n),Error(AS);return Se(new e(bf),t,1,!0)}function qr(e,t,n){if(t>Ap)throw Error(AS);return Se(new e(Df),t,n,!0)}function _S(e){var t=e.length-1,n=t*Ae+1;if(t=e[t],t){for(;t%10==0;t/=10)n--;for(t=e[0];t>=10;t/=10)n++}return n}function ci(e){for(var t="";e--;)t+="0";return t}function NS(e,t,n,r){var a,i=new e(1),o=Math.ceil(r/Ae+4);for(Me=!1;;){if(n%2&&(i=i.times(t),zS(i.d,o)&&(a=!0)),n=pn(n/2),n===0){n=i.d.length-1,a&&i.d[n]===0&&++i.d[n];break}t=t.times(t),zS(t.d,o)}return Me=!0,i}function FS(e){return e.d[e.d.length-1]&1}function BS(e,t,n){for(var r,a,i=new e(t[0]),o=0;++o<t.length;){if(a=new e(t[o]),!a.s){i=a;break}r=i.cmp(a),(r===n||r===0&&i.s===n)&&(i=a)}return i}function Cp(e,t){var n,r,a,i,o,s,l,u=0,c=0,f=0,d=e.constructor,h=d.rounding,g=d.precision;if(!e.d||!e.d[0]||e.e>17)return new d(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(t==null?(Me=!1,l=g):l=t,s=new d(.03125);e.e>-2;)e=e.times(s),f+=5;for(r=Math.log(Xt(2,f))/Math.LN10*2+5|0,l+=r,n=i=o=new d(1),d.precision=l;;){if(i=Se(i.times(e),l,1),n=n.times(++c),s=o.plus(ft(i,n,l,1)),sn(s.d).slice(0,l)===sn(o.d).slice(0,l)){for(a=f;a--;)o=Se(o.times(o),l,1);if(t==null)if(u<3&&Xl(o.d,l-r,h,u))d.precision=l+=10,n=i=s=new d(1),c=0,u++;else return Se(o,d.precision=g,h,Me=!0);else return d.precision=g,o}o=s}}function fi(e,t){var n,r,a,i,o,s,l,u,c,f,d,h=1,g=10,m=e,D=m.d,p=m.constructor,v=p.rounding,y=p.precision;if(m.s<0||!D||!D[0]||!m.e&&D[0]==1&&D.length==1)return new p(D&&!D[0]?-1/0:m.s!=1?NaN:D?0:m);if(t==null?(Me=!1,c=y):c=t,p.precision=c+=g,n=sn(D),r=n.charAt(0),Math.abs(i=m.e)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)m=m.times(e),n=sn(m.d),r=n.charAt(0),h++;i=m.e,r>1?(m=new p("0."+n),i++):m=new p(r+"."+n.slice(1))}else return u=Ef(p,c+2,y).times(i+""),m=fi(new p(r+"."+n.slice(1)),c-g).plus(u),p.precision=y,t==null?Se(m,y,v,Me=!0):m;for(f=m,l=o=m=ft(m.minus(1),m.plus(1),c,1),d=Se(m.times(m),c,1),a=3;;){if(o=Se(o.times(d),c,1),u=l.plus(ft(o,new p(a),c,1)),sn(u.d).slice(0,c)===sn(l.d).slice(0,c))if(l=l.times(2),i!==0&&(l=l.plus(Ef(p,c+2,y).times(i+""))),l=ft(l,new p(h),c,1),t==null)if(Xl(l.d,c-g,v,s))p.precision=c+=g,u=o=m=ft(f.minus(1),f.plus(1),c,1),d=Se(m.times(m),c,1),a=s=1;else return Se(l,p.precision=y,v,Me=!0);else return p.precision=y,l;l=u,a+=2}}function OS(e){return String(e.s*e.s/0)}function Af(e,t){var n,r,a;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;r++);for(a=t.length;t.charCodeAt(a-1)===48;--a);if(t=t.slice(r,a),t){if(a-=r,e.e=n=n-r-1,e.d=[],r=(n+1)%Ae,n<0&&(r+=Ae),r<a){for(r&&e.d.push(+t.slice(0,r)),a-=Ae;r<a;)e.d.push(+t.slice(r,r+=Ae));t=t.slice(r),r=Ae-t.length}else r-=a;for(;r--;)t+="0";e.d.push(+t),Me&&(e.e>e.constructor.maxE?(e.d=null,e.e=NaN):e.e<e.constructor.minE&&(e.e=0,e.d=[0]))}else e.e=0,e.d=[0];return e}function JM(e,t){var n,r,a,i,o,s,l,u,c;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),MS.test(t))return Af(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(XM.test(t))n=16,t=t.toLowerCase();else if(VM.test(t))n=2;else if(ZM.test(t))n=8;else throw Error(ui+t);for(i=t.search(/p/i),i>0?(l=+t.slice(i+1),t=t.substring(2,i)):t=t.slice(2),i=t.indexOf("."),o=i>=0,r=e.constructor,o&&(t=t.replace(".",""),s=t.length,i=s-i,a=NS(r,new r(n),i,i*2)),u=wf(t,n,Cr),c=u.length-1,i=c;u[i]===0;--i)u.pop();return i<0?new r(e.s*0):(e.e=xf(u,c),e.d=u,Me=!1,o&&(e=ft(e,a,s*4)),l&&(e=e.times(Math.abs(l)<54?Xt(2,l):ds.pow(2,l))),Me=!0,e)}function e_(e,t){var n,r=t.d.length;if(r<3)return t.isZero()?t:fs(e,2,t,t);n=1.4*Math.sqrt(r),n=n>16?16:n|0,t=t.times(1/Cf(5,n)),t=fs(e,2,t,t);for(var a,i=new e(5),o=new e(16),s=new e(20);n--;)a=t.times(t),t=t.times(i.plus(a.times(o.times(a).minus(s))));return t}function fs(e,t,n,r,a){var i,o,s,l,u=e.precision,c=Math.ceil(u/Ae);for(Me=!1,l=n.times(n),s=new e(r);;){if(o=ft(s.times(l),new e(t++*t++),u,1),s=a?r.plus(o):r.minus(o),r=ft(o.times(l),new e(t++*t++),u,1),o=s.plus(r),o.d[c]!==void 0){for(i=c;o.d[i]===s.d[i]&&i--;);if(i==-1)break}i=s,s=r,r=o,o=i}return Me=!0,o.d.length=c+1,o}function Cf(e,t){for(var n=e;--t;)n*=e;return n}function RS(e,t){var n,r=t.s<0,a=qr(e,e.precision,1),i=a.times(.5);if(t=t.abs(),t.lte(i))return Sa=r?4:1,t;if(n=t.divToInt(a),n.isZero())Sa=r?3:2;else{if(t=t.minus(n.times(a)),t.lte(i))return Sa=FS(n)?r?2:3:r?4:1,t;Sa=FS(n)?r?1:4:r?3:2}return t.minus(a).abs()}function Tp(e,t,n,r){var a,i,o,s,l,u,c,f,d,h=e.constructor,g=n!==void 0;if(g?(On(n,1,li),r===void 0?r=h.rounding:On(r,0,8)):(n=h.precision,r=h.rounding),!e.isFinite())c=OS(e);else{for(c=Hr(e),o=c.indexOf("."),g?(a=2,t==16?n=n*4-3:t==8&&(n=n*3-2)):a=t,o>=0&&(c=c.replace(".",""),d=new h(1),d.e=c.length-o,d.d=wf(Hr(d),10,a),d.e=d.d.length),f=wf(c,10,a),i=l=f.length;f[--l]==0;)f.pop();if(!f[0])c=g?"0p+0":"0";else{if(o<0?i--:(e=new h(e),e.d=f,e.e=i,e=ft(e,d,n,r,0,a),f=e.d,i=e.e,u=ES),o=f[n],s=a/2,u=u||f[n+1]!==void 0,u=r<4?(o!==void 0||u)&&(r===0||r===(e.s<0?3:2)):o>s||o===s&&(r===4||u||r===6&&f[n-1]&1||r===(e.s<0?8:7)),f.length=n,u)for(;++f[--n]>a-1;)f[n]=0,n||(++i,f.unshift(1));for(l=f.length;!f[l-1];--l);for(o=0,c="";o<l;o++)c+=xp.charAt(f[o]);if(g){if(l>1)if(t==16||t==8){for(o=t==16?4:3,--l;l%o;l++)c+="0";for(f=wf(c,a,t),l=f.length;!f[l-1];--l);for(o=1,c="1.";o<l;o++)c+=xp.charAt(f[o])}else c=c.charAt(0)+"."+c.slice(1);c=c+(i<0?"p":"p+")+i}else if(i<0){for(;++i;)c="0"+c;c="0."+c}else if(++i>l)for(i-=l;i--;)c+="0";else i<l&&(c=c.slice(0,i)+"."+c.slice(i))}c=(t==16?"0x":t==2?"0b":t==8?"0o":"")+c}return e.s<0?"-"+c:c}function zS(e,t){if(e.length>t)return e.length=t,!0}function t_(e){return new this(e).abs()}function n_(e){return new this(e).acos()}function r_(e){return new this(e).acosh()}function a_(e,t){return new this(e).plus(t)}function i_(e){return new this(e).asin()}function o_(e){return new this(e).asinh()}function s_(e){return new this(e).atan()}function l_(e){return new this(e).atanh()}function u_(e,t){e=new this(e),t=new this(t);var n,r=this.precision,a=this.rounding,i=r+4;return!e.s||!t.s?n=new this(NaN):!e.d&&!t.d?(n=qr(this,i,1).times(t.s>0?.25:.75),n.s=e.s):!t.d||e.isZero()?(n=t.s<0?qr(this,r,a):new this(0),n.s=e.s):!e.d||t.isZero()?(n=qr(this,i,1).times(.5),n.s=e.s):t.s<0?(this.precision=i,this.rounding=1,n=this.atan(ft(e,t,i,1)),t=qr(this,i,1),this.precision=r,this.rounding=a,n=e.s<0?n.minus(t):n.plus(t)):n=this.atan(ft(e,t,i,1)),n}function c_(e){return new this(e).cbrt()}function f_(e){return Se(e=new this(e),e.e+1,2)}function d_(e,t,n){return new this(e).clamp(t,n)}function h_(e){if(!e||typeof e!="object")throw Error(Sf+"Object expected");var t,n,r,a=e.defaults===!0,i=["precision",1,li,"rounding",0,8,"toExpNeg",-cs,0,"toExpPos",0,cs,"maxE",0,cs,"minE",-cs,0,"modulo",0,9];for(t=0;t<i.length;t+=3)if(n=i[t],a&&(this[n]=Ep[n]),(r=e[n])!==void 0)if(pn(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(ui+n+": "+r);if(n="crypto",a&&(this[n]=Ep[n]),(r=e[n])!==void 0)if(r===!0||r===!1||r===0||r===1)if(r)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[n]=!0;else throw Error(CS);else this[n]=!1;else throw Error(ui+n+": "+r);return this}function m_(e){return new this(e).cos()}function p_(e){return new this(e).cosh()}function kS(e){var t,n,r;function a(i){var o,s,l,u=this;if(!(u instanceof a))return new a(i);if(u.constructor=a,$S(i)){u.s=i.s,Me?!i.d||i.e>a.maxE?(u.e=NaN,u.d=null):i.e<a.minE?(u.e=0,u.d=[0]):(u.e=i.e,u.d=i.d.slice()):(u.e=i.e,u.d=i.d?i.d.slice():i.d);return}if(l=typeof i,l==="number"){if(i===0){u.s=1/i<0?-1:1,u.e=0,u.d=[0];return}if(i<0?(i=-i,u.s=-1):u.s=1,i===~~i&&i<1e7){for(o=0,s=i;s>=10;s/=10)o++;Me?o>a.maxE?(u.e=NaN,u.d=null):o<a.minE?(u.e=0,u.d=[0]):(u.e=o,u.d=[i]):(u.e=o,u.d=[i]);return}if(i*0!==0){i||(u.s=NaN),u.e=NaN,u.d=null;return}return Af(u,i.toString())}if(l==="string")return(s=i.charCodeAt(0))===45?(i=i.slice(1),u.s=-1):(s===43&&(i=i.slice(1)),u.s=1),MS.test(i)?Af(u,i):JM(u,i);if(l==="bigint")return i<0?(i=-i,u.s=-1):u.s=1,Af(u,i.toString());throw Error(ui+i)}if(a.prototype=ae,a.ROUND_UP=0,a.ROUND_DOWN=1,a.ROUND_CEIL=2,a.ROUND_FLOOR=3,a.ROUND_HALF_UP=4,a.ROUND_HALF_DOWN=5,a.ROUND_HALF_EVEN=6,a.ROUND_HALF_CEIL=7,a.ROUND_HALF_FLOOR=8,a.EUCLID=9,a.config=a.set=h_,a.clone=kS,a.isDecimal=$S,a.abs=t_,a.acos=n_,a.acosh=r_,a.add=a_,a.asin=i_,a.asinh=o_,a.atan=s_,a.atanh=l_,a.atan2=u_,a.cbrt=c_,a.ceil=f_,a.clamp=d_,a.cos=m_,a.cosh=p_,a.div=g_,a.exp=v_,a.floor=y_,a.hypot=b_,a.ln=D_,a.log=S_,a.log10=x_,a.log2=w_,a.max=E_,a.min=A_,a.mod=C_,a.mul=T_,a.pow=M_,a.random=__,a.round=N_,a.sign=F_,a.sin=B_,a.sinh=O_,a.sqrt=R_,a.sub=z_,a.sum=k_,a.tan=$_,a.tanh=I_,a.trunc=U_,e===void 0&&(e={}),e&&e.defaults!==!0)for(r=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return a.config(e),a}function g_(e,t){return new this(e).div(t)}function v_(e){return new this(e).exp()}function y_(e){return Se(e=new this(e),e.e+1,3)}function b_(){var e,t,n=new this(0);for(Me=!1,e=0;e<arguments.length;)if(t=new this(arguments[e++]),t.d)n.d&&(n=n.plus(t.times(t)));else{if(t.s)return Me=!0,new this(1/0);n=t}return Me=!0,n.sqrt()}function $S(e){return e instanceof ds||e&&e.toStringTag===TS||!1}function D_(e){return new this(e).ln()}function S_(e,t){return new this(e).log(t)}function w_(e){return new this(e).log(2)}function x_(e){return new this(e).log(10)}function E_(){return BS(this,arguments,-1)}function A_(){return BS(this,arguments,1)}function C_(e,t){return new this(e).mod(t)}function T_(e,t){return new this(e).mul(t)}function M_(e,t){return new this(e).pow(t)}function __(e){var t,n,r,a,i=0,o=new this(1),s=[];if(e===void 0?e=this.precision:On(e,1,li),r=Math.ceil(e/Ae),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(r));i<r;)a=t[i],a>=429e7?t[i]=crypto.getRandomValues(new Uint32Array(1))[0]:s[i++]=a%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(r*=4);i<r;)a=t[i]+(t[i+1]<<8)+(t[i+2]<<16)+((t[i+3]&127)<<24),a>=214e7?crypto.randomBytes(4).copy(t,i):(s.push(a%1e7),i+=4);i=r/4}else throw Error(CS);else for(;i<r;)s[i++]=Math.random()*1e7|0;for(r=s[--i],e%=Ae,r&&e&&(a=Xt(10,Ae-e),s[i]=(r/a|0)*a);s[i]===0;i--)s.pop();if(i<0)n=0,s=[0];else{for(n=-1;s[0]===0;n-=Ae)s.shift();for(r=1,a=s[0];a>=10;a/=10)r++;r<Ae&&(n-=Ae-r)}return o.e=n,o.d=s,o}function N_(e){return Se(e=new this(e),e.e+1,this.rounding)}function F_(e){return e=new this(e),e.d?e.d[0]?e.s:0*e.s:e.s||NaN}function B_(e){return new this(e).sin()}function O_(e){return new this(e).sinh()}function R_(e){return new this(e).sqrt()}function z_(e,t){return new this(e).sub(t)}function k_(){var e=0,t=arguments,n=new this(t[e]);for(Me=!1;n.s&&++e<t.length;)n=n.plus(t[e]);return Me=!0,Se(n,this.precision,this.rounding)}function $_(e){return new this(e).tan()}function I_(e){return new this(e).tanh()}function U_(e){return Se(e=new this(e),e.e+1,1)}ae[Symbol.for("nodejs.util.inspect.custom")]=ae.toString,ae[Symbol.toStringTag]="Decimal";var ds=ae.constructor=kS(Ep);bf=new ds(bf),Df=new ds(Df);var L_="BigNumber",P_=["?on","config"],j_=fe(L_,P_,e=>{var{on:t,config:n}=e,r=ds.clone({precision:n.precision,modulo:ds.EUCLID});return r.prototype=Object.create(r.prototype),r.prototype.type="BigNumber",r.prototype.isBigNumber=!0,r.prototype.toJSON=function(){return{mathjs:"BigNumber",value:this.toString()}},r.fromJSON=function(a){return new r(a.value)},t&&t("config",function(a,i){a.precision!==i.precision&&r.config({precision:a.precision})}),r},{isClass:!0});const gn=Math.cosh||function(e){return Math.abs(e)<1e-9?1-e:(Math.exp(e)+Math.exp(-e))*.5},hr=Math.sinh||function(e){return Math.abs(e)<1e-9?e:(Math.exp(e)-Math.exp(-e))*.5},H_=function(e){const t=Math.PI/4;if(-t>e||e>t)return Math.cos(e)-1;const n=e*e;return n*(n*(n*(n*(n*(n*(n*(n/20922789888e3-1/87178291200)+1/479001600)-1/3628800)+1/40320)-1/720)+1/24)-1/2)},Mp=function(e,t){return e=Math.abs(e),t=Math.abs(t),e<t&&([e,t]=[t,e]),e<1e8?Math.sqrt(e*e+t*t):(t/=e,e*Math.sqrt(1+t*t))},hs=function(){throw SyntaxError("Invalid Param")};function _p(e,t){const n=Math.abs(e),r=Math.abs(t);return e===0?Math.log(r):t===0?Math.log(n):n<3e3&&r<3e3?Math.log(e*e+t*t)*.5:(e=e*.5,t=t*.5,.5*Math.log(e*e+t*t)+Math.LN2)}const q_={re:0,im:0},Yi=function(e,t){const n=q_;if(e==null)n.re=n.im=0;else if(t!==void 0)n.re=e,n.im=t;else switch(typeof e){case"object":if("im"in e&&"re"in e)n.re=e.re,n.im=e.im;else if("abs"in e&&"arg"in e){if(!isFinite(e.abs)&&isFinite(e.arg))return K.INFINITY;n.re=e.abs*Math.cos(e.arg),n.im=e.abs*Math.sin(e.arg)}else if("r"in e&&"phi"in e){if(!isFinite(e.r)&&isFinite(e.phi))return K.INFINITY;n.re=e.r*Math.cos(e.phi),n.im=e.r*Math.sin(e.phi)}else e.length===2?(n.re=e[0],n.im=e[1]):hs();break;case"string":n.im=n.re=0;const r=e.replace(/_/g,"").match(/\d+\.?\d*e[+-]?\d+|\d+\.?\d*|\.\d+|./g);let a=1,i=0;r===null&&hs();for(let o=0;o<r.length;o++){const s=r[o];s===" "||s===" "||s===`
75
- `||(s==="+"?a++:s==="-"?i++:s==="i"||s==="I"?(a+i===0&&hs(),r[o+1]!==" "&&!isNaN(r[o+1])?(n.im+=parseFloat((i%2?"-":"")+r[o+1]),o++):n.im+=parseFloat((i%2?"-":"")+"1"),a=i=0):((a+i===0||isNaN(s))&&hs(),r[o+1]==="i"||r[o+1]==="I"?(n.im+=parseFloat((i%2?"-":"")+s),o++):n.re+=parseFloat((i%2?"-":"")+s),a=i=0))}a+i>0&&hs();break;case"number":n.im=0,n.re=e;break;default:hs()}return isNaN(n.re)||isNaN(n.im),n};function K(e,t){if(!(this instanceof K))return new K(e,t);const n=Yi(e,t);this.re=n.re,this.im=n.im}K.prototype={re:0,im:0,sign:function(){const e=Mp(this.re,this.im);return new K(this.re/e,this.im/e)},add:function(e,t){const n=Yi(e,t),r=this.isInfinite(),a=!(isFinite(n.re)&&isFinite(n.im));return r||a?r&&a?K.NAN:K.INFINITY:new K(this.re+n.re,this.im+n.im)},sub:function(e,t){const n=Yi(e,t),r=this.isInfinite(),a=!(isFinite(n.re)&&isFinite(n.im));return r||a?r&&a?K.NAN:K.INFINITY:new K(this.re-n.re,this.im-n.im)},mul:function(e,t){const n=Yi(e,t),r=this.isInfinite(),a=!(isFinite(n.re)&&isFinite(n.im)),i=this.re===0&&this.im===0,o=n.re===0&&n.im===0;return r&&o||a&&i?K.NAN:r||a?K.INFINITY:n.im===0&&this.im===0?new K(this.re*n.re,0):new K(this.re*n.re-this.im*n.im,this.re*n.im+this.im*n.re)},div:function(e,t){const n=Yi(e,t),r=this.isInfinite(),a=!(isFinite(n.re)&&isFinite(n.im)),i=this.re===0&&this.im===0,o=n.re===0&&n.im===0;if(i&&o||r&&a)return K.NAN;if(o||r)return K.INFINITY;if(i||a)return K.ZERO;if(n.im===0)return new K(this.re/n.re,this.im/n.re);if(Math.abs(n.re)<Math.abs(n.im)){const s=n.re/n.im,l=n.re*s+n.im;return new K((this.re*s+this.im)/l,(this.im*s-this.re)/l)}else{const s=n.im/n.re,l=n.im*s+n.re;return new K((this.re+this.im*s)/l,(this.im-this.re*s)/l)}},pow:function(e,t){const n=Yi(e,t),r=this.re===0&&this.im===0;if(n.re===0&&n.im===0)return K.ONE;if(n.im===0){if(this.im===0&&this.re>0)return new K(Math.pow(this.re,n.re),0);if(this.re===0)switch((n.re%4+4)%4){case 0:return new K(Math.pow(this.im,n.re),0);case 1:return new K(0,Math.pow(this.im,n.re));case 2:return new K(-Math.pow(this.im,n.re),0);case 3:return new K(0,-Math.pow(this.im,n.re))}}if(r&&n.re>0)return K.ZERO;const i=Math.atan2(this.im,this.re),o=_p(this.re,this.im);let s=Math.exp(n.re*o-n.im*i),l=n.im*o+n.re*i;return new K(s*Math.cos(l),s*Math.sin(l))},sqrt:function(){const e=this.re,t=this.im;if(t===0)return e>=0?new K(Math.sqrt(e),0):new K(0,Math.sqrt(-e));const n=Mp(e,t);let r=Math.sqrt(.5*(n+Math.abs(e))),a=Math.abs(t)/(2*r);return e>=0?new K(r,t<0?-a:a):new K(a,t<0?-r:r)},exp:function(){const e=Math.exp(this.re);return this.im===0?new K(e,0):new K(e*Math.cos(this.im),e*Math.sin(this.im))},expm1:function(){const e=this.re,t=this.im;return new K(Math.expm1(e)*Math.cos(t)+H_(t),Math.exp(e)*Math.sin(t))},log:function(){const e=this.re,t=this.im;return t===0&&e>0?new K(Math.log(e),0):new K(_p(e,t),Math.atan2(t,e))},abs:function(){return Mp(this.re,this.im)},arg:function(){return Math.atan2(this.im,this.re)},sin:function(){const e=this.re,t=this.im;return new K(Math.sin(e)*gn(t),Math.cos(e)*hr(t))},cos:function(){const e=this.re,t=this.im;return new K(Math.cos(e)*gn(t),-Math.sin(e)*hr(t))},tan:function(){const e=2*this.re,t=2*this.im,n=Math.cos(e)+gn(t);return new K(Math.sin(e)/n,hr(t)/n)},cot:function(){const e=2*this.re,t=2*this.im,n=Math.cos(e)-gn(t);return new K(-Math.sin(e)/n,hr(t)/n)},sec:function(){const e=this.re,t=this.im,n=.5*gn(2*t)+.5*Math.cos(2*e);return new K(Math.cos(e)*gn(t)/n,Math.sin(e)*hr(t)/n)},csc:function(){const e=this.re,t=this.im,n=.5*gn(2*t)-.5*Math.cos(2*e);return new K(Math.sin(e)*gn(t)/n,-Math.cos(e)*hr(t)/n)},asin:function(){const e=this.re,t=this.im,n=new K(t*t-e*e+1,-2*e*t).sqrt(),r=new K(n.re-t,n.im+e).log();return new K(r.im,-r.re)},acos:function(){const e=this.re,t=this.im,n=new K(t*t-e*e+1,-2*e*t).sqrt(),r=new K(n.re-t,n.im+e).log();return new K(Math.PI/2-r.im,r.re)},atan:function(){const e=this.re,t=this.im;if(e===0){if(t===1)return new K(0,1/0);if(t===-1)return new K(0,-1/0)}const n=e*e+(1-t)*(1-t),r=new K((1-t*t-e*e)/n,-2*e/n).log();return new K(-.5*r.im,.5*r.re)},acot:function(){const e=this.re,t=this.im;if(t===0)return new K(Math.atan2(1,e),0);const n=e*e+t*t;return n!==0?new K(e/n,-t/n).atan():new K(e!==0?e/0:0,t!==0?-t/0:0).atan()},asec:function(){const e=this.re,t=this.im;if(e===0&&t===0)return new K(0,1/0);const n=e*e+t*t;return n!==0?new K(e/n,-t/n).acos():new K(e!==0?e/0:0,t!==0?-t/0:0).acos()},acsc:function(){const e=this.re,t=this.im;if(e===0&&t===0)return new K(Math.PI/2,1/0);const n=e*e+t*t;return n!==0?new K(e/n,-t/n).asin():new K(e!==0?e/0:0,t!==0?-t/0:0).asin()},sinh:function(){const e=this.re,t=this.im;return new K(hr(e)*Math.cos(t),gn(e)*Math.sin(t))},cosh:function(){const e=this.re,t=this.im;return new K(gn(e)*Math.cos(t),hr(e)*Math.sin(t))},tanh:function(){const e=2*this.re,t=2*this.im,n=gn(e)+Math.cos(t);return new K(hr(e)/n,Math.sin(t)/n)},coth:function(){const e=2*this.re,t=2*this.im,n=gn(e)-Math.cos(t);return new K(hr(e)/n,-Math.sin(t)/n)},csch:function(){const e=this.re,t=this.im,n=Math.cos(2*t)-gn(2*e);return new K(-2*hr(e)*Math.cos(t)/n,2*gn(e)*Math.sin(t)/n)},sech:function(){const e=this.re,t=this.im,n=Math.cos(2*t)+gn(2*e);return new K(2*gn(e)*Math.cos(t)/n,-2*hr(e)*Math.sin(t)/n)},asinh:function(){let e=this.im;this.im=-this.re,this.re=e;const t=this.asin();return this.re=-this.im,this.im=e,e=t.re,t.re=-t.im,t.im=e,t},acosh:function(){const e=this.acos();if(e.im<=0){const t=e.re;e.re=-e.im,e.im=t}else{const t=e.im;e.im=-e.re,e.re=t}return e},atanh:function(){const e=this.re,t=this.im,n=e>1&&t===0,r=1-e,a=1+e,i=r*r+t*t,o=i!==0?new K((a*r-t*t)/i,(t*r+a*t)/i):new K(e!==-1?e/0:0,t!==0?t/0:0),s=o.re;return o.re=_p(o.re,o.im)/2,o.im=Math.atan2(o.im,s)/2,n&&(o.im=-o.im),o},acoth:function(){const e=this.re,t=this.im;if(e===0&&t===0)return new K(0,Math.PI/2);const n=e*e+t*t;return n!==0?new K(e/n,-t/n).atanh():new K(e!==0?e/0:0,t!==0?-t/0:0).atanh()},acsch:function(){const e=this.re,t=this.im;if(t===0)return new K(e!==0?Math.log(e+Math.sqrt(e*e+1)):1/0,0);const n=e*e+t*t;return n!==0?new K(e/n,-t/n).asinh():new K(e!==0?e/0:0,t!==0?-t/0:0).asinh()},asech:function(){const e=this.re,t=this.im;if(this.isZero())return K.INFINITY;const n=e*e+t*t;return n!==0?new K(e/n,-t/n).acosh():new K(e!==0?e/0:0,t!==0?-t/0:0).acosh()},inverse:function(){if(this.isZero())return K.INFINITY;if(this.isInfinite())return K.ZERO;const e=this.re,t=this.im,n=e*e+t*t;return new K(e/n,-t/n)},conjugate:function(){return new K(this.re,-this.im)},neg:function(){return new K(-this.re,-this.im)},ceil:function(e){return e=Math.pow(10,e||0),new K(Math.ceil(this.re*e)/e,Math.ceil(this.im*e)/e)},floor:function(e){return e=Math.pow(10,e||0),new K(Math.floor(this.re*e)/e,Math.floor(this.im*e)/e)},round:function(e){return e=Math.pow(10,e||0),new K(Math.round(this.re*e)/e,Math.round(this.im*e)/e)},equals:function(e,t){const n=Yi(e,t);return Math.abs(n.re-this.re)<=K.EPSILON&&Math.abs(n.im-this.im)<=K.EPSILON},clone:function(){return new K(this.re,this.im)},toString:function(){let e=this.re,t=this.im,n="";return this.isNaN()?"NaN":this.isInfinite()?"Infinity":(Math.abs(e)<K.EPSILON&&(e=0),Math.abs(t)<K.EPSILON&&(t=0),t===0?n+e:(e!==0?(n+=e,n+=" ",t<0?(t=-t,n+="-"):n+="+",n+=" "):t<0&&(t=-t,n+="-"),t!==1&&(n+=t),n+"i"))},toVector:function(){return[this.re,this.im]},valueOf:function(){return this.im===0?this.re:null},isNaN:function(){return isNaN(this.re)||isNaN(this.im)},isZero:function(){return this.im===0&&this.re===0},isFinite:function(){return isFinite(this.re)&&isFinite(this.im)},isInfinite:function(){return!this.isFinite()}},K.ZERO=new K(0,0),K.ONE=new K(1,0),K.I=new K(0,1),K.PI=new K(Math.PI,0),K.E=new K(Math.E,0),K.INFINITY=new K(1/0,1/0),K.NAN=new K(NaN,NaN),K.EPSILON=1e-15;var Y_="Complex",G_=[],V_=fe(Y_,G_,()=>(Object.defineProperty(K,"name",{value:"Complex"}),K.prototype.constructor=K,K.prototype.type="Complex",K.prototype.isComplex=!0,K.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},K.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},K.prototype.format=function(e){var t="",n=this.im,r=this.re,a=wp(this.re,e),i=wp(this.im,e),o=ct(e)?e:e?e.precision:null;if(o!==null){var s=Math.pow(10,-o);Math.abs(r/n)<s&&(r=0),Math.abs(n/r)<s&&(n=0)}return n===0?t=a:r===0?n===1?t="i":n===-1?t="-i":t=i+"i":n<0?n===-1?t=a+" - i":t=a+" - "+i.substring(1)+"i":n===1?t=a+" + i":t=a+" + "+i+"i",t},K.fromPolar=function(e){switch(arguments.length){case 1:{var t=arguments[0];if(typeof t=="object")return K(t);throw new TypeError("Input has to be an object with r and phi keys.")}case 2:{var n=arguments[0],r=arguments[1];if(ct(n)){if(fS(r)&&r.hasBase("ANGLE")&&(r=r.toNumber("rad")),ct(r))return new K({r:n,phi:r});throw new TypeError("Phi is not a number nor an angle unit.")}else throw new TypeError("Radius r is not a number.")}default:throw new SyntaxError("Wrong number of arguments in function fromPolar")}},K.prototype.valueOf=K.prototype.toString,K.fromJSON=function(e){return new K(e)},K.compare=function(e,t){return e.re>t.re?1:e.re<t.re?-1:e.im>t.im?1:e.im<t.im?-1:0},K),{isClass:!0});typeof BigInt>"u"&&(BigInt=function(e){if(isNaN(e))throw new Error("");return e});const ye=BigInt(0),Re=BigInt(1),Jt=BigInt(2),Zl=BigInt(3),ms=BigInt(5),Rn=BigInt(10);BigInt(Number.MAX_SAFE_INTEGER);const X_=2e3,he={s:Re,n:ye,d:Re};function wa(e,t){try{e=BigInt(e)}catch{throw di()}return e*t}function Tr(e){return typeof e=="bigint"?e:Math.floor(e)}function At(e,t){if(t===ye)throw Np();const n=Object.create(mr.prototype);n.s=e<ye?-Re:Re,e=e<ye?-e:e;const r=Gi(e,t);return n.n=e/r,n.d=t/r,n}const Z_=[Jt*Jt,Jt,Jt*Jt,Jt,Jt*Jt,Jt*Zl,Jt,Jt*Zl];function ps(e){const t=Object.create(null);if(e<=Re)return t[e]=Re,t;const n=r=>{t[r]=(t[r]||ye)+Re};for(;e%Jt===ye;)n(Jt),e/=Jt;for(;e%Zl===ye;)n(Zl),e/=Zl;for(;e%ms===ye;)n(ms),e/=ms;for(let r=0,a=Jt+ms;a*a<=e;){for(;e%a===ye;)n(a),e/=a;a+=Z_[r],r=r+1&7}return e>Re&&n(e),t}const en=function(e,t){let n=ye,r=Re,a=Re;if(e!=null)if(t!==void 0){if(typeof e=="bigint")n=e;else{if(isNaN(e))throw di();if(e%1!==0)throw IS();n=BigInt(e)}if(typeof t=="bigint")r=t;else{if(isNaN(t))throw di();if(t%1!==0)throw IS();r=BigInt(t)}a=n*r}else if(typeof e=="object"){if("d"in e&&"n"in e)n=BigInt(e.n),r=BigInt(e.d),"s"in e&&(n*=BigInt(e.s));else if(0 in e)n=BigInt(e[0]),1 in e&&(r=BigInt(e[1]));else if(typeof e=="bigint")n=e;else throw di();a=n*r}else if(typeof e=="number"){if(isNaN(e))throw di();if(e<0&&(a=-Re,e=-e),e%1===0)n=BigInt(e);else{let i=1,o=0,s=1,l=1,u=1,c=1e7;for(e>=1&&(i=10**Math.floor(1+Math.log10(e)),e/=i);s<=c&&u<=c;){let f=(o+l)/(s+u);if(e===f){s+u<=c?(n=o+l,r=s+u):u>s?(n=l,r=u):(n=o,r=s);break}else e>f?(o+=l,s+=u):(l+=o,u+=s),s>c?(n=l,r=u):(n=o,r=s)}n=BigInt(n)*BigInt(i),r=BigInt(r)}}else if(typeof e=="string"){let i=0,o=ye,s=ye,l=ye,u=Re,c=Re,f=e.replace(/_/g,"").match(/\d+|./g);if(f===null)throw di();if(f[i]==="-"?(a=-Re,i++):f[i]==="+"&&i++,f.length===i+1?s=wa(f[i++],a):f[i+1]==="."||f[i]==="."?(f[i]!=="."&&(o=wa(f[i++],a)),i++,(i+1===f.length||f[i+1]==="("&&f[i+3]===")"||f[i+1]==="'"&&f[i+3]==="'")&&(s=wa(f[i],a),u=Rn**BigInt(f[i].length),i++),(f[i]==="("&&f[i+2]===")"||f[i]==="'"&&f[i+2]==="'")&&(l=wa(f[i+1],a),c=Rn**BigInt(f[i+1].length)-Re,i+=3)):f[i+1]==="/"||f[i+1]===":"?(s=wa(f[i],a),u=wa(f[i+2],Re),i+=3):f[i+3]==="/"&&f[i+1]===" "&&(o=wa(f[i],a),s=wa(f[i+2],a),u=wa(f[i+4],Re),i+=5),f.length<=i)r=u*c,a=n=l+r*o+c*s;else throw di()}else if(typeof e=="bigint")n=e,a=e,r=Re;else throw di();if(r===ye)throw Np();he.s=a<ye?-Re:Re,he.n=n<ye?-n:n,he.d=r<ye?-r:r};function K_(e,t,n){let r=Re;for(;t>ye;e=e*e%n,t>>=Re)t&Re&&(r=r*e%n);return r}function Q_(e,t){for(;t%Jt===ye;t/=Jt);for(;t%ms===ye;t/=ms);if(t===Re)return ye;let n=Rn%t,r=1;for(;n!==Re;r++)if(n=n*Rn%t,r>X_)return ye;return BigInt(r)}function W_(e,t,n){let r=Re,a=K_(Rn,n,t);for(let i=0;i<300;i++){if(r===a)return BigInt(i);r=r*Rn%t,a=a*Rn%t}return 0}function Gi(e,t){if(!e)return t;if(!t)return e;for(;;){if(e%=t,!e)return t;if(t%=e,!t)return e}}function mr(e,t){if(en(e,t),this instanceof mr)e=Gi(he.d,he.n),this.s=he.s,this.n=he.n/e,this.d=he.d/e;else return At(he.s*he.n,he.d)}const Np=function(){return new Error("Division by Zero")},di=function(){return new Error("Invalid argument")},IS=function(){return new Error("Parameters must be integer")};mr.prototype={s:Re,n:ye,d:Re,abs:function(){return At(this.n,this.d)},neg:function(){return At(-this.s*this.n,this.d)},add:function(e,t){return en(e,t),At(this.s*this.n*he.d+he.s*this.d*he.n,this.d*he.d)},sub:function(e,t){return en(e,t),At(this.s*this.n*he.d-he.s*this.d*he.n,this.d*he.d)},mul:function(e,t){return en(e,t),At(this.s*he.s*this.n*he.n,this.d*he.d)},div:function(e,t){return en(e,t),At(this.s*he.s*this.n*he.d,this.d*he.n)},clone:function(){return At(this.s*this.n,this.d)},mod:function(e,t){if(e===void 0)return At(this.s*this.n%this.d,Re);if(en(e,t),ye===he.n*this.d)throw Np();return At(this.s*(he.d*this.n)%(he.n*this.d),he.d*this.d)},gcd:function(e,t){return en(e,t),At(Gi(he.n,this.n)*Gi(he.d,this.d),he.d*this.d)},lcm:function(e,t){return en(e,t),he.n===ye&&this.n===ye?At(ye,Re):At(he.n*this.n,Gi(he.n,this.n)*Gi(he.d,this.d))},inverse:function(){return At(this.s*this.d,this.n)},pow:function(e,t){if(en(e,t),he.d===Re)return he.s<ye?At((this.s*this.d)**he.n,this.n**he.n):At((this.s*this.n)**he.n,this.d**he.n);if(this.s<ye)return null;let n=ps(this.n),r=ps(this.d),a=Re,i=Re;for(let o in n)if(o!=="1"){if(o==="0"){a=ye;break}if(n[o]*=he.n,n[o]%he.d===ye)n[o]/=he.d;else return null;a*=BigInt(o)**n[o]}for(let o in r)if(o!=="1"){if(r[o]*=he.n,r[o]%he.d===ye)r[o]/=he.d;else return null;i*=BigInt(o)**r[o]}return he.s<ye?At(i,a):At(a,i)},log:function(e,t){if(en(e,t),this.s<=ye||he.s<=ye)return null;const n=Object.create(null),r=ps(he.n),a=ps(he.d),i=ps(this.n),o=ps(this.d);for(const u in a)r[u]=(r[u]||ye)-a[u];for(const u in o)i[u]=(i[u]||ye)-o[u];for(const u in r)u!=="1"&&(n[u]=!0);for(const u in i)u!=="1"&&(n[u]=!0);let s=null,l=null;for(const u in n){const c=r[u]||ye,f=i[u]||ye;if(c===ye){if(f!==ye)return null;continue}let d=f,h=c;const g=Gi(d,h);if(d/=g,h/=g,s===null&&l===null)s=d,l=h;else if(d*l!==s*h)return null}return s!==null&&l!==null?At(s,l):null},equals:function(e,t){return en(e,t),this.s*this.n*he.d===he.s*he.n*this.d},lt:function(e,t){return en(e,t),this.s*this.n*he.d<he.s*he.n*this.d},lte:function(e,t){return en(e,t),this.s*this.n*he.d<=he.s*he.n*this.d},gt:function(e,t){return en(e,t),this.s*this.n*he.d>he.s*he.n*this.d},gte:function(e,t){return en(e,t),this.s*this.n*he.d>=he.s*he.n*this.d},compare:function(e,t){en(e,t);let n=this.s*this.n*he.d-he.s*he.n*this.d;return(ye<n)-(n<ye)},ceil:function(e){return e=Rn**BigInt(e||0),At(Tr(this.s*e*this.n/this.d)+(e*this.n%this.d>ye&&this.s>=ye?Re:ye),e)},floor:function(e){return e=Rn**BigInt(e||0),At(Tr(this.s*e*this.n/this.d)-(e*this.n%this.d>ye&&this.s<ye?Re:ye),e)},round:function(e){return e=Rn**BigInt(e||0),At(Tr(this.s*e*this.n/this.d)+this.s*((this.s>=ye?Re:ye)+Jt*(e*this.n%this.d)>this.d?Re:ye),e)},roundTo:function(e,t){en(e,t);const n=this.n*he.d,r=this.d*he.n,a=n%r;let i=Tr(n/r);return a+a>=r&&i++,At(this.s*i*he.n,he.d)},divisible:function(e,t){return en(e,t),he.n===ye?!1:this.n*he.d%(he.n*this.d)===ye},valueOf:function(){return Number(this.s*this.n)/Number(this.d)},toString:function(e=15){let t=this.n,n=this.d,r=Q_(t,n),a=W_(t,n,r),i=this.s<ye?"-":"";if(i+=Tr(t/n),t%=n,t*=Rn,t&&(i+="."),r){for(let o=a;o--;)i+=Tr(t/n),t%=n,t*=Rn;i+="(";for(let o=r;o--;)i+=Tr(t/n),t%=n,t*=Rn;i+=")"}else for(let o=e;t&&o--;)i+=Tr(t/n),t%=n,t*=Rn;return i},toFraction:function(e=!1){let t=this.n,n=this.d,r=this.s<ye?"-":"";if(n===Re)r+=t;else{const a=Tr(t/n);e&&a>ye&&(r+=a,r+=" ",t%=n),r+=t,r+="/",r+=n}return r},toLatex:function(e=!1){let t=this.n,n=this.d,r=this.s<ye?"-":"";if(n===Re)r+=t;else{const a=Tr(t/n);e&&a>ye&&(r+=a,t%=n),r+="\\frac{",r+=t,r+="}{",r+=n,r+="}"}return r},toContinued:function(){let e=this.n,t=this.d;const n=[];for(;t;){n.push(Tr(e/t));const r=e%t;e=t,t=r}return n},simplify:function(e=.001){const t=BigInt(Math.ceil(1/e)),n=this.abs(),r=n.toContinued();for(let a=1;a<r.length;a++){let i=At(r[a-1],Re);for(let s=a-2;s>=0;s--)i=i.inverse().add(r[s]);let o=i.sub(n);if(o.n*t<o.d)return i.mul(this.s)}return this}};var J_="Fraction",e9=[],t9=fe(J_,e9,()=>(Object.defineProperty(mr,"name",{value:"Fraction"}),mr.prototype.constructor=mr,mr.prototype.type="Fraction",mr.prototype.isFraction=!0,mr.prototype.toJSON=function(){return{mathjs:"Fraction",n:String(this.s*this.n),d:String(this.d)}},mr.fromJSON=function(e){return new mr(e)},mr),{isClass:!0}),n9="Matrix",r9=[],a9=fe(n9,r9,()=>{function e(){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator")}return e.prototype.type="Matrix",e.prototype.isMatrix=!0,e.prototype.storage=function(){throw new Error("Cannot invoke storage on a Matrix interface")},e.prototype.datatype=function(){throw new Error("Cannot invoke datatype on a Matrix interface")},e.prototype.create=function(t,n){throw new Error("Cannot invoke create on a Matrix interface")},e.prototype.subset=function(t,n,r){throw new Error("Cannot invoke subset on a Matrix interface")},e.prototype.get=function(t){throw new Error("Cannot invoke get on a Matrix interface")},e.prototype.set=function(t,n,r){throw new Error("Cannot invoke set on a Matrix interface")},e.prototype.resize=function(t,n){throw new Error("Cannot invoke resize on a Matrix interface")},e.prototype.reshape=function(t,n){throw new Error("Cannot invoke reshape on a Matrix interface")},e.prototype.clone=function(){throw new Error("Cannot invoke clone on a Matrix interface")},e.prototype.size=function(){throw new Error("Cannot invoke size on a Matrix interface")},e.prototype.map=function(t,n){throw new Error("Cannot invoke map on a Matrix interface")},e.prototype.forEach=function(t){throw new Error("Cannot invoke forEach on a Matrix interface")},e.prototype[Symbol.iterator]=function(){throw new Error("Cannot iterate a Matrix interface")},e.prototype.toArray=function(){throw new Error("Cannot invoke toArray on a Matrix interface")},e.prototype.valueOf=function(){throw new Error("Cannot invoke valueOf on a Matrix interface")},e.prototype.format=function(t){throw new Error("Cannot invoke format on a Matrix interface")},e.prototype.toString=function(){throw new Error("Cannot invoke toString on a Matrix interface")},e},{isClass:!0});function Fp(e,t,n){var r=e.constructor,a=new r(2),i="";if(n){if(n<1)throw new Error("size must be in greater than 0");if(!pt(n))throw new Error("size must be an integer");if(e.greaterThan(a.pow(n-1).sub(1))||e.lessThan(a.pow(n-1).mul(-1)))throw new Error("Value must be in range [-2^".concat(n-1,", 2^").concat(n-1,"-1]"));if(!e.isInteger())throw new Error("Value must be an integer");e.lessThan(0)&&(e=e.add(a.pow(n))),i="i".concat(n)}switch(t){case 2:return"".concat(e.toBinary()).concat(i);case 8:return"".concat(e.toOctal()).concat(i);case 16:return"".concat(e.toHexadecimal()).concat(i);default:throw new Error("Base ".concat(t," not supported "))}}function i9(e,t){if(typeof t=="function")return t(e);if(!e.isFinite())return e.isNaN()?"NaN":e.gt(0)?"Infinity":"-Infinity";var{notation:n,precision:r,wordSize:a}=bS(t);switch(n){case"fixed":return s9(e,r);case"exponential":return US(e,r);case"engineering":return o9(e,r);case"bin":return Fp(e,2,a);case"oct":return Fp(e,8,a);case"hex":return Fp(e,16,a);case"auto":{var i=LS(t?.lowerExp,-3),o=LS(t?.upperExp,5);if(e.isZero())return"0";var s,l=e.toSignificantDigits(r),u=l.e;return u>=i&&u<o?s=l.toFixed():s=US(e,r),s.replace(/((\.\d*?)(0+))($|e)/,function(){var c=arguments[2],f=arguments[4];return c!=="."?c+f:f})}default:throw new Error('Unknown notation "'+n+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function o9(e,t){var n=e.e,r=n%3===0?n:n<0?n-3-n%3:n-n%3,a=e.mul(Math.pow(10,-r)),i=a.toPrecision(t);if(i.includes("e")){var o=e.constructor;i=new o(i).toFixed()}return i+"e"+(n>=0?"+":"")+r.toString()}function US(e,t){return t!==void 0?e.toExponential(t-1):e.toExponential()}function s9(e,t){return e.toFixed(t)}function LS(e,t){return ct(e)?e:Mt(e)?e.toNumber():t}function yt(e,t){var n=l9(e,t);return t&&typeof t=="object"&&"truncate"in t&&n.length>t.truncate?n.substring(0,t.truncate-3)+"...":n}function l9(e,t){if(typeof e=="number")return wp(e,t);if(Mt(e))return i9(e,t);if(u9(e))return!t||t.fraction!=="decimal"?"".concat(e.s*e.n,"/").concat(e.d):e.toString();if(Array.isArray(e))return HS(e,t);if(Ar(e))return PS(e);if(typeof e=="function")return e.syntax?String(e.syntax):"function";if(e&&typeof e=="object"){if(typeof e.format=="function")return e.format(t);if(e&&e.toString(t)!=={}.toString())return e.toString(t);var n=Object.keys(e).map(r=>PS(r)+": "+yt(e[r],t));return"{"+n.join(", ")+"}"}return String(e)}function PS(e){for(var t=String(e),n="",r=0;r<t.length;){var a=t.charAt(r);n+=a in jS?jS[a]:a,r++}return'"'+n+'"'}var jS={'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"};function HS(e,t){if(Array.isArray(e)){for(var n="[",r=e.length,a=0;a<r;a++)a!==0&&(n+=", "),n+=HS(e[a],t);return n+="]",n}else return yt(e,t)}function u9(e){return e&&typeof e=="object"&&typeof e.s=="bigint"&&typeof e.n=="bigint"&&typeof e.d=="bigint"||!1}function Ze(e,t,n){if(!(this instanceof Ze))throw new SyntaxError("Constructor must be called with the new operator");this.actual=e,this.expected=t,this.relation=n,this.message="Dimension mismatch ("+(Array.isArray(e)?"["+e.join(", ")+"]":e)+" "+(this.relation||"!=")+" "+(Array.isArray(t)?"["+t.join(", ")+"]":t)+")",this.stack=new Error().stack}Ze.prototype=new RangeError,Ze.prototype.constructor=RangeError,Ze.prototype.name="DimensionError",Ze.prototype.isDimensionError=!0;function hi(e,t,n){if(!(this instanceof hi))throw new SyntaxError("Constructor must be called with the new operator");this.index=e,arguments.length<3?(this.min=0,this.max=t):(this.min=t,this.max=n),this.min!==void 0&&this.index<this.min?this.message="Index out of range ("+this.index+" < "+this.min+")":this.max!==void 0&&this.index>=this.max?this.message="Index out of range ("+this.index+" > "+(this.max-1)+")":this.message="Index out of range ("+this.index+")",this.stack=new Error().stack}hi.prototype=new RangeError,hi.prototype.constructor=RangeError,hi.prototype.name="IndexError",hi.prototype.isIndexError=!0;function bt(e){for(var t=[];Array.isArray(e);)t.push(e.length),e=e[0];return t}function qS(e,t,n){var r,a=e.length;if(a!==t[n])throw new Ze(a,t[n]);if(n<t.length-1){var i=n+1;for(r=0;r<a;r++){var o=e[r];if(!Array.isArray(o))throw new Ze(t.length-1,t.length,"<");qS(e[r],t,i)}}else for(r=0;r<a;r++)if(Array.isArray(e[r]))throw new Ze(t.length+1,t.length,">")}function YS(e,t){var n=t.length===0;if(n){if(Array.isArray(e))throw new Ze(e.length,0)}else qS(e,t,0)}function _t(e,t){if(e!==void 0){if(!ct(e)||!pt(e))throw new TypeError("Index must be an integer (value: "+e+")");if(e<0||typeof t=="number"&&e>=t)throw new hi(e,t)}}function Tf(e,t,n){if(!Array.isArray(t))throw new TypeError("Array expected");if(t.length===0)throw new Error("Resizing to scalar is not supported");t.forEach(function(a){if(!ct(a)||!pt(a)||a<0)throw new TypeError("Invalid size, must contain positive integers (size: "+yt(t)+")")}),(ct(e)||Mt(e))&&(e=[e]);var r=n!==void 0?n:0;return Bp(e,t,0,r),e}function Bp(e,t,n,r){var a,i,o=e.length,s=t[n],l=Math.min(o,s);if(e.length=s,n<t.length-1){var u=n+1;for(a=0;a<l;a++)i=e[a],Array.isArray(i)||(i=[i],e[a]=i),Bp(i,t,u,r);for(a=l;a<s;a++)i=[],e[a]=i,Bp(i,t,u,r)}else{for(a=0;a<l;a++)for(;Array.isArray(e[a]);)e[a]=e[a][0];for(a=l;a<s;a++)e[a]=r}}function Op(e,t){var n=zp(e,!0),r=n.length;if(!Array.isArray(e)||!Array.isArray(t))throw new TypeError("Array expected");if(t.length===0)throw new Ze(0,r,"!=");t=Rp(t,r);var a=GS(t);if(r!==a)throw new Ze(a,r,"!=");try{return c9(n,t)}catch(i){throw i instanceof Ze?new Ze(a,r,"!="):i}}function Rp(e,t){var n=GS(e),r=e.slice(),a=-1,i=e.indexOf(a),o=e.indexOf(a,i+1)>=0;if(o)throw new Error("More than one wildcard in sizes");var s=i>=0,l=t%n===0;if(s)if(l)r[i]=-t/n;else throw new Error("Could not replace wildcard, since "+t+" is no multiple of "+-n);return r}function GS(e){return e.reduce((t,n)=>t*n,1)}function c9(e,t){for(var n=e,r,a=t.length-1;a>0;a--){var i=t[a];r=[];for(var o=n.length/i,s=0;s<o;s++)r.push(n.slice(s*i,(s+1)*i));n=r}return n}function VS(e,t,n,r){var a=r||bt(e);if(n)for(var i=0;i<n;i++)e=[e],a.unshift(1);for(e=XS(e,t,0);a.length<t;)a.push(1);return e}function XS(e,t,n){var r,a;if(Array.isArray(e)){var i=n+1;for(r=0,a=e.length;r<a;r++)e[r]=XS(e[r],t,i)}else for(var o=n;o<t;o++)e=[e];return e}function zp(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(!Array.isArray(e))return e;if(typeof t!="boolean")throw new TypeError("Boolean expected for second argument of flatten");var n=[];return t?a(e):r(e),n;function r(i){for(var o=0;o<i.length;o++){var s=i[o];Array.isArray(s)?r(s):n.push(s)}}function a(i){if(Array.isArray(i[0]))for(var o=0;o<i.length;o++)a(i[o]);else for(var s=0;s<i.length;s++)n.push(i[s])}}function Mf(e,t){for(var n,r=0,a=0;a<e.length;a++){var i=e[a],o=Array.isArray(i);if(a===0&&o&&(r=i.length),o&&i.length!==r)return;var s=o?Mf(i,t):t(i);if(n===void 0)n=s;else if(n!==s)return"mixed"}return n}function ZS(e,t,n,r){if(r<n){if(e.length!==t.length)throw new Ze(e.length,t.length);for(var a=[],i=0;i<e.length;i++)a[i]=ZS(e[i],t[i],n,r+1);return a}else return e.concat(t)}function KS(){var e=Array.prototype.slice.call(arguments,0,-1),t=Array.prototype.slice.call(arguments,-1);if(e.length===1)return e[0];if(e.length>1)return e.slice(1).reduce(function(n,r){return ZS(n,r,t,0)},e[0]);throw new Error("Wrong number of arguments in function concat")}function QS(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var r=t.map(d=>d.length),a=Math.max(...r),i=new Array(a).fill(null),o=0;o<t.length;o++)for(var s=t[o],l=r[o],u=0;u<l;u++){var c=a-l+u;s[u]>i[c]&&(i[c]=s[u])}for(var f=0;f<t.length;f++)WS(t[f],i);return i}function WS(e,t){for(var n=t.length,r=e.length,a=0;a<r;a++){var i=n-r+a;if(e[a]<t[i]&&e[a]>1||e[a]>t[i])throw new Error("shape mismatch: mismatch is found in arg with shape (".concat(e,") not possible to broadcast dimension ").concat(r," with size ").concat(e[a]," to size ").concat(t[i]))}}function kp(e,t){var n=bt(e);if(si(n,t))return e;WS(n,t);var r=QS(n,t),a=r.length,i=[...Array(a-n.length).fill(1),...n],o=h9(e);n.length<a&&(o=Op(o,i),n=bt(o));for(var s=0;s<a;s++)n[s]<r[s]&&(o=f9(o,r[s],s),n=bt(o));return o}function f9(e,t,n){return KS(...Array(t).fill(e),n)}function JS(e,t){if(!Array.isArray(e))throw new Error("Array expected");var n=bt(e);if(t.length!==n.length)throw new Ze(t.length,n.length);for(var r=0;r<t.length;r++)_t(t[r],n[r]);return t.reduce((a,i)=>a[i],e)}function ew(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(e.length===0)return[];if(n)return i(e);var r=[];return a(e,0);function a(o,s){if(Array.isArray(o)){for(var l=o.length,u=Array(l),c=0;c<l;c++)r[s]=c,u[c]=a(o[c],s+1);return u}else return t(o,r.slice(0,s),e)}function i(o){if(Array.isArray(o)){for(var s=o.length,l=Array(s),u=0;u<s;u++)l[u]=i(o[u]);return l}else return t(o)}}function d9(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(e.length===0)return;if(n){i(e);return}var r=[];a(e,0);function a(o,s){if(Array.isArray(o))for(var l=o.length,u=0;u<l;u++)r[s]=u,a(o[u],s+1);else t(o,r.slice(0,s),e)}function i(o){if(Array.isArray(o))for(var s=o.length,l=0;l<s;l++)i(o[l]);else t(o)}}function h9(e){return oi([],e)}function _f(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(hf.isTypedFunction(e)){var a;if(r)a=1;else{var i=(t.isMatrix?t.size():bt(t)).map(()=>0),o=t.isMatrix?t.get(i):JS(t,i);a=g9(e,o,i,t)}var s;if(t.isMatrix&&t.dataType!=="mixed"&&t.dataType!==void 0){var l=m9(e,a);s=l!==void 0?l:e}else s=e;return a>=1&&a<=3?{isUnary:a===1,fn:function(){for(var c=arguments.length,f=new Array(c),d=0;d<c;d++)f[d]=arguments[d];return tw(s,f.slice(0,a),n,e.name)}}:{isUnary:!1,fn:function(){for(var c=arguments.length,f=new Array(c),d=0;d<c;d++)f[d]=arguments[d];return tw(s,f,n,e.name)}}}return r===void 0?{isUnary:p9(e),fn:e}:{isUnary:r,fn:e}}function m9(e,t){var n=[];if(Object.entries(e.signatures).forEach(r=>{var[a,i]=r;a.split(",").length===t&&n.push(i)}),n.length===1)return n[0]}function p9(e){if(e.length!==1)return!1;var t=e.toString();if(/arguments/.test(t))return!1;var n=t.match(/\(.*?\)/);return!/\.\.\./.test(n)}function g9(e,t,n,r){for(var a=[t,n,r],i=3;i>0;i--){var o=a.slice(0,i);if(hf.resolve(e,o)!==null)return i}}function tw(e,t,n,r){try{return e(...t)}catch(a){v9(a,t,n,r)}}function v9(e,t,n,r){var a;if(e instanceof TypeError&&((a=e.data)===null||a===void 0?void 0:a.category)==="wrongType"){var i=[];throw i.push("value: ".concat(Zn(t[0]))),t.length>=2&&i.push("index: ".concat(Zn(t[1]))),t.length>=3&&i.push("array: ".concat(Zn(t[2]))),new TypeError("Function ".concat(n," cannot apply callback arguments ")+"".concat(r,"(").concat(i.join(", "),") at index ").concat(JSON.stringify(t[1])))}else throw new TypeError("Function ".concat(n," cannot apply callback arguments ")+"to function ".concat(r,": ").concat(e.message))}var y9="DenseMatrix",b9=["Matrix"],D9=fe(y9,b9,e=>{var{Matrix:t}=e;function n(c,f){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(f&&!Ar(f))throw new Error("Invalid datatype: "+f);if(We(c))c.type==="DenseMatrix"?(this._data=Ge(c._data),this._size=Ge(c._size),this._datatype=f||c._datatype):(this._data=c.toArray(),this._size=c.size(),this._datatype=f||c._datatype);else if(c&&Et(c.data)&&Et(c.size))this._data=c.data,this._size=c.size,YS(this._data,this._size),this._datatype=f||c.datatype;else if(Et(c))this._data=u(c),this._size=bt(this._data),YS(this._data,this._size),this._datatype=f;else{if(c)throw new TypeError("Unsupported type of data ("+Zn(c)+")");this._data=[],this._size=[0],this._datatype=f}}n.prototype=new t,n.prototype.createDenseMatrix=function(c,f){return new n(c,f)},Object.defineProperty(n,"name",{value:"DenseMatrix"}),n.prototype.constructor=n,n.prototype.type="DenseMatrix",n.prototype.isDenseMatrix=!0,n.prototype.getDataType=function(){return Mf(this._data,Zn)},n.prototype.storage=function(){return"dense"},n.prototype.datatype=function(){return this._datatype},n.prototype.create=function(c,f){return new n(c,f)},n.prototype.subset=function(c,f,d){switch(arguments.length){case 1:return r(this,c);case 2:case 3:return i(this,c,f,d);default:throw new SyntaxError("Wrong number of arguments")}},n.prototype.get=function(c){return JS(this._data,c)},n.prototype.set=function(c,f,d){if(!Et(c))throw new TypeError("Array expected");if(c.length<this._size.length)throw new Ze(c.length,this._size.length,"<");var h,g,m,D=c.map(function(v){return v+1});l(this,D,d);var p=this._data;for(h=0,g=c.length-1;h<g;h++)m=c[h],_t(m,p.length),p=p[m];return m=c[c.length-1],_t(m,p.length),p[m]=f,this};function r(c,f){if(!bp(f))throw new TypeError("Invalid index");var d=f.isScalar();if(d)return c.get(f.min());var h=f.size();if(h.length!==c._size.length)throw new Ze(h.length,c._size.length);for(var g=f.min(),m=f.max(),D=0,p=c._size.length;D<p;D++)_t(g[D],c._size[D]),_t(m[D],c._size[D]);var v=new n([]),y=a(c._data,f);return v._size=y.size,v._datatype=c._datatype,v._data=y.data,v}function a(c,f){var d=f.size().length-1,h=Array(d);return{data:g(c),size:h};function g(m){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,p=f.dimension(D);return h[D]=p.size()[0],D<d?p.map(v=>(_t(v,m.length),g(m[v],D+1))).valueOf():p.map(v=>(_t(v,m.length),m[v])).valueOf()}}function i(c,f,d,h){if(!f||f.isIndex!==!0)throw new TypeError("Invalid index");var g=f.size(),m=f.isScalar(),D;if(We(d)?(D=d.size(),d=d.valueOf()):D=bt(d),m){if(D.length!==0)throw new TypeError("Scalar expected");c.set(f.min(),d,h)}else{if(!si(D,g))try{D.length===0?d=kp([d],g):d=kp(d,g),D=bt(d)}catch{}if(g.length<c._size.length)throw new Ze(g.length,c._size.length,"<");if(D.length<g.length){for(var p=0,v=0;g[p]===1&&D[p]===1;)p++;for(;g[p]===1;)v++,p++;d=VS(d,g.length,v,D)}if(!si(g,D))throw new Ze(g,D,">");var y=f.max().map(function(w){return w+1});l(c,y,h),o(c._data,f,d)}return c}function o(c,f,d){var h=f.size().length-1;g(c,d);function g(m,D){var p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,v=f.dimension(p);p<h?v.forEach((y,w)=>{_t(y,m.length),g(m[y],D[w[0]],p+1)}):v.forEach((y,w)=>{_t(y,m.length),m[y]=D[w[0]]})}}n.prototype.resize=function(c,f,d){if(!Gl(c))throw new TypeError("Array or Matrix expected");var h=c.valueOf().map(m=>Array.isArray(m)&&m.length===1?m[0]:m),g=d?this.clone():this;return s(g,h,f)};function s(c,f,d){if(f.length===0){for(var h=c._data;Et(h);)h=h[0];return h}return c._size=f.slice(0),c._data=Tf(c._data,c._size,d),c}n.prototype.reshape=function(c,f){var d=f?this.clone():this;d._data=Op(d._data,c);var h=d._size.reduce((g,m)=>g*m);return d._size=Rp(c,h),d};function l(c,f,d){for(var h=c._size.slice(0),g=!1;h.length<f.length;)h.push(0),g=!0;for(var m=0,D=f.length;m<D;m++)f[m]>h[m]&&(h[m]=f[m],g=!0);g&&s(c,h,d)}n.prototype.clone=function(){var c=new n({data:Ge(this._data),size:Ge(this._size),datatype:this._datatype});return c},n.prototype.size=function(){return this._size.slice(0)},n.prototype.map=function(c){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,d=this,h=d._size.length-1;if(h<0)return d.clone();var g=_f(c,d,"map",f),m=g.fn,D=d.create(void 0,d._datatype);if(D._size=d._size,f||g.isUnary)return D._data=b(d._data),D;if(h===0){for(var p=d.valueOf(),v=Array(p.length),y=0;y<p.length;y++)v[y]=m(p[y],[y],d);return D._data=v,D}var w=[];return D._data=E(d._data),D;function E(S){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,C=Array(S.length);if(A<h)for(var T=0;T<S.length;T++)w[A]=T,C[T]=E(S[T],A+1);else for(var M=0;M<S.length;M++)w[A]=M,C[M]=m(S[M],w.slice(),d);return C}function b(S){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,C=Array(S.length);if(A<h)for(var T=0;T<S.length;T++)C[T]=b(S[T],A+1);else for(var M=0;M<S.length;M++)C[M]=m(S[M]);return C}},n.prototype.forEach=function(c){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,d=this,h=d._size.length-1;if(h<0)return;var g=_f(c,d,"map",f),m=g.fn;if(f||g.isUnary){y(d._data);return}if(h===0){for(var D=0;D<d._data.length;D++)m(d._data[D],[D],d);return}var p=[];v(d._data);function v(w){var E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(E<h)for(var b=0;b<w.length;b++)p[E]=b,v(w[b],E+1);else for(var S=0;S<w.length;S++)p[E]=S,m(w[S],p.slice(),d)}function y(w){var E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(E<h)for(var b=0;b<w.length;b++)y(w[b],E+1);else for(var S=0;S<w.length;S++)m(w[S])}},n.prototype[Symbol.iterator]=function*(){var c=this._size.length-1;if(!(c<0)){if(c===0){for(var f=0;f<this._data.length;f++)yield{value:this._data[f],index:[f]};return}for(var d=Array(c+1).fill(0),h=this._size.reduce((v,y)=>v*y,1),g=0;g<h;g++){for(var m=this._data,D=0;D<c;D++)m=m[d[D]];yield{value:m[d[c]],index:d.slice()};for(var p=c;p>=0&&(d[p]++,!(d[p]<this._size[p]));p--)d[p]=0}}},n.prototype.rows=function(){var c=[],f=this.size();if(f.length!==2)throw new TypeError("Rows can only be returned for a 2D matrix.");var d=this._data;for(var h of d)c.push(new n([h],this._datatype));return c},n.prototype.columns=function(){var c=this,f=[],d=this.size();if(d.length!==2)throw new TypeError("Rows can only be returned for a 2D matrix.");for(var h=this._data,g=function(p){var v=h.map(y=>[y[p]]);f.push(new n(v,c._datatype))},m=0;m<d[1];m++)g(m);return f},n.prototype.toArray=function(){return Ge(this._data)},n.prototype.valueOf=function(){return this._data},n.prototype.format=function(c){return yt(this._data,c)},n.prototype.toString=function(){return yt(this._data)},n.prototype.toJSON=function(){return{mathjs:"DenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},n.prototype.diagonal=function(c){if(c){if(Mt(c)&&(c=c.toNumber()),!ct(c)||!pt(c))throw new TypeError("The parameter k must be an integer number")}else c=0;for(var f=c>0?c:0,d=c<0?-c:0,h=this._size[0],g=this._size[1],m=Math.min(h-d,g-f),D=[],p=0;p<m;p++)D[p]=this._data[p+d][p+f];return new n({data:D,size:[m],datatype:this._datatype})},n.diagonal=function(c,f,d,h){if(!Et(c))throw new TypeError("Array expected, size parameter");if(c.length!==2)throw new Error("Only two dimensions matrix are supported");if(c=c.map(function(S){if(Mt(S)&&(S=S.toNumber()),!ct(S)||!pt(S)||S<1)throw new Error("Size values must be positive integers");return S}),d){if(Mt(d)&&(d=d.toNumber()),!ct(d)||!pt(d))throw new TypeError("The parameter k must be an integer number")}else d=0;var g=d>0?d:0,m=d<0?-d:0,D=c[0],p=c[1],v=Math.min(D-m,p-g),y;if(Et(f)){if(f.length!==v)throw new Error("Invalid value array length");y=function(A){return f[A]}}else if(We(f)){var w=f.size();if(w.length!==1||w[0]!==v)throw new Error("Invalid matrix length");y=function(A){return f.get([A])}}else y=function(){return f};h||(h=Mt(y(0))?y(0).mul(0):0);var E=[];if(c.length>0){E=Tf(E,c,h);for(var b=0;b<v;b++)E[b+m][b+g]=y(b)}return new n({data:E,size:[D,p]})},n.fromJSON=function(c){return new n(c)},n.prototype.swapRows=function(c,f){if(!ct(c)||!pt(c)||!ct(f)||!pt(f))throw new Error("Row index must be positive integers");if(this._size.length!==2)throw new Error("Only two dimensional matrix is supported");return _t(c,this._size[0]),_t(f,this._size[0]),n._swapRows(c,f,this._data),this},n._swapRows=function(c,f,d){var h=d[c];d[c]=d[f],d[f]=h};function u(c){return We(c)?u(c.valueOf()):Et(c)?c.map(u):c}return n},{isClass:!0});function S9(e){var t=e.length,n=e[0].length,r,a,i=[];for(a=0;a<n;a++){var o=[];for(r=0;r<t;r++)o.push(e[r][a]);i.push(o)}return i}function nw(e){for(var t=0;t<e.length;t++)if(Gl(e[t]))return!0;return!1}function rw(e,t){We(e)?e.forEach(n=>t(n),!1,!0):d9(e,t,!0)}function zn(e,t,n){if(!n)return We(e)?e.map(a=>t(a),!1,!0):ew(e,t,!0);var r=a=>a===0?a:t(a);return We(e)?e.map(a=>r(a),!1,!0):ew(e,r,!0)}function aw(e,t,n){var r=Array.isArray(e)?bt(e):e.size();if(t<0||t>=r.length)throw new hi(t,r.length);return We(e)?e.create(Nf(e.valueOf(),t,n),e.datatype()):Nf(e,t,n)}function Nf(e,t,n){var r,a,i,o;if(t<=0)if(Array.isArray(e[0])){for(o=S9(e),a=[],r=0;r<o.length;r++)a[r]=Nf(o[r],t-1,n);return a}else{for(i=e[0],r=1;r<e.length;r++)i=n(i,e[r]);return i}else{for(a=[],r=0;r<e.length;r++)a[r]=Nf(e[r],t-1,n);return a}}var iw="isInteger",w9=["typed"],x9=fe(iw,w9,e=>{var{typed:t}=e;return t(iw,{number:pt,BigNumber:function(r){return r.isInt()},bigint:function(r){return!0},Fraction:function(r){return r.d===1n},"Array | Matrix":t.referToSelf(n=>r=>zn(r,n))})}),$p="number",Ff="number, number";function ow(e){return Math.abs(e)}ow.signature=$p;function sw(e,t){return e+t}sw.signature=Ff;function lw(e,t){return e-t}lw.signature=Ff;function uw(e,t){return e*t}uw.signature=Ff;function cw(e){return-e}cw.signature=$p;function Ip(e){return UM(e)}Ip.signature=$p;function fw(e,t){return e*e<1&&t===1/0||e*e>1&&t===-1/0?0:Math.pow(e,t)}fw.signature=Ff;var dw="number";function hw(e){return e>0}hw.signature=dw;function mw(e){return Number.isNaN(e)}mw.signature=dw;function gs(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1e-9,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;if(n<=0)throw new Error("Relative tolerance must be greater than 0");if(r<0)throw new Error("Absolute tolerance must be at least 0");return e.isNaN()||t.isNaN()?!1:!e.isFinite()||!t.isFinite()?e.eq(t):e.eq(t)?!0:e.minus(t).abs().lte(e.constructor.max(e.constructor.max(e.abs(),t.abs()).mul(n),r))}var pw="isPositive",E9=["typed","config"],A9=fe(pw,E9,e=>{var{typed:t,config:n}=e;return t(pw,{number:r=>Da(r,0,n.relTol,n.absTol)?!1:hw(r),BigNumber:r=>gs(r,new r.constructor(0),n.relTol,n.absTol)?!1:!r.isNeg()&&!r.isZero()&&!r.isNaN(),bigint:r=>r>0n,Fraction:r=>r.s>0n&&r.n>0n,Unit:t.referToSelf(r=>a=>t.find(r,a.valueType())(a.value)),"Array | Matrix":t.referToSelf(r=>a=>zn(a,r))})}),gw="isZero",C9=["typed","equalScalar"],T9=fe(gw,C9,e=>{var{typed:t,equalScalar:n}=e;return t(gw,{"number | BigNumber | Complex | Fraction":r=>n(r,0),bigint:r=>r===0n,Unit:t.referToSelf(r=>a=>t.find(r,a.valueType())(a.value)),"Array | Matrix":t.referToSelf(r=>a=>zn(a,r))})}),vw="isNaN",M9=["typed"],_9=fe(vw,M9,e=>{var{typed:t}=e;return t(vw,{number:mw,BigNumber:function(r){return r.isNaN()},bigint:function(r){return!1},Fraction:function(r){return!1},Complex:function(r){return r.isNaN()},Unit:function(r){return Number.isNaN(r.value)},"Array | Matrix":t.referToSelf(n=>r=>zn(r,n))})});function N9(e,t,n,r){return Da(e.re,t.re,n,r)&&Da(e.im,t.im,n,r)}var Kl=fe("compareUnits",["typed"],e=>{var{typed:t}=e;return{"Unit, Unit":t.referToSelf(n=>(r,a)=>{if(!r.equalBase(a))throw new Error("Cannot compare units with different base");return t.find(n,[r.valueType(),a.valueType()])(r.value,a.value)})}}),Bf="equalScalar",F9=["typed","config"],B9=fe(Bf,F9,e=>{var{typed:t,config:n}=e,r=Kl({typed:t});return t(Bf,{"boolean, boolean":function(i,o){return i===o},"number, number":function(i,o){return Da(i,o,n.relTol,n.absTol)},"BigNumber, BigNumber":function(i,o){return i.eq(o)||gs(i,o,n.relTol,n.absTol)},"bigint, bigint":function(i,o){return i===o},"Fraction, Fraction":function(i,o){return i.equals(o)},"Complex, Complex":function(i,o){return N9(i,o,n.relTol,n.absTol)}},r)});fe(Bf,["typed","config"],e=>{var{typed:t,config:n}=e;return t(Bf,{"number, number":function(a,i){return Da(a,i,n.relTol,n.absTol)}})});var O9="SparseMatrix",R9=["typed","equalScalar","Matrix"],z9=fe(O9,R9,e=>{var{typed:t,equalScalar:n,Matrix:r}=e;function a(m,D){if(!(this instanceof a))throw new SyntaxError("Constructor must be called with the new operator");if(D&&!Ar(D))throw new Error("Invalid datatype: "+D);if(We(m))i(this,m,D);else if(m&&Et(m.index)&&Et(m.ptr)&&Et(m.size))this._values=m.values,this._index=m.index,this._ptr=m.ptr,this._size=m.size,this._datatype=D||m.datatype;else if(Et(m))o(this,m,D);else{if(m)throw new TypeError("Unsupported type of data ("+Zn(m)+")");this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=D}}function i(m,D,p){D.type==="SparseMatrix"?(m._values=D._values?Ge(D._values):void 0,m._index=Ge(D._index),m._ptr=Ge(D._ptr),m._size=Ge(D._size),m._datatype=p||D._datatype):o(m,D.valueOf(),p||D._datatype)}function o(m,D,p){m._values=[],m._index=[],m._ptr=[],m._datatype=p;var v=D.length,y=0,w=n,E=0;if(Ar(p)&&(w=t.find(n,[p,p])||n,E=t.convert(0,p)),v>0){var b=0;do{m._ptr.push(m._index.length);for(var S=0;S<v;S++){var A=D[S];if(Et(A)){if(b===0&&y<A.length&&(y=A.length),b<A.length){var C=A[b];w(C,E)||(m._values.push(C),m._index.push(S))}}else b===0&&y<1&&(y=1),w(A,E)||(m._values.push(A),m._index.push(S))}b++}while(b<y)}m._ptr.push(m._index.length),m._size=[v,y]}a.prototype=new r,a.prototype.createSparseMatrix=function(m,D){return new a(m,D)},Object.defineProperty(a,"name",{value:"SparseMatrix"}),a.prototype.constructor=a,a.prototype.type="SparseMatrix",a.prototype.isSparseMatrix=!0,a.prototype.getDataType=function(){return Mf(this._values,Zn)},a.prototype.storage=function(){return"sparse"},a.prototype.datatype=function(){return this._datatype},a.prototype.create=function(m,D){return new a(m,D)},a.prototype.density=function(){var m=this._size[0],D=this._size[1];return m!==0&&D!==0?this._index.length/(m*D):0},a.prototype.subset=function(m,D,p){if(!this._values)throw new Error("Cannot invoke subset on a Pattern only matrix");switch(arguments.length){case 1:return s(this,m);case 2:case 3:return l(this,m,D,p);default:throw new SyntaxError("Wrong number of arguments")}};function s(m,D){if(!bp(D))throw new TypeError("Invalid index");var p=D.isScalar();if(p)return m.get(D.min());var v=D.size();if(v.length!==m._size.length)throw new Ze(v.length,m._size.length);var y,w,E,b,S=D.min(),A=D.max();for(y=0,w=m._size.length;y<w;y++)_t(S[y],m._size[y]),_t(A[y],m._size[y]);var C=m._values,T=m._index,M=m._ptr,x=D.dimension(0),N=D.dimension(1),O=[],z=[];x.forEach(function(U,Y){z[U]=Y[0],O[U]=!0});var B=C?[]:void 0,k=[],$=[];return N.forEach(function(U){for($.push(k.length),E=M[U],b=M[U+1];E<b;E++)y=T[E],O[y]===!0&&(k.push(z[y]),B&&B.push(C[E]))}),$.push(k.length),new a({values:B,index:k,ptr:$,size:v,datatype:m._datatype})}function l(m,D,p,v){if(!D||D.isIndex!==!0)throw new TypeError("Invalid index");var y=D.size(),w=D.isScalar(),E;if(We(p)?(E=p.size(),p=p.toArray()):E=bt(p),w){if(E.length!==0)throw new TypeError("Scalar expected");m.set(D.min(),p,v)}else{if(y.length!==1&&y.length!==2)throw new Ze(y.length,m._size.length,"<");if(E.length<y.length){for(var b=0,S=0;y[b]===1&&E[b]===1;)b++;for(;y[b]===1;)S++,b++;p=VS(p,y.length,S,E)}if(!si(y,E))throw new Ze(y,E,">");if(y.length===1){var A=D.dimension(0);A.forEach(function(M,x){_t(M),m.set([M,0],p[x[0]],v)})}else{var C=D.dimension(0),T=D.dimension(1);C.forEach(function(M,x){_t(M),T.forEach(function(N,O){_t(N),m.set([M,N],p[x[0]][O[0]],v)})})}}return m}a.prototype.get=function(m){if(!Et(m))throw new TypeError("Array expected");if(m.length!==this._size.length)throw new Ze(m.length,this._size.length);if(!this._values)throw new Error("Cannot invoke get on a Pattern only matrix");var D=m[0],p=m[1];_t(D,this._size[0]),_t(p,this._size[1]);var v=u(D,this._ptr[p],this._ptr[p+1],this._index);return v<this._ptr[p+1]&&this._index[v]===D?this._values[v]:0},a.prototype.set=function(m,D,p){if(!Et(m))throw new TypeError("Array expected");if(m.length!==this._size.length)throw new Ze(m.length,this._size.length);if(!this._values)throw new Error("Cannot invoke set on a Pattern only matrix");var v=m[0],y=m[1],w=this._size[0],E=this._size[1],b=n,S=0;Ar(this._datatype)&&(b=t.find(n,[this._datatype,this._datatype])||n,S=t.convert(0,this._datatype)),(v>w-1||y>E-1)&&(d(this,Math.max(v+1,w),Math.max(y+1,E),p),w=this._size[0],E=this._size[1]),_t(v,w),_t(y,E);var A=u(v,this._ptr[y],this._ptr[y+1],this._index);return A<this._ptr[y+1]&&this._index[A]===v?b(D,S)?c(A,y,this._values,this._index,this._ptr):this._values[A]=D:b(D,S)||f(A,v,y,D,this._values,this._index,this._ptr),this};function u(m,D,p,v){if(p-D===0)return p;for(var y=D;y<p;y++)if(v[y]===m)return y;return D}function c(m,D,p,v,y){p.splice(m,1),v.splice(m,1);for(var w=D+1;w<y.length;w++)y[w]--}function f(m,D,p,v,y,w,E){y.splice(m,0,v),w.splice(m,0,D);for(var b=p+1;b<E.length;b++)E[b]++}a.prototype.resize=function(m,D,p){if(!Gl(m))throw new TypeError("Array or Matrix expected");var v=m.valueOf().map(w=>Array.isArray(w)&&w.length===1?w[0]:w);if(v.length!==2)throw new Error("Only two dimensions matrix are supported");v.forEach(function(w){if(!ct(w)||!pt(w)||w<0)throw new TypeError("Invalid size, must contain positive integers (size: "+yt(v)+")")});var y=p?this.clone():this;return d(y,v[0],v[1],D)};function d(m,D,p,v){var y=v||0,w=n,E=0;Ar(m._datatype)&&(w=t.find(n,[m._datatype,m._datatype])||n,E=t.convert(0,m._datatype),y=t.convert(y,m._datatype));var b=!w(y,E),S=m._size[0],A=m._size[1],C,T,M;if(p>A){for(T=A;T<p;T++)if(m._ptr[T]=m._values.length,b)for(C=0;C<S;C++)m._values.push(y),m._index.push(C);m._ptr[p]=m._values.length}else p<A&&(m._ptr.splice(p+1,A-p),m._values.splice(m._ptr[p],m._values.length),m._index.splice(m._ptr[p],m._index.length));if(A=p,D>S){if(b){var x=0;for(T=0;T<A;T++){m._ptr[T]=m._ptr[T]+x,M=m._ptr[T+1]+x;var N=0;for(C=S;C<D;C++,N++)m._values.splice(M+N,0,y),m._index.splice(M+N,0,C),x++}m._ptr[A]=m._values.length}}else if(D<S){var O=0;for(T=0;T<A;T++){m._ptr[T]=m._ptr[T]-O;var z=m._ptr[T],B=m._ptr[T+1]-O;for(M=z;M<B;M++)C=m._index[M],C>D-1&&(m._values.splice(M,1),m._index.splice(M,1),O++)}m._ptr[T]=m._values.length}return m._size[0]=D,m._size[1]=p,m}a.prototype.reshape=function(m,D){if(!Et(m))throw new TypeError("Array expected");if(m.length!==2)throw new Error("Sparse matrices can only be reshaped in two dimensions");m.forEach(function(U){if(!ct(U)||!pt(U)||U<=-2||U===0)throw new TypeError("Invalid size, must contain positive integers or -1 (size: "+yt(m)+")")});var p=this._size[0]*this._size[1];m=Rp(m,p);var v=m[0]*m[1];if(p!==v)throw new Error("Reshaping sparse matrix will result in the wrong number of elements");var y=D?this.clone():this;if(this._size[0]===m[0]&&this._size[1]===m[1])return y;for(var w=[],E=0;E<y._ptr.length;E++)for(var b=0;b<y._ptr[E+1]-y._ptr[E];b++)w.push(E);for(var S=y._values.slice(),A=y._index.slice(),C=0;C<y._index.length;C++){var T=A[C],M=w[C],x=T*y._size[1]+M;w[C]=x%m[1],A[C]=Math.floor(x/m[1])}y._values.length=0,y._index.length=0,y._ptr.length=m[1]+1,y._size=m.slice();for(var N=0;N<y._ptr.length;N++)y._ptr[N]=0;for(var O=0;O<S.length;O++){var z=A[O],B=w[O],k=S[O],$=u(z,y._ptr[B],y._ptr[B+1],y._index);f($,z,B,k,y._values,y._index,y._ptr)}return y},a.prototype.clone=function(){var m=new a({values:this._values?Ge(this._values):void 0,index:Ge(this._index),ptr:Ge(this._ptr),size:Ge(this._size),datatype:this._datatype});return m},a.prototype.size=function(){return this._size.slice(0)},a.prototype.map=function(m,D){if(!this._values)throw new Error("Cannot invoke map on a Pattern only matrix");var p=this,v=this._size[0],y=this._size[1],w=_f(m,p,"map"),E=function(S,A,C){return w.fn(S,[A,C],p)};return h(this,0,v-1,0,y-1,E,D)};function h(m,D,p,v,y,w,E){var b=[],S=[],A=[],C=n,T=0;Ar(m._datatype)&&(C=t.find(n,[m._datatype,m._datatype])||n,T=t.convert(0,m._datatype));for(var M=function(G,q,L){var j=w(G,q,L);C(j,T)||(b.push(j),S.push(q))},x=v;x<=y;x++){A.push(b.length);var N=m._ptr[x],O=m._ptr[x+1];if(E)for(var z=N;z<O;z++){var B=m._index[z];B>=D&&B<=p&&M(m._values[z],B-D,x-v)}else{for(var k={},$=N;$<O;$++){var U=m._index[$];k[U]=m._values[$]}for(var Y=D;Y<=p;Y++){var X=Y in k?k[Y]:0;M(X,Y-D,x-v)}}}return A.push(b.length),new a({values:b,index:S,ptr:A,size:[p-D+1,y-v+1]})}a.prototype.forEach=function(m,D){if(!this._values)throw new Error("Cannot invoke forEach on a Pattern only matrix");for(var p=this,v=this._size[0],y=this._size[1],w=_f(m,p,"forEach"),E=0;E<y;E++){var b=this._ptr[E],S=this._ptr[E+1];if(D)for(var A=b;A<S;A++){var C=this._index[A];w.fn(this._values[A],[C,E],p)}else{for(var T={},M=b;M<S;M++){var x=this._index[M];T[x]=this._values[M]}for(var N=0;N<v;N++){var O=N in T?T[N]:0;w.fn(O,[N,E],p)}}}},a.prototype[Symbol.iterator]=function*(){if(!this._values)throw new Error("Cannot iterate a Pattern only matrix");for(var m=this._size[1],D=0;D<m;D++)for(var p=this._ptr[D],v=this._ptr[D+1],y=p;y<v;y++){var w=this._index[y];yield{value:this._values[y],index:[w,D]}}},a.prototype.toArray=function(){return g(this._values,this._index,this._ptr,this._size,!0)},a.prototype.valueOf=function(){return g(this._values,this._index,this._ptr,this._size,!1)};function g(m,D,p,v,y){var w=v[0],E=v[1],b=[],S,A;for(S=0;S<w;S++)for(b[S]=[],A=0;A<E;A++)b[S][A]=0;for(A=0;A<E;A++)for(var C=p[A],T=p[A+1],M=C;M<T;M++)S=D[M],b[S][A]=m?y?Ge(m[M]):m[M]:1;return b}return a.prototype.format=function(m){for(var D=this._size[0],p=this._size[1],v=this.density(),y="Sparse Matrix ["+yt(D,m)+" x "+yt(p,m)+"] density: "+yt(v,m)+`
76
- `,w=0;w<p;w++)for(var E=this._ptr[w],b=this._ptr[w+1],S=E;S<b;S++){var A=this._index[S];y+=`
77
- (`+yt(A,m)+", "+yt(w,m)+") ==> "+(this._values?yt(this._values[S],m):"X")}return y},a.prototype.toString=function(){return yt(this.toArray())},a.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},a.prototype.diagonal=function(m){if(m){if(Mt(m)&&(m=m.toNumber()),!ct(m)||!pt(m))throw new TypeError("The parameter k must be an integer number")}else m=0;var D=m>0?m:0,p=m<0?-m:0,v=this._size[0],y=this._size[1],w=Math.min(v-p,y-D),E=[],b=[],S=[];S[0]=0;for(var A=D;A<y&&E.length<w;A++)for(var C=this._ptr[A],T=this._ptr[A+1],M=C;M<T;M++){var x=this._index[M];if(x===A-D+p){E.push(this._values[M]),b[E.length-1]=x-p;break}}return S.push(E.length),new a({values:E,index:b,ptr:S,size:[w,1]})},a.fromJSON=function(m){return new a(m)},a.diagonal=function(m,D,p,v,y){if(!Et(m))throw new TypeError("Array expected, size parameter");if(m.length!==2)throw new Error("Only two dimensions matrix are supported");if(m=m.map(function(U){if(Mt(U)&&(U=U.toNumber()),!ct(U)||!pt(U)||U<1)throw new Error("Size values must be positive integers");return U}),p){if(Mt(p)&&(p=p.toNumber()),!ct(p)||!pt(p))throw new TypeError("The parameter k must be an integer number")}else p=0;var w=n,E=0;Ar(y)&&(w=t.find(n,[y,y])||n,E=t.convert(0,y));var b=p>0?p:0,S=p<0?-p:0,A=m[0],C=m[1],T=Math.min(A-S,C-b),M;if(Et(D)){if(D.length!==T)throw new Error("Invalid value array length");M=function(Y){return D[Y]}}else if(We(D)){var x=D.size();if(x.length!==1||x[0]!==T)throw new Error("Invalid matrix length");M=function(Y){return D.get([Y])}}else M=function(){return D};for(var N=[],O=[],z=[],B=0;B<C;B++){z.push(N.length);var k=B-b;if(k>=0&&k<T){var $=M(k);w($,E)||(O.push(k+S),N.push($))}}return z.push(N.length),new a({values:N,index:O,ptr:z,size:[A,C]})},a.prototype.swapRows=function(m,D){if(!ct(m)||!pt(m)||!ct(D)||!pt(D))throw new Error("Row index must be positive integers");if(this._size.length!==2)throw new Error("Only two dimensional matrix is supported");return _t(m,this._size[0]),_t(D,this._size[0]),a._swapRows(m,D,this._size[1],this._values,this._index,this._ptr),this},a._forEachRow=function(m,D,p,v,y){for(var w=v[m],E=v[m+1],b=w;b<E;b++)y(p[b],D[b])},a._swapRows=function(m,D,p,v,y,w){for(var E=0;E<p;E++){var b=w[E],S=w[E+1],A=u(m,b,S,y),C=u(D,b,S,y);if(A<S&&C<S&&y[A]===m&&y[C]===D){if(v){var T=v[A];v[A]=v[C],v[C]=T}continue}if(A<S&&y[A]===m&&(C>=S||y[C]!==D)){var M=v?v[A]:void 0;y.splice(C,0,D),v&&v.splice(C,0,M),y.splice(C<=A?A+1:A,1),v&&v.splice(C<=A?A+1:A,1);continue}if(C<S&&y[C]===D&&(A>=S||y[A]!==m)){var x=v?v[C]:void 0;y.splice(A,0,m),v&&v.splice(A,0,x),y.splice(A<=C?C+1:C,1),v&&v.splice(A<=C?C+1:C,1)}}},a},{isClass:!0}),k9="number",$9=["typed"];function I9(e){var t=e.match(/(0[box])([0-9a-fA-F]*)\.([0-9a-fA-F]*)/);if(t){var n={"0b":2,"0o":8,"0x":16}[t[1]],r=t[2],a=t[3];return{input:e,radix:n,integerPart:r,fractionalPart:a}}else return null}function U9(e){for(var t=parseInt(e.integerPart,e.radix),n=0,r=0;r<e.fractionalPart.length;r++){var a=parseInt(e.fractionalPart[r],e.radix);n+=a/Math.pow(e.radix,r+1)}var i=t+n;if(isNaN(i))throw new SyntaxError('String "'+e.input+'" is not a valid number');return i}var L9=fe(k9,$9,e=>{var{typed:t}=e,n=t("number",{"":function(){return 0},number:function(a){return a},string:function(a){if(a==="NaN")return NaN;var i=I9(a);if(i)return U9(i);var o=0,s=a.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);s&&(o=Number(s[2]),a=s[1]);var l=Number(a);if(isNaN(l))throw new SyntaxError('String "'+a+'" is not a valid number');if(s){if(l>2**o-1)throw new SyntaxError('String "'.concat(a,'" is out of range'));l>=2**(o-1)&&(l=l-2**o)}return l},BigNumber:function(a){return a.toNumber()},bigint:function(a){return Number(a)},Fraction:function(a){return a.valueOf()},Unit:t.referToSelf(r=>a=>{var i=a.clone();return i.value=r(a.value),i}),null:function(a){return 0},"Unit, string | Unit":function(a,i){return a.toNumber(i)},"Array | Matrix":t.referToSelf(r=>a=>zn(a,r))});return n.fromJSON=function(r){return parseFloat(r.value)},n}),P9="bignumber",j9=["typed","BigNumber"],H9=fe(P9,j9,e=>{var{typed:t,BigNumber:n}=e;return t("bignumber",{"":function(){return new n(0)},number:function(a){return new n(a+"")},string:function(a){var i=a.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);if(i){var o=i[2],s=n(i[1]),l=new n(2).pow(Number(o));if(s.gt(l.sub(1)))throw new SyntaxError('String "'.concat(a,'" is out of range'));var u=new n(2).pow(Number(o)-1);return s.gte(u)?s.sub(l):s}return new n(a)},BigNumber:function(a){return a},bigint:function(a){return new n(a.toString())},Unit:t.referToSelf(r=>a=>{var i=a.clone();return i.value=r(a.value),i}),Fraction:function(a){return new n(String(a.n)).div(String(a.d)).times(String(a.s))},null:function(a){return new n(0)},"Array | Matrix":t.referToSelf(r=>a=>zn(a,r))})}),q9="complex",Y9=["typed","Complex"],G9=fe(q9,Y9,e=>{var{typed:t,Complex:n}=e;return t("complex",{"":function(){return n.ZERO},number:function(a){return new n(a,0)},"number, number":function(a,i){return new n(a,i)},"BigNumber, BigNumber":function(a,i){return new n(a.toNumber(),i.toNumber())},Fraction:function(a){return new n(a.valueOf(),0)},Complex:function(a){return a.clone()},string:function(a){return n(a)},null:function(a){return n(0)},Object:function(a){if("re"in a&&"im"in a)return new n(a.re,a.im);if("r"in a&&"phi"in a||"abs"in a&&"arg"in a)return new n(a);throw new Error("Expected object with properties (re and im) or (r and phi) or (abs and arg)")},"Array | Matrix":t.referToSelf(r=>a=>zn(a,r))})}),V9="fraction",X9=["typed","Fraction"],Z9=fe(V9,X9,e=>{var{typed:t,Fraction:n}=e;return t("fraction",{number:function(a){if(!isFinite(a)||isNaN(a))throw new Error(a+" cannot be represented as a fraction");return new n(a)},string:function(a){return new n(a)},"number, number":function(a,i){return new n(a,i)},"bigint, bigint":function(a,i){return new n(a,i)},null:function(a){return new n(0)},BigNumber:function(a){return new n(a.toString())},bigint:function(a){return new n(a.toString())},Fraction:function(a){return a},Unit:t.referToSelf(r=>a=>{var i=a.clone();return i.value=r(a.value),i}),Object:function(a){return new n(a)},"Array | Matrix":t.referToSelf(r=>a=>zn(a,r))})}),yw="matrix",K9=["typed","Matrix","DenseMatrix","SparseMatrix"],Q9=fe(yw,K9,e=>{var{typed:t,Matrix:n,DenseMatrix:r,SparseMatrix:a}=e;return t(yw,{"":function(){return i([])},string:function(s){return i([],s)},"string, string":function(s,l){return i([],s,l)},Array:function(s){return i(s)},Matrix:function(s){return i(s,s.storage())},"Array | Matrix, string":i,"Array | Matrix, string, string":i});function i(o,s,l){if(s==="dense"||s==="default"||s===void 0)return new r(o,l);if(s==="sparse")return new a(o,l);throw new TypeError("Unknown matrix type "+JSON.stringify(s)+".")}}),bw="matrixFromColumns",W9=["typed","matrix","flatten","size"],J9=fe(bw,W9,e=>{var{typed:t,matrix:n,flatten:r,size:a}=e;return t(bw,{"...Array":function(l){return i(l)},"...Matrix":function(l){return n(i(l.map(u=>u.toArray())))}});function i(s){if(s.length===0)throw new TypeError("At least one column is needed to construct a matrix.");for(var l=o(s[0]),u=[],c=0;c<l;c++)u[c]=[];for(var f of s){var d=o(f);if(d!==l)throw new TypeError("The vectors had different length: "+(l|0)+" ≠ "+(d|0));for(var h=r(f),g=0;g<l;g++)u[g].push(h[g])}return u}function o(s){var l=a(s);if(l.length===1)return l[0];if(l.length===2){if(l[0]===1)return l[1];if(l[1]===1)return l[0];throw new TypeError("At least one of the arguments is not a vector.")}else throw new TypeError("Only one- or two-dimensional vectors are supported.")}}),Dw="unaryMinus",e7=["typed"],t7=fe(Dw,e7,e=>{var{typed:t}=e;return t(Dw,{number:cw,"Complex | BigNumber | Fraction":n=>n.neg(),bigint:n=>-n,Unit:t.referToSelf(n=>r=>{var a=r.clone();return a.value=t.find(n,a.valueType())(r.value),a}),"Array | Matrix":t.referToSelf(n=>r=>zn(r,n,!0))})}),Sw="abs",n7=["typed"],r7=fe(Sw,n7,e=>{var{typed:t}=e;return t(Sw,{number:ow,"Complex | BigNumber | Fraction | Unit":n=>n.abs(),bigint:n=>n<0n?-n:n,"Array | Matrix":t.referToSelf(n=>r=>zn(r,n,!0))})}),ww="addScalar",a7=["typed"],i7=fe(ww,a7,e=>{var{typed:t}=e;return t(ww,{"number, number":sw,"Complex, Complex":function(r,a){return r.add(a)},"BigNumber, BigNumber":function(r,a){return r.plus(a)},"bigint, bigint":function(r,a){return r+a},"Fraction, Fraction":function(r,a){return r.add(a)},"Unit, Unit":t.referToSelf(n=>(r,a)=>{if(r.value===null||r.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(a.value===null||a.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!r.equalBase(a))throw new Error("Units do not match");var i=r.clone();return i.value=t.find(n,[i.valueType(),a.valueType()])(i.value,a.value),i.fixPrefix=!1,i})})}),xw="subtractScalar",o7=["typed"],s7=fe(xw,o7,e=>{var{typed:t}=e;return t(xw,{"number, number":lw,"Complex, Complex":function(r,a){return r.sub(a)},"BigNumber, BigNumber":function(r,a){return r.minus(a)},"bigint, bigint":function(r,a){return r-a},"Fraction, Fraction":function(r,a){return r.sub(a)},"Unit, Unit":t.referToSelf(n=>(r,a)=>{if(r.value===null||r.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(a.value===null||a.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!r.equalBase(a))throw new Error("Units do not match");var i=r.clone();return i.value=t.find(n,[i.valueType(),a.valueType()])(i.value,a.value),i.fixPrefix=!1,i})})}),l7="matAlgo11xS0s",u7=["typed","equalScalar"],Ew=fe(l7,u7,e=>{var{typed:t,equalScalar:n}=e;return function(a,i,o,s){var l=a._values,u=a._index,c=a._ptr,f=a._size,d=a._datatype;if(!l)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var h=f[0],g=f[1],m,D=n,p=0,v=o;typeof d=="string"&&(m=d,D=t.find(n,[m,m]),p=t.convert(0,m),i=t.convert(i,m),v=t.find(o,[m,m]));for(var y=[],w=[],E=[],b=0;b<g;b++){E[b]=w.length;for(var S=c[b],A=c[b+1],C=S;C<A;C++){var T=u[C],M=s?v(i,l[C]):v(l[C],i);D(M,p)||(w.push(T),y.push(M))}}return E[g]=w.length,a.createSparseMatrix({values:y,index:w,ptr:E,size:[h,g],datatype:m})}}),c7="matAlgo12xSfs",f7=["typed","DenseMatrix"],vs=fe(c7,f7,e=>{var{typed:t,DenseMatrix:n}=e;return function(a,i,o,s){var l=a._values,u=a._index,c=a._ptr,f=a._size,d=a._datatype;if(!l)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var h=f[0],g=f[1],m,D=o;typeof d=="string"&&(m=d,i=t.convert(i,m),D=t.find(o,[m,m]));for(var p=[],v=[],y=[],w=0;w<g;w++){for(var E=w+1,b=c[w],S=c[w+1],A=b;A<S;A++){var C=u[A];v[C]=l[A],y[C]=E}for(var T=0;T<h;T++)w===0&&(p[T]=[]),y[T]===E?p[T][w]=s?D(i,v[T]):D(v[T],i):p[T][w]=s?D(i,0):D(0,i)}return new n({data:p,size:[h,g],datatype:m})}}),d7="matAlgo14xDs",h7=["typed"],Up=fe(d7,h7,e=>{var{typed:t}=e;return function(a,i,o,s){var l=a._data,u=a._size,c=a._datatype,f,d=o;typeof c=="string"&&(f=c,i=t.convert(i,f),d=t.find(o,[f,f]));var h=u.length>0?n(d,0,u,u[0],l,i,s):[];return a.createDenseMatrix({data:h,size:Ge(u),datatype:f})};function n(r,a,i,o,s,l,u){var c=[];if(a===i.length-1)for(var f=0;f<o;f++)c[f]=u?r(l,s[f]):r(s[f],l);else for(var d=0;d<o;d++)c[d]=n(r,a+1,i,i[a+1],s[d],l,u);return c}}),m7="matAlgo03xDSf",p7=["typed"],ys=fe(m7,p7,e=>{var{typed:t}=e;return function(r,a,i,o){var s=r._data,l=r._size,u=r._datatype||r.getDataType(),c=a._values,f=a._index,d=a._ptr,h=a._size,g=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(l.length!==h.length)throw new Ze(l.length,h.length);if(l[0]!==h[0]||l[1]!==h[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+h+")");if(!c)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var m=l[0],D=l[1],p,v=0,y=i;typeof u=="string"&&u===g&&u!=="mixed"&&(p=u,v=t.convert(0,p),y=t.find(i,[p,p]));for(var w=[],E=0;E<m;E++)w[E]=[];for(var b=[],S=[],A=0;A<D;A++){for(var C=A+1,T=d[A],M=d[A+1],x=T;x<M;x++){var N=f[x];b[N]=o?y(c[x],s[N][A]):y(s[N][A],c[x]),S[N]=C}for(var O=0;O<m;O++)S[O]===C?w[O][A]=b[O]:w[O][A]=o?y(v,s[O][A]):y(s[O][A],v)}return r.createDenseMatrix({data:w,size:[m,D],datatype:u===r._datatype&&g===a._datatype?p:void 0})}}),g7="matAlgo05xSfSf",v7=["typed","equalScalar"],y7=fe(g7,v7,e=>{var{typed:t,equalScalar:n}=e;return function(a,i,o){var s=a._values,l=a._index,u=a._ptr,c=a._size,f=a._datatype||a._data===void 0?a._datatype:a.getDataType(),d=i._values,h=i._index,g=i._ptr,m=i._size,D=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(c.length!==m.length)throw new Ze(c.length,m.length);if(c[0]!==m[0]||c[1]!==m[1])throw new RangeError("Dimension mismatch. Matrix A ("+c+") must match Matrix B ("+m+")");var p=c[0],v=c[1],y,w=n,E=0,b=o;typeof f=="string"&&f===D&&f!=="mixed"&&(y=f,w=t.find(n,[y,y]),E=t.convert(0,y),b=t.find(o,[y,y]));var S=s&&d?[]:void 0,A=[],C=[],T=S?[]:void 0,M=S?[]:void 0,x=[],N=[],O,z,B,k;for(z=0;z<v;z++){C[z]=A.length;var $=z+1;for(B=u[z],k=u[z+1];B<k;B++)O=l[B],A.push(O),x[O]=$,T&&(T[O]=s[B]);for(B=g[z],k=g[z+1];B<k;B++)O=h[B],x[O]!==$&&A.push(O),N[O]=$,M&&(M[O]=d[B]);if(S)for(B=C[z];B<A.length;){O=A[B];var U=x[O],Y=N[O];if(U===$||Y===$){var X=U===$?T[O]:E,P=Y===$?M[O]:E,G=b(X,P);w(G,E)?A.splice(B,1):(S.push(G),B++)}}}return C[v]=A.length,a.createSparseMatrix({values:S,index:A,ptr:C,size:[p,v],datatype:f===a._datatype&&D===i._datatype?y:void 0})}}),b7="matAlgo13xDD",D7=["typed"],S7=fe(b7,D7,e=>{var{typed:t}=e;return function(a,i,o){var s=a._data,l=a._size,u=a._datatype,c=i._data,f=i._size,d=i._datatype,h=[];if(l.length!==f.length)throw new Ze(l.length,f.length);for(var g=0;g<l.length;g++){if(l[g]!==f[g])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+f+")");h[g]=l[g]}var m,D=o;typeof u=="string"&&u===d&&(m=u,D=t.find(o,[m,m]));var p=h.length>0?n(D,0,h,h[0],s,c):[];return a.createDenseMatrix({data:p,size:h,datatype:m})};function n(r,a,i,o,s,l){var u=[];if(a===i.length-1)for(var c=0;c<o;c++)u[c]=r(s[c],l[c]);else for(var f=0;f<o;f++)u[f]=n(r,a+1,i,i[a+1],s[f],l[f]);return u}});function tn(e,t){if(si(e.size(),t.size()))return[e,t];var n=QS(e.size(),t.size());return[e,t].map(r=>w7(r,n))}function w7(e,t){return si(e.size(),t)?e:e.create(kp(e.valueOf(),t),e.datatype())}var x7="matrixAlgorithmSuite",E7=["typed","matrix"],Vi=fe(x7,E7,e=>{var{typed:t,matrix:n}=e,r=S7({typed:t}),a=Up({typed:t});return function(o){var s=o.elop,l=o.SD||o.DS,u;s?(u={"DenseMatrix, DenseMatrix":(h,g)=>r(...tn(h,g),s),"Array, Array":(h,g)=>r(...tn(n(h),n(g)),s).valueOf(),"Array, DenseMatrix":(h,g)=>r(...tn(n(h),g),s),"DenseMatrix, Array":(h,g)=>r(...tn(h,n(g)),s)},o.SS&&(u["SparseMatrix, SparseMatrix"]=(h,g)=>o.SS(...tn(h,g),s,!1)),o.DS&&(u["DenseMatrix, SparseMatrix"]=(h,g)=>o.DS(...tn(h,g),s,!1),u["Array, SparseMatrix"]=(h,g)=>o.DS(...tn(n(h),g),s,!1)),l&&(u["SparseMatrix, DenseMatrix"]=(h,g)=>l(...tn(g,h),s,!0),u["SparseMatrix, Array"]=(h,g)=>l(...tn(n(g),h),s,!0))):(u={"DenseMatrix, DenseMatrix":t.referToSelf(h=>(g,m)=>r(...tn(g,m),h)),"Array, Array":t.referToSelf(h=>(g,m)=>r(...tn(n(g),n(m)),h).valueOf()),"Array, DenseMatrix":t.referToSelf(h=>(g,m)=>r(...tn(n(g),m),h)),"DenseMatrix, Array":t.referToSelf(h=>(g,m)=>r(...tn(g,n(m)),h))},o.SS&&(u["SparseMatrix, SparseMatrix"]=t.referToSelf(h=>(g,m)=>o.SS(...tn(g,m),h,!1))),o.DS&&(u["DenseMatrix, SparseMatrix"]=t.referToSelf(h=>(g,m)=>o.DS(...tn(g,m),h,!1)),u["Array, SparseMatrix"]=t.referToSelf(h=>(g,m)=>o.DS(...tn(n(g),m),h,!1))),l&&(u["SparseMatrix, DenseMatrix"]=t.referToSelf(h=>(g,m)=>l(...tn(m,g),h,!0)),u["SparseMatrix, Array"]=t.referToSelf(h=>(g,m)=>l(...tn(n(m),g),h,!0))));var c=o.scalar||"any",f=o.Ds||o.Ss;f&&(s?(u["DenseMatrix,"+c]=(h,g)=>a(h,g,s,!1),u[c+", DenseMatrix"]=(h,g)=>a(g,h,s,!0),u["Array,"+c]=(h,g)=>a(n(h),g,s,!1).valueOf(),u[c+", Array"]=(h,g)=>a(n(g),h,s,!0).valueOf()):(u["DenseMatrix,"+c]=t.referToSelf(h=>(g,m)=>a(g,m,h,!1)),u[c+", DenseMatrix"]=t.referToSelf(h=>(g,m)=>a(m,g,h,!0)),u["Array,"+c]=t.referToSelf(h=>(g,m)=>a(n(g),m,h,!1).valueOf()),u[c+", Array"]=t.referToSelf(h=>(g,m)=>a(n(m),g,h,!0).valueOf())));var d=o.sS!==void 0?o.sS:o.Ss;return s?(o.Ss&&(u["SparseMatrix,"+c]=(h,g)=>o.Ss(h,g,s,!1)),d&&(u[c+", SparseMatrix"]=(h,g)=>d(g,h,s,!0))):(o.Ss&&(u["SparseMatrix,"+c]=t.referToSelf(h=>(g,m)=>o.Ss(g,m,h,!1))),d&&(u[c+", SparseMatrix"]=t.referToSelf(h=>(g,m)=>d(m,g,h,!0)))),s&&s.signatures&&pS(u,s.signatures),u}}),A7="matAlgo01xDSid",C7=["typed"],Aw=fe(A7,C7,e=>{var{typed:t}=e;return function(r,a,i,o){var s=r._data,l=r._size,u=r._datatype||r.getDataType(),c=a._values,f=a._index,d=a._ptr,h=a._size,g=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(l.length!==h.length)throw new Ze(l.length,h.length);if(l[0]!==h[0]||l[1]!==h[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+h+")");if(!c)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var m=l[0],D=l[1],p=typeof u=="string"&&u!=="mixed"&&u===g?u:void 0,v=p?t.find(i,[p,p]):i,y,w,E=[];for(y=0;y<m;y++)E[y]=[];var b=[],S=[];for(w=0;w<D;w++){for(var A=w+1,C=d[w],T=d[w+1],M=C;M<T;M++)y=f[M],b[y]=o?v(c[M],s[y][w]):v(s[y][w],c[M]),S[y]=A;for(y=0;y<m;y++)S[y]===A?E[y][w]=b[y]:E[y][w]=s[y][w]}return r.createDenseMatrix({data:E,size:[m,D],datatype:u===r._datatype&&g===a._datatype?p:void 0})}}),T7="matAlgo04xSidSid",M7=["typed","equalScalar"],_7=fe(T7,M7,e=>{var{typed:t,equalScalar:n}=e;return function(a,i,o){var s=a._values,l=a._index,u=a._ptr,c=a._size,f=a._datatype||a._data===void 0?a._datatype:a.getDataType(),d=i._values,h=i._index,g=i._ptr,m=i._size,D=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(c.length!==m.length)throw new Ze(c.length,m.length);if(c[0]!==m[0]||c[1]!==m[1])throw new RangeError("Dimension mismatch. Matrix A ("+c+") must match Matrix B ("+m+")");var p=c[0],v=c[1],y,w=n,E=0,b=o;typeof f=="string"&&f===D&&f!=="mixed"&&(y=f,w=t.find(n,[y,y]),E=t.convert(0,y),b=t.find(o,[y,y]));var S=s&&d?[]:void 0,A=[],C=[],T=s&&d?[]:void 0,M=s&&d?[]:void 0,x=[],N=[],O,z,B,k,$;for(z=0;z<v;z++){C[z]=A.length;var U=z+1;for(k=u[z],$=u[z+1],B=k;B<$;B++)O=l[B],A.push(O),x[O]=U,T&&(T[O]=s[B]);for(k=g[z],$=g[z+1],B=k;B<$;B++)if(O=h[B],x[O]===U){if(T){var Y=b(T[O],d[B]);w(Y,E)?x[O]=null:T[O]=Y}}else A.push(O),N[O]=U,M&&(M[O]=d[B]);if(T&&M)for(B=C[z];B<A.length;)O=A[B],x[O]===U?(S[B]=T[O],B++):N[O]===U?(S[B]=M[O],B++):A.splice(B,1)}return C[v]=A.length,a.createSparseMatrix({values:S,index:A,ptr:C,size:[p,v],datatype:f===a._datatype&&D===i._datatype?y:void 0})}}),N7="matAlgo10xSids",F7=["typed","DenseMatrix"],Cw=fe(N7,F7,e=>{var{typed:t,DenseMatrix:n}=e;return function(a,i,o,s){var l=a._values,u=a._index,c=a._ptr,f=a._size,d=a._datatype;if(!l)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var h=f[0],g=f[1],m,D=o;typeof d=="string"&&(m=d,i=t.convert(i,m),D=t.find(o,[m,m]));for(var p=[],v=[],y=[],w=0;w<g;w++){for(var E=w+1,b=c[w],S=c[w+1],A=b;A<S;A++){var C=u[A];v[C]=l[A],y[C]=E}for(var T=0;T<h;T++)w===0&&(p[T]=[]),y[T]===E?p[T][w]=s?D(i,v[T]):D(v[T],i):p[T][w]=i}return new n({data:p,size:[h,g],datatype:m})}}),B7="multiplyScalar",O7=["typed"],R7=fe(B7,O7,e=>{var{typed:t}=e;return t("multiplyScalar",{"number, number":uw,"Complex, Complex":function(r,a){return r.mul(a)},"BigNumber, BigNumber":function(r,a){return r.times(a)},"bigint, bigint":function(r,a){return r*a},"Fraction, Fraction":function(r,a){return r.mul(a)},"number | Fraction | BigNumber | Complex, Unit":(n,r)=>r.multiply(n),"Unit, number | Fraction | BigNumber | Complex | Unit":(n,r)=>n.multiply(r)})}),Tw="multiply",z7=["typed","matrix","addScalar","multiplyScalar","equalScalar","dot"],k7=fe(Tw,z7,e=>{var{typed:t,matrix:n,addScalar:r,multiplyScalar:a,equalScalar:i,dot:o}=e,s=Ew({typed:t,equalScalar:i}),l=Up({typed:t});function u(E,b){switch(E.length){case 1:switch(b.length){case 1:if(E[0]!==b[0])throw new RangeError("Dimension mismatch in multiplication. Vectors must have the same length");break;case 2:if(E[0]!==b[0])throw new RangeError("Dimension mismatch in multiplication. Vector length ("+E[0]+") must match Matrix rows ("+b[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+b.length+" dimensions)")}break;case 2:switch(b.length){case 1:if(E[1]!==b[0])throw new RangeError("Dimension mismatch in multiplication. Matrix columns ("+E[1]+") must match Vector length ("+b[0]+")");break;case 2:if(E[1]!==b[0])throw new RangeError("Dimension mismatch in multiplication. Matrix A columns ("+E[1]+") must match Matrix B rows ("+b[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+b.length+" dimensions)")}break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix A has "+E.length+" dimensions)")}}function c(E,b,S){if(S===0)throw new Error("Cannot multiply two empty vectors");return o(E,b)}function f(E,b){if(b.storage()!=="dense")throw new Error("Support for SparseMatrix not implemented");return d(E,b)}function d(E,b){var S=E._data,A=E._size,C=E._datatype||E.getDataType(),T=b._data,M=b._size,x=b._datatype||b.getDataType(),N=A[0],O=M[1],z,B=r,k=a;C&&x&&C===x&&typeof C=="string"&&C!=="mixed"&&(z=C,B=t.find(r,[z,z]),k=t.find(a,[z,z]));for(var $=[],U=0;U<O;U++){for(var Y=k(S[0],T[0][U]),X=1;X<N;X++)Y=B(Y,k(S[X],T[X][U]));$[U]=Y}return E.createDenseMatrix({data:$,size:[O],datatype:C===E._datatype&&x===b._datatype?z:void 0})}var h=t("_multiplyMatrixVector",{"DenseMatrix, any":m,"SparseMatrix, any":v}),g=t("_multiplyMatrixMatrix",{"DenseMatrix, DenseMatrix":D,"DenseMatrix, SparseMatrix":p,"SparseMatrix, DenseMatrix":y,"SparseMatrix, SparseMatrix":w});function m(E,b){var S=E._data,A=E._size,C=E._datatype||E.getDataType(),T=b._data,M=b._datatype||b.getDataType(),x=A[0],N=A[1],O,z=r,B=a;C&&M&&C===M&&typeof C=="string"&&C!=="mixed"&&(O=C,z=t.find(r,[O,O]),B=t.find(a,[O,O]));for(var k=[],$=0;$<x;$++){for(var U=S[$],Y=B(U[0],T[0]),X=1;X<N;X++)Y=z(Y,B(U[X],T[X]));k[$]=Y}return E.createDenseMatrix({data:k,size:[x],datatype:C===E._datatype&&M===b._datatype?O:void 0})}function D(E,b){var S=E._data,A=E._size,C=E._datatype||E.getDataType(),T=b._data,M=b._size,x=b._datatype||b.getDataType(),N=A[0],O=A[1],z=M[1],B,k=r,$=a;C&&x&&C===x&&typeof C=="string"&&C!=="mixed"&&C!=="mixed"&&(B=C,k=t.find(r,[B,B]),$=t.find(a,[B,B]));for(var U=[],Y=0;Y<N;Y++){var X=S[Y];U[Y]=[];for(var P=0;P<z;P++){for(var G=$(X[0],T[0][P]),q=1;q<O;q++)G=k(G,$(X[q],T[q][P]));U[Y][P]=G}}return E.createDenseMatrix({data:U,size:[N,z],datatype:C===E._datatype&&x===b._datatype?B:void 0})}function p(E,b){var S=E._data,A=E._size,C=E._datatype||E.getDataType(),T=b._values,M=b._index,x=b._ptr,N=b._size,O=b._datatype||b._data===void 0?b._datatype:b.getDataType();if(!T)throw new Error("Cannot multiply Dense Matrix times Pattern only Matrix");var z=A[0],B=N[1],k,$=r,U=a,Y=i,X=0;C&&O&&C===O&&typeof C=="string"&&C!=="mixed"&&(k=C,$=t.find(r,[k,k]),U=t.find(a,[k,k]),Y=t.find(i,[k,k]),X=t.convert(0,k));for(var P=[],G=[],q=[],L=b.createSparseMatrix({values:P,index:G,ptr:q,size:[z,B],datatype:C===E._datatype&&O===b._datatype?k:void 0}),j=0;j<B;j++){q[j]=G.length;var V=x[j],te=x[j+1];if(te>V)for(var ee=0,ne=0;ne<z;ne++){for(var se=ne+1,W=void 0,de=V;de<te;de++){var me=M[de];ee!==se?(W=U(S[ne][me],T[de]),ee=se):W=$(W,U(S[ne][me],T[de]))}ee===se&&!Y(W,X)&&(G.push(ne),P.push(W))}}return q[B]=G.length,L}function v(E,b){var S=E._values,A=E._index,C=E._ptr,T=E._datatype||E._data===void 0?E._datatype:E.getDataType();if(!S)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var M=b._data,x=b._datatype||b.getDataType(),N=E._size[0],O=b._size[0],z=[],B=[],k=[],$,U=r,Y=a,X=i,P=0;T&&x&&T===x&&typeof T=="string"&&T!=="mixed"&&($=T,U=t.find(r,[$,$]),Y=t.find(a,[$,$]),X=t.find(i,[$,$]),P=t.convert(0,$));var G=[],q=[];k[0]=0;for(var L=0;L<O;L++){var j=M[L];if(!X(j,P))for(var V=C[L],te=C[L+1],ee=V;ee<te;ee++){var ne=A[ee];q[ne]?G[ne]=U(G[ne],Y(j,S[ee])):(q[ne]=!0,B.push(ne),G[ne]=Y(j,S[ee]))}}for(var se=B.length,W=0;W<se;W++){var de=B[W];z[W]=G[de]}return k[1]=B.length,E.createSparseMatrix({values:z,index:B,ptr:k,size:[N,1],datatype:T===E._datatype&&x===b._datatype?$:void 0})}function y(E,b){var S=E._values,A=E._index,C=E._ptr,T=E._datatype||E._data===void 0?E._datatype:E.getDataType();if(!S)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var M=b._data,x=b._datatype||b.getDataType(),N=E._size[0],O=b._size[0],z=b._size[1],B,k=r,$=a,U=i,Y=0;T&&x&&T===x&&typeof T=="string"&&T!=="mixed"&&(B=T,k=t.find(r,[B,B]),$=t.find(a,[B,B]),U=t.find(i,[B,B]),Y=t.convert(0,B));for(var X=[],P=[],G=[],q=E.createSparseMatrix({values:X,index:P,ptr:G,size:[N,z],datatype:T===E._datatype&&x===b._datatype?B:void 0}),L=[],j=[],V=0;V<z;V++){G[V]=P.length;for(var te=V+1,ee=0;ee<O;ee++){var ne=M[ee][V];if(!U(ne,Y))for(var se=C[ee],W=C[ee+1],de=se;de<W;de++){var me=A[de];j[me]!==te?(j[me]=te,P.push(me),L[me]=$(ne,S[de])):L[me]=k(L[me],$(ne,S[de]))}}for(var be=G[V],xe=P.length,Ee=be;Ee<xe;Ee++){var Te=P[Ee];X[Ee]=L[Te]}}return G[z]=P.length,q}function w(E,b){var S=E._values,A=E._index,C=E._ptr,T=E._datatype||E._data===void 0?E._datatype:E.getDataType(),M=b._values,x=b._index,N=b._ptr,O=b._datatype||b._data===void 0?b._datatype:b.getDataType(),z=E._size[0],B=b._size[1],k=S&&M,$,U=r,Y=a;T&&O&&T===O&&typeof T=="string"&&T!=="mixed"&&($=T,U=t.find(r,[$,$]),Y=t.find(a,[$,$]));for(var X=k?[]:void 0,P=[],G=[],q=E.createSparseMatrix({values:X,index:P,ptr:G,size:[z,B],datatype:T===E._datatype&&O===b._datatype?$:void 0}),L=k?[]:void 0,j=[],V,te,ee,ne,se,W,de,me,be=0;be<B;be++){G[be]=P.length;var xe=be+1;for(se=N[be],W=N[be+1],ne=se;ne<W;ne++)if(me=x[ne],k)for(te=C[me],ee=C[me+1],V=te;V<ee;V++)de=A[V],j[de]!==xe?(j[de]=xe,P.push(de),L[de]=Y(M[ne],S[V])):L[de]=U(L[de],Y(M[ne],S[V]));else for(te=C[me],ee=C[me+1],V=te;V<ee;V++)de=A[V],j[de]!==xe&&(j[de]=xe,P.push(de));if(k)for(var Ee=G[be],Te=P.length,He=Ee;He<Te;He++){var Be=P[He];X[He]=L[Be]}}return G[B]=P.length,q}return t(Tw,a,{"Array, Array":t.referTo("Matrix, Matrix",E=>(b,S)=>{u(bt(b),bt(S));var A=E(n(b),n(S));return We(A)?A.valueOf():A}),"Matrix, Matrix":function(b,S){var A=b.size(),C=S.size();return u(A,C),A.length===1?C.length===1?c(b,S,A[0]):f(b,S):C.length===1?h(b,S):g(b,S)},"Matrix, Array":t.referTo("Matrix,Matrix",E=>(b,S)=>E(b,n(S))),"Array, Matrix":t.referToSelf(E=>(b,S)=>E(n(b,S.storage()),S)),"SparseMatrix, any":function(b,S){return s(b,S,a,!1)},"DenseMatrix, any":function(b,S){return l(b,S,a,!1)},"any, SparseMatrix":function(b,S){return s(S,b,a,!0)},"any, DenseMatrix":function(b,S){return l(S,b,a,!0)},"Array, any":function(b,S){return l(n(b),S,a,!1).valueOf()},"any, Array":function(b,S){return l(n(S),b,a,!0).valueOf()},"any, any":a,"any, any, ...any":t.referToSelf(E=>(b,S,A)=>{for(var C=E(b,S),T=0;T<A.length;T++)C=E(C,A[T]);return C})})}),Mw="sign",$7=["typed","BigNumber","Fraction","complex"],I7=fe(Mw,$7,e=>{var{typed:t,BigNumber:n,complex:r,Fraction:a}=e;return t(Mw,{number:Ip,Complex:function(o){return o.im===0?r(Ip(o.re)):o.sign()},BigNumber:function(o){return new n(o.cmp(0))},bigint:function(o){return o>0n?1n:o<0n?-1n:0n},Fraction:function(o){return o.n===0n?new a(0):new a(o.s)},"Array | Matrix":t.referToSelf(i=>o=>zn(o,i,!0)),Unit:t.referToSelf(i=>o=>{if(!o._isDerived()&&o.units[0].unit.offset!==0)throw new TypeError("sign is ambiguous for units with offset");return t.find(i,o.valueType())(o.value)})})}),U7="sqrt",L7=["config","typed","Complex"],P7=fe(U7,L7,e=>{var{config:t,typed:n,Complex:r}=e;return n("sqrt",{number:a,Complex:function(o){return o.sqrt()},BigNumber:function(o){return!o.isNegative()||t.predictable?o.sqrt():a(o.toNumber())},Unit:function(o){return o.pow(.5)}});function a(i){return isNaN(i)?NaN:i>=0||t.predictable?Math.sqrt(i):new r(i,0).sqrt()}}),_w="subtract",j7=["typed","matrix","equalScalar","subtractScalar","unaryMinus","DenseMatrix","concat"],H7=fe(_w,j7,e=>{var{typed:t,matrix:n,equalScalar:r,subtractScalar:a,unaryMinus:i,DenseMatrix:o,concat:s}=e,l=Aw({typed:t}),u=ys({typed:t}),c=y7({typed:t,equalScalar:r}),f=Cw({typed:t,DenseMatrix:o}),d=vs({typed:t,DenseMatrix:o}),h=Vi({typed:t,matrix:n,concat:s});return t(_w,{"any, any":a},h({elop:a,SS:c,DS:l,SD:u,Ss:d,sS:f}))}),q7="matAlgo07xSSf",Y7=["typed","SparseMatrix"],Ql=fe(q7,Y7,e=>{var{typed:t,SparseMatrix:n}=e;return function(i,o,s){var l=i._size,u=i._datatype||i._data===void 0?i._datatype:i.getDataType(),c=o._size,f=o._datatype||o._data===void 0?o._datatype:o.getDataType();if(l.length!==c.length)throw new Ze(l.length,c.length);if(l[0]!==c[0]||l[1]!==c[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+c+")");var d=l[0],h=l[1],g,m=0,D=s;typeof u=="string"&&u===f&&u!=="mixed"&&(g=u,m=t.convert(0,g),D=t.find(s,[g,g]));for(var p=[],v=[],y=new Array(h+1).fill(0),w=[],E=[],b=[],S=[],A=0;A<h;A++){var C=A+1,T=0;r(i,A,b,w,C),r(o,A,S,E,C);for(var M=0;M<d;M++){var x=b[M]===C?w[M]:m,N=S[M]===C?E[M]:m,O=D(x,N);O!==0&&O!==!1&&(v.push(M),p.push(O),T++)}y[A+1]=y[A]+T}return new n({values:p,index:v,ptr:y,size:[d,h],datatype:u===i._datatype&&f===o._datatype?g:void 0})};function r(a,i,o,s,l){for(var u=a._values,c=a._index,f=a._ptr,d=f[i],h=f[i+1];d<h;d++){var g=c[d];o[g]=l,s[g]=u[d]}}}),Nw="conj",G7=["typed"],V7=fe(Nw,G7,e=>{var{typed:t}=e;return t(Nw,{"number | BigNumber | Fraction":n=>n,Complex:n=>n.conjugate(),Unit:t.referToSelf(n=>r=>new r.constructor(n(r.toNumeric()),r.formatUnits())),"Array | Matrix":t.referToSelf(n=>r=>zn(r,n))})}),Fw="im",X7=["typed"],Z7=fe(Fw,X7,e=>{var{typed:t}=e;return t(Fw,{number:()=>0,"BigNumber | Fraction":n=>n.mul(0),Complex:n=>n.im,"Array | Matrix":t.referToSelf(n=>r=>zn(r,n))})}),Bw="re",K7=["typed"],Q7=fe(Bw,K7,e=>{var{typed:t}=e;return t(Bw,{"number | BigNumber | Fraction":n=>n,Complex:n=>n.re,"Array | Matrix":t.referToSelf(n=>r=>zn(r,n))})}),Ow="concat",W7=["typed","matrix","isInteger"],J7=fe(Ow,W7,e=>{var{typed:t,matrix:n,isInteger:r}=e;return t(Ow,{"...Array | Matrix | number | BigNumber":function(i){var o,s=i.length,l=-1,u,c=!1,f=[];for(o=0;o<s;o++){var d=i[o];if(We(d)&&(c=!0),ct(d)||Mt(d)){if(o!==s-1)throw new Error("Dimension must be specified as last argument");if(u=l,l=d.valueOf(),!r(l))throw new TypeError("Integer number expected for dimension");if(l<0||o>0&&l>u)throw new hi(l,u+1)}else{var h=Ge(d).valueOf(),g=bt(h);if(f[o]=h,u=l,l=g.length-1,o>0&&l!==u)throw new Ze(u+1,l+1)}}if(f.length===0)throw new SyntaxError("At least one matrix expected");for(var m=f.shift();f.length;)m=KS(m,f.shift(),l);return c?n(m):m},"...string":function(i){return i.join("")}})}),Rw="column",eN=["typed","Index","matrix","range"],tN=fe(Rw,eN,e=>{var{typed:t,Index:n,matrix:r,range:a}=e;return t(Rw,{"Matrix, number":i,"Array, number":function(s,l){return i(r(Ge(s)),l).valueOf()}});function i(o,s){if(o.size().length!==2)throw new Error("Only two dimensional matrix is supported");_t(s,o.size()[1]);var l=a(0,o.size()[0]),u=new n(l,s),c=o.subset(u);return We(c)?c:r([[c]])}}),zw="diag",nN=["typed","matrix","DenseMatrix","SparseMatrix"],rN=fe(zw,nN,e=>{var{typed:t,matrix:n,DenseMatrix:r,SparseMatrix:a}=e;return t(zw,{Array:function(u){return i(u,0,bt(u),null)},"Array, number":function(u,c){return i(u,c,bt(u),null)},"Array, BigNumber":function(u,c){return i(u,c.toNumber(),bt(u),null)},"Array, string":function(u,c){return i(u,0,bt(u),c)},"Array, number, string":function(u,c,f){return i(u,c,bt(u),f)},"Array, BigNumber, string":function(u,c,f){return i(u,c.toNumber(),bt(u),f)},Matrix:function(u){return i(u,0,u.size(),u.storage())},"Matrix, number":function(u,c){return i(u,c,u.size(),u.storage())},"Matrix, BigNumber":function(u,c){return i(u,c.toNumber(),u.size(),u.storage())},"Matrix, string":function(u,c){return i(u,0,u.size(),c)},"Matrix, number, string":function(u,c,f){return i(u,c,u.size(),f)},"Matrix, BigNumber, string":function(u,c,f){return i(u,c.toNumber(),u.size(),f)}});function i(l,u,c,f){if(!pt(u))throw new TypeError("Second parameter in function diag must be an integer");var d=u>0?u:0,h=u<0?-u:0;switch(c.length){case 1:return o(l,u,f,c[0],h,d);case 2:return s(l,u,f,c,h,d)}throw new RangeError("Matrix for function diag must be 2 dimensional")}function o(l,u,c,f,d,h){var g=[f+d,f+h];if(c&&c!=="sparse"&&c!=="dense")throw new TypeError("Unknown matrix type ".concat(c,'"'));var m=c==="sparse"?a.diagonal(g,l,u):r.diagonal(g,l,u);return c!==null?m:m.valueOf()}function s(l,u,c,f,d,h){if(We(l)){var g=l.diagonal(u);return c!==null?c!==g.storage()?n(g,c):g:g.valueOf()}for(var m=Math.min(f[0]-d,f[1]-h),D=[],p=0;p<m;p++)D[p]=l[p+d][p+h];return c!==null?n(D):D}}),kw="flatten",aN=["typed"],iN=fe(kw,aN,e=>{var{typed:t}=e;return t(kw,{Array:function(r){return zp(r)},Matrix:function(r){return r.create(zp(r.valueOf(),!0),r.datatype())}})}),$w="getMatrixDataType",oN=["typed"],sN=fe($w,oN,e=>{var{typed:t}=e;return t($w,{Array:function(r){return Mf(r,Zn)},Matrix:function(r){return r.getDataType()}})}),Iw="identity",lN=["typed","config","matrix","BigNumber","DenseMatrix","SparseMatrix"],uN=fe(Iw,lN,e=>{var{typed:t,config:n,matrix:r,BigNumber:a,DenseMatrix:i,SparseMatrix:o}=e;return t(Iw,{"":function(){return n.matrix==="Matrix"?r([]):[]},string:function(c){return r(c)},"number | BigNumber":function(c){return l(c,c,n.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, string":function(c,f){return l(c,c,f)},"number | BigNumber, number | BigNumber":function(c,f){return l(c,f,n.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, number | BigNumber, string":function(c,f,d){return l(c,f,d)},Array:function(c){return s(c)},"Array, string":function(c,f){return s(c,f)},Matrix:function(c){return s(c.valueOf(),c.storage())},"Matrix, string":function(c,f){return s(c.valueOf(),f)}});function s(u,c){switch(u.length){case 0:return c?r(c):[];case 1:return l(u[0],u[0],c);case 2:return l(u[0],u[1],c);default:throw new Error("Vector containing two values expected")}}function l(u,c,f){var d=Mt(u)||Mt(c)?a:null;if(Mt(u)&&(u=u.toNumber()),Mt(c)&&(c=c.toNumber()),!pt(u)||u<1)throw new Error("Parameters in function identity must be positive integers");if(!pt(c)||c<1)throw new Error("Parameters in function identity must be positive integers");var h=d?new a(1):1,g=d?new d(0):0,m=[u,c];if(f){if(f==="sparse")return o.diagonal(m,h,0,g);if(f==="dense")return i.diagonal(m,h,0,g);throw new TypeError('Unknown matrix type "'.concat(f,'"'))}for(var D=Tf([],m,g),p=u<c?u:c,v=0;v<p;v++)D[v][v]=h;return D}});function Uw(){throw new Error('No "bignumber" implementation available')}function cN(){throw new Error('No "fraction" implementation available')}function Lw(){throw new Error('No "matrix" implementation available')}var Pw="range",fN=["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],dN=fe(Pw,fN,e=>{var{typed:t,config:n,matrix:r,bignumber:a,smaller:i,smallerEq:o,larger:s,largerEq:l,add:u,isPositive:c}=e;return t(Pw,{string:d,"string, boolean":d,number:function(D){throw new TypeError("Too few arguments to function range(): ".concat(D))},boolean:function(D){throw new TypeError("Unexpected type of argument 1 to function range(): ".concat(D,", number|bigint|BigNumber|Fraction"))},"number, number":function(D,p){return f(h(D,p,1,!1))},"number, number, number":function(D,p,v){return f(h(D,p,v,!1))},"number, number, boolean":function(D,p,v){return f(h(D,p,1,v))},"number, number, number, boolean":function(D,p,v,y){return f(h(D,p,v,y))},"bigint, bigint|number":function(D,p){return f(h(D,p,1n,!1))},"number, bigint":function(D,p){return f(h(BigInt(D),p,1n,!1))},"bigint, bigint|number, bigint|number":function(D,p,v){return f(h(D,p,BigInt(v),!1))},"number, bigint, bigint|number":function(D,p,v){return f(h(BigInt(D),p,BigInt(v),!1))},"bigint, bigint|number, boolean":function(D,p,v){return f(h(D,p,1n,v))},"number, bigint, boolean":function(D,p,v){return f(h(BigInt(D),p,1n,v))},"bigint, bigint|number, bigint|number, boolean":function(D,p,v,y){return f(h(D,p,BigInt(v),y))},"number, bigint, bigint|number, boolean":function(D,p,v,y){return f(h(BigInt(D),p,BigInt(v),y))},"BigNumber, BigNumber":function(D,p){var v=D.constructor;return f(h(D,p,new v(1),!1))},"BigNumber, BigNumber, BigNumber":function(D,p,v){return f(h(D,p,v,!1))},"BigNumber, BigNumber, boolean":function(D,p,v){var y=D.constructor;return f(h(D,p,new y(1),v))},"BigNumber, BigNumber, BigNumber, boolean":function(D,p,v,y){return f(h(D,p,v,y))},"Fraction, Fraction":function(D,p){return f(h(D,p,1,!1))},"Fraction, Fraction, Fraction":function(D,p,v){return f(h(D,p,v,!1))},"Fraction, Fraction, boolean":function(D,p,v){return f(h(D,p,1,v))},"Fraction, Fraction, Fraction, boolean":function(D,p,v,y){return f(h(D,p,v,y))},"Unit, Unit, Unit":function(D,p,v){return f(h(D,p,v,!1))},"Unit, Unit, Unit, boolean":function(D,p,v,y){return f(h(D,p,v,y))}});function f(m){return n.matrix==="Matrix"?r?r(m):Lw():m}function d(m,D){var p=g(m);if(!p)throw new SyntaxError('String "'+m+'" is no valid range');return n.number==="BigNumber"?(a===void 0&&Uw(),f(h(a(p.start),a(p.end),a(p.step)))):f(h(p.start,p.end,p.step,D))}function h(m,D,p,v){for(var y=[],w=c(p)?v?o:i:v?l:s,E=m;w(E,D);)y.push(E),E=u(E,p);return y}function g(m){var D=m.split(":"),p=D.map(function(y){return Number(y)}),v=p.some(function(y){return isNaN(y)});if(v)return null;switch(p.length){case 2:return{start:p[0],end:p[1],step:1};case 3:return{start:p[0],end:p[2],step:p[1]};default:return null}}}),jw="reshape",hN=["typed","isInteger","matrix"],mN=fe(jw,hN,e=>{var{typed:t,isInteger:n}=e;return t(jw,{"Matrix, Array":function(a,i){return a.reshape(i,!0)},"Array, Array":function(a,i){return i.forEach(function(o){if(!n(o))throw new TypeError("Invalid size for dimension: "+o)}),Op(a,i)}})}),Hw="size",pN=["typed","config","?matrix"],gN=fe(Hw,pN,e=>{var{typed:t,config:n,matrix:r}=e;return t(Hw,{Matrix:function(i){return i.create(i.size(),"number")},Array:bt,string:function(i){return n.matrix==="Array"?[i.length]:r([i.length],"dense","number")},"number | Complex | BigNumber | Unit | boolean | null":function(i){return n.matrix==="Array"?[]:r?r([],"dense","number"):Lw()}})}),qw="transpose",vN=["typed","matrix"],yN=fe(qw,vN,e=>{var{typed:t,matrix:n}=e;return t(qw,{Array:o=>r(n(o)).valueOf(),Matrix:r,any:Ge});function r(o){var s=o.size(),l;switch(s.length){case 1:l=o.clone();break;case 2:{var u=s[0],c=s[1];if(c===0)throw new RangeError("Cannot transpose a 2D matrix with no columns (size: "+yt(s)+")");switch(o.storage()){case"dense":l=a(o,u,c);break;case"sparse":l=i(o,u,c);break}}break;default:throw new RangeError("Matrix must be a vector or two dimensional (size: "+yt(s)+")")}return l}function a(o,s,l){for(var u=o._data,c=[],f,d=0;d<l;d++){f=c[d]=[];for(var h=0;h<s;h++)f[h]=Ge(u[h][d])}return o.createDenseMatrix({data:c,size:[l,s],datatype:o._datatype})}function i(o,s,l){for(var u=o._values,c=o._index,f=o._ptr,d=u?[]:void 0,h=[],g=[],m=[],D=0;D<s;D++)m[D]=0;var p,v,y;for(p=0,v=c.length;p<v;p++)m[c[p]]++;for(var w=0,E=0;E<s;E++)g.push(w),w+=m[E],m[E]=g[E];for(g.push(w),y=0;y<l;y++)for(var b=f[y],S=f[y+1],A=b;A<S;A++){var C=m[c[A]]++;h[C]=y,u&&(d[C]=Ge(u[A]))}return o.createSparseMatrix({values:d,index:h,ptr:g,size:[l,s],datatype:o._datatype})}}),Yw="ctranspose",bN=["typed","transpose","conj"],DN=fe(Yw,bN,e=>{var{typed:t,transpose:n,conj:r}=e;return t(Yw,{any:function(i){return r(n(i))}})}),Gw="zeros",SN=["typed","config","matrix","BigNumber"],wN=fe(Gw,SN,e=>{var{typed:t,config:n,matrix:r,BigNumber:a}=e;return t(Gw,{"":function(){return n.matrix==="Array"?i([]):i([],"default")},"...number | BigNumber | string":function(u){var c=u[u.length-1];if(typeof c=="string"){var f=u.pop();return i(u,f)}else return n.matrix==="Array"?i(u):i(u,"default")},Array:i,Matrix:function(u){var c=u.storage();return i(u.valueOf(),c)},"Array | Matrix, string":function(u,c){return i(u.valueOf(),c)}});function i(l,u){var c=o(l),f=c?new a(0):0;if(s(l),u){var d=r(u);return l.length>0?d.resize(l,f):d}else{var h=[];return l.length>0?Tf(h,l,f):h}}function o(l){var u=!1;return l.forEach(function(c,f,d){Mt(c)&&(u=!0,d[f]=c.toNumber())}),u}function s(l){l.forEach(function(u){if(typeof u!="number"||!pt(u)||u<0)throw new Error("Parameters in function zeros must be positive integers")})}});function Of(e,t,n){var r;return String(e).includes("Unexpected type")?(r=arguments.length>2?" (type: "+Zn(n)+", value: "+JSON.stringify(n)+")":" (type: "+e.data.actual+")",new TypeError("Cannot calculate "+t+", unexpected type of argument"+r)):String(e).includes("complex numbers")?(r=arguments.length>2?" (type: "+Zn(n)+", value: "+JSON.stringify(n)+")":"",new TypeError("Cannot calculate "+t+", no ordering relation is defined for complex numbers"+r)):e}var xN="numeric",EN=["number","?bignumber","?fraction"],AN=fe(xN,EN,e=>{var{number:t,bignumber:n,fraction:r}=e,a={string:!0,number:!0,BigNumber:!0,Fraction:!0},i={number:o=>t(o),BigNumber:n?o=>n(o):Uw,bigint:o=>BigInt(o),Fraction:r?o=>r(o):cN};return function(s){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"number",u=arguments.length>2?arguments[2]:void 0;if(u!==void 0)throw new SyntaxError("numeric() takes one or two arguments");var c=Zn(s);if(!(c in a))throw new TypeError("Cannot convert "+s+' of type "'+c+'"; valid input types are '+Object.keys(a).join(", "));if(!(l in i))throw new TypeError("Cannot convert "+s+' to type "'+l+'"; valid output types are '+Object.keys(i).join(", "));return l===c?s:i[l](s)}}),Vw="divideScalar",CN=["typed","numeric"],TN=fe(Vw,CN,e=>{var{typed:t,numeric:n}=e;return t(Vw,{"number, number":function(a,i){return a/i},"Complex, Complex":function(a,i){return a.div(i)},"BigNumber, BigNumber":function(a,i){return a.div(i)},"bigint, bigint":function(a,i){return a/i},"Fraction, Fraction":function(a,i){return a.div(i)},"Unit, number | Complex | Fraction | BigNumber | Unit":(r,a)=>r.divide(a),"number | Fraction | Complex | BigNumber, Unit":(r,a)=>a.divideInto(r)})}),Xw="pow",MN=["typed","config","identity","multiply","matrix","inv","fraction","number","Complex"],_N=fe(Xw,MN,e=>{var{typed:t,config:n,identity:r,multiply:a,matrix:i,inv:o,number:s,fraction:l,Complex:u}=e;return t(Xw,{"number, number":c,"Complex, Complex":function(g,m){return g.pow(m)},"BigNumber, BigNumber":function(g,m){return m.isInteger()||g>=0||n.predictable?g.pow(m):new u(g.toNumber(),0).pow(m.toNumber(),0)},"bigint, bigint":(h,g)=>h**g,"Fraction, Fraction":function(g,m){var D=g.pow(m);if(D!=null)return D;if(n.predictable)throw new Error("Result of pow is non-rational and cannot be expressed as a fraction");return c(g.valueOf(),m.valueOf())},"Array, number":f,"Array, BigNumber":function(g,m){return f(g,m.toNumber())},"Matrix, number":d,"Matrix, BigNumber":function(g,m){return d(g,m.toNumber())},"Unit, number | BigNumber":function(g,m){return g.pow(m)}});function c(h,g){if(n.predictable&&!pt(g)&&h<0)try{var m=l(g),D=s(m);if((g===D||Math.abs((g-D)/g)<1e-14)&&m.d%2n===1n)return(m.n%2n===0n?1:-1)*Math.pow(-h,g)}catch{}return n.predictable&&(h<-1&&g===1/0||h>-1&&h<0&&g===-1/0)?NaN:pt(g)||h>=0||n.predictable?fw(h,g):h*h<1&&g===1/0||h*h>1&&g===-1/0?0:new u(h,0).pow(g,0)}function f(h,g){if(!pt(g))throw new TypeError("For A^b, b must be an integer (value is "+g+")");var m=bt(h);if(m.length!==2)throw new Error("For A^b, A must be 2 dimensional (A has "+m.length+" dimensions)");if(m[0]!==m[1])throw new Error("For A^b, A must be square (size is "+m[0]+"x"+m[1]+")");if(g<0)try{return f(o(h),-g)}catch(v){throw v.message==="Cannot calculate inverse, determinant is zero"?new TypeError("For A^b, when A is not invertible, b must be a positive integer (value is "+g+")"):v}for(var D=r(m[0]).valueOf(),p=h;g>=1;)(g&1)===1&&(D=a(p,D)),g>>=1,p=a(p,p);return D}function d(h,g){return i(f(h.valueOf(),g))}});function Zw(e){var{DenseMatrix:t}=e;return function(r,a,i){var o=r.size();if(o.length!==2)throw new RangeError("Matrix must be two dimensional (size: "+yt(o)+")");var s=o[0],l=o[1];if(s!==l)throw new RangeError("Matrix must be square (size: "+yt(o)+")");var u=[];if(We(a)){var c=a.size(),f=a._data;if(c.length===1){if(c[0]!==s)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var d=0;d<s;d++)u[d]=[f[d]];return new t({data:u,size:[s,1],datatype:a._datatype})}if(c.length===2){if(c[0]!==s||c[1]!==1)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");if(dS(a)){if(i){u=[];for(var h=0;h<s;h++)u[h]=[f[h][0]];return new t({data:u,size:[s,1],datatype:a._datatype})}return a}if(hS(a)){for(var g=0;g<s;g++)u[g]=[0];for(var m=a._values,D=a._index,p=a._ptr,v=p[1],y=p[0];y<v;y++){var w=D[y];u[w][0]=m[y]}return new t({data:u,size:[s,1],datatype:a._datatype})}}throw new RangeError("Dimension mismatch. The right side has to be either 1- or 2-dimensional vector.")}if(Et(a)){var E=bt(a);if(E.length===1){if(E[0]!==s)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var b=0;b<s;b++)u[b]=[a[b]];return new t({data:u,size:[s,1]})}if(E.length===2){if(E[0]!==s||E[1]!==1)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var S=0;S<s;S++)u[S]=[a[S][0]];return new t({data:u,size:[s,1]})}throw new RangeError("Dimension mismatch. The right side has to be either 1- or 2-dimensional vector.")}}}var Kw="usolve",NN=["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],FN=fe(Kw,NN,e=>{var{typed:t,matrix:n,divideScalar:r,multiplyScalar:a,subtractScalar:i,equalScalar:o,DenseMatrix:s}=e,l=Zw({DenseMatrix:s});return t(Kw,{"SparseMatrix, Array | Matrix":function(d,h){return c(d,h)},"DenseMatrix, Array | Matrix":function(d,h){return u(d,h)},"Array, Array | Matrix":function(d,h){var g=n(d),m=u(g,h);return m.valueOf()}});function u(f,d){d=l(f,d,!0);for(var h=d._data,g=f._size[0],m=f._size[1],D=[],p=f._data,v=m-1;v>=0;v--){var y=h[v][0]||0,w=void 0;if(o(y,0))w=0;else{var E=p[v][v];if(o(E,0))throw new Error("Linear system cannot be solved since matrix is singular");w=r(y,E);for(var b=v-1;b>=0;b--)h[b]=[i(h[b][0]||0,a(w,p[b][v]))]}D[v]=[w]}return new s({data:D,size:[g,1]})}function c(f,d){d=l(f,d,!0);for(var h=d._data,g=f._size[0],m=f._size[1],D=f._values,p=f._index,v=f._ptr,y=[],w=m-1;w>=0;w--){var E=h[w][0]||0;if(o(E,0))y[w]=[0];else{for(var b=0,S=[],A=[],C=v[w],T=v[w+1],M=T-1;M>=C;M--){var x=p[M];x===w?b=D[M]:x<w&&(S.push(D[M]),A.push(x))}if(o(b,0))throw new Error("Linear system cannot be solved since matrix is singular");for(var N=r(E,b),O=0,z=A.length;O<z;O++){var B=A[O];h[B]=[i(h[B][0],a(N,S[O]))]}y[w]=[N]}}return new s({data:y,size:[g,1]})}}),Qw="usolveAll",BN=["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],ON=fe(Qw,BN,e=>{var{typed:t,matrix:n,divideScalar:r,multiplyScalar:a,subtractScalar:i,equalScalar:o,DenseMatrix:s}=e,l=Zw({DenseMatrix:s});return t(Qw,{"SparseMatrix, Array | Matrix":function(d,h){return c(d,h)},"DenseMatrix, Array | Matrix":function(d,h){return u(d,h)},"Array, Array | Matrix":function(d,h){var g=n(d),m=u(g,h);return m.map(D=>D.valueOf())}});function u(f,d){for(var h=[l(f,d,!0)._data.map(A=>A[0])],g=f._data,m=f._size[0],D=f._size[1],p=D-1;p>=0;p--)for(var v=h.length,y=0;y<v;y++){var w=h[y];if(o(g[p][p],0))if(o(w[p],0)){if(y===0){var b=[...w];b[p]=1;for(var S=p-1;S>=0;S--)b[S]=i(b[S],g[S][p]);h.push(b)}}else{if(y===0)return[];h.splice(y,1),y-=1,v-=1}else{w[p]=r(w[p],g[p][p]);for(var E=p-1;E>=0;E--)w[E]=i(w[E],a(w[p],g[E][p]))}}return h.map(A=>new s({data:A.map(C=>[C]),size:[m,1]}))}function c(f,d){for(var h=[l(f,d,!0)._data.map(X=>X[0])],g=f._size[0],m=f._size[1],D=f._values,p=f._index,v=f._ptr,y=m-1;y>=0;y--)for(var w=h.length,E=0;E<w;E++){for(var b=h[E],S=[],A=[],C=v[y],T=v[y+1],M=0,x=T-1;x>=C;x--){var N=p[x];N===y?M=D[x]:N<y&&(S.push(D[x]),A.push(N))}if(o(M,0))if(o(b[y],0)){if(E===0){var k=[...b];k[y]=1;for(var $=0,U=A.length;$<U;$++){var Y=A[$];k[Y]=i(k[Y],S[$])}h.push(k)}}else{if(E===0)return[];h.splice(E,1),E-=1,w-=1}else{b[y]=r(b[y],M);for(var O=0,z=A.length;O<z;O++){var B=A[O];b[B]=i(b[B],a(b[y],S[O]))}}}return h.map(X=>new s({data:X.map(P=>[P]),size:[g,1]}))}}),Rf="equal",RN=["typed","matrix","equalScalar","DenseMatrix","concat","SparseMatrix"],zN=fe(Rf,RN,e=>{var{typed:t,matrix:n,equalScalar:r,DenseMatrix:a,concat:i,SparseMatrix:o}=e,s=ys({typed:t}),l=Ql({typed:t,SparseMatrix:o}),u=vs({typed:t,DenseMatrix:a}),c=Vi({typed:t,matrix:n,concat:i});return t(Rf,kN({typed:t,equalScalar:r}),c({elop:r,SS:l,DS:s,Ss:u}))}),kN=fe(Rf,["typed","equalScalar"],e=>{var{typed:t,equalScalar:n}=e;return t(Rf,{"any, any":function(a,i){return a===null?i===null:i===null?a===null:a===void 0?i===void 0:i===void 0?a===void 0:n(a,i)}})}),zf="smaller",$N=["typed","config","bignumber","matrix","DenseMatrix","concat","SparseMatrix"],IN=fe(zf,$N,e=>{var{typed:t,config:n,bignumber:r,matrix:a,DenseMatrix:i,concat:o,SparseMatrix:s}=e,l=ys({typed:t}),u=Ql({typed:t,SparseMatrix:s}),c=vs({typed:t,DenseMatrix:i}),f=Vi({typed:t,matrix:a,concat:o}),d=Kl({typed:t});function h(g,m){return g.lt(m)&&!gs(g,m,n.relTol,n.absTol)}return t(zf,UN({typed:t,config:n}),{"boolean, boolean":(g,m)=>g<m,"BigNumber, BigNumber":h,"bigint, bigint":(g,m)=>g<m,"Fraction, Fraction":(g,m)=>g.compare(m)===-1,"Fraction, BigNumber":function(m,D){return h(r(m),D)},"BigNumber, Fraction":function(m,D){return h(m,r(D))},"Complex, Complex":function(m,D){throw new TypeError("No ordering relation is defined for complex numbers")}},d,f({SS:u,DS:l,Ss:c}))}),UN=fe(zf,["typed","config"],e=>{var{typed:t,config:n}=e;return t(zf,{"number, number":function(a,i){return a<i&&!Da(a,i,n.relTol,n.absTol)}})}),kf="smallerEq",LN=["typed","config","matrix","DenseMatrix","concat","SparseMatrix"],PN=fe(kf,LN,e=>{var{typed:t,config:n,matrix:r,DenseMatrix:a,concat:i,SparseMatrix:o}=e,s=ys({typed:t}),l=Ql({typed:t,SparseMatrix:o}),u=vs({typed:t,DenseMatrix:a}),c=Vi({typed:t,matrix:r,concat:i}),f=Kl({typed:t});return t(kf,jN({typed:t,config:n}),{"boolean, boolean":(d,h)=>d<=h,"BigNumber, BigNumber":function(h,g){return h.lte(g)||gs(h,g,n.relTol,n.absTol)},"bigint, bigint":(d,h)=>d<=h,"Fraction, Fraction":(d,h)=>d.compare(h)!==1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},f,c({SS:l,DS:s,Ss:u}))}),jN=fe(kf,["typed","config"],e=>{var{typed:t,config:n}=e;return t(kf,{"number, number":function(a,i){return a<=i||Da(a,i,n.relTol,n.absTol)}})}),$f="larger",HN=["typed","config","bignumber","matrix","DenseMatrix","concat","SparseMatrix"],qN=fe($f,HN,e=>{var{typed:t,config:n,bignumber:r,matrix:a,DenseMatrix:i,concat:o,SparseMatrix:s}=e,l=ys({typed:t}),u=Ql({typed:t,SparseMatrix:s}),c=vs({typed:t,DenseMatrix:i}),f=Vi({typed:t,matrix:a,concat:o}),d=Kl({typed:t});function h(g,m){return g.gt(m)&&!gs(g,m,n.relTol,n.absTol)}return t($f,YN({typed:t,config:n}),{"boolean, boolean":(g,m)=>g>m,"BigNumber, BigNumber":h,"bigint, bigint":(g,m)=>g>m,"Fraction, Fraction":(g,m)=>g.compare(m)===1,"Fraction, BigNumber":function(m,D){return h(r(m),D)},"BigNumber, Fraction":function(m,D){return h(m,r(D))},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},d,f({SS:u,DS:l,Ss:c}))}),YN=fe($f,["typed","config"],e=>{var{typed:t,config:n}=e;return t($f,{"number, number":function(a,i){return a>i&&!Da(a,i,n.relTol,n.absTol)}})}),If="largerEq",GN=["typed","config","matrix","DenseMatrix","concat","SparseMatrix"],VN=fe(If,GN,e=>{var{typed:t,config:n,matrix:r,DenseMatrix:a,concat:i,SparseMatrix:o}=e,s=ys({typed:t}),l=Ql({typed:t,SparseMatrix:o}),u=vs({typed:t,DenseMatrix:a}),c=Vi({typed:t,matrix:r,concat:i}),f=Kl({typed:t});return t(If,XN({typed:t,config:n}),{"boolean, boolean":(d,h)=>d>=h,"BigNumber, BigNumber":function(h,g){return h.gte(g)||gs(h,g,n.relTol,n.absTol)},"bigint, bigint":function(h,g){return h>=g},"Fraction, Fraction":(d,h)=>d.compare(h)!==-1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},f,c({SS:l,DS:s,Ss:u}))}),XN=fe(If,["typed","config"],e=>{var{typed:t,config:n}=e;return t(If,{"number, number":function(a,i){return a>=i||Da(a,i,n.relTol,n.absTol)}})}),Ww="min",ZN=["typed","config","numeric","smaller","isNaN"],KN=fe(Ww,ZN,e=>{var{typed:t,config:n,numeric:r,smaller:a,isNaN:i}=e;return t(Ww,{"Array | Matrix":s,"Array | Matrix, number | BigNumber":function(u,c){return aw(u,c.valueOf(),o)},"...":function(u){if(nw(u))throw new TypeError("Scalar values expected in function min");return s(u)}});function o(l,u){try{return a(l,u)?l:u}catch(c){throw Of(c,"min",u)}}function s(l){var u;if(rw(l,function(c){try{(i(c)||u===void 0||a(c,u))&&(u=c)}catch(f){throw Of(f,"min",c)}}),u===void 0)throw new Error("Cannot calculate min of an empty array");return typeof u=="string"&&(u=r(u,IM(u,n))),u}}),QN="ImmutableDenseMatrix",WN=["smaller","DenseMatrix"],JN=fe(QN,WN,e=>{var{smaller:t,DenseMatrix:n}=e;function r(a,i){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if(i&&!Ar(i))throw new Error("Invalid datatype: "+i);if(We(a)||Et(a)){var o=new n(a,i);this._data=o._data,this._size=o._size,this._datatype=o._datatype,this._min=null,this._max=null}else if(a&&Et(a.data)&&Et(a.size))this._data=a.data,this._size=a.size,this._datatype=a.datatype,this._min=typeof a.min<"u"?a.min:null,this._max=typeof a.max<"u"?a.max:null;else{if(a)throw new TypeError("Unsupported type of data ("+Zn(a)+")");this._data=[],this._size=[0],this._datatype=i,this._min=null,this._max=null}}return r.prototype=new n,r.prototype.type="ImmutableDenseMatrix",r.prototype.isImmutableDenseMatrix=!0,r.prototype.subset=function(a){switch(arguments.length){case 1:{var i=n.prototype.subset.call(this,a);return We(i)?new r({data:i._data,size:i._size,datatype:i._datatype}):i}case 2:case 3:throw new Error("Cannot invoke set subset on an Immutable Matrix instance");default:throw new SyntaxError("Wrong number of arguments")}},r.prototype.set=function(){throw new Error("Cannot invoke set on an Immutable Matrix instance")},r.prototype.resize=function(){throw new Error("Cannot invoke resize on an Immutable Matrix instance")},r.prototype.reshape=function(){throw new Error("Cannot invoke reshape on an Immutable Matrix instance")},r.prototype.clone=function(){return new r({data:Ge(this._data),size:Ge(this._size),datatype:this._datatype})},r.prototype.toJSON=function(){return{mathjs:"ImmutableDenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},r.fromJSON=function(a){return new r(a)},r.prototype.swapRows=function(){throw new Error("Cannot invoke swapRows on an Immutable Matrix instance")},r.prototype.min=function(){if(this._min===null){var a=null;this.forEach(function(i){(a===null||t(i,a))&&(a=i)}),this._min=a!==null?a:void 0}return this._min},r.prototype.max=function(){if(this._max===null){var a=null;this.forEach(function(i){(a===null||t(a,i))&&(a=i)}),this._max=a!==null?a:void 0}return this._max},r},{isClass:!0}),eF="Index",tF=["ImmutableDenseMatrix","getMatrixDataType"],nF=fe(eF,tF,e=>{var{ImmutableDenseMatrix:t,getMatrixDataType:n}=e;function r(i){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");this._dimensions=[],this._sourceSize=[],this._isScalar=!0;for(var o=0,s=arguments.length;o<s;o++){var l=arguments[o],u=Et(l),c=We(l),f=typeof l,d=null;if(mS(l))this._dimensions.push(l),this._isScalar=!1;else if(u||c){var h=void 0;n(l)==="boolean"?(u&&(h=a(Jw(l).valueOf())),c&&(h=a(Jw(l._data).valueOf())),d=l.valueOf().length):h=a(l.valueOf()),this._dimensions.push(h);var g=h.size();(g.length!==1||g[0]!==1||d!==null)&&(this._isScalar=!1)}else if(f==="number")this._dimensions.push(a([l]));else if(f==="bigint")this._dimensions.push(a([Number(l)]));else if(f==="string")this._dimensions.push(l);else throw new TypeError("Dimension must be an Array, Matrix, number, bigint, string, or Range");this._sourceSize.push(d)}}r.prototype.type="Index",r.prototype.isIndex=!0;function a(i){for(var o=0,s=i.length;o<s;o++)if(typeof i[o]!="number"||!pt(i[o]))throw new TypeError("Index parameters must be positive integer numbers");return new t(i)}return r.prototype.clone=function(){var i=new r;return i._dimensions=Ge(this._dimensions),i._isScalar=this._isScalar,i._sourceSize=this._sourceSize,i},r.create=function(i){var o=new r;return r.apply(o,i),o},r.prototype.size=function(){for(var i=[],o=0,s=this._dimensions.length;o<s;o++){var l=this._dimensions[o];i[o]=typeof l=="string"?1:l.size()[0]}return i},r.prototype.max=function(){for(var i=[],o=0,s=this._dimensions.length;o<s;o++){var l=this._dimensions[o];i[o]=typeof l=="string"?l:l.max()}return i},r.prototype.min=function(){for(var i=[],o=0,s=this._dimensions.length;o<s;o++){var l=this._dimensions[o];i[o]=typeof l=="string"?l:l.min()}return i},r.prototype.forEach=function(i){for(var o=0,s=this._dimensions.length;o<s;o++)i(this._dimensions[o],o,this)},r.prototype.dimension=function(i){return typeof i!="number"?null:this._dimensions[i]||null},r.prototype.isObjectProperty=function(){return this._dimensions.length===1&&typeof this._dimensions[0]=="string"},r.prototype.getObjectProperty=function(){return this.isObjectProperty()?this._dimensions[0]:null},r.prototype.isScalar=function(){return this._isScalar},r.prototype.toArray=function(){for(var i=[],o=0,s=this._dimensions.length;o<s;o++){var l=this._dimensions[o];i.push(typeof l=="string"?l:l.toArray())}return i},r.prototype.valueOf=r.prototype.toArray,r.prototype.toString=function(){for(var i=[],o=0,s=this._dimensions.length;o<s;o++){var l=this._dimensions[o];typeof l=="string"?i.push(JSON.stringify(l)):i.push(l.toString())}return"["+i.join(", ")+"]"},r.prototype.toJSON=function(){return{mathjs:"Index",dimensions:this._dimensions}},r.fromJSON=function(i){return r.create(i.dimensions)},r},{isClass:!0});function Jw(e){var t=[];return e.forEach((n,r)=>{n&&t.push(r)}),t}var rF="atan",aF=["typed"],iF=fe(rF,aF,e=>{var{typed:t}=e;return t("atan",{number:function(r){return Math.atan(r)},Complex:function(r){return r.atan()},BigNumber:function(r){return r.atan()}})}),ex=fe("trigUnit",["typed"],e=>{var{typed:t}=e;return{Unit:t.referToSelf(n=>r=>{if(!r.hasBase(r.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function cot is no angle");return t.find(n,r.valueType())(r.value)})}}),tx="cos",oF=["typed"],sF=fe(tx,oF,e=>{var{typed:t}=e,n=ex({typed:t});return t(tx,{number:Math.cos,"Complex | BigNumber":r=>r.cos()},n)}),nx="sin",lF=["typed"],uF=fe(nx,lF,e=>{var{typed:t}=e,n=ex({typed:t});return t(nx,{number:Math.sin,"Complex | BigNumber":r=>r.sin()},n)}),rx="add",cF=["typed","matrix","addScalar","equalScalar","DenseMatrix","SparseMatrix","concat"],fF=fe(rx,cF,e=>{var{typed:t,matrix:n,addScalar:r,equalScalar:a,DenseMatrix:i,SparseMatrix:o,concat:s}=e,l=Aw({typed:t}),u=_7({typed:t,equalScalar:a}),c=Cw({typed:t,DenseMatrix:i}),f=Vi({typed:t,matrix:n,concat:s});return t(rx,{"any, any":r,"any, any, ...any":t.referToSelf(d=>(h,g,m)=>{for(var D=d(h,g),p=0;p<m.length;p++)D=d(D,m[p]);return D})},f({elop:r,DS:l,SS:u,Ss:c}))}),ax="norm",dF=["typed","abs","add","pow","conj","sqrt","multiply","equalScalar","larger","smaller","matrix","ctranspose","eigs"],hF=fe(ax,dF,e=>{var{typed:t,abs:n,add:r,pow:a,conj:i,sqrt:o,multiply:s,equalScalar:l,larger:u,smaller:c,matrix:f,ctranspose:d,eigs:h}=e;return t(ax,{number:Math.abs,Complex:function(A){return A.abs()},BigNumber:function(A){return A.abs()},boolean:function(A){return Math.abs(A)},Array:function(A){return b(f(A),2)},Matrix:function(A){return b(A,2)},"Array, number | BigNumber | string":function(A,C){return b(f(A),C)},"Matrix, number | BigNumber | string":function(A,C){return b(A,C)}});function g(S){var A=0;return S.forEach(function(C){var T=n(C);u(T,A)&&(A=T)},!0),A}function m(S){var A;return S.forEach(function(C){var T=n(C);(!A||c(T,A))&&(A=T)},!0),A||0}function D(S,A){if(A===Number.POSITIVE_INFINITY||A==="inf")return g(S);if(A===Number.NEGATIVE_INFINITY||A==="-inf")return m(S);if(A==="fro")return b(S,2);if(typeof A=="number"&&!isNaN(A)){if(!l(A,0)){var C=0;return S.forEach(function(T){C=r(a(n(T),A),C)},!0),a(C,1/A)}return Number.POSITIVE_INFINITY}throw new Error("Unsupported parameter value")}function p(S){var A=0;return S.forEach(function(C,T){A=r(A,s(C,i(C)))}),n(o(A))}function v(S){var A=[],C=0;return S.forEach(function(T,M){var x=M[1],N=r(A[x]||0,n(T));u(N,C)&&(C=N),A[x]=N},!0),C}function y(S){var A=S.size();if(A[0]!==A[1])throw new RangeError("Invalid matrix dimensions");var C=d(S),T=s(C,S),M=h(T).values.toArray(),x=M[M.length-1];return n(o(x))}function w(S){var A=[],C=0;return S.forEach(function(T,M){var x=M[0],N=r(A[x]||0,n(T));u(N,C)&&(C=N),A[x]=N},!0),C}function E(S,A){if(A===1)return v(S);if(A===Number.POSITIVE_INFINITY||A==="inf")return w(S);if(A==="fro")return p(S);if(A===2)return y(S);throw new Error("Unsupported parameter value "+A)}function b(S,A){var C=S.size();if(C.length===1)return D(S,A);if(C.length===2){if(C[0]&&C[1])return E(S,A);throw new RangeError("Invalid matrix dimensions")}}}),ix="dot",mF=["typed","addScalar","multiplyScalar","conj","size"],pF=fe(ix,mF,e=>{var{typed:t,addScalar:n,multiplyScalar:r,conj:a,size:i}=e;return t(ix,{"Array | DenseMatrix, Array | DenseMatrix":s,"SparseMatrix, SparseMatrix":l});function o(c,f){var d=u(c),h=u(f),g,m;if(d.length===1)g=d[0];else if(d.length===2&&d[1]===1)g=d[0];else throw new RangeError("Expected a column vector, instead got a matrix of size ("+d.join(", ")+")");if(h.length===1)m=h[0];else if(h.length===2&&h[1]===1)m=h[0];else throw new RangeError("Expected a column vector, instead got a matrix of size ("+h.join(", ")+")");if(g!==m)throw new RangeError("Vectors must have equal length ("+g+" != "+m+")");if(g===0)throw new RangeError("Cannot calculate the dot product of empty vectors");return g}function s(c,f){var d=o(c,f),h=We(c)?c._data:c,g=We(c)?c._datatype||c.getDataType():void 0,m=We(f)?f._data:f,D=We(f)?f._datatype||f.getDataType():void 0,p=u(c).length===2,v=u(f).length===2,y=n,w=r;if(g&&D&&g===D&&typeof g=="string"&&g!=="mixed"){var E=g;y=t.find(n,[E,E]),w=t.find(r,[E,E])}if(!p&&!v){for(var b=w(a(h[0]),m[0]),S=1;S<d;S++)b=y(b,w(a(h[S]),m[S]));return b}if(!p&&v){for(var A=w(a(h[0]),m[0][0]),C=1;C<d;C++)A=y(A,w(a(h[C]),m[C][0]));return A}if(p&&!v){for(var T=w(a(h[0][0]),m[0]),M=1;M<d;M++)T=y(T,w(a(h[M][0]),m[M]));return T}if(p&&v){for(var x=w(a(h[0][0]),m[0][0]),N=1;N<d;N++)x=y(x,w(a(h[N][0]),m[N][0]));return x}}function l(c,f){o(c,f);for(var d=c._index,h=c._values,g=f._index,m=f._values,D=0,p=n,v=r,y=0,w=0;y<d.length&&w<g.length;){var E=d[y],b=g[w];if(E<b){y++;continue}if(E>b){w++;continue}E===b&&(D=p(D,v(h[y],m[w])),y++,w++)}return D}function u(c){return We(c)?c.size():i(c)}}),ox="qr",gF=["typed","matrix","zeros","identity","isZero","equal","sign","sqrt","conj","unaryMinus","addScalar","divideScalar","multiplyScalar","subtractScalar","complex"],vF=fe(ox,gF,e=>{var{typed:t,matrix:n,zeros:r,identity:a,isZero:i,equal:o,sign:s,sqrt:l,conj:u,unaryMinus:c,addScalar:f,divideScalar:d,multiplyScalar:h,subtractScalar:g,complex:m}=e;return oi(t(ox,{DenseMatrix:function(w){return p(w)},SparseMatrix:function(w){return v()},Array:function(w){var E=n(w),b=p(E);return{Q:b.Q.valueOf(),R:b.R.valueOf()}}}),{_denseQRimpl:D});function D(y){var w=y._size[0],E=y._size[1],b=a([w],"dense"),S=b._data,A=y.clone(),C=A._data,T,M,x,N=r([w],"");for(x=0;x<Math.min(E,w);++x){var O=C[x][x],z=c(o(O,0)?1:s(O)),B=u(z),k=0;for(T=x;T<w;T++)k=f(k,h(C[T][x],u(C[T][x])));var $=h(z,l(k));if(!i($)){var U=g(O,$);for(N[x]=1,T=x+1;T<w;T++)N[T]=d(C[T][x],U);var Y=c(u(d(U,$))),X=void 0;for(M=x;M<E;M++){for(X=0,T=x;T<w;T++)X=f(X,h(u(N[T]),C[T][M]));for(X=h(X,Y),T=x;T<w;T++)C[T][M]=h(g(C[T][M],h(N[T],X)),B)}for(T=0;T<w;T++){for(X=0,M=x;M<w;M++)X=f(X,h(S[T][M],N[M]));for(X=h(X,Y),M=x;M<w;++M)S[T][M]=d(g(S[T][M],h(X,u(N[M]))),B)}}}return{Q:b,R:A,toString:function(){return"Q: "+this.Q.toString()+`
78
- R: `+this.R.toString()}}}function p(y){var w=D(y),E=w.R._data;if(y._data.length>0)for(var b=E[0][0].type==="Complex"?m(0):0,S=0;S<E.length;++S)for(var A=0;A<S&&A<(E[0]||[]).length;++A)E[S][A]=b;return w}function v(y){throw new Error("qr not implemented for sparse matrices yet")}}),sx="det",yF=["typed","matrix","subtractScalar","multiply","divideScalar","isZero","unaryMinus"],bF=fe(sx,yF,e=>{var{typed:t,matrix:n,subtractScalar:r,multiply:a,divideScalar:i,isZero:o,unaryMinus:s}=e;return t(sx,{any:function(c){return Ge(c)},"Array | Matrix":function(c){var f;switch(We(c)?f=c.size():Array.isArray(c)?(c=n(c),f=c.size()):f=[],f.length){case 0:return Ge(c);case 1:if(f[0]===1)return Ge(c.valueOf()[0]);if(f[0]===0)return 1;throw new RangeError("Matrix must be square (size: "+yt(f)+")");case 2:{var d=f[0],h=f[1];if(d===h)return l(c.clone().valueOf(),d);if(h===0)return 1;throw new RangeError("Matrix must be square (size: "+yt(f)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+yt(f)+")")}}});function l(u,c,f){if(c===1)return Ge(u[0][0]);if(c===2)return r(a(u[0][0],u[1][1]),a(u[1][0],u[0][1]));for(var d=!1,h=new Array(c).fill(0).map((S,A)=>A),g=0;g<c;g++){var m=h[g];if(o(u[m][g])){var D=void 0;for(D=g+1;D<c;D++)if(!o(u[h[D]][g])){m=h[D],h[D]=h[g],h[g]=m,d=!d;break}if(D===c)return u[m][g]}for(var p=u[m][g],v=g===0?1:u[h[g-1]][g-1],y=g+1;y<c;y++)for(var w=h[y],E=g+1;E<c;E++)u[w][E]=i(r(a(u[w][E],p),a(u[w][g],u[m][E])),v)}var b=u[h[c-1]][c-1];return d?s(b):b}}),lx="inv",DF=["typed","matrix","divideScalar","addScalar","multiply","unaryMinus","det","identity","abs"],SF=fe(lx,DF,e=>{var{typed:t,matrix:n,divideScalar:r,addScalar:a,multiply:i,unaryMinus:o,det:s,identity:l,abs:u}=e;return t(lx,{"Array | Matrix":function(d){var h=We(d)?d.size():bt(d);switch(h.length){case 1:if(h[0]===1)return We(d)?n([r(1,d.valueOf()[0])]):[r(1,d[0])];throw new RangeError("Matrix must be square (size: "+yt(h)+")");case 2:{var g=h[0],m=h[1];if(g===m)return We(d)?n(c(d.valueOf(),g,m),d.storage()):c(d,g,m);throw new RangeError("Matrix must be square (size: "+yt(h)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+yt(h)+")")}},any:function(d){return r(1,d)}});function c(f,d,h){var g,m,D,p,v;if(d===1){if(p=f[0][0],p===0)throw Error("Cannot calculate inverse, determinant is zero");return[[r(1,p)]]}else if(d===2){var y=s(f);if(y===0)throw Error("Cannot calculate inverse, determinant is zero");return[[r(f[1][1],y),r(o(f[0][1]),y)],[r(o(f[1][0]),y),r(f[0][0],y)]]}else{var w=f.concat();for(g=0;g<d;g++)w[g]=w[g].concat();for(var E=l(d).valueOf(),b=0;b<h;b++){var S=u(w[b][b]),A=b;for(g=b+1;g<d;)u(w[g][b])>S&&(S=u(w[g][b]),A=g),g++;if(S===0)throw Error("Cannot calculate inverse, determinant is zero");g=A,g!==b&&(v=w[b],w[b]=w[g],w[g]=v,v=E[b],E[b]=E[g],E[g]=v);var C=w[b],T=E[b];for(g=0;g<d;g++){var M=w[g],x=E[g];if(g!==b){if(M[b]!==0){for(D=r(o(M[b]),C[b]),m=b;m<h;m++)M[m]=a(M[m],i(D,C[m]));for(m=0;m<h;m++)x[m]=a(x[m],i(D,T[m]))}}else{for(D=C[b],m=b;m<h;m++)M[m]=r(M[m],D);for(m=0;m<h;m++)x[m]=r(x[m],D)}}}return E}}});function wF(e){var{addScalar:t,subtract:n,flatten:r,multiply:a,multiplyScalar:i,divideScalar:o,sqrt:s,abs:l,bignumber:u,diag:c,size:f,reshape:d,inv:h,qr:g,usolve:m,usolveAll:D,equal:p,complex:v,larger:y,smaller:w,matrixFromColumns:E,dot:b}=e;function S(P,G,q,L){var j=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,V=A(P,G,q,L,j);C(P,G,q,L,j,V);var{values:te,C:ee}=T(P,G,q,L,j);if(j){var ne=M(P,G,ee,V,te,q,L);return{values:te,eigenvectors:ne}}return{values:te}}function A(P,G,q,L,j){var V=L==="BigNumber",te=L==="Complex",ee=V?u(0):0,ne=V?u(1):te?v(1):1,se=V?u(1):1,W=V?u(10):2,de=i(W,W),me;j&&(me=Array(G).fill(ne));for(var be=!1;!be;){be=!0;for(var xe=0;xe<G;xe++){for(var Ee=ee,Te=ee,He=0;He<G;He++)xe!==He&&(Ee=t(Ee,l(P[He][xe])),Te=t(Te,l(P[xe][He])));if(!p(Ee,0)&&!p(Te,0)){for(var Be=se,Pe=Ee,ve=o(Te,W),R=i(Te,W);w(Pe,ve);)Pe=i(Pe,de),Be=i(Be,W);for(;y(Pe,R);)Pe=o(Pe,de),Be=o(Be,W);var I=w(o(t(Pe,Te),Be),i(t(Ee,Te),.95));if(I){be=!1;for(var H=o(1,Be),Z=0;Z<G;Z++)xe!==Z&&(P[xe][Z]=i(P[xe][Z],H),P[Z][xe]=i(P[Z][xe],Be));j&&(me[xe]=i(me[xe],H))}}}}return j?c(me):null}function C(P,G,q,L,j,V){var te=L==="BigNumber",ee=L==="Complex",ne=te?u(0):ee?v(0):0;te&&(q=u(q));for(var se=0;se<G-2;se++){for(var W=0,de=ne,me=se+1;me<G;me++){var be=P[me][se];w(l(de),l(be))&&(de=be,W=me)}if(!w(l(de),q)){if(W!==se+1){var xe=P[W];P[W]=P[se+1],P[se+1]=xe;for(var Ee=0;Ee<G;Ee++){var Te=P[Ee][W];P[Ee][W]=P[Ee][se+1],P[Ee][se+1]=Te}if(j){var He=V[W];V[W]=V[se+1],V[se+1]=He}}for(var Be=se+2;Be<G;Be++){var Pe=o(P[Be][se],de);if(Pe!==0){for(var ve=0;ve<G;ve++)P[Be][ve]=n(P[Be][ve],i(Pe,P[se+1][ve]));for(var R=0;R<G;R++)P[R][se+1]=t(P[R][se+1],i(Pe,P[R][Be]));if(j)for(var I=0;I<G;I++)V[Be][I]=n(V[Be][I],i(Pe,V[se+1][I]))}}}}return V}function T(P,G,q,L,j){var V=L==="BigNumber",te=L==="Complex",ee=V?u(1):te?v(1):1;V&&(q=u(q));for(var ne=Ge(P),se=[],W=G,de=[],me=j?c(Array(G).fill(ee)):void 0,be=j?c(Array(W).fill(ee)):void 0,xe=0;xe<=100;){xe+=1;for(var Ee=ne[W-1][W-1],Te=0;Te<W;Te++)ne[Te][Te]=n(ne[Te][Te],Ee);var{Q:He,R:Be}=g(ne);ne=a(Be,He);for(var Pe=0;Pe<W;Pe++)ne[Pe][Pe]=t(ne[Pe][Pe],Ee);if(j&&(be=a(be,He)),W===1||w(l(ne[W-1][W-2]),q)){xe=0,se.push(ne[W-1][W-1]),j&&(de.unshift([[1]]),O(be,G),me=a(me,be),W>1&&(be=c(Array(W-1).fill(ee)))),W-=1,ne.pop();for(var ve=0;ve<W;ve++)ne[ve].pop()}else if(W===2||w(l(ne[W-2][W-3]),q)){xe=0;var R=x(ne[W-2][W-2],ne[W-2][W-1],ne[W-1][W-2],ne[W-1][W-1]);se.push(...R),j&&(de.unshift(N(ne[W-2][W-2],ne[W-2][W-1],ne[W-1][W-2],ne[W-1][W-1],R[0],R[1],q,L)),O(be,G),me=a(me,be),W>2&&(be=c(Array(W-2).fill(ee)))),W-=2,ne.pop(),ne.pop();for(var I=0;I<W;I++)ne[I].pop(),ne[I].pop()}if(W===0)break}if(se.sort((ie,J)=>+n(l(ie),l(J))),xe>100){var H=Error("The eigenvalues failed to converge. Only found these eigenvalues: "+se.join(", "));throw H.values=se,H.vectors=[],H}var Z=j?a(me,z(de,G)):void 0;return{values:se,C:Z}}function M(P,G,q,L,j,V,te){var ee=h(q),ne=a(ee,P,q),se=te==="BigNumber",W=te==="Complex",de=se?u(0):W?v(0):0,me=se?u(1):W?v(1):1,be=[],xe=[];for(var Ee of j){var Te=B(be,Ee,p);Te===-1?(be.push(Ee),xe.push(1)):xe[Te]+=1}for(var He=[],Be=be.length,Pe=Array(G).fill(de),ve=c(Array(G).fill(me)),R=function(){var Z=be[I],ie=n(ne,a(Z,ve)),J=D(ie,Pe);for(J.shift();J.length<xe[I];){var ge=k(ie,G,J,V,te);if(ge===null)break;J.push(ge)}var ce=a(h(L),q);J=J.map(pe=>a(ce,pe)),He.push(...J.map(pe=>({value:Z,vector:r(pe)})))},I=0;I<Be;I++)R();return He}function x(P,G,q,L){var j=t(P,L),V=n(i(P,L),i(G,q)),te=i(j,.5),ee=i(s(n(i(j,j),i(4,V))),.5);return[t(te,ee),n(te,ee)]}function N(P,G,q,L,j,V,te,ee){var ne=ee==="BigNumber",se=ee==="Complex",W=ne?u(0):se?v(0):0,de=ne?u(1):se?v(1):1;if(w(l(q),te))return[[de,W],[W,de]];if(y(l(n(j,V)),te))return[[n(j,L),n(V,L)],[q,q]];var me=n(P,j),be=n(L,j);return w(l(G),te)&&w(l(be),te)?[[me,de],[q,W]]:[[G,W],[be,de]]}function O(P,G){for(var q=0;q<P.length;q++)P[q].push(...Array(G-P[q].length).fill(0));for(var L=P.length;L<G;L++)P.push(Array(G).fill(0)),P[L][L]=1;return P}function z(P,G){for(var q=[],L=0;L<G;L++)q[L]=Array(G).fill(0);var j=0;for(var V of P){for(var te=V.length,ee=0;ee<te;ee++)for(var ne=0;ne<te;ne++)q[j+ee][j+ne]=V[ee][ne];j+=te}return q}function B(P,G,q){for(var L=0;L<P.length;L++)if(q(P[L],G))return L;return-1}function k(P,G,q,L,j){for(var V=j==="BigNumber"?u(1e3):1e3,te,ee=0;ee<5;++ee){te=$(G,q,j);try{te=m(P,te)}catch{continue}if(y(Y(te),V))break}if(ee>=5)return null;for(ee=0;;){var ne=m(P,te);if(w(Y(U(te,[ne])),L))break;if(++ee>=10)return null;te=X(ne)}return te}function $(P,G,q){var L=q==="BigNumber",j=q==="Complex",V=Array(P).fill(0).map(te=>2*Math.random()-1);return L&&(V=V.map(te=>u(te))),j&&(V=V.map(te=>v(te))),V=U(V,G),X(V,q)}function U(P,G){var q=f(P);for(var L of G)L=d(L,q),P=n(P,a(o(b(L,P),b(L,L)),L));return P}function Y(P){return l(s(b(P,P)))}function X(P,G){var q=G==="BigNumber",L=G==="Complex",j=q?u(1):L?v(1):1;return a(o(j,Y(P)),P)}return S}function xF(e){var{config:t,addScalar:n,subtract:r,abs:a,atan:i,cos:o,sin:s,multiplyScalar:l,inv:u,bignumber:c,multiply:f,add:d}=e;function h(C,T){var M=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t.relTol,x=arguments.length>3?arguments[3]:void 0,N=arguments.length>4?arguments[4]:void 0;if(x==="number")return g(C,M,N);if(x==="BigNumber")return m(C,M,N);throw TypeError("Unsupported data type: "+x)}function g(C,T,M){var x=C.length,N=Math.abs(T/x),O,z;if(M){z=new Array(x);for(var B=0;B<x;B++)z[B]=Array(x).fill(0),z[B][B]=1}for(var k=b(C);Math.abs(k[1])>=Math.abs(N);){var $=k[0][0],U=k[0][1];O=D(C[$][$],C[U][U],C[$][U]),C=E(C,O,$,U),M&&(z=v(z,O,$,U)),k=b(C)}for(var Y=Array(x).fill(0),X=0;X<x;X++)Y[X]=C[X][X];return A(Ge(Y),z,M)}function m(C,T,M){var x=C.length,N=a(T/x),O,z;if(M){z=new Array(x);for(var B=0;B<x;B++)z[B]=Array(x).fill(0),z[B][B]=1}for(var k=S(C);a(k[1])>=a(N);){var $=k[0][0],U=k[0][1];O=p(C[$][$],C[U][U],C[$][U]),C=w(C,O,$,U),M&&(z=y(z,O,$,U)),k=S(C)}for(var Y=Array(x).fill(0),X=0;X<x;X++)Y[X]=C[X][X];return A(Ge(Y),z,M)}function D(C,T,M){var x=T-C;return Math.abs(x)<=t.relTol?Math.PI/4:.5*Math.atan(2*M/(T-C))}function p(C,T,M){var x=r(T,C);return a(x)<=t.relTol?c(-1).acos().div(4):l(.5,i(f(2,M,u(x))))}function v(C,T,M,x){for(var N=C.length,O=Math.cos(T),z=Math.sin(T),B=Array(N).fill(0),k=Array(N).fill(0),$=0;$<N;$++)B[$]=O*C[$][M]-z*C[$][x],k[$]=z*C[$][M]+O*C[$][x];for(var U=0;U<N;U++)C[U][M]=B[U],C[U][x]=k[U];return C}function y(C,T,M,x){for(var N=C.length,O=o(T),z=s(T),B=Array(N).fill(c(0)),k=Array(N).fill(c(0)),$=0;$<N;$++)B[$]=r(l(O,C[$][M]),l(z,C[$][x])),k[$]=n(l(z,C[$][M]),l(O,C[$][x]));for(var U=0;U<N;U++)C[U][M]=B[U],C[U][x]=k[U];return C}function w(C,T,M,x){for(var N=C.length,O=c(o(T)),z=c(s(T)),B=l(O,O),k=l(z,z),$=Array(N).fill(c(0)),U=Array(N).fill(c(0)),Y=f(c(2),O,z,C[M][x]),X=n(r(l(B,C[M][M]),Y),l(k,C[x][x])),P=d(l(k,C[M][M]),Y,l(B,C[x][x])),G=0;G<N;G++)$[G]=r(l(O,C[M][G]),l(z,C[x][G])),U[G]=n(l(z,C[M][G]),l(O,C[x][G]));C[M][M]=X,C[x][x]=P,C[M][x]=c(0),C[x][M]=c(0);for(var q=0;q<N;q++)q!==M&&q!==x&&(C[M][q]=$[q],C[q][M]=$[q],C[x][q]=U[q],C[q][x]=U[q]);return C}function E(C,T,M,x){for(var N=C.length,O=Math.cos(T),z=Math.sin(T),B=O*O,k=z*z,$=Array(N).fill(0),U=Array(N).fill(0),Y=B*C[M][M]-2*O*z*C[M][x]+k*C[x][x],X=k*C[M][M]+2*O*z*C[M][x]+B*C[x][x],P=0;P<N;P++)$[P]=O*C[M][P]-z*C[x][P],U[P]=z*C[M][P]+O*C[x][P];C[M][M]=Y,C[x][x]=X,C[M][x]=0,C[x][M]=0;for(var G=0;G<N;G++)G!==M&&G!==x&&(C[M][G]=$[G],C[G][M]=$[G],C[x][G]=U[G],C[G][x]=U[G]);return C}function b(C){for(var T=C.length,M=0,x=[0,1],N=0;N<T;N++)for(var O=N+1;O<T;O++)Math.abs(M)<Math.abs(C[N][O])&&(M=Math.abs(C[N][O]),x=[N,O]);return[x,M]}function S(C){for(var T=C.length,M=0,x=[0,1],N=0;N<T;N++)for(var O=N+1;O<T;O++)a(M)<a(C[N][O])&&(M=a(C[N][O]),x=[N,O]);return[x,M]}function A(C,T,M){var x=C.length,N=Array(x),O;if(M){O=Array(x);for(var z=0;z<x;z++)O[z]=Array(x)}for(var B=0;B<x;B++){for(var k=0,$=C[0],U=0;U<C.length;U++)a(C[U])<a($)&&(k=U,$=C[k]);if(N[B]=C.splice(k,1)[0],M)for(var Y=0;Y<x;Y++)O[B][Y]=T[Y][k],T[Y].splice(k,1)}if(!M)return{values:N};var X=O.map((P,G)=>({value:N[G],vector:P}));return{values:N,eigenvectors:X}}return h}var EF="eigs",AF=["config","typed","matrix","addScalar","equal","subtract","abs","atan","cos","sin","multiplyScalar","divideScalar","inv","bignumber","multiply","add","larger","column","flatten","number","complex","sqrt","diag","size","reshape","qr","usolve","usolveAll","im","re","smaller","matrixFromColumns","dot"],CF=fe(EF,AF,e=>{var{config:t,typed:n,matrix:r,addScalar:a,subtract:i,equal:o,abs:s,atan:l,cos:u,sin:c,multiplyScalar:f,divideScalar:d,inv:h,bignumber:g,multiply:m,add:D,larger:p,column:v,flatten:y,number:w,complex:E,sqrt:b,diag:S,size:A,reshape:C,qr:T,usolve:M,usolveAll:x,im:N,re:O,smaller:z,matrixFromColumns:B,dot:k}=e,$=xF({config:t,addScalar:a,subtract:i,abs:s,atan:l,cos:u,sin:c,multiplyScalar:f,inv:h,bignumber:g,multiply:m,add:D}),U=wF({addScalar:a,subtract:i,multiply:m,multiplyScalar:f,flatten:y,divideScalar:d,sqrt:b,abs:s,bignumber:g,diag:S,size:A,reshape:C,qr:T,inv:h,usolve:M,usolveAll:x,equal:o,complex:E,larger:p,smaller:z,matrixFromColumns:B,dot:k});return n("eigs",{Array:function(V){return Y(r(V))},"Array, number|BigNumber":function(V,te){return Y(r(V),{precision:te})},"Array, Object"(j,V){return Y(r(j),V)},Matrix:function(V){return Y(V,{matricize:!0})},"Matrix, number|BigNumber":function(V,te){return Y(V,{precision:te,matricize:!0})},"Matrix, Object":function(V,te){var ee={matricize:!0};return oi(ee,te),Y(V,ee)}});function Y(j){var V,te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ee="eigenvectors"in te?te.eigenvectors:!0,ne=(V=te.precision)!==null&&V!==void 0?V:t.relTol,se=X(j,ne,ee);return te.matricize&&(se.values=r(se.values),ee&&(se.eigenvectors=se.eigenvectors.map(W=>{var{value:de,vector:me}=W;return{value:de,vector:r(me)}}))),ee&&Object.defineProperty(se,"vectors",{enumerable:!1,get:()=>{throw new Error("eigs(M).vectors replaced with eigs(M).eigenvectors")}}),se}function X(j,V,te){var ee=j.toArray(),ne=j.size();if(ne.length!==2||ne[0]!==ne[1])throw new RangeError("Matrix must be square (size: ".concat(yt(ne),")"));var se=ne[0];if(G(ee,se,V)&&(q(ee,se),P(ee,se,V))){var W=L(j,ee,se);return $(ee,se,V,W,te)}var de=L(j,ee,se);return U(ee,se,V,de,te)}function P(j,V,te){for(var ee=0;ee<V;ee++)for(var ne=ee;ne<V;ne++)if(p(g(s(i(j[ee][ne],j[ne][ee]))),te))return!1;return!0}function G(j,V,te){for(var ee=0;ee<V;ee++)for(var ne=0;ne<V;ne++)if(p(g(s(N(j[ee][ne]))),te))return!1;return!0}function q(j,V){for(var te=0;te<V;te++)for(var ee=0;ee<V;ee++)j[te][ee]=O(j[te][ee])}function L(j,V,te){var ee=j.datatype();if(ee==="number"||ee==="BigNumber"||ee==="Complex")return ee;for(var ne=!1,se=!1,W=!1,de=0;de<te;de++)for(var me=0;me<te;me++){var be=V[de][me];if(ct(be)||yp(be))ne=!0;else if(Mt(be))se=!0;else if(vp(be))W=!0;else throw TypeError("Unsupported type in Matrix: "+Zn(be))}if(se&&W&&console.warn("Complex BigNumbers not supported, this operation will lose precission."),W){for(var xe=0;xe<te;xe++)for(var Ee=0;Ee<te;Ee++)V[xe][Ee]=E(V[xe][Ee]);return"Complex"}if(se){for(var Te=0;Te<te;Te++)for(var He=0;He<te;He++)V[Te][He]=g(V[Te][He]);return"BigNumber"}if(ne){for(var Be=0;Be<te;Be++)for(var Pe=0;Pe<te;Pe++)V[Be][Pe]=w(V[Be][Pe]);return"number"}else throw TypeError("Matrix contains unsupported types only.")}}),TF="divide",MF=["typed","matrix","multiply","equalScalar","divideScalar","inv"],_F=fe(TF,MF,e=>{var{typed:t,matrix:n,multiply:r,equalScalar:a,divideScalar:i,inv:o}=e,s=Ew({typed:t,equalScalar:a}),l=Up({typed:t});return t("divide",pS({"Array | Matrix, Array | Matrix":function(c,f){return r(c,o(f))},"DenseMatrix, any":function(c,f){return l(c,f,i,!1)},"SparseMatrix, any":function(c,f){return s(c,f,i,!1)},"Array, any":function(c,f){return l(n(c),f,i,!1).valueOf()},"any, Array | Matrix":function(c,f){return r(c,o(f))}},i.signatures))}),ux="mean",NF=["typed","add","divide"],FF=fe(ux,NF,e=>{var{typed:t,add:n,divide:r}=e;return t(ux,{"Array | Matrix":i,"Array | Matrix, number | BigNumber":a,"...":function(s){if(nw(s))throw new TypeError("Scalar values expected in function mean");return i(s)}});function a(o,s){try{var l=aw(o,s,n),u=Array.isArray(o)?bt(o):o.size();return r(l,u[s])}catch(c){throw Of(c,"mean")}}function i(o){var s,l=0;if(rw(o,function(u){try{s=s===void 0?u:n(s,u),l++}catch(c){throw Of(c,"mean",u)}}),l===0)throw new Error("Cannot calculate the mean of an empty array");return r(s,l)}}),Wl=j_({config:mn}),Uf=V_({}),Lp=t9({}),Pp=a9({}),kn=D9({Matrix:Pp}),De=YM({BigNumber:Wl,Complex:Uf,DenseMatrix:kn,Fraction:Lp}),Jl=r7({typed:De}),bs=i7({typed:De}),BF=iF({typed:De}),jp=G9({Complex:Uf,typed:De}),Lf=V7({typed:De}),OF=sF({typed:De}),Yr=B9({config:mn,typed:De}),cx=iN({typed:De}),RF=sN({typed:De}),zF=Z7({typed:De}),fx=x9({typed:De}),kF=A9({config:mn,typed:De}),dx=T9({equalScalar:Yr,typed:De}),Ds=R7({typed:De}),Hp=L9({typed:De}),$F=Q7({typed:De}),IF=I7({BigNumber:Wl,Fraction:Lp,complex:jp,typed:De}),UF=uF({typed:De}),xa=z9({Matrix:Pp,equalScalar:Yr,typed:De}),eu=s7({typed:De}),tu=H9({BigNumber:Wl,typed:De}),LF=_9({typed:De}),Ye=Q9({DenseMatrix:kn,Matrix:Pp,SparseMatrix:xa,typed:De}),PF=mN({isInteger:fx,matrix:Ye,typed:De}),qp=P7({Complex:Uf,config:mn,typed:De}),jF=yN({matrix:Ye,typed:De}),HF=wN({BigNumber:Wl,config:mn,matrix:Ye,typed:De}),Xi=J7({isInteger:fx,matrix:Ye,typed:De}),qF=DN({conj:Lf,transpose:jF,typed:De}),YF=rN({DenseMatrix:kn,SparseMatrix:xa,matrix:Ye,typed:De}),hx=zN({DenseMatrix:kn,SparseMatrix:xa,concat:Xi,equalScalar:Yr,matrix:Ye,typed:De}),mx=Z9({Fraction:Lp,typed:De}),Yp=uN({BigNumber:Wl,DenseMatrix:kn,SparseMatrix:xa,config:mn,matrix:Ye,typed:De}),GF=VN({DenseMatrix:kn,SparseMatrix:xa,concat:Xi,config:mn,matrix:Ye,typed:De}),px=AN({bignumber:tu,fraction:mx,number:Hp}),Gp=gN({matrix:Ye,config:mn,typed:De}),nu=IN({DenseMatrix:kn,SparseMatrix:xa,bignumber:tu,concat:Xi,config:mn,matrix:Ye,typed:De}),Pf=t7({typed:De}),jf=fF({DenseMatrix:kn,SparseMatrix:xa,addScalar:bs,concat:Xi,equalScalar:Yr,matrix:Ye,typed:De}),Zi=TN({numeric:px,typed:De}),VF=JN({DenseMatrix:kn,smaller:nu}),XF=nF({ImmutableDenseMatrix:VF,getMatrixDataType:RF}),Vp=qN({DenseMatrix:kn,SparseMatrix:xa,bignumber:tu,concat:Xi,config:mn,matrix:Ye,typed:De}),ZF=J9({flatten:cx,matrix:Ye,size:Gp,typed:De}),KF=KN({config:mn,isNaN:LF,numeric:px,smaller:nu,typed:De}),QF=vF({addScalar:bs,complex:jp,conj:Lf,divideScalar:Zi,equal:hx,identity:Yp,isZero:dx,matrix:Ye,multiplyScalar:Ds,sign:IF,sqrt:qp,subtractScalar:eu,typed:De,unaryMinus:Pf,zeros:HF}),WF=PN({DenseMatrix:kn,SparseMatrix:xa,concat:Xi,config:mn,matrix:Ye,typed:De}),JF=H7({DenseMatrix:kn,concat:Xi,equalScalar:Yr,matrix:Ye,subtractScalar:eu,typed:De,unaryMinus:Pf}),eB=FN({DenseMatrix:kn,divideScalar:Zi,equalScalar:Yr,matrix:Ye,multiplyScalar:Ds,subtractScalar:eu,typed:De}),gx=pF({addScalar:bs,conj:Lf,multiplyScalar:Ds,size:Gp,typed:De}),mi=k7({addScalar:bs,dot:gx,equalScalar:Yr,matrix:Ye,multiplyScalar:Ds,typed:De}),tB=dN({bignumber:tu,matrix:Ye,add:jf,config:mn,isPositive:kF,larger:Vp,largerEq:GF,smaller:nu,smallerEq:WF,typed:De}),nB=ON({DenseMatrix:kn,divideScalar:Zi,equalScalar:Yr,matrix:Ye,multiplyScalar:Ds,subtractScalar:eu,typed:De}),rB=tN({Index:XF,matrix:Ye,range:tB,typed:De}),aB=bF({divideScalar:Zi,isZero:dx,matrix:Ye,multiply:mi,subtractScalar:eu,typed:De,unaryMinus:Pf}),Xp=SF({abs:Jl,addScalar:bs,det:aB,divideScalar:Zi,identity:Yp,matrix:Ye,multiply:mi,typed:De,unaryMinus:Pf}),iB=_N({Complex:Uf,config:mn,fraction:mx,identity:Yp,inv:Xp,matrix:Ye,multiply:mi,number:Hp,typed:De}),oB=_F({divideScalar:Zi,equalScalar:Yr,inv:Xp,matrix:Ye,multiply:mi,typed:De}),sB=CF({abs:Jl,add:jf,addScalar:bs,atan:BF,bignumber:tu,column:rB,complex:jp,config:mn,cos:OF,diag:YF,divideScalar:Zi,dot:gx,equal:hx,flatten:cx,im:zF,inv:Xp,larger:Vp,matrix:Ye,matrixFromColumns:ZF,multiply:mi,multiplyScalar:Ds,number:Hp,qr:QF,re:$F,reshape:PF,sin:UF,size:Gp,smaller:nu,sqrt:qp,subtract:JF,typed:De,usolve:eB,usolveAll:nB}),lB=FF({add:jf,divide:oB,typed:De}),vx=hF({abs:Jl,add:jf,conj:Lf,ctranspose:qF,eigs:sB,equalScalar:Yr,larger:Vp,matrix:Ye,multiply:mi,pow:iB,smaller:nu,sqrt:qp,typed:De});Ye([[0,0,0],[0,0,0]]);const Hf=e=>Jl(e.xmax-e.xmin),yx=e=>Jl(e.ymax-e.ymin),bx=(e,t)=>[Math.min(e[0],t[0]),Math.min(e[1],t[1]),Math.abs(e[0]-t[0]),Math.abs(e[1]-t[1])],Dx=e=>({xmin:e[0],ymin:e[1],xmax:e[0]+e[2],ymax:e[1]+e[3]}),Zp=(e,t)=>!(e.xmax<t.xmin||e.xmin>t.xmax||e.ymax<t.ymin||e.ymin>t.ymax),uB=(e,t)=>t.xmin<e[0]&&e[0]<t.xmax&&Math.min(t.ymin,t.ymax)<e[1]&&e[1]<Math.max(t.ymax,t.ymin),Kp=(e,t)=>{t.length===2&&(t=[t[0],t[1],1]);const n=Ye(e),r=Ye(t);return mi(n,r).toArray()},cB=(e,t)=>e.map((n,r)=>[n,t[r]]),Qp=(e,t)=>{const n=Ye(e),r=Ye([t.map(o=>o[0]),t.map(o=>o[1]),t.map(()=>1)]),[a,i]=mi(n,r).toArray();return cB(a,i)},fB="rgba(196, 196, 196, 0.5)",Sx="COMPUTE_DRAG",wx="END_DRAG",xx="RESET_DRAG",dB="PARTIAL",Ex=e=>{const t=e.currentTarget.getBoundingClientRect(),n=[e.clientX-t.x,e.clientY-t.y],r=e.buttons===1,a=e.shiftKey;return{type:dB,mouseButtonIsDown:r,point:n,shift:a}},hB=(e,t)=>{const{dragAnchor:n,dragRect:r}=e,{type:a,mouseButtonIsDown:i,point:o,shift:s}=t,l=4;switch(a){case xx:return{isActive:!1};case wx:return{isActive:!1,dragRect:n&&o?bx(n,o):void 0,shift:s};case Sx:if(!i)return{isActive:!1};if(!o)throw Error("ASSERTION FAILED: COMPUTE_DRAG but the mousemove event had no location.");return n?r||Math.abs(o[0]-n[0])>l||Math.abs(o[1]-n[1])>l?{...e,isActive:!0,dragRect:bx(n,o)}:e:{isActive:!1,dragAnchor:o};default:throw Error(`Invalid mode for drag reducer: ${a}`)}},mB=(e,t,n)=>{if(!t||!e||typeof e=="function")return;const r=e.current,a=r&&r.getContext("2d");if(a&&(a.clearRect(0,0,a.canvas.width,a.canvas.height),t.isActive)){const i=t.dragRect||[0,0,0,0];a.fillStyle=n??fB,a.fillRect(i[0],i[1],i[2],i[3])}},Ax=e=>{const{nextDragStateUpdate:t,nextFrame:n,reducer:r,reducerOtherProps:a}=e;if(t.current===null)window.cancelAnimationFrame(n.current),n.current=0;else{r({...a,dragAction:t.current});const i=()=>Ax(e);n.current=requestAnimationFrame(i)}t.current=null},pB=(e,t)=>{const{nextDragStateUpdate:n,nextFrame:r}=t,a={...Ex(e),type:Sx};return a.mouseButtonIsDown?(n.current=a,r.current===0&&Ax(t),!0):!1},gB=(e,t)=>{const{nextDragStateUpdate:n,reducer:r,reducerOtherProps:a}=t;n.current=null,r({...a,dragAction:{type:xx}})},vB=(e,t)=>{const{nextDragStateUpdate:n,reducer:r,reducerOtherProps:a}=t;n.current=null,r({...a,dragAction:{...Ex(e),type:wx}})},yB=e=>{const{width:t,height:n,newState:r,dragStyle:a}=e,i=_.useRef(null),o=_.useMemo(()=>F.jsx("canvas",{ref:i,width:t,height:n,style:{position:"absolute",left:0,top:0}}),[t,n]);return mB(i,r,a),o},bB=e=>{const t=e([0,0]),n=e([1,0]),r=e([0,1]);return[[n[0]-t[0],r[0]-t[0],t[0]],[n[1]-t[1],r[1]-t[1],t[1]],[0,0,1]]},DB=(e,t)=>{e.clearRect(0,0,t.width,t.height);for(const n of t.pixelVerticalLines||[])e.strokeStyle=n.color,e.beginPath(),e.moveTo(n.x,t.margins.top-20),e.lineTo(n.x,t.height-t.margins.bottom),e.stroke();t.barBoxes.forEach(n=>{e.fillStyle=n.color,e.fillRect(n.x1,n.y1,n.x2-n.x1,n.y2-n.y1)}),t.xLabel&&(e.textBaseline="bottom",e.textAlign="center",e.fillStyle="black",e.fillText(t.xLabel,t.width/2,t.height-3));for(const n of t.pixelTicks||[])e.strokeStyle="black",e.beginPath(),e.moveTo(n.x,t.height-t.margins.bottom),e.lineTo(n.x,t.height-t.margins.bottom+6),e.stroke(),e.textBaseline="top",e.textAlign="center",e.fillStyle="black",e.fillText(n.label,n.x,t.height-t.margins.bottom+8)},SB=e=>F.jsx(Er,{width:e.width,height:e.height,draw:DB,drawData:e}),wB={},xB=({bars:e,ticks:t,verticalLines:n,xLabel:r,onSelectRect:a,width:i,height:o})=>{const{xMin:s,xMax:l}=_.useMemo(()=>e.length>0?{xMin:e[0].xStart,xMax:e[e.length-1].xEnd}:{xMin:0,xMax:1},[e]),u=_.useMemo(()=>Math.max(...e.map(b=>b.height)),[e]),{barBoxes:c,margins:f,pixelTicks:d,pixelVerticalLines:h}=_.useMemo(()=>{const b={left:3,right:3,top:5,bottom:3+(r?13:0)+(t?13:0)},S=i-b.left-b.right,A=o-b.top-b.bottom,C=e.map(x=>({key:x.key,x1:b.left+(x.xStart-s)/(l-s)*S,x2:b.left+(x.xEnd-s)/(l-s)*S,y1:b.top+A*(1-x.height/u),y2:b.top+A,tooltip:x.tooltip,color:x.color})),T=t?t.map(x=>({x:b.left+(x.x-s)/(l-s)*S,label:`${x.label}`})):void 0,M=n?n.map(x=>({x:b.left+(x.x-s)/(l-s)*S,color:x.color})):void 0;return{barBoxes:C,margins:b,pixelTicks:T,pixelVerticalLines:M}},[e,t,n,s,l,u,i,o,r]),g=_.useCallback((b,{ctrlKey:S,shiftKey:A})=>{const C=[],T={x:b[0],y:b[1],width:b[2],height:b[3]};for(const M of c)M.x1<=T.x+T.width&&M.x2>=T.x&&C.push(M.key);a&&a(T,C,{ctrlKey:S,shiftKey:A})},[c,a]),m=_.useCallback(()=>{},[]),{onMouseMove:D,onMouseDown:p,onMouseUp:v,onMouseLeave:y,paintDragSelectLayer:w}=cf(i,o,g,m),E=_.useMemo(()=>F.jsx(Er,{width:i,height:o,draw:w,drawData:wB}),[i,o,w]);return F.jsxs("div",{style:{width:i,height:o,position:"relative"},onMouseDown:p,onMouseMove:D,onMouseUp:v,onMouseLeave:y,children:[F.jsx(SB,{barBoxes:c,margins:f,pixelTicks:d,pixelVerticalLines:h,xLabel:r,width:i,height:o}),E]})},EB=(e={})=>{const[t,n]=_.useState(!1),[r,a]=_.useState(!1),i=_.useRef(null);return _.useEffect(()=>{const o=i.current;if(!o)return;const s=new IntersectionObserver(([l])=>{const u=l.isIntersecting;n(u),u&&!r&&a(!0)},{threshold:e.threshold||0,root:e.root||null,rootMargin:e.rootMargin||"0px"});return s.observe(o),()=>{s.unobserve(o)}},[e.threshold,e.root,e.rootMargin,r]),{elementRef:i,isVisible:t,hasBeenVisible:r}},AB=({children:e,width:t,height:n})=>{const{elementRef:r,isVisible:a}=EB({threshold:.1});return F.jsx("div",{ref:r,style:{position:"relative",width:t,height:n},children:a?e:F.jsx("span",{children:"Not visible"})})},CB=()=>{},TB=e=>{const{rowStart:t,maxItems:n,plotIds:r,selectedPlotKeys:a,currentPlotKey:i,plotsDict:o,hideBorderColorPlotKeys:s}=e,l=n||r.length,u=r.slice(t,t+l);return F.jsx("div",{style:{display:"flex",flexWrap:"wrap"},children:u.filter(c=>o[c]).map(c=>{let f="plotWrapperStyle";return s?.has(c)?f=f+" plotUnselectableStyle":f=f+" "+(i===c?"plotCurrentStyle":a?.has(c)?"plotSelectedStyle":"plotUnselectedStyle"),F.jsx("div",{style:{flex:"0 0 auto"},children:F.jsx("div",{className:f,children:o[c]})},c)})},t)},qf=({plots:e,plotComponent:t,selectedPlotKeys:n,currentPlotKey:r,numPlotsPerRow:a})=>{const i=t,o=_.useMemo(()=>{const c=new Set;for(const f of e)f.hideBorderColor&&c.add(f.key);return c},[e]),s=_.useMemo(()=>Object.assign({},...e.map(f=>{const d=f.label!==void 0?20:0,h=F.jsx("div",{"data-key":f.key,onClick:f.clickHandler||CB,children:F.jsx(AB,{width:f.props.width,height:f.props.height,children:F.jsxs("span",{children:[f.label!==void 0&&F.jsx("div",{className:"plotLabelStyle",style:{maxWidth:f.props.width,height:d,userSelect:"none"},children:F.jsx("span",{style:{color:f.labelColor},children:f.label||F.jsx("span",{children:" "})})}),F.jsx(i,{...f.props,height:f.props.height?f.props.height-d:f.props.height})]})})});return{[f.key]:h}})),[e,i]),l=Array(e.length).fill(0).map((c,f)=>f).filter(c=>c%(a||e.length)===0),u=_.useMemo(()=>e.map(c=>c.key),[e]);return F.jsx("div",{className:"PlotGrid",style:{display:"flex",flexDirection:"column"},children:l.map(c=>F.jsx(TB,{rowStart:c,maxItems:a,plotIds:u,selectedPlotKeys:n,currentPlotKey:r,hideBorderColorPlotKeys:o,plotsDict:s},`row-${c}`))})},Yf=({width:e,height:t,children:n,disableScroll:r})=>{const a=_.useMemo(()=>({width:e-20,height:t,position:"relative",overflowY:r?"hidden":"auto"}),[e,t,r]);return F.jsx("div",{style:a,children:n})};var Cx={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Tx=Rt.createContext&&Rt.createContext(Cx),MB=["attr","size","title"];function _B(e,t){if(e==null)return{};var n=NB(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function NB(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Gf(){return Gf=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},Gf.apply(this,arguments)}function Mx(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Vf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Mx(Object(n),!0).forEach(function(r){FB(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Mx(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function FB(e,t,n){return t=BB(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function BB(e){var t=OB(e,"string");return typeof t=="symbol"?t:t+""}function OB(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function _x(e){return e&&e.map((t,n)=>Rt.createElement(t.tag,Vf({key:n},t.attr),_x(t.child)))}function Gr(e){return t=>Rt.createElement(RB,Gf({attr:Vf({},e.attr)},t),_x(e.child))}function RB(e){var t=n=>{var{attr:r,size:a,title:i}=e,o=_B(e,MB),s=a||n.size||"1em",l;return n.className&&(l=n.className),e.className&&(l=(l?l+" ":"")+e.className),Rt.createElement("svg",Gf({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,o,{className:l,style:Vf(Vf({color:e.color||n.color},n.style),e.style),height:s,width:s,xmlns:"http://www.w3.org/2000/svg"}),i&&Rt.createElement("title",null,i),e.children)};return Tx!==void 0?Rt.createElement(Tx.Consumer,null,n=>t(n)):t(Cx)}function zB(e){return Gr({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M413.1 222.5l22.2 22.2c9.4 9.4 9.4 24.6 0 33.9L241 473c-9.4 9.4-24.6 9.4-33.9 0L12.7 278.6c-9.4-9.4-9.4-24.6 0-33.9l22.2-22.2c9.5-9.5 25-9.3 34.3.4L184 343.4V56c0-13.3 10.7-24 24-24h32c13.3 0 24 10.7 24 24v287.4l114.8-120.5c9.3-9.8 24.8-10 34.3-.4z"},child:[]}]})(e)}function kB(e){return Gr({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M257.5 445.1l-22.2 22.2c-9.4 9.4-24.6 9.4-33.9 0L7 273c-9.4-9.4-9.4-24.6 0-33.9L201.4 44.7c9.4-9.4 24.6-9.4 33.9 0l22.2 22.2c9.5 9.5 9.3 25-.4 34.3L136.6 216H424c13.3 0 24 10.7 24 24v32c0 13.3-10.7 24-24 24H136.6l120.5 114.8c9.8 9.3 10 24.8.4 34.3z"},child:[]}]})(e)}function $B(e){return Gr({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z"},child:[]}]})(e)}function IB(e){return Gr({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M34.9 289.5l-22.2-22.2c-9.4-9.4-9.4-24.6 0-33.9L207 39c9.4-9.4 24.6-9.4 33.9 0l194.3 194.3c9.4 9.4 9.4 24.6 0 33.9L413 289.4c-9.5 9.5-25 9.3-34.3-.4L264 168.6V456c0 13.3-10.7 24-24 24h-32c-13.3 0-24-10.7-24-24V168.6L69.2 289.1c-9.3 9.8-24.8 10-34.3.4z"},child:[]}]})(e)}function Xf(e){return Gr({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"},child:[]}]})(e)}function UB(e){return Gr({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M497.9 142.1l-46.1 46.1c-4.7 4.7-12.3 4.7-17 0l-111-111c-4.7-4.7-4.7-12.3 0-17l46.1-46.1c18.7-18.7 49.1-18.7 67.9 0l60.1 60.1c18.8 18.7 18.8 49.1 0 67.9zM284.2 99.8L21.6 362.4.4 483.9c-2.9 16.4 11.4 30.6 27.8 27.8l121.5-21.3 262.6-262.6c4.7-4.7 4.7-12.3 0-17l-111-111c-4.8-4.7-12.4-4.7-17.1 0zM124.1 339.9c-5.5-5.5-5.5-14.3 0-19.8l154-154c5.5-5.5 14.3-5.5 19.8 0s5.5 14.3 0 19.8l-154 154c-5.5 5.5-14.3 5.5-19.8 0zM88 424h48v36.3l-64.5 11.3-31.1-31.1L51.7 376H88v48z"},child:[]}]})(e)}function Zf(e){return Gr({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"},child:[]}]})(e)}function LB(e){return Gr({attr:{viewBox:"0 0 352 512"},child:[{tag:"path",attr:{d:"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"},child:[]}]})(e)}function Nx(e){return Gr({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16zM53.2 467a48 48 0 0 0 47.9 45h245.8a48 48 0 0 0 47.9-45L416 128H32z"},child:[]}]})(e)}function Fx(e){return Gr({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200zm101.8-262.2L295.6 256l62.2 62.2c4.7 4.7 4.7 12.3 0 17l-22.6 22.6c-4.7 4.7-12.3 4.7-17 0L256 295.6l-62.2 62.2c-4.7 4.7-12.3 4.7-17 0l-22.6-22.6c-4.7-4.7-4.7-12.3 0-17l62.2-62.2-62.2-62.2c-4.7-4.7-4.7-12.3 0-17l22.6-22.6c4.7-4.7 12.3-4.7 17 0l62.2 62.2 62.2-62.2c4.7-4.7 12.3-4.7 17 0l22.6 22.6c4.7 4.7 4.7 12.3 0 17z"},child:[]}]})(e)}let PB=0,jB=1,Wp;const Vr=e=>{Wp===void 0&&(Wp=Bx.length);const t=(PB+e*jB)%Wp;return Bx[t]},Bx=["#00ff00","#ff00ff","#0080ff","#ff8000","#80bf80","#470ba7","#c80b32","#fd7ee5","#027d30","#00ffff","#00ff80","#9c5a86","#808000","#8ed7fa","#80ff00","#6e52ff","#0000ff","#119c9b","#feb982","#56333d","#fb2b97","#8000ff","#c3f1a2","#b3bd25","#45bc2d","#1c4b88","#49f3c0","#a90c9c","#c436ea","#13055b","#7f93d0","#c4552d","#ee7381","#800000","#58fe60","#4f825e","#21bde8","#d7b8e0","#1e40ee","#324a01","#fc2b03","#723cb9","#3a6ac1","#aef14e","#14c568","#bd9c9b","#f9c506","#b579fa","#810e5e","#b38d4d","#854810","#02ea3a","#0b3b3c","#f90161","#07c304","#fe4c54","#be02ea","#0521bb","#338b05","#4989ff","#52b8b3","#be3271","#f1a441","#0b776b","#0ccfac","#cd61bd","#85fc95","#fe43fe","#bd810d","#cce9e6","#644179","#fedfbe","#80bd00","#99c4bd","#48e5fa","#400626","#bcfc01","#866b3f","#5422e9","#ea03bd","#69809a","#bfca76","#40e60e","#f1da52","#3d5f3b","#63b3f8","#7cd83d","#b52f02","#9364ca","#80a740","#3ce183","#a6a9f6","#fba2bb","#e3763f","#ae3cae","#91414a","#1e94cf","#06f6c9"],ru={black:"#000",white:"#fff"},Ss={300:"#e57373",400:"#ef5350",500:"#f44336",700:"#d32f2f",800:"#c62828"},ws={50:"#f3e5f5",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",700:"#7b1fa2"},xs={50:"#e3f2fd",200:"#90caf9",400:"#42a5f5",700:"#1976d2",800:"#1565c0"},Es={300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",700:"#0288d1",900:"#01579b"},As={300:"#81c784",400:"#66bb6a",500:"#4caf50",700:"#388e3c",800:"#2e7d32",900:"#1b5e20"},au={300:"#ffb74d",400:"#ffa726",500:"#ff9800",700:"#f57c00",900:"#e65100"},HB={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"};function Ki(e,...t){const n=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(r=>n.searchParams.append("args[]",r)),`Minified MUI error #${e}; visit ${n} for the full message.`}const qB="$$material";function YB(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function GB(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var VB=function(){function e(n){var r=this;this._insertTag=function(a){var i;r.tags.length===0?r.insertionPoint?i=r.insertionPoint.nextSibling:r.prepend?i=r.container.firstChild:i=r.before:i=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(a,i),r.tags.push(a)},this.isSpeedy=n.speedy===void 0?!0:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(r){r.forEach(this._insertTag)},t.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(GB(this));var a=this.tags[this.tags.length-1];if(this.isSpeedy){var i=YB(a);try{i.insertRule(r,i.cssRules.length)}catch{}}else a.appendChild(document.createTextNode(r));this.ctr++},t.flush=function(){this.tags.forEach(function(r){var a;return(a=r.parentNode)==null?void 0:a.removeChild(r)}),this.tags=[],this.ctr=0},e}(),vn="-ms-",Kf="-moz-",Ke="-webkit-",Ox="comm",Jp="rule",eg="decl",XB="@import",Rx="@keyframes",ZB="@layer",KB=Math.abs,Qf=String.fromCharCode,QB=Object.assign;function WB(e,t){return ln(e,0)^45?(((t<<2^ln(e,0))<<2^ln(e,1))<<2^ln(e,2))<<2^ln(e,3):0}function zx(e){return e.trim()}function JB(e,t){return(e=t.exec(e))?e[0]:e}function Qe(e,t,n){return e.replace(t,n)}function tg(e,t){return e.indexOf(t)}function ln(e,t){return e.charCodeAt(t)|0}function iu(e,t,n){return e.slice(t,n)}function Xr(e){return e.length}function ng(e){return e.length}function Wf(e,t){return t.push(e),e}function eO(e,t){return e.map(t).join("")}var Jf=1,Cs=1,kx=0,$n=0,Ht=0,Ts="";function ed(e,t,n,r,a,i,o){return{value:e,root:t,parent:n,type:r,props:a,children:i,line:Jf,column:Cs,length:o,return:""}}function ou(e,t){return QB(ed("",null,null,"",null,null,0),e,{length:-e.length},t)}function tO(){return Ht}function nO(){return Ht=$n>0?ln(Ts,--$n):0,Cs--,Ht===10&&(Cs=1,Jf--),Ht}function Kn(){return Ht=$n<kx?ln(Ts,$n++):0,Cs++,Ht===10&&(Cs=1,Jf++),Ht}function Zr(){return ln(Ts,$n)}function td(){return $n}function su(e,t){return iu(Ts,e,t)}function lu(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function $x(e){return Jf=Cs=1,kx=Xr(Ts=e),$n=0,[]}function Ix(e){return Ts="",e}function nd(e){return zx(su($n-1,rg(e===91?e+2:e===40?e+1:e)))}function rO(e){for(;(Ht=Zr())&&Ht<33;)Kn();return lu(e)>2||lu(Ht)>3?"":" "}function aO(e,t){for(;--t&&Kn()&&!(Ht<48||Ht>102||Ht>57&&Ht<65||Ht>70&&Ht<97););return su(e,td()+(t<6&&Zr()==32&&Kn()==32))}function rg(e){for(;Kn();)switch(Ht){case e:return $n;case 34:case 39:e!==34&&e!==39&&rg(Ht);break;case 40:e===41&&rg(e);break;case 92:Kn();break}return $n}function iO(e,t){for(;Kn()&&e+Ht!==57;)if(e+Ht===84&&Zr()===47)break;return"/*"+su(t,$n-1)+"*"+Qf(e===47?e:Kn())}function oO(e){for(;!lu(Zr());)Kn();return su(e,$n)}function sO(e){return Ix(rd("",null,null,null,[""],e=$x(e),0,[0],e))}function rd(e,t,n,r,a,i,o,s,l){for(var u=0,c=0,f=o,d=0,h=0,g=0,m=1,D=1,p=1,v=0,y="",w=a,E=i,b=r,S=y;D;)switch(g=v,v=Kn()){case 40:if(g!=108&&ln(S,f-1)==58){tg(S+=Qe(nd(v),"&","&\f"),"&\f")!=-1&&(p=-1);break}case 34:case 39:case 91:S+=nd(v);break;case 9:case 10:case 13:case 32:S+=rO(g);break;case 92:S+=aO(td()-1,7);continue;case 47:switch(Zr()){case 42:case 47:Wf(lO(iO(Kn(),td()),t,n),l);break;default:S+="/"}break;case 123*m:s[u++]=Xr(S)*p;case 125*m:case 59:case 0:switch(v){case 0:case 125:D=0;case 59+c:p==-1&&(S=Qe(S,/\f/g,"")),h>0&&Xr(S)-f&&Wf(h>32?Lx(S+";",r,n,f-1):Lx(Qe(S," ","")+";",r,n,f-2),l);break;case 59:S+=";";default:if(Wf(b=Ux(S,t,n,u,c,a,s,y,w=[],E=[],f),i),v===123)if(c===0)rd(S,t,b,b,w,i,f,s,E);else switch(d===99&&ln(S,3)===110?100:d){case 100:case 108:case 109:case 115:rd(e,b,b,r&&Wf(Ux(e,b,b,0,0,a,s,y,a,w=[],f),E),a,E,f,s,r?w:E);break;default:rd(S,b,b,b,[""],E,0,s,E)}}u=c=h=0,m=p=1,y=S="",f=o;break;case 58:f=1+Xr(S),h=g;default:if(m<1){if(v==123)--m;else if(v==125&&m++==0&&nO()==125)continue}switch(S+=Qf(v),v*m){case 38:p=c>0?1:(S+="\f",-1);break;case 44:s[u++]=(Xr(S)-1)*p,p=1;break;case 64:Zr()===45&&(S+=nd(Kn())),d=Zr(),c=f=Xr(y=S+=oO(td())),v++;break;case 45:g===45&&Xr(S)==2&&(m=0)}}return i}function Ux(e,t,n,r,a,i,o,s,l,u,c){for(var f=a-1,d=a===0?i:[""],h=ng(d),g=0,m=0,D=0;g<r;++g)for(var p=0,v=iu(e,f+1,f=KB(m=o[g])),y=e;p<h;++p)(y=zx(m>0?d[p]+" "+v:Qe(v,/&\f/g,d[p])))&&(l[D++]=y);return ed(e,t,n,a===0?Jp:s,l,u,c)}function lO(e,t,n){return ed(e,t,n,Ox,Qf(tO()),iu(e,2,-2),0)}function Lx(e,t,n,r){return ed(e,t,n,eg,iu(e,0,r),iu(e,r+1,-1),r)}function Ms(e,t){for(var n="",r=ng(e),a=0;a<r;a++)n+=t(e[a],a,e,t)||"";return n}function uO(e,t,n,r){switch(e.type){case ZB:if(e.children.length)break;case XB:case eg:return e.return=e.return||e.value;case Ox:return"";case Rx:return e.return=e.value+"{"+Ms(e.children,r)+"}";case Jp:e.value=e.props.join(",")}return Xr(n=Ms(e.children,r))?e.return=e.value+"{"+n+"}":""}function cO(e){var t=ng(e);return function(n,r,a,i){for(var o="",s=0;s<t;s++)o+=e[s](n,r,a,i)||"";return o}}function fO(e){return function(t){t.root||(t=t.return)&&e(t)}}function Px(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var dO=function(t,n,r){for(var a=0,i=0;a=i,i=Zr(),a===38&&i===12&&(n[r]=1),!lu(i);)Kn();return su(t,$n)},hO=function(t,n){var r=-1,a=44;do switch(lu(a)){case 0:a===38&&Zr()===12&&(n[r]=1),t[r]+=dO($n-1,n,r);break;case 2:t[r]+=nd(a);break;case 4:if(a===44){t[++r]=Zr()===58?"&\f":"",n[r]=t[r].length;break}default:t[r]+=Qf(a)}while(a=Kn());return t},mO=function(t,n){return Ix(hO($x(t),n))},jx=new WeakMap,pO=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var n=t.value,r=t.parent,a=t.column===r.column&&t.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(t.props.length===1&&n.charCodeAt(0)!==58&&!jx.get(r))&&!a){jx.set(t,!0);for(var i=[],o=mO(n,i),s=r.props,l=0,u=0;l<o.length;l++)for(var c=0;c<s.length;c++,u++)t.props[u]=i[l]?o[l].replace(/&\f/g,s[c]):s[c]+" "+o[l]}}},gO=function(t){if(t.type==="decl"){var n=t.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(t.return="",t.value="")}};function Hx(e,t){switch(WB(e,t)){case 5103:return Ke+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Ke+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return Ke+e+Kf+e+vn+e+e;case 6828:case 4268:return Ke+e+vn+e+e;case 6165:return Ke+e+vn+"flex-"+e+e;case 5187:return Ke+e+Qe(e,/(\w+).+(:[^]+)/,Ke+"box-$1$2"+vn+"flex-$1$2")+e;case 5443:return Ke+e+vn+"flex-item-"+Qe(e,/flex-|-self/,"")+e;case 4675:return Ke+e+vn+"flex-line-pack"+Qe(e,/align-content|flex-|-self/,"")+e;case 5548:return Ke+e+vn+Qe(e,"shrink","negative")+e;case 5292:return Ke+e+vn+Qe(e,"basis","preferred-size")+e;case 6060:return Ke+"box-"+Qe(e,"-grow","")+Ke+e+vn+Qe(e,"grow","positive")+e;case 4554:return Ke+Qe(e,/([^-])(transform)/g,"$1"+Ke+"$2")+e;case 6187:return Qe(Qe(Qe(e,/(zoom-|grab)/,Ke+"$1"),/(image-set)/,Ke+"$1"),e,"")+e;case 5495:case 3959:return Qe(e,/(image-set\([^]*)/,Ke+"$1$`$1");case 4968:return Qe(Qe(e,/(.+:)(flex-)?(.*)/,Ke+"box-pack:$3"+vn+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Ke+e+e;case 4095:case 3583:case 4068:case 2532:return Qe(e,/(.+)-inline(.+)/,Ke+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Xr(e)-1-t>6)switch(ln(e,t+1)){case 109:if(ln(e,t+4)!==45)break;case 102:return Qe(e,/(.+:)(.+)-([^]+)/,"$1"+Ke+"$2-$3$1"+Kf+(ln(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~tg(e,"stretch")?Hx(Qe(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(ln(e,t+1)!==115)break;case 6444:switch(ln(e,Xr(e)-3-(~tg(e,"!important")&&10))){case 107:return Qe(e,":",":"+Ke)+e;case 101:return Qe(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Ke+(ln(e,14)===45?"inline-":"")+"box$3$1"+Ke+"$2$3$1"+vn+"$2box$3")+e}break;case 5936:switch(ln(e,t+11)){case 114:return Ke+e+vn+Qe(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Ke+e+vn+Qe(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Ke+e+vn+Qe(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Ke+e+vn+e+e}return e}var vO=function(t,n,r,a){if(t.length>-1&&!t.return)switch(t.type){case eg:t.return=Hx(t.value,t.length);break;case Rx:return Ms([ou(t,{value:Qe(t.value,"@","@"+Ke)})],a);case Jp:if(t.length)return eO(t.props,function(i){switch(JB(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Ms([ou(t,{props:[Qe(i,/:(read-\w+)/,":"+Kf+"$1")]})],a);case"::placeholder":return Ms([ou(t,{props:[Qe(i,/:(plac\w+)/,":"+Ke+"input-$1")]}),ou(t,{props:[Qe(i,/:(plac\w+)/,":"+Kf+"$1")]}),ou(t,{props:[Qe(i,/:(plac\w+)/,vn+"input-$1")]})],a)}return""})}},yO=[vO],bO=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(m){var D=m.getAttribute("data-emotion");D.indexOf(" ")!==-1&&(document.head.appendChild(m),m.setAttribute("data-s",""))})}var a=t.stylisPlugins||yO,i={},o,s=[];o=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(m){for(var D=m.getAttribute("data-emotion").split(" "),p=1;p<D.length;p++)i[D[p]]=!0;s.push(m)});var l,u=[pO,gO];{var c,f=[uO,fO(function(m){c.insert(m)})],d=cO(u.concat(a,f)),h=function(D){return Ms(sO(D),d)};l=function(D,p,v,y){c=v,h(D?D+"{"+p.styles+"}":p.styles),y&&(g.inserted[p.name]=!0)}}var g={key:n,sheet:new VB({key:n,container:o,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:i,registered:{},insert:l};return g.sheet.hydrate(s),g},qx={exports:{}},tt={};/** @license React v16.13.1
63
+ */var so=9e15,Mi=1e9,Sh="0123456789abcdef",Ks="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",Ws="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",xh={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-so,maxE:so,crypto:!1},jy,Gr,Ae=!0,Js="[DecimalError] ",_i=Js+"Invalid argument: ",Hy=Js+"Precision limit exceeded",Py=Js+"crypto unavailable",qy="[object Decimal]",Jt=Math.floor,Ut=Math.pow,IC=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,$C=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,kC=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Vy=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,or=1e7,xe=7,LC=9007199254740991,jC=Ks.length-1,wh=Ws.length-1,ie={toStringTag:qy};ie.absoluteValue=ie.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),be(e)},ie.ceil=function(){return be(new this.constructor(this),this.e+1,2)},ie.clampedTo=ie.clamp=function(e,t){var n,r=this,i=r.constructor;if(e=new i(e),t=new i(t),!e.s||!t.s)return new i(NaN);if(e.gt(t))throw Error(_i+t);return n=r.cmp(e),n<0?e:r.cmp(t)>0?t:new i(r)},ie.comparedTo=ie.cmp=function(e){var t,n,r,i,a=this,o=a.d,u=(e=new a.constructor(e)).d,l=a.s,s=e.s;if(!o||!u)return!l||!s?NaN:l!==s?l:o===u?0:!o^l<0?1:-1;if(!o[0]||!u[0])return o[0]?l:u[0]?-s:0;if(l!==s)return l;if(a.e!==e.e)return a.e>e.e^l<0?1:-1;for(r=o.length,i=u.length,t=0,n=r<i?r:i;t<n;++t)if(o[t]!==u[t])return o[t]>u[t]^l<0?1:-1;return r===i?0:r>i^l<0?1:-1},ie.cosine=ie.cos=function(){var e,t,n=this,r=n.constructor;return n.d?n.d[0]?(e=r.precision,t=r.rounding,r.precision=e+Math.max(n.e,n.sd())+xe,r.rounding=1,n=HC(r,Ky(r,n)),r.precision=e,r.rounding=t,be(Gr==2||Gr==3?n.neg():n,e,t,!0)):new r(1):new r(NaN)},ie.cubeRoot=ie.cbrt=function(){var e,t,n,r,i,a,o,u,l,s,c=this,f=c.constructor;if(!c.isFinite()||c.isZero())return new f(c);for(Ae=!1,a=c.s*Ut(c.s*c,1/3),!a||Math.abs(a)==1/0?(n=Xt(c.d),e=c.e,(a=(e-n.length+1)%3)&&(n+=a==1||a==-2?"0":"00"),a=Ut(n,1/3),e=Jt((e+1)/3)-(e%3==(e<0?-1:2)),a==1/0?n="5e"+e:(n=a.toExponential(),n=n.slice(0,n.indexOf("e")+1)+e),r=new f(n),r.s=c.s):r=new f(a.toString()),o=(e=f.precision)+3;;)if(u=r,l=u.times(u).times(u),s=l.plus(c),r=tt(s.plus(c).times(u),s.plus(l),o+2,1),Xt(u.d).slice(0,o)===(n=Xt(r.d)).slice(0,o))if(n=n.slice(o-3,o+1),n=="9999"||!i&&n=="4999"){if(!i&&(be(u,e+1,0),u.times(u).times(u).eq(c))){r=u;break}o+=4,i=1}else{(!+n||!+n.slice(1)&&n.charAt(0)=="5")&&(be(r,e+1,1),t=!r.times(r).times(r).eq(c));break}return Ae=!0,be(r,e,f.rounding,t)},ie.decimalPlaces=ie.dp=function(){var e,t=this.d,n=NaN;if(t){if(e=t.length-1,n=(e-Jt(this.e/xe))*xe,e=t[e],e)for(;e%10==0;e/=10)n--;n<0&&(n=0)}return n},ie.dividedBy=ie.div=function(e){return tt(this,new this.constructor(e))},ie.dividedToIntegerBy=ie.divToInt=function(e){var t=this,n=t.constructor;return be(tt(t,new n(e),0,1,1),n.precision,n.rounding)},ie.equals=ie.eq=function(e){return this.cmp(e)===0},ie.floor=function(){return be(new this.constructor(this),this.e+1,3)},ie.greaterThan=ie.gt=function(e){return this.cmp(e)>0},ie.greaterThanOrEqualTo=ie.gte=function(e){var t=this.cmp(e);return t==1||t===0},ie.hyperbolicCosine=ie.cosh=function(){var e,t,n,r,i,a=this,o=a.constructor,u=new o(1);if(!a.isFinite())return new o(a.s?1/0:NaN);if(a.isZero())return u;n=o.precision,r=o.rounding,o.precision=n+Math.max(a.e,a.sd())+4,o.rounding=1,i=a.d.length,i<32?(e=Math.ceil(i/3),t=(1/ic(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),a=co(o,1,a.times(t),new o(1),!0);for(var l,s=e,c=new o(8);s--;)l=a.times(a),a=u.minus(l.times(c.minus(l.times(c))));return be(a,o.precision=n,o.rounding=r,!0)},ie.hyperbolicSine=ie.sinh=function(){var e,t,n,r,i=this,a=i.constructor;if(!i.isFinite()||i.isZero())return new a(i);if(t=a.precision,n=a.rounding,a.precision=t+Math.max(i.e,i.sd())+4,a.rounding=1,r=i.d.length,r<3)i=co(a,2,i,i,!0);else{e=1.4*Math.sqrt(r),e=e>16?16:e|0,i=i.times(1/ic(5,e)),i=co(a,2,i,i,!0);for(var o,u=new a(5),l=new a(16),s=new a(20);e--;)o=i.times(i),i=i.times(u.plus(o.times(l.times(o).plus(s))))}return a.precision=t,a.rounding=n,be(i,t,n,!0)},ie.hyperbolicTangent=ie.tanh=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+7,r.rounding=1,tt(n.sinh(),n.cosh(),r.precision=e,r.rounding=t)):new r(n.s)},ie.inverseCosine=ie.acos=function(){var e=this,t=e.constructor,n=e.abs().cmp(1),r=t.precision,i=t.rounding;return n!==-1?n===0?e.isNeg()?Dr(t,r,i):new t(0):new t(NaN):e.isZero()?Dr(t,r+4,i).times(.5):(t.precision=r+6,t.rounding=1,e=new t(1).minus(e).div(e.plus(1)).sqrt().atan(),t.precision=r,t.rounding=i,e.times(2))},ie.inverseHyperbolicCosine=ie.acosh=function(){var e,t,n=this,r=n.constructor;return n.lte(1)?new r(n.eq(1)?0:NaN):n.isFinite()?(e=r.precision,t=r.rounding,r.precision=e+Math.max(Math.abs(n.e),n.sd())+4,r.rounding=1,Ae=!1,n=n.times(n).minus(1).sqrt().plus(n),Ae=!0,r.precision=e,r.rounding=t,n.ln()):new r(n)},ie.inverseHyperbolicSine=ie.asinh=function(){var e,t,n=this,r=n.constructor;return!n.isFinite()||n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+2*Math.max(Math.abs(n.e),n.sd())+6,r.rounding=1,Ae=!1,n=n.times(n).plus(1).sqrt().plus(n),Ae=!0,r.precision=e,r.rounding=t,n.ln())},ie.inverseHyperbolicTangent=ie.atanh=function(){var e,t,n,r,i=this,a=i.constructor;return i.isFinite()?i.e>=0?new a(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=a.precision,t=a.rounding,r=i.sd(),Math.max(r,e)<2*-i.e-1?be(new a(i),e,t,!0):(a.precision=n=r-i.e,i=tt(i.plus(1),new a(1).minus(i),n+e,1),a.precision=e+4,a.rounding=1,i=i.ln(),a.precision=e,a.rounding=t,i.times(.5))):new a(NaN)},ie.inverseSine=ie.asin=function(){var e,t,n,r,i=this,a=i.constructor;return i.isZero()?new a(i):(t=i.abs().cmp(1),n=a.precision,r=a.rounding,t!==-1?t===0?(e=Dr(a,n+4,r).times(.5),e.s=i.s,e):new a(NaN):(a.precision=n+6,a.rounding=1,i=i.div(new a(1).minus(i.times(i)).sqrt().plus(1)).atan(),a.precision=n,a.rounding=r,i.times(2)))},ie.inverseTangent=ie.atan=function(){var e,t,n,r,i,a,o,u,l,s=this,c=s.constructor,f=c.precision,d=c.rounding;if(s.isFinite()){if(s.isZero())return new c(s);if(s.abs().eq(1)&&f+4<=wh)return o=Dr(c,f+4,d).times(.25),o.s=s.s,o}else{if(!s.s)return new c(NaN);if(f+4<=wh)return o=Dr(c,f+4,d).times(.5),o.s=s.s,o}for(c.precision=u=f+10,c.rounding=1,n=Math.min(28,u/xe+2|0),e=n;e;--e)s=s.div(s.times(s).plus(1).sqrt().plus(1));for(Ae=!1,t=Math.ceil(u/xe),r=1,l=s.times(s),o=new c(s),i=s;e!==-1;)if(i=i.times(l),a=o.minus(i.div(r+=2)),i=i.times(l),o=a.plus(i.div(r+=2)),o.d[t]!==void 0)for(e=t;o.d[e]===a.d[e]&&e--;);return n&&(o=o.times(2<<n-1)),Ae=!0,be(o,c.precision=f,c.rounding=d,!0)},ie.isFinite=function(){return!!this.d},ie.isInteger=ie.isInt=function(){return!!this.d&&Jt(this.e/xe)>this.d.length-2},ie.isNaN=function(){return!this.s},ie.isNegative=ie.isNeg=function(){return this.s<0},ie.isPositive=ie.isPos=function(){return this.s>0},ie.isZero=function(){return!!this.d&&this.d[0]===0},ie.lessThan=ie.lt=function(e){return this.cmp(e)<0},ie.lessThanOrEqualTo=ie.lte=function(e){return this.cmp(e)<1},ie.logarithm=ie.log=function(e){var t,n,r,i,a,o,u,l,s=this,c=s.constructor,f=c.precision,d=c.rounding,h=5;if(e==null)e=new c(10),t=!0;else{if(e=new c(e),n=e.d,e.s<0||!n||!n[0]||e.eq(1))return new c(NaN);t=e.eq(10)}if(n=s.d,s.s<0||!n||!n[0]||s.eq(1))return new c(n&&!n[0]?-1/0:s.s!=1?NaN:n?0:1/0);if(t)if(n.length>1)a=!0;else{for(i=n[0];i%10===0;)i/=10;a=i!==1}if(Ae=!1,u=f+h,o=Fi(s,u),r=t?nc(c,u+10):Fi(e,u),l=tt(o,r,u,1),Hu(l.d,i=f,d))do if(u+=10,o=Fi(s,u),r=t?nc(c,u+10):Fi(e,u),l=tt(o,r,u,1),!a){+Xt(l.d).slice(i+1,i+15)+1==1e14&&(l=be(l,f+1,0));break}while(Hu(l.d,i+=10,d));return Ae=!0,be(l,f,d)},ie.minus=ie.sub=function(e){var t,n,r,i,a,o,u,l,s,c,f,d,h=this,v=h.constructor;if(e=new v(e),!h.d||!e.d)return!h.s||!e.s?e=new v(NaN):h.d?e.s=-e.s:e=new v(e.d||h.s!==e.s?h:NaN),e;if(h.s!=e.s)return e.s=-e.s,h.plus(e);if(s=h.d,d=e.d,u=v.precision,l=v.rounding,!s[0]||!d[0]){if(d[0])e.s=-e.s;else if(s[0])e=new v(h);else return new v(l===3?-0:0);return Ae?be(e,u,l):e}if(n=Jt(e.e/xe),c=Jt(h.e/xe),s=s.slice(),a=c-n,a){for(f=a<0,f?(t=s,a=-a,o=d.length):(t=d,n=c,o=s.length),r=Math.max(Math.ceil(u/xe),o)+2,a>r&&(a=r,t.length=1),t.reverse(),r=a;r--;)t.push(0);t.reverse()}else{for(r=s.length,o=d.length,f=r<o,f&&(o=r),r=0;r<o;r++)if(s[r]!=d[r]){f=s[r]<d[r];break}a=0}for(f&&(t=s,s=d,d=t,e.s=-e.s),o=s.length,r=d.length-o;r>0;--r)s[o++]=0;for(r=d.length;r>a;){if(s[--r]<d[r]){for(i=r;i&&s[--i]===0;)s[i]=or-1;--s[i],s[r]+=or}s[r]-=d[r]}for(;s[--o]===0;)s.pop();for(;s[0]===0;s.shift())--n;return s[0]?(e.d=s,e.e=tc(s,n),Ae?be(e,u,l):e):new v(l===3?-0:0)},ie.modulo=ie.mod=function(e){var t,n=this,r=n.constructor;return e=new r(e),!n.d||!e.s||e.d&&!e.d[0]?new r(NaN):!e.d||n.d&&!n.d[0]?be(new r(n),r.precision,r.rounding):(Ae=!1,r.modulo==9?(t=tt(n,e.abs(),0,3,1),t.s*=e.s):t=tt(n,e,0,r.modulo,1),t=t.times(e),Ae=!0,n.minus(t))},ie.naturalExponential=ie.exp=function(){return Eh(this)},ie.naturalLogarithm=ie.ln=function(){return Fi(this)},ie.negated=ie.neg=function(){var e=new this.constructor(this);return e.s=-e.s,be(e)},ie.plus=ie.add=function(e){var t,n,r,i,a,o,u,l,s,c,f=this,d=f.constructor;if(e=new d(e),!f.d||!e.d)return!f.s||!e.s?e=new d(NaN):f.d||(e=new d(e.d||f.s===e.s?f:NaN)),e;if(f.s!=e.s)return e.s=-e.s,f.minus(e);if(s=f.d,c=e.d,u=d.precision,l=d.rounding,!s[0]||!c[0])return c[0]||(e=new d(f)),Ae?be(e,u,l):e;if(a=Jt(f.e/xe),r=Jt(e.e/xe),s=s.slice(),i=a-r,i){for(i<0?(n=s,i=-i,o=c.length):(n=c,r=a,o=s.length),a=Math.ceil(u/xe),o=a>o?a+1:o+1,i>o&&(i=o,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for(o=s.length,i=c.length,o-i<0&&(i=o,n=c,c=s,s=n),t=0;i;)t=(s[--i]=s[i]+c[i]+t)/or|0,s[i]%=or;for(t&&(s.unshift(t),++r),o=s.length;s[--o]==0;)s.pop();return e.d=s,e.e=tc(s,r),Ae?be(e,u,l):e},ie.precision=ie.sd=function(e){var t,n=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(_i+e);return n.d?(t=Gy(n.d),e&&n.e+1>t&&(t=n.e+1)):t=NaN,t},ie.round=function(){var e=this,t=e.constructor;return be(new t(e),e.e+1,t.rounding)},ie.sine=ie.sin=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+Math.max(n.e,n.sd())+xe,r.rounding=1,n=qC(r,Ky(r,n)),r.precision=e,r.rounding=t,be(Gr>2?n.neg():n,e,t,!0)):new r(NaN)},ie.squareRoot=ie.sqrt=function(){var e,t,n,r,i,a,o=this,u=o.d,l=o.e,s=o.s,c=o.constructor;if(s!==1||!u||!u[0])return new c(!s||s<0&&(!u||u[0])?NaN:u?o:1/0);for(Ae=!1,s=Math.sqrt(+o),s==0||s==1/0?(t=Xt(u),(t.length+l)%2==0&&(t+="0"),s=Math.sqrt(t),l=Jt((l+1)/2)-(l<0||l%2),s==1/0?t="5e"+l:(t=s.toExponential(),t=t.slice(0,t.indexOf("e")+1)+l),r=new c(t)):r=new c(s.toString()),n=(l=c.precision)+3;;)if(a=r,r=a.plus(tt(o,a,n+2,1)).times(.5),Xt(a.d).slice(0,n)===(t=Xt(r.d)).slice(0,n))if(t=t.slice(n-3,n+1),t=="9999"||!i&&t=="4999"){if(!i&&(be(a,l+1,0),a.times(a).eq(o))){r=a;break}n+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(be(r,l+1,1),e=!r.times(r).eq(o));break}return Ae=!0,be(r,l,c.rounding,e)},ie.tangent=ie.tan=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+10,r.rounding=1,n=n.sin(),n.s=1,n=tt(n,new r(1).minus(n.times(n)).sqrt(),e+10,0),r.precision=e,r.rounding=t,be(Gr==2||Gr==4?n.neg():n,e,t,!0)):new r(NaN)},ie.times=ie.mul=function(e){var t,n,r,i,a,o,u,l,s,c=this,f=c.constructor,d=c.d,h=(e=new f(e)).d;if(e.s*=c.s,!d||!d[0]||!h||!h[0])return new f(!e.s||d&&!d[0]&&!h||h&&!h[0]&&!d?NaN:!d||!h?e.s/0:e.s*0);for(n=Jt(c.e/xe)+Jt(e.e/xe),l=d.length,s=h.length,l<s&&(a=d,d=h,h=a,o=l,l=s,s=o),a=[],o=l+s,r=o;r--;)a.push(0);for(r=s;--r>=0;){for(t=0,i=l+r;i>r;)u=a[i]+h[r]*d[i-r-1]+t,a[i--]=u%or|0,t=u/or|0;a[i]=(a[i]+t)%or|0}for(;!a[--o];)a.pop();return t?++n:a.shift(),e.d=a,e.e=tc(a,n),Ae?be(e,f.precision,f.rounding):e},ie.toBinary=function(e,t){return Ah(this,2,e,t)},ie.toDecimalPlaces=ie.toDP=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(hn(e,0,Mi),t===void 0?t=r.rounding:hn(t,0,8),be(n,e+n.e+1,t))},ie.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=br(r,!0):(hn(e,0,Mi),t===void 0?t=i.rounding:hn(t,0,8),r=be(new i(r),e+1,t),n=br(r,!0,e+1)),r.isNeg()&&!r.isZero()?"-"+n:n},ie.toFixed=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?n=br(i):(hn(e,0,Mi),t===void 0?t=a.rounding:hn(t,0,8),r=be(new a(i),e+i.e+1,t),n=br(r,!1,e+r.e+1)),i.isNeg()&&!i.isZero()?"-"+n:n},ie.toFraction=function(e){var t,n,r,i,a,o,u,l,s,c,f,d,h=this,v=h.d,m=h.constructor;if(!v)return new m(h);if(s=n=new m(1),r=l=new m(0),t=new m(r),a=t.e=Gy(v)-h.e-1,o=a%xe,t.d[0]=Ut(10,o<0?xe+o:o),e==null)e=a>0?t:s;else{if(u=new m(e),!u.isInt()||u.lt(s))throw Error(_i+u);e=u.gt(t)?a>0?t:s:u}for(Ae=!1,u=new m(Xt(v)),c=m.precision,m.precision=a=v.length*xe*2;f=tt(u,t,0,1,1),i=n.plus(f.times(r)),i.cmp(e)!=1;)n=r,r=i,i=s,s=l.plus(f.times(i)),l=i,i=t,t=u.minus(f.times(i)),u=i;return i=tt(e.minus(n),r,0,1,1),l=l.plus(i.times(s)),n=n.plus(i.times(r)),l.s=s.s=h.s,d=tt(s,r,a,1).minus(h).abs().cmp(tt(l,n,a,1).minus(h).abs())<1?[s,r]:[l,n],m.precision=c,Ae=!0,d},ie.toHexadecimal=ie.toHex=function(e,t){return Ah(this,16,e,t)},ie.toNearest=function(e,t){var n=this,r=n.constructor;if(n=new r(n),e==null){if(!n.d)return n;e=new r(1),t=r.rounding}else{if(e=new r(e),t===void 0?t=r.rounding:hn(t,0,8),!n.d)return e.s?n:e;if(!e.d)return e.s&&(e.s=n.s),e}return e.d[0]?(Ae=!1,n=tt(n,e,0,t,1).times(e),Ae=!0,be(n)):(e.s=n.s,n=e),n},ie.toNumber=function(){return+this},ie.toOctal=function(e,t){return Ah(this,8,e,t)},ie.toPower=ie.pow=function(e){var t,n,r,i,a,o,u=this,l=u.constructor,s=+(e=new l(e));if(!u.d||!e.d||!u.d[0]||!e.d[0])return new l(Ut(+u,s));if(u=new l(u),u.eq(1))return u;if(r=l.precision,a=l.rounding,e.eq(1))return be(u,r,a);if(t=Jt(e.e/xe),t>=e.d.length-1&&(n=s<0?-s:s)<=LC)return i=Yy(l,u,n,r),e.s<0?new l(1).div(i):be(i,r,a);if(o=u.s,o<0){if(t<e.d.length-1)return new l(NaN);if(e.d[t]&1||(o=1),u.e==0&&u.d[0]==1&&u.d.length==1)return u.s=o,u}return n=Ut(+u,s),t=n==0||!isFinite(n)?Jt(s*(Math.log("0."+Xt(u.d))/Math.LN10+u.e+1)):new l(n+"").e,t>l.maxE+1||t<l.minE-1?new l(t>0?o/0:0):(Ae=!1,l.rounding=u.s=1,n=Math.min(12,(t+"").length),i=Eh(e.times(Fi(u,r+n)),r),i.d&&(i=be(i,r+5,1),Hu(i.d,r,a)&&(t=r+10,i=be(Eh(e.times(Fi(u,t+n)),t),t+5,1),+Xt(i.d).slice(r+1,r+15)+1==1e14&&(i=be(i,r+1,0)))),i.s=o,Ae=!0,l.rounding=a,be(i,r,a))},ie.toPrecision=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=br(r,r.e<=i.toExpNeg||r.e>=i.toExpPos):(hn(e,1,Mi),t===void 0?t=i.rounding:hn(t,0,8),r=be(new i(r),e,t),n=br(r,e<=r.e||r.e<=i.toExpNeg,e)),r.isNeg()&&!r.isZero()?"-"+n:n},ie.toSignificantDigits=ie.toSD=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(hn(e,1,Mi),t===void 0?t=r.rounding:hn(t,0,8)),be(new r(n),e,t)},ie.toString=function(){var e=this,t=e.constructor,n=br(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+n:n},ie.truncated=ie.trunc=function(){return be(new this.constructor(this),this.e+1,1)},ie.valueOf=ie.toJSON=function(){var e=this,t=e.constructor,n=br(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+n:n};function Xt(e){var t,n,r,i=e.length-1,a="",o=e[0];if(i>0){for(a+=o,t=1;t<i;t++)r=e[t]+"",n=xe-r.length,n&&(a+=Bi(n)),a+=r;o=e[t],r=o+"",n=xe-r.length,n&&(a+=Bi(n))}else if(o===0)return"0";for(;o%10===0;)o/=10;return a+o}function hn(e,t,n){if(e!==~~e||e<t||e>n)throw Error(_i+e)}function Hu(e,t,n,r){var i,a,o,u;for(a=e[0];a>=10;a/=10)--t;return--t<0?(t+=xe,i=0):(i=Math.ceil((t+1)/xe),t%=xe),a=Ut(10,xe-t),u=e[i]%a|0,r==null?t<3?(t==0?u=u/100|0:t==1&&(u=u/10|0),o=n<4&&u==99999||n>3&&u==49999||u==5e4||u==0):o=(n<4&&u+1==a||n>3&&u+1==a/2)&&(e[i+1]/a/100|0)==Ut(10,t-2)-1||(u==a/2||u==0)&&(e[i+1]/a/100|0)==0:t<4?(t==0?u=u/1e3|0:t==1?u=u/100|0:t==2&&(u=u/10|0),o=(r||n<4)&&u==9999||!r&&n>3&&u==4999):o=((r||n<4)&&u+1==a||!r&&n>3&&u+1==a/2)&&(e[i+1]/a/1e3|0)==Ut(10,t-3)-1,o}function ec(e,t,n){for(var r,i=[0],a,o=0,u=e.length;o<u;){for(a=i.length;a--;)i[a]*=t;for(i[0]+=Sh.indexOf(e.charAt(o++)),r=0;r<i.length;r++)i[r]>n-1&&(i[r+1]===void 0&&(i[r+1]=0),i[r+1]+=i[r]/n|0,i[r]%=n)}return i.reverse()}function HC(e,t){var n,r,i;if(t.isZero())return t;r=t.d.length,r<32?(n=Math.ceil(r/3),i=(1/ic(4,n)).toString()):(n=16,i="2.3283064365386962890625e-10"),e.precision+=n,t=co(e,1,t.times(i),new e(1));for(var a=n;a--;){var o=t.times(t);t=o.times(o).minus(o).times(8).plus(1)}return e.precision-=n,t}var tt=function(){function e(r,i,a){var o,u=0,l=r.length;for(r=r.slice();l--;)o=r[l]*i+u,r[l]=o%a|0,u=o/a|0;return u&&r.unshift(u),r}function t(r,i,a,o){var u,l;if(a!=o)l=a>o?1:-1;else for(u=l=0;u<a;u++)if(r[u]!=i[u]){l=r[u]>i[u]?1:-1;break}return l}function n(r,i,a,o){for(var u=0;a--;)r[a]-=u,u=r[a]<i[a]?1:0,r[a]=u*o+r[a]-i[a];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,a,o,u,l){var s,c,f,d,h,v,m,D,p,g,y,S,w,b,E,C,A,T,_,x,F=r.constructor,R=r.s==i.s?1:-1,z=r.d,N=i.d;if(!z||!z[0]||!N||!N[0])return new F(!r.s||!i.s||(z?N&&z[0]==N[0]:!N)?NaN:z&&z[0]==0||!N?R*0:R/0);for(l?(h=1,c=r.e-i.e):(l=or,h=xe,c=Jt(r.e/h)-Jt(i.e/h)),_=N.length,A=z.length,p=new F(R),g=p.d=[],f=0;N[f]==(z[f]||0);f++);if(N[f]>(z[f]||0)&&c--,a==null?(b=a=F.precision,o=F.rounding):u?b=a+(r.e-i.e)+1:b=a,b<0)g.push(1),v=!0;else{if(b=b/h+2|0,f=0,_==1){for(d=0,N=N[0],b++;(f<A||d)&&b--;f++)E=d*l+(z[f]||0),g[f]=E/N|0,d=E%N|0;v=d||f<A}else{for(d=l/(N[0]+1)|0,d>1&&(N=e(N,d,l),z=e(z,d,l),_=N.length,A=z.length),C=_,y=z.slice(0,_),S=y.length;S<_;)y[S++]=0;x=N.slice(),x.unshift(0),T=N[0],N[1]>=l/2&&++T;do d=0,s=t(N,y,_,S),s<0?(w=y[0],_!=S&&(w=w*l+(y[1]||0)),d=w/T|0,d>1?(d>=l&&(d=l-1),m=e(N,d,l),D=m.length,S=y.length,s=t(m,y,D,S),s==1&&(d--,n(m,_<D?x:N,D,l))):(d==0&&(s=d=1),m=N.slice()),D=m.length,D<S&&m.unshift(0),n(y,m,S,l),s==-1&&(S=y.length,s=t(N,y,_,S),s<1&&(d++,n(y,_<S?x:N,S,l))),S=y.length):s===0&&(d++,y=[0]),g[f++]=d,s&&y[0]?y[S++]=z[C]||0:(y=[z[C]],S=1);while((C++<A||y[0]!==void 0)&&b--);v=y[0]!==void 0}g[0]||g.shift()}if(h==1)p.e=c,jy=v;else{for(f=1,d=g[0];d>=10;d/=10)f++;p.e=f+c*h-1,be(p,u?a+p.e+1:a,o,v)}return p}}();function be(e,t,n,r){var i,a,o,u,l,s,c,f,d,h=e.constructor;e:if(t!=null){if(f=e.d,!f)return e;for(i=1,u=f[0];u>=10;u/=10)i++;if(a=t-i,a<0)a+=xe,o=t,c=f[d=0],l=c/Ut(10,i-o-1)%10|0;else if(d=Math.ceil((a+1)/xe),u=f.length,d>=u)if(r){for(;u++<=d;)f.push(0);c=l=0,i=1,a%=xe,o=a-xe+1}else break e;else{for(c=u=f[d],i=1;u>=10;u/=10)i++;a%=xe,o=a-xe+i,l=o<0?0:c/Ut(10,i-o-1)%10|0}if(r=r||t<0||f[d+1]!==void 0||(o<0?c:c%Ut(10,i-o-1)),s=n<4?(l||r)&&(n==0||n==(e.s<0?3:2)):l>5||l==5&&(n==4||r||n==6&&(a>0?o>0?c/Ut(10,i-o):0:f[d-1])%10&1||n==(e.s<0?8:7)),t<1||!f[0])return f.length=0,s?(t-=e.e+1,f[0]=Ut(10,(xe-t%xe)%xe),e.e=-t||0):f[0]=e.e=0,e;if(a==0?(f.length=d,u=1,d--):(f.length=d+1,u=Ut(10,xe-a),f[d]=o>0?(c/Ut(10,i-o)%Ut(10,o)|0)*u:0),s)for(;;)if(d==0){for(a=1,o=f[0];o>=10;o/=10)a++;for(o=f[0]+=u,u=1;o>=10;o/=10)u++;a!=u&&(e.e++,f[0]==or&&(f[0]=1));break}else{if(f[d]+=u,f[d]!=or)break;f[d--]=0,u=1}for(a=f.length;f[--a]===0;)f.pop()}return Ae&&(e.e>h.maxE?(e.d=null,e.e=NaN):e.e<h.minE&&(e.e=0,e.d=[0])),e}function br(e,t,n){if(!e.isFinite())return Qy(e);var r,i=e.e,a=Xt(e.d),o=a.length;return t?(n&&(r=n-o)>0?a=a.charAt(0)+"."+a.slice(1)+Bi(r):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(e.e<0?"e":"e+")+e.e):i<0?(a="0."+Bi(-i-1)+a,n&&(r=n-o)>0&&(a+=Bi(r))):i>=o?(a+=Bi(i+1-o),n&&(r=n-i-1)>0&&(a=a+"."+Bi(r))):((r=i+1)<o&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-o)>0&&(i+1===o&&(a+="."),a+=Bi(r))),a}function tc(e,t){var n=e[0];for(t*=xe;n>=10;n/=10)t++;return t}function nc(e,t,n){if(t>jC)throw Ae=!0,n&&(e.precision=n),Error(Hy);return be(new e(Ks),t,1,!0)}function Dr(e,t,n){if(t>wh)throw Error(Hy);return be(new e(Ws),t,n,!0)}function Gy(e){var t=e.length-1,n=t*xe+1;if(t=e[t],t){for(;t%10==0;t/=10)n--;for(t=e[0];t>=10;t/=10)n++}return n}function Bi(e){for(var t="";e--;)t+="0";return t}function Yy(e,t,n,r){var i,a=new e(1),o=Math.ceil(r/xe+4);for(Ae=!1;;){if(n%2&&(a=a.times(t),Wy(a.d,o)&&(i=!0)),n=Jt(n/2),n===0){n=a.d.length-1,i&&a.d[n]===0&&++a.d[n];break}t=t.times(t),Wy(t.d,o)}return Ae=!0,a}function Xy(e){return e.d[e.d.length-1]&1}function Zy(e,t,n){for(var r,i,a=new e(t[0]),o=0;++o<t.length;){if(i=new e(t[o]),!i.s){a=i;break}r=a.cmp(i),(r===n||r===0&&a.s===n)&&(a=i)}return a}function Eh(e,t){var n,r,i,a,o,u,l,s=0,c=0,f=0,d=e.constructor,h=d.rounding,v=d.precision;if(!e.d||!e.d[0]||e.e>17)return new d(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(t==null?(Ae=!1,l=v):l=t,u=new d(.03125);e.e>-2;)e=e.times(u),f+=5;for(r=Math.log(Ut(2,f))/Math.LN10*2+5|0,l+=r,n=a=o=new d(1),d.precision=l;;){if(a=be(a.times(e),l,1),n=n.times(++c),u=o.plus(tt(a,n,l,1)),Xt(u.d).slice(0,l)===Xt(o.d).slice(0,l)){for(i=f;i--;)o=be(o.times(o),l,1);if(t==null)if(s<3&&Hu(o.d,l-r,h,s))d.precision=l+=10,n=a=u=new d(1),c=0,s++;else return be(o,d.precision=v,h,Ae=!0);else return d.precision=v,o}o=u}}function Fi(e,t){var n,r,i,a,o,u,l,s,c,f,d,h=1,v=10,m=e,D=m.d,p=m.constructor,g=p.rounding,y=p.precision;if(m.s<0||!D||!D[0]||!m.e&&D[0]==1&&D.length==1)return new p(D&&!D[0]?-1/0:m.s!=1?NaN:D?0:m);if(t==null?(Ae=!1,c=y):c=t,p.precision=c+=v,n=Xt(D),r=n.charAt(0),Math.abs(a=m.e)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)m=m.times(e),n=Xt(m.d),r=n.charAt(0),h++;a=m.e,r>1?(m=new p("0."+n),a++):m=new p(r+"."+n.slice(1))}else return s=nc(p,c+2,y).times(a+""),m=Fi(new p(r+"."+n.slice(1)),c-v).plus(s),p.precision=y,t==null?be(m,y,g,Ae=!0):m;for(f=m,l=o=m=tt(m.minus(1),m.plus(1),c,1),d=be(m.times(m),c,1),i=3;;){if(o=be(o.times(d),c,1),s=l.plus(tt(o,new p(i),c,1)),Xt(s.d).slice(0,c)===Xt(l.d).slice(0,c))if(l=l.times(2),a!==0&&(l=l.plus(nc(p,c+2,y).times(a+""))),l=tt(l,new p(h),c,1),t==null)if(Hu(l.d,c-v,g,u))p.precision=c+=v,s=o=m=tt(f.minus(1),f.plus(1),c,1),d=be(m.times(m),c,1),i=u=1;else return be(l,p.precision=y,g,Ae=!0);else return p.precision=y,l;l=s,i+=2}}function Qy(e){return String(e.s*e.s/0)}function rc(e,t){var n,r,i;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;r++);for(i=t.length;t.charCodeAt(i-1)===48;--i);if(t=t.slice(r,i),t){if(i-=r,e.e=n=n-r-1,e.d=[],r=(n+1)%xe,n<0&&(r+=xe),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=xe;r<i;)e.d.push(+t.slice(r,r+=xe));t=t.slice(r),r=xe-t.length}else r-=i;for(;r--;)t+="0";e.d.push(+t),Ae&&(e.e>e.constructor.maxE?(e.d=null,e.e=NaN):e.e<e.constructor.minE&&(e.e=0,e.d=[0]))}else e.e=0,e.d=[0];return e}function PC(e,t){var n,r,i,a,o,u,l,s,c;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),Vy.test(t))return rc(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if($C.test(t))n=16,t=t.toLowerCase();else if(IC.test(t))n=2;else if(kC.test(t))n=8;else throw Error(_i+t);for(a=t.search(/p/i),a>0?(l=+t.slice(a+1),t=t.substring(2,a)):t=t.slice(2),a=t.indexOf("."),o=a>=0,r=e.constructor,o&&(t=t.replace(".",""),u=t.length,a=u-a,i=Yy(r,new r(n),a,a*2)),s=ec(t,n,or),c=s.length-1,a=c;s[a]===0;--a)s.pop();return a<0?new r(e.s*0):(e.e=tc(s,c),e.d=s,Ae=!1,o&&(e=tt(e,i,u*4)),l&&(e=e.times(Math.abs(l)<54?Ut(2,l):fo.pow(2,l))),Ae=!0,e)}function qC(e,t){var n,r=t.d.length;if(r<3)return t.isZero()?t:co(e,2,t,t);n=1.4*Math.sqrt(r),n=n>16?16:n|0,t=t.times(1/ic(5,n)),t=co(e,2,t,t);for(var i,a=new e(5),o=new e(16),u=new e(20);n--;)i=t.times(t),t=t.times(a.plus(i.times(o.times(i).minus(u))));return t}function co(e,t,n,r,i){var a,o,u,l,s=e.precision,c=Math.ceil(s/xe);for(Ae=!1,l=n.times(n),u=new e(r);;){if(o=tt(u.times(l),new e(t++*t++),s,1),u=i?r.plus(o):r.minus(o),r=tt(o.times(l),new e(t++*t++),s,1),o=u.plus(r),o.d[c]!==void 0){for(a=c;o.d[a]===u.d[a]&&a--;);if(a==-1)break}a=u,u=r,r=o,o=a}return Ae=!0,o.d.length=c+1,o}function ic(e,t){for(var n=e;--t;)n*=e;return n}function Ky(e,t){var n,r=t.s<0,i=Dr(e,e.precision,1),a=i.times(.5);if(t=t.abs(),t.lte(a))return Gr=r?4:1,t;if(n=t.divToInt(i),n.isZero())Gr=r?3:2;else{if(t=t.minus(n.times(i)),t.lte(a))return Gr=Xy(n)?r?2:3:r?4:1,t;Gr=Xy(n)?r?1:4:r?3:2}return t.minus(i).abs()}function Ah(e,t,n,r){var i,a,o,u,l,s,c,f,d,h=e.constructor,v=n!==void 0;if(v?(hn(n,1,Mi),r===void 0?r=h.rounding:hn(r,0,8)):(n=h.precision,r=h.rounding),!e.isFinite())c=Qy(e);else{for(c=br(e),o=c.indexOf("."),v?(i=2,t==16?n=n*4-3:t==8&&(n=n*3-2)):i=t,o>=0&&(c=c.replace(".",""),d=new h(1),d.e=c.length-o,d.d=ec(br(d),10,i),d.e=d.d.length),f=ec(c,10,i),a=l=f.length;f[--l]==0;)f.pop();if(!f[0])c=v?"0p+0":"0";else{if(o<0?a--:(e=new h(e),e.d=f,e.e=a,e=tt(e,d,n,r,0,i),f=e.d,a=e.e,s=jy),o=f[n],u=i/2,s=s||f[n+1]!==void 0,s=r<4?(o!==void 0||s)&&(r===0||r===(e.s<0?3:2)):o>u||o===u&&(r===4||s||r===6&&f[n-1]&1||r===(e.s<0?8:7)),f.length=n,s)for(;++f[--n]>i-1;)f[n]=0,n||(++a,f.unshift(1));for(l=f.length;!f[l-1];--l);for(o=0,c="";o<l;o++)c+=Sh.charAt(f[o]);if(v){if(l>1)if(t==16||t==8){for(o=t==16?4:3,--l;l%o;l++)c+="0";for(f=ec(c,i,t),l=f.length;!f[l-1];--l);for(o=1,c="1.";o<l;o++)c+=Sh.charAt(f[o])}else c=c.charAt(0)+"."+c.slice(1);c=c+(a<0?"p":"p+")+a}else if(a<0){for(;++a;)c="0"+c;c="0."+c}else if(++a>l)for(a-=l;a--;)c+="0";else a<l&&(c=c.slice(0,a)+"."+c.slice(a))}c=(t==16?"0x":t==2?"0b":t==8?"0o":"")+c}return e.s<0?"-"+c:c}function Wy(e,t){if(e.length>t)return e.length=t,!0}function VC(e){return new this(e).abs()}function GC(e){return new this(e).acos()}function YC(e){return new this(e).acosh()}function XC(e,t){return new this(e).plus(t)}function ZC(e){return new this(e).asin()}function QC(e){return new this(e).asinh()}function KC(e){return new this(e).atan()}function WC(e){return new this(e).atanh()}function JC(e,t){e=new this(e),t=new this(t);var n,r=this.precision,i=this.rounding,a=r+4;return!e.s||!t.s?n=new this(NaN):!e.d&&!t.d?(n=Dr(this,a,1).times(t.s>0?.25:.75),n.s=e.s):!t.d||e.isZero()?(n=t.s<0?Dr(this,r,i):new this(0),n.s=e.s):!e.d||t.isZero()?(n=Dr(this,a,1).times(.5),n.s=e.s):t.s<0?(this.precision=a,this.rounding=1,n=this.atan(tt(e,t,a,1)),t=Dr(this,a,1),this.precision=r,this.rounding=i,n=e.s<0?n.minus(t):n.plus(t)):n=this.atan(tt(e,t,a,1)),n}function e3(e){return new this(e).cbrt()}function t3(e){return be(e=new this(e),e.e+1,2)}function n3(e,t,n){return new this(e).clamp(t,n)}function r3(e){if(!e||typeof e!="object")throw Error(Js+"Object expected");var t,n,r,i=e.defaults===!0,a=["precision",1,Mi,"rounding",0,8,"toExpNeg",-so,0,"toExpPos",0,so,"maxE",0,so,"minE",-so,0,"modulo",0,9];for(t=0;t<a.length;t+=3)if(n=a[t],i&&(this[n]=xh[n]),(r=e[n])!==void 0)if(Jt(r)===r&&r>=a[t+1]&&r<=a[t+2])this[n]=r;else throw Error(_i+n+": "+r);if(n="crypto",i&&(this[n]=xh[n]),(r=e[n])!==void 0)if(r===!0||r===!1||r===0||r===1)if(r)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[n]=!0;else throw Error(Py);else this[n]=!1;else throw Error(_i+n+": "+r);return this}function i3(e){return new this(e).cos()}function a3(e){return new this(e).cosh()}function Jy(e){var t,n,r;function i(a){var o,u,l,s=this;if(!(s instanceof i))return new i(a);if(s.constructor=i,eb(a)){s.s=a.s,Ae?!a.d||a.e>i.maxE?(s.e=NaN,s.d=null):a.e<i.minE?(s.e=0,s.d=[0]):(s.e=a.e,s.d=a.d.slice()):(s.e=a.e,s.d=a.d?a.d.slice():a.d);return}if(l=typeof a,l==="number"){if(a===0){s.s=1/a<0?-1:1,s.e=0,s.d=[0];return}if(a<0?(a=-a,s.s=-1):s.s=1,a===~~a&&a<1e7){for(o=0,u=a;u>=10;u/=10)o++;Ae?o>i.maxE?(s.e=NaN,s.d=null):o<i.minE?(s.e=0,s.d=[0]):(s.e=o,s.d=[a]):(s.e=o,s.d=[a]);return}if(a*0!==0){a||(s.s=NaN),s.e=NaN,s.d=null;return}return rc(s,a.toString())}if(l==="string")return(u=a.charCodeAt(0))===45?(a=a.slice(1),s.s=-1):(u===43&&(a=a.slice(1)),s.s=1),Vy.test(a)?rc(s,a):PC(s,a);if(l==="bigint")return a<0?(a=-a,s.s=-1):s.s=1,rc(s,a.toString());throw Error(_i+a)}if(i.prototype=ie,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.EUCLID=9,i.config=i.set=r3,i.clone=Jy,i.isDecimal=eb,i.abs=VC,i.acos=GC,i.acosh=YC,i.add=XC,i.asin=ZC,i.asinh=QC,i.atan=KC,i.atanh=WC,i.atan2=JC,i.cbrt=e3,i.ceil=t3,i.clamp=n3,i.cos=i3,i.cosh=a3,i.div=o3,i.exp=u3,i.floor=l3,i.hypot=s3,i.ln=c3,i.log=f3,i.log10=h3,i.log2=d3,i.max=m3,i.min=p3,i.mod=g3,i.mul=v3,i.pow=y3,i.random=b3,i.round=D3,i.sign=S3,i.sin=x3,i.sinh=w3,i.sqrt=E3,i.sub=A3,i.sum=C3,i.tan=T3,i.tanh=M3,i.trunc=_3,e===void 0&&(e={}),e&&e.defaults!==!0)for(r=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return i.config(e),i}function o3(e,t){return new this(e).div(t)}function u3(e){return new this(e).exp()}function l3(e){return be(e=new this(e),e.e+1,3)}function s3(){var e,t,n=new this(0);for(Ae=!1,e=0;e<arguments.length;)if(t=new this(arguments[e++]),t.d)n.d&&(n=n.plus(t.times(t)));else{if(t.s)return Ae=!0,new this(1/0);n=t}return Ae=!0,n.sqrt()}function eb(e){return e instanceof fo||e&&e.toStringTag===qy||!1}function c3(e){return new this(e).ln()}function f3(e,t){return new this(e).log(t)}function d3(e){return new this(e).log(2)}function h3(e){return new this(e).log(10)}function m3(){return Zy(this,arguments,-1)}function p3(){return Zy(this,arguments,1)}function g3(e,t){return new this(e).mod(t)}function v3(e,t){return new this(e).mul(t)}function y3(e,t){return new this(e).pow(t)}function b3(e){var t,n,r,i,a=0,o=new this(1),u=[];if(e===void 0?e=this.precision:hn(e,1,Mi),r=Math.ceil(e/xe),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(r));a<r;)i=t[a],i>=429e7?t[a]=crypto.getRandomValues(new Uint32Array(1))[0]:u[a++]=i%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(r*=4);a<r;)i=t[a]+(t[a+1]<<8)+(t[a+2]<<16)+((t[a+3]&127)<<24),i>=214e7?crypto.randomBytes(4).copy(t,a):(u.push(i%1e7),a+=4);a=r/4}else throw Error(Py);else for(;a<r;)u[a++]=Math.random()*1e7|0;for(r=u[--a],e%=xe,r&&e&&(i=Ut(10,xe-e),u[a]=(r/i|0)*i);u[a]===0;a--)u.pop();if(a<0)n=0,u=[0];else{for(n=-1;u[0]===0;n-=xe)u.shift();for(r=1,i=u[0];i>=10;i/=10)r++;r<xe&&(n-=xe-r)}return o.e=n,o.d=u,o}function D3(e){return be(e=new this(e),e.e+1,this.rounding)}function S3(e){return e=new this(e),e.d?e.d[0]?e.s:0*e.s:e.s||NaN}function x3(e){return new this(e).sin()}function w3(e){return new this(e).sinh()}function E3(e){return new this(e).sqrt()}function A3(e,t){return new this(e).sub(t)}function C3(){var e=0,t=arguments,n=new this(t[e]);for(Ae=!1;n.s&&++e<t.length;)n=n.plus(t[e]);return Ae=!0,be(n,this.precision,this.rounding)}function T3(e){return new this(e).tan()}function M3(e){return new this(e).tanh()}function _3(e){return be(e=new this(e),e.e+1,1)}ie[Symbol.for("nodejs.util.inspect.custom")]=ie.toString,ie[Symbol.toStringTag]="Decimal";var fo=ie.constructor=Jy(xh);Ks=new fo(Ks),Ws=new fo(Ws);var B3="BigNumber",F3=["?on","config"],N3=se(B3,F3,e=>{var{on:t,config:n}=e,r=fo.clone({precision:n.precision,modulo:fo.EUCLID});return r.prototype=Object.create(r.prototype),r.prototype.type="BigNumber",r.prototype.isBigNumber=!0,r.prototype.toJSON=function(){return{mathjs:"BigNumber",value:this.toString()}},r.fromJSON=function(i){return new r(i.value)},t&&t("config",function(i,a){i.precision!==a.precision&&r.config({precision:i.precision})}),r},{isClass:!0});const en=Math.cosh||function(e){return Math.abs(e)<1e-9?1-e:(Math.exp(e)+Math.exp(-e))*.5},Zn=Math.sinh||function(e){return Math.abs(e)<1e-9?e:(Math.exp(e)-Math.exp(-e))*.5},R3=function(e){const t=Math.PI/4;if(-t>e||e>t)return Math.cos(e)-1;const n=e*e;return n*(n*(n*(n*(n*(n*(n*(n/20922789888e3-1/87178291200)+1/479001600)-1/3628800)+1/40320)-1/720)+1/24)-1/2)},Ch=function(e,t){return e=Math.abs(e),t=Math.abs(t),e<t&&([e,t]=[t,e]),e<1e8?Math.sqrt(e*e+t*t):(t/=e,e*Math.sqrt(1+t*t))},ho=function(){throw SyntaxError("Invalid Param")};function Th(e,t){const n=Math.abs(e),r=Math.abs(t);return e===0?Math.log(r):t===0?Math.log(n):n<3e3&&r<3e3?Math.log(e*e+t*t)*.5:(e=e*.5,t=t*.5,.5*Math.log(e*e+t*t)+Math.LN2)}const O3={re:0,im:0},ra=function(e,t){const n=O3;if(e==null)n.re=n.im=0;else if(t!==void 0)n.re=e,n.im=t;else switch(typeof e){case"object":if("im"in e&&"re"in e)n.re=e.re,n.im=e.im;else if("abs"in e&&"arg"in e){if(!isFinite(e.abs)&&isFinite(e.arg))return Q.INFINITY;n.re=e.abs*Math.cos(e.arg),n.im=e.abs*Math.sin(e.arg)}else if("r"in e&&"phi"in e){if(!isFinite(e.r)&&isFinite(e.phi))return Q.INFINITY;n.re=e.r*Math.cos(e.phi),n.im=e.r*Math.sin(e.phi)}else e.length===2?(n.re=e[0],n.im=e[1]):ho();break;case"string":n.im=n.re=0;const r=e.replace(/_/g,"").match(/\d+\.?\d*e[+-]?\d+|\d+\.?\d*|\.\d+|./g);let i=1,a=0;r===null&&ho();for(let o=0;o<r.length;o++){const u=r[o];u===" "||u===" "||u===`
64
+ `||(u==="+"?i++:u==="-"?a++:u==="i"||u==="I"?(i+a===0&&ho(),r[o+1]!==" "&&!isNaN(r[o+1])?(n.im+=parseFloat((a%2?"-":"")+r[o+1]),o++):n.im+=parseFloat((a%2?"-":"")+"1"),i=a=0):((i+a===0||isNaN(u))&&ho(),r[o+1]==="i"||r[o+1]==="I"?(n.im+=parseFloat((a%2?"-":"")+u),o++):n.re+=parseFloat((a%2?"-":"")+u),i=a=0))}i+a>0&&ho();break;case"number":n.im=0,n.re=e;break;default:ho()}return isNaN(n.re)||isNaN(n.im),n};function Q(e,t){if(!(this instanceof Q))return new Q(e,t);const n=ra(e,t);this.re=n.re,this.im=n.im}Q.prototype={re:0,im:0,sign:function(){const e=Ch(this.re,this.im);return new Q(this.re/e,this.im/e)},add:function(e,t){const n=ra(e,t),r=this.isInfinite(),i=!(isFinite(n.re)&&isFinite(n.im));return r||i?r&&i?Q.NAN:Q.INFINITY:new Q(this.re+n.re,this.im+n.im)},sub:function(e,t){const n=ra(e,t),r=this.isInfinite(),i=!(isFinite(n.re)&&isFinite(n.im));return r||i?r&&i?Q.NAN:Q.INFINITY:new Q(this.re-n.re,this.im-n.im)},mul:function(e,t){const n=ra(e,t),r=this.isInfinite(),i=!(isFinite(n.re)&&isFinite(n.im)),a=this.re===0&&this.im===0,o=n.re===0&&n.im===0;return r&&o||i&&a?Q.NAN:r||i?Q.INFINITY:n.im===0&&this.im===0?new Q(this.re*n.re,0):new Q(this.re*n.re-this.im*n.im,this.re*n.im+this.im*n.re)},div:function(e,t){const n=ra(e,t),r=this.isInfinite(),i=!(isFinite(n.re)&&isFinite(n.im)),a=this.re===0&&this.im===0,o=n.re===0&&n.im===0;if(a&&o||r&&i)return Q.NAN;if(o||r)return Q.INFINITY;if(a||i)return Q.ZERO;if(n.im===0)return new Q(this.re/n.re,this.im/n.re);if(Math.abs(n.re)<Math.abs(n.im)){const u=n.re/n.im,l=n.re*u+n.im;return new Q((this.re*u+this.im)/l,(this.im*u-this.re)/l)}else{const u=n.im/n.re,l=n.im*u+n.re;return new Q((this.re+this.im*u)/l,(this.im-this.re*u)/l)}},pow:function(e,t){const n=ra(e,t),r=this.re===0&&this.im===0;if(n.re===0&&n.im===0)return Q.ONE;if(n.im===0){if(this.im===0&&this.re>0)return new Q(Math.pow(this.re,n.re),0);if(this.re===0)switch((n.re%4+4)%4){case 0:return new Q(Math.pow(this.im,n.re),0);case 1:return new Q(0,Math.pow(this.im,n.re));case 2:return new Q(-Math.pow(this.im,n.re),0);case 3:return new Q(0,-Math.pow(this.im,n.re))}}if(r&&n.re>0)return Q.ZERO;const a=Math.atan2(this.im,this.re),o=Th(this.re,this.im);let u=Math.exp(n.re*o-n.im*a),l=n.im*o+n.re*a;return new Q(u*Math.cos(l),u*Math.sin(l))},sqrt:function(){const e=this.re,t=this.im;if(t===0)return e>=0?new Q(Math.sqrt(e),0):new Q(0,Math.sqrt(-e));const n=Ch(e,t);let r=Math.sqrt(.5*(n+Math.abs(e))),i=Math.abs(t)/(2*r);return e>=0?new Q(r,t<0?-i:i):new Q(i,t<0?-r:r)},exp:function(){const e=Math.exp(this.re);return this.im===0?new Q(e,0):new Q(e*Math.cos(this.im),e*Math.sin(this.im))},expm1:function(){const e=this.re,t=this.im;return new Q(Math.expm1(e)*Math.cos(t)+R3(t),Math.exp(e)*Math.sin(t))},log:function(){const e=this.re,t=this.im;return t===0&&e>0?new Q(Math.log(e),0):new Q(Th(e,t),Math.atan2(t,e))},abs:function(){return Ch(this.re,this.im)},arg:function(){return Math.atan2(this.im,this.re)},sin:function(){const e=this.re,t=this.im;return new Q(Math.sin(e)*en(t),Math.cos(e)*Zn(t))},cos:function(){const e=this.re,t=this.im;return new Q(Math.cos(e)*en(t),-Math.sin(e)*Zn(t))},tan:function(){const e=2*this.re,t=2*this.im,n=Math.cos(e)+en(t);return new Q(Math.sin(e)/n,Zn(t)/n)},cot:function(){const e=2*this.re,t=2*this.im,n=Math.cos(e)-en(t);return new Q(-Math.sin(e)/n,Zn(t)/n)},sec:function(){const e=this.re,t=this.im,n=.5*en(2*t)+.5*Math.cos(2*e);return new Q(Math.cos(e)*en(t)/n,Math.sin(e)*Zn(t)/n)},csc:function(){const e=this.re,t=this.im,n=.5*en(2*t)-.5*Math.cos(2*e);return new Q(Math.sin(e)*en(t)/n,-Math.cos(e)*Zn(t)/n)},asin:function(){const e=this.re,t=this.im,n=new Q(t*t-e*e+1,-2*e*t).sqrt(),r=new Q(n.re-t,n.im+e).log();return new Q(r.im,-r.re)},acos:function(){const e=this.re,t=this.im,n=new Q(t*t-e*e+1,-2*e*t).sqrt(),r=new Q(n.re-t,n.im+e).log();return new Q(Math.PI/2-r.im,r.re)},atan:function(){const e=this.re,t=this.im;if(e===0){if(t===1)return new Q(0,1/0);if(t===-1)return new Q(0,-1/0)}const n=e*e+(1-t)*(1-t),r=new Q((1-t*t-e*e)/n,-2*e/n).log();return new Q(-.5*r.im,.5*r.re)},acot:function(){const e=this.re,t=this.im;if(t===0)return new Q(Math.atan2(1,e),0);const n=e*e+t*t;return n!==0?new Q(e/n,-t/n).atan():new Q(e!==0?e/0:0,t!==0?-t/0:0).atan()},asec:function(){const e=this.re,t=this.im;if(e===0&&t===0)return new Q(0,1/0);const n=e*e+t*t;return n!==0?new Q(e/n,-t/n).acos():new Q(e!==0?e/0:0,t!==0?-t/0:0).acos()},acsc:function(){const e=this.re,t=this.im;if(e===0&&t===0)return new Q(Math.PI/2,1/0);const n=e*e+t*t;return n!==0?new Q(e/n,-t/n).asin():new Q(e!==0?e/0:0,t!==0?-t/0:0).asin()},sinh:function(){const e=this.re,t=this.im;return new Q(Zn(e)*Math.cos(t),en(e)*Math.sin(t))},cosh:function(){const e=this.re,t=this.im;return new Q(en(e)*Math.cos(t),Zn(e)*Math.sin(t))},tanh:function(){const e=2*this.re,t=2*this.im,n=en(e)+Math.cos(t);return new Q(Zn(e)/n,Math.sin(t)/n)},coth:function(){const e=2*this.re,t=2*this.im,n=en(e)-Math.cos(t);return new Q(Zn(e)/n,-Math.sin(t)/n)},csch:function(){const e=this.re,t=this.im,n=Math.cos(2*t)-en(2*e);return new Q(-2*Zn(e)*Math.cos(t)/n,2*en(e)*Math.sin(t)/n)},sech:function(){const e=this.re,t=this.im,n=Math.cos(2*t)+en(2*e);return new Q(2*en(e)*Math.cos(t)/n,-2*Zn(e)*Math.sin(t)/n)},asinh:function(){let e=this.im;this.im=-this.re,this.re=e;const t=this.asin();return this.re=-this.im,this.im=e,e=t.re,t.re=-t.im,t.im=e,t},acosh:function(){const e=this.acos();if(e.im<=0){const t=e.re;e.re=-e.im,e.im=t}else{const t=e.im;e.im=-e.re,e.re=t}return e},atanh:function(){const e=this.re,t=this.im,n=e>1&&t===0,r=1-e,i=1+e,a=r*r+t*t,o=a!==0?new Q((i*r-t*t)/a,(t*r+i*t)/a):new Q(e!==-1?e/0:0,t!==0?t/0:0),u=o.re;return o.re=Th(o.re,o.im)/2,o.im=Math.atan2(o.im,u)/2,n&&(o.im=-o.im),o},acoth:function(){const e=this.re,t=this.im;if(e===0&&t===0)return new Q(0,Math.PI/2);const n=e*e+t*t;return n!==0?new Q(e/n,-t/n).atanh():new Q(e!==0?e/0:0,t!==0?-t/0:0).atanh()},acsch:function(){const e=this.re,t=this.im;if(t===0)return new Q(e!==0?Math.log(e+Math.sqrt(e*e+1)):1/0,0);const n=e*e+t*t;return n!==0?new Q(e/n,-t/n).asinh():new Q(e!==0?e/0:0,t!==0?-t/0:0).asinh()},asech:function(){const e=this.re,t=this.im;if(this.isZero())return Q.INFINITY;const n=e*e+t*t;return n!==0?new Q(e/n,-t/n).acosh():new Q(e!==0?e/0:0,t!==0?-t/0:0).acosh()},inverse:function(){if(this.isZero())return Q.INFINITY;if(this.isInfinite())return Q.ZERO;const e=this.re,t=this.im,n=e*e+t*t;return new Q(e/n,-t/n)},conjugate:function(){return new Q(this.re,-this.im)},neg:function(){return new Q(-this.re,-this.im)},ceil:function(e){return e=Math.pow(10,e||0),new Q(Math.ceil(this.re*e)/e,Math.ceil(this.im*e)/e)},floor:function(e){return e=Math.pow(10,e||0),new Q(Math.floor(this.re*e)/e,Math.floor(this.im*e)/e)},round:function(e){return e=Math.pow(10,e||0),new Q(Math.round(this.re*e)/e,Math.round(this.im*e)/e)},equals:function(e,t){const n=ra(e,t);return Math.abs(n.re-this.re)<=Q.EPSILON&&Math.abs(n.im-this.im)<=Q.EPSILON},clone:function(){return new Q(this.re,this.im)},toString:function(){let e=this.re,t=this.im,n="";return this.isNaN()?"NaN":this.isInfinite()?"Infinity":(Math.abs(e)<Q.EPSILON&&(e=0),Math.abs(t)<Q.EPSILON&&(t=0),t===0?n+e:(e!==0?(n+=e,n+=" ",t<0?(t=-t,n+="-"):n+="+",n+=" "):t<0&&(t=-t,n+="-"),t!==1&&(n+=t),n+"i"))},toVector:function(){return[this.re,this.im]},valueOf:function(){return this.im===0?this.re:null},isNaN:function(){return isNaN(this.re)||isNaN(this.im)},isZero:function(){return this.im===0&&this.re===0},isFinite:function(){return isFinite(this.re)&&isFinite(this.im)},isInfinite:function(){return!this.isFinite()}},Q.ZERO=new Q(0,0),Q.ONE=new Q(1,0),Q.I=new Q(0,1),Q.PI=new Q(Math.PI,0),Q.E=new Q(Math.E,0),Q.INFINITY=new Q(1/0,1/0),Q.NAN=new Q(NaN,NaN),Q.EPSILON=1e-15;var z3="Complex",U3=[],I3=se(z3,U3,()=>(Object.defineProperty(Q,"name",{value:"Complex"}),Q.prototype.constructor=Q,Q.prototype.type="Complex",Q.prototype.isComplex=!0,Q.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},Q.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},Q.prototype.format=function(e){var t="",n=this.im,r=this.re,i=Dh(this.re,e),a=Dh(this.im,e),o=et(e)?e:e?e.precision:null;if(o!==null){var u=Math.pow(10,-o);Math.abs(r/n)<u&&(r=0),Math.abs(n/r)<u&&(n=0)}return n===0?t=i:r===0?n===1?t="i":n===-1?t="-i":t=a+"i":n<0?n===-1?t=i+" - i":t=i+" - "+a.substring(1)+"i":n===1?t=i+" + i":t=i+" + "+a+"i",t},Q.fromPolar=function(e){switch(arguments.length){case 1:{var t=arguments[0];if(typeof t=="object")return Q(t);throw new TypeError("Input has to be an object with r and phi keys.")}case 2:{var n=arguments[0],r=arguments[1];if(et(n)){if(My(r)&&r.hasBase("ANGLE")&&(r=r.toNumber("rad")),et(r))return new Q({r:n,phi:r});throw new TypeError("Phi is not a number nor an angle unit.")}else throw new TypeError("Radius r is not a number.")}default:throw new SyntaxError("Wrong number of arguments in function fromPolar")}},Q.prototype.valueOf=Q.prototype.toString,Q.fromJSON=function(e){return new Q(e)},Q.compare=function(e,t){return e.re>t.re?1:e.re<t.re?-1:e.im>t.im?1:e.im<t.im?-1:0},Q),{isClass:!0});typeof BigInt>"u"&&(BigInt=function(e){if(isNaN(e))throw new Error("");return e});const ge=BigInt(0),Me=BigInt(1),jt=BigInt(2),Pu=BigInt(3),mo=BigInt(5),mn=BigInt(10);BigInt(Number.MAX_SAFE_INTEGER);const $3=2e3,fe={s:Me,n:ge,d:Me};function Yr(e,t){try{e=BigInt(e)}catch{throw Ni()}return e*t}function ur(e){return typeof e=="bigint"?e:Math.floor(e)}function mt(e,t){if(t===ge)throw Mh();const n=Object.create(Qn.prototype);n.s=e<ge?-Me:Me,e=e<ge?-e:e;const r=ia(e,t);return n.n=e/r,n.d=t/r,n}const k3=[jt*jt,jt,jt*jt,jt,jt*jt,jt*Pu,jt,jt*Pu];function po(e){const t=Object.create(null);if(e<=Me)return t[e]=Me,t;const n=r=>{t[r]=(t[r]||ge)+Me};for(;e%jt===ge;)n(jt),e/=jt;for(;e%Pu===ge;)n(Pu),e/=Pu;for(;e%mo===ge;)n(mo),e/=mo;for(let r=0,i=jt+mo;i*i<=e;){for(;e%i===ge;)n(i),e/=i;i+=k3[r],r=r+1&7}return e>Me&&n(e),t}const Ht=function(e,t){let n=ge,r=Me,i=Me;if(e!=null)if(t!==void 0){if(typeof e=="bigint")n=e;else{if(isNaN(e))throw Ni();if(e%1!==0)throw tb();n=BigInt(e)}if(typeof t=="bigint")r=t;else{if(isNaN(t))throw Ni();if(t%1!==0)throw tb();r=BigInt(t)}i=n*r}else if(typeof e=="object"){if("d"in e&&"n"in e)n=BigInt(e.n),r=BigInt(e.d),"s"in e&&(n*=BigInt(e.s));else if(0 in e)n=BigInt(e[0]),1 in e&&(r=BigInt(e[1]));else if(typeof e=="bigint")n=e;else throw Ni();i=n*r}else if(typeof e=="number"){if(isNaN(e))throw Ni();if(e<0&&(i=-Me,e=-e),e%1===0)n=BigInt(e);else{let a=1,o=0,u=1,l=1,s=1,c=1e7;for(e>=1&&(a=10**Math.floor(1+Math.log10(e)),e/=a);u<=c&&s<=c;){let f=(o+l)/(u+s);if(e===f){u+s<=c?(n=o+l,r=u+s):s>u?(n=l,r=s):(n=o,r=u);break}else e>f?(o+=l,u+=s):(l+=o,s+=u),u>c?(n=l,r=s):(n=o,r=u)}n=BigInt(n)*BigInt(a),r=BigInt(r)}}else if(typeof e=="string"){let a=0,o=ge,u=ge,l=ge,s=Me,c=Me,f=e.replace(/_/g,"").match(/\d+|./g);if(f===null)throw Ni();if(f[a]==="-"?(i=-Me,a++):f[a]==="+"&&a++,f.length===a+1?u=Yr(f[a++],i):f[a+1]==="."||f[a]==="."?(f[a]!=="."&&(o=Yr(f[a++],i)),a++,(a+1===f.length||f[a+1]==="("&&f[a+3]===")"||f[a+1]==="'"&&f[a+3]==="'")&&(u=Yr(f[a],i),s=mn**BigInt(f[a].length),a++),(f[a]==="("&&f[a+2]===")"||f[a]==="'"&&f[a+2]==="'")&&(l=Yr(f[a+1],i),c=mn**BigInt(f[a+1].length)-Me,a+=3)):f[a+1]==="/"||f[a+1]===":"?(u=Yr(f[a],i),s=Yr(f[a+2],Me),a+=3):f[a+3]==="/"&&f[a+1]===" "&&(o=Yr(f[a],i),u=Yr(f[a+2],i),s=Yr(f[a+4],Me),a+=5),f.length<=a)r=s*c,i=n=l+r*o+c*u;else throw Ni()}else if(typeof e=="bigint")n=e,i=e,r=Me;else throw Ni();if(r===ge)throw Mh();fe.s=i<ge?-Me:Me,fe.n=n<ge?-n:n,fe.d=r<ge?-r:r};function L3(e,t,n){let r=Me;for(;t>ge;e=e*e%n,t>>=Me)t&Me&&(r=r*e%n);return r}function j3(e,t){for(;t%jt===ge;t/=jt);for(;t%mo===ge;t/=mo);if(t===Me)return ge;let n=mn%t,r=1;for(;n!==Me;r++)if(n=n*mn%t,r>$3)return ge;return BigInt(r)}function H3(e,t,n){let r=Me,i=L3(mn,n,t);for(let a=0;a<300;a++){if(r===i)return BigInt(a);r=r*mn%t,i=i*mn%t}return 0}function ia(e,t){if(!e)return t;if(!t)return e;for(;;){if(e%=t,!e)return t;if(t%=e,!t)return e}}function Qn(e,t){if(Ht(e,t),this instanceof Qn)e=ia(fe.d,fe.n),this.s=fe.s,this.n=fe.n/e,this.d=fe.d/e;else return mt(fe.s*fe.n,fe.d)}const Mh=function(){return new Error("Division by Zero")},Ni=function(){return new Error("Invalid argument")},tb=function(){return new Error("Parameters must be integer")};Qn.prototype={s:Me,n:ge,d:Me,abs:function(){return mt(this.n,this.d)},neg:function(){return mt(-this.s*this.n,this.d)},add:function(e,t){return Ht(e,t),mt(this.s*this.n*fe.d+fe.s*this.d*fe.n,this.d*fe.d)},sub:function(e,t){return Ht(e,t),mt(this.s*this.n*fe.d-fe.s*this.d*fe.n,this.d*fe.d)},mul:function(e,t){return Ht(e,t),mt(this.s*fe.s*this.n*fe.n,this.d*fe.d)},div:function(e,t){return Ht(e,t),mt(this.s*fe.s*this.n*fe.d,this.d*fe.n)},clone:function(){return mt(this.s*this.n,this.d)},mod:function(e,t){if(e===void 0)return mt(this.s*this.n%this.d,Me);if(Ht(e,t),ge===fe.n*this.d)throw Mh();return mt(this.s*(fe.d*this.n)%(fe.n*this.d),fe.d*this.d)},gcd:function(e,t){return Ht(e,t),mt(ia(fe.n,this.n)*ia(fe.d,this.d),fe.d*this.d)},lcm:function(e,t){return Ht(e,t),fe.n===ge&&this.n===ge?mt(ge,Me):mt(fe.n*this.n,ia(fe.n,this.n)*ia(fe.d,this.d))},inverse:function(){return mt(this.s*this.d,this.n)},pow:function(e,t){if(Ht(e,t),fe.d===Me)return fe.s<ge?mt((this.s*this.d)**fe.n,this.n**fe.n):mt((this.s*this.n)**fe.n,this.d**fe.n);if(this.s<ge)return null;let n=po(this.n),r=po(this.d),i=Me,a=Me;for(let o in n)if(o!=="1"){if(o==="0"){i=ge;break}if(n[o]*=fe.n,n[o]%fe.d===ge)n[o]/=fe.d;else return null;i*=BigInt(o)**n[o]}for(let o in r)if(o!=="1"){if(r[o]*=fe.n,r[o]%fe.d===ge)r[o]/=fe.d;else return null;a*=BigInt(o)**r[o]}return fe.s<ge?mt(a,i):mt(i,a)},log:function(e,t){if(Ht(e,t),this.s<=ge||fe.s<=ge)return null;const n=Object.create(null),r=po(fe.n),i=po(fe.d),a=po(this.n),o=po(this.d);for(const s in i)r[s]=(r[s]||ge)-i[s];for(const s in o)a[s]=(a[s]||ge)-o[s];for(const s in r)s!=="1"&&(n[s]=!0);for(const s in a)s!=="1"&&(n[s]=!0);let u=null,l=null;for(const s in n){const c=r[s]||ge,f=a[s]||ge;if(c===ge){if(f!==ge)return null;continue}let d=f,h=c;const v=ia(d,h);if(d/=v,h/=v,u===null&&l===null)u=d,l=h;else if(d*l!==u*h)return null}return u!==null&&l!==null?mt(u,l):null},equals:function(e,t){return Ht(e,t),this.s*this.n*fe.d===fe.s*fe.n*this.d},lt:function(e,t){return Ht(e,t),this.s*this.n*fe.d<fe.s*fe.n*this.d},lte:function(e,t){return Ht(e,t),this.s*this.n*fe.d<=fe.s*fe.n*this.d},gt:function(e,t){return Ht(e,t),this.s*this.n*fe.d>fe.s*fe.n*this.d},gte:function(e,t){return Ht(e,t),this.s*this.n*fe.d>=fe.s*fe.n*this.d},compare:function(e,t){Ht(e,t);let n=this.s*this.n*fe.d-fe.s*fe.n*this.d;return(ge<n)-(n<ge)},ceil:function(e){return e=mn**BigInt(e||0),mt(ur(this.s*e*this.n/this.d)+(e*this.n%this.d>ge&&this.s>=ge?Me:ge),e)},floor:function(e){return e=mn**BigInt(e||0),mt(ur(this.s*e*this.n/this.d)-(e*this.n%this.d>ge&&this.s<ge?Me:ge),e)},round:function(e){return e=mn**BigInt(e||0),mt(ur(this.s*e*this.n/this.d)+this.s*((this.s>=ge?Me:ge)+jt*(e*this.n%this.d)>this.d?Me:ge),e)},roundTo:function(e,t){Ht(e,t);const n=this.n*fe.d,r=this.d*fe.n,i=n%r;let a=ur(n/r);return i+i>=r&&a++,mt(this.s*a*fe.n,fe.d)},divisible:function(e,t){return Ht(e,t),fe.n===ge?!1:this.n*fe.d%(fe.n*this.d)===ge},valueOf:function(){return Number(this.s*this.n)/Number(this.d)},toString:function(e=15){let t=this.n,n=this.d,r=j3(t,n),i=H3(t,n,r),a=this.s<ge?"-":"";if(a+=ur(t/n),t%=n,t*=mn,t&&(a+="."),r){for(let o=i;o--;)a+=ur(t/n),t%=n,t*=mn;a+="(";for(let o=r;o--;)a+=ur(t/n),t%=n,t*=mn;a+=")"}else for(let o=e;t&&o--;)a+=ur(t/n),t%=n,t*=mn;return a},toFraction:function(e=!1){let t=this.n,n=this.d,r=this.s<ge?"-":"";if(n===Me)r+=t;else{const i=ur(t/n);e&&i>ge&&(r+=i,r+=" ",t%=n),r+=t,r+="/",r+=n}return r},toLatex:function(e=!1){let t=this.n,n=this.d,r=this.s<ge?"-":"";if(n===Me)r+=t;else{const i=ur(t/n);e&&i>ge&&(r+=i,t%=n),r+="\\frac{",r+=t,r+="}{",r+=n,r+="}"}return r},toContinued:function(){let e=this.n,t=this.d;const n=[];for(;t;){n.push(ur(e/t));const r=e%t;e=t,t=r}return n},simplify:function(e=.001){const t=BigInt(Math.ceil(1/e)),n=this.abs(),r=n.toContinued();for(let i=1;i<r.length;i++){let a=mt(r[i-1],Me);for(let u=i-2;u>=0;u--)a=a.inverse().add(r[u]);let o=a.sub(n);if(o.n*t<o.d)return a.mul(this.s)}return this}};var P3="Fraction",q3=[],V3=se(P3,q3,()=>(Object.defineProperty(Qn,"name",{value:"Fraction"}),Qn.prototype.constructor=Qn,Qn.prototype.type="Fraction",Qn.prototype.isFraction=!0,Qn.prototype.toJSON=function(){return{mathjs:"Fraction",n:String(this.s*this.n),d:String(this.d)}},Qn.fromJSON=function(e){return new Qn(e)},Qn),{isClass:!0}),G3="Matrix",Y3=[],X3=se(G3,Y3,()=>{function e(){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator")}return e.prototype.type="Matrix",e.prototype.isMatrix=!0,e.prototype.storage=function(){throw new Error("Cannot invoke storage on a Matrix interface")},e.prototype.datatype=function(){throw new Error("Cannot invoke datatype on a Matrix interface")},e.prototype.create=function(t,n){throw new Error("Cannot invoke create on a Matrix interface")},e.prototype.subset=function(t,n,r){throw new Error("Cannot invoke subset on a Matrix interface")},e.prototype.get=function(t){throw new Error("Cannot invoke get on a Matrix interface")},e.prototype.set=function(t,n,r){throw new Error("Cannot invoke set on a Matrix interface")},e.prototype.resize=function(t,n){throw new Error("Cannot invoke resize on a Matrix interface")},e.prototype.reshape=function(t,n){throw new Error("Cannot invoke reshape on a Matrix interface")},e.prototype.clone=function(){throw new Error("Cannot invoke clone on a Matrix interface")},e.prototype.size=function(){throw new Error("Cannot invoke size on a Matrix interface")},e.prototype.map=function(t,n){throw new Error("Cannot invoke map on a Matrix interface")},e.prototype.forEach=function(t){throw new Error("Cannot invoke forEach on a Matrix interface")},e.prototype[Symbol.iterator]=function(){throw new Error("Cannot iterate a Matrix interface")},e.prototype.toArray=function(){throw new Error("Cannot invoke toArray on a Matrix interface")},e.prototype.valueOf=function(){throw new Error("Cannot invoke valueOf on a Matrix interface")},e.prototype.format=function(t){throw new Error("Cannot invoke format on a Matrix interface")},e.prototype.toString=function(){throw new Error("Cannot invoke toString on a Matrix interface")},e},{isClass:!0});function _h(e,t,n){var r=e.constructor,i=new r(2),a="";if(n){if(n<1)throw new Error("size must be in greater than 0");if(!it(n))throw new Error("size must be an integer");if(e.greaterThan(i.pow(n-1).sub(1))||e.lessThan(i.pow(n-1).mul(-1)))throw new Error("Value must be in range [-2^".concat(n-1,", 2^").concat(n-1,"-1]"));if(!e.isInteger())throw new Error("Value must be an integer");e.lessThan(0)&&(e=e.add(i.pow(n))),a="i".concat(n)}switch(t){case 2:return"".concat(e.toBinary()).concat(a);case 8:return"".concat(e.toOctal()).concat(a);case 16:return"".concat(e.toHexadecimal()).concat(a);default:throw new Error("Base ".concat(t," not supported "))}}function Z3(e,t){if(typeof t=="function")return t(e);if(!e.isFinite())return e.isNaN()?"NaN":e.gt(0)?"Infinity":"-Infinity";var{notation:n,precision:r,wordSize:i}=Uy(t);switch(n){case"fixed":return K3(e,r);case"exponential":return nb(e,r);case"engineering":return Q3(e,r);case"bin":return _h(e,2,i);case"oct":return _h(e,8,i);case"hex":return _h(e,16,i);case"auto":{var a=rb(t?.lowerExp,-3),o=rb(t?.upperExp,5);if(e.isZero())return"0";var u,l=e.toSignificantDigits(r),s=l.e;return s>=a&&s<o?u=l.toFixed():u=nb(e,r),u.replace(/((\.\d*?)(0+))($|e)/,function(){var c=arguments[2],f=arguments[4];return c!=="."?c+f:f})}default:throw new Error('Unknown notation "'+n+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function Q3(e,t){var n=e.e,r=n%3===0?n:n<0?n-3-n%3:n-n%3,i=e.mul(Math.pow(10,-r)),a=i.toPrecision(t);if(a.includes("e")){var o=e.constructor;a=new o(a).toFixed()}return a+"e"+(n>=0?"+":"")+r.toString()}function nb(e,t){return t!==void 0?e.toExponential(t-1):e.toExponential()}function K3(e,t){return e.toFixed(t)}function rb(e,t){return et(e)?e:vt(e)?e.toNumber():t}function lt(e,t){var n=W3(e,t);return t&&typeof t=="object"&&"truncate"in t&&n.length>t.truncate?n.substring(0,t.truncate-3)+"...":n}function W3(e,t){if(typeof e=="number")return Dh(e,t);if(vt(e))return Z3(e,t);if(J3(e))return!t||t.fraction!=="decimal"?"".concat(e.s*e.n,"/").concat(e.d):e.toString();if(Array.isArray(e))return ob(e,t);if(ar(e))return ib(e);if(typeof e=="function")return e.syntax?String(e.syntax):"function";if(e&&typeof e=="object"){if(typeof e.format=="function")return e.format(t);if(e&&e.toString(t)!=={}.toString())return e.toString(t);var n=Object.keys(e).map(r=>ib(r)+": "+lt(e[r],t));return"{"+n.join(", ")+"}"}return String(e)}function ib(e){for(var t=String(e),n="",r=0;r<t.length;){var i=t.charAt(r);n+=i in ab?ab[i]:i,r++}return'"'+n+'"'}var ab={'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"};function ob(e,t){if(Array.isArray(e)){for(var n="[",r=e.length,i=0;i<r;i++)i!==0&&(n+=", "),n+=ob(e[i],t);return n+="]",n}else return lt(e,t)}function J3(e){return e&&typeof e=="object"&&typeof e.s=="bigint"&&typeof e.n=="bigint"&&typeof e.d=="bigint"||!1}function Le(e,t,n){if(!(this instanceof Le))throw new SyntaxError("Constructor must be called with the new operator");this.actual=e,this.expected=t,this.relation=n,this.message="Dimension mismatch ("+(Array.isArray(e)?"["+e.join(", ")+"]":e)+" "+(this.relation||"!=")+" "+(Array.isArray(t)?"["+t.join(", ")+"]":t)+")",this.stack=new Error().stack}Le.prototype=new RangeError,Le.prototype.constructor=RangeError,Le.prototype.name="DimensionError",Le.prototype.isDimensionError=!0;function Ri(e,t,n){if(!(this instanceof Ri))throw new SyntaxError("Constructor must be called with the new operator");this.index=e,arguments.length<3?(this.min=0,this.max=t):(this.min=t,this.max=n),this.min!==void 0&&this.index<this.min?this.message="Index out of range ("+this.index+" < "+this.min+")":this.max!==void 0&&this.index>=this.max?this.message="Index out of range ("+this.index+" > "+(this.max-1)+")":this.message="Index out of range ("+this.index+")",this.stack=new Error().stack}Ri.prototype=new RangeError,Ri.prototype.constructor=RangeError,Ri.prototype.name="IndexError",Ri.prototype.isIndexError=!0;function st(e){for(var t=[];Array.isArray(e);)t.push(e.length),e=e[0];return t}function ub(e,t,n){var r,i=e.length;if(i!==t[n])throw new Le(i,t[n]);if(n<t.length-1){var a=n+1;for(r=0;r<i;r++){var o=e[r];if(!Array.isArray(o))throw new Le(t.length-1,t.length,"<");ub(e[r],t,a)}}else for(r=0;r<i;r++)if(Array.isArray(e[r]))throw new Le(t.length+1,t.length,">")}function lb(e,t){var n=t.length===0;if(n){if(Array.isArray(e))throw new Le(e.length,0)}else ub(e,t,0)}function yt(e,t){if(e!==void 0){if(!et(e)||!it(e))throw new TypeError("Index must be an integer (value: "+e+")");if(e<0||typeof t=="number"&&e>=t)throw new Ri(e,t)}}function ac(e,t,n){if(!Array.isArray(t))throw new TypeError("Array expected");if(t.length===0)throw new Error("Resizing to scalar is not supported");t.forEach(function(i){if(!et(i)||!it(i)||i<0)throw new TypeError("Invalid size, must contain positive integers (size: "+lt(t)+")")}),(et(e)||vt(e))&&(e=[e]);var r=n!==void 0?n:0;return Bh(e,t,0,r),e}function Bh(e,t,n,r){var i,a,o=e.length,u=t[n],l=Math.min(o,u);if(e.length=u,n<t.length-1){var s=n+1;for(i=0;i<l;i++)a=e[i],Array.isArray(a)||(a=[a],e[i]=a),Bh(a,t,s,r);for(i=l;i<u;i++)a=[],e[i]=a,Bh(a,t,s,r)}else{for(i=0;i<l;i++)for(;Array.isArray(e[i]);)e[i]=e[i][0];for(i=l;i<u;i++)e[i]=r}}function Fh(e,t){var n=Rh(e,!0),r=n.length;if(!Array.isArray(e)||!Array.isArray(t))throw new TypeError("Array expected");if(t.length===0)throw new Le(0,r,"!=");t=Nh(t,r);var i=sb(t);if(r!==i)throw new Le(i,r,"!=");try{return eT(n,t)}catch(a){throw a instanceof Le?new Le(i,r,"!="):a}}function Nh(e,t){var n=sb(e),r=e.slice(),i=-1,a=e.indexOf(i),o=e.indexOf(i,a+1)>=0;if(o)throw new Error("More than one wildcard in sizes");var u=a>=0,l=t%n===0;if(u)if(l)r[a]=-t/n;else throw new Error("Could not replace wildcard, since "+t+" is no multiple of "+-n);return r}function sb(e){return e.reduce((t,n)=>t*n,1)}function eT(e,t){for(var n=e,r,i=t.length-1;i>0;i--){var a=t[i];r=[];for(var o=n.length/a,u=0;u<o;u++)r.push(n.slice(u*a,(u+1)*a));n=r}return n}function cb(e,t,n,r){var i=r||st(e);if(n)for(var a=0;a<n;a++)e=[e],i.unshift(1);for(e=fb(e,t,0);i.length<t;)i.push(1);return e}function fb(e,t,n){var r,i;if(Array.isArray(e)){var a=n+1;for(r=0,i=e.length;r<i;r++)e[r]=fb(e[r],t,a)}else for(var o=n;o<t;o++)e=[e];return e}function Rh(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(!Array.isArray(e))return e;if(typeof t!="boolean")throw new TypeError("Boolean expected for second argument of flatten");var n=[];return t?i(e):r(e),n;function r(a){for(var o=0;o<a.length;o++){var u=a[o];Array.isArray(u)?r(u):n.push(u)}}function i(a){if(Array.isArray(a[0]))for(var o=0;o<a.length;o++)i(a[o]);else for(var u=0;u<a.length;u++)n.push(a[u])}}function oc(e,t){for(var n,r=0,i=0;i<e.length;i++){var a=e[i],o=Array.isArray(a);if(i===0&&o&&(r=a.length),o&&a.length!==r)return;var u=o?oc(a,t):t(a);if(n===void 0)n=u;else if(n!==u)return"mixed"}return n}function db(e,t,n,r){if(r<n){if(e.length!==t.length)throw new Le(e.length,t.length);for(var i=[],a=0;a<e.length;a++)i[a]=db(e[a],t[a],n,r+1);return i}else return e.concat(t)}function hb(){var e=Array.prototype.slice.call(arguments,0,-1),t=Array.prototype.slice.call(arguments,-1);if(e.length===1)return e[0];if(e.length>1)return e.slice(1).reduce(function(n,r){return db(n,r,t,0)},e[0]);throw new Error("Wrong number of arguments in function concat")}function mb(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var r=t.map(d=>d.length),i=Math.max(...r),a=new Array(i).fill(null),o=0;o<t.length;o++)for(var u=t[o],l=r[o],s=0;s<l;s++){var c=i-l+s;u[s]>a[c]&&(a[c]=u[s])}for(var f=0;f<t.length;f++)pb(t[f],a);return a}function pb(e,t){for(var n=t.length,r=e.length,i=0;i<r;i++){var a=n-r+i;if(e[i]<t[a]&&e[i]>1||e[i]>t[a])throw new Error("shape mismatch: mismatch is found in arg with shape (".concat(e,") not possible to broadcast dimension ").concat(r," with size ").concat(e[i]," to size ").concat(t[a]))}}function Oh(e,t){var n=st(e);if(Ti(n,t))return e;pb(n,t);var r=mb(n,t),i=r.length,a=[...Array(i-n.length).fill(1),...n],o=rT(e);n.length<i&&(o=Fh(o,a),n=st(o));for(var u=0;u<i;u++)n[u]<r[u]&&(o=tT(o,r[u],u),n=st(o));return o}function tT(e,t,n){return hb(...Array(t).fill(e),n)}function gb(e,t){if(!Array.isArray(e))throw new Error("Array expected");var n=st(e);if(t.length!==n.length)throw new Le(t.length,n.length);for(var r=0;r<t.length;r++)yt(t[r],n[r]);return t.reduce((i,a)=>i[a],e)}function vb(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(e.length===0)return[];if(n)return a(e);var r=[];return i(e,0);function i(o,u){if(Array.isArray(o)){for(var l=o.length,s=Array(l),c=0;c<l;c++)r[u]=c,s[c]=i(o[c],u+1);return s}else return t(o,r.slice(0,u),e)}function a(o){if(Array.isArray(o)){for(var u=o.length,l=Array(u),s=0;s<u;s++)l[s]=a(o[s]);return l}else return t(o)}}function nT(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(e.length===0)return;if(n){a(e);return}var r=[];i(e,0);function i(o,u){if(Array.isArray(o))for(var l=o.length,s=0;s<l;s++)r[u]=s,i(o[s],u+1);else t(o,r.slice(0,u),e)}function a(o){if(Array.isArray(o))for(var u=o.length,l=0;l<u;l++)a(o[l]);else t(o)}}function rT(e){return Ci([],e)}function uc(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(Vs.isTypedFunction(e)){var i;if(r)i=1;else{var a=(t.isMatrix?t.size():st(t)).map(()=>0),o=t.isMatrix?t.get(a):gb(t,a);i=oT(e,o,a,t)}var u;if(t.isMatrix&&t.dataType!=="mixed"&&t.dataType!==void 0){var l=iT(e,i);u=l!==void 0?l:e}else u=e;return i>=1&&i<=3?{isUnary:i===1,fn:function(){for(var c=arguments.length,f=new Array(c),d=0;d<c;d++)f[d]=arguments[d];return yb(u,f.slice(0,i),n,e.name)}}:{isUnary:!1,fn:function(){for(var c=arguments.length,f=new Array(c),d=0;d<c;d++)f[d]=arguments[d];return yb(u,f,n,e.name)}}}return r===void 0?{isUnary:aT(e),fn:e}:{isUnary:r,fn:e}}function iT(e,t){var n=[];if(Object.entries(e.signatures).forEach(r=>{var[i,a]=r;i.split(",").length===t&&n.push(a)}),n.length===1)return n[0]}function aT(e){if(e.length!==1)return!1;var t=e.toString();if(/arguments/.test(t))return!1;var n=t.match(/\(.*?\)/);return!/\.\.\./.test(n)}function oT(e,t,n,r){for(var i=[t,n,r],a=3;a>0;a--){var o=i.slice(0,a);if(Vs.resolve(e,o)!==null)return a}}function yb(e,t,n,r){try{return e(...t)}catch(i){uT(i,t,n,r)}}function uT(e,t,n,r){var i;if(e instanceof TypeError&&((i=e.data)===null||i===void 0?void 0:i.category)==="wrongType"){var a=[];throw a.push("value: ".concat(Fn(t[0]))),t.length>=2&&a.push("index: ".concat(Fn(t[1]))),t.length>=3&&a.push("array: ".concat(Fn(t[2]))),new TypeError("Function ".concat(n," cannot apply callback arguments ")+"".concat(r,"(").concat(a.join(", "),") at index ").concat(JSON.stringify(t[1])))}else throw new TypeError("Function ".concat(n," cannot apply callback arguments ")+"to function ".concat(r,": ").concat(e.message))}var lT="DenseMatrix",sT=["Matrix"],cT=se(lT,sT,e=>{var{Matrix:t}=e;function n(c,f){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(f&&!ar(f))throw new Error("Invalid datatype: "+f);if(Pe(c))c.type==="DenseMatrix"?(this._data=Ie(c._data),this._size=Ie(c._size),this._datatype=f||c._datatype):(this._data=c.toArray(),this._size=c.size(),this._datatype=f||c._datatype);else if(c&&ht(c.data)&&ht(c.size))this._data=c.data,this._size=c.size,lb(this._data,this._size),this._datatype=f||c.datatype;else if(ht(c))this._data=s(c),this._size=st(this._data),lb(this._data,this._size),this._datatype=f;else{if(c)throw new TypeError("Unsupported type of data ("+Fn(c)+")");this._data=[],this._size=[0],this._datatype=f}}n.prototype=new t,n.prototype.createDenseMatrix=function(c,f){return new n(c,f)},Object.defineProperty(n,"name",{value:"DenseMatrix"}),n.prototype.constructor=n,n.prototype.type="DenseMatrix",n.prototype.isDenseMatrix=!0,n.prototype.getDataType=function(){return oc(this._data,Fn)},n.prototype.storage=function(){return"dense"},n.prototype.datatype=function(){return this._datatype},n.prototype.create=function(c,f){return new n(c,f)},n.prototype.subset=function(c,f,d){switch(arguments.length){case 1:return r(this,c);case 2:case 3:return a(this,c,f,d);default:throw new SyntaxError("Wrong number of arguments")}},n.prototype.get=function(c){return gb(this._data,c)},n.prototype.set=function(c,f,d){if(!ht(c))throw new TypeError("Array expected");if(c.length<this._size.length)throw new Le(c.length,this._size.length,"<");var h,v,m,D=c.map(function(g){return g+1});l(this,D,d);var p=this._data;for(h=0,v=c.length-1;h<v;h++)m=c[h],yt(m,p.length),p=p[m];return m=c[c.length-1],yt(m,p.length),p[m]=f,this};function r(c,f){if(!vh(f))throw new TypeError("Invalid index");var d=f.isScalar();if(d)return c.get(f.min());var h=f.size();if(h.length!==c._size.length)throw new Le(h.length,c._size.length);for(var v=f.min(),m=f.max(),D=0,p=c._size.length;D<p;D++)yt(v[D],c._size[D]),yt(m[D],c._size[D]);var g=new n([]),y=i(c._data,f);return g._size=y.size,g._datatype=c._datatype,g._data=y.data,g}function i(c,f){var d=f.size().length-1,h=Array(d);return{data:v(c),size:h};function v(m){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,p=f.dimension(D);return h[D]=p.size()[0],D<d?p.map(g=>(yt(g,m.length),v(m[g],D+1))).valueOf():p.map(g=>(yt(g,m.length),m[g])).valueOf()}}function a(c,f,d,h){if(!f||f.isIndex!==!0)throw new TypeError("Invalid index");var v=f.size(),m=f.isScalar(),D;if(Pe(d)?(D=d.size(),d=d.valueOf()):D=st(d),m){if(D.length!==0)throw new TypeError("Scalar expected");c.set(f.min(),d,h)}else{if(!Ti(D,v))try{D.length===0?d=Oh([d],v):d=Oh(d,v),D=st(d)}catch{}if(v.length<c._size.length)throw new Le(v.length,c._size.length,"<");if(D.length<v.length){for(var p=0,g=0;v[p]===1&&D[p]===1;)p++;for(;v[p]===1;)g++,p++;d=cb(d,v.length,g,D)}if(!Ti(v,D))throw new Le(v,D,">");var y=f.max().map(function(S){return S+1});l(c,y,h),o(c._data,f,d)}return c}function o(c,f,d){var h=f.size().length-1;v(c,d);function v(m,D){var p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,g=f.dimension(p);p<h?g.forEach((y,S)=>{yt(y,m.length),v(m[y],D[S[0]],p+1)}):g.forEach((y,S)=>{yt(y,m.length),m[y]=D[S[0]]})}}n.prototype.resize=function(c,f,d){if(!Lu(c))throw new TypeError("Array or Matrix expected");var h=c.valueOf().map(m=>Array.isArray(m)&&m.length===1?m[0]:m),v=d?this.clone():this;return u(v,h,f)};function u(c,f,d){if(f.length===0){for(var h=c._data;ht(h);)h=h[0];return h}return c._size=f.slice(0),c._data=ac(c._data,c._size,d),c}n.prototype.reshape=function(c,f){var d=f?this.clone():this;d._data=Fh(d._data,c);var h=d._size.reduce((v,m)=>v*m);return d._size=Nh(c,h),d};function l(c,f,d){for(var h=c._size.slice(0),v=!1;h.length<f.length;)h.push(0),v=!0;for(var m=0,D=f.length;m<D;m++)f[m]>h[m]&&(h[m]=f[m],v=!0);v&&u(c,h,d)}n.prototype.clone=function(){var c=new n({data:Ie(this._data),size:Ie(this._size),datatype:this._datatype});return c},n.prototype.size=function(){return this._size.slice(0)},n.prototype.map=function(c){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,d=this,h=d._size.length-1;if(h<0)return d.clone();var v=uc(c,d,"map",f),m=v.fn,D=d.create(void 0,d._datatype);if(D._size=d._size,f||v.isUnary)return D._data=b(d._data),D;if(h===0){for(var p=d.valueOf(),g=Array(p.length),y=0;y<p.length;y++)g[y]=m(p[y],[y],d);return D._data=g,D}var S=[];return D._data=w(d._data),D;function w(E){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,A=Array(E.length);if(C<h)for(var T=0;T<E.length;T++)S[C]=T,A[T]=w(E[T],C+1);else for(var _=0;_<E.length;_++)S[C]=_,A[_]=m(E[_],S.slice(),d);return A}function b(E){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,A=Array(E.length);if(C<h)for(var T=0;T<E.length;T++)A[T]=b(E[T],C+1);else for(var _=0;_<E.length;_++)A[_]=m(E[_]);return A}},n.prototype.forEach=function(c){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,d=this,h=d._size.length-1;if(h<0)return;var v=uc(c,d,"map",f),m=v.fn;if(f||v.isUnary){y(d._data);return}if(h===0){for(var D=0;D<d._data.length;D++)m(d._data[D],[D],d);return}var p=[];g(d._data);function g(S){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(w<h)for(var b=0;b<S.length;b++)p[w]=b,g(S[b],w+1);else for(var E=0;E<S.length;E++)p[w]=E,m(S[E],p.slice(),d)}function y(S){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(w<h)for(var b=0;b<S.length;b++)y(S[b],w+1);else for(var E=0;E<S.length;E++)m(S[E])}},n.prototype[Symbol.iterator]=function*(){var c=this._size.length-1;if(!(c<0)){if(c===0){for(var f=0;f<this._data.length;f++)yield{value:this._data[f],index:[f]};return}for(var d=Array(c+1).fill(0),h=this._size.reduce((g,y)=>g*y,1),v=0;v<h;v++){for(var m=this._data,D=0;D<c;D++)m=m[d[D]];yield{value:m[d[c]],index:d.slice()};for(var p=c;p>=0&&(d[p]++,!(d[p]<this._size[p]));p--)d[p]=0}}},n.prototype.rows=function(){var c=[],f=this.size();if(f.length!==2)throw new TypeError("Rows can only be returned for a 2D matrix.");var d=this._data;for(var h of d)c.push(new n([h],this._datatype));return c},n.prototype.columns=function(){var c=this,f=[],d=this.size();if(d.length!==2)throw new TypeError("Rows can only be returned for a 2D matrix.");for(var h=this._data,v=function(p){var g=h.map(y=>[y[p]]);f.push(new n(g,c._datatype))},m=0;m<d[1];m++)v(m);return f},n.prototype.toArray=function(){return Ie(this._data)},n.prototype.valueOf=function(){return this._data},n.prototype.format=function(c){return lt(this._data,c)},n.prototype.toString=function(){return lt(this._data)},n.prototype.toJSON=function(){return{mathjs:"DenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},n.prototype.diagonal=function(c){if(c){if(vt(c)&&(c=c.toNumber()),!et(c)||!it(c))throw new TypeError("The parameter k must be an integer number")}else c=0;for(var f=c>0?c:0,d=c<0?-c:0,h=this._size[0],v=this._size[1],m=Math.min(h-d,v-f),D=[],p=0;p<m;p++)D[p]=this._data[p+d][p+f];return new n({data:D,size:[m],datatype:this._datatype})},n.diagonal=function(c,f,d,h){if(!ht(c))throw new TypeError("Array expected, size parameter");if(c.length!==2)throw new Error("Only two dimensions matrix are supported");if(c=c.map(function(E){if(vt(E)&&(E=E.toNumber()),!et(E)||!it(E)||E<1)throw new Error("Size values must be positive integers");return E}),d){if(vt(d)&&(d=d.toNumber()),!et(d)||!it(d))throw new TypeError("The parameter k must be an integer number")}else d=0;var v=d>0?d:0,m=d<0?-d:0,D=c[0],p=c[1],g=Math.min(D-m,p-v),y;if(ht(f)){if(f.length!==g)throw new Error("Invalid value array length");y=function(C){return f[C]}}else if(Pe(f)){var S=f.size();if(S.length!==1||S[0]!==g)throw new Error("Invalid matrix length");y=function(C){return f.get([C])}}else y=function(){return f};h||(h=vt(y(0))?y(0).mul(0):0);var w=[];if(c.length>0){w=ac(w,c,h);for(var b=0;b<g;b++)w[b+m][b+v]=y(b)}return new n({data:w,size:[D,p]})},n.fromJSON=function(c){return new n(c)},n.prototype.swapRows=function(c,f){if(!et(c)||!it(c)||!et(f)||!it(f))throw new Error("Row index must be positive integers");if(this._size.length!==2)throw new Error("Only two dimensional matrix is supported");return yt(c,this._size[0]),yt(f,this._size[0]),n._swapRows(c,f,this._data),this},n._swapRows=function(c,f,d){var h=d[c];d[c]=d[f],d[f]=h};function s(c){return Pe(c)?s(c.valueOf()):ht(c)?c.map(s):c}return n},{isClass:!0});function fT(e){var t=e.length,n=e[0].length,r,i,a=[];for(i=0;i<n;i++){var o=[];for(r=0;r<t;r++)o.push(e[r][i]);a.push(o)}return a}function bb(e){for(var t=0;t<e.length;t++)if(Lu(e[t]))return!0;return!1}function Db(e,t){Pe(e)?e.forEach(n=>t(n),!1,!0):nT(e,t,!0)}function pn(e,t,n){if(!n)return Pe(e)?e.map(i=>t(i),!1,!0):vb(e,t,!0);var r=i=>i===0?i:t(i);return Pe(e)?e.map(i=>r(i),!1,!0):vb(e,r,!0)}function Sb(e,t,n){var r=Array.isArray(e)?st(e):e.size();if(t<0||t>=r.length)throw new Ri(t,r.length);return Pe(e)?e.create(lc(e.valueOf(),t,n),e.datatype()):lc(e,t,n)}function lc(e,t,n){var r,i,a,o;if(t<=0)if(Array.isArray(e[0])){for(o=fT(e),i=[],r=0;r<o.length;r++)i[r]=lc(o[r],t-1,n);return i}else{for(a=e[0],r=1;r<e.length;r++)a=n(a,e[r]);return a}else{for(i=[],r=0;r<e.length;r++)i[r]=lc(e[r],t-1,n);return i}}var xb="isInteger",dT=["typed"],hT=se(xb,dT,e=>{var{typed:t}=e;return t(xb,{number:it,BigNumber:function(r){return r.isInt()},bigint:function(r){return!0},Fraction:function(r){return r.d===1n},"Array | Matrix":t.referToSelf(n=>r=>pn(r,n))})}),zh="number",sc="number, number";function wb(e){return Math.abs(e)}wb.signature=zh;function Eb(e,t){return e+t}Eb.signature=sc;function Ab(e,t){return e-t}Ab.signature=sc;function Cb(e,t){return e*t}Cb.signature=sc;function Tb(e){return-e}Tb.signature=zh;function Uh(e){return _C(e)}Uh.signature=zh;function Mb(e,t){return e*e<1&&t===1/0||e*e>1&&t===-1/0?0:Math.pow(e,t)}Mb.signature=sc;var _b="number";function Bb(e){return e>0}Bb.signature=_b;function Fb(e){return Number.isNaN(e)}Fb.signature=_b;function go(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1e-9,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;if(n<=0)throw new Error("Relative tolerance must be greater than 0");if(r<0)throw new Error("Absolute tolerance must be at least 0");return e.isNaN()||t.isNaN()?!1:!e.isFinite()||!t.isFinite()?e.eq(t):e.eq(t)?!0:e.minus(t).abs().lte(e.constructor.max(e.constructor.max(e.abs(),t.abs()).mul(n),r))}var Nb="isPositive",mT=["typed","config"],pT=se(Nb,mT,e=>{var{typed:t,config:n}=e;return t(Nb,{number:r=>Vr(r,0,n.relTol,n.absTol)?!1:Bb(r),BigNumber:r=>go(r,new r.constructor(0),n.relTol,n.absTol)?!1:!r.isNeg()&&!r.isZero()&&!r.isNaN(),bigint:r=>r>0n,Fraction:r=>r.s>0n&&r.n>0n,Unit:t.referToSelf(r=>i=>t.find(r,i.valueType())(i.value)),"Array | Matrix":t.referToSelf(r=>i=>pn(i,r))})}),Rb="isZero",gT=["typed","equalScalar"],vT=se(Rb,gT,e=>{var{typed:t,equalScalar:n}=e;return t(Rb,{"number | BigNumber | Complex | Fraction":r=>n(r,0),bigint:r=>r===0n,Unit:t.referToSelf(r=>i=>t.find(r,i.valueType())(i.value)),"Array | Matrix":t.referToSelf(r=>i=>pn(i,r))})}),Ob="isNaN",yT=["typed"],bT=se(Ob,yT,e=>{var{typed:t}=e;return t(Ob,{number:Fb,BigNumber:function(r){return r.isNaN()},bigint:function(r){return!1},Fraction:function(r){return!1},Complex:function(r){return r.isNaN()},Unit:function(r){return Number.isNaN(r.value)},"Array | Matrix":t.referToSelf(n=>r=>pn(r,n))})});function DT(e,t,n,r){return Vr(e.re,t.re,n,r)&&Vr(e.im,t.im,n,r)}var qu=se("compareUnits",["typed"],e=>{var{typed:t}=e;return{"Unit, Unit":t.referToSelf(n=>(r,i)=>{if(!r.equalBase(i))throw new Error("Cannot compare units with different base");return t.find(n,[r.valueType(),i.valueType()])(r.value,i.value)})}}),cc="equalScalar",ST=["typed","config"],xT=se(cc,ST,e=>{var{typed:t,config:n}=e,r=qu({typed:t});return t(cc,{"boolean, boolean":function(a,o){return a===o},"number, number":function(a,o){return Vr(a,o,n.relTol,n.absTol)},"BigNumber, BigNumber":function(a,o){return a.eq(o)||go(a,o,n.relTol,n.absTol)},"bigint, bigint":function(a,o){return a===o},"Fraction, Fraction":function(a,o){return a.equals(o)},"Complex, Complex":function(a,o){return DT(a,o,n.relTol,n.absTol)}},r)});se(cc,["typed","config"],e=>{var{typed:t,config:n}=e;return t(cc,{"number, number":function(i,a){return Vr(i,a,n.relTol,n.absTol)}})});var wT="SparseMatrix",ET=["typed","equalScalar","Matrix"],AT=se(wT,ET,e=>{var{typed:t,equalScalar:n,Matrix:r}=e;function i(m,D){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");if(D&&!ar(D))throw new Error("Invalid datatype: "+D);if(Pe(m))a(this,m,D);else if(m&&ht(m.index)&&ht(m.ptr)&&ht(m.size))this._values=m.values,this._index=m.index,this._ptr=m.ptr,this._size=m.size,this._datatype=D||m.datatype;else if(ht(m))o(this,m,D);else{if(m)throw new TypeError("Unsupported type of data ("+Fn(m)+")");this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=D}}function a(m,D,p){D.type==="SparseMatrix"?(m._values=D._values?Ie(D._values):void 0,m._index=Ie(D._index),m._ptr=Ie(D._ptr),m._size=Ie(D._size),m._datatype=p||D._datatype):o(m,D.valueOf(),p||D._datatype)}function o(m,D,p){m._values=[],m._index=[],m._ptr=[],m._datatype=p;var g=D.length,y=0,S=n,w=0;if(ar(p)&&(S=t.find(n,[p,p])||n,w=t.convert(0,p)),g>0){var b=0;do{m._ptr.push(m._index.length);for(var E=0;E<g;E++){var C=D[E];if(ht(C)){if(b===0&&y<C.length&&(y=C.length),b<C.length){var A=C[b];S(A,w)||(m._values.push(A),m._index.push(E))}}else b===0&&y<1&&(y=1),S(C,w)||(m._values.push(C),m._index.push(E))}b++}while(b<y)}m._ptr.push(m._index.length),m._size=[g,y]}i.prototype=new r,i.prototype.createSparseMatrix=function(m,D){return new i(m,D)},Object.defineProperty(i,"name",{value:"SparseMatrix"}),i.prototype.constructor=i,i.prototype.type="SparseMatrix",i.prototype.isSparseMatrix=!0,i.prototype.getDataType=function(){return oc(this._values,Fn)},i.prototype.storage=function(){return"sparse"},i.prototype.datatype=function(){return this._datatype},i.prototype.create=function(m,D){return new i(m,D)},i.prototype.density=function(){var m=this._size[0],D=this._size[1];return m!==0&&D!==0?this._index.length/(m*D):0},i.prototype.subset=function(m,D,p){if(!this._values)throw new Error("Cannot invoke subset on a Pattern only matrix");switch(arguments.length){case 1:return u(this,m);case 2:case 3:return l(this,m,D,p);default:throw new SyntaxError("Wrong number of arguments")}};function u(m,D){if(!vh(D))throw new TypeError("Invalid index");var p=D.isScalar();if(p)return m.get(D.min());var g=D.size();if(g.length!==m._size.length)throw new Le(g.length,m._size.length);var y,S,w,b,E=D.min(),C=D.max();for(y=0,S=m._size.length;y<S;y++)yt(E[y],m._size[y]),yt(C[y],m._size[y]);var A=m._values,T=m._index,_=m._ptr,x=D.dimension(0),F=D.dimension(1),R=[],z=[];x.forEach(function(L,G){z[L]=G[0],R[L]=!0});var N=A?[]:void 0,U=[],I=[];return F.forEach(function(L){for(I.push(U.length),w=_[L],b=_[L+1];w<b;w++)y=T[w],R[y]===!0&&(U.push(z[y]),N&&N.push(A[w]))}),I.push(U.length),new i({values:N,index:U,ptr:I,size:g,datatype:m._datatype})}function l(m,D,p,g){if(!D||D.isIndex!==!0)throw new TypeError("Invalid index");var y=D.size(),S=D.isScalar(),w;if(Pe(p)?(w=p.size(),p=p.toArray()):w=st(p),S){if(w.length!==0)throw new TypeError("Scalar expected");m.set(D.min(),p,g)}else{if(y.length!==1&&y.length!==2)throw new Le(y.length,m._size.length,"<");if(w.length<y.length){for(var b=0,E=0;y[b]===1&&w[b]===1;)b++;for(;y[b]===1;)E++,b++;p=cb(p,y.length,E,w)}if(!Ti(y,w))throw new Le(y,w,">");if(y.length===1){var C=D.dimension(0);C.forEach(function(_,x){yt(_),m.set([_,0],p[x[0]],g)})}else{var A=D.dimension(0),T=D.dimension(1);A.forEach(function(_,x){yt(_),T.forEach(function(F,R){yt(F),m.set([_,F],p[x[0]][R[0]],g)})})}}return m}i.prototype.get=function(m){if(!ht(m))throw new TypeError("Array expected");if(m.length!==this._size.length)throw new Le(m.length,this._size.length);if(!this._values)throw new Error("Cannot invoke get on a Pattern only matrix");var D=m[0],p=m[1];yt(D,this._size[0]),yt(p,this._size[1]);var g=s(D,this._ptr[p],this._ptr[p+1],this._index);return g<this._ptr[p+1]&&this._index[g]===D?this._values[g]:0},i.prototype.set=function(m,D,p){if(!ht(m))throw new TypeError("Array expected");if(m.length!==this._size.length)throw new Le(m.length,this._size.length);if(!this._values)throw new Error("Cannot invoke set on a Pattern only matrix");var g=m[0],y=m[1],S=this._size[0],w=this._size[1],b=n,E=0;ar(this._datatype)&&(b=t.find(n,[this._datatype,this._datatype])||n,E=t.convert(0,this._datatype)),(g>S-1||y>w-1)&&(d(this,Math.max(g+1,S),Math.max(y+1,w),p),S=this._size[0],w=this._size[1]),yt(g,S),yt(y,w);var C=s(g,this._ptr[y],this._ptr[y+1],this._index);return C<this._ptr[y+1]&&this._index[C]===g?b(D,E)?c(C,y,this._values,this._index,this._ptr):this._values[C]=D:b(D,E)||f(C,g,y,D,this._values,this._index,this._ptr),this};function s(m,D,p,g){if(p-D===0)return p;for(var y=D;y<p;y++)if(g[y]===m)return y;return D}function c(m,D,p,g,y){p.splice(m,1),g.splice(m,1);for(var S=D+1;S<y.length;S++)y[S]--}function f(m,D,p,g,y,S,w){y.splice(m,0,g),S.splice(m,0,D);for(var b=p+1;b<w.length;b++)w[b]++}i.prototype.resize=function(m,D,p){if(!Lu(m))throw new TypeError("Array or Matrix expected");var g=m.valueOf().map(S=>Array.isArray(S)&&S.length===1?S[0]:S);if(g.length!==2)throw new Error("Only two dimensions matrix are supported");g.forEach(function(S){if(!et(S)||!it(S)||S<0)throw new TypeError("Invalid size, must contain positive integers (size: "+lt(g)+")")});var y=p?this.clone():this;return d(y,g[0],g[1],D)};function d(m,D,p,g){var y=g||0,S=n,w=0;ar(m._datatype)&&(S=t.find(n,[m._datatype,m._datatype])||n,w=t.convert(0,m._datatype),y=t.convert(y,m._datatype));var b=!S(y,w),E=m._size[0],C=m._size[1],A,T,_;if(p>C){for(T=C;T<p;T++)if(m._ptr[T]=m._values.length,b)for(A=0;A<E;A++)m._values.push(y),m._index.push(A);m._ptr[p]=m._values.length}else p<C&&(m._ptr.splice(p+1,C-p),m._values.splice(m._ptr[p],m._values.length),m._index.splice(m._ptr[p],m._index.length));if(C=p,D>E){if(b){var x=0;for(T=0;T<C;T++){m._ptr[T]=m._ptr[T]+x,_=m._ptr[T+1]+x;var F=0;for(A=E;A<D;A++,F++)m._values.splice(_+F,0,y),m._index.splice(_+F,0,A),x++}m._ptr[C]=m._values.length}}else if(D<E){var R=0;for(T=0;T<C;T++){m._ptr[T]=m._ptr[T]-R;var z=m._ptr[T],N=m._ptr[T+1]-R;for(_=z;_<N;_++)A=m._index[_],A>D-1&&(m._values.splice(_,1),m._index.splice(_,1),R++)}m._ptr[T]=m._values.length}return m._size[0]=D,m._size[1]=p,m}i.prototype.reshape=function(m,D){if(!ht(m))throw new TypeError("Array expected");if(m.length!==2)throw new Error("Sparse matrices can only be reshaped in two dimensions");m.forEach(function(L){if(!et(L)||!it(L)||L<=-2||L===0)throw new TypeError("Invalid size, must contain positive integers or -1 (size: "+lt(m)+")")});var p=this._size[0]*this._size[1];m=Nh(m,p);var g=m[0]*m[1];if(p!==g)throw new Error("Reshaping sparse matrix will result in the wrong number of elements");var y=D?this.clone():this;if(this._size[0]===m[0]&&this._size[1]===m[1])return y;for(var S=[],w=0;w<y._ptr.length;w++)for(var b=0;b<y._ptr[w+1]-y._ptr[w];b++)S.push(w);for(var E=y._values.slice(),C=y._index.slice(),A=0;A<y._index.length;A++){var T=C[A],_=S[A],x=T*y._size[1]+_;S[A]=x%m[1],C[A]=Math.floor(x/m[1])}y._values.length=0,y._index.length=0,y._ptr.length=m[1]+1,y._size=m.slice();for(var F=0;F<y._ptr.length;F++)y._ptr[F]=0;for(var R=0;R<E.length;R++){var z=C[R],N=S[R],U=E[R],I=s(z,y._ptr[N],y._ptr[N+1],y._index);f(I,z,N,U,y._values,y._index,y._ptr)}return y},i.prototype.clone=function(){var m=new i({values:this._values?Ie(this._values):void 0,index:Ie(this._index),ptr:Ie(this._ptr),size:Ie(this._size),datatype:this._datatype});return m},i.prototype.size=function(){return this._size.slice(0)},i.prototype.map=function(m,D){if(!this._values)throw new Error("Cannot invoke map on a Pattern only matrix");var p=this,g=this._size[0],y=this._size[1],S=uc(m,p,"map"),w=function(E,C,A){return S.fn(E,[C,A],p)};return h(this,0,g-1,0,y-1,w,D)};function h(m,D,p,g,y,S,w){var b=[],E=[],C=[],A=n,T=0;ar(m._datatype)&&(A=t.find(n,[m._datatype,m._datatype])||n,T=t.convert(0,m._datatype));for(var _=function(j,H,k){var q=S(j,H,k);A(q,T)||(b.push(q),E.push(H))},x=g;x<=y;x++){C.push(b.length);var F=m._ptr[x],R=m._ptr[x+1];if(w)for(var z=F;z<R;z++){var N=m._index[z];N>=D&&N<=p&&_(m._values[z],N-D,x-g)}else{for(var U={},I=F;I<R;I++){var L=m._index[I];U[L]=m._values[I]}for(var G=D;G<=p;G++){var X=G in U?U[G]:0;_(X,G-D,x-g)}}}return C.push(b.length),new i({values:b,index:E,ptr:C,size:[p-D+1,y-g+1]})}i.prototype.forEach=function(m,D){if(!this._values)throw new Error("Cannot invoke forEach on a Pattern only matrix");for(var p=this,g=this._size[0],y=this._size[1],S=uc(m,p,"forEach"),w=0;w<y;w++){var b=this._ptr[w],E=this._ptr[w+1];if(D)for(var C=b;C<E;C++){var A=this._index[C];S.fn(this._values[C],[A,w],p)}else{for(var T={},_=b;_<E;_++){var x=this._index[_];T[x]=this._values[_]}for(var F=0;F<g;F++){var R=F in T?T[F]:0;S.fn(R,[F,w],p)}}}},i.prototype[Symbol.iterator]=function*(){if(!this._values)throw new Error("Cannot iterate a Pattern only matrix");for(var m=this._size[1],D=0;D<m;D++)for(var p=this._ptr[D],g=this._ptr[D+1],y=p;y<g;y++){var S=this._index[y];yield{value:this._values[y],index:[S,D]}}},i.prototype.toArray=function(){return v(this._values,this._index,this._ptr,this._size,!0)},i.prototype.valueOf=function(){return v(this._values,this._index,this._ptr,this._size,!1)};function v(m,D,p,g,y){var S=g[0],w=g[1],b=[],E,C;for(E=0;E<S;E++)for(b[E]=[],C=0;C<w;C++)b[E][C]=0;for(C=0;C<w;C++)for(var A=p[C],T=p[C+1],_=A;_<T;_++)E=D[_],b[E][C]=m?y?Ie(m[_]):m[_]:1;return b}return i.prototype.format=function(m){for(var D=this._size[0],p=this._size[1],g=this.density(),y="Sparse Matrix ["+lt(D,m)+" x "+lt(p,m)+"] density: "+lt(g,m)+`
65
+ `,S=0;S<p;S++)for(var w=this._ptr[S],b=this._ptr[S+1],E=w;E<b;E++){var C=this._index[E];y+=`
66
+ (`+lt(C,m)+", "+lt(S,m)+") ==> "+(this._values?lt(this._values[E],m):"X")}return y},i.prototype.toString=function(){return lt(this.toArray())},i.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},i.prototype.diagonal=function(m){if(m){if(vt(m)&&(m=m.toNumber()),!et(m)||!it(m))throw new TypeError("The parameter k must be an integer number")}else m=0;var D=m>0?m:0,p=m<0?-m:0,g=this._size[0],y=this._size[1],S=Math.min(g-p,y-D),w=[],b=[],E=[];E[0]=0;for(var C=D;C<y&&w.length<S;C++)for(var A=this._ptr[C],T=this._ptr[C+1],_=A;_<T;_++){var x=this._index[_];if(x===C-D+p){w.push(this._values[_]),b[w.length-1]=x-p;break}}return E.push(w.length),new i({values:w,index:b,ptr:E,size:[S,1]})},i.fromJSON=function(m){return new i(m)},i.diagonal=function(m,D,p,g,y){if(!ht(m))throw new TypeError("Array expected, size parameter");if(m.length!==2)throw new Error("Only two dimensions matrix are supported");if(m=m.map(function(L){if(vt(L)&&(L=L.toNumber()),!et(L)||!it(L)||L<1)throw new Error("Size values must be positive integers");return L}),p){if(vt(p)&&(p=p.toNumber()),!et(p)||!it(p))throw new TypeError("The parameter k must be an integer number")}else p=0;var S=n,w=0;ar(y)&&(S=t.find(n,[y,y])||n,w=t.convert(0,y));var b=p>0?p:0,E=p<0?-p:0,C=m[0],A=m[1],T=Math.min(C-E,A-b),_;if(ht(D)){if(D.length!==T)throw new Error("Invalid value array length");_=function(G){return D[G]}}else if(Pe(D)){var x=D.size();if(x.length!==1||x[0]!==T)throw new Error("Invalid matrix length");_=function(G){return D.get([G])}}else _=function(){return D};for(var F=[],R=[],z=[],N=0;N<A;N++){z.push(F.length);var U=N-b;if(U>=0&&U<T){var I=_(U);S(I,w)||(R.push(U+E),F.push(I))}}return z.push(F.length),new i({values:F,index:R,ptr:z,size:[C,A]})},i.prototype.swapRows=function(m,D){if(!et(m)||!it(m)||!et(D)||!it(D))throw new Error("Row index must be positive integers");if(this._size.length!==2)throw new Error("Only two dimensional matrix is supported");return yt(m,this._size[0]),yt(D,this._size[0]),i._swapRows(m,D,this._size[1],this._values,this._index,this._ptr),this},i._forEachRow=function(m,D,p,g,y){for(var S=g[m],w=g[m+1],b=S;b<w;b++)y(p[b],D[b])},i._swapRows=function(m,D,p,g,y,S){for(var w=0;w<p;w++){var b=S[w],E=S[w+1],C=s(m,b,E,y),A=s(D,b,E,y);if(C<E&&A<E&&y[C]===m&&y[A]===D){if(g){var T=g[C];g[C]=g[A],g[A]=T}continue}if(C<E&&y[C]===m&&(A>=E||y[A]!==D)){var _=g?g[C]:void 0;y.splice(A,0,D),g&&g.splice(A,0,_),y.splice(A<=C?C+1:C,1),g&&g.splice(A<=C?C+1:C,1);continue}if(A<E&&y[A]===D&&(C>=E||y[C]!==m)){var x=g?g[A]:void 0;y.splice(C,0,m),g&&g.splice(C,0,x),y.splice(C<=A?A+1:A,1),g&&g.splice(C<=A?A+1:A,1)}}},i},{isClass:!0}),CT="number",TT=["typed"];function MT(e){var t=e.match(/(0[box])([0-9a-fA-F]*)\.([0-9a-fA-F]*)/);if(t){var n={"0b":2,"0o":8,"0x":16}[t[1]],r=t[2],i=t[3];return{input:e,radix:n,integerPart:r,fractionalPart:i}}else return null}function _T(e){for(var t=parseInt(e.integerPart,e.radix),n=0,r=0;r<e.fractionalPart.length;r++){var i=parseInt(e.fractionalPart[r],e.radix);n+=i/Math.pow(e.radix,r+1)}var a=t+n;if(isNaN(a))throw new SyntaxError('String "'+e.input+'" is not a valid number');return a}var BT=se(CT,TT,e=>{var{typed:t}=e,n=t("number",{"":function(){return 0},number:function(i){return i},string:function(i){if(i==="NaN")return NaN;var a=MT(i);if(a)return _T(a);var o=0,u=i.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);u&&(o=Number(u[2]),i=u[1]);var l=Number(i);if(isNaN(l))throw new SyntaxError('String "'+i+'" is not a valid number');if(u){if(l>2**o-1)throw new SyntaxError('String "'.concat(i,'" is out of range'));l>=2**(o-1)&&(l=l-2**o)}return l},BigNumber:function(i){return i.toNumber()},bigint:function(i){return Number(i)},Fraction:function(i){return i.valueOf()},Unit:t.referToSelf(r=>i=>{var a=i.clone();return a.value=r(i.value),a}),null:function(i){return 0},"Unit, string | Unit":function(i,a){return i.toNumber(a)},"Array | Matrix":t.referToSelf(r=>i=>pn(i,r))});return n.fromJSON=function(r){return parseFloat(r.value)},n}),FT="bignumber",NT=["typed","BigNumber"],RT=se(FT,NT,e=>{var{typed:t,BigNumber:n}=e;return t("bignumber",{"":function(){return new n(0)},number:function(i){return new n(i+"")},string:function(i){var a=i.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);if(a){var o=a[2],u=n(a[1]),l=new n(2).pow(Number(o));if(u.gt(l.sub(1)))throw new SyntaxError('String "'.concat(i,'" is out of range'));var s=new n(2).pow(Number(o)-1);return u.gte(s)?u.sub(l):u}return new n(i)},BigNumber:function(i){return i},bigint:function(i){return new n(i.toString())},Unit:t.referToSelf(r=>i=>{var a=i.clone();return a.value=r(i.value),a}),Fraction:function(i){return new n(String(i.n)).div(String(i.d)).times(String(i.s))},null:function(i){return new n(0)},"Array | Matrix":t.referToSelf(r=>i=>pn(i,r))})}),OT="complex",zT=["typed","Complex"],UT=se(OT,zT,e=>{var{typed:t,Complex:n}=e;return t("complex",{"":function(){return n.ZERO},number:function(i){return new n(i,0)},"number, number":function(i,a){return new n(i,a)},"BigNumber, BigNumber":function(i,a){return new n(i.toNumber(),a.toNumber())},Fraction:function(i){return new n(i.valueOf(),0)},Complex:function(i){return i.clone()},string:function(i){return n(i)},null:function(i){return n(0)},Object:function(i){if("re"in i&&"im"in i)return new n(i.re,i.im);if("r"in i&&"phi"in i||"abs"in i&&"arg"in i)return new n(i);throw new Error("Expected object with properties (re and im) or (r and phi) or (abs and arg)")},"Array | Matrix":t.referToSelf(r=>i=>pn(i,r))})}),IT="fraction",$T=["typed","Fraction"],kT=se(IT,$T,e=>{var{typed:t,Fraction:n}=e;return t("fraction",{number:function(i){if(!isFinite(i)||isNaN(i))throw new Error(i+" cannot be represented as a fraction");return new n(i)},string:function(i){return new n(i)},"number, number":function(i,a){return new n(i,a)},"bigint, bigint":function(i,a){return new n(i,a)},null:function(i){return new n(0)},BigNumber:function(i){return new n(i.toString())},bigint:function(i){return new n(i.toString())},Fraction:function(i){return i},Unit:t.referToSelf(r=>i=>{var a=i.clone();return a.value=r(i.value),a}),Object:function(i){return new n(i)},"Array | Matrix":t.referToSelf(r=>i=>pn(i,r))})}),zb="matrix",LT=["typed","Matrix","DenseMatrix","SparseMatrix"],jT=se(zb,LT,e=>{var{typed:t,Matrix:n,DenseMatrix:r,SparseMatrix:i}=e;return t(zb,{"":function(){return a([])},string:function(u){return a([],u)},"string, string":function(u,l){return a([],u,l)},Array:function(u){return a(u)},Matrix:function(u){return a(u,u.storage())},"Array | Matrix, string":a,"Array | Matrix, string, string":a});function a(o,u,l){if(u==="dense"||u==="default"||u===void 0)return new r(o,l);if(u==="sparse")return new i(o,l);throw new TypeError("Unknown matrix type "+JSON.stringify(u)+".")}}),Ub="matrixFromColumns",HT=["typed","matrix","flatten","size"],PT=se(Ub,HT,e=>{var{typed:t,matrix:n,flatten:r,size:i}=e;return t(Ub,{"...Array":function(l){return a(l)},"...Matrix":function(l){return n(a(l.map(s=>s.toArray())))}});function a(u){if(u.length===0)throw new TypeError("At least one column is needed to construct a matrix.");for(var l=o(u[0]),s=[],c=0;c<l;c++)s[c]=[];for(var f of u){var d=o(f);if(d!==l)throw new TypeError("The vectors had different length: "+(l|0)+" ≠ "+(d|0));for(var h=r(f),v=0;v<l;v++)s[v].push(h[v])}return s}function o(u){var l=i(u);if(l.length===1)return l[0];if(l.length===2){if(l[0]===1)return l[1];if(l[1]===1)return l[0];throw new TypeError("At least one of the arguments is not a vector.")}else throw new TypeError("Only one- or two-dimensional vectors are supported.")}}),Ib="unaryMinus",qT=["typed"],VT=se(Ib,qT,e=>{var{typed:t}=e;return t(Ib,{number:Tb,"Complex | BigNumber | Fraction":n=>n.neg(),bigint:n=>-n,Unit:t.referToSelf(n=>r=>{var i=r.clone();return i.value=t.find(n,i.valueType())(r.value),i}),"Array | Matrix":t.referToSelf(n=>r=>pn(r,n,!0))})}),$b="abs",GT=["typed"],YT=se($b,GT,e=>{var{typed:t}=e;return t($b,{number:wb,"Complex | BigNumber | Fraction | Unit":n=>n.abs(),bigint:n=>n<0n?-n:n,"Array | Matrix":t.referToSelf(n=>r=>pn(r,n,!0))})}),kb="addScalar",XT=["typed"],ZT=se(kb,XT,e=>{var{typed:t}=e;return t(kb,{"number, number":Eb,"Complex, Complex":function(r,i){return r.add(i)},"BigNumber, BigNumber":function(r,i){return r.plus(i)},"bigint, bigint":function(r,i){return r+i},"Fraction, Fraction":function(r,i){return r.add(i)},"Unit, Unit":t.referToSelf(n=>(r,i)=>{if(r.value===null||r.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(i.value===null||i.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!r.equalBase(i))throw new Error("Units do not match");var a=r.clone();return a.value=t.find(n,[a.valueType(),i.valueType()])(a.value,i.value),a.fixPrefix=!1,a})})}),Lb="subtractScalar",QT=["typed"],KT=se(Lb,QT,e=>{var{typed:t}=e;return t(Lb,{"number, number":Ab,"Complex, Complex":function(r,i){return r.sub(i)},"BigNumber, BigNumber":function(r,i){return r.minus(i)},"bigint, bigint":function(r,i){return r-i},"Fraction, Fraction":function(r,i){return r.sub(i)},"Unit, Unit":t.referToSelf(n=>(r,i)=>{if(r.value===null||r.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(i.value===null||i.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!r.equalBase(i))throw new Error("Units do not match");var a=r.clone();return a.value=t.find(n,[a.valueType(),i.valueType()])(a.value,i.value),a.fixPrefix=!1,a})})}),WT="matAlgo11xS0s",JT=["typed","equalScalar"],jb=se(WT,JT,e=>{var{typed:t,equalScalar:n}=e;return function(i,a,o,u){var l=i._values,s=i._index,c=i._ptr,f=i._size,d=i._datatype;if(!l)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var h=f[0],v=f[1],m,D=n,p=0,g=o;typeof d=="string"&&(m=d,D=t.find(n,[m,m]),p=t.convert(0,m),a=t.convert(a,m),g=t.find(o,[m,m]));for(var y=[],S=[],w=[],b=0;b<v;b++){w[b]=S.length;for(var E=c[b],C=c[b+1],A=E;A<C;A++){var T=s[A],_=u?g(a,l[A]):g(l[A],a);D(_,p)||(S.push(T),y.push(_))}}return w[v]=S.length,i.createSparseMatrix({values:y,index:S,ptr:w,size:[h,v],datatype:m})}}),eM="matAlgo12xSfs",tM=["typed","DenseMatrix"],vo=se(eM,tM,e=>{var{typed:t,DenseMatrix:n}=e;return function(i,a,o,u){var l=i._values,s=i._index,c=i._ptr,f=i._size,d=i._datatype;if(!l)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var h=f[0],v=f[1],m,D=o;typeof d=="string"&&(m=d,a=t.convert(a,m),D=t.find(o,[m,m]));for(var p=[],g=[],y=[],S=0;S<v;S++){for(var w=S+1,b=c[S],E=c[S+1],C=b;C<E;C++){var A=s[C];g[A]=l[C],y[A]=w}for(var T=0;T<h;T++)S===0&&(p[T]=[]),y[T]===w?p[T][S]=u?D(a,g[T]):D(g[T],a):p[T][S]=u?D(a,0):D(0,a)}return new n({data:p,size:[h,v],datatype:m})}}),nM="matAlgo14xDs",rM=["typed"],Ih=se(nM,rM,e=>{var{typed:t}=e;return function(i,a,o,u){var l=i._data,s=i._size,c=i._datatype,f,d=o;typeof c=="string"&&(f=c,a=t.convert(a,f),d=t.find(o,[f,f]));var h=s.length>0?n(d,0,s,s[0],l,a,u):[];return i.createDenseMatrix({data:h,size:Ie(s),datatype:f})};function n(r,i,a,o,u,l,s){var c=[];if(i===a.length-1)for(var f=0;f<o;f++)c[f]=s?r(l,u[f]):r(u[f],l);else for(var d=0;d<o;d++)c[d]=n(r,i+1,a,a[i+1],u[d],l,s);return c}}),iM="matAlgo03xDSf",aM=["typed"],yo=se(iM,aM,e=>{var{typed:t}=e;return function(r,i,a,o){var u=r._data,l=r._size,s=r._datatype||r.getDataType(),c=i._values,f=i._index,d=i._ptr,h=i._size,v=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(l.length!==h.length)throw new Le(l.length,h.length);if(l[0]!==h[0]||l[1]!==h[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+h+")");if(!c)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var m=l[0],D=l[1],p,g=0,y=a;typeof s=="string"&&s===v&&s!=="mixed"&&(p=s,g=t.convert(0,p),y=t.find(a,[p,p]));for(var S=[],w=0;w<m;w++)S[w]=[];for(var b=[],E=[],C=0;C<D;C++){for(var A=C+1,T=d[C],_=d[C+1],x=T;x<_;x++){var F=f[x];b[F]=o?y(c[x],u[F][C]):y(u[F][C],c[x]),E[F]=A}for(var R=0;R<m;R++)E[R]===A?S[R][C]=b[R]:S[R][C]=o?y(g,u[R][C]):y(u[R][C],g)}return r.createDenseMatrix({data:S,size:[m,D],datatype:s===r._datatype&&v===i._datatype?p:void 0})}}),oM="matAlgo05xSfSf",uM=["typed","equalScalar"],lM=se(oM,uM,e=>{var{typed:t,equalScalar:n}=e;return function(i,a,o){var u=i._values,l=i._index,s=i._ptr,c=i._size,f=i._datatype||i._data===void 0?i._datatype:i.getDataType(),d=a._values,h=a._index,v=a._ptr,m=a._size,D=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(c.length!==m.length)throw new Le(c.length,m.length);if(c[0]!==m[0]||c[1]!==m[1])throw new RangeError("Dimension mismatch. Matrix A ("+c+") must match Matrix B ("+m+")");var p=c[0],g=c[1],y,S=n,w=0,b=o;typeof f=="string"&&f===D&&f!=="mixed"&&(y=f,S=t.find(n,[y,y]),w=t.convert(0,y),b=t.find(o,[y,y]));var E=u&&d?[]:void 0,C=[],A=[],T=E?[]:void 0,_=E?[]:void 0,x=[],F=[],R,z,N,U;for(z=0;z<g;z++){A[z]=C.length;var I=z+1;for(N=s[z],U=s[z+1];N<U;N++)R=l[N],C.push(R),x[R]=I,T&&(T[R]=u[N]);for(N=v[z],U=v[z+1];N<U;N++)R=h[N],x[R]!==I&&C.push(R),F[R]=I,_&&(_[R]=d[N]);if(E)for(N=A[z];N<C.length;){R=C[N];var L=x[R],G=F[R];if(L===I||G===I){var X=L===I?T[R]:w,P=G===I?_[R]:w,j=b(X,P);S(j,w)?C.splice(N,1):(E.push(j),N++)}}}return A[g]=C.length,i.createSparseMatrix({values:E,index:C,ptr:A,size:[p,g],datatype:f===i._datatype&&D===a._datatype?y:void 0})}}),sM="matAlgo13xDD",cM=["typed"],fM=se(sM,cM,e=>{var{typed:t}=e;return function(i,a,o){var u=i._data,l=i._size,s=i._datatype,c=a._data,f=a._size,d=a._datatype,h=[];if(l.length!==f.length)throw new Le(l.length,f.length);for(var v=0;v<l.length;v++){if(l[v]!==f[v])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+f+")");h[v]=l[v]}var m,D=o;typeof s=="string"&&s===d&&(m=s,D=t.find(o,[m,m]));var p=h.length>0?n(D,0,h,h[0],u,c):[];return i.createDenseMatrix({data:p,size:h,datatype:m})};function n(r,i,a,o,u,l){var s=[];if(i===a.length-1)for(var c=0;c<o;c++)s[c]=r(u[c],l[c]);else for(var f=0;f<o;f++)s[f]=n(r,i+1,a,a[i+1],u[f],l[f]);return s}});function Pt(e,t){if(Ti(e.size(),t.size()))return[e,t];var n=mb(e.size(),t.size());return[e,t].map(r=>dM(r,n))}function dM(e,t){return Ti(e.size(),t)?e:e.create(Oh(e.valueOf(),t),e.datatype())}var hM="matrixAlgorithmSuite",mM=["typed","matrix"],aa=se(hM,mM,e=>{var{typed:t,matrix:n}=e,r=fM({typed:t}),i=Ih({typed:t});return function(o){var u=o.elop,l=o.SD||o.DS,s;u?(s={"DenseMatrix, DenseMatrix":(h,v)=>r(...Pt(h,v),u),"Array, Array":(h,v)=>r(...Pt(n(h),n(v)),u).valueOf(),"Array, DenseMatrix":(h,v)=>r(...Pt(n(h),v),u),"DenseMatrix, Array":(h,v)=>r(...Pt(h,n(v)),u)},o.SS&&(s["SparseMatrix, SparseMatrix"]=(h,v)=>o.SS(...Pt(h,v),u,!1)),o.DS&&(s["DenseMatrix, SparseMatrix"]=(h,v)=>o.DS(...Pt(h,v),u,!1),s["Array, SparseMatrix"]=(h,v)=>o.DS(...Pt(n(h),v),u,!1)),l&&(s["SparseMatrix, DenseMatrix"]=(h,v)=>l(...Pt(v,h),u,!0),s["SparseMatrix, Array"]=(h,v)=>l(...Pt(n(v),h),u,!0))):(s={"DenseMatrix, DenseMatrix":t.referToSelf(h=>(v,m)=>r(...Pt(v,m),h)),"Array, Array":t.referToSelf(h=>(v,m)=>r(...Pt(n(v),n(m)),h).valueOf()),"Array, DenseMatrix":t.referToSelf(h=>(v,m)=>r(...Pt(n(v),m),h)),"DenseMatrix, Array":t.referToSelf(h=>(v,m)=>r(...Pt(v,n(m)),h))},o.SS&&(s["SparseMatrix, SparseMatrix"]=t.referToSelf(h=>(v,m)=>o.SS(...Pt(v,m),h,!1))),o.DS&&(s["DenseMatrix, SparseMatrix"]=t.referToSelf(h=>(v,m)=>o.DS(...Pt(v,m),h,!1)),s["Array, SparseMatrix"]=t.referToSelf(h=>(v,m)=>o.DS(...Pt(n(v),m),h,!1))),l&&(s["SparseMatrix, DenseMatrix"]=t.referToSelf(h=>(v,m)=>l(...Pt(m,v),h,!0)),s["SparseMatrix, Array"]=t.referToSelf(h=>(v,m)=>l(...Pt(n(m),v),h,!0))));var c=o.scalar||"any",f=o.Ds||o.Ss;f&&(u?(s["DenseMatrix,"+c]=(h,v)=>i(h,v,u,!1),s[c+", DenseMatrix"]=(h,v)=>i(v,h,u,!0),s["Array,"+c]=(h,v)=>i(n(h),v,u,!1).valueOf(),s[c+", Array"]=(h,v)=>i(n(v),h,u,!0).valueOf()):(s["DenseMatrix,"+c]=t.referToSelf(h=>(v,m)=>i(v,m,h,!1)),s[c+", DenseMatrix"]=t.referToSelf(h=>(v,m)=>i(m,v,h,!0)),s["Array,"+c]=t.referToSelf(h=>(v,m)=>i(n(v),m,h,!1).valueOf()),s[c+", Array"]=t.referToSelf(h=>(v,m)=>i(n(m),v,h,!0).valueOf())));var d=o.sS!==void 0?o.sS:o.Ss;return u?(o.Ss&&(s["SparseMatrix,"+c]=(h,v)=>o.Ss(h,v,u,!1)),d&&(s[c+", SparseMatrix"]=(h,v)=>d(v,h,u,!0))):(o.Ss&&(s["SparseMatrix,"+c]=t.referToSelf(h=>(v,m)=>o.Ss(v,m,h,!1))),d&&(s[c+", SparseMatrix"]=t.referToSelf(h=>(v,m)=>d(m,v,h,!0)))),u&&u.signatures&&Ny(s,u.signatures),s}}),pM="matAlgo01xDSid",gM=["typed"],Hb=se(pM,gM,e=>{var{typed:t}=e;return function(r,i,a,o){var u=r._data,l=r._size,s=r._datatype||r.getDataType(),c=i._values,f=i._index,d=i._ptr,h=i._size,v=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(l.length!==h.length)throw new Le(l.length,h.length);if(l[0]!==h[0]||l[1]!==h[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+h+")");if(!c)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var m=l[0],D=l[1],p=typeof s=="string"&&s!=="mixed"&&s===v?s:void 0,g=p?t.find(a,[p,p]):a,y,S,w=[];for(y=0;y<m;y++)w[y]=[];var b=[],E=[];for(S=0;S<D;S++){for(var C=S+1,A=d[S],T=d[S+1],_=A;_<T;_++)y=f[_],b[y]=o?g(c[_],u[y][S]):g(u[y][S],c[_]),E[y]=C;for(y=0;y<m;y++)E[y]===C?w[y][S]=b[y]:w[y][S]=u[y][S]}return r.createDenseMatrix({data:w,size:[m,D],datatype:s===r._datatype&&v===i._datatype?p:void 0})}}),vM="matAlgo04xSidSid",yM=["typed","equalScalar"],bM=se(vM,yM,e=>{var{typed:t,equalScalar:n}=e;return function(i,a,o){var u=i._values,l=i._index,s=i._ptr,c=i._size,f=i._datatype||i._data===void 0?i._datatype:i.getDataType(),d=a._values,h=a._index,v=a._ptr,m=a._size,D=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(c.length!==m.length)throw new Le(c.length,m.length);if(c[0]!==m[0]||c[1]!==m[1])throw new RangeError("Dimension mismatch. Matrix A ("+c+") must match Matrix B ("+m+")");var p=c[0],g=c[1],y,S=n,w=0,b=o;typeof f=="string"&&f===D&&f!=="mixed"&&(y=f,S=t.find(n,[y,y]),w=t.convert(0,y),b=t.find(o,[y,y]));var E=u&&d?[]:void 0,C=[],A=[],T=u&&d?[]:void 0,_=u&&d?[]:void 0,x=[],F=[],R,z,N,U,I;for(z=0;z<g;z++){A[z]=C.length;var L=z+1;for(U=s[z],I=s[z+1],N=U;N<I;N++)R=l[N],C.push(R),x[R]=L,T&&(T[R]=u[N]);for(U=v[z],I=v[z+1],N=U;N<I;N++)if(R=h[N],x[R]===L){if(T){var G=b(T[R],d[N]);S(G,w)?x[R]=null:T[R]=G}}else C.push(R),F[R]=L,_&&(_[R]=d[N]);if(T&&_)for(N=A[z];N<C.length;)R=C[N],x[R]===L?(E[N]=T[R],N++):F[R]===L?(E[N]=_[R],N++):C.splice(N,1)}return A[g]=C.length,i.createSparseMatrix({values:E,index:C,ptr:A,size:[p,g],datatype:f===i._datatype&&D===a._datatype?y:void 0})}}),DM="matAlgo10xSids",SM=["typed","DenseMatrix"],Pb=se(DM,SM,e=>{var{typed:t,DenseMatrix:n}=e;return function(i,a,o,u){var l=i._values,s=i._index,c=i._ptr,f=i._size,d=i._datatype;if(!l)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var h=f[0],v=f[1],m,D=o;typeof d=="string"&&(m=d,a=t.convert(a,m),D=t.find(o,[m,m]));for(var p=[],g=[],y=[],S=0;S<v;S++){for(var w=S+1,b=c[S],E=c[S+1],C=b;C<E;C++){var A=s[C];g[A]=l[C],y[A]=w}for(var T=0;T<h;T++)S===0&&(p[T]=[]),y[T]===w?p[T][S]=u?D(a,g[T]):D(g[T],a):p[T][S]=a}return new n({data:p,size:[h,v],datatype:m})}}),xM="multiplyScalar",wM=["typed"],EM=se(xM,wM,e=>{var{typed:t}=e;return t("multiplyScalar",{"number, number":Cb,"Complex, Complex":function(r,i){return r.mul(i)},"BigNumber, BigNumber":function(r,i){return r.times(i)},"bigint, bigint":function(r,i){return r*i},"Fraction, Fraction":function(r,i){return r.mul(i)},"number | Fraction | BigNumber | Complex, Unit":(n,r)=>r.multiply(n),"Unit, number | Fraction | BigNumber | Complex | Unit":(n,r)=>n.multiply(r)})}),qb="multiply",AM=["typed","matrix","addScalar","multiplyScalar","equalScalar","dot"],CM=se(qb,AM,e=>{var{typed:t,matrix:n,addScalar:r,multiplyScalar:i,equalScalar:a,dot:o}=e,u=jb({typed:t,equalScalar:a}),l=Ih({typed:t});function s(w,b){switch(w.length){case 1:switch(b.length){case 1:if(w[0]!==b[0])throw new RangeError("Dimension mismatch in multiplication. Vectors must have the same length");break;case 2:if(w[0]!==b[0])throw new RangeError("Dimension mismatch in multiplication. Vector length ("+w[0]+") must match Matrix rows ("+b[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+b.length+" dimensions)")}break;case 2:switch(b.length){case 1:if(w[1]!==b[0])throw new RangeError("Dimension mismatch in multiplication. Matrix columns ("+w[1]+") must match Vector length ("+b[0]+")");break;case 2:if(w[1]!==b[0])throw new RangeError("Dimension mismatch in multiplication. Matrix A columns ("+w[1]+") must match Matrix B rows ("+b[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+b.length+" dimensions)")}break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix A has "+w.length+" dimensions)")}}function c(w,b,E){if(E===0)throw new Error("Cannot multiply two empty vectors");return o(w,b)}function f(w,b){if(b.storage()!=="dense")throw new Error("Support for SparseMatrix not implemented");return d(w,b)}function d(w,b){var E=w._data,C=w._size,A=w._datatype||w.getDataType(),T=b._data,_=b._size,x=b._datatype||b.getDataType(),F=C[0],R=_[1],z,N=r,U=i;A&&x&&A===x&&typeof A=="string"&&A!=="mixed"&&(z=A,N=t.find(r,[z,z]),U=t.find(i,[z,z]));for(var I=[],L=0;L<R;L++){for(var G=U(E[0],T[0][L]),X=1;X<F;X++)G=N(G,U(E[X],T[X][L]));I[L]=G}return w.createDenseMatrix({data:I,size:[R],datatype:A===w._datatype&&x===b._datatype?z:void 0})}var h=t("_multiplyMatrixVector",{"DenseMatrix, any":m,"SparseMatrix, any":g}),v=t("_multiplyMatrixMatrix",{"DenseMatrix, DenseMatrix":D,"DenseMatrix, SparseMatrix":p,"SparseMatrix, DenseMatrix":y,"SparseMatrix, SparseMatrix":S});function m(w,b){var E=w._data,C=w._size,A=w._datatype||w.getDataType(),T=b._data,_=b._datatype||b.getDataType(),x=C[0],F=C[1],R,z=r,N=i;A&&_&&A===_&&typeof A=="string"&&A!=="mixed"&&(R=A,z=t.find(r,[R,R]),N=t.find(i,[R,R]));for(var U=[],I=0;I<x;I++){for(var L=E[I],G=N(L[0],T[0]),X=1;X<F;X++)G=z(G,N(L[X],T[X]));U[I]=G}return w.createDenseMatrix({data:U,size:[x],datatype:A===w._datatype&&_===b._datatype?R:void 0})}function D(w,b){var E=w._data,C=w._size,A=w._datatype||w.getDataType(),T=b._data,_=b._size,x=b._datatype||b.getDataType(),F=C[0],R=C[1],z=_[1],N,U=r,I=i;A&&x&&A===x&&typeof A=="string"&&A!=="mixed"&&A!=="mixed"&&(N=A,U=t.find(r,[N,N]),I=t.find(i,[N,N]));for(var L=[],G=0;G<F;G++){var X=E[G];L[G]=[];for(var P=0;P<z;P++){for(var j=I(X[0],T[0][P]),H=1;H<R;H++)j=U(j,I(X[H],T[H][P]));L[G][P]=j}}return w.createDenseMatrix({data:L,size:[F,z],datatype:A===w._datatype&&x===b._datatype?N:void 0})}function p(w,b){var E=w._data,C=w._size,A=w._datatype||w.getDataType(),T=b._values,_=b._index,x=b._ptr,F=b._size,R=b._datatype||b._data===void 0?b._datatype:b.getDataType();if(!T)throw new Error("Cannot multiply Dense Matrix times Pattern only Matrix");var z=C[0],N=F[1],U,I=r,L=i,G=a,X=0;A&&R&&A===R&&typeof A=="string"&&A!=="mixed"&&(U=A,I=t.find(r,[U,U]),L=t.find(i,[U,U]),G=t.find(a,[U,U]),X=t.convert(0,U));for(var P=[],j=[],H=[],k=b.createSparseMatrix({values:P,index:j,ptr:H,size:[z,N],datatype:A===w._datatype&&R===b._datatype?U:void 0}),q=0;q<N;q++){H[q]=j.length;var Y=x[q],ee=x[q+1];if(ee>Y)for(var te=0,ne=0;ne<z;ne++){for(var oe=ne+1,W=void 0,ce=Y;ce<ee;ce++){var de=_[ce];te!==oe?(W=L(E[ne][de],T[ce]),te=oe):W=I(W,L(E[ne][de],T[ce]))}te===oe&&!G(W,X)&&(j.push(ne),P.push(W))}}return H[N]=j.length,k}function g(w,b){var E=w._values,C=w._index,A=w._ptr,T=w._datatype||w._data===void 0?w._datatype:w.getDataType();if(!E)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var _=b._data,x=b._datatype||b.getDataType(),F=w._size[0],R=b._size[0],z=[],N=[],U=[],I,L=r,G=i,X=a,P=0;T&&x&&T===x&&typeof T=="string"&&T!=="mixed"&&(I=T,L=t.find(r,[I,I]),G=t.find(i,[I,I]),X=t.find(a,[I,I]),P=t.convert(0,I));var j=[],H=[];U[0]=0;for(var k=0;k<R;k++){var q=_[k];if(!X(q,P))for(var Y=A[k],ee=A[k+1],te=Y;te<ee;te++){var ne=C[te];H[ne]?j[ne]=L(j[ne],G(q,E[te])):(H[ne]=!0,N.push(ne),j[ne]=G(q,E[te]))}}for(var oe=N.length,W=0;W<oe;W++){var ce=N[W];z[W]=j[ce]}return U[1]=N.length,w.createSparseMatrix({values:z,index:N,ptr:U,size:[F,1],datatype:T===w._datatype&&x===b._datatype?I:void 0})}function y(w,b){var E=w._values,C=w._index,A=w._ptr,T=w._datatype||w._data===void 0?w._datatype:w.getDataType();if(!E)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var _=b._data,x=b._datatype||b.getDataType(),F=w._size[0],R=b._size[0],z=b._size[1],N,U=r,I=i,L=a,G=0;T&&x&&T===x&&typeof T=="string"&&T!=="mixed"&&(N=T,U=t.find(r,[N,N]),I=t.find(i,[N,N]),L=t.find(a,[N,N]),G=t.convert(0,N));for(var X=[],P=[],j=[],H=w.createSparseMatrix({values:X,index:P,ptr:j,size:[F,z],datatype:T===w._datatype&&x===b._datatype?N:void 0}),k=[],q=[],Y=0;Y<z;Y++){j[Y]=P.length;for(var ee=Y+1,te=0;te<R;te++){var ne=_[te][Y];if(!L(ne,G))for(var oe=A[te],W=A[te+1],ce=oe;ce<W;ce++){var de=C[ce];q[de]!==ee?(q[de]=ee,P.push(de),k[de]=I(ne,E[ce])):k[de]=U(k[de],I(ne,E[ce]))}}for(var ve=j[Y],De=P.length,Se=ve;Se<De;Se++){var Ee=P[Se];X[Se]=k[Ee]}}return j[z]=P.length,H}function S(w,b){var E=w._values,C=w._index,A=w._ptr,T=w._datatype||w._data===void 0?w._datatype:w.getDataType(),_=b._values,x=b._index,F=b._ptr,R=b._datatype||b._data===void 0?b._datatype:b.getDataType(),z=w._size[0],N=b._size[1],U=E&&_,I,L=r,G=i;T&&R&&T===R&&typeof T=="string"&&T!=="mixed"&&(I=T,L=t.find(r,[I,I]),G=t.find(i,[I,I]));for(var X=U?[]:void 0,P=[],j=[],H=w.createSparseMatrix({values:X,index:P,ptr:j,size:[z,N],datatype:T===w._datatype&&R===b._datatype?I:void 0}),k=U?[]:void 0,q=[],Y,ee,te,ne,oe,W,ce,de,ve=0;ve<N;ve++){j[ve]=P.length;var De=ve+1;for(oe=F[ve],W=F[ve+1],ne=oe;ne<W;ne++)if(de=x[ne],U)for(ee=A[de],te=A[de+1],Y=ee;Y<te;Y++)ce=C[Y],q[ce]!==De?(q[ce]=De,P.push(ce),k[ce]=G(_[ne],E[Y])):k[ce]=L(k[ce],G(_[ne],E[Y]));else for(ee=A[de],te=A[de+1],Y=ee;Y<te;Y++)ce=C[Y],q[ce]!==De&&(q[ce]=De,P.push(ce));if(U)for(var Se=j[ve],Ee=P.length,Re=Se;Re<Ee;Re++){var Ce=P[Re];X[Re]=k[Ce]}}return j[N]=P.length,H}return t(qb,i,{"Array, Array":t.referTo("Matrix, Matrix",w=>(b,E)=>{s(st(b),st(E));var C=w(n(b),n(E));return Pe(C)?C.valueOf():C}),"Matrix, Matrix":function(b,E){var C=b.size(),A=E.size();return s(C,A),C.length===1?A.length===1?c(b,E,C[0]):f(b,E):A.length===1?h(b,E):v(b,E)},"Matrix, Array":t.referTo("Matrix,Matrix",w=>(b,E)=>w(b,n(E))),"Array, Matrix":t.referToSelf(w=>(b,E)=>w(n(b,E.storage()),E)),"SparseMatrix, any":function(b,E){return u(b,E,i,!1)},"DenseMatrix, any":function(b,E){return l(b,E,i,!1)},"any, SparseMatrix":function(b,E){return u(E,b,i,!0)},"any, DenseMatrix":function(b,E){return l(E,b,i,!0)},"Array, any":function(b,E){return l(n(b),E,i,!1).valueOf()},"any, Array":function(b,E){return l(n(E),b,i,!0).valueOf()},"any, any":i,"any, any, ...any":t.referToSelf(w=>(b,E,C)=>{for(var A=w(b,E),T=0;T<C.length;T++)A=w(A,C[T]);return A})})}),Vb="sign",TM=["typed","BigNumber","Fraction","complex"],MM=se(Vb,TM,e=>{var{typed:t,BigNumber:n,complex:r,Fraction:i}=e;return t(Vb,{number:Uh,Complex:function(o){return o.im===0?r(Uh(o.re)):o.sign()},BigNumber:function(o){return new n(o.cmp(0))},bigint:function(o){return o>0n?1n:o<0n?-1n:0n},Fraction:function(o){return o.n===0n?new i(0):new i(o.s)},"Array | Matrix":t.referToSelf(a=>o=>pn(o,a,!0)),Unit:t.referToSelf(a=>o=>{if(!o._isDerived()&&o.units[0].unit.offset!==0)throw new TypeError("sign is ambiguous for units with offset");return t.find(a,o.valueType())(o.value)})})}),_M="sqrt",BM=["config","typed","Complex"],FM=se(_M,BM,e=>{var{config:t,typed:n,Complex:r}=e;return n("sqrt",{number:i,Complex:function(o){return o.sqrt()},BigNumber:function(o){return!o.isNegative()||t.predictable?o.sqrt():i(o.toNumber())},Unit:function(o){return o.pow(.5)}});function i(a){return isNaN(a)?NaN:a>=0||t.predictable?Math.sqrt(a):new r(a,0).sqrt()}}),Gb="subtract",NM=["typed","matrix","equalScalar","subtractScalar","unaryMinus","DenseMatrix","concat"],RM=se(Gb,NM,e=>{var{typed:t,matrix:n,equalScalar:r,subtractScalar:i,unaryMinus:a,DenseMatrix:o,concat:u}=e,l=Hb({typed:t}),s=yo({typed:t}),c=lM({typed:t,equalScalar:r}),f=Pb({typed:t,DenseMatrix:o}),d=vo({typed:t,DenseMatrix:o}),h=aa({typed:t,matrix:n,concat:u});return t(Gb,{"any, any":i},h({elop:i,SS:c,DS:l,SD:s,Ss:d,sS:f}))}),OM="matAlgo07xSSf",zM=["typed","SparseMatrix"],Vu=se(OM,zM,e=>{var{typed:t,SparseMatrix:n}=e;return function(a,o,u){var l=a._size,s=a._datatype||a._data===void 0?a._datatype:a.getDataType(),c=o._size,f=o._datatype||o._data===void 0?o._datatype:o.getDataType();if(l.length!==c.length)throw new Le(l.length,c.length);if(l[0]!==c[0]||l[1]!==c[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+c+")");var d=l[0],h=l[1],v,m=0,D=u;typeof s=="string"&&s===f&&s!=="mixed"&&(v=s,m=t.convert(0,v),D=t.find(u,[v,v]));for(var p=[],g=[],y=new Array(h+1).fill(0),S=[],w=[],b=[],E=[],C=0;C<h;C++){var A=C+1,T=0;r(a,C,b,S,A),r(o,C,E,w,A);for(var _=0;_<d;_++){var x=b[_]===A?S[_]:m,F=E[_]===A?w[_]:m,R=D(x,F);R!==0&&R!==!1&&(g.push(_),p.push(R),T++)}y[C+1]=y[C]+T}return new n({values:p,index:g,ptr:y,size:[d,h],datatype:s===a._datatype&&f===o._datatype?v:void 0})};function r(i,a,o,u,l){for(var s=i._values,c=i._index,f=i._ptr,d=f[a],h=f[a+1];d<h;d++){var v=c[d];o[v]=l,u[v]=s[d]}}}),Yb="conj",UM=["typed"],IM=se(Yb,UM,e=>{var{typed:t}=e;return t(Yb,{"number | BigNumber | Fraction":n=>n,Complex:n=>n.conjugate(),Unit:t.referToSelf(n=>r=>new r.constructor(n(r.toNumeric()),r.formatUnits())),"Array | Matrix":t.referToSelf(n=>r=>pn(r,n))})}),Xb="im",$M=["typed"],kM=se(Xb,$M,e=>{var{typed:t}=e;return t(Xb,{number:()=>0,"BigNumber | Fraction":n=>n.mul(0),Complex:n=>n.im,"Array | Matrix":t.referToSelf(n=>r=>pn(r,n))})}),Zb="re",LM=["typed"],jM=se(Zb,LM,e=>{var{typed:t}=e;return t(Zb,{"number | BigNumber | Fraction":n=>n,Complex:n=>n.re,"Array | Matrix":t.referToSelf(n=>r=>pn(r,n))})}),Qb="concat",HM=["typed","matrix","isInteger"],PM=se(Qb,HM,e=>{var{typed:t,matrix:n,isInteger:r}=e;return t(Qb,{"...Array | Matrix | number | BigNumber":function(a){var o,u=a.length,l=-1,s,c=!1,f=[];for(o=0;o<u;o++){var d=a[o];if(Pe(d)&&(c=!0),et(d)||vt(d)){if(o!==u-1)throw new Error("Dimension must be specified as last argument");if(s=l,l=d.valueOf(),!r(l))throw new TypeError("Integer number expected for dimension");if(l<0||o>0&&l>s)throw new Ri(l,s+1)}else{var h=Ie(d).valueOf(),v=st(h);if(f[o]=h,s=l,l=v.length-1,o>0&&l!==s)throw new Le(s+1,l+1)}}if(f.length===0)throw new SyntaxError("At least one matrix expected");for(var m=f.shift();f.length;)m=hb(m,f.shift(),l);return c?n(m):m},"...string":function(a){return a.join("")}})}),Kb="column",qM=["typed","Index","matrix","range"],VM=se(Kb,qM,e=>{var{typed:t,Index:n,matrix:r,range:i}=e;return t(Kb,{"Matrix, number":a,"Array, number":function(u,l){return a(r(Ie(u)),l).valueOf()}});function a(o,u){if(o.size().length!==2)throw new Error("Only two dimensional matrix is supported");yt(u,o.size()[1]);var l=i(0,o.size()[0]),s=new n(l,u),c=o.subset(s);return Pe(c)?c:r([[c]])}}),Wb="diag",GM=["typed","matrix","DenseMatrix","SparseMatrix"],YM=se(Wb,GM,e=>{var{typed:t,matrix:n,DenseMatrix:r,SparseMatrix:i}=e;return t(Wb,{Array:function(s){return a(s,0,st(s),null)},"Array, number":function(s,c){return a(s,c,st(s),null)},"Array, BigNumber":function(s,c){return a(s,c.toNumber(),st(s),null)},"Array, string":function(s,c){return a(s,0,st(s),c)},"Array, number, string":function(s,c,f){return a(s,c,st(s),f)},"Array, BigNumber, string":function(s,c,f){return a(s,c.toNumber(),st(s),f)},Matrix:function(s){return a(s,0,s.size(),s.storage())},"Matrix, number":function(s,c){return a(s,c,s.size(),s.storage())},"Matrix, BigNumber":function(s,c){return a(s,c.toNumber(),s.size(),s.storage())},"Matrix, string":function(s,c){return a(s,0,s.size(),c)},"Matrix, number, string":function(s,c,f){return a(s,c,s.size(),f)},"Matrix, BigNumber, string":function(s,c,f){return a(s,c.toNumber(),s.size(),f)}});function a(l,s,c,f){if(!it(s))throw new TypeError("Second parameter in function diag must be an integer");var d=s>0?s:0,h=s<0?-s:0;switch(c.length){case 1:return o(l,s,f,c[0],h,d);case 2:return u(l,s,f,c,h,d)}throw new RangeError("Matrix for function diag must be 2 dimensional")}function o(l,s,c,f,d,h){var v=[f+d,f+h];if(c&&c!=="sparse"&&c!=="dense")throw new TypeError("Unknown matrix type ".concat(c,'"'));var m=c==="sparse"?i.diagonal(v,l,s):r.diagonal(v,l,s);return c!==null?m:m.valueOf()}function u(l,s,c,f,d,h){if(Pe(l)){var v=l.diagonal(s);return c!==null?c!==v.storage()?n(v,c):v:v.valueOf()}for(var m=Math.min(f[0]-d,f[1]-h),D=[],p=0;p<m;p++)D[p]=l[p+d][p+h];return c!==null?n(D):D}}),Jb="flatten",XM=["typed"],ZM=se(Jb,XM,e=>{var{typed:t}=e;return t(Jb,{Array:function(r){return Rh(r)},Matrix:function(r){return r.create(Rh(r.valueOf(),!0),r.datatype())}})}),eD="getMatrixDataType",QM=["typed"],KM=se(eD,QM,e=>{var{typed:t}=e;return t(eD,{Array:function(r){return oc(r,Fn)},Matrix:function(r){return r.getDataType()}})}),tD="identity",WM=["typed","config","matrix","BigNumber","DenseMatrix","SparseMatrix"],JM=se(tD,WM,e=>{var{typed:t,config:n,matrix:r,BigNumber:i,DenseMatrix:a,SparseMatrix:o}=e;return t(tD,{"":function(){return n.matrix==="Matrix"?r([]):[]},string:function(c){return r(c)},"number | BigNumber":function(c){return l(c,c,n.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, string":function(c,f){return l(c,c,f)},"number | BigNumber, number | BigNumber":function(c,f){return l(c,f,n.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, number | BigNumber, string":function(c,f,d){return l(c,f,d)},Array:function(c){return u(c)},"Array, string":function(c,f){return u(c,f)},Matrix:function(c){return u(c.valueOf(),c.storage())},"Matrix, string":function(c,f){return u(c.valueOf(),f)}});function u(s,c){switch(s.length){case 0:return c?r(c):[];case 1:return l(s[0],s[0],c);case 2:return l(s[0],s[1],c);default:throw new Error("Vector containing two values expected")}}function l(s,c,f){var d=vt(s)||vt(c)?i:null;if(vt(s)&&(s=s.toNumber()),vt(c)&&(c=c.toNumber()),!it(s)||s<1)throw new Error("Parameters in function identity must be positive integers");if(!it(c)||c<1)throw new Error("Parameters in function identity must be positive integers");var h=d?new i(1):1,v=d?new d(0):0,m=[s,c];if(f){if(f==="sparse")return o.diagonal(m,h,0,v);if(f==="dense")return a.diagonal(m,h,0,v);throw new TypeError('Unknown matrix type "'.concat(f,'"'))}for(var D=ac([],m,v),p=s<c?s:c,g=0;g<p;g++)D[g][g]=h;return D}});function nD(){throw new Error('No "bignumber" implementation available')}function e4(){throw new Error('No "fraction" implementation available')}function rD(){throw new Error('No "matrix" implementation available')}var iD="range",t4=["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],n4=se(iD,t4,e=>{var{typed:t,config:n,matrix:r,bignumber:i,smaller:a,smallerEq:o,larger:u,largerEq:l,add:s,isPositive:c}=e;return t(iD,{string:d,"string, boolean":d,number:function(D){throw new TypeError("Too few arguments to function range(): ".concat(D))},boolean:function(D){throw new TypeError("Unexpected type of argument 1 to function range(): ".concat(D,", number|bigint|BigNumber|Fraction"))},"number, number":function(D,p){return f(h(D,p,1,!1))},"number, number, number":function(D,p,g){return f(h(D,p,g,!1))},"number, number, boolean":function(D,p,g){return f(h(D,p,1,g))},"number, number, number, boolean":function(D,p,g,y){return f(h(D,p,g,y))},"bigint, bigint|number":function(D,p){return f(h(D,p,1n,!1))},"number, bigint":function(D,p){return f(h(BigInt(D),p,1n,!1))},"bigint, bigint|number, bigint|number":function(D,p,g){return f(h(D,p,BigInt(g),!1))},"number, bigint, bigint|number":function(D,p,g){return f(h(BigInt(D),p,BigInt(g),!1))},"bigint, bigint|number, boolean":function(D,p,g){return f(h(D,p,1n,g))},"number, bigint, boolean":function(D,p,g){return f(h(BigInt(D),p,1n,g))},"bigint, bigint|number, bigint|number, boolean":function(D,p,g,y){return f(h(D,p,BigInt(g),y))},"number, bigint, bigint|number, boolean":function(D,p,g,y){return f(h(BigInt(D),p,BigInt(g),y))},"BigNumber, BigNumber":function(D,p){var g=D.constructor;return f(h(D,p,new g(1),!1))},"BigNumber, BigNumber, BigNumber":function(D,p,g){return f(h(D,p,g,!1))},"BigNumber, BigNumber, boolean":function(D,p,g){var y=D.constructor;return f(h(D,p,new y(1),g))},"BigNumber, BigNumber, BigNumber, boolean":function(D,p,g,y){return f(h(D,p,g,y))},"Fraction, Fraction":function(D,p){return f(h(D,p,1,!1))},"Fraction, Fraction, Fraction":function(D,p,g){return f(h(D,p,g,!1))},"Fraction, Fraction, boolean":function(D,p,g){return f(h(D,p,1,g))},"Fraction, Fraction, Fraction, boolean":function(D,p,g,y){return f(h(D,p,g,y))},"Unit, Unit, Unit":function(D,p,g){return f(h(D,p,g,!1))},"Unit, Unit, Unit, boolean":function(D,p,g,y){return f(h(D,p,g,y))}});function f(m){return n.matrix==="Matrix"?r?r(m):rD():m}function d(m,D){var p=v(m);if(!p)throw new SyntaxError('String "'+m+'" is no valid range');return n.number==="BigNumber"?(i===void 0&&nD(),f(h(i(p.start),i(p.end),i(p.step)))):f(h(p.start,p.end,p.step,D))}function h(m,D,p,g){for(var y=[],S=c(p)?g?o:a:g?l:u,w=m;S(w,D);)y.push(w),w=s(w,p);return y}function v(m){var D=m.split(":"),p=D.map(function(y){return Number(y)}),g=p.some(function(y){return isNaN(y)});if(g)return null;switch(p.length){case 2:return{start:p[0],end:p[1],step:1};case 3:return{start:p[0],end:p[2],step:p[1]};default:return null}}}),aD="reshape",r4=["typed","isInteger","matrix"],i4=se(aD,r4,e=>{var{typed:t,isInteger:n}=e;return t(aD,{"Matrix, Array":function(i,a){return i.reshape(a,!0)},"Array, Array":function(i,a){return a.forEach(function(o){if(!n(o))throw new TypeError("Invalid size for dimension: "+o)}),Fh(i,a)}})}),oD="size",a4=["typed","config","?matrix"],o4=se(oD,a4,e=>{var{typed:t,config:n,matrix:r}=e;return t(oD,{Matrix:function(a){return a.create(a.size(),"number")},Array:st,string:function(a){return n.matrix==="Array"?[a.length]:r([a.length],"dense","number")},"number | Complex | BigNumber | Unit | boolean | null":function(a){return n.matrix==="Array"?[]:r?r([],"dense","number"):rD()}})}),uD="transpose",u4=["typed","matrix"],l4=se(uD,u4,e=>{var{typed:t,matrix:n}=e;return t(uD,{Array:o=>r(n(o)).valueOf(),Matrix:r,any:Ie});function r(o){var u=o.size(),l;switch(u.length){case 1:l=o.clone();break;case 2:{var s=u[0],c=u[1];if(c===0)throw new RangeError("Cannot transpose a 2D matrix with no columns (size: "+lt(u)+")");switch(o.storage()){case"dense":l=i(o,s,c);break;case"sparse":l=a(o,s,c);break}}break;default:throw new RangeError("Matrix must be a vector or two dimensional (size: "+lt(u)+")")}return l}function i(o,u,l){for(var s=o._data,c=[],f,d=0;d<l;d++){f=c[d]=[];for(var h=0;h<u;h++)f[h]=Ie(s[h][d])}return o.createDenseMatrix({data:c,size:[l,u],datatype:o._datatype})}function a(o,u,l){for(var s=o._values,c=o._index,f=o._ptr,d=s?[]:void 0,h=[],v=[],m=[],D=0;D<u;D++)m[D]=0;var p,g,y;for(p=0,g=c.length;p<g;p++)m[c[p]]++;for(var S=0,w=0;w<u;w++)v.push(S),S+=m[w],m[w]=v[w];for(v.push(S),y=0;y<l;y++)for(var b=f[y],E=f[y+1],C=b;C<E;C++){var A=m[c[C]]++;h[A]=y,s&&(d[A]=Ie(s[C]))}return o.createSparseMatrix({values:d,index:h,ptr:v,size:[l,u],datatype:o._datatype})}}),lD="ctranspose",s4=["typed","transpose","conj"],c4=se(lD,s4,e=>{var{typed:t,transpose:n,conj:r}=e;return t(lD,{any:function(a){return r(n(a))}})}),sD="zeros",f4=["typed","config","matrix","BigNumber"],d4=se(sD,f4,e=>{var{typed:t,config:n,matrix:r,BigNumber:i}=e;return t(sD,{"":function(){return n.matrix==="Array"?a([]):a([],"default")},"...number | BigNumber | string":function(s){var c=s[s.length-1];if(typeof c=="string"){var f=s.pop();return a(s,f)}else return n.matrix==="Array"?a(s):a(s,"default")},Array:a,Matrix:function(s){var c=s.storage();return a(s.valueOf(),c)},"Array | Matrix, string":function(s,c){return a(s.valueOf(),c)}});function a(l,s){var c=o(l),f=c?new i(0):0;if(u(l),s){var d=r(s);return l.length>0?d.resize(l,f):d}else{var h=[];return l.length>0?ac(h,l,f):h}}function o(l){var s=!1;return l.forEach(function(c,f,d){vt(c)&&(s=!0,d[f]=c.toNumber())}),s}function u(l){l.forEach(function(s){if(typeof s!="number"||!it(s)||s<0)throw new Error("Parameters in function zeros must be positive integers")})}});function fc(e,t,n){var r;return String(e).includes("Unexpected type")?(r=arguments.length>2?" (type: "+Fn(n)+", value: "+JSON.stringify(n)+")":" (type: "+e.data.actual+")",new TypeError("Cannot calculate "+t+", unexpected type of argument"+r)):String(e).includes("complex numbers")?(r=arguments.length>2?" (type: "+Fn(n)+", value: "+JSON.stringify(n)+")":"",new TypeError("Cannot calculate "+t+", no ordering relation is defined for complex numbers"+r)):e}var h4="numeric",m4=["number","?bignumber","?fraction"],p4=se(h4,m4,e=>{var{number:t,bignumber:n,fraction:r}=e,i={string:!0,number:!0,BigNumber:!0,Fraction:!0},a={number:o=>t(o),BigNumber:n?o=>n(o):nD,bigint:o=>BigInt(o),Fraction:r?o=>r(o):e4};return function(u){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"number",s=arguments.length>2?arguments[2]:void 0;if(s!==void 0)throw new SyntaxError("numeric() takes one or two arguments");var c=Fn(u);if(!(c in i))throw new TypeError("Cannot convert "+u+' of type "'+c+'"; valid input types are '+Object.keys(i).join(", "));if(!(l in a))throw new TypeError("Cannot convert "+u+' to type "'+l+'"; valid output types are '+Object.keys(a).join(", "));return l===c?u:a[l](u)}}),cD="divideScalar",g4=["typed","numeric"],v4=se(cD,g4,e=>{var{typed:t,numeric:n}=e;return t(cD,{"number, number":function(i,a){return i/a},"Complex, Complex":function(i,a){return i.div(a)},"BigNumber, BigNumber":function(i,a){return i.div(a)},"bigint, bigint":function(i,a){return i/a},"Fraction, Fraction":function(i,a){return i.div(a)},"Unit, number | Complex | Fraction | BigNumber | Unit":(r,i)=>r.divide(i),"number | Fraction | Complex | BigNumber, Unit":(r,i)=>i.divideInto(r)})}),fD="pow",y4=["typed","config","identity","multiply","matrix","inv","fraction","number","Complex"],b4=se(fD,y4,e=>{var{typed:t,config:n,identity:r,multiply:i,matrix:a,inv:o,number:u,fraction:l,Complex:s}=e;return t(fD,{"number, number":c,"Complex, Complex":function(v,m){return v.pow(m)},"BigNumber, BigNumber":function(v,m){return m.isInteger()||v>=0||n.predictable?v.pow(m):new s(v.toNumber(),0).pow(m.toNumber(),0)},"bigint, bigint":(h,v)=>h**v,"Fraction, Fraction":function(v,m){var D=v.pow(m);if(D!=null)return D;if(n.predictable)throw new Error("Result of pow is non-rational and cannot be expressed as a fraction");return c(v.valueOf(),m.valueOf())},"Array, number":f,"Array, BigNumber":function(v,m){return f(v,m.toNumber())},"Matrix, number":d,"Matrix, BigNumber":function(v,m){return d(v,m.toNumber())},"Unit, number | BigNumber":function(v,m){return v.pow(m)}});function c(h,v){if(n.predictable&&!it(v)&&h<0)try{var m=l(v),D=u(m);if((v===D||Math.abs((v-D)/v)<1e-14)&&m.d%2n===1n)return(m.n%2n===0n?1:-1)*Math.pow(-h,v)}catch{}return n.predictable&&(h<-1&&v===1/0||h>-1&&h<0&&v===-1/0)?NaN:it(v)||h>=0||n.predictable?Mb(h,v):h*h<1&&v===1/0||h*h>1&&v===-1/0?0:new s(h,0).pow(v,0)}function f(h,v){if(!it(v))throw new TypeError("For A^b, b must be an integer (value is "+v+")");var m=st(h);if(m.length!==2)throw new Error("For A^b, A must be 2 dimensional (A has "+m.length+" dimensions)");if(m[0]!==m[1])throw new Error("For A^b, A must be square (size is "+m[0]+"x"+m[1]+")");if(v<0)try{return f(o(h),-v)}catch(g){throw g.message==="Cannot calculate inverse, determinant is zero"?new TypeError("For A^b, when A is not invertible, b must be a positive integer (value is "+v+")"):g}for(var D=r(m[0]).valueOf(),p=h;v>=1;)(v&1)===1&&(D=i(p,D)),v>>=1,p=i(p,p);return D}function d(h,v){return a(f(h.valueOf(),v))}});function dD(e){var{DenseMatrix:t}=e;return function(r,i,a){var o=r.size();if(o.length!==2)throw new RangeError("Matrix must be two dimensional (size: "+lt(o)+")");var u=o[0],l=o[1];if(u!==l)throw new RangeError("Matrix must be square (size: "+lt(o)+")");var s=[];if(Pe(i)){var c=i.size(),f=i._data;if(c.length===1){if(c[0]!==u)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var d=0;d<u;d++)s[d]=[f[d]];return new t({data:s,size:[u,1],datatype:i._datatype})}if(c.length===2){if(c[0]!==u||c[1]!==1)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");if(_y(i)){if(a){s=[];for(var h=0;h<u;h++)s[h]=[f[h][0]];return new t({data:s,size:[u,1],datatype:i._datatype})}return i}if(By(i)){for(var v=0;v<u;v++)s[v]=[0];for(var m=i._values,D=i._index,p=i._ptr,g=p[1],y=p[0];y<g;y++){var S=D[y];s[S][0]=m[y]}return new t({data:s,size:[u,1],datatype:i._datatype})}}throw new RangeError("Dimension mismatch. The right side has to be either 1- or 2-dimensional vector.")}if(ht(i)){var w=st(i);if(w.length===1){if(w[0]!==u)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var b=0;b<u;b++)s[b]=[i[b]];return new t({data:s,size:[u,1]})}if(w.length===2){if(w[0]!==u||w[1]!==1)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var E=0;E<u;E++)s[E]=[i[E][0]];return new t({data:s,size:[u,1]})}throw new RangeError("Dimension mismatch. The right side has to be either 1- or 2-dimensional vector.")}}}var hD="usolve",D4=["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],S4=se(hD,D4,e=>{var{typed:t,matrix:n,divideScalar:r,multiplyScalar:i,subtractScalar:a,equalScalar:o,DenseMatrix:u}=e,l=dD({DenseMatrix:u});return t(hD,{"SparseMatrix, Array | Matrix":function(d,h){return c(d,h)},"DenseMatrix, Array | Matrix":function(d,h){return s(d,h)},"Array, Array | Matrix":function(d,h){var v=n(d),m=s(v,h);return m.valueOf()}});function s(f,d){d=l(f,d,!0);for(var h=d._data,v=f._size[0],m=f._size[1],D=[],p=f._data,g=m-1;g>=0;g--){var y=h[g][0]||0,S=void 0;if(o(y,0))S=0;else{var w=p[g][g];if(o(w,0))throw new Error("Linear system cannot be solved since matrix is singular");S=r(y,w);for(var b=g-1;b>=0;b--)h[b]=[a(h[b][0]||0,i(S,p[b][g]))]}D[g]=[S]}return new u({data:D,size:[v,1]})}function c(f,d){d=l(f,d,!0);for(var h=d._data,v=f._size[0],m=f._size[1],D=f._values,p=f._index,g=f._ptr,y=[],S=m-1;S>=0;S--){var w=h[S][0]||0;if(o(w,0))y[S]=[0];else{for(var b=0,E=[],C=[],A=g[S],T=g[S+1],_=T-1;_>=A;_--){var x=p[_];x===S?b=D[_]:x<S&&(E.push(D[_]),C.push(x))}if(o(b,0))throw new Error("Linear system cannot be solved since matrix is singular");for(var F=r(w,b),R=0,z=C.length;R<z;R++){var N=C[R];h[N]=[a(h[N][0],i(F,E[R]))]}y[S]=[F]}}return new u({data:y,size:[v,1]})}}),mD="usolveAll",x4=["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],w4=se(mD,x4,e=>{var{typed:t,matrix:n,divideScalar:r,multiplyScalar:i,subtractScalar:a,equalScalar:o,DenseMatrix:u}=e,l=dD({DenseMatrix:u});return t(mD,{"SparseMatrix, Array | Matrix":function(d,h){return c(d,h)},"DenseMatrix, Array | Matrix":function(d,h){return s(d,h)},"Array, Array | Matrix":function(d,h){var v=n(d),m=s(v,h);return m.map(D=>D.valueOf())}});function s(f,d){for(var h=[l(f,d,!0)._data.map(C=>C[0])],v=f._data,m=f._size[0],D=f._size[1],p=D-1;p>=0;p--)for(var g=h.length,y=0;y<g;y++){var S=h[y];if(o(v[p][p],0))if(o(S[p],0)){if(y===0){var b=[...S];b[p]=1;for(var E=p-1;E>=0;E--)b[E]=a(b[E],v[E][p]);h.push(b)}}else{if(y===0)return[];h.splice(y,1),y-=1,g-=1}else{S[p]=r(S[p],v[p][p]);for(var w=p-1;w>=0;w--)S[w]=a(S[w],i(S[p],v[w][p]))}}return h.map(C=>new u({data:C.map(A=>[A]),size:[m,1]}))}function c(f,d){for(var h=[l(f,d,!0)._data.map(X=>X[0])],v=f._size[0],m=f._size[1],D=f._values,p=f._index,g=f._ptr,y=m-1;y>=0;y--)for(var S=h.length,w=0;w<S;w++){for(var b=h[w],E=[],C=[],A=g[y],T=g[y+1],_=0,x=T-1;x>=A;x--){var F=p[x];F===y?_=D[x]:F<y&&(E.push(D[x]),C.push(F))}if(o(_,0))if(o(b[y],0)){if(w===0){var U=[...b];U[y]=1;for(var I=0,L=C.length;I<L;I++){var G=C[I];U[G]=a(U[G],E[I])}h.push(U)}}else{if(w===0)return[];h.splice(w,1),w-=1,S-=1}else{b[y]=r(b[y],_);for(var R=0,z=C.length;R<z;R++){var N=C[R];b[N]=a(b[N],i(b[y],E[R]))}}}return h.map(X=>new u({data:X.map(P=>[P]),size:[v,1]}))}}),dc="equal",E4=["typed","matrix","equalScalar","DenseMatrix","concat","SparseMatrix"],A4=se(dc,E4,e=>{var{typed:t,matrix:n,equalScalar:r,DenseMatrix:i,concat:a,SparseMatrix:o}=e,u=yo({typed:t}),l=Vu({typed:t,SparseMatrix:o}),s=vo({typed:t,DenseMatrix:i}),c=aa({typed:t,matrix:n,concat:a});return t(dc,C4({typed:t,equalScalar:r}),c({elop:r,SS:l,DS:u,Ss:s}))}),C4=se(dc,["typed","equalScalar"],e=>{var{typed:t,equalScalar:n}=e;return t(dc,{"any, any":function(i,a){return i===null?a===null:a===null?i===null:i===void 0?a===void 0:a===void 0?i===void 0:n(i,a)}})}),hc="smaller",T4=["typed","config","bignumber","matrix","DenseMatrix","concat","SparseMatrix"],M4=se(hc,T4,e=>{var{typed:t,config:n,bignumber:r,matrix:i,DenseMatrix:a,concat:o,SparseMatrix:u}=e,l=yo({typed:t}),s=Vu({typed:t,SparseMatrix:u}),c=vo({typed:t,DenseMatrix:a}),f=aa({typed:t,matrix:i,concat:o}),d=qu({typed:t});function h(v,m){return v.lt(m)&&!go(v,m,n.relTol,n.absTol)}return t(hc,_4({typed:t,config:n}),{"boolean, boolean":(v,m)=>v<m,"BigNumber, BigNumber":h,"bigint, bigint":(v,m)=>v<m,"Fraction, Fraction":(v,m)=>v.compare(m)===-1,"Fraction, BigNumber":function(m,D){return h(r(m),D)},"BigNumber, Fraction":function(m,D){return h(m,r(D))},"Complex, Complex":function(m,D){throw new TypeError("No ordering relation is defined for complex numbers")}},d,f({SS:s,DS:l,Ss:c}))}),_4=se(hc,["typed","config"],e=>{var{typed:t,config:n}=e;return t(hc,{"number, number":function(i,a){return i<a&&!Vr(i,a,n.relTol,n.absTol)}})}),mc="smallerEq",B4=["typed","config","matrix","DenseMatrix","concat","SparseMatrix"],F4=se(mc,B4,e=>{var{typed:t,config:n,matrix:r,DenseMatrix:i,concat:a,SparseMatrix:o}=e,u=yo({typed:t}),l=Vu({typed:t,SparseMatrix:o}),s=vo({typed:t,DenseMatrix:i}),c=aa({typed:t,matrix:r,concat:a}),f=qu({typed:t});return t(mc,N4({typed:t,config:n}),{"boolean, boolean":(d,h)=>d<=h,"BigNumber, BigNumber":function(h,v){return h.lte(v)||go(h,v,n.relTol,n.absTol)},"bigint, bigint":(d,h)=>d<=h,"Fraction, Fraction":(d,h)=>d.compare(h)!==1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},f,c({SS:l,DS:u,Ss:s}))}),N4=se(mc,["typed","config"],e=>{var{typed:t,config:n}=e;return t(mc,{"number, number":function(i,a){return i<=a||Vr(i,a,n.relTol,n.absTol)}})}),pc="larger",R4=["typed","config","bignumber","matrix","DenseMatrix","concat","SparseMatrix"],O4=se(pc,R4,e=>{var{typed:t,config:n,bignumber:r,matrix:i,DenseMatrix:a,concat:o,SparseMatrix:u}=e,l=yo({typed:t}),s=Vu({typed:t,SparseMatrix:u}),c=vo({typed:t,DenseMatrix:a}),f=aa({typed:t,matrix:i,concat:o}),d=qu({typed:t});function h(v,m){return v.gt(m)&&!go(v,m,n.relTol,n.absTol)}return t(pc,z4({typed:t,config:n}),{"boolean, boolean":(v,m)=>v>m,"BigNumber, BigNumber":h,"bigint, bigint":(v,m)=>v>m,"Fraction, Fraction":(v,m)=>v.compare(m)===1,"Fraction, BigNumber":function(m,D){return h(r(m),D)},"BigNumber, Fraction":function(m,D){return h(m,r(D))},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},d,f({SS:s,DS:l,Ss:c}))}),z4=se(pc,["typed","config"],e=>{var{typed:t,config:n}=e;return t(pc,{"number, number":function(i,a){return i>a&&!Vr(i,a,n.relTol,n.absTol)}})}),gc="largerEq",U4=["typed","config","matrix","DenseMatrix","concat","SparseMatrix"],I4=se(gc,U4,e=>{var{typed:t,config:n,matrix:r,DenseMatrix:i,concat:a,SparseMatrix:o}=e,u=yo({typed:t}),l=Vu({typed:t,SparseMatrix:o}),s=vo({typed:t,DenseMatrix:i}),c=aa({typed:t,matrix:r,concat:a}),f=qu({typed:t});return t(gc,$4({typed:t,config:n}),{"boolean, boolean":(d,h)=>d>=h,"BigNumber, BigNumber":function(h,v){return h.gte(v)||go(h,v,n.relTol,n.absTol)},"bigint, bigint":function(h,v){return h>=v},"Fraction, Fraction":(d,h)=>d.compare(h)!==-1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},f,c({SS:l,DS:u,Ss:s}))}),$4=se(gc,["typed","config"],e=>{var{typed:t,config:n}=e;return t(gc,{"number, number":function(i,a){return i>=a||Vr(i,a,n.relTol,n.absTol)}})}),pD="min",k4=["typed","config","numeric","smaller","isNaN"],L4=se(pD,k4,e=>{var{typed:t,config:n,numeric:r,smaller:i,isNaN:a}=e;return t(pD,{"Array | Matrix":u,"Array | Matrix, number | BigNumber":function(s,c){return Sb(s,c.valueOf(),o)},"...":function(s){if(bb(s))throw new TypeError("Scalar values expected in function min");return u(s)}});function o(l,s){try{return i(l,s)?l:s}catch(c){throw fc(c,"min",s)}}function u(l){var s;if(Db(l,function(c){try{(a(c)||s===void 0||i(c,s))&&(s=c)}catch(f){throw fc(f,"min",c)}}),s===void 0)throw new Error("Cannot calculate min of an empty array");return typeof s=="string"&&(s=r(s,MC(s,n))),s}}),j4="ImmutableDenseMatrix",H4=["smaller","DenseMatrix"],P4=se(j4,H4,e=>{var{smaller:t,DenseMatrix:n}=e;function r(i,a){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if(a&&!ar(a))throw new Error("Invalid datatype: "+a);if(Pe(i)||ht(i)){var o=new n(i,a);this._data=o._data,this._size=o._size,this._datatype=o._datatype,this._min=null,this._max=null}else if(i&&ht(i.data)&&ht(i.size))this._data=i.data,this._size=i.size,this._datatype=i.datatype,this._min=typeof i.min<"u"?i.min:null,this._max=typeof i.max<"u"?i.max:null;else{if(i)throw new TypeError("Unsupported type of data ("+Fn(i)+")");this._data=[],this._size=[0],this._datatype=a,this._min=null,this._max=null}}return r.prototype=new n,r.prototype.type="ImmutableDenseMatrix",r.prototype.isImmutableDenseMatrix=!0,r.prototype.subset=function(i){switch(arguments.length){case 1:{var a=n.prototype.subset.call(this,i);return Pe(a)?new r({data:a._data,size:a._size,datatype:a._datatype}):a}case 2:case 3:throw new Error("Cannot invoke set subset on an Immutable Matrix instance");default:throw new SyntaxError("Wrong number of arguments")}},r.prototype.set=function(){throw new Error("Cannot invoke set on an Immutable Matrix instance")},r.prototype.resize=function(){throw new Error("Cannot invoke resize on an Immutable Matrix instance")},r.prototype.reshape=function(){throw new Error("Cannot invoke reshape on an Immutable Matrix instance")},r.prototype.clone=function(){return new r({data:Ie(this._data),size:Ie(this._size),datatype:this._datatype})},r.prototype.toJSON=function(){return{mathjs:"ImmutableDenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},r.fromJSON=function(i){return new r(i)},r.prototype.swapRows=function(){throw new Error("Cannot invoke swapRows on an Immutable Matrix instance")},r.prototype.min=function(){if(this._min===null){var i=null;this.forEach(function(a){(i===null||t(a,i))&&(i=a)}),this._min=i!==null?i:void 0}return this._min},r.prototype.max=function(){if(this._max===null){var i=null;this.forEach(function(a){(i===null||t(i,a))&&(i=a)}),this._max=i!==null?i:void 0}return this._max},r},{isClass:!0}),q4="Index",V4=["ImmutableDenseMatrix","getMatrixDataType"],G4=se(q4,V4,e=>{var{ImmutableDenseMatrix:t,getMatrixDataType:n}=e;function r(a){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");this._dimensions=[],this._sourceSize=[],this._isScalar=!0;for(var o=0,u=arguments.length;o<u;o++){var l=arguments[o],s=ht(l),c=Pe(l),f=typeof l,d=null;if(Fy(l))this._dimensions.push(l),this._isScalar=!1;else if(s||c){var h=void 0;n(l)==="boolean"?(s&&(h=i(gD(l).valueOf())),c&&(h=i(gD(l._data).valueOf())),d=l.valueOf().length):h=i(l.valueOf()),this._dimensions.push(h);var v=h.size();(v.length!==1||v[0]!==1||d!==null)&&(this._isScalar=!1)}else if(f==="number")this._dimensions.push(i([l]));else if(f==="bigint")this._dimensions.push(i([Number(l)]));else if(f==="string")this._dimensions.push(l);else throw new TypeError("Dimension must be an Array, Matrix, number, bigint, string, or Range");this._sourceSize.push(d)}}r.prototype.type="Index",r.prototype.isIndex=!0;function i(a){for(var o=0,u=a.length;o<u;o++)if(typeof a[o]!="number"||!it(a[o]))throw new TypeError("Index parameters must be positive integer numbers");return new t(a)}return r.prototype.clone=function(){var a=new r;return a._dimensions=Ie(this._dimensions),a._isScalar=this._isScalar,a._sourceSize=this._sourceSize,a},r.create=function(a){var o=new r;return r.apply(o,a),o},r.prototype.size=function(){for(var a=[],o=0,u=this._dimensions.length;o<u;o++){var l=this._dimensions[o];a[o]=typeof l=="string"?1:l.size()[0]}return a},r.prototype.max=function(){for(var a=[],o=0,u=this._dimensions.length;o<u;o++){var l=this._dimensions[o];a[o]=typeof l=="string"?l:l.max()}return a},r.prototype.min=function(){for(var a=[],o=0,u=this._dimensions.length;o<u;o++){var l=this._dimensions[o];a[o]=typeof l=="string"?l:l.min()}return a},r.prototype.forEach=function(a){for(var o=0,u=this._dimensions.length;o<u;o++)a(this._dimensions[o],o,this)},r.prototype.dimension=function(a){return typeof a!="number"?null:this._dimensions[a]||null},r.prototype.isObjectProperty=function(){return this._dimensions.length===1&&typeof this._dimensions[0]=="string"},r.prototype.getObjectProperty=function(){return this.isObjectProperty()?this._dimensions[0]:null},r.prototype.isScalar=function(){return this._isScalar},r.prototype.toArray=function(){for(var a=[],o=0,u=this._dimensions.length;o<u;o++){var l=this._dimensions[o];a.push(typeof l=="string"?l:l.toArray())}return a},r.prototype.valueOf=r.prototype.toArray,r.prototype.toString=function(){for(var a=[],o=0,u=this._dimensions.length;o<u;o++){var l=this._dimensions[o];typeof l=="string"?a.push(JSON.stringify(l)):a.push(l.toString())}return"["+a.join(", ")+"]"},r.prototype.toJSON=function(){return{mathjs:"Index",dimensions:this._dimensions}},r.fromJSON=function(a){return r.create(a.dimensions)},r},{isClass:!0});function gD(e){var t=[];return e.forEach((n,r)=>{n&&t.push(r)}),t}var Y4="atan",X4=["typed"],Z4=se(Y4,X4,e=>{var{typed:t}=e;return t("atan",{number:function(r){return Math.atan(r)},Complex:function(r){return r.atan()},BigNumber:function(r){return r.atan()}})}),vD=se("trigUnit",["typed"],e=>{var{typed:t}=e;return{Unit:t.referToSelf(n=>r=>{if(!r.hasBase(r.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function cot is no angle");return t.find(n,r.valueType())(r.value)})}}),yD="cos",Q4=["typed"],K4=se(yD,Q4,e=>{var{typed:t}=e,n=vD({typed:t});return t(yD,{number:Math.cos,"Complex | BigNumber":r=>r.cos()},n)}),bD="sin",W4=["typed"],J4=se(bD,W4,e=>{var{typed:t}=e,n=vD({typed:t});return t(bD,{number:Math.sin,"Complex | BigNumber":r=>r.sin()},n)}),DD="add",e5=["typed","matrix","addScalar","equalScalar","DenseMatrix","SparseMatrix","concat"],t5=se(DD,e5,e=>{var{typed:t,matrix:n,addScalar:r,equalScalar:i,DenseMatrix:a,SparseMatrix:o,concat:u}=e,l=Hb({typed:t}),s=bM({typed:t,equalScalar:i}),c=Pb({typed:t,DenseMatrix:a}),f=aa({typed:t,matrix:n,concat:u});return t(DD,{"any, any":r,"any, any, ...any":t.referToSelf(d=>(h,v,m)=>{for(var D=d(h,v),p=0;p<m.length;p++)D=d(D,m[p]);return D})},f({elop:r,DS:l,SS:s,Ss:c}))}),SD="norm",n5=["typed","abs","add","pow","conj","sqrt","multiply","equalScalar","larger","smaller","matrix","ctranspose","eigs"],r5=se(SD,n5,e=>{var{typed:t,abs:n,add:r,pow:i,conj:a,sqrt:o,multiply:u,equalScalar:l,larger:s,smaller:c,matrix:f,ctranspose:d,eigs:h}=e;return t(SD,{number:Math.abs,Complex:function(C){return C.abs()},BigNumber:function(C){return C.abs()},boolean:function(C){return Math.abs(C)},Array:function(C){return b(f(C),2)},Matrix:function(C){return b(C,2)},"Array, number | BigNumber | string":function(C,A){return b(f(C),A)},"Matrix, number | BigNumber | string":function(C,A){return b(C,A)}});function v(E){var C=0;return E.forEach(function(A){var T=n(A);s(T,C)&&(C=T)},!0),C}function m(E){var C;return E.forEach(function(A){var T=n(A);(!C||c(T,C))&&(C=T)},!0),C||0}function D(E,C){if(C===Number.POSITIVE_INFINITY||C==="inf")return v(E);if(C===Number.NEGATIVE_INFINITY||C==="-inf")return m(E);if(C==="fro")return b(E,2);if(typeof C=="number"&&!isNaN(C)){if(!l(C,0)){var A=0;return E.forEach(function(T){A=r(i(n(T),C),A)},!0),i(A,1/C)}return Number.POSITIVE_INFINITY}throw new Error("Unsupported parameter value")}function p(E){var C=0;return E.forEach(function(A,T){C=r(C,u(A,a(A)))}),n(o(C))}function g(E){var C=[],A=0;return E.forEach(function(T,_){var x=_[1],F=r(C[x]||0,n(T));s(F,A)&&(A=F),C[x]=F},!0),A}function y(E){var C=E.size();if(C[0]!==C[1])throw new RangeError("Invalid matrix dimensions");var A=d(E),T=u(A,E),_=h(T).values.toArray(),x=_[_.length-1];return n(o(x))}function S(E){var C=[],A=0;return E.forEach(function(T,_){var x=_[0],F=r(C[x]||0,n(T));s(F,A)&&(A=F),C[x]=F},!0),A}function w(E,C){if(C===1)return g(E);if(C===Number.POSITIVE_INFINITY||C==="inf")return S(E);if(C==="fro")return p(E);if(C===2)return y(E);throw new Error("Unsupported parameter value "+C)}function b(E,C){var A=E.size();if(A.length===1)return D(E,C);if(A.length===2){if(A[0]&&A[1])return w(E,C);throw new RangeError("Invalid matrix dimensions")}}}),xD="dot",i5=["typed","addScalar","multiplyScalar","conj","size"],a5=se(xD,i5,e=>{var{typed:t,addScalar:n,multiplyScalar:r,conj:i,size:a}=e;return t(xD,{"Array | DenseMatrix, Array | DenseMatrix":u,"SparseMatrix, SparseMatrix":l});function o(c,f){var d=s(c),h=s(f),v,m;if(d.length===1)v=d[0];else if(d.length===2&&d[1]===1)v=d[0];else throw new RangeError("Expected a column vector, instead got a matrix of size ("+d.join(", ")+")");if(h.length===1)m=h[0];else if(h.length===2&&h[1]===1)m=h[0];else throw new RangeError("Expected a column vector, instead got a matrix of size ("+h.join(", ")+")");if(v!==m)throw new RangeError("Vectors must have equal length ("+v+" != "+m+")");if(v===0)throw new RangeError("Cannot calculate the dot product of empty vectors");return v}function u(c,f){var d=o(c,f),h=Pe(c)?c._data:c,v=Pe(c)?c._datatype||c.getDataType():void 0,m=Pe(f)?f._data:f,D=Pe(f)?f._datatype||f.getDataType():void 0,p=s(c).length===2,g=s(f).length===2,y=n,S=r;if(v&&D&&v===D&&typeof v=="string"&&v!=="mixed"){var w=v;y=t.find(n,[w,w]),S=t.find(r,[w,w])}if(!p&&!g){for(var b=S(i(h[0]),m[0]),E=1;E<d;E++)b=y(b,S(i(h[E]),m[E]));return b}if(!p&&g){for(var C=S(i(h[0]),m[0][0]),A=1;A<d;A++)C=y(C,S(i(h[A]),m[A][0]));return C}if(p&&!g){for(var T=S(i(h[0][0]),m[0]),_=1;_<d;_++)T=y(T,S(i(h[_][0]),m[_]));return T}if(p&&g){for(var x=S(i(h[0][0]),m[0][0]),F=1;F<d;F++)x=y(x,S(i(h[F][0]),m[F][0]));return x}}function l(c,f){o(c,f);for(var d=c._index,h=c._values,v=f._index,m=f._values,D=0,p=n,g=r,y=0,S=0;y<d.length&&S<v.length;){var w=d[y],b=v[S];if(w<b){y++;continue}if(w>b){S++;continue}w===b&&(D=p(D,g(h[y],m[S])),y++,S++)}return D}function s(c){return Pe(c)?c.size():a(c)}}),wD="qr",o5=["typed","matrix","zeros","identity","isZero","equal","sign","sqrt","conj","unaryMinus","addScalar","divideScalar","multiplyScalar","subtractScalar","complex"],u5=se(wD,o5,e=>{var{typed:t,matrix:n,zeros:r,identity:i,isZero:a,equal:o,sign:u,sqrt:l,conj:s,unaryMinus:c,addScalar:f,divideScalar:d,multiplyScalar:h,subtractScalar:v,complex:m}=e;return Ci(t(wD,{DenseMatrix:function(S){return p(S)},SparseMatrix:function(S){return g()},Array:function(S){var w=n(S),b=p(w);return{Q:b.Q.valueOf(),R:b.R.valueOf()}}}),{_denseQRimpl:D});function D(y){var S=y._size[0],w=y._size[1],b=i([S],"dense"),E=b._data,C=y.clone(),A=C._data,T,_,x,F=r([S],"");for(x=0;x<Math.min(w,S);++x){var R=A[x][x],z=c(o(R,0)?1:u(R)),N=s(z),U=0;for(T=x;T<S;T++)U=f(U,h(A[T][x],s(A[T][x])));var I=h(z,l(U));if(!a(I)){var L=v(R,I);for(F[x]=1,T=x+1;T<S;T++)F[T]=d(A[T][x],L);var G=c(s(d(L,I))),X=void 0;for(_=x;_<w;_++){for(X=0,T=x;T<S;T++)X=f(X,h(s(F[T]),A[T][_]));for(X=h(X,G),T=x;T<S;T++)A[T][_]=h(v(A[T][_],h(F[T],X)),N)}for(T=0;T<S;T++){for(X=0,_=x;_<S;_++)X=f(X,h(E[T][_],F[_]));for(X=h(X,G),_=x;_<S;++_)E[T][_]=d(v(E[T][_],h(X,s(F[_]))),N)}}}return{Q:b,R:C,toString:function(){return"Q: "+this.Q.toString()+`
67
+ R: `+this.R.toString()}}}function p(y){var S=D(y),w=S.R._data;if(y._data.length>0)for(var b=w[0][0].type==="Complex"?m(0):0,E=0;E<w.length;++E)for(var C=0;C<E&&C<(w[0]||[]).length;++C)w[E][C]=b;return S}function g(y){throw new Error("qr not implemented for sparse matrices yet")}}),ED="det",l5=["typed","matrix","subtractScalar","multiply","divideScalar","isZero","unaryMinus"],s5=se(ED,l5,e=>{var{typed:t,matrix:n,subtractScalar:r,multiply:i,divideScalar:a,isZero:o,unaryMinus:u}=e;return t(ED,{any:function(c){return Ie(c)},"Array | Matrix":function(c){var f;switch(Pe(c)?f=c.size():Array.isArray(c)?(c=n(c),f=c.size()):f=[],f.length){case 0:return Ie(c);case 1:if(f[0]===1)return Ie(c.valueOf()[0]);if(f[0]===0)return 1;throw new RangeError("Matrix must be square (size: "+lt(f)+")");case 2:{var d=f[0],h=f[1];if(d===h)return l(c.clone().valueOf(),d);if(h===0)return 1;throw new RangeError("Matrix must be square (size: "+lt(f)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+lt(f)+")")}}});function l(s,c,f){if(c===1)return Ie(s[0][0]);if(c===2)return r(i(s[0][0],s[1][1]),i(s[1][0],s[0][1]));for(var d=!1,h=new Array(c).fill(0).map((E,C)=>C),v=0;v<c;v++){var m=h[v];if(o(s[m][v])){var D=void 0;for(D=v+1;D<c;D++)if(!o(s[h[D]][v])){m=h[D],h[D]=h[v],h[v]=m,d=!d;break}if(D===c)return s[m][v]}for(var p=s[m][v],g=v===0?1:s[h[v-1]][v-1],y=v+1;y<c;y++)for(var S=h[y],w=v+1;w<c;w++)s[S][w]=a(r(i(s[S][w],p),i(s[S][v],s[m][w])),g)}var b=s[h[c-1]][c-1];return d?u(b):b}}),AD="inv",c5=["typed","matrix","divideScalar","addScalar","multiply","unaryMinus","det","identity","abs"],f5=se(AD,c5,e=>{var{typed:t,matrix:n,divideScalar:r,addScalar:i,multiply:a,unaryMinus:o,det:u,identity:l,abs:s}=e;return t(AD,{"Array | Matrix":function(d){var h=Pe(d)?d.size():st(d);switch(h.length){case 1:if(h[0]===1)return Pe(d)?n([r(1,d.valueOf()[0])]):[r(1,d[0])];throw new RangeError("Matrix must be square (size: "+lt(h)+")");case 2:{var v=h[0],m=h[1];if(v===m)return Pe(d)?n(c(d.valueOf(),v,m),d.storage()):c(d,v,m);throw new RangeError("Matrix must be square (size: "+lt(h)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+lt(h)+")")}},any:function(d){return r(1,d)}});function c(f,d,h){var v,m,D,p,g;if(d===1){if(p=f[0][0],p===0)throw Error("Cannot calculate inverse, determinant is zero");return[[r(1,p)]]}else if(d===2){var y=u(f);if(y===0)throw Error("Cannot calculate inverse, determinant is zero");return[[r(f[1][1],y),r(o(f[0][1]),y)],[r(o(f[1][0]),y),r(f[0][0],y)]]}else{var S=f.concat();for(v=0;v<d;v++)S[v]=S[v].concat();for(var w=l(d).valueOf(),b=0;b<h;b++){var E=s(S[b][b]),C=b;for(v=b+1;v<d;)s(S[v][b])>E&&(E=s(S[v][b]),C=v),v++;if(E===0)throw Error("Cannot calculate inverse, determinant is zero");v=C,v!==b&&(g=S[b],S[b]=S[v],S[v]=g,g=w[b],w[b]=w[v],w[v]=g);var A=S[b],T=w[b];for(v=0;v<d;v++){var _=S[v],x=w[v];if(v!==b){if(_[b]!==0){for(D=r(o(_[b]),A[b]),m=b;m<h;m++)_[m]=i(_[m],a(D,A[m]));for(m=0;m<h;m++)x[m]=i(x[m],a(D,T[m]))}}else{for(D=A[b],m=b;m<h;m++)_[m]=r(_[m],D);for(m=0;m<h;m++)x[m]=r(x[m],D)}}}return w}}});function d5(e){var{addScalar:t,subtract:n,flatten:r,multiply:i,multiplyScalar:a,divideScalar:o,sqrt:u,abs:l,bignumber:s,diag:c,size:f,reshape:d,inv:h,qr:v,usolve:m,usolveAll:D,equal:p,complex:g,larger:y,smaller:S,matrixFromColumns:w,dot:b}=e;function E(P,j,H,k){var q=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,Y=C(P,j,H,k,q);A(P,j,H,k,q,Y);var{values:ee,C:te}=T(P,j,H,k,q);if(q){var ne=_(P,j,te,Y,ee,H,k);return{values:ee,eigenvectors:ne}}return{values:ee}}function C(P,j,H,k,q){var Y=k==="BigNumber",ee=k==="Complex",te=Y?s(0):0,ne=Y?s(1):ee?g(1):1,oe=Y?s(1):1,W=Y?s(10):2,ce=a(W,W),de;q&&(de=Array(j).fill(ne));for(var ve=!1;!ve;){ve=!0;for(var De=0;De<j;De++){for(var Se=te,Ee=te,Re=0;Re<j;Re++)De!==Re&&(Se=t(Se,l(P[Re][De])),Ee=t(Ee,l(P[De][Re])));if(!p(Se,0)&&!p(Ee,0)){for(var Ce=oe,Ne=Se,pe=o(Ee,W),O=a(Ee,W);S(Ne,pe);)Ne=a(Ne,ce),Ce=a(Ce,W);for(;y(Ne,O);)Ne=o(Ne,ce),Ce=o(Ce,W);var $=S(o(t(Ne,Ee),Ce),a(t(Se,Ee),.95));if($){ve=!1;for(var V=o(1,Ce),Z=0;Z<j;Z++)De!==Z&&(P[De][Z]=a(P[De][Z],V),P[Z][De]=a(P[Z][De],Ce));q&&(de[De]=a(de[De],V))}}}}return q?c(de):null}function A(P,j,H,k,q,Y){var ee=k==="BigNumber",te=k==="Complex",ne=ee?s(0):te?g(0):0;ee&&(H=s(H));for(var oe=0;oe<j-2;oe++){for(var W=0,ce=ne,de=oe+1;de<j;de++){var ve=P[de][oe];S(l(ce),l(ve))&&(ce=ve,W=de)}if(!S(l(ce),H)){if(W!==oe+1){var De=P[W];P[W]=P[oe+1],P[oe+1]=De;for(var Se=0;Se<j;Se++){var Ee=P[Se][W];P[Se][W]=P[Se][oe+1],P[Se][oe+1]=Ee}if(q){var Re=Y[W];Y[W]=Y[oe+1],Y[oe+1]=Re}}for(var Ce=oe+2;Ce<j;Ce++){var Ne=o(P[Ce][oe],ce);if(Ne!==0){for(var pe=0;pe<j;pe++)P[Ce][pe]=n(P[Ce][pe],a(Ne,P[oe+1][pe]));for(var O=0;O<j;O++)P[O][oe+1]=t(P[O][oe+1],a(Ne,P[O][Ce]));if(q)for(var $=0;$<j;$++)Y[Ce][$]=n(Y[Ce][$],a(Ne,Y[oe+1][$]))}}}}return Y}function T(P,j,H,k,q){var Y=k==="BigNumber",ee=k==="Complex",te=Y?s(1):ee?g(1):1;Y&&(H=s(H));for(var ne=Ie(P),oe=[],W=j,ce=[],de=q?c(Array(j).fill(te)):void 0,ve=q?c(Array(W).fill(te)):void 0,De=0;De<=100;){De+=1;for(var Se=ne[W-1][W-1],Ee=0;Ee<W;Ee++)ne[Ee][Ee]=n(ne[Ee][Ee],Se);var{Q:Re,R:Ce}=v(ne);ne=i(Ce,Re);for(var Ne=0;Ne<W;Ne++)ne[Ne][Ne]=t(ne[Ne][Ne],Se);if(q&&(ve=i(ve,Re)),W===1||S(l(ne[W-1][W-2]),H)){De=0,oe.push(ne[W-1][W-1]),q&&(ce.unshift([[1]]),R(ve,j),de=i(de,ve),W>1&&(ve=c(Array(W-1).fill(te)))),W-=1,ne.pop();for(var pe=0;pe<W;pe++)ne[pe].pop()}else if(W===2||S(l(ne[W-2][W-3]),H)){De=0;var O=x(ne[W-2][W-2],ne[W-2][W-1],ne[W-1][W-2],ne[W-1][W-1]);oe.push(...O),q&&(ce.unshift(F(ne[W-2][W-2],ne[W-2][W-1],ne[W-1][W-2],ne[W-1][W-1],O[0],O[1],H,k)),R(ve,j),de=i(de,ve),W>2&&(ve=c(Array(W-2).fill(te)))),W-=2,ne.pop(),ne.pop();for(var $=0;$<W;$++)ne[$].pop(),ne[$].pop()}if(W===0)break}if(oe.sort((ae,J)=>+n(l(ae),l(J))),De>100){var V=Error("The eigenvalues failed to converge. Only found these eigenvalues: "+oe.join(", "));throw V.values=oe,V.vectors=[],V}var Z=q?i(de,z(ce,j)):void 0;return{values:oe,C:Z}}function _(P,j,H,k,q,Y,ee){var te=h(H),ne=i(te,P,H),oe=ee==="BigNumber",W=ee==="Complex",ce=oe?s(0):W?g(0):0,de=oe?s(1):W?g(1):1,ve=[],De=[];for(var Se of q){var Ee=N(ve,Se,p);Ee===-1?(ve.push(Se),De.push(1)):De[Ee]+=1}for(var Re=[],Ce=ve.length,Ne=Array(j).fill(ce),pe=c(Array(j).fill(de)),O=function(){var Z=ve[$],ae=n(ne,i(Z,pe)),J=D(ae,Ne);for(J.shift();J.length<De[$];){var me=U(ae,j,J,Y,ee);if(me===null)break;J.push(me)}var le=i(h(k),H);J=J.map(he=>i(le,he)),Re.push(...J.map(he=>({value:Z,vector:r(he)})))},$=0;$<Ce;$++)O();return Re}function x(P,j,H,k){var q=t(P,k),Y=n(a(P,k),a(j,H)),ee=a(q,.5),te=a(u(n(a(q,q),a(4,Y))),.5);return[t(ee,te),n(ee,te)]}function F(P,j,H,k,q,Y,ee,te){var ne=te==="BigNumber",oe=te==="Complex",W=ne?s(0):oe?g(0):0,ce=ne?s(1):oe?g(1):1;if(S(l(H),ee))return[[ce,W],[W,ce]];if(y(l(n(q,Y)),ee))return[[n(q,k),n(Y,k)],[H,H]];var de=n(P,q),ve=n(k,q);return S(l(j),ee)&&S(l(ve),ee)?[[de,ce],[H,W]]:[[j,W],[ve,ce]]}function R(P,j){for(var H=0;H<P.length;H++)P[H].push(...Array(j-P[H].length).fill(0));for(var k=P.length;k<j;k++)P.push(Array(j).fill(0)),P[k][k]=1;return P}function z(P,j){for(var H=[],k=0;k<j;k++)H[k]=Array(j).fill(0);var q=0;for(var Y of P){for(var ee=Y.length,te=0;te<ee;te++)for(var ne=0;ne<ee;ne++)H[q+te][q+ne]=Y[te][ne];q+=ee}return H}function N(P,j,H){for(var k=0;k<P.length;k++)if(H(P[k],j))return k;return-1}function U(P,j,H,k,q){for(var Y=q==="BigNumber"?s(1e3):1e3,ee,te=0;te<5;++te){ee=I(j,H,q);try{ee=m(P,ee)}catch{continue}if(y(G(ee),Y))break}if(te>=5)return null;for(te=0;;){var ne=m(P,ee);if(S(G(L(ee,[ne])),k))break;if(++te>=10)return null;ee=X(ne)}return ee}function I(P,j,H){var k=H==="BigNumber",q=H==="Complex",Y=Array(P).fill(0).map(ee=>2*Math.random()-1);return k&&(Y=Y.map(ee=>s(ee))),q&&(Y=Y.map(ee=>g(ee))),Y=L(Y,j),X(Y,H)}function L(P,j){var H=f(P);for(var k of j)k=d(k,H),P=n(P,i(o(b(k,P),b(k,k)),k));return P}function G(P){return l(u(b(P,P)))}function X(P,j){var H=j==="BigNumber",k=j==="Complex",q=H?s(1):k?g(1):1;return i(o(q,G(P)),P)}return E}function h5(e){var{config:t,addScalar:n,subtract:r,abs:i,atan:a,cos:o,sin:u,multiplyScalar:l,inv:s,bignumber:c,multiply:f,add:d}=e;function h(A,T){var _=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t.relTol,x=arguments.length>3?arguments[3]:void 0,F=arguments.length>4?arguments[4]:void 0;if(x==="number")return v(A,_,F);if(x==="BigNumber")return m(A,_,F);throw TypeError("Unsupported data type: "+x)}function v(A,T,_){var x=A.length,F=Math.abs(T/x),R,z;if(_){z=new Array(x);for(var N=0;N<x;N++)z[N]=Array(x).fill(0),z[N][N]=1}for(var U=b(A);Math.abs(U[1])>=Math.abs(F);){var I=U[0][0],L=U[0][1];R=D(A[I][I],A[L][L],A[I][L]),A=w(A,R,I,L),_&&(z=g(z,R,I,L)),U=b(A)}for(var G=Array(x).fill(0),X=0;X<x;X++)G[X]=A[X][X];return C(Ie(G),z,_)}function m(A,T,_){var x=A.length,F=i(T/x),R,z;if(_){z=new Array(x);for(var N=0;N<x;N++)z[N]=Array(x).fill(0),z[N][N]=1}for(var U=E(A);i(U[1])>=i(F);){var I=U[0][0],L=U[0][1];R=p(A[I][I],A[L][L],A[I][L]),A=S(A,R,I,L),_&&(z=y(z,R,I,L)),U=E(A)}for(var G=Array(x).fill(0),X=0;X<x;X++)G[X]=A[X][X];return C(Ie(G),z,_)}function D(A,T,_){var x=T-A;return Math.abs(x)<=t.relTol?Math.PI/4:.5*Math.atan(2*_/(T-A))}function p(A,T,_){var x=r(T,A);return i(x)<=t.relTol?c(-1).acos().div(4):l(.5,a(f(2,_,s(x))))}function g(A,T,_,x){for(var F=A.length,R=Math.cos(T),z=Math.sin(T),N=Array(F).fill(0),U=Array(F).fill(0),I=0;I<F;I++)N[I]=R*A[I][_]-z*A[I][x],U[I]=z*A[I][_]+R*A[I][x];for(var L=0;L<F;L++)A[L][_]=N[L],A[L][x]=U[L];return A}function y(A,T,_,x){for(var F=A.length,R=o(T),z=u(T),N=Array(F).fill(c(0)),U=Array(F).fill(c(0)),I=0;I<F;I++)N[I]=r(l(R,A[I][_]),l(z,A[I][x])),U[I]=n(l(z,A[I][_]),l(R,A[I][x]));for(var L=0;L<F;L++)A[L][_]=N[L],A[L][x]=U[L];return A}function S(A,T,_,x){for(var F=A.length,R=c(o(T)),z=c(u(T)),N=l(R,R),U=l(z,z),I=Array(F).fill(c(0)),L=Array(F).fill(c(0)),G=f(c(2),R,z,A[_][x]),X=n(r(l(N,A[_][_]),G),l(U,A[x][x])),P=d(l(U,A[_][_]),G,l(N,A[x][x])),j=0;j<F;j++)I[j]=r(l(R,A[_][j]),l(z,A[x][j])),L[j]=n(l(z,A[_][j]),l(R,A[x][j]));A[_][_]=X,A[x][x]=P,A[_][x]=c(0),A[x][_]=c(0);for(var H=0;H<F;H++)H!==_&&H!==x&&(A[_][H]=I[H],A[H][_]=I[H],A[x][H]=L[H],A[H][x]=L[H]);return A}function w(A,T,_,x){for(var F=A.length,R=Math.cos(T),z=Math.sin(T),N=R*R,U=z*z,I=Array(F).fill(0),L=Array(F).fill(0),G=N*A[_][_]-2*R*z*A[_][x]+U*A[x][x],X=U*A[_][_]+2*R*z*A[_][x]+N*A[x][x],P=0;P<F;P++)I[P]=R*A[_][P]-z*A[x][P],L[P]=z*A[_][P]+R*A[x][P];A[_][_]=G,A[x][x]=X,A[_][x]=0,A[x][_]=0;for(var j=0;j<F;j++)j!==_&&j!==x&&(A[_][j]=I[j],A[j][_]=I[j],A[x][j]=L[j],A[j][x]=L[j]);return A}function b(A){for(var T=A.length,_=0,x=[0,1],F=0;F<T;F++)for(var R=F+1;R<T;R++)Math.abs(_)<Math.abs(A[F][R])&&(_=Math.abs(A[F][R]),x=[F,R]);return[x,_]}function E(A){for(var T=A.length,_=0,x=[0,1],F=0;F<T;F++)for(var R=F+1;R<T;R++)i(_)<i(A[F][R])&&(_=i(A[F][R]),x=[F,R]);return[x,_]}function C(A,T,_){var x=A.length,F=Array(x),R;if(_){R=Array(x);for(var z=0;z<x;z++)R[z]=Array(x)}for(var N=0;N<x;N++){for(var U=0,I=A[0],L=0;L<A.length;L++)i(A[L])<i(I)&&(U=L,I=A[U]);if(F[N]=A.splice(U,1)[0],_)for(var G=0;G<x;G++)R[N][G]=T[G][U],T[G].splice(U,1)}if(!_)return{values:F};var X=R.map((P,j)=>({value:F[j],vector:P}));return{values:F,eigenvectors:X}}return h}var m5="eigs",p5=["config","typed","matrix","addScalar","equal","subtract","abs","atan","cos","sin","multiplyScalar","divideScalar","inv","bignumber","multiply","add","larger","column","flatten","number","complex","sqrt","diag","size","reshape","qr","usolve","usolveAll","im","re","smaller","matrixFromColumns","dot"],g5=se(m5,p5,e=>{var{config:t,typed:n,matrix:r,addScalar:i,subtract:a,equal:o,abs:u,atan:l,cos:s,sin:c,multiplyScalar:f,divideScalar:d,inv:h,bignumber:v,multiply:m,add:D,larger:p,column:g,flatten:y,number:S,complex:w,sqrt:b,diag:E,size:C,reshape:A,qr:T,usolve:_,usolveAll:x,im:F,re:R,smaller:z,matrixFromColumns:N,dot:U}=e,I=h5({config:t,addScalar:i,subtract:a,abs:u,atan:l,cos:s,sin:c,multiplyScalar:f,inv:h,bignumber:v,multiply:m,add:D}),L=d5({addScalar:i,subtract:a,multiply:m,multiplyScalar:f,flatten:y,divideScalar:d,sqrt:b,abs:u,bignumber:v,diag:E,size:C,reshape:A,qr:T,inv:h,usolve:_,usolveAll:x,equal:o,complex:w,larger:p,smaller:z,matrixFromColumns:N,dot:U});return n("eigs",{Array:function(Y){return G(r(Y))},"Array, number|BigNumber":function(Y,ee){return G(r(Y),{precision:ee})},"Array, Object"(q,Y){return G(r(q),Y)},Matrix:function(Y){return G(Y,{matricize:!0})},"Matrix, number|BigNumber":function(Y,ee){return G(Y,{precision:ee,matricize:!0})},"Matrix, Object":function(Y,ee){var te={matricize:!0};return Ci(te,ee),G(Y,te)}});function G(q){var Y,ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},te="eigenvectors"in ee?ee.eigenvectors:!0,ne=(Y=ee.precision)!==null&&Y!==void 0?Y:t.relTol,oe=X(q,ne,te);return ee.matricize&&(oe.values=r(oe.values),te&&(oe.eigenvectors=oe.eigenvectors.map(W=>{var{value:ce,vector:de}=W;return{value:ce,vector:r(de)}}))),te&&Object.defineProperty(oe,"vectors",{enumerable:!1,get:()=>{throw new Error("eigs(M).vectors replaced with eigs(M).eigenvectors")}}),oe}function X(q,Y,ee){var te=q.toArray(),ne=q.size();if(ne.length!==2||ne[0]!==ne[1])throw new RangeError("Matrix must be square (size: ".concat(lt(ne),")"));var oe=ne[0];if(j(te,oe,Y)&&(H(te,oe),P(te,oe,Y))){var W=k(q,te,oe);return I(te,oe,Y,W,ee)}var ce=k(q,te,oe);return L(te,oe,Y,ce,ee)}function P(q,Y,ee){for(var te=0;te<Y;te++)for(var ne=te;ne<Y;ne++)if(p(v(u(a(q[te][ne],q[ne][te]))),ee))return!1;return!0}function j(q,Y,ee){for(var te=0;te<Y;te++)for(var ne=0;ne<Y;ne++)if(p(v(u(F(q[te][ne]))),ee))return!1;return!0}function H(q,Y){for(var ee=0;ee<Y;ee++)for(var te=0;te<Y;te++)q[ee][te]=R(q[ee][te])}function k(q,Y,ee){var te=q.datatype();if(te==="number"||te==="BigNumber"||te==="Complex")return te;for(var ne=!1,oe=!1,W=!1,ce=0;ce<ee;ce++)for(var de=0;de<ee;de++){var ve=Y[ce][de];if(et(ve)||gh(ve))ne=!0;else if(vt(ve))oe=!0;else if(ph(ve))W=!0;else throw TypeError("Unsupported type in Matrix: "+Fn(ve))}if(oe&&W&&console.warn("Complex BigNumbers not supported, this operation will lose precission."),W){for(var De=0;De<ee;De++)for(var Se=0;Se<ee;Se++)Y[De][Se]=w(Y[De][Se]);return"Complex"}if(oe){for(var Ee=0;Ee<ee;Ee++)for(var Re=0;Re<ee;Re++)Y[Ee][Re]=v(Y[Ee][Re]);return"BigNumber"}if(ne){for(var Ce=0;Ce<ee;Ce++)for(var Ne=0;Ne<ee;Ne++)Y[Ce][Ne]=S(Y[Ce][Ne]);return"number"}else throw TypeError("Matrix contains unsupported types only.")}}),v5="divide",y5=["typed","matrix","multiply","equalScalar","divideScalar","inv"],b5=se(v5,y5,e=>{var{typed:t,matrix:n,multiply:r,equalScalar:i,divideScalar:a,inv:o}=e,u=jb({typed:t,equalScalar:i}),l=Ih({typed:t});return t("divide",Ny({"Array | Matrix, Array | Matrix":function(c,f){return r(c,o(f))},"DenseMatrix, any":function(c,f){return l(c,f,a,!1)},"SparseMatrix, any":function(c,f){return u(c,f,a,!1)},"Array, any":function(c,f){return l(n(c),f,a,!1).valueOf()},"any, Array | Matrix":function(c,f){return r(c,o(f))}},a.signatures))}),CD="mean",D5=["typed","add","divide"],S5=se(CD,D5,e=>{var{typed:t,add:n,divide:r}=e;return t(CD,{"Array | Matrix":a,"Array | Matrix, number | BigNumber":i,"...":function(u){if(bb(u))throw new TypeError("Scalar values expected in function mean");return a(u)}});function i(o,u){try{var l=Sb(o,u,n),s=Array.isArray(o)?st(o):o.size();return r(l,s[u])}catch(c){throw fc(c,"mean")}}function a(o){var u,l=0;if(Db(o,function(s){try{u=u===void 0?s:n(u,s),l++}catch(c){throw fc(c,"mean",s)}}),l===0)throw new Error("Cannot calculate the mean of an empty array");return r(u,l)}}),Gu=N3({config:Wt}),vc=I3({}),$h=V3({}),kh=X3({}),gn=cT({Matrix:kh}),ye=zC({BigNumber:Gu,Complex:vc,DenseMatrix:gn,Fraction:$h}),Yu=YT({typed:ye}),bo=ZT({typed:ye}),x5=Z4({typed:ye}),Lh=UT({Complex:vc,typed:ye}),yc=IM({typed:ye}),w5=K4({typed:ye}),Sr=xT({config:Wt,typed:ye}),TD=ZM({typed:ye}),E5=KM({typed:ye}),A5=kM({typed:ye}),MD=hT({typed:ye}),C5=pT({config:Wt,typed:ye}),_D=vT({equalScalar:Sr,typed:ye}),Do=EM({typed:ye}),jh=BT({typed:ye}),T5=jM({typed:ye}),M5=MM({BigNumber:Gu,Fraction:$h,complex:Lh,typed:ye}),_5=J4({typed:ye}),Xr=AT({Matrix:kh,equalScalar:Sr,typed:ye}),Xu=KT({typed:ye}),Zu=RT({BigNumber:Gu,typed:ye}),B5=bT({typed:ye}),ze=jT({DenseMatrix:gn,Matrix:kh,SparseMatrix:Xr,typed:ye}),F5=i4({isInteger:MD,matrix:ze,typed:ye}),Hh=FM({Complex:vc,config:Wt,typed:ye}),N5=l4({matrix:ze,typed:ye}),R5=d4({BigNumber:Gu,config:Wt,matrix:ze,typed:ye}),oa=PM({isInteger:MD,matrix:ze,typed:ye}),O5=c4({conj:yc,transpose:N5,typed:ye}),z5=YM({DenseMatrix:gn,SparseMatrix:Xr,matrix:ze,typed:ye}),BD=A4({DenseMatrix:gn,SparseMatrix:Xr,concat:oa,equalScalar:Sr,matrix:ze,typed:ye}),FD=kT({Fraction:$h,typed:ye}),Ph=JM({BigNumber:Gu,DenseMatrix:gn,SparseMatrix:Xr,config:Wt,matrix:ze,typed:ye}),U5=I4({DenseMatrix:gn,SparseMatrix:Xr,concat:oa,config:Wt,matrix:ze,typed:ye}),ND=p4({bignumber:Zu,fraction:FD,number:jh}),qh=o4({matrix:ze,config:Wt,typed:ye}),Qu=M4({DenseMatrix:gn,SparseMatrix:Xr,bignumber:Zu,concat:oa,config:Wt,matrix:ze,typed:ye}),bc=VT({typed:ye}),Dc=t5({DenseMatrix:gn,SparseMatrix:Xr,addScalar:bo,concat:oa,equalScalar:Sr,matrix:ze,typed:ye}),ua=v4({numeric:ND,typed:ye}),I5=P4({DenseMatrix:gn,smaller:Qu}),$5=G4({ImmutableDenseMatrix:I5,getMatrixDataType:E5}),Vh=O4({DenseMatrix:gn,SparseMatrix:Xr,bignumber:Zu,concat:oa,config:Wt,matrix:ze,typed:ye}),k5=PT({flatten:TD,matrix:ze,size:qh,typed:ye}),L5=L4({config:Wt,isNaN:B5,numeric:ND,smaller:Qu,typed:ye}),j5=u5({addScalar:bo,complex:Lh,conj:yc,divideScalar:ua,equal:BD,identity:Ph,isZero:_D,matrix:ze,multiplyScalar:Do,sign:M5,sqrt:Hh,subtractScalar:Xu,typed:ye,unaryMinus:bc,zeros:R5}),H5=F4({DenseMatrix:gn,SparseMatrix:Xr,concat:oa,config:Wt,matrix:ze,typed:ye}),P5=RM({DenseMatrix:gn,concat:oa,equalScalar:Sr,matrix:ze,subtractScalar:Xu,typed:ye,unaryMinus:bc}),q5=S4({DenseMatrix:gn,divideScalar:ua,equalScalar:Sr,matrix:ze,multiplyScalar:Do,subtractScalar:Xu,typed:ye}),RD=a5({addScalar:bo,conj:yc,multiplyScalar:Do,size:qh,typed:ye}),Oi=CM({addScalar:bo,dot:RD,equalScalar:Sr,matrix:ze,multiplyScalar:Do,typed:ye}),V5=n4({bignumber:Zu,matrix:ze,add:Dc,config:Wt,isPositive:C5,larger:Vh,largerEq:U5,smaller:Qu,smallerEq:H5,typed:ye}),G5=w4({DenseMatrix:gn,divideScalar:ua,equalScalar:Sr,matrix:ze,multiplyScalar:Do,subtractScalar:Xu,typed:ye}),Y5=VM({Index:$5,matrix:ze,range:V5,typed:ye}),X5=s5({divideScalar:ua,isZero:_D,matrix:ze,multiply:Oi,subtractScalar:Xu,typed:ye,unaryMinus:bc}),Gh=f5({abs:Yu,addScalar:bo,det:X5,divideScalar:ua,identity:Ph,matrix:ze,multiply:Oi,typed:ye,unaryMinus:bc}),Z5=b4({Complex:vc,config:Wt,fraction:FD,identity:Ph,inv:Gh,matrix:ze,multiply:Oi,number:jh,typed:ye}),Q5=b5({divideScalar:ua,equalScalar:Sr,inv:Gh,matrix:ze,multiply:Oi,typed:ye}),K5=g5({abs:Yu,add:Dc,addScalar:bo,atan:x5,bignumber:Zu,column:Y5,complex:Lh,config:Wt,cos:w5,diag:z5,divideScalar:ua,dot:RD,equal:BD,flatten:TD,im:A5,inv:Gh,larger:Vh,matrix:ze,matrixFromColumns:k5,multiply:Oi,multiplyScalar:Do,number:jh,qr:j5,re:T5,reshape:F5,sin:_5,size:qh,smaller:Qu,sqrt:Hh,subtract:P5,typed:ye,usolve:q5,usolveAll:G5}),W5=S5({add:Dc,divide:Q5,typed:ye}),OD=r5({abs:Yu,add:Dc,conj:yc,ctranspose:O5,eigs:K5,equalScalar:Sr,larger:Vh,matrix:ze,multiply:Oi,pow:Z5,smaller:Qu,sqrt:Hh,typed:ye});ze([[0,0,0],[0,0,0]]);const Sc=e=>Yu(e.xmax-e.xmin),zD=e=>Yu(e.ymax-e.ymin),UD=(e,t)=>[Math.min(e[0],t[0]),Math.min(e[1],t[1]),Math.abs(e[0]-t[0]),Math.abs(e[1]-t[1])],ID=e=>({xmin:e[0],ymin:e[1],xmax:e[0]+e[2],ymax:e[1]+e[3]}),Yh=(e,t)=>!(e.xmax<t.xmin||e.xmin>t.xmax||e.ymax<t.ymin||e.ymin>t.ymax),J5=(e,t)=>t.xmin<e[0]&&e[0]<t.xmax&&Math.min(t.ymin,t.ymax)<e[1]&&e[1]<Math.max(t.ymax,t.ymin),Xh=(e,t)=>{t.length===2&&(t=[t[0],t[1],1]);const n=ze(e),r=ze(t);return Oi(n,r).toArray()},e_=(e,t)=>e.map((n,r)=>[n,t[r]]),Zh=(e,t)=>{const n=ze(e),r=ze([t.map(o=>o[0]),t.map(o=>o[1]),t.map(()=>1)]),[i,a]=Oi(n,r).toArray();return e_(i,a)},t_="rgba(196, 196, 196, 0.5)",$D="COMPUTE_DRAG",kD="END_DRAG",LD="RESET_DRAG",n_="PARTIAL",jD=e=>{const t=e.currentTarget.getBoundingClientRect(),n=[e.clientX-t.x,e.clientY-t.y],r=e.buttons===1,i=e.shiftKey;return{type:n_,mouseButtonIsDown:r,point:n,shift:i}},r_=(e,t)=>{const{dragAnchor:n,dragRect:r}=e,{type:i,mouseButtonIsDown:a,point:o,shift:u}=t,l=4;switch(i){case LD:return{isActive:!1};case kD:return{isActive:!1,dragRect:n&&o?UD(n,o):void 0,shift:u};case $D:if(!a)return{isActive:!1};if(!o)throw Error("ASSERTION FAILED: COMPUTE_DRAG but the mousemove event had no location.");return n?r||Math.abs(o[0]-n[0])>l||Math.abs(o[1]-n[1])>l?{...e,isActive:!0,dragRect:UD(n,o)}:e:{isActive:!1,dragAnchor:o};default:throw Error(`Invalid mode for drag reducer: ${i}`)}},i_=(e,t,n)=>{if(!t||!e||typeof e=="function")return;const r=e.current,i=r&&r.getContext("2d");if(i&&(i.clearRect(0,0,i.canvas.width,i.canvas.height),t.isActive)){const a=t.dragRect||[0,0,0,0];i.fillStyle=n??t_,i.fillRect(a[0],a[1],a[2],a[3])}},HD=e=>{const{nextDragStateUpdate:t,nextFrame:n,reducer:r,reducerOtherProps:i}=e;if(t.current===null)window.cancelAnimationFrame(n.current),n.current=0;else{r({...i,dragAction:t.current});const a=()=>HD(e);n.current=requestAnimationFrame(a)}t.current=null},a_=(e,t)=>{const{nextDragStateUpdate:n,nextFrame:r}=t,i={...jD(e),type:$D};return i.mouseButtonIsDown?(n.current=i,r.current===0&&HD(t),!0):!1},o_=(e,t)=>{const{nextDragStateUpdate:n,reducer:r,reducerOtherProps:i}=t;n.current=null,r({...i,dragAction:{type:LD}})},u_=(e,t)=>{const{nextDragStateUpdate:n,reducer:r,reducerOtherProps:i}=t;n.current=null,r({...i,dragAction:{...jD(e),type:kD}})},l_=e=>{const{width:t,height:n,newState:r,dragStyle:i}=e,a=M.useRef(null),o=M.useMemo(()=>B.jsx("canvas",{ref:a,width:t,height:n,style:{position:"absolute",left:0,top:0}}),[t,n]);return i_(a,r,i),o},s_=e=>{const t=e([0,0]),n=e([1,0]),r=e([0,1]);return[[n[0]-t[0],r[0]-t[0],t[0]],[n[1]-t[1],r[1]-t[1],t[1]],[0,0,1]]},c_=(e,t)=>{e.clearRect(0,0,t.width,t.height);for(const n of t.pixelVerticalLines||[])e.strokeStyle=n.color,e.beginPath(),e.moveTo(n.x,t.margins.top-20),e.lineTo(n.x,t.height-t.margins.bottom),e.stroke();t.barBoxes.forEach(n=>{e.fillStyle=n.color,e.fillRect(n.x1,n.y1,n.x2-n.x1,n.y2-n.y1)}),t.xLabel&&(e.textBaseline="bottom",e.textAlign="center",e.fillStyle="black",e.fillText(t.xLabel,t.width/2,t.height-3));for(const n of t.pixelTicks||[])e.strokeStyle="black",e.beginPath(),e.moveTo(n.x,t.height-t.margins.bottom),e.lineTo(n.x,t.height-t.margins.bottom+6),e.stroke(),e.textBaseline="top",e.textAlign="center",e.fillStyle="black",e.fillText(n.label,n.x,t.height-t.margins.bottom+8)},f_=e=>B.jsx(ir,{width:e.width,height:e.height,draw:c_,drawData:e}),d_={},h_=({bars:e,ticks:t,verticalLines:n,xLabel:r,onSelectRect:i,width:a,height:o})=>{const{xMin:u,xMax:l}=M.useMemo(()=>e.length>0?{xMin:e[0].xStart,xMax:e[e.length-1].xEnd}:{xMin:0,xMax:1},[e]),s=M.useMemo(()=>Math.max(...e.map(b=>b.height)),[e]),{barBoxes:c,margins:f,pixelTicks:d,pixelVerticalLines:h}=M.useMemo(()=>{const b={left:3,right:3,top:5,bottom:3+(r?13:0)+(t?13:0)},E=a-b.left-b.right,C=o-b.top-b.bottom,A=e.map(x=>({key:x.key,x1:b.left+(x.xStart-u)/(l-u)*E,x2:b.left+(x.xEnd-u)/(l-u)*E,y1:b.top+C*(1-x.height/s),y2:b.top+C,tooltip:x.tooltip,color:x.color})),T=t?t.map(x=>({x:b.left+(x.x-u)/(l-u)*E,label:`${x.label}`})):void 0,_=n?n.map(x=>({x:b.left+(x.x-u)/(l-u)*E,color:x.color})):void 0;return{barBoxes:A,margins:b,pixelTicks:T,pixelVerticalLines:_}},[e,t,n,u,l,s,a,o,r]),v=M.useCallback((b,{ctrlKey:E,shiftKey:C})=>{const A=[],T={x:b[0],y:b[1],width:b[2],height:b[3]};for(const _ of c)_.x1<=T.x+T.width&&_.x2>=T.x&&A.push(_.key);i&&i(T,A,{ctrlKey:E,shiftKey:C})},[c,i]),m=M.useCallback(()=>{},[]),{onMouseMove:D,onMouseDown:p,onMouseUp:g,onMouseLeave:y,paintDragSelectLayer:S}=Hs(a,o,v,m),w=M.useMemo(()=>B.jsx(ir,{width:a,height:o,draw:S,drawData:d_}),[a,o,S]);return B.jsxs("div",{style:{width:a,height:o,position:"relative"},onMouseDown:p,onMouseMove:D,onMouseUp:g,onMouseLeave:y,children:[B.jsx(f_,{barBoxes:c,margins:f,pixelTicks:d,pixelVerticalLines:h,xLabel:r,width:a,height:o}),w]})},m_=(e={})=>{const[t,n]=M.useState(!1),[r,i]=M.useState(!1),a=M.useRef(null);return M.useEffect(()=>{const o=a.current;if(!o)return;const u=new IntersectionObserver(([l])=>{const s=l.isIntersecting;n(s),s&&!r&&i(!0)},{threshold:e.threshold||0,root:e.root||null,rootMargin:e.rootMargin||"0px"});return u.observe(o),()=>{u.unobserve(o)}},[e.threshold,e.root,e.rootMargin,r]),{elementRef:a,isVisible:t,hasBeenVisible:r}},p_=({children:e,width:t,height:n})=>{const{elementRef:r,isVisible:i}=m_({threshold:.1});return B.jsx("div",{ref:r,style:{position:"relative",width:t,height:n},children:i?e:B.jsx("span",{children:"Not visible"})})},g_=()=>{},v_=e=>{const{rowStart:t,maxItems:n,plotIds:r,selectedPlotKeys:i,currentPlotKey:a,plotsDict:o,hideBorderColorPlotKeys:u}=e,l=n||r.length,s=r.slice(t,t+l);return B.jsx("div",{style:{display:"flex",flexWrap:"wrap"},children:s.filter(c=>o[c]).map(c=>{let f="plotWrapperStyle";return u?.has(c)?f=f+" plotUnselectableStyle":f=f+" "+(a===c?"plotCurrentStyle":i?.has(c)?"plotSelectedStyle":"plotUnselectedStyle"),B.jsx("div",{style:{flex:"0 0 auto"},children:B.jsx("div",{className:f,children:o[c]})},c)})},t)},xc=({plots:e,plotComponent:t,selectedPlotKeys:n,currentPlotKey:r,numPlotsPerRow:i})=>{const a=t,o=M.useMemo(()=>{const c=new Set;for(const f of e)f.hideBorderColor&&c.add(f.key);return c},[e]),u=M.useMemo(()=>Object.assign({},...e.map(f=>{const d=f.label!==void 0?20:0,h=B.jsx("div",{"data-key":f.key,onClick:f.clickHandler||g_,children:B.jsx(p_,{width:f.props.width,height:f.props.height,children:B.jsxs("span",{children:[f.label!==void 0&&B.jsx("div",{className:"plotLabelStyle",style:{maxWidth:f.props.width,height:d,userSelect:"none"},children:B.jsx("span",{style:{color:f.labelColor},children:f.label||B.jsx("span",{children:" "})})}),B.jsx(a,{...f.props,height:f.props.height?f.props.height-d:f.props.height})]})})});return{[f.key]:h}})),[e,a]),l=Array(e.length).fill(0).map((c,f)=>f).filter(c=>c%(i||e.length)===0),s=M.useMemo(()=>e.map(c=>c.key),[e]);return B.jsx("div",{className:"PlotGrid",style:{display:"flex",flexDirection:"column"},children:l.map(c=>B.jsx(v_,{rowStart:c,maxItems:i,plotIds:s,selectedPlotKeys:n,currentPlotKey:r,hideBorderColorPlotKeys:o,plotsDict:u},`row-${c}`))})},wc=({width:e,height:t,children:n,disableScroll:r})=>{const i=M.useMemo(()=>({width:e-20,height:t,position:"relative",overflowY:r?"hidden":"auto"}),[e,t,r]);return B.jsx("div",{style:i,children:n})};var PD={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},qD=Nt.createContext&&Nt.createContext(PD),y_=["attr","size","title"];function b_(e,t){if(e==null)return{};var n=D_(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function D_(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Ec(){return Ec=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},Ec.apply(this,arguments)}function VD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ac(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?VD(Object(n),!0).forEach(function(r){S_(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function S_(e,t,n){return t=x_(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function x_(e){var t=w_(e,"string");return typeof t=="symbol"?t:t+""}function w_(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function GD(e){return e&&e.map((t,n)=>Nt.createElement(t.tag,Ac({key:n},t.attr),GD(t.child)))}function xr(e){return t=>Nt.createElement(E_,Ec({attr:Ac({},e.attr)},t),GD(e.child))}function E_(e){var t=n=>{var{attr:r,size:i,title:a}=e,o=b_(e,y_),u=i||n.size||"1em",l;return n.className&&(l=n.className),e.className&&(l=(l?l+" ":"")+e.className),Nt.createElement("svg",Ec({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,o,{className:l,style:Ac(Ac({color:e.color||n.color},n.style),e.style),height:u,width:u,xmlns:"http://www.w3.org/2000/svg"}),a&&Nt.createElement("title",null,a),e.children)};return qD!==void 0?Nt.createElement(qD.Consumer,null,n=>t(n)):t(PD)}function A_(e){return xr({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M413.1 222.5l22.2 22.2c9.4 9.4 9.4 24.6 0 33.9L241 473c-9.4 9.4-24.6 9.4-33.9 0L12.7 278.6c-9.4-9.4-9.4-24.6 0-33.9l22.2-22.2c9.5-9.5 25-9.3 34.3.4L184 343.4V56c0-13.3 10.7-24 24-24h32c13.3 0 24 10.7 24 24v287.4l114.8-120.5c9.3-9.8 24.8-10 34.3-.4z"},child:[]}]})(e)}function C_(e){return xr({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M257.5 445.1l-22.2 22.2c-9.4 9.4-24.6 9.4-33.9 0L7 273c-9.4-9.4-9.4-24.6 0-33.9L201.4 44.7c9.4-9.4 24.6-9.4 33.9 0l22.2 22.2c9.5 9.5 9.3 25-.4 34.3L136.6 216H424c13.3 0 24 10.7 24 24v32c0 13.3-10.7 24-24 24H136.6l120.5 114.8c9.8 9.3 10 24.8.4 34.3z"},child:[]}]})(e)}function T_(e){return xr({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z"},child:[]}]})(e)}function M_(e){return xr({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M34.9 289.5l-22.2-22.2c-9.4-9.4-9.4-24.6 0-33.9L207 39c9.4-9.4 24.6-9.4 33.9 0l194.3 194.3c9.4 9.4 9.4 24.6 0 33.9L413 289.4c-9.5 9.5-25 9.3-34.3-.4L264 168.6V456c0 13.3-10.7 24-24 24h-32c-13.3 0-24-10.7-24-24V168.6L69.2 289.1c-9.3 9.8-24.8 10-34.3.4z"},child:[]}]})(e)}function Cc(e){return xr({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"},child:[]}]})(e)}function __(e){return xr({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M497.9 142.1l-46.1 46.1c-4.7 4.7-12.3 4.7-17 0l-111-111c-4.7-4.7-4.7-12.3 0-17l46.1-46.1c18.7-18.7 49.1-18.7 67.9 0l60.1 60.1c18.8 18.7 18.8 49.1 0 67.9zM284.2 99.8L21.6 362.4.4 483.9c-2.9 16.4 11.4 30.6 27.8 27.8l121.5-21.3 262.6-262.6c4.7-4.7 4.7-12.3 0-17l-111-111c-4.8-4.7-12.4-4.7-17.1 0zM124.1 339.9c-5.5-5.5-5.5-14.3 0-19.8l154-154c5.5-5.5 14.3-5.5 19.8 0s5.5 14.3 0 19.8l-154 154c-5.5 5.5-14.3 5.5-19.8 0zM88 424h48v36.3l-64.5 11.3-31.1-31.1L51.7 376H88v48z"},child:[]}]})(e)}function Tc(e){return xr({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"},child:[]}]})(e)}function B_(e){return xr({attr:{viewBox:"0 0 352 512"},child:[{tag:"path",attr:{d:"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"},child:[]}]})(e)}function YD(e){return xr({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16zM53.2 467a48 48 0 0 0 47.9 45h245.8a48 48 0 0 0 47.9-45L416 128H32z"},child:[]}]})(e)}function XD(e){return xr({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200zm101.8-262.2L295.6 256l62.2 62.2c4.7 4.7 4.7 12.3 0 17l-22.6 22.6c-4.7 4.7-12.3 4.7-17 0L256 295.6l-62.2 62.2c-4.7 4.7-12.3 4.7-17 0l-22.6-22.6c-4.7-4.7-4.7-12.3 0-17l62.2-62.2-62.2-62.2c-4.7-4.7-4.7-12.3 0-17l22.6-22.6c4.7-4.7 12.3-4.7 17 0l62.2 62.2 62.2-62.2c4.7-4.7 12.3-4.7 17 0l22.6 22.6c4.7 4.7 4.7 12.3 0 17z"},child:[]}]})(e)}let F_=0,N_=1,Qh;const wr=e=>{Qh===void 0&&(Qh=ZD.length);const t=(F_+e*N_)%Qh;return ZD[t]},ZD=["#00ff00","#ff00ff","#0080ff","#ff8000","#80bf80","#470ba7","#c80b32","#fd7ee5","#027d30","#00ffff","#00ff80","#9c5a86","#808000","#8ed7fa","#80ff00","#6e52ff","#0000ff","#119c9b","#feb982","#56333d","#fb2b97","#8000ff","#c3f1a2","#b3bd25","#45bc2d","#1c4b88","#49f3c0","#a90c9c","#c436ea","#13055b","#7f93d0","#c4552d","#ee7381","#800000","#58fe60","#4f825e","#21bde8","#d7b8e0","#1e40ee","#324a01","#fc2b03","#723cb9","#3a6ac1","#aef14e","#14c568","#bd9c9b","#f9c506","#b579fa","#810e5e","#b38d4d","#854810","#02ea3a","#0b3b3c","#f90161","#07c304","#fe4c54","#be02ea","#0521bb","#338b05","#4989ff","#52b8b3","#be3271","#f1a441","#0b776b","#0ccfac","#cd61bd","#85fc95","#fe43fe","#bd810d","#cce9e6","#644179","#fedfbe","#80bd00","#99c4bd","#48e5fa","#400626","#bcfc01","#866b3f","#5422e9","#ea03bd","#69809a","#bfca76","#40e60e","#f1da52","#3d5f3b","#63b3f8","#7cd83d","#b52f02","#9364ca","#80a740","#3ce183","#a6a9f6","#fba2bb","#e3763f","#ae3cae","#91414a","#1e94cf","#06f6c9"],Ku={black:"#000",white:"#fff"},So={300:"#e57373",400:"#ef5350",500:"#f44336",700:"#d32f2f",800:"#c62828"},xo={50:"#f3e5f5",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",700:"#7b1fa2"},wo={50:"#e3f2fd",200:"#90caf9",400:"#42a5f5",700:"#1976d2",800:"#1565c0"},Eo={300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",700:"#0288d1",900:"#01579b"},Ao={300:"#81c784",400:"#66bb6a",500:"#4caf50",700:"#388e3c",800:"#2e7d32",900:"#1b5e20"},Wu={300:"#ffb74d",400:"#ffa726",500:"#ff9800",700:"#f57c00",900:"#e65100"},R_={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"};function la(e,...t){const n=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(r=>n.searchParams.append("args[]",r)),`Minified MUI error #${e}; visit ${n} for the full message.`}const O_="$$material";function z_(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function U_(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var I_=function(){function e(n){var r=this;this._insertTag=function(i){var a;r.tags.length===0?r.insertionPoint?a=r.insertionPoint.nextSibling:r.prepend?a=r.container.firstChild:a=r.before:a=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(i,a),r.tags.push(i)},this.isSpeedy=n.speedy===void 0?!0:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(r){r.forEach(this._insertTag)},t.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(U_(this));var i=this.tags[this.tags.length-1];if(this.isSpeedy){var a=z_(i);try{a.insertRule(r,a.cssRules.length)}catch{}}else i.appendChild(document.createTextNode(r));this.ctr++},t.flush=function(){this.tags.forEach(function(r){var i;return(i=r.parentNode)==null?void 0:i.removeChild(r)}),this.tags=[],this.ctr=0},e}(),tn="-ms-",Mc="-moz-",je="-webkit-",QD="comm",Kh="rule",Wh="decl",$_="@import",KD="@keyframes",k_="@layer",L_=Math.abs,_c=String.fromCharCode,j_=Object.assign;function H_(e,t){return Zt(e,0)^45?(((t<<2^Zt(e,0))<<2^Zt(e,1))<<2^Zt(e,2))<<2^Zt(e,3):0}function WD(e){return e.trim()}function P_(e,t){return(e=t.exec(e))?e[0]:e}function He(e,t,n){return e.replace(t,n)}function Jh(e,t){return e.indexOf(t)}function Zt(e,t){return e.charCodeAt(t)|0}function Ju(e,t,n){return e.slice(t,n)}function Er(e){return e.length}function em(e){return e.length}function Bc(e,t){return t.push(e),e}function q_(e,t){return e.map(t).join("")}var Fc=1,Co=1,JD=0,vn=0,Bt=0,To="";function Nc(e,t,n,r,i,a,o){return{value:e,root:t,parent:n,type:r,props:i,children:a,line:Fc,column:Co,length:o,return:""}}function el(e,t){return j_(Nc("",null,null,"",null,null,0),e,{length:-e.length},t)}function V_(){return Bt}function G_(){return Bt=vn>0?Zt(To,--vn):0,Co--,Bt===10&&(Co=1,Fc--),Bt}function Nn(){return Bt=vn<JD?Zt(To,vn++):0,Co++,Bt===10&&(Co=1,Fc++),Bt}function Ar(){return Zt(To,vn)}function Rc(){return vn}function tl(e,t){return Ju(To,e,t)}function nl(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function e2(e){return Fc=Co=1,JD=Er(To=e),vn=0,[]}function t2(e){return To="",e}function Oc(e){return WD(tl(vn-1,tm(e===91?e+2:e===40?e+1:e)))}function Y_(e){for(;(Bt=Ar())&&Bt<33;)Nn();return nl(e)>2||nl(Bt)>3?"":" "}function X_(e,t){for(;--t&&Nn()&&!(Bt<48||Bt>102||Bt>57&&Bt<65||Bt>70&&Bt<97););return tl(e,Rc()+(t<6&&Ar()==32&&Nn()==32))}function tm(e){for(;Nn();)switch(Bt){case e:return vn;case 34:case 39:e!==34&&e!==39&&tm(Bt);break;case 40:e===41&&tm(e);break;case 92:Nn();break}return vn}function Z_(e,t){for(;Nn()&&e+Bt!==57;)if(e+Bt===84&&Ar()===47)break;return"/*"+tl(t,vn-1)+"*"+_c(e===47?e:Nn())}function Q_(e){for(;!nl(Ar());)Nn();return tl(e,vn)}function K_(e){return t2(zc("",null,null,null,[""],e=e2(e),0,[0],e))}function zc(e,t,n,r,i,a,o,u,l){for(var s=0,c=0,f=o,d=0,h=0,v=0,m=1,D=1,p=1,g=0,y="",S=i,w=a,b=r,E=y;D;)switch(v=g,g=Nn()){case 40:if(v!=108&&Zt(E,f-1)==58){Jh(E+=He(Oc(g),"&","&\f"),"&\f")!=-1&&(p=-1);break}case 34:case 39:case 91:E+=Oc(g);break;case 9:case 10:case 13:case 32:E+=Y_(v);break;case 92:E+=X_(Rc()-1,7);continue;case 47:switch(Ar()){case 42:case 47:Bc(W_(Z_(Nn(),Rc()),t,n),l);break;default:E+="/"}break;case 123*m:u[s++]=Er(E)*p;case 125*m:case 59:case 0:switch(g){case 0:case 125:D=0;case 59+c:p==-1&&(E=He(E,/\f/g,"")),h>0&&Er(E)-f&&Bc(h>32?r2(E+";",r,n,f-1):r2(He(E," ","")+";",r,n,f-2),l);break;case 59:E+=";";default:if(Bc(b=n2(E,t,n,s,c,i,u,y,S=[],w=[],f),a),g===123)if(c===0)zc(E,t,b,b,S,a,f,u,w);else switch(d===99&&Zt(E,3)===110?100:d){case 100:case 108:case 109:case 115:zc(e,b,b,r&&Bc(n2(e,b,b,0,0,i,u,y,i,S=[],f),w),i,w,f,u,r?S:w);break;default:zc(E,b,b,b,[""],w,0,u,w)}}s=c=h=0,m=p=1,y=E="",f=o;break;case 58:f=1+Er(E),h=v;default:if(m<1){if(g==123)--m;else if(g==125&&m++==0&&G_()==125)continue}switch(E+=_c(g),g*m){case 38:p=c>0?1:(E+="\f",-1);break;case 44:u[s++]=(Er(E)-1)*p,p=1;break;case 64:Ar()===45&&(E+=Oc(Nn())),d=Ar(),c=f=Er(y=E+=Q_(Rc())),g++;break;case 45:v===45&&Er(E)==2&&(m=0)}}return a}function n2(e,t,n,r,i,a,o,u,l,s,c){for(var f=i-1,d=i===0?a:[""],h=em(d),v=0,m=0,D=0;v<r;++v)for(var p=0,g=Ju(e,f+1,f=L_(m=o[v])),y=e;p<h;++p)(y=WD(m>0?d[p]+" "+g:He(g,/&\f/g,d[p])))&&(l[D++]=y);return Nc(e,t,n,i===0?Kh:u,l,s,c)}function W_(e,t,n){return Nc(e,t,n,QD,_c(V_()),Ju(e,2,-2),0)}function r2(e,t,n,r){return Nc(e,t,n,Wh,Ju(e,0,r),Ju(e,r+1,-1),r)}function Mo(e,t){for(var n="",r=em(e),i=0;i<r;i++)n+=t(e[i],i,e,t)||"";return n}function J_(e,t,n,r){switch(e.type){case k_:if(e.children.length)break;case $_:case Wh:return e.return=e.return||e.value;case QD:return"";case KD:return e.return=e.value+"{"+Mo(e.children,r)+"}";case Kh:e.value=e.props.join(",")}return Er(n=Mo(e.children,r))?e.return=e.value+"{"+n+"}":""}function e8(e){var t=em(e);return function(n,r,i,a){for(var o="",u=0;u<t;u++)o+=e[u](n,r,i,a)||"";return o}}function t8(e){return function(t){t.root||(t=t.return)&&e(t)}}function i2(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var n8=function(t,n,r){for(var i=0,a=0;i=a,a=Ar(),i===38&&a===12&&(n[r]=1),!nl(a);)Nn();return tl(t,vn)},r8=function(t,n){var r=-1,i=44;do switch(nl(i)){case 0:i===38&&Ar()===12&&(n[r]=1),t[r]+=n8(vn-1,n,r);break;case 2:t[r]+=Oc(i);break;case 4:if(i===44){t[++r]=Ar()===58?"&\f":"",n[r]=t[r].length;break}default:t[r]+=_c(i)}while(i=Nn());return t},i8=function(t,n){return t2(r8(e2(t),n))},a2=new WeakMap,a8=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var n=t.value,r=t.parent,i=t.column===r.column&&t.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(t.props.length===1&&n.charCodeAt(0)!==58&&!a2.get(r))&&!i){a2.set(t,!0);for(var a=[],o=i8(n,a),u=r.props,l=0,s=0;l<o.length;l++)for(var c=0;c<u.length;c++,s++)t.props[s]=a[l]?o[l].replace(/&\f/g,u[c]):u[c]+" "+o[l]}}},o8=function(t){if(t.type==="decl"){var n=t.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(t.return="",t.value="")}};function o2(e,t){switch(H_(e,t)){case 5103:return je+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return je+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return je+e+Mc+e+tn+e+e;case 6828:case 4268:return je+e+tn+e+e;case 6165:return je+e+tn+"flex-"+e+e;case 5187:return je+e+He(e,/(\w+).+(:[^]+)/,je+"box-$1$2"+tn+"flex-$1$2")+e;case 5443:return je+e+tn+"flex-item-"+He(e,/flex-|-self/,"")+e;case 4675:return je+e+tn+"flex-line-pack"+He(e,/align-content|flex-|-self/,"")+e;case 5548:return je+e+tn+He(e,"shrink","negative")+e;case 5292:return je+e+tn+He(e,"basis","preferred-size")+e;case 6060:return je+"box-"+He(e,"-grow","")+je+e+tn+He(e,"grow","positive")+e;case 4554:return je+He(e,/([^-])(transform)/g,"$1"+je+"$2")+e;case 6187:return He(He(He(e,/(zoom-|grab)/,je+"$1"),/(image-set)/,je+"$1"),e,"")+e;case 5495:case 3959:return He(e,/(image-set\([^]*)/,je+"$1$`$1");case 4968:return He(He(e,/(.+:)(flex-)?(.*)/,je+"box-pack:$3"+tn+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+je+e+e;case 4095:case 3583:case 4068:case 2532:return He(e,/(.+)-inline(.+)/,je+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Er(e)-1-t>6)switch(Zt(e,t+1)){case 109:if(Zt(e,t+4)!==45)break;case 102:return He(e,/(.+:)(.+)-([^]+)/,"$1"+je+"$2-$3$1"+Mc+(Zt(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Jh(e,"stretch")?o2(He(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Zt(e,t+1)!==115)break;case 6444:switch(Zt(e,Er(e)-3-(~Jh(e,"!important")&&10))){case 107:return He(e,":",":"+je)+e;case 101:return He(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+je+(Zt(e,14)===45?"inline-":"")+"box$3$1"+je+"$2$3$1"+tn+"$2box$3")+e}break;case 5936:switch(Zt(e,t+11)){case 114:return je+e+tn+He(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return je+e+tn+He(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return je+e+tn+He(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return je+e+tn+e+e}return e}var u8=function(t,n,r,i){if(t.length>-1&&!t.return)switch(t.type){case Wh:t.return=o2(t.value,t.length);break;case KD:return Mo([el(t,{value:He(t.value,"@","@"+je)})],i);case Kh:if(t.length)return q_(t.props,function(a){switch(P_(a,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Mo([el(t,{props:[He(a,/:(read-\w+)/,":"+Mc+"$1")]})],i);case"::placeholder":return Mo([el(t,{props:[He(a,/:(plac\w+)/,":"+je+"input-$1")]}),el(t,{props:[He(a,/:(plac\w+)/,":"+Mc+"$1")]}),el(t,{props:[He(a,/:(plac\w+)/,tn+"input-$1")]})],i)}return""})}},l8=[u8],s8=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(m){var D=m.getAttribute("data-emotion");D.indexOf(" ")!==-1&&(document.head.appendChild(m),m.setAttribute("data-s",""))})}var i=t.stylisPlugins||l8,a={},o,u=[];o=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(m){for(var D=m.getAttribute("data-emotion").split(" "),p=1;p<D.length;p++)a[D[p]]=!0;u.push(m)});var l,s=[a8,o8];{var c,f=[J_,t8(function(m){c.insert(m)})],d=e8(s.concat(i,f)),h=function(D){return Mo(K_(D),d)};l=function(D,p,g,y){c=g,h(D?D+"{"+p.styles+"}":p.styles),y&&(v.inserted[p.name]=!0)}}var v={key:n,sheet:new I_({key:n,container:o,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:a,registered:{},insert:l};return v.sheet.hydrate(u),v},u2={exports:{}},Ge={};/** @license React v16.13.1
79
68
  * react-is.production.min.js
80
69
  *
81
70
  * Copyright (c) Facebook, Inc. and its affiliates.
82
71
  *
83
72
  * This source code is licensed under the MIT license found in the
84
73
  * LICENSE file in the root directory of this source tree.
85
- */var nn=typeof Symbol=="function"&&Symbol.for,ag=nn?Symbol.for("react.element"):60103,ig=nn?Symbol.for("react.portal"):60106,ad=nn?Symbol.for("react.fragment"):60107,id=nn?Symbol.for("react.strict_mode"):60108,od=nn?Symbol.for("react.profiler"):60114,sd=nn?Symbol.for("react.provider"):60109,ld=nn?Symbol.for("react.context"):60110,og=nn?Symbol.for("react.async_mode"):60111,ud=nn?Symbol.for("react.concurrent_mode"):60111,cd=nn?Symbol.for("react.forward_ref"):60112,fd=nn?Symbol.for("react.suspense"):60113,DO=nn?Symbol.for("react.suspense_list"):60120,dd=nn?Symbol.for("react.memo"):60115,hd=nn?Symbol.for("react.lazy"):60116,SO=nn?Symbol.for("react.block"):60121,wO=nn?Symbol.for("react.fundamental"):60117,xO=nn?Symbol.for("react.responder"):60118,EO=nn?Symbol.for("react.scope"):60119;function Qn(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case ag:switch(e=e.type,e){case og:case ud:case ad:case od:case id:case fd:return e;default:switch(e=e&&e.$$typeof,e){case ld:case cd:case hd:case dd:case sd:return e;default:return t}}case ig:return t}}}function Yx(e){return Qn(e)===ud}tt.AsyncMode=og,tt.ConcurrentMode=ud,tt.ContextConsumer=ld,tt.ContextProvider=sd,tt.Element=ag,tt.ForwardRef=cd,tt.Fragment=ad,tt.Lazy=hd,tt.Memo=dd,tt.Portal=ig,tt.Profiler=od,tt.StrictMode=id,tt.Suspense=fd,tt.isAsyncMode=function(e){return Yx(e)||Qn(e)===og},tt.isConcurrentMode=Yx,tt.isContextConsumer=function(e){return Qn(e)===ld},tt.isContextProvider=function(e){return Qn(e)===sd},tt.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===ag},tt.isForwardRef=function(e){return Qn(e)===cd},tt.isFragment=function(e){return Qn(e)===ad},tt.isLazy=function(e){return Qn(e)===hd},tt.isMemo=function(e){return Qn(e)===dd},tt.isPortal=function(e){return Qn(e)===ig},tt.isProfiler=function(e){return Qn(e)===od},tt.isStrictMode=function(e){return Qn(e)===id},tt.isSuspense=function(e){return Qn(e)===fd},tt.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===ad||e===ud||e===od||e===id||e===fd||e===DO||typeof e=="object"&&e!==null&&(e.$$typeof===hd||e.$$typeof===dd||e.$$typeof===sd||e.$$typeof===ld||e.$$typeof===cd||e.$$typeof===wO||e.$$typeof===xO||e.$$typeof===EO||e.$$typeof===SO)},tt.typeOf=Qn,qx.exports=tt;var AO=qx.exports,Gx=AO,CO={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},TO={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Vx={};Vx[Gx.ForwardRef]=CO,Vx[Gx.Memo]=TO;var MO=!0;function Xx(e,t,n){var r="";return n.split(" ").forEach(function(a){e[a]!==void 0?t.push(e[a]+";"):a&&(r+=a+" ")}),r}var sg=function(t,n,r){var a=t.key+"-"+n.name;(r===!1||MO===!1)&&t.registered[a]===void 0&&(t.registered[a]=n.styles)},Zx=function(t,n,r){sg(t,n,r);var a=t.key+"-"+n.name;if(t.inserted[n.name]===void 0){var i=n;do t.insert(n===i?"."+a:"",i,t.sheet,!0),i=i.next;while(i!==void 0)}};function _O(e){for(var t=0,n,r=0,a=e.length;a>=4;++r,a-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(a){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var NO={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},FO=/[A-Z]|^ms/g,BO=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Kx=function(t){return t.charCodeAt(1)===45},Qx=function(t){return t!=null&&typeof t!="boolean"},lg=Px(function(e){return Kx(e)?e:e.replace(FO,"-$&").toLowerCase()}),Wx=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(BO,function(r,a,i){return Kr={name:a,styles:i,next:Kr},a})}return NO[t]!==1&&!Kx(t)&&typeof n=="number"&&n!==0?n+"px":n};function uu(e,t,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var a=n;if(a.anim===1)return Kr={name:a.name,styles:a.styles,next:Kr},a.name;var i=n;if(i.styles!==void 0){var o=i.next;if(o!==void 0)for(;o!==void 0;)Kr={name:o.name,styles:o.styles,next:Kr},o=o.next;var s=i.styles+";";return s}return OO(e,t,n)}case"function":{if(e!==void 0){var l=Kr,u=n(e);return Kr=l,uu(e,t,u)}break}}var c=n;if(t==null)return c;var f=t[c];return f!==void 0?f:c}function OO(e,t,n){var r="";if(Array.isArray(n))for(var a=0;a<n.length;a++)r+=uu(e,t,n[a])+";";else for(var i in n){var o=n[i];if(typeof o!="object"){var s=o;t!=null&&t[s]!==void 0?r+=i+"{"+t[s]+"}":Qx(s)&&(r+=lg(i)+":"+Wx(i,s)+";")}else if(Array.isArray(o)&&typeof o[0]=="string"&&(t==null||t[o[0]]===void 0))for(var l=0;l<o.length;l++)Qx(o[l])&&(r+=lg(i)+":"+Wx(i,o[l])+";");else{var u=uu(e,t,o);switch(i){case"animation":case"animationName":{r+=lg(i)+":"+u+";";break}default:r+=i+"{"+u+"}"}}}return r}var Jx=/label:\s*([^\s;{]+)\s*(;|$)/g,Kr;function md(e,t,n){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var r=!0,a="";Kr=void 0;var i=e[0];if(i==null||i.raw===void 0)r=!1,a+=uu(n,t,i);else{var o=i;a+=o[0]}for(var s=1;s<e.length;s++)if(a+=uu(n,t,e[s]),r){var l=i;a+=l[s]}Jx.lastIndex=0;for(var u="",c;(c=Jx.exec(a))!==null;)u+="-"+c[1];var f=_O(a)+u;return{name:f,styles:a,next:Kr}}var RO=function(t){return t()},zO=D0.useInsertionEffect?D0.useInsertionEffect:!1,eE=zO||RO,tE=_.createContext(typeof HTMLElement<"u"?bO({key:"css"}):null);tE.Provider;var nE=function(t){return _.forwardRef(function(n,r){var a=_.useContext(tE);return t(n,a,r)})},rE=_.createContext({}),ug={}.hasOwnProperty,cg="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",kO=function(t,n){var r={};for(var a in n)ug.call(n,a)&&(r[a]=n[a]);return r[cg]=t,r},$O=function(t){var n=t.cache,r=t.serialized,a=t.isStringTag;return sg(n,r,a),eE(function(){return Zx(n,r,a)}),null},IO=nE(function(e,t,n){var r=e.css;typeof r=="string"&&t.registered[r]!==void 0&&(r=t.registered[r]);var a=e[cg],i=[r],o="";typeof e.className=="string"?o=Xx(t.registered,i,e.className):e.className!=null&&(o=e.className+" ");var s=md(i,void 0,_.useContext(rE));o+=t.key+"-"+s.name;var l={};for(var u in e)ug.call(e,u)&&u!=="css"&&u!==cg&&(l[u]=e[u]);return l.className=o,n&&(l.ref=n),_.createElement(_.Fragment,null,_.createElement($O,{cache:t,serialized:s,isStringTag:typeof a=="string"}),_.createElement(a,l))}),UO=IO,aE=function(t,n){var r=arguments;if(n==null||!ug.call(n,"css"))return _.createElement.apply(void 0,r);var a=r.length,i=new Array(a);i[0]=UO,i[1]=kO(t,n);for(var o=2;o<a;o++)i[o]=r[o];return _.createElement.apply(null,i)};(function(e){var t;t||(t=e.JSX||(e.JSX={}))})(aE||(aE={}));function _s(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return md(t)}function pi(){var e=_s.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}var LO=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,PO=Px(function(e){return LO.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),jO=PO,HO=function(t){return t!=="theme"},iE=function(t){return typeof t=="string"&&t.charCodeAt(0)>96?jO:HO},oE=function(t,n,r){var a;if(n){var i=n.shouldForwardProp;a=t.__emotion_forwardProp&&i?function(o){return t.__emotion_forwardProp(o)&&i(o)}:i}return typeof a!="function"&&r&&(a=t.__emotion_forwardProp),a},qO=function(t){var n=t.cache,r=t.serialized,a=t.isStringTag;return sg(n,r,a),eE(function(){return Zx(n,r,a)}),null},YO=function e(t,n){var r=t.__emotion_real===t,a=r&&t.__emotion_base||t,i,o;n!==void 0&&(i=n.label,o=n.target);var s=oE(t,n,r),l=s||iE(a),u=!l("as");return function(){var c=arguments,f=r&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(i!==void 0&&f.push("label:"+i+";"),c[0]==null||c[0].raw===void 0)f.push.apply(f,c);else{var d=c[0];f.push(d[0]);for(var h=c.length,g=1;g<h;g++)f.push(c[g],d[g])}var m=nE(function(D,p,v){var y=u&&D.as||a,w="",E=[],b=D;if(D.theme==null){b={};for(var S in D)b[S]=D[S];b.theme=_.useContext(rE)}typeof D.className=="string"?w=Xx(p.registered,E,D.className):D.className!=null&&(w=D.className+" ");var A=md(f.concat(E),p.registered,b);w+=p.key+"-"+A.name,o!==void 0&&(w+=" "+o);var C=u&&s===void 0?iE(y):l,T={};for(var M in D)u&&M==="as"||C(M)&&(T[M]=D[M]);return T.className=w,v&&(T.ref=v),_.createElement(_.Fragment,null,_.createElement(qO,{cache:p,serialized:A,isStringTag:typeof y=="string"}),_.createElement(y,T))});return m.displayName=i!==void 0?i:"Styled("+(typeof a=="string"?a:a.displayName||a.name||"Component")+")",m.defaultProps=t.defaultProps,m.__emotion_real=m,m.__emotion_base=a,m.__emotion_styles=f,m.__emotion_forwardProp=s,Object.defineProperty(m,"toString",{value:function(){return"."+o}}),m.withComponent=function(D,p){var v=e(D,oi({},n,p,{shouldForwardProp:oE(m,p,!0)}));return v.apply(void 0,f)},m}},GO=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],fg=YO.bind(null);GO.forEach(function(e){fg[e]=fg(e)});var sE={exports:{}},VO="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",XO=VO,ZO=XO;function lE(){}function uE(){}uE.resetWarningCache=lE;var KO=function(){function e(r,a,i,o,s,l){if(l!==ZO){var u=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 u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:uE,resetWarningCache:lE};return n.PropTypes=n,n};sE.exports=KO();var QO=sE.exports;const ke=U1(QO);function WO(e,t){return fg(e,t)}function JO(e,t){Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}const cE=[];function Qi(e){return cE[0]=e,md(cE)}var fE={exports:{}},dt={};/**
74
+ */var qt=typeof Symbol=="function"&&Symbol.for,nm=qt?Symbol.for("react.element"):60103,rm=qt?Symbol.for("react.portal"):60106,Uc=qt?Symbol.for("react.fragment"):60107,Ic=qt?Symbol.for("react.strict_mode"):60108,$c=qt?Symbol.for("react.profiler"):60114,kc=qt?Symbol.for("react.provider"):60109,Lc=qt?Symbol.for("react.context"):60110,im=qt?Symbol.for("react.async_mode"):60111,jc=qt?Symbol.for("react.concurrent_mode"):60111,Hc=qt?Symbol.for("react.forward_ref"):60112,Pc=qt?Symbol.for("react.suspense"):60113,c8=qt?Symbol.for("react.suspense_list"):60120,qc=qt?Symbol.for("react.memo"):60115,Vc=qt?Symbol.for("react.lazy"):60116,f8=qt?Symbol.for("react.block"):60121,d8=qt?Symbol.for("react.fundamental"):60117,h8=qt?Symbol.for("react.responder"):60118,m8=qt?Symbol.for("react.scope"):60119;function Rn(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case nm:switch(e=e.type,e){case im:case jc:case Uc:case $c:case Ic:case Pc:return e;default:switch(e=e&&e.$$typeof,e){case Lc:case Hc:case Vc:case qc:case kc:return e;default:return t}}case rm:return t}}}function l2(e){return Rn(e)===jc}Ge.AsyncMode=im,Ge.ConcurrentMode=jc,Ge.ContextConsumer=Lc,Ge.ContextProvider=kc,Ge.Element=nm,Ge.ForwardRef=Hc,Ge.Fragment=Uc,Ge.Lazy=Vc,Ge.Memo=qc,Ge.Portal=rm,Ge.Profiler=$c,Ge.StrictMode=Ic,Ge.Suspense=Pc,Ge.isAsyncMode=function(e){return l2(e)||Rn(e)===im},Ge.isConcurrentMode=l2,Ge.isContextConsumer=function(e){return Rn(e)===Lc},Ge.isContextProvider=function(e){return Rn(e)===kc},Ge.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===nm},Ge.isForwardRef=function(e){return Rn(e)===Hc},Ge.isFragment=function(e){return Rn(e)===Uc},Ge.isLazy=function(e){return Rn(e)===Vc},Ge.isMemo=function(e){return Rn(e)===qc},Ge.isPortal=function(e){return Rn(e)===rm},Ge.isProfiler=function(e){return Rn(e)===$c},Ge.isStrictMode=function(e){return Rn(e)===Ic},Ge.isSuspense=function(e){return Rn(e)===Pc},Ge.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Uc||e===jc||e===$c||e===Ic||e===Pc||e===c8||typeof e=="object"&&e!==null&&(e.$$typeof===Vc||e.$$typeof===qc||e.$$typeof===kc||e.$$typeof===Lc||e.$$typeof===Hc||e.$$typeof===d8||e.$$typeof===h8||e.$$typeof===m8||e.$$typeof===f8)},Ge.typeOf=Rn,u2.exports=Ge;var p8=u2.exports,s2=p8,g8={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},v8={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},c2={};c2[s2.ForwardRef]=g8,c2[s2.Memo]=v8;var y8=!0;function f2(e,t,n){var r="";return n.split(" ").forEach(function(i){e[i]!==void 0?t.push(e[i]+";"):i&&(r+=i+" ")}),r}var am=function(t,n,r){var i=t.key+"-"+n.name;(r===!1||y8===!1)&&t.registered[i]===void 0&&(t.registered[i]=n.styles)},d2=function(t,n,r){am(t,n,r);var i=t.key+"-"+n.name;if(t.inserted[n.name]===void 0){var a=n;do t.insert(n===a?"."+i:"",a,t.sheet,!0),a=a.next;while(a!==void 0)}};function b8(e){for(var t=0,n,r=0,i=e.length;i>=4;++r,i-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var D8={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},S8=/[A-Z]|^ms/g,x8=/_EMO_([^_]+?)_([^]*?)_EMO_/g,h2=function(t){return t.charCodeAt(1)===45},m2=function(t){return t!=null&&typeof t!="boolean"},om=i2(function(e){return h2(e)?e:e.replace(S8,"-$&").toLowerCase()}),p2=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(x8,function(r,i,a){return Cr={name:i,styles:a,next:Cr},i})}return D8[t]!==1&&!h2(t)&&typeof n=="number"&&n!==0?n+"px":n};function rl(e,t,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var i=n;if(i.anim===1)return Cr={name:i.name,styles:i.styles,next:Cr},i.name;var a=n;if(a.styles!==void 0){var o=a.next;if(o!==void 0)for(;o!==void 0;)Cr={name:o.name,styles:o.styles,next:Cr},o=o.next;var u=a.styles+";";return u}return w8(e,t,n)}case"function":{if(e!==void 0){var l=Cr,s=n(e);return Cr=l,rl(e,t,s)}break}}var c=n;if(t==null)return c;var f=t[c];return f!==void 0?f:c}function w8(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i<n.length;i++)r+=rl(e,t,n[i])+";";else for(var a in n){var o=n[a];if(typeof o!="object"){var u=o;t!=null&&t[u]!==void 0?r+=a+"{"+t[u]+"}":m2(u)&&(r+=om(a)+":"+p2(a,u)+";")}else if(Array.isArray(o)&&typeof o[0]=="string"&&(t==null||t[o[0]]===void 0))for(var l=0;l<o.length;l++)m2(o[l])&&(r+=om(a)+":"+p2(a,o[l])+";");else{var s=rl(e,t,o);switch(a){case"animation":case"animationName":{r+=om(a)+":"+s+";";break}default:r+=a+"{"+s+"}"}}}return r}var g2=/label:\s*([^\s;{]+)\s*(;|$)/g,Cr;function Gc(e,t,n){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var r=!0,i="";Cr=void 0;var a=e[0];if(a==null||a.raw===void 0)r=!1,i+=rl(n,t,a);else{var o=a;i+=o[0]}for(var u=1;u<e.length;u++)if(i+=rl(n,t,e[u]),r){var l=a;i+=l[u]}g2.lastIndex=0;for(var s="",c;(c=g2.exec(i))!==null;)s+="-"+c[1];var f=b8(i)+s;return{name:f,styles:i,next:Cr}}var E8=function(t){return t()},A8=Lf.useInsertionEffect?Lf.useInsertionEffect:!1,v2=A8||E8,y2=M.createContext(typeof HTMLElement<"u"?s8({key:"css"}):null);y2.Provider;var b2=function(t){return M.forwardRef(function(n,r){var i=M.useContext(y2);return t(n,i,r)})},D2=M.createContext({}),um={}.hasOwnProperty,lm="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",C8=function(t,n){var r={};for(var i in n)um.call(n,i)&&(r[i]=n[i]);return r[lm]=t,r},T8=function(t){var n=t.cache,r=t.serialized,i=t.isStringTag;return am(n,r,i),v2(function(){return d2(n,r,i)}),null},M8=b2(function(e,t,n){var r=e.css;typeof r=="string"&&t.registered[r]!==void 0&&(r=t.registered[r]);var i=e[lm],a=[r],o="";typeof e.className=="string"?o=f2(t.registered,a,e.className):e.className!=null&&(o=e.className+" ");var u=Gc(a,void 0,M.useContext(D2));o+=t.key+"-"+u.name;var l={};for(var s in e)um.call(e,s)&&s!=="css"&&s!==lm&&(l[s]=e[s]);return l.className=o,n&&(l.ref=n),M.createElement(M.Fragment,null,M.createElement(T8,{cache:t,serialized:u,isStringTag:typeof i=="string"}),M.createElement(i,l))}),_8=M8,S2=function(t,n){var r=arguments;if(n==null||!um.call(n,"css"))return M.createElement.apply(void 0,r);var i=r.length,a=new Array(i);a[0]=_8,a[1]=C8(t,n);for(var o=2;o<i;o++)a[o]=r[o];return M.createElement.apply(null,a)};(function(e){var t;t||(t=e.JSX||(e.JSX={}))})(S2||(S2={}));function sm(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Gc(t)}function il(){var e=sm.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}var B8=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,F8=i2(function(e){return B8.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),N8=F8,R8=function(t){return t!=="theme"},x2=function(t){return typeof t=="string"&&t.charCodeAt(0)>96?N8:R8},w2=function(t,n,r){var i;if(n){var a=n.shouldForwardProp;i=t.__emotion_forwardProp&&a?function(o){return t.__emotion_forwardProp(o)&&a(o)}:a}return typeof i!="function"&&r&&(i=t.__emotion_forwardProp),i},O8=function(t){var n=t.cache,r=t.serialized,i=t.isStringTag;return am(n,r,i),v2(function(){return d2(n,r,i)}),null},z8=function e(t,n){var r=t.__emotion_real===t,i=r&&t.__emotion_base||t,a,o;n!==void 0&&(a=n.label,o=n.target);var u=w2(t,n,r),l=u||x2(i),s=!l("as");return function(){var c=arguments,f=r&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(a!==void 0&&f.push("label:"+a+";"),c[0]==null||c[0].raw===void 0)f.push.apply(f,c);else{var d=c[0];f.push(d[0]);for(var h=c.length,v=1;v<h;v++)f.push(c[v],d[v])}var m=b2(function(D,p,g){var y=s&&D.as||i,S="",w=[],b=D;if(D.theme==null){b={};for(var E in D)b[E]=D[E];b.theme=M.useContext(D2)}typeof D.className=="string"?S=f2(p.registered,w,D.className):D.className!=null&&(S=D.className+" ");var C=Gc(f.concat(w),p.registered,b);S+=p.key+"-"+C.name,o!==void 0&&(S+=" "+o);var A=s&&u===void 0?x2(y):l,T={};for(var _ in D)s&&_==="as"||A(_)&&(T[_]=D[_]);return T.className=S,g&&(T.ref=g),M.createElement(M.Fragment,null,M.createElement(O8,{cache:p,serialized:C,isStringTag:typeof y=="string"}),M.createElement(y,T))});return m.displayName=a!==void 0?a:"Styled("+(typeof i=="string"?i:i.displayName||i.name||"Component")+")",m.defaultProps=t.defaultProps,m.__emotion_real=m,m.__emotion_base=i,m.__emotion_styles=f,m.__emotion_forwardProp=u,Object.defineProperty(m,"toString",{value:function(){return"."+o}}),m.withComponent=function(D,p){var g=e(D,Ci({},n,p,{shouldForwardProp:w2(m,p,!0)}));return g.apply(void 0,f)},m}},U8=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],cm=z8.bind(null);U8.forEach(function(e){cm[e]=cm(e)});function I8(e,t){return cm(e,t)}function $8(e,t){Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}const E2=[];function sa(e){return E2[0]=e,Gc(E2)}var A2={exports:{}},nt={};/**
86
75
  * @license React
87
76
  * react-is.production.js
88
77
  *
@@ -90,14 +79,14 @@ R: `+this.R.toString()}}}function p(y){var w=D(y),E=w.R._data;if(y._data.length>
90
79
  *
91
80
  * This source code is licensed under the MIT license found in the
92
81
  * LICENSE file in the root directory of this source tree.
93
- */var dg=Symbol.for("react.transitional.element"),hg=Symbol.for("react.portal"),pd=Symbol.for("react.fragment"),gd=Symbol.for("react.strict_mode"),vd=Symbol.for("react.profiler"),yd=Symbol.for("react.consumer"),bd=Symbol.for("react.context"),Dd=Symbol.for("react.forward_ref"),Sd=Symbol.for("react.suspense"),wd=Symbol.for("react.suspense_list"),xd=Symbol.for("react.memo"),Ed=Symbol.for("react.lazy"),eR=Symbol.for("react.view_transition"),tR=Symbol.for("react.client.reference");function pr(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case dg:switch(e=e.type,e){case pd:case vd:case gd:case Sd:case wd:case eR:return e;default:switch(e=e&&e.$$typeof,e){case bd:case Dd:case Ed:case xd:return e;case yd:return e;default:return t}}case hg:return t}}}dt.ContextConsumer=yd,dt.ContextProvider=bd,dt.Element=dg,dt.ForwardRef=Dd,dt.Fragment=pd,dt.Lazy=Ed,dt.Memo=xd,dt.Portal=hg,dt.Profiler=vd,dt.StrictMode=gd,dt.Suspense=Sd,dt.SuspenseList=wd,dt.isContextConsumer=function(e){return pr(e)===yd},dt.isContextProvider=function(e){return pr(e)===bd},dt.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===dg},dt.isForwardRef=function(e){return pr(e)===Dd},dt.isFragment=function(e){return pr(e)===pd},dt.isLazy=function(e){return pr(e)===Ed},dt.isMemo=function(e){return pr(e)===xd},dt.isPortal=function(e){return pr(e)===hg},dt.isProfiler=function(e){return pr(e)===vd},dt.isStrictMode=function(e){return pr(e)===gd},dt.isSuspense=function(e){return pr(e)===Sd},dt.isSuspenseList=function(e){return pr(e)===wd},dt.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===pd||e===vd||e===gd||e===Sd||e===wd||typeof e=="object"&&e!==null&&(e.$$typeof===Ed||e.$$typeof===xd||e.$$typeof===bd||e.$$typeof===yd||e.$$typeof===Dd||e.$$typeof===tR||e.getModuleId!==void 0)},dt.typeOf=pr,fE.exports=dt;var dE=fE.exports;function Ea(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 hE(e){if(_.isValidElement(e)||dE.isValidElementType(e)||!Ea(e))return e;const t={};return Object.keys(e).forEach(n=>{t[n]=hE(e[n])}),t}function Wn(e,t,n={clone:!0}){const r=n.clone?{...e}:e;return Ea(e)&&Ea(t)&&Object.keys(t).forEach(a=>{_.isValidElement(t[a])||dE.isValidElementType(t[a])?r[a]=t[a]:Ea(t[a])&&Object.prototype.hasOwnProperty.call(e,a)&&Ea(e[a])?r[a]=Wn(e[a],t[a],n):n.clone?r[a]=Ea(t[a])?hE(t[a]):t[a]:r[a]=t[a]}),r}const nR=e=>{const t=Object.keys(e).map(n=>({key:n,val:e[n]}))||[];return t.sort((n,r)=>n.val-r.val),t.reduce((n,r)=>({...n,[r.key]:r.val}),{})};function rR(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:r=5,...a}=e,i=nR(t),o=Object.keys(i);function s(d){return`@media (min-width:${typeof t[d]=="number"?t[d]:d}${n})`}function l(d){return`@media (max-width:${(typeof t[d]=="number"?t[d]:d)-r/100}${n})`}function u(d,h){const g=o.indexOf(h);return`@media (min-width:${typeof t[d]=="number"?t[d]:d}${n}) and (max-width:${(g!==-1&&typeof t[o[g]]=="number"?t[o[g]]:h)-r/100}${n})`}function c(d){return o.indexOf(d)+1<o.length?u(d,o[o.indexOf(d)+1]):s(d)}function f(d){const h=o.indexOf(d);return h===0?s(o[1]):h===o.length-1?l(o[h]):u(d,o[o.indexOf(d)+1]).replace("@media","@media not all and")}return{keys:o,values:i,up:s,down:l,between:u,only:c,not:f,unit:n,...a}}function mE(e,t){if(!e.containerQueries)return t;const n=Object.keys(t).filter(r=>r.startsWith("@container")).sort((r,a)=>{const i=/min-width:\s*([0-9.]+)/;return+(r.match(i)?.[1]||0)-+(a.match(i)?.[1]||0)});return n.length?n.reduce((r,a)=>{const i=t[a];return delete r[a],r[a]=i,r},{...t}):t}function aR(e,t){return t==="@"||t.startsWith("@")&&(e.some(n=>t.startsWith(`@${n}`))||!!t.match(/^@\d/))}function iR(e,t){const n=t.match(/^@([^/]+)?\/?(.+)?$/);if(!n)return null;const[,r,a]=n,i=Number.isNaN(+r)?r||0:+r;return e.containerQueries(a).up(i)}function oR(e){const t=(i,o)=>i.replace("@media",o?`@container ${o}`:"@container");function n(i,o){i.up=(...s)=>t(e.breakpoints.up(...s),o),i.down=(...s)=>t(e.breakpoints.down(...s),o),i.between=(...s)=>t(e.breakpoints.between(...s),o),i.only=(...s)=>t(e.breakpoints.only(...s),o),i.not=(...s)=>{const l=t(e.breakpoints.not(...s),o);return l.includes("not all and")?l.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):l}}const r={},a=i=>(n(r,i),r);return n(a),{...e,containerQueries:a}}const sR={borderRadius:4};function cu(e,t){return t?Wn(e,t,{clone:!1}):e}const Ad={xs:0,sm:600,md:900,lg:1200,xl:1536},pE={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${Ad[e]}px)`},lR={containerQueries:e=>({up:t=>{let n=typeof t=="number"?t:Ad[t]||t;return typeof n=="number"&&(n=`${n}px`),e?`@container ${e} (min-width:${n})`:`@container (min-width:${n})`}})};function Aa(e,t,n){const r=e.theme||{};if(Array.isArray(t)){const i=r.breakpoints||pE;return t.reduce((o,s,l)=>(o[i.up(i.keys[l])]=n(t[l]),o),{})}if(typeof t=="object"){const i=r.breakpoints||pE;return Object.keys(t).reduce((o,s)=>{if(aR(i.keys,s)){const l=iR(r.containerQueries?r:lR,s);l&&(o[l]=n(t[s],s))}else if(Object.keys(i.values||Ad).includes(s)){const l=i.up(s);o[l]=n(t[s],s)}else{const l=s;o[l]=t[l]}return o},{})}return n(t)}function uR(e={}){return e.keys?.reduce((n,r)=>{const a=e.up(r);return n[a]={},n},{})||{}}function gE(e,t){return e.reduce((n,r)=>{const a=n[r];return(!a||Object.keys(a).length===0)&&delete n[r],n},t)}function Fe(e){if(typeof e!="string")throw new Error(Ki(7));return e.charAt(0).toUpperCase()+e.slice(1)}function Cd(e,t,n=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&n){const r=`vars.${t}`.split(".").reduce((a,i)=>a&&a[i]?a[i]:null,e);if(r!=null)return r}return t.split(".").reduce((r,a)=>r&&r[a]!=null?r[a]:null,e)}function Td(e,t,n,r=n){let a;return typeof e=="function"?a=e(n):Array.isArray(e)?a=e[n]||r:a=Cd(e,n)||r,t&&(a=t(a,r,e)),a}function It(e){const{prop:t,cssProperty:n=e.prop,themeKey:r,transform:a}=e,i=o=>{if(o[t]==null)return null;const s=o[t],l=o.theme,u=Cd(l,r)||{};return Aa(o,s,f=>{let d=Td(u,a,f);return f===d&&typeof f=="string"&&(d=Td(u,a,`${t}${f==="default"?"":Fe(f)}`,f)),n===!1?d:{[n]:d}})};return i.propTypes={},i.filterProps=[t],i}function cR(e){const t={};return n=>(t[n]===void 0&&(t[n]=e(n)),t[n])}const fR={m:"margin",p:"padding"},dR={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},vE={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},hR=cR(e=>{if(e.length>2)if(vE[e])e=vE[e];else return[e];const[t,n]=e.split(""),r=fR[t],a=dR[n]||"";return Array.isArray(a)?a.map(i=>r+i):[r+a]}),mg=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],pg=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...mg,...pg];function fu(e,t,n,r){const a=Cd(e,t,!0)??n;return typeof a=="number"||typeof a=="string"?i=>typeof i=="string"?i:typeof a=="string"?a.startsWith("var(")&&i===0?0:a.startsWith("var(")&&i===1?a:`calc(${i} * ${a})`:a*i:Array.isArray(a)?i=>{if(typeof i=="string")return i;const o=Math.abs(i),s=a[o];return i>=0?s:typeof s=="number"?-s:typeof s=="string"&&s.startsWith("var(")?`calc(-1 * ${s})`:`-${s}`}:typeof a=="function"?a:()=>{}}function gg(e){return fu(e,"spacing",8)}function du(e,t){return typeof t=="string"||t==null?t:e(t)}function mR(e,t){return n=>e.reduce((r,a)=>(r[a]=du(t,n),r),{})}function pR(e,t,n,r){if(!t.includes(n))return null;const a=hR(n),i=mR(a,r),o=e[n];return Aa(e,o,i)}function yE(e,t){const n=gg(e.theme);return Object.keys(e).map(r=>pR(e,t,r,n)).reduce(cu,{})}function Bt(e){return yE(e,mg)}Bt.propTypes={},Bt.filterProps=mg;function Ot(e){return yE(e,pg)}Ot.propTypes={},Ot.filterProps=pg;function bE(e=8,t=gg({spacing:e})){if(e.mui)return e;const n=(...r)=>(r.length===0?[1]:r).map(i=>{const o=t(i);return typeof o=="number"?`${o}px`:o}).join(" ");return n.mui=!0,n}function Md(...e){const t=e.reduce((r,a)=>(a.filterProps.forEach(i=>{r[i]=a}),r),{}),n=r=>Object.keys(r).reduce((a,i)=>t[i]?cu(a,t[i](r)):a,{});return n.propTypes={},n.filterProps=e.reduce((r,a)=>r.concat(a.filterProps),[]),n}function gr(e){return typeof e!="number"?e:`${e}px solid`}function vr(e,t){return It({prop:e,themeKey:"borders",transform:t})}const gR=vr("border",gr),vR=vr("borderTop",gr),yR=vr("borderRight",gr),bR=vr("borderBottom",gr),DR=vr("borderLeft",gr),SR=vr("borderColor"),wR=vr("borderTopColor"),xR=vr("borderRightColor"),ER=vr("borderBottomColor"),AR=vr("borderLeftColor"),CR=vr("outline",gr),TR=vr("outlineColor"),_d=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=fu(e.theme,"shape.borderRadius",4),n=r=>({borderRadius:du(t,r)});return Aa(e,e.borderRadius,n)}return null};_d.propTypes={},_d.filterProps=["borderRadius"],Md(gR,vR,yR,bR,DR,SR,wR,xR,ER,AR,_d,CR,TR);const Nd=e=>{if(e.gap!==void 0&&e.gap!==null){const t=fu(e.theme,"spacing",8),n=r=>({gap:du(t,r)});return Aa(e,e.gap,n)}return null};Nd.propTypes={},Nd.filterProps=["gap"];const Fd=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=fu(e.theme,"spacing",8),n=r=>({columnGap:du(t,r)});return Aa(e,e.columnGap,n)}return null};Fd.propTypes={},Fd.filterProps=["columnGap"];const Bd=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=fu(e.theme,"spacing",8),n=r=>({rowGap:du(t,r)});return Aa(e,e.rowGap,n)}return null};Bd.propTypes={},Bd.filterProps=["rowGap"];const MR=It({prop:"gridColumn"}),_R=It({prop:"gridRow"}),NR=It({prop:"gridAutoFlow"}),FR=It({prop:"gridAutoColumns"}),BR=It({prop:"gridAutoRows"}),OR=It({prop:"gridTemplateColumns"}),RR=It({prop:"gridTemplateRows"}),zR=It({prop:"gridTemplateAreas"}),kR=It({prop:"gridArea"});Md(Nd,Fd,Bd,MR,_R,NR,FR,BR,OR,RR,zR,kR);function Ns(e,t){return t==="grey"?t:e}const $R=It({prop:"color",themeKey:"palette",transform:Ns}),IR=It({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:Ns}),UR=It({prop:"backgroundColor",themeKey:"palette",transform:Ns});Md($R,IR,UR);function Jn(e){return e<=1&&e!==0?`${e*100}%`:e}const LR=It({prop:"width",transform:Jn}),vg=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=n=>{const r=e.theme?.breakpoints?.values?.[n]||Ad[n];return r?e.theme?.breakpoints?.unit!=="px"?{maxWidth:`${r}${e.theme.breakpoints.unit}`}:{maxWidth:r}:{maxWidth:Jn(n)}};return Aa(e,e.maxWidth,t)}return null};vg.filterProps=["maxWidth"];const PR=It({prop:"minWidth",transform:Jn}),jR=It({prop:"height",transform:Jn}),HR=It({prop:"maxHeight",transform:Jn}),qR=It({prop:"minHeight",transform:Jn});It({prop:"size",cssProperty:"width",transform:Jn}),It({prop:"size",cssProperty:"height",transform:Jn});const YR=It({prop:"boxSizing"});Md(LR,vg,PR,jR,HR,qR,YR);const Od={border:{themeKey:"borders",transform:gr},borderTop:{themeKey:"borders",transform:gr},borderRight:{themeKey:"borders",transform:gr},borderBottom:{themeKey:"borders",transform:gr},borderLeft:{themeKey:"borders",transform:gr},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:gr},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:_d},color:{themeKey:"palette",transform:Ns},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:Ns},backgroundColor:{themeKey:"palette",transform:Ns},p:{style:Ot},pt:{style:Ot},pr:{style:Ot},pb:{style:Ot},pl:{style:Ot},px:{style:Ot},py:{style:Ot},padding:{style:Ot},paddingTop:{style:Ot},paddingRight:{style:Ot},paddingBottom:{style:Ot},paddingLeft:{style:Ot},paddingX:{style:Ot},paddingY:{style:Ot},paddingInline:{style:Ot},paddingInlineStart:{style:Ot},paddingInlineEnd:{style:Ot},paddingBlock:{style:Ot},paddingBlockStart:{style:Ot},paddingBlockEnd:{style:Ot},m:{style:Bt},mt:{style:Bt},mr:{style:Bt},mb:{style:Bt},ml:{style:Bt},mx:{style:Bt},my:{style:Bt},margin:{style:Bt},marginTop:{style:Bt},marginRight:{style:Bt},marginBottom:{style:Bt},marginLeft:{style:Bt},marginX:{style:Bt},marginY:{style:Bt},marginInline:{style:Bt},marginInlineStart:{style:Bt},marginInlineEnd:{style:Bt},marginBlock:{style:Bt},marginBlockStart:{style:Bt},marginBlockEnd:{style:Bt},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:Nd},rowGap:{style:Bd},columnGap:{style:Fd},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:Jn},maxWidth:{style:vg},minWidth:{transform:Jn},height:{transform:Jn},maxHeight:{transform:Jn},minHeight:{transform:Jn},boxSizing:{},font:{themeKey:"font"},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function GR(...e){const t=e.reduce((r,a)=>r.concat(Object.keys(a)),[]),n=new Set(t);return e.every(r=>n.size===Object.keys(r).length)}function VR(e,t){return typeof e=="function"?e(t):e}function XR(){function e(n,r,a,i){const o={[n]:r,theme:a},s=i[n];if(!s)return{[n]:r};const{cssProperty:l=n,themeKey:u,transform:c,style:f}=s;if(r==null)return null;if(u==="typography"&&r==="inherit")return{[n]:r};const d=Cd(a,u)||{};return f?f(o):Aa(o,r,g=>{let m=Td(d,c,g);return g===m&&typeof g=="string"&&(m=Td(d,c,`${n}${g==="default"?"":Fe(g)}`,g)),l===!1?m:{[l]:m}})}function t(n){const{sx:r,theme:a={},nested:i}=n||{};if(!r)return null;const o=a.unstable_sxConfig??Od;function s(l){let u=l;if(typeof l=="function")u=l(a);else if(typeof l!="object")return l;if(!u)return null;const c=uR(a.breakpoints),f=Object.keys(c);let d=c;return Object.keys(u).forEach(h=>{const g=VR(u[h],a);if(g!=null)if(typeof g=="object")if(o[h])d=cu(d,e(h,g,a,o));else{const m=Aa({theme:a},g,D=>({[h]:D}));GR(m,g)?d[h]=t({sx:g,theme:a,nested:!0}):d=cu(d,m)}else d=cu(d,e(h,g,a,o))}),!i&&a.modularCssLayers?{"@layer sx":mE(a,gE(f,d))}:mE(a,gE(f,d))}return Array.isArray(r)?r.map(s):s(r)}return t}const Fs=XR();Fs.filterProps=["sx"];function ZR(e,t){const n=this;if(n.vars){if(!n.colorSchemes?.[e]||typeof n.getColorSchemeSelector!="function")return{};let r=n.getColorSchemeSelector(e);return r==="&"?t:((r.includes("data-")||r.includes("."))&&(r=`*:where(${r.replace(/\s*&$/,"")}) &`),{[r]:t})}return n.palette.mode===e?t:{}}function DE(e={},...t){const{breakpoints:n={},palette:r={},spacing:a,shape:i={},...o}=e,s=rR(n),l=bE(a);let u=Wn({breakpoints:s,direction:"ltr",components:{},palette:{mode:"light",...r},spacing:l,shape:{...sR,...i}},o);return u=oR(u),u.applyStyles=ZR,u=t.reduce((c,f)=>Wn(c,f),u),u.unstable_sxConfig={...Od,...o?.unstable_sxConfig},u.unstable_sx=function(f){return Fs({sx:f,theme:this})},u}const SE=e=>e,KR=(()=>{let e=SE;return{configure(t){e=t},generate(t){return e(t)},reset(){e=SE}}})();function wE(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=wE(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function st(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=wE(e))&&(r&&(r+=" "),r+=t);return r}const QR={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function yn(e,t,n="Mui"){const r=QR[t];return r?`${n}-${r}`:`${KR.generate(e)}-${t}`}function bn(e,t,n="Mui"){const r={};return t.forEach(a=>{r[a]=yn(e,a,n)}),r}function xE(e){const{variants:t,...n}=e,r={variants:t,style:Qi(n),isProcessed:!0};return r.style===n||t&&t.forEach(a=>{typeof a.style!="function"&&(a.style=Qi(a.style))}),r}const WR=DE();function yg(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}function Wi(e,t){return t&&e&&typeof e=="object"&&e.styles&&!e.styles.startsWith("@layer")&&(e.styles=`@layer ${t}{${String(e.styles)}}`),e}function JR(e){return e?(t,n)=>n[e]:null}function ez(e,t,n){e.theme=rz(e.theme)?n:e.theme[t]||e.theme}function Rd(e,t,n){const r=typeof t=="function"?t(e):t;if(Array.isArray(r))return r.flatMap(a=>Rd(e,a,n));if(Array.isArray(r?.variants)){let a;if(r.isProcessed)a=n?Wi(r.style,n):r.style;else{const{variants:i,...o}=r;a=n?Wi(Qi(o),n):o}return EE(e,r.variants,[a],n)}return r?.isProcessed?n?Wi(Qi(r.style),n):r.style:n?Wi(Qi(r),n):r}function EE(e,t,n=[],r=void 0){let a;e:for(let i=0;i<t.length;i+=1){const o=t[i];if(typeof o.props=="function"){if(a??={...e,...e.ownerState,ownerState:e.ownerState},!o.props(a))continue}else for(const s in o.props)if(e[s]!==o.props[s]&&e.ownerState?.[s]!==o.props[s])continue e;typeof o.style=="function"?(a??={...e,...e.ownerState,ownerState:e.ownerState},n.push(r?Wi(Qi(o.style(a)),r):o.style(a))):n.push(r?Wi(Qi(o.style),r):o.style)}return n}function tz(e={}){const{themeId:t,defaultTheme:n=WR,rootShouldForwardProp:r=yg,slotShouldForwardProp:a=yg}=e;function i(s){ez(s,t,n)}return(s,l={})=>{JO(s,b=>b.filter(S=>S!==Fs));const{name:u,slot:c,skipVariantsResolver:f,skipSx:d,overridesResolver:h=JR(iz(c)),...g}=l,m=u&&u.startsWith("Mui")||c?"components":"custom",D=f!==void 0?f:c&&c!=="Root"&&c!=="root"||!1,p=d||!1;let v=yg;c==="Root"||c==="root"?v=r:c?v=a:az(s)&&(v=void 0);const y=WO(s,{shouldForwardProp:v,label:nz(),...g}),w=b=>{if(b.__emotion_real===b)return b;if(typeof b=="function")return function(A){return Rd(A,b,A.theme.modularCssLayers?m:void 0)};if(Ea(b)){const S=xE(b);return function(C){return S.variants?Rd(C,S,C.theme.modularCssLayers?m:void 0):C.theme.modularCssLayers?Wi(S.style,m):S.style}}return b},E=(...b)=>{const S=[],A=b.map(w),C=[];if(S.push(i),u&&h&&C.push(function(N){const z=N.theme.components?.[u]?.styleOverrides;if(!z)return null;const B={};for(const k in z)B[k]=Rd(N,z[k],N.theme.modularCssLayers?"theme":void 0);return h(N,B)}),u&&!D&&C.push(function(N){const z=N.theme?.components?.[u]?.variants;return z?EE(N,z,[],N.theme.modularCssLayers?"theme":void 0):null}),p||C.push(Fs),Array.isArray(A[0])){const x=A.shift(),N=new Array(S.length).fill(""),O=new Array(C.length).fill("");let z;z=[...N,...x,...O],z.raw=[...N,...x.raw,...O],S.unshift(z)}const T=[...S,...A,...C],M=y(...T);return s.muiName&&(M.muiName=s.muiName),M};return y.withConfig&&(E.withConfig=y.withConfig),E}}function nz(e,t){return void 0}function rz(e){for(const t in e)return!1;return!0}function az(e){return typeof e=="string"&&e.charCodeAt(0)>96}function iz(e){return e&&e.charAt(0).toLowerCase()+e.slice(1)}function bg(e,t,n=!1){const r={...t};for(const a in e)if(Object.prototype.hasOwnProperty.call(e,a)){const i=a;if(i==="components"||i==="slots")r[i]={...e[i],...r[i]};else if(i==="componentsProps"||i==="slotProps"){const o=e[i],s=t[i];if(!s)r[i]=o||{};else if(!o)r[i]=s;else{r[i]={...s};for(const l in o)if(Object.prototype.hasOwnProperty.call(o,l)){const u=l;r[i][u]=bg(o[u],s[u],n)}}}else i==="className"&&n&&t.className?r.className=st(e?.className,t?.className):i==="style"&&n&&t.style?r.style={...e?.style,...t?.style}:r[i]===void 0&&(r[i]=e[i])}return r}const oz=typeof window<"u"?_.useLayoutEffect:_.useEffect;function sz(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}function Dg(e,t=0,n=1){return sz(e,t,n)}function lz(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let n=e.match(t);return n&&n[0].length===1&&(n=n.map(r=>r+r)),n?`rgb${n.length===4?"a":""}(${n.map((r,a)=>a<3?parseInt(r,16):Math.round(parseInt(r,16)/255*1e3)/1e3).join(", ")})`:""}function gi(e){if(e.type)return e;if(e.charAt(0)==="#")return gi(lz(e));const t=e.indexOf("("),n=e.substring(0,t);if(!["rgb","rgba","hsl","hsla","color"].includes(n))throw new Error(Ki(9,e));let r=e.substring(t+1,e.length-1),a;if(n==="color"){if(r=r.split(" "),a=r.shift(),r.length===4&&r[3].charAt(0)==="/"&&(r[3]=r[3].slice(1)),!["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].includes(a))throw new Error(Ki(10,a))}else r=r.split(",");return r=r.map(i=>parseFloat(i)),{type:n,values:r,colorSpace:a}}const uz=e=>{const t=gi(e);return t.values.slice(0,3).map((n,r)=>t.type.includes("hsl")&&r!==0?`${n}%`:n).join(" ")},hu=(e,t)=>{try{return uz(e)}catch{return e}};function zd(e){const{type:t,colorSpace:n}=e;let{values:r}=e;return t.includes("rgb")?r=r.map((a,i)=>i<3?parseInt(a,10):a):t.includes("hsl")&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),t.includes("color")?r=`${n} ${r.join(" ")}`:r=`${r.join(", ")}`,`${t}(${r})`}function AE(e){e=gi(e);const{values:t}=e,n=t[0],r=t[1]/100,a=t[2]/100,i=r*Math.min(a,1-a),o=(u,c=(u+n/30)%12)=>a-i*Math.max(Math.min(c-3,9-c,1),-1);let s="rgb";const l=[Math.round(o(0)*255),Math.round(o(8)*255),Math.round(o(4)*255)];return e.type==="hsla"&&(s+="a",l.push(t[3])),zd({type:s,values:l})}function Sg(e){e=gi(e);let t=e.type==="hsl"||e.type==="hsla"?gi(AE(e)).values:e.values;return t=t.map(n=>(e.type!=="color"&&(n/=255),n<=.03928?n/12.92:((n+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function cz(e,t){const n=Sg(e),r=Sg(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function CE(e,t){return e=gi(e),t=Dg(t),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${t}`:e.values[3]=t,zd(e)}function Ji(e,t,n){try{return CE(e,t)}catch{return e}}function kd(e,t){if(e=gi(e),t=Dg(t),e.type.includes("hsl"))e.values[2]*=1-t;else if(e.type.includes("rgb")||e.type.includes("color"))for(let n=0;n<3;n+=1)e.values[n]*=1-t;return zd(e)}function nt(e,t,n){try{return kd(e,t)}catch{return e}}function $d(e,t){if(e=gi(e),t=Dg(t),e.type.includes("hsl"))e.values[2]+=(100-e.values[2])*t;else if(e.type.includes("rgb"))for(let n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;else if(e.type.includes("color"))for(let n=0;n<3;n+=1)e.values[n]+=(1-e.values[n])*t;return zd(e)}function rt(e,t,n){try{return $d(e,t)}catch{return e}}function fz(e,t=.15){return Sg(e)>.5?kd(e,t):$d(e,t)}function Id(e,t,n){try{return fz(e,t)}catch{return e}}const dz=_.createContext(),hz=()=>_.useContext(dz)??!1,mz=_.createContext(void 0);function pz(e){const{theme:t,name:n,props:r}=e;if(!t||!t.components||!t.components[n])return r;const a=t.components[n];return a.defaultProps?bg(a.defaultProps,r,t.components.mergeClassNameAndStyle):!a.styleOverrides&&!a.variants?bg(a,r,t.components.mergeClassNameAndStyle):r}function gz({props:e,name:t}){const n=_.useContext(mz);return pz({props:e,name:t,theme:{components:n}})}let TE=0;function vz(e){const[t,n]=_.useState(e),r=e||t;return _.useEffect(()=>{t==null&&(TE+=1,n(`mui-${TE}`))},[t]),r}const ME={...D0}.useId;function yz(e){if(ME!==void 0){const t=ME();return e??t}return vz(e)}const _E={theme:void 0};function bz(e){let t,n;return function(a){let i=t;return(i===void 0||a.theme!==n)&&(_E.theme=a.theme,i=xE(e(_E)),t=i,n=a.theme),i}}function Dz(e=""){function t(...r){if(!r.length)return"";const a=r[0];return typeof a=="string"&&!a.match(/(#|\(|\)|(-?(\d*\.)?\d+)(px|em|%|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc))|^(-?(\d*\.)?\d+)$|(\d+ \d+ \d+)/)?`, var(--${e?`${e}-`:""}${a}${t(...r.slice(1))})`:`, ${a}`}return(r,...a)=>`var(--${e?`${e}-`:""}${r}${t(...a)})`}const NE=(e,t,n,r=[])=>{let a=e;t.forEach((i,o)=>{o===t.length-1?Array.isArray(a)?a[Number(i)]=n:a&&typeof a=="object"&&(a[i]=n):a&&typeof a=="object"&&(a[i]||(a[i]=r.includes(i)?[]:{}),a=a[i])})},Sz=(e,t,n)=>{function r(a,i=[],o=[]){Object.entries(a).forEach(([s,l])=>{(!n||n&&!n([...i,s]))&&l!=null&&(typeof l=="object"&&Object.keys(l).length>0?r(l,[...i,s],Array.isArray(l)?[...o,s]:o):t([...i,s],l,o))})}r(e)},wz=(e,t)=>typeof t=="number"?["lineHeight","fontWeight","opacity","zIndex"].some(r=>e.includes(r))||e[e.length-1].toLowerCase().includes("opacity")?t:`${t}px`:t;function wg(e,t){const{prefix:n,shouldSkipGeneratingVar:r}=t||{},a={},i={},o={};return Sz(e,(s,l,u)=>{if((typeof l=="string"||typeof l=="number")&&(!r||!r(s,l))){const c=`--${n?`${n}-`:""}${s.join("-")}`,f=wz(s,l);Object.assign(a,{[c]:f}),NE(i,s,`var(${c})`,u),NE(o,s,`var(${c}, ${f})`,u)}},s=>s[0]==="vars"),{css:a,vars:i,varsWithDefaults:o}}function xz(e,t={}){const{getSelector:n=p,disableCssColorScheme:r,colorSchemeSelector:a,enableContrastVars:i}=t,{colorSchemes:o={},components:s,defaultColorScheme:l="light",...u}=e,{vars:c,css:f,varsWithDefaults:d}=wg(u,t);let h=d;const g={},{[l]:m,...D}=o;if(Object.entries(D||{}).forEach(([w,E])=>{const{vars:b,css:S,varsWithDefaults:A}=wg(E,t);h=Wn(h,A),g[w]={css:S,vars:b}}),m){const{css:w,vars:E,varsWithDefaults:b}=wg(m,t);h=Wn(h,b),g[l]={css:w,vars:E}}function p(w,E){let b=a;if(a==="class"&&(b=".%s"),a==="data"&&(b="[data-%s]"),a?.startsWith("data-")&&!a.includes("%s")&&(b=`[${a}="%s"]`),w){if(b==="media")return e.defaultColorScheme===w?":root":{[`@media (prefers-color-scheme: ${o[w]?.palette?.mode||w})`]:{":root":E}};if(b)return e.defaultColorScheme===w?`:root, ${b.replace("%s",String(w))}`:b.replace("%s",String(w))}return":root"}return{vars:h,generateThemeVars:()=>{let w={...c};return Object.entries(g).forEach(([,{vars:E}])=>{w=Wn(w,E)}),w},generateStyleSheets:()=>{const w=[],E=e.defaultColorScheme||"light";function b(C,T){Object.keys(T).length&&w.push(typeof C=="string"?{[C]:{...T}}:C)}b(n(void 0,{...f}),f);const{[E]:S,...A}=g;if(S){const{css:C}=S,T=o[E]?.palette?.mode,M=!r&&T?{colorScheme:T,...C}:{...C};b(n(E,{...M}),M)}return Object.entries(A).forEach(([C,{css:T}])=>{const M=o[C]?.palette?.mode,x=!r&&M?{colorScheme:M,...T}:{...T};b(n(C,{...x}),x)}),i&&w.push({":root":{"--__l-threshold":"0.7","--__l":"clamp(0, (l / var(--__l-threshold) - 1) * -infinity, 1)","--__a":"clamp(0.87, (l / var(--__l-threshold) - 1) * -infinity, 1)"}}),w}}}function Ez(e){return function(n){return e==="media"?`@media (prefers-color-scheme: ${n})`:e?e.startsWith("data-")&&!e.includes("%s")?`[${e}="${n}"] &`:e==="class"?`.${n} &`:e==="data"?`[data-${n}] &`:`${e.replace("%s",n)} &`:"&"}}function En(e,t,n=void 0){const r={};for(const a in e){const i=e[a];let o="",s=!0;for(let l=0;l<i.length;l+=1){const u=i[l];u&&(o+=(s===!0?"":" ")+t(u),s=!1,n&&n[u]&&(o+=" "+n[u]))}r[a]=o}return r}function FE(){return{text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:ru.white,default:ru.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}}}const BE=FE();function OE(){return{text:{primary:ru.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:ru.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}}}const xg=OE();function RE(e,t,n,r){const a=r.light||r,i=r.dark||r*1.5;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:t==="light"?e.light=$d(e.main,a):t==="dark"&&(e.dark=kd(e.main,i)))}function zE(e,t,n,r,a){const i=a.light||a,o=a.dark||a*1.5;t[n]||(t.hasOwnProperty(r)?t[n]=t[r]:n==="light"?t.light=`color-mix(in ${e}, ${t.main}, #fff ${(i*100).toFixed(0)}%)`:n==="dark"&&(t.dark=`color-mix(in ${e}, ${t.main}, #000 ${(o*100).toFixed(0)}%)`))}function Az(e="light"){return e==="dark"?{main:xs[200],light:xs[50],dark:xs[400]}:{main:xs[700],light:xs[400],dark:xs[800]}}function Cz(e="light"){return e==="dark"?{main:ws[200],light:ws[50],dark:ws[400]}:{main:ws[500],light:ws[300],dark:ws[700]}}function Tz(e="light"){return e==="dark"?{main:Ss[500],light:Ss[300],dark:Ss[700]}:{main:Ss[700],light:Ss[400],dark:Ss[800]}}function Mz(e="light"){return e==="dark"?{main:Es[400],light:Es[300],dark:Es[700]}:{main:Es[700],light:Es[500],dark:Es[900]}}function _z(e="light"){return e==="dark"?{main:As[400],light:As[300],dark:As[700]}:{main:As[800],light:As[500],dark:As[900]}}function Nz(e="light"){return e==="dark"?{main:au[400],light:au[300],dark:au[700]}:{main:"#ed6c02",light:au[500],dark:au[900]}}function Fz(e){return`oklch(from ${e} var(--__l) 0 h / var(--__a))`}function Eg(e){const{mode:t="light",contrastThreshold:n=3,tonalOffset:r=.2,colorSpace:a,...i}=e,o=e.primary||Az(t),s=e.secondary||Cz(t),l=e.error||Tz(t),u=e.info||Mz(t),c=e.success||_z(t),f=e.warning||Nz(t);function d(D){return a?Fz(D):cz(D,xg.text.primary)>=n?xg.text.primary:BE.text.primary}const h=({color:D,name:p,mainShade:v=500,lightShade:y=300,darkShade:w=700})=>{if(D={...D},!D.main&&D[v]&&(D.main=D[v]),!D.hasOwnProperty("main"))throw new Error(Ki(11,p?` (${p})`:"",v));if(typeof D.main!="string")throw new Error(Ki(12,p?` (${p})`:"",JSON.stringify(D.main)));return a?(zE(a,D,"light",y,r),zE(a,D,"dark",w,r)):(RE(D,"light",y,r),RE(D,"dark",w,r)),D.contrastText||(D.contrastText=d(D.main)),D};let g;return t==="light"?g=FE():t==="dark"&&(g=OE()),Wn({common:{...ru},mode:t,primary:h({color:o,name:"primary"}),secondary:h({color:s,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:h({color:l,name:"error"}),warning:h({color:f,name:"warning"}),info:h({color:u,name:"info"}),success:h({color:c,name:"success"}),grey:HB,contrastThreshold:n,getContrastText:d,augmentColor:h,tonalOffset:r,...g},i)}function Bz(e){const t={};return Object.entries(e).forEach(r=>{const[a,i]=r;typeof i=="object"&&(t[a]=`${i.fontStyle?`${i.fontStyle} `:""}${i.fontVariant?`${i.fontVariant} `:""}${i.fontWeight?`${i.fontWeight} `:""}${i.fontStretch?`${i.fontStretch} `:""}${i.fontSize||""}${i.lineHeight?`/${i.lineHeight} `:""}${i.fontFamily||""}`)}),t}function Oz(e,t){return{toolbar:{minHeight:56,[e.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[e.up("sm")]:{minHeight:64}},...t}}function Rz(e){return Math.round(e*1e5)/1e5}const kE={textTransform:"uppercase"},$E='"Roboto", "Helvetica", "Arial", sans-serif';function zz(e,t){const{fontFamily:n=$E,fontSize:r=14,fontWeightLight:a=300,fontWeightRegular:i=400,fontWeightMedium:o=500,fontWeightBold:s=700,htmlFontSize:l=16,allVariants:u,pxToRem:c,...f}=typeof t=="function"?t(e):t,d=r/14,h=c||(D=>`${D/l*d}rem`),g=(D,p,v,y,w)=>({fontFamily:n,fontWeight:D,fontSize:h(p),lineHeight:v,...n===$E?{letterSpacing:`${Rz(y/p)}em`}:{},...w,...u}),m={h1:g(a,96,1.167,-1.5),h2:g(a,60,1.2,-.5),h3:g(i,48,1.167,0),h4:g(i,34,1.235,.25),h5:g(i,24,1.334,0),h6:g(o,20,1.6,.15),subtitle1:g(i,16,1.75,.15),subtitle2:g(o,14,1.57,.1),body1:g(i,16,1.5,.15),body2:g(i,14,1.43,.15),button:g(o,14,1.75,.4,kE),caption:g(i,12,1.66,.4),overline:g(i,12,2.66,1,kE),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return Wn({htmlFontSize:l,pxToRem:h,fontFamily:n,fontSize:r,fontWeightLight:a,fontWeightRegular:i,fontWeightMedium:o,fontWeightBold:s,...m},f,{clone:!1})}const kz=.2,$z=.14,Iz=.12;function Ct(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${kz})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${$z})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${Iz})`].join(",")}const Uz=["none",Ct(0,2,1,-1,0,1,1,0,0,1,3,0),Ct(0,3,1,-2,0,2,2,0,0,1,5,0),Ct(0,3,3,-2,0,3,4,0,0,1,8,0),Ct(0,2,4,-1,0,4,5,0,0,1,10,0),Ct(0,3,5,-1,0,5,8,0,0,1,14,0),Ct(0,3,5,-1,0,6,10,0,0,1,18,0),Ct(0,4,5,-2,0,7,10,1,0,2,16,1),Ct(0,5,5,-3,0,8,10,1,0,3,14,2),Ct(0,5,6,-3,0,9,12,1,0,3,16,2),Ct(0,6,6,-3,0,10,14,1,0,4,18,3),Ct(0,6,7,-4,0,11,15,1,0,4,20,3),Ct(0,7,8,-4,0,12,17,2,0,5,22,4),Ct(0,7,8,-4,0,13,19,2,0,5,24,4),Ct(0,7,9,-4,0,14,21,2,0,5,26,4),Ct(0,8,9,-5,0,15,22,2,0,6,28,5),Ct(0,8,10,-5,0,16,24,2,0,6,30,5),Ct(0,8,11,-5,0,17,26,2,0,6,32,5),Ct(0,9,11,-5,0,18,28,2,0,7,34,6),Ct(0,9,12,-6,0,19,29,2,0,7,36,6),Ct(0,10,13,-6,0,20,31,3,0,8,38,7),Ct(0,10,13,-6,0,21,33,3,0,8,40,7),Ct(0,10,14,-6,0,22,35,3,0,8,42,7),Ct(0,11,14,-7,0,23,36,3,0,9,44,8),Ct(0,11,15,-7,0,24,38,3,0,9,46,8)],Lz={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},Pz={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function IE(e){return`${Math.round(e)}ms`}function jz(e){if(!e)return 0;const t=e/36;return Math.min(Math.round((4+15*t**.25+t/5)*10),3e3)}function Hz(e){const t={...Lz,...e.easing},n={...Pz,...e.duration};return{getAutoHeightDuration:jz,create:(a=["all"],i={})=>{const{duration:o=n.standard,easing:s=t.easeInOut,delay:l=0,...u}=i;return(Array.isArray(a)?a:[a]).map(c=>`${c} ${typeof o=="string"?o:IE(o)} ${s} ${typeof l=="string"?l:IE(l)}`).join(",")},...e,easing:t,duration:n}}const qz={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function Yz(e){return Ea(e)||typeof e>"u"||typeof e=="string"||typeof e=="boolean"||typeof e=="number"||Array.isArray(e)}function UE(e={}){const t={...e};function n(r){const a=Object.entries(r);for(let i=0;i<a.length;i++){const[o,s]=a[i];!Yz(s)||o.startsWith("unstable_")?delete r[o]:Ea(s)&&(r[o]={...s},n(r[o]))}}return n(t),`import { unstable_createBreakpoints as createBreakpoints, createTransitions } from '@mui/material/styles';
82
+ */var fm=Symbol.for("react.transitional.element"),dm=Symbol.for("react.portal"),Yc=Symbol.for("react.fragment"),Xc=Symbol.for("react.strict_mode"),Zc=Symbol.for("react.profiler"),Qc=Symbol.for("react.consumer"),Kc=Symbol.for("react.context"),Wc=Symbol.for("react.forward_ref"),Jc=Symbol.for("react.suspense"),ef=Symbol.for("react.suspense_list"),tf=Symbol.for("react.memo"),nf=Symbol.for("react.lazy"),k8=Symbol.for("react.view_transition"),L8=Symbol.for("react.client.reference");function Kn(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case fm:switch(e=e.type,e){case Yc:case Zc:case Xc:case Jc:case ef:case k8:return e;default:switch(e=e&&e.$$typeof,e){case Kc:case Wc:case nf:case tf:return e;case Qc:return e;default:return t}}case dm:return t}}}nt.ContextConsumer=Qc,nt.ContextProvider=Kc,nt.Element=fm,nt.ForwardRef=Wc,nt.Fragment=Yc,nt.Lazy=nf,nt.Memo=tf,nt.Portal=dm,nt.Profiler=Zc,nt.StrictMode=Xc,nt.Suspense=Jc,nt.SuspenseList=ef,nt.isContextConsumer=function(e){return Kn(e)===Qc},nt.isContextProvider=function(e){return Kn(e)===Kc},nt.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===fm},nt.isForwardRef=function(e){return Kn(e)===Wc},nt.isFragment=function(e){return Kn(e)===Yc},nt.isLazy=function(e){return Kn(e)===nf},nt.isMemo=function(e){return Kn(e)===tf},nt.isPortal=function(e){return Kn(e)===dm},nt.isProfiler=function(e){return Kn(e)===Zc},nt.isStrictMode=function(e){return Kn(e)===Xc},nt.isSuspense=function(e){return Kn(e)===Jc},nt.isSuspenseList=function(e){return Kn(e)===ef},nt.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Yc||e===Zc||e===Xc||e===Jc||e===ef||typeof e=="object"&&e!==null&&(e.$$typeof===nf||e.$$typeof===tf||e.$$typeof===Kc||e.$$typeof===Qc||e.$$typeof===Wc||e.$$typeof===L8||e.getModuleId!==void 0)},nt.typeOf=Kn,A2.exports=nt;var C2=A2.exports;function Zr(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 T2(e){if(M.isValidElement(e)||C2.isValidElementType(e)||!Zr(e))return e;const t={};return Object.keys(e).forEach(n=>{t[n]=T2(e[n])}),t}function On(e,t,n={clone:!0}){const r=n.clone?{...e}:e;return Zr(e)&&Zr(t)&&Object.keys(t).forEach(i=>{M.isValidElement(t[i])||C2.isValidElementType(t[i])?r[i]=t[i]:Zr(t[i])&&Object.prototype.hasOwnProperty.call(e,i)&&Zr(e[i])?r[i]=On(e[i],t[i],n):n.clone?r[i]=Zr(t[i])?T2(t[i]):t[i]:r[i]=t[i]}),r}const j8=e=>{const t=Object.keys(e).map(n=>({key:n,val:e[n]}))||[];return t.sort((n,r)=>n.val-r.val),t.reduce((n,r)=>({...n,[r.key]:r.val}),{})};function H8(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:r=5,...i}=e,a=j8(t),o=Object.keys(a);function u(d){return`@media (min-width:${typeof t[d]=="number"?t[d]:d}${n})`}function l(d){return`@media (max-width:${(typeof t[d]=="number"?t[d]:d)-r/100}${n})`}function s(d,h){const v=o.indexOf(h);return`@media (min-width:${typeof t[d]=="number"?t[d]:d}${n}) and (max-width:${(v!==-1&&typeof t[o[v]]=="number"?t[o[v]]:h)-r/100}${n})`}function c(d){return o.indexOf(d)+1<o.length?s(d,o[o.indexOf(d)+1]):u(d)}function f(d){const h=o.indexOf(d);return h===0?u(o[1]):h===o.length-1?l(o[h]):s(d,o[o.indexOf(d)+1]).replace("@media","@media not all and")}return{keys:o,values:a,up:u,down:l,between:s,only:c,not:f,unit:n,...i}}function M2(e,t){if(!e.containerQueries)return t;const n=Object.keys(t).filter(r=>r.startsWith("@container")).sort((r,i)=>{const a=/min-width:\s*([0-9.]+)/;return+(r.match(a)?.[1]||0)-+(i.match(a)?.[1]||0)});return n.length?n.reduce((r,i)=>{const a=t[i];return delete r[i],r[i]=a,r},{...t}):t}function P8(e,t){return t==="@"||t.startsWith("@")&&(e.some(n=>t.startsWith(`@${n}`))||!!t.match(/^@\d/))}function q8(e,t){const n=t.match(/^@([^/]+)?\/?(.+)?$/);if(!n)return null;const[,r,i]=n,a=Number.isNaN(+r)?r||0:+r;return e.containerQueries(i).up(a)}function V8(e){const t=(a,o)=>a.replace("@media",o?`@container ${o}`:"@container");function n(a,o){a.up=(...u)=>t(e.breakpoints.up(...u),o),a.down=(...u)=>t(e.breakpoints.down(...u),o),a.between=(...u)=>t(e.breakpoints.between(...u),o),a.only=(...u)=>t(e.breakpoints.only(...u),o),a.not=(...u)=>{const l=t(e.breakpoints.not(...u),o);return l.includes("not all and")?l.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):l}}const r={},i=a=>(n(r,a),r);return n(i),{...e,containerQueries:i}}const G8={borderRadius:4};function al(e,t){return t?On(e,t,{clone:!1}):e}const rf={xs:0,sm:600,md:900,lg:1200,xl:1536},_2={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${rf[e]}px)`},Y8={containerQueries:e=>({up:t=>{let n=typeof t=="number"?t:rf[t]||t;return typeof n=="number"&&(n=`${n}px`),e?`@container ${e} (min-width:${n})`:`@container (min-width:${n})`}})};function Qr(e,t,n){const r=e.theme||{};if(Array.isArray(t)){const a=r.breakpoints||_2;return t.reduce((o,u,l)=>(o[a.up(a.keys[l])]=n(t[l]),o),{})}if(typeof t=="object"){const a=r.breakpoints||_2;return Object.keys(t).reduce((o,u)=>{if(P8(a.keys,u)){const l=q8(r.containerQueries?r:Y8,u);l&&(o[l]=n(t[u],u))}else if(Object.keys(a.values||rf).includes(u)){const l=a.up(u);o[l]=n(t[u],u)}else{const l=u;o[l]=t[l]}return o},{})}return n(t)}function X8(e={}){return e.keys?.reduce((n,r)=>{const i=e.up(r);return n[i]={},n},{})||{}}function B2(e,t){return e.reduce((n,r)=>{const i=n[r];return(!i||Object.keys(i).length===0)&&delete n[r],n},t)}function Ue(e){if(typeof e!="string")throw new Error(la(7));return e.charAt(0).toUpperCase()+e.slice(1)}function af(e,t,n=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&n){const r=`vars.${t}`.split(".").reduce((i,a)=>i&&i[a]?i[a]:null,e);if(r!=null)return r}return t.split(".").reduce((r,i)=>r&&r[i]!=null?r[i]:null,e)}function of(e,t,n,r=n){let i;return typeof e=="function"?i=e(n):Array.isArray(e)?i=e[n]||r:i=af(e,n)||r,t&&(i=t(i,r,e)),i}function Tt(e){const{prop:t,cssProperty:n=e.prop,themeKey:r,transform:i}=e,a=o=>{if(o[t]==null)return null;const u=o[t],l=o.theme,s=af(l,r)||{};return Qr(o,u,f=>{let d=of(s,i,f);return f===d&&typeof f=="string"&&(d=of(s,i,`${t}${f==="default"?"":Ue(f)}`,f)),n===!1?d:{[n]:d}})};return a.propTypes={},a.filterProps=[t],a}function Z8(e){const t={};return n=>(t[n]===void 0&&(t[n]=e(n)),t[n])}const Q8={m:"margin",p:"padding"},K8={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},F2={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},W8=Z8(e=>{if(e.length>2)if(F2[e])e=F2[e];else return[e];const[t,n]=e.split(""),r=Q8[t],i=K8[n]||"";return Array.isArray(i)?i.map(a=>r+a):[r+i]}),hm=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],mm=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...hm,...mm];function ol(e,t,n,r){const i=af(e,t,!0)??n;return typeof i=="number"||typeof i=="string"?a=>typeof a=="string"?a:typeof i=="string"?i.startsWith("var(")&&a===0?0:i.startsWith("var(")&&a===1?i:`calc(${a} * ${i})`:i*a:Array.isArray(i)?a=>{if(typeof a=="string")return a;const o=Math.abs(a),u=i[o];return a>=0?u:typeof u=="number"?-u:typeof u=="string"&&u.startsWith("var(")?`calc(-1 * ${u})`:`-${u}`}:typeof i=="function"?i:()=>{}}function pm(e){return ol(e,"spacing",8)}function ul(e,t){return typeof t=="string"||t==null?t:e(t)}function J8(e,t){return n=>e.reduce((r,i)=>(r[i]=ul(t,n),r),{})}function e6(e,t,n,r){if(!t.includes(n))return null;const i=W8(n),a=J8(i,r),o=e[n];return Qr(e,o,a)}function N2(e,t){const n=pm(e.theme);return Object.keys(e).map(r=>e6(e,t,r,n)).reduce(al,{})}function St(e){return N2(e,hm)}St.propTypes={},St.filterProps=hm;function xt(e){return N2(e,mm)}xt.propTypes={},xt.filterProps=mm;function R2(e=8,t=pm({spacing:e})){if(e.mui)return e;const n=(...r)=>(r.length===0?[1]:r).map(a=>{const o=t(a);return typeof o=="number"?`${o}px`:o}).join(" ");return n.mui=!0,n}function uf(...e){const t=e.reduce((r,i)=>(i.filterProps.forEach(a=>{r[a]=i}),r),{}),n=r=>Object.keys(r).reduce((i,a)=>t[a]?al(i,t[a](r)):i,{});return n.propTypes={},n.filterProps=e.reduce((r,i)=>r.concat(i.filterProps),[]),n}function Wn(e){return typeof e!="number"?e:`${e}px solid`}function Jn(e,t){return Tt({prop:e,themeKey:"borders",transform:t})}const t6=Jn("border",Wn),n6=Jn("borderTop",Wn),r6=Jn("borderRight",Wn),i6=Jn("borderBottom",Wn),a6=Jn("borderLeft",Wn),o6=Jn("borderColor"),u6=Jn("borderTopColor"),l6=Jn("borderRightColor"),s6=Jn("borderBottomColor"),c6=Jn("borderLeftColor"),f6=Jn("outline",Wn),d6=Jn("outlineColor"),lf=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=ol(e.theme,"shape.borderRadius",4),n=r=>({borderRadius:ul(t,r)});return Qr(e,e.borderRadius,n)}return null};lf.propTypes={},lf.filterProps=["borderRadius"],uf(t6,n6,r6,i6,a6,o6,u6,l6,s6,c6,lf,f6,d6);const sf=e=>{if(e.gap!==void 0&&e.gap!==null){const t=ol(e.theme,"spacing",8),n=r=>({gap:ul(t,r)});return Qr(e,e.gap,n)}return null};sf.propTypes={},sf.filterProps=["gap"];const cf=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=ol(e.theme,"spacing",8),n=r=>({columnGap:ul(t,r)});return Qr(e,e.columnGap,n)}return null};cf.propTypes={},cf.filterProps=["columnGap"];const ff=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=ol(e.theme,"spacing",8),n=r=>({rowGap:ul(t,r)});return Qr(e,e.rowGap,n)}return null};ff.propTypes={},ff.filterProps=["rowGap"];const h6=Tt({prop:"gridColumn"}),m6=Tt({prop:"gridRow"}),p6=Tt({prop:"gridAutoFlow"}),g6=Tt({prop:"gridAutoColumns"}),v6=Tt({prop:"gridAutoRows"}),y6=Tt({prop:"gridTemplateColumns"}),b6=Tt({prop:"gridTemplateRows"}),D6=Tt({prop:"gridTemplateAreas"}),S6=Tt({prop:"gridArea"});uf(sf,cf,ff,h6,m6,p6,g6,v6,y6,b6,D6,S6);function _o(e,t){return t==="grey"?t:e}const x6=Tt({prop:"color",themeKey:"palette",transform:_o}),w6=Tt({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:_o}),E6=Tt({prop:"backgroundColor",themeKey:"palette",transform:_o});uf(x6,w6,E6);function zn(e){return e<=1&&e!==0?`${e*100}%`:e}const A6=Tt({prop:"width",transform:zn}),gm=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=n=>{const r=e.theme?.breakpoints?.values?.[n]||rf[n];return r?e.theme?.breakpoints?.unit!=="px"?{maxWidth:`${r}${e.theme.breakpoints.unit}`}:{maxWidth:r}:{maxWidth:zn(n)}};return Qr(e,e.maxWidth,t)}return null};gm.filterProps=["maxWidth"];const C6=Tt({prop:"minWidth",transform:zn}),T6=Tt({prop:"height",transform:zn}),M6=Tt({prop:"maxHeight",transform:zn}),_6=Tt({prop:"minHeight",transform:zn});Tt({prop:"size",cssProperty:"width",transform:zn}),Tt({prop:"size",cssProperty:"height",transform:zn});const B6=Tt({prop:"boxSizing"});uf(A6,gm,C6,T6,M6,_6,B6);const df={border:{themeKey:"borders",transform:Wn},borderTop:{themeKey:"borders",transform:Wn},borderRight:{themeKey:"borders",transform:Wn},borderBottom:{themeKey:"borders",transform:Wn},borderLeft:{themeKey:"borders",transform:Wn},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:Wn},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:lf},color:{themeKey:"palette",transform:_o},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:_o},backgroundColor:{themeKey:"palette",transform:_o},p:{style:xt},pt:{style:xt},pr:{style:xt},pb:{style:xt},pl:{style:xt},px:{style:xt},py:{style:xt},padding:{style:xt},paddingTop:{style:xt},paddingRight:{style:xt},paddingBottom:{style:xt},paddingLeft:{style:xt},paddingX:{style:xt},paddingY:{style:xt},paddingInline:{style:xt},paddingInlineStart:{style:xt},paddingInlineEnd:{style:xt},paddingBlock:{style:xt},paddingBlockStart:{style:xt},paddingBlockEnd:{style:xt},m:{style:St},mt:{style:St},mr:{style:St},mb:{style:St},ml:{style:St},mx:{style:St},my:{style:St},margin:{style:St},marginTop:{style:St},marginRight:{style:St},marginBottom:{style:St},marginLeft:{style:St},marginX:{style:St},marginY:{style:St},marginInline:{style:St},marginInlineStart:{style:St},marginInlineEnd:{style:St},marginBlock:{style:St},marginBlockStart:{style:St},marginBlockEnd:{style:St},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:sf},rowGap:{style:ff},columnGap:{style:cf},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:zn},maxWidth:{style:gm},minWidth:{transform:zn},height:{transform:zn},maxHeight:{transform:zn},minHeight:{transform:zn},boxSizing:{},font:{themeKey:"font"},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function F6(...e){const t=e.reduce((r,i)=>r.concat(Object.keys(i)),[]),n=new Set(t);return e.every(r=>n.size===Object.keys(r).length)}function N6(e,t){return typeof e=="function"?e(t):e}function R6(){function e(n,r,i,a){const o={[n]:r,theme:i},u=a[n];if(!u)return{[n]:r};const{cssProperty:l=n,themeKey:s,transform:c,style:f}=u;if(r==null)return null;if(s==="typography"&&r==="inherit")return{[n]:r};const d=af(i,s)||{};return f?f(o):Qr(o,r,v=>{let m=of(d,c,v);return v===m&&typeof v=="string"&&(m=of(d,c,`${n}${v==="default"?"":Ue(v)}`,v)),l===!1?m:{[l]:m}})}function t(n){const{sx:r,theme:i={},nested:a}=n||{};if(!r)return null;const o=i.unstable_sxConfig??df;function u(l){let s=l;if(typeof l=="function")s=l(i);else if(typeof l!="object")return l;if(!s)return null;const c=X8(i.breakpoints),f=Object.keys(c);let d=c;return Object.keys(s).forEach(h=>{const v=N6(s[h],i);if(v!=null)if(typeof v=="object")if(o[h])d=al(d,e(h,v,i,o));else{const m=Qr({theme:i},v,D=>({[h]:D}));F6(m,v)?d[h]=t({sx:v,theme:i,nested:!0}):d=al(d,m)}else d=al(d,e(h,v,i,o))}),!a&&i.modularCssLayers?{"@layer sx":M2(i,B2(f,d))}:M2(i,B2(f,d))}return Array.isArray(r)?r.map(u):u(r)}return t}const Bo=R6();Bo.filterProps=["sx"];function O6(e,t){const n=this;if(n.vars){if(!n.colorSchemes?.[e]||typeof n.getColorSchemeSelector!="function")return{};let r=n.getColorSchemeSelector(e);return r==="&"?t:((r.includes("data-")||r.includes("."))&&(r=`*:where(${r.replace(/\s*&$/,"")}) &`),{[r]:t})}return n.palette.mode===e?t:{}}function O2(e={},...t){const{breakpoints:n={},palette:r={},spacing:i,shape:a={},...o}=e,u=H8(n),l=R2(i);let s=On({breakpoints:u,direction:"ltr",components:{},palette:{mode:"light",...r},spacing:l,shape:{...G8,...a}},o);return s=V8(s),s.applyStyles=O6,s=t.reduce((c,f)=>On(c,f),s),s.unstable_sxConfig={...df,...o?.unstable_sxConfig},s.unstable_sx=function(f){return Bo({sx:f,theme:this})},s}const z2=e=>e,z6=(()=>{let e=z2;return{configure(t){e=t},generate(t){return e(t)},reset(){e=z2}}})();function U2(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=U2(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function at(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=U2(e))&&(r&&(r+=" "),r+=t);return r}const U6={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function yn(e,t,n="Mui"){const r=U6[t];return r?`${n}-${r}`:`${z6.generate(e)}-${t}`}function bn(e,t,n="Mui"){const r={};return t.forEach(i=>{r[i]=yn(e,i,n)}),r}function I2(e){const{variants:t,...n}=e,r={variants:t,style:sa(n),isProcessed:!0};return r.style===n||t&&t.forEach(i=>{typeof i.style!="function"&&(i.style=sa(i.style))}),r}const I6=O2();function vm(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}function ca(e,t){return t&&e&&typeof e=="object"&&e.styles&&!e.styles.startsWith("@layer")&&(e.styles=`@layer ${t}{${String(e.styles)}}`),e}function $6(e){return e?(t,n)=>n[e]:null}function k6(e,t,n){e.theme=H6(e.theme)?n:e.theme[t]||e.theme}function hf(e,t,n){const r=typeof t=="function"?t(e):t;if(Array.isArray(r))return r.flatMap(i=>hf(e,i,n));if(Array.isArray(r?.variants)){let i;if(r.isProcessed)i=n?ca(r.style,n):r.style;else{const{variants:a,...o}=r;i=n?ca(sa(o),n):o}return $2(e,r.variants,[i],n)}return r?.isProcessed?n?ca(sa(r.style),n):r.style:n?ca(sa(r),n):r}function $2(e,t,n=[],r=void 0){let i;e:for(let a=0;a<t.length;a+=1){const o=t[a];if(typeof o.props=="function"){if(i??={...e,...e.ownerState,ownerState:e.ownerState},!o.props(i))continue}else for(const u in o.props)if(e[u]!==o.props[u]&&e.ownerState?.[u]!==o.props[u])continue e;typeof o.style=="function"?(i??={...e,...e.ownerState,ownerState:e.ownerState},n.push(r?ca(sa(o.style(i)),r):o.style(i))):n.push(r?ca(sa(o.style),r):o.style)}return n}function L6(e={}){const{themeId:t,defaultTheme:n=I6,rootShouldForwardProp:r=vm,slotShouldForwardProp:i=vm}=e;function a(u){k6(u,t,n)}return(u,l={})=>{$8(u,b=>b.filter(E=>E!==Bo));const{name:s,slot:c,skipVariantsResolver:f,skipSx:d,overridesResolver:h=$6(q6(c)),...v}=l,m=s&&s.startsWith("Mui")||c?"components":"custom",D=f!==void 0?f:c&&c!=="Root"&&c!=="root"||!1,p=d||!1;let g=vm;c==="Root"||c==="root"?g=r:c?g=i:P6(u)&&(g=void 0);const y=I8(u,{shouldForwardProp:g,label:j6(),...v}),S=b=>{if(b.__emotion_real===b)return b;if(typeof b=="function")return function(C){return hf(C,b,C.theme.modularCssLayers?m:void 0)};if(Zr(b)){const E=I2(b);return function(A){return E.variants?hf(A,E,A.theme.modularCssLayers?m:void 0):A.theme.modularCssLayers?ca(E.style,m):E.style}}return b},w=(...b)=>{const E=[],C=b.map(S),A=[];if(E.push(a),s&&h&&A.push(function(F){const z=F.theme.components?.[s]?.styleOverrides;if(!z)return null;const N={};for(const U in z)N[U]=hf(F,z[U],F.theme.modularCssLayers?"theme":void 0);return h(F,N)}),s&&!D&&A.push(function(F){const z=F.theme?.components?.[s]?.variants;return z?$2(F,z,[],F.theme.modularCssLayers?"theme":void 0):null}),p||A.push(Bo),Array.isArray(C[0])){const x=C.shift(),F=new Array(E.length).fill(""),R=new Array(A.length).fill("");let z;z=[...F,...x,...R],z.raw=[...F,...x.raw,...R],E.unshift(z)}const T=[...E,...C,...A],_=y(...T);return u.muiName&&(_.muiName=u.muiName),_};return y.withConfig&&(w.withConfig=y.withConfig),w}}function j6(e,t){return void 0}function H6(e){for(const t in e)return!1;return!0}function P6(e){return typeof e=="string"&&e.charCodeAt(0)>96}function q6(e){return e&&e.charAt(0).toLowerCase()+e.slice(1)}function ym(e,t,n=!1){const r={...t};for(const i in e)if(Object.prototype.hasOwnProperty.call(e,i)){const a=i;if(a==="components"||a==="slots")r[a]={...e[a],...r[a]};else if(a==="componentsProps"||a==="slotProps"){const o=e[a],u=t[a];if(!u)r[a]=o||{};else if(!o)r[a]=u;else{r[a]={...u};for(const l in o)if(Object.prototype.hasOwnProperty.call(o,l)){const s=l;r[a][s]=ym(o[s],u[s],n)}}}else a==="className"&&n&&t.className?r.className=at(e?.className,t?.className):a==="style"&&n&&t.style?r.style={...e?.style,...t?.style}:r[a]===void 0&&(r[a]=e[a])}return r}const V6=typeof window<"u"?M.useLayoutEffect:M.useEffect;function G6(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}function bm(e,t=0,n=1){return G6(e,t,n)}function Y6(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let n=e.match(t);return n&&n[0].length===1&&(n=n.map(r=>r+r)),n?`rgb${n.length===4?"a":""}(${n.map((r,i)=>i<3?parseInt(r,16):Math.round(parseInt(r,16)/255*1e3)/1e3).join(", ")})`:""}function zi(e){if(e.type)return e;if(e.charAt(0)==="#")return zi(Y6(e));const t=e.indexOf("("),n=e.substring(0,t);if(!["rgb","rgba","hsl","hsla","color"].includes(n))throw new Error(la(9,e));let r=e.substring(t+1,e.length-1),i;if(n==="color"){if(r=r.split(" "),i=r.shift(),r.length===4&&r[3].charAt(0)==="/"&&(r[3]=r[3].slice(1)),!["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].includes(i))throw new Error(la(10,i))}else r=r.split(",");return r=r.map(a=>parseFloat(a)),{type:n,values:r,colorSpace:i}}const X6=e=>{const t=zi(e);return t.values.slice(0,3).map((n,r)=>t.type.includes("hsl")&&r!==0?`${n}%`:n).join(" ")},ll=(e,t)=>{try{return X6(e)}catch{return e}};function mf(e){const{type:t,colorSpace:n}=e;let{values:r}=e;return t.includes("rgb")?r=r.map((i,a)=>a<3?parseInt(i,10):i):t.includes("hsl")&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),t.includes("color")?r=`${n} ${r.join(" ")}`:r=`${r.join(", ")}`,`${t}(${r})`}function k2(e){e=zi(e);const{values:t}=e,n=t[0],r=t[1]/100,i=t[2]/100,a=r*Math.min(i,1-i),o=(s,c=(s+n/30)%12)=>i-a*Math.max(Math.min(c-3,9-c,1),-1);let u="rgb";const l=[Math.round(o(0)*255),Math.round(o(8)*255),Math.round(o(4)*255)];return e.type==="hsla"&&(u+="a",l.push(t[3])),mf({type:u,values:l})}function Dm(e){e=zi(e);let t=e.type==="hsl"||e.type==="hsla"?zi(k2(e)).values:e.values;return t=t.map(n=>(e.type!=="color"&&(n/=255),n<=.03928?n/12.92:((n+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function Z6(e,t){const n=Dm(e),r=Dm(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function L2(e,t){return e=zi(e),t=bm(t),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${t}`:e.values[3]=t,mf(e)}function fa(e,t,n){try{return L2(e,t)}catch{return e}}function pf(e,t){if(e=zi(e),t=bm(t),e.type.includes("hsl"))e.values[2]*=1-t;else if(e.type.includes("rgb")||e.type.includes("color"))for(let n=0;n<3;n+=1)e.values[n]*=1-t;return mf(e)}function Ye(e,t,n){try{return pf(e,t)}catch{return e}}function gf(e,t){if(e=zi(e),t=bm(t),e.type.includes("hsl"))e.values[2]+=(100-e.values[2])*t;else if(e.type.includes("rgb"))for(let n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;else if(e.type.includes("color"))for(let n=0;n<3;n+=1)e.values[n]+=(1-e.values[n])*t;return mf(e)}function Xe(e,t,n){try{return gf(e,t)}catch{return e}}function Q6(e,t=.15){return Dm(e)>.5?pf(e,t):gf(e,t)}function vf(e,t,n){try{return Q6(e,t)}catch{return e}}const K6=M.createContext(void 0);function W6(e){const{theme:t,name:n,props:r}=e;if(!t||!t.components||!t.components[n])return r;const i=t.components[n];return i.defaultProps?ym(i.defaultProps,r,t.components.mergeClassNameAndStyle):!i.styleOverrides&&!i.variants?ym(i,r,t.components.mergeClassNameAndStyle):r}function J6({props:e,name:t}){const n=M.useContext(K6);return W6({props:e,name:t,theme:{components:n}})}let j2=0;function e9(e){const[t,n]=M.useState(e),r=e||t;return M.useEffect(()=>{t==null&&(j2+=1,n(`mui-${j2}`))},[t]),r}const H2={...Lf}.useId;function t9(e){if(H2!==void 0){const t=H2();return e??t}return e9(e)}const P2={theme:void 0};function n9(e){let t,n;return function(i){let a=t;return(a===void 0||i.theme!==n)&&(P2.theme=i.theme,a=I2(e(P2)),t=a,n=i.theme),a}}function r9(e=""){function t(...r){if(!r.length)return"";const i=r[0];return typeof i=="string"&&!i.match(/(#|\(|\)|(-?(\d*\.)?\d+)(px|em|%|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc))|^(-?(\d*\.)?\d+)$|(\d+ \d+ \d+)/)?`, var(--${e?`${e}-`:""}${i}${t(...r.slice(1))})`:`, ${i}`}return(r,...i)=>`var(--${e?`${e}-`:""}${r}${t(...i)})`}const q2=(e,t,n,r=[])=>{let i=e;t.forEach((a,o)=>{o===t.length-1?Array.isArray(i)?i[Number(a)]=n:i&&typeof i=="object"&&(i[a]=n):i&&typeof i=="object"&&(i[a]||(i[a]=r.includes(a)?[]:{}),i=i[a])})},i9=(e,t,n)=>{function r(i,a=[],o=[]){Object.entries(i).forEach(([u,l])=>{(!n||n&&!n([...a,u]))&&l!=null&&(typeof l=="object"&&Object.keys(l).length>0?r(l,[...a,u],Array.isArray(l)?[...o,u]:o):t([...a,u],l,o))})}r(e)},a9=(e,t)=>typeof t=="number"?["lineHeight","fontWeight","opacity","zIndex"].some(r=>e.includes(r))||e[e.length-1].toLowerCase().includes("opacity")?t:`${t}px`:t;function Sm(e,t){const{prefix:n,shouldSkipGeneratingVar:r}=t||{},i={},a={},o={};return i9(e,(u,l,s)=>{if((typeof l=="string"||typeof l=="number")&&(!r||!r(u,l))){const c=`--${n?`${n}-`:""}${u.join("-")}`,f=a9(u,l);Object.assign(i,{[c]:f}),q2(a,u,`var(${c})`,s),q2(o,u,`var(${c}, ${f})`,s)}},u=>u[0]==="vars"),{css:i,vars:a,varsWithDefaults:o}}function o9(e,t={}){const{getSelector:n=p,disableCssColorScheme:r,colorSchemeSelector:i,enableContrastVars:a}=t,{colorSchemes:o={},components:u,defaultColorScheme:l="light",...s}=e,{vars:c,css:f,varsWithDefaults:d}=Sm(s,t);let h=d;const v={},{[l]:m,...D}=o;if(Object.entries(D||{}).forEach(([S,w])=>{const{vars:b,css:E,varsWithDefaults:C}=Sm(w,t);h=On(h,C),v[S]={css:E,vars:b}}),m){const{css:S,vars:w,varsWithDefaults:b}=Sm(m,t);h=On(h,b),v[l]={css:S,vars:w}}function p(S,w){let b=i;if(i==="class"&&(b=".%s"),i==="data"&&(b="[data-%s]"),i?.startsWith("data-")&&!i.includes("%s")&&(b=`[${i}="%s"]`),S){if(b==="media")return e.defaultColorScheme===S?":root":{[`@media (prefers-color-scheme: ${o[S]?.palette?.mode||S})`]:{":root":w}};if(b)return e.defaultColorScheme===S?`:root, ${b.replace("%s",String(S))}`:b.replace("%s",String(S))}return":root"}return{vars:h,generateThemeVars:()=>{let S={...c};return Object.entries(v).forEach(([,{vars:w}])=>{S=On(S,w)}),S},generateStyleSheets:()=>{const S=[],w=e.defaultColorScheme||"light";function b(A,T){Object.keys(T).length&&S.push(typeof A=="string"?{[A]:{...T}}:A)}b(n(void 0,{...f}),f);const{[w]:E,...C}=v;if(E){const{css:A}=E,T=o[w]?.palette?.mode,_=!r&&T?{colorScheme:T,...A}:{...A};b(n(w,{..._}),_)}return Object.entries(C).forEach(([A,{css:T}])=>{const _=o[A]?.palette?.mode,x=!r&&_?{colorScheme:_,...T}:{...T};b(n(A,{...x}),x)}),a&&S.push({":root":{"--__l-threshold":"0.7","--__l":"clamp(0, (l / var(--__l-threshold) - 1) * -infinity, 1)","--__a":"clamp(0.87, (l / var(--__l-threshold) - 1) * -infinity, 1)"}}),S}}}function u9(e){return function(n){return e==="media"?`@media (prefers-color-scheme: ${n})`:e?e.startsWith("data-")&&!e.includes("%s")?`[${e}="${n}"] &`:e==="class"?`.${n} &`:e==="data"?`[data-${n}] &`:`${e.replace("%s",n)} &`:"&"}}function Un(e,t,n=void 0){const r={};for(const i in e){const a=e[i];let o="",u=!0;for(let l=0;l<a.length;l+=1){const s=a[l];s&&(o+=(u===!0?"":" ")+t(s),u=!1,n&&n[s]&&(o+=" "+n[s]))}r[i]=o}return r}function V2(){return{text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:Ku.white,default:Ku.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}}}const G2=V2();function Y2(){return{text:{primary:Ku.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:Ku.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}}}const xm=Y2();function X2(e,t,n,r){const i=r.light||r,a=r.dark||r*1.5;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:t==="light"?e.light=gf(e.main,i):t==="dark"&&(e.dark=pf(e.main,a)))}function Z2(e,t,n,r,i){const a=i.light||i,o=i.dark||i*1.5;t[n]||(t.hasOwnProperty(r)?t[n]=t[r]:n==="light"?t.light=`color-mix(in ${e}, ${t.main}, #fff ${(a*100).toFixed(0)}%)`:n==="dark"&&(t.dark=`color-mix(in ${e}, ${t.main}, #000 ${(o*100).toFixed(0)}%)`))}function l9(e="light"){return e==="dark"?{main:wo[200],light:wo[50],dark:wo[400]}:{main:wo[700],light:wo[400],dark:wo[800]}}function s9(e="light"){return e==="dark"?{main:xo[200],light:xo[50],dark:xo[400]}:{main:xo[500],light:xo[300],dark:xo[700]}}function c9(e="light"){return e==="dark"?{main:So[500],light:So[300],dark:So[700]}:{main:So[700],light:So[400],dark:So[800]}}function f9(e="light"){return e==="dark"?{main:Eo[400],light:Eo[300],dark:Eo[700]}:{main:Eo[700],light:Eo[500],dark:Eo[900]}}function d9(e="light"){return e==="dark"?{main:Ao[400],light:Ao[300],dark:Ao[700]}:{main:Ao[800],light:Ao[500],dark:Ao[900]}}function h9(e="light"){return e==="dark"?{main:Wu[400],light:Wu[300],dark:Wu[700]}:{main:"#ed6c02",light:Wu[500],dark:Wu[900]}}function m9(e){return`oklch(from ${e} var(--__l) 0 h / var(--__a))`}function wm(e){const{mode:t="light",contrastThreshold:n=3,tonalOffset:r=.2,colorSpace:i,...a}=e,o=e.primary||l9(t),u=e.secondary||s9(t),l=e.error||c9(t),s=e.info||f9(t),c=e.success||d9(t),f=e.warning||h9(t);function d(D){return i?m9(D):Z6(D,xm.text.primary)>=n?xm.text.primary:G2.text.primary}const h=({color:D,name:p,mainShade:g=500,lightShade:y=300,darkShade:S=700})=>{if(D={...D},!D.main&&D[g]&&(D.main=D[g]),!D.hasOwnProperty("main"))throw new Error(la(11,p?` (${p})`:"",g));if(typeof D.main!="string")throw new Error(la(12,p?` (${p})`:"",JSON.stringify(D.main)));return i?(Z2(i,D,"light",y,r),Z2(i,D,"dark",S,r)):(X2(D,"light",y,r),X2(D,"dark",S,r)),D.contrastText||(D.contrastText=d(D.main)),D};let v;return t==="light"?v=V2():t==="dark"&&(v=Y2()),On({common:{...Ku},mode:t,primary:h({color:o,name:"primary"}),secondary:h({color:u,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:h({color:l,name:"error"}),warning:h({color:f,name:"warning"}),info:h({color:s,name:"info"}),success:h({color:c,name:"success"}),grey:R_,contrastThreshold:n,getContrastText:d,augmentColor:h,tonalOffset:r,...v},a)}function p9(e){const t={};return Object.entries(e).forEach(r=>{const[i,a]=r;typeof a=="object"&&(t[i]=`${a.fontStyle?`${a.fontStyle} `:""}${a.fontVariant?`${a.fontVariant} `:""}${a.fontWeight?`${a.fontWeight} `:""}${a.fontStretch?`${a.fontStretch} `:""}${a.fontSize||""}${a.lineHeight?`/${a.lineHeight} `:""}${a.fontFamily||""}`)}),t}function g9(e,t){return{toolbar:{minHeight:56,[e.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[e.up("sm")]:{minHeight:64}},...t}}function v9(e){return Math.round(e*1e5)/1e5}const Q2={textTransform:"uppercase"},K2='"Roboto", "Helvetica", "Arial", sans-serif';function y9(e,t){const{fontFamily:n=K2,fontSize:r=14,fontWeightLight:i=300,fontWeightRegular:a=400,fontWeightMedium:o=500,fontWeightBold:u=700,htmlFontSize:l=16,allVariants:s,pxToRem:c,...f}=typeof t=="function"?t(e):t,d=r/14,h=c||(D=>`${D/l*d}rem`),v=(D,p,g,y,S)=>({fontFamily:n,fontWeight:D,fontSize:h(p),lineHeight:g,...n===K2?{letterSpacing:`${v9(y/p)}em`}:{},...S,...s}),m={h1:v(i,96,1.167,-1.5),h2:v(i,60,1.2,-.5),h3:v(a,48,1.167,0),h4:v(a,34,1.235,.25),h5:v(a,24,1.334,0),h6:v(o,20,1.6,.15),subtitle1:v(a,16,1.75,.15),subtitle2:v(o,14,1.57,.1),body1:v(a,16,1.5,.15),body2:v(a,14,1.43,.15),button:v(o,14,1.75,.4,Q2),caption:v(a,12,1.66,.4),overline:v(a,12,2.66,1,Q2),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return On({htmlFontSize:l,pxToRem:h,fontFamily:n,fontSize:r,fontWeightLight:i,fontWeightRegular:a,fontWeightMedium:o,fontWeightBold:u,...m},f,{clone:!1})}const b9=.2,D9=.14,S9=.12;function pt(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${b9})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${D9})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${S9})`].join(",")}const x9=["none",pt(0,2,1,-1,0,1,1,0,0,1,3,0),pt(0,3,1,-2,0,2,2,0,0,1,5,0),pt(0,3,3,-2,0,3,4,0,0,1,8,0),pt(0,2,4,-1,0,4,5,0,0,1,10,0),pt(0,3,5,-1,0,5,8,0,0,1,14,0),pt(0,3,5,-1,0,6,10,0,0,1,18,0),pt(0,4,5,-2,0,7,10,1,0,2,16,1),pt(0,5,5,-3,0,8,10,1,0,3,14,2),pt(0,5,6,-3,0,9,12,1,0,3,16,2),pt(0,6,6,-3,0,10,14,1,0,4,18,3),pt(0,6,7,-4,0,11,15,1,0,4,20,3),pt(0,7,8,-4,0,12,17,2,0,5,22,4),pt(0,7,8,-4,0,13,19,2,0,5,24,4),pt(0,7,9,-4,0,14,21,2,0,5,26,4),pt(0,8,9,-5,0,15,22,2,0,6,28,5),pt(0,8,10,-5,0,16,24,2,0,6,30,5),pt(0,8,11,-5,0,17,26,2,0,6,32,5),pt(0,9,11,-5,0,18,28,2,0,7,34,6),pt(0,9,12,-6,0,19,29,2,0,7,36,6),pt(0,10,13,-6,0,20,31,3,0,8,38,7),pt(0,10,13,-6,0,21,33,3,0,8,40,7),pt(0,10,14,-6,0,22,35,3,0,8,42,7),pt(0,11,14,-7,0,23,36,3,0,9,44,8),pt(0,11,15,-7,0,24,38,3,0,9,46,8)],w9={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},E9={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function W2(e){return`${Math.round(e)}ms`}function A9(e){if(!e)return 0;const t=e/36;return Math.min(Math.round((4+15*t**.25+t/5)*10),3e3)}function C9(e){const t={...w9,...e.easing},n={...E9,...e.duration};return{getAutoHeightDuration:A9,create:(i=["all"],a={})=>{const{duration:o=n.standard,easing:u=t.easeInOut,delay:l=0,...s}=a;return(Array.isArray(i)?i:[i]).map(c=>`${c} ${typeof o=="string"?o:W2(o)} ${u} ${typeof l=="string"?l:W2(l)}`).join(",")},...e,easing:t,duration:n}}const T9={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function M9(e){return Zr(e)||typeof e>"u"||typeof e=="string"||typeof e=="boolean"||typeof e=="number"||Array.isArray(e)}function J2(e={}){const t={...e};function n(r){const i=Object.entries(r);for(let a=0;a<i.length;a++){const[o,u]=i[a];!M9(u)||o.startsWith("unstable_")?delete r[o]:Zr(u)&&(r[o]={...u},n(r[o]))}}return n(t),`import { unstable_createBreakpoints as createBreakpoints, createTransitions } from '@mui/material/styles';
94
83
 
95
84
  const theme = ${JSON.stringify(t,null,2)};
96
85
 
97
86
  theme.breakpoints = createBreakpoints(theme.breakpoints || {});
98
87
  theme.transitions = createTransitions(theme.transitions || {});
99
88
 
100
- export default theme;`}function LE(e){return typeof e=="number"?`${(e*100).toFixed(0)}%`:`calc((${e}) * 100%)`}const Gz=e=>{if(!Number.isNaN(+e))return+e;const t=e.match(/\d*\.?\d+/g);if(!t)return 0;let n=0;for(let r=0;r<t.length;r+=1)n+=+t[r];return n};function Vz(e){Object.assign(e,{alpha(t,n){const r=this||e;return r.colorSpace?`oklch(from ${t} l c h / ${typeof n=="string"?`calc(${n})`:n})`:r.vars?`rgba(${t.replace(/var\(--([^,\s)]+)(?:,[^)]+)?\)+/g,"var(--$1Channel)")} / ${typeof n=="string"?`calc(${n})`:n})`:CE(t,Gz(n))},lighten(t,n){const r=this||e;return r.colorSpace?`color-mix(in ${r.colorSpace}, ${t}, #fff ${LE(n)})`:$d(t,n)},darken(t,n){const r=this||e;return r.colorSpace?`color-mix(in ${r.colorSpace}, ${t}, #000 ${LE(n)})`:kd(t,n)}})}function Ag(e={},...t){const{breakpoints:n,mixins:r={},spacing:a,palette:i={},transitions:o={},typography:s={},shape:l,colorSpace:u,...c}=e;if(e.vars&&e.generateThemeVars===void 0)throw new Error(Ki(20));const f=Eg({...i,colorSpace:u}),d=DE(e);let h=Wn(d,{mixins:Oz(d.breakpoints,r),palette:f,shadows:Uz.slice(),typography:zz(f,s),transitions:Hz(o),zIndex:{...qz}});return h=Wn(h,c),h=t.reduce((g,m)=>Wn(g,m),h),h.unstable_sxConfig={...Od,...c?.unstable_sxConfig},h.unstable_sx=function(m){return Fs({sx:m,theme:this})},h.toRuntimeSource=UE,Vz(h),h}function Xz(e){let t;return e<1?t=5.11916*e**2:t=4.5*Math.log(e+1)+2,Math.round(t*10)/1e3}const Zz=[...Array(25)].map((e,t)=>{if(t===0)return"none";const n=Xz(t);return`linear-gradient(rgba(255 255 255 / ${n}), rgba(255 255 255 / ${n}))`});function PE(e){return{inputPlaceholder:e==="dark"?.5:.42,inputUnderline:e==="dark"?.7:.42,switchTrackDisabled:e==="dark"?.2:.12,switchTrack:e==="dark"?.3:.38}}function jE(e){return e==="dark"?Zz:[]}function Kz(e){const{palette:t={mode:"light"},opacity:n,overlays:r,colorSpace:a,...i}=e,o=Eg({...t,colorSpace:a});return{palette:o,opacity:{...PE(o.mode),...n},overlays:r||jE(o.mode),...i}}function Qz(e){return!!e[0].match(/(cssVarPrefix|colorSchemeSelector|modularCssLayers|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!e[0].match(/sxConfig$/)||e[0]==="palette"&&!!e[1]?.match(/(mode|contrastThreshold|tonalOffset)/)}const Wz=e=>[...[...Array(25)].map((t,n)=>`--${e?`${e}-`:""}overlays-${n}`),`--${e?`${e}-`:""}palette-AppBar-darkBg`,`--${e?`${e}-`:""}palette-AppBar-darkColor`],Jz=e=>(t,n)=>{const r=e.rootSelector||":root",a=e.colorSchemeSelector;let i=a;if(a==="class"&&(i=".%s"),a==="data"&&(i="[data-%s]"),a?.startsWith("data-")&&!a.includes("%s")&&(i=`[${a}="%s"]`),e.defaultColorScheme===t){if(t==="dark"){const o={};return Wz(e.cssVarPrefix).forEach(s=>{o[s]=n[s],delete n[s]}),i==="media"?{[r]:n,"@media (prefers-color-scheme: dark)":{[r]:o}}:i?{[i.replace("%s",t)]:o,[`${r}, ${i.replace("%s",t)}`]:n}:{[r]:{...n,...o}}}if(i&&i!=="media")return`${r}, ${i.replace("%s",String(t))}`}else if(t){if(i==="media")return{[`@media (prefers-color-scheme: ${String(t)})`]:{[r]:n}};if(i)return i.replace("%s",String(t))}return r};function ek(e,t){t.forEach(n=>{e[n]||(e[n]={})})}function Q(e,t,n){!e[t]&&n&&(e[t]=n)}function mu(e){return typeof e!="string"||!e.startsWith("hsl")?e:AE(e)}function Ca(e,t){`${t}Channel`in e||(e[`${t}Channel`]=hu(mu(e[t])))}function tk(e){return typeof e=="number"?`${e}px`:typeof e=="string"||typeof e=="function"||Array.isArray(e)?e:"8px"}const Qr=e=>{try{return e()}catch{}},nk=(e="mui")=>Dz(e);function Cg(e,t,n,r,a){if(!n)return;n=n===!0?{}:n;const i=a==="dark"?"dark":"light";if(!r){t[a]=Kz({...n,palette:{mode:i,...n?.palette},colorSpace:e});return}const{palette:o,...s}=Ag({...r,palette:{mode:i,...n?.palette},colorSpace:e});return t[a]={...n,palette:o,opacity:{...PE(i),...n?.opacity},overlays:n?.overlays||jE(i)},s}function rk(e={},...t){const{colorSchemes:n={light:!0},defaultColorScheme:r,disableCssColorScheme:a=!1,cssVarPrefix:i="mui",nativeColor:o=!1,shouldSkipGeneratingVar:s=Qz,colorSchemeSelector:l=n.light&&n.dark?"media":void 0,rootSelector:u=":root",...c}=e,f=Object.keys(n)[0],d=r||(n.light&&f!=="light"?"light":f),h=nk(i),{[d]:g,light:m,dark:D,...p}=n,v={...p};let y=g;if((d==="dark"&&!("dark"in n)||d==="light"&&!("light"in n))&&(y=!0),!y)throw new Error(Ki(21,d));let w;o&&(w="oklch");const E=Cg(w,v,y,c,d);m&&!v.light&&Cg(w,v,m,void 0,"light"),D&&!v.dark&&Cg(w,v,D,void 0,"dark");let b={defaultColorScheme:d,...E,cssVarPrefix:i,colorSchemeSelector:l,rootSelector:u,getCssVar:h,colorSchemes:v,font:{...Bz(E.typography),...E.font},spacing:tk(c.spacing)};Object.keys(b.colorSchemes).forEach(M=>{const x=b.colorSchemes[M].palette,N=z=>{const B=z.split("-"),k=B[1],$=B[2];return h(z,x[k][$])};x.mode==="light"&&(Q(x.common,"background","#fff"),Q(x.common,"onBackground","#000")),x.mode==="dark"&&(Q(x.common,"background","#000"),Q(x.common,"onBackground","#fff"));function O(z,B,k){if(w){let $;return z===Ji&&($=`transparent ${((1-k)*100).toFixed(0)}%`),z===nt&&($=`#000 ${(k*100).toFixed(0)}%`),z===rt&&($=`#fff ${(k*100).toFixed(0)}%`),`color-mix(in ${w}, ${B}, ${$})`}return z(B,k)}if(ek(x,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),x.mode==="light"){Q(x.Alert,"errorColor",O(nt,x.error.light,.6)),Q(x.Alert,"infoColor",O(nt,x.info.light,.6)),Q(x.Alert,"successColor",O(nt,x.success.light,.6)),Q(x.Alert,"warningColor",O(nt,x.warning.light,.6)),Q(x.Alert,"errorFilledBg",N("palette-error-main")),Q(x.Alert,"infoFilledBg",N("palette-info-main")),Q(x.Alert,"successFilledBg",N("palette-success-main")),Q(x.Alert,"warningFilledBg",N("palette-warning-main")),Q(x.Alert,"errorFilledColor",Qr(()=>x.getContrastText(x.error.main))),Q(x.Alert,"infoFilledColor",Qr(()=>x.getContrastText(x.info.main))),Q(x.Alert,"successFilledColor",Qr(()=>x.getContrastText(x.success.main))),Q(x.Alert,"warningFilledColor",Qr(()=>x.getContrastText(x.warning.main))),Q(x.Alert,"errorStandardBg",O(rt,x.error.light,.9)),Q(x.Alert,"infoStandardBg",O(rt,x.info.light,.9)),Q(x.Alert,"successStandardBg",O(rt,x.success.light,.9)),Q(x.Alert,"warningStandardBg",O(rt,x.warning.light,.9)),Q(x.Alert,"errorIconColor",N("palette-error-main")),Q(x.Alert,"infoIconColor",N("palette-info-main")),Q(x.Alert,"successIconColor",N("palette-success-main")),Q(x.Alert,"warningIconColor",N("palette-warning-main")),Q(x.AppBar,"defaultBg",N("palette-grey-100")),Q(x.Avatar,"defaultBg",N("palette-grey-400")),Q(x.Button,"inheritContainedBg",N("palette-grey-300")),Q(x.Button,"inheritContainedHoverBg",N("palette-grey-A100")),Q(x.Chip,"defaultBorder",N("palette-grey-400")),Q(x.Chip,"defaultAvatarColor",N("palette-grey-700")),Q(x.Chip,"defaultIconColor",N("palette-grey-700")),Q(x.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),Q(x.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),Q(x.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),Q(x.LinearProgress,"primaryBg",O(rt,x.primary.main,.62)),Q(x.LinearProgress,"secondaryBg",O(rt,x.secondary.main,.62)),Q(x.LinearProgress,"errorBg",O(rt,x.error.main,.62)),Q(x.LinearProgress,"infoBg",O(rt,x.info.main,.62)),Q(x.LinearProgress,"successBg",O(rt,x.success.main,.62)),Q(x.LinearProgress,"warningBg",O(rt,x.warning.main,.62)),Q(x.Skeleton,"bg",w?O(Ji,x.text.primary,.11):`rgba(${N("palette-text-primaryChannel")} / 0.11)`),Q(x.Slider,"primaryTrack",O(rt,x.primary.main,.62)),Q(x.Slider,"secondaryTrack",O(rt,x.secondary.main,.62)),Q(x.Slider,"errorTrack",O(rt,x.error.main,.62)),Q(x.Slider,"infoTrack",O(rt,x.info.main,.62)),Q(x.Slider,"successTrack",O(rt,x.success.main,.62)),Q(x.Slider,"warningTrack",O(rt,x.warning.main,.62));const z=w?O(nt,x.background.default,.6825):Id(x.background.default,.8);Q(x.SnackbarContent,"bg",z),Q(x.SnackbarContent,"color",Qr(()=>w?xg.text.primary:x.getContrastText(z))),Q(x.SpeedDialAction,"fabHoverBg",Id(x.background.paper,.15)),Q(x.StepConnector,"border",N("palette-grey-400")),Q(x.StepContent,"border",N("palette-grey-400")),Q(x.Switch,"defaultColor",N("palette-common-white")),Q(x.Switch,"defaultDisabledColor",N("palette-grey-100")),Q(x.Switch,"primaryDisabledColor",O(rt,x.primary.main,.62)),Q(x.Switch,"secondaryDisabledColor",O(rt,x.secondary.main,.62)),Q(x.Switch,"errorDisabledColor",O(rt,x.error.main,.62)),Q(x.Switch,"infoDisabledColor",O(rt,x.info.main,.62)),Q(x.Switch,"successDisabledColor",O(rt,x.success.main,.62)),Q(x.Switch,"warningDisabledColor",O(rt,x.warning.main,.62)),Q(x.TableCell,"border",O(rt,O(Ji,x.divider,1),.88)),Q(x.Tooltip,"bg",O(Ji,x.grey[700],.92))}if(x.mode==="dark"){Q(x.Alert,"errorColor",O(rt,x.error.light,.6)),Q(x.Alert,"infoColor",O(rt,x.info.light,.6)),Q(x.Alert,"successColor",O(rt,x.success.light,.6)),Q(x.Alert,"warningColor",O(rt,x.warning.light,.6)),Q(x.Alert,"errorFilledBg",N("palette-error-dark")),Q(x.Alert,"infoFilledBg",N("palette-info-dark")),Q(x.Alert,"successFilledBg",N("palette-success-dark")),Q(x.Alert,"warningFilledBg",N("palette-warning-dark")),Q(x.Alert,"errorFilledColor",Qr(()=>x.getContrastText(x.error.dark))),Q(x.Alert,"infoFilledColor",Qr(()=>x.getContrastText(x.info.dark))),Q(x.Alert,"successFilledColor",Qr(()=>x.getContrastText(x.success.dark))),Q(x.Alert,"warningFilledColor",Qr(()=>x.getContrastText(x.warning.dark))),Q(x.Alert,"errorStandardBg",O(nt,x.error.light,.9)),Q(x.Alert,"infoStandardBg",O(nt,x.info.light,.9)),Q(x.Alert,"successStandardBg",O(nt,x.success.light,.9)),Q(x.Alert,"warningStandardBg",O(nt,x.warning.light,.9)),Q(x.Alert,"errorIconColor",N("palette-error-main")),Q(x.Alert,"infoIconColor",N("palette-info-main")),Q(x.Alert,"successIconColor",N("palette-success-main")),Q(x.Alert,"warningIconColor",N("palette-warning-main")),Q(x.AppBar,"defaultBg",N("palette-grey-900")),Q(x.AppBar,"darkBg",N("palette-background-paper")),Q(x.AppBar,"darkColor",N("palette-text-primary")),Q(x.Avatar,"defaultBg",N("palette-grey-600")),Q(x.Button,"inheritContainedBg",N("palette-grey-800")),Q(x.Button,"inheritContainedHoverBg",N("palette-grey-700")),Q(x.Chip,"defaultBorder",N("palette-grey-700")),Q(x.Chip,"defaultAvatarColor",N("palette-grey-300")),Q(x.Chip,"defaultIconColor",N("palette-grey-300")),Q(x.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),Q(x.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),Q(x.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),Q(x.LinearProgress,"primaryBg",O(nt,x.primary.main,.5)),Q(x.LinearProgress,"secondaryBg",O(nt,x.secondary.main,.5)),Q(x.LinearProgress,"errorBg",O(nt,x.error.main,.5)),Q(x.LinearProgress,"infoBg",O(nt,x.info.main,.5)),Q(x.LinearProgress,"successBg",O(nt,x.success.main,.5)),Q(x.LinearProgress,"warningBg",O(nt,x.warning.main,.5)),Q(x.Skeleton,"bg",w?O(Ji,x.text.primary,.13):`rgba(${N("palette-text-primaryChannel")} / 0.13)`),Q(x.Slider,"primaryTrack",O(nt,x.primary.main,.5)),Q(x.Slider,"secondaryTrack",O(nt,x.secondary.main,.5)),Q(x.Slider,"errorTrack",O(nt,x.error.main,.5)),Q(x.Slider,"infoTrack",O(nt,x.info.main,.5)),Q(x.Slider,"successTrack",O(nt,x.success.main,.5)),Q(x.Slider,"warningTrack",O(nt,x.warning.main,.5));const z=w?O(rt,x.background.default,.985):Id(x.background.default,.98);Q(x.SnackbarContent,"bg",z),Q(x.SnackbarContent,"color",Qr(()=>w?BE.text.primary:x.getContrastText(z))),Q(x.SpeedDialAction,"fabHoverBg",Id(x.background.paper,.15)),Q(x.StepConnector,"border",N("palette-grey-600")),Q(x.StepContent,"border",N("palette-grey-600")),Q(x.Switch,"defaultColor",N("palette-grey-300")),Q(x.Switch,"defaultDisabledColor",N("palette-grey-600")),Q(x.Switch,"primaryDisabledColor",O(nt,x.primary.main,.55)),Q(x.Switch,"secondaryDisabledColor",O(nt,x.secondary.main,.55)),Q(x.Switch,"errorDisabledColor",O(nt,x.error.main,.55)),Q(x.Switch,"infoDisabledColor",O(nt,x.info.main,.55)),Q(x.Switch,"successDisabledColor",O(nt,x.success.main,.55)),Q(x.Switch,"warningDisabledColor",O(nt,x.warning.main,.55)),Q(x.TableCell,"border",O(nt,O(Ji,x.divider,1),.68)),Q(x.Tooltip,"bg",O(Ji,x.grey[700],.92))}Ca(x.background,"default"),Ca(x.background,"paper"),Ca(x.common,"background"),Ca(x.common,"onBackground"),Ca(x,"divider"),Object.keys(x).forEach(z=>{const B=x[z];z!=="tonalOffset"&&B&&typeof B=="object"&&(B.main&&Q(x[z],"mainChannel",hu(mu(B.main))),B.light&&Q(x[z],"lightChannel",hu(mu(B.light))),B.dark&&Q(x[z],"darkChannel",hu(mu(B.dark))),B.contrastText&&Q(x[z],"contrastTextChannel",hu(mu(B.contrastText))),z==="text"&&(Ca(x[z],"primary"),Ca(x[z],"secondary")),z==="action"&&(B.active&&Ca(x[z],"active"),B.selected&&Ca(x[z],"selected")))})}),b=t.reduce((M,x)=>Wn(M,x),b);const S={prefix:i,disableCssColorScheme:a,shouldSkipGeneratingVar:s,getSelector:Jz(b),enableContrastVars:o},{vars:A,generateThemeVars:C,generateStyleSheets:T}=xz(b,S);return b.vars=A,Object.entries(b.colorSchemes[b.defaultColorScheme]).forEach(([M,x])=>{b[M]=x}),b.generateThemeVars=C,b.generateStyleSheets=T,b.generateSpacing=function(){return bE(c.spacing,gg(this))},b.getColorSchemeSelector=Ez(l),b.spacing=b.generateSpacing(),b.shouldSkipGeneratingVar=s,b.unstable_sxConfig={...Od,...c?.unstable_sxConfig},b.unstable_sx=function(x){return Fs({sx:x,theme:this})},b.toRuntimeSource=UE,b}function HE(e,t,n){e.colorSchemes&&n&&(e.colorSchemes[t]={...n!==!0&&n,palette:Eg({...n===!0?{}:n.palette,mode:t})})}function ak(e={},...t){const{palette:n,cssVariables:r=!1,colorSchemes:a=n?void 0:{light:!0},defaultColorScheme:i=n?.mode,...o}=e,s=i||"light",l=a?.[s],u={...a,...n?{[s]:{...typeof l!="boolean"&&l,palette:n}}:void 0};if(r===!1){if(!("colorSchemes"in e))return Ag(e,...t);let c=n;"palette"in e||u[s]&&(u[s]!==!0?c=u[s].palette:s==="dark"&&(c={mode:"dark"}));const f=Ag({...e,palette:c},...t);return f.defaultColorScheme=s,f.colorSchemes=u,f.palette.mode==="light"&&(f.colorSchemes.light={...u.light!==!0&&u.light,palette:f.palette},HE(f,"dark",u.dark)),f.palette.mode==="dark"&&(f.colorSchemes.dark={...u.dark!==!0&&u.dark,palette:f.palette},HE(f,"light",u.light)),f}return!n&&!("light"in u)&&s==="light"&&(u.light=!0),rk({...o,colorSchemes:u,defaultColorScheme:s,...typeof r!="boolean"&&r},...t)}const ik=ak();function ok(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const Tg=e=>ok(e)&&e!=="classes",ht=tz({themeId:qB,defaultTheme:ik,rootShouldForwardProp:Tg}),un=bz;function An(e){return gz(e)}function sk(e){return yn("MuiSvgIcon",e)}bn("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const lk=e=>{const{color:t,fontSize:n,classes:r}=e,a={root:["root",t!=="inherit"&&`color${Fe(t)}`,`fontSize${Fe(n)}`]};return En(a,sk,r)},uk=ht("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="inherit"&&t[`color${Fe(n.color)}`],t[`fontSize${Fe(n.fontSize)}`]]}})(un(({theme:e})=>({userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:e.transitions?.create?.("fill",{duration:(e.vars??e).transitions?.duration?.shorter}),variants:[{props:t=>!t.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:e.typography?.pxToRem?.(20)||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:e.typography?.pxToRem?.(24)||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:e.typography?.pxToRem?.(35)||"2.1875rem"}},...Object.entries((e.vars??e).palette).filter(([,t])=>t&&t.main).map(([t])=>({props:{color:t},style:{color:(e.vars??e).palette?.[t]?.main}})),{props:{color:"action"},style:{color:(e.vars??e).palette?.action?.active}},{props:{color:"disabled"},style:{color:(e.vars??e).palette?.action?.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}))),Mg=_.forwardRef(function(t,n){const r=An({props:t,name:"MuiSvgIcon"}),{children:a,className:i,color:o="inherit",component:s="svg",fontSize:l="medium",htmlColor:u,inheritViewBox:c=!1,titleAccess:f,viewBox:d="0 0 24 24",...h}=r,g=_.isValidElement(a)&&a.type==="svg",m={...r,color:o,component:s,fontSize:l,instanceFontSize:t.fontSize,inheritViewBox:c,viewBox:d,hasSvgAsChild:g},D={};c||(D.viewBox=d);const p=lk(m);return F.jsxs(uk,{as:s,className:st(p.root,i),focusable:"false",color:u,"aria-hidden":f?void 0:!0,role:f?"img":void 0,ref:n,...D,...h,...g&&a.props,ownerState:m,children:[g?a.props.children:a,f?F.jsx("title",{children:f}):null]})});Mg.muiName="SvgIcon";function _g(e,t){function n(r,a){return F.jsx(Mg,{"data-testid":void 0,ref:a,...r,children:e})}return n.muiName=Mg.muiName,_.memo(_.forwardRef(n))}function ck(e){const{controlled:t,default:n}=e,{current:r}=_.useRef(t!==void 0),[a,i]=_.useState(n),o=r?t:a,s=_.useCallback(l=>{r||i(l)},[]);return[o,s]}function Ud(e){const t=_.useRef(e);return oz(()=>{t.current=e}),_.useRef((...n)=>(0,t.current)(...n)).current}function Ng(...e){const t=_.useRef(void 0),n=_.useCallback(r=>{const a=e.map(i=>{if(i==null)return null;if(typeof i=="function"){const o=i,s=o(r);return typeof s=="function"?s:()=>{o(null)}}return i.current=r,()=>{i.current=null}});return()=>{a.forEach(i=>i?.())}},e);return _.useMemo(()=>e.every(r=>r==null)?null:r=>{t.current&&(t.current(),t.current=void 0),r!=null&&(t.current=n(r))},e)}function fk(e,t){const n=e.charCodeAt(2);return e[0]==="o"&&e[1]==="n"&&n>=65&&n<=90&&typeof t=="function"}function dk(e,t){if(!e)return t;function n(o,s){const l={};return Object.keys(s).forEach(u=>{fk(u,s[u])&&typeof o[u]=="function"&&(l[u]=(...c)=>{o[u](...c),s[u](...c)})}),l}if(typeof e=="function"||typeof t=="function")return o=>{const s=typeof t=="function"?t(o):t,l=typeof e=="function"?e({...o,...s}):e,u=st(o?.className,s?.className,l?.className),c=n(l,s);return{...s,...l,...c,...!!u&&{className:u},...s?.style&&l?.style&&{style:{...s.style,...l.style}},...s?.sx&&l?.sx&&{sx:[...Array.isArray(s.sx)?s.sx:[s.sx],...Array.isArray(l.sx)?l.sx:[l.sx]]}}};const r=t,a=n(e,r),i=st(r?.className,e?.className);return{...t,...e,...a,...!!i&&{className:i},...r?.style&&e?.style&&{style:{...r.style,...e.style}},...r?.sx&&e?.sx&&{sx:[...Array.isArray(r.sx)?r.sx:[r.sx],...Array.isArray(e.sx)?e.sx:[e.sx]]}}}function hk(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Fg(e,t){return Fg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Fg(e,t)}function mk(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Fg(e,t)}const qE=Rt.createContext(null);function pk(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Bg(e,t){var n=function(i){return t&&_.isValidElement(i)?t(i):i},r=Object.create(null);return e&&_.Children.map(e,function(a){return a}).forEach(function(a){r[a.key]=n(a)}),r}function gk(e,t){e=e||{},t=t||{};function n(c){return c in t?t[c]:e[c]}var r=Object.create(null),a=[];for(var i in e)i in t?a.length&&(r[i]=a,a=[]):a.push(i);var o,s={};for(var l in t){if(r[l])for(o=0;o<r[l].length;o++){var u=r[l][o];s[r[l][o]]=n(u)}s[l]=n(l)}for(o=0;o<a.length;o++)s[a[o]]=n(a[o]);return s}function eo(e,t,n){return n[t]!=null?n[t]:e.props[t]}function vk(e,t){return Bg(e.children,function(n){return _.cloneElement(n,{onExited:t.bind(null,n),in:!0,appear:eo(n,"appear",e),enter:eo(n,"enter",e),exit:eo(n,"exit",e)})})}function yk(e,t,n){var r=Bg(e.children),a=gk(t,r);return Object.keys(a).forEach(function(i){var o=a[i];if(_.isValidElement(o)){var s=i in t,l=i in r,u=t[i],c=_.isValidElement(u)&&!u.props.in;l&&(!s||c)?a[i]=_.cloneElement(o,{onExited:n.bind(null,o),in:!0,exit:eo(o,"exit",e),enter:eo(o,"enter",e)}):!l&&s&&!c?a[i]=_.cloneElement(o,{in:!1}):l&&s&&_.isValidElement(u)&&(a[i]=_.cloneElement(o,{onExited:n.bind(null,o),in:u.props.in,exit:eo(o,"exit",e),enter:eo(o,"enter",e)}))}}),a}var bk=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},Dk={component:"div",childFactory:function(t){return t}},Og=function(e){mk(t,e);function t(r,a){var i;i=e.call(this,r,a)||this;var o=i.handleExited.bind(pk(i));return i.state={contextValue:{isMounting:!0},handleExited:o,firstRender:!0},i}var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(a,i){var o=i.children,s=i.handleExited,l=i.firstRender;return{children:l?vk(a,s):yk(a,o,s),firstRender:!1}},n.handleExited=function(a,i){var o=Bg(this.props.children);a.key in o||(a.props.onExited&&a.props.onExited(i),this.mounted&&this.setState(function(s){var l=oi({},s.children);return delete l[a.key],{children:l}}))},n.render=function(){var a=this.props,i=a.component,o=a.childFactory,s=hk(a,["component","childFactory"]),l=this.state.contextValue,u=bk(this.state.children).map(o);return delete s.appear,delete s.enter,delete s.exit,i===null?Rt.createElement(qE.Provider,{value:l},u):Rt.createElement(qE.Provider,{value:l},Rt.createElement(i,s,u))},t}(Rt.Component);Og.propTypes={},Og.defaultProps=Dk;const YE={};function GE(e,t){const n=_.useRef(YE);return n.current===YE&&(n.current=e(t)),n}const Sk=[];function wk(e){_.useEffect(e,Sk)}class Rg{static create(){return new Rg}currentId=null;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,n()},t)}clear=()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)};disposeEffect=()=>this.clear}function xk(){const e=GE(Rg.create).current;return wk(e.disposeEffect),e}function Ek(e){return typeof e=="string"}function Ak(e,t,n){return e===void 0||Ek(e)?t:{...t,ownerState:{...t.ownerState,...n}}}function Ck(e,t,n){return typeof e=="function"?e(t,n):e}function Tk(e,t=[]){if(e===void 0)return{};const n={};return Object.keys(e).filter(r=>r.match(/^on[A-Z]/)&&typeof e[r]=="function"&&!t.includes(r)).forEach(r=>{n[r]=e[r]}),n}function VE(e){if(e===void 0)return{};const t={};return Object.keys(e).filter(n=>!(n.match(/^on[A-Z]/)&&typeof e[n]=="function")).forEach(n=>{t[n]=e[n]}),t}function Mk(e){const{getSlotProps:t,additionalProps:n,externalSlotProps:r,externalForwardedProps:a,className:i}=e;if(!t){const h=st(n?.className,i,a?.className,r?.className),g={...n?.style,...a?.style,...r?.style},m={...n,...a,...r};return h.length>0&&(m.className=h),Object.keys(g).length>0&&(m.style=g),{props:m,internalRef:void 0}}const o=Tk({...a,...r}),s=VE(r),l=VE(a),u=t(o),c=st(u?.className,n?.className,i,a?.className,r?.className),f={...u?.style,...n?.style,...a?.style,...r?.style},d={...u,...n,...l,...s};return c.length>0&&(d.className=c),Object.keys(f).length>0&&(d.style=f),{props:d,internalRef:u.ref}}function Bs(e,t){const{className:n,elementType:r,ownerState:a,externalForwardedProps:i,internalForwardedProps:o,shouldForwardComponentProp:s=!1,...l}=t,{component:u,slots:c={[e]:void 0},slotProps:f={[e]:void 0},...d}=i,h=c[e]||r,g=Ck(f[e],a),{props:{component:m,...D},internalRef:p}=Mk({className:n,...l,externalForwardedProps:e==="root"?d:void 0,externalSlotProps:g}),v=Ng(p,g?.ref,t.ref),y=e==="root"?m||u:m,w=Ak(h,{...e==="root"&&!u&&!c[e]&&o,...e!=="root"&&!c[e]&&o,...D,...y&&!s&&{as:y},...y&&s&&{component:y},ref:v},a);return[h,w]}function XE(e){try{return e.matches(":focus-visible")}catch{}return!1}class Ld{static create(){return new Ld}static use(){const t=GE(Ld.create).current,[n,r]=_.useState(!1);return t.shouldMount=n,t.setShouldMount=r,_.useEffect(t.mountEffect,[n]),t}constructor(){this.ref={current:null},this.mounted=null,this.didMount=!1,this.shouldMount=!1,this.setShouldMount=null}mount(){return this.mounted||(this.mounted=Nk(),this.shouldMount=!0,this.setShouldMount(this.shouldMount)),this.mounted}mountEffect=()=>{this.shouldMount&&!this.didMount&&this.ref.current!==null&&(this.didMount=!0,this.mounted.resolve())};start(...t){this.mount().then(()=>this.ref.current?.start(...t))}stop(...t){this.mount().then(()=>this.ref.current?.stop(...t))}pulsate(...t){this.mount().then(()=>this.ref.current?.pulsate(...t))}}function _k(){return Ld.use()}function Nk(){let e,t;const n=new Promise((r,a)=>{e=r,t=a});return n.resolve=e,n.reject=t,n}function Fk(e){const{className:t,classes:n,pulsate:r=!1,rippleX:a,rippleY:i,rippleSize:o,in:s,onExited:l,timeout:u}=e,[c,f]=_.useState(!1),d=st(t,n.ripple,n.rippleVisible,r&&n.ripplePulsate),h={width:o,height:o,top:-(o/2)+i,left:-(o/2)+a},g=st(n.child,c&&n.childLeaving,r&&n.childPulsate);return!s&&!c&&f(!0),_.useEffect(()=>{if(!s&&l!=null){const m=setTimeout(l,u);return()=>{clearTimeout(m)}}},[l,s,u]),F.jsx("span",{className:d,style:h,children:F.jsx("span",{className:g})})}const yr=bn("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),zg=550,Bk=80,Ok=pi`
89
+ export default theme;`}function eS(e){return typeof e=="number"?`${(e*100).toFixed(0)}%`:`calc((${e}) * 100%)`}const _9=e=>{if(!Number.isNaN(+e))return+e;const t=e.match(/\d*\.?\d+/g);if(!t)return 0;let n=0;for(let r=0;r<t.length;r+=1)n+=+t[r];return n};function B9(e){Object.assign(e,{alpha(t,n){const r=this||e;return r.colorSpace?`oklch(from ${t} l c h / ${typeof n=="string"?`calc(${n})`:n})`:r.vars?`rgba(${t.replace(/var\(--([^,\s)]+)(?:,[^)]+)?\)+/g,"var(--$1Channel)")} / ${typeof n=="string"?`calc(${n})`:n})`:L2(t,_9(n))},lighten(t,n){const r=this||e;return r.colorSpace?`color-mix(in ${r.colorSpace}, ${t}, #fff ${eS(n)})`:gf(t,n)},darken(t,n){const r=this||e;return r.colorSpace?`color-mix(in ${r.colorSpace}, ${t}, #000 ${eS(n)})`:pf(t,n)}})}function Em(e={},...t){const{breakpoints:n,mixins:r={},spacing:i,palette:a={},transitions:o={},typography:u={},shape:l,colorSpace:s,...c}=e;if(e.vars&&e.generateThemeVars===void 0)throw new Error(la(20));const f=wm({...a,colorSpace:s}),d=O2(e);let h=On(d,{mixins:g9(d.breakpoints,r),palette:f,shadows:x9.slice(),typography:y9(f,u),transitions:C9(o),zIndex:{...T9}});return h=On(h,c),h=t.reduce((v,m)=>On(v,m),h),h.unstable_sxConfig={...df,...c?.unstable_sxConfig},h.unstable_sx=function(m){return Bo({sx:m,theme:this})},h.toRuntimeSource=J2,B9(h),h}function F9(e){let t;return e<1?t=5.11916*e**2:t=4.5*Math.log(e+1)+2,Math.round(t*10)/1e3}const N9=[...Array(25)].map((e,t)=>{if(t===0)return"none";const n=F9(t);return`linear-gradient(rgba(255 255 255 / ${n}), rgba(255 255 255 / ${n}))`});function tS(e){return{inputPlaceholder:e==="dark"?.5:.42,inputUnderline:e==="dark"?.7:.42,switchTrackDisabled:e==="dark"?.2:.12,switchTrack:e==="dark"?.3:.38}}function nS(e){return e==="dark"?N9:[]}function R9(e){const{palette:t={mode:"light"},opacity:n,overlays:r,colorSpace:i,...a}=e,o=wm({...t,colorSpace:i});return{palette:o,opacity:{...tS(o.mode),...n},overlays:r||nS(o.mode),...a}}function O9(e){return!!e[0].match(/(cssVarPrefix|colorSchemeSelector|modularCssLayers|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!e[0].match(/sxConfig$/)||e[0]==="palette"&&!!e[1]?.match(/(mode|contrastThreshold|tonalOffset)/)}const z9=e=>[...[...Array(25)].map((t,n)=>`--${e?`${e}-`:""}overlays-${n}`),`--${e?`${e}-`:""}palette-AppBar-darkBg`,`--${e?`${e}-`:""}palette-AppBar-darkColor`],U9=e=>(t,n)=>{const r=e.rootSelector||":root",i=e.colorSchemeSelector;let a=i;if(i==="class"&&(a=".%s"),i==="data"&&(a="[data-%s]"),i?.startsWith("data-")&&!i.includes("%s")&&(a=`[${i}="%s"]`),e.defaultColorScheme===t){if(t==="dark"){const o={};return z9(e.cssVarPrefix).forEach(u=>{o[u]=n[u],delete n[u]}),a==="media"?{[r]:n,"@media (prefers-color-scheme: dark)":{[r]:o}}:a?{[a.replace("%s",t)]:o,[`${r}, ${a.replace("%s",t)}`]:n}:{[r]:{...n,...o}}}if(a&&a!=="media")return`${r}, ${a.replace("%s",String(t))}`}else if(t){if(a==="media")return{[`@media (prefers-color-scheme: ${String(t)})`]:{[r]:n}};if(a)return a.replace("%s",String(t))}return r};function I9(e,t){t.forEach(n=>{e[n]||(e[n]={})})}function K(e,t,n){!e[t]&&n&&(e[t]=n)}function sl(e){return typeof e!="string"||!e.startsWith("hsl")?e:k2(e)}function Kr(e,t){`${t}Channel`in e||(e[`${t}Channel`]=ll(sl(e[t])))}function $9(e){return typeof e=="number"?`${e}px`:typeof e=="string"||typeof e=="function"||Array.isArray(e)?e:"8px"}const Tr=e=>{try{return e()}catch{}},k9=(e="mui")=>r9(e);function Am(e,t,n,r,i){if(!n)return;n=n===!0?{}:n;const a=i==="dark"?"dark":"light";if(!r){t[i]=R9({...n,palette:{mode:a,...n?.palette},colorSpace:e});return}const{palette:o,...u}=Em({...r,palette:{mode:a,...n?.palette},colorSpace:e});return t[i]={...n,palette:o,opacity:{...tS(a),...n?.opacity},overlays:n?.overlays||nS(a)},u}function L9(e={},...t){const{colorSchemes:n={light:!0},defaultColorScheme:r,disableCssColorScheme:i=!1,cssVarPrefix:a="mui",nativeColor:o=!1,shouldSkipGeneratingVar:u=O9,colorSchemeSelector:l=n.light&&n.dark?"media":void 0,rootSelector:s=":root",...c}=e,f=Object.keys(n)[0],d=r||(n.light&&f!=="light"?"light":f),h=k9(a),{[d]:v,light:m,dark:D,...p}=n,g={...p};let y=v;if((d==="dark"&&!("dark"in n)||d==="light"&&!("light"in n))&&(y=!0),!y)throw new Error(la(21,d));let S;o&&(S="oklch");const w=Am(S,g,y,c,d);m&&!g.light&&Am(S,g,m,void 0,"light"),D&&!g.dark&&Am(S,g,D,void 0,"dark");let b={defaultColorScheme:d,...w,cssVarPrefix:a,colorSchemeSelector:l,rootSelector:s,getCssVar:h,colorSchemes:g,font:{...p9(w.typography),...w.font},spacing:$9(c.spacing)};Object.keys(b.colorSchemes).forEach(_=>{const x=b.colorSchemes[_].palette,F=z=>{const N=z.split("-"),U=N[1],I=N[2];return h(z,x[U][I])};x.mode==="light"&&(K(x.common,"background","#fff"),K(x.common,"onBackground","#000")),x.mode==="dark"&&(K(x.common,"background","#000"),K(x.common,"onBackground","#fff"));function R(z,N,U){if(S){let I;return z===fa&&(I=`transparent ${((1-U)*100).toFixed(0)}%`),z===Ye&&(I=`#000 ${(U*100).toFixed(0)}%`),z===Xe&&(I=`#fff ${(U*100).toFixed(0)}%`),`color-mix(in ${S}, ${N}, ${I})`}return z(N,U)}if(I9(x,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),x.mode==="light"){K(x.Alert,"errorColor",R(Ye,x.error.light,.6)),K(x.Alert,"infoColor",R(Ye,x.info.light,.6)),K(x.Alert,"successColor",R(Ye,x.success.light,.6)),K(x.Alert,"warningColor",R(Ye,x.warning.light,.6)),K(x.Alert,"errorFilledBg",F("palette-error-main")),K(x.Alert,"infoFilledBg",F("palette-info-main")),K(x.Alert,"successFilledBg",F("palette-success-main")),K(x.Alert,"warningFilledBg",F("palette-warning-main")),K(x.Alert,"errorFilledColor",Tr(()=>x.getContrastText(x.error.main))),K(x.Alert,"infoFilledColor",Tr(()=>x.getContrastText(x.info.main))),K(x.Alert,"successFilledColor",Tr(()=>x.getContrastText(x.success.main))),K(x.Alert,"warningFilledColor",Tr(()=>x.getContrastText(x.warning.main))),K(x.Alert,"errorStandardBg",R(Xe,x.error.light,.9)),K(x.Alert,"infoStandardBg",R(Xe,x.info.light,.9)),K(x.Alert,"successStandardBg",R(Xe,x.success.light,.9)),K(x.Alert,"warningStandardBg",R(Xe,x.warning.light,.9)),K(x.Alert,"errorIconColor",F("palette-error-main")),K(x.Alert,"infoIconColor",F("palette-info-main")),K(x.Alert,"successIconColor",F("palette-success-main")),K(x.Alert,"warningIconColor",F("palette-warning-main")),K(x.AppBar,"defaultBg",F("palette-grey-100")),K(x.Avatar,"defaultBg",F("palette-grey-400")),K(x.Button,"inheritContainedBg",F("palette-grey-300")),K(x.Button,"inheritContainedHoverBg",F("palette-grey-A100")),K(x.Chip,"defaultBorder",F("palette-grey-400")),K(x.Chip,"defaultAvatarColor",F("palette-grey-700")),K(x.Chip,"defaultIconColor",F("palette-grey-700")),K(x.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),K(x.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),K(x.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),K(x.LinearProgress,"primaryBg",R(Xe,x.primary.main,.62)),K(x.LinearProgress,"secondaryBg",R(Xe,x.secondary.main,.62)),K(x.LinearProgress,"errorBg",R(Xe,x.error.main,.62)),K(x.LinearProgress,"infoBg",R(Xe,x.info.main,.62)),K(x.LinearProgress,"successBg",R(Xe,x.success.main,.62)),K(x.LinearProgress,"warningBg",R(Xe,x.warning.main,.62)),K(x.Skeleton,"bg",S?R(fa,x.text.primary,.11):`rgba(${F("palette-text-primaryChannel")} / 0.11)`),K(x.Slider,"primaryTrack",R(Xe,x.primary.main,.62)),K(x.Slider,"secondaryTrack",R(Xe,x.secondary.main,.62)),K(x.Slider,"errorTrack",R(Xe,x.error.main,.62)),K(x.Slider,"infoTrack",R(Xe,x.info.main,.62)),K(x.Slider,"successTrack",R(Xe,x.success.main,.62)),K(x.Slider,"warningTrack",R(Xe,x.warning.main,.62));const z=S?R(Ye,x.background.default,.6825):vf(x.background.default,.8);K(x.SnackbarContent,"bg",z),K(x.SnackbarContent,"color",Tr(()=>S?xm.text.primary:x.getContrastText(z))),K(x.SpeedDialAction,"fabHoverBg",vf(x.background.paper,.15)),K(x.StepConnector,"border",F("palette-grey-400")),K(x.StepContent,"border",F("palette-grey-400")),K(x.Switch,"defaultColor",F("palette-common-white")),K(x.Switch,"defaultDisabledColor",F("palette-grey-100")),K(x.Switch,"primaryDisabledColor",R(Xe,x.primary.main,.62)),K(x.Switch,"secondaryDisabledColor",R(Xe,x.secondary.main,.62)),K(x.Switch,"errorDisabledColor",R(Xe,x.error.main,.62)),K(x.Switch,"infoDisabledColor",R(Xe,x.info.main,.62)),K(x.Switch,"successDisabledColor",R(Xe,x.success.main,.62)),K(x.Switch,"warningDisabledColor",R(Xe,x.warning.main,.62)),K(x.TableCell,"border",R(Xe,R(fa,x.divider,1),.88)),K(x.Tooltip,"bg",R(fa,x.grey[700],.92))}if(x.mode==="dark"){K(x.Alert,"errorColor",R(Xe,x.error.light,.6)),K(x.Alert,"infoColor",R(Xe,x.info.light,.6)),K(x.Alert,"successColor",R(Xe,x.success.light,.6)),K(x.Alert,"warningColor",R(Xe,x.warning.light,.6)),K(x.Alert,"errorFilledBg",F("palette-error-dark")),K(x.Alert,"infoFilledBg",F("palette-info-dark")),K(x.Alert,"successFilledBg",F("palette-success-dark")),K(x.Alert,"warningFilledBg",F("palette-warning-dark")),K(x.Alert,"errorFilledColor",Tr(()=>x.getContrastText(x.error.dark))),K(x.Alert,"infoFilledColor",Tr(()=>x.getContrastText(x.info.dark))),K(x.Alert,"successFilledColor",Tr(()=>x.getContrastText(x.success.dark))),K(x.Alert,"warningFilledColor",Tr(()=>x.getContrastText(x.warning.dark))),K(x.Alert,"errorStandardBg",R(Ye,x.error.light,.9)),K(x.Alert,"infoStandardBg",R(Ye,x.info.light,.9)),K(x.Alert,"successStandardBg",R(Ye,x.success.light,.9)),K(x.Alert,"warningStandardBg",R(Ye,x.warning.light,.9)),K(x.Alert,"errorIconColor",F("palette-error-main")),K(x.Alert,"infoIconColor",F("palette-info-main")),K(x.Alert,"successIconColor",F("palette-success-main")),K(x.Alert,"warningIconColor",F("palette-warning-main")),K(x.AppBar,"defaultBg",F("palette-grey-900")),K(x.AppBar,"darkBg",F("palette-background-paper")),K(x.AppBar,"darkColor",F("palette-text-primary")),K(x.Avatar,"defaultBg",F("palette-grey-600")),K(x.Button,"inheritContainedBg",F("palette-grey-800")),K(x.Button,"inheritContainedHoverBg",F("palette-grey-700")),K(x.Chip,"defaultBorder",F("palette-grey-700")),K(x.Chip,"defaultAvatarColor",F("palette-grey-300")),K(x.Chip,"defaultIconColor",F("palette-grey-300")),K(x.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),K(x.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),K(x.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),K(x.LinearProgress,"primaryBg",R(Ye,x.primary.main,.5)),K(x.LinearProgress,"secondaryBg",R(Ye,x.secondary.main,.5)),K(x.LinearProgress,"errorBg",R(Ye,x.error.main,.5)),K(x.LinearProgress,"infoBg",R(Ye,x.info.main,.5)),K(x.LinearProgress,"successBg",R(Ye,x.success.main,.5)),K(x.LinearProgress,"warningBg",R(Ye,x.warning.main,.5)),K(x.Skeleton,"bg",S?R(fa,x.text.primary,.13):`rgba(${F("palette-text-primaryChannel")} / 0.13)`),K(x.Slider,"primaryTrack",R(Ye,x.primary.main,.5)),K(x.Slider,"secondaryTrack",R(Ye,x.secondary.main,.5)),K(x.Slider,"errorTrack",R(Ye,x.error.main,.5)),K(x.Slider,"infoTrack",R(Ye,x.info.main,.5)),K(x.Slider,"successTrack",R(Ye,x.success.main,.5)),K(x.Slider,"warningTrack",R(Ye,x.warning.main,.5));const z=S?R(Xe,x.background.default,.985):vf(x.background.default,.98);K(x.SnackbarContent,"bg",z),K(x.SnackbarContent,"color",Tr(()=>S?G2.text.primary:x.getContrastText(z))),K(x.SpeedDialAction,"fabHoverBg",vf(x.background.paper,.15)),K(x.StepConnector,"border",F("palette-grey-600")),K(x.StepContent,"border",F("palette-grey-600")),K(x.Switch,"defaultColor",F("palette-grey-300")),K(x.Switch,"defaultDisabledColor",F("palette-grey-600")),K(x.Switch,"primaryDisabledColor",R(Ye,x.primary.main,.55)),K(x.Switch,"secondaryDisabledColor",R(Ye,x.secondary.main,.55)),K(x.Switch,"errorDisabledColor",R(Ye,x.error.main,.55)),K(x.Switch,"infoDisabledColor",R(Ye,x.info.main,.55)),K(x.Switch,"successDisabledColor",R(Ye,x.success.main,.55)),K(x.Switch,"warningDisabledColor",R(Ye,x.warning.main,.55)),K(x.TableCell,"border",R(Ye,R(fa,x.divider,1),.68)),K(x.Tooltip,"bg",R(fa,x.grey[700],.92))}Kr(x.background,"default"),Kr(x.background,"paper"),Kr(x.common,"background"),Kr(x.common,"onBackground"),Kr(x,"divider"),Object.keys(x).forEach(z=>{const N=x[z];z!=="tonalOffset"&&N&&typeof N=="object"&&(N.main&&K(x[z],"mainChannel",ll(sl(N.main))),N.light&&K(x[z],"lightChannel",ll(sl(N.light))),N.dark&&K(x[z],"darkChannel",ll(sl(N.dark))),N.contrastText&&K(x[z],"contrastTextChannel",ll(sl(N.contrastText))),z==="text"&&(Kr(x[z],"primary"),Kr(x[z],"secondary")),z==="action"&&(N.active&&Kr(x[z],"active"),N.selected&&Kr(x[z],"selected")))})}),b=t.reduce((_,x)=>On(_,x),b);const E={prefix:a,disableCssColorScheme:i,shouldSkipGeneratingVar:u,getSelector:U9(b),enableContrastVars:o},{vars:C,generateThemeVars:A,generateStyleSheets:T}=o9(b,E);return b.vars=C,Object.entries(b.colorSchemes[b.defaultColorScheme]).forEach(([_,x])=>{b[_]=x}),b.generateThemeVars=A,b.generateStyleSheets=T,b.generateSpacing=function(){return R2(c.spacing,pm(this))},b.getColorSchemeSelector=u9(l),b.spacing=b.generateSpacing(),b.shouldSkipGeneratingVar=u,b.unstable_sxConfig={...df,...c?.unstable_sxConfig},b.unstable_sx=function(x){return Bo({sx:x,theme:this})},b.toRuntimeSource=J2,b}function rS(e,t,n){e.colorSchemes&&n&&(e.colorSchemes[t]={...n!==!0&&n,palette:wm({...n===!0?{}:n.palette,mode:t})})}function j9(e={},...t){const{palette:n,cssVariables:r=!1,colorSchemes:i=n?void 0:{light:!0},defaultColorScheme:a=n?.mode,...o}=e,u=a||"light",l=i?.[u],s={...i,...n?{[u]:{...typeof l!="boolean"&&l,palette:n}}:void 0};if(r===!1){if(!("colorSchemes"in e))return Em(e,...t);let c=n;"palette"in e||s[u]&&(s[u]!==!0?c=s[u].palette:u==="dark"&&(c={mode:"dark"}));const f=Em({...e,palette:c},...t);return f.defaultColorScheme=u,f.colorSchemes=s,f.palette.mode==="light"&&(f.colorSchemes.light={...s.light!==!0&&s.light,palette:f.palette},rS(f,"dark",s.dark)),f.palette.mode==="dark"&&(f.colorSchemes.dark={...s.dark!==!0&&s.dark,palette:f.palette},rS(f,"light",s.light)),f}return!n&&!("light"in s)&&u==="light"&&(s.light=!0),L9({...o,colorSchemes:s,defaultColorScheme:u,...typeof r!="boolean"&&r},...t)}const H9=j9();function P9(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const Cm=e=>P9(e)&&e!=="classes",wt=L6({themeId:O_,defaultTheme:H9,rootShouldForwardProp:Cm}),In=n9;function $n(e){return J6(e)}function q9(e){return yn("MuiSvgIcon",e)}bn("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const V9=e=>{const{color:t,fontSize:n,classes:r}=e,i={root:["root",t!=="inherit"&&`color${Ue(t)}`,`fontSize${Ue(n)}`]};return Un(i,q9,r)},G9=wt("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="inherit"&&t[`color${Ue(n.color)}`],t[`fontSize${Ue(n.fontSize)}`]]}})(In(({theme:e})=>({userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:e.transitions?.create?.("fill",{duration:(e.vars??e).transitions?.duration?.shorter}),variants:[{props:t=>!t.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:e.typography?.pxToRem?.(20)||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:e.typography?.pxToRem?.(24)||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:e.typography?.pxToRem?.(35)||"2.1875rem"}},...Object.entries((e.vars??e).palette).filter(([,t])=>t&&t.main).map(([t])=>({props:{color:t},style:{color:(e.vars??e).palette?.[t]?.main}})),{props:{color:"action"},style:{color:(e.vars??e).palette?.action?.active}},{props:{color:"disabled"},style:{color:(e.vars??e).palette?.action?.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}))),Tm=M.forwardRef(function(t,n){const r=$n({props:t,name:"MuiSvgIcon"}),{children:i,className:a,color:o="inherit",component:u="svg",fontSize:l="medium",htmlColor:s,inheritViewBox:c=!1,titleAccess:f,viewBox:d="0 0 24 24",...h}=r,v=M.isValidElement(i)&&i.type==="svg",m={...r,color:o,component:u,fontSize:l,instanceFontSize:t.fontSize,inheritViewBox:c,viewBox:d,hasSvgAsChild:v},D={};c||(D.viewBox=d);const p=V9(m);return B.jsxs(G9,{as:u,className:at(p.root,a),focusable:"false",color:s,"aria-hidden":f?void 0:!0,role:f?"img":void 0,ref:n,...D,...h,...v&&i.props,ownerState:m,children:[v?i.props.children:i,f?B.jsx("title",{children:f}):null]})});Tm.muiName="SvgIcon";function Mm(e,t){function n(r,i){return B.jsx(Tm,{"data-testid":void 0,ref:i,...r,children:e})}return n.muiName=Tm.muiName,M.memo(M.forwardRef(n))}function Y9(e){const{controlled:t,default:n}=e,{current:r}=M.useRef(t!==void 0),[i,a]=M.useState(n),o=r?t:i,u=M.useCallback(l=>{r||a(l)},[]);return[o,u]}function yf(e){const t=M.useRef(e);return V6(()=>{t.current=e}),M.useRef((...n)=>(0,t.current)(...n)).current}function _m(...e){const t=M.useRef(void 0),n=M.useCallback(r=>{const i=e.map(a=>{if(a==null)return null;if(typeof a=="function"){const o=a,u=o(r);return typeof u=="function"?u:()=>{o(null)}}return a.current=r,()=>{a.current=null}});return()=>{i.forEach(a=>a?.())}},e);return M.useMemo(()=>e.every(r=>r==null)?null:r=>{t.current&&(t.current(),t.current=void 0),r!=null&&(t.current=n(r))},e)}function X9(e,t){const n=e.charCodeAt(2);return e[0]==="o"&&e[1]==="n"&&n>=65&&n<=90&&typeof t=="function"}function Z9(e,t){if(!e)return t;function n(o,u){const l={};return Object.keys(u).forEach(s=>{X9(s,u[s])&&typeof o[s]=="function"&&(l[s]=(...c)=>{o[s](...c),u[s](...c)})}),l}if(typeof e=="function"||typeof t=="function")return o=>{const u=typeof t=="function"?t(o):t,l=typeof e=="function"?e({...o,...u}):e,s=at(o?.className,u?.className,l?.className),c=n(l,u);return{...u,...l,...c,...!!s&&{className:s},...u?.style&&l?.style&&{style:{...u.style,...l.style}},...u?.sx&&l?.sx&&{sx:[...Array.isArray(u.sx)?u.sx:[u.sx],...Array.isArray(l.sx)?l.sx:[l.sx]]}}};const r=t,i=n(e,r),a=at(r?.className,e?.className);return{...t,...e,...i,...!!a&&{className:a},...r?.style&&e?.style&&{style:{...r.style,...e.style}},...r?.sx&&e?.sx&&{sx:[...Array.isArray(r.sx)?r.sx:[r.sx],...Array.isArray(e.sx)?e.sx:[e.sx]]}}}function Q9(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Bm(e,t){return Bm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Bm(e,t)}function K9(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Bm(e,t)}const iS=Nt.createContext(null);function W9(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Fm(e,t){var n=function(a){return t&&M.isValidElement(a)?t(a):a},r=Object.create(null);return e&&M.Children.map(e,function(i){return i}).forEach(function(i){r[i.key]=n(i)}),r}function J9(e,t){e=e||{},t=t||{};function n(c){return c in t?t[c]:e[c]}var r=Object.create(null),i=[];for(var a in e)a in t?i.length&&(r[a]=i,i=[]):i.push(a);var o,u={};for(var l in t){if(r[l])for(o=0;o<r[l].length;o++){var s=r[l][o];u[r[l][o]]=n(s)}u[l]=n(l)}for(o=0;o<i.length;o++)u[i[o]]=n(i[o]);return u}function da(e,t,n){return n[t]!=null?n[t]:e.props[t]}function eB(e,t){return Fm(e.children,function(n){return M.cloneElement(n,{onExited:t.bind(null,n),in:!0,appear:da(n,"appear",e),enter:da(n,"enter",e),exit:da(n,"exit",e)})})}function tB(e,t,n){var r=Fm(e.children),i=J9(t,r);return Object.keys(i).forEach(function(a){var o=i[a];if(M.isValidElement(o)){var u=a in t,l=a in r,s=t[a],c=M.isValidElement(s)&&!s.props.in;l&&(!u||c)?i[a]=M.cloneElement(o,{onExited:n.bind(null,o),in:!0,exit:da(o,"exit",e),enter:da(o,"enter",e)}):!l&&u&&!c?i[a]=M.cloneElement(o,{in:!1}):l&&u&&M.isValidElement(s)&&(i[a]=M.cloneElement(o,{onExited:n.bind(null,o),in:s.props.in,exit:da(o,"exit",e),enter:da(o,"enter",e)}))}}),i}var nB=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},rB={component:"div",childFactory:function(t){return t}},Nm=function(e){K9(t,e);function t(r,i){var a;a=e.call(this,r,i)||this;var o=a.handleExited.bind(W9(a));return a.state={contextValue:{isMounting:!0},handleExited:o,firstRender:!0},a}var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(i,a){var o=a.children,u=a.handleExited,l=a.firstRender;return{children:l?eB(i,u):tB(i,o,u),firstRender:!1}},n.handleExited=function(i,a){var o=Fm(this.props.children);i.key in o||(i.props.onExited&&i.props.onExited(a),this.mounted&&this.setState(function(u){var l=Ci({},u.children);return delete l[i.key],{children:l}}))},n.render=function(){var i=this.props,a=i.component,o=i.childFactory,u=Q9(i,["component","childFactory"]),l=this.state.contextValue,s=nB(this.state.children).map(o);return delete u.appear,delete u.enter,delete u.exit,a===null?Nt.createElement(iS.Provider,{value:l},s):Nt.createElement(iS.Provider,{value:l},Nt.createElement(a,u,s))},t}(Nt.Component);Nm.propTypes={},Nm.defaultProps=rB;const aS={};function oS(e,t){const n=M.useRef(aS);return n.current===aS&&(n.current=e(t)),n}const iB=[];function aB(e){M.useEffect(e,iB)}class Rm{static create(){return new Rm}currentId=null;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,n()},t)}clear=()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)};disposeEffect=()=>this.clear}function oB(){const e=oS(Rm.create).current;return aB(e.disposeEffect),e}function uB(e){return typeof e=="string"}function lB(e,t,n){return e===void 0||uB(e)?t:{...t,ownerState:{...t.ownerState,...n}}}function sB(e,t,n){return typeof e=="function"?e(t,n):e}function cB(e,t=[]){if(e===void 0)return{};const n={};return Object.keys(e).filter(r=>r.match(/^on[A-Z]/)&&typeof e[r]=="function"&&!t.includes(r)).forEach(r=>{n[r]=e[r]}),n}function uS(e){if(e===void 0)return{};const t={};return Object.keys(e).filter(n=>!(n.match(/^on[A-Z]/)&&typeof e[n]=="function")).forEach(n=>{t[n]=e[n]}),t}function fB(e){const{getSlotProps:t,additionalProps:n,externalSlotProps:r,externalForwardedProps:i,className:a}=e;if(!t){const h=at(n?.className,a,i?.className,r?.className),v={...n?.style,...i?.style,...r?.style},m={...n,...i,...r};return h.length>0&&(m.className=h),Object.keys(v).length>0&&(m.style=v),{props:m,internalRef:void 0}}const o=cB({...i,...r}),u=uS(r),l=uS(i),s=t(o),c=at(s?.className,n?.className,a,i?.className,r?.className),f={...s?.style,...n?.style,...i?.style,...r?.style},d={...s,...n,...l,...u};return c.length>0&&(d.className=c),Object.keys(f).length>0&&(d.style=f),{props:d,internalRef:s.ref}}function Fo(e,t){const{className:n,elementType:r,ownerState:i,externalForwardedProps:a,internalForwardedProps:o,shouldForwardComponentProp:u=!1,...l}=t,{component:s,slots:c={[e]:void 0},slotProps:f={[e]:void 0},...d}=a,h=c[e]||r,v=sB(f[e],i),{props:{component:m,...D},internalRef:p}=fB({className:n,...l,externalForwardedProps:e==="root"?d:void 0,externalSlotProps:v}),g=_m(p,v?.ref,t.ref),y=e==="root"?m||s:m,S=lB(h,{...e==="root"&&!s&&!c[e]&&o,...e!=="root"&&!c[e]&&o,...D,...y&&!u&&{as:y},...y&&u&&{component:y},ref:g},i);return[h,S]}function lS(e){try{return e.matches(":focus-visible")}catch{}return!1}class bf{static create(){return new bf}static use(){const t=oS(bf.create).current,[n,r]=M.useState(!1);return t.shouldMount=n,t.setShouldMount=r,M.useEffect(t.mountEffect,[n]),t}constructor(){this.ref={current:null},this.mounted=null,this.didMount=!1,this.shouldMount=!1,this.setShouldMount=null}mount(){return this.mounted||(this.mounted=hB(),this.shouldMount=!0,this.setShouldMount(this.shouldMount)),this.mounted}mountEffect=()=>{this.shouldMount&&!this.didMount&&this.ref.current!==null&&(this.didMount=!0,this.mounted.resolve())};start(...t){this.mount().then(()=>this.ref.current?.start(...t))}stop(...t){this.mount().then(()=>this.ref.current?.stop(...t))}pulsate(...t){this.mount().then(()=>this.ref.current?.pulsate(...t))}}function dB(){return bf.use()}function hB(){let e,t;const n=new Promise((r,i)=>{e=r,t=i});return n.resolve=e,n.reject=t,n}function mB(e){const{className:t,classes:n,pulsate:r=!1,rippleX:i,rippleY:a,rippleSize:o,in:u,onExited:l,timeout:s}=e,[c,f]=M.useState(!1),d=at(t,n.ripple,n.rippleVisible,r&&n.ripplePulsate),h={width:o,height:o,top:-(o/2)+a,left:-(o/2)+i},v=at(n.child,c&&n.childLeaving,r&&n.childPulsate);return!u&&!c&&f(!0),M.useEffect(()=>{if(!u&&l!=null){const m=setTimeout(l,s);return()=>{clearTimeout(m)}}},[l,u,s]),B.jsx("span",{className:d,style:h,children:B.jsx("span",{className:v})})}const er=bn("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),Om=550,pB=80,gB=il`
101
90
  0% {
102
91
  transform: scale(0);
103
92
  opacity: 0.1;
@@ -107,7 +96,7 @@ export default theme;`}function LE(e){return typeof e=="number"?`${(e*100).toFix
107
96
  transform: scale(1);
108
97
  opacity: 0.3;
109
98
  }
110
- `,Rk=pi`
99
+ `,vB=il`
111
100
  0% {
112
101
  opacity: 1;
113
102
  }
@@ -115,7 +104,7 @@ export default theme;`}function LE(e){return typeof e=="number"?`${(e*100).toFix
115
104
  100% {
116
105
  opacity: 0;
117
106
  }
118
- `,zk=pi`
107
+ `,yB=il`
119
108
  0% {
120
109
  transform: scale(1);
121
110
  }
@@ -127,23 +116,23 @@ export default theme;`}function LE(e){return typeof e=="number"?`${(e*100).toFix
127
116
  100% {
128
117
  transform: scale(1);
129
118
  }
130
- `,kk=ht("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),$k=ht(Fk,{name:"MuiTouchRipple",slot:"Ripple"})`
119
+ `,bB=wt("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),DB=wt(mB,{name:"MuiTouchRipple",slot:"Ripple"})`
131
120
  opacity: 0;
132
121
  position: absolute;
133
122
 
134
- &.${yr.rippleVisible} {
123
+ &.${er.rippleVisible} {
135
124
  opacity: 0.3;
136
125
  transform: scale(1);
137
- animation-name: ${Ok};
138
- animation-duration: ${zg}ms;
126
+ animation-name: ${gB};
127
+ animation-duration: ${Om}ms;
139
128
  animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut};
140
129
  }
141
130
 
142
- &.${yr.ripplePulsate} {
131
+ &.${er.ripplePulsate} {
143
132
  animation-duration: ${({theme:e})=>e.transitions.duration.shorter}ms;
144
133
  }
145
134
 
146
- & .${yr.child} {
135
+ & .${er.child} {
147
136
  opacity: 1;
148
137
  display: block;
149
138
  width: 100%;
@@ -152,25 +141,25 @@ export default theme;`}function LE(e){return typeof e=="number"?`${(e*100).toFix
152
141
  background-color: currentColor;
153
142
  }
154
143
 
155
- & .${yr.childLeaving} {
144
+ & .${er.childLeaving} {
156
145
  opacity: 0;
157
- animation-name: ${Rk};
158
- animation-duration: ${zg}ms;
146
+ animation-name: ${vB};
147
+ animation-duration: ${Om}ms;
159
148
  animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut};
160
149
  }
161
150
 
162
- & .${yr.childPulsate} {
151
+ & .${er.childPulsate} {
163
152
  position: absolute;
164
153
  /* @noflip */
165
154
  left: 0px;
166
155
  top: 0;
167
- animation-name: ${zk};
156
+ animation-name: ${yB};
168
157
  animation-duration: 2500ms;
169
158
  animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut};
170
159
  animation-iteration-count: infinite;
171
160
  animation-delay: 200ms;
172
161
  }
173
- `,Ik=_.forwardRef(function(t,n){const r=An({props:t,name:"MuiTouchRipple"}),{center:a=!1,classes:i={},className:o,...s}=r,[l,u]=_.useState([]),c=_.useRef(0),f=_.useRef(null);_.useEffect(()=>{f.current&&(f.current(),f.current=null)},[l]);const d=_.useRef(!1),h=xk(),g=_.useRef(null),m=_.useRef(null),D=_.useCallback(w=>{const{pulsate:E,rippleX:b,rippleY:S,rippleSize:A,cb:C}=w;u(T=>[...T,F.jsx($k,{classes:{ripple:st(i.ripple,yr.ripple),rippleVisible:st(i.rippleVisible,yr.rippleVisible),ripplePulsate:st(i.ripplePulsate,yr.ripplePulsate),child:st(i.child,yr.child),childLeaving:st(i.childLeaving,yr.childLeaving),childPulsate:st(i.childPulsate,yr.childPulsate)},timeout:zg,pulsate:E,rippleX:b,rippleY:S,rippleSize:A},c.current)]),c.current+=1,f.current=C},[i]),p=_.useCallback((w={},E={},b=()=>{})=>{const{pulsate:S=!1,center:A=a||E.pulsate,fakeElement:C=!1}=E;if(w?.type==="mousedown"&&d.current){d.current=!1;return}w?.type==="touchstart"&&(d.current=!0);const T=C?null:m.current,M=T?T.getBoundingClientRect():{width:0,height:0,left:0,top:0};let x,N,O;if(A||w===void 0||w.clientX===0&&w.clientY===0||!w.clientX&&!w.touches)x=Math.round(M.width/2),N=Math.round(M.height/2);else{const{clientX:z,clientY:B}=w.touches&&w.touches.length>0?w.touches[0]:w;x=Math.round(z-M.left),N=Math.round(B-M.top)}if(A)O=Math.sqrt((2*M.width**2+M.height**2)/3),O%2===0&&(O+=1);else{const z=Math.max(Math.abs((T?T.clientWidth:0)-x),x)*2+2,B=Math.max(Math.abs((T?T.clientHeight:0)-N),N)*2+2;O=Math.sqrt(z**2+B**2)}w?.touches?g.current===null&&(g.current=()=>{D({pulsate:S,rippleX:x,rippleY:N,rippleSize:O,cb:b})},h.start(Bk,()=>{g.current&&(g.current(),g.current=null)})):D({pulsate:S,rippleX:x,rippleY:N,rippleSize:O,cb:b})},[a,D,h]),v=_.useCallback(()=>{p({},{pulsate:!0})},[p]),y=_.useCallback((w,E)=>{if(h.clear(),w?.type==="touchend"&&g.current){g.current(),g.current=null,h.start(0,()=>{y(w,E)});return}g.current=null,u(b=>b.length>0?b.slice(1):b),f.current=E},[h]);return _.useImperativeHandle(n,()=>({pulsate:v,start:p,stop:y}),[v,p,y]),F.jsx(kk,{className:st(yr.root,i.root,o),ref:m,...s,children:F.jsx(Og,{component:null,exit:!0,children:l})})});function Uk(e){return yn("MuiButtonBase",e)}const Lk=bn("MuiButtonBase",["root","disabled","focusVisible"]),Pk=e=>{const{disabled:t,focusVisible:n,focusVisibleClassName:r,classes:a}=e,o=En({root:["root",t&&"disabled",n&&"focusVisible"]},Uk,a);return n&&r&&(o.root+=` ${r}`),o},jk=ht("button",{name:"MuiButtonBase",slot:"Root"})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${Lk.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),ZE=_.forwardRef(function(t,n){const r=An({props:t,name:"MuiButtonBase"}),{action:a,centerRipple:i=!1,children:o,className:s,component:l="button",disabled:u=!1,disableRipple:c=!1,disableTouchRipple:f=!1,focusRipple:d=!1,focusVisibleClassName:h,LinkComponent:g="a",onBlur:m,onClick:D,onContextMenu:p,onDragLeave:v,onFocus:y,onFocusVisible:w,onKeyDown:E,onKeyUp:b,onMouseDown:S,onMouseLeave:A,onMouseUp:C,onTouchEnd:T,onTouchMove:M,onTouchStart:x,tabIndex:N=0,TouchRippleProps:O,touchRippleRef:z,type:B,...k}=r,$=_.useRef(null),U=_k(),Y=Ng(U.ref,z),[X,P]=_.useState(!1);u&&X&&P(!1),_.useImperativeHandle(a,()=>({focusVisible:()=>{P(!0),$.current.focus()}}),[]);const G=U.shouldMount&&!c&&!u;_.useEffect(()=>{X&&d&&!c&&U.pulsate()},[c,d,X,U]);const q=Ta(U,"start",S,f),L=Ta(U,"stop",p,f),j=Ta(U,"stop",v,f),V=Ta(U,"stop",C,f),te=Ta(U,"stop",ve=>{X&&ve.preventDefault(),A&&A(ve)},f),ee=Ta(U,"start",x,f),ne=Ta(U,"stop",T,f),se=Ta(U,"stop",M,f),W=Ta(U,"stop",ve=>{XE(ve.target)||P(!1),m&&m(ve)},!1),de=Ud(ve=>{$.current||($.current=ve.currentTarget),XE(ve.target)&&(P(!0),w&&w(ve)),y&&y(ve)}),me=()=>{const ve=$.current;return l&&l!=="button"&&!(ve.tagName==="A"&&ve.href)},be=Ud(ve=>{d&&!ve.repeat&&X&&ve.key===" "&&U.stop(ve,()=>{U.start(ve)}),ve.target===ve.currentTarget&&me()&&ve.key===" "&&ve.preventDefault(),E&&E(ve),ve.target===ve.currentTarget&&me()&&ve.key==="Enter"&&!u&&(ve.preventDefault(),D&&D(ve))}),xe=Ud(ve=>{d&&ve.key===" "&&X&&!ve.defaultPrevented&&U.stop(ve,()=>{U.pulsate(ve)}),b&&b(ve),D&&ve.target===ve.currentTarget&&me()&&ve.key===" "&&!ve.defaultPrevented&&D(ve)});let Ee=l;Ee==="button"&&(k.href||k.to)&&(Ee=g);const Te={};Ee==="button"?(Te.type=B===void 0?"button":B,Te.disabled=u):(!k.href&&!k.to&&(Te.role="button"),u&&(Te["aria-disabled"]=u));const He=Ng(n,$),Be={...r,centerRipple:i,component:l,disabled:u,disableRipple:c,disableTouchRipple:f,focusRipple:d,tabIndex:N,focusVisible:X},Pe=Pk(Be);return F.jsxs(jk,{as:Ee,className:st(Pe.root,s),ownerState:Be,onBlur:W,onClick:D,onContextMenu:L,onFocus:de,onKeyDown:be,onKeyUp:xe,onMouseDown:q,onMouseLeave:te,onMouseUp:V,onDragLeave:j,onTouchEnd:ne,onTouchMove:se,onTouchStart:ee,ref:He,tabIndex:u?-1:N,type:B,...Te,...k,children:[o,G?F.jsx(Ik,{ref:Y,center:i,...O}):null]})});function Ta(e,t,n,r=!1){return Ud(a=>(n&&n(a),r||e[t](a),!0))}function Hk(e){return typeof e.main=="string"}function qk(e,t=[]){if(!Hk(e))return!1;for(const n of t)if(!e.hasOwnProperty(n)||typeof e[n]!="string")return!1;return!0}function Mr(e=[]){return([,t])=>t&&qk(t,e)}function Yk(e){return yn("MuiCircularProgress",e)}bn("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const vi=44,kg=pi`
162
+ `,SB=M.forwardRef(function(t,n){const r=$n({props:t,name:"MuiTouchRipple"}),{center:i=!1,classes:a={},className:o,...u}=r,[l,s]=M.useState([]),c=M.useRef(0),f=M.useRef(null);M.useEffect(()=>{f.current&&(f.current(),f.current=null)},[l]);const d=M.useRef(!1),h=oB(),v=M.useRef(null),m=M.useRef(null),D=M.useCallback(S=>{const{pulsate:w,rippleX:b,rippleY:E,rippleSize:C,cb:A}=S;s(T=>[...T,B.jsx(DB,{classes:{ripple:at(a.ripple,er.ripple),rippleVisible:at(a.rippleVisible,er.rippleVisible),ripplePulsate:at(a.ripplePulsate,er.ripplePulsate),child:at(a.child,er.child),childLeaving:at(a.childLeaving,er.childLeaving),childPulsate:at(a.childPulsate,er.childPulsate)},timeout:Om,pulsate:w,rippleX:b,rippleY:E,rippleSize:C},c.current)]),c.current+=1,f.current=A},[a]),p=M.useCallback((S={},w={},b=()=>{})=>{const{pulsate:E=!1,center:C=i||w.pulsate,fakeElement:A=!1}=w;if(S?.type==="mousedown"&&d.current){d.current=!1;return}S?.type==="touchstart"&&(d.current=!0);const T=A?null:m.current,_=T?T.getBoundingClientRect():{width:0,height:0,left:0,top:0};let x,F,R;if(C||S===void 0||S.clientX===0&&S.clientY===0||!S.clientX&&!S.touches)x=Math.round(_.width/2),F=Math.round(_.height/2);else{const{clientX:z,clientY:N}=S.touches&&S.touches.length>0?S.touches[0]:S;x=Math.round(z-_.left),F=Math.round(N-_.top)}if(C)R=Math.sqrt((2*_.width**2+_.height**2)/3),R%2===0&&(R+=1);else{const z=Math.max(Math.abs((T?T.clientWidth:0)-x),x)*2+2,N=Math.max(Math.abs((T?T.clientHeight:0)-F),F)*2+2;R=Math.sqrt(z**2+N**2)}S?.touches?v.current===null&&(v.current=()=>{D({pulsate:E,rippleX:x,rippleY:F,rippleSize:R,cb:b})},h.start(pB,()=>{v.current&&(v.current(),v.current=null)})):D({pulsate:E,rippleX:x,rippleY:F,rippleSize:R,cb:b})},[i,D,h]),g=M.useCallback(()=>{p({},{pulsate:!0})},[p]),y=M.useCallback((S,w)=>{if(h.clear(),S?.type==="touchend"&&v.current){v.current(),v.current=null,h.start(0,()=>{y(S,w)});return}v.current=null,s(b=>b.length>0?b.slice(1):b),f.current=w},[h]);return M.useImperativeHandle(n,()=>({pulsate:g,start:p,stop:y}),[g,p,y]),B.jsx(bB,{className:at(er.root,a.root,o),ref:m,...u,children:B.jsx(Nm,{component:null,exit:!0,children:l})})});function xB(e){return yn("MuiButtonBase",e)}const wB=bn("MuiButtonBase",["root","disabled","focusVisible"]),EB=e=>{const{disabled:t,focusVisible:n,focusVisibleClassName:r,classes:i}=e,o=Un({root:["root",t&&"disabled",n&&"focusVisible"]},xB,i);return n&&r&&(o.root+=` ${r}`),o},AB=wt("button",{name:"MuiButtonBase",slot:"Root"})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${wB.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),sS=M.forwardRef(function(t,n){const r=$n({props:t,name:"MuiButtonBase"}),{action:i,centerRipple:a=!1,children:o,className:u,component:l="button",disabled:s=!1,disableRipple:c=!1,disableTouchRipple:f=!1,focusRipple:d=!1,focusVisibleClassName:h,LinkComponent:v="a",onBlur:m,onClick:D,onContextMenu:p,onDragLeave:g,onFocus:y,onFocusVisible:S,onKeyDown:w,onKeyUp:b,onMouseDown:E,onMouseLeave:C,onMouseUp:A,onTouchEnd:T,onTouchMove:_,onTouchStart:x,tabIndex:F=0,TouchRippleProps:R,touchRippleRef:z,type:N,...U}=r,I=M.useRef(null),L=dB(),G=_m(L.ref,z),[X,P]=M.useState(!1);s&&X&&P(!1),M.useImperativeHandle(i,()=>({focusVisible:()=>{P(!0),I.current.focus()}}),[]);const j=L.shouldMount&&!c&&!s;M.useEffect(()=>{X&&d&&!c&&L.pulsate()},[c,d,X,L]);const H=Wr(L,"start",E,f),k=Wr(L,"stop",p,f),q=Wr(L,"stop",g,f),Y=Wr(L,"stop",A,f),ee=Wr(L,"stop",pe=>{X&&pe.preventDefault(),C&&C(pe)},f),te=Wr(L,"start",x,f),ne=Wr(L,"stop",T,f),oe=Wr(L,"stop",_,f),W=Wr(L,"stop",pe=>{lS(pe.target)||P(!1),m&&m(pe)},!1),ce=yf(pe=>{I.current||(I.current=pe.currentTarget),lS(pe.target)&&(P(!0),S&&S(pe)),y&&y(pe)}),de=()=>{const pe=I.current;return l&&l!=="button"&&!(pe.tagName==="A"&&pe.href)},ve=yf(pe=>{d&&!pe.repeat&&X&&pe.key===" "&&L.stop(pe,()=>{L.start(pe)}),pe.target===pe.currentTarget&&de()&&pe.key===" "&&pe.preventDefault(),w&&w(pe),pe.target===pe.currentTarget&&de()&&pe.key==="Enter"&&!s&&(pe.preventDefault(),D&&D(pe))}),De=yf(pe=>{d&&pe.key===" "&&X&&!pe.defaultPrevented&&L.stop(pe,()=>{L.pulsate(pe)}),b&&b(pe),D&&pe.target===pe.currentTarget&&de()&&pe.key===" "&&!pe.defaultPrevented&&D(pe)});let Se=l;Se==="button"&&(U.href||U.to)&&(Se=v);const Ee={};Se==="button"?(Ee.type=N===void 0?"button":N,Ee.disabled=s):(!U.href&&!U.to&&(Ee.role="button"),s&&(Ee["aria-disabled"]=s));const Re=_m(n,I),Ce={...r,centerRipple:a,component:l,disabled:s,disableRipple:c,disableTouchRipple:f,focusRipple:d,tabIndex:F,focusVisible:X},Ne=EB(Ce);return B.jsxs(AB,{as:Se,className:at(Ne.root,u),ownerState:Ce,onBlur:W,onClick:D,onContextMenu:k,onFocus:ce,onKeyDown:ve,onKeyUp:De,onMouseDown:H,onMouseLeave:ee,onMouseUp:Y,onDragLeave:q,onTouchEnd:ne,onTouchMove:oe,onTouchStart:te,ref:Re,tabIndex:s?-1:F,type:N,...Ee,...U,children:[o,j?B.jsx(SB,{ref:G,center:a,...R}):null]})});function Wr(e,t,n,r=!1){return yf(i=>(n&&n(i),r||e[t](i),!0))}function CB(e){return typeof e.main=="string"}function TB(e,t=[]){if(!CB(e))return!1;for(const n of t)if(!e.hasOwnProperty(n)||typeof e[n]!="string")return!1;return!0}function No(e=[]){return([,t])=>t&&TB(t,e)}function MB(e){return yn("MuiCircularProgress",e)}bn("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const Ui=44,zm=il`
174
163
  0% {
175
164
  transform: rotate(0deg);
176
165
  }
@@ -178,7 +167,7 @@ export default theme;`}function LE(e){return typeof e=="number"?`${(e*100).toFix
178
167
  100% {
179
168
  transform: rotate(360deg);
180
169
  }
181
- `,$g=pi`
170
+ `,Um=il`
182
171
  0% {
183
172
  stroke-dasharray: 1px, 200px;
184
173
  stroke-dashoffset: 0;
@@ -193,623 +182,10 @@ export default theme;`}function LE(e){return typeof e=="number"?`${(e*100).toFix
193
182
  stroke-dasharray: 1px, 200px;
194
183
  stroke-dashoffset: -126px;
195
184
  }
196
- `,Gk=typeof kg!="string"?_s`
197
- animation: ${kg} 1.4s linear infinite;
198
- `:null,Vk=typeof $g!="string"?_s`
199
- animation: ${$g} 1.4s ease-in-out infinite;
200
- `:null,Xk=e=>{const{classes:t,variant:n,color:r,disableShrink:a}=e,i={root:["root",n,`color${Fe(r)}`],svg:["svg"],circle:["circle",`circle${Fe(n)}`,a&&"circleDisableShrink"]};return En(i,Yk,t)},Zk=ht("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`color${Fe(n.color)}`]]}})(un(({theme:e})=>({display:"inline-block",variants:[{props:{variant:"determinate"},style:{transition:e.transitions.create("transform")}},{props:{variant:"indeterminate"},style:Gk||{animation:`${kg} 1.4s linear infinite`}},...Object.entries(e.palette).filter(Mr()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}}))]}))),Kk=ht("svg",{name:"MuiCircularProgress",slot:"Svg"})({display:"block"}),Qk=ht("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.circle,t[`circle${Fe(n.variant)}`],n.disableShrink&&t.circleDisableShrink]}})(un(({theme:e})=>({stroke:"currentColor",variants:[{props:{variant:"determinate"},style:{transition:e.transitions.create("stroke-dashoffset")}},{props:{variant:"indeterminate"},style:{strokeDasharray:"80px, 200px",strokeDashoffset:0}},{props:({ownerState:t})=>t.variant==="indeterminate"&&!t.disableShrink,style:Vk||{animation:`${$g} 1.4s ease-in-out infinite`}}]}))),Wk=_.forwardRef(function(t,n){const r=An({props:t,name:"MuiCircularProgress"}),{className:a,color:i="primary",disableShrink:o=!1,size:s=40,style:l,thickness:u=3.6,value:c=0,variant:f="indeterminate",...d}=r,h={...r,color:i,disableShrink:o,size:s,thickness:u,value:c,variant:f},g=Xk(h),m={},D={},p={};if(f==="determinate"){const v=2*Math.PI*((vi-u)/2);m.strokeDasharray=v.toFixed(3),p["aria-valuenow"]=Math.round(c),m.strokeDashoffset=`${((100-c)/100*v).toFixed(3)}px`,D.transform="rotate(-90deg)"}return F.jsx(Zk,{className:st(g.root,a),style:{width:s,height:s,...D,...l},ownerState:h,ref:n,role:"progressbar",...p,...d,children:F.jsx(Kk,{className:g.svg,ownerState:h,viewBox:`${vi/2} ${vi/2} ${vi} ${vi}`,children:F.jsx(Qk,{className:g.circle,style:m,ownerState:h,cx:vi,cy:vi,r:(vi-u)/2,fill:"none",strokeWidth:u})})})});function Jk(e){return yn("MuiIconButton",e)}const KE=bn("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge","loading","loadingIndicator","loadingWrapper"]),e$=e=>{const{classes:t,disabled:n,color:r,edge:a,size:i,loading:o}=e,s={root:["root",o&&"loading",n&&"disabled",r!=="default"&&`color${Fe(r)}`,a&&`edge${Fe(a)}`,`size${Fe(i)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]};return En(s,Jk,t)},t$=ht(ZE,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.loading&&t.loading,n.color!=="default"&&t[`color${Fe(n.color)}`],n.edge&&t[`edge${Fe(n.edge)}`],t[`size${Fe(n.size)}`]]}})(un(({theme:e})=>({textAlign:"center",flex:"0 0 auto",fontSize:e.typography.pxToRem(24),padding:8,borderRadius:"50%",color:(e.vars||e).palette.action.active,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),variants:[{props:t=>!t.disableRipple,style:{"--IconButton-hoverBg":e.alpha((e.vars||e).palette.action.active,(e.vars||e).palette.action.hoverOpacity),"&:hover":{backgroundColor:"var(--IconButton-hoverBg)","@media (hover: none)":{backgroundColor:"transparent"}}}},{props:{edge:"start"},style:{marginLeft:-12}},{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:{edge:"end"},style:{marginRight:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}}]})),un(({theme:e})=>({variants:[{props:{color:"inherit"},style:{color:"inherit"}},...Object.entries(e.palette).filter(Mr()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),...Object.entries(e.palette).filter(Mr()).map(([t])=>({props:{color:t},style:{"--IconButton-hoverBg":e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity)}})),{props:{size:"small"},style:{padding:5,fontSize:e.typography.pxToRem(18)}},{props:{size:"large"},style:{padding:12,fontSize:e.typography.pxToRem(28)}}],[`&.${KE.disabled}`]:{backgroundColor:"transparent",color:(e.vars||e).palette.action.disabled},[`&.${KE.loading}`]:{color:"transparent"}}))),n$=ht("span",{name:"MuiIconButton",slot:"LoadingIndicator"})(({theme:e})=>({display:"none",position:"absolute",visibility:"visible",top:"50%",left:"50%",transform:"translate(-50%, -50%)",color:(e.vars||e).palette.action.disabled,variants:[{props:{loading:!0},style:{display:"flex"}}]})),pu=_.forwardRef(function(t,n){const r=An({props:t,name:"MuiIconButton"}),{edge:a=!1,children:i,className:o,color:s="default",disabled:l=!1,disableFocusRipple:u=!1,size:c="medium",id:f,loading:d=null,loadingIndicator:h,...g}=r,m=yz(f),D=h??F.jsx(Wk,{"aria-labelledby":m,color:"inherit",size:16}),p={...r,edge:a,color:s,disabled:l,disableFocusRipple:u,loading:d,loadingIndicator:D,size:c},v=e$(p);return F.jsxs(t$,{id:d?m:f,className:st(v.root,o),centerRipple:!0,focusRipple:!u,disabled:l||d,ref:n,...g,ownerState:p,children:[typeof d=="boolean"&&F.jsx("span",{className:v.loadingWrapper,style:{display:"contents"},children:F.jsx(n$,{className:v.loadingIndicator,ownerState:p,children:d&&D})}),i]})});function r$({props:e,states:t,muiFormControl:n}){return t.reduce((r,a)=>(r[a]=e[a],n&&typeof e[a]>"u"&&(r[a]=n[a]),r),{})}const a$=_.createContext(void 0);function QE(){return _.useContext(a$)}function i$(e){return yn("PrivateSwitchBase",e)}bn("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const o$=e=>{const{classes:t,checked:n,disabled:r,edge:a}=e,i={root:["root",n&&"checked",r&&"disabled",a&&`edge${Fe(a)}`],input:["input"]};return En(i,i$,t)},s$=ht(ZE,{name:"MuiSwitchBase"})({padding:9,borderRadius:"50%",variants:[{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:({edge:e,ownerState:t})=>e==="start"&&t.size!=="small",style:{marginLeft:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}},{props:({edge:e,ownerState:t})=>e==="end"&&t.size!=="small",style:{marginRight:-12}}]}),l$=ht("input",{name:"MuiSwitchBase",shouldForwardProp:Tg})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),WE=_.forwardRef(function(t,n){const{autoFocus:r,checked:a,checkedIcon:i,defaultChecked:o,disabled:s,disableFocusRipple:l=!1,edge:u=!1,icon:c,id:f,inputProps:d,inputRef:h,name:g,onBlur:m,onChange:D,onFocus:p,readOnly:v,required:y=!1,tabIndex:w,type:E,value:b,slots:S={},slotProps:A={},...C}=t,[T,M]=ck({controlled:a,default:!!o}),x=QE(),N=L=>{p&&p(L),x&&x.onFocus&&x.onFocus(L)},O=L=>{m&&m(L),x&&x.onBlur&&x.onBlur(L)},z=L=>{if(L.nativeEvent.defaultPrevented)return;const j=L.target.checked;M(j),D&&D(L,j)};let B=s;x&&typeof B>"u"&&(B=x.disabled);const k=E==="checkbox"||E==="radio",$={...t,checked:T,disabled:B,disableFocusRipple:l,edge:u},U=o$($),Y={slots:S,slotProps:{input:d,...A}},[X,P]=Bs("root",{ref:n,elementType:s$,className:U.root,shouldForwardComponentProp:!0,externalForwardedProps:{...Y,component:"span",...C},getSlotProps:L=>({...L,onFocus:j=>{L.onFocus?.(j),N(j)},onBlur:j=>{L.onBlur?.(j),O(j)}}),ownerState:$,additionalProps:{centerRipple:!0,focusRipple:!l,disabled:B,role:void 0,tabIndex:null}}),[G,q]=Bs("input",{ref:h,elementType:l$,className:U.input,externalForwardedProps:Y,getSlotProps:L=>({...L,onChange:j=>{L.onChange?.(j),z(j)}}),ownerState:$,additionalProps:{autoFocus:r,checked:a,defaultChecked:o,disabled:B,id:k?f:void 0,name:g,readOnly:v,required:y,tabIndex:w,type:E,...E==="checkbox"&&b===void 0?{}:{value:b}}});return F.jsxs(X,{...P,children:[F.jsx(G,{...q}),T?i:c]})}),u$=_g(F.jsx("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"})),c$=_g(F.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})),f$=_g(F.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}));function d$(e){return yn("MuiCheckbox",e)}const Ig=bn("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),h$=e=>{const{classes:t,indeterminate:n,color:r,size:a}=e,i={root:["root",n&&"indeterminate",`color${Fe(r)}`,`size${Fe(a)}`]},o=En(i,d$,t);return{...t,...o}},m$=ht(WE,{shouldForwardProp:e=>Tg(e)||e==="classes",name:"MuiCheckbox",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.indeterminate&&t.indeterminate,t[`size${Fe(n.size)}`],n.color!=="default"&&t[`color${Fe(n.color)}`]]}})(un(({theme:e})=>({color:(e.vars||e).palette.text.secondary,variants:[{props:{color:"default",disableRipple:!1},style:{"&:hover":{backgroundColor:e.alpha((e.vars||e).palette.action.active,(e.vars||e).palette.action.hoverOpacity)}}},...Object.entries(e.palette).filter(Mr()).map(([t])=>({props:{color:t,disableRipple:!1},style:{"&:hover":{backgroundColor:e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity)}}})),...Object.entries(e.palette).filter(Mr()).map(([t])=>({props:{color:t},style:{[`&.${Ig.checked}, &.${Ig.indeterminate}`]:{color:(e.vars||e).palette[t].main},[`&.${Ig.disabled}`]:{color:(e.vars||e).palette.action.disabled}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]}))),p$=F.jsx(c$,{}),g$=F.jsx(u$,{}),v$=F.jsx(f$,{}),Ug=_.forwardRef(function(t,n){const r=An({props:t,name:"MuiCheckbox"}),{checkedIcon:a=p$,color:i="primary",icon:o=g$,indeterminate:s=!1,indeterminateIcon:l=v$,inputProps:u,size:c="medium",disableRipple:f=!1,className:d,slots:h={},slotProps:g={},...m}=r,D=s?l:o,p=s?l:a,v={...r,disableRipple:f,color:i,indeterminate:s,size:c},y=h$(v),w=g.input??u,[E,b]=Bs("root",{ref:n,elementType:m$,className:st(y.root,d),shouldForwardComponentProp:!0,externalForwardedProps:{slots:h,slotProps:g,...m},ownerState:v,additionalProps:{type:"checkbox",icon:_.cloneElement(D,{fontSize:D.props.fontSize??c}),checkedIcon:_.cloneElement(p,{fontSize:p.props.fontSize??c}),disableRipple:f,slots:h,slotProps:{input:dk(typeof w=="function"?w(v):w,{"data-indeterminate":s})}}});return F.jsx(E,{...b,classes:y})});function y$(e){return yn("MuiFormGroup",e)}bn("MuiFormGroup",["root","row","error"]);const b$=e=>{const{classes:t,row:n,error:r}=e;return En({root:["root",n&&"row",r&&"error"]},y$,t)},D$=ht("div",{name:"MuiFormGroup",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.row&&t.row]}})({display:"flex",flexDirection:"column",flexWrap:"wrap",variants:[{props:{row:!0},style:{flexDirection:"row"}}]}),S$=_.forwardRef(function(t,n){const r=An({props:t,name:"MuiFormGroup"}),{className:a,row:i=!1,...o}=r,s=QE(),l=r$({props:r,muiFormControl:s,states:["error"]}),u={...r,row:i,error:l.error},c=b$(u);return F.jsx(D$,{className:st(c.root,a),ownerState:u,ref:n,...o})});function w$(e){return yn("MuiLinearProgress",e)}bn("MuiLinearProgress",["root","colorPrimary","colorSecondary","determinate","indeterminate","buffer","query","dashed","dashedColorPrimary","dashedColorSecondary","bar","bar1","bar2","barColorPrimary","barColorSecondary","bar1Indeterminate","bar1Determinate","bar1Buffer","bar2Indeterminate","bar2Buffer"]);const Lg=4,Pg=pi`
201
- 0% {
202
- left: -35%;
203
- right: 100%;
204
- }
205
-
206
- 60% {
207
- left: 100%;
208
- right: -90%;
209
- }
210
-
211
- 100% {
212
- left: 100%;
213
- right: -90%;
214
- }
215
- `,x$=typeof Pg!="string"?_s`
216
- animation: ${Pg} 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;
217
- `:null,jg=pi`
218
- 0% {
219
- left: -200%;
220
- right: 100%;
221
- }
222
-
223
- 60% {
224
- left: 107%;
225
- right: -8%;
226
- }
227
-
228
- 100% {
229
- left: 107%;
230
- right: -8%;
231
- }
232
- `,E$=typeof jg!="string"?_s`
233
- animation: ${jg} 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite;
234
- `:null,Hg=pi`
235
- 0% {
236
- opacity: 1;
237
- background-position: 0 -23px;
238
- }
239
-
240
- 60% {
241
- opacity: 0;
242
- background-position: 0 -23px;
243
- }
244
-
245
- 100% {
246
- opacity: 1;
247
- background-position: -200px -23px;
248
- }
249
- `,A$=typeof Hg!="string"?_s`
250
- animation: ${Hg} 3s infinite linear;
251
- `:null,C$=e=>{const{classes:t,variant:n,color:r}=e,a={root:["root",`color${Fe(r)}`,n],dashed:["dashed",`dashedColor${Fe(r)}`],bar1:["bar","bar1",`barColor${Fe(r)}`,(n==="indeterminate"||n==="query")&&"bar1Indeterminate",n==="determinate"&&"bar1Determinate",n==="buffer"&&"bar1Buffer"],bar2:["bar","bar2",n!=="buffer"&&`barColor${Fe(r)}`,n==="buffer"&&`color${Fe(r)}`,(n==="indeterminate"||n==="query")&&"bar2Indeterminate",n==="buffer"&&"bar2Buffer"]};return En(a,w$,t)},qg=(e,t)=>e.vars?e.vars.palette.LinearProgress[`${t}Bg`]:e.palette.mode==="light"?e.lighten(e.palette[t].main,.62):e.darken(e.palette[t].main,.5),T$=ht("span",{name:"MuiLinearProgress",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`color${Fe(n.color)}`],t[n.variant]]}})(un(({theme:e})=>({position:"relative",overflow:"hidden",display:"block",height:4,zIndex:0,"@media print":{colorAdjust:"exact"},variants:[...Object.entries(e.palette).filter(Mr()).map(([t])=>({props:{color:t},style:{backgroundColor:qg(e,t)}})),{props:({ownerState:t})=>t.color==="inherit"&&t.variant!=="buffer",style:{"&::before":{content:'""',position:"absolute",left:0,top:0,right:0,bottom:0,backgroundColor:"currentColor",opacity:.3}}},{props:{variant:"buffer"},style:{backgroundColor:"transparent"}},{props:{variant:"query"},style:{transform:"rotate(180deg)"}}]}))),M$=ht("span",{name:"MuiLinearProgress",slot:"Dashed",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.dashed,t[`dashedColor${Fe(n.color)}`]]}})(un(({theme:e})=>({position:"absolute",marginTop:0,height:"100%",width:"100%",backgroundSize:"10px 10px",backgroundPosition:"0 -23px",variants:[{props:{color:"inherit"},style:{opacity:.3,backgroundImage:"radial-gradient(currentColor 0%, currentColor 16%, transparent 42%)"}},...Object.entries(e.palette).filter(Mr()).map(([t])=>{const n=qg(e,t);return{props:{color:t},style:{backgroundImage:`radial-gradient(${n} 0%, ${n} 16%, transparent 42%)`}}})]})),A$||{animation:`${Hg} 3s infinite linear`}),_$=ht("span",{name:"MuiLinearProgress",slot:"Bar1",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.bar,t.bar1,t[`barColor${Fe(n.color)}`],(n.variant==="indeterminate"||n.variant==="query")&&t.bar1Indeterminate,n.variant==="determinate"&&t.bar1Determinate,n.variant==="buffer"&&t.bar1Buffer]}})(un(({theme:e})=>({width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left",variants:[{props:{color:"inherit"},style:{backgroundColor:"currentColor"}},...Object.entries(e.palette).filter(Mr()).map(([t])=>({props:{color:t},style:{backgroundColor:(e.vars||e).palette[t].main}})),{props:{variant:"determinate"},style:{transition:`transform .${Lg}s linear`}},{props:{variant:"buffer"},style:{zIndex:1,transition:`transform .${Lg}s linear`}},{props:({ownerState:t})=>t.variant==="indeterminate"||t.variant==="query",style:{width:"auto"}},{props:({ownerState:t})=>t.variant==="indeterminate"||t.variant==="query",style:x$||{animation:`${Pg} 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite`}}]}))),N$=ht("span",{name:"MuiLinearProgress",slot:"Bar2",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.bar,t.bar2,t[`barColor${Fe(n.color)}`],(n.variant==="indeterminate"||n.variant==="query")&&t.bar2Indeterminate,n.variant==="buffer"&&t.bar2Buffer]}})(un(({theme:e})=>({width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left",variants:[...Object.entries(e.palette).filter(Mr()).map(([t])=>({props:{color:t},style:{"--LinearProgressBar2-barColor":(e.vars||e).palette[t].main}})),{props:({ownerState:t})=>t.variant!=="buffer"&&t.color!=="inherit",style:{backgroundColor:"var(--LinearProgressBar2-barColor, currentColor)"}},{props:({ownerState:t})=>t.variant!=="buffer"&&t.color==="inherit",style:{backgroundColor:"currentColor"}},{props:{color:"inherit"},style:{opacity:.3}},...Object.entries(e.palette).filter(Mr()).map(([t])=>({props:{color:t,variant:"buffer"},style:{backgroundColor:qg(e,t),transition:`transform .${Lg}s linear`}})),{props:({ownerState:t})=>t.variant==="indeterminate"||t.variant==="query",style:{width:"auto"}},{props:({ownerState:t})=>t.variant==="indeterminate"||t.variant==="query",style:E$||{animation:`${jg} 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite`}}]}))),F$=_.forwardRef(function(t,n){const r=An({props:t,name:"MuiLinearProgress"}),{className:a,color:i="primary",value:o,valueBuffer:s,variant:l="indeterminate",...u}=r,c={...r,color:i,variant:l},f=C$(c),d=hz(),h={},g={bar1:{},bar2:{}};if((l==="determinate"||l==="buffer")&&o!==void 0){h["aria-valuenow"]=Math.round(o),h["aria-valuemin"]=0,h["aria-valuemax"]=100;let m=o-100;d&&(m=-m),g.bar1.transform=`translateX(${m}%)`}if(l==="buffer"&&s!==void 0){let m=(s||0)-100;d&&(m=-m),g.bar2.transform=`translateX(${m}%)`}return F.jsxs(T$,{className:st(f.root,a),ownerState:c,role:"progressbar",...h,ref:n,...u,children:[l==="buffer"?F.jsx(M$,{className:f.dashed,ownerState:c}):null,F.jsx(_$,{className:f.bar1,ownerState:c,style:g.bar1}),l==="determinate"?null:F.jsx(N$,{className:f.bar2,ownerState:c,style:g.bar2})]})});function B$(e){return yn("MuiSwitch",e)}const Cn=bn("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]),O$=e=>{const{classes:t,edge:n,size:r,color:a,checked:i,disabled:o}=e,s={root:["root",n&&`edge${Fe(n)}`,`size${Fe(r)}`],switchBase:["switchBase",`color${Fe(a)}`,i&&"checked",o&&"disabled"],thumb:["thumb"],track:["track"],input:["input"]},l=En(s,B$,t);return{...t,...l}},R$=ht("span",{name:"MuiSwitch",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.edge&&t[`edge${Fe(n.edge)}`],t[`size${Fe(n.size)}`]]}})({display:"inline-flex",width:34+12*2,height:14+12*2,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle","@media print":{colorAdjust:"exact"},variants:[{props:{edge:"start"},style:{marginLeft:-8}},{props:{edge:"end"},style:{marginRight:-8}},{props:{size:"small"},style:{width:40,height:24,padding:7,[`& .${Cn.thumb}`]:{width:16,height:16},[`& .${Cn.switchBase}`]:{padding:4,[`&.${Cn.checked}`]:{transform:"translateX(16px)"}}}}]}),z$=ht(WE,{name:"MuiSwitch",slot:"SwitchBase",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.switchBase,{[`& .${Cn.input}`]:t.input},n.color!=="default"&&t[`color${Fe(n.color)}`]]}})(un(({theme:e})=>({position:"absolute",top:0,left:0,zIndex:1,color:e.vars?e.vars.palette.Switch.defaultColor:`${e.palette.mode==="light"?e.palette.common.white:e.palette.grey[300]}`,transition:e.transitions.create(["left","transform"],{duration:e.transitions.duration.shortest}),[`&.${Cn.checked}`]:{transform:"translateX(20px)"},[`&.${Cn.disabled}`]:{color:e.vars?e.vars.palette.Switch.defaultDisabledColor:`${e.palette.mode==="light"?e.palette.grey[100]:e.palette.grey[600]}`},[`&.${Cn.checked} + .${Cn.track}`]:{opacity:.5},[`&.${Cn.disabled} + .${Cn.track}`]:{opacity:e.vars?e.vars.opacity.switchTrackDisabled:`${e.palette.mode==="light"?.12:.2}`},[`& .${Cn.input}`]:{left:"-100%",width:"300%"}})),un(({theme:e})=>({"&:hover":{backgroundColor:e.alpha((e.vars||e).palette.action.active,(e.vars||e).palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[...Object.entries(e.palette).filter(Mr(["light"])).map(([t])=>({props:{color:t},style:{[`&.${Cn.checked}`]:{color:(e.vars||e).palette[t].main,"&:hover":{backgroundColor:e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${Cn.disabled}`]:{color:e.vars?e.vars.palette.Switch[`${t}DisabledColor`]:`${e.palette.mode==="light"?e.lighten(e.palette[t].main,.62):e.darken(e.palette[t].main,.55)}`}},[`&.${Cn.checked} + .${Cn.track}`]:{backgroundColor:(e.vars||e).palette[t].main}}}))]}))),k$=ht("span",{name:"MuiSwitch",slot:"Track"})(un(({theme:e})=>({height:"100%",width:"100%",borderRadius:14/2,zIndex:-1,transition:e.transitions.create(["opacity","background-color"],{duration:e.transitions.duration.shortest}),backgroundColor:e.vars?e.vars.palette.common.onBackground:`${e.palette.mode==="light"?e.palette.common.black:e.palette.common.white}`,opacity:e.vars?e.vars.opacity.switchTrack:`${e.palette.mode==="light"?.38:.3}`}))),$$=ht("span",{name:"MuiSwitch",slot:"Thumb"})(un(({theme:e})=>({boxShadow:(e.vars||e).shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"}))),JE=_.forwardRef(function(t,n){const r=An({props:t,name:"MuiSwitch"}),{className:a,color:i="primary",edge:o=!1,size:s="medium",sx:l,slots:u={},slotProps:c={},...f}=r,d={...r,color:i,edge:o,size:s},h=O$(d),g={slots:u,slotProps:c},[m,D]=Bs("root",{className:st(h.root,a),elementType:R$,externalForwardedProps:g,ownerState:d,additionalProps:{sx:l}}),[p,v]=Bs("thumb",{className:h.thumb,elementType:$$,externalForwardedProps:g,ownerState:d}),y=F.jsx(p,{...v}),[w,E]=Bs("track",{className:h.track,elementType:k$,externalForwardedProps:g,ownerState:d});return F.jsxs(m,{...D,children:[F.jsx(z$,{type:"checkbox",icon:y,checkedIcon:y,ref:n,ownerState:d,...f,classes:{...h,root:h.switchBase},slots:{...u.switchBase&&{root:u.switchBase},...u.input&&{input:u.input}},slotProps:{...c.switchBase&&{root:typeof c.switchBase=="function"?c.switchBase(d):c.switchBase},input:{role:"switch"},...c.input&&{input:typeof c.input=="function"?c.input(d):c.input}}}),F.jsx(w,{...E})]})}),eA=_.createContext();function I$(e){return yn("MuiTable",e)}bn("MuiTable",["root","stickyHeader"]);const U$=e=>{const{classes:t,stickyHeader:n}=e;return En({root:["root",n&&"stickyHeader"]},I$,t)},L$=ht("table",{name:"MuiTable",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.stickyHeader&&t.stickyHeader]}})(un(({theme:e})=>({display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":{...e.typography.body2,padding:e.spacing(2),color:(e.vars||e).palette.text.secondary,textAlign:"left",captionSide:"bottom"},variants:[{props:({ownerState:t})=>t.stickyHeader,style:{borderCollapse:"separate"}}]}))),tA="table",nA=_.forwardRef(function(t,n){const r=An({props:t,name:"MuiTable"}),{className:a,component:i=tA,padding:o="normal",size:s="medium",stickyHeader:l=!1,...u}=r,c={...r,component:i,padding:o,size:s,stickyHeader:l},f=U$(c),d=_.useMemo(()=>({padding:o,size:s,stickyHeader:l}),[o,s,l]);return F.jsx(eA.Provider,{value:d,children:F.jsx(L$,{as:i,role:i===tA?null:"table",ref:n,className:st(f.root,a),ownerState:c,...u})})}),Pd=_.createContext();function P$(e){return yn("MuiTableBody",e)}bn("MuiTableBody",["root"]);const j$=e=>{const{classes:t}=e;return En({root:["root"]},P$,t)},H$=ht("tbody",{name:"MuiTableBody",slot:"Root"})({display:"table-row-group"}),q$={variant:"body"},rA="tbody",aA=_.forwardRef(function(t,n){const r=An({props:t,name:"MuiTableBody"}),{className:a,component:i=rA,...o}=r,s={...r,component:i},l=j$(s);return F.jsx(Pd.Provider,{value:q$,children:F.jsx(H$,{className:st(l.root,a),as:i,ref:n,role:i===rA?null:"rowgroup",ownerState:s,...o})})});function Y$(e){return yn("MuiTableCell",e)}const G$=bn("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),V$=e=>{const{classes:t,variant:n,align:r,padding:a,size:i,stickyHeader:o}=e,s={root:["root",n,o&&"stickyHeader",r!=="inherit"&&`align${Fe(r)}`,a!=="normal"&&`padding${Fe(a)}`,`size${Fe(i)}`]};return En(s,Y$,t)},X$=ht("td",{name:"MuiTableCell",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`size${Fe(n.size)}`],n.padding!=="normal"&&t[`padding${Fe(n.padding)}`],n.align!=="inherit"&&t[`align${Fe(n.align)}`],n.stickyHeader&&t.stickyHeader]}})(un(({theme:e})=>({...e.typography.body2,display:"table-cell",verticalAlign:"inherit",borderBottom:e.vars?`1px solid ${e.vars.palette.TableCell.border}`:`1px solid
252
- ${e.palette.mode==="light"?e.lighten(e.alpha(e.palette.divider,1),.88):e.darken(e.alpha(e.palette.divider,1),.68)}`,textAlign:"left",padding:16,variants:[{props:{variant:"head"},style:{color:(e.vars||e).palette.text.primary,lineHeight:e.typography.pxToRem(24),fontWeight:e.typography.fontWeightMedium}},{props:{variant:"body"},style:{color:(e.vars||e).palette.text.primary}},{props:{variant:"footer"},style:{color:(e.vars||e).palette.text.secondary,lineHeight:e.typography.pxToRem(21),fontSize:e.typography.pxToRem(12)}},{props:{size:"small"},style:{padding:"6px 16px",[`&.${G$.paddingCheckbox}`]:{width:24,padding:"0 12px 0 16px","& > *":{padding:0}}}},{props:{padding:"checkbox"},style:{width:48,padding:"0 0 0 4px"}},{props:{padding:"none"},style:{padding:0}},{props:{align:"left"},style:{textAlign:"left"}},{props:{align:"center"},style:{textAlign:"center"}},{props:{align:"right"},style:{textAlign:"right",flexDirection:"row-reverse"}},{props:{align:"justify"},style:{textAlign:"justify"}},{props:({ownerState:t})=>t.stickyHeader,style:{position:"sticky",top:0,zIndex:2,backgroundColor:(e.vars||e).palette.background.default}}]}))),yi=_.forwardRef(function(t,n){const r=An({props:t,name:"MuiTableCell"}),{align:a="inherit",className:i,component:o,padding:s,scope:l,size:u,sortDirection:c,variant:f,...d}=r,h=_.useContext(eA),g=_.useContext(Pd),m=g&&g.variant==="head";let D;o?D=o:D=m?"th":"td";let p=l;D==="td"?p=void 0:!p&&m&&(p="col");const v=f||g&&g.variant,y={...r,align:a,component:D,padding:s||(h&&h.padding?h.padding:"normal"),size:u||(h&&h.size?h.size:"medium"),sortDirection:c,stickyHeader:v==="head"&&h&&h.stickyHeader,variant:v},w=V$(y);let E=null;return c&&(E=c==="asc"?"ascending":"descending"),F.jsx(X$,{as:D,ref:n,className:st(w.root,i),"aria-sort":E,scope:p,ownerState:y,...d})});function Z$(e){return yn("MuiTableContainer",e)}bn("MuiTableContainer",["root"]);const K$=e=>{const{classes:t}=e;return En({root:["root"]},Z$,t)},Q$=ht("div",{name:"MuiTableContainer",slot:"Root"})({width:"100%",overflowX:"auto"}),W$=_.forwardRef(function(t,n){const r=An({props:t,name:"MuiTableContainer"}),{className:a,component:i="div",...o}=r,s={...r,component:i},l=K$(s);return F.jsx(Q$,{ref:n,as:i,className:st(l.root,a),ownerState:s,...o})});function J$(e){return yn("MuiTableHead",e)}bn("MuiTableHead",["root"]);const eI=e=>{const{classes:t}=e;return En({root:["root"]},J$,t)},tI=ht("thead",{name:"MuiTableHead",slot:"Root"})({display:"table-header-group"}),nI={variant:"head"},iA="thead",oA=_.forwardRef(function(t,n){const r=An({props:t,name:"MuiTableHead"}),{className:a,component:i=iA,...o}=r,s={...r,component:i},l=eI(s);return F.jsx(Pd.Provider,{value:nI,children:F.jsx(tI,{as:i,className:st(l.root,a),ref:n,role:i===iA?null:"rowgroup",ownerState:s,...o})})});function rI(e){return yn("MuiTableRow",e)}const sA=bn("MuiTableRow",["root","selected","hover","head","footer"]),aI=e=>{const{classes:t,selected:n,hover:r,head:a,footer:i}=e;return En({root:["root",n&&"selected",r&&"hover",a&&"head",i&&"footer"]},rI,t)},iI=ht("tr",{name:"MuiTableRow",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.head&&t.head,n.footer&&t.footer]}})(un(({theme:e})=>({color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,[`&.${sA.hover}:hover`]:{backgroundColor:(e.vars||e).palette.action.hover},[`&.${sA.selected}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity),"&:hover":{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`)}}}))),lA="tr",jd=_.forwardRef(function(t,n){const r=An({props:t,name:"MuiTableRow"}),{className:a,component:i=lA,hover:o=!1,selected:s=!1,...l}=r,u=_.useContext(Pd),c={...r,component:i,hover:o,selected:s,head:u&&u.variant==="head",footer:u&&u.variant==="footer"},f=aI(c);return F.jsx(iI,{as:i,ref:n,className:st(f.root,a),role:i===lA?null:"row",ownerState:c,...l})}),oI={paddingLeft:0,paddingRight:0,paddingTop:1,paddingBottom:1},gu=35,sI=e=>{const t=e.selected?"secondary":"inherit";return F.jsx("span",{title:e.title,children:e.icon?F.jsx(pu,{title:e.title,onClick:e.onClick,color:t,style:oI,disabled:!!e.disabled,sx:{fontSize:18},children:e.icon},e.elementIndex):F.jsx("button",{title:e.title,onClick:e.onClick,disabled:!!e.disabled,style:{padding:0,margin:0,fontSize:10},children:e.text},e.elementIndex)},e.elementIndex+"-span")},lI=e=>e.useHorizontalLayout?F.jsx(F.Fragment,{}):F.jsx("hr",{},e.elementIndex),uI=e=>{const t=Number.isFinite(e.content)?e.content:0,n=e.contentSigFigs||0,r=Math.abs(t-Math.round(t))*10**(n+1)<1,a=Number.isFinite(e.content)?r&&!e.contentAlwaysShowDecimal?Math.round(t)+"":t.toFixed(e.contentSigFigs||2):e.content||"",i=e.useHorizontalLayout?"span":"div";return Rt.createElement(i,{key:e.elementIndex,title:e.title,style:{textAlign:"left",fontWeight:"bold",cursor:"default",fontSize:10}},a)},cI=e=>{switch(e.subtype){case"checkbox":return F.jsx(fI,{...e});case"slider":return F.jsx(dI,{...e});default:return F.jsxs("span",{children:["ERROR: Bad toggle subtype ",e.subtype]},e.elementIndex)}},fI=e=>F.jsx(Ug,{checked:e.selected,onClick:e.onClick,style:{padding:0,paddingLeft:0},title:e.title,disabled:e.disabled},e.elementIndex),dI=e=>F.jsx(S$,{children:F.jsx(JE,{checked:e.selected,size:"small",style:{left:-3},onChange:e.onClick,disabled:e.disabled,title:e.title})},e.elementIndex),hI=e=>{switch(e.type){case"button":return F.jsx(sI,{...e});case"divider":return F.jsx(lI,{...e});case"text":return F.jsx(uI,{...e});case"toggle":return F.jsx(cI,{...e});default:return F.jsx("span",{},e.elementIndex)}},mI=e=>(e||[]).map((t,n)=>({type:t.type||"button",subtype:t.subtype,title:t.title,onClick:t.callback,icon:t.icon||"",text:t.text||"",selected:t.selected,disabled:t.disabled,content:t.content,contentSigFigs:t.contentSigFigs,contentAlwaysShowDecimal:t.boolean,elementIndex:n})),vu=e=>{const t=_.useMemo(()=>mI(e.customActions),[e.customActions]),n=_.useMemo(()=>t.map((i,o)=>F.jsx(hI,{...i,useHorizontalLayout:e.useHorizontalLayout},o)),[t,e.useHorizontalLayout]),r=_.useMemo(()=>({width:e.width,height:e.height,top:e.top??0,paddingTop:e.topPadding??0}),[e.width,e.height,e.top,e.topPadding]),a=e.useHorizontalLayout?"HorizontalToolbar":"VerticalToolbar";return F.jsx("div",{className:a,style:{...r},children:n})},Hd={onlyShowSelected:!1},qd=({options:e,setOptions:t,onRedistributeUnitColors:n})=>F.jsxs("div",{children:[F.jsx(JE,{checked:e.onlyShowSelected,onClick:()=>{t({...e,onlyShowSelected:!e.onlyShowSelected})}}),F.jsx("span",{style:{position:"relative",top:2,overflow:"hidden"},children:"only show selected"}),"  ",n&&F.jsx("button",{onClick:n,title:"Redistribute unit colors",children:"rc"})]}),pI=(e,t)=>{const n=t-e;let r;n<=30?r=10:n<=120?r=20:n<=300?r=50:n<=600?r=100:n<=1e3?r=150:r=100;const a=[];let i=Math.ceil(e/r);for(;i*r<=t;)a.push(i*r),i++;return a},uA=({binEdgesSec:e,binCounts:t,color:n,width:r,height:a,hideXAxis:i})=>{const o=_.useMemo(()=>(t||[]).map((c,f)=>{const d=(e||[])[f]*1e3,h=(e||[])[f+1]*1e3;return{key:f,xStart:d,xEnd:h,height:c,tooltip:`[${d}, ${h}]: ${c}`,color:n}}),[t,e,n]),{xMin:s,xMax:l}=_.useMemo(()=>o.length>0?{xMin:o[0].xStart,xMax:o[o.length-1].xEnd}:{xMin:0,xMax:1},[o]),u=_.useMemo(()=>pI(s,l).map(f=>({x:f,label:`${f}`})),[s,l]);return t?F.jsx(xB,{bars:o,ticks:i?void 0:u,width:r,height:a,xLabel:i?void 0:"dt (msec)"}):F.jsx("div",{style:{position:"relative",width:r,height:a,color:"orange"}})},gI=10,vI=4,yI=2,Os=Rt.forwardRef((e,t)=>{const{width:n,height:r,initialPosition:a,onChange:i,adjustable:o=!0,positionFromRight:s=!1,direction:l="horizontal"}=e,u=l==="horizontal"?n:r,[c,f]=_.useState(a),[d,h]=_.useState(!1),[g,m]=_.useState({x:0,y:0}),[D,p]=_.useState(0),v=_.useRef(null);if(_.useEffect(()=>{c>u-4?f(u-4):c<4&&u>20&&f(4)},[c,n,u]),!e.children)throw Error("Unexpected: no props.children");let y,w;if(!Array.isArray(e.children))y=e.children,w=null;else{const Y=e.children.filter(X=>X!==void 0);y=Y[0]||null,w=Y[1]||null}if(y||(y=w,w=null),!y)throw Error("Splitter must have at least one child.");if(!w)return F.jsx(y.type,{...y.props,width:n,height:r});const E=s?u-c:c,b=o?e.gripThickness??gI:0,S=o?e.gripInnerThickness??vI:0,A=o?e.gripMargin??yI:0,C=E-b/2-A,T=u-C-b-2*A,M={top:0,left:0,width:n,height:r,overflow:"hidden"},x={left:0,top:0,width:l==="horizontal"?C:n,height:l==="horizontal"?r:C,zIndex:0,overflowY:l==="horizontal"?"auto":"hidden",overflowX:l==="horizontal"?"hidden":"auto"},N={left:l==="horizontal"?C+b+2*A:0,top:l==="horizontal"?0:C+b+2*A,width:l==="horizontal"?T:n,height:l==="horizontal"?r:T,zIndex:0,overflowY:l==="horizontal"?"auto":"hidden",overflowX:l==="horizontal"?"hidden":"auto"},O={left:0,top:0,width:l==="horizontal"?b+2*A:n,height:l==="horizontal"?r:b+2*A,backgroundColor:"transparent",cursor:l==="horizontal"?"col-resize":"row-resize",zIndex:9998},z={left:l==="horizontal"?A:0,top:l==="horizontal"?0:A,width:l==="horizontal"?b:n,height:l==="horizontal"?r:b,background:"rgb(230, 230, 230)",cursor:l==="horizontal"?"col-resize":"row-resize"},B={top:l==="horizontal"?0:(b-S)/2,left:l==="horizontal"?(b-S)/2:0,width:l==="horizontal"?S:n,height:l==="horizontal"?r:S,background:"gray",cursor:l==="horizontal"?"col-resize":"row-resize"},k=_.useCallback(Y=>{Y.preventDefault(),h(!0),m({x:Y.clientX,y:Y.clientY}),p(E)},[E]),$=_.useCallback(Y=>{if(!d)return;const X=Y.clientX-g.x,P=Y.clientY-g.y;let q=D+(l==="horizontal"?X:P);const L=4,j=u-4;q=Math.max(L,Math.min(j,q));const V=s?u-q:q;f(V),i&&i(V)},[d,g,D,l,u,s,i]),U=_.useCallback(()=>{h(!1)},[]);return _.useEffect(()=>{if(d)return document.addEventListener("mousemove",$),document.addEventListener("mouseup",U),()=>{document.removeEventListener("mousemove",$),document.removeEventListener("mouseup",U)}},[d,$,U]),F.jsxs("div",{className:"splitter",style:{...M,position:"relative"},children:[F.jsx("div",{style:{...x,position:"absolute"},className:"SplitterChild",children:F.jsx(y.type,{...y.props,width:l==="horizontal"?C:n,height:l==="horizontal"?r:C})},"child1"),o&&F.jsx("div",{ref:v,style:{...O,position:"absolute",left:l==="horizontal"?E-b/2-A:0,top:l==="horizontal"?0:E-b/2-A},onMouseDown:k,children:F.jsx("div",{style:{...z,position:"absolute"},children:F.jsx("div",{style:{...B,position:"absolute"}})})},"drag"),F.jsx("div",{style:{...N,position:"absolute"},className:"SplitterChild",children:F.jsx(w.type,{ref:t,...w.props,width:l==="horizontal"?T:n,height:l==="horizontal"?r:T})},"child2")]})}),bI=({data:e,width:t,height:n})=>{const[r,a]=_.useState(Hd),{selectedUnitIds:i,orderedUnitIds:o,plotClickHandlerGenerator:s,unitIdSelectionDispatch:l}=ri(),[u,c]=_.useState(1),[f,d]=_.useState(!1);_.useEffect(()=>{l({type:Wo,newUnitOrder:Pr(e.autocorrelograms.map(v=>v.unitId))})},[e.autocorrelograms,l]);const h=_.useMemo(()=>e.autocorrelograms.filter(v=>r.onlyShowSelected?i.has(v.unitId):!0).map(v=>({unitId:v.unitId,key:v.unitId,label:`Unit ${v.unitId}`,labelColor:Vr($t(v.unitId)),clickHandler:r.onlyShowSelected?void 0:s(v.unitId),props:{binEdgesSec:v.binEdgesSec,binCounts:v.binCounts,color:Vr($t(v.unitId)),width:120*u,height:120*u,hideXAxis:!f}})),[e.autocorrelograms,s,r.onlyShowSelected,i,f,u]),g=_.useMemo(()=>o&&o.length>0?o.map(v=>h.filter(y=>y.unitId===v)[0]).filter(v=>v!==void 0):h,[h,o]),m=_.useMemo(()=>{const v=[{type:"button",callback:()=>c(w=>w*1.3),title:"Increase box size",icon:F.jsx(Zf,{})},{type:"button",callback:()=>c(w=>w/1.3),title:"Decrease box size",icon:F.jsx(Xf,{})}],y={type:"toggle",subtype:"checkbox",callback:()=>d(w=>!w),title:"Show X Axis",selected:f===!0};return[...v,{type:"divider"},y]},[f]),D=30,p=gu;return F.jsxs("div",{children:[F.jsxs(Os,{width:t,height:n-D,initialPosition:p,adjustable:!1,children:[F.jsx(vu,{width:p,height:n,customActions:m}),F.jsx(Yf,{width:0,height:0,children:F.jsx(qf,{plots:g,plotComponent:uA,selectedPlotKeys:r.onlyShowSelected?void 0:i})})]}),F.jsx("div",{style:{position:"absolute",top:n-D,height:D,overflow:"hidden"},children:F.jsx(qd,{options:r,setOptions:a})})]})},Yg=e=>{const[t,n]=_.useState(void 0);return _.useEffect(()=>{const r=e.onChange(a=>{n(a)});return n(e.state),()=>{r()}},[e.onChange]),t===void 0?{state:void 0,dispatch:void 0}:{state:t,dispatch:e.dispatch}},DI=({zarrGroup:e,contexts:t,width:n,height:r})=>{const[a,i]=_.useState(null);return _.useEffect(()=>{let o=!1;return(async()=>{const l=[],u=e.attrs.num_autocorrelograms||0;if(u===0){o||i({type:"Autocorrelograms",autocorrelograms:[]});return}const c=await e.getDatasetData("bin_edges_sec",{}),f=await e.getDatasetData("bin_counts",{});if(!c||!f){console.error("Failed to load autocorrelograms data");return}const d=Array.from(c),h=new Int32Array(f),g=d.length-1,m=e.attrs.autocorrelograms;for(let D=0;D<u;D++){const p=m[D],v=D*g,y=Array.from(h.slice(v,v+g));l.push({unitId:p.unit_id,binEdgesSec:d,binCounts:y})}o||i({type:"Autocorrelograms",autocorrelograms:l})})(),()=>{o=!0}},[e]),a?F.jsx(bi,{context:t.unitSelection,children:F.jsx(bI,{data:a,width:n,height:r})}):F.jsx("div",{children:"Loading..."})},bi=({context:e,children:t})=>{const{state:n,dispatch:r}=Yg(e);return r?F.jsx(yD.Provider,{value:{unitSelection:n,unitSelectionDispatch:r},children:t}):F.jsx(F.Fragment,{children:"Waiting for context..."})},SI=e=>{const{unitId:t,mergeGroup:n}=e,r=Vr($t(t)),a=n?n.map(i=>`${i}`).join(", "):"";return F.jsxs("span",{children:[F.jsx("div",{className:"unitLabel",style:{backgroundColor:r}})," ",`${t}`,n&&n.length>0&&F.jsx("span",{children:` (${a})`},"mergeGroup")]})},wI=(e,t)=>((t||{}).mergeGroups||[]).filter(r=>r.includes(e))[0]||null,cA=e=>{const{rowId:t,selected:n,onClick:r,isIndeterminate:a,isDisabled:i}=e;return F.jsx(Ug,{checked:n,indeterminate:a,onClick:r,className:"SortableTableCheckbox",title:`${n?"Deselect":"Select"} ${t}`,disabled:i,size:"small"})},xI=e=>{const{rowId:t,selected:n,current:r,onClick:a,isDisabled:i,contentRepository:o}=e,s=o[t];return F.jsxs(jd,{className:r?"currentRow":n?"selectedRow":"",children:[a&&F.jsx(yi,{children:F.jsx(cA,{rowId:t,selected:n,onClick:a,isDisabled:i})},"_checkbox"),s]},t)};/*!
253
- * Font Awesome Free 7.0.1 by @fontawesome - https://fontawesome.com
254
- * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
255
- * Copyright 2025 Fonticons, Inc.
256
- */var EI={prefix:"fas",iconName:"caret-up",icon:[384,512,[],"f0d8","M32 352c-12.9 0-24.6-7.8-29.6-19.8S.2 306.5 9.4 297.4l160-160c12.5-12.5 32.8-12.5 45.3 0l160 160c9.2 9.2 11.9 22.9 6.9 34.9S364.9 352 352 352L32 352z"]},AI={prefix:"fas",iconName:"caret-down",icon:[384,512,[],"f0d7","M352 160c12.9 0 24.6 7.8 29.6 19.8s2.2 25.7-6.9 34.9l-160 160c-12.5 12.5-32.8 12.5-45.3 0l-160-160c-9.2-9.2-11.9-22.9-6.9-34.9S19.1 160 32 160l320 0z"]};/*!
257
- * Font Awesome Free 7.0.1 by @fontawesome - https://fontawesome.com
258
- * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
259
- * Copyright 2025 Fonticons, Inc.
260
- */function Gg(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function CI(e){if(Array.isArray(e))return e}function TI(e){if(Array.isArray(e))return Gg(e)}function MI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _I(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,dA(r.key),r)}}function NI(e,t,n){return t&&_I(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Yd(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Vg(e))||t){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(l){throw l},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
261
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var l=n.next();return o=l.done,l},e:function(l){s=!0,i=l},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw i}}}}function je(e,t,n){return(t=dA(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function FI(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function BI(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(c){u=!0,a=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return s}}function OI(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
262
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function RI(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
263
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function ue(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?fA(Object(n),!0).forEach(function(r){je(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Gd(e,t){return CI(e)||BI(e,t)||Vg(e,t)||OI()}function _r(e){return TI(e)||FI(e)||Vg(e)||RI()}function zI(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function dA(e){var t=zI(e,"string");return typeof t=="symbol"?t:t+""}function Vd(e){"@babel/helpers - typeof";return Vd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vd(e)}function Vg(e,t){if(e){if(typeof e=="string")return Gg(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Gg(e,t):void 0}}var hA=function(){},Xg={},mA={},pA=null,gA={mark:hA,measure:hA};try{typeof window<"u"&&(Xg=window),typeof document<"u"&&(mA=document),typeof MutationObserver<"u"&&(pA=MutationObserver),typeof performance<"u"&&(gA=performance)}catch{}var kI=Xg.navigator||{},vA=kI.userAgent,yA=vA===void 0?"":vA,Di=Xg,Dt=mA,bA=pA,Xd=gA;Di.document;var Ma=!!Dt.documentElement&&!!Dt.head&&typeof Dt.addEventListener=="function"&&typeof Dt.createElement=="function",DA=~yA.indexOf("MSIE")||~yA.indexOf("Trident/"),Zg,$I=/fa(k|kd|s|r|l|t|d|dr|dl|dt|b|slr|slpr|wsb|tl|ns|nds|es|jr|jfr|jdr|cr|ss|sr|sl|st|sds|sdr|sdl|sdt)?[\-\ ]/,II=/Font ?Awesome ?([567 ]*)(Solid|Regular|Light|Thin|Duotone|Brands|Free|Pro|Sharp Duotone|Sharp|Kit|Notdog Duo|Notdog|Chisel|Etch|Thumbprint|Jelly Fill|Jelly Duo|Jelly|Slab Press|Slab|Whiteboard)?.*/i,SA={classic:{fa:"solid",fas:"solid","fa-solid":"solid",far:"regular","fa-regular":"regular",fal:"light","fa-light":"light",fat:"thin","fa-thin":"thin",fab:"brands","fa-brands":"brands"},duotone:{fa:"solid",fad:"solid","fa-solid":"solid","fa-duotone":"solid",fadr:"regular","fa-regular":"regular",fadl:"light","fa-light":"light",fadt:"thin","fa-thin":"thin"},sharp:{fa:"solid",fass:"solid","fa-solid":"solid",fasr:"regular","fa-regular":"regular",fasl:"light","fa-light":"light",fast:"thin","fa-thin":"thin"},"sharp-duotone":{fa:"solid",fasds:"solid","fa-solid":"solid",fasdr:"regular","fa-regular":"regular",fasdl:"light","fa-light":"light",fasdt:"thin","fa-thin":"thin"},slab:{"fa-regular":"regular",faslr:"regular"},"slab-press":{"fa-regular":"regular",faslpr:"regular"},thumbprint:{"fa-light":"light",fatl:"light"},whiteboard:{"fa-semibold":"semibold",fawsb:"semibold"},notdog:{"fa-solid":"solid",fans:"solid"},"notdog-duo":{"fa-solid":"solid",fands:"solid"},etch:{"fa-solid":"solid",faes:"solid"},jelly:{"fa-regular":"regular",fajr:"regular"},"jelly-fill":{"fa-regular":"regular",fajfr:"regular"},"jelly-duo":{"fa-regular":"regular",fajdr:"regular"},chisel:{"fa-regular":"regular",facr:"regular"}},UI={GROUP:"duotone-group",PRIMARY:"primary",SECONDARY:"secondary"},wA=["fa-classic","fa-duotone","fa-sharp","fa-sharp-duotone","fa-thumbprint","fa-whiteboard","fa-notdog","fa-notdog-duo","fa-chisel","fa-etch","fa-jelly","fa-jelly-fill","fa-jelly-duo","fa-slab","fa-slab-press"],cn="classic",yu="duotone",xA="sharp",EA="sharp-duotone",AA="chisel",CA="etch",TA="jelly",MA="jelly-duo",_A="jelly-fill",NA="notdog",FA="notdog-duo",BA="slab",OA="slab-press",RA="thumbprint",zA="whiteboard",LI="Classic",PI="Duotone",jI="Sharp",HI="Sharp Duotone",qI="Chisel",YI="Etch",GI="Jelly",VI="Jelly Duo",XI="Jelly Fill",ZI="Notdog",KI="Notdog Duo",QI="Slab",WI="Slab Press",JI="Thumbprint",eU="Whiteboard",kA=[cn,yu,xA,EA,AA,CA,TA,MA,_A,NA,FA,BA,OA,RA,zA];Zg={},je(je(je(je(je(je(je(je(je(je(Zg,cn,LI),yu,PI),xA,jI),EA,HI),AA,qI),CA,YI),TA,GI),MA,VI),_A,XI),NA,ZI),je(je(je(je(je(Zg,FA,KI),BA,QI),OA,WI),RA,JI),zA,eU);var tU={classic:{900:"fas",400:"far",normal:"far",300:"fal",100:"fat"},duotone:{900:"fad",400:"fadr",300:"fadl",100:"fadt"},sharp:{900:"fass",400:"fasr",300:"fasl",100:"fast"},"sharp-duotone":{900:"fasds",400:"fasdr",300:"fasdl",100:"fasdt"},slab:{400:"faslr"},"slab-press":{400:"faslpr"},whiteboard:{600:"fawsb"},thumbprint:{300:"fatl"},notdog:{900:"fans"},"notdog-duo":{900:"fands"},etch:{900:"faes"},chisel:{400:"facr"},jelly:{400:"fajr"},"jelly-fill":{400:"fajfr"},"jelly-duo":{400:"fajdr"}},nU={"Font Awesome 7 Free":{900:"fas",400:"far"},"Font Awesome 7 Pro":{900:"fas",400:"far",normal:"far",300:"fal",100:"fat"},"Font Awesome 7 Brands":{400:"fab",normal:"fab"},"Font Awesome 7 Duotone":{900:"fad",400:"fadr",normal:"fadr",300:"fadl",100:"fadt"},"Font Awesome 7 Sharp":{900:"fass",400:"fasr",normal:"fasr",300:"fasl",100:"fast"},"Font Awesome 7 Sharp Duotone":{900:"fasds",400:"fasdr",normal:"fasdr",300:"fasdl",100:"fasdt"},"Font Awesome 7 Jelly":{400:"fajr",normal:"fajr"},"Font Awesome 7 Jelly Fill":{400:"fajfr",normal:"fajfr"},"Font Awesome 7 Jelly Duo":{400:"fajdr",normal:"fajdr"},"Font Awesome 7 Slab":{400:"faslr",normal:"faslr"},"Font Awesome 7 Slab Press":{400:"faslpr",normal:"faslpr"},"Font Awesome 7 Thumbprint":{300:"fatl",normal:"fatl"},"Font Awesome 7 Notdog":{900:"fans",normal:"fans"},"Font Awesome 7 Notdog Duo":{900:"fands",normal:"fands"},"Font Awesome 7 Etch":{900:"faes",normal:"faes"},"Font Awesome 7 Chisel":{400:"facr",normal:"facr"},"Font Awesome 7 Whiteboard":{600:"fawsb",normal:"fawsb"}},rU=new Map([["classic",{defaultShortPrefixId:"fas",defaultStyleId:"solid",styleIds:["solid","regular","light","thin","brands"],futureStyleIds:[],defaultFontWeight:900}],["duotone",{defaultShortPrefixId:"fad",defaultStyleId:"solid",styleIds:["solid","regular","light","thin"],futureStyleIds:[],defaultFontWeight:900}],["sharp",{defaultShortPrefixId:"fass",defaultStyleId:"solid",styleIds:["solid","regular","light","thin"],futureStyleIds:[],defaultFontWeight:900}],["sharp-duotone",{defaultShortPrefixId:"fasds",defaultStyleId:"solid",styleIds:["solid","regular","light","thin"],futureStyleIds:[],defaultFontWeight:900}],["chisel",{defaultShortPrefixId:"facr",defaultStyleId:"regular",styleIds:["regular"],futureStyleIds:[],defaultFontWeight:400}],["etch",{defaultShortPrefixId:"faes",defaultStyleId:"solid",styleIds:["solid"],futureStyleIds:[],defaultFontWeight:900}],["jelly",{defaultShortPrefixId:"fajr",defaultStyleId:"regular",styleIds:["regular"],futureStyleIds:[],defaultFontWeight:400}],["jelly-duo",{defaultShortPrefixId:"fajdr",defaultStyleId:"regular",styleIds:["regular"],futureStyleIds:[],defaultFontWeight:400}],["jelly-fill",{defaultShortPrefixId:"fajfr",defaultStyleId:"regular",styleIds:["regular"],futureStyleIds:[],defaultFontWeight:400}],["notdog",{defaultShortPrefixId:"fans",defaultStyleId:"solid",styleIds:["solid"],futureStyleIds:[],defaultFontWeight:900}],["notdog-duo",{defaultShortPrefixId:"fands",defaultStyleId:"solid",styleIds:["solid"],futureStyleIds:[],defaultFontWeight:900}],["slab",{defaultShortPrefixId:"faslr",defaultStyleId:"regular",styleIds:["regular"],futureStyleIds:[],defaultFontWeight:400}],["slab-press",{defaultShortPrefixId:"faslpr",defaultStyleId:"regular",styleIds:["regular"],futureStyleIds:[],defaultFontWeight:400}],["thumbprint",{defaultShortPrefixId:"fatl",defaultStyleId:"light",styleIds:["light"],futureStyleIds:[],defaultFontWeight:300}],["whiteboard",{defaultShortPrefixId:"fawsb",defaultStyleId:"semibold",styleIds:["semibold"],futureStyleIds:[],defaultFontWeight:600}]]),aU={chisel:{regular:"facr"},classic:{brands:"fab",light:"fal",regular:"far",solid:"fas",thin:"fat"},duotone:{light:"fadl",regular:"fadr",solid:"fad",thin:"fadt"},etch:{solid:"faes"},jelly:{regular:"fajr"},"jelly-duo":{regular:"fajdr"},"jelly-fill":{regular:"fajfr"},notdog:{solid:"fans"},"notdog-duo":{solid:"fands"},sharp:{light:"fasl",regular:"fasr",solid:"fass",thin:"fast"},"sharp-duotone":{light:"fasdl",regular:"fasdr",solid:"fasds",thin:"fasdt"},slab:{regular:"faslr"},"slab-press":{regular:"faslpr"},thumbprint:{light:"fatl"},whiteboard:{semibold:"fawsb"}},$A=["fak","fa-kit","fakd","fa-kit-duotone"],IA={kit:{fak:"kit","fa-kit":"kit"},"kit-duotone":{fakd:"kit-duotone","fa-kit-duotone":"kit-duotone"}},iU=["kit"],oU="kit",sU="kit-duotone",lU="Kit",uU="Kit Duotone";je(je({},oU,lU),sU,uU);var cU={kit:{"fa-kit":"fak"}},fU={"Font Awesome Kit":{400:"fak",normal:"fak"},"Font Awesome Kit Duotone":{400:"fakd",normal:"fakd"}},dU={kit:{fak:"fa-kit"}},UA={kit:{kit:"fak"},"kit-duotone":{"kit-duotone":"fakd"}},Kg,Zd={GROUP:"duotone-group",SWAP_OPACITY:"swap-opacity",PRIMARY:"primary",SECONDARY:"secondary"},hU=["fa-classic","fa-duotone","fa-sharp","fa-sharp-duotone","fa-thumbprint","fa-whiteboard","fa-notdog","fa-notdog-duo","fa-chisel","fa-etch","fa-jelly","fa-jelly-fill","fa-jelly-duo","fa-slab","fa-slab-press"],mU="classic",pU="duotone",gU="sharp",vU="sharp-duotone",yU="chisel",bU="etch",DU="jelly",SU="jelly-duo",wU="jelly-fill",xU="notdog",EU="notdog-duo",AU="slab",CU="slab-press",TU="thumbprint",MU="whiteboard",_U="Classic",NU="Duotone",FU="Sharp",BU="Sharp Duotone",OU="Chisel",RU="Etch",zU="Jelly",kU="Jelly Duo",$U="Jelly Fill",IU="Notdog",UU="Notdog Duo",LU="Slab",PU="Slab Press",jU="Thumbprint",HU="Whiteboard";Kg={},je(je(je(je(je(je(je(je(je(je(Kg,mU,_U),pU,NU),gU,FU),vU,BU),yU,OU),bU,RU),DU,zU),SU,kU),wU,$U),xU,IU),je(je(je(je(je(Kg,EU,UU),AU,LU),CU,PU),TU,jU),MU,HU);var qU="kit",YU="kit-duotone",GU="Kit",VU="Kit Duotone";je(je({},qU,GU),YU,VU);var XU={classic:{"fa-brands":"fab","fa-duotone":"fad","fa-light":"fal","fa-regular":"far","fa-solid":"fas","fa-thin":"fat"},duotone:{"fa-regular":"fadr","fa-light":"fadl","fa-thin":"fadt"},sharp:{"fa-solid":"fass","fa-regular":"fasr","fa-light":"fasl","fa-thin":"fast"},"sharp-duotone":{"fa-solid":"fasds","fa-regular":"fasdr","fa-light":"fasdl","fa-thin":"fasdt"},slab:{"fa-regular":"faslr"},"slab-press":{"fa-regular":"faslpr"},whiteboard:{"fa-semibold":"fawsb"},thumbprint:{"fa-light":"fatl"},notdog:{"fa-solid":"fans"},"notdog-duo":{"fa-solid":"fands"},etch:{"fa-solid":"faes"},jelly:{"fa-regular":"fajr"},"jelly-fill":{"fa-regular":"fajfr"},"jelly-duo":{"fa-regular":"fajdr"},chisel:{"fa-regular":"facr"}},ZU={classic:["fas","far","fal","fat","fad"],duotone:["fadr","fadl","fadt"],sharp:["fass","fasr","fasl","fast"],"sharp-duotone":["fasds","fasdr","fasdl","fasdt"],slab:["faslr"],"slab-press":["faslpr"],whiteboard:["fawsb"],thumbprint:["fatl"],notdog:["fans"],"notdog-duo":["fands"],etch:["faes"],jelly:["fajr"],"jelly-fill":["fajfr"],"jelly-duo":["fajdr"],chisel:["facr"]},Qg={classic:{fab:"fa-brands",fad:"fa-duotone",fal:"fa-light",far:"fa-regular",fas:"fa-solid",fat:"fa-thin"},duotone:{fadr:"fa-regular",fadl:"fa-light",fadt:"fa-thin"},sharp:{fass:"fa-solid",fasr:"fa-regular",fasl:"fa-light",fast:"fa-thin"},"sharp-duotone":{fasds:"fa-solid",fasdr:"fa-regular",fasdl:"fa-light",fasdt:"fa-thin"},slab:{faslr:"fa-regular"},"slab-press":{faslpr:"fa-regular"},whiteboard:{fawsb:"fa-semibold"},thumbprint:{fatl:"fa-light"},notdog:{fans:"fa-solid"},"notdog-duo":{fands:"fa-solid"},etch:{faes:"fa-solid"},jelly:{fajr:"fa-regular"},"jelly-fill":{fajfr:"fa-regular"},"jelly-duo":{fajdr:"fa-regular"},chisel:{facr:"fa-regular"}},KU=["fa-solid","fa-regular","fa-light","fa-thin","fa-duotone","fa-brands","fa-semibold"],LA=["fa","fas","far","fal","fat","fad","fadr","fadl","fadt","fab","fass","fasr","fasl","fast","fasds","fasdr","fasdl","fasdt","faslr","faslpr","fawsb","fatl","fans","fands","faes","fajr","fajfr","fajdr","facr"].concat(hU,KU),QU=["solid","regular","light","thin","duotone","brands","semibold"],PA=[1,2,3,4,5,6,7,8,9,10],WU=PA.concat([11,12,13,14,15,16,17,18,19,20]),JU=["aw","fw","pull-left","pull-right"],eL=[].concat(_r(Object.keys(ZU)),QU,JU,["2xs","xs","sm","lg","xl","2xl","beat","border","fade","beat-fade","bounce","flip-both","flip-horizontal","flip-vertical","flip","inverse","layers","layers-bottom-left","layers-bottom-right","layers-counter","layers-text","layers-top-left","layers-top-right","li","pull-end","pull-start","pulse","rotate-180","rotate-270","rotate-90","rotate-by","shake","spin-pulse","spin-reverse","spin","stack-1x","stack-2x","stack","ul","width-auto","width-fixed",Zd.GROUP,Zd.SWAP_OPACITY,Zd.PRIMARY,Zd.SECONDARY]).concat(PA.map(function(e){return"".concat(e,"x")})).concat(WU.map(function(e){return"w-".concat(e)})),tL={"Font Awesome 5 Free":{900:"fas",400:"far"},"Font Awesome 5 Pro":{900:"fas",400:"far",normal:"far",300:"fal"},"Font Awesome 5 Brands":{400:"fab",normal:"fab"},"Font Awesome 5 Duotone":{900:"fad"}},_a="___FONT_AWESOME___",Wg=16,jA="fa",HA="svg-inline--fa",to="data-fa-i2svg",Jg="data-fa-pseudo-element",nL="data-fa-pseudo-element-pending",e1="data-prefix",t1="data-icon",qA="fontawesome-i2svg",rL="async",aL=["HTML","HEAD","STYLE","SCRIPT"],YA=["::before","::after",":before",":after"],GA=function(){try{return!0}catch{return!1}}();function bu(e){return new Proxy(e,{get:function(n,r){return r in n?n[r]:n[cn]}})}var VA=ue({},SA);VA[cn]=ue(ue(ue(ue({},{"fa-duotone":"duotone"}),SA[cn]),IA.kit),IA["kit-duotone"]);var iL=bu(VA),n1=ue({},aU);n1[cn]=ue(ue(ue(ue({},{duotone:"fad"}),n1[cn]),UA.kit),UA["kit-duotone"]);var XA=bu(n1),r1=ue({},Qg);r1[cn]=ue(ue({},r1[cn]),dU.kit);var a1=bu(r1),i1=ue({},XU);i1[cn]=ue(ue({},i1[cn]),cU.kit),bu(i1);var oL=$I,ZA="fa-layers-text",sL=II,lL=ue({},tU);bu(lL);var uL=["class","data-prefix","data-icon","data-fa-transform","data-fa-mask"],o1=UI,cL=[].concat(_r(iU),_r(eL)),Du=Di.FontAwesomeConfig||{};function fL(e){var t=Dt.querySelector("script["+e+"]");if(t)return t.getAttribute(e)}function dL(e){return e===""?!0:e==="false"?!1:e==="true"?!0:e}if(Dt&&typeof Dt.querySelector=="function"){var hL=[["data-family-prefix","familyPrefix"],["data-css-prefix","cssPrefix"],["data-family-default","familyDefault"],["data-style-default","styleDefault"],["data-replacement-class","replacementClass"],["data-auto-replace-svg","autoReplaceSvg"],["data-auto-add-css","autoAddCss"],["data-search-pseudo-elements","searchPseudoElements"],["data-search-pseudo-elements-warnings","searchPseudoElementsWarnings"],["data-search-pseudo-elements-full-scan","searchPseudoElementsFullScan"],["data-observe-mutations","observeMutations"],["data-mutate-approach","mutateApproach"],["data-keep-original-source","keepOriginalSource"],["data-measure-performance","measurePerformance"],["data-show-missing-icons","showMissingIcons"]];hL.forEach(function(e){var t=Gd(e,2),n=t[0],r=t[1],a=dL(fL(n));a!=null&&(Du[r]=a)})}var KA={styleDefault:"solid",familyDefault:cn,cssPrefix:jA,replacementClass:HA,autoReplaceSvg:!0,autoAddCss:!0,searchPseudoElements:!1,searchPseudoElementsWarnings:!0,searchPseudoElementsFullScan:!1,observeMutations:!0,mutateApproach:"async",keepOriginalSource:!0,measurePerformance:!1,showMissingIcons:!0};Du.familyPrefix&&(Du.cssPrefix=Du.familyPrefix);var Rs=ue(ue({},KA),Du);Rs.autoReplaceSvg||(Rs.observeMutations=!1);var we={};Object.keys(KA).forEach(function(e){Object.defineProperty(we,e,{enumerable:!0,set:function(n){Rs[e]=n,Su.forEach(function(r){return r(we)})},get:function(){return Rs[e]}})}),Object.defineProperty(we,"familyPrefix",{enumerable:!0,set:function(t){Rs.cssPrefix=t,Su.forEach(function(n){return n(we)})},get:function(){return Rs.cssPrefix}}),Di.FontAwesomeConfig=we;var Su=[];function mL(e){return Su.push(e),function(){Su.splice(Su.indexOf(e),1)}}var zs=Wg,Wr={size:16,x:0,y:0,rotate:0,flipX:!1,flipY:!1};function pL(e){if(!(!e||!Ma)){var t=Dt.createElement("style");t.setAttribute("type","text/css"),t.innerHTML=e;for(var n=Dt.head.childNodes,r=null,a=n.length-1;a>-1;a--){var i=n[a],o=(i.tagName||"").toUpperCase();["STYLE","LINK"].indexOf(o)>-1&&(r=i)}return Dt.head.insertBefore(t,r),e}}var gL="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function QA(){for(var e=12,t="";e-- >0;)t+=gL[Math.random()*62|0];return t}function ks(e){for(var t=[],n=(e||[]).length>>>0;n--;)t[n]=e[n];return t}function s1(e){return e.classList?ks(e.classList):(e.getAttribute("class")||"").split(" ").filter(function(t){return t})}function WA(e){return"".concat(e).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function vL(e){return Object.keys(e||{}).reduce(function(t,n){return t+"".concat(n,'="').concat(WA(e[n]),'" ')},"").trim()}function Kd(e){return Object.keys(e||{}).reduce(function(t,n){return t+"".concat(n,": ").concat(e[n].trim(),";")},"")}function l1(e){return e.size!==Wr.size||e.x!==Wr.x||e.y!==Wr.y||e.rotate!==Wr.rotate||e.flipX||e.flipY}function yL(e){var t=e.transform,n=e.containerWidth,r=e.iconWidth,a={transform:"translate(".concat(n/2," 256)")},i="translate(".concat(t.x*32,", ").concat(t.y*32,") "),o="scale(".concat(t.size/16*(t.flipX?-1:1),", ").concat(t.size/16*(t.flipY?-1:1),") "),s="rotate(".concat(t.rotate," 0 0)"),l={transform:"".concat(i," ").concat(o," ").concat(s)},u={transform:"translate(".concat(r/2*-1," -256)")};return{outer:a,inner:l,path:u}}function bL(e){var t=e.transform,n=e.width,r=n===void 0?Wg:n,a=e.height,i=a===void 0?Wg:a,o="";return DA?o+="translate(".concat(t.x/zs-r/2,"em, ").concat(t.y/zs-i/2,"em) "):o+="translate(calc(-50% + ".concat(t.x/zs,"em), calc(-50% + ").concat(t.y/zs,"em)) "),o+="scale(".concat(t.size/zs*(t.flipX?-1:1),", ").concat(t.size/zs*(t.flipY?-1:1),") "),o+="rotate(".concat(t.rotate,"deg) "),o}var DL=`:root, :host {
264
- --fa-font-solid: normal 900 1em/1 "Font Awesome 7 Free";
265
- --fa-font-regular: normal 400 1em/1 "Font Awesome 7 Free";
266
- --fa-font-light: normal 300 1em/1 "Font Awesome 7 Pro";
267
- --fa-font-thin: normal 100 1em/1 "Font Awesome 7 Pro";
268
- --fa-font-duotone: normal 900 1em/1 "Font Awesome 7 Duotone";
269
- --fa-font-duotone-regular: normal 400 1em/1 "Font Awesome 7 Duotone";
270
- --fa-font-duotone-light: normal 300 1em/1 "Font Awesome 7 Duotone";
271
- --fa-font-duotone-thin: normal 100 1em/1 "Font Awesome 7 Duotone";
272
- --fa-font-brands: normal 400 1em/1 "Font Awesome 7 Brands";
273
- --fa-font-sharp-solid: normal 900 1em/1 "Font Awesome 7 Sharp";
274
- --fa-font-sharp-regular: normal 400 1em/1 "Font Awesome 7 Sharp";
275
- --fa-font-sharp-light: normal 300 1em/1 "Font Awesome 7 Sharp";
276
- --fa-font-sharp-thin: normal 100 1em/1 "Font Awesome 7 Sharp";
277
- --fa-font-sharp-duotone-solid: normal 900 1em/1 "Font Awesome 7 Sharp Duotone";
278
- --fa-font-sharp-duotone-regular: normal 400 1em/1 "Font Awesome 7 Sharp Duotone";
279
- --fa-font-sharp-duotone-light: normal 300 1em/1 "Font Awesome 7 Sharp Duotone";
280
- --fa-font-sharp-duotone-thin: normal 100 1em/1 "Font Awesome 7 Sharp Duotone";
281
- --fa-font-slab-regular: normal 400 1em/1 "Font Awesome 7 Slab";
282
- --fa-font-slab-press-regular: normal 400 1em/1 "Font Awesome 7 Slab Press";
283
- --fa-font-whiteboard-semibold: normal 600 1em/1 "Font Awesome 7 Whiteboard";
284
- --fa-font-thumbprint-light: normal 300 1em/1 "Font Awesome 7 Thumbprint";
285
- --fa-font-notdog-solid: normal 900 1em/1 "Font Awesome 7 Notdog";
286
- --fa-font-notdog-duo-solid: normal 900 1em/1 "Font Awesome 7 Notdog Duo";
287
- --fa-font-etch-solid: normal 900 1em/1 "Font Awesome 7 Etch";
288
- --fa-font-jelly-regular: normal 400 1em/1 "Font Awesome 7 Jelly";
289
- --fa-font-jelly-fill-regular: normal 400 1em/1 "Font Awesome 7 Jelly Fill";
290
- --fa-font-jelly-duo-regular: normal 400 1em/1 "Font Awesome 7 Jelly Duo";
291
- --fa-font-chisel-regular: normal 400 1em/1 "Font Awesome 7 Chisel";
292
- }
293
-
294
- .svg-inline--fa {
295
- box-sizing: content-box;
296
- display: var(--fa-display, inline-block);
297
- height: 1em;
298
- overflow: visible;
299
- vertical-align: -0.125em;
300
- width: var(--fa-width, 1.25em);
301
- }
302
- .svg-inline--fa.fa-2xs {
303
- vertical-align: 0.1em;
304
- }
305
- .svg-inline--fa.fa-xs {
306
- vertical-align: 0em;
307
- }
308
- .svg-inline--fa.fa-sm {
309
- vertical-align: -0.0714285714em;
310
- }
311
- .svg-inline--fa.fa-lg {
312
- vertical-align: -0.2em;
313
- }
314
- .svg-inline--fa.fa-xl {
315
- vertical-align: -0.25em;
316
- }
317
- .svg-inline--fa.fa-2xl {
318
- vertical-align: -0.3125em;
319
- }
320
- .svg-inline--fa.fa-pull-left,
321
- .svg-inline--fa .fa-pull-start {
322
- float: inline-start;
323
- margin-inline-end: var(--fa-pull-margin, 0.3em);
324
- }
325
- .svg-inline--fa.fa-pull-right,
326
- .svg-inline--fa .fa-pull-end {
327
- float: inline-end;
328
- margin-inline-start: var(--fa-pull-margin, 0.3em);
329
- }
330
- .svg-inline--fa.fa-li {
331
- width: var(--fa-li-width, 2em);
332
- inset-inline-start: calc(-1 * var(--fa-li-width, 2em));
333
- inset-block-start: 0.25em; /* syncing vertical alignment with Web Font rendering */
334
- }
335
-
336
- .fa-layers-counter, .fa-layers-text {
337
- display: inline-block;
338
- position: absolute;
339
- text-align: center;
340
- }
341
-
342
- .fa-layers {
343
- display: inline-block;
344
- height: 1em;
345
- position: relative;
346
- text-align: center;
347
- vertical-align: -0.125em;
348
- width: var(--fa-width, 1.25em);
349
- }
350
- .fa-layers .svg-inline--fa {
351
- inset: 0;
352
- margin: auto;
353
- position: absolute;
354
- transform-origin: center center;
355
- }
356
-
357
- .fa-layers-text {
358
- left: 50%;
359
- top: 50%;
360
- transform: translate(-50%, -50%);
361
- transform-origin: center center;
362
- }
363
-
364
- .fa-layers-counter {
365
- background-color: var(--fa-counter-background-color, #ff253a);
366
- border-radius: var(--fa-counter-border-radius, 1em);
367
- box-sizing: border-box;
368
- color: var(--fa-inverse, #fff);
369
- line-height: var(--fa-counter-line-height, 1);
370
- max-width: var(--fa-counter-max-width, 5em);
371
- min-width: var(--fa-counter-min-width, 1.5em);
372
- overflow: hidden;
373
- padding: var(--fa-counter-padding, 0.25em 0.5em);
374
- right: var(--fa-right, 0);
375
- text-overflow: ellipsis;
376
- top: var(--fa-top, 0);
377
- transform: scale(var(--fa-counter-scale, 0.25));
378
- transform-origin: top right;
379
- }
380
-
381
- .fa-layers-bottom-right {
382
- bottom: var(--fa-bottom, 0);
383
- right: var(--fa-right, 0);
384
- top: auto;
385
- transform: scale(var(--fa-layers-scale, 0.25));
386
- transform-origin: bottom right;
387
- }
388
-
389
- .fa-layers-bottom-left {
390
- bottom: var(--fa-bottom, 0);
391
- left: var(--fa-left, 0);
392
- right: auto;
393
- top: auto;
394
- transform: scale(var(--fa-layers-scale, 0.25));
395
- transform-origin: bottom left;
396
- }
397
-
398
- .fa-layers-top-right {
399
- top: var(--fa-top, 0);
400
- right: var(--fa-right, 0);
401
- transform: scale(var(--fa-layers-scale, 0.25));
402
- transform-origin: top right;
403
- }
404
-
405
- .fa-layers-top-left {
406
- left: var(--fa-left, 0);
407
- right: auto;
408
- top: var(--fa-top, 0);
409
- transform: scale(var(--fa-layers-scale, 0.25));
410
- transform-origin: top left;
411
- }
412
-
413
- .fa-1x {
414
- font-size: 1em;
415
- }
416
-
417
- .fa-2x {
418
- font-size: 2em;
419
- }
420
-
421
- .fa-3x {
422
- font-size: 3em;
423
- }
424
-
425
- .fa-4x {
426
- font-size: 4em;
427
- }
428
-
429
- .fa-5x {
430
- font-size: 5em;
431
- }
432
-
433
- .fa-6x {
434
- font-size: 6em;
435
- }
436
-
437
- .fa-7x {
438
- font-size: 7em;
439
- }
440
-
441
- .fa-8x {
442
- font-size: 8em;
443
- }
444
-
445
- .fa-9x {
446
- font-size: 9em;
447
- }
448
-
449
- .fa-10x {
450
- font-size: 10em;
451
- }
452
-
453
- .fa-2xs {
454
- font-size: calc(10 / 16 * 1em); /* converts a 10px size into an em-based value that's relative to the scale's 16px base */
455
- line-height: calc(1 / 10 * 1em); /* sets the line-height of the icon back to that of it's parent */
456
- vertical-align: calc((6 / 10 - 0.375) * 1em); /* vertically centers the icon taking into account the surrounding text's descender */
457
- }
458
-
459
- .fa-xs {
460
- font-size: calc(12 / 16 * 1em); /* converts a 12px size into an em-based value that's relative to the scale's 16px base */
461
- line-height: calc(1 / 12 * 1em); /* sets the line-height of the icon back to that of it's parent */
462
- vertical-align: calc((6 / 12 - 0.375) * 1em); /* vertically centers the icon taking into account the surrounding text's descender */
463
- }
464
-
465
- .fa-sm {
466
- font-size: calc(14 / 16 * 1em); /* converts a 14px size into an em-based value that's relative to the scale's 16px base */
467
- line-height: calc(1 / 14 * 1em); /* sets the line-height of the icon back to that of it's parent */
468
- vertical-align: calc((6 / 14 - 0.375) * 1em); /* vertically centers the icon taking into account the surrounding text's descender */
469
- }
470
-
471
- .fa-lg {
472
- font-size: calc(20 / 16 * 1em); /* converts a 20px size into an em-based value that's relative to the scale's 16px base */
473
- line-height: calc(1 / 20 * 1em); /* sets the line-height of the icon back to that of it's parent */
474
- vertical-align: calc((6 / 20 - 0.375) * 1em); /* vertically centers the icon taking into account the surrounding text's descender */
475
- }
476
-
477
- .fa-xl {
478
- font-size: calc(24 / 16 * 1em); /* converts a 24px size into an em-based value that's relative to the scale's 16px base */
479
- line-height: calc(1 / 24 * 1em); /* sets the line-height of the icon back to that of it's parent */
480
- vertical-align: calc((6 / 24 - 0.375) * 1em); /* vertically centers the icon taking into account the surrounding text's descender */
481
- }
482
-
483
- .fa-2xl {
484
- font-size: calc(32 / 16 * 1em); /* converts a 32px size into an em-based value that's relative to the scale's 16px base */
485
- line-height: calc(1 / 32 * 1em); /* sets the line-height of the icon back to that of it's parent */
486
- vertical-align: calc((6 / 32 - 0.375) * 1em); /* vertically centers the icon taking into account the surrounding text's descender */
487
- }
488
-
489
- .fa-width-auto {
490
- --fa-width: auto;
491
- }
492
-
493
- .fa-fw,
494
- .fa-width-fixed {
495
- --fa-width: 1.25em;
496
- }
497
-
498
- .fa-ul {
499
- list-style-type: none;
500
- margin-inline-start: var(--fa-li-margin, 2.5em);
501
- padding-inline-start: 0;
502
- }
503
- .fa-ul > li {
504
- position: relative;
505
- }
506
-
507
- .fa-li {
508
- inset-inline-start: calc(-1 * var(--fa-li-width, 2em));
509
- position: absolute;
510
- text-align: center;
511
- width: var(--fa-li-width, 2em);
512
- line-height: inherit;
513
- }
514
-
515
- /* Heads Up: Bordered Icons will not be supported in the future!
516
- - This feature will be deprecated in the next major release of Font Awesome (v8)!
517
- - You may continue to use it in this version *v7), but it will not be supported in Font Awesome v8.
518
- */
519
- /* Notes:
520
- * --@{v.$css-prefix}-border-width = 1/16 by default (to render as ~1px based on a 16px default font-size)
521
- * --@{v.$css-prefix}-border-padding =
522
- ** 3/16 for vertical padding (to give ~2px of vertical whitespace around an icon considering it's vertical alignment)
523
- ** 4/16 for horizontal padding (to give ~4px of horizontal whitespace around an icon)
524
- */
525
- .fa-border {
526
- border-color: var(--fa-border-color, #eee);
527
- border-radius: var(--fa-border-radius, 0.1em);
528
- border-style: var(--fa-border-style, solid);
529
- border-width: var(--fa-border-width, 0.0625em);
530
- box-sizing: var(--fa-border-box-sizing, content-box);
531
- padding: var(--fa-border-padding, 0.1875em 0.25em);
532
- }
533
-
534
- .fa-pull-left,
535
- .fa-pull-start {
536
- float: inline-start;
537
- margin-inline-end: var(--fa-pull-margin, 0.3em);
538
- }
539
-
540
- .fa-pull-right,
541
- .fa-pull-end {
542
- float: inline-end;
543
- margin-inline-start: var(--fa-pull-margin, 0.3em);
544
- }
545
-
546
- .fa-beat {
547
- animation-name: fa-beat;
548
- animation-delay: var(--fa-animation-delay, 0s);
549
- animation-direction: var(--fa-animation-direction, normal);
550
- animation-duration: var(--fa-animation-duration, 1s);
551
- animation-iteration-count: var(--fa-animation-iteration-count, infinite);
552
- animation-timing-function: var(--fa-animation-timing, ease-in-out);
553
- }
554
-
555
- .fa-bounce {
556
- animation-name: fa-bounce;
557
- animation-delay: var(--fa-animation-delay, 0s);
558
- animation-direction: var(--fa-animation-direction, normal);
559
- animation-duration: var(--fa-animation-duration, 1s);
560
- animation-iteration-count: var(--fa-animation-iteration-count, infinite);
561
- animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.28, 0.84, 0.42, 1));
562
- }
563
-
564
- .fa-fade {
565
- animation-name: fa-fade;
566
- animation-delay: var(--fa-animation-delay, 0s);
567
- animation-direction: var(--fa-animation-direction, normal);
568
- animation-duration: var(--fa-animation-duration, 1s);
569
- animation-iteration-count: var(--fa-animation-iteration-count, infinite);
570
- animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));
571
- }
572
-
573
- .fa-beat-fade {
574
- animation-name: fa-beat-fade;
575
- animation-delay: var(--fa-animation-delay, 0s);
576
- animation-direction: var(--fa-animation-direction, normal);
577
- animation-duration: var(--fa-animation-duration, 1s);
578
- animation-iteration-count: var(--fa-animation-iteration-count, infinite);
579
- animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));
580
- }
581
-
582
- .fa-flip {
583
- animation-name: fa-flip;
584
- animation-delay: var(--fa-animation-delay, 0s);
585
- animation-direction: var(--fa-animation-direction, normal);
586
- animation-duration: var(--fa-animation-duration, 1s);
587
- animation-iteration-count: var(--fa-animation-iteration-count, infinite);
588
- animation-timing-function: var(--fa-animation-timing, ease-in-out);
589
- }
590
-
591
- .fa-shake {
592
- animation-name: fa-shake;
593
- animation-delay: var(--fa-animation-delay, 0s);
594
- animation-direction: var(--fa-animation-direction, normal);
595
- animation-duration: var(--fa-animation-duration, 1s);
596
- animation-iteration-count: var(--fa-animation-iteration-count, infinite);
597
- animation-timing-function: var(--fa-animation-timing, linear);
598
- }
599
-
600
- .fa-spin {
601
- animation-name: fa-spin;
602
- animation-delay: var(--fa-animation-delay, 0s);
603
- animation-direction: var(--fa-animation-direction, normal);
604
- animation-duration: var(--fa-animation-duration, 2s);
605
- animation-iteration-count: var(--fa-animation-iteration-count, infinite);
606
- animation-timing-function: var(--fa-animation-timing, linear);
607
- }
608
-
609
- .fa-spin-reverse {
610
- --fa-animation-direction: reverse;
611
- }
612
-
613
- .fa-pulse,
614
- .fa-spin-pulse {
615
- animation-name: fa-spin;
616
- animation-direction: var(--fa-animation-direction, normal);
617
- animation-duration: var(--fa-animation-duration, 1s);
618
- animation-iteration-count: var(--fa-animation-iteration-count, infinite);
619
- animation-timing-function: var(--fa-animation-timing, steps(8));
620
- }
621
-
622
- @media (prefers-reduced-motion: reduce) {
623
- .fa-beat,
624
- .fa-bounce,
625
- .fa-fade,
626
- .fa-beat-fade,
627
- .fa-flip,
628
- .fa-pulse,
629
- .fa-shake,
630
- .fa-spin,
631
- .fa-spin-pulse {
632
- animation: none !important;
633
- transition: none !important;
634
- }
635
- }
636
- @keyframes fa-beat {
637
- 0%, 90% {
638
- transform: scale(1);
639
- }
640
- 45% {
641
- transform: scale(var(--fa-beat-scale, 1.25));
642
- }
643
- }
644
- @keyframes fa-bounce {
645
- 0% {
646
- transform: scale(1, 1) translateY(0);
647
- }
648
- 10% {
649
- transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0);
650
- }
651
- 30% {
652
- transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em));
653
- }
654
- 50% {
655
- transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0);
656
- }
657
- 57% {
658
- transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em));
659
- }
660
- 64% {
661
- transform: scale(1, 1) translateY(0);
662
- }
663
- 100% {
664
- transform: scale(1, 1) translateY(0);
665
- }
666
- }
667
- @keyframes fa-fade {
668
- 50% {
669
- opacity: var(--fa-fade-opacity, 0.4);
670
- }
671
- }
672
- @keyframes fa-beat-fade {
673
- 0%, 100% {
674
- opacity: var(--fa-beat-fade-opacity, 0.4);
675
- transform: scale(1);
676
- }
677
- 50% {
678
- opacity: 1;
679
- transform: scale(var(--fa-beat-fade-scale, 1.125));
680
- }
681
- }
682
- @keyframes fa-flip {
683
- 50% {
684
- transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg));
685
- }
686
- }
687
- @keyframes fa-shake {
688
- 0% {
689
- transform: rotate(-15deg);
690
- }
691
- 4% {
692
- transform: rotate(15deg);
693
- }
694
- 8%, 24% {
695
- transform: rotate(-18deg);
696
- }
697
- 12%, 28% {
698
- transform: rotate(18deg);
699
- }
700
- 16% {
701
- transform: rotate(-22deg);
702
- }
703
- 20% {
704
- transform: rotate(22deg);
705
- }
706
- 32% {
707
- transform: rotate(-12deg);
708
- }
709
- 36% {
710
- transform: rotate(12deg);
711
- }
712
- 40%, 100% {
713
- transform: rotate(0deg);
714
- }
715
- }
716
- @keyframes fa-spin {
717
- 0% {
718
- transform: rotate(0deg);
719
- }
720
- 100% {
721
- transform: rotate(360deg);
722
- }
723
- }
724
- .fa-rotate-90 {
725
- transform: rotate(90deg);
726
- }
727
-
728
- .fa-rotate-180 {
729
- transform: rotate(180deg);
730
- }
731
-
732
- .fa-rotate-270 {
733
- transform: rotate(270deg);
734
- }
735
-
736
- .fa-flip-horizontal {
737
- transform: scale(-1, 1);
738
- }
739
-
740
- .fa-flip-vertical {
741
- transform: scale(1, -1);
742
- }
743
-
744
- .fa-flip-both,
745
- .fa-flip-horizontal.fa-flip-vertical {
746
- transform: scale(-1, -1);
747
- }
748
-
749
- .fa-rotate-by {
750
- transform: rotate(var(--fa-rotate-angle, 0));
751
- }
752
-
753
- .svg-inline--fa .fa-primary {
754
- fill: var(--fa-primary-color, currentColor);
755
- opacity: var(--fa-primary-opacity, 1);
756
- }
757
-
758
- .svg-inline--fa .fa-secondary {
759
- fill: var(--fa-secondary-color, currentColor);
760
- opacity: var(--fa-secondary-opacity, 0.4);
761
- }
762
-
763
- .svg-inline--fa.fa-swap-opacity .fa-primary {
764
- opacity: var(--fa-secondary-opacity, 0.4);
765
- }
766
-
767
- .svg-inline--fa.fa-swap-opacity .fa-secondary {
768
- opacity: var(--fa-primary-opacity, 1);
769
- }
770
-
771
- .svg-inline--fa mask .fa-primary,
772
- .svg-inline--fa mask .fa-secondary {
773
- fill: black;
774
- }
775
-
776
- .svg-inline--fa.fa-inverse {
777
- fill: var(--fa-inverse, #fff);
778
- }
779
-
780
- .fa-stack {
781
- display: inline-block;
782
- height: 2em;
783
- line-height: 2em;
784
- position: relative;
785
- vertical-align: middle;
786
- width: 2.5em;
787
- }
788
-
789
- .fa-inverse {
790
- color: var(--fa-inverse, #fff);
791
- }
792
-
793
- .svg-inline--fa.fa-stack-1x {
794
- --fa-width: 1.25em;
795
- height: 1em;
796
- width: var(--fa-width);
797
- }
798
- .svg-inline--fa.fa-stack-2x {
799
- --fa-width: 2.5em;
800
- height: 2em;
801
- width: var(--fa-width);
802
- }
803
-
804
- .fa-stack-1x,
805
- .fa-stack-2x {
806
- inset: 0;
807
- margin: auto;
808
- position: absolute;
809
- z-index: var(--fa-stack-z-index, auto);
810
- }`;function JA(){var e=jA,t=HA,n=we.cssPrefix,r=we.replacementClass,a=DL;if(n!==e||r!==t){var i=new RegExp("\\.".concat(e,"\\-"),"g"),o=new RegExp("\\--".concat(e,"\\-"),"g"),s=new RegExp("\\.".concat(t),"g");a=a.replace(i,".".concat(n,"-")).replace(o,"--".concat(n,"-")).replace(s,".".concat(r))}return a}var e3=!1;function u1(){we.autoAddCss&&!e3&&(pL(JA()),e3=!0)}var SL={mixout:function(){return{dom:{css:JA,insertCss:u1}}},hooks:function(){return{beforeDOMElementCreation:function(){u1()},beforeI2svg:function(){u1()}}}},Na=Di||{};Na[_a]||(Na[_a]={}),Na[_a].styles||(Na[_a].styles={}),Na[_a].hooks||(Na[_a].hooks={}),Na[_a].shims||(Na[_a].shims=[]);var Nr=Na[_a],t3=[],n3=function(){Dt.removeEventListener("DOMContentLoaded",n3),Qd=1,t3.map(function(t){return t()})},Qd=!1;Ma&&(Qd=(Dt.documentElement.doScroll?/^loaded|^c/:/^loaded|^i|^c/).test(Dt.readyState),Qd||Dt.addEventListener("DOMContentLoaded",n3));function wL(e){Ma&&(Qd?setTimeout(e,0):t3.push(e))}function wu(e){var t=e.tag,n=e.attributes,r=n===void 0?{}:n,a=e.children,i=a===void 0?[]:a;return typeof e=="string"?WA(e):"<".concat(t," ").concat(vL(r),">").concat(i.map(wu).join(""),"</").concat(t,">")}function r3(e,t,n){if(e&&e[t]&&e[t][n])return{prefix:t,iconName:n,icon:e[t][n]}}var c1=function(t,n,r,a){var i=Object.keys(t),o=i.length,s=n,l,u,c;for(r===void 0?(l=1,c=t[i[0]]):(l=0,c=r);l<o;l++)u=i[l],c=s(c,t[u],u,t);return c};function a3(e){return _r(e).length!==1?null:e.codePointAt(0).toString(16)}function i3(e){return Object.keys(e).reduce(function(t,n){var r=e[n],a=!!r.icon;return a?t[r.iconName]=r.icon:t[n]=r,t},{})}function f1(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.skipHooks,a=r===void 0?!1:r,i=i3(t);typeof Nr.hooks.addPack=="function"&&!a?Nr.hooks.addPack(e,i3(t)):Nr.styles[e]=ue(ue({},Nr.styles[e]||{}),i),e==="fas"&&f1("fa",t)}var xu=Nr.styles,xL=Nr.shims,o3=Object.keys(a1),EL=o3.reduce(function(e,t){return e[t]=Object.keys(a1[t]),e},{}),d1=null,s3={},l3={},u3={},c3={},f3={};function AL(e){return~cL.indexOf(e)}function CL(e,t){var n=t.split("-"),r=n[0],a=n.slice(1).join("-");return r===e&&a!==""&&!AL(a)?a:null}var d3=function(){var t=function(i){return c1(xu,function(o,s,l){return o[l]=c1(s,i,{}),o},{})};s3=t(function(a,i,o){if(i[3]&&(a[i[3]]=o),i[2]){var s=i[2].filter(function(l){return typeof l=="number"});s.forEach(function(l){a[l.toString(16)]=o})}return a}),l3=t(function(a,i,o){if(a[o]=o,i[2]){var s=i[2].filter(function(l){return typeof l=="string"});s.forEach(function(l){a[l]=o})}return a}),f3=t(function(a,i,o){var s=i[2];return a[o]=o,s.forEach(function(l){a[l]=o}),a});var n="far"in xu||we.autoFetchSvg,r=c1(xL,function(a,i){var o=i[0],s=i[1],l=i[2];return s==="far"&&!n&&(s="fas"),typeof o=="string"&&(a.names[o]={prefix:s,iconName:l}),typeof o=="number"&&(a.unicodes[o.toString(16)]={prefix:s,iconName:l}),a},{names:{},unicodes:{}});u3=r.names,c3=r.unicodes,d1=Wd(we.styleDefault,{family:we.familyDefault})};mL(function(e){d1=Wd(e.styleDefault,{family:we.familyDefault})}),d3();function h1(e,t){return(s3[e]||{})[t]}function TL(e,t){return(l3[e]||{})[t]}function no(e,t){return(f3[e]||{})[t]}function h3(e){return u3[e]||{prefix:null,iconName:null}}function ML(e){var t=c3[e],n=h1("fas",e);return t||(n?{prefix:"fas",iconName:n}:null)||{prefix:null,iconName:null}}function Si(){return d1}var m3=function(){return{prefix:null,iconName:null,rest:[]}};function _L(e){var t=cn,n=o3.reduce(function(r,a){return r[a]="".concat(we.cssPrefix,"-").concat(a),r},{});return kA.forEach(function(r){(e.includes(n[r])||e.some(function(a){return EL[r].includes(a)}))&&(t=r)}),t}function Wd(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.family,r=n===void 0?cn:n,a=iL[r][e];if(r===yu&&!e)return"fad";var i=XA[r][e]||XA[r][a],o=e in Nr.styles?e:null,s=i||o||null;return s}function NL(e){var t=[],n=null;return e.forEach(function(r){var a=CL(we.cssPrefix,r);a?n=a:r&&t.push(r)}),{iconName:n,rest:t}}function p3(e){return e.sort().filter(function(t,n,r){return r.indexOf(t)===n})}var g3=LA.concat($A);function Jd(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.skipLookups,r=n===void 0?!1:n,a=null,i=p3(e.filter(function(h){return g3.includes(h)})),o=p3(e.filter(function(h){return!g3.includes(h)})),s=i.filter(function(h){return a=h,!wA.includes(h)}),l=Gd(s,1),u=l[0],c=u===void 0?null:u,f=_L(i),d=ue(ue({},NL(o)),{},{prefix:Wd(c,{family:f})});return ue(ue(ue({},d),RL({values:e,family:f,styles:xu,config:we,canonical:d,givenPrefix:a})),FL(r,a,d))}function FL(e,t,n){var r=n.prefix,a=n.iconName;if(e||!r||!a)return{prefix:r,iconName:a};var i=t==="fa"?h3(a):{},o=no(r,a);return a=i.iconName||o||a,r=i.prefix||r,r==="far"&&!xu.far&&xu.fas&&!we.autoFetchSvg&&(r="fas"),{prefix:r,iconName:a}}var BL=kA.filter(function(e){return e!==cn||e!==yu}),OL=Object.keys(Qg).filter(function(e){return e!==cn}).map(function(e){return Object.keys(Qg[e])}).flat();function RL(e){var t=e.values,n=e.family,r=e.canonical,a=e.givenPrefix,i=a===void 0?"":a,o=e.styles,s=o===void 0?{}:o,l=e.config,u=l===void 0?{}:l,c=n===yu,f=t.includes("fa-duotone")||t.includes("fad"),d=u.familyDefault==="duotone",h=r.prefix==="fad"||r.prefix==="fa-duotone";if(!c&&(f||d||h)&&(r.prefix="fad"),(t.includes("fa-brands")||t.includes("fab"))&&(r.prefix="fab"),!r.prefix&&BL.includes(n)){var g=Object.keys(s).find(function(D){return OL.includes(D)});if(g||u.autoFetchSvg){var m=rU.get(n).defaultShortPrefixId;r.prefix=m,r.iconName=no(r.prefix,r.iconName)||r.iconName}}return(r.prefix==="fa"||i==="fa")&&(r.prefix=Si()||"fas"),r}var zL=function(){function e(){MI(this,e),this.definitions={}}return NI(e,[{key:"add",value:function(){for(var n=this,r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];var o=a.reduce(this._pullDefinitions,{});Object.keys(o).forEach(function(s){n.definitions[s]=ue(ue({},n.definitions[s]||{}),o[s]),f1(s,o[s]);var l=a1[cn][s];l&&f1(l,o[s]),d3()})}},{key:"reset",value:function(){this.definitions={}}},{key:"_pullDefinitions",value:function(n,r){var a=r.prefix&&r.iconName&&r.icon?{0:r}:r;return Object.keys(a).map(function(i){var o=a[i],s=o.prefix,l=o.iconName,u=o.icon,c=u[2];n[s]||(n[s]={}),c.length>0&&c.forEach(function(f){typeof f=="string"&&(n[s][f]=u)}),n[s][l]=u}),n}}])}(),v3=[],$s={},Is={},kL=Object.keys(Is);function $L(e,t){var n=t.mixoutsTo;return v3=e,$s={},Object.keys(Is).forEach(function(r){kL.indexOf(r)===-1&&delete Is[r]}),v3.forEach(function(r){var a=r.mixout?r.mixout():{};if(Object.keys(a).forEach(function(o){typeof a[o]=="function"&&(n[o]=a[o]),Vd(a[o])==="object"&&Object.keys(a[o]).forEach(function(s){n[o]||(n[o]={}),n[o][s]=a[o][s]})}),r.hooks){var i=r.hooks();Object.keys(i).forEach(function(o){$s[o]||($s[o]=[]),$s[o].push(i[o])})}r.provides&&r.provides(Is)}),n}function m1(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),a=2;a<n;a++)r[a-2]=arguments[a];var i=$s[e]||[];return i.forEach(function(o){t=o.apply(null,[t].concat(r))}),t}function ro(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var a=$s[e]||[];a.forEach(function(i){i.apply(null,n)})}function wi(){var e=arguments[0],t=Array.prototype.slice.call(arguments,1);return Is[e]?Is[e].apply(null,t):void 0}function p1(e){e.prefix==="fa"&&(e.prefix="fas");var t=e.iconName,n=e.prefix||Si();if(t)return t=no(n,t)||t,r3(y3.definitions,n,t)||r3(Nr.styles,n,t)}var y3=new zL,IL=function(){we.autoReplaceSvg=!1,we.observeMutations=!1,ro("noAuto")},UL={i2svg:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Ma?(ro("beforeI2svg",t),wi("pseudoElements2svg",t),wi("i2svg",t)):Promise.reject(new Error("Operation requires a DOM of some kind."))},watch:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.autoReplaceSvgRoot;we.autoReplaceSvg===!1&&(we.autoReplaceSvg=!0),we.observeMutations=!0,wL(function(){PL({autoReplaceSvgRoot:n}),ro("watch",t)})}},LL={icon:function(t){if(t===null)return null;if(Vd(t)==="object"&&t.prefix&&t.iconName)return{prefix:t.prefix,iconName:no(t.prefix,t.iconName)||t.iconName};if(Array.isArray(t)&&t.length===2){var n=t[1].indexOf("fa-")===0?t[1].slice(3):t[1],r=Wd(t[0]);return{prefix:r,iconName:no(r,n)||n}}if(typeof t=="string"&&(t.indexOf("".concat(we.cssPrefix,"-"))>-1||t.match(oL))){var a=Jd(t.split(" "),{skipLookups:!0});return{prefix:a.prefix||Si(),iconName:no(a.prefix,a.iconName)||a.iconName}}if(typeof t=="string"){var i=Si();return{prefix:i,iconName:no(i,t)||t}}}},er={noAuto:IL,config:we,dom:UL,parse:LL,library:y3,findIconDefinition:p1,toHtml:wu},PL=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.autoReplaceSvgRoot,r=n===void 0?Dt:n;(Object.keys(Nr.styles).length>0||we.autoFetchSvg)&&Ma&&we.autoReplaceSvg&&er.dom.i2svg({node:r})};function e0(e,t){return Object.defineProperty(e,"abstract",{get:t}),Object.defineProperty(e,"html",{get:function(){return e.abstract.map(function(r){return wu(r)})}}),Object.defineProperty(e,"node",{get:function(){if(Ma){var r=Dt.createElement("div");return r.innerHTML=e.html,r.children}}}),e}function jL(e){var t=e.children,n=e.main,r=e.mask,a=e.attributes,i=e.styles,o=e.transform;if(l1(o)&&n.found&&!r.found){var s=n.width,l=n.height,u={x:s/l/2,y:.5};a.style=Kd(ue(ue({},i),{},{"transform-origin":"".concat(u.x+o.x/16,"em ").concat(u.y+o.y/16,"em")}))}return[{tag:"svg",attributes:a,children:t}]}function HL(e){var t=e.prefix,n=e.iconName,r=e.children,a=e.attributes,i=e.symbol,o=i===!0?"".concat(t,"-").concat(we.cssPrefix,"-").concat(n):i;return[{tag:"svg",attributes:{style:"display: none;"},children:[{tag:"symbol",attributes:ue(ue({},a),{},{id:o}),children:r}]}]}function qL(e){var t=["aria-label","aria-labelledby","title","role"];return t.some(function(n){return n in e})}function g1(e){var t=e.icons,n=t.main,r=t.mask,a=e.prefix,i=e.iconName,o=e.transform,s=e.symbol,l=e.maskId,u=e.extra,c=e.watchable,f=c===void 0?!1:c,d=r.found?r:n,h=d.width,g=d.height,m=[we.replacementClass,i?"".concat(we.cssPrefix,"-").concat(i):""].filter(function(E){return u.classes.indexOf(E)===-1}).filter(function(E){return E!==""||!!E}).concat(u.classes).join(" "),D={children:[],attributes:ue(ue({},u.attributes),{},{"data-prefix":a,"data-icon":i,class:m,role:u.attributes.role||"img",viewBox:"0 0 ".concat(h," ").concat(g)})};!qL(u.attributes)&&!u.attributes["aria-hidden"]&&(D.attributes["aria-hidden"]="true"),f&&(D.attributes[to]="");var p=ue(ue({},D),{},{prefix:a,iconName:i,main:n,mask:r,maskId:l,transform:o,symbol:s,styles:ue({},u.styles)}),v=r.found&&n.found?wi("generateAbstractMask",p)||{children:[],attributes:{}}:wi("generateAbstractIcon",p)||{children:[],attributes:{}},y=v.children,w=v.attributes;return p.children=y,p.attributes=w,s?HL(p):jL(p)}function b3(e){var t=e.content,n=e.width,r=e.height,a=e.transform,i=e.extra,o=e.watchable,s=o===void 0?!1:o,l=ue(ue({},i.attributes),{},{class:i.classes.join(" ")});s&&(l[to]="");var u=ue({},i.styles);l1(a)&&(u.transform=bL({transform:a,width:n,height:r}),u["-webkit-transform"]=u.transform);var c=Kd(u);c.length>0&&(l.style=c);var f=[];return f.push({tag:"span",attributes:l,children:[t]}),f}function YL(e){var t=e.content,n=e.extra,r=ue(ue({},n.attributes),{},{class:n.classes.join(" ")}),a=Kd(n.styles);a.length>0&&(r.style=a);var i=[];return i.push({tag:"span",attributes:r,children:[t]}),i}var v1=Nr.styles;function y1(e){var t=e[0],n=e[1],r=e.slice(4),a=Gd(r,1),i=a[0],o=null;return Array.isArray(i)?o={tag:"g",attributes:{class:"".concat(we.cssPrefix,"-").concat(o1.GROUP)},children:[{tag:"path",attributes:{class:"".concat(we.cssPrefix,"-").concat(o1.SECONDARY),fill:"currentColor",d:i[0]}},{tag:"path",attributes:{class:"".concat(we.cssPrefix,"-").concat(o1.PRIMARY),fill:"currentColor",d:i[1]}}]}:o={tag:"path",attributes:{fill:"currentColor",d:i}},{found:!0,width:t,height:n,icon:o}}var GL={found:!1,width:512,height:512};function VL(e,t){!GA&&!we.showMissingIcons&&e&&console.error('Icon with name "'.concat(e,'" and prefix "').concat(t,'" is missing.'))}function b1(e,t){var n=t;return t==="fa"&&we.styleDefault!==null&&(t=Si()),new Promise(function(r,a){if(n==="fa"){var i=h3(e)||{};e=i.iconName||e,t=i.prefix||t}if(e&&t&&v1[t]&&v1[t][e]){var o=v1[t][e];return r(y1(o))}VL(e,t),r(ue(ue({},GL),{},{icon:we.showMissingIcons&&e?wi("missingIconAbstract")||{}:{}}))})}var D3=function(){},D1=we.measurePerformance&&Xd&&Xd.mark&&Xd.measure?Xd:{mark:D3,measure:D3},Eu='FA "7.0.1"',XL=function(t){return D1.mark("".concat(Eu," ").concat(t," begins")),function(){return S3(t)}},S3=function(t){D1.mark("".concat(Eu," ").concat(t," ends")),D1.measure("".concat(Eu," ").concat(t),"".concat(Eu," ").concat(t," begins"),"".concat(Eu," ").concat(t," ends"))},S1={begin:XL,end:S3},t0=function(){};function w3(e){var t=e.getAttribute?e.getAttribute(to):null;return typeof t=="string"}function ZL(e){var t=e.getAttribute?e.getAttribute(e1):null,n=e.getAttribute?e.getAttribute(t1):null;return t&&n}function KL(e){return e&&e.classList&&e.classList.contains&&e.classList.contains(we.replacementClass)}function QL(){if(we.autoReplaceSvg===!0)return n0.replace;var e=n0[we.autoReplaceSvg];return e||n0.replace}function WL(e){return Dt.createElementNS("http://www.w3.org/2000/svg",e)}function JL(e){return Dt.createElement(e)}function x3(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.ceFn,r=n===void 0?e.tag==="svg"?WL:JL:n;if(typeof e=="string")return Dt.createTextNode(e);var a=r(e.tag);Object.keys(e.attributes||[]).forEach(function(o){a.setAttribute(o,e.attributes[o])});var i=e.children||[];return i.forEach(function(o){a.appendChild(x3(o,{ceFn:r}))}),a}function eP(e){var t=" ".concat(e.outerHTML," ");return t="".concat(t,"Font Awesome fontawesome.com "),t}var n0={replace:function(t){var n=t[0];if(n.parentNode)if(t[1].forEach(function(a){n.parentNode.insertBefore(x3(a),n)}),n.getAttribute(to)===null&&we.keepOriginalSource){var r=Dt.createComment(eP(n));n.parentNode.replaceChild(r,n)}else n.remove()},nest:function(t){var n=t[0],r=t[1];if(~s1(n).indexOf(we.replacementClass))return n0.replace(t);var a=new RegExp("".concat(we.cssPrefix,"-.*"));if(delete r[0].attributes.id,r[0].attributes.class){var i=r[0].attributes.class.split(" ").reduce(function(s,l){return l===we.replacementClass||l.match(a)?s.toSvg.push(l):s.toNode.push(l),s},{toNode:[],toSvg:[]});r[0].attributes.class=i.toSvg.join(" "),i.toNode.length===0?n.removeAttribute("class"):n.setAttribute("class",i.toNode.join(" "))}var o=r.map(function(s){return wu(s)}).join(`
811
- `);n.setAttribute(to,""),n.innerHTML=o}};function E3(e){e()}function A3(e,t){var n=typeof t=="function"?t:t0;if(e.length===0)n();else{var r=E3;we.mutateApproach===rL&&(r=Di.requestAnimationFrame||E3),r(function(){var a=QL(),i=S1.begin("mutate");e.map(a),i(),n()})}}var w1=!1;function C3(){w1=!0}function x1(){w1=!1}var r0=null;function T3(e){if(bA&&we.observeMutations){var t=e.treeCallback,n=t===void 0?t0:t,r=e.nodeCallback,a=r===void 0?t0:r,i=e.pseudoElementsCallback,o=i===void 0?t0:i,s=e.observeMutationsRoot,l=s===void 0?Dt:s;r0=new bA(function(u){if(!w1){var c=Si();ks(u).forEach(function(f){if(f.type==="childList"&&f.addedNodes.length>0&&!w3(f.addedNodes[0])&&(we.searchPseudoElements&&o(f.target),n(f.target)),f.type==="attributes"&&f.target.parentNode&&we.searchPseudoElements&&o([f.target],!0),f.type==="attributes"&&w3(f.target)&&~uL.indexOf(f.attributeName))if(f.attributeName==="class"&&ZL(f.target)){var d=Jd(s1(f.target)),h=d.prefix,g=d.iconName;f.target.setAttribute(e1,h||c),g&&f.target.setAttribute(t1,g)}else KL(f.target)&&a(f.target)})}}),Ma&&r0.observe(l,{childList:!0,attributes:!0,characterData:!0,subtree:!0})}}function tP(){r0&&r0.disconnect()}function nP(e){var t=e.getAttribute("style"),n=[];return t&&(n=t.split(";").reduce(function(r,a){var i=a.split(":"),o=i[0],s=i.slice(1);return o&&s.length>0&&(r[o]=s.join(":").trim()),r},{})),n}function rP(e){var t=e.getAttribute("data-prefix"),n=e.getAttribute("data-icon"),r=e.innerText!==void 0?e.innerText.trim():"",a=Jd(s1(e));return a.prefix||(a.prefix=Si()),t&&n&&(a.prefix=t,a.iconName=n),a.iconName&&a.prefix||(a.prefix&&r.length>0&&(a.iconName=TL(a.prefix,e.innerText)||h1(a.prefix,a3(e.innerText))),!a.iconName&&we.autoFetchSvg&&e.firstChild&&e.firstChild.nodeType===Node.TEXT_NODE&&(a.iconName=e.firstChild.data)),a}function aP(e){var t=ks(e.attributes).reduce(function(n,r){return n.name!=="class"&&n.name!=="style"&&(n[r.name]=r.value),n},{});return t}function iP(){return{iconName:null,prefix:null,transform:Wr,symbol:!1,mask:{iconName:null,prefix:null,rest:[]},maskId:null,extra:{classes:[],styles:{},attributes:{}}}}function M3(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{styleParser:!0},n=rP(e),r=n.iconName,a=n.prefix,i=n.rest,o=aP(e),s=m1("parseNodeAttributes",{},e),l=t.styleParser?nP(e):[];return ue({iconName:r,prefix:a,transform:Wr,mask:{iconName:null,prefix:null,rest:[]},maskId:null,symbol:!1,extra:{classes:i,styles:l,attributes:o}},s)}var oP=Nr.styles;function _3(e){var t=we.autoReplaceSvg==="nest"?M3(e,{styleParser:!1}):M3(e);return~t.extra.classes.indexOf(ZA)?wi("generateLayersText",e,t):wi("generateSvgReplacementMutation",e,t)}function sP(){return[].concat(_r($A),_r(LA))}function N3(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!Ma)return Promise.resolve();var n=Dt.documentElement.classList,r=function(f){return n.add("".concat(qA,"-").concat(f))},a=function(f){return n.remove("".concat(qA,"-").concat(f))},i=we.autoFetchSvg?sP():wA.concat(Object.keys(oP));i.includes("fa")||i.push("fa");var o=[".".concat(ZA,":not([").concat(to,"])")].concat(i.map(function(c){return".".concat(c,":not([").concat(to,"])")})).join(", ");if(o.length===0)return Promise.resolve();var s=[];try{s=ks(e.querySelectorAll(o))}catch{}if(s.length>0)r("pending"),a("complete");else return Promise.resolve();var l=S1.begin("onTree"),u=s.reduce(function(c,f){try{var d=_3(f);d&&c.push(d)}catch(h){GA||h.name==="MissingIcon"&&console.error(h)}return c},[]);return new Promise(function(c,f){Promise.all(u).then(function(d){A3(d,function(){r("active"),r("complete"),a("pending"),typeof t=="function"&&t(),l(),c()})}).catch(function(d){l(),f(d)})})}function lP(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;_3(e).then(function(n){n&&A3([n],t)})}function uP(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=(t||{}).icon?t:p1(t||{}),a=n.mask;return a&&(a=(a||{}).icon?a:p1(a||{})),e(r,ue(ue({},n),{},{mask:a}))}}var cP=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.transform,a=r===void 0?Wr:r,i=n.symbol,o=i===void 0?!1:i,s=n.mask,l=s===void 0?null:s,u=n.maskId,c=u===void 0?null:u,f=n.classes,d=f===void 0?[]:f,h=n.attributes,g=h===void 0?{}:h,m=n.styles,D=m===void 0?{}:m;if(t){var p=t.prefix,v=t.iconName,y=t.icon;return e0(ue({type:"icon"},t),function(){return ro("beforeDOMElementCreation",{iconDefinition:t,params:n}),g1({icons:{main:y1(y),mask:l?y1(l.icon):{found:!1,width:null,height:null,icon:{}}},prefix:p,iconName:v,transform:ue(ue({},Wr),a),symbol:o,maskId:c,extra:{attributes:g,styles:D,classes:d}})})}},fP={mixout:function(){return{icon:uP(cP)}},hooks:function(){return{mutationObserverCallbacks:function(n){return n.treeCallback=N3,n.nodeCallback=lP,n}}},provides:function(t){t.i2svg=function(n){var r=n.node,a=r===void 0?Dt:r,i=n.callback,o=i===void 0?function(){}:i;return N3(a,o)},t.generateSvgReplacementMutation=function(n,r){var a=r.iconName,i=r.prefix,o=r.transform,s=r.symbol,l=r.mask,u=r.maskId,c=r.extra;return new Promise(function(f,d){Promise.all([b1(a,i),l.iconName?b1(l.iconName,l.prefix):Promise.resolve({found:!1,width:512,height:512,icon:{}})]).then(function(h){var g=Gd(h,2),m=g[0],D=g[1];f([n,g1({icons:{main:m,mask:D},prefix:i,iconName:a,transform:o,symbol:s,maskId:u,extra:c,watchable:!0})])}).catch(d)})},t.generateAbstractIcon=function(n){var r=n.children,a=n.attributes,i=n.main,o=n.transform,s=n.styles,l=Kd(s);l.length>0&&(a.style=l);var u;return l1(o)&&(u=wi("generateAbstractTransformGrouping",{main:i,transform:o,containerWidth:i.width,iconWidth:i.width})),r.push(u||i.icon),{children:r,attributes:a}}}},dP={mixout:function(){return{layer:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=r.classes,i=a===void 0?[]:a;return e0({type:"layer"},function(){ro("beforeDOMElementCreation",{assembler:n,params:r});var o=[];return n(function(s){Array.isArray(s)?s.map(function(l){o=o.concat(l.abstract)}):o=o.concat(s.abstract)}),[{tag:"span",attributes:{class:["".concat(we.cssPrefix,"-layers")].concat(_r(i)).join(" ")},children:o}]})}}}},hP={mixout:function(){return{counter:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};r.title;var a=r.classes,i=a===void 0?[]:a,o=r.attributes,s=o===void 0?{}:o,l=r.styles,u=l===void 0?{}:l;return e0({type:"counter",content:n},function(){return ro("beforeDOMElementCreation",{content:n,params:r}),YL({content:n.toString(),extra:{attributes:s,styles:u,classes:["".concat(we.cssPrefix,"-layers-counter")].concat(_r(i))}})})}}}},mP={mixout:function(){return{text:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=r.transform,i=a===void 0?Wr:a,o=r.classes,s=o===void 0?[]:o,l=r.attributes,u=l===void 0?{}:l,c=r.styles,f=c===void 0?{}:c;return e0({type:"text",content:n},function(){return ro("beforeDOMElementCreation",{content:n,params:r}),b3({content:n,transform:ue(ue({},Wr),i),extra:{attributes:u,styles:f,classes:["".concat(we.cssPrefix,"-layers-text")].concat(_r(s))}})})}}},provides:function(t){t.generateLayersText=function(n,r){var a=r.transform,i=r.extra,o=null,s=null;if(DA){var l=parseInt(getComputedStyle(n).fontSize,10),u=n.getBoundingClientRect();o=u.width/l,s=u.height/l}return Promise.resolve([n,b3({content:n.innerHTML,width:o,height:s,transform:a,extra:i,watchable:!0})])}}},F3=new RegExp('"',"ug"),B3=[1105920,1112319],O3=ue(ue(ue(ue({},{FontAwesome:{normal:"fas",400:"fas"}}),nU),tL),fU),E1=Object.keys(O3).reduce(function(e,t){return e[t.toLowerCase()]=O3[t],e},{}),pP=Object.keys(E1).reduce(function(e,t){var n=E1[t];return e[t]=n[900]||_r(Object.entries(n))[0][1],e},{});function gP(e){var t=e.replace(F3,"");return a3(_r(t)[0]||"")}function vP(e){var t=e.getPropertyValue("font-feature-settings").includes("ss01"),n=e.getPropertyValue("content"),r=n.replace(F3,""),a=r.codePointAt(0),i=a>=B3[0]&&a<=B3[1],o=r.length===2?r[0]===r[1]:!1;return i||o||t}function yP(e,t){var n=e.replace(/^['"]|['"]$/g,"").toLowerCase(),r=parseInt(t),a=isNaN(r)?"normal":r;return(E1[n]||{})[a]||pP[n]}function R3(e,t){var n="".concat(nL).concat(t.replace(":","-"));return new Promise(function(r,a){if(e.getAttribute(n)!==null)return r();var i=ks(e.children),o=i.filter(function(b){return b.getAttribute(Jg)===t})[0],s=Di.getComputedStyle(e,t),l=s.getPropertyValue("font-family"),u=l.match(sL),c=s.getPropertyValue("font-weight"),f=s.getPropertyValue("content");if(o&&!u)return e.removeChild(o),r();if(u&&f!=="none"&&f!==""){var d=s.getPropertyValue("content"),h=yP(l,c),g=gP(d),m=u[0].startsWith("FontAwesome"),D=vP(s),p=h1(h,g),v=p;if(m){var y=ML(g);y.iconName&&y.prefix&&(p=y.iconName,h=y.prefix)}if(p&&!D&&(!o||o.getAttribute(e1)!==h||o.getAttribute(t1)!==v)){e.setAttribute(n,v),o&&e.removeChild(o);var w=iP(),E=w.extra;E.attributes[Jg]=t,b1(p,h).then(function(b){var S=g1(ue(ue({},w),{},{icons:{main:b,mask:m3()},prefix:h,iconName:v,extra:E,watchable:!0})),A=Dt.createElementNS("http://www.w3.org/2000/svg","svg");t==="::before"?e.insertBefore(A,e.firstChild):e.appendChild(A),A.outerHTML=S.map(function(C){return wu(C)}).join(`
812
- `),e.removeAttribute(n),r()}).catch(a)}else r()}else r()})}function bP(e){return Promise.all([R3(e,"::before"),R3(e,"::after")])}function DP(e){return e.parentNode!==document.head&&!~aL.indexOf(e.tagName.toUpperCase())&&!e.getAttribute(Jg)&&(!e.parentNode||e.parentNode.tagName!=="svg")}var SP=function(t){return!!t&&YA.some(function(n){return t.includes(n)})},wP=function(t){if(!t)return[];var n=new Set,r=t.split(/,(?![^()]*\))/).map(function(l){return l.trim()});r=r.flatMap(function(l){return l.includes("(")?l:l.split(",").map(function(u){return u.trim()})});var a=Yd(r),i;try{for(a.s();!(i=a.n()).done;){var o=i.value;if(SP(o)){var s=YA.reduce(function(l,u){return l.replace(u,"")},o);s!==""&&s!=="*"&&n.add(s)}}}catch(l){a.e(l)}finally{a.f()}return n};function z3(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(Ma){var n;if(t)n=e;else if(we.searchPseudoElementsFullScan)n=e.querySelectorAll("*");else{var r=new Set,a=Yd(document.styleSheets),i;try{for(a.s();!(i=a.n()).done;){var o=i.value;try{var s=Yd(o.cssRules),l;try{for(s.s();!(l=s.n()).done;){var u=l.value,c=wP(u.selectorText),f=Yd(c),d;try{for(f.s();!(d=f.n()).done;){var h=d.value;r.add(h)}}catch(m){f.e(m)}finally{f.f()}}}catch(m){s.e(m)}finally{s.f()}}catch(m){we.searchPseudoElementsWarnings&&console.warn("Font Awesome: cannot parse stylesheet: ".concat(o.href," (").concat(m.message,`)
813
- If it declares any Font Awesome CSS pseudo-elements, they will not be rendered as SVG icons. Add crossorigin="anonymous" to the <link>, enable searchPseudoElementsFullScan for slower but more thorough DOM parsing, or suppress this warning by setting searchPseudoElementsWarnings to false.`))}}}catch(m){a.e(m)}finally{a.f()}if(!r.size)return;var g=Array.from(r).join(", ");try{n=e.querySelectorAll(g)}catch{}}return new Promise(function(m,D){var p=ks(n).filter(DP).map(bP),v=S1.begin("searchPseudoElements");C3(),Promise.all(p).then(function(){v(),x1(),m()}).catch(function(){v(),x1(),D()})})}}var xP={hooks:function(){return{mutationObserverCallbacks:function(n){return n.pseudoElementsCallback=z3,n}}},provides:function(t){t.pseudoElements2svg=function(n){var r=n.node,a=r===void 0?Dt:r;we.searchPseudoElements&&z3(a)}}},k3=!1,EP={mixout:function(){return{dom:{unwatch:function(){C3(),k3=!0}}}},hooks:function(){return{bootstrap:function(){T3(m1("mutationObserverCallbacks",{}))},noAuto:function(){tP()},watch:function(n){var r=n.observeMutationsRoot;k3?x1():T3(m1("mutationObserverCallbacks",{observeMutationsRoot:r}))}}}},$3=function(t){var n={size:16,x:0,y:0,flipX:!1,flipY:!1,rotate:0};return t.toLowerCase().split(" ").reduce(function(r,a){var i=a.toLowerCase().split("-"),o=i[0],s=i.slice(1).join("-");if(o&&s==="h")return r.flipX=!0,r;if(o&&s==="v")return r.flipY=!0,r;if(s=parseFloat(s),isNaN(s))return r;switch(o){case"grow":r.size=r.size+s;break;case"shrink":r.size=r.size-s;break;case"left":r.x=r.x-s;break;case"right":r.x=r.x+s;break;case"up":r.y=r.y-s;break;case"down":r.y=r.y+s;break;case"rotate":r.rotate=r.rotate+s;break}return r},n)},AP={mixout:function(){return{parse:{transform:function(n){return $3(n)}}}},hooks:function(){return{parseNodeAttributes:function(n,r){var a=r.getAttribute("data-fa-transform");return a&&(n.transform=$3(a)),n}}},provides:function(t){t.generateAbstractTransformGrouping=function(n){var r=n.main,a=n.transform,i=n.containerWidth,o=n.iconWidth,s={transform:"translate(".concat(i/2," 256)")},l="translate(".concat(a.x*32,", ").concat(a.y*32,") "),u="scale(".concat(a.size/16*(a.flipX?-1:1),", ").concat(a.size/16*(a.flipY?-1:1),") "),c="rotate(".concat(a.rotate," 0 0)"),f={transform:"".concat(l," ").concat(u," ").concat(c)},d={transform:"translate(".concat(o/2*-1," -256)")},h={outer:s,inner:f,path:d};return{tag:"g",attributes:ue({},h.outer),children:[{tag:"g",attributes:ue({},h.inner),children:[{tag:r.icon.tag,children:r.icon.children,attributes:ue(ue({},r.icon.attributes),h.path)}]}]}}}},A1={x:0,y:0,width:"100%",height:"100%"};function I3(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return e.attributes&&(e.attributes.fill||t)&&(e.attributes.fill="black"),e}function CP(e){return e.tag==="g"?e.children:[e]}var TP={hooks:function(){return{parseNodeAttributes:function(n,r){var a=r.getAttribute("data-fa-mask"),i=a?Jd(a.split(" ").map(function(o){return o.trim()})):m3();return i.prefix||(i.prefix=Si()),n.mask=i,n.maskId=r.getAttribute("data-fa-mask-id"),n}}},provides:function(t){t.generateAbstractMask=function(n){var r=n.children,a=n.attributes,i=n.main,o=n.mask,s=n.maskId,l=n.transform,u=i.width,c=i.icon,f=o.width,d=o.icon,h=yL({transform:l,containerWidth:f,iconWidth:u}),g={tag:"rect",attributes:ue(ue({},A1),{},{fill:"white"})},m=c.children?{children:c.children.map(I3)}:{},D={tag:"g",attributes:ue({},h.inner),children:[I3(ue({tag:c.tag,attributes:ue(ue({},c.attributes),h.path)},m))]},p={tag:"g",attributes:ue({},h.outer),children:[D]},v="mask-".concat(s||QA()),y="clip-".concat(s||QA()),w={tag:"mask",attributes:ue(ue({},A1),{},{id:v,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse"}),children:[g,p]},E={tag:"defs",children:[{tag:"clipPath",attributes:{id:y},children:CP(d)},w]};return r.push(E,{tag:"rect",attributes:ue({fill:"currentColor","clip-path":"url(#".concat(y,")"),mask:"url(#".concat(v,")")},A1)}),{children:r,attributes:a}}}},MP={provides:function(t){var n=!1;Di.matchMedia&&(n=Di.matchMedia("(prefers-reduced-motion: reduce)").matches),t.missingIconAbstract=function(){var r=[],a={fill:"currentColor"},i={attributeType:"XML",repeatCount:"indefinite",dur:"2s"};r.push({tag:"path",attributes:ue(ue({},a),{},{d:"M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z"})});var o=ue(ue({},i),{},{attributeName:"opacity"}),s={tag:"circle",attributes:ue(ue({},a),{},{cx:"256",cy:"364",r:"28"}),children:[]};return n||s.children.push({tag:"animate",attributes:ue(ue({},i),{},{attributeName:"r",values:"28;14;28;28;14;28;"})},{tag:"animate",attributes:ue(ue({},o),{},{values:"1;0;1;1;0;1;"})}),r.push(s),r.push({tag:"path",attributes:ue(ue({},a),{},{opacity:"1",d:"M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z"}),children:n?[]:[{tag:"animate",attributes:ue(ue({},o),{},{values:"1;0;0;0;0;1;"})}]}),n||r.push({tag:"path",attributes:ue(ue({},a),{},{opacity:"0",d:"M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z"}),children:[{tag:"animate",attributes:ue(ue({},o),{},{values:"0;0;1;1;0;0;"})}]}),{tag:"g",attributes:{class:"missing"},children:r}}}},_P={hooks:function(){return{parseNodeAttributes:function(n,r){var a=r.getAttribute("data-fa-symbol"),i=a===null?!1:a===""?!0:a;return n.symbol=i,n}}}},NP=[SL,fP,dP,hP,mP,xP,EP,AP,TP,MP,_P];$L(NP,{mixoutsTo:er}),er.noAuto,er.config,er.library,er.dom;var C1=er.parse;er.findIconDefinition,er.toHtml;var FP=er.icon;er.layer,er.text,er.counter;function T1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function BP(e){if(Array.isArray(e))return e}function OP(e){if(Array.isArray(e))return T1(e)}function xi(e,t,n){return(t=PP(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function RP(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function zP(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(c){u=!0,a=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return s}}function kP(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
814
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $P(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
815
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function U3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Jr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?U3(Object(n),!0).forEach(function(r){xi(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):U3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function IP(e,t){if(e==null)return{};var n,r,a=UP(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function UP(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function L3(e,t){return BP(e)||zP(e,t)||P3(e,t)||kP()}function M1(e){return OP(e)||RP(e)||P3(e)||$P()}function LP(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function PP(e){var t=LP(e,"string");return typeof t=="symbol"?t:t+""}function a0(e){"@babel/helpers - typeof";return a0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a0(e)}function P3(e,t){if(e){if(typeof e=="string")return T1(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?T1(e,t):void 0}}var jP="7.0.0",_1;try{var HP=require("@fortawesome/fontawesome-svg-core/package.json");_1=HP.version}catch{_1=typeof process<"u"&&process.env.FA_VERSION||"7.0.0"}function qP(e){var t=e.beat,n=e.fade,r=e.beatFade,a=e.bounce,i=e.shake,o=e.flash,s=e.spin,l=e.spinPulse,u=e.spinReverse,c=e.pulse,f=e.fixedWidth,d=e.inverse,h=e.border,g=e.listItem,m=e.flip,D=e.size,p=e.rotation,v=e.pull,y=e.swapOpacity,w=e.rotateBy,E=e.widthAuto,b=YP(_1,jP),S=xi(xi(xi(xi(xi(xi({"fa-beat":t,"fa-fade":n,"fa-beat-fade":r,"fa-bounce":a,"fa-shake":i,"fa-flash":o,"fa-spin":s,"fa-spin-reverse":u,"fa-spin-pulse":l,"fa-pulse":c,"fa-fw":f,"fa-inverse":d,"fa-border":h,"fa-li":g,"fa-flip":m===!0,"fa-flip-horizontal":m==="horizontal"||m==="both","fa-flip-vertical":m==="vertical"||m==="both"},"fa-".concat(D),typeof D<"u"&&D!==null),"fa-rotate-".concat(p),typeof p<"u"&&p!==null&&p!==0),"fa-pull-".concat(v),typeof v<"u"&&v!==null),"fa-swap-opacity",y),"fa-rotate-by",b&&w),"fa-width-auto",b&&E);return Object.keys(S).map(function(A){return S[A]?A:null}).filter(function(A){return A})}function YP(e,t){for(var n=e.split("-"),r=L3(n,2),a=r[0],i=r[1],o=t.split("-"),s=L3(o,2),l=s[0],u=s[1],c=a.split("."),f=l.split("."),d=0;d<Math.max(c.length,f.length);d++){var h=c[d]||"0",g=f[d]||"0",m=parseInt(h,10),D=parseInt(g,10);if(m!==D)return m>D}for(var p=0;p<Math.max(c.length,f.length);p++){var v=c[p]||"0",y=f[p]||"0";if(v!==y&&v.length!==y.length)return v.length<y.length}return!(i&&!u)}function GP(e){return e=e-0,e===e}function j3(e){return GP(e)?e:(e=e.replace(/[\-_\s]+(.)?/g,function(t,n){return n?n.toUpperCase():""}),e.substr(0,1).toLowerCase()+e.substr(1))}var VP=["style"];function XP(e){return e.charAt(0).toUpperCase()+e.slice(1)}function ZP(e){return e.split(";").map(function(t){return t.trim()}).filter(function(t){return t}).reduce(function(t,n){var r=n.indexOf(":"),a=j3(n.slice(0,r)),i=n.slice(r+1).trim();return a.startsWith("webkit")?t[XP(a)]=i:t[a]=i,t},{})}function H3(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(typeof t=="string")return t;var r=(t.children||[]).map(function(l){return H3(e,l)}),a=Object.keys(t.attributes||{}).reduce(function(l,u){var c=t.attributes[u];switch(u){case"class":l.attrs.className=c,delete t.attributes.class;break;case"style":l.attrs.style=ZP(c);break;default:u.indexOf("aria-")===0||u.indexOf("data-")===0?l.attrs[u.toLowerCase()]=c:l.attrs[j3(u)]=c}return l},{attrs:{}}),i=n.style,o=i===void 0?{}:i,s=IP(n,VP);return a.attrs.style=Jr(Jr({},a.attrs.style),o),e.apply(void 0,[t.tag,Jr(Jr({},a.attrs),s)].concat(M1(r)))}var q3=!1;try{q3=!0}catch{}function KP(){if(!q3&&console&&typeof console.error=="function"){var e;(e=console).error.apply(e,arguments)}}function Y3(e){if(e&&a0(e)==="object"&&e.prefix&&e.iconName&&e.icon)return e;if(C1.icon)return C1.icon(e);if(e===null)return null;if(e&&a0(e)==="object"&&e.prefix&&e.iconName)return e;if(Array.isArray(e)&&e.length===2)return{prefix:e[0],iconName:e[1]};if(typeof e=="string")return{prefix:"fas",iconName:e}}function N1(e,t){return Array.isArray(t)&&t.length>0||!Array.isArray(t)&&t?xi({},e,t):{}}var G3={border:!1,className:"",mask:null,maskId:null,fixedWidth:!1,inverse:!1,flip:!1,icon:null,listItem:!1,pull:null,pulse:!1,rotation:null,rotateBy:!1,size:null,spin:!1,spinPulse:!1,spinReverse:!1,beat:!1,fade:!1,beatFade:!1,bounce:!1,shake:!1,symbol:!1,title:"",titleId:null,transform:null,swapOpacity:!1,widthAuto:!1},i0=Rt.forwardRef(function(e,t){var n=Jr(Jr({},G3),e),r=n.icon,a=n.mask,i=n.symbol,o=n.className,s=n.title,l=n.titleId,u=n.maskId,c=Y3(r),f=N1("classes",[].concat(M1(qP(n)),M1((o||"").split(" ")))),d=N1("transform",typeof n.transform=="string"?C1.transform(n.transform):n.transform),h=N1("mask",Y3(a)),g=FP(c,Jr(Jr(Jr(Jr({},f),d),h),{},{symbol:i,title:s,titleId:l,maskId:u}));if(!g)return KP("Could not find icon",c),null;var m=g.abstract,D={ref:t};return Object.keys(n).forEach(function(p){G3.hasOwnProperty(p)||(D[p]=n[p])}),QP(m[0],D)});i0.displayName="FontAwesomeIcon",i0.propTypes={beat:ke.bool,border:ke.bool,beatFade:ke.bool,bounce:ke.bool,className:ke.string,fade:ke.bool,flash:ke.bool,mask:ke.oneOfType([ke.object,ke.array,ke.string]),maskId:ke.string,fixedWidth:ke.bool,inverse:ke.bool,flip:ke.oneOf([!0,!1,"horizontal","vertical","both"]),icon:ke.oneOfType([ke.object,ke.array,ke.string]),listItem:ke.bool,pull:ke.oneOf(["right","left"]),pulse:ke.bool,rotation:ke.oneOf([0,90,180,270]),rotateBy:ke.bool,shake:ke.bool,size:ke.oneOf(["2xs","xs","sm","lg","xl","2xl","1x","2x","3x","4x","5x","6x","7x","8x","9x","10x"]),spin:ke.bool,spinPulse:ke.bool,spinReverse:ke.bool,symbol:ke.oneOfType([ke.bool,ke.string]),title:ke.string,titleId:ke.string,transform:ke.oneOfType([ke.string,ke.object]),swapOpacity:ke.bool,widthAuto:ke.bool};var QP=H3.bind(null,Rt.createElement);const WP=e=>e?F.jsx(i0,{icon:EI}):F.jsx(i0,{icon:AI}),JP=(e,t)=>n=>ej(e,t,n),ej=(e,t,n)=>{const r=Array.from(e.values());return n.forEach(a=>{const i=a.columnName,o=t.get(i);o&&r.sort((s,l)=>{const u=(s.data[i]||{}).sortValue,c=(l.data[i]||{}).sortValue;return a.sortAscending?o.sort(u,c):o.sort(c,u)})}),r.map(a=>a.rowId)},tj=e=>{const t=new Map;return e.forEach(n=>t.set(n.columnName,n)),t},nj=(e,t)=>e.map(n=>({name:n.columnName,tooltip:n.tooltip,label:n.label,isCalculating:n.calculating||!1,isPrimarySort:n.columnName===t?.columnName,isAscendingSort:t?.sortAscending||!1})),rj=e=>{const{columns:t,selectionDispatch:n,primarySortRule:r,allUnitSelectionStatus:a,rowSorterCallback:i,selectionDisabled:o,hideSelectionColumn:s}=e,l=_.useMemo(()=>tj(t),[t]),u=_.useMemo(()=>nj(t,r),[t,r]),c=_.useCallback(()=>n({type:pD}),[n]),f=_.useCallback(g=>i(l)(g),[i,l]),d=_.useCallback(g=>{o||n({type:gD,newSortField:g,sortCallback:f,ascending:l.get(g)?.onlyAllowDescendingSort?!1:void 0})},[n,f,o,l]),h=_.useMemo(()=>u.map(g=>{const m=(g.tooltip||g.label||"")+" (click to sort)";return F.jsx(yi,{onClick:()=>d(g.name),title:m,style:{cursor:"pointer"},children:F.jsxs("div",{style:{display:"flex",justifyContent:"flex-start",alignItems:"center",flexDirection:"row"},children:[F.jsx("span",{className:"SortCaretSpan",children:g.isPrimarySort&&WP(g.isAscendingSort)}),F.jsxs("span",{children:[F.jsx("span",{children:g.label},"label"),F.jsx("span",{children:g.isCalculating&&F.jsx(F$,{})},"progress")]})]})},g.name)}),[u,d]);return F.jsx(oA,{children:F.jsxs(jd,{children:[!s&&F.jsx(yi,{width:"30px",children:F.jsx(cA,{rowId:"all",selected:a==="all"||a==="partial",onClick:c,isIndeterminate:a==="partial",isDisabled:o})},"_checkbox"),h]})})},aj=e=>{const{selectedUnitIds:t,currentUnitId:n,selectionDispatch:r,rows:a,columns:i,orderedUnitIds:o,visibleUnitIds:s,primarySortRule:l,height:u,selectionDisabled:c,hideSelectionColumn:f}=e,d=_.useMemo(()=>s&&s.length>0?s:o,[s,o]),h=_.useMemo(()=>lD({selectedUnitIds:t,orderedUnitIds:o,visibleUnitIds:d}),[t,o,d]),g=_.useCallback(y=>JP(a,y),[a]),m=_.useMemo(()=>F.jsx(rj,{columns:i,primarySortRule:l,allUnitSelectionStatus:h,rowSorterCallback:g,selectionDispatch:r,selectionDisabled:c,hideSelectionColumn:f}),[i,l,h,g,r,c,f]),D=_.useMemo(()=>{const y={};return a.forEach(w=>{const E=i.map(b=>F.jsx(yi,{children:F.jsx("div",{title:b.tooltip,children:b.dataElement(w.data[b.columnName].value)})},b.columnName));y[w.rowId]=E}),y},[a,i]),p=_.useMemo(()=>{if(!a)return[];const y=d.map(w=>a.get(w)).filter(w=>w!==void 0);if(y.some(w=>w===void 0))throw Error("Rows missing from row dict (2)");return y},[d,a]),v=_.useMemo(()=>p.map(y=>F.jsx(xI,{rowId:y.rowId,selected:t.has(y.rowId),current:n===y.rowId,onClick:f?void 0:y.checkboxFn||B6,isDisabled:c||!1,contentRepository:D},y.rowId)),[t,n,p,D,c,f]);return F.jsx(W$,{style:u!==void 0?{maxHeight:u}:{},children:F.jsxs(nA,{stickyHeader:!0,className:"SortableTableWidget",children:[m,F.jsx(aA,{children:v})]})})},ij=Rt.createContext({}),oj=()=>_.useContext(ij),V3=({data:e,width:t,height:n})=>{const[r,a]=_.useState({...Hd,onlyShowSelected:!1}),{selectedUnitIds:i,currentUnitId:o,orderedUnitIds:s,visibleUnitIds:l,primarySortRule:u,checkboxClickHandlerGenerator:c,unitIdSelectionDispatch:f}=ri(),{sortingCuration:d}=oj(),h=_.useMemo(()=>r.onlyShowSelected?l?l.filter(E=>i.has(E)):[...i]:l,[l,i,r.onlyShowSelected]),g=_.useMemo(()=>{const E=[];return E.push({columnName:"_unitId",label:"Unit",tooltip:"Unit ID",sort:(b,S)=>$t(b)-$t(S),dataElement:b=>F.jsx(SI,{unitId:b.unitId,mergeGroup:b.mergeGroup}),calculating:!1}),d&&E.push({columnName:"_labels",label:"Labels",tooltip:"Curation labels",sort:(b,S)=>b<S?-1:b>S?1:0,dataElement:b=>F.jsx("span",{children:b.join(", ")}),calculating:!1}),e.similarityScores&&E.push({columnName:"_similarity",label:"Similarity",tooltip:"Similarity with current unit",sort:(b,S)=>{if(b.unitId===o)return 1;if(S.unitId===o)return-1;const A=b.score,C=S.score;return A===void 0&&C!==void 0?-1:A!==void 0&&C===void 0?1:A===void 0&&C===void 0?0:A!==void 0&&C!==void 0?A<C?-1:A>C?1:0:0},dataElement:b=>F.jsx("span",{children:b}),calculating:!1,onlyAllowDescendingSort:!0}),e.columns.filter(b=>b.key!=="unitId").forEach(b=>{E.push({columnName:b.key,label:b.label,tooltip:b.label,sort:b.dtype==="str"?(S,A)=>S<A?-1:S>A?1:0:b.dtype==="int"?(S,A)=>S-A:b.dtype=="bool"?(S,A)=>(S?1:0)-(A?1:0):b.dtype==="float"?(S,A)=>S-A:(S,A)=>S-A,dataElement:S=>F.jsx("span",{children:S}),calculating:!1})}),E},[e.columns,o,d,e.similarityScores]),m=_.useMemo(()=>{for(let b=0;b<0;b++)s.push("never-added");const E={};if(e.similarityScores&&o!==void 0)for(const b of e.similarityScores)b.unitId1===o?E[b.unitId2]=b.similarity:b.unitId2===o&&(E[b.unitId1]=b.similarity);return e.rows.map(b=>{const S=(d?.labelsByUnit||{})[`${b.unitId}`]||[],A={value:{unitId:b.unitId,mergeGroup:wI(b.unitId,d)},sortValue:b.unitId},C=E[b.unitId],T={_unitId:A,_labels:{value:S,sortValue:S.join(", ")},_similarity:{value:C!==void 0?C.toFixed(3):void 0,sortValue:{unitId:b.unitId,score:C}}};for(const M of e.columns){const x=`${b.values[M.key]!==void 0?b.values[M.key]:""}`;T[M.key]={value:x,sortValue:b.values[M.key]}}return{rowId:b.unitId,data:T,checkboxFn:c(b.unitId)}})},[e.rows,e.columns,o,e.similarityScores,d,c,s]);_.useEffect(()=>{f({type:Wo,newUnitOrder:Pr(m.map(E=>E.rowId))})},[m,f]);const D=_.useMemo(()=>{const E=new Map;return m.forEach(b=>E.set(b.rowId,b)),E},[m]),p=30,v=_.useMemo(()=>({width:t-20,height:n-p,top:0,position:"relative",overflowY:"auto"}),[t,n]),y=_.useCallback(E=>{if(E.ctrlKey)return E.key==="ArrowDown"?f({type:fD}):E.key==="ArrowUp"?f({type:dD}):E.key==="Home"?f({type:hD}):E.key==="End"&&f({type:mD}),!1},[f]),w=_.useCallback(()=>{f({type:"REDISTRIBUTE_UNIT_COLORS"})},[f]);return F.jsxs("div",{children:[F.jsx("div",{style:v,onKeyDown:y,children:F.jsx(aj,{columns:g,rows:D,orderedUnitIds:s,visibleUnitIds:h,selectedUnitIds:i,currentUnitId:o,selectionDispatch:f,primarySortRule:u})}),F.jsx("div",{style:{position:"absolute",top:n-p,height:p,overflow:"hidden"},children:F.jsx(qd,{options:r,setOptions:a,onRedistributeUnitColors:w})})]})},sj=({zarrGroup:e,contexts:t,width:n,height:r})=>{const[a,i]=_.useState(null),[o,s]=_.useState(null),[l,u]=_.useState(!0);return _.useEffect(()=>{let c=!1;return(async()=>{try{u(!0),s(null);const d=e.attrs.columns||[],h=await e.getDatasetData("rows_data",{});if(!h||h.length===0)throw new Error("Empty rows data");const g=new Uint8Array(h),m=new TextDecoder("utf-8").decode(g),D=JSON.parse(m);let p;try{const v=await e.getDatasetData("similarity_scores_data",{});if(v&&v.length>0){const y=new Uint8Array(v),w=new TextDecoder("utf-8").decode(y);p=JSON.parse(w)}}catch{console.debug("No similarity scores found")}if(c)return;i({type:"UnitsTable",columns:d,rows:D,similarityScores:p})}catch(d){console.error("Error loading units table data:",d),s(`Failed to load units table data: ${d instanceof Error?d.message:String(d)}`)}finally{u(!1)}})(),()=>{c=!0}},[e]),o?F.jsxs("div",{style:{width:n,height:r,display:"flex",alignItems:"center",justifyContent:"center",color:"#666",backgroundColor:"#f5f5f5"},children:["Error: ",o]}):l?F.jsx("div",{style:{width:n,height:r,display:"flex",alignItems:"center",justifyContent:"center",color:"#666",backgroundColor:"#f5f5f5"},children:"Loading units table data..."}):a?F.jsx(bi,{context:t.unitSelection,children:F.jsx(V3,{data:a,width:n,height:r})}):F.jsx("div",{style:{width:n,height:r,display:"flex",alignItems:"center",justifyContent:"center",color:"#666",backgroundColor:"#f5f5f5"},children:"No units table data available"})},lj=e=>{const{ampScaleFactor:t,setAmpScaleFactor:n}=e,r=()=>{n(t*1.2)},a=()=>{n(t/1.2)},i=()=>{n(1)};return[{type:"button",callback:r,title:"Scale amplitude up [shift + mouse-wheel]",icon:F.jsx(IB,{}),keyCode:38},{type:"button",callback:i,title:"Reset scale amplitude",icon:F.jsx(Fx,{})},{type:"button",callback:a,title:"Scale amplitude down [shift + mouse-wheel]",icon:F.jsx(zB,{}),keyCode:40}]},X3={forward:[[1,0,0],[0,1,0]],inverse:[[1,0,0],[0,1,0]]},ao=(e,t)=>({x:t.x*e.forward[0][0]+t.y*e.forward[0][1]+e.forward[0][2],y:t.x*e.forward[1][0]+t.y*e.forward[1][1]+e.forward[1][2]}),F1=(e,t)=>({x:t.x*e.inverse[0][0]+t.y*e.inverse[0][1]+e.inverse[0][2],y:t.x*e.inverse[1][0]+t.y*e.inverse[1][1]+e.inverse[1][2]}),uj=(e,t)=>({forward:Z3(e.forward,t.forward),inverse:Z3(t.inverse,e.inverse)}),cj=e=>({forward:[...e.map(t=>[...t])],inverse:dj(e)}),fj=e=>({forward:e.inverse,inverse:e.forward}),B1=e=>e.forward[0][0]*e.forward[1][1]-e.forward[0][1]*e.forward[1][0],Z3=(e,t)=>[[e[0][0]*t[0][0]+e[0][1]*t[1][0],e[0][0]*t[0][1]+e[0][1]*t[1][1],e[0][0]*t[0][2]+e[0][1]*t[1][2]+e[0][2]],[e[1][0]*t[0][0]+e[1][1]*t[1][0],e[1][0]*t[0][1]+e[1][1]*t[1][1],e[1][0]*t[0][2]+e[1][1]*t[1][2]+e[1][2]]],dj=e=>{const t=[[e[0][0],e[0][1]],[e[1][0],e[1][1]]],n=[e[0][2],e[1][2]],r=t[0][0]*t[1][1]-t[0][1]*t[1][0],a=[[t[1][1]/r,-t[0][1]/r],[-t[1][0]/r,t[0][0]/r]],i=[a[0][0]*n[0]+a[0][1]*n[1],a[1][0]*n[0]+a[1][1]*n[1]];return[[a[0][0],a[0][1],-i[0]],[a[1][0],a[1][1],-i[1]]]},O1=(e,t,n={})=>{const r=n.shift!==void 0?n.shift:!0,a=n.shift!==void 0?n.alt:!1,[i,o]=_.useState(X3),s=_.useCallback(l=>{if(r&&!l.shiftKey||!r&&l.shiftKey||a&&!l.altKey||!a&&l.altKey)return;const u=l.currentTarget.getBoundingClientRect(),c={x:l.clientX-u.x,y:l.clientY-u.y},f=l.deltaY,d=1.3;let h=cj([[d,0,(1-d)*c.x],[0,d,(1-d)*c.y]]);f>0&&(h=fj(h));let g=uj(h,i);const m=ao(g,{x:0,y:0}),D=ao(g,{x:e,y:t});return 0<=m.x&&m.x<e&&0<=m.y&&m.y<t&&0<=D.x&&D.x<e&&0<=D.y&&D.y<t&&(g=X3),o(g),!1},[i,t,e,r,a]);return{affineTransform:i,handleWheel:s}},Au={border:"rgb(30, 30, 30)",base:"rgb(0, 0, 255)",selected:"rgb(50, 200, 50)",hover:"rgb(128, 128, 255)",selectedHover:"rgb(200, 200, 196)",dragged:"rgb(0, 0, 196)",draggedSelected:"rgb(180, 180, 150)",dragRect:"rgba(196, 196, 196, 0.5)",textLight:"rgb(228, 228, 228)",textDark:"rgb(32, 32, 32)"},hj=2*Math.PI,mj=(e,t)=>{const{layoutMode:n,affineTransform:r}=t;if(e.save(),r){const a=r.forward;e.transform(a[0][0],a[1][0],a[0][1],a[1][1],a[0][2],a[1][2])}n==="geom"?gj(e,t):pj(e,t),e.restore()},pj=(e,t)=>{const{pixelElectrodes:n,pixelRadius:r,showLabels:a,xMargin:i}=t,o=r>5&&a,s=t.colors??Au,l=o?2*r:0;e.clearRect(0,0,e.canvas.width,e.canvas.height);const u=i+l,c=e.canvas.width-i;if(e.beginPath(),n.forEach(f=>{e.moveTo(u,f.pixelY),e.lineTo(c,f.pixelY)}),e.strokeStyle=s.border,e.stroke(),o){const f=u-.5*r;e.font=`${r-3}px Arial`,e.fillStyle=s.textDark,e.textAlign="right",e.textBaseline="middle",n.forEach(d=>{e.fillText(`${d.e.label}`,f,d.pixelY)})}},gj=(e,t)=>{const{pixelElectrodes:n,selectedElectrodeIds:r,hoveredElectrodeId:a,draggedElectrodeIds:i,pixelRadius:o,showLabels:s,offsetLabels:l}=t,u=o>5&&s,c=t.colors??Au,f=n.map(d=>{const h=r.includes(d.e.id),g=(a??-1)===d.e.id,m=i.includes(d.e.id),D=h?m?c.draggedSelected:g?c.selectedHover:c.selected:m?c.dragged:g?c.hover:c.base;return{...d,color:D,textColor:h||g&&!m?c.textDark:c.textLight}});if(e.clearRect(0,0,e.canvas.width,e.canvas.height),f.forEach(d=>{e.fillStyle=d.color,e.beginPath(),e.ellipse(d.pixelX,d.pixelY,o,o,0,0,hj),e.fill()}),u){e.font=`${o}px Arial`,e.textAlign=l?"right":"center",e.textBaseline="middle";const d=l?1.4*o:0;f.forEach(h=>{e.fillStyle=l?c.textDark:h.textColor,e.fillText(`${h.e.label}`,h.pixelX-d,h.pixelY)})}},o0=e=>e.reduce((t,n)=>t<=n?t:n,1/0),s0=e=>e.reduce((t,n)=>t>=n?t:n,-1/0),Us=10,Cu=10,vj=(e,t)=>{const n=t||{};return t&&(Object.keys(n).length!==e.length||e.some(a=>!n[`${a}`]))?(console.warn("Attempt to compute electrode locations with mismatched lists. Skipping..."),[]):e.map(a=>{const i=n[`${a}`]||[a,0];return{id:a,label:`${a}`,x:i[0],y:i[1]}})},K3=new Map,Q3=e=>{const t=JSON.stringify(e),n=K3.get(t);if(n!==void 0)return n;let r=Number.MAX_VALUE;e.forEach(i=>{e.forEach(o=>{const s=vx([i.x-o.x,i.y-o.y]);s!==0&&(r=Math.min(r,s))})});const a=.45*r;return K3.set(t,a),a},W3=(e,t)=>({xmin:o0(e.map(n=>n.x))-t,xmax:s0(e.map(n=>n.x))+t,ymin:o0(e.map(n=>n.y))-t,ymax:s0(e.map(n=>n.y))+t}),yj=e=>{const t=Q3(e),n=W3(e,t),r=Hf(n),a=yx(n),i={x:r/2+n.xmin,y:a/2+n.ymin};return{boxAspect:r/a,boxCenter:i}},bj=e=>{const t={xmin:o0(e.map(n=>n.x)),xmax:s0(e.map(n=>n.x)),ymin:o0(e.map(n=>n.y)),ymax:s0(e.map(n=>n.y))};return t.xmin===t.xmax&&t.ymin===t.ymax?e.map((n,r)=>({...n,x:r,y:0})):e},Dj=(e,t)=>bB(n=>{const r=Us+n[0]*(e-2*Us),a=Cu+n[1]*(t-2*Cu);return[r,a]}),Sj=(e,t)=>{const n=e.map((i,o)=>({e:i,ind:o})).sort((i,o)=>-i.e.y+o.e.y).map(i=>i.ind),r=[];for(let i=0;i<e.length;i++)r.push([0,0]);for(let i=0;i<n.length;i++){const o=n[i];r[o]=[.5,(.5+i)/(1+e.length)]}const a=Qp(t,r);return e.map((i,o)=>{const[s,l]=a[o];return{e:i,pixelX:s,pixelY:l}})},wj=(e,t,n,r,a)=>{const i=e-Us*2,o=t-Cu*2,s=Hf(a),l=yx(a);return KF(i/s,o/l,r/n)},xj=(e,t,n,r)=>{const a=Hf(r),i=(e-a*n)/2,o=[n,0,i-r.xmin*n],s=[0,-n,(t+n*(r.ymin+r.ymax))/2];return[o,s,[0,0,1]]},Ej=(e,t,n,r={})=>{const a=(e-Us*2)/(t-Cu*2),i=bj(n),{boxAspect:o}=yj(i);return r.disableAutoRotate||o===1||a===1||o>1==a>1?{electrodes:n,rotated:!1}:{electrodes:n.map(s=>({...s,x:s.y,y:-s.x})),rotated:!0}},Aj=(e,t)=>{const n=e.map(a=>[a.x,a.y]),r=Qp(t,n);return e.map((a,i)=>{const[o,s]=r[i];return{e:a,pixelX:o,pixelY:s}})},J3=(e,t,n)=>{for(const r of e)if(vx([r.pixelX-n[0],r.pixelY-n[1]])<t)return r.e.id},eC=(e,t,n)=>{const r=t.xmin-n,a=t.xmax+n,i=t.ymin-n,o=t.ymax+n;return e.filter(s=>s.pixelX>r&&s.pixelX<a&&s.pixelY>i&&s.pixelY<o).map(s=>s.e.id)},R1=(e,t,n,r="geom",a=rC,i)=>{if(r==="vertical"){const m=Dj(e,t),D=Sj(n,m),p=(t-2*Cu)/(1+n.length);return{transform:m,convertedElectrodes:D,pixelRadius:p}}const{electrodes:o,rotated:s}=Ej(e,t,n,{disableAutoRotate:i.disableAutoRotate}),l=Q3(o),u=W3(o,l),c=wj(e,t,l,a,u),f=l*c;let d=xj(e,t,c,u);const h=(e-Hf(u)*c)/2,g=Aj(o,d);return s&&(d=[[-d[0][1],d[0][0],d[0][2]],[-d[1][1],d[1][0],d[1][2]],[-d[2][1],d[2][0],d[2][2]]]),{transform:d,convertedElectrodes:g,pixelRadius:f,xMargin:h}},tC={isActive:!1},Cj=(e,t)=>{if(t.type==="INITIALIZE"){const{width:n,height:r,electrodes:a,layoutMode:i,maxElectrodePixelRadius:o}=t,{convertedElectrodes:s,pixelRadius:l,xMargin:u}=R1(n,r,a,i,o,{disableAutoRotate:t.disableAutoRotate});return{...e,convertedElectrodes:s,pixelRadius:l,draggedElectrodeIds:[],hoveredElectrodeId:void 0,dragState:tC,xMarginWidth:u??Us}}else if(t.type==="DRAGUPDATE"){const n=hB(e.dragState,t.dragAction);if(!n.isActive&&n.dragRect){const r=Dx(n.dragRect),a=eC(e.convertedElectrodes,r,e.pixelRadius),i=t.dragAction.shift?[...a,...t.selectedElectrodeIds||[]]:a;return{...e,draggedElectrodeIds:[],hoveredElectrodeId:void 0,pendingSelectedElectrodeIds:i,dragState:tC}}else if(n.dragRect){const r=Dx(n.dragRect),a=eC(e.convertedElectrodes,r,e.pixelRadius);return a.length===e.draggedElectrodeIds.length&&a.filter(i=>!e.draggedElectrodeIds.includes(i)).length===0?{...e,hoveredElectrodeId:void 0,dragState:n}:{...e,hoveredElectrodeId:void 0,draggedElectrodeIds:a,dragState:n}}else return{...e,dragState:n}}else if(t.type==="UPDATEHOVER"){const n=J3(e.convertedElectrodes,e.pixelRadius,t.point);return n===e.hoveredElectrodeId?e:{...e,hoveredElectrodeId:n}}else if(t.type==="UPDATECLICK"){const n=J3(e.convertedElectrodes,e.pixelRadius,t.point);if(n===void 0)return!(t.shift||t.ctrl)&&t.selectedElectrodeIds.length>0?{...e,pendingSelectedElectrodeIds:[]}:e;const r=t.ctrl?t.selectedElectrodeIds.includes(n)?t.selectedElectrodeIds.filter(a=>a!==n):[...t.selectedElectrodeIds,n]:t.shift?[...t.selectedElectrodeIds,n]:[n];return{...e,hoveredElectrodeId:void 0,pendingSelectedElectrodeIds:r}}else return console.log("Error: unrecognized verb in electrode geometry reducer."),e},nC=!1,rC=25,aC={showLabels:!0,maxElectrodePixelRadius:rC},Tj=e=>{const t=e.currentTarget.getBoundingClientRect();return[e.clientX-t.x,e.clientY-t.y]},Mj=()=>({selectedElectrodeIds:[],setSelectedElectrodeIds:e=>{}}),iC=e=>{const{width:t,height:n,electrodes:r,disableAutoRotate:a,affineTransform:i}=e,{selectedElectrodeIds:o,setSelectedElectrodeIds:s}=Mj(),l=e.disableSelection??!1,u=e.offsetLabels??!1,c=e.colors??Au,f=e.layoutMode??"geom",d=e.maxElectrodePixelRadius||aC.maxElectrodePixelRadius,[h,g]=_.useReducer(Cj,{convertedElectrodes:[],pixelRadius:-1,draggedElectrodeIds:[],pendingSelectedElectrodeIds:o||[],dragState:{isActive:!1},xMarginWidth:-1}),{affineTransform:m,handleWheel:D}=O1(t,n,{shift:!0,alt:!1}),p=_.useMemo(()=>{const T=h.convertedElectrodes.map(M=>{const x=ao(m,{x:M.pixelX,y:M.pixelY});return{...M,pixelX:x.x,pixelY:x.y}});return{...h,convertedElectrodes:T,pixelRadius:h.pixelRadius*Math.sqrt(B1(m))}},[m,h]),v=_.useMemo(()=>T=>{const M=Tj(T),x=F1(m,{x:M[0],y:M[1]});return[x.x,x.y]},[m]);_.useEffect(()=>{g({type:"INITIALIZE",electrodes:r,width:t,height:n,maxElectrodePixelRadius:d,layoutMode:f,disableAutoRotate:a})},[t,n,r,f,d,a]),_.useEffect(()=>{s(h.pendingSelectedElectrodeIds)},[s,h.pendingSelectedElectrodeIds]);const y=_.useRef(null),w=_.useRef(0),E=l||F.jsx(yB,{width:t,height:n,newState:h.dragState}),b=_.useCallback(T=>{if(!pB(T,{nextDragStateUpdate:y,nextFrame:w,reducer:g,reducerOtherProps:{type:"DRAGUPDATE"}})){const x=v(T);g({type:"UPDATEHOVER",point:x})}},[v]),S=_.useCallback(T=>{gB(T,{nextDragStateUpdate:y,reducer:g,reducerOtherProps:{type:"DRAGUPDATE"}})},[]),A=_.useCallback(T=>{if(h.dragState.isActive)vB(T,{nextDragStateUpdate:y,reducer:g,reducerOtherProps:{type:"DRAGUPDATE",selectedElectrodeIds:o}});else{const M=v(T);g({type:"UPDATECLICK",point:M,shift:T.shiftKey,ctrl:T.ctrlKey,selectedElectrodeIds:o||[]})}},[h.dragState.isActive,o,v]),C=_.useMemo(()=>{const T={pixelElectrodes:p.convertedElectrodes,selectedElectrodeIds:o||[],hoveredElectrodeId:h.hoveredElectrodeId,draggedElectrodeIds:h.draggedElectrodeIds,pixelRadius:p.pixelRadius,showLabels:e.showLabels??aC.showLabels,offsetLabels:u,layoutMode:e.layoutMode??"geom",xMargin:h.xMarginWidth,colors:c,affineTransform:i};return F.jsx(Er,{width:t,height:n,draw:mj,drawData:T})},[t,n,p.convertedElectrodes,o,h.hoveredElectrodeId,h.draggedElectrodeIds,p.pixelRadius,e.showLabels,u,e.layoutMode,h.xMarginWidth,c,i]);return _.useMemo(()=>nC,[h.convertedElectrodes,o,h.hoveredElectrodeId,h.draggedElectrodeIds,h.pixelRadius,e.showLabels,u,e.layoutMode,h.xMarginWidth,t,n,c]),F.jsxs("div",{style:{width:t,height:n,position:"relative"},onMouseMove:b,onMouseUp:A,onMouseDown:S,onWheel:D,children:[E,nC,C]})},_j=e=>1/e,io=(e,t,n,r,a)=>{const i=[];return n.forEach((o,s)=>{for(const l of t){const u=l.electrodeIndices.indexOf(s);if(u>=0){let c;const f=l.waveformStdDev,d=l.waveformPercentiles;if(r==="normal"?c=l.waveform[u]:r==="lower"?c=f?l.waveform[u].map((h,g)=>l.waveform[u][g]-f[u][g]):void 0:r==="upper"?c=f?l.waveform[u].map((h,g)=>l.waveform[u][g]+f[u][g]):void 0:r==="percentile1"?c=d?l.waveform[u].map((h,g)=>d[0][u][g]):void 0:r==="percentile2"?c=d?l.waveform[u].map((h,g)=>d[1][u][g]):void 0:r==="percentile3"?c=d&&2<d.length?l.waveform[u].map((h,g)=>d[2][u][g]):void 0:r==="percentile4"&&(c=d&&3<d.length?l.waveform[u].map((h,g)=>d[3][u][g]):void 0),c){const h=c.map((m,D)=>[(c?.length||0)/2+(D-(c?.length||0)/2)*a,m]),g=Qp(e,h);i.push({pointsInPaintBox:g,offsetFromParentCenter:[o.pixelX,o.pixelY],color:l.waveformColors.base})}}}}),i},Nj=(e,t)=>{const{pixelSpacePaths:n,pixelSpacePathsLower:r,pixelSpacePathsUpper:a,pixelSpacePathsPercentile1:i,pixelSpacePathsPercentile2:o,pixelSpacePathsPercentile3:s,pixelSpacePathsPercentile4:l,xMargin:u,waveformWidth:c,affineTransform:f,useUnitColors:d}=t;if(!n||n.length===0)return;if(e.resetTransform(),e.clearRect(0,0,e.canvas.width,e.canvas.height),e.save(),f){const v=f.forward;e.transform(v[0][0],v[1][0],v[0][1],v[1][1],v[0][2],v[1][2])}e.translate(u,0);const h=e.getTransform();r&&a&&r.forEach((v,y)=>{const w=r[y],E=a[y];e.fillStyle="#dddddd",e.strokeStyle="#bbbbbb",e.lineWidth=1,e.translate(w.offsetFromParentCenter[0],w.offsetFromParentCenter[1]),e.beginPath(),e.moveTo(w.pointsInPaintBox[0][0],w.pointsInPaintBox[0][1]);for(let b=0;b<w.pointsInPaintBox.length;b++)e.lineTo(w.pointsInPaintBox[b][0],w.pointsInPaintBox[b][1]);for(let b=E.pointsInPaintBox.length-1;b>=0;b--)e.lineTo(E.pointsInPaintBox[b][0],E.pointsInPaintBox[b][1]);e.fill(),e.stroke(),e.setTransform(h)});let g,m,D,p;i&&o&&s&&l?(g=i,m=o,D=s,p=l):i&&o&&!s&&!l?(g=void 0,m=i,D=o,p=void 0):(g=void 0,m=void 0,D=void 0,p=void 0),g&&g.length>0&&p&&p.length>0&&g.forEach((v,y)=>{if(!g||!p)throw Error("unexpected");const w=g[y],E=p[y];e.fillStyle="#dddddd",e.strokeStyle="#dddddd",e.lineWidth=1,e.translate(w.offsetFromParentCenter[0],w.offsetFromParentCenter[1]),e.beginPath(),e.moveTo(w.pointsInPaintBox[0][0],w.pointsInPaintBox[0][1]);for(let b=0;b<w.pointsInPaintBox.length;b++)e.lineTo(w.pointsInPaintBox[b][0],w.pointsInPaintBox[b][1]);for(let b=E.pointsInPaintBox.length-1;b>=0;b--)e.lineTo(E.pointsInPaintBox[b][0],E.pointsInPaintBox[b][1]);e.fill(),e.stroke(),e.setTransform(h)}),m&&m.length>0&&m.length>0&&D&&D.length>0&&m.forEach((v,y)=>{if(!m||!D)throw Error("unexpected");const w=m[y],E=D[y];e.fillStyle="#bbbbbb",e.strokeStyle="#bbbbbb",e.lineWidth=1,e.translate(w.offsetFromParentCenter[0],w.offsetFromParentCenter[1]),e.beginPath(),e.moveTo(w.pointsInPaintBox[0][0],w.pointsInPaintBox[0][1]);for(let b=0;b<w.pointsInPaintBox.length;b++)e.lineTo(w.pointsInPaintBox[b][0],w.pointsInPaintBox[b][1]);for(let b=E.pointsInPaintBox.length-1;b>=0;b--)e.lineTo(E.pointsInPaintBox[b][0],E.pointsInPaintBox[b][1]);e.fill(),e.stroke(),e.setTransform(h)}),n.forEach(v=>{e.strokeStyle=d?v.color:"black",e.lineWidth=c,e.translate(v.offsetFromParentCenter[0],v.offsetFromParentCenter[1]),e.beginPath(),e.moveTo(v.pointsInPaintBox[0][0],v.pointsInPaintBox[0][1]),v.pointsInPaintBox.forEach(y=>{e.lineTo(y[0],y[1])}),e.stroke(),e.setTransform(h)}),e.restore()},Fj=e=>{const{electrodes:t,waveforms:n,oneElectrodeHeight:r,oneElectrodeWidth:a,yScale:i,horizontalStretchFactor:o,width:s,height:l,layoutMode:u,waveformWidth:c,affineTransform:f,useUnitColors:d}=e;return _.useMemo(()=>{const g=n.length>0&&n[0].waveform.length>0?n[0].waveform[0].length:0,m=a/g,D=-a*(.5+1/g),p=i*r/2,v=Ye([[m,0,D],[0,-p,0],[0,0,1]]).toArray(),y=io(v,n,t,"normal",o),w=io(v,n,t,"lower",o),E=io(v,n,t,"upper",o);let b=io(v,n,t,"percentile1",o),S=io(v,n,t,"percentile2",o),A=io(v,n,t,"percentile3",o),C=io(v,n,t,"percentile4",o);b.length===0&&(b=void 0),S.length===0&&(S=void 0),A.length===0&&(A=void 0),C.length===0&&(C=void 0);const T=u==="vertical"?(s-a)/2:0,M={pixelSpacePaths:y,pixelSpacePathsLower:w,pixelSpacePathsUpper:E,pixelSpacePathsPercentile1:b,pixelSpacePathsPercentile2:S,pixelSpacePathsPercentile3:A,pixelSpacePathsPercentile4:C,xMargin:T,waveformWidth:c,affineTransform:f,useUnitColors:d};return F.jsx(Er,{width:s,height:l,draw:Nj,drawData:M})},[n,t,i,s,l,a,r,u,c,f,o,d])},Bj={colors:{border:"rgb(120, 100, 120)",base:"rgb(240, 240, 240)",selected:"rgb(196, 196, 128)",hover:"rgb(128, 128, 255)",selectedHover:"rgb(200, 200, 196)",dragged:"rgb(0, 0, 196)",draggedSelected:"rgb(180, 180, 150)",dragRect:"rgba(196, 196, 196, 0.5)",textLight:"rgb(162, 162, 162)",textDark:"rgb(32, 150, 150)"}},Oj=e=>{const t=e.colors??Bj.colors,{electrodes:n,waveforms:r,ampScaleFactor:a,horizontalStretchFactor:i,layoutMode:o,hideElectrodes:s,width:l,height:u,showChannelIds:c,useUnitColors:f,waveformWidth:d,disableAutoRotate:h}=e,g=1e3,{handleWheel:m,affineTransform:D}=O1(l,u,{shift:!0,alt:!0}),p=_.useMemo(()=>F.jsx(iC,{electrodes:n,width:l,height:u,layoutMode:o,colors:t,showLabels:c,maxElectrodePixelRadius:g,disableSelection:!0,disableAutoRotate:h,affineTransform:D}),[n,l,u,o,t,c,h,D]),{convertedElectrodes:v,pixelRadius:y,xMargin:w}=R1(l,u,n,o,g,{disableAutoRotate:h}),E=w||Us,b=_.useMemo(()=>_j(e.peakAmplitude),[e.peakAmplitude]),S=_.useMemo(()=>a*b,[a,b]),A=o==="geom"?y*2:u/n.length,C=o==="geom"?y*2:l-E-(c?2*y:0),T=F.jsx(Fj,{electrodes:v,waveforms:r,oneElectrodeHeight:A,oneElectrodeWidth:C,horizontalStretchFactor:i,yScale:S,width:l,height:u,layoutMode:o,waveformWidth:d,affineTransform:D,useUnitColors:f});return F.jsxs("div",{style:{width:l,height:u,position:"relative"},onWheel:m,children:[!s&&p,T]})},Rj=({allChannelIds:e,channelIds:t,units:n,layoutMode:r,hideElectrodes:a,channelLocations:i,samplingFrequency:o,peakAmplitude:s,ampScaleFactor:l,horizontalStretchFactor:u,showChannelIds:c,useUnitColors:f,showReferenceProbe:d,disableAutoRotate:h,width:g,height:m})=>{const D=_.useMemo(()=>{const E=i||{};return t.map(b=>({id:b,label:`${b}`,x:E[`${b}`]!==void 0?E[`${b}`][0]:$t(b),y:E[`${b}`]!==void 0?E[`${b}`][1]:0}))},[t,i]),p=_.useMemo(()=>{const E=i||{};return e.map(b=>({id:b,label:`${b}`,x:E[`${b}`]!==void 0?E[`${b}`][0]:$t(b),y:E[`${b}`]!==void 0?E[`${b}`][1]:0}))},[e,i]),v=g/4,y=_.useMemo(()=>n.map(E=>{const b={base:E.waveformColor},S=[];for(const A of E.channelIds)S.push(D.map(C=>C.id).indexOf(A));return{electrodeIndices:S,waveform:E.waveform,waveformStdDev:E.waveformStdDev,waveformPercentiles:E.waveformPercentiles,waveformColors:b}}),[D,n]),w=F.jsx(Oj,{waveforms:y,electrodes:D,ampScaleFactor:l,horizontalStretchFactor:u,layoutMode:i?r:"vertical",hideElectrodes:a,width:d?g-v:g,height:m,showLabels:!0,peakAmplitude:s,samplingFrequency:o,showChannelIds:c,useUnitColors:f,waveformWidth:2,disableAutoRotate:h});return d?F.jsxs("div",{style:{position:"relative",width:g,height:m},children:[F.jsx("div",{style:{position:"absolute",left:0,top:0,width:v,height:m},children:F.jsx(iC,{electrodes:p,disableSelection:!1,width:v,height:m})}),F.jsx("div",{style:{position:"absolute",left:v,top:0,width:g-v,height:m},children:w})]}):w},zj=({data:e,width:t,height:n})=>{const r=_.useMemo(()=>{const L=[];for(const j of e.averageWaveforms)for(const V of j.channelIds)L.includes(V)||L.push(V);return Pr(L)},[e.averageWaveforms]),[a,i]=_.useState({...Hd,onlyShowSelected:!1}),{selectedUnitIds:o,currentUnitId:s,orderedUnitIds:l,plotClickHandlerGenerator:u,unitIdSelectionDispatch:c}=ri(),[f,d]=_.useState(1),[h,g]=_.useState("geom"),[m,D]=_.useState(!0),[p,v]=_.useState(!1),[y,w]=_.useState(e.showReferenceProbe||!1),[E,b]=_.useState(!1),[S,A]=_.useState(1),[C,T]=_.useState(!0),[M,x]=_.useState(!0);_.useEffect(()=>{c({type:Wo,newUnitOrder:Pr(e.averageWaveforms.map(L=>L.unitId))})},[e.averageWaveforms,c]);const[N,O]=_.useState(2),z=_.useMemo(()=>{let L=0;return e.averageWaveforms.forEach(j=>{j.waveform.forEach(V=>{V.forEach(te=>{const ee=Math.abs(te);ee>L&&(L=ee)})})}),L},[e.averageWaveforms]),B=_.useMemo(()=>e.averageWaveforms.filter(L=>a.onlyShowSelected?o.has(L.unitId):!0).map(L=>{const j=[{channelIds:L.channelIds,waveform:$j(L.waveform),waveformStdDev:m&&!E?L.waveformStdDev:void 0,waveformPercentiles:m&&!E&&L.waveformPercentiles?Ij(L.waveformPercentiles,L.waveform):void 0,waveformColor:Vr($t(L.unitId))}],V={allChannelIds:r,channelIds:L.channelIds,units:j,layoutMode:h,hideElectrodes:C,channelLocations:e.channelLocations,samplingFrequency:e.samplingFrequency,peakAmplitude:z,ampScaleFactor:f,horizontalStretchFactor:S,showChannelIds:p,useUnitColors:M,width:120*N+(y?120*N/4:0),height:120*N,showReferenceProbe:y,disableAutoRotate:!0};return{unitId:L.unitId,key:L.unitId,label:`Unit ${L.unitId}`,labelColor:Vr($t(L.unitId)),clickHandler:a.onlyShowSelected?void 0:u(L.unitId),props:V}}),[e.averageWaveforms,e.channelLocations,e.samplingFrequency,r,z,h,f,u,a.onlyShowSelected,o,N,m,p,y,E,S,C,M]),k=_.useMemo(()=>l?l.map(L=>B.filter(j=>j.unitId===L)[0]).filter(L=>L!==void 0):B,[B,l]),$=_.useMemo(()=>E?kj(k):k,[k,E]),U=_.useMemo(()=>[{type:"button",callback:()=>{A(L=>L*1.1)},title:"Increase horizontal stretch [alt + mouse-wheel]",icon:F.jsx($B,{})},{type:"button",callback:()=>{A(1)},title:"Reset scale amplitude",icon:F.jsx(Fx,{})},{type:"button",callback:()=>{A(L=>L/1.1)},title:"Decrease horizontal stretch [alt + mouse-wheel]",icon:F.jsx(kB,{})}],[]),Y=_.useMemo(()=>{const L=lj({ampScaleFactor:f,setAmpScaleFactor:d}),j={type:"toggle",subtype:"checkbox",callback:()=>g(me=>me==="geom"?"vertical":"geom"),title:"Show electrode geometry",selected:h==="geom"},V={type:"toggle",subtype:"checkbox",callback:()=>T(me=>!me),title:"Show electrodes",selected:!C},te=[{type:"button",callback:()=>O(me=>me*1.3),title:"Increase box size",icon:F.jsx(Zf,{})},{type:"button",callback:()=>O(me=>me/1.3),title:"Decrease box size",icon:F.jsx(Xf,{})}],ee={type:"toggle",subtype:"checkbox",callback:()=>D(me=>!me),title:"Show waveform stdev",selected:m===!0},ne={type:"toggle",subtype:"checkbox",callback:()=>v(me=>!me),title:"Show channel IDs",selected:p===!0},se={type:"toggle",subtype:"checkbox",callback:()=>w(me=>!me),title:"Show reference probes",selected:y===!0},W={type:"toggle",subtype:"checkbox",callback:()=>b(me=>!me),title:"Show overlapping",selected:E===!0},de={type:"toggle",subtype:"checkbox",callback:()=>x(me=>!me),title:"Use unit colors",selected:M===!0};return[{type:"divider"},...te,{type:"divider"},...L,{type:"divider"},...U,{type:"divider"},j,V,{type:"divider"},ee,{type:"divider"},ne,{type:"divider"},se,{type:"divider"},W,{type:"divider"},de]},[h,f,m,p,E,y,U,C,M]),X=_.useCallback(L=>{L.shiftKey&&!L.altKey?L.deltaY<0?d(j=>j*1.3):d(j=>j/1.3):L.altKey&&!L.shiftKey&&(L.deltaY<0?A(j=>j*1.1):A(j=>j/1.1))},[]),P=30,G=_.useCallback(L=>{L&&L.addEventListener("wheel",j=>{(j.shiftKey||j.altKey)&&j.preventDefault()})},[]),q=gu;return F.jsxs("div",{ref:L=>G(L),onWheel:X,children:[F.jsxs(Os,{width:t,height:n-P,initialPosition:q,adjustable:!1,children:[F.jsx(vu,{width:q,height:n,customActions:Y}),F.jsx(Yf,{width:0,height:0,children:F.jsx(qf,{plots:$,plotComponent:Rj,selectedPlotKeys:a.onlyShowSelected?void 0:o,currentPlotKey:s})})]}),F.jsx("div",{style:{position:"absolute",top:n-P,height:P,overflow:"hidden"},children:F.jsx(qd,{options:a,setOptions:i})})]})},kj=e=>{if(e.length===0)return e;const t={...e[0],props:{...e[0].props}},n=t.props;t.key="overlapping",t.label="Overlapping",t.labelColor="black",t.unitId="overlapping",n.height*=3;const r=new Set;for(const i of e)for(const o of i.props.channelIds)r.add(o);const a=Pr([...r]);return n.channelIds=a,n.units=e.map(i=>i.props.units[0]),[t]},$j=e=>e.map(t=>{const n=oC(t);return t.map(r=>r-n)}),Ij=(e,t)=>{const n=[];for(let r=0;r<e.length;r++)n.push(e[r].map((a,i)=>{const o=oC(t[i]);return a.map(s=>s-o)}));return n},oC=e=>e.length>0?lB(e):0,Uj=e=>F.jsx(bi,{context:e.contexts.unitSelection,children:F.jsx(Lj,{...e})}),Lj=({zarrGroup:e,width:t,height:n})=>{const[r,a]=_.useState(null);return _.useEffect(()=>{let i=!1;return(async()=>{const s=[],l=e.attrs.num_average_waveforms||0,u=e.attrs.average_waveforms,c=u.length;c!==l&&console.warn(`numUnits (${c}) !== numAverageWaveforms (${l})`);for(let f=0;f<l;f++){const d=`waveform_${f}`,h=await e.getGroup(d);if(!h){console.warn(`No group for ${d}`);continue}if(h.datasets.find(v=>v.name==="waveform")===void 0){console.warn(`No waveform dataset for ${d}`);continue}const g=await e.getDataset(`${d}/waveform`);if(!g){console.warn(`Could not load waveform dataset for ${d}`);continue}const m=g.shape,D=await e.getDatasetData(`${d}/waveform`,{});let p;if(h.datasets.find(v=>v.name==="waveform_std_dev")===void 0?p=void 0:p=await e.getDatasetData(`${d}/waveform_std_dev`,{}),D){const v=u.find(y=>y.name===d);v&&s.push({unitId:v.unit_id,channelIds:v.channel_ids,waveform:sC(D,m),waveformStdDev:p?sC(p,m):void 0})}}i||a({type:"AverageWaveforms",averageWaveforms:s})})(),()=>{i=!0}},[e]),r?F.jsx(zj,{data:r,width:t,height:n}):F.jsx("div",{children:"Loading..."})},sC=(e,t)=>{if(t.length!==2)throw Error("shape.length should be 2");const[n,r]=t;if(e.length!==n*r)throw Error(`data.length does not match shape. Expected ${n*r}, got ${e.length}`);const a=[];for(let i=0;i<r;i++){const o=[];for(let s=0;s<n;s++)o.push(e[s*r+i]);a.push(o)}return a},lC=20,Pj=({data:e,width:t,height:n})=>{const[r,a]=_.useState(!1),{selectedUnitIds:i}=ri(),o=_.useMemo(()=>Pr([...i]),[i]),s=e.hideUnitSelector,l=_.useMemo(()=>{const p=e.crossCorrelograms.filter(y=>o.includes(y.unitId1)&&o.includes(y.unitId2)),v=[];for(const y of o)for(const w of o){const E=p.filter(b=>b.unitId1===y&&b.unitId2===w)[0];E?v.push(E):v.push(void 0)}return v},[e.crossCorrelograms,o]),u=s?0:100,c=gu,f=t-u-c,d=n,h=_.useMemo(()=>{const p=o.length,{plotWidth:v,plotHeight:y}=uC(f,d,p);return l.map((w,E)=>({key:`${E}`,unitId:w?w.unitId1:0,label:w?v>80?`Unit ${w.unitId1}/${w.unitId2}`:`${w.unitId1}/${w.unitId2}`:"",labelColor:"black",clickHandler:void 0,props:{binEdgesSec:w?w.binEdgesSec:void 0,binCounts:w?w.binCounts:void 0,color:w?.unitId1===w?.unitId2?Vr($t(w?.unitId1)):"gray",width:v,height:y,hideXAxis:!r}}))},[l,f,d,o,r]),g=_.useMemo(()=>[{type:"toggle",subtype:"checkbox",callback:()=>a(v=>!v),title:"Show X Axis",selected:r===!0}],[r]),m=_.useMemo(()=>{const p=new Set;e.crossCorrelograms.forEach(y=>{p.add(y.unitId1),p.add(y.unitId2)});const v=Pr(Array.from(p));return{type:"UnitsTable",columns:[],rows:v.map(y=>({unitId:y,values:{}}))}},[e.crossCorrelograms]),D=F.jsxs(Os,{width:t-u,height:n,initialPosition:c,adjustable:!1,children:[F.jsx(vu,{width:c,height:n,customActions:g}),F.jsx(Yf,{width:0,height:0,disableScroll:!0,children:o.length>lC?F.jsxs("div",{children:["Not showing cross-correlogram matrix. Too many units selected (max ="," ",lC,")."]}):o.length===0?F.jsx("div",{children:"Select one or more units to view cross-correlograms."}):F.jsx(qf,{plots:h,plotComponent:uA,selectedPlotKeys:void 0,numPlotsPerRow:o.length})})]});return s?D:F.jsxs("div",{style:{position:"relative",width:t,height:n},children:[F.jsx("div",{style:{position:"absolute",left:0,top:0,width:u,height:n,borderRight:"1px solid #ccc",boxSizing:"border-box",padding:10,backgroundColor:"#f9f9f9"},children:F.jsx(V3,{data:m,width:u,height:n})}),F.jsx("div",{style:{position:"absolute",left:u,top:0,width:t-u,height:n},children:D})]})},uC=(e,t,n)=>{const r=Math.min((e-30-(n-1)*7)/n,(t-30-(n-1)*7)/n);return{plotWidth:r,plotHeight:r}},jj=({zarrGroup:e,contexts:t,width:n,height:r})=>{const[a,i]=_.useState(null);return _.useEffect(()=>{let o=!1;return(async()=>{const l=[],u=e.attrs.num_cross_correlograms||0;if(u===0){o||i({type:"CrossCorrelograms",crossCorrelograms:[],hideUnitSelector:e.attrs.hide_unit_selector||!1});return}const c=await e.getDatasetData("bin_edges_sec",{}),f=await e.getDatasetData("bin_counts",{});if(!c||!f){console.error("Failed to load cross-correlograms data");return}const d=Array.from(c),h=new Int32Array(f),g=d.length-1,m=e.attrs.cross_correlograms;for(let p=0;p<u;p++){const v=m[p],y=p*g,w=Array.from(h.slice(y,y+g));l.push({unitId1:v.unit_id1,unitId2:v.unit_id2,binEdgesSec:d,binCounts:w})}const D=e.attrs.hide_unit_selector||!1;o||i({type:"CrossCorrelograms",crossCorrelograms:l,hideUnitSelector:D})})(),()=>{o=!0}},[e]),a?F.jsx(bi,{context:t.unitSelection,children:F.jsx(Pj,{data:a,width:n,height:r})}):F.jsx("div",{children:"Loading..."})},Hj=1.4,qj=(e,t,n,r)=>{if(e.visibleStartTimeSec===void 0||e.visibleEndTimeSec===void 0||e.startTimeSec===void 0||e.endTimeSec===void 0)return console.warn(`WARNING: * Attempt to call zoomTime() with uninitialized state ${e}.`),{visibleStartTimeSec:e.visibleStartTimeSec,visibleEndTimeSec:e.visibleEndTimeSec};const a=e.endTimeSec-e.startTimeSec,i=e.visibleEndTimeSec-e.visibleStartTimeSec;if(i===a&&t==="out")return{visibleStartTimeSec:e.startTimeSec,visibleEndTimeSec:e.endTimeSec};let o=n??Hj;o=t==="in"?1/o:o;const s=Math.min(i*o,a);if(s>=a)return{...e,visibleStartTimeSec:e.startTimeSec,visibleEndTimeSec:e.endTimeSec};const l=r!==void 0?r:e.currentTime??e.visibleStartTimeSec+i/2,u=(l-e.visibleStartTimeSec)/i;let c=Math.max(l-u*s,e.startTimeSec);const f=Math.min(c+s,e.endTimeSec);return c=f-s,{visibleStartTimeSec:c,visibleEndTimeSec:f}},cC=(e,t)=>{if(e.visibleStartTimeSec===void 0||e.visibleEndTimeSec===void 0||e.startTimeSec===void 0||e.endTimeSec===void 0)return console.warn(`WARNING: Attempt to call panTime() with uninitialized state ${e}.`),e;const n=e.visibleEndTimeSec-e.visibleStartTimeSec;let r=e.visibleStartTimeSec,a=e.visibleEndTimeSec;if(t>0)a=Math.min(e.visibleEndTimeSec+t,e.endTimeSec),r=Math.max(a-n,e.startTimeSec);else if(t<0)r=Math.max(e.visibleStartTimeSec+t,e.startTimeSec),a=Math.min(r+n,e.endTimeSec);else return e;const o=!0?e.currentTime:void 0;return r===e.visibleStartTimeSec&&a===e.visibleEndTimeSec?e:{...e,visibleStartTimeSec:r,visibleEndTimeSec:a,currentTimeSec:o}},Yj=(e,t)=>{if(e.visibleStartTimeSec===void 0||e.visibleEndTimeSec===void 0||e.startTimeSec===void 0||e.endTimeSec===void 0)return console.warn(`WARNING: * Attempt to call panTime() with uninitialized state ${e}.`),{visibleStartTimeSec:e.visibleStartTimeSec,visibleEndTimeSec:e.visibleEndTimeSec};const n=e.visibleEndTimeSec-e.visibleStartTimeSec,r=t.panAmountPct/100*n*(t.type==="back"?-1:1);return cC(e,r)},Gj=(e,t)=>{if(e.visibleStartTimeSec===void 0||e.visibleEndTimeSec===void 0||e.startTimeSec===void 0||e.endTimeSec===void 0)return console.warn(`WARNING: Attempt to call panTime() with uninitialized state ${e}.`),e;const n=t.deltaT;return cC(e,n)},fC=Rt.createContext(void 0),l0=()=>{const e=_.useContext(fC);if(!e)throw new Error("useTimeseriesSelection must be used within a TimeseriesSelectionContext");const t=e.dispatch,n=_.useCallback(s=>{t({type:"initializeTimeseries",startTimeSec:s.startTimeSec,endTimeSec:s.endTimeSec,initialVisibleStartTimeSec:s.initialVisibleStartTimeSec,initialVisibleEndTimeSec:s.initialVisibleEndTimeSec})},[t]),r=_.useCallback((s,l)=>{t({type:"setVisibleTimeRange",visibleStartTimeSec:s,visibleEndTimeSec:l})},[t]),a=_.useCallback(s=>{t({type:"setCurrentTime",currentTime:s})},[t]),i=_.useCallback(s=>{t({type:"zoomVisibleTimeRange",factor:s})},[t]),o=_.useCallback(s=>{t({type:"translateVisibleTimeRangeFrac",frac:s})},[t]);if(e===void 0)throw new Error("useTimeseriesSelection must be used within a TimeseriesSelectionContext.Provider");return{initializeTimeseriesSelection:n,setVisibleTimeRange:r,setCurrentTime:a,zoomVisibleTimeRange:i,translateVisibleTimeRangeFrac:o,timeseriesSelection:e.timeseriesSelection,startTimeSec:e.timeseriesSelection.startTimeSec,endTimeSec:e.timeseriesSelection.endTimeSec,visibleStartTimeSec:e.timeseriesSelection.visibleStartTimeSec,visibleEndTimeSec:e.timeseriesSelection.visibleEndTimeSec,currentTime:e.timeseriesSelection.currentTime}},u0=()=>{const{visibleStartTimeSec:e,visibleEndTimeSec:t,currentTime:n,setCurrentTime:r,startTimeSec:a,endTimeSec:i,setVisibleTimeRange:o}=l0(),s=_.useCallback((d,h,g)=>{const m=qj({visibleStartTimeSec:e,visibleEndTimeSec:t,currentTime:n,startTimeSec:a,endTimeSec:i},d,h,g);m.visibleStartTimeSec!==void 0&&m.visibleEndTimeSec!==void 0&&o(m.visibleStartTimeSec,m.visibleEndTimeSec)},[e,t,n,a,i,o]),l=_.useCallback((d,h)=>{const g=Yj({visibleStartTimeSec:e,visibleEndTimeSec:t,startTimeSec:a,endTimeSec:i,currentTime:n},{type:d,panAmountPct:h??10});g.visibleStartTimeSec!==void 0&&g.visibleEndTimeSec!==void 0&&o(g.visibleStartTimeSec,g.visibleEndTimeSec)},[e,t,a,i,n,o]),u=_.useCallback(d=>{const h=Gj({visibleStartTimeSec:e,visibleEndTimeSec:t,startTimeSec:a,endTimeSec:i,currentTime:n},{deltaT:d});h.visibleStartTimeSec!==void 0&&h.visibleEndTimeSec!==void 0&&o(h.visibleStartTimeSec,h.visibleEndTimeSec)},[e,t,a,i,n,o]),c=_.useCallback(d=>{if(e===void 0||t===void 0)return;const h=t-e,g=d,m=g+h;o(g,m)},[e,t,o]),f=_.useCallback((d,h)=>{if(e===void 0||t===void 0)return;const g=e+d*(t-e);r(g)},[e,t,r]);return{visibleStartTimeSec:e,visibleEndTimeSec:t,setVisibleTimeRange:o,zoomTimeseriesSelection:s,panTimeseriesSelection:l,panTimeseriesSelectionDeltaT:u,panTimeseriesSelectionVisibleStartTimeSec:c,setCurrentTimeFraction:f}},dC=()=>{const[e,t]=_.useState(!1),n=_.useMemo(()=>[{id:"only-show-selected",label:"Only Show Selected",tooltip:"Toggle visibility of only selected units",icon:e?"👁️":"👁️‍🗨️",isActive:e,onClick:()=>t(r=>!r)}],[e]);return{onlyShowSelected:e,customToolbarActions:n}},Vj=[{name:"1ms",secondsPerTick:.001,countPerLargerUnit:10,scale_appropriate_label:e=>`${e%1e3} ms`},{name:"10ms",secondsPerTick:.01,countPerLargerUnit:10,scale_appropriate_label:e=>`${e*10%1e3} ms`},{name:"100ms",secondsPerTick:.1,countPerLargerUnit:10,scale_appropriate_label:e=>`${e*100%1e3} ms`},{name:"1s",secondsPerTick:1,countPerLargerUnit:10,scale_appropriate_label:e=>`${e%60} s`},{name:"10s",secondsPerTick:10,countPerLargerUnit:6,scale_appropriate_label:e=>`${e*10%60} s`},{name:"1min",secondsPerTick:60,countPerLargerUnit:10,scale_appropriate_label:e=>`${e%60} min`},{name:"10min",secondsPerTick:60*10,countPerLargerUnit:6,scale_appropriate_label:e=>`${e*10%60} min`},{name:"1hr",secondsPerTick:60*60,countPerLargerUnit:6,scale_appropriate_label:e=>`${e%24} hr`},{name:"6hr",secondsPerTick:60*60*6,countPerLargerUnit:4,scale_appropriate_label:e=>`${e*6%24} hr`},{name:"1day",secondsPerTick:60*60*24,countPerLargerUnit:10,scale_appropriate_label:e=>`${e} day`},{name:"10day",secondsPerTick:60*60*24*10,countPerLargerUnit:1e4,scale_appropriate_label:e=>`${10*e} day`}],Xj=(e,t,n,r)=>_.useMemo(()=>{if(t===void 0||n===void 0)return[];if(n<=t)return[];const a=[],i=e/(n-t);for(const o of Vj){const s=i*o.secondsPerTick;if(s<=50)continue;const l=Math.ceil(t/o.secondsPerTick),u=Math.floor(n/o.secondsPerTick),c=s>200||u-l<5;for(let f=l;f<=u;f++){if(f%o.countPerLargerUnit===0)continue;const d=f*o.secondsPerTick;a.push({value:d,label:o.scale_appropriate_label(f),major:c,xPixelPosition:r(d)})}}return a},[t,n,r,e]),Zj=e=>{if(!e||typeof e=="function")return;const t=e.current,n=t&&t.getContext("2d");if(n)return n},Kj={position:"absolute",left:0,top:0},hC=e=>{const{width:t,height:n,draw:r,drawData:a}=e,i=_.useRef(null);return _.useEffect(()=>{const o=Zj(i);o&&o.canvas&&r(o,a)},[r,i,a]),F.jsx("canvas",{ref:i,width:t,height:n,style:Kj})},Qj=(e,t)=>{const{width:n,height:r,margins:a,timeTicks:i,gridlineOpts:o,yTickSet:s,yLabel:l}=t;e.clearRect(0,0,e.canvas.width,e.canvas.height);const u=r-a.bottom;Wj(e,i,u,a.top,{hideGridlines:o?.hideX},t.hideTimeAxisLabels),e.strokeStyle="lightgray",z1(e,a.left,u,n-a.right,u),s&&Jj(e,s,u,a.left,n-a.right,a.top,{hideGridlines:o?.hideY}),l&&eH(e,l,a.left,a.bottom,a.top,e.canvas.height)},Wj=(e,t,n,r,a,i)=>{const o=i||!1;if(!t||t.length===0)return;const s=2,l=n+(o?0:5);e.textAlign="center",e.textBaseline="top",t.forEach(u=>{e.strokeStyle=u.major?"gray":"lightgray";const c=a.hideGridlines?n:r;z1(e,u.xPixelPosition,l,u.xPixelPosition,c),o||(e.fillStyle=u.major?"black":"gray",e.fillText(u.label,u.xPixelPosition,l+s))})},Jj=(e,t,n,r,a,i,o)=>{const l=r-5,u=l-2,{ticks:c}=t;e.fillStyle="black",e.textAlign="right",e.textBaseline="middle",c.forEach(f=>{if(!f.pixelValue)return;const d=f.pixelValue;e.strokeStyle=f.isMajor?"gray":"lightgray",e.fillStyle=f.isMajor?"black":"gray";const h=o.hideGridlines?r:a;z1(e,l,d,h,d),e.fillText(f.label,u,d)})},eH=(e,t,n,r,a,i)=>{e.textAlign="center",e.textBaseline="middle",e.save(),e.translate(15,(i-r-a)/2+a),e.fillStyle="black",e.font="13px sans-serif",e.rotate(-Math.PI/2),e.fillText(t,0,0),e.restore()},z1=(e,t,n,r,a)=>{e.beginPath(),e.moveTo(t,n),e.lineTo(r,a),e.stroke()},tH={},nH=e=>{const{width:t,height:n}=e,r=_.useCallback(a=>{Qj(a,e)},[e]);return F.jsx("span",{className:"TSV2AxesLayer",children:F.jsx(hC,{width:t,height:n,draw:r,drawData:tH})})},rH=(e,t)=>{const{margins:n,currentTimePixels:r,currentTimeIntervalPixels:a}=t;if(e.clearRect(0,0,e.canvas.width,e.canvas.height),a!==void 0){e.fillStyle="rgba(255, 225, 225, 0.4)",e.strokeStyle="rgba(150, 50, 50, 0.9)";const i=a[0],o=n.top,s=a[1]-a[0],l=e.canvas.height-n.bottom-n.top;e.fillRect(i,o,s,l),e.strokeRect(i,o,s,l)}if(r!==void 0&&a===void 0){e.fillStyle="rgba(255, 255, 0, 0.1)";const i=4;e.fillRect(r-i/2,n.top,i,e.canvas.height-n.bottom-n.top),e.strokeStyle="rgba(200, 200, 0, 0.4)",e.lineWidth=1,e.beginPath(),e.moveTo(r,n.top),e.lineTo(r,e.canvas.height-n.bottom),e.stroke()}},aH=e=>{const{width:t,height:n,timeRange:r,currentTimePixels:a,currentTimeIntervalPixels:i,margins:o}=e,s=_.useMemo(()=>({width:t,height:n,timeRange:r,currentTimePixels:a,currentTimeIntervalPixels:i,margins:o}),[t,n,r,a,i,o]);return F.jsx(hC,{width:t,height:n,draw:rH,drawData:s})},iH=({width:e,height:t,selectionRect:n})=>{if(!n)return null;const{startX:r,endX:a}=n,i=Math.abs(a-r),o=Math.min(r,a);return F.jsx("div",{style:{position:"absolute",top:0,left:0,width:e,height:t,pointerEvents:"none",zIndex:10},children:F.jsx("div",{style:{position:"absolute",left:o,top:0,width:i,height:t,backgroundColor:"rgba(0, 123, 255, 0.2)",border:"1px solid rgba(0, 123, 255, 0.6)",borderRadius:"2px"}})})},oH=e=>{const{pixelToTime:t,visibleStartTimeSec:n,setCurrentTime:r,onMouseDown:a,onMouseUp:i,onMouseMove:o,onMouseOut:s,onCanvasClick:l,interactionMode:u}=e,{panTimeseriesSelectionVisibleStartTimeSec:c,setVisibleTimeRange:f}=u0(),[d,h]=_.useState(!1),[g,m]=_.useState(void 0),[D,p]=_.useState(null),v=_.useRef({mouseDownAchorX:null,mouseDownAnchorTime:null,mouseDownAnchorVisibleStartTime:null,mouseDownAnchorPixelToTime:null,moved:!1,selectionStartX:null,selectionEndX:null}),y=_.useCallback(S=>{if(h(!0),!S.shiftKey&&!S.ctrlKey&&!S.altKey){const A=S.clientX-S.currentTarget.getBoundingClientRect().x;u==="select-zoom"?(v.current.selectionStartX=A,v.current.selectionEndX=A,p({startX:A,endX:A})):(v.current.mouseDownAchorX=A,v.current.mouseDownAnchorTime=t(A),v.current.mouseDownAnchorVisibleStartTime=n||null,v.current.mouseDownAnchorPixelToTime=t),v.current.moved=!1}else a&&a(S)},[t,a,n,u]),w=_.useCallback(S=>{if(!S.shiftKey&&!S.ctrlKey&&!S.altKey){const A=S.clientX-S.currentTarget.getBoundingClientRect().x;if(u==="select-zoom"&&v.current.selectionStartX!==null){const C=Math.min(v.current.selectionStartX,A),T=Math.max(v.current.selectionStartX,A);if(Math.abs(T-C)>5){const M=t(C),x=t(T);f(M,x)}else if(!v.current.moved){const M=t(A);if(r(M),l){const x=S.clientY-S.currentTarget.getBoundingClientRect().y;l(A,x)}}p(null),v.current.selectionStartX=null,v.current.selectionEndX=null}else if(v.current.mouseDownAchorX=null,v.current.mouseDownAnchorTime=null,v.current.mouseDownAnchorPixelToTime=null,!v.current.moved){const C=t(A);if(r(C),l){const T=S.clientY-S.currentTarget.getBoundingClientRect().y;l(A,T)}}}else i&&i(S)},[i,t,r,u,f]),E=_.useCallback(S=>{const A=S.clientX-S.currentTarget.getBoundingClientRect().x,C=t(A);if(m(C),!S.shiftKey&&!S.ctrlKey&&!S.altKey){if(u==="select-zoom"&&v.current.selectionStartX!==null)v.current.selectionEndX=A,p({startX:Math.min(v.current.selectionStartX,A),endX:Math.max(v.current.selectionStartX,A)}),v.current.moved=!0;else if(u==="pan"&&v.current.mouseDownAchorX!==null&&v.current.mouseDownAnchorPixelToTime!==null){const T=v.current.mouseDownAnchorPixelToTime(A),M=v.current.mouseDownAnchorTime,x=v.current.mouseDownAnchorVisibleStartTime;if(M!==null&&x!==null){const N=T-M,O=A-v.current.mouseDownAchorX;if(Math.abs(O)>2||Math.abs(N)>.01){const z=x-N;c(z),S.preventDefault(),S.stopPropagation(),v.current.moved=!0}}}}o&&o(S)},[t,o,u,c]),b=_.useCallback(S=>{m(void 0),h(!1),p(null),v.current.selectionStartX=null,v.current.selectionEndX=null,s&&s(S)},[s]);return{isViewClicked:d,hoverTime:g,selectionRect:D,handleMouseDown:y,handleMouseUp:w,handleMouseMove:E,handleMouseOut:b}},sH=({width:e,height:t,leftMargin:n,customToolbarActions:r,hideTimeAxisLabels:a,hideNavToolbar:i})=>{const o=r&&r.length>0,s=_.useMemo(()=>({left:n||60,right:20,top:10,bottom:a?10:30}),[n,a]);let l=0;i||(l+=40),o&&(l+=40);const u=e,c=t-l;return{margins:s,canvasWidth:u,canvasHeight:c}},lH=23,uH=60,cH=(e,t,n,r)=>{const a=Math.ceil((t-r)/n);return isNaN(a)||a<1?[]:Array(a).fill(0).map((i,o)=>r+o*n).filter(i=>i>e)},fH=(e,t)=>{let n=0;const r=Math.trunc(Math.log10(t));if(Math.trunc(Math.log10(e))!==r)return n;const a=Math.trunc(Math.log10(t-e));if(r<=a)return n;const i=a+1,o=Math.pow(10,-i),s=Math.trunc(t*o).toString(),l=Math.trunc(e*o).toString();for(const[u,c]of[...s].entries()){if(c!==l[u]){n=n*Math.pow(10,u-i);break}n=n*10+parseInt(c)}return n*Math.pow(10,i)},dH=(e,t)=>Math.floor(e*Math.pow(10,-(t+1)))*Math.pow(10,t+1),hH=(e,t,n)=>{const r=e-t,a=Math.trunc(r*Math.pow(10,-n)),i=a%10===0;return{label:Math.abs(n)>3?`${(a/10).toFixed(1)}e${n+1}`:`${Math.round(a*Math.pow(10,n)*1e9)/1e9}`,isMajor:i,dataValue:e}},mH=(e,t,n,r,a)=>{const i=cH(t,n,r,e).map(l=>Math.round(l*1e9)/1e9),o=fH(t,n);return i.map(l=>hH(l,o,a))},mC={ticks:[],datamin:0,datamax:0},pH=(e,t)=>{const n=Math.floor(Math.log10(e/t)),r=Math.pow(10,n),a=[1,2,5,10],o=a.map(s=>e/(r*s)).findIndex(s=>s<t);return o===3?{step:1,scale:n+1}:{step:a[o],scale:n}},gH=e=>{const{datamin:t,datamax:n,userSpecifiedZoom:r}=e;let{pixelHeight:a}=e;a<=1&&(a=1);const i=r??1;return _.useMemo(()=>{if(t===void 0||n===void 0||t===n)return mC;const o=t/i,s=n/i,l=s-o,u=a/uH,c=a/lH,f=pH(l,c),d=f.step*Math.pow(10,f.scale);if(l/d<u)return console.warn("Error: Unable to compute valid y-axis step size. Suppressing display."),mC;const h=dH(o,f.scale);return{ticks:mH(h,o,s,d,f.scale),datamin:o,datamax:s}},[n,t,i,a])},vH=e=>{const t=Math.round(e*1e3),n=Math.floor(t/(1e3*60*60)),r=Math.floor(t%(1e3*60*60)/(1e3*60)),a=Math.floor(t%(1e3*60)/1e3),i=t%1e3;return`${n.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}.${i.toString().padStart(3,"0")}`},yH=({width:e,height:t,interactionMode:n,onInteractionModeChange:r,currentTime:a,onZoomToFit:i})=>{const{zoomTimeseriesSelection:o,panTimeseriesSelection:s}=u0(),l=_.useCallback(()=>{o("in",1.2)},[o]),u=_.useCallback(()=>{o("out",1.2)},[o]),c=_.useCallback(()=>{s("back",10)},[s]),f=_.useCallback(()=>{s("forward",10)},[s]),d=_.useCallback(h=>{r(h)},[r]);return F.jsxs("div",{style:{width:e,height:t,backgroundColor:"#f8f9fa",borderTop:"1px solid #dee2e6",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 12px",fontSize:"13px",fontFamily:"system-ui, -apple-system, sans-serif"},children:[F.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[F.jsx("button",{onClick:()=>d("pan"),style:{padding:"4px 8px",border:"1px solid #ced4da",borderRadius:"4px",backgroundColor:n==="pan"?"#007bff":"#ffffff",color:n==="pan"?"#ffffff":"#495057",cursor:"pointer",fontSize:"12px",fontWeight:"500",transition:"all 0.15s ease"},title:"Pan mode: Drag to pan, wheel to zoom",children:"🖱️ Pan"}),F.jsx("button",{onClick:()=>d("select-zoom"),style:{padding:"4px 8px",border:"1px solid #ced4da",borderRadius:"4px",backgroundColor:n==="select-zoom"?"#007bff":"#ffffff",color:n==="select-zoom"?"#ffffff":"#495057",cursor:"pointer",fontSize:"12px",fontWeight:"500",transition:"all 0.15s ease"},title:"Select zoom mode: Drag to select region and zoom in",children:"🔍 Select"})]}),F.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[F.jsx("button",{onClick:c,style:{padding:"6px 10px",border:"1px solid #ced4da",borderRadius:"4px",backgroundColor:"#ffffff",color:"#495057",cursor:"pointer",fontSize:"12px",fontWeight:"500",transition:"all 0.15s ease",display:"flex",alignItems:"center",gap:"4px"},title:"Pan left",onMouseEnter:h=>{h.currentTarget.style.backgroundColor="#e9ecef"},onMouseLeave:h=>{h.currentTarget.style.backgroundColor="#ffffff"},children:"⬅️"}),F.jsx("button",{onClick:u,style:{padding:"6px 10px",border:"1px solid #ced4da",borderRadius:"4px",backgroundColor:"#ffffff",color:"#495057",cursor:"pointer",fontSize:"12px",fontWeight:"500",transition:"all 0.15s ease",display:"flex",alignItems:"center",gap:"4px"},title:"Zoom out",onMouseEnter:h=>{h.currentTarget.style.backgroundColor="#e9ecef"},onMouseLeave:h=>{h.currentTarget.style.backgroundColor="#ffffff"},children:"🔍➖"}),F.jsx("button",{onClick:l,style:{padding:"6px 10px",border:"1px solid #ced4da",borderRadius:"4px",backgroundColor:"#ffffff",color:"#495057",cursor:"pointer",fontSize:"12px",fontWeight:"500",transition:"all 0.15s ease",display:"flex",alignItems:"center",gap:"4px"},title:"Zoom in",onMouseEnter:h=>{h.currentTarget.style.backgroundColor="#e9ecef"},onMouseLeave:h=>{h.currentTarget.style.backgroundColor="#ffffff"},children:"🔍➕"}),F.jsx("button",{onClick:f,style:{padding:"6px 10px",border:"1px solid #ced4da",borderRadius:"4px",backgroundColor:"#ffffff",color:"#495057",cursor:"pointer",fontSize:"12px",fontWeight:"500",transition:"all 0.15s ease",display:"flex",alignItems:"center",gap:"4px"},title:"Pan right",onMouseEnter:h=>{h.currentTarget.style.backgroundColor="#e9ecef"},onMouseLeave:h=>{h.currentTarget.style.backgroundColor="#ffffff"},children:"➡️"}),F.jsx("div",{style:{width:"1px",height:"20px",backgroundColor:"#dee2e6",margin:"0 4px"}}),F.jsx("button",{onClick:i,style:{padding:"6px 10px",border:"1px solid #ced4da",borderRadius:"4px",backgroundColor:"#ffffff",color:"#495057",cursor:"pointer",fontSize:"12px",fontWeight:"500",transition:"all 0.15s ease",display:"flex",alignItems:"center",gap:"4px"},title:"Reset zoom to show all data",onMouseEnter:h=>{h.currentTarget.style.backgroundColor="#e9ecef"},onMouseLeave:h=>{h.currentTarget.style.backgroundColor="#ffffff"},children:"🏠"})]}),F.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[F.jsx("span",{style:{color:"#6c757d",fontWeight:"500"},children:"Time:"}),F.jsx("span",{style:{padding:"4px 8px",backgroundColor:"#e9ecef",borderRadius:"4px",fontFamily:"Monaco, Consolas, monospace",fontSize:"12px",fontWeight:"600",color:"#495057",minWidth:"120px",textAlign:"center"},children:a!==void 0?vH(a):"--:--:--.---"})]})]})},bH=({width:e,height:t,customActions:n})=>!n||n.length===0?null:F.jsx("div",{style:{width:e,height:t,backgroundColor:"#f8f9fa",borderTop:"1px solid #dee2e6",display:"flex",alignItems:"center",justifyContent:"flex-start",padding:"0 12px",fontSize:"13px",fontFamily:"system-ui, -apple-system, sans-serif"},children:F.jsx("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:n.map(r=>r.component?F.jsx("div",{style:{display:"flex",alignItems:"center"},children:r.component},r.id):F.jsxs("button",{onClick:r.onClick,style:{padding:"4px 8px",border:"1px solid #ced4da",borderRadius:"4px",backgroundColor:r.isActive?"#007bff":"#ffffff",color:r.isActive?"#ffffff":"#495057",cursor:r.onClick?"pointer":"default",fontSize:"12px",fontWeight:"500",transition:"all 0.15s ease",display:"flex",alignItems:"center",gap:"4px"},title:r.tooltip||r.label,onMouseEnter:a=>{!r.isActive&&r.onClick&&(a.currentTarget.style.backgroundColor="#e9ecef")},onMouseLeave:a=>{!r.isActive&&r.onClick&&(a.currentTarget.style.backgroundColor="#ffffff")},children:[r.icon&&F.jsx("span",{children:r.icon}),r.label]},r.id))})}),DH=e=>{if(!e||!e.current)return;e.current.querySelectorAll("canvas").forEach(n=>{n.addEventListener("wheel",r=>{r.preventDefault()})})},pC=({width:e,height:t,onCanvasElement:n,gridlineOpts:r,onKeyDown:a,onMouseDown:i,onMouseMove:o,onMouseOut:s,onMouseUp:l,yAxisInfo:u,shiftZoom:c,requireClickToZoom:f,leftMargin:d,customToolbarActions:h,onCanvasClick:g,hideNavToolbar:m=!1,hideTimeAxisLabels:D=!1})=>{const{visibleStartTimeSec:p,visibleEndTimeSec:v,zoomTimeseriesSelection:y,panTimeseriesSelection:w,setVisibleTimeRange:E}=u0(),{currentTime:b,setCurrentTime:S,startTimeSec:A,endTimeSec:C}=l0(),T=_.useMemo(()=>[p,v],[p,v]),{margins:M,canvasWidth:x,canvasHeight:N}=sH({width:e,height:t,leftMargin:d,customToolbarActions:h,hideNavToolbar:m}),O=_.useMemo(()=>p===void 0||v===void 0?()=>0:v<=p?()=>0:R=>M.left+(R-p)/(v-p)*(x-M.left-M.right),[x,p,v,M]),z=_.useMemo(()=>p===void 0||v===void 0?()=>0:v<=p?()=>0:R=>p+(R-M.left)/(x-M.left-M.right)*(v-p),[x,p,v,M]),B=_.useMemo(()=>{const R=u?.yMin||0,I=u?.yMax||0;return I<=R?()=>0:H=>N-M.bottom-(H-R)/(I-R)*(N-M.top-M.bottom)},[u,N,M]),k=Xj(x,p,v,O),$=gH({datamin:u?.yMin||0,datamax:u?.yMax||0,pixelHeight:N-M.left-M.right}),U=_.useMemo(()=>({datamin:$.datamin,datamax:$.datamax,ticks:$.ticks.map(R=>({...R,pixelValue:B(R.dataValue)}))}),[$,B]),Y=N,X=_.useMemo(()=>F.jsx(nH,{width:x,height:Y,timeRange:T,margins:M,timeTicks:k,yTickSet:u?.showTicks?U:void 0,yLabel:u?.yLabel,gridlineOpts:r,hideTimeAxisLabels:D}),[r,x,Y,T,M,k,u?.showTicks,u?.yLabel,U]),P=_.useMemo(()=>b!==void 0?O(b):void 0,[b,O]),G=_.useMemo(()=>F.jsx(aH,{width:x,height:Y,timeRange:T,margins:M,currentTimePixels:P}),[x,Y,T,M,P]),q=_.useRef(null),[L,j]=_.useState("pan"),{isViewClicked:V,hoverTime:te,selectionRect:ee,handleMouseDown:ne,handleMouseUp:se,handleMouseMove:W,handleMouseOut:de}=oH({pixelToTime:z,visibleStartTimeSec:p,setCurrentTime:S,onMouseDown:i,onMouseUp:l,onMouseMove:o,onMouseOut:s,onCanvasClick:g,interactionMode:L});_.useEffect(()=>{(f===!1||V)&&DH(q)},[f,V]);const me=_.useCallback(R=>{if(c&&!R.shiftKey||R.deltaY===0||f!==!1&&!V)return;const I=-R.deltaY/100;y(I>0?"in":"out",1.2,te)},[c,y,te,f,V]),be=_.useCallback(R=>{R.key==="="?y("in"):R.key==="-"?y("out"):R.key==="ArrowRight"?w("forward"):R.key==="ArrowLeft"&&w("back"),a&&a(R)},[a,y,w]),xe=_.useCallback(()=>{A!==void 0&&C!==void 0&&E(A,C)},[A,C,E]),Ee=_.useMemo(()=>F.jsx(iH,{width:x,height:Y,selectionRect:ee}),[x,Y,ee]),[Te,He]=_.useState(null);_.useEffect(()=>{Te&&n(Te,x,N,M)},[Te,x,N,M]);const Be=_.useMemo(()=>F.jsxs("div",{style:{position:"relative",overflow:"hidden",width:x,height:Y},onWheel:!f||V?me:void 0,onMouseDown:ne,onMouseUp:se,onMouseMove:W,onMouseOut:de,tabIndex:0,onKeyDown:be,children:[X,F.jsx("canvas",{style:{position:"absolute",width:x,height:Y},ref:R=>He(R),width:x,height:Y}),G,Ee]}),[n,X,G,Ee,x,Y,be,me,ne,se,W,de,f,V]),Pe=_.useMemo(()=>F.jsx(yH,{width:e,height:40,interactionMode:L,onInteractionModeChange:j,currentTime:b,onZoomToFit:xe}),[e,L,j,b,xe]),ve=_.useMemo(()=>F.jsx(bH,{width:e,height:40,customActions:h}),[e,h]);return F.jsxs("div",{className:"time-scroll-view-3",ref:q,style:{position:"absolute",width:e,height:t,background:"white"},children:[Be,!m&&F.jsxs("div",{style:{position:"absolute",bottom:0,left:0,right:0},children:[Pe,ve]})]})},gC=15,SH={hideX:!1,hideY:!0},wH={showTicks:!1,yMin:void 0,yMax:void 0},xH=({dataClient:e,width:t,height:n})=>{const{visibleStartTimeSec:r,visibleEndTimeSec:a}=u0(),{initializeTimeseriesSelection:i}=l0(),{selectedUnitIds:o,unitIdSelectionDispatch:s}=ri(),[l,u]=_.useState(void 0),c=_.useRef(null),[f,d]=_.useState(null),[h,g]=_.useState(null),[m,D]=_.useState(!1),[p,v]=_.useState(null),[y,w]=_.useState(null),E=_.useMemo(()=>r===void 0||a===void 0?"raster":a-r>120?"heatmap":"raster",[r,a]),b=e.metadata.unitIds;_.useEffect(()=>{e.metadata&&i({startTimeSec:e.metadata.startTimeSec,endTimeSec:e.metadata.endTimeSec,initialVisibleStartTimeSec:e.metadata.startTimeSec,initialVisibleEndTimeSec:e.metadata.endTimeSec})},[i,e.metadata]),_.useEffect(()=>{let q=!1;const L=async()=>{if(!(r===void 0||a===void 0))try{if(E==="raster"){const j=await e.getDataForRange({startTimeSec:r,endTimeSec:a});if(q)return;g(j),w(null)}else{const j=e.getSpikeCountsForRange({startTimeSec:r,endTimeSec:a});if(q)return;w(j),g(null)}v(null)}catch(j){if(q)return;console.error("Error loading data:",j),v(`Error loading data: ${j}`)}};return D(!0),L().finally(()=>{q||D(!1)}),()=>{q=!0}},[e,r,a,E]);const{onlyShowSelected:S,customToolbarActions:A}=dC(),[C,T]=_.useState(t),[M,x]=_.useState(n),[N,O]=_.useState(null),z=_.useCallback(()=>{if(!N||!c.current||!f||!y||!e.metadata||r===void 0||a===void 0)return;if(f.clearRect(0,0,C,M),m&&(f.fillStyle="rgba(0, 0, 0, 0.02)",f.fillRect(0,0,C,M),f.fillStyle="black",f.font="16px Arial",f.textAlign="center",f.fillText("Loading...",C/2,M/2)),p){f.fillStyle="rgba(255, 0, 0, 0.1)",f.fillRect(0,0,C,M),f.fillStyle="red",f.font="14px Arial",f.textAlign="center",f.fillText(p,C/2,M/2);return}const L=M-N.top-N.bottom,j=C-N.left-N.right,V=a-r;let te;if(S){let se=0;b.forEach((W,de)=>{o.has(W)&&se++}),te=se}else b.forEach((se,W)=>{}),te=b.length;const ee=L/(te||1);f.save(),f.beginPath(),f.rect(N.left,N.top,j,L),f.clip();let ne=1;if(y.counts.forEach(se=>{S?B.forEach(W=>{const de=se[W];de>ne&&(ne=de)}):se.forEach(W=>{W>ne&&(ne=W)})}),y.counts.forEach((se,W)=>{const de=y.binEdges[W],me=y.binEdges[W+1],be=N.left+(de-r)/V*j,xe=N.left+(me-r)/V*j;if(S)for(let Ee=0;Ee<B.length;Ee++){const Te=B[Ee],Be=se[Te]/ne,Pe=N.top+(B.length-1-Ee)*ee,ve=vC(Be);f.fillStyle=ve,f.fillRect(be,Pe,xe-be+.5,ee)}else se.forEach((Ee,Te)=>{const He=Ee/ne,Be=N.top+(b.length-1-Te)*ee,Pe=vC(He);f.fillStyle=Pe,f.fillRect(be,Be,xe-be+.5,ee)})}),f.restore(),ee>=gC){f.globalAlpha=1;const se=S?k:b;se.forEach((W,de)=>{const be=N.top+(se.length-1-de)*ee+ee/2,xe=gp($t(W));f.fillStyle=xe,f.font="12px Arial",f.textAlign="right",f.fillText(`Unit ${W}`,N.left-5,be)})}},[C,M,N,y,r,a,e.metadata,m,p,f,o,S]),B=_.useMemo(()=>{const q=[];return S&&b.forEach((L,j)=>{o.has(L)&&q.push(j)}),q},[S,o,b]),k=_.useMemo(()=>B.map(q=>b[q]),[B,b]);console.log(o,B,k);const $=_.useCallback(()=>{if(!N||!c.current||!f||!h||!e.metadata||r===void 0||a===void 0)return;if(f.clearRect(0,0,C,M),m&&(f.fillStyle="rgba(0, 0, 0, 0.02)",f.fillRect(0,0,C,M),f.fillStyle="black",f.font="16px Arial",f.textAlign="center",f.fillText("Loading...",C/2,M/2)),p){f.fillStyle="rgba(255, 0, 0, 0.1)",f.fillRect(0,0,C,M),f.fillStyle="red",f.font="14px Arial",f.textAlign="center",f.fillText(p,C/2,M/2);return}const L=M-N.top-N.bottom,j=C-N.left-N.right,V=a-r,te=e.metadata.unitIds,ee={};let ne;if(S){for(let W=0;W<B.length;W++){const de=B[W];ee[de]=W}ne=B.length}else te.forEach((W,de)=>{ee[de]=de}),ne=te.length;const se=L/(ne||1);f.save(),f.beginPath(),f.rect(N.left,N.top,j,L),f.clip();for(let W=0;W<h.timestamps.length;W++){const de=h.timestamps[W],me=ee[h.unitIndices[W]];if(me===void 0)continue;const be=te[h.unitIndices[W]],xe=N.top+(ne-1-me)*se+se/2,Ee=gp($t(be)),Te=l===be,He=o.has(be);f.strokeStyle=Ee,f.lineWidth=Te||He?2:1,f.globalAlpha=He?1:Te?.8:.6;const Be=N.left+(de-r)/V*j;f.beginPath(),f.moveTo(Be,xe-se*.4),f.lineTo(Be,xe+se*.4),f.stroke()}if(f.restore(),se>=gC){f.globalAlpha=1;const W=S?k:te;W.forEach((de,me)=>{const xe=N.top+(W.length-1-me)*se+se/2,Ee=gp($t(de));f.fillStyle=Ee,f.font="12px Arial",f.textAlign="right",f.fillText(`Unit ${de}`,N.left-5,xe)})}},[C,M,N,h,r,a,l,e.metadata,m,p,f,o,S]);_.useEffect(()=>{E==="heatmap"&&y?z():$()},[$,z,E,y]);const U=_.useCallback(()=>{},[]),Y=_.useCallback(q=>{if(!N||!e.metadata)return;const L=e.metadata.unitIds,j=L.length,V=1-(q.y-N.top)/(M-N.top-N.bottom),te=Math.round(V*j-.5);if(0<=te&&te<j)return L[te]},[M,N,e.metadata]),X=_.useCallback(q=>{const L=q.currentTarget.getBoundingClientRect(),j={x:q.clientX-L.x,y:q.clientY-L.y},V=Y(j);q.shiftKey||q.ctrlKey?s({type:"TOGGLE_UNIT",targetUnit:V}):s({type:"UNIQUE_SELECT",targetUnit:V})},[Y,s]),P=_.useCallback(q=>{const L=q.currentTarget.getBoundingClientRect(),j={x:q.clientX-L.x,y:q.clientY-L.y},V=Y(j);V!==void 0&&u(V)},[Y]),G=_.useCallback(()=>{u(void 0)},[]);return e.metadata?F.jsx(pC,{width:t,height:n,customToolbarActions:A,onCanvasElement:(q,L,j,V)=>{c.current=q;const te=q?.getContext("2d");d(te),T(L),x(j),O(V)},gridlineOpts:SH,onKeyDown:U,onMouseDown:X,onMouseMove:P,onMouseOut:G,yAxisInfo:wH}):F.jsx("div",{children:"Loading metadata..."})},vC=e=>{if(e===0)return"rgb(255,255,255)";const t=Math.max(0,Math.min(1,.7*(1-e))),n=Math.round(t*255);return`rgb(${n}, ${n}, ${n})`};class k1{constructor(t,n,r,a,i,o){this.zarrGroup=t,this.metadata=n,this.referenceTimes=r,this.referenceIndices=a,this.counts2dArray=i,this.binEdges=o,this.zarrGroup=t}static async create(t){const n={startTimeSec:t.attrs.start_time_sec,endTimeSec:t.attrs.end_time_sec,unitIds:t.attrs.unit_ids||[],totalSpikes:t.attrs.total_spikes||0},r=await t.getDatasetData("reference_times",{}),a=await t.getDatasetData("reference_indices",{});if(!r||!a)throw new Error(`Reference arrays not found in Zarr group: ${t.path}`);const i=await t.getDatasetData("spike_counts_1sec",{}).catch(()=>{});if(!i)throw new Error(`Spike counts data not found in Zarr group: ${t.path}`);const o=Math.ceil(n.endTimeSec-n.startTimeSec),s=n.unitIds.length,l=Array(o);for(let f=0;f<o;f++){l[f]=Array(s);for(let d=0;d<s;d++){const h=f*s+d;l[f][d]=h<i.length?i[h]:0}}const u=Array(o+1);for(let f=0;f<=o;f++)u[f]=n.startTimeSec+f;return new k1(t,n,r,a,l,u)}async getDataForRange(t){const n=this.findStartIndex(this.referenceTimes,this.referenceIndices,t.startTimeSec),r=this.findEndIndex(this.referenceTimes,this.referenceIndices,t.endTimeSec);if(n>=r)return{timestamps:[],unitIndices:[]};const a=await this.zarrGroup.getDatasetData("timestamps",{slice:[[n,r]]}),i=await this.zarrGroup.getDatasetData("unit_indices",{slice:[[n,r]]});return{timestamps:Array.from(a),unitIndices:Array.from(i)}}findStartIndex(t,n,r){let a=0;for(;a+1<t.length&&t[a+1]<r;)a++;return n[a]}getSpikeCountsForRange(t){const{startTimeSec:n,endTimeSec:r}=t,a=Math.floor(n-this.metadata.startTimeSec),i=Math.ceil(r-this.metadata.startTimeSec);let o=1;for(;(i-a)/o>500;)o+=1;const s=this.counts2dArray.slice(a,i),l=this.binEdges.slice(a,i+1);if(o===1)return{binEdges:l,counts:s};{const u=[],c=[];for(let f=0;f<s.length;f+=o){const d=Array(this.metadata.unitIds.length).fill(0);for(let h=0;h<o;h++)if(f+h<s.length)for(let g=0;g<d.length;g++)d[g]+=s[f+h][g];u.push(d),c.push(l[f])}return l.length>0&&c.push(l[Math.min(l.length-1,c.length*o)]),{binEdges:c,counts:u}}}findEndIndex(t,n,r){let a=t.length-1;for(;a-1>=0&&t[a-1]>r;)a--;return n[a]}}const EH=({zarrGroup:e,contexts:t,width:n,height:r})=>{const a=AH(e);return a?F.jsx(yC,{context:t.timeseriesSelection,children:F.jsx(bi,{context:t.unitSelection,children:F.jsx(xH,{dataClient:a,width:n,height:r})})}):null},yC=({context:e,children:t})=>{const{state:n,dispatch:r}=Yg(e);return r?F.jsx(fC.Provider,{value:{timeseriesSelection:n,dispatch:r},children:t}):F.jsx(F.Fragment,{children:"Waiting for context..."})},AH=e=>{const[t,n]=_.useState(null);return _.useEffect(()=>{let r=!0;return k1.create(e).then(a=>{r&&n(a)}),()=>{r=!1}},[e]),t},CH=({dataClient:e,width:t,height:n})=>{const{selectedUnitIds:r,unitIdSelectionDispatch:a}=ri(),{initializeTimeseriesSelection:i,visibleStartTimeSec:o,visibleEndTimeSec:s}=l0(),[l,u]=_.useState(null),[c,f]=_.useState(null),[d,h]=_.useState(!1),[g,m]=_.useState(null),D=gu,{onlyShowSelected:p,customToolbarActions:v}=dC(),[y,w]=_.useState(t),[E,b]=_.useState(n),[S,A]=_.useState(null),C=e.metadata;_.useEffect(()=>{C&&a({type:Wo,newUnitOrder:Pr(C.unitIds)})},[C,a]),_.useEffect(()=>{C&&i({startTimeSec:C.startTimeSec,endTimeSec:C.endTimeSec,initialVisibleStartTimeSec:C.startTimeSec,initialVisibleEndTimeSec:C.endTimeSec})},[i,C]),_.useEffect(()=>{let x=!1;const N=async()=>{if(o!==void 0&&s!==void 0){let O=1e4;for(;;){const z=await e.getDataForRange({startTimeSec:o,endTimeSec:s},{maxNumEvents:O});if(x)return;if(z&&f(z),z.subsampleFactor>1){if(O===1e6)break;O=Math.max(O*3,z.timestamps.length*3),O>1e6&&(O=1e6)}else break}}};return h(!0),m(null),N().catch(O=>{x||m(`Failed to load data: ${O}`),m(`Failed to load data: ${O}`)}).finally(()=>{h(!1)}),()=>{x=!0}},[o,s,e]);const T=_.useMemo(()=>{if(!c||!C||c.amplitudes.length===0)return{yMin:0,yMax:10};let x=1/0,N=-1/0;for(let z=0;z<c.amplitudes.length;z++){const B=C.unitIds[c.unitIndices[z]];if(p?r.has(B):!0){const $=c.amplitudes[z];$<x&&(x=$),$>N&&(N=$)}}if(x===1/0)return{yMin:0,yMax:10};const O=(N-x)*.1;return{yMin:x-O,yMax:N+O}},[c,C,p,r]);_.useEffect(()=>{if(!l||!c||!C||!S||s===void 0||o===void 0)return;let x=!1;return(async()=>{if(x)return;if(l.clearRect(0,0,y,E),d&&(l.fillStyle="rgba(0, 0, 0, 0.1)",l.fillRect(0,0,y,E),l.fillStyle="black",l.font="16px Arial",l.textAlign="center",l.fillText("Loading...",y/2,E/2)),g){l.fillStyle="rgba(255, 0, 0, 0.1)",l.fillRect(0,0,y,E),l.fillStyle="red",l.font="14px Arial",l.textAlign="center",l.fillText(g,y/2,E/2);return}l.save(),l.beginPath(),l.rect(S.left,S.top,y-S.left-S.right,E-S.top-S.bottom),l.clip();const O=B=>S.left+(B-o)/(s-o)*(y-S.left-S.right),z=B=>E-S.bottom-(B-T.yMin)/(T.yMax-T.yMin)*(E-S.top-S.bottom);for(let B=0;B<c.timestamps.length;B++){const k=c.timestamps[B],$=c.amplitudes[B],U=C.unitIds[c.unitIndices[B]];if(k<o||k>s||!(p?r.has(U):!0))continue;const X=Vr($t(U)),G=r.has(U)?1:.3;l.fillStyle=X,l.globalAlpha=G;const q=O(k),L=z($);l.beginPath(),l.arc(q,L,2,0,Math.PI*2),l.fill()}l.globalAlpha=1,c.subsampleFactor>1&&(l.fillStyle="#2196F3",l.font="12px Arial",l.textAlign="left",l.fillText(`Subsampled ${c.subsampleFactor}x`,S.left+10,S.top+20)),l.restore()})(),()=>{x=!0}},[l,c,C,o,s,y,E,S,T,r,p,d,g]);const M=_.useMemo(()=>({showTicks:!0,yMin:T.yMin,yMax:T.yMax,yLabel:"Amplitude"}),[T]);return C?F.jsx("div",{children:F.jsxs(Os,{width:t,height:n,initialPosition:D,adjustable:!1,children:[F.jsx(vu,{width:D,height:n}),F.jsx(pC,{width:t-D,height:n,onCanvasElement:(x,N,O,z)=>{if(!x)return;const B=x.getContext("2d");u(B),w(N),b(O),A(z)},yAxisInfo:M,customToolbarActions:v})]})}):F.jsx("div",{children:"Loading metadata..."})};class c0{constructor(t,n,r={},a,i){this.zarrGroup=t,this.metadata=n,this.subsampleClients=r,this.referenceTimes=a,this.referenceIndices=i,this.zarrGroup=t}static async create(t){const n={startTimeSec:t.attrs.start_time_sec,endTimeSec:t.attrs.end_time_sec,unitIds:t.attrs.unit_ids||[],totalSpikes:t.attrs.total_spikes||0},r={},a=t.subgroups.find(s=>s.name==="subsampled_data"),i=await t.getDatasetData("reference_times",{}),o=await t.getDatasetData("reference_indices",{});if(!i||!o)throw new Error(`Reference arrays not found in Zarr group: ${t.path}`);if(a){const s=await t.getGroup(a.name);if(!s)throw new Error(`Failed to load subsampled_data group at ${a.name} in ${t.path}`);let l=4;for(;;){const u=s.subgroups.find(d=>d.name===`factor_${l}`);if(!u)break;const c=await t.getGroup(u.name);if(!c)throw new Error(`Failed to load subsampled group at ${u.name} in ${t.path}`);const f=await c0.create(c);r[l]=f,l*=4}}return new c0(t,n,r,i,o)}async getDataForRange(t,n){const r=this.findStartIndex(this.referenceTimes,this.referenceIndices,t.startTimeSec),a=this.findEndIndex(this.referenceTimes,this.referenceIndices,t.endTimeSec);if(r>=a)return{timestamps:[],unitIndices:[],amplitudes:[],subsampleFactor:1};if(n.maxNumEvents>0&&a-r>n.maxNumEvents){let u=4;for(;u*4 in this.subsampleClients&&(a-r)/u>n.maxNumEvents;)u*=4;if(u in this.subsampleClients){const f=await this.subsampleClients[u].getDataForRange(t,{maxNumEvents:0});return f.subsampleFactor=u,f}}const i=await this.zarrGroup.getDatasetData("timestamps",{slice:[[r,a]]}),o=await this.zarrGroup.getDatasetData("unit_indices",{slice:[[r,a]]}),s=await this.zarrGroup.getDatasetData("amplitudes",{slice:[[r,a]]});return{timestamps:Array.from(i),unitIndices:Array.from(o),amplitudes:Array.from(s),subsampleFactor:1}}findStartIndex(t,n,r){let a=0;for(;a+1<t.length&&t[a+1]<r;)a++;return n[a]}findEndIndex(t,n,r){let a=t.length-1;for(;a-1>=0&&t[a-1]>r;)a--;return n[a]}}const TH=({zarrGroup:e,contexts:t,width:n,height:r})=>{const a=MH(e);return a?F.jsx(yC,{context:t.timeseriesSelection,children:F.jsx(bi,{context:t.unitSelection,children:F.jsx(CH,{dataClient:a,width:n,height:r})})}):null},MH=e=>{const[t,n]=_.useState(null);return _.useEffect(()=>{let r=!0;return c0.create(e).then(a=>{r&&n(a)}),()=>{r=!1}},[e]),t},_H=25,$1=2*Math.PI,NH={maxElectrodePixelRadius:_H},I1={},Ls=8,FH=()=>({selectedElectrodeIds:[]}),BH=e=>{const{width:t,height:n,electrodes:r,units:a,disableAutoRotate:i,onlyShowSelected:o}=e,{selectedElectrodeIds:s}=FH(),{selectedUnitIds:l,unitIdSelectionDispatch:u}=ri(),{affineTransform:c,handleWheel:f}=O1(t,n,{shift:!0,alt:!1}),d=_.useMemo(()=>new Set([...l]),[l]),h=a.filter(k=>o?d.has(k.unitId):!0).sort((k,$)=>d.has(k.unitId)&&!d.has($.unitId)?1:!d.has(k.unitId)&&d.has($.unitId)?-1:$t(k.unitId)-$t($.unitId)),g=e.maxElectrodePixelRadius||NH.maxElectrodePixelRadius,m=e.colors??Au,D=e.showLabels??!1,p=e.offsetLabels??!1,{convertedElectrodes:v,pixelRadius:y,transform:w}=_.useMemo(()=>R1(t,n,r,"geom",g,{disableAutoRotate:i}),[r,n,g,t,i]),E=Math.sqrt(B1(c)),b=_.useCallback((k,$)=>{const U=y*E,Y=v.map(X=>{const P=(s||[]).includes(X.e.id),G=!1,q=!1,L=P?q?m.draggedSelected:G?m.selectedHover:m.selected:q?m.dragged:G?m.hover:m.base;return{...X,color:L,textColor:P||G&&!q?m.textDark:m.textLight}});if(k.clearRect(0,0,k.canvas.width,k.canvas.height),Y.forEach(X=>{const P=ao(c,{x:X.pixelX,y:X.pixelY});k.fillStyle=X.color,k.beginPath(),k.ellipse(P.x,P.y,U,U,0,0,$1),k.fill()}),k.strokeStyle=Au.border,v.forEach(X=>{const P=ao(c,{x:X.pixelX,y:X.pixelY});k.beginPath(),k.ellipse(P.x,P.y,U,U,0,0,$1),k.stroke()}),D){k.font=`${U}px Arial`,k.textAlign=p?"right":"center",k.textBaseline="middle";const X=p?1.4*U:0;Y.forEach(P=>{const G=ao(c,{x:P.pixelX,y:P.pixelY});k.fillStyle=p?m.textDark:P.textColor,k.fillText(`${P.e.label}`,G.x-X,G.y)})}},[m,p,v,y,s,D,c,E]),S=_.useCallback((k,$)=>{const U=Ls;k.clearRect(0,0,k.canvas.width,k.canvas.height);const Y=(X,P,G)=>{k.fillStyle=G,k.strokeStyle="black",k.beginPath(),k.ellipse(X,P,U,U,0,0,$1),k.fill(),k.stroke()};for(let X of h){const P=Kp(w,[X.x,X.y]),G=ao(c,{x:P[0],y:P[1]}),q=l.size===0||l.has(X.unitId)?Vr($t(X.unitId)):"rgb(220, 220, 220)";Y(G.x,G.y,q)}},[w,h,l,c]),A=_.useMemo(()=>F.jsx(Er,{width:t,height:n,draw:b,drawData:I1}),[t,n,b]),C=_.useMemo(()=>F.jsx(Er,{width:t,height:n,draw:S,drawData:I1}),[t,n,S]),T=_.useCallback((k,{ctrlKey:$})=>{const U=OH(c,k),Y=B1(c),X=Ls/Math.sqrt(Y),P=[];for(let G of h){const q=Kp(w,[G.x,G.y]);Zp(f0([q[0]-X,q[1]-X,X*2,X*2]),f0(U))&&(f0([q[0]-X,q[1]-X,X*2,X*2]),P.push(G.unitId))}if($)for(let G of P)u({type:"TOGGLE_UNIT",targetUnit:G});else u({type:"SET_SELECTION",incomingSelectedUnitIds:P})},[w,u,h,c]),M=_.useCallback((k,{ctrlKey:$})=>{let U=!1;for(let Y of h){const X=Kp(w,[Y.x,Y.y]);uB(k,f0([X[0]-Ls,X[1]-Ls,Ls*2,Ls*2]))&&(U=!0,u($?{type:"TOGGLE_UNIT",targetUnit:Y.unitId}:{type:"SET_SELECTION",incomingSelectedUnitIds:[Y.unitId]}))}U||u({type:"SET_SELECTION",incomingSelectedUnitIds:[]})},[w,u,h]),{onMouseMove:x,onMouseDown:N,onMouseUp:O,paintDragSelectLayer:z}=cf(t,n,T,M),B=_.useMemo(()=>F.jsx(Er,{width:t,height:n,draw:z,drawData:I1}),[t,n,z]);return t>0&&n>0?F.jsxs("div",{style:{width:t,height:n,position:"relative"},onMouseMove:x,onMouseUp:O,onMouseDown:N,onWheel:f,children:[A,C,B]}):F.jsx("div",{})},f0=e=>({xmin:e[0],ymin:e[1],xmax:e[0]+e[2],ymax:e[1]+e[3]}),OH=(e,t)=>{const n=F1(e,{x:t[0],y:t[1]}),r=F1(e,{x:t[0]+t[2],y:t[1]+t[3]});return[n.x,n.y,r.x-n.x,r.y-n.y]},RH=e=>{const{data:t,width:n,height:r}=e,[a,i]=_.useState({...Hd,onlyShowSelected:!1}),o=30,s=Object.keys(t.channelLocations),l=vj(s,t.channelLocations),u=_.useMemo(()=>({width:n-20,height:r-o,top:0,position:"absolute"}),[n,r]);return F.jsxs("div",{children:[F.jsx("div",{style:u,children:F.jsx(BH,{width:n-20,height:r-o,electrodes:l,units:t.units,disableAutoRotate:t.disableAutoRotate,onlyShowSelected:a.onlyShowSelected})}),F.jsx("div",{style:{position:"absolute",top:r-o,height:o,overflow:"hidden"},children:F.jsx(qd,{options:a,setOptions:i})})]})},zH=({zarrGroup:e,contexts:t,width:n,height:r})=>{const[a,i]=_.useState(null),[o,s]=_.useState(null),[l,u]=_.useState(!0);return _.useEffect(()=>{let c=!1;return(async()=>{try{u(!0),s(null);const d=e.attrs.disable_auto_rotate||!1,h=e.attrs.unit_ids,g=e.attrs.channel_locations,m=await e.getDatasetData("coords",{});if(!m||m.length===0)throw new Error("Empty coords data");const D=new Float32Array(m);if(D.length!==h.length*2)throw new Error(`Expected coords length ${h.length*2}, got ${D.length}`);const p=[];for(let v=0;v<h.length;v++)p.push({unitId:h[v],x:D[v*2],y:D[v*2+1]});if(c)return;i({type:"UnitLocations",channelLocations:g,units:p,disableAutoRotate:d})}catch(d){console.error("Error loading unit locations data:",d),s(`Failed to load unit locations data: ${d instanceof Error?d.message:String(d)}`)}finally{u(!1)}})(),()=>{c=!0}},[e]),o?F.jsxs("div",{style:{width:n,height:r,display:"flex",alignItems:"center",justifyContent:"center",color:"#666",backgroundColor:"#f5f5f5"},children:["Error: ",o]}):l?F.jsx("div",{style:{width:n,height:r,display:"flex",alignItems:"center",justifyContent:"center",color:"#666",backgroundColor:"#f5f5f5"},children:"Loading unit locations data..."}):a?F.jsx(bi,{context:t.unitSelection,children:F.jsx(RH,{data:a,width:n,height:r})}):F.jsx("div",{style:{width:n,height:r,display:"flex",alignItems:"center",justifyContent:"center",color:"#666",backgroundColor:"#f5f5f5"},children:"No unit locations data available"})},kH=({rows:e,columns:t,onDeleteRow:n=void 0,deleteRowLabel:r=void 0,onEditRow:a=void 0,editRowLabel:i=void 0,selectionMode:o="none",selectedRowKeys:s=[],onSelectedRowKeysChanged:l=void 0,selectionDisabled:u})=>{const c=_.useMemo(()=>{const p={};return s.forEach(v=>{p[v]=!0}),p},[s]),[f,d]=_.useState(null),h=_.useCallback(p=>{l&&(o==="single"?!(p in c)||!c[p]?l([p+""]):l([]):o==="multiple"&&l(Object.keys(c).filter(v=>v!=p&&c[v]).concat(c[p]?[]:[p.toString()])))},[l,o,c]),g=_.useCallback(p=>{d(p)},[]),m=_.useCallback((p,v)=>{v&&n&&n(p),d(null)},[n]),D=_.useCallback(p=>{a&&a(p)},[a]);return F.jsxs(nA,{className:"NiceTable",children:[F.jsx(oA,{children:F.jsxs(jd,{children:[F.jsx(yi,{style:{width:0}},"_first"),t.map(p=>F.jsx(yi,{children:p.element?p.element:F.jsx("span",{children:p.label})},p.key))]})}),F.jsx(aA,{children:e.map(p=>F.jsxs(jd,{children:[F.jsxs(yi,{children:[n&&(f===p.key?F.jsx(IH,{title:r||"",onConfirmDeleteRow:m,rowKey:p.key}):F.jsx($H,{title:r||"",onDeleteRow:g,rowKey:p.key})),a&&F.jsx(UH,{title:i||"",onEditRow:D,rowKey:p.key}),o!=="none"&&F.jsx(Ug,{checked:c[p.key]||!1,onClick:()=>h(p.key),disabled:u})]}),t.map(v=>F.jsx(yi,{children:F.jsx("span",{children:LH(p.columnValues[v.key])})},v.key))]},p.key))})]})},$H=({title:e,rowKey:t,onDeleteRow:n})=>{const r=_.useCallback(()=>{n&&n(t)},[n,t]);return F.jsx(pu,{title:e,onClick:r,children:F.jsx(Nx,{})})},IH=({title:e,rowKey:t,onConfirmDeleteRow:n})=>{const r=_.useCallback(()=>{n&&n(t,!0)},[n,t]),a=_.useCallback(()=>{n&&n(t,!1)},[n,t]);return F.jsxs("span",{children:["Confirm delete?",F.jsx(pu,{title:e,onClick:r,children:F.jsx(Nx,{})}),F.jsx(pu,{title:"Cancel",onClick:a,children:F.jsx(LB,{})})]})},UH=({title:e,rowKey:t,onEditRow:n})=>F.jsx(pu,{title:e,onClick:()=>n&&n(t),children:F.jsx(UB,{})}),LH=e=>e==0?e:e?typeof e=="object"?e.element?e.element:e.text||"":e:"",PH=({width:e,height:t})=>{const{selectedUnitMetrics:n,allUnitMetrics:r,unitMetricSelectionDispatch:a}=qm(),i=_.useMemo(()=>[{key:"metric",label:"Metric"}],[]),o=_.useMemo(()=>(r||[]).map(l=>({key:l,columnValues:{metric:l}})),[r]),s=_.useCallback(l=>{a({type:"selectUnitMetrics",unitMetrics:l})},[a]);return F.jsx("div",{style:{position:"absolute",width:e,height:t},children:F.jsx(kH,{rows:o,columns:i,selectedRowKeys:n,onSelectedRowKeysChanged:s,selectionMode:"multiple"})})},jH=(e,t)=>{e.clearRect(0,0,t.width,t.height);for(const n of t.pixelVerticalLines||[])e.strokeStyle=n.color,e.beginPath(),e.moveTo(n.x,t.margins.top-20),e.lineTo(n.x,t.height-t.margins.bottom),e.stroke();t.barBoxes.forEach(n=>{e.fillStyle=n.color,e.fillRect(n.x1,n.y1,n.x2-n.x1,n.y2-n.y1)}),t.xLabel&&(e.textBaseline="bottom",e.textAlign="center",e.fillStyle="black",e.fillText(t.xLabel,t.width/2,t.height-3));for(const n of t.pixelTicks||[])e.strokeStyle="black",e.beginPath(),e.moveTo(n.x,t.height-t.margins.bottom),e.lineTo(n.x,t.height-t.margins.bottom+6),e.stroke(),e.textBaseline="top",e.textAlign="center",e.fillStyle="black",e.fillText(n.label,n.x,t.height-t.margins.bottom+8)},HH=e=>F.jsx(Er,{width:e.width,height:e.height,draw:jH,drawData:e}),qH={},YH=({bars:e,range:t,ticks:n,verticalLines:r,xLabel:a,onSelectRect:i,width:o,height:s})=>{const{xMin:l,xMax:u}=_.useMemo(()=>t?{xMin:t.min,xMax:t.max}:e.length>0?{xMin:e[0].xStart,xMax:e[e.length-1].xEnd}:{xMin:0,xMax:1},[e,t]),c=_.useMemo(()=>Math.max(...e.map(S=>S.height)),[e]),{barBoxes:f,margins:d,pixelTicks:h,pixelVerticalLines:g}=_.useMemo(()=>{const S={left:3,right:3,top:5,bottom:3+(a?18:0)+(n?18:0)},A=o-S.left-S.right,C=s-S.top-S.bottom,T=e.map(N=>({key:N.key,x1:S.left+(N.xStart-l)/(u-l)*A,x2:S.left+(N.xEnd-l)/(u-l)*A,y1:S.top+C*(1-N.height/c),y2:S.top+C,tooltip:N.tooltip,color:N.color})),M=n?n.map(N=>({x:S.left+(N.x-l)/(u-l)*A,label:`${N.label}`})):void 0,x=r?r.map(N=>({x:S.left+(N.x-l)/(u-l)*A,color:N.color})):void 0;return{barBoxes:T,margins:S,pixelTicks:M,pixelVerticalLines:x}},[e,n,r,l,u,c,o,s,a]),m=_.useCallback((S,{ctrlKey:A,shiftKey:C})=>{const T=[],M={x:S[0],y:S[1],width:S[2],height:S[3]};for(const z of f)z.x1<=M.x+M.width&&z.x2>=M.x&&T.push(z.key);const x=o-d.left-d.right,N=(M.x-d.left)/x*(u-l)+l,O=(M.x+M.width-d.left)/x*(u-l)+l;i&&i(M,T,{ctrlKey:A,shiftKey:C,xMin:N,xMax:O})},[f,i,d.left,d.right,o,l,u]),D=_.useCallback(()=>{},[]),{onMouseMove:p,onMouseDown:v,onMouseUp:y,onMouseLeave:w,paintDragSelectLayer:E}=cf(o,s,m,D),b=_.useMemo(()=>F.jsx(Er,{width:o,height:s,draw:E,drawData:qH}),[o,s,E]);return F.jsxs("div",{style:{width:o,height:s,position:"relative"},onMouseDown:v,onMouseMove:p,onMouseUp:y,onMouseLeave:w,children:[F.jsx(HH,{barBoxes:f,margins:d,pixelTicks:h,pixelVerticalLines:g,xLabel:a,width:o,height:s}),b]})},GH=(e,t)=>{const n=t-e;let r;n<=30?r=10:n<=120?r=20:n<=300?r=50:n<=600?r=100:n<=1e3?r=150:r=100;const a=[];let i=Math.ceil(e/r);for(;i*r<=t;)a.push(i*r),i++;return a},VH=({metric:e,metricRange:t,units:n,selectedUnitIds:r,setSelectedUnitIds:a,numBins:i,onZoomToRect:o,width:s,height:l})=>{const{bars:u,ticks:c,verticalLines:f}=_.useMemo(()=>{const h=n.map(p=>p.values[e.key]).filter(p=>p!==void 0).map(p=>p),g=n.filter(p=>r.has(p.unitId)).map(p=>p.values[e.key]).filter(p=>p!==void 0).map(p=>p),D=n.filter(p=>r.has(p.unitId)).map(p=>({unitId:p.unitId,value:p.values[e.key]})).filter(p=>p.value!==void 0).map(p=>p.unitId).map(p=>Vr($t(p)));return XH(h,g,D,i||10)},[n,e,r,i]),d=_.useCallback((h,g,{ctrlKey:m,shiftKey:D,xMin:p,xMax:v})=>{if(D){o&&o({x:p,y:h.y,width:v-p,height:h.height});return}if(g.length===0)return;const y=[];for(const S of g){const A=u[S];y.push(A)}const w=Math.min(...y.map(S=>S.xStart)),E=Math.max(...y.map(S=>S.xEnd)),b=[];for(const S of n){const A=S.values[e.key];A!==void 0&&w<=A&&A<=E&&b.push(S.unitId)}a(m||D?[...new Set([...r,...b])]:b)},[u,e,r,a,n,o]);return F.jsx(YH,{width:s,height:l,bars:u,range:t,ticks:c,verticalLines:f,onSelectRect:d})},XH=(e,t,n,r)=>{if(e.length===0)return{bars:[],ticks:[],verticalLines:[]};let a=Math.min(...e),i=Math.max(...e);if(i<=a)return{bars:[],ticks:[],verticalLines:[]};a-=(i-a)/r/2,i+=(i-a)/r/2;const o=[];for(let f=0;f<r;f++)o.push(0);for(const f of e){const d=Math.min(Math.floor((f-a)/(i-a)*r),r-1);o[d]++}const s=[];for(let f=0;f<r;f++)s.push(0);for(const f of t){const d=Math.min(Math.floor((f-a)/(i-a)*r),r-1);s[d]++}const l=[];t.forEach((f,d)=>{l.push({x:f,color:n[d]})});const c=ZH(a,i).map(f=>({x:f,label:`${f}`}));return{bars:[...o.map((f,d)=>({key:d,xStart:a+d*(i-a)/r,xEnd:a+(d+1)*(i-a)/r,height:f,tooltip:"",color:"gray"}))],ticks:c,verticalLines:l}},ZH=(e,t)=>{const n=t-e;if(n<=0)return[];let r=1;for(;n*r<100;)r*=10;for(;n*r>=1e3;)r/=10;return GH(e*r,t*r).map(a=>a/r)},KH=(e,t)=>{e.clearRect(0,0,t.width,t.height),t.markers.forEach(n=>{const r=t.coord2Pixel({x:n.x,y:n.y});e.fillStyle=n.color,e.strokeStyle="black",e.beginPath(),e.ellipse(r.x,r.y,n.radius,n.radius,0,0,2*Math.PI),e.fill(),e.stroke()})},QH=e=>F.jsx(Er,{width:e.width,height:e.height,draw:KH,drawData:e}),WH={},JH=({markers:e,xRange:t,yRange:n,onSelectRect:r,onClickPoint:a,width:i,height:o})=>{const{margins:s}=_.useMemo(()=>({margins:{left:20,right:20,top:20,bottom:20}}),[]),{xMin:l,xMax:u,yMin:c,yMax:f}=_.useMemo(()=>{let b,S,A,C;return t?(b=t.min,S=t.max):e.length>0?(b=Math.min(...e.map(T=>T.x)),S=Math.max(...e.map(T=>T.x))):(b=0,S=1),n?(A=n.min,C=n.max):e.length>0?(A=Math.min(...e.map(T=>T.y)),C=Math.max(...e.map(T=>T.y))):(A=0,C=1),{xMin:b,xMax:S,yMin:A,yMax:C}},[e,t,n]),{coord2Pixel:d,pixel2Coord:h}=_.useMemo(()=>{const b=i-s.left-s.right,S=o-s.top-s.bottom;return{coord2Pixel:T=>({x:s.left+(T.x-l)/(u-l)*b,y:s.top+(1-(T.y-c)/(f-c))*S}),pixel2Coord:T=>({x:l+(T.x-s.left)/b*(u-l),y:c+(1-(T.y-s.top)/S)*(f-c)})}},[i,o,s,l,u,c,f]),g=_.useCallback((b,{ctrlKey:S,shiftKey:A})=>{const C={x:b[0],y:b[1],width:b[2],height:b[3]},T=[];for(const x of e){const N=d({x:x.x,y:x.y}),O={xmin:N.x-x.radius,ymin:N.y-x.radius,xmax:N.x+x.radius,ymax:N.y+x.radius};Zp({xmin:C.x,xmax:C.x+C.width,ymin:C.y,ymax:C.y+C.height},O)&&T.push(x.key)}const M=eq(h,C);r&&r(M,T,{ctrlKey:S,shiftKey:A})},[r,h,e,d]),m=_.useCallback((b,{ctrlKey:S,shiftKey:A})=>{const C={x:b[0],y:b[1]},T={x:C.x,y:C.y,width:1,height:1};let M;for(const x of e){const N=d({x:x.x,y:x.y}),O={xmin:N.x-x.radius,ymin:N.y-x.radius,xmax:N.x+x.radius,ymax:N.y+x.radius};Zp({xmin:T.x,xmax:T.x+T.width,ymin:T.y,ymax:T.y+T.height},O)&&(M=x.key)}a&&a(h(C),M,{ctrlKey:S,shiftKey:A})},[d,e,a,h]),{onMouseMove:D,onMouseDown:p,onMouseUp:v,onMouseLeave:y,paintDragSelectLayer:w}=cf(i,o,g,m),E=_.useMemo(()=>F.jsx(Er,{width:i,height:o,draw:w,drawData:WH}),[i,o,w]);return F.jsxs("div",{style:{width:i,height:o,position:"relative"},onMouseDown:p,onMouseMove:D,onMouseUp:v,onMouseLeave:y,children:[F.jsx(QH,{markers:e,margins:s,coord2Pixel:d,width:i,height:o}),E]})},eq=(e,t)=>{const n=e({x:t.x,y:t.y}),r=e({x:t.x+t.width,y:t.y+t.height});return{x:Math.min(n.x,r.x),y:Math.min(n.y,r.y),width:Math.abs(r.x-n.x),height:Math.abs(r.y-n.y)}},tq=({metric1:e,metric2:t,metric1Range:n,metric2Range:r,units:a,selectedUnitIds:i,setSelectedUnitIds:o,onZoomToRect:s,width:l,height:u})=>{const f=_.useMemo(()=>{const g=[];for(const m of a){const D=m.values[e.key],p=m.values[t.key];D!==void 0&&p!==void 0&&g.push({key:m.unitId,x:D,y:p,color:i.has(m.unitId)?Vr($t(m.unitId)):"lightgray",radius:6,tooltip:`Unit ${m.unitId}`})}return g},[a,e,t,i]),d=_.useCallback((g,m,{ctrlKey:D,shiftKey:p})=>{if(p){s&&s(g);return}let v=m;D&&(v=[...new Set([...m,...i])]),o(v)},[o,i,s]),h=_.useCallback((g,m,{ctrlKey:D,shiftKey:p})=>{let v;if(D||p){const y=new Set([...i]);m!==void 0&&(y.has(m)?y.delete(m):y.add(m)),v=[...y]}else m===void 0?v=[]:v=[m];o(v)},[o,i]);return F.jsx(JH,{width:l,height:u,markers:f,xRange:n,yRange:r,onSelectRect:d,onClickPoint:h})},nq=({type:e,metric1:t,metric2:n,metric1Range:r,metric2Range:a,units:i,selectedUnitIds:o,setSelectedUnitIds:s,numHistogramBins:l,onZoomToRect:u,width:c,height:f})=>{if(e==="histogram"){if(!t)throw Error("Unexpected: metric1 not defined");return F.jsx(VH,{metric:t,metricRange:r,units:i,selectedUnitIds:o,setSelectedUnitIds:s,numBins:l,onZoomToRect:u,width:c,height:f})}else if(e==="scatter"){if(!t)throw Error("Unexpected: metric1 not defined");if(!n)throw Error("Unexpected: metric2 not defined");return F.jsx(tq,{metric1:t,metric2:n,metric1Range:r,metric2Range:a,units:i,selectedUnitIds:o,setSelectedUnitIds:s,onZoomToRect:u,width:c,height:f})}else{if(e==="bottom-label")return F.jsx("div",{style:{width:c,textAlign:"center"},children:t?.label||F.jsx("span",{children:" "})});if(e==="left-label")return F.jsx("div",{style:{width:c,height:f,overflow:"hidden",writingMode:"vertical-lr",transform:"rotate(-180deg)",textAlign:"center"},children:t?.label||F.jsx("span",{children:" "})});throw Error(`Unexpected type: ${e}`)}},rq=({data:e,width:t,height:n})=>{const{units:r,metrics:a}=e,{selectedUnitIds:i,unitIdSelectionDispatch:o}=ri(),{selectedUnitMetrics:s}=qm(),[l,u]=_.useState(1),[c,f]=_.useState(10),[d,h]=_.useState({}),g=_.useMemo(()=>r.sort((v,y)=>i.has(v.unitId)&&!i.has(y.unitId)?1:!i.has(v.unitId)&&i.has(y.unitId)?-1:$t(v.unitId)-$t(y.unitId)),[r,i]);_.useEffect(()=>{o({type:Wo,newUnitOrder:Pr(g.map(v=>v.unitId))})},[g,o]);const m=_.useMemo(()=>{const v=s.length===0?[{type:"text",content:"Box size",title:"Set box size"},{type:"button",callback:()=>u(E=>E*1.3),title:"Increase box size",icon:F.jsx(Zf,{})},{type:"button",callback:()=>u(E=>E/1.3),title:"Decrease box size",icon:F.jsx(Xf,{})}]:[],y=[{type:"text",content:"# bins",title:""},{type:"button",callback:()=>f(E=>E+5),title:"Increase num. histogram bins",icon:F.jsx(Zf,{})},{type:"button",callback:()=>f(E=>Math.max(5,E-5)),title:"Decrease num. histogram bins",icon:F.jsx(Xf,{})}],w={type:"button",callback:()=>h({}),title:"Reset zoom",text:"reset"};return[...v,{type:"divider"},...y,{type:"divider"},w]},[s.length]),D=gu,p=_.useMemo(()=>{const v=y=>{o({type:"SET_SELECTION",incomingSelectedUnitIds:y})};if(s.length===0)return a.map(y=>{const w={type:"histogram",metric1:y,metric2:y,metric1Range:d[y.key],metric2Range:d[y.key],units:g,width:400*l,height:400*l,numHistogramBins:c,selectedUnitIds:i,setSelectedUnitIds:v,onZoomToRect:b=>{h({...d,[y.key]:{min:b.x,max:b.x+b.width}})}};return{key:y.key,label:y.label,unitId:"",labelColor:"black",props:w}});{const{plotWidth:E,plotHeight:b}=uC(t-D-30-10,n-30-10,s.length),S=[];for(const A of s){const C=a.filter(T=>T.key===A)[0];{const T={type:"left-label",metric1:C,metric2:C,units:g,numHistogramBins:c,width:30,height:b,selectedUnitIds:i,setSelectedUnitIds:v};S.push({key:`left-label-${A}`,label:void 0,unitId:"",labelColor:"black",props:T,hideBorderColor:!0})}for(const T of s){const M=a.filter(x=>x.key===T)[0];if(C&&M){const x={type:A===T?"histogram":"scatter",metric1:M,metric2:C,metric1Range:d[M.key],metric2Range:d[C.key],units:g,numHistogramBins:c,width:E,height:b,selectedUnitIds:i,setSelectedUnitIds:v,onZoomToRect:N=>{h(A!==T?{...d,[M.key]:{min:N.x,max:N.x+N.width},[C.key]:{min:N.y,max:N.y+N.height}}:{...d,[C.key]:{min:N.x,max:N.x+N.width}})}};S.push({key:`${T}-${A}`,label:x.type==="histogram"?A:void 0,unitId:"",labelColor:"black",props:x})}}}{const A={type:"bottom-label",metric1:void 0,metric2:void 0,units:g,numHistogramBins:c,width:30,height:30,selectedUnitIds:i,setSelectedUnitIds:v};S.push({key:"left-bottom-label",label:void 0,unitId:"",labelColor:"black",props:A,hideBorderColor:!0})}for(const A of s){const C=a.filter(M=>M.key===A)[0],T={type:"bottom-label",metric1:C,metric2:C,units:g,numHistogramBins:c,width:E,height:30,selectedUnitIds:i,setSelectedUnitIds:v};S.push({key:`bottom-label-${A}`,label:void 0,unitId:"",labelColor:"black",props:T,hideBorderColor:!0})}return S}},[a,i,g,l,s,c,t,n,o,d,D]);return F.jsxs(Os,{width:t,height:n,initialPosition:D,adjustable:!1,children:[F.jsx(vu,{width:D,height:n,customActions:m}),F.jsx(Yf,{width:0,height:0,disableScroll:s.length>0,children:F.jsx(qf,{plots:p,plotComponent:nq,numPlotsPerRow:s.length===0?void 0:s.length+1})})]})},aq=({data:e,width:t,height:n})=>{const{metrics:r}=e,{unitMetricSelectionDispatch:a}=qm();return _.useEffect(()=>{a({type:"initialize",unitMetrics:r.map(i=>i.key)})},[r,a]),F.jsxs(Os,{width:t,height:n,initialPosition:200,adjustable:!0,children:[F.jsx(PH,{width:0,height:0}),F.jsx(rq,{data:e,width:0,height:0})]})},iq=e=>uf(e,{key:lf,label:lf,dtype:lf}),oq=e=>uf(e,{unitId:q8([H8,lf]),values:()=>!0}),sq=e=>uf(e,{type:Y8("UnitMetricsGraph"),metrics:uS(iq),units:uS(oq)}),lq=({zarrGroup:e,contexts:t,width:n,height:r})=>{const[a,i]=_.useState(null),[o,s]=_.useState(null),[l,u]=_.useState(!0);return _.useEffect(()=>{let c=!1;return(async()=>{try{u(!0),s(null);const d=e.attrs.metrics||[],h=await e.getDatasetData("units_data",{});if(!h||h.length===0)throw new Error("Empty units data");const g=new Uint8Array(h),m=new TextDecoder("utf-8").decode(g),D=JSON.parse(m);if(c)return;const p={type:"UnitMetricsGraph",metrics:d,units:D.map(v=>({unitId:v.unit_id,values:v.values}))};if(!sq(p))throw new Error("Invalid view data structure");i(p)}catch(d){console.error("Error loading unit metrics graph data:",d),s(`Failed to load unit metrics graph data: ${d instanceof Error?d.message:String(d)}`)}finally{u(!1)}})(),()=>{c=!0}},[e]),o?F.jsxs("div",{style:{width:n,height:r,display:"flex",alignItems:"center",justifyContent:"center",color:"#666",backgroundColor:"#f5f5f5"},children:["Error: ",o]}):l?F.jsx("div",{style:{width:n,height:r,display:"flex",alignItems:"center",justifyContent:"center",color:"#666",backgroundColor:"#f5f5f5"},children:"Loading unit metrics data..."}):a?F.jsx(uq,{context:t.unitMetricSelection,children:F.jsx(bi,{context:t.unitSelection,children:F.jsx(aq,{data:a,width:n,height:r})})}):F.jsx("div",{style:{width:n,height:r,display:"flex",alignItems:"center",justifyContent:"center",color:"#666",backgroundColor:"#f5f5f5"},children:"No unit metrics data available"})},uq=({context:e,children:t})=>{const{state:n,dispatch:r}=Yg(e);return r?F.jsx(sD.Provider,{value:{unitMetricSelection:n,unitMetricSelectionDispatch:r},children:t}):F.jsx(F.Fragment,{children:"Waiting for unit metric selection context..."})},bC=()=>{let e={};const t=[];return{state:e,dispatch:a=>{e=y6(e,a),t.forEach(i=>{i(e)})},onChange:a=>(t.push(a),()=>{const i=t.indexOf(a);i>=0&&t.splice(i,1)}),createNew:bC}},DC=()=>{let e=vD;const t=[];return{state:e,dispatch:a=>{e=q6(e,a),t.forEach(i=>{i(e)})},onChange:a=>(t.push(a),()=>{const i=t.indexOf(a);i>=0&&t.splice(i,1)}),createNew:DC}},cq=({zarrGroup:e,width:t,height:n,onResize:r,contexts:a,component:i})=>{const[o,s]=_.useState(t),[l,u]=_.useState(n);return _.useEffect(()=>{r((c,f)=>{s(c),u(f)})},[r]),F.jsx(i,{zarrGroup:e,width:o,height:l,contexts:a})},fq=e=>t=>{const{container:n,zarrGroup:r,width:a,height:i,onResize:o,contexts:s}=t;v6.createRoot(n).render(F.jsx(cq,{zarrGroup:r,width:a,height:i,onResize:o,contexts:s,component:e}))};(()=>{const e=[{name:"spike_sorting.Autocorrelograms",component:DI},{name:"spike_sorting.AverageWaveforms",component:Uj},{name:"spike_sorting.CrossCorrelograms",component:jj},{name:"spike_sorting.RasterPlot",component:EH},{name:"spike_sorting.SpikeAmplitudes",component:TH},{name:"spike_sorting.UnitLocations",component:zH},{name:"spike_sorting.UnitMetricsGraph",component:lq},{name:"spike_sorting.UnitsTable",component:sj}],t=window.figpack_p1.registerFPViewComponent;for(const a of e)t({name:a.name,render:fq(a.component)});const n=window.figpack_p1.registerFPViewContextCreator;n({name:"unitSelection",create:DC}),n({name:"unitMetricSelection",create:bC});const r=window.figpack_p1.registerFPExtension;r({name:"figpack-spike-sorting"})})()})();
185
+ `,_B=typeof zm!="string"?sm`
186
+ animation: ${zm} 1.4s linear infinite;
187
+ `:null,BB=typeof Um!="string"?sm`
188
+ animation: ${Um} 1.4s ease-in-out infinite;
189
+ `:null,FB=e=>{const{classes:t,variant:n,color:r,disableShrink:i}=e,a={root:["root",n,`color${Ue(r)}`],svg:["svg"],circle:["circle",`circle${Ue(n)}`,i&&"circleDisableShrink"]};return Un(a,MB,t)},NB=wt("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`color${Ue(n.color)}`]]}})(In(({theme:e})=>({display:"inline-block",variants:[{props:{variant:"determinate"},style:{transition:e.transitions.create("transform")}},{props:{variant:"indeterminate"},style:_B||{animation:`${zm} 1.4s linear infinite`}},...Object.entries(e.palette).filter(No()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}}))]}))),RB=wt("svg",{name:"MuiCircularProgress",slot:"Svg"})({display:"block"}),OB=wt("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.circle,t[`circle${Ue(n.variant)}`],n.disableShrink&&t.circleDisableShrink]}})(In(({theme:e})=>({stroke:"currentColor",variants:[{props:{variant:"determinate"},style:{transition:e.transitions.create("stroke-dashoffset")}},{props:{variant:"indeterminate"},style:{strokeDasharray:"80px, 200px",strokeDashoffset:0}},{props:({ownerState:t})=>t.variant==="indeterminate"&&!t.disableShrink,style:BB||{animation:`${Um} 1.4s ease-in-out infinite`}}]}))),zB=M.forwardRef(function(t,n){const r=$n({props:t,name:"MuiCircularProgress"}),{className:i,color:a="primary",disableShrink:o=!1,size:u=40,style:l,thickness:s=3.6,value:c=0,variant:f="indeterminate",...d}=r,h={...r,color:a,disableShrink:o,size:u,thickness:s,value:c,variant:f},v=FB(h),m={},D={},p={};if(f==="determinate"){const g=2*Math.PI*((Ui-s)/2);m.strokeDasharray=g.toFixed(3),p["aria-valuenow"]=Math.round(c),m.strokeDashoffset=`${((100-c)/100*g).toFixed(3)}px`,D.transform="rotate(-90deg)"}return B.jsx(NB,{className:at(v.root,i),style:{width:u,height:u,...D,...l},ownerState:h,ref:n,role:"progressbar",...p,...d,children:B.jsx(RB,{className:v.svg,ownerState:h,viewBox:`${Ui/2} ${Ui/2} ${Ui} ${Ui}`,children:B.jsx(OB,{className:v.circle,style:m,ownerState:h,cx:Ui,cy:Ui,r:(Ui-s)/2,fill:"none",strokeWidth:s})})})});function UB(e){return yn("MuiIconButton",e)}const cS=bn("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge","loading","loadingIndicator","loadingWrapper"]),IB=e=>{const{classes:t,disabled:n,color:r,edge:i,size:a,loading:o}=e,u={root:["root",o&&"loading",n&&"disabled",r!=="default"&&`color${Ue(r)}`,i&&`edge${Ue(i)}`,`size${Ue(a)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]};return Un(u,UB,t)},$B=wt(sS,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.loading&&t.loading,n.color!=="default"&&t[`color${Ue(n.color)}`],n.edge&&t[`edge${Ue(n.edge)}`],t[`size${Ue(n.size)}`]]}})(In(({theme:e})=>({textAlign:"center",flex:"0 0 auto",fontSize:e.typography.pxToRem(24),padding:8,borderRadius:"50%",color:(e.vars||e).palette.action.active,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),variants:[{props:t=>!t.disableRipple,style:{"--IconButton-hoverBg":e.alpha((e.vars||e).palette.action.active,(e.vars||e).palette.action.hoverOpacity),"&:hover":{backgroundColor:"var(--IconButton-hoverBg)","@media (hover: none)":{backgroundColor:"transparent"}}}},{props:{edge:"start"},style:{marginLeft:-12}},{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:{edge:"end"},style:{marginRight:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}}]})),In(({theme:e})=>({variants:[{props:{color:"inherit"},style:{color:"inherit"}},...Object.entries(e.palette).filter(No()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),...Object.entries(e.palette).filter(No()).map(([t])=>({props:{color:t},style:{"--IconButton-hoverBg":e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity)}})),{props:{size:"small"},style:{padding:5,fontSize:e.typography.pxToRem(18)}},{props:{size:"large"},style:{padding:12,fontSize:e.typography.pxToRem(28)}}],[`&.${cS.disabled}`]:{backgroundColor:"transparent",color:(e.vars||e).palette.action.disabled},[`&.${cS.loading}`]:{color:"transparent"}}))),kB=wt("span",{name:"MuiIconButton",slot:"LoadingIndicator"})(({theme:e})=>({display:"none",position:"absolute",visibility:"visible",top:"50%",left:"50%",transform:"translate(-50%, -50%)",color:(e.vars||e).palette.action.disabled,variants:[{props:{loading:!0},style:{display:"flex"}}]})),cl=M.forwardRef(function(t,n){const r=$n({props:t,name:"MuiIconButton"}),{edge:i=!1,children:a,className:o,color:u="default",disabled:l=!1,disableFocusRipple:s=!1,size:c="medium",id:f,loading:d=null,loadingIndicator:h,...v}=r,m=t9(f),D=h??B.jsx(zB,{"aria-labelledby":m,color:"inherit",size:16}),p={...r,edge:i,color:u,disabled:l,disableFocusRipple:s,loading:d,loadingIndicator:D,size:c},g=IB(p);return B.jsxs($B,{id:d?m:f,className:at(g.root,o),centerRipple:!0,focusRipple:!s,disabled:l||d,ref:n,...v,ownerState:p,children:[typeof d=="boolean"&&B.jsx("span",{className:g.loadingWrapper,style:{display:"contents"},children:B.jsx(kB,{className:g.loadingIndicator,ownerState:p,children:d&&D})}),a]})});function LB({props:e,states:t,muiFormControl:n}){return t.reduce((r,i)=>(r[i]=e[i],n&&typeof e[i]>"u"&&(r[i]=n[i]),r),{})}const jB=M.createContext(void 0);function fS(){return M.useContext(jB)}function HB(e){return yn("PrivateSwitchBase",e)}bn("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const PB=e=>{const{classes:t,checked:n,disabled:r,edge:i}=e,a={root:["root",n&&"checked",r&&"disabled",i&&`edge${Ue(i)}`],input:["input"]};return Un(a,HB,t)},qB=wt(sS,{name:"MuiSwitchBase"})({padding:9,borderRadius:"50%",variants:[{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:({edge:e,ownerState:t})=>e==="start"&&t.size!=="small",style:{marginLeft:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}},{props:({edge:e,ownerState:t})=>e==="end"&&t.size!=="small",style:{marginRight:-12}}]}),VB=wt("input",{name:"MuiSwitchBase",shouldForwardProp:Cm})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),dS=M.forwardRef(function(t,n){const{autoFocus:r,checked:i,checkedIcon:a,defaultChecked:o,disabled:u,disableFocusRipple:l=!1,edge:s=!1,icon:c,id:f,inputProps:d,inputRef:h,name:v,onBlur:m,onChange:D,onFocus:p,readOnly:g,required:y=!1,tabIndex:S,type:w,value:b,slots:E={},slotProps:C={},...A}=t,[T,_]=Y9({controlled:i,default:!!o}),x=fS(),F=k=>{p&&p(k),x&&x.onFocus&&x.onFocus(k)},R=k=>{m&&m(k),x&&x.onBlur&&x.onBlur(k)},z=k=>{if(k.nativeEvent.defaultPrevented)return;const q=k.target.checked;_(q),D&&D(k,q)};let N=u;x&&typeof N>"u"&&(N=x.disabled);const U=w==="checkbox"||w==="radio",I={...t,checked:T,disabled:N,disableFocusRipple:l,edge:s},L=PB(I),G={slots:E,slotProps:{input:d,...C}},[X,P]=Fo("root",{ref:n,elementType:qB,className:L.root,shouldForwardComponentProp:!0,externalForwardedProps:{...G,component:"span",...A},getSlotProps:k=>({...k,onFocus:q=>{k.onFocus?.(q),F(q)},onBlur:q=>{k.onBlur?.(q),R(q)}}),ownerState:I,additionalProps:{centerRipple:!0,focusRipple:!l,disabled:N,role:void 0,tabIndex:null}}),[j,H]=Fo("input",{ref:h,elementType:VB,className:L.input,externalForwardedProps:G,getSlotProps:k=>({...k,onChange:q=>{k.onChange?.(q),z(q)}}),ownerState:I,additionalProps:{autoFocus:r,checked:i,defaultChecked:o,disabled:N,id:U?f:void 0,name:v,readOnly:g,required:y,tabIndex:S,type:w,...w==="checkbox"&&b===void 0?{}:{value:b}}});return B.jsxs(X,{...P,children:[B.jsx(j,{...H}),T?a:c]})}),GB=Mm(B.jsx("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"})),YB=Mm(B.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})),XB=Mm(B.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}));function ZB(e){return yn("MuiCheckbox",e)}const Im=bn("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),QB=e=>{const{classes:t,indeterminate:n,color:r,size:i}=e,a={root:["root",n&&"indeterminate",`color${Ue(r)}`,`size${Ue(i)}`]},o=Un(a,ZB,t);return{...t,...o}},KB=wt(dS,{shouldForwardProp:e=>Cm(e)||e==="classes",name:"MuiCheckbox",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.indeterminate&&t.indeterminate,t[`size${Ue(n.size)}`],n.color!=="default"&&t[`color${Ue(n.color)}`]]}})(In(({theme:e})=>({color:(e.vars||e).palette.text.secondary,variants:[{props:{color:"default",disableRipple:!1},style:{"&:hover":{backgroundColor:e.alpha((e.vars||e).palette.action.active,(e.vars||e).palette.action.hoverOpacity)}}},...Object.entries(e.palette).filter(No()).map(([t])=>({props:{color:t,disableRipple:!1},style:{"&:hover":{backgroundColor:e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity)}}})),...Object.entries(e.palette).filter(No()).map(([t])=>({props:{color:t},style:{[`&.${Im.checked}, &.${Im.indeterminate}`]:{color:(e.vars||e).palette[t].main},[`&.${Im.disabled}`]:{color:(e.vars||e).palette.action.disabled}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]}))),WB=B.jsx(YB,{}),JB=B.jsx(GB,{}),eF=B.jsx(XB,{}),hS=M.forwardRef(function(t,n){const r=$n({props:t,name:"MuiCheckbox"}),{checkedIcon:i=WB,color:a="primary",icon:o=JB,indeterminate:u=!1,indeterminateIcon:l=eF,inputProps:s,size:c="medium",disableRipple:f=!1,className:d,slots:h={},slotProps:v={},...m}=r,D=u?l:o,p=u?l:i,g={...r,disableRipple:f,color:a,indeterminate:u,size:c},y=QB(g),S=v.input??s,[w,b]=Fo("root",{ref:n,elementType:KB,className:at(y.root,d),shouldForwardComponentProp:!0,externalForwardedProps:{slots:h,slotProps:v,...m},ownerState:g,additionalProps:{type:"checkbox",icon:M.cloneElement(D,{fontSize:D.props.fontSize??c}),checkedIcon:M.cloneElement(p,{fontSize:p.props.fontSize??c}),disableRipple:f,slots:h,slotProps:{input:Z9(typeof S=="function"?S(g):S,{"data-indeterminate":u})}}});return B.jsx(w,{...b,classes:y})});function tF(e){return yn("MuiFormGroup",e)}bn("MuiFormGroup",["root","row","error"]);const nF=e=>{const{classes:t,row:n,error:r}=e;return Un({root:["root",n&&"row",r&&"error"]},tF,t)},rF=wt("div",{name:"MuiFormGroup",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.row&&t.row]}})({display:"flex",flexDirection:"column",flexWrap:"wrap",variants:[{props:{row:!0},style:{flexDirection:"row"}}]}),iF=M.forwardRef(function(t,n){const r=$n({props:t,name:"MuiFormGroup"}),{className:i,row:a=!1,...o}=r,u=fS(),l=LB({props:r,muiFormControl:u,states:["error"]}),s={...r,row:a,error:l.error},c=nF(s);return B.jsx(rF,{className:at(c.root,i),ownerState:s,ref:n,...o})});function aF(e){return yn("MuiSwitch",e)}const on=bn("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]),oF=e=>{const{classes:t,edge:n,size:r,color:i,checked:a,disabled:o}=e,u={root:["root",n&&`edge${Ue(n)}`,`size${Ue(r)}`],switchBase:["switchBase",`color${Ue(i)}`,a&&"checked",o&&"disabled"],thumb:["thumb"],track:["track"],input:["input"]},l=Un(u,aF,t);return{...t,...l}},uF=wt("span",{name:"MuiSwitch",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.edge&&t[`edge${Ue(n.edge)}`],t[`size${Ue(n.size)}`]]}})({display:"inline-flex",width:34+12*2,height:14+12*2,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle","@media print":{colorAdjust:"exact"},variants:[{props:{edge:"start"},style:{marginLeft:-8}},{props:{edge:"end"},style:{marginRight:-8}},{props:{size:"small"},style:{width:40,height:24,padding:7,[`& .${on.thumb}`]:{width:16,height:16},[`& .${on.switchBase}`]:{padding:4,[`&.${on.checked}`]:{transform:"translateX(16px)"}}}}]}),lF=wt(dS,{name:"MuiSwitch",slot:"SwitchBase",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.switchBase,{[`& .${on.input}`]:t.input},n.color!=="default"&&t[`color${Ue(n.color)}`]]}})(In(({theme:e})=>({position:"absolute",top:0,left:0,zIndex:1,color:e.vars?e.vars.palette.Switch.defaultColor:`${e.palette.mode==="light"?e.palette.common.white:e.palette.grey[300]}`,transition:e.transitions.create(["left","transform"],{duration:e.transitions.duration.shortest}),[`&.${on.checked}`]:{transform:"translateX(20px)"},[`&.${on.disabled}`]:{color:e.vars?e.vars.palette.Switch.defaultDisabledColor:`${e.palette.mode==="light"?e.palette.grey[100]:e.palette.grey[600]}`},[`&.${on.checked} + .${on.track}`]:{opacity:.5},[`&.${on.disabled} + .${on.track}`]:{opacity:e.vars?e.vars.opacity.switchTrackDisabled:`${e.palette.mode==="light"?.12:.2}`},[`& .${on.input}`]:{left:"-100%",width:"300%"}})),In(({theme:e})=>({"&:hover":{backgroundColor:e.alpha((e.vars||e).palette.action.active,(e.vars||e).palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[...Object.entries(e.palette).filter(No(["light"])).map(([t])=>({props:{color:t},style:{[`&.${on.checked}`]:{color:(e.vars||e).palette[t].main,"&:hover":{backgroundColor:e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${on.disabled}`]:{color:e.vars?e.vars.palette.Switch[`${t}DisabledColor`]:`${e.palette.mode==="light"?e.lighten(e.palette[t].main,.62):e.darken(e.palette[t].main,.55)}`}},[`&.${on.checked} + .${on.track}`]:{backgroundColor:(e.vars||e).palette[t].main}}}))]}))),sF=wt("span",{name:"MuiSwitch",slot:"Track"})(In(({theme:e})=>({height:"100%",width:"100%",borderRadius:14/2,zIndex:-1,transition:e.transitions.create(["opacity","background-color"],{duration:e.transitions.duration.shortest}),backgroundColor:e.vars?e.vars.palette.common.onBackground:`${e.palette.mode==="light"?e.palette.common.black:e.palette.common.white}`,opacity:e.vars?e.vars.opacity.switchTrack:`${e.palette.mode==="light"?.38:.3}`}))),cF=wt("span",{name:"MuiSwitch",slot:"Thumb"})(In(({theme:e})=>({boxShadow:(e.vars||e).shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"}))),mS=M.forwardRef(function(t,n){const r=$n({props:t,name:"MuiSwitch"}),{className:i,color:a="primary",edge:o=!1,size:u="medium",sx:l,slots:s={},slotProps:c={},...f}=r,d={...r,color:a,edge:o,size:u},h=oF(d),v={slots:s,slotProps:c},[m,D]=Fo("root",{className:at(h.root,i),elementType:uF,externalForwardedProps:v,ownerState:d,additionalProps:{sx:l}}),[p,g]=Fo("thumb",{className:h.thumb,elementType:cF,externalForwardedProps:v,ownerState:d}),y=B.jsx(p,{...g}),[S,w]=Fo("track",{className:h.track,elementType:sF,externalForwardedProps:v,ownerState:d});return B.jsxs(m,{...D,children:[B.jsx(lF,{type:"checkbox",icon:y,checkedIcon:y,ref:n,ownerState:d,...f,classes:{...h,root:h.switchBase},slots:{...s.switchBase&&{root:s.switchBase},...s.input&&{input:s.input}},slotProps:{...c.switchBase&&{root:typeof c.switchBase=="function"?c.switchBase(d):c.switchBase},input:{role:"switch"},...c.input&&{input:typeof c.input=="function"?c.input(d):c.input}}}),B.jsx(S,{...w})]})}),pS=M.createContext();function fF(e){return yn("MuiTable",e)}bn("MuiTable",["root","stickyHeader"]);const dF=e=>{const{classes:t,stickyHeader:n}=e;return Un({root:["root",n&&"stickyHeader"]},fF,t)},hF=wt("table",{name:"MuiTable",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.stickyHeader&&t.stickyHeader]}})(In(({theme:e})=>({display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":{...e.typography.body2,padding:e.spacing(2),color:(e.vars||e).palette.text.secondary,textAlign:"left",captionSide:"bottom"},variants:[{props:({ownerState:t})=>t.stickyHeader,style:{borderCollapse:"separate"}}]}))),gS="table",mF=M.forwardRef(function(t,n){const r=$n({props:t,name:"MuiTable"}),{className:i,component:a=gS,padding:o="normal",size:u="medium",stickyHeader:l=!1,...s}=r,c={...r,component:a,padding:o,size:u,stickyHeader:l},f=dF(c),d=M.useMemo(()=>({padding:o,size:u,stickyHeader:l}),[o,u,l]);return B.jsx(pS.Provider,{value:d,children:B.jsx(hF,{as:a,role:a===gS?null:"table",ref:n,className:at(f.root,i),ownerState:c,...s})})}),Df=M.createContext();function pF(e){return yn("MuiTableBody",e)}bn("MuiTableBody",["root"]);const gF=e=>{const{classes:t}=e;return Un({root:["root"]},pF,t)},vF=wt("tbody",{name:"MuiTableBody",slot:"Root"})({display:"table-row-group"}),yF={variant:"body"},vS="tbody",bF=M.forwardRef(function(t,n){const r=$n({props:t,name:"MuiTableBody"}),{className:i,component:a=vS,...o}=r,u={...r,component:a},l=gF(u);return B.jsx(Df.Provider,{value:yF,children:B.jsx(vF,{className:at(l.root,i),as:a,ref:n,role:a===vS?null:"rowgroup",ownerState:u,...o})})});function DF(e){return yn("MuiTableCell",e)}const SF=bn("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),xF=e=>{const{classes:t,variant:n,align:r,padding:i,size:a,stickyHeader:o}=e,u={root:["root",n,o&&"stickyHeader",r!=="inherit"&&`align${Ue(r)}`,i!=="normal"&&`padding${Ue(i)}`,`size${Ue(a)}`]};return Un(u,DF,t)},wF=wt("td",{name:"MuiTableCell",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`size${Ue(n.size)}`],n.padding!=="normal"&&t[`padding${Ue(n.padding)}`],n.align!=="inherit"&&t[`align${Ue(n.align)}`],n.stickyHeader&&t.stickyHeader]}})(In(({theme:e})=>({...e.typography.body2,display:"table-cell",verticalAlign:"inherit",borderBottom:e.vars?`1px solid ${e.vars.palette.TableCell.border}`:`1px solid
190
+ ${e.palette.mode==="light"?e.lighten(e.alpha(e.palette.divider,1),.88):e.darken(e.alpha(e.palette.divider,1),.68)}`,textAlign:"left",padding:16,variants:[{props:{variant:"head"},style:{color:(e.vars||e).palette.text.primary,lineHeight:e.typography.pxToRem(24),fontWeight:e.typography.fontWeightMedium}},{props:{variant:"body"},style:{color:(e.vars||e).palette.text.primary}},{props:{variant:"footer"},style:{color:(e.vars||e).palette.text.secondary,lineHeight:e.typography.pxToRem(21),fontSize:e.typography.pxToRem(12)}},{props:{size:"small"},style:{padding:"6px 16px",[`&.${SF.paddingCheckbox}`]:{width:24,padding:"0 12px 0 16px","& > *":{padding:0}}}},{props:{padding:"checkbox"},style:{width:48,padding:"0 0 0 4px"}},{props:{padding:"none"},style:{padding:0}},{props:{align:"left"},style:{textAlign:"left"}},{props:{align:"center"},style:{textAlign:"center"}},{props:{align:"right"},style:{textAlign:"right",flexDirection:"row-reverse"}},{props:{align:"justify"},style:{textAlign:"justify"}},{props:({ownerState:t})=>t.stickyHeader,style:{position:"sticky",top:0,zIndex:2,backgroundColor:(e.vars||e).palette.background.default}}]}))),Sf=M.forwardRef(function(t,n){const r=$n({props:t,name:"MuiTableCell"}),{align:i="inherit",className:a,component:o,padding:u,scope:l,size:s,sortDirection:c,variant:f,...d}=r,h=M.useContext(pS),v=M.useContext(Df),m=v&&v.variant==="head";let D;o?D=o:D=m?"th":"td";let p=l;D==="td"?p=void 0:!p&&m&&(p="col");const g=f||v&&v.variant,y={...r,align:i,component:D,padding:u||(h&&h.padding?h.padding:"normal"),size:s||(h&&h.size?h.size:"medium"),sortDirection:c,stickyHeader:g==="head"&&h&&h.stickyHeader,variant:g},S=xF(y);let w=null;return c&&(w=c==="asc"?"ascending":"descending"),B.jsx(wF,{as:D,ref:n,className:at(S.root,a),"aria-sort":w,scope:p,ownerState:y,...d})});function EF(e){return yn("MuiTableHead",e)}bn("MuiTableHead",["root"]);const AF=e=>{const{classes:t}=e;return Un({root:["root"]},EF,t)},CF=wt("thead",{name:"MuiTableHead",slot:"Root"})({display:"table-header-group"}),TF={variant:"head"},yS="thead",MF=M.forwardRef(function(t,n){const r=$n({props:t,name:"MuiTableHead"}),{className:i,component:a=yS,...o}=r,u={...r,component:a},l=AF(u);return B.jsx(Df.Provider,{value:TF,children:B.jsx(CF,{as:a,className:at(l.root,i),ref:n,role:a===yS?null:"rowgroup",ownerState:u,...o})})});function _F(e){return yn("MuiTableRow",e)}const bS=bn("MuiTableRow",["root","selected","hover","head","footer"]),BF=e=>{const{classes:t,selected:n,hover:r,head:i,footer:a}=e;return Un({root:["root",n&&"selected",r&&"hover",i&&"head",a&&"footer"]},_F,t)},FF=wt("tr",{name:"MuiTableRow",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.head&&t.head,n.footer&&t.footer]}})(In(({theme:e})=>({color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,[`&.${bS.hover}:hover`]:{backgroundColor:(e.vars||e).palette.action.hover},[`&.${bS.selected}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity),"&:hover":{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`)}}}))),DS="tr",SS=M.forwardRef(function(t,n){const r=$n({props:t,name:"MuiTableRow"}),{className:i,component:a=DS,hover:o=!1,selected:u=!1,...l}=r,s=M.useContext(Df),c={...r,component:a,hover:o,selected:u,head:s&&s.variant==="head",footer:s&&s.variant==="footer"},f=BF(c);return B.jsx(FF,{as:a,ref:n,className:at(f.root,i),role:a===DS?null:"row",ownerState:c,...l})}),NF={paddingLeft:0,paddingRight:0,paddingTop:1,paddingBottom:1},fl=35,RF=e=>{const t=e.selected?"secondary":"inherit";return B.jsx("span",{title:e.title,children:e.icon?B.jsx(cl,{title:e.title,onClick:e.onClick,color:t,style:NF,disabled:!!e.disabled,sx:{fontSize:18},children:e.icon},e.elementIndex):B.jsx("button",{title:e.title,onClick:e.onClick,disabled:!!e.disabled,style:{padding:0,margin:0,fontSize:10},children:e.text},e.elementIndex)},e.elementIndex+"-span")},OF=e=>e.useHorizontalLayout?B.jsx(B.Fragment,{}):B.jsx("hr",{},e.elementIndex),zF=e=>{const t=Number.isFinite(e.content)?e.content:0,n=e.contentSigFigs||0,r=Math.abs(t-Math.round(t))*10**(n+1)<1,i=Number.isFinite(e.content)?r&&!e.contentAlwaysShowDecimal?Math.round(t)+"":t.toFixed(e.contentSigFigs||2):e.content||"",a=e.useHorizontalLayout?"span":"div";return Nt.createElement(a,{key:e.elementIndex,title:e.title,style:{textAlign:"left",fontWeight:"bold",cursor:"default",fontSize:10}},i)},UF=e=>{switch(e.subtype){case"checkbox":return B.jsx(IF,{...e});case"slider":return B.jsx($F,{...e});default:return B.jsxs("span",{children:["ERROR: Bad toggle subtype ",e.subtype]},e.elementIndex)}},IF=e=>B.jsx(hS,{checked:e.selected,onClick:e.onClick,style:{padding:0,paddingLeft:0},title:e.title,disabled:e.disabled},e.elementIndex),$F=e=>B.jsx(iF,{children:B.jsx(mS,{checked:e.selected,size:"small",style:{left:-3},onChange:e.onClick,disabled:e.disabled,title:e.title})},e.elementIndex),kF=e=>{switch(e.type){case"button":return B.jsx(RF,{...e});case"divider":return B.jsx(OF,{...e});case"text":return B.jsx(zF,{...e});case"toggle":return B.jsx(UF,{...e});default:return B.jsx("span",{},e.elementIndex)}},LF=e=>(e||[]).map((t,n)=>({type:t.type||"button",subtype:t.subtype,title:t.title,onClick:t.callback,icon:t.icon||"",text:t.text||"",selected:t.selected,disabled:t.disabled,content:t.content,contentSigFigs:t.contentSigFigs,contentAlwaysShowDecimal:t.boolean,elementIndex:n})),dl=e=>{const t=M.useMemo(()=>LF(e.customActions),[e.customActions]),n=M.useMemo(()=>t.map((a,o)=>B.jsx(kF,{...a,useHorizontalLayout:e.useHorizontalLayout},o)),[t,e.useHorizontalLayout]),r=M.useMemo(()=>({width:e.width,height:e.height,top:e.top??0,paddingTop:e.topPadding??0}),[e.width,e.height,e.top,e.topPadding]),i=e.useHorizontalLayout?"HorizontalToolbar":"VerticalToolbar";return B.jsx("div",{className:i,style:{...r},children:n})},xf={onlyShowSelected:!1},wf=({options:e,setOptions:t,onRedistributeUnitColors:n})=>B.jsxs("div",{children:[B.jsx(mS,{checked:e.onlyShowSelected,onClick:()=>{t({...e,onlyShowSelected:!e.onlyShowSelected})}}),B.jsx("span",{style:{position:"relative",top:2,overflow:"hidden"},children:"only show selected"}),"  ",n&&B.jsx("button",{onClick:n,title:"Redistribute unit colors",children:"rc"})]}),jF=(e,t)=>{const n=t-e;let r;n<=30?r=10:n<=120?r=20:n<=300?r=50:n<=600?r=100:n<=1e3?r=150:r=100;const i=[];let a=Math.ceil(e/r);for(;a*r<=t;)i.push(a*r),a++;return i},xS=({binEdgesSec:e,binCounts:t,color:n,width:r,height:i,hideXAxis:a})=>{const o=M.useMemo(()=>(t||[]).map((c,f)=>{const d=(e||[])[f]*1e3,h=(e||[])[f+1]*1e3;return{key:f,xStart:d,xEnd:h,height:c,tooltip:`[${d}, ${h}]: ${c}`,color:n}}),[t,e,n]),{xMin:u,xMax:l}=M.useMemo(()=>o.length>0?{xMin:o[0].xStart,xMax:o[o.length-1].xEnd}:{xMin:0,xMax:1},[o]),s=M.useMemo(()=>jF(u,l).map(f=>({x:f,label:`${f}`})),[u,l]);return t?B.jsx(h_,{bars:o,ticks:a?void 0:s,width:r,height:i,xLabel:a?void 0:"dt (msec)"}):B.jsx("div",{style:{position:"relative",width:r,height:i,color:"orange"}})},HF=10,PF=4,qF=2,Ro=Nt.forwardRef((e,t)=>{const{width:n,height:r,initialPosition:i,onChange:a,adjustable:o=!0,positionFromRight:u=!1,direction:l="horizontal"}=e,s=l==="horizontal"?n:r,[c,f]=M.useState(i),[d,h]=M.useState(!1),[v,m]=M.useState({x:0,y:0}),[D,p]=M.useState(0),g=M.useRef(null);if(M.useEffect(()=>{c>s-4?f(s-4):c<4&&s>20&&f(4)},[c,n,s]),!e.children)throw Error("Unexpected: no props.children");let y,S;if(!Array.isArray(e.children))y=e.children,S=null;else{const G=e.children.filter(X=>X!==void 0);y=G[0]||null,S=G[1]||null}if(y||(y=S,S=null),!y)throw Error("Splitter must have at least one child.");const w=u?s-c:c,b=o?e.gripThickness??HF:0,E=o?e.gripInnerThickness??PF:0,C=o?e.gripMargin??qF:0,A=w-b/2-C,T=s-A-b-2*C,_={top:0,left:0,width:n,height:r,overflow:"hidden"},x={left:0,top:0,width:l==="horizontal"?A:n,height:l==="horizontal"?r:A,zIndex:0,overflowY:l==="horizontal"?"auto":"hidden",overflowX:l==="horizontal"?"hidden":"auto"},F={left:l==="horizontal"?A+b+2*C:0,top:l==="horizontal"?0:A+b+2*C,width:l==="horizontal"?T:n,height:l==="horizontal"?r:T,zIndex:0,overflowY:l==="horizontal"?"auto":"hidden",overflowX:l==="horizontal"?"hidden":"auto"},R={left:0,top:0,width:l==="horizontal"?b+2*C:n,height:l==="horizontal"?r:b+2*C,backgroundColor:"transparent",cursor:l==="horizontal"?"col-resize":"row-resize",zIndex:9998},z={left:l==="horizontal"?C:0,top:l==="horizontal"?0:C,width:l==="horizontal"?b:n,height:l==="horizontal"?r:b,background:"rgb(230, 230, 230)",cursor:l==="horizontal"?"col-resize":"row-resize"},N={top:l==="horizontal"?0:(b-E)/2,left:l==="horizontal"?(b-E)/2:0,width:l==="horizontal"?E:n,height:l==="horizontal"?r:E,background:"gray",cursor:l==="horizontal"?"col-resize":"row-resize"},U=M.useCallback(G=>{G.preventDefault(),h(!0),m({x:G.clientX,y:G.clientY}),p(w)},[w]),I=M.useCallback(G=>{if(!d)return;const X=G.clientX-v.x,P=G.clientY-v.y;let H=D+(l==="horizontal"?X:P);const k=4,q=s-4;H=Math.max(k,Math.min(q,H));const Y=u?s-H:H;f(Y),a&&a(Y)},[d,v,D,l,s,u,a]),L=M.useCallback(()=>{h(!1)},[]);return M.useEffect(()=>{if(d)return document.addEventListener("mousemove",I),document.addEventListener("mouseup",L),()=>{document.removeEventListener("mousemove",I),document.removeEventListener("mouseup",L)}},[d,I,L]),S?B.jsxs("div",{className:"splitter",style:{..._,position:"relative"},children:[B.jsx("div",{style:{...x,position:"absolute"},className:"SplitterChild",children:B.jsx(y.type,{...y.props,width:l==="horizontal"?A:n,height:l==="horizontal"?r:A})},"child1"),o&&B.jsx("div",{ref:g,style:{...R,position:"absolute",left:l==="horizontal"?w-b/2-C:0,top:l==="horizontal"?0:w-b/2-C},onMouseDown:U,children:B.jsx("div",{style:{...z,position:"absolute"},children:B.jsx("div",{style:{...N,position:"absolute"}})})},"drag"),B.jsx("div",{style:{...F,position:"absolute"},className:"SplitterChild",children:B.jsx(S.type,{ref:t,...S.props,width:l==="horizontal"?T:n,height:l==="horizontal"?r:T})},"child2")]}):B.jsx(y.type,{...y.props,width:n,height:r})}),VF=({data:e,width:t,height:n})=>{const[r,i]=M.useState(xf),{selectedUnitIds:a,orderedUnitIds:o,plotClickHandlerGenerator:u,unitIdSelectionDispatch:l}=qr(),[s,c]=M.useState(1),[f,d]=M.useState(!1);M.useEffect(()=>{l({type:oo,newUnitOrder:yr(e.autocorrelograms.map(g=>g.unitId))})},[e.autocorrelograms,l]);const h=M.useMemo(()=>e.autocorrelograms.filter(g=>r.onlyShowSelected?a.has(g.unitId):!0).map(g=>({unitId:g.unitId,key:g.unitId,label:`Unit ${g.unitId}`,labelColor:wr(Ct(g.unitId)),clickHandler:r.onlyShowSelected?void 0:u(g.unitId),props:{binEdgesSec:g.binEdgesSec,binCounts:g.binCounts,color:wr(Ct(g.unitId)),width:120*s,height:120*s,hideXAxis:!f}})),[e.autocorrelograms,u,r.onlyShowSelected,a,f,s]),v=M.useMemo(()=>o&&o.length>0?o.map(g=>h.filter(y=>y.unitId===g)[0]).filter(g=>g!==void 0):h,[h,o]),m=M.useMemo(()=>{const g=[{type:"button",callback:()=>c(S=>S*1.3),title:"Increase box size",icon:B.jsx(Tc,{})},{type:"button",callback:()=>c(S=>S/1.3),title:"Decrease box size",icon:B.jsx(Cc,{})}],y={type:"toggle",subtype:"checkbox",callback:()=>d(S=>!S),title:"Show X Axis",selected:f===!0};return[...g,{type:"divider"},y]},[f]),D=30,p=fl;return B.jsxs("div",{children:[B.jsxs(Ro,{width:t,height:n-D,initialPosition:p,adjustable:!1,children:[B.jsx(dl,{width:p,height:n,customActions:m}),B.jsx(wc,{width:0,height:0,children:B.jsx(xc,{plots:v,plotComponent:xS,selectedPlotKeys:r.onlyShowSelected?void 0:a})})]}),B.jsx("div",{style:{position:"absolute",top:n-D,height:D,overflow:"hidden"},children:B.jsx(wf,{options:r,setOptions:i})})]})},Ef=e=>{const[t,n]=M.useState(e?.stateRef.current),r=e?.stateRef,i=e?.onChange;return M.useEffect(()=>{n(r?.current);const a=i?.(o=>{n(o)});return()=>{a&&a()}},[i,r]),t===void 0?{state:void 0,dispatch:void 0}:{state:t,dispatch:e?.dispatch}},GF=(e,t,n)=>{const{state:r,dispatch:i}=Ef(e?.figureAnnotations);M.useEffect(()=>{i&&n&&i({type:"reportViewWithAnnotations"})},[i,n]);const a=M.useMemo(()=>r?.annotations[t],[r,t]),o=M.useMemo(()=>r?.editingAnnotations?(u,l)=>{i&&i({type:"setAnnotation",path:t,key:u,value:l})}:void 0,[i,t,r?.editingAnnotations]);return{annotations:a,setAnnotation:o}},YF=({zarrGroup:e,contexts:t,width:n,height:r})=>{const[i,a]=M.useState(null);return M.useEffect(()=>{let o=!1;return(async()=>{const l=[],s=e.attrs.num_autocorrelograms||0;if(s===0){o||a({type:"Autocorrelograms",autocorrelograms:[]});return}const c=await e.getDatasetData("bin_edges_sec",{}),f=await e.getDatasetData("bin_counts",{});if(!c||!f){console.error("Failed to load autocorrelograms data");return}const d=Array.from(c),h=new Int32Array(f),v=d.length-1,m=e.attrs.autocorrelograms;for(let D=0;D<s;D++){const p=m[D],g=D*v,y=Array.from(h.slice(g,g+v));l.push({unitId:p.unit_id,binEdgesSec:d,binCounts:y})}o||a({type:"Autocorrelograms",autocorrelograms:l})})(),()=>{o=!0}},[e]),i?B.jsx(Jr,{context:t.unitSelection,children:B.jsx(VF,{data:i,width:n,height:r})}):B.jsx("div",{children:"Loading..."})},Jr=({context:e,children:t})=>{const{state:n,dispatch:r}=Ef(e);return!r||!n?B.jsx(B.Fragment,{children:"Waiting for context..."}):B.jsx(xy.Provider,{value:{unitSelection:n,unitSelectionDispatch:r},children:t})},XF=e=>{const{unitId:t,mergeGroup:n}=e,r=wr(Ct(t)),i=n?n.map(a=>`${a}`).join(", "):"";return B.jsxs("span",{children:[B.jsx("div",{className:"unitLabel",style:{backgroundColor:r}})," ",`${t}`,n&&n.length>0&&B.jsx("span",{children:` (${i})`},"mergeGroup")]})},ZF=(e,t)=>((t||{}).mergeGroups||[]).filter(r=>r.includes(e))[0]||null,QF=e=>{const{selectedUnitIds:t,currentUnitId:n,selectionDispatch:r,rows:i,columns:a,orderedUnitIds:o,visibleUnitIds:u,primarySortRule:l,height:s,selectionDisabled:c,hideSelectionColumn:f}=e,[d,h]=M.useState(l),v=M.useMemo(()=>u&&u.length>0?u:o,[u,o]),m=M.useMemo(()=>my({selectedUnitIds:t,orderedUnitIds:o,visibleUnitIds:v}),[t,o,v]),D=M.useCallback((S,w)=>{const b=d?.columnName===S?!d?.sortAscending:!0;h({columnName:S,sortAscending:b}),r&&r({type:"UPDATE_SORT_FIELDS",newSortField:S,ascending:b})},[d,r]),p=M.useCallback(()=>{r&&r(m==="all"?{type:"DESELECT_ALL"}:{type:"TOGGLE_SELECT_ALL"})},[m,r]),g=M.useMemo(()=>{const S=v.map(b=>i.get(b)).filter(b=>b!==void 0);if(!d)return S;const w=a.find(b=>b.columnName===d.columnName);return w?[...S].sort((b,E)=>{const C=b.data[d.columnName]?.sortValue,A=E.data[d.columnName]?.sortValue,T=w.sort(C,A);return d.sortAscending?T:-T}):S},[v,i,d,a]),y=S=>d?.columnName!==S?"":d.sortAscending?"↑":"↓";return B.jsx("div",{className:"compact-table-container",style:{height:s?`${s}px`:"100%",overflow:"auto"},children:B.jsxs("table",{className:"compact-table",children:[B.jsx("thead",{children:B.jsxs("tr",{children:[!f&&B.jsx("th",{className:"compact-table-header",children:B.jsx("input",{type:"checkbox",checked:m==="all",ref:S=>{S&&(S.indeterminate=m==="partial")},onChange:p,disabled:c})}),a.map(S=>B.jsxs("th",{className:"compact-table-header",onClick:()=>D(S.columnName,S),title:S.tooltip,style:{cursor:"pointer"},children:[S.label,B.jsx("span",{className:"sort-indicator",children:y(S.columnName)})]},S.columnName))]})}),B.jsx("tbody",{children:g.map(S=>B.jsxs("tr",{className:`compact-table-row ${t.has(S.rowId)?"selected":""} ${n===S.rowId?"current":""}`,children:[!f&&B.jsx("td",{className:"compact-table-cell",children:B.jsx("input",{type:"checkbox",checked:t.has(S.rowId),onChange:w=>{S.checkboxFn&&S.checkboxFn(w)},disabled:c})}),a.map(w=>B.jsx("td",{className:"compact-table-cell",children:w.dataElement(S.data[w.columnName]?.value)},w.columnName))]},S.rowId))})]})})},KF={},Af=(e,t)=>{if(t.type!=="REOPEN_CURATION"&&e.isClosed&&console.log(`WARNING: Applying curation action to a closed sorting curation:
191
+ Action: ${t.type}`),t.type==="SET_CURATION")return t.curation;if(t.type==="CLOSE_CURATION")return{...e,isClosed:!0};if(t.type==="REOPEN_CURATION")return{...e,isClosed:!1};if(t.type==="ADD_UNIT_LABEL"){const n=typeof t.unitId=="object"?t.unitId:[t.unitId],r={...e.labelsByUnit||{}};let i=!1;for(const a of n){const o=r[a+""]||[];o.includes(t.label)||(i=!0,r[a+""]=[...o,t.label].sort())}return i?{...e,labelsByUnit:r}:e}else if(t.type==="TOGGLE_UNIT_LABEL"){const n=typeof t.unitId=="object"?t.unitId:[t.unitId];let r=!0;for(const i of n)((e.labelsByUnit||{})[i+""]||[]).includes(t.label)||(r=!1);return r?Af(e,{type:"REMOVE_UNIT_LABEL",unitId:t.unitId,label:t.label}):Af(e,{type:"ADD_UNIT_LABEL",unitId:t.unitId,label:t.label})}else if(t.type==="REMOVE_UNIT_LABEL"){const n=typeof t.unitId=="object"?t.unitId:[t.unitId],r={...e.labelsByUnit||{}};let i=!1;for(const a of n){const o=r[a+""]||[];o.includes(t.label)&&(i=!0,r[a+""]=o.filter(u=>u!==t.label))}return i?{...e,labelsByUnit:r}:e}else{if(t.type==="MERGE_UNITS")return{...e,mergeGroups:AS([...e.mergeGroups||[],t.unitIds])};if(t.type==="UNMERGE_UNITS")return{...e,mergeGroups:AS((e.mergeGroups||[]).map(n=>n.filter(r=>!t.unitIds.includes(r))))};if(t.type==="SET_LABEL_CHOICES")return{...e,labelChoices:t.labelChoices}}return e},WF={sortingCuration:KF,sortingCurationDispatch:e=>{console.warn("No sortingCurationDispatch function provided.")},curating:!1},wS=Nt.createContext(WF),ES=()=>{const e=M.useContext(wS);if(!e)throw Error("useSortingCuration must be used within a SortingCurationContext.Provider");return e},JF=(e,t)=>e.filter(n=>t.includes(n)),eN=(e,t)=>[...e,...t.filter(n=>!e.includes(n))].sort(),AS=e=>{const t=e.map(r=>[...r]);let n=!0;for(;n;){n=!1;for(let r=0;r<t.length;r++){const i=t[r];for(let a=r+1;a<t.length;a++){const o=t[a];JF(i,o).length>0&&(t[r]=eN(i,o),t[a]=[],n=!0)}}}return t.filter(r=>r.length>=2)},CS=({data:e,width:t,height:n})=>{const[r,i]=M.useState({...xf,onlyShowSelected:!1}),{selectedUnitIds:a,currentUnitId:o,orderedUnitIds:u,visibleUnitIds:l,primarySortRule:s,checkboxClickHandlerGenerator:c,unitIdSelectionDispatch:f}=qr(),{sortingCuration:d}=ES(),h=M.useMemo(()=>r.onlyShowSelected?l?l.filter(w=>a.has(w)):[...a]:l,[l,a,r.onlyShowSelected]),v=M.useMemo(()=>{const w=[];return w.push({columnName:"_unitId",label:"Unit",tooltip:"Unit ID",sort:(b,E)=>Ct(b)-Ct(E),dataElement:b=>B.jsx(XF,{unitId:b.unitId,mergeGroup:b.mergeGroup}),calculating:!1}),d&&w.push({columnName:"_labels",label:"Labels",tooltip:"Curation labels",sort:(b,E)=>b<E?-1:b>E?1:0,dataElement:b=>B.jsx("span",{children:b.join(", ")}),calculating:!1}),e.similarityScores&&w.push({columnName:"_similarity",label:"Similarity",tooltip:"Similarity with current unit",sort:(b,E)=>{if(b.unitId===o)return 1;if(E.unitId===o)return-1;const C=b.score,A=E.score;return C===void 0&&A!==void 0?-1:C!==void 0&&A===void 0?1:C===void 0&&A===void 0?0:C!==void 0&&A!==void 0?C<A?-1:C>A?1:0:0},dataElement:b=>B.jsx("span",{children:b}),calculating:!1,onlyAllowDescendingSort:!0}),e.columns.filter(b=>b.key!=="unitId").forEach(b=>{w.push({columnName:b.key,label:b.label,tooltip:b.label,sort:b.dtype==="str"?(E,C)=>E<C?-1:E>C?1:0:b.dtype==="int"?(E,C)=>E-C:b.dtype=="bool"?(E,C)=>(E?1:0)-(C?1:0):b.dtype==="float"?(E,C)=>E-C:(E,C)=>E-C,dataElement:E=>B.jsx("span",{children:E}),calculating:!1})}),w},[e.columns,o,d,e.similarityScores]),m=M.useMemo(()=>{for(let b=0;b<0;b++)u.push("never-added");const w={};if(e.similarityScores&&o!==void 0)for(const b of e.similarityScores)b.unitId1===o?w[b.unitId2]=b.similarity:b.unitId2===o&&(w[b.unitId1]=b.similarity);return e.rows.map(b=>{const E=(d?.labelsByUnit||{})[`${b.unitId}`]||[],C={value:{unitId:b.unitId,mergeGroup:ZF(b.unitId,d)},sortValue:b.unitId},A=w[b.unitId],T={_unitId:C,_labels:{value:E,sortValue:E.join(", ")},_similarity:{value:A!==void 0?A.toFixed(3):void 0,sortValue:{unitId:b.unitId,score:A}}};for(const _ of e.columns){const x=`${b.values[_.key]!==void 0?b.values[_.key]:""}`;T[_.key]={value:x,sortValue:b.values[_.key]}}return{rowId:b.unitId,data:T,checkboxFn:c(b.unitId)}})},[e.rows,e.columns,o,e.similarityScores,d,c,u]);M.useEffect(()=>{f({type:oo,newUnitOrder:yr(m.map(w=>w.rowId))})},[m,f]);const D=M.useMemo(()=>{const w=new Map;return m.forEach(b=>w.set(b.rowId,b)),w},[m]),p=30,g=M.useMemo(()=>({width:t-20,height:n-p,top:0,position:"relative",overflowY:"auto"}),[t,n]),y=M.useCallback(w=>{if(w.ctrlKey)return w.key==="ArrowDown"?f({type:vy}):w.key==="ArrowUp"?f({type:yy}):w.key==="Home"?f({type:by}):w.key==="End"&&f({type:Dy}),!1},[f]),S=M.useCallback(()=>{f({type:"REDISTRIBUTE_UNIT_COLORS"})},[f]);return B.jsxs("div",{children:[B.jsx("div",{style:g,onKeyDown:y,children:B.jsx(QF,{columns:v,rows:D,orderedUnitIds:u,visibleUnitIds:h,selectedUnitIds:a,currentUnitId:o,selectionDispatch:f,primarySortRule:s})}),B.jsx("div",{style:{position:"absolute",top:n-p,height:p,overflow:"hidden"},children:B.jsx(wf,{options:r,setOptions:i,onRedistributeUnitColors:S})})]})},tN=({defaultLabelOptions:e,width:t,height:n})=>{const{selectedUnitIdsArray:r}=qr(),{sortingCuration:i,sortingCurationDispatch:a,curating:o}=ES(),{labelChoices:u=[],labelsByUnit:l={},mergeGroups:s=[],isClosed:c=!1}=i,[f,d]=M.useState(""),[h,v]=M.useState(!1),m=M.useMemo(()=>u.length===0&&e.length>0&&o?(a({type:"SET_LABEL_CHOICES",labelChoices:e}),e):u,[u,e,a,o]);M.useEffect(()=>{},[m]);const D=M.useCallback(j=>{if(r.length===0)return"none";const H=r.filter(k=>(l[k.toString()]||[]).includes(j));return H.length===0?"none":H.length===r.length?"full":"partial"},[r,l]),p=M.useCallback(j=>{o&&(r.length===0||c||a({type:"TOGGLE_UNIT_LABEL",unitId:r,label:j}))},[r,c,a,o]),g=M.useCallback(()=>{if(!o)return;const j=f.trim();j&&!m.includes(j)&&(a({type:"SET_LABEL_CHOICES",labelChoices:[...m,j]}),d(""))},[f,m,a,o]),y=M.useCallback(j=>Object.values(l).some(H=>H.includes(j)),[l]),S=M.useCallback(j=>{o&&(y(j)||a({type:"SET_LABEL_CHOICES",labelChoices:m.filter(H=>H!==j)}))},[m,a,y,o]),w=M.useCallback(j=>s.find(H=>H.includes(j)),[s]),b=M.useMemo(()=>{if(r.length===0)return{canMerge:!1,canUnmerge:!1,groupsInvolved:[],unmergedUnits:[]};const j=new Set,H=[];r.forEach(Y=>{const ee=w(Y);ee?j.add(ee):H.push(Y)});const k=r.length>=2,q=j.size>0;return{canMerge:k,canUnmerge:q,groupsInvolved:Array.from(j),unmergedUnits:H}},[r,w]),E=M.useCallback(()=>{o&&(r.length<2||c||a({type:"MERGE_UNITS",unitIds:r}))},[r,c,a,o]),C=M.useCallback(()=>{o&&(r.length===0||c||a({type:"UNMERGE_UNITS",unitIds:r}))},[r,c,a,o]),A=M.useCallback(()=>{o&&a(c?{type:"REOPEN_CURATION"}:{type:"CLOSE_CURATION"})},[c,a,o]),T=M.useMemo(()=>r.length===0?"No units selected":r.length<=5?`Units: ${r.join(", ")}`:`${r.length} units selected`,[r]),_={width:t,height:n,padding:"8px",fontSize:"12px",fontFamily:"Arial, sans-serif",border:"1px solid #ddd",borderRadius:"4px",backgroundColor:"#fafafa",overflow:"auto",display:"flex",flexDirection:"column",gap:"8px"},x={marginBottom:"6px"},F={fontWeight:"bold",marginBottom:"4px",fontSize:"11px",color:"#333"},R={display:"inline-flex",alignItems:"center",padding:"2px 6px",margin:"2px",backgroundColor:"#e0e0e0",borderRadius:"12px",fontSize:"10px",border:"1px solid #ccc"},z={marginLeft:"4px",cursor:"pointer",color:"#666",fontWeight:"bold"},N={padding:"2px 4px",fontSize:"10px",border:"1px solid #ccc",borderRadius:"2px",marginRight:"4px",flex:1},U={padding:"2px 6px",fontSize:"10px",border:"1px solid #ccc",borderRadius:"2px",backgroundColor:"#f0f0f0",cursor:"pointer"},I={display:"inline-flex",alignItems:"center",margin:"2px 8px 2px 0",cursor:r.length>0&&!c?"pointer":"default",opacity:r.length>0&&!c?1:.5},L={...x,textAlign:"center"},G={...U,backgroundColor:c?"#f8d7da":"#d4edda",borderColor:c?"#f5c6cb":"#c3e6cb",color:c?"#721c24":"#155724"},X={display:"flex",alignItems:"center",cursor:"pointer",fontSize:"11px",fontWeight:"bold",color:"#333",marginBottom:"4px"},P={marginRight:"4px",fontSize:"10px",transform:h?"rotate(90deg)":"rotate(0deg)",transition:"transform 0.2s"};return B.jsxs("div",{style:_,children:[B.jsxs("div",{style:x,children:[B.jsx("div",{style:F,children:"Selected Units"}),B.jsx("div",{style:{fontSize:"10px",color:"#666"},children:T})]}),B.jsxs("div",{style:x,children:[B.jsx("div",{style:F,children:"Label Assignment"}),m.map(j=>{const H=D(j);return B.jsxs("div",{style:I,onClick:o?()=>p(j):void 0,children:[B.jsx("input",{type:"checkbox",checked:H==="full",ref:k=>{k&&(k.indeterminate=H==="partial")},onChange:()=>{},style:{marginRight:"4px"},disabled:r.length===0||c}),B.jsx("span",{style:{fontSize:"10px"},children:j})]},j)}),r.length===0&&B.jsx("div",{style:{fontSize:"10px",color:"#999",fontStyle:"italic"},children:"Select units to assign labels"})]}),B.jsxs("div",{style:x,children:[B.jsx("div",{style:F,children:"Unit Merging"}),r.length>0&&b.groupsInvolved.length>0&&B.jsxs("div",{style:{marginBottom:"6px"},children:[B.jsx("div",{style:{fontSize:"10px",color:"#666",marginBottom:"2px"},children:"Merge groups involving selected units:"}),b.groupsInvolved.map((j,H)=>{const k={...R,backgroundColor:"#e3f2fd",borderColor:"#90caf9",color:"#1565c0"};return B.jsx("span",{style:k,children:j.join(", ")},H)})]}),B.jsxs("div",{style:{display:"flex",gap:"4px",alignItems:"center",flexWrap:"wrap"},children:[B.jsx("button",{onClick:o?E:void 0,style:{...U,backgroundColor:b.canMerge&&!c?"#d4edda":"#f8f9fa",borderColor:b.canMerge&&!c?"#c3e6cb":"#dee2e6",color:b.canMerge&&!c?"#155724":"#6c757d",cursor:b.canMerge&&!c?"pointer":"default"},disabled:!b.canMerge||c,title:c?"Cannot merge when curation is closed":r.length<2?"Select 2 or more units to merge":"Merge selected units",children:"Merge Selected"}),B.jsx("button",{onClick:o?C:void 0,style:{...U,backgroundColor:b.canUnmerge&&!c?"#fff3cd":"#f8f9fa",borderColor:b.canUnmerge&&!c?"#ffeaa7":"#dee2e6",color:b.canUnmerge&&!c?"#856404":"#6c757d",cursor:b.canUnmerge&&!c?"pointer":"default"},disabled:!b.canUnmerge||c,title:c?"Cannot unmerge when curation is closed":b.canUnmerge?"Unmerge selected units":"Select units that are part of merge groups to unmerge",children:"Unmerge Selected"})]}),r.length>0&&B.jsxs("div",{style:{fontSize:"10px",color:"#666",marginTop:"4px"},children:[b.groupsInvolved.length>0&&B.jsxs("div",{children:["Selected units in"," ",b.groupsInvolved.length," merge group(s)"]}),b.unmergedUnits.length>0&&B.jsxs("div",{children:[b.unmergedUnits.length," unmerged unit(s) selected"]})]}),r.length===0&&B.jsx("div",{style:{fontSize:"10px",color:"#999",fontStyle:"italic",marginTop:"4px"},children:"Select units to merge or unmerge"})]}),B.jsxs("div",{style:x,children:[B.jsxs("div",{style:X,onClick:()=>v(!h),children:[B.jsx("span",{style:P,children:"▶"}),"Manage Label Choices"]}),h&&B.jsxs("div",{children:[B.jsx("div",{style:{marginBottom:"4px"},children:m.map(j=>{const H=y(j);return B.jsxs("span",{style:R,children:[j,!c&&!H&&B.jsx("span",{style:z,onClick:o?()=>S(j):void 0,title:"Remove label choice",children:"×"})]},j)})}),!c&&B.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[B.jsx("input",{type:"text",value:f,onChange:j=>d(j.target.value),onKeyPress:j=>j.key==="Enter"&&o&&g(),placeholder:"Add label...",style:N}),B.jsx("button",{onClick:o?g:void 0,style:U,disabled:!f.trim(),children:"Add"})]})]})]}),B.jsxs("div",{style:L,children:[B.jsx("button",{onClick:o?A:void 0,style:G,children:c?"Reopen Curation":"Finalize Curation"}),B.jsxs("div",{style:{fontSize:"10px",color:"#666",marginTop:"2px"},children:["Status: ",c?"Closed":"Open"]})]})]})},nN=({zarrGroup:e,contexts:t,width:n,height:r})=>B.jsx(Jr,{context:t.unitSelection,children:B.jsx(TS,{contexts:t,editable:!0,children:B.jsx(rN,{zarrGroup:e,contexts:t,width:n,height:r})})}),rN=({zarrGroup:e,width:t,height:n})=>{const r=e.attrs.default_label_options||[];return B.jsx(tN,{defaultLabelOptions:r,width:t,height:n})},TS=({contexts:e,children:t,editable:n})=>{const{annotations:r,setAnnotation:i}=GF(e,"/",n),a=M.useMemo(()=>{try{return JSON.parse(r?.sorting_curation||"{}")}catch(u){return console.error("Error parsing sorting_curation:",u),{}}},[r]),o=M.useMemo(()=>u=>{if(!i)return;const l=Af(a,u);i("sorting_curation",JSON.stringify(l))},[i,a]);return B.jsx(wS.Provider,{value:{sortingCuration:a,sortingCurationDispatch:o,curating:!!i},children:t})},iN=({zarrGroup:e,contexts:t,width:n,height:r})=>{const[i,a]=M.useState(null),[o,u]=M.useState(null),[l,s]=M.useState(!0);return M.useEffect(()=>{let c=!1;return(async()=>{try{s(!0),u(null);const d=e.attrs.columns||[],h=await e.getDatasetData("rows_data",{});if(!h||h.length===0)throw new Error("Empty rows data");const v=new Uint8Array(h),m=new TextDecoder("utf-8").decode(v),D=JSON.parse(m);let p;try{const g=await e.getDatasetData("similarity_scores_data",{});if(g&&g.length>0){const y=new Uint8Array(g),S=new TextDecoder("utf-8").decode(y);p=JSON.parse(S)}}catch(g){console.warn("No similarity scores data found: "+g)}if(c)return;a({type:"UnitsTable",columns:d,rows:D,similarityScores:p})}catch(d){console.error("Error loading units table data:",d),u(`Failed to load units table data: ${d instanceof Error?d.message:String(d)}`)}finally{s(!1)}})(),()=>{c=!0}},[e]),o?B.jsxs("div",{style:{width:n,height:r,display:"flex",alignItems:"center",justifyContent:"center",color:"#666",backgroundColor:"#f5f5f5"},children:["Error: ",o]}):l?B.jsx("div",{style:{width:n,height:r,display:"flex",alignItems:"center",justifyContent:"center",color:"#666",backgroundColor:"#f5f5f5"},children:"Loading units table data..."}):i?B.jsx(Jr,{context:t.unitSelection,children:B.jsx(TS,{contexts:t,editable:!1,children:B.jsx(CS,{data:i,width:n,height:r})})}):B.jsx("div",{style:{width:n,height:r,display:"flex",alignItems:"center",justifyContent:"center",color:"#666",backgroundColor:"#f5f5f5"},children:"No units table data available"})},aN=e=>{const{ampScaleFactor:t,setAmpScaleFactor:n}=e,r=()=>{n(t*1.2)},i=()=>{n(t/1.2)},a=()=>{n(1)};return[{type:"button",callback:r,title:"Scale amplitude up [shift + mouse-wheel]",icon:B.jsx(M_,{}),keyCode:38},{type:"button",callback:a,title:"Reset scale amplitude",icon:B.jsx(XD,{})},{type:"button",callback:i,title:"Scale amplitude down [shift + mouse-wheel]",icon:B.jsx(A_,{}),keyCode:40}]},MS={forward:[[1,0,0],[0,1,0]],inverse:[[1,0,0],[0,1,0]]},ha=(e,t)=>({x:t.x*e.forward[0][0]+t.y*e.forward[0][1]+e.forward[0][2],y:t.x*e.forward[1][0]+t.y*e.forward[1][1]+e.forward[1][2]}),$m=(e,t)=>({x:t.x*e.inverse[0][0]+t.y*e.inverse[0][1]+e.inverse[0][2],y:t.x*e.inverse[1][0]+t.y*e.inverse[1][1]+e.inverse[1][2]}),oN=(e,t)=>({forward:_S(e.forward,t.forward),inverse:_S(t.inverse,e.inverse)}),uN=e=>({forward:[...e.map(t=>[...t])],inverse:sN(e)}),lN=e=>({forward:e.inverse,inverse:e.forward}),km=e=>e.forward[0][0]*e.forward[1][1]-e.forward[0][1]*e.forward[1][0],_S=(e,t)=>[[e[0][0]*t[0][0]+e[0][1]*t[1][0],e[0][0]*t[0][1]+e[0][1]*t[1][1],e[0][0]*t[0][2]+e[0][1]*t[1][2]+e[0][2]],[e[1][0]*t[0][0]+e[1][1]*t[1][0],e[1][0]*t[0][1]+e[1][1]*t[1][1],e[1][0]*t[0][2]+e[1][1]*t[1][2]+e[1][2]]],sN=e=>{const t=[[e[0][0],e[0][1]],[e[1][0],e[1][1]]],n=[e[0][2],e[1][2]],r=t[0][0]*t[1][1]-t[0][1]*t[1][0],i=[[t[1][1]/r,-t[0][1]/r],[-t[1][0]/r,t[0][0]/r]],a=[i[0][0]*n[0]+i[0][1]*n[1],i[1][0]*n[0]+i[1][1]*n[1]];return[[i[0][0],i[0][1],-a[0]],[i[1][0],i[1][1],-a[1]]]},Lm=(e,t,n={})=>{const r=n.shift!==void 0?n.shift:!0,i=n.shift!==void 0?n.alt:!1,[a,o]=M.useState(MS),u=M.useCallback(l=>{if(r&&!l.shiftKey||!r&&l.shiftKey||i&&!l.altKey||!i&&l.altKey)return;const s=l.currentTarget.getBoundingClientRect(),c={x:l.clientX-s.x,y:l.clientY-s.y},f=l.deltaY,d=1.3;let h=uN([[d,0,(1-d)*c.x],[0,d,(1-d)*c.y]]);f>0&&(h=lN(h));let v=oN(h,a);const m=ha(v,{x:0,y:0}),D=ha(v,{x:e,y:t});return 0<=m.x&&m.x<e&&0<=m.y&&m.y<t&&0<=D.x&&D.x<e&&0<=D.y&&D.y<t&&(v=MS),o(v),!1},[a,t,e,r,i]);return{affineTransform:a,handleWheel:u}},hl={border:"rgb(30, 30, 30)",base:"rgb(0, 0, 255)",selected:"rgb(50, 200, 50)",hover:"rgb(128, 128, 255)",selectedHover:"rgb(200, 200, 196)",dragged:"rgb(0, 0, 196)",draggedSelected:"rgb(180, 180, 150)",dragRect:"rgba(196, 196, 196, 0.5)",textLight:"rgb(228, 228, 228)",textDark:"rgb(32, 32, 32)"},cN=2*Math.PI,fN=(e,t)=>{const{layoutMode:n,affineTransform:r}=t;if(e.save(),r){const i=r.forward;e.transform(i[0][0],i[1][0],i[0][1],i[1][1],i[0][2],i[1][2])}n==="geom"?hN(e,t):dN(e,t),e.restore()},dN=(e,t)=>{const{pixelElectrodes:n,pixelRadius:r,showLabels:i,xMargin:a}=t,o=r>5&&i,u=t.colors??hl,l=o?2*r:0;e.clearRect(0,0,e.canvas.width,e.canvas.height);const s=a+l,c=e.canvas.width-a;if(e.beginPath(),n.forEach(f=>{e.moveTo(s,f.pixelY),e.lineTo(c,f.pixelY)}),e.strokeStyle=u.border,e.stroke(),o){const f=s-.5*r;e.font=`${r-3}px Arial`,e.fillStyle=u.textDark,e.textAlign="right",e.textBaseline="middle",n.forEach(d=>{e.fillText(`${d.e.label}`,f,d.pixelY)})}},hN=(e,t)=>{const{pixelElectrodes:n,selectedElectrodeIds:r,hoveredElectrodeId:i,draggedElectrodeIds:a,pixelRadius:o,showLabels:u,offsetLabels:l}=t,s=o>5&&u,c=t.colors??hl,f=n.map(d=>{const h=r.includes(d.e.id),v=(i??-1)===d.e.id,m=a.includes(d.e.id),D=h?m?c.draggedSelected:v?c.selectedHover:c.selected:m?c.dragged:v?c.hover:c.base;return{...d,color:D,textColor:h||v&&!m?c.textDark:c.textLight}});if(e.clearRect(0,0,e.canvas.width,e.canvas.height),f.forEach(d=>{e.fillStyle=d.color,e.beginPath(),e.ellipse(d.pixelX,d.pixelY,o,o,0,0,cN),e.fill()}),s){e.font=`${o}px Arial`,e.textAlign=l?"right":"center",e.textBaseline="middle";const d=l?1.4*o:0;f.forEach(h=>{e.fillStyle=l?c.textDark:h.textColor,e.fillText(`${h.e.label}`,h.pixelX-d,h.pixelY)})}},Cf=e=>e.reduce((t,n)=>t<=n?t:n,1/0),Tf=e=>e.reduce((t,n)=>t>=n?t:n,-1/0),Oo=10,ml=10,mN=(e,t)=>{const n=t||{};return t&&(Object.keys(n).length!==e.length||e.some(i=>!n[`${i}`]))?(console.warn("Attempt to compute electrode locations with mismatched lists. Skipping..."),[]):e.map(i=>{const a=n[`${i}`]||[i,0];return{id:i,label:`${i}`,x:a[0],y:a[1]}})},BS=new Map,FS=e=>{const t=JSON.stringify(e),n=BS.get(t);if(n!==void 0)return n;let r=Number.MAX_VALUE;e.forEach(a=>{e.forEach(o=>{const u=OD([a.x-o.x,a.y-o.y]);u!==0&&(r=Math.min(r,u))})});const i=.45*r;return BS.set(t,i),i},NS=(e,t)=>({xmin:Cf(e.map(n=>n.x))-t,xmax:Tf(e.map(n=>n.x))+t,ymin:Cf(e.map(n=>n.y))-t,ymax:Tf(e.map(n=>n.y))+t}),pN=e=>{const t=FS(e),n=NS(e,t),r=Sc(n),i=zD(n),a={x:r/2+n.xmin,y:i/2+n.ymin};return{boxAspect:r/i,boxCenter:a}},gN=e=>{const t={xmin:Cf(e.map(n=>n.x)),xmax:Tf(e.map(n=>n.x)),ymin:Cf(e.map(n=>n.y)),ymax:Tf(e.map(n=>n.y))};return t.xmin===t.xmax&&t.ymin===t.ymax?e.map((n,r)=>({...n,x:r,y:0})):e},vN=(e,t)=>s_(n=>{const r=Oo+n[0]*(e-2*Oo),i=ml+n[1]*(t-2*ml);return[r,i]}),yN=(e,t)=>{const n=e.map((a,o)=>({e:a,ind:o})).sort((a,o)=>-a.e.y+o.e.y).map(a=>a.ind),r=[];for(let a=0;a<e.length;a++)r.push([0,0]);for(let a=0;a<n.length;a++){const o=n[a];r[o]=[.5,(.5+a)/(1+e.length)]}const i=Zh(t,r);return e.map((a,o)=>{const[u,l]=i[o];return{e:a,pixelX:u,pixelY:l}})},bN=(e,t,n,r,i)=>{const a=e-Oo*2,o=t-ml*2,u=Sc(i),l=zD(i);return L5(a/u,o/l,r/n)},DN=(e,t,n,r)=>{const i=Sc(r),a=(e-i*n)/2,o=[n,0,a-r.xmin*n],u=[0,-n,(t+n*(r.ymin+r.ymax))/2];return[o,u,[0,0,1]]},SN=(e,t,n,r={})=>{const i=(e-Oo*2)/(t-ml*2),a=gN(n),{boxAspect:o}=pN(a);return r.disableAutoRotate||o===1||i===1||o>1==i>1?{electrodes:n,rotated:!1}:{electrodes:n.map(u=>({...u,x:u.y,y:-u.x})),rotated:!0}},xN=(e,t)=>{const n=e.map(i=>[i.x,i.y]),r=Zh(t,n);return e.map((i,a)=>{const[o,u]=r[a];return{e:i,pixelX:o,pixelY:u}})},RS=(e,t,n)=>{for(const r of e)if(OD([r.pixelX-n[0],r.pixelY-n[1]])<t)return r.e.id},OS=(e,t,n)=>{const r=t.xmin-n,i=t.xmax+n,a=t.ymin-n,o=t.ymax+n;return e.filter(u=>u.pixelX>r&&u.pixelX<i&&u.pixelY>a&&u.pixelY<o).map(u=>u.e.id)},jm=(e,t,n,r="geom",i=IS,a)=>{if(r==="vertical"){const m=vN(e,t),D=yN(n,m),p=(t-2*ml)/(1+n.length);return{transform:m,convertedElectrodes:D,pixelRadius:p}}const{electrodes:o,rotated:u}=SN(e,t,n,{disableAutoRotate:a.disableAutoRotate}),l=FS(o),s=NS(o,l),c=bN(e,t,l,i,s),f=l*c;let d=DN(e,t,c,s);const h=(e-Sc(s)*c)/2,v=xN(o,d);return u&&(d=[[-d[0][1],d[0][0],d[0][2]],[-d[1][1],d[1][0],d[1][2]],[-d[2][1],d[2][0],d[2][2]]]),{transform:d,convertedElectrodes:v,pixelRadius:f,xMargin:h}},zS={isActive:!1},wN=(e,t)=>{if(t.type==="INITIALIZE"){const{width:n,height:r,electrodes:i,layoutMode:a,maxElectrodePixelRadius:o}=t,{convertedElectrodes:u,pixelRadius:l,xMargin:s}=jm(n,r,i,a,o,{disableAutoRotate:t.disableAutoRotate});return{...e,convertedElectrodes:u,pixelRadius:l,draggedElectrodeIds:[],hoveredElectrodeId:void 0,dragState:zS,xMarginWidth:s??Oo}}else if(t.type==="DRAGUPDATE"){const n=r_(e.dragState,t.dragAction);if(!n.isActive&&n.dragRect){const r=ID(n.dragRect),i=OS(e.convertedElectrodes,r,e.pixelRadius),a=t.dragAction.shift?[...i,...t.selectedElectrodeIds||[]]:i;return{...e,draggedElectrodeIds:[],hoveredElectrodeId:void 0,pendingSelectedElectrodeIds:a,dragState:zS}}else if(n.dragRect){const r=ID(n.dragRect),i=OS(e.convertedElectrodes,r,e.pixelRadius);return i.length===e.draggedElectrodeIds.length&&i.filter(a=>!e.draggedElectrodeIds.includes(a)).length===0?{...e,hoveredElectrodeId:void 0,dragState:n}:{...e,hoveredElectrodeId:void 0,draggedElectrodeIds:i,dragState:n}}else return{...e,dragState:n}}else if(t.type==="UPDATEHOVER"){const n=RS(e.convertedElectrodes,e.pixelRadius,t.point);return n===e.hoveredElectrodeId?e:{...e,hoveredElectrodeId:n}}else if(t.type==="UPDATECLICK"){const n=RS(e.convertedElectrodes,e.pixelRadius,t.point);if(n===void 0)return!(t.shift||t.ctrl)&&t.selectedElectrodeIds.length>0?{...e,pendingSelectedElectrodeIds:[]}:e;const r=t.ctrl?t.selectedElectrodeIds.includes(n)?t.selectedElectrodeIds.filter(i=>i!==n):[...t.selectedElectrodeIds,n]:t.shift?[...t.selectedElectrodeIds,n]:[n];return{...e,hoveredElectrodeId:void 0,pendingSelectedElectrodeIds:r}}else return console.log("Error: unrecognized verb in electrode geometry reducer."),e},US=!1,IS=25,$S={showLabels:!0,maxElectrodePixelRadius:IS},EN=e=>{const t=e.currentTarget.getBoundingClientRect();return[e.clientX-t.x,e.clientY-t.y]},AN=()=>({selectedElectrodeIds:[],setSelectedElectrodeIds:e=>{}}),kS=e=>{const{width:t,height:n,electrodes:r,disableAutoRotate:i,affineTransform:a}=e,{selectedElectrodeIds:o,setSelectedElectrodeIds:u}=AN(),l=e.disableSelection??!1,s=e.offsetLabels??!1,c=e.colors??hl,f=e.layoutMode??"geom",d=e.maxElectrodePixelRadius||$S.maxElectrodePixelRadius,[h,v]=M.useReducer(wN,{convertedElectrodes:[],pixelRadius:-1,draggedElectrodeIds:[],pendingSelectedElectrodeIds:o||[],dragState:{isActive:!1},xMarginWidth:-1}),{affineTransform:m,handleWheel:D}=Lm(t,n,{shift:!0,alt:!1}),p=M.useMemo(()=>{const T=h.convertedElectrodes.map(_=>{const x=ha(m,{x:_.pixelX,y:_.pixelY});return{..._,pixelX:x.x,pixelY:x.y}});return{...h,convertedElectrodes:T,pixelRadius:h.pixelRadius*Math.sqrt(km(m))}},[m,h]),g=M.useMemo(()=>T=>{const _=EN(T),x=$m(m,{x:_[0],y:_[1]});return[x.x,x.y]},[m]);M.useEffect(()=>{v({type:"INITIALIZE",electrodes:r,width:t,height:n,maxElectrodePixelRadius:d,layoutMode:f,disableAutoRotate:i})},[t,n,r,f,d,i]),M.useEffect(()=>{u(h.pendingSelectedElectrodeIds)},[u,h.pendingSelectedElectrodeIds]);const y=M.useRef(null),S=M.useRef(0),w=l||B.jsx(l_,{width:t,height:n,newState:h.dragState}),b=M.useCallback(T=>{if(!a_(T,{nextDragStateUpdate:y,nextFrame:S,reducer:v,reducerOtherProps:{type:"DRAGUPDATE"}})){const x=g(T);v({type:"UPDATEHOVER",point:x})}},[g]),E=M.useCallback(T=>{o_(T,{nextDragStateUpdate:y,reducer:v,reducerOtherProps:{type:"DRAGUPDATE"}})},[]),C=M.useCallback(T=>{if(h.dragState.isActive)u_(T,{nextDragStateUpdate:y,reducer:v,reducerOtherProps:{type:"DRAGUPDATE",selectedElectrodeIds:o}});else{const _=g(T);v({type:"UPDATECLICK",point:_,shift:T.shiftKey,ctrl:T.ctrlKey,selectedElectrodeIds:o||[]})}},[h.dragState.isActive,o,g]),A=M.useMemo(()=>{const T={pixelElectrodes:p.convertedElectrodes,selectedElectrodeIds:o||[],hoveredElectrodeId:h.hoveredElectrodeId,draggedElectrodeIds:h.draggedElectrodeIds,pixelRadius:p.pixelRadius,showLabels:e.showLabels??$S.showLabels,offsetLabels:s,layoutMode:e.layoutMode??"geom",xMargin:h.xMarginWidth,colors:c,affineTransform:a};return B.jsx(ir,{width:t,height:n,draw:fN,drawData:T})},[t,n,p.convertedElectrodes,o,h.hoveredElectrodeId,h.draggedElectrodeIds,p.pixelRadius,e.showLabels,s,e.layoutMode,h.xMarginWidth,c,a]);return M.useMemo(()=>US,[h.convertedElectrodes,o,h.hoveredElectrodeId,h.draggedElectrodeIds,h.pixelRadius,e.showLabels,s,e.layoutMode,h.xMarginWidth,t,n,c]),B.jsxs("div",{style:{width:t,height:n,position:"relative"},onMouseMove:b,onMouseUp:C,onMouseDown:E,onWheel:D,children:[w,US,A]})},CN=e=>1/e,ma=(e,t,n,r,i)=>{const a=[];return n.forEach((o,u)=>{for(const l of t){const s=l.electrodeIndices.indexOf(u);if(s>=0){let c;const f=l.waveformStdDev,d=l.waveformPercentiles;if(r==="normal"?c=l.waveform[s]:r==="lower"?c=f?l.waveform[s].map((h,v)=>l.waveform[s][v]-f[s][v]):void 0:r==="upper"?c=f?l.waveform[s].map((h,v)=>l.waveform[s][v]+f[s][v]):void 0:r==="percentile1"?c=d?l.waveform[s].map((h,v)=>d[0][s][v]):void 0:r==="percentile2"?c=d?l.waveform[s].map((h,v)=>d[1][s][v]):void 0:r==="percentile3"?c=d&&2<d.length?l.waveform[s].map((h,v)=>d[2][s][v]):void 0:r==="percentile4"&&(c=d&&3<d.length?l.waveform[s].map((h,v)=>d[3][s][v]):void 0),c){const h=c.map((m,D)=>[(c?.length||0)/2+(D-(c?.length||0)/2)*i,m]),v=Zh(e,h);a.push({pointsInPaintBox:v,offsetFromParentCenter:[o.pixelX,o.pixelY],color:l.waveformColors.base})}}}}),a},TN=(e,t)=>{const{pixelSpacePaths:n,pixelSpacePathsLower:r,pixelSpacePathsUpper:i,pixelSpacePathsPercentile1:a,pixelSpacePathsPercentile2:o,pixelSpacePathsPercentile3:u,pixelSpacePathsPercentile4:l,xMargin:s,waveformWidth:c,affineTransform:f,useUnitColors:d}=t;if(!n||n.length===0)return;if(e.resetTransform(),e.clearRect(0,0,e.canvas.width,e.canvas.height),e.save(),f){const g=f.forward;e.transform(g[0][0],g[1][0],g[0][1],g[1][1],g[0][2],g[1][2])}e.translate(s,0);const h=e.getTransform();r&&i&&r.forEach((g,y)=>{const S=r[y],w=i[y];e.fillStyle="#dddddd",e.strokeStyle="#bbbbbb",e.lineWidth=1,e.translate(S.offsetFromParentCenter[0],S.offsetFromParentCenter[1]),e.beginPath(),e.moveTo(S.pointsInPaintBox[0][0],S.pointsInPaintBox[0][1]);for(let b=0;b<S.pointsInPaintBox.length;b++)e.lineTo(S.pointsInPaintBox[b][0],S.pointsInPaintBox[b][1]);for(let b=w.pointsInPaintBox.length-1;b>=0;b--)e.lineTo(w.pointsInPaintBox[b][0],w.pointsInPaintBox[b][1]);e.fill(),e.stroke(),e.setTransform(h)});let v,m,D,p;a&&o&&u&&l?(v=a,m=o,D=u,p=l):a&&o&&!u&&!l?(v=void 0,m=a,D=o,p=void 0):(v=void 0,m=void 0,D=void 0,p=void 0),v&&v.length>0&&p&&p.length>0&&v.forEach((g,y)=>{if(!v||!p)throw Error("unexpected");const S=v[y],w=p[y];e.fillStyle="#dddddd",e.strokeStyle="#dddddd",e.lineWidth=1,e.translate(S.offsetFromParentCenter[0],S.offsetFromParentCenter[1]),e.beginPath(),e.moveTo(S.pointsInPaintBox[0][0],S.pointsInPaintBox[0][1]);for(let b=0;b<S.pointsInPaintBox.length;b++)e.lineTo(S.pointsInPaintBox[b][0],S.pointsInPaintBox[b][1]);for(let b=w.pointsInPaintBox.length-1;b>=0;b--)e.lineTo(w.pointsInPaintBox[b][0],w.pointsInPaintBox[b][1]);e.fill(),e.stroke(),e.setTransform(h)}),m&&m.length>0&&m.length>0&&D&&D.length>0&&m.forEach((g,y)=>{if(!m||!D)throw Error("unexpected");const S=m[y],w=D[y];e.fillStyle="#bbbbbb",e.strokeStyle="#bbbbbb",e.lineWidth=1,e.translate(S.offsetFromParentCenter[0],S.offsetFromParentCenter[1]),e.beginPath(),e.moveTo(S.pointsInPaintBox[0][0],S.pointsInPaintBox[0][1]);for(let b=0;b<S.pointsInPaintBox.length;b++)e.lineTo(S.pointsInPaintBox[b][0],S.pointsInPaintBox[b][1]);for(let b=w.pointsInPaintBox.length-1;b>=0;b--)e.lineTo(w.pointsInPaintBox[b][0],w.pointsInPaintBox[b][1]);e.fill(),e.stroke(),e.setTransform(h)}),n.forEach(g=>{e.strokeStyle=d?g.color:"black",e.lineWidth=c,e.translate(g.offsetFromParentCenter[0],g.offsetFromParentCenter[1]),e.beginPath(),e.moveTo(g.pointsInPaintBox[0][0],g.pointsInPaintBox[0][1]),g.pointsInPaintBox.forEach(y=>{e.lineTo(y[0],y[1])}),e.stroke(),e.setTransform(h)}),e.restore()},MN=e=>{const{electrodes:t,waveforms:n,oneElectrodeHeight:r,oneElectrodeWidth:i,yScale:a,horizontalStretchFactor:o,width:u,height:l,layoutMode:s,waveformWidth:c,affineTransform:f,useUnitColors:d}=e;return M.useMemo(()=>{const v=n.length>0&&n[0].waveform.length>0?n[0].waveform[0].length:0,m=i/v,D=-i*(.5+1/v),p=a*r/2,g=ze([[m,0,D],[0,-p,0],[0,0,1]]).toArray(),y=ma(g,n,t,"normal",o),S=ma(g,n,t,"lower",o),w=ma(g,n,t,"upper",o);let b=ma(g,n,t,"percentile1",o),E=ma(g,n,t,"percentile2",o),C=ma(g,n,t,"percentile3",o),A=ma(g,n,t,"percentile4",o);b.length===0&&(b=void 0),E.length===0&&(E=void 0),C.length===0&&(C=void 0),A.length===0&&(A=void 0);const T=s==="vertical"?(u-i)/2:0,_={pixelSpacePaths:y,pixelSpacePathsLower:S,pixelSpacePathsUpper:w,pixelSpacePathsPercentile1:b,pixelSpacePathsPercentile2:E,pixelSpacePathsPercentile3:C,pixelSpacePathsPercentile4:A,xMargin:T,waveformWidth:c,affineTransform:f,useUnitColors:d};return B.jsx(ir,{width:u,height:l,draw:TN,drawData:_})},[n,t,a,u,l,i,r,s,c,f,o,d])},_N={colors:{border:"rgb(120, 100, 120)",base:"rgb(240, 240, 240)",selected:"rgb(196, 196, 128)",hover:"rgb(128, 128, 255)",selectedHover:"rgb(200, 200, 196)",dragged:"rgb(0, 0, 196)",draggedSelected:"rgb(180, 180, 150)",dragRect:"rgba(196, 196, 196, 0.5)",textLight:"rgb(162, 162, 162)",textDark:"rgb(32, 150, 150)"}},BN=e=>{const t=e.colors??_N.colors,{electrodes:n,waveforms:r,ampScaleFactor:i,horizontalStretchFactor:a,layoutMode:o,hideElectrodes:u,width:l,height:s,showChannelIds:c,useUnitColors:f,waveformWidth:d,disableAutoRotate:h}=e,v=1e3,{handleWheel:m,affineTransform:D}=Lm(l,s,{shift:!0,alt:!0}),p=M.useMemo(()=>B.jsx(kS,{electrodes:n,width:l,height:s,layoutMode:o,colors:t,showLabels:c,maxElectrodePixelRadius:v,disableSelection:!0,disableAutoRotate:h,affineTransform:D}),[n,l,s,o,t,c,h,D]),{convertedElectrodes:g,pixelRadius:y,xMargin:S}=jm(l,s,n,o,v,{disableAutoRotate:h}),w=S||Oo,b=M.useMemo(()=>CN(e.peakAmplitude),[e.peakAmplitude]),E=M.useMemo(()=>i*b,[i,b]),C=o==="geom"?y*2:s/n.length,A=o==="geom"?y*2:l-w-(c?2*y:0),T=B.jsx(MN,{electrodes:g,waveforms:r,oneElectrodeHeight:C,oneElectrodeWidth:A,horizontalStretchFactor:a,yScale:E,width:l,height:s,layoutMode:o,waveformWidth:d,affineTransform:D,useUnitColors:f});return B.jsxs("div",{style:{width:l,height:s,position:"relative"},onWheel:m,children:[!u&&p,T]})},FN=({allChannelIds:e,channelIds:t,units:n,layoutMode:r,hideElectrodes:i,channelLocations:a,samplingFrequency:o,peakAmplitude:u,ampScaleFactor:l,horizontalStretchFactor:s,showChannelIds:c,useUnitColors:f,showReferenceProbe:d,disableAutoRotate:h,width:v,height:m})=>{const D=M.useMemo(()=>{const w=a||{};return t.map(b=>({id:b,label:`${b}`,x:w[`${b}`]!==void 0?w[`${b}`][0]:Ct(b),y:w[`${b}`]!==void 0?w[`${b}`][1]:0}))},[t,a]),p=M.useMemo(()=>{const w=a||{};return e.map(b=>({id:b,label:`${b}`,x:w[`${b}`]!==void 0?w[`${b}`][0]:Ct(b),y:w[`${b}`]!==void 0?w[`${b}`][1]:0}))},[e,a]),g=v/4,y=M.useMemo(()=>n.map(w=>{const b={base:w.waveformColor},E=[];for(const C of w.channelIds)E.push(D.map(A=>A.id).indexOf(C));return{electrodeIndices:E,waveform:w.waveform,waveformStdDev:w.waveformStdDev,waveformPercentiles:w.waveformPercentiles,waveformColors:b}}),[D,n]),S=B.jsx(BN,{waveforms:y,electrodes:D,ampScaleFactor:l,horizontalStretchFactor:s,layoutMode:a?r:"vertical",hideElectrodes:i,width:d?v-g:v,height:m,showLabels:!0,peakAmplitude:u,samplingFrequency:o,showChannelIds:c,useUnitColors:f,waveformWidth:2,disableAutoRotate:h});return d?B.jsxs("div",{style:{position:"relative",width:v,height:m},children:[B.jsx("div",{style:{position:"absolute",left:0,top:0,width:g,height:m},children:B.jsx(kS,{electrodes:p,disableSelection:!1,width:g,height:m})}),B.jsx("div",{style:{position:"absolute",left:g,top:0,width:v-g,height:m},children:S})]}):S},NN=({data:e,width:t,height:n})=>{const r=M.useMemo(()=>{const k=[];for(const q of e.averageWaveforms)for(const Y of q.channelIds)k.includes(Y)||k.push(Y);return yr(k)},[e.averageWaveforms]),[i,a]=M.useState({...xf,onlyShowSelected:!1}),{selectedUnitIds:o,currentUnitId:u,orderedUnitIds:l,plotClickHandlerGenerator:s,unitIdSelectionDispatch:c}=qr(),[f,d]=M.useState(1),[h,v]=M.useState("geom"),[m,D]=M.useState(!0),[p,g]=M.useState(!1),[y,S]=M.useState(e.showReferenceProbe||!1),[w,b]=M.useState(!1),[E,C]=M.useState(1),[A,T]=M.useState(!0),[_,x]=M.useState(!0);M.useEffect(()=>{c({type:oo,newUnitOrder:yr(e.averageWaveforms.map(k=>k.unitId))})},[e.averageWaveforms,c]);const[F,R]=M.useState(2),z=M.useMemo(()=>{let k=0;return e.averageWaveforms.forEach(q=>{q.waveform.forEach(Y=>{Y.forEach(ee=>{const te=Math.abs(ee);te>k&&(k=te)})})}),k},[e.averageWaveforms]),N=M.useMemo(()=>e.averageWaveforms.filter(k=>i.onlyShowSelected?o.has(k.unitId):!0).map(k=>{const q=[{channelIds:k.channelIds,waveform:ON(k.waveform),waveformStdDev:m&&!w?k.waveformStdDev:void 0,waveformPercentiles:m&&!w&&k.waveformPercentiles?zN(k.waveformPercentiles,k.waveform):void 0,waveformColor:wr(Ct(k.unitId))}],Y={allChannelIds:r,channelIds:k.channelIds,units:q,layoutMode:h,hideElectrodes:A,channelLocations:e.channelLocations,samplingFrequency:e.samplingFrequency,peakAmplitude:z,ampScaleFactor:f,horizontalStretchFactor:E,showChannelIds:p,useUnitColors:_,width:120*F+(y?120*F/4:0),height:120*F,showReferenceProbe:y,disableAutoRotate:!0};return{unitId:k.unitId,key:k.unitId,label:`Unit ${k.unitId}`,labelColor:wr(Ct(k.unitId)),clickHandler:i.onlyShowSelected?void 0:s(k.unitId),props:Y}}),[e.averageWaveforms,e.channelLocations,e.samplingFrequency,r,z,h,f,s,i.onlyShowSelected,o,F,m,p,y,w,E,A,_]),U=M.useMemo(()=>l?l.map(k=>N.filter(q=>q.unitId===k)[0]).filter(k=>k!==void 0):N,[N,l]),I=M.useMemo(()=>w?RN(U):U,[U,w]),L=M.useMemo(()=>[{type:"button",callback:()=>{C(k=>k*1.1)},title:"Increase horizontal stretch [alt + mouse-wheel]",icon:B.jsx(T_,{})},{type:"button",callback:()=>{C(1)},title:"Reset scale amplitude",icon:B.jsx(XD,{})},{type:"button",callback:()=>{C(k=>k/1.1)},title:"Decrease horizontal stretch [alt + mouse-wheel]",icon:B.jsx(C_,{})}],[]),G=M.useMemo(()=>{const k=aN({ampScaleFactor:f,setAmpScaleFactor:d}),q={type:"toggle",subtype:"checkbox",callback:()=>v(de=>de==="geom"?"vertical":"geom"),title:"Show electrode geometry",selected:h==="geom"},Y={type:"toggle",subtype:"checkbox",callback:()=>T(de=>!de),title:"Show electrodes",selected:!A},ee=[{type:"button",callback:()=>R(de=>de*1.3),title:"Increase box size",icon:B.jsx(Tc,{})},{type:"button",callback:()=>R(de=>de/1.3),title:"Decrease box size",icon:B.jsx(Cc,{})}],te={type:"toggle",subtype:"checkbox",callback:()=>D(de=>!de),title:"Show waveform stdev",selected:m===!0},ne={type:"toggle",subtype:"checkbox",callback:()=>g(de=>!de),title:"Show channel IDs",selected:p===!0},oe={type:"toggle",subtype:"checkbox",callback:()=>S(de=>!de),title:"Show reference probes",selected:y===!0},W={type:"toggle",subtype:"checkbox",callback:()=>b(de=>!de),title:"Show overlapping",selected:w===!0},ce={type:"toggle",subtype:"checkbox",callback:()=>x(de=>!de),title:"Use unit colors",selected:_===!0};return[{type:"divider"},...ee,{type:"divider"},...k,{type:"divider"},...L,{type:"divider"},q,Y,{type:"divider"},te,{type:"divider"},ne,{type:"divider"},oe,{type:"divider"},W,{type:"divider"},ce]},[h,f,m,p,w,y,L,A,_]),X=M.useCallback(k=>{k.shiftKey&&!k.altKey?k.deltaY<0?d(q=>q*1.3):d(q=>q/1.3):k.altKey&&!k.shiftKey&&(k.deltaY<0?C(q=>q*1.1):C(q=>q/1.1))},[]),P=30,j=M.useCallback(k=>{k&&k.addEventListener("wheel",q=>{(q.shiftKey||q.altKey)&&q.preventDefault()})},[]),H=fl;return B.jsxs("div",{ref:k=>j(k),onWheel:X,children:[B.jsxs(Ro,{width:t,height:n-P,initialPosition:H,adjustable:!1,children:[B.jsx(dl,{width:H,height:n,customActions:G}),B.jsx(wc,{width:0,height:0,children:B.jsx(xc,{plots:I,plotComponent:FN,selectedPlotKeys:i.onlyShowSelected?void 0:o,currentPlotKey:u})})]}),B.jsx("div",{style:{position:"absolute",top:n-P,height:P,overflow:"hidden"},children:B.jsx(wf,{options:i,setOptions:a})})]})},RN=e=>{if(e.length===0)return e;const t={...e[0],props:{...e[0].props}},n=t.props;t.key="overlapping",t.label="Overlapping",t.labelColor="black",t.unitId="overlapping",n.height*=3;const r=new Set;for(const a of e)for(const o of a.props.channelIds)r.add(o);const i=yr([...r]);return n.channelIds=i,n.units=e.map(a=>a.props.units[0]),[t]},ON=e=>e.map(t=>{const n=LS(t);return t.map(r=>r-n)}),zN=(e,t)=>{const n=[];for(let r=0;r<e.length;r++)n.push(e[r].map((i,a)=>{const o=LS(t[a]);return i.map(u=>u-o)}));return n},LS=e=>e.length>0?W5(e):0,UN=e=>B.jsx(Jr,{context:e.contexts.unitSelection,children:B.jsx(IN,{...e})}),IN=({zarrGroup:e,width:t,height:n})=>{const[r,i]=M.useState(null);return M.useEffect(()=>{let a=!1;return(async()=>{const u=[],l=e.attrs.num_average_waveforms||0,s=e.attrs.average_waveforms,c=s.length;c!==l&&console.warn(`numUnits (${c}) !== numAverageWaveforms (${l})`);for(let f=0;f<l;f++){const d=`waveform_${f}`,h=await e.getGroup(d);if(!h){console.warn(`No group for ${d}`);continue}if(h.datasets.find(g=>g.name==="waveform")===void 0){console.warn(`No waveform dataset for ${d}`);continue}const v=await e.getDataset(`${d}/waveform`);if(!v){console.warn(`Could not load waveform dataset for ${d}`);continue}const m=v.shape,D=await e.getDatasetData(`${d}/waveform`,{});let p;if(h.datasets.find(g=>g.name==="waveform_std_dev")===void 0?p=void 0:p=await e.getDatasetData(`${d}/waveform_std_dev`,{}),D){const g=s.find(y=>y.name===d);g&&u.push({unitId:g.unit_id,channelIds:g.channel_ids,waveform:jS(D,m),waveformStdDev:p?jS(p,m):void 0})}}a||i({type:"AverageWaveforms",averageWaveforms:u})})(),()=>{a=!0}},[e]),r?B.jsx(NN,{data:r,width:t,height:n}):B.jsx("div",{children:"Loading..."})},jS=(e,t)=>{if(t.length!==2)throw Error("shape.length should be 2");const[n,r]=t;if(e.length!==n*r)throw Error(`data.length does not match shape. Expected ${n*r}, got ${e.length}`);const i=[];for(let a=0;a<r;a++){const o=[];for(let u=0;u<n;u++)o.push(e[u*r+a]);i.push(o)}return i},HS=20,$N=({data:e,width:t,height:n})=>{const[r,i]=M.useState(!1),{selectedUnitIds:a}=qr(),o=M.useMemo(()=>yr([...a]),[a]),u=e.hideUnitSelector,l=M.useMemo(()=>{const p=e.crossCorrelograms.filter(y=>o.includes(y.unitId1)&&o.includes(y.unitId2)),g=[];for(const y of o)for(const S of o){const w=p.filter(b=>b.unitId1===y&&b.unitId2===S)[0];w?g.push(w):g.push(void 0)}return g},[e.crossCorrelograms,o]),s=u?0:100,c=fl,f=t-s-c,d=n,h=M.useMemo(()=>{const p=o.length,{plotWidth:g,plotHeight:y}=PS(f,d,p);return l.map((S,w)=>({key:`${w}`,unitId:S?S.unitId1:0,label:S?g>80?`Unit ${S.unitId1}/${S.unitId2}`:`${S.unitId1}/${S.unitId2}`:"",labelColor:"black",clickHandler:void 0,props:{binEdgesSec:S?S.binEdgesSec:void 0,binCounts:S?S.binCounts:void 0,color:S?.unitId1===S?.unitId2?wr(Ct(S?.unitId1)):"gray",width:g,height:y,hideXAxis:!r}}))},[l,f,d,o,r]),v=M.useMemo(()=>[{type:"toggle",subtype:"checkbox",callback:()=>i(g=>!g),title:"Show X Axis",selected:r===!0}],[r]),m=M.useMemo(()=>{const p=new Set;e.crossCorrelograms.forEach(y=>{p.add(y.unitId1),p.add(y.unitId2)});const g=yr(Array.from(p));return{type:"UnitsTable",columns:[],rows:g.map(y=>({unitId:y,values:{}}))}},[e.crossCorrelograms]),D=B.jsxs(Ro,{width:t-s,height:n,initialPosition:c,adjustable:!1,children:[B.jsx(dl,{width:c,height:n,customActions:v}),B.jsx(wc,{width:0,height:0,disableScroll:!0,children:o.length>HS?B.jsxs("div",{children:["Not showing cross-correlogram matrix. Too many units selected (max ="," ",HS,")."]}):o.length===0?B.jsx("div",{children:"Select one or more units to view cross-correlograms."}):B.jsx(xc,{plots:h,plotComponent:xS,selectedPlotKeys:void 0,numPlotsPerRow:o.length})})]});return u?D:B.jsxs("div",{style:{position:"relative",width:t,height:n},children:[B.jsx("div",{style:{position:"absolute",left:0,top:0,width:s,height:n,borderRight:"1px solid #ccc",boxSizing:"border-box",padding:10,backgroundColor:"#f9f9f9"},children:B.jsx(CS,{data:m,width:s,height:n})}),B.jsx("div",{style:{position:"absolute",left:s,top:0,width:t-s,height:n},children:D})]})},PS=(e,t,n)=>{const r=Math.min((e-30-(n-1)*7)/n,(t-30-(n-1)*7)/n);return{plotWidth:r,plotHeight:r}},kN=({zarrGroup:e,contexts:t,width:n,height:r})=>{const[i,a]=M.useState(null);return M.useEffect(()=>{let o=!1;return(async()=>{const l=[],s=e.attrs.num_cross_correlograms||0;if(s===0){o||a({type:"CrossCorrelograms",crossCorrelograms:[],hideUnitSelector:e.attrs.hide_unit_selector||!1});return}const c=await e.getDatasetData("bin_edges_sec",{}),f=await e.getDatasetData("bin_counts",{});if(!c||!f){console.error("Failed to load cross-correlograms data");return}const d=Array.from(c),h=new Int32Array(f),v=d.length-1,m=e.attrs.cross_correlograms;for(let p=0;p<s;p++){const g=m[p],y=p*v,S=Array.from(h.slice(y,y+v));l.push({unitId1:g.unit_id1,unitId2:g.unit_id2,binEdgesSec:d,binCounts:S})}const D=e.attrs.hide_unit_selector||!1;o||a({type:"CrossCorrelograms",crossCorrelograms:l,hideUnitSelector:D})})(),()=>{o=!0}},[e]),i?B.jsx(Jr,{context:t.unitSelection,children:B.jsx($N,{data:i,width:n,height:r})}):B.jsx("div",{children:"Loading..."})},LN=1.4,jN=(e,t,n,r)=>{if(e.visibleStartTimeSec===void 0||e.visibleEndTimeSec===void 0||e.startTimeSec===void 0||e.endTimeSec===void 0)return console.warn(`WARNING: * Attempt to call zoomTime() with uninitialized state ${e}.`),{visibleStartTimeSec:e.visibleStartTimeSec,visibleEndTimeSec:e.visibleEndTimeSec};const i=e.endTimeSec-e.startTimeSec,a=e.visibleEndTimeSec-e.visibleStartTimeSec;if(a===i&&t==="out")return{visibleStartTimeSec:e.startTimeSec,visibleEndTimeSec:e.endTimeSec};let o=n??LN;o=t==="in"?1/o:o;const u=Math.min(a*o,i);if(u>=i)return{...e,visibleStartTimeSec:e.startTimeSec,visibleEndTimeSec:e.endTimeSec};const l=r!==void 0?r:e.currentTime??e.visibleStartTimeSec+a/2,s=(l-e.visibleStartTimeSec)/a;let c=Math.max(l-s*u,e.startTimeSec);const f=Math.min(c+u,e.endTimeSec);return c=f-u,{visibleStartTimeSec:c,visibleEndTimeSec:f}},qS=(e,t)=>{if(e.visibleStartTimeSec===void 0||e.visibleEndTimeSec===void 0||e.startTimeSec===void 0||e.endTimeSec===void 0)return console.warn(`WARNING: Attempt to call panTime() with uninitialized state ${e}.`),e;const n=e.visibleEndTimeSec-e.visibleStartTimeSec;let r=e.visibleStartTimeSec,i=e.visibleEndTimeSec;if(t>0)i=Math.min(e.visibleEndTimeSec+t,e.endTimeSec),r=Math.max(i-n,e.startTimeSec);else if(t<0)r=Math.max(e.visibleStartTimeSec+t,e.startTimeSec),i=Math.min(r+n,e.endTimeSec);else return e;const o=!0?e.currentTime:void 0;return r===e.visibleStartTimeSec&&i===e.visibleEndTimeSec?e:{...e,visibleStartTimeSec:r,visibleEndTimeSec:i,currentTimeSec:o}},HN=(e,t)=>{if(e.visibleStartTimeSec===void 0||e.visibleEndTimeSec===void 0||e.startTimeSec===void 0||e.endTimeSec===void 0)return console.warn(`WARNING: * Attempt to call panTime() with uninitialized state ${e}.`),{visibleStartTimeSec:e.visibleStartTimeSec,visibleEndTimeSec:e.visibleEndTimeSec};const n=e.visibleEndTimeSec-e.visibleStartTimeSec,r=t.panAmountPct/100*n*(t.type==="back"?-1:1);return qS(e,r)},PN=(e,t)=>{if(e.visibleStartTimeSec===void 0||e.visibleEndTimeSec===void 0||e.startTimeSec===void 0||e.endTimeSec===void 0)return console.warn(`WARNING: Attempt to call panTime() with uninitialized state ${e}.`),e;const n=t.deltaT;return qS(e,n)},VS=Nt.createContext(void 0),Mf=()=>{const e=M.useContext(VS);if(!e)throw new Error("useTimeseriesSelection must be used within a TimeseriesSelectionContext");const t=e.dispatch,n=M.useCallback(u=>{t({type:"initializeTimeseries",startTimeSec:u.startTimeSec,endTimeSec:u.endTimeSec,initialVisibleStartTimeSec:u.initialVisibleStartTimeSec,initialVisibleEndTimeSec:u.initialVisibleEndTimeSec})},[t]),r=M.useCallback((u,l)=>{t({type:"setVisibleTimeRange",visibleStartTimeSec:u,visibleEndTimeSec:l})},[t]),i=M.useCallback(u=>{t({type:"setCurrentTime",currentTime:u})},[t]),a=M.useCallback(u=>{t({type:"zoomVisibleTimeRange",factor:u})},[t]),o=M.useCallback(u=>{t({type:"translateVisibleTimeRangeFrac",frac:u})},[t]);if(e===void 0)throw new Error("useTimeseriesSelection must be used within a TimeseriesSelectionContext.Provider");return{initializeTimeseriesSelection:n,setVisibleTimeRange:r,setCurrentTime:i,zoomVisibleTimeRange:a,translateVisibleTimeRangeFrac:o,timeseriesSelection:e.timeseriesSelection,startTimeSec:e.timeseriesSelection.startTimeSec,endTimeSec:e.timeseriesSelection.endTimeSec,visibleStartTimeSec:e.timeseriesSelection.visibleStartTimeSec,visibleEndTimeSec:e.timeseriesSelection.visibleEndTimeSec,currentTime:e.timeseriesSelection.currentTime}},_f=()=>{const{visibleStartTimeSec:e,visibleEndTimeSec:t,currentTime:n,setCurrentTime:r,startTimeSec:i,endTimeSec:a,setVisibleTimeRange:o}=Mf(),u=M.useCallback((d,h,v)=>{const m=jN({visibleStartTimeSec:e,visibleEndTimeSec:t,currentTime:n,startTimeSec:i,endTimeSec:a},d,h,v);m.visibleStartTimeSec!==void 0&&m.visibleEndTimeSec!==void 0&&o(m.visibleStartTimeSec,m.visibleEndTimeSec)},[e,t,n,i,a,o]),l=M.useCallback((d,h)=>{const v=HN({visibleStartTimeSec:e,visibleEndTimeSec:t,startTimeSec:i,endTimeSec:a,currentTime:n},{type:d,panAmountPct:h??10});v.visibleStartTimeSec!==void 0&&v.visibleEndTimeSec!==void 0&&o(v.visibleStartTimeSec,v.visibleEndTimeSec)},[e,t,i,a,n,o]),s=M.useCallback(d=>{const h=PN({visibleStartTimeSec:e,visibleEndTimeSec:t,startTimeSec:i,endTimeSec:a,currentTime:n},{deltaT:d});h.visibleStartTimeSec!==void 0&&h.visibleEndTimeSec!==void 0&&o(h.visibleStartTimeSec,h.visibleEndTimeSec)},[e,t,i,a,n,o]),c=M.useCallback(d=>{if(e===void 0||t===void 0)return;const h=t-e,v=d,m=v+h;o(v,m)},[e,t,o]),f=M.useCallback((d,h)=>{if(e===void 0||t===void 0)return;const v=e+d*(t-e);r(v)},[e,t,r]);return{visibleStartTimeSec:e,visibleEndTimeSec:t,setVisibleTimeRange:o,zoomTimeseriesSelection:u,panTimeseriesSelection:l,panTimeseriesSelectionDeltaT:s,panTimeseriesSelectionVisibleStartTimeSec:c,setCurrentTimeFraction:f}},GS=()=>{const[e,t]=M.useState(!1),n=M.useMemo(()=>[{id:"only-show-selected",label:"Only Show Selected",tooltip:"Toggle visibility of only selected units",icon:e?"👁️":"👁️‍🗨️",isActive:e,onClick:()=>t(r=>!r)}],[e]);return{onlyShowSelected:e,customToolbarActions:n}},qN=[{name:"1ms",secondsPerTick:.001,countPerLargerUnit:10,scale_appropriate_label:e=>`${e%1e3} ms`},{name:"10ms",secondsPerTick:.01,countPerLargerUnit:10,scale_appropriate_label:e=>`${e*10%1e3} ms`},{name:"100ms",secondsPerTick:.1,countPerLargerUnit:10,scale_appropriate_label:e=>`${e*100%1e3} ms`},{name:"1s",secondsPerTick:1,countPerLargerUnit:10,scale_appropriate_label:e=>`${e%60} s`},{name:"10s",secondsPerTick:10,countPerLargerUnit:6,scale_appropriate_label:e=>`${e*10%60} s`},{name:"1min",secondsPerTick:60,countPerLargerUnit:10,scale_appropriate_label:e=>`${e%60} min`},{name:"10min",secondsPerTick:60*10,countPerLargerUnit:6,scale_appropriate_label:e=>`${e*10%60} min`},{name:"1hr",secondsPerTick:60*60,countPerLargerUnit:6,scale_appropriate_label:e=>`${e%24} hr`},{name:"6hr",secondsPerTick:60*60*6,countPerLargerUnit:4,scale_appropriate_label:e=>`${e*6%24} hr`},{name:"1day",secondsPerTick:60*60*24,countPerLargerUnit:10,scale_appropriate_label:e=>`${e} day`},{name:"10day",secondsPerTick:60*60*24*10,countPerLargerUnit:1e4,scale_appropriate_label:e=>`${10*e} day`}],VN=(e,t,n,r)=>M.useMemo(()=>{if(t===void 0||n===void 0)return[];if(n<=t)return[];const i=[],a=e/(n-t);for(const o of qN){const u=a*o.secondsPerTick;if(u<=50)continue;const l=Math.ceil(t/o.secondsPerTick),s=Math.floor(n/o.secondsPerTick),c=u>200||s-l<5;for(let f=l;f<=s;f++){if(f%o.countPerLargerUnit===0)continue;const d=f*o.secondsPerTick;i.push({value:d,label:o.scale_appropriate_label(f),major:c,xPixelPosition:r(d)})}}return i},[t,n,r,e]),GN=e=>{if(!e||typeof e=="function")return;const t=e.current,n=t&&t.getContext("2d");if(n)return n},YN={position:"absolute",left:0,top:0},YS=e=>{const{width:t,height:n,draw:r,drawData:i}=e,a=M.useRef(null);return M.useEffect(()=>{const o=GN(a);o&&o.canvas&&r(o,i)},[r,a,i]),B.jsx("canvas",{ref:a,width:t,height:n,style:YN})},XN=(e,t)=>{const{width:n,height:r,margins:i,timeTicks:a,gridlineOpts:o,yTickSet:u,yLabel:l}=t;e.clearRect(0,0,e.canvas.width,e.canvas.height);const s=r-i.bottom;ZN(e,a,s,i.top,{hideGridlines:o?.hideX},t.hideTimeAxisLabels),e.strokeStyle="lightgray",Hm(e,i.left,s,n-i.right,s),u&&QN(e,u,s,i.left,n-i.right,i.top,{hideGridlines:o?.hideY}),l&&KN(e,l,i.left,i.bottom,i.top,e.canvas.height)},ZN=(e,t,n,r,i,a)=>{const o=a||!1;if(!t||t.length===0)return;const u=2,l=n+(o?0:5);e.textAlign="center",e.textBaseline="top",t.forEach(s=>{e.strokeStyle=s.major?"gray":"lightgray";const c=i.hideGridlines?n:r;Hm(e,s.xPixelPosition,l,s.xPixelPosition,c),o||(e.fillStyle=s.major?"black":"gray",e.fillText(s.label,s.xPixelPosition,l+u))})},QN=(e,t,n,r,i,a,o)=>{const l=r-5,s=l-2,{ticks:c}=t;e.fillStyle="black",e.textAlign="right",e.textBaseline="middle",c.forEach(f=>{if(!f.pixelValue)return;const d=f.pixelValue;e.strokeStyle=f.isMajor?"gray":"lightgray",e.fillStyle=f.isMajor?"black":"gray";const h=o.hideGridlines?r:i;Hm(e,l,d,h,d),e.fillText(f.label,s,d)})},KN=(e,t,n,r,i,a)=>{e.textAlign="center",e.textBaseline="middle",e.save(),e.translate(15,(a-r-i)/2+i),e.fillStyle="black",e.font="13px sans-serif",e.rotate(-Math.PI/2),e.fillText(t,0,0),e.restore()},Hm=(e,t,n,r,i)=>{e.beginPath(),e.moveTo(t,n),e.lineTo(r,i),e.stroke()},WN={},JN=e=>{const{width:t,height:n}=e,r=M.useCallback(i=>{XN(i,e)},[e]);return B.jsx("span",{className:"TSV2AxesLayer",children:B.jsx(YS,{width:t,height:n,draw:r,drawData:WN})})},e7=(e,t)=>{const{margins:n,currentTimePixels:r,currentTimeIntervalPixels:i}=t;if(e.clearRect(0,0,e.canvas.width,e.canvas.height),i!==void 0){e.fillStyle="rgba(255, 225, 225, 0.4)",e.strokeStyle="rgba(150, 50, 50, 0.9)";const a=i[0],o=n.top,u=i[1]-i[0],l=e.canvas.height-n.bottom-n.top;e.fillRect(a,o,u,l),e.strokeRect(a,o,u,l)}if(r!==void 0&&i===void 0){e.fillStyle="rgba(255, 255, 0, 0.1)";const a=4;e.fillRect(r-a/2,n.top,a,e.canvas.height-n.bottom-n.top),e.strokeStyle="rgba(200, 200, 0, 0.4)",e.lineWidth=1,e.beginPath(),e.moveTo(r,n.top),e.lineTo(r,e.canvas.height-n.bottom),e.stroke()}},t7=e=>{const{width:t,height:n,timeRange:r,currentTimePixels:i,currentTimeIntervalPixels:a,margins:o}=e,u=M.useMemo(()=>({width:t,height:n,timeRange:r,currentTimePixels:i,currentTimeIntervalPixels:a,margins:o}),[t,n,r,i,a,o]);return B.jsx(YS,{width:t,height:n,draw:e7,drawData:u})},n7=({width:e,height:t,selectionRect:n})=>{if(!n)return null;const{startX:r,endX:i}=n,a=Math.abs(i-r),o=Math.min(r,i);return B.jsx("div",{style:{position:"absolute",top:0,left:0,width:e,height:t,pointerEvents:"none",zIndex:10},children:B.jsx("div",{style:{position:"absolute",left:o,top:0,width:a,height:t,backgroundColor:"rgba(0, 123, 255, 0.2)",border:"1px solid rgba(0, 123, 255, 0.6)",borderRadius:"2px"}})})},r7=e=>{const{pixelToTime:t,visibleStartTimeSec:n,setCurrentTime:r,onMouseDown:i,onMouseUp:a,onMouseMove:o,onMouseOut:u,onCanvasClick:l,interactionMode:s}=e,{panTimeseriesSelectionVisibleStartTimeSec:c,setVisibleTimeRange:f}=_f(),[d,h]=M.useState(!1),[v,m]=M.useState(void 0),[D,p]=M.useState(null),g=M.useRef({mouseDownAchorX:null,mouseDownAnchorTime:null,mouseDownAnchorVisibleStartTime:null,mouseDownAnchorPixelToTime:null,moved:!1,selectionStartX:null,selectionEndX:null}),y=M.useCallback(E=>{if(h(!0),!E.shiftKey&&!E.ctrlKey&&!E.altKey){const C=E.clientX-E.currentTarget.getBoundingClientRect().x;s==="select-zoom"?(g.current.selectionStartX=C,g.current.selectionEndX=C,p({startX:C,endX:C})):(g.current.mouseDownAchorX=C,g.current.mouseDownAnchorTime=t(C),g.current.mouseDownAnchorVisibleStartTime=n||null,g.current.mouseDownAnchorPixelToTime=t),g.current.moved=!1}else i&&i(E)},[t,i,n,s]),S=M.useCallback(E=>{if(!E.shiftKey&&!E.ctrlKey&&!E.altKey){const C=E.clientX-E.currentTarget.getBoundingClientRect().x;if(s==="select-zoom"&&g.current.selectionStartX!==null){const A=Math.min(g.current.selectionStartX,C),T=Math.max(g.current.selectionStartX,C);if(Math.abs(T-A)>5){const _=t(A),x=t(T);f(_,x)}else if(!g.current.moved){const _=t(C);if(r(_),l){const x=E.clientY-E.currentTarget.getBoundingClientRect().y;l(C,x)}}p(null),g.current.selectionStartX=null,g.current.selectionEndX=null}else if(g.current.mouseDownAchorX=null,g.current.mouseDownAnchorTime=null,g.current.mouseDownAnchorPixelToTime=null,!g.current.moved){const A=t(C);if(r(A),l){const T=E.clientY-E.currentTarget.getBoundingClientRect().y;l(C,T)}}}else a&&a(E)},[a,t,r,s,f,l]),w=M.useCallback(E=>{const C=E.clientX-E.currentTarget.getBoundingClientRect().x,A=t(C);if(m(A),!E.shiftKey&&!E.ctrlKey&&!E.altKey){if(s==="select-zoom"&&g.current.selectionStartX!==null)g.current.selectionEndX=C,p({startX:Math.min(g.current.selectionStartX,C),endX:Math.max(g.current.selectionStartX,C)}),g.current.moved=!0;else if(s==="pan"&&g.current.mouseDownAchorX!==null&&g.current.mouseDownAnchorPixelToTime!==null){const T=g.current.mouseDownAnchorPixelToTime(C),_=g.current.mouseDownAnchorTime,x=g.current.mouseDownAnchorVisibleStartTime;if(_!==null&&x!==null){const F=T-_,R=C-g.current.mouseDownAchorX;if(Math.abs(R)>2||Math.abs(F)>.01){const z=x-F;c(z),E.preventDefault(),E.stopPropagation(),g.current.moved=!0}}}}o&&o(E)},[t,o,s,c]),b=M.useCallback(E=>{m(void 0),h(!1),p(null),g.current.selectionStartX=null,g.current.selectionEndX=null,u&&u(E)},[u]);return{isViewClicked:d,hoverTime:v,selectionRect:D,handleMouseDown:y,handleMouseUp:S,handleMouseMove:w,handleMouseOut:b}},i7=({width:e,height:t,leftMargin:n,customToolbarActions:r,hideTimeAxisLabels:i,hideNavToolbar:a})=>{const o=r&&r.length>0,u=M.useMemo(()=>({left:n||60,right:20,top:10,bottom:i?10:30}),[n,i]);let l=0;a||(l+=40),o&&(l+=40);const s=e,c=t-l;return{margins:u,canvasWidth:s,canvasHeight:c}},a7=23,o7=60,u7=(e,t,n,r)=>{const i=Math.ceil((t-r)/n);return isNaN(i)||i<1?[]:Array(i).fill(0).map((a,o)=>r+o*n).filter(a=>a>e)},l7=(e,t)=>{let n=0;const r=Math.trunc(Math.log10(t));if(Math.trunc(Math.log10(e))!==r)return n;const i=Math.trunc(Math.log10(t-e));if(r<=i)return n;const a=i+1,o=Math.pow(10,-a),u=Math.trunc(t*o).toString(),l=Math.trunc(e*o).toString();for(const[s,c]of[...u].entries()){if(c!==l[s]){n=n*Math.pow(10,s-a);break}n=n*10+parseInt(c)}return n*Math.pow(10,a)},s7=(e,t)=>Math.floor(e*Math.pow(10,-(t+1)))*Math.pow(10,t+1),c7=(e,t,n)=>{const r=e-t,i=Math.trunc(r*Math.pow(10,-n)),a=i%10===0;return{label:Math.abs(n)>3?`${(i/10).toFixed(1)}e${n+1}`:`${Math.round(i*Math.pow(10,n)*1e9)/1e9}`,isMajor:a,dataValue:e}},f7=(e,t,n,r,i)=>{const a=u7(t,n,r,e).map(l=>Math.round(l*1e9)/1e9),o=l7(t,n);return a.map(l=>c7(l,o,i))},XS={ticks:[],datamin:0,datamax:0},d7=(e,t)=>{const n=Math.floor(Math.log10(e/t)),r=Math.pow(10,n),i=[1,2,5,10],o=i.map(u=>e/(r*u)).findIndex(u=>u<t);return o===3?{step:1,scale:n+1}:{step:i[o],scale:n}},h7=e=>{const{datamin:t,datamax:n,userSpecifiedZoom:r}=e;let{pixelHeight:i}=e;i<=1&&(i=1);const a=r??1;return M.useMemo(()=>{if(t===void 0||n===void 0||t===n)return XS;const o=t/a,u=n/a,l=u-o,s=i/o7,c=i/a7,f=d7(l,c),d=f.step*Math.pow(10,f.scale);if(l/d<s)return console.warn("Error: Unable to compute valid y-axis step size. Suppressing display."),XS;const h=s7(o,f.scale);return{ticks:f7(h,o,u,d,f.scale),datamin:o,datamax:u}},[n,t,a,i])},m7=e=>{const t=Math.round(e*1e3),n=Math.floor(t/(1e3*60*60)),r=Math.floor(t%(1e3*60*60)/(1e3*60)),i=Math.floor(t%(1e3*60)/1e3),a=t%1e3;return`${n.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}:${i.toString().padStart(2,"0")}.${a.toString().padStart(3,"0")}`},p7=({width:e,height:t,interactionMode:n,onInteractionModeChange:r,currentTime:i,onZoomToFit:a})=>{const{zoomTimeseriesSelection:o,panTimeseriesSelection:u}=_f(),l=M.useCallback(()=>{o("in",1.2)},[o]),s=M.useCallback(()=>{o("out",1.2)},[o]),c=M.useCallback(()=>{u("back",10)},[u]),f=M.useCallback(()=>{u("forward",10)},[u]),d=M.useCallback(h=>{r(h)},[r]);return B.jsxs("div",{style:{width:e,height:t,backgroundColor:"#f8f9fa",borderTop:"1px solid #dee2e6",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 12px",fontSize:"13px",fontFamily:"system-ui, -apple-system, sans-serif"},children:[B.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[B.jsx("button",{onClick:()=>d("pan"),style:{padding:"4px 8px",border:"1px solid #ced4da",borderRadius:"4px",backgroundColor:n==="pan"?"#007bff":"#ffffff",color:n==="pan"?"#ffffff":"#495057",cursor:"pointer",fontSize:"12px",fontWeight:"500",transition:"all 0.15s ease"},title:"Pan mode: Drag to pan, wheel to zoom",children:"🖱️ Pan"}),B.jsx("button",{onClick:()=>d("select-zoom"),style:{padding:"4px 8px",border:"1px solid #ced4da",borderRadius:"4px",backgroundColor:n==="select-zoom"?"#007bff":"#ffffff",color:n==="select-zoom"?"#ffffff":"#495057",cursor:"pointer",fontSize:"12px",fontWeight:"500",transition:"all 0.15s ease"},title:"Select zoom mode: Drag to select region and zoom in",children:"🔍 Select"})]}),B.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[B.jsx("button",{onClick:c,style:{padding:"6px 10px",border:"1px solid #ced4da",borderRadius:"4px",backgroundColor:"#ffffff",color:"#495057",cursor:"pointer",fontSize:"12px",fontWeight:"500",transition:"all 0.15s ease",display:"flex",alignItems:"center",gap:"4px"},title:"Pan left",onMouseEnter:h=>{h.currentTarget.style.backgroundColor="#e9ecef"},onMouseLeave:h=>{h.currentTarget.style.backgroundColor="#ffffff"},children:"⬅️"}),B.jsx("button",{onClick:s,style:{padding:"6px 10px",border:"1px solid #ced4da",borderRadius:"4px",backgroundColor:"#ffffff",color:"#495057",cursor:"pointer",fontSize:"12px",fontWeight:"500",transition:"all 0.15s ease",display:"flex",alignItems:"center",gap:"4px"},title:"Zoom out",onMouseEnter:h=>{h.currentTarget.style.backgroundColor="#e9ecef"},onMouseLeave:h=>{h.currentTarget.style.backgroundColor="#ffffff"},children:"🔍➖"}),B.jsx("button",{onClick:l,style:{padding:"6px 10px",border:"1px solid #ced4da",borderRadius:"4px",backgroundColor:"#ffffff",color:"#495057",cursor:"pointer",fontSize:"12px",fontWeight:"500",transition:"all 0.15s ease",display:"flex",alignItems:"center",gap:"4px"},title:"Zoom in",onMouseEnter:h=>{h.currentTarget.style.backgroundColor="#e9ecef"},onMouseLeave:h=>{h.currentTarget.style.backgroundColor="#ffffff"},children:"🔍➕"}),B.jsx("button",{onClick:f,style:{padding:"6px 10px",border:"1px solid #ced4da",borderRadius:"4px",backgroundColor:"#ffffff",color:"#495057",cursor:"pointer",fontSize:"12px",fontWeight:"500",transition:"all 0.15s ease",display:"flex",alignItems:"center",gap:"4px"},title:"Pan right",onMouseEnter:h=>{h.currentTarget.style.backgroundColor="#e9ecef"},onMouseLeave:h=>{h.currentTarget.style.backgroundColor="#ffffff"},children:"➡️"}),B.jsx("div",{style:{width:"1px",height:"20px",backgroundColor:"#dee2e6",margin:"0 4px"}}),B.jsx("button",{onClick:a,style:{padding:"6px 10px",border:"1px solid #ced4da",borderRadius:"4px",backgroundColor:"#ffffff",color:"#495057",cursor:"pointer",fontSize:"12px",fontWeight:"500",transition:"all 0.15s ease",display:"flex",alignItems:"center",gap:"4px"},title:"Reset zoom to show all data",onMouseEnter:h=>{h.currentTarget.style.backgroundColor="#e9ecef"},onMouseLeave:h=>{h.currentTarget.style.backgroundColor="#ffffff"},children:"🏠"})]}),B.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[B.jsx("span",{style:{color:"#6c757d",fontWeight:"500"},children:"Time:"}),B.jsx("span",{style:{padding:"4px 8px",backgroundColor:"#e9ecef",borderRadius:"4px",fontFamily:"Monaco, Consolas, monospace",fontSize:"12px",fontWeight:"600",color:"#495057",minWidth:"120px",textAlign:"center"},children:i!==void 0?m7(i):"--:--:--.---"})]})]})},g7=({width:e,height:t,customActions:n})=>!n||n.length===0?null:B.jsx("div",{style:{width:e,height:t,backgroundColor:"#f8f9fa",borderTop:"1px solid #dee2e6",display:"flex",alignItems:"center",justifyContent:"flex-start",padding:"0 12px",fontSize:"13px",fontFamily:"system-ui, -apple-system, sans-serif"},children:B.jsx("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:n.map(r=>r.component?B.jsx("div",{style:{display:"flex",alignItems:"center"},children:r.component},r.id):B.jsxs("button",{onClick:r.onClick,style:{padding:"4px 8px",border:"1px solid #ced4da",borderRadius:"4px",backgroundColor:r.isActive?"#007bff":"#ffffff",color:r.isActive?"#ffffff":"#495057",cursor:r.onClick?"pointer":"default",fontSize:"12px",fontWeight:"500",transition:"all 0.15s ease",display:"flex",alignItems:"center",gap:"4px"},title:r.tooltip||r.label,onMouseEnter:i=>{!r.isActive&&r.onClick&&(i.currentTarget.style.backgroundColor="#e9ecef")},onMouseLeave:i=>{!r.isActive&&r.onClick&&(i.currentTarget.style.backgroundColor="#ffffff")},children:[r.icon&&B.jsx("span",{children:r.icon}),r.label]},r.id))})}),v7=e=>{if(!e||!e.current)return;e.current.querySelectorAll("canvas").forEach(n=>{n.addEventListener("wheel",r=>{r.preventDefault()})})},ZS=({width:e,height:t,onCanvasElement:n,gridlineOpts:r,onKeyDown:i,onMouseDown:a,onMouseMove:o,onMouseOut:u,onMouseUp:l,yAxisInfo:s,shiftZoom:c,requireClickToZoom:f,leftMargin:d,customToolbarActions:h,onCanvasClick:v,hideNavToolbar:m=!1,hideTimeAxisLabels:D=!1})=>{const{visibleStartTimeSec:p,visibleEndTimeSec:g,zoomTimeseriesSelection:y,panTimeseriesSelection:S,setVisibleTimeRange:w}=_f(),{currentTime:b,setCurrentTime:E,startTimeSec:C,endTimeSec:A}=Mf(),T=M.useMemo(()=>[p,g],[p,g]),{margins:_,canvasWidth:x,canvasHeight:F}=i7({width:e,height:t,leftMargin:d,customToolbarActions:h,hideNavToolbar:m}),R=M.useMemo(()=>p===void 0||g===void 0?()=>0:g<=p?()=>0:O=>_.left+(O-p)/(g-p)*(x-_.left-_.right),[x,p,g,_]),z=M.useMemo(()=>p===void 0||g===void 0?()=>0:g<=p?()=>0:O=>p+(O-_.left)/(x-_.left-_.right)*(g-p),[x,p,g,_]),N=M.useMemo(()=>{const O=s?.yMin||0,$=s?.yMax||0;return $<=O?()=>0:V=>F-_.bottom-(V-O)/($-O)*(F-_.top-_.bottom)},[s,F,_]),U=VN(x,p,g,R),I=h7({datamin:s?.yMin||0,datamax:s?.yMax||0,pixelHeight:F-_.left-_.right}),L=M.useMemo(()=>({datamin:I.datamin,datamax:I.datamax,ticks:I.ticks.map(O=>({...O,pixelValue:N(O.dataValue)}))}),[I,N]),G=F,X=M.useMemo(()=>B.jsx(JN,{width:x,height:G,timeRange:T,margins:_,timeTicks:U,yTickSet:s?.showTicks?L:void 0,yLabel:s?.yLabel,gridlineOpts:r,hideTimeAxisLabels:D}),[x,G,T,_,U,s,L,D,r]),P=M.useMemo(()=>b!==void 0?R(b):void 0,[b,R]),j=M.useMemo(()=>B.jsx(t7,{width:x,height:G,timeRange:T,margins:_,currentTimePixels:P}),[x,G,T,_,P]),H=M.useRef(null),[k,q]=M.useState("pan"),{isViewClicked:Y,hoverTime:ee,selectionRect:te,handleMouseDown:ne,handleMouseUp:oe,handleMouseMove:W,handleMouseOut:ce}=r7({pixelToTime:z,visibleStartTimeSec:p,setCurrentTime:E,onMouseDown:a,onMouseUp:l,onMouseMove:o,onMouseOut:u,onCanvasClick:v,interactionMode:k});M.useEffect(()=>{(f===!1||Y)&&v7(H)},[f,Y]);const de=M.useCallback(O=>{if(c&&!O.shiftKey||O.deltaY===0||f!==!1&&!Y)return;const $=-O.deltaY/100;y($>0?"in":"out",1.2,ee)},[c,y,ee,f,Y]),ve=M.useCallback(O=>{O.key==="="?y("in"):O.key==="-"?y("out"):O.key==="ArrowRight"?S("forward"):O.key==="ArrowLeft"&&S("back"),i&&i(O)},[i,y,S]),De=M.useCallback(()=>{C!==void 0&&A!==void 0&&w(C,A)},[C,A,w]),Se=M.useMemo(()=>B.jsx(n7,{width:x,height:G,selectionRect:te}),[x,G,te]),[Ee,Re]=M.useState(null);M.useEffect(()=>{Ee&&n(Ee,x,F,_)},[Ee,x,F,_,n]);const Ce=M.useMemo(()=>B.jsxs("div",{style:{position:"relative",overflow:"hidden",width:x,height:G},onWheel:!f||Y?de:void 0,onMouseDown:ne,onMouseUp:oe,onMouseMove:W,onMouseOut:ce,tabIndex:0,onKeyDown:ve,children:[X,B.jsx("canvas",{style:{position:"absolute",width:x,height:G},ref:O=>Re(O),width:x,height:G}),j,Se]}),[x,G,ve,de,ne,oe,W,ce,f,Y,X,j,Se]),Ne=M.useMemo(()=>B.jsx(p7,{width:e,height:40,interactionMode:k,onInteractionModeChange:q,currentTime:b,onZoomToFit:De}),[e,k,q,b,De]),pe=M.useMemo(()=>B.jsx(g7,{width:e,height:40,customActions:h}),[e,h]);return B.jsxs("div",{className:"time-scroll-view-3",ref:H,style:{position:"absolute",width:e,height:t,background:"white"},children:[Ce,!m&&B.jsxs("div",{style:{position:"absolute",bottom:0,left:0,right:0},children:[Ne,pe]})]})},QS=15,y7={hideX:!1,hideY:!0},b7={showTicks:!1,yMin:void 0,yMax:void 0},D7=({dataClient:e,width:t,height:n})=>{const{visibleStartTimeSec:r,visibleEndTimeSec:i}=_f(),{initializeTimeseriesSelection:a}=Mf(),{selectedUnitIds:o,unitIdSelectionDispatch:u}=qr(),[l,s]=M.useState(void 0),c=M.useRef(null),[f,d]=M.useState(null),[h,v]=M.useState(null),[m,D]=M.useState(!1),[p,g]=M.useState(null),[y,S]=M.useState(null),w=M.useMemo(()=>r===void 0||i===void 0?"raster":i-r>120?"heatmap":"raster",[r,i]),b=e.metadata.unitIds;M.useEffect(()=>{e.metadata&&a({startTimeSec:e.metadata.startTimeSec,endTimeSec:e.metadata.endTimeSec,initialVisibleStartTimeSec:e.metadata.startTimeSec,initialVisibleEndTimeSec:e.metadata.endTimeSec})},[a,e.metadata]),M.useEffect(()=>{let H=!1;const k=async()=>{if(!(r===void 0||i===void 0))try{if(w==="raster"){const q=await e.getDataForRange({startTimeSec:r,endTimeSec:i});if(H)return;v(q),S(null)}else{const q=e.getSpikeCountsForRange({startTimeSec:r,endTimeSec:i});if(H)return;S(q),v(null)}g(null)}catch(q){if(H)return;console.error("Error loading data:",q),g(`Error loading data: ${q}`)}};return D(!0),k().finally(()=>{H||D(!1)}),()=>{H=!0}},[e,r,i,w]);const{onlyShowSelected:E,customToolbarActions:C}=GS(),[A,T]=M.useState(t),[_,x]=M.useState(n),[F,R]=M.useState(null),z=M.useMemo(()=>{const H=[];return E&&b.forEach((k,q)=>{o.has(k)&&H.push(q)}),H},[E,o,b]),N=M.useMemo(()=>z.map(H=>b[H]),[z,b]),U=M.useCallback(()=>{if(!F||!c.current||!f||!y||!e.metadata||r===void 0||i===void 0)return;if(f.clearRect(0,0,A,_),m&&(f.fillStyle="rgba(0, 0, 0, 0.02)",f.fillRect(0,0,A,_),f.fillStyle="black",f.font="16px Arial",f.textAlign="center",f.fillText("Loading...",A/2,_/2)),p){f.fillStyle="rgba(255, 0, 0, 0.1)",f.fillRect(0,0,A,_),f.fillStyle="red",f.font="14px Arial",f.textAlign="center",f.fillText(p,A/2,_/2);return}const k=_-F.top-F.bottom,q=A-F.left-F.right,Y=i-r;let ee;if(E){let oe=0;b.forEach((W,ce)=>{o.has(W)&&oe++}),ee=oe}else b.forEach((oe,W)=>{}),ee=b.length;const te=k/(ee||1);f.save(),f.beginPath(),f.rect(F.left,F.top,q,k),f.clip();let ne=1;if(y.counts.forEach(oe=>{E?z.forEach(W=>{const ce=oe[W];ce>ne&&(ne=ce)}):oe.forEach(W=>{W>ne&&(ne=W)})}),y.counts.forEach((oe,W)=>{const ce=y.binEdges[W],de=y.binEdges[W+1],ve=F.left+(ce-r)/Y*q,De=F.left+(de-r)/Y*q;if(E)for(let Se=0;Se<z.length;Se++){const Ee=z[Se],Ce=oe[Ee]/ne,Ne=F.top+(z.length-1-Se)*te,pe=KS(Ce);f.fillStyle=pe,f.fillRect(ve,Ne,De-ve+.5,te)}else oe.forEach((Se,Ee)=>{const Re=Se/ne,Ce=F.top+(b.length-1-Ee)*te,Ne=KS(Re);f.fillStyle=Ne,f.fillRect(ve,Ce,De-ve+.5,te)})}),f.restore(),te>=QS){f.globalAlpha=1;const oe=E?N:b;oe.forEach((W,ce)=>{const ve=F.top+(oe.length-1-ce)*te+te/2,De=mh(Ct(W));f.fillStyle=De,f.font="12px Arial",f.textAlign="right",f.fillText(`Unit ${W}`,F.left-5,ve)})}},[A,_,F,y,r,i,e.metadata,m,p,f,o,E,b,z,N]);console.log(o,z,N);const I=M.useCallback(()=>{if(!F||!c.current||!f||!h||!e.metadata||r===void 0||i===void 0)return;if(f.clearRect(0,0,A,_),m&&(f.fillStyle="rgba(0, 0, 0, 0.02)",f.fillRect(0,0,A,_),f.fillStyle="black",f.font="16px Arial",f.textAlign="center",f.fillText("Loading...",A/2,_/2)),p){f.fillStyle="rgba(255, 0, 0, 0.1)",f.fillRect(0,0,A,_),f.fillStyle="red",f.font="14px Arial",f.textAlign="center",f.fillText(p,A/2,_/2);return}const k=_-F.top-F.bottom,q=A-F.left-F.right,Y=i-r,ee=e.metadata.unitIds,te={};let ne;if(E){for(let W=0;W<z.length;W++){const ce=z[W];te[ce]=W}ne=z.length}else ee.forEach((W,ce)=>{te[ce]=ce}),ne=ee.length;const oe=k/(ne||1);f.save(),f.beginPath(),f.rect(F.left,F.top,q,k),f.clip();for(let W=0;W<h.timestamps.length;W++){const ce=h.timestamps[W],de=te[h.unitIndices[W]];if(de===void 0)continue;const ve=ee[h.unitIndices[W]],De=F.top+(ne-1-de)*oe+oe/2,Se=mh(Ct(ve)),Ee=l===ve,Re=o.has(ve);f.strokeStyle=Se,f.lineWidth=Ee||Re?2:1,f.globalAlpha=Re?1:Ee?.8:.6;const Ce=F.left+(ce-r)/Y*q;f.beginPath(),f.moveTo(Ce,De-oe*.4),f.lineTo(Ce,De+oe*.4),f.stroke()}if(f.restore(),oe>=QS){f.globalAlpha=1;const W=E?N:ee;W.forEach((ce,de)=>{const De=F.top+(W.length-1-de)*oe+oe/2,Se=mh(Ct(ce));f.fillStyle=Se,f.font="12px Arial",f.textAlign="right",f.fillText(`Unit ${ce}`,F.left-5,De)})}},[A,_,F,h,e.metadata,r,i,m,p,l,o,E,f,N,z]);M.useEffect(()=>{w==="heatmap"&&y?U():I()},[I,U,w,y]);const L=M.useCallback(()=>{},[]),G=M.useCallback(H=>{if(!F||!e.metadata)return;const k=e.metadata.unitIds,q=k.length,Y=1-(H.y-F.top)/(_-F.top-F.bottom),ee=Math.round(Y*q-.5);if(0<=ee&&ee<q)return k[ee]},[_,F,e.metadata]),X=M.useCallback(H=>{const k=H.currentTarget.getBoundingClientRect(),q={x:H.clientX-k.x,y:H.clientY-k.y},Y=G(q);H.shiftKey||H.ctrlKey?u({type:"TOGGLE_UNIT",targetUnit:Y}):u({type:"UNIQUE_SELECT",targetUnit:Y})},[G,u]),P=M.useCallback(H=>{const k=H.currentTarget.getBoundingClientRect(),q={x:H.clientX-k.x,y:H.clientY-k.y},Y=G(q);Y!==void 0&&s(Y)},[G]),j=M.useCallback(()=>{s(void 0)},[]);return e.metadata?B.jsx(ZS,{width:t,height:n,customToolbarActions:C,onCanvasElement:(H,k,q,Y)=>{c.current=H;const ee=H?.getContext("2d");d(ee),T(k),x(q),R(Y)},gridlineOpts:y7,onKeyDown:L,onMouseDown:X,onMouseMove:P,onMouseOut:j,yAxisInfo:b7}):B.jsx("div",{children:"Loading metadata..."})},KS=e=>{if(e===0)return"rgb(255,255,255)";const t=Math.max(0,Math.min(1,.7*(1-e))),n=Math.round(t*255);return`rgb(${n}, ${n}, ${n})`};class Pm{constructor(t,n,r,i,a,o){this.zarrGroup=t,this.metadata=n,this.referenceTimes=r,this.referenceIndices=i,this.counts2dArray=a,this.binEdges=o,this.zarrGroup=t}static async create(t){const n={startTimeSec:t.attrs.start_time_sec,endTimeSec:t.attrs.end_time_sec,unitIds:t.attrs.unit_ids||[],totalSpikes:t.attrs.total_spikes||0},r=await t.getDatasetData("reference_times",{}),i=await t.getDatasetData("reference_indices",{});if(!r||!i)throw new Error(`Reference arrays not found in Zarr group: ${t.path}`);const a=await t.getDatasetData("spike_counts_1sec",{}).catch(()=>{});if(!a)throw new Error(`Spike counts data not found in Zarr group: ${t.path}`);const o=Math.ceil(n.endTimeSec-n.startTimeSec),u=n.unitIds.length,l=Array(o);for(let f=0;f<o;f++){l[f]=Array(u);for(let d=0;d<u;d++){const h=f*u+d;l[f][d]=h<a.length?a[h]:0}}const s=Array(o+1);for(let f=0;f<=o;f++)s[f]=n.startTimeSec+f;return new Pm(t,n,r,i,l,s)}async getDataForRange(t){const n=this.findStartIndex(this.referenceTimes,this.referenceIndices,t.startTimeSec),r=this.findEndIndex(this.referenceTimes,this.referenceIndices,t.endTimeSec);if(n>=r)return{timestamps:[],unitIndices:[]};const i=await this.zarrGroup.getDatasetData("timestamps",{slice:[[n,r]]}),a=await this.zarrGroup.getDatasetData("unit_indices",{slice:[[n,r]]});return{timestamps:Array.from(i),unitIndices:Array.from(a)}}findStartIndex(t,n,r){let i=0;for(;i+1<t.length&&t[i+1]<r;)i++;return n[i]}getSpikeCountsForRange(t){const{startTimeSec:n,endTimeSec:r}=t,i=Math.floor(n-this.metadata.startTimeSec),a=Math.ceil(r-this.metadata.startTimeSec);let o=1;for(;(a-i)/o>500;)o+=1;const u=this.counts2dArray.slice(i,a),l=this.binEdges.slice(i,a+1);if(o===1)return{binEdges:l,counts:u};{const s=[],c=[];for(let f=0;f<u.length;f+=o){const d=Array(this.metadata.unitIds.length).fill(0);for(let h=0;h<o;h++)if(f+h<u.length)for(let v=0;v<d.length;v++)d[v]+=u[f+h][v];s.push(d),c.push(l[f])}return l.length>0&&c.push(l[Math.min(l.length-1,c.length*o)]),{binEdges:c,counts:s}}}findEndIndex(t,n,r){let i=t.length-1;for(;i-1>=0&&t[i-1]>r;)i--;return n[i]}}const S7=({zarrGroup:e,contexts:t,width:n,height:r})=>{const i=x7(e);return i?B.jsx(WS,{context:t.timeseriesSelection,children:B.jsx(Jr,{context:t.unitSelection,children:B.jsx(D7,{dataClient:i,width:n,height:r})})}):null},WS=({context:e,children:t})=>{const{state:n,dispatch:r}=Ef(e);return!r||!n?B.jsx(B.Fragment,{children:"Waiting for context..."}):B.jsx(VS.Provider,{value:{timeseriesSelection:n,dispatch:r},children:t})},x7=e=>{const[t,n]=M.useState(null);return M.useEffect(()=>{let r=!0;return Pm.create(e).then(i=>{r&&n(i)}),()=>{r=!1}},[e]),t},w7=({dataClient:e,width:t,height:n})=>{const{selectedUnitIds:r,unitIdSelectionDispatch:i}=qr(),{initializeTimeseriesSelection:a,visibleStartTimeSec:o,visibleEndTimeSec:u}=Mf(),[l,s]=M.useState(null),[c,f]=M.useState(null),[d,h]=M.useState(!1),[v,m]=M.useState(null),D=fl,{onlyShowSelected:p,customToolbarActions:g}=GS(),[y,S]=M.useState(t),[w,b]=M.useState(n),[E,C]=M.useState(null),A=e.metadata;M.useEffect(()=>{A&&i({type:oo,newUnitOrder:yr(A.unitIds)})},[A,i]),M.useEffect(()=>{A&&a({startTimeSec:A.startTimeSec,endTimeSec:A.endTimeSec,initialVisibleStartTimeSec:A.startTimeSec,initialVisibleEndTimeSec:A.endTimeSec})},[a,A]),M.useEffect(()=>{let x=!1;const F=async()=>{if(o!==void 0&&u!==void 0){let R=1e4;for(;;){const z=await e.getDataForRange({startTimeSec:o,endTimeSec:u},{maxNumEvents:R});if(x)return;if(z&&f(z),z.subsampleFactor>1){if(R===1e6)break;R=Math.max(R*3,z.timestamps.length*3),R>1e6&&(R=1e6)}else break}}};return h(!0),m(null),F().catch(R=>{x||m(`Failed to load data: ${R}`),m(`Failed to load data: ${R}`)}).finally(()=>{h(!1)}),()=>{x=!0}},[o,u,e]);const T=M.useMemo(()=>{if(!c||!A||c.amplitudes.length===0)return{yMin:0,yMax:10};let x=1/0,F=-1/0;for(let z=0;z<c.amplitudes.length;z++){const N=A.unitIds[c.unitIndices[z]];if(p?r.has(N):!0){const I=c.amplitudes[z];I<x&&(x=I),I>F&&(F=I)}}if(x===1/0)return{yMin:0,yMax:10};const R=(F-x)*.1;return{yMin:x-R,yMax:F+R}},[c,A,p,r]);M.useEffect(()=>{if(!l||!c||!A||!E||u===void 0||o===void 0)return;let x=!1;return(async()=>{if(x)return;if(l.clearRect(0,0,y,w),d&&(l.fillStyle="rgba(0, 0, 0, 0.1)",l.fillRect(0,0,y,w),l.fillStyle="black",l.font="16px Arial",l.textAlign="center",l.fillText("Loading...",y/2,w/2)),v){l.fillStyle="rgba(255, 0, 0, 0.1)",l.fillRect(0,0,y,w),l.fillStyle="red",l.font="14px Arial",l.textAlign="center",l.fillText(v,y/2,w/2);return}l.save(),l.beginPath(),l.rect(E.left,E.top,y-E.left-E.right,w-E.top-E.bottom),l.clip();const R=N=>E.left+(N-o)/(u-o)*(y-E.left-E.right),z=N=>w-E.bottom-(N-T.yMin)/(T.yMax-T.yMin)*(w-E.top-E.bottom);for(let N=0;N<c.timestamps.length;N++){const U=c.timestamps[N],I=c.amplitudes[N],L=A.unitIds[c.unitIndices[N]];if(U<o||U>u||!(p?r.has(L):!0))continue;const X=wr(Ct(L)),j=r.has(L)?1:.3;l.fillStyle=X,l.globalAlpha=j;const H=R(U),k=z(I);l.beginPath(),l.arc(H,k,2,0,Math.PI*2),l.fill()}l.globalAlpha=1,c.subsampleFactor>1&&(l.fillStyle="#2196F3",l.font="12px Arial",l.textAlign="left",l.fillText(`Subsampled ${c.subsampleFactor}x`,E.left+10,E.top+20)),l.restore()})(),()=>{x=!0}},[l,c,A,o,u,y,w,E,T,r,p,d,v]);const _=M.useMemo(()=>({showTicks:!0,yMin:T.yMin,yMax:T.yMax,yLabel:"Amplitude"}),[T]);return A?B.jsx("div",{children:B.jsxs(Ro,{width:t,height:n,initialPosition:D,adjustable:!1,children:[B.jsx(dl,{width:D,height:n}),B.jsx(ZS,{width:t-D,height:n,onCanvasElement:(x,F,R,z)=>{if(!x)return;const N=x.getContext("2d");s(N),S(F),b(R),C(z)},yAxisInfo:_,customToolbarActions:g})]})}):B.jsx("div",{children:"Loading metadata..."})};class Bf{constructor(t,n,r={},i,a){this.zarrGroup=t,this.metadata=n,this.subsampleClients=r,this.referenceTimes=i,this.referenceIndices=a,this.zarrGroup=t}static async create(t){const n={startTimeSec:t.attrs.start_time_sec,endTimeSec:t.attrs.end_time_sec,unitIds:t.attrs.unit_ids||[],totalSpikes:t.attrs.total_spikes||0},r={},i=t.subgroups.find(u=>u.name==="subsampled_data"),a=await t.getDatasetData("reference_times",{}),o=await t.getDatasetData("reference_indices",{});if(!a||!o)throw new Error(`Reference arrays not found in Zarr group: ${t.path}`);if(i){const u=await t.getGroup(i.name);if(!u)throw new Error(`Failed to load subsampled_data group at ${i.name} in ${t.path}`);let l=4;for(;;){const s=u.subgroups.find(d=>d.name===`factor_${l}`);if(!s)break;const c=await u.getGroup(s.name);if(!c)throw console.warn(u.subgroups),new Error(`Failed to load subsampled group at ${s.name} in ${t.path}`);const f=await Bf.create(c);r[l]=f,l*=4}}return new Bf(t,n,r,a,o)}async getDataForRange(t,n){const r=this.findStartIndex(this.referenceTimes,this.referenceIndices,t.startTimeSec),i=this.findEndIndex(this.referenceTimes,this.referenceIndices,t.endTimeSec);if(r>=i)return{timestamps:[],unitIndices:[],amplitudes:[],subsampleFactor:1};if(n.maxNumEvents>0&&i-r>n.maxNumEvents){let s=4;for(;s*4 in this.subsampleClients&&(i-r)/s>n.maxNumEvents;)s*=4;if(s in this.subsampleClients){const f=await this.subsampleClients[s].getDataForRange(t,{maxNumEvents:0});return f.subsampleFactor=s,f}}const a=await this.zarrGroup.getDatasetData("timestamps",{slice:[[r,i]]}),o=await this.zarrGroup.getDatasetData("unit_indices",{slice:[[r,i]]}),u=await this.zarrGroup.getDatasetData("amplitudes",{slice:[[r,i]]});return{timestamps:Array.from(a),unitIndices:Array.from(o),amplitudes:Array.from(u),subsampleFactor:1}}findStartIndex(t,n,r){let i=0;for(;i+1<t.length&&t[i+1]<r;)i++;return n[i]}findEndIndex(t,n,r){let i=t.length-1;for(;i-1>=0&&t[i-1]>r;)i--;return n[i]}}const E7=({zarrGroup:e,contexts:t,width:n,height:r})=>{const i=A7(e);return i?B.jsx(WS,{context:t.timeseriesSelection,children:B.jsx(Jr,{context:t.unitSelection,children:B.jsx(w7,{dataClient:i,width:n,height:r})})}):null},A7=e=>{const[t,n]=M.useState(null);return M.useEffect(()=>{let r=!0;return Bf.create(e).then(i=>{r&&n(i)}),()=>{r=!1}},[e]),t},C7=25,qm=2*Math.PI,T7={maxElectrodePixelRadius:C7},Vm={},zo=8,M7=()=>({selectedElectrodeIds:[]}),_7=e=>{const{width:t,height:n,electrodes:r,units:i,disableAutoRotate:a,onlyShowSelected:o}=e,{selectedElectrodeIds:u}=M7(),{selectedUnitIds:l,unitIdSelectionDispatch:s}=qr(),{affineTransform:c,handleWheel:f}=Lm(t,n,{shift:!0,alt:!1}),d=M.useMemo(()=>new Set([...l]),[l]),h=i.filter(U=>o?d.has(U.unitId):!0).sort((U,I)=>d.has(U.unitId)&&!d.has(I.unitId)?1:!d.has(U.unitId)&&d.has(I.unitId)?-1:Ct(U.unitId)-Ct(I.unitId)),v=e.maxElectrodePixelRadius||T7.maxElectrodePixelRadius,m=e.colors??hl,D=e.showLabels??!1,p=e.offsetLabels??!1,{convertedElectrodes:g,pixelRadius:y,transform:S}=M.useMemo(()=>jm(t,n,r,"geom",v,{disableAutoRotate:a}),[r,n,v,t,a]),w=Math.sqrt(km(c)),b=M.useCallback((U,I)=>{const L=y*w,G=g.map(X=>{const P=(u||[]).includes(X.e.id),j=!1,H=!1,k=P?H?m.draggedSelected:j?m.selectedHover:m.selected:H?m.dragged:j?m.hover:m.base;return{...X,color:k,textColor:P||j&&!H?m.textDark:m.textLight}});if(U.clearRect(0,0,U.canvas.width,U.canvas.height),G.forEach(X=>{const P=ha(c,{x:X.pixelX,y:X.pixelY});U.fillStyle=X.color,U.beginPath(),U.ellipse(P.x,P.y,L,L,0,0,qm),U.fill()}),U.strokeStyle=hl.border,g.forEach(X=>{const P=ha(c,{x:X.pixelX,y:X.pixelY});U.beginPath(),U.ellipse(P.x,P.y,L,L,0,0,qm),U.stroke()}),D){U.font=`${L}px Arial`,U.textAlign=p?"right":"center",U.textBaseline="middle";const X=p?1.4*L:0;G.forEach(P=>{const j=ha(c,{x:P.pixelX,y:P.pixelY});U.fillStyle=p?m.textDark:P.textColor,U.fillText(`${P.e.label}`,j.x-X,j.y)})}},[m,p,g,y,u,D,c,w]),E=M.useCallback((U,I)=>{const L=zo;U.clearRect(0,0,U.canvas.width,U.canvas.height);const G=(X,P,j)=>{U.fillStyle=j,U.strokeStyle="black",U.beginPath(),U.ellipse(X,P,L,L,0,0,qm),U.fill(),U.stroke()};for(const X of h){const P=Xh(S,[X.x,X.y]),j=ha(c,{x:P[0],y:P[1]}),H=l.size===0||l.has(X.unitId)?wr(Ct(X.unitId)):"rgb(220, 220, 220)";G(j.x,j.y,H)}},[S,h,l,c]),C=M.useMemo(()=>B.jsx(ir,{width:t,height:n,draw:b,drawData:Vm}),[t,n,b]),A=M.useMemo(()=>B.jsx(ir,{width:t,height:n,draw:E,drawData:Vm}),[t,n,E]),T=M.useCallback((U,{ctrlKey:I})=>{const L=B7(c,U),G=km(c),X=zo/Math.sqrt(G),P=[];for(const j of h){const H=Xh(S,[j.x,j.y]);Yh(Ff([H[0]-X,H[1]-X,X*2,X*2]),Ff(L))&&(Ff([H[0]-X,H[1]-X,X*2,X*2]),P.push(j.unitId))}if(I)for(const j of P)s({type:"TOGGLE_UNIT",targetUnit:j});else s({type:"SET_SELECTION",incomingSelectedUnitIds:P})},[S,s,h,c]),_=M.useCallback((U,{ctrlKey:I})=>{let L=!1;for(const G of h){const X=Xh(S,[G.x,G.y]);J5(U,Ff([X[0]-zo,X[1]-zo,zo*2,zo*2]))&&(L=!0,s(I?{type:"TOGGLE_UNIT",targetUnit:G.unitId}:{type:"SET_SELECTION",incomingSelectedUnitIds:[G.unitId]}))}L||s({type:"SET_SELECTION",incomingSelectedUnitIds:[]})},[S,s,h]),{onMouseMove:x,onMouseDown:F,onMouseUp:R,paintDragSelectLayer:z}=Hs(t,n,T,_),N=M.useMemo(()=>B.jsx(ir,{width:t,height:n,draw:z,drawData:Vm}),[t,n,z]);return t>0&&n>0?B.jsxs("div",{style:{width:t,height:n,position:"relative"},onMouseMove:x,onMouseUp:R,onMouseDown:F,onWheel:f,children:[C,A,N]}):B.jsx("div",{})},Ff=e=>({xmin:e[0],ymin:e[1],xmax:e[0]+e[2],ymax:e[1]+e[3]}),B7=(e,t)=>{const n=$m(e,{x:t[0],y:t[1]}),r=$m(e,{x:t[0]+t[2],y:t[1]+t[3]});return[n.x,n.y,r.x-n.x,r.y-n.y]},F7=e=>{const{data:t,width:n,height:r}=e,[i,a]=M.useState({...xf,onlyShowSelected:!1}),o=30,u=Object.keys(t.channelLocations),l=mN(u,t.channelLocations),s=M.useMemo(()=>({width:n-20,height:r-o,top:0,position:"absolute"}),[n,r]);return B.jsxs("div",{children:[B.jsx("div",{style:s,children:B.jsx(_7,{width:n-20,height:r-o,electrodes:l,units:t.units,disableAutoRotate:t.disableAutoRotate,onlyShowSelected:i.onlyShowSelected})}),B.jsx("div",{style:{position:"absolute",top:r-o,height:o,overflow:"hidden"},children:B.jsx(wf,{options:i,setOptions:a})})]})},N7=({zarrGroup:e,contexts:t,width:n,height:r})=>{const[i,a]=M.useState(null),[o,u]=M.useState(null),[l,s]=M.useState(!0);return M.useEffect(()=>{let c=!1;return(async()=>{try{s(!0),u(null);const d=e.attrs.disable_auto_rotate||!1,h=e.attrs.unit_ids,v=e.attrs.channel_locations,m=await e.getDatasetData("coords",{});if(!m||m.length===0)throw new Error("Empty coords data");const D=new Float32Array(m);if(D.length!==h.length*2)throw new Error(`Expected coords length ${h.length*2}, got ${D.length}`);const p=[];for(let g=0;g<h.length;g++)p.push({unitId:h[g],x:D[g*2],y:D[g*2+1]});if(c)return;a({type:"UnitLocations",channelLocations:v,units:p,disableAutoRotate:d})}catch(d){console.error("Error loading unit locations data:",d),u(`Failed to load unit locations data: ${d instanceof Error?d.message:String(d)}`)}finally{s(!1)}})(),()=>{c=!0}},[e]),o?B.jsxs("div",{style:{width:n,height:r,display:"flex",alignItems:"center",justifyContent:"center",color:"#666",backgroundColor:"#f5f5f5"},children:["Error: ",o]}):l?B.jsx("div",{style:{width:n,height:r,display:"flex",alignItems:"center",justifyContent:"center",color:"#666",backgroundColor:"#f5f5f5"},children:"Loading unit locations data..."}):i?B.jsx(Jr,{context:t.unitSelection,children:B.jsx(F7,{data:i,width:n,height:r})}):B.jsx("div",{style:{width:n,height:r,display:"flex",alignItems:"center",justifyContent:"center",color:"#666",backgroundColor:"#f5f5f5"},children:"No unit locations data available"})},R7=({rows:e,columns:t,onDeleteRow:n=void 0,deleteRowLabel:r=void 0,onEditRow:i=void 0,editRowLabel:a=void 0,selectionMode:o="none",selectedRowKeys:u=[],onSelectedRowKeysChanged:l=void 0,selectionDisabled:s})=>{const c=M.useMemo(()=>{const p={};return u.forEach(g=>{p[g]=!0}),p},[u]),[f,d]=M.useState(null),h=M.useCallback(p=>{l&&(o==="single"?!(p in c)||!c[p]?l([p+""]):l([]):o==="multiple"&&l(Object.keys(c).filter(g=>g!=p&&c[g]).concat(c[p]?[]:[p.toString()])))},[l,o,c]),v=M.useCallback(p=>{d(p)},[]),m=M.useCallback((p,g)=>{g&&n&&n(p),d(null)},[n]),D=M.useCallback(p=>{i&&i(p)},[i]);return B.jsxs(mF,{className:"NiceTable",children:[B.jsx(MF,{children:B.jsxs(SS,{children:[B.jsx(Sf,{style:{width:0}},"_first"),t.map(p=>B.jsx(Sf,{children:p.element?p.element:B.jsx("span",{children:p.label})},p.key))]})}),B.jsx(bF,{children:e.map(p=>B.jsxs(SS,{children:[B.jsxs(Sf,{children:[n&&(f===p.key?B.jsx(z7,{title:r||"",onConfirmDeleteRow:m,rowKey:p.key}):B.jsx(O7,{title:r||"",onDeleteRow:v,rowKey:p.key})),i&&B.jsx(U7,{title:a||"",onEditRow:D,rowKey:p.key}),o!=="none"&&B.jsx(hS,{checked:c[p.key]||!1,onClick:()=>h(p.key),disabled:s})]}),t.map(g=>B.jsx(Sf,{children:B.jsx("span",{children:I7(p.columnValues[g.key])})},g.key))]},p.key))})]})},O7=({title:e,rowKey:t,onDeleteRow:n})=>{const r=M.useCallback(()=>{n&&n(t)},[n,t]);return B.jsx(cl,{title:e,onClick:r,children:B.jsx(YD,{})})},z7=({title:e,rowKey:t,onConfirmDeleteRow:n})=>{const r=M.useCallback(()=>{n&&n(t,!0)},[n,t]),i=M.useCallback(()=>{n&&n(t,!1)},[n,t]);return B.jsxs("span",{children:["Confirm delete?",B.jsx(cl,{title:e,onClick:r,children:B.jsx(YD,{})}),B.jsx(cl,{title:"Cancel",onClick:i,children:B.jsx(B_,{})})]})},U7=({title:e,rowKey:t,onEditRow:n})=>B.jsx(cl,{title:e,onClick:()=>n&&n(t),children:B.jsx(__,{})}),I7=e=>e==0?e:e?typeof e=="object"?e.element?e.element:e.text||"":e:"",$7=({width:e,height:t})=>{const{selectedUnitMetrics:n,allUnitMetrics:r,unitMetricSelectionDispatch:i}=ch(),a=M.useMemo(()=>[{key:"metric",label:"Metric"}],[]),o=M.useMemo(()=>(r||[]).map(l=>({key:l,columnValues:{metric:l}})),[r]),u=M.useCallback(l=>{i({type:"selectUnitMetrics",unitMetrics:l})},[i]);return B.jsx("div",{style:{position:"absolute",width:e,height:t},children:B.jsx(R7,{rows:o,columns:a,selectedRowKeys:n,onSelectedRowKeysChanged:u,selectionMode:"multiple"})})},k7=(e,t)=>{e.clearRect(0,0,t.width,t.height);for(const n of t.pixelVerticalLines||[])e.strokeStyle=n.color,e.beginPath(),e.moveTo(n.x,t.margins.top-20),e.lineTo(n.x,t.height-t.margins.bottom),e.stroke();t.barBoxes.forEach(n=>{e.fillStyle=n.color,e.fillRect(n.x1,n.y1,n.x2-n.x1,n.y2-n.y1)}),t.xLabel&&(e.textBaseline="bottom",e.textAlign="center",e.fillStyle="black",e.fillText(t.xLabel,t.width/2,t.height-3));for(const n of t.pixelTicks||[])e.strokeStyle="black",e.beginPath(),e.moveTo(n.x,t.height-t.margins.bottom),e.lineTo(n.x,t.height-t.margins.bottom+6),e.stroke(),e.textBaseline="top",e.textAlign="center",e.fillStyle="black",e.fillText(n.label,n.x,t.height-t.margins.bottom+8)},L7=e=>B.jsx(ir,{width:e.width,height:e.height,draw:k7,drawData:e}),j7={},H7=({bars:e,range:t,ticks:n,verticalLines:r,xLabel:i,onSelectRect:a,width:o,height:u})=>{const{xMin:l,xMax:s}=M.useMemo(()=>t?{xMin:t.min,xMax:t.max}:e.length>0?{xMin:e[0].xStart,xMax:e[e.length-1].xEnd}:{xMin:0,xMax:1},[e,t]),c=M.useMemo(()=>Math.max(...e.map(E=>E.height)),[e]),{barBoxes:f,margins:d,pixelTicks:h,pixelVerticalLines:v}=M.useMemo(()=>{const E={left:3,right:3,top:5,bottom:3+(i?18:0)+(n?18:0)},C=o-E.left-E.right,A=u-E.top-E.bottom,T=e.map(F=>({key:F.key,x1:E.left+(F.xStart-l)/(s-l)*C,x2:E.left+(F.xEnd-l)/(s-l)*C,y1:E.top+A*(1-F.height/c),y2:E.top+A,tooltip:F.tooltip,color:F.color})),_=n?n.map(F=>({x:E.left+(F.x-l)/(s-l)*C,label:`${F.label}`})):void 0,x=r?r.map(F=>({x:E.left+(F.x-l)/(s-l)*C,color:F.color})):void 0;return{barBoxes:T,margins:E,pixelTicks:_,pixelVerticalLines:x}},[e,n,r,l,s,c,o,u,i]),m=M.useCallback((E,{ctrlKey:C,shiftKey:A})=>{const T=[],_={x:E[0],y:E[1],width:E[2],height:E[3]};for(const z of f)z.x1<=_.x+_.width&&z.x2>=_.x&&T.push(z.key);const x=o-d.left-d.right,F=(_.x-d.left)/x*(s-l)+l,R=(_.x+_.width-d.left)/x*(s-l)+l;a&&a(_,T,{ctrlKey:C,shiftKey:A,xMin:F,xMax:R})},[f,a,d.left,d.right,o,l,s]),D=M.useCallback(()=>{},[]),{onMouseMove:p,onMouseDown:g,onMouseUp:y,onMouseLeave:S,paintDragSelectLayer:w}=Hs(o,u,m,D),b=M.useMemo(()=>B.jsx(ir,{width:o,height:u,draw:w,drawData:j7}),[o,u,w]);return B.jsxs("div",{style:{width:o,height:u,position:"relative"},onMouseDown:g,onMouseMove:p,onMouseUp:y,onMouseLeave:S,children:[B.jsx(L7,{barBoxes:f,margins:d,pixelTicks:h,pixelVerticalLines:v,xLabel:i,width:o,height:u}),b]})},P7=(e,t)=>{const n=t-e;let r;n<=30?r=10:n<=120?r=20:n<=300?r=50:n<=600?r=100:n<=1e3?r=150:r=100;const i=[];let a=Math.ceil(e/r);for(;a*r<=t;)i.push(a*r),a++;return i},q7=({metric:e,metricRange:t,units:n,selectedUnitIds:r,setSelectedUnitIds:i,numBins:a,onZoomToRect:o,width:u,height:l})=>{const{bars:s,ticks:c,verticalLines:f}=M.useMemo(()=>{const h=n.map(p=>p.values[e.key]).filter(p=>p!==void 0).map(p=>p),v=n.filter(p=>r.has(p.unitId)).map(p=>p.values[e.key]).filter(p=>p!==void 0).map(p=>p),D=n.filter(p=>r.has(p.unitId)).map(p=>({unitId:p.unitId,value:p.values[e.key]})).filter(p=>p.value!==void 0).map(p=>p.unitId).map(p=>wr(Ct(p)));return V7(h,v,D,a||10)},[n,e,r,a]),d=M.useCallback((h,v,{ctrlKey:m,shiftKey:D,xMin:p,xMax:g})=>{if(D){o&&o({x:p,y:h.y,width:g-p,height:h.height});return}if(v.length===0)return;const y=[];for(const E of v){const C=s[E];y.push(C)}const S=Math.min(...y.map(E=>E.xStart)),w=Math.max(...y.map(E=>E.xEnd)),b=[];for(const E of n){const C=E.values[e.key];C!==void 0&&S<=C&&C<=w&&b.push(E.unitId)}i(m||D?[...new Set([...r,...b])]:b)},[s,e,r,i,n,o]);return B.jsx(H7,{width:u,height:l,bars:s,range:t,ticks:c,verticalLines:f,onSelectRect:d})},V7=(e,t,n,r)=>{if(e.length===0)return{bars:[],ticks:[],verticalLines:[]};let i=Math.min(...e),a=Math.max(...e);if(a<=i)return{bars:[],ticks:[],verticalLines:[]};i-=(a-i)/r/2,a+=(a-i)/r/2;const o=[];for(let f=0;f<r;f++)o.push(0);for(const f of e){const d=Math.min(Math.floor((f-i)/(a-i)*r),r-1);o[d]++}const u=[];for(let f=0;f<r;f++)u.push(0);for(const f of t){const d=Math.min(Math.floor((f-i)/(a-i)*r),r-1);u[d]++}const l=[];t.forEach((f,d)=>{l.push({x:f,color:n[d]})});const c=G7(i,a).map(f=>({x:f,label:`${f}`}));return{bars:[...o.map((f,d)=>({key:d,xStart:i+d*(a-i)/r,xEnd:i+(d+1)*(a-i)/r,height:f,tooltip:"",color:"gray"}))],ticks:c,verticalLines:l}},G7=(e,t)=>{const n=t-e;if(n<=0)return[];let r=1;for(;n*r<100;)r*=10;for(;n*r>=1e3;)r/=10;return P7(e*r,t*r).map(i=>i/r)},Y7=(e,t)=>{e.clearRect(0,0,t.width,t.height),t.markers.forEach(n=>{const r=t.coord2Pixel({x:n.x,y:n.y});e.fillStyle=n.color,e.strokeStyle="black",e.beginPath(),e.ellipse(r.x,r.y,n.radius,n.radius,0,0,2*Math.PI),e.fill(),e.stroke()})},X7=e=>B.jsx(ir,{width:e.width,height:e.height,draw:Y7,drawData:e}),Z7={},Q7=({markers:e,xRange:t,yRange:n,onSelectRect:r,onClickPoint:i,width:a,height:o})=>{const{margins:u}=M.useMemo(()=>({margins:{left:20,right:20,top:20,bottom:20}}),[]),{xMin:l,xMax:s,yMin:c,yMax:f}=M.useMemo(()=>{let b,E,C,A;return t?(b=t.min,E=t.max):e.length>0?(b=Math.min(...e.map(T=>T.x)),E=Math.max(...e.map(T=>T.x))):(b=0,E=1),n?(C=n.min,A=n.max):e.length>0?(C=Math.min(...e.map(T=>T.y)),A=Math.max(...e.map(T=>T.y))):(C=0,A=1),{xMin:b,xMax:E,yMin:C,yMax:A}},[e,t,n]),{coord2Pixel:d,pixel2Coord:h}=M.useMemo(()=>{const b=a-u.left-u.right,E=o-u.top-u.bottom;return{coord2Pixel:T=>({x:u.left+(T.x-l)/(s-l)*b,y:u.top+(1-(T.y-c)/(f-c))*E}),pixel2Coord:T=>({x:l+(T.x-u.left)/b*(s-l),y:c+(1-(T.y-u.top)/E)*(f-c)})}},[a,o,u,l,s,c,f]),v=M.useCallback((b,{ctrlKey:E,shiftKey:C})=>{const A={x:b[0],y:b[1],width:b[2],height:b[3]},T=[];for(const x of e){const F=d({x:x.x,y:x.y}),R={xmin:F.x-x.radius,ymin:F.y-x.radius,xmax:F.x+x.radius,ymax:F.y+x.radius};Yh({xmin:A.x,xmax:A.x+A.width,ymin:A.y,ymax:A.y+A.height},R)&&T.push(x.key)}const _=K7(h,A);r&&r(_,T,{ctrlKey:E,shiftKey:C})},[r,h,e,d]),m=M.useCallback((b,{ctrlKey:E,shiftKey:C})=>{const A={x:b[0],y:b[1]},T={x:A.x,y:A.y,width:1,height:1};let _;for(const x of e){const F=d({x:x.x,y:x.y}),R={xmin:F.x-x.radius,ymin:F.y-x.radius,xmax:F.x+x.radius,ymax:F.y+x.radius};Yh({xmin:T.x,xmax:T.x+T.width,ymin:T.y,ymax:T.y+T.height},R)&&(_=x.key)}i&&i(h(A),_,{ctrlKey:E,shiftKey:C})},[d,e,i,h]),{onMouseMove:D,onMouseDown:p,onMouseUp:g,onMouseLeave:y,paintDragSelectLayer:S}=Hs(a,o,v,m),w=M.useMemo(()=>B.jsx(ir,{width:a,height:o,draw:S,drawData:Z7}),[a,o,S]);return B.jsxs("div",{style:{width:a,height:o,position:"relative"},onMouseDown:p,onMouseMove:D,onMouseUp:g,onMouseLeave:y,children:[B.jsx(X7,{markers:e,margins:u,coord2Pixel:d,width:a,height:o}),w]})},K7=(e,t)=>{const n=e({x:t.x,y:t.y}),r=e({x:t.x+t.width,y:t.y+t.height});return{x:Math.min(n.x,r.x),y:Math.min(n.y,r.y),width:Math.abs(r.x-n.x),height:Math.abs(r.y-n.y)}},W7=({metric1:e,metric2:t,metric1Range:n,metric2Range:r,units:i,selectedUnitIds:a,setSelectedUnitIds:o,onZoomToRect:u,width:l,height:s})=>{const f=M.useMemo(()=>{const v=[];for(const m of i){const D=m.values[e.key],p=m.values[t.key];D!==void 0&&p!==void 0&&v.push({key:m.unitId,x:D,y:p,color:a.has(m.unitId)?wr(Ct(m.unitId)):"lightgray",radius:6,tooltip:`Unit ${m.unitId}`})}return v},[i,e,t,a]),d=M.useCallback((v,m,{ctrlKey:D,shiftKey:p})=>{if(p){u&&u(v);return}let g=m;D&&(g=[...new Set([...m,...a])]),o(g)},[o,a,u]),h=M.useCallback((v,m,{ctrlKey:D,shiftKey:p})=>{let g;if(D||p){const y=new Set([...a]);m!==void 0&&(y.has(m)?y.delete(m):y.add(m)),g=[...y]}else m===void 0?g=[]:g=[m];o(g)},[o,a]);return B.jsx(Q7,{width:l,height:s,markers:f,xRange:n,yRange:r,onSelectRect:d,onClickPoint:h})},J7=({type:e,metric1:t,metric2:n,metric1Range:r,metric2Range:i,units:a,selectedUnitIds:o,setSelectedUnitIds:u,numHistogramBins:l,onZoomToRect:s,width:c,height:f})=>{if(e==="histogram"){if(!t)throw Error("Unexpected: metric1 not defined");return B.jsx(q7,{metric:t,metricRange:r,units:a,selectedUnitIds:o,setSelectedUnitIds:u,numBins:l,onZoomToRect:s,width:c,height:f})}else if(e==="scatter"){if(!t)throw Error("Unexpected: metric1 not defined");if(!n)throw Error("Unexpected: metric2 not defined");return B.jsx(W7,{metric1:t,metric2:n,metric1Range:r,metric2Range:i,units:a,selectedUnitIds:o,setSelectedUnitIds:u,onZoomToRect:s,width:c,height:f})}else{if(e==="bottom-label")return B.jsx("div",{style:{width:c,textAlign:"center"},children:t?.label||B.jsx("span",{children:" "})});if(e==="left-label")return B.jsx("div",{style:{width:c,height:f,overflow:"hidden",writingMode:"vertical-lr",transform:"rotate(-180deg)",textAlign:"center"},children:t?.label||B.jsx("span",{children:" "})});throw Error(`Unexpected type: ${e}`)}},eR=({data:e,width:t,height:n})=>{const{units:r,metrics:i}=e,{selectedUnitIds:a,unitIdSelectionDispatch:o}=qr(),{selectedUnitMetrics:u}=ch(),[l,s]=M.useState(1),[c,f]=M.useState(10),[d,h]=M.useState({}),v=M.useMemo(()=>r.sort((g,y)=>a.has(g.unitId)&&!a.has(y.unitId)?1:!a.has(g.unitId)&&a.has(y.unitId)?-1:Ct(g.unitId)-Ct(y.unitId)),[r,a]);M.useEffect(()=>{o({type:oo,newUnitOrder:yr(v.map(g=>g.unitId))})},[v,o]);const m=M.useMemo(()=>{const g=u.length===0?[{type:"text",content:"Box size",title:"Set box size"},{type:"button",callback:()=>s(w=>w*1.3),title:"Increase box size",icon:B.jsx(Tc,{})},{type:"button",callback:()=>s(w=>w/1.3),title:"Decrease box size",icon:B.jsx(Cc,{})}]:[],y=[{type:"text",content:"# bins",title:""},{type:"button",callback:()=>f(w=>w+5),title:"Increase num. histogram bins",icon:B.jsx(Tc,{})},{type:"button",callback:()=>f(w=>Math.max(5,w-5)),title:"Decrease num. histogram bins",icon:B.jsx(Cc,{})}],S={type:"button",callback:()=>h({}),title:"Reset zoom",text:"reset"};return[...g,{type:"divider"},...y,{type:"divider"},S]},[u.length]),D=fl,p=M.useMemo(()=>{const g=y=>{o({type:"SET_SELECTION",incomingSelectedUnitIds:y})};if(u.length===0)return i.map(y=>{const S={type:"histogram",metric1:y,metric2:y,metric1Range:d[y.key],metric2Range:d[y.key],units:v,width:400*l,height:400*l,numHistogramBins:c,selectedUnitIds:a,setSelectedUnitIds:g,onZoomToRect:b=>{h({...d,[y.key]:{min:b.x,max:b.x+b.width}})}};return{key:y.key,label:y.label,unitId:"",labelColor:"black",props:S}});{const{plotWidth:w,plotHeight:b}=PS(t-D-30-10,n-30-10,u.length),E=[];for(const C of u){const A=i.filter(T=>T.key===C)[0];{const T={type:"left-label",metric1:A,metric2:A,units:v,numHistogramBins:c,width:30,height:b,selectedUnitIds:a,setSelectedUnitIds:g};E.push({key:`left-label-${C}`,label:void 0,unitId:"",labelColor:"black",props:T,hideBorderColor:!0})}for(const T of u){const _=i.filter(x=>x.key===T)[0];if(A&&_){const x={type:C===T?"histogram":"scatter",metric1:_,metric2:A,metric1Range:d[_.key],metric2Range:d[A.key],units:v,numHistogramBins:c,width:w,height:b,selectedUnitIds:a,setSelectedUnitIds:g,onZoomToRect:F=>{h(C!==T?{...d,[_.key]:{min:F.x,max:F.x+F.width},[A.key]:{min:F.y,max:F.y+F.height}}:{...d,[A.key]:{min:F.x,max:F.x+F.width}})}};E.push({key:`${T}-${C}`,label:x.type==="histogram"?C:void 0,unitId:"",labelColor:"black",props:x})}}}{const C={type:"bottom-label",metric1:void 0,metric2:void 0,units:v,numHistogramBins:c,width:30,height:30,selectedUnitIds:a,setSelectedUnitIds:g};E.push({key:"left-bottom-label",label:void 0,unitId:"",labelColor:"black",props:C,hideBorderColor:!0})}for(const C of u){const A=i.filter(_=>_.key===C)[0],T={type:"bottom-label",metric1:A,metric2:A,units:v,numHistogramBins:c,width:w,height:30,selectedUnitIds:a,setSelectedUnitIds:g};E.push({key:`bottom-label-${C}`,label:void 0,unitId:"",labelColor:"black",props:T,hideBorderColor:!0})}return E}},[i,a,v,l,u,c,t,n,o,d,D]);return B.jsxs(Ro,{width:t,height:n,initialPosition:D,adjustable:!1,children:[B.jsx(dl,{width:D,height:n,customActions:m}),B.jsx(wc,{width:0,height:0,disableScroll:u.length>0,children:B.jsx(xc,{plots:p,plotComponent:J7,numPlotsPerRow:u.length===0?void 0:u.length+1})})]})},tR=({data:e,width:t,height:n})=>{const{metrics:r}=e,{unitMetricSelectionDispatch:i}=ch();return M.useEffect(()=>{i({type:"initialize",unitMetrics:r.map(a=>a.key)})},[r,i]),B.jsxs(Ro,{width:t,height:n,initialPosition:200,adjustable:!0,children:[B.jsx($7,{width:0,height:0}),B.jsx(eR,{data:e,width:0,height:0})]})},nR=e=>js(e,{key:Ls,label:Ls,dtype:Ls}),rR=e=>js(e,{unitId:OA([RA,Ls]),values:()=>!0}),iR=e=>js(e,{type:zA("UnitMetricsGraph"),metrics:Cy(nR),units:Cy(rR)}),aR=({zarrGroup:e,contexts:t,width:n,height:r})=>{const[i,a]=M.useState(null),[o,u]=M.useState(null),[l,s]=M.useState(!0);return M.useEffect(()=>{let c=!1;return(async()=>{try{s(!0),u(null);const d=e.attrs.metrics||[],h=await e.getDatasetData("units_data",{});if(!h||h.length===0)throw new Error("Empty units data");const v=new Uint8Array(h),m=new TextDecoder("utf-8").decode(v),D=JSON.parse(m);if(c)return;const p={type:"UnitMetricsGraph",metrics:d,units:D.map(g=>({unitId:g.unit_id,values:g.values}))};if(!iR(p))throw new Error("Invalid view data structure");a(p)}catch(d){console.error("Error loading unit metrics graph data:",d),u(`Failed to load unit metrics graph data: ${d instanceof Error?d.message:String(d)}`)}finally{s(!1)}})(),()=>{c=!0}},[e]),o?B.jsxs("div",{style:{width:n,height:r,display:"flex",alignItems:"center",justifyContent:"center",color:"#666",backgroundColor:"#f5f5f5"},children:["Error: ",o]}):l?B.jsx("div",{style:{width:n,height:r,display:"flex",alignItems:"center",justifyContent:"center",color:"#666",backgroundColor:"#f5f5f5"},children:"Loading unit metrics data..."}):i?B.jsx(oR,{context:t.unitMetricSelection,children:B.jsx(Jr,{context:t.unitSelection,children:B.jsx(tR,{data:i,width:n,height:r})})}):B.jsx("div",{style:{width:n,height:r,display:"flex",alignItems:"center",justifyContent:"center",color:"#666",backgroundColor:"#f5f5f5"},children:"No unit metrics data available"})},oR=({context:e,children:t})=>{const{state:n,dispatch:r}=Ef(e);return!r||!n?B.jsx(B.Fragment,{children:"Waiting for unit metric selection context..."}):B.jsx(hy.Provider,{value:{unitMetricSelection:n,unitMetricSelectionDispatch:r},children:t})},JS=()=>{const e={current:{}},t=[];return{stateRef:e,dispatch:i=>{e.current=eA(e.current,i),t.forEach(a=>{a(e.current)})},onChange:i=>(t.push(i),()=>{const a=t.indexOf(i);a>=0&&t.splice(a,1)}),createNew:JS}},ex=()=>{const e={current:Sy},t=[];return{stateRef:e,dispatch:i=>{e.current=TA(e.current,i),t.forEach(a=>{a(e.current)})},onChange:i=>(t.push(i),()=>{const a=t.indexOf(i);a>=0&&t.splice(a,1)}),createNew:ex}},tx=()=>{const e={current:{}},t=[];return{stateRef:e,dispatch:i=>{e.current=Af(e.current,i),t.forEach(a=>{a(e.current)})},onChange:i=>(t.push(i),()=>{const a=t.indexOf(i);a>=0&&t.splice(a,1)}),createNew:tx}},uR=({zarrGroup:e,width:t,height:n,onResize:r,onDataChange:i,contexts:a,component:o})=>{const[u,l]=M.useState(t),[s,c]=M.useState(n),[f,d]=M.useState(e);return M.useEffect(()=>{r((h,v)=>{l(h),c(v)}),i(h=>{d(h)})},[r,i]),B.jsx(o,{zarrGroup:f,width:u,height:s,contexts:a})},lR=e=>t=>{const{container:n,zarrGroup:r,width:i,height:a,onResize:o,onDataChange:u,contexts:l}=t;JE.createRoot(n).render(B.jsx(uR,{zarrGroup:r,width:i,height:a,onResize:o,onDataChange:u,contexts:l,component:e}))};(()=>{const e=[{name:"spike_sorting.Autocorrelograms",component:YF},{name:"spike_sorting.AverageWaveforms",component:UN},{name:"spike_sorting.CrossCorrelograms",component:kN},{name:"spike_sorting.RasterPlot",component:S7},{name:"spike_sorting.SpikeAmplitudes",component:E7},{name:"spike_sorting.UnitLocations",component:N7},{name:"spike_sorting.UnitMetricsGraph",component:aR},{name:"spike_sorting.UnitsTable",component:iN},{name:"spike_sorting.SortingCuration",component:nN}],t=window.figpack_p1.registerFPViewComponent;for(const i of e)t({name:i.name,render:lR(i.component)});const n=window.figpack_p1.registerFPViewContextCreator;n({name:"unitSelection",create:ex}),n({name:"unitMetricSelection",create:JS}),n({name:"sortingCuration",create:tx});const r=window.figpack_p1.registerFPExtension;r({name:"figpack-spike-sorting"})})()})();