diff --git a/assets/Latin-Merriweather-Bold-CCF7lkx7.woff2 b/assets/Latin-Merriweather-Bold-CCF7lkx7.woff2 new file mode 100644 index 00000000..b71dc5a0 Binary files /dev/null and b/assets/Latin-Merriweather-Bold-CCF7lkx7.woff2 differ diff --git a/assets/Latin-Merriweather-BoldItalic-JQDcMnUg.woff2 b/assets/Latin-Merriweather-BoldItalic-JQDcMnUg.woff2 new file mode 100644 index 00000000..36d3abfc Binary files /dev/null and b/assets/Latin-Merriweather-BoldItalic-JQDcMnUg.woff2 differ diff --git a/assets/Latin-Merriweather-Italic-025x4r-i.woff2 b/assets/Latin-Merriweather-Italic-025x4r-i.woff2 new file mode 100644 index 00000000..09916326 Binary files /dev/null and b/assets/Latin-Merriweather-Italic-025x4r-i.woff2 differ diff --git a/assets/Latin-Merriweather-Light-PDnE-7rh.woff2 b/assets/Latin-Merriweather-Light-PDnE-7rh.woff2 new file mode 100644 index 00000000..a0eadc33 Binary files /dev/null and b/assets/Latin-Merriweather-Light-PDnE-7rh.woff2 differ diff --git a/assets/Latin-Merriweather-LightItalic-fzuv9GcB.woff2 b/assets/Latin-Merriweather-LightItalic-fzuv9GcB.woff2 new file mode 100644 index 00000000..5112dab4 Binary files /dev/null and b/assets/Latin-Merriweather-LightItalic-fzuv9GcB.woff2 differ diff --git a/assets/Latin-Merriweather-Regular-cMHUZnTa.woff2 b/assets/Latin-Merriweather-Regular-cMHUZnTa.woff2 new file mode 100644 index 00000000..9a9bd644 Binary files /dev/null and b/assets/Latin-Merriweather-Regular-cMHUZnTa.woff2 differ diff --git a/assets/hero-PagYR-AW.jpg b/assets/hero-PagYR-AW.jpg new file mode 100644 index 00000000..62320c42 Binary files /dev/null and b/assets/hero-PagYR-AW.jpg differ diff --git a/assets/index-5Hh-80ku.js b/assets/index-5Hh-80ku.js new file mode 100644 index 00000000..ae36c9f9 --- /dev/null +++ b/assets/index-5Hh-80ku.js @@ -0,0 +1,565 @@ +var Ug=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var L=(e,t,n)=>(Ug(e,t,"read from private field"),n?n.call(e):t.get(e)),he=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},ce=(e,t,n,r)=>(Ug(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);var Gd=(e,t,n,r)=>({set _(o){ce(e,t,o,n)},get _(){return L(e,t,r)}}),Re=(e,t,n)=>(Ug(e,t,"access private method"),n);function PL(e,t){for(var n=0;nr[o]})}}}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 o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();var oa=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ko(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ML(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 o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var kO={exports:{}},f0={},TO={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 gd=Symbol.for("react.element"),jL=Symbol.for("react.portal"),NL=Symbol.for("react.fragment"),LL=Symbol.for("react.strict_mode"),IL=Symbol.for("react.profiler"),DL=Symbol.for("react.provider"),FL=Symbol.for("react.context"),UL=Symbol.for("react.forward_ref"),VL=Symbol.for("react.suspense"),zL=Symbol.for("react.memo"),BL=Symbol.for("react.lazy"),Pw=Symbol.iterator;function HL(e){return e===null||typeof e!="object"?null:(e=Pw&&e[Pw]||e["@@iterator"],typeof e=="function"?e:null)}var $O={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},PO=Object.assign,MO={};function zl(e,t,n){this.props=e,this.context=t,this.refs=MO,this.updater=n||$O}zl.prototype.isReactComponent={};zl.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")};zl.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function jO(){}jO.prototype=zl.prototype;function o_(e,t,n){this.props=e,this.context=t,this.refs=MO,this.updater=n||$O}var i_=o_.prototype=new jO;i_.constructor=o_;PO(i_,zl.prototype);i_.isPureReactComponent=!0;var Mw=Array.isArray,NO=Object.prototype.hasOwnProperty,a_={current:null},LO={key:!0,ref:!0,__self:!0,__source:!0};function IO(e,t,n){var r,o={},i=null,a=null;if(t!=null)for(r in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(i=""+t.key),t)NO.call(t,r)&&!LO.hasOwnProperty(r)&&(o[r]=t[r]);var s=arguments.length-2;if(s===1)o.children=n;else if(1>>1,P=V[Y];if(0>>1;Yo(re,B))eeo(le,re)?(V[Y]=le,V[ee]=B,Y=ee):(V[Y]=re,V[G]=B,Y=G);else if(eeo(le,B))V[Y]=le,V[ee]=B,Y=ee;else break e}}return K}function o(V,K){var B=V.sortIndex-K.sortIndex;return B!==0?B:V.id-K.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,s=a.now();e.unstable_now=function(){return a.now()-s}}var l=[],u=[],c=1,d=null,f=3,p=!1,g=!1,v=!1,_=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,h=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(V){for(var K=n(u);K!==null;){if(K.callback===null)r(u);else if(K.startTime<=V)r(u),K.sortIndex=K.expirationTime,t(l,K);else break;K=n(u)}}function b(V){if(v=!1,y(V),!g)if(n(l)!==null)g=!0,W(S);else{var K=n(u);K!==null&&Q(b,K.startTime-V)}}function S(V,K){g=!1,v&&(v=!1,m(O),O=-1),p=!0;var B=f;try{for(y(K),d=n(l);d!==null&&(!(d.expirationTime>K)||V&&!T());){var Y=d.callback;if(typeof Y=="function"){d.callback=null,f=d.priorityLevel;var P=Y(d.expirationTime<=K);K=e.unstable_now(),typeof P=="function"?d.callback=P:d===n(l)&&r(l),y(K)}else r(l);d=n(l)}if(d!==null)var z=!0;else{var G=n(u);G!==null&&Q(b,G.startTime-K),z=!1}return z}finally{d=null,f=B,p=!1}}var x=!1,A=null,O=-1,R=5,C=-1;function T(){return!(e.unstable_now()-CV||125Y?(V.sortIndex=B,t(u,V),n(l)===null&&V===n(u)&&(v?(m(O),O=-1):v=!0,Q(b,B-Y))):(V.sortIndex=P,t(l,V),g||p||(g=!0,W(S))),V},e.unstable_shouldYield=T,e.unstable_wrapCallback=function(V){var K=f;return function(){var B=f;f=K;try{return V.apply(this,arguments)}finally{f=B}}}})(VO);UO.exports=VO;var nI=UO.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 zO=H,kn=nI;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"),Jy=Object.prototype.hasOwnProperty,rI=/^[: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]*$/,Nw={},Lw={};function oI(e){return Jy.call(Lw,e)?!0:Jy.call(Nw,e)?!1:rI.test(e)?Lw[e]=!0:(Nw[e]=!0,!1)}function iI(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 aI(e,t,n,r){if(t===null||typeof t>"u"||iI(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 en(e,t,n,r,o,i,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=a}var Nt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Nt[e]=new en(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Nt[t]=new en(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Nt[e]=new en(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Nt[e]=new en(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){Nt[e]=new en(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Nt[e]=new en(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Nt[e]=new en(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Nt[e]=new en(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Nt[e]=new en(e,5,!1,e.toLowerCase(),null,!1,!1)});var l_=/[\-:]([a-z])/g;function u_(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(l_,u_);Nt[t]=new en(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(l_,u_);Nt[t]=new en(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(l_,u_);Nt[t]=new en(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Nt[e]=new en(e,1,!1,e.toLowerCase(),null,!1,!1)});Nt.xlinkHref=new en("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Nt[e]=new en(e,1,!1,e.toLowerCase(),null,!0,!0)});function c_(e,t,n,r){var o=Nt.hasOwnProperty(t)?Nt[t]:null;(o!==null?o.type!==0:r||!(2s||o[a]!==i[s]){var l=` +`+o[a].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=a&&0<=s);break}}}finally{Bg=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Fu(e):""}function sI(e){switch(e.tag){case 5:return Fu(e.type);case 16:return Fu("Lazy");case 13:return Fu("Suspense");case 19:return Fu("SuspenseList");case 0:case 2:case 15:return e=Hg(e.type,!1),e;case 11:return e=Hg(e.type.render,!1),e;case 1:return e=Hg(e.type,!0),e;default:return""}}function rv(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 vs:return"Fragment";case ys:return"Portal";case ev:return"Profiler";case d_:return"StrictMode";case tv:return"Suspense";case nv:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case WO:return(e.displayName||"Context")+".Consumer";case HO:return(e._context.displayName||"Context")+".Provider";case f_:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case p_:return t=e.displayName||null,t!==null?t:rv(e.type)||"Memo";case Wo:t=e._payload,e=e._init;try{return rv(e(t))}catch{}}return null}function lI(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 rv(t);case 8:return t===d_?"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 ki(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function GO(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function uI(e){var t=GO(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 o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(a){r=""+a,i.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Qd(e){e._valueTracker||(e._valueTracker=uI(e))}function KO(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=GO(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function wp(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 ov(e,t){var n=t.checked;return ot({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Dw(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ki(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 YO(e,t){t=t.checked,t!=null&&c_(e,"checked",t,!1)}function iv(e,t){YO(e,t);var n=ki(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")?av(e,t.type,n):t.hasOwnProperty("defaultValue")&&av(e,t.type,ki(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Fw(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 av(e,t,n){(t!=="number"||wp(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Uu=Array.isArray;function zs(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=Xd.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function vc(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Zu={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},cI=["Webkit","ms","Moz","O"];Object.keys(Zu).forEach(function(e){cI.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Zu[t]=Zu[e]})});function JO(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Zu.hasOwnProperty(e)&&Zu[e]?(""+t).trim():t+"px"}function eR(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=JO(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var dI=ot({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 uv(e,t){if(t){if(dI[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 cv(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 dv=null;function h_(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var fv=null,Bs=null,Hs=null;function zw(e){if(e=vd(e)){if(typeof fv!="function")throw Error(J(280));var t=e.stateNode;t&&(t=y0(t),fv(e.stateNode,e.type,t))}}function tR(e){Bs?Hs?Hs.push(e):Hs=[e]:Bs=e}function nR(){if(Bs){var e=Bs,t=Hs;if(Hs=Bs=null,zw(e),t)for(e=0;e>>=0,e===0?32:31-(SI(e)/xI|0)|0}var Zd=64,Jd=4194304;function Vu(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 Ap(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,a=n&268435455;if(a!==0){var s=a&~o;s!==0?r=Vu(s):(i&=a,i!==0&&(r=Vu(i)))}else a=n&~o,a!==0?r=Vu(a):i!==0&&(r=Vu(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&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 md(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-wr(t),e[t]=n}function OI(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=ec),Xw=" ",Zw=!1;function SR(e,t){switch(e){case"keyup":return tD.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function xR(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var _s=!1;function rD(e,t){switch(e){case"compositionend":return xR(t);case"keypress":return t.which!==32?null:(Zw=!0,Xw);case"textInput":return e=t.data,e===Xw&&Zw?null:e;default:return null}}function oD(e,t){if(_s)return e==="compositionend"||!S_&&SR(e,t)?(e=bR(),Bf=__=ui=null,_s=!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=nS(n)}}function OR(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?OR(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function RR(){for(var e=window,t=wp();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=wp(e.document)}return t}function x_(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 pD(e){var t=RR(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&OR(n.ownerDocument.documentElement,n)){if(r!==null&&x_(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 o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=rS(n,i);var a=rS(n,r);o&&a&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.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,bs=null,vv=null,nc=null,_v=!1;function oS(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;_v||bs==null||bs!==wp(r)||(r=bs,"selectionStart"in r&&x_(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}),nc&&Ec(nc,r)||(nc=r,r=Rp(vv,"onSelect"),0xs||(e.current=Av[xs],Av[xs]=null,xs--)}function He(e,t){xs++,Av[xs]=e.current,e.current=t}var Ti={},Vt=Li(Ti),pn=Li(!1),Ta=Ti;function vl(e,t){var n=e.type.contextTypes;if(!n)return Ti;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function hn(e){return e=e.childContextTypes,e!=null}function Tp(){Ye(pn),Ye(Vt)}function dS(e,t,n){if(Vt.current!==Ti)throw Error(J(168));He(Vt,t),He(pn,n)}function IR(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(J(108,lI(e)||"Unknown",o));return ot({},n,r)}function $p(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ti,Ta=Vt.current,He(Vt,e),He(pn,pn.current),!0}function fS(e,t,n){var r=e.stateNode;if(!r)throw Error(J(169));n?(e=IR(e,t,Ta),r.__reactInternalMemoizedMergedChildContext=e,Ye(pn),Ye(Vt),He(Vt,e)):Ye(pn),He(pn,n)}var po=null,v0=!1,om=!1;function DR(e){po===null?po=[e]:po.push(e)}function AD(e){v0=!0,DR(e)}function Ii(){if(!om&&po!==null){om=!0;var e=0,t=De;try{var n=po;for(De=1;e>=a,o-=a,ho=1<<32-wr(t)+o|n<O?(R=A,A=null):R=A.sibling;var C=f(m,A,y[O],b);if(C===null){A===null&&(A=R);break}e&&A&&C.alternate===null&&t(m,A),h=i(C,h,O),x===null?S=C:x.sibling=C,x=C,A=R}if(O===y.length)return n(m,A),Je&&Gi(m,O),S;if(A===null){for(;OO?(R=A,A=null):R=A.sibling;var T=f(m,A,C.value,b);if(T===null){A===null&&(A=R);break}e&&A&&T.alternate===null&&t(m,A),h=i(T,h,O),x===null?S=T:x.sibling=T,x=T,A=R}if(C.done)return n(m,A),Je&&Gi(m,O),S;if(A===null){for(;!C.done;O++,C=y.next())C=d(m,C.value,b),C!==null&&(h=i(C,h,O),x===null?S=C:x.sibling=C,x=C);return Je&&Gi(m,O),S}for(A=r(m,A);!C.done;O++,C=y.next())C=p(A,m,O,C.value,b),C!==null&&(e&&C.alternate!==null&&A.delete(C.key===null?O:C.key),h=i(C,h,O),x===null?S=C:x.sibling=C,x=C);return e&&A.forEach(function(k){return t(m,k)}),Je&&Gi(m,O),S}function _(m,h,y,b){if(typeof y=="object"&&y!==null&&y.type===vs&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case Yd:e:{for(var S=y.key,x=h;x!==null;){if(x.key===S){if(S=y.type,S===vs){if(x.tag===7){n(m,x.sibling),h=o(x,y.props.children),h.return=m,m=h;break e}}else if(x.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Wo&&_S(S)===x.type){n(m,x.sibling),h=o(x,y.props),h.ref=bu(m,x,y),h.return=m,m=h;break e}n(m,x);break}else t(m,x);x=x.sibling}y.type===vs?(h=xa(y.props.children,m.mode,b,y.key),h.return=m,m=h):(b=Xf(y.type,y.key,y.props,null,m.mode,b),b.ref=bu(m,h,y),b.return=m,m=b)}return a(m);case ys:e:{for(x=y.key;h!==null;){if(h.key===x)if(h.tag===4&&h.stateNode.containerInfo===y.containerInfo&&h.stateNode.implementation===y.implementation){n(m,h.sibling),h=o(h,y.children||[]),h.return=m,m=h;break e}else{n(m,h);break}else t(m,h);h=h.sibling}h=fm(y,m.mode,b),h.return=m,m=h}return a(m);case Wo:return x=y._init,_(m,h,x(y._payload),b)}if(Uu(y))return g(m,h,y,b);if(gu(y))return v(m,h,y,b);sf(m,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,h!==null&&h.tag===6?(n(m,h.sibling),h=o(h,y),h.return=m,m=h):(n(m,h),h=dm(y,m.mode,b),h.return=m,m=h),a(m)):n(m,h)}return _}var bl=qR(!0),GR=qR(!1),_d={},Wr=Li(_d),Rc=Li(_d),kc=Li(_d);function sa(e){if(e===_d)throw Error(J(174));return e}function P_(e,t){switch(He(kc,t),He(Rc,e),He(Wr,_d),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:lv(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=lv(t,e)}Ye(Wr),He(Wr,t)}function wl(){Ye(Wr),Ye(Rc),Ye(kc)}function KR(e){sa(kc.current);var t=sa(Wr.current),n=lv(t,e.type);t!==n&&(He(Rc,e),He(Wr,n))}function M_(e){Rc.current===e&&(Ye(Wr),Ye(Rc))}var tt=Li(0);function Ip(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 im=[];function j_(){for(var e=0;en?n:4,e(!0);var r=am.transition;am.transition={};try{e(!1),t()}finally{De=n,am.transition=r}}function ck(){return er().memoizedState}function kD(e,t,n){var r=bi(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},dk(e))fk(t,n);else if(n=zR(e,t,n,r),n!==null){var o=Xt();Sr(n,e,r,o),pk(n,t,r)}}function TD(e,t,n){var r=bi(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(dk(e))fk(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var a=t.lastRenderedState,s=i(a,n);if(o.hasEagerState=!0,o.eagerState=s,Er(s,a)){var l=t.interleaved;l===null?(o.next=o,T_(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}finally{}n=zR(e,t,o,r),n!==null&&(o=Xt(),Sr(n,e,r,o),pk(n,t,r))}}function dk(e){var t=e.alternate;return e===nt||t!==null&&t===nt}function fk(e,t){rc=Dp=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function pk(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,m_(e,n)}}var Fp={readContext:Jn,useCallback:Lt,useContext:Lt,useEffect:Lt,useImperativeHandle:Lt,useInsertionEffect:Lt,useLayoutEffect:Lt,useMemo:Lt,useReducer:Lt,useRef:Lt,useState:Lt,useDebugValue:Lt,useDeferredValue:Lt,useTransition:Lt,useMutableSource:Lt,useSyncExternalStore:Lt,useId:Lt,unstable_isNewReconciler:!1},$D={readContext:Jn,useCallback:function(e,t){return Tr().memoizedState=[e,t===void 0?null:t],e},useContext:Jn,useEffect:wS,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Gf(4194308,4,ik.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Gf(4194308,4,e,t)},useInsertionEffect:function(e,t){return Gf(4,2,e,t)},useMemo:function(e,t){var n=Tr();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Tr();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=kD.bind(null,nt,e),[r.memoizedState,e]},useRef:function(e){var t=Tr();return e={current:e},t.memoizedState=e},useState:bS,useDebugValue:F_,useDeferredValue:function(e){return Tr().memoizedState=e},useTransition:function(){var e=bS(!1),t=e[0];return e=RD.bind(null,e[1]),Tr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=nt,o=Tr();if(Je){if(n===void 0)throw Error(J(407));n=n()}else{if(n=t(),Ot===null)throw Error(J(349));Pa&30||XR(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,wS(JR.bind(null,r,i,e),[e]),r.flags|=2048,Pc(9,ZR.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Tr(),t=Ot.identifierPrefix;if(Je){var n=go,r=ho;n=(r&~(1<<32-wr(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Tc++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[Fr]=t,e[Oc]=r,Sk(e,t,!1,!1),t.stateNode=e;e:{switch(a=cv(n,r),n){case"dialog":We("cancel",e),We("close",e),o=r;break;case"iframe":case"object":case"embed":We("load",e),o=r;break;case"video":case"audio":for(o=0;oxl&&(t.flags|=128,r=!0,wu(i,!1),t.lanes=4194304)}else{if(!r)if(e=Ip(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),wu(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!Je)return It(t),null}else 2*lt()-i.renderingStartTime>xl&&n!==1073741824&&(t.flags|=128,r=!0,wu(i,!1),t.lanes=4194304);i.isBackwards?(a.sibling=t.child,t.child=a):(n=i.last,n!==null?n.sibling=a:t.child=a,i.last=a)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=lt(),t.sibling=null,n=tt.current,He(tt,r?n&1|2:n&1),t):(It(t),null);case 22:case 23:return W_(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?An&1073741824&&(It(t),t.subtreeFlags&6&&(t.flags|=8192)):It(t),null;case 24:return null;case 25:return null}throw Error(J(156,t.tag))}function FD(e,t){switch(A_(t),t.tag){case 1:return hn(t.type)&&Tp(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return wl(),Ye(pn),Ye(Vt),j_(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return M_(t),null;case 13:if(Ye(tt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(J(340));_l()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ye(tt),null;case 4:return wl(),null;case 10:return k_(t.type._context),null;case 22:case 23:return W_(),null;case 24:return null;default:return null}}var uf=!1,Ut=!1,UD=typeof WeakSet=="function"?WeakSet:Set,de=null;function Os(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){it(e,t,r)}else n.current=null}function Iv(e,t,n){try{n()}catch(r){it(e,t,r)}}var TS=!1;function VD(e,t){if(bv=Cp,e=RR(),x_(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 o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var a=0,s=-1,l=-1,u=0,c=0,d=e,f=null;t:for(;;){for(var p;d!==n||o!==0&&d.nodeType!==3||(s=a+o),d!==i||r!==0&&d.nodeType!==3||(l=a+r),d.nodeType===3&&(a+=d.nodeValue.length),(p=d.firstChild)!==null;)f=d,d=p;for(;;){if(d===e)break t;if(f===n&&++u===o&&(s=a),f===i&&++c===r&&(l=a),(p=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=p}n=s===-1||l===-1?null:{start:s,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(wv={focusedElem:e,selectionRange:n},Cp=!1,de=t;de!==null;)if(t=de,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,de=e;else for(;de!==null;){t=de;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 v=g.memoizedProps,_=g.memoizedState,m=t.stateNode,h=m.getSnapshotBeforeUpdate(t.elementType===t.type?v:cr(t.type,v),_);m.__reactInternalSnapshotBeforeUpdate=h}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(J(163))}}catch(b){it(t,t.return,b)}if(e=t.sibling,e!==null){e.return=t.return,de=e;break}de=t.return}return g=TS,TS=!1,g}function oc(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&Iv(t,n,i)}o=o.next}while(o!==r)}}function w0(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 Dv(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 Ak(e){var t=e.alternate;t!==null&&(e.alternate=null,Ak(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Fr],delete t[Oc],delete t[Ev],delete t[xD],delete t[ED])),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 Ck(e){return e.tag===5||e.tag===3||e.tag===4}function $S(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Ck(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 Fv(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=kp));else if(r!==4&&(e=e.child,e!==null))for(Fv(e,t,n),e=e.sibling;e!==null;)Fv(e,t,n),e=e.sibling}function Uv(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(Uv(e,t,n),e=e.sibling;e!==null;)Uv(e,t,n),e=e.sibling}var Pt=null,fr=!1;function Vo(e,t,n){for(n=n.child;n!==null;)Ok(e,t,n),n=n.sibling}function Ok(e,t,n){if(Hr&&typeof Hr.onCommitFiberUnmount=="function")try{Hr.onCommitFiberUnmount(p0,n)}catch{}switch(n.tag){case 5:Ut||Os(n,t);case 6:var r=Pt,o=fr;Pt=null,Vo(e,t,n),Pt=r,fr=o,Pt!==null&&(fr?(e=Pt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Pt.removeChild(n.stateNode));break;case 18:Pt!==null&&(fr?(e=Pt,n=n.stateNode,e.nodeType===8?rm(e.parentNode,n):e.nodeType===1&&rm(e,n),Sc(e)):rm(Pt,n.stateNode));break;case 4:r=Pt,o=fr,Pt=n.stateNode.containerInfo,fr=!0,Vo(e,t,n),Pt=r,fr=o;break;case 0:case 11:case 14:case 15:if(!Ut&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,a=i.destroy;i=i.tag,a!==void 0&&(i&2||i&4)&&Iv(n,t,a),o=o.next}while(o!==r)}Vo(e,t,n);break;case 1:if(!Ut&&(Os(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){it(n,t,s)}Vo(e,t,n);break;case 21:Vo(e,t,n);break;case 22:n.mode&1?(Ut=(r=Ut)||n.memoizedState!==null,Vo(e,t,n),Ut=r):Vo(e,t,n);break;default:Vo(e,t,n)}}function PS(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new UD),t.forEach(function(r){var o=QD.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function sr(e,t){var n=t.deletions;if(n!==null)for(var r=0;ro&&(o=a),r&=~i}if(r=o,r=lt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*BD(r/1960))-r,10e?16:e,ci===null)var r=!1;else{if(e=ci,ci=null,zp=0,Me&6)throw Error(J(331));var o=Me;for(Me|=4,de=e.current;de!==null;){var i=de,a=i.child;if(de.flags&16){var s=i.deletions;if(s!==null){for(var l=0;llt()-B_?Sa(e,0):z_|=n),gn(e,t)}function Nk(e,t){t===0&&(e.mode&1?(t=Jd,Jd<<=1,!(Jd&130023424)&&(Jd=4194304)):t=1);var n=Xt();e=wo(e,t),e!==null&&(md(e,t,n),gn(e,n))}function YD(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Nk(e,n)}function QD(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(J(314))}r!==null&&r.delete(t),Nk(e,n)}var Lk;Lk=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||pn.current)fn=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return fn=!1,ID(e,t,n);fn=!!(e.flags&131072)}else fn=!1,Je&&t.flags&1048576&&FR(t,Mp,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Kf(e,t),e=t.pendingProps;var o=vl(t,Vt.current);qs(t,n),o=L_(null,t,r,e,o,n);var i=I_();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,hn(r)?(i=!0,$p(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,$_(t),o.updater=_0,t.stateNode=o,o._reactInternals=t,Tv(t,r,e,n),t=Mv(null,t,r,!0,i,n)):(t.tag=0,Je&&i&&E_(t),Gt(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Kf(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=ZD(r),e=cr(r,e),o){case 0:t=Pv(null,t,r,e,n);break e;case 1:t=OS(null,t,r,e,n);break e;case 11:t=AS(null,t,r,e,n);break e;case 14:t=CS(null,t,r,cr(r.type,e),n);break e}throw Error(J(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:cr(r,o),Pv(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:cr(r,o),OS(e,t,r,o,n);case 3:e:{if(_k(t),e===null)throw Error(J(387));r=t.pendingProps,i=t.memoizedState,o=i.element,BR(e,t),Lp(t,r,null,n);var a=t.memoizedState;if(r=a.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=Sl(Error(J(423)),t),t=RS(e,t,r,n,o);break e}else if(r!==o){o=Sl(Error(J(424)),t),t=RS(e,t,r,n,o);break e}else for(Cn=yi(t.stateNode.containerInfo.firstChild),Rn=t,Je=!0,hr=null,n=GR(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(_l(),r===o){t=So(e,t,n);break e}Gt(e,t,r,n)}t=t.child}return t;case 5:return KR(t),e===null&&Ov(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,a=o.children,Sv(r,o)?a=null:i!==null&&Sv(r,i)&&(t.flags|=32),vk(e,t),Gt(e,t,a,n),t.child;case 6:return e===null&&Ov(t),null;case 13:return bk(e,t,n);case 4:return P_(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=bl(t,null,r,n):Gt(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:cr(r,o),AS(e,t,r,o,n);case 7:return Gt(e,t,t.pendingProps,n),t.child;case 8:return Gt(e,t,t.pendingProps.children,n),t.child;case 12:return Gt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,a=o.value,He(jp,r._currentValue),r._currentValue=a,i!==null)if(Er(i.value,a)){if(i.children===o.children&&!pn.current){t=So(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var s=i.dependencies;if(s!==null){a=i.child;for(var l=s.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=vo(-1,n&-n),l.tag=2;var u=i.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}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),Rv(i.return,n,t),s.lanes|=n;break}l=l.next}}else if(i.tag===10)a=i.type===t.type?null:i.child;else if(i.tag===18){if(a=i.return,a===null)throw Error(J(341));a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),Rv(a,n,t),a=i.sibling}else a=i.child;if(a!==null)a.return=i;else for(a=i;a!==null;){if(a===t){a=null;break}if(i=a.sibling,i!==null){i.return=a.return,a=i;break}a=a.return}i=a}Gt(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,qs(t,n),o=Jn(o),r=r(o),t.flags|=1,Gt(e,t,r,n),t.child;case 14:return r=t.type,o=cr(r,t.pendingProps),o=cr(r.type,o),CS(e,t,r,o,n);case 15:return mk(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:cr(r,o),Kf(e,t),t.tag=1,hn(r)?(e=!0,$p(t)):e=!1,qs(t,n),WR(t,r,o),Tv(t,r,o,n),Mv(null,t,r,!0,e,n);case 19:return wk(e,t,n);case 22:return yk(e,t,n)}throw Error(J(156,t.tag))};function Ik(e,t){return uR(e,t)}function XD(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 Qn(e,t,n,r){return new XD(e,t,n,r)}function G_(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ZD(e){if(typeof e=="function")return G_(e)?1:0;if(e!=null){if(e=e.$$typeof,e===f_)return 11;if(e===p_)return 14}return 2}function wi(e,t){var n=e.alternate;return n===null?(n=Qn(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 Xf(e,t,n,r,o,i){var a=2;if(r=e,typeof e=="function")G_(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case vs:return xa(n.children,o,i,t);case d_:a=8,o|=8;break;case ev:return e=Qn(12,n,t,o|2),e.elementType=ev,e.lanes=i,e;case tv:return e=Qn(13,n,t,o),e.elementType=tv,e.lanes=i,e;case nv:return e=Qn(19,n,t,o),e.elementType=nv,e.lanes=i,e;case qO:return x0(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case HO:a=10;break e;case WO:a=9;break e;case f_:a=11;break e;case p_:a=14;break e;case Wo:a=16,r=null;break e}throw Error(J(130,e==null?e:typeof e,""))}return t=Qn(a,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function xa(e,t,n,r){return e=Qn(7,e,r,t),e.lanes=n,e}function x0(e,t,n,r){return e=Qn(22,e,r,t),e.elementType=qO,e.lanes=n,e.stateNode={isHidden:!1},e}function dm(e,t,n){return e=Qn(6,e,null,t),e.lanes=n,e}function fm(e,t,n){return t=Qn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function JD(e,t,n,r,o){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=qg(0),this.expirationTimes=qg(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=qg(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function K_(e,t,n,r,o,i,a,s,l){return e=new JD(e,t,n,s,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Qn(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},$_(i),e}function eF(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Vk)}catch(e){console.error(e)}}Vk(),FO.exports=$n;var zk=FO.exports;const iF=ko(zk);var US=zk;Zy.createRoot=US.createRoot,Zy.hydrateRoot=US.hydrateRoot;function aF(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 pm={exports:{}};const sF={},lF=Object.freeze(Object.defineProperty({__proto__:null,default:sF},Symbol.toStringTag,{value:"Module"})),uF=ML(lF);var VS;function R0(){return VS||(VS=1,function(e,t){(function(n,r){e.exports=r()})(oa,function(){var n=n||function(r,o){var i;if(typeof window<"u"&&window.crypto&&(i=window.crypto),typeof self<"u"&&self.crypto&&(i=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(i=globalThis.crypto),!i&&typeof window<"u"&&window.msCrypto&&(i=window.msCrypto),!i&&typeof oa<"u"&&oa.crypto&&(i=oa.crypto),!i&&typeof aF=="function")try{i=uF}catch{}var a=function(){if(i){if(typeof i.getRandomValues=="function")try{return i.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof i.randomBytes=="function")try{return i.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},s=Object.create||function(){function h(){}return function(y){var b;return h.prototype=y,b=new h,h.prototype=null,b}}(),l={},u=l.lib={},c=u.Base=function(){return{extend:function(h){var y=s(this);return h&&y.mixIn(h),(!y.hasOwnProperty("init")||this.init===y.init)&&(y.init=function(){y.$super.init.apply(this,arguments)}),y.init.prototype=y,y.$super=this,y},create:function(){var h=this.extend();return h.init.apply(h,arguments),h},init:function(){},mixIn:function(h){for(var y in h)h.hasOwnProperty(y)&&(this[y]=h[y]);h.hasOwnProperty("toString")&&(this.toString=h.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),d=u.WordArray=c.extend({init:function(h,y){h=this.words=h||[],y!=o?this.sigBytes=y:this.sigBytes=h.length*4},toString:function(h){return(h||p).stringify(this)},concat:function(h){var y=this.words,b=h.words,S=this.sigBytes,x=h.sigBytes;if(this.clamp(),S%4)for(var A=0;A>>2]>>>24-A%4*8&255;y[S+A>>>2]|=O<<24-(S+A)%4*8}else for(var R=0;R>>2]=b[R>>>2];return this.sigBytes+=x,this},clamp:function(){var h=this.words,y=this.sigBytes;h[y>>>2]&=4294967295<<32-y%4*8,h.length=r.ceil(y/4)},clone:function(){var h=c.clone.call(this);return h.words=this.words.slice(0),h},random:function(h){for(var y=[],b=0;b>>2]>>>24-x%4*8&255;S.push((A>>>4).toString(16)),S.push((A&15).toString(16))}return S.join("")},parse:function(h){for(var y=h.length,b=[],S=0;S>>3]|=parseInt(h.substr(S,2),16)<<24-S%8*4;return new d.init(b,y/2)}},g=f.Latin1={stringify:function(h){for(var y=h.words,b=h.sigBytes,S=[],x=0;x>>2]>>>24-x%4*8&255;S.push(String.fromCharCode(A))}return S.join("")},parse:function(h){for(var y=h.length,b=[],S=0;S>>2]|=(h.charCodeAt(S)&255)<<24-S%4*8;return new d.init(b,y)}},v=f.Utf8={stringify:function(h){try{return decodeURIComponent(escape(g.stringify(h)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(h){return g.parse(unescape(encodeURIComponent(h)))}},_=u.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new d.init,this._nDataBytes=0},_append:function(h){typeof h=="string"&&(h=v.parse(h)),this._data.concat(h),this._nDataBytes+=h.sigBytes},_process:function(h){var y,b=this._data,S=b.words,x=b.sigBytes,A=this.blockSize,O=A*4,R=x/O;h?R=r.ceil(R):R=r.max((R|0)-this._minBufferSize,0);var C=R*A,T=r.min(C*4,x);if(C){for(var k=0;k>>7)^(R<<14|R>>>18)^R>>>3,T=d[O-2],k=(T<<15|T>>>17)^(T<<13|T>>>19)^T>>>10;d[O]=C+d[O-7]+k+d[O-16]}var $=b&S^~b&x,D=_&m^_&h^m&h,N=(_<<30|_>>>2)^(_<<19|_>>>13)^(_<<10|_>>>22),W=(b<<26|b>>>6)^(b<<21|b>>>11)^(b<<7|b>>>25),Q=A+W+$+c[O]+d[O],V=N+D;A=x,x=S,S=b,b=y+Q|0,y=h,h=m,m=_,_=Q+V|0}v[0]=v[0]+_|0,v[1]=v[1]+m|0,v[2]=v[2]+h|0,v[3]=v[3]+y|0,v[4]=v[4]+b|0,v[5]=v[5]+S|0,v[6]=v[6]+x|0,v[7]=v[7]+A|0},_doFinalize:function(){var p=this._data,g=p.words,v=this._nDataBytes*8,_=p.sigBytes*8;return g[_>>>5]|=128<<24-_%32,g[(_+64>>>9<<4)+14]=r.floor(v/4294967296),g[(_+64>>>9<<4)+15]=v,p.sigBytes=g.length*4,this._process(),this._hash},clone:function(){var p=s.clone.call(this);return p._hash=this._hash.clone(),p}});o.SHA256=s._createHelper(f),o.HmacSHA256=s._createHmacHelper(f)}(Math),n.SHA256})})(Bk);var fF=Bk.exports;const pF=ko(fF);var Hk={exports:{}};(function(e,t){(function(n,r){e.exports=r(R0())})(oa,function(n){return function(){var r=n,o=r.lib,i=o.WordArray,a=r.enc;a.Base64={stringify:function(l){var u=l.words,c=l.sigBytes,d=this._map;l.clamp();for(var f=[],p=0;p>>2]>>>24-p%4*8&255,v=u[p+1>>>2]>>>24-(p+1)%4*8&255,_=u[p+2>>>2]>>>24-(p+2)%4*8&255,m=g<<16|v<<8|_,h=0;h<4&&p+h*.75>>6*(3-h)&63));var y=d.charAt(64);if(y)for(;f.length%4;)f.push(y);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-p%4*2,_=g|v;d[f>>>2]|=_<<24-f%4*8,f++}return i.create(d,f)}}(),n.enc.Base64})})(Hk);var hF=Hk.exports;const zS=ko(hF);var Wk={exports:{}};(function(e,t){(function(n,r){e.exports=r(R0())})(oa,function(n){return n.enc.Utf8})})(Wk);var gF=Wk.exports;const mF=ko(gF);function Wv(e){this.message=e}Wv.prototype=new Error,Wv.prototype.name="InvalidCharacterError";var BS=typeof window<"u"&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new Wv("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,r,o=0,i=0,a="";r=t.charAt(i++);~r&&(n=o%4?64*n+r:r,o++%4)?a+=String.fromCharCode(255&n>>(-2*o&6)):0)r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);return a};function yF(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(BS(n).replace(/(.)/g,function(r,o){var i=o.charCodeAt(0).toString(16).toUpperCase();return i.length<2&&(i="0"+i),"%"+i}))}(t)}catch{return BS(t)}}function Wp(e){this.message=e}function vF(e,t){if(typeof e!="string")throw new Wp("Invalid token specified");var n=(t=t||{}).header===!0?0:1;try{return JSON.parse(yF(e.split(".")[n]))}catch(r){throw new Wp("Invalid token specified: "+r.message)}}Wp.prototype=new Error,Wp.prototype.name="InvalidTokenError";var _F={debug:()=>{},info:()=>{},warn:()=>{},error:()=>{}},$r,Pr,qp=(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))(qp||{});(e=>{function t(){$r=3,Pr=_F}e.reset=t;function n(o){if(!(0<=o&&o<=4))throw new Error("Invalid log level");$r=o}e.setLevel=n;function r(o){Pr=o}e.setLogger=r})(qp||(qp={}));var Se=class{constructor(e){this._name=e}debug(...e){$r>=4&&Pr.debug(Se._format(this._name,this._method),...e)}info(...e){$r>=3&&Pr.info(Se._format(this._name,this._method),...e)}warn(...e){$r>=2&&Pr.warn(Se._format(this._name,this._method),...e)}error(...e){$r>=1&&Pr.error(Se._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 Se(`${e}.${t}`);return n.debug("begin"),n}static _format(e,t){const n=`[${e}]`;return t?`${n} ${t}:`:n}static debug(e,...t){$r>=4&&Pr.debug(Se._format(e),...t)}static info(e,...t){$r>=3&&Pr.info(Se._format(e),...t)}static warn(e,...t){$r>=2&&Pr.warn(Se._format(e),...t)}static error(e,...t){$r>=1&&Pr.error(Se._format(e),...t)}};qp.reset();var bF="10000000-1000-4000-8000-100000000000",Vr=class{static _randomWord(){return dF.lib.WordArray.random(1).words[0]}static generateUUIDv4(){return bF.replace(/[018]/g,t=>(+t^Vr._randomWord()&15>>+t/4).toString(16)).replace(/-/g,"")}static generateCodeVerifier(){return Vr.generateUUIDv4()+Vr.generateUUIDv4()+Vr.generateUUIDv4()}static generateCodeChallenge(e){try{const t=pF(e);return zS.stringify(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}catch(t){throw Se.error("CryptoUtils.generateCodeChallenge",t),t}}static generateBasicAuth(e,t){const n=mF.parse([e,t].join(":"));return zS.stringify(n)}},Go=class{constructor(e){this._name=e,this._logger=new Se(`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)}},qv=class{static decode(e){try{return vF(e)}catch(t){throw Se.error("JwtUtils.decode",t),t}}},HS=class{static center({...e}){var t,n,r;return e.width==null&&(e.width=(t=[800,720,600,480].find(o=>o<=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(",")}},Zn=class extends Go{constructor(){super(...arguments),this._logger=new Se(`Timer('${this._name}')`),this._timerHandle=null,this._expiration=0,this._callback=()=>{const e=this._expiration-Zn.getEpochTime();this._logger.debug("timer completes in",e),this._expiration<=Zn.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=Zn.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)}},Gv=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))}},Kv=";",Na=class extends Error{constructor(e,t){var n,r,o;if(super(e.error_description||e.error||""),this.form=t,this.name="ErrorResponse",!e.error)throw Se.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=(o=e.session_state)!=null?o:null,this.url_state=e.url_state}},Z_=class extends Error{constructor(e){super(e),this.name="ErrorTimeout"}},wF=class{constructor(e){this._logger=new Se("AccessTokenEvents"),this._expiringTimer=new Zn("Access token expiring"),this._expiredTimer=new Zn("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 o=n-this._expiringNotificationTimeInSeconds;o<=0&&(o=1),t.debug("registering expiring timer, raising in",o,"seconds"),this._expiringTimer.init(o)}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)}},SF=class{constructor(e,t,n,r,o){this._callback=e,this._client_id=t,this._intervalInSeconds=r,this._stopOnError=o,this._logger=new Se("CheckSessionIFrame"),this._timer=null,this._session_state=null,this._message=a=>{a.origin===this._frame_origin&&a.source===this._frame.contentWindow&&(a.data==="error"?(this._logger.error("error message from check session op iframe"),this._stopOnError&&this.stop()):a.data==="changed"?(this._logger.debug("changed message from check session op iframe"),this.stop(),this._callback()):this._logger.debug(a.data+" message from check session op iframe"))};const i=new URL(n);this._frame_origin=i.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=i.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)}},qk=class{constructor(){this._logger=new Se("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]}},J_=class{constructor(e=[],t=null,n={}){this._jwtHandler=t,this._extraHeaders=n,this._logger=new Se("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 o=new AbortController,i=setTimeout(()=>o.abort(),n*1e3);try{return await fetch(e,{...t,signal:o.signal})}catch(a){throw a instanceof DOMException&&a.name==="AbortError"?new Z_("Network timed out"):a}finally{clearTimeout(i)}}async getJson(e,{token:t,credentials:n}={}){const r=this._logger.create("getJson"),o={Accept:this._contentTypes.join(", ")};t&&(r.debug("token passed, setting Authorization header"),o.Authorization="Bearer "+t),this.appendExtraHeaders(o);let i;try{r.debug("url:",e),i=await this.fetchWithTimeout(e,{method:"GET",headers:o,credentials:n})}catch(l){throw r.error("Network Error"),l}r.debug("HTTP response received, status",i.status);const a=i.headers.get("Content-Type");if(a&&!this._contentTypes.find(l=>a.startsWith(l))&&r.throw(new Error(`Invalid response Content-Type: ${a??"undefined"}, from URL: ${e}`)),i.ok&&this._jwtHandler&&(a!=null&&a.startsWith("application/jwt")))return await this._jwtHandler(await i.text());let s;try{s=await i.json()}catch(l){throw r.error("Error parsing JSON response",l),i.ok?l:new Error(`${i.statusText} (${i.status})`)}if(!i.ok)throw r.error("Error from server:",s),s.error?new Na(s):new Error(`${i.statusText} (${i.status}): ${JSON.stringify(s)}`);return s}async postForm(e,{body:t,basicAuth:n,timeoutInSeconds:r,initCredentials:o}){const i=this._logger.create("postForm"),a={Accept:this._contentTypes.join(", "),"Content-Type":"application/x-www-form-urlencoded"};n!==void 0&&(a.Authorization="Basic "+n),this.appendExtraHeaders(a);let s;try{i.debug("url:",e),s=await this.fetchWithTimeout(e,{method:"POST",headers:a,body:t,timeoutInSeconds:r,credentials:o})}catch(d){throw i.error("Network error"),d}i.debug("HTTP response received, status",s.status);const l=s.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 s.text();let c={};if(u)try{c=JSON.parse(u)}catch(d){throw i.error("Error parsing JSON response",d),s.ok?d:new Error(`${s.statusText} (${s.status})`)}if(!s.ok)throw i.error("Error from server:",c),c.error?new Na(c,t):new Error(`${s.statusText} (${s.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(o=>{if(r.includes(o.toLocaleLowerCase())){t.warn("Protected header could not be overridden",o,r);return}const i=typeof this._extraHeaders[o]=="function"?this._extraHeaders[o]():this._extraHeaders[o];i&&i!==""&&(e[o]=i)})}},xF=class{constructor(e){this._settings=e,this._logger=new Se("MetadataService"),this._signingKeys=null,this._metadata=null,this._metadataUrl=this._settings.metadataUrl,this._jsonService=new J_(["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}},Gk=class{constructor({prefix:e="oidc.",store:t=localStorage}={}){this._logger=new Se("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 o=qv.decode(n);return r.debug("JWT decoding successful"),o}catch(o){throw r.error("Error parsing JWT response"),o}},this._jsonService=new J_(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}},Kk=class{constructor(e,t){this._settings=e,this._metadataService=t,this._logger=new Se("TokenClient"),this._jsonService=new J_(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,...o}){const i=this._logger.create("exchangeCode");n||i.throw(new Error("A client_id is required")),t||i.throw(new Error("A redirect_uri is required")),o.code||i.throw(new Error("A code is required"));const a=new URLSearchParams({grant_type:e,redirect_uri:t});for(const[c,d]of Object.entries(o))d!=null&&a.set(c,d);let s;switch(this._settings.client_authentication){case"client_secret_basic":if(!r)throw i.throw(new Error("A client_secret is required")),null;s=Vr.generateBasicAuth(n,r);break;case"client_secret_post":a.append("client_id",n),r&&a.append("client_secret",r);break}const l=await this._metadataService.getTokenEndpoint(!1);i.debug("got token endpoint");const u=await this._jsonService.postForm(l,{body:a,basicAuth:s,initCredentials:this._settings.fetchRequestCredentials});return i.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,...o}){const i=this._logger.create("exchangeCredentials");t||i.throw(new Error("A client_id is required"));const a=new URLSearchParams({grant_type:e,scope:r});for(const[c,d]of Object.entries(o))d!=null&&a.set(c,d);let s;switch(this._settings.client_authentication){case"client_secret_basic":if(!n)throw i.throw(new Error("A client_secret is required")),null;s=Vr.generateBasicAuth(t,n);break;case"client_secret_post":a.append("client_id",t),n&&a.append("client_secret",n);break}const l=await this._metadataService.getTokenEndpoint(!1);i.debug("got token endpoint");const u=await this._jsonService.postForm(l,{body:a,basicAuth:s,initCredentials:this._settings.fetchRequestCredentials});return i.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,...o}){const i=this._logger.create("exchangeRefreshToken");t||i.throw(new Error("A client_id is required")),o.refresh_token||i.throw(new Error("A refresh_token is required"));const a=new URLSearchParams({grant_type:e});for(const[c,d]of Object.entries(o))Array.isArray(d)?d.forEach(f=>a.append(c,f)):d!=null&&a.set(c,d);let s;switch(this._settings.client_authentication){case"client_secret_basic":if(!n)throw i.throw(new Error("A client_secret is required")),null;s=Vr.generateBasicAuth(t,n);break;case"client_secret_post":a.append("client_id",t),n&&a.append("client_secret",n);break}const l=await this._metadataService.getTokenEndpoint(!1);i.debug("got token endpoint");const u=await this._jsonService.postForm(l,{body:a,basicAuth:s,timeoutInSeconds:r,initCredentials:this._settings.fetchRequestCredentials});return i.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 o=new URLSearchParams;for(const[i,a]of Object.entries(e))a!=null&&o.set(i,a);o.set("client_id",this._settings.client_id),this._settings.client_secret&&o.set("client_secret",this._settings.client_secret),await this._jsonService.postForm(r,{body:o}),n.debug("got response")}},$F=class{constructor(e,t,n){this._settings=e,this._metadataService=t,this._claimsService=n,this._logger=new Se("ResponseValidator"),this._userInfoService=new TF(this._settings,this._metadataService),this._tokenClient=new Kk(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 o=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),o.debug("ID Token validated")),e.id_token||(e.id_token=t.id_token,e.profile=t.profile);const i=e.isOpenId&&!!e.id_token;await this._processClaims(e,!1,i),o.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 Na(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 Na(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 o=await this._userInfoService.getClaims(e.access_token);r.debug("user info claims received from user info endpoint"),n&&o.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(o)),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 o=qv.decode((n=e.id_token)!=null?n:"");if(o.sub||r.throw(new Error("ID Token is missing a subject claim")),t){const i=qv.decode(t);o.sub!==i.sub&&r.throw(new Error("sub in id_token does not match current sub")),o.auth_time&&o.auth_time!==i.auth_time&&r.throw(new Error("auth_time in id_token does not match original auth_time")),o.azp&&o.azp!==i.azp&&r.throw(new Error("azp in id_token does not match original azp")),!o.azp&&i.azp&&r.throw(new Error("azp not in id_token, but present in original id_token"))}e.profile=o}},El=class{constructor(e){this.id=e.id||Vr.generateUUIDv4(),this.data=e.data,e.created&&e.created>0?this.created=e.created:this.created=Zn.getEpochTime(),this.request_type=e.request_type,this.url_state=e.url_state}toStorageString(){return new Se("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 Se.createStatic("State","fromStorageString"),new El(JSON.parse(e))}static async clearStaleState(e,t){const n=Se.createStatic("State","clearStaleState"),r=Zn.getEpochTime()-t,o=await e.getAllKeys();n.debug("got keys",o);for(let i=0;ih.searchParams.append("resource",S));for(const[b,S]of Object.entries({response_mode:s,...m,...g}))S!=null&&h.searchParams.append(b,S.toString());this.url=h.href}},MF="openid",hm=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(Kv);this.state=t[0],t.length>1&&(this.url_state=t.slice(1).join(Kv))}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-Zn.getEpochTime()}set expires_in(e){typeof e=="string"&&(e=Number(e)),e!==void 0&&e>=0&&(this.expires_at=Math.floor(e)+Zn.getEpochTime())}get isOpenId(){var e;return((e=this.scope)==null?void 0:e.split(" ").includes(MF))||!!this.id_token}},jF=class{constructor({url:e,state_data:t,id_token_hint:n,post_logout_redirect_uri:r,extraQueryParams:o,request_type:i,client_id:a}){if(this._logger=new Se("SignoutRequest"),!e)throw this._logger.error("ctor: No url passed"),new Error("url");const s=new URL(e);n&&s.searchParams.append("id_token_hint",n),a&&s.searchParams.append("client_id",a),r&&(s.searchParams.append("post_logout_redirect_uri",r),t&&(this.state=new El({data:t,request_type:i}),s.searchParams.append("state",this.state.id)));for(const[l,u]of Object.entries({...o}))u!=null&&s.searchParams.append(l,u.toString());this.url=s.href}},NF=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")}},LF=["nbf","jti","auth_time","nonce","acr","amr","azp","at_hash"],IF=["sub","iss","aud","exp","iat"],DF=class{constructor(e){this._settings=e,this._logger=new Se("ClaimsService")}filterProtocolClaims(e){const t={...e};if(this._settings.filterProtocolClaims){let n;Array.isArray(this._settings.filterProtocolClaims)?n=this._settings.filterProtocolClaims:n=LF;for(const r of n)IF.includes(r)||delete t[r]}return t}mergeClaims(e,t){const n={...e};for(const[r,o]of Object.entries(t))for(const i of Array.isArray(o)?o:[o]){const a=n[r];a===void 0?n[r]=i:Array.isArray(a)?a.includes(i)||a.push(i):n[r]!==i&&(typeof i=="object"&&this._settings.mergeClaims?n[r]=this.mergeClaims(a,i):n[r]=[a,i])}return n}},FF=class{constructor(e,t){this._logger=new Se("OidcClient"),this.settings=e instanceof Yv?e:new Yv(e),this.metadataService=t??new xF(this.settings),this._claimsService=new DF(this.settings),this._validator=new $F(this.settings,this.metadataService,this._claimsService),this._tokenClient=new Kk(this.settings,this.metadataService)}async createSigninRequest({state:e,request:t,request_uri:n,request_type:r,id_token_hint:o,login_hint:i,skipUserInfo:a,nonce:s,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:p=this.settings.display,max_age:g=this.settings.max_age,ui_locales:v=this.settings.ui_locales,acr_values:_=this.settings.acr_values,resource:m=this.settings.resource,response_mode:h=this.settings.response_mode,extraQueryParams:y=this.settings.extraQueryParams,extraTokenParams:b=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 x=await this.metadataService.getAuthorizationEndpoint();S.debug("Received authorization endpoint",x);const A=new PF({url:x,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:p,max_age:g,ui_locales:v,id_token_hint:o,login_hint:i,acr_values:_,resource:m,request:t,request_uri:n,extraQueryParams:y,extraTokenParams:b,request_type:r,response_mode:h,client_secret:this.settings.client_secret,skipUserInfo:a,nonce:s,disablePKCE:this.settings.disablePKCE});await this.clearStaleState();const O=A.state;return await this.settings.stateStore.set(O.id,O.toStorageString()),A}async readSigninResponseState(e,t=!1){const n=this._logger.create("readSigninResponseState"),r=new hm(Gv.readParams(e,this.settings.response_mode));if(!r.state)throw n.throw(new Error("No state in response")),null;const o=await this.settings.stateStore[t?"remove":"get"](r.state);if(!o)throw n.throw(new Error("No matching state found in storage")),null;return{state:eb.fromStorageString(o),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 o=await this._tokenClient.exchangeCredentials({username:e,password:t,...r}),i=new hm(new URLSearchParams);return Object.assign(i,o),await this._validator.validateCredentialsResponse(i,n),i}async useRefreshToken({state:e,timeoutInSeconds:t}){var n;const r=this._logger.create("useRefreshToken");let o;if(this.settings.refreshTokenAllowedScope===void 0)o=e.scope;else{const s=this.settings.refreshTokenAllowedScope.split(" ");o=(((n=e.scope)==null?void 0:n.split(" "))||[]).filter(u=>s.includes(u)).join(" ")}const i=await this._tokenClient.exchangeRefreshToken({refresh_token:e.refresh_token,resource:e.resource,scope:o,timeoutInSeconds:t}),a=new hm(new URLSearchParams);return Object.assign(a,i),r.debug("validating response",a),await this._validator.validateRefreshResponse(a,{...e,scope:o}),a}async createSignoutRequest({state:e,id_token_hint:t,client_id:n,request_type:r,post_logout_redirect_uri:o=this.settings.post_logout_redirect_uri,extraQueryParams:i=this.settings.extraQueryParams}={}){const a=this._logger.create("createSignoutRequest"),s=await this.metadataService.getEndSessionEndpoint();if(!s)throw a.throw(new Error("No end session endpoint")),null;a.debug("Received end session endpoint",s),!n&&o&&!t&&(n=this.settings.client_id);const l=new jF({url:s,id_token_hint:t,client_id:n,post_logout_redirect_uri:o,state_data:e,extraQueryParams:i,request_type:r});await this.clearStaleState();const u=l.state;return u&&(a.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 NF(Gv.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 Na(r);return{state:void 0,response:r}}const o=await this.settings.stateStore[t?"remove":"get"](r.state);if(!o)throw n.throw(new Error("No matching state found in storage")),null;return{state:El.fromStorageString(o),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"),El.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})}},UF=class{constructor(e){this._userManager=e,this._logger=new Se("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 o=await this._userManager.metadataService.getCheckSessionIframe();if(o){r.debug("initializing check session iframe");const i=this._userManager.settings.client_id,a=this._userManager.settings.checkSessionIntervalInSeconds,s=this._userManager.settings.stopCheckSessionOnError,l=new SF(this._callback,i,o,a,s);await l.load(),this._checkSessionIFrame=l,l.start(n)}else r.warn("no check session iframe found in the metadata")}catch(o){r.error("Error from getCheckSessionIframe:",o instanceof Error?o.message:o)}},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 o={session_state:r.session_state,profile:r.sub&&r.sid?{sub:r.sub,sid:r.sid}:null};this._start(o)}}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)}}}},Zf=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-Zn.getEpochTime()}set expires_in(e){e!==void 0&&(this.expires_at=Math.floor(e)+Zn.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 Se("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 Se.createStatic("User","fromStorageString"),new Zf(JSON.parse(e))}},WS="oidc-client",Yk=class{constructor(){this._abort=new Go("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((o,i)=>{const a=s=>{var l;const u=s.data,c=(l=e.scriptOrigin)!=null?l:window.location.origin;if(!(s.origin!==c||(u==null?void 0:u.source)!==WS)){try{const d=Gv.readParams(u.url,e.response_mode).get("state");if(d||t.warn("no state found in response url"),s.source!==this._window&&d!==e.state)return}catch{this._dispose(),i(new Error("Invalid response from window"))}o(u)}};window.addEventListener("message",a,!1),this._disposeHandlers.add(()=>window.removeEventListener("message",a,!1)),this._disposeHandlers.add(this._abort.addHandler(s=>{this._dispose(),i(s)}))});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:WS,url:t,keepOpen:n},r)}},Qk={location:!1,toolbar:!1,height:640,closePopupWindowAfterInSeconds:-1},Xk="_blank",VF=60,zF=2,Zk=10,BF=class extends Yv{constructor(e){const{popup_redirect_uri:t=e.redirect_uri,popup_post_logout_redirect_uri:n=e.post_logout_redirect_uri,popupWindowFeatures:r=Qk,popupWindowTarget:o=Xk,redirectMethod:i="assign",redirectTarget:a="self",iframeNotifyParentOrigin:s=e.iframeNotifyParentOrigin,iframeScriptOrigin:l=e.iframeScriptOrigin,silent_redirect_uri:u=e.redirect_uri,silentRequestTimeoutInSeconds:c=Zk,automaticSilentRenew:d=!0,validateSubOnSilentRenew:f=!0,includeIdTokenInSilentRenew:p=!1,monitorSession:g=!1,monitorAnonymousSession:v=!1,checkSessionIntervalInSeconds:_=zF,query_status_response_type:m="code",stopCheckSessionOnError:h=!0,revokeTokenTypes:y=["access_token","refresh_token"],revokeTokensOnSignout:b=!1,includeIdTokenInSilentSignout:S=!1,accessTokenExpiringNotificationTimeInSeconds:x=VF,userStore:A}=e;if(super(e),this.popup_redirect_uri=t,this.popup_post_logout_redirect_uri=n,this.popupWindowFeatures=r,this.popupWindowTarget=o,this.redirectMethod=i,this.redirectTarget=a,this.iframeNotifyParentOrigin=s,this.iframeScriptOrigin=l,this.silent_redirect_uri=u,this.silentRequestTimeoutInSeconds=c,this.automaticSilentRenew=d,this.validateSubOnSilentRenew=f,this.includeIdTokenInSilentRenew=p,this.monitorSession=g,this.monitorAnonymousSession=v,this.checkSessionIntervalInSeconds=_,this.stopCheckSessionOnError=h,this.query_status_response_type=m,this.revokeTokenTypes=y,this.revokeTokensOnSignout=b,this.includeIdTokenInSilentSignout=S,this.accessTokenExpiringNotificationTimeInSeconds=x,A)this.userStore=A;else{const O=typeof window<"u"?window.sessionStorage:new qk;this.userStore=new Gk({store:O})}}},Qv=class extends Yk{constructor({silentRequestTimeoutInSeconds:e=Zk}){super(),this._logger=new Se("IFrameWindow"),this._timeoutInSeconds=e,this._frame=Qv.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 Z_("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)}},HF=class{constructor(e){this._settings=e,this._logger=new Se("IFrameNavigator")}async prepare({silentRequestTimeoutInSeconds:e=this._settings.silentRequestTimeoutInSeconds}){return new Qv({silentRequestTimeoutInSeconds:e})}async callback(e){this._logger.create("callback"),Qv.notifyParent(e,this._settings.iframeNotifyParentOrigin)}},WF=500,qF=1e3,qS=class extends Yk{constructor({popupWindowTarget:e=Xk,popupWindowFeatures:t={}}){super(),this._logger=new Se("PopupWindow");const n=HS.center({...Qk,...t});this._window=window.open(void 0,e,HS.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*qF)}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"))},WF);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)}},GF=class{constructor(e){this._settings=e,this._logger=new Se("PopupNavigator")}async prepare({popupWindowFeatures:e=this._settings.popupWindowFeatures,popupWindowTarget:t=this._settings.popupWindowTarget}){return new qS({popupWindowFeatures:e,popupWindowTarget:t})}async callback(e,{keepOpen:t=!1}){this._logger.create("callback"),qS.notifyOpener(e,t)}},KF=class{constructor(e){this._settings=e,this._logger=new Se("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 o=r.location[e].bind(r.location);let i;return{navigate:async a=>{this._logger.create("navigate");const s=new Promise((l,u)=>{i=u});return o(a.url),await s},close:()=>{this._logger.create("close"),i==null||i(new Error("Redirect aborted")),r.stop()}}}async callback(){}},YF=class extends wF{constructor(e){super({expiringNotificationTimeInSeconds:e.accessTokenExpiringNotificationTimeInSeconds}),this._logger=new Se("UserManagerEvents"),this._userLoaded=new Go("User loaded"),this._userUnloaded=new Go("User unloaded"),this._silentRenewError=new Go("Silent renew error"),this._userSignedIn=new Go("User signed in"),this._userSignedOut=new Go("User signed out"),this._userSessionChanged=new Go("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()}},QF=class{constructor(e){this._userManager=e,this._logger=new Se("SilentRenewService"),this._isStarted=!1,this._retryTimer=new Zn("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 Z_){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)}},XF=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}},ZF=class{constructor(e,t,n,r){this._logger=new Se("UserManager"),this.settings=new BF(e),this._client=new FF(e),this._redirectNavigator=t??new KF(this.settings),this._popupNavigator=n??new GF(this.settings),this._iframeNavigator=r??new HF(this.settings),this._events=new YF(this.settings),this._silentRenewService=new QF(this),this.settings.automaticSilentRenew&&this.startSilentRenew(),this._sessionMonitor=null,this.settings.monitorSession&&(this._sessionMonitor=new UF(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"),o=await this._client.processResourceOwnerPasswordCredentials({username:e,password:t,skipUserInfo:n,extraTokenParams:this.settings.extraTokenParams});r.debug("got signin response");const i=await this._buildUser(o);return i.profile&&i.profile.sub?r.info("success, signed in subject",i.profile.sub):r.info("no subject"),i}async signinPopup(e={}){const t=this._logger.create("signinPopup"),{popupWindowFeatures:n,popupWindowTarget:r,...o}=e,i=this.settings.popup_redirect_uri;i||t.throw(new Error("No popup_redirect_uri configured"));const a=await this._popupNavigator.prepare({popupWindowFeatures:n,popupWindowTarget:r}),s=await this._signin({request_type:"si:p",redirect_uri:i,display:"popup",...o},a);return s&&(s.profile&&s.profile.sub?t.info("success, signed in subject",s.profile.sub):t.info("no subject")),s}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:o,...i}=e;let a=await this._loadUser();if(a!=null&&a.refresh_token){n.debug("using refresh token");const c=new XF(a,o);return await this._useRefreshToken(c)}const s=this.settings.silent_redirect_uri;s||n.throw(new Error("No silent_redirect_uri configured"));let l;a&&this.settings.validateSubOnSilentRenew&&(n.debug("subject prior to silent renew:",a.profile.sub),l=a.profile.sub);const u=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:r});return a=await this._signin({request_type:"si:s",redirect_uri:s,prompt:"none",id_token_hint:this.settings.includeIdTokenInSilentRenew?a==null?void 0:a.id_token:void 0,...i},u,l),a&&((t=a.profile)!=null&&t.sub?n.info("success, signed in subject",a.profile.sub):n.info("no subject")),a}async _useRefreshToken(e){const t=await this._client.useRefreshToken({state:e,timeoutInSeconds:this.settings.silentRequestTimeoutInSeconds}),n=new Zf({...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,o=this.settings.silent_redirect_uri;o||t.throw(new Error("No silent_redirect_uri configured"));const i=await this._loadUser(),a=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:n}),s=await this._signinStart({request_type:"si:s",redirect_uri:o,prompt:"none",id_token_hint:this.settings.includeIdTokenInSilentRenew?i==null?void 0:i.id_token:void 0,response_type:this.settings.query_status_response_type,scope:"openid",skipUserInfo:!0,...r},a);try{const l=await this._client.processSigninResponse(s.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 Na)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 Zf(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 Na({...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,o=await this._redirectNavigator.prepare({redirectMethod:n});await this._signoutStart({request_type:"so:r",post_logout_redirect_uri:this.settings.post_logout_redirect_uri,...r},o),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,...o}=e,i=this.settings.popup_post_logout_redirect_uri,a=await this._popupNavigator.prepare({popupWindowFeatures:n,popupWindowTarget:r});await this._signout({request_type:"so:p",post_logout_redirect_uri:i,state:i==null?void 0:{},...o},a),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 o=await this._loadUser();r.debug("loaded current user from storage"),this.settings.revokeTokensOnSignout&&await this._revokeInternal(o);const i=e.id_token_hint||o&&o.id_token;i&&(r.debug("setting id_token_hint in signout request"),e.id_token_hint=i),await this.removeUser(),r.debug("user removed, creating signout request");const a=await this._client.createSignoutRequest(e);return r.debug("got signout request"),await t.navigate({url:a.url,state:(n=a.state)==null?void 0:n.id,scriptOrigin:this.settings.iframeScriptOrigin})}catch(o){throw r.debug("error after preparing navigator, closing navigator window"),t.close(),o}}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,...o}=e,i=this.settings.includeIdTokenInSilentSignout?(t=await this._loadUser())==null?void 0:t.id_token:void 0,a=this.settings.popup_post_logout_redirect_uri,s=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:r});await this._signout({request_type:"so:s",post_logout_redirect_uri:a,id_token_hint:i,...o},s),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(o=>typeof e[o]=="string");if(!r.length){n.debug("no need to revoke due to no token(s)");return}for(const o of r)await this._client.revokeToken(e[o],o),n.info(`${o} revoked successfully`),o!=="access_token"&&(e[o]=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"),Zf.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()}},tb=E.createContext(void 0);tb.displayName="AuthContext";var JF={isLoading:!0,isAuthenticated:!1},e9=(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}`)}}},t9=(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")))},n9=e=>t=>t instanceof Error?t:new Error(e),r9=n9("Login failed"),o9=["clearStaleState","querySessionStatus","revokeTokens","startSilentRenew","stopSilentRenew"],i9=["signinPopup","signinSilent","signinRedirect","signinResourceOwnerCredentials","signoutPopup","signoutRedirect","signoutSilent"],gm=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.`)},a9=typeof window>"u"?null:ZF,s9=e=>{const{children:t,onSigninCallback:n,skipSigninCallback:r,onRemoveUser:o,onSignoutRedirect:i,onSignoutPopup:a,implementation:s=a9,userManager:l,...u}=e,[c]=H.useState(()=>l??(s?new s(u):{settings:u})),[d,f]=H.useReducer(e9,JF),p=H.useMemo(()=>Object.assign({settings:c.settings,events:c.events},Object.fromEntries(o9.map(y=>{var b,S;return[y,(S=(b=c[y])==null?void 0:b.bind(c))!=null?S:gm(y)]})),Object.fromEntries(i9.map(y=>[y,c[y]?async b=>{f({type:"NAVIGATOR_INIT",method:y});try{return await c[y](b)}catch(S){return f({type:"ERROR",error:S}),null}finally{f({type:"NAVIGATOR_CLOSE"})}}:gm(y)]))),[c]),g=H.useRef(!1);H.useEffect(()=>{!c||g.current||(g.current=!0,(async()=>{let y=null;try{t9()&&!r&&(y=await c.signinCallback(),n&&await n(y)),y=y||await c.getUser(),f({type:"INITIALISED",user:y})}catch(b){f({type:"ERROR",error:r9(b)})}})())},[c,r,n]),H.useEffect(()=>{if(!c)return;const y=x=>{f({type:"USER_LOADED",user:x})};c.events.addUserLoaded(y);const b=()=>{f({type:"USER_UNLOADED"})};c.events.addUserUnloaded(b);const S=x=>{f({type:"ERROR",error:x})};return c.events.addSilentRenewError(S),()=>{c.events.removeUserLoaded(y),c.events.removeUserUnloaded(b),c.events.removeSilentRenewError(S)}},[c]);const v=H.useCallback(c?()=>c.removeUser().then(o):gm("removeUser"),[c,o]),_=H.useCallback(y=>p.signoutRedirect(y).then(i),[p.signoutRedirect,i]),m=H.useCallback(y=>p.signoutPopup(y).then(a),[p.signoutPopup,a]),h=H.useCallback(y=>p.signoutSilent(y),[p.signoutSilent]);return E.createElement(tb.Provider,{value:{...d,...p,removeUser:v,signoutRedirect:_,signoutPopup:m,signoutSilent:h}},t)},l9=()=>{const e=E.useContext(tb);return e||console.warn("AuthProvider context is undefined, please verify you are calling useAuth() as child of a component."),e};/** + * @remix-run/router v1.15.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 jc(){return jc=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function Jk(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function c9(){return Math.random().toString(36).substr(2,8)}function KS(e,t){return{usr:e.state,key:e.key,idx:t}}function Xv(e,t,n,r){return n===void 0&&(n=null),jc({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Wl(t):t,{state:n,key:t&&t.key||r||c9()})}function Gp(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 Wl(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 d9(e,t,n,r){r===void 0&&(r={});let{window:o=document.defaultView,v5Compat:i=!1}=r,a=o.history,s=di.Pop,l=null,u=c();u==null&&(u=0,a.replaceState(jc({},a.state,{idx:u}),""));function c(){return(a.state||{idx:null}).idx}function d(){s=di.Pop;let _=c(),m=_==null?null:_-u;u=_,l&&l({action:s,location:v.location,delta:m})}function f(_,m){s=di.Push;let h=Xv(v.location,_,m);n&&n(h,_),u=c()+1;let y=KS(h,u),b=v.createHref(h);try{a.pushState(y,"",b)}catch(S){if(S instanceof DOMException&&S.name==="DataCloneError")throw S;o.location.assign(b)}i&&l&&l({action:s,location:v.location,delta:1})}function p(_,m){s=di.Replace;let h=Xv(v.location,_,m);n&&n(h,_),u=c();let y=KS(h,u),b=v.createHref(h);a.replaceState(y,"",b),i&&l&&l({action:s,location:v.location,delta:0})}function g(_){let m=o.location.origin!=="null"?o.location.origin:o.location.href,h=typeof _=="string"?_:Gp(_);return h=h.replace(/ $/,"%20"),rt(m,"No window.location.(origin|href) available to create URL for href: "+h),new URL(h,m)}let v={get action(){return s},get location(){return e(o,a)},listen(_){if(l)throw new Error("A history only accepts one active listener");return o.addEventListener(GS,d),l=_,()=>{o.removeEventListener(GS,d),l=null}},createHref(_){return t(o,_)},createURL:g,encodeLocation(_){let m=g(_);return{pathname:m.pathname,search:m.search,hash:m.hash}},push:f,replace:p,go(_){return a.go(_)}};return v}var YS;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(YS||(YS={}));function f9(e,t,n){n===void 0&&(n="/");let r=typeof t=="string"?Wl(t):t,o=Al(r.pathname||"/",n);if(o==null)return null;let i=eT(e);p9(i);let a=null;for(let s=0;a==null&&s{let l={relativePath:s===void 0?i.path||"":s,caseSensitive:i.caseSensitive===!0,childrenIndex:a,route:i};l.relativePath.startsWith("/")&&(rt(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=Si([r,l.relativePath]),c=n.concat(l);i.children&&i.children.length>0&&(rt(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),eT(i.children,t,c,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:b9(u,i.index),routesMeta:c})};return e.forEach((i,a)=>{var s;if(i.path===""||!((s=i.path)!=null&&s.includes("?")))o(i,a);else for(let l of tT(i.path))o(i,a,l)}),t}function tT(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return o?[i,""]:[i];let a=tT(r.join("/")),s=[];return s.push(...a.map(l=>l===""?i:[i,l].join("/"))),o&&s.push(...a),s.map(l=>e.startsWith("/")&&l===""?"/":l)}function p9(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:w9(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const h9=/^:[\w-]+$/,g9=3,m9=2,y9=1,v9=10,_9=-2,QS=e=>e==="*";function b9(e,t){let n=e.split("/"),r=n.length;return n.some(QS)&&(r+=_9),t&&(r+=m9),n.filter(o=>!QS(o)).reduce((o,i)=>o+(h9.test(i)?g9:i===""?y9:v9),r)}function w9(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function S9(e,t){let{routesMeta:n}=e,r={},o="/",i=[];for(let a=0;a{let{paramName:f,isOptional:p}=c;if(f==="*"){let v=s[d]||"";a=i.slice(0,i.length-v.length).replace(/(.)\/+$/,"$1")}const g=s[d];return p&&!g?u[f]=void 0:u[f]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:a,pattern:e}}function x9(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Jk(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=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,s,l)=>(r.push({paramName:s,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function E9(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Jk(!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 Al(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 A9(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?Wl(e):e;return{pathname:n?n.startsWith("/")?n:C9(n,t):t,search:k9(r),hash:T9(o)}}function C9(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function mm(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 O9(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function nb(e,t){let n=O9(e);return t?n.map((r,o)=>o===e.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function rb(e,t,n,r){r===void 0&&(r=!1);let o;typeof e=="string"?o=Wl(e):(o=jc({},e),rt(!o.pathname||!o.pathname.includes("?"),mm("?","pathname","search",o)),rt(!o.pathname||!o.pathname.includes("#"),mm("#","pathname","hash",o)),rt(!o.search||!o.search.includes("#"),mm("#","search","hash",o)));let i=e===""||o.pathname==="",a=i?"/":o.pathname,s;if(a==null)s=n;else{let d=t.length-1;if(!r&&a.startsWith("..")){let f=a.split("/");for(;f[0]==="..";)f.shift(),d-=1;o.pathname=f.join("/")}s=d>=0?t[d]:"/"}let l=A9(o,s),u=a&&a!=="/"&&a.endsWith("/"),c=(i||a===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(u||c)&&(l.pathname+="/"),l}const Si=e=>e.join("/").replace(/\/\/+/g,"/"),R9=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),k9=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,T9=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function $9(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const nT=["post","put","patch","delete"];new Set(nT);const P9=["get",...nT];new Set(P9);/** + * React Router v6.22.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 Nc(){return Nc=Object.assign?Object.assign.bind():function(e){for(var t=1;t{s.current=!0}),H.useCallback(function(u,c){if(c===void 0&&(c={}),!s.current)return;if(typeof u=="number"){r.go(u);return}let d=rb(u,JSON.parse(a),i,c.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:Si([t,d.pathname])),(c.replace?r.replace:r.push)(d,c.state,c)},[t,r,a,i,e])}const N9=H.createContext(null);function L9(e){let t=H.useContext(Qr).outlet;return t&&H.createElement(N9.Provider,{value:e},t)}function I9(){let{matches:e}=H.useContext(Qr),t=e[e.length-1];return t?t.params:{}}function P0(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=H.useContext($o),{matches:o}=H.useContext(Qr),{pathname:i}=Wa(),a=JSON.stringify(nb(o,r.v7_relativeSplatPath));return H.useMemo(()=>rb(e,JSON.parse(a),i,n==="path"),[e,a,i,n])}function D9(e,t){return F9(e,t)}function F9(e,t,n,r){ql()||rt(!1);let{navigator:o}=H.useContext($o),{matches:i}=H.useContext(Qr),a=i[i.length-1],s=a?a.params:{};a&&a.pathname;let l=a?a.pathnameBase:"/";a&&a.route;let u=Wa(),c;if(t){var d;let _=typeof t=="string"?Wl(t):t;l==="/"||(d=_.pathname)!=null&&d.startsWith(l)||rt(!1),c=_}else c=u;let f=c.pathname||"/",p=f;if(l!=="/"){let _=l.replace(/^\//,"").split("/");p="/"+f.replace(/^\//,"").split("/").slice(_.length).join("/")}let g=f9(e,{pathname:p}),v=H9(g&&g.map(_=>Object.assign({},_,{params:Object.assign({},s,_.params),pathname:Si([l,o.encodeLocation?o.encodeLocation(_.pathname).pathname:_.pathname]),pathnameBase:_.pathnameBase==="/"?l:Si([l,o.encodeLocation?o.encodeLocation(_.pathnameBase).pathname:_.pathnameBase])})),i,n,r);return t&&v?H.createElement(T0.Provider,{value:{location:Nc({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:di.Pop}},v):v}function U9(){let e=K9(),t=$9(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},i=null;return H.createElement(H.Fragment,null,H.createElement("h2",null,"Unexpected Application Error!"),H.createElement("h3",{style:{fontStyle:"italic"}},t),n?H.createElement("pre",{style:o},n):null,i)}const V9=H.createElement(U9,null);class z9 extends H.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?H.createElement(Qr.Provider,{value:this.props.routeContext},H.createElement(oT.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function B9(e){let{routeContext:t,match:n,children:r}=e,o=H.useContext(k0);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),H.createElement(Qr.Provider,{value:t},r)}function H9(e,t,n,r){var o;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if((i=n)!=null&&i.errors)e=n.matches;else return null}let a=e,s=(o=n)==null?void 0:o.errors;if(s!=null){let c=a.findIndex(d=>d.route.id&&(s==null?void 0:s[d.route.id]));c>=0||rt(!1),a=a.slice(0,Math.min(a.length,c+1))}let l=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let c=0;c=0?a=a.slice(0,u+1):a=[a[0]];break}}}return a.reduceRight((c,d,f)=>{let p,g=!1,v=null,_=null;n&&(p=s&&d.route.id?s[d.route.id]:void 0,v=d.route.errorElement||V9,l&&(u<0&&f===0?(Q9("route-fallback",!1),g=!0,_=null):u===f&&(g=!0,_=d.route.hydrateFallbackElement||null)));let m=t.concat(a.slice(0,f+1)),h=()=>{let y;return p?y=v:g?y=_:d.route.Component?y=H.createElement(d.route.Component,null):d.route.element?y=d.route.element:y=c,H.createElement(B9,{match:d,routeContext:{outlet:c,matches:m,isDataRoute:n!=null},children:y})};return n&&(d.route.ErrorBoundary||d.route.errorElement||f===0)?H.createElement(z9,{location:n.location,revalidation:n.revalidation,component:v,error:p,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):h()},null)}var aT=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(aT||{}),Kp=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}(Kp||{});function W9(e){let t=H.useContext(k0);return t||rt(!1),t}function q9(e){let t=H.useContext(rT);return t||rt(!1),t}function G9(e){let t=H.useContext(Qr);return t||rt(!1),t}function sT(e){let t=G9(),n=t.matches[t.matches.length-1];return n.route.id||rt(!1),n.route.id}function K9(){var e;let t=H.useContext(oT),n=q9(Kp.UseRouteError),r=sT(Kp.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function Y9(){let{router:e}=W9(aT.UseNavigateStable),t=sT(Kp.UseNavigateStable),n=H.useRef(!1);return iT(()=>{n.current=!0}),H.useCallback(function(o,i){i===void 0&&(i={}),n.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,Nc({fromRouteId:t},i)))},[e,t])}const XS={};function Q9(e,t,n){!t&&!XS[e]&&(XS[e]=!0)}function X9(e){let{to:t,replace:n,state:r,relative:o}=e;ql()||rt(!1);let{future:i,static:a}=H.useContext($o),{matches:s}=H.useContext(Qr),{pathname:l}=Wa(),u=$0(),c=rb(t,nb(s,i.v7_relativeSplatPath),l,o==="path"),d=JSON.stringify(c);return H.useEffect(()=>u(JSON.parse(d),{replace:n,state:r,relative:o}),[u,d,o,n,r]),null}function Z9(e){return L9(e.context)}function Yi(e){rt(!1)}function J9(e){let{basename:t="/",children:n=null,location:r,navigationType:o=di.Pop,navigator:i,static:a=!1,future:s}=e;ql()&&rt(!1);let l=t.replace(/^\/*/,"/"),u=H.useMemo(()=>({basename:l,navigator:i,static:a,future:Nc({v7_relativeSplatPath:!1},s)}),[l,s,i,a]);typeof r=="string"&&(r=Wl(r));let{pathname:c="/",search:d="",hash:f="",state:p=null,key:g="default"}=r,v=H.useMemo(()=>{let _=Al(c,l);return _==null?null:{location:{pathname:_,search:d,hash:f,state:p,key:g},navigationType:o}},[l,c,d,f,p,g,o]);return v==null?null:H.createElement($o.Provider,{value:u},H.createElement(T0.Provider,{children:n,value:v}))}function eU(e){let{children:t,location:n}=e;return D9(Jv(t),n)}new Promise(()=>{});function Jv(e,t){t===void 0&&(t=[]);let n=[];return H.Children.forEach(e,(r,o)=>{if(!H.isValidElement(r))return;let i=[...t,o];if(r.type===H.Fragment){n.push.apply(n,Jv(r.props.children,i));return}r.type!==Yi&&rt(!1),!r.props.index||!r.props.children||rt(!1);let a={id:r.props.id||i.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&&(a.children=Jv(r.props.children,i)),n.push(a)}),n}/** + * React Router DOM v6.22.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 Yp(){return Yp=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[o]=e[o]);return n}function tU(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function nU(e,t){return e.button===0&&(!t||t==="_self")&&!tU(e)}const rU=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],oU=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"],iU="6";try{window.__reactRouterVersion=iU}catch{}const aU=H.createContext({isTransitioning:!1}),sU="startTransition",ZS=YL[sU];function lU(e){let{basename:t,children:n,future:r,window:o}=e,i=H.useRef();i.current==null&&(i.current=u9({window:o,v5Compat:!0}));let a=i.current,[s,l]=H.useState({action:a.action,location:a.location}),{v7_startTransition:u}=r||{},c=H.useCallback(d=>{u&&ZS?ZS(()=>l(d)):l(d)},[l,u]);return H.useLayoutEffect(()=>a.listen(c),[a,c]),H.createElement(J9,{basename:t,children:n,location:s.location,navigationType:s.action,navigator:a,future:r})}const uU=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",cU=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,uT=H.forwardRef(function(t,n){let{onClick:r,relative:o,reloadDocument:i,replace:a,state:s,target:l,to:u,preventScrollReset:c,unstable_viewTransition:d}=t,f=lT(t,rU),{basename:p}=H.useContext($o),g,v=!1;if(typeof u=="string"&&cU.test(u)&&(g=u,uU))try{let y=new URL(window.location.href),b=u.startsWith("//")?new URL(y.protocol+u):new URL(u),S=Al(b.pathname,p);b.origin===y.origin&&S!=null?u=S+b.search+b.hash:v=!0}catch{}let _=M9(u,{relative:o}),m=fU(u,{replace:a,state:s,target:l,preventScrollReset:c,relative:o,unstable_viewTransition:d});function h(y){r&&r(y),y.defaultPrevented||m(y)}return H.createElement("a",Yp({},f,{href:g||_,onClick:v||i?r:h,ref:n,target:l}))}),Jf=H.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:o=!1,className:i="",end:a=!1,style:s,to:l,unstable_viewTransition:u,children:c}=t,d=lT(t,oU),f=P0(l,{relative:d.relative}),p=Wa(),g=H.useContext(rT),{navigator:v,basename:_}=H.useContext($o),m=g!=null&&pU(f)&&u===!0,h=v.encodeLocation?v.encodeLocation(f).pathname:f.pathname,y=p.pathname,b=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;o||(y=y.toLowerCase(),b=b?b.toLowerCase():null,h=h.toLowerCase()),b&&_&&(b=Al(b,_)||b);const S=h!=="/"&&h.endsWith("/")?h.length-1:h.length;let x=y===h||!a&&y.startsWith(h)&&y.charAt(S)==="/",A=b!=null&&(b===h||!a&&b.startsWith(h)&&b.charAt(h.length)==="/"),O={isActive:x,isPending:A,isTransitioning:m},R=x?r:void 0,C;typeof i=="function"?C=i(O):C=[i,x?"active":null,A?"pending":null,m?"transitioning":null].filter(Boolean).join(" ");let T=typeof s=="function"?s(O):s;return H.createElement(uT,Yp({},d,{"aria-current":R,className:C,ref:n,style:T,to:l,unstable_viewTransition:u}),typeof c=="function"?c(O):c)});var e1;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(e1||(e1={}));var JS;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(JS||(JS={}));function dU(e){let t=H.useContext(k0);return t||rt(!1),t}function fU(e,t){let{target:n,replace:r,state:o,preventScrollReset:i,relative:a,unstable_viewTransition:s}=t===void 0?{}:t,l=$0(),u=Wa(),c=P0(e,{relative:a});return H.useCallback(d=>{if(nU(d,n)){d.preventDefault();let f=r!==void 0?r:Gp(u)===Gp(c);l(e,{replace:f,state:o,preventScrollReset:i,relative:a,unstable_viewTransition:s})}},[u,l,c,r,o,n,e,i,a,s])}function pU(e,t){t===void 0&&(t={});let n=H.useContext(aU);n==null&&rt(!1);let{basename:r}=dU(e1.useViewTransitionState),o=P0(e,{relative:t.relative});if(!n.isTransitioning)return!1;let i=Al(n.currentLocation.pathname,r)||n.currentLocation.pathname,a=Al(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Zv(o.pathname,a)!=null||Zv(o.pathname,i)!=null}var cT={};function hU(e){const t=new Error(e);if(t.stack===void 0)try{throw t}catch{}return t}var gU=hU,Ae=gU;function mU(e){return!!e&&typeof e.then=="function"}var Ke=mU;function yU(e,t){if(e!=null)return e;throw Ae(t??"Got unexpected null or undefined")}var et=yU;function Ee(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class M0{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 vU extends M0{constructor(t){super(),Ee(this,"state","hasValue"),Ee(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)?La(n):Cl(n)?n:bd(n)}catch(n){return Ke(n)?La(n.next(()=>this.map(t))):j0(n)}}}class _U extends M0{constructor(t){super(),Ee(this,"state","hasError"),Ee(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 dT extends M0{constructor(t){super(),Ee(this,"state","loading"),Ee(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 La(this.contents.then(n=>{const r=t(n);if(Cl(r)){const o=r;switch(o.state){case"hasValue":return o.contents;case"hasError":throw o.contents;case"loading":return o.contents}}return r}).catch(n=>{if(Ke(n))return n.then(()=>this.map(t).contents);throw n}))}}function bd(e){return Object.freeze(new vU(e))}function j0(e){return Object.freeze(new _U(e))}function La(e){return Object.freeze(new dT(e))}function fT(){return Object.freeze(new dT(new Promise(()=>{})))}function bU(e){return e.every(t=>t.state==="hasValue")?bd(e.map(t=>t.contents)):e.some(t=>t.state==="hasError")?j0(et(e.find(t=>t.state==="hasError"),"Invalid loadable passed to loadableAll").contents):La(Promise.all(e.map(t=>t.contents)))}function pT(e){const n=(Array.isArray(e)?e:Object.getOwnPropertyNames(e).map(o=>e[o])).map(o=>Cl(o)?o:Ke(o)?La(o):bd(o)),r=bU(n);return Array.isArray(e)?r:r.map(o=>Object.getOwnPropertyNames(e).reduce((i,a,s)=>({...i,[a]:o[s]}),{}))}function Cl(e){return e instanceof M0}const wU={of:e=>Ke(e)?La(e):Cl(e)?e:bd(e),error:e=>j0(e),loading:()=>fT(),all:pT,isLoadable:Cl};var qa={loadableWithValue:bd,loadableWithError:j0,loadableWithPromise:La,loadableLoading:fT,loadableAll:pT,isLoadable:Cl,RecoilLoadable:wU},SU=qa.loadableWithValue,xU=qa.loadableWithError,EU=qa.loadableWithPromise,AU=qa.loadableLoading,CU=qa.loadableAll,OU=qa.isLoadable,RU=qa.RecoilLoadable,wd=Object.freeze({__proto__:null,loadableWithValue:SU,loadableWithError:xU,loadableWithPromise:EU,loadableLoading:AU,loadableAll:CU,isLoadable:OU,RecoilLoadable:RU});const t1={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 kU(e,t){var n,r;const o=(n=cT[e])===null||n===void 0||(r=n.toLowerCase())===null||r===void 0?void 0:r.trim();if(o==null||o==="")return;if(!["true","false"].includes(o))throw Ae(`process.env.${e} value must be 'true', 'false', or empty: ${o}`);t(o==="true")}function TU(e,t){var n;const r=(n=cT[e])===null||n===void 0?void 0:n.trim();r==null||r===""||t(r.split(/\s*,\s*|\s+/))}function $U(){var e;typeof process>"u"||((e=process)===null||e===void 0?void 0:e.env)!=null&&(kU("RECOIL_DUPLICATE_ATOM_KEY_CHECKING_ENABLED",t=>{t1.RECOIL_DUPLICATE_ATOM_KEY_CHECKING_ENABLED=t}),TU("RECOIL_GKS_ENABLED",t=>{t.forEach(n=>{t1.RECOIL_GKS_ENABLED.add(n)})}))}$U();var Gl=t1;function N0(e){return Gl.RECOIL_GKS_ENABLED.has(e)}N0.setPass=e=>{Gl.RECOIL_GKS_ENABLED.add(e)};N0.setFail=e=>{Gl.RECOIL_GKS_ENABLED.delete(e)};N0.clear=()=>{Gl.RECOIL_GKS_ENABLED.clear()};var Ve=N0;function PU(e,t,{error:n}={}){return null}var MU=PU,ob=MU,ym,vm,_m;const jU=(ym=E.createMutableSource)!==null&&ym!==void 0?ym:E.unstable_createMutableSource,hT=(vm=E.useMutableSource)!==null&&vm!==void 0?vm:E.unstable_useMutableSource,gT=(_m=E.useSyncExternalStore)!==null&&_m!==void 0?_m:E.unstable_useSyncExternalStore;function NU(){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 LU(){return Ve("recoil_transition_support")?{mode:"TRANSITION_SUPPORT",early:!0,concurrent:!0}:Ve("recoil_sync_external_store")&&gT!=null?{mode:"SYNC_EXTERNAL_STORE",early:!0,concurrent:!1}:Ve("recoil_mutable_source")&&hT!=null&&typeof window<"u"&&!window.$disableRecoilValueMutableSource_TEMP_HACK_DO_NOT_USE?Ve("recoil_suppress_rerender_in_callback")?{mode:"MUTABLE_SOURCE",early:!0,concurrent:!0}:{mode:"MUTABLE_SOURCE",early:!1,concurrent:!1}:Ve("recoil_suppress_rerender_in_callback")?{mode:"LEGACY",early:!0,concurrent:!1}:{mode:"LEGACY",early:!1,concurrent:!1}}function IU(){return!1}var Sd={createMutableSource:jU,useMutableSource:hT,useSyncExternalStore:gT,currentRendererSupportsUseSyncExternalStore:NU,reactMode:LU,isFastRefreshEnabled:IU};class ib{constructor(t){Ee(this,"key",void 0),this.key=t}toJSON(){return{key:this.key}}}class mT extends ib{}class yT extends ib{}function DU(e){return e instanceof mT||e instanceof yT}var L0={AbstractRecoilValue:ib,RecoilState:mT,RecoilValueReadOnly:yT,isRecoilValue:DU},FU=L0.AbstractRecoilValue,UU=L0.RecoilState,VU=L0.RecoilValueReadOnly,zU=L0.isRecoilValue,Ol=Object.freeze({__proto__:null,AbstractRecoilValue:FU,RecoilState:UU,RecoilValueReadOnly:VU,isRecoilValue:zU});function BU(e,t){return function*(){let n=0;for(const r of e)yield t(r,n++)}()}var I0=BU;class vT{}const HU=new vT,Ia=new Map,ab=new Map;function WU(e){return I0(e,t=>et(ab.get(t)))}function qU(e){if(Ia.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 GU(e){Gl.RECOIL_DUPLICATE_ATOM_KEY_CHECKING_ENABLED&&qU(e.key),Ia.set(e.key,e);const t=e.set==null?new Ol.RecoilValueReadOnly(e.key):new Ol.RecoilState(e.key);return ab.set(e.key,t),t}class _T extends Error{}function KU(e){const t=Ia.get(e);if(t==null)throw new _T(`Missing definition for RecoilValue: "${e}""`);return t}function YU(e){return Ia.get(e)}const Qp=new Map;function QU(e){var t;if(!Ve("recoil_memory_managament_2020"))return;const n=Ia.get(e);if(n!=null&&(t=n.shouldDeleteConfigOnRelease)!==null&&t!==void 0&&t.call(n)){var r;Ia.delete(e),(r=bT(e))===null||r===void 0||r(),Qp.delete(e)}}function XU(e,t){Ve("recoil_memory_managament_2020")&&(t===void 0?Qp.delete(e):Qp.set(e,t))}function bT(e){return Qp.get(e)}var _n={nodes:Ia,recoilValues:ab,registerNode:GU,getNode:KU,getNodeMaybe:YU,deleteNodeConfigIfPossible:QU,setConfigDeletionHandler:XU,getConfigDeletionHandler:bT,recoilValuesForKeys:WU,NodeMissingError:_T,DefaultValue:vT,DEFAULT_VALUE:HU};function ZU(e,t){t()}var JU={enqueueExecution:ZU};function eV(e,t){return t={exports:{}},e(t,t.exports),t.exports}var tV=eV(function(e){var t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(F){return typeof F}:function(F){return F&&typeof Symbol=="function"&&F.constructor===Symbol&&F!==Symbol.prototype?"symbol":typeof F},n={},r=5,o=Math.pow(2,r),i=o-1,a=o/2,s=o/4,l={},u=function(I){return function(){return I}},c=n.hash=function(F){var I=typeof F>"u"?"undefined":t(F);if(I==="number")return F;I!=="string"&&(F+="");for(var Z=0,ie=0,ae=F.length;ie>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&i},p=function(I){return 1<=Z;)ae[_e--]=ae[_e];return ae[Z]=ie,ae}for(var ye=0,ve=0,Oe=new Array(fe+1);ye>>=1;return _e[Z]=ie,T(I,ve+1,_e)},D=function(I,Z,ie,ae){for(var fe=new Array(Z-1),_e=0,ye=0,ve=0,Oe=ae.length;ve1?R(I,this.hash,Oe):Oe[0]}var Xe=ae();return Xe===l?this:(++ye.value,N(I,ie,this.hash,this,fe,O(I,fe,_e,Xe)))},B=function(I,Z,ie,ae,fe,_e,ye){var ve=this.mask,Oe=this.children,Xe=f(ie,fe),nn=p(Xe),xt=g(ve,nn),Ln=ve&nn,ar=Ln?Oe[xt]:x,rs=ar._modify(I,Z,ie+r,ae,fe,_e,ye);if(ar===rs)return this;var qd=Q(I,this),pu=ve,hu=void 0;if(Ln&&A(rs)){if(pu&=~nn,!pu)return x;if(Oe.length<=2&&k(Oe[xt^1]))return Oe[xt^1];hu=_(qd,xt,Oe)}else if(!Ln&&!A(rs)){if(Oe.length>=a)return $(I,Xe,rs,ve,Oe);pu|=nn,hu=m(qd,xt,rs,Oe)}else hu=v(qd,xt,rs,Oe);return qd?(this.mask=pu,this.children=hu,this):C(I,pu,hu)},Y=function(I,Z,ie,ae,fe,_e,ye){var ve=this.size,Oe=this.children,Xe=f(ie,fe),nn=Oe[Xe],xt=(nn||x)._modify(I,Z,ie+r,ae,fe,_e,ye);if(nn===xt)return this;var Ln=Q(I,this),ar=void 0;if(A(nn)&&!A(xt))++ve,ar=v(Ln,Xe,xt,Oe);else if(!A(nn)&&A(xt)){if(--ve,ve<=s)return D(I,ve,Xe,Oe);ar=v(Ln,Xe,x,Oe)}else ar=v(Ln,Xe,xt,Oe);return Ln?(this.size=ve,this.children=ar,this):T(I,ve,ar)};x._modify=function(F,I,Z,ie,ae,fe,_e){var ye=ie();return ye===l?x:(++_e.value,O(F,ae,fe,ye))};function P(F,I,Z,ie,ae){this._editable=F,this._edit=I,this._config=Z,this._root=ie,this._size=ae}P.prototype.setTree=function(F,I){return this._editable?(this._root=F,this._size=I,this):F===this._root?this:new P(this._editable,this._edit,this._config,F,I)};var z=n.tryGetHash=function(F,I,Z,ie){for(var ae=ie._root,fe=0,_e=ie._config.keyEq;;)switch(ae.type){case h:return _e(Z,ae.key)?ae.value:F;case y:{if(I===ae.hash)for(var ye=ae.children,ve=0,Oe=ye.length;ve{n.set(o,t(r,o))}),n}var Xp=sV;function lV(){return{nodeDeps:new Map,nodeToNodeSubscriptions:new Map}}function uV(e){return{nodeDeps:Xp(e.nodeDeps,t=>new Set(t)),nodeToNodeSubscriptions:Xp(e.nodeToNodeSubscriptions,t=>new Set(t))}}function bm(e,t,n,r){const{nodeDeps:o,nodeToNodeSubscriptions:i}=n,a=o.get(e);if(a&&r&&a!==r.nodeDeps.get(e))return;o.set(e,t);const s=a==null?t:sc(t,a);for(const l of s)i.has(l)||i.set(l,new Set),et(i.get(l)).add(e);if(a){const l=sc(a,t);for(const u of l){if(!i.has(u))return;const c=et(i.get(u));c.delete(e),c.size===0&&i.delete(u)}}}function cV(e,t,n,r){var o,i,a,s;const l=n.getState();r===l.currentTree.version||r===((o=l.nextTree)===null||o===void 0?void 0:o.version)||((i=l.previousTree)===null||i===void 0||i.version);const u=n.getGraph(r);if(bm(e,t,u),r===((a=l.previousTree)===null||a===void 0?void 0:a.version)){const d=n.getGraph(l.currentTree.version);bm(e,t,d,u)}if(r===((s=l.previousTree)===null||s===void 0?void 0:s.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);bm(e,t,f,u)}}}var xd={cloneGraph:uV,graph:lV,saveDepsToStore:cV};let dV=0;const fV=()=>dV++;let pV=0;const hV=()=>pV++;let gV=0;const mV=()=>gV++;var D0={getNextTreeStateVersion:fV,getNextStoreID:hV,getNextComponentID:mV};const{persistentMap:ex}=iV,{graph:yV}=xd,{getNextTreeStateVersion:wT}=D0;function ST(){const e=wT();return{version:e,stateID:e,transactionMetadata:{},dirtyAtoms:new Set,atomValues:ex(),nonvalidatedAtoms:ex()}}function vV(){const e=ST();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,yV()),retention:{referenceCounts:new Map,nodesRetainedByZone:new Map,retainablesToCheckForRelease:new Set},nodeCleanupFunctions:new Map}}var xT={makeEmptyTreeState:ST,makeEmptyStoreState:vV,getNextTreeStateVersion:wT};class ET{}function _V(){return new ET}var F0={RetentionZone:ET,retentionZone:_V};function bV(e,t){const n=new Set(e);return n.add(t),n}function wV(e,t){const n=new Set(e);return n.delete(t),n}function SV(e,t,n){const r=new Map(e);return r.set(t,n),r}function xV(e,t,n){const r=new Map(e);return r.set(t,n(r.get(t))),r}function EV(e,t){const n=new Map(e);return n.delete(t),n}function AV(e,t){const n=new Map(e);return t.forEach(r=>n.delete(r)),n}var AT={setByAddingToSet:bV,setByDeletingFromSet:wV,mapBySettingInMap:SV,mapByUpdatingInMap:xV,mapByDeletingFromMap:EV,mapByDeletingMultipleFromMap:AV};function*CV(e,t){let n=0;for(const r of e)t(r,n++)&&(yield r)}var ub=CV;function OV(e,t){return new Proxy(e,{get:(r,o)=>(!(o in r)&&o in t&&(r[o]=t[o]()),r[o]),ownKeys:r=>Object.keys(r)})}var CT=OV;const{getNode:Ed,getNodeMaybe:RV,recoilValuesForKeys:tx}=_n,{RetentionZone:nx}=F0,{setByAddingToSet:kV}=AT,TV=Object.freeze(new Set);class $V extends Error{}function PV(e,t,n){if(!Ve("recoil_memory_managament_2020"))return()=>{};const{nodesRetainedByZone:r}=e.getState().retention;function o(i){let a=r.get(i);a||r.set(i,a=new Set),a.add(t)}if(n instanceof nx)o(n);else if(Array.isArray(n))for(const i of n)o(i);return()=>{if(!Ve("recoil_memory_managament_2020"))return;const{retention:i}=e.getState();function a(s){const l=i.nodesRetainedByZone.get(s);l==null||l.delete(t),l&&l.size===0&&i.nodesRetainedByZone.delete(s)}if(n instanceof nx)a(n);else if(Array.isArray(n))for(const s of n)a(s)}}function cb(e,t,n,r){const o=e.getState();if(o.nodeCleanupFunctions.has(n))return;const i=Ed(n),a=PV(e,n,i.retainedBy),s=i.init(e,t,r);o.nodeCleanupFunctions.set(n,()=>{s(),a()})}function MV(e,t,n){cb(e,e.getState().currentTree,t,n)}function jV(e,t){var n;const r=e.getState();(n=r.nodeCleanupFunctions.get(t))===null||n===void 0||n(),r.nodeCleanupFunctions.delete(t)}function NV(e,t,n){return cb(e,t,n,"get"),Ed(n).get(e,t)}function OT(e,t,n){return Ed(n).peek(e,t)}function LV(e,t,n){var r;const o=RV(t);return o==null||(r=o.invalidate)===null||r===void 0||r.call(o,e),{...e,atomValues:e.atomValues.clone().delete(t),nonvalidatedAtoms:e.nonvalidatedAtoms.clone().set(t,n),dirtyAtoms:kV(e.dirtyAtoms,t)}}function IV(e,t,n,r){const o=Ed(n);if(o.set==null)throw new $V(`Attempt to set read-only RecoilValue: ${n}`);const i=o.set;return cb(e,t,n,"set"),i(e,t,r)}function DV(e,t,n){const r=e.getState(),o=e.getGraph(t.version),i=Ed(n).nodeType;return CT({type:i},{loadable:()=>OT(e,t,n),isActive:()=>r.knownAtoms.has(n)||r.knownSelectors.has(n),isSet:()=>i==="selector"?!1:t.atomValues.has(n),isModified:()=>t.dirtyAtoms.has(n),deps:()=>{var a;return tx((a=o.nodeDeps.get(n))!==null&&a!==void 0?a:[])},subscribers:()=>{var a,s;return{nodes:tx(ub(RT(e,t,new Set([n])),l=>l!==n)),components:I0((a=(s=r.nodeToComponentSubscriptions.get(n))===null||s===void 0?void 0:s.values())!==null&&a!==void 0?a:[],([l])=>({name:l}))}}})}function RT(e,t,n){const r=new Set,o=Array.from(n),i=e.getGraph(t.version);for(let s=o.pop();s;s=o.pop()){var a;r.add(s);const l=(a=i.nodeToNodeSubscriptions.get(s))!==null&&a!==void 0?a:TV;for(const u of l)r.has(u)||o.push(u)}return r}var Di={getNodeLoadable:NV,peekNodeLoadable:OT,setNodeValue:IV,initializeNode:MV,cleanUpNode:jV,setUnvalidatedAtomValue_DEPRECATED:LV,peekNodeInfo:DV,getDownstreamNodes:RT};let kT=null;function FV(e){kT=e}function UV(){var e;(e=kT)===null||e===void 0||e()}var TT={setInvalidateMemoizedSnapshot:FV,invalidateMemoizedSnapshot:UV};const{getDownstreamNodes:VV,getNodeLoadable:$T,setNodeValue:zV}=Di,{getNextComponentID:BV}=D0,{getNode:HV,getNodeMaybe:PT}=_n,{DefaultValue:db}=_n,{reactMode:WV}=Sd,{AbstractRecoilValue:qV,RecoilState:GV,RecoilValueReadOnly:KV,isRecoilValue:YV}=Ol,{invalidateMemoizedSnapshot:QV}=TT;function XV(e,{key:t},n=e.getState().currentTree){var r,o;const i=e.getState();n.version===i.currentTree.version||n.version===((r=i.nextTree)===null||r===void 0?void 0:r.version)||(n.version,(o=i.previousTree)===null||o===void 0||o.version);const a=$T(e,n,t);return a.state==="loading"&&a.contents.catch(()=>{}),a}function ZV(e,t){const n=e.clone();return t.forEach((r,o)=>{r.state==="hasValue"&&r.contents instanceof db?n.delete(o):n.set(o,r)}),n}function JV(e,t,{key:n},r){if(typeof r=="function"){const o=$T(e,t,n);if(o.state==="loading"){const i=`Tried to set atom or selector "${n}" using an updater function while the current state is pending, this is not currently supported.`;throw Ae(i)}else if(o.state==="hasError")throw o.contents;return r(o.contents)}else return r}function ez(e,t,n){if(n.type==="set"){const{recoilValue:o,valueOrUpdater:i}=n,a=JV(e,t,o,i),s=zV(e,t,o.key,a);for(const[l,u]of s.entries())n1(t,l,u)}else if(n.type==="setLoadable"){const{recoilValue:{key:o},loadable:i}=n;n1(t,o,i)}else if(n.type==="markModified"){const{recoilValue:{key:o}}=n;t.dirtyAtoms.add(o)}else if(n.type==="setUnvalidated"){var r;const{recoilValue:{key:o},unvalidatedValue:i}=n,a=PT(o);a==null||(r=a.invalidate)===null||r===void 0||r.call(a,t),t.atomValues.delete(o),t.nonvalidatedAtoms.set(o,i),t.dirtyAtoms.add(o)}else ob(`Unknown action ${n.type}`)}function n1(e,t,n){n.state==="hasValue"&&n.contents instanceof db?e.atomValues.delete(t):e.atomValues.set(t,n),e.dirtyAtoms.add(t),e.nonvalidatedAtoms.delete(t)}function MT(e,t){e.replaceState(n=>{const r=jT(n);for(const o of t)ez(e,r,o);return NT(e,r),QV(),r})}function U0(e,t){if(lc.length){const n=lc[lc.length-1];let r=n.get(e);r||n.set(e,r=[]),r.push(t)}else MT(e,[t])}const lc=[];function tz(){const e=new Map;return lc.push(e),()=>{for(const[t,n]of e)MT(t,n);lc.pop()}}function jT(e){return{...e,atomValues:e.atomValues.clone(),nonvalidatedAtoms:e.nonvalidatedAtoms.clone(),dirtyAtoms:new Set(e.dirtyAtoms)}}function NT(e,t){const n=VV(e,t,t.dirtyAtoms);for(const i of n){var r,o;(r=PT(i))===null||r===void 0||(o=r.invalidate)===null||o===void 0||o.call(r,t)}}function LT(e,t,n){U0(e,{type:"set",recoilValue:t,valueOrUpdater:n})}function nz(e,t,n){if(n instanceof db)return LT(e,t,n);U0(e,{type:"setLoadable",recoilValue:t,loadable:n})}function rz(e,t){U0(e,{type:"markModified",recoilValue:t})}function oz(e,t,n){U0(e,{type:"setUnvalidated",recoilValue:t,unvalidatedValue:n})}function iz(e,{key:t},n,r=null){const o=BV(),i=e.getState();i.nodeToComponentSubscriptions.has(t)||i.nodeToComponentSubscriptions.set(t,new Map),et(i.nodeToComponentSubscriptions.get(t)).set(o,[r??"",n]);const a=WV();if(a.early&&(a.mode==="LEGACY"||a.mode==="MUTABLE_SOURCE")){const s=e.getState().nextTree;s&&s.dirtyAtoms.has(t)&&n(s)}return{release:()=>{const s=e.getState(),l=s.nodeToComponentSubscriptions.get(t);l===void 0||!l.has(o)||(l.delete(o),l.size===0&&s.nodeToComponentSubscriptions.delete(t))}}}function az(e,t){var n;const{currentTree:r}=e.getState(),o=HV(t.key);(n=o.clearCache)===null||n===void 0||n.call(o,e,r)}var Xr={RecoilValueReadOnly:KV,AbstractRecoilValue:qV,RecoilState:GV,getRecoilValueAsLoadable:XV,setRecoilValue:LT,setRecoilValueLoadable:nz,markRecoilValueModified:rz,setUnvalidatedRecoilValue:oz,subscribeToRecoilValue:iz,isRecoilValue:YV,applyAtomValueWrites:ZV,batchStart:tz,writeLoadableToTreeState:n1,invalidateDownstreams:NT,copyTreeState:jT,refreshRecoilValue:az};function sz(e,t,n){const r=e.entries();let o=r.next();for(;!o.done;){const i=o.value;if(t.call(n,i[1],i[0],e))return!0;o=r.next()}return!1}var lz=sz;const{cleanUpNode:uz}=Di,{deleteNodeConfigIfPossible:cz,getNode:IT}=_n,{RetentionZone:DT}=F0,dz=12e4,FT=new Set;function UT(e,t){const n=e.getState(),r=n.currentTree;if(n.nextTree)return;const o=new Set;for(const a of t)if(a instanceof DT)for(const s of gz(n,a))o.add(s);else o.add(a);const i=fz(e,o);for(const a of i)hz(e,r,a)}function fz(e,t){const n=e.getState(),r=n.currentTree,o=e.getGraph(r.version),i=new Set,a=new Set;return s(t),i;function s(l){const u=new Set,c=pz(e,r,l,i,a);for(const g of c){var d;if(IT(g).retainedBy==="recoilRoot"){a.add(g);continue}if(((d=n.retention.referenceCounts.get(g))!==null&&d!==void 0?d:0)>0){a.add(g);continue}if(VT(g).some(_=>n.retention.referenceCounts.get(_))){a.add(g);continue}const v=o.nodeToNodeSubscriptions.get(g);if(v&&lz(v,_=>a.has(_))){a.add(g);continue}i.add(g),u.add(g)}const f=new Set;for(const g of u)for(const v of(p=o.nodeDeps.get(g))!==null&&p!==void 0?p:FT){var p;i.has(v)||f.add(v)}f.size&&s(f)}}function pz(e,t,n,r,o){const i=e.getGraph(t.version),a=[],s=new Set;for(;n.size>0;)l(et(n.values().next().value));return a;function l(u){if(r.has(u)||o.has(u)){n.delete(u);return}if(s.has(u))return;const c=i.nodeToNodeSubscriptions.get(u);if(c)for(const d of c)l(d);s.add(u),n.delete(u),a.push(u)}}function hz(e,t,n){if(!Ve("recoil_memory_managament_2020"))return;uz(e,n);const r=e.getState();r.knownAtoms.delete(n),r.knownSelectors.delete(n),r.nodeTransactionSubscriptions.delete(n),r.retention.referenceCounts.delete(n);const o=VT(n);for(const l of o){var i;(i=r.retention.nodesRetainedByZone.get(l))===null||i===void 0||i.delete(n)}t.atomValues.delete(n),t.dirtyAtoms.delete(n),t.nonvalidatedAtoms.delete(n);const a=r.graphsByVersion.get(t.version);if(a){const l=a.nodeDeps.get(n);if(l!==void 0){a.nodeDeps.delete(n);for(const u of l){var s;(s=a.nodeToNodeSubscriptions.get(u))===null||s===void 0||s.delete(n)}}a.nodeToNodeSubscriptions.delete(n)}cz(n)}function gz(e,t){var n;return(n=e.retention.nodesRetainedByZone.get(t))!==null&&n!==void 0?n:FT}function VT(e){const t=IT(e).retainedBy;return t===void 0||t==="components"||t==="recoilRoot"?[]:t instanceof DT?[t]:t}function mz(e,t){const n=e.getState();n.nextTree?n.retention.retainablesToCheckForRelease.add(t):UT(e,new Set([t]))}function yz(e,t,n){var r;if(!Ve("recoil_memory_managament_2020"))return;const o=e.getState().retention.referenceCounts,i=((r=o.get(t))!==null&&r!==void 0?r:0)+n;i===0?zT(e,t):o.set(t,i)}function zT(e,t){if(!Ve("recoil_memory_managament_2020"))return;e.getState().retention.referenceCounts.delete(t),mz(e,t)}function vz(e){if(!Ve("recoil_memory_managament_2020"))return;const t=e.getState();UT(e,t.retention.retainablesToCheckForRelease),t.retention.retainablesToCheckForRelease.clear()}function _z(e){return e===void 0?"recoilRoot":e}var Ga={SUSPENSE_TIMEOUT_MS:dz,updateRetainCount:yz,updateRetainCountToZero:zT,releaseScheduledRetainablesNow:vz,retainedByOptionWithDefault:_z};const{unstable_batchedUpdates:bz}=iF;var wz={unstable_batchedUpdates:bz};const{unstable_batchedUpdates:Sz}=wz;var xz={unstable_batchedUpdates:Sz};const{batchStart:Ez}=Xr,{unstable_batchedUpdates:Az}=xz;let fb=Az||(e=>e());const Cz=e=>{fb=e},Oz=()=>fb,Rz=e=>{fb(()=>{let t=()=>{};try{t=Ez(),e()}finally{t()}})};var V0={getBatcher:Oz,setBatcher:Cz,batchUpdates:Rz};function*kz(e){for(const t of e)for(const n of t)yield n}var BT=kz;const HT=typeof Window>"u"||typeof window>"u",Tz=e=>!HT&&(e===window||e instanceof Window),$z=typeof navigator<"u"&&navigator.product==="ReactNative";var z0={isSSR:HT,isReactNative:$z,isWindow:Tz};function Pz(e,t){let n;return(...r)=>{n||(n={});const o=t(...r);return Object.hasOwnProperty.call(n,o)||(n[o]=e(...r)),n[o]}}function Mz(e,t){let n,r;return(...o)=>{const i=t(...o);return n===i||(n=i,r=e(...o)),r}}function jz(e,t){let n,r;return[(...a)=>{const s=t(...a);return n===s||(n=s,r=e(...a)),r},()=>{n=null}]}var Nz={memoizeWithArgsHash:Pz,memoizeOneWithArgsHash:Mz,memoizeOneWithArgsHashAndInvalidation:jz};const{batchUpdates:r1}=V0,{initializeNode:Lz,peekNodeInfo:Iz}=Di,{graph:Dz}=xd,{getNextStoreID:Fz}=D0,{DEFAULT_VALUE:Uz,recoilValues:rx,recoilValuesForKeys:ox}=_n,{AbstractRecoilValue:Vz,getRecoilValueAsLoadable:zz,setRecoilValue:ix,setUnvalidatedRecoilValue:Bz}=Xr,{updateRetainCount:ep}=Ga,{setInvalidateMemoizedSnapshot:Hz}=TT,{getNextTreeStateVersion:Wz,makeEmptyStoreState:qz}=xT,{isSSR:Gz}=z0,{memoizeOneWithArgsHashAndInvalidation:Kz}=Nz;class B0{constructor(t,n){Ee(this,"_store",void 0),Ee(this,"_refCount",1),Ee(this,"getLoadable",r=>(this.checkRefCount_INTERNAL(),zz(this._store,r))),Ee(this,"getPromise",r=>(this.checkRefCount_INTERNAL(),this.getLoadable(r).toPromise())),Ee(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 a=this._store.getState().currentTree;return ox(a.dirtyAtoms)}const o=this._store.getState().knownAtoms,i=this._store.getState().knownSelectors;return(r==null?void 0:r.isInitialized)==null?rx.values():r.isInitialized===!0?ox(BT([o,i])):ub(rx.values(),({key:a})=>!o.has(a)&&!i.has(a))}),Ee(this,"getInfo_UNSTABLE",({key:r})=>(this.checkRefCount_INTERNAL(),Iz(this._store,this._store.getState().currentTree,r))),Ee(this,"map",r=>{this.checkRefCount_INTERNAL();const o=new o1(this,r1);return r(o),o}),Ee(this,"asyncMap",async r=>{this.checkRefCount_INTERNAL();const o=new o1(this,r1);return o.retain(),await r(o),o.autoRelease_INTERNAL(),o}),this._store={storeID:Fz(),parentStoreID:n,getState:()=>t,replaceState:r=>{t.currentTree=r(t.currentTree)},getGraph:r=>{const o=t.graphsByVersion;if(o.has(r))return et(o.get(r));const i=Dz();return o.set(r,i),i},subscribeToTransactions:()=>({release:()=>{}}),addTransactionMetadata:()=>{throw Ae("Cannot subscribe to Snapshots")}};for(const r of this._store.getState().knownAtoms)Lz(this._store,r,"get"),ep(this._store,r,1);this.autoRelease_INTERNAL()}retain(){this._refCount<=0,this._refCount++;let t=!1;return()=>{t||(t=!0,this._release())}}autoRelease_INTERNAL(){Gz||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(),!Ve("recoil_memory_managament_2020"))return}else this._refCount<0}isRetained(){return this._refCount>0}checkRefCount_INTERNAL(){Ve("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 WT(e,t,n=!1){const r=e.getState(),o=n?Wz():t.version;return{currentTree:{version:n?o:t.version,stateID:n?o: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(o,e.getGraph(t.version)),retention:{referenceCounts:new Map,nodesRetainedByZone:new Map,retainablesToCheckForRelease:new Set},nodeCleanupFunctions:new Map(I0(r.nodeCleanupFunctions.entries(),([i])=>[i,()=>{}]))}}function Yz(e){const t=new B0(qz());return e!=null?t.map(e):t}const[ax,qT]=Kz((e,t)=>{var n;const r=e.getState(),o=t==="latest"?(n=r.nextTree)!==null&&n!==void 0?n:r.currentTree:et(r.previousTree);return new B0(WT(e,o),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)});Hz(qT);function Qz(e,t="latest"){const n=ax(e,t);return n.isRetained()?n:(qT(),ax(e,t))}class o1 extends B0{constructor(t,n){super(WT(t.getStore_INTERNAL(),t.getStore_INTERNAL().getState().currentTree,!0),t.getStoreID()),Ee(this,"_batch",void 0),Ee(this,"set",(r,o)=>{this.checkRefCount_INTERNAL();const i=this.getStore_INTERNAL();this._batch(()=>{ep(i,r.key,1),ix(this.getStore_INTERNAL(),r,o)})}),Ee(this,"reset",r=>{this.checkRefCount_INTERNAL();const o=this.getStore_INTERNAL();this._batch(()=>{ep(o,r.key,1),ix(this.getStore_INTERNAL(),r,Uz)})}),Ee(this,"setUnvalidatedAtomValues_DEPRECATED",r=>{this.checkRefCount_INTERNAL();const o=this.getStore_INTERNAL();r1(()=>{for(const[i,a]of r.entries())ep(o,i,1),Bz(o,new Vz(i),a)})}),this._batch=n}}var H0={Snapshot:B0,MutableSnapshot:o1,freshSnapshot:Yz,cloneSnapshot:Qz},Xz=H0.Snapshot,Zz=H0.MutableSnapshot,Jz=H0.freshSnapshot,eB=H0.cloneSnapshot,W0=Object.freeze({__proto__:null,Snapshot:Xz,MutableSnapshot:Zz,freshSnapshot:Jz,cloneSnapshot:eB});function tB(...e){const t=new Set;for(const n of e)for(const r of n)t.add(r);return t}var nB=tB;const{useRef:rB}=E;function oB(e){const t=rB(e);return t.current===e&&typeof e=="function"&&(t.current=e()),t}var sx=oB;const{getNextTreeStateVersion:iB,makeEmptyStoreState:GT}=xT,{cleanUpNode:aB,getDownstreamNodes:sB,initializeNode:lB,setNodeValue:uB,setUnvalidatedAtomValue_DEPRECATED:cB}=Di,{graph:dB}=xd,{cloneGraph:fB}=xd,{getNextStoreID:KT}=D0,{createMutableSource:wm,reactMode:YT}=Sd,{applyAtomValueWrites:pB}=Xr,{releaseScheduledRetainablesNow:QT}=Ga,{freshSnapshot:hB}=W0,{useCallback:gB,useContext:XT,useEffect:i1,useMemo:mB,useRef:yB,useState:vB}=E;function xu(){throw Ae("This component must be used inside a component.")}const ZT=Object.freeze({storeID:KT(),getState:xu,replaceState:xu,getGraph:xu,subscribeToTransactions:xu,addTransactionMetadata:xu});let a1=!1;function lx(e){if(a1)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){Ve("recoil_memory_managament_2020")&&Ve("recoil_release_on_cascading_update_killswitch_2021")&&t.commitDepth>0&&QT(e);const n=t.currentTree.version,r=iB();t.nextTree={...t.currentTree,version:r,stateID:r,dirtyAtoms:new Set,transactionMetadata:{}},t.graphsByVersion.set(r,fB(et(t.graphsByVersion.get(n))))}}const JT=E.createContext({current:ZT}),q0=()=>XT(JT),e$=E.createContext(null);function _B(){return XT(e$)}function pb(e,t,n){const r=sB(e,n,n.dirtyAtoms);for(const o of r){const i=t.nodeToComponentSubscriptions.get(o);if(i)for(const[a,[s,l]]of i)l(n)}}function t$(e){const t=e.getState(),n=t.currentTree,r=n.dirtyAtoms;if(r.size){for(const[o,i]of t.nodeTransactionSubscriptions)if(r.has(o))for(const[a,s]of i)s(e);for(const[o,i]of t.transactionSubscriptions)i(e);(!YT().early||t.suspendedComponentResolvers.size>0)&&(pb(e,t,n),t.suspendedComponentResolvers.forEach(o=>o()),t.suspendedComponentResolvers.clear())}t.queuedComponentCallbacks_DEPRECATED.forEach(o=>o(n)),t.queuedComponentCallbacks_DEPRECATED.splice(0,t.queuedComponentCallbacks_DEPRECATED.length)}function bB(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,t$(e),t.previousTree!=null?t.graphsByVersion.delete(t.previousTree.version):ob("Ended batch with no previous state, which is unexpected","recoil"),t.previousTree=null,Ve("recoil_memory_managament_2020")&&n==null&&QT(e)}finally{t.commitDepth--}}function wB({setNotifyBatcherOfChange:e}){const t=q0(),[,n]=vB([]);return e(()=>n({})),i1(()=>(e(()=>n({})),()=>{e(()=>{})}),[e]),i1(()=>{JU.enqueueExecution("Batcher",()=>{bB(t.current)})}),null}function SB(e,t){const n=GT();return t({set:(r,o)=>{const i=n.currentTree,a=uB(e,i,r.key,o),s=new Set(a.keys()),l=i.nonvalidatedAtoms.clone();for(const u of s)l.delete(u);n.currentTree={...i,dirtyAtoms:nB(i.dirtyAtoms,s),atomValues:pB(i.atomValues,a),nonvalidatedAtoms:l}},setUnvalidatedAtomValues:r=>{r.forEach((o,i)=>{n.currentTree=cB(n.currentTree,i,o)})}}),n}function xB(e){const t=hB(e),n=t.getStore_INTERNAL().getState();return t.retain(),n.nodeCleanupFunctions.forEach(r=>r()),n.nodeCleanupFunctions.clear(),n}let ux=0;function EB({initializeState_DEPRECATED:e,initializeState:t,store_INTERNAL:n,children:r}){let o;const i=p=>{const g=o.current.graphsByVersion;if(g.has(p))return et(g.get(p));const v=dB();return g.set(p,v),v},a=(p,g)=>{if(g==null){const{transactionSubscriptions:v}=d.current.getState(),_=ux++;return v.set(_,p),{release:()=>{v.delete(_)}}}else{const{nodeTransactionSubscriptions:v}=d.current.getState();v.has(g)||v.set(g,new Map);const _=ux++;return et(v.get(g)).set(_,p),{release:()=>{const m=v.get(g);m&&(m.delete(_),m.size===0&&v.delete(g))}}}},s=p=>{lx(d.current);for(const g of Object.keys(p))et(d.current.getState().nextTree).transactionMetadata[g]=p[g]},l=p=>{lx(d.current);const g=et(o.current.nextTree);let v;try{a1=!0,v=p(g)}finally{a1=!1}v!==g&&(o.current.nextTree=v,YT().early&&pb(d.current,o.current,v),et(u.current)())},u=yB(null),c=gB(p=>{u.current=p},[u]),d=sx(()=>n??{storeID:KT(),getState:()=>o.current,replaceState:l,getGraph:i,subscribeToTransactions:a,addTransactionMetadata:s});n!=null&&(d.current=n),o=sx(()=>e!=null?SB(d.current,e):t!=null?xB(t):GT());const f=mB(()=>wm==null?void 0:wm(o,()=>o.current.currentTree.version),[o]);return i1(()=>{const p=d.current;for(const g of new Set(p.getState().knownAtoms))lB(p,g,"get");return()=>{for(const g of p.getState().knownAtoms)aB(p,g)}},[d]),E.createElement(JT.Provider,{value:d},E.createElement(e$.Provider,{value:f},E.createElement(wB,{setNotifyBatcherOfChange:c}),r))}function AB(e){const{override:t,...n}=e,r=q0();return t===!1&&r.current!==ZT?e.children:E.createElement(EB,n)}function CB(){return q0().current.storeID}var Po={RecoilRoot:AB,useStoreRef:q0,useRecoilMutableSource:_B,useRecoilStoreID:CB,notifyComponents_FOR_TESTING:pb,sendEndOfBatchNotifications_FOR_TESTING:t$};function OB(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 n$=$B;const{useStoreRef:PB}=Po,{SUSPENSE_TIMEOUT_MS:MB}=Ga,{updateRetainCount:Eu}=Ga,{RetentionZone:jB}=F0,{useEffect:NB,useRef:LB}=E,{isSSR:cx}=z0;function IB(e){if(Ve("recoil_memory_managament_2020"))return DB(e)}function DB(e){const n=(Array.isArray(e)?e:[e]).map(a=>a instanceof jB?a:a.key),r=PB();NB(()=>{if(!Ve("recoil_memory_managament_2020"))return;const a=r.current;if(o.current&&!cx)window.clearTimeout(o.current),o.current=null;else for(const s of n)Eu(a,s,1);return()=>{for(const s of n)Eu(a,s,-1)}},[r,...n]);const o=LB(),i=n$(n);if(!cx&&(i===void 0||!RB(i,n))){const a=r.current;for(const s of n)Eu(a,s,1);if(i)for(const s of i)Eu(a,s,-1);o.current&&window.clearTimeout(o.current),o.current=window.setTimeout(()=>{o.current=null;for(const s of n)Eu(a,s,-1)},MB)}}var hb=IB;function FB(){return""}var Ad=FB;const{batchUpdates:UB}=V0,{DEFAULT_VALUE:r$}=_n,{currentRendererSupportsUseSyncExternalStore:VB,reactMode:Kl,useMutableSource:zB,useSyncExternalStore:BB}=Sd,{useRecoilMutableSource:HB,useStoreRef:Zr}=Po,{AbstractRecoilValue:s1,getRecoilValueAsLoadable:Cd,setRecoilValue:Zp,setUnvalidatedRecoilValue:WB,subscribeToRecoilValue:Rl}=Xr,{useCallback:mn,useEffect:kl,useMemo:o$,useRef:uc,useState:gb}=E,{setByAddingToSet:qB}=AT,{isSSR:GB}=z0;function mb(e,t,n){if(e.state==="hasValue")return e.contents;throw e.state==="loading"?new Promise(o=>{const i=n.current.getState().suspendedComponentResolvers;i.add(o),GB&&Ke(e.contents)&&e.contents.finally(()=>{i.delete(o)})}):e.state==="hasError"?e.contents:Ae(`Invalid value of loadable atom "${t.key}"`)}function KB(){const e=Ad(),t=Zr(),[,n]=gb([]),r=uc(new Set);r.current=new Set;const o=uc(new Set),i=uc(new Map),a=mn(l=>{const u=i.current.get(l);u&&(u.release(),i.current.delete(l))},[i]),s=mn((l,u)=>{i.current.has(u)&&n([])},[]);return kl(()=>{const l=t.current;sc(r.current,o.current).forEach(u=>{if(i.current.has(u))return;const c=Rl(l,new s1(u),f=>s(f,u),e);i.current.set(u,c),l.getState().nextTree?l.getState().queuedComponentCallbacks_DEPRECATED.push(()=>{s(l.getState(),u)}):s(l.getState(),u)}),sc(o.current,r.current).forEach(u=>{a(u)}),o.current=r.current}),kl(()=>{const l=i.current;return sc(r.current,new Set(l.keys())).forEach(u=>{const c=Rl(t.current,new s1(u),d=>s(d,u),e);l.set(u,c)}),()=>l.forEach((u,c)=>a(c))},[e,t,a,s]),o$(()=>{function l(g){return v=>{Zp(t.current,g,v)}}function u(g){return()=>Zp(t.current,g,r$)}function c(g){var v;r.current.has(g.key)||(r.current=qB(r.current,g.key));const _=t.current.getState();return Cd(t.current,g,Kl().early&&(v=_.nextTree)!==null&&v!==void 0?v:_.currentTree)}function d(g){const v=c(g);return mb(v,g,t)}function f(g){return[d(g),l(g)]}function p(g){return[c(g),l(g)]}return{getRecoilValue:d,getRecoilValueLoadable:c,getRecoilState:f,getRecoilStateLoadable:p,getSetRecoilState:l,getResetRecoilState:u}},[r,t])}const YB={current:0};function QB(e){const t=Zr(),n=Ad(),r=mn(()=>{var s;const l=t.current,u=l.getState(),c=Kl().early&&(s=u.nextTree)!==null&&s!==void 0?s:u.currentTree;return{loadable:Cd(l,e,c),key:e.key}},[t,e]),o=mn(s=>{let l;return()=>{var u,c;const d=s();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)}},[]),i=o$(()=>o(r),[r,o]),a=mn(s=>{const l=t.current;return Rl(l,e,s,n).release},[t,e,n]);return BB(a,i,i).loadable}function XB(e){const t=Zr(),n=mn(()=>{var u;const c=t.current,d=c.getState(),f=Kl().early&&(u=d.nextTree)!==null&&u!==void 0?u:d.currentTree;return Cd(c,e,f)},[t,e]),r=mn(()=>n(),[n]),o=Ad(),i=mn((u,c)=>{const d=t.current;return Rl(d,e,()=>{if(!Ve("recoil_suppress_rerender_in_callback"))return c();const p=n();l.current.is(p)||c(),l.current=p},o).release},[t,e,o,n]),a=HB();if(a==null)throw Ae("Recoil hooks must be used in components contained within a component.");const s=zB(a,r,i),l=uc(s);return kl(()=>{l.current=s}),s}function l1(e){const t=Zr(),n=Ad(),r=mn(()=>{var l;const u=t.current,c=u.getState(),d=Kl().early&&(l=c.nextTree)!==null&&l!==void 0?l:c.currentTree;return Cd(u,e,d)},[t,e]),o=mn(()=>({loadable:r(),key:e.key}),[r,e.key]),i=mn(l=>{const u=o();return l.loadable.is(u.loadable)&&l.key===u.key?l:u},[o]);kl(()=>{const l=Rl(t.current,e,u=>{s(i)},n);return s(i),l.release},[n,e,t,i]);const[a,s]=gb(o);return a.key!==e.key?o().loadable:a.loadable}function ZB(e){const t=Zr(),[,n]=gb([]),r=Ad(),o=mn(()=>{var s;const l=t.current,u=l.getState(),c=Kl().early&&(s=u.nextTree)!==null&&s!==void 0?s:u.currentTree;return Cd(l,e,c)},[t,e]),i=o(),a=uc(i);return kl(()=>{a.current=i}),kl(()=>{const s=t.current,l=s.getState(),u=Rl(s,e,d=>{var f;if(!Ve("recoil_suppress_rerender_in_callback"))return n([]);const p=o();(f=a.current)!==null&&f!==void 0&&f.is(p)||n(p),a.current=p},r);if(l.nextTree)s.getState().queuedComponentCallbacks_DEPRECATED.push(()=>{a.current=null,n([])});else{var c;if(!Ve("recoil_suppress_rerender_in_callback"))return n([]);const d=o();(c=a.current)!==null&&c!==void 0&&c.is(d)||n(d),a.current=d}return u.release},[r,o,e,t]),i}function yb(e){return Ve("recoil_memory_managament_2020")&&hb(e),{TRANSITION_SUPPORT:l1,SYNC_EXTERNAL_STORE:VB()?QB:l1,MUTABLE_SOURCE:XB,LEGACY:ZB}[Kl().mode](e)}function i$(e){const t=Zr(),n=yb(e);return mb(n,e,t)}function G0(e){const t=Zr();return mn(n=>{Zp(t.current,e,n)},[t,e])}function JB(e){const t=Zr();return mn(()=>{Zp(t.current,e,r$)},[t,e])}function e8(e){return[i$(e),G0(e)]}function t8(e){return[yb(e),G0(e)]}function n8(){const e=Zr();return(t,n={})=>{UB(()=>{e.current.addTransactionMetadata(n),t.forEach((r,o)=>WB(e.current,new s1(o),r))})}}function a$(e){return Ve("recoil_memory_managament_2020")&&hb(e),l1(e)}function s$(e){const t=Zr(),n=a$(e);return mb(n,e,t)}function r8(e){return[s$(e),G0(e)]}var o8={recoilComponentGetRecoilValueCount_FOR_TESTING:YB,useRecoilInterface:KB,useRecoilState:e8,useRecoilStateLoadable:t8,useRecoilValue:i$,useRecoilValueLoadable:yb,useResetRecoilState:JB,useSetRecoilState:G0,useSetUnvalidatedAtomValues:n8,useRecoilValueLoadable_TRANSITION_SUPPORT_UNSTABLE:a$,useRecoilValue_TRANSITION_SUPPORT_UNSTABLE:s$,useRecoilState_TRANSITION_SUPPORT_UNSTABLE:r8};function i8(e,t){const n=new Map;for(const[r,o]of e)t(o,r)&&n.set(r,o);return n}var a8=i8;function s8(e,t){const n=new Set;for(const r of e)t(r)&&n.add(r);return n}var l8=s8;function u8(...e){const t=new Map;for(let n=0;nt.current.subscribeToTransactions(e).release,[e,t])}function px(e){const t=e.atomValues.toMap(),n=Xp(a8(t,(r,o)=>{const a=l$(o).persistence_UNSTABLE;return a!=null&&a.type!=="none"&&r.state==="hasValue"}),r=>r.contents);return c8(e.nonvalidatedAtoms.toMap(),n)}function v8(e){Y0(K0(t=>{let n=t.getState().previousTree;const r=t.getState().currentTree;n||(n=t.getState().currentTree);const o=px(r),i=px(n),a=Xp(p8,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}}}),s=l8(r.dirtyAtoms,l=>o.has(l)||i.has(l));e({atomValues:o,previousAtomValues:i,atomInfo:a,modifiedAtoms:s,transactionMetadata:{...r.transactionMetadata}})},[e]))}function _8(e){Y0(K0(t=>{const n=Jp(t,"latest"),r=Jp(t,"previous");e({snapshot:n,previousSnapshot:r})},[e]))}function b8(){const e=vb(),[t,n]=y8(()=>Jp(e.current)),r=n$(t),o=dx(),i=dx();if(Y0(K0(s=>n(Jp(s)),[])),u$(()=>{const s=t.retain();if(o.current&&!fx){var l;window.clearTimeout(o.current),o.current=null,(l=i.current)===null||l===void 0||l.call(i),i.current=null}return()=>{window.setTimeout(s,10)}},[t]),r!==t&&!fx){if(o.current){var a;window.clearTimeout(o.current),o.current=null,(a=i.current)===null||a===void 0||a.call(i),i.current=null}i.current=t.retain(),o.current=window.setTimeout(()=>{var s;o.current=null,(s=i.current)===null||s===void 0||s.call(i),i.current=null},m8)}return t}function c$(e,t){var n;const r=e.getState(),o=(n=r.nextTree)!==null&&n!==void 0?n:r.currentTree,i=t.getStore_INTERNAL().getState().currentTree;d8(()=>{const a=new Set;for(const u of[o.atomValues.keys(),i.atomValues.keys()])for(const c of u){var s,l;((s=o.atomValues.get(c))===null||s===void 0?void 0:s.contents)!==((l=i.atomValues.get(c))===null||l===void 0?void 0:l.contents)&&l$(c).shouldRestoreFromSnapshots&&a.add(c)}a.forEach(u=>{g8(e,new h8(u),i.atomValues.has(u)?et(i.atomValues.get(u)):f8)}),e.replaceState(u=>({...u,stateID:t.getID()}))})}function w8(){const e=vb();return K0(t=>c$(e.current,t),[e])}var d$={useRecoilSnapshot:b8,gotoSnapshot:c$,useGotoRecoilSnapshot:w8,useRecoilTransactionObserver:_8,useTransactionObservation_DEPRECATED:v8,useTransactionSubscription_DEPRECATED:Y0};const{peekNodeInfo:S8}=Di,{useStoreRef:x8}=Po;function E8(){const e=x8();return({key:t})=>S8(e.current,e.current.getState().currentTree,t)}var A8=E8;const{reactMode:C8}=Sd,{RecoilRoot:O8,useStoreRef:R8}=Po,{useMemo:k8}=E;function T8(){C8().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=R8().current;return k8(()=>{function t({children:n}){return E.createElement(O8,{store_INTERNAL:e},n)}return t},[e])}var $8=T8;const{loadableWithValue:P8}=wd,{initializeNode:M8}=Di,{DEFAULT_VALUE:j8,getNode:N8}=_n,{copyTreeState:L8,getRecoilValueAsLoadable:I8,invalidateDownstreams:D8,writeLoadableToTreeState:F8}=Xr;function hx(e){return N8(e.key).nodeType==="atom"}class U8{constructor(t,n){Ee(this,"_store",void 0),Ee(this,"_treeState",void 0),Ee(this,"_changes",void 0),Ee(this,"get",r=>{if(this._changes.has(r.key))return this._changes.get(r.key);if(!hx(r))throw Ae("Reading selectors within atomicUpdate is not supported");const o=I8(this._store,r,this._treeState);if(o.state==="hasValue")return o.contents;throw o.state==="hasError"?o.contents:Ae(`Expected Recoil atom ${r.key} to have a value, but it is in a loading state.`)}),Ee(this,"set",(r,o)=>{if(!hx(r))throw Ae("Setting selectors within atomicUpdate is not supported");if(typeof o=="function"){const i=this.get(r);this._changes.set(r.key,o(i))}else M8(this._store,r.key,"set"),this._changes.set(r.key,o)}),Ee(this,"reset",r=>{this.set(r,j8)}),this._store=t,this._treeState=n,this._changes=new Map}newTreeState_INTERNAL(){if(this._changes.size===0)return this._treeState;const t=L8(this._treeState);for(const[n,r]of this._changes)F8(t,n,P8(r));return D8(this._store,t),t}}function V8(e){return t=>{e.replaceState(n=>{const r=new U8(e,n);return t(r),r.newTreeState_INTERNAL()})}}var z8={atomicUpdater:V8},B8=z8.atomicUpdater,f$=Object.freeze({__proto__:null,atomicUpdater:B8});function H8(e,t){if(!e)throw new Error(t)}var W8=H8,Bu=W8;const{atomicUpdater:q8}=f$,{batchUpdates:G8}=V0,{DEFAULT_VALUE:K8}=_n,{useStoreRef:Y8}=Po,{refreshRecoilValue:Q8,setRecoilValue:gx}=Xr,{cloneSnapshot:X8}=W0,{gotoSnapshot:Z8}=d$,{useCallback:J8}=E;class p${}const eH=new p$;function h$(e,t,n,r){let o=eH,i;if(G8(()=>{const s="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(s);const l=CT({...r??{},set:(c,d)=>gx(e,c,d),reset:c=>gx(e,c,K8),refresh:c=>Q8(e,c),gotoSnapshot:c=>Z8(e,c),transact_UNSTABLE:c=>q8(e)(c)},{snapshot:()=>{const c=X8(e);return i=c.retain(),c}}),u=t(l);if(typeof u!="function")throw Ae(s);o=u(...n)}),o instanceof p$&&Bu(!1),Ke(o))o=o.finally(()=>{var s;(s=i)===null||s===void 0||s()});else{var a;(a=i)===null||a===void 0||a()}return o}function tH(e,t){const n=Y8();return J8((...r)=>h$(n.current,e,r),t!=null?[...t,n]:void 0)}var g$={recoilCallback:h$,useRecoilCallback:tH};const{useStoreRef:nH}=Po,{refreshRecoilValue:rH}=Xr,{useCallback:oH}=E;function iH(e){const t=nH();return oH(()=>{const n=t.current;rH(n,e)},[e,t])}var aH=iH;const{atomicUpdater:sH}=f$,{useStoreRef:lH}=Po,{useMemo:uH}=E;function cH(e,t){const n=lH();return uH(()=>(...r)=>{sH(n.current)(i=>{e(i)(...r)})},t!=null?[...t,n]:void 0)}var dH=cH;class fH{constructor(t){Ee(this,"value",void 0),this.value=t}}var pH={WrappedValue:fH},hH=pH.WrappedValue,m$=Object.freeze({__proto__:null,WrappedValue:hH});const{isFastRefreshEnabled:gH}=Sd;class mx extends Error{}class mH{constructor(t){var n,r,o;Ee(this,"_name",void 0),Ee(this,"_numLeafs",void 0),Ee(this,"_root",void 0),Ee(this,"_onHit",void 0),Ee(this,"_onSet",void 0),Ee(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=(o=t==null?void 0:t.mapNodeValue)!==null&&o!==void 0?o:i=>i}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 o=this._mapNodeValue(t(r.nodeKey));r=r.branches.get(o)}}set(t,n,r){const o=()=>{var i,a,s,l;let u,c;for(const[_,m]of t){var d,f,p;const h=this._root;if((h==null?void 0:h.type)==="leaf")throw this.invalidCacheError();const y=u;if(u=y?y.branches.get(c):h,u=(d=u)!==null&&d!==void 0?d:{type:"branch",nodeKey:_,parent:y,branches:new Map,branchKey:c},u.type!=="branch"||u.nodeKey!==_)throw this.invalidCacheError();y==null||y.branches.set(c,u),r==null||(f=r.onNodeVisit)===null||f===void 0||f.call(r,u),c=this._mapNodeValue(m),this._root=(p=this._root)!==null&&p!==void 0?p:u}const g=u?(i=u)===null||i===void 0?void 0:i.branches.get(c):this._root;if(g!=null&&(g.type!=="leaf"||g.branchKey!==c))throw this.invalidCacheError();const v={type:"leaf",value:n,parent:u,branchKey:c};(a=u)===null||a===void 0||a.branches.set(c,v),this._root=(s=this._root)!==null&&s!==void 0?s:v,this._numLeafs++,this._onSet(v),r==null||(l=r.onNodeVisit)===null||l===void 0||l.call(r,v)};try{o()}catch(i){if(i instanceof mx)this.clear(),o();else throw i}}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,o=t.branchKey;for(;r;){var i;if(r.branches.delete(o),r===n)return r.branches.size===0?(this._root=null,this._numLeafs=0):this._numLeafs--,!0;if(r.branches.size>0)break;o=(i=r)===null||i===void 0?void 0:i.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=gH()?"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 ob(t+(this._name!=null?` - ${this._name}`:"")),new mx}}var yH={TreeCache:mH},vH=yH.TreeCache,y$=Object.freeze({__proto__:null,TreeCache:vH});class _H{constructor(t){var n;Ee(this,"_maxSize",void 0),Ee(this,"_size",void 0),Ee(this,"_head",void 0),Ee(this,"_tail",void 0),Ee(this,"_map",void 0),Ee(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 i=this.head(),a={key:t,right:i,left:null,value:n};i?i.left=a:this._tail=a,this._map.set(r,a),this._head=a,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=et(this._map.get(n)),o=r.right,i=r.left;o&&(o.left=r.left),i&&(i.right=r.right),r===this.head()&&(this._head=o),r===this.tail()&&(this._tail=i),this._map.delete(n),this._size--}clear(){this._size=0,this._head=null,this._tail=null,this._map=new Map}}var bH={LRUCache:_H},wH=bH.LRUCache,v$=Object.freeze({__proto__:null,LRUCache:wH});const{LRUCache:SH}=v$,{TreeCache:xH}=y$;function EH({name:e,maxSize:t,mapNodeValue:n=r=>r}){const r=new SH({maxSize:t}),o=new xH({name:e,mapNodeValue:n,onHit:i=>{r.set(i,!0)},onSet:i=>{const a=r.tail();r.set(i,!0),a&&o.size()>t&&o.delete(a.key)}});return o}var yx=EH;function lr(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((o,i)=>lr(o,t,i.toString()))}]`;if(typeof e.toJSON=="function")return lr(e.toJSON(n),t,n);if(e instanceof Map){const o={};for(const[i,a]of e)o[typeof i=="string"?i:lr(i,t)]=a;return lr(o,t,n)}return e instanceof Set?lr(Array.from(e).sort((o,i)=>lr(o,t).localeCompare(lr(i,t))),t,n):Symbol!==void 0&&e[Symbol.iterator]!=null&&typeof e[Symbol.iterator]=="function"?lr(Array.from(e),t,n):`{${Object.keys(e).filter(o=>e[o]!==void 0).sort().map(o=>`${lr(o,t)}:${lr(e[o],t,o)}`).join(",")}}`}function AH(e,t={allowFunctions:!1}){return lr(e,t)}var Q0=AH;const{TreeCache:CH}=y$,ff={equality:"reference",eviction:"keep-all",maxSize:1/0};function OH({equality:e=ff.equality,eviction:t=ff.eviction,maxSize:n=ff.maxSize}=ff,r){const o=RH(e);return kH(t,n,o,r)}function RH(e){switch(e){case"reference":return t=>t;case"value":return t=>Q0(t)}throw Ae(`Unrecognized equality policy ${e}`)}function kH(e,t,n,r){switch(e){case"keep-all":return new CH({name:r,mapNodeValue:n});case"lru":return yx({name:r,maxSize:et(t),mapNodeValue:n});case"most-recent":return yx({name:r,maxSize:1,mapNodeValue:n})}throw Ae(`Unrecognized eviction policy ${e}`)}var TH=OH;function $H(e){return()=>null}var PH={startPerfBlock:$H};const{isLoadable:MH,loadableWithError:pf,loadableWithPromise:jH,loadableWithValue:Sm}=wd,{WrappedValue:_$}=m$,{getNodeLoadable:hf,peekNodeLoadable:NH,setNodeValue:LH}=Di,{saveDepsToStore:IH}=xd,{DEFAULT_VALUE:DH,getConfigDeletionHandler:FH,getNode:UH,registerNode:vx}=_n,{isRecoilValue:VH}=Ol,{markRecoilValueModified:_x}=Xr,{retainedByOptionWithDefault:zH}=Ga,{recoilCallback:BH}=g$,{startPerfBlock:HH}=PH;class b${}const Au=new b$,Cu=[],gf=new Map,WH=(()=>{let e=0;return()=>e++})();function w$(e){let t=null;const{key:n,get:r,cachePolicy_UNSTABLE:o}=e,i=e.set!=null?e.set:void 0,a=new Set,s=TH(o??{equality:"reference",eviction:"keep-all"},n),l=zH(e.retainedBy_UNSTABLE),u=new Map;let c=0;function d(){return!Ve("recoil_memory_managament_2020")||c>0}function f(P){return P.getState().knownSelectors.add(n),c++,()=>{c--}}function p(){return FH(n)!==void 0&&!d()}function g(P,z,G,re,ee){W(z,re,ee),v(P,G)}function v(P,z){D(P,z)&&$(P),m(z,!0)}function _(P,z){D(P,z)&&(et(C(P)).stateVersions.clear(),m(z,!1))}function m(P,z){const G=gf.get(P);if(G!=null){for(const re of G)_x(re,et(t));z&&gf.delete(P)}}function h(P,z){let G=gf.get(z);G==null&&gf.set(z,G=new Set),G.add(P)}function y(P,z,G,re,ee,le){return z.then(ge=>{if(!d())throw $(P),Au;const ue=Sm(ge);return g(P,G,ee,ue,re),ge}).catch(ge=>{if(!d())throw $(P),Au;if(Ke(ge))return b(P,ge,G,re,ee,le);const ue=pf(ge);throw g(P,G,ee,ue,re),ge})}function b(P,z,G,re,ee,le){return z.then(ge=>{if(!d())throw $(P),Au;le.loadingDepKey!=null&&le.loadingDepPromise===z?G.atomValues.set(le.loadingDepKey,Sm(ge)):P.getState().knownSelectors.forEach(we=>{G.atomValues.delete(we)});const ue=A(P,G);if(ue&&ue.state!=="loading"){if((D(P,ee)||C(P)==null)&&v(P,ee),ue.state==="hasValue")return ue.contents;throw ue.contents}if(!D(P,ee)){const we=R(P,G);if(we!=null)return we.loadingLoadable.contents}const[Ce,je]=x(P,G,ee);if(Ce.state!=="loading"&&g(P,G,ee,Ce,je),Ce.state==="hasError")throw Ce.contents;return Ce.contents}).catch(ge=>{if(ge instanceof b$)throw Au;if(!d())throw $(P),Au;const ue=pf(ge);throw g(P,G,ee,ue,re),ge})}function S(P,z,G,re){var ee,le,ge,ue;if(D(P,re)||z.version===((ee=P.getState())===null||ee===void 0||(le=ee.currentTree)===null||le===void 0?void 0:le.version)||z.version===((ge=P.getState())===null||ge===void 0||(ue=ge.nextTree)===null||ue===void 0?void 0:ue.version)){var Ce,je,we;IH(n,G,P,(Ce=(je=P.getState())===null||je===void 0||(we=je.nextTree)===null||we===void 0?void 0:we.version)!==null&&Ce!==void 0?Ce:P.getState().currentTree.version)}for(const $e of G)a.add($e)}function x(P,z,G){const re=HH(n);let ee=!0,le=!0;const ge=()=>{re(),le=!1};let ue,Ce=!1,je;const we={loadingDepKey:null,loadingDepPromise:null},$e=new Map;function Ne({key:St}){const pt=hf(P,z,St);switch($e.set(St,pt),ee||(S(P,z,new Set($e.keys()),G),_(P,G)),pt.state){case"hasValue":return pt.contents;case"hasError":throw pt.contents;case"loading":throw we.loadingDepKey=St,we.loadingDepPromise=pt.contents,pt.contents}throw Ae("Invalid Loadable state")}const Ht=St=>(...pt)=>{if(le)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&&Bu(!1),BH(P,St,pt,{node:t})};try{ue=r({get:Ne,getCallback:Ht}),ue=VH(ue)?Ne(ue):ue,MH(ue)&&(ue.state==="hasError"&&(Ce=!0),ue=ue.contents),Ke(ue)?ue=y(P,ue,z,$e,G,we).finally(ge):ge(),ue=ue instanceof _$?ue.value:ue}catch(St){ue=St,Ke(ue)?ue=b(P,ue,z,$e,G,we).finally(ge):(Ce=!0,ge())}return Ce?je=pf(ue):Ke(ue)?je=jH(ue):je=Sm(ue),ee=!1,k(P,G,$e),S(P,z,new Set($e.keys()),G),[je,$e]}function A(P,z){let G=z.atomValues.get(n);if(G!=null)return G;const re=new Set;try{G=s.get(le=>(typeof le!="string"&&Bu(!1),hf(P,z,le).contents),{onNodeVisit:le=>{le.type==="branch"&&le.nodeKey!==n&&re.add(le.nodeKey)}})}catch(le){throw Ae(`Problem with cache lookup for selector "${n}": ${le.message}`)}if(G){var ee;z.atomValues.set(n,G),S(P,z,re,(ee=C(P))===null||ee===void 0?void 0:ee.executionID)}return G}function O(P,z){const G=A(P,z);if(G!=null)return $(P),G;const re=R(P,z);if(re!=null){var ee;return((ee=re.loadingLoadable)===null||ee===void 0?void 0:ee.state)==="loading"&&h(P,re.executionID),re.loadingLoadable}const le=WH(),[ge,ue]=x(P,z,le);return ge.state==="loading"?(T(P,le,ge,ue,z),h(P,le)):($(P),W(z,ge,ue)),ge}function R(P,z){const G=BT([u.has(P)?[et(u.get(P))]:[],I0(ub(u,([ee])=>ee!==P),([,ee])=>ee)]);function re(ee){for(const[le,ge]of ee)if(!hf(P,z,le).is(ge))return!0;return!1}for(const ee of G){if(ee.stateVersions.get(z.version)||!re(ee.depValuesDiscoveredSoFarDuringAsyncWork))return ee.stateVersions.set(z.version,!0),ee;ee.stateVersions.set(z.version,!1)}}function C(P){return u.get(P)}function T(P,z,G,re,ee){u.set(P,{depValuesDiscoveredSoFarDuringAsyncWork:re,executionID:z,loadingLoadable:G,stateVersions:new Map([[ee.version,!0]])})}function k(P,z,G){if(D(P,z)){const re=C(P);re!=null&&(re.depValuesDiscoveredSoFarDuringAsyncWork=G)}}function $(P){u.delete(P)}function D(P,z){var G;return z===((G=C(P))===null||G===void 0?void 0:G.executionID)}function N(P){return Array.from(P.entries()).map(([z,G])=>[z,G.contents])}function W(P,z,G){P.atomValues.set(n,z);try{s.set(N(G),z)}catch(re){throw Ae(`Problem with setting cache for selector "${n}": ${re.message}`)}}function Q(P){if(Cu.includes(n)){const z=`Recoil selector has circular dependencies: ${Cu.slice(Cu.indexOf(n)).join(" → ")}`;return pf(Ae(z))}Cu.push(n);try{return P()}finally{Cu.pop()}}function V(P,z){const G=z.atomValues.get(n);return G??s.get(re=>{var ee;return typeof re!="string"&&Bu(!1),(ee=NH(P,z,re))===null||ee===void 0?void 0:ee.contents})}function K(P,z){return Q(()=>O(P,z))}function B(P){P.atomValues.delete(n)}function Y(P,z){t==null&&Bu(!1);for(const re of a){var G;const ee=UH(re);(G=ee.clearCache)===null||G===void 0||G.call(ee,P,z)}a.clear(),B(z),s.clear(),_x(P,t)}return i!=null?t=vx({key:n,nodeType:"selector",peek:V,get:K,set:(z,G,re)=>{let ee=!1;const le=new Map;function ge({key:we}){if(ee)throw Ae("Recoil: Async selector sets are not currently supported.");const $e=hf(z,G,we);if($e.state==="hasValue")return $e.contents;if($e.state==="loading"){const Ne=`Getting value of asynchronous atom or selector "${we}" in a pending state while setting selector "${n}" is not yet supported.`;throw Ae(Ne)}else throw $e.contents}function ue(we,$e){if(ee)throw Ae("Recoil: Async selector sets are not currently supported.");const Ne=typeof $e=="function"?$e(ge(we)):$e;LH(z,G,we.key,Ne).forEach((St,pt)=>le.set(pt,St))}function Ce(we){ue(we,DH)}const je=i({set:ue,get:ge,reset:Ce},re);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 ee=!0,le},init:f,invalidate:B,clearCache:Y,shouldDeleteConfigOnRelease:p,dangerouslyAllowMutability:e.dangerouslyAllowMutability,shouldRestoreFromSnapshots:!1,retainedBy:l}):t=vx({key:n,nodeType:"selector",peek:V,get:K,init:f,invalidate:B,clearCache:Y,shouldDeleteConfigOnRelease:p,dangerouslyAllowMutability:e.dangerouslyAllowMutability,shouldRestoreFromSnapshots:!1,retainedBy:l})}w$.value=e=>new _$(e);var Tl=w$;const{isLoadable:qH,loadableWithError:xm,loadableWithPromise:Em,loadableWithValue:is}=wd,{WrappedValue:S$}=m$,{peekNodeInfo:GH}=Di,{DEFAULT_VALUE:Ji,DefaultValue:Ko,getConfigDeletionHandler:x$,registerNode:KH,setConfigDeletionHandler:YH}=_n,{isRecoilValue:QH}=Ol,{getRecoilValueAsLoadable:XH,markRecoilValueModified:ZH,setRecoilValue:bx,setRecoilValueLoadable:JH}=Xr,{retainedByOptionWithDefault:e7}=Ga,Ou=e=>e instanceof S$?e.value:e;function t7(e){const{key:t,persistence_UNSTABLE:n}=e,r=e7(e.retainedBy_UNSTABLE);let o=0;function i(h){return Em(h.then(y=>(a=is(y),y)).catch(y=>{throw a=xm(y),y}))}let a=Ke(e.default)?i(e.default):qH(e.default)?e.default.state==="loading"?i(e.default.contents):e.default:is(Ou(e.default));a.contents;let s;const l=new Map;function u(h){return h}function c(h,y){const b=y.then(S=>{var x,A;return((A=((x=h.getState().nextTree)!==null&&x!==void 0?x:h.getState().currentTree).atomValues.get(t))===null||A===void 0?void 0:A.contents)===b&&bx(h,m,S),S}).catch(S=>{var x,A;throw((A=((x=h.getState().nextTree)!==null&&x!==void 0?x:h.getState().currentTree).atomValues.get(t))===null||A===void 0?void 0:A.contents)===b&&JH(h,m,xm(S)),S});return b}function d(h,y,b){var S;o++;const x=()=>{var C;o--,(C=l.get(h))===null||C===void 0||C.forEach(T=>T()),l.delete(h)};if(h.getState().knownAtoms.add(t),a.state==="loading"){const C=()=>{var T;((T=h.getState().nextTree)!==null&&T!==void 0?T:h.getState().currentTree).atomValues.has(t)||ZH(h,m)};a.contents.finally(C)}const A=(S=e.effects)!==null&&S!==void 0?S:e.effects_UNSTABLE;if(A!=null){let C=function(B){if(D&&B.key===t){const Y=$;return Y instanceof Ko?f(h,y):Ke(Y)?Em(Y.then(P=>P instanceof Ko?a.toPromise():P)):is(Y)}return XH(h,B)},T=function(B){return C(B).toPromise()},k=function(B){var Y;const P=GH(h,(Y=h.getState().nextTree)!==null&&Y!==void 0?Y:h.getState().currentTree,B.key);return D&&B.key===t&&!($ instanceof Ko)?{...P,isSet:!0,loadable:C(B)}:P},$=Ji,D=!0,N=!1,W=null;const Q=B=>Y=>{if(D){const P=C(m),z=P.state==="hasValue"?P.contents:Ji;$=typeof Y=="function"?Y(z):Y,Ke($)&&($=$.then(G=>(W={effect:B,value:G},G)))}else{if(Ke(Y))throw Ae("Setting atoms to async values is not implemented.");typeof Y!="function"&&(W={effect:B,value:Ou(Y)}),bx(h,m,typeof Y=="function"?P=>{const z=Ou(Y(P));return W={effect:B,value:z},z}:Ou(Y))}},V=B=>()=>Q(B)(Ji),K=B=>Y=>{var P;const{release:z}=h.subscribeToTransactions(G=>{var re;let{currentTree:ee,previousTree:le}=G.getState();le||(le=ee);const ge=(re=ee.atomValues.get(t))!==null&&re!==void 0?re:a;if(ge.state==="hasValue"){var ue,Ce,je,we;const $e=ge.contents,Ne=(ue=le.atomValues.get(t))!==null&&ue!==void 0?ue:a,Ht=Ne.state==="hasValue"?Ne.contents:Ji;((Ce=W)===null||Ce===void 0?void 0:Ce.effect)!==B||((je=W)===null||je===void 0?void 0:je.value)!==$e?Y($e,Ht,!ee.atomValues.has(t)):((we=W)===null||we===void 0?void 0:we.effect)===B&&(W=null)}},t);l.set(h,[...(P=l.get(h))!==null&&P!==void 0?P:[],z])};for(const B of A)try{const Y=B({node:m,storeID:h.storeID,parentStoreID_UNSTABLE:h.parentStoreID,trigger:b,setSelf:Q(B),resetSelf:V(B),onSet:K(B),getPromise:T,getLoadable:C,getInfo_UNSTABLE:k});if(Y!=null){var O;l.set(h,[...(O=l.get(h))!==null&&O!==void 0?O:[],Y])}}catch(Y){$=Y,N=!0}if(D=!1,!($ instanceof Ko)){var R;const B=N?xm($):Ke($)?Em(c(h,$)):is(Ou($));B.contents,y.atomValues.set(t,B),(R=h.getState().nextTree)===null||R===void 0||R.atomValues.set(t,B)}}return x}function f(h,y){var b,S;return(b=(S=y.atomValues.get(t))!==null&&S!==void 0?S:s)!==null&&b!==void 0?b:a}function p(h,y){if(y.atomValues.has(t))return et(y.atomValues.get(t));if(y.nonvalidatedAtoms.has(t)){if(s!=null)return s;if(n==null)return a;const b=y.nonvalidatedAtoms.get(t),S=n.validator(b,Ji);return s=S instanceof Ko?a:is(S),s}else return a}function g(){s=void 0}function v(h,y,b){if(y.atomValues.has(t)){const S=et(y.atomValues.get(t));if(S.state==="hasValue"&&b===S.contents)return new Map}else if(!y.nonvalidatedAtoms.has(t)&&b instanceof Ko)return new Map;return s=void 0,new Map().set(t,is(b))}function _(){return x$(t)!==void 0&&o<=0}const m=KH({key:t,nodeType:"atom",peek:f,get:p,set:v,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 _b(e){const{...t}=e,n="default"in e?e.default:new Promise(()=>{});return QH(n)?n7({...t,default:n}):t7({...t,default:n})}function n7(e){const t=_b({...e,default:Ji,persistence_UNSTABLE:e.persistence_UNSTABLE===void 0?void 0:{...e.persistence_UNSTABLE,validator:r=>r instanceof Ko?r:et(e.persistence_UNSTABLE).validator(r,Ji)},effects:e.effects,effects_UNSTABLE:e.effects_UNSTABLE}),n=Tl({key:`${e.key}__withFallback`,get:({get:r})=>{const o=r(t);return o instanceof Ko?e.default:o},set:({set:r},o)=>r(t,o),cachePolicy_UNSTABLE:{eviction:"most-recent"},dangerouslyAllowMutability:e.dangerouslyAllowMutability});return YH(n.key,x$(e.key)),n}_b.value=e=>new S$(e);var E$=_b;class r7{constructor(t){var n;Ee(this,"_map",void 0),Ee(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 o7={MapCache:r7},i7=o7.MapCache,a7=Object.freeze({__proto__:null,MapCache:i7});const{LRUCache:wx}=v$,{MapCache:s7}=a7,mf={equality:"reference",eviction:"none",maxSize:1/0};function l7({equality:e=mf.equality,eviction:t=mf.eviction,maxSize:n=mf.maxSize}=mf){const r=u7(e);return c7(t,n,r)}function u7(e){switch(e){case"reference":return t=>t;case"value":return t=>Q0(t)}throw Ae(`Unrecognized equality policy ${e}`)}function c7(e,t,n){switch(e){case"keep-all":return new s7({mapKey:n});case"lru":return new wx({mapKey:n,maxSize:et(t)});case"most-recent":return new wx({mapKey:n,maxSize:1})}throw Ae(`Unrecognized eviction policy ${e}`)}var A$=l7;const{setConfigDeletionHandler:d7}=_n;function f7(e){var t,n;const r=A$({equality:(t=(n=e.cachePolicyForParams_UNSTABLE)===null||n===void 0?void 0:n.equality)!==null&&t!==void 0?t:"value",eviction:"keep-all"});return o=>{var i,a;const s=r.get(o);if(s!=null)return s;const{cachePolicyForParams_UNSTABLE:l,...u}=e,c="default"in e?e.default:new Promise(()=>{}),d=E$({...u,key:`${e.key}__${(i=Q0(o))!==null&&i!==void 0?i:"void"}`,default:typeof c=="function"?c(o):c,retainedBy_UNSTABLE:typeof e.retainedBy_UNSTABLE=="function"?e.retainedBy_UNSTABLE(o):e.retainedBy_UNSTABLE,effects:typeof e.effects=="function"?e.effects(o):typeof e.effects_UNSTABLE=="function"?e.effects_UNSTABLE(o):(a=e.effects)!==null&&a!==void 0?a:e.effects_UNSTABLE});return r.set(o,d),d7(d.key,()=>{r.delete(o)}),d}}var p7=f7;const{setConfigDeletionHandler:h7}=_n;let g7=0;function m7(e){var t,n;const r=A$({equality:(t=(n=e.cachePolicyForParams_UNSTABLE)===null||n===void 0?void 0:n.equality)!==null&&t!==void 0?t:"value",eviction:"keep-all"});return o=>{var i;let a;try{a=r.get(o)}catch(f){throw Ae(`Problem with cache lookup for selector ${e.key}: ${f.message}`)}if(a!=null)return a;const s=`${e.key}__selectorFamily/${(i=Q0(o,{allowFunctions:!0}))!==null&&i!==void 0?i:"void"}/${g7++}`,l=f=>e.get(o)(f),u=e.cachePolicy_UNSTABLE,c=typeof e.retainedBy_UNSTABLE=="function"?e.retainedBy_UNSTABLE(o):e.retainedBy_UNSTABLE;let d;if(e.set!=null){const f=e.set;d=Tl({key:s,get:l,set:(g,v)=>f(o)(g,v),cachePolicy_UNSTABLE:u,dangerouslyAllowMutability:e.dangerouslyAllowMutability,retainedBy_UNSTABLE:c})}else d=Tl({key:s,get:l,cachePolicy_UNSTABLE:u,dangerouslyAllowMutability:e.dangerouslyAllowMutability,retainedBy_UNSTABLE:c});return r.set(o,d),h7(d.key,()=>{r.delete(o)}),d}}var Fi=m7;const y7=Fi({key:"__constant",get:e=>()=>e,cachePolicyForParams_UNSTABLE:{equality:"reference"}});function v7(e){return y7(e)}var _7=v7;const b7=Fi({key:"__error",get:e=>()=>{throw Ae(e)},cachePolicyForParams_UNSTABLE:{equality:"reference"}});function w7(e){return b7(e)}var S7=w7;function x7(e){return e}var E7=x7;const{loadableWithError:C$,loadableWithPromise:O$,loadableWithValue:R$}=wd;function X0(e,t){const n=Array(t.length).fill(void 0),r=Array(t.length).fill(void 0);for(const[o,i]of t.entries())try{n[o]=e(i)}catch(a){r[o]=a}return[n,r]}function A7(e){return e!=null&&!Ke(e)}function Z0(e){return Array.isArray(e)?e:Object.getOwnPropertyNames(e).map(t=>e[t])}function u1(e,t){return Array.isArray(e)?t:Object.getOwnPropertyNames(e).reduce((n,r,o)=>({...n,[r]:t[o]}),{})}function Ks(e,t,n){const r=n.map((o,i)=>o==null?R$(t[i]):Ke(o)?O$(o):C$(o));return u1(e,r)}function C7(e,t){return t.map((n,r)=>n===void 0?e[r]:n)}const O7=Fi({key:"__waitForNone",get:e=>({get:t})=>{const n=Z0(e),[r,o]=X0(t,n);return Ks(e,r,o)},dangerouslyAllowMutability:!0}),R7=Fi({key:"__waitForAny",get:e=>({get:t})=>{const n=Z0(e),[r,o]=X0(t,n);return o.some(i=>!Ke(i))?Ks(e,r,o):new Promise(i=>{for(const[a,s]of o.entries())Ke(s)&&s.then(l=>{r[a]=l,o[a]=void 0,i(Ks(e,r,o))}).catch(l=>{o[a]=l,i(Ks(e,r,o))})})},dangerouslyAllowMutability:!0}),k7=Fi({key:"__waitForAll",get:e=>({get:t})=>{const n=Z0(e),[r,o]=X0(t,n);if(o.every(a=>a==null))return u1(e,r);const i=o.find(A7);if(i!=null)throw i;return Promise.all(o).then(a=>u1(e,C7(r,a)))},dangerouslyAllowMutability:!0}),T7=Fi({key:"__waitForAllSettled",get:e=>({get:t})=>{const n=Z0(e),[r,o]=X0(t,n);return o.every(i=>!Ke(i))?Ks(e,r,o):Promise.all(o.map((i,a)=>Ke(i)?i.then(s=>{r[a]=s,o[a]=void 0}).catch(s=>{r[a]=void 0,o[a]=s}):null)).then(()=>Ks(e,r,o))},dangerouslyAllowMutability:!0}),$7=Fi({key:"__noWait",get:e=>({get:t})=>{try{return Tl.value(R$(t(e)))}catch(n){return Tl.value(Ke(n)?O$(n):C$(n))}},dangerouslyAllowMutability:!0});var P7={waitForNone:O7,waitForAny:R7,waitForAll:k7,waitForAllSettled:T7,noWait:$7};const{RecoilLoadable:M7}=wd,{DefaultValue:j7}=_n,{RecoilRoot:N7,useRecoilStoreID:L7}=Po,{isRecoilValue:I7}=Ol,{retentionZone:D7}=F0,{freshSnapshot:F7}=W0,{useRecoilState:U7,useRecoilState_TRANSITION_SUPPORT_UNSTABLE:V7,useRecoilStateLoadable:z7,useRecoilValue:B7,useRecoilValue_TRANSITION_SUPPORT_UNSTABLE:H7,useRecoilValueLoadable:W7,useRecoilValueLoadable_TRANSITION_SUPPORT_UNSTABLE:q7,useResetRecoilState:G7,useSetRecoilState:K7}=o8,{useGotoRecoilSnapshot:Y7,useRecoilSnapshot:Q7,useRecoilTransactionObserver:X7}=d$,{useRecoilCallback:Z7}=g$,{noWait:J7,waitForAll:eW,waitForAllSettled:tW,waitForAny:nW,waitForNone:rW}=P7;var bb={DefaultValue:j7,isRecoilValue:I7,RecoilLoadable:M7,RecoilEnv:Gl,RecoilRoot:N7,useRecoilStoreID:L7,useRecoilBridgeAcrossReactRoots_UNSTABLE:$8,atom:E$,selector:Tl,atomFamily:p7,selectorFamily:Fi,constSelector:_7,errorSelector:S7,readOnlySelector:E7,noWait:J7,waitForNone:rW,waitForAny:nW,waitForAll:eW,waitForAllSettled:tW,useRecoilValue:B7,useRecoilValueLoadable:W7,useRecoilState:U7,useRecoilStateLoadable:z7,useSetRecoilState:K7,useResetRecoilState:G7,useGetRecoilValueInfo_UNSTABLE:A8,useRecoilRefresher_UNSTABLE:aH,useRecoilValueLoadable_TRANSITION_SUPPORT_UNSTABLE:q7,useRecoilValue_TRANSITION_SUPPORT_UNSTABLE:H7,useRecoilState_TRANSITION_SUPPORT_UNSTABLE:V7,useRecoilCallback:Z7,useRecoilTransaction_UNSTABLE:dH,useGotoRecoilSnapshot:Y7,useRecoilSnapshot:Q7,useRecoilTransactionObserver_UNSTABLE:X7,snapshot_UNSTABLE:F7,useRetain:hb,retentionZone:D7},oW=bb.RecoilRoot,k$=bb.atom,Sx=bb.useRecoilState,Od=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(){}},$l=typeof window>"u"||"Deno"in window;function Wn(){}function iW(e,t){return typeof e=="function"?e(t):e}function c1(e){return typeof e=="number"&&e>=0&&e!==1/0}function T$(e,t){return Math.max(e+(t||0)-Date.now(),0)}function xx(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:a,stale:s}=e;if(a){if(r){if(t.queryHash!==wb(a,t.options))return!1}else if(!Ic(t.queryKey,a))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof s=="boolean"&&t.isStale()!==s||typeof o<"u"&&o!==t.state.fetchStatus||i&&!i(t))}function Ex(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(Lc(t.options.mutationKey)!==Lc(i))return!1}else if(!Ic(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function wb(e,t){return((t==null?void 0:t.queryKeyHashFn)||Lc)(e)}function Lc(e){return JSON.stringify(e,(t,n)=>f1(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function Ic(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Ic(e[n],t[n])):!1}function $$(e,t){if(e===t)return e;const n=Ax(e)&&Ax(t);if(n||f1(e)&&f1(t)){const r=n?e:Object.keys(e),o=r.length,i=n?t:Object.keys(t),a=i.length,s=n?[]:{};let l=0;for(let u=0;u"u")return!0;const n=t.prototype;return!(!Cx(n)||!n.hasOwnProperty("isPrototypeOf"))}function Cx(e){return Object.prototype.toString.call(e)==="[object Object]"}function aW(e){return new Promise(t=>{setTimeout(t,e)})}function p1(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?$$(e,t):t}function sW(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function lW(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var ha,ni,nl,bO,uW=(bO=class extends Od{constructor(){super();he(this,ha,void 0);he(this,ni,void 0);he(this,nl,void 0);ce(this,nl,t=>{if(!$l&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){L(this,ni)||this.setEventListener(L(this,nl))}onUnsubscribe(){var t;this.hasListeners()||((t=L(this,ni))==null||t.call(this),ce(this,ni,void 0))}setEventListener(t){var n;ce(this,nl,t),(n=L(this,ni))==null||n.call(this),ce(this,ni,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){L(this,ha)!==t&&(ce(this,ha,t),this.onFocus())}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){var t;return typeof L(this,ha)=="boolean"?L(this,ha):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},ha=new WeakMap,ni=new WeakMap,nl=new WeakMap,bO),eh=new uW,rl,ri,ol,wO,cW=(wO=class extends Od{constructor(){super();he(this,rl,!0);he(this,ri,void 0);he(this,ol,void 0);ce(this,ol,t=>{if(!$l&&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(){L(this,ri)||this.setEventListener(L(this,ol))}onUnsubscribe(){var t;this.hasListeners()||((t=L(this,ri))==null||t.call(this),ce(this,ri,void 0))}setEventListener(t){var n;ce(this,ol,t),(n=L(this,ri))==null||n.call(this),ce(this,ri,t(this.setOnline.bind(this)))}setOnline(t){L(this,rl)!==t&&(ce(this,rl,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return L(this,rl)}},rl=new WeakMap,ri=new WeakMap,ol=new WeakMap,wO),th=new cW;function dW(e){return Math.min(1e3*2**e,3e4)}function J0(e){return(e??"online")==="online"?th.isOnline():!0}var P$=class{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Am(e){return e instanceof P$}function M$(e){let t=!1,n=0,r=!1,o,i,a;const s=new Promise((_,m)=>{i=_,a=m}),l=_=>{var m;r||(p(new P$(_)),(m=e.abort)==null||m.call(e))},u=()=>{t=!0},c=()=>{t=!1},d=()=>!eh.isFocused()||e.networkMode!=="always"&&!th.isOnline(),f=_=>{var m;r||(r=!0,(m=e.onSuccess)==null||m.call(e,_),o==null||o(),i(_))},p=_=>{var m;r||(r=!0,(m=e.onError)==null||m.call(e,_),o==null||o(),a(_))},g=()=>new Promise(_=>{var m;o=h=>{const y=r||!d();return y&&_(h),y},(m=e.onPause)==null||m.call(e)}).then(()=>{var _;o=void 0,r||(_=e.onContinue)==null||_.call(e)}),v=()=>{if(r)return;let _;try{_=e.fn()}catch(m){_=Promise.reject(m)}Promise.resolve(_).then(f).catch(m=>{var x;if(r)return;const h=e.retry??($l?0:3),y=e.retryDelay??dW,b=typeof y=="function"?y(n,m):y,S=h===!0||typeof h=="number"&&n{if(d())return g()}).then(()=>{t?p(m):v()})})};return J0(e.networkMode)?v():g().then(v),{promise:s,cancel:l,continue:()=>(o==null?void 0:o())?s:Promise.resolve(),cancelRetry:u,continueRetry:c}}function fW(){let e=[],t=0,n=f=>{f()},r=f=>{f()},o=f=>setTimeout(f,0);const i=f=>{o=f},a=f=>{let p;t++;try{p=f()}finally{t--,t||u()}return p},s=f=>{t?e.push(f):o(()=>{n(f)})},l=f=>(...p)=>{s(()=>{f(...p)})},u=()=>{const f=e;e=[],f.length&&o(()=>{r(()=>{f.forEach(p=>{n(p)})})})};return{batch:a,batchCalls:l,schedule:s,setNotifyFunction:f=>{n=f},setBatchNotifyFunction:f=>{r=f},setScheduler:i}}var Mt=fW(),ga,SO,j$=(SO=class{constructor(){he(this,ga,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),c1(this.gcTime)&&ce(this,ga,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??($l?1/0:5*60*1e3))}clearGcTimeout(){L(this,ga)&&(clearTimeout(L(this,ga)),ce(this,ga,void 0))}},ga=new WeakMap,SO),il,al,zn,oi,Bn,Et,rd,ma,sl,tp,dr,io,xO,pW=(xO=class extends j${constructor(t){super();he(this,sl);he(this,dr);he(this,il,void 0);he(this,al,void 0);he(this,zn,void 0);he(this,oi,void 0);he(this,Bn,void 0);he(this,Et,void 0);he(this,rd,void 0);he(this,ma,void 0);ce(this,ma,!1),ce(this,rd,t.defaultOptions),Re(this,sl,tp).call(this,t.options),ce(this,Et,[]),ce(this,zn,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ce(this,il,t.state||hW(this.options)),this.state=L(this,il),this.scheduleGc()}get meta(){return this.options.meta}optionalRemove(){!L(this,Et).length&&this.state.fetchStatus==="idle"&&L(this,zn).remove(this)}setData(t,n){const r=p1(this.state.data,t,this.options);return Re(this,dr,io).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Re(this,dr,io).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r;const n=L(this,oi);return(r=L(this,Bn))==null||r.cancel(t),n?n.then(Wn).catch(Wn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(L(this,il))}isActive(){return L(this,Et).some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||L(this,Et).some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!T$(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=L(this,Et).find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=L(this,Bn))==null||n.continue()}onOnline(){var n;const t=L(this,Et).find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=L(this,Bn))==null||n.continue()}addObserver(t){L(this,Et).includes(t)||(L(this,Et).push(t),this.clearGcTimeout(),L(this,zn).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){L(this,Et).includes(t)&&(ce(this,Et,L(this,Et).filter(n=>n!==t)),L(this,Et).length||(L(this,Bn)&&(L(this,ma)?L(this,Bn).cancel({revert:!0}):L(this,Bn).cancelRetry()),this.scheduleGc()),L(this,zn).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return L(this,Et).length}invalidate(){this.state.isInvalidated||Re(this,dr,io).call(this,{type:"invalidate"})}fetch(t,n){var u,c,d,f;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(L(this,oi))return(u=L(this,Bn))==null||u.continueRetry(),L(this,oi)}if(t&&Re(this,sl,tp).call(this,t),!this.options.queryFn){const p=L(this,Et).find(g=>g.options.queryFn);p&&Re(this,sl,tp).call(this,p.options)}const r=new AbortController,o={queryKey:this.queryKey,meta:this.meta},i=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>(ce(this,ma,!0),r.signal)})};i(o);const a=()=>this.options.queryFn?(ce(this,ma,!1),this.options.persister?this.options.persister(this.options.queryFn,o,this):this.options.queryFn(o)):Promise.reject(new Error(`Missing queryFn: '${this.options.queryHash}'`)),s={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:a};i(s),(c=this.options.behavior)==null||c.onFetch(s,this),ce(this,al,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=s.fetchOptions)==null?void 0:d.meta))&&Re(this,dr,io).call(this,{type:"fetch",meta:(f=s.fetchOptions)==null?void 0:f.meta});const l=p=>{var g,v,_,m;Am(p)&&p.silent||Re(this,dr,io).call(this,{type:"error",error:p}),Am(p)||((v=(g=L(this,zn).config).onError)==null||v.call(g,p,this),(m=(_=L(this,zn).config).onSettled)==null||m.call(_,this.state.data,p,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return ce(this,Bn,M$({fn:s.fetchFn,abort:r.abort.bind(r),onSuccess:p=>{var g,v,_,m;if(typeof p>"u"){l(new Error(`${this.queryHash} data is undefined`));return}this.setData(p),(v=(g=L(this,zn).config).onSuccess)==null||v.call(g,p,this),(m=(_=L(this,zn).config).onSettled)==null||m.call(_,p,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:l,onFail:(p,g)=>{Re(this,dr,io).call(this,{type:"failed",failureCount:p,error:g})},onPause:()=>{Re(this,dr,io).call(this,{type:"pause"})},onContinue:()=>{Re(this,dr,io).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode})),ce(this,oi,L(this,Bn).promise),L(this,oi)}},il=new WeakMap,al=new WeakMap,zn=new WeakMap,oi=new WeakMap,Bn=new WeakMap,Et=new WeakMap,rd=new WeakMap,ma=new WeakMap,sl=new WeakSet,tp=function(t){this.options={...L(this,rd),...t},this.updateGcTime(this.options.gcTime)},dr=new WeakSet,io=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:t.meta??null,fetchStatus:J0(this.options.networkMode)?"fetching":"paused",...!r.dataUpdatedAt&&{error:null,status:"pending"}};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const o=t.error;return Am(o)&&o.revert&&L(this,al)?{...L(this,al),fetchStatus:"idle"}:{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Mt.batch(()=>{L(this,Et).forEach(r=>{r.onQueryUpdate()}),L(this,zn).notify({query:this,type:"updated",action:t})})},xO);function hW(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=typeof t<"u",r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var jr,EO,gW=(EO=class extends Od{constructor(t={}){super();he(this,jr,void 0);this.config=t,ce(this,jr,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??wb(o,n);let a=this.get(i);return a||(a=new pW({cache:this,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(a)),a}add(t){L(this,jr).has(t.queryHash)||(L(this,jr).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=L(this,jr).get(t.queryHash);n&&(t.destroy(),n===t&&L(this,jr).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Mt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return L(this,jr).get(t)}getAll(){return[...L(this,jr).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>xx(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>xx(t,r)):n}notify(t){Mt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Mt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Mt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},jr=new WeakMap,EO),Nr,od,En,ll,Lr,Bo,AO,mW=(AO=class extends j${constructor(t){super();he(this,Lr);he(this,Nr,void 0);he(this,od,void 0);he(this,En,void 0);he(this,ll,void 0);this.mutationId=t.mutationId,ce(this,od,t.defaultOptions),ce(this,En,t.mutationCache),ce(this,Nr,[]),this.state=t.state||yW(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...L(this,od),...t},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){L(this,Nr).includes(t)||(L(this,Nr).push(t),this.clearGcTimeout(),L(this,En).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ce(this,Nr,L(this,Nr).filter(n=>n!==t)),this.scheduleGc(),L(this,En).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){L(this,Nr).length||(this.state.status==="pending"?this.scheduleGc():L(this,En).remove(this))}continue(){var t;return((t=L(this,ll))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,a,s,l,u,c,d,f,p,g,v,_,m,h,y,b,S,x,A;const n=()=>(ce(this,ll,M$({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(O,R)=>{Re(this,Lr,Bo).call(this,{type:"failed",failureCount:O,error:R})},onPause:()=>{Re(this,Lr,Bo).call(this,{type:"pause"})},onContinue:()=>{Re(this,Lr,Bo).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),L(this,ll).promise),r=this.state.status==="pending";try{if(!r){Re(this,Lr,Bo).call(this,{type:"pending",variables:t}),await((i=(o=L(this,En).config).onMutate)==null?void 0:i.call(o,t,this));const R=await((s=(a=this.options).onMutate)==null?void 0:s.call(a,t));R!==this.state.context&&Re(this,Lr,Bo).call(this,{type:"pending",context:R,variables:t})}const O=await n();return await((u=(l=L(this,En).config).onSuccess)==null?void 0:u.call(l,O,t,this.state.context,this)),await((d=(c=this.options).onSuccess)==null?void 0:d.call(c,O,t,this.state.context)),await((p=(f=L(this,En).config).onSettled)==null?void 0:p.call(f,O,null,this.state.variables,this.state.context,this)),await((v=(g=this.options).onSettled)==null?void 0:v.call(g,O,null,t,this.state.context)),Re(this,Lr,Bo).call(this,{type:"success",data:O}),O}catch(O){try{throw await((m=(_=L(this,En).config).onError)==null?void 0:m.call(_,O,t,this.state.context,this)),await((y=(h=this.options).onError)==null?void 0:y.call(h,O,t,this.state.context)),await((S=(b=L(this,En).config).onSettled)==null?void 0:S.call(b,void 0,O,this.state.variables,this.state.context,this)),await((A=(x=this.options).onSettled)==null?void 0:A.call(x,void 0,O,t,this.state.context)),O}finally{Re(this,Lr,Bo).call(this,{type:"error",error:O})}}}},Nr=new WeakMap,od=new WeakMap,En=new WeakMap,ll=new WeakMap,Lr=new WeakSet,Bo=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:!J0(this.options.networkMode),status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Mt.batch(()=>{L(this,Nr).forEach(r=>{r.onMutationUpdate(t)}),L(this,En).notify({mutation:this,type:"updated",action:t})})},AO);function yW(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Hn,id,ya,CO,vW=(CO=class extends Od{constructor(t={}){super();he(this,Hn,void 0);he(this,id,void 0);he(this,ya,void 0);this.config=t,ce(this,Hn,[]),ce(this,id,0)}build(t,n,r){const o=new mW({mutationCache:this,mutationId:++Gd(this,id)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){L(this,Hn).push(t),this.notify({type:"added",mutation:t})}remove(t){ce(this,Hn,L(this,Hn).filter(n=>n!==t)),this.notify({type:"removed",mutation:t})}clear(){Mt.batch(()=>{L(this,Hn).forEach(t=>{this.remove(t)})})}getAll(){return L(this,Hn)}find(t){const n={exact:!0,...t};return L(this,Hn).find(r=>Ex(n,r))}findAll(t={}){return L(this,Hn).filter(n=>Ex(t,n))}notify(t){Mt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){return ce(this,ya,(L(this,ya)??Promise.resolve()).then(()=>{const t=L(this,Hn).filter(n=>n.state.isPaused);return Mt.batch(()=>t.reduce((n,r)=>n.then(()=>r.continue().catch(Wn)),Promise.resolve()))}).then(()=>{ce(this,ya,void 0)})),L(this,ya)}},Hn=new WeakMap,id=new WeakMap,ya=new WeakMap,CO);function _W(e){return{onFetch:(t,n)=>{const r=async()=>{var g,v,_,m,h;const o=t.options,i=(_=(v=(g=t.fetchOptions)==null?void 0:g.meta)==null?void 0:v.fetchMore)==null?void 0:_.direction,a=((m=t.state.data)==null?void 0:m.pages)||[],s=((h=t.state.data)==null?void 0:h.pageParams)||[],l={pages:[],pageParams:[]};let u=!1;const c=y=>{Object.defineProperty(y,"signal",{enumerable:!0,get:()=>(t.signal.aborted?u=!0:t.signal.addEventListener("abort",()=>{u=!0}),t.signal)})},d=t.options.queryFn||(()=>Promise.reject(new Error(`Missing queryFn: '${t.options.queryHash}'`))),f=async(y,b,S)=>{if(u)return Promise.reject();if(b==null&&y.pages.length)return Promise.resolve(y);const x={queryKey:t.queryKey,pageParam:b,direction:S?"backward":"forward",meta:t.options.meta};c(x);const A=await d(x),{maxPages:O}=t.options,R=S?lW:sW;return{pages:R(y.pages,A,O),pageParams:R(y.pageParams,b,O)}};let p;if(i&&a.length){const y=i==="backward",b=y?bW:Ox,S={pages:a,pageParams:s},x=b(o,S);p=await f(S,x,y)}else{p=await f(l,s[0]??o.initialPageParam);const y=e??a.length;for(let b=1;b{var o,i;return(i=(o=t.options).persister)==null?void 0:i.call(o,r,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=r}}}function Ox(e,{pages:t,pageParams:n}){const r=t.length-1;return e.getNextPageParam(t[r],t,n[r],n)}function bW(e,{pages:t,pageParams:n}){var r;return(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n)}var mt,ii,ai,ul,cl,si,dl,fl,OO,wW=(OO=class{constructor(e={}){he(this,mt,void 0);he(this,ii,void 0);he(this,ai,void 0);he(this,ul,void 0);he(this,cl,void 0);he(this,si,void 0);he(this,dl,void 0);he(this,fl,void 0);ce(this,mt,e.queryCache||new gW),ce(this,ii,e.mutationCache||new vW),ce(this,ai,e.defaultOptions||{}),ce(this,ul,new Map),ce(this,cl,new Map),ce(this,si,0)}mount(){Gd(this,si)._++,L(this,si)===1&&(ce(this,dl,eh.subscribe(()=>{eh.isFocused()&&(this.resumePausedMutations(),L(this,mt).onFocus())})),ce(this,fl,th.subscribe(()=>{th.isOnline()&&(this.resumePausedMutations(),L(this,mt).onOnline())})))}unmount(){var e,t;Gd(this,si)._--,L(this,si)===0&&((e=L(this,dl))==null||e.call(this),ce(this,dl,void 0),(t=L(this,fl))==null||t.call(this),ce(this,fl,void 0))}isFetching(e){return L(this,mt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return L(this,ii).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=L(this,mt).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);return t!==void 0?Promise.resolve(t):this.fetchQuery(e)}getQueriesData(e){return this.getQueryCache().findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=L(this,mt).get(r.queryHash),i=o==null?void 0:o.state.data,a=iW(t,i);if(!(typeof a>"u"))return L(this,mt).build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return Mt.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=L(this,mt).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=L(this,mt);Mt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=L(this,mt),r={type:"active",...e};return Mt.batch(()=>(n.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=Mt.batch(()=>L(this,mt).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(Wn).catch(Wn)}invalidateQueries(e={},t={}){return Mt.batch(()=>{if(L(this,mt).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=Mt.batch(()=>L(this,mt).findAll(e).filter(o=>!o.isDisabled()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(Wn)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Wn)}fetchQuery(e){const t=this.defaultQueryOptions(e);typeof t.retry>"u"&&(t.retry=!1);const n=L(this,mt).build(this,t);return n.isStaleByTime(t.staleTime)?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Wn).catch(Wn)}fetchInfiniteQuery(e){return e.behavior=_W(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Wn).catch(Wn)}resumePausedMutations(){return L(this,ii).resumePausedMutations()}getQueryCache(){return L(this,mt)}getMutationCache(){return L(this,ii)}getDefaultOptions(){return L(this,ai)}setDefaultOptions(e){ce(this,ai,e)}setQueryDefaults(e,t){L(this,ul).set(Lc(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...L(this,ul).values()];let n={};return t.forEach(r=>{Ic(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){L(this,cl).set(Lc(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...L(this,cl).values()];let n={};return t.forEach(r=>{Ic(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...L(this,ai).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=wb(t.queryKey,t)),typeof t.refetchOnReconnect>"u"&&(t.refetchOnReconnect=t.networkMode!=="always"),typeof t.throwOnError>"u"&&(t.throwOnError=!!t.suspense),typeof t.networkMode>"u"&&t.persister&&(t.networkMode="offlineFirst"),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...L(this,ai).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){L(this,mt).clear(),L(this,ii).clear()}},mt=new WeakMap,ii=new WeakMap,ai=new WeakMap,ul=new WeakMap,cl=new WeakMap,si=new WeakMap,dl=new WeakMap,fl=new WeakMap,OO),sn,Ge,ad,qt,va,pl,Ir,sd,hl,gl,_a,ba,li,ml,wa,Hu,ld,h1,ud,g1,cd,m1,dd,y1,fd,v1,pd,_1,hd,b1,d0,N$,RO,SW=(RO=class extends Od{constructor(t,n){super();he(this,wa);he(this,ld);he(this,ud);he(this,cd);he(this,dd);he(this,fd);he(this,pd);he(this,hd);he(this,d0);he(this,sn,void 0);he(this,Ge,void 0);he(this,ad,void 0);he(this,qt,void 0);he(this,va,void 0);he(this,pl,void 0);he(this,Ir,void 0);he(this,sd,void 0);he(this,hl,void 0);he(this,gl,void 0);he(this,_a,void 0);he(this,ba,void 0);he(this,li,void 0);he(this,ml,new Set);this.options=n,ce(this,sn,t),ce(this,Ir,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(L(this,Ge).addObserver(this),Rx(L(this,Ge),this.options)?Re(this,wa,Hu).call(this):this.updateResult(),Re(this,dd,y1).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return w1(L(this,Ge),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return w1(L(this,Ge),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Re(this,fd,v1).call(this),Re(this,pd,_1).call(this),L(this,Ge).removeObserver(this)}setOptions(t,n){const r=this.options,o=L(this,Ge);if(this.options=L(this,sn).defaultQueryOptions(t),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");Re(this,hd,b1).call(this),d1(this.options,r)||L(this,sn).getQueryCache().notify({type:"observerOptionsUpdated",query:L(this,Ge),observer:this});const i=this.hasListeners();i&&kx(L(this,Ge),o,this.options,r)&&Re(this,wa,Hu).call(this),this.updateResult(n),i&&(L(this,Ge)!==o||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&Re(this,ld,h1).call(this);const a=Re(this,ud,g1).call(this);i&&(L(this,Ge)!==o||this.options.enabled!==r.enabled||a!==L(this,li))&&Re(this,cd,m1).call(this,a)}getOptimisticResult(t){const n=L(this,sn).getQueryCache().build(L(this,sn),t),r=this.createResult(n,t);return EW(this,r)&&(ce(this,qt,r),ce(this,pl,this.options),ce(this,va,L(this,Ge).state)),r}getCurrentResult(){return L(this,qt)}trackResult(t){const n={};return Object.keys(t).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(L(this,ml).add(r),t[r])})}),n}getCurrentQuery(){return L(this,Ge)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=L(this,sn).defaultQueryOptions(t),r=L(this,sn).getQueryCache().build(L(this,sn),n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Re(this,wa,Hu).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),L(this,qt)))}createResult(t,n){var x;const r=L(this,Ge),o=this.options,i=L(this,qt),a=L(this,va),s=L(this,pl),u=t!==r?t.state:L(this,ad),{state:c}=t;let{error:d,errorUpdatedAt:f,fetchStatus:p,status:g}=c,v=!1,_;if(n._optimisticResults){const A=this.hasListeners(),O=!A&&Rx(t,n),R=A&&kx(t,r,n,o);(O||R)&&(p=J0(t.options.networkMode)?"fetching":"paused",c.dataUpdatedAt||(g="pending")),n._optimisticResults==="isRestoring"&&(p="idle")}if(n.select&&typeof c.data<"u")if(i&&c.data===(a==null?void 0:a.data)&&n.select===L(this,sd))_=L(this,hl);else try{ce(this,sd,n.select),_=n.select(c.data),_=p1(i==null?void 0:i.data,_,n),ce(this,hl,_),ce(this,Ir,null)}catch(A){ce(this,Ir,A)}else _=c.data;if(typeof n.placeholderData<"u"&&typeof _>"u"&&g==="pending"){let A;if(i!=null&&i.isPlaceholderData&&n.placeholderData===(s==null?void 0:s.placeholderData))A=i.data;else if(A=typeof n.placeholderData=="function"?n.placeholderData((x=L(this,gl))==null?void 0:x.state.data,L(this,gl)):n.placeholderData,n.select&&typeof A<"u")try{A=n.select(A),ce(this,Ir,null)}catch(O){ce(this,Ir,O)}typeof A<"u"&&(g="success",_=p1(i==null?void 0:i.data,A,n),v=!0)}L(this,Ir)&&(d=L(this,Ir),_=L(this,hl),f=Date.now(),g="error");const m=p==="fetching",h=g==="pending",y=g==="error",b=h&&m;return{status:g,fetchStatus:p,isPending:h,isSuccess:g==="success",isError:y,isInitialLoading:b,isLoading:b,data:_,dataUpdatedAt:c.dataUpdatedAt,error:d,errorUpdatedAt:f,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdateCount:c.errorUpdateCount,isFetched:c.dataUpdateCount>0||c.errorUpdateCount>0,isFetchedAfterMount:c.dataUpdateCount>u.dataUpdateCount||c.errorUpdateCount>u.errorUpdateCount,isFetching:m,isRefetching:m&&!h,isLoadingError:y&&c.dataUpdatedAt===0,isPaused:p==="paused",isPlaceholderData:v,isRefetchError:y&&c.dataUpdatedAt!==0,isStale:Sb(t,n),refetch:this.refetch}}updateResult(t){const n=L(this,qt),r=this.createResult(L(this,Ge),this.options);if(ce(this,va,L(this,Ge).state),ce(this,pl,this.options),L(this,va).data!==void 0&&ce(this,gl,L(this,Ge)),d1(r,n))return;ce(this,qt,r);const o={},i=()=>{if(!n)return!0;const{notifyOnChangeProps:a}=this.options,s=typeof a=="function"?a():a;if(s==="all"||!s&&!L(this,ml).size)return!0;const l=new Set(s??L(this,ml));return this.options.throwOnError&&l.add("error"),Object.keys(L(this,qt)).some(u=>{const c=u;return L(this,qt)[c]!==n[c]&&l.has(c)})};(t==null?void 0:t.listeners)!==!1&&i()&&(o.listeners=!0),Re(this,d0,N$).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Re(this,dd,y1).call(this)}},sn=new WeakMap,Ge=new WeakMap,ad=new WeakMap,qt=new WeakMap,va=new WeakMap,pl=new WeakMap,Ir=new WeakMap,sd=new WeakMap,hl=new WeakMap,gl=new WeakMap,_a=new WeakMap,ba=new WeakMap,li=new WeakMap,ml=new WeakMap,wa=new WeakSet,Hu=function(t){Re(this,hd,b1).call(this);let n=L(this,Ge).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Wn)),n},ld=new WeakSet,h1=function(){if(Re(this,fd,v1).call(this),$l||L(this,qt).isStale||!c1(this.options.staleTime))return;const n=T$(L(this,qt).dataUpdatedAt,this.options.staleTime)+1;ce(this,_a,setTimeout(()=>{L(this,qt).isStale||this.updateResult()},n))},ud=new WeakSet,g1=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(L(this,Ge)):this.options.refetchInterval)??!1},cd=new WeakSet,m1=function(t){Re(this,pd,_1).call(this),ce(this,li,t),!($l||this.options.enabled===!1||!c1(L(this,li))||L(this,li)===0)&&ce(this,ba,setInterval(()=>{(this.options.refetchIntervalInBackground||eh.isFocused())&&Re(this,wa,Hu).call(this)},L(this,li)))},dd=new WeakSet,y1=function(){Re(this,ld,h1).call(this),Re(this,cd,m1).call(this,Re(this,ud,g1).call(this))},fd=new WeakSet,v1=function(){L(this,_a)&&(clearTimeout(L(this,_a)),ce(this,_a,void 0))},pd=new WeakSet,_1=function(){L(this,ba)&&(clearInterval(L(this,ba)),ce(this,ba,void 0))},hd=new WeakSet,b1=function(){const t=L(this,sn).getQueryCache().build(L(this,sn),this.options);if(t===L(this,Ge))return;const n=L(this,Ge);ce(this,Ge,t),ce(this,ad,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},d0=new WeakSet,N$=function(t){Mt.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(L(this,qt))}),L(this,sn).getQueryCache().notify({query:L(this,Ge),type:"observerResultsUpdated"})})},RO);function xW(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Rx(e,t){return xW(e,t)||e.state.dataUpdatedAt>0&&w1(e,t,t.refetchOnMount)}function w1(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Sb(e,t)}return!1}function kx(e,t,n,r){return n.enabled!==!1&&(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&Sb(e,n)}function Sb(e,t){return e.isStaleByTime(t.staleTime)}function EW(e,t){return!d1(e.getCurrentResult(),t)}var L$=H.createContext(void 0),AW=e=>{const t=H.useContext(L$);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},CW=({client:e,children:t})=>(H.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),j.jsx(L$.Provider,{value:e,children:t})),I$=H.createContext(!1),OW=()=>H.useContext(I$);I$.Provider;function RW(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var kW=H.createContext(RW()),TW=()=>H.useContext(kW);function $W(e,t){return typeof e=="function"?e(...t):!!e}var PW=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},MW=e=>{H.useEffect(()=>{e.clearReset()},[e])},jW=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&$W(n,[e.error,r]),NW=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},LW=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,IW=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function DW(e,t,n){const r=AW(n),o=OW(),i=TW(),a=r.defaultQueryOptions(e);a._optimisticResults=o?"isRestoring":"optimistic",NW(a),PW(a,i),MW(i);const[s]=H.useState(()=>new t(r,a)),l=s.getOptimisticResult(a);if(H.useSyncExternalStore(H.useCallback(u=>{const c=o?()=>{}:s.subscribe(Mt.batchCalls(u));return s.updateResult(),c},[s,o]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),H.useEffect(()=>{s.setOptions(a,{listeners:!1})},[a,s]),LW(a,l))throw IW(a,s,i);if(jW({result:l,errorResetBoundary:i,throwOnError:a.throwOnError,query:r.getQueryCache().get(a.queryHash)}))throw l.error;return a.notifyOnChangeProps?l:s.trackResult(l)}function D$(e,t){return DW(e,SW,t)}const F$="Starter App",FW="This field is required.",U$=8,UW=`Password must be at least ${U$} characters long`,V$={required:FW},VW={...V$,minLength:{value:U$,message:UW}},zW="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",BW="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",HW="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",WW="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",qW="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",GW="/comet-starter/img/logo.png",KW=()=>{const e=t=>{t.preventDefault(),window.scrollTo(0,0)};return j.jsxs("footer",{className:"usa-footer",children:[j.jsx("div",{className:"grid-container usa-footer__return-to-top",children:j.jsx("a",{href:"/#",onClick:t=>{e(t)},children:"Return to top"})}),j.jsx("div",{className:"usa-footer__primary-section",children:j.jsx("nav",{className:"usa-footer__nav","aria-label":"Footer navigation",children:j.jsxs("ul",{className:"grid-row grid-gap",children:[j.jsx("li",{className:` + mobile-lg:grid-col-4 + desktop:grid-col-auto + usa-footer__primary-content + `,children:j.jsx("a",{className:"usa-footer__primary-link",href:"/#",children:""})}),j.jsx("li",{className:` + mobile-lg:grid-col-4 + desktop:grid-col-auto + usa-footer__primary-content + `,children:j.jsx("a",{className:"usa-footer__primary-link",href:"/#",children:""})}),j.jsx("li",{className:` + mobile-lg:grid-col-4 + desktop:grid-col-auto + usa-footer__primary-content + `,children:j.jsx("a",{className:"usa-footer__primary-link",href:"/#",children:""})}),j.jsx("li",{className:` + mobile-lg:grid-col-4 + desktop:grid-col-auto + usa-footer__primary-content + `,children:j.jsx("a",{className:"usa-footer__primary-link",href:"/#",children:""})}),j.jsx("li",{className:` + mobile-lg:grid-col-4 + desktop:grid-col-auto + usa-footer__primary-content + `,children:j.jsx("a",{className:"usa-footer__primary-link",href:"/#",children:""})})]})})}),j.jsx("div",{className:"usa-footer__secondary-section",children:j.jsx("div",{className:"grid-container",children:j.jsxs("div",{className:"grid-row grid-gap",children:[j.jsxs("div",{className:` + usa-footer__logo + grid-row + mobile-lg:grid-col-6 mobile-lg:grid-gap-2 + `,children:[j.jsx("div",{className:"mobile-lg:grid-col-auto",children:j.jsx("img",{className:"usa-footer__logo-img",src:GW,alt:"US Flag"})}),j.jsx("div",{className:"mobile-lg:grid-col-auto",children:j.jsx("p",{className:"usa-footer__logo-heading",children:F$})})]}),j.jsxs("div",{className:"usa-footer__contact-links mobile-lg:grid-col-6",children:[j.jsxs("div",{className:"usa-footer__social-links grid-row grid-gap-1",children:[j.jsx("div",{className:"grid-col-auto",children:j.jsx("a",{className:"usa-social-link",href:"/#",children:j.jsx("img",{className:"usa-social-link__icon",src:zW,alt:"Facebook"})})}),j.jsx("div",{className:"grid-col-auto",children:j.jsx("a",{className:"usa-social-link",href:"/#",children:j.jsx("img",{className:"usa-social-link__icon",src:WW,alt:"Twitter"})})}),j.jsx("div",{className:"grid-col-auto",children:j.jsx("a",{className:"usa-social-link",href:"/#",children:j.jsx("img",{className:"usa-social-link__icon",src:qW,alt:"YouTube"})})}),j.jsx("div",{className:"grid-col-auto",children:j.jsx("a",{className:"usa-social-link",href:"/#",children:j.jsx("img",{className:"usa-social-link__icon",src:BW,alt:"Instagram"})})}),j.jsx("div",{className:"grid-col-auto",children:j.jsx("a",{className:"usa-social-link",href:"/#",children:j.jsx("img",{className:"usa-social-link__icon",src:HW,alt:"RSS"})})})]}),j.jsx("h2",{className:"usa-footer__contact-heading",children:""}),j.jsx("address",{className:"usa-footer__address",children:j.jsxs("div",{className:"usa-footer__contact-info grid-row grid-gap",children:[j.jsx("div",{className:"grid-col-auto",children:j.jsx("a",{href:"tel:1-800-555-5555",children:" <(800) 555-GOVT> "})}),j.jsx("div",{className:"grid-col-auto",children:j.jsx("a",{href:"mailto:",children:""})})]})})]})]})})})]})},YW=e=>e&&typeof e=="object"&&e.nodeType===1;var Mo=(e,t)=>{if(typeof e!="string")return[];(!t||!YW(t))&&(t=window.document);const n=t.querySelectorAll(e);return Array.prototype.slice.call(n)};/* +object-assign +(c) Sindre Sorhus +@license MIT +*/var Tx=Object.getOwnPropertySymbols,QW=Object.prototype.hasOwnProperty,XW=Object.prototype.propertyIsEnumerable;function ZW(e){if(e==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function JW(){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(i){return t[i]});if(r.join("")!=="0123456789")return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(i){o[i]=i}),Object.keys(Object.assign({},o)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}var xb=JW()?Object.assign:function(e,t){for(var n,r=ZW(e),o,i=1;i-1?e.split(Px).map(function(a){return B$({type:a},i)}):(i.type=e,[i])};var Mx=function(e,t){var n=e[t];return delete e[t],n},H$=function(t,n){const r=Object.keys(t).reduce(function(o,i){var a=aq(i,t[i]);return o.concat(a)},[]);return B$({add:function(i){r.forEach(function(a){i.addEventListener(a.type,a.delegate,a.options)})},remove:function(i){r.forEach(function(a){i.removeEventListener(a.type,a.delegate,a.options)})}},n)};const sq=xb,lq=H$,jx=(...e)=>function(n=document.body){e.forEach(r=>{typeof this[r]=="function"&&this[r].call(this,n)})};var Mn=(e,t)=>lq(e,sq({on:jx("init","add"),off:jx("teardown","remove")},t));const Nx="aria-expanded",uq="aria-controls",Lx="hidden";var Ab=(e,t)=>{let n=t;typeof n!="boolean"&&(n=e.getAttribute(Nx)==="false"),e.setAttribute(Nx,n);const r=e.getAttribute(uq),o=document.getElementById(r);if(!o)throw new Error(`No toggle target found with id: "${r}"`);return n?o.removeAttribute(Lx):o.setAttribute(Lx,""),n};function cq(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 W$=cq,Yl={CLICK:"click"},or={prefix:"usa"};const q$=Mo,dq=Mn,Ix=Ab,fq=W$,{CLICK:pq}=Yl,{prefix:nh}=or,rh=`.${nh}-accordion, .${nh}-accordion--bordered`,hq=`.${nh}-banner__button`,cc=`.${nh}-accordion__button[aria-controls]:not(${hq})`,Dx="aria-expanded",gq="data-allow-multiple",G$=e=>q$(cc,e).filter(n=>n.closest(rh)===e),dc=(e,t)=>{const n=e.closest(rh);let r=t;if(!n)throw new Error(`${cc} is missing outer ${rh}`);r=Ix(e,t);const o=n.hasAttribute(gq);r&&!o&&G$(n).forEach(i=>{i!==e&&Ix(i,!1)})},mq=e=>dc(e,!0),yq=e=>dc(e,!1),vq=dq({[pq]:{[cc](){dc(this),this.getAttribute(Dx)==="true"&&(fq(this)||this.scrollIntoView())}}},{init(e){q$(cc,e).forEach(t=>{const n=t.getAttribute(Dx)==="true";dc(t,n)})},ACCORDION:rh,BUTTON:cc,show:mq,hide:yq,toggle:dc,getButtons:G$});var K$=vq;const Fx=ko(K$),_q=Mn,bq=Mo,{CLICK:wq}=Yl,{prefix:Y$}=or,Q$=Ab,X$=`.${Y$}-banner__header`,Z$=`${Y$}-banner__header--expanded`,S1=`${X$} [aria-controls]`,Sq=function(t){t.preventDefault();const n=t.target.closest(S1);Q$(n),this.closest(X$).classList.toggle(Z$)};var xq=_q({[wq]:{[S1]:Sq}},{init(e){bq(S1,e).forEach(t=>{const n=t.getAttribute(Z$)==="true";Q$(t,n)})}});const Ux=ko(xq),Eq="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAAsBAMAAAAncaPMAAAAAXNSR0IArs4c6QAAABtQTFRF////4EAg2z8g2z8f2z4f2j4fHjSyHjOxHTOxQEYPwgAAAIdJREFUeNrNkUENxDAMBEOhFJaCKZiCKZhCKBj2ebV3rdR71+pIq+Qxj1GyqjJ3U8VlHkc07hFm0awBYe91juq6MSI0yhSAEgkzJ4TMKiXyzFw3pgR9lmIBJlqj2AmBedf+IycExmlKZVzvZEJ4A0oBrjBl/m6PCy95B3fFAN6YuQPxhbcB4QMkEj04wQXD5wAAAABJRU5ErkJggg==",Aq="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",Cq="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 Oq=function(t,n=500){let r=null;return(...o)=>{window.clearTimeout(r),r=window.setTimeout(()=>{t.apply(this,o)},n)}};const Rq=Mo,kq=Mn,Tq=Oq,{prefix:eg}=or,Cb=`${eg}-character-count`,Cm=`.${Cb}`,x1=`.${eg}-character-count__field`,Vx=`.${eg}-character-count__message`,E1="The content is too long.",J$=`${eg}-character-count__status--invalid`,Ob=`${Cb}__status`,Rb=`${Cb}__sr-status`,$q=`.${Ob}`,Pq=`.${Rb}`,kb="characters allowed",Tb=e=>{const t=e.closest(Cm);if(!t)throw new Error(`${x1} is missing outer ${Cm}`);const n=t.querySelector(Vx);if(!n)throw new Error(`${Cm} is missing inner ${Vx}`);return{characterCountEl:t,messageEl:n}},Mq=e=>{const{characterCountEl:t}=Tb(e),n=e.getAttribute("maxlength");n&&(e.removeAttribute("maxlength"),t.setAttribute("data-maxlength",n))},eP=e=>{const t=document.createElement("div"),n=document.createElement("div"),o=`${e.dataset.maxlength} ${kb}`;t.classList.add(`${Ob}`,"usa-hint"),n.classList.add(`${Rb}`,"usa-sr-only"),t.setAttribute("aria-hidden",!0),n.setAttribute("aria-live","polite"),t.textContent=o,n.textContent=o,e.append(t,n)},tP=(e,t)=>{let n="";if(e===0)n=`${t} ${kb}`;else{const r=Math.abs(t-e),o=`character${r===1?"":"s"}`,i=e>t?"over limit":"left";n=`${r} ${o} ${i}`}return n},jq=Tq((e,t)=>{const n=e;n.textContent=t},1e3),zx=e=>{const{characterCountEl:t}=Tb(e),n=e.value.length,r=parseInt(t.getAttribute("data-maxlength"),10),o=t.querySelector($q),i=t.querySelector(Pq),a=tP(n,r);if(!r)return;const s=n&&n>r;o.textContent=a,jq(i,a),s&&!e.validationMessage&&e.setCustomValidity(E1),!s&&e.validationMessage===E1&&e.setCustomValidity(""),o.classList.toggle(J$,s)},Nq=e=>{const{characterCountEl:t,messageEl:n}=Tb(e);n.classList.add("usa-sr-only"),n.removeAttribute("aria-live"),Mq(e),eP(t)};kq({input:{[x1](){zx(this)}}},{init(e){Rq(x1,e).forEach(t=>Nq(t))},MESSAGE_INVALID_CLASS:J$,VALIDATION_MESSAGE:E1,STATUS_MESSAGE_CLASS:Ob,STATUS_MESSAGE_SR_ONLY_CLASS:Rb,DEFAULT_STATUS_LABEL:kb,createStatusMessages:eP,getCountMessage:tP,updateCountMessage:zx});var $b={exports:{}},Lq={exports:{}};(function(e,t){(function(){var n={polyfill:i,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 o="";for(r=65;r<91;r++)o=String.fromCharCode(r),n.keys[r]=[o.toLowerCase(),o.toUpperCase()];function i(){if(!("KeyboardEvent"in window)||"key"in KeyboardEvent.prototype)return!1;var a={get:function(s){var l=n.keys[this.which||this.keyCode];return Array.isArray(l)&&(l=l[+this.shiftKey]),l}};return Object.defineProperty(KeyboardEvent.prototype,"key",a),a}e.exports=n})()})(Lq);const A1={Alt:"altKey",Control:"ctrlKey",Ctrl:"ctrlKey",Shift:"shiftKey"},nP="+",Iq=function(e,t){var n=e.key;if(t)for(var r in A1)e[A1[r]]===!0&&(n=[r,n].join(nP));return n};$b.exports=function(t){const n=Object.keys(t).some(function(r){return r.indexOf(nP)>-1});return function(r){var o=Iq(r,n);return[o,o.toLowerCase()].reduce(function(i,a){return a in t&&(i=t[o].call(this,r)),i},void 0)}};$b.exports.MODIFIERS=A1;var tg=$b.exports;const Dq=Mo,Fq=e=>e&&typeof e=="object"&&e.nodeType===1;var Ka=(e,t)=>{const n=Dq(e,t);return typeof e!="string"||Fq(t)&&t.matches(e)&&n.push(t),n},rP={exports:{}};(function(e){rP.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),o=1;o{},Kr=(e,t="")=>{const n=e;n.value=t;const r=new CustomEvent("change",{bubbles:!0,cancelable:!0,detail:{value:t}});n.dispatchEvent(r)},kt=e=>{const t=e.closest(mo);if(!t)throw new Error(`Element is missing outer ${mo}`);const n=t.querySelector(Gq),r=t.querySelector(np),o=t.querySelector(Kq),i=t.querySelector(Qq),a=t.querySelector(dP),s=t.querySelector(Yq),l=t.querySelector(cP),u=t.querySelector(uP),c=t.classList.contains(Ya),d=t.dataset.disableFiltering==="true";return{comboBoxEl:t,selectEl:n,inputEl:r,listEl:o,statusEl:i,focusedOptionEl:a,selectedOptionEl:s,toggleListBtnEl:l,clearInputBtnEl:u,isPristine:c,disableFiltering:d}},fP=e=>{const{inputEl:t,toggleListBtnEl:n,clearInputBtnEl:r}=kt(e);r.hidden=!0,r.disabled=!0,n.disabled=!0,t.disabled=!0},Jq=e=>{const{inputEl:t,toggleListBtnEl:n,clearInputBtnEl:r}=kt(e);r.hidden=!0,r.setAttribute("aria-disabled",!0),n.setAttribute("aria-disabled",!0),t.setAttribute("aria-disabled",!0)},eG=e=>{const{inputEl:t,toggleListBtnEl:n,clearInputBtnEl:r}=kt(e);r.hidden=!1,r.disabled=!1,n.disabled=!1,t.disabled=!1},Hx=e=>{const t=e.closest(mo);if(t.dataset.enhanced)return;const n=t.querySelector("select");if(!n)throw new Error(`${mo} is missing inner select`);const r=n.id,o=document.querySelector(`label[for="${r}"]`),i=`${r}--list`,a=`${r}-label`,s=`${r}--assistiveHint`,l=[],{defaultValue:u}=t.dataset,{placeholder:c}=t.dataset;let d;if(c&&l.push({placeholder:c}),u)for(let p=0,g=n.options.length;p{if(n.hasAttribute(p)){const g=n.getAttribute(p);l.push({[p]:g}),n.removeAttribute(p)}});const f=document.createElement("input");if(f.setAttribute("id",r),f.setAttribute("aria-owns",i),f.setAttribute("aria-controls",i),f.setAttribute("aria-autocomplete","list"),f.setAttribute("aria-describedby",s),f.setAttribute("aria-expanded","false"),f.setAttribute("autocapitalize","off"),f.setAttribute("autocomplete","off"),f.setAttribute("class",iP),f.setAttribute("type","text"),f.setAttribute("role","combobox"),l.forEach(p=>Object.keys(p).forEach(g=>{const v=Bx.escapeHTML`${p[g]}`;f.setAttribute(g,v)})),t.insertAdjacentElement("beforeend",f),t.insertAdjacentHTML("beforeend",Bx.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:p}=kt(t);Kr(n,d.value),Kr(p,d.text),t.classList.add(Ya)}n.disabled&&(fP(t),n.disabled=!1),n.hasAttribute("aria-disabled")&&(Jq(t),n.removeAttribute("aria-disabled")),t.dataset.enhanced="true"},Rd=(e,t,{skipFocus:n,preventScroll:r}={})=>{const{inputEl:o,listEl:i,focusedOptionEl:a}=kt(e);if(a&&(a.classList.remove(Da),a.setAttribute("tabIndex","-1")),t){if(o.setAttribute("aria-activedescendant",t.id),t.setAttribute("tabIndex","0"),t.classList.add(Da),!r){const s=t.offsetTop+t.offsetHeight,l=i.scrollTop+i.offsetHeight;s>l&&(i.scrollTop=s-i.offsetHeight),t.offsetTop{const r=i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");let o=e.replace(/{{(.*?)}}/g,(i,a)=>{const s=a.trim(),l=n[s];if(s!=="query"&&l){const u=new RegExp(l,"i"),c=t.match(u);return c?r(c[1]):""}return r(t)});return o=`^(?:${o})$`,new RegExp(o,"i")},Pl=e=>{const{comboBoxEl:t,selectEl:n,inputEl:r,listEl:o,statusEl:i,isPristine:a,disableFiltering:s}=kt(e);let l,u;const c=`${o.id}--option-`,d=(r.value||"").toLowerCase(),f=t.dataset.filter||Xq,p=pP(f,d,t.dataset),g=[];for(let y=0,b=n.options.length;y{const S=`${c}${b}`,x=[Dc];let A="-1",O="false";S===l&&(x.push(sP,Da),A="0",O="true"),!l&&b===0&&(x.push(Da),A="0");const R=document.createElement("li");return R.setAttribute("aria-setsize",g.length),R.setAttribute("aria-posinset",b+1),R.setAttribute("aria-selected",O),R.setAttribute("id",S),R.setAttribute("class",x.join(" ")),R.setAttribute("tabindex",A),R.setAttribute("role","option"),R.setAttribute("data-value",y.value),R.textContent=y.text,R}),m=document.createElement("li");m.setAttribute("class",`${Dc}--no-results`),m.textContent="No results found",o.hidden=!1,v?(o.innerHTML="",_.forEach(y=>o.insertAdjacentElement("beforeend",y))):(o.innerHTML="",o.insertAdjacentElement("beforeend",m)),r.setAttribute("aria-expanded","true"),i.textContent=v?`${v} result${v>1?"s":""} available.`:"No results.";let h;a&&l?h=o.querySelector(`#${l}`):s&&u&&(h=o.querySelector(`#${u}`)),h&&Rd(o,h,{skipFocus:!0})},Fa=e=>{const{inputEl:t,listEl:n,statusEl:r,focusedOptionEl:o}=kt(e);r.innerHTML="",t.setAttribute("aria-expanded","false"),t.setAttribute("aria-activedescendant",""),o&&o.classList.remove(Da),n.scrollTop=0,n.hidden=!0},jb=e=>{const{comboBoxEl:t,selectEl:n,inputEl:r}=kt(e);Kr(n,e.dataset.value),Kr(r,e.textContent),t.classList.add(Ya),Fa(t),r.focus()},tG=e=>{const{comboBoxEl:t,listEl:n,selectEl:r,inputEl:o}=kt(e),i=!n.hidden;r.value&&Kr(r),o.value&&Kr(o),t.classList.remove(Ya),i&&Pl(t),o.focus()},Nb=e=>{const{comboBoxEl:t,selectEl:n,inputEl:r}=kt(e),o=n.value,i=(r.value||"").toLowerCase();if(o)for(let a=0,s=n.options.length;a{const{comboBoxEl:t,selectEl:n,inputEl:r,statusEl:o}=kt(e);o.textContent="";const i=(r.value||"").toLowerCase();if(i)for(let a=0,s=n.options.length;a{const{comboBoxEl:t,inputEl:n}=kt(e.target);Fa(t),Nb(t),n.focus()},Wx=e=>{const{comboBoxEl:t,listEl:n}=kt(e.target);n.hidden&&Pl(t);const r=n.querySelector(dP)||n.querySelector(rp);r&&Rd(t,r),e.preventDefault()},oG=e=>{const{comboBoxEl:t,listEl:n}=kt(e.target),r=!n.hidden;nG(t),r&&Fa(t),e.preventDefault()},qx=e=>{const t=e.target,n=t.nextSibling;n&&Rd(t,n),e.preventDefault()},iG=e=>{jb(e.target),e.preventDefault()},aG=e=>{jb(e.target),e.preventDefault()},Gx=e=>{const{comboBoxEl:t,listEl:n,focusedOptionEl:r}=kt(e.target),o=r&&r.previousSibling,i=!n.hidden;Rd(t,o),i&&e.preventDefault(),o||Fa(t)},sG=e=>{e.classList.contains(Da)||Rd(e,e,{preventScroll:!0})},lG=e=>{const{comboBoxEl:t,listEl:n,inputEl:r}=kt(e);n.hidden?Pl(t):Fa(t),r.focus()},uG=e=>{const{comboBoxEl:t,listEl:n}=kt(e);n.hidden&&Pl(t)},cG=Vq({[Bq]:{[np](){this.disabled||uG(this)},[cP](){this.disabled||lG(this)},[rp](){this.disabled||jb(this)},[uP](){this.disabled||tG(this)}},focusout:{[mo](e){this.contains(e.relatedTarget)||(Nb(this),Fa(this))}},keydown:{[mo]:Om({Escape:rG}),[np]:Om({Enter:oG,ArrowDown:Wx,Down:Wx}),[rp]:Om({ArrowUp:Gx,Up:Gx,ArrowDown:qx,Down:qx,Enter:aG," ":iG,"Shift+Tab":Zq})},input:{[np](){this.closest(mo).classList.remove(Ya),Pl(this)}},mouseover:{[rp](){sG(this)}}},{init(e){Uq(mo,e).forEach(t=>{Hx(t)})},getComboBoxContext:kt,enhanceComboBox:Hx,generateDynamicRegExp:pP,disable:fP,enable:eG,displayList:Pl,hideList:Fa,COMBO_BOX_CLASS:Cr});var dG=cG,hP=(e=document)=>e.activeElement;function fG(){return typeof navigator<"u"&&(navigator.userAgent.match(/(iPod|iPhone|iPad)/g)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!window.MSStream}var pG=fG;const Wi=tg,hG=Mn,gG=Mo,mG=Ka,{prefix:yG}=or,{CLICK:vG}=Yl,_G=hP,bG=pG,Ys=ng,jo=`${yG}-date-picker`,wG=`${jo}__wrapper`,SG=`${jo}--initialized`,gP=`${jo}--active`,mP=`${jo}__internal-input`,yP=`${jo}__external-input`,vP=`${jo}__button`,ct=`${jo}__calendar`,_P=`${jo}__status`,ir=`${ct}__date`,bP=`${ir}--focused`,xG=`${ir}--selected`,EG=`${ir}--previous-month`,wP=`${ir}--current-month`,AG=`${ir}--next-month`,CG=`${ir}--range-date`,OG=`${ir}--today`,RG=`${ir}--range-date-start`,kG=`${ir}--range-date-end`,TG=`${ir}--within-range`,SP=`${ct}__previous-year`,xP=`${ct}__previous-month`,EP=`${ct}__next-year`,AP=`${ct}__next-month`,CP=`${ct}__month-selection`,OP=`${ct}__year-selection`,rg=`${ct}__month`,Lb=`${rg}--focused`,$G=`${rg}--selected`,og=`${ct}__year`,Ib=`${og}--focused`,PG=`${og}--selected`,RP=`${ct}__previous-year-chunk`,kP=`${ct}__next-year-chunk`,TP=`${ct}__date-picker`,$P=`${ct}__month-picker`,PP=`${ct}__year-picker`,oh=`${ct}__table`,MG=`${ct}__row`,ds=`${ct}__cell`,yf=`${ds}--center-items`,jG=`${ct}__month-label`,NG=`${ct}__day-of-week`,Ua=`.${jo}`,MP=`.${vP}`,LG=`.${mP}`,op=`.${yP}`,ih=`.${ct}`,IG=`.${_P}`,Kx=`.${ir}`,Ql=`.${bP}`,DG=`.${wP}`,Db=`.${SP}`,Fb=`.${xP}`,Ub=`.${EP}`,Vb=`.${AP}`,jP=`.${OP}`,NP=`.${CP}`,C1=`.${rg}`,ah=`.${og}`,zb=`.${RP}`,Bb=`.${kP}`,Xl=`.${TP}`,FG=`.${$P}`,Hb=`.${PP}`,ig=`.${Lb}`,Zl=`.${Ib}`,Yx="Please enter a valid date",O1=["January","February","March","April","May","June","July","August","September","October","November","December"],UG=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],VG=13,Dr=12,zG="0000-01-01",ag="MM/DD/YYYY",LP="YYYY-MM-DD",BG=":not([disabled])",Wb=(...e)=>e.map(t=>t+BG).join(", "),HG=Wb(Db,Fb,jP,NP,Ub,Vb,Ql),WG=Wb(ig),qG=Wb(zb,Bb,Zl),qb=(e,t)=>(t!==e.getMonth()&&e.setDate(0),e),sh=(e,t,n)=>{const r=new Date(0);return r.setFullYear(e,t,n),r},Gb=()=>{const e=new Date,t=e.getDate(),n=e.getMonth(),r=e.getFullYear();return sh(r,n,t)},Kb=e=>{const t=new Date(0);return t.setFullYear(e.getFullYear(),e.getMonth(),1),t},IP=e=>{const t=new Date(0);return t.setFullYear(e.getFullYear(),e.getMonth()+1,0),t},Ea=(e,t)=>{const n=new Date(e.getTime());return n.setDate(n.getDate()+t),n},Yb=(e,t)=>Ea(e,-t),DP=(e,t)=>Ea(e,t*7),GG=(e,t)=>DP(e,-t),FP=e=>{const t=e.getDay();return Yb(e,t)},KG=e=>{const t=e.getDay();return Ea(e,6-t)},kd=(e,t)=>{const n=new Date(e.getTime()),r=(n.getMonth()+12+t)%12;return n.setMonth(n.getMonth()+t),qb(n,r),n},Qb=(e,t)=>kd(e,-t),Xb=(e,t)=>kd(e,t*12),UP=(e,t)=>Xb(e,-t),Ml=(e,t)=>{const n=new Date(e.getTime());return n.setMonth(t),qb(n,t),n},xi=(e,t)=>{const n=new Date(e.getTime()),r=n.getMonth();return n.setFullYear(t),qb(n,r),n},YG=(e,t)=>{let n=e;return t{let n=e;return t>e&&(n=t),new Date(n.getTime())},VP=(e,t)=>e&&t&&e.getFullYear()===t.getFullYear(),ea=(e,t)=>VP(e,t)&&e.getMonth()===t.getMonth(),Ho=(e,t)=>ea(e,t)&&e.getDate()===t.getDate(),jn=(e,t,n)=>{let r=e;return en&&(r=n),new Date(r.getTime())},R1=(e,t,n)=>e>=t&&(!n||e<=n),XG=(e,t,n)=>IP(e)n,Rm=(e,t,n)=>IP(Ml(e,11))n,pr=(e,t=LP,n=!1)=>{let r,o,i,a,s;if(e){let l,u,c;if(t===ag?[l,u,c]=e.split("/"):[c,l,u]=e.split("-"),c&&(s=parseInt(c,10),!Number.isNaN(s)&&(a=s,n&&(a=Math.max(0,a),c.length<3)))){const d=Gb().getFullYear();a=d-d%10**c.length+s}if(l&&(s=parseInt(l,10),Number.isNaN(s)||(o=s,n&&(o=Math.max(1,o),o=Math.min(12,o)))),o&&u&&a!=null&&(s=parseInt(u,10),!Number.isNaN(s)&&(i=s,n))){const d=sh(a,o,0).getDate();i=Math.max(1,i),i=Math.min(d,i)}o&&i&&a!=null&&(r=sh(a,o-1,i))}return r},jl=(e,t=LP)=>{const n=(a,s)=>`0000${a}`.slice(-s),r=e.getMonth()+1,o=e.getDate(),i=e.getFullYear();return t===ag?[n(r,2),n(o,2),n(i,4)].join("/"):[n(i,4),n(r,2),n(o,2)].join("-")},Zb=(e,t)=>{const n=[];let r=[],o=0;for(;o{i.insertAdjacentElement("beforeend",a)}),n.push(i)}return n},Jb=e=>{const t=document.createElement("tbody");return e.forEach(n=>{t.insertAdjacentElement("beforeend",n)}),t},k1=(e,t="")=>{const n=e;n.value=t;const r=new CustomEvent("change",{bubbles:!0,cancelable:!0,detail:{value:t}});n.dispatchEvent(r)},Ue=e=>{const t=e.closest(Ua);if(!t)throw new Error(`Element is missing outer ${Ua}`);const n=t.querySelector(LG),r=t.querySelector(op),o=t.querySelector(ih),i=t.querySelector(MP),a=t.querySelector(IG),s=t.querySelector(ah),l=pr(r.value,ag,!0),u=pr(n.value),c=pr(o.dataset.value),d=pr(t.dataset.minDate),f=pr(t.dataset.maxDate),p=pr(t.dataset.rangeDate),g=pr(t.dataset.defaultDate);if(d&&f&&d>f)throw new Error("Minimum date cannot be after maximum date");return{calendarDate:c,minDate:d,toggleBtnEl:i,selectedDate:u,maxDate:f,firstYearChunkEl:s,datePickerEl:t,inputDate:l,internalInputEl:n,externalInputEl:r,calendarEl:o,rangeDate:p,defaultDate:g,statusEl:a}},zP=e=>{const{externalInputEl:t,toggleBtnEl:n}=Ue(e);n.disabled=!0,t.disabled=!0},BP=e=>{const{externalInputEl:t,toggleBtnEl:n}=Ue(e);n.setAttribute("aria-disabled",!0),t.setAttribute("aria-disabled",!0)},ZG=e=>{const{externalInputEl:t,toggleBtnEl:n}=Ue(e);n.disabled=!1,t.disabled=!1},e2=e=>{const{externalInputEl:t,minDate:n,maxDate:r}=Ue(e),o=t.value;let i=!1;if(o){i=!0;const a=o.split("/"),[s,l,u]=a.map(c=>{let d;const f=parseInt(c,10);return Number.isNaN(f)||(d=f),d});if(s&&l&&u!=null){const c=sh(u,s-1,l);c.getMonth()===s-1&&c.getDate()===l&&c.getFullYear()===u&&a[2].length===4&&R1(c,n,r)&&(i=!1)}}return i},lh=e=>{const{externalInputEl:t}=Ue(e),n=e2(t);n&&!t.validationMessage&&t.setCustomValidity(Yx),!n&&t.validationMessage===Yx&&t.setCustomValidity("")},JG=e=>{const{internalInputEl:t,inputDate:n}=Ue(e);let r="";n&&!e2(e)&&(r=jl(n)),t.value!==r&&k1(t,r)},t2=(e,t)=>{const n=pr(t);if(n){const r=jl(n,ag),{datePickerEl:o,internalInputEl:i,externalInputEl:a}=Ue(e);k1(i,t),k1(a,r),lh(o)}},eK=e=>{const t=e.closest(Ua),{defaultValue:n}=t.dataset,r=t.querySelector("input");if(!r)throw new Error(`${Ua} is missing inner input`);r.value&&(r.value="");const o=pr(t.dataset.minDate||r.getAttribute("min"));t.dataset.minDate=o?jl(o):zG;const i=pr(t.dataset.maxDate||r.getAttribute("max"));i&&(t.dataset.maxDate=jl(i));const a=document.createElement("div");a.classList.add(wG);const s=r.cloneNode();s.classList.add(yP),s.type="text",a.appendChild(s),a.insertAdjacentHTML("beforeend",Ys.escapeHTML` + + +
`),r.setAttribute("aria-hidden","true"),r.setAttribute("tabindex","-1"),r.style.display="none",r.classList.add(mP),r.removeAttribute("id"),r.removeAttribute("name"),r.required=!1,t.appendChild(a),t.classList.add(SG),n&&t2(t,n),r.disabled&&(zP(t),r.disabled=!1),r.hasAttribute("aria-disabled")&&(BP(t),r.removeAttribute("aria-disabled"))},Or=(e,t)=>{const{datePickerEl:n,calendarEl:r,statusEl:o,selectedDate:i,maxDate:a,minDate:s,rangeDate:l}=Ue(e),u=Gb();let c=t||u;const d=r.hidden,f=Ea(c,0),p=c.getMonth(),g=c.getFullYear(),v=Qb(c,1),_=kd(c,1),m=jl(c),h=Kb(c),y=ea(c,s),b=ea(c,a),S=i||c,x=l&&YG(S,l),A=l&&QG(S,l),O=l&&Ea(x,1),R=l&&Yb(A,1),C=O1[p],T=P=>{const z=[ir],G=P.getDate(),re=P.getMonth(),ee=P.getFullYear(),le=P.getDay(),ge=jl(P);let ue="-1";const Ce=!R1(P,s,a),je=Ho(P,i);ea(P,v)&&z.push(EG),ea(P,f)&&z.push(wP),ea(P,_)&&z.push(AG),je&&z.push(xG),Ho(P,u)&&z.push(OG),l&&(Ho(P,l)&&z.push(CG),Ho(P,x)&&z.push(RG),Ho(P,A)&&z.push(kG),R1(P,O,R)&&z.push(TG)),Ho(P,f)&&(ue="0",z.push(bP));const we=O1[re],$e=UG[le],Ne=document.createElement("button");return Ne.setAttribute("type","button"),Ne.setAttribute("tabindex",ue),Ne.setAttribute("class",z.join(" ")),Ne.setAttribute("data-day",G),Ne.setAttribute("data-month",re+1),Ne.setAttribute("data-year",ee),Ne.setAttribute("data-value",ge),Ne.setAttribute("aria-label",Ys.escapeHTML`${G} ${we} ${ee} ${$e}`),Ne.setAttribute("aria-selected",je?"true":"false"),Ce===!0&&(Ne.disabled=!0),Ne.textContent=G,Ne};c=FP(h);const k=[];for(;k.length<28||c.getMonth()===p||k.length%7!==0;)k.push(T(c)),c=Ea(c,1);const $=Zb(k,7),D=r.cloneNode();D.dataset.value=m,D.style.top=`${n.offsetHeight}px`,D.hidden=!1,D.innerHTML=Ys.escapeHTML` +
+
+
+ +
+
+ +
+
+ + +
+
+ +
+
+ +
+
+
+ `;const N=document.createElement("table");N.setAttribute("class",oh);const W=document.createElement("thead");N.insertAdjacentElement("beforeend",W);const Q=document.createElement("tr");W.insertAdjacentElement("beforeend",Q);const V={Sunday:"S",Monday:"M",Tuesday:"T",Wednesday:"W",Thursday:"Th",Friday:"Fr",Saturday:"S"};Object.keys(V).forEach(P=>{const z=document.createElement("th");z.setAttribute("class",NG),z.setAttribute("scope","col"),z.setAttribute("aria-label",P),z.textContent=V[P],Q.insertAdjacentElement("beforeend",z)});const K=Jb($);N.insertAdjacentElement("beforeend",K),D.querySelector(Xl).insertAdjacentElement("beforeend",N),r.parentNode.replaceChild(D,r),n.classList.add(gP);const Y=[];return Ho(i,f)&&Y.push("Selected date"),d?(Y.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"),o.textContent=""):Y.push(`${C} ${g}`),o.textContent=Y.join(". "),D},tK=e=>{if(e.disabled)return;const{calendarEl:t,calendarDate:n,minDate:r,maxDate:o}=Ue(e);let i=UP(n,1);i=jn(i,r,o);const a=Or(t,i);let s=a.querySelector(Db);s.disabled&&(s=a.querySelector(Xl)),s.focus()},nK=e=>{if(e.disabled)return;const{calendarEl:t,calendarDate:n,minDate:r,maxDate:o}=Ue(e);let i=Qb(n,1);i=jn(i,r,o);const a=Or(t,i);let s=a.querySelector(Fb);s.disabled&&(s=a.querySelector(Xl)),s.focus()},rK=e=>{if(e.disabled)return;const{calendarEl:t,calendarDate:n,minDate:r,maxDate:o}=Ue(e);let i=kd(n,1);i=jn(i,r,o);const a=Or(t,i);let s=a.querySelector(Vb);s.disabled&&(s=a.querySelector(Xl)),s.focus()},oK=e=>{if(e.disabled)return;const{calendarEl:t,calendarDate:n,minDate:r,maxDate:o}=Ue(e);let i=Xb(n,1);i=jn(i,r,o);const a=Or(t,i);let s=a.querySelector(Ub);s.disabled&&(s=a.querySelector(Xl)),s.focus()},sg=e=>{const{datePickerEl:t,calendarEl:n,statusEl:r}=Ue(e);t.classList.remove(gP),n.hidden=!0,r.textContent=""},iK=e=>{if(e.disabled)return;const{datePickerEl:t,externalInputEl:n}=Ue(e);t2(e,e.dataset.value),sg(t),n.focus()},aK=e=>{if(e.disabled)return;const{calendarEl:t,inputDate:n,minDate:r,maxDate:o,defaultDate:i}=Ue(e);if(t.hidden){const a=jn(n||i||Gb(),r,o);Or(t,a).querySelector(Ql).focus()}else sg(e)},HP=e=>{const{calendarEl:t,inputDate:n,minDate:r,maxDate:o}=Ue(e);if(!t.hidden&&n){const a=jn(n,r,o);Or(t,a)}},n2=(e,t)=>{const{calendarEl:n,statusEl:r,calendarDate:o,minDate:i,maxDate:a}=Ue(e),s=o.getMonth(),l=t??s,u=O1.map((v,_)=>{const m=Ml(o,_),h=XG(m,i,a);let y="-1";const b=[rg],S=_===s;_===l&&(y="0",b.push(Lb)),S&&b.push($G);const x=document.createElement("button");return x.setAttribute("type","button"),x.setAttribute("tabindex",y),x.setAttribute("class",b.join(" ")),x.setAttribute("data-value",_),x.setAttribute("data-label",v),x.setAttribute("aria-selected",S?"true":"false"),h===!0&&(x.disabled=!0),x.textContent=v,x}),c=document.createElement("div");c.setAttribute("tabindex","-1"),c.setAttribute("class",$P);const d=document.createElement("table");d.setAttribute("class",oh),d.setAttribute("role","presentation");const f=Zb(u,3),p=Jb(f);d.insertAdjacentElement("beforeend",p),c.insertAdjacentElement("beforeend",d);const g=n.cloneNode();return g.insertAdjacentElement("beforeend",c),n.parentNode.replaceChild(g,n),r.textContent="Select a month.",g},sK=e=>{if(e.disabled)return;const{calendarEl:t,calendarDate:n,minDate:r,maxDate:o}=Ue(e),i=parseInt(e.dataset.value,10);let a=Ml(n,i);a=jn(a,r,o),Or(t,a).querySelector(Ql).focus()},Td=(e,t)=>{const{calendarEl:n,statusEl:r,calendarDate:o,minDate:i,maxDate:a}=Ue(e),s=o.getFullYear(),l=t??s;let u=l;u-=u%Dr,u=Math.max(0,u);const c=Rm(xi(o,u-1),i,a),d=Rm(xi(o,u+Dr),i,a),f=[];let p=u;for(;f.length{if(e.disabled)return;const{calendarEl:t,calendarDate:n,minDate:r,maxDate:o}=Ue(e),i=t.querySelector(Zl);let s=parseInt(i.textContent,10)-Dr;s=Math.max(0,s);const l=xi(n,s),u=jn(l,r,o),c=Td(t,u.getFullYear());let d=c.querySelector(zb);d.disabled&&(d=c.querySelector(Hb)),d.focus()},uK=e=>{if(e.disabled)return;const{calendarEl:t,calendarDate:n,minDate:r,maxDate:o}=Ue(e),i=t.querySelector(Zl);let s=parseInt(i.textContent,10)+Dr;s=Math.max(0,s);const l=xi(n,s),u=jn(l,r,o),c=Td(t,u.getFullYear());let d=c.querySelector(Bb);d.disabled&&(d=c.querySelector(Hb)),d.focus()},cK=e=>{if(e.disabled)return;const{calendarEl:t,calendarDate:n,minDate:r,maxDate:o}=Ue(e),i=parseInt(e.innerHTML,10);let a=xi(n,i);a=jn(a,r,o),Or(t,a).querySelector(Ql).focus()},dK=e=>{const{datePickerEl:t,externalInputEl:n}=Ue(e.target);sg(t),n.focus(),e.preventDefault()},Jr=e=>t=>{const{calendarEl:n,calendarDate:r,minDate:o,maxDate:i}=Ue(t.target),a=e(r),s=jn(a,o,i);Ho(r,s)||Or(n,s).querySelector(Ql).focus(),t.preventDefault()},Qx=Jr(e=>GG(e,1)),Xx=Jr(e=>DP(e,1)),Zx=Jr(e=>Yb(e,1)),Jx=Jr(e=>Ea(e,1)),fK=Jr(e=>FP(e)),pK=Jr(e=>KG(e)),hK=Jr(e=>kd(e,1)),gK=Jr(e=>Qb(e,1)),mK=Jr(e=>Xb(e,1)),yK=Jr(e=>UP(e,1)),vK=e=>{if(e.disabled)return;const t=e.closest(ih),n=t.dataset.value,r=e.dataset.value;if(r===n)return;const o=pr(r);Or(t,o).querySelector(Ql).focus()},Ui=e=>t=>{const n=t.target,r=parseInt(n.dataset.value,10),{calendarEl:o,calendarDate:i,minDate:a,maxDate:s}=Ue(n),l=Ml(i,r);let u=e(r);u=Math.max(0,Math.min(11,u));const c=Ml(i,u),d=jn(c,a,s);ea(l,d)||n2(o,d.getMonth()).querySelector(ig).focus(),t.preventDefault()},e6=Ui(e=>e-3),t6=Ui(e=>e+3),n6=Ui(e=>e-1),r6=Ui(e=>e+1),_K=Ui(e=>e-e%3),bK=Ui(e=>e+2-e%3),wK=Ui(()=>11),SK=Ui(()=>0),xK=e=>{if(e.disabled||e.classList.contains(Lb))return;const t=parseInt(e.dataset.value,10);n2(e,t).querySelector(ig).focus()},Vi=e=>t=>{const n=t.target,r=parseInt(n.dataset.value,10),{calendarEl:o,calendarDate:i,minDate:a,maxDate:s}=Ue(n),l=xi(i,r);let u=e(r);u=Math.max(0,u);const c=xi(i,u),d=jn(c,a,s);VP(l,d)||Td(o,d.getFullYear()).querySelector(Zl).focus(),t.preventDefault()},o6=Vi(e=>e-3),i6=Vi(e=>e+3),a6=Vi(e=>e-1),s6=Vi(e=>e+1),EK=Vi(e=>e-e%3),AK=Vi(e=>e+2-e%3),CK=Vi(e=>e-Dr),OK=Vi(e=>e+Dr),RK=e=>{if(e.disabled||e.classList.contains(Ib))return;const t=parseInt(e.dataset.value,10);Td(e,t).querySelector(Zl).focus()},r2=e=>{const t=n=>{const{calendarEl:r}=Ue(n),o=gG(e,r),i=0,a=o.length-1,s=o[i],l=o[a],u=o.indexOf(_G());return{focusableElements:o,isNotFound:u===-1,firstTabStop:s,isFirstTab:u===i,lastTabStop:l,isLastTab:u===a}};return{tabAhead(n){const{firstTabStop:r,isLastTab:o,isNotFound:i}=t(n.target);(o||i)&&(n.preventDefault(),r.focus())},tabBack(n){const{lastTabStop:r,isFirstTab:o,isNotFound:i}=t(n.target);(o||i)&&(n.preventDefault(),r.focus())}}},km=r2(HG),l6=r2(WG),u6=r2(qG),WP={[vG]:{[MP](){aK(this)},[Kx](){iK(this)},[C1](){sK(this)},[ah](){cK(this)},[Fb](){nK(this)},[Vb](){rK(this)},[Db](){tK(this)},[Ub](){oK(this)},[zb](){lK(this)},[Bb](){uK(this)},[NP](){n2(this).querySelector(ig).focus()},[jP](){Td(this).querySelector(Zl).focus()}},keyup:{[ih](e){const t=this.dataset.keydownKeyCode;`${e.keyCode}`!==t&&e.preventDefault()}},keydown:{[op](e){e.keyCode===VG&&lh(this)},[Kx]:Wi({Up:Qx,ArrowUp:Qx,Down:Xx,ArrowDown:Xx,Left:Zx,ArrowLeft:Zx,Right:Jx,ArrowRight:Jx,Home:fK,End:pK,PageDown:hK,PageUp:gK,"Shift+PageDown":mK,"Shift+PageUp":yK,Tab:km.tabAhead}),[Xl]:Wi({Tab:km.tabAhead,"Shift+Tab":km.tabBack}),[C1]:Wi({Up:e6,ArrowUp:e6,Down:t6,ArrowDown:t6,Left:n6,ArrowLeft:n6,Right:r6,ArrowRight:r6,Home:_K,End:bK,PageDown:wK,PageUp:SK}),[FG]:Wi({Tab:l6.tabAhead,"Shift+Tab":l6.tabBack}),[ah]:Wi({Up:o6,ArrowUp:o6,Down:i6,ArrowDown:i6,Left:a6,ArrowLeft:a6,Right:s6,ArrowRight:s6,Home:EK,End:AK,PageDown:OK,PageUp:CK}),[Hb]:Wi({Tab:u6.tabAhead,"Shift+Tab":u6.tabBack}),[ih](e){this.dataset.keydownKeyCode=e.keyCode},[Ua](e){Wi({Escape:dK})(e)}},focusout:{[op](){lh(this)},[Ua](e){this.contains(e.relatedTarget)||sg(this)}},input:{[op](){JG(this),HP(this)}}};bG()||(WP.mouseover={[DG](){vK(this)},[C1](){xK(this)},[ah](){RK(this)}});const kK=hG(WP,{init(e){mG(Ua,e).forEach(t=>{eK(t)})},getDatePickerContext:Ue,disable:zP,ariaDisable:BP,enable:ZG,isDateInputInvalid:e2,setCalendarValue:t2,validateDateInput:lh,renderCalendar:Or,updateCalendarIfVisible:HP});var TK=kK;const $K=Mn,PK=Mo,MK=Ka,{prefix:qP}=or,{getDatePickerContext:GP,isDateInputInvalid:KP,updateCalendarIfVisible:YP}=TK,jK=`${qP}-date-picker`,o2=`${qP}-date-range-picker`,QP=`${o2}__range-start`,XP=`${o2}__range-end`,Tm=`.${jK}`,Qs=`.${o2}`,ZP=`.${QP}`,JP=`.${XP}`,NK="0000-01-01",e4=e=>{const t=e.closest(Qs);if(!t)throw new Error(`Element is missing outer ${Qs}`);const n=t.querySelector(ZP),r=t.querySelector(JP);return{dateRangePickerEl:t,rangeStartEl:n,rangeEndEl:r}},t4=e=>{const{dateRangePickerEl:t,rangeStartEl:n,rangeEndEl:r}=e4(e),{internalInputEl:o}=GP(n),i=o.value;i&&!KP(o)?(r.dataset.minDate=i,r.dataset.rangeDate=i,r.dataset.defaultDate=i):(r.dataset.minDate=t.dataset.minDate||"",r.dataset.rangeDate="",r.dataset.defaultDate=""),YP(r)},n4=e=>{const{dateRangePickerEl:t,rangeStartEl:n,rangeEndEl:r}=e4(e),{internalInputEl:o}=GP(r),i=o.value;i&&!KP(o)?(n.dataset.maxDate=i,n.dataset.rangeDate=i,n.dataset.defaultDate=i):(n.dataset.maxDate=t.dataset.maxDate||"",n.dataset.rangeDate="",n.dataset.defaultDate=""),YP(n)},LK=e=>{const t=e.closest(Qs),[n,r]=PK(Tm,t);if(!n)throw new Error(`${Qs} is missing inner two '${Tm}' elements`);if(!r)throw new Error(`${Qs} is missing second '${Tm}' element`);n.classList.add(QP),r.classList.add(XP),t.dataset.minDate||(t.dataset.minDate=NK);const{minDate:o}=t.dataset;n.dataset.minDate=o,r.dataset.minDate=o;const{maxDate:i}=t.dataset;i&&(n.dataset.maxDate=i,r.dataset.maxDate=i),t4(t),n4(t)};$K({"input change":{[ZP](){t4(this)},[JP](){n4(this)}}},{init(e){MK(Qs,e).forEach(t=>{LK(t)})}});const c6=Ka,IK=Mn,uh=ng,{prefix:bn}=or,Fc=`${bn}-file-input`,Uc=`.${Fc}`,r4=`${bn}-file-input__input`,i2=`${bn}-file-input__target`,o4=`.${r4}`,DK=`${bn}-file-input__box`,i4=`${bn}-file-input__instructions`,a4=`${bn}-file-input__preview`,s4=`${bn}-file-input__preview-heading`,lg=`${bn}-file-input--disabled`,FK=`${bn}-file-input__choose`,l4=`${bn}-file-input__accepted-files-message`,d6=`${bn}-file-input__drag-text`,$m=`${bn}-file-input--drag`,f6="is-loading",T1="has-invalid-file",Jl=`${bn}-file-input__preview-image`,UK=`${Jl}--generic`,VK=`${Jl}--pdf`,zK=`${Jl}--word`,BK=`${Jl}--video`,HK=`${Jl}--excel`,u4=`${bn}-sr-only`,as="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";let $1=!0,P1="",M1="";const $d=e=>{const t=e.closest(Uc);if(!t)throw new Error(`Element is missing outer ${Uc}`);const n=t.querySelector(o4);return{dropZoneEl:t,inputEl:n}},WK=e=>{const{dropZoneEl:t,inputEl:n}=$d(e);n.disabled=!0,t.classList.add(lg)},qK=e=>{const{dropZoneEl:t}=$d(e);t.classList.add(lg)},GK=e=>{const{dropZoneEl:t,inputEl:n}=$d(e);n.disabled=!1,t.classList.remove(lg),t.removeAttribute("aria-disabled")},KK=e=>{const t=e.charCodeAt(0);return t===32?"-":t>=65&&t<=90?`img_${e.toLowerCase()}`:`__${t.toString(16).slice(-4)}`},YK=e=>e.replace(/[^a-z0-9]/g,KK),QK=e=>`${e}-${Math.floor(Date.now().toString()/1e3)}`,c4=e=>e.hasAttribute("multiple")?"files":"file",XK=e=>{const t=document.createElement("div"),n=document.createElement("div"),r=document.createElement("div");return e.classList.remove(Fc),e.classList.add(r4),t.classList.add(Fc),r.classList.add(DK),n.classList.add(i2),n.prepend(r),e.parentNode.insertBefore(n,e),e.parentNode.insertBefore(t,n),n.appendChild(e),t.appendChild(n),n},ZK=e=>{const t=e.closest(Uc),n=c4(e),r=document.createElement("div"),o=`Drag ${n} here or`,i="choose from folder";return P1=`${o} ${i}`,r.classList.add(i4),r.setAttribute("aria-hidden","true"),e.setAttribute("aria-label",P1),r.innerHTML=uh.escapeHTML`${o} ${i}`,e.parentNode.insertBefore(r,e),(/rv:11.0/i.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent))&&(t.querySelector(`.${d6}`).outerHTML=""),r},JK=e=>{const t=document.createElement("div"),n=c4(e),r=e.closest(Uc),o=e.closest(`.${i2}`);M1=`No ${n} selected.`,t.classList.add(u4),t.setAttribute("aria-live","polite"),t.textContent=M1,r.insertBefore(t,o)},eY=e=>{const t=e.hasAttribute("aria-disabled")||e.hasAttribute("disabled"),n=XK(e),r=ZK(e),{dropZoneEl:o}=$d(e);return t?o.classList.add(lg):JK(e),{instructions:r,dropTarget:n}},d4=(e,t)=>{const n=e.querySelectorAll(`.${a4}`),r=e.querySelector(`.${s4}`),o=e.querySelector(`.${l4}`),i=a=>{a.parentNode.removeChild(a)};r&&(r.outerHTML=""),o&&(o.outerHTML="",e.classList.remove(T1)),n!==null&&(t&&t.removeAttribute("hidden"),Array.prototype.forEach.call(n,i))},tY=(e,t,n)=>{const r=e;let o=M1;t.length===1?o=`You have selected the file: ${n}`:t.length>1&&(o=`You have selected ${t.length} files: ${n.join(", ")}`),setTimeout(()=>{r.textContent=o},1e3)},nY=(e,t)=>{const n=document.createElement("div"),r=e.closest(`.${i2}`),o=r.querySelector(`.${i4}`);let i="Change file",a="";t.length===1?a=uh.escapeHTML`Selected file ${i}`:t.length>1&&(i="Change files",a=uh.escapeHTML`${t.length} files selected ${i}`),o.setAttribute("hidden","true"),n.classList.add(s4),n.innerHTML=a,r.insertBefore(n,o),e.setAttribute("aria-label",i)},rY=(e,t,n,r)=>{const o=e.target.files,a=r.closest(`.${Fc}`).querySelector(`.${u4}`),s=[];d4(r,n);for(let l=0;l