diff --git a/assets/Latin-Merriweather-Bold-IIXuWTHu.woff2 b/assets/Latin-Merriweather-Bold-IIXuWTHu.woff2 new file mode 100644 index 00000000..b71dc5a0 Binary files /dev/null and b/assets/Latin-Merriweather-Bold-IIXuWTHu.woff2 differ diff --git a/assets/Latin-Merriweather-BoldItalic-lANwydSD.woff2 b/assets/Latin-Merriweather-BoldItalic-lANwydSD.woff2 new file mode 100644 index 00000000..36d3abfc Binary files /dev/null and b/assets/Latin-Merriweather-BoldItalic-lANwydSD.woff2 differ diff --git a/assets/Latin-Merriweather-Italic-DTbnHiv6.woff2 b/assets/Latin-Merriweather-Italic-DTbnHiv6.woff2 new file mode 100644 index 00000000..09916326 Binary files /dev/null and b/assets/Latin-Merriweather-Italic-DTbnHiv6.woff2 differ diff --git a/assets/Latin-Merriweather-Light-8OcT7uuF.woff2 b/assets/Latin-Merriweather-Light-8OcT7uuF.woff2 new file mode 100644 index 00000000..a0eadc33 Binary files /dev/null and b/assets/Latin-Merriweather-Light-8OcT7uuF.woff2 differ diff --git a/assets/Latin-Merriweather-LightItalic-B_O6_0Zw.woff2 b/assets/Latin-Merriweather-LightItalic-B_O6_0Zw.woff2 new file mode 100644 index 00000000..5112dab4 Binary files /dev/null and b/assets/Latin-Merriweather-LightItalic-B_O6_0Zw.woff2 differ diff --git a/assets/Latin-Merriweather-Regular-BwwdRmdN.woff2 b/assets/Latin-Merriweather-Regular-BwwdRmdN.woff2 new file mode 100644 index 00000000..9a9bd644 Binary files /dev/null and b/assets/Latin-Merriweather-Regular-BwwdRmdN.woff2 differ diff --git a/assets/hero-9qBhH4BY.jpg b/assets/hero-9qBhH4BY.jpg new file mode 100644 index 00000000..62320c42 Binary files /dev/null and b/assets/hero-9qBhH4BY.jpg differ diff --git a/assets/index-D0TBaauD.js b/assets/index-D0TBaauD.js new file mode 100644 index 00000000..49c544ef --- /dev/null +++ b/assets/index-D0TBaauD.js @@ -0,0 +1,633 @@ +var CL=Object.defineProperty;var z_=e=>{throw TypeError(e)};var AL=(e,t,n)=>t in e?CL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Y=(e,t,n)=>AL(e,typeof t!="symbol"?t+"":t,n),Ip=(e,t,n)=>t.has(e)||z_("Cannot "+n);var P=(e,t,n)=>(Ip(e,t,"read from private field"),n?n.call(e):t.get(e)),Se=(e,t,n)=>t.has(e)?z_("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),he=(e,t,n,r)=>(Ip(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Me=(e,t,n)=>(Ip(e,t,"access private method"),n);var pd=(e,t,n,r)=>({set _(i){he(e,t,i,n)},get _(){return P(e,t,r)}});function RL(e,t){for(var n=0;nr[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var Bo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function zr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function $L(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var zE={exports:{}},l0={},BE={exports:{}},ke={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Pc=Symbol.for("react.element"),kL=Symbol.for("react.portal"),TL=Symbol.for("react.fragment"),ML=Symbol.for("react.strict_mode"),NL=Symbol.for("react.profiler"),LL=Symbol.for("react.provider"),OL=Symbol.for("react.context"),PL=Symbol.for("react.forward_ref"),IL=Symbol.for("react.suspense"),DL=Symbol.for("react.memo"),jL=Symbol.for("react.lazy"),B_=Symbol.iterator;function FL(e){return e===null||typeof e!="object"?null:(e=B_&&e[B_]||e["@@iterator"],typeof e=="function"?e:null)}var HE={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},WE=Object.assign,qE={};function vl(e,t,n){this.props=e,this.context=t,this.refs=qE,this.updater=n||HE}vl.prototype.isReactComponent={};vl.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};vl.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function GE(){}GE.prototype=vl.prototype;function f1(e,t,n){this.props=e,this.context=t,this.refs=qE,this.updater=n||HE}var h1=f1.prototype=new GE;h1.constructor=f1;WE(h1,vl.prototype);h1.isPureReactComponent=!0;var H_=Array.isArray,KE=Object.prototype.hasOwnProperty,p1={current:null},YE={key:!0,ref:!0,__self:!0,__source:!0};function QE(e,t,n){var r,i={},o=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(o=""+t.key),t)KE.call(t,r)&&!YE.hasOwnProperty(r)&&(i[r]=t[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1>>1,N=V[X];if(0>>1;Xi(ie,q))Ki(pe,ie)?(V[X]=pe,V[K]=q,X=K):(V[X]=ie,V[G]=q,X=G);else if(Ki(pe,q))V[X]=pe,V[K]=q,X=K;else break e}}return W}function i(V,W){var q=V.sortIndex-W.sortIndex;return q!==0?q:V.id-W.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var l=[],u=[],c=1,d=null,f=3,h=!1,g=!1,y=!1,_=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,p=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function v(V){for(var W=n(u);W!==null;){if(W.callback===null)r(u);else if(W.startTime<=V)r(u),W.sortIndex=W.expirationTime,t(l,W);else break;W=n(u)}}function x(V){if(y=!1,v(V),!g)if(n(l)!==null)g=!0,H(S);else{var W=n(u);W!==null&&Q(x,W.startTime-V)}}function S(V,W){g=!1,y&&(y=!1,m(A),A=-1),h=!0;var q=f;try{for(v(W),d=n(l);d!==null&&(!(d.expirationTime>W)||V&&!M());){var X=d.callback;if(typeof X=="function"){d.callback=null,f=d.priorityLevel;var N=X(d.expirationTime<=W);W=e.unstable_now(),typeof N=="function"?d.callback=N:d===n(l)&&r(l),v(W)}else r(l);d=n(l)}if(d!==null)var B=!0;else{var G=n(u);G!==null&&Q(x,G.startTime-W),B=!1}return B}finally{d=null,f=q,h=!1}}var w=!1,b=null,A=-1,k=5,R=-1;function M(){return!(e.unstable_now()-RV||125X?(V.sortIndex=q,t(u,V),n(l)===null&&V===n(u)&&(y?(m(A),A=-1):y=!0,Q(x,q-X))):(V.sortIndex=N,t(l,V),g||h||(g=!0,H(S))),V},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(V){var W=f;return function(){var q=f;f=W;try{return V.apply(this,arguments)}finally{f=q}}}})(eC);JE.exports=eC;var XL=JE.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var tC=U,Tn=XL;function J(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Rm=Object.prototype.hasOwnProperty,ZL=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,q_={},G_={};function JL(e){return Rm.call(G_,e)?!0:Rm.call(q_,e)?!1:ZL.test(e)?G_[e]=!0:(q_[e]=!0,!1)}function eO(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function tO(e,t,n,r){if(t===null||typeof t>"u"||eO(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function tn(e,t,n,r,i,o,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=s}var Pt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Pt[e]=new tn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Pt[t]=new tn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Pt[e]=new tn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Pt[e]=new tn(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Pt[e]=new tn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Pt[e]=new tn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Pt[e]=new tn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Pt[e]=new tn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Pt[e]=new tn(e,5,!1,e.toLowerCase(),null,!1,!1)});var m1=/[\-:]([a-z])/g;function y1(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(m1,y1);Pt[t]=new tn(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(m1,y1);Pt[t]=new tn(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(m1,y1);Pt[t]=new tn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Pt[e]=new tn(e,1,!1,e.toLowerCase(),null,!1,!1)});Pt.xlinkHref=new tn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Pt[e]=new tn(e,1,!1,e.toLowerCase(),null,!0,!0)});function v1(e,t,n,r){var i=Pt.hasOwnProperty(t)?Pt[t]:null;(i!==null?i.type!==0:r||!(2a||i[s]!==o[a]){var l=` +`+i[s].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=s&&0<=a);break}}}finally{Fp=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?hu(e):""}function nO(e){switch(e.tag){case 5:return hu(e.type);case 16:return hu("Lazy");case 13:return hu("Suspense");case 19:return hu("SuspenseList");case 0:case 2:case 15:return e=Up(e.type,!1),e;case 11:return e=Up(e.type.render,!1),e;case 1:return e=Up(e.type,!0),e;default:return""}}function Mm(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case na:return"Fragment";case ta:return"Portal";case $m:return"Profiler";case _1:return"StrictMode";case km:return"Suspense";case Tm:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case iC:return(e.displayName||"Context")+".Consumer";case rC:return(e._context.displayName||"Context")+".Provider";case x1:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case S1:return t=e.displayName||null,t!==null?t:Mm(e.type)||"Memo";case Di:t=e._payload,e=e._init;try{return Mm(e(t))}catch{}}return null}function rO(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Mm(t);case 8:return t===_1?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function _o(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function sC(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function iO(e){var t=sC(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(s){r=""+s,o.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function yd(e){e._valueTracker||(e._valueTracker=iO(e))}function aC(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=sC(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Of(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 Nm(e,t){var n=t.checked;return rt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Y_(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=_o(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function lC(e,t){t=t.checked,t!=null&&v1(e,"checked",t,!1)}function Lm(e,t){lC(e,t);var n=_o(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Om(e,t.type,n):t.hasOwnProperty("defaultValue")&&Om(e,t.type,_o(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Q_(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Om(e,t,n){(t!=="number"||Of(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var pu=Array.isArray;function xa(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=vd.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Gu(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Au={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},oO=["Webkit","ms","Moz","O"];Object.keys(Au).forEach(function(e){oO.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Au[t]=Au[e]})});function fC(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Au.hasOwnProperty(e)&&Au[e]?(""+t).trim():t+"px"}function hC(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=fC(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var sO=rt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Dm(e,t){if(t){if(sO[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(J(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(J(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(J(61))}if(t.style!=null&&typeof t.style!="object")throw Error(J(62))}}function jm(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Fm=null;function w1(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Um=null,Sa=null,wa=null;function J_(e){if(e=jc(e)){if(typeof Um!="function")throw Error(J(280));var t=e.stateNode;t&&(t=h0(t),Um(e.stateNode,e.type,t))}}function pC(e){Sa?wa?wa.push(e):wa=[e]:Sa=e}function gC(){if(Sa){var e=Sa,t=wa;if(wa=Sa=null,J_(e),t)for(e=0;e>>=0,e===0?32:31-(yO(e)/vO|0)|0}var _d=64,xd=4194304;function gu(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function jf(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,s=n&268435455;if(s!==0){var a=s&~i;a!==0?r=gu(a):(o&=s,o!==0&&(r=gu(o)))}else s=n&~i,s!==0?r=gu(s):o!==0&&(r=gu(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Ic(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-mr(t),e[t]=n}function wO(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=$u),lx=" ",ux=!1;function PC(e,t){switch(e){case"keyup":return QO.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function IC(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ra=!1;function ZO(e,t){switch(e){case"compositionend":return IC(t);case"keypress":return t.which!==32?null:(ux=!0,lx);case"textInput":return e=t.data,e===lx&&ux?null:e;default:return null}}function JO(e,t){if(ra)return e==="compositionend"||!T1&&PC(e,t)?(e=LC(),lf=R1=eo=null,ra=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=hx(n)}}function UC(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?UC(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function VC(){for(var e=window,t=Of();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Of(e.document)}return t}function M1(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function lP(e){var t=VC(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&UC(n.ownerDocument.documentElement,n)){if(r!==null&&M1(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=px(n,o);var s=px(n,r);i&&s&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,ia=null,qm=null,Tu=null,Gm=!1;function gx(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Gm||ia==null||ia!==Of(r)||(r=ia,"selectionStart"in r&&M1(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Tu&&Ju(Tu,r)||(Tu=r,r=Vf(qm,"onSelect"),0aa||(e.current=Jm[aa],Jm[aa]=null,aa--)}function We(e,t){aa++,Jm[aa]=e.current,e.current=t}var xo={},Bt=Ao(xo),hn=Ao(!1),ps=xo;function Ya(e,t){var n=e.type.contextTypes;if(!n)return xo;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function pn(e){return e=e.childContextTypes,e!=null}function Bf(){Ye(hn),Ye(Bt)}function wx(e,t,n){if(Bt.current!==xo)throw Error(J(168));We(Bt,t),We(hn,n)}function QC(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(J(108,rO(e)||"Unknown",i));return rt({},n,r)}function Hf(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||xo,ps=Bt.current,We(Bt,e),We(hn,hn.current),!0}function bx(e,t,n){var r=e.stateNode;if(!r)throw Error(J(169));n?(e=QC(e,t,ps),r.__reactInternalMemoizedMergedChildContext=e,Ye(hn),Ye(Bt),We(Bt,e)):Ye(hn),We(hn,n)}var ai=null,p0=!1,eg=!1;function XC(e){ai===null?ai=[e]:ai.push(e)}function xP(e){p0=!0,XC(e)}function Ro(){if(!eg&&ai!==null){eg=!0;var e=0,t=Ue;try{var n=ai;for(Ue=1;e>=s,i-=s,li=1<<32-mr(t)+i|n<A?(k=b,b=null):k=b.sibling;var R=f(m,b,v[A],x);if(R===null){b===null&&(b=k);break}e&&b&&R.alternate===null&&t(m,b),p=o(R,p,A),w===null?S=R:w.sibling=R,w=R,b=k}if(A===v.length)return n(m,b),Ze&&Io(m,A),S;if(b===null){for(;AA?(k=b,b=null):k=b.sibling;var M=f(m,b,R.value,x);if(M===null){b===null&&(b=k);break}e&&b&&M.alternate===null&&t(m,b),p=o(M,p,A),w===null?S=M:w.sibling=M,w=M,b=k}if(R.done)return n(m,b),Ze&&Io(m,A),S;if(b===null){for(;!R.done;A++,R=v.next())R=d(m,R.value,x),R!==null&&(p=o(R,p,A),w===null?S=R:w.sibling=R,w=R);return Ze&&Io(m,A),S}for(b=r(m,b);!R.done;A++,R=v.next())R=h(b,m,A,R.value,x),R!==null&&(e&&R.alternate!==null&&b.delete(R.key===null?A:R.key),p=o(R,p,A),w===null?S=R:w.sibling=R,w=R);return e&&b.forEach(function($){return t(m,$)}),Ze&&Io(m,A),S}function _(m,p,v,x){if(typeof v=="object"&&v!==null&&v.type===na&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case md:e:{for(var S=v.key,w=p;w!==null;){if(w.key===S){if(S=v.type,S===na){if(w.tag===7){n(m,w.sibling),p=i(w,v.props.children),p.return=m,m=p;break e}}else if(w.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Di&&Tx(S)===w.type){n(m,w.sibling),p=i(w,v.props),p.ref=Kl(m,w,v),p.return=m,m=p;break e}n(m,w);break}else t(m,w);w=w.sibling}v.type===na?(p=ss(v.props.children,m.mode,x,v.key),p.return=m,m=p):(x=mf(v.type,v.key,v.props,null,m.mode,x),x.ref=Kl(m,p,v),x.return=m,m=x)}return s(m);case ta:e:{for(w=v.key;p!==null;){if(p.key===w)if(p.tag===4&&p.stateNode.containerInfo===v.containerInfo&&p.stateNode.implementation===v.implementation){n(m,p.sibling),p=i(p,v.children||[]),p.return=m,m=p;break e}else{n(m,p);break}else t(m,p);p=p.sibling}p=lg(v,m.mode,x),p.return=m,m=p}return s(m);case Di:return w=v._init,_(m,p,w(v._payload),x)}if(pu(v))return g(m,p,v,x);if(Bl(v))return y(m,p,v,x);Rd(m,v)}return typeof v=="string"&&v!==""||typeof v=="number"?(v=""+v,p!==null&&p.tag===6?(n(m,p.sibling),p=i(p,v),p.return=m,m=p):(n(m,p),p=ag(v,m.mode,x),p.return=m,m=p),s(m)):n(m,p)}return _}var Xa=oA(!0),sA=oA(!1),Fc={},jr=Ao(Fc),rc=Ao(Fc),ic=Ao(Fc);function qo(e){if(e===Fc)throw Error(J(174));return e}function U1(e,t){switch(We(ic,t),We(rc,e),We(jr,Fc),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Im(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Im(t,e)}Ye(jr),We(jr,t)}function Za(){Ye(jr),Ye(rc),Ye(ic)}function aA(e){qo(ic.current);var t=qo(jr.current),n=Im(t,e.type);t!==n&&(We(rc,e),We(jr,n))}function V1(e){rc.current===e&&(Ye(jr),Ye(rc))}var et=Ao(0);function Qf(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var tg=[];function z1(){for(var e=0;en?n:4,e(!0);var r=ng.transition;ng.transition={};try{e(!1),t()}finally{Ue=n,ng.transition=r}}function bA(){return Zn().memoizedState}function EP(e,t,n){var r=co(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},EA(e))CA(t,n);else if(n=tA(e,t,n,r),n!==null){var i=Zt();yr(n,e,r,i),AA(n,t,r)}}function CP(e,t,n){var r=co(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(EA(e))CA(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var s=t.lastRenderedState,a=o(s,n);if(i.hasEagerState=!0,i.eagerState=a,_r(a,s)){var l=t.interleaved;l===null?(i.next=i,j1(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=tA(e,t,i,r),n!==null&&(i=Zt(),yr(n,e,r,i),AA(n,t,r))}}function EA(e){var t=e.alternate;return e===tt||t!==null&&t===tt}function CA(e,t){Mu=Xf=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function AA(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,E1(e,n)}}var Zf={readContext:Xn,useCallback:It,useContext:It,useEffect:It,useImperativeHandle:It,useInsertionEffect:It,useLayoutEffect:It,useMemo:It,useReducer:It,useRef:It,useState:It,useDebugValue:It,useDeferredValue:It,useTransition:It,useMutableSource:It,useSyncExternalStore:It,useId:It,unstable_isNewReconciler:!1},AP={readContext:Xn,useCallback:function(e,t){return Er().memoizedState=[e,t===void 0?null:t],e},useContext:Xn,useEffect:Nx,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,ff(4194308,4,vA.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ff(4194308,4,e,t)},useInsertionEffect:function(e,t){return ff(4,2,e,t)},useMemo:function(e,t){var n=Er();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Er();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=EP.bind(null,tt,e),[r.memoizedState,e]},useRef:function(e){var t=Er();return e={current:e},t.memoizedState=e},useState:Mx,useDebugValue:G1,useDeferredValue:function(e){return Er().memoizedState=e},useTransition:function(){var e=Mx(!1),t=e[0];return e=bP.bind(null,e[1]),Er().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=tt,i=Er();if(Ze){if(n===void 0)throw Error(J(407));n=n()}else{if(n=t(),$t===null)throw Error(J(349));ms&30||cA(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,Nx(fA.bind(null,r,o,e),[e]),r.flags|=2048,ac(9,dA.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Er(),t=$t.identifierPrefix;if(Ze){var n=ui,r=li;n=(r&~(1<<32-mr(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=oc++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[Nr]=t,e[nc]=r,PA(e,t,!1,!1),t.stateNode=e;e:{switch(s=jm(n,r),n){case"dialog":qe("cancel",e),qe("close",e),i=r;break;case"iframe":case"object":case"embed":qe("load",e),i=r;break;case"video":case"audio":for(i=0;iel&&(t.flags|=128,r=!0,Yl(o,!1),t.lanes=4194304)}else{if(!r)if(e=Qf(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Yl(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!Ze)return Dt(t),null}else 2*ut()-o.renderingStartTime>el&&n!==1073741824&&(t.flags|=128,r=!0,Yl(o,!1),t.lanes=4194304);o.isBackwards?(s.sibling=t.child,t.child=s):(n=o.last,n!==null?n.sibling=s:t.child=s,o.last=s)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=ut(),t.sibling=null,n=et.current,We(et,r?n&1|2:n&1),t):(Dt(t),null);case 22:case 23:return J1(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?An&1073741824&&(Dt(t),t.subtreeFlags&6&&(t.flags|=8192)):Dt(t),null;case 24:return null;case 25:return null}throw Error(J(156,t.tag))}function OP(e,t){switch(L1(t),t.tag){case 1:return pn(t.type)&&Bf(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Za(),Ye(hn),Ye(Bt),z1(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return V1(t),null;case 13:if(Ye(et),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(J(340));Qa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ye(et),null;case 4:return Za(),null;case 10:return D1(t.type._context),null;case 22:case 23:return J1(),null;case 24:return null;default:return null}}var kd=!1,zt=!1,PP=typeof WeakSet=="function"?WeakSet:Set,ce=null;function da(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){ot(e,t,r)}else n.current=null}function dy(e,t,n){try{n()}catch(r){ot(e,t,r)}}var Vx=!1;function IP(e,t){if(Km=Ff,e=VC(),M1(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,u=0,c=0,d=e,f=null;t:for(;;){for(var h;d!==n||i!==0&&d.nodeType!==3||(a=s+i),d!==o||r!==0&&d.nodeType!==3||(l=s+r),d.nodeType===3&&(s+=d.nodeValue.length),(h=d.firstChild)!==null;)f=d,d=h;for(;;){if(d===e)break t;if(f===n&&++u===i&&(a=s),f===o&&++c===r&&(l=s),(h=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=h}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Ym={focusedElem:e,selectionRange:n},Ff=!1,ce=t;ce!==null;)if(t=ce,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ce=e;else for(;ce!==null;){t=ce;try{var g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var y=g.memoizedProps,_=g.memoizedState,m=t.stateNode,p=m.getSnapshotBeforeUpdate(t.elementType===t.type?y:sr(t.type,y),_);m.__reactInternalSnapshotBeforeUpdate=p}break;case 3:var v=t.stateNode.containerInfo;v.nodeType===1?v.textContent="":v.nodeType===9&&v.documentElement&&v.removeChild(v.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(J(163))}}catch(x){ot(t,t.return,x)}if(e=t.sibling,e!==null){e.return=t.return,ce=e;break}ce=t.return}return g=Vx,Vx=!1,g}function Nu(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&dy(t,n,o)}i=i.next}while(i!==r)}}function y0(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function fy(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function jA(e){var t=e.alternate;t!==null&&(e.alternate=null,jA(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Nr],delete t[nc],delete t[Zm],delete t[vP],delete t[_P])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function FA(e){return e.tag===5||e.tag===3||e.tag===4}function zx(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||FA(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function hy(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=zf));else if(r!==4&&(e=e.child,e!==null))for(hy(e,t,n),e=e.sibling;e!==null;)hy(e,t,n),e=e.sibling}function py(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(py(e,t,n),e=e.sibling;e!==null;)py(e,t,n),e=e.sibling}var Nt=null,lr=!1;function Ni(e,t,n){for(n=n.child;n!==null;)UA(e,t,n),n=n.sibling}function UA(e,t,n){if(Dr&&typeof Dr.onCommitFiberUnmount=="function")try{Dr.onCommitFiberUnmount(u0,n)}catch{}switch(n.tag){case 5:zt||da(n,t);case 6:var r=Nt,i=lr;Nt=null,Ni(e,t,n),Nt=r,lr=i,Nt!==null&&(lr?(e=Nt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Nt.removeChild(n.stateNode));break;case 18:Nt!==null&&(lr?(e=Nt,n=n.stateNode,e.nodeType===8?Jp(e.parentNode,n):e.nodeType===1&&Jp(e,n),Xu(e)):Jp(Nt,n.stateNode));break;case 4:r=Nt,i=lr,Nt=n.stateNode.containerInfo,lr=!0,Ni(e,t,n),Nt=r,lr=i;break;case 0:case 11:case 14:case 15:if(!zt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,s=o.destroy;o=o.tag,s!==void 0&&(o&2||o&4)&&dy(n,t,s),i=i.next}while(i!==r)}Ni(e,t,n);break;case 1:if(!zt&&(da(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){ot(n,t,a)}Ni(e,t,n);break;case 21:Ni(e,t,n);break;case 22:n.mode&1?(zt=(r=zt)||n.memoizedState!==null,Ni(e,t,n),zt=r):Ni(e,t,n);break;default:Ni(e,t,n)}}function Bx(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new PP),t.forEach(function(r){var i=WP.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function ir(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=s),r&=~o}if(r=i,r=ut()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*jP(r/1960))-r,10e?16:e,to===null)var r=!1;else{if(e=to,to=null,th=0,Pe&6)throw Error(J(331));var i=Pe;for(Pe|=4,ce=e.current;ce!==null;){var o=ce,s=o.child;if(ce.flags&16){var a=o.deletions;if(a!==null){for(var l=0;lut()-X1?os(e,0):Q1|=n),gn(e,t)}function KA(e,t){t===0&&(e.mode&1?(t=xd,xd<<=1,!(xd&130023424)&&(xd=4194304)):t=1);var n=Zt();e=yi(e,t),e!==null&&(Ic(e,t,n),gn(e,n))}function HP(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),KA(e,n)}function WP(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(J(314))}r!==null&&r.delete(t),KA(e,n)}var YA;YA=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||hn.current)fn=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return fn=!1,NP(e,t,n);fn=!!(e.flags&131072)}else fn=!1,Ze&&t.flags&1048576&&ZC(t,qf,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;hf(e,t),e=t.pendingProps;var i=Ya(t,Bt.current);Ea(t,n),i=H1(null,t,r,e,i,n);var o=W1();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,pn(r)?(o=!0,Hf(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,F1(t),i.updater=g0,t.stateNode=i,i._reactInternals=t,iy(t,r,e,n),t=ay(null,t,r,!0,o,n)):(t.tag=0,Ze&&o&&N1(t),Kt(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(hf(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=GP(r),e=sr(r,e),i){case 0:t=sy(null,t,r,e,n);break e;case 1:t=jx(null,t,r,e,n);break e;case 11:t=Ix(null,t,r,e,n);break e;case 14:t=Dx(null,t,r,sr(r.type,e),n);break e}throw Error(J(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:sr(r,i),sy(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:sr(r,i),jx(e,t,r,i,n);case 3:e:{if(NA(t),e===null)throw Error(J(387));r=t.pendingProps,o=t.memoizedState,i=o.element,nA(e,t),Yf(t,r,null,n);var s=t.memoizedState;if(r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=Ja(Error(J(423)),t),t=Fx(e,t,r,n,i);break e}else if(r!==i){i=Ja(Error(J(424)),t),t=Fx(e,t,r,n,i);break e}else for(Rn=ao(t.stateNode.containerInfo.firstChild),kn=t,Ze=!0,cr=null,n=sA(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Qa(),r===i){t=vi(e,t,n);break e}Kt(e,t,r,n)}t=t.child}return t;case 5:return aA(t),e===null&&ty(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,s=i.children,Qm(r,i)?s=null:o!==null&&Qm(r,o)&&(t.flags|=32),MA(e,t),Kt(e,t,s,n),t.child;case 6:return e===null&&ty(t),null;case 13:return LA(e,t,n);case 4:return U1(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Xa(t,null,r,n):Kt(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:sr(r,i),Ix(e,t,r,i,n);case 7:return Kt(e,t,t.pendingProps,n),t.child;case 8:return Kt(e,t,t.pendingProps.children,n),t.child;case 12:return Kt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,s=i.value,We(Gf,r._currentValue),r._currentValue=s,o!==null)if(_r(o.value,s)){if(o.children===i.children&&!hn.current){t=vi(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var a=o.dependencies;if(a!==null){s=o.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=hi(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),ny(o.return,n,t),a.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(J(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),ny(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}Kt(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Ea(t,n),i=Xn(i),r=r(i),t.flags|=1,Kt(e,t,r,n),t.child;case 14:return r=t.type,i=sr(r,t.pendingProps),i=sr(r.type,i),Dx(e,t,r,i,n);case 15:return kA(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:sr(r,i),hf(e,t),t.tag=1,pn(r)?(e=!0,Hf(t)):e=!1,Ea(t,n),iA(t,r,i),iy(t,r,i,n),ay(null,t,r,!0,e,n);case 19:return OA(e,t,n);case 22:return TA(e,t,n)}throw Error(J(156,t.tag))};function QA(e,t){return wC(e,t)}function qP(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Gn(e,t,n,r){return new qP(e,t,n,r)}function t2(e){return e=e.prototype,!(!e||!e.isReactComponent)}function GP(e){if(typeof e=="function")return t2(e)?1:0;if(e!=null){if(e=e.$$typeof,e===x1)return 11;if(e===S1)return 14}return 2}function fo(e,t){var n=e.alternate;return n===null?(n=Gn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function mf(e,t,n,r,i,o){var s=2;if(r=e,typeof e=="function")t2(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case na:return ss(n.children,i,o,t);case _1:s=8,i|=8;break;case $m:return e=Gn(12,n,t,i|2),e.elementType=$m,e.lanes=o,e;case km:return e=Gn(13,n,t,i),e.elementType=km,e.lanes=o,e;case Tm:return e=Gn(19,n,t,i),e.elementType=Tm,e.lanes=o,e;case oC:return _0(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case rC:s=10;break e;case iC:s=9;break e;case x1:s=11;break e;case S1:s=14;break e;case Di:s=16,r=null;break e}throw Error(J(130,e==null?e:typeof e,""))}return t=Gn(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function ss(e,t,n,r){return e=Gn(7,e,r,t),e.lanes=n,e}function _0(e,t,n,r){return e=Gn(22,e,r,t),e.elementType=oC,e.lanes=n,e.stateNode={isHidden:!1},e}function ag(e,t,n){return e=Gn(6,e,null,t),e.lanes=n,e}function lg(e,t,n){return t=Gn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function KP(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=zp(0),this.expirationTimes=zp(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=zp(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function n2(e,t,n,r,i,o,s,a,l){return e=new KP(e,t,n,a,l),t===1?(t=1,o===!0&&(t|=8)):t=0,o=Gn(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},F1(o),e}function YP(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(eR)}catch(e){console.error(e)}}eR(),ZE.exports=Nn;var tR=ZE.exports;const eI=zr(tR);var Xx=tR;Am.createRoot=Xx.createRoot,Am.hydrateRoot=Xx.hydrateRoot;function tI(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var nR={exports:{}};const nI={},rI=Object.freeze(Object.defineProperty({__proto__:null,default:nI},Symbol.toStringTag,{value:"Module"})),iI=$L(rI);(function(e,t){(function(n,r){e.exports=r()})(Bo,function(){var n=n||function(r,i){var o;if(typeof window<"u"&&window.crypto&&(o=window.crypto),typeof self<"u"&&self.crypto&&(o=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(o=globalThis.crypto),!o&&typeof window<"u"&&window.msCrypto&&(o=window.msCrypto),!o&&typeof Bo<"u"&&Bo.crypto&&(o=Bo.crypto),!o&&typeof tI=="function")try{o=iI}catch{}var s=function(){if(o){if(typeof o.getRandomValues=="function")try{return o.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof o.randomBytes=="function")try{return o.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},a=Object.create||function(){function p(){}return function(v){var x;return p.prototype=v,x=new p,p.prototype=null,x}}(),l={},u=l.lib={},c=u.Base=function(){return{extend:function(p){var v=a(this);return p&&v.mixIn(p),(!v.hasOwnProperty("init")||this.init===v.init)&&(v.init=function(){v.$super.init.apply(this,arguments)}),v.init.prototype=v,v.$super=this,v},create:function(){var p=this.extend();return p.init.apply(p,arguments),p},init:function(){},mixIn:function(p){for(var v in p)p.hasOwnProperty(v)&&(this[v]=p[v]);p.hasOwnProperty("toString")&&(this.toString=p.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),d=u.WordArray=c.extend({init:function(p,v){p=this.words=p||[],v!=i?this.sigBytes=v:this.sigBytes=p.length*4},toString:function(p){return(p||h).stringify(this)},concat:function(p){var v=this.words,x=p.words,S=this.sigBytes,w=p.sigBytes;if(this.clamp(),S%4)for(var b=0;b>>2]>>>24-b%4*8&255;v[S+b>>>2]|=A<<24-(S+b)%4*8}else for(var k=0;k>>2]=x[k>>>2];return this.sigBytes+=w,this},clamp:function(){var p=this.words,v=this.sigBytes;p[v>>>2]&=4294967295<<32-v%4*8,p.length=r.ceil(v/4)},clone:function(){var p=c.clone.call(this);return p.words=this.words.slice(0),p},random:function(p){for(var v=[],x=0;x>>2]>>>24-w%4*8&255;S.push((b>>>4).toString(16)),S.push((b&15).toString(16))}return S.join("")},parse:function(p){for(var v=p.length,x=[],S=0;S>>3]|=parseInt(p.substr(S,2),16)<<24-S%8*4;return new d.init(x,v/2)}},g=f.Latin1={stringify:function(p){for(var v=p.words,x=p.sigBytes,S=[],w=0;w>>2]>>>24-w%4*8&255;S.push(String.fromCharCode(b))}return S.join("")},parse:function(p){for(var v=p.length,x=[],S=0;S>>2]|=(p.charCodeAt(S)&255)<<24-S%4*8;return new d.init(x,v)}},y=f.Utf8={stringify:function(p){try{return decodeURIComponent(escape(g.stringify(p)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(p){return g.parse(unescape(encodeURIComponent(p)))}},_=u.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new d.init,this._nDataBytes=0},_append:function(p){typeof p=="string"&&(p=y.parse(p)),this._data.concat(p),this._nDataBytes+=p.sigBytes},_process:function(p){var v,x=this._data,S=x.words,w=x.sigBytes,b=this.blockSize,A=b*4,k=w/A;p?k=r.ceil(k):k=r.max((k|0)-this._minBufferSize,0);var R=k*b,M=r.min(R*4,w);if(R){for(var $=0;$>>7)^(k<<14|k>>>18)^k>>>3,M=d[A-2],$=(M<<15|M>>>17)^(M<<13|M>>>19)^M>>>10;d[A]=R+d[A-7]+$+d[A-16]}var T=x&S^~x&w,D=_&m^_&p^m&p,O=(_<<30|_>>>2)^(_<<19|_>>>13)^(_<<10|_>>>22),H=(x<<26|x>>>6)^(x<<21|x>>>11)^(x<<7|x>>>25),Q=b+H+T+c[A]+d[A],V=O+D;b=w,w=S,S=x,x=v+Q|0,v=p,p=m,m=_,_=Q+V|0}y[0]=y[0]+_|0,y[1]=y[1]+m|0,y[2]=y[2]+p|0,y[3]=y[3]+v|0,y[4]=y[4]+x|0,y[5]=y[5]+S|0,y[6]=y[6]+w|0,y[7]=y[7]+b|0},_doFinalize:function(){var h=this._data,g=h.words,y=this._nDataBytes*8,_=h.sigBytes*8;return g[_>>>5]|=128<<24-_%32,g[(_+64>>>9<<4)+14]=r.floor(y/4294967296),g[(_+64>>>9<<4)+15]=y,h.sigBytes=g.length*4,this._process(),this._hash},clone:function(){var h=a.clone.call(this);return h._hash=this._hash.clone(),h}});i.SHA256=a._createHelper(f),i.HmacSHA256=a._createHmacHelper(f)}(Math),n.SHA256})})(rR);var sI=rR.exports;const aI=zr(sI);var iR={exports:{}};(function(e,t){(function(n,r){e.exports=r(E0)})(Bo,function(n){return function(){var r=n,i=r.lib,o=i.WordArray,s=r.enc;s.Base64={stringify:function(l){var u=l.words,c=l.sigBytes,d=this._map;l.clamp();for(var f=[],h=0;h>>2]>>>24-h%4*8&255,y=u[h+1>>>2]>>>24-(h+1)%4*8&255,_=u[h+2>>>2]>>>24-(h+2)%4*8&255,m=g<<16|y<<8|_,p=0;p<4&&h+p*.75>>6*(3-p)&63));var v=d.charAt(64);if(v)for(;f.length%4;)f.push(v);return f.join("")},parse:function(l){var u=l.length,c=this._map,d=this._reverseMap;if(!d){d=this._reverseMap=[];for(var f=0;f>>6-h%4*2,_=g|y;d[f>>>2]|=_<<24-f%4*8,f++}return o.create(d,f)}}(),n.enc.Base64})})(iR);var lI=iR.exports;const Zx=zr(lI);var oR={exports:{}};(function(e,t){(function(n,r){e.exports=r(E0)})(Bo,function(n){return n.enc.Utf8})})(oR);var uI=oR.exports;const cI=zr(uI);function _y(e){this.message=e}_y.prototype=new Error,_y.prototype.name="InvalidCharacterError";var Jx=typeof window<"u"&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new _y("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,r,i=0,o=0,s="";r=t.charAt(o++);~r&&(n=i%4?64*n+r:r,i++%4)?s+=String.fromCharCode(255&n>>(-2*i&6)):0)r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);return s};function dI(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(n){return decodeURIComponent(Jx(n).replace(/(.)/g,function(r,i){var o=i.charCodeAt(0).toString(16).toUpperCase();return o.length<2&&(o="0"+o),"%"+o}))}(t)}catch{return Jx(t)}}function ih(e){this.message=e}function fI(e,t){if(typeof e!="string")throw new ih("Invalid token specified");var n=(t=t||{}).header===!0?0:1;try{return JSON.parse(dI(e.split(".")[n]))}catch(r){throw new ih("Invalid token specified: "+r.message)}}ih.prototype=new Error,ih.prototype.name="InvalidTokenError";var hI={debug:()=>{},info:()=>{},warn:()=>{},error:()=>{}},Cr,Ar,oh=(e=>(e[e.NONE=0]="NONE",e[e.ERROR=1]="ERROR",e[e.WARN=2]="WARN",e[e.INFO=3]="INFO",e[e.DEBUG=4]="DEBUG",e))(oh||{});(e=>{function t(){Cr=3,Ar=hI}e.reset=t;function n(i){if(!(0<=i&&i<=4))throw new Error("Invalid log level");Cr=i}e.setLevel=n;function r(i){Ar=i}e.setLogger=r})(oh||(oh={}));var be=class{constructor(e){this._name=e}debug(...e){Cr>=4&&Ar.debug(be._format(this._name,this._method),...e)}info(...e){Cr>=3&&Ar.info(be._format(this._name,this._method),...e)}warn(...e){Cr>=2&&Ar.warn(be._format(this._name,this._method),...e)}error(...e){Cr>=1&&Ar.error(be._format(this._name,this._method),...e)}throw(e){throw this.error(e),e}create(e){const t=Object.create(this);return t._method=e,t.debug("begin"),t}static createStatic(e,t){const n=new be(`${e}.${t}`);return n.debug("begin"),n}static _format(e,t){const n=`[${e}]`;return t?`${n} ${t}:`:n}static debug(e,...t){Cr>=4&&Ar.debug(be._format(e),...t)}static info(e,...t){Cr>=3&&Ar.info(be._format(e),...t)}static warn(e,...t){Cr>=2&&Ar.warn(be._format(e),...t)}static error(e,...t){Cr>=1&&Ar.error(be._format(e),...t)}};oh.reset();var pI="10000000-1000-4000-8000-100000000000",Or=class{static _randomWord(){return oI.lib.WordArray.random(1).words[0]}static generateUUIDv4(){return pI.replace(/[018]/g,t=>(+t^Or._randomWord()&15>>+t/4).toString(16)).replace(/-/g,"")}static generateCodeVerifier(){return Or.generateUUIDv4()+Or.generateUUIDv4()+Or.generateUUIDv4()}static generateCodeChallenge(e){try{const t=aI(e);return Zx.stringify(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}catch(t){throw be.error("CryptoUtils.generateCodeChallenge",t),t}}static generateBasicAuth(e,t){const n=cI.parse([e,t].join(":"));return Zx.stringify(n)}},Fi=class{constructor(e){this._name=e,this._logger=new be(`Event('${this._name}')`),this._callbacks=[]}addHandler(e){return this._callbacks.push(e),()=>this.removeHandler(e)}removeHandler(e){const t=this._callbacks.lastIndexOf(e);t>=0&&this._callbacks.splice(t,1)}raise(...e){this._logger.debug("raise:",...e);for(const t of this._callbacks)t(...e)}},xy=class{static decode(e){try{return fI(e)}catch(t){throw be.error("JwtUtils.decode",t),t}}},eS=class{static center({...e}){var t,n,r;return e.width==null&&(e.width=(t=[800,720,600,480].find(i=>i<=window.outerWidth/1.618))!=null?t:360),(n=e.left)!=null||(e.left=Math.max(0,Math.round(window.screenX+(window.outerWidth-e.width)/2))),e.height!=null&&((r=e.top)!=null||(e.top=Math.max(0,Math.round(window.screenY+(window.outerHeight-e.height)/2)))),e}static serialize(e){return Object.entries(e).filter(([,t])=>t!=null).map(([t,n])=>`${t}=${typeof n!="boolean"?n:n?"yes":"no"}`).join(",")}},Yn=class extends Fi{constructor(){super(...arguments),this._logger=new be(`Timer('${this._name}')`),this._timerHandle=null,this._expiration=0,this._callback=()=>{const e=this._expiration-Yn.getEpochTime();this._logger.debug("timer completes in",e),this._expiration<=Yn.getEpochTime()&&(this.cancel(),super.raise())}}static getEpochTime(){return Math.floor(Date.now()/1e3)}init(e){const t=this._logger.create("init");e=Math.max(Math.floor(e),1);const n=Yn.getEpochTime()+e;if(this.expiration===n&&this._timerHandle){t.debug("skipping since already initialized for expiration at",this.expiration);return}this.cancel(),t.debug("using duration",e),this._expiration=n;const r=Math.min(e,5);this._timerHandle=setInterval(this._callback,r*1e3)}get expiration(){return this._expiration}cancel(){this._logger.create("cancel"),this._timerHandle&&(clearInterval(this._timerHandle),this._timerHandle=null)}},Sy=class{static readParams(e,t="query"){if(!e)throw new TypeError("Invalid URL");const r=new URL(e,"http://127.0.0.1")[t==="fragment"?"hash":"search"];return new URLSearchParams(r.slice(1))}},wy=";",_s=class extends Error{constructor(e,t){var n,r,i;if(super(e.error_description||e.error||""),this.form=t,this.name="ErrorResponse",!e.error)throw be.error("ErrorResponse","No error passed"),new Error("No error passed");this.error=e.error,this.error_description=(n=e.error_description)!=null?n:null,this.error_uri=(r=e.error_uri)!=null?r:null,this.state=e.userState,this.session_state=(i=e.session_state)!=null?i:null,this.url_state=e.url_state}},s2=class extends Error{constructor(e){super(e),this.name="ErrorTimeout"}},gI=class{constructor(e){this._logger=new be("AccessTokenEvents"),this._expiringTimer=new Yn("Access token expiring"),this._expiredTimer=new Yn("Access token expired"),this._expiringNotificationTimeInSeconds=e.expiringNotificationTimeInSeconds}load(e){const t=this._logger.create("load");if(e.access_token&&e.expires_in!==void 0){const n=e.expires_in;if(t.debug("access token present, remaining duration:",n),n>0){let i=n-this._expiringNotificationTimeInSeconds;i<=0&&(i=1),t.debug("registering expiring timer, raising in",i,"seconds"),this._expiringTimer.init(i)}else t.debug("canceling existing expiring timer because we're past expiration."),this._expiringTimer.cancel();const r=n+1;t.debug("registering expired timer, raising in",r,"seconds"),this._expiredTimer.init(r)}else this._expiringTimer.cancel(),this._expiredTimer.cancel()}unload(){this._logger.debug("unload: canceling existing access token timers"),this._expiringTimer.cancel(),this._expiredTimer.cancel()}addAccessTokenExpiring(e){return this._expiringTimer.addHandler(e)}removeAccessTokenExpiring(e){this._expiringTimer.removeHandler(e)}addAccessTokenExpired(e){return this._expiredTimer.addHandler(e)}removeAccessTokenExpired(e){this._expiredTimer.removeHandler(e)}},mI=class{constructor(e,t,n,r,i){this._callback=e,this._client_id=t,this._intervalInSeconds=r,this._stopOnError=i,this._logger=new be("CheckSessionIFrame"),this._timer=null,this._session_state=null,this._message=s=>{s.origin===this._frame_origin&&s.source===this._frame.contentWindow&&(s.data==="error"?(this._logger.error("error message from check session op iframe"),this._stopOnError&&this.stop()):s.data==="changed"?(this._logger.debug("changed message from check session op iframe"),this.stop(),this._callback()):this._logger.debug(s.data+" message from check session op iframe"))};const o=new URL(n);this._frame_origin=o.origin,this._frame=window.document.createElement("iframe"),this._frame.style.visibility="hidden",this._frame.style.position="fixed",this._frame.style.left="-1000px",this._frame.style.top="0",this._frame.width="0",this._frame.height="0",this._frame.src=o.href}load(){return new Promise(e=>{this._frame.onload=()=>{e()},window.document.body.appendChild(this._frame),window.addEventListener("message",this._message,!1)})}start(e){if(this._session_state===e)return;this._logger.create("start"),this.stop(),this._session_state=e;const t=()=>{!this._frame.contentWindow||!this._session_state||this._frame.contentWindow.postMessage(this._client_id+" "+this._session_state,this._frame_origin)};t(),this._timer=setInterval(t,this._intervalInSeconds*1e3)}stop(){this._logger.create("stop"),this._session_state=null,this._timer&&(clearInterval(this._timer),this._timer=null)}},sR=class{constructor(){this._logger=new be("InMemoryWebStorage"),this._data={}}clear(){this._logger.create("clear"),this._data={}}getItem(e){return this._logger.create(`getItem('${e}')`),this._data[e]}setItem(e,t){this._logger.create(`setItem('${e}')`),this._data[e]=t}removeItem(e){this._logger.create(`removeItem('${e}')`),delete this._data[e]}get length(){return Object.getOwnPropertyNames(this._data).length}key(e){return Object.getOwnPropertyNames(this._data)[e]}},a2=class{constructor(e=[],t=null,n={}){this._jwtHandler=t,this._extraHeaders=n,this._logger=new be("JsonService"),this._contentTypes=[],this._contentTypes.push(...e,"application/json"),t&&this._contentTypes.push("application/jwt")}async fetchWithTimeout(e,t={}){const{timeoutInSeconds:n,...r}=t;if(!n)return await fetch(e,r);const i=new AbortController,o=setTimeout(()=>i.abort(),n*1e3);try{return await fetch(e,{...t,signal:i.signal})}catch(s){throw s instanceof DOMException&&s.name==="AbortError"?new s2("Network timed out"):s}finally{clearTimeout(o)}}async getJson(e,{token:t,credentials:n}={}){const r=this._logger.create("getJson"),i={Accept:this._contentTypes.join(", ")};t&&(r.debug("token passed, setting Authorization header"),i.Authorization="Bearer "+t),this.appendExtraHeaders(i);let o;try{r.debug("url:",e),o=await this.fetchWithTimeout(e,{method:"GET",headers:i,credentials:n})}catch(l){throw r.error("Network Error"),l}r.debug("HTTP response received, status",o.status);const s=o.headers.get("Content-Type");if(s&&!this._contentTypes.find(l=>s.startsWith(l))&&r.throw(new Error(`Invalid response Content-Type: ${s??"undefined"}, from URL: ${e}`)),o.ok&&this._jwtHandler&&(s!=null&&s.startsWith("application/jwt")))return await this._jwtHandler(await o.text());let a;try{a=await o.json()}catch(l){throw r.error("Error parsing JSON response",l),o.ok?l:new Error(`${o.statusText} (${o.status})`)}if(!o.ok)throw r.error("Error from server:",a),a.error?new _s(a):new Error(`${o.statusText} (${o.status}): ${JSON.stringify(a)}`);return a}async postForm(e,{body:t,basicAuth:n,timeoutInSeconds:r,initCredentials:i}){const o=this._logger.create("postForm"),s={Accept:this._contentTypes.join(", "),"Content-Type":"application/x-www-form-urlencoded"};n!==void 0&&(s.Authorization="Basic "+n),this.appendExtraHeaders(s);let a;try{o.debug("url:",e),a=await this.fetchWithTimeout(e,{method:"POST",headers:s,body:t,timeoutInSeconds:r,credentials:i})}catch(d){throw o.error("Network error"),d}o.debug("HTTP response received, status",a.status);const l=a.headers.get("Content-Type");if(l&&!this._contentTypes.find(d=>l.startsWith(d)))throw new Error(`Invalid response Content-Type: ${l??"undefined"}, from URL: ${e}`);const u=await a.text();let c={};if(u)try{c=JSON.parse(u)}catch(d){throw o.error("Error parsing JSON response",d),a.ok?d:new Error(`${a.statusText} (${a.status})`)}if(!a.ok)throw o.error("Error from server:",c),c.error?new _s(c,t):new Error(`${a.statusText} (${a.status}): ${JSON.stringify(c)}`);return c}appendExtraHeaders(e){const t=this._logger.create("appendExtraHeaders"),n=Object.keys(this._extraHeaders),r=["authorization","accept","content-type"];n.length!==0&&n.forEach(i=>{if(r.includes(i.toLocaleLowerCase())){t.warn("Protected header could not be overridden",i,r);return}const o=typeof this._extraHeaders[i]=="function"?this._extraHeaders[i]():this._extraHeaders[i];o&&o!==""&&(e[i]=o)})}},yI=class{constructor(e){this._settings=e,this._logger=new be("MetadataService"),this._signingKeys=null,this._metadata=null,this._metadataUrl=this._settings.metadataUrl,this._jsonService=new a2(["application/jwk-set+json"],null,this._settings.extraHeaders),this._settings.signingKeys&&(this._logger.debug("using signingKeys from settings"),this._signingKeys=this._settings.signingKeys),this._settings.metadata&&(this._logger.debug("using metadata from settings"),this._metadata=this._settings.metadata),this._settings.fetchRequestCredentials&&(this._logger.debug("using fetchRequestCredentials from settings"),this._fetchRequestCredentials=this._settings.fetchRequestCredentials)}resetSigningKeys(){this._signingKeys=null}async getMetadata(){const e=this._logger.create("getMetadata");if(this._metadata)return e.debug("using cached values"),this._metadata;if(!this._metadataUrl)throw e.throw(new Error("No authority or metadataUrl configured on settings")),null;e.debug("getting metadata from",this._metadataUrl);const t=await this._jsonService.getJson(this._metadataUrl,{credentials:this._fetchRequestCredentials});return e.debug("merging remote JSON with seed metadata"),this._metadata=Object.assign({},this._settings.metadataSeed,t),this._metadata}getIssuer(){return this._getMetadataProperty("issuer")}getAuthorizationEndpoint(){return this._getMetadataProperty("authorization_endpoint")}getUserInfoEndpoint(){return this._getMetadataProperty("userinfo_endpoint")}getTokenEndpoint(e=!0){return this._getMetadataProperty("token_endpoint",e)}getCheckSessionIframe(){return this._getMetadataProperty("check_session_iframe",!0)}getEndSessionEndpoint(){return this._getMetadataProperty("end_session_endpoint",!0)}getRevocationEndpoint(e=!0){return this._getMetadataProperty("revocation_endpoint",e)}getKeysEndpoint(e=!0){return this._getMetadataProperty("jwks_uri",e)}async _getMetadataProperty(e,t=!1){const n=this._logger.create(`_getMetadataProperty('${e}')`),r=await this.getMetadata();if(n.debug("resolved"),r[e]===void 0){if(t===!0){n.warn("Metadata does not contain optional property");return}n.throw(new Error("Metadata does not contain property "+e))}return r[e]}async getSigningKeys(){const e=this._logger.create("getSigningKeys");if(this._signingKeys)return e.debug("returning signingKeys from cache"),this._signingKeys;const t=await this.getKeysEndpoint(!1);e.debug("got jwks_uri",t);const n=await this._jsonService.getJson(t);if(e.debug("got key set",n),!Array.isArray(n.keys))throw e.throw(new Error("Missing keys on keyset")),null;return this._signingKeys=n.keys,this._signingKeys}},l2=class{constructor({prefix:e="oidc.",store:t=localStorage}={}){this._logger=new be("WebStorageStateStore"),this._store=t,this._prefix=e}async set(e,t){this._logger.create(`set('${e}')`),e=this._prefix+e,await this._store.setItem(e,t)}async get(e){return this._logger.create(`get('${e}')`),e=this._prefix+e,await this._store.getItem(e)}async remove(e){this._logger.create(`remove('${e}')`),e=this._prefix+e;const t=await this._store.getItem(e);return await this._store.removeItem(e),t}async getAllKeys(){this._logger.create("getAllKeys");const e=await this._store.length,t=[];for(let n=0;n{const r=this._logger.create("_getClaimsFromJwt");try{const i=xy.decode(n);return r.debug("JWT decoding successful"),i}catch(i){throw r.error("Error parsing JWT response"),i}},this._jsonService=new a2(void 0,this._getClaimsFromJwt,this._settings.extraHeaders)}async getClaims(e){const t=this._logger.create("getClaims");e||this._logger.throw(new Error("No token passed"));const n=await this._metadataService.getUserInfoEndpoint();t.debug("got userinfo url",n);const r=await this._jsonService.getJson(n,{token:e,credentials:this._settings.fetchRequestCredentials});return t.debug("got claims",r),r}},aR=class{constructor(e,t){this._settings=e,this._metadataService=t,this._logger=new be("TokenClient"),this._jsonService=new a2(this._settings.revokeTokenAdditionalContentTypes,null,this._settings.extraHeaders)}async exchangeCode({grant_type:e="authorization_code",redirect_uri:t=this._settings.redirect_uri,client_id:n=this._settings.client_id,client_secret:r=this._settings.client_secret,...i}){const o=this._logger.create("exchangeCode");n||o.throw(new Error("A client_id is required")),t||o.throw(new Error("A redirect_uri is required")),i.code||o.throw(new Error("A code is required"));const s=new URLSearchParams({grant_type:e,redirect_uri:t});for(const[c,d]of Object.entries(i))d!=null&&s.set(c,d);let a;switch(this._settings.client_authentication){case"client_secret_basic":if(!r)throw o.throw(new Error("A client_secret is required")),null;a=Or.generateBasicAuth(n,r);break;case"client_secret_post":s.append("client_id",n),r&&s.append("client_secret",r);break}const l=await this._metadataService.getTokenEndpoint(!1);o.debug("got token endpoint");const u=await this._jsonService.postForm(l,{body:s,basicAuth:a,initCredentials:this._settings.fetchRequestCredentials});return o.debug("got response"),u}async exchangeCredentials({grant_type:e="password",client_id:t=this._settings.client_id,client_secret:n=this._settings.client_secret,scope:r=this._settings.scope,...i}){const o=this._logger.create("exchangeCredentials");t||o.throw(new Error("A client_id is required"));const s=new URLSearchParams({grant_type:e,scope:r});for(const[c,d]of Object.entries(i))d!=null&&s.set(c,d);let a;switch(this._settings.client_authentication){case"client_secret_basic":if(!n)throw o.throw(new Error("A client_secret is required")),null;a=Or.generateBasicAuth(t,n);break;case"client_secret_post":s.append("client_id",t),n&&s.append("client_secret",n);break}const l=await this._metadataService.getTokenEndpoint(!1);o.debug("got token endpoint");const u=await this._jsonService.postForm(l,{body:s,basicAuth:a,initCredentials:this._settings.fetchRequestCredentials});return o.debug("got response"),u}async exchangeRefreshToken({grant_type:e="refresh_token",client_id:t=this._settings.client_id,client_secret:n=this._settings.client_secret,timeoutInSeconds:r,...i}){const o=this._logger.create("exchangeRefreshToken");t||o.throw(new Error("A client_id is required")),i.refresh_token||o.throw(new Error("A refresh_token is required"));const s=new URLSearchParams({grant_type:e});for(const[c,d]of Object.entries(i))Array.isArray(d)?d.forEach(f=>s.append(c,f)):d!=null&&s.set(c,d);let a;switch(this._settings.client_authentication){case"client_secret_basic":if(!n)throw o.throw(new Error("A client_secret is required")),null;a=Or.generateBasicAuth(t,n);break;case"client_secret_post":s.append("client_id",t),n&&s.append("client_secret",n);break}const l=await this._metadataService.getTokenEndpoint(!1);o.debug("got token endpoint");const u=await this._jsonService.postForm(l,{body:s,basicAuth:a,timeoutInSeconds:r,initCredentials:this._settings.fetchRequestCredentials});return o.debug("got response"),u}async revoke(e){var t;const n=this._logger.create("revoke");e.token||n.throw(new Error("A token is required"));const r=await this._metadataService.getRevocationEndpoint(!1);n.debug(`got revocation endpoint, revoking ${(t=e.token_type_hint)!=null?t:"default token type"}`);const i=new URLSearchParams;for(const[o,s]of Object.entries(e))s!=null&&i.set(o,s);i.set("client_id",this._settings.client_id),this._settings.client_secret&&i.set("client_secret",this._settings.client_secret),await this._jsonService.postForm(r,{body:i}),n.debug("got response")}},CI=class{constructor(e,t,n){this._settings=e,this._metadataService=t,this._claimsService=n,this._logger=new be("ResponseValidator"),this._userInfoService=new EI(this._settings,this._metadataService),this._tokenClient=new aR(this._settings,this._metadataService)}async validateSigninResponse(e,t){const n=this._logger.create("validateSigninResponse");this._processSigninState(e,t),n.debug("state processed"),await this._processCode(e,t),n.debug("code processed"),e.isOpenId&&this._validateIdTokenAttributes(e),n.debug("tokens validated"),await this._processClaims(e,t==null?void 0:t.skipUserInfo,e.isOpenId),n.debug("claims processed")}async validateCredentialsResponse(e,t){const n=this._logger.create("validateCredentialsResponse");e.isOpenId&&e.id_token&&this._validateIdTokenAttributes(e),n.debug("tokens validated"),await this._processClaims(e,t,e.isOpenId),n.debug("claims processed")}async validateRefreshResponse(e,t){var n,r;const i=this._logger.create("validateRefreshResponse");e.userState=t.data,(n=e.session_state)!=null||(e.session_state=t.session_state),(r=e.scope)!=null||(e.scope=t.scope),e.isOpenId&&e.id_token&&(this._validateIdTokenAttributes(e,t.id_token),i.debug("ID Token validated")),e.id_token||(e.id_token=t.id_token,e.profile=t.profile);const o=e.isOpenId&&!!e.id_token;await this._processClaims(e,!1,o),i.debug("claims processed")}validateSignoutResponse(e,t){const n=this._logger.create("validateSignoutResponse");if(t.id!==e.state&&n.throw(new Error("State does not match")),n.debug("state validated"),e.userState=t.data,e.error)throw n.warn("Response was error",e.error),new _s(e)}_processSigninState(e,t){var n;const r=this._logger.create("_processSigninState");if(t.id!==e.state&&r.throw(new Error("State does not match")),t.client_id||r.throw(new Error("No client_id on state")),t.authority||r.throw(new Error("No authority on state")),this._settings.authority!==t.authority&&r.throw(new Error("authority mismatch on settings vs. signin state")),this._settings.client_id&&this._settings.client_id!==t.client_id&&r.throw(new Error("client_id mismatch on settings vs. signin state")),r.debug("state validated"),e.userState=t.data,e.url_state=t.url_state,(n=e.scope)!=null||(e.scope=t.scope),e.error)throw r.warn("Response was error",e.error),new _s(e);t.code_verifier&&!e.code&&r.throw(new Error("Expected code in response"))}async _processClaims(e,t=!1,n=!0){const r=this._logger.create("_processClaims");if(e.profile=this._claimsService.filterProtocolClaims(e.profile),t||!this._settings.loadUserInfo||!e.access_token){r.debug("not loading user info");return}r.debug("loading user info");const i=await this._userInfoService.getClaims(e.access_token);r.debug("user info claims received from user info endpoint"),n&&i.sub!==e.profile.sub&&r.throw(new Error("subject from UserInfo response does not match subject in ID Token")),e.profile=this._claimsService.mergeClaims(e.profile,this._claimsService.filterProtocolClaims(i)),r.debug("user info claims received, updated profile:",e.profile)}async _processCode(e,t){const n=this._logger.create("_processCode");if(e.code){n.debug("Validating code");const r=await this._tokenClient.exchangeCode({client_id:t.client_id,client_secret:t.client_secret,code:e.code,redirect_uri:t.redirect_uri,code_verifier:t.code_verifier,...t.extraTokenParams});Object.assign(e,r)}else n.debug("No code to process")}_validateIdTokenAttributes(e,t){var n;const r=this._logger.create("_validateIdTokenAttributes");r.debug("decoding ID Token JWT");const i=xy.decode((n=e.id_token)!=null?n:"");if(i.sub||r.throw(new Error("ID Token is missing a subject claim")),t){const o=xy.decode(t);i.sub!==o.sub&&r.throw(new Error("sub in id_token does not match current sub")),i.auth_time&&i.auth_time!==o.auth_time&&r.throw(new Error("auth_time in id_token does not match original auth_time")),i.azp&&i.azp!==o.azp&&r.throw(new Error("azp in id_token does not match original azp")),!i.azp&&o.azp&&r.throw(new Error("azp not in id_token, but present in original id_token"))}e.profile=i}},tl=class{constructor(e){this.id=e.id||Or.generateUUIDv4(),this.data=e.data,e.created&&e.created>0?this.created=e.created:this.created=Yn.getEpochTime(),this.request_type=e.request_type,this.url_state=e.url_state}toStorageString(){return new be("State").create("toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type,url_state:this.url_state})}static fromStorageString(e){return be.createStatic("State","fromStorageString"),new tl(JSON.parse(e))}static async clearStaleState(e,t){const n=be.createStatic("State","clearStaleState"),r=Yn.getEpochTime()-t,i=await e.getAllKeys();n.debug("got keys",i);for(let o=0;op.searchParams.append("resource",S));for(const[x,S]of Object.entries({response_mode:a,...m,...g}))S!=null&&p.searchParams.append(x,S.toString());this.url=p.href}},RI="openid",ug=class{constructor(e){if(this.access_token="",this.token_type="",this.profile={},this.state=e.get("state"),this.session_state=e.get("session_state"),this.state){const t=decodeURIComponent(this.state).split(wy);this.state=t[0],t.length>1&&(this.url_state=t.slice(1).join(wy))}this.error=e.get("error"),this.error_description=e.get("error_description"),this.error_uri=e.get("error_uri"),this.code=e.get("code")}get expires_in(){if(this.expires_at!==void 0)return this.expires_at-Yn.getEpochTime()}set expires_in(e){typeof e=="string"&&(e=Number(e)),e!==void 0&&e>=0&&(this.expires_at=Math.floor(e)+Yn.getEpochTime())}get isOpenId(){var e;return((e=this.scope)==null?void 0:e.split(" ").includes(RI))||!!this.id_token}},$I=class{constructor({url:e,state_data:t,id_token_hint:n,post_logout_redirect_uri:r,extraQueryParams:i,request_type:o,client_id:s}){if(this._logger=new be("SignoutRequest"),!e)throw this._logger.error("ctor: No url passed"),new Error("url");const a=new URL(e);n&&a.searchParams.append("id_token_hint",n),s&&a.searchParams.append("client_id",s),r&&(a.searchParams.append("post_logout_redirect_uri",r),t&&(this.state=new tl({data:t,request_type:o}),a.searchParams.append("state",this.state.id)));for(const[l,u]of Object.entries({...i}))u!=null&&a.searchParams.append(l,u.toString());this.url=a.href}},kI=class{constructor(e){this.state=e.get("state"),this.error=e.get("error"),this.error_description=e.get("error_description"),this.error_uri=e.get("error_uri")}},TI=["nbf","jti","auth_time","nonce","acr","amr","azp","at_hash"],MI=["sub","iss","aud","exp","iat"],NI=class{constructor(e){this._settings=e,this._logger=new be("ClaimsService")}filterProtocolClaims(e){const t={...e};if(this._settings.filterProtocolClaims){let n;Array.isArray(this._settings.filterProtocolClaims)?n=this._settings.filterProtocolClaims:n=TI;for(const r of n)MI.includes(r)||delete t[r]}return t}mergeClaims(e,t){const n={...e};for(const[r,i]of Object.entries(t))for(const o of Array.isArray(i)?i:[i]){const s=n[r];s===void 0?n[r]=o:Array.isArray(s)?s.includes(o)||s.push(o):n[r]!==o&&(typeof o=="object"&&this._settings.mergeClaims?n[r]=this.mergeClaims(s,o):n[r]=[s,o])}return n}},LI=class{constructor(e,t){this._logger=new be("OidcClient"),this.settings=e instanceof by?e:new by(e),this.metadataService=t??new yI(this.settings),this._claimsService=new NI(this.settings),this._validator=new CI(this.settings,this.metadataService,this._claimsService),this._tokenClient=new aR(this.settings,this.metadataService)}async createSigninRequest({state:e,request:t,request_uri:n,request_type:r,id_token_hint:i,login_hint:o,skipUserInfo:s,nonce:a,url_state:l,response_type:u=this.settings.response_type,scope:c=this.settings.scope,redirect_uri:d=this.settings.redirect_uri,prompt:f=this.settings.prompt,display:h=this.settings.display,max_age:g=this.settings.max_age,ui_locales:y=this.settings.ui_locales,acr_values:_=this.settings.acr_values,resource:m=this.settings.resource,response_mode:p=this.settings.response_mode,extraQueryParams:v=this.settings.extraQueryParams,extraTokenParams:x=this.settings.extraTokenParams}){const S=this._logger.create("createSigninRequest");if(u!=="code")throw new Error("Only the Authorization Code flow (with PKCE) is supported");const w=await this.metadataService.getAuthorizationEndpoint();S.debug("Received authorization endpoint",w);const b=new AI({url:w,authority:this.settings.authority,client_id:this.settings.client_id,redirect_uri:d,response_type:u,scope:c,state_data:e,url_state:l,prompt:f,display:h,max_age:g,ui_locales:y,id_token_hint:i,login_hint:o,acr_values:_,resource:m,request:t,request_uri:n,extraQueryParams:v,extraTokenParams:x,request_type:r,response_mode:p,client_secret:this.settings.client_secret,skipUserInfo:s,nonce:a,disablePKCE:this.settings.disablePKCE});await this.clearStaleState();const A=b.state;return await this.settings.stateStore.set(A.id,A.toStorageString()),b}async readSigninResponseState(e,t=!1){const n=this._logger.create("readSigninResponseState"),r=new ug(Sy.readParams(e,this.settings.response_mode));if(!r.state)throw n.throw(new Error("No state in response")),null;const i=await this.settings.stateStore[t?"remove":"get"](r.state);if(!i)throw n.throw(new Error("No matching state found in storage")),null;return{state:u2.fromStorageString(i),response:r}}async processSigninResponse(e){const t=this._logger.create("processSigninResponse"),{state:n,response:r}=await this.readSigninResponseState(e,!0);return t.debug("received state from storage; validating response"),await this._validator.validateSigninResponse(r,n),r}async processResourceOwnerPasswordCredentials({username:e,password:t,skipUserInfo:n=!1,extraTokenParams:r={}}){const i=await this._tokenClient.exchangeCredentials({username:e,password:t,...r}),o=new ug(new URLSearchParams);return Object.assign(o,i),await this._validator.validateCredentialsResponse(o,n),o}async useRefreshToken({state:e,timeoutInSeconds:t}){var n;const r=this._logger.create("useRefreshToken");let i;if(this.settings.refreshTokenAllowedScope===void 0)i=e.scope;else{const a=this.settings.refreshTokenAllowedScope.split(" ");i=(((n=e.scope)==null?void 0:n.split(" "))||[]).filter(u=>a.includes(u)).join(" ")}const o=await this._tokenClient.exchangeRefreshToken({refresh_token:e.refresh_token,resource:e.resource,scope:i,timeoutInSeconds:t}),s=new ug(new URLSearchParams);return Object.assign(s,o),r.debug("validating response",s),await this._validator.validateRefreshResponse(s,{...e,scope:i}),s}async createSignoutRequest({state:e,id_token_hint:t,client_id:n,request_type:r,post_logout_redirect_uri:i=this.settings.post_logout_redirect_uri,extraQueryParams:o=this.settings.extraQueryParams}={}){const s=this._logger.create("createSignoutRequest"),a=await this.metadataService.getEndSessionEndpoint();if(!a)throw s.throw(new Error("No end session endpoint")),null;s.debug("Received end session endpoint",a),!n&&i&&!t&&(n=this.settings.client_id);const l=new $I({url:a,id_token_hint:t,client_id:n,post_logout_redirect_uri:i,state_data:e,extraQueryParams:o,request_type:r});await this.clearStaleState();const u=l.state;return u&&(s.debug("Signout request has state to persist"),await this.settings.stateStore.set(u.id,u.toStorageString())),l}async readSignoutResponseState(e,t=!1){const n=this._logger.create("readSignoutResponseState"),r=new kI(Sy.readParams(e,this.settings.response_mode));if(!r.state){if(n.debug("No state in response"),r.error)throw n.warn("Response was error:",r.error),new _s(r);return{state:void 0,response:r}}const i=await this.settings.stateStore[t?"remove":"get"](r.state);if(!i)throw n.throw(new Error("No matching state found in storage")),null;return{state:tl.fromStorageString(i),response:r}}async processSignoutResponse(e){const t=this._logger.create("processSignoutResponse"),{state:n,response:r}=await this.readSignoutResponseState(e,!0);return n?(t.debug("Received state from storage; validating response"),this._validator.validateSignoutResponse(r,n)):t.debug("No state from storage; skipping response validation"),r}clearStaleState(){return this._logger.create("clearStaleState"),tl.clearStaleState(this.settings.stateStore,this.settings.staleStateAgeInSeconds)}async revokeToken(e,t){return this._logger.create("revokeToken"),await this._tokenClient.revoke({token:e,token_type_hint:t})}},OI=class{constructor(e){this._userManager=e,this._logger=new be("SessionMonitor"),this._start=async t=>{const n=t.session_state;if(!n)return;const r=this._logger.create("_start");if(t.profile?(this._sub=t.profile.sub,this._sid=t.profile.sid,r.debug("session_state",n,", sub",this._sub)):(this._sub=void 0,this._sid=void 0,r.debug("session_state",n,", anonymous user")),this._checkSessionIFrame){this._checkSessionIFrame.start(n);return}try{const i=await this._userManager.metadataService.getCheckSessionIframe();if(i){r.debug("initializing check session iframe");const o=this._userManager.settings.client_id,s=this._userManager.settings.checkSessionIntervalInSeconds,a=this._userManager.settings.stopCheckSessionOnError,l=new mI(this._callback,o,i,s,a);await l.load(),this._checkSessionIFrame=l,l.start(n)}else r.warn("no check session iframe found in the metadata")}catch(i){r.error("Error from getCheckSessionIframe:",i instanceof Error?i.message:i)}},this._stop=()=>{const t=this._logger.create("_stop");if(this._sub=void 0,this._sid=void 0,this._checkSessionIFrame&&this._checkSessionIFrame.stop(),this._userManager.settings.monitorAnonymousSession){const n=setInterval(async()=>{clearInterval(n);try{const r=await this._userManager.querySessionStatus();if(r){const i={session_state:r.session_state,profile:r.sub&&r.sid?{sub:r.sub,sid:r.sid}:null};this._start(i)}}catch(r){t.error("error from querySessionStatus",r instanceof Error?r.message:r)}},1e3)}},this._callback=async()=>{const t=this._logger.create("_callback");try{const n=await this._userManager.querySessionStatus();let r=!0;n&&this._checkSessionIFrame?n.sub===this._sub?(r=!1,this._checkSessionIFrame.start(n.session_state),n.sid===this._sid?t.debug("same sub still logged in at OP, restarting check session iframe; session_state",n.session_state):(t.debug("same sub still logged in at OP, session state has changed, restarting check session iframe; session_state",n.session_state),this._userManager.events._raiseUserSessionChanged())):t.debug("different subject signed into OP",n.sub):t.debug("subject no longer signed into OP"),r?this._sub?this._userManager.events._raiseUserSignedOut():this._userManager.events._raiseUserSignedIn():t.debug("no change in session detected, no event to raise")}catch(n){this._sub&&(t.debug("Error calling queryCurrentSigninSession; raising signed out event",n),this._userManager.events._raiseUserSignedOut())}},e||this._logger.throw(new Error("No user manager passed")),this._userManager.events.addUserLoaded(this._start),this._userManager.events.addUserUnloaded(this._stop),this._init().catch(t=>{this._logger.error(t)})}async _init(){this._logger.create("_init");const e=await this._userManager.getUser();if(e)this._start(e);else if(this._userManager.settings.monitorAnonymousSession){const t=await this._userManager.querySessionStatus();if(t){const n={session_state:t.session_state,profile:t.sub&&t.sid?{sub:t.sub,sid:t.sid}:null};this._start(n)}}}},yf=class{constructor(e){var t;this.id_token=e.id_token,this.session_state=(t=e.session_state)!=null?t:null,this.access_token=e.access_token,this.refresh_token=e.refresh_token,this.token_type=e.token_type,this.scope=e.scope,this.profile=e.profile,this.expires_at=e.expires_at,this.state=e.userState,this.url_state=e.url_state}get expires_in(){if(this.expires_at!==void 0)return this.expires_at-Yn.getEpochTime()}set expires_in(e){e!==void 0&&(this.expires_at=Math.floor(e)+Yn.getEpochTime())}get expired(){const e=this.expires_in;if(e!==void 0)return e<=0}get scopes(){var e,t;return(t=(e=this.scope)==null?void 0:e.split(" "))!=null?t:[]}toStorageString(){return new be("User").create("toStorageString"),JSON.stringify({id_token:this.id_token,session_state:this.session_state,access_token:this.access_token,refresh_token:this.refresh_token,token_type:this.token_type,scope:this.scope,profile:this.profile,expires_at:this.expires_at})}static fromStorageString(e){return be.createStatic("User","fromStorageString"),new yf(JSON.parse(e))}},tS="oidc-client",lR=class{constructor(){this._abort=new Fi("Window navigation aborted"),this._disposeHandlers=new Set,this._window=null}async navigate(e){const t=this._logger.create("navigate");if(!this._window)throw new Error("Attempted to navigate on a disposed window");t.debug("setting URL in window"),this._window.location.replace(e.url);const{url:n,keepOpen:r}=await new Promise((i,o)=>{const s=a=>{var l;const u=a.data,c=(l=e.scriptOrigin)!=null?l:window.location.origin;if(!(a.origin!==c||(u==null?void 0:u.source)!==tS)){try{const d=Sy.readParams(u.url,e.response_mode).get("state");if(d||t.warn("no state found in response url"),a.source!==this._window&&d!==e.state)return}catch{this._dispose(),o(new Error("Invalid response from window"))}i(u)}};window.addEventListener("message",s,!1),this._disposeHandlers.add(()=>window.removeEventListener("message",s,!1)),this._disposeHandlers.add(this._abort.addHandler(a=>{this._dispose(),o(a)}))});return t.debug("got response from window"),this._dispose(),r||this.close(),{url:n}}_dispose(){this._logger.create("_dispose");for(const e of this._disposeHandlers)e();this._disposeHandlers.clear()}static _notifyParent(e,t,n=!1,r=window.location.origin){e.postMessage({source:tS,url:t,keepOpen:n},r)}},uR={location:!1,toolbar:!1,height:640,closePopupWindowAfterInSeconds:-1},cR="_blank",PI=60,II=2,dR=10,DI=class extends by{constructor(e){const{popup_redirect_uri:t=e.redirect_uri,popup_post_logout_redirect_uri:n=e.post_logout_redirect_uri,popupWindowFeatures:r=uR,popupWindowTarget:i=cR,redirectMethod:o="assign",redirectTarget:s="self",iframeNotifyParentOrigin:a=e.iframeNotifyParentOrigin,iframeScriptOrigin:l=e.iframeScriptOrigin,silent_redirect_uri:u=e.redirect_uri,silentRequestTimeoutInSeconds:c=dR,automaticSilentRenew:d=!0,validateSubOnSilentRenew:f=!0,includeIdTokenInSilentRenew:h=!1,monitorSession:g=!1,monitorAnonymousSession:y=!1,checkSessionIntervalInSeconds:_=II,query_status_response_type:m="code",stopCheckSessionOnError:p=!0,revokeTokenTypes:v=["access_token","refresh_token"],revokeTokensOnSignout:x=!1,includeIdTokenInSilentSignout:S=!1,accessTokenExpiringNotificationTimeInSeconds:w=PI,userStore:b}=e;if(super(e),this.popup_redirect_uri=t,this.popup_post_logout_redirect_uri=n,this.popupWindowFeatures=r,this.popupWindowTarget=i,this.redirectMethod=o,this.redirectTarget=s,this.iframeNotifyParentOrigin=a,this.iframeScriptOrigin=l,this.silent_redirect_uri=u,this.silentRequestTimeoutInSeconds=c,this.automaticSilentRenew=d,this.validateSubOnSilentRenew=f,this.includeIdTokenInSilentRenew=h,this.monitorSession=g,this.monitorAnonymousSession=y,this.checkSessionIntervalInSeconds=_,this.stopCheckSessionOnError=p,this.query_status_response_type=m,this.revokeTokenTypes=v,this.revokeTokensOnSignout=x,this.includeIdTokenInSilentSignout=S,this.accessTokenExpiringNotificationTimeInSeconds=w,b)this.userStore=b;else{const A=typeof window<"u"?window.sessionStorage:new sR;this.userStore=new l2({store:A})}}},Ey=class extends lR{constructor({silentRequestTimeoutInSeconds:e=dR}){super(),this._logger=new be("IFrameWindow"),this._timeoutInSeconds=e,this._frame=Ey.createHiddenIframe(),this._window=this._frame.contentWindow}static createHiddenIframe(){const e=window.document.createElement("iframe");return e.style.visibility="hidden",e.style.position="fixed",e.style.left="-1000px",e.style.top="0",e.width="0",e.height="0",window.document.body.appendChild(e),e}async navigate(e){this._logger.debug("navigate: Using timeout of:",this._timeoutInSeconds);const t=setTimeout(()=>this._abort.raise(new s2("IFrame timed out without a response")),this._timeoutInSeconds*1e3);return this._disposeHandlers.add(()=>clearTimeout(t)),await super.navigate(e)}close(){var e;this._frame&&(this._frame.parentNode&&(this._frame.addEventListener("load",t=>{var n;const r=t.target;(n=r.parentNode)==null||n.removeChild(r),this._abort.raise(new Error("IFrame removed from DOM"))},!0),(e=this._frame.contentWindow)==null||e.location.replace("about:blank")),this._frame=null),this._window=null}static notifyParent(e,t){return super._notifyParent(window.parent,e,!1,t)}},jI=class{constructor(e){this._settings=e,this._logger=new be("IFrameNavigator")}async prepare({silentRequestTimeoutInSeconds:e=this._settings.silentRequestTimeoutInSeconds}){return new Ey({silentRequestTimeoutInSeconds:e})}async callback(e){this._logger.create("callback"),Ey.notifyParent(e,this._settings.iframeNotifyParentOrigin)}},FI=500,UI=1e3,nS=class extends lR{constructor({popupWindowTarget:e=cR,popupWindowFeatures:t={}}){super(),this._logger=new be("PopupWindow");const n=eS.center({...uR,...t});this._window=window.open(void 0,e,eS.serialize(n)),t.closePopupWindowAfterInSeconds&&t.closePopupWindowAfterInSeconds>0&&setTimeout(()=>{if(!this._window||typeof this._window.closed!="boolean"||this._window.closed){this._abort.raise(new Error("Popup blocked by user"));return}this.close()},t.closePopupWindowAfterInSeconds*UI)}async navigate(e){var t;(t=this._window)==null||t.focus();const n=setInterval(()=>{(!this._window||this._window.closed)&&this._abort.raise(new Error("Popup closed by user"))},FI);return this._disposeHandlers.add(()=>clearInterval(n)),await super.navigate(e)}close(){this._window&&(this._window.closed||(this._window.close(),this._abort.raise(new Error("Popup closed")))),this._window=null}static notifyOpener(e,t){if(!window.opener)throw new Error("No window.opener. Can't complete notification.");return super._notifyParent(window.opener,e,t)}},VI=class{constructor(e){this._settings=e,this._logger=new be("PopupNavigator")}async prepare({popupWindowFeatures:e=this._settings.popupWindowFeatures,popupWindowTarget:t=this._settings.popupWindowTarget}){return new nS({popupWindowFeatures:e,popupWindowTarget:t})}async callback(e,{keepOpen:t=!1}){this._logger.create("callback"),nS.notifyOpener(e,t)}},zI=class{constructor(e){this._settings=e,this._logger=new be("RedirectNavigator")}async prepare({redirectMethod:e=this._settings.redirectMethod,redirectTarget:t=this._settings.redirectTarget}){var n;this._logger.create("prepare");let r=window.self;t==="top"&&(r=(n=window.top)!=null?n:window.self);const i=r.location[e].bind(r.location);let o;return{navigate:async s=>{this._logger.create("navigate");const a=new Promise((l,u)=>{o=u});return i(s.url),await a},close:()=>{this._logger.create("close"),o==null||o(new Error("Redirect aborted")),r.stop()}}}async callback(){}},BI=class extends gI{constructor(e){super({expiringNotificationTimeInSeconds:e.accessTokenExpiringNotificationTimeInSeconds}),this._logger=new be("UserManagerEvents"),this._userLoaded=new Fi("User loaded"),this._userUnloaded=new Fi("User unloaded"),this._silentRenewError=new Fi("Silent renew error"),this._userSignedIn=new Fi("User signed in"),this._userSignedOut=new Fi("User signed out"),this._userSessionChanged=new Fi("User session changed")}load(e,t=!0){super.load(e),t&&this._userLoaded.raise(e)}unload(){super.unload(),this._userUnloaded.raise()}addUserLoaded(e){return this._userLoaded.addHandler(e)}removeUserLoaded(e){return this._userLoaded.removeHandler(e)}addUserUnloaded(e){return this._userUnloaded.addHandler(e)}removeUserUnloaded(e){return this._userUnloaded.removeHandler(e)}addSilentRenewError(e){return this._silentRenewError.addHandler(e)}removeSilentRenewError(e){return this._silentRenewError.removeHandler(e)}_raiseSilentRenewError(e){this._silentRenewError.raise(e)}addUserSignedIn(e){return this._userSignedIn.addHandler(e)}removeUserSignedIn(e){this._userSignedIn.removeHandler(e)}_raiseUserSignedIn(){this._userSignedIn.raise()}addUserSignedOut(e){return this._userSignedOut.addHandler(e)}removeUserSignedOut(e){this._userSignedOut.removeHandler(e)}_raiseUserSignedOut(){this._userSignedOut.raise()}addUserSessionChanged(e){return this._userSessionChanged.addHandler(e)}removeUserSessionChanged(e){this._userSessionChanged.removeHandler(e)}_raiseUserSessionChanged(){this._userSessionChanged.raise()}},HI=class{constructor(e){this._userManager=e,this._logger=new be("SilentRenewService"),this._isStarted=!1,this._retryTimer=new Yn("Retry Silent Renew"),this._tokenExpiring=async()=>{const t=this._logger.create("_tokenExpiring");try{await this._userManager.signinSilent(),t.debug("silent token renewal successful")}catch(n){if(n instanceof s2){t.warn("ErrorTimeout from signinSilent:",n,"retry in 5s"),this._retryTimer.init(5);return}t.error("Error from signinSilent:",n),this._userManager.events._raiseSilentRenewError(n)}}}async start(){const e=this._logger.create("start");if(!this._isStarted){this._isStarted=!0,this._userManager.events.addAccessTokenExpiring(this._tokenExpiring),this._retryTimer.addHandler(this._tokenExpiring);try{await this._userManager.getUser()}catch(t){e.error("getUser error",t)}}}stop(){this._isStarted&&(this._retryTimer.cancel(),this._retryTimer.removeHandler(this._tokenExpiring),this._userManager.events.removeAccessTokenExpiring(this._tokenExpiring),this._isStarted=!1)}},WI=class{constructor(e,t){this.refresh_token=e.refresh_token,this.id_token=e.id_token,this.session_state=e.session_state,this.scope=e.scope,this.profile=e.profile,this.resource=t,this.data=e.state}},qI=class{constructor(e,t,n,r){this._logger=new be("UserManager"),this.settings=new DI(e),this._client=new LI(e),this._redirectNavigator=t??new zI(this.settings),this._popupNavigator=n??new VI(this.settings),this._iframeNavigator=r??new jI(this.settings),this._events=new BI(this.settings),this._silentRenewService=new HI(this),this.settings.automaticSilentRenew&&this.startSilentRenew(),this._sessionMonitor=null,this.settings.monitorSession&&(this._sessionMonitor=new OI(this))}get events(){return this._events}get metadataService(){return this._client.metadataService}async getUser(){const e=this._logger.create("getUser"),t=await this._loadUser();return t?(e.info("user loaded"),this._events.load(t,!1),t):(e.info("user not found in storage"),null)}async removeUser(){const e=this._logger.create("removeUser");await this.storeUser(null),e.info("user removed from storage"),this._events.unload()}async signinRedirect(e={}){this._logger.create("signinRedirect");const{redirectMethod:t,...n}=e,r=await this._redirectNavigator.prepare({redirectMethod:t});await this._signinStart({request_type:"si:r",...n},r)}async signinRedirectCallback(e=window.location.href){const t=this._logger.create("signinRedirectCallback"),n=await this._signinEnd(e);return n.profile&&n.profile.sub?t.info("success, signed in subject",n.profile.sub):t.info("no subject"),n}async signinResourceOwnerCredentials({username:e,password:t,skipUserInfo:n=!1}){const r=this._logger.create("signinResourceOwnerCredential"),i=await this._client.processResourceOwnerPasswordCredentials({username:e,password:t,skipUserInfo:n,extraTokenParams:this.settings.extraTokenParams});r.debug("got signin response");const o=await this._buildUser(i);return o.profile&&o.profile.sub?r.info("success, signed in subject",o.profile.sub):r.info("no subject"),o}async signinPopup(e={}){const t=this._logger.create("signinPopup"),{popupWindowFeatures:n,popupWindowTarget:r,...i}=e,o=this.settings.popup_redirect_uri;o||t.throw(new Error("No popup_redirect_uri configured"));const s=await this._popupNavigator.prepare({popupWindowFeatures:n,popupWindowTarget:r}),a=await this._signin({request_type:"si:p",redirect_uri:o,display:"popup",...i},s);return a&&(a.profile&&a.profile.sub?t.info("success, signed in subject",a.profile.sub):t.info("no subject")),a}async signinPopupCallback(e=window.location.href,t=!1){const n=this._logger.create("signinPopupCallback");await this._popupNavigator.callback(e,{keepOpen:t}),n.info("success")}async signinSilent(e={}){var t;const n=this._logger.create("signinSilent"),{silentRequestTimeoutInSeconds:r,resource:i,...o}=e;let s=await this._loadUser();if(s!=null&&s.refresh_token){n.debug("using refresh token");const c=new WI(s,i);return await this._useRefreshToken(c)}const a=this.settings.silent_redirect_uri;a||n.throw(new Error("No silent_redirect_uri configured"));let l;s&&this.settings.validateSubOnSilentRenew&&(n.debug("subject prior to silent renew:",s.profile.sub),l=s.profile.sub);const u=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:r});return s=await this._signin({request_type:"si:s",redirect_uri:a,prompt:"none",id_token_hint:this.settings.includeIdTokenInSilentRenew?s==null?void 0:s.id_token:void 0,...o},u,l),s&&((t=s.profile)!=null&&t.sub?n.info("success, signed in subject",s.profile.sub):n.info("no subject")),s}async _useRefreshToken(e){const t=await this._client.useRefreshToken({state:e,timeoutInSeconds:this.settings.silentRequestTimeoutInSeconds}),n=new yf({...e,...t});return await this.storeUser(n),this._events.load(n),n}async signinSilentCallback(e=window.location.href){const t=this._logger.create("signinSilentCallback");await this._iframeNavigator.callback(e),t.info("success")}async signinCallback(e=window.location.href){const{state:t}=await this._client.readSigninResponseState(e);switch(t.request_type){case"si:r":return await this.signinRedirectCallback(e);case"si:p":return await this.signinPopupCallback(e);case"si:s":return await this.signinSilentCallback(e);default:throw new Error("invalid response_type in state")}}async signoutCallback(e=window.location.href,t=!1){const{state:n}=await this._client.readSignoutResponseState(e);if(n)switch(n.request_type){case"so:r":await this.signoutRedirectCallback(e);break;case"so:p":await this.signoutPopupCallback(e,t);break;case"so:s":await this.signoutSilentCallback(e);break;default:throw new Error("invalid response_type in state")}}async querySessionStatus(e={}){const t=this._logger.create("querySessionStatus"),{silentRequestTimeoutInSeconds:n,...r}=e,i=this.settings.silent_redirect_uri;i||t.throw(new Error("No silent_redirect_uri configured"));const o=await this._loadUser(),s=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:n}),a=await this._signinStart({request_type:"si:s",redirect_uri:i,prompt:"none",id_token_hint:this.settings.includeIdTokenInSilentRenew?o==null?void 0:o.id_token:void 0,response_type:this.settings.query_status_response_type,scope:"openid",skipUserInfo:!0,...r},s);try{const l=await this._client.processSigninResponse(a.url);return t.debug("got signin response"),l.session_state&&l.profile.sub?(t.info("success for subject",l.profile.sub),{session_state:l.session_state,sub:l.profile.sub,sid:l.profile.sid}):(t.info("success, user not authenticated"),null)}catch(l){if(this.settings.monitorAnonymousSession&&l instanceof _s)switch(l.error){case"login_required":case"consent_required":case"interaction_required":case"account_selection_required":return t.info("success for anonymous user"),{session_state:l.session_state}}throw l}}async _signin(e,t,n){const r=await this._signinStart(e,t);return await this._signinEnd(r.url,n)}async _signinStart(e,t){const n=this._logger.create("_signinStart");try{const r=await this._client.createSigninRequest(e);return n.debug("got signin request"),await t.navigate({url:r.url,state:r.state.id,response_mode:r.state.response_mode,scriptOrigin:this.settings.iframeScriptOrigin})}catch(r){throw n.debug("error after preparing navigator, closing navigator window"),t.close(),r}}async _signinEnd(e,t){const n=this._logger.create("_signinEnd"),r=await this._client.processSigninResponse(e);return n.debug("got signin response"),await this._buildUser(r,t)}async _buildUser(e,t){const n=this._logger.create("_buildUser"),r=new yf(e);if(t){if(t!==r.profile.sub)throw n.debug("current user does not match user returned from signin. sub from signin:",r.profile.sub),new _s({...e,error:"login_required"});n.debug("current user matches user returned from signin")}return await this.storeUser(r),n.debug("user stored"),this._events.load(r),r}async signoutRedirect(e={}){const t=this._logger.create("signoutRedirect"),{redirectMethod:n,...r}=e,i=await this._redirectNavigator.prepare({redirectMethod:n});await this._signoutStart({request_type:"so:r",post_logout_redirect_uri:this.settings.post_logout_redirect_uri,...r},i),t.info("success")}async signoutRedirectCallback(e=window.location.href){const t=this._logger.create("signoutRedirectCallback"),n=await this._signoutEnd(e);return t.info("success"),n}async signoutPopup(e={}){const t=this._logger.create("signoutPopup"),{popupWindowFeatures:n,popupWindowTarget:r,...i}=e,o=this.settings.popup_post_logout_redirect_uri,s=await this._popupNavigator.prepare({popupWindowFeatures:n,popupWindowTarget:r});await this._signout({request_type:"so:p",post_logout_redirect_uri:o,state:o==null?void 0:{},...i},s),t.info("success")}async signoutPopupCallback(e=window.location.href,t=!1){const n=this._logger.create("signoutPopupCallback");await this._popupNavigator.callback(e,{keepOpen:t}),n.info("success")}async _signout(e,t){const n=await this._signoutStart(e,t);return await this._signoutEnd(n.url)}async _signoutStart(e={},t){var n;const r=this._logger.create("_signoutStart");try{const i=await this._loadUser();r.debug("loaded current user from storage"),this.settings.revokeTokensOnSignout&&await this._revokeInternal(i);const o=e.id_token_hint||i&&i.id_token;o&&(r.debug("setting id_token_hint in signout request"),e.id_token_hint=o),await this.removeUser(),r.debug("user removed, creating signout request");const s=await this._client.createSignoutRequest(e);return r.debug("got signout request"),await t.navigate({url:s.url,state:(n=s.state)==null?void 0:n.id,scriptOrigin:this.settings.iframeScriptOrigin})}catch(i){throw r.debug("error after preparing navigator, closing navigator window"),t.close(),i}}async _signoutEnd(e){const t=this._logger.create("_signoutEnd"),n=await this._client.processSignoutResponse(e);return t.debug("got signout response"),n}async signoutSilent(e={}){var t;const n=this._logger.create("signoutSilent"),{silentRequestTimeoutInSeconds:r,...i}=e,o=this.settings.includeIdTokenInSilentSignout?(t=await this._loadUser())==null?void 0:t.id_token:void 0,s=this.settings.popup_post_logout_redirect_uri,a=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:r});await this._signout({request_type:"so:s",post_logout_redirect_uri:s,id_token_hint:o,...i},a),n.info("success")}async signoutSilentCallback(e=window.location.href){const t=this._logger.create("signoutSilentCallback");await this._iframeNavigator.callback(e),t.info("success")}async revokeTokens(e){const t=await this._loadUser();await this._revokeInternal(t,e)}async _revokeInternal(e,t=this.settings.revokeTokenTypes){const n=this._logger.create("_revokeInternal");if(!e)return;const r=t.filter(i=>typeof e[i]=="string");if(!r.length){n.debug("no need to revoke due to no token(s)");return}for(const i of r)await this._client.revokeToken(e[i],i),n.info(`${i} revoked successfully`),i!=="access_token"&&(e[i]=null);await this.storeUser(e),n.debug("user stored"),this._events.load(e)}startSilentRenew(){this._logger.create("startSilentRenew"),this._silentRenewService.start()}stopSilentRenew(){this._silentRenewService.stop()}get _userStoreKey(){return`user:${this.settings.authority}:${this.settings.client_id}`}async _loadUser(){const e=this._logger.create("_loadUser"),t=await this.settings.userStore.get(this._userStoreKey);return t?(e.debug("user storageString loaded"),yf.fromStorageString(t)):(e.debug("no user storageString"),null)}async storeUser(e){const t=this._logger.create("storeUser");if(e){t.debug("storing user");const n=e.toStorageString();await this.settings.userStore.set(this._userStoreKey,n)}else this._logger.debug("removing user"),await this.settings.userStore.remove(this._userStoreKey)}async clearStaleState(){await this._client.clearStaleState()}},c2=E.createContext(void 0);c2.displayName="AuthContext";var GI={isLoading:!0,isAuthenticated:!1},KI=(e,t)=>{switch(t.type){case"INITIALISED":case"USER_LOADED":return{...e,user:t.user,isLoading:!1,isAuthenticated:t.user?!t.user.expired:!1,error:void 0};case"USER_UNLOADED":return{...e,user:void 0,isAuthenticated:!1};case"NAVIGATOR_INIT":return{...e,isLoading:!0,activeNavigator:t.method};case"NAVIGATOR_CLOSE":return{...e,isLoading:!1,activeNavigator:void 0};case"ERROR":return{...e,isLoading:!1,error:t.error};default:return{...e,isLoading:!1,error:new Error(`unknown type ${t.type}`)}}},YI=(e=window.location)=>{let t=new URLSearchParams(e.search);return!!((t.get("code")||t.get("error"))&&t.get("state")||(t=new URLSearchParams(e.hash.replace("#","?")),(t.get("code")||t.get("error"))&&t.get("state")))},QI=e=>t=>t instanceof Error?t:new Error(e),XI=QI("Login failed"),ZI=["clearStaleState","querySessionStatus","revokeTokens","startSilentRenew","stopSilentRenew"],JI=["signinPopup","signinSilent","signinRedirect","signinResourceOwnerCredentials","signoutPopup","signoutRedirect","signoutSilent"],cg=e=>()=>{throw new Error(`UserManager#${e} was called from an unsupported context. If this is a server-rendered page, defer this call with useEffect() or pass a custom UserManager implementation.`)},eD=typeof window>"u"?null:qI,tD=e=>{const{children:t,onSigninCallback:n,skipSigninCallback:r,onRemoveUser:i,onSignoutRedirect:o,onSignoutPopup:s,implementation:a=eD,userManager:l,...u}=e,[c]=U.useState(()=>l??(a?new a(u):{settings:u})),[d,f]=U.useReducer(KI,GI),h=U.useMemo(()=>Object.assign({settings:c.settings,events:c.events},Object.fromEntries(ZI.map(v=>{var x,S;return[v,(S=(x=c[v])==null?void 0:x.bind(c))!=null?S:cg(v)]})),Object.fromEntries(JI.map(v=>[v,c[v]?async x=>{f({type:"NAVIGATOR_INIT",method:v});try{return await c[v](x)}catch(S){return f({type:"ERROR",error:S}),null}finally{f({type:"NAVIGATOR_CLOSE"})}}:cg(v)]))),[c]),g=U.useRef(!1);U.useEffect(()=>{!c||g.current||(g.current=!0,(async()=>{let v=null;try{YI()&&!r&&(v=await c.signinCallback(),n&&await n(v)),v=v||await c.getUser(),f({type:"INITIALISED",user:v})}catch(x){f({type:"ERROR",error:XI(x)})}})())},[c,r,n]),U.useEffect(()=>{if(!c)return;const v=w=>{f({type:"USER_LOADED",user:w})};c.events.addUserLoaded(v);const x=()=>{f({type:"USER_UNLOADED"})};c.events.addUserUnloaded(x);const S=w=>{f({type:"ERROR",error:w})};return c.events.addSilentRenewError(S),()=>{c.events.removeUserLoaded(v),c.events.removeUserUnloaded(x),c.events.removeSilentRenewError(S)}},[c]);const y=U.useCallback(c?()=>c.removeUser().then(i):cg("removeUser"),[c,i]),_=U.useCallback(v=>h.signoutRedirect(v).then(o),[h.signoutRedirect,o]),m=U.useCallback(v=>h.signoutPopup(v).then(s),[h.signoutPopup,s]),p=U.useCallback(v=>h.signoutSilent(v),[h.signoutSilent]);return E.createElement(c2.Provider,{value:{...d,...h,removeUser:y,signoutRedirect:_,signoutPopup:m,signoutSilent:p}},t)},nD=()=>{const e=E.useContext(c2);return e||console.warn("AuthProvider context is undefined, please verify you are calling useAuth() as child of a component."),e};/** + * @remix-run/router v1.19.1 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function uc(){return uc=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function fR(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function iD(){return Math.random().toString(36).substr(2,8)}function iS(e,t){return{usr:e.state,key:e.key,idx:t}}function Cy(e,t,n,r){return n===void 0&&(n=null),uc({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Sl(t):t,{state:n,key:t&&t.key||r||iD()})}function sh(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Sl(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function oD(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:o=!1}=r,s=i.history,a=no.Pop,l=null,u=c();u==null&&(u=0,s.replaceState(uc({},s.state,{idx:u}),""));function c(){return(s.state||{idx:null}).idx}function d(){a=no.Pop;let _=c(),m=_==null?null:_-u;u=_,l&&l({action:a,location:y.location,delta:m})}function f(_,m){a=no.Push;let p=Cy(y.location,_,m);u=c()+1;let v=iS(p,u),x=y.createHref(p);try{s.pushState(v,"",x)}catch(S){if(S instanceof DOMException&&S.name==="DataCloneError")throw S;i.location.assign(x)}o&&l&&l({action:a,location:y.location,delta:1})}function h(_,m){a=no.Replace;let p=Cy(y.location,_,m);u=c();let v=iS(p,u),x=y.createHref(p);s.replaceState(v,"",x),o&&l&&l({action:a,location:y.location,delta:0})}function g(_){let m=i.location.origin!=="null"?i.location.origin:i.location.href,p=typeof _=="string"?_:sh(_);return p=p.replace(/ $/,"%20"),nt(m,"No window.location.(origin|href) available to create URL for href: "+p),new URL(p,m)}let y={get action(){return a},get location(){return e(i,s)},listen(_){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(rS,d),l=_,()=>{i.removeEventListener(rS,d),l=null}},createHref(_){return t(i,_)},createURL:g,encodeLocation(_){let m=g(_);return{pathname:m.pathname,search:m.search,hash:m.hash}},push:f,replace:h,go(_){return s.go(_)}};return y}var oS;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(oS||(oS={}));function sD(e,t,n){return n===void 0&&(n="/"),aD(e,t,n,!1)}function aD(e,t,n,r){let i=typeof t=="string"?Sl(t):t,o=nl(i.pathname||"/",n);if(o==null)return null;let s=hR(e);lD(s);let a=null;for(let l=0;a==null&&l{let l={relativePath:a===void 0?o.path||"":a,caseSensitive:o.caseSensitive===!0,childrenIndex:s,route:o};l.relativePath.startsWith("/")&&(nt(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let u=ho([r,l.relativePath]),c=n.concat(l);o.children&&o.children.length>0&&(nt(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),hR(o.children,t,c,u)),!(o.path==null&&!o.index)&&t.push({path:u,score:gD(u,o.index),routesMeta:c})};return e.forEach((o,s)=>{var a;if(o.path===""||!((a=o.path)!=null&&a.includes("?")))i(o,s);else for(let l of pR(o.path))i(o,s,l)}),t}function pR(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return i?[o,""]:[o];let s=pR(r.join("/")),a=[];return a.push(...s.map(l=>l===""?o:[o,l].join("/"))),i&&a.push(...s),a.map(l=>e.startsWith("/")&&l===""?"/":l)}function lD(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:mD(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const uD=/^:[\w-]+$/,cD=3,dD=2,fD=1,hD=10,pD=-2,sS=e=>e==="*";function gD(e,t){let n=e.split("/"),r=n.length;return n.some(sS)&&(r+=pD),t&&(r+=dD),n.filter(i=>!sS(i)).reduce((i,o)=>i+(uD.test(o)?cD:o===""?fD:hD),r)}function mD(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function yD(e,t,n){let{routesMeta:r}=e,i={},o="/",s=[];for(let a=0;a{let{paramName:f,isOptional:h}=c;if(f==="*"){let y=a[d]||"";s=o.slice(0,o.length-y.length).replace(/(.)\/+$/,"$1")}const g=a[d];return h&&!g?u[f]=void 0:u[f]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:s,pattern:e}}function vD(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),fR(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,a,l)=>(r.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function _D(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return fR(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function nl(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function xD(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Sl(e):e;return{pathname:n?n.startsWith("/")?n:SD(n,t):t,search:ED(r),hash:CD(i)}}function SD(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function dg(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function wD(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function d2(e,t){let n=wD(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function f2(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=Sl(e):(i=uc({},e),nt(!i.pathname||!i.pathname.includes("?"),dg("?","pathname","search",i)),nt(!i.pathname||!i.pathname.includes("#"),dg("#","pathname","hash",i)),nt(!i.search||!i.search.includes("#"),dg("#","search","hash",i)));let o=e===""||i.pathname==="",s=o?"/":i.pathname,a;if(s==null)a=n;else{let d=t.length-1;if(!r&&s.startsWith("..")){let f=s.split("/");for(;f[0]==="..";)f.shift(),d-=1;i.pathname=f.join("/")}a=d>=0?t[d]:"/"}let l=xD(i,a),u=s&&s!=="/"&&s.endsWith("/"),c=(o||s===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(u||c)&&(l.pathname+="/"),l}const ho=e=>e.join("/").replace(/\/\/+/g,"/"),bD=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),ED=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,CD=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function AD(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const gR=["post","put","patch","delete"];new Set(gR);const RD=["get",...gR];new Set(RD);/** + * React Router v6.26.1 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function cc(){return cc=Object.assign?Object.assign.bind():function(e){for(var t=1;t{a.current=!0}),U.useCallback(function(u,c){if(c===void 0&&(c={}),!a.current)return;if(typeof u=="number"){r.go(u);return}let d=f2(u,JSON.parse(s),o,c.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:ho([t,d.pathname])),(c.replace?r.replace:r.push)(d,c.state,c)},[t,r,s,o,e])}const TD=U.createContext(null);function MD(e){let t=U.useContext(Br).outlet;return t&&U.createElement(TD.Provider,{value:e},t)}function ND(){let{matches:e}=U.useContext(Br),t=e[e.length-1];return t?t.params:{}}function R0(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=U.useContext(Ci),{matches:i}=U.useContext(Br),{pathname:o}=$o(),s=JSON.stringify(d2(i,r.v7_relativeSplatPath));return U.useMemo(()=>f2(e,JSON.parse(s),o,n==="path"),[e,s,o,n])}function LD(e,t){return OD(e,t)}function OD(e,t,n,r){wl()||nt(!1);let{navigator:i}=U.useContext(Ci),{matches:o}=U.useContext(Br),s=o[o.length-1],a=s?s.params:{};s&&s.pathname;let l=s?s.pathnameBase:"/";s&&s.route;let u=$o(),c;if(t){var d;let _=typeof t=="string"?Sl(t):t;l==="/"||(d=_.pathname)!=null&&d.startsWith(l)||nt(!1),c=_}else c=u;let f=c.pathname||"/",h=f;if(l!=="/"){let _=l.replace(/^\//,"").split("/");h="/"+f.replace(/^\//,"").split("/").slice(_.length).join("/")}let g=sD(e,{pathname:h}),y=FD(g&&g.map(_=>Object.assign({},_,{params:Object.assign({},a,_.params),pathname:ho([l,i.encodeLocation?i.encodeLocation(_.pathname).pathname:_.pathname]),pathnameBase:_.pathnameBase==="/"?l:ho([l,i.encodeLocation?i.encodeLocation(_.pathnameBase).pathname:_.pathnameBase])})),o,n,r);return t&&y?U.createElement(A0.Provider,{value:{location:cc({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:no.Pop}},y):y}function PD(){let e=BD(),t=AD(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return U.createElement(U.Fragment,null,U.createElement("h2",null,"Unexpected Application Error!"),U.createElement("h3",{style:{fontStyle:"italic"}},t),n?U.createElement("pre",{style:i},n):null,null)}const ID=U.createElement(PD,null);class DD extends U.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?U.createElement(Br.Provider,{value:this.props.routeContext},U.createElement(yR.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function jD(e){let{routeContext:t,match:n,children:r}=e,i=U.useContext(C0);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),U.createElement(Br.Provider,{value:t},r)}function FD(e,t,n,r){var i;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var o;if(!n)return null;if(n.errors)e=n.matches;else if((o=r)!=null&&o.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let s=e,a=(i=n)==null?void 0:i.errors;if(a!=null){let c=s.findIndex(d=>d.route.id&&(a==null?void 0:a[d.route.id])!==void 0);c>=0||nt(!1),s=s.slice(0,Math.min(s.length,c+1))}let l=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let c=0;c=0?s=s.slice(0,u+1):s=[s[0]];break}}}return s.reduceRight((c,d,f)=>{let h,g=!1,y=null,_=null;n&&(h=a&&d.route.id?a[d.route.id]:void 0,y=d.route.errorElement||ID,l&&(u<0&&f===0?(g=!0,_=null):u===f&&(g=!0,_=d.route.hydrateFallbackElement||null)));let m=t.concat(s.slice(0,f+1)),p=()=>{let v;return h?v=y:g?v=_:d.route.Component?v=U.createElement(d.route.Component,null):d.route.element?v=d.route.element:v=c,U.createElement(jD,{match:d,routeContext:{outlet:c,matches:m,isDataRoute:n!=null},children:v})};return n&&(d.route.ErrorBoundary||d.route.errorElement||f===0)?U.createElement(DD,{location:n.location,revalidation:n.revalidation,component:y,error:h,children:p(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):p()},null)}var _R=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(_R||{}),lh=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(lh||{});function UD(e){let t=U.useContext(C0);return t||nt(!1),t}function VD(e){let t=U.useContext(mR);return t||nt(!1),t}function zD(e){let t=U.useContext(Br);return t||nt(!1),t}function xR(e){let t=zD(),n=t.matches[t.matches.length-1];return n.route.id||nt(!1),n.route.id}function BD(){var e;let t=U.useContext(yR),n=VD(lh.UseRouteError),r=xR(lh.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function HD(){let{router:e}=UD(_R.UseNavigateStable),t=xR(lh.UseNavigateStable),n=U.useRef(!1);return vR(()=>{n.current=!0}),U.useCallback(function(i,o){o===void 0&&(o={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,cc({fromRouteId:t},o)))},[e,t])}function WD(e){let{to:t,replace:n,state:r,relative:i}=e;wl()||nt(!1);let{future:o,static:s}=U.useContext(Ci),{matches:a}=U.useContext(Br),{pathname:l}=$o(),u=Uc(),c=f2(t,d2(a,o.v7_relativeSplatPath),l,i==="path"),d=JSON.stringify(c);return U.useEffect(()=>u(JSON.parse(d),{replace:n,state:r,relative:i}),[u,d,i,n,r]),null}function qD(e){return MD(e.context)}function jo(e){nt(!1)}function GD(e){let{basename:t="/",children:n=null,location:r,navigationType:i=no.Pop,navigator:o,static:s=!1,future:a}=e;wl()&&nt(!1);let l=t.replace(/^\/*/,"/"),u=U.useMemo(()=>({basename:l,navigator:o,static:s,future:cc({v7_relativeSplatPath:!1},a)}),[l,a,o,s]);typeof r=="string"&&(r=Sl(r));let{pathname:c="/",search:d="",hash:f="",state:h=null,key:g="default"}=r,y=U.useMemo(()=>{let _=nl(c,l);return _==null?null:{location:{pathname:_,search:d,hash:f,state:h,key:g},navigationType:i}},[l,c,d,f,h,g,i]);return y==null?null:U.createElement(Ci.Provider,{value:u},U.createElement(A0.Provider,{children:n,value:y}))}function KD(e){let{children:t,location:n}=e;return LD(Ay(t),n)}new Promise(()=>{});function Ay(e,t){t===void 0&&(t=[]);let n=[];return U.Children.forEach(e,(r,i)=>{if(!U.isValidElement(r))return;let o=[...t,i];if(r.type===U.Fragment){n.push.apply(n,Ay(r.props.children,o));return}r.type!==jo&&nt(!1),!r.props.index||!r.props.children||nt(!1);let s={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(s.children=Ay(r.props.children,o)),n.push(s)}),n}/** + * React Router DOM v6.26.1 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function uh(){return uh=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[i]=e[i]);return n}function YD(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function QD(e,t){return e.button===0&&(!t||t==="_self")&&!YD(e)}function Ry(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function XD(e,t){let n=Ry(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(o=>{n.append(i,o)})}),n}const ZD=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],JD=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"],ej="6";try{window.__reactRouterVersion=ej}catch{}const tj=U.createContext({isTransitioning:!1}),nj="startTransition",aS=HL[nj];function rj(e){let{basename:t,children:n,future:r,window:i}=e,o=U.useRef();o.current==null&&(o.current=rD({window:i,v5Compat:!0}));let s=o.current,[a,l]=U.useState({action:s.action,location:s.location}),{v7_startTransition:u}=r||{},c=U.useCallback(d=>{u&&aS?aS(()=>l(d)):l(d)},[l,u]);return U.useLayoutEffect(()=>s.listen(c),[s,c]),U.createElement(GD,{basename:t,children:n,location:a.location,navigationType:a.action,navigator:s,future:r})}const ij=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",oj=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,wR=U.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:o,replace:s,state:a,target:l,to:u,preventScrollReset:c,unstable_viewTransition:d}=t,f=SR(t,ZD),{basename:h}=U.useContext(Ci),g,y=!1;if(typeof u=="string"&&oj.test(u)&&(g=u,ij))try{let v=new URL(window.location.href),x=u.startsWith("//")?new URL(v.protocol+u):new URL(u),S=nl(x.pathname,h);x.origin===v.origin&&S!=null?u=S+x.search+x.hash:y=!0}catch{}let _=$D(u,{relative:i}),m=aj(u,{replace:s,state:a,target:l,preventScrollReset:c,relative:i,unstable_viewTransition:d});function p(v){r&&r(v),v.defaultPrevented||m(v)}return U.createElement("a",uh({},f,{href:g||_,onClick:y||o?r:p,ref:n,target:l}))}),Pu=U.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:i=!1,className:o="",end:s=!1,style:a,to:l,unstable_viewTransition:u,children:c}=t,d=SR(t,JD),f=R0(l,{relative:d.relative}),h=$o(),g=U.useContext(mR),{navigator:y,basename:_}=U.useContext(Ci),m=g!=null&&uj(f)&&u===!0,p=y.encodeLocation?y.encodeLocation(f).pathname:f.pathname,v=h.pathname,x=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;i||(v=v.toLowerCase(),x=x?x.toLowerCase():null,p=p.toLowerCase()),x&&_&&(x=nl(x,_)||x);const S=p!=="/"&&p.endsWith("/")?p.length-1:p.length;let w=v===p||!s&&v.startsWith(p)&&v.charAt(S)==="/",b=x!=null&&(x===p||!s&&x.startsWith(p)&&x.charAt(p.length)==="/"),A={isActive:w,isPending:b,isTransitioning:m},k=w?r:void 0,R;typeof o=="function"?R=o(A):R=[o,w?"active":null,b?"pending":null,m?"transitioning":null].filter(Boolean).join(" ");let M=typeof a=="function"?a(A):a;return U.createElement(wR,uh({},d,{"aria-current":k,className:R,ref:n,style:M,to:l,unstable_viewTransition:u}),typeof c=="function"?c(A):c)});var $y;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})($y||($y={}));var lS;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(lS||(lS={}));function sj(e){let t=U.useContext(C0);return t||nt(!1),t}function aj(e,t){let{target:n,replace:r,state:i,preventScrollReset:o,relative:s,unstable_viewTransition:a}=t===void 0?{}:t,l=Uc(),u=$o(),c=R0(e,{relative:s});return U.useCallback(d=>{if(QD(d,n)){d.preventDefault();let f=r!==void 0?r:sh(u)===sh(c);l(e,{replace:f,state:i,preventScrollReset:o,relative:s,unstable_viewTransition:a})}},[u,l,c,r,i,n,e,o,s,a])}function lj(e){let t=U.useRef(Ry(e)),n=U.useRef(!1),r=$o(),i=U.useMemo(()=>XD(r.search,n.current?null:t.current),[r.search]),o=Uc(),s=U.useCallback((a,l)=>{const u=Ry(typeof a=="function"?a(i):a);n.current=!0,o("?"+u,l)},[o,i]);return[i,s]}function uj(e,t){t===void 0&&(t={});let n=U.useContext(tj);n==null&&nt(!1);let{basename:r}=sj($y.useViewTransitionState),i=R0(e,{relative:t.relative});if(!n.isTransitioning)return!1;let o=nl(n.currentLocation.pathname,r)||n.currentLocation.pathname,s=nl(n.nextLocation.pathname,r)||n.nextLocation.pathname;return ah(i.pathname,s)!=null||ah(i.pathname,o)!=null}var bR={};function cj(e){const t=new Error(e);if(t.stack===void 0)try{throw t}catch{}return t}var dj=cj,Ae=dj;function fj(e){return!!e&&typeof e.then=="function"}var Ke=fj;function hj(e,t){if(e!=null)return e;throw Ae(t??"Got unexpected null or undefined")}var Je=hj;function Ce(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class $0{getValue(){throw Ae("BaseLoadable")}toPromise(){throw Ae("BaseLoadable")}valueMaybe(){throw Ae("BaseLoadable")}valueOrThrow(){throw Ae(`Loadable expected value, but in "${this.state}" state`)}promiseMaybe(){throw Ae("BaseLoadable")}promiseOrThrow(){throw Ae(`Loadable expected promise, but in "${this.state}" state`)}errorMaybe(){throw Ae("BaseLoadable")}errorOrThrow(){throw Ae(`Loadable expected error, but in "${this.state}" state`)}is(t){return t.state===this.state&&t.contents===this.contents}map(t){throw Ae("BaseLoadable")}}class pj extends $0{constructor(t){super(),Ce(this,"state","hasValue"),Ce(this,"contents",void 0),this.contents=t}getValue(){return this.contents}toPromise(){return Promise.resolve(this.contents)}valueMaybe(){return this.contents}valueOrThrow(){return this.contents}promiseMaybe(){}errorMaybe(){}map(t){try{const n=t(this.contents);return Ke(n)?xs(n):rl(n)?n:Vc(n)}catch(n){return Ke(n)?xs(n.next(()=>this.map(t))):k0(n)}}}class gj extends $0{constructor(t){super(),Ce(this,"state","hasError"),Ce(this,"contents",void 0),this.contents=t}getValue(){throw this.contents}toPromise(){return Promise.reject(this.contents)}valueMaybe(){}promiseMaybe(){}errorMaybe(){return this.contents}errorOrThrow(){return this.contents}map(t){return this}}class ER extends $0{constructor(t){super(),Ce(this,"state","loading"),Ce(this,"contents",void 0),this.contents=t}getValue(){throw this.contents}toPromise(){return this.contents}valueMaybe(){}promiseMaybe(){return this.contents}promiseOrThrow(){return this.contents}errorMaybe(){}map(t){return xs(this.contents.then(n=>{const r=t(n);if(rl(r)){const i=r;switch(i.state){case"hasValue":return i.contents;case"hasError":throw i.contents;case"loading":return i.contents}}return r}).catch(n=>{if(Ke(n))return n.then(()=>this.map(t).contents);throw n}))}}function Vc(e){return Object.freeze(new pj(e))}function k0(e){return Object.freeze(new gj(e))}function xs(e){return Object.freeze(new ER(e))}function CR(){return Object.freeze(new ER(new Promise(()=>{})))}function mj(e){return e.every(t=>t.state==="hasValue")?Vc(e.map(t=>t.contents)):e.some(t=>t.state==="hasError")?k0(Je(e.find(t=>t.state==="hasError"),"Invalid loadable passed to loadableAll").contents):xs(Promise.all(e.map(t=>t.contents)))}function AR(e){const n=(Array.isArray(e)?e:Object.getOwnPropertyNames(e).map(i=>e[i])).map(i=>rl(i)?i:Ke(i)?xs(i):Vc(i)),r=mj(n);return Array.isArray(e)?r:r.map(i=>Object.getOwnPropertyNames(e).reduce((o,s,a)=>({...o,[s]:i[a]}),{}))}function rl(e){return e instanceof $0}const yj={of:e=>Ke(e)?xs(e):rl(e)?e:Vc(e),error:e=>k0(e),loading:()=>CR(),all:AR,isLoadable:rl};var ks={loadableWithValue:Vc,loadableWithError:k0,loadableWithPromise:xs,loadableLoading:CR,loadableAll:AR,isLoadable:rl,RecoilLoadable:yj},vj=ks.loadableWithValue,_j=ks.loadableWithError,xj=ks.loadableWithPromise,Sj=ks.loadableLoading,wj=ks.loadableAll,bj=ks.isLoadable,Ej=ks.RecoilLoadable,zc=Object.freeze({__proto__:null,loadableWithValue:vj,loadableWithError:_j,loadableWithPromise:xj,loadableLoading:Sj,loadableAll:wj,isLoadable:bj,RecoilLoadable:Ej});const ky={RECOIL_DUPLICATE_ATOM_KEY_CHECKING_ENABLED:!0,RECOIL_GKS_ENABLED:new Set(["recoil_hamt_2020","recoil_sync_external_store","recoil_suppress_rerender_in_callback","recoil_memory_managament_2020"])};function Cj(e,t){var n,r;const i=(n=bR[e])===null||n===void 0||(r=n.toLowerCase())===null||r===void 0?void 0:r.trim();if(i==null||i==="")return;if(!["true","false"].includes(i))throw Ae(`process.env.${e} value must be 'true', 'false', or empty: ${i}`);t(i==="true")}function Aj(e,t){var n;const r=(n=bR[e])===null||n===void 0?void 0:n.trim();r==null||r===""||t(r.split(/\s*,\s*|\s+/))}function Rj(){var e;typeof process>"u"||((e=process)===null||e===void 0?void 0:e.env)!=null&&(Cj("RECOIL_DUPLICATE_ATOM_KEY_CHECKING_ENABLED",t=>{ky.RECOIL_DUPLICATE_ATOM_KEY_CHECKING_ENABLED=t}),Aj("RECOIL_GKS_ENABLED",t=>{t.forEach(n=>{ky.RECOIL_GKS_ENABLED.add(n)})}))}Rj();var bl=ky;function T0(e){return bl.RECOIL_GKS_ENABLED.has(e)}T0.setPass=e=>{bl.RECOIL_GKS_ENABLED.add(e)};T0.setFail=e=>{bl.RECOIL_GKS_ENABLED.delete(e)};T0.clear=()=>{bl.RECOIL_GKS_ENABLED.clear()};var Be=T0;function $j(e,t,{error:n}={}){return null}var kj=$j,h2=kj,fg,hg,pg;const Tj=(fg=E.createMutableSource)!==null&&fg!==void 0?fg:E.unstable_createMutableSource,RR=(hg=E.useMutableSource)!==null&&hg!==void 0?hg:E.unstable_useMutableSource,$R=(pg=E.useSyncExternalStore)!==null&&pg!==void 0?pg:E.unstable_useSyncExternalStore;function Mj(){var e;const{ReactCurrentDispatcher:t,ReactCurrentOwner:n}=E.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;return((e=t==null?void 0:t.current)!==null&&e!==void 0?e:n.currentDispatcher).useSyncExternalStore!=null}function Nj(){return Be("recoil_transition_support")?{mode:"TRANSITION_SUPPORT",early:!0,concurrent:!0}:Be("recoil_sync_external_store")&&$R!=null?{mode:"SYNC_EXTERNAL_STORE",early:!0,concurrent:!1}:Be("recoil_mutable_source")&&RR!=null&&typeof window<"u"&&!window.$disableRecoilValueMutableSource_TEMP_HACK_DO_NOT_USE?Be("recoil_suppress_rerender_in_callback")?{mode:"MUTABLE_SOURCE",early:!0,concurrent:!0}:{mode:"MUTABLE_SOURCE",early:!1,concurrent:!1}:Be("recoil_suppress_rerender_in_callback")?{mode:"LEGACY",early:!0,concurrent:!1}:{mode:"LEGACY",early:!1,concurrent:!1}}function Lj(){return!1}var Bc={createMutableSource:Tj,useMutableSource:RR,useSyncExternalStore:$R,currentRendererSupportsUseSyncExternalStore:Mj,reactMode:Nj,isFastRefreshEnabled:Lj};class p2{constructor(t){Ce(this,"key",void 0),this.key=t}toJSON(){return{key:this.key}}}class kR extends p2{}class TR extends p2{}function Oj(e){return e instanceof kR||e instanceof TR}var M0={AbstractRecoilValue:p2,RecoilState:kR,RecoilValueReadOnly:TR,isRecoilValue:Oj},Pj=M0.AbstractRecoilValue,Ij=M0.RecoilState,Dj=M0.RecoilValueReadOnly,jj=M0.isRecoilValue,il=Object.freeze({__proto__:null,AbstractRecoilValue:Pj,RecoilState:Ij,RecoilValueReadOnly:Dj,isRecoilValue:jj});function Fj(e,t){return function*(){let n=0;for(const r of e)yield t(r,n++)}()}var N0=Fj;class MR{}const Uj=new MR,Ss=new Map,g2=new Map;function Vj(e){return N0(e,t=>Je(g2.get(t)))}function zj(e){if(Ss.has(e)){const t=`Duplicate atom key "${e}". This is a FATAL ERROR in + production. But it is safe to ignore this warning if it occurred because of + hot module replacement.`;console.warn(t)}}function Bj(e){bl.RECOIL_DUPLICATE_ATOM_KEY_CHECKING_ENABLED&&zj(e.key),Ss.set(e.key,e);const t=e.set==null?new il.RecoilValueReadOnly(e.key):new il.RecoilState(e.key);return g2.set(e.key,t),t}class NR extends Error{}function Hj(e){const t=Ss.get(e);if(t==null)throw new NR(`Missing definition for RecoilValue: "${e}""`);return t}function Wj(e){return Ss.get(e)}const ch=new Map;function qj(e){var t;if(!Be("recoil_memory_managament_2020"))return;const n=Ss.get(e);if(n!=null&&(t=n.shouldDeleteConfigOnRelease)!==null&&t!==void 0&&t.call(n)){var r;Ss.delete(e),(r=LR(e))===null||r===void 0||r(),ch.delete(e)}}function Gj(e,t){Be("recoil_memory_managament_2020")&&(t===void 0?ch.delete(e):ch.set(e,t))}function LR(e){return ch.get(e)}var _n={nodes:Ss,recoilValues:g2,registerNode:Bj,getNode:Hj,getNodeMaybe:Wj,deleteNodeConfigIfPossible:qj,setConfigDeletionHandler:Gj,getConfigDeletionHandler:LR,recoilValuesForKeys:Vj,NodeMissingError:NR,DefaultValue:MR,DEFAULT_VALUE:Uj};function Kj(e,t){t()}var Yj={enqueueExecution:Kj};function Qj(e,t){return t={exports:{}},e(t,t.exports),t.exports}var Xj=Qj(function(e){var t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(j){return typeof j}:function(j){return j&&typeof Symbol=="function"&&j.constructor===Symbol&&j!==Symbol.prototype?"symbol":typeof j},n={},r=5,i=Math.pow(2,r),o=i-1,s=i/2,a=i/4,l={},u=function(I){return function(){return I}},c=n.hash=function(j){var I=typeof j>"u"?"undefined":t(j);if(I==="number")return j;I!=="string"&&(j+="");for(var Z=0,se=0,ae=j.length;se>1&1431655765,I=(I&858993459)+(I>>2&858993459),I=I+(I>>4)&252645135,I+=I>>8,I+=I>>16,I&127},f=function(I,Z){return Z>>>I&o},h=function(I){return 1<=Z;)ae[xe--]=ae[xe];return ae[Z]=se,ae}for(var ve=0,_e=0,Re=new Array(fe+1);ve>>=1;return xe[Z]=se,M(I,_e+1,xe)},D=function(I,Z,se,ae){for(var fe=new Array(Z-1),xe=0,ve=0,_e=0,Re=ae.length;_e1?k(I,this.hash,Re):Re[0]}var Xe=ae();return Xe===l?this:(++ve.value,O(I,se,this.hash,this,fe,A(I,fe,xe,Xe)))},q=function(I,Z,se,ae,fe,xe,ve){var _e=this.mask,Re=this.children,Xe=f(se,fe),nn=h(Xe),Ct=g(_e,nn),jn=_e&nn,rr=jn?Re[Ct]:w,zs=rr._modify(I,Z,se+r,ae,fe,xe,ve);if(rr===zs)return this;var hd=Q(I,this),Vl=_e,zl=void 0;if(jn&&b(zs)){if(Vl&=~nn,!Vl)return w;if(Re.length<=2&&$(Re[Ct^1]))return Re[Ct^1];zl=_(hd,Ct,Re)}else if(!jn&&!b(zs)){if(Re.length>=s)return T(I,Xe,zs,_e,Re);Vl|=nn,zl=m(hd,Ct,zs,Re)}else zl=y(hd,Ct,zs,Re);return hd?(this.mask=Vl,this.children=zl,this):R(I,Vl,zl)},X=function(I,Z,se,ae,fe,xe,ve){var _e=this.size,Re=this.children,Xe=f(se,fe),nn=Re[Xe],Ct=(nn||w)._modify(I,Z,se+r,ae,fe,xe,ve);if(nn===Ct)return this;var jn=Q(I,this),rr=void 0;if(b(nn)&&!b(Ct))++_e,rr=y(jn,Xe,Ct,Re);else if(!b(nn)&&b(Ct)){if(--_e,_e<=a)return D(I,_e,Xe,Re);rr=y(jn,Xe,w,Re)}else rr=y(jn,Xe,Ct,Re);return jn?(this.size=_e,this.children=rr,this):M(I,_e,rr)};w._modify=function(j,I,Z,se,ae,fe,xe){var ve=se();return ve===l?w:(++xe.value,A(j,ae,fe,ve))};function N(j,I,Z,se,ae){this._editable=j,this._edit=I,this._config=Z,this._root=se,this._size=ae}N.prototype.setTree=function(j,I){return this._editable?(this._root=j,this._size=I,this):j===this._root?this:new N(this._editable,this._edit,this._config,j,I)};var B=n.tryGetHash=function(j,I,Z,se){for(var ae=se._root,fe=0,xe=se._config.keyEq;;)switch(ae.type){case p:return xe(Z,ae.key)?ae.value:j;case v:{if(I===ae.hash)for(var ve=ae.children,_e=0,Re=ve.length;_e{n.set(i,t(r,i))}),n}var dh=rF;function iF(){return{nodeDeps:new Map,nodeToNodeSubscriptions:new Map}}function oF(e){return{nodeDeps:dh(e.nodeDeps,t=>new Set(t)),nodeToNodeSubscriptions:dh(e.nodeToNodeSubscriptions,t=>new Set(t))}}function gg(e,t,n,r){const{nodeDeps:i,nodeToNodeSubscriptions:o}=n,s=i.get(e);if(s&&r&&s!==r.nodeDeps.get(e))return;i.set(e,t);const a=s==null?t:Iu(t,s);for(const l of a)o.has(l)||o.set(l,new Set),Je(o.get(l)).add(e);if(s){const l=Iu(s,t);for(const u of l){if(!o.has(u))return;const c=Je(o.get(u));c.delete(e),c.size===0&&o.delete(u)}}}function sF(e,t,n,r){var i,o,s,a;const l=n.getState();r===l.currentTree.version||r===((i=l.nextTree)===null||i===void 0?void 0:i.version)||((o=l.previousTree)===null||o===void 0||o.version);const u=n.getGraph(r);if(gg(e,t,u),r===((s=l.previousTree)===null||s===void 0?void 0:s.version)){const d=n.getGraph(l.currentTree.version);gg(e,t,d,u)}if(r===((a=l.previousTree)===null||a===void 0?void 0:a.version)||r===l.currentTree.version){var c;const d=(c=l.nextTree)===null||c===void 0?void 0:c.version;if(d!==void 0){const f=n.getGraph(d);gg(e,t,f,u)}}}var Hc={cloneGraph:oF,graph:iF,saveDepsToStore:sF};let aF=0;const lF=()=>aF++;let uF=0;const cF=()=>uF++;let dF=0;const fF=()=>dF++;var L0={getNextTreeStateVersion:lF,getNextStoreID:cF,getNextComponentID:fF};const{persistentMap:uS}=tF,{graph:hF}=Hc,{getNextTreeStateVersion:OR}=L0;function PR(){const e=OR();return{version:e,stateID:e,transactionMetadata:{},dirtyAtoms:new Set,atomValues:uS(),nonvalidatedAtoms:uS()}}function pF(){const e=PR();return{currentTree:e,nextTree:null,previousTree:null,commitDepth:0,knownAtoms:new Set,knownSelectors:new Set,transactionSubscriptions:new Map,nodeTransactionSubscriptions:new Map,nodeToComponentSubscriptions:new Map,queuedComponentCallbacks_DEPRECATED:[],suspendedComponentResolvers:new Set,graphsByVersion:new Map().set(e.version,hF()),retention:{referenceCounts:new Map,nodesRetainedByZone:new Map,retainablesToCheckForRelease:new Set},nodeCleanupFunctions:new Map}}var IR={makeEmptyTreeState:PR,makeEmptyStoreState:pF,getNextTreeStateVersion:OR};class DR{}function gF(){return new DR}var O0={RetentionZone:DR,retentionZone:gF};function mF(e,t){const n=new Set(e);return n.add(t),n}function yF(e,t){const n=new Set(e);return n.delete(t),n}function vF(e,t,n){const r=new Map(e);return r.set(t,n),r}function _F(e,t,n){const r=new Map(e);return r.set(t,n(r.get(t))),r}function xF(e,t){const n=new Map(e);return n.delete(t),n}function SF(e,t){const n=new Map(e);return t.forEach(r=>n.delete(r)),n}var jR={setByAddingToSet:mF,setByDeletingFromSet:yF,mapBySettingInMap:vF,mapByUpdatingInMap:_F,mapByDeletingFromMap:xF,mapByDeletingMultipleFromMap:SF};function*wF(e,t){let n=0;for(const r of e)t(r,n++)&&(yield r)}var v2=wF;function bF(e,t){return new Proxy(e,{get:(r,i)=>(!(i in r)&&i in t&&(r[i]=t[i]()),r[i]),ownKeys:r=>Object.keys(r)})}var FR=bF;const{getNode:Wc,getNodeMaybe:EF,recoilValuesForKeys:cS}=_n,{RetentionZone:dS}=O0,{setByAddingToSet:CF}=jR,AF=Object.freeze(new Set);class RF extends Error{}function $F(e,t,n){if(!Be("recoil_memory_managament_2020"))return()=>{};const{nodesRetainedByZone:r}=e.getState().retention;function i(o){let s=r.get(o);s||r.set(o,s=new Set),s.add(t)}if(n instanceof dS)i(n);else if(Array.isArray(n))for(const o of n)i(o);return()=>{if(!Be("recoil_memory_managament_2020"))return;const{retention:o}=e.getState();function s(a){const l=o.nodesRetainedByZone.get(a);l==null||l.delete(t),l&&l.size===0&&o.nodesRetainedByZone.delete(a)}if(n instanceof dS)s(n);else if(Array.isArray(n))for(const a of n)s(a)}}function _2(e,t,n,r){const i=e.getState();if(i.nodeCleanupFunctions.has(n))return;const o=Wc(n),s=$F(e,n,o.retainedBy),a=o.init(e,t,r);i.nodeCleanupFunctions.set(n,()=>{a(),s()})}function kF(e,t,n){_2(e,e.getState().currentTree,t,n)}function TF(e,t){var n;const r=e.getState();(n=r.nodeCleanupFunctions.get(t))===null||n===void 0||n(),r.nodeCleanupFunctions.delete(t)}function MF(e,t,n){return _2(e,t,n,"get"),Wc(n).get(e,t)}function UR(e,t,n){return Wc(n).peek(e,t)}function NF(e,t,n){var r;const i=EF(t);return i==null||(r=i.invalidate)===null||r===void 0||r.call(i,e),{...e,atomValues:e.atomValues.clone().delete(t),nonvalidatedAtoms:e.nonvalidatedAtoms.clone().set(t,n),dirtyAtoms:CF(e.dirtyAtoms,t)}}function LF(e,t,n,r){const i=Wc(n);if(i.set==null)throw new RF(`Attempt to set read-only RecoilValue: ${n}`);const o=i.set;return _2(e,t,n,"set"),o(e,t,r)}function OF(e,t,n){const r=e.getState(),i=e.getGraph(t.version),o=Wc(n).nodeType;return FR({type:o},{loadable:()=>UR(e,t,n),isActive:()=>r.knownAtoms.has(n)||r.knownSelectors.has(n),isSet:()=>o==="selector"?!1:t.atomValues.has(n),isModified:()=>t.dirtyAtoms.has(n),deps:()=>{var s;return cS((s=i.nodeDeps.get(n))!==null&&s!==void 0?s:[])},subscribers:()=>{var s,a;return{nodes:cS(v2(VR(e,t,new Set([n])),l=>l!==n)),components:N0((s=(a=r.nodeToComponentSubscriptions.get(n))===null||a===void 0?void 0:a.values())!==null&&s!==void 0?s:[],([l])=>({name:l}))}}})}function VR(e,t,n){const r=new Set,i=Array.from(n),o=e.getGraph(t.version);for(let a=i.pop();a;a=i.pop()){var s;r.add(a);const l=(s=o.nodeToNodeSubscriptions.get(a))!==null&&s!==void 0?s:AF;for(const u of l)r.has(u)||i.push(u)}return r}var ko={getNodeLoadable:MF,peekNodeLoadable:UR,setNodeValue:LF,initializeNode:kF,cleanUpNode:TF,setUnvalidatedAtomValue_DEPRECATED:NF,peekNodeInfo:OF,getDownstreamNodes:VR};let zR=null;function PF(e){zR=e}function IF(){var e;(e=zR)===null||e===void 0||e()}var BR={setInvalidateMemoizedSnapshot:PF,invalidateMemoizedSnapshot:IF};const{getDownstreamNodes:DF,getNodeLoadable:HR,setNodeValue:jF}=ko,{getNextComponentID:FF}=L0,{getNode:UF,getNodeMaybe:WR}=_n,{DefaultValue:x2}=_n,{reactMode:VF}=Bc,{AbstractRecoilValue:zF,RecoilState:BF,RecoilValueReadOnly:HF,isRecoilValue:WF}=il,{invalidateMemoizedSnapshot:qF}=BR;function GF(e,{key:t},n=e.getState().currentTree){var r,i;const o=e.getState();n.version===o.currentTree.version||n.version===((r=o.nextTree)===null||r===void 0?void 0:r.version)||(n.version,(i=o.previousTree)===null||i===void 0||i.version);const s=HR(e,n,t);return s.state==="loading"&&s.contents.catch(()=>{}),s}function KF(e,t){const n=e.clone();return t.forEach((r,i)=>{r.state==="hasValue"&&r.contents instanceof x2?n.delete(i):n.set(i,r)}),n}function YF(e,t,{key:n},r){if(typeof r=="function"){const i=HR(e,t,n);if(i.state==="loading"){const o=`Tried to set atom or selector "${n}" using an updater function while the current state is pending, this is not currently supported.`;throw Ae(o)}else if(i.state==="hasError")throw i.contents;return r(i.contents)}else return r}function QF(e,t,n){if(n.type==="set"){const{recoilValue:i,valueOrUpdater:o}=n,s=YF(e,t,i,o),a=jF(e,t,i.key,s);for(const[l,u]of a.entries())Ty(t,l,u)}else if(n.type==="setLoadable"){const{recoilValue:{key:i},loadable:o}=n;Ty(t,i,o)}else if(n.type==="markModified"){const{recoilValue:{key:i}}=n;t.dirtyAtoms.add(i)}else if(n.type==="setUnvalidated"){var r;const{recoilValue:{key:i},unvalidatedValue:o}=n,s=WR(i);s==null||(r=s.invalidate)===null||r===void 0||r.call(s,t),t.atomValues.delete(i),t.nonvalidatedAtoms.set(i,o),t.dirtyAtoms.add(i)}else h2(`Unknown action ${n.type}`)}function Ty(e,t,n){n.state==="hasValue"&&n.contents instanceof x2?e.atomValues.delete(t):e.atomValues.set(t,n),e.dirtyAtoms.add(t),e.nonvalidatedAtoms.delete(t)}function qR(e,t){e.replaceState(n=>{const r=GR(n);for(const i of t)QF(e,r,i);return KR(e,r),qF(),r})}function P0(e,t){if(Du.length){const n=Du[Du.length-1];let r=n.get(e);r||n.set(e,r=[]),r.push(t)}else qR(e,[t])}const Du=[];function XF(){const e=new Map;return Du.push(e),()=>{for(const[t,n]of e)qR(t,n);Du.pop()}}function GR(e){return{...e,atomValues:e.atomValues.clone(),nonvalidatedAtoms:e.nonvalidatedAtoms.clone(),dirtyAtoms:new Set(e.dirtyAtoms)}}function KR(e,t){const n=DF(e,t,t.dirtyAtoms);for(const o of n){var r,i;(r=WR(o))===null||r===void 0||(i=r.invalidate)===null||i===void 0||i.call(r,t)}}function YR(e,t,n){P0(e,{type:"set",recoilValue:t,valueOrUpdater:n})}function ZF(e,t,n){if(n instanceof x2)return YR(e,t,n);P0(e,{type:"setLoadable",recoilValue:t,loadable:n})}function JF(e,t){P0(e,{type:"markModified",recoilValue:t})}function e8(e,t,n){P0(e,{type:"setUnvalidated",recoilValue:t,unvalidatedValue:n})}function t8(e,{key:t},n,r=null){const i=FF(),o=e.getState();o.nodeToComponentSubscriptions.has(t)||o.nodeToComponentSubscriptions.set(t,new Map),Je(o.nodeToComponentSubscriptions.get(t)).set(i,[r??"",n]);const s=VF();if(s.early&&(s.mode==="LEGACY"||s.mode==="MUTABLE_SOURCE")){const a=e.getState().nextTree;a&&a.dirtyAtoms.has(t)&&n(a)}return{release:()=>{const a=e.getState(),l=a.nodeToComponentSubscriptions.get(t);l===void 0||!l.has(i)||(l.delete(i),l.size===0&&a.nodeToComponentSubscriptions.delete(t))}}}function n8(e,t){var n;const{currentTree:r}=e.getState(),i=UF(t.key);(n=i.clearCache)===null||n===void 0||n.call(i,e,r)}var Hr={RecoilValueReadOnly:HF,AbstractRecoilValue:zF,RecoilState:BF,getRecoilValueAsLoadable:GF,setRecoilValue:YR,setRecoilValueLoadable:ZF,markRecoilValueModified:JF,setUnvalidatedRecoilValue:e8,subscribeToRecoilValue:t8,isRecoilValue:WF,applyAtomValueWrites:KF,batchStart:XF,writeLoadableToTreeState:Ty,invalidateDownstreams:KR,copyTreeState:GR,refreshRecoilValue:n8};function r8(e,t,n){const r=e.entries();let i=r.next();for(;!i.done;){const o=i.value;if(t.call(n,o[1],o[0],e))return!0;i=r.next()}return!1}var i8=r8;const{cleanUpNode:o8}=ko,{deleteNodeConfigIfPossible:s8,getNode:QR}=_n,{RetentionZone:XR}=O0,a8=12e4,ZR=new Set;function JR(e,t){const n=e.getState(),r=n.currentTree;if(n.nextTree)return;const i=new Set;for(const s of t)if(s instanceof XR)for(const a of d8(n,s))i.add(a);else i.add(s);const o=l8(e,i);for(const s of o)c8(e,r,s)}function l8(e,t){const n=e.getState(),r=n.currentTree,i=e.getGraph(r.version),o=new Set,s=new Set;return a(t),o;function a(l){const u=new Set,c=u8(e,r,l,o,s);for(const g of c){var d;if(QR(g).retainedBy==="recoilRoot"){s.add(g);continue}if(((d=n.retention.referenceCounts.get(g))!==null&&d!==void 0?d:0)>0){s.add(g);continue}if(e$(g).some(_=>n.retention.referenceCounts.get(_))){s.add(g);continue}const y=i.nodeToNodeSubscriptions.get(g);if(y&&i8(y,_=>s.has(_))){s.add(g);continue}o.add(g),u.add(g)}const f=new Set;for(const g of u)for(const y of(h=i.nodeDeps.get(g))!==null&&h!==void 0?h:ZR){var h;o.has(y)||f.add(y)}f.size&&a(f)}}function u8(e,t,n,r,i){const o=e.getGraph(t.version),s=[],a=new Set;for(;n.size>0;)l(Je(n.values().next().value));return s;function l(u){if(r.has(u)||i.has(u)){n.delete(u);return}if(a.has(u))return;const c=o.nodeToNodeSubscriptions.get(u);if(c)for(const d of c)l(d);a.add(u),n.delete(u),s.push(u)}}function c8(e,t,n){if(!Be("recoil_memory_managament_2020"))return;o8(e,n);const r=e.getState();r.knownAtoms.delete(n),r.knownSelectors.delete(n),r.nodeTransactionSubscriptions.delete(n),r.retention.referenceCounts.delete(n);const i=e$(n);for(const l of i){var o;(o=r.retention.nodesRetainedByZone.get(l))===null||o===void 0||o.delete(n)}t.atomValues.delete(n),t.dirtyAtoms.delete(n),t.nonvalidatedAtoms.delete(n);const s=r.graphsByVersion.get(t.version);if(s){const l=s.nodeDeps.get(n);if(l!==void 0){s.nodeDeps.delete(n);for(const u of l){var a;(a=s.nodeToNodeSubscriptions.get(u))===null||a===void 0||a.delete(n)}}s.nodeToNodeSubscriptions.delete(n)}s8(n)}function d8(e,t){var n;return(n=e.retention.nodesRetainedByZone.get(t))!==null&&n!==void 0?n:ZR}function e$(e){const t=QR(e).retainedBy;return t===void 0||t==="components"||t==="recoilRoot"?[]:t instanceof XR?[t]:t}function f8(e,t){const n=e.getState();n.nextTree?n.retention.retainablesToCheckForRelease.add(t):JR(e,new Set([t]))}function h8(e,t,n){var r;if(!Be("recoil_memory_managament_2020"))return;const i=e.getState().retention.referenceCounts,o=((r=i.get(t))!==null&&r!==void 0?r:0)+n;o===0?t$(e,t):i.set(t,o)}function t$(e,t){if(!Be("recoil_memory_managament_2020"))return;e.getState().retention.referenceCounts.delete(t),f8(e,t)}function p8(e){if(!Be("recoil_memory_managament_2020"))return;const t=e.getState();JR(e,t.retention.retainablesToCheckForRelease),t.retention.retainablesToCheckForRelease.clear()}function g8(e){return e===void 0?"recoilRoot":e}var Ts={SUSPENSE_TIMEOUT_MS:a8,updateRetainCount:h8,updateRetainCountToZero:t$,releaseScheduledRetainablesNow:p8,retainedByOptionWithDefault:g8};const{unstable_batchedUpdates:m8}=eI;var y8={unstable_batchedUpdates:m8};const{unstable_batchedUpdates:v8}=y8;var _8={unstable_batchedUpdates:v8};const{batchStart:x8}=Hr,{unstable_batchedUpdates:S8}=_8;let S2=S8||(e=>e());const w8=e=>{S2=e},b8=()=>S2,E8=e=>{S2(()=>{let t=()=>{};try{t=x8(),e()}finally{t()}})};var I0={getBatcher:b8,setBatcher:w8,batchUpdates:E8};function*C8(e){for(const t of e)for(const n of t)yield n}var n$=C8;const r$=typeof Window>"u"||typeof window>"u",A8=e=>!r$&&(e===window||e instanceof Window),R8=typeof navigator<"u"&&navigator.product==="ReactNative";var D0={isSSR:r$,isReactNative:R8,isWindow:A8};function $8(e,t){let n;return(...r)=>{n||(n={});const i=t(...r);return Object.hasOwnProperty.call(n,i)||(n[i]=e(...r)),n[i]}}function k8(e,t){let n,r;return(...i)=>{const o=t(...i);return n===o||(n=o,r=e(...i)),r}}function T8(e,t){let n,r;return[(...s)=>{const a=t(...s);return n===a||(n=a,r=e(...s)),r},()=>{n=null}]}var M8={memoizeWithArgsHash:$8,memoizeOneWithArgsHash:k8,memoizeOneWithArgsHashAndInvalidation:T8};const{batchUpdates:My}=I0,{initializeNode:N8,peekNodeInfo:L8}=ko,{graph:O8}=Hc,{getNextStoreID:P8}=L0,{DEFAULT_VALUE:I8,recoilValues:fS,recoilValuesForKeys:hS}=_n,{AbstractRecoilValue:D8,getRecoilValueAsLoadable:j8,setRecoilValue:pS,setUnvalidatedRecoilValue:F8}=Hr,{updateRetainCount:vf}=Ts,{setInvalidateMemoizedSnapshot:U8}=BR,{getNextTreeStateVersion:V8,makeEmptyStoreState:z8}=IR,{isSSR:B8}=D0,{memoizeOneWithArgsHashAndInvalidation:H8}=M8;class j0{constructor(t,n){Ce(this,"_store",void 0),Ce(this,"_refCount",1),Ce(this,"getLoadable",r=>(this.checkRefCount_INTERNAL(),j8(this._store,r))),Ce(this,"getPromise",r=>(this.checkRefCount_INTERNAL(),this.getLoadable(r).toPromise())),Ce(this,"getNodes_UNSTABLE",r=>{if(this.checkRefCount_INTERNAL(),(r==null?void 0:r.isModified)===!0){if((r==null?void 0:r.isInitialized)===!1)return[];const s=this._store.getState().currentTree;return hS(s.dirtyAtoms)}const i=this._store.getState().knownAtoms,o=this._store.getState().knownSelectors;return(r==null?void 0:r.isInitialized)==null?fS.values():r.isInitialized===!0?hS(n$([i,o])):v2(fS.values(),({key:s})=>!i.has(s)&&!o.has(s))}),Ce(this,"getInfo_UNSTABLE",({key:r})=>(this.checkRefCount_INTERNAL(),L8(this._store,this._store.getState().currentTree,r))),Ce(this,"map",r=>{this.checkRefCount_INTERNAL();const i=new Ny(this,My);return r(i),i}),Ce(this,"asyncMap",async r=>{this.checkRefCount_INTERNAL();const i=new Ny(this,My);return i.retain(),await r(i),i.autoRelease_INTERNAL(),i}),this._store={storeID:P8(),parentStoreID:n,getState:()=>t,replaceState:r=>{t.currentTree=r(t.currentTree)},getGraph:r=>{const i=t.graphsByVersion;if(i.has(r))return Je(i.get(r));const o=O8();return i.set(r,o),o},subscribeToTransactions:()=>({release:()=>{}}),addTransactionMetadata:()=>{throw Ae("Cannot subscribe to Snapshots")}};for(const r of this._store.getState().knownAtoms)N8(this._store,r,"get"),vf(this._store,r,1);this.autoRelease_INTERNAL()}retain(){this._refCount<=0,this._refCount++;let t=!1;return()=>{t||(t=!0,this._release())}}autoRelease_INTERNAL(){B8||window.setTimeout(()=>this._release(),10)}_release(){if(this._refCount--,this._refCount===0){if(this._store.getState().nodeCleanupFunctions.forEach(t=>t()),this._store.getState().nodeCleanupFunctions.clear(),!Be("recoil_memory_managament_2020"))return}else this._refCount<0}isRetained(){return this._refCount>0}checkRefCount_INTERNAL(){Be("recoil_memory_managament_2020")&&this._refCount<=0}getStore_INTERNAL(){return this.checkRefCount_INTERNAL(),this._store}getID(){return this.checkRefCount_INTERNAL(),this._store.getState().currentTree.stateID}getStoreID(){return this.checkRefCount_INTERNAL(),this._store.storeID}}function i$(e,t,n=!1){const r=e.getState(),i=n?V8():t.version;return{currentTree:{version:n?i:t.version,stateID:n?i:t.stateID,transactionMetadata:{...t.transactionMetadata},dirtyAtoms:new Set(t.dirtyAtoms),atomValues:t.atomValues.clone(),nonvalidatedAtoms:t.nonvalidatedAtoms.clone()},commitDepth:0,nextTree:null,previousTree:null,knownAtoms:new Set(r.knownAtoms),knownSelectors:new Set(r.knownSelectors),transactionSubscriptions:new Map,nodeTransactionSubscriptions:new Map,nodeToComponentSubscriptions:new Map,queuedComponentCallbacks_DEPRECATED:[],suspendedComponentResolvers:new Set,graphsByVersion:new Map().set(i,e.getGraph(t.version)),retention:{referenceCounts:new Map,nodesRetainedByZone:new Map,retainablesToCheckForRelease:new Set},nodeCleanupFunctions:new Map(N0(r.nodeCleanupFunctions.entries(),([o])=>[o,()=>{}]))}}function W8(e){const t=new j0(z8());return e!=null?t.map(e):t}const[gS,o$]=H8((e,t)=>{var n;const r=e.getState(),i=t==="latest"?(n=r.nextTree)!==null&&n!==void 0?n:r.currentTree:Je(r.previousTree);return new j0(i$(e,i),e.storeID)},(e,t)=>{var n,r;return String(t)+String(e.storeID)+String((n=e.getState().nextTree)===null||n===void 0?void 0:n.version)+String(e.getState().currentTree.version)+String((r=e.getState().previousTree)===null||r===void 0?void 0:r.version)});U8(o$);function q8(e,t="latest"){const n=gS(e,t);return n.isRetained()?n:(o$(),gS(e,t))}class Ny extends j0{constructor(t,n){super(i$(t.getStore_INTERNAL(),t.getStore_INTERNAL().getState().currentTree,!0),t.getStoreID()),Ce(this,"_batch",void 0),Ce(this,"set",(r,i)=>{this.checkRefCount_INTERNAL();const o=this.getStore_INTERNAL();this._batch(()=>{vf(o,r.key,1),pS(this.getStore_INTERNAL(),r,i)})}),Ce(this,"reset",r=>{this.checkRefCount_INTERNAL();const i=this.getStore_INTERNAL();this._batch(()=>{vf(i,r.key,1),pS(this.getStore_INTERNAL(),r,I8)})}),Ce(this,"setUnvalidatedAtomValues_DEPRECATED",r=>{this.checkRefCount_INTERNAL();const i=this.getStore_INTERNAL();My(()=>{for(const[o,s]of r.entries())vf(i,o,1),F8(i,new D8(o),s)})}),this._batch=n}}var F0={Snapshot:j0,MutableSnapshot:Ny,freshSnapshot:W8,cloneSnapshot:q8},G8=F0.Snapshot,K8=F0.MutableSnapshot,Y8=F0.freshSnapshot,Q8=F0.cloneSnapshot,U0=Object.freeze({__proto__:null,Snapshot:G8,MutableSnapshot:K8,freshSnapshot:Y8,cloneSnapshot:Q8});function X8(...e){const t=new Set;for(const n of e)for(const r of n)t.add(r);return t}var Z8=X8;const{useRef:J8}=E;function e9(e){const t=J8(e);return t.current===e&&typeof e=="function"&&(t.current=e()),t}var mS=e9;const{getNextTreeStateVersion:t9,makeEmptyStoreState:s$}=IR,{cleanUpNode:n9,getDownstreamNodes:r9,initializeNode:i9,setNodeValue:o9,setUnvalidatedAtomValue_DEPRECATED:s9}=ko,{graph:a9}=Hc,{cloneGraph:l9}=Hc,{getNextStoreID:a$}=L0,{createMutableSource:mg,reactMode:l$}=Bc,{applyAtomValueWrites:u9}=Hr,{releaseScheduledRetainablesNow:u$}=Ts,{freshSnapshot:c9}=U0,{useCallback:d9,useContext:c$,useEffect:Ly,useMemo:f9,useRef:h9,useState:p9}=E;function Xl(){throw Ae("This component must be used inside a component.")}const d$=Object.freeze({storeID:a$(),getState:Xl,replaceState:Xl,getGraph:Xl,subscribeToTransactions:Xl,addTransactionMetadata:Xl});let Oy=!1;function yS(e){if(Oy)throw Ae("An atom update was triggered within the execution of a state updater function. State updater functions provided to Recoil must be pure functions.");const t=e.getState();if(t.nextTree===null){Be("recoil_memory_managament_2020")&&Be("recoil_release_on_cascading_update_killswitch_2021")&&t.commitDepth>0&&u$(e);const n=t.currentTree.version,r=t9();t.nextTree={...t.currentTree,version:r,stateID:r,dirtyAtoms:new Set,transactionMetadata:{}},t.graphsByVersion.set(r,l9(Je(t.graphsByVersion.get(n))))}}const f$=E.createContext({current:d$}),V0=()=>c$(f$),h$=E.createContext(null);function g9(){return c$(h$)}function w2(e,t,n){const r=r9(e,n,n.dirtyAtoms);for(const i of r){const o=t.nodeToComponentSubscriptions.get(i);if(o)for(const[s,[a,l]]of o)l(n)}}function p$(e){const t=e.getState(),n=t.currentTree,r=n.dirtyAtoms;if(r.size){for(const[i,o]of t.nodeTransactionSubscriptions)if(r.has(i))for(const[s,a]of o)a(e);for(const[i,o]of t.transactionSubscriptions)o(e);(!l$().early||t.suspendedComponentResolvers.size>0)&&(w2(e,t,n),t.suspendedComponentResolvers.forEach(i=>i()),t.suspendedComponentResolvers.clear())}t.queuedComponentCallbacks_DEPRECATED.forEach(i=>i(n)),t.queuedComponentCallbacks_DEPRECATED.splice(0,t.queuedComponentCallbacks_DEPRECATED.length)}function m9(e){const t=e.getState();t.commitDepth++;try{const{nextTree:n}=t;if(n==null)return;t.previousTree=t.currentTree,t.currentTree=n,t.nextTree=null,p$(e),t.previousTree!=null?t.graphsByVersion.delete(t.previousTree.version):h2("Ended batch with no previous state, which is unexpected","recoil"),t.previousTree=null,Be("recoil_memory_managament_2020")&&n==null&&u$(e)}finally{t.commitDepth--}}function y9({setNotifyBatcherOfChange:e}){const t=V0(),[,n]=p9([]);return e(()=>n({})),Ly(()=>(e(()=>n({})),()=>{e(()=>{})}),[e]),Ly(()=>{Yj.enqueueExecution("Batcher",()=>{m9(t.current)})}),null}function v9(e,t){const n=s$();return t({set:(r,i)=>{const o=n.currentTree,s=o9(e,o,r.key,i),a=new Set(s.keys()),l=o.nonvalidatedAtoms.clone();for(const u of a)l.delete(u);n.currentTree={...o,dirtyAtoms:Z8(o.dirtyAtoms,a),atomValues:u9(o.atomValues,s),nonvalidatedAtoms:l}},setUnvalidatedAtomValues:r=>{r.forEach((i,o)=>{n.currentTree=s9(n.currentTree,o,i)})}}),n}function _9(e){const t=c9(e),n=t.getStore_INTERNAL().getState();return t.retain(),n.nodeCleanupFunctions.forEach(r=>r()),n.nodeCleanupFunctions.clear(),n}let vS=0;function x9({initializeState_DEPRECATED:e,initializeState:t,store_INTERNAL:n,children:r}){let i;const o=h=>{const g=i.current.graphsByVersion;if(g.has(h))return Je(g.get(h));const y=a9();return g.set(h,y),y},s=(h,g)=>{if(g==null){const{transactionSubscriptions:y}=d.current.getState(),_=vS++;return y.set(_,h),{release:()=>{y.delete(_)}}}else{const{nodeTransactionSubscriptions:y}=d.current.getState();y.has(g)||y.set(g,new Map);const _=vS++;return Je(y.get(g)).set(_,h),{release:()=>{const m=y.get(g);m&&(m.delete(_),m.size===0&&y.delete(g))}}}},a=h=>{yS(d.current);for(const g of Object.keys(h))Je(d.current.getState().nextTree).transactionMetadata[g]=h[g]},l=h=>{yS(d.current);const g=Je(i.current.nextTree);let y;try{Oy=!0,y=h(g)}finally{Oy=!1}y!==g&&(i.current.nextTree=y,l$().early&&w2(d.current,i.current,y),Je(u.current)())},u=h9(null),c=d9(h=>{u.current=h},[u]),d=mS(()=>n??{storeID:a$(),getState:()=>i.current,replaceState:l,getGraph:o,subscribeToTransactions:s,addTransactionMetadata:a});n!=null&&(d.current=n),i=mS(()=>e!=null?v9(d.current,e):t!=null?_9(t):s$());const f=f9(()=>mg==null?void 0:mg(i,()=>i.current.currentTree.version),[i]);return Ly(()=>{const h=d.current;for(const g of new Set(h.getState().knownAtoms))i9(h,g,"get");return()=>{for(const g of h.getState().knownAtoms)n9(h,g)}},[d]),E.createElement(f$.Provider,{value:d},E.createElement(h$.Provider,{value:f},E.createElement(y9,{setNotifyBatcherOfChange:c}),r))}function S9(e){const{override:t,...n}=e,r=V0();return t===!1&&r.current!==d$?e.children:E.createElement(x9,n)}function w9(){return V0().current.storeID}var Ai={RecoilRoot:S9,useStoreRef:V0,useRecoilMutableSource:g9,useRecoilStoreID:w9,notifyComponents_FOR_TESTING:w2,sendEndOfBatchNotifications_FOR_TESTING:p$};function b9(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0,r=e.length;n{t.current=e}),t.current}var g$=R9;const{useStoreRef:$9}=Ai,{SUSPENSE_TIMEOUT_MS:k9}=Ts,{updateRetainCount:Zl}=Ts,{RetentionZone:T9}=O0,{useEffect:M9,useRef:N9}=E,{isSSR:_S}=D0;function L9(e){if(Be("recoil_memory_managament_2020"))return O9(e)}function O9(e){const n=(Array.isArray(e)?e:[e]).map(s=>s instanceof T9?s:s.key),r=$9();M9(()=>{if(!Be("recoil_memory_managament_2020"))return;const s=r.current;if(i.current&&!_S)window.clearTimeout(i.current),i.current=null;else for(const a of n)Zl(s,a,1);return()=>{for(const a of n)Zl(s,a,-1)}},[r,...n]);const i=N9(),o=g$(n);if(!_S&&(o===void 0||!E9(o,n))){const s=r.current;for(const a of n)Zl(s,a,1);if(o)for(const a of o)Zl(s,a,-1);i.current&&window.clearTimeout(i.current),i.current=window.setTimeout(()=>{i.current=null;for(const a of n)Zl(s,a,-1)},k9)}}var b2=L9;function P9(){return""}var qc=P9;const{batchUpdates:I9}=I0,{DEFAULT_VALUE:m$}=_n,{currentRendererSupportsUseSyncExternalStore:D9,reactMode:El,useMutableSource:j9,useSyncExternalStore:F9}=Bc,{useRecoilMutableSource:U9,useStoreRef:Wr}=Ai,{AbstractRecoilValue:Py,getRecoilValueAsLoadable:Gc,setRecoilValue:fh,setUnvalidatedRecoilValue:V9,subscribeToRecoilValue:ol}=Hr,{useCallback:mn,useEffect:sl,useMemo:y$,useRef:ju,useState:E2}=E,{setByAddingToSet:z9}=jR,{isSSR:B9}=D0;function C2(e,t,n){if(e.state==="hasValue")return e.contents;throw e.state==="loading"?new Promise(i=>{const o=n.current.getState().suspendedComponentResolvers;o.add(i),B9&&Ke(e.contents)&&e.contents.finally(()=>{o.delete(i)})}):e.state==="hasError"?e.contents:Ae(`Invalid value of loadable atom "${t.key}"`)}function H9(){const e=qc(),t=Wr(),[,n]=E2([]),r=ju(new Set);r.current=new Set;const i=ju(new Set),o=ju(new Map),s=mn(l=>{const u=o.current.get(l);u&&(u.release(),o.current.delete(l))},[o]),a=mn((l,u)=>{o.current.has(u)&&n([])},[]);return sl(()=>{const l=t.current;Iu(r.current,i.current).forEach(u=>{if(o.current.has(u))return;const c=ol(l,new Py(u),f=>a(f,u),e);o.current.set(u,c),l.getState().nextTree?l.getState().queuedComponentCallbacks_DEPRECATED.push(()=>{a(l.getState(),u)}):a(l.getState(),u)}),Iu(i.current,r.current).forEach(u=>{s(u)}),i.current=r.current}),sl(()=>{const l=o.current;return Iu(r.current,new Set(l.keys())).forEach(u=>{const c=ol(t.current,new Py(u),d=>a(d,u),e);l.set(u,c)}),()=>l.forEach((u,c)=>s(c))},[e,t,s,a]),y$(()=>{function l(g){return y=>{fh(t.current,g,y)}}function u(g){return()=>fh(t.current,g,m$)}function c(g){var y;r.current.has(g.key)||(r.current=z9(r.current,g.key));const _=t.current.getState();return Gc(t.current,g,El().early&&(y=_.nextTree)!==null&&y!==void 0?y:_.currentTree)}function d(g){const y=c(g);return C2(y,g,t)}function f(g){return[d(g),l(g)]}function h(g){return[c(g),l(g)]}return{getRecoilValue:d,getRecoilValueLoadable:c,getRecoilState:f,getRecoilStateLoadable:h,getSetRecoilState:l,getResetRecoilState:u}},[r,t])}const W9={current:0};function q9(e){const t=Wr(),n=qc(),r=mn(()=>{var a;const l=t.current,u=l.getState(),c=El().early&&(a=u.nextTree)!==null&&a!==void 0?a:u.currentTree;return{loadable:Gc(l,e,c),key:e.key}},[t,e]),i=mn(a=>{let l;return()=>{var u,c;const d=a();return(u=l)!==null&&u!==void 0&&u.loadable.is(d.loadable)&&((c=l)===null||c===void 0?void 0:c.key)===d.key?l:(l=d,d)}},[]),o=y$(()=>i(r),[r,i]),s=mn(a=>{const l=t.current;return ol(l,e,a,n).release},[t,e,n]);return F9(s,o,o).loadable}function G9(e){const t=Wr(),n=mn(()=>{var u;const c=t.current,d=c.getState(),f=El().early&&(u=d.nextTree)!==null&&u!==void 0?u:d.currentTree;return Gc(c,e,f)},[t,e]),r=mn(()=>n(),[n]),i=qc(),o=mn((u,c)=>{const d=t.current;return ol(d,e,()=>{if(!Be("recoil_suppress_rerender_in_callback"))return c();const h=n();l.current.is(h)||c(),l.current=h},i).release},[t,e,i,n]),s=U9();if(s==null)throw Ae("Recoil hooks must be used in components contained within a component.");const a=j9(s,r,o),l=ju(a);return sl(()=>{l.current=a}),a}function Iy(e){const t=Wr(),n=qc(),r=mn(()=>{var l;const u=t.current,c=u.getState(),d=El().early&&(l=c.nextTree)!==null&&l!==void 0?l:c.currentTree;return Gc(u,e,d)},[t,e]),i=mn(()=>({loadable:r(),key:e.key}),[r,e.key]),o=mn(l=>{const u=i();return l.loadable.is(u.loadable)&&l.key===u.key?l:u},[i]);sl(()=>{const l=ol(t.current,e,u=>{a(o)},n);return a(o),l.release},[n,e,t,o]);const[s,a]=E2(i);return s.key!==e.key?i().loadable:s.loadable}function K9(e){const t=Wr(),[,n]=E2([]),r=qc(),i=mn(()=>{var a;const l=t.current,u=l.getState(),c=El().early&&(a=u.nextTree)!==null&&a!==void 0?a:u.currentTree;return Gc(l,e,c)},[t,e]),o=i(),s=ju(o);return sl(()=>{s.current=o}),sl(()=>{const a=t.current,l=a.getState(),u=ol(a,e,d=>{var f;if(!Be("recoil_suppress_rerender_in_callback"))return n([]);const h=i();(f=s.current)!==null&&f!==void 0&&f.is(h)||n(h),s.current=h},r);if(l.nextTree)a.getState().queuedComponentCallbacks_DEPRECATED.push(()=>{s.current=null,n([])});else{var c;if(!Be("recoil_suppress_rerender_in_callback"))return n([]);const d=i();(c=s.current)!==null&&c!==void 0&&c.is(d)||n(d),s.current=d}return u.release},[r,i,e,t]),o}function A2(e){return Be("recoil_memory_managament_2020")&&b2(e),{TRANSITION_SUPPORT:Iy,SYNC_EXTERNAL_STORE:D9()?q9:Iy,MUTABLE_SOURCE:G9,LEGACY:K9}[El().mode](e)}function v$(e){const t=Wr(),n=A2(e);return C2(n,e,t)}function z0(e){const t=Wr();return mn(n=>{fh(t.current,e,n)},[t,e])}function Y9(e){const t=Wr();return mn(()=>{fh(t.current,e,m$)},[t,e])}function Q9(e){return[v$(e),z0(e)]}function X9(e){return[A2(e),z0(e)]}function Z9(){const e=Wr();return(t,n={})=>{I9(()=>{e.current.addTransactionMetadata(n),t.forEach((r,i)=>V9(e.current,new Py(i),r))})}}function _$(e){return Be("recoil_memory_managament_2020")&&b2(e),Iy(e)}function x$(e){const t=Wr(),n=_$(e);return C2(n,e,t)}function J9(e){return[x$(e),z0(e)]}var e7={recoilComponentGetRecoilValueCount_FOR_TESTING:W9,useRecoilInterface:H9,useRecoilState:Q9,useRecoilStateLoadable:X9,useRecoilValue:v$,useRecoilValueLoadable:A2,useResetRecoilState:Y9,useSetRecoilState:z0,useSetUnvalidatedAtomValues:Z9,useRecoilValueLoadable_TRANSITION_SUPPORT_UNSTABLE:_$,useRecoilValue_TRANSITION_SUPPORT_UNSTABLE:x$,useRecoilState_TRANSITION_SUPPORT_UNSTABLE:J9};function t7(e,t){const n=new Map;for(const[r,i]of e)t(i,r)&&n.set(r,i);return n}var n7=t7;function r7(e,t){const n=new Set;for(const r of e)t(r)&&n.add(r);return n}var i7=r7;function o7(...e){const t=new Map;for(let n=0;nt.current.subscribeToTransactions(e).release,[e,t])}function wS(e){const t=e.atomValues.toMap(),n=dh(n7(t,(r,i)=>{const s=S$(i).persistence_UNSTABLE;return s!=null&&s.type!=="none"&&r.state==="hasValue"}),r=>r.contents);return s7(e.nonvalidatedAtoms.toMap(),n)}function p7(e){H0(B0(t=>{let n=t.getState().previousTree;const r=t.getState().currentTree;n||(n=t.getState().currentTree);const i=wS(r),o=wS(n),s=dh(u7,l=>{var u,c,d,f;return{persistence_UNSTABLE:{type:(u=(c=l.persistence_UNSTABLE)===null||c===void 0?void 0:c.type)!==null&&u!==void 0?u:"none",backButton:(d=(f=l.persistence_UNSTABLE)===null||f===void 0?void 0:f.backButton)!==null&&d!==void 0?d:!1}}}),a=i7(r.dirtyAtoms,l=>i.has(l)||o.has(l));e({atomValues:i,previousAtomValues:o,atomInfo:s,modifiedAtoms:a,transactionMetadata:{...r.transactionMetadata}})},[e]))}function g7(e){H0(B0(t=>{const n=hh(t,"latest"),r=hh(t,"previous");e({snapshot:n,previousSnapshot:r})},[e]))}function m7(){const e=R2(),[t,n]=h7(()=>hh(e.current)),r=g$(t),i=xS(),o=xS();if(H0(B0(a=>n(hh(a)),[])),w$(()=>{const a=t.retain();if(i.current&&!SS){var l;window.clearTimeout(i.current),i.current=null,(l=o.current)===null||l===void 0||l.call(o),o.current=null}return()=>{window.setTimeout(a,10)}},[t]),r!==t&&!SS){if(i.current){var s;window.clearTimeout(i.current),i.current=null,(s=o.current)===null||s===void 0||s.call(o),o.current=null}o.current=t.retain(),i.current=window.setTimeout(()=>{var a;i.current=null,(a=o.current)===null||a===void 0||a.call(o),o.current=null},f7)}return t}function b$(e,t){var n;const r=e.getState(),i=(n=r.nextTree)!==null&&n!==void 0?n:r.currentTree,o=t.getStore_INTERNAL().getState().currentTree;a7(()=>{const s=new Set;for(const u of[i.atomValues.keys(),o.atomValues.keys()])for(const c of u){var a,l;((a=i.atomValues.get(c))===null||a===void 0?void 0:a.contents)!==((l=o.atomValues.get(c))===null||l===void 0?void 0:l.contents)&&S$(c).shouldRestoreFromSnapshots&&s.add(c)}s.forEach(u=>{d7(e,new c7(u),o.atomValues.has(u)?Je(o.atomValues.get(u)):l7)}),e.replaceState(u=>({...u,stateID:t.getID()}))})}function y7(){const e=R2();return B0(t=>b$(e.current,t),[e])}var E$={useRecoilSnapshot:m7,gotoSnapshot:b$,useGotoRecoilSnapshot:y7,useRecoilTransactionObserver:g7,useTransactionObservation_DEPRECATED:p7,useTransactionSubscription_DEPRECATED:H0};const{peekNodeInfo:v7}=ko,{useStoreRef:_7}=Ai;function x7(){const e=_7();return({key:t})=>v7(e.current,e.current.getState().currentTree,t)}var S7=x7;const{reactMode:w7}=Bc,{RecoilRoot:b7,useStoreRef:E7}=Ai,{useMemo:C7}=E;function A7(){w7().mode==="MUTABLE_SOURCE"&&console.warn("Warning: There are known issues using useRecoilBridgeAcrossReactRoots() in recoil_mutable_source rendering mode. Please consider upgrading to recoil_sync_external_store mode.");const e=E7().current;return C7(()=>{function t({children:n}){return E.createElement(b7,{store_INTERNAL:e},n)}return t},[e])}var R7=A7;const{loadableWithValue:$7}=zc,{initializeNode:k7}=ko,{DEFAULT_VALUE:T7,getNode:M7}=_n,{copyTreeState:N7,getRecoilValueAsLoadable:L7,invalidateDownstreams:O7,writeLoadableToTreeState:P7}=Hr;function bS(e){return M7(e.key).nodeType==="atom"}class I7{constructor(t,n){Ce(this,"_store",void 0),Ce(this,"_treeState",void 0),Ce(this,"_changes",void 0),Ce(this,"get",r=>{if(this._changes.has(r.key))return this._changes.get(r.key);if(!bS(r))throw Ae("Reading selectors within atomicUpdate is not supported");const i=L7(this._store,r,this._treeState);if(i.state==="hasValue")return i.contents;throw i.state==="hasError"?i.contents:Ae(`Expected Recoil atom ${r.key} to have a value, but it is in a loading state.`)}),Ce(this,"set",(r,i)=>{if(!bS(r))throw Ae("Setting selectors within atomicUpdate is not supported");if(typeof i=="function"){const o=this.get(r);this._changes.set(r.key,i(o))}else k7(this._store,r.key,"set"),this._changes.set(r.key,i)}),Ce(this,"reset",r=>{this.set(r,T7)}),this._store=t,this._treeState=n,this._changes=new Map}newTreeState_INTERNAL(){if(this._changes.size===0)return this._treeState;const t=N7(this._treeState);for(const[n,r]of this._changes)P7(t,n,$7(r));return O7(this._store,t),t}}function D7(e){return t=>{e.replaceState(n=>{const r=new I7(e,n);return t(r),r.newTreeState_INTERNAL()})}}var j7={atomicUpdater:D7},F7=j7.atomicUpdater,C$=Object.freeze({__proto__:null,atomicUpdater:F7});function U7(e,t){if(!e)throw new Error(t)}var V7=U7,yu=V7;const{atomicUpdater:z7}=C$,{batchUpdates:B7}=I0,{DEFAULT_VALUE:H7}=_n,{useStoreRef:W7}=Ai,{refreshRecoilValue:q7,setRecoilValue:ES}=Hr,{cloneSnapshot:G7}=U0,{gotoSnapshot:K7}=E$,{useCallback:Y7}=E;class A${}const Q7=new A$;function R$(e,t,n,r){let i=Q7,o;if(B7(()=>{const a="useRecoilCallback() expects a function that returns a function: it accepts a function of the type (RecoilInterface) => (Args) => ReturnType and returns a callback function (Args) => ReturnType, where RecoilInterface is an object {snapshot, set, ...} and Args and ReturnType are the argument and return types of the callback you want to create. Please see the docs at recoiljs.org for details.";if(typeof t!="function")throw Ae(a);const l=FR({...r??{},set:(c,d)=>ES(e,c,d),reset:c=>ES(e,c,H7),refresh:c=>q7(e,c),gotoSnapshot:c=>K7(e,c),transact_UNSTABLE:c=>z7(e)(c)},{snapshot:()=>{const c=G7(e);return o=c.retain(),c}}),u=t(l);if(typeof u!="function")throw Ae(a);i=u(...n)}),i instanceof A$&&yu(!1),Ke(i))i=i.finally(()=>{var a;(a=o)===null||a===void 0||a()});else{var s;(s=o)===null||s===void 0||s()}return i}function X7(e,t){const n=W7();return Y7((...r)=>R$(n.current,e,r),t!=null?[...t,n]:void 0)}var $$={recoilCallback:R$,useRecoilCallback:X7};const{useStoreRef:Z7}=Ai,{refreshRecoilValue:J7}=Hr,{useCallback:eU}=E;function tU(e){const t=Z7();return eU(()=>{const n=t.current;J7(n,e)},[e,t])}var nU=tU;const{atomicUpdater:rU}=C$,{useStoreRef:iU}=Ai,{useMemo:oU}=E;function sU(e,t){const n=iU();return oU(()=>(...r)=>{rU(n.current)(o=>{e(o)(...r)})},t!=null?[...t,n]:void 0)}var aU=sU;class lU{constructor(t){Ce(this,"value",void 0),this.value=t}}var uU={WrappedValue:lU},cU=uU.WrappedValue,k$=Object.freeze({__proto__:null,WrappedValue:cU});const{isFastRefreshEnabled:dU}=Bc;class CS extends Error{}class fU{constructor(t){var n,r,i;Ce(this,"_name",void 0),Ce(this,"_numLeafs",void 0),Ce(this,"_root",void 0),Ce(this,"_onHit",void 0),Ce(this,"_onSet",void 0),Ce(this,"_mapNodeValue",void 0),this._name=t==null?void 0:t.name,this._numLeafs=0,this._root=null,this._onHit=(n=t==null?void 0:t.onHit)!==null&&n!==void 0?n:()=>{},this._onSet=(r=t==null?void 0:t.onSet)!==null&&r!==void 0?r:()=>{},this._mapNodeValue=(i=t==null?void 0:t.mapNodeValue)!==null&&i!==void 0?i:o=>o}size(){return this._numLeafs}root(){return this._root}get(t,n){var r;return(r=this.getLeafNode(t,n))===null||r===void 0?void 0:r.value}getLeafNode(t,n){if(this._root==null)return;let r=this._root;for(;r;){if(n==null||n.onNodeVisit(r),r.type==="leaf")return this._onHit(r),r;const i=this._mapNodeValue(t(r.nodeKey));r=r.branches.get(i)}}set(t,n,r){const i=()=>{var o,s,a,l;let u,c;for(const[_,m]of t){var d,f,h;const p=this._root;if((p==null?void 0:p.type)==="leaf")throw this.invalidCacheError();const v=u;if(u=v?v.branches.get(c):p,u=(d=u)!==null&&d!==void 0?d:{type:"branch",nodeKey:_,parent:v,branches:new Map,branchKey:c},u.type!=="branch"||u.nodeKey!==_)throw this.invalidCacheError();v==null||v.branches.set(c,u),r==null||(f=r.onNodeVisit)===null||f===void 0||f.call(r,u),c=this._mapNodeValue(m),this._root=(h=this._root)!==null&&h!==void 0?h:u}const g=u?(o=u)===null||o===void 0?void 0:o.branches.get(c):this._root;if(g!=null&&(g.type!=="leaf"||g.branchKey!==c))throw this.invalidCacheError();const y={type:"leaf",value:n,parent:u,branchKey:c};(s=u)===null||s===void 0||s.branches.set(c,y),this._root=(a=this._root)!==null&&a!==void 0?a:y,this._numLeafs++,this._onSet(y),r==null||(l=r.onNodeVisit)===null||l===void 0||l.call(r,y)};try{i()}catch(o){if(o instanceof CS)this.clear(),i();else throw o}}delete(t){const n=this.root();if(!n)return!1;if(t===n)return this._root=null,this._numLeafs=0,!0;let r=t.parent,i=t.branchKey;for(;r;){var o;if(r.branches.delete(i),r===n)return r.branches.size===0?(this._root=null,this._numLeafs=0):this._numLeafs--,!0;if(r.branches.size>0)break;i=(o=r)===null||o===void 0?void 0:o.branchKey,r=r.parent}for(;r!==n;r=r.parent)if(r==null)return!1;return this._numLeafs--,!0}clear(){this._numLeafs=0,this._root=null}invalidCacheError(){const t=dU()?"Possible Fast Refresh module reload detected. This may also be caused by an selector returning inconsistent values. Resetting cache.":"Invalid cache values. This happens when selectors do not return consistent values for the same input dependency values. That may also be caused when using Fast Refresh to change a selector implementation. Resetting cache.";throw h2(t+(this._name!=null?` - ${this._name}`:"")),new CS}}var hU={TreeCache:fU},pU=hU.TreeCache,T$=Object.freeze({__proto__:null,TreeCache:pU});class gU{constructor(t){var n;Ce(this,"_maxSize",void 0),Ce(this,"_size",void 0),Ce(this,"_head",void 0),Ce(this,"_tail",void 0),Ce(this,"_map",void 0),Ce(this,"_keyMapper",void 0),this._maxSize=t.maxSize,this._size=0,this._head=null,this._tail=null,this._map=new Map,this._keyMapper=(n=t.mapKey)!==null&&n!==void 0?n:r=>r}head(){return this._head}tail(){return this._tail}size(){return this._size}maxSize(){return this._maxSize}has(t){return this._map.has(this._keyMapper(t))}get(t){const n=this._keyMapper(t),r=this._map.get(n);if(r)return this.set(t,r.value),r.value}set(t,n){const r=this._keyMapper(t);this._map.get(r)&&this.delete(t);const o=this.head(),s={key:t,right:o,left:null,value:n};o?o.left=s:this._tail=s,this._map.set(r,s),this._head=s,this._size++,this._maybeDeleteLRU()}_maybeDeleteLRU(){this.size()>this.maxSize()&&this.deleteLru()}deleteLru(){const t=this.tail();t&&this.delete(t.key)}delete(t){const n=this._keyMapper(t);if(!this._size||!this._map.has(n))return;const r=Je(this._map.get(n)),i=r.right,o=r.left;i&&(i.left=r.left),o&&(o.right=r.right),r===this.head()&&(this._head=i),r===this.tail()&&(this._tail=o),this._map.delete(n),this._size--}clear(){this._size=0,this._head=null,this._tail=null,this._map=new Map}}var mU={LRUCache:gU},yU=mU.LRUCache,M$=Object.freeze({__proto__:null,LRUCache:yU});const{LRUCache:vU}=M$,{TreeCache:_U}=T$;function xU({name:e,maxSize:t,mapNodeValue:n=r=>r}){const r=new vU({maxSize:t}),i=new _U({name:e,mapNodeValue:n,onHit:o=>{r.set(o,!0)},onSet:o=>{const s=r.tail();r.set(o,!0),s&&i.size()>t&&i.delete(s.key)}});return i}var AS=xU;function or(e,t,n){if(typeof e=="string"&&!e.includes('"')&&!e.includes("\\"))return`"${e}"`;switch(typeof e){case"undefined":return"";case"boolean":return e?"true":"false";case"number":case"symbol":return String(e);case"string":return JSON.stringify(e);case"function":if((t==null?void 0:t.allowFunctions)!==!0)throw Ae("Attempt to serialize function in a Recoil cache key");return`__FUNCTION(${e.name})__`}if(e===null)return"null";if(typeof e!="object"){var r;return(r=JSON.stringify(e))!==null&&r!==void 0?r:""}if(Ke(e))return"__PROMISE__";if(Array.isArray(e))return`[${e.map((i,o)=>or(i,t,o.toString()))}]`;if(typeof e.toJSON=="function")return or(e.toJSON(n),t,n);if(e instanceof Map){const i={};for(const[o,s]of e)i[typeof o=="string"?o:or(o,t)]=s;return or(i,t,n)}return e instanceof Set?or(Array.from(e).sort((i,o)=>or(i,t).localeCompare(or(o,t))),t,n):Symbol!==void 0&&e[Symbol.iterator]!=null&&typeof e[Symbol.iterator]=="function"?or(Array.from(e),t,n):`{${Object.keys(e).filter(i=>e[i]!==void 0).sort().map(i=>`${or(i,t)}:${or(e[i],t,i)}`).join(",")}}`}function SU(e,t={allowFunctions:!1}){return or(e,t)}var W0=SU;const{TreeCache:wU}=T$,Nd={equality:"reference",eviction:"keep-all",maxSize:1/0};function bU({equality:e=Nd.equality,eviction:t=Nd.eviction,maxSize:n=Nd.maxSize}=Nd,r){const i=EU(e);return CU(t,n,i,r)}function EU(e){switch(e){case"reference":return t=>t;case"value":return t=>W0(t)}throw Ae(`Unrecognized equality policy ${e}`)}function CU(e,t,n,r){switch(e){case"keep-all":return new wU({name:r,mapNodeValue:n});case"lru":return AS({name:r,maxSize:Je(t),mapNodeValue:n});case"most-recent":return AS({name:r,maxSize:1,mapNodeValue:n})}throw Ae(`Unrecognized eviction policy ${e}`)}var AU=bU;function RU(e){return()=>null}var $U={startPerfBlock:RU};const{isLoadable:kU,loadableWithError:Ld,loadableWithPromise:TU,loadableWithValue:yg}=zc,{WrappedValue:N$}=k$,{getNodeLoadable:Od,peekNodeLoadable:MU,setNodeValue:NU}=ko,{saveDepsToStore:LU}=Hc,{DEFAULT_VALUE:OU,getConfigDeletionHandler:PU,getNode:IU,registerNode:RS}=_n,{isRecoilValue:DU}=il,{markRecoilValueModified:$S}=Hr,{retainedByOptionWithDefault:jU}=Ts,{recoilCallback:FU}=$$,{startPerfBlock:UU}=$U;class L${}const Jl=new L$,eu=[],Pd=new Map,VU=(()=>{let e=0;return()=>e++})();function O$(e){let t=null;const{key:n,get:r,cachePolicy_UNSTABLE:i}=e,o=e.set!=null?e.set:void 0,s=new Set,a=AU(i??{equality:"reference",eviction:"keep-all"},n),l=jU(e.retainedBy_UNSTABLE),u=new Map;let c=0;function d(){return!Be("recoil_memory_managament_2020")||c>0}function f(N){return N.getState().knownSelectors.add(n),c++,()=>{c--}}function h(){return PU(n)!==void 0&&!d()}function g(N,B,G,ie,K){H(B,ie,K),y(N,G)}function y(N,B){D(N,B)&&T(N),m(B,!0)}function _(N,B){D(N,B)&&(Je(R(N)).stateVersions.clear(),m(B,!1))}function m(N,B){const G=Pd.get(N);if(G!=null){for(const ie of G)$S(ie,Je(t));B&&Pd.delete(N)}}function p(N,B){let G=Pd.get(B);G==null&&Pd.set(B,G=new Set),G.add(N)}function v(N,B,G,ie,K,pe){return B.then(ge=>{if(!d())throw T(N),Jl;const ue=yg(ge);return g(N,G,K,ue,ie),ge}).catch(ge=>{if(!d())throw T(N),Jl;if(Ke(ge))return x(N,ge,G,ie,K,pe);const ue=Ld(ge);throw g(N,G,K,ue,ie),ge})}function x(N,B,G,ie,K,pe){return B.then(ge=>{if(!d())throw T(N),Jl;pe.loadingDepKey!=null&&pe.loadingDepPromise===B?G.atomValues.set(pe.loadingDepKey,yg(ge)):N.getState().knownSelectors.forEach(we=>{G.atomValues.delete(we)});const ue=b(N,G);if(ue&&ue.state!=="loading"){if((D(N,K)||R(N)==null)&&y(N,K),ue.state==="hasValue")return ue.contents;throw ue.contents}if(!D(N,K)){const we=k(N,G);if(we!=null)return we.loadingLoadable.contents}const[$e,je]=w(N,G,K);if($e.state!=="loading"&&g(N,G,K,$e,je),$e.state==="hasError")throw $e.contents;return $e.contents}).catch(ge=>{if(ge instanceof L$)throw Jl;if(!d())throw T(N),Jl;const ue=Ld(ge);throw g(N,G,K,ue,ie),ge})}function S(N,B,G,ie){var K,pe,ge,ue;if(D(N,ie)||B.version===((K=N.getState())===null||K===void 0||(pe=K.currentTree)===null||pe===void 0?void 0:pe.version)||B.version===((ge=N.getState())===null||ge===void 0||(ue=ge.nextTree)===null||ue===void 0?void 0:ue.version)){var $e,je,we;LU(n,G,N,($e=(je=N.getState())===null||je===void 0||(we=je.nextTree)===null||we===void 0?void 0:we.version)!==null&&$e!==void 0?$e:N.getState().currentTree.version)}for(const Te of G)s.add(Te)}function w(N,B,G){const ie=UU(n);let K=!0,pe=!0;const ge=()=>{ie(),pe=!1};let ue,$e=!1,je;const we={loadingDepKey:null,loadingDepPromise:null},Te=new Map;function Ie({key:Et}){const mt=Od(N,B,Et);switch(Te.set(Et,mt),K||(S(N,B,new Set(Te.keys()),G),_(N,G)),mt.state){case"hasValue":return mt.contents;case"hasError":throw mt.contents;case"loading":throw we.loadingDepKey=Et,we.loadingDepPromise=mt.contents,mt.contents}throw Ae("Invalid Loadable state")}const Dn=Et=>(...mt)=>{if(pe)throw Ae("Callbacks from getCallback() should only be called asynchronously after the selector is evalutated. It can be used for selectors to return objects with callbacks that can work with Recoil state without a subscription.");return t==null&&yu(!1),FU(N,Et,mt,{node:t})};try{ue=r({get:Ie,getCallback:Dn}),ue=DU(ue)?Ie(ue):ue,kU(ue)&&(ue.state==="hasError"&&($e=!0),ue=ue.contents),Ke(ue)?ue=v(N,ue,B,Te,G,we).finally(ge):ge(),ue=ue instanceof N$?ue.value:ue}catch(Et){ue=Et,Ke(ue)?ue=x(N,ue,B,Te,G,we).finally(ge):($e=!0,ge())}return $e?je=Ld(ue):Ke(ue)?je=TU(ue):je=yg(ue),K=!1,$(N,G,Te),S(N,B,new Set(Te.keys()),G),[je,Te]}function b(N,B){let G=B.atomValues.get(n);if(G!=null)return G;const ie=new Set;try{G=a.get(pe=>(typeof pe!="string"&&yu(!1),Od(N,B,pe).contents),{onNodeVisit:pe=>{pe.type==="branch"&&pe.nodeKey!==n&&ie.add(pe.nodeKey)}})}catch(pe){throw Ae(`Problem with cache lookup for selector "${n}": ${pe.message}`)}if(G){var K;B.atomValues.set(n,G),S(N,B,ie,(K=R(N))===null||K===void 0?void 0:K.executionID)}return G}function A(N,B){const G=b(N,B);if(G!=null)return T(N),G;const ie=k(N,B);if(ie!=null){var K;return((K=ie.loadingLoadable)===null||K===void 0?void 0:K.state)==="loading"&&p(N,ie.executionID),ie.loadingLoadable}const pe=VU(),[ge,ue]=w(N,B,pe);return ge.state==="loading"?(M(N,pe,ge,ue,B),p(N,pe)):(T(N),H(B,ge,ue)),ge}function k(N,B){const G=n$([u.has(N)?[Je(u.get(N))]:[],N0(v2(u,([K])=>K!==N),([,K])=>K)]);function ie(K){for(const[pe,ge]of K)if(!Od(N,B,pe).is(ge))return!0;return!1}for(const K of G){if(K.stateVersions.get(B.version)||!ie(K.depValuesDiscoveredSoFarDuringAsyncWork))return K.stateVersions.set(B.version,!0),K;K.stateVersions.set(B.version,!1)}}function R(N){return u.get(N)}function M(N,B,G,ie,K){u.set(N,{depValuesDiscoveredSoFarDuringAsyncWork:ie,executionID:B,loadingLoadable:G,stateVersions:new Map([[K.version,!0]])})}function $(N,B,G){if(D(N,B)){const ie=R(N);ie!=null&&(ie.depValuesDiscoveredSoFarDuringAsyncWork=G)}}function T(N){u.delete(N)}function D(N,B){var G;return B===((G=R(N))===null||G===void 0?void 0:G.executionID)}function O(N){return Array.from(N.entries()).map(([B,G])=>[B,G.contents])}function H(N,B,G){N.atomValues.set(n,B);try{a.set(O(G),B)}catch(ie){throw Ae(`Problem with setting cache for selector "${n}": ${ie.message}`)}}function Q(N){if(eu.includes(n)){const B=`Recoil selector has circular dependencies: ${eu.slice(eu.indexOf(n)).join(" → ")}`;return Ld(Ae(B))}eu.push(n);try{return N()}finally{eu.pop()}}function V(N,B){const G=B.atomValues.get(n);return G??a.get(ie=>{var K;return typeof ie!="string"&&yu(!1),(K=MU(N,B,ie))===null||K===void 0?void 0:K.contents})}function W(N,B){return Q(()=>A(N,B))}function q(N){N.atomValues.delete(n)}function X(N,B){t==null&&yu(!1);for(const ie of s){var G;const K=IU(ie);(G=K.clearCache)===null||G===void 0||G.call(K,N,B)}s.clear(),q(B),a.clear(),$S(N,t)}return o!=null?t=RS({key:n,nodeType:"selector",peek:V,get:W,set:(B,G,ie)=>{let K=!1;const pe=new Map;function ge({key:we}){if(K)throw Ae("Recoil: Async selector sets are not currently supported.");const Te=Od(B,G,we);if(Te.state==="hasValue")return Te.contents;if(Te.state==="loading"){const Ie=`Getting value of asynchronous atom or selector "${we}" in a pending state while setting selector "${n}" is not yet supported.`;throw Ae(Ie)}else throw Te.contents}function ue(we,Te){if(K)throw Ae("Recoil: Async selector sets are not currently supported.");const Ie=typeof Te=="function"?Te(ge(we)):Te;NU(B,G,we.key,Ie).forEach((Et,mt)=>pe.set(mt,Et))}function $e(we){ue(we,OU)}const je=o({set:ue,get:ge,reset:$e},ie);if(je!==void 0)throw Ke(je)?Ae("Recoil: Async selector sets are not currently supported."):Ae("Recoil: selector set should be a void function.");return K=!0,pe},init:f,invalidate:q,clearCache:X,shouldDeleteConfigOnRelease:h,dangerouslyAllowMutability:e.dangerouslyAllowMutability,shouldRestoreFromSnapshots:!1,retainedBy:l}):t=RS({key:n,nodeType:"selector",peek:V,get:W,init:f,invalidate:q,clearCache:X,shouldDeleteConfigOnRelease:h,dangerouslyAllowMutability:e.dangerouslyAllowMutability,shouldRestoreFromSnapshots:!1,retainedBy:l})}O$.value=e=>new N$(e);var al=O$;const{isLoadable:zU,loadableWithError:vg,loadableWithPromise:_g,loadableWithValue:Hs}=zc,{WrappedValue:P$}=k$,{peekNodeInfo:BU}=ko,{DEFAULT_VALUE:Vo,DefaultValue:Ui,getConfigDeletionHandler:I$,registerNode:HU,setConfigDeletionHandler:WU}=_n,{isRecoilValue:qU}=il,{getRecoilValueAsLoadable:GU,markRecoilValueModified:KU,setRecoilValue:kS,setRecoilValueLoadable:YU}=Hr,{retainedByOptionWithDefault:QU}=Ts,tu=e=>e instanceof P$?e.value:e;function XU(e){const{key:t,persistence_UNSTABLE:n}=e,r=QU(e.retainedBy_UNSTABLE);let i=0;function o(p){return _g(p.then(v=>(s=Hs(v),v)).catch(v=>{throw s=vg(v),v}))}let s=Ke(e.default)?o(e.default):zU(e.default)?e.default.state==="loading"?o(e.default.contents):e.default:Hs(tu(e.default));s.contents;let a;const l=new Map;function u(p){return p}function c(p,v){const x=v.then(S=>{var w,b;return((b=((w=p.getState().nextTree)!==null&&w!==void 0?w:p.getState().currentTree).atomValues.get(t))===null||b===void 0?void 0:b.contents)===x&&kS(p,m,S),S}).catch(S=>{var w,b;throw((b=((w=p.getState().nextTree)!==null&&w!==void 0?w:p.getState().currentTree).atomValues.get(t))===null||b===void 0?void 0:b.contents)===x&&YU(p,m,vg(S)),S});return x}function d(p,v,x){var S;i++;const w=()=>{var R;i--,(R=l.get(p))===null||R===void 0||R.forEach(M=>M()),l.delete(p)};if(p.getState().knownAtoms.add(t),s.state==="loading"){const R=()=>{var M;((M=p.getState().nextTree)!==null&&M!==void 0?M:p.getState().currentTree).atomValues.has(t)||KU(p,m)};s.contents.finally(R)}const b=(S=e.effects)!==null&&S!==void 0?S:e.effects_UNSTABLE;if(b!=null){let R=function(q){if(D&&q.key===t){const X=T;return X instanceof Ui?f(p,v):Ke(X)?_g(X.then(N=>N instanceof Ui?s.toPromise():N)):Hs(X)}return GU(p,q)},M=function(q){return R(q).toPromise()},$=function(q){var X;const N=BU(p,(X=p.getState().nextTree)!==null&&X!==void 0?X:p.getState().currentTree,q.key);return D&&q.key===t&&!(T instanceof Ui)?{...N,isSet:!0,loadable:R(q)}:N},T=Vo,D=!0,O=!1,H=null;const Q=q=>X=>{if(D){const N=R(m),B=N.state==="hasValue"?N.contents:Vo;T=typeof X=="function"?X(B):X,Ke(T)&&(T=T.then(G=>(H={effect:q,value:G},G)))}else{if(Ke(X))throw Ae("Setting atoms to async values is not implemented.");typeof X!="function"&&(H={effect:q,value:tu(X)}),kS(p,m,typeof X=="function"?N=>{const B=tu(X(N));return H={effect:q,value:B},B}:tu(X))}},V=q=>()=>Q(q)(Vo),W=q=>X=>{var N;const{release:B}=p.subscribeToTransactions(G=>{var ie;let{currentTree:K,previousTree:pe}=G.getState();pe||(pe=K);const ge=(ie=K.atomValues.get(t))!==null&&ie!==void 0?ie:s;if(ge.state==="hasValue"){var ue,$e,je,we;const Te=ge.contents,Ie=(ue=pe.atomValues.get(t))!==null&&ue!==void 0?ue:s,Dn=Ie.state==="hasValue"?Ie.contents:Vo;(($e=H)===null||$e===void 0?void 0:$e.effect)!==q||((je=H)===null||je===void 0?void 0:je.value)!==Te?X(Te,Dn,!K.atomValues.has(t)):((we=H)===null||we===void 0?void 0:we.effect)===q&&(H=null)}},t);l.set(p,[...(N=l.get(p))!==null&&N!==void 0?N:[],B])};for(const q of b)try{const X=q({node:m,storeID:p.storeID,parentStoreID_UNSTABLE:p.parentStoreID,trigger:x,setSelf:Q(q),resetSelf:V(q),onSet:W(q),getPromise:M,getLoadable:R,getInfo_UNSTABLE:$});if(X!=null){var A;l.set(p,[...(A=l.get(p))!==null&&A!==void 0?A:[],X])}}catch(X){T=X,O=!0}if(D=!1,!(T instanceof Ui)){var k;const q=O?vg(T):Ke(T)?_g(c(p,T)):Hs(tu(T));q.contents,v.atomValues.set(t,q),(k=p.getState().nextTree)===null||k===void 0||k.atomValues.set(t,q)}}return w}function f(p,v){var x,S;return(x=(S=v.atomValues.get(t))!==null&&S!==void 0?S:a)!==null&&x!==void 0?x:s}function h(p,v){if(v.atomValues.has(t))return Je(v.atomValues.get(t));if(v.nonvalidatedAtoms.has(t)){if(a!=null)return a;if(n==null)return s;const x=v.nonvalidatedAtoms.get(t),S=n.validator(x,Vo);return a=S instanceof Ui?s:Hs(S),a}else return s}function g(){a=void 0}function y(p,v,x){if(v.atomValues.has(t)){const S=Je(v.atomValues.get(t));if(S.state==="hasValue"&&x===S.contents)return new Map}else if(!v.nonvalidatedAtoms.has(t)&&x instanceof Ui)return new Map;return a=void 0,new Map().set(t,Hs(x))}function _(){return I$(t)!==void 0&&i<=0}const m=HU({key:t,nodeType:"atom",peek:f,get:h,set:y,init:d,invalidate:g,shouldDeleteConfigOnRelease:_,dangerouslyAllowMutability:e.dangerouslyAllowMutability,persistence_UNSTABLE:e.persistence_UNSTABLE?{type:e.persistence_UNSTABLE.type,backButton:e.persistence_UNSTABLE.backButton}:void 0,shouldRestoreFromSnapshots:!0,retainedBy:r});return m}function $2(e){const{...t}=e,n="default"in e?e.default:new Promise(()=>{});return qU(n)?ZU({...t,default:n}):XU({...t,default:n})}function ZU(e){const t=$2({...e,default:Vo,persistence_UNSTABLE:e.persistence_UNSTABLE===void 0?void 0:{...e.persistence_UNSTABLE,validator:r=>r instanceof Ui?r:Je(e.persistence_UNSTABLE).validator(r,Vo)},effects:e.effects,effects_UNSTABLE:e.effects_UNSTABLE}),n=al({key:`${e.key}__withFallback`,get:({get:r})=>{const i=r(t);return i instanceof Ui?e.default:i},set:({set:r},i)=>r(t,i),cachePolicy_UNSTABLE:{eviction:"most-recent"},dangerouslyAllowMutability:e.dangerouslyAllowMutability});return WU(n.key,I$(e.key)),n}$2.value=e=>new P$(e);var D$=$2;class JU{constructor(t){var n;Ce(this,"_map",void 0),Ce(this,"_keyMapper",void 0),this._map=new Map,this._keyMapper=(n=t==null?void 0:t.mapKey)!==null&&n!==void 0?n:r=>r}size(){return this._map.size}has(t){return this._map.has(this._keyMapper(t))}get(t){return this._map.get(this._keyMapper(t))}set(t,n){this._map.set(this._keyMapper(t),n)}delete(t){this._map.delete(this._keyMapper(t))}clear(){this._map.clear()}}var eV={MapCache:JU},tV=eV.MapCache,nV=Object.freeze({__proto__:null,MapCache:tV});const{LRUCache:TS}=M$,{MapCache:rV}=nV,Id={equality:"reference",eviction:"none",maxSize:1/0};function iV({equality:e=Id.equality,eviction:t=Id.eviction,maxSize:n=Id.maxSize}=Id){const r=oV(e);return sV(t,n,r)}function oV(e){switch(e){case"reference":return t=>t;case"value":return t=>W0(t)}throw Ae(`Unrecognized equality policy ${e}`)}function sV(e,t,n){switch(e){case"keep-all":return new rV({mapKey:n});case"lru":return new TS({mapKey:n,maxSize:Je(t)});case"most-recent":return new TS({mapKey:n,maxSize:1})}throw Ae(`Unrecognized eviction policy ${e}`)}var j$=iV;const{setConfigDeletionHandler:aV}=_n;function lV(e){var t,n;const r=j$({equality:(t=(n=e.cachePolicyForParams_UNSTABLE)===null||n===void 0?void 0:n.equality)!==null&&t!==void 0?t:"value",eviction:"keep-all"});return i=>{var o,s;const a=r.get(i);if(a!=null)return a;const{cachePolicyForParams_UNSTABLE:l,...u}=e,c="default"in e?e.default:new Promise(()=>{}),d=D$({...u,key:`${e.key}__${(o=W0(i))!==null&&o!==void 0?o:"void"}`,default:typeof c=="function"?c(i):c,retainedBy_UNSTABLE:typeof e.retainedBy_UNSTABLE=="function"?e.retainedBy_UNSTABLE(i):e.retainedBy_UNSTABLE,effects:typeof e.effects=="function"?e.effects(i):typeof e.effects_UNSTABLE=="function"?e.effects_UNSTABLE(i):(s=e.effects)!==null&&s!==void 0?s:e.effects_UNSTABLE});return r.set(i,d),aV(d.key,()=>{r.delete(i)}),d}}var uV=lV;const{setConfigDeletionHandler:cV}=_n;let dV=0;function fV(e){var t,n;const r=j$({equality:(t=(n=e.cachePolicyForParams_UNSTABLE)===null||n===void 0?void 0:n.equality)!==null&&t!==void 0?t:"value",eviction:"keep-all"});return i=>{var o;let s;try{s=r.get(i)}catch(f){throw Ae(`Problem with cache lookup for selector ${e.key}: ${f.message}`)}if(s!=null)return s;const a=`${e.key}__selectorFamily/${(o=W0(i,{allowFunctions:!0}))!==null&&o!==void 0?o:"void"}/${dV++}`,l=f=>e.get(i)(f),u=e.cachePolicy_UNSTABLE,c=typeof e.retainedBy_UNSTABLE=="function"?e.retainedBy_UNSTABLE(i):e.retainedBy_UNSTABLE;let d;if(e.set!=null){const f=e.set;d=al({key:a,get:l,set:(g,y)=>f(i)(g,y),cachePolicy_UNSTABLE:u,dangerouslyAllowMutability:e.dangerouslyAllowMutability,retainedBy_UNSTABLE:c})}else d=al({key:a,get:l,cachePolicy_UNSTABLE:u,dangerouslyAllowMutability:e.dangerouslyAllowMutability,retainedBy_UNSTABLE:c});return r.set(i,d),cV(d.key,()=>{r.delete(i)}),d}}var To=fV;const hV=To({key:"__constant",get:e=>()=>e,cachePolicyForParams_UNSTABLE:{equality:"reference"}});function pV(e){return hV(e)}var gV=pV;const mV=To({key:"__error",get:e=>()=>{throw Ae(e)},cachePolicyForParams_UNSTABLE:{equality:"reference"}});function yV(e){return mV(e)}var vV=yV;function _V(e){return e}var xV=_V;const{loadableWithError:F$,loadableWithPromise:U$,loadableWithValue:V$}=zc;function q0(e,t){const n=Array(t.length).fill(void 0),r=Array(t.length).fill(void 0);for(const[i,o]of t.entries())try{n[i]=e(o)}catch(s){r[i]=s}return[n,r]}function SV(e){return e!=null&&!Ke(e)}function G0(e){return Array.isArray(e)?e:Object.getOwnPropertyNames(e).map(t=>e[t])}function Dy(e,t){return Array.isArray(e)?t:Object.getOwnPropertyNames(e).reduce((n,r,i)=>({...n,[r]:t[i]}),{})}function Aa(e,t,n){const r=n.map((i,o)=>i==null?V$(t[o]):Ke(i)?U$(i):F$(i));return Dy(e,r)}function wV(e,t){return t.map((n,r)=>n===void 0?e[r]:n)}const bV=To({key:"__waitForNone",get:e=>({get:t})=>{const n=G0(e),[r,i]=q0(t,n);return Aa(e,r,i)},dangerouslyAllowMutability:!0}),EV=To({key:"__waitForAny",get:e=>({get:t})=>{const n=G0(e),[r,i]=q0(t,n);return i.some(o=>!Ke(o))?Aa(e,r,i):new Promise(o=>{for(const[s,a]of i.entries())Ke(a)&&a.then(l=>{r[s]=l,i[s]=void 0,o(Aa(e,r,i))}).catch(l=>{i[s]=l,o(Aa(e,r,i))})})},dangerouslyAllowMutability:!0}),CV=To({key:"__waitForAll",get:e=>({get:t})=>{const n=G0(e),[r,i]=q0(t,n);if(i.every(s=>s==null))return Dy(e,r);const o=i.find(SV);if(o!=null)throw o;return Promise.all(i).then(s=>Dy(e,wV(r,s)))},dangerouslyAllowMutability:!0}),AV=To({key:"__waitForAllSettled",get:e=>({get:t})=>{const n=G0(e),[r,i]=q0(t,n);return i.every(o=>!Ke(o))?Aa(e,r,i):Promise.all(i.map((o,s)=>Ke(o)?o.then(a=>{r[s]=a,i[s]=void 0}).catch(a=>{r[s]=void 0,i[s]=a}):null)).then(()=>Aa(e,r,i))},dangerouslyAllowMutability:!0}),RV=To({key:"__noWait",get:e=>({get:t})=>{try{return al.value(V$(t(e)))}catch(n){return al.value(Ke(n)?U$(n):F$(n))}},dangerouslyAllowMutability:!0});var $V={waitForNone:bV,waitForAny:EV,waitForAll:CV,waitForAllSettled:AV,noWait:RV};const{RecoilLoadable:kV}=zc,{DefaultValue:TV}=_n,{RecoilRoot:MV,useRecoilStoreID:NV}=Ai,{isRecoilValue:LV}=il,{retentionZone:OV}=O0,{freshSnapshot:PV}=U0,{useRecoilState:IV,useRecoilState_TRANSITION_SUPPORT_UNSTABLE:DV,useRecoilStateLoadable:jV,useRecoilValue:FV,useRecoilValue_TRANSITION_SUPPORT_UNSTABLE:UV,useRecoilValueLoadable:VV,useRecoilValueLoadable_TRANSITION_SUPPORT_UNSTABLE:zV,useResetRecoilState:BV,useSetRecoilState:HV}=e7,{useGotoRecoilSnapshot:WV,useRecoilSnapshot:qV,useRecoilTransactionObserver:GV}=E$,{useRecoilCallback:KV}=$$,{noWait:YV,waitForAll:QV,waitForAllSettled:XV,waitForAny:ZV,waitForNone:JV}=$V;var k2={DefaultValue:TV,isRecoilValue:LV,RecoilLoadable:kV,RecoilEnv:bl,RecoilRoot:MV,useRecoilStoreID:NV,useRecoilBridgeAcrossReactRoots_UNSTABLE:R7,atom:D$,selector:al,atomFamily:uV,selectorFamily:To,constSelector:gV,errorSelector:vV,readOnlySelector:xV,noWait:YV,waitForNone:JV,waitForAny:ZV,waitForAll:QV,waitForAllSettled:XV,useRecoilValue:FV,useRecoilValueLoadable:VV,useRecoilState:IV,useRecoilStateLoadable:jV,useSetRecoilState:HV,useResetRecoilState:BV,useGetRecoilValueInfo_UNSTABLE:S7,useRecoilRefresher_UNSTABLE:nU,useRecoilValueLoadable_TRANSITION_SUPPORT_UNSTABLE:zV,useRecoilValue_TRANSITION_SUPPORT_UNSTABLE:UV,useRecoilState_TRANSITION_SUPPORT_UNSTABLE:DV,useRecoilCallback:KV,useRecoilTransaction_UNSTABLE:aU,useGotoRecoilSnapshot:WV,useRecoilSnapshot:qV,useRecoilTransactionObserver_UNSTABLE:GV,snapshot_UNSTABLE:PV,useRetain:b2,retentionZone:OV},ez=k2.RecoilRoot,z$=k2.atom,MS=k2.useRecoilState,Kc=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ll=typeof window>"u"||"Deno"in globalThis;function zn(){}function tz(e,t){return typeof e=="function"?e(t):e}function jy(e){return typeof e=="number"&&e>=0&&e!==1/0}function B$(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ra(e,t){return typeof e=="function"?e(t):e}function dr(e,t){return typeof e=="function"?e(t):e}function NS(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==T2(s,t.options))return!1}else if(!fc(t.queryKey,s))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||i&&i!==t.state.fetchStatus||o&&!o(t))}function LS(e,t){const{exact:n,status:r,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(dc(t.options.mutationKey)!==dc(o))return!1}else if(!fc(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function T2(e,t){return((t==null?void 0:t.queryKeyHashFn)||dc)(e)}function dc(e){return JSON.stringify(e,(t,n)=>Uy(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function fc(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!fc(e[n],t[n])):!1}function H$(e,t){if(e===t)return e;const n=OS(e)&&OS(t);if(n||Uy(e)&&Uy(t)){const r=n?e:Object.keys(e),i=r.length,o=n?t:Object.keys(t),s=o.length,a=n?[]:{};let l=0;for(let u=0;u{setTimeout(t,e)})}function Vy(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?H$(e,t):t}function rz(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function iz(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var W$=Symbol();function q$(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===W$?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Zo,Ki,Pa,LE,oz=(LE=class extends Kc{constructor(){super();Se(this,Zo);Se(this,Ki);Se(this,Pa);he(this,Pa,t=>{if(!ll&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){P(this,Ki)||this.setEventListener(P(this,Pa))}onUnsubscribe(){var t;this.hasListeners()||((t=P(this,Ki))==null||t.call(this),he(this,Ki,void 0))}setEventListener(t){var n;he(this,Pa,t),(n=P(this,Ki))==null||n.call(this),he(this,Ki,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){P(this,Zo)!==t&&(he(this,Zo,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof P(this,Zo)=="boolean"?P(this,Zo):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Zo=new WeakMap,Ki=new WeakMap,Pa=new WeakMap,LE),M2=new oz,Ia,Yi,Da,OE,sz=(OE=class extends Kc{constructor(){super();Se(this,Ia,!0);Se(this,Yi);Se(this,Da);he(this,Da,t=>{if(!ll&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){P(this,Yi)||this.setEventListener(P(this,Da))}onUnsubscribe(){var t;this.hasListeners()||((t=P(this,Yi))==null||t.call(this),he(this,Yi,void 0))}setEventListener(t){var n;he(this,Da,t),(n=P(this,Yi))==null||n.call(this),he(this,Yi,t(this.setOnline.bind(this)))}setOnline(t){P(this,Ia)!==t&&(he(this,Ia,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return P(this,Ia)}},Ia=new WeakMap,Yi=new WeakMap,Da=new WeakMap,OE),ph=new sz;function az(e){return Math.min(1e3*2**e,3e4)}function G$(e){return(e??"online")==="online"?ph.isOnline():!0}var K$=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function xg(e){return e instanceof K$}function Y$(e){let t=!1,n=0,r=!1,i,o,s;const a=new Promise((m,p)=>{o=m,s=p}),l=m=>{var p;r||(g(new K$(m)),(p=e.abort)==null||p.call(e))},u=()=>{t=!0},c=()=>{t=!1},d=()=>M2.isFocused()&&(e.networkMode==="always"||ph.isOnline())&&e.canRun(),f=()=>G$(e.networkMode)&&e.canRun(),h=m=>{var p;r||(r=!0,(p=e.onSuccess)==null||p.call(e,m),i==null||i(),o(m))},g=m=>{var p;r||(r=!0,(p=e.onError)==null||p.call(e,m),i==null||i(),s(m))},y=()=>new Promise(m=>{var p;i=v=>{(r||d())&&m(v)},(p=e.onPause)==null||p.call(e)}).then(()=>{var m;i=void 0,r||(m=e.onContinue)==null||m.call(e)}),_=()=>{if(r)return;let m;const p=n===0?e.initialPromise:void 0;try{m=p??e.fn()}catch(v){m=Promise.reject(v)}Promise.resolve(m).then(h).catch(v=>{var A;if(r)return;const x=e.retry??(ll?0:3),S=e.retryDelay??az,w=typeof S=="function"?S(n,v):S,b=x===!0||typeof x=="number"&&nd()?void 0:y()).then(()=>{t?g(v):_()})})};return{promise:a,cancel:l,continue:()=>(i==null||i(),a),cancelRetry:u,continueRetry:c,canStart:f,start:()=>(f()?_():y().then(_),a)}}function lz(){let e=[],t=0,n=f=>{f()},r=f=>{f()},i=f=>setTimeout(f,0);const o=f=>{i=f},s=f=>{let h;t++;try{h=f()}finally{t--,t||u()}return h},a=f=>{t?e.push(f):i(()=>{n(f)})},l=f=>(...h)=>{a(()=>{f(...h)})},u=()=>{const f=e;e=[],f.length&&i(()=>{r(()=>{f.forEach(h=>{n(h)})})})};return{batch:s,batchCalls:l,schedule:a,setNotifyFunction:f=>{n=f},setBatchNotifyFunction:f=>{r=f},setScheduler:o}}var Lt=lz(),Jo,PE,Q$=(PE=class{constructor(){Se(this,Jo)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),jy(this.gcTime)&&he(this,Jo,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ll?1/0:5*60*1e3))}clearGcTimeout(){P(this,Jo)&&(clearTimeout(P(this,Jo)),he(this,Jo,void 0))}},Jo=new WeakMap,PE),ja,Fa,Vn,Vt,Mc,es,ar,Xr,IE,uz=(IE=class extends Q${constructor(t){super();Se(this,ar);Se(this,ja);Se(this,Fa);Se(this,Vn);Se(this,Vt);Se(this,Mc);Se(this,es);he(this,es,!1),he(this,Mc,t.defaultOptions),this.setOptions(t.options),this.observers=[],he(this,Vn,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,he(this,ja,cz(this.options)),this.state=t.state??P(this,ja),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=P(this,Vt))==null?void 0:t.promise}setOptions(t){this.options={...P(this,Mc),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&P(this,Vn).remove(this)}setData(t,n){const r=Vy(this.state.data,t,this.options);return Me(this,ar,Xr).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Me(this,ar,Xr).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=P(this,Vt))==null?void 0:r.promise;return(i=P(this,Vt))==null||i.cancel(t),n?n.then(zn).catch(zn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(P(this,ja))}isActive(){return this.observers.some(t=>dr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!B$(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=P(this,Vt))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=P(this,Vt))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),P(this,Vn).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(P(this,Vt)&&(P(this,es)?P(this,Vt).cancel({revert:!0}):P(this,Vt).cancelRetry()),this.scheduleGc()),P(this,Vn).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Me(this,ar,Xr).call(this,{type:"invalidate"})}fetch(t,n){var l,u,c;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(P(this,Vt))return P(this,Vt).continueRetry(),P(this,Vt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const d=this.observers.find(f=>f.options.queryFn);d&&this.setOptions(d.options)}const r=new AbortController,i=d=>{Object.defineProperty(d,"signal",{enumerable:!0,get:()=>(he(this,es,!0),r.signal)})},o=()=>{const d=q$(this.options,n),f={queryKey:this.queryKey,meta:this.meta};return i(f),he(this,es,!1),this.options.persister?this.options.persister(d,f,this):d(f)},s={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:o};i(s),(l=this.options.behavior)==null||l.onFetch(s,this),he(this,Fa,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=s.fetchOptions)==null?void 0:u.meta))&&Me(this,ar,Xr).call(this,{type:"fetch",meta:(c=s.fetchOptions)==null?void 0:c.meta});const a=d=>{var f,h,g,y;xg(d)&&d.silent||Me(this,ar,Xr).call(this,{type:"error",error:d}),xg(d)||((h=(f=P(this,Vn).config).onError)==null||h.call(f,d,this),(y=(g=P(this,Vn).config).onSettled)==null||y.call(g,this.state.data,d,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return he(this,Vt,Y$({initialPromise:n==null?void 0:n.initialPromise,fn:s.fetchFn,abort:r.abort.bind(r),onSuccess:d=>{var f,h,g,y;if(d===void 0){a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(d)}catch(_){a(_);return}(h=(f=P(this,Vn).config).onSuccess)==null||h.call(f,d,this),(y=(g=P(this,Vn).config).onSettled)==null||y.call(g,d,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:a,onFail:(d,f)=>{Me(this,ar,Xr).call(this,{type:"failed",failureCount:d,error:f})},onPause:()=>{Me(this,ar,Xr).call(this,{type:"pause"})},onContinue:()=>{Me(this,ar,Xr).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0})),P(this,Vt).start()}},ja=new WeakMap,Fa=new WeakMap,Vn=new WeakMap,Vt=new WeakMap,Mc=new WeakMap,es=new WeakMap,ar=new WeakSet,Xr=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...X$(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=t.error;return xg(i)&&i.revert&&P(this,Fa)?{...P(this,Fa),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Lt.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),P(this,Vn).notify({query:this,type:"updated",action:t})})},IE);function X$(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:G$(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function cz(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Rr,DE,dz=(DE=class extends Kc{constructor(t={}){super();Se(this,Rr);this.config=t,he(this,Rr,new Map)}build(t,n,r){const i=n.queryKey,o=n.queryHash??T2(i,n);let s=this.get(o);return s||(s=new uz({cache:this,queryKey:i,queryHash:o,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(s)),s}add(t){P(this,Rr).has(t.queryHash)||(P(this,Rr).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=P(this,Rr).get(t.queryHash);n&&(t.destroy(),n===t&&P(this,Rr).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Lt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return P(this,Rr).get(t)}getAll(){return[...P(this,Rr).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>NS(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>NS(t,r)):n}notify(t){Lt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Lt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Lt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Rr=new WeakMap,DE),$r,qt,ts,kr,Oi,jE,fz=(jE=class extends Q${constructor(t){super();Se(this,kr);Se(this,$r);Se(this,qt);Se(this,ts);this.mutationId=t.mutationId,he(this,qt,t.mutationCache),he(this,$r,[]),this.state=t.state||hz(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){P(this,$r).includes(t)||(P(this,$r).push(t),this.clearGcTimeout(),P(this,qt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){he(this,$r,P(this,$r).filter(n=>n!==t)),this.scheduleGc(),P(this,qt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){P(this,$r).length||(this.state.status==="pending"?this.scheduleGc():P(this,qt).remove(this))}continue(){var t;return((t=P(this,ts))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,o,s,a,l,u,c,d,f,h,g,y,_,m,p,v,x,S,w,b;he(this,ts,Y$({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(A,k)=>{Me(this,kr,Oi).call(this,{type:"failed",failureCount:A,error:k})},onPause:()=>{Me(this,kr,Oi).call(this,{type:"pause"})},onContinue:()=>{Me(this,kr,Oi).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>P(this,qt).canRun(this)}));const n=this.state.status==="pending",r=!P(this,ts).canStart();try{if(!n){Me(this,kr,Oi).call(this,{type:"pending",variables:t,isPaused:r}),await((o=(i=P(this,qt).config).onMutate)==null?void 0:o.call(i,t,this));const k=await((a=(s=this.options).onMutate)==null?void 0:a.call(s,t));k!==this.state.context&&Me(this,kr,Oi).call(this,{type:"pending",context:k,variables:t,isPaused:r})}const A=await P(this,ts).start();return await((u=(l=P(this,qt).config).onSuccess)==null?void 0:u.call(l,A,t,this.state.context,this)),await((d=(c=this.options).onSuccess)==null?void 0:d.call(c,A,t,this.state.context)),await((h=(f=P(this,qt).config).onSettled)==null?void 0:h.call(f,A,null,this.state.variables,this.state.context,this)),await((y=(g=this.options).onSettled)==null?void 0:y.call(g,A,null,t,this.state.context)),Me(this,kr,Oi).call(this,{type:"success",data:A}),A}catch(A){try{throw await((m=(_=P(this,qt).config).onError)==null?void 0:m.call(_,A,t,this.state.context,this)),await((v=(p=this.options).onError)==null?void 0:v.call(p,A,t,this.state.context)),await((S=(x=P(this,qt).config).onSettled)==null?void 0:S.call(x,void 0,A,this.state.variables,this.state.context,this)),await((b=(w=this.options).onSettled)==null?void 0:b.call(w,void 0,A,t,this.state.context)),A}finally{Me(this,kr,Oi).call(this,{type:"error",error:A})}}finally{P(this,qt).runNext(this)}}},$r=new WeakMap,qt=new WeakMap,ts=new WeakMap,kr=new WeakSet,Oi=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Lt.batch(()=>{P(this,$r).forEach(r=>{r.onMutationUpdate(t)}),P(this,qt).notify({mutation:this,type:"updated",action:t})})},jE);function hz(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Cn,Nc,FE,pz=(FE=class extends Kc{constructor(t={}){super();Se(this,Cn);Se(this,Nc);this.config=t,he(this,Cn,new Map),he(this,Nc,Date.now())}build(t,n,r){const i=new fz({mutationCache:this,mutationId:++pd(this,Nc)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){const n=Dd(t),r=P(this,Cn).get(n)??[];r.push(t),P(this,Cn).set(n,r),this.notify({type:"added",mutation:t})}remove(t){var r;const n=Dd(t);if(P(this,Cn).has(n)){const i=(r=P(this,Cn).get(n))==null?void 0:r.filter(o=>o!==t);i&&(i.length===0?P(this,Cn).delete(n):P(this,Cn).set(n,i))}this.notify({type:"removed",mutation:t})}canRun(t){var r;const n=(r=P(this,Cn).get(Dd(t)))==null?void 0:r.find(i=>i.state.status==="pending");return!n||n===t}runNext(t){var r;const n=(r=P(this,Cn).get(Dd(t)))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}clear(){Lt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}getAll(){return[...P(this,Cn).values()].flat()}find(t){const n={exact:!0,...t};return this.getAll().find(r=>LS(n,r))}findAll(t={}){return this.getAll().filter(n=>LS(t,n))}notify(t){Lt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Lt.batch(()=>Promise.all(t.map(n=>n.continue().catch(zn))))}},Cn=new WeakMap,Nc=new WeakMap,FE);function Dd(e){var t;return((t=e.options.scope)==null?void 0:t.id)??String(e.mutationId)}function gz(e){return{onFetch:(t,n)=>{const r=async()=>{var g,y,_,m,p;const i=t.options,o=(_=(y=(g=t.fetchOptions)==null?void 0:g.meta)==null?void 0:y.fetchMore)==null?void 0:_.direction,s=((m=t.state.data)==null?void 0:m.pages)||[],a=((p=t.state.data)==null?void 0:p.pageParams)||[],l={pages:[],pageParams:[]};let u=!1;const c=v=>{Object.defineProperty(v,"signal",{enumerable:!0,get:()=>(t.signal.aborted?u=!0:t.signal.addEventListener("abort",()=>{u=!0}),t.signal)})},d=q$(t.options,t.fetchOptions),f=async(v,x,S)=>{if(u)return Promise.reject();if(x==null&&v.pages.length)return Promise.resolve(v);const w={queryKey:t.queryKey,pageParam:x,direction:S?"backward":"forward",meta:t.options.meta};c(w);const b=await d(w),{maxPages:A}=t.options,k=S?iz:rz;return{pages:k(v.pages,b,A),pageParams:k(v.pageParams,x,A)}};let h;if(o&&s.length){const v=o==="backward",x=v?mz:IS,S={pages:s,pageParams:a},w=x(i,S);h=await f(S,w,v)}else{h=await f(l,a[0]??i.initialPageParam);const v=e??s.length;for(let x=1;x{var i,o;return(o=(i=t.options).persister)==null?void 0:o.call(i,r,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=r}}}function IS(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function mz(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var it,Qi,Xi,Ua,Va,Zi,za,Ba,UE,yz=(UE=class{constructor(e={}){Se(this,it);Se(this,Qi);Se(this,Xi);Se(this,Ua);Se(this,Va);Se(this,Zi);Se(this,za);Se(this,Ba);he(this,it,e.queryCache||new dz),he(this,Qi,e.mutationCache||new pz),he(this,Xi,e.defaultOptions||{}),he(this,Ua,new Map),he(this,Va,new Map),he(this,Zi,0)}mount(){pd(this,Zi)._++,P(this,Zi)===1&&(he(this,za,M2.subscribe(async e=>{e&&(await this.resumePausedMutations(),P(this,it).onFocus())})),he(this,Ba,ph.subscribe(async e=>{e&&(await this.resumePausedMutations(),P(this,it).onOnline())})))}unmount(){var e,t;pd(this,Zi)._--,P(this,Zi)===0&&((e=P(this,za))==null||e.call(this),he(this,za,void 0),(t=P(this,Ba))==null||t.call(this),he(this,Ba,void 0))}isFetching(e){return P(this,it).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return P(this,Qi).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=P(this,it).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);if(t===void 0)return this.fetchQuery(e);{const n=this.defaultQueryOptions(e),r=P(this,it).build(this,n);return e.revalidateIfStale&&r.isStaleByTime(Ra(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(t)}}getQueriesData(e){return P(this,it).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=P(this,it).get(r.queryHash),o=i==null?void 0:i.state.data,s=tz(t,o);if(s!==void 0)return P(this,it).build(this,r).setData(s,{...n,manual:!0})}setQueriesData(e,t,n){return Lt.batch(()=>P(this,it).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=P(this,it).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=P(this,it);Lt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=P(this,it),r={type:"active",...e};return Lt.batch(()=>(n.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=Lt.batch(()=>P(this,it).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(zn).catch(zn)}invalidateQueries(e={},t={}){return Lt.batch(()=>{if(P(this,it).findAll(e).forEach(r=>{r.invalidate()}),e.refetchType==="none")return Promise.resolve();const n={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e={},t){const n={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},r=Lt.batch(()=>P(this,it).findAll(e).filter(i=>!i.isDisabled()).map(i=>{let o=i.fetch(void 0,n);return n.throwOnError||(o=o.catch(zn)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(zn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=P(this,it).build(this,t);return n.isStaleByTime(Ra(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(zn).catch(zn)}fetchInfiniteQuery(e){return e.behavior=gz(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(zn).catch(zn)}resumePausedMutations(){return ph.isOnline()?P(this,Qi).resumePausedMutations():Promise.resolve()}getQueryCache(){return P(this,it)}getMutationCache(){return P(this,Qi)}getDefaultOptions(){return P(this,Xi)}setDefaultOptions(e){he(this,Xi,e)}setQueryDefaults(e,t){P(this,Ua).set(dc(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...P(this,Ua).values()];let n={};return t.forEach(r=>{fc(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){P(this,Va).set(dc(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...P(this,Va).values()];let n={};return t.forEach(r=>{fc(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...P(this,Xi).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=T2(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.enabled!==!0&&t.queryFn===W$&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...P(this,Xi).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){P(this,it).clear(),P(this,Qi).clear()}},it=new WeakMap,Qi=new WeakMap,Xi=new WeakMap,Ua=new WeakMap,Va=new WeakMap,Zi=new WeakMap,za=new WeakMap,Ba=new WeakMap,UE),an,Ne,Lc,Gt,ns,Ha,Tr,Oc,Wa,qa,rs,is,Ji,Ga,Fe,vu,zy,By,Hy,Wy,qy,Gy,Ky,Z$,VE,vz=(VE=class extends Kc{constructor(t,n){super();Se(this,Fe);Se(this,an);Se(this,Ne);Se(this,Lc);Se(this,Gt);Se(this,ns);Se(this,Ha);Se(this,Tr);Se(this,Oc);Se(this,Wa);Se(this,qa);Se(this,rs);Se(this,is);Se(this,Ji);Se(this,Ga,new Set);this.options=n,he(this,an,t),he(this,Tr,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(P(this,Ne).addObserver(this),DS(P(this,Ne),this.options)?Me(this,Fe,vu).call(this):this.updateResult(),Me(this,Fe,Wy).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Yy(P(this,Ne),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Yy(P(this,Ne),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Me(this,Fe,qy).call(this),Me(this,Fe,Gy).call(this),P(this,Ne).removeObserver(this)}setOptions(t,n){const r=this.options,i=P(this,Ne);if(this.options=P(this,an).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof dr(this.options.enabled,P(this,Ne))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Me(this,Fe,Ky).call(this),P(this,Ne).setOptions(this.options),r._defaulted&&!Fy(this.options,r)&&P(this,an).getQueryCache().notify({type:"observerOptionsUpdated",query:P(this,Ne),observer:this});const o=this.hasListeners();o&&jS(P(this,Ne),i,this.options,r)&&Me(this,Fe,vu).call(this),this.updateResult(n),o&&(P(this,Ne)!==i||dr(this.options.enabled,P(this,Ne))!==dr(r.enabled,P(this,Ne))||Ra(this.options.staleTime,P(this,Ne))!==Ra(r.staleTime,P(this,Ne)))&&Me(this,Fe,zy).call(this);const s=Me(this,Fe,By).call(this);o&&(P(this,Ne)!==i||dr(this.options.enabled,P(this,Ne))!==dr(r.enabled,P(this,Ne))||s!==P(this,Ji))&&Me(this,Fe,Hy).call(this,s)}getOptimisticResult(t){const n=P(this,an).getQueryCache().build(P(this,an),t),r=this.createResult(n,t);return xz(this,r)&&(he(this,Gt,r),he(this,Ha,this.options),he(this,ns,P(this,Ne).state)),r}getCurrentResult(){return P(this,Gt)}trackResult(t,n){const r={};return Object.keys(t).forEach(i=>{Object.defineProperty(r,i,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(i),n==null||n(i),t[i])})}),r}trackProp(t){P(this,Ga).add(t)}getCurrentQuery(){return P(this,Ne)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=P(this,an).defaultQueryOptions(t),r=P(this,an).getQueryCache().build(P(this,an),n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Me(this,Fe,vu).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),P(this,Gt)))}createResult(t,n){var b;const r=P(this,Ne),i=this.options,o=P(this,Gt),s=P(this,ns),a=P(this,Ha),u=t!==r?t.state:P(this,Lc),{state:c}=t;let d={...c},f=!1,h;if(n._optimisticResults){const A=this.hasListeners(),k=!A&&DS(t,n),R=A&&jS(t,r,n,i);(k||R)&&(d={...d,...X$(c.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:g,errorUpdatedAt:y,status:_}=d;if(n.select&&d.data!==void 0)if(o&&d.data===(s==null?void 0:s.data)&&n.select===P(this,Oc))h=P(this,Wa);else try{he(this,Oc,n.select),h=n.select(d.data),h=Vy(o==null?void 0:o.data,h,n),he(this,Wa,h),he(this,Tr,null)}catch(A){he(this,Tr,A)}else h=d.data;if(n.placeholderData!==void 0&&h===void 0&&_==="pending"){let A;if(o!=null&&o.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))A=o.data;else if(A=typeof n.placeholderData=="function"?n.placeholderData((b=P(this,qa))==null?void 0:b.state.data,P(this,qa)):n.placeholderData,n.select&&A!==void 0)try{A=n.select(A),he(this,Tr,null)}catch(k){he(this,Tr,k)}A!==void 0&&(_="success",h=Vy(o==null?void 0:o.data,A,n),f=!0)}P(this,Tr)&&(g=P(this,Tr),h=P(this,Wa),y=Date.now(),_="error");const m=d.fetchStatus==="fetching",p=_==="pending",v=_==="error",x=p&&m,S=h!==void 0;return{status:_,fetchStatus:d.fetchStatus,isPending:p,isSuccess:_==="success",isError:v,isInitialLoading:x,isLoading:x,data:h,dataUpdatedAt:d.dataUpdatedAt,error:g,errorUpdatedAt:y,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>u.dataUpdateCount||d.errorUpdateCount>u.errorUpdateCount,isFetching:m,isRefetching:m&&!p,isLoadingError:v&&!S,isPaused:d.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:v&&S,isStale:N2(t,n),refetch:this.refetch}}updateResult(t){const n=P(this,Gt),r=this.createResult(P(this,Ne),this.options);if(he(this,ns,P(this,Ne).state),he(this,Ha,this.options),P(this,ns).data!==void 0&&he(this,qa,P(this,Ne)),Fy(r,n))return;he(this,Gt,r);const i={},o=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!P(this,Ga).size)return!0;const l=new Set(a??P(this,Ga));return this.options.throwOnError&&l.add("error"),Object.keys(P(this,Gt)).some(u=>{const c=u;return P(this,Gt)[c]!==n[c]&&l.has(c)})};(t==null?void 0:t.listeners)!==!1&&o()&&(i.listeners=!0),Me(this,Fe,Z$).call(this,{...i,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Me(this,Fe,Wy).call(this)}},an=new WeakMap,Ne=new WeakMap,Lc=new WeakMap,Gt=new WeakMap,ns=new WeakMap,Ha=new WeakMap,Tr=new WeakMap,Oc=new WeakMap,Wa=new WeakMap,qa=new WeakMap,rs=new WeakMap,is=new WeakMap,Ji=new WeakMap,Ga=new WeakMap,Fe=new WeakSet,vu=function(t){Me(this,Fe,Ky).call(this);let n=P(this,Ne).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(zn)),n},zy=function(){Me(this,Fe,qy).call(this);const t=Ra(this.options.staleTime,P(this,Ne));if(ll||P(this,Gt).isStale||!jy(t))return;const r=B$(P(this,Gt).dataUpdatedAt,t)+1;he(this,rs,setTimeout(()=>{P(this,Gt).isStale||this.updateResult()},r))},By=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(P(this,Ne)):this.options.refetchInterval)??!1},Hy=function(t){Me(this,Fe,Gy).call(this),he(this,Ji,t),!(ll||dr(this.options.enabled,P(this,Ne))===!1||!jy(P(this,Ji))||P(this,Ji)===0)&&he(this,is,setInterval(()=>{(this.options.refetchIntervalInBackground||M2.isFocused())&&Me(this,Fe,vu).call(this)},P(this,Ji)))},Wy=function(){Me(this,Fe,zy).call(this),Me(this,Fe,Hy).call(this,Me(this,Fe,By).call(this))},qy=function(){P(this,rs)&&(clearTimeout(P(this,rs)),he(this,rs,void 0))},Gy=function(){P(this,is)&&(clearInterval(P(this,is)),he(this,is,void 0))},Ky=function(){const t=P(this,an).getQueryCache().build(P(this,an),this.options);if(t===P(this,Ne))return;const n=P(this,Ne);he(this,Ne,t),he(this,Lc,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Z$=function(t){Lt.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(P(this,Gt))}),P(this,an).getQueryCache().notify({query:P(this,Ne),type:"observerResultsUpdated"})})},VE);function _z(e,t){return dr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function DS(e,t){return _z(e,t)||e.state.data!==void 0&&Yy(e,t,t.refetchOnMount)}function Yy(e,t,n){if(dr(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&N2(e,t)}return!1}function jS(e,t,n,r){return(e!==t||dr(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&N2(e,n)}function N2(e,t){return dr(t.enabled,e)!==!1&&e.isStaleByTime(Ra(t.staleTime,e))}function xz(e,t){return!Fy(e.getCurrentResult(),t)}var J$=U.createContext(void 0),Sz=e=>{const t=U.useContext(J$);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},wz=({client:e,children:t})=>(U.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),C.jsx(J$.Provider,{value:e,children:t})),ek=U.createContext(!1),bz=()=>U.useContext(ek);ek.Provider;function Ez(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Cz=U.createContext(Ez()),Az=()=>U.useContext(Cz);function Rz(e,t){return typeof e=="function"?e(...t):!!e}var $z=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},kz=e=>{U.useEffect(()=>{e.clearReset()},[e])},Tz=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&Rz(n,[e.error,r]),Mz=e=>{e.suspense&&(typeof e.staleTime!="number"&&(e.staleTime=1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},Nz=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Lz=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Oz(e,t,n){var u,c,d,f;const r=Sz(),i=bz(),o=Az(),s=r.defaultQueryOptions(e);(c=(u=r.getDefaultOptions().queries)==null?void 0:u._experimental_beforeQuery)==null||c.call(u,s),s._optimisticResults=i?"isRestoring":"optimistic",Mz(s),$z(s,o),kz(o);const[a]=U.useState(()=>new t(r,s)),l=a.getOptimisticResult(s);if(U.useSyncExternalStore(U.useCallback(h=>{const g=i?()=>{}:a.subscribe(Lt.batchCalls(h));return a.updateResult(),g},[a,i]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),U.useEffect(()=>{a.setOptions(s,{listeners:!1})},[s,a]),Nz(s,l))throw Lz(s,a,o);if(Tz({result:l,errorResetBoundary:o,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash)}))throw l.error;return(f=(d=r.getDefaultOptions().queries)==null?void 0:d._experimental_afterQuery)==null||f.call(d,s,l),s.notifyOnChangeProps?l:a.trackResult(l)}function L2(e,t){return Oz(e,vz)}const tk="Starter App",Pz="This field is required.",nk=8,Iz=`Password must be at least ${nk} characters long`,rk={required:Pz},Dz={...rk,minLength:{value:nk,message:Iz}},jz="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='24'%20viewBox='0%200%2024%2024'%20width='24'%3e%3cpath%20fill='none'%20d='M0%200h24v24H0z'/%3e%3cpath%20d='M22%2012c0-5.52-4.48-10-10-10S2%206.48%202%2012c0%204.84%203.44%208.87%208%209.8V15H8v-3h2V9.5C10%207.57%2011.57%206%2013.5%206H16v3h-2c-.55%200-1%20.45-1%201v2h3v3h-3v6.95c5.05-.5%209-4.76%209-9.95z'/%3e%3c/svg%3e",Fz="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M8.273%203.063c-.958.045-1.612.198-2.184.423a4.41%204.41%200%200%200-1.592%201.04%204.409%204.409%200%200%200-1.035%201.596c-.222.572-.372%201.227-.414%202.185-.042.958-.052%201.266-.047%203.71.005%202.444.016%202.75.062%203.71.046.958.198%201.612.423%202.184a4.41%204.41%200%200%200%201.04%201.592%204.4%204.4%200%200%200%201.597%201.035c.572.221%201.227.372%202.185.414.958.042%201.266.052%203.71.047%202.443-.005%202.75-.016%203.71-.061.96-.046%201.611-.199%202.183-.423a4.411%204.411%200%200%200%201.592-1.04%204.41%204.41%200%200%200%201.035-1.597c.222-.572.372-1.227.414-2.184.042-.96.052-1.268.047-3.711-.005-2.444-.016-2.75-.061-3.71-.046-.96-.198-1.612-.423-2.184a4.418%204.418%200%200%200-1.04-1.592%204.4%204.4%200%200%200-1.597-1.035c-.572-.221-1.227-.372-2.185-.414-.958-.041-1.266-.052-3.71-.047-2.444.005-2.75.015-3.71.062m.105%2016.27c-.878-.038-1.354-.184-1.672-.306a2.802%202.802%200%200%201-1.036-.671%202.772%202.772%200%200%201-.675-1.034c-.124-.317-.272-.793-.313-1.67-.045-.95-.054-1.234-.06-3.637-.004-2.403.005-2.687.046-3.636.038-.877.184-1.354.306-1.671.162-.421.357-.72.672-1.036a2.778%202.778%200%200%201%201.033-.675c.317-.124.793-.272%201.67-.313.95-.045%201.234-.054%203.637-.06%202.402-.005%202.687.004%203.637.046.876.038%201.354.183%201.67.306.421.162.72.357%201.037.671.316.315.511.613.675%201.034.124.317.271.792.313%201.67.045.95.055%201.234.06%203.636.004%202.402-.004%202.688-.046%203.636-.038.878-.184%201.354-.306%201.672a2.79%202.79%200%200%201-.672%201.036%202.78%202.78%200%200%201-1.033.675c-.317.124-.794.271-1.67.313-.95.045-1.234.054-3.637.06-2.403.005-2.687-.005-3.636-.046M15.715%207.19a1.08%201.08%200%201%200%202.16-.004%201.08%201.08%200%200%200-2.16.004m-8.336%204.819a4.62%204.62%200%201%200%209.242-.018%204.62%204.62%200%200%200-9.242.018M9%2012.006a3%203%200%201%201%206-.012%203%203%200%200%201-6%20.012'/%3e%3c/svg%3e",Uz="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%3e%3ccircle%20cx='6.18'%20cy='17.82'%20r='2.18'/%3e%3cpath%20d='M4%204.44v2.83c7.03%200%2012.73%205.7%2012.73%2012.73h2.83c0-8.59-6.97-15.56-15.56-15.56zm0%205.66v2.83c3.9%200%207.07%203.17%207.07%207.07h2.83c0-5.47-4.43-9.9-9.9-9.9z'/%3e%3c/svg%3e",Vz="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M19.912%207.925v.527A11.562%2011.562%200%200%201%208.265%2020.098%2011.443%2011.443%200%200%201%202%2018.265c.328.017.657.017.985%200a8.132%208.132%200%200%200%205.093-1.698%204.092%204.092%200%200%201-3.786-2.852c.255.062.518.091.781.085.36-.002.72-.047%201.07-.136a4.109%204.109%200%200%201-3.21-4.024c.566.32%201.202.494%201.851.51a4.126%204.126%200%200%201-1.34-5.518%2011.613%2011.613%200%200%200%208.488%204.295%204.397%204.397%200%200%201-.119-.934%204.092%204.092%200%200%201%204.092-4.092%204.04%204.04%200%200%201%203.005%201.29%207.929%207.929%200%200%200%202.53-1c-.3.953-.94%201.763-1.8%202.274A7.725%207.725%200%200%200%2022%205.803a8.489%208.489%200%200%201-2.088%202.122Z'%20fill-rule='evenodd'/%3e%3c/svg%3e",zz="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M19.816%205.389a2.469%202.469%200%200%201%201.766%201.746c.291%201.598.43%203.22.417%204.843a25.867%2025.867%200%200%201-.417%204.794%202.468%202.468%200%200%201-1.766%201.795c-2.593.318-5.204.46-7.816.429a58.411%2058.411%200%200%201-7.816-.429%202.469%202.469%200%200%201-1.766-1.746%2025.879%2025.879%200%200%201-.417-4.843%2025.85%2025.85%200%200%201%20.417-4.793%202.468%202.468%200%200%201%201.766-1.796c2.594-.3%205.205-.427%207.816-.379a58.413%2058.413%200%200%201%207.816.379ZM9.95%209.046v5.864l5.233-2.932L9.95%209.046Z'/%3e%3c/svg%3e",Bz="/comet-starter/img/logo.png",Hz=()=>{const e=t=>{t.preventDefault(),window.scrollTo(0,0)};return C.jsxs("footer",{className:"usa-footer",children:[C.jsx("div",{className:"grid-container usa-footer__return-to-top",children:C.jsx("a",{href:"/#",onClick:t=>{e(t)},children:"Return to top"})}),C.jsx("div",{className:"usa-footer__primary-section",children:C.jsx("nav",{className:"usa-footer__nav","aria-label":"Footer navigation",children:C.jsxs("ul",{className:"grid-row grid-gap",children:[C.jsx("li",{className:` + mobile-lg:grid-col-4 + desktop:grid-col-auto + usa-footer__primary-content + `,children:C.jsx("a",{className:"usa-footer__primary-link",href:"/#",children:""})}),C.jsx("li",{className:` + mobile-lg:grid-col-4 + desktop:grid-col-auto + usa-footer__primary-content + `,children:C.jsx("a",{className:"usa-footer__primary-link",href:"/#",children:""})}),C.jsx("li",{className:` + mobile-lg:grid-col-4 + desktop:grid-col-auto + usa-footer__primary-content + `,children:C.jsx("a",{className:"usa-footer__primary-link",href:"/#",children:""})}),C.jsx("li",{className:` + mobile-lg:grid-col-4 + desktop:grid-col-auto + usa-footer__primary-content + `,children:C.jsx("a",{className:"usa-footer__primary-link",href:"/#",children:""})}),C.jsx("li",{className:` + mobile-lg:grid-col-4 + desktop:grid-col-auto + usa-footer__primary-content + `,children:C.jsx("a",{className:"usa-footer__primary-link",href:"/#",children:""})})]})})}),C.jsx("div",{className:"usa-footer__secondary-section",children:C.jsx("div",{className:"grid-container",children:C.jsxs("div",{className:"grid-row grid-gap",children:[C.jsxs("div",{className:` + usa-footer__logo + grid-row + mobile-lg:grid-col-6 mobile-lg:grid-gap-2 + `,children:[C.jsx("div",{className:"mobile-lg:grid-col-auto",children:C.jsx("img",{className:"usa-footer__logo-img",src:Bz,alt:"US Flag"})}),C.jsx("div",{className:"mobile-lg:grid-col-auto",children:C.jsx("p",{className:"usa-footer__logo-heading",children:tk})})]}),C.jsxs("div",{className:"usa-footer__contact-links mobile-lg:grid-col-6",children:[C.jsxs("div",{className:"usa-footer__social-links grid-row grid-gap-1",children:[C.jsx("div",{className:"grid-col-auto",children:C.jsx("a",{className:"usa-social-link",href:"/#",children:C.jsx("img",{className:"usa-social-link__icon",src:jz,alt:"Facebook"})})}),C.jsx("div",{className:"grid-col-auto",children:C.jsx("a",{className:"usa-social-link",href:"/#",children:C.jsx("img",{className:"usa-social-link__icon",src:Vz,alt:"Twitter"})})}),C.jsx("div",{className:"grid-col-auto",children:C.jsx("a",{className:"usa-social-link",href:"/#",children:C.jsx("img",{className:"usa-social-link__icon",src:zz,alt:"YouTube"})})}),C.jsx("div",{className:"grid-col-auto",children:C.jsx("a",{className:"usa-social-link",href:"/#",children:C.jsx("img",{className:"usa-social-link__icon",src:Fz,alt:"Instagram"})})}),C.jsx("div",{className:"grid-col-auto",children:C.jsx("a",{className:"usa-social-link",href:"/#",children:C.jsx("img",{className:"usa-social-link__icon",src:Uz,alt:"RSS"})})})]}),C.jsx("h2",{className:"usa-footer__contact-heading",children:""}),C.jsx("address",{className:"usa-footer__address",children:C.jsxs("div",{className:"usa-footer__contact-info grid-row grid-gap",children:[C.jsx("div",{className:"grid-col-auto",children:C.jsx("a",{href:"tel:1-800-555-5555",children:" <(800) 555-GOVT> "})}),C.jsx("div",{className:"grid-col-auto",children:C.jsx("a",{href:"mailto:",children:""})})]})})]})]})})})]})},Wz=e=>e&&typeof e=="object"&&e.nodeType===1;var Ri=(e,t)=>{if(typeof e!="string")return[];(!t||!Wz(t))&&(t=window.document);const n=t.querySelectorAll(e);return Array.prototype.slice.call(n)};/* +object-assign +(c) Sindre Sorhus +@license MIT +*/var FS=Object.getOwnPropertySymbols,qz=Object.prototype.hasOwnProperty,Gz=Object.prototype.propertyIsEnumerable;function Kz(e){if(e==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function Yz(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de",Object.getOwnPropertyNames(e)[0]==="5")return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;var r=Object.getOwnPropertyNames(t).map(function(o){return t[o]});if(r.join("")!=="0123456789")return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(o){i[o]=o}),Object.keys(Object.assign({},i)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}var O2=Yz()?Object.assign:function(e,t){for(var n,r=Kz(e),i,o=1;o-1?e.split(VS).map(function(s){return ok({type:s},o)}):(o.type=e,[o])};var zS=function(e,t){var n=e[t];return delete e[t],n},sk=function(t,n){const r=Object.keys(t).reduce(function(i,o){var s=nB(o,t[o]);return i.concat(s)},[]);return ok({add:function(o){r.forEach(function(s){o.addEventListener(s.type,s.delegate,s.options)})},remove:function(o){r.forEach(function(s){o.removeEventListener(s.type,s.delegate,s.options)})}},n)};const rB=O2,iB=sk,BS=(...e)=>function(n=document.body){e.forEach(r=>{typeof this[r]=="function"&&this[r].call(this,n)})};var xn=(e,t)=>iB(e,rB({on:BS("init","add"),off:BS("teardown","remove")},t));const HS="aria-expanded",oB="aria-controls",WS="hidden";var I2=(e,t)=>{let n=t;typeof n!="boolean"&&(n=e.getAttribute(HS)==="false"),e.setAttribute(HS,n);const r=e.getAttribute(oB),i=document.getElementById(r);if(!i)throw new Error(`No toggle target found with id: "${r}"`);return n?i.removeAttribute(WS):i.setAttribute(WS,""),n};function sB(e,t=window,n=document.documentElement){const r=e.getBoundingClientRect();return r.top>=0&&r.left>=0&&r.bottom<=(t.innerHeight||n.clientHeight)&&r.right<=(t.innerWidth||n.clientWidth)}var ak=sB,Cl={CLICK:"click"},On={prefix:"usa"};const lk=Ri,aB=xn,qS=I2,lB=ak,{CLICK:uB}=Cl,{prefix:gh}=On,mh=`.${gh}-accordion, .${gh}-accordion--bordered`,cB=`.${gh}-banner__button`,Fu=`.${gh}-accordion__button[aria-controls]:not(${cB})`,GS="aria-expanded",dB="data-allow-multiple",uk=e=>lk(Fu,e).filter(n=>n.closest(mh)===e),Uu=(e,t)=>{const n=e.closest(mh);let r=t;if(!n)throw new Error(`${Fu} is missing outer ${mh}`);r=qS(e,t);const i=n.hasAttribute(dB);r&&!i&&uk(n).forEach(o=>{o!==e&&qS(o,!1)})},fB=e=>Uu(e,!0),hB=e=>Uu(e,!1),pB=aB({[uB]:{[Fu](){Uu(this),this.getAttribute(GS)==="true"&&(lB(this)||this.scrollIntoView())}}},{init(e){lk(Fu,e).forEach(t=>{const n=t.getAttribute(GS)==="true";Uu(t,n)})},ACCORDION:mh,BUTTON:Fu,show:fB,hide:hB,toggle:Uu,getButtons:uk});var ck=pB;const KS=zr(ck),gB=xn,mB=Ri,{CLICK:yB}=Cl,{prefix:dk}=On,fk=I2,hk=`.${dk}-banner__header`,pk=`${dk}-banner__header--expanded`,Qy=`${hk} [aria-controls]`,vB=function(t){t.preventDefault();const n=t.target.closest(Qy);fk(n),this.closest(hk).classList.toggle(pk)};var _B=gB({[yB]:{[Qy]:vB}},{init(e){mB(Qy,e).forEach(t=>{const n=t.getAttribute(pk)==="true";fk(t,n)})}});const YS=zr(_B),xB="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAAsBAMAAAAncaPMAAAAAXNSR0IArs4c6QAAABtQTFRF////4EAg2z8g2z8f2z4f2j4fHjSyHjOxHTOxQEYPwgAAAIdJREFUeNrNkUENxDAMBEOhFJaCKZiCKZhCKBj2ebV3rdR71+pIq+Qxj1GyqjJ3U8VlHkc07hFm0awBYe91juq6MSI0yhSAEgkzJ4TMKiXyzFw3pgR9lmIBJlqj2AmBedf+IycExmlKZVzvZEJ4A0oBrjBl/m6PCy95B3fFAN6YuQPxhbcB4QMkEj04wQXD5wAAAABJRU5ErkJggg==",SB="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='64'%20height='64'%20viewBox='0%200%2064%2064'%3e%3ctitle%3eicon-https%3c/title%3e%3cpath%20fill='%23719F2A'%20fill-rule='evenodd'%20d='M32%200c17.673%200%2032%2014.327%2032%2032%200%2017.673-14.327%2032-32%2032C14.327%2064%200%2049.673%200%2032%200%2014.327%2014.327%200%2032%200zm0%201.208C14.994%201.208%201.208%2014.994%201.208%2032S14.994%2062.792%2032%2062.792%2062.792%2049.006%2062.792%2032%2049.006%201.208%2032%201.208zm0%2018.886a7.245%207.245%200%200%201%207.245%207.245v3.103h.52c.86%200%201.557.698%201.557%201.558v9.322c0%20.86-.697%201.558-1.557%201.558h-15.53c-.86%200-1.557-.697-1.557-1.558V32c0-.86.697-1.558%201.557-1.558h.52V27.34A7.245%207.245%200%200%201%2032%2020.094zm0%203.103a4.142%204.142%200%200%200-4.142%204.142v3.103h8.284V27.34A4.142%204.142%200%200%200%2032%2023.197z'/%3e%3c/svg%3e",wB="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='64'%20height='64'%20viewBox='0%200%2064%2064'%3e%3ctitle%3eicon-dot-gov%3c/title%3e%3cpath%20fill='%232378C3'%20fill-rule='evenodd'%20d='m32%200c17.7%200%2032%2014.3%2032%2032s-14.3%2032-32%2032-32-14.3-32-32%2014.3-32%2032-32zm0%201.2c-17%200-30.8%2013.8-30.8%2030.8s13.8%2030.8%2030.8%2030.8%2030.8-13.8%2030.8-30.8-13.8-30.8-30.8-30.8zm11.4%2038.9c.5%200%20.9.4.9.8v1.6h-24.6v-1.6c0-.5.4-.8.9-.8zm-17.1-12.3v9.8h1.6v-9.8h3.3v9.8h1.6v-9.8h3.3v9.8h1.6v-9.8h3.3v9.8h.8c.5%200%20.9.4.9.8v.8h-21.4v-.8c0-.5.4-.8.9-.8h.8v-9.8zm5.7-8.2%2012.3%204.9v1.6h-1.6c0%20.5-.4.8-.9.8h-19.6c-.5%200-.9-.4-.9-.8h-1.6v-1.6s12.3-4.9%2012.3-4.9z'/%3e%3c/svg%3e";var bB=function(t,n=500){let r=null;return(...i)=>{window.clearTimeout(r),r=window.setTimeout(()=>{t.apply(this,i)},n)}};const EB=Ri,CB=xn,AB=bB,{prefix:K0}=On,D2=`${K0}-character-count`,Sg=`.${D2}`,Xy=`.${K0}-character-count__field`,QS=`.${K0}-character-count__message`,Zy="The content is too long.",gk=`${K0}-character-count__status--invalid`,j2=`${D2}__status`,F2=`${D2}__sr-status`,RB=`.${j2}`,$B=`.${F2}`,U2="characters allowed",V2=e=>{const t=e.closest(Sg);if(!t)throw new Error(`${Xy} is missing outer ${Sg}`);const n=t.querySelector(QS);if(!n)throw new Error(`${Sg} is missing inner ${QS}`);return{characterCountEl:t,messageEl:n}},kB=e=>{const{characterCountEl:t}=V2(e),n=e.getAttribute("maxlength");n&&(e.removeAttribute("maxlength"),t.setAttribute("data-maxlength",n))},mk=e=>{const t=document.createElement("div"),n=document.createElement("div"),i=`${e.dataset.maxlength} ${U2}`;t.classList.add(`${j2}`,"usa-hint"),n.classList.add(`${F2}`,"usa-sr-only"),t.setAttribute("aria-hidden",!0),n.setAttribute("aria-live","polite"),t.textContent=i,n.textContent=i,e.append(t,n)},yk=(e,t)=>{let n="";if(e===0)n=`${t} ${U2}`;else{const r=Math.abs(t-e),i=`character${r===1?"":"s"}`,o=e>t?"over limit":"left";n=`${r} ${i} ${o}`}return n},TB=AB((e,t)=>{const n=e;n.textContent=t},1e3),XS=e=>{const{characterCountEl:t}=V2(e),n=e.value.length,r=parseInt(t.getAttribute("data-maxlength"),10),i=t.querySelector(RB),o=t.querySelector($B),s=yk(n,r);if(!r)return;const a=n&&n>r;i.textContent=s,TB(o,s),a&&!e.validationMessage&&e.setCustomValidity(Zy),!a&&e.validationMessage===Zy&&e.setCustomValidity(""),i.classList.toggle(gk,a)},MB=e=>{const{characterCountEl:t,messageEl:n}=V2(e);n.classList.add("usa-sr-only"),n.removeAttribute("aria-live"),kB(e),mk(t)};CB({input:{[Xy](){XS(this)}}},{init(e){EB(Xy,e).forEach(t=>MB(t))},MESSAGE_INVALID_CLASS:gk,VALIDATION_MESSAGE:Zy,STATUS_MESSAGE_CLASS:j2,STATUS_MESSAGE_SR_ONLY_CLASS:F2,DEFAULT_STATUS_LABEL:U2,createStatusMessages:mk,getCountMessage:yk,updateCountMessage:XS});var z2={exports:{}},NB={exports:{}};(function(e,t){(function(){var n={polyfill:o,keys:{3:"Cancel",6:"Help",8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",28:"Convert",29:"NonConvert",30:"Accept",31:"ModeChange",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",41:"Select",42:"Print",43:"Execute",44:"PrintScreen",45:"Insert",46:"Delete",48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],91:"OS",93:"ContextMenu",144:"NumLock",145:"ScrollLock",181:"VolumeMute",182:"VolumeDown",183:"VolumeUp",186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"'],224:"Meta",225:"AltGraph",246:"Attn",247:"CrSel",248:"ExSel",249:"EraseEof",250:"Play",251:"ZoomOut"}},r;for(r=1;r<25;r++)n.keys[111+r]="F"+r;var i="";for(r=65;r<91;r++)i=String.fromCharCode(r),n.keys[r]=[i.toLowerCase(),i.toUpperCase()];function o(){if(!("KeyboardEvent"in window)||"key"in KeyboardEvent.prototype)return!1;var s={get:function(a){var l=n.keys[this.which||this.keyCode];return Array.isArray(l)&&(l=l[+this.shiftKey]),l}};return Object.defineProperty(KeyboardEvent.prototype,"key",s),s}e.exports=n})()})(NB);const Jy={Alt:"altKey",Control:"ctrlKey",Ctrl:"ctrlKey",Shift:"shiftKey"},vk="+",LB=function(e,t){var n=e.key;if(t)for(var r in Jy)e[Jy[r]]===!0&&(n=[r,n].join(vk));return n};z2.exports=function(t){const n=Object.keys(t).some(function(r){return r.indexOf(vk)>-1});return function(r){var i=LB(r,n);return[i,i.toLowerCase()].reduce(function(o,s){return s in t&&(o=t[i].call(this,r)),o},void 0)}};z2.exports.MODIFIERS=Jy;var Yc=z2.exports;const OB=Ri,PB=e=>e&&typeof e=="object"&&e.nodeType===1;var Mo=(e,t)=>{const n=OB(e,t);return typeof e!="string"||PB(t)&&t.matches(e)&&n.push(t),n},_k={exports:{}};(function(e){_k.exports=e()})(function(){var e={_entity:/[&<>"'/]/g,_entities:{"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},getEntity:function(t){return e._entities[t]},escapeHTML:function(t){for(var n="",r=0;r1?n-1:0),i=1;i{},Ur=(e,t="")=>{const n=e;n.value=t;const r=new CustomEvent("change",{bubbles:!0,cancelable:!0,detail:{value:t}});n.dispatchEvent(r)},Tt=e=>{const t=e.closest(ci);if(!t)throw new Error(`Element is missing outer ${ci}`);const n=t.querySelector(BB),r=t.querySelector(_f),i=t.querySelector(HB),o=t.querySelector(qB),s=t.querySelector(Rk),a=t.querySelector(WB),l=t.querySelector(Ak),u=t.querySelector(Ck),c=t.classList.contains(Ms),d=t.dataset.disableFiltering==="true";return{comboBoxEl:t,selectEl:n,inputEl:r,listEl:i,statusEl:o,focusedOptionEl:s,selectedOptionEl:a,toggleListBtnEl:l,clearInputBtnEl:u,isPristine:c,disableFiltering:d}},$k=e=>{const{inputEl:t,toggleListBtnEl:n,clearInputBtnEl:r}=Tt(e);r.hidden=!0,r.disabled=!0,n.disabled=!0,t.disabled=!0},YB=e=>{const{inputEl:t,toggleListBtnEl:n,clearInputBtnEl:r}=Tt(e);r.hidden=!0,r.setAttribute("aria-disabled",!0),n.setAttribute("aria-disabled",!0),t.setAttribute("aria-disabled",!0)},QB=e=>{const{inputEl:t,toggleListBtnEl:n,clearInputBtnEl:r}=Tt(e);r.hidden=!1,r.disabled=!1,n.disabled=!1,t.disabled=!1},JS=e=>{const t=e.closest(ci);if(t.dataset.enhanced)return;const n=t.querySelector("select");if(!n)throw new Error(`${ci} is missing inner select`);const r=n.id,i=document.querySelector(`label[for="${r}"]`),o=`${r}--list`,s=`${r}-label`,a=`${r}--assistiveHint`,l=[],{defaultValue:u}=t.dataset,{placeholder:c}=t.dataset;let d;if(c&&l.push({placeholder:c}),u)for(let h=0,g=n.options.length;h{if(n.hasAttribute(h)){const g=n.getAttribute(h);l.push({[h]:g}),n.removeAttribute(h)}});const f=document.createElement("input");if(f.setAttribute("id",r),f.setAttribute("aria-owns",o),f.setAttribute("aria-controls",o),f.setAttribute("aria-autocomplete","list"),f.setAttribute("aria-describedby",a),f.setAttribute("aria-expanded","false"),f.setAttribute("autocapitalize","off"),f.setAttribute("autocomplete","off"),f.setAttribute("class",Sk),f.setAttribute("type","text"),f.setAttribute("role","combobox"),l.forEach(h=>Object.keys(h).forEach(g=>{const y=ZS.escapeHTML`${h[g]}`;f.setAttribute(g,y)})),t.insertAdjacentElement("beforeend",f),t.insertAdjacentHTML("beforeend",ZS.escapeHTML` + + + +   + + + + +
+ + When autocomplete results are available use up and down arrows to review and enter to select. + Touch device users, explore by touch or with swipe gestures. + `),d){const{inputEl:h}=Tt(t);Ur(n,d.value),Ur(h,d.text),t.classList.add(Ms)}n.disabled&&($k(t),n.disabled=!1),n.hasAttribute("aria-disabled")&&(YB(t),n.removeAttribute("aria-disabled")),t.dataset.enhanced="true"},Qc=(e,t,{skipFocus:n,preventScroll:r}={})=>{const{inputEl:i,listEl:o,focusedOptionEl:s}=Tt(e);if(s&&(s.classList.remove(ws),s.setAttribute("tabIndex","-1")),t){if(i.setAttribute("aria-activedescendant",t.id),t.setAttribute("tabIndex","0"),t.classList.add(ws),!r){const a=t.offsetTop+t.offsetHeight,l=o.scrollTop+o.offsetHeight;a>l&&(o.scrollTop=a-o.offsetHeight),t.offsetTop{const r=o=>o.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");let i=e.replace(/{{(.*?)}}/g,(o,s)=>{const a=s.trim(),l=n[a];if(a!=="query"&&l){const u=new RegExp(l,"i"),c=t.match(u);return c?r(c[1]):""}return r(t)});return i=`^(?:${i})$`,new RegExp(i,"i")},ul=e=>{const{comboBoxEl:t,selectEl:n,inputEl:r,listEl:i,statusEl:o,isPristine:s,disableFiltering:a}=Tt(e);let l,u;const c=`${i.id}--option-`,d=(r.value||"").toLowerCase(),f=t.dataset.filter||GB,h=kk(f,d,t.dataset),g=[];for(let v=0,x=n.options.length;v{const S=`${c}${x}`,w=[hc];let b="-1",A="false";S===l&&(w.push(bk,ws),b="0",A="true"),!l&&x===0&&(w.push(ws),b="0");const k=document.createElement("li");return k.setAttribute("aria-setsize",g.length),k.setAttribute("aria-posinset",x+1),k.setAttribute("aria-selected",A),k.setAttribute("id",S),k.setAttribute("class",w.join(" ")),k.setAttribute("tabindex",b),k.setAttribute("role","option"),k.setAttribute("data-value",v.value),k.textContent=v.text,k}),m=document.createElement("li");m.setAttribute("class",`${hc}--no-results`),m.textContent="No results found",i.hidden=!1,y?(i.innerHTML="",_.forEach(v=>i.insertAdjacentElement("beforeend",v))):(i.innerHTML="",i.insertAdjacentElement("beforeend",m)),r.setAttribute("aria-expanded","true"),o.textContent=y?`${y} result${y>1?"s":""} available.`:"No results.";let p;s&&l?p=i.querySelector(`#${l}`):a&&u&&(p=i.querySelector(`#${u}`)),p&&Qc(i,p,{skipFocus:!0})},bs=e=>{const{inputEl:t,listEl:n,statusEl:r,focusedOptionEl:i}=Tt(e);r.innerHTML="",t.setAttribute("aria-expanded","false"),t.setAttribute("aria-activedescendant",""),i&&i.classList.remove(ws),n.scrollTop=0,n.hidden=!0},W2=e=>{const{comboBoxEl:t,selectEl:n,inputEl:r}=Tt(e);Ur(n,e.dataset.value),Ur(r,e.textContent),t.classList.add(Ms),bs(t),r.focus()},XB=e=>{const{comboBoxEl:t,listEl:n,selectEl:r,inputEl:i}=Tt(e),o=!n.hidden;r.value&&Ur(r),i.value&&Ur(i),t.classList.remove(Ms),o&&ul(t),i.focus()},q2=e=>{const{comboBoxEl:t,selectEl:n,inputEl:r}=Tt(e),i=n.value,o=(r.value||"").toLowerCase();if(i)for(let s=0,a=n.options.length;s{const{comboBoxEl:t,selectEl:n,inputEl:r,statusEl:i}=Tt(e);i.textContent="";const o=(r.value||"").toLowerCase();if(o)for(let s=0,a=n.options.length;s{const{comboBoxEl:t,inputEl:n}=Tt(e.target);bs(t),q2(t),n.focus()},ew=e=>{const{comboBoxEl:t,listEl:n}=Tt(e.target);n.hidden&&ul(t);const r=n.querySelector(Rk)||n.querySelector(xf);r&&Qc(t,r),e.preventDefault()},eH=e=>{const{comboBoxEl:t,listEl:n}=Tt(e.target),r=!n.hidden;ZB(t),r&&bs(t),e.preventDefault()},tw=e=>{const t=e.target,n=t.nextSibling;n&&Qc(t,n),e.preventDefault()},tH=e=>{W2(e.target),e.preventDefault()},nH=e=>{W2(e.target),e.preventDefault()},nw=e=>{const{comboBoxEl:t,listEl:n,focusedOptionEl:r}=Tt(e.target),i=r&&r.previousSibling,o=!n.hidden;Qc(t,i),o&&e.preventDefault(),i||bs(t)},rH=e=>{e.classList.contains(ws)||Qc(e,e,{preventScroll:!0})},iH=e=>{const{comboBoxEl:t,listEl:n,inputEl:r}=Tt(e);n.hidden?ul(t):bs(t),r.focus()},oH=e=>{const{comboBoxEl:t,listEl:n}=Tt(e);n.hidden&&ul(t)},sH=DB({[FB]:{[_f](){this.disabled||oH(this)},[Ak](){this.disabled||iH(this)},[xf](){this.disabled||W2(this)},[Ck](){this.disabled||XB(this)}},focusout:{[ci](e){this.contains(e.relatedTarget)||(q2(this),bs(this))}},keydown:{[ci]:wg({Escape:JB}),[_f]:wg({Enter:eH,ArrowDown:ew,Down:ew}),[xf]:wg({ArrowUp:nw,Up:nw,ArrowDown:tw,Down:tw,Enter:nH," ":tH,"Shift+Tab":KB})},input:{[_f](){this.closest(ci).classList.remove(Ms),ul(this)}},mouseover:{[xf](){rH(this)}}},{init(e){IB(ci,e).forEach(t=>{JS(t)})},getComboBoxContext:Tt,enhanceComboBox:JS,generateDynamicRegExp:kk,disable:$k,enable:QB,displayList:ul,hideList:bs,COMBO_BOX_CLASS:Sr});var aH=sH,Tk=(e=document)=>e.activeElement;function lH(){return typeof navigator<"u"&&(navigator.userAgent.match(/(iPod|iPhone|iPad)/g)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!window.MSStream}var uH=lH;const Oo=Yc,cH=xn,dH=Ri,fH=Mo,{prefix:hH}=On,{CLICK:pH}=Cl,gH=Tk,mH=uH,$a=Y0,$i=`${hH}-date-picker`,yH=`${$i}__wrapper`,vH=`${$i}--initialized`,Mk=`${$i}--active`,Nk=`${$i}__internal-input`,Lk=`${$i}__external-input`,Ok=`${$i}__button`,dt=`${$i}__calendar`,Pk=`${$i}__status`,nr=`${dt}__date`,Ik=`${nr}--focused`,_H=`${nr}--selected`,xH=`${nr}--previous-month`,Dk=`${nr}--current-month`,SH=`${nr}--next-month`,wH=`${nr}--range-date`,bH=`${nr}--today`,EH=`${nr}--range-date-start`,CH=`${nr}--range-date-end`,AH=`${nr}--within-range`,jk=`${dt}__previous-year`,Fk=`${dt}__previous-month`,Uk=`${dt}__next-year`,Vk=`${dt}__next-month`,zk=`${dt}__month-selection`,Bk=`${dt}__year-selection`,Q0=`${dt}__month`,G2=`${Q0}--focused`,RH=`${Q0}--selected`,X0=`${dt}__year`,K2=`${X0}--focused`,$H=`${X0}--selected`,Hk=`${dt}__previous-year-chunk`,Wk=`${dt}__next-year-chunk`,qk=`${dt}__date-picker`,Gk=`${dt}__month-picker`,Kk=`${dt}__year-picker`,yh=`${dt}__table`,kH=`${dt}__row`,Ys=`${dt}__cell`,jd=`${Ys}--center-items`,TH=`${dt}__month-label`,MH=`${dt}__day-of-week`,Es=`.${$i}`,Yk=`.${Ok}`,NH=`.${Nk}`,Sf=`.${Lk}`,vh=`.${dt}`,LH=`.${Pk}`,rw=`.${nr}`,Al=`.${Ik}`,OH=`.${Dk}`,Y2=`.${jk}`,Q2=`.${Fk}`,X2=`.${Uk}`,Z2=`.${Vk}`,Qk=`.${Bk}`,Xk=`.${zk}`,ev=`.${Q0}`,_h=`.${X0}`,J2=`.${Hk}`,e5=`.${Wk}`,Rl=`.${qk}`,PH=`.${Gk}`,t5=`.${Kk}`,Z0=`.${G2}`,$l=`.${K2}`,iw="Please enter a valid date",tv=["January","February","March","April","May","June","July","August","September","October","November","December"],IH=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],DH=13,Mr=12,jH="0000-01-01",J0="MM/DD/YYYY",Zk="YYYY-MM-DD",FH=":not([disabled])",n5=(...e)=>e.map(t=>t+FH).join(", "),UH=n5(Y2,Q2,Qk,Xk,X2,Z2,Al),VH=n5(Z0),zH=n5(J2,e5,$l),r5=(e,t)=>(t!==e.getMonth()&&e.setDate(0),e),xh=(e,t,n)=>{const r=new Date(0);return r.setFullYear(e,t,n),r},i5=()=>{const e=new Date,t=e.getDate(),n=e.getMonth(),r=e.getFullYear();return xh(r,n,t)},o5=e=>{const t=new Date(0);return t.setFullYear(e.getFullYear(),e.getMonth(),1),t},Jk=e=>{const t=new Date(0);return t.setFullYear(e.getFullYear(),e.getMonth()+1,0),t},as=(e,t)=>{const n=new Date(e.getTime());return n.setDate(n.getDate()+t),n},s5=(e,t)=>as(e,-t),eT=(e,t)=>as(e,t*7),BH=(e,t)=>eT(e,-t),tT=e=>{const t=e.getDay();return s5(e,t)},HH=e=>{const t=e.getDay();return as(e,6-t)},Xc=(e,t)=>{const n=new Date(e.getTime()),r=(n.getMonth()+12+t)%12;return n.setMonth(n.getMonth()+t),r5(n,r),n},a5=(e,t)=>Xc(e,-t),l5=(e,t)=>Xc(e,t*12),nT=(e,t)=>l5(e,-t),cl=(e,t)=>{const n=new Date(e.getTime());return n.setMonth(t),r5(n,t),n},po=(e,t)=>{const n=new Date(e.getTime()),r=n.getMonth();return n.setFullYear(t),r5(n,r),n},WH=(e,t)=>{let n=e;return t{let n=e;return t>e&&(n=t),new Date(n.getTime())},rT=(e,t)=>e&&t&&e.getFullYear()===t.getFullYear(),zo=(e,t)=>rT(e,t)&&e.getMonth()===t.getMonth(),Pi=(e,t)=>zo(e,t)&&e.getDate()===t.getDate(),Pn=(e,t,n)=>{let r=e;return en&&(r=n),new Date(r.getTime())},nv=(e,t,n)=>e>=t&&(!n||e<=n),GH=(e,t,n)=>Jk(e)n,bg=(e,t,n)=>Jk(cl(e,11))n,ur=(e,t=Zk,n=!1)=>{let r,i,o,s,a;if(e){let l,u,c;if(t===J0?[l,u,c]=e.split("/"):[c,l,u]=e.split("-"),c&&(a=parseInt(c,10),!Number.isNaN(a)&&(s=a,n&&(s=Math.max(0,s),c.length<3)))){const d=i5().getFullYear();s=d-d%10**c.length+a}if(l&&(a=parseInt(l,10),Number.isNaN(a)||(i=a,n&&(i=Math.max(1,i),i=Math.min(12,i)))),i&&u&&s!=null&&(a=parseInt(u,10),!Number.isNaN(a)&&(o=a,n))){const d=xh(s,i,0).getDate();o=Math.max(1,o),o=Math.min(d,o)}i&&o&&s!=null&&(r=xh(s,i-1,o))}return r},dl=(e,t=Zk)=>{const n=(s,a)=>`0000${s}`.slice(-a),r=e.getMonth()+1,i=e.getDate(),o=e.getFullYear();return t===J0?[n(r,2),n(i,2),n(o,4)].join("/"):[n(o,4),n(r,2),n(i,2)].join("-")},u5=(e,t)=>{const n=[];let r=[],i=0;for(;i{o.insertAdjacentElement("beforeend",s)}),n.push(o)}return n},c5=e=>{const t=document.createElement("tbody");return e.forEach(n=>{t.insertAdjacentElement("beforeend",n)}),t},rv=(e,t="")=>{const n=e;n.value=t;const r=new CustomEvent("change",{bubbles:!0,cancelable:!0,detail:{value:t}});n.dispatchEvent(r)},Ve=e=>{const t=e.closest(Es);if(!t)throw new Error(`Element is missing outer ${Es}`);const n=t.querySelector(NH),r=t.querySelector(Sf),i=t.querySelector(vh),o=t.querySelector(Yk),s=t.querySelector(LH),a=t.querySelector(_h),l=ur(r.value,J0,!0),u=ur(n.value),c=ur(i.dataset.value),d=ur(t.dataset.minDate),f=ur(t.dataset.maxDate),h=ur(t.dataset.rangeDate),g=ur(t.dataset.defaultDate);if(d&&f&&d>f)throw new Error("Minimum date cannot be after maximum date");return{calendarDate:c,minDate:d,toggleBtnEl:o,selectedDate:u,maxDate:f,firstYearChunkEl:a,datePickerEl:t,inputDate:l,internalInputEl:n,externalInputEl:r,calendarEl:i,rangeDate:h,defaultDate:g,statusEl:s}},iT=e=>{const{externalInputEl:t,toggleBtnEl:n}=Ve(e);n.disabled=!0,t.disabled=!0},oT=e=>{const{externalInputEl:t,toggleBtnEl:n}=Ve(e);n.setAttribute("aria-disabled",!0),t.setAttribute("aria-disabled",!0)},KH=e=>{const{externalInputEl:t,toggleBtnEl:n}=Ve(e);n.disabled=!1,t.disabled=!1},d5=e=>{const{externalInputEl:t,minDate:n,maxDate:r}=Ve(e),i=t.value;let o=!1;if(i){o=!0;const s=i.split("/"),[a,l,u]=s.map(c=>{let d;const f=parseInt(c,10);return Number.isNaN(f)||(d=f),d});if(a&&l&&u!=null){const c=xh(u,a-1,l);c.getMonth()===a-1&&c.getDate()===l&&c.getFullYear()===u&&s[2].length===4&&nv(c,n,r)&&(o=!1)}}return o},Sh=e=>{const{externalInputEl:t}=Ve(e),n=d5(t);n&&!t.validationMessage&&t.setCustomValidity(iw),!n&&t.validationMessage===iw&&t.setCustomValidity("")},YH=e=>{const{internalInputEl:t,inputDate:n}=Ve(e);let r="";n&&!d5(e)&&(r=dl(n)),t.value!==r&&rv(t,r)},f5=(e,t)=>{const n=ur(t);if(n){const r=dl(n,J0),{datePickerEl:i,internalInputEl:o,externalInputEl:s}=Ve(e);rv(o,t),rv(s,r),Sh(i)}},QH=e=>{const t=e.closest(Es),{defaultValue:n}=t.dataset,r=t.querySelector("input");if(!r)throw new Error(`${Es} is missing inner input`);r.value&&(r.value="");const i=ur(t.dataset.minDate||r.getAttribute("min"));t.dataset.minDate=i?dl(i):jH;const o=ur(t.dataset.maxDate||r.getAttribute("max"));o&&(t.dataset.maxDate=dl(o));const s=document.createElement("div");s.classList.add(yH);const a=r.cloneNode();a.classList.add(Lk),a.type="text",s.appendChild(a),s.insertAdjacentHTML("beforeend",$a.escapeHTML` + + +
`),r.setAttribute("aria-hidden","true"),r.setAttribute("tabindex","-1"),r.style.display="none",r.classList.add(Nk),r.removeAttribute("id"),r.removeAttribute("name"),r.required=!1,t.appendChild(s),t.classList.add(vH),n&&f5(t,n),r.disabled&&(iT(t),r.disabled=!1),r.hasAttribute("aria-disabled")&&(oT(t),r.removeAttribute("aria-disabled"))},wr=(e,t)=>{const{datePickerEl:n,calendarEl:r,statusEl:i,selectedDate:o,maxDate:s,minDate:a,rangeDate:l}=Ve(e),u=i5();let c=t||u;const d=r.hidden,f=as(c,0),h=c.getMonth(),g=c.getFullYear(),y=a5(c,1),_=Xc(c,1),m=dl(c),p=o5(c),v=zo(c,a),x=zo(c,s),S=o||c,w=l&&WH(S,l),b=l&&qH(S,l),A=l&&as(w,1),k=l&&s5(b,1),R=tv[h],M=N=>{const B=[nr],G=N.getDate(),ie=N.getMonth(),K=N.getFullYear(),pe=N.getDay(),ge=dl(N);let ue="-1";const $e=!nv(N,a,s),je=Pi(N,o);zo(N,y)&&B.push(xH),zo(N,f)&&B.push(Dk),zo(N,_)&&B.push(SH),je&&B.push(_H),Pi(N,u)&&B.push(bH),l&&(Pi(N,l)&&B.push(wH),Pi(N,w)&&B.push(EH),Pi(N,b)&&B.push(CH),nv(N,A,k)&&B.push(AH)),Pi(N,f)&&(ue="0",B.push(Ik));const we=tv[ie],Te=IH[pe],Ie=document.createElement("button");return Ie.setAttribute("type","button"),Ie.setAttribute("tabindex",ue),Ie.setAttribute("class",B.join(" ")),Ie.setAttribute("data-day",G),Ie.setAttribute("data-month",ie+1),Ie.setAttribute("data-year",K),Ie.setAttribute("data-value",ge),Ie.setAttribute("aria-label",$a.escapeHTML`${G} ${we} ${K} ${Te}`),Ie.setAttribute("aria-selected",je?"true":"false"),$e===!0&&(Ie.disabled=!0),Ie.textContent=G,Ie};c=tT(p);const $=[];for(;$.length<28||c.getMonth()===h||$.length%7!==0;)$.push(M(c)),c=as(c,1);const T=u5($,7),D=r.cloneNode();D.dataset.value=m,D.style.top=`${n.offsetHeight}px`,D.hidden=!1,D.innerHTML=$a.escapeHTML` +
+
+
+ +
+
+ +
+
+ + +
+
+ +
+
+ +
+
+
+ `;const O=document.createElement("table");O.setAttribute("class",yh);const H=document.createElement("thead");O.insertAdjacentElement("beforeend",H);const Q=document.createElement("tr");H.insertAdjacentElement("beforeend",Q);const V={Sunday:"S",Monday:"M",Tuesday:"T",Wednesday:"W",Thursday:"Th",Friday:"Fr",Saturday:"S"};Object.keys(V).forEach(N=>{const B=document.createElement("th");B.setAttribute("class",MH),B.setAttribute("scope","col"),B.setAttribute("aria-label",N),B.textContent=V[N],Q.insertAdjacentElement("beforeend",B)});const W=c5(T);O.insertAdjacentElement("beforeend",W),D.querySelector(Rl).insertAdjacentElement("beforeend",O),r.parentNode.replaceChild(D,r),n.classList.add(Mk);const X=[];return Pi(o,f)&&X.push("Selected date"),d?(X.push("You can navigate by day using left and right arrows","Weeks by using up and down arrows","Months by using page up and page down keys","Years by using shift plus page up and shift plus page down","Home and end keys navigate to the beginning and end of a week"),i.textContent=""):X.push(`${R} ${g}`),i.textContent=X.join(". "),D},XH=e=>{if(e.disabled)return;const{calendarEl:t,calendarDate:n,minDate:r,maxDate:i}=Ve(e);let o=nT(n,1);o=Pn(o,r,i);const s=wr(t,o);let a=s.querySelector(Y2);a.disabled&&(a=s.querySelector(Rl)),a.focus()},ZH=e=>{if(e.disabled)return;const{calendarEl:t,calendarDate:n,minDate:r,maxDate:i}=Ve(e);let o=a5(n,1);o=Pn(o,r,i);const s=wr(t,o);let a=s.querySelector(Q2);a.disabled&&(a=s.querySelector(Rl)),a.focus()},JH=e=>{if(e.disabled)return;const{calendarEl:t,calendarDate:n,minDate:r,maxDate:i}=Ve(e);let o=Xc(n,1);o=Pn(o,r,i);const s=wr(t,o);let a=s.querySelector(Z2);a.disabled&&(a=s.querySelector(Rl)),a.focus()},eW=e=>{if(e.disabled)return;const{calendarEl:t,calendarDate:n,minDate:r,maxDate:i}=Ve(e);let o=l5(n,1);o=Pn(o,r,i);const s=wr(t,o);let a=s.querySelector(X2);a.disabled&&(a=s.querySelector(Rl)),a.focus()},ep=e=>{const{datePickerEl:t,calendarEl:n,statusEl:r}=Ve(e);t.classList.remove(Mk),n.hidden=!0,r.textContent=""},tW=e=>{if(e.disabled)return;const{datePickerEl:t,externalInputEl:n}=Ve(e);f5(e,e.dataset.value),ep(t),n.focus()},nW=e=>{if(e.disabled)return;const{calendarEl:t,inputDate:n,minDate:r,maxDate:i,defaultDate:o}=Ve(e);if(t.hidden){const s=Pn(n||o||i5(),r,i);wr(t,s).querySelector(Al).focus()}else ep(e)},sT=e=>{const{calendarEl:t,inputDate:n,minDate:r,maxDate:i}=Ve(e);if(!t.hidden&&n){const s=Pn(n,r,i);wr(t,s)}},h5=(e,t)=>{const{calendarEl:n,statusEl:r,calendarDate:i,minDate:o,maxDate:s}=Ve(e),a=i.getMonth(),l=t??a,u=tv.map((y,_)=>{const m=cl(i,_),p=GH(m,o,s);let v="-1";const x=[Q0],S=_===a;_===l&&(v="0",x.push(G2)),S&&x.push(RH);const w=document.createElement("button");return w.setAttribute("type","button"),w.setAttribute("tabindex",v),w.setAttribute("class",x.join(" ")),w.setAttribute("data-value",_),w.setAttribute("data-label",y),w.setAttribute("aria-selected",S?"true":"false"),p===!0&&(w.disabled=!0),w.textContent=y,w}),c=document.createElement("div");c.setAttribute("tabindex","-1"),c.setAttribute("class",Gk);const d=document.createElement("table");d.setAttribute("class",yh),d.setAttribute("role","presentation");const f=u5(u,3),h=c5(f);d.insertAdjacentElement("beforeend",h),c.insertAdjacentElement("beforeend",d);const g=n.cloneNode();return g.insertAdjacentElement("beforeend",c),n.parentNode.replaceChild(g,n),r.textContent="Select a month.",g},rW=e=>{if(e.disabled)return;const{calendarEl:t,calendarDate:n,minDate:r,maxDate:i}=Ve(e),o=parseInt(e.dataset.value,10);let s=cl(n,o);s=Pn(s,r,i),wr(t,s).querySelector(Al).focus()},Zc=(e,t)=>{const{calendarEl:n,statusEl:r,calendarDate:i,minDate:o,maxDate:s}=Ve(e),a=i.getFullYear(),l=t??a;let u=l;u-=u%Mr,u=Math.max(0,u);const c=bg(po(i,u-1),o,s),d=bg(po(i,u+Mr),o,s),f=[];let h=u;for(;f.length{if(e.disabled)return;const{calendarEl:t,calendarDate:n,minDate:r,maxDate:i}=Ve(e),o=t.querySelector($l);let a=parseInt(o.textContent,10)-Mr;a=Math.max(0,a);const l=po(n,a),u=Pn(l,r,i),c=Zc(t,u.getFullYear());let d=c.querySelector(J2);d.disabled&&(d=c.querySelector(t5)),d.focus()},oW=e=>{if(e.disabled)return;const{calendarEl:t,calendarDate:n,minDate:r,maxDate:i}=Ve(e),o=t.querySelector($l);let a=parseInt(o.textContent,10)+Mr;a=Math.max(0,a);const l=po(n,a),u=Pn(l,r,i),c=Zc(t,u.getFullYear());let d=c.querySelector(e5);d.disabled&&(d=c.querySelector(t5)),d.focus()},sW=e=>{if(e.disabled)return;const{calendarEl:t,calendarDate:n,minDate:r,maxDate:i}=Ve(e),o=parseInt(e.innerHTML,10);let s=po(n,o);s=Pn(s,r,i),wr(t,s).querySelector(Al).focus()},aW=e=>{const{datePickerEl:t,externalInputEl:n}=Ve(e.target);ep(t),n.focus(),e.preventDefault()},qr=e=>t=>{const{calendarEl:n,calendarDate:r,minDate:i,maxDate:o}=Ve(t.target),s=e(r),a=Pn(s,i,o);Pi(r,a)||wr(n,a).querySelector(Al).focus(),t.preventDefault()},ow=qr(e=>BH(e,1)),sw=qr(e=>eT(e,1)),aw=qr(e=>s5(e,1)),lw=qr(e=>as(e,1)),lW=qr(e=>tT(e)),uW=qr(e=>HH(e)),cW=qr(e=>Xc(e,1)),dW=qr(e=>a5(e,1)),fW=qr(e=>l5(e,1)),hW=qr(e=>nT(e,1)),pW=e=>{if(e.disabled)return;const t=e.closest(vh),n=t.dataset.value,r=e.dataset.value;if(r===n)return;const i=ur(r);wr(t,i).querySelector(Al).focus()},No=e=>t=>{const n=t.target,r=parseInt(n.dataset.value,10),{calendarEl:i,calendarDate:o,minDate:s,maxDate:a}=Ve(n),l=cl(o,r);let u=e(r);u=Math.max(0,Math.min(11,u));const c=cl(o,u),d=Pn(c,s,a);zo(l,d)||h5(i,d.getMonth()).querySelector(Z0).focus(),t.preventDefault()},uw=No(e=>e-3),cw=No(e=>e+3),dw=No(e=>e-1),fw=No(e=>e+1),gW=No(e=>e-e%3),mW=No(e=>e+2-e%3),yW=No(()=>11),vW=No(()=>0),_W=e=>{if(e.disabled||e.classList.contains(G2))return;const t=parseInt(e.dataset.value,10);h5(e,t).querySelector(Z0).focus()},Lo=e=>t=>{const n=t.target,r=parseInt(n.dataset.value,10),{calendarEl:i,calendarDate:o,minDate:s,maxDate:a}=Ve(n),l=po(o,r);let u=e(r);u=Math.max(0,u);const c=po(o,u),d=Pn(c,s,a);rT(l,d)||Zc(i,d.getFullYear()).querySelector($l).focus(),t.preventDefault()},hw=Lo(e=>e-3),pw=Lo(e=>e+3),gw=Lo(e=>e-1),mw=Lo(e=>e+1),xW=Lo(e=>e-e%3),SW=Lo(e=>e+2-e%3),wW=Lo(e=>e-Mr),bW=Lo(e=>e+Mr),EW=e=>{if(e.disabled||e.classList.contains(K2))return;const t=parseInt(e.dataset.value,10);Zc(e,t).querySelector($l).focus()},p5=e=>{const t=n=>{const{calendarEl:r}=Ve(n),i=dH(e,r),o=0,s=i.length-1,a=i[o],l=i[s],u=i.indexOf(gH());return{focusableElements:i,isNotFound:u===-1,firstTabStop:a,isFirstTab:u===o,lastTabStop:l,isLastTab:u===s}};return{tabAhead(n){const{firstTabStop:r,isLastTab:i,isNotFound:o}=t(n.target);(i||o)&&(n.preventDefault(),r.focus())},tabBack(n){const{lastTabStop:r,isFirstTab:i,isNotFound:o}=t(n.target);(i||o)&&(n.preventDefault(),r.focus())}}},Eg=p5(UH),yw=p5(VH),vw=p5(zH),aT={[pH]:{[Yk](){nW(this)},[rw](){tW(this)},[ev](){rW(this)},[_h](){sW(this)},[Q2](){ZH(this)},[Z2](){JH(this)},[Y2](){XH(this)},[X2](){eW(this)},[J2](){iW(this)},[e5](){oW(this)},[Xk](){h5(this).querySelector(Z0).focus()},[Qk](){Zc(this).querySelector($l).focus()}},keyup:{[vh](e){const t=this.dataset.keydownKeyCode;`${e.keyCode}`!==t&&e.preventDefault()}},keydown:{[Sf](e){e.keyCode===DH&&Sh(this)},[rw]:Oo({Up:ow,ArrowUp:ow,Down:sw,ArrowDown:sw,Left:aw,ArrowLeft:aw,Right:lw,ArrowRight:lw,Home:lW,End:uW,PageDown:cW,PageUp:dW,"Shift+PageDown":fW,"Shift+PageUp":hW,Tab:Eg.tabAhead}),[Rl]:Oo({Tab:Eg.tabAhead,"Shift+Tab":Eg.tabBack}),[ev]:Oo({Up:uw,ArrowUp:uw,Down:cw,ArrowDown:cw,Left:dw,ArrowLeft:dw,Right:fw,ArrowRight:fw,Home:gW,End:mW,PageDown:yW,PageUp:vW}),[PH]:Oo({Tab:yw.tabAhead,"Shift+Tab":yw.tabBack}),[_h]:Oo({Up:hw,ArrowUp:hw,Down:pw,ArrowDown:pw,Left:gw,ArrowLeft:gw,Right:mw,ArrowRight:mw,Home:xW,End:SW,PageDown:bW,PageUp:wW}),[t5]:Oo({Tab:vw.tabAhead,"Shift+Tab":vw.tabBack}),[vh](e){this.dataset.keydownKeyCode=e.keyCode},[Es](e){Oo({Escape:aW})(e)}},focusout:{[Sf](){Sh(this)},[Es](e){this.contains(e.relatedTarget)||ep(this)}},input:{[Sf](){YH(this),sT(this)}}};mH()||(aT.mouseover={[OH](){pW(this)},[ev](){_W(this)},[_h](){EW(this)}});const CW=cH(aT,{init(e){fH(Es,e).forEach(t=>{QH(t)})},getDatePickerContext:Ve,disable:iT,ariaDisable:oT,enable:KH,isDateInputInvalid:d5,setCalendarValue:f5,validateDateInput:Sh,renderCalendar:wr,updateCalendarIfVisible:sT});var AW=CW;const RW=xn,$W=Ri,kW=Mo,{prefix:lT}=On,{getDatePickerContext:uT,isDateInputInvalid:cT,updateCalendarIfVisible:dT}=AW,TW=`${lT}-date-picker`,g5=`${lT}-date-range-picker`,fT=`${g5}__range-start`,hT=`${g5}__range-end`,Cg=`.${TW}`,ka=`.${g5}`,pT=`.${fT}`,gT=`.${hT}`,MW="0000-01-01",mT=e=>{const t=e.closest(ka);if(!t)throw new Error(`Element is missing outer ${ka}`);const n=t.querySelector(pT),r=t.querySelector(gT);return{dateRangePickerEl:t,rangeStartEl:n,rangeEndEl:r}},yT=e=>{const{dateRangePickerEl:t,rangeStartEl:n,rangeEndEl:r}=mT(e),{internalInputEl:i}=uT(n),o=i.value;o&&!cT(i)?(r.dataset.minDate=o,r.dataset.rangeDate=o,r.dataset.defaultDate=o):(r.dataset.minDate=t.dataset.minDate||"",r.dataset.rangeDate="",r.dataset.defaultDate=""),dT(r)},vT=e=>{const{dateRangePickerEl:t,rangeStartEl:n,rangeEndEl:r}=mT(e),{internalInputEl:i}=uT(r),o=i.value;o&&!cT(i)?(n.dataset.maxDate=o,n.dataset.rangeDate=o,n.dataset.defaultDate=o):(n.dataset.maxDate=t.dataset.maxDate||"",n.dataset.rangeDate="",n.dataset.defaultDate=""),dT(n)},NW=e=>{const t=e.closest(ka),[n,r]=$W(Cg,t);if(!n)throw new Error(`${ka} is missing inner two '${Cg}' elements`);if(!r)throw new Error(`${ka} is missing second '${Cg}' element`);n.classList.add(fT),r.classList.add(hT),t.dataset.minDate||(t.dataset.minDate=MW);const{minDate:i}=t.dataset;n.dataset.minDate=i,r.dataset.minDate=i;const{maxDate:o}=t.dataset;o&&(n.dataset.maxDate=o,r.dataset.maxDate=o),yT(t),vT(t)};RW({"input change":{[pT](){yT(this)},[gT](){vT(this)}}},{init(e){kW(ka,e).forEach(t=>{NW(t)})}});const _w=Mo,LW=xn,wh=Y0,{prefix:Sn}=On,pc=`${Sn}-file-input`,gc=`.${pc}`,_T=`${Sn}-file-input__input`,m5=`${Sn}-file-input__target`,xT=`.${_T}`,OW=`${Sn}-file-input__box`,ST=`${Sn}-file-input__instructions`,wT=`${Sn}-file-input__preview`,bT=`${Sn}-file-input__preview-heading`,tp=`${Sn}-file-input--disabled`,PW=`${Sn}-file-input__choose`,ET=`${Sn}-file-input__accepted-files-message`,xw=`${Sn}-file-input__drag-text`,Ag=`${Sn}-file-input--drag`,Sw="is-loading",iv="has-invalid-file",kl=`${Sn}-file-input__preview-image`,IW=`${kl}--generic`,DW=`${kl}--pdf`,jW=`${kl}--word`,FW=`${kl}--video`,UW=`${kl}--excel`,CT=`${Sn}-sr-only`,Ws="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";let ov=!0,sv="",av="";const Jc=e=>{const t=e.closest(gc);if(!t)throw new Error(`Element is missing outer ${gc}`);const n=t.querySelector(xT);return{dropZoneEl:t,inputEl:n}},VW=e=>{const{dropZoneEl:t,inputEl:n}=Jc(e);n.disabled=!0,t.classList.add(tp)},zW=e=>{const{dropZoneEl:t}=Jc(e);t.classList.add(tp)},BW=e=>{const{dropZoneEl:t,inputEl:n}=Jc(e);n.disabled=!1,t.classList.remove(tp),t.removeAttribute("aria-disabled")},HW=e=>{const t=e.charCodeAt(0);return t===32?"-":t>=65&&t<=90?`img_${e.toLowerCase()}`:`__${t.toString(16).slice(-4)}`},WW=e=>e.replace(/[^a-z0-9]/g,HW),qW=e=>`${e}-${Math.floor(Date.now().toString()/1e3)}`,AT=e=>e.hasAttribute("multiple")?"files":"file",GW=e=>{const t=document.createElement("div"),n=document.createElement("div"),r=document.createElement("div");return e.classList.remove(pc),e.classList.add(_T),t.classList.add(pc),r.classList.add(OW),n.classList.add(m5),n.prepend(r),e.parentNode.insertBefore(n,e),e.parentNode.insertBefore(t,n),n.appendChild(e),t.appendChild(n),n},KW=e=>{const t=e.closest(gc),n=AT(e),r=document.createElement("div"),i=`Drag ${n} here or`,o="choose from folder";return sv=`${i} ${o}`,r.classList.add(ST),r.setAttribute("aria-hidden","true"),e.setAttribute("aria-label",sv),r.innerHTML=wh.escapeHTML`${i} ${o}`,e.parentNode.insertBefore(r,e),(/rv:11.0/i.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent))&&(t.querySelector(`.${xw}`).outerHTML=""),r},YW=e=>{const t=document.createElement("div"),n=AT(e),r=e.closest(gc),i=e.closest(`.${m5}`);av=`No ${n} selected.`,t.classList.add(CT),t.setAttribute("aria-live","polite"),t.textContent=av,r.insertBefore(t,i)},QW=e=>{const t=e.hasAttribute("aria-disabled")||e.hasAttribute("disabled"),n=GW(e),r=KW(e),{dropZoneEl:i}=Jc(e);return t?i.classList.add(tp):YW(e),{instructions:r,dropTarget:n}},RT=(e,t)=>{const n=e.querySelectorAll(`.${wT}`),r=e.querySelector(`.${bT}`),i=e.querySelector(`.${ET}`),o=s=>{s.parentNode.removeChild(s)};r&&(r.outerHTML=""),i&&(i.outerHTML="",e.classList.remove(iv)),n!==null&&(t&&t.removeAttribute("hidden"),Array.prototype.forEach.call(n,o))},XW=(e,t,n)=>{const r=e;let i=av;t.length===1?i=`You have selected the file: ${n}`:t.length>1&&(i=`You have selected ${t.length} files: ${n.join(", ")}`),setTimeout(()=>{r.textContent=i},1e3)},ZW=(e,t)=>{const n=document.createElement("div"),r=e.closest(`.${m5}`),i=r.querySelector(`.${ST}`);let o="Change file",s="";t.length===1?s=wh.escapeHTML`Selected file ${o}`:t.length>1&&(o="Change files",s=wh.escapeHTML`${t.length} files selected ${o}`),i.setAttribute("hidden","true"),n.classList.add(bT),n.innerHTML=s,r.insertBefore(n,i),e.setAttribute("aria-label",o)},JW=(e,t,n,r)=>{const i=e.target.files,s=r.closest(`.${pc}`).querySelector(`.${CT}`),a=[];RT(r,n);for(let l=0;l