figpack-spike-sorting 0.1.5__py3-none-any.whl → 0.1.7__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,5 +1,5 @@
1
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
+ (function(){"use strict";function ax(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 ox(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Gm={exports:{}},vl={};/**
3
3
  * @license React
4
4
  * react-jsx-runtime.production.js
5
5
  *
@@ -7,7 +7,7 @@
7
7
  *
8
8
  * This source code is licensed under the MIT license found in the
9
9
  * LICENSE file in the root directory of this source tree.
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
+ */var ux=Symbol.for("react.transitional.element"),lx=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:ux,type:e,key:r,ref:t!==void 0?t:null,props:n}}vl.Fragment=lx,vl.jsx=Ym,vl.jsxs=Ym,Gm.exports=vl;var _=Gm.exports,Xm={exports:{}},Te={};/**
11
11
  * @license React
12
12
  * react.production.js
13
13
  *
@@ -15,7 +15,7 @@
15
15
  *
16
16
  * This source code is licensed under the MIT license found in the
17
17
  * LICENSE file in the root directory of this source tree.
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
+ */var Of=Symbol.for("react.transitional.element"),sx=Symbol.for("react.portal"),cx=Symbol.for("react.fragment"),fx=Symbol.for("react.strict_mode"),dx=Symbol.for("react.profiler"),hx=Symbol.for("react.consumer"),mx=Symbol.for("react.context"),px=Symbol.for("react.forward_ref"),gx=Symbol.for("react.suspense"),vx=Symbol.for("react.memo"),Zm=Symbol.for("react.lazy"),Qm=Symbol.iterator;function yx(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 bx(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 Dx(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?Dx(""+e.key):t.toString(36)}function ip(){}function Sx(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 sx: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=bx(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=yx(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(Sx(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 xx(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 wx(){}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=cx,Te.Profiler=dx,Te.PureComponent=zf,Te.StrictMode=fx,Te.Suspense=gx,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:mx,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:hx,_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:px,render:e}},Te.isValidElement=$f,Te.lazy=function(e){return{$$typeof:Zm,_payload:{_status:-1,_result:e},_init:xx}},Te.memo=function(e,t){return{$$typeof:vx,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(wx,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=ox(M),Lf=ax({__proto__:null,default:Nt},[M]);var op={exports:{}},bl={},up={exports:{}},lp={};/**
19
19
  * @license React
20
20
  * scheduler.production.js
21
21
  *
@@ -23,7 +23,7 @@
23
23
  *
24
24
  * This source code is licensed under the MIT license found in the
25
25
  * LICENSE file in the root directory of this source tree.
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
+ */(function(e){function t(N,U){var I=N.length;N.push(U);e:for(;0<I;){var L=I-1>>>1,X=N[L];if(0<i(X,U))N[L]=U,N[I]=X,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,X=N.length,Z=X>>>1;L<Z;){var P=2*(L+1)-1,j=N[P],Y=P+1,$=N[Y];if(0>i(j,I))Y<X&&0>i($,j)?(N[L]=$,N[Y]=I,L=Y):(N[L]=j,N[P]=I,L=P);else if(Y<X&&0>i($,I))N[L]=$,N[Y]=I,L=Y;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,S=!1,p=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;function D(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,D(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,A=5,C=-1;function T(){return S?!0:!(e.unstable_now()-C<A)}function B(){if(S=!1,b){var N=e.unstable_now();C=N;var U=!0;try{e:{v=!1,m&&(m=!1,g(E),E=-1),h=!0;var I=d;try{t:{for(D(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 X=L(f.expirationTime<=N);if(N=e.unstable_now(),typeof X=="function"){f.callback=X,D(N),U=!0;break t}f===n(l)&&r(l),D(N)}else r(l);f=n(l)}if(f!==null)U=!0;else{var Z=n(s);Z!==null&&z(w,Z.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(B)};else if(typeof MessageChannel<"u"){var R=new MessageChannel,F=R.port2;R.port1.onmessage=B,x=function(){F.postMessage(null)}}else x=function(){p(B,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"):A=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(){S=!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 X=-1;break;case 2:X=250;break;case 5:X=1073741823;break;case 4:X=1e4;break;default:X=5e3}return X=I+X,N={id:c++,callback:U,priorityLevel:N,startTime:I,expirationTime:X,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=X,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 Ex=up.exports,sp={exports:{}},nn={};/**
27
27
  * @license React
28
28
  * react-dom.production.js
29
29
  *
@@ -31,7 +31,7 @@
31
31
  *
32
32
  * This source code is licensed under the MIT license found in the
33
33
  * LICENSE file in the root directory of this source tree.
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
+ */var Ax=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},Cx=Symbol.for("react.portal");function Tx(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Cx,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}var Io=Ax.__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 Tx(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 Mx=sp.exports;/**
35
35
  * @license React
36
36
  * react-dom-client.production.js
37
37
  *
@@ -39,39 +39,39 @@
39
39
  *
40
40
  * This source code is licensed under the MIT license found in the
41
41
  * LICENSE file in the root directory of this source tree.
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
+ */var Rt=Ex,dp=M,_x=Mx;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 Bx(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,Fx=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"),Nx=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"),Rx=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 Ox=Symbol.for("react.client.reference");function Yf(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Ox?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,Ee=dp.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$e=_x.__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,zx=Rt.unstable_shouldYield,Ux=Rt.unstable_requestPaint,dr=Rt.unstable_now,Ix=Rt.unstable_getCurrentPriorityLevel,Dp=Rt.unstable_ImmediatePriority,Sp=Rt.unstable_UserBlockingPriority,Al=Rt.unstable_NormalPriority,$x=Rt.unstable_LowPriority,xp=Rt.unstable_IdlePriority,kx=Rt.log,Lx=Rt.unstable_setDisableYieldValue,Po=null,xn=null;function ri(e){if(typeof kx=="function"&&Lx(e),xn&&typeof xn.setStrictMode=="function")try{xn.setStrictMode(Po,e)}catch{}}var wn=Math.clz32?Math.clz32:Px,jx=Math.log,Hx=Math.LN2;function Px(e){return e>>>=0,e===0?32:31-(jx(e)/Hx|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 qx(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 Vx(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 Gx(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,Yx="__reactListeners$"+ii,Xx="__reactHandles$"+ii,Mp="__reactResources$"+ii,Go="__reactMarker$"+ii;function rd(e){delete e[Qt],delete e[ln],delete e[nd],delete e[Yx],delete e[Xx]}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 Zx=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 Qx(e){return Qf.call(Np,e)?!0:Qf.call(Fp,e)?!1:Zx.test(e)?Np[e]=!0:(Fp[e]=!0,!1)}function _l(e,t,n){if(Qx(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(`
43
43
  at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
44
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
45
  `),s=u.split(`
46
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
+ `+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 Kx(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+=Kx(e),e=e.return;while(e);return t}catch(n){return`
48
48
  Error generating stack: `+n.message+`
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.
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 Wx(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=Wx(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 Jx=/[\n"\\]/g;function Ln(e){return e.replace(Jx,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 ew=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||ew.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 tw=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"]]),nw=/^[\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 nw.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}),rw=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),iw=ut({},$l,{dataTransfer:0}),aw=sn(iw),ow=ut({},Qo,{relatedTarget:0}),vd=sn(ow),uw=ut({},Li,{animationName:0,elapsedTime:0,pseudoElement:0}),lw=sn(uw),sw=ut({},Li,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),cw=sn(sw),fw=ut({},Li,{data:0}),Yp=sn(fw),dw={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},hw={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"},mw={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function pw(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=mw[e])?!!t[e]:!1}function yd(){return pw}var gw=ut({},Qo,{key:function(e){if(e.key){var t=dw[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"?hw[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}}),vw=sn(gw),yw=ut({},$l,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Xp=sn(yw),bw=ut({},Qo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:yd}),Dw=sn(bw),Sw=ut({},Li,{propertyName:0,elapsedTime:0,pseudoElement:0}),xw=sn(Sw),ww=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}),Ew=sn(ww),Aw=ut({},Li,{newState:0,oldState:0}),Cw=sn(Aw),Tw=[9,13,27,32],bd=Br&&"CompositionEvent"in window,Wo=null;Br&&"documentMode"in document&&(Wo=document.documentMode);var Mw=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 Tw.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 _w(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 Bw(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 Fw={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"?!!Fw[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 Nw(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(Nw,t)}}function Rw(e,t,n){e==="focusin"?(ag(),Jo=t,eu=n,Jo.attachEvent("onpropertychange",og)):e==="focusout"&&ag()}function Ow(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return kl(eu)}function zw(e,t){if(e==="click")return kl(t)}function Uw(e,t){if(e==="input"||e==="change")return kl(t)}function Iw(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var En=typeof Object.is=="function"?Object.is:Iw;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 $w=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"),kw=Hi("transitionrun"),Lw=Hi("transitionstart"),jw=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 Hw(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 Hw(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=qE(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 Nx: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":Ne("cancel",t),Ne("close",t);break;case"iframe":case"object":case"embed":Ne("load",t);break;case"video":case"audio":for(n=0;n<_u.length;n++)Ne(_u[n],t);break;case"source":Ne("error",t);break;case"img":case"image":case"link":Ne("error",t),Ne("load",t);break;case"details":Ne("toggle",t);break;case"input":Ne("invalid",t),Ip(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0),Fl(t);break;case"select":Ne("invalid",t);break;case"textarea":Ne("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&&(Ne("beforetoggle",t),Ne("toggle",t)),r.onScroll!=null&&Ne("scroll",t),r.onScrollEnd!=null&&Ne("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 Pw=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()})}},qw=Rt.unstable_scheduleCallback,Vw=Rt.unstable_NormalPriority,Ot={$$typeof:Mr,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function $d(){return{controller:new Pw,data:new Map,refCount:0}}function uu(e){e.refCount--,e.refCount===0&&qw(Vw,function(){e.controller.abort()})}var lu=null,kd=0,$a=0,ka=null;function Gw(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 Yw(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=Ee.S;Ee.S=function(e,t){typeof t=="object"&&t!==null&&typeof t.then=="function"&&Gw(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 S=n;switch(m.tag){case 1:if(v=m.payload,typeof v=="function"){f=v.call(S,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(S,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,Xw=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,Ee.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){Ee.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)}Ee.H=tE,a=t(n,r)}while(ja);return a}function Zw(){var e=Ee.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,Ee.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]=Rx;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 Qw(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)}};Ee.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=Ee.T,o={};Ee.T=o;try{var u=n(i,r),l=Ee.S;l!==null&&l(o,u),Yg(e,t,u)}catch(s){i0(e,t,s)}finally{Ee.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=Qw.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(),Kw.bind(null,i,n),null)),[r,a,e]}function Kw(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=Ee.T,u={};Ee.T=u,s0(e,!1,t,n);try{var l=i(),s=Ee.S;if(s!==null&&s(u,l),l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=Yw(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,Ee.T=o}}function Ww(){}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?Ww: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 Jw(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 eE(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=eE.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=Xw++,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=Jw.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},tE={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===Fx?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,D){return g===null||g.tag!==6?(g=Bd(y,p.mode,D),g.return=p,g):(g=i(g,y),g.return=p,g)}function l(p,g,y,D){var w=y.type;return w===va?c(p,g,y.props.children,D,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,D),bu(g,y),g.return=p,g)}function s(p,g,y,D){return g===null||g.tag!==4||g.stateNode.containerInfo!==y.containerInfo||g.stateNode.implementation!==y.implementation?(g=Fd(y,p.mode,D),g.return=p,g):(g=i(g,y.children||[]),g.return=p,g)}function c(p,g,y,D,w){return g===null||g.tag!==7?(g=Pi(y,p.mode,D,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 D=g._init;return g=D(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,D){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,D);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Sl:return y.key===w?l(p,g,y,D):null;case ko:return y.key===w?s(p,g,y,D):null;case ti:return w=y._init,y=w(y._payload),d(p,g,y,D)}if(jo(y)||Lo(y))return w!==null?null:c(p,g,y,D,null);if(typeof y.then=="function")return d(p,g,os(y),D);if(y.$$typeof===Mr)return d(p,g,Yl(p,y),D);us(p,y)}return null}function h(p,g,y,D,w){if(typeof D=="string"&&D!==""||typeof D=="number"||typeof D=="bigint")return p=p.get(y)||null,u(g,p,""+D,w);if(typeof D=="object"&&D!==null){switch(D.$$typeof){case Sl:return p=p.get(D.key===null?y:D.key)||null,l(g,p,D,w);case ko:return p=p.get(D.key===null?y:D.key)||null,s(g,p,D,w);case ti:var b=D._init;return D=b(D._payload),h(p,g,y,D,w)}if(jo(D)||Lo(D))return p=p.get(y)||null,c(g,p,D,w,null);if(typeof D.then=="function")return h(p,g,y,os(D),w);if(D.$$typeof===Mr)return h(p,g,y,Yl(g,D),w);us(g,D)}return null}function v(p,g,y,D){for(var w=null,b=null,E=g,A=g=0,C=null;E!==null&&A<y.length;A++){E.index>A?(C=E,E=null):C=E.sibling;var T=d(p,E,y[A],D);if(T===null){E===null&&(E=C);break}e&&E&&T.alternate===null&&t(p,E),g=a(T,g,A),b===null?w=T:b.sibling=T,b=T,E=C}if(A===y.length)return n(p,E),ke&&Vi(p,A),w;if(E===null){for(;A<y.length;A++)E=f(p,y[A],D),E!==null&&(g=a(E,g,A),b===null?w=E:b.sibling=E,b=E);return ke&&Vi(p,A),w}for(E=r(E);A<y.length;A++)C=h(E,p,A,y[A],D),C!==null&&(e&&C.alternate!==null&&E.delete(C.key===null?A:C.key),g=a(C,g,A),b===null?w=C:b.sibling=C,b=C);return e&&E.forEach(function(B){return t(p,B)}),ke&&Vi(p,A),w}function m(p,g,y,D){if(y==null)throw Error(re(151));for(var w=null,b=null,E=g,A=g=0,C=null,T=y.next();E!==null&&!T.done;A++,T=y.next()){E.index>A?(C=E,E=null):C=E.sibling;var B=d(p,E,T.value,D);if(B===null){E===null&&(E=C);break}e&&E&&B.alternate===null&&t(p,E),g=a(B,g,A),b===null?w=B:b.sibling=B,b=B,E=C}if(T.done)return n(p,E),ke&&Vi(p,A),w;if(E===null){for(;!T.done;A++,T=y.next())T=f(p,T.value,D),T!==null&&(g=a(T,g,A),b===null?w=T:b.sibling=T,b=T);return ke&&Vi(p,A),w}for(E=r(E);!T.done;A++,T=y.next())T=h(E,p,A,T.value,D),T!==null&&(e&&T.alternate!==null&&E.delete(T.key===null?A:T.key),g=a(T,g,A),b===null?w=T:b.sibling=T,b=T);return e&&E.forEach(function(x){return t(p,x)}),ke&&Vi(p,A),w}function S(p,g,y,D){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),D=i(g,y.props.children),D.return=p,p=D;break e}}else if(g.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===ti&&Sv(w)===g.type){n(p,g.sibling),D=i(g,y.props),bu(D,y),D.return=p,p=D;break e}n(p,g);break}else t(p,g);g=g.sibling}y.type===va?(D=Pi(y.props.children,p.mode,D,y.key),D.return=p,p=D):(D=Pl(y.type,y.key,y.props,null,p.mode,D),bu(D,y),D.return=p,p=D)}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),D=i(g,y.children||[]),D.return=p,p=D;break e}else{n(p,g);break}else t(p,g);g=g.sibling}D=Fd(y,p.mode,D),D.return=p,p=D}return o(p);case ti:return w=y._init,y=w(y._payload),S(p,g,y,D)}if(jo(y))return v(p,g,y,D);if(Lo(y)){if(w=Lo(y),typeof w!="function")throw Error(re(150));return y=w.call(y),m(p,g,y,D)}if(typeof y.then=="function")return S(p,g,os(y),D);if(y.$$typeof===Mr)return S(p,g,Yl(p,y),D);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),D=i(g,y),D.return=p,p=D):(n(p,g),D=Bd(y,p.mode,D),D.return=p,p=D),o(p)):n(p,g)}return function(p,g,y,D){try{yu=0;var w=S(p,g,y,D);return qa=null,w}catch(E){if(E===su||E===Zl)throw E;var b=An(29,E,null,p.mode);return b.lanes=D,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 nE(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 rE(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,rE(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=FE(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,Zw,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=NE(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 iE(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 aE(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;CE(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 oE(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=pE.bind(null,n),RE(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 uE(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=uE(e);t.forEach(function(r){var i=gE.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&&GE(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 lE={getCacheForType:function(e){var t=Kt(Ot),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n}},sE=typeof WeakMap=="function"?WeakMap:Map,qe=0,rt=null,Fe=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(Ee.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?dE(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&&!cE(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:VE},u1(t),f=YE(),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 cE(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(Fe!==null){if(Ve===0)var e=Fe.return;else e=Fe,Or=Xi=null,Wd(e),qa=null,yu=0,e=Fe;for(;e!==null;)Yv(e.alternate,e),e=e.return;Fe=null}}function Wa(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,ME(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),z0(),rt=e,Fe=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,Ee.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,Fe===null&&(Dt=1,cs(e,jn(t,e.current)))}function g1(){var e=Ee.H;return Ee.H=as,e===null?as:e}function v1(){var e=Ee.A;return Ee.A=lE,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&&Fe!==null){var u=Fe,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)}}fE(),o=Dt;break}catch(c){p1(e,c)}while(!0);return t&&e.shellSuspendCounter++,Or=Xi=null,qe=r,Ee.H=i,Ee.A=a,Fe===null&&(rt=null,Oe=0,Ll()),o}function fE(){for(;Fe!==null;)y1(Fe)}function dE(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&&Fe!==null){t=Fe;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(Fe.tag){case 26:o=Fe.memoizedState;case 5:case 27:var u=Fe;if(!o||ey(o)){Ve=0,Mn=null;var l=u.sibling;if(l!==null)Fe=l;else{var s=u.return;s!==null?(Fe=s,bs(s)):Fe=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))}}hE();break}catch(c){p1(e,c)}while(!0);return Or=Xi=null,Ee.H=r,Ee.A=i,qe=n,Fe!==null?0:(rt=null,Oe=0,Ll(),Dt)}function hE(){for(;Fe!==null&&!zx();)y1(Fe)}function y1(e){var t=Vv(e.alternate,e,Hr);e.memoizedProps=e.pendingProps,t===null?bs(e):Fe=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=Fe=Dg(t,Hr),t=Vv(n,t,Hr)}e.memoizedProps=e.pendingProps,t===null?bs(e):Fe=t}function Ja(e,t,n,r){Or=Xi=null,Wd(t),qa=null,yu=0;var i=t.return;try{if(nE(e,i,t,n,Oe)){Dt=1,cs(e,jn(n,e.current)),Fe=null;return}}catch(a){if(i!==null)throw Fe=i,a;Dt=1,cs(e,jn(n,e.current)),Fe=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=iE(t.alternate,t,Hr);if(n!==null){Fe=n;return}if(t=t.sibling,t!==null){Fe=t;return}Fe=t=e}while(t!==null);Dt===0&&(Dt=5)}function D1(e,t){do{var n=aE(e.alternate,e);if(n!==null){n.flags&=32767,Fe=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Fe=e;return}Fe=e=n}while(e!==null);Dt=6,Fe=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,Vx(e,n,a,o,u,l),e===rt&&(Fe=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,vE(Al,function(){return C1(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,t.subtreeFlags&13878||r){r=Ee.T,Ee.T=null,i=$e.p,$e.p=2,o=qe,qe|=4;try{oE(e,t,n)}finally{qe=o,$e.p=i,Ee.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=Ee.T,Ee.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),S=l.end===void 0?m:Math.min(l.end,v);!h.extend&&m>S&&(o=S,S=m,m=o);var p=lg(u,m),g=lg(u,S);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>S?(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 D=f[u];D.element.scrollLeft=D.left,D.element.scrollTop=D.top}}Ns=!!X0,Z0=X0=null}finally{qe=i,$e.p=r,Ee.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=Ee.T,Ee.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,Ee.T=n}}Gt=3}}function E1(){if(Gt===4||Gt===3){Gt=0,Ux();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=Ee.T,i=$e.p,$e.p=2,Ee.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{Ee.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=Ee.T,i=$e.p;try{$e.p=32>n?32:n,Ee.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,Ee.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 sE;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=mE.bind(null,e,t,n),t.then(e,e))}function mE(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 pE(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),M1(e,n)}function gE(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 vE(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,bE())}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 yE(){_1()}function _1(){xs=k0=!1;var e=0;ta!==0&&(TE()&&(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]=qx(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 bE(){_E(function(){qe&6?Kf(Dp,yE):_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 DE(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],SE=P0.toLowerCase(),xE=P0[0].toUpperCase()+P0.slice(1);tr(SE,"on"+xE)}tr(hg,"onAnimationEnd"),tr(mg,"onAnimationIteration"),tr(pg,"onAnimationStart"),tr("dblclick","onDoubleClick"),tr("focusin","onFocus"),tr("focusout","onBlur"),tr(kw,"onTransitionRun"),tr(Lw,"onTransitionStart"),tr(jw,"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(" "),wE=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 Ne(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"&&(wE.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=QE;break;case 8:i=KE;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=vw;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=aw;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=Dw;break;case hg:case mg:case pg:h=lw;break;case gg:h=xw;break;case"scroll":case"scrollend":h=rw;break;case"wheel":h=Ew;break;case"copy":case"cut":case"paste":h=cw;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=Cw}var m=(t&4)!==0,S=!m&&(e==="scroll"||e==="scrollend"),p=m?d!==null?d+"Capture":null:d;m=[];for(var g=s,y;g!==null;){var D=g;if(y=D.stateNode,D=D.tag,D!==5&&D!==26&&D!==27||y===null||p===null||(D=Xo(g,p),D!=null&&m.push(Bu(g,D,y))),S)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&&(S=$o(v),m=v.tag,v!==S||m!==5&&m!==27&&m!==6)&&(v=null)):(h=null,v=s),h!==v)){if(m=Gp,D="onMouseLeave",p="onMouseEnter",g="mouse",(e==="pointerout"||e==="pointerover")&&(m=Xp,D="onPointerLeave",p="onPointerEnter",g="pointer"),S=h==null?d:Yo(h),y=v==null?d:Yo(v),d=new m(D,g+"leave",h,n,c),d.target=S,d.relatedTarget=y,D=null,Sa(c)===s&&(m=new m(p,g+"enter",v,n,c),m.target=y,m.relatedTarget=S,D=m),S=D,h&&v)t:{for(m=h,p=v,g=0,y=m;y;y=to(y))g++;for(y=0,D=p;D;D=to(D))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&&S!==null&&I1(f,S,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=Uw;else{w=Ow;var b=Rw}else h=d.nodeName,!h||h.toLowerCase()!=="input"||d.type!=="checkbox"&&d.type!=="radio"?s&&sd(s.elementType)&&(w=ng):w=zw;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($w)break;case"keydown":case"keyup":fg(f,n,c)}var E;if(bd)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 Ba?Wp(e,n)&&(A="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(A="onCompositionStart");A&&(Zp&&n.locale!=="ko"&&(Ba||A!=="onCompositionStart"?A==="onCompositionEnd"&&Ba&&(E=qp()):(ai=c,md="value"in ai?ai.value:ai.textContent,Ba=!0)),b=Es(s,A),0<b.length&&(A=new Yp(A,e,null,n,c),f.push({event:A,listeners:b}),E?A.data=E:(E=Jp(n),E!==null&&(A.data=E)))),(E=Mw?_w(e,n):Bw(e,n))&&(A=Es(s,"onBeforeInput"),0<A.length&&(b=new Yp("onBeforeInput","beforeinput",null,n,c),f.push({event:b,listeners:A}),b.data=E)),DE(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 EE=/\r\n?/g,AE=/\u0000|\uFFFD/g;function $1(e){return(typeof e=="string"?e:""+e).replace(EE,`
50
+ `).replace(AE,"")}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&&Ne("scroll",e);break;case"onScrollEnd":r!=null&&Ne("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":Ne("beforetoggle",e),Ne("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=tw.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&&Ne("scroll",e);break;case"onScrollEnd":r!=null&&Ne("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":Ne("error",e),Ne("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":Ne("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":Ne("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":Ne("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":Ne("beforetoggle",e),Ne("toggle",e),Ne("cancel",e),Ne("close",e);break;case"iframe":case"object":Ne("load",e);break;case"video":case"audio":for(r=0;r<_u.length;r++)Ne(_u[r],e);break;case"image":Ne("error",e),Ne("load",e);break;case"details":Ne("toggle",e);break;case"embed":case"source":case"link":Ne("error",e),Ne("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 CE(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 S in n)d=n[S],n.hasOwnProperty(S)&&d!==void 0&&!r.hasOwnProperty(S)&&Y0(e,t,S,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 TE(){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,ME=typeof clearTimeout=="function"?clearTimeout:void 0,P1=typeof Promise=="function"?Promise:void 0,_E=typeof queueMicrotask=="function"?queueMicrotask:typeof P1<"u"?function(e){return P1.resolve(null).then(e).catch(BE)}:H1;function BE(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 FE(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 NE(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 RE(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:OE,r:zE,D:UE,C:IE,L:$E,m:kE,X:jE,S:LE,M:HE};function OE(){var e=Pr.f(),t=ys();return e||t}function zE(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 UE(e){Pr.D(e),X1("dns-prefetch",e,null)}function IE(e,t){Pr.C(e,t),X1("preconnect",e,t)}function $E(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 kE(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 LE(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 jE(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 HE(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||PE(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 PE(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 qE(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 VE(){}function GE(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 YE(){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(XE,e),Fs=null,Bs.call(e))}function XE(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 ZE(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 ZE(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 QE(e,t,n,r){var i=Ee.T;Ee.T=null;var a=$e.p;try{$e.p=2,ah(e,t,n,r)}finally{$e.p=a,Ee.T=i}}function KE(e,t,n,r){var i=Ee.T;Ee.T=null;var a=$e.p;try{$e.p=8,ah(e,t,n,r)}finally{$e.p=a,Ee.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(JE(i,e,t,n,r))r.stopPropagation();else if(uy(e,r),t&4&&-1<WE.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(Ix()){case Dp:return 2;case Sp:return 8;case Al:case $x: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=[],WE="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 JE(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,Gx(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 eA(){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,eA)))}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=Bx(t),e=e!==null?gp(e):null,e=e===null?null:e.stateNode,e};var tA={bundleType:0,version:"19.1.1",rendererPackageName:"react-dom",currentDispatcherRef:Ee,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(tA),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 nA=op.exports;const rA=(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=iA(e);try{const n=parseFloat(t);return isNaN(n)?0:n}catch{return 0}}else return 0},iA=e=>{let t=0;for(;t<e.length&&aA(e[t]);)t++;return e.slice(t)},aA=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}},oA=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})},uA=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})},lA=e=>e.orderedUnitIds.length===0?e:ao(e,{targetUnit:e.orderedUnitIds[0]}),sA=e=>e.orderedUnitIds.length===0?e:ao(e,{targetUnit:e.orderedUnitIds[e.orderedUnitIds.length-1]}),cA=(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}},fA=(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}},dA=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}},hA=e=>t=>n=>{pA(t,e,n)},mA=e=>t=>n=>{gA(t,e,n)},pA=(e,t,n)=>{const r={type:n.ctrlKey?fh:n.shiftKey?hh:dh,targetUnit:e};t(r)},gA=(e,t,n)=>{const r={type:n.shiftKey?hh:n.ctrlKey?dh:fh,targetUnit:e};t(r)},ks=20,vA=(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)}},yA=(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},bA=(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:[]}},DA=(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=SA(n||[],r,t.ascending),o=i(a),u=gy(e,o);return{...e,sortRules:a,orderedUnitIds:o,visibleUnitIds:u,lastClickedId:void 0}},SA=(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}]},xA="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",wA="TOGGLE_SELECT_ALL",EA="DESELECT_ALL",oo="INITIALIZE_UNITS",AA="SET_UNIT_ORDER",CA="UPDATE_SORT_FIELDS",TA="SET_VISIBLE_UNITS",MA="SET_RESTRICTED_UNITS",_A="COPY_STATE",Sy={selectedUnitIds:new Set,currentUnitId:void 0,orderedUnitIds:[]},BA=(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 xA:return cA(e,t);case fh:return ao(e,t);case vy:return oA(e);case yy:return uA(e);case by:return lA(e);case Dy:return sA(e);case dh:return py(e,t);case hh:return e.lastClickedId?fA(e,t):py(e,t);case wA:return dA(e);case EA:return{...e,selectedUnitIds:new Set,currentUnitId:void 0};case AA:return bA(e,t);case CA:return DA(e,t);case TA:return vA(e,t);case MA:return yA(e,t);case _A: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}`)}},FA=()=>M.useContext(xy),xy=Nt.createContext({unitSelection:Sy,unitSelectionDispatch:()=>{}}),qr=()=>{const{unitSelection:e,unitSelectionDispatch:t}=FA(),n=M.useMemo(()=>hA(t),[t]),r=M.useMemo(()=>mA(t),[t]),i=M.useMemo(()=>NA(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}},NA=(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 RA(e,t){const{r:n,g:r,b:i}=wy(e),a=1/t;return Ey(n*a,r*a,i*a)}function OA(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(RA(na[e],2));for(let e=0;e<Ay;e++)na.push(OA(na[e],1.5));const mh=e=>na[e%na.length],Ls=e=>e!==null&&typeof e=="string",zA=e=>e!==null&&typeof e=="function",UA=e=>e!==null&&typeof e=="number",IA=e=>t=>{for(const n of e)if(n(t))return!0;return!1},$A=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(zA(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},kA=(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(kA,{}),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=LA,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}},LA="rgba(196, 196, 196, 0.5)",Ps=e=>{const t=e.currentTarget.getBoundingClientRect();return[e.clientX-t.x,e.clientY-t.y]},jA={position:"absolute",left:0,top:0},HA=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=HA(u);f&&f.canvas&&a(f,o)},[a,u,o]);const c={...jA,...r?{top:r}:{},...i?{left:i}:{}};return _.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 PA(e,t){if(qs(e,t))return e[t];throw typeof e[t]=="function"&&VA(e,t)?new Error('Cannot access method "'+t+'" as a property'):new Error('No access to property "'+t+'"')}function qA(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!GA(e)&&!Array.isArray(e)?!1:ju(YA,t)?!0:!(t in Object.prototype||t in Function.prototype)}function VA(e,t){return e==null||typeof e[t]!="function"||ju(e,t)&&Object.getPrototypeOf&&t in Object.getPrototypeOf(e)?!1:ju(XA,t)?!0:!(t in Object.prototype||t in Function.prototype)}function GA(e){return typeof e=="object"&&e&&e.constructor===Object}var YA={length:!0,name:!0},XA={toString:!0,valueOf:!0,toLocaleString:!0};class ZA{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 PA(this.wrappedObject,t)}set(t,n){return qA(this.wrappedObject,t,n),this}has(t){return qs(this.wrappedObject,t)&&t in this.wrappedObject}entries(){return QA(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 QA(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 KA(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 WA(e){return typeof e=="boolean"}function JA(e){return e&&e.constructor.prototype.isResultSet===!0||!1}function eC(e){return e&&e.constructor.prototype.isHelp===!0||!1}function tC(e){return typeof e=="function"}function nC(e){return e instanceof Date}function rC(e){return e instanceof RegExp}function yh(e){return!!(e&&typeof e=="object"&&e.constructor===Object&&!ph(e)&&!gh(e))}function iC(e){return e?e instanceof Map||e instanceof ZA||typeof e.set=="function"&&typeof e.get=="function"&&typeof e.keys=="function"&&typeof e.has=="function":!1}function aC(e){return e===null}function oC(e){return e===void 0}function uC(e){return e&&e.isAccessorNode===!0&&e.constructor.prototype.isNode===!0||!1}function lC(e){return e&&e.isArrayNode===!0&&e.constructor.prototype.isNode===!0||!1}function sC(e){return e&&e.isAssignmentNode===!0&&e.constructor.prototype.isNode===!0||!1}function cC(e){return e&&e.isBlockNode===!0&&e.constructor.prototype.isNode===!0||!1}function fC(e){return e&&e.isConditionalNode===!0&&e.constructor.prototype.isNode===!0||!1}function dC(e){return e&&e.isConstantNode===!0&&e.constructor.prototype.isNode===!0||!1}function hC(e){return e&&e.isFunctionAssignmentNode===!0&&e.constructor.prototype.isNode===!0||!1}function mC(e){return e&&e.isFunctionNode===!0&&e.constructor.prototype.isNode===!0||!1}function pC(e){return e&&e.isIndexNode===!0&&e.constructor.prototype.isNode===!0||!1}function gC(e){return e&&e.isNode===!0&&e.constructor.prototype.isNode===!0||!1}function vC(e){return e&&e.isObjectNode===!0&&e.constructor.prototype.isNode===!0||!1}function yC(e){return e&&e.isOperatorNode===!0&&e.constructor.prototype.isNode===!0||!1}function bC(e){return e&&e.isParenthesisNode===!0&&e.constructor.prototype.isNode===!0||!1}function DC(e){return e&&e.isRangeNode===!0&&e.constructor.prototype.isNode===!0||!1}function SC(e){return e&&e.isRelationalNode===!0&&e.constructor.prototype.isNode===!0||!1}function xC(e){return e&&e.isSymbolNode===!0&&e.constructor.prototype.isNode===!0||!1}function wC(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 EC(e,Ie);if(t==="function")return e;throw new TypeError("Cannot clone: unknown type of value (value: ".concat(e,")"))}function EC(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 AC(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 CC=["Matrix","Array"],TC=["number","BigNumber","Fraction"],Wt=function(t){if(t)throw new Error(`The global config is readonly.
51
51
  Please create a mathjs instance if you want to change the default configuration.
52
52
  Example:
53
53
 
54
54
  import { create, all } from 'mathjs';
55
55
  const mathjs = create(all);
56
56
  mathjs.config({ number: 'BigNumber' });
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."))}/*!
57
+ `);return Object.freeze(Ty)};Ci(Wt,Ty,{MATRIX_OPTIONS:CC,NUMBER_OPTIONS:TC});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 k=r.get(O);if(k)return k;let H='Unknown type "'+O+'"';const G=O.toLowerCase();let ie;for(ie of i)if(ie.toLowerCase()===G){H+='. Did you mean "'+ie+'" ?';break}throw new TypeError(H)}function l(O){let k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"any";const H=k?u(k).index:i.length,G=[];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 he=O[J].name;if(r.has(he))throw new TypeError('Duplicate type name "'+he+'"');G.push(he),r.set(he,{name:he,test:O[J].test,isAny:O[J].isAny,index:H+J,conversionsTo:[]})}const ie=i.slice(H);i=i.slice(0,H).concat(G).concat(ie);for(let J=H+G.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 k=i.filter(H=>{const G=r.get(H);return!G.isAny&&G.test(O)});return k.length?k:["any"]}function d(O){return O&&typeof O=="function"&&"_typedFunctionData"in O}function h(O,k,H){if(!d(O))throw new TypeError(Oy);const G=H&&H.exact,ie=Array.isArray(k)?k.join(","):k,J=D(ie),he=S(J);if(!G||he in O.signatures){const We=O._typedFunctionData.signatureMap.get(he);if(We)return We}const oe=J.length;let de;if(G){de=[];let We;for(We in O.signatures)de.push(O._typedFunctionData.signatureMap.get(We))}else de=O._typedFunctionData.signatures;for(let We=0;We<oe;++We){const ot=J[We],Ft=[];let Dn;for(Dn of de){const un=A(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(de=Ft,de.length===0)break}let ue;for(ue of de)if(ue.params.length<=oe)return ue;throw new TypeError("Signature not found (signature: "+(O.name||"unnamed")+"("+S(J,", ")+"))")}function v(O,k,H){return h(O,k,H).implementation}function m(O,k){const H=u(k);if(H.test(O))return O;const G=H.conversionsTo;if(G.length===0)throw new Error("There are no conversions to "+k+" defined.");for(let ie=0;ie<G.length;ie++)if(u(G[ie].from).test(O))return G[ie].convert(O);throw new Error("Cannot convert "+O+" to "+k)}function S(O){let k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:",";return O.map(H=>H.name).join(k)}function p(O){const k=O.indexOf("...")===0,G=(k?O.length>3?O.slice(3):"any":O).split("|").map(oe=>u(oe.trim()));let ie=!1,J=k?"...":"";return{types:G.map(function(oe){return ie=oe.isAny||ie,J+=oe.name+"|",{name:oe.name,typeIndex:oe.index,test:oe.test,isAny:oe.isAny,conversion:null,conversionIndex:-1}}),name:J.slice(0,-1),hasAny:ie,hasConversion:!1,restParam:k}}function g(O){const k=O.types.map(he=>he.name),H=U(k);let G=O.hasAny,ie=O.name;const J=H.map(function(he){const oe=u(he.from);return G=oe.isAny||G,ie+="|"+he.from,{name:he.from,typeIndex:oe.index,test:oe.test,isAny:oe.isAny,conversion:he,conversionIndex:he.index}});return{types:O.types.concat(J),name:ie,hasAny:G,hasConversion:J.length>0,restParam:O.restParam}}function y(O){return O.typeSet||(O.typeSet=new Set,O.types.forEach(k=>O.typeSet.add(k.name))),O.typeSet}function D(O){const k=[];if(typeof O!="string")throw new TypeError("Signatures must be strings");const H=O.trim();if(H==="")return k;const G=H.split(",");for(let ie=0;ie<G.length;++ie){const J=p(G[ie].trim());if(J.restParam&&ie!==G.length-1)throw new SyntaxError('Unexpected rest parameter "'+G[ie]+'": only allowed for the last parameter');if(J.types.length===0)return null;k.push(J)}return k}function w(O){const k=W(O);return k?k.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 k=u(O.types[0].name).test,H=u(O.types[1].name).test;return function(ie){return k(ie)||H(ie)}}else{const k=O.types.map(function(H){return u(H.name).test});return function(G){for(let ie=0;ie<k.length;ie++)if(k[ie](G))return!0;return!1}}}function E(O){let k,H,G;if(w(O)){k=te(O).map(b);const ie=k.length,J=b(W(O)),he=function(oe){for(let de=ie;de<oe.length;de++)if(!J(oe[de]))return!1;return!0};return function(de){for(let ue=0;ue<k.length;ue++)if(!k[ue](de[ue]))return!1;return he(de)&&de.length>=ie+1}}else return O.length===0?function(J){return J.length===0}:O.length===1?(H=b(O[0]),function(J){return H(J[0])&&J.length===1}):O.length===2?(H=b(O[0]),G=b(O[1]),function(J){return H(J[0])&&G(J[1])&&J.length===2}):(k=O.map(b),function(J){for(let he=0;he<k.length;he++)if(!k[he](J[he]))return!1;return J.length===k.length})}function A(O,k){return k<O.length?O[k]:w(O)?W(O):null}function C(O,k){const H=A(O,k);return H?y(H):new Set}function T(O){return O.conversion===null||O.conversion===void 0}function B(O,k){const H=new Set;return O.forEach(G=>{const ie=C(G.params,k);let J;for(J of ie)H.add(J)}),H.has("any")?["any"]:Array.from(H)}function x(O,k,H){let G,ie;const J=O||"unnamed";let he=H,oe;for(oe=0;oe<k.length;oe++){const ot=[];if(he.forEach(Ft=>{const Dn=A(Ft.params,oe),un=b(Dn);(oe<Ft.params.length||w(Ft.params))&&un(k[oe])&&ot.push(Ft)}),ot.length===0){if(ie=B(he,oe),ie.length>0){const Ft=f(k[oe]);return G=new TypeError("Unexpected type of argument in function "+J+" (expected: "+ie.join(" or ")+", actual: "+Ft.join(" | ")+", index: "+oe+")"),G.data={category:"wrongType",fn:J,index:oe,actual:Ft,expected:ie},G}}else he=ot}const de=he.map(function(ot){return w(ot.params)?1/0:ot.params.length});if(k.length<Math.min.apply(null,de))return ie=B(he,oe),G=new TypeError("Too few arguments in function "+J+" (expected: "+ie.join(" or ")+", index: "+k.length+")"),G.data={category:"tooFewArgs",fn:J,index:k.length,expected:ie},G;const ue=Math.max.apply(null,de);if(k.length>ue)return G=new TypeError("Too many arguments in function "+J+" (expected: "+ue+", actual: "+k.length+")"),G.data={category:"tooManyArgs",fn:J,index:k.length,expectedLength:ue},G;const We=[];for(let ot=0;ot<k.length;++ot)We.push(f(k[ot]).join("|"));return G=new TypeError('Arguments of type "'+We.join(", ")+'" do not match any of the defined signatures of function '+J+"."),G.data={category:"mismatch",actual:We},G}function R(O){let k=i.length+1;for(let H=0;H<O.types.length;H++)T(O.types[H])&&(k=Math.min(k,O.types[H].typeIndex));return k}function F(O){let k=a+1;for(let H=0;H<O.types.length;H++)T(O.types[H])||(k=Math.min(k,O.types[H].conversionIndex));return k}function z(O,k){if(O.hasAny){if(!k.hasAny)return 1}else if(k.hasAny)return-1;if(O.restParam){if(!k.restParam)return 1}else if(k.restParam)return-1;if(O.hasConversion){if(!k.hasConversion)return 1}else if(k.hasConversion)return-1;const H=R(O)-R(k);if(H<0)return-1;if(H>0)return 1;const G=F(O)-F(k);return G<0?-1:G>0?1:0}function N(O,k){const H=O.params,G=k.params,ie=W(H),J=W(G),he=w(H),oe=w(G);if(he&&ie.hasAny){if(!oe||!J.hasAny)return 1}else if(oe&&J.hasAny)return-1;let de=0,ue=0,We;for(We of H)We.hasAny&&++de,We.hasConversion&&++ue;let ot=0,Ft=0;for(We of G)We.hasAny&&++ot,We.hasConversion&&++Ft;if(de!==ot)return de-ot;if(he&&ie.hasConversion){if(!oe||!J.hasConversion)return 1}else if(oe&&J.hasConversion)return-1;if(ue!==Ft)return ue-Ft;if(he){if(!oe)return 1}else if(oe)return-1;const Dn=(H.length-G.length)*(he?-1:1);if(Dn!==0)return Dn;const un=[];let lr=0;for(let Uo=0;Uo<H.length;++Uo){const Nf=z(H[Uo],G[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 k=O.map(u);O.length>1&&k.sort((ie,J)=>ie.index-J.index);let H=k[0].conversionsTo;if(O.length===1)return H;H=H.concat([]);const G=new Set(O);for(let ie=1;ie<k.length;++ie){let J;for(J of k[ie].conversionsTo)G.has(J.from)||(H.push(J),G.add(J.from))}return H}function I(O,k){let H=k;if(O.some(ie=>ie.hasConversion)){const ie=w(O),J=O.map(L);H=function(){const oe=[],de=ie?arguments.length-1:arguments.length;for(let ue=0;ue<de;ue++)oe[ue]=J[ue](arguments[ue]);return ie&&(oe[de]=arguments[de].map(J[de])),k.apply(this,oe)}}let G=H;if(w(O)){const ie=O.length-1;G=function(){return H.apply(this,ne(arguments,0,ie).concat([ne(arguments,ie)]))}}return G}function L(O){let k,H,G,ie;const J=[],he=[];switch(O.types.forEach(function(oe){oe.conversion&&(J.push(u(oe.conversion.from).test),he.push(oe.conversion.convert))}),he.length){case 0:return function(de){return de};case 1:return k=J[0],G=he[0],function(de){return k(de)?G(de):de};case 2:return k=J[0],H=J[1],G=he[0],ie=he[1],function(de){return k(de)?G(de):H(de)?ie(de):de};default:return function(de){for(let ue=0;ue<he.length;ue++)if(J[ue](de))return he[ue](de);return de}}}function X(O){function k(H,G,ie){if(G<H.length){const J=H[G];let he=[];if(J.restParam){const oe=J.types.filter(T);oe.length<J.types.length&&he.push({types:oe,name:"..."+oe.map(de=>de.name).join("|"),hasAny:oe.some(de=>de.isAny),hasConversion:!1,restParam:!0}),he.push(J)}else he=J.types.map(function(oe){return{types:[oe],name:oe.name,hasAny:oe.isAny,hasConversion:oe.conversion,restParam:!1}});return ee(he,function(oe){return k(H,G+1,ie.concat([oe]))})}else return[ie]}return k(O,0,[])}function Z(O,k){const H=Math.max(O.length,k.length);for(let oe=0;oe<H;oe++){const de=C(O,oe),ue=C(k,oe);let We=!1,ot;for(ot of ue)if(de.has(ot)){We=!0;break}if(!We)return!1}const G=O.length,ie=k.length,J=w(O),he=w(k);return J?he?G===ie:ie>=G:he?G>=ie:G===ie}function P(O){return O.map(k=>xe(k)?De(k.referToSelf.callback):be(k)?se(k.referTo.references,k.referTo.callback):k)}function j(O,k,H){const G=[];let ie;for(ie of O){let J=H[ie];if(typeof J!="number")throw new TypeError('No definition for referenced signature "'+ie+'"');if(J=k[J],typeof J!="function")return!1;G.push(J)}return G}function Y(O,k,H){const G=P(O),ie=new Array(G.length).fill(!1);let J=!0;for(;J;){J=!1;let he=!0;for(let oe=0;oe<G.length;++oe){if(ie[oe])continue;const de=G[oe];if(xe(de))G[oe]=de.referToSelf.callback(H),G[oe].referToSelf=de.referToSelf,ie[oe]=!0,he=!1;else if(be(de)){const ue=j(de.referTo.references,G,k);ue?(G[oe]=de.referTo.callback.apply(this,ue),G[oe].referTo=de.referTo,ie[oe]=!0,he=!1):J=!0}}if(he&&J)throw new SyntaxError("Circular reference detected in resolving typed.referTo")}return G}function $(O){const k=/\bthis(\(|\.signatures\b)/;Object.keys(O).forEach(H=>{const G=O[H];if(k.test(G.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,k){if(o.createCount++,Object.keys(k).length===0)throw new SyntaxError("No signatures provided");o.warnAgainstDeprecatedThis&&$(k);const H=[],G=[],ie={},J=[];let he;for(he in k){if(!Object.prototype.hasOwnProperty.call(k,he))continue;const Ze=D(he);if(!Ze)continue;H.forEach(function(gl){if(Z(gl,Ze))throw new TypeError('Conflicting signatures "'+S(gl)+'" and "'+S(Ze)+'".')}),H.push(Ze);const Sn=G.length;G.push(k[he]);const kR=Ze.map(g);let Rf;for(Rf of X(kR)){const gl=S(Rf);J.push({params:Rf,name:gl,fn:Sn}),Rf.every(LR=>!LR.hasConversion)&&(ie[gl]=Sn)}}J.sort(N);const oe=Y(G,ie,pl);let de;for(de in ie)Object.prototype.hasOwnProperty.call(ie,de)&&(ie[de]=oe[ie[de]]);const ue=[],We=new Map;for(de of J)We.has(de.name)||(de.fn=oe[de.fn],ue.push(de),We.set(de.name,de));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,fR=Ft?b(ue[1].params[0]):Xn,dR=Dn?b(ue[2].params[0]):Xn,hR=un?b(ue[3].params[0]):Xn,mR=lr?b(ue[4].params[0]):Xn,pR=sr?b(ue[5].params[0]):Xn,gR=ot?b(ue[0].params[1]):Xn,vR=Ft?b(ue[1].params[1]):Xn,yR=Dn?b(ue[2].params[1]):Xn,bR=un?b(ue[3].params[1]):Xn,DR=lr?b(ue[4].params[1]):Xn,SR=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 xR=ot?ue[0].implementation:uo,wR=Ft?ue[1].implementation:uo,ER=Dn?ue[2].implementation:uo,AR=un?ue[3].implementation:uo,CR=lr?ue[4].implementation:uo,TR=sr?ue[5].implementation:uo,MR=ot?ue[0].params.length:-1,_R=Ft?ue[1].params.length:-1,BR=Dn?ue[2].params.length:-1,FR=un?ue[3].params.length:-1,NR=lr?ue[4].params.length:-1,RR=sr?ue[5].params.length:-1,OR=Uo?6:0,zR=ue.length,UR=ue.map(Ze=>Ze.test),IR=ue.map(Ze=>Ze.implementation),$R=function(){for(let Sn=OR;Sn<zR;Sn++)if(UR[Sn](arguments))return IR[Sn].apply(this,arguments);return o.onMismatch(O,arguments,ue)};function pl(Ze,Sn){return arguments.length===MR&&Nf(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):arguments.length===NR&&mR(Ze)&&DR(Sn)?CR.apply(this,arguments):arguments.length===RR&&pR(Ze)&&SR(Sn)?TR.apply(this,arguments):$R.apply(this,arguments)}try{Object.defineProperty(pl,"name",{value:O})}catch{}return pl.signatures=ie,pl._typedFunctionData={signatures:ue,signatureMap:We},pl}function V(O,k,H){throw x(O,k,H)}function te(O){return ne(O,0,O.length-1)}function W(O){return O[O.length-1]}function ne(O,k,H){return Array.prototype.slice.call(O,k,H)}function fe(O,k){for(let H=0;H<O.length;H++)if(k(O[H]))return O[H]}function ee(O,k){return Array.prototype.concat.apply([],O.map(k))}function le(){const O=te(arguments).map(H=>S(D(H))),k=W(arguments);if(typeof k!="function")throw new TypeError("Callback function expected as last argument");return se(O,k)}function se(O,k){return{referTo:{references:O,callback:k}}}function De(O){if(typeof O!="function")throw new TypeError("Callback function expected as first argument");return{referToSelf:{callback:O}}}function be(O){return O&&typeof O.referTo=="object"&&Array.isArray(O.referTo.references)&&typeof O.referTo.callback=="function"}function xe(O){return O&&typeof O.referToSelf=="object"&&typeof O.referToSelf.callback=="function"}function we(O,k){if(!O)return k;if(k&&k!==O){const H=new Error("Function names do not match (expected: "+O+", actual: "+k+")");throw H.data={actual:k,expected:O},H}return O}function Re(O){let k;for(const H in O)Object.prototype.hasOwnProperty.call(O,H)&&(d(O[H])||typeof O[H].signature=="string")&&(k=we(k,O[H].name));return k}function Ce(O,k){let H;for(H in k)if(Object.prototype.hasOwnProperty.call(k,H)){if(H in O&&k[H]!==O[H]){const G=new Error('Signature "'+H+'" is defined twice');throw G.data={signature:H,sourceFunction:k[H],destFunction:O[H]},G}O[H]=k[H]}}const Be=o;o=function(O){const k=typeof O=="string",H=k?1:0;let G=k?O:"";const ie={};for(let J=H;J<arguments.length;++J){const he=arguments[J];let oe={},de;if(typeof he=="function"?(de=he.name,typeof he.signature=="string"?oe[he.signature]=he:d(he)&&(oe=he.signatures)):e(he)&&(oe=he,k||(de=Re(he))),Object.keys(oe).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:he},ue}k||(G=we(G,de)),Ce(ie,oe)}return q(G||"",ie)},o.create=zy,o.createCount=Be.createCount,o.onMismatch=V,o.throwMismatchError=V,o.createError=x,o.clear=s,o.clearConversions=c,o.addTypes=l,o._findType=u,o.referTo=le,o.referToSelf=De,o.convert=m,o.findSignature=h,o.find=v,o.isTypedFunction=d,o.warnAgainstDeprecatedThis=!0,o.addType=function(O,k){let H="any";k!==!1&&r.has("Object")&&(H="Object"),o.addTypes([O],H)};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 k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{override:!1};pe(O);const H=u(O.to),G=H.conversionsTo.find(ie=>ie.from===O.from);if(G)if(k&&k.override)o.removeConversion({from:G.from,to:O.to,convert:G.convert});else throw new Error('There is already a conversion from "'+O.from+'" to "'+H.name+'"');H.conversionsTo.push({from:O.from,convert:O.convert,index:a++})},o.addConversions=function(O,k){O.forEach(H=>o.addConversion(H,k))},o.removeConversion=function(O){pe(O);const k=u(O.to),H=fe(k.conversionsTo,ie=>ie.from===O.from);if(!H)throw new Error("Attempt to remove nonexistent conversion from "+O.from+" to "+O.to);if(H.convert!==O.convert)throw new Error("Conversion to remove does not match existing conversion");const G=k.conversionsTo.indexOf(H);k.conversionsTo.splice(G,1)},o.resolve=function(O,k){if(!d(O))throw new TypeError(Oy);const H=O._typedFunctionData.signatures;for(let G=0;G<H.length;++G)if(H[G].test(k))return H[G];return null},o}const Vs=zy();function ce(e,t,n,r){function i(a){var o=AC(a,t.map(BC));return MC(e,t,a),n(o)}return i.isFactory=!0,i.fn=e,i.dependencies=t.slice().sort(),r&&(i.meta=r),i}function MC(e,t,n){var r=t.filter(a=>!_C(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 _C(e){return e&&e[0]==="?"}function BC(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 FC(e,t){if(t.number==="bigint")try{BigInt(e)}catch{return t.numberFallback}return t.number}var NC=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 OC(e,r);case"exponential":return Iy(e,r);case"engineering":return RC(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 zC(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 RC(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 OC(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 zC(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 UC(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},IC=["?BigNumber","?Complex","?DenseMatrix","?Fraction"],$C=ce("typed",IC,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:KA},{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:wC},{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:WA},{name:"ResultSet",test:JA},{name:"Help",test:eC},{name:"function",test:tC},{name:"Date",test:nC},{name:"RegExp",test:rC},{name:"null",test:aC},{name:"undefined",test:oC},{name:"AccessorNode",test:uC},{name:"ArrayNode",test:lC},{name:"AssignmentNode",test:sC},{name:"BlockNode",test:cC},{name:"ConditionalNode",test:fC},{name:"ConstantNode",test:dC},{name:"FunctionNode",test:mC},{name:"FunctionAssignmentNode",test:hC},{name:"IndexNode",test:pC},{name:"Node",test:gC},{name:"ObjectNode",test:vC},{name:"OperatorNode",test:yC},{name:"ParenthesisNode",test:bC},{name:"RangeNode",test:DC},{name:"RelationalNode",test:SC},{name:"SymbolNode",test:xC},{name:"Map",test:iC},{name:"Object",test:yh}]),o.addConversions([{from:"number",to:"BigNumber",convert:function(l){if(n||Xs(l),UC(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||kC(),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 kC(){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."))}/*!
58
58
  * decimal.js v10.6.0
59
59
  * An arbitrary-precision Decimal type for JavaScript.
60
60
  * https://github.com/MikeMcl/decimal.js
61
61
  * Copyright (c) 2025 Michael Mclaughlin <M8ch88l@gmail.com>
62
62
  * MIT Licence
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
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,LC=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,jC=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,HC=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Vy=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,or=1e7,Se=7,PC=9007199254740991,qC=Ks.length-1,wh=Ws.length-1,ae={toStringTag:qy};ae.absoluteValue=ae.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),ye(e)},ae.ceil=function(){return ye(new this.constructor(this),this.e+1,2)},ae.clampedTo=ae.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)},ae.comparedTo=ae.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},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())+Se,r.rounding=1,n=VC(r,Ky(r,n)),r.precision=e,r.rounding=t,ye(Gr==2||Gr==3?n.neg():n,e,t,!0)):new r(1):new r(NaN)},ae.cubeRoot=ae.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&&(ye(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")&&(ye(r,e+1,1),t=!r.times(r).times(r).eq(c));break}return Ae=!0,ye(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-Jt(this.e/Se))*Se,e=t[e],e)for(;e%10==0;e/=10)n--;n<0&&(n=0)}return n},ae.dividedBy=ae.div=function(e){return tt(this,new this.constructor(e))},ae.dividedToIntegerBy=ae.divToInt=function(e){var t=this,n=t.constructor;return ye(tt(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 ye(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,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 ye(a,o.precision=n,o.rounding=r,!0)},ae.hyperbolicSine=ae.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,ye(i,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,tt(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,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))},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,Ae=!1,n=n.times(n).minus(1).sqrt().plus(n),Ae=!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,Ae=!1,n=n.times(n).plus(1).sqrt().plus(n),Ae=!0,r.precision=e,r.rounding=t,n.ln())},ae.inverseHyperbolicTangent=ae.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?ye(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)},ae.inverseSine=ae.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)))},ae.inverseTangent=ae.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/Se+2|0),e=n;e;--e)s=s.div(s.times(s).plus(1).sqrt().plus(1));for(Ae=!1,t=Math.ceil(u/Se),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,ye(o,c.precision=f,c.rounding=d,!0)},ae.isFinite=function(){return!!this.d},ae.isInteger=ae.isInt=function(){return!!this.d&&Jt(this.e/Se)>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,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=ye(l,f+1,0));break}while(Hu(l.d,i+=10,d));return Ae=!0,ye(l,f,d)},ae.minus=ae.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?ye(e,u,l):e}if(n=Jt(e.e/Se),c=Jt(h.e/Se),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/Se),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?ye(e,u,l):e):new v(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]?ye(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))},ae.naturalExponential=ae.exp=function(){return Eh(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,ye(e)},ae.plus=ae.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?ye(e,u,l):e;if(a=Jt(f.e/Se),r=Jt(e.e/Se),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/Se),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?ye(e,u,l):e},ae.precision=ae.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},ae.round=function(){var e=this,t=e.constructor;return ye(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())+Se,r.rounding=1,n=YC(r,Ky(r,n)),r.precision=e,r.rounding=t,ye(Gr>2?n.neg():n,e,t,!0)):new r(NaN)},ae.squareRoot=ae.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&&(ye(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")&&(ye(r,l+1,1),e=!r.times(r).eq(o));break}return Ae=!0,ye(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=tt(n,new r(1).minus(n.times(n)).sqrt(),e+10,0),r.precision=e,r.rounding=t,ye(Gr==2||Gr==4?n.neg():n,e,t,!0)):new r(NaN)},ae.times=ae.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/Se)+Jt(e.e/Se),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?ye(e,f.precision,f.rounding):e},ae.toBinary=function(e,t){return Ah(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:(hn(e,0,Mi),t===void 0?t=r.rounding:hn(t,0,8),ye(n,e+n.e+1,t))},ae.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=ye(new i(r),e+1,t),n=br(r,!0,e+1)),r.isNeg()&&!r.isZero()?"-"+n:n},ae.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=ye(new a(i),e+i.e+1,t),n=br(r,!1,e+r.e+1)),i.isNeg()&&!i.isZero()?"-"+n:n},ae.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%Se,t.d[0]=Ut(10,o<0?Se+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*Se*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},ae.toHexadecimal=ae.toHex=function(e,t){return Ah(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: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,ye(n)):(e.s=n.s,n=e),n},ae.toNumber=function(){return+this},ae.toOctal=function(e,t){return Ah(this,8,e,t)},ae.toPower=ae.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 ye(u,r,a);if(t=Jt(e.e/Se),t>=e.d.length-1&&(n=s<0?-s:s)<=PC)return i=Yy(l,u,n,r),e.s<0?new l(1).div(i):ye(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=ye(i,r+5,1),Hu(i.d,r,a)&&(t=r+10,i=ye(Eh(e.times(Fi(u,t+n)),t),t+5,1),+Xt(i.d).slice(r+1,r+15)+1==1e14&&(i=ye(i,r+1,0)))),i.s=o,Ae=!0,l.rounding=a,ye(i,r,a))},ae.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=ye(new i(r),e,t),n=br(r,e<=r.e||r.e<=i.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):(hn(e,1,Mi),t===void 0?t=r.rounding:hn(t,0,8)),ye(new r(n),e,t)},ae.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},ae.truncated=ae.trunc=function(){return ye(new this.constructor(this),this.e+1,1)},ae.valueOf=ae.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=Se-r.length,n&&(a+=Bi(n)),a+=r;o=e[t],r=o+"",n=Se-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+=Se,i=0):(i=Math.ceil((t+1)/Se),t%=Se),a=Ut(10,Se-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 VC(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,S,p,g,y,D,w,b,E,A,C,T,B,x,R=r.constructor,F=r.s==i.s?1:-1,z=r.d,N=i.d;if(!z||!z[0]||!N||!N[0])return new R(!r.s||!i.s||(z?N&&z[0]==N[0]:!N)?NaN:z&&z[0]==0||!N?F*0:F/0);for(l?(h=1,c=r.e-i.e):(l=or,h=Se,c=Jt(r.e/h)-Jt(i.e/h)),B=N.length,C=z.length,p=new R(F),g=p.d=[],f=0;N[f]==(z[f]||0);f++);if(N[f]>(z[f]||0)&&c--,a==null?(b=a=R.precision,o=R.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,B==1){for(d=0,N=N[0],b++;(f<C||d)&&b--;f++)E=d*l+(z[f]||0),g[f]=E/N|0,d=E%N|0;v=d||f<C}else{for(d=l/(N[0]+1)|0,d>1&&(N=e(N,d,l),z=e(z,d,l),B=N.length,C=z.length),A=B,y=z.slice(0,B),D=y.length;D<B;)y[D++]=0;x=N.slice(),x.unshift(0),T=N[0],N[1]>=l/2&&++T;do d=0,s=t(N,y,B,D),s<0?(w=y[0],B!=D&&(w=w*l+(y[1]||0)),d=w/T|0,d>1?(d>=l&&(d=l-1),m=e(N,d,l),S=m.length,D=y.length,s=t(m,y,S,D),s==1&&(d--,n(m,B<S?x:N,S,l))):(d==0&&(s=d=1),m=N.slice()),S=m.length,S<D&&m.unshift(0),n(y,m,D,l),s==-1&&(D=y.length,s=t(N,y,B,D),s<1&&(d++,n(y,B<D?x:N,D,l))),D=y.length):s===0&&(d++,y=[0]),g[f++]=d,s&&y[0]?y[D++]=z[A]||0:(y=[z[A]],D=1);while((A++<C||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,ye(p,u?a+p.e+1:a,o,v)}return p}}();function ye(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+=Se,o=t,c=f[d=0],l=c/Ut(10,i-o-1)%10|0;else if(d=Math.ceil((a+1)/Se),u=f.length,d>=u)if(r){for(;u++<=d;)f.push(0);c=l=0,i=1,a%=Se,o=a-Se+1}else break e;else{for(c=u=f[d],i=1;u>=10;u/=10)i++;a%=Se,o=a-Se+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,(Se-t%Se)%Se),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,Se-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*=Se;n>=10;n/=10)t++;return t}function nc(e,t,n){if(t>qC)throw Ae=!0,n&&(e.precision=n),Error(Hy);return ye(new e(Ks),t,1,!0)}function Dr(e,t,n){if(t>wh)throw Error(Hy);return ye(new e(Ws),t,n,!0)}function Gy(e){var t=e.length-1,n=t*Se+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/Se+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=ye(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=ye(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 ye(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,S=m.d,p=m.constructor,g=p.rounding,y=p.precision;if(m.s<0||!S||!S[0]||!m.e&&S[0]==1&&S.length==1)return new p(S&&!S[0]?-1/0:m.s!=1?NaN:S?0:m);if(t==null?(Ae=!1,c=y):c=t,p.precision=c+=v,n=Xt(S),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?ye(m,y,g,Ae=!0):m;for(f=m,l=o=m=tt(m.minus(1),m.plus(1),c,1),d=ye(m.times(m),c,1),i=3;;){if(o=ye(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=ye(m.times(m),c,1),i=u=1;else return ye(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)%Se,n<0&&(r+=Se),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=Se;r<i;)e.d.push(+t.slice(r,r+=Se));t=t.slice(r),r=Se-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 GC(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(jC.test(t))n=16,t=t.toLowerCase();else if(LC.test(t))n=2;else if(HC.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 YC(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/Se);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 XC(e){return new this(e).abs()}function ZC(e){return new this(e).acos()}function QC(e){return new this(e).acosh()}function KC(e,t){return new this(e).plus(t)}function WC(e){return new this(e).asin()}function JC(e){return new this(e).asinh()}function e3(e){return new this(e).atan()}function t3(e){return new this(e).atanh()}function n3(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 r3(e){return new this(e).cbrt()}function i3(e){return ye(e=new this(e),e.e+1,2)}function a3(e,t,n){return new this(e).clamp(t,n)}function o3(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 u3(e){return new this(e).cos()}function l3(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):GC(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=ae,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=o3,i.clone=Jy,i.isDecimal=eb,i.abs=XC,i.acos=ZC,i.acosh=QC,i.add=KC,i.asin=WC,i.asinh=JC,i.atan=e3,i.atanh=t3,i.atan2=n3,i.cbrt=r3,i.ceil=i3,i.clamp=a3,i.cos=u3,i.cosh=l3,i.div=s3,i.exp=c3,i.floor=f3,i.hypot=d3,i.ln=h3,i.log=m3,i.log10=g3,i.log2=p3,i.max=v3,i.min=y3,i.mod=b3,i.mul=D3,i.pow=S3,i.random=x3,i.round=w3,i.sign=E3,i.sin=A3,i.sinh=C3,i.sqrt=T3,i.sub=M3,i.sum=_3,i.tan=B3,i.tanh=F3,i.trunc=N3,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 s3(e,t){return new this(e).div(t)}function c3(e){return new this(e).exp()}function f3(e){return ye(e=new this(e),e.e+1,3)}function d3(){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 h3(e){return new this(e).ln()}function m3(e,t){return new this(e).log(t)}function p3(e){return new this(e).log(2)}function g3(e){return new this(e).log(10)}function v3(){return Zy(this,arguments,-1)}function y3(){return Zy(this,arguments,1)}function b3(e,t){return new this(e).mod(t)}function D3(e,t){return new this(e).mul(t)}function S3(e,t){return new this(e).pow(t)}function x3(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/Se),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%=Se,r&&e&&(i=Ut(10,Se-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-=Se)u.shift();for(r=1,i=u[0];i>=10;i/=10)r++;r<Se&&(n-=Se-r)}return o.e=n,o.d=u,o}function w3(e){return ye(e=new this(e),e.e+1,this.rounding)}function E3(e){return e=new this(e),e.d?e.d[0]?e.s:0*e.s:e.s||NaN}function A3(e){return new this(e).sin()}function C3(e){return new this(e).sinh()}function T3(e){return new this(e).sqrt()}function M3(e,t){return new this(e).sub(t)}function _3(){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,ye(n,this.precision,this.rounding)}function B3(e){return new this(e).tan()}function F3(e){return new this(e).tanh()}function N3(e){return ye(e=new this(e),e.e+1,1)}ae[Symbol.for("nodejs.util.inspect.custom")]=ae.toString,ae[Symbol.toStringTag]="Decimal";var fo=ae.constructor=Jy(xh);Ks=new fo(Ks),Ws=new fo(Ws);var R3="BigNumber",O3=["?on","config"],z3=ce(R3,O3,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},U3=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 I3={re:0,im:0},ra=function(e,t){const n=I3;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)+U3(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 $3="Complex",k3=[],L3=ce($3,k3,()=>(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 j3=2e3,me={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 H3=[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+=H3[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();me.s=i<ge?-Me:Me,me.n=n<ge?-n:n,me.d=r<ge?-r:r};function P3(e,t,n){let r=Me;for(;t>ge;e=e*e%n,t>>=Me)t&Me&&(r=r*e%n);return r}function q3(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>j3)return ge;return BigInt(r)}function V3(e,t,n){let r=Me,i=P3(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(me.d,me.n),this.s=me.s,this.n=me.n/e,this.d=me.d/e;else return mt(me.s*me.n,me.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*me.d+me.s*this.d*me.n,this.d*me.d)},sub:function(e,t){return Ht(e,t),mt(this.s*this.n*me.d-me.s*this.d*me.n,this.d*me.d)},mul:function(e,t){return Ht(e,t),mt(this.s*me.s*this.n*me.n,this.d*me.d)},div:function(e,t){return Ht(e,t),mt(this.s*me.s*this.n*me.d,this.d*me.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===me.n*this.d)throw Mh();return mt(this.s*(me.d*this.n)%(me.n*this.d),me.d*this.d)},gcd:function(e,t){return Ht(e,t),mt(ia(me.n,this.n)*ia(me.d,this.d),me.d*this.d)},lcm:function(e,t){return Ht(e,t),me.n===ge&&this.n===ge?mt(ge,Me):mt(me.n*this.n,ia(me.n,this.n)*ia(me.d,this.d))},inverse:function(){return mt(this.s*this.d,this.n)},pow:function(e,t){if(Ht(e,t),me.d===Me)return me.s<ge?mt((this.s*this.d)**me.n,this.n**me.n):mt((this.s*this.n)**me.n,this.d**me.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]*=me.n,n[o]%me.d===ge)n[o]/=me.d;else return null;i*=BigInt(o)**n[o]}for(let o in r)if(o!=="1"){if(r[o]*=me.n,r[o]%me.d===ge)r[o]/=me.d;else return null;a*=BigInt(o)**r[o]}return me.s<ge?mt(a,i):mt(i,a)},log:function(e,t){if(Ht(e,t),this.s<=ge||me.s<=ge)return null;const n=Object.create(null),r=po(me.n),i=po(me.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*me.d===me.s*me.n*this.d},lt:function(e,t){return Ht(e,t),this.s*this.n*me.d<me.s*me.n*this.d},lte:function(e,t){return Ht(e,t),this.s*this.n*me.d<=me.s*me.n*this.d},gt:function(e,t){return Ht(e,t),this.s*this.n*me.d>me.s*me.n*this.d},gte:function(e,t){return Ht(e,t),this.s*this.n*me.d>=me.s*me.n*this.d},compare:function(e,t){Ht(e,t);let n=this.s*this.n*me.d-me.s*me.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*me.d,r=this.d*me.n,i=n%r;let a=ur(n/r);return i+i>=r&&a++,mt(this.s*a*me.n,me.d)},divisible:function(e,t){return Ht(e,t),me.n===ge?!1:this.n*me.d%(me.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=q3(t,n),i=V3(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 G3="Fraction",Y3=[],X3=ce(G3,Y3,()=>(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}),Z3="Matrix",Q3=[],K3=ce(Z3,Q3,()=>{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 W3(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 eT(e,r);case"exponential":return nb(e,r);case"engineering":return J3(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 J3(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 eT(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=tT(e,t);return t&&typeof t=="object"&&"truncate"in t&&n.length>t.truncate?n.substring(0,t.truncate-3)+"...":n}function tT(e,t){if(typeof e=="number")return Dh(e,t);if(vt(e))return W3(e,t);if(nT(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 nT(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 rT(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 rT(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=oT(e);n.length<i&&(o=Fh(o,a),n=st(o));for(var u=0;u<i;u++)n[u]<r[u]&&(o=iT(o,r[u],u),n=st(o));return o}function iT(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 aT(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 oT(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=sT(e,o,a,t)}var u;if(t.isMatrix&&t.dataType!=="mixed"&&t.dataType!==void 0){var l=uT(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:lT(e),fn:e}:{isUnary:r,fn:e}}function uT(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 lT(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 sT(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){cT(i,t,n,r)}}function cT(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 fT="DenseMatrix",dT=["Matrix"],hT=ce(fT,dT,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,S=c.map(function(g){return g+1});l(this,S,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(),S=0,p=c._size.length;S<p;S++)yt(v[S],c._size[S]),yt(m[S],c._size[S]);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 S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,p=f.dimension(S);return h[S]=p.size()[0],S<d?p.map(g=>(yt(g,m.length),v(m[g],S+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(),S;if(Pe(d)?(S=d.size(),d=d.valueOf()):S=st(d),m){if(S.length!==0)throw new TypeError("Scalar expected");c.set(f.min(),d,h)}else{if(!Ti(S,v))try{S.length===0?d=Oh([d],v):d=Oh(d,v),S=st(d)}catch{}if(v.length<c._size.length)throw new Le(v.length,c._size.length,"<");if(S.length<v.length){for(var p=0,g=0;v[p]===1&&S[p]===1;)p++;for(;v[p]===1;)g++,p++;d=cb(d,v.length,g,S)}if(!Ti(v,S))throw new Le(v,S,">");var y=f.max().map(function(D){return D+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,S){var p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,g=f.dimension(p);p<h?g.forEach((y,D)=>{yt(y,m.length),v(m[y],S[D[0]],p+1)}):g.forEach((y,D)=>{yt(y,m.length),m[y]=S[D[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,S=f.length;m<S;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,S=d.create(void 0,d._datatype);if(S._size=d._size,f||v.isUnary)return S._data=b(d._data),S;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 S._data=g,S}var D=[];return S._data=w(d._data),S;function w(E){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,C=Array(E.length);if(A<h)for(var T=0;T<E.length;T++)D[A]=T,C[T]=w(E[T],A+1);else for(var B=0;B<E.length;B++)D[A]=B,C[B]=m(E[B],D.slice(),d);return C}function b(E){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,C=Array(E.length);if(A<h)for(var T=0;T<E.length;T++)C[T]=b(E[T],A+1);else for(var B=0;B<E.length;B++)C[B]=m(E[B]);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 v=uc(c,d,"map",f),m=v.fn;if(f||v.isUnary){y(d._data);return}if(h===0){for(var S=0;S<d._data.length;S++)m(d._data[S],[S],d);return}var p=[];g(d._data);function g(D){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(w<h)for(var b=0;b<D.length;b++)p[w]=b,g(D[b],w+1);else for(var E=0;E<D.length;E++)p[w]=E,m(D[E],p.slice(),d)}function y(D){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(w<h)for(var b=0;b<D.length;b++)y(D[b],w+1);else for(var E=0;E<D.length;E++)m(D[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,S=0;S<c;S++)m=m[d[S]];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),S=[],p=0;p<m;p++)S[p]=this._data[p+d][p+f];return new n({data:S,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,S=c[0],p=c[1],g=Math.min(S-m,p-v),y;if(ht(f)){if(f.length!==g)throw new Error("Invalid value array length");y=function(A){return f[A]}}else if(Pe(f)){var D=f.size();if(D.length!==1||D[0]!==g)throw new Error("Invalid matrix length");y=function(A){return f.get([A])}}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:[S,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 mT(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):aT(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=mT(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",pT=["typed"],gT=ce(xb,pT,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 NC(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",vT=["typed","config"],yT=ce(Nb,vT,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",bT=["typed","equalScalar"],DT=ce(Rb,bT,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",ST=["typed"],xT=ce(Ob,ST,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 wT(e,t,n,r){return Vr(e.re,t.re,n,r)&&Vr(e.im,t.im,n,r)}var qu=ce("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",ET=["typed","config"],AT=ce(cc,ET,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 wT(a,o,n.relTol,n.absTol)}},r)});ce(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 CT="SparseMatrix",TT=["typed","equalScalar","Matrix"],MT=ce(CT,TT,e=>{var{typed:t,equalScalar:n,Matrix:r}=e;function i(m,S){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");if(S&&!ar(S))throw new Error("Invalid datatype: "+S);if(Pe(m))a(this,m,S);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=S||m.datatype;else if(ht(m))o(this,m,S);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=S}}function a(m,S,p){S.type==="SparseMatrix"?(m._values=S._values?Ie(S._values):void 0,m._index=Ie(S._index),m._ptr=Ie(S._ptr),m._size=Ie(S._size),m._datatype=p||S._datatype):o(m,S.valueOf(),p||S._datatype)}function o(m,S,p){m._values=[],m._index=[],m._ptr=[],m._datatype=p;var g=S.length,y=0,D=n,w=0;if(ar(p)&&(D=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 A=S[E];if(ht(A)){if(b===0&&y<A.length&&(y=A.length),b<A.length){var C=A[b];D(C,w)||(m._values.push(C),m._index.push(E))}}else b===0&&y<1&&(y=1),D(A,w)||(m._values.push(A),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,S){return new i(m,S)},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,S){return new i(m,S)},i.prototype.density=function(){var m=this._size[0],S=this._size[1];return m!==0&&S!==0?this._index.length/(m*S):0},i.prototype.subset=function(m,S,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,S,p);default:throw new SyntaxError("Wrong number of arguments")}};function u(m,S){if(!vh(S))throw new TypeError("Invalid index");var p=S.isScalar();if(p)return m.get(S.min());var g=S.size();if(g.length!==m._size.length)throw new Le(g.length,m._size.length);var y,D,w,b,E=S.min(),A=S.max();for(y=0,D=m._size.length;y<D;y++)yt(E[y],m._size[y]),yt(A[y],m._size[y]);var C=m._values,T=m._index,B=m._ptr,x=S.dimension(0),R=S.dimension(1),F=[],z=[];x.forEach(function(L,X){z[L]=X[0],F[L]=!0});var N=C?[]:void 0,U=[],I=[];return R.forEach(function(L){for(I.push(U.length),w=B[L],b=B[L+1];w<b;w++)y=T[w],F[y]===!0&&(U.push(z[y]),N&&N.push(C[w]))}),I.push(U.length),new i({values:N,index:U,ptr:I,size:g,datatype:m._datatype})}function l(m,S,p,g){if(!S||S.isIndex!==!0)throw new TypeError("Invalid index");var y=S.size(),D=S.isScalar(),w;if(Pe(p)?(w=p.size(),p=p.toArray()):w=st(p),D){if(w.length!==0)throw new TypeError("Scalar expected");m.set(S.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 A=S.dimension(0);A.forEach(function(B,x){yt(B),m.set([B,0],p[x[0]],g)})}else{var C=S.dimension(0),T=S.dimension(1);C.forEach(function(B,x){yt(B),T.forEach(function(R,F){yt(R),m.set([B,R],p[x[0]][F[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 S=m[0],p=m[1];yt(S,this._size[0]),yt(p,this._size[1]);var g=s(S,this._ptr[p],this._ptr[p+1],this._index);return g<this._ptr[p+1]&&this._index[g]===S?this._values[g]:0},i.prototype.set=function(m,S,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],D=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>D-1||y>w-1)&&(d(this,Math.max(g+1,D),Math.max(y+1,w),p),D=this._size[0],w=this._size[1]),yt(g,D),yt(y,w);var A=s(g,this._ptr[y],this._ptr[y+1],this._index);return A<this._ptr[y+1]&&this._index[A]===g?b(S,E)?c(A,y,this._values,this._index,this._ptr):this._values[A]=S:b(S,E)||f(A,g,y,S,this._values,this._index,this._ptr),this};function s(m,S,p,g){if(p-S===0)return p;for(var y=S;y<p;y++)if(g[y]===m)return y;return S}function c(m,S,p,g,y){p.splice(m,1),g.splice(m,1);for(var D=S+1;D<y.length;D++)y[D]--}function f(m,S,p,g,y,D,w){y.splice(m,0,g),D.splice(m,0,S);for(var b=p+1;b<w.length;b++)w[b]++}i.prototype.resize=function(m,S,p){if(!Lu(m))throw new TypeError("Array or Matrix expected");var g=m.valueOf().map(D=>Array.isArray(D)&&D.length===1?D[0]:D);if(g.length!==2)throw new Error("Only two dimensions matrix are supported");g.forEach(function(D){if(!et(D)||!it(D)||D<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],S)};function d(m,S,p,g){var y=g||0,D=n,w=0;ar(m._datatype)&&(D=t.find(n,[m._datatype,m._datatype])||n,w=t.convert(0,m._datatype),y=t.convert(y,m._datatype));var b=!D(y,w),E=m._size[0],A=m._size[1],C,T,B;if(p>A){for(T=A;T<p;T++)if(m._ptr[T]=m._values.length,b)for(C=0;C<E;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,S>E){if(b){var x=0;for(T=0;T<A;T++){m._ptr[T]=m._ptr[T]+x,B=m._ptr[T+1]+x;var R=0;for(C=E;C<S;C++,R++)m._values.splice(B+R,0,y),m._index.splice(B+R,0,C),x++}m._ptr[A]=m._values.length}}else if(S<E){var F=0;for(T=0;T<A;T++){m._ptr[T]=m._ptr[T]-F;var z=m._ptr[T],N=m._ptr[T+1]-F;for(B=z;B<N;B++)C=m._index[B],C>S-1&&(m._values.splice(B,1),m._index.splice(B,1),F++)}m._ptr[T]=m._values.length}return m._size[0]=S,m._size[1]=p,m}i.prototype.reshape=function(m,S){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=S?this.clone():this;if(this._size[0]===m[0]&&this._size[1]===m[1])return y;for(var D=[],w=0;w<y._ptr.length;w++)for(var b=0;b<y._ptr[w+1]-y._ptr[w];b++)D.push(w);for(var E=y._values.slice(),A=y._index.slice(),C=0;C<y._index.length;C++){var T=A[C],B=D[C],x=T*y._size[1]+B;D[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 R=0;R<y._ptr.length;R++)y._ptr[R]=0;for(var F=0;F<E.length;F++){var z=A[F],N=D[F],U=E[F],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,S){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],D=uc(m,p,"map"),w=function(E,A,C){return D.fn(E,[A,C],p)};return h(this,0,g-1,0,y-1,w,S)};function h(m,S,p,g,y,D,w){var b=[],E=[],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 B=function(j,Y,$){var q=D(j,Y,$);C(q,T)||(b.push(q),E.push(Y))},x=g;x<=y;x++){A.push(b.length);var R=m._ptr[x],F=m._ptr[x+1];if(w)for(var z=R;z<F;z++){var N=m._index[z];N>=S&&N<=p&&B(m._values[z],N-S,x-g)}else{for(var U={},I=R;I<F;I++){var L=m._index[I];U[L]=m._values[I]}for(var X=S;X<=p;X++){var Z=X in U?U[X]:0;B(Z,X-S,x-g)}}}return A.push(b.length),new i({values:b,index:E,ptr:A,size:[p-S+1,y-g+1]})}i.prototype.forEach=function(m,S){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],D=uc(m,p,"forEach"),w=0;w<y;w++){var b=this._ptr[w],E=this._ptr[w+1];if(S)for(var A=b;A<E;A++){var C=this._index[A];D.fn(this._values[A],[C,w],p)}else{for(var T={},B=b;B<E;B++){var x=this._index[B];T[x]=this._values[B]}for(var R=0;R<g;R++){var F=R in T?T[R]:0;D.fn(F,[R,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],S=0;S<m;S++)for(var p=this._ptr[S],g=this._ptr[S+1],y=p;y<g;y++){var D=this._index[y];yield{value:this._values[y],index:[D,S]}}},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,S,p,g,y){var D=g[0],w=g[1],b=[],E,A;for(E=0;E<D;E++)for(b[E]=[],A=0;A<w;A++)b[E][A]=0;for(A=0;A<w;A++)for(var C=p[A],T=p[A+1],B=C;B<T;B++)E=S[B],b[E][A]=m?y?Ie(m[B]):m[B]:1;return b}return i.prototype.format=function(m){for(var S=this._size[0],p=this._size[1],g=this.density(),y="Sparse Matrix ["+lt(S,m)+" x "+lt(p,m)+"] density: "+lt(g,m)+`
65
+ `,D=0;D<p;D++)for(var w=this._ptr[D],b=this._ptr[D+1],E=w;E<b;E++){var A=this._index[E];y+=`
66
+ (`+lt(A,m)+", "+lt(D,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 S=m>0?m:0,p=m<0?-m:0,g=this._size[0],y=this._size[1],D=Math.min(g-p,y-S),w=[],b=[],E=[];E[0]=0;for(var A=S;A<y&&w.length<D;A++)for(var C=this._ptr[A],T=this._ptr[A+1],B=C;B<T;B++){var x=this._index[B];if(x===A-S+p){w.push(this._values[B]),b[w.length-1]=x-p;break}}return E.push(w.length),new i({values:w,index:b,ptr:E,size:[D,1]})},i.fromJSON=function(m){return new i(m)},i.diagonal=function(m,S,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 D=n,w=0;ar(y)&&(D=t.find(n,[y,y])||n,w=t.convert(0,y));var b=p>0?p:0,E=p<0?-p:0,A=m[0],C=m[1],T=Math.min(A-E,C-b),B;if(ht(S)){if(S.length!==T)throw new Error("Invalid value array length");B=function(X){return S[X]}}else if(Pe(S)){var x=S.size();if(x.length!==1||x[0]!==T)throw new Error("Invalid matrix length");B=function(X){return S.get([X])}}else B=function(){return S};for(var R=[],F=[],z=[],N=0;N<C;N++){z.push(R.length);var U=N-b;if(U>=0&&U<T){var I=B(U);D(I,w)||(F.push(U+E),R.push(I))}}return z.push(R.length),new i({values:R,index:F,ptr:z,size:[A,C]})},i.prototype.swapRows=function(m,S){if(!et(m)||!it(m)||!et(S)||!it(S))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(S,this._size[0]),i._swapRows(m,S,this._size[1],this._values,this._index,this._ptr),this},i._forEachRow=function(m,S,p,g,y){for(var D=g[m],w=g[m+1],b=D;b<w;b++)y(p[b],S[b])},i._swapRows=function(m,S,p,g,y,D){for(var w=0;w<p;w++){var b=D[w],E=D[w+1],A=s(m,b,E,y),C=s(S,b,E,y);if(A<E&&C<E&&y[A]===m&&y[C]===S){if(g){var T=g[A];g[A]=g[C],g[C]=T}continue}if(A<E&&y[A]===m&&(C>=E||y[C]!==S)){var B=g?g[A]:void 0;y.splice(C,0,S),g&&g.splice(C,0,B),y.splice(C<=A?A+1:A,1),g&&g.splice(C<=A?A+1:A,1);continue}if(C<E&&y[C]===S&&(A>=E||y[A]!==m)){var x=g?g[C]:void 0;y.splice(A,0,m),g&&g.splice(A,0,x),y.splice(A<=C?C+1:C,1),g&&g.splice(A<=C?C+1:C,1)}}},i},{isClass:!0}),_T="number",BT=["typed"];function FT(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 NT(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 RT=ce(_T,BT,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=FT(i);if(a)return NT(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}),OT="bignumber",zT=["typed","BigNumber"],UT=ce(OT,zT,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))})}),IT="complex",$T=["typed","Complex"],kT=ce(IT,$T,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))})}),LT="fraction",jT=["typed","Fraction"],HT=ce(LT,jT,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",PT=["typed","Matrix","DenseMatrix","SparseMatrix"],qT=ce(zb,PT,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",VT=["typed","matrix","flatten","size"],GT=ce(Ub,VT,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",YT=["typed"],XT=ce(Ib,YT,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",ZT=["typed"],QT=ce($b,ZT,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",KT=["typed"],WT=ce(kb,KT,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",JT=["typed"],eM=ce(Lb,JT,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})})}),tM="matAlgo11xS0s",nM=["typed","equalScalar"],jb=ce(tM,nM,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,S=n,p=0,g=o;typeof d=="string"&&(m=d,S=t.find(n,[m,m]),p=t.convert(0,m),a=t.convert(a,m),g=t.find(o,[m,m]));for(var y=[],D=[],w=[],b=0;b<v;b++){w[b]=D.length;for(var E=c[b],A=c[b+1],C=E;C<A;C++){var T=s[C],B=u?g(a,l[C]):g(l[C],a);S(B,p)||(D.push(T),y.push(B))}}return w[v]=D.length,i.createSparseMatrix({values:y,index:D,ptr:w,size:[h,v],datatype:m})}}),rM="matAlgo12xSfs",iM=["typed","DenseMatrix"],vo=ce(rM,iM,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,S=o;typeof d=="string"&&(m=d,a=t.convert(a,m),S=t.find(o,[m,m]));for(var p=[],g=[],y=[],D=0;D<v;D++){for(var w=D+1,b=c[D],E=c[D+1],A=b;A<E;A++){var C=s[A];g[C]=l[A],y[C]=w}for(var T=0;T<h;T++)D===0&&(p[T]=[]),y[T]===w?p[T][D]=u?S(a,g[T]):S(g[T],a):p[T][D]=u?S(a,0):S(0,a)}return new n({data:p,size:[h,v],datatype:m})}}),aM="matAlgo14xDs",oM=["typed"],Ih=ce(aM,oM,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}}),uM="matAlgo03xDSf",lM=["typed"],yo=ce(uM,lM,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],S=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 D=[],w=0;w<m;w++)D[w]=[];for(var b=[],E=[],A=0;A<S;A++){for(var C=A+1,T=d[A],B=d[A+1],x=T;x<B;x++){var R=f[x];b[R]=o?y(c[x],u[R][A]):y(u[R][A],c[x]),E[R]=C}for(var F=0;F<m;F++)E[F]===C?D[F][A]=b[F]:D[F][A]=o?y(g,u[F][A]):y(u[F][A],g)}return r.createDenseMatrix({data:D,size:[m,S],datatype:s===r._datatype&&v===i._datatype?p:void 0})}}),sM="matAlgo05xSfSf",cM=["typed","equalScalar"],fM=ce(sM,cM,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,S=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,D=n,w=0,b=o;typeof f=="string"&&f===S&&f!=="mixed"&&(y=f,D=t.find(n,[y,y]),w=t.convert(0,y),b=t.find(o,[y,y]));var E=u&&d?[]:void 0,A=[],C=[],T=E?[]:void 0,B=E?[]:void 0,x=[],R=[],F,z,N,U;for(z=0;z<g;z++){C[z]=A.length;var I=z+1;for(N=s[z],U=s[z+1];N<U;N++)F=l[N],A.push(F),x[F]=I,T&&(T[F]=u[N]);for(N=v[z],U=v[z+1];N<U;N++)F=h[N],x[F]!==I&&A.push(F),R[F]=I,B&&(B[F]=d[N]);if(E)for(N=C[z];N<A.length;){F=A[N];var L=x[F],X=R[F];if(L===I||X===I){var Z=L===I?T[F]:w,P=X===I?B[F]:w,j=b(Z,P);D(j,w)?A.splice(N,1):(E.push(j),N++)}}}return C[g]=A.length,i.createSparseMatrix({values:E,index:A,ptr:C,size:[p,g],datatype:f===i._datatype&&S===a._datatype?y:void 0})}}),dM="matAlgo13xDD",hM=["typed"],mM=ce(dM,hM,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,S=o;typeof s=="string"&&s===d&&(m=s,S=t.find(o,[m,m]));var p=h.length>0?n(S,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=>pM(r,n))}function pM(e,t){return Ti(e.size(),t)?e:e.create(Oh(e.valueOf(),t),e.datatype())}var gM="matrixAlgorithmSuite",vM=["typed","matrix"],aa=ce(gM,vM,e=>{var{typed:t,matrix:n}=e,r=mM({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}}),yM="matAlgo01xDSid",bM=["typed"],Hb=ce(yM,bM,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],S=l[1],p=typeof s=="string"&&s!=="mixed"&&s===v?s:void 0,g=p?t.find(a,[p,p]):a,y,D,w=[];for(y=0;y<m;y++)w[y]=[];var b=[],E=[];for(D=0;D<S;D++){for(var A=D+1,C=d[D],T=d[D+1],B=C;B<T;B++)y=f[B],b[y]=o?g(c[B],u[y][D]):g(u[y][D],c[B]),E[y]=A;for(y=0;y<m;y++)E[y]===A?w[y][D]=b[y]:w[y][D]=u[y][D]}return r.createDenseMatrix({data:w,size:[m,S],datatype:s===r._datatype&&v===i._datatype?p:void 0})}}),DM="matAlgo04xSidSid",SM=["typed","equalScalar"],xM=ce(DM,SM,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,S=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,D=n,w=0,b=o;typeof f=="string"&&f===S&&f!=="mixed"&&(y=f,D=t.find(n,[y,y]),w=t.convert(0,y),b=t.find(o,[y,y]));var E=u&&d?[]:void 0,A=[],C=[],T=u&&d?[]:void 0,B=u&&d?[]:void 0,x=[],R=[],F,z,N,U,I;for(z=0;z<g;z++){C[z]=A.length;var L=z+1;for(U=s[z],I=s[z+1],N=U;N<I;N++)F=l[N],A.push(F),x[F]=L,T&&(T[F]=u[N]);for(U=v[z],I=v[z+1],N=U;N<I;N++)if(F=h[N],x[F]===L){if(T){var X=b(T[F],d[N]);D(X,w)?x[F]=null:T[F]=X}}else A.push(F),R[F]=L,B&&(B[F]=d[N]);if(T&&B)for(N=C[z];N<A.length;)F=A[N],x[F]===L?(E[N]=T[F],N++):R[F]===L?(E[N]=B[F],N++):A.splice(N,1)}return C[g]=A.length,i.createSparseMatrix({values:E,index:A,ptr:C,size:[p,g],datatype:f===i._datatype&&S===a._datatype?y:void 0})}}),wM="matAlgo10xSids",EM=["typed","DenseMatrix"],Pb=ce(wM,EM,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,S=o;typeof d=="string"&&(m=d,a=t.convert(a,m),S=t.find(o,[m,m]));for(var p=[],g=[],y=[],D=0;D<v;D++){for(var w=D+1,b=c[D],E=c[D+1],A=b;A<E;A++){var C=s[A];g[C]=l[A],y[C]=w}for(var T=0;T<h;T++)D===0&&(p[T]=[]),y[T]===w?p[T][D]=u?S(a,g[T]):S(g[T],a):p[T][D]=a}return new n({data:p,size:[h,v],datatype:m})}}),AM="multiplyScalar",CM=["typed"],TM=ce(AM,CM,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",MM=["typed","matrix","addScalar","multiplyScalar","equalScalar","dot"],_M=ce(qb,MM,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,A=w._size,C=w._datatype||w.getDataType(),T=b._data,B=b._size,x=b._datatype||b.getDataType(),R=A[0],F=B[1],z,N=r,U=i;C&&x&&C===x&&typeof C=="string"&&C!=="mixed"&&(z=C,N=t.find(r,[z,z]),U=t.find(i,[z,z]));for(var I=[],L=0;L<F;L++){for(var X=U(E[0],T[0][L]),Z=1;Z<R;Z++)X=N(X,U(E[Z],T[Z][L]));I[L]=X}return w.createDenseMatrix({data:I,size:[F],datatype:C===w._datatype&&x===b._datatype?z:void 0})}var h=t("_multiplyMatrixVector",{"DenseMatrix, any":m,"SparseMatrix, any":g}),v=t("_multiplyMatrixMatrix",{"DenseMatrix, DenseMatrix":S,"DenseMatrix, SparseMatrix":p,"SparseMatrix, DenseMatrix":y,"SparseMatrix, SparseMatrix":D});function m(w,b){var E=w._data,A=w._size,C=w._datatype||w.getDataType(),T=b._data,B=b._datatype||b.getDataType(),x=A[0],R=A[1],F,z=r,N=i;C&&B&&C===B&&typeof C=="string"&&C!=="mixed"&&(F=C,z=t.find(r,[F,F]),N=t.find(i,[F,F]));for(var U=[],I=0;I<x;I++){for(var L=E[I],X=N(L[0],T[0]),Z=1;Z<R;Z++)X=z(X,N(L[Z],T[Z]));U[I]=X}return w.createDenseMatrix({data:U,size:[x],datatype:C===w._datatype&&B===b._datatype?F:void 0})}function S(w,b){var E=w._data,A=w._size,C=w._datatype||w.getDataType(),T=b._data,B=b._size,x=b._datatype||b.getDataType(),R=A[0],F=A[1],z=B[1],N,U=r,I=i;C&&x&&C===x&&typeof C=="string"&&C!=="mixed"&&C!=="mixed"&&(N=C,U=t.find(r,[N,N]),I=t.find(i,[N,N]));for(var L=[],X=0;X<R;X++){var Z=E[X];L[X]=[];for(var P=0;P<z;P++){for(var j=I(Z[0],T[0][P]),Y=1;Y<F;Y++)j=U(j,I(Z[Y],T[Y][P]));L[X][P]=j}}return w.createDenseMatrix({data:L,size:[R,z],datatype:C===w._datatype&&x===b._datatype?N:void 0})}function p(w,b){var E=w._data,A=w._size,C=w._datatype||w.getDataType(),T=b._values,B=b._index,x=b._ptr,R=b._size,F=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],N=R[1],U,I=r,L=i,X=a,Z=0;C&&F&&C===F&&typeof C=="string"&&C!=="mixed"&&(U=C,I=t.find(r,[U,U]),L=t.find(i,[U,U]),X=t.find(a,[U,U]),Z=t.convert(0,U));for(var P=[],j=[],Y=[],$=b.createSparseMatrix({values:P,index:j,ptr:Y,size:[z,N],datatype:C===w._datatype&&F===b._datatype?U:void 0}),q=0;q<N;q++){Y[q]=j.length;var V=x[q],te=x[q+1];if(te>V)for(var W=0,ne=0;ne<z;ne++){for(var fe=ne+1,ee=void 0,le=V;le<te;le++){var se=B[le];W!==fe?(ee=L(E[ne][se],T[le]),W=fe):ee=I(ee,L(E[ne][se],T[le]))}W===fe&&!X(ee,Z)&&(j.push(ne),P.push(ee))}}return Y[N]=j.length,$}function g(w,b){var E=w._values,A=w._index,C=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=b._data,x=b._datatype||b.getDataType(),R=w._size[0],F=b._size[0],z=[],N=[],U=[],I,L=r,X=i,Z=a,P=0;T&&x&&T===x&&typeof T=="string"&&T!=="mixed"&&(I=T,L=t.find(r,[I,I]),X=t.find(i,[I,I]),Z=t.find(a,[I,I]),P=t.convert(0,I));var j=[],Y=[];U[0]=0;for(var $=0;$<F;$++){var q=B[$];if(!Z(q,P))for(var V=C[$],te=C[$+1],W=V;W<te;W++){var ne=A[W];Y[ne]?j[ne]=L(j[ne],X(q,E[W])):(Y[ne]=!0,N.push(ne),j[ne]=X(q,E[W]))}}for(var fe=N.length,ee=0;ee<fe;ee++){var le=N[ee];z[ee]=j[le]}return U[1]=N.length,w.createSparseMatrix({values:z,index:N,ptr:U,size:[R,1],datatype:T===w._datatype&&x===b._datatype?I:void 0})}function y(w,b){var E=w._values,A=w._index,C=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=b._data,x=b._datatype||b.getDataType(),R=w._size[0],F=b._size[0],z=b._size[1],N,U=r,I=i,L=a,X=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]),X=t.convert(0,N));for(var Z=[],P=[],j=[],Y=w.createSparseMatrix({values:Z,index:P,ptr:j,size:[R,z],datatype:T===w._datatype&&x===b._datatype?N:void 0}),$=[],q=[],V=0;V<z;V++){j[V]=P.length;for(var te=V+1,W=0;W<F;W++){var ne=B[W][V];if(!L(ne,X))for(var fe=C[W],ee=C[W+1],le=fe;le<ee;le++){var se=A[le];q[se]!==te?(q[se]=te,P.push(se),$[se]=I(ne,E[le])):$[se]=U($[se],I(ne,E[le]))}}for(var De=j[V],be=P.length,xe=De;xe<be;xe++){var we=P[xe];Z[xe]=$[we]}}return j[z]=P.length,Y}function D(w,b){var E=w._values,A=w._index,C=w._ptr,T=w._datatype||w._data===void 0?w._datatype:w.getDataType(),B=b._values,x=b._index,R=b._ptr,F=b._datatype||b._data===void 0?b._datatype:b.getDataType(),z=w._size[0],N=b._size[1],U=E&&B,I,L=r,X=i;T&&F&&T===F&&typeof T=="string"&&T!=="mixed"&&(I=T,L=t.find(r,[I,I]),X=t.find(i,[I,I]));for(var Z=U?[]:void 0,P=[],j=[],Y=w.createSparseMatrix({values:Z,index:P,ptr:j,size:[z,N],datatype:T===w._datatype&&F===b._datatype?I:void 0}),$=U?[]:void 0,q=[],V,te,W,ne,fe,ee,le,se,De=0;De<N;De++){j[De]=P.length;var be=De+1;for(fe=R[De],ee=R[De+1],ne=fe;ne<ee;ne++)if(se=x[ne],U)for(te=C[se],W=C[se+1],V=te;V<W;V++)le=A[V],q[le]!==be?(q[le]=be,P.push(le),$[le]=X(B[ne],E[V])):$[le]=L($[le],X(B[ne],E[V]));else for(te=C[se],W=C[se+1],V=te;V<W;V++)le=A[V],q[le]!==be&&(q[le]=be,P.push(le));if(U)for(var xe=j[De],we=P.length,Re=xe;Re<we;Re++){var Ce=P[Re];Z[Re]=$[Ce]}}return j[N]=P.length,Y}return t(qb,i,{"Array, Array":t.referTo("Matrix, Matrix",w=>(b,E)=>{s(st(b),st(E));var A=w(n(b),n(E));return Pe(A)?A.valueOf():A}),"Matrix, Matrix":function(b,E){var A=b.size(),C=E.size();return s(A,C),A.length===1?C.length===1?c(b,E,A[0]):f(b,E):C.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,A)=>{for(var C=w(b,E),T=0;T<A.length;T++)C=w(C,A[T]);return C})})}),Vb="sign",BM=["typed","BigNumber","Fraction","complex"],FM=ce(Vb,BM,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)})})}),NM="sqrt",RM=["config","typed","Complex"],OM=ce(NM,RM,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",zM=["typed","matrix","equalScalar","subtractScalar","unaryMinus","DenseMatrix","concat"],UM=ce(Gb,zM,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=fM({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}))}),IM="matAlgo07xSSf",$M=["typed","SparseMatrix"],Vu=ce(IM,$M,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,S=u;typeof s=="string"&&s===f&&s!=="mixed"&&(v=s,m=t.convert(0,v),S=t.find(u,[v,v]));for(var p=[],g=[],y=new Array(h+1).fill(0),D=[],w=[],b=[],E=[],A=0;A<h;A++){var C=A+1,T=0;r(a,A,b,D,C),r(o,A,E,w,C);for(var B=0;B<d;B++){var x=b[B]===C?D[B]:m,R=E[B]===C?w[B]:m,F=S(x,R);F!==0&&F!==!1&&(g.push(B),p.push(F),T++)}y[A+1]=y[A]+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",kM=["typed"],LM=ce(Yb,kM,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",jM=["typed"],HM=ce(Xb,jM,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",PM=["typed"],qM=ce(Zb,PM,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",VM=["typed","matrix","isInteger"],GM=ce(Qb,VM,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",YM=["typed","Index","matrix","range"],XM=ce(Kb,YM,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",ZM=["typed","matrix","DenseMatrix","SparseMatrix"],QM=ce(Wb,ZM,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),S=[],p=0;p<m;p++)S[p]=l[p+d][p+h];return c!==null?n(S):S}}),Jb="flatten",KM=["typed"],WM=ce(Jb,KM,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",JM=["typed"],e4=ce(eD,JM,e=>{var{typed:t}=e;return t(eD,{Array:function(r){return oc(r,Fn)},Matrix:function(r){return r.getDataType()}})}),tD="identity",t4=["typed","config","matrix","BigNumber","DenseMatrix","SparseMatrix"],n4=ce(tD,t4,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 S=ac([],m,v),p=s<c?s:c,g=0;g<p;g++)S[g][g]=h;return S}});function nD(){throw new Error('No "bignumber" implementation available')}function r4(){throw new Error('No "fraction" implementation available')}function rD(){throw new Error('No "matrix" implementation available')}var iD="range",i4=["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],a4=ce(iD,i4,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(S){throw new TypeError("Too few arguments to function range(): ".concat(S))},boolean:function(S){throw new TypeError("Unexpected type of argument 1 to function range(): ".concat(S,", number|bigint|BigNumber|Fraction"))},"number, number":function(S,p){return f(h(S,p,1,!1))},"number, number, number":function(S,p,g){return f(h(S,p,g,!1))},"number, number, boolean":function(S,p,g){return f(h(S,p,1,g))},"number, number, number, boolean":function(S,p,g,y){return f(h(S,p,g,y))},"bigint, bigint|number":function(S,p){return f(h(S,p,1n,!1))},"number, bigint":function(S,p){return f(h(BigInt(S),p,1n,!1))},"bigint, bigint|number, bigint|number":function(S,p,g){return f(h(S,p,BigInt(g),!1))},"number, bigint, bigint|number":function(S,p,g){return f(h(BigInt(S),p,BigInt(g),!1))},"bigint, bigint|number, boolean":function(S,p,g){return f(h(S,p,1n,g))},"number, bigint, boolean":function(S,p,g){return f(h(BigInt(S),p,1n,g))},"bigint, bigint|number, bigint|number, boolean":function(S,p,g,y){return f(h(S,p,BigInt(g),y))},"number, bigint, bigint|number, boolean":function(S,p,g,y){return f(h(BigInt(S),p,BigInt(g),y))},"BigNumber, BigNumber":function(S,p){var g=S.constructor;return f(h(S,p,new g(1),!1))},"BigNumber, BigNumber, BigNumber":function(S,p,g){return f(h(S,p,g,!1))},"BigNumber, BigNumber, boolean":function(S,p,g){var y=S.constructor;return f(h(S,p,new y(1),g))},"BigNumber, BigNumber, BigNumber, boolean":function(S,p,g,y){return f(h(S,p,g,y))},"Fraction, Fraction":function(S,p){return f(h(S,p,1,!1))},"Fraction, Fraction, Fraction":function(S,p,g){return f(h(S,p,g,!1))},"Fraction, Fraction, boolean":function(S,p,g){return f(h(S,p,1,g))},"Fraction, Fraction, Fraction, boolean":function(S,p,g,y){return f(h(S,p,g,y))},"Unit, Unit, Unit":function(S,p,g){return f(h(S,p,g,!1))},"Unit, Unit, Unit, boolean":function(S,p,g,y){return f(h(S,p,g,y))}});function f(m){return n.matrix==="Matrix"?r?r(m):rD():m}function d(m,S){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,S))}function h(m,S,p,g){for(var y=[],D=c(p)?g?o:a:g?l:u,w=m;D(w,S);)y.push(w),w=s(w,p);return y}function v(m){var S=m.split(":"),p=S.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",o4=["typed","isInteger","matrix"],u4=ce(aD,o4,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",l4=["typed","config","?matrix"],s4=ce(oD,l4,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",c4=["typed","matrix"],f4=ce(uD,c4,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=[],S=0;S<u;S++)m[S]=0;var p,g,y;for(p=0,g=c.length;p<g;p++)m[c[p]]++;for(var D=0,w=0;w<u;w++)v.push(D),D+=m[w],m[w]=v[w];for(v.push(D),y=0;y<l;y++)for(var b=f[y],E=f[y+1],A=b;A<E;A++){var C=m[c[A]]++;h[C]=y,s&&(d[C]=Ie(s[A]))}return o.createSparseMatrix({values:d,index:h,ptr:v,size:[l,u],datatype:o._datatype})}}),lD="ctranspose",d4=["typed","transpose","conj"],h4=ce(lD,d4,e=>{var{typed:t,transpose:n,conj:r}=e;return t(lD,{any:function(a){return r(n(a))}})}),sD="zeros",m4=["typed","config","matrix","BigNumber"],p4=ce(sD,m4,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 g4="numeric",v4=["number","?bignumber","?fraction"],y4=ce(g4,v4,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):r4};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",b4=["typed","numeric"],D4=ce(cD,b4,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",S4=["typed","config","identity","multiply","matrix","inv","fraction","number","Complex"],x4=ce(fD,S4,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 S=v.pow(m);if(S!=null)return S;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),S=u(m);if((v===S||Math.abs((v-S)/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 S=r(m[0]).valueOf(),p=h;v>=1;)(v&1)===1&&(S=i(p,S)),v>>=1,p=i(p,p);return S}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,S=i._index,p=i._ptr,g=p[1],y=p[0];y<g;y++){var D=S[y];s[D][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",w4=["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],E4=ce(hD,w4,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],S=[],p=f._data,g=m-1;g>=0;g--){var y=h[g][0]||0,D=void 0;if(o(y,0))D=0;else{var w=p[g][g];if(o(w,0))throw new Error("Linear system cannot be solved since matrix is singular");D=r(y,w);for(var b=g-1;b>=0;b--)h[b]=[a(h[b][0]||0,i(D,p[b][g]))]}S[g]=[D]}return new u({data:S,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],S=f._values,p=f._index,g=f._ptr,y=[],D=m-1;D>=0;D--){var w=h[D][0]||0;if(o(w,0))y[D]=[0];else{for(var b=0,E=[],A=[],C=g[D],T=g[D+1],B=T-1;B>=C;B--){var x=p[B];x===D?b=S[B]:x<D&&(E.push(S[B]),A.push(x))}if(o(b,0))throw new Error("Linear system cannot be solved since matrix is singular");for(var R=r(w,b),F=0,z=A.length;F<z;F++){var N=A[F];h[N]=[a(h[N][0],i(R,E[F]))]}y[D]=[R]}}return new u({data:y,size:[v,1]})}}),mD="usolveAll",A4=["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],C4=ce(mD,A4,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(S=>S.valueOf())}});function s(f,d){for(var h=[l(f,d,!0)._data.map(A=>A[0])],v=f._data,m=f._size[0],S=f._size[1],p=S-1;p>=0;p--)for(var g=h.length,y=0;y<g;y++){var D=h[y];if(o(v[p][p],0))if(o(D[p],0)){if(y===0){var b=[...D];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{D[p]=r(D[p],v[p][p]);for(var w=p-1;w>=0;w--)D[w]=a(D[w],i(D[p],v[w][p]))}}return h.map(A=>new u({data:A.map(C=>[C]),size:[m,1]}))}function c(f,d){for(var h=[l(f,d,!0)._data.map(Z=>Z[0])],v=f._size[0],m=f._size[1],S=f._values,p=f._index,g=f._ptr,y=m-1;y>=0;y--)for(var D=h.length,w=0;w<D;w++){for(var b=h[w],E=[],A=[],C=g[y],T=g[y+1],B=0,x=T-1;x>=C;x--){var R=p[x];R===y?B=S[x]:R<y&&(E.push(S[x]),A.push(R))}if(o(B,0))if(o(b[y],0)){if(w===0){var U=[...b];U[y]=1;for(var I=0,L=A.length;I<L;I++){var X=A[I];U[X]=a(U[X],E[I])}h.push(U)}}else{if(w===0)return[];h.splice(w,1),w-=1,D-=1}else{b[y]=r(b[y],B);for(var F=0,z=A.length;F<z;F++){var N=A[F];b[N]=a(b[N],i(b[y],E[F]))}}}return h.map(Z=>new u({data:Z.map(P=>[P]),size:[v,1]}))}}),dc="equal",T4=["typed","matrix","equalScalar","DenseMatrix","concat","SparseMatrix"],M4=ce(dc,T4,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,_4({typed:t,equalScalar:r}),c({elop:r,SS:l,DS:u,Ss:s}))}),_4=ce(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",B4=["typed","config","bignumber","matrix","DenseMatrix","concat","SparseMatrix"],F4=ce(hc,B4,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,N4({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,S){return h(r(m),S)},"BigNumber, Fraction":function(m,S){return h(m,r(S))},"Complex, Complex":function(m,S){throw new TypeError("No ordering relation is defined for complex numbers")}},d,f({SS:s,DS:l,Ss:c}))}),N4=ce(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",R4=["typed","config","matrix","DenseMatrix","concat","SparseMatrix"],O4=ce(mc,R4,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,z4({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}))}),z4=ce(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",U4=["typed","config","bignumber","matrix","DenseMatrix","concat","SparseMatrix"],I4=ce(pc,U4,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,$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,S){return h(r(m),S)},"BigNumber, Fraction":function(m,S){return h(m,r(S))},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},d,f({SS:s,DS:l,Ss:c}))}),$4=ce(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",k4=["typed","config","matrix","DenseMatrix","concat","SparseMatrix"],L4=ce(gc,k4,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,j4({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}))}),j4=ce(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",H4=["typed","config","numeric","smaller","isNaN"],P4=ce(pD,H4,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,FC(s,n))),s}}),q4="ImmutableDenseMatrix",V4=["smaller","DenseMatrix"],G4=ce(q4,V4,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}),Y4="Index",X4=["ImmutableDenseMatrix","getMatrixDataType"],Z4=ce(Y4,X4,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 Q4="atan",K4=["typed"],W4=ce(Q4,K4,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=ce("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",J4=["typed"],e5=ce(yD,J4,e=>{var{typed:t}=e,n=vD({typed:t});return t(yD,{number:Math.cos,"Complex | BigNumber":r=>r.cos()},n)}),bD="sin",t5=["typed"],n5=ce(bD,t5,e=>{var{typed:t}=e,n=vD({typed:t});return t(bD,{number:Math.sin,"Complex | BigNumber":r=>r.sin()},n)}),DD="add",r5=["typed","matrix","addScalar","equalScalar","DenseMatrix","SparseMatrix","concat"],i5=ce(DD,r5,e=>{var{typed:t,matrix:n,addScalar:r,equalScalar:i,DenseMatrix:a,SparseMatrix:o,concat:u}=e,l=Hb({typed:t}),s=xM({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 S=d(h,v),p=0;p<m.length;p++)S=d(S,m[p]);return S})},f({elop:r,DS:l,SS:s,Ss:c}))}),SD="norm",a5=["typed","abs","add","pow","conj","sqrt","multiply","equalScalar","larger","smaller","matrix","ctranspose","eigs"],o5=ce(SD,a5,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(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 v(E){var A=0;return E.forEach(function(C){var T=n(C);s(T,A)&&(A=T)},!0),A}function m(E){var A;return E.forEach(function(C){var T=n(C);(!A||c(T,A))&&(A=T)},!0),A||0}function S(E,A){if(A===Number.POSITIVE_INFINITY||A==="inf")return v(E);if(A===Number.NEGATIVE_INFINITY||A==="-inf")return m(E);if(A==="fro")return b(E,2);if(typeof A=="number"&&!isNaN(A)){if(!l(A,0)){var C=0;return E.forEach(function(T){C=r(i(n(T),A),C)},!0),i(C,1/A)}return Number.POSITIVE_INFINITY}throw new Error("Unsupported parameter value")}function p(E){var A=0;return E.forEach(function(C,T){A=r(A,u(C,a(C)))}),n(o(A))}function g(E){var A=[],C=0;return E.forEach(function(T,B){var x=B[1],R=r(A[x]||0,n(T));s(R,C)&&(C=R),A[x]=R},!0),C}function y(E){var A=E.size();if(A[0]!==A[1])throw new RangeError("Invalid matrix dimensions");var C=d(E),T=u(C,E),B=h(T).values.toArray(),x=B[B.length-1];return n(o(x))}function D(E){var A=[],C=0;return E.forEach(function(T,B){var x=B[0],R=r(A[x]||0,n(T));s(R,C)&&(C=R),A[x]=R},!0),C}function w(E,A){if(A===1)return g(E);if(A===Number.POSITIVE_INFINITY||A==="inf")return D(E);if(A==="fro")return p(E);if(A===2)return y(E);throw new Error("Unsupported parameter value "+A)}function b(E,A){var C=E.size();if(C.length===1)return S(E,A);if(C.length===2){if(C[0]&&C[1])return w(E,A);throw new RangeError("Invalid matrix dimensions")}}}),xD="dot",u5=["typed","addScalar","multiplyScalar","conj","size"],l5=ce(xD,u5,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,S=Pe(f)?f._datatype||f.getDataType():void 0,p=s(c).length===2,g=s(f).length===2,y=n,D=r;if(v&&S&&v===S&&typeof v=="string"&&v!=="mixed"){var w=v;y=t.find(n,[w,w]),D=t.find(r,[w,w])}if(!p&&!g){for(var b=D(i(h[0]),m[0]),E=1;E<d;E++)b=y(b,D(i(h[E]),m[E]));return b}if(!p&&g){for(var A=D(i(h[0]),m[0][0]),C=1;C<d;C++)A=y(A,D(i(h[C]),m[C][0]));return A}if(p&&!g){for(var T=D(i(h[0][0]),m[0]),B=1;B<d;B++)T=y(T,D(i(h[B][0]),m[B]));return T}if(p&&g){for(var x=D(i(h[0][0]),m[0][0]),R=1;R<d;R++)x=y(x,D(i(h[R][0]),m[R][0]));return x}}function l(c,f){o(c,f);for(var d=c._index,h=c._values,v=f._index,m=f._values,S=0,p=n,g=r,y=0,D=0;y<d.length&&D<v.length;){var w=d[y],b=v[D];if(w<b){y++;continue}if(w>b){D++;continue}w===b&&(S=p(S,g(h[y],m[D])),y++,D++)}return S}function s(c){return Pe(c)?c.size():a(c)}}),wD="qr",s5=["typed","matrix","zeros","identity","isZero","equal","sign","sqrt","conj","unaryMinus","addScalar","divideScalar","multiplyScalar","subtractScalar","complex"],c5=ce(wD,s5,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(D){return p(D)},SparseMatrix:function(D){return g()},Array:function(D){var w=n(D),b=p(w);return{Q:b.Q.valueOf(),R:b.R.valueOf()}}}),{_denseQRimpl:S});function S(y){var D=y._size[0],w=y._size[1],b=i([D],"dense"),E=b._data,A=y.clone(),C=A._data,T,B,x,R=r([D],"");for(x=0;x<Math.min(w,D);++x){var F=C[x][x],z=c(o(F,0)?1:u(F)),N=s(z),U=0;for(T=x;T<D;T++)U=f(U,h(C[T][x],s(C[T][x])));var I=h(z,l(U));if(!a(I)){var L=v(F,I);for(R[x]=1,T=x+1;T<D;T++)R[T]=d(C[T][x],L);var X=c(s(d(L,I))),Z=void 0;for(B=x;B<w;B++){for(Z=0,T=x;T<D;T++)Z=f(Z,h(s(R[T]),C[T][B]));for(Z=h(Z,X),T=x;T<D;T++)C[T][B]=h(v(C[T][B],h(R[T],Z)),N)}for(T=0;T<D;T++){for(Z=0,B=x;B<D;B++)Z=f(Z,h(E[T][B],R[B]));for(Z=h(Z,X),B=x;B<D;++B)E[T][B]=d(v(E[T][B],h(Z,s(R[B]))),N)}}}return{Q:b,R:A,toString:function(){return"Q: "+this.Q.toString()+`
67
+ R: `+this.R.toString()}}}function p(y){var D=S(y),w=D.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 A=0;A<E&&A<(w[0]||[]).length;++A)w[E][A]=b;return D}function g(y){throw new Error("qr not implemented for sparse matrices yet")}}),ED="det",f5=["typed","matrix","subtractScalar","multiply","divideScalar","isZero","unaryMinus"],d5=ce(ED,f5,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,A)=>A),v=0;v<c;v++){var m=h[v];if(o(s[m][v])){var S=void 0;for(S=v+1;S<c;S++)if(!o(s[h[S]][v])){m=h[S],h[S]=h[v],h[v]=m,d=!d;break}if(S===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 D=h[y],w=v+1;w<c;w++)s[D][w]=a(r(i(s[D][w],p),i(s[D][v],s[m][w])),g)}var b=s[h[c-1]][c-1];return d?u(b):b}}),AD="inv",h5=["typed","matrix","divideScalar","addScalar","multiply","unaryMinus","det","identity","abs"],m5=ce(AD,h5,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,S,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 D=f.concat();for(v=0;v<d;v++)D[v]=D[v].concat();for(var w=l(d).valueOf(),b=0;b<h;b++){var E=s(D[b][b]),A=b;for(v=b+1;v<d;)s(D[v][b])>E&&(E=s(D[v][b]),A=v),v++;if(E===0)throw Error("Cannot calculate inverse, determinant is zero");v=A,v!==b&&(g=D[b],D[b]=D[v],D[v]=g,g=w[b],w[b]=w[v],w[v]=g);var C=D[b],T=w[b];for(v=0;v<d;v++){var B=D[v],x=w[v];if(v!==b){if(B[b]!==0){for(S=r(o(B[b]),C[b]),m=b;m<h;m++)B[m]=i(B[m],a(S,C[m]));for(m=0;m<h;m++)x[m]=i(x[m],a(S,T[m]))}}else{for(S=C[b],m=b;m<h;m++)B[m]=r(B[m],S);for(m=0;m<h;m++)x[m]=r(x[m],S)}}}return w}}});function p5(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:S,equal:p,complex:g,larger:y,smaller:D,matrixFromColumns:w,dot:b}=e;function E(P,j,Y,$){var q=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,V=A(P,j,Y,$,q);C(P,j,Y,$,q,V);var{values:te,C:W}=T(P,j,Y,$,q);if(q){var ne=B(P,j,W,V,te,Y,$);return{values:te,eigenvectors:ne}}return{values:te}}function A(P,j,Y,$,q){var V=$==="BigNumber",te=$==="Complex",W=V?s(0):0,ne=V?s(1):te?g(1):1,fe=V?s(1):1,ee=V?s(10):2,le=a(ee,ee),se;q&&(se=Array(j).fill(ne));for(var De=!1;!De;){De=!0;for(var be=0;be<j;be++){for(var xe=W,we=W,Re=0;Re<j;Re++)be!==Re&&(xe=t(xe,l(P[Re][be])),we=t(we,l(P[be][Re])));if(!p(xe,0)&&!p(we,0)){for(var Ce=fe,Be=xe,pe=o(we,ee),O=a(we,ee);D(Be,pe);)Be=a(Be,le),Ce=a(Ce,ee);for(;y(Be,O);)Be=o(Be,le),Ce=o(Ce,ee);var k=D(o(t(Be,we),Ce),a(t(xe,we),.95));if(k){De=!1;for(var H=o(1,Ce),G=0;G<j;G++)be!==G&&(P[be][G]=a(P[be][G],H),P[G][be]=a(P[G][be],Ce));q&&(se[be]=a(se[be],H))}}}}return q?c(se):null}function C(P,j,Y,$,q,V){var te=$==="BigNumber",W=$==="Complex",ne=te?s(0):W?g(0):0;te&&(Y=s(Y));for(var fe=0;fe<j-2;fe++){for(var ee=0,le=ne,se=fe+1;se<j;se++){var De=P[se][fe];D(l(le),l(De))&&(le=De,ee=se)}if(!D(l(le),Y)){if(ee!==fe+1){var be=P[ee];P[ee]=P[fe+1],P[fe+1]=be;for(var xe=0;xe<j;xe++){var we=P[xe][ee];P[xe][ee]=P[xe][fe+1],P[xe][fe+1]=we}if(q){var Re=V[ee];V[ee]=V[fe+1],V[fe+1]=Re}}for(var Ce=fe+2;Ce<j;Ce++){var Be=o(P[Ce][fe],le);if(Be!==0){for(var pe=0;pe<j;pe++)P[Ce][pe]=n(P[Ce][pe],a(Be,P[fe+1][pe]));for(var O=0;O<j;O++)P[O][fe+1]=t(P[O][fe+1],a(Be,P[O][Ce]));if(q)for(var k=0;k<j;k++)V[Ce][k]=n(V[Ce][k],a(Be,V[fe+1][k]))}}}}return V}function T(P,j,Y,$,q){var V=$==="BigNumber",te=$==="Complex",W=V?s(1):te?g(1):1;V&&(Y=s(Y));for(var ne=Ie(P),fe=[],ee=j,le=[],se=q?c(Array(j).fill(W)):void 0,De=q?c(Array(ee).fill(W)):void 0,be=0;be<=100;){be+=1;for(var xe=ne[ee-1][ee-1],we=0;we<ee;we++)ne[we][we]=n(ne[we][we],xe);var{Q:Re,R:Ce}=v(ne);ne=i(Ce,Re);for(var Be=0;Be<ee;Be++)ne[Be][Be]=t(ne[Be][Be],xe);if(q&&(De=i(De,Re)),ee===1||D(l(ne[ee-1][ee-2]),Y)){be=0,fe.push(ne[ee-1][ee-1]),q&&(le.unshift([[1]]),F(De,j),se=i(se,De),ee>1&&(De=c(Array(ee-1).fill(W)))),ee-=1,ne.pop();for(var pe=0;pe<ee;pe++)ne[pe].pop()}else if(ee===2||D(l(ne[ee-2][ee-3]),Y)){be=0;var O=x(ne[ee-2][ee-2],ne[ee-2][ee-1],ne[ee-1][ee-2],ne[ee-1][ee-1]);fe.push(...O),q&&(le.unshift(R(ne[ee-2][ee-2],ne[ee-2][ee-1],ne[ee-1][ee-2],ne[ee-1][ee-1],O[0],O[1],Y,$)),F(De,j),se=i(se,De),ee>2&&(De=c(Array(ee-2).fill(W)))),ee-=2,ne.pop(),ne.pop();for(var k=0;k<ee;k++)ne[k].pop(),ne[k].pop()}if(ee===0)break}if(fe.sort((ie,J)=>+n(l(ie),l(J))),be>100){var H=Error("The eigenvalues failed to converge. Only found these eigenvalues: "+fe.join(", "));throw H.values=fe,H.vectors=[],H}var G=q?i(se,z(le,j)):void 0;return{values:fe,C:G}}function B(P,j,Y,$,q,V,te){var W=h(Y),ne=i(W,P,Y),fe=te==="BigNumber",ee=te==="Complex",le=fe?s(0):ee?g(0):0,se=fe?s(1):ee?g(1):1,De=[],be=[];for(var xe of q){var we=N(De,xe,p);we===-1?(De.push(xe),be.push(1)):be[we]+=1}for(var Re=[],Ce=De.length,Be=Array(j).fill(le),pe=c(Array(j).fill(se)),O=function(){var G=De[k],ie=n(ne,i(G,pe)),J=S(ie,Be);for(J.shift();J.length<be[k];){var he=U(ie,j,J,V,te);if(he===null)break;J.push(he)}var oe=i(h($),Y);J=J.map(de=>i(oe,de)),Re.push(...J.map(de=>({value:G,vector:r(de)})))},k=0;k<Ce;k++)O();return Re}function x(P,j,Y,$){var q=t(P,$),V=n(a(P,$),a(j,Y)),te=a(q,.5),W=a(u(n(a(q,q),a(4,V))),.5);return[t(te,W),n(te,W)]}function R(P,j,Y,$,q,V,te,W){var ne=W==="BigNumber",fe=W==="Complex",ee=ne?s(0):fe?g(0):0,le=ne?s(1):fe?g(1):1;if(D(l(Y),te))return[[le,ee],[ee,le]];if(y(l(n(q,V)),te))return[[n(q,$),n(V,$)],[Y,Y]];var se=n(P,q),De=n($,q);return D(l(j),te)&&D(l(De),te)?[[se,le],[Y,ee]]:[[j,ee],[De,le]]}function F(P,j){for(var Y=0;Y<P.length;Y++)P[Y].push(...Array(j-P[Y].length).fill(0));for(var $=P.length;$<j;$++)P.push(Array(j).fill(0)),P[$][$]=1;return P}function z(P,j){for(var Y=[],$=0;$<j;$++)Y[$]=Array(j).fill(0);var q=0;for(var V of P){for(var te=V.length,W=0;W<te;W++)for(var ne=0;ne<te;ne++)Y[q+W][q+ne]=V[W][ne];q+=te}return Y}function N(P,j,Y){for(var $=0;$<P.length;$++)if(Y(P[$],j))return $;return-1}function U(P,j,Y,$,q){for(var V=q==="BigNumber"?s(1e3):1e3,te,W=0;W<5;++W){te=I(j,Y,q);try{te=m(P,te)}catch{continue}if(y(X(te),V))break}if(W>=5)return null;for(W=0;;){var ne=m(P,te);if(D(X(L(te,[ne])),$))break;if(++W>=10)return null;te=Z(ne)}return te}function I(P,j,Y){var $=Y==="BigNumber",q=Y==="Complex",V=Array(P).fill(0).map(te=>2*Math.random()-1);return $&&(V=V.map(te=>s(te))),q&&(V=V.map(te=>g(te))),V=L(V,j),Z(V,Y)}function L(P,j){var Y=f(P);for(var $ of j)$=d($,Y),P=n(P,i(o(b($,P),b($,$)),$));return P}function X(P){return l(u(b(P,P)))}function Z(P,j){var Y=j==="BigNumber",$=j==="Complex",q=Y?s(1):$?g(1):1;return i(o(q,X(P)),P)}return E}function g5(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(C,T){var B=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t.relTol,x=arguments.length>3?arguments[3]:void 0,R=arguments.length>4?arguments[4]:void 0;if(x==="number")return v(C,B,R);if(x==="BigNumber")return m(C,B,R);throw TypeError("Unsupported data type: "+x)}function v(C,T,B){var x=C.length,R=Math.abs(T/x),F,z;if(B){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(C);Math.abs(U[1])>=Math.abs(R);){var I=U[0][0],L=U[0][1];F=S(C[I][I],C[L][L],C[I][L]),C=w(C,F,I,L),B&&(z=g(z,F,I,L)),U=b(C)}for(var X=Array(x).fill(0),Z=0;Z<x;Z++)X[Z]=C[Z][Z];return A(Ie(X),z,B)}function m(C,T,B){var x=C.length,R=i(T/x),F,z;if(B){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(C);i(U[1])>=i(R);){var I=U[0][0],L=U[0][1];F=p(C[I][I],C[L][L],C[I][L]),C=D(C,F,I,L),B&&(z=y(z,F,I,L)),U=E(C)}for(var X=Array(x).fill(0),Z=0;Z<x;Z++)X[Z]=C[Z][Z];return A(Ie(X),z,B)}function S(C,T,B){var x=T-C;return Math.abs(x)<=t.relTol?Math.PI/4:.5*Math.atan(2*B/(T-C))}function p(C,T,B){var x=r(T,C);return i(x)<=t.relTol?c(-1).acos().div(4):l(.5,a(f(2,B,s(x))))}function g(C,T,B,x){for(var R=C.length,F=Math.cos(T),z=Math.sin(T),N=Array(R).fill(0),U=Array(R).fill(0),I=0;I<R;I++)N[I]=F*C[I][B]-z*C[I][x],U[I]=z*C[I][B]+F*C[I][x];for(var L=0;L<R;L++)C[L][B]=N[L],C[L][x]=U[L];return C}function y(C,T,B,x){for(var R=C.length,F=o(T),z=u(T),N=Array(R).fill(c(0)),U=Array(R).fill(c(0)),I=0;I<R;I++)N[I]=r(l(F,C[I][B]),l(z,C[I][x])),U[I]=n(l(z,C[I][B]),l(F,C[I][x]));for(var L=0;L<R;L++)C[L][B]=N[L],C[L][x]=U[L];return C}function D(C,T,B,x){for(var R=C.length,F=c(o(T)),z=c(u(T)),N=l(F,F),U=l(z,z),I=Array(R).fill(c(0)),L=Array(R).fill(c(0)),X=f(c(2),F,z,C[B][x]),Z=n(r(l(N,C[B][B]),X),l(U,C[x][x])),P=d(l(U,C[B][B]),X,l(N,C[x][x])),j=0;j<R;j++)I[j]=r(l(F,C[B][j]),l(z,C[x][j])),L[j]=n(l(z,C[B][j]),l(F,C[x][j]));C[B][B]=Z,C[x][x]=P,C[B][x]=c(0),C[x][B]=c(0);for(var Y=0;Y<R;Y++)Y!==B&&Y!==x&&(C[B][Y]=I[Y],C[Y][B]=I[Y],C[x][Y]=L[Y],C[Y][x]=L[Y]);return C}function w(C,T,B,x){for(var R=C.length,F=Math.cos(T),z=Math.sin(T),N=F*F,U=z*z,I=Array(R).fill(0),L=Array(R).fill(0),X=N*C[B][B]-2*F*z*C[B][x]+U*C[x][x],Z=U*C[B][B]+2*F*z*C[B][x]+N*C[x][x],P=0;P<R;P++)I[P]=F*C[B][P]-z*C[x][P],L[P]=z*C[B][P]+F*C[x][P];C[B][B]=X,C[x][x]=Z,C[B][x]=0,C[x][B]=0;for(var j=0;j<R;j++)j!==B&&j!==x&&(C[B][j]=I[j],C[j][B]=I[j],C[x][j]=L[j],C[j][x]=L[j]);return C}function b(C){for(var T=C.length,B=0,x=[0,1],R=0;R<T;R++)for(var F=R+1;F<T;F++)Math.abs(B)<Math.abs(C[R][F])&&(B=Math.abs(C[R][F]),x=[R,F]);return[x,B]}function E(C){for(var T=C.length,B=0,x=[0,1],R=0;R<T;R++)for(var F=R+1;F<T;F++)i(B)<i(C[R][F])&&(B=i(C[R][F]),x=[R,F]);return[x,B]}function A(C,T,B){var x=C.length,R=Array(x),F;if(B){F=Array(x);for(var z=0;z<x;z++)F[z]=Array(x)}for(var N=0;N<x;N++){for(var U=0,I=C[0],L=0;L<C.length;L++)i(C[L])<i(I)&&(U=L,I=C[U]);if(R[N]=C.splice(U,1)[0],B)for(var X=0;X<x;X++)F[N][X]=T[X][U],T[X].splice(U,1)}if(!B)return{values:R};var Z=F.map((P,j)=>({value:R[j],vector:P}));return{values:R,eigenvectors:Z}}return h}var v5="eigs",y5=["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"],b5=ce(v5,y5,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:S,larger:p,column:g,flatten:y,number:D,complex:w,sqrt:b,diag:E,size:A,reshape:C,qr:T,usolve:B,usolveAll:x,im:R,re:F,smaller:z,matrixFromColumns:N,dot:U}=e,I=g5({config:t,addScalar:i,subtract:a,abs:u,atan:l,cos:s,sin:c,multiplyScalar:f,inv:h,bignumber:v,multiply:m,add:S}),L=p5({addScalar:i,subtract:a,multiply:m,multiplyScalar:f,flatten:y,divideScalar:d,sqrt:b,abs:u,bignumber:v,diag:E,size:A,reshape:C,qr:T,inv:h,usolve:B,usolveAll:x,equal:o,complex:w,larger:p,smaller:z,matrixFromColumns:N,dot:U});return n("eigs",{Array:function(V){return X(r(V))},"Array, number|BigNumber":function(V,te){return X(r(V),{precision:te})},"Array, Object"(q,V){return X(r(q),V)},Matrix:function(V){return X(V,{matricize:!0})},"Matrix, number|BigNumber":function(V,te){return X(V,{precision:te,matricize:!0})},"Matrix, Object":function(V,te){var W={matricize:!0};return Ci(W,te),X(V,W)}});function X(q){var V,te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},W="eigenvectors"in te?te.eigenvectors:!0,ne=(V=te.precision)!==null&&V!==void 0?V:t.relTol,fe=Z(q,ne,W);return te.matricize&&(fe.values=r(fe.values),W&&(fe.eigenvectors=fe.eigenvectors.map(ee=>{var{value:le,vector:se}=ee;return{value:le,vector:r(se)}}))),W&&Object.defineProperty(fe,"vectors",{enumerable:!1,get:()=>{throw new Error("eigs(M).vectors replaced with eigs(M).eigenvectors")}}),fe}function Z(q,V,te){var W=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 fe=ne[0];if(j(W,fe,V)&&(Y(W,fe),P(W,fe,V))){var ee=$(q,W,fe);return I(W,fe,V,ee,te)}var le=$(q,W,fe);return L(W,fe,V,le,te)}function P(q,V,te){for(var W=0;W<V;W++)for(var ne=W;ne<V;ne++)if(p(v(u(a(q[W][ne],q[ne][W]))),te))return!1;return!0}function j(q,V,te){for(var W=0;W<V;W++)for(var ne=0;ne<V;ne++)if(p(v(u(R(q[W][ne]))),te))return!1;return!0}function Y(q,V){for(var te=0;te<V;te++)for(var W=0;W<V;W++)q[te][W]=F(q[te][W])}function $(q,V,te){var W=q.datatype();if(W==="number"||W==="BigNumber"||W==="Complex")return W;for(var ne=!1,fe=!1,ee=!1,le=0;le<te;le++)for(var se=0;se<te;se++){var De=V[le][se];if(et(De)||gh(De))ne=!0;else if(vt(De))fe=!0;else if(ph(De))ee=!0;else throw TypeError("Unsupported type in Matrix: "+Fn(De))}if(fe&&ee&&console.warn("Complex BigNumbers not supported, this operation will lose precission."),ee){for(var be=0;be<te;be++)for(var xe=0;xe<te;xe++)V[be][xe]=w(V[be][xe]);return"Complex"}if(fe){for(var we=0;we<te;we++)for(var Re=0;Re<te;Re++)V[we][Re]=v(V[we][Re]);return"BigNumber"}if(ne){for(var Ce=0;Ce<te;Ce++)for(var Be=0;Be<te;Be++)V[Ce][Be]=D(V[Ce][Be]);return"number"}else throw TypeError("Matrix contains unsupported types only.")}}),D5="divide",S5=["typed","matrix","multiply","equalScalar","divideScalar","inv"],x5=ce(D5,S5,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",w5=["typed","add","divide"],E5=ce(CD,w5,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=z3({config:Wt}),vc=L3({}),$h=X3({}),kh=K3({}),gn=hT({Matrix:kh}),ve=$C({BigNumber:Gu,Complex:vc,DenseMatrix:gn,Fraction:$h}),Yu=QT({typed:ve}),bo=WT({typed:ve}),A5=W4({typed:ve}),Lh=kT({Complex:vc,typed:ve}),yc=LM({typed:ve}),C5=e5({typed:ve}),Sr=AT({config:Wt,typed:ve}),TD=WM({typed:ve}),T5=e4({typed:ve}),M5=HM({typed:ve}),MD=gT({typed:ve}),_5=yT({config:Wt,typed:ve}),_D=DT({equalScalar:Sr,typed:ve}),Do=TM({typed:ve}),jh=RT({typed:ve}),B5=qM({typed:ve}),F5=FM({BigNumber:Gu,Fraction:$h,complex:Lh,typed:ve}),N5=n5({typed:ve}),Xr=MT({Matrix:kh,equalScalar:Sr,typed:ve}),Xu=eM({typed:ve}),Zu=UT({BigNumber:Gu,typed:ve}),R5=xT({typed:ve}),ze=qT({DenseMatrix:gn,Matrix:kh,SparseMatrix:Xr,typed:ve}),O5=u4({isInteger:MD,matrix:ze,typed:ve}),Hh=OM({Complex:vc,config:Wt,typed:ve}),z5=f4({matrix:ze,typed:ve}),U5=p4({BigNumber:Gu,config:Wt,matrix:ze,typed:ve}),oa=GM({isInteger:MD,matrix:ze,typed:ve}),I5=h4({conj:yc,transpose:z5,typed:ve}),$5=QM({DenseMatrix:gn,SparseMatrix:Xr,matrix:ze,typed:ve}),BD=M4({DenseMatrix:gn,SparseMatrix:Xr,concat:oa,equalScalar:Sr,matrix:ze,typed:ve}),FD=HT({Fraction:$h,typed:ve}),Ph=n4({BigNumber:Gu,DenseMatrix:gn,SparseMatrix:Xr,config:Wt,matrix:ze,typed:ve}),k5=L4({DenseMatrix:gn,SparseMatrix:Xr,concat:oa,config:Wt,matrix:ze,typed:ve}),ND=y4({bignumber:Zu,fraction:FD,number:jh}),qh=s4({matrix:ze,config:Wt,typed:ve}),Qu=F4({DenseMatrix:gn,SparseMatrix:Xr,bignumber:Zu,concat:oa,config:Wt,matrix:ze,typed:ve}),bc=XT({typed:ve}),Dc=i5({DenseMatrix:gn,SparseMatrix:Xr,addScalar:bo,concat:oa,equalScalar:Sr,matrix:ze,typed:ve}),ua=D4({numeric:ND,typed:ve}),L5=G4({DenseMatrix:gn,smaller:Qu}),j5=Z4({ImmutableDenseMatrix:L5,getMatrixDataType:T5}),Vh=I4({DenseMatrix:gn,SparseMatrix:Xr,bignumber:Zu,concat:oa,config:Wt,matrix:ze,typed:ve}),H5=GT({flatten:TD,matrix:ze,size:qh,typed:ve}),P5=P4({config:Wt,isNaN:R5,numeric:ND,smaller:Qu,typed:ve}),q5=c5({addScalar:bo,complex:Lh,conj:yc,divideScalar:ua,equal:BD,identity:Ph,isZero:_D,matrix:ze,multiplyScalar:Do,sign:F5,sqrt:Hh,subtractScalar:Xu,typed:ve,unaryMinus:bc,zeros:U5}),V5=O4({DenseMatrix:gn,SparseMatrix:Xr,concat:oa,config:Wt,matrix:ze,typed:ve}),G5=UM({DenseMatrix:gn,concat:oa,equalScalar:Sr,matrix:ze,subtractScalar:Xu,typed:ve,unaryMinus:bc}),Y5=E4({DenseMatrix:gn,divideScalar:ua,equalScalar:Sr,matrix:ze,multiplyScalar:Do,subtractScalar:Xu,typed:ve}),RD=l5({addScalar:bo,conj:yc,multiplyScalar:Do,size:qh,typed:ve}),Oi=_M({addScalar:bo,dot:RD,equalScalar:Sr,matrix:ze,multiplyScalar:Do,typed:ve}),X5=a4({bignumber:Zu,matrix:ze,add:Dc,config:Wt,isPositive:_5,larger:Vh,largerEq:k5,smaller:Qu,smallerEq:V5,typed:ve}),Z5=C4({DenseMatrix:gn,divideScalar:ua,equalScalar:Sr,matrix:ze,multiplyScalar:Do,subtractScalar:Xu,typed:ve}),Q5=XM({Index:j5,matrix:ze,range:X5,typed:ve}),K5=d5({divideScalar:ua,isZero:_D,matrix:ze,multiply:Oi,subtractScalar:Xu,typed:ve,unaryMinus:bc}),Gh=m5({abs:Yu,addScalar:bo,det:K5,divideScalar:ua,identity:Ph,matrix:ze,multiply:Oi,typed:ve,unaryMinus:bc}),W5=x4({Complex:vc,config:Wt,fraction:FD,identity:Ph,inv:Gh,matrix:ze,multiply:Oi,number:jh,typed:ve}),J5=x5({divideScalar:ua,equalScalar:Sr,inv:Gh,matrix:ze,multiply:Oi,typed:ve}),e_=b5({abs:Yu,add:Dc,addScalar:bo,atan:A5,bignumber:Zu,column:Q5,complex:Lh,config:Wt,cos:C5,diag:$5,divideScalar:ua,dot:RD,equal:BD,flatten:TD,im:M5,inv:Gh,larger:Vh,matrix:ze,matrixFromColumns:H5,multiply:Oi,multiplyScalar:Do,number:jh,qr:q5,re:B5,reshape:O5,sin:N5,size:qh,smaller:Qu,sqrt:Hh,subtract:G5,typed:ve,usolve:Y5,usolveAll:Z5}),t_=E5({add:Dc,divide:J5,typed:ve}),OD=o5({abs:Yu,add:Dc,conj:yc,ctranspose:I5,eigs:e_,equalScalar:Sr,larger:Vh,matrix:ze,multiply:Oi,pow:W5,smaller:Qu,sqrt:Hh,typed:ve});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),n_=(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()},r_=(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 r_(i,a)},i_="rgba(196, 196, 196, 0.5)",$D="COMPUTE_DRAG",kD="END_DRAG",LD="RESET_DRAG",a_="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:a_,mouseButtonIsDown:r,point:n,shift:i}},o_=(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}`)}},u_=(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??i_,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},l_=(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},s_=(e,t)=>{const{nextDragStateUpdate:n,reducer:r,reducerOtherProps:i}=t;n.current=null,r({...i,dragAction:{type:LD}})},c_=(e,t)=>{const{nextDragStateUpdate:n,reducer:r,reducerOtherProps:i}=t;n.current=null,r({...i,dragAction:{...jD(e),type:kD}})},f_=e=>{const{width:t,height:n,newState:r,dragStyle:i}=e,a=M.useRef(null),o=M.useMemo(()=>_.jsx("canvas",{ref:a,width:t,height:n,style:{position:"absolute",left:0,top:0}}),[t,n]);return u_(a,r,i),o},d_=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]]},h_=(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)},m_=e=>_.jsx(ir,{width:e.width,height:e.height,draw:h_,drawData:e}),p_={},g_=({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,A=o-b.top-b.bottom,C=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+A*(1-x.height/s),y2:b.top+A,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,B=n?n.map(x=>({x:b.left+(x.x-u)/(l-u)*E,color:x.color})):void 0;return{barBoxes:C,margins:b,pixelTicks:T,pixelVerticalLines:B}},[e,t,n,u,l,s,a,o,r]),v=M.useCallback((b,{ctrlKey:E,shiftKey:A})=>{const C=[],T={x:b[0],y:b[1],width:b[2],height:b[3]};for(const B of c)B.x1<=T.x+T.width&&B.x2>=T.x&&C.push(B.key);i&&i(T,C,{ctrlKey:E,shiftKey:A})},[c,i]),m=M.useCallback(()=>{},[]),{onMouseMove:S,onMouseDown:p,onMouseUp:g,onMouseLeave:y,paintDragSelectLayer:D}=Hs(a,o,v,m),w=M.useMemo(()=>_.jsx(ir,{width:a,height:o,draw:D,drawData:p_}),[a,o,D]);return _.jsxs("div",{style:{width:a,height:o,position:"relative"},onMouseDown:p,onMouseMove:S,onMouseUp:g,onMouseLeave:y,children:[_.jsx(m_,{barBoxes:c,margins:f,pixelTicks:d,pixelVerticalLines:h,xLabel:r,width:a,height:o}),w]})},v_=(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}},y_=({children:e,width:t,height:n})=>{const{elementRef:r,isVisible:i}=v_({threshold:.1});return _.jsx("div",{ref:r,style:{position:"relative",width:t,height:n},children:i?e:_.jsx("span",{children:"Not visible"})})},b_=()=>{},D_=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 _.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"),_.jsx("div",{style:{flex:"0 0 auto"},children:_.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=_.jsx("div",{"data-key":f.key,onClick:f.clickHandler||b_,children:_.jsx(y_,{width:f.props.width,height:f.props.height,children:_.jsxs("span",{children:[f.label!==void 0&&_.jsx("div",{className:"plotLabelStyle",style:{maxWidth:f.props.width,height:d,userSelect:"none"},children:_.jsx("span",{style:{color:f.labelColor},children:f.label||_.jsx("span",{children:" "})})}),_.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 _.jsx("div",{className:"PlotGrid",style:{display:"flex",flexDirection:"column"},children:l.map(c=>_.jsx(D_,{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 _.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),S_=["attr","size","title"];function x_(e,t){if(e==null)return{};var n=w_(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 w_(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){E_(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 E_(e,t,n){return t=A_(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function A_(e){var t=C_(e,"string");return typeof t=="symbol"?t:t+""}function C_(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(T_,Ec({attr:Ac({},e.attr)},t),GD(e.child))}function T_(e){var t=n=>{var{attr:r,size:i,title:a}=e,o=x_(e,S_),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 M_(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 __(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 B_(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 F_(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 N_(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 R_(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 O_=0,z_=1,Qh;const wr=e=>{Qh===void 0&&(Qh=ZD.length);const t=(O_+e*z_)%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"},U_={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 I_="$$material";function $_(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 k_(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 L_=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(k_(this));var i=this.tags[this.tags.length-1];if(this.isSpeedy){var a=$_(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",j_="@import",KD="@keyframes",H_="@layer",P_=Math.abs,_c=String.fromCharCode,q_=Object.assign;function V_(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 G_(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 Y_(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 q_(Nc("",null,null,"",null,null,0),e,{length:-e.length},t)}function X_(){return Bt}function Z_(){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 Q_(e){for(;(Bt=Ar())&&Bt<33;)Nn();return nl(e)>2||nl(Bt)>3?"":" "}function K_(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 W_(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 J_(e){for(;!nl(Ar());)Nn();return tl(e,vn)}function e8(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,S=1,p=1,g=0,y="",D=i,w=a,b=r,E=y;S;)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+=Q_(v);break;case 92:E+=K_(Rc()-1,7);continue;case 47:switch(Ar()){case 42:case 47:Bc(t8(W_(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:S=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,D=[],w=[],f),a),g===123)if(c===0)zc(E,t,b,b,D,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,D=[],f),w),i,w,f,u,r?D: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&&Z_()==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+=J_(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,S=0;v<r;++v)for(var p=0,g=Ju(e,f+1,f=P_(m=o[v])),y=e;p<h;++p)(y=WD(m>0?d[p]+" "+g:He(g,/&\f/g,d[p])))&&(l[S++]=y);return Nc(e,t,n,i===0?Kh:u,l,s,c)}function t8(e,t,n){return Nc(e,t,n,QD,_c(X_()),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 n8(e,t,n,r){switch(e.type){case H_:if(e.children.length)break;case j_: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 r8(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 i8(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 a8=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)},o8=function(t,n){var r=-1,i=44;do switch(nl(i)){case 0:i===38&&Ar()===12&&(n[r]=1),t[r]+=a8(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},u8=function(t,n){return t2(o8(e2(t),n))},a2=new WeakMap,l8=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=u8(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]}}},s8=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(V_(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 c8=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 Y_(t.props,function(a){switch(G_(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""})}},f8=[c8],d8=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 S=m.getAttribute("data-emotion");S.indexOf(" ")!==-1&&(document.head.appendChild(m),m.setAttribute("data-s",""))})}var i=t.stylisPlugins||f8,a={},o,u=[];o=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(m){for(var S=m.getAttribute("data-emotion").split(" "),p=1;p<S.length;p++)a[S[p]]=!0;u.push(m)});var l,s=[l8,s8];{var c,f=[n8,i8(function(m){c.insert(m)})],d=r8(s.concat(i,f)),h=function(S){return Mo(e8(S),d)};l=function(S,p,g,y){c=g,h(S?S+"{"+p.styles+"}":p.styles),y&&(v.inserted[p.name]=!0)}}var v={key:n,sheet:new L_({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
68
68
  * react-is.production.min.js
69
69
  *
70
70
  * Copyright (c) Facebook, Inc. and its affiliates.
71
71
  *
72
72
  * This source code is licensed under the MIT license found in the
73
73
  * LICENSE file in the root directory of this source tree.
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={};/**
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,h8=qt?Symbol.for("react.suspense_list"):60120,qc=qt?Symbol.for("react.memo"):60115,Vc=qt?Symbol.for("react.lazy"):60116,m8=qt?Symbol.for("react.block"):60121,p8=qt?Symbol.for("react.fundamental"):60117,g8=qt?Symbol.for("react.responder"):60118,v8=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===h8||typeof e=="object"&&e!==null&&(e.$$typeof===Vc||e.$$typeof===qc||e.$$typeof===kc||e.$$typeof===Lc||e.$$typeof===Hc||e.$$typeof===p8||e.$$typeof===g8||e.$$typeof===v8||e.$$typeof===m8)},Ge.typeOf=Rn,u2.exports=Ge;var y8=u2.exports,s2=y8,b8={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},D8={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},c2={};c2[s2.ForwardRef]=b8,c2[s2.Memo]=D8;var S8=!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||S8===!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 x8(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 w8={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},E8=/[A-Z]|^ms/g,A8=/_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(E8,"-$&").toLowerCase()}),p2=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(A8,function(r,i,a){return Cr={name:i,styles:a,next:Cr},i})}return w8[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 C8(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 C8(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=x8(i)+s;return{name:f,styles:i,next:Cr}}var T8=function(t){return t()},M8=Lf.useInsertionEffect?Lf.useInsertionEffect:!1,v2=M8||T8,y2=M.createContext(typeof HTMLElement<"u"?d8({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__",_8=function(t,n){var r={};for(var i in n)um.call(n,i)&&(r[i]=n[i]);return r[lm]=t,r},B8=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},F8=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(B8,{cache:t,serialized:u,isStringTag:typeof i=="string"}),M.createElement(i,l))}),N8=F8,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]=N8,a[1]=_8(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 R8=/^((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)-.*))$/,O8=i2(function(e){return R8.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),z8=O8,U8=function(t){return t!=="theme"},x2=function(t){return typeof t=="string"&&t.charCodeAt(0)>96?z8:U8},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},I8=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},$8=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(S,p,g){var y=s&&S.as||i,D="",w=[],b=S;if(S.theme==null){b={};for(var E in S)b[E]=S[E];b.theme=M.useContext(D2)}typeof S.className=="string"?D=f2(p.registered,w,S.className):S.className!=null&&(D=S.className+" ");var A=Gc(f.concat(w),p.registered,b);D+=p.key+"-"+A.name,o!==void 0&&(D+=" "+o);var C=s&&u===void 0?x2(y):l,T={};for(var B in S)s&&B==="as"||C(B)&&(T[B]=S[B]);return T.className=D,g&&(T.ref=g),M.createElement(M.Fragment,null,M.createElement(I8,{cache:p,serialized:A,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(S,p){var g=e(S,Ci({},n,p,{shouldForwardProp:w2(m,p,!0)}));return g.apply(void 0,f)},m}},k8=["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=$8.bind(null);k8.forEach(function(e){cm[e]=cm(e)});function L8(e,t){return cm(e,t)}function j8(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={};/**
75
75
  * @license React
76
76
  * react-is.production.js
77
77
  *
@@ -79,14 +79,14 @@ R: `+this.R.toString()}}}function p(y){var S=D(y),w=S.R._data;if(y._data.length>
79
79
  *
80
80
  * This source code is licensed under the MIT license found in the
81
81
  * LICENSE file in the root directory of this source tree.
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';
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"),H8=Symbol.for("react.view_transition"),P8=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 H8: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===P8||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 q8=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 V8(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:r=5,...i}=e,a=q8(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 G8(e,t){return t==="@"||t.startsWith("@")&&(e.some(n=>t.startsWith(`@${n}`))||!!t.match(/^@\d/))}function Y8(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 X8(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 Z8={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)`},Q8={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(G8(a.keys,u)){const l=Y8(r.containerQueries?r:Q8,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 K8(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 W8(e){const t={};return n=>(t[n]===void 0&&(t[n]=e(n)),t[n])}const J8={m:"margin",p:"padding"},e6={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},F2={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},t6=W8(e=>{if(e.length>2)if(F2[e])e=F2[e];else return[e];const[t,n]=e.split(""),r=J8[t],i=e6[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 n6(e,t){return n=>e.reduce((r,i)=>(r[i]=ul(t,n),r),{})}function r6(e,t,n,r){if(!t.includes(n))return null;const i=t6(n),a=n6(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=>r6(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 i6=Jn("border",Wn),a6=Jn("borderTop",Wn),o6=Jn("borderRight",Wn),u6=Jn("borderBottom",Wn),l6=Jn("borderLeft",Wn),s6=Jn("borderColor"),c6=Jn("borderTopColor"),f6=Jn("borderRightColor"),d6=Jn("borderBottomColor"),h6=Jn("borderLeftColor"),m6=Jn("outline",Wn),p6=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(i6,a6,o6,u6,l6,s6,c6,f6,d6,h6,lf,m6,p6);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 g6=Tt({prop:"gridColumn"}),v6=Tt({prop:"gridRow"}),y6=Tt({prop:"gridAutoFlow"}),b6=Tt({prop:"gridAutoColumns"}),D6=Tt({prop:"gridAutoRows"}),S6=Tt({prop:"gridTemplateColumns"}),x6=Tt({prop:"gridTemplateRows"}),w6=Tt({prop:"gridTemplateAreas"}),E6=Tt({prop:"gridArea"});uf(sf,cf,ff,g6,v6,y6,b6,D6,S6,x6,w6,E6);function _o(e,t){return t==="grey"?t:e}const A6=Tt({prop:"color",themeKey:"palette",transform:_o}),C6=Tt({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:_o}),T6=Tt({prop:"backgroundColor",themeKey:"palette",transform:_o});uf(A6,C6,T6);function zn(e){return e<=1&&e!==0?`${e*100}%`:e}const M6=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 _6=Tt({prop:"minWidth",transform:zn}),B6=Tt({prop:"height",transform:zn}),F6=Tt({prop:"maxHeight",transform:zn}),N6=Tt({prop:"minHeight",transform:zn});Tt({prop:"size",cssProperty:"width",transform:zn}),Tt({prop:"size",cssProperty:"height",transform:zn});const R6=Tt({prop:"boxSizing"});uf(M6,gm,_6,B6,F6,N6,R6);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 O6(...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 z6(e,t){return typeof e=="function"?e(t):e}function U6(){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=K8(i.breakpoints),f=Object.keys(c);let d=c;return Object.keys(s).forEach(h=>{const v=z6(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,S=>({[h]:S}));O6(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=U6();Bo.filterProps=["sx"];function I6(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=V8(n),l=R2(i);let s=On({breakpoints:u,direction:"ltr",components:{},palette:{mode:"light",...r},spacing:l,shape:{...Z8,...a}},o);return s=X8(s),s.applyStyles=I6,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,$6=(()=>{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 k6={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=k6[t];return r?`${n}-${r}`:`${$6.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 L6=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 j6(e){return e?(t,n)=>n[e]:null}function H6(e,t,n){e.theme=V6(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 P6(e={}){const{themeId:t,defaultTheme:n=L6,rootShouldForwardProp:r=vm,slotShouldForwardProp:i=vm}=e;function a(u){H6(u,t,n)}return(u,l={})=>{j8(u,b=>b.filter(E=>E!==Bo));const{name:s,slot:c,skipVariantsResolver:f,skipSx:d,overridesResolver:h=j6(Y6(c)),...v}=l,m=s&&s.startsWith("Mui")||c?"components":"custom",S=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:G6(u)&&(g=void 0);const y=L8(u,{shouldForwardProp:g,label:q6(),...v}),D=b=>{if(b.__emotion_real===b)return b;if(typeof b=="function")return function(A){return hf(A,b,A.theme.modularCssLayers?m:void 0)};if(Zr(b)){const E=I2(b);return function(C){return E.variants?hf(C,E,C.theme.modularCssLayers?m:void 0):C.theme.modularCssLayers?ca(E.style,m):E.style}}return b},w=(...b)=>{const E=[],A=b.map(D),C=[];if(E.push(a),s&&h&&C.push(function(R){const z=R.theme.components?.[s]?.styleOverrides;if(!z)return null;const N={};for(const U in z)N[U]=hf(R,z[U],R.theme.modularCssLayers?"theme":void 0);return h(R,N)}),s&&!S&&C.push(function(R){const z=R.theme?.components?.[s]?.variants;return z?$2(R,z,[],R.theme.modularCssLayers?"theme":void 0):null}),p||C.push(Bo),Array.isArray(A[0])){const x=A.shift(),R=new Array(E.length).fill(""),F=new Array(C.length).fill("");let z;z=[...R,...x,...F],z.raw=[...R,...x.raw,...F],E.unshift(z)}const T=[...E,...A,...C],B=y(...T);return u.muiName&&(B.muiName=u.muiName),B};return y.withConfig&&(w.withConfig=y.withConfig),w}}function q6(e,t){return void 0}function V6(e){for(const t in e)return!1;return!0}function G6(e){return typeof e=="string"&&e.charCodeAt(0)>96}function Y6(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 X6=typeof window<"u"?M.useLayoutEffect:M.useEffect;function Z6(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 Z6(e,t,n)}function Q6(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(Q6(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 K6=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 K6(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 W6(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 J6(e,t=.15){return Dm(e)>.5?pf(e,t):gf(e,t)}function vf(e,t,n){try{return J6(e,t)}catch{return e}}const e9=M.createContext(void 0);function t9(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 n9({props:e,name:t}){const n=M.useContext(e9);return t9({props:e,name:t,theme:{components:n}})}let j2=0;function r9(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 i9(e){if(H2!==void 0){const t=H2();return e??t}return r9(e)}const P2={theme:void 0};function a9(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 o9(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])})},u9=(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)},l9=(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 u9(e,(u,l,s)=>{if((typeof l=="string"||typeof l=="number")&&(!r||!r(u,l))){const c=`--${n?`${n}-`:""}${u.join("-")}`,f=l9(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 s9(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,...S}=o;if(Object.entries(S||{}).forEach(([D,w])=>{const{vars:b,css:E,varsWithDefaults:A}=Sm(w,t);h=On(h,A),v[D]={css:E,vars:b}}),m){const{css:D,vars:w,varsWithDefaults:b}=Sm(m,t);h=On(h,b),v[l]={css:D,vars:w}}function p(D,w){let b=i;if(i==="class"&&(b=".%s"),i==="data"&&(b="[data-%s]"),i?.startsWith("data-")&&!i.includes("%s")&&(b=`[${i}="%s"]`),D){if(b==="media")return e.defaultColorScheme===D?":root":{[`@media (prefers-color-scheme: ${o[D]?.palette?.mode||D})`]:{":root":w}};if(b)return e.defaultColorScheme===D?`:root, ${b.replace("%s",String(D))}`:b.replace("%s",String(D))}return":root"}return{vars:h,generateThemeVars:()=>{let D={...c};return Object.entries(v).forEach(([,{vars:w}])=>{D=On(D,w)}),D},generateStyleSheets:()=>{const D=[],w=e.defaultColorScheme||"light";function b(C,T){Object.keys(T).length&&D.push(typeof C=="string"?{[C]:{...T}}:C)}b(n(void 0,{...f}),f);const{[w]:E,...A}=v;if(E){const{css:C}=E,T=o[w]?.palette?.mode,B=!r&&T?{colorScheme:T,...C}:{...C};b(n(w,{...B}),B)}return Object.entries(A).forEach(([C,{css:T}])=>{const B=o[C]?.palette?.mode,x=!r&&B?{colorScheme:B,...T}:{...T};b(n(C,{...x}),x)}),a&&D.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)"}}),D}}}function c9(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 f9(e="light"){return e==="dark"?{main:wo[200],light:wo[50],dark:wo[400]}:{main:wo[700],light:wo[400],dark:wo[800]}}function d9(e="light"){return e==="dark"?{main:xo[200],light:xo[50],dark:xo[400]}:{main:xo[500],light:xo[300],dark:xo[700]}}function h9(e="light"){return e==="dark"?{main:So[500],light:So[300],dark:So[700]}:{main:So[700],light:So[400],dark:So[800]}}function m9(e="light"){return e==="dark"?{main:Eo[400],light:Eo[300],dark:Eo[700]}:{main:Eo[700],light:Eo[500],dark:Eo[900]}}function p9(e="light"){return e==="dark"?{main:Ao[400],light:Ao[300],dark:Ao[700]}:{main:Ao[800],light:Ao[500],dark:Ao[900]}}function g9(e="light"){return e==="dark"?{main:Wu[400],light:Wu[300],dark:Wu[700]}:{main:"#ed6c02",light:Wu[500],dark:Wu[900]}}function v9(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||f9(t),u=e.secondary||d9(t),l=e.error||h9(t),s=e.info||m9(t),c=e.success||p9(t),f=e.warning||g9(t);function d(S){return i?v9(S):W6(S,xm.text.primary)>=n?xm.text.primary:G2.text.primary}const h=({color:S,name:p,mainShade:g=500,lightShade:y=300,darkShade:D=700})=>{if(S={...S},!S.main&&S[g]&&(S.main=S[g]),!S.hasOwnProperty("main"))throw new Error(la(11,p?` (${p})`:"",g));if(typeof S.main!="string")throw new Error(la(12,p?` (${p})`:"",JSON.stringify(S.main)));return i?(Z2(i,S,"light",y,r),Z2(i,S,"dark",D,r)):(X2(S,"light",y,r),X2(S,"dark",D,r)),S.contrastText||(S.contrastText=d(S.main)),S};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:U_,contrastThreshold:n,getContrastText:d,augmentColor:h,tonalOffset:r,...v},a)}function y9(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 b9(e,t){return{toolbar:{minHeight:56,[e.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[e.up("sm")]:{minHeight:64}},...t}}function D9(e){return Math.round(e*1e5)/1e5}const Q2={textTransform:"uppercase"},K2='"Roboto", "Helvetica", "Arial", sans-serif';function S9(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||(S=>`${S/l*d}rem`),v=(S,p,g,y,D)=>({fontFamily:n,fontWeight:S,fontSize:h(p),lineHeight:g,...n===K2?{letterSpacing:`${D9(y/p)}em`}:{},...D,...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 x9=.2,w9=.14,E9=.12;function pt(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${x9})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${w9})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${E9})`].join(",")}const A9=["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)],C9={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)"},T9={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function W2(e){return`${Math.round(e)}ms`}function M9(e){if(!e)return 0;const t=e/36;return Math.min(Math.round((4+15*t**.25+t/5)*10),3e3)}function _9(e){const t={...C9,...e.easing},n={...T9,...e.duration};return{getAutoHeightDuration:M9,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 B9={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function F9(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];!F9(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';
83
83
 
84
84
  const theme = ${JSON.stringify(t,null,2)};
85
85
 
86
86
  theme.breakpoints = createBreakpoints(theme.breakpoints || {});
87
87
  theme.transitions = createTransitions(theme.transitions || {});
88
88
 
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`
89
+ export default theme;`}function eS(e){return typeof e=="number"?`${(e*100).toFixed(0)}%`:`calc((${e}) * 100%)`}const N9=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 R9(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,N9(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:b9(d.breakpoints,r),palette:f,shadows:A9.slice(),typography:S9(f,u),transitions:_9(o),zIndex:{...B9}});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,R9(h),h}function O9(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 z9=[...Array(25)].map((e,t)=>{if(t===0)return"none";const n=O9(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"?z9:[]}function U9(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 I9(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 $9=e=>[...[...Array(25)].map((t,n)=>`--${e?`${e}-`:""}overlays-${n}`),`--${e?`${e}-`:""}palette-AppBar-darkBg`,`--${e?`${e}-`:""}palette-AppBar-darkColor`],k9=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 $9(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 L9(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 j9(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{}},H9=(e="mui")=>o9(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]=U9({...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 P9(e={},...t){const{colorSchemes:n={light:!0},defaultColorScheme:r,disableCssColorScheme:i=!1,cssVarPrefix:a="mui",nativeColor:o=!1,shouldSkipGeneratingVar:u=I9,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=H9(a),{[d]:v,light:m,dark:S,...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 D;o&&(D="oklch");const w=Am(D,g,y,c,d);m&&!g.light&&Am(D,g,m,void 0,"light"),S&&!g.dark&&Am(D,g,S,void 0,"dark");let b={defaultColorScheme:d,...w,cssVarPrefix:a,colorSchemeSelector:l,rootSelector:s,getCssVar:h,colorSchemes:g,font:{...y9(w.typography),...w.font},spacing:j9(c.spacing)};Object.keys(b.colorSchemes).forEach(B=>{const x=b.colorSchemes[B].palette,R=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 F(z,N,U){if(D){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 ${D}, ${N}, ${I})`}return z(N,U)}if(L9(x,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),x.mode==="light"){K(x.Alert,"errorColor",F(Ye,x.error.light,.6)),K(x.Alert,"infoColor",F(Ye,x.info.light,.6)),K(x.Alert,"successColor",F(Ye,x.success.light,.6)),K(x.Alert,"warningColor",F(Ye,x.warning.light,.6)),K(x.Alert,"errorFilledBg",R("palette-error-main")),K(x.Alert,"infoFilledBg",R("palette-info-main")),K(x.Alert,"successFilledBg",R("palette-success-main")),K(x.Alert,"warningFilledBg",R("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",F(Xe,x.error.light,.9)),K(x.Alert,"infoStandardBg",F(Xe,x.info.light,.9)),K(x.Alert,"successStandardBg",F(Xe,x.success.light,.9)),K(x.Alert,"warningStandardBg",F(Xe,x.warning.light,.9)),K(x.Alert,"errorIconColor",R("palette-error-main")),K(x.Alert,"infoIconColor",R("palette-info-main")),K(x.Alert,"successIconColor",R("palette-success-main")),K(x.Alert,"warningIconColor",R("palette-warning-main")),K(x.AppBar,"defaultBg",R("palette-grey-100")),K(x.Avatar,"defaultBg",R("palette-grey-400")),K(x.Button,"inheritContainedBg",R("palette-grey-300")),K(x.Button,"inheritContainedHoverBg",R("palette-grey-A100")),K(x.Chip,"defaultBorder",R("palette-grey-400")),K(x.Chip,"defaultAvatarColor",R("palette-grey-700")),K(x.Chip,"defaultIconColor",R("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",F(Xe,x.primary.main,.62)),K(x.LinearProgress,"secondaryBg",F(Xe,x.secondary.main,.62)),K(x.LinearProgress,"errorBg",F(Xe,x.error.main,.62)),K(x.LinearProgress,"infoBg",F(Xe,x.info.main,.62)),K(x.LinearProgress,"successBg",F(Xe,x.success.main,.62)),K(x.LinearProgress,"warningBg",F(Xe,x.warning.main,.62)),K(x.Skeleton,"bg",D?F(fa,x.text.primary,.11):`rgba(${R("palette-text-primaryChannel")} / 0.11)`),K(x.Slider,"primaryTrack",F(Xe,x.primary.main,.62)),K(x.Slider,"secondaryTrack",F(Xe,x.secondary.main,.62)),K(x.Slider,"errorTrack",F(Xe,x.error.main,.62)),K(x.Slider,"infoTrack",F(Xe,x.info.main,.62)),K(x.Slider,"successTrack",F(Xe,x.success.main,.62)),K(x.Slider,"warningTrack",F(Xe,x.warning.main,.62));const z=D?F(Ye,x.background.default,.6825):vf(x.background.default,.8);K(x.SnackbarContent,"bg",z),K(x.SnackbarContent,"color",Tr(()=>D?xm.text.primary:x.getContrastText(z))),K(x.SpeedDialAction,"fabHoverBg",vf(x.background.paper,.15)),K(x.StepConnector,"border",R("palette-grey-400")),K(x.StepContent,"border",R("palette-grey-400")),K(x.Switch,"defaultColor",R("palette-common-white")),K(x.Switch,"defaultDisabledColor",R("palette-grey-100")),K(x.Switch,"primaryDisabledColor",F(Xe,x.primary.main,.62)),K(x.Switch,"secondaryDisabledColor",F(Xe,x.secondary.main,.62)),K(x.Switch,"errorDisabledColor",F(Xe,x.error.main,.62)),K(x.Switch,"infoDisabledColor",F(Xe,x.info.main,.62)),K(x.Switch,"successDisabledColor",F(Xe,x.success.main,.62)),K(x.Switch,"warningDisabledColor",F(Xe,x.warning.main,.62)),K(x.TableCell,"border",F(Xe,F(fa,x.divider,1),.88)),K(x.Tooltip,"bg",F(fa,x.grey[700],.92))}if(x.mode==="dark"){K(x.Alert,"errorColor",F(Xe,x.error.light,.6)),K(x.Alert,"infoColor",F(Xe,x.info.light,.6)),K(x.Alert,"successColor",F(Xe,x.success.light,.6)),K(x.Alert,"warningColor",F(Xe,x.warning.light,.6)),K(x.Alert,"errorFilledBg",R("palette-error-dark")),K(x.Alert,"infoFilledBg",R("palette-info-dark")),K(x.Alert,"successFilledBg",R("palette-success-dark")),K(x.Alert,"warningFilledBg",R("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",F(Ye,x.error.light,.9)),K(x.Alert,"infoStandardBg",F(Ye,x.info.light,.9)),K(x.Alert,"successStandardBg",F(Ye,x.success.light,.9)),K(x.Alert,"warningStandardBg",F(Ye,x.warning.light,.9)),K(x.Alert,"errorIconColor",R("palette-error-main")),K(x.Alert,"infoIconColor",R("palette-info-main")),K(x.Alert,"successIconColor",R("palette-success-main")),K(x.Alert,"warningIconColor",R("palette-warning-main")),K(x.AppBar,"defaultBg",R("palette-grey-900")),K(x.AppBar,"darkBg",R("palette-background-paper")),K(x.AppBar,"darkColor",R("palette-text-primary")),K(x.Avatar,"defaultBg",R("palette-grey-600")),K(x.Button,"inheritContainedBg",R("palette-grey-800")),K(x.Button,"inheritContainedHoverBg",R("palette-grey-700")),K(x.Chip,"defaultBorder",R("palette-grey-700")),K(x.Chip,"defaultAvatarColor",R("palette-grey-300")),K(x.Chip,"defaultIconColor",R("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",F(Ye,x.primary.main,.5)),K(x.LinearProgress,"secondaryBg",F(Ye,x.secondary.main,.5)),K(x.LinearProgress,"errorBg",F(Ye,x.error.main,.5)),K(x.LinearProgress,"infoBg",F(Ye,x.info.main,.5)),K(x.LinearProgress,"successBg",F(Ye,x.success.main,.5)),K(x.LinearProgress,"warningBg",F(Ye,x.warning.main,.5)),K(x.Skeleton,"bg",D?F(fa,x.text.primary,.13):`rgba(${R("palette-text-primaryChannel")} / 0.13)`),K(x.Slider,"primaryTrack",F(Ye,x.primary.main,.5)),K(x.Slider,"secondaryTrack",F(Ye,x.secondary.main,.5)),K(x.Slider,"errorTrack",F(Ye,x.error.main,.5)),K(x.Slider,"infoTrack",F(Ye,x.info.main,.5)),K(x.Slider,"successTrack",F(Ye,x.success.main,.5)),K(x.Slider,"warningTrack",F(Ye,x.warning.main,.5));const z=D?F(Xe,x.background.default,.985):vf(x.background.default,.98);K(x.SnackbarContent,"bg",z),K(x.SnackbarContent,"color",Tr(()=>D?G2.text.primary:x.getContrastText(z))),K(x.SpeedDialAction,"fabHoverBg",vf(x.background.paper,.15)),K(x.StepConnector,"border",R("palette-grey-600")),K(x.StepContent,"border",R("palette-grey-600")),K(x.Switch,"defaultColor",R("palette-grey-300")),K(x.Switch,"defaultDisabledColor",R("palette-grey-600")),K(x.Switch,"primaryDisabledColor",F(Ye,x.primary.main,.55)),K(x.Switch,"secondaryDisabledColor",F(Ye,x.secondary.main,.55)),K(x.Switch,"errorDisabledColor",F(Ye,x.error.main,.55)),K(x.Switch,"infoDisabledColor",F(Ye,x.info.main,.55)),K(x.Switch,"successDisabledColor",F(Ye,x.success.main,.55)),K(x.Switch,"warningDisabledColor",F(Ye,x.warning.main,.55)),K(x.TableCell,"border",F(Ye,F(fa,x.divider,1),.68)),K(x.Tooltip,"bg",F(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((B,x)=>On(B,x),b);const E={prefix:a,disableCssColorScheme:i,shouldSkipGeneratingVar:u,getSelector:k9(b),enableContrastVars:o},{vars:A,generateThemeVars:C,generateStyleSheets:T}=s9(b,E);return b.vars=A,Object.entries(b.colorSchemes[b.defaultColorScheme]).forEach(([B,x])=>{b[B]=x}),b.generateThemeVars=C,b.generateStyleSheets=T,b.generateSpacing=function(){return R2(c.spacing,pm(this))},b.getColorSchemeSelector=c9(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 q9(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),P9({...o,colorSchemes:s,defaultColorScheme:u,...typeof r!="boolean"&&r},...t)}const V9=q9();function G9(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const Cm=e=>G9(e)&&e!=="classes",wt=P6({themeId:I_,defaultTheme:V9,rootShouldForwardProp:Cm}),In=a9;function $n(e){return n9(e)}function Y9(e){return yn("MuiSvgIcon",e)}bn("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const X9=e=>{const{color:t,fontSize:n,classes:r}=e,i={root:["root",t!=="inherit"&&`color${Ue(t)}`,`fontSize${Ue(n)}`]};return Un(i,Y9,r)},Z9=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},S={};c||(S.viewBox=d);const p=X9(m);return _.jsxs(Z9,{as:u,className:at(p.root,a),focusable:"false",color:s,"aria-hidden":f?void 0:!0,role:f?"img":void 0,ref:n,...S,...h,...v&&i.props,ownerState:m,children:[v?i.props.children:i,f?_.jsx("title",{children:f}):null]})});Tm.muiName="SvgIcon";function Mm(e,t){function n(r,i){return _.jsx(Tm,{"data-testid":void 0,ref:i,...r,children:e})}return n.muiName=Tm.muiName,M.memo(M.forwardRef(n))}function Q9(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 X6(()=>{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 K9(e,t){const n=e.charCodeAt(2);return e[0]==="o"&&e[1]==="n"&&n>=65&&n<=90&&typeof t=="function"}function W9(e,t){if(!e)return t;function n(o,u){const l={};return Object.keys(u).forEach(s=>{K9(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 J9(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 eB(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Bm(e,t)}const iS=Nt.createContext(null);function tB(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 nB(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 rB(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 iB(e,t,n){var r=Fm(e.children),i=nB(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 aB=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},oB={component:"div",childFactory:function(t){return t}},Nm=function(e){eB(t,e);function t(r,i){var a;a=e.call(this,r,i)||this;var o=a.handleExited.bind(tB(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?rB(i,u):iB(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=J9(i,["component","childFactory"]),l=this.state.contextValue,s=aB(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=oB;const aS={};function oS(e,t){const n=M.useRef(aS);return n.current===aS&&(n.current=e(t)),n}const uB=[];function lB(e){M.useEffect(e,uB)}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 sB(){const e=oS(Rm.create).current;return lB(e.disposeEffect),e}function cB(e){return typeof e=="string"}function fB(e,t,n){return e===void 0||cB(e)?t:{...t,ownerState:{...t.ownerState,...n}}}function dB(e,t,n){return typeof e=="function"?e(t,n):e}function hB(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 mB(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=hB({...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=dB(f[e],i),{props:{component:m,...S},internalRef:p}=mB({className:n,...l,externalForwardedProps:e==="root"?d:void 0,externalSlotProps:v}),g=_m(p,v?.ref,t.ref),y=e==="root"?m||s:m,D=fB(h,{...e==="root"&&!s&&!c[e]&&o,...e!=="root"&&!c[e]&&o,...S,...y&&!u&&{as:y},...y&&u&&{component:y},ref:g},i);return[h,D]}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=gB(),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 pB(){return bf.use()}function gB(){let e,t;const n=new Promise((r,i)=>{e=r,t=i});return n.resolve=e,n.reject=t,n}function vB(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]),_.jsx("span",{className:d,style:h,children:_.jsx("span",{className:v})})}const er=bn("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),Om=550,yB=80,bB=il`
90
90
  0% {
91
91
  transform: scale(0);
92
92
  opacity: 0.1;
@@ -96,7 +96,7 @@ export default theme;`}function eS(e){return typeof e=="number"?`${(e*100).toFix
96
96
  transform: scale(1);
97
97
  opacity: 0.3;
98
98
  }
99
- `,vB=il`
99
+ `,DB=il`
100
100
  0% {
101
101
  opacity: 1;
102
102
  }
@@ -104,7 +104,7 @@ export default theme;`}function eS(e){return typeof e=="number"?`${(e*100).toFix
104
104
  100% {
105
105
  opacity: 0;
106
106
  }
107
- `,yB=il`
107
+ `,SB=il`
108
108
  0% {
109
109
  transform: scale(1);
110
110
  }
@@ -116,14 +116,14 @@ export default theme;`}function eS(e){return typeof e=="number"?`${(e*100).toFix
116
116
  100% {
117
117
  transform: scale(1);
118
118
  }
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"})`
119
+ `,xB=wt("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),wB=wt(vB,{name:"MuiTouchRipple",slot:"Ripple"})`
120
120
  opacity: 0;
121
121
  position: absolute;
122
122
 
123
123
  &.${er.rippleVisible} {
124
124
  opacity: 0.3;
125
125
  transform: scale(1);
126
- animation-name: ${gB};
126
+ animation-name: ${bB};
127
127
  animation-duration: ${Om}ms;
128
128
  animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut};
129
129
  }
@@ -143,7 +143,7 @@ export default theme;`}function eS(e){return typeof e=="number"?`${(e*100).toFix
143
143
 
144
144
  & .${er.childLeaving} {
145
145
  opacity: 0;
146
- animation-name: ${vB};
146
+ animation-name: ${DB};
147
147
  animation-duration: ${Om}ms;
148
148
  animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut};
149
149
  }
@@ -153,13 +153,13 @@ export default theme;`}function eS(e){return typeof e=="number"?`${(e*100).toFix
153
153
  /* @noflip */
154
154
  left: 0px;
155
155
  top: 0;
156
- animation-name: ${yB};
156
+ animation-name: ${SB};
157
157
  animation-duration: 2500ms;
158
158
  animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut};
159
159
  animation-iteration-count: infinite;
160
160
  animation-delay: 200ms;
161
161
  }
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`
162
+ `,EB=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=sB(),v=M.useRef(null),m=M.useRef(null),S=M.useCallback(D=>{const{pulsate:w,rippleX:b,rippleY:E,rippleSize:A,cb:C}=D;s(T=>[...T,_.jsx(wB,{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:A},c.current)]),c.current+=1,f.current=C},[a]),p=M.useCallback((D={},w={},b=()=>{})=>{const{pulsate:E=!1,center:A=i||w.pulsate,fakeElement:C=!1}=w;if(D?.type==="mousedown"&&d.current){d.current=!1;return}D?.type==="touchstart"&&(d.current=!0);const T=C?null:m.current,B=T?T.getBoundingClientRect():{width:0,height:0,left:0,top:0};let x,R,F;if(A||D===void 0||D.clientX===0&&D.clientY===0||!D.clientX&&!D.touches)x=Math.round(B.width/2),R=Math.round(B.height/2);else{const{clientX:z,clientY:N}=D.touches&&D.touches.length>0?D.touches[0]:D;x=Math.round(z-B.left),R=Math.round(N-B.top)}if(A)F=Math.sqrt((2*B.width**2+B.height**2)/3),F%2===0&&(F+=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)-R),R)*2+2;F=Math.sqrt(z**2+N**2)}D?.touches?v.current===null&&(v.current=()=>{S({pulsate:E,rippleX:x,rippleY:R,rippleSize:F,cb:b})},h.start(yB,()=>{v.current&&(v.current(),v.current=null)})):S({pulsate:E,rippleX:x,rippleY:R,rippleSize:F,cb:b})},[i,S,h]),g=M.useCallback(()=>{p({},{pulsate:!0})},[p]),y=M.useCallback((D,w)=>{if(h.clear(),D?.type==="touchend"&&v.current){v.current(),v.current=null,h.start(0,()=>{y(D,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]),_.jsx(xB,{className:at(er.root,a.root,o),ref:m,...u,children:_.jsx(Nm,{component:null,exit:!0,children:l})})});function AB(e){return yn("MuiButtonBase",e)}const CB=bn("MuiButtonBase",["root","disabled","focusVisible"]),TB=e=>{const{disabled:t,focusVisible:n,focusVisibleClassName:r,classes:i}=e,o=Un({root:["root",t&&"disabled",n&&"focusVisible"]},AB,i);return n&&r&&(o.root+=` ${r}`),o},MB=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"},[`&.${CB.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:S,onContextMenu:p,onDragLeave:g,onFocus:y,onFocusVisible:D,onKeyDown:w,onKeyUp:b,onMouseDown:E,onMouseLeave:A,onMouseUp:C,onTouchEnd:T,onTouchMove:B,onTouchStart:x,tabIndex:R=0,TouchRippleProps:F,touchRippleRef:z,type:N,...U}=r,I=M.useRef(null),L=pB(),X=_m(L.ref,z),[Z,P]=M.useState(!1);s&&Z&&P(!1),M.useImperativeHandle(i,()=>({focusVisible:()=>{P(!0),I.current.focus()}}),[]);const j=L.shouldMount&&!c&&!s;M.useEffect(()=>{Z&&d&&!c&&L.pulsate()},[c,d,Z,L]);const Y=Wr(L,"start",E,f),$=Wr(L,"stop",p,f),q=Wr(L,"stop",g,f),V=Wr(L,"stop",C,f),te=Wr(L,"stop",pe=>{Z&&pe.preventDefault(),A&&A(pe)},f),W=Wr(L,"start",x,f),ne=Wr(L,"stop",T,f),fe=Wr(L,"stop",B,f),ee=Wr(L,"stop",pe=>{lS(pe.target)||P(!1),m&&m(pe)},!1),le=yf(pe=>{I.current||(I.current=pe.currentTarget),lS(pe.target)&&(P(!0),D&&D(pe)),y&&y(pe)}),se=()=>{const pe=I.current;return l&&l!=="button"&&!(pe.tagName==="A"&&pe.href)},De=yf(pe=>{d&&!pe.repeat&&Z&&pe.key===" "&&L.stop(pe,()=>{L.start(pe)}),pe.target===pe.currentTarget&&se()&&pe.key===" "&&pe.preventDefault(),w&&w(pe),pe.target===pe.currentTarget&&se()&&pe.key==="Enter"&&!s&&(pe.preventDefault(),S&&S(pe))}),be=yf(pe=>{d&&pe.key===" "&&Z&&!pe.defaultPrevented&&L.stop(pe,()=>{L.pulsate(pe)}),b&&b(pe),S&&pe.target===pe.currentTarget&&se()&&pe.key===" "&&!pe.defaultPrevented&&S(pe)});let xe=l;xe==="button"&&(U.href||U.to)&&(xe=v);const we={};xe==="button"?(we.type=N===void 0?"button":N,we.disabled=s):(!U.href&&!U.to&&(we.role="button"),s&&(we["aria-disabled"]=s));const Re=_m(n,I),Ce={...r,centerRipple:a,component:l,disabled:s,disableRipple:c,disableTouchRipple:f,focusRipple:d,tabIndex:R,focusVisible:Z},Be=TB(Ce);return _.jsxs(MB,{as:xe,className:at(Be.root,u),ownerState:Ce,onBlur:ee,onClick:S,onContextMenu:$,onFocus:le,onKeyDown:De,onKeyUp:be,onMouseDown:Y,onMouseLeave:te,onMouseUp:V,onDragLeave:q,onTouchEnd:ne,onTouchMove:fe,onTouchStart:W,ref:Re,tabIndex:s?-1:R,type:N,...we,...U,children:[o,j?_.jsx(EB,{ref:X,center:a,...F}):null]})});function Wr(e,t,n,r=!1){return yf(i=>(n&&n(i),r||e[t](i),!0))}function _B(e){return typeof e.main=="string"}function BB(e,t=[]){if(!_B(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&&BB(t,e)}function FB(e){return yn("MuiCircularProgress",e)}bn("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const Ui=44,zm=il`
163
163
  0% {
164
164
  transform: rotate(0deg);
165
165
  }
@@ -182,10 +182,10 @@ export default theme;`}function eS(e){return typeof e=="number"?`${(e*100).toFix
182
182
  stroke-dasharray: 1px, 200px;
183
183
  stroke-dashoffset: -126px;
184
184
  }
185
- `,_B=typeof zm!="string"?sm`
185
+ `,NB=typeof zm!="string"?sm`
186
186
  animation: ${zm} 1.4s linear infinite;
187
- `:null,BB=typeof Um!="string"?sm`
187
+ `:null,RB=typeof Um!="string"?sm`
188
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-0,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"})})()})();
189
+ `:null,OB=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,FB,t)},zB=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:NB||{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}}))]}))),UB=wt("svg",{name:"MuiCircularProgress",slot:"Svg"})({display:"block"}),IB=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:RB||{animation:`${Um} 1.4s ease-in-out infinite`}}]}))),$B=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=OB(h),m={},S={},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`,S.transform="rotate(-90deg)"}return _.jsx(zB,{className:at(v.root,i),style:{width:u,height:u,...S,...l},ownerState:h,ref:n,role:"progressbar",...p,...d,children:_.jsx(UB,{className:v.svg,ownerState:h,viewBox:`${Ui/2} ${Ui/2} ${Ui} ${Ui}`,children:_.jsx(IB,{className:v.circle,style:m,ownerState:h,cx:Ui,cy:Ui,r:(Ui-s)/2,fill:"none",strokeWidth:s})})})});function kB(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"]),LB=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,kB,t)},jB=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"}}))),HB=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=i9(f),S=h??_.jsx($B,{"aria-labelledby":m,color:"inherit",size:16}),p={...r,edge:i,color:u,disabled:l,disableFocusRipple:s,loading:d,loadingIndicator:S,size:c},g=LB(p);return _.jsxs(jB,{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"&&_.jsx("span",{className:g.loadingWrapper,style:{display:"contents"},children:_.jsx(HB,{className:g.loadingIndicator,ownerState:p,children:d&&S})}),a]})});function PB({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 qB=M.createContext(void 0);function fS(){return M.useContext(qB)}function VB(e){return yn("PrivateSwitchBase",e)}bn("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const GB=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,VB,t)},YB=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}}]}),XB=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:S,onFocus:p,readOnly:g,required:y=!1,tabIndex:D,type:w,value:b,slots:E={},slotProps:A={},...C}=t,[T,B]=Q9({controlled:i,default:!!o}),x=fS(),R=$=>{p&&p($),x&&x.onFocus&&x.onFocus($)},F=$=>{m&&m($),x&&x.onBlur&&x.onBlur($)},z=$=>{if($.nativeEvent.defaultPrevented)return;const q=$.target.checked;B(q),S&&S($,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=GB(I),X={slots:E,slotProps:{input:d,...A}},[Z,P]=Fo("root",{ref:n,elementType:YB,className:L.root,shouldForwardComponentProp:!0,externalForwardedProps:{...X,component:"span",...C},getSlotProps:$=>({...$,onFocus:q=>{$.onFocus?.(q),R(q)},onBlur:q=>{$.onBlur?.(q),F(q)}}),ownerState:I,additionalProps:{centerRipple:!0,focusRipple:!l,disabled:N,role:void 0,tabIndex:null}}),[j,Y]=Fo("input",{ref:h,elementType:XB,className:L.input,externalForwardedProps:X,getSlotProps:$=>({...$,onChange:q=>{$.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:D,type:w,...w==="checkbox"&&b===void 0?{}:{value:b}}});return _.jsxs(Z,{...P,children:[_.jsx(j,{...Y}),T?a:c]})}),ZB=Mm(_.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"})),QB=Mm(_.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"})),KB=Mm(_.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 WB(e){return yn("MuiCheckbox",e)}const Im=bn("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),JB=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,WB,t);return{...t,...o}},eF=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"}}}}]}))),tF=_.jsx(QB,{}),nF=_.jsx(ZB,{}),rF=_.jsx(KB,{}),hS=M.forwardRef(function(t,n){const r=$n({props:t,name:"MuiCheckbox"}),{checkedIcon:i=tF,color:a="primary",icon:o=nF,indeterminate:u=!1,indeterminateIcon:l=rF,inputProps:s,size:c="medium",disableRipple:f=!1,className:d,slots:h={},slotProps:v={},...m}=r,S=u?l:o,p=u?l:i,g={...r,disableRipple:f,color:a,indeterminate:u,size:c},y=JB(g),D=v.input??s,[w,b]=Fo("root",{ref:n,elementType:eF,className:at(y.root,d),shouldForwardComponentProp:!0,externalForwardedProps:{slots:h,slotProps:v,...m},ownerState:g,additionalProps:{type:"checkbox",icon:M.cloneElement(S,{fontSize:S.props.fontSize??c}),checkedIcon:M.cloneElement(p,{fontSize:p.props.fontSize??c}),disableRipple:f,slots:h,slotProps:{input:W9(typeof D=="function"?D(g):D,{"data-indeterminate":u})}}});return _.jsx(w,{...b,classes:y})});function iF(e){return yn("MuiFormGroup",e)}bn("MuiFormGroup",["root","row","error"]);const aF=e=>{const{classes:t,row:n,error:r}=e;return Un({root:["root",n&&"row",r&&"error"]},iF,t)},oF=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"}}]}),uF=M.forwardRef(function(t,n){const r=$n({props:t,name:"MuiFormGroup"}),{className:i,row:a=!1,...o}=r,u=fS(),l=PB({props:r,muiFormControl:u,states:["error"]}),s={...r,row:a,error:l.error},c=aF(s);return _.jsx(oF,{className:at(c.root,i),ownerState:s,ref:n,...o})});function lF(e){return yn("MuiSwitch",e)}const on=bn("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]),sF=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,lF,t);return{...t,...l}},cF=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)"}}}}]}),fF=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}}}))]}))),dF=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}`}))),hF=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=sF(d),v={slots:s,slotProps:c},[m,S]=Fo("root",{className:at(h.root,i),elementType:cF,externalForwardedProps:v,ownerState:d,additionalProps:{sx:l}}),[p,g]=Fo("thumb",{className:h.thumb,elementType:hF,externalForwardedProps:v,ownerState:d}),y=_.jsx(p,{...g}),[D,w]=Fo("track",{className:h.track,elementType:dF,externalForwardedProps:v,ownerState:d});return _.jsxs(m,{...S,children:[_.jsx(fF,{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}}}),_.jsx(D,{...w})]})}),pS=M.createContext();function mF(e){return yn("MuiTable",e)}bn("MuiTable",["root","stickyHeader"]);const pF=e=>{const{classes:t,stickyHeader:n}=e;return Un({root:["root",n&&"stickyHeader"]},mF,t)},gF=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",vF=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=pF(c),d=M.useMemo(()=>({padding:o,size:u,stickyHeader:l}),[o,u,l]);return _.jsx(pS.Provider,{value:d,children:_.jsx(gF,{as:a,role:a===gS?null:"table",ref:n,className:at(f.root,i),ownerState:c,...s})})}),Df=M.createContext();function yF(e){return yn("MuiTableBody",e)}bn("MuiTableBody",["root"]);const bF=e=>{const{classes:t}=e;return Un({root:["root"]},yF,t)},DF=wt("tbody",{name:"MuiTableBody",slot:"Root"})({display:"table-row-group"}),SF={variant:"body"},vS="tbody",xF=M.forwardRef(function(t,n){const r=$n({props:t,name:"MuiTableBody"}),{className:i,component:a=vS,...o}=r,u={...r,component:a},l=bF(u);return _.jsx(Df.Provider,{value:SF,children:_.jsx(DF,{className:at(l.root,i),as:a,ref:n,role:a===vS?null:"rowgroup",ownerState:u,...o})})});function wF(e){return yn("MuiTableCell",e)}const EF=bn("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),AF=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,wF,t)},CF=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",[`&.${EF.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 S;o?S=o:S=m?"th":"td";let p=l;S==="td"?p=void 0:!p&&m&&(p="col");const g=f||v&&v.variant,y={...r,align:i,component:S,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},D=AF(y);let w=null;return c&&(w=c==="asc"?"ascending":"descending"),_.jsx(CF,{as:S,ref:n,className:at(D.root,a),"aria-sort":w,scope:p,ownerState:y,...d})});function TF(e){return yn("MuiTableHead",e)}bn("MuiTableHead",["root"]);const MF=e=>{const{classes:t}=e;return Un({root:["root"]},TF,t)},_F=wt("thead",{name:"MuiTableHead",slot:"Root"})({display:"table-header-group"}),BF={variant:"head"},yS="thead",FF=M.forwardRef(function(t,n){const r=$n({props:t,name:"MuiTableHead"}),{className:i,component:a=yS,...o}=r,u={...r,component:a},l=MF(u);return _.jsx(Df.Provider,{value:BF,children:_.jsx(_F,{as:a,className:at(l.root,i),ref:n,role:a===yS?null:"rowgroup",ownerState:u,...o})})});function NF(e){return yn("MuiTableRow",e)}const bS=bn("MuiTableRow",["root","selected","hover","head","footer"]),RF=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"]},NF,t)},OF=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=RF(c);return _.jsx(OF,{as:a,ref:n,className:at(f.root,i),role:a===DS?null:"row",ownerState:c,...l})}),zF={paddingLeft:0,paddingRight:0,paddingTop:1,paddingBottom:1},fl=35,UF=e=>{const t=e.selected?"secondary":"inherit";return _.jsx("span",{title:e.title,children:e.icon?_.jsx(cl,{title:e.title,onClick:e.onClick,color:t,style:zF,disabled:!!e.disabled,sx:{fontSize:18},children:e.icon},e.elementIndex):_.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")},IF=e=>e.useHorizontalLayout?_.jsx(_.Fragment,{}):_.jsx("hr",{},e.elementIndex),$F=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)},kF=e=>{switch(e.subtype){case"checkbox":return _.jsx(LF,{...e});case"slider":return _.jsx(jF,{...e});default:return _.jsxs("span",{children:["ERROR: Bad toggle subtype ",e.subtype]},e.elementIndex)}},LF=e=>_.jsx(hS,{checked:e.selected,onClick:e.onClick,style:{padding:0,paddingLeft:0},title:e.title,disabled:e.disabled},e.elementIndex),jF=e=>_.jsx(uF,{children:_.jsx(mS,{checked:e.selected,size:"small",style:{left:-3},onChange:e.onClick,disabled:e.disabled,title:e.title})},e.elementIndex),HF=e=>{switch(e.type){case"button":return _.jsx(UF,{...e});case"divider":return _.jsx(IF,{...e});case"text":return _.jsx($F,{...e});case"toggle":return _.jsx(kF,{...e});default:return _.jsx("span",{},e.elementIndex)}},PF=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(()=>PF(e.customActions),[e.customActions]),n=M.useMemo(()=>t.map((a,o)=>_.jsx(HF,{...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 _.jsx("div",{className:i,style:{...r},children:n})},xf={onlyShowSelected:!1},wf=({options:e,setOptions:t,onRedistributeUnitColors:n})=>_.jsxs("div",{children:[_.jsx(mS,{checked:e.onlyShowSelected,onClick:()=>{t({...e,onlyShowSelected:!e.onlyShowSelected})}}),_.jsx("span",{style:{position:"relative",top:2,overflow:"hidden"},children:"only show selected"}),"  ",n&&_.jsx("button",{onClick:n,title:"Redistribute unit colors",children:"rc"})]}),qF=(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(()=>qF(u,l).map(f=>({x:f,label:`${f}`})),[u,l]);return t?_.jsx(g_,{bars:o,ticks:a?void 0:s,width:r,height:i,xLabel:a?void 0:"dt (msec)"}):_.jsx("div",{style:{position:"relative",width:r,height:i,color:"orange"}})},VF=10,GF=4,YF=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}),[S,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,D;if(!Array.isArray(e.children))y=e.children,D=null;else{const X=e.children.filter(Z=>Z!==void 0);y=X[0]||null,D=X[1]||null}if(y||(y=D,D=null),!y)throw Error("Splitter must have at least one child.");const w=u?s-c:c,b=o?e.gripThickness??VF:0,E=o?e.gripInnerThickness??GF:0,A=o?e.gripMargin??YF:0,C=w-b/2-A,T=s-C-b-2*A,B={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"},R={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"},F={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"},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(X=>{X.preventDefault(),h(!0),m({x:X.clientX,y:X.clientY}),p(w)},[w]),I=M.useCallback(X=>{if(!d)return;const Z=X.clientX-v.x,P=X.clientY-v.y;let Y=S+(l==="horizontal"?Z:P);const $=4,q=s-4;Y=Math.max($,Math.min(q,Y));const V=u?s-Y:Y;f(V),a&&a(V)},[d,v,S,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]),D?_.jsxs("div",{className:"splitter",style:{...B,position:"relative"},children:[_.jsx("div",{style:{...x,position:"absolute"},className:"SplitterChild",children:_.jsx(y.type,{...y.props,width:l==="horizontal"?C:n,height:l==="horizontal"?r:C})},"child1"),o&&_.jsx("div",{ref:g,style:{...F,position:"absolute",left:l==="horizontal"?w-b/2-A:0,top:l==="horizontal"?0:w-b/2-A},onMouseDown:U,children:_.jsx("div",{style:{...z,position:"absolute"},children:_.jsx("div",{style:{...N,position:"absolute"}})})},"drag"),_.jsx("div",{style:{...R,position:"absolute"},className:"SplitterChild",children:_.jsx(D.type,{ref:t,...D.props,width:l==="horizontal"?T:n,height:l==="horizontal"?r:T})},"child2")]}):_.jsx(y.type,{...y.props,width:n,height:r})}),XF=({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(D=>D*1.3),title:"Increase box size",icon:_.jsx(Tc,{})},{type:"button",callback:()=>c(D=>D/1.3),title:"Decrease box size",icon:_.jsx(Cc,{})}],y={type:"toggle",subtype:"checkbox",callback:()=>d(D=>!D),title:"Show X Axis",selected:f===!0};return[...g,{type:"divider"},y]},[f]),S=30,p=fl;return _.jsxs("div",{children:[_.jsxs(Ro,{width:t,height:n-S,initialPosition:p,adjustable:!1,children:[_.jsx(dl,{width:p,height:n,customActions:m}),_.jsx(wc,{width:0,height:0,children:_.jsx(xc,{plots:v,plotComponent:xS,selectedPlotKeys:r.onlyShowSelected?void 0:a})})]}),_.jsx("div",{style:{position:"absolute",top:n-S,height:S,overflow:"hidden"},children:_.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}},ZF=(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}},QF=({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 S=0;S<s;S++){const p=m[S],g=S*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?_.jsx(Jr,{context:t.unitSelection,children:_.jsx(XF,{data:i,width:n,height:r})}):_.jsx("div",{children:"Loading..."})},Jr=({context:e,children:t})=>{const{state:n,dispatch:r}=Ef(e);return!r||!n?_.jsx(_.Fragment,{children:"Waiting for context..."}):_.jsx(xy.Provider,{value:{unitSelection:n,unitSelectionDispatch:r},children:t})},KF=e=>{const{unitId:t,mergeGroup:n}=e,r=wr(Ct(t)),i=n?n.map(a=>`${a}`).join(", "):"";return _.jsxs("span",{children:[_.jsx("div",{className:"unitLabel",style:{backgroundColor:r}})," ",`${t}`,n&&n.length>0&&_.jsx("span",{children:` (${i})`},"mergeGroup")]})},WF=(e,t)=>((t||{}).mergeGroups||[]).filter(r=>r.includes(e))[0]||null,JF=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]),S=M.useCallback((D,w)=>{const b=d?.columnName===D?!d?.sortAscending:!0;h({columnName:D,sortAscending:b}),r&&r({type:"UPDATE_SORT_FIELDS",newSortField:D,ascending:b})},[d,r]),p=M.useCallback(()=>{r&&r(m==="all"?{type:"DESELECT_ALL"}:{type:"TOGGLE_SELECT_ALL"})},[m,r]),g=M.useMemo(()=>{const D=v.map(b=>i.get(b)).filter(b=>b!==void 0);if(!d)return D;const w=a.find(b=>b.columnName===d.columnName);return w?[...D].sort((b,E)=>{const A=b.data[d.columnName]?.sortValue,C=E.data[d.columnName]?.sortValue,T=w.sort(A,C);return d.sortAscending?T:-T}):D},[v,i,d,a]),y=D=>d?.columnName!==D?"":d.sortAscending?"↑":"↓";return _.jsx("div",{className:"compact-table-container",style:{height:s?`${s}px`:"100%",overflow:"auto"},children:_.jsxs("table",{className:"compact-table",children:[_.jsx("thead",{children:_.jsxs("tr",{children:[!f&&_.jsx("th",{className:"compact-table-header",children:_.jsx("input",{type:"checkbox",checked:m==="all",ref:D=>{D&&(D.indeterminate=m==="partial")},onChange:p,disabled:c})}),a.map(D=>_.jsxs("th",{className:"compact-table-header",onClick:()=>S(D.columnName,D),title:D.tooltip,style:{cursor:"pointer"},children:[D.label,_.jsx("span",{className:"sort-indicator",children:y(D.columnName)})]},D.columnName))]})}),_.jsx("tbody",{children:g.map(D=>_.jsxs("tr",{className:`compact-table-row ${t.has(D.rowId)?"selected":""} ${n===D.rowId?"current":""}`,children:[!f&&_.jsx("td",{className:"compact-table-cell",children:_.jsx("input",{type:"checkbox",checked:t.has(D.rowId),onChange:w=>{D.checkboxFn&&D.checkboxFn(w)},disabled:c})}),a.map(w=>_.jsx("td",{className:"compact-table-cell",children:w.dataElement(D.data[w.columnName]?.value)},w.columnName))]},D.rowId))})]})})},eN={},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},tN={sortingCuration:eN,sortingCurationDispatch:e=>{console.warn("No sortingCurationDispatch function provided.")},curating:!1},wS=Nt.createContext(tN),ES=()=>{const e=M.useContext(wS);if(!e)throw Error("useSortingCuration must be used within a SortingCurationContext.Provider");return e},nN=(e,t)=>e.filter(n=>t.includes(n)),rN=(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];nN(i,o).length>0&&(t[r]=rN(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=>_.jsx(KF,{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=>_.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 A=b.score,C=E.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=>_.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,A)=>E<A?-1:E>A?1:0:b.dtype==="int"?(E,A)=>E-A:b.dtype=="bool"?(E,A)=>(E?1:0)-(A?1:0):b.dtype==="float"?(E,A)=>E-A:(E,A)=>E-A,dataElement:E=>_.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}`]||[],A={value:{unitId:b.unitId,mergeGroup:WF(b.unitId,d)},sortValue:b.unitId},C=w[b.unitId],T={_unitId:A,_labels:{value:E,sortValue:E.join(", ")},_similarity:{value:C!==void 0?C.toFixed(3):void 0,sortValue:{unitId:b.unitId,score:C}}};for(const B of e.columns){const x=`${b.values[B.key]!==void 0?b.values[B.key]:""}`;T[B.key]={value:x,sortValue:b.values[B.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 S=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]),D=M.useCallback(()=>{f({type:"REDISTRIBUTE_UNIT_COLORS"})},[f]);return _.jsxs("div",{children:[_.jsx("div",{style:g,onKeyDown:y,children:_.jsx(JF,{columns:v,rows:S,orderedUnitIds:u,visibleUnitIds:h,selectedUnitIds:a,currentUnitId:o,selectionDispatch:f,primarySortRule:s})}),_.jsx("div",{style:{position:"absolute",top:n-p,height:p,overflow:"hidden"},children:_.jsx(wf,{options:r,setOptions:i,onRedistributeUnitColors:D})})]})},iN=({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 S=M.useCallback(j=>{if(r.length===0)return"none";const Y=r.filter($=>(l[$.toString()]||[]).includes(j));return Y.length===0?"none":Y.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(Y=>Y.includes(j)),[l]),D=M.useCallback(j=>{o&&(y(j)||a({type:"SET_LABEL_CHOICES",labelChoices:m.filter(Y=>Y!==j)}))},[m,a,y,o]),w=M.useCallback(j=>s.find(Y=>Y.includes(j)),[s]),b=M.useMemo(()=>{if(r.length===0)return{canMerge:!1,canUnmerge:!1,groupsInvolved:[],unmergedUnits:[]};const j=new Set,Y=[];r.forEach(V=>{const te=w(V);te?j.add(te):Y.push(V)});const $=r.length>=2,q=j.size>0;return{canMerge:$,canUnmerge:q,groupsInvolved:Array.from(j),unmergedUnits:Y}},[r,w]),E=M.useCallback(()=>{o&&(r.length<2||c||a({type:"MERGE_UNITS",unitIds:r}))},[r,c,a,o]),A=M.useCallback(()=>{o&&(r.length===0||c||a({type:"UNMERGE_UNITS",unitIds:r}))},[r,c,a,o]),C=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]),B={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"},R={fontWeight:"bold",marginBottom:"4px",fontSize:"11px",color:"#333"},F={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"},X={...U,backgroundColor:c?"#f8d7da":"#d4edda",borderColor:c?"#f5c6cb":"#c3e6cb",color:c?"#721c24":"#155724"},Z={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 _.jsxs("div",{style:B,children:[_.jsxs("div",{style:x,children:[_.jsx("div",{style:R,children:"Selected Units"}),_.jsx("div",{style:{fontSize:"10px",color:"#666"},children:T})]}),_.jsxs("div",{style:x,children:[_.jsx("div",{style:R,children:"Label Assignment"}),m.map(j=>{const Y=S(j);return _.jsxs("div",{style:I,onClick:o?()=>p(j):void 0,children:[_.jsx("input",{type:"checkbox",checked:Y==="full",ref:$=>{$&&($.indeterminate=Y==="partial")},onChange:()=>{},style:{marginRight:"4px"},disabled:r.length===0||c}),_.jsx("span",{style:{fontSize:"10px"},children:j})]},j)}),r.length===0&&_.jsx("div",{style:{fontSize:"10px",color:"#999",fontStyle:"italic"},children:"Select units to assign labels"})]}),_.jsxs("div",{style:x,children:[_.jsx("div",{style:R,children:"Unit Merging"}),r.length>0&&b.groupsInvolved.length>0&&_.jsxs("div",{style:{marginBottom:"6px"},children:[_.jsx("div",{style:{fontSize:"10px",color:"#666",marginBottom:"2px"},children:"Merge groups involving selected units:"}),b.groupsInvolved.map((j,Y)=>{const $={...F,backgroundColor:"#e3f2fd",borderColor:"#90caf9",color:"#1565c0"};return _.jsx("span",{style:$,children:j.join(", ")},Y)})]}),_.jsxs("div",{style:{display:"flex",gap:"4px",alignItems:"center",flexWrap:"wrap"},children:[_.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"}),_.jsx("button",{onClick:o?A: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&&_.jsxs("div",{style:{fontSize:"10px",color:"#666",marginTop:"4px"},children:[b.groupsInvolved.length>0&&_.jsxs("div",{children:["Selected units in"," ",b.groupsInvolved.length," merge group(s)"]}),b.unmergedUnits.length>0&&_.jsxs("div",{children:[b.unmergedUnits.length," unmerged unit(s) selected"]})]}),r.length===0&&_.jsx("div",{style:{fontSize:"10px",color:"#999",fontStyle:"italic",marginTop:"4px"},children:"Select units to merge or unmerge"})]}),_.jsxs("div",{style:x,children:[_.jsxs("div",{style:Z,onClick:()=>v(!h),children:[_.jsx("span",{style:P,children:"▶"}),"Manage Label Choices"]}),h&&_.jsxs("div",{children:[_.jsx("div",{style:{marginBottom:"4px"},children:m.map(j=>{const Y=y(j);return _.jsxs("span",{style:F,children:[j,!c&&!Y&&_.jsx("span",{style:z,onClick:o?()=>D(j):void 0,title:"Remove label choice",children:"×"})]},j)})}),!c&&_.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[_.jsx("input",{type:"text",value:f,onChange:j=>d(j.target.value),onKeyPress:j=>j.key==="Enter"&&o&&g(),placeholder:"Add label...",style:N}),_.jsx("button",{onClick:o?g:void 0,style:U,disabled:!f.trim(),children:"Add"})]})]})]}),_.jsxs("div",{style:L,children:[_.jsx("button",{onClick:o?C:void 0,style:X,children:c?"Reopen Curation":"Finalize Curation"}),_.jsxs("div",{style:{fontSize:"10px",color:"#666",marginTop:"2px"},children:["Status: ",c?"Closed":"Open"]})]})]})},aN=({zarrGroup:e,contexts:t,width:n,height:r})=>_.jsx(Jr,{context:t.unitSelection,children:_.jsx(TS,{contexts:t,editable:!0,children:_.jsx(oN,{zarrGroup:e,contexts:t,width:n,height:r})})}),oN=({zarrGroup:e,width:t,height:n})=>{const r=e.attrs.default_label_options||[];return _.jsx(iN,{defaultLabelOptions:r,width:t,height:n})},TS=({contexts:e,children:t,editable:n})=>{const{annotations:r,setAnnotation:i}=ZF(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 _.jsx(wS.Provider,{value:{sortingCuration:a,sortingCurationDispatch:o,curating:!!i},children:t})},uN=({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),S=JSON.parse(m);let p;try{const g=await e.getDatasetData("similarity_scores_data",{});if(g&&g.length>0){const y=new Uint8Array(g),D=new TextDecoder("utf-8").decode(y);p=JSON.parse(D)}}catch(g){console.warn("No similarity scores data found: "+g)}if(c)return;a({type:"UnitsTable",columns:d,rows:S,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?_.jsxs("div",{style:{width:n,height:r,display:"flex",alignItems:"center",justifyContent:"center",color:"#666",backgroundColor:"#f5f5f5"},children:["Error: ",o]}):l?_.jsx("div",{style:{width:n,height:r,display:"flex",alignItems:"center",justifyContent:"center",color:"#666",backgroundColor:"#f5f5f5"},children:"Loading units table data..."}):i?_.jsx(Jr,{context:t.unitSelection,children:_.jsx(TS,{contexts:t,editable:!1,children:_.jsx(CS,{data:i,width:n,height:r})})}):_.jsx("div",{style:{width:n,height:r,display:"flex",alignItems:"center",justifyContent:"center",color:"#666",backgroundColor:"#f5f5f5"},children:"No units table data available"})},lN=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:_.jsx(F_,{}),keyCode:38},{type:"button",callback:a,title:"Reset scale amplitude",icon:_.jsx(XD,{})},{type:"button",callback:i,title:"Scale amplitude down [shift + mouse-wheel]",icon:_.jsx(M_,{}),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]}),sN=(e,t)=>({forward:_S(e.forward,t.forward),inverse:_S(t.inverse,e.inverse)}),cN=e=>({forward:[...e.map(t=>[...t])],inverse:dN(e)}),fN=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]]],dN=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=cN([[d,0,(1-d)*c.x],[0,d,(1-d)*c.y]]);f>0&&(h=fN(h));let v=sN(h,a);const m=ha(v,{x:0,y:0}),S=ha(v,{x:e,y:t});return 0<=m.x&&m.x<e&&0<=m.y&&m.y<t&&0<=S.x&&S.x<e&&0<=S.y&&S.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)"},hN=2*Math.PI,mN=(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"?gN(e,t):pN(e,t),e.restore()},pN=(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)})}},gN=(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),S=h?m?c.draggedSelected:v?c.selectedHover:c.selected:m?c.dragged:v?c.hover:c.base;return{...d,color:S,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,hN),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,vN=(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}),yN=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}},bN=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},DN=(e,t)=>d_(n=>{const r=Oo+n[0]*(e-2*Oo),i=ml+n[1]*(t-2*ml);return[r,i]}),SN=(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}})},xN=(e,t,n,r,i)=>{const a=e-Oo*2,o=t-ml*2,u=Sc(i),l=zD(i);return P5(a/u,o/l,r/n)},wN=(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]]},EN=(e,t,n,r={})=>{const i=(e-Oo*2)/(t-ml*2),a=bN(n),{boxAspect:o}=yN(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}},AN=(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=DN(e,t),S=SN(n,m),p=(t-2*ml)/(1+n.length);return{transform:m,convertedElectrodes:S,pixelRadius:p}}const{electrodes:o,rotated:u}=EN(e,t,n,{disableAutoRotate:a.disableAutoRotate}),l=FS(o),s=NS(o,l),c=xN(e,t,l,i,s),f=l*c;let d=wN(e,t,c,s);const h=(e-Sc(s)*c)/2,v=AN(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},CN=(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=o_(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},TN=e=>{const t=e.currentTarget.getBoundingClientRect();return[e.clientX-t.x,e.clientY-t.y]},MN=()=>({selectedElectrodeIds:[],setSelectedElectrodeIds:e=>{}}),kS=e=>{const{width:t,height:n,electrodes:r,disableAutoRotate:i,affineTransform:a}=e,{selectedElectrodeIds:o,setSelectedElectrodeIds:u}=MN(),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(CN,{convertedElectrodes:[],pixelRadius:-1,draggedElectrodeIds:[],pendingSelectedElectrodeIds:o||[],dragState:{isActive:!1},xMarginWidth:-1}),{affineTransform:m,handleWheel:S}=Lm(t,n,{shift:!0,alt:!1}),p=M.useMemo(()=>{const T=h.convertedElectrodes.map(B=>{const x=ha(m,{x:B.pixelX,y:B.pixelY});return{...B,pixelX:x.x,pixelY:x.y}});return{...h,convertedElectrodes:T,pixelRadius:h.pixelRadius*Math.sqrt(km(m))}},[m,h]),g=M.useMemo(()=>T=>{const B=TN(T),x=$m(m,{x:B[0],y:B[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),D=M.useRef(0),w=l||_.jsx(f_,{width:t,height:n,newState:h.dragState}),b=M.useCallback(T=>{if(!l_(T,{nextDragStateUpdate:y,nextFrame:D,reducer:v,reducerOtherProps:{type:"DRAGUPDATE"}})){const x=g(T);v({type:"UPDATEHOVER",point:x})}},[g]),E=M.useCallback(T=>{s_(T,{nextDragStateUpdate:y,reducer:v,reducerOtherProps:{type:"DRAGUPDATE"}})},[]),A=M.useCallback(T=>{if(h.dragState.isActive)c_(T,{nextDragStateUpdate:y,reducer:v,reducerOtherProps:{type:"DRAGUPDATE",selectedElectrodeIds:o}});else{const B=g(T);v({type:"UPDATECLICK",point:B,shift:T.shiftKey,ctrl:T.ctrlKey,selectedElectrodeIds:o||[]})}},[h.dragState.isActive,o,g]),C=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 _.jsx(ir,{width:t,height:n,draw:mN,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]),_.jsxs("div",{style:{width:t,height:n,position:"relative"},onMouseMove:b,onMouseUp:A,onMouseDown:E,onWheel:S,children:[w,US,C]})},_N=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,S)=>[(c?.length||0)/2+(S-(c?.length||0)/2)*i,m]),v=Zh(e,h);a.push({pointsInPaintBox:v,offsetFromParentCenter:[o.pixelX,o.pixelY],color:l.waveformColors.base})}}}}),a},BN=(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 D=r[y],w=i[y];e.fillStyle="#dddddd",e.strokeStyle="#bbbbbb",e.lineWidth=1,e.translate(D.offsetFromParentCenter[0],D.offsetFromParentCenter[1]),e.beginPath(),e.moveTo(D.pointsInPaintBox[0][0],D.pointsInPaintBox[0][1]);for(let b=0;b<D.pointsInPaintBox.length;b++)e.lineTo(D.pointsInPaintBox[b][0],D.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,S,p;a&&o&&u&&l?(v=a,m=o,S=u,p=l):a&&o&&!u&&!l?(v=void 0,m=a,S=o,p=void 0):(v=void 0,m=void 0,S=void 0,p=void 0),v&&v.length>0&&p&&p.length>0&&v.forEach((g,y)=>{if(!v||!p)throw Error("unexpected");const D=v[y],w=p[y];e.fillStyle="#dddddd",e.strokeStyle="#dddddd",e.lineWidth=1,e.translate(D.offsetFromParentCenter[0],D.offsetFromParentCenter[1]),e.beginPath(),e.moveTo(D.pointsInPaintBox[0][0],D.pointsInPaintBox[0][1]);for(let b=0;b<D.pointsInPaintBox.length;b++)e.lineTo(D.pointsInPaintBox[b][0],D.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&&S&&S.length>0&&m.forEach((g,y)=>{if(!m||!S)throw Error("unexpected");const D=m[y],w=S[y];e.fillStyle="#bbbbbb",e.strokeStyle="#bbbbbb",e.lineWidth=1,e.translate(D.offsetFromParentCenter[0],D.offsetFromParentCenter[1]),e.beginPath(),e.moveTo(D.pointsInPaintBox[0][0],D.pointsInPaintBox[0][1]);for(let b=0;b<D.pointsInPaintBox.length;b++)e.lineTo(D.pointsInPaintBox[b][0],D.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()},FN=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,S=-i*(.5+1/v),p=a*r/2,g=ze([[m,0,S],[0,-p,0],[0,0,1]]).toArray(),y=ma(g,n,t,"normal",o),D=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),A=ma(g,n,t,"percentile3",o),C=ma(g,n,t,"percentile4",o);b.length===0&&(b=void 0),E.length===0&&(E=void 0),A.length===0&&(A=void 0),C.length===0&&(C=void 0);const T=s==="vertical"?(u-i)/2:0,B={pixelSpacePaths:y,pixelSpacePathsLower:D,pixelSpacePathsUpper:w,pixelSpacePathsPercentile1:b,pixelSpacePathsPercentile2:E,pixelSpacePathsPercentile3:A,pixelSpacePathsPercentile4:C,xMargin:T,waveformWidth:c,affineTransform:f,useUnitColors:d};return _.jsx(ir,{width:u,height:l,draw:BN,drawData:B})},[n,t,a,u,l,i,r,s,c,f,o,d])},NN={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)"}},RN=e=>{const t=e.colors??NN.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:S}=Lm(l,s,{shift:!0,alt:!0}),p=M.useMemo(()=>_.jsx(kS,{electrodes:n,width:l,height:s,layoutMode:o,colors:t,showLabels:c,maxElectrodePixelRadius:v,disableSelection:!0,disableAutoRotate:h,affineTransform:S}),[n,l,s,o,t,c,h,S]),{convertedElectrodes:g,pixelRadius:y,xMargin:D}=jm(l,s,n,o,v,{disableAutoRotate:h}),w=D||Oo,b=M.useMemo(()=>_N(e.peakAmplitude),[e.peakAmplitude]),E=M.useMemo(()=>i*b,[i,b]),A=o==="geom"?y*2:s/n.length,C=o==="geom"?y*2:l-w-(c?2*y:0),T=_.jsx(FN,{electrodes:g,waveforms:r,oneElectrodeHeight:A,oneElectrodeWidth:C,horizontalStretchFactor:a,yScale:E,width:l,height:s,layoutMode:o,waveformWidth:d,affineTransform:S,useUnitColors:f});return _.jsxs("div",{style:{width:l,height:s,position:"relative"},onWheel:m,children:[!u&&p,T]})},ON=({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 S=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 A of w.channelIds)E.push(S.map(C=>C.id).indexOf(A));return{electrodeIndices:E,waveform:w.waveform,waveformStdDev:w.waveformStdDev,waveformPercentiles:w.waveformPercentiles,waveformColors:b}}),[S,n]),D=_.jsx(RN,{waveforms:y,electrodes:S,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?_.jsxs("div",{style:{position:"relative",width:v,height:m},children:[_.jsx("div",{style:{position:"absolute",left:0,top:0,width:g,height:m},children:_.jsx(kS,{electrodes:p,disableSelection:!1,width:g,height:m})}),_.jsx("div",{style:{position:"absolute",left:g,top:0,width:v-g,height:m},children:D})]}):D},zN=({data:e,width:t,height:n})=>{const r=M.useMemo(()=>{const $=[];for(const q of e.averageWaveforms)for(const V of q.channelIds)$.includes(V)||$.push(V);return yr($)},[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,S]=M.useState(!0),[p,g]=M.useState(!1),[y,D]=M.useState(e.showReferenceProbe||!1),[w,b]=M.useState(!1),[E,A]=M.useState(1),[C,T]=M.useState(!0),[B,x]=M.useState(!0);M.useEffect(()=>{c({type:oo,newUnitOrder:yr(e.averageWaveforms.map($=>$.unitId))})},[e.averageWaveforms,c]);const[R,F]=M.useState(2),z=M.useMemo(()=>{let $=0;return e.averageWaveforms.forEach(q=>{q.waveform.forEach(V=>{V.forEach(te=>{const W=Math.abs(te);W>$&&($=W)})})}),$},[e.averageWaveforms]),N=M.useMemo(()=>e.averageWaveforms.filter($=>i.onlyShowSelected?o.has($.unitId):!0).map($=>{const q=[{channelIds:$.channelIds,waveform:IN($.waveform),waveformStdDev:m&&!w?$.waveformStdDev:void 0,waveformPercentiles:m&&!w&&$.waveformPercentiles?$N($.waveformPercentiles,$.waveform):void 0,waveformColor:wr(Ct($.unitId))}],V={allChannelIds:r,channelIds:$.channelIds,units:q,layoutMode:h,hideElectrodes:C,channelLocations:e.channelLocations,samplingFrequency:e.samplingFrequency,peakAmplitude:z,ampScaleFactor:f,horizontalStretchFactor:E,showChannelIds:p,useUnitColors:B,width:120*R+(y?120*R/4:0),height:120*R,showReferenceProbe:y,disableAutoRotate:!0};return{unitId:$.unitId,key:$.unitId,label:`Unit ${$.unitId}`,labelColor:wr(Ct($.unitId)),clickHandler:i.onlyShowSelected?void 0:s($.unitId),props:V}}),[e.averageWaveforms,e.channelLocations,e.samplingFrequency,r,z,h,f,s,i.onlyShowSelected,o,R,m,p,y,w,E,C,B]),U=M.useMemo(()=>l?l.map($=>N.filter(q=>q.unitId===$)[0]).filter($=>$!==void 0):N,[N,l]),I=M.useMemo(()=>w?UN(U):U,[U,w]),L=M.useMemo(()=>[{type:"button",callback:()=>{A($=>$*1.1)},title:"Increase horizontal stretch [alt + mouse-wheel]",icon:_.jsx(B_,{})},{type:"button",callback:()=>{A(1)},title:"Reset scale amplitude",icon:_.jsx(XD,{})},{type:"button",callback:()=>{A($=>$/1.1)},title:"Decrease horizontal stretch [alt + mouse-wheel]",icon:_.jsx(__,{})}],[]),X=M.useMemo(()=>{const $=lN({ampScaleFactor:f,setAmpScaleFactor:d}),q={type:"toggle",subtype:"checkbox",callback:()=>v(se=>se==="geom"?"vertical":"geom"),title:"Show electrode geometry",selected:h==="geom"},V={type:"toggle",subtype:"checkbox",callback:()=>T(se=>!se),title:"Show electrodes",selected:!C},te=[{type:"button",callback:()=>F(se=>se*1.3),title:"Increase box size",icon:_.jsx(Tc,{})},{type:"button",callback:()=>F(se=>se/1.3),title:"Decrease box size",icon:_.jsx(Cc,{})}],W={type:"toggle",subtype:"checkbox",callback:()=>S(se=>!se),title:"Show waveform stdev",selected:m===!0},ne={type:"toggle",subtype:"checkbox",callback:()=>g(se=>!se),title:"Show channel IDs",selected:p===!0},fe={type:"toggle",subtype:"checkbox",callback:()=>D(se=>!se),title:"Show reference probes",selected:y===!0},ee={type:"toggle",subtype:"checkbox",callback:()=>b(se=>!se),title:"Show overlapping",selected:w===!0},le={type:"toggle",subtype:"checkbox",callback:()=>x(se=>!se),title:"Use unit colors",selected:B===!0};return[{type:"divider"},...te,{type:"divider"},...$,{type:"divider"},...L,{type:"divider"},q,V,{type:"divider"},W,{type:"divider"},ne,{type:"divider"},fe,{type:"divider"},ee,{type:"divider"},le]},[h,f,m,p,w,y,L,C,B]),Z=M.useCallback($=>{$.shiftKey&&!$.altKey?$.deltaY<0?d(q=>q*1.3):d(q=>q/1.3):$.altKey&&!$.shiftKey&&($.deltaY<0?A(q=>q*1.1):A(q=>q/1.1))},[]),P=30,j=M.useCallback($=>{$&&$.addEventListener("wheel",q=>{(q.shiftKey||q.altKey)&&q.preventDefault()})},[]),Y=fl;return _.jsxs("div",{ref:$=>j($),onWheel:Z,children:[_.jsxs(Ro,{width:t,height:n-P,initialPosition:Y,adjustable:!1,children:[_.jsx(dl,{width:Y,height:n,customActions:X}),_.jsx(wc,{width:0,height:0,children:_.jsx(xc,{plots:I,plotComponent:ON,selectedPlotKeys:i.onlyShowSelected?void 0:o,currentPlotKey:u})})]}),_.jsx("div",{style:{position:"absolute",top:n-P,height:P,overflow:"hidden"},children:_.jsx(wf,{options:i,setOptions:a})})]})},UN=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]},IN=e=>e.map(t=>{const n=LS(t);return t.map(r=>r-n)}),$N=(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?t_(e):0,kN=e=>_.jsx(Jr,{context:e.contexts.unitSelection,children:_.jsx(LN,{...e})}),LN=({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,S=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`,{}),S){const g=s.find(y=>y.name===d);g&&u.push({unitId:g.unit_id,channelIds:g.channel_ids,waveform:jS(S,m),waveformStdDev:p?jS(p,m):void 0})}}a||i({type:"AverageWaveforms",averageWaveforms:u})})(),()=>{a=!0}},[e]),r?_.jsx(zN,{data:r,width:t,height:n}):_.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,jN=({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 D of o){const w=p.filter(b=>b.unitId1===y&&b.unitId2===D)[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((D,w)=>({key:`${w}`,unitId:D?D.unitId1:0,label:D?g>80?`Unit ${D.unitId1}/${D.unitId2}`:`${D.unitId1}/${D.unitId2}`:"",labelColor:"black",clickHandler:void 0,props:{binEdgesSec:D?D.binEdgesSec:void 0,binCounts:D?D.binCounts:void 0,color:D?.unitId1===D?.unitId2?wr(Ct(D?.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]),S=_.jsxs(Ro,{width:t-s,height:n,initialPosition:c,adjustable:!1,children:[_.jsx(dl,{width:c,height:n,customActions:v}),_.jsx(wc,{width:0,height:0,disableScroll:!0,children:o.length>HS?_.jsxs("div",{children:["Not showing cross-correlogram matrix. Too many units selected (max ="," ",HS,")."]}):o.length===0?_.jsx("div",{children:"Select one or more units to view cross-correlograms."}):_.jsx(xc,{plots:h,plotComponent:xS,selectedPlotKeys:void 0,numPlotsPerRow:o.length})})]});return u?S:_.jsxs("div",{style:{position:"relative",width:t,height:n},children:[_.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:_.jsx(CS,{data:m,width:s,height:n})}),_.jsx("div",{style:{position:"absolute",left:s,top:0,width:t-s,height:n},children:S})]})},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}},HN=({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,D=Array.from(h.slice(y,y+v));l.push({unitId1:g.unit_id1,unitId2:g.unit_id2,binEdgesSec:d,binCounts:D})}const S=e.attrs.hide_unit_selector||!1;o||a({type:"CrossCorrelograms",crossCorrelograms:l,hideUnitSelector:S})})(),()=>{o=!0}},[e]),i?_.jsx(Jr,{context:t.unitSelection,children:_.jsx(jN,{data:i,width:n,height:r})}):_.jsx("div",{children:"Loading..."})},PN=1.4,qN=(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??PN;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}},VN=(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)},GN=(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,l)=>{t({type:"setCurrentTime",currentTime:u,ensureVisible:l?.ensureVisible})},[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=qN({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=VN({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=GN({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}},YN=({width:e,height:t,customActions:n})=>!n||n.length===0?null:_.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:_.jsx("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:n.map(r=>r.component?_.jsx("div",{style:{display:"flex",alignItems:"center"},children:r.component},r.id):_.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&&_.jsx("span",{children:r.icon}),r.label]},r.id))})}),XN=e=>{if(!e||!e.current)return;e.current.querySelectorAll("canvas").forEach(n=>{n.addEventListener("wheel",r=>{r.preventDefault()})})},ZN=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")}`},QN=({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 _.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:[_.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[_.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"}),_.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"})]}),_.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[_.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:"⬅️"}),_.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:"🔍➖"}),_.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:"🔍➕"}),_.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:"➡️"}),_.jsx("div",{style:{width:"1px",height:"20px",backgroundColor:"#dee2e6",margin:"0 4px"}}),_.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:"🏠"})]}),_.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[_.jsx("span",{style:{color:"#6c757d",fontWeight:"500"},children:"Time:"}),_.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?ZN(i):"--:--:--.---"})]})]})},KN=[{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`}],YS=(e,t,n,r)=>{if(t===void 0||n===void 0)return[];if(n<=t)return[];const i=[],a=e/(n-t);for(const o of KN){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},WN=(e,t,n,r)=>M.useMemo(()=>YS(e,t,n,r),[t,n,r,e]),JN=e=>{if(!e||typeof e=="function")return;const t=e.current,n=t&&t.getContext("2d");if(n)return n},e7={position:"absolute",left:0,top:0},XS=e=>{const{width:t,height:n,draw:r,drawData:i}=e,a=M.useRef(null);return M.useEffect(()=>{const o=JN(a);o&&o.canvas&&r(o,i)},[r,a,i]),_.jsx("canvas",{ref:a,width:t,height:n,style:e7})},ZS=(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;t7(e,a,s,i.top,{hideGridlines:o?.hideX},t.hideTimeAxisLabels),e.strokeStyle="lightgray",Hm(e,i.left,s,n-i.right,s),u&&n7(e,u,s,i.left,n-i.right,i.top,{hideGridlines:o?.hideY}),l&&r7(e,l,i.left,i.bottom,i.top,e.canvas.height)},t7=(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))})},n7=(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)})},r7=(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()},i7={},a7=e=>{const{width:t,height:n}=e,r=M.useCallback(i=>{ZS(i,e)},[e]);return _.jsx("span",{className:"TSV2AxesLayer",children:_.jsx(XS,{width:t,height:n,draw:r,drawData:i7})})},o7=(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()}},u7=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 _.jsx(XS,{width:t,height:n,draw:o7,drawData:u})},l7=({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 _.jsx("div",{style:{position:"absolute",top:0,left:0,width:e,height:t,pointerEvents:"none",zIndex:10},children:_.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"}})})},s7=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),[S,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 A=E.clientX-E.currentTarget.getBoundingClientRect().x;s==="select-zoom"?(g.current.selectionStartX=A,g.current.selectionEndX=A,p({startX:A,endX:A})):(g.current.mouseDownAchorX=A,g.current.mouseDownAnchorTime=t(A),g.current.mouseDownAnchorVisibleStartTime=n||null,g.current.mouseDownAnchorPixelToTime=t),g.current.moved=!1}else i&&i(E)},[t,i,n,s]),D=M.useCallback(E=>{if(!E.shiftKey&&!E.ctrlKey&&!E.altKey){const A=E.clientX-E.currentTarget.getBoundingClientRect().x;if(s==="select-zoom"&&g.current.selectionStartX!==null){const C=Math.min(g.current.selectionStartX,A),T=Math.max(g.current.selectionStartX,A);if(Math.abs(T-C)>5){const B=t(C),x=t(T);f(B,x)}else if(!g.current.moved){const B=t(A);if(r(B),l){const x=E.clientY-E.currentTarget.getBoundingClientRect().y;l(A,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 C=t(A);if(r(C),l){const T=E.clientY-E.currentTarget.getBoundingClientRect().y;l(A,T)}}}else a&&a(E)},[a,t,r,s,f,l]),w=M.useCallback(E=>{const A=E.clientX-E.currentTarget.getBoundingClientRect().x,C=t(A);if(m(C),!E.shiftKey&&!E.ctrlKey&&!E.altKey){if(s==="select-zoom"&&g.current.selectionStartX!==null)g.current.selectionEndX=A,p({startX:Math.min(g.current.selectionStartX,A),endX:Math.max(g.current.selectionStartX,A)}),g.current.moved=!0;else if(s==="pan"&&g.current.mouseDownAchorX!==null&&g.current.mouseDownAnchorPixelToTime!==null){const T=g.current.mouseDownAnchorPixelToTime(A),B=g.current.mouseDownAnchorTime,x=g.current.mouseDownAnchorVisibleStartTime;if(B!==null&&x!==null){const R=T-B,F=A-g.current.mouseDownAchorX;if(Math.abs(F)>2||Math.abs(R)>.01){const z=x-R;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:S,handleMouseDown:y,handleMouseUp:D,handleMouseMove:w,handleMouseOut:b}},c7=({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}},f7=23,d7=60,h7=(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)},m7=(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)},p7=(e,t)=>Math.floor(e*Math.pow(10,-(t+1)))*Math.pow(10,t+1),g7=(e,t,n)=>{const r=e-0,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}},v7=(e,t,n,r,i)=>{const a=h7(t,n,r,e).map(l=>Math.round(l*1e9)/1e9),o=m7(t,n);return a.map(l=>g7(l,o,i))},QS={ticks:[],datamin:0,datamax:0},y7=(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}},KS=e=>{const{datamin:t,datamax:n,userSpecifiedZoom:r}=e;let{pixelHeight:i}=e;i<=1&&(i=1);const a=r??1;if(t===void 0||n===void 0||t===n)return QS;const o=t/a,u=n/a,l=u-o,s=i/d7,c=i/f7,f=y7(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."),QS;const h=p7(o,f.scale);return{ticks:v7(h,o,u,d,f.scale),datamin:o,datamax:u}},b7=e=>{const{datamin:t,datamax:n,userSpecifiedZoom:r}=e;let{pixelHeight:i}=e;return i<=1&&(i=1),M.useMemo(()=>KS({datamin:t,datamax:n,userSpecifiedZoom:r,pixelHeight:i}),[n,t,i,r])},WS=({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:S=!1,drawContentForExport:p,setDrawForExport:g})=>{const{visibleStartTimeSec:y,visibleEndTimeSec:D,zoomTimeseriesSelection:w,panTimeseriesSelection:b,setVisibleTimeRange:E}=_f(),{currentTime:A,setCurrentTime:C,startTimeSec:T,endTimeSec:B}=Mf(),x=M.useMemo(()=>[y,D],[y,D]),{margins:R,canvasWidth:F,canvasHeight:z}=c7({width:e,height:t,leftMargin:d,customToolbarActions:h,hideNavToolbar:m}),N=M.useMemo(()=>y===void 0||D===void 0?()=>0:D<=y?()=>0:H=>R.left+(H-y)/(D-y)*(F-R.left-R.right),[F,y,D,R]),U=M.useMemo(()=>y===void 0||D===void 0?()=>0:D<=y?()=>0:H=>y+(H-R.left)/(F-R.left-R.right)*(D-y),[F,y,D,R]),I=M.useMemo(()=>{const H=s?.yMin||0,G=s?.yMax||0;return G<=H?()=>0:ie=>z-R.bottom-(ie-H)/(G-H)*(z-R.top-R.bottom)},[s,z,R]),L=WN(F,y,D,N),X=b7({datamin:s?.yMin||0,datamax:s?.yMax||0,pixelHeight:z-R.left-R.right}),Z=M.useMemo(()=>({datamin:X.datamin,datamax:X.datamax,ticks:X.ticks.map(H=>({...H,pixelValue:I(H.dataValue)}))}),[X,I]),P=z,j=M.useMemo(()=>_.jsx(a7,{width:F,height:P,timeRange:x,margins:R,timeTicks:L,yTickSet:s?.showTicks?Z:void 0,yLabel:s?.yLabel,gridlineOpts:r,hideTimeAxisLabels:S}),[r,F,P,x,R,L,s?.showTicks,s?.yLabel,Z,S]),Y=M.useMemo(()=>A!==void 0?N(A):void 0,[A,N]),$=M.useMemo(()=>_.jsx(u7,{width:F,height:P,timeRange:x,margins:R,currentTimePixels:Y}),[F,P,x,R,Y]),q=M.useRef(null),[V,te]=M.useState("pan"),{isViewClicked:W,hoverTime:ne,selectionRect:fe,handleMouseDown:ee,handleMouseUp:le,handleMouseMove:se,handleMouseOut:De}=s7({pixelToTime:U,visibleStartTimeSec:y,setCurrentTime:C,onMouseDown:a,onMouseUp:l,onMouseMove:o,onMouseOut:u,onCanvasClick:v,interactionMode:V});M.useEffect(()=>{(f===!1||W)&&XN(q)},[f,W]);const be=M.useCallback(H=>{if(c&&!H.shiftKey||H.deltaY===0||f!==!1&&!W)return;const G=-H.deltaY/100;w(G>0?"in":"out",1.2,ne)},[c,w,ne,f,W]),xe=M.useCallback(H=>{H.key==="="?w("in"):H.key==="-"?w("out"):H.key==="ArrowRight"?b("forward"):H.key==="ArrowLeft"&&b("back"),i&&i(H)},[i,w,b]),we=M.useCallback(()=>{T!==void 0&&B!==void 0&&E(T,B)},[T,B,E]),Re=M.useMemo(()=>_.jsx(l7,{width:F,height:P,selectionRect:fe}),[F,P,fe]),[Ce,Be]=M.useState(null);M.useEffect(()=>{Ce&&n(Ce,F,z,R)},[Ce,F,z,R,n]),M.useEffect(()=>{if(!g)return;g(async G=>{if(!G||!R)return;const ie=oe=>{const de=s?.yMin||0,ue=s?.yMax||0;return ue<=de?0:G.height-R.bottom-(oe-de)/(ue-de)*(G.height-R.top-R.bottom)},J=YS(G.width,y,D,N),he=KS({datamin:s?.yMin,datamax:s?.yMax,pixelHeight:G.height});for(const oe of he.ticks)oe.pixelValue=ie(oe.dataValue);ZS(G.context,{timeTicks:J,margins:R,gridlineOpts:r,yTickSet:he,yLabel:s?.yLabel,width:G.width,height:G.height,hideTimeAxisLabels:S}),p&&await p(G.context,G.width,G.height,R,{exporting:!0})})},[p,g,R,y,D,N,x,r,s,S,I]);const pe=M.useMemo(()=>_.jsxs("div",{style:{position:"relative",overflow:"hidden",width:F,height:P},onWheel:!f||W?be:void 0,onMouseDown:ee,onMouseUp:le,onMouseMove:se,onMouseOut:De,tabIndex:0,onKeyDown:xe,children:[j,_.jsx("canvas",{style:{position:"absolute",width:F,height:P},ref:H=>Be(H),width:F,height:P}),$,Re]}),[j,$,Re,F,P,xe,be,ee,le,se,De,f,W]),O=M.useMemo(()=>_.jsx(QN,{width:e,height:40,interactionMode:V,onInteractionModeChange:te,currentTime:A,onZoomToFit:we}),[e,V,te,A,we]),k=M.useMemo(()=>_.jsx(YN,{width:e,height:40,customActions:h}),[e,h]);return _.jsxs("div",{className:"time-scroll-view-3",ref:q,style:{position:"absolute",width:e,height:t,background:"white"},children:[pe,!m&&_.jsxs("div",{style:{position:"absolute",bottom:0,left:0,right:0},children:[O,k]})]})},JS=15,D7={hideX:!1,hideY:!0},S7={showTicks:!1,yMin:void 0,yMax:void 0},x7=({dataClient:e,width:t,height:n,setDrawForExport:r})=>{const{visibleStartTimeSec:i,visibleEndTimeSec:a}=_f(),{initializeTimeseriesSelection:o}=Mf(),{selectedUnitIds:u,unitIdSelectionDispatch:l}=qr(),[s,c]=M.useState(void 0),f=M.useRef(null),[d,h]=M.useState(null),[v,m]=M.useState(null),[S,p]=M.useState(!1),[g,y]=M.useState(null),[D,w]=M.useState(null),b=M.useMemo(()=>i===void 0||a===void 0?"raster":a-i>120?"heatmap":"raster",[i,a]),E=e.metadata.unitIds;M.useEffect(()=>{e.metadata&&o({startTimeSec:e.metadata.startTimeSec,endTimeSec:e.metadata.endTimeSec,initialVisibleStartTimeSec:e.metadata.startTimeSec,initialVisibleEndTimeSec:e.metadata.endTimeSec})},[o,e.metadata]),M.useEffect(()=>{let $=!1;const q=async()=>{if(!(i===void 0||a===void 0))try{if(b==="raster"){const V=await e.getDataForRange({startTimeSec:i,endTimeSec:a});if($)return;m(V),w(null)}else{const V=e.getSpikeCountsForRange({startTimeSec:i,endTimeSec:a});if($)return;w(V),m(null)}y(null)}catch(V){if($)return;console.error("Error loading data:",V),y(`Error loading data: ${V}`)}};return p(!0),q().finally(()=>{$||p(!1)}),()=>{$=!0}},[e,i,a,b]);const{onlyShowSelected:A,customToolbarActions:C}=GS(),[T,B]=M.useState(t),[x,R]=M.useState(n),[F,z]=M.useState(null),N=M.useMemo(()=>{const $=[];return A&&E.forEach((q,V)=>{u.has(q)&&$.push(V)}),$},[A,u,E]),U=M.useMemo(()=>N.map($=>E[$]),[N,E]),I=M.useCallback(()=>{if(!F||!f.current||!d||!D||!e.metadata||i===void 0||a===void 0)return;if(d.clearRect(0,0,T,x),S&&(d.fillStyle="rgba(0, 0, 0, 0.02)",d.fillRect(0,0,T,x),d.fillStyle="black",d.font="16px Arial",d.textAlign="center",d.fillText("Loading...",T/2,x/2)),g){d.fillStyle="rgba(255, 0, 0, 0.1)",d.fillRect(0,0,T,x),d.fillStyle="red",d.font="14px Arial",d.textAlign="center",d.fillText(g,T/2,x/2);return}const q=x-F.top-F.bottom,V=T-F.left-F.right,te=a-i;let W;if(A){let ee=0;E.forEach((le,se)=>{u.has(le)&&ee++}),W=ee}else E.forEach((ee,le)=>{}),W=E.length;const ne=q/(W||1);d.save(),d.beginPath(),d.rect(F.left,F.top,V,q),d.clip();let fe=1;if(D.counts.forEach(ee=>{A?N.forEach(le=>{const se=ee[le];se>fe&&(fe=se)}):ee.forEach(le=>{le>fe&&(fe=le)})}),D.counts.forEach((ee,le)=>{const se=D.binEdges[le],De=D.binEdges[le+1],be=F.left+(se-i)/te*V,xe=F.left+(De-i)/te*V;if(A)for(let we=0;we<N.length;we++){const Re=N[we],Be=ee[Re]/fe,pe=F.top+(N.length-1-we)*ne,O=ex(Be);d.fillStyle=O,d.fillRect(be,pe,xe-be+.5,ne)}else ee.forEach((we,Re)=>{const Ce=we/fe,Be=F.top+(E.length-1-Re)*ne,pe=ex(Ce);d.fillStyle=pe,d.fillRect(be,Be,xe-be+.5,ne)})}),d.restore(),ne>=JS){d.globalAlpha=1;const ee=A?U:E;ee.forEach((le,se)=>{const be=F.top+(ee.length-1-se)*ne+ne/2,xe=mh(Ct(le));d.fillStyle=xe,d.font="12px Arial",d.textAlign="right",d.fillText(`Unit ${le}`,F.left-5,be)})}},[T,x,F,D,i,a,e.metadata,S,g,d,u,A,E,N,U]),L=M.useCallback(()=>{if(!F||!f.current||!d||!v||!e.metadata||i===void 0||a===void 0)return;if(d.clearRect(0,0,T,x),S&&(d.fillStyle="rgba(0, 0, 0, 0.02)",d.fillRect(0,0,T,x),d.fillStyle="black",d.font="16px Arial",d.textAlign="center",d.fillText("Loading...",T/2,x/2)),g){d.fillStyle="rgba(255, 0, 0, 0.1)",d.fillRect(0,0,T,x),d.fillStyle="red",d.font="14px Arial",d.textAlign="center",d.fillText(g,T/2,x/2);return}const q=x-F.top-F.bottom,V=T-F.left-F.right,te=a-i,W=e.metadata.unitIds,ne={};let fe;if(A){for(let le=0;le<N.length;le++){const se=N[le];ne[se]=le}fe=N.length}else W.forEach((le,se)=>{ne[se]=se}),fe=W.length;const ee=q/(fe||1);d.save(),d.beginPath(),d.rect(F.left,F.top,V,q),d.clip();for(let le=0;le<v.timestamps.length;le++){const se=v.timestamps[le],De=ne[v.unitIndices[le]];if(De===void 0)continue;const be=W[v.unitIndices[le]],xe=F.top+(fe-1-De)*ee+ee/2,we=mh(Ct(be)),Re=s===be,Ce=u.has(be);d.strokeStyle=we,d.lineWidth=Re||Ce?2:1,d.globalAlpha=Ce?1:Re?.8:.6;const Be=F.left+(se-i)/te*V;d.beginPath(),d.moveTo(Be,xe-ee*.4),d.lineTo(Be,xe+ee*.4),d.stroke()}if(d.restore(),ee>=JS){d.globalAlpha=1;const le=A?U:W;le.forEach((se,De)=>{const xe=F.top+(le.length-1-De)*ee+ee/2,we=mh(Ct(se));d.fillStyle=we,d.font="12px Arial",d.textAlign="right",d.fillText(`Unit ${se}`,F.left-5,xe)})}},[T,x,F,v,e.metadata,i,a,S,g,s,u,A,d,U,N]);M.useEffect(()=>{b==="heatmap"&&D?I():L()},[L,I,b,D]);const X=M.useCallback(()=>{},[]),Z=M.useCallback($=>{if(!F||!e.metadata)return;const q=e.metadata.unitIds,V=q.length,te=1-($.y-F.top)/(x-F.top-F.bottom),W=Math.round(te*V-.5);if(0<=W&&W<V)return q[W]},[x,F,e.metadata]),P=M.useCallback($=>{const q=$.currentTarget.getBoundingClientRect(),V={x:$.clientX-q.x,y:$.clientY-q.y},te=Z(V);$.shiftKey||$.ctrlKey?l({type:"TOGGLE_UNIT",targetUnit:te}):l({type:"UNIQUE_SELECT",targetUnit:te})},[Z,l]),j=M.useCallback($=>{const q=$.currentTarget.getBoundingClientRect(),V={x:$.clientX-q.x,y:$.clientY-q.y},te=Z(V);te!==void 0&&c(te)},[Z]),Y=M.useCallback(()=>{c(void 0)},[]);return e.metadata?_.jsx(WS,{width:t,height:n,customToolbarActions:C,onCanvasElement:($,q,V,te)=>{f.current=$;const W=$?.getContext("2d");h(W),B(q),R(V),z(te)},gridlineOpts:D7,onKeyDown:X,onMouseDown:P,onMouseMove:j,onMouseOut:Y,yAxisInfo:S7,setDrawForExport:r}):_.jsx("div",{children:"Loading metadata..."})},ex=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 w7=({zarrGroup:e,contexts:t,width:n,height:r,setDrawForExport:i})=>{const a=E7(e);return a?_.jsx(tx,{context:t.timeseriesSelection,children:_.jsx(Jr,{context:t.unitSelection,children:_.jsx(x7,{dataClient:a,width:n,height:r,setDrawForExport:i})})}):null},tx=({context:e,children:t})=>{const{state:n,dispatch:r}=Ef(e);return!r||!n?_.jsx(_.Fragment,{children:"Waiting for context..."}):_.jsx(VS.Provider,{value:{timeseriesSelection:n,dispatch:r},children:t})},E7=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},A7=({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),S=fl,{onlyShowSelected:p,customToolbarActions:g}=GS(),[y,D]=M.useState(t),[w,b]=M.useState(n),[E,A]=M.useState(null),C=e.metadata;M.useEffect(()=>{C&&i({type:oo,newUnitOrder:yr(C.unitIds)})},[C,i]),M.useEffect(()=>{C&&a({startTimeSec:C.startTimeSec,endTimeSec:C.endTimeSec,initialVisibleStartTimeSec:C.startTimeSec,initialVisibleEndTimeSec:C.endTimeSec})},[a,C]),M.useEffect(()=>{let x=!1;const R=async()=>{if(o!==void 0&&u!==void 0){let F=1e4;for(;;){const z=await e.getDataForRange({startTimeSec:o,endTimeSec:u},{maxNumEvents:F});if(x)return;if(z&&f(z),z.subsampleFactor>1){if(F===1e6)break;F=Math.max(F*3,z.timestamps.length*3),F>1e6&&(F=1e6)}else break}}};return h(!0),m(null),R().catch(F=>{x||m(`Failed to load data: ${F}`),m(`Failed to load data: ${F}`)}).finally(()=>{h(!1)}),()=>{x=!0}},[o,u,e]);const T=M.useMemo(()=>{if(!c||!C||c.amplitudes.length===0)return{yMin:0,yMax:10};let x=1/0,R=-1/0;for(let z=0;z<c.amplitudes.length;z++){const N=C.unitIds[c.unitIndices[z]];if(p?r.has(N):!0){const I=c.amplitudes[z];I<x&&(x=I),I>R&&(R=I)}}if(x===1/0)return{yMin:0,yMax:10};const F=(R-x)*.1;return{yMin:x-F,yMax:R+F}},[c,C,p,r]);M.useEffect(()=>{if(!l||!c||!C||!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 F=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=C.unitIds[c.unitIndices[N]];if(U<o||U>u||!(p?r.has(L):!0))continue;const Z=wr(Ct(L)),j=r.has(L)?1:.3;l.fillStyle=Z,l.globalAlpha=j;const Y=F(U),$=z(I);l.beginPath(),l.arc(Y,$,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,C,o,u,y,w,E,T,r,p,d,v]);const B=M.useMemo(()=>({showTicks:!0,yMin:T.yMin,yMax:T.yMax,yLabel:"Amplitude"}),[T]);return C?_.jsx("div",{children:_.jsxs(Ro,{width:t,height:n,initialPosition:S,adjustable:!1,children:[_.jsx(dl,{width:S,height:n}),_.jsx(WS,{width:t-S,height:n,onCanvasElement:(x,R,F,z)=>{if(!x)return;const N=x.getContext("2d");s(N),D(R),b(F),A(z)},yAxisInfo:B,customToolbarActions:g})]})}):_.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 C7=({zarrGroup:e,contexts:t,width:n,height:r})=>{const i=T7(e);return i?_.jsx(tx,{context:t.timeseriesSelection,children:_.jsx(Jr,{context:t.unitSelection,children:_.jsx(A7,{dataClient:i,width:n,height:r})})}):null},T7=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},M7=25,qm=2*Math.PI,_7={maxElectrodePixelRadius:M7},Vm={},zo=8,B7=()=>({selectedElectrodeIds:[]}),F7=e=>{const{width:t,height:n,electrodes:r,units:i,disableAutoRotate:a,onlyShowSelected:o}=e,{selectedElectrodeIds:u}=B7(),{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||_7.maxElectrodePixelRadius,m=e.colors??hl,S=e.showLabels??!1,p=e.offsetLabels??!1,{convertedElectrodes:g,pixelRadius:y,transform:D}=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,X=g.map(Z=>{const P=(u||[]).includes(Z.e.id),j=!1,Y=!1,$=P?Y?m.draggedSelected:j?m.selectedHover:m.selected:Y?m.dragged:j?m.hover:m.base;return{...Z,color:$,textColor:P||j&&!Y?m.textDark:m.textLight}});if(U.clearRect(0,0,U.canvas.width,U.canvas.height),X.forEach(Z=>{const P=ha(c,{x:Z.pixelX,y:Z.pixelY});U.fillStyle=Z.color,U.beginPath(),U.ellipse(P.x,P.y,L,L,0,0,qm),U.fill()}),U.strokeStyle=hl.border,g.forEach(Z=>{const P=ha(c,{x:Z.pixelX,y:Z.pixelY});U.beginPath(),U.ellipse(P.x,P.y,L,L,0,0,qm),U.stroke()}),S){U.font=`${L}px Arial`,U.textAlign=p?"right":"center",U.textBaseline="middle";const Z=p?1.4*L:0;X.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-Z,j.y)})}},[m,p,g,y,u,S,c,w]),E=M.useCallback((U,I)=>{const L=zo;U.clearRect(0,0,U.canvas.width,U.canvas.height);const X=(Z,P,j)=>{U.fillStyle=j,U.strokeStyle="black",U.beginPath(),U.ellipse(Z,P,L,L,0,0,qm),U.fill(),U.stroke()};for(const Z of h){const P=Xh(D,[Z.x,Z.y]),j=ha(c,{x:P[0],y:P[1]}),Y=l.size===0||l.has(Z.unitId)?wr(Ct(Z.unitId)):"rgb(220, 220, 220)";X(j.x,j.y,Y)}},[D,h,l,c]),A=M.useMemo(()=>_.jsx(ir,{width:t,height:n,draw:b,drawData:Vm}),[t,n,b]),C=M.useMemo(()=>_.jsx(ir,{width:t,height:n,draw:E,drawData:Vm}),[t,n,E]),T=M.useCallback((U,{ctrlKey:I})=>{const L=N7(c,U),X=km(c),Z=zo/Math.sqrt(X),P=[];for(const j of h){const Y=Xh(D,[j.x,j.y]);Yh(Ff([Y[0]-Z,Y[1]-Z,Z*2,Z*2]),Ff(L))&&(Ff([Y[0]-Z,Y[1]-Z,Z*2,Z*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})},[D,s,h,c]),B=M.useCallback((U,{ctrlKey:I})=>{let L=!1;for(const X of h){const Z=Xh(D,[X.x,X.y]);n_(U,Ff([Z[0]-zo,Z[1]-zo,zo*2,zo*2]))&&(L=!0,s(I?{type:"TOGGLE_UNIT",targetUnit:X.unitId}:{type:"SET_SELECTION",incomingSelectedUnitIds:[X.unitId]}))}L||s({type:"SET_SELECTION",incomingSelectedUnitIds:[]})},[D,s,h]),{onMouseMove:x,onMouseDown:R,onMouseUp:F,paintDragSelectLayer:z}=Hs(t,n,T,B),N=M.useMemo(()=>_.jsx(ir,{width:t,height:n,draw:z,drawData:Vm}),[t,n,z]);return t>0&&n>0?_.jsxs("div",{style:{width:t,height:n,position:"relative"},onMouseMove:x,onMouseUp:F,onMouseDown:R,onWheel:f,children:[A,C,N]}):_.jsx("div",{})},Ff=e=>({xmin:e[0],ymin:e[1],xmax:e[0]+e[2],ymax:e[1]+e[3]}),N7=(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]},R7=e=>{const{data:t,width:n,height:r}=e,[i,a]=M.useState({...xf,onlyShowSelected:!1}),o=30,u=Object.keys(t.channelLocations),l=vN(u,t.channelLocations),s=M.useMemo(()=>({width:n-20,height:r-o,top:0,position:"absolute"}),[n,r]);return _.jsxs("div",{children:[_.jsx("div",{style:s,children:_.jsx(F7,{width:n-20,height:r-o,electrodes:l,units:t.units,disableAutoRotate:t.disableAutoRotate,onlyShowSelected:i.onlyShowSelected})}),_.jsx("div",{style:{position:"absolute",top:r-o,height:o,overflow:"hidden"},children:_.jsx(wf,{options:i,setOptions:a})})]})},O7=({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 S=new Float32Array(m);if(S.length!==h.length*2)throw new Error(`Expected coords length ${h.length*2}, got ${S.length}`);const p=[];for(let g=0;g<h.length;g++)p.push({unitId:h[g],x:S[g*2],y:S[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?_.jsxs("div",{style:{width:n,height:r,display:"flex",alignItems:"center",justifyContent:"center",color:"#666",backgroundColor:"#f5f5f5"},children:["Error: ",o]}):l?_.jsx("div",{style:{width:n,height:r,display:"flex",alignItems:"center",justifyContent:"center",color:"#666",backgroundColor:"#f5f5f5"},children:"Loading unit locations data..."}):i?_.jsx(Jr,{context:t.unitSelection,children:_.jsx(R7,{data:i,width:n,height:r})}):_.jsx("div",{style:{width:n,height:r,display:"flex",alignItems:"center",justifyContent:"center",color:"#666",backgroundColor:"#f5f5f5"},children:"No unit locations data available"})},z7=({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]),S=M.useCallback(p=>{i&&i(p)},[i]);return _.jsxs(vF,{className:"NiceTable",children:[_.jsx(FF,{children:_.jsxs(SS,{children:[_.jsx(Sf,{style:{width:0}},"_first"),t.map(p=>_.jsx(Sf,{children:p.element?p.element:_.jsx("span",{children:p.label})},p.key))]})}),_.jsx(xF,{children:e.map(p=>_.jsxs(SS,{children:[_.jsxs(Sf,{children:[n&&(f===p.key?_.jsx(I7,{title:r||"",onConfirmDeleteRow:m,rowKey:p.key}):_.jsx(U7,{title:r||"",onDeleteRow:v,rowKey:p.key})),i&&_.jsx($7,{title:a||"",onEditRow:S,rowKey:p.key}),o!=="none"&&_.jsx(hS,{checked:c[p.key]||!1,onClick:()=>h(p.key),disabled:s})]}),t.map(g=>_.jsx(Sf,{children:_.jsx("span",{children:k7(p.columnValues[g.key])})},g.key))]},p.key))})]})},U7=({title:e,rowKey:t,onDeleteRow:n})=>{const r=M.useCallback(()=>{n&&n(t)},[n,t]);return _.jsx(cl,{title:e,onClick:r,children:_.jsx(YD,{})})},I7=({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 _.jsxs("span",{children:["Confirm delete?",_.jsx(cl,{title:e,onClick:r,children:_.jsx(YD,{})}),_.jsx(cl,{title:"Cancel",onClick:i,children:_.jsx(R_,{})})]})},$7=({title:e,rowKey:t,onEditRow:n})=>_.jsx(cl,{title:e,onClick:()=>n&&n(t),children:_.jsx(N_,{})}),k7=e=>e==0?e:e?typeof e=="object"?e.element?e.element:e.text||"":e:"",L7=({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 _.jsx("div",{style:{position:"absolute",width:e,height:t},children:_.jsx(z7,{rows:o,columns:a,selectedRowKeys:n,onSelectedRowKeysChanged:u,selectionMode:"multiple"})})},j7=(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)},H7=e=>_.jsx(ir,{width:e.width,height:e.height,draw:j7,drawData:e}),P7={},q7=({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)},A=o-E.left-E.right,C=u-E.top-E.bottom,T=e.map(R=>({key:R.key,x1:E.left+(R.xStart-l)/(s-l)*A,x2:E.left+(R.xEnd-l)/(s-l)*A,y1:E.top+C*(1-R.height/c),y2:E.top+C,tooltip:R.tooltip,color:R.color})),B=n?n.map(R=>({x:E.left+(R.x-l)/(s-l)*A,label:`${R.label}`})):void 0,x=r?r.map(R=>({x:E.left+(R.x-l)/(s-l)*A,color:R.color})):void 0;return{barBoxes:T,margins:E,pixelTicks:B,pixelVerticalLines:x}},[e,n,r,l,s,c,o,u,i]),m=M.useCallback((E,{ctrlKey:A,shiftKey:C})=>{const T=[],B={x:E[0],y:E[1],width:E[2],height:E[3]};for(const z of f)z.x1<=B.x+B.width&&z.x2>=B.x&&T.push(z.key);const x=o-d.left-d.right,R=(B.x-d.left)/x*(s-l)+l,F=(B.x+B.width-d.left)/x*(s-l)+l;a&&a(B,T,{ctrlKey:A,shiftKey:C,xMin:R,xMax:F})},[f,a,d.left,d.right,o,l,s]),S=M.useCallback(()=>{},[]),{onMouseMove:p,onMouseDown:g,onMouseUp:y,onMouseLeave:D,paintDragSelectLayer:w}=Hs(o,u,m,S),b=M.useMemo(()=>_.jsx(ir,{width:o,height:u,draw:w,drawData:P7}),[o,u,w]);return _.jsxs("div",{style:{width:o,height:u,position:"relative"},onMouseDown:g,onMouseMove:p,onMouseUp:y,onMouseLeave:D,children:[_.jsx(H7,{barBoxes:f,margins:d,pixelTicks:h,pixelVerticalLines:v,xLabel:i,width:o,height:u}),b]})},V7=(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},G7=({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),S=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 Y7(h,v,S,a||10)},[n,e,r,a]),d=M.useCallback((h,v,{ctrlKey:m,shiftKey:S,xMin:p,xMax:g})=>{if(S){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 A=s[E];y.push(A)}const D=Math.min(...y.map(E=>E.xStart)),w=Math.max(...y.map(E=>E.xEnd)),b=[];for(const E of n){const A=E.values[e.key];A!==void 0&&D<=A&&A<=w&&b.push(E.unitId)}i(m||S?[...new Set([...r,...b])]:b)},[s,e,r,i,n,o]);return _.jsx(q7,{width:u,height:l,bars:s,range:t,ticks:c,verticalLines:f,onSelectRect:d})},Y7=(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=X7(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}},X7=(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 V7(e*r,t*r).map(i=>i/r)},Z7=(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()})},Q7=e=>_.jsx(ir,{width:e.width,height:e.height,draw:Z7,drawData:e}),K7={},W7=({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,A,C;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?(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:E,yMin:A,yMax:C}},[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:A})=>{const C={x:b[0],y:b[1],width:b[2],height:b[3]},T=[];for(const x of e){const R=d({x:x.x,y:x.y}),F={xmin:R.x-x.radius,ymin:R.y-x.radius,xmax:R.x+x.radius,ymax:R.y+x.radius};Yh({xmin:C.x,xmax:C.x+C.width,ymin:C.y,ymax:C.y+C.height},F)&&T.push(x.key)}const B=J7(h,C);r&&r(B,T,{ctrlKey:E,shiftKey:A})},[r,h,e,d]),m=M.useCallback((b,{ctrlKey:E,shiftKey:A})=>{const C={x:b[0],y:b[1]},T={x:C.x,y:C.y,width:1,height:1};let B;for(const x of e){const R=d({x:x.x,y:x.y}),F={xmin:R.x-x.radius,ymin:R.y-x.radius,xmax:R.x+x.radius,ymax:R.y+x.radius};Yh({xmin:T.x,xmax:T.x+T.width,ymin:T.y,ymax:T.y+T.height},F)&&(B=x.key)}i&&i(h(C),B,{ctrlKey:E,shiftKey:A})},[d,e,i,h]),{onMouseMove:S,onMouseDown:p,onMouseUp:g,onMouseLeave:y,paintDragSelectLayer:D}=Hs(a,o,v,m),w=M.useMemo(()=>_.jsx(ir,{width:a,height:o,draw:D,drawData:K7}),[a,o,D]);return _.jsxs("div",{style:{width:a,height:o,position:"relative"},onMouseDown:p,onMouseMove:S,onMouseUp:g,onMouseLeave:y,children:[_.jsx(Q7,{markers:e,margins:u,coord2Pixel:d,width:a,height:o}),w]})},J7=(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)}},eR=({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 S=m.values[e.key],p=m.values[t.key];S!==void 0&&p!==void 0&&v.push({key:m.unitId,x:S,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:S,shiftKey:p})=>{if(p){u&&u(v);return}let g=m;S&&(g=[...new Set([...m,...a])]),o(g)},[o,a,u]),h=M.useCallback((v,m,{ctrlKey:S,shiftKey:p})=>{let g;if(S||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 _.jsx(W7,{width:l,height:s,markers:f,xRange:n,yRange:r,onSelectRect:d,onClickPoint:h})},tR=({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 _.jsx(G7,{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 _.jsx(eR,{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 _.jsx("div",{style:{width:c,textAlign:"center"},children:t?.label||_.jsx("span",{children:" "})});if(e==="left-label")return _.jsx("div",{style:{width:c,height:f,overflow:"hidden",writingMode:"vertical-lr",transform:"rotate(-180deg)",textAlign:"center"},children:t?.label||_.jsx("span",{children:" "})});throw Error(`Unexpected type: ${e}`)}},nR=({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:_.jsx(Tc,{})},{type:"button",callback:()=>s(w=>w/1.3),title:"Decrease box size",icon:_.jsx(Cc,{})}]:[],y=[{type:"text",content:"# bins",title:""},{type:"button",callback:()=>f(w=>w+5),title:"Increase num. histogram bins",icon:_.jsx(Tc,{})},{type:"button",callback:()=>f(w=>Math.max(5,w-5)),title:"Decrease num. histogram bins",icon:_.jsx(Cc,{})}],D={type:"button",callback:()=>h({}),title:"Reset zoom",text:"reset"};return[...g,{type:"divider"},...y,{type:"divider"},D]},[u.length]),S=fl,p=M.useMemo(()=>{const g=y=>{o({type:"SET_SELECTION",incomingSelectedUnitIds:y})};if(u.length===0)return i.map(y=>{const D={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:D}});{const{plotWidth:w,plotHeight:b}=PS(t-S-30-10,n-30-10,u.length),E=[];for(const A of u){const C=i.filter(T=>T.key===A)[0];{const T={type:"left-label",metric1:C,metric2:C,units:v,numHistogramBins:c,width:30,height:b,selectedUnitIds:a,setSelectedUnitIds:g};E.push({key:`left-label-${A}`,label:void 0,unitId:"",labelColor:"black",props:T,hideBorderColor:!0})}for(const T of u){const B=i.filter(x=>x.key===T)[0];if(C&&B){const x={type:A===T?"histogram":"scatter",metric1:B,metric2:C,metric1Range:d[B.key],metric2Range:d[C.key],units:v,numHistogramBins:c,width:w,height:b,selectedUnitIds:a,setSelectedUnitIds:g,onZoomToRect:R=>{h(A!==T?{...d,[B.key]:{min:R.x,max:R.x+R.width},[C.key]:{min:R.y,max:R.y+R.height}}:{...d,[C.key]:{min:R.x,max:R.x+R.width}})}};E.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:v,numHistogramBins:c,width:30,height:30,selectedUnitIds:a,setSelectedUnitIds:g};E.push({key:"left-bottom-label",label:void 0,unitId:"",labelColor:"black",props:A,hideBorderColor:!0})}for(const A of u){const C=i.filter(B=>B.key===A)[0],T={type:"bottom-label",metric1:C,metric2:C,units:v,numHistogramBins:c,width:w,height:30,selectedUnitIds:a,setSelectedUnitIds:g};E.push({key:`bottom-label-${A}`,label:void 0,unitId:"",labelColor:"black",props:T,hideBorderColor:!0})}return E}},[i,a,v,l,u,c,t,n,o,d,S]);return _.jsxs(Ro,{width:t,height:n,initialPosition:S,adjustable:!1,children:[_.jsx(dl,{width:S,height:n,customActions:m}),_.jsx(wc,{width:0,height:0,disableScroll:u.length>0,children:_.jsx(xc,{plots:p,plotComponent:tR,numPlotsPerRow:u.length===0?void 0:u.length+1})})]})},rR=({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]),_.jsxs(Ro,{width:t,height:n,initialPosition:200,adjustable:!0,children:[_.jsx(L7,{width:0,height:0}),_.jsx(nR,{data:e,width:0,height:0})]})},iR=e=>js(e,{key:Ls,label:Ls,dtype:Ls}),aR=e=>js(e,{unitId:IA([UA,Ls]),values:()=>!0}),oR=e=>js(e,{type:$A("UnitMetricsGraph"),metrics:Cy(iR),units:Cy(aR)}),uR=({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),S=JSON.parse(m);if(c)return;const p={type:"UnitMetricsGraph",metrics:d,units:S.map(g=>({unitId:g.unit_id,values:g.values}))};if(!oR(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?_.jsxs("div",{style:{width:n,height:r,display:"flex",alignItems:"center",justifyContent:"center",color:"#666",backgroundColor:"#f5f5f5"},children:["Error: ",o]}):l?_.jsx("div",{style:{width:n,height:r,display:"flex",alignItems:"center",justifyContent:"center",color:"#666",backgroundColor:"#f5f5f5"},children:"Loading unit metrics data..."}):i?_.jsx(lR,{context:t.unitMetricSelection,children:_.jsx(Jr,{context:t.unitSelection,children:_.jsx(rR,{data:i,width:n,height:r})})}):_.jsx("div",{style:{width:n,height:r,display:"flex",alignItems:"center",justifyContent:"center",color:"#666",backgroundColor:"#f5f5f5"},children:"No unit metrics data available"})},lR=({context:e,children:t})=>{const{state:n,dispatch:r}=Ef(e);return!r||!n?_.jsx(_.Fragment,{children:"Waiting for unit metric selection context..."}):_.jsx(hy.Provider,{value:{unitMetricSelection:n,unitMetricSelectionDispatch:r},children:t})},nx=()=>{const e={current:{}},t=[];return{stateRef:e,dispatch:i=>{e.current=rA(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:nx}},rx=()=>{const e={current:Sy},t=[];return{stateRef:e,dispatch:i=>{e.current=BA(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:rx}},ix=()=>{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:ix}},sR=({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]),_.jsx(o,{zarrGroup:f,width:u,height:s,contexts:a})},cR=e=>t=>{const{container:n,zarrGroup:r,width:i,height:a,onResize:o,onDataChange:u,contexts:l}=t;nA.createRoot(n).render(_.jsx(sR,{zarrGroup:r,width:i,height:a,onResize:o,onDataChange:u,contexts:l,component:e}))};(()=>{const e=[{name:"spike_sorting.Autocorrelograms",component:QF},{name:"spike_sorting.AverageWaveforms",component:kN},{name:"spike_sorting.CrossCorrelograms",component:HN},{name:"spike_sorting.RasterPlot",component:w7},{name:"spike_sorting.SpikeAmplitudes",component:C7},{name:"spike_sorting.UnitLocations",component:O7},{name:"spike_sorting.UnitMetricsGraph",component:uR},{name:"spike_sorting.UnitsTable",component:uN},{name:"spike_sorting.SortingCuration",component:aN}],t=window.figpack_p1.registerFPViewComponent;for(const i of e)t({name:i.name,render:cR(i.component)});const n=window.figpack_p1.registerFPViewContextCreator;n({name:"unitSelection",create:rx}),n({name:"unitMetricSelection",create:nx}),n({name:"sortingCuration",create:ix});const r=window.figpack_p1.registerFPExtension;r({name:"figpack-spike-sorting"})})()})();