@college-africa/chat-ui 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,23 +1,23 @@
1
- "use strict";var Od=Object.defineProperty;var Ad=(e,t,r)=>t in e?Od(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var er=(e,t,r)=>Ad(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("react/jsx-runtime"),U=require("react"),z=require("@mui/material"),jd=require("sdk"),kd=require("@emotion/styled");require("@emotion/react");function $d(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const nr=$d(U);let Ct=null;async function Sl(e,t){return Ct||(Ct=new jd.ChatSDK(e),t&&await Ct.setAuthToken(t),await Ct.connect(),Ct)}function jt(){if(!Ct)throw new Error("SDK not initialized. Call initSDK() first.");return Ct}function Ka(){Ct&&(Ct.disconnect(),Ct=null)}function Id(){return Ct!==null}const pi=(e,t)=>e instanceof Error?e:new Error(t),Pd=()=>k.jsx(z.Box,{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh",children:k.jsx(z.CircularProgress,{})}),Rd=({error:e,retry:t})=>k.jsx(z.Box,{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh",p:2,children:k.jsxs(z.Alert,{severity:"error",action:k.jsx(z.Button,{onClick:t,children:" Retry"}),children:[k.jsx(z.AlertTitle,{children:"Failed to initialize chat"}),e.message]})}),Dd=({config:e,token:t,getToken:r,children:i,LoadingComponent:a=Pd,ErrorComponent:s=Rd})=>{const[c,d]=U.useState(!1),[p,m]=U.useState(null),x=U.useCallback(async()=>{d(!1),m(null);try{Ka();let _=t??e.authToken;if(r&&!_&&(_=await r()),!_)return;await Sl(e,_),d(!0)}catch(_){m(pi(_,"Unknown error initializing SDK"))}},[e,t,r]);return U.useEffect(()=>(x(),()=>{Ka()}),[e.baseURL,t,r]),!c&&!p?k.jsx(a,{}):p?k.jsx(s,{error:p,retry:x}):k.jsx(k.Fragment,{children:i})},au=e=>e,Fd=()=>{let e=au;return{configure(t){e=t},generate(t){return e(t)},reset(){e=au}}},Md=Fd();function Tr(e,...t){const r=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(i=>r.searchParams.append("args[]",i)),`Minified MUI error #${e}; visit ${r} for the full message.`}function Er(e){if(typeof e!="string")throw new Error(process.env.NODE_ENV!=="production"?"MUI: `capitalize(string)` expects a string argument.":Tr(7));return e.charAt(0).toUpperCase()+e.slice(1)}var gn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function An(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ri={exports:{}},ni={exports:{}},Me={};/** @license React v16.13.1
1
+ "use strict";var Rd=Object.defineProperty;var Id=(e,t,r)=>t in e?Rd(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var gr=(e,t,r)=>Id(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("react/jsx-runtime"),Y=require("react"),U=require("@mui/material"),Dd=require("sdk"),Fd=require("@emotion/styled");require("@emotion/react");function Md(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const ir=Md(Y);let jt=null;async function Al(e,t){return jt||(jt=new Dd.ChatSDK(e),t&&await jt.setAuthToken(t),await jt.connect(),jt)}function Pt(){if(!jt)throw new Error("SDK not initialized. Call initSDK() first.");return jt}function Ua(){jt&&(jt.disconnect(),jt=null)}function Nd(){return jt!==null}const gi=(e,t)=>e instanceof Error?e:new Error(t),Bd=()=>k.jsx(U.Box,{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh",children:k.jsx(U.CircularProgress,{})}),qd=({error:e,retry:t})=>k.jsx(U.Box,{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh",p:2,children:k.jsxs(U.Alert,{severity:"error",action:k.jsx(U.Button,{onClick:t,children:" Retry"}),children:[k.jsx(U.AlertTitle,{children:"Failed to initialize chat"}),e.message]})}),Ld=({config:e,token:t,getToken:r,children:i,LoadingComponent:a=Bd,ErrorComponent:s=qd})=>{const[c,d]=Y.useState(!1),[p,m]=Y.useState(null),x=Y.useCallback(async()=>{d(!1),m(null);try{Ua();let b=t??e.authToken;if(r&&!b&&(b=await r()),!b)return;await Al(e,b),d(!0)}catch(b){m(gi(b,"Unknown error initializing SDK"))}},[e,t,r]);return Y.useEffect(()=>(x(),()=>{Ua()}),[e.baseURL,t,r]),!c&&!p?k.jsx(a,{}):p?k.jsx(s,{error:p,retry:x}):k.jsx(k.Fragment,{children:i})},uu=e=>e,Vd=()=>{let e=uu;return{configure(t){e=t},generate(t){return e(t)},reset(){e=uu}}},Kd=Vd();function Cr(e,...t){const r=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(i=>r.searchParams.append("args[]",i)),`Minified MUI error #${e}; visit ${r} for the full message.`}function Or(e){if(typeof e!="string")throw new Error(process.env.NODE_ENV!=="production"?"MUI: `capitalize(string)` expects a string argument.":Cr(7));return e.charAt(0).toUpperCase()+e.slice(1)}var bn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function $n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ii={exports:{}},oi={exports:{}},Me={};/** @license React v16.13.1
2
2
  * react-is.production.min.js
3
3
  *
4
4
  * Copyright (c) Facebook, Inc. and its affiliates.
5
5
  *
6
6
  * This source code is licensed under the MIT license found in the
7
7
  * LICENSE file in the root directory of this source tree.
8
- */var su;function Nd(){if(su)return Me;su=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,i=e?Symbol.for("react.fragment"):60107,a=e?Symbol.for("react.strict_mode"):60108,s=e?Symbol.for("react.profiler"):60114,c=e?Symbol.for("react.provider"):60109,d=e?Symbol.for("react.context"):60110,p=e?Symbol.for("react.async_mode"):60111,m=e?Symbol.for("react.concurrent_mode"):60111,x=e?Symbol.for("react.forward_ref"):60112,_=e?Symbol.for("react.suspense"):60113,w=e?Symbol.for("react.suspense_list"):60120,R=e?Symbol.for("react.memo"):60115,I=e?Symbol.for("react.lazy"):60116,b=e?Symbol.for("react.block"):60121,q=e?Symbol.for("react.fundamental"):60117,M=e?Symbol.for("react.responder"):60118,W=e?Symbol.for("react.scope"):60119;function G(L){if(typeof L=="object"&&L!==null){var N=L.$$typeof;switch(N){case t:switch(L=L.type,L){case p:case m:case i:case s:case a:case _:return L;default:switch(L=L&&L.$$typeof,L){case d:case x:case I:case R:case c:return L;default:return N}}case r:return N}}}function X(L){return G(L)===m}return Me.AsyncMode=p,Me.ConcurrentMode=m,Me.ContextConsumer=d,Me.ContextProvider=c,Me.Element=t,Me.ForwardRef=x,Me.Fragment=i,Me.Lazy=I,Me.Memo=R,Me.Portal=r,Me.Profiler=s,Me.StrictMode=a,Me.Suspense=_,Me.isAsyncMode=function(L){return X(L)||G(L)===p},Me.isConcurrentMode=X,Me.isContextConsumer=function(L){return G(L)===d},Me.isContextProvider=function(L){return G(L)===c},Me.isElement=function(L){return typeof L=="object"&&L!==null&&L.$$typeof===t},Me.isForwardRef=function(L){return G(L)===x},Me.isFragment=function(L){return G(L)===i},Me.isLazy=function(L){return G(L)===I},Me.isMemo=function(L){return G(L)===R},Me.isPortal=function(L){return G(L)===r},Me.isProfiler=function(L){return G(L)===s},Me.isStrictMode=function(L){return G(L)===a},Me.isSuspense=function(L){return G(L)===_},Me.isValidElementType=function(L){return typeof L=="string"||typeof L=="function"||L===i||L===m||L===s||L===a||L===_||L===w||typeof L=="object"&&L!==null&&(L.$$typeof===I||L.$$typeof===R||L.$$typeof===c||L.$$typeof===d||L.$$typeof===x||L.$$typeof===q||L.$$typeof===M||L.$$typeof===W||L.$$typeof===b)},Me.typeOf=G,Me}var Ne={};/** @license React v16.13.1
8
+ */var cu;function zd(){if(cu)return Me;cu=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,i=e?Symbol.for("react.fragment"):60107,a=e?Symbol.for("react.strict_mode"):60108,s=e?Symbol.for("react.profiler"):60114,c=e?Symbol.for("react.provider"):60109,d=e?Symbol.for("react.context"):60110,p=e?Symbol.for("react.async_mode"):60111,m=e?Symbol.for("react.concurrent_mode"):60111,x=e?Symbol.for("react.forward_ref"):60112,b=e?Symbol.for("react.suspense"):60113,S=e?Symbol.for("react.suspense_list"):60120,R=e?Symbol.for("react.memo"):60115,P=e?Symbol.for("react.lazy"):60116,_=e?Symbol.for("react.block"):60121,L=e?Symbol.for("react.fundamental"):60117,M=e?Symbol.for("react.responder"):60118,H=e?Symbol.for("react.scope"):60119;function G(A){if(typeof A=="object"&&A!==null){var q=A.$$typeof;switch(q){case t:switch(A=A.type,A){case p:case m:case i:case s:case a:case b:return A;default:switch(A=A&&A.$$typeof,A){case d:case x:case P:case R:case c:return A;default:return q}}case r:return q}}}function W(A){return G(A)===m}return Me.AsyncMode=p,Me.ConcurrentMode=m,Me.ContextConsumer=d,Me.ContextProvider=c,Me.Element=t,Me.ForwardRef=x,Me.Fragment=i,Me.Lazy=P,Me.Memo=R,Me.Portal=r,Me.Profiler=s,Me.StrictMode=a,Me.Suspense=b,Me.isAsyncMode=function(A){return W(A)||G(A)===p},Me.isConcurrentMode=W,Me.isContextConsumer=function(A){return G(A)===d},Me.isContextProvider=function(A){return G(A)===c},Me.isElement=function(A){return typeof A=="object"&&A!==null&&A.$$typeof===t},Me.isForwardRef=function(A){return G(A)===x},Me.isFragment=function(A){return G(A)===i},Me.isLazy=function(A){return G(A)===P},Me.isMemo=function(A){return G(A)===R},Me.isPortal=function(A){return G(A)===r},Me.isProfiler=function(A){return G(A)===s},Me.isStrictMode=function(A){return G(A)===a},Me.isSuspense=function(A){return G(A)===b},Me.isValidElementType=function(A){return typeof A=="string"||typeof A=="function"||A===i||A===m||A===s||A===a||A===b||A===S||typeof A=="object"&&A!==null&&(A.$$typeof===P||A.$$typeof===R||A.$$typeof===c||A.$$typeof===d||A.$$typeof===x||A.$$typeof===L||A.$$typeof===M||A.$$typeof===H||A.$$typeof===_)},Me.typeOf=G,Me}var Ne={};/** @license React v16.13.1
9
9
  * react-is.development.js
10
10
  *
11
11
  * Copyright (c) Facebook, Inc. and its affiliates.
12
12
  *
13
13
  * This source code is licensed under the MIT license found in the
14
14
  * LICENSE file in the root directory of this source tree.
15
- */var uu;function Bd(){return uu||(uu=1,process.env.NODE_ENV!=="production"&&(function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,i=e?Symbol.for("react.fragment"):60107,a=e?Symbol.for("react.strict_mode"):60108,s=e?Symbol.for("react.profiler"):60114,c=e?Symbol.for("react.provider"):60109,d=e?Symbol.for("react.context"):60110,p=e?Symbol.for("react.async_mode"):60111,m=e?Symbol.for("react.concurrent_mode"):60111,x=e?Symbol.for("react.forward_ref"):60112,_=e?Symbol.for("react.suspense"):60113,w=e?Symbol.for("react.suspense_list"):60120,R=e?Symbol.for("react.memo"):60115,I=e?Symbol.for("react.lazy"):60116,b=e?Symbol.for("react.block"):60121,q=e?Symbol.for("react.fundamental"):60117,M=e?Symbol.for("react.responder"):60118,W=e?Symbol.for("react.scope"):60119;function G(Y){return typeof Y=="string"||typeof Y=="function"||Y===i||Y===m||Y===s||Y===a||Y===_||Y===w||typeof Y=="object"&&Y!==null&&(Y.$$typeof===I||Y.$$typeof===R||Y.$$typeof===c||Y.$$typeof===d||Y.$$typeof===x||Y.$$typeof===q||Y.$$typeof===M||Y.$$typeof===W||Y.$$typeof===b)}function X(Y){if(typeof Y=="object"&&Y!==null){var st=Y.$$typeof;switch(st){case t:var Gt=Y.type;switch(Gt){case p:case m:case i:case s:case a:case _:return Gt;default:var xt=Gt&&Gt.$$typeof;switch(xt){case d:case x:case I:case R:case c:return xt;default:return st}}case r:return st}}}var L=p,N=m,Z=d,ae=c,ye=t,We=x,be=i,v=I,ee=R,te=r,ge=s,Ee=a,He=_,Ue=!1;function ft(Y){return Ue||(Ue=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),H(Y)||X(Y)===p}function H(Y){return X(Y)===m}function le(Y){return X(Y)===d}function _e(Y){return X(Y)===c}function Oe(Y){return typeof Y=="object"&&Y!==null&&Y.$$typeof===t}function we(Y){return X(Y)===x}function Ce(Y){return X(Y)===i}function Te(Y){return X(Y)===I}function Se(Y){return X(Y)===R}function Ae(Y){return X(Y)===r}function Ie(Y){return X(Y)===s}function re(Y){return X(Y)===a}function rt(Y){return X(Y)===_}Ne.AsyncMode=L,Ne.ConcurrentMode=N,Ne.ContextConsumer=Z,Ne.ContextProvider=ae,Ne.Element=ye,Ne.ForwardRef=We,Ne.Fragment=be,Ne.Lazy=v,Ne.Memo=ee,Ne.Portal=te,Ne.Profiler=ge,Ne.StrictMode=Ee,Ne.Suspense=He,Ne.isAsyncMode=ft,Ne.isConcurrentMode=H,Ne.isContextConsumer=le,Ne.isContextProvider=_e,Ne.isElement=Oe,Ne.isForwardRef=we,Ne.isFragment=Ce,Ne.isLazy=Te,Ne.isMemo=Se,Ne.isPortal=Ae,Ne.isProfiler=Ie,Ne.isStrictMode=re,Ne.isSuspense=rt,Ne.isValidElementType=G,Ne.typeOf=X})()),Ne}var cu;function is(){return cu||(cu=1,process.env.NODE_ENV==="production"?ni.exports=Nd():ni.exports=Bd()),ni.exports}/*
15
+ */var lu;function Ud(){return lu||(lu=1,process.env.NODE_ENV!=="production"&&(function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,i=e?Symbol.for("react.fragment"):60107,a=e?Symbol.for("react.strict_mode"):60108,s=e?Symbol.for("react.profiler"):60114,c=e?Symbol.for("react.provider"):60109,d=e?Symbol.for("react.context"):60110,p=e?Symbol.for("react.async_mode"):60111,m=e?Symbol.for("react.concurrent_mode"):60111,x=e?Symbol.for("react.forward_ref"):60112,b=e?Symbol.for("react.suspense"):60113,S=e?Symbol.for("react.suspense_list"):60120,R=e?Symbol.for("react.memo"):60115,P=e?Symbol.for("react.lazy"):60116,_=e?Symbol.for("react.block"):60121,L=e?Symbol.for("react.fundamental"):60117,M=e?Symbol.for("react.responder"):60118,H=e?Symbol.for("react.scope"):60119;function G(N){return typeof N=="string"||typeof N=="function"||N===i||N===m||N===s||N===a||N===b||N===S||typeof N=="object"&&N!==null&&(N.$$typeof===P||N.$$typeof===R||N.$$typeof===c||N.$$typeof===d||N.$$typeof===x||N.$$typeof===L||N.$$typeof===M||N.$$typeof===H||N.$$typeof===_)}function W(N){if(typeof N=="object"&&N!==null){var et=N.$$typeof;switch(et){case t:var xt=N.type;switch(xt){case p:case m:case i:case s:case a:case b:return xt;default:var gt=xt&&xt.$$typeof;switch(gt){case d:case x:case P:case R:case c:return gt;default:return et}}case r:return et}}}var A=p,q=m,X=d,ie=c,ye=t,Ge=x,ve=i,v=P,ee=R,te=r,ge=s,Te=a,We=b,Ke=!1;function lt(N){return Ke||(Ke=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),J(N)||W(N)===p}function J(N){return W(N)===m}function ce(N){return W(N)===d}function be(N){return W(N)===c}function Oe(N){return typeof N=="object"&&N!==null&&N.$$typeof===t}function xe(N){return W(N)===x}function Ce(N){return W(N)===i}function Ee(N){return W(N)===P}function we(N){return W(N)===R}function Ae(N){return W(N)===r}function ke(N){return W(N)===s}function re(N){return W(N)===a}function Qe(N){return W(N)===b}Ne.AsyncMode=A,Ne.ConcurrentMode=q,Ne.ContextConsumer=X,Ne.ContextProvider=ie,Ne.Element=ye,Ne.ForwardRef=Ge,Ne.Fragment=ve,Ne.Lazy=v,Ne.Memo=ee,Ne.Portal=te,Ne.Profiler=ge,Ne.StrictMode=Te,Ne.Suspense=We,Ne.isAsyncMode=lt,Ne.isConcurrentMode=J,Ne.isContextConsumer=ce,Ne.isContextProvider=be,Ne.isElement=Oe,Ne.isForwardRef=xe,Ne.isFragment=Ce,Ne.isLazy=Ee,Ne.isMemo=we,Ne.isPortal=Ae,Ne.isProfiler=ke,Ne.isStrictMode=re,Ne.isSuspense=Qe,Ne.isValidElementType=G,Ne.typeOf=W})()),Ne}var fu;function jl(){return fu||(fu=1,process.env.NODE_ENV==="production"?oi.exports=zd():oi.exports=Ud()),oi.exports}/*
16
16
  object-assign
17
17
  (c) Sindre Sorhus
18
18
  @license MIT
19
- */var Eo,lu;function qd(){if(lu)return Eo;lu=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function i(s){if(s==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(s)}function a(){try{if(!Object.assign)return!1;var s=new String("abc");if(s[5]="de",Object.getOwnPropertyNames(s)[0]==="5")return!1;for(var c={},d=0;d<10;d++)c["_"+String.fromCharCode(d)]=d;var p=Object.getOwnPropertyNames(c).map(function(x){return c[x]});if(p.join("")!=="0123456789")return!1;var m={};return"abcdefghijklmnopqrst".split("").forEach(function(x){m[x]=x}),Object.keys(Object.assign({},m)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Eo=a()?Object.assign:function(s,c){for(var d,p=i(s),m,x=1;x<arguments.length;x++){d=Object(arguments[x]);for(var _ in d)t.call(d,_)&&(p[_]=d[_]);if(e){m=e(d);for(var w=0;w<m.length;w++)r.call(d,m[w])&&(p[m[w]]=d[m[w]])}}return p},Eo}var Co,fu;function os(){if(fu)return Co;fu=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Co=e,Co}var Oo,du;function Tl(){return du||(du=1,Oo=Function.call.bind(Object.prototype.hasOwnProperty)),Oo}var Ao,hu;function Ld(){if(hu)return Ao;hu=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=os(),r={},i=Tl();e=function(s){var c="Warning: "+s;typeof console<"u"&&console.error(c);try{throw new Error(c)}catch{}}}function a(s,c,d,p,m){if(process.env.NODE_ENV!=="production"){for(var x in s)if(i(s,x)){var _;try{if(typeof s[x]!="function"){var w=Error((p||"React class")+": "+d+" type `"+x+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof s[x]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw w.name="Invariant Violation",w}_=s[x](c,x,p,d,null,t)}catch(I){_=I}if(_&&!(_ instanceof Error)&&e((p||"React class")+": type specification of "+d+" `"+x+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof _+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),_ instanceof Error&&!(_.message in r)){r[_.message]=!0;var R=m?m():"";e("Failed "+d+" type: "+_.message+(R??""))}}}}return a.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(r={})},Ao=a,Ao}var jo,pu;function Kd(){if(pu)return jo;pu=1;var e=is(),t=qd(),r=os(),i=Tl(),a=Ld(),s=function(){};process.env.NODE_ENV!=="production"&&(s=function(d){var p="Warning: "+d;typeof console<"u"&&console.error(p);try{throw new Error(p)}catch{}});function c(){return null}return jo=function(d,p){var m=typeof Symbol=="function"&&Symbol.iterator,x="@@iterator";function _(H){var le=H&&(m&&H[m]||H[x]);if(typeof le=="function")return le}var w="<<anonymous>>",R={array:M("array"),bigint:M("bigint"),bool:M("boolean"),func:M("function"),number:M("number"),object:M("object"),string:M("string"),symbol:M("symbol"),any:W(),arrayOf:G,element:X(),elementType:L(),instanceOf:N,node:We(),objectOf:ae,oneOf:Z,oneOfType:ye,shape:v,exact:ee};function I(H,le){return H===le?H!==0||1/H===1/le:H!==H&&le!==le}function b(H,le){this.message=H,this.data=le&&typeof le=="object"?le:{},this.stack=""}b.prototype=Error.prototype;function q(H){if(process.env.NODE_ENV!=="production")var le={},_e=0;function Oe(Ce,Te,Se,Ae,Ie,re,rt){if(Ae=Ae||w,re=re||Se,rt!==r){if(p){var Y=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw Y.name="Invariant Violation",Y}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var st=Ae+":"+Se;!le[st]&&_e<3&&(s("You are manually calling a React.PropTypes validation function for the `"+re+"` prop on `"+Ae+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),le[st]=!0,_e++)}}return Te[Se]==null?Ce?Te[Se]===null?new b("The "+Ie+" `"+re+"` is marked as required "+("in `"+Ae+"`, but its value is `null`.")):new b("The "+Ie+" `"+re+"` is marked as required in "+("`"+Ae+"`, but its value is `undefined`.")):null:H(Te,Se,Ae,Ie,re)}var we=Oe.bind(null,!1);return we.isRequired=Oe.bind(null,!0),we}function M(H){function le(_e,Oe,we,Ce,Te,Se){var Ae=_e[Oe],Ie=Ee(Ae);if(Ie!==H){var re=He(Ae);return new b("Invalid "+Ce+" `"+Te+"` of type "+("`"+re+"` supplied to `"+we+"`, expected ")+("`"+H+"`."),{expectedType:H})}return null}return q(le)}function W(){return q(c)}function G(H){function le(_e,Oe,we,Ce,Te){if(typeof H!="function")return new b("Property `"+Te+"` of component `"+we+"` has invalid PropType notation inside arrayOf.");var Se=_e[Oe];if(!Array.isArray(Se)){var Ae=Ee(Se);return new b("Invalid "+Ce+" `"+Te+"` of type "+("`"+Ae+"` supplied to `"+we+"`, expected an array."))}for(var Ie=0;Ie<Se.length;Ie++){var re=H(Se,Ie,we,Ce,Te+"["+Ie+"]",r);if(re instanceof Error)return re}return null}return q(le)}function X(){function H(le,_e,Oe,we,Ce){var Te=le[_e];if(!d(Te)){var Se=Ee(Te);return new b("Invalid "+we+" `"+Ce+"` of type "+("`"+Se+"` supplied to `"+Oe+"`, expected a single ReactElement."))}return null}return q(H)}function L(){function H(le,_e,Oe,we,Ce){var Te=le[_e];if(!e.isValidElementType(Te)){var Se=Ee(Te);return new b("Invalid "+we+" `"+Ce+"` of type "+("`"+Se+"` supplied to `"+Oe+"`, expected a single ReactElement type."))}return null}return q(H)}function N(H){function le(_e,Oe,we,Ce,Te){if(!(_e[Oe]instanceof H)){var Se=H.name||w,Ae=ft(_e[Oe]);return new b("Invalid "+Ce+" `"+Te+"` of type "+("`"+Ae+"` supplied to `"+we+"`, expected ")+("instance of `"+Se+"`."))}return null}return q(le)}function Z(H){if(!Array.isArray(H))return process.env.NODE_ENV!=="production"&&(arguments.length>1?s("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):s("Invalid argument supplied to oneOf, expected an array.")),c;function le(_e,Oe,we,Ce,Te){for(var Se=_e[Oe],Ae=0;Ae<H.length;Ae++)if(I(Se,H[Ae]))return null;var Ie=JSON.stringify(H,function(rt,Y){var st=He(Y);return st==="symbol"?String(Y):Y});return new b("Invalid "+Ce+" `"+Te+"` of value `"+String(Se)+"` "+("supplied to `"+we+"`, expected one of "+Ie+"."))}return q(le)}function ae(H){function le(_e,Oe,we,Ce,Te){if(typeof H!="function")return new b("Property `"+Te+"` of component `"+we+"` has invalid PropType notation inside objectOf.");var Se=_e[Oe],Ae=Ee(Se);if(Ae!=="object")return new b("Invalid "+Ce+" `"+Te+"` of type "+("`"+Ae+"` supplied to `"+we+"`, expected an object."));for(var Ie in Se)if(i(Se,Ie)){var re=H(Se,Ie,we,Ce,Te+"."+Ie,r);if(re instanceof Error)return re}return null}return q(le)}function ye(H){if(!Array.isArray(H))return process.env.NODE_ENV!=="production"&&s("Invalid argument supplied to oneOfType, expected an instance of array."),c;for(var le=0;le<H.length;le++){var _e=H[le];if(typeof _e!="function")return s("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+Ue(_e)+" at index "+le+"."),c}function Oe(we,Ce,Te,Se,Ae){for(var Ie=[],re=0;re<H.length;re++){var rt=H[re],Y=rt(we,Ce,Te,Se,Ae,r);if(Y==null)return null;Y.data&&i(Y.data,"expectedType")&&Ie.push(Y.data.expectedType)}var st=Ie.length>0?", expected one of type ["+Ie.join(", ")+"]":"";return new b("Invalid "+Se+" `"+Ae+"` supplied to "+("`"+Te+"`"+st+"."))}return q(Oe)}function We(){function H(le,_e,Oe,we,Ce){return te(le[_e])?null:new b("Invalid "+we+" `"+Ce+"` supplied to "+("`"+Oe+"`, expected a ReactNode."))}return q(H)}function be(H,le,_e,Oe,we){return new b((H||"React class")+": "+le+" type `"+_e+"."+Oe+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+we+"`.")}function v(H){function le(_e,Oe,we,Ce,Te){var Se=_e[Oe],Ae=Ee(Se);if(Ae!=="object")return new b("Invalid "+Ce+" `"+Te+"` of type `"+Ae+"` "+("supplied to `"+we+"`, expected `object`."));for(var Ie in H){var re=H[Ie];if(typeof re!="function")return be(we,Ce,Te,Ie,He(re));var rt=re(Se,Ie,we,Ce,Te+"."+Ie,r);if(rt)return rt}return null}return q(le)}function ee(H){function le(_e,Oe,we,Ce,Te){var Se=_e[Oe],Ae=Ee(Se);if(Ae!=="object")return new b("Invalid "+Ce+" `"+Te+"` of type `"+Ae+"` "+("supplied to `"+we+"`, expected `object`."));var Ie=t({},_e[Oe],H);for(var re in Ie){var rt=H[re];if(i(H,re)&&typeof rt!="function")return be(we,Ce,Te,re,He(rt));if(!rt)return new b("Invalid "+Ce+" `"+Te+"` key `"+re+"` supplied to `"+we+"`.\nBad object: "+JSON.stringify(_e[Oe],null," ")+`
20
- Valid keys: `+JSON.stringify(Object.keys(H),null," "));var Y=rt(Se,re,we,Ce,Te+"."+re,r);if(Y)return Y}return null}return q(le)}function te(H){switch(typeof H){case"number":case"string":case"undefined":return!0;case"boolean":return!H;case"object":if(Array.isArray(H))return H.every(te);if(H===null||d(H))return!0;var le=_(H);if(le){var _e=le.call(H),Oe;if(le!==H.entries){for(;!(Oe=_e.next()).done;)if(!te(Oe.value))return!1}else for(;!(Oe=_e.next()).done;){var we=Oe.value;if(we&&!te(we[1]))return!1}}else return!1;return!0;default:return!1}}function ge(H,le){return H==="symbol"?!0:le?le["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&le instanceof Symbol:!1}function Ee(H){var le=typeof H;return Array.isArray(H)?"array":H instanceof RegExp?"object":ge(le,H)?"symbol":le}function He(H){if(typeof H>"u"||H===null)return""+H;var le=Ee(H);if(le==="object"){if(H instanceof Date)return"date";if(H instanceof RegExp)return"regexp"}return le}function Ue(H){var le=He(H);switch(le){case"array":case"object":return"an "+le;case"boolean":case"date":case"regexp":return"a "+le;default:return le}}function ft(H){return!H.constructor||!H.constructor.name?w:H.constructor.name}return R.checkPropTypes=a,R.resetWarningCache=a.resetWarningCache,R.PropTypes=R,R},jo}var ko,mu;function Vd(){if(mu)return ko;mu=1;var e=os();function t(){}function r(){}return r.resetWarningCache=t,ko=function(){function i(c,d,p,m,x,_){if(_!==e){var w=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw w.name="Invariant Violation",w}}i.isRequired=i;function a(){return i}var s={array:i,bigint:i,bool:i,func:i,number:i,object:i,string:i,symbol:i,any:i,arrayOf:a,element:i,elementType:i,instanceOf:a,node:i,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:r,resetWarningCache:t};return s.PropTypes=s,s},ko}var yu;function zd(){if(yu)return ri.exports;if(yu=1,process.env.NODE_ENV!=="production"){var e=is(),t=!0;ri.exports=Kd()(e.isElement,t)}else ri.exports=Vd()();return ri.exports}var Ud=zd();const Fe=An(Ud);function El(e){var t,r,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=El(e[t]))&&(i&&(i+=" "),i+=r)}else for(r in e)e[r]&&(i&&(i+=" "),i+=r);return i}function Cl(){for(var e,t,r=0,i="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=El(e))&&(i&&(i+=" "),i+=t);return i}function Gd(e,t,r=void 0){const i={};for(const a in e){const s=e[a];let c="",d=!0;for(let p=0;p<s.length;p+=1){const m=s[p];m&&(c+=(d===!0?"":" ")+t(m),d=!1,r&&r[m]&&(c+=" "+r[m]))}i[a]=c}return i}var ii={exports:{}},Le={};/**
19
+ */var Ao,du;function Gd(){if(du)return Ao;du=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function i(s){if(s==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(s)}function a(){try{if(!Object.assign)return!1;var s=new String("abc");if(s[5]="de",Object.getOwnPropertyNames(s)[0]==="5")return!1;for(var c={},d=0;d<10;d++)c["_"+String.fromCharCode(d)]=d;var p=Object.getOwnPropertyNames(c).map(function(x){return c[x]});if(p.join("")!=="0123456789")return!1;var m={};return"abcdefghijklmnopqrst".split("").forEach(function(x){m[x]=x}),Object.keys(Object.assign({},m)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Ao=a()?Object.assign:function(s,c){for(var d,p=i(s),m,x=1;x<arguments.length;x++){d=Object(arguments[x]);for(var b in d)t.call(d,b)&&(p[b]=d[b]);if(e){m=e(d);for(var S=0;S<m.length;S++)r.call(d,m[S])&&(p[m[S]]=d[m[S]])}}return p},Ao}var jo,hu;function ss(){if(hu)return jo;hu=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return jo=e,jo}var $o,pu;function $l(){return pu||(pu=1,$o=Function.call.bind(Object.prototype.hasOwnProperty)),$o}var ko,mu;function Wd(){if(mu)return ko;mu=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=ss(),r={},i=$l();e=function(s){var c="Warning: "+s;typeof console<"u"&&console.error(c);try{throw new Error(c)}catch{}}}function a(s,c,d,p,m){if(process.env.NODE_ENV!=="production"){for(var x in s)if(i(s,x)){var b;try{if(typeof s[x]!="function"){var S=Error((p||"React class")+": "+d+" type `"+x+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof s[x]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw S.name="Invariant Violation",S}b=s[x](c,x,p,d,null,t)}catch(P){b=P}if(b&&!(b instanceof Error)&&e((p||"React class")+": type specification of "+d+" `"+x+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof b+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),b instanceof Error&&!(b.message in r)){r[b.message]=!0;var R=m?m():"";e("Failed "+d+" type: "+b.message+(R??""))}}}}return a.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(r={})},ko=a,ko}var Po,yu;function Yd(){if(yu)return Po;yu=1;var e=jl(),t=Gd(),r=ss(),i=$l(),a=Wd(),s=function(){};process.env.NODE_ENV!=="production"&&(s=function(d){var p="Warning: "+d;typeof console<"u"&&console.error(p);try{throw new Error(p)}catch{}});function c(){return null}return Po=function(d,p){var m=typeof Symbol=="function"&&Symbol.iterator,x="@@iterator";function b(J){var ce=J&&(m&&J[m]||J[x]);if(typeof ce=="function")return ce}var S="<<anonymous>>",R={array:M("array"),bigint:M("bigint"),bool:M("boolean"),func:M("function"),number:M("number"),object:M("object"),string:M("string"),symbol:M("symbol"),any:H(),arrayOf:G,element:W(),elementType:A(),instanceOf:q,node:Ge(),objectOf:ie,oneOf:X,oneOfType:ye,shape:v,exact:ee};function P(J,ce){return J===ce?J!==0||1/J===1/ce:J!==J&&ce!==ce}function _(J,ce){this.message=J,this.data=ce&&typeof ce=="object"?ce:{},this.stack=""}_.prototype=Error.prototype;function L(J){if(process.env.NODE_ENV!=="production")var ce={},be=0;function Oe(Ce,Ee,we,Ae,ke,re,Qe){if(Ae=Ae||S,re=re||we,Qe!==r){if(p){var N=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw N.name="Invariant Violation",N}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var et=Ae+":"+we;!ce[et]&&be<3&&(s("You are manually calling a React.PropTypes validation function for the `"+re+"` prop on `"+Ae+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),ce[et]=!0,be++)}}return Ee[we]==null?Ce?Ee[we]===null?new _("The "+ke+" `"+re+"` is marked as required "+("in `"+Ae+"`, but its value is `null`.")):new _("The "+ke+" `"+re+"` is marked as required in "+("`"+Ae+"`, but its value is `undefined`.")):null:J(Ee,we,Ae,ke,re)}var xe=Oe.bind(null,!1);return xe.isRequired=Oe.bind(null,!0),xe}function M(J){function ce(be,Oe,xe,Ce,Ee,we){var Ae=be[Oe],ke=Te(Ae);if(ke!==J){var re=We(Ae);return new _("Invalid "+Ce+" `"+Ee+"` of type "+("`"+re+"` supplied to `"+xe+"`, expected ")+("`"+J+"`."),{expectedType:J})}return null}return L(ce)}function H(){return L(c)}function G(J){function ce(be,Oe,xe,Ce,Ee){if(typeof J!="function")return new _("Property `"+Ee+"` of component `"+xe+"` has invalid PropType notation inside arrayOf.");var we=be[Oe];if(!Array.isArray(we)){var Ae=Te(we);return new _("Invalid "+Ce+" `"+Ee+"` of type "+("`"+Ae+"` supplied to `"+xe+"`, expected an array."))}for(var ke=0;ke<we.length;ke++){var re=J(we,ke,xe,Ce,Ee+"["+ke+"]",r);if(re instanceof Error)return re}return null}return L(ce)}function W(){function J(ce,be,Oe,xe,Ce){var Ee=ce[be];if(!d(Ee)){var we=Te(Ee);return new _("Invalid "+xe+" `"+Ce+"` of type "+("`"+we+"` supplied to `"+Oe+"`, expected a single ReactElement."))}return null}return L(J)}function A(){function J(ce,be,Oe,xe,Ce){var Ee=ce[be];if(!e.isValidElementType(Ee)){var we=Te(Ee);return new _("Invalid "+xe+" `"+Ce+"` of type "+("`"+we+"` supplied to `"+Oe+"`, expected a single ReactElement type."))}return null}return L(J)}function q(J){function ce(be,Oe,xe,Ce,Ee){if(!(be[Oe]instanceof J)){var we=J.name||S,Ae=lt(be[Oe]);return new _("Invalid "+Ce+" `"+Ee+"` of type "+("`"+Ae+"` supplied to `"+xe+"`, expected ")+("instance of `"+we+"`."))}return null}return L(ce)}function X(J){if(!Array.isArray(J))return process.env.NODE_ENV!=="production"&&(arguments.length>1?s("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):s("Invalid argument supplied to oneOf, expected an array.")),c;function ce(be,Oe,xe,Ce,Ee){for(var we=be[Oe],Ae=0;Ae<J.length;Ae++)if(P(we,J[Ae]))return null;var ke=JSON.stringify(J,function(Qe,N){var et=We(N);return et==="symbol"?String(N):N});return new _("Invalid "+Ce+" `"+Ee+"` of value `"+String(we)+"` "+("supplied to `"+xe+"`, expected one of "+ke+"."))}return L(ce)}function ie(J){function ce(be,Oe,xe,Ce,Ee){if(typeof J!="function")return new _("Property `"+Ee+"` of component `"+xe+"` has invalid PropType notation inside objectOf.");var we=be[Oe],Ae=Te(we);if(Ae!=="object")return new _("Invalid "+Ce+" `"+Ee+"` of type "+("`"+Ae+"` supplied to `"+xe+"`, expected an object."));for(var ke in we)if(i(we,ke)){var re=J(we,ke,xe,Ce,Ee+"."+ke,r);if(re instanceof Error)return re}return null}return L(ce)}function ye(J){if(!Array.isArray(J))return process.env.NODE_ENV!=="production"&&s("Invalid argument supplied to oneOfType, expected an instance of array."),c;for(var ce=0;ce<J.length;ce++){var be=J[ce];if(typeof be!="function")return s("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+Ke(be)+" at index "+ce+"."),c}function Oe(xe,Ce,Ee,we,Ae){for(var ke=[],re=0;re<J.length;re++){var Qe=J[re],N=Qe(xe,Ce,Ee,we,Ae,r);if(N==null)return null;N.data&&i(N.data,"expectedType")&&ke.push(N.data.expectedType)}var et=ke.length>0?", expected one of type ["+ke.join(", ")+"]":"";return new _("Invalid "+we+" `"+Ae+"` supplied to "+("`"+Ee+"`"+et+"."))}return L(Oe)}function Ge(){function J(ce,be,Oe,xe,Ce){return te(ce[be])?null:new _("Invalid "+xe+" `"+Ce+"` supplied to "+("`"+Oe+"`, expected a ReactNode."))}return L(J)}function ve(J,ce,be,Oe,xe){return new _((J||"React class")+": "+ce+" type `"+be+"."+Oe+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+xe+"`.")}function v(J){function ce(be,Oe,xe,Ce,Ee){var we=be[Oe],Ae=Te(we);if(Ae!=="object")return new _("Invalid "+Ce+" `"+Ee+"` of type `"+Ae+"` "+("supplied to `"+xe+"`, expected `object`."));for(var ke in J){var re=J[ke];if(typeof re!="function")return ve(xe,Ce,Ee,ke,We(re));var Qe=re(we,ke,xe,Ce,Ee+"."+ke,r);if(Qe)return Qe}return null}return L(ce)}function ee(J){function ce(be,Oe,xe,Ce,Ee){var we=be[Oe],Ae=Te(we);if(Ae!=="object")return new _("Invalid "+Ce+" `"+Ee+"` of type `"+Ae+"` "+("supplied to `"+xe+"`, expected `object`."));var ke=t({},be[Oe],J);for(var re in ke){var Qe=J[re];if(i(J,re)&&typeof Qe!="function")return ve(xe,Ce,Ee,re,We(Qe));if(!Qe)return new _("Invalid "+Ce+" `"+Ee+"` key `"+re+"` supplied to `"+xe+"`.\nBad object: "+JSON.stringify(be[Oe],null," ")+`
20
+ Valid keys: `+JSON.stringify(Object.keys(J),null," "));var N=Qe(we,re,xe,Ce,Ee+"."+re,r);if(N)return N}return null}return L(ce)}function te(J){switch(typeof J){case"number":case"string":case"undefined":return!0;case"boolean":return!J;case"object":if(Array.isArray(J))return J.every(te);if(J===null||d(J))return!0;var ce=b(J);if(ce){var be=ce.call(J),Oe;if(ce!==J.entries){for(;!(Oe=be.next()).done;)if(!te(Oe.value))return!1}else for(;!(Oe=be.next()).done;){var xe=Oe.value;if(xe&&!te(xe[1]))return!1}}else return!1;return!0;default:return!1}}function ge(J,ce){return J==="symbol"?!0:ce?ce["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&ce instanceof Symbol:!1}function Te(J){var ce=typeof J;return Array.isArray(J)?"array":J instanceof RegExp?"object":ge(ce,J)?"symbol":ce}function We(J){if(typeof J>"u"||J===null)return""+J;var ce=Te(J);if(ce==="object"){if(J instanceof Date)return"date";if(J instanceof RegExp)return"regexp"}return ce}function Ke(J){var ce=We(J);switch(ce){case"array":case"object":return"an "+ce;case"boolean":case"date":case"regexp":return"a "+ce;default:return ce}}function lt(J){return!J.constructor||!J.constructor.name?S:J.constructor.name}return R.checkPropTypes=a,R.resetWarningCache=a.resetWarningCache,R.PropTypes=R,R},Po}var Ro,gu;function Hd(){if(gu)return Ro;gu=1;var e=ss();function t(){}function r(){}return r.resetWarningCache=t,Ro=function(){function i(c,d,p,m,x,b){if(b!==e){var S=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw S.name="Invariant Violation",S}}i.isRequired=i;function a(){return i}var s={array:i,bigint:i,bool:i,func:i,number:i,object:i,string:i,symbol:i,any:i,arrayOf:a,element:i,elementType:i,instanceOf:a,node:i,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:r,resetWarningCache:t};return s.PropTypes=s,s},Ro}var vu;function Jd(){if(vu)return ii.exports;if(vu=1,process.env.NODE_ENV!=="production"){var e=jl(),t=!0;ii.exports=Yd()(e.isElement,t)}else ii.exports=Hd()();return ii.exports}var Xd=Jd();const Fe=$n(Xd);function kl(e){var t,r,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=kl(e[t]))&&(i&&(i+=" "),i+=r)}else for(r in e)e[r]&&(i&&(i+=" "),i+=r);return i}function Pl(){for(var e,t,r=0,i="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=kl(e))&&(i&&(i+=" "),i+=t);return i}function Zd(e,t,r=void 0){const i={};for(const a in e){const s=e[a];let c="",d=!0;for(let p=0;p<s.length;p+=1){const m=s[p];m&&(c+=(d===!0?"":" ")+t(m),d=!1,r&&r[m]&&(c+=" "+r[m]))}i[a]=c}return i}var ai={exports:{}},ze={};/**
21
21
  * @license React
22
22
  * react-is.production.js
23
23
  *
@@ -25,7 +25,7 @@ Valid keys: `+JSON.stringify(Object.keys(H),null," "));var Y=rt(Se,re,we,Ce,Te+
25
25
  *
26
26
  * This source code is licensed under the MIT license found in the
27
27
  * LICENSE file in the root directory of this source tree.
28
- */var gu;function Wd(){if(gu)return Le;gu=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),m=Symbol.for("react.suspense_list"),x=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),w=Symbol.for("react.view_transition"),R=Symbol.for("react.client.reference");function I(b){if(typeof b=="object"&&b!==null){var q=b.$$typeof;switch(q){case e:switch(b=b.type,b){case r:case a:case i:case p:case m:case w:return b;default:switch(b=b&&b.$$typeof,b){case c:case d:case _:case x:return b;case s:return b;default:return q}}case t:return q}}}return Le.ContextConsumer=s,Le.ContextProvider=c,Le.Element=e,Le.ForwardRef=d,Le.Fragment=r,Le.Lazy=_,Le.Memo=x,Le.Portal=t,Le.Profiler=a,Le.StrictMode=i,Le.Suspense=p,Le.SuspenseList=m,Le.isContextConsumer=function(b){return I(b)===s},Le.isContextProvider=function(b){return I(b)===c},Le.isElement=function(b){return typeof b=="object"&&b!==null&&b.$$typeof===e},Le.isForwardRef=function(b){return I(b)===d},Le.isFragment=function(b){return I(b)===r},Le.isLazy=function(b){return I(b)===_},Le.isMemo=function(b){return I(b)===x},Le.isPortal=function(b){return I(b)===t},Le.isProfiler=function(b){return I(b)===a},Le.isStrictMode=function(b){return I(b)===i},Le.isSuspense=function(b){return I(b)===p},Le.isSuspenseList=function(b){return I(b)===m},Le.isValidElementType=function(b){return typeof b=="string"||typeof b=="function"||b===r||b===a||b===i||b===p||b===m||typeof b=="object"&&b!==null&&(b.$$typeof===_||b.$$typeof===x||b.$$typeof===c||b.$$typeof===s||b.$$typeof===d||b.$$typeof===R||b.getModuleId!==void 0)},Le.typeOf=I,Le}var Ke={};/**
28
+ */var bu;function Qd(){if(bu)return ze;bu=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),m=Symbol.for("react.suspense_list"),x=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),S=Symbol.for("react.view_transition"),R=Symbol.for("react.client.reference");function P(_){if(typeof _=="object"&&_!==null){var L=_.$$typeof;switch(L){case e:switch(_=_.type,_){case r:case a:case i:case p:case m:case S:return _;default:switch(_=_&&_.$$typeof,_){case c:case d:case b:case x:return _;case s:return _;default:return L}}case t:return L}}}return ze.ContextConsumer=s,ze.ContextProvider=c,ze.Element=e,ze.ForwardRef=d,ze.Fragment=r,ze.Lazy=b,ze.Memo=x,ze.Portal=t,ze.Profiler=a,ze.StrictMode=i,ze.Suspense=p,ze.SuspenseList=m,ze.isContextConsumer=function(_){return P(_)===s},ze.isContextProvider=function(_){return P(_)===c},ze.isElement=function(_){return typeof _=="object"&&_!==null&&_.$$typeof===e},ze.isForwardRef=function(_){return P(_)===d},ze.isFragment=function(_){return P(_)===r},ze.isLazy=function(_){return P(_)===b},ze.isMemo=function(_){return P(_)===x},ze.isPortal=function(_){return P(_)===t},ze.isProfiler=function(_){return P(_)===a},ze.isStrictMode=function(_){return P(_)===i},ze.isSuspense=function(_){return P(_)===p},ze.isSuspenseList=function(_){return P(_)===m},ze.isValidElementType=function(_){return typeof _=="string"||typeof _=="function"||_===r||_===a||_===i||_===p||_===m||typeof _=="object"&&_!==null&&(_.$$typeof===b||_.$$typeof===x||_.$$typeof===c||_.$$typeof===s||_.$$typeof===d||_.$$typeof===R||_.getModuleId!==void 0)},ze.typeOf=P,ze}var Ue={};/**
29
29
  * @license React
30
30
  * react-is.development.js
31
31
  *
@@ -33,23 +33,23 @@ Valid keys: `+JSON.stringify(Object.keys(H),null," "));var Y=rt(Se,re,we,Ce,Te+
33
33
  *
34
34
  * This source code is licensed under the MIT license found in the
35
35
  * LICENSE file in the root directory of this source tree.
36
- */var vu;function Hd(){return vu||(vu=1,process.env.NODE_ENV!=="production"&&(function(){function e(b){if(typeof b=="object"&&b!==null){var q=b.$$typeof;switch(q){case t:switch(b=b.type,b){case i:case s:case a:case m:case x:case R:return b;default:switch(b=b&&b.$$typeof,b){case d:case p:case w:case _:return b;case c:return b;default:return q}}case r:return q}}}var t=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),d=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),x=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),R=Symbol.for("react.view_transition"),I=Symbol.for("react.client.reference");Ke.ContextConsumer=c,Ke.ContextProvider=d,Ke.Element=t,Ke.ForwardRef=p,Ke.Fragment=i,Ke.Lazy=w,Ke.Memo=_,Ke.Portal=r,Ke.Profiler=s,Ke.StrictMode=a,Ke.Suspense=m,Ke.SuspenseList=x,Ke.isContextConsumer=function(b){return e(b)===c},Ke.isContextProvider=function(b){return e(b)===d},Ke.isElement=function(b){return typeof b=="object"&&b!==null&&b.$$typeof===t},Ke.isForwardRef=function(b){return e(b)===p},Ke.isFragment=function(b){return e(b)===i},Ke.isLazy=function(b){return e(b)===w},Ke.isMemo=function(b){return e(b)===_},Ke.isPortal=function(b){return e(b)===r},Ke.isProfiler=function(b){return e(b)===s},Ke.isStrictMode=function(b){return e(b)===a},Ke.isSuspense=function(b){return e(b)===m},Ke.isSuspenseList=function(b){return e(b)===x},Ke.isValidElementType=function(b){return typeof b=="string"||typeof b=="function"||b===i||b===s||b===a||b===m||b===x||typeof b=="object"&&b!==null&&(b.$$typeof===w||b.$$typeof===_||b.$$typeof===d||b.$$typeof===c||b.$$typeof===p||b.$$typeof===I||b.getModuleId!==void 0)},Ke.typeOf=e})()),Ke}var bu;function Yd(){return bu||(bu=1,process.env.NODE_ENV==="production"?ii.exports=Wd():ii.exports=Hd()),ii.exports}var mi=Yd();function Vt(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 Ol(e){if(nr.isValidElement(e)||mi.isValidElementType(e)||!Vt(e))return e;const t={};return Object.keys(e).forEach(r=>{t[r]=Ol(e[r])}),t}function _t(e,t,r={clone:!0}){const i=r.clone?{...e}:e;return Vt(e)&&Vt(t)&&Object.keys(t).forEach(a=>{nr.isValidElement(t[a])||mi.isValidElementType(t[a])?i[a]=t[a]:Vt(t[a])&&Object.prototype.hasOwnProperty.call(e,a)&&Vt(e[a])?i[a]=_t(e[a],t[a],r):r.clone?i[a]=Vt(t[a])?Ol(t[a]):t[a]:i[a]=t[a]}),i}function _n(e,t){return t?_t(e,t,{clone:!1}):e}const ar=process.env.NODE_ENV!=="production"?Fe.oneOfType([Fe.number,Fe.string,Fe.object,Fe.array]):{};function _u(e,t){if(!e.containerQueries)return t;const r=Object.keys(t).filter(i=>i.startsWith("@container")).sort((i,a)=>{var c,d;const s=/min-width:\s*([0-9.]+)/;return+(((c=i.match(s))==null?void 0:c[1])||0)-+(((d=a.match(s))==null?void 0:d[1])||0)});return r.length?r.reduce((i,a)=>{const s=t[a];return delete i[a],i[a]=s,i},{...t}):t}function Jd(e,t){return t==="@"||t.startsWith("@")&&(e.some(r=>t.startsWith(`@${r}`))||!!t.match(/^@\d/))}function Xd(e,t){const r=t.match(/^@([^/]+)?\/?(.+)?$/);if(!r){if(process.env.NODE_ENV!=="production")throw new Error(`MUI: The provided shorthand ${`(${t})`} is invalid. The format should be \`@<breakpoint | number>\` or \`@<breakpoint | number>/<container>\`.
37
- For example, \`@sm\` or \`@600\` or \`@40rem/sidebar\`.`);return null}const[,i,a]=r,s=Number.isNaN(+i)?i||0:+i;return e.containerQueries(a).up(s)}function Zd(e){const t=(s,c)=>s.replace("@media",c?`@container ${c}`:"@container");function r(s,c){s.up=(...d)=>t(e.breakpoints.up(...d),c),s.down=(...d)=>t(e.breakpoints.down(...d),c),s.between=(...d)=>t(e.breakpoints.between(...d),c),s.only=(...d)=>t(e.breakpoints.only(...d),c),s.not=(...d)=>{const p=t(e.breakpoints.not(...d),c);return p.includes("not all and")?p.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):p}}const i={},a=s=>(r(i,s),i);return r(a),{...e,containerQueries:a}}const wi={xs:0,sm:600,md:900,lg:1200,xl:1536},xu={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${wi[e]}px)`},Qd={containerQueries:e=>({up:t=>{let r=typeof t=="number"?t:wi[t]||t;return typeof r=="number"&&(r=`${r}px`),e?`@container ${e} (min-width:${r})`:`@container (min-width:${r})`}})};function zt(e,t,r){const i=e.theme||{};if(Array.isArray(t)){const s=i.breakpoints||xu;return t.reduce((c,d,p)=>(c[s.up(s.keys[p])]=r(t[p]),c),{})}if(typeof t=="object"){const s=i.breakpoints||xu;return Object.keys(t).reduce((c,d)=>{if(Jd(s.keys,d)){const p=Xd(i.containerQueries?i:Qd,d);p&&(c[p]=r(t[d],d))}else if(Object.keys(s.values||wi).includes(d)){const p=s.up(d);c[p]=r(t[d],d)}else{const p=d;c[p]=t[p]}return c},{})}return r(t)}function eh(e={}){var r;return((r=e.keys)==null?void 0:r.reduce((i,a)=>{const s=e.up(a);return i[s]={},i},{}))||{}}function wu(e,t){return e.reduce((r,i)=>{const a=r[i];return(!a||Object.keys(a).length===0)&&delete r[i],r},t)}function Si(e,t,r=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&r){const i=`vars.${t}`.split(".").reduce((a,s)=>a&&a[s]?a[s]:null,e);if(i!=null)return i}return t.split(".").reduce((i,a)=>i&&i[a]!=null?i[a]:null,e)}function yi(e,t,r,i=r){let a;return typeof e=="function"?a=e(r):Array.isArray(e)?a=e[r]||i:a=Si(e,r)||i,t&&(a=t(a,i,e)),a}function ot(e){const{prop:t,cssProperty:r=e.prop,themeKey:i,transform:a}=e,s=c=>{if(c[t]==null)return null;const d=c[t],p=c.theme,m=Si(p,i)||{};return zt(c,d,_=>{let w=yi(m,a,_);return _===w&&typeof _=="string"&&(w=yi(m,a,`${t}${_==="default"?"":Er(_)}`,_)),r===!1?w:{[r]:w}})};return s.propTypes=process.env.NODE_ENV!=="production"?{[t]:ar}:{},s.filterProps=[t],s}function th(e){const t={};return r=>(t[r]===void 0&&(t[r]=e(r)),t[r])}const rh={m:"margin",p:"padding"},nh={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},Su={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},ih=th(e=>{if(e.length>2)if(Su[e])e=Su[e];else return[e];const[t,r]=e.split(""),i=rh[t],a=nh[r]||"";return Array.isArray(a)?a.map(s=>i+s):[i+a]}),Ti=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],Ei=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"],oh=[...Ti,...Ei];function jn(e,t,r,i){const a=Si(e,t,!0)??r;return typeof a=="number"||typeof a=="string"?s=>typeof s=="string"?s:(process.env.NODE_ENV!=="production"&&typeof s!="number"&&console.error(`MUI: Expected ${i} argument to be a number or a string, got ${s}.`),typeof a=="string"?a.startsWith("var(")&&s===0?0:a.startsWith("var(")&&s===1?a:`calc(${s} * ${a})`:a*s):Array.isArray(a)?s=>{if(typeof s=="string")return s;const c=Math.abs(s);process.env.NODE_ENV!=="production"&&(Number.isInteger(c)?c>a.length-1&&console.error([`MUI: The value provided (${c}) overflows.`,`The supported values are: ${JSON.stringify(a)}.`,`${c} > ${a.length-1}, you need to add the missing values.`].join(`
36
+ */var _u;function eh(){return _u||(_u=1,process.env.NODE_ENV!=="production"&&(function(){function e(_){if(typeof _=="object"&&_!==null){var L=_.$$typeof;switch(L){case t:switch(_=_.type,_){case i:case s:case a:case m:case x:case R:return _;default:switch(_=_&&_.$$typeof,_){case d:case p:case S:case b:return _;case c:return _;default:return L}}case r:return L}}}var t=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),d=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),x=Symbol.for("react.suspense_list"),b=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),R=Symbol.for("react.view_transition"),P=Symbol.for("react.client.reference");Ue.ContextConsumer=c,Ue.ContextProvider=d,Ue.Element=t,Ue.ForwardRef=p,Ue.Fragment=i,Ue.Lazy=S,Ue.Memo=b,Ue.Portal=r,Ue.Profiler=s,Ue.StrictMode=a,Ue.Suspense=m,Ue.SuspenseList=x,Ue.isContextConsumer=function(_){return e(_)===c},Ue.isContextProvider=function(_){return e(_)===d},Ue.isElement=function(_){return typeof _=="object"&&_!==null&&_.$$typeof===t},Ue.isForwardRef=function(_){return e(_)===p},Ue.isFragment=function(_){return e(_)===i},Ue.isLazy=function(_){return e(_)===S},Ue.isMemo=function(_){return e(_)===b},Ue.isPortal=function(_){return e(_)===r},Ue.isProfiler=function(_){return e(_)===s},Ue.isStrictMode=function(_){return e(_)===a},Ue.isSuspense=function(_){return e(_)===m},Ue.isSuspenseList=function(_){return e(_)===x},Ue.isValidElementType=function(_){return typeof _=="string"||typeof _=="function"||_===i||_===s||_===a||_===m||_===x||typeof _=="object"&&_!==null&&(_.$$typeof===S||_.$$typeof===b||_.$$typeof===d||_.$$typeof===c||_.$$typeof===p||_.$$typeof===P||_.getModuleId!==void 0)},Ue.typeOf=e})()),Ue}var xu;function th(){return xu||(xu=1,process.env.NODE_ENV==="production"?ai.exports=Qd():ai.exports=eh()),ai.exports}var vi=th();function Gt(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 Rl(e){if(ir.isValidElement(e)||vi.isValidElementType(e)||!Gt(e))return e;const t={};return Object.keys(e).forEach(r=>{t[r]=Rl(e[r])}),t}function Et(e,t,r={clone:!0}){const i=r.clone?{...e}:e;return Gt(e)&&Gt(t)&&Object.keys(t).forEach(a=>{ir.isValidElement(t[a])||vi.isValidElementType(t[a])?i[a]=t[a]:Gt(t[a])&&Object.prototype.hasOwnProperty.call(e,a)&&Gt(e[a])?i[a]=Et(e[a],t[a],r):r.clone?i[a]=Gt(t[a])?Rl(t[a]):t[a]:i[a]=t[a]}),i}function Sn(e,t){return t?Et(e,t,{clone:!1}):e}const sr=process.env.NODE_ENV!=="production"?Fe.oneOfType([Fe.number,Fe.string,Fe.object,Fe.array]):{};function Su(e,t){if(!e.containerQueries)return t;const r=Object.keys(t).filter(i=>i.startsWith("@container")).sort((i,a)=>{var c,d;const s=/min-width:\s*([0-9.]+)/;return+(((c=i.match(s))==null?void 0:c[1])||0)-+(((d=a.match(s))==null?void 0:d[1])||0)});return r.length?r.reduce((i,a)=>{const s=t[a];return delete i[a],i[a]=s,i},{...t}):t}function rh(e,t){return t==="@"||t.startsWith("@")&&(e.some(r=>t.startsWith(`@${r}`))||!!t.match(/^@\d/))}function nh(e,t){const r=t.match(/^@([^/]+)?\/?(.+)?$/);if(!r){if(process.env.NODE_ENV!=="production")throw new Error(`MUI: The provided shorthand ${`(${t})`} is invalid. The format should be \`@<breakpoint | number>\` or \`@<breakpoint | number>/<container>\`.
37
+ For example, \`@sm\` or \`@600\` or \`@40rem/sidebar\`.`);return null}const[,i,a]=r,s=Number.isNaN(+i)?i||0:+i;return e.containerQueries(a).up(s)}function ih(e){const t=(s,c)=>s.replace("@media",c?`@container ${c}`:"@container");function r(s,c){s.up=(...d)=>t(e.breakpoints.up(...d),c),s.down=(...d)=>t(e.breakpoints.down(...d),c),s.between=(...d)=>t(e.breakpoints.between(...d),c),s.only=(...d)=>t(e.breakpoints.only(...d),c),s.not=(...d)=>{const p=t(e.breakpoints.not(...d),c);return p.includes("not all and")?p.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):p}}const i={},a=s=>(r(i,s),i);return r(a),{...e,containerQueries:a}}const Ti={xs:0,sm:600,md:900,lg:1200,xl:1536},wu={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${Ti[e]}px)`},oh={containerQueries:e=>({up:t=>{let r=typeof t=="number"?t:Ti[t]||t;return typeof r=="number"&&(r=`${r}px`),e?`@container ${e} (min-width:${r})`:`@container (min-width:${r})`}})};function Wt(e,t,r){const i=e.theme||{};if(Array.isArray(t)){const s=i.breakpoints||wu;return t.reduce((c,d,p)=>(c[s.up(s.keys[p])]=r(t[p]),c),{})}if(typeof t=="object"){const s=i.breakpoints||wu;return Object.keys(t).reduce((c,d)=>{if(rh(s.keys,d)){const p=nh(i.containerQueries?i:oh,d);p&&(c[p]=r(t[d],d))}else if(Object.keys(s.values||Ti).includes(d)){const p=s.up(d);c[p]=r(t[d],d)}else{const p=d;c[p]=t[p]}return c},{})}return r(t)}function ah(e={}){var r;return((r=e.keys)==null?void 0:r.reduce((i,a)=>{const s=e.up(a);return i[s]={},i},{}))||{}}function Eu(e,t){return e.reduce((r,i)=>{const a=r[i];return(!a||Object.keys(a).length===0)&&delete r[i],r},t)}function Ci(e,t,r=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&r){const i=`vars.${t}`.split(".").reduce((a,s)=>a&&a[s]?a[s]:null,e);if(i!=null)return i}return t.split(".").reduce((i,a)=>i&&i[a]!=null?i[a]:null,e)}function bi(e,t,r,i=r){let a;return typeof e=="function"?a=e(r):Array.isArray(e)?a=e[r]||i:a=Ci(e,r)||i,t&&(a=t(a,i,e)),a}function ut(e){const{prop:t,cssProperty:r=e.prop,themeKey:i,transform:a}=e,s=c=>{if(c[t]==null)return null;const d=c[t],p=c.theme,m=Ci(p,i)||{};return Wt(c,d,b=>{let S=bi(m,a,b);return b===S&&typeof b=="string"&&(S=bi(m,a,`${t}${b==="default"?"":Or(b)}`,b)),r===!1?S:{[r]:S}})};return s.propTypes=process.env.NODE_ENV!=="production"?{[t]:sr}:{},s.filterProps=[t],s}function sh(e){const t={};return r=>(t[r]===void 0&&(t[r]=e(r)),t[r])}const uh={m:"margin",p:"padding"},ch={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},Tu={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},lh=sh(e=>{if(e.length>2)if(Tu[e])e=Tu[e];else return[e];const[t,r]=e.split(""),i=uh[t],a=ch[r]||"";return Array.isArray(a)?a.map(s=>i+s):[i+a]}),Oi=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],Ai=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"],fh=[...Oi,...Ai];function kn(e,t,r,i){const a=Ci(e,t,!0)??r;return typeof a=="number"||typeof a=="string"?s=>typeof s=="string"?s:(process.env.NODE_ENV!=="production"&&typeof s!="number"&&console.error(`MUI: Expected ${i} argument to be a number or a string, got ${s}.`),typeof a=="string"?a.startsWith("var(")&&s===0?0:a.startsWith("var(")&&s===1?a:`calc(${s} * ${a})`:a*s):Array.isArray(a)?s=>{if(typeof s=="string")return s;const c=Math.abs(s);process.env.NODE_ENV!=="production"&&(Number.isInteger(c)?c>a.length-1&&console.error([`MUI: The value provided (${c}) overflows.`,`The supported values are: ${JSON.stringify(a)}.`,`${c} > ${a.length-1}, you need to add the missing values.`].join(`
38
38
  `)):console.error([`MUI: The \`theme.${t}\` array type cannot be combined with non integer values.You should either use an integer value that can be used as index, or define the \`theme.${t}\` as a number.`].join(`
39
39
  `)));const d=a[c];return s>=0?d:typeof d=="number"?-d:typeof d=="string"&&d.startsWith("var(")?`calc(-1 * ${d})`:`-${d}`}:typeof a=="function"?a:(process.env.NODE_ENV!=="production"&&console.error([`MUI: The \`theme.${t}\` value (${a}) is invalid.`,"It should be a number, an array or a function."].join(`
40
- `)),()=>{})}function as(e){return jn(e,"spacing",8,"spacing")}function kn(e,t){return typeof t=="string"||t==null?t:e(t)}function ah(e,t){return r=>e.reduce((i,a)=>(i[a]=kn(t,r),i),{})}function sh(e,t,r,i){if(!t.includes(r))return null;const a=ih(r),s=ah(a,i),c=e[r];return zt(e,c,s)}function Al(e,t){const r=as(e.theme);return Object.keys(e).map(i=>sh(e,t,i,r)).reduce(_n,{})}function et(e){return Al(e,Ti)}et.propTypes=process.env.NODE_ENV!=="production"?Ti.reduce((e,t)=>(e[t]=ar,e),{}):{};et.filterProps=Ti;function tt(e){return Al(e,Ei)}tt.propTypes=process.env.NODE_ENV!=="production"?Ei.reduce((e,t)=>(e[t]=ar,e),{}):{};tt.filterProps=Ei;process.env.NODE_ENV!=="production"&&oh.reduce((e,t)=>(e[t]=ar,e),{});function Ci(...e){const t=e.reduce((i,a)=>(a.filterProps.forEach(s=>{i[s]=a}),i),{}),r=i=>Object.keys(i).reduce((a,s)=>t[s]?_n(a,t[s](i)):a,{});return r.propTypes=process.env.NODE_ENV!=="production"?e.reduce((i,a)=>Object.assign(i,a.propTypes),{}):{},r.filterProps=e.reduce((i,a)=>i.concat(a.filterProps),[]),r}function Ot(e){return typeof e!="number"?e:`${e}px solid`}function At(e,t){return ot({prop:e,themeKey:"borders",transform:t})}const uh=At("border",Ot),ch=At("borderTop",Ot),lh=At("borderRight",Ot),fh=At("borderBottom",Ot),dh=At("borderLeft",Ot),hh=At("borderColor"),ph=At("borderTopColor"),mh=At("borderRightColor"),yh=At("borderBottomColor"),gh=At("borderLeftColor"),vh=At("outline",Ot),bh=At("outlineColor"),Oi=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=jn(e.theme,"shape.borderRadius",4,"borderRadius"),r=i=>({borderRadius:kn(t,i)});return zt(e,e.borderRadius,r)}return null};Oi.propTypes=process.env.NODE_ENV!=="production"?{borderRadius:ar}:{};Oi.filterProps=["borderRadius"];Ci(uh,ch,lh,fh,dh,hh,ph,mh,yh,gh,Oi,vh,bh);const Ai=e=>{if(e.gap!==void 0&&e.gap!==null){const t=jn(e.theme,"spacing",8,"gap"),r=i=>({gap:kn(t,i)});return zt(e,e.gap,r)}return null};Ai.propTypes=process.env.NODE_ENV!=="production"?{gap:ar}:{};Ai.filterProps=["gap"];const ji=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=jn(e.theme,"spacing",8,"columnGap"),r=i=>({columnGap:kn(t,i)});return zt(e,e.columnGap,r)}return null};ji.propTypes=process.env.NODE_ENV!=="production"?{columnGap:ar}:{};ji.filterProps=["columnGap"];const ki=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=jn(e.theme,"spacing",8,"rowGap"),r=i=>({rowGap:kn(t,i)});return zt(e,e.rowGap,r)}return null};ki.propTypes=process.env.NODE_ENV!=="production"?{rowGap:ar}:{};ki.filterProps=["rowGap"];const _h=ot({prop:"gridColumn"}),xh=ot({prop:"gridRow"}),wh=ot({prop:"gridAutoFlow"}),Sh=ot({prop:"gridAutoColumns"}),Th=ot({prop:"gridAutoRows"}),Eh=ot({prop:"gridTemplateColumns"}),Ch=ot({prop:"gridTemplateRows"}),Oh=ot({prop:"gridTemplateAreas"}),Ah=ot({prop:"gridArea"});Ci(Ai,ji,ki,_h,xh,wh,Sh,Th,Eh,Ch,Oh,Ah);function Xr(e,t){return t==="grey"?t:e}const jh=ot({prop:"color",themeKey:"palette",transform:Xr}),kh=ot({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:Xr}),$h=ot({prop:"backgroundColor",themeKey:"palette",transform:Xr});Ci(jh,kh,$h);function bt(e){return e<=1&&e!==0?`${e*100}%`:e}const Ih=ot({prop:"width",transform:bt}),ss=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=r=>{var a,s,c,d,p;const i=((c=(s=(a=e.theme)==null?void 0:a.breakpoints)==null?void 0:s.values)==null?void 0:c[r])||wi[r];return i?((p=(d=e.theme)==null?void 0:d.breakpoints)==null?void 0:p.unit)!=="px"?{maxWidth:`${i}${e.theme.breakpoints.unit}`}:{maxWidth:i}:{maxWidth:bt(r)}};return zt(e,e.maxWidth,t)}return null};ss.filterProps=["maxWidth"];const Ph=ot({prop:"minWidth",transform:bt}),Rh=ot({prop:"height",transform:bt}),Dh=ot({prop:"maxHeight",transform:bt}),Fh=ot({prop:"minHeight",transform:bt});ot({prop:"size",cssProperty:"width",transform:bt});ot({prop:"size",cssProperty:"height",transform:bt});const Mh=ot({prop:"boxSizing"});Ci(Ih,ss,Ph,Rh,Dh,Fh,Mh);const $i={border:{themeKey:"borders",transform:Ot},borderTop:{themeKey:"borders",transform:Ot},borderRight:{themeKey:"borders",transform:Ot},borderBottom:{themeKey:"borders",transform:Ot},borderLeft:{themeKey:"borders",transform:Ot},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:Ot},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:Oi},color:{themeKey:"palette",transform:Xr},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:Xr},backgroundColor:{themeKey:"palette",transform:Xr},p:{style:tt},pt:{style:tt},pr:{style:tt},pb:{style:tt},pl:{style:tt},px:{style:tt},py:{style:tt},padding:{style:tt},paddingTop:{style:tt},paddingRight:{style:tt},paddingBottom:{style:tt},paddingLeft:{style:tt},paddingX:{style:tt},paddingY:{style:tt},paddingInline:{style:tt},paddingInlineStart:{style:tt},paddingInlineEnd:{style:tt},paddingBlock:{style:tt},paddingBlockStart:{style:tt},paddingBlockEnd:{style:tt},m:{style:et},mt:{style:et},mr:{style:et},mb:{style:et},ml:{style:et},mx:{style:et},my:{style:et},margin:{style:et},marginTop:{style:et},marginRight:{style:et},marginBottom:{style:et},marginLeft:{style:et},marginX:{style:et},marginY:{style:et},marginInline:{style:et},marginInlineStart:{style:et},marginInlineEnd:{style:et},marginBlock:{style:et},marginBlockStart:{style:et},marginBlockEnd:{style:et},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:Ai},rowGap:{style:ki},columnGap:{style:ji},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:bt},maxWidth:{style:ss},minWidth:{transform:bt},height:{transform:bt},maxHeight:{transform:bt},minHeight:{transform:bt},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 Nh(...e){const t=e.reduce((i,a)=>i.concat(Object.keys(a)),[]),r=new Set(t);return e.every(i=>r.size===Object.keys(i).length)}function Bh(e,t){return typeof e=="function"?e(t):e}function qh(){function e(r,i,a,s){const c={[r]:i,theme:a},d=s[r];if(!d)return{[r]:i};const{cssProperty:p=r,themeKey:m,transform:x,style:_}=d;if(i==null)return null;if(m==="typography"&&i==="inherit")return{[r]:i};const w=Si(a,m)||{};return _?_(c):zt(c,i,I=>{let b=yi(w,x,I);return I===b&&typeof I=="string"&&(b=yi(w,x,`${r}${I==="default"?"":Er(I)}`,I)),p===!1?b:{[p]:b}})}function t(r){const{sx:i,theme:a={},nested:s}=r||{};if(!i)return null;const c=a.unstable_sxConfig??$i;function d(p){let m=p;if(typeof p=="function")m=p(a);else if(typeof p!="object")return p;if(!m)return null;const x=eh(a.breakpoints),_=Object.keys(x);let w=x;return Object.keys(m).forEach(R=>{const I=Bh(m[R],a);if(I!=null)if(typeof I=="object")if(c[R])w=_n(w,e(R,I,a,c));else{const b=zt({theme:a},I,q=>({[R]:q}));Nh(b,I)?w[R]=t({sx:I,theme:a,nested:!0}):w=_n(w,b)}else w=_n(w,e(R,I,a,c))}),!s&&a.modularCssLayers?{"@layer sx":_u(a,wu(_,w))}:_u(a,wu(_,w))}return Array.isArray(i)?i.map(d):d(i)}return t}const Zr=qh();Zr.filterProps=["sx"];function Lh(e){for(var t=0,r,i=0,a=e.length;a>=4;++i,a-=4)r=e.charCodeAt(i)&255|(e.charCodeAt(++i)&255)<<8|(e.charCodeAt(++i)&255)<<16|(e.charCodeAt(++i)&255)<<24,r=(r&65535)*1540483477+((r>>>16)*59797<<16),r^=r>>>24,t=(r&65535)*1540483477+((r>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(a){case 3:t^=(e.charCodeAt(i+2)&255)<<16;case 2:t^=(e.charCodeAt(i+1)&255)<<8;case 1:t^=e.charCodeAt(i)&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 Kh={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};function Vh(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}var zh=/[A-Z]|^ms/g,Uh=/_EMO_([^_]+?)_([^]*?)_EMO_/g,jl=function(t){return t.charCodeAt(1)===45},Tu=function(t){return t!=null&&typeof t!="boolean"},$o=Vh(function(e){return jl(e)?e:e.replace(zh,"-$&").toLowerCase()}),Eu=function(t,r){switch(t){case"animation":case"animationName":if(typeof r=="string")return r.replace(Uh,function(i,a,s){return tr={name:a,styles:s,next:tr},a})}return Kh[t]!==1&&!jl(t)&&typeof r=="number"&&r!==0?r+"px":r};function gi(e,t,r){if(r==null)return"";var i=r;if(i.__emotion_styles!==void 0)return i;switch(typeof r){case"boolean":return"";case"object":{var a=r;if(a.anim===1)return tr={name:a.name,styles:a.styles,next:tr},a.name;var s=r;if(s.styles!==void 0){var c=s.next;if(c!==void 0)for(;c!==void 0;)tr={name:c.name,styles:c.styles,next:tr},c=c.next;var d=s.styles+";";return d}return Gh(e,t,r)}}var p=r;return p}function Gh(e,t,r){var i="";if(Array.isArray(r))for(var a=0;a<r.length;a++)i+=gi(e,t,r[a])+";";else for(var s in r){var c=r[s];if(typeof c!="object"){var d=c;Tu(d)&&(i+=$o(s)+":"+Eu(s,d)+";")}else if(Array.isArray(c)&&typeof c[0]=="string"&&t==null)for(var p=0;p<c.length;p++)Tu(c[p])&&(i+=$o(s)+":"+Eu(s,c[p])+";");else{var m=gi(e,t,c);switch(s){case"animation":case"animationName":{i+=$o(s)+":"+m+";";break}default:i+=s+"{"+m+"}"}}}return i}var Cu=/label:\s*([^\s;{]+)\s*(;|$)/g,tr;function Wh(e,t,r){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var i=!0,a="";tr=void 0;var s=e[0];if(s==null||s.raw===void 0)i=!1,a+=gi(r,t,s);else{var c=s;a+=c[0]}for(var d=1;d<e.length;d++)if(a+=gi(r,t,e[d]),i){var p=s;a+=p[d]}Cu.lastIndex=0;for(var m="",x;(x=Cu.exec(a))!==null;)m+="-"+x[1];var _=Lh(a)+m;return{name:_,styles:a,next:tr}}/**
40
+ `)),()=>{})}function us(e){return kn(e,"spacing",8,"spacing")}function Pn(e,t){return typeof t=="string"||t==null?t:e(t)}function dh(e,t){return r=>e.reduce((i,a)=>(i[a]=Pn(t,r),i),{})}function hh(e,t,r,i){if(!t.includes(r))return null;const a=lh(r),s=dh(a,i),c=e[r];return Wt(e,c,s)}function Il(e,t){const r=us(e.theme);return Object.keys(e).map(i=>hh(e,t,i,r)).reduce(Sn,{})}function it(e){return Il(e,Oi)}it.propTypes=process.env.NODE_ENV!=="production"?Oi.reduce((e,t)=>(e[t]=sr,e),{}):{};it.filterProps=Oi;function ot(e){return Il(e,Ai)}ot.propTypes=process.env.NODE_ENV!=="production"?Ai.reduce((e,t)=>(e[t]=sr,e),{}):{};ot.filterProps=Ai;process.env.NODE_ENV!=="production"&&fh.reduce((e,t)=>(e[t]=sr,e),{});function ji(...e){const t=e.reduce((i,a)=>(a.filterProps.forEach(s=>{i[s]=a}),i),{}),r=i=>Object.keys(i).reduce((a,s)=>t[s]?Sn(a,t[s](i)):a,{});return r.propTypes=process.env.NODE_ENV!=="production"?e.reduce((i,a)=>Object.assign(i,a.propTypes),{}):{},r.filterProps=e.reduce((i,a)=>i.concat(a.filterProps),[]),r}function $t(e){return typeof e!="number"?e:`${e}px solid`}function kt(e,t){return ut({prop:e,themeKey:"borders",transform:t})}const ph=kt("border",$t),mh=kt("borderTop",$t),yh=kt("borderRight",$t),gh=kt("borderBottom",$t),vh=kt("borderLeft",$t),bh=kt("borderColor"),_h=kt("borderTopColor"),xh=kt("borderRightColor"),Sh=kt("borderBottomColor"),wh=kt("borderLeftColor"),Eh=kt("outline",$t),Th=kt("outlineColor"),$i=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=kn(e.theme,"shape.borderRadius",4,"borderRadius"),r=i=>({borderRadius:Pn(t,i)});return Wt(e,e.borderRadius,r)}return null};$i.propTypes=process.env.NODE_ENV!=="production"?{borderRadius:sr}:{};$i.filterProps=["borderRadius"];ji(ph,mh,yh,gh,vh,bh,_h,xh,Sh,wh,$i,Eh,Th);const ki=e=>{if(e.gap!==void 0&&e.gap!==null){const t=kn(e.theme,"spacing",8,"gap"),r=i=>({gap:Pn(t,i)});return Wt(e,e.gap,r)}return null};ki.propTypes=process.env.NODE_ENV!=="production"?{gap:sr}:{};ki.filterProps=["gap"];const Pi=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=kn(e.theme,"spacing",8,"columnGap"),r=i=>({columnGap:Pn(t,i)});return Wt(e,e.columnGap,r)}return null};Pi.propTypes=process.env.NODE_ENV!=="production"?{columnGap:sr}:{};Pi.filterProps=["columnGap"];const Ri=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=kn(e.theme,"spacing",8,"rowGap"),r=i=>({rowGap:Pn(t,i)});return Wt(e,e.rowGap,r)}return null};Ri.propTypes=process.env.NODE_ENV!=="production"?{rowGap:sr}:{};Ri.filterProps=["rowGap"];const Ch=ut({prop:"gridColumn"}),Oh=ut({prop:"gridRow"}),Ah=ut({prop:"gridAutoFlow"}),jh=ut({prop:"gridAutoColumns"}),$h=ut({prop:"gridAutoRows"}),kh=ut({prop:"gridTemplateColumns"}),Ph=ut({prop:"gridTemplateRows"}),Rh=ut({prop:"gridTemplateAreas"}),Ih=ut({prop:"gridArea"});ji(ki,Pi,Ri,Ch,Oh,Ah,jh,$h,kh,Ph,Rh,Ih);function Qr(e,t){return t==="grey"?t:e}const Dh=ut({prop:"color",themeKey:"palette",transform:Qr}),Fh=ut({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:Qr}),Mh=ut({prop:"backgroundColor",themeKey:"palette",transform:Qr});ji(Dh,Fh,Mh);function wt(e){return e<=1&&e!==0?`${e*100}%`:e}const Nh=ut({prop:"width",transform:wt}),cs=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=r=>{var a,s,c,d,p;const i=((c=(s=(a=e.theme)==null?void 0:a.breakpoints)==null?void 0:s.values)==null?void 0:c[r])||Ti[r];return i?((p=(d=e.theme)==null?void 0:d.breakpoints)==null?void 0:p.unit)!=="px"?{maxWidth:`${i}${e.theme.breakpoints.unit}`}:{maxWidth:i}:{maxWidth:wt(r)}};return Wt(e,e.maxWidth,t)}return null};cs.filterProps=["maxWidth"];const Bh=ut({prop:"minWidth",transform:wt}),qh=ut({prop:"height",transform:wt}),Lh=ut({prop:"maxHeight",transform:wt}),Vh=ut({prop:"minHeight",transform:wt});ut({prop:"size",cssProperty:"width",transform:wt});ut({prop:"size",cssProperty:"height",transform:wt});const Kh=ut({prop:"boxSizing"});ji(Nh,cs,Bh,qh,Lh,Vh,Kh);const Ii={border:{themeKey:"borders",transform:$t},borderTop:{themeKey:"borders",transform:$t},borderRight:{themeKey:"borders",transform:$t},borderBottom:{themeKey:"borders",transform:$t},borderLeft:{themeKey:"borders",transform:$t},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:$t},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:$i},color:{themeKey:"palette",transform:Qr},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:Qr},backgroundColor:{themeKey:"palette",transform:Qr},p:{style:ot},pt:{style:ot},pr:{style:ot},pb:{style:ot},pl:{style:ot},px:{style:ot},py:{style:ot},padding:{style:ot},paddingTop:{style:ot},paddingRight:{style:ot},paddingBottom:{style:ot},paddingLeft:{style:ot},paddingX:{style:ot},paddingY:{style:ot},paddingInline:{style:ot},paddingInlineStart:{style:ot},paddingInlineEnd:{style:ot},paddingBlock:{style:ot},paddingBlockStart:{style:ot},paddingBlockEnd:{style:ot},m:{style:it},mt:{style:it},mr:{style:it},mb:{style:it},ml:{style:it},mx:{style:it},my:{style:it},margin:{style:it},marginTop:{style:it},marginRight:{style:it},marginBottom:{style:it},marginLeft:{style:it},marginX:{style:it},marginY:{style:it},marginInline:{style:it},marginInlineStart:{style:it},marginInlineEnd:{style:it},marginBlock:{style:it},marginBlockStart:{style:it},marginBlockEnd:{style:it},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:ki},rowGap:{style:Ri},columnGap:{style:Pi},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:wt},maxWidth:{style:cs},minWidth:{transform:wt},height:{transform:wt},maxHeight:{transform:wt},minHeight:{transform:wt},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 zh(...e){const t=e.reduce((i,a)=>i.concat(Object.keys(a)),[]),r=new Set(t);return e.every(i=>r.size===Object.keys(i).length)}function Uh(e,t){return typeof e=="function"?e(t):e}function Gh(){function e(r,i,a,s){const c={[r]:i,theme:a},d=s[r];if(!d)return{[r]:i};const{cssProperty:p=r,themeKey:m,transform:x,style:b}=d;if(i==null)return null;if(m==="typography"&&i==="inherit")return{[r]:i};const S=Ci(a,m)||{};return b?b(c):Wt(c,i,P=>{let _=bi(S,x,P);return P===_&&typeof P=="string"&&(_=bi(S,x,`${r}${P==="default"?"":Or(P)}`,P)),p===!1?_:{[p]:_}})}function t(r){const{sx:i,theme:a={},nested:s}=r||{};if(!i)return null;const c=a.unstable_sxConfig??Ii;function d(p){let m=p;if(typeof p=="function")m=p(a);else if(typeof p!="object")return p;if(!m)return null;const x=ah(a.breakpoints),b=Object.keys(x);let S=x;return Object.keys(m).forEach(R=>{const P=Uh(m[R],a);if(P!=null)if(typeof P=="object")if(c[R])S=Sn(S,e(R,P,a,c));else{const _=Wt({theme:a},P,L=>({[R]:L}));zh(_,P)?S[R]=t({sx:P,theme:a,nested:!0}):S=Sn(S,_)}else S=Sn(S,e(R,P,a,c))}),!s&&a.modularCssLayers?{"@layer sx":Su(a,Eu(b,S))}:Su(a,Eu(b,S))}return Array.isArray(i)?i.map(d):d(i)}return t}const en=Gh();en.filterProps=["sx"];function Wh(e){for(var t=0,r,i=0,a=e.length;a>=4;++i,a-=4)r=e.charCodeAt(i)&255|(e.charCodeAt(++i)&255)<<8|(e.charCodeAt(++i)&255)<<16|(e.charCodeAt(++i)&255)<<24,r=(r&65535)*1540483477+((r>>>16)*59797<<16),r^=r>>>24,t=(r&65535)*1540483477+((r>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(a){case 3:t^=(e.charCodeAt(i+2)&255)<<16;case 2:t^=(e.charCodeAt(i+1)&255)<<8;case 1:t^=e.charCodeAt(i)&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 Yh={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};function Hh(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}var Jh=/[A-Z]|^ms/g,Xh=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Dl=function(t){return t.charCodeAt(1)===45},Cu=function(t){return t!=null&&typeof t!="boolean"},Io=Hh(function(e){return Dl(e)?e:e.replace(Jh,"-$&").toLowerCase()}),Ou=function(t,r){switch(t){case"animation":case"animationName":if(typeof r=="string")return r.replace(Xh,function(i,a,s){return rr={name:a,styles:s,next:rr},a})}return Yh[t]!==1&&!Dl(t)&&typeof r=="number"&&r!==0?r+"px":r};function _i(e,t,r){if(r==null)return"";var i=r;if(i.__emotion_styles!==void 0)return i;switch(typeof r){case"boolean":return"";case"object":{var a=r;if(a.anim===1)return rr={name:a.name,styles:a.styles,next:rr},a.name;var s=r;if(s.styles!==void 0){var c=s.next;if(c!==void 0)for(;c!==void 0;)rr={name:c.name,styles:c.styles,next:rr},c=c.next;var d=s.styles+";";return d}return Zh(e,t,r)}}var p=r;return p}function Zh(e,t,r){var i="";if(Array.isArray(r))for(var a=0;a<r.length;a++)i+=_i(e,t,r[a])+";";else for(var s in r){var c=r[s];if(typeof c!="object"){var d=c;Cu(d)&&(i+=Io(s)+":"+Ou(s,d)+";")}else if(Array.isArray(c)&&typeof c[0]=="string"&&t==null)for(var p=0;p<c.length;p++)Cu(c[p])&&(i+=Io(s)+":"+Ou(s,c[p])+";");else{var m=_i(e,t,c);switch(s){case"animation":case"animationName":{i+=Io(s)+":"+m+";";break}default:i+=s+"{"+m+"}"}}}return i}var Au=/label:\s*([^\s;{]+)\s*(;|$)/g,rr;function Qh(e,t,r){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var i=!0,a="";rr=void 0;var s=e[0];if(s==null||s.raw===void 0)i=!1,a+=_i(r,t,s);else{var c=s;a+=c[0]}for(var d=1;d<e.length;d++)if(a+=_i(r,t,e[d]),i){var p=s;a+=p[d]}Au.lastIndex=0;for(var m="",x;(x=Au.exec(a))!==null;)m+="-"+x[1];var b=Wh(a)+m;return{name:b,styles:a,next:rr}}/**
41
41
  * @mui/styled-engine v7.3.8
42
42
  *
43
43
  * @license MIT
44
44
  * This source code is licensed under the MIT license found in the
45
45
  * LICENSE file in the root directory of this source tree.
46
- */function Hh(e,t){const r=kd(e,t);return process.env.NODE_ENV!=="production"?(...i)=>{const a=typeof e=="string"?`"${e}"`:"component";return i.length===0?console.error([`MUI: Seems like you called \`styled(${a})()\` without a \`style\` argument.`,'You must provide a `styles` argument: `styled("div")(styleYouForgotToPass)`.'].join(`
47
- `)):i.some(s=>s===void 0)&&console.error(`MUI: the styled(${a})(...args) API requires all its args to be defined.`),r(...i)}:r}function Yh(e,t){Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}const Ou=[];function xr(e){return Ou[0]=e,Wh(Ou)}const Jh=e=>{const t=Object.keys(e).map(r=>({key:r,val:e[r]}))||[];return t.sort((r,i)=>r.val-i.val),t.reduce((r,i)=>({...r,[i.key]:i.val}),{})};function Xh(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:r="px",step:i=5,...a}=e,s=Jh(t),c=Object.keys(s);function d(w){return`@media (min-width:${typeof t[w]=="number"?t[w]:w}${r})`}function p(w){return`@media (max-width:${(typeof t[w]=="number"?t[w]:w)-i/100}${r})`}function m(w,R){const I=c.indexOf(R);return`@media (min-width:${typeof t[w]=="number"?t[w]:w}${r}) and (max-width:${(I!==-1&&typeof t[c[I]]=="number"?t[c[I]]:R)-i/100}${r})`}function x(w){return c.indexOf(w)+1<c.length?m(w,c[c.indexOf(w)+1]):d(w)}function _(w){const R=c.indexOf(w);return R===0?d(c[1]):R===c.length-1?p(c[R]):m(w,c[c.indexOf(w)+1]).replace("@media","@media not all and")}return{keys:c,values:s,up:d,down:p,between:m,only:x,not:_,unit:r,...a}}const Zh={borderRadius:4};function kl(e=8,t=as({spacing:e})){if(e.mui)return e;const r=(...i)=>(process.env.NODE_ENV!=="production"&&(i.length<=4||console.error(`MUI: Too many arguments provided, expected between 0 and 4, got ${i.length}`)),(i.length===0?[1]:i).map(s=>{const c=t(s);return typeof c=="number"?`${c}px`:c}).join(" "));return r.mui=!0,r}function Qh(e,t){var i;const r=this;if(r.vars){if(!((i=r.colorSchemes)!=null&&i[e])||typeof r.getColorSchemeSelector!="function")return{};let a=r.getColorSchemeSelector(e);return a==="&"?t:((a.includes("data-")||a.includes("."))&&(a=`*:where(${a.replace(/\s*&$/,"")}) &`),{[a]:t})}return r.palette.mode===e?t:{}}function $l(e={},...t){const{breakpoints:r={},palette:i={},spacing:a,shape:s={},...c}=e,d=Xh(r),p=kl(a);let m=_t({breakpoints:d,direction:"ltr",components:{},palette:{mode:"light",...i},spacing:p,shape:{...Zh,...s}},c);return m=Zd(m),m.applyStyles=Qh,m=t.reduce((x,_)=>_t(x,_),m),m.unstable_sxConfig={...$i,...c==null?void 0:c.unstable_sxConfig},m.unstable_sx=function(_){return Zr({sx:_,theme:this})},m}const ep={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 us(e,t,r="Mui"){const i=ep[t];return i?`${r}-${i}`:`${Md.generate(e)}-${t}`}function tp(e,t,r="Mui"){const i={};return t.forEach(a=>{i[a]=us(e,a,r)}),i}function Il(e,t=""){return e.displayName||e.name||t}function Au(e,t,r){const i=Il(t);return e.displayName||(i!==""?`${r}(${i})`:r)}function rp(e){if(e!=null){if(typeof e=="string")return e;if(typeof e=="function")return Il(e,"Component");if(typeof e=="object")switch(e.$$typeof){case mi.ForwardRef:return Au(e,e.render,"ForwardRef");case mi.Memo:return Au(e,e.type,"memo");default:return}}}function Pl(e){const{variants:t,...r}=e,i={variants:t,style:xr(r),isProcessed:!0};return i.style===r||t&&t.forEach(a=>{typeof a.style!="function"&&(a.style=xr(a.style))}),i}const np=$l();function Io(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}function br(e,t){return t&&e&&typeof e=="object"&&e.styles&&!e.styles.startsWith("@layer")&&(e.styles=`@layer ${t}{${String(e.styles)}}`),e}function ip(e){return e?(t,r)=>r[e]:null}function op(e,t,r){e.theme=cp(e.theme)?r:e.theme[t]||e.theme}function li(e,t,r){const i=typeof t=="function"?t(e):t;if(Array.isArray(i))return i.flatMap(a=>li(e,a,r));if(Array.isArray(i==null?void 0:i.variants)){let a;if(i.isProcessed)a=r?br(i.style,r):i.style;else{const{variants:s,...c}=i;a=r?br(xr(c),r):c}return Rl(e,i.variants,[a],r)}return i!=null&&i.isProcessed?r?br(xr(i.style),r):i.style:r?br(xr(i),r):i}function Rl(e,t,r=[],i=void 0){var s;let a;e:for(let c=0;c<t.length;c+=1){const d=t[c];if(typeof d.props=="function"){if(a??(a={...e,...e.ownerState,ownerState:e.ownerState}),!d.props(a))continue}else for(const p in d.props)if(e[p]!==d.props[p]&&((s=e.ownerState)==null?void 0:s[p])!==d.props[p])continue e;typeof d.style=="function"?(a??(a={...e,...e.ownerState,ownerState:e.ownerState}),r.push(i?br(xr(d.style(a)),i):d.style(a))):r.push(i?br(xr(d.style),i):d.style)}return r}function ap(e={}){const{themeId:t,defaultTheme:r=np,rootShouldForwardProp:i=Io,slotShouldForwardProp:a=Io}=e;function s(d){op(d,t,r)}return(d,p={})=>{Yh(d,N=>N.filter(Z=>Z!==Zr));const{name:m,slot:x,skipVariantsResolver:_,skipSx:w,overridesResolver:R=ip(Dl(x)),...I}=p,b=m&&m.startsWith("Mui")||x?"components":"custom",q=_!==void 0?_:x&&x!=="Root"&&x!=="root"||!1,M=w||!1;let W=Io;x==="Root"||x==="root"?W=i:x?W=a:lp(d)&&(W=void 0);const G=Hh(d,{shouldForwardProp:W,label:up(m,x),...I}),X=N=>{if(N.__emotion_real===N)return N;if(typeof N=="function")return function(ae){return li(ae,N,ae.theme.modularCssLayers?b:void 0)};if(Vt(N)){const Z=Pl(N);return function(ye){return Z.variants?li(ye,Z,ye.theme.modularCssLayers?b:void 0):ye.theme.modularCssLayers?br(Z.style,b):Z.style}}return N},L=(...N)=>{const Z=[],ae=N.map(X),ye=[];if(Z.push(s),m&&R&&ye.push(function(ee){var He,Ue;const ge=(Ue=(He=ee.theme.components)==null?void 0:He[m])==null?void 0:Ue.styleOverrides;if(!ge)return null;const Ee={};for(const ft in ge)Ee[ft]=li(ee,ge[ft],ee.theme.modularCssLayers?"theme":void 0);return R(ee,Ee)}),m&&!q&&ye.push(function(ee){var Ee,He;const te=ee.theme,ge=(He=(Ee=te==null?void 0:te.components)==null?void 0:Ee[m])==null?void 0:He.variants;return ge?Rl(ee,ge,[],ee.theme.modularCssLayers?"theme":void 0):null}),M||ye.push(Zr),Array.isArray(ae[0])){const v=ae.shift(),ee=new Array(Z.length).fill(""),te=new Array(ye.length).fill("");let ge;ge=[...ee,...v,...te],ge.raw=[...ee,...v.raw,...te],Z.unshift(ge)}const We=[...Z,...ae,...ye],be=G(...We);return d.muiName&&(be.muiName=d.muiName),process.env.NODE_ENV!=="production"&&(be.displayName=sp(m,x,d)),be};return G.withConfig&&(L.withConfig=G.withConfig),L}}function sp(e,t,r){return e?`${e}${Er(t||"")}`:`Styled(${rp(r)})`}function up(e,t){let r;return process.env.NODE_ENV!=="production"&&e&&(r=`${e}-${Dl(t||"Root")}`),r}function cp(e){for(const t in e)return!1;return!0}function lp(e){return typeof e=="string"&&e.charCodeAt(0)>96}function Dl(e){return e&&e.charAt(0).toLowerCase()+e.slice(1)}function Va(e,t,r=!1){const i={...t};for(const a in e)if(Object.prototype.hasOwnProperty.call(e,a)){const s=a;if(s==="components"||s==="slots")i[s]={...e[s],...i[s]};else if(s==="componentsProps"||s==="slotProps"){const c=e[s],d=t[s];if(!d)i[s]=c||{};else if(!c)i[s]=d;else{i[s]={...d};for(const p in c)if(Object.prototype.hasOwnProperty.call(c,p)){const m=p;i[s][m]=Va(c[m],d[m],r)}}}else s==="className"&&r&&t.className?i.className=Cl(e==null?void 0:e.className,t==null?void 0:t.className):s==="style"&&r&&t.style?i.style={...e==null?void 0:e.style,...t==null?void 0:t.style}:i[s]===void 0&&(i[s]=e[s])}return i}function fp(e,t=Number.MIN_SAFE_INTEGER,r=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,r))}function cs(e,t=0,r=1){return process.env.NODE_ENV!=="production"&&(e<t||e>r)&&console.error(`MUI: The value provided ${e} is out of range [${t}, ${r}].`),fp(e,t,r)}function dp(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let r=e.match(t);return r&&r[0].length===1&&(r=r.map(i=>i+i)),process.env.NODE_ENV!=="production"&&e.length!==e.trim().length&&console.error(`MUI: The color: "${e}" is invalid. Make sure the color input doesn't contain leading/trailing space.`),r?`rgb${r.length===4?"a":""}(${r.map((i,a)=>a<3?parseInt(i,16):Math.round(parseInt(i,16)/255*1e3)/1e3).join(", ")})`:""}function ir(e){if(e.type)return e;if(e.charAt(0)==="#")return ir(dp(e));const t=e.indexOf("("),r=e.substring(0,t);if(!["rgb","rgba","hsl","hsla","color"].includes(r))throw new Error(process.env.NODE_ENV!=="production"?`MUI: Unsupported \`${e}\` color.
48
- The following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().`:Tr(9,e));let i=e.substring(t+1,e.length-1),a;if(r==="color"){if(i=i.split(" "),a=i.shift(),i.length===4&&i[3].charAt(0)==="/"&&(i[3]=i[3].slice(1)),!["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].includes(a))throw new Error(process.env.NODE_ENV!=="production"?`MUI: unsupported \`${a}\` color space.
49
- The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rgb, rec-2020.`:Tr(10,a))}else i=i.split(",");return i=i.map(s=>parseFloat(s)),{type:r,values:i,colorSpace:a}}const hp=e=>{const t=ir(e);return t.values.slice(0,3).map((r,i)=>t.type.includes("hsl")&&i!==0?`${r}%`:r).join(" ")},vn=(e,t)=>{try{return hp(e)}catch{return t&&process.env.NODE_ENV!=="production"&&console.warn(t),e}};function Ii(e){const{type:t,colorSpace:r}=e;let{values:i}=e;return t.includes("rgb")?i=i.map((a,s)=>s<3?parseInt(a,10):a):t.includes("hsl")&&(i[1]=`${i[1]}%`,i[2]=`${i[2]}%`),t.includes("color")?i=`${r} ${i.join(" ")}`:i=`${i.join(", ")}`,`${t}(${i})`}function Fl(e){e=ir(e);const{values:t}=e,r=t[0],i=t[1]/100,a=t[2]/100,s=i*Math.min(a,1-a),c=(m,x=(m+r/30)%12)=>a-s*Math.max(Math.min(x-3,9-x,1),-1);let d="rgb";const p=[Math.round(c(0)*255),Math.round(c(8)*255),Math.round(c(4)*255)];return e.type==="hsla"&&(d+="a",p.push(t[3])),Ii({type:d,values:p})}function za(e){e=ir(e);let t=e.type==="hsl"||e.type==="hsla"?ir(Fl(e)).values:e.values;return t=t.map(r=>(e.type!=="color"&&(r/=255),r<=.03928?r/12.92:((r+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function ju(e,t){const r=za(e),i=za(t);return(Math.max(r,i)+.05)/(Math.min(r,i)+.05)}function Ml(e,t){return e=ir(e),t=cs(t),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${t}`:e.values[3]=t,Ii(e)}function yr(e,t,r){try{return Ml(e,t)}catch{return r&&process.env.NODE_ENV!=="production"&&console.warn(r),e}}function Pi(e,t){if(e=ir(e),t=cs(t),e.type.includes("hsl"))e.values[2]*=1-t;else if(e.type.includes("rgb")||e.type.includes("color"))for(let r=0;r<3;r+=1)e.values[r]*=1-t;return Ii(e)}function Be(e,t,r){try{return Pi(e,t)}catch{return r&&process.env.NODE_ENV!=="production"&&console.warn(r),e}}function Ri(e,t){if(e=ir(e),t=cs(t),e.type.includes("hsl"))e.values[2]+=(100-e.values[2])*t;else if(e.type.includes("rgb"))for(let r=0;r<3;r+=1)e.values[r]+=(255-e.values[r])*t;else if(e.type.includes("color"))for(let r=0;r<3;r+=1)e.values[r]+=(1-e.values[r])*t;return Ii(e)}function qe(e,t,r){try{return Ri(e,t)}catch{return r&&process.env.NODE_ENV!=="production"&&console.warn(r),e}}function pp(e,t=.15){return za(e)>.5?Pi(e,t):Ri(e,t)}function oi(e,t,r){try{return pp(e,t)}catch{return e}}const mp=nr.createContext(void 0);process.env.NODE_ENV!=="production"&&(Fe.node,Fe.object);function yp(e){const{theme:t,name:r,props:i}=e;if(!t||!t.components||!t.components[r])return i;const a=t.components[r];return a.defaultProps?Va(a.defaultProps,i,t.components.mergeClassNameAndStyle):!a.styleOverrides&&!a.variants?Va(a,i,t.components.mergeClassNameAndStyle):i}function gp({props:e,name:t}){const r=nr.useContext(mp);return yp({props:e,name:t,theme:{components:r}})}const ku={theme:void 0};function vp(e){let t,r;return function(a){let s=t;return(s===void 0||a.theme!==r)&&(ku.theme=a.theme,s=Pl(e(ku)),t=s,r=a.theme),s}}function bp(e=""){function t(...i){if(!i.length)return"";const a=i[0];return typeof a=="string"&&!a.match(/(#|\(|\)|(-?(\d*\.)?\d+)(px|em|%|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc))|^(-?(\d*\.)?\d+)$|(\d+ \d+ \d+)/)?`, var(--${e?`${e}-`:""}${a}${t(...i.slice(1))})`:`, ${a}`}return(i,...a)=>`var(--${e?`${e}-`:""}${i}${t(...a)})`}const $u=(e,t,r,i=[])=>{let a=e;t.forEach((s,c)=>{c===t.length-1?Array.isArray(a)?a[Number(s)]=r:a&&typeof a=="object"&&(a[s]=r):a&&typeof a=="object"&&(a[s]||(a[s]=i.includes(s)?[]:{}),a=a[s])})},_p=(e,t,r)=>{function i(a,s=[],c=[]){Object.entries(a).forEach(([d,p])=>{(!r||r&&!r([...s,d]))&&p!=null&&(typeof p=="object"&&Object.keys(p).length>0?i(p,[...s,d],Array.isArray(p)?[...c,d]:c):t([...s,d],p,c))})}i(e)},xp=(e,t)=>typeof t=="number"?["lineHeight","fontWeight","opacity","zIndex"].some(i=>e.includes(i))||e[e.length-1].toLowerCase().includes("opacity")?t:`${t}px`:t;function Po(e,t){const{prefix:r,shouldSkipGeneratingVar:i}=t||{},a={},s={},c={};return _p(e,(d,p,m)=>{if((typeof p=="string"||typeof p=="number")&&(!i||!i(d,p))){const x=`--${r?`${r}-`:""}${d.join("-")}`,_=xp(d,p);Object.assign(a,{[x]:_}),$u(s,d,`var(${x})`,m),$u(c,d,`var(${x}, ${_})`,m)}},d=>d[0]==="vars"),{css:a,vars:s,varsWithDefaults:c}}function wp(e,t={}){const{getSelector:r=M,disableCssColorScheme:i,colorSchemeSelector:a,enableContrastVars:s}=t,{colorSchemes:c={},components:d,defaultColorScheme:p="light",...m}=e,{vars:x,css:_,varsWithDefaults:w}=Po(m,t);let R=w;const I={},{[p]:b,...q}=c;if(Object.entries(q||{}).forEach(([X,L])=>{const{vars:N,css:Z,varsWithDefaults:ae}=Po(L,t);R=_t(R,ae),I[X]={css:Z,vars:N}}),b){const{css:X,vars:L,varsWithDefaults:N}=Po(b,t);R=_t(R,N),I[p]={css:X,vars:L}}function M(X,L){var Z,ae;let N=a;if(a==="class"&&(N=".%s"),a==="data"&&(N="[data-%s]"),a!=null&&a.startsWith("data-")&&!a.includes("%s")&&(N=`[${a}="%s"]`),X){if(N==="media")return e.defaultColorScheme===X?":root":{[`@media (prefers-color-scheme: ${((ae=(Z=c[X])==null?void 0:Z.palette)==null?void 0:ae.mode)||X})`]:{":root":L}};if(N)return e.defaultColorScheme===X?`:root, ${N.replace("%s",String(X))}`:N.replace("%s",String(X))}return":root"}return{vars:R,generateThemeVars:()=>{let X={...x};return Object.entries(I).forEach(([,{vars:L}])=>{X=_t(X,L)}),X},generateStyleSheets:()=>{var ye,We;const X=[],L=e.defaultColorScheme||"light";function N(be,v){Object.keys(v).length&&X.push(typeof be=="string"?{[be]:{...v}}:be)}N(r(void 0,{..._}),_);const{[L]:Z,...ae}=I;if(Z){const{css:be}=Z,v=(We=(ye=c[L])==null?void 0:ye.palette)==null?void 0:We.mode,ee=!i&&v?{colorScheme:v,...be}:{...be};N(r(L,{...ee}),ee)}return Object.entries(ae).forEach(([be,{css:v}])=>{var ge,Ee;const ee=(Ee=(ge=c[be])==null?void 0:ge.palette)==null?void 0:Ee.mode,te=!i&&ee?{colorScheme:ee,...v}:{...v};N(r(be,{...te}),te)}),s&&X.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)"}}),X}}}function Sp(e){return function(r){return e==="media"?(process.env.NODE_ENV!=="production"&&r!=="light"&&r!=="dark"&&console.error(`MUI: @media (prefers-color-scheme) supports only 'light' or 'dark', but receive '${r}'.`),`@media (prefers-color-scheme: ${r})`):e?e.startsWith("data-")&&!e.includes("%s")?`[${e}="${r}"] &`:e==="class"?`.${r} &`:e==="data"?`[data-${r}] &`:`${e.replace("%s",r)} &`:"&"}}const Sn={black:"#000",white:"#fff"},Tp={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"},Vr={50:"#f3e5f5",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",700:"#7b1fa2"},zr={300:"#e57373",400:"#ef5350",500:"#f44336",700:"#d32f2f",800:"#c62828"},mn={300:"#ffb74d",400:"#ffa726",500:"#ff9800",700:"#f57c00",900:"#e65100"},Ur={50:"#e3f2fd",200:"#90caf9",400:"#42a5f5",700:"#1976d2",800:"#1565c0"},Gr={300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",700:"#0288d1",900:"#01579b"},Wr={300:"#81c784",400:"#66bb6a",500:"#4caf50",700:"#388e3c",800:"#2e7d32",900:"#1b5e20"};function Nl(){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:Sn.white,default:Sn.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 Bl=Nl();function ql(){return{text:{primary:Sn.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:Sn.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 Ua=ql();function Iu(e,t,r,i){const a=i.light||i,s=i.dark||i*1.5;e[t]||(e.hasOwnProperty(r)?e[t]=e[r]:t==="light"?e.light=Ri(e.main,a):t==="dark"&&(e.dark=Pi(e.main,s)))}function Pu(e,t,r,i,a){const s=a.light||a,c=a.dark||a*1.5;t[r]||(t.hasOwnProperty(i)?t[r]=t[i]:r==="light"?t.light=`color-mix(in ${e}, ${t.main}, #fff ${(s*100).toFixed(0)}%)`:r==="dark"&&(t.dark=`color-mix(in ${e}, ${t.main}, #000 ${(c*100).toFixed(0)}%)`))}function Ep(e="light"){return e==="dark"?{main:Ur[200],light:Ur[50],dark:Ur[400]}:{main:Ur[700],light:Ur[400],dark:Ur[800]}}function Cp(e="light"){return e==="dark"?{main:Vr[200],light:Vr[50],dark:Vr[400]}:{main:Vr[500],light:Vr[300],dark:Vr[700]}}function Op(e="light"){return e==="dark"?{main:zr[500],light:zr[300],dark:zr[700]}:{main:zr[700],light:zr[400],dark:zr[800]}}function Ap(e="light"){return e==="dark"?{main:Gr[400],light:Gr[300],dark:Gr[700]}:{main:Gr[700],light:Gr[500],dark:Gr[900]}}function jp(e="light"){return e==="dark"?{main:Wr[400],light:Wr[300],dark:Wr[700]}:{main:Wr[800],light:Wr[500],dark:Wr[900]}}function kp(e="light"){return e==="dark"?{main:mn[400],light:mn[300],dark:mn[700]}:{main:"#ed6c02",light:mn[500],dark:mn[900]}}function $p(e){return`oklch(from ${e} var(--__l) 0 h / var(--__a))`}function ls(e){const{mode:t="light",contrastThreshold:r=3,tonalOffset:i=.2,colorSpace:a,...s}=e,c=e.primary||Ep(t),d=e.secondary||Cp(t),p=e.error||Op(t),m=e.info||Ap(t),x=e.success||jp(t),_=e.warning||kp(t);function w(q){if(a)return $p(q);const M=ju(q,Ua.text.primary)>=r?Ua.text.primary:Bl.text.primary;if(process.env.NODE_ENV!=="production"){const W=ju(q,M);W<3&&console.error([`MUI: The contrast ratio of ${W}:1 for ${M} on ${q}`,"falls below the WCAG recommended absolute minimum contrast ratio of 3:1.","https://www.w3.org/TR/2008/REC-WCAG20-20081211/#visual-audio-contrast-contrast"].join(`
50
- `))}return M}const R=({color:q,name:M,mainShade:W=500,lightShade:G=300,darkShade:X=700})=>{if(q={...q},!q.main&&q[W]&&(q.main=q[W]),!q.hasOwnProperty("main"))throw new Error(process.env.NODE_ENV!=="production"?`MUI: The color${M?` (${M})`:""} provided to augmentColor(color) is invalid.
51
- The color object needs to have a \`main\` property or a \`${W}\` property.`:Tr(11,M?` (${M})`:"",W));if(typeof q.main!="string")throw new Error(process.env.NODE_ENV!=="production"?`MUI: The color${M?` (${M})`:""} provided to augmentColor(color) is invalid.
52
- \`color.main\` should be a string, but \`${JSON.stringify(q.main)}\` was provided instead.
46
+ */function ep(e,t){const r=Fd(e,t);return process.env.NODE_ENV!=="production"?(...i)=>{const a=typeof e=="string"?`"${e}"`:"component";return i.length===0?console.error([`MUI: Seems like you called \`styled(${a})()\` without a \`style\` argument.`,'You must provide a `styles` argument: `styled("div")(styleYouForgotToPass)`.'].join(`
47
+ `)):i.some(s=>s===void 0)&&console.error(`MUI: the styled(${a})(...args) API requires all its args to be defined.`),r(...i)}:r}function tp(e,t){Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}const ju=[];function wr(e){return ju[0]=e,Qh(ju)}const rp=e=>{const t=Object.keys(e).map(r=>({key:r,val:e[r]}))||[];return t.sort((r,i)=>r.val-i.val),t.reduce((r,i)=>({...r,[i.key]:i.val}),{})};function np(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:r="px",step:i=5,...a}=e,s=rp(t),c=Object.keys(s);function d(S){return`@media (min-width:${typeof t[S]=="number"?t[S]:S}${r})`}function p(S){return`@media (max-width:${(typeof t[S]=="number"?t[S]:S)-i/100}${r})`}function m(S,R){const P=c.indexOf(R);return`@media (min-width:${typeof t[S]=="number"?t[S]:S}${r}) and (max-width:${(P!==-1&&typeof t[c[P]]=="number"?t[c[P]]:R)-i/100}${r})`}function x(S){return c.indexOf(S)+1<c.length?m(S,c[c.indexOf(S)+1]):d(S)}function b(S){const R=c.indexOf(S);return R===0?d(c[1]):R===c.length-1?p(c[R]):m(S,c[c.indexOf(S)+1]).replace("@media","@media not all and")}return{keys:c,values:s,up:d,down:p,between:m,only:x,not:b,unit:r,...a}}const ip={borderRadius:4};function Fl(e=8,t=us({spacing:e})){if(e.mui)return e;const r=(...i)=>(process.env.NODE_ENV!=="production"&&(i.length<=4||console.error(`MUI: Too many arguments provided, expected between 0 and 4, got ${i.length}`)),(i.length===0?[1]:i).map(s=>{const c=t(s);return typeof c=="number"?`${c}px`:c}).join(" "));return r.mui=!0,r}function op(e,t){var i;const r=this;if(r.vars){if(!((i=r.colorSchemes)!=null&&i[e])||typeof r.getColorSchemeSelector!="function")return{};let a=r.getColorSchemeSelector(e);return a==="&"?t:((a.includes("data-")||a.includes("."))&&(a=`*:where(${a.replace(/\s*&$/,"")}) &`),{[a]:t})}return r.palette.mode===e?t:{}}function Ml(e={},...t){const{breakpoints:r={},palette:i={},spacing:a,shape:s={},...c}=e,d=np(r),p=Fl(a);let m=Et({breakpoints:d,direction:"ltr",components:{},palette:{mode:"light",...i},spacing:p,shape:{...ip,...s}},c);return m=ih(m),m.applyStyles=op,m=t.reduce((x,b)=>Et(x,b),m),m.unstable_sxConfig={...Ii,...c==null?void 0:c.unstable_sxConfig},m.unstable_sx=function(b){return en({sx:b,theme:this})},m}const ap={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 ls(e,t,r="Mui"){const i=ap[t];return i?`${r}-${i}`:`${Kd.generate(e)}-${t}`}function sp(e,t,r="Mui"){const i={};return t.forEach(a=>{i[a]=ls(e,a,r)}),i}function Nl(e,t=""){return e.displayName||e.name||t}function $u(e,t,r){const i=Nl(t);return e.displayName||(i!==""?`${r}(${i})`:r)}function up(e){if(e!=null){if(typeof e=="string")return e;if(typeof e=="function")return Nl(e,"Component");if(typeof e=="object")switch(e.$$typeof){case vi.ForwardRef:return $u(e,e.render,"ForwardRef");case vi.Memo:return $u(e,e.type,"memo");default:return}}}function Bl(e){const{variants:t,...r}=e,i={variants:t,style:wr(r),isProcessed:!0};return i.style===r||t&&t.forEach(a=>{typeof a.style!="function"&&(a.style=wr(a.style))}),i}const cp=Ml();function Do(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}function xr(e,t){return t&&e&&typeof e=="object"&&e.styles&&!e.styles.startsWith("@layer")&&(e.styles=`@layer ${t}{${String(e.styles)}}`),e}function lp(e){return e?(t,r)=>r[e]:null}function fp(e,t,r){e.theme=mp(e.theme)?r:e.theme[t]||e.theme}function hi(e,t,r){const i=typeof t=="function"?t(e):t;if(Array.isArray(i))return i.flatMap(a=>hi(e,a,r));if(Array.isArray(i==null?void 0:i.variants)){let a;if(i.isProcessed)a=r?xr(i.style,r):i.style;else{const{variants:s,...c}=i;a=r?xr(wr(c),r):c}return ql(e,i.variants,[a],r)}return i!=null&&i.isProcessed?r?xr(wr(i.style),r):i.style:r?xr(wr(i),r):i}function ql(e,t,r=[],i=void 0){var s;let a;e:for(let c=0;c<t.length;c+=1){const d=t[c];if(typeof d.props=="function"){if(a??(a={...e,...e.ownerState,ownerState:e.ownerState}),!d.props(a))continue}else for(const p in d.props)if(e[p]!==d.props[p]&&((s=e.ownerState)==null?void 0:s[p])!==d.props[p])continue e;typeof d.style=="function"?(a??(a={...e,...e.ownerState,ownerState:e.ownerState}),r.push(i?xr(wr(d.style(a)),i):d.style(a))):r.push(i?xr(wr(d.style),i):d.style)}return r}function dp(e={}){const{themeId:t,defaultTheme:r=cp,rootShouldForwardProp:i=Do,slotShouldForwardProp:a=Do}=e;function s(d){fp(d,t,r)}return(d,p={})=>{tp(d,q=>q.filter(X=>X!==en));const{name:m,slot:x,skipVariantsResolver:b,skipSx:S,overridesResolver:R=lp(Ll(x)),...P}=p,_=m&&m.startsWith("Mui")||x?"components":"custom",L=b!==void 0?b:x&&x!=="Root"&&x!=="root"||!1,M=S||!1;let H=Do;x==="Root"||x==="root"?H=i:x?H=a:yp(d)&&(H=void 0);const G=ep(d,{shouldForwardProp:H,label:pp(m,x),...P}),W=q=>{if(q.__emotion_real===q)return q;if(typeof q=="function")return function(ie){return hi(ie,q,ie.theme.modularCssLayers?_:void 0)};if(Gt(q)){const X=Bl(q);return function(ye){return X.variants?hi(ye,X,ye.theme.modularCssLayers?_:void 0):ye.theme.modularCssLayers?xr(X.style,_):X.style}}return q},A=(...q)=>{const X=[],ie=q.map(W),ye=[];if(X.push(s),m&&R&&ye.push(function(ee){var We,Ke;const ge=(Ke=(We=ee.theme.components)==null?void 0:We[m])==null?void 0:Ke.styleOverrides;if(!ge)return null;const Te={};for(const lt in ge)Te[lt]=hi(ee,ge[lt],ee.theme.modularCssLayers?"theme":void 0);return R(ee,Te)}),m&&!L&&ye.push(function(ee){var Te,We;const te=ee.theme,ge=(We=(Te=te==null?void 0:te.components)==null?void 0:Te[m])==null?void 0:We.variants;return ge?ql(ee,ge,[],ee.theme.modularCssLayers?"theme":void 0):null}),M||ye.push(en),Array.isArray(ie[0])){const v=ie.shift(),ee=new Array(X.length).fill(""),te=new Array(ye.length).fill("");let ge;ge=[...ee,...v,...te],ge.raw=[...ee,...v.raw,...te],X.unshift(ge)}const Ge=[...X,...ie,...ye],ve=G(...Ge);return d.muiName&&(ve.muiName=d.muiName),process.env.NODE_ENV!=="production"&&(ve.displayName=hp(m,x,d)),ve};return G.withConfig&&(A.withConfig=G.withConfig),A}}function hp(e,t,r){return e?`${e}${Or(t||"")}`:`Styled(${up(r)})`}function pp(e,t){let r;return process.env.NODE_ENV!=="production"&&e&&(r=`${e}-${Ll(t||"Root")}`),r}function mp(e){for(const t in e)return!1;return!0}function yp(e){return typeof e=="string"&&e.charCodeAt(0)>96}function Ll(e){return e&&e.charAt(0).toLowerCase()+e.slice(1)}function Ga(e,t,r=!1){const i={...t};for(const a in e)if(Object.prototype.hasOwnProperty.call(e,a)){const s=a;if(s==="components"||s==="slots")i[s]={...e[s],...i[s]};else if(s==="componentsProps"||s==="slotProps"){const c=e[s],d=t[s];if(!d)i[s]=c||{};else if(!c)i[s]=d;else{i[s]={...d};for(const p in c)if(Object.prototype.hasOwnProperty.call(c,p)){const m=p;i[s][m]=Ga(c[m],d[m],r)}}}else s==="className"&&r&&t.className?i.className=Pl(e==null?void 0:e.className,t==null?void 0:t.className):s==="style"&&r&&t.style?i.style={...e==null?void 0:e.style,...t==null?void 0:t.style}:i[s]===void 0&&(i[s]=e[s])}return i}function gp(e,t=Number.MIN_SAFE_INTEGER,r=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,r))}function fs(e,t=0,r=1){return process.env.NODE_ENV!=="production"&&(e<t||e>r)&&console.error(`MUI: The value provided ${e} is out of range [${t}, ${r}].`),gp(e,t,r)}function vp(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let r=e.match(t);return r&&r[0].length===1&&(r=r.map(i=>i+i)),process.env.NODE_ENV!=="production"&&e.length!==e.trim().length&&console.error(`MUI: The color: "${e}" is invalid. Make sure the color input doesn't contain leading/trailing space.`),r?`rgb${r.length===4?"a":""}(${r.map((i,a)=>a<3?parseInt(i,16):Math.round(parseInt(i,16)/255*1e3)/1e3).join(", ")})`:""}function or(e){if(e.type)return e;if(e.charAt(0)==="#")return or(vp(e));const t=e.indexOf("("),r=e.substring(0,t);if(!["rgb","rgba","hsl","hsla","color"].includes(r))throw new Error(process.env.NODE_ENV!=="production"?`MUI: Unsupported \`${e}\` color.
48
+ The following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().`:Cr(9,e));let i=e.substring(t+1,e.length-1),a;if(r==="color"){if(i=i.split(" "),a=i.shift(),i.length===4&&i[3].charAt(0)==="/"&&(i[3]=i[3].slice(1)),!["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].includes(a))throw new Error(process.env.NODE_ENV!=="production"?`MUI: unsupported \`${a}\` color space.
49
+ The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rgb, rec-2020.`:Cr(10,a))}else i=i.split(",");return i=i.map(s=>parseFloat(s)),{type:r,values:i,colorSpace:a}}const bp=e=>{const t=or(e);return t.values.slice(0,3).map((r,i)=>t.type.includes("hsl")&&i!==0?`${r}%`:r).join(" ")},_n=(e,t)=>{try{return bp(e)}catch{return t&&process.env.NODE_ENV!=="production"&&console.warn(t),e}};function Di(e){const{type:t,colorSpace:r}=e;let{values:i}=e;return t.includes("rgb")?i=i.map((a,s)=>s<3?parseInt(a,10):a):t.includes("hsl")&&(i[1]=`${i[1]}%`,i[2]=`${i[2]}%`),t.includes("color")?i=`${r} ${i.join(" ")}`:i=`${i.join(", ")}`,`${t}(${i})`}function Vl(e){e=or(e);const{values:t}=e,r=t[0],i=t[1]/100,a=t[2]/100,s=i*Math.min(a,1-a),c=(m,x=(m+r/30)%12)=>a-s*Math.max(Math.min(x-3,9-x,1),-1);let d="rgb";const p=[Math.round(c(0)*255),Math.round(c(8)*255),Math.round(c(4)*255)];return e.type==="hsla"&&(d+="a",p.push(t[3])),Di({type:d,values:p})}function Wa(e){e=or(e);let t=e.type==="hsl"||e.type==="hsla"?or(Vl(e)).values:e.values;return t=t.map(r=>(e.type!=="color"&&(r/=255),r<=.03928?r/12.92:((r+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function ku(e,t){const r=Wa(e),i=Wa(t);return(Math.max(r,i)+.05)/(Math.min(r,i)+.05)}function Kl(e,t){return e=or(e),t=fs(t),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${t}`:e.values[3]=t,Di(e)}function vr(e,t,r){try{return Kl(e,t)}catch{return r&&process.env.NODE_ENV!=="production"&&console.warn(r),e}}function Fi(e,t){if(e=or(e),t=fs(t),e.type.includes("hsl"))e.values[2]*=1-t;else if(e.type.includes("rgb")||e.type.includes("color"))for(let r=0;r<3;r+=1)e.values[r]*=1-t;return Di(e)}function Le(e,t,r){try{return Fi(e,t)}catch{return r&&process.env.NODE_ENV!=="production"&&console.warn(r),e}}function Mi(e,t){if(e=or(e),t=fs(t),e.type.includes("hsl"))e.values[2]+=(100-e.values[2])*t;else if(e.type.includes("rgb"))for(let r=0;r<3;r+=1)e.values[r]+=(255-e.values[r])*t;else if(e.type.includes("color"))for(let r=0;r<3;r+=1)e.values[r]+=(1-e.values[r])*t;return Di(e)}function Ve(e,t,r){try{return Mi(e,t)}catch{return r&&process.env.NODE_ENV!=="production"&&console.warn(r),e}}function _p(e,t=.15){return Wa(e)>.5?Fi(e,t):Mi(e,t)}function si(e,t,r){try{return _p(e,t)}catch{return e}}const xp=ir.createContext(void 0);process.env.NODE_ENV!=="production"&&(Fe.node,Fe.object);function Sp(e){const{theme:t,name:r,props:i}=e;if(!t||!t.components||!t.components[r])return i;const a=t.components[r];return a.defaultProps?Ga(a.defaultProps,i,t.components.mergeClassNameAndStyle):!a.styleOverrides&&!a.variants?Ga(a,i,t.components.mergeClassNameAndStyle):i}function wp({props:e,name:t}){const r=ir.useContext(xp);return Sp({props:e,name:t,theme:{components:r}})}const Pu={theme:void 0};function Ep(e){let t,r;return function(a){let s=t;return(s===void 0||a.theme!==r)&&(Pu.theme=a.theme,s=Bl(e(Pu)),t=s,r=a.theme),s}}function Tp(e=""){function t(...i){if(!i.length)return"";const a=i[0];return typeof a=="string"&&!a.match(/(#|\(|\)|(-?(\d*\.)?\d+)(px|em|%|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc))|^(-?(\d*\.)?\d+)$|(\d+ \d+ \d+)/)?`, var(--${e?`${e}-`:""}${a}${t(...i.slice(1))})`:`, ${a}`}return(i,...a)=>`var(--${e?`${e}-`:""}${i}${t(...a)})`}const Ru=(e,t,r,i=[])=>{let a=e;t.forEach((s,c)=>{c===t.length-1?Array.isArray(a)?a[Number(s)]=r:a&&typeof a=="object"&&(a[s]=r):a&&typeof a=="object"&&(a[s]||(a[s]=i.includes(s)?[]:{}),a=a[s])})},Cp=(e,t,r)=>{function i(a,s=[],c=[]){Object.entries(a).forEach(([d,p])=>{(!r||r&&!r([...s,d]))&&p!=null&&(typeof p=="object"&&Object.keys(p).length>0?i(p,[...s,d],Array.isArray(p)?[...c,d]:c):t([...s,d],p,c))})}i(e)},Op=(e,t)=>typeof t=="number"?["lineHeight","fontWeight","opacity","zIndex"].some(i=>e.includes(i))||e[e.length-1].toLowerCase().includes("opacity")?t:`${t}px`:t;function Fo(e,t){const{prefix:r,shouldSkipGeneratingVar:i}=t||{},a={},s={},c={};return Cp(e,(d,p,m)=>{if((typeof p=="string"||typeof p=="number")&&(!i||!i(d,p))){const x=`--${r?`${r}-`:""}${d.join("-")}`,b=Op(d,p);Object.assign(a,{[x]:b}),Ru(s,d,`var(${x})`,m),Ru(c,d,`var(${x}, ${b})`,m)}},d=>d[0]==="vars"),{css:a,vars:s,varsWithDefaults:c}}function Ap(e,t={}){const{getSelector:r=M,disableCssColorScheme:i,colorSchemeSelector:a,enableContrastVars:s}=t,{colorSchemes:c={},components:d,defaultColorScheme:p="light",...m}=e,{vars:x,css:b,varsWithDefaults:S}=Fo(m,t);let R=S;const P={},{[p]:_,...L}=c;if(Object.entries(L||{}).forEach(([W,A])=>{const{vars:q,css:X,varsWithDefaults:ie}=Fo(A,t);R=Et(R,ie),P[W]={css:X,vars:q}}),_){const{css:W,vars:A,varsWithDefaults:q}=Fo(_,t);R=Et(R,q),P[p]={css:W,vars:A}}function M(W,A){var X,ie;let q=a;if(a==="class"&&(q=".%s"),a==="data"&&(q="[data-%s]"),a!=null&&a.startsWith("data-")&&!a.includes("%s")&&(q=`[${a}="%s"]`),W){if(q==="media")return e.defaultColorScheme===W?":root":{[`@media (prefers-color-scheme: ${((ie=(X=c[W])==null?void 0:X.palette)==null?void 0:ie.mode)||W})`]:{":root":A}};if(q)return e.defaultColorScheme===W?`:root, ${q.replace("%s",String(W))}`:q.replace("%s",String(W))}return":root"}return{vars:R,generateThemeVars:()=>{let W={...x};return Object.entries(P).forEach(([,{vars:A}])=>{W=Et(W,A)}),W},generateStyleSheets:()=>{var ye,Ge;const W=[],A=e.defaultColorScheme||"light";function q(ve,v){Object.keys(v).length&&W.push(typeof ve=="string"?{[ve]:{...v}}:ve)}q(r(void 0,{...b}),b);const{[A]:X,...ie}=P;if(X){const{css:ve}=X,v=(Ge=(ye=c[A])==null?void 0:ye.palette)==null?void 0:Ge.mode,ee=!i&&v?{colorScheme:v,...ve}:{...ve};q(r(A,{...ee}),ee)}return Object.entries(ie).forEach(([ve,{css:v}])=>{var ge,Te;const ee=(Te=(ge=c[ve])==null?void 0:ge.palette)==null?void 0:Te.mode,te=!i&&ee?{colorScheme:ee,...v}:{...v};q(r(ve,{...te}),te)}),s&&W.push({":root":{"--__l-threshold":"0.7","--__l":"clamp(0, (l / var(--__l-threshold) - 1) * -infinity, 1)","--__a":"clamp(0.87, (l / var(--__l-threshold) - 1) * -infinity, 1)"}}),W}}}function jp(e){return function(r){return e==="media"?(process.env.NODE_ENV!=="production"&&r!=="light"&&r!=="dark"&&console.error(`MUI: @media (prefers-color-scheme) supports only 'light' or 'dark', but receive '${r}'.`),`@media (prefers-color-scheme: ${r})`):e?e.startsWith("data-")&&!e.includes("%s")?`[${e}="${r}"] &`:e==="class"?`.${r} &`:e==="data"?`[data-${r}] &`:`${e.replace("%s",r)} &`:"&"}}const Tn={black:"#000",white:"#fff"},$p={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"},Ur={50:"#f3e5f5",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",700:"#7b1fa2"},Gr={300:"#e57373",400:"#ef5350",500:"#f44336",700:"#d32f2f",800:"#c62828"},gn={300:"#ffb74d",400:"#ffa726",500:"#ff9800",700:"#f57c00",900:"#e65100"},Wr={50:"#e3f2fd",200:"#90caf9",400:"#42a5f5",700:"#1976d2",800:"#1565c0"},Yr={300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",700:"#0288d1",900:"#01579b"},Hr={300:"#81c784",400:"#66bb6a",500:"#4caf50",700:"#388e3c",800:"#2e7d32",900:"#1b5e20"};function zl(){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:Tn.white,default:Tn.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 Ul=zl();function Gl(){return{text:{primary:Tn.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:Tn.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 Ya=Gl();function Iu(e,t,r,i){const a=i.light||i,s=i.dark||i*1.5;e[t]||(e.hasOwnProperty(r)?e[t]=e[r]:t==="light"?e.light=Mi(e.main,a):t==="dark"&&(e.dark=Fi(e.main,s)))}function Du(e,t,r,i,a){const s=a.light||a,c=a.dark||a*1.5;t[r]||(t.hasOwnProperty(i)?t[r]=t[i]:r==="light"?t.light=`color-mix(in ${e}, ${t.main}, #fff ${(s*100).toFixed(0)}%)`:r==="dark"&&(t.dark=`color-mix(in ${e}, ${t.main}, #000 ${(c*100).toFixed(0)}%)`))}function kp(e="light"){return e==="dark"?{main:Wr[200],light:Wr[50],dark:Wr[400]}:{main:Wr[700],light:Wr[400],dark:Wr[800]}}function Pp(e="light"){return e==="dark"?{main:Ur[200],light:Ur[50],dark:Ur[400]}:{main:Ur[500],light:Ur[300],dark:Ur[700]}}function Rp(e="light"){return e==="dark"?{main:Gr[500],light:Gr[300],dark:Gr[700]}:{main:Gr[700],light:Gr[400],dark:Gr[800]}}function Ip(e="light"){return e==="dark"?{main:Yr[400],light:Yr[300],dark:Yr[700]}:{main:Yr[700],light:Yr[500],dark:Yr[900]}}function Dp(e="light"){return e==="dark"?{main:Hr[400],light:Hr[300],dark:Hr[700]}:{main:Hr[800],light:Hr[500],dark:Hr[900]}}function Fp(e="light"){return e==="dark"?{main:gn[400],light:gn[300],dark:gn[700]}:{main:"#ed6c02",light:gn[500],dark:gn[900]}}function Mp(e){return`oklch(from ${e} var(--__l) 0 h / var(--__a))`}function ds(e){const{mode:t="light",contrastThreshold:r=3,tonalOffset:i=.2,colorSpace:a,...s}=e,c=e.primary||kp(t),d=e.secondary||Pp(t),p=e.error||Rp(t),m=e.info||Ip(t),x=e.success||Dp(t),b=e.warning||Fp(t);function S(L){if(a)return Mp(L);const M=ku(L,Ya.text.primary)>=r?Ya.text.primary:Ul.text.primary;if(process.env.NODE_ENV!=="production"){const H=ku(L,M);H<3&&console.error([`MUI: The contrast ratio of ${H}:1 for ${M} on ${L}`,"falls below the WCAG recommended absolute minimum contrast ratio of 3:1.","https://www.w3.org/TR/2008/REC-WCAG20-20081211/#visual-audio-contrast-contrast"].join(`
50
+ `))}return M}const R=({color:L,name:M,mainShade:H=500,lightShade:G=300,darkShade:W=700})=>{if(L={...L},!L.main&&L[H]&&(L.main=L[H]),!L.hasOwnProperty("main"))throw new Error(process.env.NODE_ENV!=="production"?`MUI: The color${M?` (${M})`:""} provided to augmentColor(color) is invalid.
51
+ The color object needs to have a \`main\` property or a \`${H}\` property.`:Cr(11,M?` (${M})`:"",H));if(typeof L.main!="string")throw new Error(process.env.NODE_ENV!=="production"?`MUI: The color${M?` (${M})`:""} provided to augmentColor(color) is invalid.
52
+ \`color.main\` should be a string, but \`${JSON.stringify(L.main)}\` was provided instead.
53
53
 
54
54
  Did you intend to use one of the following approaches?
55
55
 
@@ -61,21 +61,35 @@ const theme1 = createTheme({ palette: {
61
61
 
62
62
  const theme2 = createTheme({ palette: {
63
63
  primary: { main: green[500] },
64
- } });`:Tr(12,M?` (${M})`:"",JSON.stringify(q.main)));return a?(Pu(a,q,"light",G,i),Pu(a,q,"dark",X,i)):(Iu(q,"light",G,i),Iu(q,"dark",X,i)),q.contrastText||(q.contrastText=w(q.main)),q};let I;return t==="light"?I=Nl():t==="dark"&&(I=ql()),process.env.NODE_ENV!=="production"&&(I||console.error(`MUI: The palette mode \`${t}\` is not supported.`)),_t({common:{...Sn},mode:t,primary:R({color:c,name:"primary"}),secondary:R({color:d,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:R({color:p,name:"error"}),warning:R({color:_,name:"warning"}),info:R({color:m,name:"info"}),success:R({color:x,name:"success"}),grey:Tp,contrastThreshold:r,getContrastText:w,augmentColor:R,tonalOffset:i,...I},s)}function Ip(e){const t={};return Object.entries(e).forEach(i=>{const[a,s]=i;typeof s=="object"&&(t[a]=`${s.fontStyle?`${s.fontStyle} `:""}${s.fontVariant?`${s.fontVariant} `:""}${s.fontWeight?`${s.fontWeight} `:""}${s.fontStretch?`${s.fontStretch} `:""}${s.fontSize||""}${s.lineHeight?`/${s.lineHeight} `:""}${s.fontFamily||""}`)}),t}function Pp(e,t){return{toolbar:{minHeight:56,[e.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[e.up("sm")]:{minHeight:64}},...t}}function Rp(e){return Math.round(e*1e5)/1e5}const Ru={textTransform:"uppercase"},Du='"Roboto", "Helvetica", "Arial", sans-serif';function Dp(e,t){const{fontFamily:r=Du,fontSize:i=14,fontWeightLight:a=300,fontWeightRegular:s=400,fontWeightMedium:c=500,fontWeightBold:d=700,htmlFontSize:p=16,allVariants:m,pxToRem:x,..._}=typeof t=="function"?t(e):t;process.env.NODE_ENV!=="production"&&(typeof i!="number"&&console.error("MUI: `fontSize` is required to be a number."),typeof p!="number"&&console.error("MUI: `htmlFontSize` is required to be a number."));const w=i/14,R=x||(q=>`${q/p*w}rem`),I=(q,M,W,G,X)=>({fontFamily:r,fontWeight:q,fontSize:R(M),lineHeight:W,...r===Du?{letterSpacing:`${Rp(G/M)}em`}:{},...X,...m}),b={h1:I(a,96,1.167,-1.5),h2:I(a,60,1.2,-.5),h3:I(s,48,1.167,0),h4:I(s,34,1.235,.25),h5:I(s,24,1.334,0),h6:I(c,20,1.6,.15),subtitle1:I(s,16,1.75,.15),subtitle2:I(c,14,1.57,.1),body1:I(s,16,1.5,.15),body2:I(s,14,1.43,.15),button:I(c,14,1.75,.4,Ru),caption:I(s,12,1.66,.4),overline:I(s,12,2.66,1,Ru),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return _t({htmlFontSize:p,pxToRem:R,fontFamily:r,fontSize:i,fontWeightLight:a,fontWeightRegular:s,fontWeightMedium:c,fontWeightBold:d,...b},_,{clone:!1})}const Fp=.2,Mp=.14,Np=.12;function Je(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${Fp})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${Mp})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${Np})`].join(",")}const Bp=["none",Je(0,2,1,-1,0,1,1,0,0,1,3,0),Je(0,3,1,-2,0,2,2,0,0,1,5,0),Je(0,3,3,-2,0,3,4,0,0,1,8,0),Je(0,2,4,-1,0,4,5,0,0,1,10,0),Je(0,3,5,-1,0,5,8,0,0,1,14,0),Je(0,3,5,-1,0,6,10,0,0,1,18,0),Je(0,4,5,-2,0,7,10,1,0,2,16,1),Je(0,5,5,-3,0,8,10,1,0,3,14,2),Je(0,5,6,-3,0,9,12,1,0,3,16,2),Je(0,6,6,-3,0,10,14,1,0,4,18,3),Je(0,6,7,-4,0,11,15,1,0,4,20,3),Je(0,7,8,-4,0,12,17,2,0,5,22,4),Je(0,7,8,-4,0,13,19,2,0,5,24,4),Je(0,7,9,-4,0,14,21,2,0,5,26,4),Je(0,8,9,-5,0,15,22,2,0,6,28,5),Je(0,8,10,-5,0,16,24,2,0,6,30,5),Je(0,8,11,-5,0,17,26,2,0,6,32,5),Je(0,9,11,-5,0,18,28,2,0,7,34,6),Je(0,9,12,-6,0,19,29,2,0,7,36,6),Je(0,10,13,-6,0,20,31,3,0,8,38,7),Je(0,10,13,-6,0,21,33,3,0,8,40,7),Je(0,10,14,-6,0,22,35,3,0,8,42,7),Je(0,11,14,-7,0,23,36,3,0,9,44,8),Je(0,11,15,-7,0,24,38,3,0,9,46,8)],qp={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)"},Lp={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function Fu(e){return`${Math.round(e)}ms`}function Kp(e){if(!e)return 0;const t=e/36;return Math.min(Math.round((4+15*t**.25+t/5)*10),3e3)}function Vp(e){const t={...qp,...e.easing},r={...Lp,...e.duration};return{getAutoHeightDuration:Kp,create:(a=["all"],s={})=>{const{duration:c=r.standard,easing:d=t.easeInOut,delay:p=0,...m}=s;if(process.env.NODE_ENV!=="production"){const x=w=>typeof w=="string",_=w=>!Number.isNaN(parseFloat(w));!x(a)&&!Array.isArray(a)&&console.error('MUI: Argument "props" must be a string or Array.'),!_(c)&&!x(c)&&console.error(`MUI: Argument "duration" must be a number or a string but found ${c}.`),x(d)||console.error('MUI: Argument "easing" must be a string.'),!_(p)&&!x(p)&&console.error('MUI: Argument "delay" must be a number or a string.'),typeof s!="object"&&console.error(["MUI: Secong argument of transition.create must be an object.","Arguments should be either `create('prop1', options)` or `create(['prop1', 'prop2'], options)`"].join(`
65
- `)),Object.keys(m).length!==0&&console.error(`MUI: Unrecognized argument(s) [${Object.keys(m).join(",")}].`)}return(Array.isArray(a)?a:[a]).map(x=>`${x} ${typeof c=="string"?c:Fu(c)} ${d} ${typeof p=="string"?p:Fu(p)}`).join(",")},...e,easing:t,duration:r}}const zp={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function Up(e){return Vt(e)||typeof e>"u"||typeof e=="string"||typeof e=="boolean"||typeof e=="number"||Array.isArray(e)}function Ll(e={}){const t={...e};function r(i){const a=Object.entries(i);for(let s=0;s<a.length;s++){const[c,d]=a[s];!Up(d)||c.startsWith("unstable_")?delete i[c]:Vt(d)&&(i[c]={...d},r(i[c]))}}return r(t),`import { unstable_createBreakpoints as createBreakpoints, createTransitions } from '@mui/material/styles';
64
+ } });`:Cr(12,M?` (${M})`:"",JSON.stringify(L.main)));return a?(Du(a,L,"light",G,i),Du(a,L,"dark",W,i)):(Iu(L,"light",G,i),Iu(L,"dark",W,i)),L.contrastText||(L.contrastText=S(L.main)),L};let P;return t==="light"?P=zl():t==="dark"&&(P=Gl()),process.env.NODE_ENV!=="production"&&(P||console.error(`MUI: The palette mode \`${t}\` is not supported.`)),Et({common:{...Tn},mode:t,primary:R({color:c,name:"primary"}),secondary:R({color:d,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:R({color:p,name:"error"}),warning:R({color:b,name:"warning"}),info:R({color:m,name:"info"}),success:R({color:x,name:"success"}),grey:$p,contrastThreshold:r,getContrastText:S,augmentColor:R,tonalOffset:i,...P},s)}function Np(e){const t={};return Object.entries(e).forEach(i=>{const[a,s]=i;typeof s=="object"&&(t[a]=`${s.fontStyle?`${s.fontStyle} `:""}${s.fontVariant?`${s.fontVariant} `:""}${s.fontWeight?`${s.fontWeight} `:""}${s.fontStretch?`${s.fontStretch} `:""}${s.fontSize||""}${s.lineHeight?`/${s.lineHeight} `:""}${s.fontFamily||""}`)}),t}function Bp(e,t){return{toolbar:{minHeight:56,[e.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[e.up("sm")]:{minHeight:64}},...t}}function qp(e){return Math.round(e*1e5)/1e5}const Fu={textTransform:"uppercase"},Mu='"Roboto", "Helvetica", "Arial", sans-serif';function Lp(e,t){const{fontFamily:r=Mu,fontSize:i=14,fontWeightLight:a=300,fontWeightRegular:s=400,fontWeightMedium:c=500,fontWeightBold:d=700,htmlFontSize:p=16,allVariants:m,pxToRem:x,...b}=typeof t=="function"?t(e):t;process.env.NODE_ENV!=="production"&&(typeof i!="number"&&console.error("MUI: `fontSize` is required to be a number."),typeof p!="number"&&console.error("MUI: `htmlFontSize` is required to be a number."));const S=i/14,R=x||(L=>`${L/p*S}rem`),P=(L,M,H,G,W)=>({fontFamily:r,fontWeight:L,fontSize:R(M),lineHeight:H,...r===Mu?{letterSpacing:`${qp(G/M)}em`}:{},...W,...m}),_={h1:P(a,96,1.167,-1.5),h2:P(a,60,1.2,-.5),h3:P(s,48,1.167,0),h4:P(s,34,1.235,.25),h5:P(s,24,1.334,0),h6:P(c,20,1.6,.15),subtitle1:P(s,16,1.75,.15),subtitle2:P(c,14,1.57,.1),body1:P(s,16,1.5,.15),body2:P(s,14,1.43,.15),button:P(c,14,1.75,.4,Fu),caption:P(s,12,1.66,.4),overline:P(s,12,2.66,1,Fu),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return Et({htmlFontSize:p,pxToRem:R,fontFamily:r,fontSize:i,fontWeightLight:a,fontWeightRegular:s,fontWeightMedium:c,fontWeightBold:d,..._},b,{clone:!1})}const Vp=.2,Kp=.14,zp=.12;function Ze(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${Vp})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${Kp})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${zp})`].join(",")}const Up=["none",Ze(0,2,1,-1,0,1,1,0,0,1,3,0),Ze(0,3,1,-2,0,2,2,0,0,1,5,0),Ze(0,3,3,-2,0,3,4,0,0,1,8,0),Ze(0,2,4,-1,0,4,5,0,0,1,10,0),Ze(0,3,5,-1,0,5,8,0,0,1,14,0),Ze(0,3,5,-1,0,6,10,0,0,1,18,0),Ze(0,4,5,-2,0,7,10,1,0,2,16,1),Ze(0,5,5,-3,0,8,10,1,0,3,14,2),Ze(0,5,6,-3,0,9,12,1,0,3,16,2),Ze(0,6,6,-3,0,10,14,1,0,4,18,3),Ze(0,6,7,-4,0,11,15,1,0,4,20,3),Ze(0,7,8,-4,0,12,17,2,0,5,22,4),Ze(0,7,8,-4,0,13,19,2,0,5,24,4),Ze(0,7,9,-4,0,14,21,2,0,5,26,4),Ze(0,8,9,-5,0,15,22,2,0,6,28,5),Ze(0,8,10,-5,0,16,24,2,0,6,30,5),Ze(0,8,11,-5,0,17,26,2,0,6,32,5),Ze(0,9,11,-5,0,18,28,2,0,7,34,6),Ze(0,9,12,-6,0,19,29,2,0,7,36,6),Ze(0,10,13,-6,0,20,31,3,0,8,38,7),Ze(0,10,13,-6,0,21,33,3,0,8,40,7),Ze(0,10,14,-6,0,22,35,3,0,8,42,7),Ze(0,11,14,-7,0,23,36,3,0,9,44,8),Ze(0,11,15,-7,0,24,38,3,0,9,46,8)],Gp={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)"},Wp={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function Nu(e){return`${Math.round(e)}ms`}function Yp(e){if(!e)return 0;const t=e/36;return Math.min(Math.round((4+15*t**.25+t/5)*10),3e3)}function Hp(e){const t={...Gp,...e.easing},r={...Wp,...e.duration};return{getAutoHeightDuration:Yp,create:(a=["all"],s={})=>{const{duration:c=r.standard,easing:d=t.easeInOut,delay:p=0,...m}=s;if(process.env.NODE_ENV!=="production"){const x=S=>typeof S=="string",b=S=>!Number.isNaN(parseFloat(S));!x(a)&&!Array.isArray(a)&&console.error('MUI: Argument "props" must be a string or Array.'),!b(c)&&!x(c)&&console.error(`MUI: Argument "duration" must be a number or a string but found ${c}.`),x(d)||console.error('MUI: Argument "easing" must be a string.'),!b(p)&&!x(p)&&console.error('MUI: Argument "delay" must be a number or a string.'),typeof s!="object"&&console.error(["MUI: Secong argument of transition.create must be an object.","Arguments should be either `create('prop1', options)` or `create(['prop1', 'prop2'], options)`"].join(`
65
+ `)),Object.keys(m).length!==0&&console.error(`MUI: Unrecognized argument(s) [${Object.keys(m).join(",")}].`)}return(Array.isArray(a)?a:[a]).map(x=>`${x} ${typeof c=="string"?c:Nu(c)} ${d} ${typeof p=="string"?p:Nu(p)}`).join(",")},...e,easing:t,duration:r}}const Jp={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function Xp(e){return Gt(e)||typeof e>"u"||typeof e=="string"||typeof e=="boolean"||typeof e=="number"||Array.isArray(e)}function Wl(e={}){const t={...e};function r(i){const a=Object.entries(i);for(let s=0;s<a.length;s++){const[c,d]=a[s];!Xp(d)||c.startsWith("unstable_")?delete i[c]:Gt(d)&&(i[c]={...d},r(i[c]))}}return r(t),`import { unstable_createBreakpoints as createBreakpoints, createTransitions } from '@mui/material/styles';
66
66
 
67
67
  const theme = ${JSON.stringify(t,null,2)};
68
68
 
69
69
  theme.breakpoints = createBreakpoints(theme.breakpoints || {});
70
70
  theme.transitions = createTransitions(theme.transitions || {});
71
71
 
72
- export default theme;`}function Mu(e){return typeof e=="number"?`${(e*100).toFixed(0)}%`:`calc((${e}) * 100%)`}const Gp=e=>{if(!Number.isNaN(+e))return+e;const t=e.match(/\d*\.?\d+/g);if(!t)return 0;let r=0;for(let i=0;i<t.length;i+=1)r+=+t[i];return r};function Wp(e){Object.assign(e,{alpha(t,r){const i=this||e;return i.colorSpace?`oklch(from ${t} l c h / ${typeof r=="string"?`calc(${r})`:r})`:i.vars?`rgba(${t.replace(/var\(--([^,\s)]+)(?:,[^)]+)?\)+/g,"var(--$1Channel)")} / ${typeof r=="string"?`calc(${r})`:r})`:Ml(t,Gp(r))},lighten(t,r){const i=this||e;return i.colorSpace?`color-mix(in ${i.colorSpace}, ${t}, #fff ${Mu(r)})`:Ri(t,r)},darken(t,r){const i=this||e;return i.colorSpace?`color-mix(in ${i.colorSpace}, ${t}, #000 ${Mu(r)})`:Pi(t,r)}})}function Ga(e={},...t){const{breakpoints:r,mixins:i={},spacing:a,palette:s={},transitions:c={},typography:d={},shape:p,colorSpace:m,...x}=e;if(e.vars&&e.generateThemeVars===void 0)throw new Error(process.env.NODE_ENV!=="production"?"MUI: `vars` is a private field used for CSS variables support.\nPlease use another name or follow the [docs](https://mui.com/material-ui/customization/css-theme-variables/usage/) to enable the feature.":Tr(20));const _=ls({...s,colorSpace:m}),w=$l(e);let R=_t(w,{mixins:Pp(w.breakpoints,i),palette:_,shadows:Bp.slice(),typography:Dp(_,d),transitions:Vp(c),zIndex:{...zp}});if(R=_t(R,x),R=t.reduce((I,b)=>_t(I,b),R),process.env.NODE_ENV!=="production"){const I=["active","checked","completed","disabled","error","expanded","focused","focusVisible","required","selected"],b=(q,M)=>{let W;for(W in q){const G=q[W];if(I.includes(W)&&Object.keys(G).length>0){if(process.env.NODE_ENV!=="production"){const X=us("",W);console.error([`MUI: The \`${M}\` component increases the CSS specificity of the \`${W}\` internal state.`,"You can not override it like this: ",JSON.stringify(q,null,2),"",`Instead, you need to use the '&.${X}' syntax:`,JSON.stringify({root:{[`&.${X}`]:G}},null,2),"","https://mui.com/r/state-classes-guide"].join(`
73
- `))}q[W]={}}}};Object.keys(R.components).forEach(q=>{const M=R.components[q].styleOverrides;M&&q.startsWith("Mui")&&b(M,q)})}return R.unstable_sxConfig={...$i,...x==null?void 0:x.unstable_sxConfig},R.unstable_sx=function(b){return Zr({sx:b,theme:this})},R.toRuntimeSource=Ll,Wp(R),R}function Hp(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 Yp=[...Array(25)].map((e,t)=>{if(t===0)return"none";const r=Hp(t);return`linear-gradient(rgba(255 255 255 / ${r}), rgba(255 255 255 / ${r}))`});function Kl(e){return{inputPlaceholder:e==="dark"?.5:.42,inputUnderline:e==="dark"?.7:.42,switchTrackDisabled:e==="dark"?.2:.12,switchTrack:e==="dark"?.3:.38}}function Vl(e){return e==="dark"?Yp:[]}function Jp(e){const{palette:t={mode:"light"},opacity:r,overlays:i,colorSpace:a,...s}=e,c=ls({...t,colorSpace:a});return{palette:c,opacity:{...Kl(c.mode),...r},overlays:i||Vl(c.mode),...s}}function Xp(e){var t;return!!e[0].match(/(cssVarPrefix|colorSchemeSelector|modularCssLayers|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!e[0].match(/sxConfig$/)||e[0]==="palette"&&!!((t=e[1])!=null&&t.match(/(mode|contrastThreshold|tonalOffset)/))}const Zp=e=>[...[...Array(25)].map((t,r)=>`--${e?`${e}-`:""}overlays-${r}`),`--${e?`${e}-`:""}palette-AppBar-darkBg`,`--${e?`${e}-`:""}palette-AppBar-darkColor`],Qp=e=>(t,r)=>{const i=e.rootSelector||":root",a=e.colorSchemeSelector;let s=a;if(a==="class"&&(s=".%s"),a==="data"&&(s="[data-%s]"),a!=null&&a.startsWith("data-")&&!a.includes("%s")&&(s=`[${a}="%s"]`),e.defaultColorScheme===t){if(t==="dark"){const c={};return Zp(e.cssVarPrefix).forEach(d=>{c[d]=r[d],delete r[d]}),s==="media"?{[i]:r,"@media (prefers-color-scheme: dark)":{[i]:c}}:s?{[s.replace("%s",t)]:c,[`${i}, ${s.replace("%s",t)}`]:r}:{[i]:{...r,...c}}}if(s&&s!=="media")return`${i}, ${s.replace("%s",String(t))}`}else if(t){if(s==="media")return{[`@media (prefers-color-scheme: ${String(t)})`]:{[i]:r}};if(s)return s.replace("%s",String(t))}return i};function em(e,t){t.forEach(r=>{e[r]||(e[r]={})})}function K(e,t,r){!e[t]&&r&&(e[t]=r)}function bn(e){return typeof e!="string"||!e.startsWith("hsl")?e:Fl(e)}function qt(e,t){`${t}Channel`in e||(e[`${t}Channel`]=vn(bn(e[t]),`MUI: Can't create \`palette.${t}Channel\` because \`palette.${t}\` is not one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().
74
- To suppress this warning, you need to explicitly provide the \`palette.${t}Channel\` as a string (in rgb format, for example "12 12 12") or undefined if you want to remove the channel token.`))}function tm(e){return typeof e=="number"?`${e}px`:typeof e=="string"||typeof e=="function"||Array.isArray(e)?e:"8px"}const Pt=e=>{try{return e()}catch{}},rm=(e="mui")=>bp(e);function Ro(e,t,r,i,a){if(!r)return;r=r===!0?{}:r;const s=a==="dark"?"dark":"light";if(!i){t[a]=Jp({...r,palette:{mode:s,...r==null?void 0:r.palette},colorSpace:e});return}const{palette:c,...d}=Ga({...i,palette:{mode:s,...r==null?void 0:r.palette},colorSpace:e});return t[a]={...r,palette:c,opacity:{...Kl(s),...r==null?void 0:r.opacity},overlays:(r==null?void 0:r.overlays)||Vl(s)},d}function nm(e={},...t){const{colorSchemes:r={light:!0},defaultColorScheme:i,disableCssColorScheme:a=!1,cssVarPrefix:s="mui",nativeColor:c=!1,shouldSkipGeneratingVar:d=Xp,colorSchemeSelector:p=r.light&&r.dark?"media":void 0,rootSelector:m=":root",...x}=e,_=Object.keys(r)[0],w=i||(r.light&&_!=="light"?"light":_),R=rm(s),{[w]:I,light:b,dark:q,...M}=r,W={...M};let G=I;if((w==="dark"&&!("dark"in r)||w==="light"&&!("light"in r))&&(G=!0),!G)throw new Error(process.env.NODE_ENV!=="production"?`MUI: The \`colorSchemes.${w}\` option is either missing or invalid.`:Tr(21,w));let X;c&&(X="oklch");const L=Ro(X,W,G,x,w);b&&!W.light&&Ro(X,W,b,void 0,"light"),q&&!W.dark&&Ro(X,W,q,void 0,"dark");let N={defaultColorScheme:w,...L,cssVarPrefix:s,colorSchemeSelector:p,rootSelector:m,getCssVar:R,colorSchemes:W,font:{...Ip(L.typography),...L.font},spacing:tm(x.spacing)};Object.keys(N.colorSchemes).forEach(be=>{const v=N.colorSchemes[be].palette,ee=ge=>{const Ee=ge.split("-"),He=Ee[1],Ue=Ee[2];return R(ge,v[He][Ue])};v.mode==="light"&&(K(v.common,"background","#fff"),K(v.common,"onBackground","#000")),v.mode==="dark"&&(K(v.common,"background","#000"),K(v.common,"onBackground","#fff"));function te(ge,Ee,He){if(X){let Ue;return ge===yr&&(Ue=`transparent ${((1-He)*100).toFixed(0)}%`),ge===Be&&(Ue=`#000 ${(He*100).toFixed(0)}%`),ge===qe&&(Ue=`#fff ${(He*100).toFixed(0)}%`),`color-mix(in ${X}, ${Ee}, ${Ue})`}return ge(Ee,He)}if(em(v,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),v.mode==="light"){K(v.Alert,"errorColor",te(Be,v.error.light,.6)),K(v.Alert,"infoColor",te(Be,v.info.light,.6)),K(v.Alert,"successColor",te(Be,v.success.light,.6)),K(v.Alert,"warningColor",te(Be,v.warning.light,.6)),K(v.Alert,"errorFilledBg",ee("palette-error-main")),K(v.Alert,"infoFilledBg",ee("palette-info-main")),K(v.Alert,"successFilledBg",ee("palette-success-main")),K(v.Alert,"warningFilledBg",ee("palette-warning-main")),K(v.Alert,"errorFilledColor",Pt(()=>v.getContrastText(v.error.main))),K(v.Alert,"infoFilledColor",Pt(()=>v.getContrastText(v.info.main))),K(v.Alert,"successFilledColor",Pt(()=>v.getContrastText(v.success.main))),K(v.Alert,"warningFilledColor",Pt(()=>v.getContrastText(v.warning.main))),K(v.Alert,"errorStandardBg",te(qe,v.error.light,.9)),K(v.Alert,"infoStandardBg",te(qe,v.info.light,.9)),K(v.Alert,"successStandardBg",te(qe,v.success.light,.9)),K(v.Alert,"warningStandardBg",te(qe,v.warning.light,.9)),K(v.Alert,"errorIconColor",ee("palette-error-main")),K(v.Alert,"infoIconColor",ee("palette-info-main")),K(v.Alert,"successIconColor",ee("palette-success-main")),K(v.Alert,"warningIconColor",ee("palette-warning-main")),K(v.AppBar,"defaultBg",ee("palette-grey-100")),K(v.Avatar,"defaultBg",ee("palette-grey-400")),K(v.Button,"inheritContainedBg",ee("palette-grey-300")),K(v.Button,"inheritContainedHoverBg",ee("palette-grey-A100")),K(v.Chip,"defaultBorder",ee("palette-grey-400")),K(v.Chip,"defaultAvatarColor",ee("palette-grey-700")),K(v.Chip,"defaultIconColor",ee("palette-grey-700")),K(v.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),K(v.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),K(v.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),K(v.LinearProgress,"primaryBg",te(qe,v.primary.main,.62)),K(v.LinearProgress,"secondaryBg",te(qe,v.secondary.main,.62)),K(v.LinearProgress,"errorBg",te(qe,v.error.main,.62)),K(v.LinearProgress,"infoBg",te(qe,v.info.main,.62)),K(v.LinearProgress,"successBg",te(qe,v.success.main,.62)),K(v.LinearProgress,"warningBg",te(qe,v.warning.main,.62)),K(v.Skeleton,"bg",X?te(yr,v.text.primary,.11):`rgba(${ee("palette-text-primaryChannel")} / 0.11)`),K(v.Slider,"primaryTrack",te(qe,v.primary.main,.62)),K(v.Slider,"secondaryTrack",te(qe,v.secondary.main,.62)),K(v.Slider,"errorTrack",te(qe,v.error.main,.62)),K(v.Slider,"infoTrack",te(qe,v.info.main,.62)),K(v.Slider,"successTrack",te(qe,v.success.main,.62)),K(v.Slider,"warningTrack",te(qe,v.warning.main,.62));const ge=X?te(Be,v.background.default,.6825):oi(v.background.default,.8);K(v.SnackbarContent,"bg",ge),K(v.SnackbarContent,"color",Pt(()=>X?Ua.text.primary:v.getContrastText(ge))),K(v.SpeedDialAction,"fabHoverBg",oi(v.background.paper,.15)),K(v.StepConnector,"border",ee("palette-grey-400")),K(v.StepContent,"border",ee("palette-grey-400")),K(v.Switch,"defaultColor",ee("palette-common-white")),K(v.Switch,"defaultDisabledColor",ee("palette-grey-100")),K(v.Switch,"primaryDisabledColor",te(qe,v.primary.main,.62)),K(v.Switch,"secondaryDisabledColor",te(qe,v.secondary.main,.62)),K(v.Switch,"errorDisabledColor",te(qe,v.error.main,.62)),K(v.Switch,"infoDisabledColor",te(qe,v.info.main,.62)),K(v.Switch,"successDisabledColor",te(qe,v.success.main,.62)),K(v.Switch,"warningDisabledColor",te(qe,v.warning.main,.62)),K(v.TableCell,"border",te(qe,te(yr,v.divider,1),.88)),K(v.Tooltip,"bg",te(yr,v.grey[700],.92))}if(v.mode==="dark"){K(v.Alert,"errorColor",te(qe,v.error.light,.6)),K(v.Alert,"infoColor",te(qe,v.info.light,.6)),K(v.Alert,"successColor",te(qe,v.success.light,.6)),K(v.Alert,"warningColor",te(qe,v.warning.light,.6)),K(v.Alert,"errorFilledBg",ee("palette-error-dark")),K(v.Alert,"infoFilledBg",ee("palette-info-dark")),K(v.Alert,"successFilledBg",ee("palette-success-dark")),K(v.Alert,"warningFilledBg",ee("palette-warning-dark")),K(v.Alert,"errorFilledColor",Pt(()=>v.getContrastText(v.error.dark))),K(v.Alert,"infoFilledColor",Pt(()=>v.getContrastText(v.info.dark))),K(v.Alert,"successFilledColor",Pt(()=>v.getContrastText(v.success.dark))),K(v.Alert,"warningFilledColor",Pt(()=>v.getContrastText(v.warning.dark))),K(v.Alert,"errorStandardBg",te(Be,v.error.light,.9)),K(v.Alert,"infoStandardBg",te(Be,v.info.light,.9)),K(v.Alert,"successStandardBg",te(Be,v.success.light,.9)),K(v.Alert,"warningStandardBg",te(Be,v.warning.light,.9)),K(v.Alert,"errorIconColor",ee("palette-error-main")),K(v.Alert,"infoIconColor",ee("palette-info-main")),K(v.Alert,"successIconColor",ee("palette-success-main")),K(v.Alert,"warningIconColor",ee("palette-warning-main")),K(v.AppBar,"defaultBg",ee("palette-grey-900")),K(v.AppBar,"darkBg",ee("palette-background-paper")),K(v.AppBar,"darkColor",ee("palette-text-primary")),K(v.Avatar,"defaultBg",ee("palette-grey-600")),K(v.Button,"inheritContainedBg",ee("palette-grey-800")),K(v.Button,"inheritContainedHoverBg",ee("palette-grey-700")),K(v.Chip,"defaultBorder",ee("palette-grey-700")),K(v.Chip,"defaultAvatarColor",ee("palette-grey-300")),K(v.Chip,"defaultIconColor",ee("palette-grey-300")),K(v.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),K(v.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),K(v.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),K(v.LinearProgress,"primaryBg",te(Be,v.primary.main,.5)),K(v.LinearProgress,"secondaryBg",te(Be,v.secondary.main,.5)),K(v.LinearProgress,"errorBg",te(Be,v.error.main,.5)),K(v.LinearProgress,"infoBg",te(Be,v.info.main,.5)),K(v.LinearProgress,"successBg",te(Be,v.success.main,.5)),K(v.LinearProgress,"warningBg",te(Be,v.warning.main,.5)),K(v.Skeleton,"bg",X?te(yr,v.text.primary,.13):`rgba(${ee("palette-text-primaryChannel")} / 0.13)`),K(v.Slider,"primaryTrack",te(Be,v.primary.main,.5)),K(v.Slider,"secondaryTrack",te(Be,v.secondary.main,.5)),K(v.Slider,"errorTrack",te(Be,v.error.main,.5)),K(v.Slider,"infoTrack",te(Be,v.info.main,.5)),K(v.Slider,"successTrack",te(Be,v.success.main,.5)),K(v.Slider,"warningTrack",te(Be,v.warning.main,.5));const ge=X?te(qe,v.background.default,.985):oi(v.background.default,.98);K(v.SnackbarContent,"bg",ge),K(v.SnackbarContent,"color",Pt(()=>X?Bl.text.primary:v.getContrastText(ge))),K(v.SpeedDialAction,"fabHoverBg",oi(v.background.paper,.15)),K(v.StepConnector,"border",ee("palette-grey-600")),K(v.StepContent,"border",ee("palette-grey-600")),K(v.Switch,"defaultColor",ee("palette-grey-300")),K(v.Switch,"defaultDisabledColor",ee("palette-grey-600")),K(v.Switch,"primaryDisabledColor",te(Be,v.primary.main,.55)),K(v.Switch,"secondaryDisabledColor",te(Be,v.secondary.main,.55)),K(v.Switch,"errorDisabledColor",te(Be,v.error.main,.55)),K(v.Switch,"infoDisabledColor",te(Be,v.info.main,.55)),K(v.Switch,"successDisabledColor",te(Be,v.success.main,.55)),K(v.Switch,"warningDisabledColor",te(Be,v.warning.main,.55)),K(v.TableCell,"border",te(Be,te(yr,v.divider,1),.68)),K(v.Tooltip,"bg",te(yr,v.grey[700],.92))}qt(v.background,"default"),qt(v.background,"paper"),qt(v.common,"background"),qt(v.common,"onBackground"),qt(v,"divider"),Object.keys(v).forEach(ge=>{const Ee=v[ge];ge!=="tonalOffset"&&Ee&&typeof Ee=="object"&&(Ee.main&&K(v[ge],"mainChannel",vn(bn(Ee.main))),Ee.light&&K(v[ge],"lightChannel",vn(bn(Ee.light))),Ee.dark&&K(v[ge],"darkChannel",vn(bn(Ee.dark))),Ee.contrastText&&K(v[ge],"contrastTextChannel",vn(bn(Ee.contrastText))),ge==="text"&&(qt(v[ge],"primary"),qt(v[ge],"secondary")),ge==="action"&&(Ee.active&&qt(v[ge],"active"),Ee.selected&&qt(v[ge],"selected")))})}),N=t.reduce((be,v)=>_t(be,v),N);const Z={prefix:s,disableCssColorScheme:a,shouldSkipGeneratingVar:d,getSelector:Qp(N),enableContrastVars:c},{vars:ae,generateThemeVars:ye,generateStyleSheets:We}=wp(N,Z);return N.vars=ae,Object.entries(N.colorSchemes[N.defaultColorScheme]).forEach(([be,v])=>{N[be]=v}),N.generateThemeVars=ye,N.generateStyleSheets=We,N.generateSpacing=function(){return kl(x.spacing,as(this))},N.getColorSchemeSelector=Sp(p),N.spacing=N.generateSpacing(),N.shouldSkipGeneratingVar=d,N.unstable_sxConfig={...$i,...x==null?void 0:x.unstable_sxConfig},N.unstable_sx=function(v){return Zr({sx:v,theme:this})},N.toRuntimeSource=Ll,N}function Nu(e,t,r){e.colorSchemes&&r&&(e.colorSchemes[t]={...r!==!0&&r,palette:ls({...r===!0?{}:r.palette,mode:t})})}function zl(e={},...t){const{palette:r,cssVariables:i=!1,colorSchemes:a=r?void 0:{light:!0},defaultColorScheme:s=r==null?void 0:r.mode,...c}=e,d=s||"light",p=a==null?void 0:a[d],m={...a,...r?{[d]:{...typeof p!="boolean"&&p,palette:r}}:void 0};if(i===!1){if(!("colorSchemes"in e))return Ga(e,...t);let x=r;"palette"in e||m[d]&&(m[d]!==!0?x=m[d].palette:d==="dark"&&(x={mode:"dark"}));const _=Ga({...e,palette:x},...t);return _.defaultColorScheme=d,_.colorSchemes=m,_.palette.mode==="light"&&(_.colorSchemes.light={...m.light!==!0&&m.light,palette:_.palette},Nu(_,"dark",m.dark)),_.palette.mode==="dark"&&(_.colorSchemes.dark={...m.dark!==!0&&m.dark,palette:_.palette},Nu(_,"light",m.light)),_}return!r&&!("light"in m)&&d==="light"&&(m.light=!0),nm({...c,colorSchemes:m,defaultColorScheme:d,...typeof i!="boolean"&&i},...t)}const im=zl(),om="$$material";function am(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const sm=e=>am(e)&&e!=="classes",um=ap({themeId:om,defaultTheme:im,rootShouldForwardProp:sm}),cm=vp;process.env.NODE_ENV!=="production"&&(Fe.node,Fe.object.isRequired);function lm(e){return gp(e)}function fm(e){return us("MuiSvgIcon",e)}tp("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const dm=e=>{const{color:t,fontSize:r,classes:i}=e,a={root:["root",t!=="inherit"&&`color${Er(t)}`,`fontSize${Er(r)}`]};return Gd(a,fm,i)},hm=um("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.color!=="inherit"&&t[`color${Er(r.color)}`],t[`fontSize${Er(r.fontSize)}`]]}})(cm(({theme:e})=>{var t,r,i,a,s,c,d,p,m,x,_,w,R,I;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:(a=(t=e.transitions)==null?void 0:t.create)==null?void 0:a.call(t,"fill",{duration:(i=(r=(e.vars??e).transitions)==null?void 0:r.duration)==null?void 0:i.shorter}),variants:[{props:b=>!b.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:((c=(s=e.typography)==null?void 0:s.pxToRem)==null?void 0:c.call(s,20))||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:((p=(d=e.typography)==null?void 0:d.pxToRem)==null?void 0:p.call(d,24))||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:((x=(m=e.typography)==null?void 0:m.pxToRem)==null?void 0:x.call(m,35))||"2.1875rem"}},...Object.entries((e.vars??e).palette).filter(([,b])=>b&&b.main).map(([b])=>{var q,M;return{props:{color:b},style:{color:(M=(q=(e.vars??e).palette)==null?void 0:q[b])==null?void 0:M.main}}}),{props:{color:"action"},style:{color:(w=(_=(e.vars??e).palette)==null?void 0:_.action)==null?void 0:w.active}},{props:{color:"disabled"},style:{color:(I=(R=(e.vars??e).palette)==null?void 0:R.action)==null?void 0:I.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}})),vi=nr.forwardRef(function(t,r){const i=lm({props:t,name:"MuiSvgIcon"}),{children:a,className:s,color:c="inherit",component:d="svg",fontSize:p="medium",htmlColor:m,inheritViewBox:x=!1,titleAccess:_,viewBox:w="0 0 24 24",...R}=i,I=nr.isValidElement(a)&&a.type==="svg",b={...i,color:c,component:d,fontSize:p,instanceFontSize:t.fontSize,inheritViewBox:x,viewBox:w,hasSvgAsChild:I},q={};x||(q.viewBox=w);const M=dm(b);return k.jsxs(hm,{as:d,className:Cl(M.root,s),focusable:"false",color:m,"aria-hidden":_?void 0:!0,role:_?"img":void 0,ref:r,...q,...R,...I&&a.props,ownerState:b,children:[I?a.props.children:a,_?k.jsx("title",{children:_}):null]})});process.env.NODE_ENV!=="production"&&(vi.propTypes={children:Fe.node,classes:Fe.object,className:Fe.string,color:Fe.oneOfType([Fe.oneOf(["inherit","action","disabled","primary","secondary","error","info","success","warning"]),Fe.string]),component:Fe.elementType,fontSize:Fe.oneOfType([Fe.oneOf(["inherit","large","medium","small"]),Fe.string]),htmlColor:Fe.string,inheritViewBox:Fe.bool,shapeRendering:Fe.string,sx:Fe.oneOfType([Fe.arrayOf(Fe.oneOfType([Fe.func,Fe.object,Fe.bool])),Fe.func,Fe.object]),titleAccess:Fe.string,viewBox:Fe.string});vi.muiName="SvgIcon";function pt(e,t){function r(i,a){return k.jsx(vi,{"data-testid":process.env.NODE_ENV!=="production"?`${t}Icon`:void 0,ref:a,...i,children:e})}return process.env.NODE_ENV!=="production"&&(r.displayName=`${t}Icon`),r.muiName=vi.muiName,nr.memo(nr.forwardRef(r))}const pm=pt(k.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}),"Add"),mm=pt(k.jsx("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20z"}),"ArrowBack"),ym=pt(k.jsx("path",{d:"m7 10 5 5 5-5z"}),"ArrowDropDown"),gm=pt(k.jsx("path",{d:"M7.5 5.6 10 7 8.6 4.5 10 2 7.5 3.4 5 2l1.4 2.5L5 7zm12 9.8L17 14l1.4 2.5L17 19l2.5-1.4L22 19l-1.4-2.5L22 14zM22 2l-2.5 1.4L17 2l1.4 2.5L17 7l2.5-1.4L22 7l-1.4-2.5zm-7.63 5.29a.996.996 0 0 0-1.41 0L1.29 18.96c-.39.39-.39 1.02 0 1.41l2.34 2.34c.39.39 1.02.39 1.41 0L16.7 11.05c.39-.39.39-1.02 0-1.41zm-1.03 5.49-2.12-2.12 2.44-2.44 2.12 2.12z"}),"AutoFixHigh"),vm=pt(k.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close"),bm=pt(k.jsx("path",{d:"M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z"}),"Done"),_m=pt(k.jsx("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"ErrorOutline"),Ul=pt(k.jsx("path",{d:"M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5s-3 1.34-3 3 1.34 3 3 3m-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5 5 6.34 5 8s1.34 3 3 3m0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5m8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5"}),"Group"),Gl=pt(k.jsx("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4m0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4"}),"Person"),xm=pt(k.jsx("path",{d:"M15 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4m-9-2V7H4v3H1v2h3v3h2v-3h3v-2zm9 4c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4"}),"PersonAdd"),wm=pt(k.jsx("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z"}),"Refresh"),Sm=pt([k.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"},"0"),k.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"},"1")],"Schedule"),Tm=pt(k.jsx("path",{d:"M2.01 21 23 12 2.01 3 2 10l15 2-15 2z"}),"Send"),Em=pt(k.jsx("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5M12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"}),"Visibility"),Cm=pt(k.jsx("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7M2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2m4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3z"}),"VisibilityOff"),Om=pt(k.jsx("path",{d:"M22.99 9C19.15 5.16 13.8 3.76 8.84 4.78l2.52 2.52c3.47-.17 6.99 1.05 9.63 3.7zm-4 4c-1.29-1.29-2.84-2.13-4.49-2.56l3.53 3.53zM2 3.05 5.07 6.1C3.6 6.82 2.22 7.78 1 9l1.99 2c1.24-1.24 2.67-2.16 4.2-2.77l2.24 2.24C7.81 10.89 6.27 11.73 5 13v.01L6.99 15c1.36-1.36 3.14-2.04 4.92-2.06L18.98 20l1.27-1.26L3.29 1.79zM9 17l3 3 3-3c-1.65-1.66-4.34-1.66-6 0"}),"WifiOff");function Am(e){const t=new Date(e),i=new Date().getTime()-t.getTime(),a=Math.floor(i/6e4),s=Math.floor(i/36e5),c=Math.floor(i/864e5);return a<1?"now":a<60?`${a}m`:s<24?`${s}h`:c<7?`${c}d`:t.toLocaleDateString(void 0,{month:"short",day:"numeric"})}const Wl=U.memo(({conversation:e,displayName:t,selected:r,onClick:i,currentUser:a})=>{const s=!!e.group,c=e.unread_count,d=(a==null?void 0:a.role)==="admin";return k.jsx(z.ListItem,{disablePadding:!0,children:k.jsxs(z.ListItemButton,{selected:r,onClick:i,sx:{"&.Mui-selected":{backgroundColor:"action.selected","&:hover":{backgroundColor:"action.selected"}}},children:[k.jsx(z.ListItemAvatar,{children:k.jsx(z.Badge,{badgeContent:c,color:"primary",overlap:"circular",invisible:c===0,children:k.jsx(z.Avatar,{sx:{bgcolor:s?"primary.main":"secondary.main"},children:s?k.jsx(Ul,{}):k.jsx(Gl,{})})})}),k.jsx(z.ListItemText,{primary:k.jsxs(z.Box,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[k.jsx(z.Typography,{variant:"subtitle2",noWrap:!0,sx:{fontWeight:c>0?600:400,flex:1},children:t}),k.jsx(z.Typography,{variant:"caption",color:"text.secondary",sx:{ml:1,flexShrink:0},children:Am(e.last_message_at)})]}),secondary:k.jsx(z.Typography,{variant:"body2",color:"text.secondary",noWrap:!0,sx:{fontWeight:c>0?500:400},children:e.message_count===0?d&&s?"View group":"No messages yet":`${e.message_count} message${e.message_count!==1?"s":""}`})})]})})}),Hl=()=>k.jsxs(z.ListItem,{children:[k.jsx(z.ListItemAvatar,{children:k.jsx(z.Skeleton,{variant:"circular",width:40,height:40})}),k.jsx(z.ListItemText,{primary:k.jsxs(z.Box,{display:"flex",justifyContent:"space-between",children:[k.jsx(z.Skeleton,{variant:"text",width:"60%"}),k.jsx(z.Skeleton,{variant:"text",width:"15%"})]}),secondary:k.jsx(z.Skeleton,{variant:"text",width:"80%"})})]});var jm=function(t){return km(t)&&!$m(t)};function km(e){return!!e&&typeof e=="object"}function $m(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||Rm(e)}var Im=typeof Symbol=="function"&&Symbol.for,Pm=Im?Symbol.for("react.element"):60103;function Rm(e){return e.$$typeof===Pm}function Dm(e){return Array.isArray(e)?[]:{}}function bi(e,t){return t.clone!==!1&&t.isMergeableObject(e)?Tn(Dm(e),e,t):e}function Fm(e,t,r){return e.concat(t).map(function(i){return bi(i,r)})}function Mm(e,t,r){var i={};return r.isMergeableObject(e)&&Object.keys(e).forEach(function(a){i[a]=bi(e[a],r)}),Object.keys(t).forEach(function(a){!r.isMergeableObject(t[a])||!e[a]?i[a]=bi(t[a],r):i[a]=Tn(e[a],t[a],r)}),i}function Tn(e,t,r){r=r||{},r.arrayMerge=r.arrayMerge||Fm,r.isMergeableObject=r.isMergeableObject||jm;var i=Array.isArray(t),a=Array.isArray(e),s=i===a;return s?i?r.arrayMerge(e,t,r):Mm(e,t,r):bi(t,r)}Tn.all=function(t,r){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(i,a){return Tn(i,a,r)},{})};var Wa=Tn,Yl=typeof global=="object"&&global&&global.Object===Object&&global,Nm=typeof self=="object"&&self&&self.Object===Object&&self,Ft=Yl||Nm||Function("return this")(),or=Ft.Symbol,Jl=Object.prototype,Bm=Jl.hasOwnProperty,qm=Jl.toString,yn=or?or.toStringTag:void 0;function Lm(e){var t=Bm.call(e,yn),r=e[yn];try{e[yn]=void 0;var i=!0}catch{}var a=qm.call(e);return i&&(t?e[yn]=r:delete e[yn]),a}var Km=Object.prototype,Vm=Km.toString;function zm(e){return Vm.call(e)}var Um="[object Null]",Gm="[object Undefined]",Bu=or?or.toStringTag:void 0;function Or(e){return e==null?e===void 0?Gm:Um:Bu&&Bu in Object(e)?Lm(e):zm(e)}function Xl(e,t){return function(r){return e(t(r))}}var fs=Xl(Object.getPrototypeOf,Object);function Ar(e){return e!=null&&typeof e=="object"}var Wm="[object Object]",Hm=Function.prototype,Ym=Object.prototype,Zl=Hm.toString,Jm=Ym.hasOwnProperty,Xm=Zl.call(Object);function qu(e){if(!Ar(e)||Or(e)!=Wm)return!1;var t=fs(e);if(t===null)return!0;var r=Jm.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&Zl.call(r)==Xm}function Zm(){this.__data__=[],this.size=0}function Ql(e,t){return e===t||e!==e&&t!==t}function Di(e,t){for(var r=e.length;r--;)if(Ql(e[r][0],t))return r;return-1}var Qm=Array.prototype,ey=Qm.splice;function ty(e){var t=this.__data__,r=Di(t,e);if(r<0)return!1;var i=t.length-1;return r==i?t.pop():ey.call(t,r,1),--this.size,!0}function ry(e){var t=this.__data__,r=Di(t,e);return r<0?void 0:t[r][1]}function ny(e){return Di(this.__data__,e)>-1}function iy(e,t){var r=this.__data__,i=Di(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}function Ut(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}Ut.prototype.clear=Zm;Ut.prototype.delete=ty;Ut.prototype.get=ry;Ut.prototype.has=ny;Ut.prototype.set=iy;function oy(){this.__data__=new Ut,this.size=0}function ay(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}function sy(e){return this.__data__.get(e)}function uy(e){return this.__data__.has(e)}function $n(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var cy="[object AsyncFunction]",ly="[object Function]",fy="[object GeneratorFunction]",dy="[object Proxy]";function ef(e){if(!$n(e))return!1;var t=Or(e);return t==ly||t==fy||t==cy||t==dy}var Do=Ft["__core-js_shared__"],Lu=(function(){var e=/[^.]+$/.exec(Do&&Do.keys&&Do.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function hy(e){return!!Lu&&Lu in e}var py=Function.prototype,my=py.toString;function jr(e){if(e!=null){try{return my.call(e)}catch{}try{return e+""}catch{}}return""}var yy=/[\\^$.*+?()[\]{}|]/g,gy=/^\[object .+?Constructor\]$/,vy=Function.prototype,by=Object.prototype,_y=vy.toString,xy=by.hasOwnProperty,wy=RegExp("^"+_y.call(xy).replace(yy,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Sy(e){if(!$n(e)||hy(e))return!1;var t=ef(e)?wy:gy;return t.test(jr(e))}function Ty(e,t){return e==null?void 0:e[t]}function kr(e,t){var r=Ty(e,t);return Sy(r)?r:void 0}var En=kr(Ft,"Map"),Cn=kr(Object,"create");function Ey(){this.__data__=Cn?Cn(null):{},this.size=0}function Cy(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Oy="__lodash_hash_undefined__",Ay=Object.prototype,jy=Ay.hasOwnProperty;function ky(e){var t=this.__data__;if(Cn){var r=t[e];return r===Oy?void 0:r}return jy.call(t,e)?t[e]:void 0}var $y=Object.prototype,Iy=$y.hasOwnProperty;function Py(e){var t=this.__data__;return Cn?t[e]!==void 0:Iy.call(t,e)}var Ry="__lodash_hash_undefined__";function Dy(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Cn&&t===void 0?Ry:t,this}function Cr(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}Cr.prototype.clear=Ey;Cr.prototype.delete=Cy;Cr.prototype.get=ky;Cr.prototype.has=Py;Cr.prototype.set=Dy;function Fy(){this.size=0,this.__data__={hash:new Cr,map:new(En||Ut),string:new Cr}}function My(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Fi(e,t){var r=e.__data__;return My(t)?r[typeof t=="string"?"string":"hash"]:r.map}function Ny(e){var t=Fi(this,e).delete(e);return this.size-=t?1:0,t}function By(e){return Fi(this,e).get(e)}function qy(e){return Fi(this,e).has(e)}function Ly(e,t){var r=Fi(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}function sr(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}sr.prototype.clear=Fy;sr.prototype.delete=Ny;sr.prototype.get=By;sr.prototype.has=qy;sr.prototype.set=Ly;var Ky=200;function Vy(e,t){var r=this.__data__;if(r instanceof Ut){var i=r.__data__;if(!En||i.length<Ky-1)return i.push([e,t]),this.size=++r.size,this;r=this.__data__=new sr(i)}return r.set(e,t),this.size=r.size,this}function tn(e){var t=this.__data__=new Ut(e);this.size=t.size}tn.prototype.clear=oy;tn.prototype.delete=ay;tn.prototype.get=sy;tn.prototype.has=uy;tn.prototype.set=Vy;function zy(e,t){for(var r=-1,i=e==null?0:e.length;++r<i&&t(e[r],r,e)!==!1;);return e}var Ku=(function(){try{var e=kr(Object,"defineProperty");return e({},"",{}),e}catch{}})();function tf(e,t,r){t=="__proto__"&&Ku?Ku(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var Uy=Object.prototype,Gy=Uy.hasOwnProperty;function rf(e,t,r){var i=e[t];(!(Gy.call(e,t)&&Ql(i,r))||r===void 0&&!(t in e))&&tf(e,t,r)}function Mi(e,t,r,i){var a=!r;r||(r={});for(var s=-1,c=t.length;++s<c;){var d=t[s],p=void 0;p===void 0&&(p=e[d]),a?tf(r,d,p):rf(r,d,p)}return r}function Wy(e,t){for(var r=-1,i=Array(e);++r<e;)i[r]=t(r);return i}var Hy="[object Arguments]";function Vu(e){return Ar(e)&&Or(e)==Hy}var nf=Object.prototype,Yy=nf.hasOwnProperty,Jy=nf.propertyIsEnumerable,Xy=Vu((function(){return arguments})())?Vu:function(e){return Ar(e)&&Yy.call(e,"callee")&&!Jy.call(e,"callee")},In=Array.isArray;function Zy(){return!1}var of=typeof exports=="object"&&exports&&!exports.nodeType&&exports,zu=of&&typeof module=="object"&&module&&!module.nodeType&&module,Qy=zu&&zu.exports===of,Uu=Qy?Ft.Buffer:void 0,eg=Uu?Uu.isBuffer:void 0,af=eg||Zy,tg=9007199254740991,rg=/^(?:0|[1-9]\d*)$/;function ng(e,t){var r=typeof e;return t=t??tg,!!t&&(r=="number"||r!="symbol"&&rg.test(e))&&e>-1&&e%1==0&&e<t}var ig=9007199254740991;function sf(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=ig}var og="[object Arguments]",ag="[object Array]",sg="[object Boolean]",ug="[object Date]",cg="[object Error]",lg="[object Function]",fg="[object Map]",dg="[object Number]",hg="[object Object]",pg="[object RegExp]",mg="[object Set]",yg="[object String]",gg="[object WeakMap]",vg="[object ArrayBuffer]",bg="[object DataView]",_g="[object Float32Array]",xg="[object Float64Array]",wg="[object Int8Array]",Sg="[object Int16Array]",Tg="[object Int32Array]",Eg="[object Uint8Array]",Cg="[object Uint8ClampedArray]",Og="[object Uint16Array]",Ag="[object Uint32Array]",Ge={};Ge[_g]=Ge[xg]=Ge[wg]=Ge[Sg]=Ge[Tg]=Ge[Eg]=Ge[Cg]=Ge[Og]=Ge[Ag]=!0;Ge[og]=Ge[ag]=Ge[vg]=Ge[sg]=Ge[bg]=Ge[ug]=Ge[cg]=Ge[lg]=Ge[fg]=Ge[dg]=Ge[hg]=Ge[pg]=Ge[mg]=Ge[yg]=Ge[gg]=!1;function jg(e){return Ar(e)&&sf(e.length)&&!!Ge[Or(e)]}function ds(e){return function(t){return e(t)}}var uf=typeof exports=="object"&&exports&&!exports.nodeType&&exports,xn=uf&&typeof module=="object"&&module&&!module.nodeType&&module,kg=xn&&xn.exports===uf,Fo=kg&&Yl.process,Qr=(function(){try{var e=xn&&xn.require&&xn.require("util").types;return e||Fo&&Fo.binding&&Fo.binding("util")}catch{}})(),Gu=Qr&&Qr.isTypedArray,$g=Gu?ds(Gu):jg,Ig=Object.prototype,Pg=Ig.hasOwnProperty;function cf(e,t){var r=In(e),i=!r&&Xy(e),a=!r&&!i&&af(e),s=!r&&!i&&!a&&$g(e),c=r||i||a||s,d=c?Wy(e.length,String):[],p=d.length;for(var m in e)(t||Pg.call(e,m))&&!(c&&(m=="length"||a&&(m=="offset"||m=="parent")||s&&(m=="buffer"||m=="byteLength"||m=="byteOffset")||ng(m,p)))&&d.push(m);return d}var Rg=Object.prototype;function hs(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||Rg;return e===r}var Dg=Xl(Object.keys,Object),Fg=Object.prototype,Mg=Fg.hasOwnProperty;function Ng(e){if(!hs(e))return Dg(e);var t=[];for(var r in Object(e))Mg.call(e,r)&&r!="constructor"&&t.push(r);return t}function lf(e){return e!=null&&sf(e.length)&&!ef(e)}function ps(e){return lf(e)?cf(e):Ng(e)}function Bg(e,t){return e&&Mi(t,ps(t),e)}function qg(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}var Lg=Object.prototype,Kg=Lg.hasOwnProperty;function Vg(e){if(!$n(e))return qg(e);var t=hs(e),r=[];for(var i in e)i=="constructor"&&(t||!Kg.call(e,i))||r.push(i);return r}function ms(e){return lf(e)?cf(e,!0):Vg(e)}function zg(e,t){return e&&Mi(t,ms(t),e)}var ff=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Wu=ff&&typeof module=="object"&&module&&!module.nodeType&&module,Ug=Wu&&Wu.exports===ff,Hu=Ug?Ft.Buffer:void 0,Yu=Hu?Hu.allocUnsafe:void 0;function Gg(e,t){if(t)return e.slice();var r=e.length,i=Yu?Yu(r):new e.constructor(r);return e.copy(i),i}function df(e,t){var r=-1,i=e.length;for(t||(t=Array(i));++r<i;)t[r]=e[r];return t}function Wg(e,t){for(var r=-1,i=e==null?0:e.length,a=0,s=[];++r<i;){var c=e[r];t(c,r,e)&&(s[a++]=c)}return s}function hf(){return[]}var Hg=Object.prototype,Yg=Hg.propertyIsEnumerable,Ju=Object.getOwnPropertySymbols,ys=Ju?function(e){return e==null?[]:(e=Object(e),Wg(Ju(e),function(t){return Yg.call(e,t)}))}:hf;function Jg(e,t){return Mi(e,ys(e),t)}function pf(e,t){for(var r=-1,i=t.length,a=e.length;++r<i;)e[a+r]=t[r];return e}var Xg=Object.getOwnPropertySymbols,mf=Xg?function(e){for(var t=[];e;)pf(t,ys(e)),e=fs(e);return t}:hf;function Zg(e,t){return Mi(e,mf(e),t)}function yf(e,t,r){var i=t(e);return In(e)?i:pf(i,r(e))}function Qg(e){return yf(e,ps,ys)}function ev(e){return yf(e,ms,mf)}var Ha=kr(Ft,"DataView"),Ya=kr(Ft,"Promise"),Ja=kr(Ft,"Set"),Xa=kr(Ft,"WeakMap"),Xu="[object Map]",tv="[object Object]",Zu="[object Promise]",Qu="[object Set]",ec="[object WeakMap]",tc="[object DataView]",rv=jr(Ha),nv=jr(En),iv=jr(Ya),ov=jr(Ja),av=jr(Xa),Kt=Or;(Ha&&Kt(new Ha(new ArrayBuffer(1)))!=tc||En&&Kt(new En)!=Xu||Ya&&Kt(Ya.resolve())!=Zu||Ja&&Kt(new Ja)!=Qu||Xa&&Kt(new Xa)!=ec)&&(Kt=function(e){var t=Or(e),r=t==tv?e.constructor:void 0,i=r?jr(r):"";if(i)switch(i){case rv:return tc;case nv:return Xu;case iv:return Zu;case ov:return Qu;case av:return ec}return t});var sv=Object.prototype,uv=sv.hasOwnProperty;function cv(e){var t=e.length,r=new e.constructor(t);return t&&typeof e[0]=="string"&&uv.call(e,"index")&&(r.index=e.index,r.input=e.input),r}var rc=Ft.Uint8Array;function gs(e){var t=new e.constructor(e.byteLength);return new rc(t).set(new rc(e)),t}function lv(e,t){var r=t?gs(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}var fv=/\w*$/;function dv(e){var t=new e.constructor(e.source,fv.exec(e));return t.lastIndex=e.lastIndex,t}var nc=or?or.prototype:void 0,ic=nc?nc.valueOf:void 0;function hv(e){return ic?Object(ic.call(e)):{}}function pv(e,t){var r=t?gs(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var mv="[object Boolean]",yv="[object Date]",gv="[object Map]",vv="[object Number]",bv="[object RegExp]",_v="[object Set]",xv="[object String]",wv="[object Symbol]",Sv="[object ArrayBuffer]",Tv="[object DataView]",Ev="[object Float32Array]",Cv="[object Float64Array]",Ov="[object Int8Array]",Av="[object Int16Array]",jv="[object Int32Array]",kv="[object Uint8Array]",$v="[object Uint8ClampedArray]",Iv="[object Uint16Array]",Pv="[object Uint32Array]";function Rv(e,t,r){var i=e.constructor;switch(t){case Sv:return gs(e);case mv:case yv:return new i(+e);case Tv:return lv(e,r);case Ev:case Cv:case Ov:case Av:case jv:case kv:case $v:case Iv:case Pv:return pv(e,r);case gv:return new i;case vv:case xv:return new i(e);case bv:return dv(e);case _v:return new i;case wv:return hv(e)}}var oc=Object.create,Dv=(function(){function e(){}return function(t){if(!$n(t))return{};if(oc)return oc(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}})();function Fv(e){return typeof e.constructor=="function"&&!hs(e)?Dv(fs(e)):{}}var Mv="[object Map]";function Nv(e){return Ar(e)&&Kt(e)==Mv}var ac=Qr&&Qr.isMap,Bv=ac?ds(ac):Nv,qv="[object Set]";function Lv(e){return Ar(e)&&Kt(e)==qv}var sc=Qr&&Qr.isSet,Kv=sc?ds(sc):Lv,Vv=1,zv=2,Uv=4,gf="[object Arguments]",Gv="[object Array]",Wv="[object Boolean]",Hv="[object Date]",Yv="[object Error]",vf="[object Function]",Jv="[object GeneratorFunction]",Xv="[object Map]",Zv="[object Number]",bf="[object Object]",Qv="[object RegExp]",eb="[object Set]",tb="[object String]",rb="[object Symbol]",nb="[object WeakMap]",ib="[object ArrayBuffer]",ob="[object DataView]",ab="[object Float32Array]",sb="[object Float64Array]",ub="[object Int8Array]",cb="[object Int16Array]",lb="[object Int32Array]",fb="[object Uint8Array]",db="[object Uint8ClampedArray]",hb="[object Uint16Array]",pb="[object Uint32Array]",ze={};ze[gf]=ze[Gv]=ze[ib]=ze[ob]=ze[Wv]=ze[Hv]=ze[ab]=ze[sb]=ze[ub]=ze[cb]=ze[lb]=ze[Xv]=ze[Zv]=ze[bf]=ze[Qv]=ze[eb]=ze[tb]=ze[rb]=ze[fb]=ze[db]=ze[hb]=ze[pb]=!0;ze[Yv]=ze[vf]=ze[nb]=!1;function wn(e,t,r,i,a,s){var c,d=t&Vv,p=t&zv,m=t&Uv;if(c!==void 0)return c;if(!$n(e))return e;var x=In(e);if(x){if(c=cv(e),!d)return df(e,c)}else{var _=Kt(e),w=_==vf||_==Jv;if(af(e))return Gg(e,d);if(_==bf||_==gf||w&&!a){if(c=p||w?{}:Fv(e),!d)return p?Zg(e,zg(c,e)):Jg(e,Bg(c,e))}else{if(!ze[_])return a?e:{};c=Rv(e,_,d)}}s||(s=new tn);var R=s.get(e);if(R)return R;s.set(e,c),Kv(e)?e.forEach(function(q){c.add(wn(q,t,r,q,e,s))}):Bv(e)&&e.forEach(function(q,M){c.set(M,wn(q,t,r,M,e,s))});var I=m?p?ev:Qg:p?ms:ps,b=x?void 0:I(e);return zy(b||e,function(q,M){b&&(M=q,q=e[M]),rf(c,M,wn(q,t,r,M,e,s))}),c}var mb=1,yb=4;function ai(e){return wn(e,mb|yb)}var Mo,uc;function gb(){if(uc)return Mo;uc=1;var e=Array.isArray,t=Object.keys,r=Object.prototype.hasOwnProperty,i=typeof Element<"u";function a(s,c){if(s===c)return!0;if(s&&c&&typeof s=="object"&&typeof c=="object"){var d=e(s),p=e(c),m,x,_;if(d&&p){if(x=s.length,x!=c.length)return!1;for(m=x;m--!==0;)if(!a(s[m],c[m]))return!1;return!0}if(d!=p)return!1;var w=s instanceof Date,R=c instanceof Date;if(w!=R)return!1;if(w&&R)return s.getTime()==c.getTime();var I=s instanceof RegExp,b=c instanceof RegExp;if(I!=b)return!1;if(I&&b)return s.toString()==c.toString();var q=t(s);if(x=q.length,x!==t(c).length)return!1;for(m=x;m--!==0;)if(!r.call(c,q[m]))return!1;if(i&&s instanceof Element&&c instanceof Element)return s===c;for(m=x;m--!==0;)if(_=q[m],!(_==="_owner"&&s.$$typeof)&&!a(s[_],c[_]))return!1;return!0}return s!==s&&c!==c}return Mo=function(c,d){try{return a(c,d)}catch(p){if(p.message&&p.message.match(/stack|recursion/i)||p.number===-2146828260)return console.warn("Warning: react-fast-compare does not handle circular references.",p.name,p.message),!1;throw p}},Mo}var vb=gb();const vr=An(vb);var bb=process.env.NODE_ENV==="production";function Yr(e,t){if(!bb){var r="Warning: "+t;typeof console<"u"&&console.warn(r);try{throw Error(r)}catch{}}}var _b=4;function cc(e){return wn(e,_b)}function _f(e,t){for(var r=-1,i=e==null?0:e.length,a=Array(i);++r<i;)a[r]=t(e[r],r,e);return a}var xb="[object Symbol]";function vs(e){return typeof e=="symbol"||Ar(e)&&Or(e)==xb}var wb="Expected a function";function bs(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(wb);var r=function(){var i=arguments,a=t?t.apply(this,i):i[0],s=r.cache;if(s.has(a))return s.get(a);var c=e.apply(this,i);return r.cache=s.set(a,c)||s,c};return r.cache=new(bs.Cache||sr),r}bs.Cache=sr;var Sb=500;function Tb(e){var t=bs(e,function(i){return r.size===Sb&&r.clear(),i}),r=t.cache;return t}var Eb=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Cb=/\\(\\)?/g,Ob=Tb(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Eb,function(r,i,a,s){t.push(a?s.replace(Cb,"$1"):i||r)}),t});function Ab(e){if(typeof e=="string"||vs(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var lc=or?or.prototype:void 0,fc=lc?lc.toString:void 0;function xf(e){if(typeof e=="string")return e;if(In(e))return _f(e,xf)+"";if(vs(e))return fc?fc.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function jb(e){return e==null?"":xf(e)}function wf(e){return In(e)?_f(e,Ab):vs(e)?[e]:df(Ob(jb(e)))}var No,dc;function kb(){if(dc)return No;dc=1;var e=is(),t={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},r={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},i={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};s[e.ForwardRef]=i,s[e.Memo]=a;function c(I){return e.isMemo(I)?a:s[I.$$typeof]||t}var d=Object.defineProperty,p=Object.getOwnPropertyNames,m=Object.getOwnPropertySymbols,x=Object.getOwnPropertyDescriptor,_=Object.getPrototypeOf,w=Object.prototype;function R(I,b,q){if(typeof b!="string"){if(w){var M=_(b);M&&M!==w&&R(I,M,q)}var W=p(b);m&&(W=W.concat(m(b)));for(var G=c(I),X=c(b),L=0;L<W.length;++L){var N=W[L];if(!r[N]&&!(q&&q[N])&&!(X&&X[N])&&!(G&&G[N])){var Z=x(b,N);try{d(I,N,Z)}catch{}}}}return I}return No=R,No}kb();function lt(){return lt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},lt.apply(this,arguments)}function Sf(e,t){if(e==null)return{};var r={},i=Object.keys(e),a,s;for(s=0;s<i.length;s++)a=i[s],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}var Ni=U.createContext(void 0);Ni.displayName="FormikContext";Ni.Provider;Ni.Consumer;function $b(){var e=U.useContext(Ni);return e||(process.env.NODE_ENV!=="production"?Yr(!1,"Formik context is undefined, please verify you are calling useFormikContext() as child of a <Formik> component."):Yr()),e}var Et=function(t){return typeof t=="function"},Bi=function(t){return t!==null&&typeof t=="object"},Ib=function(t){return String(Math.floor(Number(t)))===t},Bo=function(t){return Object.prototype.toString.call(t)==="[object String]"},qo=function(t){return Bi(t)&&Et(t.then)};function Pb(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}}function gt(e,t,r,i){i===void 0&&(i=0);for(var a=wf(t);e&&i<a.length;)e=e[a[i++]];return i!==a.length&&!e||e===void 0?r:e}function wr(e,t,r){for(var i=cc(e),a=i,s=0,c=wf(t);s<c.length-1;s++){var d=c[s],p=gt(e,c.slice(0,s+1));if(p&&(Bi(p)||Array.isArray(p)))a=a[d]=cc(p);else{var m=c[s+1];a=a[d]=Ib(m)&&Number(m)>=0?[]:{}}}return(s===0?e:a)[c[s]]===r?e:(r===void 0?delete a[c[s]]:a[c[s]]=r,s===0&&r===void 0&&delete i[c[s]],i)}function Tf(e,t,r,i){r===void 0&&(r=new WeakMap),i===void 0&&(i={});for(var a=0,s=Object.keys(e);a<s.length;a++){var c=s[a],d=e[c];Bi(d)?r.get(d)||(r.set(d,!0),i[c]=Array.isArray(d)?[]:{},Tf(d,t,r,i[c])):i[c]=t}return i}function Rb(e,t){switch(t.type){case"SET_VALUES":return lt({},e,{values:t.payload});case"SET_TOUCHED":return lt({},e,{touched:t.payload});case"SET_ERRORS":return vr(e.errors,t.payload)?e:lt({},e,{errors:t.payload});case"SET_STATUS":return lt({},e,{status:t.payload});case"SET_ISSUBMITTING":return lt({},e,{isSubmitting:t.payload});case"SET_ISVALIDATING":return lt({},e,{isValidating:t.payload});case"SET_FIELD_VALUE":return lt({},e,{values:wr(e.values,t.payload.field,t.payload.value)});case"SET_FIELD_TOUCHED":return lt({},e,{touched:wr(e.touched,t.payload.field,t.payload.value)});case"SET_FIELD_ERROR":return lt({},e,{errors:wr(e.errors,t.payload.field,t.payload.value)});case"RESET_FORM":return lt({},e,t.payload);case"SET_FORMIK_STATE":return t.payload(e);case"SUBMIT_ATTEMPT":return lt({},e,{touched:Tf(e.values,!0),isSubmitting:!0,submitCount:e.submitCount+1});case"SUBMIT_FAILURE":return lt({},e,{isSubmitting:!1});case"SUBMIT_SUCCESS":return lt({},e,{isSubmitting:!1});default:return e}}var gr={},si={};function Db(e){var t=e.validateOnChange,r=t===void 0?!0:t,i=e.validateOnBlur,a=i===void 0?!0:i,s=e.validateOnMount,c=s===void 0?!1:s,d=e.isInitialValid,p=e.enableReinitialize,m=p===void 0?!1:p,x=e.onSubmit,_=Sf(e,["validateOnChange","validateOnBlur","validateOnMount","isInitialValid","enableReinitialize","onSubmit"]),w=lt({validateOnChange:r,validateOnBlur:a,validateOnMount:c,onSubmit:x},_),R=U.useRef(w.initialValues),I=U.useRef(w.initialErrors||gr),b=U.useRef(w.initialTouched||si),q=U.useRef(w.initialStatus),M=U.useRef(!1),W=U.useRef({});process.env.NODE_ENV!=="production"&&U.useEffect(function(){typeof d>"u"||(process.env.NODE_ENV!=="production"?Yr(!1,"isInitialValid has been deprecated and will be removed in future versions of Formik. Please use initialErrors or validateOnMount instead."):Yr())},[]),U.useEffect(function(){return M.current=!0,function(){M.current=!1}},[]);var G=U.useState(0),X=G[1],L=U.useRef({values:ai(w.initialValues),errors:ai(w.initialErrors)||gr,touched:ai(w.initialTouched)||si,status:ai(w.initialStatus),isSubmitting:!1,isValidating:!1,submitCount:0}),N=L.current,Z=U.useCallback(function(B){var se=L.current;L.current=Rb(se,B),se!==L.current&&X(function(he){return he+1})},[]),ae=U.useCallback(function(B,se){return new Promise(function(he,pe){var ve=w.validate(B,se);ve==null?he(gr):qo(ve)?ve.then(function(je){he(je||gr)},function(je){process.env.NODE_ENV!=="production"&&console.warn("Warning: An unhandled error was caught during validation in <Formik validate />",je),pe(je)}):he(ve)})},[w.validate]),ye=U.useCallback(function(B,se){var he=w.validationSchema,pe=Et(he)?he(se):he,ve=se&&pe.validateAt?pe.validateAt(se,B):Mb(B,pe);return new Promise(function(je,Ze){ve.then(function(){je(gr)},function(dt){dt.name==="ValidationError"?je(Fb(dt)):(process.env.NODE_ENV!=="production"&&console.warn("Warning: An unhandled error was caught during validation in <Formik validationSchema />",dt),Ze(dt))})})},[w.validationSchema]),We=U.useCallback(function(B,se){return new Promise(function(he){return he(W.current[B].validate(se))})},[]),be=U.useCallback(function(B){var se=Object.keys(W.current).filter(function(pe){return Et(W.current[pe].validate)}),he=se.length>0?se.map(function(pe){return We(pe,gt(B,pe))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(he).then(function(pe){return pe.reduce(function(ve,je,Ze){return je==="DO_NOT_DELETE_YOU_WILL_BE_FIRED"||je&&(ve=wr(ve,se[Ze],je)),ve},{})})},[We]),v=U.useCallback(function(B){return Promise.all([be(B),w.validationSchema?ye(B):{},w.validate?ae(B):{}]).then(function(se){var he=se[0],pe=se[1],ve=se[2],je=Wa.all([he,pe,ve],{arrayMerge:Nb});return je})},[w.validate,w.validationSchema,be,ae,ye]),ee=Tt(function(B){return B===void 0&&(B=N.values),Z({type:"SET_ISVALIDATING",payload:!0}),v(B).then(function(se){return M.current&&(Z({type:"SET_ISVALIDATING",payload:!1}),Z({type:"SET_ERRORS",payload:se})),se})});U.useEffect(function(){c&&M.current===!0&&vr(R.current,w.initialValues)&&ee(R.current)},[c,ee]);var te=U.useCallback(function(B){var se=B&&B.values?B.values:R.current,he=B&&B.errors?B.errors:I.current?I.current:w.initialErrors||{},pe=B&&B.touched?B.touched:b.current?b.current:w.initialTouched||{},ve=B&&B.status?B.status:q.current?q.current:w.initialStatus;R.current=se,I.current=he,b.current=pe,q.current=ve;var je=function(){Z({type:"RESET_FORM",payload:{isSubmitting:!!B&&!!B.isSubmitting,errors:he,touched:pe,status:ve,values:se,isValidating:!!B&&!!B.isValidating,submitCount:B&&B.submitCount&&typeof B.submitCount=="number"?B.submitCount:0}})};if(w.onReset){var Ze=w.onReset(N.values,st);qo(Ze)?Ze.then(je):je()}else je()},[w.initialErrors,w.initialStatus,w.initialTouched,w.onReset]);U.useEffect(function(){M.current===!0&&!vr(R.current,w.initialValues)&&m&&(R.current=w.initialValues,te(),c&&ee(R.current))},[m,w.initialValues,te,c,ee]),U.useEffect(function(){m&&M.current===!0&&!vr(I.current,w.initialErrors)&&(I.current=w.initialErrors||gr,Z({type:"SET_ERRORS",payload:w.initialErrors||gr}))},[m,w.initialErrors]),U.useEffect(function(){m&&M.current===!0&&!vr(b.current,w.initialTouched)&&(b.current=w.initialTouched||si,Z({type:"SET_TOUCHED",payload:w.initialTouched||si}))},[m,w.initialTouched]),U.useEffect(function(){m&&M.current===!0&&!vr(q.current,w.initialStatus)&&(q.current=w.initialStatus,Z({type:"SET_STATUS",payload:w.initialStatus}))},[m,w.initialStatus,w.initialTouched]);var ge=Tt(function(B){if(W.current[B]&&Et(W.current[B].validate)){var se=gt(N.values,B),he=W.current[B].validate(se);return qo(he)?(Z({type:"SET_ISVALIDATING",payload:!0}),he.then(function(pe){return pe}).then(function(pe){Z({type:"SET_FIELD_ERROR",payload:{field:B,value:pe}}),Z({type:"SET_ISVALIDATING",payload:!1})})):(Z({type:"SET_FIELD_ERROR",payload:{field:B,value:he}}),Promise.resolve(he))}else if(w.validationSchema)return Z({type:"SET_ISVALIDATING",payload:!0}),ye(N.values,B).then(function(pe){return pe}).then(function(pe){Z({type:"SET_FIELD_ERROR",payload:{field:B,value:gt(pe,B)}}),Z({type:"SET_ISVALIDATING",payload:!1})});return Promise.resolve()}),Ee=U.useCallback(function(B,se){var he=se.validate;W.current[B]={validate:he}},[]),He=U.useCallback(function(B){delete W.current[B]},[]),Ue=Tt(function(B,se){Z({type:"SET_TOUCHED",payload:B});var he=se===void 0?a:se;return he?ee(N.values):Promise.resolve()}),ft=U.useCallback(function(B){Z({type:"SET_ERRORS",payload:B})},[]),H=Tt(function(B,se){var he=Et(B)?B(N.values):B;Z({type:"SET_VALUES",payload:he});var pe=se===void 0?r:se;return pe?ee(he):Promise.resolve()}),le=U.useCallback(function(B,se){Z({type:"SET_FIELD_ERROR",payload:{field:B,value:se}})},[]),_e=Tt(function(B,se,he){var pe=Et(se)?se(gt(N.values,B)):se;Z({type:"SET_FIELD_VALUE",payload:{field:B,value:pe}});var ve=he===void 0?r:he;return ve?ee(wr(N.values,B,pe)):Promise.resolve()}),Oe=U.useCallback(function(B,se){var he=se,pe=B,ve;if(!Bo(B)){B.persist&&B.persist();var je=B.target?B.target:B.currentTarget,Ze=je.type,dt=je.name,ur=je.id,Wt=je.value,Mt=je.checked,Ir=je.outerHTML,Pr=je.options,kt=je.multiple;he=se||dt||ur,!he&&process.env.NODE_ENV!=="production"&&hc({htmlContent:Ir,documentationAnchorLink:"handlechange-e-reactchangeeventany--void",handlerName:"handleChange"}),pe=/number|range/.test(Ze)?(ve=parseFloat(Wt),isNaN(ve)?"":ve):/checkbox/.test(Ze)?qb(gt(N.values,he),Mt,Wt):Pr&&kt?Bb(Pr):Wt}he&&_e(he,pe)},[_e,N.values]),we=Tt(function(B){if(Bo(B))return function(se){return Oe(se,B)};Oe(B)}),Ce=Tt(function(B,se,he){se===void 0&&(se=!0),Z({type:"SET_FIELD_TOUCHED",payload:{field:B,value:se}});var pe=he===void 0?a:he;return pe?ee(N.values):Promise.resolve()}),Te=U.useCallback(function(B,se){B.persist&&B.persist();var he=B.target,pe=he.name,ve=he.id,je=he.outerHTML,Ze=se||pe||ve;!Ze&&process.env.NODE_ENV!=="production"&&hc({htmlContent:je,documentationAnchorLink:"handleblur-e-any--void",handlerName:"handleBlur"}),Ce(Ze,!0)},[Ce]),Se=Tt(function(B){if(Bo(B))return function(se){return Te(se,B)};Te(B)}),Ae=U.useCallback(function(B){Et(B)?Z({type:"SET_FORMIK_STATE",payload:B}):Z({type:"SET_FORMIK_STATE",payload:function(){return B}})},[]),Ie=U.useCallback(function(B){Z({type:"SET_STATUS",payload:B})},[]),re=U.useCallback(function(B){Z({type:"SET_ISSUBMITTING",payload:B})},[]),rt=Tt(function(){return Z({type:"SUBMIT_ATTEMPT"}),ee().then(function(B){var se=B instanceof Error,he=!se&&Object.keys(B).length===0;if(he){var pe;try{if(pe=Gt(),pe===void 0)return}catch(ve){throw ve}return Promise.resolve(pe).then(function(ve){return M.current&&Z({type:"SUBMIT_SUCCESS"}),ve}).catch(function(ve){if(M.current)throw Z({type:"SUBMIT_FAILURE"}),ve})}else if(M.current&&(Z({type:"SUBMIT_FAILURE"}),se))throw B})}),Y=Tt(function(B){if(B&&B.preventDefault&&Et(B.preventDefault)&&B.preventDefault(),B&&B.stopPropagation&&Et(B.stopPropagation)&&B.stopPropagation(),process.env.NODE_ENV!=="production"&&typeof document<"u"){var se=Pb();se!==null&&se instanceof HTMLButtonElement&&(se.attributes&&se.attributes.getNamedItem("type")||(process.env.NODE_ENV!=="production"?Yr(!1,'You submitted a Formik form using a button with an unspecified `type` attribute. Most browsers default button elements to `type="submit"`. If this is not a submit button, please add `type="button"`.'):Yr()))}rt().catch(function(he){console.warn("Warning: An unhandled error was caught from submitForm()",he)})}),st={resetForm:te,validateForm:ee,validateField:ge,setErrors:ft,setFieldError:le,setFieldTouched:Ce,setFieldValue:_e,setStatus:Ie,setSubmitting:re,setTouched:Ue,setValues:H,setFormikState:Ae,submitForm:rt},Gt=Tt(function(){return x(N.values,st)}),xt=Tt(function(B){B&&B.preventDefault&&Et(B.preventDefault)&&B.preventDefault(),B&&B.stopPropagation&&Et(B.stopPropagation)&&B.stopPropagation(),te()}),zi=U.useCallback(function(B){return{value:gt(N.values,B),error:gt(N.errors,B),touched:!!gt(N.touched,B),initialValue:gt(R.current,B),initialTouched:!!gt(b.current,B),initialError:gt(I.current,B)}},[N.errors,N.touched,N.values]),Ui=U.useCallback(function(B){return{setValue:function(he,pe){return _e(B,he,pe)},setTouched:function(he,pe){return Ce(B,he,pe)},setError:function(he){return le(B,he)}}},[_e,Ce,le]),Gi=U.useCallback(function(B){var se=Bi(B),he=se?B.name:B,pe=gt(N.values,he),ve={name:he,value:pe,onChange:we,onBlur:Se};if(se){var je=B.type,Ze=B.value,dt=B.as,ur=B.multiple;je==="checkbox"?Ze===void 0?ve.checked=!!pe:(ve.checked=!!(Array.isArray(pe)&&~pe.indexOf(Ze)),ve.value=Ze):je==="radio"?(ve.checked=pe===Ze,ve.value=Ze):dt==="select"&&ur&&(ve.value=ve.value||[],ve.multiple=!0)}return ve},[Se,we,N.values]),rn=U.useMemo(function(){return!vr(R.current,N.values)},[R.current,N.values]),nn=U.useMemo(function(){return typeof d<"u"?rn?N.errors&&Object.keys(N.errors).length===0:d!==!1&&Et(d)?d(w):d:N.errors&&Object.keys(N.errors).length===0},[d,rn,N.errors,w]),wt=lt({},N,{initialValues:R.current,initialErrors:I.current,initialTouched:b.current,initialStatus:q.current,handleBlur:Se,handleChange:we,handleReset:xt,handleSubmit:Y,resetForm:te,setErrors:ft,setFormikState:Ae,setFieldTouched:Ce,setFieldValue:_e,setFieldError:le,setStatus:Ie,setSubmitting:re,setTouched:Ue,setValues:H,submitForm:rt,validateForm:ee,validateField:ge,isValid:nn,dirty:rn,unregisterField:He,registerField:Ee,getFieldProps:Gi,getFieldMeta:zi,getFieldHelpers:Ui,validateOnBlur:a,validateOnChange:r,validateOnMount:c});return wt}function hc(e){var t=e.htmlContent,r=e.documentationAnchorLink,i=e.handlerName;console.warn("Warning: Formik called `"+i+"`, but you forgot to pass an `id` or `name` attribute to your input:\n "+t+`
72
+ export default theme;`}function Bu(e){return typeof e=="number"?`${(e*100).toFixed(0)}%`:`calc((${e}) * 100%)`}const Zp=e=>{if(!Number.isNaN(+e))return+e;const t=e.match(/\d*\.?\d+/g);if(!t)return 0;let r=0;for(let i=0;i<t.length;i+=1)r+=+t[i];return r};function Qp(e){Object.assign(e,{alpha(t,r){const i=this||e;return i.colorSpace?`oklch(from ${t} l c h / ${typeof r=="string"?`calc(${r})`:r})`:i.vars?`rgba(${t.replace(/var\(--([^,\s)]+)(?:,[^)]+)?\)+/g,"var(--$1Channel)")} / ${typeof r=="string"?`calc(${r})`:r})`:Kl(t,Zp(r))},lighten(t,r){const i=this||e;return i.colorSpace?`color-mix(in ${i.colorSpace}, ${t}, #fff ${Bu(r)})`:Mi(t,r)},darken(t,r){const i=this||e;return i.colorSpace?`color-mix(in ${i.colorSpace}, ${t}, #000 ${Bu(r)})`:Fi(t,r)}})}function Ha(e={},...t){const{breakpoints:r,mixins:i={},spacing:a,palette:s={},transitions:c={},typography:d={},shape:p,colorSpace:m,...x}=e;if(e.vars&&e.generateThemeVars===void 0)throw new Error(process.env.NODE_ENV!=="production"?"MUI: `vars` is a private field used for CSS variables support.\nPlease use another name or follow the [docs](https://mui.com/material-ui/customization/css-theme-variables/usage/) to enable the feature.":Cr(20));const b=ds({...s,colorSpace:m}),S=Ml(e);let R=Et(S,{mixins:Bp(S.breakpoints,i),palette:b,shadows:Up.slice(),typography:Lp(b,d),transitions:Hp(c),zIndex:{...Jp}});if(R=Et(R,x),R=t.reduce((P,_)=>Et(P,_),R),process.env.NODE_ENV!=="production"){const P=["active","checked","completed","disabled","error","expanded","focused","focusVisible","required","selected"],_=(L,M)=>{let H;for(H in L){const G=L[H];if(P.includes(H)&&Object.keys(G).length>0){if(process.env.NODE_ENV!=="production"){const W=ls("",H);console.error([`MUI: The \`${M}\` component increases the CSS specificity of the \`${H}\` internal state.`,"You can not override it like this: ",JSON.stringify(L,null,2),"",`Instead, you need to use the '&.${W}' syntax:`,JSON.stringify({root:{[`&.${W}`]:G}},null,2),"","https://mui.com/r/state-classes-guide"].join(`
73
+ `))}L[H]={}}}};Object.keys(R.components).forEach(L=>{const M=R.components[L].styleOverrides;M&&L.startsWith("Mui")&&_(M,L)})}return R.unstable_sxConfig={...Ii,...x==null?void 0:x.unstable_sxConfig},R.unstable_sx=function(_){return en({sx:_,theme:this})},R.toRuntimeSource=Wl,Qp(R),R}function em(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 tm=[...Array(25)].map((e,t)=>{if(t===0)return"none";const r=em(t);return`linear-gradient(rgba(255 255 255 / ${r}), rgba(255 255 255 / ${r}))`});function Yl(e){return{inputPlaceholder:e==="dark"?.5:.42,inputUnderline:e==="dark"?.7:.42,switchTrackDisabled:e==="dark"?.2:.12,switchTrack:e==="dark"?.3:.38}}function Hl(e){return e==="dark"?tm:[]}function rm(e){const{palette:t={mode:"light"},opacity:r,overlays:i,colorSpace:a,...s}=e,c=ds({...t,colorSpace:a});return{palette:c,opacity:{...Yl(c.mode),...r},overlays:i||Hl(c.mode),...s}}function nm(e){var t;return!!e[0].match(/(cssVarPrefix|colorSchemeSelector|modularCssLayers|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!e[0].match(/sxConfig$/)||e[0]==="palette"&&!!((t=e[1])!=null&&t.match(/(mode|contrastThreshold|tonalOffset)/))}const im=e=>[...[...Array(25)].map((t,r)=>`--${e?`${e}-`:""}overlays-${r}`),`--${e?`${e}-`:""}palette-AppBar-darkBg`,`--${e?`${e}-`:""}palette-AppBar-darkColor`],om=e=>(t,r)=>{const i=e.rootSelector||":root",a=e.colorSchemeSelector;let s=a;if(a==="class"&&(s=".%s"),a==="data"&&(s="[data-%s]"),a!=null&&a.startsWith("data-")&&!a.includes("%s")&&(s=`[${a}="%s"]`),e.defaultColorScheme===t){if(t==="dark"){const c={};return im(e.cssVarPrefix).forEach(d=>{c[d]=r[d],delete r[d]}),s==="media"?{[i]:r,"@media (prefers-color-scheme: dark)":{[i]:c}}:s?{[s.replace("%s",t)]:c,[`${i}, ${s.replace("%s",t)}`]:r}:{[i]:{...r,...c}}}if(s&&s!=="media")return`${i}, ${s.replace("%s",String(t))}`}else if(t){if(s==="media")return{[`@media (prefers-color-scheme: ${String(t)})`]:{[i]:r}};if(s)return s.replace("%s",String(t))}return i};function am(e,t){t.forEach(r=>{e[r]||(e[r]={})})}function K(e,t,r){!e[t]&&r&&(e[t]=r)}function xn(e){return typeof e!="string"||!e.startsWith("hsl")?e:Vl(e)}function Kt(e,t){`${t}Channel`in e||(e[`${t}Channel`]=_n(xn(e[t]),`MUI: Can't create \`palette.${t}Channel\` because \`palette.${t}\` is not one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().
74
+ To suppress this warning, you need to explicitly provide the \`palette.${t}Channel\` as a string (in rgb format, for example "12 12 12") or undefined if you want to remove the channel token.`))}function sm(e){return typeof e=="number"?`${e}px`:typeof e=="string"||typeof e=="function"||Array.isArray(e)?e:"8px"}const Ft=e=>{try{return e()}catch{}},um=(e="mui")=>Tp(e);function Mo(e,t,r,i,a){if(!r)return;r=r===!0?{}:r;const s=a==="dark"?"dark":"light";if(!i){t[a]=rm({...r,palette:{mode:s,...r==null?void 0:r.palette},colorSpace:e});return}const{palette:c,...d}=Ha({...i,palette:{mode:s,...r==null?void 0:r.palette},colorSpace:e});return t[a]={...r,palette:c,opacity:{...Yl(s),...r==null?void 0:r.opacity},overlays:(r==null?void 0:r.overlays)||Hl(s)},d}function cm(e={},...t){const{colorSchemes:r={light:!0},defaultColorScheme:i,disableCssColorScheme:a=!1,cssVarPrefix:s="mui",nativeColor:c=!1,shouldSkipGeneratingVar:d=nm,colorSchemeSelector:p=r.light&&r.dark?"media":void 0,rootSelector:m=":root",...x}=e,b=Object.keys(r)[0],S=i||(r.light&&b!=="light"?"light":b),R=um(s),{[S]:P,light:_,dark:L,...M}=r,H={...M};let G=P;if((S==="dark"&&!("dark"in r)||S==="light"&&!("light"in r))&&(G=!0),!G)throw new Error(process.env.NODE_ENV!=="production"?`MUI: The \`colorSchemes.${S}\` option is either missing or invalid.`:Cr(21,S));let W;c&&(W="oklch");const A=Mo(W,H,G,x,S);_&&!H.light&&Mo(W,H,_,void 0,"light"),L&&!H.dark&&Mo(W,H,L,void 0,"dark");let q={defaultColorScheme:S,...A,cssVarPrefix:s,colorSchemeSelector:p,rootSelector:m,getCssVar:R,colorSchemes:H,font:{...Np(A.typography),...A.font},spacing:sm(x.spacing)};Object.keys(q.colorSchemes).forEach(ve=>{const v=q.colorSchemes[ve].palette,ee=ge=>{const Te=ge.split("-"),We=Te[1],Ke=Te[2];return R(ge,v[We][Ke])};v.mode==="light"&&(K(v.common,"background","#fff"),K(v.common,"onBackground","#000")),v.mode==="dark"&&(K(v.common,"background","#000"),K(v.common,"onBackground","#fff"));function te(ge,Te,We){if(W){let Ke;return ge===vr&&(Ke=`transparent ${((1-We)*100).toFixed(0)}%`),ge===Le&&(Ke=`#000 ${(We*100).toFixed(0)}%`),ge===Ve&&(Ke=`#fff ${(We*100).toFixed(0)}%`),`color-mix(in ${W}, ${Te}, ${Ke})`}return ge(Te,We)}if(am(v,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),v.mode==="light"){K(v.Alert,"errorColor",te(Le,v.error.light,.6)),K(v.Alert,"infoColor",te(Le,v.info.light,.6)),K(v.Alert,"successColor",te(Le,v.success.light,.6)),K(v.Alert,"warningColor",te(Le,v.warning.light,.6)),K(v.Alert,"errorFilledBg",ee("palette-error-main")),K(v.Alert,"infoFilledBg",ee("palette-info-main")),K(v.Alert,"successFilledBg",ee("palette-success-main")),K(v.Alert,"warningFilledBg",ee("palette-warning-main")),K(v.Alert,"errorFilledColor",Ft(()=>v.getContrastText(v.error.main))),K(v.Alert,"infoFilledColor",Ft(()=>v.getContrastText(v.info.main))),K(v.Alert,"successFilledColor",Ft(()=>v.getContrastText(v.success.main))),K(v.Alert,"warningFilledColor",Ft(()=>v.getContrastText(v.warning.main))),K(v.Alert,"errorStandardBg",te(Ve,v.error.light,.9)),K(v.Alert,"infoStandardBg",te(Ve,v.info.light,.9)),K(v.Alert,"successStandardBg",te(Ve,v.success.light,.9)),K(v.Alert,"warningStandardBg",te(Ve,v.warning.light,.9)),K(v.Alert,"errorIconColor",ee("palette-error-main")),K(v.Alert,"infoIconColor",ee("palette-info-main")),K(v.Alert,"successIconColor",ee("palette-success-main")),K(v.Alert,"warningIconColor",ee("palette-warning-main")),K(v.AppBar,"defaultBg",ee("palette-grey-100")),K(v.Avatar,"defaultBg",ee("palette-grey-400")),K(v.Button,"inheritContainedBg",ee("palette-grey-300")),K(v.Button,"inheritContainedHoverBg",ee("palette-grey-A100")),K(v.Chip,"defaultBorder",ee("palette-grey-400")),K(v.Chip,"defaultAvatarColor",ee("palette-grey-700")),K(v.Chip,"defaultIconColor",ee("palette-grey-700")),K(v.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),K(v.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),K(v.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),K(v.LinearProgress,"primaryBg",te(Ve,v.primary.main,.62)),K(v.LinearProgress,"secondaryBg",te(Ve,v.secondary.main,.62)),K(v.LinearProgress,"errorBg",te(Ve,v.error.main,.62)),K(v.LinearProgress,"infoBg",te(Ve,v.info.main,.62)),K(v.LinearProgress,"successBg",te(Ve,v.success.main,.62)),K(v.LinearProgress,"warningBg",te(Ve,v.warning.main,.62)),K(v.Skeleton,"bg",W?te(vr,v.text.primary,.11):`rgba(${ee("palette-text-primaryChannel")} / 0.11)`),K(v.Slider,"primaryTrack",te(Ve,v.primary.main,.62)),K(v.Slider,"secondaryTrack",te(Ve,v.secondary.main,.62)),K(v.Slider,"errorTrack",te(Ve,v.error.main,.62)),K(v.Slider,"infoTrack",te(Ve,v.info.main,.62)),K(v.Slider,"successTrack",te(Ve,v.success.main,.62)),K(v.Slider,"warningTrack",te(Ve,v.warning.main,.62));const ge=W?te(Le,v.background.default,.6825):si(v.background.default,.8);K(v.SnackbarContent,"bg",ge),K(v.SnackbarContent,"color",Ft(()=>W?Ya.text.primary:v.getContrastText(ge))),K(v.SpeedDialAction,"fabHoverBg",si(v.background.paper,.15)),K(v.StepConnector,"border",ee("palette-grey-400")),K(v.StepContent,"border",ee("palette-grey-400")),K(v.Switch,"defaultColor",ee("palette-common-white")),K(v.Switch,"defaultDisabledColor",ee("palette-grey-100")),K(v.Switch,"primaryDisabledColor",te(Ve,v.primary.main,.62)),K(v.Switch,"secondaryDisabledColor",te(Ve,v.secondary.main,.62)),K(v.Switch,"errorDisabledColor",te(Ve,v.error.main,.62)),K(v.Switch,"infoDisabledColor",te(Ve,v.info.main,.62)),K(v.Switch,"successDisabledColor",te(Ve,v.success.main,.62)),K(v.Switch,"warningDisabledColor",te(Ve,v.warning.main,.62)),K(v.TableCell,"border",te(Ve,te(vr,v.divider,1),.88)),K(v.Tooltip,"bg",te(vr,v.grey[700],.92))}if(v.mode==="dark"){K(v.Alert,"errorColor",te(Ve,v.error.light,.6)),K(v.Alert,"infoColor",te(Ve,v.info.light,.6)),K(v.Alert,"successColor",te(Ve,v.success.light,.6)),K(v.Alert,"warningColor",te(Ve,v.warning.light,.6)),K(v.Alert,"errorFilledBg",ee("palette-error-dark")),K(v.Alert,"infoFilledBg",ee("palette-info-dark")),K(v.Alert,"successFilledBg",ee("palette-success-dark")),K(v.Alert,"warningFilledBg",ee("palette-warning-dark")),K(v.Alert,"errorFilledColor",Ft(()=>v.getContrastText(v.error.dark))),K(v.Alert,"infoFilledColor",Ft(()=>v.getContrastText(v.info.dark))),K(v.Alert,"successFilledColor",Ft(()=>v.getContrastText(v.success.dark))),K(v.Alert,"warningFilledColor",Ft(()=>v.getContrastText(v.warning.dark))),K(v.Alert,"errorStandardBg",te(Le,v.error.light,.9)),K(v.Alert,"infoStandardBg",te(Le,v.info.light,.9)),K(v.Alert,"successStandardBg",te(Le,v.success.light,.9)),K(v.Alert,"warningStandardBg",te(Le,v.warning.light,.9)),K(v.Alert,"errorIconColor",ee("palette-error-main")),K(v.Alert,"infoIconColor",ee("palette-info-main")),K(v.Alert,"successIconColor",ee("palette-success-main")),K(v.Alert,"warningIconColor",ee("palette-warning-main")),K(v.AppBar,"defaultBg",ee("palette-grey-900")),K(v.AppBar,"darkBg",ee("palette-background-paper")),K(v.AppBar,"darkColor",ee("palette-text-primary")),K(v.Avatar,"defaultBg",ee("palette-grey-600")),K(v.Button,"inheritContainedBg",ee("palette-grey-800")),K(v.Button,"inheritContainedHoverBg",ee("palette-grey-700")),K(v.Chip,"defaultBorder",ee("palette-grey-700")),K(v.Chip,"defaultAvatarColor",ee("palette-grey-300")),K(v.Chip,"defaultIconColor",ee("palette-grey-300")),K(v.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),K(v.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),K(v.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),K(v.LinearProgress,"primaryBg",te(Le,v.primary.main,.5)),K(v.LinearProgress,"secondaryBg",te(Le,v.secondary.main,.5)),K(v.LinearProgress,"errorBg",te(Le,v.error.main,.5)),K(v.LinearProgress,"infoBg",te(Le,v.info.main,.5)),K(v.LinearProgress,"successBg",te(Le,v.success.main,.5)),K(v.LinearProgress,"warningBg",te(Le,v.warning.main,.5)),K(v.Skeleton,"bg",W?te(vr,v.text.primary,.13):`rgba(${ee("palette-text-primaryChannel")} / 0.13)`),K(v.Slider,"primaryTrack",te(Le,v.primary.main,.5)),K(v.Slider,"secondaryTrack",te(Le,v.secondary.main,.5)),K(v.Slider,"errorTrack",te(Le,v.error.main,.5)),K(v.Slider,"infoTrack",te(Le,v.info.main,.5)),K(v.Slider,"successTrack",te(Le,v.success.main,.5)),K(v.Slider,"warningTrack",te(Le,v.warning.main,.5));const ge=W?te(Ve,v.background.default,.985):si(v.background.default,.98);K(v.SnackbarContent,"bg",ge),K(v.SnackbarContent,"color",Ft(()=>W?Ul.text.primary:v.getContrastText(ge))),K(v.SpeedDialAction,"fabHoverBg",si(v.background.paper,.15)),K(v.StepConnector,"border",ee("palette-grey-600")),K(v.StepContent,"border",ee("palette-grey-600")),K(v.Switch,"defaultColor",ee("palette-grey-300")),K(v.Switch,"defaultDisabledColor",ee("palette-grey-600")),K(v.Switch,"primaryDisabledColor",te(Le,v.primary.main,.55)),K(v.Switch,"secondaryDisabledColor",te(Le,v.secondary.main,.55)),K(v.Switch,"errorDisabledColor",te(Le,v.error.main,.55)),K(v.Switch,"infoDisabledColor",te(Le,v.info.main,.55)),K(v.Switch,"successDisabledColor",te(Le,v.success.main,.55)),K(v.Switch,"warningDisabledColor",te(Le,v.warning.main,.55)),K(v.TableCell,"border",te(Le,te(vr,v.divider,1),.68)),K(v.Tooltip,"bg",te(vr,v.grey[700],.92))}Kt(v.background,"default"),Kt(v.background,"paper"),Kt(v.common,"background"),Kt(v.common,"onBackground"),Kt(v,"divider"),Object.keys(v).forEach(ge=>{const Te=v[ge];ge!=="tonalOffset"&&Te&&typeof Te=="object"&&(Te.main&&K(v[ge],"mainChannel",_n(xn(Te.main))),Te.light&&K(v[ge],"lightChannel",_n(xn(Te.light))),Te.dark&&K(v[ge],"darkChannel",_n(xn(Te.dark))),Te.contrastText&&K(v[ge],"contrastTextChannel",_n(xn(Te.contrastText))),ge==="text"&&(Kt(v[ge],"primary"),Kt(v[ge],"secondary")),ge==="action"&&(Te.active&&Kt(v[ge],"active"),Te.selected&&Kt(v[ge],"selected")))})}),q=t.reduce((ve,v)=>Et(ve,v),q);const X={prefix:s,disableCssColorScheme:a,shouldSkipGeneratingVar:d,getSelector:om(q),enableContrastVars:c},{vars:ie,generateThemeVars:ye,generateStyleSheets:Ge}=Ap(q,X);return q.vars=ie,Object.entries(q.colorSchemes[q.defaultColorScheme]).forEach(([ve,v])=>{q[ve]=v}),q.generateThemeVars=ye,q.generateStyleSheets=Ge,q.generateSpacing=function(){return Fl(x.spacing,us(this))},q.getColorSchemeSelector=jp(p),q.spacing=q.generateSpacing(),q.shouldSkipGeneratingVar=d,q.unstable_sxConfig={...Ii,...x==null?void 0:x.unstable_sxConfig},q.unstable_sx=function(v){return en({sx:v,theme:this})},q.toRuntimeSource=Wl,q}function qu(e,t,r){e.colorSchemes&&r&&(e.colorSchemes[t]={...r!==!0&&r,palette:ds({...r===!0?{}:r.palette,mode:t})})}function Jl(e={},...t){const{palette:r,cssVariables:i=!1,colorSchemes:a=r?void 0:{light:!0},defaultColorScheme:s=r==null?void 0:r.mode,...c}=e,d=s||"light",p=a==null?void 0:a[d],m={...a,...r?{[d]:{...typeof p!="boolean"&&p,palette:r}}:void 0};if(i===!1){if(!("colorSchemes"in e))return Ha(e,...t);let x=r;"palette"in e||m[d]&&(m[d]!==!0?x=m[d].palette:d==="dark"&&(x={mode:"dark"}));const b=Ha({...e,palette:x},...t);return b.defaultColorScheme=d,b.colorSchemes=m,b.palette.mode==="light"&&(b.colorSchemes.light={...m.light!==!0&&m.light,palette:b.palette},qu(b,"dark",m.dark)),b.palette.mode==="dark"&&(b.colorSchemes.dark={...m.dark!==!0&&m.dark,palette:b.palette},qu(b,"light",m.light)),b}return!r&&!("light"in m)&&d==="light"&&(m.light=!0),cm({...c,colorSchemes:m,defaultColorScheme:d,...typeof i!="boolean"&&i},...t)}const lm=Jl(),fm="$$material";function dm(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const hm=e=>dm(e)&&e!=="classes",pm=dp({themeId:fm,defaultTheme:lm,rootShouldForwardProp:hm}),mm=Ep;process.env.NODE_ENV!=="production"&&(Fe.node,Fe.object.isRequired);function ym(e){return wp(e)}function gm(e){return ls("MuiSvgIcon",e)}sp("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const vm=e=>{const{color:t,fontSize:r,classes:i}=e,a={root:["root",t!=="inherit"&&`color${Or(t)}`,`fontSize${Or(r)}`]};return Zd(a,gm,i)},bm=pm("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.color!=="inherit"&&t[`color${Or(r.color)}`],t[`fontSize${Or(r.fontSize)}`]]}})(mm(({theme:e})=>{var t,r,i,a,s,c,d,p,m,x,b,S,R,P;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:(a=(t=e.transitions)==null?void 0:t.create)==null?void 0:a.call(t,"fill",{duration:(i=(r=(e.vars??e).transitions)==null?void 0:r.duration)==null?void 0:i.shorter}),variants:[{props:_=>!_.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:((c=(s=e.typography)==null?void 0:s.pxToRem)==null?void 0:c.call(s,20))||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:((p=(d=e.typography)==null?void 0:d.pxToRem)==null?void 0:p.call(d,24))||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:((x=(m=e.typography)==null?void 0:m.pxToRem)==null?void 0:x.call(m,35))||"2.1875rem"}},...Object.entries((e.vars??e).palette).filter(([,_])=>_&&_.main).map(([_])=>{var L,M;return{props:{color:_},style:{color:(M=(L=(e.vars??e).palette)==null?void 0:L[_])==null?void 0:M.main}}}),{props:{color:"action"},style:{color:(S=(b=(e.vars??e).palette)==null?void 0:b.action)==null?void 0:S.active}},{props:{color:"disabled"},style:{color:(P=(R=(e.vars??e).palette)==null?void 0:R.action)==null?void 0:P.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}})),xi=ir.forwardRef(function(t,r){const i=ym({props:t,name:"MuiSvgIcon"}),{children:a,className:s,color:c="inherit",component:d="svg",fontSize:p="medium",htmlColor:m,inheritViewBox:x=!1,titleAccess:b,viewBox:S="0 0 24 24",...R}=i,P=ir.isValidElement(a)&&a.type==="svg",_={...i,color:c,component:d,fontSize:p,instanceFontSize:t.fontSize,inheritViewBox:x,viewBox:S,hasSvgAsChild:P},L={};x||(L.viewBox=S);const M=vm(_);return k.jsxs(bm,{as:d,className:Pl(M.root,s),focusable:"false",color:m,"aria-hidden":b?void 0:!0,role:b?"img":void 0,ref:r,...L,...R,...P&&a.props,ownerState:_,children:[P?a.props.children:a,b?k.jsx("title",{children:b}):null]})});process.env.NODE_ENV!=="production"&&(xi.propTypes={children:Fe.node,classes:Fe.object,className:Fe.string,color:Fe.oneOfType([Fe.oneOf(["inherit","action","disabled","primary","secondary","error","info","success","warning"]),Fe.string]),component:Fe.elementType,fontSize:Fe.oneOfType([Fe.oneOf(["inherit","large","medium","small"]),Fe.string]),htmlColor:Fe.string,inheritViewBox:Fe.bool,shapeRendering:Fe.string,sx:Fe.oneOfType([Fe.arrayOf(Fe.oneOfType([Fe.func,Fe.object,Fe.bool])),Fe.func,Fe.object]),titleAccess:Fe.string,viewBox:Fe.string});xi.muiName="SvgIcon";function yt(e,t){function r(i,a){return k.jsx(xi,{"data-testid":process.env.NODE_ENV!=="production"?`${t}Icon`:void 0,ref:a,...i,children:e})}return process.env.NODE_ENV!=="production"&&(r.displayName=`${t}Icon`),r.muiName=xi.muiName,ir.memo(ir.forwardRef(r))}const _m=yt(k.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}),"Add"),xm=yt(k.jsx("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20z"}),"ArrowBack"),Sm=yt(k.jsx("path",{d:"m7 10 5 5 5-5z"}),"ArrowDropDown"),wm=yt(k.jsx("path",{d:"M7.5 5.6 10 7 8.6 4.5 10 2 7.5 3.4 5 2l1.4 2.5L5 7zm12 9.8L17 14l1.4 2.5L17 19l2.5-1.4L22 19l-1.4-2.5L22 14zM22 2l-2.5 1.4L17 2l1.4 2.5L17 7l2.5-1.4L22 7l-1.4-2.5zm-7.63 5.29a.996.996 0 0 0-1.41 0L1.29 18.96c-.39.39-.39 1.02 0 1.41l2.34 2.34c.39.39 1.02.39 1.41 0L16.7 11.05c.39-.39.39-1.02 0-1.41zm-1.03 5.49-2.12-2.12 2.44-2.44 2.12 2.12z"}),"AutoFixHigh"),Em=yt(k.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close"),Tm=yt(k.jsx("path",{d:"M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z"}),"Done"),Cm=yt(k.jsx("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"ErrorOutline"),Xl=yt(k.jsx("path",{d:"M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5s-3 1.34-3 3 1.34 3 3 3m-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5 5 6.34 5 8s1.34 3 3 3m0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5m8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5"}),"Group"),Zl=yt(k.jsx("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4m0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4"}),"Person"),Om=yt(k.jsx("path",{d:"M15 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4m-9-2V7H4v3H1v2h3v3h2v-3h3v-2zm9 4c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4"}),"PersonAdd"),Am=yt(k.jsx("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z"}),"Refresh"),jm=yt([k.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"},"0"),k.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"},"1")],"Schedule"),$m=yt(k.jsx("path",{d:"M2.01 21 23 12 2.01 3 2 10l15 2-15 2z"}),"Send"),km=yt(k.jsx("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5M12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"}),"Visibility"),Pm=yt(k.jsx("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7M2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2m4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3z"}),"VisibilityOff"),Rm=yt(k.jsx("path",{d:"M22.99 9C19.15 5.16 13.8 3.76 8.84 4.78l2.52 2.52c3.47-.17 6.99 1.05 9.63 3.7zm-4 4c-1.29-1.29-2.84-2.13-4.49-2.56l3.53 3.53zM2 3.05 5.07 6.1C3.6 6.82 2.22 7.78 1 9l1.99 2c1.24-1.24 2.67-2.16 4.2-2.77l2.24 2.24C7.81 10.89 6.27 11.73 5 13v.01L6.99 15c1.36-1.36 3.14-2.04 4.92-2.06L18.98 20l1.27-1.26L3.29 1.79zM9 17l3 3 3-3c-1.65-1.66-4.34-1.66-6 0"}),"WifiOff");function Im(e){const t=new Date(e),i=new Date().getTime()-t.getTime(),a=Math.floor(i/6e4),s=Math.floor(i/36e5),c=Math.floor(i/864e5);return a<1?"now":a<60?`${a}m`:s<24?`${s}h`:c<7?`${c}d`:t.toLocaleDateString(void 0,{month:"short",day:"numeric"})}const Ql=Y.memo(({conversation:e,displayName:t,selected:r,onClick:i,currentUser:a})=>{const s=!!e.group,c=e.unread_count,d=(a==null?void 0:a.role)==="admin";return k.jsx(U.ListItem,{disablePadding:!0,children:k.jsxs(U.ListItemButton,{selected:r,onClick:i,sx:{"&.Mui-selected":{backgroundColor:"action.selected","&:hover":{backgroundColor:"action.selected"}}},children:[k.jsx(U.ListItemAvatar,{children:k.jsx(U.Badge,{badgeContent:c,color:"primary",overlap:"circular",invisible:c===0,children:k.jsx(U.Avatar,{sx:{bgcolor:s?"primary.main":"secondary.main"},children:s?k.jsx(Xl,{}):k.jsx(Zl,{})})})}),k.jsx(U.ListItemText,{primary:k.jsxs(U.Box,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[k.jsx(U.Typography,{variant:"subtitle2",noWrap:!0,sx:{fontWeight:c>0?600:400,flex:1},children:t}),k.jsx(U.Typography,{variant:"caption",color:"text.secondary",sx:{ml:1,flexShrink:0},children:Im(e.last_message_at)})]}),secondary:k.jsx(U.Typography,{variant:"body2",color:"text.secondary",noWrap:!0,sx:{fontWeight:c>0?500:400},children:e.message_count===0?d&&s?"View group":"No messages yet":`${e.message_count} message${e.message_count!==1?"s":""}`})})]})})}),ef=()=>k.jsxs(U.ListItem,{children:[k.jsx(U.ListItemAvatar,{children:k.jsx(U.Skeleton,{variant:"circular",width:40,height:40})}),k.jsx(U.ListItemText,{primary:k.jsxs(U.Box,{display:"flex",justifyContent:"space-between",children:[k.jsx(U.Skeleton,{variant:"text",width:"60%"}),k.jsx(U.Skeleton,{variant:"text",width:"15%"})]}),secondary:k.jsx(U.Skeleton,{variant:"text",width:"80%"})})]});var Dm=function(t){return Fm(t)&&!Mm(t)};function Fm(e){return!!e&&typeof e=="object"}function Mm(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||qm(e)}var Nm=typeof Symbol=="function"&&Symbol.for,Bm=Nm?Symbol.for("react.element"):60103;function qm(e){return e.$$typeof===Bm}function Lm(e){return Array.isArray(e)?[]:{}}function Si(e,t){return t.clone!==!1&&t.isMergeableObject(e)?Cn(Lm(e),e,t):e}function Vm(e,t,r){return e.concat(t).map(function(i){return Si(i,r)})}function Km(e,t,r){var i={};return r.isMergeableObject(e)&&Object.keys(e).forEach(function(a){i[a]=Si(e[a],r)}),Object.keys(t).forEach(function(a){!r.isMergeableObject(t[a])||!e[a]?i[a]=Si(t[a],r):i[a]=Cn(e[a],t[a],r)}),i}function Cn(e,t,r){r=r||{},r.arrayMerge=r.arrayMerge||Vm,r.isMergeableObject=r.isMergeableObject||Dm;var i=Array.isArray(t),a=Array.isArray(e),s=i===a;return s?i?r.arrayMerge(e,t,r):Km(e,t,r):Si(t,r)}Cn.all=function(t,r){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(i,a){return Cn(i,a,r)},{})};var Ja=Cn,tf=typeof global=="object"&&global&&global.Object===Object&&global,zm=typeof self=="object"&&self&&self.Object===Object&&self,Bt=tf||zm||Function("return this")(),ar=Bt.Symbol,rf=Object.prototype,Um=rf.hasOwnProperty,Gm=rf.toString,vn=ar?ar.toStringTag:void 0;function Wm(e){var t=Um.call(e,vn),r=e[vn];try{e[vn]=void 0;var i=!0}catch{}var a=Gm.call(e);return i&&(t?e[vn]=r:delete e[vn]),a}var Ym=Object.prototype,Hm=Ym.toString;function Jm(e){return Hm.call(e)}var Xm="[object Null]",Zm="[object Undefined]",Lu=ar?ar.toStringTag:void 0;function jr(e){return e==null?e===void 0?Zm:Xm:Lu&&Lu in Object(e)?Wm(e):Jm(e)}function nf(e,t){return function(r){return e(t(r))}}var hs=nf(Object.getPrototypeOf,Object);function $r(e){return e!=null&&typeof e=="object"}var Qm="[object Object]",ey=Function.prototype,ty=Object.prototype,of=ey.toString,ry=ty.hasOwnProperty,ny=of.call(Object);function Vu(e){if(!$r(e)||jr(e)!=Qm)return!1;var t=hs(e);if(t===null)return!0;var r=ry.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&of.call(r)==ny}function iy(){this.__data__=[],this.size=0}function af(e,t){return e===t||e!==e&&t!==t}function Ni(e,t){for(var r=e.length;r--;)if(af(e[r][0],t))return r;return-1}var oy=Array.prototype,ay=oy.splice;function sy(e){var t=this.__data__,r=Ni(t,e);if(r<0)return!1;var i=t.length-1;return r==i?t.pop():ay.call(t,r,1),--this.size,!0}function uy(e){var t=this.__data__,r=Ni(t,e);return r<0?void 0:t[r][1]}function cy(e){return Ni(this.__data__,e)>-1}function ly(e,t){var r=this.__data__,i=Ni(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}function Yt(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}Yt.prototype.clear=iy;Yt.prototype.delete=sy;Yt.prototype.get=uy;Yt.prototype.has=cy;Yt.prototype.set=ly;function fy(){this.__data__=new Yt,this.size=0}function dy(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}function hy(e){return this.__data__.get(e)}function py(e){return this.__data__.has(e)}function Rn(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var my="[object AsyncFunction]",yy="[object Function]",gy="[object GeneratorFunction]",vy="[object Proxy]";function sf(e){if(!Rn(e))return!1;var t=jr(e);return t==yy||t==gy||t==my||t==vy}var No=Bt["__core-js_shared__"],Ku=(function(){var e=/[^.]+$/.exec(No&&No.keys&&No.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function by(e){return!!Ku&&Ku in e}var _y=Function.prototype,xy=_y.toString;function kr(e){if(e!=null){try{return xy.call(e)}catch{}try{return e+""}catch{}}return""}var Sy=/[\\^$.*+?()[\]{}|]/g,wy=/^\[object .+?Constructor\]$/,Ey=Function.prototype,Ty=Object.prototype,Cy=Ey.toString,Oy=Ty.hasOwnProperty,Ay=RegExp("^"+Cy.call(Oy).replace(Sy,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function jy(e){if(!Rn(e)||by(e))return!1;var t=sf(e)?Ay:wy;return t.test(kr(e))}function $y(e,t){return e==null?void 0:e[t]}function Pr(e,t){var r=$y(e,t);return jy(r)?r:void 0}var On=Pr(Bt,"Map"),An=Pr(Object,"create");function ky(){this.__data__=An?An(null):{},this.size=0}function Py(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Ry="__lodash_hash_undefined__",Iy=Object.prototype,Dy=Iy.hasOwnProperty;function Fy(e){var t=this.__data__;if(An){var r=t[e];return r===Ry?void 0:r}return Dy.call(t,e)?t[e]:void 0}var My=Object.prototype,Ny=My.hasOwnProperty;function By(e){var t=this.__data__;return An?t[e]!==void 0:Ny.call(t,e)}var qy="__lodash_hash_undefined__";function Ly(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=An&&t===void 0?qy:t,this}function Ar(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}Ar.prototype.clear=ky;Ar.prototype.delete=Py;Ar.prototype.get=Fy;Ar.prototype.has=By;Ar.prototype.set=Ly;function Vy(){this.size=0,this.__data__={hash:new Ar,map:new(On||Yt),string:new Ar}}function Ky(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Bi(e,t){var r=e.__data__;return Ky(t)?r[typeof t=="string"?"string":"hash"]:r.map}function zy(e){var t=Bi(this,e).delete(e);return this.size-=t?1:0,t}function Uy(e){return Bi(this,e).get(e)}function Gy(e){return Bi(this,e).has(e)}function Wy(e,t){var r=Bi(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}function ur(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}ur.prototype.clear=Vy;ur.prototype.delete=zy;ur.prototype.get=Uy;ur.prototype.has=Gy;ur.prototype.set=Wy;var Yy=200;function Hy(e,t){var r=this.__data__;if(r instanceof Yt){var i=r.__data__;if(!On||i.length<Yy-1)return i.push([e,t]),this.size=++r.size,this;r=this.__data__=new ur(i)}return r.set(e,t),this.size=r.size,this}function nn(e){var t=this.__data__=new Yt(e);this.size=t.size}nn.prototype.clear=fy;nn.prototype.delete=dy;nn.prototype.get=hy;nn.prototype.has=py;nn.prototype.set=Hy;function Jy(e,t){for(var r=-1,i=e==null?0:e.length;++r<i&&t(e[r],r,e)!==!1;);return e}var zu=(function(){try{var e=Pr(Object,"defineProperty");return e({},"",{}),e}catch{}})();function uf(e,t,r){t=="__proto__"&&zu?zu(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var Xy=Object.prototype,Zy=Xy.hasOwnProperty;function cf(e,t,r){var i=e[t];(!(Zy.call(e,t)&&af(i,r))||r===void 0&&!(t in e))&&uf(e,t,r)}function qi(e,t,r,i){var a=!r;r||(r={});for(var s=-1,c=t.length;++s<c;){var d=t[s],p=void 0;p===void 0&&(p=e[d]),a?uf(r,d,p):cf(r,d,p)}return r}function Qy(e,t){for(var r=-1,i=Array(e);++r<e;)i[r]=t(r);return i}var eg="[object Arguments]";function Uu(e){return $r(e)&&jr(e)==eg}var lf=Object.prototype,tg=lf.hasOwnProperty,rg=lf.propertyIsEnumerable,ng=Uu((function(){return arguments})())?Uu:function(e){return $r(e)&&tg.call(e,"callee")&&!rg.call(e,"callee")},In=Array.isArray;function ig(){return!1}var ff=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Gu=ff&&typeof module=="object"&&module&&!module.nodeType&&module,og=Gu&&Gu.exports===ff,Wu=og?Bt.Buffer:void 0,ag=Wu?Wu.isBuffer:void 0,df=ag||ig,sg=9007199254740991,ug=/^(?:0|[1-9]\d*)$/;function cg(e,t){var r=typeof e;return t=t??sg,!!t&&(r=="number"||r!="symbol"&&ug.test(e))&&e>-1&&e%1==0&&e<t}var lg=9007199254740991;function hf(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=lg}var fg="[object Arguments]",dg="[object Array]",hg="[object Boolean]",pg="[object Date]",mg="[object Error]",yg="[object Function]",gg="[object Map]",vg="[object Number]",bg="[object Object]",_g="[object RegExp]",xg="[object Set]",Sg="[object String]",wg="[object WeakMap]",Eg="[object ArrayBuffer]",Tg="[object DataView]",Cg="[object Float32Array]",Og="[object Float64Array]",Ag="[object Int8Array]",jg="[object Int16Array]",$g="[object Int32Array]",kg="[object Uint8Array]",Pg="[object Uint8ClampedArray]",Rg="[object Uint16Array]",Ig="[object Uint32Array]",Je={};Je[Cg]=Je[Og]=Je[Ag]=Je[jg]=Je[$g]=Je[kg]=Je[Pg]=Je[Rg]=Je[Ig]=!0;Je[fg]=Je[dg]=Je[Eg]=Je[hg]=Je[Tg]=Je[pg]=Je[mg]=Je[yg]=Je[gg]=Je[vg]=Je[bg]=Je[_g]=Je[xg]=Je[Sg]=Je[wg]=!1;function Dg(e){return $r(e)&&hf(e.length)&&!!Je[jr(e)]}function ps(e){return function(t){return e(t)}}var pf=typeof exports=="object"&&exports&&!exports.nodeType&&exports,wn=pf&&typeof module=="object"&&module&&!module.nodeType&&module,Fg=wn&&wn.exports===pf,Bo=Fg&&tf.process,tn=(function(){try{var e=wn&&wn.require&&wn.require("util").types;return e||Bo&&Bo.binding&&Bo.binding("util")}catch{}})(),Yu=tn&&tn.isTypedArray,Mg=Yu?ps(Yu):Dg,Ng=Object.prototype,Bg=Ng.hasOwnProperty;function mf(e,t){var r=In(e),i=!r&&ng(e),a=!r&&!i&&df(e),s=!r&&!i&&!a&&Mg(e),c=r||i||a||s,d=c?Qy(e.length,String):[],p=d.length;for(var m in e)(t||Bg.call(e,m))&&!(c&&(m=="length"||a&&(m=="offset"||m=="parent")||s&&(m=="buffer"||m=="byteLength"||m=="byteOffset")||cg(m,p)))&&d.push(m);return d}var qg=Object.prototype;function ms(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||qg;return e===r}var Lg=nf(Object.keys,Object),Vg=Object.prototype,Kg=Vg.hasOwnProperty;function zg(e){if(!ms(e))return Lg(e);var t=[];for(var r in Object(e))Kg.call(e,r)&&r!="constructor"&&t.push(r);return t}function yf(e){return e!=null&&hf(e.length)&&!sf(e)}function ys(e){return yf(e)?mf(e):zg(e)}function Ug(e,t){return e&&qi(t,ys(t),e)}function Gg(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}var Wg=Object.prototype,Yg=Wg.hasOwnProperty;function Hg(e){if(!Rn(e))return Gg(e);var t=ms(e),r=[];for(var i in e)i=="constructor"&&(t||!Yg.call(e,i))||r.push(i);return r}function gs(e){return yf(e)?mf(e,!0):Hg(e)}function Jg(e,t){return e&&qi(t,gs(t),e)}var gf=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Hu=gf&&typeof module=="object"&&module&&!module.nodeType&&module,Xg=Hu&&Hu.exports===gf,Ju=Xg?Bt.Buffer:void 0,Xu=Ju?Ju.allocUnsafe:void 0;function Zg(e,t){if(t)return e.slice();var r=e.length,i=Xu?Xu(r):new e.constructor(r);return e.copy(i),i}function vf(e,t){var r=-1,i=e.length;for(t||(t=Array(i));++r<i;)t[r]=e[r];return t}function Qg(e,t){for(var r=-1,i=e==null?0:e.length,a=0,s=[];++r<i;){var c=e[r];t(c,r,e)&&(s[a++]=c)}return s}function bf(){return[]}var ev=Object.prototype,tv=ev.propertyIsEnumerable,Zu=Object.getOwnPropertySymbols,vs=Zu?function(e){return e==null?[]:(e=Object(e),Qg(Zu(e),function(t){return tv.call(e,t)}))}:bf;function rv(e,t){return qi(e,vs(e),t)}function _f(e,t){for(var r=-1,i=t.length,a=e.length;++r<i;)e[a+r]=t[r];return e}var nv=Object.getOwnPropertySymbols,xf=nv?function(e){for(var t=[];e;)_f(t,vs(e)),e=hs(e);return t}:bf;function iv(e,t){return qi(e,xf(e),t)}function Sf(e,t,r){var i=t(e);return In(e)?i:_f(i,r(e))}function ov(e){return Sf(e,ys,vs)}function av(e){return Sf(e,gs,xf)}var Xa=Pr(Bt,"DataView"),Za=Pr(Bt,"Promise"),Qa=Pr(Bt,"Set"),es=Pr(Bt,"WeakMap"),Qu="[object Map]",sv="[object Object]",ec="[object Promise]",tc="[object Set]",rc="[object WeakMap]",nc="[object DataView]",uv=kr(Xa),cv=kr(On),lv=kr(Za),fv=kr(Qa),dv=kr(es),Ut=jr;(Xa&&Ut(new Xa(new ArrayBuffer(1)))!=nc||On&&Ut(new On)!=Qu||Za&&Ut(Za.resolve())!=ec||Qa&&Ut(new Qa)!=tc||es&&Ut(new es)!=rc)&&(Ut=function(e){var t=jr(e),r=t==sv?e.constructor:void 0,i=r?kr(r):"";if(i)switch(i){case uv:return nc;case cv:return Qu;case lv:return ec;case fv:return tc;case dv:return rc}return t});var hv=Object.prototype,pv=hv.hasOwnProperty;function mv(e){var t=e.length,r=new e.constructor(t);return t&&typeof e[0]=="string"&&pv.call(e,"index")&&(r.index=e.index,r.input=e.input),r}var ic=Bt.Uint8Array;function bs(e){var t=new e.constructor(e.byteLength);return new ic(t).set(new ic(e)),t}function yv(e,t){var r=t?bs(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}var gv=/\w*$/;function vv(e){var t=new e.constructor(e.source,gv.exec(e));return t.lastIndex=e.lastIndex,t}var oc=ar?ar.prototype:void 0,ac=oc?oc.valueOf:void 0;function bv(e){return ac?Object(ac.call(e)):{}}function _v(e,t){var r=t?bs(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var xv="[object Boolean]",Sv="[object Date]",wv="[object Map]",Ev="[object Number]",Tv="[object RegExp]",Cv="[object Set]",Ov="[object String]",Av="[object Symbol]",jv="[object ArrayBuffer]",$v="[object DataView]",kv="[object Float32Array]",Pv="[object Float64Array]",Rv="[object Int8Array]",Iv="[object Int16Array]",Dv="[object Int32Array]",Fv="[object Uint8Array]",Mv="[object Uint8ClampedArray]",Nv="[object Uint16Array]",Bv="[object Uint32Array]";function qv(e,t,r){var i=e.constructor;switch(t){case jv:return bs(e);case xv:case Sv:return new i(+e);case $v:return yv(e,r);case kv:case Pv:case Rv:case Iv:case Dv:case Fv:case Mv:case Nv:case Bv:return _v(e,r);case wv:return new i;case Ev:case Ov:return new i(e);case Tv:return vv(e);case Cv:return new i;case Av:return bv(e)}}var sc=Object.create,Lv=(function(){function e(){}return function(t){if(!Rn(t))return{};if(sc)return sc(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}})();function Vv(e){return typeof e.constructor=="function"&&!ms(e)?Lv(hs(e)):{}}var Kv="[object Map]";function zv(e){return $r(e)&&Ut(e)==Kv}var uc=tn&&tn.isMap,Uv=uc?ps(uc):zv,Gv="[object Set]";function Wv(e){return $r(e)&&Ut(e)==Gv}var cc=tn&&tn.isSet,Yv=cc?ps(cc):Wv,Hv=1,Jv=2,Xv=4,wf="[object Arguments]",Zv="[object Array]",Qv="[object Boolean]",eb="[object Date]",tb="[object Error]",Ef="[object Function]",rb="[object GeneratorFunction]",nb="[object Map]",ib="[object Number]",Tf="[object Object]",ob="[object RegExp]",ab="[object Set]",sb="[object String]",ub="[object Symbol]",cb="[object WeakMap]",lb="[object ArrayBuffer]",fb="[object DataView]",db="[object Float32Array]",hb="[object Float64Array]",pb="[object Int8Array]",mb="[object Int16Array]",yb="[object Int32Array]",gb="[object Uint8Array]",vb="[object Uint8ClampedArray]",bb="[object Uint16Array]",_b="[object Uint32Array]",He={};He[wf]=He[Zv]=He[lb]=He[fb]=He[Qv]=He[eb]=He[db]=He[hb]=He[pb]=He[mb]=He[yb]=He[nb]=He[ib]=He[Tf]=He[ob]=He[ab]=He[sb]=He[ub]=He[gb]=He[vb]=He[bb]=He[_b]=!0;He[tb]=He[Ef]=He[cb]=!1;function En(e,t,r,i,a,s){var c,d=t&Hv,p=t&Jv,m=t&Xv;if(c!==void 0)return c;if(!Rn(e))return e;var x=In(e);if(x){if(c=mv(e),!d)return vf(e,c)}else{var b=Ut(e),S=b==Ef||b==rb;if(df(e))return Zg(e,d);if(b==Tf||b==wf||S&&!a){if(c=p||S?{}:Vv(e),!d)return p?iv(e,Jg(c,e)):rv(e,Ug(c,e))}else{if(!He[b])return a?e:{};c=qv(e,b,d)}}s||(s=new nn);var R=s.get(e);if(R)return R;s.set(e,c),Yv(e)?e.forEach(function(L){c.add(En(L,t,r,L,e,s))}):Uv(e)&&e.forEach(function(L,M){c.set(M,En(L,t,r,M,e,s))});var P=m?p?av:ov:p?gs:ys,_=x?void 0:P(e);return Jy(_||e,function(L,M){_&&(M=L,L=e[M]),cf(c,M,En(L,t,r,M,e,s))}),c}var xb=1,Sb=4;function ui(e){return En(e,xb|Sb)}var qo,lc;function wb(){if(lc)return qo;lc=1;var e=Array.isArray,t=Object.keys,r=Object.prototype.hasOwnProperty,i=typeof Element<"u";function a(s,c){if(s===c)return!0;if(s&&c&&typeof s=="object"&&typeof c=="object"){var d=e(s),p=e(c),m,x,b;if(d&&p){if(x=s.length,x!=c.length)return!1;for(m=x;m--!==0;)if(!a(s[m],c[m]))return!1;return!0}if(d!=p)return!1;var S=s instanceof Date,R=c instanceof Date;if(S!=R)return!1;if(S&&R)return s.getTime()==c.getTime();var P=s instanceof RegExp,_=c instanceof RegExp;if(P!=_)return!1;if(P&&_)return s.toString()==c.toString();var L=t(s);if(x=L.length,x!==t(c).length)return!1;for(m=x;m--!==0;)if(!r.call(c,L[m]))return!1;if(i&&s instanceof Element&&c instanceof Element)return s===c;for(m=x;m--!==0;)if(b=L[m],!(b==="_owner"&&s.$$typeof)&&!a(s[b],c[b]))return!1;return!0}return s!==s&&c!==c}return qo=function(c,d){try{return a(c,d)}catch(p){if(p.message&&p.message.match(/stack|recursion/i)||p.number===-2146828260)return console.warn("Warning: react-fast-compare does not handle circular references.",p.name,p.message),!1;throw p}},qo}var Eb=wb();const _r=$n(Eb);var Tb=process.env.NODE_ENV==="production";function Xr(e,t){if(!Tb){var r="Warning: "+t;typeof console<"u"&&console.warn(r);try{throw Error(r)}catch{}}}var Cb=4;function fc(e){return En(e,Cb)}function Cf(e,t){for(var r=-1,i=e==null?0:e.length,a=Array(i);++r<i;)a[r]=t(e[r],r,e);return a}var Ob="[object Symbol]";function _s(e){return typeof e=="symbol"||$r(e)&&jr(e)==Ob}var Ab="Expected a function";function xs(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(Ab);var r=function(){var i=arguments,a=t?t.apply(this,i):i[0],s=r.cache;if(s.has(a))return s.get(a);var c=e.apply(this,i);return r.cache=s.set(a,c)||s,c};return r.cache=new(xs.Cache||ur),r}xs.Cache=ur;var jb=500;function $b(e){var t=xs(e,function(i){return r.size===jb&&r.clear(),i}),r=t.cache;return t}var kb=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Pb=/\\(\\)?/g,Rb=$b(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(kb,function(r,i,a,s){t.push(a?s.replace(Pb,"$1"):i||r)}),t});function Ib(e){if(typeof e=="string"||_s(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var dc=ar?ar.prototype:void 0,hc=dc?dc.toString:void 0;function Of(e){if(typeof e=="string")return e;if(In(e))return Cf(e,Of)+"";if(_s(e))return hc?hc.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Db(e){return e==null?"":Of(e)}function Af(e){return In(e)?Cf(e,Ib):_s(e)?[e]:vf(Rb(Db(e)))}var ci={exports:{}},Be={};/** @license React v16.13.1
75
+ * react-is.production.min.js
76
+ *
77
+ * Copyright (c) Facebook, Inc. and its affiliates.
78
+ *
79
+ * This source code is licensed under the MIT license found in the
80
+ * LICENSE file in the root directory of this source tree.
81
+ */var pc;function Fb(){if(pc)return Be;pc=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,i=e?Symbol.for("react.fragment"):60107,a=e?Symbol.for("react.strict_mode"):60108,s=e?Symbol.for("react.profiler"):60114,c=e?Symbol.for("react.provider"):60109,d=e?Symbol.for("react.context"):60110,p=e?Symbol.for("react.async_mode"):60111,m=e?Symbol.for("react.concurrent_mode"):60111,x=e?Symbol.for("react.forward_ref"):60112,b=e?Symbol.for("react.suspense"):60113,S=e?Symbol.for("react.suspense_list"):60120,R=e?Symbol.for("react.memo"):60115,P=e?Symbol.for("react.lazy"):60116,_=e?Symbol.for("react.block"):60121,L=e?Symbol.for("react.fundamental"):60117,M=e?Symbol.for("react.responder"):60118,H=e?Symbol.for("react.scope"):60119;function G(A){if(typeof A=="object"&&A!==null){var q=A.$$typeof;switch(q){case t:switch(A=A.type,A){case p:case m:case i:case s:case a:case b:return A;default:switch(A=A&&A.$$typeof,A){case d:case x:case P:case R:case c:return A;default:return q}}case r:return q}}}function W(A){return G(A)===m}return Be.AsyncMode=p,Be.ConcurrentMode=m,Be.ContextConsumer=d,Be.ContextProvider=c,Be.Element=t,Be.ForwardRef=x,Be.Fragment=i,Be.Lazy=P,Be.Memo=R,Be.Portal=r,Be.Profiler=s,Be.StrictMode=a,Be.Suspense=b,Be.isAsyncMode=function(A){return W(A)||G(A)===p},Be.isConcurrentMode=W,Be.isContextConsumer=function(A){return G(A)===d},Be.isContextProvider=function(A){return G(A)===c},Be.isElement=function(A){return typeof A=="object"&&A!==null&&A.$$typeof===t},Be.isForwardRef=function(A){return G(A)===x},Be.isFragment=function(A){return G(A)===i},Be.isLazy=function(A){return G(A)===P},Be.isMemo=function(A){return G(A)===R},Be.isPortal=function(A){return G(A)===r},Be.isProfiler=function(A){return G(A)===s},Be.isStrictMode=function(A){return G(A)===a},Be.isSuspense=function(A){return G(A)===b},Be.isValidElementType=function(A){return typeof A=="string"||typeof A=="function"||A===i||A===m||A===s||A===a||A===b||A===S||typeof A=="object"&&A!==null&&(A.$$typeof===P||A.$$typeof===R||A.$$typeof===c||A.$$typeof===d||A.$$typeof===x||A.$$typeof===L||A.$$typeof===M||A.$$typeof===H||A.$$typeof===_)},Be.typeOf=G,Be}var qe={};/** @license React v16.13.1
82
+ * react-is.development.js
83
+ *
84
+ * Copyright (c) Facebook, Inc. and its affiliates.
85
+ *
86
+ * This source code is licensed under the MIT license found in the
87
+ * LICENSE file in the root directory of this source tree.
88
+ */var mc;function Mb(){return mc||(mc=1,process.env.NODE_ENV!=="production"&&(function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,i=e?Symbol.for("react.fragment"):60107,a=e?Symbol.for("react.strict_mode"):60108,s=e?Symbol.for("react.profiler"):60114,c=e?Symbol.for("react.provider"):60109,d=e?Symbol.for("react.context"):60110,p=e?Symbol.for("react.async_mode"):60111,m=e?Symbol.for("react.concurrent_mode"):60111,x=e?Symbol.for("react.forward_ref"):60112,b=e?Symbol.for("react.suspense"):60113,S=e?Symbol.for("react.suspense_list"):60120,R=e?Symbol.for("react.memo"):60115,P=e?Symbol.for("react.lazy"):60116,_=e?Symbol.for("react.block"):60121,L=e?Symbol.for("react.fundamental"):60117,M=e?Symbol.for("react.responder"):60118,H=e?Symbol.for("react.scope"):60119;function G(N){return typeof N=="string"||typeof N=="function"||N===i||N===m||N===s||N===a||N===b||N===S||typeof N=="object"&&N!==null&&(N.$$typeof===P||N.$$typeof===R||N.$$typeof===c||N.$$typeof===d||N.$$typeof===x||N.$$typeof===L||N.$$typeof===M||N.$$typeof===H||N.$$typeof===_)}function W(N){if(typeof N=="object"&&N!==null){var et=N.$$typeof;switch(et){case t:var xt=N.type;switch(xt){case p:case m:case i:case s:case a:case b:return xt;default:var gt=xt&&xt.$$typeof;switch(gt){case d:case x:case P:case R:case c:return gt;default:return et}}case r:return et}}}var A=p,q=m,X=d,ie=c,ye=t,Ge=x,ve=i,v=P,ee=R,te=r,ge=s,Te=a,We=b,Ke=!1;function lt(N){return Ke||(Ke=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),J(N)||W(N)===p}function J(N){return W(N)===m}function ce(N){return W(N)===d}function be(N){return W(N)===c}function Oe(N){return typeof N=="object"&&N!==null&&N.$$typeof===t}function xe(N){return W(N)===x}function Ce(N){return W(N)===i}function Ee(N){return W(N)===P}function we(N){return W(N)===R}function Ae(N){return W(N)===r}function ke(N){return W(N)===s}function re(N){return W(N)===a}function Qe(N){return W(N)===b}qe.AsyncMode=A,qe.ConcurrentMode=q,qe.ContextConsumer=X,qe.ContextProvider=ie,qe.Element=ye,qe.ForwardRef=Ge,qe.Fragment=ve,qe.Lazy=v,qe.Memo=ee,qe.Portal=te,qe.Profiler=ge,qe.StrictMode=Te,qe.Suspense=We,qe.isAsyncMode=lt,qe.isConcurrentMode=J,qe.isContextConsumer=ce,qe.isContextProvider=be,qe.isElement=Oe,qe.isForwardRef=xe,qe.isFragment=Ce,qe.isLazy=Ee,qe.isMemo=we,qe.isPortal=Ae,qe.isProfiler=ke,qe.isStrictMode=re,qe.isSuspense=Qe,qe.isValidElementType=G,qe.typeOf=W})()),qe}var yc;function Nb(){return yc||(yc=1,process.env.NODE_ENV==="production"?ci.exports=Fb():ci.exports=Mb()),ci.exports}var Lo,gc;function Bb(){if(gc)return Lo;gc=1;var e=Nb(),t={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},r={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},i={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};s[e.ForwardRef]=i,s[e.Memo]=a;function c(P){return e.isMemo(P)?a:s[P.$$typeof]||t}var d=Object.defineProperty,p=Object.getOwnPropertyNames,m=Object.getOwnPropertySymbols,x=Object.getOwnPropertyDescriptor,b=Object.getPrototypeOf,S=Object.prototype;function R(P,_,L){if(typeof _!="string"){if(S){var M=b(_);M&&M!==S&&R(P,M,L)}var H=p(_);m&&(H=H.concat(m(_)));for(var G=c(P),W=c(_),A=0;A<H.length;++A){var q=H[A];if(!r[q]&&!(L&&L[q])&&!(W&&W[q])&&!(G&&G[q])){var X=x(_,q);try{d(P,q,X)}catch{}}}}return P}return Lo=R,Lo}Bb();function ht(){return ht=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},ht.apply(this,arguments)}function jf(e,t){if(e==null)return{};var r={},i=Object.keys(e),a,s;for(s=0;s<i.length;s++)a=i[s],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}var Li=Y.createContext(void 0);Li.displayName="FormikContext";Li.Provider;Li.Consumer;function qb(){var e=Y.useContext(Li);return e||(process.env.NODE_ENV!=="production"?Xr(!1,"Formik context is undefined, please verify you are calling useFormikContext() as child of a <Formik> component."):Xr()),e}var At=function(t){return typeof t=="function"},Vi=function(t){return t!==null&&typeof t=="object"},Lb=function(t){return String(Math.floor(Number(t)))===t},Vo=function(t){return Object.prototype.toString.call(t)==="[object String]"},Ko=function(t){return Vi(t)&&At(t.then)};function Vb(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}}function _t(e,t,r,i){i===void 0&&(i=0);for(var a=Af(t);e&&i<a.length;)e=e[a[i++]];return i!==a.length&&!e||e===void 0?r:e}function Er(e,t,r){for(var i=fc(e),a=i,s=0,c=Af(t);s<c.length-1;s++){var d=c[s],p=_t(e,c.slice(0,s+1));if(p&&(Vi(p)||Array.isArray(p)))a=a[d]=fc(p);else{var m=c[s+1];a=a[d]=Lb(m)&&Number(m)>=0?[]:{}}}return(s===0?e:a)[c[s]]===r?e:(r===void 0?delete a[c[s]]:a[c[s]]=r,s===0&&r===void 0&&delete i[c[s]],i)}function $f(e,t,r,i){r===void 0&&(r=new WeakMap),i===void 0&&(i={});for(var a=0,s=Object.keys(e);a<s.length;a++){var c=s[a],d=e[c];Vi(d)?r.get(d)||(r.set(d,!0),i[c]=Array.isArray(d)?[]:{},$f(d,t,r,i[c])):i[c]=t}return i}function Kb(e,t){switch(t.type){case"SET_VALUES":return ht({},e,{values:t.payload});case"SET_TOUCHED":return ht({},e,{touched:t.payload});case"SET_ERRORS":return _r(e.errors,t.payload)?e:ht({},e,{errors:t.payload});case"SET_STATUS":return ht({},e,{status:t.payload});case"SET_ISSUBMITTING":return ht({},e,{isSubmitting:t.payload});case"SET_ISVALIDATING":return ht({},e,{isValidating:t.payload});case"SET_FIELD_VALUE":return ht({},e,{values:Er(e.values,t.payload.field,t.payload.value)});case"SET_FIELD_TOUCHED":return ht({},e,{touched:Er(e.touched,t.payload.field,t.payload.value)});case"SET_FIELD_ERROR":return ht({},e,{errors:Er(e.errors,t.payload.field,t.payload.value)});case"RESET_FORM":return ht({},e,t.payload);case"SET_FORMIK_STATE":return t.payload(e);case"SUBMIT_ATTEMPT":return ht({},e,{touched:$f(e.values,!0),isSubmitting:!0,submitCount:e.submitCount+1});case"SUBMIT_FAILURE":return ht({},e,{isSubmitting:!1});case"SUBMIT_SUCCESS":return ht({},e,{isSubmitting:!1});default:return e}}var br={},li={};function zb(e){var t=e.validateOnChange,r=t===void 0?!0:t,i=e.validateOnBlur,a=i===void 0?!0:i,s=e.validateOnMount,c=s===void 0?!1:s,d=e.isInitialValid,p=e.enableReinitialize,m=p===void 0?!1:p,x=e.onSubmit,b=jf(e,["validateOnChange","validateOnBlur","validateOnMount","isInitialValid","enableReinitialize","onSubmit"]),S=ht({validateOnChange:r,validateOnBlur:a,validateOnMount:c,onSubmit:x},b),R=Y.useRef(S.initialValues),P=Y.useRef(S.initialErrors||br),_=Y.useRef(S.initialTouched||li),L=Y.useRef(S.initialStatus),M=Y.useRef(!1),H=Y.useRef({});process.env.NODE_ENV!=="production"&&Y.useEffect(function(){typeof d>"u"||(process.env.NODE_ENV!=="production"?Xr(!1,"isInitialValid has been deprecated and will be removed in future versions of Formik. Please use initialErrors or validateOnMount instead."):Xr())},[]),Y.useEffect(function(){return M.current=!0,function(){M.current=!1}},[]);var G=Y.useState(0),W=G[1],A=Y.useRef({values:ui(S.initialValues),errors:ui(S.initialErrors)||br,touched:ui(S.initialTouched)||li,status:ui(S.initialStatus),isSubmitting:!1,isValidating:!1,submitCount:0}),q=A.current,X=Y.useCallback(function(V){var se=A.current;A.current=Kb(se,V),se!==A.current&&W(function(he){return he+1})},[]),ie=Y.useCallback(function(V,se){return new Promise(function(he,pe){var _e=S.validate(V,se);_e==null?he(br):Ko(_e)?_e.then(function(je){he(je||br)},function(je){process.env.NODE_ENV!=="production"&&console.warn("Warning: An unhandled error was caught during validation in <Formik validate />",je),pe(je)}):he(_e)})},[S.validate]),ye=Y.useCallback(function(V,se){var he=S.validationSchema,pe=At(he)?he(se):he,_e=se&&pe.validateAt?pe.validateAt(se,V):Gb(V,pe);return new Promise(function(je,rt){_e.then(function(){je(br)},function(pt){pt.name==="ValidationError"?je(Ub(pt)):(process.env.NODE_ENV!=="production"&&console.warn("Warning: An unhandled error was caught during validation in <Formik validationSchema />",pt),rt(pt))})})},[S.validationSchema]),Ge=Y.useCallback(function(V,se){return new Promise(function(he){return he(H.current[V].validate(se))})},[]),ve=Y.useCallback(function(V){var se=Object.keys(H.current).filter(function(pe){return At(H.current[pe].validate)}),he=se.length>0?se.map(function(pe){return Ge(pe,_t(V,pe))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(he).then(function(pe){return pe.reduce(function(_e,je,rt){return je==="DO_NOT_DELETE_YOU_WILL_BE_FIRED"||je&&(_e=Er(_e,se[rt],je)),_e},{})})},[Ge]),v=Y.useCallback(function(V){return Promise.all([ve(V),S.validationSchema?ye(V):{},S.validate?ie(V):{}]).then(function(se){var he=se[0],pe=se[1],_e=se[2],je=Ja.all([he,pe,_e],{arrayMerge:Wb});return je})},[S.validate,S.validationSchema,ve,ie,ye]),ee=Ot(function(V){return V===void 0&&(V=q.values),X({type:"SET_ISVALIDATING",payload:!0}),v(V).then(function(se){return M.current&&(X({type:"SET_ISVALIDATING",payload:!1}),X({type:"SET_ERRORS",payload:se})),se})});Y.useEffect(function(){c&&M.current===!0&&_r(R.current,S.initialValues)&&ee(R.current)},[c,ee]);var te=Y.useCallback(function(V){var se=V&&V.values?V.values:R.current,he=V&&V.errors?V.errors:P.current?P.current:S.initialErrors||{},pe=V&&V.touched?V.touched:_.current?_.current:S.initialTouched||{},_e=V&&V.status?V.status:L.current?L.current:S.initialStatus;R.current=se,P.current=he,_.current=pe,L.current=_e;var je=function(){X({type:"RESET_FORM",payload:{isSubmitting:!!V&&!!V.isSubmitting,errors:he,touched:pe,status:_e,values:se,isValidating:!!V&&!!V.isValidating,submitCount:V&&V.submitCount&&typeof V.submitCount=="number"?V.submitCount:0}})};if(S.onReset){var rt=S.onReset(q.values,et);Ko(rt)?rt.then(je):je()}else je()},[S.initialErrors,S.initialStatus,S.initialTouched,S.onReset]);Y.useEffect(function(){M.current===!0&&!_r(R.current,S.initialValues)&&m&&(R.current=S.initialValues,te(),c&&ee(R.current))},[m,S.initialValues,te,c,ee]),Y.useEffect(function(){m&&M.current===!0&&!_r(P.current,S.initialErrors)&&(P.current=S.initialErrors||br,X({type:"SET_ERRORS",payload:S.initialErrors||br}))},[m,S.initialErrors]),Y.useEffect(function(){m&&M.current===!0&&!_r(_.current,S.initialTouched)&&(_.current=S.initialTouched||li,X({type:"SET_TOUCHED",payload:S.initialTouched||li}))},[m,S.initialTouched]),Y.useEffect(function(){m&&M.current===!0&&!_r(L.current,S.initialStatus)&&(L.current=S.initialStatus,X({type:"SET_STATUS",payload:S.initialStatus}))},[m,S.initialStatus,S.initialTouched]);var ge=Ot(function(V){if(H.current[V]&&At(H.current[V].validate)){var se=_t(q.values,V),he=H.current[V].validate(se);return Ko(he)?(X({type:"SET_ISVALIDATING",payload:!0}),he.then(function(pe){return pe}).then(function(pe){X({type:"SET_FIELD_ERROR",payload:{field:V,value:pe}}),X({type:"SET_ISVALIDATING",payload:!1})})):(X({type:"SET_FIELD_ERROR",payload:{field:V,value:he}}),Promise.resolve(he))}else if(S.validationSchema)return X({type:"SET_ISVALIDATING",payload:!0}),ye(q.values,V).then(function(pe){return pe}).then(function(pe){X({type:"SET_FIELD_ERROR",payload:{field:V,value:_t(pe,V)}}),X({type:"SET_ISVALIDATING",payload:!1})});return Promise.resolve()}),Te=Y.useCallback(function(V,se){var he=se.validate;H.current[V]={validate:he}},[]),We=Y.useCallback(function(V){delete H.current[V]},[]),Ke=Ot(function(V,se){X({type:"SET_TOUCHED",payload:V});var he=se===void 0?a:se;return he?ee(q.values):Promise.resolve()}),lt=Y.useCallback(function(V){X({type:"SET_ERRORS",payload:V})},[]),J=Ot(function(V,se){var he=At(V)?V(q.values):V;X({type:"SET_VALUES",payload:he});var pe=se===void 0?r:se;return pe?ee(he):Promise.resolve()}),ce=Y.useCallback(function(V,se){X({type:"SET_FIELD_ERROR",payload:{field:V,value:se}})},[]),be=Ot(function(V,se,he){var pe=At(se)?se(_t(q.values,V)):se;X({type:"SET_FIELD_VALUE",payload:{field:V,value:pe}});var _e=he===void 0?r:he;return _e?ee(Er(q.values,V,pe)):Promise.resolve()}),Oe=Y.useCallback(function(V,se){var he=se,pe=V,_e;if(!Vo(V)){V.persist&&V.persist();var je=V.target?V.target:V.currentTarget,rt=je.type,pt=je.name,cr=je.id,Ht=je.value,qt=je.checked,Ir=je.outerHTML,Dr=je.options,Rt=je.multiple;he=se||pt||cr,!he&&process.env.NODE_ENV!=="production"&&vc({htmlContent:Ir,documentationAnchorLink:"handlechange-e-reactchangeeventany--void",handlerName:"handleChange"}),pe=/number|range/.test(rt)?(_e=parseFloat(Ht),isNaN(_e)?"":_e):/checkbox/.test(rt)?Hb(_t(q.values,he),qt,Ht):Dr&&Rt?Yb(Dr):Ht}he&&be(he,pe)},[be,q.values]),xe=Ot(function(V){if(Vo(V))return function(se){return Oe(se,V)};Oe(V)}),Ce=Ot(function(V,se,he){se===void 0&&(se=!0),X({type:"SET_FIELD_TOUCHED",payload:{field:V,value:se}});var pe=he===void 0?a:he;return pe?ee(q.values):Promise.resolve()}),Ee=Y.useCallback(function(V,se){V.persist&&V.persist();var he=V.target,pe=he.name,_e=he.id,je=he.outerHTML,rt=se||pe||_e;!rt&&process.env.NODE_ENV!=="production"&&vc({htmlContent:je,documentationAnchorLink:"handleblur-e-any--void",handlerName:"handleBlur"}),Ce(rt,!0)},[Ce]),we=Ot(function(V){if(Vo(V))return function(se){return Ee(se,V)};Ee(V)}),Ae=Y.useCallback(function(V){At(V)?X({type:"SET_FORMIK_STATE",payload:V}):X({type:"SET_FORMIK_STATE",payload:function(){return V}})},[]),ke=Y.useCallback(function(V){X({type:"SET_STATUS",payload:V})},[]),re=Y.useCallback(function(V){X({type:"SET_ISSUBMITTING",payload:V})},[]),Qe=Ot(function(){return X({type:"SUBMIT_ATTEMPT"}),ee().then(function(V){var se=V instanceof Error,he=!se&&Object.keys(V).length===0;if(he){var pe;try{if(pe=xt(),pe===void 0)return}catch(_e){throw _e}return Promise.resolve(pe).then(function(_e){return M.current&&X({type:"SUBMIT_SUCCESS"}),_e}).catch(function(_e){if(M.current)throw X({type:"SUBMIT_FAILURE"}),_e})}else if(M.current&&(X({type:"SUBMIT_FAILURE"}),se))throw V})}),N=Ot(function(V){if(V&&V.preventDefault&&At(V.preventDefault)&&V.preventDefault(),V&&V.stopPropagation&&At(V.stopPropagation)&&V.stopPropagation(),process.env.NODE_ENV!=="production"&&typeof document<"u"){var se=Vb();se!==null&&se instanceof HTMLButtonElement&&(se.attributes&&se.attributes.getNamedItem("type")||(process.env.NODE_ENV!=="production"?Xr(!1,'You submitted a Formik form using a button with an unspecified `type` attribute. Most browsers default button elements to `type="submit"`. If this is not a submit button, please add `type="button"`.'):Xr()))}Qe().catch(function(he){console.warn("Warning: An unhandled error was caught from submitForm()",he)})}),et={resetForm:te,validateForm:ee,validateField:ge,setErrors:lt,setFieldError:ce,setFieldTouched:Ce,setFieldValue:be,setStatus:ke,setSubmitting:re,setTouched:Ke,setValues:J,setFormikState:Ae,submitForm:Qe},xt=Ot(function(){return x(q.values,et)}),gt=Ot(function(V){V&&V.preventDefault&&At(V.preventDefault)&&V.preventDefault(),V&&V.stopPropagation&&At(V.stopPropagation)&&V.stopPropagation(),te()}),Wi=Y.useCallback(function(V){return{value:_t(q.values,V),error:_t(q.errors,V),touched:!!_t(q.touched,V),initialValue:_t(R.current,V),initialTouched:!!_t(_.current,V),initialError:_t(P.current,V)}},[q.errors,q.touched,q.values]),Yi=Y.useCallback(function(V){return{setValue:function(he,pe){return be(V,he,pe)},setTouched:function(he,pe){return Ce(V,he,pe)},setError:function(he){return ce(V,he)}}},[be,Ce,ce]),Hi=Y.useCallback(function(V){var se=Vi(V),he=se?V.name:V,pe=_t(q.values,he),_e={name:he,value:pe,onChange:xe,onBlur:we};if(se){var je=V.type,rt=V.value,pt=V.as,cr=V.multiple;je==="checkbox"?rt===void 0?_e.checked=!!pe:(_e.checked=!!(Array.isArray(pe)&&~pe.indexOf(rt)),_e.value=rt):je==="radio"?(_e.checked=pe===rt,_e.value=rt):pt==="select"&&cr&&(_e.value=_e.value||[],_e.multiple=!0)}return _e},[we,xe,q.values]),on=Y.useMemo(function(){return!_r(R.current,q.values)},[R.current,q.values]),an=Y.useMemo(function(){return typeof d<"u"?on?q.errors&&Object.keys(q.errors).length===0:d!==!1&&At(d)?d(S):d:q.errors&&Object.keys(q.errors).length===0},[d,on,q.errors,S]),Tt=ht({},q,{initialValues:R.current,initialErrors:P.current,initialTouched:_.current,initialStatus:L.current,handleBlur:we,handleChange:xe,handleReset:gt,handleSubmit:N,resetForm:te,setErrors:lt,setFormikState:Ae,setFieldTouched:Ce,setFieldValue:be,setFieldError:ce,setStatus:ke,setSubmitting:re,setTouched:Ke,setValues:J,submitForm:Qe,validateForm:ee,validateField:ge,isValid:an,dirty:on,unregisterField:We,registerField:Te,getFieldProps:Hi,getFieldMeta:Wi,getFieldHelpers:Yi,validateOnBlur:a,validateOnChange:r,validateOnMount:c});return Tt}function vc(e){var t=e.htmlContent,r=e.documentationAnchorLink,i=e.handlerName;console.warn("Warning: Formik called `"+i+"`, but you forgot to pass an `id` or `name` attribute to your input:\n "+t+`
75
89
  Formik cannot determine which value to update. For more info see https://formik.org/docs/api/formik#`+r+`
76
- `)}function Fb(e){var t={};if(e.inner){if(e.inner.length===0)return wr(t,e.path,e.message);for(var a=e.inner,r=Array.isArray(a),i=0,a=r?a:a[Symbol.iterator]();;){var s;if(r){if(i>=a.length)break;s=a[i++]}else{if(i=a.next(),i.done)break;s=i.value}var c=s;gt(t,c.path)||(t=wr(t,c.path,c.message))}}return t}function Mb(e,t,r,i){r===void 0&&(r=!1);var a=Za(e);return t[r?"validateSync":"validate"](a,{abortEarly:!1,context:a})}function Za(e){var t=Array.isArray(e)?[]:{};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var i=String(r);Array.isArray(e[i])===!0?t[i]=e[i].map(function(a){return Array.isArray(a)===!0||qu(a)?Za(a):a!==""?a:void 0}):qu(e[i])?t[i]=Za(e[i]):t[i]=e[i]!==""?e[i]:void 0}return t}function Nb(e,t,r){var i=e.slice();return t.forEach(function(s,c){if(typeof i[c]>"u"){var d=r.clone!==!1,p=d&&r.isMergeableObject(s);i[c]=p?Wa(Array.isArray(s)?[]:{},s,r):s}else r.isMergeableObject(s)?i[c]=Wa(e[c],s,r):e.indexOf(s)===-1&&i.push(s)}),i}function Bb(e){return Array.from(e).filter(function(t){return t.selected}).map(function(t){return t.value})}function qb(e,t,r){if(typeof e=="boolean")return!!t;var i=[],a=!1,s=-1;if(Array.isArray(e))i=e,s=e.indexOf(r),a=s>=0;else if(!r||r=="true"||r=="false")return!!t;return t&&r&&!a?i.concat(r):a?i.slice(0,s).concat(i.slice(s+1)):i}var Lb=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?U.useLayoutEffect:U.useEffect;function Tt(e){var t=U.useRef(e);return Lb(function(){t.current=e}),U.useCallback(function(){for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return t.current.apply(void 0,i)},[])}var Kb=U.forwardRef(function(e,t){var r=e.action,i=Sf(e,["action"]),a=r??"#",s=$b(),c=s.handleReset,d=s.handleSubmit;return U.createElement("form",lt({onSubmit:d,ref:t,onReset:c,action:a},i))});Kb.displayName="Form";var Lo,pc;function Vb(){if(pc)return Lo;pc=1;function e(M){this._maxSize=M,this.clear()}e.prototype.clear=function(){this._size=0,this._values=Object.create(null)},e.prototype.get=function(M){return this._values[M]},e.prototype.set=function(M,W){return this._size>=this._maxSize&&this.clear(),M in this._values||this._size++,this._values[M]=W};var t=/[^.^\]^[]+|(?=\[\]|\.\.)/g,r=/^\d+$/,i=/^\d/,a=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,s=/^\s*(['"]?)(.*?)(\1)\s*$/,c=512,d=new e(c),p=new e(c),m=new e(c);Lo={Cache:e,split:_,normalizePath:x,setter:function(M){var W=x(M);return p.get(M)||p.set(M,function(X,L){for(var N=0,Z=W.length,ae=X;N<Z-1;){var ye=W[N];if(ye==="__proto__"||ye==="constructor"||ye==="prototype")return X;ae=ae[W[N++]]}ae[W[N]]=L})},getter:function(M,W){var G=x(M);return m.get(M)||m.set(M,function(L){for(var N=0,Z=G.length;N<Z;)if(L!=null||!W)L=L[G[N++]];else return;return L})},join:function(M){return M.reduce(function(W,G){return W+(R(G)||r.test(G)?"["+G+"]":(W?".":"")+G)},"")},forEach:function(M,W,G){w(Array.isArray(M)?M:_(M),W,G)}};function x(M){return d.get(M)||d.set(M,_(M).map(function(W){return W.replace(s,"$2")}))}function _(M){return M.match(t)||[""]}function w(M,W,G){var X=M.length,L,N,Z,ae;for(N=0;N<X;N++)L=M[N],L&&(q(L)&&(L='"'+L+'"'),ae=R(L),Z=!ae&&/^\d+$/.test(L),W.call(G,L,ae,Z,N,M))}function R(M){return typeof M=="string"&&M&&["'",'"'].indexOf(M.charAt(0))!==-1}function I(M){return M.match(i)&&!M.match(r)}function b(M){return a.test(M)}function q(M){return!R(M)&&(I(M)||b(M))}return Lo}var Sr=Vb(),Ko,mc;function zb(){if(mc)return Ko;mc=1;const e=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,t=x=>x.match(e)||[],r=x=>x[0].toUpperCase()+x.slice(1),i=(x,_)=>t(x).join(_).toLowerCase(),a=x=>t(x).reduce((_,w)=>`${_}${_?w[0].toUpperCase()+w.slice(1).toLowerCase():w.toLowerCase()}`,"");return Ko={words:t,upperFirst:r,camelCase:a,pascalCase:x=>r(a(x)),snakeCase:x=>i(x,"_"),kebabCase:x=>i(x,"-"),sentenceCase:x=>r(i(x," ")),titleCase:x=>t(x).map(r).join(" ")},Ko}var Vo=zb(),ui={exports:{}},yc;function Ub(){if(yc)return ui.exports;yc=1,ui.exports=function(a){return e(t(a),a)},ui.exports.array=e;function e(a,s){var c=a.length,d=new Array(c),p={},m=c,x=r(s),_=i(a);for(s.forEach(function(R){if(!_.has(R[0])||!_.has(R[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});m--;)p[m]||w(a[m],m,new Set);return d;function w(R,I,b){if(b.has(R)){var q;try{q=", node was:"+JSON.stringify(R)}catch{q=""}throw new Error("Cyclic dependency"+q)}if(!_.has(R))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(R));if(!p[I]){p[I]=!0;var M=x.get(R)||new Set;if(M=Array.from(M),I=M.length){b.add(R);do{var W=M[--I];w(W,_.get(W),b)}while(I);b.delete(R)}d[--c]=R}}}function t(a){for(var s=new Set,c=0,d=a.length;c<d;c++){var p=a[c];s.add(p[0]),s.add(p[1])}return Array.from(s)}function r(a){for(var s=new Map,c=0,d=a.length;c<d;c++){var p=a[c];s.has(p[0])||s.set(p[0],new Set),s.has(p[1])||s.set(p[1],new Set),s.get(p[0]).add(p[1])}return s}function i(a){for(var s=new Map,c=0,d=a.length;c<d;c++)s.set(a[c],c);return s}return ui.exports}var Gb=Ub();const Wb=An(Gb),Hb=Object.prototype.toString,Yb=Error.prototype.toString,Jb=RegExp.prototype.toString,Xb=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",Zb=/^Symbol\((.*)\)(.*)$/;function Qb(e){return e!=+e?"NaN":e===0&&1/e<0?"-0":""+e}function gc(e,t=!1){if(e==null||e===!0||e===!1)return""+e;const r=typeof e;if(r==="number")return Qb(e);if(r==="string")return t?`"${e}"`:e;if(r==="function")return"[Function "+(e.name||"anonymous")+"]";if(r==="symbol")return Xb.call(e).replace(Zb,"Symbol($1)");const i=Hb.call(e).slice(8,-1);return i==="Date"?isNaN(e.getTime())?""+e:e.toISOString(e):i==="Error"||e instanceof Error?"["+Yb.call(e)+"]":i==="RegExp"?Jb.call(e):null}function rr(e,t){let r=gc(e,t);return r!==null?r:JSON.stringify(e,function(i,a){let s=gc(this[i],t);return s!==null?s:a},2)}function Ef(e){return e==null?[]:[].concat(e)}let Cf,Of,Af,e0=/\$\{\s*(\w+)\s*\}/g;Cf=Symbol.toStringTag;class vc{constructor(t,r,i,a){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[Cf]="Error",this.name="ValidationError",this.value=r,this.path=i,this.type=a,this.errors=[],this.inner=[],Ef(t).forEach(s=>{if(mt.isError(s)){this.errors.push(...s.errors);const c=s.inner.length?s.inner:[s];this.inner.push(...c)}else this.errors.push(s)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}Of=Symbol.hasInstance;Af=Symbol.toStringTag;class mt extends Error{static formatError(t,r){const i=r.label||r.path||"this";return r=Object.assign({},r,{path:i,originalPath:r.path}),typeof t=="string"?t.replace(e0,(a,s)=>rr(r[s])):typeof t=="function"?t(r):t}static isError(t){return t&&t.name==="ValidationError"}constructor(t,r,i,a,s){const c=new vc(t,r,i,a);if(s)return c;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[Af]="Error",this.name=c.name,this.message=c.message,this.type=c.type,this.value=c.value,this.path=c.path,this.errors=c.errors,this.inner=c.inner,Error.captureStackTrace&&Error.captureStackTrace(this,mt)}static[Of](t){return vc[Symbol.hasInstance](t)||super[Symbol.hasInstance](t)}}let Rt={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:e,type:t,value:r,originalValue:i})=>{const a=i!=null&&i!==r?` (cast from the value \`${rr(i,!0)}\`).`:".";return t!=="mixed"?`${e} must be a \`${t}\` type, but the final value was: \`${rr(r,!0)}\``+a:`${e} must match the configured type. The validated value was: \`${rr(r,!0)}\``+a}},yt={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},t0={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},Qa={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},r0={isValue:"${path} field must be ${value}"},fi={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},n0={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},i0={notType:e=>{const{path:t,value:r,spec:i}=e,a=i.types.length;if(Array.isArray(r)){if(r.length<a)return`${t} tuple value has too few items, expected a length of ${a} but got ${r.length} for value: \`${rr(r,!0)}\``;if(r.length>a)return`${t} tuple value has too many items, expected a length of ${a} but got ${r.length} for value: \`${rr(r,!0)}\``}return mt.formatError(Rt.notType,e)}};Object.assign(Object.create(null),{mixed:Rt,string:yt,number:t0,date:Qa,object:fi,array:n0,boolean:r0,tuple:i0});const _s=e=>e&&e.__isYupSchema__;class _i{static fromOptions(t,r){if(!r.then&&!r.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:i,then:a,otherwise:s}=r,c=typeof i=="function"?i:(...d)=>d.every(p=>p===i);return new _i(t,(d,p)=>{var m;let x=c(...d)?a:s;return(m=x==null?void 0:x(p))!=null?m:p})}constructor(t,r){this.fn=void 0,this.refs=t,this.refs=t,this.fn=r}resolve(t,r){let i=this.refs.map(s=>s.getValue(r==null?void 0:r.value,r==null?void 0:r.parent,r==null?void 0:r.context)),a=this.fn(i,t,r);if(a===void 0||a===t)return t;if(!_s(a))throw new TypeError("conditions must return a schema object");return a.resolve(r)}}const ci={context:"$",value:"."};class $r{constructor(t,r={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof t!="string")throw new TypeError("ref must be a string, got: "+t);if(this.key=t.trim(),t==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===ci.context,this.isValue=this.key[0]===ci.value,this.isSibling=!this.isContext&&!this.isValue;let i=this.isContext?ci.context:this.isValue?ci.value:"";this.path=this.key.slice(i.length),this.getter=this.path&&Sr.getter(this.path,!0),this.map=r.map}getValue(t,r,i){let a=this.isContext?i:this.isValue?t:r;return this.getter&&(a=this.getter(a||{})),this.map&&(a=this.map(a)),a}cast(t,r){return this.getValue(t,r==null?void 0:r.parent,r==null?void 0:r.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(t){return t&&t.__isYupRef}}$r.prototype.__isYupRef=!0;const _r=e=>e==null;function Hr(e){function t({value:r,path:i="",options:a,originalValue:s,schema:c},d,p){const{name:m,test:x,params:_,message:w,skipAbsent:R}=e;let{parent:I,context:b,abortEarly:q=c.spec.abortEarly,disableStackTrace:M=c.spec.disableStackTrace}=a;const W={value:r,parent:I,context:b};function G(be={}){const v=jf(Object.assign({value:r,originalValue:s,label:c.spec.label,path:be.path||i,spec:c.spec,disableStackTrace:be.disableStackTrace||M},_,be.params),W),ee=new mt(mt.formatError(be.message||w,v),r,v.path,be.type||m,v.disableStackTrace);return ee.params=v,ee}const X=q?d:p;let L={path:i,parent:I,type:m,from:a.from,createError:G,resolve(be){return kf(be,W)},options:a,originalValue:s,schema:c};const N=be=>{mt.isError(be)?X(be):be?p(null):X(G())},Z=be=>{mt.isError(be)?X(be):d(be)};if(R&&_r(r))return N(!0);let ye;try{var We;if(ye=x.call(L,r,L),typeof((We=ye)==null?void 0:We.then)=="function"){if(a.sync)throw new Error(`Validation test of type: "${L.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(ye).then(N,Z)}}catch(be){Z(be);return}N(ye)}return t.OPTIONS=e,t}function jf(e,t){if(!e)return e;for(const r of Object.keys(e))e[r]=kf(e[r],t);return e}function kf(e,t){return $r.isRef(e)?e.getValue(t.value,t.parent,t.context):e}function o0(e,t,r,i=r){let a,s,c;return t?(Sr.forEach(t,(d,p,m)=>{let x=p?d.slice(1,d.length-1):d;e=e.resolve({context:i,parent:a,value:r});let _=e.type==="tuple",w=m?parseInt(x,10):0;if(e.innerType||_){if(_&&!m)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${c}" must contain an index to the tuple element, e.g. "${c}[0]"`);if(r&&w>=r.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${d}, in the path: ${t}. because there is no value at that index. `);a=r,r=r&&r[w],e=_?e.spec.types[w]:e.innerType}if(!m){if(!e.fields||!e.fields[x])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${c} which is a type: "${e.type}")`);a=r,r=r&&r[x],e=e.fields[x]}s=x,c=p?"["+d+"]":"."+d}),{schema:e,parent:a,parentPath:s}):{parent:a,parentPath:t,schema:e}}class xi extends Set{describe(){const t=[];for(const r of this.values())t.push($r.isRef(r)?r.describe():r);return t}resolveAll(t){let r=[];for(const i of this.values())r.push(t(i));return r}clone(){return new xi(this.values())}merge(t,r){const i=this.clone();return t.forEach(a=>i.add(a)),r.forEach(a=>i.delete(a)),i}}function Jr(e,t=new Map){if(_s(e)||!e||typeof e!="object")return e;if(t.has(e))return t.get(e);let r;if(e instanceof Date)r=new Date(e.getTime()),t.set(e,r);else if(e instanceof RegExp)r=new RegExp(e),t.set(e,r);else if(Array.isArray(e)){r=new Array(e.length),t.set(e,r);for(let i=0;i<e.length;i++)r[i]=Jr(e[i],t)}else if(e instanceof Map){r=new Map,t.set(e,r);for(const[i,a]of e.entries())r.set(i,Jr(a,t))}else if(e instanceof Set){r=new Set,t.set(e,r);for(const i of e)r.add(Jr(i,t))}else if(e instanceof Object){r={},t.set(e,r);for(const[i,a]of Object.entries(e))r[i]=Jr(a,t)}else throw Error(`Unable to clone ${e}`);return r}function a0(e){if(!(e!=null&&e.length))return;const t=[];let r="",i=!1,a=!1;for(let s=0;s<e.length;s++){const c=e[s];if(c==="["&&!a){r&&(t.push(...r.split(".").filter(Boolean)),r=""),i=!0;continue}if(c==="]"&&!a){r&&(/^\d+$/.test(r)?t.push(r):t.push(r.replace(/^"|"$/g,"")),r=""),i=!1;continue}if(c==='"'){a=!a;continue}if(c==="."&&!i&&!a){r&&(t.push(r),r="");continue}r+=c}return r&&t.push(...r.split(".").filter(Boolean)),t}function s0(e,t){const r=t?`${t}.${e.path}`:e.path;return e.errors.map(i=>({message:i,path:a0(r)}))}function $f(e,t){var r;if(!((r=e.inner)!=null&&r.length)&&e.errors.length)return s0(e,t);const i=t?`${t}.${e.path}`:e.path;return e.inner.flatMap(a=>$f(a,i))}class Dt{constructor(t){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new xi,this._blacklist=new xi,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(Rt.notType)}),this.type=t.type,this._typeCheck=t.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},t==null?void 0:t.spec),this.withMutation(r=>{r.nonNullable()})}get _type(){return this.type}clone(t){if(this._mutate)return t&&Object.assign(this.spec,t),this;const r=Object.create(Object.getPrototypeOf(this));return r.type=this.type,r._typeCheck=this._typeCheck,r._whitelist=this._whitelist.clone(),r._blacklist=this._blacklist.clone(),r.internalTests=Object.assign({},this.internalTests),r.exclusiveTests=Object.assign({},this.exclusiveTests),r.deps=[...this.deps],r.conditions=[...this.conditions],r.tests=[...this.tests],r.transforms=[...this.transforms],r.spec=Jr(Object.assign({},this.spec,t)),r}label(t){let r=this.clone();return r.spec.label=t,r}meta(...t){if(t.length===0)return this.spec.meta;let r=this.clone();return r.spec.meta=Object.assign(r.spec.meta||{},t[0]),r}withMutation(t){let r=this._mutate;this._mutate=!0;let i=t(this);return this._mutate=r,i}concat(t){if(!t||t===this)return this;if(t.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${t.type}`);let r=this,i=t.clone();const a=Object.assign({},r.spec,i.spec);return i.spec=a,i.internalTests=Object.assign({},r.internalTests,i.internalTests),i._whitelist=r._whitelist.merge(t._whitelist,t._blacklist),i._blacklist=r._blacklist.merge(t._blacklist,t._whitelist),i.tests=r.tests,i.exclusiveTests=r.exclusiveTests,i.withMutation(s=>{t.tests.forEach(c=>{s.test(c.OPTIONS)})}),i.transforms=[...r.transforms,...i.transforms],i}isType(t){return t==null?!!(this.spec.nullable&&t===null||this.spec.optional&&t===void 0):this._typeCheck(t)}resolve(t){let r=this;if(r.conditions.length){let i=r.conditions;r=r.clone(),r.conditions=[],r=i.reduce((a,s)=>s.resolve(a,t),r),r=r.resolve(t)}return r}resolveOptions(t){var r,i,a,s;return Object.assign({},t,{from:t.from||[],strict:(r=t.strict)!=null?r:this.spec.strict,abortEarly:(i=t.abortEarly)!=null?i:this.spec.abortEarly,recursive:(a=t.recursive)!=null?a:this.spec.recursive,disableStackTrace:(s=t.disableStackTrace)!=null?s:this.spec.disableStackTrace})}cast(t,r={}){let i=this.resolve(Object.assign({},r,{value:t})),a=r.assert==="ignore-optionality",s=i._cast(t,r);if(r.assert!==!1&&!i.isType(s)){if(a&&_r(s))return s;let c=rr(t),d=rr(s);throw new TypeError(`The value of ${r.path||"field"} could not be cast to a value that satisfies the schema type: "${i.type}".
90
+ `)}function Ub(e){var t={};if(e.inner){if(e.inner.length===0)return Er(t,e.path,e.message);for(var a=e.inner,r=Array.isArray(a),i=0,a=r?a:a[Symbol.iterator]();;){var s;if(r){if(i>=a.length)break;s=a[i++]}else{if(i=a.next(),i.done)break;s=i.value}var c=s;_t(t,c.path)||(t=Er(t,c.path,c.message))}}return t}function Gb(e,t,r,i){r===void 0&&(r=!1);var a=ts(e);return t[r?"validateSync":"validate"](a,{abortEarly:!1,context:a})}function ts(e){var t=Array.isArray(e)?[]:{};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var i=String(r);Array.isArray(e[i])===!0?t[i]=e[i].map(function(a){return Array.isArray(a)===!0||Vu(a)?ts(a):a!==""?a:void 0}):Vu(e[i])?t[i]=ts(e[i]):t[i]=e[i]!==""?e[i]:void 0}return t}function Wb(e,t,r){var i=e.slice();return t.forEach(function(s,c){if(typeof i[c]>"u"){var d=r.clone!==!1,p=d&&r.isMergeableObject(s);i[c]=p?Ja(Array.isArray(s)?[]:{},s,r):s}else r.isMergeableObject(s)?i[c]=Ja(e[c],s,r):e.indexOf(s)===-1&&i.push(s)}),i}function Yb(e){return Array.from(e).filter(function(t){return t.selected}).map(function(t){return t.value})}function Hb(e,t,r){if(typeof e=="boolean")return!!t;var i=[],a=!1,s=-1;if(Array.isArray(e))i=e,s=e.indexOf(r),a=s>=0;else if(!r||r=="true"||r=="false")return!!t;return t&&r&&!a?i.concat(r):a?i.slice(0,s).concat(i.slice(s+1)):i}var Jb=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?Y.useLayoutEffect:Y.useEffect;function Ot(e){var t=Y.useRef(e);return Jb(function(){t.current=e}),Y.useCallback(function(){for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return t.current.apply(void 0,i)},[])}var Xb=Y.forwardRef(function(e,t){var r=e.action,i=jf(e,["action"]),a=r??"#",s=qb(),c=s.handleReset,d=s.handleSubmit;return Y.createElement("form",ht({onSubmit:d,ref:t,onReset:c,action:a},i))});Xb.displayName="Form";var zo,bc;function Zb(){if(bc)return zo;bc=1;function e(M){this._maxSize=M,this.clear()}e.prototype.clear=function(){this._size=0,this._values=Object.create(null)},e.prototype.get=function(M){return this._values[M]},e.prototype.set=function(M,H){return this._size>=this._maxSize&&this.clear(),M in this._values||this._size++,this._values[M]=H};var t=/[^.^\]^[]+|(?=\[\]|\.\.)/g,r=/^\d+$/,i=/^\d/,a=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,s=/^\s*(['"]?)(.*?)(\1)\s*$/,c=512,d=new e(c),p=new e(c),m=new e(c);zo={Cache:e,split:b,normalizePath:x,setter:function(M){var H=x(M);return p.get(M)||p.set(M,function(W,A){for(var q=0,X=H.length,ie=W;q<X-1;){var ye=H[q];if(ye==="__proto__"||ye==="constructor"||ye==="prototype")return W;ie=ie[H[q++]]}ie[H[q]]=A})},getter:function(M,H){var G=x(M);return m.get(M)||m.set(M,function(A){for(var q=0,X=G.length;q<X;)if(A!=null||!H)A=A[G[q++]];else return;return A})},join:function(M){return M.reduce(function(H,G){return H+(R(G)||r.test(G)?"["+G+"]":(H?".":"")+G)},"")},forEach:function(M,H,G){S(Array.isArray(M)?M:b(M),H,G)}};function x(M){return d.get(M)||d.set(M,b(M).map(function(H){return H.replace(s,"$2")}))}function b(M){return M.match(t)||[""]}function S(M,H,G){var W=M.length,A,q,X,ie;for(q=0;q<W;q++)A=M[q],A&&(L(A)&&(A='"'+A+'"'),ie=R(A),X=!ie&&/^\d+$/.test(A),H.call(G,A,ie,X,q,M))}function R(M){return typeof M=="string"&&M&&["'",'"'].indexOf(M.charAt(0))!==-1}function P(M){return M.match(i)&&!M.match(r)}function _(M){return a.test(M)}function L(M){return!R(M)&&(P(M)||_(M))}return zo}var Tr=Zb(),Uo,_c;function Qb(){if(_c)return Uo;_c=1;const e=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,t=x=>x.match(e)||[],r=x=>x[0].toUpperCase()+x.slice(1),i=(x,b)=>t(x).join(b).toLowerCase(),a=x=>t(x).reduce((b,S)=>`${b}${b?S[0].toUpperCase()+S.slice(1).toLowerCase():S.toLowerCase()}`,"");return Uo={words:t,upperFirst:r,camelCase:a,pascalCase:x=>r(a(x)),snakeCase:x=>i(x,"_"),kebabCase:x=>i(x,"-"),sentenceCase:x=>r(i(x," ")),titleCase:x=>t(x).map(r).join(" ")},Uo}var Go=Qb(),fi={exports:{}},xc;function e0(){if(xc)return fi.exports;xc=1,fi.exports=function(a){return e(t(a),a)},fi.exports.array=e;function e(a,s){var c=a.length,d=new Array(c),p={},m=c,x=r(s),b=i(a);for(s.forEach(function(R){if(!b.has(R[0])||!b.has(R[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});m--;)p[m]||S(a[m],m,new Set);return d;function S(R,P,_){if(_.has(R)){var L;try{L=", node was:"+JSON.stringify(R)}catch{L=""}throw new Error("Cyclic dependency"+L)}if(!b.has(R))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(R));if(!p[P]){p[P]=!0;var M=x.get(R)||new Set;if(M=Array.from(M),P=M.length){_.add(R);do{var H=M[--P];S(H,b.get(H),_)}while(P);_.delete(R)}d[--c]=R}}}function t(a){for(var s=new Set,c=0,d=a.length;c<d;c++){var p=a[c];s.add(p[0]),s.add(p[1])}return Array.from(s)}function r(a){for(var s=new Map,c=0,d=a.length;c<d;c++){var p=a[c];s.has(p[0])||s.set(p[0],new Set),s.has(p[1])||s.set(p[1],new Set),s.get(p[0]).add(p[1])}return s}function i(a){for(var s=new Map,c=0,d=a.length;c<d;c++)s.set(a[c],c);return s}return fi.exports}var t0=e0();const r0=$n(t0),n0=Object.prototype.toString,i0=Error.prototype.toString,o0=RegExp.prototype.toString,a0=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",s0=/^Symbol\((.*)\)(.*)$/;function u0(e){return e!=+e?"NaN":e===0&&1/e<0?"-0":""+e}function Sc(e,t=!1){if(e==null||e===!0||e===!1)return""+e;const r=typeof e;if(r==="number")return u0(e);if(r==="string")return t?`"${e}"`:e;if(r==="function")return"[Function "+(e.name||"anonymous")+"]";if(r==="symbol")return a0.call(e).replace(s0,"Symbol($1)");const i=n0.call(e).slice(8,-1);return i==="Date"?isNaN(e.getTime())?""+e:e.toISOString(e):i==="Error"||e instanceof Error?"["+i0.call(e)+"]":i==="RegExp"?o0.call(e):null}function nr(e,t){let r=Sc(e,t);return r!==null?r:JSON.stringify(e,function(i,a){let s=Sc(this[i],t);return s!==null?s:a},2)}function kf(e){return e==null?[]:[].concat(e)}let Pf,Rf,If,c0=/\$\{\s*(\w+)\s*\}/g;Pf=Symbol.toStringTag;class wc{constructor(t,r,i,a){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[Pf]="Error",this.name="ValidationError",this.value=r,this.path=i,this.type=a,this.errors=[],this.inner=[],kf(t).forEach(s=>{if(vt.isError(s)){this.errors.push(...s.errors);const c=s.inner.length?s.inner:[s];this.inner.push(...c)}else this.errors.push(s)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}Rf=Symbol.hasInstance;If=Symbol.toStringTag;class vt extends Error{static formatError(t,r){const i=r.label||r.path||"this";return r=Object.assign({},r,{path:i,originalPath:r.path}),typeof t=="string"?t.replace(c0,(a,s)=>nr(r[s])):typeof t=="function"?t(r):t}static isError(t){return t&&t.name==="ValidationError"}constructor(t,r,i,a,s){const c=new wc(t,r,i,a);if(s)return c;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[If]="Error",this.name=c.name,this.message=c.message,this.type=c.type,this.value=c.value,this.path=c.path,this.errors=c.errors,this.inner=c.inner,Error.captureStackTrace&&Error.captureStackTrace(this,vt)}static[Rf](t){return wc[Symbol.hasInstance](t)||super[Symbol.hasInstance](t)}}let Mt={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:e,type:t,value:r,originalValue:i})=>{const a=i!=null&&i!==r?` (cast from the value \`${nr(i,!0)}\`).`:".";return t!=="mixed"?`${e} must be a \`${t}\` type, but the final value was: \`${nr(r,!0)}\``+a:`${e} must match the configured type. The validated value was: \`${nr(r,!0)}\``+a}},bt={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},l0={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},rs={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},f0={isValue:"${path} field must be ${value}"},pi={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},d0={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},h0={notType:e=>{const{path:t,value:r,spec:i}=e,a=i.types.length;if(Array.isArray(r)){if(r.length<a)return`${t} tuple value has too few items, expected a length of ${a} but got ${r.length} for value: \`${nr(r,!0)}\``;if(r.length>a)return`${t} tuple value has too many items, expected a length of ${a} but got ${r.length} for value: \`${nr(r,!0)}\``}return vt.formatError(Mt.notType,e)}};Object.assign(Object.create(null),{mixed:Mt,string:bt,number:l0,date:rs,object:pi,array:d0,boolean:f0,tuple:h0});const Ss=e=>e&&e.__isYupSchema__;class wi{static fromOptions(t,r){if(!r.then&&!r.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:i,then:a,otherwise:s}=r,c=typeof i=="function"?i:(...d)=>d.every(p=>p===i);return new wi(t,(d,p)=>{var m;let x=c(...d)?a:s;return(m=x==null?void 0:x(p))!=null?m:p})}constructor(t,r){this.fn=void 0,this.refs=t,this.refs=t,this.fn=r}resolve(t,r){let i=this.refs.map(s=>s.getValue(r==null?void 0:r.value,r==null?void 0:r.parent,r==null?void 0:r.context)),a=this.fn(i,t,r);if(a===void 0||a===t)return t;if(!Ss(a))throw new TypeError("conditions must return a schema object");return a.resolve(r)}}const di={context:"$",value:"."};class Rr{constructor(t,r={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof t!="string")throw new TypeError("ref must be a string, got: "+t);if(this.key=t.trim(),t==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===di.context,this.isValue=this.key[0]===di.value,this.isSibling=!this.isContext&&!this.isValue;let i=this.isContext?di.context:this.isValue?di.value:"";this.path=this.key.slice(i.length),this.getter=this.path&&Tr.getter(this.path,!0),this.map=r.map}getValue(t,r,i){let a=this.isContext?i:this.isValue?t:r;return this.getter&&(a=this.getter(a||{})),this.map&&(a=this.map(a)),a}cast(t,r){return this.getValue(t,r==null?void 0:r.parent,r==null?void 0:r.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(t){return t&&t.__isYupRef}}Rr.prototype.__isYupRef=!0;const Sr=e=>e==null;function Jr(e){function t({value:r,path:i="",options:a,originalValue:s,schema:c},d,p){const{name:m,test:x,params:b,message:S,skipAbsent:R}=e;let{parent:P,context:_,abortEarly:L=c.spec.abortEarly,disableStackTrace:M=c.spec.disableStackTrace}=a;const H={value:r,parent:P,context:_};function G(ve={}){const v=Df(Object.assign({value:r,originalValue:s,label:c.spec.label,path:ve.path||i,spec:c.spec,disableStackTrace:ve.disableStackTrace||M},b,ve.params),H),ee=new vt(vt.formatError(ve.message||S,v),r,v.path,ve.type||m,v.disableStackTrace);return ee.params=v,ee}const W=L?d:p;let A={path:i,parent:P,type:m,from:a.from,createError:G,resolve(ve){return Ff(ve,H)},options:a,originalValue:s,schema:c};const q=ve=>{vt.isError(ve)?W(ve):ve?p(null):W(G())},X=ve=>{vt.isError(ve)?W(ve):d(ve)};if(R&&Sr(r))return q(!0);let ye;try{var Ge;if(ye=x.call(A,r,A),typeof((Ge=ye)==null?void 0:Ge.then)=="function"){if(a.sync)throw new Error(`Validation test of type: "${A.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(ye).then(q,X)}}catch(ve){X(ve);return}q(ye)}return t.OPTIONS=e,t}function Df(e,t){if(!e)return e;for(const r of Object.keys(e))e[r]=Ff(e[r],t);return e}function Ff(e,t){return Rr.isRef(e)?e.getValue(t.value,t.parent,t.context):e}function p0(e,t,r,i=r){let a,s,c;return t?(Tr.forEach(t,(d,p,m)=>{let x=p?d.slice(1,d.length-1):d;e=e.resolve({context:i,parent:a,value:r});let b=e.type==="tuple",S=m?parseInt(x,10):0;if(e.innerType||b){if(b&&!m)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${c}" must contain an index to the tuple element, e.g. "${c}[0]"`);if(r&&S>=r.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${d}, in the path: ${t}. because there is no value at that index. `);a=r,r=r&&r[S],e=b?e.spec.types[S]:e.innerType}if(!m){if(!e.fields||!e.fields[x])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${c} which is a type: "${e.type}")`);a=r,r=r&&r[x],e=e.fields[x]}s=x,c=p?"["+d+"]":"."+d}),{schema:e,parent:a,parentPath:s}):{parent:a,parentPath:t,schema:e}}class Ei extends Set{describe(){const t=[];for(const r of this.values())t.push(Rr.isRef(r)?r.describe():r);return t}resolveAll(t){let r=[];for(const i of this.values())r.push(t(i));return r}clone(){return new Ei(this.values())}merge(t,r){const i=this.clone();return t.forEach(a=>i.add(a)),r.forEach(a=>i.delete(a)),i}}function Zr(e,t=new Map){if(Ss(e)||!e||typeof e!="object")return e;if(t.has(e))return t.get(e);let r;if(e instanceof Date)r=new Date(e.getTime()),t.set(e,r);else if(e instanceof RegExp)r=new RegExp(e),t.set(e,r);else if(Array.isArray(e)){r=new Array(e.length),t.set(e,r);for(let i=0;i<e.length;i++)r[i]=Zr(e[i],t)}else if(e instanceof Map){r=new Map,t.set(e,r);for(const[i,a]of e.entries())r.set(i,Zr(a,t))}else if(e instanceof Set){r=new Set,t.set(e,r);for(const i of e)r.add(Zr(i,t))}else if(e instanceof Object){r={},t.set(e,r);for(const[i,a]of Object.entries(e))r[i]=Zr(a,t)}else throw Error(`Unable to clone ${e}`);return r}function m0(e){if(!(e!=null&&e.length))return;const t=[];let r="",i=!1,a=!1;for(let s=0;s<e.length;s++){const c=e[s];if(c==="["&&!a){r&&(t.push(...r.split(".").filter(Boolean)),r=""),i=!0;continue}if(c==="]"&&!a){r&&(/^\d+$/.test(r)?t.push(r):t.push(r.replace(/^"|"$/g,"")),r=""),i=!1;continue}if(c==='"'){a=!a;continue}if(c==="."&&!i&&!a){r&&(t.push(r),r="");continue}r+=c}return r&&t.push(...r.split(".").filter(Boolean)),t}function y0(e,t){const r=t?`${t}.${e.path}`:e.path;return e.errors.map(i=>({message:i,path:m0(r)}))}function Mf(e,t){var r;if(!((r=e.inner)!=null&&r.length)&&e.errors.length)return y0(e,t);const i=t?`${t}.${e.path}`:e.path;return e.inner.flatMap(a=>Mf(a,i))}class Nt{constructor(t){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new Ei,this._blacklist=new Ei,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(Mt.notType)}),this.type=t.type,this._typeCheck=t.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},t==null?void 0:t.spec),this.withMutation(r=>{r.nonNullable()})}get _type(){return this.type}clone(t){if(this._mutate)return t&&Object.assign(this.spec,t),this;const r=Object.create(Object.getPrototypeOf(this));return r.type=this.type,r._typeCheck=this._typeCheck,r._whitelist=this._whitelist.clone(),r._blacklist=this._blacklist.clone(),r.internalTests=Object.assign({},this.internalTests),r.exclusiveTests=Object.assign({},this.exclusiveTests),r.deps=[...this.deps],r.conditions=[...this.conditions],r.tests=[...this.tests],r.transforms=[...this.transforms],r.spec=Zr(Object.assign({},this.spec,t)),r}label(t){let r=this.clone();return r.spec.label=t,r}meta(...t){if(t.length===0)return this.spec.meta;let r=this.clone();return r.spec.meta=Object.assign(r.spec.meta||{},t[0]),r}withMutation(t){let r=this._mutate;this._mutate=!0;let i=t(this);return this._mutate=r,i}concat(t){if(!t||t===this)return this;if(t.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${t.type}`);let r=this,i=t.clone();const a=Object.assign({},r.spec,i.spec);return i.spec=a,i.internalTests=Object.assign({},r.internalTests,i.internalTests),i._whitelist=r._whitelist.merge(t._whitelist,t._blacklist),i._blacklist=r._blacklist.merge(t._blacklist,t._whitelist),i.tests=r.tests,i.exclusiveTests=r.exclusiveTests,i.withMutation(s=>{t.tests.forEach(c=>{s.test(c.OPTIONS)})}),i.transforms=[...r.transforms,...i.transforms],i}isType(t){return t==null?!!(this.spec.nullable&&t===null||this.spec.optional&&t===void 0):this._typeCheck(t)}resolve(t){let r=this;if(r.conditions.length){let i=r.conditions;r=r.clone(),r.conditions=[],r=i.reduce((a,s)=>s.resolve(a,t),r),r=r.resolve(t)}return r}resolveOptions(t){var r,i,a,s;return Object.assign({},t,{from:t.from||[],strict:(r=t.strict)!=null?r:this.spec.strict,abortEarly:(i=t.abortEarly)!=null?i:this.spec.abortEarly,recursive:(a=t.recursive)!=null?a:this.spec.recursive,disableStackTrace:(s=t.disableStackTrace)!=null?s:this.spec.disableStackTrace})}cast(t,r={}){let i=this.resolve(Object.assign({},r,{value:t})),a=r.assert==="ignore-optionality",s=i._cast(t,r);if(r.assert!==!1&&!i.isType(s)){if(a&&Sr(s))return s;let c=nr(t),d=nr(s);throw new TypeError(`The value of ${r.path||"field"} could not be cast to a value that satisfies the schema type: "${i.type}".
77
91
 
78
92
  attempted value: ${c}
79
- `+(d!==c?`result of cast: ${d}`:""))}return s}_cast(t,r){let i=t===void 0?t:this.transforms.reduce((a,s)=>s.call(this,a,t,this,r),t);return i===void 0&&(i=this.getDefault(r)),i}_validate(t,r={},i,a){let{path:s,originalValue:c=t,strict:d=this.spec.strict}=r,p=t;d||(p=this._cast(p,Object.assign({assert:!1},r)));let m=[];for(let x of Object.values(this.internalTests))x&&m.push(x);this.runTests({path:s,value:p,originalValue:c,options:r,tests:m},i,x=>{if(x.length)return a(x,p);this.runTests({path:s,value:p,originalValue:c,options:r,tests:this.tests},i,a)})}runTests(t,r,i){let a=!1,{tests:s,value:c,originalValue:d,path:p,options:m}=t,x=b=>{a||(a=!0,r(b,c))},_=b=>{a||(a=!0,i(b,c))},w=s.length,R=[];if(!w)return _([]);let I={value:c,originalValue:d,path:p,options:m,schema:this};for(let b=0;b<s.length;b++){const q=s[b];q(I,x,function(W){W&&(Array.isArray(W)?R.push(...W):R.push(W)),--w<=0&&_(R)})}}asNestedTest({key:t,index:r,parent:i,parentPath:a,originalParent:s,options:c}){const d=t??r;if(d==null)throw TypeError("Must include `key` or `index` for nested validations");const p=typeof d=="number";let m=i[d];const x=Object.assign({},c,{strict:!0,parent:i,value:m,originalValue:s[d],key:void 0,[p?"index":"key"]:d,path:p||d.includes(".")?`${a||""}[${p?d:`"${d}"`}]`:(a?`${a}.`:"")+t});return(_,w,R)=>this.resolve(x)._validate(m,x,w,R)}validate(t,r){var i;let a=this.resolve(Object.assign({},r,{value:t})),s=(i=r==null?void 0:r.disableStackTrace)!=null?i:a.spec.disableStackTrace;return new Promise((c,d)=>a._validate(t,r,(p,m)=>{mt.isError(p)&&(p.value=m),d(p)},(p,m)=>{p.length?d(new mt(p,m,void 0,void 0,s)):c(m)}))}validateSync(t,r){var i;let a=this.resolve(Object.assign({},r,{value:t})),s,c=(i=r==null?void 0:r.disableStackTrace)!=null?i:a.spec.disableStackTrace;return a._validate(t,Object.assign({},r,{sync:!0}),(d,p)=>{throw mt.isError(d)&&(d.value=p),d},(d,p)=>{if(d.length)throw new mt(d,t,void 0,void 0,c);s=p}),s}isValid(t,r){return this.validate(t,r).then(()=>!0,i=>{if(mt.isError(i))return!1;throw i})}isValidSync(t,r){try{return this.validateSync(t,r),!0}catch(i){if(mt.isError(i))return!1;throw i}}_getDefault(t){let r=this.spec.default;return r==null?r:typeof r=="function"?r.call(this,t):Jr(r)}getDefault(t){return this.resolve(t||{})._getDefault(t)}default(t){return arguments.length===0?this._getDefault():this.clone({default:t})}strict(t=!0){return this.clone({strict:t})}nullability(t,r){const i=this.clone({nullable:t});return i.internalTests.nullable=Hr({message:r,name:"nullable",test(a){return a===null?this.schema.spec.nullable:!0}}),i}optionality(t,r){const i=this.clone({optional:t});return i.internalTests.optionality=Hr({message:r,name:"optionality",test(a){return a===void 0?this.schema.spec.optional:!0}}),i}optional(){return this.optionality(!0)}defined(t=Rt.defined){return this.optionality(!1,t)}nullable(){return this.nullability(!0)}nonNullable(t=Rt.notNull){return this.nullability(!1,t)}required(t=Rt.required){return this.clone().withMutation(r=>r.nonNullable(t).defined(t))}notRequired(){return this.clone().withMutation(t=>t.nullable().optional())}transform(t){let r=this.clone();return r.transforms.push(t),r}test(...t){let r;if(t.length===1?typeof t[0]=="function"?r={test:t[0]}:r=t[0]:t.length===2?r={name:t[0],test:t[1]}:r={name:t[0],message:t[1],test:t[2]},r.message===void 0&&(r.message=Rt.default),typeof r.test!="function")throw new TypeError("`test` is a required parameters");let i=this.clone(),a=Hr(r),s=r.exclusive||r.name&&i.exclusiveTests[r.name]===!0;if(r.exclusive&&!r.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return r.name&&(i.exclusiveTests[r.name]=!!r.exclusive),i.tests=i.tests.filter(c=>!(c.OPTIONS.name===r.name&&(s||c.OPTIONS.test===a.OPTIONS.test))),i.tests.push(a),i}when(t,r){!Array.isArray(t)&&typeof t!="string"&&(r=t,t=".");let i=this.clone(),a=Ef(t).map(s=>new $r(s));return a.forEach(s=>{s.isSibling&&i.deps.push(s.key)}),i.conditions.push(typeof r=="function"?new _i(a,r):_i.fromOptions(a,r)),i}typeError(t){let r=this.clone();return r.internalTests.typeError=Hr({message:t,name:"typeError",skipAbsent:!0,test(i){return this.schema._typeCheck(i)?!0:this.createError({params:{type:this.schema.type}})}}),r}oneOf(t,r=Rt.oneOf){let i=this.clone();return t.forEach(a=>{i._whitelist.add(a),i._blacklist.delete(a)}),i.internalTests.whiteList=Hr({message:r,name:"oneOf",skipAbsent:!0,test(a){let s=this.schema._whitelist,c=s.resolveAll(this.resolve);return c.includes(a)?!0:this.createError({params:{values:Array.from(s).join(", "),resolved:c}})}}),i}notOneOf(t,r=Rt.notOneOf){let i=this.clone();return t.forEach(a=>{i._blacklist.add(a),i._whitelist.delete(a)}),i.internalTests.blacklist=Hr({message:r,name:"notOneOf",test(a){let s=this.schema._blacklist,c=s.resolveAll(this.resolve);return c.includes(a)?this.createError({params:{values:Array.from(s).join(", "),resolved:c}}):!0}}),i}strip(t=!0){let r=this.clone();return r.spec.strip=t,r}describe(t){const r=(t?this.resolve(t):this).clone(),{label:i,meta:a,optional:s,nullable:c}=r.spec;return{meta:a,label:i,optional:s,nullable:c,default:r.getDefault(t),type:r.type,oneOf:r._whitelist.describe(),notOneOf:r._blacklist.describe(),tests:r.tests.filter((p,m,x)=>x.findIndex(_=>_.OPTIONS.name===p.OPTIONS.name)===m).map(p=>{const m=p.OPTIONS.params&&t?jf(Object.assign({},p.OPTIONS.params),t):p.OPTIONS.params;return{name:p.OPTIONS.name,params:m}})}}get"~standard"(){const t=this;return{version:1,vendor:"yup",async validate(i){try{return{value:await t.validate(i,{abortEarly:!1})}}catch(a){if(a instanceof mt)return{issues:$f(a)};throw a}}}}}Dt.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])Dt.prototype[`${e}At`]=function(t,r,i={}){const{parent:a,parentPath:s,schema:c}=o0(this,t,r,i.context);return c[e](a&&a[s],Object.assign({},i,{parent:a,path:t}))};for(const e of["equals","is"])Dt.prototype[e]=Dt.prototype.oneOf;for(const e of["not","nope"])Dt.prototype[e]=Dt.prototype.notOneOf;const u0=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function c0(e){const t=es(e);if(!t)return Date.parse?Date.parse(e):Number.NaN;if(t.z===void 0&&t.plusMinus===void 0)return new Date(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond).valueOf();let r=0;return t.z!=="Z"&&t.plusMinus!==void 0&&(r=t.hourOffset*60+t.minuteOffset,t.plusMinus==="+"&&(r=0-r)),Date.UTC(t.year,t.month,t.day,t.hour,t.minute+r,t.second,t.millisecond)}function es(e){var t,r;const i=u0.exec(e);return i?{year:Lt(i[1]),month:Lt(i[2],1)-1,day:Lt(i[3],1),hour:Lt(i[4]),minute:Lt(i[5]),second:Lt(i[6]),millisecond:i[7]?Lt(i[7].substring(0,3)):0,precision:(t=(r=i[7])==null?void 0:r.length)!=null?t:void 0,z:i[8]||void 0,plusMinus:i[9]||void 0,hourOffset:Lt(i[10]),minuteOffset:Lt(i[11])}:null}function Lt(e,t=0){return Number(e)||t}let l0=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,f0=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,d0=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,h0="^\\d{4}-\\d{2}-\\d{2}",p0="\\d{2}:\\d{2}:\\d{2}",m0="(([+-]\\d{2}(:?\\d{2})?)|Z)",y0=new RegExp(`${h0}T${p0}(\\.\\d+)?${m0}$`),g0=e=>_r(e)||e===e.trim(),v0={}.toString();function If(){return new Pf}class Pf extends Dt{constructor(){super({type:"string",check(t){return t instanceof String&&(t=t.valueOf()),typeof t=="string"}}),this.withMutation(()=>{this.transform((t,r)=>{if(!this.spec.coerce||this.isType(t)||Array.isArray(t))return t;const i=t!=null&&t.toString?t.toString():t;return i===v0?t:i})})}required(t){return super.required(t).withMutation(r=>r.test({message:t||Rt.required,name:"required",skipAbsent:!0,test:i=>!!i.length}))}notRequired(){return super.notRequired().withMutation(t=>(t.tests=t.tests.filter(r=>r.OPTIONS.name!=="required"),t))}length(t,r=yt.length){return this.test({message:r,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(i){return i.length===this.resolve(t)}})}min(t,r=yt.min){return this.test({message:r,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(i){return i.length>=this.resolve(t)}})}max(t,r=yt.max){return this.test({name:"max",exclusive:!0,message:r,params:{max:t},skipAbsent:!0,test(i){return i.length<=this.resolve(t)}})}matches(t,r){let i=!1,a,s;return r&&(typeof r=="object"?{excludeEmptyString:i=!1,message:a,name:s}=r:a=r),this.test({name:s||"matches",message:a||yt.matches,params:{regex:t},skipAbsent:!0,test:c=>c===""&&i||c.search(t)!==-1})}email(t=yt.email){return this.matches(l0,{name:"email",message:t,excludeEmptyString:!0})}url(t=yt.url){return this.matches(f0,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=yt.uuid){return this.matches(d0,{name:"uuid",message:t,excludeEmptyString:!1})}datetime(t){let r="",i,a;return t&&(typeof t=="object"?{message:r="",allowOffset:i=!1,precision:a=void 0}=t:r=t),this.matches(y0,{name:"datetime",message:r||yt.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:r||yt.datetime_offset,params:{allowOffset:i},skipAbsent:!0,test:s=>{if(!s||i)return!0;const c=es(s);return c?!!c.z:!1}}).test({name:"datetime_precision",message:r||yt.datetime_precision,params:{precision:a},skipAbsent:!0,test:s=>{if(!s||a==null)return!0;const c=es(s);return c?c.precision===a:!1}})}ensure(){return this.default("").transform(t=>t===null?"":t)}trim(t=yt.trim){return this.transform(r=>r!=null?r.trim():r).test({message:t,name:"trim",test:g0})}lowercase(t=yt.lowercase){return this.transform(r=>_r(r)?r:r.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:r=>_r(r)||r===r.toLowerCase()})}uppercase(t=yt.uppercase){return this.transform(r=>_r(r)?r:r.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:r=>_r(r)||r===r.toUpperCase()})}}If.prototype=Pf.prototype;let b0=new Date(""),_0=e=>Object.prototype.toString.call(e)==="[object Date]";class xs extends Dt{constructor(){super({type:"date",check(t){return _0(t)&&!isNaN(t.getTime())}}),this.withMutation(()=>{this.transform((t,r)=>!this.spec.coerce||this.isType(t)||t===null?t:(t=c0(t),isNaN(t)?xs.INVALID_DATE:new Date(t)))})}prepareParam(t,r){let i;if($r.isRef(t))i=t;else{let a=this.cast(t);if(!this._typeCheck(a))throw new TypeError(`\`${r}\` must be a Date or a value that can be \`cast()\` to a Date`);i=a}return i}min(t,r=Qa.min){let i=this.prepareParam(t,"min");return this.test({message:r,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(a){return a>=this.resolve(i)}})}max(t,r=Qa.max){let i=this.prepareParam(t,"max");return this.test({message:r,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(a){return a<=this.resolve(i)}})}}xs.INVALID_DATE=b0;function x0(e,t=[]){let r=[],i=new Set,a=new Set(t.map(([c,d])=>`${c}-${d}`));function s(c,d){let p=Sr.split(c)[0];i.add(p),a.has(`${d}-${p}`)||r.push([d,p])}for(const c of Object.keys(e)){let d=e[c];i.add(c),$r.isRef(d)&&d.isSibling?s(d.path,c):_s(d)&&"deps"in d&&d.deps.forEach(p=>s(p,c))}return Wb.array(Array.from(i),r).reverse()}function bc(e,t){let r=1/0;return e.some((i,a)=>{var s;if((s=t.path)!=null&&s.includes(i))return r=a,!0}),r}function Rf(e){return(t,r)=>bc(e,t)-bc(e,r)}const w0=(e,t,r)=>{if(typeof e!="string")return e;let i=e;try{i=JSON.parse(e)}catch{}return r.isType(i)?i:e};function di(e){if("fields"in e){const t={};for(const[r,i]of Object.entries(e.fields))t[r]=di(i);return e.setFields(t)}if(e.type==="array"){const t=e.optional();return t.innerType&&(t.innerType=di(t.innerType)),t}return e.type==="tuple"?e.optional().clone({types:e.spec.types.map(di)}):"optional"in e?e.optional():e}const S0=(e,t)=>{const r=[...Sr.normalizePath(t)];if(r.length===1)return r[0]in e;let i=r.pop(),a=Sr.getter(Sr.join(r),!0)(e);return!!(a&&i in a)};let _c=e=>Object.prototype.toString.call(e)==="[object Object]";function xc(e,t){let r=Object.keys(e.fields);return Object.keys(t).filter(i=>r.indexOf(i)===-1)}const T0=Rf([]);function Df(e){return new Ff(e)}class Ff extends Dt{constructor(t){super({type:"object",check(r){return _c(r)||typeof r=="function"}}),this.fields=Object.create(null),this._sortErrors=T0,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{t&&this.shape(t)})}_cast(t,r={}){var i;let a=super._cast(t,r);if(a===void 0)return this.getDefault(r);if(!this._typeCheck(a))return a;let s=this.fields,c=(i=r.stripUnknown)!=null?i:this.spec.noUnknown,d=[].concat(this._nodes,Object.keys(a).filter(_=>!this._nodes.includes(_))),p={},m=Object.assign({},r,{parent:p,__validating:r.__validating||!1}),x=!1;for(const _ of d){let w=s[_],R=_ in a,I=a[_];if(w){let b;m.path=(r.path?`${r.path}.`:"")+_,w=w.resolve({value:I,context:r.context,parent:p});let q=w instanceof Dt?w.spec:void 0,M=q==null?void 0:q.strict;if(q!=null&&q.strip){x=x||_ in a;continue}b=!r.__validating||!M?w.cast(I,m):I,b!==void 0&&(p[_]=b)}else R&&!c&&(p[_]=I);(R!==_ in p||p[_]!==I)&&(x=!0)}return x?p:a}_validate(t,r={},i,a){let{from:s=[],originalValue:c=t,recursive:d=this.spec.recursive}=r;r.from=[{schema:this,value:c},...s],r.__validating=!0,r.originalValue=c,super._validate(t,r,i,(p,m)=>{if(!d||!_c(m)){a(p,m);return}c=c||m;let x=[];for(let _ of this._nodes){let w=this.fields[_];!w||$r.isRef(w)||x.push(w.asNestedTest({options:r,key:_,parent:m,parentPath:r.path,originalParent:c}))}this.runTests({tests:x,value:m,originalValue:c,options:r},i,_=>{a(_.sort(this._sortErrors).concat(p),m)})})}clone(t){const r=super.clone(t);return r.fields=Object.assign({},this.fields),r._nodes=this._nodes,r._excludedEdges=this._excludedEdges,r._sortErrors=this._sortErrors,r}concat(t){let r=super.concat(t),i=r.fields;for(let[a,s]of Object.entries(this.fields)){const c=i[a];i[a]=c===void 0?s:c}return r.withMutation(a=>a.setFields(i,[...this._excludedEdges,...t._excludedEdges]))}_getDefault(t){if("default"in this.spec)return super._getDefault(t);if(!this._nodes.length)return;let r={};return this._nodes.forEach(i=>{var a;const s=this.fields[i];let c=t;(a=c)!=null&&a.value&&(c=Object.assign({},c,{parent:c.value,value:c.value[i]})),r[i]=s&&"getDefault"in s?s.getDefault(c):void 0}),r}setFields(t,r){let i=this.clone();return i.fields=t,i._nodes=x0(t,r),i._sortErrors=Rf(Object.keys(t)),r&&(i._excludedEdges=r),i}shape(t,r=[]){return this.clone().withMutation(i=>{let a=i._excludedEdges;return r.length&&(Array.isArray(r[0])||(r=[r]),a=[...i._excludedEdges,...r]),i.setFields(Object.assign(i.fields,t),a)})}partial(){const t={};for(const[r,i]of Object.entries(this.fields))t[r]="optional"in i&&i.optional instanceof Function?i.optional():i;return this.setFields(t)}deepPartial(){return di(this)}pick(t){const r={};for(const i of t)this.fields[i]&&(r[i]=this.fields[i]);return this.setFields(r,this._excludedEdges.filter(([i,a])=>t.includes(i)&&t.includes(a)))}omit(t){const r=[];for(const i of Object.keys(this.fields))t.includes(i)||r.push(i);return this.pick(r)}from(t,r,i){let a=Sr.getter(t,!0);return this.transform(s=>{if(!s)return s;let c=s;return S0(s,t)&&(c=Object.assign({},s),i||delete c[t],c[r]=a(s)),c})}json(){return this.transform(w0)}exact(t){return this.test({name:"exact",exclusive:!0,message:t||fi.exact,test(r){if(r==null)return!0;const i=xc(this.schema,r);return i.length===0||this.createError({params:{properties:i.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(t=!0,r=fi.noUnknown){typeof t!="boolean"&&(r=t,t=!0);let i=this.test({name:"noUnknown",exclusive:!0,message:r,test(a){if(a==null)return!0;const s=xc(this.schema,a);return!t||s.length===0||this.createError({params:{unknown:s.join(", ")}})}});return i.spec.noUnknown=t,i}unknown(t=!0,r=fi.noUnknown){return this.noUnknown(!t,r)}transformKeys(t){return this.transform(r=>{if(!r)return r;const i={};for(const a of Object.keys(r))i[t(a)]=r[a];return i})}camelCase(){return this.transformKeys(Vo.camelCase)}snakeCase(){return this.transformKeys(Vo.snakeCase)}constantCase(){return this.transformKeys(t=>Vo.snakeCase(t).toUpperCase())}describe(t){const r=(t?this.resolve(t):this).clone(),i=super.describe(t);i.fields={};for(const[s,c]of Object.entries(r.fields)){var a;let d=t;(a=d)!=null&&a.value&&(d=Object.assign({},d,{parent:d.value,value:d.value[s]})),i.fields[s]=c.describe(d)}return i}}Df.prototype=Ff.prototype;var zo,wc;function ws(){if(wc)return zo;wc=1;var e=Array.isArray;return zo=e,zo}var Uo,Sc;function E0(){if(Sc)return Uo;Sc=1;var e=typeof gn=="object"&&gn&&gn.Object===Object&&gn;return Uo=e,Uo}var Go,Tc;function Ss(){if(Tc)return Go;Tc=1;var e=E0(),t=typeof self=="object"&&self&&self.Object===Object&&self,r=e||t||Function("return this")();return Go=r,Go}var Wo,Ec;function Ts(){if(Ec)return Wo;Ec=1;var e=Ss(),t=e.Symbol;return Wo=t,Wo}var Ho,Cc;function C0(){if(Cc)return Ho;Cc=1;var e=Ts(),t=Object.prototype,r=t.hasOwnProperty,i=t.toString,a=e?e.toStringTag:void 0;function s(c){var d=r.call(c,a),p=c[a];try{c[a]=void 0;var m=!0}catch{}var x=i.call(c);return m&&(d?c[a]=p:delete c[a]),x}return Ho=s,Ho}var Yo,Oc;function O0(){if(Oc)return Yo;Oc=1;var e=Object.prototype,t=e.toString;function r(i){return t.call(i)}return Yo=r,Yo}var Jo,Ac;function Mf(){if(Ac)return Jo;Ac=1;var e=Ts(),t=C0(),r=O0(),i="[object Null]",a="[object Undefined]",s=e?e.toStringTag:void 0;function c(d){return d==null?d===void 0?a:i:s&&s in Object(d)?t(d):r(d)}return Jo=c,Jo}var Xo,jc;function A0(){if(jc)return Xo;jc=1;function e(t){return t!=null&&typeof t=="object"}return Xo=e,Xo}var Zo,kc;function Es(){if(kc)return Zo;kc=1;var e=Mf(),t=A0(),r="[object Symbol]";function i(a){return typeof a=="symbol"||t(a)&&e(a)==r}return Zo=i,Zo}var Qo,$c;function j0(){if($c)return Qo;$c=1;var e=ws(),t=Es(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,i=/^\w*$/;function a(s,c){if(e(s))return!1;var d=typeof s;return d=="number"||d=="symbol"||d=="boolean"||s==null||t(s)?!0:i.test(s)||!r.test(s)||c!=null&&s in Object(c)}return Qo=a,Qo}var ea,Ic;function Nf(){if(Ic)return ea;Ic=1;function e(t){var r=typeof t;return t!=null&&(r=="object"||r=="function")}return ea=e,ea}var ta,Pc;function k0(){if(Pc)return ta;Pc=1;var e=Mf(),t=Nf(),r="[object AsyncFunction]",i="[object Function]",a="[object GeneratorFunction]",s="[object Proxy]";function c(d){if(!t(d))return!1;var p=e(d);return p==i||p==a||p==r||p==s}return ta=c,ta}var ra,Rc;function $0(){if(Rc)return ra;Rc=1;var e=Ss(),t=e["__core-js_shared__"];return ra=t,ra}var na,Dc;function I0(){if(Dc)return na;Dc=1;var e=$0(),t=(function(){var i=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return i?"Symbol(src)_1."+i:""})();function r(i){return!!t&&t in i}return na=r,na}var ia,Fc;function P0(){if(Fc)return ia;Fc=1;var e=Function.prototype,t=e.toString;function r(i){if(i!=null){try{return t.call(i)}catch{}try{return i+""}catch{}}return""}return ia=r,ia}var oa,Mc;function R0(){if(Mc)return oa;Mc=1;var e=k0(),t=I0(),r=Nf(),i=P0(),a=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,c=Function.prototype,d=Object.prototype,p=c.toString,m=d.hasOwnProperty,x=RegExp("^"+p.call(m).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function _(w){if(!r(w)||t(w))return!1;var R=e(w)?x:s;return R.test(i(w))}return oa=_,oa}var aa,Nc;function D0(){if(Nc)return aa;Nc=1;function e(t,r){return t==null?void 0:t[r]}return aa=e,aa}var sa,Bc;function Bf(){if(Bc)return sa;Bc=1;var e=R0(),t=D0();function r(i,a){var s=t(i,a);return e(s)?s:void 0}return sa=r,sa}var ua,qc;function qi(){if(qc)return ua;qc=1;var e=Bf(),t=e(Object,"create");return ua=t,ua}var ca,Lc;function F0(){if(Lc)return ca;Lc=1;var e=qi();function t(){this.__data__=e?e(null):{},this.size=0}return ca=t,ca}var la,Kc;function M0(){if(Kc)return la;Kc=1;function e(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r}return la=e,la}var fa,Vc;function N0(){if(Vc)return fa;Vc=1;var e=qi(),t="__lodash_hash_undefined__",r=Object.prototype,i=r.hasOwnProperty;function a(s){var c=this.__data__;if(e){var d=c[s];return d===t?void 0:d}return i.call(c,s)?c[s]:void 0}return fa=a,fa}var da,zc;function B0(){if(zc)return da;zc=1;var e=qi(),t=Object.prototype,r=t.hasOwnProperty;function i(a){var s=this.__data__;return e?s[a]!==void 0:r.call(s,a)}return da=i,da}var ha,Uc;function q0(){if(Uc)return ha;Uc=1;var e=qi(),t="__lodash_hash_undefined__";function r(i,a){var s=this.__data__;return this.size+=this.has(i)?0:1,s[i]=e&&a===void 0?t:a,this}return ha=r,ha}var pa,Gc;function L0(){if(Gc)return pa;Gc=1;var e=F0(),t=M0(),r=N0(),i=B0(),a=q0();function s(c){var d=-1,p=c==null?0:c.length;for(this.clear();++d<p;){var m=c[d];this.set(m[0],m[1])}}return s.prototype.clear=e,s.prototype.delete=t,s.prototype.get=r,s.prototype.has=i,s.prototype.set=a,pa=s,pa}var ma,Wc;function K0(){if(Wc)return ma;Wc=1;function e(){this.__data__=[],this.size=0}return ma=e,ma}var ya,Hc;function V0(){if(Hc)return ya;Hc=1;function e(t,r){return t===r||t!==t&&r!==r}return ya=e,ya}var ga,Yc;function Li(){if(Yc)return ga;Yc=1;var e=V0();function t(r,i){for(var a=r.length;a--;)if(e(r[a][0],i))return a;return-1}return ga=t,ga}var va,Jc;function z0(){if(Jc)return va;Jc=1;var e=Li(),t=Array.prototype,r=t.splice;function i(a){var s=this.__data__,c=e(s,a);if(c<0)return!1;var d=s.length-1;return c==d?s.pop():r.call(s,c,1),--this.size,!0}return va=i,va}var ba,Xc;function U0(){if(Xc)return ba;Xc=1;var e=Li();function t(r){var i=this.__data__,a=e(i,r);return a<0?void 0:i[a][1]}return ba=t,ba}var _a,Zc;function G0(){if(Zc)return _a;Zc=1;var e=Li();function t(r){return e(this.__data__,r)>-1}return _a=t,_a}var xa,Qc;function W0(){if(Qc)return xa;Qc=1;var e=Li();function t(r,i){var a=this.__data__,s=e(a,r);return s<0?(++this.size,a.push([r,i])):a[s][1]=i,this}return xa=t,xa}var wa,el;function H0(){if(el)return wa;el=1;var e=K0(),t=z0(),r=U0(),i=G0(),a=W0();function s(c){var d=-1,p=c==null?0:c.length;for(this.clear();++d<p;){var m=c[d];this.set(m[0],m[1])}}return s.prototype.clear=e,s.prototype.delete=t,s.prototype.get=r,s.prototype.has=i,s.prototype.set=a,wa=s,wa}var Sa,tl;function Y0(){if(tl)return Sa;tl=1;var e=Bf(),t=Ss(),r=e(t,"Map");return Sa=r,Sa}var Ta,rl;function J0(){if(rl)return Ta;rl=1;var e=L0(),t=H0(),r=Y0();function i(){this.size=0,this.__data__={hash:new e,map:new(r||t),string:new e}}return Ta=i,Ta}var Ea,nl;function X0(){if(nl)return Ea;nl=1;function e(t){var r=typeof t;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?t!=="__proto__":t===null}return Ea=e,Ea}var Ca,il;function Ki(){if(il)return Ca;il=1;var e=X0();function t(r,i){var a=r.__data__;return e(i)?a[typeof i=="string"?"string":"hash"]:a.map}return Ca=t,Ca}var Oa,ol;function Z0(){if(ol)return Oa;ol=1;var e=Ki();function t(r){var i=e(this,r).delete(r);return this.size-=i?1:0,i}return Oa=t,Oa}var Aa,al;function Q0(){if(al)return Aa;al=1;var e=Ki();function t(r){return e(this,r).get(r)}return Aa=t,Aa}var ja,sl;function e_(){if(sl)return ja;sl=1;var e=Ki();function t(r){return e(this,r).has(r)}return ja=t,ja}var ka,ul;function t_(){if(ul)return ka;ul=1;var e=Ki();function t(r,i){var a=e(this,r),s=a.size;return a.set(r,i),this.size+=a.size==s?0:1,this}return ka=t,ka}var $a,cl;function r_(){if(cl)return $a;cl=1;var e=J0(),t=Z0(),r=Q0(),i=e_(),a=t_();function s(c){var d=-1,p=c==null?0:c.length;for(this.clear();++d<p;){var m=c[d];this.set(m[0],m[1])}}return s.prototype.clear=e,s.prototype.delete=t,s.prototype.get=r,s.prototype.has=i,s.prototype.set=a,$a=s,$a}var Ia,ll;function n_(){if(ll)return Ia;ll=1;var e=r_(),t="Expected a function";function r(i,a){if(typeof i!="function"||a!=null&&typeof a!="function")throw new TypeError(t);var s=function(){var c=arguments,d=a?a.apply(this,c):c[0],p=s.cache;if(p.has(d))return p.get(d);var m=i.apply(this,c);return s.cache=p.set(d,m)||p,m};return s.cache=new(r.Cache||e),s}return r.Cache=e,Ia=r,Ia}var Pa,fl;function i_(){if(fl)return Pa;fl=1;var e=n_(),t=500;function r(i){var a=e(i,function(c){return s.size===t&&s.clear(),c}),s=a.cache;return a}return Pa=r,Pa}var Ra,dl;function o_(){if(dl)return Ra;dl=1;var e=i_(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,i=e(function(a){var s=[];return a.charCodeAt(0)===46&&s.push(""),a.replace(t,function(c,d,p,m){s.push(p?m.replace(r,"$1"):d||c)}),s});return Ra=i,Ra}var Da,hl;function a_(){if(hl)return Da;hl=1;function e(t,r){for(var i=-1,a=t==null?0:t.length,s=Array(a);++i<a;)s[i]=r(t[i],i,t);return s}return Da=e,Da}var Fa,pl;function s_(){if(pl)return Fa;pl=1;var e=Ts(),t=a_(),r=ws(),i=Es(),a=e?e.prototype:void 0,s=a?a.toString:void 0;function c(d){if(typeof d=="string")return d;if(r(d))return t(d,c)+"";if(i(d))return s?s.call(d):"";var p=d+"";return p=="0"&&1/d==-1/0?"-0":p}return Fa=c,Fa}var Ma,ml;function u_(){if(ml)return Ma;ml=1;var e=s_();function t(r){return r==null?"":e(r)}return Ma=t,Ma}var Na,yl;function c_(){if(yl)return Na;yl=1;var e=ws(),t=j0(),r=o_(),i=u_();function a(s,c){return e(s)?s:t(s,c)?[s]:r(i(s))}return Na=a,Na}var Ba,gl;function l_(){if(gl)return Ba;gl=1;var e=Es();function t(r){if(typeof r=="string"||e(r))return r;var i=r+"";return i=="0"&&1/r==-1/0?"-0":i}return Ba=t,Ba}var qa,vl;function f_(){if(vl)return qa;vl=1;var e=c_(),t=l_();function r(i,a){a=e(a,i);for(var s=0,c=a.length;i!=null&&s<c;)i=i[t(a[s++])];return s&&s==c?i:void 0}return qa=r,qa}var La,bl;function d_(){if(bl)return La;bl=1;var e=f_();function t(r,i,a){var s=r==null?void 0:e(r,i);return s===void 0?a:s}return La=t,La}var h_=d_();const p_=An(h_),m_=(e=16)=>{const t={upper:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",lower:"abcdefghijklmnopqrstuvwxyz",numbers:"0123456789",symbols:"!@%^&*()_+[]{}|;:,.<>?"},r=t.upper+t.lower+t.numbers+t.symbols,i=s=>{const c=crypto.getRandomValues(new Uint32Array(1));return s[c[0]%s.length]},a=[i(t.upper),i(t.lower),i(t.numbers),i(t.symbols)];for(let s=4;s<e;s++)a.push(i(r));for(let s=a.length-1;s>0;s--){const d=crypto.getRandomValues(new Uint32Array(1))[0]%(s+1),p=a[s];a[s]=a[d],a[d]=p}return a.join("")},y_=({showPassword:e,onToggleVisibility:t,onGenerate:r})=>k.jsxs(z.InputAdornment,{position:"end",children:[r&&k.jsx(z.Tooltip,{title:"Generate Password",children:k.jsx(z.IconButton,{onClick:r,edge:"end",size:"small",sx:{opacity:.7},"aria-label":"generate password",children:k.jsx(gm,{})})}),k.jsx(z.Tooltip,{title:e?"Hide password":"Show password",children:k.jsx(z.IconButton,{onClick:t,edge:"end",size:"small",sx:{opacity:.7},"aria-label":e?"hide password":"show password",children:e?k.jsx(Cm,{}):k.jsx(Em,{})})})]}),g_=({type:e,autoGenerate:t=!1,formik:r,name:i})=>{const[a,s]=U.useState(!1),c={},d=a?"text":"password";if(e!=="password")return{inputType:e,inputProps:c};const p=()=>{s(!a)},m=()=>{if(!r||!i)return;const x=m_();r.setFieldValue(i,x),a||s(!0)};return c.endAdornment=y_({showPassword:a,onToggleVisibility:p,onGenerate:t?m:void 0}),{inputType:d,inputProps:c}},v_=({helperText:e,errorText:t,formik:r,name:i,defaultValue:a,onChange:s,type:c,fullWidth:d=!0,autoGenerate:p=!1,...m})=>{var R;const x=g_({type:c,autoGenerate:p,formik:r,name:i});let _={};const w=m.value??a;if(U.useEffect(()=>{!r||!i||w===void 0||r.setFieldValue(i,w)},[w]),i&&r){r.touched[i]&&(t??(t=r.errors[i]));let I=p_(r.values,i,"");c==="date"&&(I=b_(I)),_={value:I??"",onBlur:()=>r.setFieldTouched(i),onChange:b=>{let q=b.target.value;c==="date"&&q&&(q=new Date(q)),r.setFieldValue(i,q||null),s==null||s(b)},slotProps:{...m.slotProps,input:{...m.InputProps,...(R=m.slotProps)==null?void 0:R.input,...x.inputProps},inputLabel:c==="date"?{shrink:!0}:void 0}}}return k.jsx(z.TextField,{variant:"standard",onChange:s,...m,..._,name:i,type:x.inputType,fullWidth:d,helperText:t||e,error:!!t})},b_=e=>{if(!e)return"";const t=new Date(e),r=t.getFullYear(),i=String(t.getMonth()+1).padStart(2,"0"),a=String(t.getDate()).padStart(2,"0");return`${r}-${i}-${a}`},__=({multiple:e=!1,formik:t,name:r,label:i="Search users",disabled:a=!1,error:s,helperText:c,value:d,onChange:p})=>{const[m,x]=U.useState(!1),[_,w]=U.useState([]),[R,I]=U.useState(!1),[b,q]=U.useState(""),M=U.useCallback(async ae=>{if(ae.length<2){w([]);return}I(!0);try{const We=await jt().searchUsers({name:ae});w(We)}catch(ye){console.error("Failed to search users:",ye),w([])}finally{I(!1)}},[]),W=U.useCallback((ae,ye)=>{q(ye),M(ye)},[M]),G=()=>d!==void 0?d:t&&r?t.values[r]:e?[]:null,X=(ae,ye)=>{p?p(ye):t&&r&&t.setFieldValue(r,ye)},L=()=>{t&&r&&t.setFieldTouched(r)},N=()=>{if(s)return" ";if(t&&r&&t.touched[r]&&t.errors[r])return t.errors[r]},Z=G();return k.jsx(z.Autocomplete,{open:m,onOpen:()=>x(!0),onClose:()=>x(!1),multiple:e,options:_,value:Z,onChange:X,onBlur:L,onInputChange:W,getOptionLabel:ae=>ae.name,isOptionEqualToValue:(ae,ye)=>ae.id===ye.id,loading:R,noOptionsText:b.length<3?"Type at least 3 characters to search":"No users found",renderOption:(ae,ye)=>U.createElement(z.Box,{component:"li",...ae,key:ye.id},k.jsxs(z.Box,{children:[k.jsx(z.Typography,{variant:"body1",children:ye.name}),k.jsx(z.Typography,{variant:"body2",color:"text.secondary",children:ye.email})]})),renderInput:ae=>k.jsx(z.TextField,{...ae,label:i,disabled:a,error:!!N(),helperText:N()||c,InputProps:{...ae.InputProps,endAdornment:k.jsxs(k.Fragment,{children:[R?k.jsx(z.CircularProgress,{size:20}):null,ae.InputProps.endAdornment]})}})})},x_=Df({name:If().trim().required("Group name is required").min(2,"Group name must be at least 2 characters").max(100,"Group name must be at most 100 characters")}),qf=({open:e,onClose:t,onSuccess:r,orgId:i})=>{const[a,s]=U.useState(null),c=Db({initialValues:{name:"",read_only:!1,members:[]},validationSchema:x_,onSubmit:async(_,{setSubmitting:w,resetForm:R})=>{s(null);try{const I=jt(),b=await I.createGroup(i,{name:_.name.trim(),read_only:_.read_only});_.members&&_.members.length>0&&await I.addGroupMembers(i,b.id,_.members.map(q=>({user:q.userId,role:q.role}))),R(),r==null||r(),t()}catch(I){s(pi(I,"Failed to create group"))}w(!1)}}),d=_=>{const w=Array.isArray(_)?_:[];c.setFieldValue("members",w.map(R=>({userId:R.id,role:"member",user:R})))},p=(_,w)=>{const R=c.values.members.map(I=>I.userId===_?{...I,role:w}:I);c.setFieldValue("members",R)},m=_=>{const w=c.values.members.filter(R=>R.userId!==_);c.setFieldValue("members",w)},x=()=>{c.resetForm(),t()};return k.jsxs(z.Dialog,{open:e,onClose:x,maxWidth:"sm",fullWidth:!0,PaperProps:{component:"form",onSubmit:c.handleSubmit},children:[k.jsx(z.DialogTitle,{children:"Create New Group"}),k.jsx(z.DialogContent,{children:k.jsxs(z.Box,{sx:{display:"flex",flexDirection:"column",gap:2,pt:1},children:[a&&k.jsx(z.Alert,{severity:"error",onClose:()=>s(null),children:a.message}),k.jsx(v_,{label:"Group Name",name:"name",formik:c,required:!0,disabled:c.isSubmitting,placeholder:"e.g., Computer Science 101"}),k.jsx(z.FormControlLabel,{control:k.jsx(z.Switch,{name:"read_only",checked:c.values.read_only,onChange:c.handleChange,disabled:c.isSubmitting}),label:"Read-only group (only moderators can post)"}),k.jsx(z.Divider,{sx:{my:2}}),k.jsx(z.Typography,{color:"warning.main",fontWeight:500,children:"You cannot add members later. Only admins can join a group after it is created"}),k.jsxs(z.Box,{children:[k.jsx(z.Typography,{variant:"subtitle2",gutterBottom:!0,children:"Add Members"}),k.jsx(__,{multiple:!0,label:"Search users to add",value:c.values.members.map(_=>_.user),onChange:d,disabled:c.isSubmitting})]}),c.values.members.length>0&&k.jsxs(k.Fragment,{children:[k.jsx(z.Typography,{variant:"subtitle2",gutterBottom:!0,children:"Selected Members"}),c.values.members.map(_=>k.jsxs(z.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",borderRadius:1},children:[k.jsx(z.Box,{sx:{flex:1},children:_.user.name}),k.jsxs(z.Select,{value:_.role,onChange:w=>p(_.userId,w.target.value),size:"small",disabled:c.isSubmitting,sx:{mr:2},children:[k.jsx(z.MenuItem,{value:"member",children:"Member"}),k.jsx(z.MenuItem,{value:"moderator",children:"Moderator"})]}),k.jsx(z.IconButton,{size:"small",onClick:()=>m(_.userId),disabled:c.isSubmitting,color:"error",children:k.jsx(vm,{})})]},_.userId))]})]})}),k.jsxs(z.DialogActions,{sx:{p:3},children:[k.jsx(z.Button,{onClick:x,disabled:c.isSubmitting,children:"Cancel"}),k.jsx(z.Button,{type:"submit",variant:"contained",disabled:c.isSubmitting||!c.isValid,startIcon:c.isSubmitting&&k.jsx(z.CircularProgress,{size:16}),children:"Create Group"})]})]})};var hi={exports:{}},w_=hi.exports,_l;function S_(){return _l||(_l=1,(function(e,t){((r,i)=>{e.exports=i()})(w_,function(){var r=function(n,o){return(r=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(u,l){u.__proto__=l}:function(u,l){for(var f in l)Object.prototype.hasOwnProperty.call(l,f)&&(u[f]=l[f])}))(n,o)},i=function(){return(i=Object.assign||function(n){for(var o,u=1,l=arguments.length;u<l;u++)for(var f in o=arguments[u])Object.prototype.hasOwnProperty.call(o,f)&&(n[f]=o[f]);return n}).apply(this,arguments)};function a(n,o,u){for(var l,f=0,h=o.length;f<h;f++)!l&&f in o||((l=l||Array.prototype.slice.call(o,0,f))[f]=o[f]);return n.concat(l||Array.prototype.slice.call(o))}var s=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:gn,c=Object.keys,d=Array.isArray;function p(n,o){return typeof o=="object"&&c(o).forEach(function(u){n[u]=o[u]}),n}typeof Promise>"u"||s.Promise||(s.Promise=Promise);var m=Object.getPrototypeOf,x={}.hasOwnProperty;function _(n,o){return x.call(n,o)}function w(n,o){typeof o=="function"&&(o=o(m(n))),(typeof Reflect>"u"?c:Reflect.ownKeys)(o).forEach(function(u){I(n,u,o[u])})}var R=Object.defineProperty;function I(n,o,u,l){R(n,o,p(u&&_(u,"get")&&typeof u.get=="function"?{get:u.get,set:u.set,configurable:!0}:{value:u,configurable:!0,writable:!0},l))}function b(n){return{from:function(o){return n.prototype=Object.create(o.prototype),I(n.prototype,"constructor",n),{extend:w.bind(null,n.prototype)}}}}var q=Object.getOwnPropertyDescriptor,M=[].slice;function W(n,o,u){return M.call(n,o,u)}function G(n,o){return o(n)}function X(n){if(!n)throw new Error("Assertion Failed")}function L(n){s.setImmediate?setImmediate(n):setTimeout(n,0)}function N(n,o){if(typeof o=="string"&&_(n,o))return n[o];if(!o)return n;if(typeof o!="string"){for(var u=[],l=0,f=o.length;l<f;++l){var h=N(n,o[l]);u.push(h)}return u}var y,g=o.indexOf(".");return g===-1||(y=n[o.substr(0,g)])==null?void 0:N(y,o.substr(g+1))}function Z(n,o,u){if(n&&o!==void 0&&!("isFrozen"in Object&&Object.isFrozen(n)))if(typeof o!="string"&&"length"in o){X(typeof u!="string"&&"length"in u);for(var l=0,f=o.length;l<f;++l)Z(n,o[l],u[l])}else{var h,y,g=o.indexOf(".");g!==-1?(h=o.substr(0,g),(g=o.substr(g+1))===""?u===void 0?d(n)&&!isNaN(parseInt(h))?n.splice(h,1):delete n[h]:n[h]=u:Z(y=(y=n[h])&&_(n,h)?y:n[h]={},g,u)):u===void 0?d(n)&&!isNaN(parseInt(o))?n.splice(o,1):delete n[o]:n[o]=u}}function ae(n){var o,u={};for(o in n)_(n,o)&&(u[o]=n[o]);return u}var ye=[].concat;function We(n){return ye.apply([],n)}var _e="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(We([8,16,32,64].map(function(n){return["Int","Uint","Float"].map(function(o){return o+n+"Array"})}))).filter(function(n){return s[n]}),be=new Set(_e.map(function(n){return s[n]})),v=null;function ee(n){return v=new WeakMap,n=(function o(u){if(!u||typeof u!="object")return u;var l=v.get(u);if(l)return l;if(d(u)){l=[],v.set(u,l);for(var f=0,h=u.length;f<h;++f)l.push(o(u[f]))}else if(be.has(u.constructor))l=u;else{var y,g=m(u);for(y in l=g===Object.prototype?{}:Object.create(g),v.set(u,l),u)_(u,y)&&(l[y]=o(u[y]))}return l})(n),v=null,n}var te={}.toString;function ge(n){return te.call(n).slice(8,-1)}var Ee=typeof Symbol<"u"?Symbol.iterator:"@@iterator",He=typeof Ee=="symbol"?function(n){var o;return n!=null&&(o=n[Ee])&&o.apply(n)}:function(){return null};function Ue(n,o){o=n.indexOf(o),0<=o&&n.splice(o,1)}var ft={};function H(n){var o,u,l,f;if(arguments.length===1){if(d(n))return n.slice();if(this===ft&&typeof n=="string")return[n];if(f=He(n))for(u=[];!(l=f.next()).done;)u.push(l.value);else{if(n==null)return[n];if(typeof(o=n.length)!="number")return[n];for(u=new Array(o);o--;)u[o]=n[o]}}else for(o=arguments.length,u=new Array(o);o--;)u[o]=arguments[o];return u}var le=typeof Symbol<"u"?function(n){return n[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},_e=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],ve=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(_e),Oe={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function we(n,o){this.name=n,this.message=o}function Ce(n,o){return n+". Errors: "+Object.keys(o).map(function(u){return o[u].toString()}).filter(function(u,l,f){return f.indexOf(u)===l}).join(`
80
- `)}function Te(n,o,u,l){this.failures=o,this.failedKeys=l,this.successCount=u,this.message=Ce(n,o)}function Se(n,o){this.name="BulkError",this.failures=Object.keys(o).map(function(u){return o[u]}),this.failuresByPos=o,this.message=Ce(n,this.failures)}b(we).from(Error).extend({toString:function(){return this.name+": "+this.message}}),b(Te).from(we),b(Se).from(we);var Ae=ve.reduce(function(n,o){return n[o]=o+"Error",n},{}),Ie=we,re=ve.reduce(function(n,o){var u=o+"Error";function l(f,h){this.name=u,f?typeof f=="string"?(this.message="".concat(f).concat(h?`
81
- `+h:""),this.inner=h||null):typeof f=="object"&&(this.message="".concat(f.name," ").concat(f.message),this.inner=f):(this.message=Oe[o]||u,this.inner=null)}return b(l).from(Ie),n[o]=l,n},{}),rt=(re.Syntax=SyntaxError,re.Type=TypeError,re.Range=RangeError,_e.reduce(function(n,o){return n[o+"Error"]=re[o],n},{}));_e=ve.reduce(function(n,o){return["Syntax","Type","Range"].indexOf(o)===-1&&(n[o+"Error"]=re[o]),n},{});function Y(){}function st(n){return n}function Gt(n,o){return n==null||n===st?o:function(u){return o(n(u))}}function xt(n,o){return function(){n.apply(this,arguments),o.apply(this,arguments)}}function zi(n,o){return n===Y?o:function(){var u=n.apply(this,arguments),l=(u!==void 0&&(arguments[0]=u),this.onsuccess),f=this.onerror,h=(this.onsuccess=null,this.onerror=null,o.apply(this,arguments));return l&&(this.onsuccess=this.onsuccess?xt(l,this.onsuccess):l),f&&(this.onerror=this.onerror?xt(f,this.onerror):f),h!==void 0?h:u}}function Ui(n,o){return n===Y?o:function(){n.apply(this,arguments);var u=this.onsuccess,l=this.onerror;this.onsuccess=this.onerror=null,o.apply(this,arguments),u&&(this.onsuccess=this.onsuccess?xt(u,this.onsuccess):u),l&&(this.onerror=this.onerror?xt(l,this.onerror):l)}}function Gi(n,o){return n===Y?o:function(f){var l=n.apply(this,arguments),f=(p(f,l),this.onsuccess),h=this.onerror,y=(this.onsuccess=null,this.onerror=null,o.apply(this,arguments));return f&&(this.onsuccess=this.onsuccess?xt(f,this.onsuccess):f),h&&(this.onerror=this.onerror?xt(h,this.onerror):h),l===void 0?y===void 0?void 0:y:p(l,y)}}function rn(n,o){return n===Y?o:function(){return o.apply(this,arguments)!==!1&&n.apply(this,arguments)}}function nn(n,o){return n===Y?o:function(){var u=n.apply(this,arguments);if(u&&typeof u.then=="function"){for(var l=this,f=arguments.length,h=new Array(f);f--;)h[f]=arguments[f];return u.then(function(){return o.apply(l,h)})}return o.apply(this,arguments)}}_e.ModifyError=Te,_e.DexieError=we,_e.BulkError=Se;var wt=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function B(n){wt=n}var se={},he=100,pe=typeof Promise>"u"?[]:(ve=Promise.resolve(),typeof crypto<"u"&&crypto.subtle?[pe=crypto.subtle.digest("SHA-512",new Uint8Array([0])),m(pe),ve]:[ve,m(ve),ve]),ve=pe[0],Lr=pe[1],Lr=Lr&&Lr.then,je=ve&&ve.constructor,Ze=!!pe[2],dt=function(n,o){on.push([n,o]),Wt&&(queueMicrotask(nd),Wt=!1)},ur=!0,Wt=!0,Mt=[],Ir=[],Pr=st,kt={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Y,pgp:!1,env:{},finalize:Y},me=kt,on=[],cr=0,Pn=[];function ue(n){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var o=this._PSD=me;if(typeof n!="function"){if(n!==se)throw new TypeError("Not a function");this._state=arguments[1],this._value=arguments[2],this._state===!1&&Hi(this,this._value)}else this._state=null,this._value=null,++o.ref,(function u(l,f){try{f(function(h){if(l._state===null){if(h===l)throw new TypeError("A promise cannot be resolved with itself.");var y=l._lib&&Rr();h&&typeof h.then=="function"?u(l,function(g,E){h instanceof ue?h._then(g,E):h.then(g,E)}):(l._state=!0,l._value=h,As(l)),y&&Dr()}},Hi.bind(null,l))}catch(h){Hi(l,h)}})(this,n)}var Wi={get:function(){var n=me,o=Mn;function u(l,f){var h=this,y=!n.global&&(n!==me||o!==Mn),g=y&&!Yt(),E=new ue(function(P,C){Yi(h,new Os(ks(l,n,y,g),ks(f,n,y,g),P,C,n))});return this._consoleTask&&(E._consoleTask=this._consoleTask),E}return u.prototype=se,u},set:function(n){I(this,"then",n&&n.prototype===se?Wi:{get:function(){return n},set:Wi.set})}};function Os(n,o,u,l,f){this.onFulfilled=typeof n=="function"?n:null,this.onRejected=typeof o=="function"?o:null,this.resolve=u,this.reject=l,this.psd=f}function Hi(n,o){var u,l;Ir.push(o),n._state===null&&(u=n._lib&&Rr(),o=Pr(o),n._state=!1,n._value=o,l=n,Mt.some(function(f){return f._value===l._value})||Mt.push(l),As(n),u)&&Dr()}function As(n){var o=n._listeners;n._listeners=[];for(var u=0,l=o.length;u<l;++u)Yi(n,o[u]);var f=n._PSD;--f.ref||f.finalize(),cr===0&&(++cr,dt(function(){--cr==0&&Ji()},[]))}function Yi(n,o){if(n._state===null)n._listeners.push(o);else{var u=n._state?o.onFulfilled:o.onRejected;if(u===null)return(n._state?o.resolve:o.reject)(n._value);++o.psd.ref,++cr,dt(rd,[u,n,o])}}function rd(n,o,u){try{var l,f=o._value;!o._state&&Ir.length&&(Ir=[]),l=wt&&o._consoleTask?o._consoleTask.run(function(){return n(f)}):n(f),o._state||Ir.indexOf(f)!==-1||(h=>{for(var y=Mt.length;y;)if(Mt[--y]._value===h._value)return Mt.splice(y,1)})(o),u.resolve(l)}catch(h){u.reject(h)}finally{--cr==0&&Ji(),--u.psd.ref||u.psd.finalize()}}function nd(){lr(kt,function(){Rr()&&Dr()})}function Rr(){var n=ur;return Wt=ur=!1,n}function Dr(){var n,o,u;do for(;0<on.length;)for(n=on,on=[],u=n.length,o=0;o<u;++o){var l=n[o];l[0].apply(null,l[1])}while(0<on.length);Wt=ur=!0}function Ji(){for(var n=Mt,o=(Mt=[],n.forEach(function(l){l._PSD.onunhandled.call(null,l._value,l)}),Pn.slice(0)),u=o.length;u;)o[--u]()}function Rn(n){return new ue(se,!1,n)}function Ye(n,o){var u=me;return function(){var l=Rr(),f=me;try{return Jt(u,!0),n.apply(this,arguments)}catch(h){o&&o(h)}finally{Jt(f,!1),l&&Dr()}}}w(ue.prototype,{then:Wi,_then:function(n,o){Yi(this,new Os(null,null,n,o,me))},catch:function(n){var o,u;return arguments.length===1?this.then(null,n):(o=n,u=arguments[1],typeof o=="function"?this.then(null,function(l){return(l instanceof o?u:Rn)(l)}):this.then(null,function(l){return(l&&l.name===o?u:Rn)(l)}))},finally:function(n){return this.then(function(o){return ue.resolve(n()).then(function(){return o})},function(o){return ue.resolve(n()).then(function(){return Rn(o)})})},timeout:function(n,o){var u=this;return n<1/0?new ue(function(l,f){var h=setTimeout(function(){return f(new re.Timeout(o))},n);u.then(l,f).finally(clearTimeout.bind(null,h))}):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&I(ue.prototype,Symbol.toStringTag,"Dexie.Promise"),kt.env=js(),w(ue,{all:function(){var n=H.apply(null,arguments).map(Nn);return new ue(function(o,u){n.length===0&&o([]);var l=n.length;n.forEach(function(f,h){return ue.resolve(f).then(function(y){n[h]=y,--l||o(n)},u)})})},resolve:function(n){return n instanceof ue?n:n&&typeof n.then=="function"?new ue(function(o,u){n.then(o,u)}):new ue(se,!0,n)},reject:Rn,race:function(){var n=H.apply(null,arguments).map(Nn);return new ue(function(o,u){n.map(function(l){return ue.resolve(l).then(o,u)})})},PSD:{get:function(){return me},set:function(n){return me=n}},totalEchoes:{get:function(){return Mn}},newPSD:Ht,usePSD:lr,scheduler:{get:function(){return dt},set:function(n){dt=n}},rejectionMapper:{get:function(){return Pr},set:function(n){Pr=n}},follow:function(n,o){return new ue(function(u,l){return Ht(function(f,h){var y=me;y.unhandleds=[],y.onunhandled=h,y.finalize=xt(function(){var g,E=this;g=function(){E.unhandleds.length===0?f():h(E.unhandleds[0])},Pn.push(function P(){g(),Pn.splice(Pn.indexOf(P),1)}),++cr,dt(function(){--cr==0&&Ji()},[])},y.finalize),n()},o,u,l)})}}),je&&(je.allSettled&&I(ue,"allSettled",function(){var n=H.apply(null,arguments).map(Nn);return new ue(function(o){n.length===0&&o([]);var u=n.length,l=new Array(u);n.forEach(function(f,h){return ue.resolve(f).then(function(y){return l[h]={status:"fulfilled",value:y}},function(y){return l[h]={status:"rejected",reason:y}}).then(function(){return--u||o(l)})})})}),je.any&&typeof AggregateError<"u"&&I(ue,"any",function(){var n=H.apply(null,arguments).map(Nn);return new ue(function(o,u){n.length===0&&u(new AggregateError([]));var l=n.length,f=new Array(l);n.forEach(function(h,y){return ue.resolve(h).then(function(g){return o(g)},function(g){f[y]=g,--l||u(new AggregateError(f))})})})}),je.withResolvers)&&(ue.withResolvers=je.withResolvers);var ut={awaits:0,echoes:0,id:0},id=0,Dn=[],Fn=0,Mn=0,od=0;function Ht(n,y,u,l){var f=me,h=Object.create(f),y=(h.parent=f,h.ref=0,h.global=!1,h.id=++od,kt.env,h.env=Ze?{Promise:ue,PromiseProp:{value:ue,configurable:!0,writable:!0},all:ue.all,race:ue.race,allSettled:ue.allSettled,any:ue.any,resolve:ue.resolve,reject:ue.reject}:{},y&&p(h,y),++f.ref,h.finalize=function(){--this.parent.ref||this.parent.finalize()},lr(h,n,u,l));return h.ref===0&&h.finalize(),y}function Fr(){return ut.id||(ut.id=++id),++ut.awaits,ut.echoes+=he,ut.id}function Yt(){return!!ut.awaits&&(--ut.awaits==0&&(ut.id=0),ut.echoes=ut.awaits*he,!0)}function Nn(n){return ut.echoes&&n&&n.constructor===je?(Fr(),n.then(function(o){return Yt(),o},function(o){return Yt(),nt(o)})):n}function ad(){var n=Dn[Dn.length-1];Dn.pop(),Jt(n,!1)}function Jt(n,o){var u,l,f=me;(o?!ut.echoes||Fn++&&n===me:!Fn||--Fn&&n===me)||queueMicrotask(o?(function(h){++Mn,ut.echoes&&--ut.echoes!=0||(ut.echoes=ut.awaits=ut.id=0),Dn.push(me),Jt(h,!0)}).bind(null,n):ad),n!==me&&(me=n,f===kt&&(kt.env=js()),Ze)&&(u=kt.env.Promise,l=n.env,f.global||n.global)&&(Object.defineProperty(s,"Promise",l.PromiseProp),u.all=l.all,u.race=l.race,u.resolve=l.resolve,u.reject=l.reject,l.allSettled&&(u.allSettled=l.allSettled),l.any)&&(u.any=l.any)}function js(){var n=s.Promise;return Ze?{Promise:n,PromiseProp:Object.getOwnPropertyDescriptor(s,"Promise"),all:n.all,race:n.race,allSettled:n.allSettled,any:n.any,resolve:n.resolve,reject:n.reject}:{}}function lr(n,o,u,l,f){var h=me;try{return Jt(n,!0),o(u,l,f)}finally{Jt(h,!1)}}function ks(n,o,u,l){return typeof n!="function"?n:function(){var f=me;u&&Fr(),Jt(o,!0);try{return n.apply(this,arguments)}finally{Jt(f,!1),l&&queueMicrotask(Yt)}}}function Xi(n){Promise===je&&ut.echoes===0?Fn===0?n():enqueueNativeMicroTask(n):setTimeout(n,0)}(""+Lr).indexOf("[native code]")===-1&&(Fr=Yt=Y);var nt=ue.reject,fr="￿",Nt="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",$s="String expected.",Mr=[],Bn="__dbnames",Zi="readonly",Qi="readwrite";function dr(n,o){return n?o?function(){return n.apply(this,arguments)&&o.apply(this,arguments)}:n:o}var Is={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function qn(n){return typeof n!="string"||/\./.test(n)?function(o){return o}:function(o){return o[n]===void 0&&n in o&&delete(o=ee(o))[n],o}}function Ps(){throw re.Type("Entity instances must never be new:ed. Instances are generated by the framework bypassing the constructor.")}function $e(n,o){try{var u=Rs(n),l=Rs(o);if(u!==l)return u==="Array"?1:l==="Array"?-1:u==="binary"?1:l==="binary"?-1:u==="string"?1:l==="string"?-1:u==="Date"?1:l!=="Date"?NaN:-1;switch(u){case"number":case"Date":case"string":return o<n?1:n<o?-1:0;case"binary":for(var f=Ds(n),h=Ds(o),y=f.length,g=h.length,E=y<g?y:g,P=0;P<E;++P)if(f[P]!==h[P])return f[P]<h[P]?-1:1;return y===g?0:y<g?-1:1;case"Array":for(var C=n,S=o,A=C.length,j=S.length,O=A<j?A:j,T=0;T<O;++T){var D=$e(C[T],S[T]);if(D!==0)return D}return A===j?0:A<j?-1:1}}catch{}return NaN}function Rs(n){var o=typeof n;return o=="object"&&(ArrayBuffer.isView(n)||(o=ge(n))==="ArrayBuffer")?"binary":o}function Ds(n){return n instanceof Uint8Array?n:ArrayBuffer.isView(n)?new Uint8Array(n.buffer,n.byteOffset,n.byteLength):new Uint8Array(n)}function Ln(n,o,u){var l=n.schema.yProps;return l?(o&&0<u.numFailures&&(o=o.filter(function(f,h){return!u.failures[h]})),Promise.all(l.map(function(f){return f=f.updatesTable,o?n.db.table(f).where("k").anyOf(o).delete():n.db.table(f).clear()})).then(function(){return u})):u}Fs.prototype.execute=function(n){var o=this["@@propmod"];if(o.add!==void 0){var u=o.add;if(d(u))return a(a([],d(n)?n:[],!0),u).sort();if(typeof u=="number")return(Number(n)||0)+u;if(typeof u=="bigint")try{return BigInt(n)+u}catch{return BigInt(0)+u}throw new TypeError("Invalid term ".concat(u))}if(o.remove!==void 0){var l=o.remove;if(d(l))return d(n)?n.filter(function(f){return!l.includes(f)}).sort():[];if(typeof l=="number")return Number(n)-l;if(typeof l=="bigint")try{return BigInt(n)-l}catch{return BigInt(0)-l}throw new TypeError("Invalid subtrahend ".concat(l))}return u=(u=o.replacePrefix)==null?void 0:u[0],u&&typeof n=="string"&&n.startsWith(u)?o.replacePrefix[1]+n.substring(u.length):n};var an=Fs;function Fs(n){this["@@propmod"]=n}function Ms(n,o){for(var u=c(o),l=u.length,f=!1,h=0;h<l;++h){var y=u[h],g=o[y],E=N(n,y);g instanceof an?(Z(n,y,g.execute(E)),f=!0):E!==g&&(Z(n,y,g),f=!0)}return f}Ve.prototype._trans=function(n,o,u){var l=this._tx||me.trans,f=this.name,h=wt&&typeof console<"u"&&console.createTask&&console.createTask("Dexie: ".concat(n==="readonly"?"read":"write"," ").concat(this.name));function y(P,C,S){if(S.schema[f])return o(S.idbtrans,S);throw new re.NotFound("Table "+f+" not part of transaction")}var g=Rr();try{var E=l&&l.db._novip===this.db._novip?l===me.trans?l._promise(n,y,u):Ht(function(){return l._promise(n,y,u)},{trans:l,transless:me.transless||me}):(function P(C,S,A,j){if(C.idbdb&&(C._state.openComplete||me.letThrough||C._vip)){var O=C._createTransaction(S,A,C._dbSchema);try{O.create(),C._state.PR1398_maxLoop=3}catch(T){return T.name===Ae.InvalidState&&C.isOpen()&&0<--C._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),C.close({disableAutoOpen:!1}),C.open().then(function(){return P(C,S,A,j)})):nt(T)}return O._promise(S,function(T,D){return Ht(function(){return me.trans=O,j(T,D,O)})}).then(function(T){if(S==="readwrite")try{O.idbtrans.commit()}catch{}return S==="readonly"?T:O._completion.then(function(){return T})})}if(C._state.openComplete)return nt(new re.DatabaseClosed(C._state.dbOpenError));if(!C._state.isBeingOpened){if(!C._state.autoOpen)return nt(new re.DatabaseClosed);C.open().catch(Y)}return C._state.dbReadyPromise.then(function(){return P(C,S,A,j)})})(this.db,n,[this.name],y);return h&&(E._consoleTask=h,E=E.catch(function(P){return console.trace(P),nt(P)})),E}finally{g&&Dr()}},Ve.prototype.get=function(n,o){var u=this;return n&&n.constructor===Object?this.where(n).first(o):n==null?nt(new re.Type("Invalid argument to Table.get()")):this._trans("readonly",function(l){return u.core.get({trans:l,key:n}).then(function(f){return u.hook.reading.fire(f)})}).then(o)},Ve.prototype.where=function(n){if(typeof n=="string")return new this.db.WhereClause(this,n);if(d(n))return new this.db.WhereClause(this,"[".concat(n.join("+"),"]"));var o=c(n);if(o.length===1)return this.where(o[0]).equals(n[o[0]]);var u=this.schema.indexes.concat(this.schema.primKey).filter(function(g){if(g.compound&&o.every(function(P){return 0<=g.keyPath.indexOf(P)})){for(var E=0;E<o.length;++E)if(o.indexOf(g.keyPath[E])===-1)return!1;return!0}return!1}).sort(function(g,E){return g.keyPath.length-E.keyPath.length})[0];if(u&&this.db._maxKey!==fr)return y=u.keyPath.slice(0,o.length),this.where(y).equals(y.map(function(g){return n[g]}));!u&&wt&&console.warn("The query ".concat(JSON.stringify(n)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(o.join("+"),"]"));var l=this.schema.idxByName;function f(g,E){return $e(g,E)===0}var y=o.reduce(function(C,E){var P=C[0],C=C[1],S=l[E],A=n[E];return[P||S,P||!S?dr(C,S&&S.multi?function(j){return j=N(j,E),d(j)&&j.some(function(O){return f(A,O)})}:function(j){return f(A,N(j,E))}):C]},[null,null]),h=y[0],y=y[1];return h?this.where(h.name).equals(n[h.keyPath]).filter(y):u?this.filter(y):this.where(o).equals("")},Ve.prototype.filter=function(n){return this.toCollection().and(n)},Ve.prototype.count=function(n){return this.toCollection().count(n)},Ve.prototype.offset=function(n){return this.toCollection().offset(n)},Ve.prototype.limit=function(n){return this.toCollection().limit(n)},Ve.prototype.each=function(n){return this.toCollection().each(n)},Ve.prototype.toArray=function(n){return this.toCollection().toArray(n)},Ve.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},Ve.prototype.orderBy=function(n){return new this.db.Collection(new this.db.WhereClause(this,d(n)?"[".concat(n.join("+"),"]"):n))},Ve.prototype.reverse=function(){return this.toCollection().reverse()},Ve.prototype.mapToClass=function(n){for(var o=this.db,u=this.name,l=((this.schema.mappedClass=n).prototype instanceof Ps&&(n=(y=>{var g=C,E=y;if(typeof E!="function"&&E!==null)throw new TypeError("Class extends value "+String(E)+" is not a constructor or null");function P(){this.constructor=g}function C(){return y!==null&&y.apply(this,arguments)||this}return r(g,E),g.prototype=E===null?Object.create(E):(P.prototype=E.prototype,new P),Object.defineProperty(C.prototype,"db",{get:function(){return o},enumerable:!1,configurable:!0}),C.prototype.table=function(){return u},C})(n)),new Set),f=n.prototype;f;f=m(f))Object.getOwnPropertyNames(f).forEach(function(y){return l.add(y)});function h(y){if(!y)return y;var g,E=Object.create(n.prototype);for(g in y)if(!l.has(g))try{E[g]=y[g]}catch{}return E}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=h,this.hook("reading",h),n},Ve.prototype.defineClass=function(){return this.mapToClass(function(n){p(this,n)})},Ve.prototype.add=function(n,o){var u=this,l=this.schema.primKey,f=l.auto,h=l.keyPath,y=n;return h&&f&&(y=qn(h)(n)),this._trans("readwrite",function(g){return u.core.mutate({trans:g,type:"add",keys:o!=null?[o]:null,values:[y]})}).then(function(g){return g.numFailures?ue.reject(g.failures[0]):g.lastResult}).then(function(g){if(h)try{Z(n,h,g)}catch{}return g})},Ve.prototype.upsert=function(n,o){var u=this,l=this.schema.primKey.keyPath;return this._trans("readwrite",function(f){return u.core.get({trans:f,key:n}).then(function(h){var y=h??{};return Ms(y,o),l&&Z(y,l,n),u.core.mutate({trans:f,type:"put",values:[y],keys:[n],upsert:!0,updates:{keys:[n],changeSpecs:[o]}}).then(function(g){return g.numFailures?ue.reject(g.failures[0]):!!h})})})},Ve.prototype.update=function(n,o){return typeof n!="object"||d(n)?this.where(":id").equals(n).modify(o):(n=N(n,this.schema.primKey.keyPath))===void 0?nt(new re.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(n).modify(o)},Ve.prototype.put=function(n,o){var u=this,l=this.schema.primKey,f=l.auto,h=l.keyPath,y=n;return h&&f&&(y=qn(h)(n)),this._trans("readwrite",function(g){return u.core.mutate({trans:g,type:"put",values:[y],keys:o!=null?[o]:null})}).then(function(g){return g.numFailures?ue.reject(g.failures[0]):g.lastResult}).then(function(g){if(h)try{Z(n,h,g)}catch{}return g})},Ve.prototype.delete=function(n){var o=this;return this._trans("readwrite",function(u){return o.core.mutate({trans:u,type:"delete",keys:[n]}).then(function(l){return Ln(o,[n],l)}).then(function(l){return l.numFailures?ue.reject(l.failures[0]):void 0})})},Ve.prototype.clear=function(){var n=this;return this._trans("readwrite",function(o){return n.core.mutate({trans:o,type:"deleteRange",range:Is}).then(function(u){return Ln(n,null,u)})}).then(function(o){return o.numFailures?ue.reject(o.failures[0]):void 0})},Ve.prototype.bulkGet=function(n){var o=this;return this._trans("readonly",function(u){return o.core.getMany({keys:n,trans:u}).then(function(l){return l.map(function(f){return o.hook.reading.fire(f)})})})},Ve.prototype.bulkAdd=function(n,o,u){var l=this,f=Array.isArray(o)?o:void 0,h=(u=u||(f?void 0:o))?u.allKeys:void 0;return this._trans("readwrite",function(y){var g=l.schema.primKey,P=g.auto,g=g.keyPath;if(g&&f)throw new re.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(f&&f.length!==n.length)throw new re.InvalidArgument("Arguments objects and keys must have the same length");var E=n.length,P=g&&P?n.map(qn(g)):n;return l.core.mutate({trans:y,type:"add",keys:f,values:P,wantResults:h}).then(function(C){var S=C.numFailures,A=C.failures;if(S===0)return h?C.results:C.lastResult;throw new Se("".concat(l.name,".bulkAdd(): ").concat(S," of ").concat(E," operations failed"),A)})})},Ve.prototype.bulkPut=function(n,o,u){var l=this,f=Array.isArray(o)?o:void 0,h=(u=u||(f?void 0:o))?u.allKeys:void 0;return this._trans("readwrite",function(y){var g=l.schema.primKey,P=g.auto,g=g.keyPath;if(g&&f)throw new re.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(f&&f.length!==n.length)throw new re.InvalidArgument("Arguments objects and keys must have the same length");var E=n.length,P=g&&P?n.map(qn(g)):n;return l.core.mutate({trans:y,type:"put",keys:f,values:P,wantResults:h}).then(function(C){var S=C.numFailures,A=C.failures;if(S===0)return h?C.results:C.lastResult;throw new Se("".concat(l.name,".bulkPut(): ").concat(S," of ").concat(E," operations failed"),A)})})},Ve.prototype.bulkUpdate=function(n){var o=this,u=this.core,l=n.map(function(y){return y.key}),f=n.map(function(y){return y.changes}),h=[];return this._trans("readwrite",function(y){return u.getMany({trans:y,keys:l,cache:"clone"}).then(function(g){var E=[],P=[],C=(n.forEach(function(S,A){var j=S.key,O=S.changes,T=g[A];if(T){for(var D=0,F=Object.keys(O);D<F.length;D++){var $=F[D],V=O[$];if($===o.schema.primKey.keyPath){if($e(V,j)!==0)throw new re.Constraint("Cannot update primary key in bulkUpdate()")}else Z(T,$,V)}h.push(A),E.push(j),P.push(T)}}),E.length);return u.mutate({trans:y,type:"put",keys:E,values:P,updates:{keys:l,changeSpecs:f}}).then(function(S){var A=S.numFailures,j=S.failures;if(A===0)return C;for(var O=0,T=Object.keys(j);O<T.length;O++){var D,F=T[O],$=h[Number(F)];$!=null&&(D=j[F],delete j[F],j[$]=D)}throw new Se("".concat(o.name,".bulkUpdate(): ").concat(A," of ").concat(C," operations failed"),j)})})})},Ve.prototype.bulkDelete=function(n){var o=this,u=n.length;return this._trans("readwrite",function(l){return o.core.mutate({trans:l,type:"delete",keys:n}).then(function(f){return Ln(o,n,f)})}).then(function(l){var f=l.numFailures,h=l.failures;if(f===0)return l.lastResult;throw new Se("".concat(o.name,".bulkDelete(): ").concat(f," of ").concat(u," operations failed"),h)})};var Ns=Ve;function Ve(){}function sn(n){function o(y,g){if(g){for(var E=arguments.length,P=new Array(E-1);--E;)P[E-1]=arguments[E];return u[y].subscribe.apply(null,P),n}if(typeof y=="string")return u[y]}var u={};o.addEventType=h;for(var l=1,f=arguments.length;l<f;++l)h(arguments[l]);return o;function h(y,g,E){var P,C;if(typeof y!="object")return g=g||rn,C={subscribers:[],fire:E=E||Y,subscribe:function(S){C.subscribers.indexOf(S)===-1&&(C.subscribers.push(S),C.fire=g(C.fire,S))},unsubscribe:function(S){C.subscribers=C.subscribers.filter(function(A){return A!==S}),C.fire=C.subscribers.reduce(g,E)}},u[y]=o[y]=C;c(P=y).forEach(function(S){var A=P[S];if(d(A))h(S,P[S][0],P[S][1]);else{if(A!=="asap")throw new re.InvalidArgument("Invalid event config");var j=h(S,st,function(){for(var O=arguments.length,T=new Array(O);O--;)T[O]=arguments[O];j.subscribers.forEach(function(D){L(function(){D.apply(null,T)})})})}})}}function un(n,o){return b(o).from({prototype:n}),o}function Nr(n,o){return!(n.filter||n.algorithm||n.or)&&(o?n.justLimit:!n.replayFilter)}function eo(n,o){n.filter=dr(n.filter,o)}function to(n,o,u){var l=n.replayFilter;n.replayFilter=l?function(){return dr(l(),o())}:o,n.justLimit=u&&!l}function Kn(n,o){if(n.isPrimKey)return o.primaryKey;var u=o.getIndexByKeyPath(n.index);if(u)return u;throw new re.Schema("KeyPath "+n.index+" on object store "+o.name+" is not indexed")}function Bs(n,o,u){var l=Kn(n,o.schema);return o.openCursor({trans:u,values:!n.keysOnly,reverse:n.dir==="prev",unique:!!n.unique,query:{index:l,range:n.range}})}function Vn(n,o,u,l){var f,h,y=n.replayFilter?dr(n.filter,n.replayFilter()):n.filter;return n.or?(f={},h=function(g,E,P){var C,S;y&&!y(E,P,function(A){return E.stop(A)},function(A){return E.fail(A)})||((S=""+(C=E.primaryKey))=="[object ArrayBuffer]"&&(S=""+new Uint8Array(C)),_(f,S))||(f[S]=!0,o(g,E,P))},Promise.all([n.or._iterate(h,u),qs(Bs(n,l,u),n.algorithm,h,!n.keysOnly&&n.valueMapper)])):qs(Bs(n,l,u),dr(n.algorithm,y),o,!n.keysOnly&&n.valueMapper)}function qs(n,o,u,l){var f=Ye(l?function(h,y,g){return u(l(h),y,g)}:u);return n.then(function(h){if(h)return h.start(function(){var y=function(){return h.continue()};o&&!o(h,function(g){return y=g},function(g){h.stop(g),y=Y},function(g){h.fail(g),y=Y})||f(h.value,h,function(g){return y=g}),y()})})}Re.prototype._read=function(n,o){var u=this._ctx;return u.error?u.table._trans(null,nt.bind(null,u.error)):u.table._trans("readonly",n).then(o)},Re.prototype._write=function(n){var o=this._ctx;return o.error?o.table._trans(null,nt.bind(null,o.error)):o.table._trans("readwrite",n,"locked")},Re.prototype._addAlgorithm=function(n){var o=this._ctx;o.algorithm=dr(o.algorithm,n)},Re.prototype._iterate=function(n,o){return Vn(this._ctx,n,o,this._ctx.table.core)},Re.prototype.clone=function(n){var o=Object.create(this.constructor.prototype),u=Object.create(this._ctx);return n&&p(u,n),o._ctx=u,o},Re.prototype.raw=function(){return this._ctx.valueMapper=null,this},Re.prototype.each=function(n){var o=this._ctx;return this._read(function(u){return Vn(o,n,u,o.table.core)})},Re.prototype.count=function(n){var o=this;return this._read(function(u){var l,f=o._ctx,h=f.table.core;return Nr(f,!0)?h.count({trans:u,query:{index:Kn(f,h.schema),range:f.range}}).then(function(y){return Math.min(y,f.limit)}):(l=0,Vn(f,function(){return++l,!1},u,h).then(function(){return l}))}).then(n)},Re.prototype.sortBy=function(n,o){var u=n.split(".").reverse(),l=u[0],f=u.length-1;function h(E,P){return P?h(E[u[P]],P-1):E[l]}var y=this._ctx.dir==="next"?1:-1;function g(E,P){return $e(h(E,f),h(P,f))*y}return this.toArray(function(E){return E.sort(g)}).then(o)},Re.prototype.toArray=function(n){var o=this;return this._read(function(u){var l,f,h,y=o._ctx;return y.dir==="next"&&Nr(y,!0)&&0<y.limit?(l=y.valueMapper,f=Kn(y,y.table.core.schema),y.table.core.query({trans:u,limit:y.limit,values:!0,query:{index:f,range:y.range}}).then(function(g){return g=g.result,l?g.map(l):g})):(h=[],Vn(y,function(g){return h.push(g)},u,y.table.core).then(function(){return h}))},n)},Re.prototype.offset=function(n){var o=this._ctx;return n<=0||(o.offset+=n,Nr(o)?to(o,function(){var u=n;return function(l,f){return u===0||(u===1?--u:f(function(){l.advance(u),u=0}),!1)}}):to(o,function(){var u=n;return function(){return--u<0}})),this},Re.prototype.limit=function(n){return this._ctx.limit=Math.min(this._ctx.limit,n),to(this._ctx,function(){var o=n;return function(u,l,f){return--o<=0&&l(f),0<=o}},!0),this},Re.prototype.until=function(n,o){return eo(this._ctx,function(u,l,f){return!n(u.value)||(l(f),o)}),this},Re.prototype.first=function(n){return this.limit(1).toArray(function(o){return o[0]}).then(n)},Re.prototype.last=function(n){return this.reverse().first(n)},Re.prototype.filter=function(n){var o;return eo(this._ctx,function(u){return n(u.value)}),(o=this._ctx).isMatch=dr(o.isMatch,n),this},Re.prototype.and=function(n){return this.filter(n)},Re.prototype.or=function(n){return new this.db.WhereClause(this._ctx.table,n,this)},Re.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},Re.prototype.desc=function(){return this.reverse()},Re.prototype.eachKey=function(n){var o=this._ctx;return o.keysOnly=!o.isMatch,this.each(function(u,l){n(l.key,l)})},Re.prototype.eachUniqueKey=function(n){return this._ctx.unique="unique",this.eachKey(n)},Re.prototype.eachPrimaryKey=function(n){var o=this._ctx;return o.keysOnly=!o.isMatch,this.each(function(u,l){n(l.primaryKey,l)})},Re.prototype.keys=function(n){var o=this._ctx,u=(o.keysOnly=!o.isMatch,[]);return this.each(function(l,f){u.push(f.key)}).then(function(){return u}).then(n)},Re.prototype.primaryKeys=function(n){var o=this._ctx;if(o.dir==="next"&&Nr(o,!0)&&0<o.limit)return this._read(function(l){var f=Kn(o,o.table.core.schema);return o.table.core.query({trans:l,values:!1,limit:o.limit,query:{index:f,range:o.range}})}).then(function(l){return l.result}).then(n);o.keysOnly=!o.isMatch;var u=[];return this.each(function(l,f){u.push(f.primaryKey)}).then(function(){return u}).then(n)},Re.prototype.uniqueKeys=function(n){return this._ctx.unique="unique",this.keys(n)},Re.prototype.firstKey=function(n){return this.limit(1).keys(function(o){return o[0]}).then(n)},Re.prototype.lastKey=function(n){return this.reverse().firstKey(n)},Re.prototype.distinct=function(){var n,o=this._ctx,o=o.index&&o.table.schema.idxByName[o.index];return o&&o.multi&&(n={},eo(this._ctx,function(l){var l=l.primaryKey.toString(),f=_(n,l);return n[l]=!0,!f})),this},Re.prototype.modify=function(n){var o=this,u=this._ctx;return this._write(function(l){function f(T,D){var F=D.failures;A+=T-D.numFailures;for(var $=0,V=c(F);$<V.length;$++){var J=V[$];S.push(F[J])}}var h=typeof n=="function"?n:function(T){return Ms(T,n)},y=u.table.core,C=y.schema.primaryKey,g=C.outbound,E=C.extractKey,P=200,C=o.db._options.modifyChunkSize,S=(C&&(P=typeof C=="object"?C[y.name]||C["*"]||200:C),[]),A=0,j=[],O=n===Ls;return o.clone().primaryKeys().then(function(T){function D($){var V=Math.min(P,T.length-$),J=T.slice($,$+V);return(O?Promise.resolve([]):y.getMany({trans:l,keys:J,cache:"immutable"})).then(function(ie){var oe=[],Q=[],fe=g?[]:null,ce=O?J:[];if(!O)for(var ne=0;ne<V;++ne){var de=ie[ne],Pe={value:ee(de),primKey:T[$+ne]};h.call(Pe,Pe.value,Pe)!==!1&&(Pe.value==null?ce.push(T[$+ne]):g||$e(E(de),E(Pe.value))===0?(Q.push(Pe.value),g&&fe.push(T[$+ne])):(ce.push(T[$+ne]),oe.push(Pe.value)))}return Promise.resolve(0<oe.length&&y.mutate({trans:l,type:"add",values:oe}).then(function(De){for(var xe in De.failures)ce.splice(parseInt(xe),1);f(oe.length,De)})).then(function(){return(0<Q.length||F&&typeof n=="object")&&y.mutate({trans:l,type:"put",keys:fe,values:Q,criteria:F,changeSpec:typeof n!="function"&&n,isAdditionalChunk:0<$}).then(function(De){return f(Q.length,De)})}).then(function(){return(0<ce.length||F&&O)&&y.mutate({trans:l,type:"delete",keys:ce,criteria:F,isAdditionalChunk:0<$}).then(function(De){return Ln(u.table,ce,De)}).then(function(De){return f(ce.length,De)})}).then(function(){return T.length>$+V&&D($+P)})})}var F=Nr(u)&&u.limit===1/0&&(typeof n!="function"||O)&&{index:u.index,range:u.range};return D(0).then(function(){if(0<S.length)throw new Te("Error modifying one or more objects",S,A,j);return T.length})})})},Re.prototype.delete=function(){var n=this._ctx,o=n.range;return!Nr(n)||n.table.schema.yProps||!n.isPrimKey&&o.type!==3?this.modify(Ls):this._write(function(u){var l=n.table.core.schema.primaryKey,f=o;return n.table.core.count({trans:u,query:{index:l,range:f}}).then(function(h){return n.table.core.mutate({trans:u,type:"deleteRange",range:f}).then(function(E){var g=E.failures,E=E.numFailures;if(E)throw new Te("Could not delete some values",Object.keys(g).map(function(P){return g[P]}),h-E);return h-E})})})};var sd=Re;function Re(){}var Ls=function(n,o){return o.value=null};function ud(n,o){return n<o?-1:n===o?0:1}function cd(n,o){return o<n?-1:n===o?0:1}function vt(n,o,u){return n=n instanceof Vs?new n.Collection(n):n,n._ctx.error=new(u||TypeError)(o),n}function Br(n){return new n.Collection(n,function(){return Ks("")}).limit(0)}function zn(j,o,u,l){var f,h,y,g,E,P,C,S=u.length;if(!u.every(function(T){return typeof T=="string"}))return vt(j,$s);function A(T){f=T==="next"?function(F){return F.toUpperCase()}:function(F){return F.toLowerCase()},h=T==="next"?function(F){return F.toLowerCase()}:function(F){return F.toUpperCase()},y=T==="next"?ud:cd;var D=u.map(function(F){return{lower:h(F),upper:f(F)}}).sort(function(F,$){return y(F.lower,$.lower)});g=D.map(function(F){return F.upper}),E=D.map(function(F){return F.lower}),C=(P=T)==="next"?"":l}A("next");var j=new j.Collection(j,function(){return Xt(g[0],E[S-1]+l)}),O=(j._ondirectionchange=function(T){A(T)},0);return j._addAlgorithm(function(T,D,F){var $=T.key;if(typeof $=="string"){var V=h($);if(o(V,E,O))return!0;for(var J=null,ie=O;ie<S;++ie){var oe=((Q,fe,ce,ne,de,Pe)=>{for(var De=Math.min(Q.length,ne.length),xe=-1,ke=0;ke<De;++ke){var Xe=fe[ke];if(Xe!==ne[ke])return de(Q[ke],ce[ke])<0?Q.substr(0,ke)+ce[ke]+ce.substr(ke+1):de(Q[ke],ne[ke])<0?Q.substr(0,ke)+ne[ke]+ce.substr(ke+1):0<=xe?Q.substr(0,xe)+fe[xe]+ce.substr(xe+1):null;de(Q[ke],Xe)<0&&(xe=ke)}return De<ne.length&&Pe==="next"?Q+ce.substr(Q.length):De<Q.length&&Pe==="prev"?Q.substr(0,ce.length):xe<0?null:Q.substr(0,xe)+ne[xe]+ce.substr(xe+1)})($,V,g[ie],E[ie],y,P);oe===null&&J===null?O=ie+1:(J===null||0<y(J,oe))&&(J=oe)}D(J!==null?function(){T.continue(J+C)}:F)}return!1}),j}function Xt(n,o,u,l){return{type:2,lower:n,upper:o,lowerOpen:u,upperOpen:l}}function Ks(n){return{type:1,lower:n,upper:n}}Object.defineProperty(ct.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),ct.prototype.between=function(n,o,u,l){u=u!==!1,l=l===!0;try{return 0<this._cmp(n,o)||this._cmp(n,o)===0&&(u||l)&&(!u||!l)?Br(this):new this.Collection(this,function(){return Xt(n,o,!u,!l)})}catch{return vt(this,Nt)}},ct.prototype.equals=function(n){return n==null?vt(this,Nt):new this.Collection(this,function(){return Ks(n)})},ct.prototype.above=function(n){return n==null?vt(this,Nt):new this.Collection(this,function(){return Xt(n,void 0,!0)})},ct.prototype.aboveOrEqual=function(n){return n==null?vt(this,Nt):new this.Collection(this,function(){return Xt(n,void 0,!1)})},ct.prototype.below=function(n){return n==null?vt(this,Nt):new this.Collection(this,function(){return Xt(void 0,n,!1,!0)})},ct.prototype.belowOrEqual=function(n){return n==null?vt(this,Nt):new this.Collection(this,function(){return Xt(void 0,n)})},ct.prototype.startsWith=function(n){return typeof n!="string"?vt(this,$s):this.between(n,n+fr,!0,!0)},ct.prototype.startsWithIgnoreCase=function(n){return n===""?this.startsWith(n):zn(this,function(o,u){return o.indexOf(u[0])===0},[n],fr)},ct.prototype.equalsIgnoreCase=function(n){return zn(this,function(o,u){return o===u[0]},[n],"")},ct.prototype.anyOfIgnoreCase=function(){var n=H.apply(ft,arguments);return n.length===0?Br(this):zn(this,function(o,u){return u.indexOf(o)!==-1},n,"")},ct.prototype.startsWithAnyOfIgnoreCase=function(){var n=H.apply(ft,arguments);return n.length===0?Br(this):zn(this,function(o,u){return u.some(function(l){return o.indexOf(l)===0})},n,fr)},ct.prototype.anyOf=function(){var n,o,u=this,l=H.apply(ft,arguments),f=this._cmp;try{l.sort(f)}catch{return vt(this,Nt)}return l.length===0?Br(this):((n=new this.Collection(this,function(){return Xt(l[0],l[l.length-1])}))._ondirectionchange=function(h){f=h==="next"?u._ascending:u._descending,l.sort(f)},o=0,n._addAlgorithm(function(h,y,g){for(var E=h.key;0<f(E,l[o]);)if(++o===l.length)return y(g),!1;return f(E,l[o])===0||(y(function(){h.continue(l[o])}),!1)}),n)},ct.prototype.notEqual=function(n){return this.inAnyRange([[-1/0,n],[n,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},ct.prototype.noneOf=function(){var n=H.apply(ft,arguments);if(n.length===0)return new this.Collection(this);try{n.sort(this._ascending)}catch{return vt(this,Nt)}var o=n.reduce(function(u,l){return u?u.concat([[u[u.length-1][1],l]]):[[-1/0,l]]},null);return o.push([n[n.length-1],this.db._maxKey]),this.inAnyRange(o,{includeLowers:!1,includeUppers:!1})},ct.prototype.inAnyRange=function(n,F){var u=this,l=this._cmp,f=this._ascending,h=this._descending,y=this._min,g=this._max;if(n.length===0)return Br(this);if(!n.every(function($){return $[0]!==void 0&&$[1]!==void 0&&f($[0],$[1])<=0}))return vt(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",re.InvalidArgument);var E=!F||F.includeLowers!==!1,P=F&&F.includeUppers===!0,C,S=f;function A($,V){return S($[0],V[0])}try{(C=n.reduce(function($,V){for(var J=0,ie=$.length;J<ie;++J){var oe=$[J];if(l(V[0],oe[1])<0&&0<l(V[1],oe[0])){oe[0]=y(oe[0],V[0]),oe[1]=g(oe[1],V[1]);break}}return J===ie&&$.push(V),$},[])).sort(A)}catch{return vt(this,Nt)}var j=0,O=P?function($){return 0<f($,C[j][1])}:function($){return 0<=f($,C[j][1])},T=E?function($){return 0<h($,C[j][0])}:function($){return 0<=h($,C[j][0])},D=O,F=new this.Collection(this,function(){return Xt(C[0][0],C[C.length-1][1],!E,!P)});return F._ondirectionchange=function($){S=$==="next"?(D=O,f):(D=T,h),C.sort(A)},F._addAlgorithm(function($,V,J){for(var ie,oe=$.key;D(oe);)if(++j===C.length)return V(J),!1;return!O(ie=oe)&&!T(ie)||(u._cmp(oe,C[j][1])===0||u._cmp(oe,C[j][0])===0||V(function(){S===f?$.continue(C[j][0]):$.continue(C[j][1])}),!1)}),F},ct.prototype.startsWithAnyOf=function(){var n=H.apply(ft,arguments);return n.every(function(o){return typeof o=="string"})?n.length===0?Br(this):this.inAnyRange(n.map(function(o){return[o,o+fr]})):vt(this,"startsWithAnyOf() only works with strings")};var Vs=ct;function ct(){}function $t(n){return Ye(function(o){return cn(o),n(o.target.error),!1})}function cn(n){n.stopPropagation&&n.stopPropagation(),n.preventDefault&&n.preventDefault()}var ln="storagemutated",ro="x-storagemutated-1",Zt=sn(null,ln),ld=(It.prototype._lock=function(){return X(!me.global),++this._reculock,this._reculock!==1||me.global||(me.lockOwnerFor=this),this},It.prototype._unlock=function(){if(X(!me.global),--this._reculock==0)for(me.global||(me.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var n=this._blockedFuncs.shift();try{lr(n[1],n[0])}catch{}}return this},It.prototype._locked=function(){return this._reculock&&me.lockOwnerFor!==this},It.prototype.create=function(n){var o=this;if(this.mode){var u=this.db.idbdb,l=this.db._state.dbOpenError;if(X(!this.idbtrans),!n&&!u)switch(l&&l.name){case"DatabaseClosedError":throw new re.DatabaseClosed(l);case"MissingAPIError":throw new re.MissingAPI(l.message,l);default:throw new re.OpenFailed(l)}if(!this.active)throw new re.TransactionInactive;X(this._completion._state===null),(n=this.idbtrans=n||(this.db.core||u).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=Ye(function(f){cn(f),o._reject(n.error)}),n.onabort=Ye(function(f){cn(f),o.active&&o._reject(new re.Abort(n.error)),o.active=!1,o.on("abort").fire(f)}),n.oncomplete=Ye(function(){o.active=!1,o._resolve(),"mutatedParts"in n&&Zt.storagemutated.fire(n.mutatedParts)})}return this},It.prototype._promise=function(n,o,u){var l,f=this;return n==="readwrite"&&this.mode!=="readwrite"?nt(new re.ReadOnly("Transaction is readonly")):this.active?this._locked()?new ue(function(h,y){f._blockedFuncs.push([function(){f._promise(n,o,u).then(h,y)},me])}):u?Ht(function(){var h=new ue(function(y,g){f._lock();var E=o(y,g,f);E&&E.then&&E.then(y,g)});return h.finally(function(){return f._unlock()}),h._lib=!0,h}):((l=new ue(function(h,y){var g=o(h,y,f);g&&g.then&&g.then(h,y)}))._lib=!0,l):nt(new re.TransactionInactive)},It.prototype._root=function(){return this.parent?this.parent._root():this},It.prototype.waitFor=function(n){var o,u=this._root(),l=ue.resolve(n),f=(u._waitingFor?u._waitingFor=u._waitingFor.then(function(){return l}):(u._waitingFor=l,u._waitingQueue=[],o=u.idbtrans.objectStore(u.storeNames[0]),(function h(){for(++u._spinCount;u._waitingQueue.length;)u._waitingQueue.shift()();u._waitingFor&&(o.get(-1/0).onsuccess=h)})()),u._waitingFor);return new ue(function(h,y){l.then(function(g){return u._waitingQueue.push(Ye(h.bind(null,g)))},function(g){return u._waitingQueue.push(Ye(y.bind(null,g)))}).finally(function(){u._waitingFor===f&&(u._waitingFor=null)})})},It.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new re.Abort))},It.prototype.table=function(n){var o=this._memoizedTables||(this._memoizedTables={});if(_(o,n))return o[n];var u=this.schema[n];if(u)return(u=new this.db.Table(n,u,this)).core=this.db.core.table(n),o[n]=u;throw new re.NotFound("Table "+n+" not part of transaction")},It);function It(){}function no(n,o,u,l,f,h,y,g){return{name:n,keyPath:o,unique:u,multi:l,auto:f,compound:h,src:(u&&!y?"&":"")+(l?"*":"")+(f?"++":"")+zs(o),type:g}}function zs(n){return typeof n=="string"?n:n?"["+[].join.call(n,"+")+"]":""}function io(n,o,u){return{name:n,primKey:o,indexes:u,mappedClass:null,idxByName:(l=function(f){return[f.name,f]},u.reduce(function(f,h,y){return h=l(h,y),h&&(f[h[0]]=h[1]),f},{}))};var l}var fn=function(n){try{return n.only([[]]),fn=function(){return[[]]},[[]]}catch{return fn=function(){return fr},fr}};function oo(n){return n==null?function(){}:typeof n=="string"?(o=n).split(".").length===1?function(u){return u[o]}:function(u){return N(u,o)}:function(u){return N(u,n)};var o}function Us(n){return[].slice.call(n)}var fd=0;function dn(n){return n==null?":id":typeof n=="string"?n:"[".concat(n.join("+"),"]")}function dd(n,o,E){function l(O){if(O.type===3)return null;if(O.type===4)throw new Error("Cannot convert never type to IDBKeyRange");var S=O.lower,A=O.upper,j=O.lowerOpen,O=O.upperOpen;return S===void 0?A===void 0?null:o.upperBound(A,!!O):A===void 0?o.lowerBound(S,!!j):o.bound(S,A,!!j,!!O)}function f(C){var S,A=C.name;return{name:A,schema:C,mutate:function(j){var O=j.trans,T=j.type,D=j.keys,F=j.values,$=j.range;return new Promise(function(V,J){V=Ye(V);var ie=O.objectStore(A),oe=ie.keyPath==null,Q=T==="put"||T==="add";if(!Q&&T!=="delete"&&T!=="deleteRange")throw new Error("Invalid operation type: "+T);var fe,ce=(D||F||{length:1}).length;if(D&&F&&D.length!==F.length)throw new Error("Given keys array must have same length as given values array.");if(ce===0)return V({numFailures:0,failures:{},results:[],lastResult:void 0});function ne(Qe){++De,cn(Qe)}var de=[],Pe=[],De=0;if(T==="deleteRange"){if($.type===4)return V({numFailures:De,failures:Pe,results:[],lastResult:void 0});$.type===3?de.push(fe=ie.clear()):de.push(fe=ie.delete(l($)))}else{var oe=Q?oe?[F,D]:[F,null]:[D,null],xe=oe[0],ke=oe[1];if(Q)for(var Xe=0;Xe<ce;++Xe)de.push(fe=ke&&ke[Xe]!==void 0?ie[T](xe[Xe],ke[Xe]):ie[T](xe[Xe])),fe.onerror=ne;else for(Xe=0;Xe<ce;++Xe)de.push(fe=ie[T](xe[Xe])),fe.onerror=ne}function St(Qe){Qe=Qe.target.result,de.forEach(function(mr,To){return mr.error!=null&&(Pe[To]=mr.error)}),V({numFailures:De,failures:Pe,results:T==="delete"?D:de.map(function(mr){return mr.result}),lastResult:Qe})}fe.onerror=function(Qe){ne(Qe),St(Qe)},fe.onsuccess=St})},getMany:function(j){var O=j.trans,T=j.keys;return new Promise(function(D,F){D=Ye(D);for(var $,V=O.objectStore(A),J=T.length,ie=new Array(J),oe=0,Q=0,fe=function(de){de=de.target,ie[de._pos]=de.result,++Q===oe&&D(ie)},ce=$t(F),ne=0;ne<J;++ne)T[ne]!=null&&(($=V.get(T[ne]))._pos=ne,$.onsuccess=fe,$.onerror=ce,++oe);oe===0&&D(ie)})},get:function(j){var O=j.trans,T=j.key;return new Promise(function(D,F){D=Ye(D);var $=O.objectStore(A).get(T);$.onsuccess=function(V){return D(V.target.result)},$.onerror=$t(F)})},query:(S=g,function(j){return new Promise(function(O,T){O=Ye(O);var D,F,$,Q=j.trans,V=j.values,J=j.limit,oe=j.query,ie=J===1/0?void 0:J,fe=oe.index,oe=oe.range,Q=Q.objectStore(A),Q=fe.isPrimaryKey?Q:Q.index(fe.name),fe=l(oe);if(J===0)return O({result:[]});S?((oe=V?Q.getAll(fe,ie):Q.getAllKeys(fe,ie)).onsuccess=function(ce){return O({result:ce.target.result})},oe.onerror=$t(T)):(D=0,F=!V&&"openKeyCursor"in Q?Q.openKeyCursor(fe):Q.openCursor(fe),$=[],F.onsuccess=function(ce){var ne=F.result;return!ne||($.push(V?ne.value:ne.primaryKey),++D===J)?O({result:$}):void ne.continue()},F.onerror=$t(T))})}),openCursor:function(j){var O=j.trans,T=j.values,D=j.query,F=j.reverse,$=j.unique;return new Promise(function(V,J){V=Ye(V);var Q=D.index,ie=D.range,oe=O.objectStore(A),oe=Q.isPrimaryKey?oe:oe.index(Q.name),Q=F?$?"prevunique":"prev":$?"nextunique":"next",fe=!T&&"openKeyCursor"in oe?oe.openKeyCursor(l(ie),Q):oe.openCursor(l(ie),Q);fe.onerror=$t(J),fe.onsuccess=Ye(function(ce){var ne,de,Pe,De,xe=fe.result;xe?(xe.___id=++fd,xe.done=!1,ne=xe.continue.bind(xe),de=(de=xe.continuePrimaryKey)&&de.bind(xe),Pe=xe.advance.bind(xe),De=function(){throw new Error("Cursor not stopped")},xe.trans=O,xe.stop=xe.continue=xe.continuePrimaryKey=xe.advance=function(){throw new Error("Cursor not started")},xe.fail=Ye(J),xe.next=function(){var ke=this,Xe=1;return this.start(function(){return Xe--?ke.continue():ke.stop()}).then(function(){return ke})},xe.start=function(ke){function Xe(){if(fe.result)try{ke()}catch(Qe){xe.fail(Qe)}else xe.done=!0,xe.start=function(){throw new Error("Cursor behind last entry")},xe.stop()}var St=new Promise(function(Qe,mr){Qe=Ye(Qe),fe.onerror=$t(mr),xe.fail=mr,xe.stop=function(To){xe.stop=xe.continue=xe.continuePrimaryKey=xe.advance=De,Qe(To)}});return fe.onsuccess=Ye(function(Qe){fe.onsuccess=Xe,Xe()}),xe.continue=ne,xe.continuePrimaryKey=de,xe.advance=Pe,Xe(),St},V(xe)):V(null)},J)})},count:function(j){var O=j.query,T=j.trans,D=O.index,F=O.range;return new Promise(function($,V){var J=T.objectStore(A),J=D.isPrimaryKey?J:J.index(D.name),ie=l(F),ie=ie?J.count(ie):J.count();ie.onsuccess=Ye(function(oe){return $(oe.target.result)}),ie.onerror=$t(V)})}}}h=E,y=Us((E=n).objectStoreNames);var h,E={schema:{name:E.name,tables:y.map(function(C){return h.objectStore(C)}).map(function(C){var S=C.keyPath,A=C.autoIncrement,O=d(S),j={},O={name:C.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:S==null,compound:O,keyPath:S,autoIncrement:A,unique:!0,extractKey:oo(S)},indexes:Us(C.indexNames).map(function(T){return C.index(T)}).map(function($){var V=$.name,D=$.unique,F=$.multiEntry,$=$.keyPath,V={name:V,compound:d($),keyPath:$,unique:D,multiEntry:F,extractKey:oo($)};return j[dn($)]=V}),getIndexByKeyPath:function(T){return j[dn(T)]}};return j[":id"]=O.primaryKey,S!=null&&(j[dn(S)]=O.primaryKey),O})},hasGetAll:0<y.length&&"getAll"in h.objectStore(y[0])&&!(typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)},y=E.schema,g=E.hasGetAll,E=y.tables.map(f),P={};return E.forEach(function(C){return P[C.name]=C}),{stack:"dbcore",transaction:n.transaction.bind(n),table:function(C){if(P[C])return P[C];throw new Error("Table '".concat(C,"' not found"))},MIN_KEY:-1/0,MAX_KEY:fn(o),schema:y}}function hd(n,o,u,l){return u=u.IDBKeyRange,o=dd(o,u,l),{dbcore:n.dbcore.reduce(function(f,h){return h=h.create,i(i({},f),h(f))},o)}}function Un(n,o){var u=o.db,u=hd(n._middlewares,u,n._deps,o);n.core=u.dbcore,n.tables.forEach(function(l){var f=l.name;n.core.schema.tables.some(function(h){return h.name===f})&&(l.core=n.core.table(f),n[f]instanceof n.Table)&&(n[f].core=l.core)})}function Gn(n,o,u,l){u.forEach(function(f){var h=l[f];o.forEach(function(y){var g=(function E(P,C){return q(P,C)||(P=m(P))&&E(P,C)})(y,f);(!g||"value"in g&&g.value===void 0)&&(y===n.Transaction.prototype||y instanceof n.Transaction?I(y,f,{get:function(){return this.table(f)},set:function(E){R(this,f,{value:E,writable:!0,configurable:!0,enumerable:!0})}}):y[f]=new n.Table(f,h))})})}function ao(n,o){o.forEach(function(u){for(var l in u)u[l]instanceof n.Table&&delete u[l]})}function pd(n,o){return n._cfg.version-o._cfg.version}function md(n,o,u,l){var f=n._dbSchema,h=(u.objectStoreNames.contains("$meta")&&!f.$meta&&(f.$meta=io("$meta",Ws("")[0],[]),n._storeNames.push("$meta")),n._createTransaction("readwrite",n._storeNames,f)),y=(h.create(u),h._completion.catch(l),h._reject.bind(h)),g=me.transless||me;Ht(function(){if(me.trans=h,me.transless=g,o!==0)return Un(n,u),P=o,((E=h).storeNames.includes("$meta")?E.table("$meta").get("version").then(function(C){return C??P}):ue.resolve(P)).then(function(D){var S=n,A=D,j=h,O=u,T=[],D=S._versions,F=S._dbSchema=Hn(0,S.idbdb,O);return(D=D.filter(function($){return $._cfg.version>=A})).length===0?ue.resolve():(D.forEach(function($){T.push(function(){var V,J,ie,oe=F,Q=$._cfg.dbschema,fe=(Yn(S,oe,O),Yn(S,Q,O),F=S._dbSchema=Q,so(oe,Q)),ce=(fe.add.forEach(function(ne){uo(O,ne[0],ne[1].primKey,ne[1].indexes)}),fe.change.forEach(function(ne){if(ne.recreate)throw new re.Upgrade("Not yet support for changing primary key");var de=O.objectStore(ne.name);ne.add.forEach(function(Pe){return Wn(de,Pe)}),ne.change.forEach(function(Pe){de.deleteIndex(Pe.name),Wn(de,Pe)}),ne.del.forEach(function(Pe){return de.deleteIndex(Pe)})}),$._cfg.contentUpgrade);if(ce&&$._cfg.version>A)return Un(S,O),j._memoizedTables={},V=ae(Q),fe.del.forEach(function(ne){V[ne]=oe[ne]}),ao(S,[S.Transaction.prototype]),Gn(S,[S.Transaction.prototype],c(V),V),j.schema=V,(J=le(ce))&&Fr(),Q=ue.follow(function(){var ne;(ie=ce(j))&&J&&(ne=Yt.bind(null,null),ie.then(ne,ne))}),ie&&typeof ie.then=="function"?ue.resolve(ie):Q.then(function(){return ie})}),T.push(function(V){var J,ie,oe=$._cfg.dbschema;J=oe,ie=V,[].slice.call(ie.db.objectStoreNames).forEach(function(Q){return J[Q]==null&&ie.db.deleteObjectStore(Q)}),ao(S,[S.Transaction.prototype]),Gn(S,[S.Transaction.prototype],S._storeNames,S._dbSchema),j.schema=S._dbSchema}),T.push(function(V){S.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(S.idbdb.version/10)===$._cfg.version?(S.idbdb.deleteObjectStore("$meta"),delete S._dbSchema.$meta,S._storeNames=S._storeNames.filter(function(J){return J!=="$meta"})):V.objectStore("$meta").put($._cfg.version,"version"))})}),(function $(){return T.length?ue.resolve(T.shift()(j.idbtrans)).then($):ue.resolve()})().then(function(){Gs(F,O)}))}).catch(y);var E,P;c(f).forEach(function(C){uo(u,C,f[C].primKey,f[C].indexes)}),Un(n,u),ue.follow(function(){return n.on.populate.fire(h)}).catch(y)})}function yd(n,o){Gs(n._dbSchema,o),o.db.version%10!=0||o.objectStoreNames.contains("$meta")||o.db.createObjectStore("$meta").add(Math.ceil(o.db.version/10-1),"version");var u=Hn(0,n.idbdb,o);Yn(n,n._dbSchema,o);for(var l=0,f=so(u,n._dbSchema).change;l<f.length;l++){var h=(y=>{if(y.change.length||y.recreate)return console.warn("Unable to patch indexes of table ".concat(y.name," because it has changes on the type of index or primary key.")),{value:void 0};var g=o.objectStore(y.name);y.add.forEach(function(E){wt&&console.debug("Dexie upgrade patch: Creating missing index ".concat(y.name,".").concat(E.src)),Wn(g,E)})})(f[l]);if(typeof h=="object")return h.value}}function so(n,o){var u,l={del:[],add:[],change:[]};for(u in n)o[u]||l.del.push(u);for(u in o){var f=n[u],h=o[u];if(f){var y={name:u,def:h,recreate:!1,del:[],add:[],change:[]};if(""+(f.primKey.keyPath||"")!=""+(h.primKey.keyPath||"")||f.primKey.auto!==h.primKey.auto)y.recreate=!0,l.change.push(y);else{var g=f.idxByName,E=h.idxByName,P=void 0;for(P in g)E[P]||y.del.push(P);for(P in E){var C=g[P],S=E[P];C?C.src!==S.src&&y.change.push(S):y.add.push(S)}(0<y.del.length||0<y.add.length||0<y.change.length)&&l.change.push(y)}}else l.add.push([u,h])}return l}function uo(n,o,u,l){var f=n.db.createObjectStore(o,u.keyPath?{keyPath:u.keyPath,autoIncrement:u.auto}:{autoIncrement:u.auto});l.forEach(function(h){return Wn(f,h)})}function Gs(n,o){c(n).forEach(function(u){o.db.objectStoreNames.contains(u)||(wt&&console.debug("Dexie: Creating missing table",u),uo(o,u,n[u].primKey,n[u].indexes))})}function Wn(n,o){n.createIndex(o.name,o.keyPath,{unique:o.unique,multiEntry:o.multi})}function Hn(n,o,u){var l={};return W(o.objectStoreNames,0).forEach(function(f){for(var h=u.objectStore(f),y=no(zs(P=h.keyPath),P||"",!0,!1,!!h.autoIncrement,P&&typeof P!="string",!0),g=[],E=0;E<h.indexNames.length;++E){var C=h.index(h.indexNames[E]),P=C.keyPath,C=no(C.name,P,!!C.unique,!!C.multiEntry,!1,P&&typeof P!="string",!1);g.push(C)}l[f]=io(f,y,g)}),l}function Yn(n,o,u){for(var l=u.db.objectStoreNames,f=0;f<l.length;++f){var h=l[f],y=u.objectStore(h);n._hasGetAll="getAll"in y;for(var g=0;g<y.indexNames.length;++g){var E,P=y.indexNames[g],C=y.index(P).keyPath,C=typeof C=="string"?C:"["+W(C).join("+")+"]";o[h]&&(E=o[h].idxByName[C])&&(E.name=P,delete o[h].idxByName[C],o[h].idxByName[P]=E)}}typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&s.WorkerGlobalScope&&s instanceof s.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(n._hasGetAll=!1)}function Ws(n){return n.split(",").map(function(o,u){var f=o.split(":"),l=(l=f[1])==null?void 0:l.trim(),f=(o=f[0].trim()).replace(/([&*]|\+\+)/g,""),h=/^\[/.test(f)?f.match(/^\[(.*)\]$/)[1].split("+"):f;return no(f,h||null,/\&/.test(o),/\*/.test(o),/\+\+/.test(o),d(h),u===0,l)})}qr.prototype._createTableSchema=io,qr.prototype._parseIndexSyntax=Ws,qr.prototype._parseStoresSpec=function(n,o){var u=this;c(n).forEach(function(l){if(n[l]!==null){var f=u._parseIndexSyntax(n[l]),h=f.shift();if(!h)throw new re.Schema("Invalid schema for table "+l+": "+n[l]);if(h.unique=!0,h.multi)throw new re.Schema("Primary key cannot be multiEntry*");f.forEach(function(y){if(y.auto)throw new re.Schema("Only primary key can be marked as autoIncrement (++)");if(!y.keyPath)throw new re.Schema("Index must have a name and cannot be an empty string")}),h=u._createTableSchema(l,h,f),o[l]=h}})},qr.prototype.stores=function(u){var o=this.db,u=(this._cfg.storesSource=this._cfg.storesSource?p(this._cfg.storesSource,u):u,o._versions),l={},f={};return u.forEach(function(h){p(l,h._cfg.storesSource),f=h._cfg.dbschema={},h._parseStoresSpec(l,f)}),o._dbSchema=f,ao(o,[o._allTables,o,o.Transaction.prototype]),Gn(o,[o._allTables,o,o.Transaction.prototype,this._cfg.tables],c(f),f),o._storeNames=c(f),this},qr.prototype.upgrade=function(n){return this._cfg.contentUpgrade=nn(this._cfg.contentUpgrade||Y,n),this};var gd=qr;function qr(){}function co(n,o){var u=n._dbNamesDB;return u||(u=n._dbNamesDB=new Bt(Bn,{addons:[],indexedDB:n,IDBKeyRange:o})).version(1).stores({dbnames:"name"}),u.table("dbnames")}function lo(n){return n&&typeof n.databases=="function"}function fo(n){return Ht(function(){return me.letThrough=!0,n()})}function ho(n){return!("from"in n)}var ht=function(n,o){var u;if(!this)return u=new ht,n&&"d"in n&&p(u,n),u;p(this,arguments.length?{d:1,from:n,to:1<arguments.length?o:n}:{d:0})};function hn(n,o,u){var l=$e(o,u);if(!isNaN(l)){if(0<l)throw RangeError();if(ho(n))return p(n,{from:o,to:u,d:1});var l=n.l,f=n.r;if($e(u,n.from)<0)return l?hn(l,o,u):n.l={from:o,to:u,d:1,l:null,r:null},Ys(n);if(0<$e(o,n.to))return f?hn(f,o,u):n.r={from:o,to:u,d:1,l:null,r:null},Ys(n);$e(o,n.from)<0&&(n.from=o,n.l=null,n.d=f?f.d+1:1),0<$e(u,n.to)&&(n.to=u,n.r=null,n.d=n.l?n.l.d+1:1),o=!n.r,l&&!n.l&&pn(n,l),f&&o&&pn(n,f)}}function pn(n,o){ho(o)||(function u(l,f){var h=f.from,y=f.l,g=f.r;hn(l,h,f.to),y&&u(l,y),g&&u(l,g)})(n,o)}function Hs(n,o){var u=Jn(o),l=u.next();if(!l.done)for(var f=l.value,h=Jn(n),y=h.next(f.from),g=y.value;!l.done&&!y.done;){if($e(g.from,f.to)<=0&&0<=$e(g.to,f.from))return!0;$e(f.from,g.from)<0?f=(l=u.next(g.from)).value:g=(y=h.next(f.from)).value}return!1}function Jn(n){var o=ho(n)?null:{s:0,n};return{next:function(u){for(var l=0<arguments.length;o;)switch(o.s){case 0:if(o.s=1,l)for(;o.n.l&&$e(u,o.n.from)<0;)o={up:o,n:o.n.l,s:1};else for(;o.n.l;)o={up:o,n:o.n.l,s:1};case 1:if(o.s=2,!l||$e(u,o.n.to)<=0)return{value:o.n,done:!1};case 2:if(o.n.r){o.s=3,o={up:o,n:o.n.r,s:0};continue}case 3:o=o.up}return{done:!0}}}}function Ys(n){var o,u,l,f=(((f=n.r)==null?void 0:f.d)||0)-(((f=n.l)==null?void 0:f.d)||0),f=1<f?"r":f<-1?"l":"";f&&(o=f=="r"?"l":"r",u=i({},n),l=n[f],n.from=l.from,n.to=l.to,n[f]=l[f],u[f]=l[o],(n[o]=u).d=Js(u)),n.d=Js(n)}function Js(u){var o=u.r,u=u.l;return(o?u?Math.max(o.d,u.d):o.d:u?u.d:0)+1}function Xn(n,o){return c(o).forEach(function(u){n[u]?pn(n[u],o[u]):n[u]=(function l(f){var h,y,g={};for(h in f)_(f,h)&&(y=f[h],g[h]=!y||typeof y!="object"||be.has(y.constructor)?y:l(y));return g})(o[u])}),n}function po(n,o){return n.all||o.all||Object.keys(n).some(function(u){return o[u]&&Hs(o[u],n[u])})}w(ht.prototype,((ve={add:function(n){return pn(this,n),this},addKey:function(n){return hn(this,n,n),this},addKeys:function(n){var o=this;return n.forEach(function(u){return hn(o,u,u)}),this},hasKey:function(n){var o=Jn(this).next(n).value;return o&&$e(o.from,n)<=0&&0<=$e(o.to,n)}})[Ee]=function(){return Jn(this)},ve));var hr={},mo={},yo=!1;function Zn(n){Xn(mo,n),yo||(yo=!0,setTimeout(function(){yo=!1,go(mo,!(mo={}))},0))}function go(n,o){o===void 0&&(o=!1);var u=new Set;if(n.all)for(var l=0,f=Object.values(hr);l<f.length;l++)Xs(g=f[l],n,u,o);else for(var h in n){var y,g,h=/^idb\:\/\/(.*)\/(.*)\//.exec(h);h&&(y=h[1],h=h[2],g=hr["idb://".concat(y,"/").concat(h)])&&Xs(g,n,u,o)}u.forEach(function(E){return E()})}function Xs(n,o,u,l){for(var f=[],h=0,y=Object.entries(n.queries.query);h<y.length;h++){for(var g=y[h],E=g[0],P=[],C=0,S=g[1];C<S.length;C++){var A=S[C];po(o,A.obsSet)?A.subscribers.forEach(function(D){return u.add(D)}):l&&P.push(A)}l&&f.push([E,P])}if(l)for(var j=0,O=f;j<O.length;j++){var T=O[j],E=T[0],P=T[1];n.queries.query[E]=P}}function vd(n){var o=n._state,u=n._deps.indexedDB;if(o.isBeingOpened||n.idbdb)return o.dbReadyPromise.then(function(){return o.dbOpenError?nt(o.dbOpenError):n});o.isBeingOpened=!0,o.dbOpenError=null,o.openComplete=!1;var l=o.openCanceller,f=Math.round(10*n.verno),h=!1;function y(){if(o.openCanceller!==l)throw new re.DatabaseClosed("db.open() was cancelled")}function g(){return new ue(function(A,j){if(y(),!u)throw new re.MissingAPI;var O=n.name,T=o.autoSchema||!f?u.open(O):u.open(O,f);if(!T)throw new re.MissingAPI;T.onerror=$t(j),T.onblocked=Ye(n._fireOnBlocked),T.onupgradeneeded=Ye(function(D){var F;C=T.transaction,o.autoSchema&&!n._options.allowEmptyDB?(T.onerror=cn,C.abort(),T.result.close(),(F=u.deleteDatabase(O)).onsuccess=F.onerror=Ye(function(){j(new re.NoSuchDatabase("Database ".concat(O," doesnt exist")))})):(C.onerror=$t(j),F=D.oldVersion>Math.pow(2,62)?0:D.oldVersion,S=F<1,n.idbdb=T.result,h&&yd(n,C),md(n,F/10,C,j))},j),T.onsuccess=Ye(function(){C=null;var D,F,$,V,J,ie,oe=n.idbdb=T.result,Q=W(oe.objectStoreNames);if(0<Q.length)try{var fe=oe.transaction((J=Q).length===1?J[0]:J,"readonly");if(o.autoSchema)ie=oe,V=fe,($=n).verno=ie.version/10,V=$._dbSchema=Hn(0,ie,V),$._storeNames=W(ie.objectStoreNames,0),Gn($,[$._allTables],c(V),V);else if(Yn(n,n._dbSchema,fe),F=fe,((F=so(Hn(0,(D=n).idbdb,F),D._dbSchema)).add.length||F.change.some(function(ce){return ce.add.length||ce.change.length}))&&!h)return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."),oe.close(),f=oe.version+1,h=!0,A(g());Un(n,fe)}catch{}Mr.push(n),oe.onversionchange=Ye(function(ce){o.vcFired=!0,n.on("versionchange").fire(ce)}),oe.onclose=Ye(function(){n.close({disableAutoOpen:!1})}),S&&(Q=n._deps,J=O,lo(ie=Q.indexedDB)||J===Bn||co(ie,Q.IDBKeyRange).put({name:J}).catch(Y)),A()},j)}).catch(function(A){switch(A==null?void 0:A.name){case"UnknownError":if(0<o.PR1398_maxLoop)return o.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),g();break;case"VersionError":if(0<f)return f=0,g()}return ue.reject(A)})}var E,P=o.dbReadyResolve,C=null,S=!1;return ue.race([l,(typeof navigator>"u"?ue.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(A){function j(){return indexedDB.databases().finally(A)}E=setInterval(j,100),j()}).finally(function(){return clearInterval(E)}):Promise.resolve()).then(g)]).then(function(){return y(),o.onReadyBeingFired=[],ue.resolve(fo(function(){return n.on.ready.fire(n.vip)})).then(function A(){var j;if(0<o.onReadyBeingFired.length)return j=o.onReadyBeingFired.reduce(nn,Y),o.onReadyBeingFired=[],ue.resolve(fo(function(){return j(n.vip)})).then(A)})}).finally(function(){o.openCanceller===l&&(o.onReadyBeingFired=null,o.isBeingOpened=!1)}).catch(function(A){o.dbOpenError=A;try{C&&C.abort()}catch{}return l===o.openCanceller&&n._close(),nt(A)}).finally(function(){o.openComplete=!0,P()}).then(function(){var A;return S&&(A={},n.tables.forEach(function(j){j.schema.indexes.forEach(function(O){O.name&&(A["idb://".concat(n.name,"/").concat(j.name,"/").concat(O.name)]=new ht(-1/0,[[[]]]))}),A["idb://".concat(n.name,"/").concat(j.name,"/")]=A["idb://".concat(n.name,"/").concat(j.name,"/:dels")]=new ht(-1/0,[[[]]])}),Zt(ln).fire(A),go(A,!0)),n})}function vo(n){function o(h){return n.next(h)}var u=f(o),l=f(function(h){return n.throw(h)});function f(h){return function(g){var g=h(g),E=g.value;return g.done?E:E&&typeof E.then=="function"?E.then(u,l):d(E)?Promise.all(E).then(u,l):u(E)}}return f(o)()}function Qn(n,o,u){for(var l=d(n)?n.slice():[n],f=0;f<u;++f)l.push(o);return l}var bd={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(n){return i(i({},n),{table:function(l){var u=n.table(l),l=u.schema,f={},h=[];function y(A,j,O){var $=dn(A),T=f[$]=f[$]||[],D=A==null?0:typeof A=="string"?1:A.length,F=0<j,$=i(i({},O),{name:F?"".concat($,"(virtual-from:").concat(O.name,")"):O.name,lowLevelIndex:O,isVirtual:F,keyTail:j,keyLength:D,extractKey:oo(A),unique:!F&&O.unique});return T.push($),$.isPrimaryKey||h.push($),1<D&&y(D===2?A[0]:A.slice(0,D-1),j+1,O),T.sort(function(V,J){return V.keyTail-J.keyTail}),$}var g=y(l.primaryKey.keyPath,0,l.primaryKey);f[":id"]=[g];for(var E=0,P=l.indexes;E<P.length;E++){var C=P[E];y(C.keyPath,0,C)}function S(A){var j,O=A.query.index;return O.isVirtual?i(i({},A),{query:{index:O.lowLevelIndex,range:(j=A.query.range,O=O.keyTail,{type:j.type===1?2:j.type,lower:Qn(j.lower,j.lowerOpen?n.MAX_KEY:n.MIN_KEY,O),lowerOpen:!0,upper:Qn(j.upper,j.upperOpen?n.MIN_KEY:n.MAX_KEY,O),upperOpen:!0})}}):A}return i(i({},u),{schema:i(i({},l),{primaryKey:g,indexes:h,getIndexByKeyPath:function(A){return(A=f[dn(A)])&&A[0]}}),count:function(A){return u.count(S(A))},query:function(A){return u.query(S(A))},openCursor:function(A){var j=A.query.index,O=j.keyTail,T=j.keyLength;return j.isVirtual?u.openCursor(S(A)).then(function(F){return F&&D(F)}):u.openCursor(A);function D(F){return Object.create(F,{continue:{value:function($){$!=null?F.continue(Qn($,A.reverse?n.MAX_KEY:n.MIN_KEY,O)):A.unique?F.continue(F.key.slice(0,T).concat(A.reverse?n.MIN_KEY:n.MAX_KEY,O)):F.continue()}},continuePrimaryKey:{value:function($,V){F.continuePrimaryKey(Qn($,n.MAX_KEY,O),V)}},primaryKey:{get:function(){return F.primaryKey}},key:{get:function(){var $=F.key;return T===1?$[0]:$.slice(0,T)}},value:{get:function(){return F.value}}})}}})}})}};function bo(n,o,u,l){return u=u||{},l=l||"",c(n).forEach(function(f){var h,y,g;_(o,f)?(h=n[f],y=o[f],typeof h=="object"&&typeof y=="object"&&h&&y?(g=ge(h))!==ge(y)?u[l+f]=o[f]:g==="Object"?bo(h,y,u,l+f+"."):h!==y&&(u[l+f]=o[f]):h!==y&&(u[l+f]=o[f])):u[l+f]=void 0}),c(o).forEach(function(f){_(n,f)||(u[l+f]=o[f])}),u}function _o(n,o){return o.type==="delete"?o.keys:o.keys||o.values.map(n.extractKey)}var _d={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(n){return i(i({},n),{table:function(o){var u=n.table(o),l=u.schema.primaryKey;return i(i({},u),{mutate:function(f){var h=me.trans,y=h.table(o).hook,g=y.deleting,E=y.creating,P=y.updating;switch(f.type){case"add":if(E.fire===Y)break;return h._promise("readwrite",function(){return C(f)},!0);case"put":if(E.fire===Y&&P.fire===Y)break;return h._promise("readwrite",function(){return C(f)},!0);case"delete":if(g.fire===Y)break;return h._promise("readwrite",function(){return C(f)},!0);case"deleteRange":if(g.fire===Y)break;return h._promise("readwrite",function(){return(function S(A,j,O){return u.query({trans:A,values:!1,query:{index:l,range:j},limit:O}).then(function(T){var D=T.result;return C({type:"delete",keys:D,trans:A}).then(function(F){return 0<F.numFailures?Promise.reject(F.failures[0]):D.length<O?{failures:[],numFailures:0,lastResult:void 0}:S(A,i(i({},j),{lower:D[D.length-1],lowerOpen:!0}),O)})})})(f.trans,f.range,1e4)},!0)}return u.mutate(f);function C(S){var A,j,O,T=me.trans,D=S.keys||_o(l,S);if(D)return(S=S.type==="add"||S.type==="put"?i(i({},S),{keys:D}):i({},S)).type!=="delete"&&(S.values=a([],S.values)),S.keys&&(S.keys=a([],S.keys)),A=u,O=D,((j=S).type==="add"?Promise.resolve([]):A.getMany({trans:j.trans,keys:O,cache:"immutable"})).then(function(F){var $=D.map(function(V,J){var ie,oe,Q,fe=F[J],ce={onerror:null,onsuccess:null};return S.type==="delete"?g.fire.call(ce,V,fe,T):S.type==="add"||fe===void 0?(ie=E.fire.call(ce,V,S.values[J],T),V==null&&ie!=null&&(S.keys[J]=V=ie,l.outbound||Z(S.values[J],l.keyPath,V))):(ie=bo(fe,S.values[J]),(oe=P.fire.call(ce,ie,V,fe,T))&&(Q=S.values[J],Object.keys(oe).forEach(function(ne){_(Q,ne)?Q[ne]=oe[ne]:Z(Q,ne,oe[ne])}))),ce});return u.mutate(S).then(function(V){for(var J=V.failures,ie=V.results,oe=V.numFailures,V=V.lastResult,Q=0;Q<D.length;++Q){var fe=(ie||D)[Q],ce=$[Q];fe==null?ce.onerror&&ce.onerror(J[Q]):ce.onsuccess&&ce.onsuccess(S.type==="put"&&F[Q]?S.values[Q]:fe)}return{failures:J,results:ie,numFailures:oe,lastResult:V}}).catch(function(V){return $.forEach(function(J){return J.onerror&&J.onerror(V)}),Promise.reject(V)})});throw new Error("Keys missing")}}})}})}};function Zs(n,o,u){try{if(!o||o.keys.length<n.length)return null;for(var l=[],f=0,h=0;f<o.keys.length&&h<n.length;++f)$e(o.keys[f],n[h])===0&&(l.push(u?ee(o.values[f]):o.values[f]),++h);return l.length===n.length?l:null}catch{return null}}var xd={stack:"dbcore",level:-1,create:function(n){return{table:function(o){var u=n.table(o);return i(i({},u),{getMany:function(l){var f;return l.cache?(f=Zs(l.keys,l.trans._cache,l.cache==="clone"))?ue.resolve(f):u.getMany(l).then(function(h){return l.trans._cache={keys:l.keys,values:l.cache==="clone"?ee(h):h},h}):u.getMany(l)},mutate:function(l){return l.type!=="add"&&(l.trans._cache=null),u.mutate(l)}})}}}};function Qs(n,o){return n.trans.mode==="readonly"&&!!n.subscr&&!n.trans.explicit&&n.trans.db._options.cache!=="disabled"&&!o.schema.primaryKey.outbound}function eu(n,o){switch(n){case"query":return o.values&&!o.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var wd={stack:"dbcore",level:0,name:"Observability",create:function(n){var o=n.schema.name,u=new ht(n.MIN_KEY,n.MAX_KEY);return i(i({},n),{transaction:function(l,f,h){if(me.subscr&&f!=="readonly")throw new re.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(me.querier));return n.transaction(l,f,h)},table:function(l){function f(D){var T,D=D.query;return[T=D.index,new ht((T=(D=D.range).lower)!=null?T:n.MIN_KEY,(T=D.upper)!=null?T:n.MAX_KEY)]}var h=n.table(l),y=h.schema,g=y.primaryKey,E=y.indexes,P=g.extractKey,C=g.outbound,S=g.autoIncrement&&E.filter(function(O){return O.compound&&O.keyPath.includes(g.keyPath)}),A=i(i({},h),{mutate:function(O){function T(de){return de="idb://".concat(o,"/").concat(l,"/").concat(de),J[de]||(J[de]=new ht)}var D,F,$,V=O.trans,J=O.mutatedParts||(O.mutatedParts={}),ie=T(""),oe=T(":dels"),Q=O.type,ce=O.type==="deleteRange"?[O.range]:O.type==="delete"?[O.keys]:O.values.length<50?[_o(g,O).filter(function(de){return de}),O.values]:[],fe=ce[0],ce=ce[1],ne=O.trans._cache;return d(fe)?(ie.addKeys(fe),(Q=Q==="delete"||fe.length===ce.length?Zs(fe,ne):null)||oe.addKeys(fe),(Q||ce)&&(D=T,F=Q,$=ce,y.indexes.forEach(function(de){var Pe=D(de.name||"");function De(ke){return ke!=null?de.extractKey(ke):null}function xe(ke){de.multiEntry&&d(ke)?ke.forEach(function(Xe){return Pe.addKey(Xe)}):Pe.addKey(ke)}(F||$).forEach(function(ke,Qe){var St=F&&De(F[Qe]),Qe=$&&De($[Qe]);$e(St,Qe)!==0&&(St!=null&&xe(St),Qe!=null)&&xe(Qe)})}))):fe?(ce={from:(ne=fe.lower)!=null?ne:n.MIN_KEY,to:(Q=fe.upper)!=null?Q:n.MAX_KEY},oe.add(ce),ie.add(ce)):(ie.add(u),oe.add(u),y.indexes.forEach(function(de){return T(de.name).add(u)})),h.mutate(O).then(function(de){return!fe||O.type!=="add"&&O.type!=="put"||(ie.addKeys(de.results),S&&S.forEach(function(Pe){for(var De=O.values.map(function(St){return Pe.extractKey(St)}),xe=Pe.keyPath.findIndex(function(St){return St===g.keyPath}),ke=0,Xe=de.results.length;ke<Xe;++ke)De[ke][xe]=de.results[ke];T(Pe.name).addKeys(De)})),V.mutatedParts=Xn(V.mutatedParts||{},J),de})}}),j={get:function(O){return[g,new ht(O.key)]},getMany:function(O){return[g,new ht().addKeys(O.keys)]},count:f,query:f,openCursor:f};return c(j).forEach(function(O){A[O]=function(T){var D=me.subscr,F=!!D,$=Qs(me,h)&&eu(O,T)?T.obsSet={}:D;if(F){var V,D=function(ce){return ce="idb://".concat(o,"/").concat(l,"/").concat(ce),$[ce]||($[ce]=new ht)},J=D(""),ie=D(":dels"),F=j[O](T),oe=F[0],F=F[1];if((O==="query"&&oe.isPrimaryKey&&!T.values?ie:D(oe.name||"")).add(F),!oe.isPrimaryKey){if(O!=="count")return V=O==="query"&&C&&T.values&&h.query(i(i({},T),{values:!1})),h[O].apply(this,arguments).then(function(ce){if(O==="query"){if(C&&T.values)return V.then(function(De){return De=De.result,J.addKeys(De),ce});var ne=T.values?ce.result.map(P):ce.result;(T.values?J:ie).addKeys(ne)}else{var de,Pe;if(O==="openCursor")return Pe=T.values,(de=ce)&&Object.create(de,{key:{get:function(){return ie.addKey(de.primaryKey),de.key}},primaryKey:{get:function(){var De=de.primaryKey;return ie.addKey(De),De}},value:{get:function(){return Pe&&J.addKey(de.primaryKey),de.value}}})}return ce});ie.add(u)}}return h[O].apply(this,arguments)}}),A}})}};function tu(n,o,u){var l;return u.numFailures===0?o:o.type==="deleteRange"||(l=o.keys?o.keys.length:"values"in o&&o.values?o.values.length:1,u.numFailures===l)?null:(l=i({},o),d(l.keys)&&(l.keys=l.keys.filter(function(f,h){return!(h in u.failures)})),"values"in l&&d(l.values)&&(l.values=l.values.filter(function(f,h){return!(h in u.failures)})),l)}function xo(n,o){return u=n,((l=o).lower===void 0||(l.lowerOpen?0<$e(u,l.lower):0<=$e(u,l.lower)))&&(u=n,(l=o).upper===void 0||(l.upperOpen?$e(u,l.upper)<0:$e(u,l.upper)<=0));var u,l}function ru(n,o,u,l,f,h){var y,g,E,P,C,S;return!u||u.length===0||(y=o.query.index,g=y.multiEntry,E=o.query.range,P=l.schema.primaryKey.extractKey,C=y.extractKey,S=(y.lowLevelIndex||y).extractKey,(l=u.reduce(function(A,j){var O=A,T=[];if(j.type==="add"||j.type==="put")for(var D=new ht,F=j.values.length-1;0<=F;--F){var $,V=j.values[F],J=P(V);!D.hasKey(J)&&($=C(V),g&&d($)?$.some(function(ce){return xo(ce,E)}):xo($,E))&&(D.addKey(J),T.push(V))}switch(j.type){case"add":var ie=new ht().addKeys(o.values?A.map(function(ne){return P(ne)}):A),O=A.concat(o.values?T.filter(function(ne){return ne=P(ne),!ie.hasKey(ne)&&(ie.addKey(ne),!0)}):T.map(function(ne){return P(ne)}).filter(function(ne){return!ie.hasKey(ne)&&(ie.addKey(ne),!0)}));break;case"put":var oe=new ht().addKeys(j.values.map(function(ne){return P(ne)}));O=A.filter(function(ne){return!oe.hasKey(o.values?P(ne):ne)}).concat(o.values?T:T.map(function(ne){return P(ne)}));break;case"delete":var Q=new ht().addKeys(j.keys);O=A.filter(function(ne){return!Q.hasKey(o.values?P(ne):ne)});break;case"deleteRange":var fe=j.range;O=A.filter(function(ne){return!xo(P(ne),fe)})}return O},n))===n)?n:(l.sort(function(A,j){return $e(S(A),S(j))||$e(P(A),P(j))}),o.limit&&o.limit<1/0&&(l.length>o.limit?l.length=o.limit:n.length===o.limit&&l.length<o.limit&&(f.dirty=!0)),h?Object.freeze(l):l)}function nu(n,o){return $e(n.lower,o.lower)===0&&$e(n.upper,o.upper)===0&&!!n.lowerOpen==!!o.lowerOpen&&!!n.upperOpen==!!o.upperOpen}function Sd(n,o){return((u,l,f,h)=>{if(u===void 0)return l!==void 0?-1:0;if(l===void 0)return 1;if((u=$e(u,l))===0){if(f&&h)return 0;if(f)return 1;if(h)return-1}return u})(n.lower,o.lower,n.lowerOpen,o.lowerOpen)<=0&&0<=((u,l,f,h)=>{if(u===void 0)return l!==void 0?1:0;if(l===void 0)return-1;if((u=$e(u,l))===0){if(f&&h)return 0;if(f)return-1;if(h)return 1}return u})(n.upper,o.upper,n.upperOpen,o.upperOpen)}function Td(n,o,u,l){n.subscribers.add(u),l.addEventListener("abort",function(){var f,h;n.subscribers.delete(u),n.subscribers.size===0&&(f=n,h=o,setTimeout(function(){f.subscribers.size===0&&Ue(h,f)},3e3))})}var Ed={stack:"dbcore",level:0,name:"Cache",create:function(n){var o=n.schema.name;return i(i({},n),{transaction:function(u,l,f){var h,y,g=n.transaction(u,l,f);return l==="readwrite"&&(f=(h=new AbortController).signal,g.addEventListener("abort",(y=function(E){return function(){if(h.abort(),l==="readwrite"){for(var P=new Set,C=0,S=u;C<S.length;C++){var A=S[C],j=hr["idb://".concat(o,"/").concat(A)];if(j){var O=n.table(A),T=j.optimisticOps.filter(function(de){return de.trans===g});if(g._explicit&&E&&g.mutatedParts)for(var D=0,F=Object.values(j.queries.query);D<F.length;D++)for(var $=0,V=(oe=F[D]).slice();$<V.length;$++)po((Q=V[$]).obsSet,g.mutatedParts)&&(Ue(oe,Q),Q.subscribers.forEach(function(de){return P.add(de)}));else if(0<T.length){j.optimisticOps=j.optimisticOps.filter(function(de){return de.trans!==g});for(var J=0,ie=Object.values(j.queries.query);J<ie.length;J++)for(var oe,Q,fe,ce=0,ne=(oe=ie[J]).slice();ce<ne.length;ce++)(Q=ne[ce]).res!=null&&g.mutatedParts&&(E&&!Q.dirty?(fe=Object.isFrozen(Q.res),fe=ru(Q.res,Q.req,T,O,Q,fe),Q.dirty?(Ue(oe,Q),Q.subscribers.forEach(function(de){return P.add(de)})):fe!==Q.res&&(Q.res=fe,Q.promise=ue.resolve({result:fe}))):(Q.dirty&&Ue(oe,Q),Q.subscribers.forEach(function(de){return P.add(de)})))}}}P.forEach(function(de){return de()})}}})(!1),{signal:f}),g.addEventListener("error",y(!1),{signal:f}),g.addEventListener("complete",y(!0),{signal:f})),g},table:function(u){var l=n.table(u),f=l.schema.primaryKey;return i(i({},l),{mutate:function(h){var y,g=me.trans;return!f.outbound&&g.db._options.cache!=="disabled"&&!g.explicit&&g.idbtrans.mode==="readwrite"&&(y=hr["idb://".concat(o,"/").concat(u)])?(g=l.mutate(h),h.type!=="add"&&h.type!=="put"||!(50<=h.values.length||_o(f,h).some(function(E){return E==null}))?(y.optimisticOps.push(h),h.mutatedParts&&Zn(h.mutatedParts),g.then(function(E){0<E.numFailures&&(Ue(y.optimisticOps,h),(E=tu(0,h,E))&&y.optimisticOps.push(E),h.mutatedParts)&&Zn(h.mutatedParts)}),g.catch(function(){Ue(y.optimisticOps,h),h.mutatedParts&&Zn(h.mutatedParts)})):g.then(function(E){var P=tu(0,i(i({},h),{values:h.values.map(function(C,S){var A;return E.failures[S]?C:(Z(A=(A=f.keyPath)!=null&&A.includes(".")?ee(C):i({},C),f.keyPath,E.results[S]),A)})}),E);y.optimisticOps.push(P),queueMicrotask(function(){return h.mutatedParts&&Zn(h.mutatedParts)})}),g):l.mutate(h)},query:function(h){var y,g,E,P,C,S,A;return Qs(me,l)&&eu("query",h)?(y=((E=me.trans)==null?void 0:E.db._options.cache)==="immutable",g=(E=me).requery,E=E.signal,S=((j,O,T,D)=>{var F=hr["idb://".concat(j,"/").concat(O)];if(!F)return[];if(!(j=F.queries[T]))return[null,!1,F,null];var $=j[(D.query?D.query.index.name:null)||""];if(!$)return[null,!1,F,null];switch(T){case"query":var V=$.find(function(J){return J.req.limit===D.limit&&J.req.values===D.values&&nu(J.req.query.range,D.query.range)});return V?[V,!0,F,$]:[$.find(function(J){return("limit"in J.req?J.req.limit:1/0)>=D.limit&&(!D.values||J.req.values)&&Sd(J.req.query.range,D.query.range)}),!1,F,$];case"count":return V=$.find(function(J){return nu(J.req.query.range,D.query.range)}),[V,!!V,F,$]}})(o,u,"query",h),A=S[0],P=S[2],C=S[3],A&&S[1]?A.obsSet=h.obsSet:(S=l.query(h).then(function(j){var O=j.result;if(A&&(A.res=O),y){for(var T=0,D=O.length;T<D;++T)Object.freeze(O[T]);Object.freeze(O)}else j.result=ee(O);return j}).catch(function(j){return C&&A&&Ue(C,A),Promise.reject(j)}),A={obsSet:h.obsSet,promise:S,subscribers:new Set,type:"query",req:h,dirty:!1},C?C.push(A):(C=[A],(P=P||(hr["idb://".concat(o,"/").concat(u)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[h.query.index.name||""]=C)),Td(A,C,g,E),A.promise.then(function(j){return{result:ru(j.result,h,P==null?void 0:P.optimisticOps,l,A,y)}})):l.query(h)}})}})}};function ei(n,o){return new Proxy(n,{get:function(u,l,f){return l==="db"?o:Reflect.get(u,l,f)}})}it.prototype.version=function(n){if(isNaN(n)||n<.1)throw new re.Type("Given version is not a positive number");if(n=Math.round(10*n)/10,this.idbdb||this._state.isBeingOpened)throw new re.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,n);var o=this._versions,u=o.filter(function(l){return l._cfg.version===n})[0];return u||(u=new this.Version(n),o.push(u),o.sort(pd),u.stores({}),this._state.autoSchema=!1),u},it.prototype._whenReady=function(n){var o=this;return this.idbdb&&(this._state.openComplete||me.letThrough||this._vip)?n():new ue(function(u,l){if(o._state.openComplete)return l(new re.DatabaseClosed(o._state.dbOpenError));if(!o._state.isBeingOpened){if(!o._state.autoOpen)return void l(new re.DatabaseClosed);o.open().catch(Y)}o._state.dbReadyPromise.then(u,l)}).then(n)},it.prototype.use=function(f){var o=f.stack,u=f.create,l=f.level,f=f.name,h=(f&&this.unuse({stack:o,name:f}),this._middlewares[o]||(this._middlewares[o]=[]));return h.push({stack:o,create:u,level:l??10,name:f}),h.sort(function(y,g){return y.level-g.level}),this},it.prototype.unuse=function(n){var o=n.stack,u=n.name,l=n.create;return o&&this._middlewares[o]&&(this._middlewares[o]=this._middlewares[o].filter(function(f){return l?f.create!==l:!!u&&f.name!==u})),this},it.prototype.open=function(){var n=this;return lr(kt,function(){return vd(n)})},it.prototype._close=function(){this.on.close.fire(new CustomEvent("close"));var n=this._state,o=Mr.indexOf(this);if(0<=o&&Mr.splice(o,1),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}n.isBeingOpened||(n.dbReadyPromise=new ue(function(u){n.dbReadyResolve=u}),n.openCanceller=new ue(function(u,l){n.cancelOpen=l}))},it.prototype.close=function(o){var o=(o===void 0?{disableAutoOpen:!0}:o).disableAutoOpen,u=this._state;o?(u.isBeingOpened&&u.cancelOpen(new re.DatabaseClosed),this._close(),u.autoOpen=!1,u.dbOpenError=new re.DatabaseClosed):(this._close(),u.autoOpen=this._options.autoOpen||u.isBeingOpened,u.openComplete=!1,u.dbOpenError=null)},it.prototype.delete=function(n){var o=this,u=(n===void 0&&(n={disableAutoOpen:!0}),0<arguments.length&&typeof arguments[0]!="object"),l=this._state;return new ue(function(f,h){function y(){o.close(n);var g=o._deps.indexedDB.deleteDatabase(o.name);g.onsuccess=Ye(function(){var E,P,C;E=o._deps,P=o.name,lo(C=E.indexedDB)||P===Bn||co(C,E.IDBKeyRange).delete(P).catch(Y),f()}),g.onerror=$t(h),g.onblocked=o._fireOnBlocked}if(u)throw new re.InvalidArgument("Invalid closeOptions argument to db.delete()");l.isBeingOpened?l.dbReadyPromise.then(y):y()})},it.prototype.backendDB=function(){return this.idbdb},it.prototype.isOpen=function(){return this.idbdb!==null},it.prototype.hasBeenClosed=function(){var n=this._state.dbOpenError;return n&&n.name==="DatabaseClosed"},it.prototype.hasFailed=function(){return this._state.dbOpenError!==null},it.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(it.prototype,"tables",{get:function(){var n=this;return c(this._allTables).map(function(o){return n._allTables[o]})},enumerable:!1,configurable:!0}),it.prototype.transaction=function(){var n=(function(o,u,l){var f=arguments.length;if(f<2)throw new re.InvalidArgument("Too few arguments");for(var h=new Array(f-1);--f;)h[f-1]=arguments[f];return l=h.pop(),[o,We(h),l]}).apply(this,arguments);return this._transaction.apply(this,n)},it.prototype._transaction=function(n,o,u){var l,f,h=this,y=me.trans,g=(y&&y.db===this&&n.indexOf("!")===-1||(y=null),n.indexOf("?")!==-1);n=n.replace("!","").replace("?","");try{if(f=o.map(function(P){if(P=P instanceof h.Table?P.name:P,typeof P!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return P}),n=="r"||n===Zi)l=Zi;else{if(n!="rw"&&n!=Qi)throw new re.InvalidArgument("Invalid transaction mode: "+n);l=Qi}if(y){if(y.mode===Zi&&l===Qi){if(!g)throw new re.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");y=null}y&&f.forEach(function(P){if(y&&y.storeNames.indexOf(P)===-1){if(!g)throw new re.SubTransaction("Table "+P+" not included in parent transaction.");y=null}}),g&&y&&!y.active&&(y=null)}}catch(P){return y?y._promise(null,function(C,S){S(P)}):nt(P)}var E=(function P(C,S,A,j,O){return ue.resolve().then(function(){var $=me.transless||me,T=C._createTransaction(S,A,C._dbSchema,j),$=(T.explicit=!0,{trans:T,transless:$});if(j)T.idbtrans=j.idbtrans;else try{T.create(),T.idbtrans._explicit=!0,C._state.PR1398_maxLoop=3}catch(V){return V.name===Ae.InvalidState&&C.isOpen()&&0<--C._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),C.close({disableAutoOpen:!1}),C.open().then(function(){return P(C,S,A,null,O)})):nt(V)}var D,F=le(O),$=(F&&Fr(),ue.follow(function(){var V;(D=O.call(T,T))&&(F?(V=Yt.bind(null,null),D.then(V,V)):typeof D.next=="function"&&typeof D.throw=="function"&&(D=vo(D)))},$));return(D&&typeof D.then=="function"?ue.resolve(D).then(function(V){return T.active?V:nt(new re.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):$.then(function(){return D})).then(function(V){return j&&T._resolve(),T._completion.then(function(){return V})}).catch(function(V){return T._reject(V),nt(V)})})}).bind(null,this,l,f,y,u);return y?y._promise(l,E,"lock"):me.trans?lr(me.transless,function(){return h._whenReady(E)}):this._whenReady(E)},it.prototype.table=function(n){if(_(this._allTables,n))return this._allTables[n];throw new re.InvalidTable("Table ".concat(n," does not exist"))};var Bt=it;function it(n,o){var u,l,f,h,y,g=this,E=(this._middlewares={},this.verno=0,it.dependencies),E=(this._options=o=i({addons:it.addons,autoOpen:!0,indexedDB:E.indexedDB,IDBKeyRange:E.IDBKeyRange,cache:"cloned"},o),this._deps={indexedDB:o.indexedDB,IDBKeyRange:o.IDBKeyRange},o.addons),P=(this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this,{dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:Y,dbReadyPromise:null,cancelOpen:Y,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:o.autoOpen}),C=(P.dbReadyPromise=new ue(function(S){P.dbReadyResolve=S}),P.openCanceller=new ue(function(S,A){P.cancelOpen=A}),this._state=P,this.name=n,this.on=sn(this,"populate","blocked","versionchange","close",{ready:[nn,Y]}),this.once=function(S,A){var j=function(){for(var O=[],T=0;T<arguments.length;T++)O[T]=arguments[T];g.on(S).unsubscribe(j),A.apply(g,O)};return g.on(S,j)},this.on.ready.subscribe=G(this.on.ready.subscribe,function(S){return function(A,j){it.vip(function(){var O,T=g._state;T.openComplete?(T.dbOpenError||ue.resolve().then(A),j&&S(A)):T.onReadyBeingFired?(T.onReadyBeingFired.push(A),j&&S(A)):(S(A),O=g,j||S(function D(){O.on.ready.unsubscribe(A),O.on.ready.unsubscribe(D)}))})}}),this.Collection=(u=this,un(sd.prototype,function(D,T){this.db=u;var j=Is,O=null;if(T)try{j=T()}catch($){O=$}var T=D._ctx,D=T.table,F=D.hook.reading.fire;this._ctx={table:D,index:T.index,isPrimKey:!T.index||D.schema.primKey.keyPath&&T.index===D.schema.primKey.name,range:j,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:O,or:T.or,valueMapper:F!==st?F:null}})),this.Table=(l=this,un(Ns.prototype,function(S,A,j){this.db=l,this._tx=j,this.name=S,this.schema=A,this.hook=l._allTables[S]?l._allTables[S].hook:sn(null,{creating:[zi,Y],reading:[Gt,st],updating:[Gi,Y],deleting:[Ui,Y]})})),this.Transaction=(f=this,un(ld.prototype,function(S,A,j,O,T){var D=this;S!=="readonly"&&A.forEach(function(F){F=(F=j[F])==null?void 0:F.yProps,F&&(A=A.concat(F.map(function($){return $.updatesTable})))}),this.db=f,this.mode=S,this.storeNames=A,this.schema=j,this.chromeTransactionDurability=O,this.idbtrans=null,this.on=sn(this,"complete","error","abort"),this.parent=T||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new ue(function(F,$){D._resolve=F,D._reject=$}),this._completion.then(function(){D.active=!1,D.on.complete.fire()},function(F){var $=D.active;return D.active=!1,D.on.error.fire(F),D.parent?D.parent._reject(F):$&&D.idbtrans&&D.idbtrans.abort(),nt(F)})})),this.Version=(h=this,un(gd.prototype,function(S){this.db=h,this._cfg={version:S,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(y=this,un(Vs.prototype,function(S,A,j){if(this.db=y,this._ctx={table:S,index:A===":id"?null:A,or:j},this._cmp=this._ascending=$e,this._descending=function(O,T){return $e(T,O)},this._max=function(O,T){return 0<$e(O,T)?O:T},this._min=function(O,T){return $e(O,T)<0?O:T},this._IDBKeyRange=y._deps.IDBKeyRange,!this._IDBKeyRange)throw new re.MissingAPI})),this.on("versionchange",function(S){0<S.newVersion?console.warn("Another connection wants to upgrade database '".concat(g.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(g.name,"'. Closing db now to resume the delete request.")),g.close({disableAutoOpen:!1})}),this.on("blocked",function(S){!S.newVersion||S.newVersion<S.oldVersion?console.warn("Dexie.delete('".concat(g.name,"') was blocked")):console.warn("Upgrade '".concat(g.name,"' blocked by other connection holding version ").concat(S.oldVersion/10))}),this._maxKey=fn(o.IDBKeyRange),this._createTransaction=function(S,A,j,O){return new g.Transaction(S,A,j,g._options.chromeTransactionDurability,O)},this._fireOnBlocked=function(S){g.on("blocked").fire(S),Mr.filter(function(A){return A.name===g.name&&A!==g&&!A._state.vcFired}).map(function(A){return A.on("versionchange").fire(S)})},this.use(xd),this.use(Ed),this.use(wd),this.use(bd),this.use(_d),new Proxy(this,{get:function(S,A,j){var O;return A==="_vip"||(A==="table"?function(T){return ei(g.table(T),C)}:(O=Reflect.get(S,A,j))instanceof Ns?ei(O,C):A==="tables"?O.map(function(T){return ei(T,C)}):A==="_createTransaction"?function(){return ei(O.apply(this,arguments),C)}:O)}}));this.vip=C,E.forEach(function(S){return S(g)})}var ti,Lr=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable",Cd=(wo.prototype.subscribe=function(n,o,u){return this._subscribe(n&&typeof n!="function"?n:{next:n,error:o,complete:u})},wo.prototype[Lr]=function(){return this},wo);function wo(n){this._subscribe=n}try{ti={indexedDB:s.indexedDB||s.mozIndexedDB||s.webkitIndexedDB||s.msIndexedDB,IDBKeyRange:s.IDBKeyRange||s.webkitIDBKeyRange}}catch{ti={indexedDB:null,IDBKeyRange:null}}function iu(n){var o,u=!1,l=new Cd(function(f){var h=le(n),y,g=!1,E={},P={},C={get closed(){return g},unsubscribe:function(){g||(g=!0,y&&y.abort(),S&&Zt.storagemutated.unsubscribe(j))}},S=(f.start&&f.start(C),!1),A=function(){return Xi(O)},j=function(T){Xn(E,T),po(P,E)&&A()},O=function(){var T,D,F;!g&&ti.indexedDB&&(E={},T={},y&&y.abort(),y=new AbortController,F=($=>{var V=Rr();try{h&&Fr();var J=Ht(n,$);return J=h?J.finally(Yt):J}finally{V&&Dr()}})(D={subscr:T,signal:y.signal,requery:A,querier:n,trans:null}),Promise.resolve(F).then(function($){u=!0,o=$,g||D.signal.aborted||(E={},(V=>{for(var J in V)if(_(V,J))return;return 1})(P=T)||S||(Zt(ln,j),S=!0),Xi(function(){return!g&&f.next&&f.next($)}))},function($){u=!1,["DatabaseClosedError","AbortError"].includes($==null?void 0:$.name)||g||Xi(function(){g||f.error&&f.error($)})}))};return setTimeout(A,0),C});return l.hasValue=function(){return u},l.getValue=function(){return o},l}var pr=Bt;function So(n){var o=Qt;try{Qt=!0,Zt.storagemutated.fire(n),go(n,!0)}finally{Qt=o}}w(pr,i(i({},_e),{delete:function(n){return new pr(n,{addons:[]}).delete()},exists:function(n){return new pr(n,{addons:[]}).open().then(function(o){return o.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(n){try{return o=pr.dependencies,u=o.indexedDB,o=o.IDBKeyRange,(lo(u)?Promise.resolve(u.databases()).then(function(l){return l.map(function(f){return f.name}).filter(function(f){return f!==Bn})}):co(u,o).toCollection().primaryKeys()).then(n)}catch{return nt(new re.MissingAPI)}var o,u},defineClass:function(){return function(n){p(this,n)}},ignoreTransaction:function(n){return me.trans?lr(me.transless,n):n()},vip:fo,async:function(n){return function(){try{var o=vo(n.apply(this,arguments));return o&&typeof o.then=="function"?o:ue.resolve(o)}catch(u){return nt(u)}}},spawn:function(n,o,u){try{var l=vo(n.apply(u,o||[]));return l&&typeof l.then=="function"?l:ue.resolve(l)}catch(f){return nt(f)}},currentTransaction:{get:function(){return me.trans||null}},waitFor:function(n,o){return n=ue.resolve(typeof n=="function"?pr.ignoreTransaction(n):n).timeout(o||6e4),me.trans?me.trans.waitFor(n):n},Promise:ue,debug:{get:function(){return wt},set:function(n){B(n)}},derive:b,extend:p,props:w,override:G,Events:sn,on:Zt,liveQuery:iu,extendObservabilitySet:Xn,getByKeyPath:N,setByKeyPath:Z,delByKeyPath:function(n,o){typeof o=="string"?Z(n,o,void 0):"length"in o&&[].map.call(o,function(u){Z(n,u,void 0)})},shallowClone:ae,deepClone:ee,getObjectDiff:bo,cmp:$e,asap:L,minKey:-1/0,addons:[],connections:Mr,errnames:Ae,dependencies:ti,cache:hr,semVer:"4.3.0",version:"4.3.0".split(".").map(function(n){return parseInt(n)}).reduce(function(n,o,u){return n+o/Math.pow(10,2*u)})})),pr.maxKey=fn(pr.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(Zt(ln,function(n){Qt||(n=new CustomEvent(ro,{detail:n}),Qt=!0,dispatchEvent(n),Qt=!1)}),addEventListener(ro,function(n){n=n.detail,Qt||So(n)}));var Kr,Qt=!1,ou=function(){};return typeof BroadcastChannel<"u"&&((ou=function(){(Kr=new BroadcastChannel(ro)).onmessage=function(n){return n.data&&So(n.data)}})(),typeof Kr.unref=="function"&&Kr.unref(),Zt(ln,function(n){Qt||Kr.postMessage(n)})),typeof addEventListener<"u"&&(addEventListener("pagehide",function(n){if(!Bt.disableBfCache&&n.persisted){wt&&console.debug("Dexie: handling persisted pagehide"),Kr!=null&&Kr.close();for(var o=0,u=Mr;o<u.length;o++)u[o].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(n){!Bt.disableBfCache&&n.persisted&&(wt&&console.debug("Dexie: handling persisted pageshow"),ou(),So({all:new ht(-1/0,[[]])}))})),ue.rejectionMapper=function(n,o){return!n||n instanceof we||n instanceof TypeError||n instanceof SyntaxError||!n.name||!rt[n.name]?n:(o=new rt[n.name](o||n.message,n),"stack"in n&&I(o,"stack",{get:function(){return this.inner.stack}}),o)},B(wt),i(Bt,Object.freeze({__proto__:null,Dexie:Bt,Entity:Ps,PropModification:an,RangeSet:ht,add:function(n){return new an({add:n})},cmp:$e,default:Bt,liveQuery:iu,mergeRanges:pn,rangesOverlap:Hs,remove:function(n){return new an({remove:n})},replacePrefix:function(n,o){return new an({replacePrefix:[n,o]})}}),{default:Bt}),Bt})})(hi)),hi.exports}var T_=S_();const ts=An(T_),xl=Symbol.for("Dexie"),en=globalThis[xl]||(globalThis[xl]=ts);if(ts.semVer!==en.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${ts.semVer} and ${en.semVer}`);const{liveQuery:L_,mergeRanges:K_,rangesOverlap:V_,RangeSet:z_,cmp:U_,Entity:G_,PropModification:W_,replacePrefix:H_,add:Y_,remove:J_,DexieYProvider:X_}=en;class E_ extends en{constructor(){super("chat_cache");er(this,"conversations");er(this,"summaries");er(this,"users");er(this,"messages");er(this,"msgCursor");er(this,"groups");this.version(1).stores({summaries:"id",users:"id",messages:"id, conversationId",msgCursor:"id",groups:"id"})}async clearData(){await Promise.all([this.summaries.clear(),this.users.clear(),this.messages.clear(),this.msgCursor.clear(),this.groups.clear()])}}const at=new E_,Vi=({type:e,id:t})=>`${e}:${t}`,C_=({group:e,user:t})=>`${e?"group":"user"}:${e||t}`,O_=(e,t)=>e.group?`group:${e.group}`:`dm:${e.sender===t?e.receiver:e.sender}`,Lf=async e=>{const i=(await jt().getMessagesSummary(e)).map(a=>({...a,id:C_(a)}));return await at.summaries.bulkPut(i),i},Kf=async e=>{const r=await jt().getGroups(e);return await at.groups.clear(),await at.groups.bulkPut(r),r};function A_(e,t,r){var i,a;typeof e=="function"?(i=t||[],a=r):(i=[],a=t);var s=U.useRef({hasResult:!1,result:a,error:null}),c=U.useReducer(function(m){return m+1},0);c[0];var d=c[1],p=U.useMemo(function(){var m=typeof e=="function"?e():e;if(!m||typeof m.subscribe!="function")throw e===m?new TypeError("Given argument to useObservable() was neither a valid observable nor a function."):new TypeError("Observable factory given to useObservable() did not return a valid observable.");if(!s.current.hasResult&&typeof window<"u"&&(typeof m.hasValue!="function"||m.hasValue()))if(typeof m.getValue=="function")s.current.result=m.getValue(),s.current.hasResult=!0;else{var x=m.subscribe(function(_){s.current.result=_,s.current.hasResult=!0});typeof x=="function"?x():x.unsubscribe()}return m},i);if(U.useDebugValue(s.current.result),U.useEffect(function(){var m=p.subscribe(function(x){var _=s.current;(_.error!==null||_.result!==x)&&(_.error=null,_.result=x,_.hasResult=!0,d())},function(x){var _=s.current;_.error!==x&&(_.error=x,d())});return typeof m=="function"?m:m.unsubscribe.bind(m)},i),s.current.error)throw s.current.error;return s.current.result}function On(e,t,r){return A_(function(){return en.liveQuery(e)},t||[],r)}typeof FinalizationRegistry<"u"&&new FinalizationRegistry(function(e){var t=en.DexieYProvider;t&&t.release(e)});const Vf=({selectedConversation:e,currentUser:t,onConversationSelect:r})=>{const[i,a]=U.useState(!0),[s,c]=U.useState(),[d,p]=U.useState(!1),m=On(()=>at.summaries.toArray(),[e])||[],x=On(()=>at.groups.toArray(),[])||[],_=(t==null?void 0:t.role)==="admin"||(t==null?void 0:t.role)==="system",w=U.useCallback(async()=>{a(!0),t!=null&&t.org&&(await Promise.all([Lf({}),Kf(t==null?void 0:t.org)]).catch(G=>{c(G instanceof Error?G:new Error(String(G)))}),a(!1))},[t==null?void 0:t.org]);U.useEffect(()=>{w();const G=setInterval(w,3*6e4);return()=>clearInterval(G)},[w]);const[R,I]=U.useState({});U.useEffect(()=>{const G=async()=>{if(!(t!=null&&t.org))return;const X=jt(),L={};for(const N of m)try{if(N.user!==void 0&&!R[N.user]){const Z=await X.getUser(N.user);L[N.user]=Z.name}}catch(Z){console.error("Failed to load conversation name:",Z)}Object.keys(L).length>0&&I(N=>({...N,...L}))};m.length>0&&(t!=null&&t.org)&&G()},[m,t==null?void 0:t.org]);const b=G=>{if(G.user!==void 0)return R[G.user]||`User ${G.user}`;if(G.group!==void 0){const X=x.find(L=>L.id===G.group);return(X==null?void 0:X.name)||`Group ${G.group}`}return"Unknown"},q=G=>e?G.group!==void 0?e.type==="group"&&e.id===G.group:G.user!==void 0?e.type==="dm"&&e.id===G.user:!1:!1,M=G=>{G.group!==void 0?r({type:"group",id:G.group,name:b(G)}):G.user!==void 0&&r({type:"dm",id:G.user,name:b(G)})},W=async()=>{await w()};return k.jsxs(z.Box,{display:"flex",flexDirection:"column",height:"100%",children:[k.jsx(z.AppBar,{position:"static",elevation:0,sx:{backgroundColor:"background.default",color:"text.primary"},children:k.jsxs(z.Toolbar,{children:[k.jsx(z.Typography,{variant:"h6",component:"div",sx:{flexGrow:1},children:"Messages"}),_&&k.jsx(z.Tooltip,{title:"Create Group",children:k.jsx(z.IconButton,{color:"primary",onClick:()=>p(!0),size:"small",sx:{mr:-2},children:k.jsx(pm,{})})})]})}),_&&(t==null?void 0:t.org)&&k.jsx(qf,{open:d,onClose:()=>p(!1),onSuccess:W,orgId:t.org}),k.jsx(z.Box,{flex:1,overflow:"auto",children:i&&!m.length?k.jsx(z.List,{disablePadding:!0,children:[1,2,3,4,5].map(G=>k.jsx(Hl,{},G))}):s?k.jsx(z.Box,{p:2,children:k.jsxs(z.Alert,{severity:"error",children:["Failed to load conversations: ",s.message]})}):m.length===0&&x.length===0?k.jsx(z.Box,{display:"flex",justifyContent:"center",alignItems:"center",height:"100%",p:2,children:k.jsx(z.Typography,{color:"text.secondary",align:"center",children:"No conversations yet"})}):k.jsx(z.List,{disablePadding:!0,children:(()=>{const G=new Set(m.filter(ae=>ae.group!==void 0).map(ae=>ae.group)),L=x.filter(ae=>!G.has(ae.id)).map(ae=>({group:ae.id,last_message_at:ae.created_at,message_count:0,unread_count:0}));return[...[...m].sort((ae,ye)=>new Date(ye.last_message_at).getTime()-new Date(ae.last_message_at).getTime()),...L].map(ae=>k.jsx(Wl,{conversation:ae,displayName:b(ae),selected:q(ae),onClick:()=>M(ae),currentUser:t},ae.group!==void 0?`group-${ae.group}`:`user-${ae.user}`))})()})})]})},zf=({displayName:e,type:t,subtitle:r,isConnected:i=!0,onBack:a,showJoinButton:s=!1,onJoin:c,joining:d=!1})=>{const p=t==="group",[m,x]=U.useState(null),_=I=>{x(I.currentTarget)},w=()=>{x(null)},R=I=>{c(I),w()};return k.jsx(z.AppBar,{position:"static",elevation:0,sx:{backgroundColor:"background.default",color:"text.primary"},children:k.jsxs(z.Toolbar,{children:[a&&k.jsx(z.IconButton,{edge:"start",color:"inherit",onClick:a,sx:{mr:2,display:{xs:"flex",sm:"flex",md:"none"}},children:k.jsx(mm,{})}),k.jsx(z.Avatar,{sx:{bgcolor:p?"primary.main":"secondary.main",mr:2},children:p?k.jsx(Ul,{}):k.jsx(Gl,{})}),k.jsxs(z.Box,{flex:1,children:[k.jsx(z.Typography,{variant:"h6",component:"div",noWrap:!0,children:e}),r&&k.jsx(z.Typography,{variant:"caption",color:"inherit",sx:{opacity:.7},children:r})]}),s&&p&&k.jsxs(z.Box,{sx:{display:"flex",alignItems:"center",mr:1},children:[k.jsx(z.Button,{variant:"contained",color:"primary",startIcon:k.jsx(xm,{}),endIcon:k.jsx(ym,{}),onClick:_,disabled:d,children:d?"Joining...":"Join"}),k.jsxs(z.Menu,{anchorEl:m,open:!!m,onClose:w,children:[k.jsx(z.MenuItem,{onClick:()=>R("member"),children:"Member"}),k.jsx(z.MenuItem,{onClick:()=>R("moderator"),children:"Moderator"})]})]}),!i&&k.jsx(z.Chip,{icon:k.jsx(Om,{}),label:"Disconnected",size:"small",color:"warning",sx:{ml:1}})]})})};function j_(e){return(typeof e=="string"?new Date(e):e).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})}const Uf=300*1e3;function k_(e,t=Uf){if(e.length===0)return[];const r=[];let i=null;for(const a of e){const s=new Date(a.created_at).getTime();if(!i)i={senderId:a.sender,messages:[a],timestamp:new Date(a.created_at)};else{const c=new Date(i.messages[i.messages.length-1].created_at).getTime(),d=s-c;i.senderId===a.sender&&d<=t?i.messages.push(a):(r.push(i),i={senderId:a.sender,messages:[a],timestamp:new Date(a.created_at)})}}return i&&r.push(i),r}function rs(e,t,r=Uf){if(e.sender!==t.sender)return!1;const i=new Date(e.created_at).getTime(),a=new Date(t.created_at).getTime();return Math.abs(a-i)<=r}function $_(e=""){const t=e.trim().split(" ").filter(r=>r.length>0);if(t.length>=2){const r=t[0],i=t[t.length-1];if(r&&i&&r[0]&&i[0])return(r[0]+i[0]).toUpperCase()}return e.slice(0,2).toUpperCase()}const wl=async(e,t={})=>{const r=jt(),i=Vi(e);e.type==="group"?t.group=e.id:t.user=e.id;const a=await r.getMessages(t);return a.messages.map(c=>({...c,conversationId:i})).forEach(c=>at.messages.put(c)),at.msgCursor.put({...a.cursor,id:i}),a},Gf=U.memo(({message:e,isOwnMessage:t,senderName:r,showSenderName:i=!0,isFirstInGroup:a=!0,isLastInGroup:s=!0,status:c="sent"})=>{const d=e.id.startsWith("temp-"),p=()=>{if(!t||!s)return null;const x={fontSize:14,ml:.5,opacity:.7,verticalAlign:"middle"};return c==="failed"?k.jsx(_m,{sx:{...x,color:"error.main"}}):c==="sending"||d?k.jsx(Sm,{sx:x}):k.jsx(bm,{sx:x})},m=k.jsx(z.Avatar,{sx:{width:32,height:32,fontSize:"0.875rem",color:t?"primary.contrastText":"secondary.contrastText",bgcolor:t?"primary.main":"secondary.main",visibility:s?"visible":"hidden"},children:$_(r)});return k.jsxs(z.Box,{display:"flex",justifyContent:t?"flex-end":"flex-start",alignItems:"flex-end",mb:s?1:.25,gap:1,children:[!t&&m,k.jsxs(z.Paper,{elevation:1,sx:{maxWidth:"80%",p:1.5,backgroundColor:t?"primary.main":"background.paper",color:t?"primary.contrastText":"text.primary",borderTopLeftRadius:t||!a?void 0:4,borderTopRightRadius:!t||!a?void 0:4,borderBottomLeftRadius:t||!s?void 0:4,borderBottomRightRadius:!t||!s?void 0:4},children:[!t&&i&&a&&k.jsx(z.Typography,{variant:"caption",fontWeight:"bold",display:"block",mb:.5,children:r||`User ${e.sender}`}),k.jsx(z.Typography,{variant:"body1",sx:{whiteSpace:"pre-wrap"},children:e.content}),s&&k.jsxs(z.Box,{display:"flex",justifyContent:"flex-end",alignItems:"center",mt:.5,children:[k.jsx(z.Typography,{variant:"caption",color:t?"inherit":"text.secondary",sx:{opacity:.7},children:j_(new Date(e.created_at))}),k.jsx(p,{})]})]}),t&&m]})}),Wf=({isOwnMessage:e=!1})=>k.jsx(z.Box,{display:"flex",justifyContent:e?"flex-end":"flex-start",mb:1,children:k.jsxs(z.Box,{maxWidth:"70%",children:[!e&&k.jsx(z.Skeleton,{variant:"text",width:80,sx:{mb:.5}}),k.jsx(z.Skeleton,{variant:"rounded",width:Math.random()*200+150,height:60,sx:{borderRadius:2,bgcolor:e?"primary.light":"background.main"}})]})}),Hf=({hasMore:e,loading:t,onLoadMore:r,threshold:i=1,rootMargin:a="100px"})=>{const s=U.useRef(null),c=U.useRef(null);return U.useEffect(()=>{if(!e||t)return;const d=s.current;if(d)return c.current=new IntersectionObserver(p=>{const[m]=p;m&&m.isIntersecting&&e&&!t&&r()},{threshold:i,rootMargin:a}),c.current.observe(d),()=>{c.current&&d&&(c.current.unobserve(d),c.current.disconnect())}},[e,t,r,i,a]),e?k.jsx(z.Box,{ref:s,display:"flex",justifyContent:"center",alignItems:"center",py:2,children:t?k.jsx(z.CircularProgress,{size:24}):k.jsx(z.Typography,{variant:"caption",color:"text.secondary",children:"Scroll to load more"})}):null},Cs=(e,t,r)=>{U.useEffect(()=>((async()=>{await e()})(),r),t)};function I_(e){const t=e.map(i=>Number(i.sender));return new Set(t)}function Yf(e){const t=jt(),[r,i]=U.useState(()=>new Map),a=U.useCallback(async()=>{if(!e.length)return r;try{const s=I_(e),c=Array.from(s);if(console.log("[names] size:",s.size),!s.size)return r;const d=(await at.users.bulkGet(c)).filter(w=>!!w),p=new Map;if(d.forEach(w=>{p.set(w.id,w.name)}),s.size===d.length)return p;const m=c.filter(w=>!p.has(w)),x=await t.getUsers(m,{fields:["id","name"]});await at.users.bulkPut(x);const _=p;return x.forEach(w=>_.set(w.id,w.name)),_}catch(s){console.error("[useSenderNames] Failed to fetch users:",s)}return r},[e,r]);return Cs(async()=>{const s=await a();i(s)},[e]),r}const Jf=({messages:e,currentUserId:t,loading:r=!1,error:i=null,autoScroll:a=!0,hasMore:s=!1,loadingMore:c=!1,onLoadMore:d})=>{const p=U.useRef(null),m=U.useRef(null),x=U.useRef(0),_=U.useRef(!0),[w,R]=U.useState(a),I=Yf(e),b=()=>{if(!m.current)return!1;const{scrollTop:M,scrollHeight:W,clientHeight:G}=m.current;return W-M-G<100},q=()=>{_.current=b()};return U.useEffect(()=>{e.length>0&&p.current&&(p.current.scrollIntoView({behavior:"auto"}),_.current=!0)},[]),U.useEffect(()=>{!c||!e.length||(m.current&&(x.current=m.current.scrollHeight),R(!1))},[c]),U.useLayoutEffect(()=>{if(e.length){if(w&&p.current&&_.current)p.current.scrollIntoView({behavior:"smooth"});else if(!w&&m.current&&x.current>0){const W=m.current.scrollHeight-x.current;m.current.scrollTop=m.current.scrollTop+W,x.current=0,R(!0)}}},[e.length,a]),r&&!e.length?k.jsx(z.Box,{flex:1,overflow:"auto",p:2,children:[1,2,3,4,5].map(M=>k.jsx(Wf,{isOwnMessage:M%3===0},M))}):i&&!e.length?k.jsx(z.Box,{display:"flex",justifyContent:"center",alignItems:"center",flex:1,p:2,children:k.jsxs(z.Alert,{severity:"error",children:[k.jsx("strong",{children:"Failed to load messages"}),k.jsx("br",{}),i.message]})}):e.length===0?k.jsx(z.Box,{display:"flex",justifyContent:"center",alignItems:"center",flex:1,children:k.jsx(z.Typography,{variant:"body2",color:"text.secondary",children:"No messages yet. Start the conversation!"})}):k.jsxs(z.Box,{ref:m,flex:1,overflow:"auto",p:2,display:"flex",flexDirection:"column",onScroll:q,children:[s&&d&&k.jsx(Hf,{hasMore:s,loading:c,onLoadMore:d}),e.map((M,W)=>{const G=M.sender,X=M.sender===t,L=I.get(G),N=W>0?e[W-1]:null,Z=W<e.length-1?e[W+1]:null,ae=!N||!rs(N,M),ye=!Z||!rs(M,Z);return k.jsx(Gf,{message:M,isOwnMessage:X,senderName:L,showSenderName:ae,isFirstInGroup:ae,isLastInGroup:ye},M.id)}),k.jsx("div",{ref:p})]})},Xf=({onSend:e,sending:t=!1,placeholder:r="Type a message...",disabled:i=!1})=>{const[a,s]=U.useState(""),c=U.useRef(null),d=()=>{const m=a.trim();m&&!t&&!i&&(e(m),s(""),setTimeout(()=>{var x,_;(_=(x=c.current)==null?void 0:x.querySelector("textarea"))==null||_.focus()},300))},p=m=>{m.key==="Enter"&&!m.shiftKey&&(m.preventDefault(),d())};return k.jsxs(z.Box,{display:"flex",gap:1,p:2,borderTop:1,borderColor:"divider",children:[k.jsx(z.TextField,{ref:c,fullWidth:!0,multiline:!0,maxRows:4,value:a,onChange:m=>s(m.target.value),onKeyDown:p,placeholder:r,disabled:i||t,variant:"outlined",size:"small"}),k.jsx(z.IconButton,{color:"primary",onClick:d,disabled:!a.trim()||t||i,size:"large",children:t?k.jsx(z.CircularProgress,{size:24}):k.jsx(Tm,{})})]})};function Zf({conversation:e,limit:t=50}){const r=Vi(e),[i,a]=U.useState(!1),[s,c]=U.useState(!1),[d,p]=U.useState(),m=On(()=>at.messages.where("conversationId").equals(r).sortBy("created_at"),[r])||[],x=On(()=>at.msgCursor.where("id").equals(r).first(),[r]);Cs(async()=>{var R;const w={limit:t};m.length&&(w.cursorType="after",w.cursorDatetime=(R=m[m.length-1])==null?void 0:R.created_at),a(!0),await wl(e,w).catch(p),a(!1),await at.summaries.update(r,{unread_count:0})},[e,t]),console.log("mw",m.length);const _=U.useCallback(async()=>{if(!(!x||s||i)){c(!0);try{const w={limit:t};if(!(x!=null&&x.datetime))return;w.cursorType="before",w.cursorDatetime=x.datetime,await wl(e,w)}catch(w){console.error("[useMessages] Failed to load more:",w)}c(!1)}},[x,t,e,s,i]);return{messages:m,cursor:x,loading:i,error:d,loadMore:_,loadingMore:s}}const Qf=({conversation:e,user:t,isConnected:r,onBack:i})=>{const a=jt(),{messages:s,cursor:c,loading:d,error:p,loadMore:m,loadingMore:x}=Zf({conversation:e}),_=On(async()=>e.type==="group"?await at.groups.get(e.id):null,[e.id,e.type]),w=(t==null?void 0:t.role)==="admin",R=(_==null?void 0:_.is_member)??!0,I=w&&e.type==="group"&&!R,b=e.type==="group"&&!R,[q,M]=U.useState(!1),[W,G]=U.useState(!1),X=async v=>{if(e.type==="group"){M(!0);try{await a.joinGroup(t.org,e.id,v),G(!0),await Kf(t.org),await Lf({}),setTimeout(()=>G(!1),3e3)}catch(ee){ae(pi(ee,"Failed to join group"))}M(!1)}},[L,N]=U.useState(!1),[Z,ae]=U.useState(null),[ye,We]=U.useState(!1),be=async v=>{if(!v.trim())return;N(!0),ae(null),We(!0);const ee=`temp-${Date.now()}-${Math.random()}`,te={id:ee,sender:t==null?void 0:t.id,receiver:e.type==="dm"?e.id:null,group:e.type==="group"?e.id:null,content:v,created_at:new Date().toISOString(),conversationId:Vi(e)};try{await at.messages.put(te),await(e.type==="group"?a.sendGroupMessage:a.sendDM).bind(a)(e.id,v),await at.messages.delete(ee)}catch(ge){ae(pi(ge,"Failed to send message"))}N(!1),setTimeout(()=>We(!1),100)};return k.jsxs(z.Box,{display:"flex",flexDirection:"column",height:"100%",children:[k.jsx(zf,{displayName:e.name||"Chat",type:e.type,isConnected:r,onBack:i,showJoinButton:I,onJoin:X,joining:q}),k.jsx(z.Snackbar,{open:W,autoHideDuration:3e3,onClose:()=>G(!1),message:"Successfully joined group"}),Z&&k.jsx(z.Alert,{severity:"error",onClose:()=>ae(null),children:Z.message}),k.jsx(Jf,{messages:s,currentUserId:(t==null?void 0:t.id)||0,loading:d,error:p,autoScroll:!0,hasMore:!!(c!=null&&c.datetime),loadingMore:x,onLoadMore:m,forceScrollToBottom:ye}),b?k.jsx(z.Alert,{severity:"warning",sx:{m:2},children:"You must be a group member to send messages"}):k.jsx(Xf,{onSend:be,sending:L})]})};class ns extends U.Component{constructor(r){super(r);er(this,"handleReset",()=>{this.setState({hasError:!1,error:null})});this.state={hasError:!1,error:null}}static getDerivedStateFromError(r){return{hasError:!0,error:r}}componentDidCatch(r,i){var a,s;console.error("ErrorBoundary caught an error:",r,i),(s=(a=this.props).onError)==null||s.call(a,r,i)}render(){var r;return this.state.hasError?this.props.fallback?this.props.fallback:k.jsxs(z.Box,{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",height:"100%",p:3,children:[k.jsxs(z.Alert,{severity:"error",sx:{mb:2,maxWidth:500},children:[k.jsx(z.Typography,{variant:"h6",gutterBottom:!0,children:"Something went wrong"}),k.jsx(z.Typography,{variant:"body2",color:"text.secondary",children:((r=this.state.error)==null?void 0:r.message)||"An unexpected error occurred"})]}),k.jsx(z.Button,{variant:"contained",startIcon:k.jsx(wm,{}),onClick:this.handleReset,children:"Try Again"})]}):this.props.children}}function ed({onMessage:e,onConnect:t,onDisconnect:r,onError:i,currentUserId:a,conversation:s,updateCache:c=!0}={}){const d=U.useRef(a),p=U.useRef(s),m=U.useRef(c),x=U.useRef(e);U.useEffect(()=>{d.current=a,p.current=s,m.current=c,x.current=e},[a,s,c,e]);const _=U.useCallback(async b=>{var q;if(b.type==="message"){const M=b.data;if((q=x.current)==null||q.call(x,M),console.log("sss",{updateCache:m.current,currentUserId:d.current}),!m.current||!d.current)return;const W=p.current&&Vi(p.current),G=O_(M,d.current),X={...M,conversationId:G};at.messages.put(X);const L=await at.summaries.get(G),{unread_count:N,message_count:Z}=L,ae={message_count:Z+1,last_message_at:M.created_at};G!==W&&(ae.unread_count=N+1),await at.summaries.update(G,ae)}},[]),w=U.useCallback(()=>{t==null||t()},[t]),R=U.useCallback((b,q)=>{r==null||r(b,q)},[r]),I=U.useCallback(b=>{console.error("[WS] WebSocket error:",b),i==null||i(b)},[i]);U.useEffect(()=>{try{const b=jt();return console.log("www adding listeners"),b.on("message",_),b.on("open",w),b.on("close",R),b.on("error",I),()=>{console.log("www removing listeners"),b.off("message",_),b.off("open",w),b.off("close",R),b.off("error",I)}}catch(b){console.error("Failed to setup WebSocket listeners:",b)}},[_,w,R,I])}const P_=({initialConversation:e})=>{const[t,r]=U.useState(e??null),[i,a]=U.useState(),[s,c]=U.useState(!0),d=_=>()=>c(_),p=jt();Cs(async()=>{const _=await p.getMe();a(_),at.users.put(_),console.log("sdf user set",_)},[]),ed({onError:d(!1),onConnect:d(!0),onDisconnect:d(!1),currentUserId:i==null?void 0:i.id,conversation:t,updateCache:!0});const m=_=>{r(_)},x=()=>{r(null)};return k.jsxs(z.Box,{display:"flex",height:"100%",overflow:"hidden",children:[k.jsx(z.Box,{sx:{width:{xs:"100%",sm:"100%",md:"320px"},flexShrink:0,border:"0px solid",borderRightWidth:{xs:0,md:1},borderColor:"divider",overflow:"hidden",display:{xs:t?"none":"flex",sm:t?"none":"flex",md:"flex"},flexDirection:"column"},children:k.jsx(ns,{children:k.jsx(Vf,{currentUser:i,selectedConversation:t,onConversationSelect:m})})}),k.jsx(z.Box,{sx:{flex:1,overflow:"hidden",display:{xs:t?"flex":"none",sm:t?"flex":"none",md:"flex"},flexDirection:"column"},children:t?k.jsx(ns,{children:k.jsx(Qf,{conversation:t,user:i,isConnected:s,onBack:x})}):k.jsx(z.Box,{display:"flex",justifyContent:"center",alignItems:"center",height:"100%",color:"text.secondary",children:"Select a conversation to start chatting"})})]})},R_=({count:e,children:t,max:r=99})=>k.jsx(z.Badge,{badgeContent:e,color:"error",max:r,overlap:"rectangular",sx:{"& .MuiBadge-badge":{right:8,top:"50%",transform:"translateY(-50%)"}},children:t}),D_={SUMMARIES:300*1e3,USER:3600*1e3,MESSAGES:1/0},F_=()=>typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches,M_={mode:"dark",background:{paper:"#3d3d43",default:"#333338"},text:{primary:"#eee",secondary:"#aaa"}},N_={mode:"light",background:{default:"#f5f5f5",paper:"#ffff"}},td=e=>{const t=F_(),i=(e||(t?"dark":"light"))==="dark";return zl({palette:{...i?M_:N_,primary:{main:"#E91E63",light:"#F48FB1",dark:"#AD1457",contrastText:"#fff"},secondary:{main:"#e4e6eb",light:"#f0f2f5",dark:"#b0b3b8",contrastText:"rgba(0, 0, 0, 0.87)"},error:{main:"#d32f2f",light:"#ef5350",dark:"#c62828",contrastText:"#fff"},warning:{main:"#ed6c02",light:"#ff9800",dark:"#e65100",contrastText:"#fff"},info:{main:"#0288d1",light:"#03a9f4",dark:"#01579b",contrastText:"#fff"},success:{main:"#2e7d32",light:"#4caf50",dark:"#1b5e20",contrastText:"#fff"}},typography:{fontFamily:["-apple-system","BlinkMacSystemFont",'"Segoe UI"',"Roboto",'"Helvetica Neue"',"Arial","sans-serif",'"Apple Color Emoji"','"Segoe UI Emoji"','"Segoe UI Symbol"'].join(","),fontSize:14,h1:{fontSize:"2.5rem",fontWeight:500},h2:{fontSize:"2rem",fontWeight:500},h3:{fontSize:"1.75rem",fontWeight:500},h4:{fontSize:"1.5rem",fontWeight:500},h5:{fontSize:"1.25rem",fontWeight:500},h6:{fontSize:"1rem",fontWeight:500},body1:{fontSize:"0.9375rem",lineHeight:1.4},body2:{fontSize:"0.8125rem",lineHeight:1.4}},shape:{borderRadius:12},components:{MuiButton:{styleOverrides:{root:{textTransform:"none",fontWeight:500,borderRadius:20}}},MuiIconButton:{styleOverrides:{root:{borderRadius:"50%"}}},MuiPaper:{styleOverrides:{root:{backgroundImage:"none"},rounded:{borderRadius:12}}},MuiBadge:{styleOverrides:{badge:{fontSize:"0.6875rem",height:18,minWidth:18,borderRadius:9,fontWeight:600}}},MuiCssBaseline:{styleOverrides:{body:{"*::-webkit-scrollbar":{width:"8px",height:"8px"},"*::-webkit-scrollbar-track":{background:"undo",borderRadius:"4px"},"*::-webkit-scrollbar-thumb":{background:"undo",borderRadius:"4px","&:hover":{background:"undo"}},scrollbarWidth:"thin",scrollbarColor:i?"#6a6a6e #333338":"#c1c1c1 #f5f5f5"}}}}})},B_=td();exports.CACHE_TTL=D_;exports.ChatApp=Dd;exports.ChatContainer=P_;exports.ChatHeader=zf;exports.ChatWindow=Qf;exports.ConversationItem=Wl;exports.ConversationItemSkeleton=Hl;exports.ConversationList=Vf;exports.CreateGroupDialog=qf;exports.ErrorBoundary=ns;exports.LoadMoreTrigger=Hf;exports.MessageBubble=Gf;exports.MessageInput=Xf;exports.MessageList=Jf;exports.MessageSkeleton=Wf;exports.UnreadBadge=R_;exports.db=at;exports.disconnectSDK=Ka;exports.getSDK=jt;exports.getTheme=td;exports.groupMessages=k_;exports.initSDK=Sl;exports.isSDKInitialized=Id;exports.shouldGroupMessages=rs;exports.theme=B_;exports.useMessages=Zf;exports.useSenderNames=Yf;exports.useWebSocketMessages=ed;
93
+ `+(d!==c?`result of cast: ${d}`:""))}return s}_cast(t,r){let i=t===void 0?t:this.transforms.reduce((a,s)=>s.call(this,a,t,this,r),t);return i===void 0&&(i=this.getDefault(r)),i}_validate(t,r={},i,a){let{path:s,originalValue:c=t,strict:d=this.spec.strict}=r,p=t;d||(p=this._cast(p,Object.assign({assert:!1},r)));let m=[];for(let x of Object.values(this.internalTests))x&&m.push(x);this.runTests({path:s,value:p,originalValue:c,options:r,tests:m},i,x=>{if(x.length)return a(x,p);this.runTests({path:s,value:p,originalValue:c,options:r,tests:this.tests},i,a)})}runTests(t,r,i){let a=!1,{tests:s,value:c,originalValue:d,path:p,options:m}=t,x=_=>{a||(a=!0,r(_,c))},b=_=>{a||(a=!0,i(_,c))},S=s.length,R=[];if(!S)return b([]);let P={value:c,originalValue:d,path:p,options:m,schema:this};for(let _=0;_<s.length;_++){const L=s[_];L(P,x,function(H){H&&(Array.isArray(H)?R.push(...H):R.push(H)),--S<=0&&b(R)})}}asNestedTest({key:t,index:r,parent:i,parentPath:a,originalParent:s,options:c}){const d=t??r;if(d==null)throw TypeError("Must include `key` or `index` for nested validations");const p=typeof d=="number";let m=i[d];const x=Object.assign({},c,{strict:!0,parent:i,value:m,originalValue:s[d],key:void 0,[p?"index":"key"]:d,path:p||d.includes(".")?`${a||""}[${p?d:`"${d}"`}]`:(a?`${a}.`:"")+t});return(b,S,R)=>this.resolve(x)._validate(m,x,S,R)}validate(t,r){var i;let a=this.resolve(Object.assign({},r,{value:t})),s=(i=r==null?void 0:r.disableStackTrace)!=null?i:a.spec.disableStackTrace;return new Promise((c,d)=>a._validate(t,r,(p,m)=>{vt.isError(p)&&(p.value=m),d(p)},(p,m)=>{p.length?d(new vt(p,m,void 0,void 0,s)):c(m)}))}validateSync(t,r){var i;let a=this.resolve(Object.assign({},r,{value:t})),s,c=(i=r==null?void 0:r.disableStackTrace)!=null?i:a.spec.disableStackTrace;return a._validate(t,Object.assign({},r,{sync:!0}),(d,p)=>{throw vt.isError(d)&&(d.value=p),d},(d,p)=>{if(d.length)throw new vt(d,t,void 0,void 0,c);s=p}),s}isValid(t,r){return this.validate(t,r).then(()=>!0,i=>{if(vt.isError(i))return!1;throw i})}isValidSync(t,r){try{return this.validateSync(t,r),!0}catch(i){if(vt.isError(i))return!1;throw i}}_getDefault(t){let r=this.spec.default;return r==null?r:typeof r=="function"?r.call(this,t):Zr(r)}getDefault(t){return this.resolve(t||{})._getDefault(t)}default(t){return arguments.length===0?this._getDefault():this.clone({default:t})}strict(t=!0){return this.clone({strict:t})}nullability(t,r){const i=this.clone({nullable:t});return i.internalTests.nullable=Jr({message:r,name:"nullable",test(a){return a===null?this.schema.spec.nullable:!0}}),i}optionality(t,r){const i=this.clone({optional:t});return i.internalTests.optionality=Jr({message:r,name:"optionality",test(a){return a===void 0?this.schema.spec.optional:!0}}),i}optional(){return this.optionality(!0)}defined(t=Mt.defined){return this.optionality(!1,t)}nullable(){return this.nullability(!0)}nonNullable(t=Mt.notNull){return this.nullability(!1,t)}required(t=Mt.required){return this.clone().withMutation(r=>r.nonNullable(t).defined(t))}notRequired(){return this.clone().withMutation(t=>t.nullable().optional())}transform(t){let r=this.clone();return r.transforms.push(t),r}test(...t){let r;if(t.length===1?typeof t[0]=="function"?r={test:t[0]}:r=t[0]:t.length===2?r={name:t[0],test:t[1]}:r={name:t[0],message:t[1],test:t[2]},r.message===void 0&&(r.message=Mt.default),typeof r.test!="function")throw new TypeError("`test` is a required parameters");let i=this.clone(),a=Jr(r),s=r.exclusive||r.name&&i.exclusiveTests[r.name]===!0;if(r.exclusive&&!r.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return r.name&&(i.exclusiveTests[r.name]=!!r.exclusive),i.tests=i.tests.filter(c=>!(c.OPTIONS.name===r.name&&(s||c.OPTIONS.test===a.OPTIONS.test))),i.tests.push(a),i}when(t,r){!Array.isArray(t)&&typeof t!="string"&&(r=t,t=".");let i=this.clone(),a=kf(t).map(s=>new Rr(s));return a.forEach(s=>{s.isSibling&&i.deps.push(s.key)}),i.conditions.push(typeof r=="function"?new wi(a,r):wi.fromOptions(a,r)),i}typeError(t){let r=this.clone();return r.internalTests.typeError=Jr({message:t,name:"typeError",skipAbsent:!0,test(i){return this.schema._typeCheck(i)?!0:this.createError({params:{type:this.schema.type}})}}),r}oneOf(t,r=Mt.oneOf){let i=this.clone();return t.forEach(a=>{i._whitelist.add(a),i._blacklist.delete(a)}),i.internalTests.whiteList=Jr({message:r,name:"oneOf",skipAbsent:!0,test(a){let s=this.schema._whitelist,c=s.resolveAll(this.resolve);return c.includes(a)?!0:this.createError({params:{values:Array.from(s).join(", "),resolved:c}})}}),i}notOneOf(t,r=Mt.notOneOf){let i=this.clone();return t.forEach(a=>{i._blacklist.add(a),i._whitelist.delete(a)}),i.internalTests.blacklist=Jr({message:r,name:"notOneOf",test(a){let s=this.schema._blacklist,c=s.resolveAll(this.resolve);return c.includes(a)?this.createError({params:{values:Array.from(s).join(", "),resolved:c}}):!0}}),i}strip(t=!0){let r=this.clone();return r.spec.strip=t,r}describe(t){const r=(t?this.resolve(t):this).clone(),{label:i,meta:a,optional:s,nullable:c}=r.spec;return{meta:a,label:i,optional:s,nullable:c,default:r.getDefault(t),type:r.type,oneOf:r._whitelist.describe(),notOneOf:r._blacklist.describe(),tests:r.tests.filter((p,m,x)=>x.findIndex(b=>b.OPTIONS.name===p.OPTIONS.name)===m).map(p=>{const m=p.OPTIONS.params&&t?Df(Object.assign({},p.OPTIONS.params),t):p.OPTIONS.params;return{name:p.OPTIONS.name,params:m}})}}get"~standard"(){const t=this;return{version:1,vendor:"yup",async validate(i){try{return{value:await t.validate(i,{abortEarly:!1})}}catch(a){if(a instanceof vt)return{issues:Mf(a)};throw a}}}}}Nt.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])Nt.prototype[`${e}At`]=function(t,r,i={}){const{parent:a,parentPath:s,schema:c}=p0(this,t,r,i.context);return c[e](a&&a[s],Object.assign({},i,{parent:a,path:t}))};for(const e of["equals","is"])Nt.prototype[e]=Nt.prototype.oneOf;for(const e of["not","nope"])Nt.prototype[e]=Nt.prototype.notOneOf;const g0=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function v0(e){const t=ns(e);if(!t)return Date.parse?Date.parse(e):Number.NaN;if(t.z===void 0&&t.plusMinus===void 0)return new Date(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond).valueOf();let r=0;return t.z!=="Z"&&t.plusMinus!==void 0&&(r=t.hourOffset*60+t.minuteOffset,t.plusMinus==="+"&&(r=0-r)),Date.UTC(t.year,t.month,t.day,t.hour,t.minute+r,t.second,t.millisecond)}function ns(e){var t,r;const i=g0.exec(e);return i?{year:zt(i[1]),month:zt(i[2],1)-1,day:zt(i[3],1),hour:zt(i[4]),minute:zt(i[5]),second:zt(i[6]),millisecond:i[7]?zt(i[7].substring(0,3)):0,precision:(t=(r=i[7])==null?void 0:r.length)!=null?t:void 0,z:i[8]||void 0,plusMinus:i[9]||void 0,hourOffset:zt(i[10]),minuteOffset:zt(i[11])}:null}function zt(e,t=0){return Number(e)||t}let b0=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,_0=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,x0=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,S0="^\\d{4}-\\d{2}-\\d{2}",w0="\\d{2}:\\d{2}:\\d{2}",E0="(([+-]\\d{2}(:?\\d{2})?)|Z)",T0=new RegExp(`${S0}T${w0}(\\.\\d+)?${E0}$`),C0=e=>Sr(e)||e===e.trim(),O0={}.toString();function Nf(){return new Bf}class Bf extends Nt{constructor(){super({type:"string",check(t){return t instanceof String&&(t=t.valueOf()),typeof t=="string"}}),this.withMutation(()=>{this.transform((t,r)=>{if(!this.spec.coerce||this.isType(t)||Array.isArray(t))return t;const i=t!=null&&t.toString?t.toString():t;return i===O0?t:i})})}required(t){return super.required(t).withMutation(r=>r.test({message:t||Mt.required,name:"required",skipAbsent:!0,test:i=>!!i.length}))}notRequired(){return super.notRequired().withMutation(t=>(t.tests=t.tests.filter(r=>r.OPTIONS.name!=="required"),t))}length(t,r=bt.length){return this.test({message:r,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(i){return i.length===this.resolve(t)}})}min(t,r=bt.min){return this.test({message:r,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(i){return i.length>=this.resolve(t)}})}max(t,r=bt.max){return this.test({name:"max",exclusive:!0,message:r,params:{max:t},skipAbsent:!0,test(i){return i.length<=this.resolve(t)}})}matches(t,r){let i=!1,a,s;return r&&(typeof r=="object"?{excludeEmptyString:i=!1,message:a,name:s}=r:a=r),this.test({name:s||"matches",message:a||bt.matches,params:{regex:t},skipAbsent:!0,test:c=>c===""&&i||c.search(t)!==-1})}email(t=bt.email){return this.matches(b0,{name:"email",message:t,excludeEmptyString:!0})}url(t=bt.url){return this.matches(_0,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=bt.uuid){return this.matches(x0,{name:"uuid",message:t,excludeEmptyString:!1})}datetime(t){let r="",i,a;return t&&(typeof t=="object"?{message:r="",allowOffset:i=!1,precision:a=void 0}=t:r=t),this.matches(T0,{name:"datetime",message:r||bt.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:r||bt.datetime_offset,params:{allowOffset:i},skipAbsent:!0,test:s=>{if(!s||i)return!0;const c=ns(s);return c?!!c.z:!1}}).test({name:"datetime_precision",message:r||bt.datetime_precision,params:{precision:a},skipAbsent:!0,test:s=>{if(!s||a==null)return!0;const c=ns(s);return c?c.precision===a:!1}})}ensure(){return this.default("").transform(t=>t===null?"":t)}trim(t=bt.trim){return this.transform(r=>r!=null?r.trim():r).test({message:t,name:"trim",test:C0})}lowercase(t=bt.lowercase){return this.transform(r=>Sr(r)?r:r.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:r=>Sr(r)||r===r.toLowerCase()})}uppercase(t=bt.uppercase){return this.transform(r=>Sr(r)?r:r.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:r=>Sr(r)||r===r.toUpperCase()})}}Nf.prototype=Bf.prototype;let A0=new Date(""),j0=e=>Object.prototype.toString.call(e)==="[object Date]";class ws extends Nt{constructor(){super({type:"date",check(t){return j0(t)&&!isNaN(t.getTime())}}),this.withMutation(()=>{this.transform((t,r)=>!this.spec.coerce||this.isType(t)||t===null?t:(t=v0(t),isNaN(t)?ws.INVALID_DATE:new Date(t)))})}prepareParam(t,r){let i;if(Rr.isRef(t))i=t;else{let a=this.cast(t);if(!this._typeCheck(a))throw new TypeError(`\`${r}\` must be a Date or a value that can be \`cast()\` to a Date`);i=a}return i}min(t,r=rs.min){let i=this.prepareParam(t,"min");return this.test({message:r,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(a){return a>=this.resolve(i)}})}max(t,r=rs.max){let i=this.prepareParam(t,"max");return this.test({message:r,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(a){return a<=this.resolve(i)}})}}ws.INVALID_DATE=A0;function $0(e,t=[]){let r=[],i=new Set,a=new Set(t.map(([c,d])=>`${c}-${d}`));function s(c,d){let p=Tr.split(c)[0];i.add(p),a.has(`${d}-${p}`)||r.push([d,p])}for(const c of Object.keys(e)){let d=e[c];i.add(c),Rr.isRef(d)&&d.isSibling?s(d.path,c):Ss(d)&&"deps"in d&&d.deps.forEach(p=>s(p,c))}return r0.array(Array.from(i),r).reverse()}function Ec(e,t){let r=1/0;return e.some((i,a)=>{var s;if((s=t.path)!=null&&s.includes(i))return r=a,!0}),r}function qf(e){return(t,r)=>Ec(e,t)-Ec(e,r)}const k0=(e,t,r)=>{if(typeof e!="string")return e;let i=e;try{i=JSON.parse(e)}catch{}return r.isType(i)?i:e};function mi(e){if("fields"in e){const t={};for(const[r,i]of Object.entries(e.fields))t[r]=mi(i);return e.setFields(t)}if(e.type==="array"){const t=e.optional();return t.innerType&&(t.innerType=mi(t.innerType)),t}return e.type==="tuple"?e.optional().clone({types:e.spec.types.map(mi)}):"optional"in e?e.optional():e}const P0=(e,t)=>{const r=[...Tr.normalizePath(t)];if(r.length===1)return r[0]in e;let i=r.pop(),a=Tr.getter(Tr.join(r),!0)(e);return!!(a&&i in a)};let Tc=e=>Object.prototype.toString.call(e)==="[object Object]";function Cc(e,t){let r=Object.keys(e.fields);return Object.keys(t).filter(i=>r.indexOf(i)===-1)}const R0=qf([]);function Lf(e){return new Vf(e)}class Vf extends Nt{constructor(t){super({type:"object",check(r){return Tc(r)||typeof r=="function"}}),this.fields=Object.create(null),this._sortErrors=R0,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{t&&this.shape(t)})}_cast(t,r={}){var i;let a=super._cast(t,r);if(a===void 0)return this.getDefault(r);if(!this._typeCheck(a))return a;let s=this.fields,c=(i=r.stripUnknown)!=null?i:this.spec.noUnknown,d=[].concat(this._nodes,Object.keys(a).filter(b=>!this._nodes.includes(b))),p={},m=Object.assign({},r,{parent:p,__validating:r.__validating||!1}),x=!1;for(const b of d){let S=s[b],R=b in a,P=a[b];if(S){let _;m.path=(r.path?`${r.path}.`:"")+b,S=S.resolve({value:P,context:r.context,parent:p});let L=S instanceof Nt?S.spec:void 0,M=L==null?void 0:L.strict;if(L!=null&&L.strip){x=x||b in a;continue}_=!r.__validating||!M?S.cast(P,m):P,_!==void 0&&(p[b]=_)}else R&&!c&&(p[b]=P);(R!==b in p||p[b]!==P)&&(x=!0)}return x?p:a}_validate(t,r={},i,a){let{from:s=[],originalValue:c=t,recursive:d=this.spec.recursive}=r;r.from=[{schema:this,value:c},...s],r.__validating=!0,r.originalValue=c,super._validate(t,r,i,(p,m)=>{if(!d||!Tc(m)){a(p,m);return}c=c||m;let x=[];for(let b of this._nodes){let S=this.fields[b];!S||Rr.isRef(S)||x.push(S.asNestedTest({options:r,key:b,parent:m,parentPath:r.path,originalParent:c}))}this.runTests({tests:x,value:m,originalValue:c,options:r},i,b=>{a(b.sort(this._sortErrors).concat(p),m)})})}clone(t){const r=super.clone(t);return r.fields=Object.assign({},this.fields),r._nodes=this._nodes,r._excludedEdges=this._excludedEdges,r._sortErrors=this._sortErrors,r}concat(t){let r=super.concat(t),i=r.fields;for(let[a,s]of Object.entries(this.fields)){const c=i[a];i[a]=c===void 0?s:c}return r.withMutation(a=>a.setFields(i,[...this._excludedEdges,...t._excludedEdges]))}_getDefault(t){if("default"in this.spec)return super._getDefault(t);if(!this._nodes.length)return;let r={};return this._nodes.forEach(i=>{var a;const s=this.fields[i];let c=t;(a=c)!=null&&a.value&&(c=Object.assign({},c,{parent:c.value,value:c.value[i]})),r[i]=s&&"getDefault"in s?s.getDefault(c):void 0}),r}setFields(t,r){let i=this.clone();return i.fields=t,i._nodes=$0(t,r),i._sortErrors=qf(Object.keys(t)),r&&(i._excludedEdges=r),i}shape(t,r=[]){return this.clone().withMutation(i=>{let a=i._excludedEdges;return r.length&&(Array.isArray(r[0])||(r=[r]),a=[...i._excludedEdges,...r]),i.setFields(Object.assign(i.fields,t),a)})}partial(){const t={};for(const[r,i]of Object.entries(this.fields))t[r]="optional"in i&&i.optional instanceof Function?i.optional():i;return this.setFields(t)}deepPartial(){return mi(this)}pick(t){const r={};for(const i of t)this.fields[i]&&(r[i]=this.fields[i]);return this.setFields(r,this._excludedEdges.filter(([i,a])=>t.includes(i)&&t.includes(a)))}omit(t){const r=[];for(const i of Object.keys(this.fields))t.includes(i)||r.push(i);return this.pick(r)}from(t,r,i){let a=Tr.getter(t,!0);return this.transform(s=>{if(!s)return s;let c=s;return P0(s,t)&&(c=Object.assign({},s),i||delete c[t],c[r]=a(s)),c})}json(){return this.transform(k0)}exact(t){return this.test({name:"exact",exclusive:!0,message:t||pi.exact,test(r){if(r==null)return!0;const i=Cc(this.schema,r);return i.length===0||this.createError({params:{properties:i.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(t=!0,r=pi.noUnknown){typeof t!="boolean"&&(r=t,t=!0);let i=this.test({name:"noUnknown",exclusive:!0,message:r,test(a){if(a==null)return!0;const s=Cc(this.schema,a);return!t||s.length===0||this.createError({params:{unknown:s.join(", ")}})}});return i.spec.noUnknown=t,i}unknown(t=!0,r=pi.noUnknown){return this.noUnknown(!t,r)}transformKeys(t){return this.transform(r=>{if(!r)return r;const i={};for(const a of Object.keys(r))i[t(a)]=r[a];return i})}camelCase(){return this.transformKeys(Go.camelCase)}snakeCase(){return this.transformKeys(Go.snakeCase)}constantCase(){return this.transformKeys(t=>Go.snakeCase(t).toUpperCase())}describe(t){const r=(t?this.resolve(t):this).clone(),i=super.describe(t);i.fields={};for(const[s,c]of Object.entries(r.fields)){var a;let d=t;(a=d)!=null&&a.value&&(d=Object.assign({},d,{parent:d.value,value:d.value[s]})),i.fields[s]=c.describe(d)}return i}}Lf.prototype=Vf.prototype;var Wo,Oc;function Es(){if(Oc)return Wo;Oc=1;var e=Array.isArray;return Wo=e,Wo}var Yo,Ac;function I0(){if(Ac)return Yo;Ac=1;var e=typeof bn=="object"&&bn&&bn.Object===Object&&bn;return Yo=e,Yo}var Ho,jc;function Ts(){if(jc)return Ho;jc=1;var e=I0(),t=typeof self=="object"&&self&&self.Object===Object&&self,r=e||t||Function("return this")();return Ho=r,Ho}var Jo,$c;function Cs(){if($c)return Jo;$c=1;var e=Ts(),t=e.Symbol;return Jo=t,Jo}var Xo,kc;function D0(){if(kc)return Xo;kc=1;var e=Cs(),t=Object.prototype,r=t.hasOwnProperty,i=t.toString,a=e?e.toStringTag:void 0;function s(c){var d=r.call(c,a),p=c[a];try{c[a]=void 0;var m=!0}catch{}var x=i.call(c);return m&&(d?c[a]=p:delete c[a]),x}return Xo=s,Xo}var Zo,Pc;function F0(){if(Pc)return Zo;Pc=1;var e=Object.prototype,t=e.toString;function r(i){return t.call(i)}return Zo=r,Zo}var Qo,Rc;function Kf(){if(Rc)return Qo;Rc=1;var e=Cs(),t=D0(),r=F0(),i="[object Null]",a="[object Undefined]",s=e?e.toStringTag:void 0;function c(d){return d==null?d===void 0?a:i:s&&s in Object(d)?t(d):r(d)}return Qo=c,Qo}var ea,Ic;function M0(){if(Ic)return ea;Ic=1;function e(t){return t!=null&&typeof t=="object"}return ea=e,ea}var ta,Dc;function Os(){if(Dc)return ta;Dc=1;var e=Kf(),t=M0(),r="[object Symbol]";function i(a){return typeof a=="symbol"||t(a)&&e(a)==r}return ta=i,ta}var ra,Fc;function N0(){if(Fc)return ra;Fc=1;var e=Es(),t=Os(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,i=/^\w*$/;function a(s,c){if(e(s))return!1;var d=typeof s;return d=="number"||d=="symbol"||d=="boolean"||s==null||t(s)?!0:i.test(s)||!r.test(s)||c!=null&&s in Object(c)}return ra=a,ra}var na,Mc;function zf(){if(Mc)return na;Mc=1;function e(t){var r=typeof t;return t!=null&&(r=="object"||r=="function")}return na=e,na}var ia,Nc;function B0(){if(Nc)return ia;Nc=1;var e=Kf(),t=zf(),r="[object AsyncFunction]",i="[object Function]",a="[object GeneratorFunction]",s="[object Proxy]";function c(d){if(!t(d))return!1;var p=e(d);return p==i||p==a||p==r||p==s}return ia=c,ia}var oa,Bc;function q0(){if(Bc)return oa;Bc=1;var e=Ts(),t=e["__core-js_shared__"];return oa=t,oa}var aa,qc;function L0(){if(qc)return aa;qc=1;var e=q0(),t=(function(){var i=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return i?"Symbol(src)_1."+i:""})();function r(i){return!!t&&t in i}return aa=r,aa}var sa,Lc;function V0(){if(Lc)return sa;Lc=1;var e=Function.prototype,t=e.toString;function r(i){if(i!=null){try{return t.call(i)}catch{}try{return i+""}catch{}}return""}return sa=r,sa}var ua,Vc;function K0(){if(Vc)return ua;Vc=1;var e=B0(),t=L0(),r=zf(),i=V0(),a=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,c=Function.prototype,d=Object.prototype,p=c.toString,m=d.hasOwnProperty,x=RegExp("^"+p.call(m).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function b(S){if(!r(S)||t(S))return!1;var R=e(S)?x:s;return R.test(i(S))}return ua=b,ua}var ca,Kc;function z0(){if(Kc)return ca;Kc=1;function e(t,r){return t==null?void 0:t[r]}return ca=e,ca}var la,zc;function Uf(){if(zc)return la;zc=1;var e=K0(),t=z0();function r(i,a){var s=t(i,a);return e(s)?s:void 0}return la=r,la}var fa,Uc;function Ki(){if(Uc)return fa;Uc=1;var e=Uf(),t=e(Object,"create");return fa=t,fa}var da,Gc;function U0(){if(Gc)return da;Gc=1;var e=Ki();function t(){this.__data__=e?e(null):{},this.size=0}return da=t,da}var ha,Wc;function G0(){if(Wc)return ha;Wc=1;function e(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r}return ha=e,ha}var pa,Yc;function W0(){if(Yc)return pa;Yc=1;var e=Ki(),t="__lodash_hash_undefined__",r=Object.prototype,i=r.hasOwnProperty;function a(s){var c=this.__data__;if(e){var d=c[s];return d===t?void 0:d}return i.call(c,s)?c[s]:void 0}return pa=a,pa}var ma,Hc;function Y0(){if(Hc)return ma;Hc=1;var e=Ki(),t=Object.prototype,r=t.hasOwnProperty;function i(a){var s=this.__data__;return e?s[a]!==void 0:r.call(s,a)}return ma=i,ma}var ya,Jc;function H0(){if(Jc)return ya;Jc=1;var e=Ki(),t="__lodash_hash_undefined__";function r(i,a){var s=this.__data__;return this.size+=this.has(i)?0:1,s[i]=e&&a===void 0?t:a,this}return ya=r,ya}var ga,Xc;function J0(){if(Xc)return ga;Xc=1;var e=U0(),t=G0(),r=W0(),i=Y0(),a=H0();function s(c){var d=-1,p=c==null?0:c.length;for(this.clear();++d<p;){var m=c[d];this.set(m[0],m[1])}}return s.prototype.clear=e,s.prototype.delete=t,s.prototype.get=r,s.prototype.has=i,s.prototype.set=a,ga=s,ga}var va,Zc;function X0(){if(Zc)return va;Zc=1;function e(){this.__data__=[],this.size=0}return va=e,va}var ba,Qc;function Z0(){if(Qc)return ba;Qc=1;function e(t,r){return t===r||t!==t&&r!==r}return ba=e,ba}var _a,el;function zi(){if(el)return _a;el=1;var e=Z0();function t(r,i){for(var a=r.length;a--;)if(e(r[a][0],i))return a;return-1}return _a=t,_a}var xa,tl;function Q0(){if(tl)return xa;tl=1;var e=zi(),t=Array.prototype,r=t.splice;function i(a){var s=this.__data__,c=e(s,a);if(c<0)return!1;var d=s.length-1;return c==d?s.pop():r.call(s,c,1),--this.size,!0}return xa=i,xa}var Sa,rl;function e_(){if(rl)return Sa;rl=1;var e=zi();function t(r){var i=this.__data__,a=e(i,r);return a<0?void 0:i[a][1]}return Sa=t,Sa}var wa,nl;function t_(){if(nl)return wa;nl=1;var e=zi();function t(r){return e(this.__data__,r)>-1}return wa=t,wa}var Ea,il;function r_(){if(il)return Ea;il=1;var e=zi();function t(r,i){var a=this.__data__,s=e(a,r);return s<0?(++this.size,a.push([r,i])):a[s][1]=i,this}return Ea=t,Ea}var Ta,ol;function n_(){if(ol)return Ta;ol=1;var e=X0(),t=Q0(),r=e_(),i=t_(),a=r_();function s(c){var d=-1,p=c==null?0:c.length;for(this.clear();++d<p;){var m=c[d];this.set(m[0],m[1])}}return s.prototype.clear=e,s.prototype.delete=t,s.prototype.get=r,s.prototype.has=i,s.prototype.set=a,Ta=s,Ta}var Ca,al;function i_(){if(al)return Ca;al=1;var e=Uf(),t=Ts(),r=e(t,"Map");return Ca=r,Ca}var Oa,sl;function o_(){if(sl)return Oa;sl=1;var e=J0(),t=n_(),r=i_();function i(){this.size=0,this.__data__={hash:new e,map:new(r||t),string:new e}}return Oa=i,Oa}var Aa,ul;function a_(){if(ul)return Aa;ul=1;function e(t){var r=typeof t;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?t!=="__proto__":t===null}return Aa=e,Aa}var ja,cl;function Ui(){if(cl)return ja;cl=1;var e=a_();function t(r,i){var a=r.__data__;return e(i)?a[typeof i=="string"?"string":"hash"]:a.map}return ja=t,ja}var $a,ll;function s_(){if(ll)return $a;ll=1;var e=Ui();function t(r){var i=e(this,r).delete(r);return this.size-=i?1:0,i}return $a=t,$a}var ka,fl;function u_(){if(fl)return ka;fl=1;var e=Ui();function t(r){return e(this,r).get(r)}return ka=t,ka}var Pa,dl;function c_(){if(dl)return Pa;dl=1;var e=Ui();function t(r){return e(this,r).has(r)}return Pa=t,Pa}var Ra,hl;function l_(){if(hl)return Ra;hl=1;var e=Ui();function t(r,i){var a=e(this,r),s=a.size;return a.set(r,i),this.size+=a.size==s?0:1,this}return Ra=t,Ra}var Ia,pl;function f_(){if(pl)return Ia;pl=1;var e=o_(),t=s_(),r=u_(),i=c_(),a=l_();function s(c){var d=-1,p=c==null?0:c.length;for(this.clear();++d<p;){var m=c[d];this.set(m[0],m[1])}}return s.prototype.clear=e,s.prototype.delete=t,s.prototype.get=r,s.prototype.has=i,s.prototype.set=a,Ia=s,Ia}var Da,ml;function d_(){if(ml)return Da;ml=1;var e=f_(),t="Expected a function";function r(i,a){if(typeof i!="function"||a!=null&&typeof a!="function")throw new TypeError(t);var s=function(){var c=arguments,d=a?a.apply(this,c):c[0],p=s.cache;if(p.has(d))return p.get(d);var m=i.apply(this,c);return s.cache=p.set(d,m)||p,m};return s.cache=new(r.Cache||e),s}return r.Cache=e,Da=r,Da}var Fa,yl;function h_(){if(yl)return Fa;yl=1;var e=d_(),t=500;function r(i){var a=e(i,function(c){return s.size===t&&s.clear(),c}),s=a.cache;return a}return Fa=r,Fa}var Ma,gl;function p_(){if(gl)return Ma;gl=1;var e=h_(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,i=e(function(a){var s=[];return a.charCodeAt(0)===46&&s.push(""),a.replace(t,function(c,d,p,m){s.push(p?m.replace(r,"$1"):d||c)}),s});return Ma=i,Ma}var Na,vl;function m_(){if(vl)return Na;vl=1;function e(t,r){for(var i=-1,a=t==null?0:t.length,s=Array(a);++i<a;)s[i]=r(t[i],i,t);return s}return Na=e,Na}var Ba,bl;function y_(){if(bl)return Ba;bl=1;var e=Cs(),t=m_(),r=Es(),i=Os(),a=e?e.prototype:void 0,s=a?a.toString:void 0;function c(d){if(typeof d=="string")return d;if(r(d))return t(d,c)+"";if(i(d))return s?s.call(d):"";var p=d+"";return p=="0"&&1/d==-1/0?"-0":p}return Ba=c,Ba}var qa,_l;function g_(){if(_l)return qa;_l=1;var e=y_();function t(r){return r==null?"":e(r)}return qa=t,qa}var La,xl;function v_(){if(xl)return La;xl=1;var e=Es(),t=N0(),r=p_(),i=g_();function a(s,c){return e(s)?s:t(s,c)?[s]:r(i(s))}return La=a,La}var Va,Sl;function b_(){if(Sl)return Va;Sl=1;var e=Os();function t(r){if(typeof r=="string"||e(r))return r;var i=r+"";return i=="0"&&1/r==-1/0?"-0":i}return Va=t,Va}var Ka,wl;function __(){if(wl)return Ka;wl=1;var e=v_(),t=b_();function r(i,a){a=e(a,i);for(var s=0,c=a.length;i!=null&&s<c;)i=i[t(a[s++])];return s&&s==c?i:void 0}return Ka=r,Ka}var za,El;function x_(){if(El)return za;El=1;var e=__();function t(r,i,a){var s=r==null?void 0:e(r,i);return s===void 0?a:s}return za=t,za}var S_=x_();const w_=$n(S_),E_=(e=16)=>{const t={upper:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",lower:"abcdefghijklmnopqrstuvwxyz",numbers:"0123456789",symbols:"!@%^&*()_+[]{}|;:,.<>?"},r=t.upper+t.lower+t.numbers+t.symbols,i=s=>{const c=crypto.getRandomValues(new Uint32Array(1));return s[c[0]%s.length]},a=[i(t.upper),i(t.lower),i(t.numbers),i(t.symbols)];for(let s=4;s<e;s++)a.push(i(r));for(let s=a.length-1;s>0;s--){const d=crypto.getRandomValues(new Uint32Array(1))[0]%(s+1),p=a[s];a[s]=a[d],a[d]=p}return a.join("")},T_=({showPassword:e,onToggleVisibility:t,onGenerate:r})=>k.jsxs(U.InputAdornment,{position:"end",children:[r&&k.jsx(U.Tooltip,{title:"Generate Password",children:k.jsx(U.IconButton,{onClick:r,edge:"end",size:"small",sx:{opacity:.7},"aria-label":"generate password",children:k.jsx(wm,{})})}),k.jsx(U.Tooltip,{title:e?"Hide password":"Show password",children:k.jsx(U.IconButton,{onClick:t,edge:"end",size:"small",sx:{opacity:.7},"aria-label":e?"hide password":"show password",children:e?k.jsx(Pm,{}):k.jsx(km,{})})})]}),C_=({type:e,autoGenerate:t=!1,formik:r,name:i})=>{const[a,s]=Y.useState(!1),c={},d=a?"text":"password";if(e!=="password")return{inputType:e,inputProps:c};const p=()=>{s(!a)},m=()=>{if(!r||!i)return;const x=E_();r.setFieldValue(i,x),a||s(!0)};return c.endAdornment=T_({showPassword:a,onToggleVisibility:p,onGenerate:t?m:void 0}),{inputType:d,inputProps:c}},O_=({helperText:e,errorText:t,formik:r,name:i,defaultValue:a,onChange:s,type:c,fullWidth:d=!0,autoGenerate:p=!1,...m})=>{var R;const x=C_({type:c,autoGenerate:p,formik:r,name:i});let b={};const S=m.value??a;if(Y.useEffect(()=>{!r||!i||S===void 0||r.setFieldValue(i,S)},[S]),i&&r){r.touched[i]&&(t??(t=r.errors[i]));let P=w_(r.values,i,"");c==="date"&&(P=A_(P)),b={value:P??"",onBlur:()=>r.setFieldTouched(i),onChange:_=>{let L=_.target.value;c==="date"&&L&&(L=new Date(L)),r.setFieldValue(i,L||null),s==null||s(_)},slotProps:{...m.slotProps,input:{...m.InputProps,...(R=m.slotProps)==null?void 0:R.input,...x.inputProps},inputLabel:c==="date"?{shrink:!0}:void 0}}}return k.jsx(U.TextField,{variant:"standard",onChange:s,...m,...b,name:i,type:x.inputType,fullWidth:d,helperText:t||e,error:!!t})},A_=e=>{if(!e)return"";const t=new Date(e),r=t.getFullYear(),i=String(t.getMonth()+1).padStart(2,"0"),a=String(t.getDate()).padStart(2,"0");return`${r}-${i}-${a}`},j_=({multiple:e=!1,formik:t,name:r,label:i="Search users",disabled:a=!1,error:s,helperText:c,value:d,onChange:p})=>{const[m,x]=Y.useState(!1),[b,S]=Y.useState([]),[R,P]=Y.useState(!1),[_,L]=Y.useState(""),M=Y.useCallback(async ie=>{if(ie.length<2){S([]);return}P(!0);try{const Ge=await Pt().searchUsers({name:ie});S(Ge)}catch(ye){console.error("Failed to search users:",ye),S([])}finally{P(!1)}},[]),H=Y.useCallback((ie,ye)=>{L(ye),M(ye)},[M]),G=()=>d!==void 0?d:t&&r?t.values[r]:e?[]:null,W=(ie,ye)=>{p?p(ye):t&&r&&t.setFieldValue(r,ye)},A=()=>{t&&r&&t.setFieldTouched(r)},q=()=>{if(s)return" ";if(t&&r&&t.touched[r]&&t.errors[r])return t.errors[r]},X=G();return k.jsx(U.Autocomplete,{open:m,onOpen:()=>x(!0),onClose:()=>x(!1),multiple:e,options:b,value:X,onChange:W,onBlur:A,onInputChange:H,getOptionLabel:ie=>ie.name,isOptionEqualToValue:(ie,ye)=>ie.id===ye.id,loading:R,noOptionsText:_.length<3?"Type at least 3 characters to search":"No users found",renderOption:(ie,ye)=>Y.createElement(U.Box,{component:"li",...ie,key:ye.id},k.jsxs(U.Box,{children:[k.jsx(U.Typography,{variant:"body1",children:ye.name}),k.jsx(U.Typography,{variant:"body2",color:"text.secondary",children:ye.email})]})),renderInput:ie=>k.jsx(U.TextField,{...ie,label:i,disabled:a,error:!!q(),helperText:q()||c,InputProps:{...ie.InputProps,endAdornment:k.jsxs(k.Fragment,{children:[R?k.jsx(U.CircularProgress,{size:20}):null,ie.InputProps.endAdornment]})}})})},$_=Lf({name:Nf().trim().required("Group name is required").min(2,"Group name must be at least 2 characters").max(100,"Group name must be at most 100 characters")}),Gf=({open:e,onClose:t,onSuccess:r,orgId:i})=>{const[a,s]=Y.useState(null),c=zb({initialValues:{name:"",read_only:!1,members:[]},validationSchema:$_,onSubmit:async(b,{setSubmitting:S,resetForm:R})=>{s(null);try{const P=Pt(),_=await P.createGroup(i,{name:b.name.trim(),read_only:b.read_only});b.members&&b.members.length>0&&await P.addGroupMembers(i,_.id,b.members.map(L=>({user:L.userId,role:L.role}))),R(),r==null||r(),t()}catch(P){s(gi(P,"Failed to create group"))}S(!1)}}),d=b=>{const S=Array.isArray(b)?b:[];c.setFieldValue("members",S.map(R=>({userId:R.id,role:"member",user:R})))},p=(b,S)=>{const R=c.values.members.map(P=>P.userId===b?{...P,role:S}:P);c.setFieldValue("members",R)},m=b=>{const S=c.values.members.filter(R=>R.userId!==b);c.setFieldValue("members",S)},x=()=>{c.resetForm(),t()};return k.jsxs(U.Dialog,{open:e,onClose:x,maxWidth:"sm",fullWidth:!0,PaperProps:{component:"form",onSubmit:c.handleSubmit},children:[k.jsx(U.DialogTitle,{children:"Create New Group"}),k.jsx(U.DialogContent,{children:k.jsxs(U.Box,{sx:{display:"flex",flexDirection:"column",gap:2,pt:1},children:[a&&k.jsx(U.Alert,{severity:"error",onClose:()=>s(null),children:a.message}),k.jsx(O_,{label:"Group Name",name:"name",formik:c,required:!0,disabled:c.isSubmitting,placeholder:"e.g., Computer Science 101"}),k.jsx(U.FormControlLabel,{control:k.jsx(U.Switch,{name:"read_only",checked:c.values.read_only,onChange:c.handleChange,disabled:c.isSubmitting}),label:"Read-only group (only moderators can post)"}),k.jsx(U.Divider,{sx:{my:2}}),k.jsx(U.Typography,{color:"warning.main",fontWeight:500,children:"You cannot add members later. Only admins can join a group after it is created"}),k.jsxs(U.Box,{children:[k.jsx(U.Typography,{variant:"subtitle2",gutterBottom:!0,children:"Add Members"}),k.jsx(j_,{multiple:!0,label:"Search users to add",value:c.values.members.map(b=>b.user),onChange:d,disabled:c.isSubmitting})]}),c.values.members.length>0&&k.jsxs(k.Fragment,{children:[k.jsx(U.Typography,{variant:"subtitle2",gutterBottom:!0,children:"Selected Members"}),c.values.members.map(b=>k.jsxs(U.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",borderRadius:1},children:[k.jsx(U.Box,{sx:{flex:1},children:b.user.name}),k.jsxs(U.Select,{value:b.role,onChange:S=>p(b.userId,S.target.value),size:"small",disabled:c.isSubmitting,sx:{mr:2},children:[k.jsx(U.MenuItem,{value:"member",children:"Member"}),k.jsx(U.MenuItem,{value:"moderator",children:"Moderator"})]}),k.jsx(U.IconButton,{size:"small",onClick:()=>m(b.userId),disabled:c.isSubmitting,color:"error",children:k.jsx(Em,{})})]},b.userId))]})]})}),k.jsxs(U.DialogActions,{sx:{p:3},children:[k.jsx(U.Button,{onClick:x,disabled:c.isSubmitting,children:"Cancel"}),k.jsx(U.Button,{type:"submit",variant:"contained",disabled:c.isSubmitting||!c.isValid,startIcon:c.isSubmitting&&k.jsx(U.CircularProgress,{size:16}),children:"Create Group"})]})]})};var yi={exports:{}},k_=yi.exports,Tl;function P_(){return Tl||(Tl=1,(function(e,t){((r,i)=>{e.exports=i()})(k_,function(){var r=function(n,o){return(r=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(u,l){u.__proto__=l}:function(u,l){for(var f in l)Object.prototype.hasOwnProperty.call(l,f)&&(u[f]=l[f])}))(n,o)},i=function(){return(i=Object.assign||function(n){for(var o,u=1,l=arguments.length;u<l;u++)for(var f in o=arguments[u])Object.prototype.hasOwnProperty.call(o,f)&&(n[f]=o[f]);return n}).apply(this,arguments)};function a(n,o,u){for(var l,f=0,h=o.length;f<h;f++)!l&&f in o||((l=l||Array.prototype.slice.call(o,0,f))[f]=o[f]);return n.concat(l||Array.prototype.slice.call(o))}var s=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:bn,c=Object.keys,d=Array.isArray;function p(n,o){return typeof o=="object"&&c(o).forEach(function(u){n[u]=o[u]}),n}typeof Promise>"u"||s.Promise||(s.Promise=Promise);var m=Object.getPrototypeOf,x={}.hasOwnProperty;function b(n,o){return x.call(n,o)}function S(n,o){typeof o=="function"&&(o=o(m(n))),(typeof Reflect>"u"?c:Reflect.ownKeys)(o).forEach(function(u){P(n,u,o[u])})}var R=Object.defineProperty;function P(n,o,u,l){R(n,o,p(u&&b(u,"get")&&typeof u.get=="function"?{get:u.get,set:u.set,configurable:!0}:{value:u,configurable:!0,writable:!0},l))}function _(n){return{from:function(o){return n.prototype=Object.create(o.prototype),P(n.prototype,"constructor",n),{extend:S.bind(null,n.prototype)}}}}var L=Object.getOwnPropertyDescriptor,M=[].slice;function H(n,o,u){return M.call(n,o,u)}function G(n,o){return o(n)}function W(n){if(!n)throw new Error("Assertion Failed")}function A(n){s.setImmediate?setImmediate(n):setTimeout(n,0)}function q(n,o){if(typeof o=="string"&&b(n,o))return n[o];if(!o)return n;if(typeof o!="string"){for(var u=[],l=0,f=o.length;l<f;++l){var h=q(n,o[l]);u.push(h)}return u}var y,g=o.indexOf(".");return g===-1||(y=n[o.substr(0,g)])==null?void 0:q(y,o.substr(g+1))}function X(n,o,u){if(n&&o!==void 0&&!("isFrozen"in Object&&Object.isFrozen(n)))if(typeof o!="string"&&"length"in o){W(typeof u!="string"&&"length"in u);for(var l=0,f=o.length;l<f;++l)X(n,o[l],u[l])}else{var h,y,g=o.indexOf(".");g!==-1?(h=o.substr(0,g),(g=o.substr(g+1))===""?u===void 0?d(n)&&!isNaN(parseInt(h))?n.splice(h,1):delete n[h]:n[h]=u:X(y=(y=n[h])&&b(n,h)?y:n[h]={},g,u)):u===void 0?d(n)&&!isNaN(parseInt(o))?n.splice(o,1):delete n[o]:n[o]=u}}function ie(n){var o,u={};for(o in n)b(n,o)&&(u[o]=n[o]);return u}var ye=[].concat;function Ge(n){return ye.apply([],n)}var be="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(Ge([8,16,32,64].map(function(n){return["Int","Uint","Float"].map(function(o){return o+n+"Array"})}))).filter(function(n){return s[n]}),ve=new Set(be.map(function(n){return s[n]})),v=null;function ee(n){return v=new WeakMap,n=(function o(u){if(!u||typeof u!="object")return u;var l=v.get(u);if(l)return l;if(d(u)){l=[],v.set(u,l);for(var f=0,h=u.length;f<h;++f)l.push(o(u[f]))}else if(ve.has(u.constructor))l=u;else{var y,g=m(u);for(y in l=g===Object.prototype?{}:Object.create(g),v.set(u,l),u)b(u,y)&&(l[y]=o(u[y]))}return l})(n),v=null,n}var te={}.toString;function ge(n){return te.call(n).slice(8,-1)}var Te=typeof Symbol<"u"?Symbol.iterator:"@@iterator",We=typeof Te=="symbol"?function(n){var o;return n!=null&&(o=n[Te])&&o.apply(n)}:function(){return null};function Ke(n,o){o=n.indexOf(o),0<=o&&n.splice(o,1)}var lt={};function J(n){var o,u,l,f;if(arguments.length===1){if(d(n))return n.slice();if(this===lt&&typeof n=="string")return[n];if(f=We(n))for(u=[];!(l=f.next()).done;)u.push(l.value);else{if(n==null)return[n];if(typeof(o=n.length)!="number")return[n];for(u=new Array(o);o--;)u[o]=n[o]}}else for(o=arguments.length,u=new Array(o);o--;)u[o]=arguments[o];return u}var ce=typeof Symbol<"u"?function(n){return n[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},be=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],_e=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(be),Oe={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function xe(n,o){this.name=n,this.message=o}function Ce(n,o){return n+". Errors: "+Object.keys(o).map(function(u){return o[u].toString()}).filter(function(u,l,f){return f.indexOf(u)===l}).join(`
94
+ `)}function Ee(n,o,u,l){this.failures=o,this.failedKeys=l,this.successCount=u,this.message=Ce(n,o)}function we(n,o){this.name="BulkError",this.failures=Object.keys(o).map(function(u){return o[u]}),this.failuresByPos=o,this.message=Ce(n,this.failures)}_(xe).from(Error).extend({toString:function(){return this.name+": "+this.message}}),_(Ee).from(xe),_(we).from(xe);var Ae=_e.reduce(function(n,o){return n[o]=o+"Error",n},{}),ke=xe,re=_e.reduce(function(n,o){var u=o+"Error";function l(f,h){this.name=u,f?typeof f=="string"?(this.message="".concat(f).concat(h?`
95
+ `+h:""),this.inner=h||null):typeof f=="object"&&(this.message="".concat(f.name," ").concat(f.message),this.inner=f):(this.message=Oe[o]||u,this.inner=null)}return _(l).from(ke),n[o]=l,n},{}),Qe=(re.Syntax=SyntaxError,re.Type=TypeError,re.Range=RangeError,be.reduce(function(n,o){return n[o+"Error"]=re[o],n},{}));be=_e.reduce(function(n,o){return["Syntax","Type","Range"].indexOf(o)===-1&&(n[o+"Error"]=re[o]),n},{});function N(){}function et(n){return n}function xt(n,o){return n==null||n===et?o:function(u){return o(n(u))}}function gt(n,o){return function(){n.apply(this,arguments),o.apply(this,arguments)}}function Wi(n,o){return n===N?o:function(){var u=n.apply(this,arguments),l=(u!==void 0&&(arguments[0]=u),this.onsuccess),f=this.onerror,h=(this.onsuccess=null,this.onerror=null,o.apply(this,arguments));return l&&(this.onsuccess=this.onsuccess?gt(l,this.onsuccess):l),f&&(this.onerror=this.onerror?gt(f,this.onerror):f),h!==void 0?h:u}}function Yi(n,o){return n===N?o:function(){n.apply(this,arguments);var u=this.onsuccess,l=this.onerror;this.onsuccess=this.onerror=null,o.apply(this,arguments),u&&(this.onsuccess=this.onsuccess?gt(u,this.onsuccess):u),l&&(this.onerror=this.onerror?gt(l,this.onerror):l)}}function Hi(n,o){return n===N?o:function(f){var l=n.apply(this,arguments),f=(p(f,l),this.onsuccess),h=this.onerror,y=(this.onsuccess=null,this.onerror=null,o.apply(this,arguments));return f&&(this.onsuccess=this.onsuccess?gt(f,this.onsuccess):f),h&&(this.onerror=this.onerror?gt(h,this.onerror):h),l===void 0?y===void 0?void 0:y:p(l,y)}}function on(n,o){return n===N?o:function(){return o.apply(this,arguments)!==!1&&n.apply(this,arguments)}}function an(n,o){return n===N?o:function(){var u=n.apply(this,arguments);if(u&&typeof u.then=="function"){for(var l=this,f=arguments.length,h=new Array(f);f--;)h[f]=arguments[f];return u.then(function(){return o.apply(l,h)})}return o.apply(this,arguments)}}be.ModifyError=Ee,be.DexieError=xe,be.BulkError=we;var Tt=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function V(n){Tt=n}var se={},he=100,pe=typeof Promise>"u"?[]:(_e=Promise.resolve(),typeof crypto<"u"&&crypto.subtle?[pe=crypto.subtle.digest("SHA-512",new Uint8Array([0])),m(pe),_e]:[_e,m(_e),_e]),_e=pe[0],Kr=pe[1],Kr=Kr&&Kr.then,je=_e&&_e.constructor,rt=!!pe[2],pt=function(n,o){sn.push([n,o]),Ht&&(queueMicrotask(cd),Ht=!1)},cr=!0,Ht=!0,qt=[],Ir=[],Dr=et,Rt={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:N,pgp:!1,env:{},finalize:N},me=Rt,sn=[],lr=0,Dn=[];function ue(n){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var o=this._PSD=me;if(typeof n!="function"){if(n!==se)throw new TypeError("Not a function");this._state=arguments[1],this._value=arguments[2],this._state===!1&&Xi(this,this._value)}else this._state=null,this._value=null,++o.ref,(function u(l,f){try{f(function(h){if(l._state===null){if(h===l)throw new TypeError("A promise cannot be resolved with itself.");var y=l._lib&&Fr();h&&typeof h.then=="function"?u(l,function(g,T){h instanceof ue?h._then(g,T):h.then(g,T)}):(l._state=!0,l._value=h,$s(l)),y&&Mr()}},Xi.bind(null,l))}catch(h){Xi(l,h)}})(this,n)}var Ji={get:function(){var n=me,o=Bn;function u(l,f){var h=this,y=!n.global&&(n!==me||o!==Bn),g=y&&!Xt(),T=new ue(function(D,C){Zi(h,new js(Ps(l,n,y,g),Ps(f,n,y,g),D,C,n))});return this._consoleTask&&(T._consoleTask=this._consoleTask),T}return u.prototype=se,u},set:function(n){P(this,"then",n&&n.prototype===se?Ji:{get:function(){return n},set:Ji.set})}};function js(n,o,u,l,f){this.onFulfilled=typeof n=="function"?n:null,this.onRejected=typeof o=="function"?o:null,this.resolve=u,this.reject=l,this.psd=f}function Xi(n,o){var u,l;Ir.push(o),n._state===null&&(u=n._lib&&Fr(),o=Dr(o),n._state=!1,n._value=o,l=n,qt.some(function(f){return f._value===l._value})||qt.push(l),$s(n),u)&&Mr()}function $s(n){var o=n._listeners;n._listeners=[];for(var u=0,l=o.length;u<l;++u)Zi(n,o[u]);var f=n._PSD;--f.ref||f.finalize(),lr===0&&(++lr,pt(function(){--lr==0&&Qi()},[]))}function Zi(n,o){if(n._state===null)n._listeners.push(o);else{var u=n._state?o.onFulfilled:o.onRejected;if(u===null)return(n._state?o.resolve:o.reject)(n._value);++o.psd.ref,++lr,pt(ud,[u,n,o])}}function ud(n,o,u){try{var l,f=o._value;!o._state&&Ir.length&&(Ir=[]),l=Tt&&o._consoleTask?o._consoleTask.run(function(){return n(f)}):n(f),o._state||Ir.indexOf(f)!==-1||(h=>{for(var y=qt.length;y;)if(qt[--y]._value===h._value)return qt.splice(y,1)})(o),u.resolve(l)}catch(h){u.reject(h)}finally{--lr==0&&Qi(),--u.psd.ref||u.psd.finalize()}}function cd(){fr(Rt,function(){Fr()&&Mr()})}function Fr(){var n=cr;return Ht=cr=!1,n}function Mr(){var n,o,u;do for(;0<sn.length;)for(n=sn,sn=[],u=n.length,o=0;o<u;++o){var l=n[o];l[0].apply(null,l[1])}while(0<sn.length);Ht=cr=!0}function Qi(){for(var n=qt,o=(qt=[],n.forEach(function(l){l._PSD.onunhandled.call(null,l._value,l)}),Dn.slice(0)),u=o.length;u;)o[--u]()}function Fn(n){return new ue(se,!1,n)}function Xe(n,o){var u=me;return function(){var l=Fr(),f=me;try{return Zt(u,!0),n.apply(this,arguments)}catch(h){o&&o(h)}finally{Zt(f,!1),l&&Mr()}}}S(ue.prototype,{then:Ji,_then:function(n,o){Zi(this,new js(null,null,n,o,me))},catch:function(n){var o,u;return arguments.length===1?this.then(null,n):(o=n,u=arguments[1],typeof o=="function"?this.then(null,function(l){return(l instanceof o?u:Fn)(l)}):this.then(null,function(l){return(l&&l.name===o?u:Fn)(l)}))},finally:function(n){return this.then(function(o){return ue.resolve(n()).then(function(){return o})},function(o){return ue.resolve(n()).then(function(){return Fn(o)})})},timeout:function(n,o){var u=this;return n<1/0?new ue(function(l,f){var h=setTimeout(function(){return f(new re.Timeout(o))},n);u.then(l,f).finally(clearTimeout.bind(null,h))}):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&P(ue.prototype,Symbol.toStringTag,"Dexie.Promise"),Rt.env=ks(),S(ue,{all:function(){var n=J.apply(null,arguments).map(qn);return new ue(function(o,u){n.length===0&&o([]);var l=n.length;n.forEach(function(f,h){return ue.resolve(f).then(function(y){n[h]=y,--l||o(n)},u)})})},resolve:function(n){return n instanceof ue?n:n&&typeof n.then=="function"?new ue(function(o,u){n.then(o,u)}):new ue(se,!0,n)},reject:Fn,race:function(){var n=J.apply(null,arguments).map(qn);return new ue(function(o,u){n.map(function(l){return ue.resolve(l).then(o,u)})})},PSD:{get:function(){return me},set:function(n){return me=n}},totalEchoes:{get:function(){return Bn}},newPSD:Jt,usePSD:fr,scheduler:{get:function(){return pt},set:function(n){pt=n}},rejectionMapper:{get:function(){return Dr},set:function(n){Dr=n}},follow:function(n,o){return new ue(function(u,l){return Jt(function(f,h){var y=me;y.unhandleds=[],y.onunhandled=h,y.finalize=gt(function(){var g,T=this;g=function(){T.unhandleds.length===0?f():h(T.unhandleds[0])},Dn.push(function D(){g(),Dn.splice(Dn.indexOf(D),1)}),++lr,pt(function(){--lr==0&&Qi()},[])},y.finalize),n()},o,u,l)})}}),je&&(je.allSettled&&P(ue,"allSettled",function(){var n=J.apply(null,arguments).map(qn);return new ue(function(o){n.length===0&&o([]);var u=n.length,l=new Array(u);n.forEach(function(f,h){return ue.resolve(f).then(function(y){return l[h]={status:"fulfilled",value:y}},function(y){return l[h]={status:"rejected",reason:y}}).then(function(){return--u||o(l)})})})}),je.any&&typeof AggregateError<"u"&&P(ue,"any",function(){var n=J.apply(null,arguments).map(qn);return new ue(function(o,u){n.length===0&&u(new AggregateError([]));var l=n.length,f=new Array(l);n.forEach(function(h,y){return ue.resolve(h).then(function(g){return o(g)},function(g){f[y]=g,--l||u(new AggregateError(f))})})})}),je.withResolvers)&&(ue.withResolvers=je.withResolvers);var ft={awaits:0,echoes:0,id:0},ld=0,Mn=[],Nn=0,Bn=0,fd=0;function Jt(n,y,u,l){var f=me,h=Object.create(f),y=(h.parent=f,h.ref=0,h.global=!1,h.id=++fd,Rt.env,h.env=rt?{Promise:ue,PromiseProp:{value:ue,configurable:!0,writable:!0},all:ue.all,race:ue.race,allSettled:ue.allSettled,any:ue.any,resolve:ue.resolve,reject:ue.reject}:{},y&&p(h,y),++f.ref,h.finalize=function(){--this.parent.ref||this.parent.finalize()},fr(h,n,u,l));return h.ref===0&&h.finalize(),y}function Nr(){return ft.id||(ft.id=++ld),++ft.awaits,ft.echoes+=he,ft.id}function Xt(){return!!ft.awaits&&(--ft.awaits==0&&(ft.id=0),ft.echoes=ft.awaits*he,!0)}function qn(n){return ft.echoes&&n&&n.constructor===je?(Nr(),n.then(function(o){return Xt(),o},function(o){return Xt(),at(o)})):n}function dd(){var n=Mn[Mn.length-1];Mn.pop(),Zt(n,!1)}function Zt(n,o){var u,l,f=me;(o?!ft.echoes||Nn++&&n===me:!Nn||--Nn&&n===me)||queueMicrotask(o?(function(h){++Bn,ft.echoes&&--ft.echoes!=0||(ft.echoes=ft.awaits=ft.id=0),Mn.push(me),Zt(h,!0)}).bind(null,n):dd),n!==me&&(me=n,f===Rt&&(Rt.env=ks()),rt)&&(u=Rt.env.Promise,l=n.env,f.global||n.global)&&(Object.defineProperty(s,"Promise",l.PromiseProp),u.all=l.all,u.race=l.race,u.resolve=l.resolve,u.reject=l.reject,l.allSettled&&(u.allSettled=l.allSettled),l.any)&&(u.any=l.any)}function ks(){var n=s.Promise;return rt?{Promise:n,PromiseProp:Object.getOwnPropertyDescriptor(s,"Promise"),all:n.all,race:n.race,allSettled:n.allSettled,any:n.any,resolve:n.resolve,reject:n.reject}:{}}function fr(n,o,u,l,f){var h=me;try{return Zt(n,!0),o(u,l,f)}finally{Zt(h,!1)}}function Ps(n,o,u,l){return typeof n!="function"?n:function(){var f=me;u&&Nr(),Zt(o,!0);try{return n.apply(this,arguments)}finally{Zt(f,!1),l&&queueMicrotask(Xt)}}}function eo(n){Promise===je&&ft.echoes===0?Nn===0?n():enqueueNativeMicroTask(n):setTimeout(n,0)}(""+Kr).indexOf("[native code]")===-1&&(Nr=Xt=N);var at=ue.reject,dr="￿",Lt="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",Rs="String expected.",Br=[],Ln="__dbnames",to="readonly",ro="readwrite";function hr(n,o){return n?o?function(){return n.apply(this,arguments)&&o.apply(this,arguments)}:n:o}var Is={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function Vn(n){return typeof n!="string"||/\./.test(n)?function(o){return o}:function(o){return o[n]===void 0&&n in o&&delete(o=ee(o))[n],o}}function Ds(){throw re.Type("Entity instances must never be new:ed. Instances are generated by the framework bypassing the constructor.")}function Pe(n,o){try{var u=Fs(n),l=Fs(o);if(u!==l)return u==="Array"?1:l==="Array"?-1:u==="binary"?1:l==="binary"?-1:u==="string"?1:l==="string"?-1:u==="Date"?1:l!=="Date"?NaN:-1;switch(u){case"number":case"Date":case"string":return o<n?1:n<o?-1:0;case"binary":for(var f=Ms(n),h=Ms(o),y=f.length,g=h.length,T=y<g?y:g,D=0;D<T;++D)if(f[D]!==h[D])return f[D]<h[D]?-1:1;return y===g?0:y<g?-1:1;case"Array":for(var C=n,w=o,j=C.length,$=w.length,O=j<$?j:$,E=0;E<O;++E){var F=Pe(C[E],w[E]);if(F!==0)return F}return j===$?0:j<$?-1:1}}catch{}return NaN}function Fs(n){var o=typeof n;return o=="object"&&(ArrayBuffer.isView(n)||(o=ge(n))==="ArrayBuffer")?"binary":o}function Ms(n){return n instanceof Uint8Array?n:ArrayBuffer.isView(n)?new Uint8Array(n.buffer,n.byteOffset,n.byteLength):new Uint8Array(n)}function Kn(n,o,u){var l=n.schema.yProps;return l?(o&&0<u.numFailures&&(o=o.filter(function(f,h){return!u.failures[h]})),Promise.all(l.map(function(f){return f=f.updatesTable,o?n.db.table(f).where("k").anyOf(o).delete():n.db.table(f).clear()})).then(function(){return u})):u}Ns.prototype.execute=function(n){var o=this["@@propmod"];if(o.add!==void 0){var u=o.add;if(d(u))return a(a([],d(n)?n:[],!0),u).sort();if(typeof u=="number")return(Number(n)||0)+u;if(typeof u=="bigint")try{return BigInt(n)+u}catch{return BigInt(0)+u}throw new TypeError("Invalid term ".concat(u))}if(o.remove!==void 0){var l=o.remove;if(d(l))return d(n)?n.filter(function(f){return!l.includes(f)}).sort():[];if(typeof l=="number")return Number(n)-l;if(typeof l=="bigint")try{return BigInt(n)-l}catch{return BigInt(0)-l}throw new TypeError("Invalid subtrahend ".concat(l))}return u=(u=o.replacePrefix)==null?void 0:u[0],u&&typeof n=="string"&&n.startsWith(u)?o.replacePrefix[1]+n.substring(u.length):n};var un=Ns;function Ns(n){this["@@propmod"]=n}function Bs(n,o){for(var u=c(o),l=u.length,f=!1,h=0;h<l;++h){var y=u[h],g=o[y],T=q(n,y);g instanceof un?(X(n,y,g.execute(T)),f=!0):T!==g&&(X(n,y,g),f=!0)}return f}Ye.prototype._trans=function(n,o,u){var l=this._tx||me.trans,f=this.name,h=Tt&&typeof console<"u"&&console.createTask&&console.createTask("Dexie: ".concat(n==="readonly"?"read":"write"," ").concat(this.name));function y(D,C,w){if(w.schema[f])return o(w.idbtrans,w);throw new re.NotFound("Table "+f+" not part of transaction")}var g=Fr();try{var T=l&&l.db._novip===this.db._novip?l===me.trans?l._promise(n,y,u):Jt(function(){return l._promise(n,y,u)},{trans:l,transless:me.transless||me}):(function D(C,w,j,$){if(C.idbdb&&(C._state.openComplete||me.letThrough||C._vip)){var O=C._createTransaction(w,j,C._dbSchema);try{O.create(),C._state.PR1398_maxLoop=3}catch(E){return E.name===Ae.InvalidState&&C.isOpen()&&0<--C._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),C.close({disableAutoOpen:!1}),C.open().then(function(){return D(C,w,j,$)})):at(E)}return O._promise(w,function(E,F){return Jt(function(){return me.trans=O,$(E,F,O)})}).then(function(E){if(w==="readwrite")try{O.idbtrans.commit()}catch{}return w==="readonly"?E:O._completion.then(function(){return E})})}if(C._state.openComplete)return at(new re.DatabaseClosed(C._state.dbOpenError));if(!C._state.isBeingOpened){if(!C._state.autoOpen)return at(new re.DatabaseClosed);C.open().catch(N)}return C._state.dbReadyPromise.then(function(){return D(C,w,j,$)})})(this.db,n,[this.name],y);return h&&(T._consoleTask=h,T=T.catch(function(D){return console.trace(D),at(D)})),T}finally{g&&Mr()}},Ye.prototype.get=function(n,o){var u=this;return n&&n.constructor===Object?this.where(n).first(o):n==null?at(new re.Type("Invalid argument to Table.get()")):this._trans("readonly",function(l){return u.core.get({trans:l,key:n}).then(function(f){return u.hook.reading.fire(f)})}).then(o)},Ye.prototype.where=function(n){if(typeof n=="string")return new this.db.WhereClause(this,n);if(d(n))return new this.db.WhereClause(this,"[".concat(n.join("+"),"]"));var o=c(n);if(o.length===1)return this.where(o[0]).equals(n[o[0]]);var u=this.schema.indexes.concat(this.schema.primKey).filter(function(g){if(g.compound&&o.every(function(D){return 0<=g.keyPath.indexOf(D)})){for(var T=0;T<o.length;++T)if(o.indexOf(g.keyPath[T])===-1)return!1;return!0}return!1}).sort(function(g,T){return g.keyPath.length-T.keyPath.length})[0];if(u&&this.db._maxKey!==dr)return y=u.keyPath.slice(0,o.length),this.where(y).equals(y.map(function(g){return n[g]}));!u&&Tt&&console.warn("The query ".concat(JSON.stringify(n)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(o.join("+"),"]"));var l=this.schema.idxByName;function f(g,T){return Pe(g,T)===0}var y=o.reduce(function(C,T){var D=C[0],C=C[1],w=l[T],j=n[T];return[D||w,D||!w?hr(C,w&&w.multi?function($){return $=q($,T),d($)&&$.some(function(O){return f(j,O)})}:function($){return f(j,q($,T))}):C]},[null,null]),h=y[0],y=y[1];return h?this.where(h.name).equals(n[h.keyPath]).filter(y):u?this.filter(y):this.where(o).equals("")},Ye.prototype.filter=function(n){return this.toCollection().and(n)},Ye.prototype.count=function(n){return this.toCollection().count(n)},Ye.prototype.offset=function(n){return this.toCollection().offset(n)},Ye.prototype.limit=function(n){return this.toCollection().limit(n)},Ye.prototype.each=function(n){return this.toCollection().each(n)},Ye.prototype.toArray=function(n){return this.toCollection().toArray(n)},Ye.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},Ye.prototype.orderBy=function(n){return new this.db.Collection(new this.db.WhereClause(this,d(n)?"[".concat(n.join("+"),"]"):n))},Ye.prototype.reverse=function(){return this.toCollection().reverse()},Ye.prototype.mapToClass=function(n){for(var o=this.db,u=this.name,l=((this.schema.mappedClass=n).prototype instanceof Ds&&(n=(y=>{var g=C,T=y;if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");function D(){this.constructor=g}function C(){return y!==null&&y.apply(this,arguments)||this}return r(g,T),g.prototype=T===null?Object.create(T):(D.prototype=T.prototype,new D),Object.defineProperty(C.prototype,"db",{get:function(){return o},enumerable:!1,configurable:!0}),C.prototype.table=function(){return u},C})(n)),new Set),f=n.prototype;f;f=m(f))Object.getOwnPropertyNames(f).forEach(function(y){return l.add(y)});function h(y){if(!y)return y;var g,T=Object.create(n.prototype);for(g in y)if(!l.has(g))try{T[g]=y[g]}catch{}return T}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=h,this.hook("reading",h),n},Ye.prototype.defineClass=function(){return this.mapToClass(function(n){p(this,n)})},Ye.prototype.add=function(n,o){var u=this,l=this.schema.primKey,f=l.auto,h=l.keyPath,y=n;return h&&f&&(y=Vn(h)(n)),this._trans("readwrite",function(g){return u.core.mutate({trans:g,type:"add",keys:o!=null?[o]:null,values:[y]})}).then(function(g){return g.numFailures?ue.reject(g.failures[0]):g.lastResult}).then(function(g){if(h)try{X(n,h,g)}catch{}return g})},Ye.prototype.upsert=function(n,o){var u=this,l=this.schema.primKey.keyPath;return this._trans("readwrite",function(f){return u.core.get({trans:f,key:n}).then(function(h){var y=h??{};return Bs(y,o),l&&X(y,l,n),u.core.mutate({trans:f,type:"put",values:[y],keys:[n],upsert:!0,updates:{keys:[n],changeSpecs:[o]}}).then(function(g){return g.numFailures?ue.reject(g.failures[0]):!!h})})})},Ye.prototype.update=function(n,o){return typeof n!="object"||d(n)?this.where(":id").equals(n).modify(o):(n=q(n,this.schema.primKey.keyPath))===void 0?at(new re.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(n).modify(o)},Ye.prototype.put=function(n,o){var u=this,l=this.schema.primKey,f=l.auto,h=l.keyPath,y=n;return h&&f&&(y=Vn(h)(n)),this._trans("readwrite",function(g){return u.core.mutate({trans:g,type:"put",values:[y],keys:o!=null?[o]:null})}).then(function(g){return g.numFailures?ue.reject(g.failures[0]):g.lastResult}).then(function(g){if(h)try{X(n,h,g)}catch{}return g})},Ye.prototype.delete=function(n){var o=this;return this._trans("readwrite",function(u){return o.core.mutate({trans:u,type:"delete",keys:[n]}).then(function(l){return Kn(o,[n],l)}).then(function(l){return l.numFailures?ue.reject(l.failures[0]):void 0})})},Ye.prototype.clear=function(){var n=this;return this._trans("readwrite",function(o){return n.core.mutate({trans:o,type:"deleteRange",range:Is}).then(function(u){return Kn(n,null,u)})}).then(function(o){return o.numFailures?ue.reject(o.failures[0]):void 0})},Ye.prototype.bulkGet=function(n){var o=this;return this._trans("readonly",function(u){return o.core.getMany({keys:n,trans:u}).then(function(l){return l.map(function(f){return o.hook.reading.fire(f)})})})},Ye.prototype.bulkAdd=function(n,o,u){var l=this,f=Array.isArray(o)?o:void 0,h=(u=u||(f?void 0:o))?u.allKeys:void 0;return this._trans("readwrite",function(y){var g=l.schema.primKey,D=g.auto,g=g.keyPath;if(g&&f)throw new re.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(f&&f.length!==n.length)throw new re.InvalidArgument("Arguments objects and keys must have the same length");var T=n.length,D=g&&D?n.map(Vn(g)):n;return l.core.mutate({trans:y,type:"add",keys:f,values:D,wantResults:h}).then(function(C){var w=C.numFailures,j=C.failures;if(w===0)return h?C.results:C.lastResult;throw new we("".concat(l.name,".bulkAdd(): ").concat(w," of ").concat(T," operations failed"),j)})})},Ye.prototype.bulkPut=function(n,o,u){var l=this,f=Array.isArray(o)?o:void 0,h=(u=u||(f?void 0:o))?u.allKeys:void 0;return this._trans("readwrite",function(y){var g=l.schema.primKey,D=g.auto,g=g.keyPath;if(g&&f)throw new re.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(f&&f.length!==n.length)throw new re.InvalidArgument("Arguments objects and keys must have the same length");var T=n.length,D=g&&D?n.map(Vn(g)):n;return l.core.mutate({trans:y,type:"put",keys:f,values:D,wantResults:h}).then(function(C){var w=C.numFailures,j=C.failures;if(w===0)return h?C.results:C.lastResult;throw new we("".concat(l.name,".bulkPut(): ").concat(w," of ").concat(T," operations failed"),j)})})},Ye.prototype.bulkUpdate=function(n){var o=this,u=this.core,l=n.map(function(y){return y.key}),f=n.map(function(y){return y.changes}),h=[];return this._trans("readwrite",function(y){return u.getMany({trans:y,keys:l,cache:"clone"}).then(function(g){var T=[],D=[],C=(n.forEach(function(w,j){var $=w.key,O=w.changes,E=g[j];if(E){for(var F=0,B=Object.keys(O);F<B.length;F++){var I=B[F],z=O[I];if(I===o.schema.primKey.keyPath){if(Pe(z,$)!==0)throw new re.Constraint("Cannot update primary key in bulkUpdate()")}else X(E,I,z)}h.push(j),T.push($),D.push(E)}}),T.length);return u.mutate({trans:y,type:"put",keys:T,values:D,updates:{keys:l,changeSpecs:f}}).then(function(w){var j=w.numFailures,$=w.failures;if(j===0)return C;for(var O=0,E=Object.keys($);O<E.length;O++){var F,B=E[O],I=h[Number(B)];I!=null&&(F=$[B],delete $[B],$[I]=F)}throw new we("".concat(o.name,".bulkUpdate(): ").concat(j," of ").concat(C," operations failed"),$)})})})},Ye.prototype.bulkDelete=function(n){var o=this,u=n.length;return this._trans("readwrite",function(l){return o.core.mutate({trans:l,type:"delete",keys:n}).then(function(f){return Kn(o,n,f)})}).then(function(l){var f=l.numFailures,h=l.failures;if(f===0)return l.lastResult;throw new we("".concat(o.name,".bulkDelete(): ").concat(f," of ").concat(u," operations failed"),h)})};var qs=Ye;function Ye(){}function cn(n){function o(y,g){if(g){for(var T=arguments.length,D=new Array(T-1);--T;)D[T-1]=arguments[T];return u[y].subscribe.apply(null,D),n}if(typeof y=="string")return u[y]}var u={};o.addEventType=h;for(var l=1,f=arguments.length;l<f;++l)h(arguments[l]);return o;function h(y,g,T){var D,C;if(typeof y!="object")return g=g||on,C={subscribers:[],fire:T=T||N,subscribe:function(w){C.subscribers.indexOf(w)===-1&&(C.subscribers.push(w),C.fire=g(C.fire,w))},unsubscribe:function(w){C.subscribers=C.subscribers.filter(function(j){return j!==w}),C.fire=C.subscribers.reduce(g,T)}},u[y]=o[y]=C;c(D=y).forEach(function(w){var j=D[w];if(d(j))h(w,D[w][0],D[w][1]);else{if(j!=="asap")throw new re.InvalidArgument("Invalid event config");var $=h(w,et,function(){for(var O=arguments.length,E=new Array(O);O--;)E[O]=arguments[O];$.subscribers.forEach(function(F){A(function(){F.apply(null,E)})})})}})}}function ln(n,o){return _(o).from({prototype:n}),o}function qr(n,o){return!(n.filter||n.algorithm||n.or)&&(o?n.justLimit:!n.replayFilter)}function no(n,o){n.filter=hr(n.filter,o)}function io(n,o,u){var l=n.replayFilter;n.replayFilter=l?function(){return hr(l(),o())}:o,n.justLimit=u&&!l}function zn(n,o){if(n.isPrimKey)return o.primaryKey;var u=o.getIndexByKeyPath(n.index);if(u)return u;throw new re.Schema("KeyPath "+n.index+" on object store "+o.name+" is not indexed")}function Ls(n,o,u){var l=zn(n,o.schema);return o.openCursor({trans:u,values:!n.keysOnly,reverse:n.dir==="prev",unique:!!n.unique,query:{index:l,range:n.range}})}function Un(n,o,u,l){var f,h,y=n.replayFilter?hr(n.filter,n.replayFilter()):n.filter;return n.or?(f={},h=function(g,T,D){var C,w;y&&!y(T,D,function(j){return T.stop(j)},function(j){return T.fail(j)})||((w=""+(C=T.primaryKey))=="[object ArrayBuffer]"&&(w=""+new Uint8Array(C)),b(f,w))||(f[w]=!0,o(g,T,D))},Promise.all([n.or._iterate(h,u),Vs(Ls(n,l,u),n.algorithm,h,!n.keysOnly&&n.valueMapper)])):Vs(Ls(n,l,u),hr(n.algorithm,y),o,!n.keysOnly&&n.valueMapper)}function Vs(n,o,u,l){var f=Xe(l?function(h,y,g){return u(l(h),y,g)}:u);return n.then(function(h){if(h)return h.start(function(){var y=function(){return h.continue()};o&&!o(h,function(g){return y=g},function(g){h.stop(g),y=N},function(g){h.fail(g),y=N})||f(h.value,h,function(g){return y=g}),y()})})}Ie.prototype._read=function(n,o){var u=this._ctx;return u.error?u.table._trans(null,at.bind(null,u.error)):u.table._trans("readonly",n).then(o)},Ie.prototype._write=function(n){var o=this._ctx;return o.error?o.table._trans(null,at.bind(null,o.error)):o.table._trans("readwrite",n,"locked")},Ie.prototype._addAlgorithm=function(n){var o=this._ctx;o.algorithm=hr(o.algorithm,n)},Ie.prototype._iterate=function(n,o){return Un(this._ctx,n,o,this._ctx.table.core)},Ie.prototype.clone=function(n){var o=Object.create(this.constructor.prototype),u=Object.create(this._ctx);return n&&p(u,n),o._ctx=u,o},Ie.prototype.raw=function(){return this._ctx.valueMapper=null,this},Ie.prototype.each=function(n){var o=this._ctx;return this._read(function(u){return Un(o,n,u,o.table.core)})},Ie.prototype.count=function(n){var o=this;return this._read(function(u){var l,f=o._ctx,h=f.table.core;return qr(f,!0)?h.count({trans:u,query:{index:zn(f,h.schema),range:f.range}}).then(function(y){return Math.min(y,f.limit)}):(l=0,Un(f,function(){return++l,!1},u,h).then(function(){return l}))}).then(n)},Ie.prototype.sortBy=function(n,o){var u=n.split(".").reverse(),l=u[0],f=u.length-1;function h(T,D){return D?h(T[u[D]],D-1):T[l]}var y=this._ctx.dir==="next"?1:-1;function g(T,D){return Pe(h(T,f),h(D,f))*y}return this.toArray(function(T){return T.sort(g)}).then(o)},Ie.prototype.toArray=function(n){var o=this;return this._read(function(u){var l,f,h,y=o._ctx;return y.dir==="next"&&qr(y,!0)&&0<y.limit?(l=y.valueMapper,f=zn(y,y.table.core.schema),y.table.core.query({trans:u,limit:y.limit,values:!0,query:{index:f,range:y.range}}).then(function(g){return g=g.result,l?g.map(l):g})):(h=[],Un(y,function(g){return h.push(g)},u,y.table.core).then(function(){return h}))},n)},Ie.prototype.offset=function(n){var o=this._ctx;return n<=0||(o.offset+=n,qr(o)?io(o,function(){var u=n;return function(l,f){return u===0||(u===1?--u:f(function(){l.advance(u),u=0}),!1)}}):io(o,function(){var u=n;return function(){return--u<0}})),this},Ie.prototype.limit=function(n){return this._ctx.limit=Math.min(this._ctx.limit,n),io(this._ctx,function(){var o=n;return function(u,l,f){return--o<=0&&l(f),0<=o}},!0),this},Ie.prototype.until=function(n,o){return no(this._ctx,function(u,l,f){return!n(u.value)||(l(f),o)}),this},Ie.prototype.first=function(n){return this.limit(1).toArray(function(o){return o[0]}).then(n)},Ie.prototype.last=function(n){return this.reverse().first(n)},Ie.prototype.filter=function(n){var o;return no(this._ctx,function(u){return n(u.value)}),(o=this._ctx).isMatch=hr(o.isMatch,n),this},Ie.prototype.and=function(n){return this.filter(n)},Ie.prototype.or=function(n){return new this.db.WhereClause(this._ctx.table,n,this)},Ie.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},Ie.prototype.desc=function(){return this.reverse()},Ie.prototype.eachKey=function(n){var o=this._ctx;return o.keysOnly=!o.isMatch,this.each(function(u,l){n(l.key,l)})},Ie.prototype.eachUniqueKey=function(n){return this._ctx.unique="unique",this.eachKey(n)},Ie.prototype.eachPrimaryKey=function(n){var o=this._ctx;return o.keysOnly=!o.isMatch,this.each(function(u,l){n(l.primaryKey,l)})},Ie.prototype.keys=function(n){var o=this._ctx,u=(o.keysOnly=!o.isMatch,[]);return this.each(function(l,f){u.push(f.key)}).then(function(){return u}).then(n)},Ie.prototype.primaryKeys=function(n){var o=this._ctx;if(o.dir==="next"&&qr(o,!0)&&0<o.limit)return this._read(function(l){var f=zn(o,o.table.core.schema);return o.table.core.query({trans:l,values:!1,limit:o.limit,query:{index:f,range:o.range}})}).then(function(l){return l.result}).then(n);o.keysOnly=!o.isMatch;var u=[];return this.each(function(l,f){u.push(f.primaryKey)}).then(function(){return u}).then(n)},Ie.prototype.uniqueKeys=function(n){return this._ctx.unique="unique",this.keys(n)},Ie.prototype.firstKey=function(n){return this.limit(1).keys(function(o){return o[0]}).then(n)},Ie.prototype.lastKey=function(n){return this.reverse().firstKey(n)},Ie.prototype.distinct=function(){var n,o=this._ctx,o=o.index&&o.table.schema.idxByName[o.index];return o&&o.multi&&(n={},no(this._ctx,function(l){var l=l.primaryKey.toString(),f=b(n,l);return n[l]=!0,!f})),this},Ie.prototype.modify=function(n){var o=this,u=this._ctx;return this._write(function(l){function f(E,F){var B=F.failures;j+=E-F.numFailures;for(var I=0,z=c(B);I<z.length;I++){var Z=z[I];w.push(B[Z])}}var h=typeof n=="function"?n:function(E){return Bs(E,n)},y=u.table.core,C=y.schema.primaryKey,g=C.outbound,T=C.extractKey,D=200,C=o.db._options.modifyChunkSize,w=(C&&(D=typeof C=="object"?C[y.name]||C["*"]||200:C),[]),j=0,$=[],O=n===Ks;return o.clone().primaryKeys().then(function(E){function F(I){var z=Math.min(D,E.length-I),Z=E.slice(I,I+z);return(O?Promise.resolve([]):y.getMany({trans:l,keys:Z,cache:"immutable"})).then(function(oe){var ae=[],Q=[],fe=g?[]:null,le=O?Z:[];if(!O)for(var ne=0;ne<z;++ne){var de=oe[ne],Re={value:ee(de),primKey:E[I+ne]};h.call(Re,Re.value,Re)!==!1&&(Re.value==null?le.push(E[I+ne]):g||Pe(T(de),T(Re.value))===0?(Q.push(Re.value),g&&fe.push(E[I+ne])):(le.push(E[I+ne]),ae.push(Re.value)))}return Promise.resolve(0<ae.length&&y.mutate({trans:l,type:"add",values:ae}).then(function(De){for(var Se in De.failures)le.splice(parseInt(Se),1);f(ae.length,De)})).then(function(){return(0<Q.length||B&&typeof n=="object")&&y.mutate({trans:l,type:"put",keys:fe,values:Q,criteria:B,changeSpec:typeof n!="function"&&n,isAdditionalChunk:0<I}).then(function(De){return f(Q.length,De)})}).then(function(){return(0<le.length||B&&O)&&y.mutate({trans:l,type:"delete",keys:le,criteria:B,isAdditionalChunk:0<I}).then(function(De){return Kn(u.table,le,De)}).then(function(De){return f(le.length,De)})}).then(function(){return E.length>I+z&&F(I+D)})})}var B=qr(u)&&u.limit===1/0&&(typeof n!="function"||O)&&{index:u.index,range:u.range};return F(0).then(function(){if(0<w.length)throw new Ee("Error modifying one or more objects",w,j,$);return E.length})})})},Ie.prototype.delete=function(){var n=this._ctx,o=n.range;return!qr(n)||n.table.schema.yProps||!n.isPrimKey&&o.type!==3?this.modify(Ks):this._write(function(u){var l=n.table.core.schema.primaryKey,f=o;return n.table.core.count({trans:u,query:{index:l,range:f}}).then(function(h){return n.table.core.mutate({trans:u,type:"deleteRange",range:f}).then(function(T){var g=T.failures,T=T.numFailures;if(T)throw new Ee("Could not delete some values",Object.keys(g).map(function(D){return g[D]}),h-T);return h-T})})})};var hd=Ie;function Ie(){}var Ks=function(n,o){return o.value=null};function pd(n,o){return n<o?-1:n===o?0:1}function md(n,o){return o<n?-1:n===o?0:1}function St(n,o,u){return n=n instanceof Us?new n.Collection(n):n,n._ctx.error=new(u||TypeError)(o),n}function Lr(n){return new n.Collection(n,function(){return zs("")}).limit(0)}function Gn($,o,u,l){var f,h,y,g,T,D,C,w=u.length;if(!u.every(function(E){return typeof E=="string"}))return St($,Rs);function j(E){f=E==="next"?function(B){return B.toUpperCase()}:function(B){return B.toLowerCase()},h=E==="next"?function(B){return B.toLowerCase()}:function(B){return B.toUpperCase()},y=E==="next"?pd:md;var F=u.map(function(B){return{lower:h(B),upper:f(B)}}).sort(function(B,I){return y(B.lower,I.lower)});g=F.map(function(B){return B.upper}),T=F.map(function(B){return B.lower}),C=(D=E)==="next"?"":l}j("next");var $=new $.Collection($,function(){return Qt(g[0],T[w-1]+l)}),O=($._ondirectionchange=function(E){j(E)},0);return $._addAlgorithm(function(E,F,B){var I=E.key;if(typeof I=="string"){var z=h(I);if(o(z,T,O))return!0;for(var Z=null,oe=O;oe<w;++oe){var ae=((Q,fe,le,ne,de,Re)=>{for(var De=Math.min(Q.length,ne.length),Se=-1,$e=0;$e<De;++$e){var tt=fe[$e];if(tt!==ne[$e])return de(Q[$e],le[$e])<0?Q.substr(0,$e)+le[$e]+le.substr($e+1):de(Q[$e],ne[$e])<0?Q.substr(0,$e)+ne[$e]+le.substr($e+1):0<=Se?Q.substr(0,Se)+fe[Se]+le.substr(Se+1):null;de(Q[$e],tt)<0&&(Se=$e)}return De<ne.length&&Re==="next"?Q+le.substr(Q.length):De<Q.length&&Re==="prev"?Q.substr(0,le.length):Se<0?null:Q.substr(0,Se)+ne[Se]+le.substr(Se+1)})(I,z,g[oe],T[oe],y,D);ae===null&&Z===null?O=oe+1:(Z===null||0<y(Z,ae))&&(Z=ae)}F(Z!==null?function(){E.continue(Z+C)}:B)}return!1}),$}function Qt(n,o,u,l){return{type:2,lower:n,upper:o,lowerOpen:u,upperOpen:l}}function zs(n){return{type:1,lower:n,upper:n}}Object.defineProperty(dt.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),dt.prototype.between=function(n,o,u,l){u=u!==!1,l=l===!0;try{return 0<this._cmp(n,o)||this._cmp(n,o)===0&&(u||l)&&(!u||!l)?Lr(this):new this.Collection(this,function(){return Qt(n,o,!u,!l)})}catch{return St(this,Lt)}},dt.prototype.equals=function(n){return n==null?St(this,Lt):new this.Collection(this,function(){return zs(n)})},dt.prototype.above=function(n){return n==null?St(this,Lt):new this.Collection(this,function(){return Qt(n,void 0,!0)})},dt.prototype.aboveOrEqual=function(n){return n==null?St(this,Lt):new this.Collection(this,function(){return Qt(n,void 0,!1)})},dt.prototype.below=function(n){return n==null?St(this,Lt):new this.Collection(this,function(){return Qt(void 0,n,!1,!0)})},dt.prototype.belowOrEqual=function(n){return n==null?St(this,Lt):new this.Collection(this,function(){return Qt(void 0,n)})},dt.prototype.startsWith=function(n){return typeof n!="string"?St(this,Rs):this.between(n,n+dr,!0,!0)},dt.prototype.startsWithIgnoreCase=function(n){return n===""?this.startsWith(n):Gn(this,function(o,u){return o.indexOf(u[0])===0},[n],dr)},dt.prototype.equalsIgnoreCase=function(n){return Gn(this,function(o,u){return o===u[0]},[n],"")},dt.prototype.anyOfIgnoreCase=function(){var n=J.apply(lt,arguments);return n.length===0?Lr(this):Gn(this,function(o,u){return u.indexOf(o)!==-1},n,"")},dt.prototype.startsWithAnyOfIgnoreCase=function(){var n=J.apply(lt,arguments);return n.length===0?Lr(this):Gn(this,function(o,u){return u.some(function(l){return o.indexOf(l)===0})},n,dr)},dt.prototype.anyOf=function(){var n,o,u=this,l=J.apply(lt,arguments),f=this._cmp;try{l.sort(f)}catch{return St(this,Lt)}return l.length===0?Lr(this):((n=new this.Collection(this,function(){return Qt(l[0],l[l.length-1])}))._ondirectionchange=function(h){f=h==="next"?u._ascending:u._descending,l.sort(f)},o=0,n._addAlgorithm(function(h,y,g){for(var T=h.key;0<f(T,l[o]);)if(++o===l.length)return y(g),!1;return f(T,l[o])===0||(y(function(){h.continue(l[o])}),!1)}),n)},dt.prototype.notEqual=function(n){return this.inAnyRange([[-1/0,n],[n,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},dt.prototype.noneOf=function(){var n=J.apply(lt,arguments);if(n.length===0)return new this.Collection(this);try{n.sort(this._ascending)}catch{return St(this,Lt)}var o=n.reduce(function(u,l){return u?u.concat([[u[u.length-1][1],l]]):[[-1/0,l]]},null);return o.push([n[n.length-1],this.db._maxKey]),this.inAnyRange(o,{includeLowers:!1,includeUppers:!1})},dt.prototype.inAnyRange=function(n,B){var u=this,l=this._cmp,f=this._ascending,h=this._descending,y=this._min,g=this._max;if(n.length===0)return Lr(this);if(!n.every(function(I){return I[0]!==void 0&&I[1]!==void 0&&f(I[0],I[1])<=0}))return St(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",re.InvalidArgument);var T=!B||B.includeLowers!==!1,D=B&&B.includeUppers===!0,C,w=f;function j(I,z){return w(I[0],z[0])}try{(C=n.reduce(function(I,z){for(var Z=0,oe=I.length;Z<oe;++Z){var ae=I[Z];if(l(z[0],ae[1])<0&&0<l(z[1],ae[0])){ae[0]=y(ae[0],z[0]),ae[1]=g(ae[1],z[1]);break}}return Z===oe&&I.push(z),I},[])).sort(j)}catch{return St(this,Lt)}var $=0,O=D?function(I){return 0<f(I,C[$][1])}:function(I){return 0<=f(I,C[$][1])},E=T?function(I){return 0<h(I,C[$][0])}:function(I){return 0<=h(I,C[$][0])},F=O,B=new this.Collection(this,function(){return Qt(C[0][0],C[C.length-1][1],!T,!D)});return B._ondirectionchange=function(I){w=I==="next"?(F=O,f):(F=E,h),C.sort(j)},B._addAlgorithm(function(I,z,Z){for(var oe,ae=I.key;F(ae);)if(++$===C.length)return z(Z),!1;return!O(oe=ae)&&!E(oe)||(u._cmp(ae,C[$][1])===0||u._cmp(ae,C[$][0])===0||z(function(){w===f?I.continue(C[$][0]):I.continue(C[$][1])}),!1)}),B},dt.prototype.startsWithAnyOf=function(){var n=J.apply(lt,arguments);return n.every(function(o){return typeof o=="string"})?n.length===0?Lr(this):this.inAnyRange(n.map(function(o){return[o,o+dr]})):St(this,"startsWithAnyOf() only works with strings")};var Us=dt;function dt(){}function It(n){return Xe(function(o){return fn(o),n(o.target.error),!1})}function fn(n){n.stopPropagation&&n.stopPropagation(),n.preventDefault&&n.preventDefault()}var dn="storagemutated",oo="x-storagemutated-1",er=cn(null,dn),yd=(Dt.prototype._lock=function(){return W(!me.global),++this._reculock,this._reculock!==1||me.global||(me.lockOwnerFor=this),this},Dt.prototype._unlock=function(){if(W(!me.global),--this._reculock==0)for(me.global||(me.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var n=this._blockedFuncs.shift();try{fr(n[1],n[0])}catch{}}return this},Dt.prototype._locked=function(){return this._reculock&&me.lockOwnerFor!==this},Dt.prototype.create=function(n){var o=this;if(this.mode){var u=this.db.idbdb,l=this.db._state.dbOpenError;if(W(!this.idbtrans),!n&&!u)switch(l&&l.name){case"DatabaseClosedError":throw new re.DatabaseClosed(l);case"MissingAPIError":throw new re.MissingAPI(l.message,l);default:throw new re.OpenFailed(l)}if(!this.active)throw new re.TransactionInactive;W(this._completion._state===null),(n=this.idbtrans=n||(this.db.core||u).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=Xe(function(f){fn(f),o._reject(n.error)}),n.onabort=Xe(function(f){fn(f),o.active&&o._reject(new re.Abort(n.error)),o.active=!1,o.on("abort").fire(f)}),n.oncomplete=Xe(function(){o.active=!1,o._resolve(),"mutatedParts"in n&&er.storagemutated.fire(n.mutatedParts)})}return this},Dt.prototype._promise=function(n,o,u){var l,f=this;return n==="readwrite"&&this.mode!=="readwrite"?at(new re.ReadOnly("Transaction is readonly")):this.active?this._locked()?new ue(function(h,y){f._blockedFuncs.push([function(){f._promise(n,o,u).then(h,y)},me])}):u?Jt(function(){var h=new ue(function(y,g){f._lock();var T=o(y,g,f);T&&T.then&&T.then(y,g)});return h.finally(function(){return f._unlock()}),h._lib=!0,h}):((l=new ue(function(h,y){var g=o(h,y,f);g&&g.then&&g.then(h,y)}))._lib=!0,l):at(new re.TransactionInactive)},Dt.prototype._root=function(){return this.parent?this.parent._root():this},Dt.prototype.waitFor=function(n){var o,u=this._root(),l=ue.resolve(n),f=(u._waitingFor?u._waitingFor=u._waitingFor.then(function(){return l}):(u._waitingFor=l,u._waitingQueue=[],o=u.idbtrans.objectStore(u.storeNames[0]),(function h(){for(++u._spinCount;u._waitingQueue.length;)u._waitingQueue.shift()();u._waitingFor&&(o.get(-1/0).onsuccess=h)})()),u._waitingFor);return new ue(function(h,y){l.then(function(g){return u._waitingQueue.push(Xe(h.bind(null,g)))},function(g){return u._waitingQueue.push(Xe(y.bind(null,g)))}).finally(function(){u._waitingFor===f&&(u._waitingFor=null)})})},Dt.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new re.Abort))},Dt.prototype.table=function(n){var o=this._memoizedTables||(this._memoizedTables={});if(b(o,n))return o[n];var u=this.schema[n];if(u)return(u=new this.db.Table(n,u,this)).core=this.db.core.table(n),o[n]=u;throw new re.NotFound("Table "+n+" not part of transaction")},Dt);function Dt(){}function ao(n,o,u,l,f,h,y,g){return{name:n,keyPath:o,unique:u,multi:l,auto:f,compound:h,src:(u&&!y?"&":"")+(l?"*":"")+(f?"++":"")+Gs(o),type:g}}function Gs(n){return typeof n=="string"?n:n?"["+[].join.call(n,"+")+"]":""}function so(n,o,u){return{name:n,primKey:o,indexes:u,mappedClass:null,idxByName:(l=function(f){return[f.name,f]},u.reduce(function(f,h,y){return h=l(h,y),h&&(f[h[0]]=h[1]),f},{}))};var l}var hn=function(n){try{return n.only([[]]),hn=function(){return[[]]},[[]]}catch{return hn=function(){return dr},dr}};function uo(n){return n==null?function(){}:typeof n=="string"?(o=n).split(".").length===1?function(u){return u[o]}:function(u){return q(u,o)}:function(u){return q(u,n)};var o}function Ws(n){return[].slice.call(n)}var gd=0;function pn(n){return n==null?":id":typeof n=="string"?n:"[".concat(n.join("+"),"]")}function vd(n,o,T){function l(O){if(O.type===3)return null;if(O.type===4)throw new Error("Cannot convert never type to IDBKeyRange");var w=O.lower,j=O.upper,$=O.lowerOpen,O=O.upperOpen;return w===void 0?j===void 0?null:o.upperBound(j,!!O):j===void 0?o.lowerBound(w,!!$):o.bound(w,j,!!$,!!O)}function f(C){var w,j=C.name;return{name:j,schema:C,mutate:function($){var O=$.trans,E=$.type,F=$.keys,B=$.values,I=$.range;return new Promise(function(z,Z){z=Xe(z);var oe=O.objectStore(j),ae=oe.keyPath==null,Q=E==="put"||E==="add";if(!Q&&E!=="delete"&&E!=="deleteRange")throw new Error("Invalid operation type: "+E);var fe,le=(F||B||{length:1}).length;if(F&&B&&F.length!==B.length)throw new Error("Given keys array must have same length as given values array.");if(le===0)return z({numFailures:0,failures:{},results:[],lastResult:void 0});function ne(nt){++De,fn(nt)}var de=[],Re=[],De=0;if(E==="deleteRange"){if(I.type===4)return z({numFailures:De,failures:Re,results:[],lastResult:void 0});I.type===3?de.push(fe=oe.clear()):de.push(fe=oe.delete(l(I)))}else{var ae=Q?ae?[B,F]:[B,null]:[F,null],Se=ae[0],$e=ae[1];if(Q)for(var tt=0;tt<le;++tt)de.push(fe=$e&&$e[tt]!==void 0?oe[E](Se[tt],$e[tt]):oe[E](Se[tt])),fe.onerror=ne;else for(tt=0;tt<le;++tt)de.push(fe=oe[E](Se[tt])),fe.onerror=ne}function Ct(nt){nt=nt.target.result,de.forEach(function(yr,Oo){return yr.error!=null&&(Re[Oo]=yr.error)}),z({numFailures:De,failures:Re,results:E==="delete"?F:de.map(function(yr){return yr.result}),lastResult:nt})}fe.onerror=function(nt){ne(nt),Ct(nt)},fe.onsuccess=Ct})},getMany:function($){var O=$.trans,E=$.keys;return new Promise(function(F,B){F=Xe(F);for(var I,z=O.objectStore(j),Z=E.length,oe=new Array(Z),ae=0,Q=0,fe=function(de){de=de.target,oe[de._pos]=de.result,++Q===ae&&F(oe)},le=It(B),ne=0;ne<Z;++ne)E[ne]!=null&&((I=z.get(E[ne]))._pos=ne,I.onsuccess=fe,I.onerror=le,++ae);ae===0&&F(oe)})},get:function($){var O=$.trans,E=$.key;return new Promise(function(F,B){F=Xe(F);var I=O.objectStore(j).get(E);I.onsuccess=function(z){return F(z.target.result)},I.onerror=It(B)})},query:(w=g,function($){return new Promise(function(O,E){O=Xe(O);var F,B,I,Q=$.trans,z=$.values,Z=$.limit,ae=$.query,oe=Z===1/0?void 0:Z,fe=ae.index,ae=ae.range,Q=Q.objectStore(j),Q=fe.isPrimaryKey?Q:Q.index(fe.name),fe=l(ae);if(Z===0)return O({result:[]});w?((ae=z?Q.getAll(fe,oe):Q.getAllKeys(fe,oe)).onsuccess=function(le){return O({result:le.target.result})},ae.onerror=It(E)):(F=0,B=!z&&"openKeyCursor"in Q?Q.openKeyCursor(fe):Q.openCursor(fe),I=[],B.onsuccess=function(le){var ne=B.result;return!ne||(I.push(z?ne.value:ne.primaryKey),++F===Z)?O({result:I}):void ne.continue()},B.onerror=It(E))})}),openCursor:function($){var O=$.trans,E=$.values,F=$.query,B=$.reverse,I=$.unique;return new Promise(function(z,Z){z=Xe(z);var Q=F.index,oe=F.range,ae=O.objectStore(j),ae=Q.isPrimaryKey?ae:ae.index(Q.name),Q=B?I?"prevunique":"prev":I?"nextunique":"next",fe=!E&&"openKeyCursor"in ae?ae.openKeyCursor(l(oe),Q):ae.openCursor(l(oe),Q);fe.onerror=It(Z),fe.onsuccess=Xe(function(le){var ne,de,Re,De,Se=fe.result;Se?(Se.___id=++gd,Se.done=!1,ne=Se.continue.bind(Se),de=(de=Se.continuePrimaryKey)&&de.bind(Se),Re=Se.advance.bind(Se),De=function(){throw new Error("Cursor not stopped")},Se.trans=O,Se.stop=Se.continue=Se.continuePrimaryKey=Se.advance=function(){throw new Error("Cursor not started")},Se.fail=Xe(Z),Se.next=function(){var $e=this,tt=1;return this.start(function(){return tt--?$e.continue():$e.stop()}).then(function(){return $e})},Se.start=function($e){function tt(){if(fe.result)try{$e()}catch(nt){Se.fail(nt)}else Se.done=!0,Se.start=function(){throw new Error("Cursor behind last entry")},Se.stop()}var Ct=new Promise(function(nt,yr){nt=Xe(nt),fe.onerror=It(yr),Se.fail=yr,Se.stop=function(Oo){Se.stop=Se.continue=Se.continuePrimaryKey=Se.advance=De,nt(Oo)}});return fe.onsuccess=Xe(function(nt){fe.onsuccess=tt,tt()}),Se.continue=ne,Se.continuePrimaryKey=de,Se.advance=Re,tt(),Ct},z(Se)):z(null)},Z)})},count:function($){var O=$.query,E=$.trans,F=O.index,B=O.range;return new Promise(function(I,z){var Z=E.objectStore(j),Z=F.isPrimaryKey?Z:Z.index(F.name),oe=l(B),oe=oe?Z.count(oe):Z.count();oe.onsuccess=Xe(function(ae){return I(ae.target.result)}),oe.onerror=It(z)})}}}h=T,y=Ws((T=n).objectStoreNames);var h,T={schema:{name:T.name,tables:y.map(function(C){return h.objectStore(C)}).map(function(C){var w=C.keyPath,j=C.autoIncrement,O=d(w),$={},O={name:C.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:w==null,compound:O,keyPath:w,autoIncrement:j,unique:!0,extractKey:uo(w)},indexes:Ws(C.indexNames).map(function(E){return C.index(E)}).map(function(I){var z=I.name,F=I.unique,B=I.multiEntry,I=I.keyPath,z={name:z,compound:d(I),keyPath:I,unique:F,multiEntry:B,extractKey:uo(I)};return $[pn(I)]=z}),getIndexByKeyPath:function(E){return $[pn(E)]}};return $[":id"]=O.primaryKey,w!=null&&($[pn(w)]=O.primaryKey),O})},hasGetAll:0<y.length&&"getAll"in h.objectStore(y[0])&&!(typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)},y=T.schema,g=T.hasGetAll,T=y.tables.map(f),D={};return T.forEach(function(C){return D[C.name]=C}),{stack:"dbcore",transaction:n.transaction.bind(n),table:function(C){if(D[C])return D[C];throw new Error("Table '".concat(C,"' not found"))},MIN_KEY:-1/0,MAX_KEY:hn(o),schema:y}}function bd(n,o,u,l){return u=u.IDBKeyRange,o=vd(o,u,l),{dbcore:n.dbcore.reduce(function(f,h){return h=h.create,i(i({},f),h(f))},o)}}function Wn(n,o){var u=o.db,u=bd(n._middlewares,u,n._deps,o);n.core=u.dbcore,n.tables.forEach(function(l){var f=l.name;n.core.schema.tables.some(function(h){return h.name===f})&&(l.core=n.core.table(f),n[f]instanceof n.Table)&&(n[f].core=l.core)})}function Yn(n,o,u,l){u.forEach(function(f){var h=l[f];o.forEach(function(y){var g=(function T(D,C){return L(D,C)||(D=m(D))&&T(D,C)})(y,f);(!g||"value"in g&&g.value===void 0)&&(y===n.Transaction.prototype||y instanceof n.Transaction?P(y,f,{get:function(){return this.table(f)},set:function(T){R(this,f,{value:T,writable:!0,configurable:!0,enumerable:!0})}}):y[f]=new n.Table(f,h))})})}function co(n,o){o.forEach(function(u){for(var l in u)u[l]instanceof n.Table&&delete u[l]})}function _d(n,o){return n._cfg.version-o._cfg.version}function xd(n,o,u,l){var f=n._dbSchema,h=(u.objectStoreNames.contains("$meta")&&!f.$meta&&(f.$meta=so("$meta",Hs("")[0],[]),n._storeNames.push("$meta")),n._createTransaction("readwrite",n._storeNames,f)),y=(h.create(u),h._completion.catch(l),h._reject.bind(h)),g=me.transless||me;Jt(function(){if(me.trans=h,me.transless=g,o!==0)return Wn(n,u),D=o,((T=h).storeNames.includes("$meta")?T.table("$meta").get("version").then(function(C){return C??D}):ue.resolve(D)).then(function(F){var w=n,j=F,$=h,O=u,E=[],F=w._versions,B=w._dbSchema=Jn(0,w.idbdb,O);return(F=F.filter(function(I){return I._cfg.version>=j})).length===0?ue.resolve():(F.forEach(function(I){E.push(function(){var z,Z,oe,ae=B,Q=I._cfg.dbschema,fe=(Xn(w,ae,O),Xn(w,Q,O),B=w._dbSchema=Q,lo(ae,Q)),le=(fe.add.forEach(function(ne){fo(O,ne[0],ne[1].primKey,ne[1].indexes)}),fe.change.forEach(function(ne){if(ne.recreate)throw new re.Upgrade("Not yet support for changing primary key");var de=O.objectStore(ne.name);ne.add.forEach(function(Re){return Hn(de,Re)}),ne.change.forEach(function(Re){de.deleteIndex(Re.name),Hn(de,Re)}),ne.del.forEach(function(Re){return de.deleteIndex(Re)})}),I._cfg.contentUpgrade);if(le&&I._cfg.version>j)return Wn(w,O),$._memoizedTables={},z=ie(Q),fe.del.forEach(function(ne){z[ne]=ae[ne]}),co(w,[w.Transaction.prototype]),Yn(w,[w.Transaction.prototype],c(z),z),$.schema=z,(Z=ce(le))&&Nr(),Q=ue.follow(function(){var ne;(oe=le($))&&Z&&(ne=Xt.bind(null,null),oe.then(ne,ne))}),oe&&typeof oe.then=="function"?ue.resolve(oe):Q.then(function(){return oe})}),E.push(function(z){var Z,oe,ae=I._cfg.dbschema;Z=ae,oe=z,[].slice.call(oe.db.objectStoreNames).forEach(function(Q){return Z[Q]==null&&oe.db.deleteObjectStore(Q)}),co(w,[w.Transaction.prototype]),Yn(w,[w.Transaction.prototype],w._storeNames,w._dbSchema),$.schema=w._dbSchema}),E.push(function(z){w.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(w.idbdb.version/10)===I._cfg.version?(w.idbdb.deleteObjectStore("$meta"),delete w._dbSchema.$meta,w._storeNames=w._storeNames.filter(function(Z){return Z!=="$meta"})):z.objectStore("$meta").put(I._cfg.version,"version"))})}),(function I(){return E.length?ue.resolve(E.shift()($.idbtrans)).then(I):ue.resolve()})().then(function(){Ys(B,O)}))}).catch(y);var T,D;c(f).forEach(function(C){fo(u,C,f[C].primKey,f[C].indexes)}),Wn(n,u),ue.follow(function(){return n.on.populate.fire(h)}).catch(y)})}function Sd(n,o){Ys(n._dbSchema,o),o.db.version%10!=0||o.objectStoreNames.contains("$meta")||o.db.createObjectStore("$meta").add(Math.ceil(o.db.version/10-1),"version");var u=Jn(0,n.idbdb,o);Xn(n,n._dbSchema,o);for(var l=0,f=lo(u,n._dbSchema).change;l<f.length;l++){var h=(y=>{if(y.change.length||y.recreate)return console.warn("Unable to patch indexes of table ".concat(y.name," because it has changes on the type of index or primary key.")),{value:void 0};var g=o.objectStore(y.name);y.add.forEach(function(T){Tt&&console.debug("Dexie upgrade patch: Creating missing index ".concat(y.name,".").concat(T.src)),Hn(g,T)})})(f[l]);if(typeof h=="object")return h.value}}function lo(n,o){var u,l={del:[],add:[],change:[]};for(u in n)o[u]||l.del.push(u);for(u in o){var f=n[u],h=o[u];if(f){var y={name:u,def:h,recreate:!1,del:[],add:[],change:[]};if(""+(f.primKey.keyPath||"")!=""+(h.primKey.keyPath||"")||f.primKey.auto!==h.primKey.auto)y.recreate=!0,l.change.push(y);else{var g=f.idxByName,T=h.idxByName,D=void 0;for(D in g)T[D]||y.del.push(D);for(D in T){var C=g[D],w=T[D];C?C.src!==w.src&&y.change.push(w):y.add.push(w)}(0<y.del.length||0<y.add.length||0<y.change.length)&&l.change.push(y)}}else l.add.push([u,h])}return l}function fo(n,o,u,l){var f=n.db.createObjectStore(o,u.keyPath?{keyPath:u.keyPath,autoIncrement:u.auto}:{autoIncrement:u.auto});l.forEach(function(h){return Hn(f,h)})}function Ys(n,o){c(n).forEach(function(u){o.db.objectStoreNames.contains(u)||(Tt&&console.debug("Dexie: Creating missing table",u),fo(o,u,n[u].primKey,n[u].indexes))})}function Hn(n,o){n.createIndex(o.name,o.keyPath,{unique:o.unique,multiEntry:o.multi})}function Jn(n,o,u){var l={};return H(o.objectStoreNames,0).forEach(function(f){for(var h=u.objectStore(f),y=ao(Gs(D=h.keyPath),D||"",!0,!1,!!h.autoIncrement,D&&typeof D!="string",!0),g=[],T=0;T<h.indexNames.length;++T){var C=h.index(h.indexNames[T]),D=C.keyPath,C=ao(C.name,D,!!C.unique,!!C.multiEntry,!1,D&&typeof D!="string",!1);g.push(C)}l[f]=so(f,y,g)}),l}function Xn(n,o,u){for(var l=u.db.objectStoreNames,f=0;f<l.length;++f){var h=l[f],y=u.objectStore(h);n._hasGetAll="getAll"in y;for(var g=0;g<y.indexNames.length;++g){var T,D=y.indexNames[g],C=y.index(D).keyPath,C=typeof C=="string"?C:"["+H(C).join("+")+"]";o[h]&&(T=o[h].idxByName[C])&&(T.name=D,delete o[h].idxByName[C],o[h].idxByName[D]=T)}}typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&s.WorkerGlobalScope&&s instanceof s.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(n._hasGetAll=!1)}function Hs(n){return n.split(",").map(function(o,u){var f=o.split(":"),l=(l=f[1])==null?void 0:l.trim(),f=(o=f[0].trim()).replace(/([&*]|\+\+)/g,""),h=/^\[/.test(f)?f.match(/^\[(.*)\]$/)[1].split("+"):f;return ao(f,h||null,/\&/.test(o),/\*/.test(o),/\+\+/.test(o),d(h),u===0,l)})}Vr.prototype._createTableSchema=so,Vr.prototype._parseIndexSyntax=Hs,Vr.prototype._parseStoresSpec=function(n,o){var u=this;c(n).forEach(function(l){if(n[l]!==null){var f=u._parseIndexSyntax(n[l]),h=f.shift();if(!h)throw new re.Schema("Invalid schema for table "+l+": "+n[l]);if(h.unique=!0,h.multi)throw new re.Schema("Primary key cannot be multiEntry*");f.forEach(function(y){if(y.auto)throw new re.Schema("Only primary key can be marked as autoIncrement (++)");if(!y.keyPath)throw new re.Schema("Index must have a name and cannot be an empty string")}),h=u._createTableSchema(l,h,f),o[l]=h}})},Vr.prototype.stores=function(u){var o=this.db,u=(this._cfg.storesSource=this._cfg.storesSource?p(this._cfg.storesSource,u):u,o._versions),l={},f={};return u.forEach(function(h){p(l,h._cfg.storesSource),f=h._cfg.dbschema={},h._parseStoresSpec(l,f)}),o._dbSchema=f,co(o,[o._allTables,o,o.Transaction.prototype]),Yn(o,[o._allTables,o,o.Transaction.prototype,this._cfg.tables],c(f),f),o._storeNames=c(f),this},Vr.prototype.upgrade=function(n){return this._cfg.contentUpgrade=an(this._cfg.contentUpgrade||N,n),this};var wd=Vr;function Vr(){}function ho(n,o){var u=n._dbNamesDB;return u||(u=n._dbNamesDB=new Vt(Ln,{addons:[],indexedDB:n,IDBKeyRange:o})).version(1).stores({dbnames:"name"}),u.table("dbnames")}function po(n){return n&&typeof n.databases=="function"}function mo(n){return Jt(function(){return me.letThrough=!0,n()})}function yo(n){return!("from"in n)}var mt=function(n,o){var u;if(!this)return u=new mt,n&&"d"in n&&p(u,n),u;p(this,arguments.length?{d:1,from:n,to:1<arguments.length?o:n}:{d:0})};function mn(n,o,u){var l=Pe(o,u);if(!isNaN(l)){if(0<l)throw RangeError();if(yo(n))return p(n,{from:o,to:u,d:1});var l=n.l,f=n.r;if(Pe(u,n.from)<0)return l?mn(l,o,u):n.l={from:o,to:u,d:1,l:null,r:null},Xs(n);if(0<Pe(o,n.to))return f?mn(f,o,u):n.r={from:o,to:u,d:1,l:null,r:null},Xs(n);Pe(o,n.from)<0&&(n.from=o,n.l=null,n.d=f?f.d+1:1),0<Pe(u,n.to)&&(n.to=u,n.r=null,n.d=n.l?n.l.d+1:1),o=!n.r,l&&!n.l&&yn(n,l),f&&o&&yn(n,f)}}function yn(n,o){yo(o)||(function u(l,f){var h=f.from,y=f.l,g=f.r;mn(l,h,f.to),y&&u(l,y),g&&u(l,g)})(n,o)}function Js(n,o){var u=Zn(o),l=u.next();if(!l.done)for(var f=l.value,h=Zn(n),y=h.next(f.from),g=y.value;!l.done&&!y.done;){if(Pe(g.from,f.to)<=0&&0<=Pe(g.to,f.from))return!0;Pe(f.from,g.from)<0?f=(l=u.next(g.from)).value:g=(y=h.next(f.from)).value}return!1}function Zn(n){var o=yo(n)?null:{s:0,n};return{next:function(u){for(var l=0<arguments.length;o;)switch(o.s){case 0:if(o.s=1,l)for(;o.n.l&&Pe(u,o.n.from)<0;)o={up:o,n:o.n.l,s:1};else for(;o.n.l;)o={up:o,n:o.n.l,s:1};case 1:if(o.s=2,!l||Pe(u,o.n.to)<=0)return{value:o.n,done:!1};case 2:if(o.n.r){o.s=3,o={up:o,n:o.n.r,s:0};continue}case 3:o=o.up}return{done:!0}}}}function Xs(n){var o,u,l,f=(((f=n.r)==null?void 0:f.d)||0)-(((f=n.l)==null?void 0:f.d)||0),f=1<f?"r":f<-1?"l":"";f&&(o=f=="r"?"l":"r",u=i({},n),l=n[f],n.from=l.from,n.to=l.to,n[f]=l[f],u[f]=l[o],(n[o]=u).d=Zs(u)),n.d=Zs(n)}function Zs(u){var o=u.r,u=u.l;return(o?u?Math.max(o.d,u.d):o.d:u?u.d:0)+1}function Qn(n,o){return c(o).forEach(function(u){n[u]?yn(n[u],o[u]):n[u]=(function l(f){var h,y,g={};for(h in f)b(f,h)&&(y=f[h],g[h]=!y||typeof y!="object"||ve.has(y.constructor)?y:l(y));return g})(o[u])}),n}function go(n,o){return n.all||o.all||Object.keys(n).some(function(u){return o[u]&&Js(o[u],n[u])})}S(mt.prototype,((_e={add:function(n){return yn(this,n),this},addKey:function(n){return mn(this,n,n),this},addKeys:function(n){var o=this;return n.forEach(function(u){return mn(o,u,u)}),this},hasKey:function(n){var o=Zn(this).next(n).value;return o&&Pe(o.from,n)<=0&&0<=Pe(o.to,n)}})[Te]=function(){return Zn(this)},_e));var pr={},vo={},bo=!1;function ei(n){Qn(vo,n),bo||(bo=!0,setTimeout(function(){bo=!1,_o(vo,!(vo={}))},0))}function _o(n,o){o===void 0&&(o=!1);var u=new Set;if(n.all)for(var l=0,f=Object.values(pr);l<f.length;l++)Qs(g=f[l],n,u,o);else for(var h in n){var y,g,h=/^idb\:\/\/(.*)\/(.*)\//.exec(h);h&&(y=h[1],h=h[2],g=pr["idb://".concat(y,"/").concat(h)])&&Qs(g,n,u,o)}u.forEach(function(T){return T()})}function Qs(n,o,u,l){for(var f=[],h=0,y=Object.entries(n.queries.query);h<y.length;h++){for(var g=y[h],T=g[0],D=[],C=0,w=g[1];C<w.length;C++){var j=w[C];go(o,j.obsSet)?j.subscribers.forEach(function(F){return u.add(F)}):l&&D.push(j)}l&&f.push([T,D])}if(l)for(var $=0,O=f;$<O.length;$++){var E=O[$],T=E[0],D=E[1];n.queries.query[T]=D}}function Ed(n){var o=n._state,u=n._deps.indexedDB;if(o.isBeingOpened||n.idbdb)return o.dbReadyPromise.then(function(){return o.dbOpenError?at(o.dbOpenError):n});o.isBeingOpened=!0,o.dbOpenError=null,o.openComplete=!1;var l=o.openCanceller,f=Math.round(10*n.verno),h=!1;function y(){if(o.openCanceller!==l)throw new re.DatabaseClosed("db.open() was cancelled")}function g(){return new ue(function(j,$){if(y(),!u)throw new re.MissingAPI;var O=n.name,E=o.autoSchema||!f?u.open(O):u.open(O,f);if(!E)throw new re.MissingAPI;E.onerror=It($),E.onblocked=Xe(n._fireOnBlocked),E.onupgradeneeded=Xe(function(F){var B;C=E.transaction,o.autoSchema&&!n._options.allowEmptyDB?(E.onerror=fn,C.abort(),E.result.close(),(B=u.deleteDatabase(O)).onsuccess=B.onerror=Xe(function(){$(new re.NoSuchDatabase("Database ".concat(O," doesnt exist")))})):(C.onerror=It($),B=F.oldVersion>Math.pow(2,62)?0:F.oldVersion,w=B<1,n.idbdb=E.result,h&&Sd(n,C),xd(n,B/10,C,$))},$),E.onsuccess=Xe(function(){C=null;var F,B,I,z,Z,oe,ae=n.idbdb=E.result,Q=H(ae.objectStoreNames);if(0<Q.length)try{var fe=ae.transaction((Z=Q).length===1?Z[0]:Z,"readonly");if(o.autoSchema)oe=ae,z=fe,(I=n).verno=oe.version/10,z=I._dbSchema=Jn(0,oe,z),I._storeNames=H(oe.objectStoreNames,0),Yn(I,[I._allTables],c(z),z);else if(Xn(n,n._dbSchema,fe),B=fe,((B=lo(Jn(0,(F=n).idbdb,B),F._dbSchema)).add.length||B.change.some(function(le){return le.add.length||le.change.length}))&&!h)return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."),ae.close(),f=ae.version+1,h=!0,j(g());Wn(n,fe)}catch{}Br.push(n),ae.onversionchange=Xe(function(le){o.vcFired=!0,n.on("versionchange").fire(le)}),ae.onclose=Xe(function(){n.close({disableAutoOpen:!1})}),w&&(Q=n._deps,Z=O,po(oe=Q.indexedDB)||Z===Ln||ho(oe,Q.IDBKeyRange).put({name:Z}).catch(N)),j()},$)}).catch(function(j){switch(j==null?void 0:j.name){case"UnknownError":if(0<o.PR1398_maxLoop)return o.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),g();break;case"VersionError":if(0<f)return f=0,g()}return ue.reject(j)})}var T,D=o.dbReadyResolve,C=null,w=!1;return ue.race([l,(typeof navigator>"u"?ue.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(j){function $(){return indexedDB.databases().finally(j)}T=setInterval($,100),$()}).finally(function(){return clearInterval(T)}):Promise.resolve()).then(g)]).then(function(){return y(),o.onReadyBeingFired=[],ue.resolve(mo(function(){return n.on.ready.fire(n.vip)})).then(function j(){var $;if(0<o.onReadyBeingFired.length)return $=o.onReadyBeingFired.reduce(an,N),o.onReadyBeingFired=[],ue.resolve(mo(function(){return $(n.vip)})).then(j)})}).finally(function(){o.openCanceller===l&&(o.onReadyBeingFired=null,o.isBeingOpened=!1)}).catch(function(j){o.dbOpenError=j;try{C&&C.abort()}catch{}return l===o.openCanceller&&n._close(),at(j)}).finally(function(){o.openComplete=!0,D()}).then(function(){var j;return w&&(j={},n.tables.forEach(function($){$.schema.indexes.forEach(function(O){O.name&&(j["idb://".concat(n.name,"/").concat($.name,"/").concat(O.name)]=new mt(-1/0,[[[]]]))}),j["idb://".concat(n.name,"/").concat($.name,"/")]=j["idb://".concat(n.name,"/").concat($.name,"/:dels")]=new mt(-1/0,[[[]]])}),er(dn).fire(j),_o(j,!0)),n})}function xo(n){function o(h){return n.next(h)}var u=f(o),l=f(function(h){return n.throw(h)});function f(h){return function(g){var g=h(g),T=g.value;return g.done?T:T&&typeof T.then=="function"?T.then(u,l):d(T)?Promise.all(T).then(u,l):u(T)}}return f(o)()}function ti(n,o,u){for(var l=d(n)?n.slice():[n],f=0;f<u;++f)l.push(o);return l}var Td={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(n){return i(i({},n),{table:function(l){var u=n.table(l),l=u.schema,f={},h=[];function y(j,$,O){var I=pn(j),E=f[I]=f[I]||[],F=j==null?0:typeof j=="string"?1:j.length,B=0<$,I=i(i({},O),{name:B?"".concat(I,"(virtual-from:").concat(O.name,")"):O.name,lowLevelIndex:O,isVirtual:B,keyTail:$,keyLength:F,extractKey:uo(j),unique:!B&&O.unique});return E.push(I),I.isPrimaryKey||h.push(I),1<F&&y(F===2?j[0]:j.slice(0,F-1),$+1,O),E.sort(function(z,Z){return z.keyTail-Z.keyTail}),I}var g=y(l.primaryKey.keyPath,0,l.primaryKey);f[":id"]=[g];for(var T=0,D=l.indexes;T<D.length;T++){var C=D[T];y(C.keyPath,0,C)}function w(j){var $,O=j.query.index;return O.isVirtual?i(i({},j),{query:{index:O.lowLevelIndex,range:($=j.query.range,O=O.keyTail,{type:$.type===1?2:$.type,lower:ti($.lower,$.lowerOpen?n.MAX_KEY:n.MIN_KEY,O),lowerOpen:!0,upper:ti($.upper,$.upperOpen?n.MIN_KEY:n.MAX_KEY,O),upperOpen:!0})}}):j}return i(i({},u),{schema:i(i({},l),{primaryKey:g,indexes:h,getIndexByKeyPath:function(j){return(j=f[pn(j)])&&j[0]}}),count:function(j){return u.count(w(j))},query:function(j){return u.query(w(j))},openCursor:function(j){var $=j.query.index,O=$.keyTail,E=$.keyLength;return $.isVirtual?u.openCursor(w(j)).then(function(B){return B&&F(B)}):u.openCursor(j);function F(B){return Object.create(B,{continue:{value:function(I){I!=null?B.continue(ti(I,j.reverse?n.MAX_KEY:n.MIN_KEY,O)):j.unique?B.continue(B.key.slice(0,E).concat(j.reverse?n.MIN_KEY:n.MAX_KEY,O)):B.continue()}},continuePrimaryKey:{value:function(I,z){B.continuePrimaryKey(ti(I,n.MAX_KEY,O),z)}},primaryKey:{get:function(){return B.primaryKey}},key:{get:function(){var I=B.key;return E===1?I[0]:I.slice(0,E)}},value:{get:function(){return B.value}}})}}})}})}};function So(n,o,u,l){return u=u||{},l=l||"",c(n).forEach(function(f){var h,y,g;b(o,f)?(h=n[f],y=o[f],typeof h=="object"&&typeof y=="object"&&h&&y?(g=ge(h))!==ge(y)?u[l+f]=o[f]:g==="Object"?So(h,y,u,l+f+"."):h!==y&&(u[l+f]=o[f]):h!==y&&(u[l+f]=o[f])):u[l+f]=void 0}),c(o).forEach(function(f){b(n,f)||(u[l+f]=o[f])}),u}function wo(n,o){return o.type==="delete"?o.keys:o.keys||o.values.map(n.extractKey)}var Cd={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(n){return i(i({},n),{table:function(o){var u=n.table(o),l=u.schema.primaryKey;return i(i({},u),{mutate:function(f){var h=me.trans,y=h.table(o).hook,g=y.deleting,T=y.creating,D=y.updating;switch(f.type){case"add":if(T.fire===N)break;return h._promise("readwrite",function(){return C(f)},!0);case"put":if(T.fire===N&&D.fire===N)break;return h._promise("readwrite",function(){return C(f)},!0);case"delete":if(g.fire===N)break;return h._promise("readwrite",function(){return C(f)},!0);case"deleteRange":if(g.fire===N)break;return h._promise("readwrite",function(){return(function w(j,$,O){return u.query({trans:j,values:!1,query:{index:l,range:$},limit:O}).then(function(E){var F=E.result;return C({type:"delete",keys:F,trans:j}).then(function(B){return 0<B.numFailures?Promise.reject(B.failures[0]):F.length<O?{failures:[],numFailures:0,lastResult:void 0}:w(j,i(i({},$),{lower:F[F.length-1],lowerOpen:!0}),O)})})})(f.trans,f.range,1e4)},!0)}return u.mutate(f);function C(w){var j,$,O,E=me.trans,F=w.keys||wo(l,w);if(F)return(w=w.type==="add"||w.type==="put"?i(i({},w),{keys:F}):i({},w)).type!=="delete"&&(w.values=a([],w.values)),w.keys&&(w.keys=a([],w.keys)),j=u,O=F,(($=w).type==="add"?Promise.resolve([]):j.getMany({trans:$.trans,keys:O,cache:"immutable"})).then(function(B){var I=F.map(function(z,Z){var oe,ae,Q,fe=B[Z],le={onerror:null,onsuccess:null};return w.type==="delete"?g.fire.call(le,z,fe,E):w.type==="add"||fe===void 0?(oe=T.fire.call(le,z,w.values[Z],E),z==null&&oe!=null&&(w.keys[Z]=z=oe,l.outbound||X(w.values[Z],l.keyPath,z))):(oe=So(fe,w.values[Z]),(ae=D.fire.call(le,oe,z,fe,E))&&(Q=w.values[Z],Object.keys(ae).forEach(function(ne){b(Q,ne)?Q[ne]=ae[ne]:X(Q,ne,ae[ne])}))),le});return u.mutate(w).then(function(z){for(var Z=z.failures,oe=z.results,ae=z.numFailures,z=z.lastResult,Q=0;Q<F.length;++Q){var fe=(oe||F)[Q],le=I[Q];fe==null?le.onerror&&le.onerror(Z[Q]):le.onsuccess&&le.onsuccess(w.type==="put"&&B[Q]?w.values[Q]:fe)}return{failures:Z,results:oe,numFailures:ae,lastResult:z}}).catch(function(z){return I.forEach(function(Z){return Z.onerror&&Z.onerror(z)}),Promise.reject(z)})});throw new Error("Keys missing")}}})}})}};function eu(n,o,u){try{if(!o||o.keys.length<n.length)return null;for(var l=[],f=0,h=0;f<o.keys.length&&h<n.length;++f)Pe(o.keys[f],n[h])===0&&(l.push(u?ee(o.values[f]):o.values[f]),++h);return l.length===n.length?l:null}catch{return null}}var Od={stack:"dbcore",level:-1,create:function(n){return{table:function(o){var u=n.table(o);return i(i({},u),{getMany:function(l){var f;return l.cache?(f=eu(l.keys,l.trans._cache,l.cache==="clone"))?ue.resolve(f):u.getMany(l).then(function(h){return l.trans._cache={keys:l.keys,values:l.cache==="clone"?ee(h):h},h}):u.getMany(l)},mutate:function(l){return l.type!=="add"&&(l.trans._cache=null),u.mutate(l)}})}}}};function tu(n,o){return n.trans.mode==="readonly"&&!!n.subscr&&!n.trans.explicit&&n.trans.db._options.cache!=="disabled"&&!o.schema.primaryKey.outbound}function ru(n,o){switch(n){case"query":return o.values&&!o.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var Ad={stack:"dbcore",level:0,name:"Observability",create:function(n){var o=n.schema.name,u=new mt(n.MIN_KEY,n.MAX_KEY);return i(i({},n),{transaction:function(l,f,h){if(me.subscr&&f!=="readonly")throw new re.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(me.querier));return n.transaction(l,f,h)},table:function(l){function f(F){var E,F=F.query;return[E=F.index,new mt((E=(F=F.range).lower)!=null?E:n.MIN_KEY,(E=F.upper)!=null?E:n.MAX_KEY)]}var h=n.table(l),y=h.schema,g=y.primaryKey,T=y.indexes,D=g.extractKey,C=g.outbound,w=g.autoIncrement&&T.filter(function(O){return O.compound&&O.keyPath.includes(g.keyPath)}),j=i(i({},h),{mutate:function(O){function E(de){return de="idb://".concat(o,"/").concat(l,"/").concat(de),Z[de]||(Z[de]=new mt)}var F,B,I,z=O.trans,Z=O.mutatedParts||(O.mutatedParts={}),oe=E(""),ae=E(":dels"),Q=O.type,le=O.type==="deleteRange"?[O.range]:O.type==="delete"?[O.keys]:O.values.length<50?[wo(g,O).filter(function(de){return de}),O.values]:[],fe=le[0],le=le[1],ne=O.trans._cache;return d(fe)?(oe.addKeys(fe),(Q=Q==="delete"||fe.length===le.length?eu(fe,ne):null)||ae.addKeys(fe),(Q||le)&&(F=E,B=Q,I=le,y.indexes.forEach(function(de){var Re=F(de.name||"");function De($e){return $e!=null?de.extractKey($e):null}function Se($e){de.multiEntry&&d($e)?$e.forEach(function(tt){return Re.addKey(tt)}):Re.addKey($e)}(B||I).forEach(function($e,nt){var Ct=B&&De(B[nt]),nt=I&&De(I[nt]);Pe(Ct,nt)!==0&&(Ct!=null&&Se(Ct),nt!=null)&&Se(nt)})}))):fe?(le={from:(ne=fe.lower)!=null?ne:n.MIN_KEY,to:(Q=fe.upper)!=null?Q:n.MAX_KEY},ae.add(le),oe.add(le)):(oe.add(u),ae.add(u),y.indexes.forEach(function(de){return E(de.name).add(u)})),h.mutate(O).then(function(de){return!fe||O.type!=="add"&&O.type!=="put"||(oe.addKeys(de.results),w&&w.forEach(function(Re){for(var De=O.values.map(function(Ct){return Re.extractKey(Ct)}),Se=Re.keyPath.findIndex(function(Ct){return Ct===g.keyPath}),$e=0,tt=de.results.length;$e<tt;++$e)De[$e][Se]=de.results[$e];E(Re.name).addKeys(De)})),z.mutatedParts=Qn(z.mutatedParts||{},Z),de})}}),$={get:function(O){return[g,new mt(O.key)]},getMany:function(O){return[g,new mt().addKeys(O.keys)]},count:f,query:f,openCursor:f};return c($).forEach(function(O){j[O]=function(E){var F=me.subscr,B=!!F,I=tu(me,h)&&ru(O,E)?E.obsSet={}:F;if(B){var z,F=function(le){return le="idb://".concat(o,"/").concat(l,"/").concat(le),I[le]||(I[le]=new mt)},Z=F(""),oe=F(":dels"),B=$[O](E),ae=B[0],B=B[1];if((O==="query"&&ae.isPrimaryKey&&!E.values?oe:F(ae.name||"")).add(B),!ae.isPrimaryKey){if(O!=="count")return z=O==="query"&&C&&E.values&&h.query(i(i({},E),{values:!1})),h[O].apply(this,arguments).then(function(le){if(O==="query"){if(C&&E.values)return z.then(function(De){return De=De.result,Z.addKeys(De),le});var ne=E.values?le.result.map(D):le.result;(E.values?Z:oe).addKeys(ne)}else{var de,Re;if(O==="openCursor")return Re=E.values,(de=le)&&Object.create(de,{key:{get:function(){return oe.addKey(de.primaryKey),de.key}},primaryKey:{get:function(){var De=de.primaryKey;return oe.addKey(De),De}},value:{get:function(){return Re&&Z.addKey(de.primaryKey),de.value}}})}return le});oe.add(u)}}return h[O].apply(this,arguments)}}),j}})}};function nu(n,o,u){var l;return u.numFailures===0?o:o.type==="deleteRange"||(l=o.keys?o.keys.length:"values"in o&&o.values?o.values.length:1,u.numFailures===l)?null:(l=i({},o),d(l.keys)&&(l.keys=l.keys.filter(function(f,h){return!(h in u.failures)})),"values"in l&&d(l.values)&&(l.values=l.values.filter(function(f,h){return!(h in u.failures)})),l)}function Eo(n,o){return u=n,((l=o).lower===void 0||(l.lowerOpen?0<Pe(u,l.lower):0<=Pe(u,l.lower)))&&(u=n,(l=o).upper===void 0||(l.upperOpen?Pe(u,l.upper)<0:Pe(u,l.upper)<=0));var u,l}function iu(n,o,u,l,f,h){var y,g,T,D,C,w;return!u||u.length===0||(y=o.query.index,g=y.multiEntry,T=o.query.range,D=l.schema.primaryKey.extractKey,C=y.extractKey,w=(y.lowLevelIndex||y).extractKey,(l=u.reduce(function(j,$){var O=j,E=[];if($.type==="add"||$.type==="put")for(var F=new mt,B=$.values.length-1;0<=B;--B){var I,z=$.values[B],Z=D(z);!F.hasKey(Z)&&(I=C(z),g&&d(I)?I.some(function(le){return Eo(le,T)}):Eo(I,T))&&(F.addKey(Z),E.push(z))}switch($.type){case"add":var oe=new mt().addKeys(o.values?j.map(function(ne){return D(ne)}):j),O=j.concat(o.values?E.filter(function(ne){return ne=D(ne),!oe.hasKey(ne)&&(oe.addKey(ne),!0)}):E.map(function(ne){return D(ne)}).filter(function(ne){return!oe.hasKey(ne)&&(oe.addKey(ne),!0)}));break;case"put":var ae=new mt().addKeys($.values.map(function(ne){return D(ne)}));O=j.filter(function(ne){return!ae.hasKey(o.values?D(ne):ne)}).concat(o.values?E:E.map(function(ne){return D(ne)}));break;case"delete":var Q=new mt().addKeys($.keys);O=j.filter(function(ne){return!Q.hasKey(o.values?D(ne):ne)});break;case"deleteRange":var fe=$.range;O=j.filter(function(ne){return!Eo(D(ne),fe)})}return O},n))===n)?n:(l.sort(function(j,$){return Pe(w(j),w($))||Pe(D(j),D($))}),o.limit&&o.limit<1/0&&(l.length>o.limit?l.length=o.limit:n.length===o.limit&&l.length<o.limit&&(f.dirty=!0)),h?Object.freeze(l):l)}function ou(n,o){return Pe(n.lower,o.lower)===0&&Pe(n.upper,o.upper)===0&&!!n.lowerOpen==!!o.lowerOpen&&!!n.upperOpen==!!o.upperOpen}function jd(n,o){return((u,l,f,h)=>{if(u===void 0)return l!==void 0?-1:0;if(l===void 0)return 1;if((u=Pe(u,l))===0){if(f&&h)return 0;if(f)return 1;if(h)return-1}return u})(n.lower,o.lower,n.lowerOpen,o.lowerOpen)<=0&&0<=((u,l,f,h)=>{if(u===void 0)return l!==void 0?1:0;if(l===void 0)return-1;if((u=Pe(u,l))===0){if(f&&h)return 0;if(f)return-1;if(h)return 1}return u})(n.upper,o.upper,n.upperOpen,o.upperOpen)}function $d(n,o,u,l){n.subscribers.add(u),l.addEventListener("abort",function(){var f,h;n.subscribers.delete(u),n.subscribers.size===0&&(f=n,h=o,setTimeout(function(){f.subscribers.size===0&&Ke(h,f)},3e3))})}var kd={stack:"dbcore",level:0,name:"Cache",create:function(n){var o=n.schema.name;return i(i({},n),{transaction:function(u,l,f){var h,y,g=n.transaction(u,l,f);return l==="readwrite"&&(f=(h=new AbortController).signal,g.addEventListener("abort",(y=function(T){return function(){if(h.abort(),l==="readwrite"){for(var D=new Set,C=0,w=u;C<w.length;C++){var j=w[C],$=pr["idb://".concat(o,"/").concat(j)];if($){var O=n.table(j),E=$.optimisticOps.filter(function(de){return de.trans===g});if(g._explicit&&T&&g.mutatedParts)for(var F=0,B=Object.values($.queries.query);F<B.length;F++)for(var I=0,z=(ae=B[F]).slice();I<z.length;I++)go((Q=z[I]).obsSet,g.mutatedParts)&&(Ke(ae,Q),Q.subscribers.forEach(function(de){return D.add(de)}));else if(0<E.length){$.optimisticOps=$.optimisticOps.filter(function(de){return de.trans!==g});for(var Z=0,oe=Object.values($.queries.query);Z<oe.length;Z++)for(var ae,Q,fe,le=0,ne=(ae=oe[Z]).slice();le<ne.length;le++)(Q=ne[le]).res!=null&&g.mutatedParts&&(T&&!Q.dirty?(fe=Object.isFrozen(Q.res),fe=iu(Q.res,Q.req,E,O,Q,fe),Q.dirty?(Ke(ae,Q),Q.subscribers.forEach(function(de){return D.add(de)})):fe!==Q.res&&(Q.res=fe,Q.promise=ue.resolve({result:fe}))):(Q.dirty&&Ke(ae,Q),Q.subscribers.forEach(function(de){return D.add(de)})))}}}D.forEach(function(de){return de()})}}})(!1),{signal:f}),g.addEventListener("error",y(!1),{signal:f}),g.addEventListener("complete",y(!0),{signal:f})),g},table:function(u){var l=n.table(u),f=l.schema.primaryKey;return i(i({},l),{mutate:function(h){var y,g=me.trans;return!f.outbound&&g.db._options.cache!=="disabled"&&!g.explicit&&g.idbtrans.mode==="readwrite"&&(y=pr["idb://".concat(o,"/").concat(u)])?(g=l.mutate(h),h.type!=="add"&&h.type!=="put"||!(50<=h.values.length||wo(f,h).some(function(T){return T==null}))?(y.optimisticOps.push(h),h.mutatedParts&&ei(h.mutatedParts),g.then(function(T){0<T.numFailures&&(Ke(y.optimisticOps,h),(T=nu(0,h,T))&&y.optimisticOps.push(T),h.mutatedParts)&&ei(h.mutatedParts)}),g.catch(function(){Ke(y.optimisticOps,h),h.mutatedParts&&ei(h.mutatedParts)})):g.then(function(T){var D=nu(0,i(i({},h),{values:h.values.map(function(C,w){var j;return T.failures[w]?C:(X(j=(j=f.keyPath)!=null&&j.includes(".")?ee(C):i({},C),f.keyPath,T.results[w]),j)})}),T);y.optimisticOps.push(D),queueMicrotask(function(){return h.mutatedParts&&ei(h.mutatedParts)})}),g):l.mutate(h)},query:function(h){var y,g,T,D,C,w,j;return tu(me,l)&&ru("query",h)?(y=((T=me.trans)==null?void 0:T.db._options.cache)==="immutable",g=(T=me).requery,T=T.signal,w=(($,O,E,F)=>{var B=pr["idb://".concat($,"/").concat(O)];if(!B)return[];if(!($=B.queries[E]))return[null,!1,B,null];var I=$[(F.query?F.query.index.name:null)||""];if(!I)return[null,!1,B,null];switch(E){case"query":var z=I.find(function(Z){return Z.req.limit===F.limit&&Z.req.values===F.values&&ou(Z.req.query.range,F.query.range)});return z?[z,!0,B,I]:[I.find(function(Z){return("limit"in Z.req?Z.req.limit:1/0)>=F.limit&&(!F.values||Z.req.values)&&jd(Z.req.query.range,F.query.range)}),!1,B,I];case"count":return z=I.find(function(Z){return ou(Z.req.query.range,F.query.range)}),[z,!!z,B,I]}})(o,u,"query",h),j=w[0],D=w[2],C=w[3],j&&w[1]?j.obsSet=h.obsSet:(w=l.query(h).then(function($){var O=$.result;if(j&&(j.res=O),y){for(var E=0,F=O.length;E<F;++E)Object.freeze(O[E]);Object.freeze(O)}else $.result=ee(O);return $}).catch(function($){return C&&j&&Ke(C,j),Promise.reject($)}),j={obsSet:h.obsSet,promise:w,subscribers:new Set,type:"query",req:h,dirty:!1},C?C.push(j):(C=[j],(D=D||(pr["idb://".concat(o,"/").concat(u)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[h.query.index.name||""]=C)),$d(j,C,g,T),j.promise.then(function($){return{result:iu($.result,h,D==null?void 0:D.optimisticOps,l,j,y)}})):l.query(h)}})}})}};function ri(n,o){return new Proxy(n,{get:function(u,l,f){return l==="db"?o:Reflect.get(u,l,f)}})}st.prototype.version=function(n){if(isNaN(n)||n<.1)throw new re.Type("Given version is not a positive number");if(n=Math.round(10*n)/10,this.idbdb||this._state.isBeingOpened)throw new re.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,n);var o=this._versions,u=o.filter(function(l){return l._cfg.version===n})[0];return u||(u=new this.Version(n),o.push(u),o.sort(_d),u.stores({}),this._state.autoSchema=!1),u},st.prototype._whenReady=function(n){var o=this;return this.idbdb&&(this._state.openComplete||me.letThrough||this._vip)?n():new ue(function(u,l){if(o._state.openComplete)return l(new re.DatabaseClosed(o._state.dbOpenError));if(!o._state.isBeingOpened){if(!o._state.autoOpen)return void l(new re.DatabaseClosed);o.open().catch(N)}o._state.dbReadyPromise.then(u,l)}).then(n)},st.prototype.use=function(f){var o=f.stack,u=f.create,l=f.level,f=f.name,h=(f&&this.unuse({stack:o,name:f}),this._middlewares[o]||(this._middlewares[o]=[]));return h.push({stack:o,create:u,level:l??10,name:f}),h.sort(function(y,g){return y.level-g.level}),this},st.prototype.unuse=function(n){var o=n.stack,u=n.name,l=n.create;return o&&this._middlewares[o]&&(this._middlewares[o]=this._middlewares[o].filter(function(f){return l?f.create!==l:!!u&&f.name!==u})),this},st.prototype.open=function(){var n=this;return fr(Rt,function(){return Ed(n)})},st.prototype._close=function(){this.on.close.fire(new CustomEvent("close"));var n=this._state,o=Br.indexOf(this);if(0<=o&&Br.splice(o,1),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}n.isBeingOpened||(n.dbReadyPromise=new ue(function(u){n.dbReadyResolve=u}),n.openCanceller=new ue(function(u,l){n.cancelOpen=l}))},st.prototype.close=function(o){var o=(o===void 0?{disableAutoOpen:!0}:o).disableAutoOpen,u=this._state;o?(u.isBeingOpened&&u.cancelOpen(new re.DatabaseClosed),this._close(),u.autoOpen=!1,u.dbOpenError=new re.DatabaseClosed):(this._close(),u.autoOpen=this._options.autoOpen||u.isBeingOpened,u.openComplete=!1,u.dbOpenError=null)},st.prototype.delete=function(n){var o=this,u=(n===void 0&&(n={disableAutoOpen:!0}),0<arguments.length&&typeof arguments[0]!="object"),l=this._state;return new ue(function(f,h){function y(){o.close(n);var g=o._deps.indexedDB.deleteDatabase(o.name);g.onsuccess=Xe(function(){var T,D,C;T=o._deps,D=o.name,po(C=T.indexedDB)||D===Ln||ho(C,T.IDBKeyRange).delete(D).catch(N),f()}),g.onerror=It(h),g.onblocked=o._fireOnBlocked}if(u)throw new re.InvalidArgument("Invalid closeOptions argument to db.delete()");l.isBeingOpened?l.dbReadyPromise.then(y):y()})},st.prototype.backendDB=function(){return this.idbdb},st.prototype.isOpen=function(){return this.idbdb!==null},st.prototype.hasBeenClosed=function(){var n=this._state.dbOpenError;return n&&n.name==="DatabaseClosed"},st.prototype.hasFailed=function(){return this._state.dbOpenError!==null},st.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(st.prototype,"tables",{get:function(){var n=this;return c(this._allTables).map(function(o){return n._allTables[o]})},enumerable:!1,configurable:!0}),st.prototype.transaction=function(){var n=(function(o,u,l){var f=arguments.length;if(f<2)throw new re.InvalidArgument("Too few arguments");for(var h=new Array(f-1);--f;)h[f-1]=arguments[f];return l=h.pop(),[o,Ge(h),l]}).apply(this,arguments);return this._transaction.apply(this,n)},st.prototype._transaction=function(n,o,u){var l,f,h=this,y=me.trans,g=(y&&y.db===this&&n.indexOf("!")===-1||(y=null),n.indexOf("?")!==-1);n=n.replace("!","").replace("?","");try{if(f=o.map(function(D){if(D=D instanceof h.Table?D.name:D,typeof D!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return D}),n=="r"||n===to)l=to;else{if(n!="rw"&&n!=ro)throw new re.InvalidArgument("Invalid transaction mode: "+n);l=ro}if(y){if(y.mode===to&&l===ro){if(!g)throw new re.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");y=null}y&&f.forEach(function(D){if(y&&y.storeNames.indexOf(D)===-1){if(!g)throw new re.SubTransaction("Table "+D+" not included in parent transaction.");y=null}}),g&&y&&!y.active&&(y=null)}}catch(D){return y?y._promise(null,function(C,w){w(D)}):at(D)}var T=(function D(C,w,j,$,O){return ue.resolve().then(function(){var I=me.transless||me,E=C._createTransaction(w,j,C._dbSchema,$),I=(E.explicit=!0,{trans:E,transless:I});if($)E.idbtrans=$.idbtrans;else try{E.create(),E.idbtrans._explicit=!0,C._state.PR1398_maxLoop=3}catch(z){return z.name===Ae.InvalidState&&C.isOpen()&&0<--C._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),C.close({disableAutoOpen:!1}),C.open().then(function(){return D(C,w,j,null,O)})):at(z)}var F,B=ce(O),I=(B&&Nr(),ue.follow(function(){var z;(F=O.call(E,E))&&(B?(z=Xt.bind(null,null),F.then(z,z)):typeof F.next=="function"&&typeof F.throw=="function"&&(F=xo(F)))},I));return(F&&typeof F.then=="function"?ue.resolve(F).then(function(z){return E.active?z:at(new re.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):I.then(function(){return F})).then(function(z){return $&&E._resolve(),E._completion.then(function(){return z})}).catch(function(z){return E._reject(z),at(z)})})}).bind(null,this,l,f,y,u);return y?y._promise(l,T,"lock"):me.trans?fr(me.transless,function(){return h._whenReady(T)}):this._whenReady(T)},st.prototype.table=function(n){if(b(this._allTables,n))return this._allTables[n];throw new re.InvalidTable("Table ".concat(n," does not exist"))};var Vt=st;function st(n,o){var u,l,f,h,y,g=this,T=(this._middlewares={},this.verno=0,st.dependencies),T=(this._options=o=i({addons:st.addons,autoOpen:!0,indexedDB:T.indexedDB,IDBKeyRange:T.IDBKeyRange,cache:"cloned"},o),this._deps={indexedDB:o.indexedDB,IDBKeyRange:o.IDBKeyRange},o.addons),D=(this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this,{dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:N,dbReadyPromise:null,cancelOpen:N,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:o.autoOpen}),C=(D.dbReadyPromise=new ue(function(w){D.dbReadyResolve=w}),D.openCanceller=new ue(function(w,j){D.cancelOpen=j}),this._state=D,this.name=n,this.on=cn(this,"populate","blocked","versionchange","close",{ready:[an,N]}),this.once=function(w,j){var $=function(){for(var O=[],E=0;E<arguments.length;E++)O[E]=arguments[E];g.on(w).unsubscribe($),j.apply(g,O)};return g.on(w,$)},this.on.ready.subscribe=G(this.on.ready.subscribe,function(w){return function(j,$){st.vip(function(){var O,E=g._state;E.openComplete?(E.dbOpenError||ue.resolve().then(j),$&&w(j)):E.onReadyBeingFired?(E.onReadyBeingFired.push(j),$&&w(j)):(w(j),O=g,$||w(function F(){O.on.ready.unsubscribe(j),O.on.ready.unsubscribe(F)}))})}}),this.Collection=(u=this,ln(hd.prototype,function(F,E){this.db=u;var $=Is,O=null;if(E)try{$=E()}catch(I){O=I}var E=F._ctx,F=E.table,B=F.hook.reading.fire;this._ctx={table:F,index:E.index,isPrimKey:!E.index||F.schema.primKey.keyPath&&E.index===F.schema.primKey.name,range:$,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:O,or:E.or,valueMapper:B!==et?B:null}})),this.Table=(l=this,ln(qs.prototype,function(w,j,$){this.db=l,this._tx=$,this.name=w,this.schema=j,this.hook=l._allTables[w]?l._allTables[w].hook:cn(null,{creating:[Wi,N],reading:[xt,et],updating:[Hi,N],deleting:[Yi,N]})})),this.Transaction=(f=this,ln(yd.prototype,function(w,j,$,O,E){var F=this;w!=="readonly"&&j.forEach(function(B){B=(B=$[B])==null?void 0:B.yProps,B&&(j=j.concat(B.map(function(I){return I.updatesTable})))}),this.db=f,this.mode=w,this.storeNames=j,this.schema=$,this.chromeTransactionDurability=O,this.idbtrans=null,this.on=cn(this,"complete","error","abort"),this.parent=E||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new ue(function(B,I){F._resolve=B,F._reject=I}),this._completion.then(function(){F.active=!1,F.on.complete.fire()},function(B){var I=F.active;return F.active=!1,F.on.error.fire(B),F.parent?F.parent._reject(B):I&&F.idbtrans&&F.idbtrans.abort(),at(B)})})),this.Version=(h=this,ln(wd.prototype,function(w){this.db=h,this._cfg={version:w,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(y=this,ln(Us.prototype,function(w,j,$){if(this.db=y,this._ctx={table:w,index:j===":id"?null:j,or:$},this._cmp=this._ascending=Pe,this._descending=function(O,E){return Pe(E,O)},this._max=function(O,E){return 0<Pe(O,E)?O:E},this._min=function(O,E){return Pe(O,E)<0?O:E},this._IDBKeyRange=y._deps.IDBKeyRange,!this._IDBKeyRange)throw new re.MissingAPI})),this.on("versionchange",function(w){0<w.newVersion?console.warn("Another connection wants to upgrade database '".concat(g.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(g.name,"'. Closing db now to resume the delete request.")),g.close({disableAutoOpen:!1})}),this.on("blocked",function(w){!w.newVersion||w.newVersion<w.oldVersion?console.warn("Dexie.delete('".concat(g.name,"') was blocked")):console.warn("Upgrade '".concat(g.name,"' blocked by other connection holding version ").concat(w.oldVersion/10))}),this._maxKey=hn(o.IDBKeyRange),this._createTransaction=function(w,j,$,O){return new g.Transaction(w,j,$,g._options.chromeTransactionDurability,O)},this._fireOnBlocked=function(w){g.on("blocked").fire(w),Br.filter(function(j){return j.name===g.name&&j!==g&&!j._state.vcFired}).map(function(j){return j.on("versionchange").fire(w)})},this.use(Od),this.use(kd),this.use(Ad),this.use(Td),this.use(Cd),new Proxy(this,{get:function(w,j,$){var O;return j==="_vip"||(j==="table"?function(E){return ri(g.table(E),C)}:(O=Reflect.get(w,j,$))instanceof qs?ri(O,C):j==="tables"?O.map(function(E){return ri(E,C)}):j==="_createTransaction"?function(){return ri(O.apply(this,arguments),C)}:O)}}));this.vip=C,T.forEach(function(w){return w(g)})}var ni,Kr=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable",Pd=(To.prototype.subscribe=function(n,o,u){return this._subscribe(n&&typeof n!="function"?n:{next:n,error:o,complete:u})},To.prototype[Kr]=function(){return this},To);function To(n){this._subscribe=n}try{ni={indexedDB:s.indexedDB||s.mozIndexedDB||s.webkitIndexedDB||s.msIndexedDB,IDBKeyRange:s.IDBKeyRange||s.webkitIDBKeyRange}}catch{ni={indexedDB:null,IDBKeyRange:null}}function au(n){var o,u=!1,l=new Pd(function(f){var h=ce(n),y,g=!1,T={},D={},C={get closed(){return g},unsubscribe:function(){g||(g=!0,y&&y.abort(),w&&er.storagemutated.unsubscribe($))}},w=(f.start&&f.start(C),!1),j=function(){return eo(O)},$=function(E){Qn(T,E),go(D,T)&&j()},O=function(){var E,F,B;!g&&ni.indexedDB&&(T={},E={},y&&y.abort(),y=new AbortController,B=(I=>{var z=Fr();try{h&&Nr();var Z=Jt(n,I);return Z=h?Z.finally(Xt):Z}finally{z&&Mr()}})(F={subscr:E,signal:y.signal,requery:j,querier:n,trans:null}),Promise.resolve(B).then(function(I){u=!0,o=I,g||F.signal.aborted||(T={},(z=>{for(var Z in z)if(b(z,Z))return;return 1})(D=E)||w||(er(dn,$),w=!0),eo(function(){return!g&&f.next&&f.next(I)}))},function(I){u=!1,["DatabaseClosedError","AbortError"].includes(I==null?void 0:I.name)||g||eo(function(){g||f.error&&f.error(I)})}))};return setTimeout(j,0),C});return l.hasValue=function(){return u},l.getValue=function(){return o},l}var mr=Vt;function Co(n){var o=tr;try{tr=!0,er.storagemutated.fire(n),_o(n,!0)}finally{tr=o}}S(mr,i(i({},be),{delete:function(n){return new mr(n,{addons:[]}).delete()},exists:function(n){return new mr(n,{addons:[]}).open().then(function(o){return o.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(n){try{return o=mr.dependencies,u=o.indexedDB,o=o.IDBKeyRange,(po(u)?Promise.resolve(u.databases()).then(function(l){return l.map(function(f){return f.name}).filter(function(f){return f!==Ln})}):ho(u,o).toCollection().primaryKeys()).then(n)}catch{return at(new re.MissingAPI)}var o,u},defineClass:function(){return function(n){p(this,n)}},ignoreTransaction:function(n){return me.trans?fr(me.transless,n):n()},vip:mo,async:function(n){return function(){try{var o=xo(n.apply(this,arguments));return o&&typeof o.then=="function"?o:ue.resolve(o)}catch(u){return at(u)}}},spawn:function(n,o,u){try{var l=xo(n.apply(u,o||[]));return l&&typeof l.then=="function"?l:ue.resolve(l)}catch(f){return at(f)}},currentTransaction:{get:function(){return me.trans||null}},waitFor:function(n,o){return n=ue.resolve(typeof n=="function"?mr.ignoreTransaction(n):n).timeout(o||6e4),me.trans?me.trans.waitFor(n):n},Promise:ue,debug:{get:function(){return Tt},set:function(n){V(n)}},derive:_,extend:p,props:S,override:G,Events:cn,on:er,liveQuery:au,extendObservabilitySet:Qn,getByKeyPath:q,setByKeyPath:X,delByKeyPath:function(n,o){typeof o=="string"?X(n,o,void 0):"length"in o&&[].map.call(o,function(u){X(n,u,void 0)})},shallowClone:ie,deepClone:ee,getObjectDiff:So,cmp:Pe,asap:A,minKey:-1/0,addons:[],connections:Br,errnames:Ae,dependencies:ni,cache:pr,semVer:"4.3.0",version:"4.3.0".split(".").map(function(n){return parseInt(n)}).reduce(function(n,o,u){return n+o/Math.pow(10,2*u)})})),mr.maxKey=hn(mr.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(er(dn,function(n){tr||(n=new CustomEvent(oo,{detail:n}),tr=!0,dispatchEvent(n),tr=!1)}),addEventListener(oo,function(n){n=n.detail,tr||Co(n)}));var zr,tr=!1,su=function(){};return typeof BroadcastChannel<"u"&&((su=function(){(zr=new BroadcastChannel(oo)).onmessage=function(n){return n.data&&Co(n.data)}})(),typeof zr.unref=="function"&&zr.unref(),er(dn,function(n){tr||zr.postMessage(n)})),typeof addEventListener<"u"&&(addEventListener("pagehide",function(n){if(!Vt.disableBfCache&&n.persisted){Tt&&console.debug("Dexie: handling persisted pagehide"),zr!=null&&zr.close();for(var o=0,u=Br;o<u.length;o++)u[o].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(n){!Vt.disableBfCache&&n.persisted&&(Tt&&console.debug("Dexie: handling persisted pageshow"),su(),Co({all:new mt(-1/0,[[]])}))})),ue.rejectionMapper=function(n,o){return!n||n instanceof xe||n instanceof TypeError||n instanceof SyntaxError||!n.name||!Qe[n.name]?n:(o=new Qe[n.name](o||n.message,n),"stack"in n&&P(o,"stack",{get:function(){return this.inner.stack}}),o)},V(Tt),i(Vt,Object.freeze({__proto__:null,Dexie:Vt,Entity:Ds,PropModification:un,RangeSet:mt,add:function(n){return new un({add:n})},cmp:Pe,default:Vt,liveQuery:au,mergeRanges:yn,rangesOverlap:Js,remove:function(n){return new un({remove:n})},replacePrefix:function(n,o){return new un({replacePrefix:[n,o]})}}),{default:Vt}),Vt})})(yi)),yi.exports}var R_=P_();const is=$n(R_),Cl=Symbol.for("Dexie"),rn=globalThis[Cl]||(globalThis[Cl]=is);if(is.semVer!==rn.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${is.semVer} and ${rn.semVer}`);const{liveQuery:J_,mergeRanges:X_,rangesOverlap:Z_,RangeSet:Q_,cmp:ex,Entity:tx,PropModification:rx,replacePrefix:nx,add:ix,remove:ox,DexieYProvider:ax}=rn;class I_ extends rn{constructor(){super("chat_cache");gr(this,"summaries");gr(this,"users");gr(this,"messages");gr(this,"msgCursor");gr(this,"groups");this.version(1).stores({summaries:"id",users:"id",messages:"id, conversationId",msgCursor:"id",groups:"id"})}async clearData(){await Promise.all([this.summaries.clear(),this.users.clear(),this.messages.clear(),this.msgCursor.clear(),this.groups.clear()])}}const ct=new I_,Gi=({type:e,id:t})=>`${e}:${t}`,D_=({group:e,user:t})=>`${e?"group":"user"}:${e||t}`,F_=(e,t)=>e.group?`group:${e.group}`:`dm:${e.sender===t?e.receiver:e.sender}`,Wf=async e=>{const i=(await Pt().getMessagesSummary(e)).map(a=>({...a,id:D_(a)}));return await ct.summaries.bulkPut(i),i},Yf=async e=>{const r=await Pt().getGroups(e);return await ct.groups.clear(),await ct.groups.bulkPut(r),r};function M_(e,t,r){var i,a;typeof e=="function"?(i=t||[],a=r):(i=[],a=t);var s=Y.useRef({hasResult:!1,result:a,error:null}),c=Y.useReducer(function(m){return m+1},0);c[0];var d=c[1],p=Y.useMemo(function(){var m=typeof e=="function"?e():e;if(!m||typeof m.subscribe!="function")throw e===m?new TypeError("Given argument to useObservable() was neither a valid observable nor a function."):new TypeError("Observable factory given to useObservable() did not return a valid observable.");if(!s.current.hasResult&&typeof window<"u"&&(typeof m.hasValue!="function"||m.hasValue()))if(typeof m.getValue=="function")s.current.result=m.getValue(),s.current.hasResult=!0;else{var x=m.subscribe(function(b){s.current.result=b,s.current.hasResult=!0});typeof x=="function"?x():x.unsubscribe()}return m},i);if(Y.useDebugValue(s.current.result),Y.useEffect(function(){var m=p.subscribe(function(x){var b=s.current;(b.error!==null||b.result!==x)&&(b.error=null,b.result=x,b.hasResult=!0,d())},function(x){var b=s.current;b.error!==x&&(b.error=x,d())});return typeof m=="function"?m:m.unsubscribe.bind(m)},i),s.current.error)throw s.current.error;return s.current.result}function jn(e,t,r){return M_(function(){return rn.liveQuery(e)},t||[],r)}typeof FinalizationRegistry<"u"&&new FinalizationRegistry(function(e){var t=rn.DexieYProvider;t&&t.release(e)});const Hf=({selectedConversation:e,currentUser:t,onConversationSelect:r})=>{const[i,a]=Y.useState(!0),[s,c]=Y.useState(),[d,p]=Y.useState(!1),m=jn(()=>ct.summaries.toArray(),[e])||[],x=jn(()=>ct.groups.toArray(),[])||[],b=(t==null?void 0:t.role)==="admin"||(t==null?void 0:t.role)==="system",S=Y.useCallback(async()=>{a(!0),t!=null&&t.org&&(await Promise.all([Wf({}),Yf(t==null?void 0:t.org)]).catch(G=>{c(G instanceof Error?G:new Error(String(G)))}),a(!1))},[t==null?void 0:t.org]);Y.useEffect(()=>{S();const G=setInterval(S,3*6e4);return()=>clearInterval(G)},[S]);const[R,P]=Y.useState({});Y.useEffect(()=>{const G=async()=>{if(!(t!=null&&t.org))return;const W=Pt(),A={};for(const q of m)try{if(q.user!==void 0&&!R[q.user]){const X=await W.getUser(q.user);A[q.user]=X.name}}catch(X){console.error("Failed to load conversation name:",X)}Object.keys(A).length>0&&P(q=>({...q,...A}))};m.length>0&&(t!=null&&t.org)&&G()},[m,t==null?void 0:t.org]);const _=G=>{if(G.user!==void 0)return R[G.user]||`User ${G.user}`;if(G.group!==void 0){const W=x.find(A=>A.id===G.group);return(W==null?void 0:W.name)||`Group ${G.group}`}return"Unknown"},L=G=>e?G.group!==void 0?e.type==="group"&&e.id===G.group:G.user!==void 0?e.type==="dm"&&e.id===G.user:!1:!1,M=G=>{G.group!==void 0?r({type:"group",id:G.group,name:_(G)}):G.user!==void 0&&r({type:"dm",id:G.user,name:_(G)})},H=async()=>{await S()};return k.jsxs(U.Box,{display:"flex",flexDirection:"column",height:"100%",children:[k.jsx(U.AppBar,{position:"static",elevation:0,sx:{backgroundColor:"background.default",color:"text.primary"},children:k.jsxs(U.Toolbar,{children:[k.jsx(U.Typography,{variant:"h6",component:"div",sx:{flexGrow:1},children:"Messages"}),b&&k.jsx(U.Tooltip,{title:"Create Group",children:k.jsx(U.IconButton,{color:"primary",onClick:()=>p(!0),size:"small",sx:{mr:-2},children:k.jsx(_m,{})})})]})}),b&&(t==null?void 0:t.org)&&k.jsx(Gf,{open:d,onClose:()=>p(!1),onSuccess:H,orgId:t.org}),k.jsx(U.Box,{flex:1,overflow:"auto",children:i&&!m.length?k.jsx(U.List,{disablePadding:!0,children:[1,2,3,4,5].map(G=>k.jsx(ef,{},G))}):s?k.jsx(U.Box,{p:2,children:k.jsxs(U.Alert,{severity:"error",children:["Failed to load conversations: ",s.message]})}):m.length===0&&x.length===0?k.jsx(U.Box,{display:"flex",justifyContent:"center",alignItems:"center",height:"100%",p:2,children:k.jsx(U.Typography,{color:"text.secondary",align:"center",children:"No conversations yet"})}):k.jsx(U.List,{disablePadding:!0,children:(()=>{const G=new Set(m.filter(ie=>ie.group!==void 0).map(ie=>ie.group)),A=x.filter(ie=>!G.has(ie.id)).map(ie=>({group:ie.id,last_message_at:ie.created_at,message_count:0,unread_count:0}));return[...[...m].sort((ie,ye)=>new Date(ye.last_message_at).getTime()-new Date(ie.last_message_at).getTime()),...A].map(ie=>k.jsx(Ql,{conversation:ie,displayName:_(ie),selected:L(ie),onClick:()=>M(ie),currentUser:t},ie.group!==void 0?`group-${ie.group}`:`user-${ie.user}`))})()})})]})},Jf=({displayName:e,type:t,subtitle:r,isConnected:i=!0,onBack:a,showJoinButton:s=!1,onJoin:c,joining:d=!1})=>{const p=t==="group",[m,x]=Y.useState(null),b=P=>{x(P.currentTarget)},S=()=>{x(null)},R=P=>{c(P),S()};return k.jsx(U.AppBar,{position:"static",elevation:0,sx:{backgroundColor:"background.default",color:"text.primary"},children:k.jsxs(U.Toolbar,{children:[a&&k.jsx(U.IconButton,{edge:"start",color:"inherit",onClick:a,sx:{mr:2,display:{xs:"flex",sm:"flex",md:"none"}},children:k.jsx(xm,{})}),k.jsx(U.Avatar,{sx:{bgcolor:p?"primary.main":"secondary.main",mr:2},children:p?k.jsx(Xl,{}):k.jsx(Zl,{})}),k.jsxs(U.Box,{flex:1,children:[k.jsx(U.Typography,{variant:"h6",component:"div",noWrap:!0,children:e}),r&&k.jsx(U.Typography,{variant:"caption",color:"inherit",sx:{opacity:.7},children:r})]}),s&&p&&k.jsxs(U.Box,{sx:{display:"flex",alignItems:"center",mr:1},children:[k.jsx(U.Button,{variant:"contained",color:"primary",startIcon:k.jsx(Om,{}),endIcon:k.jsx(Sm,{}),onClick:b,disabled:d,children:d?"Joining...":"Join"}),k.jsxs(U.Menu,{anchorEl:m,open:!!m,onClose:S,children:[k.jsx(U.MenuItem,{onClick:()=>R("member"),children:"Member"}),k.jsx(U.MenuItem,{onClick:()=>R("moderator"),children:"Moderator"})]})]}),!i&&k.jsx(U.Chip,{icon:k.jsx(Rm,{}),label:"Disconnected",size:"small",color:"warning",sx:{ml:1}})]})})};function N_(e){return(typeof e=="string"?new Date(e):e).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})}const Xf=300*1e3;function B_(e,t=Xf){if(e.length===0)return[];const r=[];let i=null;for(const a of e){const s=new Date(a.created_at).getTime();if(!i)i={senderId:a.sender,messages:[a],timestamp:new Date(a.created_at)};else{const c=new Date(i.messages[i.messages.length-1].created_at).getTime(),d=s-c;i.senderId===a.sender&&d<=t?i.messages.push(a):(r.push(i),i={senderId:a.sender,messages:[a],timestamp:new Date(a.created_at)})}}return i&&r.push(i),r}function os(e,t,r=Xf){if(e.sender!==t.sender)return!1;const i=new Date(e.created_at).getTime(),a=new Date(t.created_at).getTime();return Math.abs(a-i)<=r}function q_(e=""){const t=e.trim().split(" ").filter(r=>r.length>0);if(t.length>=2){const r=t[0],i=t[t.length-1];if(r&&i&&r[0]&&i[0])return(r[0]+i[0]).toUpperCase()}return e.slice(0,2).toUpperCase()}const Ol=async(e,t={})=>{const r=Pt(),i=Gi(e);e.type==="group"?t.group=e.id:t.user=e.id;const a=await r.getMessages(t);return a.messages.map(c=>({...c,conversationId:i})).forEach(c=>ct.messages.put(c)),ct.msgCursor.put({...a.cursor,id:i}),a},Zf=Y.memo(({message:e,isOwnMessage:t,senderName:r,showSenderName:i=!0,isFirstInGroup:a=!0,isLastInGroup:s=!0,status:c="sent"})=>{const d=e.id.startsWith("temp-"),p=()=>{if(!t||!s)return null;const x={fontSize:14,ml:.5,opacity:.7,verticalAlign:"middle"};return c==="failed"?k.jsx(Cm,{sx:{...x,color:"error.main"}}):c==="sending"||d?k.jsx(jm,{sx:x}):k.jsx(Tm,{sx:x})},m=k.jsx(U.Avatar,{sx:{width:32,height:32,fontSize:"0.875rem",color:t?"primary.contrastText":"secondary.contrastText",bgcolor:t?"primary.main":"secondary.main",visibility:s?"visible":"hidden"},children:q_(r)});return k.jsxs(U.Box,{display:"flex",justifyContent:t?"flex-end":"flex-start",alignItems:"flex-end",mb:s?1:.25,gap:1,children:[!t&&m,k.jsxs(U.Paper,{elevation:1,sx:{maxWidth:"80%",p:1.5,backgroundColor:t?"primary.main":"background.paper",color:t?"primary.contrastText":"text.primary",borderTopLeftRadius:t||!a?void 0:4,borderTopRightRadius:!t||!a?void 0:4,borderBottomLeftRadius:t||!s?void 0:4,borderBottomRightRadius:!t||!s?void 0:4},children:[!t&&i&&a&&k.jsx(U.Typography,{variant:"caption",fontWeight:"bold",display:"block",mb:.5,children:r||`User ${e.sender}`}),k.jsx(U.Typography,{variant:"body1",sx:{whiteSpace:"pre-wrap"},children:e.content}),s&&k.jsxs(U.Box,{display:"flex",justifyContent:"flex-end",alignItems:"center",mt:.5,children:[k.jsx(U.Typography,{variant:"caption",color:t?"inherit":"text.secondary",sx:{opacity:.7},children:N_(new Date(e.created_at))}),k.jsx(p,{})]})]}),t&&m]})}),Qf=({isOwnMessage:e=!1})=>k.jsx(U.Box,{display:"flex",justifyContent:e?"flex-end":"flex-start",mb:1,children:k.jsxs(U.Box,{maxWidth:"70%",children:[!e&&k.jsx(U.Skeleton,{variant:"text",width:80,sx:{mb:.5}}),k.jsx(U.Skeleton,{variant:"rounded",width:Math.random()*200+150,height:60,sx:{borderRadius:2,bgcolor:e?"primary.light":"background.main"}})]})}),ed=({hasMore:e,loading:t,onLoadMore:r,threshold:i=1,rootMargin:a="100px"})=>{const s=Y.useRef(null),c=Y.useRef(null);return Y.useEffect(()=>{if(!e||t)return;const d=s.current;if(d)return c.current=new IntersectionObserver(p=>{const[m]=p;m&&m.isIntersecting&&e&&!t&&r()},{threshold:i,rootMargin:a}),c.current.observe(d),()=>{c.current&&d&&(c.current.unobserve(d),c.current.disconnect())}},[e,t,r,i,a]),e?k.jsx(U.Box,{ref:s,display:"flex",justifyContent:"center",alignItems:"center",py:2,children:t?k.jsx(U.CircularProgress,{size:24}):k.jsx(U.Typography,{variant:"caption",color:"text.secondary",children:"Scroll to load more"})}):null},As=(e,t,r)=>{Y.useEffect(()=>((async()=>{await e()})(),r),t)};function L_(e){const t=e.map(i=>Number(i.sender));return new Set(t)}function td(e){const t=Pt(),[r,i]=Y.useState(()=>new Map),a=Y.useCallback(async()=>{if(!e.length)return r;try{const s=L_(e),c=Array.from(s);if(console.log("[names] size:",s.size),!s.size)return r;const d=(await ct.users.bulkGet(c)).filter(S=>!!S),p=new Map;if(d.forEach(S=>{p.set(S.id,S.name)}),s.size===d.length)return p;const m=c.filter(S=>!p.has(S)),x=await t.getUsers(m,{fields:["id","name"]});await ct.users.bulkPut(x);const b=p;return x.forEach(S=>b.set(S.id,S.name)),b}catch(s){console.error("[useSenderNames] Failed to fetch users:",s)}return r},[e,r]);return As(async()=>{const s=await a();i(s)},[e]),r}const rd=({messages:e,currentUserId:t,loading:r=!1,error:i=null,autoScroll:a=!0,hasMore:s=!1,loadingMore:c=!1,onLoadMore:d})=>{const p=Y.useRef(null),m=Y.useRef(null),x=Y.useRef(0),b=Y.useRef(!0),[S,R]=Y.useState(a),P=td(e),_=()=>{if(!m.current)return!1;const{scrollTop:M,scrollHeight:H,clientHeight:G}=m.current;return H-M-G<100},L=()=>{b.current=_()};return Y.useEffect(()=>{e.length>0&&p.current&&(p.current.scrollIntoView({behavior:"auto"}),b.current=!0)},[]),Y.useEffect(()=>{!c||!e.length||(m.current&&(x.current=m.current.scrollHeight),R(!1))},[c]),Y.useLayoutEffect(()=>{if(e.length){if(S&&p.current&&b.current)p.current.scrollIntoView({behavior:"smooth"});else if(!S&&m.current&&x.current>0){const H=m.current.scrollHeight-x.current;m.current.scrollTop=m.current.scrollTop+H,x.current=0,R(!0)}}},[e.length,a]),r&&!e.length?k.jsx(U.Box,{flex:1,overflow:"auto",p:2,children:[1,2,3,4,5].map(M=>k.jsx(Qf,{isOwnMessage:M%3===0},M))}):i&&!e.length?k.jsx(U.Box,{display:"flex",justifyContent:"center",alignItems:"center",flex:1,p:2,children:k.jsxs(U.Alert,{severity:"error",children:[k.jsx("strong",{children:"Failed to load messages"}),k.jsx("br",{}),i.message]})}):e.length===0?k.jsx(U.Box,{display:"flex",justifyContent:"center",alignItems:"center",flex:1,children:k.jsx(U.Typography,{variant:"body2",color:"text.secondary",children:"No messages yet. Start the conversation!"})}):k.jsxs(U.Box,{ref:m,flex:1,overflow:"auto",p:2,display:"flex",flexDirection:"column",onScroll:L,children:[s&&d&&k.jsx(ed,{hasMore:s,loading:c,onLoadMore:d}),e.map((M,H)=>{const G=M.sender,W=M.sender===t,A=P.get(G),q=H>0?e[H-1]:null,X=H<e.length-1?e[H+1]:null,ie=!q||!os(q,M),ye=!X||!os(M,X);return k.jsx(Zf,{message:M,isOwnMessage:W,senderName:A,showSenderName:ie,isFirstInGroup:ie,isLastInGroup:ye},M.id)}),k.jsx("div",{ref:p})]})},nd=({onSend:e,sending:t=!1,placeholder:r="Type a message...",disabled:i=!1})=>{const[a,s]=Y.useState(""),c=Y.useRef(null),d=()=>{const m=a.trim();m&&!t&&!i&&(e(m),s(""),setTimeout(()=>{var x,b;(b=(x=c.current)==null?void 0:x.querySelector("textarea"))==null||b.focus()},300))},p=m=>{m.key==="Enter"&&!m.shiftKey&&(m.preventDefault(),d())};return k.jsxs(U.Box,{display:"flex",gap:1,p:2,borderTop:1,borderColor:"divider",children:[k.jsx(U.TextField,{ref:c,fullWidth:!0,multiline:!0,maxRows:4,value:a,onChange:m=>s(m.target.value),onKeyDown:p,placeholder:r,disabled:i||t,variant:"outlined",size:"small"}),k.jsx(U.IconButton,{color:"primary",onClick:d,disabled:!a.trim()||t||i,size:"large",children:t?k.jsx(U.CircularProgress,{size:24}):k.jsx($m,{})})]})};function id({conversation:e,limit:t=50}){const r=Gi(e),[i,a]=Y.useState(!1),[s,c]=Y.useState(!1),[d,p]=Y.useState(),m=jn(()=>ct.messages.where("conversationId").equals(r).sortBy("created_at"),[r])||[],x=jn(()=>ct.msgCursor.where("id").equals(r).first(),[r]);As(async()=>{var R;const S={limit:t};m.length&&(S.cursorType="after",S.cursorDatetime=(R=m[m.length-1])==null?void 0:R.created_at),a(!0),await Ol(e,S).catch(p),a(!1),await ct.summaries.update(r,{unread_count:0})},[e,t]),console.log("mw",m.length);const b=Y.useCallback(async()=>{if(!(!x||s||i)){c(!0);try{const S={limit:t};if(!(x!=null&&x.datetime))return;S.cursorType="before",S.cursorDatetime=x.datetime,await Ol(e,S)}catch(S){console.error("[useMessages] Failed to load more:",S)}c(!1)}},[x,t,e,s,i]);return{messages:m,cursor:x,loading:i,error:d,loadMore:b,loadingMore:s}}const od=({conversation:e,user:t,isConnected:r,onBack:i})=>{const a=Pt(),{messages:s,cursor:c,loading:d,error:p,loadMore:m,loadingMore:x}=id({conversation:e}),b=jn(async()=>e.type==="group"?await ct.groups.get(e.id):null,[e.id,e.type]),S=(t==null?void 0:t.role)==="admin",R=(b==null?void 0:b.is_member)??!0,P=S&&e.type==="group"&&!R,_=e.type==="group"&&!R,[L,M]=Y.useState(!1),[H,G]=Y.useState(!1),W=async v=>{if(e.type==="group"){M(!0);try{await a.joinGroup(t.org,e.id,v),G(!0),await Yf(t.org),await Wf({}),setTimeout(()=>G(!1),3e3)}catch(ee){ie(gi(ee,"Failed to join group"))}M(!1)}},[A,q]=Y.useState(!1),[X,ie]=Y.useState(null),[ye,Ge]=Y.useState(!1),ve=async v=>{if(!v.trim())return;q(!0),ie(null),Ge(!0);const ee=`temp-${Date.now()}-${Math.random()}`,te={id:ee,sender:t==null?void 0:t.id,receiver:e.type==="dm"?e.id:null,group:e.type==="group"?e.id:null,content:v,created_at:new Date().toISOString(),conversationId:Gi(e)};try{await ct.messages.put(te),await(e.type==="group"?a.sendGroupMessage:a.sendDM).bind(a)(e.id,v),await ct.messages.delete(ee)}catch(ge){ie(gi(ge,"Failed to send message"))}q(!1),setTimeout(()=>Ge(!1),100)};return k.jsxs(U.Box,{display:"flex",flexDirection:"column",height:"100%",children:[k.jsx(Jf,{displayName:e.name||"Chat",type:e.type,isConnected:r,onBack:i,showJoinButton:P,onJoin:W,joining:L}),k.jsx(U.Snackbar,{open:H,autoHideDuration:3e3,onClose:()=>G(!1),message:"Successfully joined group"}),X&&k.jsx(U.Alert,{severity:"error",onClose:()=>ie(null),children:X.message}),k.jsx(rd,{messages:s,currentUserId:(t==null?void 0:t.id)||0,loading:d,error:p,autoScroll:!0,hasMore:!!(c!=null&&c.datetime),loadingMore:x,onLoadMore:m,forceScrollToBottom:ye}),_?k.jsx(U.Alert,{severity:"warning",sx:{m:2},children:"You must be a group member to send messages"}):k.jsx(nd,{onSend:ve,sending:A})]})};class as extends Y.Component{constructor(r){super(r);gr(this,"handleReset",()=>{this.setState({hasError:!1,error:null})});this.state={hasError:!1,error:null}}static getDerivedStateFromError(r){return{hasError:!0,error:r}}componentDidCatch(r,i){var a,s;console.error("ErrorBoundary caught an error:",r,i),(s=(a=this.props).onError)==null||s.call(a,r,i)}render(){var r;return this.state.hasError?this.props.fallback?this.props.fallback:k.jsxs(U.Box,{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",height:"100%",p:3,children:[k.jsxs(U.Alert,{severity:"error",sx:{mb:2,maxWidth:500},children:[k.jsx(U.Typography,{variant:"h6",gutterBottom:!0,children:"Something went wrong"}),k.jsx(U.Typography,{variant:"body2",color:"text.secondary",children:((r=this.state.error)==null?void 0:r.message)||"An unexpected error occurred"})]}),k.jsx(U.Button,{variant:"contained",startIcon:k.jsx(Am,{}),onClick:this.handleReset,children:"Try Again"})]}):this.props.children}}function ad({onMessage:e,onConnect:t,onDisconnect:r,onError:i,currentUserId:a,conversation:s,updateCache:c=!0}={}){const d=Y.useRef(a),p=Y.useRef(s),m=Y.useRef(c),x=Y.useRef(e);Y.useEffect(()=>{d.current=a,p.current=s,m.current=c,x.current=e},[a,s,c,e]);const b=Y.useCallback(async _=>{var L;if(_.type==="message"){const M=_.data;if((L=x.current)==null||L.call(x,M),console.log("sss",{updateCache:m.current,currentUserId:d.current}),!m.current||!d.current)return;const H=p.current&&Gi(p.current),G=F_(M,d.current),W={...M,conversationId:G};ct.messages.put(W);const A=await ct.summaries.get(G),{unread_count:q,message_count:X}=A,ie={message_count:X+1,last_message_at:M.created_at};G!==H&&(ie.unread_count=q+1),await ct.summaries.update(G,ie)}},[]),S=Y.useCallback(()=>{t==null||t()},[t]),R=Y.useCallback((_,L)=>{r==null||r(_,L)},[r]),P=Y.useCallback(_=>{console.error("[WS] WebSocket error:",_),i==null||i(_)},[i]);Y.useEffect(()=>{try{const _=Pt();return console.log("www adding listeners"),_.on("message",b),_.on("open",S),_.on("close",R),_.on("error",P),()=>{console.log("www removing listeners"),_.off("message",b),_.off("open",S),_.off("close",R),_.off("error",P)}}catch(_){console.error("Failed to setup WebSocket listeners:",_)}},[b,S,R,P])}const V_=({initialConversation:e})=>{const[t,r]=Y.useState(e??null),[i,a]=Y.useState(),[s,c]=Y.useState(!0),d=b=>()=>c(b),p=Pt();As(async()=>{const b=await p.getMe();a(b),ct.users.put(b),console.log("sdf user set",b)},[]),ad({onError:d(!1),onConnect:d(!0),onDisconnect:d(!1),currentUserId:i==null?void 0:i.id,conversation:t,updateCache:!0});const m=b=>{r(b)},x=()=>{r(null)};return k.jsxs(U.Box,{display:"flex",height:"100%",overflow:"hidden",children:[k.jsx(U.Box,{sx:{width:{xs:"100%",sm:"100%",md:"320px"},flexShrink:0,border:"0px solid",borderRightWidth:{xs:0,md:1},borderColor:"divider",overflow:"hidden",display:{xs:t?"none":"flex",sm:t?"none":"flex",md:"flex"},flexDirection:"column"},children:k.jsx(as,{children:k.jsx(Hf,{currentUser:i,selectedConversation:t,onConversationSelect:m})})}),k.jsx(U.Box,{sx:{flex:1,overflow:"hidden",display:{xs:t?"flex":"none",sm:t?"flex":"none",md:"flex"},flexDirection:"column"},children:t?k.jsx(as,{children:k.jsx(od,{conversation:t,user:i,isConnected:s,onBack:x})}):k.jsx(U.Box,{display:"flex",justifyContent:"center",alignItems:"center",height:"100%",color:"text.secondary",children:"Select a conversation to start chatting"})})]})},K_=({count:e,children:t,max:r=99})=>k.jsx(U.Badge,{badgeContent:e,color:"error",max:r,overlap:"rectangular",sx:{"& .MuiBadge-badge":{right:8,top:"50%",transform:"translateY(-50%)"}},children:t}),z_={SUMMARIES:300*1e3,USER:3600*1e3,MESSAGES:1/0},U_=()=>typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches,G_={mode:"dark",background:{paper:"#3d3d43",default:"#333338"},text:{primary:"#eee",secondary:"#aaa"}},W_={mode:"light",background:{default:"#f5f5f5",paper:"#ffff"}},sd=e=>{const t=U_(),i=(e||(t?"dark":"light"))==="dark";return Jl({palette:{...i?G_:W_,primary:{main:"#E91E63",light:"#F48FB1",dark:"#AD1457",contrastText:"#fff"},secondary:{main:"#e4e6eb",light:"#f0f2f5",dark:"#b0b3b8",contrastText:"rgba(0, 0, 0, 0.87)"},error:{main:"#d32f2f",light:"#ef5350",dark:"#c62828",contrastText:"#fff"},warning:{main:"#ed6c02",light:"#ff9800",dark:"#e65100",contrastText:"#fff"},info:{main:"#0288d1",light:"#03a9f4",dark:"#01579b",contrastText:"#fff"},success:{main:"#2e7d32",light:"#4caf50",dark:"#1b5e20",contrastText:"#fff"}},typography:{fontFamily:["-apple-system","BlinkMacSystemFont",'"Segoe UI"',"Roboto",'"Helvetica Neue"',"Arial","sans-serif",'"Apple Color Emoji"','"Segoe UI Emoji"','"Segoe UI Symbol"'].join(","),fontSize:14,h1:{fontSize:"2.5rem",fontWeight:500},h2:{fontSize:"2rem",fontWeight:500},h3:{fontSize:"1.75rem",fontWeight:500},h4:{fontSize:"1.5rem",fontWeight:500},h5:{fontSize:"1.25rem",fontWeight:500},h6:{fontSize:"1rem",fontWeight:500},body1:{fontSize:"0.9375rem",lineHeight:1.4},body2:{fontSize:"0.8125rem",lineHeight:1.4}},shape:{borderRadius:12},components:{MuiButton:{styleOverrides:{root:{textTransform:"none",fontWeight:500,borderRadius:20}}},MuiIconButton:{styleOverrides:{root:{borderRadius:"50%"}}},MuiPaper:{styleOverrides:{root:{backgroundImage:"none"},rounded:{borderRadius:12}}},MuiBadge:{styleOverrides:{badge:{fontSize:"0.6875rem",height:18,minWidth:18,borderRadius:9,fontWeight:600}}},MuiCssBaseline:{styleOverrides:{body:{"*::-webkit-scrollbar":{width:"8px",height:"8px"},"*::-webkit-scrollbar-track":{background:"undo",borderRadius:"4px"},"*::-webkit-scrollbar-thumb":{background:"undo",borderRadius:"4px","&:hover":{background:"undo"}},scrollbarWidth:"thin",scrollbarColor:i?"#6a6a6e #333338":"#c1c1c1 #f5f5f5"}}}}})},Y_=sd();exports.CACHE_TTL=z_;exports.ChatApp=Ld;exports.ChatContainer=V_;exports.ChatHeader=Jf;exports.ChatWindow=od;exports.ConversationItem=Ql;exports.ConversationItemSkeleton=ef;exports.ConversationList=Hf;exports.CreateGroupDialog=Gf;exports.ErrorBoundary=as;exports.LoadMoreTrigger=ed;exports.MessageBubble=Zf;exports.MessageInput=nd;exports.MessageList=rd;exports.MessageSkeleton=Qf;exports.UnreadBadge=K_;exports.db=ct;exports.disconnectSDK=Ua;exports.getSDK=Pt;exports.getTheme=sd;exports.groupMessages=B_;exports.initSDK=Al;exports.isSDKInitialized=Nd;exports.shouldGroupMessages=os;exports.theme=Y_;exports.useMessages=id;exports.useSenderNames=td;exports.useWebSocketMessages=ad;