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-PebAx8EB.js b/assets/index-PebAx8EB.js new file mode 100644 index 00000000..452f5baa --- /dev/null +++ b/assets/index-PebAx8EB.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 $L(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 PL(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 OO={exports:{}},f0={},RO={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"),ML=Symbol.for("react.portal"),jL=Symbol.for("react.fragment"),NL=Symbol.for("react.strict_mode"),LL=Symbol.for("react.profiler"),IL=Symbol.for("react.provider"),DL=Symbol.for("react.context"),FL=Symbol.for("react.forward_ref"),UL=Symbol.for("react.suspense"),VL=Symbol.for("react.memo"),zL=Symbol.for("react.lazy"),$w=Symbol.iterator;function BL(e){return e===null||typeof e!="object"?null:(e=$w&&e[$w]||e["@@iterator"],typeof e=="function"?e:null)}var kO={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},TO=Object.assign,$O={};function zl(e,t,n){this.props=e,this.context=t,this.refs=$O,this.updater=n||kO}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 PO(){}PO.prototype=zl.prototype;function r_(e,t,n){this.props=e,this.context=t,this.refs=$O,this.updater=n||kO}var o_=r_.prototype=new PO;o_.constructor=r_;TO(o_,zl.prototype);o_.isPureReactComponent=!0;var Pw=Array.isArray,MO=Object.prototype.hasOwnProperty,i_={current:null},jO={key:!0,ref:!0,__self:!0,__source:!0};function NO(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)MO.call(t,r)&&!jO.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}}}})(FO);DO.exports=FO;var tI=DO.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 UO=H,kn=tI;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"),Zy=Object.prototype.hasOwnProperty,nI=/^[: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]*$/,jw={},Nw={};function rI(e){return Zy.call(Nw,e)?!0:Zy.call(jw,e)?!1:nI.test(e)?Nw[e]=!0:(jw[e]=!0,!1)}function oI(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 iI(e,t,n,r){if(t===null||typeof t>"u"||oI(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 s_=/[\-:]([a-z])/g;function l_(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(s_,l_);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(s_,l_);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(s_,l_);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 u_(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 aI(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 nv(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 Jy:return"Profiler";case c_:return"StrictMode";case ev:return"Suspense";case tv:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case BO:return(e.displayName||"Context")+".Consumer";case zO:return(e._context.displayName||"Context")+".Provider";case d_:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case f_:return t=e.displayName||null,t!==null?t:nv(e.type)||"Memo";case Wo:t=e._payload,e=e._init;try{return nv(e(t))}catch{}}return null}function sI(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 nv(t);case 8:return t===c_?"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 WO(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function lI(e){var t=WO(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=lI(e))}function qO(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=WO(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 rv(e,t){var n=t.checked;return ot({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Iw(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 GO(e,t){t=t.checked,t!=null&&u_(e,"checked",t,!1)}function ov(e,t){GO(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")?iv(e,t.type,n):t.hasOwnProperty("defaultValue")&&iv(e,t.type,ki(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Dw(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 iv(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},uI=["Webkit","ms","Moz","O"];Object.keys(Zu).forEach(function(e){uI.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Zu[t]=Zu[e]})});function XO(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 ZO(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=XO(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var cI=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 lv(e,t){if(t){if(cI[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 uv(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 cv=null;function p_(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var dv=null,Bs=null,Hs=null;function Vw(e){if(e=vd(e)){if(typeof dv!="function")throw Error(J(280));var t=e.stateNode;t&&(t=y0(t),dv(e.stateNode,e.type,t))}}function JO(e){Bs?Hs?Hs.push(e):Hs=[e]:Bs=e}function eR(){if(Bs){var e=Bs,t=Hs;if(Hs=Bs=null,Vw(e),t)for(e=0;e>>=0,e===0?32:31-(wI(e)/SI|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 CI(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),Qw=" ",Xw=!1;function bR(e,t){switch(e){case"keyup":return eD.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function wR(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var _s=!1;function nD(e,t){switch(e){case"compositionend":return wR(t);case"keypress":return t.which!==32?null:(Xw=!0,Qw);case"textInput":return e=t.data,e===Qw&&Xw?null:e;default:return null}}function rD(e,t){if(_s)return e==="compositionend"||!w_&&bR(e,t)?(e=vR(),Bf=v_=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=tS(n)}}function AR(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?AR(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function CR(){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 S_(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 fD(e){var t=CR(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&AR(n.ownerDocument.documentElement,n)){if(r!==null&&S_(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=nS(n,i);var a=nS(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,yv=null,nc=null,vv=!1;function rS(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;vv||bs==null||bs!==wp(r)||(r=bs,"selectionStart"in r&&S_(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(yv,"onSelect"),0xs||(e.current=Ev[xs],Ev[xs]=null,xs--)}function He(e,t){xs++,Ev[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 cS(e,t,n){if(Vt.current!==Ti)throw Error(J(168));He(Vt,t),He(pn,n)}function NR(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,sI(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 dS(e,t,n){var r=e.stateNode;if(!r)throw Error(J(169));n?(e=NR(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 LR(e){po===null?po=[e]:po.push(e)}function ED(e){v0=!0,LR(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&&vS(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=HR(!0),WR=HR(!1),_d={},Wr=Li(_d),Rc=Li(_d),kc=Li(_d);function sa(e){if(e===_d)throw Error(J(174));return e}function $_(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:sv(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=sv(t,e)}Ye(Wr),He(Wr,t)}function wl(){Ye(Wr),Ye(Rc),Ye(kc)}function qR(e){sa(kc.current);var t=sa(Wr.current),n=sv(t,e.type);t!==n&&(He(Rc,e),He(Wr,n))}function P_(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 M_(){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 lk(){return er().memoizedState}function RD(e,t,n){var r=bi(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},uk(e))ck(t,n);else if(n=UR(e,t,n,r),n!==null){var o=Xt();Sr(n,e,r,o),dk(n,t,r)}}function kD(e,t,n){var r=bi(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(uk(e))ck(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,k_(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}finally{}n=UR(e,t,o,r),n!==null&&(o=Xt(),Sr(n,e,r,o),dk(n,t,r))}}function uk(e){var t=e.alternate;return e===nt||t!==null&&t===nt}function ck(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 dk(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,g_(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},TD={readContext:Jn,useCallback:function(e,t){return Tr().memoizedState=[e,t===void 0?null:t],e},useContext:Jn,useEffect:bS,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Gf(4194308,4,rk.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=RD.bind(null,nt,e),[r.memoizedState,e]},useRef:function(e){var t=Tr();return e={current:e},t.memoizedState=e},useState:_S,useDebugValue:D_,useDeferredValue:function(e){return Tr().memoizedState=e},useTransition:function(){var e=_S(!1),t=e[0];return e=OD.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||YR(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,bS(XR.bind(null,r,i,e),[e]),r.flags|=2048,Pc(9,QR.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,bk(e,t,!1,!1),t.stateNode=e;e:{switch(a=uv(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 H_(),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 DD(e,t){switch(E_(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),M_(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return P_(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 R_(t.type._context),null;case 22:case 23:return H_(),null;case 24:return null;default:return null}}var uf=!1,Ut=!1,FD=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 Lv(e,t,n){try{n()}catch(r){it(e,t,r)}}var kS=!1;function UD(e,t){if(_v=Cp,e=CR(),S_(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(bv={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=kS,kS=!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&&Lv(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 Iv(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 xk(e){var t=e.alternate;t!==null&&(e.alternate=null,xk(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[xv],delete t[SD],delete t[xD])),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 Ek(e){return e.tag===5||e.tag===3||e.tag===4}function TS(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Ek(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 Dv(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(Dv(e,t,n),e=e.sibling;e!==null;)Dv(e,t,n),e=e.sibling}function Fv(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(Fv(e,t,n),e=e.sibling;e!==null;)Fv(e,t,n),e=e.sibling}var Pt=null,fr=!1;function Vo(e,t,n){for(n=n.child;n!==null;)Ak(e,t,n),n=n.sibling}function Ak(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)&&Lv(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 $S(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new FD),t.forEach(function(r){var o=YD.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*zD(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()-z_?Sa(e,0):V_|=n),gn(e,t)}function Mk(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 KD(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Mk(e,n)}function YD(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),Mk(e,n)}var jk;jk=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,LD(e,t,n);fn=!!(e.flags&131072)}else fn=!1,Je&&t.flags&1048576&&IR(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=N_(null,t,r,e,o,n);var i=L_();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_(t),o.updater=_0,t.stateNode=o,o._reactInternals=t,kv(t,r,e,n),t=Pv(null,t,r,!0,i,n)):(t.tag=0,Je&&i&&x_(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=XD(r),e=cr(r,e),o){case 0:t=$v(null,t,r,e,n);break e;case 1:t=CS(null,t,r,e,n);break e;case 11:t=ES(null,t,r,e,n);break e;case 14:t=AS(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),$v(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:cr(r,o),CS(e,t,r,o,n);case 3:e:{if(yk(t),e===null)throw Error(J(387));r=t.pendingProps,i=t.memoizedState,o=i.element,VR(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=OS(e,t,r,n,o);break e}else if(r!==o){o=Sl(Error(J(424)),t),t=OS(e,t,r,n,o);break e}else for(Cn=yi(t.stateNode.containerInfo.firstChild),Rn=t,Je=!0,hr=null,n=WR(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 qR(t),e===null&&Cv(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,a=o.children,wv(r,o)?a=null:i!==null&&wv(r,i)&&(t.flags|=32),mk(e,t),Gt(e,t,a,n),t.child;case 6:return e===null&&Cv(t),null;case 13:return vk(e,t,n);case 4:return $_(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),ES(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),Ov(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),Ov(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),AS(e,t,r,o,n);case 15:return hk(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),BR(t,r,o),kv(t,r,o,n),Pv(null,t,r,!0,e,n);case 19:return _k(e,t,n);case 22:return gk(e,t,n)}throw Error(J(156,t.tag))};function Nk(e,t){return sR(e,t)}function QD(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 QD(e,t,n,r)}function q_(e){return e=e.prototype,!(!e||!e.isReactComponent)}function XD(e){if(typeof e=="function")return q_(e)?1:0;if(e!=null){if(e=e.$$typeof,e===d_)return 11;if(e===f_)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")q_(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case vs:return xa(n.children,o,i,t);case c_:a=8,o|=8;break;case Jy:return e=Qn(12,n,t,o|2),e.elementType=Jy,e.lanes=i,e;case ev:return e=Qn(13,n,t,o),e.elementType=ev,e.lanes=i,e;case tv:return e=Qn(19,n,t,o),e.elementType=tv,e.lanes=i,e;case HO:return x0(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case zO:a=10;break e;case BO:a=9;break e;case d_:a=11;break e;case f_: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=HO,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 ZD(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 G_(e,t,n,r,o,i,a,s,l){return e=new ZD(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},T_(i),e}function JD(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Fk)}catch(e){console.error(e)}}Fk(),IO.exports=$n;var Uk=IO.exports;const oF=ko(Uk);var FS=Uk;Xy.createRoot=FS.createRoot,Xy.hydrateRoot=FS.hydrateRoot;function iF(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 Vk={exports:{}};const aF={},sF=Object.freeze(Object.defineProperty({__proto__:null,default:aF},Symbol.toStringTag,{value:"Module"})),lF=PL(sF);(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 iF=="function")try{i=lF}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})})(zk);var cF=zk.exports;const dF=ko(cF);var Bk={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})})(Bk);var fF=Bk.exports;const US=ko(fF);var Hk={exports:{}};(function(e,t){(function(n,r){e.exports=r(R0)})(oa,function(n){return n.enc.Utf8})})(Hk);var pF=Hk.exports;const hF=ko(pF);function Hv(e){this.message=e}Hv.prototype=new Error,Hv.prototype.name="InvalidCharacterError";var VS=typeof window<"u"&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new Hv("'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 gF(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(VS(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 VS(t)}}function Wp(e){this.message=e}function mF(e,t){if(typeof e!="string")throw new Wp("Invalid token specified");var n=(t=t||{}).header===!0?0:1;try{return JSON.parse(gF(e.split(".")[n]))}catch(r){throw new Wp("Invalid token specified: "+r.message)}}Wp.prototype=new Error,Wp.prototype.name="InvalidTokenError";var yF={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=yF}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 vF="10000000-1000-4000-8000-100000000000",Vr=class{static _randomWord(){return uF.lib.WordArray.random(1).words[0]}static generateUUIDv4(){return vF.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=dF(e);return US.stringify(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}catch(t){throw Se.error("CryptoUtils.generateCodeChallenge",t),t}}static generateBasicAuth(e,t){const n=hF.parse([e,t].join(":"));return US.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)}},Wv=class{static decode(e){try{return mF(e)}catch(t){throw Se.error("JwtUtils.decode",t),t}}},zS=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)}},qv=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))}},Gv=";",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}},X_=class extends Error{constructor(e){super(e),this.name="ErrorTimeout"}},_F=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)}},bF=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)}},Wk=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]}},Z_=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 X_("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)})}},wF=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 Z_(["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}},qk=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=Wv.decode(n);return r.debug("JWT decoding successful"),o}catch(o){throw r.error("Error parsing JWT response"),o}},this._jsonService=new Z_(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}},Gk=class{constructor(e,t){this._settings=e,this._metadataService=t,this._logger=new Se("TokenClient"),this._jsonService=new Z_(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")}},kF=class{constructor(e,t,n){this._settings=e,this._metadataService=t,this._claimsService=n,this._logger=new Se("ResponseValidator"),this._userInfoService=new RF(this._settings,this._metadataService),this._tokenClient=new Gk(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=Wv.decode((n=e.id_token)!=null?n:"");if(o.sub||r.throw(new Error("ID Token is missing a subject claim")),t){const i=Wv.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}},$F="openid",pm=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(Gv);this.state=t[0],t.length>1&&(this.url_state=t.slice(1).join(Gv))}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($F))||!!this.id_token}},PF=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}},MF=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")}},jF=["nbf","jti","auth_time","nonce","acr","amr","azp","at_hash"],NF=["sub","iss","aud","exp","iat"],LF=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=jF;for(const r of n)NF.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}},IF=class{constructor(e,t){this._logger=new Se("OidcClient"),this.settings=e instanceof Kv?e:new Kv(e),this.metadataService=t??new wF(this.settings),this._claimsService=new LF(this.settings),this._validator=new kF(this.settings,this.metadataService,this._claimsService),this._tokenClient=new Gk(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 TF({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 pm(qv.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:J_.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 pm(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 pm(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 PF({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 MF(qv.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})}},DF=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 bF(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))}},BS="oidc-client",Kk=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)!==BS)){try{const d=qv.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:BS,url:t,keepOpen:n},r)}},Yk={location:!1,toolbar:!1,height:640,closePopupWindowAfterInSeconds:-1},Qk="_blank",FF=60,UF=2,Xk=10,VF=class extends Kv{constructor(e){const{popup_redirect_uri:t=e.redirect_uri,popup_post_logout_redirect_uri:n=e.post_logout_redirect_uri,popupWindowFeatures:r=Yk,popupWindowTarget:o=Qk,redirectMethod:i="assign",redirectTarget:a="self",iframeNotifyParentOrigin:s=e.iframeNotifyParentOrigin,iframeScriptOrigin:l=e.iframeScriptOrigin,silent_redirect_uri:u=e.redirect_uri,silentRequestTimeoutInSeconds:c=Xk,automaticSilentRenew:d=!0,validateSubOnSilentRenew:f=!0,includeIdTokenInSilentRenew:p=!1,monitorSession:g=!1,monitorAnonymousSession:v=!1,checkSessionIntervalInSeconds:_=UF,query_status_response_type:m="code",stopCheckSessionOnError:h=!0,revokeTokenTypes:y=["access_token","refresh_token"],revokeTokensOnSignout:b=!1,includeIdTokenInSilentSignout:S=!1,accessTokenExpiringNotificationTimeInSeconds:x=FF,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 Wk;this.userStore=new qk({store:O})}}},Yv=class extends Kk{constructor({silentRequestTimeoutInSeconds:e=Xk}){super(),this._logger=new Se("IFrameWindow"),this._timeoutInSeconds=e,this._frame=Yv.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 X_("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)}},zF=class{constructor(e){this._settings=e,this._logger=new Se("IFrameNavigator")}async prepare({silentRequestTimeoutInSeconds:e=this._settings.silentRequestTimeoutInSeconds}){return new Yv({silentRequestTimeoutInSeconds:e})}async callback(e){this._logger.create("callback"),Yv.notifyParent(e,this._settings.iframeNotifyParentOrigin)}},BF=500,HF=1e3,HS=class extends Kk{constructor({popupWindowTarget:e=Qk,popupWindowFeatures:t={}}){super(),this._logger=new Se("PopupWindow");const n=zS.center({...Yk,...t});this._window=window.open(void 0,e,zS.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*HF)}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"))},BF);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)}},WF=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 HS({popupWindowFeatures:e,popupWindowTarget:t})}async callback(e,{keepOpen:t=!1}){this._logger.create("callback"),HS.notifyOpener(e,t)}},qF=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(){}},GF=class extends _F{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()}},KF=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 X_){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)}},YF=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}},QF=class{constructor(e,t,n,r){this._logger=new Se("UserManager"),this.settings=new VF(e),this._client=new IF(e),this._redirectNavigator=t??new qF(this.settings),this._popupNavigator=n??new WF(this.settings),this._iframeNavigator=r??new zF(this.settings),this._events=new GF(this.settings),this._silentRenewService=new KF(this),this.settings.automaticSilentRenew&&this.startSilentRenew(),this._sessionMonitor=null,this.settings.monitorSession&&(this._sessionMonitor=new DF(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 YF(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()}},eb=E.createContext(void 0);eb.displayName="AuthContext";var XF={isLoading:!0,isAuthenticated:!1},ZF=(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}`)}}},JF=(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")))},e9=e=>t=>t instanceof Error?t:new Error(e),t9=e9("Login failed"),n9=["clearStaleState","querySessionStatus","revokeTokens","startSilentRenew","stopSilentRenew"],r9=["signinPopup","signinSilent","signinRedirect","signinResourceOwnerCredentials","signoutPopup","signoutRedirect","signoutSilent"],hm=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.`)},o9=typeof window>"u"?null:QF,i9=e=>{const{children:t,onSigninCallback:n,skipSigninCallback:r,onRemoveUser:o,onSignoutRedirect:i,onSignoutPopup:a,implementation:s=o9,userManager:l,...u}=e,[c]=H.useState(()=>l??(s?new s(u):{settings:u})),[d,f]=H.useReducer(ZF,XF),p=H.useMemo(()=>Object.assign({settings:c.settings,events:c.events},Object.fromEntries(n9.map(y=>{var b,S;return[y,(S=(b=c[y])==null?void 0:b.bind(c))!=null?S:hm(y)]})),Object.fromEntries(r9.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"})}}:hm(y)]))),[c]),g=H.useRef(!1);H.useEffect(()=>{!c||g.current||(g.current=!0,(async()=>{let y=null;try{JF()&&!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:t9(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):hm("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(eb.Provider,{value:{...d,...p,removeUser:v,signoutRedirect:_,signoutPopup:m,signoutSilent:h}},t)},a9=()=>{const e=E.useContext(eb);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 Zk(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function l9(){return Math.random().toString(36).substr(2,8)}function qS(e,t){return{usr:e.state,key:e.key,idx:t}}function Qv(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||l9()})}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 u9(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=Qv(v.location,_,m);n&&n(h,_),u=c()+1;let y=qS(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=Qv(v.location,_,m);n&&n(h,_),u=c();let y=qS(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(WS,d),l=_,()=>{o.removeEventListener(WS,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 GS;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(GS||(GS={}));function c9(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=Jk(e);d9(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+'".')),Jk(i.children,t,c,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:v9(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 eT(i.path))o(i,a,l)}),t}function eT(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=eT(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 d9(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:_9(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const f9=/^:[\w-]+$/,p9=3,h9=2,g9=1,m9=10,y9=-2,KS=e=>e==="*";function v9(e,t){let n=e.split("/"),r=n.length;return n.some(KS)&&(r+=y9),t&&(r+=h9),n.filter(o=>!KS(o)).reduce((o,i)=>o+(f9.test(i)?p9:i===""?g9:m9),r)}function _9(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 b9(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 w9(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Zk(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 S9(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Zk(!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 x9(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:E9(n,t):t,search:O9(r),hash:R9(o)}}function E9(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 gm(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 A9(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function tb(e,t){let n=A9(e);return t?n.map((r,o)=>o===e.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function nb(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("?"),gm("?","pathname","search",o)),rt(!o.pathname||!o.pathname.includes("#"),gm("#","pathname","hash",o)),rt(!o.search||!o.search.includes("#"),gm("#","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=x9(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,"/"),C9=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),O9=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,R9=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function k9(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const tT=["post","put","patch","delete"];new Set(tT);const T9=["get",...tT];new Set(T9);/** + * 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=nb(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 M9=H.createContext(null);function j9(e){let t=H.useContext(Qr).outlet;return t&&H.createElement(M9.Provider,{value:e},t)}function N9(){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(tb(o,r.v7_relativeSplatPath));return H.useMemo(()=>nb(e,JSON.parse(a),i,n==="path"),[e,a,i,n])}function L9(e,t){return I9(e,t)}function I9(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=c9(e,{pathname:p}),v=z9(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 D9(){let e=q9(),t=k9(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 F9=H.createElement(D9,null);class U9 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(rT.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function V9(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 z9(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||F9,l&&(u<0&&f===0?(K9("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(V9,{match:d,routeContext:{outlet:c,matches:m,isDataRoute:n!=null},children:y})};return n&&(d.route.ErrorBoundary||d.route.errorElement||f===0)?H.createElement(U9,{location:n.location,revalidation:n.revalidation,component:v,error:p,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):h()},null)}var iT=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(iT||{}),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 B9(e){let t=H.useContext(k0);return t||rt(!1),t}function H9(e){let t=H.useContext(nT);return t||rt(!1),t}function W9(e){let t=H.useContext(Qr);return t||rt(!1),t}function aT(e){let t=W9(),n=t.matches[t.matches.length-1];return n.route.id||rt(!1),n.route.id}function q9(){var e;let t=H.useContext(rT),n=H9(Kp.UseRouteError),r=aT(Kp.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function G9(){let{router:e}=B9(iT.UseNavigateStable),t=aT(Kp.UseNavigateStable),n=H.useRef(!1);return oT(()=>{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 YS={};function K9(e,t,n){!t&&!YS[e]&&(YS[e]=!0)}function Y9(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=nb(t,tb(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 Q9(e){return j9(e.context)}function Yi(e){rt(!1)}function X9(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 Z9(e){let{children:t,location:n}=e;return L9(Zv(t),n)}new Promise(()=>{});function Zv(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,Zv(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=Zv(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 J9(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function eU(e,t){return e.button===0&&(!t||t==="_self")&&!J9(e)}const tU=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],nU=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"],rU="6";try{window.__reactRouterVersion=rU}catch{}const oU=H.createContext({isTransitioning:!1}),iU="startTransition",QS=KL[iU];function aU(e){let{basename:t,children:n,future:r,window:o}=e,i=H.useRef();i.current==null&&(i.current=s9({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&&QS?QS(()=>l(d)):l(d)},[l,u]);return H.useLayoutEffect(()=>a.listen(c),[a,c]),H.createElement(X9,{basename:t,children:n,location:s.location,navigationType:s.action,navigator:a,future:r})}const sU=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",lU=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,lT=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=sT(t,tU),{basename:p}=H.useContext($o),g,v=!1;if(typeof u=="string"&&lU.test(u)&&(g=u,sU))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 _=$9(u,{relative:o}),m=cU(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=sT(t,nU),f=P0(l,{relative:d.relative}),p=Wa(),g=H.useContext(nT),{navigator:v,basename:_}=H.useContext($o),m=g!=null&&dU(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(lT,Yp({},d,{"aria-current":R,className:C,ref:n,style:T,to:l,unstable_viewTransition:u}),typeof c=="function"?c(O):c)});var Jv;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Jv||(Jv={}));var XS;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(XS||(XS={}));function uU(e){let t=H.useContext(k0);return t||rt(!1),t}function cU(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(eU(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 dU(e,t){t===void 0&&(t={});let n=H.useContext(oU);n==null&&rt(!1);let{basename:r}=uU(Jv.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 Xv(o.pathname,a)!=null||Xv(o.pathname,i)!=null}var uT={};function fU(e){const t=new Error(e);if(t.stack===void 0)try{throw t}catch{}return t}var pU=fU,Ae=pU;function hU(e){return!!e&&typeof e.then=="function"}var Ke=hU;function gU(e,t){if(e!=null)return e;throw Ae(t??"Got unexpected null or undefined")}var et=gU;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 mU 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 yU 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 cT 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 mU(e))}function j0(e){return Object.freeze(new yU(e))}function La(e){return Object.freeze(new cT(e))}function dT(){return Object.freeze(new cT(new Promise(()=>{})))}function vU(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 fT(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=vU(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 _U={of:e=>Ke(e)?La(e):Cl(e)?e:bd(e),error:e=>j0(e),loading:()=>dT(),all:fT,isLoadable:Cl};var qa={loadableWithValue:bd,loadableWithError:j0,loadableWithPromise:La,loadableLoading:dT,loadableAll:fT,isLoadable:Cl,RecoilLoadable:_U},bU=qa.loadableWithValue,wU=qa.loadableWithError,SU=qa.loadableWithPromise,xU=qa.loadableLoading,EU=qa.loadableAll,AU=qa.isLoadable,CU=qa.RecoilLoadable,wd=Object.freeze({__proto__:null,loadableWithValue:bU,loadableWithError:wU,loadableWithPromise:SU,loadableLoading:xU,loadableAll:EU,isLoadable:AU,RecoilLoadable:CU});const e1={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 OU(e,t){var n,r;const o=(n=uT[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 RU(e,t){var n;const r=(n=uT[e])===null||n===void 0?void 0:n.trim();r==null||r===""||t(r.split(/\s*,\s*|\s+/))}function kU(){var e;typeof process>"u"||((e=process)===null||e===void 0?void 0:e.env)!=null&&(OU("RECOIL_DUPLICATE_ATOM_KEY_CHECKING_ENABLED",t=>{e1.RECOIL_DUPLICATE_ATOM_KEY_CHECKING_ENABLED=t}),RU("RECOIL_GKS_ENABLED",t=>{t.forEach(n=>{e1.RECOIL_GKS_ENABLED.add(n)})}))}kU();var Gl=e1;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 TU(e,t,{error:n}={}){return null}var $U=TU,rb=$U,mm,ym,vm;const PU=(mm=E.createMutableSource)!==null&&mm!==void 0?mm:E.unstable_createMutableSource,pT=(ym=E.useMutableSource)!==null&&ym!==void 0?ym:E.unstable_useMutableSource,hT=(vm=E.useSyncExternalStore)!==null&&vm!==void 0?vm:E.unstable_useSyncExternalStore;function MU(){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 jU(){return Ve("recoil_transition_support")?{mode:"TRANSITION_SUPPORT",early:!0,concurrent:!0}:Ve("recoil_sync_external_store")&&hT!=null?{mode:"SYNC_EXTERNAL_STORE",early:!0,concurrent:!1}:Ve("recoil_mutable_source")&&pT!=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 NU(){return!1}var Sd={createMutableSource:PU,useMutableSource:pT,useSyncExternalStore:hT,currentRendererSupportsUseSyncExternalStore:MU,reactMode:jU,isFastRefreshEnabled:NU};class ob{constructor(t){Ee(this,"key",void 0),this.key=t}toJSON(){return{key:this.key}}}class gT extends ob{}class mT extends ob{}function LU(e){return e instanceof gT||e instanceof mT}var L0={AbstractRecoilValue:ob,RecoilState:gT,RecoilValueReadOnly:mT,isRecoilValue:LU},IU=L0.AbstractRecoilValue,DU=L0.RecoilState,FU=L0.RecoilValueReadOnly,UU=L0.isRecoilValue,Ol=Object.freeze({__proto__:null,AbstractRecoilValue:IU,RecoilState:DU,RecoilValueReadOnly:FU,isRecoilValue:UU});function VU(e,t){return function*(){let n=0;for(const r of e)yield t(r,n++)}()}var I0=VU;class yT{}const zU=new yT,Ia=new Map,ib=new Map;function BU(e){return I0(e,t=>et(ib.get(t)))}function HU(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 WU(e){Gl.RECOIL_DUPLICATE_ATOM_KEY_CHECKING_ENABLED&&HU(e.key),Ia.set(e.key,e);const t=e.set==null?new Ol.RecoilValueReadOnly(e.key):new Ol.RecoilState(e.key);return ib.set(e.key,t),t}class vT extends Error{}function qU(e){const t=Ia.get(e);if(t==null)throw new vT(`Missing definition for RecoilValue: "${e}""`);return t}function GU(e){return Ia.get(e)}const Qp=new Map;function KU(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=_T(e))===null||r===void 0||r(),Qp.delete(e)}}function YU(e,t){Ve("recoil_memory_managament_2020")&&(t===void 0?Qp.delete(e):Qp.set(e,t))}function _T(e){return Qp.get(e)}var _n={nodes:Ia,recoilValues:ib,registerNode:WU,getNode:qU,getNodeMaybe:GU,deleteNodeConfigIfPossible:KU,setConfigDeletionHandler:YU,getConfigDeletionHandler:_T,recoilValuesForKeys:BU,NodeMissingError:vT,DefaultValue:yT,DEFAULT_VALUE:zU};function QU(e,t){t()}var XU={enqueueExecution:QU};function ZU(e,t){return t={exports:{}},e(t,t.exports),t.exports}var JU=ZU(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=iV;function aV(){return{nodeDeps:new Map,nodeToNodeSubscriptions:new Map}}function sV(e){return{nodeDeps:Xp(e.nodeDeps,t=>new Set(t)),nodeToNodeSubscriptions:Xp(e.nodeToNodeSubscriptions,t=>new Set(t))}}function _m(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 lV(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(_m(e,t,u),r===((a=l.previousTree)===null||a===void 0?void 0:a.version)){const d=n.getGraph(l.currentTree.version);_m(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);_m(e,t,f,u)}}}var xd={cloneGraph:sV,graph:aV,saveDepsToStore:lV};let uV=0;const cV=()=>uV++;let dV=0;const fV=()=>dV++;let pV=0;const hV=()=>pV++;var D0={getNextTreeStateVersion:cV,getNextStoreID:fV,getNextComponentID:hV};const{persistentMap:ZS}=rV,{graph:gV}=xd,{getNextTreeStateVersion:bT}=D0;function wT(){const e=bT();return{version:e,stateID:e,transactionMetadata:{},dirtyAtoms:new Set,atomValues:ZS(),nonvalidatedAtoms:ZS()}}function mV(){const e=wT();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,gV()),retention:{referenceCounts:new Map,nodesRetainedByZone:new Map,retainablesToCheckForRelease:new Set},nodeCleanupFunctions:new Map}}var ST={makeEmptyTreeState:wT,makeEmptyStoreState:mV,getNextTreeStateVersion:bT};class xT{}function yV(){return new xT}var F0={RetentionZone:xT,retentionZone:yV};function vV(e,t){const n=new Set(e);return n.add(t),n}function _V(e,t){const n=new Set(e);return n.delete(t),n}function bV(e,t,n){const r=new Map(e);return r.set(t,n),r}function wV(e,t,n){const r=new Map(e);return r.set(t,n(r.get(t))),r}function SV(e,t){const n=new Map(e);return n.delete(t),n}function xV(e,t){const n=new Map(e);return t.forEach(r=>n.delete(r)),n}var ET={setByAddingToSet:vV,setByDeletingFromSet:_V,mapBySettingInMap:bV,mapByUpdatingInMap:wV,mapByDeletingFromMap:SV,mapByDeletingMultipleFromMap:xV};function*EV(e,t){let n=0;for(const r of e)t(r,n++)&&(yield r)}var lb=EV;function AV(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 AT=AV;const{getNode:Ed,getNodeMaybe:CV,recoilValuesForKeys:JS}=_n,{RetentionZone:ex}=F0,{setByAddingToSet:OV}=ET,RV=Object.freeze(new Set);class kV extends Error{}function TV(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 ex)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 ex)a(n);else if(Array.isArray(n))for(const s of n)a(s)}}function ub(e,t,n,r){const o=e.getState();if(o.nodeCleanupFunctions.has(n))return;const i=Ed(n),a=TV(e,n,i.retainedBy),s=i.init(e,t,r);o.nodeCleanupFunctions.set(n,()=>{s(),a()})}function $V(e,t,n){ub(e,e.getState().currentTree,t,n)}function PV(e,t){var n;const r=e.getState();(n=r.nodeCleanupFunctions.get(t))===null||n===void 0||n(),r.nodeCleanupFunctions.delete(t)}function MV(e,t,n){return ub(e,t,n,"get"),Ed(n).get(e,t)}function CT(e,t,n){return Ed(n).peek(e,t)}function jV(e,t,n){var r;const o=CV(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:OV(e.dirtyAtoms,t)}}function NV(e,t,n,r){const o=Ed(n);if(o.set==null)throw new kV(`Attempt to set read-only RecoilValue: ${n}`);const i=o.set;return ub(e,t,n,"set"),i(e,t,r)}function LV(e,t,n){const r=e.getState(),o=e.getGraph(t.version),i=Ed(n).nodeType;return AT({type:i},{loadable:()=>CT(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 JS((a=o.nodeDeps.get(n))!==null&&a!==void 0?a:[])},subscribers:()=>{var a,s;return{nodes:JS(lb(OT(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 OT(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:RV;for(const u of l)r.has(u)||o.push(u)}return r}var Di={getNodeLoadable:MV,peekNodeLoadable:CT,setNodeValue:NV,initializeNode:$V,cleanUpNode:PV,setUnvalidatedAtomValue_DEPRECATED:jV,peekNodeInfo:LV,getDownstreamNodes:OT};let RT=null;function IV(e){RT=e}function DV(){var e;(e=RT)===null||e===void 0||e()}var kT={setInvalidateMemoizedSnapshot:IV,invalidateMemoizedSnapshot:DV};const{getDownstreamNodes:FV,getNodeLoadable:TT,setNodeValue:UV}=Di,{getNextComponentID:VV}=D0,{getNode:zV,getNodeMaybe:$T}=_n,{DefaultValue:cb}=_n,{reactMode:BV}=Sd,{AbstractRecoilValue:HV,RecoilState:WV,RecoilValueReadOnly:qV,isRecoilValue:GV}=Ol,{invalidateMemoizedSnapshot:KV}=kT;function YV(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=TT(e,n,t);return a.state==="loading"&&a.contents.catch(()=>{}),a}function QV(e,t){const n=e.clone();return t.forEach((r,o)=>{r.state==="hasValue"&&r.contents instanceof cb?n.delete(o):n.set(o,r)}),n}function XV(e,t,{key:n},r){if(typeof r=="function"){const o=TT(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 ZV(e,t,n){if(n.type==="set"){const{recoilValue:o,valueOrUpdater:i}=n,a=XV(e,t,o,i),s=UV(e,t,o.key,a);for(const[l,u]of s.entries())t1(t,l,u)}else if(n.type==="setLoadable"){const{recoilValue:{key:o},loadable:i}=n;t1(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=$T(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 rb(`Unknown action ${n.type}`)}function t1(e,t,n){n.state==="hasValue"&&n.contents instanceof cb?e.atomValues.delete(t):e.atomValues.set(t,n),e.dirtyAtoms.add(t),e.nonvalidatedAtoms.delete(t)}function PT(e,t){e.replaceState(n=>{const r=MT(n);for(const o of t)ZV(e,r,o);return jT(e,r),KV(),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 PT(e,[t])}const lc=[];function JV(){const e=new Map;return lc.push(e),()=>{for(const[t,n]of e)PT(t,n);lc.pop()}}function MT(e){return{...e,atomValues:e.atomValues.clone(),nonvalidatedAtoms:e.nonvalidatedAtoms.clone(),dirtyAtoms:new Set(e.dirtyAtoms)}}function jT(e,t){const n=FV(e,t,t.dirtyAtoms);for(const i of n){var r,o;(r=$T(i))===null||r===void 0||(o=r.invalidate)===null||o===void 0||o.call(r,t)}}function NT(e,t,n){U0(e,{type:"set",recoilValue:t,valueOrUpdater:n})}function ez(e,t,n){if(n instanceof cb)return NT(e,t,n);U0(e,{type:"setLoadable",recoilValue:t,loadable:n})}function tz(e,t){U0(e,{type:"markModified",recoilValue:t})}function nz(e,t,n){U0(e,{type:"setUnvalidated",recoilValue:t,unvalidatedValue:n})}function rz(e,{key:t},n,r=null){const o=VV(),i=e.getState();i.nodeToComponentSubscriptions.has(t)||i.nodeToComponentSubscriptions.set(t,new Map),et(i.nodeToComponentSubscriptions.get(t)).set(o,[r??"",n]);const a=BV();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 oz(e,t){var n;const{currentTree:r}=e.getState(),o=zV(t.key);(n=o.clearCache)===null||n===void 0||n.call(o,e,r)}var Xr={RecoilValueReadOnly:qV,AbstractRecoilValue:HV,RecoilState:WV,getRecoilValueAsLoadable:YV,setRecoilValue:NT,setRecoilValueLoadable:ez,markRecoilValueModified:tz,setUnvalidatedRecoilValue:nz,subscribeToRecoilValue:rz,isRecoilValue:GV,applyAtomValueWrites:QV,batchStart:JV,writeLoadableToTreeState:t1,invalidateDownstreams:jT,copyTreeState:MT,refreshRecoilValue:oz};function iz(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 az=iz;const{cleanUpNode:sz}=Di,{deleteNodeConfigIfPossible:lz,getNode:LT}=_n,{RetentionZone:IT}=F0,uz=12e4,DT=new Set;function FT(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 IT)for(const s of pz(n,a))o.add(s);else o.add(a);const i=cz(e,o);for(const a of i)fz(e,r,a)}function cz(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=dz(e,r,l,i,a);for(const g of c){var d;if(LT(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(UT(g).some(_=>n.retention.referenceCounts.get(_))){a.add(g);continue}const v=o.nodeToNodeSubscriptions.get(g);if(v&&az(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:DT){var p;i.has(v)||f.add(v)}f.size&&s(f)}}function dz(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 fz(e,t,n){if(!Ve("recoil_memory_managament_2020"))return;sz(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=UT(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)}lz(n)}function pz(e,t){var n;return(n=e.retention.nodesRetainedByZone.get(t))!==null&&n!==void 0?n:DT}function UT(e){const t=LT(e).retainedBy;return t===void 0||t==="components"||t==="recoilRoot"?[]:t instanceof IT?[t]:t}function hz(e,t){const n=e.getState();n.nextTree?n.retention.retainablesToCheckForRelease.add(t):FT(e,new Set([t]))}function gz(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?VT(e,t):o.set(t,i)}function VT(e,t){if(!Ve("recoil_memory_managament_2020"))return;e.getState().retention.referenceCounts.delete(t),hz(e,t)}function mz(e){if(!Ve("recoil_memory_managament_2020"))return;const t=e.getState();FT(e,t.retention.retainablesToCheckForRelease),t.retention.retainablesToCheckForRelease.clear()}function yz(e){return e===void 0?"recoilRoot":e}var Ga={SUSPENSE_TIMEOUT_MS:uz,updateRetainCount:gz,updateRetainCountToZero:VT,releaseScheduledRetainablesNow:mz,retainedByOptionWithDefault:yz};const{unstable_batchedUpdates:vz}=oF;var _z={unstable_batchedUpdates:vz};const{unstable_batchedUpdates:bz}=_z;var wz={unstable_batchedUpdates:bz};const{batchStart:Sz}=Xr,{unstable_batchedUpdates:xz}=wz;let db=xz||(e=>e());const Ez=e=>{db=e},Az=()=>db,Cz=e=>{db(()=>{let t=()=>{};try{t=Sz(),e()}finally{t()}})};var V0={getBatcher:Az,setBatcher:Ez,batchUpdates:Cz};function*Oz(e){for(const t of e)for(const n of t)yield n}var zT=Oz;const BT=typeof Window>"u"||typeof window>"u",Rz=e=>!BT&&(e===window||e instanceof Window),kz=typeof navigator<"u"&&navigator.product==="ReactNative";var z0={isSSR:BT,isReactNative:kz,isWindow:Rz};function Tz(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 $z(e,t){let n,r;return(...o)=>{const i=t(...o);return n===i||(n=i,r=e(...o)),r}}function Pz(e,t){let n,r;return[(...a)=>{const s=t(...a);return n===s||(n=s,r=e(...a)),r},()=>{n=null}]}var Mz={memoizeWithArgsHash:Tz,memoizeOneWithArgsHash:$z,memoizeOneWithArgsHashAndInvalidation:Pz};const{batchUpdates:n1}=V0,{initializeNode:jz,peekNodeInfo:Nz}=Di,{graph:Lz}=xd,{getNextStoreID:Iz}=D0,{DEFAULT_VALUE:Dz,recoilValues:tx,recoilValuesForKeys:nx}=_n,{AbstractRecoilValue:Fz,getRecoilValueAsLoadable:Uz,setRecoilValue:rx,setUnvalidatedRecoilValue:Vz}=Xr,{updateRetainCount:ep}=Ga,{setInvalidateMemoizedSnapshot:zz}=kT,{getNextTreeStateVersion:Bz,makeEmptyStoreState:Hz}=ST,{isSSR:Wz}=z0,{memoizeOneWithArgsHashAndInvalidation:qz}=Mz;class B0{constructor(t,n){Ee(this,"_store",void 0),Ee(this,"_refCount",1),Ee(this,"getLoadable",r=>(this.checkRefCount_INTERNAL(),Uz(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 nx(a.dirtyAtoms)}const o=this._store.getState().knownAtoms,i=this._store.getState().knownSelectors;return(r==null?void 0:r.isInitialized)==null?tx.values():r.isInitialized===!0?nx(zT([o,i])):lb(tx.values(),({key:a})=>!o.has(a)&&!i.has(a))}),Ee(this,"getInfo_UNSTABLE",({key:r})=>(this.checkRefCount_INTERNAL(),Nz(this._store,this._store.getState().currentTree,r))),Ee(this,"map",r=>{this.checkRefCount_INTERNAL();const o=new r1(this,n1);return r(o),o}),Ee(this,"asyncMap",async r=>{this.checkRefCount_INTERNAL();const o=new r1(this,n1);return o.retain(),await r(o),o.autoRelease_INTERNAL(),o}),this._store={storeID:Iz(),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=Lz();return o.set(r,i),i},subscribeToTransactions:()=>({release:()=>{}}),addTransactionMetadata:()=>{throw Ae("Cannot subscribe to Snapshots")}};for(const r of this._store.getState().knownAtoms)jz(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(){Wz||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 HT(e,t,n=!1){const r=e.getState(),o=n?Bz():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 Gz(e){const t=new B0(Hz());return e!=null?t.map(e):t}const[ox,WT]=qz((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(HT(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)});zz(WT);function Kz(e,t="latest"){const n=ox(e,t);return n.isRetained()?n:(WT(),ox(e,t))}class r1 extends B0{constructor(t,n){super(HT(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),rx(this.getStore_INTERNAL(),r,o)})}),Ee(this,"reset",r=>{this.checkRefCount_INTERNAL();const o=this.getStore_INTERNAL();this._batch(()=>{ep(o,r.key,1),rx(this.getStore_INTERNAL(),r,Dz)})}),Ee(this,"setUnvalidatedAtomValues_DEPRECATED",r=>{this.checkRefCount_INTERNAL();const o=this.getStore_INTERNAL();n1(()=>{for(const[i,a]of r.entries())ep(o,i,1),Vz(o,new Fz(i),a)})}),this._batch=n}}var H0={Snapshot:B0,MutableSnapshot:r1,freshSnapshot:Gz,cloneSnapshot:Kz},Yz=H0.Snapshot,Qz=H0.MutableSnapshot,Xz=H0.freshSnapshot,Zz=H0.cloneSnapshot,W0=Object.freeze({__proto__:null,Snapshot:Yz,MutableSnapshot:Qz,freshSnapshot:Xz,cloneSnapshot:Zz});function Jz(...e){const t=new Set;for(const n of e)for(const r of n)t.add(r);return t}var eB=Jz;const{useRef:tB}=E;function nB(e){const t=tB(e);return t.current===e&&typeof e=="function"&&(t.current=e()),t}var ix=nB;const{getNextTreeStateVersion:rB,makeEmptyStoreState:qT}=ST,{cleanUpNode:oB,getDownstreamNodes:iB,initializeNode:aB,setNodeValue:sB,setUnvalidatedAtomValue_DEPRECATED:lB}=Di,{graph:uB}=xd,{cloneGraph:cB}=xd,{getNextStoreID:GT}=D0,{createMutableSource:bm,reactMode:KT}=Sd,{applyAtomValueWrites:dB}=Xr,{releaseScheduledRetainablesNow:YT}=Ga,{freshSnapshot:fB}=W0,{useCallback:pB,useContext:QT,useEffect:o1,useMemo:hB,useRef:gB,useState:mB}=E;function xu(){throw Ae("This component must be used inside a component.")}const XT=Object.freeze({storeID:GT(),getState:xu,replaceState:xu,getGraph:xu,subscribeToTransactions:xu,addTransactionMetadata:xu});let i1=!1;function ax(e){if(i1)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&&YT(e);const n=t.currentTree.version,r=rB();t.nextTree={...t.currentTree,version:r,stateID:r,dirtyAtoms:new Set,transactionMetadata:{}},t.graphsByVersion.set(r,cB(et(t.graphsByVersion.get(n))))}}const ZT=E.createContext({current:XT}),q0=()=>QT(ZT),JT=E.createContext(null);function yB(){return QT(JT)}function fb(e,t,n){const r=iB(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 e$(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);(!KT().early||t.suspendedComponentResolvers.size>0)&&(fb(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 vB(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,e$(e),t.previousTree!=null?t.graphsByVersion.delete(t.previousTree.version):rb("Ended batch with no previous state, which is unexpected","recoil"),t.previousTree=null,Ve("recoil_memory_managament_2020")&&n==null&&YT(e)}finally{t.commitDepth--}}function _B({setNotifyBatcherOfChange:e}){const t=q0(),[,n]=mB([]);return e(()=>n({})),o1(()=>(e(()=>n({})),()=>{e(()=>{})}),[e]),o1(()=>{XU.enqueueExecution("Batcher",()=>{vB(t.current)})}),null}function bB(e,t){const n=qT();return t({set:(r,o)=>{const i=n.currentTree,a=sB(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:eB(i.dirtyAtoms,s),atomValues:dB(i.atomValues,a),nonvalidatedAtoms:l}},setUnvalidatedAtomValues:r=>{r.forEach((o,i)=>{n.currentTree=lB(n.currentTree,i,o)})}}),n}function wB(e){const t=fB(e),n=t.getStore_INTERNAL().getState();return t.retain(),n.nodeCleanupFunctions.forEach(r=>r()),n.nodeCleanupFunctions.clear(),n}let sx=0;function SB({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=uB();return g.set(p,v),v},a=(p,g)=>{if(g==null){const{transactionSubscriptions:v}=d.current.getState(),_=sx++;return v.set(_,p),{release:()=>{v.delete(_)}}}else{const{nodeTransactionSubscriptions:v}=d.current.getState();v.has(g)||v.set(g,new Map);const _=sx++;return et(v.get(g)).set(_,p),{release:()=>{const m=v.get(g);m&&(m.delete(_),m.size===0&&v.delete(g))}}}},s=p=>{ax(d.current);for(const g of Object.keys(p))et(d.current.getState().nextTree).transactionMetadata[g]=p[g]},l=p=>{ax(d.current);const g=et(o.current.nextTree);let v;try{i1=!0,v=p(g)}finally{i1=!1}v!==g&&(o.current.nextTree=v,KT().early&&fb(d.current,o.current,v),et(u.current)())},u=gB(null),c=pB(p=>{u.current=p},[u]),d=ix(()=>n??{storeID:GT(),getState:()=>o.current,replaceState:l,getGraph:i,subscribeToTransactions:a,addTransactionMetadata:s});n!=null&&(d.current=n),o=ix(()=>e!=null?bB(d.current,e):t!=null?wB(t):qT());const f=hB(()=>bm==null?void 0:bm(o,()=>o.current.currentTree.version),[o]);return o1(()=>{const p=d.current;for(const g of new Set(p.getState().knownAtoms))aB(p,g,"get");return()=>{for(const g of p.getState().knownAtoms)oB(p,g)}},[d]),E.createElement(ZT.Provider,{value:d},E.createElement(JT.Provider,{value:f},E.createElement(_B,{setNotifyBatcherOfChange:c}),r))}function xB(e){const{override:t,...n}=e,r=q0();return t===!1&&r.current!==XT?e.children:E.createElement(SB,n)}function EB(){return q0().current.storeID}var Po={RecoilRoot:xB,useStoreRef:q0,useRecoilMutableSource:yB,useRecoilStoreID:EB,notifyComponents_FOR_TESTING:fb,sendEndOfBatchNotifications_FOR_TESTING:e$};function AB(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 t$=kB;const{useStoreRef:TB}=Po,{SUSPENSE_TIMEOUT_MS:$B}=Ga,{updateRetainCount:Eu}=Ga,{RetentionZone:PB}=F0,{useEffect:MB,useRef:jB}=E,{isSSR:lx}=z0;function NB(e){if(Ve("recoil_memory_managament_2020"))return LB(e)}function LB(e){const n=(Array.isArray(e)?e:[e]).map(a=>a instanceof PB?a:a.key),r=TB();MB(()=>{if(!Ve("recoil_memory_managament_2020"))return;const a=r.current;if(o.current&&!lx)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=jB(),i=t$(n);if(!lx&&(i===void 0||!CB(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)},$B)}}var pb=NB;function IB(){return""}var Ad=IB;const{batchUpdates:DB}=V0,{DEFAULT_VALUE:n$}=_n,{currentRendererSupportsUseSyncExternalStore:FB,reactMode:Kl,useMutableSource:UB,useSyncExternalStore:VB}=Sd,{useRecoilMutableSource:zB,useStoreRef:Zr}=Po,{AbstractRecoilValue:a1,getRecoilValueAsLoadable:Cd,setRecoilValue:Zp,setUnvalidatedRecoilValue:BB,subscribeToRecoilValue:Rl}=Xr,{useCallback:mn,useEffect:kl,useMemo:r$,useRef:uc,useState:hb}=E,{setByAddingToSet:HB}=ET,{isSSR:WB}=z0;function gb(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),WB&&Ke(e.contents)&&e.contents.finally(()=>{i.delete(o)})}):e.state==="hasError"?e.contents:Ae(`Invalid value of loadable atom "${t.key}"`)}function qB(){const e=Ad(),t=Zr(),[,n]=hb([]),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 a1(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 a1(u),d=>s(d,u),e);l.set(u,c)}),()=>l.forEach((u,c)=>a(c))},[e,t,a,s]),r$(()=>{function l(g){return v=>{Zp(t.current,g,v)}}function u(g){return()=>Zp(t.current,g,n$)}function c(g){var v;r.current.has(g.key)||(r.current=HB(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 gb(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 GB={current:0};function KB(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=r$(()=>o(r),[r,o]),a=mn(s=>{const l=t.current;return Rl(l,e,s,n).release},[t,e,n]);return VB(a,i,i).loadable}function YB(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=zB();if(a==null)throw Ae("Recoil hooks must be used in components contained within a component.");const s=UB(a,r,i),l=uc(s);return kl(()=>{l.current=s}),s}function s1(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]=hb(o);return a.key!==e.key?o().loadable:a.loadable}function QB(e){const t=Zr(),[,n]=hb([]),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 mb(e){return Ve("recoil_memory_managament_2020")&&pb(e),{TRANSITION_SUPPORT:s1,SYNC_EXTERNAL_STORE:FB()?KB:s1,MUTABLE_SOURCE:YB,LEGACY:QB}[Kl().mode](e)}function o$(e){const t=Zr(),n=mb(e);return gb(n,e,t)}function G0(e){const t=Zr();return mn(n=>{Zp(t.current,e,n)},[t,e])}function XB(e){const t=Zr();return mn(()=>{Zp(t.current,e,n$)},[t,e])}function ZB(e){return[o$(e),G0(e)]}function JB(e){return[mb(e),G0(e)]}function e8(){const e=Zr();return(t,n={})=>{DB(()=>{e.current.addTransactionMetadata(n),t.forEach((r,o)=>BB(e.current,new a1(o),r))})}}function i$(e){return Ve("recoil_memory_managament_2020")&&pb(e),s1(e)}function a$(e){const t=Zr(),n=i$(e);return gb(n,e,t)}function t8(e){return[a$(e),G0(e)]}var n8={recoilComponentGetRecoilValueCount_FOR_TESTING:GB,useRecoilInterface:qB,useRecoilState:ZB,useRecoilStateLoadable:JB,useRecoilValue:o$,useRecoilValueLoadable:mb,useResetRecoilState:XB,useSetRecoilState:G0,useSetUnvalidatedAtomValues:e8,useRecoilValueLoadable_TRANSITION_SUPPORT_UNSTABLE:i$,useRecoilValue_TRANSITION_SUPPORT_UNSTABLE:a$,useRecoilState_TRANSITION_SUPPORT_UNSTABLE:t8};function r8(e,t){const n=new Map;for(const[r,o]of e)t(o,r)&&n.set(r,o);return n}var o8=r8;function i8(e,t){const n=new Set;for(const r of e)t(r)&&n.add(r);return n}var a8=i8;function s8(...e){const t=new Map;for(let n=0;nt.current.subscribeToTransactions(e).release,[e,t])}function dx(e){const t=e.atomValues.toMap(),n=Xp(o8(t,(r,o)=>{const a=s$(o).persistence_UNSTABLE;return a!=null&&a.type!=="none"&&r.state==="hasValue"}),r=>r.contents);return l8(e.nonvalidatedAtoms.toMap(),n)}function m8(e){Y0(K0(t=>{let n=t.getState().previousTree;const r=t.getState().currentTree;n||(n=t.getState().currentTree);const o=dx(r),i=dx(n),a=Xp(d8,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=a8(r.dirtyAtoms,l=>o.has(l)||i.has(l));e({atomValues:o,previousAtomValues:i,atomInfo:a,modifiedAtoms:s,transactionMetadata:{...r.transactionMetadata}})},[e]))}function y8(e){Y0(K0(t=>{const n=Jp(t,"latest"),r=Jp(t,"previous");e({snapshot:n,previousSnapshot:r})},[e]))}function v8(){const e=yb(),[t,n]=g8(()=>Jp(e.current)),r=t$(t),o=ux(),i=ux();if(Y0(K0(s=>n(Jp(s)),[])),l$(()=>{const s=t.retain();if(o.current&&!cx){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&&!cx){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},h8)}return t}function u$(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;u8(()=>{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)&&s$(c).shouldRestoreFromSnapshots&&a.add(c)}a.forEach(u=>{p8(e,new f8(u),i.atomValues.has(u)?et(i.atomValues.get(u)):c8)}),e.replaceState(u=>({...u,stateID:t.getID()}))})}function _8(){const e=yb();return K0(t=>u$(e.current,t),[e])}var c$={useRecoilSnapshot:v8,gotoSnapshot:u$,useGotoRecoilSnapshot:_8,useRecoilTransactionObserver:y8,useTransactionObservation_DEPRECATED:m8,useTransactionSubscription_DEPRECATED:Y0};const{peekNodeInfo:b8}=Di,{useStoreRef:w8}=Po;function S8(){const e=w8();return({key:t})=>b8(e.current,e.current.getState().currentTree,t)}var x8=S8;const{reactMode:E8}=Sd,{RecoilRoot:A8,useStoreRef:C8}=Po,{useMemo:O8}=E;function R8(){E8().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=C8().current;return O8(()=>{function t({children:n}){return E.createElement(A8,{store_INTERNAL:e},n)}return t},[e])}var k8=R8;const{loadableWithValue:T8}=wd,{initializeNode:$8}=Di,{DEFAULT_VALUE:P8,getNode:M8}=_n,{copyTreeState:j8,getRecoilValueAsLoadable:N8,invalidateDownstreams:L8,writeLoadableToTreeState:I8}=Xr;function fx(e){return M8(e.key).nodeType==="atom"}class D8{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(!fx(r))throw Ae("Reading selectors within atomicUpdate is not supported");const o=N8(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(!fx(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 $8(this._store,r.key,"set"),this._changes.set(r.key,o)}),Ee(this,"reset",r=>{this.set(r,P8)}),this._store=t,this._treeState=n,this._changes=new Map}newTreeState_INTERNAL(){if(this._changes.size===0)return this._treeState;const t=j8(this._treeState);for(const[n,r]of this._changes)I8(t,n,T8(r));return L8(this._store,t),t}}function F8(e){return t=>{e.replaceState(n=>{const r=new D8(e,n);return t(r),r.newTreeState_INTERNAL()})}}var U8={atomicUpdater:F8},V8=U8.atomicUpdater,d$=Object.freeze({__proto__:null,atomicUpdater:V8});function z8(e,t){if(!e)throw new Error(t)}var B8=z8,Bu=B8;const{atomicUpdater:H8}=d$,{batchUpdates:W8}=V0,{DEFAULT_VALUE:q8}=_n,{useStoreRef:G8}=Po,{refreshRecoilValue:K8,setRecoilValue:px}=Xr,{cloneSnapshot:Y8}=W0,{gotoSnapshot:Q8}=c$,{useCallback:X8}=E;class f${}const Z8=new f$;function p$(e,t,n,r){let o=Z8,i;if(W8(()=>{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=AT({...r??{},set:(c,d)=>px(e,c,d),reset:c=>px(e,c,q8),refresh:c=>K8(e,c),gotoSnapshot:c=>Q8(e,c),transact_UNSTABLE:c=>H8(e)(c)},{snapshot:()=>{const c=Y8(e);return i=c.retain(),c}}),u=t(l);if(typeof u!="function")throw Ae(s);o=u(...n)}),o instanceof f$&&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 J8(e,t){const n=G8();return X8((...r)=>p$(n.current,e,r),t!=null?[...t,n]:void 0)}var h$={recoilCallback:p$,useRecoilCallback:J8};const{useStoreRef:eH}=Po,{refreshRecoilValue:tH}=Xr,{useCallback:nH}=E;function rH(e){const t=eH();return nH(()=>{const n=t.current;tH(n,e)},[e,t])}var oH=rH;const{atomicUpdater:iH}=d$,{useStoreRef:aH}=Po,{useMemo:sH}=E;function lH(e,t){const n=aH();return sH(()=>(...r)=>{iH(n.current)(i=>{e(i)(...r)})},t!=null?[...t,n]:void 0)}var uH=lH;class cH{constructor(t){Ee(this,"value",void 0),this.value=t}}var dH={WrappedValue:cH},fH=dH.WrappedValue,g$=Object.freeze({__proto__:null,WrappedValue:fH});const{isFastRefreshEnabled:pH}=Sd;class hx extends Error{}class hH{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 hx)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=pH()?"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 rb(t+(this._name!=null?` - ${this._name}`:"")),new hx}}var gH={TreeCache:hH},mH=gH.TreeCache,m$=Object.freeze({__proto__:null,TreeCache:mH});class yH{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 vH={LRUCache:yH},_H=vH.LRUCache,y$=Object.freeze({__proto__:null,LRUCache:_H});const{LRUCache:bH}=y$,{TreeCache:wH}=m$;function SH({name:e,maxSize:t,mapNodeValue:n=r=>r}){const r=new bH({maxSize:t}),o=new wH({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 gx=SH;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 xH(e,t={allowFunctions:!1}){return lr(e,t)}var Q0=xH;const{TreeCache:EH}=m$,ff={equality:"reference",eviction:"keep-all",maxSize:1/0};function AH({equality:e=ff.equality,eviction:t=ff.eviction,maxSize:n=ff.maxSize}=ff,r){const o=CH(e);return OH(t,n,o,r)}function CH(e){switch(e){case"reference":return t=>t;case"value":return t=>Q0(t)}throw Ae(`Unrecognized equality policy ${e}`)}function OH(e,t,n,r){switch(e){case"keep-all":return new EH({name:r,mapNodeValue:n});case"lru":return gx({name:r,maxSize:et(t),mapNodeValue:n});case"most-recent":return gx({name:r,maxSize:1,mapNodeValue:n})}throw Ae(`Unrecognized eviction policy ${e}`)}var RH=AH;function kH(e){return()=>null}var TH={startPerfBlock:kH};const{isLoadable:$H,loadableWithError:pf,loadableWithPromise:PH,loadableWithValue:wm}=wd,{WrappedValue:v$}=g$,{getNodeLoadable:hf,peekNodeLoadable:MH,setNodeValue:jH}=Di,{saveDepsToStore:NH}=xd,{DEFAULT_VALUE:LH,getConfigDeletionHandler:IH,getNode:DH,registerNode:mx}=_n,{isRecoilValue:FH}=Ol,{markRecoilValueModified:yx}=Xr,{retainedByOptionWithDefault:UH}=Ga,{recoilCallback:VH}=h$,{startPerfBlock:zH}=TH;class _${}const Au=new _$,Cu=[],gf=new Map,BH=(()=>{let e=0;return()=>e++})();function b$(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=RH(o??{equality:"reference",eviction:"keep-all"},n),l=UH(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 IH(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)yx(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=wm(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,wm(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 _$)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;NH(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=zH(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),VH(P,St,pt,{node:t})};try{ue=r({get:Ne,getCallback:Ht}),ue=FH(ue)?Ne(ue):ue,$H(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 v$?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=PH(ue):je=wm(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=BH(),[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=zT([u.has(P)?[et(u.get(P))]:[],I0(lb(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=MH(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=DH(re);(G=ee.clearCache)===null||G===void 0||G.call(ee,P,z)}a.clear(),B(z),s.clear(),yx(P,t)}return i!=null?t=mx({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;jH(z,G,we.key,Ne).forEach((St,pt)=>le.set(pt,St))}function Ce(we){ue(we,LH)}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=mx({key:n,nodeType:"selector",peek:V,get:K,init:f,invalidate:B,clearCache:Y,shouldDeleteConfigOnRelease:p,dangerouslyAllowMutability:e.dangerouslyAllowMutability,shouldRestoreFromSnapshots:!1,retainedBy:l})}b$.value=e=>new v$(e);var Tl=b$;const{isLoadable:HH,loadableWithError:Sm,loadableWithPromise:xm,loadableWithValue:is}=wd,{WrappedValue:w$}=g$,{peekNodeInfo:WH}=Di,{DEFAULT_VALUE:Ji,DefaultValue:Ko,getConfigDeletionHandler:S$,registerNode:qH,setConfigDeletionHandler:GH}=_n,{isRecoilValue:KH}=Ol,{getRecoilValueAsLoadable:YH,markRecoilValueModified:QH,setRecoilValue:vx,setRecoilValueLoadable:XH}=Xr,{retainedByOptionWithDefault:ZH}=Ga,Ou=e=>e instanceof w$?e.value:e;function JH(e){const{key:t,persistence_UNSTABLE:n}=e,r=ZH(e.retainedBy_UNSTABLE);let o=0;function i(h){return xm(h.then(y=>(a=is(y),y)).catch(y=>{throw a=Sm(y),y}))}let a=Ke(e.default)?i(e.default):HH(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&&vx(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&&XH(h,m,Sm(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)||QH(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)?xm(Y.then(P=>P instanceof Ko?a.toPromise():P)):is(Y)}return YH(h,B)},T=function(B){return C(B).toPromise()},k=function(B){var Y;const P=WH(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)}),vx(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?Sm($):Ke($)?xm(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 S$(t)!==void 0&&o<=0}const m=qH({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 vb(e){const{...t}=e,n="default"in e?e.default:new Promise(()=>{});return KH(n)?e7({...t,default:n}):JH({...t,default:n})}function e7(e){const t=vb({...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 GH(n.key,S$(e.key)),n}vb.value=e=>new w$(e);var x$=vb;class t7{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 n7={MapCache:t7},r7=n7.MapCache,o7=Object.freeze({__proto__:null,MapCache:r7});const{LRUCache:_x}=y$,{MapCache:i7}=o7,mf={equality:"reference",eviction:"none",maxSize:1/0};function a7({equality:e=mf.equality,eviction:t=mf.eviction,maxSize:n=mf.maxSize}=mf){const r=s7(e);return l7(t,n,r)}function s7(e){switch(e){case"reference":return t=>t;case"value":return t=>Q0(t)}throw Ae(`Unrecognized equality policy ${e}`)}function l7(e,t,n){switch(e){case"keep-all":return new i7({mapKey:n});case"lru":return new _x({mapKey:n,maxSize:et(t)});case"most-recent":return new _x({mapKey:n,maxSize:1})}throw Ae(`Unrecognized eviction policy ${e}`)}var E$=a7;const{setConfigDeletionHandler:u7}=_n;function c7(e){var t,n;const r=E$({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=x$({...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),u7(d.key,()=>{r.delete(o)}),d}}var d7=c7;const{setConfigDeletionHandler:f7}=_n;let p7=0;function h7(e){var t,n;const r=E$({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"}/${p7++}`,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),f7(d.key,()=>{r.delete(o)}),d}}var Fi=h7;const g7=Fi({key:"__constant",get:e=>()=>e,cachePolicyForParams_UNSTABLE:{equality:"reference"}});function m7(e){return g7(e)}var y7=m7;const v7=Fi({key:"__error",get:e=>()=>{throw Ae(e)},cachePolicyForParams_UNSTABLE:{equality:"reference"}});function _7(e){return v7(e)}var b7=_7;function w7(e){return e}var S7=w7;const{loadableWithError:A$,loadableWithPromise:C$,loadableWithValue:O$}=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 x7(e){return e!=null&&!Ke(e)}function Z0(e){return Array.isArray(e)?e:Object.getOwnPropertyNames(e).map(t=>e[t])}function l1(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?O$(t[i]):Ke(o)?C$(o):A$(o));return l1(e,r)}function E7(e,t){return t.map((n,r)=>n===void 0?e[r]:n)}const A7=Fi({key:"__waitForNone",get:e=>({get:t})=>{const n=Z0(e),[r,o]=X0(t,n);return Ks(e,r,o)},dangerouslyAllowMutability:!0}),C7=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}),O7=Fi({key:"__waitForAll",get:e=>({get:t})=>{const n=Z0(e),[r,o]=X0(t,n);if(o.every(a=>a==null))return l1(e,r);const i=o.find(x7);if(i!=null)throw i;return Promise.all(o).then(a=>l1(e,E7(r,a)))},dangerouslyAllowMutability:!0}),R7=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}),k7=Fi({key:"__noWait",get:e=>({get:t})=>{try{return Tl.value(O$(t(e)))}catch(n){return Tl.value(Ke(n)?C$(n):A$(n))}},dangerouslyAllowMutability:!0});var T7={waitForNone:A7,waitForAny:C7,waitForAll:O7,waitForAllSettled:R7,noWait:k7};const{RecoilLoadable:$7}=wd,{DefaultValue:P7}=_n,{RecoilRoot:M7,useRecoilStoreID:j7}=Po,{isRecoilValue:N7}=Ol,{retentionZone:L7}=F0,{freshSnapshot:I7}=W0,{useRecoilState:D7,useRecoilState_TRANSITION_SUPPORT_UNSTABLE:F7,useRecoilStateLoadable:U7,useRecoilValue:V7,useRecoilValue_TRANSITION_SUPPORT_UNSTABLE:z7,useRecoilValueLoadable:B7,useRecoilValueLoadable_TRANSITION_SUPPORT_UNSTABLE:H7,useResetRecoilState:W7,useSetRecoilState:q7}=n8,{useGotoRecoilSnapshot:G7,useRecoilSnapshot:K7,useRecoilTransactionObserver:Y7}=c$,{useRecoilCallback:Q7}=h$,{noWait:X7,waitForAll:Z7,waitForAllSettled:J7,waitForAny:eW,waitForNone:tW}=T7;var _b={DefaultValue:P7,isRecoilValue:N7,RecoilLoadable:$7,RecoilEnv:Gl,RecoilRoot:M7,useRecoilStoreID:j7,useRecoilBridgeAcrossReactRoots_UNSTABLE:k8,atom:x$,selector:Tl,atomFamily:d7,selectorFamily:Fi,constSelector:y7,errorSelector:b7,readOnlySelector:S7,noWait:X7,waitForNone:tW,waitForAny:eW,waitForAll:Z7,waitForAllSettled:J7,useRecoilValue:V7,useRecoilValueLoadable:B7,useRecoilState:D7,useRecoilStateLoadable:U7,useSetRecoilState:q7,useResetRecoilState:W7,useGetRecoilValueInfo_UNSTABLE:x8,useRecoilRefresher_UNSTABLE:oH,useRecoilValueLoadable_TRANSITION_SUPPORT_UNSTABLE:H7,useRecoilValue_TRANSITION_SUPPORT_UNSTABLE:z7,useRecoilState_TRANSITION_SUPPORT_UNSTABLE:F7,useRecoilCallback:Q7,useRecoilTransaction_UNSTABLE:uH,useGotoRecoilSnapshot:G7,useRecoilSnapshot:K7,useRecoilTransactionObserver_UNSTABLE:Y7,snapshot_UNSTABLE:I7,useRetain:pb,retentionZone:L7},nW=_b.RecoilRoot,R$=_b.atom,bx=_b.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 rW(e,t){return typeof e=="function"?e(t):e}function u1(e){return typeof e=="number"&&e>=0&&e!==1/0}function k$(e,t){return Math.max(e+(t||0)-Date.now(),0)}function wx(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:a,stale:s}=e;if(a){if(r){if(t.queryHash!==bb(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 Sx(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 bb(e,t){return((t==null?void 0:t.queryKeyHashFn)||Lc)(e)}function Lc(e){return JSON.stringify(e,(t,n)=>d1(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 T$(e,t){if(e===t)return e;const n=xx(e)&&xx(t);if(n||d1(e)&&d1(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!(!Ex(n)||!n.hasOwnProperty("isPrototypeOf"))}function Ex(e){return Object.prototype.toString.call(e)==="[object Object]"}function oW(e){return new Promise(t=>{setTimeout(t,e)})}function f1(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?T$(e,t):t}function iW(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function aW(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var ha,ni,nl,vO,sW=(vO=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,vO),eh=new sW,rl,ri,ol,_O,lW=(_O=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,_O),th=new lW;function uW(e){return Math.min(1e3*2**e,3e4)}function J0(e){return(e??"online")==="online"?th.isOnline():!0}var $$=class{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Em(e){return e instanceof $$}function P$(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 $$(_)),(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??uW,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 cW(){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=cW(),ga,bO,M$=(bO=class{constructor(){he(this,ga,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),u1(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,bO),il,al,zn,oi,Bn,Et,rd,ma,sl,tp,dr,io,wO,dW=(wO=class extends M${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||fW(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=f1(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||!k$(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;Em(p)&&p.silent||Re(this,dr,io).call(this,{type:"error",error:p}),Em(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,P$({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 Em(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})})},wO);function fW(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,SO,pW=(SO=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??bb(o,n);let a=this.get(i);return a||(a=new dW({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=>wx(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>wx(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,SO),Nr,od,En,ll,Lr,Bo,xO,hW=(xO=class extends M${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||gW(),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,P$({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})})},xO);function gW(){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,EO,mW=(EO=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 hW({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=>Sx(n,r))}findAll(t={}){return L(this,Hn).filter(n=>Sx(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,EO);function yW(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?aW:iW;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?vW:Ax,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 Ax(e,{pages:t,pageParams:n}){const r=t.length-1;return e.getNextPageParam(t[r],t,n[r],n)}function vW(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,AO,_W=(AO=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 pW),ce(this,ii,e.mutationCache||new mW),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=rW(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=yW(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=bb(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,AO),sn,Ge,ad,qt,va,pl,Ir,sd,hl,gl,_a,ba,li,ml,wa,Hu,ld,p1,ud,h1,cd,g1,dd,m1,fd,y1,pd,v1,hd,_1,d0,j$,CO,bW=(CO=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),Cx(L(this,Ge),this.options)?Re(this,wa,Hu).call(this):this.updateResult(),Re(this,dd,m1).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return b1(L(this,Ge),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return b1(L(this,Ge),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Re(this,fd,y1).call(this),Re(this,pd,v1).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,_1).call(this),c1(this.options,r)||L(this,sn).getQueryCache().notify({type:"observerOptionsUpdated",query:L(this,Ge),observer:this});const i=this.hasListeners();i&&Ox(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,p1).call(this);const a=Re(this,ud,h1).call(this);i&&(L(this,Ge)!==o||this.options.enabled!==r.enabled||a!==L(this,li))&&Re(this,cd,g1).call(this,a)}getOptimisticResult(t){const n=L(this,sn).getQueryCache().build(L(this,sn),t),r=this.createResult(n,t);return SW(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&&Cx(t,n),R=A&&Ox(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),_=f1(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",_=f1(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:wb(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)),c1(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,j$).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Re(this,dd,m1).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,_1).call(this);let n=L(this,Ge).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Wn)),n},ld=new WeakSet,p1=function(){if(Re(this,fd,y1).call(this),$l||L(this,qt).isStale||!u1(this.options.staleTime))return;const n=k$(L(this,qt).dataUpdatedAt,this.options.staleTime)+1;ce(this,_a,setTimeout(()=>{L(this,qt).isStale||this.updateResult()},n))},ud=new WeakSet,h1=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(L(this,Ge)):this.options.refetchInterval)??!1},cd=new WeakSet,g1=function(t){Re(this,pd,v1).call(this),ce(this,li,t),!($l||this.options.enabled===!1||!u1(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,m1=function(){Re(this,ld,p1).call(this),Re(this,cd,g1).call(this,Re(this,ud,h1).call(this))},fd=new WeakSet,y1=function(){L(this,_a)&&(clearTimeout(L(this,_a)),ce(this,_a,void 0))},pd=new WeakSet,v1=function(){L(this,ba)&&(clearInterval(L(this,ba)),ce(this,ba,void 0))},hd=new WeakSet,_1=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,j$=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"})})},CO);function wW(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Cx(e,t){return wW(e,t)||e.state.dataUpdatedAt>0&&b1(e,t,t.refetchOnMount)}function b1(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&wb(e,t)}return!1}function Ox(e,t,n,r){return n.enabled!==!1&&(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&wb(e,n)}function wb(e,t){return e.isStaleByTime(t.staleTime)}function SW(e,t){return!c1(e.getCurrentResult(),t)}var N$=H.createContext(void 0),xW=e=>{const t=H.useContext(N$);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},EW=({client:e,children:t})=>(H.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),j.jsx(N$.Provider,{value:e,children:t})),L$=H.createContext(!1),AW=()=>H.useContext(L$);L$.Provider;function CW(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var OW=H.createContext(CW()),RW=()=>H.useContext(OW);function kW(e,t){return typeof e=="function"?e(...t):!!e}var TW=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},$W=e=>{H.useEffect(()=>{e.clearReset()},[e])},PW=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&kW(n,[e.error,r]),MW=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},jW=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,NW=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function LW(e,t,n){const r=xW(n),o=AW(),i=RW(),a=r.defaultQueryOptions(e);a._optimisticResults=o?"isRestoring":"optimistic",MW(a),TW(a,i),$W(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]),jW(a,l))throw NW(a,s,i);if(PW({result:l,errorResetBoundary:i,throwOnError:a.throwOnError,query:r.getQueryCache().get(a.queryHash)}))throw l.error;return a.notifyOnChangeProps?l:s.trackResult(l)}function I$(e,t){return LW(e,bW,t)}const D$="Starter App",IW="This field is required.",F$=8,DW=`Password must be at least ${F$} characters long`,U$={required:IW},FW={...U$,minLength:{value:F$,message:DW}},UW="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",VW="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",zW="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",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='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",HW="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",WW="/comet-starter/img/logo.png",qW=()=>{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:WW,alt:"US Flag"})}),j.jsx("div",{className:"mobile-lg:grid-col-auto",children:j.jsx("p",{className:"usa-footer__logo-heading",children:D$})})]}),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:UW,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:BW,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:HW,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:VW,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:zW,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:""})})]})})]})]})})})]})},GW=e=>e&&typeof e=="object"&&e.nodeType===1;var Mo=(e,t)=>{if(typeof e!="string")return[];(!t||!GW(t))&&(t=window.document);const n=t.querySelectorAll(e);return Array.prototype.slice.call(n)};/* +object-assign +(c) Sindre Sorhus +@license MIT +*/var Rx=Object.getOwnPropertySymbols,KW=Object.prototype.hasOwnProperty,YW=Object.prototype.propertyIsEnumerable;function QW(e){if(e==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function XW(){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 Sb=XW()?Object.assign:function(e,t){for(var n,r=QW(e),o,i=1;i-1?e.split(Tx).map(function(a){return z$({type:a},i)}):(i.type=e,[i])};var $x=function(e,t){var n=e[t];return delete e[t],n},B$=function(t,n){const r=Object.keys(t).reduce(function(o,i){var a=oq(i,t[i]);return o.concat(a)},[]);return z$({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 iq=Sb,aq=B$,Px=(...e)=>function(n=document.body){e.forEach(r=>{typeof this[r]=="function"&&this[r].call(this,n)})};var Mn=(e,t)=>aq(e,iq({on:Px("init","add"),off:Px("teardown","remove")},t));const Mx="aria-expanded",sq="aria-controls",jx="hidden";var Eb=(e,t)=>{let n=t;typeof n!="boolean"&&(n=e.getAttribute(Mx)==="false"),e.setAttribute(Mx,n);const r=e.getAttribute(sq),o=document.getElementById(r);if(!o)throw new Error(`No toggle target found with id: "${r}"`);return n?o.removeAttribute(jx):o.setAttribute(jx,""),n};function lq(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 H$=lq,Yl={CLICK:"click"},or={prefix:"usa"};const W$=Mo,uq=Mn,Nx=Eb,cq=H$,{CLICK:dq}=Yl,{prefix:nh}=or,rh=`.${nh}-accordion, .${nh}-accordion--bordered`,fq=`.${nh}-banner__button`,cc=`.${nh}-accordion__button[aria-controls]:not(${fq})`,Lx="aria-expanded",pq="data-allow-multiple",q$=e=>W$(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=Nx(e,t);const o=n.hasAttribute(pq);r&&!o&&q$(n).forEach(i=>{i!==e&&Nx(i,!1)})},hq=e=>dc(e,!0),gq=e=>dc(e,!1),mq=uq({[dq]:{[cc](){dc(this),this.getAttribute(Lx)==="true"&&(cq(this)||this.scrollIntoView())}}},{init(e){W$(cc,e).forEach(t=>{const n=t.getAttribute(Lx)==="true";dc(t,n)})},ACCORDION:rh,BUTTON:cc,show:hq,hide:gq,toggle:dc,getButtons:q$});var G$=mq;const Ix=ko(G$),yq=Mn,vq=Mo,{CLICK:_q}=Yl,{prefix:K$}=or,Y$=Eb,Q$=`.${K$}-banner__header`,X$=`${K$}-banner__header--expanded`,w1=`${Q$} [aria-controls]`,bq=function(t){t.preventDefault();const n=t.target.closest(w1);Y$(n),this.closest(Q$).classList.toggle(X$)};var wq=yq({[_q]:{[w1]:bq}},{init(e){vq(w1,e).forEach(t=>{const n=t.getAttribute(X$)==="true";Y$(t,n)})}});const Dx=ko(wq),Sq="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAAsBAMAAAAncaPMAAAAAXNSR0IArs4c6QAAABtQTFRF////4EAg2z8g2z8f2z4f2j4fHjSyHjOxHTOxQEYPwgAAAIdJREFUeNrNkUENxDAMBEOhFJaCKZiCKZhCKBj2ebV3rdR71+pIq+Qxj1GyqjJ3U8VlHkc07hFm0awBYe91juq6MSI0yhSAEgkzJ4TMKiXyzFw3pgR9lmIBJlqj2AmBedf+IycExmlKZVzvZEJ4A0oBrjBl/m6PCy95B3fFAN6YuQPxhbcB4QMkEj04wQXD5wAAAABJRU5ErkJggg==",xq="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",Eq="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 Aq=function(t,n=500){let r=null;return(...o)=>{window.clearTimeout(r),r=window.setTimeout(()=>{t.apply(this,o)},n)}};const Cq=Mo,Oq=Mn,Rq=Aq,{prefix:eg}=or,Ab=`${eg}-character-count`,Am=`.${Ab}`,S1=`.${eg}-character-count__field`,Fx=`.${eg}-character-count__message`,x1="The content is too long.",Z$=`${eg}-character-count__status--invalid`,Cb=`${Ab}__status`,Ob=`${Ab}__sr-status`,kq=`.${Cb}`,Tq=`.${Ob}`,Rb="characters allowed",kb=e=>{const t=e.closest(Am);if(!t)throw new Error(`${S1} is missing outer ${Am}`);const n=t.querySelector(Fx);if(!n)throw new Error(`${Am} is missing inner ${Fx}`);return{characterCountEl:t,messageEl:n}},$q=e=>{const{characterCountEl:t}=kb(e),n=e.getAttribute("maxlength");n&&(e.removeAttribute("maxlength"),t.setAttribute("data-maxlength",n))},J$=e=>{const t=document.createElement("div"),n=document.createElement("div"),o=`${e.dataset.maxlength} ${Rb}`;t.classList.add(`${Cb}`,"usa-hint"),n.classList.add(`${Ob}`,"usa-sr-only"),t.setAttribute("aria-hidden",!0),n.setAttribute("aria-live","polite"),t.textContent=o,n.textContent=o,e.append(t,n)},eP=(e,t)=>{let n="";if(e===0)n=`${t} ${Rb}`;else{const r=Math.abs(t-e),o=`character${r===1?"":"s"}`,i=e>t?"over limit":"left";n=`${r} ${o} ${i}`}return n},Pq=Rq((e,t)=>{const n=e;n.textContent=t},1e3),Ux=e=>{const{characterCountEl:t}=kb(e),n=e.value.length,r=parseInt(t.getAttribute("data-maxlength"),10),o=t.querySelector(kq),i=t.querySelector(Tq),a=eP(n,r);if(!r)return;const s=n&&n>r;o.textContent=a,Pq(i,a),s&&!e.validationMessage&&e.setCustomValidity(x1),!s&&e.validationMessage===x1&&e.setCustomValidity(""),o.classList.toggle(Z$,s)},Mq=e=>{const{characterCountEl:t,messageEl:n}=kb(e);n.classList.add("usa-sr-only"),n.removeAttribute("aria-live"),$q(e),J$(t)};Oq({input:{[S1](){Ux(this)}}},{init(e){Cq(S1,e).forEach(t=>Mq(t))},MESSAGE_INVALID_CLASS:Z$,VALIDATION_MESSAGE:x1,STATUS_MESSAGE_CLASS:Cb,STATUS_MESSAGE_SR_ONLY_CLASS:Ob,DEFAULT_STATUS_LABEL:Rb,createStatusMessages:J$,getCountMessage:eP,updateCountMessage:Ux});var Tb={exports:{}},jq={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})()})(jq);const E1={Alt:"altKey",Control:"ctrlKey",Ctrl:"ctrlKey",Shift:"shiftKey"},tP="+",Nq=function(e,t){var n=e.key;if(t)for(var r in E1)e[E1[r]]===!0&&(n=[r,n].join(tP));return n};Tb.exports=function(t){const n=Object.keys(t).some(function(r){return r.indexOf(tP)>-1});return function(r){var o=Nq(r,n);return[o,o.toLowerCase()].reduce(function(i,a){return a in t&&(i=t[o].call(this,r)),i},void 0)}};Tb.exports.MODIFIERS=E1;var tg=Tb.exports;const Lq=Mo,Iq=e=>e&&typeof e=="object"&&e.nodeType===1;var Ka=(e,t)=>{const n=Lq(e,t);return typeof e!="string"||Iq(t)&&t.matches(e)&&n.push(t),n},nP={exports:{}};(function(e){nP.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(Wq),r=t.querySelector(np),o=t.querySelector(qq),i=t.querySelector(Kq),a=t.querySelector(cP),s=t.querySelector(Gq),l=t.querySelector(uP),u=t.querySelector(lP),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}},dP=e=>{const{inputEl:t,toggleListBtnEl:n,clearInputBtnEl:r}=kt(e);r.hidden=!0,r.disabled=!0,n.disabled=!0,t.disabled=!0},Xq=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)},Zq=e=>{const{inputEl:t,toggleListBtnEl:n,clearInputBtnEl:r}=kt(e);r.hidden=!1,r.disabled=!1,n.disabled=!1,t.disabled=!1},zx=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",oP),f.setAttribute("type","text"),f.setAttribute("role","combobox"),l.forEach(p=>Object.keys(p).forEach(g=>{const v=Vx.escapeHTML`${p[g]}`;f.setAttribute(g,v)})),t.insertAdjacentElement("beforeend",f),t.insertAdjacentHTML("beforeend",Vx.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&&(dP(t),n.disabled=!1),n.hasAttribute("aria-disabled")&&(Xq(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||Yq,p=fP(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(aP,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},Mb=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()},Jq=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()},jb=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),jb(t),n.focus()},Bx=e=>{const{comboBoxEl:t,listEl:n}=kt(e.target);n.hidden&&Pl(t);const r=n.querySelector(cP)||n.querySelector(rp);r&&Rd(t,r),e.preventDefault()},nG=e=>{const{comboBoxEl:t,listEl:n}=kt(e.target),r=!n.hidden;eG(t),r&&Fa(t),e.preventDefault()},Hx=e=>{const t=e.target,n=t.nextSibling;n&&Rd(t,n),e.preventDefault()},rG=e=>{Mb(e.target),e.preventDefault()},oG=e=>{Mb(e.target),e.preventDefault()},Wx=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)},iG=e=>{e.classList.contains(Da)||Rd(e,e,{preventScroll:!0})},aG=e=>{const{comboBoxEl:t,listEl:n,inputEl:r}=kt(e);n.hidden?Pl(t):Fa(t),r.focus()},sG=e=>{const{comboBoxEl:t,listEl:n}=kt(e);n.hidden&&Pl(t)},lG=Fq({[Vq]:{[np](){this.disabled||sG(this)},[uP](){this.disabled||aG(this)},[rp](){this.disabled||Mb(this)},[lP](){this.disabled||Jq(this)}},focusout:{[mo](e){this.contains(e.relatedTarget)||(jb(this),Fa(this))}},keydown:{[mo]:Cm({Escape:tG}),[np]:Cm({Enter:nG,ArrowDown:Bx,Down:Bx}),[rp]:Cm({ArrowUp:Wx,Up:Wx,ArrowDown:Hx,Down:Hx,Enter:oG," ":rG,"Shift+Tab":Qq})},input:{[np](){this.closest(mo).classList.remove(Ya),Pl(this)}},mouseover:{[rp](){iG(this)}}},{init(e){Dq(mo,e).forEach(t=>{zx(t)})},getComboBoxContext:kt,enhanceComboBox:zx,generateDynamicRegExp:fP,disable:dP,enable:Zq,displayList:Pl,hideList:Fa,COMBO_BOX_CLASS:Cr});var uG=lG,pP=(e=document)=>e.activeElement;function cG(){return typeof navigator<"u"&&(navigator.userAgent.match(/(iPod|iPhone|iPad)/g)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!window.MSStream}var dG=cG;const Wi=tg,fG=Mn,pG=Mo,hG=Ka,{prefix:gG}=or,{CLICK:mG}=Yl,yG=pP,vG=dG,Ys=ng,jo=`${gG}-date-picker`,_G=`${jo}__wrapper`,bG=`${jo}--initialized`,hP=`${jo}--active`,gP=`${jo}__internal-input`,mP=`${jo}__external-input`,yP=`${jo}__button`,ct=`${jo}__calendar`,vP=`${jo}__status`,ir=`${ct}__date`,_P=`${ir}--focused`,wG=`${ir}--selected`,SG=`${ir}--previous-month`,bP=`${ir}--current-month`,xG=`${ir}--next-month`,EG=`${ir}--range-date`,AG=`${ir}--today`,CG=`${ir}--range-date-start`,OG=`${ir}--range-date-end`,RG=`${ir}--within-range`,wP=`${ct}__previous-year`,SP=`${ct}__previous-month`,xP=`${ct}__next-year`,EP=`${ct}__next-month`,AP=`${ct}__month-selection`,CP=`${ct}__year-selection`,rg=`${ct}__month`,Nb=`${rg}--focused`,kG=`${rg}--selected`,og=`${ct}__year`,Lb=`${og}--focused`,TG=`${og}--selected`,OP=`${ct}__previous-year-chunk`,RP=`${ct}__next-year-chunk`,kP=`${ct}__date-picker`,TP=`${ct}__month-picker`,$P=`${ct}__year-picker`,oh=`${ct}__table`,$G=`${ct}__row`,ds=`${ct}__cell`,yf=`${ds}--center-items`,PG=`${ct}__month-label`,MG=`${ct}__day-of-week`,Ua=`.${jo}`,PP=`.${yP}`,jG=`.${gP}`,op=`.${mP}`,ih=`.${ct}`,NG=`.${vP}`,qx=`.${ir}`,Ql=`.${_P}`,LG=`.${bP}`,Ib=`.${wP}`,Db=`.${SP}`,Fb=`.${xP}`,Ub=`.${EP}`,MP=`.${CP}`,jP=`.${AP}`,A1=`.${rg}`,ah=`.${og}`,Vb=`.${OP}`,zb=`.${RP}`,Xl=`.${kP}`,IG=`.${TP}`,Bb=`.${$P}`,ig=`.${Nb}`,Zl=`.${Lb}`,Gx="Please enter a valid date",C1=["January","February","March","April","May","June","July","August","September","October","November","December"],DG=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],FG=13,Dr=12,UG="0000-01-01",ag="MM/DD/YYYY",NP="YYYY-MM-DD",VG=":not([disabled])",Hb=(...e)=>e.map(t=>t+VG).join(", "),zG=Hb(Ib,Db,MP,jP,Fb,Ub,Ql),BG=Hb(ig),HG=Hb(Vb,zb,Zl),Wb=(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},qb=()=>{const e=new Date,t=e.getDate(),n=e.getMonth(),r=e.getFullYear();return sh(r,n,t)},Gb=e=>{const t=new Date(0);return t.setFullYear(e.getFullYear(),e.getMonth(),1),t},LP=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},Kb=(e,t)=>Ea(e,-t),IP=(e,t)=>Ea(e,t*7),WG=(e,t)=>IP(e,-t),DP=e=>{const t=e.getDay();return Kb(e,t)},qG=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),Wb(n,r),n},Yb=(e,t)=>kd(e,-t),Qb=(e,t)=>kd(e,t*12),FP=(e,t)=>Qb(e,-t),Ml=(e,t)=>{const n=new Date(e.getTime());return n.setMonth(t),Wb(n,t),n},xi=(e,t)=>{const n=new Date(e.getTime()),r=n.getMonth();return n.setFullYear(t),Wb(n,r),n},GG=(e,t)=>{let n=e;return t{let n=e;return t>e&&(n=t),new Date(n.getTime())},UP=(e,t)=>e&&t&&e.getFullYear()===t.getFullYear(),ea=(e,t)=>UP(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())},O1=(e,t,n)=>e>=t&&(!n||e<=n),YG=(e,t,n)=>LP(e)n,Om=(e,t,n)=>LP(Ml(e,11))n,pr=(e,t=NP,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=qb().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=NP)=>{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("-")},Xb=(e,t)=>{const n=[];let r=[],o=0;for(;o{i.insertAdjacentElement("beforeend",a)}),n.push(i)}return n},Zb=e=>{const t=document.createElement("tbody");return e.forEach(n=>{t.insertAdjacentElement("beforeend",n)}),t},R1=(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(jG),r=t.querySelector(op),o=t.querySelector(ih),i=t.querySelector(PP),a=t.querySelector(NG),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}},VP=e=>{const{externalInputEl:t,toggleBtnEl:n}=Ue(e);n.disabled=!0,t.disabled=!0},zP=e=>{const{externalInputEl:t,toggleBtnEl:n}=Ue(e);n.setAttribute("aria-disabled",!0),t.setAttribute("aria-disabled",!0)},QG=e=>{const{externalInputEl:t,toggleBtnEl:n}=Ue(e);n.disabled=!1,t.disabled=!1},Jb=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&&O1(c,n,r)&&(i=!1)}}return i},lh=e=>{const{externalInputEl:t}=Ue(e),n=Jb(t);n&&!t.validationMessage&&t.setCustomValidity(Gx),!n&&t.validationMessage===Gx&&t.setCustomValidity("")},XG=e=>{const{internalInputEl:t,inputDate:n}=Ue(e);let r="";n&&!Jb(e)&&(r=jl(n)),t.value!==r&&R1(t,r)},e2=(e,t)=>{const n=pr(t);if(n){const r=jl(n,ag),{datePickerEl:o,internalInputEl:i,externalInputEl:a}=Ue(e);R1(i,t),R1(a,r),lh(o)}},ZG=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):UG;const i=pr(t.dataset.maxDate||r.getAttribute("max"));i&&(t.dataset.maxDate=jl(i));const a=document.createElement("div");a.classList.add(_G);const s=r.cloneNode();s.classList.add(mP),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(gP),r.removeAttribute("id"),r.removeAttribute("name"),r.required=!1,t.appendChild(a),t.classList.add(bG),n&&e2(t,n),r.disabled&&(VP(t),r.disabled=!1),r.hasAttribute("aria-disabled")&&(zP(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=qb();let c=t||u;const d=r.hidden,f=Ea(c,0),p=c.getMonth(),g=c.getFullYear(),v=Yb(c,1),_=kd(c,1),m=jl(c),h=Gb(c),y=ea(c,s),b=ea(c,a),S=i||c,x=l&&GG(S,l),A=l&&KG(S,l),O=l&&Ea(x,1),R=l&&Kb(A,1),C=C1[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=!O1(P,s,a),je=Ho(P,i);ea(P,v)&&z.push(SG),ea(P,f)&&z.push(bP),ea(P,_)&&z.push(xG),je&&z.push(wG),Ho(P,u)&&z.push(AG),l&&(Ho(P,l)&&z.push(EG),Ho(P,x)&&z.push(CG),Ho(P,A)&&z.push(OG),O1(P,O,R)&&z.push(RG)),Ho(P,f)&&(ue="0",z.push(_P));const we=C1[re],$e=DG[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=DP(h);const k=[];for(;k.length<28||c.getMonth()===p||k.length%7!==0;)k.push(T(c)),c=Ea(c,1);const $=Xb(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",MG),z.setAttribute("scope","col"),z.setAttribute("aria-label",P),z.textContent=V[P],Q.insertAdjacentElement("beforeend",z)});const K=Zb($);N.insertAdjacentElement("beforeend",K),D.querySelector(Xl).insertAdjacentElement("beforeend",N),r.parentNode.replaceChild(D,r),n.classList.add(hP);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},JG=e=>{if(e.disabled)return;const{calendarEl:t,calendarDate:n,minDate:r,maxDate:o}=Ue(e);let i=FP(n,1);i=jn(i,r,o);const a=Or(t,i);let s=a.querySelector(Ib);s.disabled&&(s=a.querySelector(Xl)),s.focus()},eK=e=>{if(e.disabled)return;const{calendarEl:t,calendarDate:n,minDate:r,maxDate:o}=Ue(e);let i=Yb(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()},tK=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(Ub);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()},sg=e=>{const{datePickerEl:t,calendarEl:n,statusEl:r}=Ue(e);t.classList.remove(hP),n.hidden=!0,r.textContent=""},rK=e=>{if(e.disabled)return;const{datePickerEl:t,externalInputEl:n}=Ue(e);e2(e,e.dataset.value),sg(t),n.focus()},oK=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||qb(),r,o);Or(t,a).querySelector(Ql).focus()}else sg(e)},BP=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)}},t2=(e,t)=>{const{calendarEl:n,statusEl:r,calendarDate:o,minDate:i,maxDate:a}=Ue(e),s=o.getMonth(),l=t??s,u=C1.map((v,_)=>{const m=Ml(o,_),h=YG(m,i,a);let y="-1";const b=[rg],S=_===s;_===l&&(y="0",b.push(Nb)),S&&b.push(kG);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",TP);const d=document.createElement("table");d.setAttribute("class",oh),d.setAttribute("role","presentation");const f=Xb(u,3),p=Zb(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},iK=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=Om(xi(o,u-1),i,a),d=Om(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(Vb);d.disabled&&(d=c.querySelector(Bb)),d.focus()},sK=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(zb);d.disabled&&(d=c.querySelector(Bb)),d.focus()},lK=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()},uK=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()},Kx=Jr(e=>WG(e,1)),Yx=Jr(e=>IP(e,1)),Qx=Jr(e=>Kb(e,1)),Xx=Jr(e=>Ea(e,1)),cK=Jr(e=>DP(e)),dK=Jr(e=>qG(e)),fK=Jr(e=>kd(e,1)),pK=Jr(e=>Yb(e,1)),hK=Jr(e=>Qb(e,1)),gK=Jr(e=>FP(e,1)),mK=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)||t2(o,d.getMonth()).querySelector(ig).focus(),t.preventDefault()},Zx=Ui(e=>e-3),Jx=Ui(e=>e+3),e6=Ui(e=>e-1),t6=Ui(e=>e+1),yK=Ui(e=>e-e%3),vK=Ui(e=>e+2-e%3),_K=Ui(()=>11),bK=Ui(()=>0),wK=e=>{if(e.disabled||e.classList.contains(Nb))return;const t=parseInt(e.dataset.value,10);t2(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);UP(l,d)||Td(o,d.getFullYear()).querySelector(Zl).focus(),t.preventDefault()},n6=Vi(e=>e-3),r6=Vi(e=>e+3),o6=Vi(e=>e-1),i6=Vi(e=>e+1),SK=Vi(e=>e-e%3),xK=Vi(e=>e+2-e%3),EK=Vi(e=>e-Dr),AK=Vi(e=>e+Dr),CK=e=>{if(e.disabled||e.classList.contains(Lb))return;const t=parseInt(e.dataset.value,10);Td(e,t).querySelector(Zl).focus()},n2=e=>{const t=n=>{const{calendarEl:r}=Ue(n),o=pG(e,r),i=0,a=o.length-1,s=o[i],l=o[a],u=o.indexOf(yG());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())}}},Rm=n2(zG),a6=n2(BG),s6=n2(HG),HP={[mG]:{[PP](){oK(this)},[qx](){rK(this)},[A1](){iK(this)},[ah](){lK(this)},[Db](){eK(this)},[Ub](){tK(this)},[Ib](){JG(this)},[Fb](){nK(this)},[Vb](){aK(this)},[zb](){sK(this)},[jP](){t2(this).querySelector(ig).focus()},[MP](){Td(this).querySelector(Zl).focus()}},keyup:{[ih](e){const t=this.dataset.keydownKeyCode;`${e.keyCode}`!==t&&e.preventDefault()}},keydown:{[op](e){e.keyCode===FG&&lh(this)},[qx]:Wi({Up:Kx,ArrowUp:Kx,Down:Yx,ArrowDown:Yx,Left:Qx,ArrowLeft:Qx,Right:Xx,ArrowRight:Xx,Home:cK,End:dK,PageDown:fK,PageUp:pK,"Shift+PageDown":hK,"Shift+PageUp":gK,Tab:Rm.tabAhead}),[Xl]:Wi({Tab:Rm.tabAhead,"Shift+Tab":Rm.tabBack}),[A1]:Wi({Up:Zx,ArrowUp:Zx,Down:Jx,ArrowDown:Jx,Left:e6,ArrowLeft:e6,Right:t6,ArrowRight:t6,Home:yK,End:vK,PageDown:_K,PageUp:bK}),[IG]:Wi({Tab:a6.tabAhead,"Shift+Tab":a6.tabBack}),[ah]:Wi({Up:n6,ArrowUp:n6,Down:r6,ArrowDown:r6,Left:o6,ArrowLeft:o6,Right:i6,ArrowRight:i6,Home:SK,End:xK,PageDown:AK,PageUp:EK}),[Bb]:Wi({Tab:s6.tabAhead,"Shift+Tab":s6.tabBack}),[ih](e){this.dataset.keydownKeyCode=e.keyCode},[Ua](e){Wi({Escape:uK})(e)}},focusout:{[op](){lh(this)},[Ua](e){this.contains(e.relatedTarget)||sg(this)}},input:{[op](){XG(this),BP(this)}}};vG()||(HP.mouseover={[LG](){mK(this)},[A1](){wK(this)},[ah](){CK(this)}});const OK=fG(HP,{init(e){hG(Ua,e).forEach(t=>{ZG(t)})},getDatePickerContext:Ue,disable:VP,ariaDisable:zP,enable:QG,isDateInputInvalid:Jb,setCalendarValue:e2,validateDateInput:lh,renderCalendar:Or,updateCalendarIfVisible:BP});var RK=OK;const kK=Mn,TK=Mo,$K=Ka,{prefix:WP}=or,{getDatePickerContext:qP,isDateInputInvalid:GP,updateCalendarIfVisible:KP}=RK,PK=`${WP}-date-picker`,r2=`${WP}-date-range-picker`,YP=`${r2}__range-start`,QP=`${r2}__range-end`,km=`.${PK}`,Qs=`.${r2}`,XP=`.${YP}`,ZP=`.${QP}`,MK="0000-01-01",JP=e=>{const t=e.closest(Qs);if(!t)throw new Error(`Element is missing outer ${Qs}`);const n=t.querySelector(XP),r=t.querySelector(ZP);return{dateRangePickerEl:t,rangeStartEl:n,rangeEndEl:r}},e4=e=>{const{dateRangePickerEl:t,rangeStartEl:n,rangeEndEl:r}=JP(e),{internalInputEl:o}=qP(n),i=o.value;i&&!GP(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=""),KP(r)},t4=e=>{const{dateRangePickerEl:t,rangeStartEl:n,rangeEndEl:r}=JP(e),{internalInputEl:o}=qP(r),i=o.value;i&&!GP(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=""),KP(n)},jK=e=>{const t=e.closest(Qs),[n,r]=TK(km,t);if(!n)throw new Error(`${Qs} is missing inner two '${km}' elements`);if(!r)throw new Error(`${Qs} is missing second '${km}' element`);n.classList.add(YP),r.classList.add(QP),t.dataset.minDate||(t.dataset.minDate=MK);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),e4(t),t4(t)};kK({"input change":{[XP](){e4(this)},[ZP](){t4(this)}}},{init(e){$K(Qs,e).forEach(t=>{jK(t)})}});const l6=Ka,NK=Mn,uh=ng,{prefix:bn}=or,Fc=`${bn}-file-input`,Uc=`.${Fc}`,n4=`${bn}-file-input__input`,o2=`${bn}-file-input__target`,r4=`.${n4}`,LK=`${bn}-file-input__box`,o4=`${bn}-file-input__instructions`,i4=`${bn}-file-input__preview`,a4=`${bn}-file-input__preview-heading`,lg=`${bn}-file-input--disabled`,IK=`${bn}-file-input__choose`,s4=`${bn}-file-input__accepted-files-message`,u6=`${bn}-file-input__drag-text`,Tm=`${bn}-file-input--drag`,c6="is-loading",k1="has-invalid-file",Jl=`${bn}-file-input__preview-image`,DK=`${Jl}--generic`,FK=`${Jl}--pdf`,UK=`${Jl}--word`,VK=`${Jl}--video`,zK=`${Jl}--excel`,l4=`${bn}-sr-only`,as="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";let T1=!0,$1="",P1="";const $d=e=>{const t=e.closest(Uc);if(!t)throw new Error(`Element is missing outer ${Uc}`);const n=t.querySelector(r4);return{dropZoneEl:t,inputEl:n}},BK=e=>{const{dropZoneEl:t,inputEl:n}=$d(e);n.disabled=!0,t.classList.add(lg)},HK=e=>{const{dropZoneEl:t}=$d(e);t.classList.add(lg)},WK=e=>{const{dropZoneEl:t,inputEl:n}=$d(e);n.disabled=!1,t.classList.remove(lg),t.removeAttribute("aria-disabled")},qK=e=>{const t=e.charCodeAt(0);return t===32?"-":t>=65&&t<=90?`img_${e.toLowerCase()}`:`__${t.toString(16).slice(-4)}`},GK=e=>e.replace(/[^a-z0-9]/g,qK),KK=e=>`${e}-${Math.floor(Date.now().toString()/1e3)}`,u4=e=>e.hasAttribute("multiple")?"files":"file",YK=e=>{const t=document.createElement("div"),n=document.createElement("div"),r=document.createElement("div");return e.classList.remove(Fc),e.classList.add(n4),t.classList.add(Fc),r.classList.add(LK),n.classList.add(o2),n.prepend(r),e.parentNode.insertBefore(n,e),e.parentNode.insertBefore(t,n),n.appendChild(e),t.appendChild(n),n},QK=e=>{const t=e.closest(Uc),n=u4(e),r=document.createElement("div"),o=`Drag ${n} here or`,i="choose from folder";return $1=`${o} ${i}`,r.classList.add(o4),r.setAttribute("aria-hidden","true"),e.setAttribute("aria-label",$1),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(`.${u6}`).outerHTML=""),r},XK=e=>{const t=document.createElement("div"),n=u4(e),r=e.closest(Uc),o=e.closest(`.${o2}`);P1=`No ${n} selected.`,t.classList.add(l4),t.setAttribute("aria-live","polite"),t.textContent=P1,r.insertBefore(t,o)},ZK=e=>{const t=e.hasAttribute("aria-disabled")||e.hasAttribute("disabled"),n=YK(e),r=QK(e),{dropZoneEl:o}=$d(e);return t?o.classList.add(lg):XK(e),{instructions:r,dropTarget:n}},c4=(e,t)=>{const n=e.querySelectorAll(`.${i4}`),r=e.querySelector(`.${a4}`),o=e.querySelector(`.${s4}`),i=a=>{a.parentNode.removeChild(a)};r&&(r.outerHTML=""),o&&(o.outerHTML="",e.classList.remove(k1)),n!==null&&(t&&t.removeAttribute("hidden"),Array.prototype.forEach.call(n,i))},JK=(e,t,n)=>{const r=e;let o=P1;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)},eY=(e,t)=>{const n=document.createElement("div"),r=e.closest(`.${o2}`),o=r.querySelector(`.${o4}`);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(a4),n.innerHTML=a,r.insertBefore(n,o),e.setAttribute("aria-label",i)},tY=(e,t,n,r)=>{const o=e.target.files,a=r.closest(`.${Fc}`).querySelector(`.${l4}`),s=[];c4(r,n);for(let l=0;l