From d221f92aaae5f01952b0ca1093ccbc920f4a03d0 Mon Sep 17 00:00:00 2001 From: mlisnic Date: Thu, 22 Feb 2024 23:17:00 +0000 Subject: [PATCH] deploy: 7297686a2989abf0edaf86335463d1f0c21d9584 --- .../{index-RrvzXTvy.js => index-viCONUPQ.js} | 316 +++++++++--------- index.html | 2 +- 2 files changed, 159 insertions(+), 159 deletions(-) rename assets/{index-RrvzXTvy.js => index-viCONUPQ.js} (88%) diff --git a/assets/index-RrvzXTvy.js b/assets/index-viCONUPQ.js similarity index 88% rename from assets/index-RrvzXTvy.js rename to assets/index-viCONUPQ.js index 080321d15..1854eb440 100644 --- a/assets/index-RrvzXTvy.js +++ b/assets/index-viCONUPQ.js @@ -1,4 +1,4 @@ -var Rue=Object.defineProperty;var Nue=(e,t,n)=>t in e?Rue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Gs=(e,t,n)=>(Nue(e,typeof t!="symbol"?t+"":t,n),n);function kue(e,t){for(var n=0;nr[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var io=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ka(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Due(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var z7={exports:{}},dS={},H7={exports:{}},Xt={};/** +var Pue=Object.defineProperty;var Rue=(e,t,n)=>t in e?Pue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Gs=(e,t,n)=>(Rue(e,typeof t!="symbol"?t+"":t,n),n);function Nue(e,t){for(var n=0;nr[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var io=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ka(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function kue(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var z7={exports:{}},dS={},H7={exports:{}},Xt={};/** * @license React * react.production.min.js * @@ -6,7 +6,7 @@ var Rue=Object.defineProperty;var Nue=(e,t,n)=>t in e?Rue(e,t,{enumerable:!0,con * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var m_=Symbol.for("react.element"),$ue=Symbol.for("react.portal"),Lue=Symbol.for("react.fragment"),Mue=Symbol.for("react.strict_mode"),Fue=Symbol.for("react.profiler"),Bue=Symbol.for("react.provider"),jue=Symbol.for("react.context"),Uue=Symbol.for("react.forward_ref"),Vue=Symbol.for("react.suspense"),zue=Symbol.for("react.memo"),Hue=Symbol.for("react.lazy"),mL=Symbol.iterator;function Wue(e){return e===null||typeof e!="object"?null:(e=mL&&e[mL]||e["@@iterator"],typeof e=="function"?e:null)}var W7={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},q7=Object.assign,Y7={};function Am(e,t,n){this.props=e,this.context=t,this.refs=Y7,this.updater=n||W7}Am.prototype.isReactComponent={};Am.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")};Am.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function G7(){}G7.prototype=Am.prototype;function ZR(e,t,n){this.props=e,this.context=t,this.refs=Y7,this.updater=n||W7}var eN=ZR.prototype=new G7;eN.constructor=ZR;q7(eN,Am.prototype);eN.isPureReactComponent=!0;var gL=Array.isArray,K7=Object.prototype.hasOwnProperty,tN={current:null},Q7={key:!0,ref:!0,__self:!0,__source:!0};function X7(e,t,n){var r,i={},s=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(s=""+t.key),t)K7.call(t,r)&&!Q7.hasOwnProperty(r)&&(i[r]=t[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1t in e?Rue(e,t,{enumerable:!0,con * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Que=w,Xue=Symbol.for("react.element"),Jue=Symbol.for("react.fragment"),Zue=Object.prototype.hasOwnProperty,ele=Que.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,tle={key:!0,ref:!0,__self:!0,__source:!0};function J7(e,t,n){var r,i={},s=null,o=null;n!==void 0&&(s=""+n),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)Zue.call(t,r)&&!tle.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:Xue,type:e,key:s,ref:o,props:i,_owner:ele.current}}dS.Fragment=Jue;dS.jsx=J7;dS.jsxs=J7;z7.exports=dS;var $=z7.exports,PO={},Z7={exports:{}},bo={},ez={exports:{}},tz={};/** + */var Kue=w,Que=Symbol.for("react.element"),Xue=Symbol.for("react.fragment"),Jue=Object.prototype.hasOwnProperty,Zue=Kue.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,ele={key:!0,ref:!0,__self:!0,__source:!0};function J7(e,t,n){var r,i={},s=null,o=null;n!==void 0&&(s=""+n),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)Jue.call(t,r)&&!ele.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:Que,type:e,key:s,ref:o,props:i,_owner:Zue.current}}dS.Fragment=Xue;dS.jsx=J7;dS.jsxs=J7;z7.exports=dS;var $=z7.exports,PO={},Z7={exports:{}},bo={},ez={exports:{}},tz={};/** * @license React * scheduler.production.min.js * @@ -22,7 +22,7 @@ var Rue=Object.defineProperty;var Nue=(e,t,n)=>t in e?Rue(e,t,{enumerable:!0,con * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */(function(e){function t(te,se){var K=te.length;te.push(se);e:for(;0>>1,C=te[x];if(0>>1;xi(O,K))qi(le,O)?(te[x]=le,te[q]=K,x=q):(te[x]=O,te[R]=K,x=R);else if(qi(le,K))te[x]=le,te[q]=K,x=q;else break e}}return se}function i(te,se){var K=te.sortIndex-se.sortIndex;return K!==0?K:te.id-se.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();e.unstable_now=function(){return o.now()-a}}var u=[],l=[],c=1,f=null,d=3,h=!1,p=!1,m=!1,y=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function b(te){for(var se=n(l);se!==null;){if(se.callback===null)r(l);else if(se.startTime<=te)r(l),se.sortIndex=se.expirationTime,t(u,se);else break;se=n(l)}}function T(te){if(m=!1,b(te),!p)if(n(u)!==null)p=!0,he(I);else{var se=n(l);se!==null&&ve(T,se.startTime-te)}}function I(te,se){p=!1,m&&(m=!1,g(A),A=-1),h=!0;var K=d;try{for(b(se),f=n(u);f!==null&&(!(f.expirationTime>se)||te&&!M());){var x=f.callback;if(typeof x=="function"){f.callback=null,d=f.priorityLevel;var C=x(f.expirationTime<=se);se=e.unstable_now(),typeof C=="function"?f.callback=C:f===n(u)&&r(u),b(se)}else r(u);f=n(u)}if(f!==null)var z=!0;else{var R=n(l);R!==null&&ve(T,R.startTime-se),z=!1}return z}finally{f=null,d=K,h=!1}}var E=!1,S=null,A=-1,P=5,V=-1;function M(){return!(e.unstable_now()-Vte||125x?(te.sortIndex=K,t(l,te),n(u)===null&&te===n(l)&&(m?(g(A),A=-1):m=!0,ve(T,K-x))):(te.sortIndex=C,t(u,te),p||h||(p=!0,he(I))),te},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(te){var se=d;return function(){var K=d;d=se;try{return te.apply(this,arguments)}finally{d=K}}}})(tz);ez.exports=tz;var nle=ez.exports;/** + */(function(e){function t(te,se){var K=te.length;te.push(se);e:for(;0>>1,C=te[x];if(0>>1;xi(O,K))qi(le,O)?(te[x]=le,te[q]=K,x=q):(te[x]=O,te[R]=K,x=R);else if(qi(le,K))te[x]=le,te[q]=K,x=q;else break e}}return se}function i(te,se){var K=te.sortIndex-se.sortIndex;return K!==0?K:te.id-se.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();e.unstable_now=function(){return o.now()-a}}var u=[],l=[],c=1,f=null,d=3,h=!1,p=!1,m=!1,y=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function b(te){for(var se=n(l);se!==null;){if(se.callback===null)r(l);else if(se.startTime<=te)r(l),se.sortIndex=se.expirationTime,t(u,se);else break;se=n(l)}}function T(te){if(m=!1,b(te),!p)if(n(u)!==null)p=!0,he(I);else{var se=n(l);se!==null&&ve(T,se.startTime-te)}}function I(te,se){p=!1,m&&(m=!1,g(A),A=-1),h=!0;var K=d;try{for(b(se),f=n(u);f!==null&&(!(f.expirationTime>se)||te&&!M());){var x=f.callback;if(typeof x=="function"){f.callback=null,d=f.priorityLevel;var C=x(f.expirationTime<=se);se=e.unstable_now(),typeof C=="function"?f.callback=C:f===n(u)&&r(u),b(se)}else r(u);f=n(u)}if(f!==null)var z=!0;else{var R=n(l);R!==null&&ve(T,R.startTime-se),z=!1}return z}finally{f=null,d=K,h=!1}}var E=!1,S=null,A=-1,P=5,V=-1;function M(){return!(e.unstable_now()-Vte||125x?(te.sortIndex=K,t(l,te),n(u)===null&&te===n(l)&&(m?(g(A),A=-1):m=!0,ve(T,K-x))):(te.sortIndex=C,t(u,te),p||h||(p=!0,he(I))),te},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(te){var se=d;return function(){var K=d;d=se;try{return te.apply(this,arguments)}finally{d=K}}}})(tz);ez.exports=tz;var tle=ez.exports;/** * @license React * react-dom.production.min.js * @@ -30,14 +30,14 @@ var Rue=Object.defineProperty;var Nue=(e,t,n)=>t in e?Rue(e,t,{enumerable:!0,con * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var nz=w,po=nle;function Re(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"),RO=Object.prototype.hasOwnProperty,rle=/^[: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]*$/,_L={},vL={};function ile(e){return RO.call(vL,e)?!0:RO.call(_L,e)?!1:rle.test(e)?vL[e]=!0:(_L[e]=!0,!1)}function sle(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 ole(e,t,n,r){if(t===null||typeof t>"u"||sle(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 hs(e,t,n,r,i,s,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=o}var $i={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){$i[e]=new hs(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];$i[t]=new hs(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){$i[e]=new hs(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){$i[e]=new hs(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){$i[e]=new hs(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){$i[e]=new hs(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){$i[e]=new hs(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){$i[e]=new hs(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){$i[e]=new hs(e,5,!1,e.toLowerCase(),null,!1,!1)});var rN=/[\-:]([a-z])/g;function iN(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(rN,iN);$i[t]=new hs(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(rN,iN);$i[t]=new hs(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(rN,iN);$i[t]=new hs(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){$i[e]=new hs(e,1,!1,e.toLowerCase(),null,!1,!1)});$i.xlinkHref=new hs("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){$i[e]=new hs(e,1,!1,e.toLowerCase(),null,!0,!0)});function sN(e,t,n,r){var i=$i.hasOwnProperty(t)?$i[t]:null;(i!==null?i.type!==0:r||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),RO=Object.prototype.hasOwnProperty,nle=/^[: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]*$/,_L={},vL={};function rle(e){return RO.call(vL,e)?!0:RO.call(_L,e)?!1:nle.test(e)?vL[e]=!0:(_L[e]=!0,!1)}function ile(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 sle(e,t,n,r){if(t===null||typeof t>"u"||ile(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 hs(e,t,n,r,i,s,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=o}var $i={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){$i[e]=new hs(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];$i[t]=new hs(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){$i[e]=new hs(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){$i[e]=new hs(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){$i[e]=new hs(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){$i[e]=new hs(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){$i[e]=new hs(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){$i[e]=new hs(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){$i[e]=new hs(e,5,!1,e.toLowerCase(),null,!1,!1)});var rN=/[\-:]([a-z])/g;function iN(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(rN,iN);$i[t]=new hs(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(rN,iN);$i[t]=new hs(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(rN,iN);$i[t]=new hs(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){$i[e]=new hs(e,1,!1,e.toLowerCase(),null,!1,!1)});$i.xlinkHref=new hs("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){$i[e]=new hs(e,1,!1,e.toLowerCase(),null,!0,!0)});function sN(e,t,n,r){var i=$i.hasOwnProperty(t)?$i[t]:null;(i!==null?i.type!==0:r||!(2a||i[o]!==s[a]){var u=` -`+i[o].replace(" at new "," at ");return e.displayName&&u.includes("")&&(u=u.replace("",e.displayName)),u}while(1<=o&&0<=a);break}}}finally{Jx=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Jg(e):""}function ale(e){switch(e.tag){case 5:return Jg(e.type);case 16:return Jg("Lazy");case 13:return Jg("Suspense");case 19:return Jg("SuspenseList");case 0:case 2:case 15:return e=Zx(e.type,!1),e;case 11:return e=Zx(e.type.render,!1),e;case 1:return e=Zx(e.type,!0),e;default:return""}}function $O(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 Bh:return"Fragment";case Fh:return"Portal";case NO:return"Profiler";case oN:return"StrictMode";case kO:return"Suspense";case DO:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case sz:return(e.displayName||"Context")+".Consumer";case iz:return(e._context.displayName||"Context")+".Provider";case aN:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case uN:return t=e.displayName||null,t!==null?t:$O(e.type)||"Memo";case ac:t=e._payload,e=e._init;try{return $O(e(t))}catch{}}return null}function ule(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 $O(t);case 8:return t===oN?"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 Kc(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function az(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function lle(e){var t=az(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Tv(e){e._valueTracker||(e._valueTracker=lle(e))}function uz(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=az(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Pb(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function LO(e,t){var n=t.checked;return yr({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function EL(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Kc(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 lz(e,t){t=t.checked,t!=null&&sN(e,"checked",t,!1)}function MO(e,t){lz(e,t);var n=Kc(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")?FO(e,t.type,n):t.hasOwnProperty("defaultValue")&&FO(e,t.type,Kc(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function wL(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 FO(e,t,n){(t!=="number"||Pb(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Zg=Array.isArray;function lp(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Sv.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ry(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var _0={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},cle=["Webkit","ms","Moz","O"];Object.keys(_0).forEach(function(e){cle.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),_0[t]=_0[e]})});function hz(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||_0.hasOwnProperty(e)&&_0[e]?(""+t).trim():t+"px"}function pz(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=hz(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var fle=yr({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 UO(e,t){if(t){if(fle[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Re(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Re(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Re(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Re(62))}}function VO(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 zO=null;function lN(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var HO=null,cp=null,fp=null;function IL(e){if(e=__(e)){if(typeof HO!="function")throw Error(Re(280));var t=e.stateNode;t&&(t=yS(t),HO(e.stateNode,e.type,t))}}function mz(e){cp?fp?fp.push(e):fp=[e]:cp=e}function gz(){if(cp){var e=cp,t=fp;if(fp=cp=null,IL(e),t)for(e=0;e>>=0,e===0?32:31-(wle(e)/Tle|0)|0}var Iv=64,xv=4194304;function e0(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 Db(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,s=e.pingedLanes,o=n&268435455;if(o!==0){var a=o&~i;a!==0?r=e0(a):(s&=o,s!==0&&(r=e0(s)))}else o=n&~i,o!==0?r=e0(o):s!==0&&(r=e0(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,s=t&-t,i>=s||i===16&&(s&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 g_(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ta(t),e[t]=n}function Cle(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=b0),DL=" ",$L=!1;function Lz(e,t){switch(e){case"keyup":return tce.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Mz(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var jh=!1;function rce(e,t){switch(e){case"compositionend":return Mz(t);case"keypress":return t.which!==32?null:($L=!0,DL);case"textInput":return e=t.data,e===DL&&$L?null:e;default:return null}}function ice(e,t){if(jh)return e==="compositionend"||!yN&&Lz(e,t)?(e=Dz(),V1=pN=wc=null,jh=!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=BL(n)}}function Uz(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Uz(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Vz(){for(var e=window,t=Pb();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Pb(e.document)}return t}function _N(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 hce(e){var t=Vz(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Uz(n.ownerDocument.documentElement,n)){if(r!==null&&_N(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!e.extend&&s>r&&(i=r,r=s,s=i),i=jL(n,s);var o=jL(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.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,Uh=null,QO=null,w0=null,XO=!1;function UL(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;XO||Uh==null||Uh!==Pb(r)||(r=Uh,"selectionStart"in r&&_N(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}),w0&&ly(w0,r)||(w0=r,r=Mb(QO,"onSelect"),0Hh||(e.current=rP[Hh],rP[Hh]=null,Hh--)}function qn(e,t){Hh++,rP[Hh]=e.current,e.current=t}var Qc={},Qi=yf(Qc),Ls=yf(!1),xd=Qc;function Up(e,t){var n=e.type.contextTypes;if(!n)return Qc;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Ms(e){return e=e.childContextTypes,e!=null}function Bb(){Zn(Ls),Zn(Qi)}function GL(e,t,n){if(Qi.current!==Qc)throw Error(Re(168));qn(Qi,t),qn(Ls,n)}function Xz(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(Re(108,ule(e)||"Unknown",i));return yr({},n,r)}function jb(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Qc,xd=Qi.current,qn(Qi,e),qn(Ls,Ls.current),!0}function KL(e,t,n){var r=e.stateNode;if(!r)throw Error(Re(169));n?(e=Xz(e,t,xd),r.__reactInternalMemoizedMergedChildContext=e,Zn(Ls),Zn(Qi),qn(Qi,e)):Zn(Ls),qn(Ls,n)}var Ku=null,_S=!1,hC=!1;function Jz(e){Ku===null?Ku=[e]:Ku.push(e)}function Ice(e){_S=!0,Jz(e)}function _f(){if(!hC&&Ku!==null){hC=!0;var e=0,t=Rn;try{var n=Ku;for(Rn=1;e>=o,i-=o,nl=1<<32-Ta(t)+i|n<A?(P=S,S=null):P=S.sibling;var V=d(g,S,b[A],T);if(V===null){S===null&&(S=P);break}e&&S&&V.alternate===null&&t(g,S),_=s(V,_,A),E===null?I=V:E.sibling=V,E=V,S=P}if(A===b.length)return n(g,S),ar&&Df(g,A),I;if(S===null){for(;AA?(P=S,S=null):P=S.sibling;var M=d(g,S,V.value,T);if(M===null){S===null&&(S=P);break}e&&S&&M.alternate===null&&t(g,S),_=s(M,_,A),E===null?I=M:E.sibling=M,E=M,S=P}if(V.done)return n(g,S),ar&&Df(g,A),I;if(S===null){for(;!V.done;A++,V=b.next())V=f(g,V.value,T),V!==null&&(_=s(V,_,A),E===null?I=V:E.sibling=V,E=V);return ar&&Df(g,A),I}for(S=r(g,S);!V.done;A++,V=b.next())V=h(S,g,A,V.value,T),V!==null&&(e&&V.alternate!==null&&S.delete(V.key===null?A:V.key),_=s(V,_,A),E===null?I=V:E.sibling=V,E=V);return e&&S.forEach(function(H){return t(g,H)}),ar&&Df(g,A),I}function y(g,_,b,T){if(typeof b=="object"&&b!==null&&b.type===Bh&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case wv:e:{for(var I=b.key,E=_;E!==null;){if(E.key===I){if(I=b.type,I===Bh){if(E.tag===7){n(g,E.sibling),_=i(E,b.props.children),_.return=g,g=_;break e}}else if(E.elementType===I||typeof I=="object"&&I!==null&&I.$$typeof===ac&&nM(I)===E.type){n(g,E.sibling),_=i(E,b.props),_.ref=wg(g,E,b),_.return=g,g=_;break e}n(g,E);break}else t(g,E);E=E.sibling}b.type===Bh?(_=md(b.props.children,g.mode,T,b.key),_.return=g,g=_):(T=Q1(b.type,b.key,b.props,null,g.mode,T),T.ref=wg(g,_,b),T.return=g,g=T)}return o(g);case Fh:e:{for(E=b.key;_!==null;){if(_.key===E)if(_.tag===4&&_.stateNode.containerInfo===b.containerInfo&&_.stateNode.implementation===b.implementation){n(g,_.sibling),_=i(_,b.children||[]),_.return=g,g=_;break e}else{n(g,_);break}else t(g,_);_=_.sibling}_=EC(b,g.mode,T),_.return=g,g=_}return o(g);case ac:return E=b._init,y(g,_,E(b._payload),T)}if(Zg(b))return p(g,_,b,T);if(yg(b))return m(g,_,b,T);kv(g,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,_!==null&&_.tag===6?(n(g,_.sibling),_=i(_,b),_.return=g,g=_):(n(g,_),_=bC(b,g.mode,T),_.return=g,g=_),o(g)):n(g,_)}return y}var zp=oH(!0),aH=oH(!1),v_={},mu=yf(v_),hy=yf(v_),py=yf(v_);function Jf(e){if(e===v_)throw Error(Re(174));return e}function CN(e,t){switch(qn(py,t),qn(hy,e),qn(mu,v_),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:jO(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=jO(t,e)}Zn(mu),qn(mu,t)}function Hp(){Zn(mu),Zn(hy),Zn(py)}function uH(e){Jf(py.current);var t=Jf(mu.current),n=jO(t,e.type);t!==n&&(qn(hy,e),qn(mu,n))}function AN(e){hy.current===e&&(Zn(mu),Zn(hy))}var mr=yf(0);function qb(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 pC=[];function ON(){for(var e=0;en?n:4,e(!0);var r=mC.transition;mC.transition={};try{e(!1),t()}finally{Rn=n,mC.transition=r}}function SH(){return qo().memoizedState}function Oce(e,t,n){var r=Dc(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},IH(e))xH(t,n);else if(n=nH(e,t,n,r),n!==null){var i=ls();Sa(n,e,r,i),CH(n,t,r)}}function Pce(e,t,n){var r=Dc(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(IH(e))xH(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,a=s(o,n);if(i.hasEagerState=!0,i.eagerState=a,Aa(a,o)){var u=t.interleaved;u===null?(i.next=i,IN(t)):(i.next=u.next,u.next=i),t.interleaved=i;return}}catch{}finally{}n=nH(e,t,i,r),n!==null&&(i=ls(),Sa(n,e,r,i),CH(n,t,r))}}function IH(e){var t=e.alternate;return e===gr||t!==null&&t===gr}function xH(e,t){T0=Yb=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function CH(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,fN(e,n)}}var Gb={readContext:Wo,useCallback:Fi,useContext:Fi,useEffect:Fi,useImperativeHandle:Fi,useInsertionEffect:Fi,useLayoutEffect:Fi,useMemo:Fi,useReducer:Fi,useRef:Fi,useState:Fi,useDebugValue:Fi,useDeferredValue:Fi,useTransition:Fi,useMutableSource:Fi,useSyncExternalStore:Fi,useId:Fi,unstable_isNewReconciler:!1},Rce={readContext:Wo,useCallback:function(e,t){return Va().memoizedState=[e,t===void 0?null:t],e},useContext:Wo,useEffect:iM,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,q1(4194308,4,vH.bind(null,t,e),n)},useLayoutEffect:function(e,t){return q1(4194308,4,e,t)},useInsertionEffect:function(e,t){return q1(4,2,e,t)},useMemo:function(e,t){var n=Va();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Va();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=Oce.bind(null,gr,e),[r.memoizedState,e]},useRef:function(e){var t=Va();return e={current:e},t.memoizedState=e},useState:rM,useDebugValue:DN,useDeferredValue:function(e){return Va().memoizedState=e},useTransition:function(){var e=rM(!1),t=e[0];return e=Ace.bind(null,e[1]),Va().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=gr,i=Va();if(ar){if(n===void 0)throw Error(Re(407));n=n()}else{if(n=t(),di===null)throw Error(Re(349));Ad&30||fH(r,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,iM(hH.bind(null,r,s,e),[e]),r.flags|=2048,yy(9,dH.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=Va(),t=di.identifierPrefix;if(ar){var n=rl,r=nl;n=(r&~(1<<32-Ta(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=my++,0")&&(u=u.replace("",e.displayName)),u}while(1<=o&&0<=a);break}}}finally{Jx=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Jg(e):""}function ole(e){switch(e.tag){case 5:return Jg(e.type);case 16:return Jg("Lazy");case 13:return Jg("Suspense");case 19:return Jg("SuspenseList");case 0:case 2:case 15:return e=Zx(e.type,!1),e;case 11:return e=Zx(e.type.render,!1),e;case 1:return e=Zx(e.type,!0),e;default:return""}}function $O(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 Bh:return"Fragment";case Fh:return"Portal";case NO:return"Profiler";case oN:return"StrictMode";case kO:return"Suspense";case DO:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case sz:return(e.displayName||"Context")+".Consumer";case iz:return(e._context.displayName||"Context")+".Provider";case aN:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case uN:return t=e.displayName||null,t!==null?t:$O(e.type)||"Memo";case ac:t=e._payload,e=e._init;try{return $O(e(t))}catch{}}return null}function ale(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 $O(t);case 8:return t===oN?"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 Kc(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function az(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function ule(e){var t=az(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Tv(e){e._valueTracker||(e._valueTracker=ule(e))}function uz(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=az(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Pb(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function LO(e,t){var n=t.checked;return yr({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function EL(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Kc(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 lz(e,t){t=t.checked,t!=null&&sN(e,"checked",t,!1)}function MO(e,t){lz(e,t);var n=Kc(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")?FO(e,t.type,n):t.hasOwnProperty("defaultValue")&&FO(e,t.type,Kc(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function wL(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 FO(e,t,n){(t!=="number"||Pb(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Zg=Array.isArray;function lp(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Sv.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ry(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var _0={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},lle=["Webkit","ms","Moz","O"];Object.keys(_0).forEach(function(e){lle.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),_0[t]=_0[e]})});function hz(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||_0.hasOwnProperty(e)&&_0[e]?(""+t).trim():t+"px"}function pz(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=hz(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var cle=yr({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 UO(e,t){if(t){if(cle[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Re(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Re(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Re(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Re(62))}}function VO(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 zO=null;function lN(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var HO=null,cp=null,fp=null;function IL(e){if(e=__(e)){if(typeof HO!="function")throw Error(Re(280));var t=e.stateNode;t&&(t=yS(t),HO(e.stateNode,e.type,t))}}function mz(e){cp?fp?fp.push(e):fp=[e]:cp=e}function gz(){if(cp){var e=cp,t=fp;if(fp=cp=null,IL(e),t)for(e=0;e>>=0,e===0?32:31-(Ele(e)/wle|0)|0}var Iv=64,xv=4194304;function e0(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 Db(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,s=e.pingedLanes,o=n&268435455;if(o!==0){var a=o&~i;a!==0?r=e0(a):(s&=o,s!==0&&(r=e0(s)))}else o=n&~i,o!==0?r=e0(o):s!==0&&(r=e0(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,s=t&-t,i>=s||i===16&&(s&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 g_(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ta(t),e[t]=n}function xle(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=b0),DL=" ",$L=!1;function Lz(e,t){switch(e){case"keyup":return ece.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Mz(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var jh=!1;function nce(e,t){switch(e){case"compositionend":return Mz(t);case"keypress":return t.which!==32?null:($L=!0,DL);case"textInput":return e=t.data,e===DL&&$L?null:e;default:return null}}function rce(e,t){if(jh)return e==="compositionend"||!yN&&Lz(e,t)?(e=Dz(),V1=pN=wc=null,jh=!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=BL(n)}}function Uz(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Uz(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Vz(){for(var e=window,t=Pb();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Pb(e.document)}return t}function _N(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 dce(e){var t=Vz(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Uz(n.ownerDocument.documentElement,n)){if(r!==null&&_N(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!e.extend&&s>r&&(i=r,r=s,s=i),i=jL(n,s);var o=jL(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.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,Uh=null,QO=null,w0=null,XO=!1;function UL(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;XO||Uh==null||Uh!==Pb(r)||(r=Uh,"selectionStart"in r&&_N(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}),w0&&ly(w0,r)||(w0=r,r=Mb(QO,"onSelect"),0Hh||(e.current=rP[Hh],rP[Hh]=null,Hh--)}function qn(e,t){Hh++,rP[Hh]=e.current,e.current=t}var Qc={},Qi=yf(Qc),Ls=yf(!1),xd=Qc;function Up(e,t){var n=e.type.contextTypes;if(!n)return Qc;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Ms(e){return e=e.childContextTypes,e!=null}function Bb(){Zn(Ls),Zn(Qi)}function GL(e,t,n){if(Qi.current!==Qc)throw Error(Re(168));qn(Qi,t),qn(Ls,n)}function Xz(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(Re(108,ale(e)||"Unknown",i));return yr({},n,r)}function jb(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Qc,xd=Qi.current,qn(Qi,e),qn(Ls,Ls.current),!0}function KL(e,t,n){var r=e.stateNode;if(!r)throw Error(Re(169));n?(e=Xz(e,t,xd),r.__reactInternalMemoizedMergedChildContext=e,Zn(Ls),Zn(Qi),qn(Qi,e)):Zn(Ls),qn(Ls,n)}var Ku=null,_S=!1,hC=!1;function Jz(e){Ku===null?Ku=[e]:Ku.push(e)}function Sce(e){_S=!0,Jz(e)}function _f(){if(!hC&&Ku!==null){hC=!0;var e=0,t=Rn;try{var n=Ku;for(Rn=1;e>=o,i-=o,nl=1<<32-Ta(t)+i|n<A?(P=S,S=null):P=S.sibling;var V=d(g,S,b[A],T);if(V===null){S===null&&(S=P);break}e&&S&&V.alternate===null&&t(g,S),_=s(V,_,A),E===null?I=V:E.sibling=V,E=V,S=P}if(A===b.length)return n(g,S),ar&&Df(g,A),I;if(S===null){for(;AA?(P=S,S=null):P=S.sibling;var M=d(g,S,V.value,T);if(M===null){S===null&&(S=P);break}e&&S&&M.alternate===null&&t(g,S),_=s(M,_,A),E===null?I=M:E.sibling=M,E=M,S=P}if(V.done)return n(g,S),ar&&Df(g,A),I;if(S===null){for(;!V.done;A++,V=b.next())V=f(g,V.value,T),V!==null&&(_=s(V,_,A),E===null?I=V:E.sibling=V,E=V);return ar&&Df(g,A),I}for(S=r(g,S);!V.done;A++,V=b.next())V=h(S,g,A,V.value,T),V!==null&&(e&&V.alternate!==null&&S.delete(V.key===null?A:V.key),_=s(V,_,A),E===null?I=V:E.sibling=V,E=V);return e&&S.forEach(function(H){return t(g,H)}),ar&&Df(g,A),I}function y(g,_,b,T){if(typeof b=="object"&&b!==null&&b.type===Bh&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case wv:e:{for(var I=b.key,E=_;E!==null;){if(E.key===I){if(I=b.type,I===Bh){if(E.tag===7){n(g,E.sibling),_=i(E,b.props.children),_.return=g,g=_;break e}}else if(E.elementType===I||typeof I=="object"&&I!==null&&I.$$typeof===ac&&nM(I)===E.type){n(g,E.sibling),_=i(E,b.props),_.ref=wg(g,E,b),_.return=g,g=_;break e}n(g,E);break}else t(g,E);E=E.sibling}b.type===Bh?(_=md(b.props.children,g.mode,T,b.key),_.return=g,g=_):(T=Q1(b.type,b.key,b.props,null,g.mode,T),T.ref=wg(g,_,b),T.return=g,g=T)}return o(g);case Fh:e:{for(E=b.key;_!==null;){if(_.key===E)if(_.tag===4&&_.stateNode.containerInfo===b.containerInfo&&_.stateNode.implementation===b.implementation){n(g,_.sibling),_=i(_,b.children||[]),_.return=g,g=_;break e}else{n(g,_);break}else t(g,_);_=_.sibling}_=EC(b,g.mode,T),_.return=g,g=_}return o(g);case ac:return E=b._init,y(g,_,E(b._payload),T)}if(Zg(b))return p(g,_,b,T);if(yg(b))return m(g,_,b,T);kv(g,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,_!==null&&_.tag===6?(n(g,_.sibling),_=i(_,b),_.return=g,g=_):(n(g,_),_=bC(b,g.mode,T),_.return=g,g=_),o(g)):n(g,_)}return y}var zp=oH(!0),aH=oH(!1),v_={},mu=yf(v_),hy=yf(v_),py=yf(v_);function Jf(e){if(e===v_)throw Error(Re(174));return e}function CN(e,t){switch(qn(py,t),qn(hy,e),qn(mu,v_),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:jO(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=jO(t,e)}Zn(mu),qn(mu,t)}function Hp(){Zn(mu),Zn(hy),Zn(py)}function uH(e){Jf(py.current);var t=Jf(mu.current),n=jO(t,e.type);t!==n&&(qn(hy,e),qn(mu,n))}function AN(e){hy.current===e&&(Zn(mu),Zn(hy))}var mr=yf(0);function qb(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 pC=[];function ON(){for(var e=0;en?n:4,e(!0);var r=mC.transition;mC.transition={};try{e(!1),t()}finally{Rn=n,mC.transition=r}}function SH(){return qo().memoizedState}function Ace(e,t,n){var r=Dc(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},IH(e))xH(t,n);else if(n=nH(e,t,n,r),n!==null){var i=ls();Sa(n,e,r,i),CH(n,t,r)}}function Oce(e,t,n){var r=Dc(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(IH(e))xH(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,a=s(o,n);if(i.hasEagerState=!0,i.eagerState=a,Aa(a,o)){var u=t.interleaved;u===null?(i.next=i,IN(t)):(i.next=u.next,u.next=i),t.interleaved=i;return}}catch{}finally{}n=nH(e,t,i,r),n!==null&&(i=ls(),Sa(n,e,r,i),CH(n,t,r))}}function IH(e){var t=e.alternate;return e===gr||t!==null&&t===gr}function xH(e,t){T0=Yb=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function CH(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,fN(e,n)}}var Gb={readContext:Wo,useCallback:Fi,useContext:Fi,useEffect:Fi,useImperativeHandle:Fi,useInsertionEffect:Fi,useLayoutEffect:Fi,useMemo:Fi,useReducer:Fi,useRef:Fi,useState:Fi,useDebugValue:Fi,useDeferredValue:Fi,useTransition:Fi,useMutableSource:Fi,useSyncExternalStore:Fi,useId:Fi,unstable_isNewReconciler:!1},Pce={readContext:Wo,useCallback:function(e,t){return Va().memoizedState=[e,t===void 0?null:t],e},useContext:Wo,useEffect:iM,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,q1(4194308,4,vH.bind(null,t,e),n)},useLayoutEffect:function(e,t){return q1(4194308,4,e,t)},useInsertionEffect:function(e,t){return q1(4,2,e,t)},useMemo:function(e,t){var n=Va();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Va();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=Ace.bind(null,gr,e),[r.memoizedState,e]},useRef:function(e){var t=Va();return e={current:e},t.memoizedState=e},useState:rM,useDebugValue:DN,useDeferredValue:function(e){return Va().memoizedState=e},useTransition:function(){var e=rM(!1),t=e[0];return e=Cce.bind(null,e[1]),Va().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=gr,i=Va();if(ar){if(n===void 0)throw Error(Re(407));n=n()}else{if(n=t(),di===null)throw Error(Re(349));Ad&30||fH(r,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,iM(hH.bind(null,r,s,e),[e]),r.flags|=2048,yy(9,dH.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=Va(),t=di.identifierPrefix;if(ar){var n=rl,r=nl;n=(r&~(1<<32-Ta(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=my++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[Xa]=t,e[dy]=r,LH(e,t,!1,!1),t.stateNode=e;e:{switch(o=VO(n,r),n){case"dialog":Kn("cancel",e),Kn("close",e),i=r;break;case"iframe":case"object":case"embed":Kn("load",e),i=r;break;case"video":case"audio":for(i=0;iqp&&(t.flags|=128,r=!0,Tg(s,!1),t.lanes=4194304)}else{if(!r)if(e=qb(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Tg(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!ar)return Bi(t),null}else 2*kr()-s.renderingStartTime>qp&&n!==1073741824&&(t.flags|=128,r=!0,Tg(s,!1),t.lanes=4194304);s.isBackwards?(o.sibling=t.child,t.child=o):(n=s.last,n!==null?n.sibling=o:t.child=o,s.last=o)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=kr(),t.sibling=null,n=mr.current,qn(mr,r?n&1|2:n&1),t):(Bi(t),null);case 22:case 23:return jN(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Zs&1073741824&&(Bi(t),t.subtreeFlags&6&&(t.flags|=8192)):Bi(t),null;case 24:return null;case 25:return null}throw Error(Re(156,t.tag))}function Bce(e,t){switch(bN(t),t.tag){case 1:return Ms(t.type)&&Bb(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Hp(),Zn(Ls),Zn(Qi),ON(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return AN(t),null;case 13:if(Zn(mr),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Re(340));Vp()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Zn(mr),null;case 4:return Hp(),null;case 10:return SN(t.type._context),null;case 22:case 23:return jN(),null;case 24:return null;default:return null}}var $v=!1,Wi=!1,jce=typeof WeakSet=="function"?WeakSet:Set,ze=null;function Gh(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Tr(e,t,r)}else n.current=null}function mP(e,t,n){try{n()}catch(r){Tr(e,t,r)}}var hM=!1;function Uce(e,t){if(JO=$b,e=Vz(),_N(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,a=-1,u=-1,l=0,c=0,f=e,d=null;t:for(;;){for(var h;f!==n||i!==0&&f.nodeType!==3||(a=o+i),f!==s||r!==0&&f.nodeType!==3||(u=o+r),f.nodeType===3&&(o+=f.nodeValue.length),(h=f.firstChild)!==null;)d=f,f=h;for(;;){if(f===e)break t;if(d===n&&++l===i&&(a=o),d===s&&++c===r&&(u=o),(h=f.nextSibling)!==null)break;f=d,d=f.parentNode}f=h}n=a===-1||u===-1?null:{start:a,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(ZO={focusedElem:e,selectionRange:n},$b=!1,ze=t;ze!==null;)if(t=ze,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ze=e;else for(;ze!==null;){t=ze;try{var p=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(p!==null){var m=p.memoizedProps,y=p.memoizedState,g=t.stateNode,_=g.getSnapshotBeforeUpdate(t.elementType===t.type?m:da(t.type,m),y);g.__reactInternalSnapshotBeforeUpdate=_}break;case 3:var b=t.stateNode.containerInfo;b.nodeType===1?b.textContent="":b.nodeType===9&&b.documentElement&&b.removeChild(b.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Re(163))}}catch(T){Tr(t,t.return,T)}if(e=t.sibling,e!==null){e.return=t.return,ze=e;break}ze=t.return}return p=hM,hM=!1,p}function S0(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var s=i.destroy;i.destroy=void 0,s!==void 0&&mP(t,n,s)}i=i.next}while(i!==r)}}function ES(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 gP(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 BH(e){var t=e.alternate;t!==null&&(e.alternate=null,BH(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Xa],delete t[dy],delete t[nP],delete t[Tce],delete t[Sce])),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 jH(e){return e.tag===5||e.tag===3||e.tag===4}function pM(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||jH(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 yP(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=Fb));else if(r!==4&&(e=e.child,e!==null))for(yP(e,t,n),e=e.sibling;e!==null;)yP(e,t,n),e=e.sibling}function _P(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(_P(e,t,n),e=e.sibling;e!==null;)_P(e,t,n),e=e.sibling}var Ti=null,ha=!1;function Xl(e,t,n){for(n=n.child;n!==null;)UH(e,t,n),n=n.sibling}function UH(e,t,n){if(pu&&typeof pu.onCommitFiberUnmount=="function")try{pu.onCommitFiberUnmount(hS,n)}catch{}switch(n.tag){case 5:Wi||Gh(n,t);case 6:var r=Ti,i=ha;Ti=null,Xl(e,t,n),Ti=r,ha=i,Ti!==null&&(ha?(e=Ti,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ti.removeChild(n.stateNode));break;case 18:Ti!==null&&(ha?(e=Ti,n=n.stateNode,e.nodeType===8?dC(e.parentNode,n):e.nodeType===1&&dC(e,n),ay(e)):dC(Ti,n.stateNode));break;case 4:r=Ti,i=ha,Ti=n.stateNode.containerInfo,ha=!0,Xl(e,t,n),Ti=r,ha=i;break;case 0:case 11:case 14:case 15:if(!Wi&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&mP(n,t,o),i=i.next}while(i!==r)}Xl(e,t,n);break;case 1:if(!Wi&&(Gh(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Tr(n,t,a)}Xl(e,t,n);break;case 21:Xl(e,t,n);break;case 22:n.mode&1?(Wi=(r=Wi)||n.memoizedState!==null,Xl(e,t,n),Wi=r):Xl(e,t,n);break;default:Xl(e,t,n)}}function mM(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new jce),t.forEach(function(r){var i=Qce.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function oa(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=o),r&=~s}if(r=i,r=kr()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*zce(r/1960))-r,10e?16:e,Tc===null)var r=!1;else{if(e=Tc,Tc=null,Xb=0,hn&6)throw Error(Re(331));var i=hn;for(hn|=4,ze=e.current;ze!==null;){var s=ze,o=s.child;if(ze.flags&16){var a=s.deletions;if(a!==null){for(var u=0;ukr()-FN?pd(e,0):MN|=n),Fs(e,t)}function KH(e,t){t===0&&(e.mode&1?(t=xv,xv<<=1,!(xv&130023424)&&(xv=4194304)):t=1);var n=ls();e=wl(e,t),e!==null&&(g_(e,t,n),Fs(e,n))}function Kce(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),KH(e,n)}function Qce(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(Re(314))}r!==null&&r.delete(t),KH(e,n)}var QH;QH=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ls.current)Ns=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Ns=!1,Mce(e,t,n);Ns=!!(e.flags&131072)}else Ns=!1,ar&&t.flags&1048576&&Zz(t,Vb,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Y1(e,t),e=t.pendingProps;var i=Up(t,Qi.current);hp(t,n),i=RN(null,t,r,e,i,n);var s=NN();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ms(r)?(s=!0,jb(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,xN(t),i.updater=vS,t.stateNode=i,i._reactInternals=t,uP(t,r,e,n),t=fP(null,t,r,!0,s,n)):(t.tag=0,ar&&s&&vN(t),os(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Y1(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=Jce(r),e=da(r,e),i){case 0:t=cP(null,t,r,e,n);break e;case 1:t=cM(null,t,r,e,n);break e;case 11:t=uM(null,t,r,e,n);break e;case 14:t=lM(null,t,r,da(r.type,e),n);break e}throw Error(Re(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:da(r,i),cP(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:da(r,i),cM(e,t,r,i,n);case 3:e:{if(kH(t),e===null)throw Error(Re(387));r=t.pendingProps,s=t.memoizedState,i=s.element,rH(e,t),Wb(t,r,null,n);var o=t.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){i=Wp(Error(Re(423)),t),t=fM(e,t,r,n,i);break e}else if(r!==i){i=Wp(Error(Re(424)),t),t=fM(e,t,r,n,i);break e}else for(so=Rc(t.stateNode.containerInfo.firstChild),lo=t,ar=!0,ma=null,n=aH(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Vp(),r===i){t=Tl(e,t,n);break e}os(e,t,r,n)}t=t.child}return t;case 5:return uH(t),e===null&&sP(t),r=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,o=i.children,eP(r,i)?o=null:s!==null&&eP(r,s)&&(t.flags|=32),NH(e,t),os(e,t,o,n),t.child;case 6:return e===null&&sP(t),null;case 13:return DH(e,t,n);case 4:return CN(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=zp(t,null,r,n):os(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:da(r,i),uM(e,t,r,i,n);case 7:return os(e,t,t.pendingProps,n),t.child;case 8:return os(e,t,t.pendingProps.children,n),t.child;case 12:return os(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,s=t.memoizedProps,o=i.value,qn(zb,r._currentValue),r._currentValue=o,s!==null)if(Aa(s.value,o)){if(s.children===i.children&&!Ls.current){t=Tl(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var u=a.firstContext;u!==null;){if(u.context===r){if(s.tag===1){u=fl(-1,n&-n),u.tag=2;var l=s.updateQueue;if(l!==null){l=l.shared;var c=l.pending;c===null?u.next=u:(u.next=c.next,c.next=u),l.pending=u}}s.lanes|=n,u=s.alternate,u!==null&&(u.lanes|=n),oP(s.return,n,t),a.lanes|=n;break}u=u.next}}else if(s.tag===10)o=s.type===t.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(Re(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),oP(o,n,t),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===t){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}os(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,hp(t,n),i=Wo(i),r=r(i),t.flags|=1,os(e,t,r,n),t.child;case 14:return r=t.type,i=da(r,t.pendingProps),i=da(r.type,i),lM(e,t,r,i,n);case 15:return PH(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:da(r,i),Y1(e,t),t.tag=1,Ms(r)?(e=!0,jb(t)):e=!1,hp(t,n),sH(t,r,i),uP(t,r,i,n),fP(null,t,r,!0,e,n);case 19:return $H(e,t,n);case 22:return RH(e,t,n)}throw Error(Re(156,t.tag))};function XH(e,t){return Tz(e,t)}function Xce(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 jo(e,t,n,r){return new Xce(e,t,n,r)}function VN(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Jce(e){if(typeof e=="function")return VN(e)?1:0;if(e!=null){if(e=e.$$typeof,e===aN)return 11;if(e===uN)return 14}return 2}function $c(e,t){var n=e.alternate;return n===null?(n=jo(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 Q1(e,t,n,r,i,s){var o=2;if(r=e,typeof e=="function")VN(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Bh:return md(n.children,i,s,t);case oN:o=8,i|=8;break;case NO:return e=jo(12,n,t,i|2),e.elementType=NO,e.lanes=s,e;case kO:return e=jo(13,n,t,i),e.elementType=kO,e.lanes=s,e;case DO:return e=jo(19,n,t,i),e.elementType=DO,e.lanes=s,e;case oz:return TS(n,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case iz:o=10;break e;case sz:o=9;break e;case aN:o=11;break e;case uN:o=14;break e;case ac:o=16,r=null;break e}throw Error(Re(130,e==null?e:typeof e,""))}return t=jo(o,n,t,i),t.elementType=e,t.type=r,t.lanes=s,t}function md(e,t,n,r){return e=jo(7,e,r,t),e.lanes=n,e}function TS(e,t,n,r){return e=jo(22,e,r,t),e.elementType=oz,e.lanes=n,e.stateNode={isHidden:!1},e}function bC(e,t,n){return e=jo(6,e,null,t),e.lanes=n,e}function EC(e,t,n){return t=jo(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Zce(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=tC(0),this.expirationTimes=tC(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=tC(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function zN(e,t,n,r,i,s,o,a,u){return e=new Zce(e,t,n,a,u),t===1?(t=1,s===!0&&(t|=8)):t=0,s=jo(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},xN(s),e}function efe(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(tW)}catch(e){console.error(e)}}tW(),Z7.exports=bo;var b_=Z7.exports,TM=b_;PO.createRoot=TM.createRoot,PO.hydrateRoot=TM.hydrateRoot;const nW=w.createContext({storageEngine:void 0,setStorageEngine:()=>{}}),vf=()=>w.useContext(nW);function sfe({children:e}){const[t,n]=k.useState(void 0),r=k.useMemo(()=>({storageEngine:t,setStorageEngine:n}),[t]);return $.jsx(nW.Provider,{value:r,children:e})}/** +`+s.stack}return{value:e,source:t,stack:i,digest:null}}function _C(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function lP(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var kce=typeof WeakMap=="function"?WeakMap:Map;function AH(e,t,n){n=fl(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Qb||(Qb=!0,vP=r),lP(e,t)},n}function OH(e,t,n){n=fl(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){lP(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){lP(e,t),typeof r!="function"&&(kc===null?kc=new Set([this]):kc.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function sM(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new kce;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=Yce.bind(null,e,t,n),t.then(e,e))}function oM(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function aM(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=fl(-1,1),t.tag=2,Nc(n,t,1))),n.lanes|=1),e)}var Dce=Ul.ReactCurrentOwner,Ns=!1;function os(e,t,n,r){t.child=e===null?aH(t,null,n,r):zp(t,e.child,n,r)}function uM(e,t,n,r,i){n=n.render;var s=t.ref;return hp(t,i),r=RN(e,t,n,r,s,i),n=NN(),e!==null&&!Ns?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Tl(e,t,i)):(ar&&n&&vN(t),t.flags|=1,os(e,t,r,i),t.child)}function lM(e,t,n,r,i){if(e===null){var s=n.type;return typeof s=="function"&&!VN(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,PH(e,t,s,r,i)):(e=Q1(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!(e.lanes&i)){var o=s.memoizedProps;if(n=n.compare,n=n!==null?n:ly,n(o,r)&&e.ref===t.ref)return Tl(e,t,i)}return t.flags|=1,e=$c(s,r),e.ref=t.ref,e.return=t,t.child=e}function PH(e,t,n,r,i){if(e!==null){var s=e.memoizedProps;if(ly(s,r)&&e.ref===t.ref)if(Ns=!1,t.pendingProps=r=s,(e.lanes&i)!==0)e.flags&131072&&(Ns=!0);else return t.lanes=e.lanes,Tl(e,t,i)}return cP(e,t,n,r,i)}function RH(e,t,n){var r=t.pendingProps,i=r.children,s=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},qn(Kh,Zs),Zs|=n;else{if(!(n&1073741824))return e=s!==null?s.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,qn(Kh,Zs),Zs|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,qn(Kh,Zs),Zs|=r}else s!==null?(r=s.baseLanes|n,t.memoizedState=null):r=n,qn(Kh,Zs),Zs|=r;return os(e,t,i,n),t.child}function NH(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function cP(e,t,n,r,i){var s=Ms(n)?xd:Qi.current;return s=Up(t,s),hp(t,i),n=RN(e,t,n,r,s,i),r=NN(),e!==null&&!Ns?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Tl(e,t,i)):(ar&&r&&vN(t),t.flags|=1,os(e,t,n,i),t.child)}function cM(e,t,n,r,i){if(Ms(n)){var s=!0;jb(t)}else s=!1;if(hp(t,i),t.stateNode===null)Y1(e,t),sH(t,n,r),uP(t,n,r,i),r=!0;else if(e===null){var o=t.stateNode,a=t.memoizedProps;o.props=a;var u=o.context,l=n.contextType;typeof l=="object"&&l!==null?l=Wo(l):(l=Ms(n)?xd:Qi.current,l=Up(t,l));var c=n.getDerivedStateFromProps,f=typeof c=="function"||typeof o.getSnapshotBeforeUpdate=="function";f||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||u!==l)&&tM(t,o,r,l),uc=!1;var d=t.memoizedState;o.state=d,Wb(t,r,o,i),u=t.memoizedState,a!==r||d!==u||Ls.current||uc?(typeof c=="function"&&(aP(t,n,c,r),u=t.memoizedState),(a=uc||eM(t,n,a,r,d,u,l))?(f||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=u),o.props=r,o.state=u,o.context=l,r=a):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,rH(e,t),a=t.memoizedProps,l=t.type===t.elementType?a:da(t.type,a),o.props=l,f=t.pendingProps,d=o.context,u=n.contextType,typeof u=="object"&&u!==null?u=Wo(u):(u=Ms(n)?xd:Qi.current,u=Up(t,u));var h=n.getDerivedStateFromProps;(c=typeof h=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==f||d!==u)&&tM(t,o,r,u),uc=!1,d=t.memoizedState,o.state=d,Wb(t,r,o,i);var p=t.memoizedState;a!==f||d!==p||Ls.current||uc?(typeof h=="function"&&(aP(t,n,h,r),p=t.memoizedState),(l=uc||eM(t,n,l,r,d,p,u)||!1)?(c||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,p,u),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,p,u)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),o.props=r,o.state=p,o.context=u,r=l):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),r=!1)}return fP(e,t,n,r,s,i)}function fP(e,t,n,r,i,s){NH(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return i&&KL(t,n,!1),Tl(e,t,s);r=t.stateNode,Dce.current=t;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=zp(t,e.child,null,s),t.child=zp(t,null,a,s)):os(e,t,a,s),t.memoizedState=r.state,i&&KL(t,n,!0),t.child}function kH(e){var t=e.stateNode;t.pendingContext?GL(e,t.pendingContext,t.pendingContext!==t.context):t.context&&GL(e,t.context,!1),CN(e,t.containerInfo)}function fM(e,t,n,r,i){return Vp(),EN(i),t.flags|=256,os(e,t,n,r),t.child}var dP={dehydrated:null,treeContext:null,retryLane:0};function hP(e){return{baseLanes:e,cachePool:null,transitions:null}}function DH(e,t,n){var r=t.pendingProps,i=mr.current,s=!1,o=(t.flags&128)!==0,a;if((a=o)||(a=e!==null&&e.memoizedState===null?!1:(i&2)!==0),a?(s=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),qn(mr,i&1),e===null)return sP(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,s?(r=t.mode,s=t.child,o={mode:"hidden",children:o},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=TS(o,r,0,null),e=md(e,r,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=hP(n),t.memoizedState=dP,e):$N(t,o));if(i=e.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return $ce(e,t,o,r,a,i,n);if(s){s=r.fallback,o=t.mode,i=e.child,a=i.sibling;var u={mode:"hidden",children:r.children};return!(o&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=u,t.deletions=null):(r=$c(i,u),r.subtreeFlags=i.subtreeFlags&14680064),a!==null?s=$c(a,s):(s=md(s,o,n,null),s.flags|=2),s.return=t,r.return=t,r.sibling=s,t.child=r,r=s,s=t.child,o=e.child.memoizedState,o=o===null?hP(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=e.childLanes&~n,t.memoizedState=dP,r}return s=e.child,e=s.sibling,r=$c(s,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function $N(e,t){return t=TS({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Dv(e,t,n,r){return r!==null&&EN(r),zp(t,e.child,null,n),e=$N(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function $ce(e,t,n,r,i,s,o){if(n)return t.flags&256?(t.flags&=-257,r=_C(Error(Re(422))),Dv(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=r.fallback,i=t.mode,r=TS({mode:"visible",children:r.children},i,0,null),s=md(s,i,o,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,t.mode&1&&zp(t,e.child,null,o),t.child.memoizedState=hP(o),t.memoizedState=dP,s);if(!(t.mode&1))return Dv(e,t,o,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var a=r.dgst;return r=a,s=Error(Re(419)),r=_C(s,r,void 0),Dv(e,t,o,r)}if(a=(o&e.childLanes)!==0,Ns||a){if(r=di,r!==null){switch(o&-o){case 4:i=2;break;case 16:i=8;break;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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|o)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,wl(e,i),Sa(r,e,i,-1))}return UN(),r=_C(Error(Re(421))),Dv(e,t,o,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=Gce.bind(null,e),i._reactRetry=t,null):(e=s.treeContext,so=Rc(i.nextSibling),lo=t,ar=!0,ma=null,e!==null&&(Ro[No++]=nl,Ro[No++]=rl,Ro[No++]=Cd,nl=e.id,rl=e.overflow,Cd=t),t=$N(t,r.children),t.flags|=4096,t)}function dM(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),oP(e.return,t,n)}function vC(e,t,n,r,i){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=i)}function $H(e,t,n){var r=t.pendingProps,i=r.revealOrder,s=r.tail;if(os(e,t,r.children,n),r=mr.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&dM(e,n,t);else if(e.tag===19)dM(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(qn(mr,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&qb(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),vC(t,!1,i,n,s);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&qb(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}vC(t,!0,n,null,s);break;case"together":vC(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Y1(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Tl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Od|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(Re(153));if(t.child!==null){for(e=t.child,n=$c(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=$c(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Lce(e,t,n){switch(t.tag){case 3:kH(t),Vp();break;case 5:uH(t);break;case 1:Ms(t.type)&&jb(t);break;case 4:CN(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;qn(zb,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(qn(mr,mr.current&1),t.flags|=128,null):n&t.child.childLanes?DH(e,t,n):(qn(mr,mr.current&1),e=Tl(e,t,n),e!==null?e.sibling:null);qn(mr,mr.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return $H(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),qn(mr,mr.current),r)break;return null;case 22:case 23:return t.lanes=0,RH(e,t,n)}return Tl(e,t,n)}var LH,pP,MH,FH;LH=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};pP=function(){};MH=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,Jf(mu.current);var s=null;switch(n){case"input":i=LO(e,i),r=LO(e,r),s=[];break;case"select":i=yr({},i,{value:void 0}),r=yr({},r,{value:void 0}),s=[];break;case"textarea":i=BO(e,i),r=BO(e,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Fb)}UO(n,r);var o;n=null;for(l in i)if(!r.hasOwnProperty(l)&&i.hasOwnProperty(l)&&i[l]!=null)if(l==="style"){var a=i[l];for(o in a)a.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else l!=="dangerouslySetInnerHTML"&&l!=="children"&&l!=="suppressContentEditableWarning"&&l!=="suppressHydrationWarning"&&l!=="autoFocus"&&(ny.hasOwnProperty(l)?s||(s=[]):(s=s||[]).push(l,null));for(l in r){var u=r[l];if(a=i!=null?i[l]:void 0,r.hasOwnProperty(l)&&u!==a&&(u!=null||a!=null))if(l==="style")if(a){for(o in a)!a.hasOwnProperty(o)||u&&u.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in u)u.hasOwnProperty(o)&&a[o]!==u[o]&&(n||(n={}),n[o]=u[o])}else n||(s||(s=[]),s.push(l,n)),n=u;else l==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,a=a?a.__html:void 0,u!=null&&a!==u&&(s=s||[]).push(l,u)):l==="children"?typeof u!="string"&&typeof u!="number"||(s=s||[]).push(l,""+u):l!=="suppressContentEditableWarning"&&l!=="suppressHydrationWarning"&&(ny.hasOwnProperty(l)?(u!=null&&l==="onScroll"&&Kn("scroll",e),s||a===u||(s=[])):(s=s||[]).push(l,u))}n&&(s=s||[]).push("style",n);var l=s;(t.updateQueue=l)&&(t.flags|=4)}};FH=function(e,t,n,r){n!==r&&(t.flags|=4)};function Tg(e,t){if(!ar)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Bi(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Mce(e,t,n){var r=t.pendingProps;switch(bN(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Bi(t),null;case 1:return Ms(t.type)&&Bb(),Bi(t),null;case 3:return r=t.stateNode,Hp(),Zn(Ls),Zn(Qi),ON(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Nv(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ma!==null&&(wP(ma),ma=null))),pP(e,t),Bi(t),null;case 5:AN(t);var i=Jf(py.current);if(n=t.type,e!==null&&t.stateNode!=null)MH(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(Re(166));return Bi(t),null}if(e=Jf(mu.current),Nv(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[Xa]=t,r[dy]=s,e=(t.mode&1)!==0,n){case"dialog":Kn("cancel",r),Kn("close",r);break;case"iframe":case"object":case"embed":Kn("load",r);break;case"video":case"audio":for(i=0;i<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[Xa]=t,e[dy]=r,LH(e,t,!1,!1),t.stateNode=e;e:{switch(o=VO(n,r),n){case"dialog":Kn("cancel",e),Kn("close",e),i=r;break;case"iframe":case"object":case"embed":Kn("load",e),i=r;break;case"video":case"audio":for(i=0;iqp&&(t.flags|=128,r=!0,Tg(s,!1),t.lanes=4194304)}else{if(!r)if(e=qb(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Tg(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!ar)return Bi(t),null}else 2*kr()-s.renderingStartTime>qp&&n!==1073741824&&(t.flags|=128,r=!0,Tg(s,!1),t.lanes=4194304);s.isBackwards?(o.sibling=t.child,t.child=o):(n=s.last,n!==null?n.sibling=o:t.child=o,s.last=o)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=kr(),t.sibling=null,n=mr.current,qn(mr,r?n&1|2:n&1),t):(Bi(t),null);case 22:case 23:return jN(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Zs&1073741824&&(Bi(t),t.subtreeFlags&6&&(t.flags|=8192)):Bi(t),null;case 24:return null;case 25:return null}throw Error(Re(156,t.tag))}function Fce(e,t){switch(bN(t),t.tag){case 1:return Ms(t.type)&&Bb(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Hp(),Zn(Ls),Zn(Qi),ON(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return AN(t),null;case 13:if(Zn(mr),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Re(340));Vp()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Zn(mr),null;case 4:return Hp(),null;case 10:return SN(t.type._context),null;case 22:case 23:return jN(),null;case 24:return null;default:return null}}var $v=!1,Wi=!1,Bce=typeof WeakSet=="function"?WeakSet:Set,ze=null;function Gh(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Tr(e,t,r)}else n.current=null}function mP(e,t,n){try{n()}catch(r){Tr(e,t,r)}}var hM=!1;function jce(e,t){if(JO=$b,e=Vz(),_N(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,a=-1,u=-1,l=0,c=0,f=e,d=null;t:for(;;){for(var h;f!==n||i!==0&&f.nodeType!==3||(a=o+i),f!==s||r!==0&&f.nodeType!==3||(u=o+r),f.nodeType===3&&(o+=f.nodeValue.length),(h=f.firstChild)!==null;)d=f,f=h;for(;;){if(f===e)break t;if(d===n&&++l===i&&(a=o),d===s&&++c===r&&(u=o),(h=f.nextSibling)!==null)break;f=d,d=f.parentNode}f=h}n=a===-1||u===-1?null:{start:a,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(ZO={focusedElem:e,selectionRange:n},$b=!1,ze=t;ze!==null;)if(t=ze,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ze=e;else for(;ze!==null;){t=ze;try{var p=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(p!==null){var m=p.memoizedProps,y=p.memoizedState,g=t.stateNode,_=g.getSnapshotBeforeUpdate(t.elementType===t.type?m:da(t.type,m),y);g.__reactInternalSnapshotBeforeUpdate=_}break;case 3:var b=t.stateNode.containerInfo;b.nodeType===1?b.textContent="":b.nodeType===9&&b.documentElement&&b.removeChild(b.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Re(163))}}catch(T){Tr(t,t.return,T)}if(e=t.sibling,e!==null){e.return=t.return,ze=e;break}ze=t.return}return p=hM,hM=!1,p}function S0(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var s=i.destroy;i.destroy=void 0,s!==void 0&&mP(t,n,s)}i=i.next}while(i!==r)}}function ES(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 gP(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 BH(e){var t=e.alternate;t!==null&&(e.alternate=null,BH(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Xa],delete t[dy],delete t[nP],delete t[wce],delete t[Tce])),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 jH(e){return e.tag===5||e.tag===3||e.tag===4}function pM(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||jH(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 yP(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=Fb));else if(r!==4&&(e=e.child,e!==null))for(yP(e,t,n),e=e.sibling;e!==null;)yP(e,t,n),e=e.sibling}function _P(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(_P(e,t,n),e=e.sibling;e!==null;)_P(e,t,n),e=e.sibling}var Ti=null,ha=!1;function Xl(e,t,n){for(n=n.child;n!==null;)UH(e,t,n),n=n.sibling}function UH(e,t,n){if(pu&&typeof pu.onCommitFiberUnmount=="function")try{pu.onCommitFiberUnmount(hS,n)}catch{}switch(n.tag){case 5:Wi||Gh(n,t);case 6:var r=Ti,i=ha;Ti=null,Xl(e,t,n),Ti=r,ha=i,Ti!==null&&(ha?(e=Ti,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ti.removeChild(n.stateNode));break;case 18:Ti!==null&&(ha?(e=Ti,n=n.stateNode,e.nodeType===8?dC(e.parentNode,n):e.nodeType===1&&dC(e,n),ay(e)):dC(Ti,n.stateNode));break;case 4:r=Ti,i=ha,Ti=n.stateNode.containerInfo,ha=!0,Xl(e,t,n),Ti=r,ha=i;break;case 0:case 11:case 14:case 15:if(!Wi&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&mP(n,t,o),i=i.next}while(i!==r)}Xl(e,t,n);break;case 1:if(!Wi&&(Gh(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Tr(n,t,a)}Xl(e,t,n);break;case 21:Xl(e,t,n);break;case 22:n.mode&1?(Wi=(r=Wi)||n.memoizedState!==null,Xl(e,t,n),Wi=r):Xl(e,t,n);break;default:Xl(e,t,n)}}function mM(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Bce),t.forEach(function(r){var i=Kce.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function oa(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=o),r&=~s}if(r=i,r=kr()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Vce(r/1960))-r,10e?16:e,Tc===null)var r=!1;else{if(e=Tc,Tc=null,Xb=0,hn&6)throw Error(Re(331));var i=hn;for(hn|=4,ze=e.current;ze!==null;){var s=ze,o=s.child;if(ze.flags&16){var a=s.deletions;if(a!==null){for(var u=0;ukr()-FN?pd(e,0):MN|=n),Fs(e,t)}function KH(e,t){t===0&&(e.mode&1?(t=xv,xv<<=1,!(xv&130023424)&&(xv=4194304)):t=1);var n=ls();e=wl(e,t),e!==null&&(g_(e,t,n),Fs(e,n))}function Gce(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),KH(e,n)}function Kce(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(Re(314))}r!==null&&r.delete(t),KH(e,n)}var QH;QH=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ls.current)Ns=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Ns=!1,Lce(e,t,n);Ns=!!(e.flags&131072)}else Ns=!1,ar&&t.flags&1048576&&Zz(t,Vb,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Y1(e,t),e=t.pendingProps;var i=Up(t,Qi.current);hp(t,n),i=RN(null,t,r,e,i,n);var s=NN();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ms(r)?(s=!0,jb(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,xN(t),i.updater=vS,t.stateNode=i,i._reactInternals=t,uP(t,r,e,n),t=fP(null,t,r,!0,s,n)):(t.tag=0,ar&&s&&vN(t),os(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Y1(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=Xce(r),e=da(r,e),i){case 0:t=cP(null,t,r,e,n);break e;case 1:t=cM(null,t,r,e,n);break e;case 11:t=uM(null,t,r,e,n);break e;case 14:t=lM(null,t,r,da(r.type,e),n);break e}throw Error(Re(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:da(r,i),cP(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:da(r,i),cM(e,t,r,i,n);case 3:e:{if(kH(t),e===null)throw Error(Re(387));r=t.pendingProps,s=t.memoizedState,i=s.element,rH(e,t),Wb(t,r,null,n);var o=t.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){i=Wp(Error(Re(423)),t),t=fM(e,t,r,n,i);break e}else if(r!==i){i=Wp(Error(Re(424)),t),t=fM(e,t,r,n,i);break e}else for(so=Rc(t.stateNode.containerInfo.firstChild),lo=t,ar=!0,ma=null,n=aH(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Vp(),r===i){t=Tl(e,t,n);break e}os(e,t,r,n)}t=t.child}return t;case 5:return uH(t),e===null&&sP(t),r=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,o=i.children,eP(r,i)?o=null:s!==null&&eP(r,s)&&(t.flags|=32),NH(e,t),os(e,t,o,n),t.child;case 6:return e===null&&sP(t),null;case 13:return DH(e,t,n);case 4:return CN(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=zp(t,null,r,n):os(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:da(r,i),uM(e,t,r,i,n);case 7:return os(e,t,t.pendingProps,n),t.child;case 8:return os(e,t,t.pendingProps.children,n),t.child;case 12:return os(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,s=t.memoizedProps,o=i.value,qn(zb,r._currentValue),r._currentValue=o,s!==null)if(Aa(s.value,o)){if(s.children===i.children&&!Ls.current){t=Tl(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var u=a.firstContext;u!==null;){if(u.context===r){if(s.tag===1){u=fl(-1,n&-n),u.tag=2;var l=s.updateQueue;if(l!==null){l=l.shared;var c=l.pending;c===null?u.next=u:(u.next=c.next,c.next=u),l.pending=u}}s.lanes|=n,u=s.alternate,u!==null&&(u.lanes|=n),oP(s.return,n,t),a.lanes|=n;break}u=u.next}}else if(s.tag===10)o=s.type===t.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(Re(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),oP(o,n,t),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===t){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}os(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,hp(t,n),i=Wo(i),r=r(i),t.flags|=1,os(e,t,r,n),t.child;case 14:return r=t.type,i=da(r,t.pendingProps),i=da(r.type,i),lM(e,t,r,i,n);case 15:return PH(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:da(r,i),Y1(e,t),t.tag=1,Ms(r)?(e=!0,jb(t)):e=!1,hp(t,n),sH(t,r,i),uP(t,r,i,n),fP(null,t,r,!0,e,n);case 19:return $H(e,t,n);case 22:return RH(e,t,n)}throw Error(Re(156,t.tag))};function XH(e,t){return Tz(e,t)}function Qce(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 jo(e,t,n,r){return new Qce(e,t,n,r)}function VN(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Xce(e){if(typeof e=="function")return VN(e)?1:0;if(e!=null){if(e=e.$$typeof,e===aN)return 11;if(e===uN)return 14}return 2}function $c(e,t){var n=e.alternate;return n===null?(n=jo(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 Q1(e,t,n,r,i,s){var o=2;if(r=e,typeof e=="function")VN(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Bh:return md(n.children,i,s,t);case oN:o=8,i|=8;break;case NO:return e=jo(12,n,t,i|2),e.elementType=NO,e.lanes=s,e;case kO:return e=jo(13,n,t,i),e.elementType=kO,e.lanes=s,e;case DO:return e=jo(19,n,t,i),e.elementType=DO,e.lanes=s,e;case oz:return TS(n,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case iz:o=10;break e;case sz:o=9;break e;case aN:o=11;break e;case uN:o=14;break e;case ac:o=16,r=null;break e}throw Error(Re(130,e==null?e:typeof e,""))}return t=jo(o,n,t,i),t.elementType=e,t.type=r,t.lanes=s,t}function md(e,t,n,r){return e=jo(7,e,r,t),e.lanes=n,e}function TS(e,t,n,r){return e=jo(22,e,r,t),e.elementType=oz,e.lanes=n,e.stateNode={isHidden:!1},e}function bC(e,t,n){return e=jo(6,e,null,t),e.lanes=n,e}function EC(e,t,n){return t=jo(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Jce(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=tC(0),this.expirationTimes=tC(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=tC(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function zN(e,t,n,r,i,s,o,a,u){return e=new Jce(e,t,n,a,u),t===1?(t=1,s===!0&&(t|=8)):t=0,s=jo(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},xN(s),e}function Zce(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(tW)}catch(e){console.error(e)}}tW(),Z7.exports=bo;var b_=Z7.exports,TM=b_;PO.createRoot=TM.createRoot,PO.hydrateRoot=TM.hydrateRoot;const nW=w.createContext({storageEngine:void 0,setStorageEngine:()=>{}}),vf=()=>w.useContext(nW);function ife({children:e}){const[t,n]=k.useState(void 0),r=k.useMemo(()=>({storageEngine:t,setStorageEngine:n}),[t]);return $.jsx(nW.Provider,{value:r,children:e})}/** * @remix-run/router v1.5.0 * * Copyright (c) Remix Software Inc. @@ -46,7 +46,7 @@ Error generating stack: `+s.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function vy(){return vy=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function YN(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function afe(){return Math.random().toString(36).substr(2,8)}function IM(e,t){return{usr:e.state,key:e.key,idx:t}}function TP(e,t,n,r){return n===void 0&&(n=null),vy({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Rm(t):t,{state:n,key:t&&t.key||r||afe()})}function rW(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 Rm(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 ufe(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:s=!1}=r,o=i.history,a=Sc.Pop,u=null,l=c();l==null&&(l=0,o.replaceState(vy({},o.state,{idx:l}),""));function c(){return(o.state||{idx:null}).idx}function f(){a=Sc.Pop;let y=c(),g=y==null?null:y-l;l=y,u&&u({action:a,location:m.location,delta:g})}function d(y,g){a=Sc.Push;let _=TP(m.location,y,g);n&&n(_,y),l=c()+1;let b=IM(_,l),T=m.createHref(_);try{o.pushState(b,"",T)}catch{i.location.assign(T)}s&&u&&u({action:a,location:m.location,delta:1})}function h(y,g){a=Sc.Replace;let _=TP(m.location,y,g);n&&n(_,y),l=c();let b=IM(_,l),T=m.createHref(_);o.replaceState(b,"",T),s&&u&&u({action:a,location:m.location,delta:0})}function p(y){let g=i.location.origin!=="null"?i.location.origin:i.location.href,_=typeof y=="string"?y:rW(y);return zr(g,"No window.location.(origin|href) available to create URL for href: "+_),new URL(_,g)}let m={get action(){return a},get location(){return e(i,o)},listen(y){if(u)throw new Error("A history only accepts one active listener");return i.addEventListener(SM,f),u=y,()=>{i.removeEventListener(SM,f),u=null}},createHref(y){return t(i,y)},createURL:p,encodeLocation(y){let g=p(y);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:d,replace:h,go(y){return o.go(y)}};return m}var xM;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(xM||(xM={}));function lfe(e,t,n){n===void 0&&(n="/");let r=typeof t=="string"?Rm(t):t,i=oW(r.pathname||"/",n);if(i==null)return null;let s=iW(e);cfe(s);let o=null;for(let a=0;o==null&&a{let u={relativePath:a===void 0?s.path||"":a,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};u.relativePath.startsWith("/")&&(zr(u.relativePath.startsWith(r),'Absolute route path "'+u.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),u.relativePath=u.relativePath.slice(r.length));let l=Lc([r,u.relativePath]),c=n.concat(u);s.children&&s.children.length>0&&(zr(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+l+'".')),iW(s.children,t,c,l)),!(s.path==null&&!s.index)&&t.push({path:l,score:yfe(l,s.index),routesMeta:c})};return e.forEach((s,o)=>{var a;if(s.path===""||!((a=s.path)!=null&&a.includes("?")))i(s,o);else for(let u of sW(s.path))i(s,o,u)}),t}function sW(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let o=sW(r.join("/")),a=[];return a.push(...o.map(u=>u===""?s:[s,u].join("/"))),i&&a.push(...o),a.map(u=>e.startsWith("/")&&u===""?"/":u)}function cfe(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:_fe(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const ffe=/^:\w+$/,dfe=3,hfe=2,pfe=1,mfe=10,gfe=-2,CM=e=>e==="*";function yfe(e,t){let n=e.split("/"),r=n.length;return n.some(CM)&&(r+=gfe),t&&(r+=hfe),n.filter(i=>!CM(i)).reduce((i,s)=>i+(ffe.test(s)?dfe:s===""?pfe:mfe),r)}function _fe(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function vfe(e,t){let{routesMeta:n}=e,r={},i="/",s=[];for(let o=0;o{if(c==="*"){let d=a[f]||"";o=s.slice(0,s.length-d.length).replace(/(.)\/+$/,"$1")}return l[c]=Tfe(a[f]||"",c),l},{}),pathname:s,pathnameBase:o,pattern:e}}function Efe(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),YN(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/\/:(\w+)/g,(o,a)=>(r.push(a),"/([^\\/]+)"));return e.endsWith("*")?(r.push("*"),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function wfe(e){try{return decodeURI(e)}catch(t){return YN(!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 Tfe(e,t){try{return decodeURIComponent(e)}catch(n){return YN(!1,'The value for the URL param "'+t+'" will not be decoded because'+(' the string "'+e+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+n+").")),e}}function oW(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 Sfe(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Rm(e):e;return{pathname:n?n.startsWith("/")?n:Ife(n,t):t,search:Cfe(r),hash:Afe(i)}}function Ife(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function wC(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 aW(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function uW(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=Rm(e):(i=vy({},e),zr(!i.pathname||!i.pathname.includes("?"),wC("?","pathname","search",i)),zr(!i.pathname||!i.pathname.includes("#"),wC("#","pathname","hash",i)),zr(!i.search||!i.search.includes("#"),wC("#","search","hash",i)));let s=e===""||i.pathname==="",o=s?"/":i.pathname,a;if(r||o==null)a=n;else{let f=t.length-1;if(o.startsWith("..")){let d=o.split("/");for(;d[0]==="..";)d.shift(),f-=1;i.pathname=d.join("/")}a=f>=0?t[f]:"/"}let u=Sfe(i,a),l=o&&o!=="/"&&o.endsWith("/"),c=(s||o===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(l||c)&&(u.pathname+="/"),u}const Lc=e=>e.join("/").replace(/\/\/+/g,"/"),xfe=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Cfe=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Afe=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Ofe(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const lW=["post","put","patch","delete"];new Set(lW);const Pfe=["get",...lW];new Set(Pfe);/** + */function vy(){return vy=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function YN(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function ofe(){return Math.random().toString(36).substr(2,8)}function IM(e,t){return{usr:e.state,key:e.key,idx:t}}function TP(e,t,n,r){return n===void 0&&(n=null),vy({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Rm(t):t,{state:n,key:t&&t.key||r||ofe()})}function rW(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 Rm(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 afe(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:s=!1}=r,o=i.history,a=Sc.Pop,u=null,l=c();l==null&&(l=0,o.replaceState(vy({},o.state,{idx:l}),""));function c(){return(o.state||{idx:null}).idx}function f(){a=Sc.Pop;let y=c(),g=y==null?null:y-l;l=y,u&&u({action:a,location:m.location,delta:g})}function d(y,g){a=Sc.Push;let _=TP(m.location,y,g);n&&n(_,y),l=c()+1;let b=IM(_,l),T=m.createHref(_);try{o.pushState(b,"",T)}catch{i.location.assign(T)}s&&u&&u({action:a,location:m.location,delta:1})}function h(y,g){a=Sc.Replace;let _=TP(m.location,y,g);n&&n(_,y),l=c();let b=IM(_,l),T=m.createHref(_);o.replaceState(b,"",T),s&&u&&u({action:a,location:m.location,delta:0})}function p(y){let g=i.location.origin!=="null"?i.location.origin:i.location.href,_=typeof y=="string"?y:rW(y);return zr(g,"No window.location.(origin|href) available to create URL for href: "+_),new URL(_,g)}let m={get action(){return a},get location(){return e(i,o)},listen(y){if(u)throw new Error("A history only accepts one active listener");return i.addEventListener(SM,f),u=y,()=>{i.removeEventListener(SM,f),u=null}},createHref(y){return t(i,y)},createURL:p,encodeLocation(y){let g=p(y);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:d,replace:h,go(y){return o.go(y)}};return m}var xM;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(xM||(xM={}));function ufe(e,t,n){n===void 0&&(n="/");let r=typeof t=="string"?Rm(t):t,i=oW(r.pathname||"/",n);if(i==null)return null;let s=iW(e);lfe(s);let o=null;for(let a=0;o==null&&a{let u={relativePath:a===void 0?s.path||"":a,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};u.relativePath.startsWith("/")&&(zr(u.relativePath.startsWith(r),'Absolute route path "'+u.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),u.relativePath=u.relativePath.slice(r.length));let l=Lc([r,u.relativePath]),c=n.concat(u);s.children&&s.children.length>0&&(zr(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+l+'".')),iW(s.children,t,c,l)),!(s.path==null&&!s.index)&&t.push({path:l,score:gfe(l,s.index),routesMeta:c})};return e.forEach((s,o)=>{var a;if(s.path===""||!((a=s.path)!=null&&a.includes("?")))i(s,o);else for(let u of sW(s.path))i(s,o,u)}),t}function sW(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let o=sW(r.join("/")),a=[];return a.push(...o.map(u=>u===""?s:[s,u].join("/"))),i&&a.push(...o),a.map(u=>e.startsWith("/")&&u===""?"/":u)}function lfe(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:yfe(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const cfe=/^:\w+$/,ffe=3,dfe=2,hfe=1,pfe=10,mfe=-2,CM=e=>e==="*";function gfe(e,t){let n=e.split("/"),r=n.length;return n.some(CM)&&(r+=mfe),t&&(r+=dfe),n.filter(i=>!CM(i)).reduce((i,s)=>i+(cfe.test(s)?ffe:s===""?hfe:pfe),r)}function yfe(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function _fe(e,t){let{routesMeta:n}=e,r={},i="/",s=[];for(let o=0;o{if(c==="*"){let d=a[f]||"";o=s.slice(0,s.length-d.length).replace(/(.)\/+$/,"$1")}return l[c]=wfe(a[f]||"",c),l},{}),pathname:s,pathnameBase:o,pattern:e}}function bfe(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),YN(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/\/:(\w+)/g,(o,a)=>(r.push(a),"/([^\\/]+)"));return e.endsWith("*")?(r.push("*"),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function Efe(e){try{return decodeURI(e)}catch(t){return YN(!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 wfe(e,t){try{return decodeURIComponent(e)}catch(n){return YN(!1,'The value for the URL param "'+t+'" will not be decoded because'+(' the string "'+e+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+n+").")),e}}function oW(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 Tfe(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Rm(e):e;return{pathname:n?n.startsWith("/")?n:Sfe(n,t):t,search:xfe(r),hash:Cfe(i)}}function Sfe(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function wC(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 aW(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function uW(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=Rm(e):(i=vy({},e),zr(!i.pathname||!i.pathname.includes("?"),wC("?","pathname","search",i)),zr(!i.pathname||!i.pathname.includes("#"),wC("#","pathname","hash",i)),zr(!i.search||!i.search.includes("#"),wC("#","search","hash",i)));let s=e===""||i.pathname==="",o=s?"/":i.pathname,a;if(r||o==null)a=n;else{let f=t.length-1;if(o.startsWith("..")){let d=o.split("/");for(;d[0]==="..";)d.shift(),f-=1;i.pathname=d.join("/")}a=f>=0?t[f]:"/"}let u=Tfe(i,a),l=o&&o!=="/"&&o.endsWith("/"),c=(s||o===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(l||c)&&(u.pathname+="/"),u}const Lc=e=>e.join("/").replace(/\/\/+/g,"/"),Ife=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),xfe=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Cfe=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Afe(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const lW=["post","put","patch","delete"];new Set(lW);const Ofe=["get",...lW];new Set(Ofe);/** * React Router v6.10.0 * * Copyright (c) Remix Software Inc. @@ -55,7 +55,7 @@ Error generating stack: `+s.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function Rfe(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}const Nfe=typeof Object.is=="function"?Object.is:Rfe,{useState:kfe,useEffect:Dfe,useLayoutEffect:$fe,useDebugValue:Lfe}=Id;function Mfe(e,t,n){const r=t(),[{inst:i},s]=kfe({inst:{value:r,getSnapshot:t}});return $fe(()=>{i.value=r,i.getSnapshot=t,TC(i)&&s({inst:i})},[e,r,t]),Dfe(()=>(TC(i)&&s({inst:i}),e(()=>{TC(i)&&s({inst:i})})),[e]),Lfe(r),r}function TC(e){const t=e.getSnapshot,n=e.value;try{const r=t();return!Nfe(n,r)}catch{return!0}}function Ffe(e,t,n){return t()}const Bfe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",jfe=!Bfe,Ufe=jfe?Ffe:Mfe;"useSyncExternalStore"in Id&&(e=>e.useSyncExternalStore)(Id);const cW=w.createContext(null),GN=w.createContext(null),AS=w.createContext(null),OS=w.createContext(null),bf=w.createContext({outlet:null,matches:[]}),fW=w.createContext(null);function SP(){return SP=Object.assign?Object.assign.bind():function(e){for(var t=1;ta.pathnameBase)),s=w.useRef(!1);return w.useEffect(()=>{s.current=!0}),w.useCallback(function(a,u){if(u===void 0&&(u={}),!s.current)return;if(typeof a=="number"){t.go(a);return}let l=uW(a,JSON.parse(i),r,u.relative==="path");e!=="/"&&(l.pathname=l.pathname==="/"?e:Lc([e,l.pathname])),(u.replace?t.replace:t.push)(l,u.state,u)},[e,t,i,r])}const zfe=w.createContext(null);function Hfe(e){let t=w.useContext(bf).outlet;return t&&w.createElement(zfe.Provider,{value:e},t)}function KN(){let{matches:e}=w.useContext(bf),t=e[e.length-1];return t?t.params:{}}function Wfe(e,t){let{relative:n}=t===void 0?{}:t,{matches:r}=w.useContext(bf),{pathname:i}=km(),s=JSON.stringify(aW(r).map(o=>o.pathnameBase));return w.useMemo(()=>uW(e,JSON.parse(s),i,n==="path"),[e,s,i,n])}function dW(e,t){Nm()||zr(!1);let{navigator:n}=w.useContext(AS),r=w.useContext(GN),{matches:i}=w.useContext(bf),s=i[i.length-1],o=s?s.params:{};s&&s.pathname;let a=s?s.pathnameBase:"/";s&&s.route;let u=km(),l;if(t){var c;let m=typeof t=="string"?Rm(t):t;a==="/"||(c=m.pathname)!=null&&c.startsWith(a)||zr(!1),l=m}else l=u;let f=l.pathname||"/",d=a==="/"?f:f.slice(a.length)||"/",h=lfe(e,{pathname:d}),p=Kfe(h&&h.map(m=>Object.assign({},m,{params:Object.assign({},o,m.params),pathname:Lc([a,n.encodeLocation?n.encodeLocation(m.pathname).pathname:m.pathname]),pathnameBase:m.pathnameBase==="/"?a:Lc([a,n.encodeLocation?n.encodeLocation(m.pathnameBase).pathname:m.pathnameBase])})),i,r||void 0);return t&&p?w.createElement(OS.Provider,{value:{location:SP({pathname:"/",search:"",hash:"",state:null,key:"default"},l),navigationType:Sc.Pop}},p):p}function qfe(){let e=Zfe(),t=Ofe(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},s=null;return w.createElement(w.Fragment,null,w.createElement("h2",null,"Unexpected Application Error!"),w.createElement("h3",{style:{fontStyle:"italic"}},t),n?w.createElement("pre",{style:i},n):null,s)}class Yfe extends w.Component{constructor(t){super(t),this.state={location:t.location,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location?{error:t.error,location:t.location}:{error:t.error||n.error,location:n.location}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error?w.createElement(bf.Provider,{value:this.props.routeContext},w.createElement(fW.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Gfe(e){let{routeContext:t,match:n,children:r}=e,i=w.useContext(cW);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),w.createElement(bf.Provider,{value:t},r)}function Kfe(e,t,n){if(t===void 0&&(t=[]),e==null)if(n!=null&&n.errors)e=n.matches;else return null;let r=e,i=n==null?void 0:n.errors;if(i!=null){let s=r.findIndex(o=>o.route.id&&(i==null?void 0:i[o.route.id]));s>=0||zr(!1),r=r.slice(0,Math.min(r.length,s+1))}return r.reduceRight((s,o,a)=>{let u=o.route.id?i==null?void 0:i[o.route.id]:null,l=null;n&&(o.route.ErrorBoundary?l=w.createElement(o.route.ErrorBoundary,null):o.route.errorElement?l=o.route.errorElement:l=w.createElement(qfe,null));let c=t.concat(r.slice(0,a+1)),f=()=>{let d=s;return u?d=l:o.route.Component?d=w.createElement(o.route.Component,null):o.route.element&&(d=o.route.element),w.createElement(Gfe,{match:o,routeContext:{outlet:s,matches:c},children:d})};return n&&(o.route.ErrorBoundary||o.route.errorElement||a===0)?w.createElement(Yfe,{location:n.location,component:l,error:u,children:f(),routeContext:{outlet:null,matches:c}}):f()},null)}var AM;(function(e){e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator"})(AM||(AM={}));var eE;(function(e){e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator"})(eE||(eE={}));function Qfe(e){let t=w.useContext(GN);return t||zr(!1),t}function Xfe(e){let t=w.useContext(bf);return t||zr(!1),t}function Jfe(e){let t=Xfe(),n=t.matches[t.matches.length-1];return n.route.id||zr(!1),n.route.id}function Zfe(){var e;let t=w.useContext(fW),n=Qfe(eE.UseRouteError),r=Jfe(eE.UseRouteError);return t||((e=n.errors)==null?void 0:e[r])}function ede(e){let{to:t,replace:n,state:r,relative:i}=e;Nm()||zr(!1);let s=w.useContext(GN),o=Qd();return w.useEffect(()=>{s&&s.navigation.state!=="idle"||o(t,{replace:n,state:r,relative:i})}),null}function tde(e){return Hfe(e.context)}function IP(e){zr(!1)}function nde(e){let{basename:t="/",children:n=null,location:r,navigationType:i=Sc.Pop,navigator:s,static:o=!1}=e;Nm()&&zr(!1);let a=t.replace(/^\/*/,"/"),u=w.useMemo(()=>({basename:a,navigator:s,static:o}),[a,s,o]);typeof r=="string"&&(r=Rm(r));let{pathname:l="/",search:c="",hash:f="",state:d=null,key:h="default"}=r,p=w.useMemo(()=>{let m=oW(l,a);return m==null?null:{location:{pathname:m,search:c,hash:f,state:d,key:h},navigationType:i}},[a,l,c,f,d,h,i]);return p==null?null:w.createElement(AS.Provider,{value:u},w.createElement(OS.Provider,{children:n,value:p}))}function rde(e){let{children:t,location:n}=e,r=w.useContext(cW),i=r&&!t?r.router.routes:xP(t);return dW(i,n)}var OM;(function(e){e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error"})(OM||(OM={}));new Promise(()=>{});function xP(e,t){t===void 0&&(t=[]);let n=[];return w.Children.forEach(e,(r,i)=>{if(!w.isValidElement(r))return;let s=[...t,i];if(r.type===w.Fragment){n.push.apply(n,xP(r.props.children,s));return}r.type!==IP&&zr(!1),!r.props.index||!r.props.children||zr(!1);let o={id:r.props.id||s.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&&(o.children=xP(r.props.children,s)),n.push(o)}),n}/** + */function Pfe(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}const Rfe=typeof Object.is=="function"?Object.is:Pfe,{useState:Nfe,useEffect:kfe,useLayoutEffect:Dfe,useDebugValue:$fe}=Id;function Lfe(e,t,n){const r=t(),[{inst:i},s]=Nfe({inst:{value:r,getSnapshot:t}});return Dfe(()=>{i.value=r,i.getSnapshot=t,TC(i)&&s({inst:i})},[e,r,t]),kfe(()=>(TC(i)&&s({inst:i}),e(()=>{TC(i)&&s({inst:i})})),[e]),$fe(r),r}function TC(e){const t=e.getSnapshot,n=e.value;try{const r=t();return!Rfe(n,r)}catch{return!0}}function Mfe(e,t,n){return t()}const Ffe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Bfe=!Ffe,jfe=Bfe?Mfe:Lfe;"useSyncExternalStore"in Id&&(e=>e.useSyncExternalStore)(Id);const cW=w.createContext(null),GN=w.createContext(null),AS=w.createContext(null),OS=w.createContext(null),bf=w.createContext({outlet:null,matches:[]}),fW=w.createContext(null);function SP(){return SP=Object.assign?Object.assign.bind():function(e){for(var t=1;ta.pathnameBase)),s=w.useRef(!1);return w.useEffect(()=>{s.current=!0}),w.useCallback(function(a,u){if(u===void 0&&(u={}),!s.current)return;if(typeof a=="number"){t.go(a);return}let l=uW(a,JSON.parse(i),r,u.relative==="path");e!=="/"&&(l.pathname=l.pathname==="/"?e:Lc([e,l.pathname])),(u.replace?t.replace:t.push)(l,u.state,u)},[e,t,i,r])}const Vfe=w.createContext(null);function zfe(e){let t=w.useContext(bf).outlet;return t&&w.createElement(Vfe.Provider,{value:e},t)}function KN(){let{matches:e}=w.useContext(bf),t=e[e.length-1];return t?t.params:{}}function Hfe(e,t){let{relative:n}=t===void 0?{}:t,{matches:r}=w.useContext(bf),{pathname:i}=km(),s=JSON.stringify(aW(r).map(o=>o.pathnameBase));return w.useMemo(()=>uW(e,JSON.parse(s),i,n==="path"),[e,s,i,n])}function dW(e,t){Nm()||zr(!1);let{navigator:n}=w.useContext(AS),r=w.useContext(GN),{matches:i}=w.useContext(bf),s=i[i.length-1],o=s?s.params:{};s&&s.pathname;let a=s?s.pathnameBase:"/";s&&s.route;let u=km(),l;if(t){var c;let m=typeof t=="string"?Rm(t):t;a==="/"||(c=m.pathname)!=null&&c.startsWith(a)||zr(!1),l=m}else l=u;let f=l.pathname||"/",d=a==="/"?f:f.slice(a.length)||"/",h=ufe(e,{pathname:d}),p=Gfe(h&&h.map(m=>Object.assign({},m,{params:Object.assign({},o,m.params),pathname:Lc([a,n.encodeLocation?n.encodeLocation(m.pathname).pathname:m.pathname]),pathnameBase:m.pathnameBase==="/"?a:Lc([a,n.encodeLocation?n.encodeLocation(m.pathnameBase).pathname:m.pathnameBase])})),i,r||void 0);return t&&p?w.createElement(OS.Provider,{value:{location:SP({pathname:"/",search:"",hash:"",state:null,key:"default"},l),navigationType:Sc.Pop}},p):p}function Wfe(){let e=Jfe(),t=Afe(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},s=null;return w.createElement(w.Fragment,null,w.createElement("h2",null,"Unexpected Application Error!"),w.createElement("h3",{style:{fontStyle:"italic"}},t),n?w.createElement("pre",{style:i},n):null,s)}class qfe extends w.Component{constructor(t){super(t),this.state={location:t.location,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location?{error:t.error,location:t.location}:{error:t.error||n.error,location:n.location}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error?w.createElement(bf.Provider,{value:this.props.routeContext},w.createElement(fW.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Yfe(e){let{routeContext:t,match:n,children:r}=e,i=w.useContext(cW);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),w.createElement(bf.Provider,{value:t},r)}function Gfe(e,t,n){if(t===void 0&&(t=[]),e==null)if(n!=null&&n.errors)e=n.matches;else return null;let r=e,i=n==null?void 0:n.errors;if(i!=null){let s=r.findIndex(o=>o.route.id&&(i==null?void 0:i[o.route.id]));s>=0||zr(!1),r=r.slice(0,Math.min(r.length,s+1))}return r.reduceRight((s,o,a)=>{let u=o.route.id?i==null?void 0:i[o.route.id]:null,l=null;n&&(o.route.ErrorBoundary?l=w.createElement(o.route.ErrorBoundary,null):o.route.errorElement?l=o.route.errorElement:l=w.createElement(Wfe,null));let c=t.concat(r.slice(0,a+1)),f=()=>{let d=s;return u?d=l:o.route.Component?d=w.createElement(o.route.Component,null):o.route.element&&(d=o.route.element),w.createElement(Yfe,{match:o,routeContext:{outlet:s,matches:c},children:d})};return n&&(o.route.ErrorBoundary||o.route.errorElement||a===0)?w.createElement(qfe,{location:n.location,component:l,error:u,children:f(),routeContext:{outlet:null,matches:c}}):f()},null)}var AM;(function(e){e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator"})(AM||(AM={}));var eE;(function(e){e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator"})(eE||(eE={}));function Kfe(e){let t=w.useContext(GN);return t||zr(!1),t}function Qfe(e){let t=w.useContext(bf);return t||zr(!1),t}function Xfe(e){let t=Qfe(),n=t.matches[t.matches.length-1];return n.route.id||zr(!1),n.route.id}function Jfe(){var e;let t=w.useContext(fW),n=Kfe(eE.UseRouteError),r=Xfe(eE.UseRouteError);return t||((e=n.errors)==null?void 0:e[r])}function Zfe(e){let{to:t,replace:n,state:r,relative:i}=e;Nm()||zr(!1);let s=w.useContext(GN),o=Qd();return w.useEffect(()=>{s&&s.navigation.state!=="idle"||o(t,{replace:n,state:r,relative:i})}),null}function ede(e){return zfe(e.context)}function IP(e){zr(!1)}function tde(e){let{basename:t="/",children:n=null,location:r,navigationType:i=Sc.Pop,navigator:s,static:o=!1}=e;Nm()&&zr(!1);let a=t.replace(/^\/*/,"/"),u=w.useMemo(()=>({basename:a,navigator:s,static:o}),[a,s,o]);typeof r=="string"&&(r=Rm(r));let{pathname:l="/",search:c="",hash:f="",state:d=null,key:h="default"}=r,p=w.useMemo(()=>{let m=oW(l,a);return m==null?null:{location:{pathname:m,search:c,hash:f,state:d,key:h},navigationType:i}},[a,l,c,f,d,h,i]);return p==null?null:w.createElement(AS.Provider,{value:u},w.createElement(OS.Provider,{children:n,value:p}))}function nde(e){let{children:t,location:n}=e,r=w.useContext(cW),i=r&&!t?r.router.routes:xP(t);return dW(i,n)}var OM;(function(e){e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error"})(OM||(OM={}));new Promise(()=>{});function xP(e,t){t===void 0&&(t=[]);let n=[];return w.Children.forEach(e,(r,i)=>{if(!w.isValidElement(r))return;let s=[...t,i];if(r.type===w.Fragment){n.push.apply(n,xP(r.props.children,s));return}r.type!==IP&&zr(!1),!r.props.index||!r.props.children||zr(!1);let o={id:r.props.id||s.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&&(o.children=xP(r.props.children,s)),n.push(o)}),n}/** * React Router DOM v6.10.0 * * Copyright (c) Remix Software Inc. @@ -64,20 +64,20 @@ Error generating stack: `+s.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function CP(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function ide(e,t){let n=CP(e);if(t)for(let r of t.keys())n.has(r)||t.getAll(r).forEach(i=>{n.append(r,i)});return n}function sde(e){let{basename:t,children:n,window:r}=e,i=w.useRef();i.current==null&&(i.current=ofe({window:r,v5Compat:!0}));let s=i.current,[o,a]=w.useState({action:s.action,location:s.location});return w.useLayoutEffect(()=>s.listen(a),[s]),w.createElement(nde,{basename:t,children:n,location:o.location,navigationType:o.action,navigator:s})}var PM;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmitImpl="useSubmitImpl",e.UseFetcher="useFetcher"})(PM||(PM={}));var RM;(function(e){e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(RM||(RM={}));function QN(e){let t=w.useRef(CP(e)),n=w.useRef(!1),r=km(),i=w.useMemo(()=>ide(r.search,n.current?null:t.current),[r.search]),s=Qd(),o=w.useCallback((a,u)=>{const l=CP(typeof a=="function"?a(i):a);n.current=!0,s("?"+l,u)},[s,i]);return[i,o]}function tE(e,t){let n=e;for(;(n=n.parentElement)&&!n.matches(t););return n}function ode(e,t,n){for(let r=e-1;r>=0;r-=1)if(!t[r].disabled)return r;if(n){for(let r=t.length-1;r>-1;r-=1)if(!t[r].disabled)return r}return e}function ade(e,t,n){for(let r=e+1;r{var u;n==null||n(a);const l=Array.from(((u=tE(a.currentTarget,e))==null?void 0:u.querySelectorAll(t))||[]).filter(m=>ude(a.currentTarget,m,e)),c=l.findIndex(m=>a.currentTarget===m),f=ade(c,l,r),d=ode(c,l,r),h=s==="rtl"?d:f,p=s==="rtl"?f:d;switch(a.key){case"ArrowRight":{o==="horizontal"&&(a.stopPropagation(),a.preventDefault(),l[h].focus(),i&&l[h].click());break}case"ArrowLeft":{o==="horizontal"&&(a.stopPropagation(),a.preventDefault(),l[p].focus(),i&&l[p].click());break}case"ArrowUp":{o==="vertical"&&(a.stopPropagation(),a.preventDefault(),l[d].focus(),i&&l[d].click());break}case"ArrowDown":{o==="vertical"&&(a.stopPropagation(),a.preventDefault(),l[f].focus(),i&&l[f].click());break}case"Home":{a.stopPropagation(),a.preventDefault(),!l[0].disabled&&l[0].focus();break}case"End":{a.stopPropagation(),a.preventDefault();const m=l.length-1;!l[m].disabled&&l[m].focus();break}}}}function cde(e,t,n){var r;return n?Array.from(((r=tE(n,t))==null?void 0:r.querySelectorAll(e))||[]).findIndex(i=>i===n):null}function XN(e){const t=w.createContext(null);return[({children:i,value:s})=>k.createElement(t.Provider,{value:s},i),()=>{const i=w.useContext(t);if(i===null)throw new Error(e);return i}]}function Rd(e){return Array.isArray(e)?e:[e]}const fde=()=>{};function dde(e,t={active:!0}){return typeof e!="function"||!t.active?t.onKeyDown||fde:n=>{var r;n.key==="Escape"&&(e(n),(r=t.onTrigger)==null||r.call(t))}}function oo(e,t){return n=>{e==null||e(n),t==null||t(n)}}function hde(e){return Object.keys(e)}function pde(){const[e,t]=w.useState(-1);return[e,{setHovered:t,resetHovered:()=>t(-1)}]}function hW({data:e}){const t=[],n=[],r=e.reduce((i,s,o)=>(s.group?i[s.group]?i[s.group].push(o):i[s.group]=[o]:n.push(o),i),{});return Object.keys(r).forEach(i=>{t.push(...r[i].map(s=>e[s]))}),t.push(...n.map(i=>e[i])),t}function Dm(e){return Array.isArray(e)||e===null?!1:typeof e=="object"?e.type!==k.Fragment:!1}function pW(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t({fontFamily:e.fontFamily||"sans-serif"})}var yde=Object.defineProperty,NM=Object.getOwnPropertySymbols,_de=Object.prototype.hasOwnProperty,vde=Object.prototype.propertyIsEnumerable,kM=(e,t,n)=>t in e?yde(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,DM=(e,t)=>{for(var n in t||(t={}))_de.call(t,n)&&kM(e,n,t[n]);if(NM)for(var n of NM(t))vde.call(t,n)&&kM(e,n,t[n]);return e};function bde(e){return t=>({WebkitTapHighlightColor:"transparent",[t||"&:focus"]:DM({},e.focusRing==="always"||e.focusRing==="auto"?e.focusRingStyles.styles(e):e.focusRingStyles.resetStyles(e)),[t?t.replace(":focus",":focus:not(:focus-visible)"):"&:focus:not(:focus-visible)"]:DM({},e.focusRing==="auto"||e.focusRing==="never"?e.focusRingStyles.resetStyles(e):null)})}function E_(e){return t=>typeof e.primaryShade=="number"?e.primaryShade:e.primaryShade[t||e.colorScheme]}function JN(e){const t=E_(e);return(n,r,i=!0,s=!0)=>{if(typeof n=="string"&&n.includes(".")){const[a,u]=n.split("."),l=parseInt(u,10);if(a in e.colors&&l>=0&&l<10)return e.colors[a][typeof r=="number"&&!s?r:l]}const o=typeof r=="number"?r:t();return n in e.colors?e.colors[n][o]:i?e.colors[e.primaryColor][o]:n}}function gW(e){let t="";for(let n=1;n{const i={from:(r==null?void 0:r.from)||e.defaultGradient.from,to:(r==null?void 0:r.to)||e.defaultGradient.to,deg:(r==null?void 0:r.deg)||e.defaultGradient.deg};return`linear-gradient(${i.deg}deg, ${t(i.from,n(),!1)} 0%, ${t(i.to,n(),!1)} 100%)`}}function ZN(e){if(typeof e.size=="number")return e.size;const t=e.sizes[e.size];return t!==void 0?t:e.size||e.sizes.md}function Tde(e){return t=>`@media (min-width: ${ZN({size:t,sizes:e.breakpoints})}px)`}function Sde(e){return t=>`@media (max-width: ${ZN({size:t,sizes:e.breakpoints})-1}px)`}function Ide(e){return/^#?([0-9A-F]{3}){1,2}$/i.test(e)}function xde(e){let t=e.replace("#","");if(t.length===3){const o=t.split("");t=[o[0],o[0],o[1],o[1],o[2],o[2]].join("")}const n=parseInt(t,16),r=n>>16&255,i=n>>8&255,s=n&255;return{r,g:i,b:s,a:1}}function Cde(e){const[t,n,r,i]=e.replace(/[^0-9,.]/g,"").split(",").map(Number);return{r:t,g:n,b:r,a:i||1}}function ek(e){return Ide(e)?xde(e):e.startsWith("rgb")?Cde(e):{r:0,g:0,b:0,a:1}}function Ah(e,t){if(typeof e!="string"||t>1||t<0)return"rgba(0, 0, 0, 1)";const{r:n,g:r,b:i}=ek(e);return`rgba(${n}, ${r}, ${i}, ${t})`}function Ade(e=0){return{position:"absolute",top:e,right:e,left:e,bottom:e}}function Ode(e,t){const{r:n,g:r,b:i,a:s}=ek(e),o=1-t,a=u=>Math.round(u*o);return`rgba(${a(n)}, ${a(r)}, ${a(i)}, ${s})`}function Pde(e,t){const{r:n,g:r,b:i,a:s}=ek(e),o=a=>Math.round(a+(255-a)*t);return`rgba(${o(n)}, ${o(r)}, ${o(i)}, ${s})`}function Rde(e){return t=>{if(typeof t=="number")return t;const n=typeof e.defaultRadius=="number"?e.defaultRadius:e.radius[e.defaultRadius]||e.defaultRadius;return e.radius[t]||t||n}}function Nde(e,t){if(typeof e=="string"&&e.includes(".")){const[n,r]=e.split("."),i=parseInt(r,10);if(n in t.colors&&i>=0&&i<10)return{isSplittedColor:!0,key:n,shade:i}}return{isSplittedColor:!1}}function kde(e){const t=JN(e),n=E_(e),r=yW(e);return({variant:i,color:s,gradient:o,primaryFallback:a})=>{const u=Nde(s,e);switch(i){case"light":return{border:"transparent",background:Ah(t(s,e.colorScheme==="dark"?8:0,a,!1),e.colorScheme==="dark"?.2:1),color:s==="dark"?e.colorScheme==="dark"?e.colors.dark[0]:e.colors.dark[9]:t(s,e.colorScheme==="dark"?2:n("light")),hover:Ah(t(s,e.colorScheme==="dark"?7:1,a,!1),e.colorScheme==="dark"?.25:.65)};case"subtle":return{border:"transparent",background:"transparent",color:s==="dark"?e.colorScheme==="dark"?e.colors.dark[0]:e.colors.dark[9]:t(s,e.colorScheme==="dark"?2:n("light")),hover:Ah(t(s,e.colorScheme==="dark"?8:0,a,!1),e.colorScheme==="dark"?.2:1)};case"outline":return{border:t(s,e.colorScheme==="dark"?5:n("light")),background:"transparent",color:t(s,e.colorScheme==="dark"?5:n("light")),hover:e.colorScheme==="dark"?Ah(t(s,5,a,!1),.05):Ah(t(s,0,a,!1),.35)};case"default":return{border:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4],background:e.colorScheme==="dark"?e.colors.dark[6]:e.white,color:e.colorScheme==="dark"?e.white:e.black,hover:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[0]};case"white":return{border:"transparent",background:e.white,color:t(s,n()),hover:null};case"transparent":return{border:"transparent",color:s==="dark"?e.colorScheme==="dark"?e.colors.dark[0]:e.colors.dark[9]:t(s,e.colorScheme==="dark"?2:n("light")),background:"transparent",hover:null};case"gradient":return{background:r(o),color:e.white,border:"transparent",hover:null};default:{const l=n(),c=u.isSplittedColor?u.shade:l,f=u.isSplittedColor?u.key:s;return{border:"transparent",background:t(f,c,a),color:e.white,hover:t(f,c===9?8:c+1)}}}}}function Dde(e){return t=>{const n=E_(e)(t);return e.colors[e.primaryColor][n]}}function $de(e){return{"@media (hover: hover)":{"&:hover":e},"@media (hover: none)":{"&:active":e}}}const si={fontStyles:gde,themeColor:JN,focusStyles:bde,linearGradient:Ede,radialGradient:wde,smallerThan:Sde,largerThan:Tde,rgba:Ah,size:ZN,cover:Ade,darken:Ode,lighten:Pde,radius:Rde,variant:kde,primaryShade:E_,hover:$de,gradient:yW,primaryColor:Dde};var Lde=Object.defineProperty,Mde=Object.defineProperties,Fde=Object.getOwnPropertyDescriptors,$M=Object.getOwnPropertySymbols,Bde=Object.prototype.hasOwnProperty,jde=Object.prototype.propertyIsEnumerable,LM=(e,t,n)=>t in e?Lde(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ude=(e,t)=>{for(var n in t||(t={}))Bde.call(t,n)&&LM(e,n,t[n]);if($M)for(var n of $M(t))jde.call(t,n)&&LM(e,n,t[n]);return e},Vde=(e,t)=>Mde(e,Fde(t));function zde(e){return Vde(Ude({},e),{fn:{fontStyles:si.fontStyles(e),themeColor:si.themeColor(e),focusStyles:si.focusStyles(e),largerThan:si.largerThan(e),smallerThan:si.smallerThan(e),radialGradient:si.radialGradient,linearGradient:si.linearGradient,gradient:si.gradient(e),rgba:si.rgba,size:si.size,cover:si.cover,lighten:si.lighten,darken:si.darken,primaryShade:si.primaryShade(e),radius:si.radius(e),variant:si.variant(e),hover:si.hover,primaryColor:si.primaryColor(e)}})}const Hde=["xs","sm","md","lg","xl"],Wde={dir:"ltr",primaryShade:{light:6,dark:8},focusRing:"auto",loader:"oval",dateFormat:"MMMM D, YYYY",colorScheme:"light",white:"#fff",black:"#000",defaultRadius:"sm",transitionTimingFunction:"ease",colors:mde,lineHeight:1.55,fontFamily:"-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",fontFamilyMonospace:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace",primaryColor:"blue",respectReducedMotion:!0,cursorType:"default",defaultGradient:{from:"indigo",to:"cyan",deg:45},shadows:{xs:"0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1)",sm:"0 1px 3px rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0px 10px 15px -5px, rgba(0, 0, 0, 0.04) 0px 7px 7px -5px",md:"0 1px 3px rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0px 20px 25px -5px, rgba(0, 0, 0, 0.04) 0px 10px 10px -5px",lg:"0 1px 3px rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0px 28px 23px -7px, rgba(0, 0, 0, 0.04) 0px 12px 12px -7px",xl:"0 1px 3px rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0px 36px 28px -7px, rgba(0, 0, 0, 0.04) 0px 17px 17px -7px"},fontSizes:{xs:12,sm:14,md:16,lg:18,xl:20},radius:{xs:2,sm:4,md:8,lg:16,xl:32},spacing:{xs:10,sm:12,md:16,lg:20,xl:24},breakpoints:{xs:576,sm:768,md:992,lg:1200,xl:1400},headings:{fontFamily:"-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",fontWeight:700,sizes:{h1:{fontSize:34,lineHeight:1.3,fontWeight:void 0},h2:{fontSize:26,lineHeight:1.35,fontWeight:void 0},h3:{fontSize:22,lineHeight:1.4,fontWeight:void 0},h4:{fontSize:18,lineHeight:1.45,fontWeight:void 0},h5:{fontSize:16,lineHeight:1.5,fontWeight:void 0},h6:{fontSize:14,lineHeight:1.5,fontWeight:void 0}}},other:{},components:{},activeStyles:{transform:"translateY(1px)"},datesLocale:"en",globalStyles:void 0,focusRingStyles:{styles:e=>({outlineOffset:2,outline:`2px solid ${e.colors[e.primaryColor][e.colorScheme==="dark"?7:5]}`}),resetStyles:()=>({outline:"none"}),inputStyles:e=>({outline:"none",borderColor:e.colors[e.primaryColor][typeof e.primaryShade=="object"?e.primaryShade[e.colorScheme]:e.primaryShade]})}},_W=zde(Wde);function qde(e){if(e.sheet)return e.sheet;for(var t=0;t0?Ci($m,--js):0,Yp--,jr===10&&(Yp=1,RS--),jr}function co(){return jr=js2||Ey(jr)>3?"":" "}function ihe(e,t){for(;--t&&co()&&!(jr<48||jr>102||jr>57&&jr<65||jr>70&&jr<97););return w_(e,X1()+(t<6&&gu()==32&&co()==32))}function OP(e){for(;co();)switch(jr){case e:return js;case 34:case 39:e!==34&&e!==39&&OP(jr);break;case 40:e===41&&OP(e);break;case 92:co();break}return js}function she(e,t){for(;co()&&e+jr!==57;)if(e+jr===84&&gu()===47)break;return"/*"+w_(t,js-1)+"*"+PS(e===47?e:co())}function ohe(e){for(;!Ey(gu());)co();return w_(e,js)}function ahe(e){return SW(Z1("",null,null,null,[""],e=TW(e),0,[0],e))}function Z1(e,t,n,r,i,s,o,a,u){for(var l=0,c=0,f=o,d=0,h=0,p=0,m=1,y=1,g=1,_=0,b="",T=i,I=s,E=r,S=b;y;)switch(p=_,_=co()){case 40:if(p!=108&&Ci(S,f-1)==58){AP(S+=Cn(J1(_),"&","&\f"),"&\f")!=-1&&(g=-1);break}case 34:case 39:case 91:S+=J1(_);break;case 9:case 10:case 13:case 32:S+=rhe(p);break;case 92:S+=ihe(X1()-1,7);continue;case 47:switch(gu()){case 42:case 47:Fv(uhe(she(co(),X1()),t,n),u);break;default:S+="/"}break;case 123*m:a[l++]=Ka(S)*g;case 125*m:case 59:case 0:switch(_){case 0:case 125:y=0;case 59+c:h>0&&Ka(S)-f&&Fv(h>32?FM(S+";",r,n,f-1):FM(Cn(S," ","")+";",r,n,f-2),u);break;case 59:S+=";";default:if(Fv(E=MM(S,t,n,l,c,i,a,b,T=[],I=[],f),s),_===123)if(c===0)Z1(S,t,E,E,T,s,f,a,I);else switch(d===99&&Ci(S,3)===110?100:d){case 100:case 109:case 115:Z1(e,E,E,r&&Fv(MM(e,E,E,0,0,i,a,b,i,T=[],f),I),i,I,f,a,r?T:I);break;default:Z1(S,E,E,E,[""],I,0,a,I)}}l=c=h=0,m=g=1,b=S="",f=o;break;case 58:f=1+Ka(S),h=p;default:if(m<1){if(_==123)--m;else if(_==125&&m++==0&&nhe()==125)continue}switch(S+=PS(_),_*m){case 38:g=c>0?1:(S+="\f",-1);break;case 44:a[l++]=(Ka(S)-1)*g,g=1;break;case 64:gu()===45&&(S+=J1(co())),d=gu(),c=f=Ka(b=S+=ohe(X1())),_++;break;case 45:p===45&&Ka(S)==2&&(m=0)}}return s}function MM(e,t,n,r,i,s,o,a,u,l,c){for(var f=i-1,d=i===0?s:[""],h=rk(d),p=0,m=0,y=0;p0?d[g]+" "+_:Cn(_,/&\f/g,d[g])))&&(u[y++]=b);return NS(e,t,n,i===0?tk:a,u,l,c)}function uhe(e,t,n){return NS(e,t,n,vW,PS(the()),by(e,2,-2),0)}function FM(e,t,n,r){return NS(e,t,n,nk,by(e,0,r),by(e,r+1,-1),r)}function mp(e,t){for(var n="",r=rk(e),i=0;i6)switch(Ci(e,t+1)){case 109:if(Ci(e,t+4)!==45)break;case 102:return Cn(e,/(.+:)(.+)-([^]+)/,"$1"+Tn+"$2-$3$1"+nE+(Ci(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~AP(e,"stretch")?IW(Cn(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Ci(e,t+1)!==115)break;case 6444:switch(Ci(e,Ka(e)-3-(~AP(e,"!important")&&10))){case 107:return Cn(e,":",":"+Tn)+e;case 101:return Cn(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Tn+(Ci(e,14)===45?"inline-":"")+"box$3$1"+Tn+"$2$3$1"+Vi+"$2box$3")+e}break;case 5936:switch(Ci(e,t+11)){case 114:return Tn+e+Vi+Cn(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Tn+e+Vi+Cn(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Tn+e+Vi+Cn(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Tn+e+Vi+e+e}return e}var _he=function(t,n,r,i){if(t.length>-1&&!t.return)switch(t.type){case nk:t.return=IW(t.value,t.length);break;case bW:return mp([Ig(t,{value:Cn(t.value,"@","@"+Tn)})],i);case tk:if(t.length)return ehe(t.props,function(s){switch(Zde(s,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return mp([Ig(t,{props:[Cn(s,/:(read-\w+)/,":"+nE+"$1")]})],i);case"::placeholder":return mp([Ig(t,{props:[Cn(s,/:(plac\w+)/,":"+Tn+"input-$1")]}),Ig(t,{props:[Cn(s,/:(plac\w+)/,":"+nE+"$1")]}),Ig(t,{props:[Cn(s,/:(plac\w+)/,Vi+"input-$1")]})],i)}return""})}},vhe=[_he],bhe=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(m){var y=m.getAttribute("data-emotion");y.indexOf(" ")!==-1&&(document.head.appendChild(m),m.setAttribute("data-s",""))})}var i=t.stylisPlugins||vhe,s={},o,a=[];o=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(m){for(var y=m.getAttribute("data-emotion").split(" "),g=1;g{let r=e[n];return t.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function rde(e,t){let n=CP(e);if(t)for(let r of t.keys())n.has(r)||t.getAll(r).forEach(i=>{n.append(r,i)});return n}function ide(e){let{basename:t,children:n,window:r}=e,i=w.useRef();i.current==null&&(i.current=sfe({window:r,v5Compat:!0}));let s=i.current,[o,a]=w.useState({action:s.action,location:s.location});return w.useLayoutEffect(()=>s.listen(a),[s]),w.createElement(tde,{basename:t,children:n,location:o.location,navigationType:o.action,navigator:s})}var PM;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmitImpl="useSubmitImpl",e.UseFetcher="useFetcher"})(PM||(PM={}));var RM;(function(e){e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(RM||(RM={}));function QN(e){let t=w.useRef(CP(e)),n=w.useRef(!1),r=km(),i=w.useMemo(()=>rde(r.search,n.current?null:t.current),[r.search]),s=Qd(),o=w.useCallback((a,u)=>{const l=CP(typeof a=="function"?a(i):a);n.current=!0,s("?"+l,u)},[s,i]);return[i,o]}function tE(e,t){let n=e;for(;(n=n.parentElement)&&!n.matches(t););return n}function sde(e,t,n){for(let r=e-1;r>=0;r-=1)if(!t[r].disabled)return r;if(n){for(let r=t.length-1;r>-1;r-=1)if(!t[r].disabled)return r}return e}function ode(e,t,n){for(let r=e+1;r{var u;n==null||n(a);const l=Array.from(((u=tE(a.currentTarget,e))==null?void 0:u.querySelectorAll(t))||[]).filter(m=>ade(a.currentTarget,m,e)),c=l.findIndex(m=>a.currentTarget===m),f=ode(c,l,r),d=sde(c,l,r),h=s==="rtl"?d:f,p=s==="rtl"?f:d;switch(a.key){case"ArrowRight":{o==="horizontal"&&(a.stopPropagation(),a.preventDefault(),l[h].focus(),i&&l[h].click());break}case"ArrowLeft":{o==="horizontal"&&(a.stopPropagation(),a.preventDefault(),l[p].focus(),i&&l[p].click());break}case"ArrowUp":{o==="vertical"&&(a.stopPropagation(),a.preventDefault(),l[d].focus(),i&&l[d].click());break}case"ArrowDown":{o==="vertical"&&(a.stopPropagation(),a.preventDefault(),l[f].focus(),i&&l[f].click());break}case"Home":{a.stopPropagation(),a.preventDefault(),!l[0].disabled&&l[0].focus();break}case"End":{a.stopPropagation(),a.preventDefault();const m=l.length-1;!l[m].disabled&&l[m].focus();break}}}}function lde(e,t,n){var r;return n?Array.from(((r=tE(n,t))==null?void 0:r.querySelectorAll(e))||[]).findIndex(i=>i===n):null}function XN(e){const t=w.createContext(null);return[({children:i,value:s})=>k.createElement(t.Provider,{value:s},i),()=>{const i=w.useContext(t);if(i===null)throw new Error(e);return i}]}function Rd(e){return Array.isArray(e)?e:[e]}const cde=()=>{};function fde(e,t={active:!0}){return typeof e!="function"||!t.active?t.onKeyDown||cde:n=>{var r;n.key==="Escape"&&(e(n),(r=t.onTrigger)==null||r.call(t))}}function oo(e,t){return n=>{e==null||e(n),t==null||t(n)}}function dde(e){return Object.keys(e)}function hde(){const[e,t]=w.useState(-1);return[e,{setHovered:t,resetHovered:()=>t(-1)}]}function hW({data:e}){const t=[],n=[],r=e.reduce((i,s,o)=>(s.group?i[s.group]?i[s.group].push(o):i[s.group]=[o]:n.push(o),i),{});return Object.keys(r).forEach(i=>{t.push(...r[i].map(s=>e[s]))}),t.push(...n.map(i=>e[i])),t}function Dm(e){return Array.isArray(e)||e===null?!1:typeof e=="object"?e.type!==k.Fragment:!1}function pW(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t({fontFamily:e.fontFamily||"sans-serif"})}var gde=Object.defineProperty,NM=Object.getOwnPropertySymbols,yde=Object.prototype.hasOwnProperty,_de=Object.prototype.propertyIsEnumerable,kM=(e,t,n)=>t in e?gde(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,DM=(e,t)=>{for(var n in t||(t={}))yde.call(t,n)&&kM(e,n,t[n]);if(NM)for(var n of NM(t))_de.call(t,n)&&kM(e,n,t[n]);return e};function vde(e){return t=>({WebkitTapHighlightColor:"transparent",[t||"&:focus"]:DM({},e.focusRing==="always"||e.focusRing==="auto"?e.focusRingStyles.styles(e):e.focusRingStyles.resetStyles(e)),[t?t.replace(":focus",":focus:not(:focus-visible)"):"&:focus:not(:focus-visible)"]:DM({},e.focusRing==="auto"||e.focusRing==="never"?e.focusRingStyles.resetStyles(e):null)})}function E_(e){return t=>typeof e.primaryShade=="number"?e.primaryShade:e.primaryShade[t||e.colorScheme]}function JN(e){const t=E_(e);return(n,r,i=!0,s=!0)=>{if(typeof n=="string"&&n.includes(".")){const[a,u]=n.split("."),l=parseInt(u,10);if(a in e.colors&&l>=0&&l<10)return e.colors[a][typeof r=="number"&&!s?r:l]}const o=typeof r=="number"?r:t();return n in e.colors?e.colors[n][o]:i?e.colors[e.primaryColor][o]:n}}function gW(e){let t="";for(let n=1;n{const i={from:(r==null?void 0:r.from)||e.defaultGradient.from,to:(r==null?void 0:r.to)||e.defaultGradient.to,deg:(r==null?void 0:r.deg)||e.defaultGradient.deg};return`linear-gradient(${i.deg}deg, ${t(i.from,n(),!1)} 0%, ${t(i.to,n(),!1)} 100%)`}}function ZN(e){if(typeof e.size=="number")return e.size;const t=e.sizes[e.size];return t!==void 0?t:e.size||e.sizes.md}function wde(e){return t=>`@media (min-width: ${ZN({size:t,sizes:e.breakpoints})}px)`}function Tde(e){return t=>`@media (max-width: ${ZN({size:t,sizes:e.breakpoints})-1}px)`}function Sde(e){return/^#?([0-9A-F]{3}){1,2}$/i.test(e)}function Ide(e){let t=e.replace("#","");if(t.length===3){const o=t.split("");t=[o[0],o[0],o[1],o[1],o[2],o[2]].join("")}const n=parseInt(t,16),r=n>>16&255,i=n>>8&255,s=n&255;return{r,g:i,b:s,a:1}}function xde(e){const[t,n,r,i]=e.replace(/[^0-9,.]/g,"").split(",").map(Number);return{r:t,g:n,b:r,a:i||1}}function ek(e){return Sde(e)?Ide(e):e.startsWith("rgb")?xde(e):{r:0,g:0,b:0,a:1}}function Ah(e,t){if(typeof e!="string"||t>1||t<0)return"rgba(0, 0, 0, 1)";const{r:n,g:r,b:i}=ek(e);return`rgba(${n}, ${r}, ${i}, ${t})`}function Cde(e=0){return{position:"absolute",top:e,right:e,left:e,bottom:e}}function Ade(e,t){const{r:n,g:r,b:i,a:s}=ek(e),o=1-t,a=u=>Math.round(u*o);return`rgba(${a(n)}, ${a(r)}, ${a(i)}, ${s})`}function Ode(e,t){const{r:n,g:r,b:i,a:s}=ek(e),o=a=>Math.round(a+(255-a)*t);return`rgba(${o(n)}, ${o(r)}, ${o(i)}, ${s})`}function Pde(e){return t=>{if(typeof t=="number")return t;const n=typeof e.defaultRadius=="number"?e.defaultRadius:e.radius[e.defaultRadius]||e.defaultRadius;return e.radius[t]||t||n}}function Rde(e,t){if(typeof e=="string"&&e.includes(".")){const[n,r]=e.split("."),i=parseInt(r,10);if(n in t.colors&&i>=0&&i<10)return{isSplittedColor:!0,key:n,shade:i}}return{isSplittedColor:!1}}function Nde(e){const t=JN(e),n=E_(e),r=yW(e);return({variant:i,color:s,gradient:o,primaryFallback:a})=>{const u=Rde(s,e);switch(i){case"light":return{border:"transparent",background:Ah(t(s,e.colorScheme==="dark"?8:0,a,!1),e.colorScheme==="dark"?.2:1),color:s==="dark"?e.colorScheme==="dark"?e.colors.dark[0]:e.colors.dark[9]:t(s,e.colorScheme==="dark"?2:n("light")),hover:Ah(t(s,e.colorScheme==="dark"?7:1,a,!1),e.colorScheme==="dark"?.25:.65)};case"subtle":return{border:"transparent",background:"transparent",color:s==="dark"?e.colorScheme==="dark"?e.colors.dark[0]:e.colors.dark[9]:t(s,e.colorScheme==="dark"?2:n("light")),hover:Ah(t(s,e.colorScheme==="dark"?8:0,a,!1),e.colorScheme==="dark"?.2:1)};case"outline":return{border:t(s,e.colorScheme==="dark"?5:n("light")),background:"transparent",color:t(s,e.colorScheme==="dark"?5:n("light")),hover:e.colorScheme==="dark"?Ah(t(s,5,a,!1),.05):Ah(t(s,0,a,!1),.35)};case"default":return{border:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4],background:e.colorScheme==="dark"?e.colors.dark[6]:e.white,color:e.colorScheme==="dark"?e.white:e.black,hover:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[0]};case"white":return{border:"transparent",background:e.white,color:t(s,n()),hover:null};case"transparent":return{border:"transparent",color:s==="dark"?e.colorScheme==="dark"?e.colors.dark[0]:e.colors.dark[9]:t(s,e.colorScheme==="dark"?2:n("light")),background:"transparent",hover:null};case"gradient":return{background:r(o),color:e.white,border:"transparent",hover:null};default:{const l=n(),c=u.isSplittedColor?u.shade:l,f=u.isSplittedColor?u.key:s;return{border:"transparent",background:t(f,c,a),color:e.white,hover:t(f,c===9?8:c+1)}}}}}function kde(e){return t=>{const n=E_(e)(t);return e.colors[e.primaryColor][n]}}function Dde(e){return{"@media (hover: hover)":{"&:hover":e},"@media (hover: none)":{"&:active":e}}}const si={fontStyles:mde,themeColor:JN,focusStyles:vde,linearGradient:bde,radialGradient:Ede,smallerThan:Tde,largerThan:wde,rgba:Ah,size:ZN,cover:Cde,darken:Ade,lighten:Ode,radius:Pde,variant:Nde,primaryShade:E_,hover:Dde,gradient:yW,primaryColor:kde};var $de=Object.defineProperty,Lde=Object.defineProperties,Mde=Object.getOwnPropertyDescriptors,$M=Object.getOwnPropertySymbols,Fde=Object.prototype.hasOwnProperty,Bde=Object.prototype.propertyIsEnumerable,LM=(e,t,n)=>t in e?$de(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,jde=(e,t)=>{for(var n in t||(t={}))Fde.call(t,n)&&LM(e,n,t[n]);if($M)for(var n of $M(t))Bde.call(t,n)&&LM(e,n,t[n]);return e},Ude=(e,t)=>Lde(e,Mde(t));function Vde(e){return Ude(jde({},e),{fn:{fontStyles:si.fontStyles(e),themeColor:si.themeColor(e),focusStyles:si.focusStyles(e),largerThan:si.largerThan(e),smallerThan:si.smallerThan(e),radialGradient:si.radialGradient,linearGradient:si.linearGradient,gradient:si.gradient(e),rgba:si.rgba,size:si.size,cover:si.cover,lighten:si.lighten,darken:si.darken,primaryShade:si.primaryShade(e),radius:si.radius(e),variant:si.variant(e),hover:si.hover,primaryColor:si.primaryColor(e)}})}const zde=["xs","sm","md","lg","xl"],Hde={dir:"ltr",primaryShade:{light:6,dark:8},focusRing:"auto",loader:"oval",dateFormat:"MMMM D, YYYY",colorScheme:"light",white:"#fff",black:"#000",defaultRadius:"sm",transitionTimingFunction:"ease",colors:pde,lineHeight:1.55,fontFamily:"-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",fontFamilyMonospace:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace",primaryColor:"blue",respectReducedMotion:!0,cursorType:"default",defaultGradient:{from:"indigo",to:"cyan",deg:45},shadows:{xs:"0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1)",sm:"0 1px 3px rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0px 10px 15px -5px, rgba(0, 0, 0, 0.04) 0px 7px 7px -5px",md:"0 1px 3px rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0px 20px 25px -5px, rgba(0, 0, 0, 0.04) 0px 10px 10px -5px",lg:"0 1px 3px rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0px 28px 23px -7px, rgba(0, 0, 0, 0.04) 0px 12px 12px -7px",xl:"0 1px 3px rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0px 36px 28px -7px, rgba(0, 0, 0, 0.04) 0px 17px 17px -7px"},fontSizes:{xs:12,sm:14,md:16,lg:18,xl:20},radius:{xs:2,sm:4,md:8,lg:16,xl:32},spacing:{xs:10,sm:12,md:16,lg:20,xl:24},breakpoints:{xs:576,sm:768,md:992,lg:1200,xl:1400},headings:{fontFamily:"-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",fontWeight:700,sizes:{h1:{fontSize:34,lineHeight:1.3,fontWeight:void 0},h2:{fontSize:26,lineHeight:1.35,fontWeight:void 0},h3:{fontSize:22,lineHeight:1.4,fontWeight:void 0},h4:{fontSize:18,lineHeight:1.45,fontWeight:void 0},h5:{fontSize:16,lineHeight:1.5,fontWeight:void 0},h6:{fontSize:14,lineHeight:1.5,fontWeight:void 0}}},other:{},components:{},activeStyles:{transform:"translateY(1px)"},datesLocale:"en",globalStyles:void 0,focusRingStyles:{styles:e=>({outlineOffset:2,outline:`2px solid ${e.colors[e.primaryColor][e.colorScheme==="dark"?7:5]}`}),resetStyles:()=>({outline:"none"}),inputStyles:e=>({outline:"none",borderColor:e.colors[e.primaryColor][typeof e.primaryShade=="object"?e.primaryShade[e.colorScheme]:e.primaryShade]})}},_W=Vde(Hde);function Wde(e){if(e.sheet)return e.sheet;for(var t=0;t0?Ci($m,--js):0,Yp--,jr===10&&(Yp=1,RS--),jr}function co(){return jr=js2||Ey(jr)>3?"":" "}function rhe(e,t){for(;--t&&co()&&!(jr<48||jr>102||jr>57&&jr<65||jr>70&&jr<97););return w_(e,X1()+(t<6&&gu()==32&&co()==32))}function OP(e){for(;co();)switch(jr){case e:return js;case 34:case 39:e!==34&&e!==39&&OP(jr);break;case 40:e===41&&OP(e);break;case 92:co();break}return js}function ihe(e,t){for(;co()&&e+jr!==57;)if(e+jr===84&&gu()===47)break;return"/*"+w_(t,js-1)+"*"+PS(e===47?e:co())}function she(e){for(;!Ey(gu());)co();return w_(e,js)}function ohe(e){return SW(Z1("",null,null,null,[""],e=TW(e),0,[0],e))}function Z1(e,t,n,r,i,s,o,a,u){for(var l=0,c=0,f=o,d=0,h=0,p=0,m=1,y=1,g=1,_=0,b="",T=i,I=s,E=r,S=b;y;)switch(p=_,_=co()){case 40:if(p!=108&&Ci(S,f-1)==58){AP(S+=Cn(J1(_),"&","&\f"),"&\f")!=-1&&(g=-1);break}case 34:case 39:case 91:S+=J1(_);break;case 9:case 10:case 13:case 32:S+=nhe(p);break;case 92:S+=rhe(X1()-1,7);continue;case 47:switch(gu()){case 42:case 47:Fv(ahe(ihe(co(),X1()),t,n),u);break;default:S+="/"}break;case 123*m:a[l++]=Ka(S)*g;case 125*m:case 59:case 0:switch(_){case 0:case 125:y=0;case 59+c:h>0&&Ka(S)-f&&Fv(h>32?FM(S+";",r,n,f-1):FM(Cn(S," ","")+";",r,n,f-2),u);break;case 59:S+=";";default:if(Fv(E=MM(S,t,n,l,c,i,a,b,T=[],I=[],f),s),_===123)if(c===0)Z1(S,t,E,E,T,s,f,a,I);else switch(d===99&&Ci(S,3)===110?100:d){case 100:case 109:case 115:Z1(e,E,E,r&&Fv(MM(e,E,E,0,0,i,a,b,i,T=[],f),I),i,I,f,a,r?T:I);break;default:Z1(S,E,E,E,[""],I,0,a,I)}}l=c=h=0,m=g=1,b=S="",f=o;break;case 58:f=1+Ka(S),h=p;default:if(m<1){if(_==123)--m;else if(_==125&&m++==0&&the()==125)continue}switch(S+=PS(_),_*m){case 38:g=c>0?1:(S+="\f",-1);break;case 44:a[l++]=(Ka(S)-1)*g,g=1;break;case 64:gu()===45&&(S+=J1(co())),d=gu(),c=f=Ka(b=S+=she(X1())),_++;break;case 45:p===45&&Ka(S)==2&&(m=0)}}return s}function MM(e,t,n,r,i,s,o,a,u,l,c){for(var f=i-1,d=i===0?s:[""],h=rk(d),p=0,m=0,y=0;p0?d[g]+" "+_:Cn(_,/&\f/g,d[g])))&&(u[y++]=b);return NS(e,t,n,i===0?tk:a,u,l,c)}function ahe(e,t,n){return NS(e,t,n,vW,PS(ehe()),by(e,2,-2),0)}function FM(e,t,n,r){return NS(e,t,n,nk,by(e,0,r),by(e,r+1,-1),r)}function mp(e,t){for(var n="",r=rk(e),i=0;i6)switch(Ci(e,t+1)){case 109:if(Ci(e,t+4)!==45)break;case 102:return Cn(e,/(.+:)(.+)-([^]+)/,"$1"+Tn+"$2-$3$1"+nE+(Ci(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~AP(e,"stretch")?IW(Cn(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Ci(e,t+1)!==115)break;case 6444:switch(Ci(e,Ka(e)-3-(~AP(e,"!important")&&10))){case 107:return Cn(e,":",":"+Tn)+e;case 101:return Cn(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Tn+(Ci(e,14)===45?"inline-":"")+"box$3$1"+Tn+"$2$3$1"+Vi+"$2box$3")+e}break;case 5936:switch(Ci(e,t+11)){case 114:return Tn+e+Vi+Cn(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Tn+e+Vi+Cn(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Tn+e+Vi+Cn(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Tn+e+Vi+e+e}return e}var yhe=function(t,n,r,i){if(t.length>-1&&!t.return)switch(t.type){case nk:t.return=IW(t.value,t.length);break;case bW:return mp([Ig(t,{value:Cn(t.value,"@","@"+Tn)})],i);case tk:if(t.length)return Zde(t.props,function(s){switch(Jde(s,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return mp([Ig(t,{props:[Cn(s,/:(read-\w+)/,":"+nE+"$1")]})],i);case"::placeholder":return mp([Ig(t,{props:[Cn(s,/:(plac\w+)/,":"+Tn+"input-$1")]}),Ig(t,{props:[Cn(s,/:(plac\w+)/,":"+nE+"$1")]}),Ig(t,{props:[Cn(s,/:(plac\w+)/,Vi+"input-$1")]})],i)}return""})}},_he=[yhe],vhe=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(m){var y=m.getAttribute("data-emotion");y.indexOf(" ")!==-1&&(document.head.appendChild(m),m.setAttribute("data-s",""))})}var i=t.stylisPlugins||_he,s={},o,a=[];o=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(m){for(var y=m.getAttribute("data-emotion").split(" "),g=1;g=4;++r,i-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var khe={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Dhe=/[A-Z]|^ms/g,$he=/_EMO_([^_]+?)_([^]*?)_EMO_/g,NW=function(t){return t.charCodeAt(1)===45},jM=function(t){return t!=null&&typeof t!="boolean"},SC=dhe(function(e){return NW(e)?e:e.replace(Dhe,"-$&").toLowerCase()}),UM=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace($he,function(r,i,s){return Qa={name:i,styles:s,next:Qa},i})}return khe[t]!==1&&!NW(t)&&typeof n=="number"&&n!==0?n+"px":n};function wy(e,t,n){if(n==null)return"";if(n.__emotion_styles!==void 0)return n;switch(typeof n){case"boolean":return"";case"object":{if(n.anim===1)return Qa={name:n.name,styles:n.styles,next:Qa},n.name;if(n.styles!==void 0){var r=n.next;if(r!==void 0)for(;r!==void 0;)Qa={name:r.name,styles:r.styles,next:Qa},r=r.next;var i=n.styles+";";return i}return Lhe(e,t,n)}case"function":{if(e!==void 0){var s=Qa,o=n(e);return Qa=s,wy(e,t,o)}break}}if(t==null)return n;var a=t[n];return a!==void 0?a:n}function Lhe(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i(e[n]!==void 0&&(t[n]=e[n]),t),{})}var Vhe=Object.defineProperty,HM=Object.getOwnPropertySymbols,zhe=Object.prototype.hasOwnProperty,Hhe=Object.prototype.propertyIsEnumerable,WM=(e,t,n)=>t in e?Vhe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,IC=(e,t)=>{for(var n in t||(t={}))zhe.call(t,n)&&WM(e,n,t[n]);if(HM)for(var n of HM(t))Hhe.call(t,n)&&WM(e,n,t[n]);return e};const LW=w.createContext({theme:_W});function ts(){var e;return((e=w.useContext(LW))==null?void 0:e.theme)||_W}function Whe(e){const t=ts(),n=r=>{var i,s;return{styles:((i=t.components[r])==null?void 0:i.styles)||{},classNames:((s=t.components[r])==null?void 0:s.classNames)||{}}};return Array.isArray(e)?e.map(n):[n(e)]}function MW(){var e;return(e=w.useContext(LW))==null?void 0:e.emotionCache}function ct(e,t,n){var r;const s=(r=ts().components[e])==null?void 0:r.defaultProps;return IC(IC(IC({},t),s),$W(n))}const FW=w.createContext({classNames:{},styles:{},unstyled:!1});function BW({children:e,classNames:t,unstyled:n,styles:r,staticSelector:i}){return k.createElement(FW.Provider,{value:{classNames:t,styles:r,unstyled:n,staticSelector:i}},e)}function T_(){return w.useContext(FW)}const qhe={app:100,modal:200,popover:300,overlay:400,max:9999};function To(e){return qhe[e]}function Yhe(e,t){const n=w.useRef();return(!n.current||t.length!==n.current.prevDeps.length||n.current.prevDeps.map((r,i)=>r===t[i]).indexOf(!1)>=0)&&(n.current={v:e(),prevDeps:[...t]}),n.current.v}const Ghe=xW({key:"mantine",prepend:!0});function Khe(){return MW()||Ghe}var Qhe=Object.defineProperty,qM=Object.getOwnPropertySymbols,Xhe=Object.prototype.hasOwnProperty,Jhe=Object.prototype.propertyIsEnumerable,YM=(e,t,n)=>t in e?Qhe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Zhe=(e,t)=>{for(var n in t||(t={}))Xhe.call(t,n)&&YM(e,n,t[n]);if(qM)for(var n of qM(t))Jhe.call(t,n)&&YM(e,n,t[n]);return e};const xC="ref";function epe(e){let t;if(e.length!==1)return{args:e,ref:t};const[n]=e;if(!(n instanceof Object))return{args:e,ref:t};if(!(xC in n))return{args:e,ref:t};t=n[xC];const r=Zhe({},n);return delete r[xC],{args:[r],ref:t}}const{cssFactory:tpe}=(()=>{function e(n,r,i){const s=[],o=Phe(n,s,i);return s.length<2?i:o+r(s)}function t(n){const{cache:r}=n,i=(...o)=>{const{ref:a,args:u}=epe(o),l=ak(u,r.registered);return RW(r,l,!1),`${r.key}-${l.name}${a===void 0?"":` ${a}`}`};return{css:i,cx:(...o)=>e(r.registered,i,mW(o))}}return{cssFactory:t}})();function jW(){const e=Khe();return Yhe(()=>tpe({cache:e}),[e])}function npe({cx:e,classes:t,context:n,classNames:r,name:i,cache:s}){const o=n.reduce((a,u)=>(Object.keys(u.classNames).forEach(l=>{typeof a[l]!="string"?a[l]=`${u.classNames[l]}`:a[l]=`${a[l]} ${u.classNames[l]}`}),a),{});return Object.keys(t).reduce((a,u)=>(a[u]=e(t[u],o[u],r!=null&&r[u],Array.isArray(i)?i.filter(Boolean).map(l=>`${(s==null?void 0:s.key)||"mantine"}-${l}-${u}`).join(" "):i?`${(s==null?void 0:s.key)||"mantine"}-${i}-${u}`:null),a),{})}var rpe=Object.defineProperty,GM=Object.getOwnPropertySymbols,ipe=Object.prototype.hasOwnProperty,spe=Object.prototype.propertyIsEnumerable,KM=(e,t,n)=>t in e?rpe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,CC=(e,t)=>{for(var n in t||(t={}))ipe.call(t,n)&&KM(e,n,t[n]);if(GM)for(var n of GM(t))spe.call(t,n)&&KM(e,n,t[n]);return e};function ope(e){return`__mantine-ref-${e||""}`}function QM(e,t,n){const r=i=>typeof i=="function"?i(t,n||{}):i||{};return Array.isArray(e)?e.map(i=>r(i.styles)).reduce((i,s)=>(Object.keys(s).forEach(o=>{i[o]?i[o]=CC(CC({},i[o]),s[o]):i[o]=CC({},s[o])}),i),{}):r(e)}function at(e){const t=typeof e=="function"?e:()=>e;function n(r,i){const s=ts(),o=Whe(i==null?void 0:i.name),a=MW(),{css:u,cx:l}=jW(),c=t(s,r,ope),f=QM(i==null?void 0:i.styles,s,r),d=QM(o,s,r),h=Object.fromEntries(Object.keys(c).map(p=>{const m=l({[u(c[p])]:!(i!=null&&i.unstyled)},u(d[p]),u(f[p]));return[p,m]}));return{classes:npe({cx:l,classes:h,context:o,classNames:i==null?void 0:i.classNames,name:i==null?void 0:i.name,cache:a}),cx:l,theme:s}}return n}function UW({styles:e}){const t=ts();return k.createElement(jhe,{styles:DW(typeof e=="function"?e(t):e)})}var ape=Object.defineProperty,upe=Object.defineProperties,lpe=Object.getOwnPropertyDescriptors,XM=Object.getOwnPropertySymbols,cpe=Object.prototype.hasOwnProperty,fpe=Object.prototype.propertyIsEnumerable,JM=(e,t,n)=>t in e?ape(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,xg=(e,t)=>{for(var n in t||(t={}))cpe.call(t,n)&&JM(e,n,t[n]);if(XM)for(var n of XM(t))fpe.call(t,n)&&JM(e,n,t[n]);return e},Cg=(e,t)=>upe(e,lpe(t));const Ag={in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:"scale(.9) translateY(10px)"},transitionProperty:"transform, opacity"},Bv={fade:{in:{opacity:1},out:{opacity:0},transitionProperty:"opacity"},scale:{in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:"scale(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-y":{in:{opacity:1,transform:"scaleY(1)"},out:{opacity:0,transform:"scaleY(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-x":{in:{opacity:1,transform:"scaleX(1)"},out:{opacity:0,transform:"scaleX(0)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"skew-up":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:"translateY(-20px) skew(-10deg, -5deg)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"skew-down":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:"translateY(20px) skew(-10deg, -5deg)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-left":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:"translateY(20px) rotate(-5deg)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-right":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:"translateY(20px) rotate(5deg)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-down":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(-100%)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-up":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(100%)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"slide-left":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(100%)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"slide-right":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(-100%)"},common:{transformOrigin:"right"},transitionProperty:"transform, opacity"},pop:Cg(xg({},Ag),{common:{transformOrigin:"center center"}}),"pop-bottom-left":Cg(xg({},Ag),{common:{transformOrigin:"bottom left"}}),"pop-bottom-right":Cg(xg({},Ag),{common:{transformOrigin:"bottom right"}}),"pop-top-left":Cg(xg({},Ag),{common:{transformOrigin:"top left"}}),"pop-top-right":Cg(xg({},Ag),{common:{transformOrigin:"top right"}})},ZM=["mousedown","touchstart"];function dpe(e,t,n){const r=w.useRef();return w.useEffect(()=>{const i=s=>{const{target:o}=s??{};if(Array.isArray(n)){const a=(o==null?void 0:o.hasAttribute("data-ignore-outside-clicks"))||!document.body.contains(o);n.every(l=>!!l&&!l.contains(o))&&!a&&e()}else r.current&&!r.current.contains(o)&&e()};return(t||ZM).forEach(s=>document.addEventListener(s,i)),()=>{(t||ZM).forEach(s=>document.removeEventListener(s,i))}},[r,e,n]),r}function hpe(e,t){try{return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}catch{return e.addListener(t),()=>e.removeListener(t)}}function ppe(e,t){return typeof t=="boolean"?t:typeof window<"u"&&"matchMedia"in window?window.matchMedia(e).matches:!1}function mpe(e,t,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){const[r,i]=w.useState(n?!1:ppe(e,t)),s=w.useRef();return w.useEffect(()=>{if("matchMedia"in window)return s.current=window.matchMedia(e),i(s.current.matches),hpe(s.current,o=>i(o.matches))},[e]),r}function Mc(e,t,n){return Math.min(Math.max(e,t),n)}const uk=typeof document<"u"?w.useLayoutEffect:w.useEffect;function fo(e,t){const n=w.useRef(!1);w.useEffect(()=>()=>{n.current=!1},[]),w.useEffect(()=>{if(n.current)return e();n.current=!0},t)}function VW({opened:e,shouldReturnFocus:t=!0}){const n=w.useRef(),r=()=>{var i;n.current&&"focus"in n.current&&typeof n.current.focus=="function"&&((i=n.current)==null||i.focus({preventScroll:!0}))};return fo(()=>{let i=-1;const s=o=>{o.key==="Tab"&&window.clearTimeout(i)};return document.addEventListener("keydown",s),e?n.current=document.activeElement:t&&(i=window.setTimeout(r,10)),()=>{window.clearTimeout(i),document.removeEventListener("keydown",s)}},[e,t]),r}const gpe=/input|select|textarea|button|object/,zW="a, input, select, textarea, button, object, [tabindex]";function ype(e){return e.style.display==="none"}function _pe(e){if(e.getAttribute("aria-hidden")||e.getAttribute("hidden")||e.getAttribute("type")==="hidden")return!1;let n=e;for(;n&&n!==document.body;){if(ype(n))return!1;n=n.parentNode}return!0}function HW(e){let t=e.getAttribute("tabindex");return t===null&&(t=void 0),parseInt(t,10)}function PP(e){const t=e.nodeName.toLowerCase(),n=!Number.isNaN(HW(e));return(gpe.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||n)&&_pe(e)}function WW(e){const t=HW(e);return(Number.isNaN(t)||t>=0)&&PP(e)}function vpe(e){return Array.from(e.querySelectorAll(zW)).filter(WW)}function bpe(e,t){const n=vpe(e);if(!n.length){t.preventDefault();return}if(!(n[t.shiftKey?0:n.length-1]===document.activeElement||e===document.activeElement))return;t.preventDefault();const s=n[t.shiftKey?n.length-1:0];s&&s.focus()}function Epe(e,t="body > :not(script)"){const n=Array.from(document.querySelectorAll(t)).map(r=>{if(r.contains(e))return;const i=r.getAttribute("aria-hidden");return(i===null||i==="false")&&r.setAttribute("aria-hidden","true"),{node:r,ariaHidden:i}});return()=>{n.forEach(r=>{r&&(r.ariaHidden===null?r.node.removeAttribute("aria-hidden"):r.node.setAttribute("aria-hidden",r.ariaHidden))})}}function qW(e=!0){const t=w.useRef(),n=w.useRef(null),r=w.useCallback(i=>{if(e&&i!==null&&(n.current=Epe(i),t.current!==i))if(i){const s=()=>{let o=i.querySelector("[data-autofocus]");if(!o){const a=Array.from(i.querySelectorAll(zW));o=a.find(WW)||a.find(PP)||null,!o&&PP(i)&&(o=i)}o&&o.focus({preventScroll:!0})};setTimeout(()=>{i.ownerDocument&&s()}),t.current=i}else t.current=null},[e]);return w.useEffect(()=>{if(!e)return;const i=s=>{s.key==="Tab"&&t.current&&bpe(t.current,s)};return document.addEventListener("keydown",i),()=>{document.removeEventListener("keydown",i),n.current&&n.current()}},[e]),r}const wpe=()=>`mantine-${Math.random().toString(36).slice(2,11)}`,Tpe=k.useId||(()=>{});function Spe(){const[e,t]=w.useState("");return uk(()=>{t(wpe())},[]),e}function Ipe(){const e=Tpe();return e?`mantine-${e.replace(/:/g,"")}`:""}function Fu(e){return typeof e=="string"?e:Ipe()||Spe()}function RP(e,t,n){w.useEffect(()=>(window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)),[e,t])}function YW(e,t){typeof e=="function"?e(t):typeof e=="object"&&e!==null&&"current"in e&&(e.current=t)}function xpe(...e){return t=>{e.forEach(n=>YW(n,t))}}function Ko(...e){return w.useCallback(xpe(...e),e)}function GW(e,t,n="ltr"){const r=w.useRef(),i=w.useRef(!1),s=w.useRef(!1),o=w.useRef(0),[a,u]=w.useState(!1);return w.useEffect(()=>{i.current=!0},[]),w.useEffect(()=>{const l=({x:_,y:b})=>{cancelAnimationFrame(o.current),o.current=requestAnimationFrame(()=>{if(i.current&&r.current){r.current.style.userSelect="none";const T=r.current.getBoundingClientRect();if(T.width&&T.height){const I=Mc((_-T.left)/T.width,0,1);e({x:n==="ltr"?I:1-I,y:Mc((b-T.top)/T.height,0,1)})}}})},c=()=>{document.addEventListener("mousemove",m),document.addEventListener("mouseup",h),document.addEventListener("touchmove",g),document.addEventListener("touchend",h)},f=()=>{document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",h),document.removeEventListener("touchmove",g),document.removeEventListener("touchend",h)},d=()=>{!s.current&&i.current&&(s.current=!0,typeof(t==null?void 0:t.onScrubStart)=="function"&&t.onScrubStart(),u(!0),c())},h=()=>{s.current&&i.current&&(s.current=!1,u(!1),f(),setTimeout(()=>{typeof(t==null?void 0:t.onScrubEnd)=="function"&&t.onScrubEnd()},0))},p=_=>{d(),m(_)},m=_=>l({x:_.clientX,y:_.clientY}),y=_=>{_.cancelable&&_.preventDefault(),d(),g(_)},g=_=>{_.cancelable&&_.preventDefault(),l({x:_.changedTouches[0].clientX,y:_.changedTouches[0].clientY})};return r.current.addEventListener("mousedown",p),r.current.addEventListener("touchstart",y,{passive:!1}),()=>{r.current&&(r.current.removeEventListener("mousedown",p),r.current.removeEventListener("touchstart",y))}},[n,e]),{ref:r,active:a}}function Oa({value:e,defaultValue:t,finalValue:n,onChange:r=()=>{}}){const[i,s]=w.useState(t!==void 0?t:n),o=a=>{s(a),r==null||r(a)};return e!==void 0?[e,r,!0]:[i,o,!1]}function lk(e,t){return mpe("(prefers-reduced-motion: reduce)",e,t)}const Cpe=e=>e<.5?2*e*e:-1+(4-2*e)*e,Ape=({axis:e,target:t,parent:n,alignment:r,offset:i,isList:s})=>{if(!t||!n&&typeof document>"u")return 0;const o=!!n,u=(n||document.body).getBoundingClientRect(),l=t.getBoundingClientRect(),c=f=>l[f]-u[f];if(e==="y"){const f=c("top");if(f===0)return 0;if(r==="start"){const h=f-i;return h<=l.height*(s?0:1)||!s?h:0}const d=o?u.height:window.innerHeight;if(r==="end"){const h=f+i-d+l.height;return h>=-l.height*(s?0:1)||!s?h:0}return r==="center"?f-d/2+l.height/2:0}if(e==="x"){const f=c("left");if(f===0)return 0;if(r==="start"){const h=f-i;return h<=l.width||!s?h:0}const d=o?u.width:window.innerWidth;if(r==="end"){const h=f+i-d+l.width;return h>=-l.width||!s?h:0}return r==="center"?f-d/2+l.width/2:0}return 0},Ope=({axis:e,parent:t})=>{if(!t&&typeof document>"u")return 0;const n=e==="y"?"scrollTop":"scrollLeft";if(t)return t[n];const{body:r,documentElement:i}=document;return r[n]+i[n]},Ppe=({axis:e,parent:t,distance:n})=>{if(!t&&typeof document>"u")return;const r=e==="y"?"scrollTop":"scrollLeft";if(t)t[r]=n;else{const{body:i,documentElement:s}=document;i[r]=n,s[r]=n}};function KW({duration:e=1250,axis:t="y",onScrollFinish:n,easing:r=Cpe,offset:i=0,cancelable:s=!0,isList:o=!1}={}){const a=w.useRef(0),u=w.useRef(0),l=w.useRef(!1),c=w.useRef(null),f=w.useRef(null),d=lk(),h=()=>{a.current&&cancelAnimationFrame(a.current)},p=w.useCallback(({alignment:y="start"}={})=>{var g;l.current=!1,a.current&&h();const _=(g=Ope({parent:c.current,axis:t}))!=null?g:0,b=Ape({parent:c.current,target:f.current,axis:t,alignment:y,offset:i,isList:o})-(c.current?0:_);function T(){u.current===0&&(u.current=performance.now());const E=performance.now()-u.current,S=d||e===0?1:E/e,A=_+b*r(S);Ppe({parent:c.current,axis:t,distance:A}),!l.current&&S<1?a.current=requestAnimationFrame(T):(typeof n=="function"&&n(),u.current=0,a.current=0,h())}T()},[t,e,r,o,i,n,d]),m=()=>{s&&(l.current=!0)};return RP("wheel",m,{passive:!0}),RP("touchmove",m,{passive:!0}),w.useEffect(()=>h,[]),{scrollableRef:c,targetRef:f,scrollIntoView:p,cancel:h}}const Rpe={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};function QW(){const e=w.useRef(0),t=w.useRef(null),[n,r]=w.useState(Rpe),i=w.useMemo(()=>typeof window<"u"?new ResizeObserver(s=>{const o=s[0];o&&(cancelAnimationFrame(e.current),e.current=requestAnimationFrame(()=>{t.current&&r(o.contentRect)}))}):null,[]);return w.useEffect(()=>(t.current&&i.observe(t.current),()=>{i.disconnect(),e.current&&cancelAnimationFrame(e.current)}),[t.current]),[t,n]}function Npe(){if(typeof window>"u"||typeof document>"u")return 0;const e=parseInt(window.getComputedStyle(document.body).paddingRight,10),t=window.innerWidth-document.documentElement.clientWidth;return e+t}const kpe=({disableBodyPadding:e})=>{const t=e?null:Npe();return`body { + */var pi=typeof Symbol=="function"&&Symbol.for,ik=pi?Symbol.for("react.element"):60103,sk=pi?Symbol.for("react.portal"):60106,kS=pi?Symbol.for("react.fragment"):60107,DS=pi?Symbol.for("react.strict_mode"):60108,$S=pi?Symbol.for("react.profiler"):60114,LS=pi?Symbol.for("react.provider"):60109,MS=pi?Symbol.for("react.context"):60110,ok=pi?Symbol.for("react.async_mode"):60111,FS=pi?Symbol.for("react.concurrent_mode"):60111,BS=pi?Symbol.for("react.forward_ref"):60112,jS=pi?Symbol.for("react.suspense"):60113,bhe=pi?Symbol.for("react.suspense_list"):60120,US=pi?Symbol.for("react.memo"):60115,VS=pi?Symbol.for("react.lazy"):60116,Ehe=pi?Symbol.for("react.block"):60121,whe=pi?Symbol.for("react.fundamental"):60117,The=pi?Symbol.for("react.responder"):60118,She=pi?Symbol.for("react.scope"):60119;function wo(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case ik:switch(e=e.type,e){case ok:case FS:case kS:case $S:case DS:case jS:return e;default:switch(e=e&&e.$$typeof,e){case MS:case BS:case VS:case US:case LS:return e;default:return t}}case sk:return t}}}function AW(e){return wo(e)===FS}kn.AsyncMode=ok;kn.ConcurrentMode=FS;kn.ContextConsumer=MS;kn.ContextProvider=LS;kn.Element=ik;kn.ForwardRef=BS;kn.Fragment=kS;kn.Lazy=VS;kn.Memo=US;kn.Portal=sk;kn.Profiler=$S;kn.StrictMode=DS;kn.Suspense=jS;kn.isAsyncMode=function(e){return AW(e)||wo(e)===ok};kn.isConcurrentMode=AW;kn.isContextConsumer=function(e){return wo(e)===MS};kn.isContextProvider=function(e){return wo(e)===LS};kn.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===ik};kn.isForwardRef=function(e){return wo(e)===BS};kn.isFragment=function(e){return wo(e)===kS};kn.isLazy=function(e){return wo(e)===VS};kn.isMemo=function(e){return wo(e)===US};kn.isPortal=function(e){return wo(e)===sk};kn.isProfiler=function(e){return wo(e)===$S};kn.isStrictMode=function(e){return wo(e)===DS};kn.isSuspense=function(e){return wo(e)===jS};kn.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===kS||e===FS||e===$S||e===DS||e===jS||e===bhe||typeof e=="object"&&e!==null&&(e.$$typeof===VS||e.$$typeof===US||e.$$typeof===LS||e.$$typeof===MS||e.$$typeof===BS||e.$$typeof===whe||e.$$typeof===The||e.$$typeof===She||e.$$typeof===Ehe)};kn.typeOf=wo;CW.exports=kn;var Ihe=CW.exports,OW=Ihe,xhe={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Che={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},PW={};PW[OW.ForwardRef]=xhe;PW[OW.Memo]=Che;var Ahe=!0;function Ohe(e,t,n){var r="";return n.split(" ").forEach(function(i){e[i]!==void 0?t.push(e[i]+";"):r+=i+" "}),r}var Phe=function(t,n,r){var i=t.key+"-"+n.name;(r===!1||Ahe===!1)&&t.registered[i]===void 0&&(t.registered[i]=n.styles)},RW=function(t,n,r){Phe(t,n,r);var i=t.key+"-"+n.name;if(t.inserted[n.name]===void 0){var s=n;do t.insert(n===s?"."+i:"",s,t.sheet,!0),s=s.next;while(s!==void 0)}};function Rhe(e){for(var t=0,n,r=0,i=e.length;i>=4;++r,i-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var Nhe={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},khe=/[A-Z]|^ms/g,Dhe=/_EMO_([^_]+?)_([^]*?)_EMO_/g,NW=function(t){return t.charCodeAt(1)===45},jM=function(t){return t!=null&&typeof t!="boolean"},SC=fhe(function(e){return NW(e)?e:e.replace(khe,"-$&").toLowerCase()}),UM=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(Dhe,function(r,i,s){return Qa={name:i,styles:s,next:Qa},i})}return Nhe[t]!==1&&!NW(t)&&typeof n=="number"&&n!==0?n+"px":n};function wy(e,t,n){if(n==null)return"";if(n.__emotion_styles!==void 0)return n;switch(typeof n){case"boolean":return"";case"object":{if(n.anim===1)return Qa={name:n.name,styles:n.styles,next:Qa},n.name;if(n.styles!==void 0){var r=n.next;if(r!==void 0)for(;r!==void 0;)Qa={name:r.name,styles:r.styles,next:Qa},r=r.next;var i=n.styles+";";return i}return $he(e,t,n)}case"function":{if(e!==void 0){var s=Qa,o=n(e);return Qa=s,wy(e,t,o)}break}}if(t==null)return n;var a=t[n];return a!==void 0?a:n}function $he(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i(e[n]!==void 0&&(t[n]=e[n]),t),{})}var Uhe=Object.defineProperty,HM=Object.getOwnPropertySymbols,Vhe=Object.prototype.hasOwnProperty,zhe=Object.prototype.propertyIsEnumerable,WM=(e,t,n)=>t in e?Uhe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,IC=(e,t)=>{for(var n in t||(t={}))Vhe.call(t,n)&&WM(e,n,t[n]);if(HM)for(var n of HM(t))zhe.call(t,n)&&WM(e,n,t[n]);return e};const LW=w.createContext({theme:_W});function ts(){var e;return((e=w.useContext(LW))==null?void 0:e.theme)||_W}function Hhe(e){const t=ts(),n=r=>{var i,s;return{styles:((i=t.components[r])==null?void 0:i.styles)||{},classNames:((s=t.components[r])==null?void 0:s.classNames)||{}}};return Array.isArray(e)?e.map(n):[n(e)]}function MW(){var e;return(e=w.useContext(LW))==null?void 0:e.emotionCache}function ct(e,t,n){var r;const s=(r=ts().components[e])==null?void 0:r.defaultProps;return IC(IC(IC({},t),s),$W(n))}const FW=w.createContext({classNames:{},styles:{},unstyled:!1});function BW({children:e,classNames:t,unstyled:n,styles:r,staticSelector:i}){return k.createElement(FW.Provider,{value:{classNames:t,styles:r,unstyled:n,staticSelector:i}},e)}function T_(){return w.useContext(FW)}const Whe={app:100,modal:200,popover:300,overlay:400,max:9999};function To(e){return Whe[e]}function qhe(e,t){const n=w.useRef();return(!n.current||t.length!==n.current.prevDeps.length||n.current.prevDeps.map((r,i)=>r===t[i]).indexOf(!1)>=0)&&(n.current={v:e(),prevDeps:[...t]}),n.current.v}const Yhe=xW({key:"mantine",prepend:!0});function Ghe(){return MW()||Yhe}var Khe=Object.defineProperty,qM=Object.getOwnPropertySymbols,Qhe=Object.prototype.hasOwnProperty,Xhe=Object.prototype.propertyIsEnumerable,YM=(e,t,n)=>t in e?Khe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Jhe=(e,t)=>{for(var n in t||(t={}))Qhe.call(t,n)&&YM(e,n,t[n]);if(qM)for(var n of qM(t))Xhe.call(t,n)&&YM(e,n,t[n]);return e};const xC="ref";function Zhe(e){let t;if(e.length!==1)return{args:e,ref:t};const[n]=e;if(!(n instanceof Object))return{args:e,ref:t};if(!(xC in n))return{args:e,ref:t};t=n[xC];const r=Jhe({},n);return delete r[xC],{args:[r],ref:t}}const{cssFactory:epe}=(()=>{function e(n,r,i){const s=[],o=Ohe(n,s,i);return s.length<2?i:o+r(s)}function t(n){const{cache:r}=n,i=(...o)=>{const{ref:a,args:u}=Zhe(o),l=ak(u,r.registered);return RW(r,l,!1),`${r.key}-${l.name}${a===void 0?"":` ${a}`}`};return{css:i,cx:(...o)=>e(r.registered,i,mW(o))}}return{cssFactory:t}})();function jW(){const e=Ghe();return qhe(()=>epe({cache:e}),[e])}function tpe({cx:e,classes:t,context:n,classNames:r,name:i,cache:s}){const o=n.reduce((a,u)=>(Object.keys(u.classNames).forEach(l=>{typeof a[l]!="string"?a[l]=`${u.classNames[l]}`:a[l]=`${a[l]} ${u.classNames[l]}`}),a),{});return Object.keys(t).reduce((a,u)=>(a[u]=e(t[u],o[u],r!=null&&r[u],Array.isArray(i)?i.filter(Boolean).map(l=>`${(s==null?void 0:s.key)||"mantine"}-${l}-${u}`).join(" "):i?`${(s==null?void 0:s.key)||"mantine"}-${i}-${u}`:null),a),{})}var npe=Object.defineProperty,GM=Object.getOwnPropertySymbols,rpe=Object.prototype.hasOwnProperty,ipe=Object.prototype.propertyIsEnumerable,KM=(e,t,n)=>t in e?npe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,CC=(e,t)=>{for(var n in t||(t={}))rpe.call(t,n)&&KM(e,n,t[n]);if(GM)for(var n of GM(t))ipe.call(t,n)&&KM(e,n,t[n]);return e};function spe(e){return`__mantine-ref-${e||""}`}function QM(e,t,n){const r=i=>typeof i=="function"?i(t,n||{}):i||{};return Array.isArray(e)?e.map(i=>r(i.styles)).reduce((i,s)=>(Object.keys(s).forEach(o=>{i[o]?i[o]=CC(CC({},i[o]),s[o]):i[o]=CC({},s[o])}),i),{}):r(e)}function at(e){const t=typeof e=="function"?e:()=>e;function n(r,i){const s=ts(),o=Hhe(i==null?void 0:i.name),a=MW(),{css:u,cx:l}=jW(),c=t(s,r,spe),f=QM(i==null?void 0:i.styles,s,r),d=QM(o,s,r),h=Object.fromEntries(Object.keys(c).map(p=>{const m=l({[u(c[p])]:!(i!=null&&i.unstyled)},u(d[p]),u(f[p]));return[p,m]}));return{classes:tpe({cx:l,classes:h,context:o,classNames:i==null?void 0:i.classNames,name:i==null?void 0:i.name,cache:a}),cx:l,theme:s}}return n}function UW({styles:e}){const t=ts();return k.createElement(Bhe,{styles:DW(typeof e=="function"?e(t):e)})}var ope=Object.defineProperty,ape=Object.defineProperties,upe=Object.getOwnPropertyDescriptors,XM=Object.getOwnPropertySymbols,lpe=Object.prototype.hasOwnProperty,cpe=Object.prototype.propertyIsEnumerable,JM=(e,t,n)=>t in e?ope(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,xg=(e,t)=>{for(var n in t||(t={}))lpe.call(t,n)&&JM(e,n,t[n]);if(XM)for(var n of XM(t))cpe.call(t,n)&&JM(e,n,t[n]);return e},Cg=(e,t)=>ape(e,upe(t));const Ag={in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:"scale(.9) translateY(10px)"},transitionProperty:"transform, opacity"},Bv={fade:{in:{opacity:1},out:{opacity:0},transitionProperty:"opacity"},scale:{in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:"scale(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-y":{in:{opacity:1,transform:"scaleY(1)"},out:{opacity:0,transform:"scaleY(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-x":{in:{opacity:1,transform:"scaleX(1)"},out:{opacity:0,transform:"scaleX(0)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"skew-up":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:"translateY(-20px) skew(-10deg, -5deg)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"skew-down":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:"translateY(20px) skew(-10deg, -5deg)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-left":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:"translateY(20px) rotate(-5deg)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-right":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:"translateY(20px) rotate(5deg)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-down":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(-100%)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-up":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(100%)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"slide-left":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(100%)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"slide-right":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(-100%)"},common:{transformOrigin:"right"},transitionProperty:"transform, opacity"},pop:Cg(xg({},Ag),{common:{transformOrigin:"center center"}}),"pop-bottom-left":Cg(xg({},Ag),{common:{transformOrigin:"bottom left"}}),"pop-bottom-right":Cg(xg({},Ag),{common:{transformOrigin:"bottom right"}}),"pop-top-left":Cg(xg({},Ag),{common:{transformOrigin:"top left"}}),"pop-top-right":Cg(xg({},Ag),{common:{transformOrigin:"top right"}})},ZM=["mousedown","touchstart"];function fpe(e,t,n){const r=w.useRef();return w.useEffect(()=>{const i=s=>{const{target:o}=s??{};if(Array.isArray(n)){const a=(o==null?void 0:o.hasAttribute("data-ignore-outside-clicks"))||!document.body.contains(o);n.every(l=>!!l&&!l.contains(o))&&!a&&e()}else r.current&&!r.current.contains(o)&&e()};return(t||ZM).forEach(s=>document.addEventListener(s,i)),()=>{(t||ZM).forEach(s=>document.removeEventListener(s,i))}},[r,e,n]),r}function dpe(e,t){try{return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}catch{return e.addListener(t),()=>e.removeListener(t)}}function hpe(e,t){return typeof t=="boolean"?t:typeof window<"u"&&"matchMedia"in window?window.matchMedia(e).matches:!1}function ppe(e,t,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){const[r,i]=w.useState(n?!1:hpe(e,t)),s=w.useRef();return w.useEffect(()=>{if("matchMedia"in window)return s.current=window.matchMedia(e),i(s.current.matches),dpe(s.current,o=>i(o.matches))},[e]),r}function Mc(e,t,n){return Math.min(Math.max(e,t),n)}const uk=typeof document<"u"?w.useLayoutEffect:w.useEffect;function fo(e,t){const n=w.useRef(!1);w.useEffect(()=>()=>{n.current=!1},[]),w.useEffect(()=>{if(n.current)return e();n.current=!0},t)}function VW({opened:e,shouldReturnFocus:t=!0}){const n=w.useRef(),r=()=>{var i;n.current&&"focus"in n.current&&typeof n.current.focus=="function"&&((i=n.current)==null||i.focus({preventScroll:!0}))};return fo(()=>{let i=-1;const s=o=>{o.key==="Tab"&&window.clearTimeout(i)};return document.addEventListener("keydown",s),e?n.current=document.activeElement:t&&(i=window.setTimeout(r,10)),()=>{window.clearTimeout(i),document.removeEventListener("keydown",s)}},[e,t]),r}const mpe=/input|select|textarea|button|object/,zW="a, input, select, textarea, button, object, [tabindex]";function gpe(e){return e.style.display==="none"}function ype(e){if(e.getAttribute("aria-hidden")||e.getAttribute("hidden")||e.getAttribute("type")==="hidden")return!1;let n=e;for(;n&&n!==document.body;){if(gpe(n))return!1;n=n.parentNode}return!0}function HW(e){let t=e.getAttribute("tabindex");return t===null&&(t=void 0),parseInt(t,10)}function PP(e){const t=e.nodeName.toLowerCase(),n=!Number.isNaN(HW(e));return(mpe.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||n)&&ype(e)}function WW(e){const t=HW(e);return(Number.isNaN(t)||t>=0)&&PP(e)}function _pe(e){return Array.from(e.querySelectorAll(zW)).filter(WW)}function vpe(e,t){const n=_pe(e);if(!n.length){t.preventDefault();return}if(!(n[t.shiftKey?0:n.length-1]===document.activeElement||e===document.activeElement))return;t.preventDefault();const s=n[t.shiftKey?n.length-1:0];s&&s.focus()}function bpe(e,t="body > :not(script)"){const n=Array.from(document.querySelectorAll(t)).map(r=>{if(r.contains(e))return;const i=r.getAttribute("aria-hidden");return(i===null||i==="false")&&r.setAttribute("aria-hidden","true"),{node:r,ariaHidden:i}});return()=>{n.forEach(r=>{r&&(r.ariaHidden===null?r.node.removeAttribute("aria-hidden"):r.node.setAttribute("aria-hidden",r.ariaHidden))})}}function qW(e=!0){const t=w.useRef(),n=w.useRef(null),r=w.useCallback(i=>{if(e&&i!==null&&(n.current=bpe(i),t.current!==i))if(i){const s=()=>{let o=i.querySelector("[data-autofocus]");if(!o){const a=Array.from(i.querySelectorAll(zW));o=a.find(WW)||a.find(PP)||null,!o&&PP(i)&&(o=i)}o&&o.focus({preventScroll:!0})};setTimeout(()=>{i.ownerDocument&&s()}),t.current=i}else t.current=null},[e]);return w.useEffect(()=>{if(!e)return;const i=s=>{s.key==="Tab"&&t.current&&vpe(t.current,s)};return document.addEventListener("keydown",i),()=>{document.removeEventListener("keydown",i),n.current&&n.current()}},[e]),r}const Epe=()=>`mantine-${Math.random().toString(36).slice(2,11)}`,wpe=k.useId||(()=>{});function Tpe(){const[e,t]=w.useState("");return uk(()=>{t(Epe())},[]),e}function Spe(){const e=wpe();return e?`mantine-${e.replace(/:/g,"")}`:""}function Fu(e){return typeof e=="string"?e:Spe()||Tpe()}function RP(e,t,n){w.useEffect(()=>(window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)),[e,t])}function YW(e,t){typeof e=="function"?e(t):typeof e=="object"&&e!==null&&"current"in e&&(e.current=t)}function Ipe(...e){return t=>{e.forEach(n=>YW(n,t))}}function Ko(...e){return w.useCallback(Ipe(...e),e)}function GW(e,t,n="ltr"){const r=w.useRef(),i=w.useRef(!1),s=w.useRef(!1),o=w.useRef(0),[a,u]=w.useState(!1);return w.useEffect(()=>{i.current=!0},[]),w.useEffect(()=>{const l=({x:_,y:b})=>{cancelAnimationFrame(o.current),o.current=requestAnimationFrame(()=>{if(i.current&&r.current){r.current.style.userSelect="none";const T=r.current.getBoundingClientRect();if(T.width&&T.height){const I=Mc((_-T.left)/T.width,0,1);e({x:n==="ltr"?I:1-I,y:Mc((b-T.top)/T.height,0,1)})}}})},c=()=>{document.addEventListener("mousemove",m),document.addEventListener("mouseup",h),document.addEventListener("touchmove",g),document.addEventListener("touchend",h)},f=()=>{document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",h),document.removeEventListener("touchmove",g),document.removeEventListener("touchend",h)},d=()=>{!s.current&&i.current&&(s.current=!0,typeof(t==null?void 0:t.onScrubStart)=="function"&&t.onScrubStart(),u(!0),c())},h=()=>{s.current&&i.current&&(s.current=!1,u(!1),f(),setTimeout(()=>{typeof(t==null?void 0:t.onScrubEnd)=="function"&&t.onScrubEnd()},0))},p=_=>{d(),m(_)},m=_=>l({x:_.clientX,y:_.clientY}),y=_=>{_.cancelable&&_.preventDefault(),d(),g(_)},g=_=>{_.cancelable&&_.preventDefault(),l({x:_.changedTouches[0].clientX,y:_.changedTouches[0].clientY})};return r.current.addEventListener("mousedown",p),r.current.addEventListener("touchstart",y,{passive:!1}),()=>{r.current&&(r.current.removeEventListener("mousedown",p),r.current.removeEventListener("touchstart",y))}},[n,e]),{ref:r,active:a}}function Oa({value:e,defaultValue:t,finalValue:n,onChange:r=()=>{}}){const[i,s]=w.useState(t!==void 0?t:n),o=a=>{s(a),r==null||r(a)};return e!==void 0?[e,r,!0]:[i,o,!1]}function lk(e,t){return ppe("(prefers-reduced-motion: reduce)",e,t)}const xpe=e=>e<.5?2*e*e:-1+(4-2*e)*e,Cpe=({axis:e,target:t,parent:n,alignment:r,offset:i,isList:s})=>{if(!t||!n&&typeof document>"u")return 0;const o=!!n,u=(n||document.body).getBoundingClientRect(),l=t.getBoundingClientRect(),c=f=>l[f]-u[f];if(e==="y"){const f=c("top");if(f===0)return 0;if(r==="start"){const h=f-i;return h<=l.height*(s?0:1)||!s?h:0}const d=o?u.height:window.innerHeight;if(r==="end"){const h=f+i-d+l.height;return h>=-l.height*(s?0:1)||!s?h:0}return r==="center"?f-d/2+l.height/2:0}if(e==="x"){const f=c("left");if(f===0)return 0;if(r==="start"){const h=f-i;return h<=l.width||!s?h:0}const d=o?u.width:window.innerWidth;if(r==="end"){const h=f+i-d+l.width;return h>=-l.width||!s?h:0}return r==="center"?f-d/2+l.width/2:0}return 0},Ape=({axis:e,parent:t})=>{if(!t&&typeof document>"u")return 0;const n=e==="y"?"scrollTop":"scrollLeft";if(t)return t[n];const{body:r,documentElement:i}=document;return r[n]+i[n]},Ope=({axis:e,parent:t,distance:n})=>{if(!t&&typeof document>"u")return;const r=e==="y"?"scrollTop":"scrollLeft";if(t)t[r]=n;else{const{body:i,documentElement:s}=document;i[r]=n,s[r]=n}};function KW({duration:e=1250,axis:t="y",onScrollFinish:n,easing:r=xpe,offset:i=0,cancelable:s=!0,isList:o=!1}={}){const a=w.useRef(0),u=w.useRef(0),l=w.useRef(!1),c=w.useRef(null),f=w.useRef(null),d=lk(),h=()=>{a.current&&cancelAnimationFrame(a.current)},p=w.useCallback(({alignment:y="start"}={})=>{var g;l.current=!1,a.current&&h();const _=(g=Ape({parent:c.current,axis:t}))!=null?g:0,b=Cpe({parent:c.current,target:f.current,axis:t,alignment:y,offset:i,isList:o})-(c.current?0:_);function T(){u.current===0&&(u.current=performance.now());const E=performance.now()-u.current,S=d||e===0?1:E/e,A=_+b*r(S);Ope({parent:c.current,axis:t,distance:A}),!l.current&&S<1?a.current=requestAnimationFrame(T):(typeof n=="function"&&n(),u.current=0,a.current=0,h())}T()},[t,e,r,o,i,n,d]),m=()=>{s&&(l.current=!0)};return RP("wheel",m,{passive:!0}),RP("touchmove",m,{passive:!0}),w.useEffect(()=>h,[]),{scrollableRef:c,targetRef:f,scrollIntoView:p,cancel:h}}const Ppe={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};function Rpe(){const e=w.useRef(0),t=w.useRef(null),[n,r]=w.useState(Ppe),i=w.useMemo(()=>typeof window<"u"?new ResizeObserver(s=>{const o=s[0];o&&(cancelAnimationFrame(e.current),e.current=requestAnimationFrame(()=>{t.current&&r(o.contentRect)}))}):null,[]);return w.useEffect(()=>(t.current&&i.observe(t.current),()=>{i.disconnect(),e.current&&cancelAnimationFrame(e.current)}),[t.current]),[t,n]}function Npe(){if(typeof window>"u"||typeof document>"u")return 0;const e=parseInt(window.getComputedStyle(document.body).paddingRight,10),t=window.innerWidth-document.documentElement.clientWidth;return e+t}const kpe=({disableBodyPadding:e})=>{const t=e?null:Npe();return`body { --removed-scroll-width: ${t}px; touch-action: none; overflow: hidden !important; position: relative !important; ${t?"padding-right: var(--removed-scroll-width) !important;":""} - `};function Dpe(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function $pe(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}function Lpe(){const e=document.createElement("style");return e.type="text/css",e.setAttribute("mantine-scroll-lock",""),e}function Mpe(e,t={disableBodyPadding:!1}){const[n,r]=w.useState(e||!1),i=w.useRef(0),{disableBodyPadding:s}=t,o=w.useRef(null),a=()=>{i.current=window.scrollY;const l=kpe({disableBodyPadding:s}),c=Lpe();Dpe(c,l),$pe(c),o.current=c},u=()=>{o!=null&&o.current&&(o.current.parentNode.removeChild(o.current),o.current=null)};return w.useEffect(()=>(n?a():u(),u),[n]),w.useEffect(()=>{e!==void 0&&r(e)},[e]),w.useEffect(()=>{e===void 0&&typeof window<"u"&&window.document.body.style.overflow==="hidden"&&r(!0)},[r]),[n,r]}function Fpe(){const{userAgent:e}=window.navigator,t=/(Macintosh)|(MacIntel)|(MacPPC)|(Mac68K)/i,n=/(Win32)|(Win64)|(Windows)|(WinCE)/i,r=/(iPhone)|(iPad)|(iPod)/i;return t.test(e)?"macos":r.test(e)?"ios":n.test(e)?"windows":/Android/i.test(e)?"android":/Linux/i.test(e)?"linux":"undetermined"}function Bpe(){return typeof window<"u"?Fpe():"undetermined"}function jpe(e){return t=>{if(!t)e(t);else if(typeof t=="function")e(t);else if(typeof t=="object"&&"nativeEvent"in t){const{currentTarget:n}=t;n.type==="checkbox"?e(n.checked):e(n.value)}else e(t)}}function Upe(e){const[t,n]=w.useState(e);return[t,jpe(n)]}function XW(e,t){const[n,r]=w.useState(e),i=()=>{var a;n||(r(!0),(a=t==null?void 0:t.onOpen)==null||a.call(t))},s=()=>{var a;n&&(r(!1),(a=t==null?void 0:t.onClose)==null||a.call(t))};return[n,{open:i,close:s,toggle:()=>{n?s():i()}}]}function Vpe(){return`mantine-${Math.random().toString(36).slice(2,11)}`}var e4=Object.getOwnPropertySymbols,zpe=Object.prototype.hasOwnProperty,Hpe=Object.prototype.propertyIsEnumerable,Wpe=(e,t)=>{var n={};for(var r in e)zpe.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&e4)for(var r of e4(e))t.indexOf(r)<0&&Hpe.call(e,r)&&(n[r]=e[r]);return n};function Xd(e){const t=e,{m:n,mx:r,my:i,mt:s,mb:o,ml:a,mr:u,p:l,px:c,py:f,pt:d,pb:h,pl:p,pr:m,bg:y,c:g,opacity:_,ff:b,fz:T,fw:I,lts:E,ta:S,lh:A,fs:P,tt:V,td:M,w:H,miw:J,maw:Y,h:ye,mih:he,mah:ve,bgsz:te,bgp:se,bgr:K,bga:x,pos:C,top:z,left:R,bottom:O,right:q,inset:le,display:ae}=t,pe=Wpe(t,["m","mx","my","mt","mb","ml","mr","p","px","py","pt","pb","pl","pr","bg","c","opacity","ff","fz","fw","lts","ta","lh","fs","tt","td","w","miw","maw","h","mih","mah","bgsz","bgp","bgr","bga","pos","top","left","bottom","right","inset","display"]);return{systemStyles:$W({m:n,mx:r,my:i,mt:s,mb:o,ml:a,mr:u,p:l,px:c,py:f,pt:d,pb:h,pl:p,pr:m,bg:y,c:g,opacity:_,ff:b,fz:T,fw:I,lts:E,ta:S,lh:A,fs:P,tt:V,td:M,w:H,miw:J,maw:Y,h:ye,mih:he,mah:ve,bgsz:te,bgp:se,bgr:K,bga:x,pos:C,top:z,left:R,bottom:O,right:q,inset:le,display:ae}),rest:pe}}function qpe(e,t){const n=Object.keys(e).filter(r=>r!=="base").sort((r,i)=>t.fn.size({size:r,sizes:t.breakpoints})-t.fn.size({size:i,sizes:t.breakpoints}));return"base"in e?["base",...n]:n}function Ype({value:e,theme:t,getValue:n,property:r}){if(e==null)return;if(typeof e=="object")return qpe(e,t).reduce((o,a)=>{if(a==="base"&&e.base!==void 0){const l=n(e.base,t);return Array.isArray(r)?(r.forEach(c=>{o[c]=l}),o):(o[r]=l,o)}const u=n(e[a],t);return Array.isArray(r)?(o[t.fn.largerThan(a)]={},r.forEach(l=>{o[t.fn.largerThan(a)][l]=u}),o):(o[t.fn.largerThan(a)]={[r]:u},o)},{});const i=n(e,t);return Array.isArray(r)?r.reduce((s,o)=>(s[o]=i,s),{}):{[r]:i}}function Gpe(e,t){return e==="dimmed"?t.colorScheme==="dark"?t.colors.dark[2]:t.colors.gray[6]:t.fn.variant({variant:"filled",color:e,primaryFallback:!1}).background}function Kpe(e){return e}function Qpe(e,t){return t.fn.size({size:e,sizes:t.fontSizes})}const Xpe=["-xs","-sm","-md","-lg","-xl"];function Jpe(e,t){return Xpe.includes(e)?t.fn.size({size:e.replace("-",""),sizes:t.spacing})*-1:t.fn.size({size:e,sizes:t.spacing})}const Zpe={color:Gpe,default:Kpe,fontSize:Qpe,spacing:Jpe},eme={m:{type:"spacing",property:"margin"},mt:{type:"spacing",property:"marginTop"},mb:{type:"spacing",property:"marginBottom"},ml:{type:"spacing",property:"marginLeft"},mr:{type:"spacing",property:"marginRight"},mx:{type:"spacing",property:["marginRight","marginLeft"]},my:{type:"spacing",property:["marginTop","marginBottom"]},p:{type:"spacing",property:"padding"},pt:{type:"spacing",property:"paddingTop"},pb:{type:"spacing",property:"paddingBottom"},pl:{type:"spacing",property:"paddingLeft"},pr:{type:"spacing",property:"paddingRight"},px:{type:"spacing",property:["paddingRight","paddingLeft"]},py:{type:"spacing",property:["paddingTop","paddingBottom"]},bg:{type:"color",property:"background"},c:{type:"color",property:"color"},opacity:{type:"default",property:"opacity"},ff:{type:"default",property:"fontFamily"},fz:{type:"fontSize",property:"fontSize"},fw:{type:"default",property:"fontWeight"},lts:{type:"default",property:"letterSpacing"},ta:{type:"default",property:"textAlign"},lh:{type:"default",property:"lineHeight"},fs:{type:"default",property:"fontStyle"},tt:{type:"default",property:"textTransform"},td:{type:"default",property:"textDecoration"},w:{type:"default",property:"width"},miw:{type:"default",property:"minWidth"},maw:{type:"default",property:"maxWidth"},h:{type:"default",property:"height"},mih:{type:"default",property:"minHeight"},mah:{type:"default",property:"maxHeight"},bgsz:{type:"default",property:"background-size"},bgp:{type:"default",property:"background-position"},bgr:{type:"default",property:"background-repeat"},bga:{type:"default",property:"background-attachment"},pos:{type:"default",property:"position"},top:{type:"default",property:"top"},left:{type:"default",property:"left"},bottom:{type:"default",property:"bottom"},right:{type:"default",property:"right"},inset:{type:"default",property:"inset"},display:{type:"default",property:"display"}};var tme=Object.defineProperty,t4=Object.getOwnPropertySymbols,nme=Object.prototype.hasOwnProperty,rme=Object.prototype.propertyIsEnumerable,n4=(e,t,n)=>t in e?tme(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,r4=(e,t)=>{for(var n in t||(t={}))nme.call(t,n)&&n4(e,n,t[n]);if(t4)for(var n of t4(t))rme.call(t,n)&&n4(e,n,t[n]);return e};function NP(e,t,n=eme){return Object.keys(n).reduce((i,s)=>(s in e&&e[s]!==void 0&&i.push(Ype({value:e[s],getValue:Zpe[n[s].type],property:n[s].property,theme:t})),i),[]).reduce((i,s)=>(Object.keys(s).forEach(o=>{typeof s[o]=="object"&&s[o]!==null&&o in i?i[o]=r4(r4({},i[o]),s[o]):i[o]=s[o]}),i),{})}function i4(e,t){return typeof e=="function"?e(t):e}function ime(e,t,n){const r=ts(),{css:i,cx:s}=jW();return Array.isArray(e)?s(n,i(NP(t,r)),e.map(o=>i(i4(o,r)))):s(n,i(i4(e,r)),i(NP(t,r)))}var sme=Object.defineProperty,rE=Object.getOwnPropertySymbols,JW=Object.prototype.hasOwnProperty,ZW=Object.prototype.propertyIsEnumerable,s4=(e,t,n)=>t in e?sme(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ome=(e,t)=>{for(var n in t||(t={}))JW.call(t,n)&&s4(e,n,t[n]);if(rE)for(var n of rE(t))ZW.call(t,n)&&s4(e,n,t[n]);return e},ame=(e,t)=>{var n={};for(var r in e)JW.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&rE)for(var r of rE(e))t.indexOf(r)<0&&ZW.call(e,r)&&(n[r]=e[r]);return n};const eq=w.forwardRef((e,t)=>{var n=e,{className:r,component:i,style:s,sx:o}=n,a=ame(n,["className","component","style","sx"]);const{systemStyles:u,rest:l}=Xd(a),c=i||"div";return k.createElement(c,ome({ref:t,className:ime(o,u,r),style:s},l))});eq.displayName="@mantine/core/Box";const ut=eq;var ume=Object.defineProperty,lme=Object.defineProperties,cme=Object.getOwnPropertyDescriptors,o4=Object.getOwnPropertySymbols,fme=Object.prototype.hasOwnProperty,dme=Object.prototype.propertyIsEnumerable,a4=(e,t,n)=>t in e?ume(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,u4=(e,t)=>{for(var n in t||(t={}))fme.call(t,n)&&a4(e,n,t[n]);if(o4)for(var n of o4(t))dme.call(t,n)&&a4(e,n,t[n]);return e},hme=(e,t)=>lme(e,cme(t)),pme=at(e=>({root:hme(u4(u4({},e.fn.focusStyles()),e.fn.fontStyles()),{cursor:"pointer",border:0,padding:0,appearance:"none",fontSize:e.fontSizes.md,backgroundColor:"transparent",textAlign:"left",color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,textDecoration:"none",boxSizing:"border-box"})}));const mme=pme;var gme=Object.defineProperty,iE=Object.getOwnPropertySymbols,tq=Object.prototype.hasOwnProperty,nq=Object.prototype.propertyIsEnumerable,l4=(e,t,n)=>t in e?gme(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yme=(e,t)=>{for(var n in t||(t={}))tq.call(t,n)&&l4(e,n,t[n]);if(iE)for(var n of iE(t))nq.call(t,n)&&l4(e,n,t[n]);return e},_me=(e,t)=>{var n={};for(var r in e)tq.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&iE)for(var r of iE(e))t.indexOf(r)<0&&nq.call(e,r)&&(n[r]=e[r]);return n};const rq=w.forwardRef((e,t)=>{const n=ct("UnstyledButton",{},e),{className:r,component:i="button",unstyled:s}=n,o=_me(n,["className","component","unstyled"]),{classes:a,cx:u}=mme(null,{name:"UnstyledButton",unstyled:s});return k.createElement(ut,yme({component:i,ref:t,className:u(a.root,r),type:i==="button"?"button":void 0},o))});rq.displayName="@mantine/core/UnstyledButton";const ck=rq;var vme=Object.defineProperty,bme=Object.defineProperties,Eme=Object.getOwnPropertyDescriptors,c4=Object.getOwnPropertySymbols,wme=Object.prototype.hasOwnProperty,Tme=Object.prototype.propertyIsEnumerable,f4=(e,t,n)=>t in e?vme(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,iq=(e,t)=>{for(var n in t||(t={}))wme.call(t,n)&&f4(e,n,t[n]);if(c4)for(var n of c4(t))Tme.call(t,n)&&f4(e,n,t[n]);return e},Sme=(e,t)=>bme(e,Eme(t));const n0={xs:18,sm:22,md:28,lg:34,xl:44};function Ime({variant:e,theme:t,color:n,gradient:r}){const i=t.fn.variant({color:n,variant:e,gradient:r});return e==="gradient"?{border:0,backgroundImage:i.background,color:i.color,"&:hover":t.fn.hover({backgroundSize:"200%"})}:iq({border:`1px solid ${i.border}`,backgroundColor:i.background,color:i.color},t.fn.hover({backgroundColor:i.hover}))}var xme=at((e,{color:t,size:n,radius:r,variant:i,gradient:s})=>({root:Sme(iq({},Ime({variant:i,theme:e,color:t,gradient:s})),{position:"relative",height:e.fn.size({size:n,sizes:n0}),minHeight:e.fn.size({size:n,sizes:n0}),width:e.fn.size({size:n,sizes:n0}),minWidth:e.fn.size({size:n,sizes:n0}),borderRadius:e.fn.radius(r),padding:0,lineHeight:1,display:"flex",alignItems:"center",justifyContent:"center","&:active":e.activeStyles,"&:disabled, &[data-disabled]":{color:e.colors.gray[e.colorScheme==="dark"?6:4],cursor:"not-allowed",backgroundColor:i==="transparent"?void 0:e.fn.themeColor("gray",e.colorScheme==="dark"?8:1),borderColor:i==="transparent"?void 0:e.fn.themeColor("gray",e.colorScheme==="dark"?8:1),backgroundImage:"none",pointerEvents:"none","&:active":{transform:"none"}},"&[data-loading]":{pointerEvents:"none","&::before":{content:'""',position:"absolute",top:-1,left:-1,right:-1,bottom:-1,backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.colors.dark[7],.5):"rgba(255, 255, 255, .5)",borderRadius:e.fn.radius(r),cursor:"not-allowed"}}})}));const Cme=xme;var Ame=Object.defineProperty,sE=Object.getOwnPropertySymbols,sq=Object.prototype.hasOwnProperty,oq=Object.prototype.propertyIsEnumerable,d4=(e,t,n)=>t in e?Ame(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ome=(e,t)=>{for(var n in t||(t={}))sq.call(t,n)&&d4(e,n,t[n]);if(sE)for(var n of sE(t))oq.call(t,n)&&d4(e,n,t[n]);return e},Pme=(e,t)=>{var n={};for(var r in e)sq.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&sE)for(var r of sE(e))t.indexOf(r)<0&&oq.call(e,r)&&(n[r]=e[r]);return n};function Rme(e){var t=e,{size:n,color:r}=t,i=Pme(t,["size","color"]);return k.createElement("svg",Ome({viewBox:"0 0 135 140",xmlns:"http://www.w3.org/2000/svg",fill:r,width:`${n}px`},i),k.createElement("rect",{y:"10",width:"15",height:"120",rx:"6"},k.createElement("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),k.createElement("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),k.createElement("rect",{x:"30",y:"10",width:"15",height:"120",rx:"6"},k.createElement("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),k.createElement("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),k.createElement("rect",{x:"60",width:"15",height:"140",rx:"6"},k.createElement("animate",{attributeName:"height",begin:"0s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),k.createElement("animate",{attributeName:"y",begin:"0s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),k.createElement("rect",{x:"90",y:"10",width:"15",height:"120",rx:"6"},k.createElement("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),k.createElement("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),k.createElement("rect",{x:"120",y:"10",width:"15",height:"120",rx:"6"},k.createElement("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),k.createElement("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})))}var Nme=Object.defineProperty,oE=Object.getOwnPropertySymbols,aq=Object.prototype.hasOwnProperty,uq=Object.prototype.propertyIsEnumerable,h4=(e,t,n)=>t in e?Nme(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,kme=(e,t)=>{for(var n in t||(t={}))aq.call(t,n)&&h4(e,n,t[n]);if(oE)for(var n of oE(t))uq.call(t,n)&&h4(e,n,t[n]);return e},Dme=(e,t)=>{var n={};for(var r in e)aq.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&oE)for(var r of oE(e))t.indexOf(r)<0&&uq.call(e,r)&&(n[r]=e[r]);return n};function $me(e){var t=e,{size:n,color:r}=t,i=Dme(t,["size","color"]);return k.createElement("svg",kme({width:`${n}px`,height:`${n}px`,viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",stroke:r},i),k.createElement("g",{fill:"none",fillRule:"evenodd"},k.createElement("g",{transform:"translate(2.5 2.5)",strokeWidth:"5"},k.createElement("circle",{strokeOpacity:".5",cx:"16",cy:"16",r:"16"}),k.createElement("path",{d:"M32 16c0-9.94-8.06-16-16-16"},k.createElement("animateTransform",{attributeName:"transform",type:"rotate",from:"0 16 16",to:"360 16 16",dur:"1s",repeatCount:"indefinite"})))))}var Lme=Object.defineProperty,aE=Object.getOwnPropertySymbols,lq=Object.prototype.hasOwnProperty,cq=Object.prototype.propertyIsEnumerable,p4=(e,t,n)=>t in e?Lme(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Mme=(e,t)=>{for(var n in t||(t={}))lq.call(t,n)&&p4(e,n,t[n]);if(aE)for(var n of aE(t))cq.call(t,n)&&p4(e,n,t[n]);return e},Fme=(e,t)=>{var n={};for(var r in e)lq.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&aE)for(var r of aE(e))t.indexOf(r)<0&&cq.call(e,r)&&(n[r]=e[r]);return n};function Bme(e){var t=e,{size:n,color:r}=t,i=Fme(t,["size","color"]);return k.createElement("svg",Mme({width:`${n}px`,height:`${n/4}px`,viewBox:"0 0 120 30",xmlns:"http://www.w3.org/2000/svg",fill:r},i),k.createElement("circle",{cx:"15",cy:"15",r:"15"},k.createElement("animate",{attributeName:"r",from:"15",to:"15",begin:"0s",dur:"0.8s",values:"15;9;15",calcMode:"linear",repeatCount:"indefinite"}),k.createElement("animate",{attributeName:"fill-opacity",from:"1",to:"1",begin:"0s",dur:"0.8s",values:"1;.5;1",calcMode:"linear",repeatCount:"indefinite"})),k.createElement("circle",{cx:"60",cy:"15",r:"9",fillOpacity:"0.3"},k.createElement("animate",{attributeName:"r",from:"9",to:"9",begin:"0s",dur:"0.8s",values:"9;15;9",calcMode:"linear",repeatCount:"indefinite"}),k.createElement("animate",{attributeName:"fill-opacity",from:"0.5",to:"0.5",begin:"0s",dur:"0.8s",values:".5;1;.5",calcMode:"linear",repeatCount:"indefinite"})),k.createElement("circle",{cx:"105",cy:"15",r:"15"},k.createElement("animate",{attributeName:"r",from:"15",to:"15",begin:"0s",dur:"0.8s",values:"15;9;15",calcMode:"linear",repeatCount:"indefinite"}),k.createElement("animate",{attributeName:"fill-opacity",from:"1",to:"1",begin:"0s",dur:"0.8s",values:"1;.5;1",calcMode:"linear",repeatCount:"indefinite"})))}var jme=Object.defineProperty,uE=Object.getOwnPropertySymbols,fq=Object.prototype.hasOwnProperty,dq=Object.prototype.propertyIsEnumerable,m4=(e,t,n)=>t in e?jme(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ume=(e,t)=>{for(var n in t||(t={}))fq.call(t,n)&&m4(e,n,t[n]);if(uE)for(var n of uE(t))dq.call(t,n)&&m4(e,n,t[n]);return e},Vme=(e,t)=>{var n={};for(var r in e)fq.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&uE)for(var r of uE(e))t.indexOf(r)<0&&dq.call(e,r)&&(n[r]=e[r]);return n};const AC={bars:Rme,oval:$me,dots:Bme},zme={xs:18,sm:22,md:36,lg:44,xl:58},Hme={size:"md"};function Lm(e){const t=ct("Loader",Hme,e),{size:n,color:r,variant:i}=t,s=Vme(t,["size","color","variant"]),o=ts(),a=i in AC?i:o.loader;return k.createElement(ut,Ume({role:"presentation",component:AC[a]||AC.bars,size:o.fn.size({size:n,sizes:zme}),color:o.fn.variant({variant:"filled",primaryFallback:!1,color:r||o.primaryColor}).background},s))}Lm.displayName="@mantine/core/Loader";var Wme=Object.defineProperty,lE=Object.getOwnPropertySymbols,hq=Object.prototype.hasOwnProperty,pq=Object.prototype.propertyIsEnumerable,g4=(e,t,n)=>t in e?Wme(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,y4=(e,t)=>{for(var n in t||(t={}))hq.call(t,n)&&g4(e,n,t[n]);if(lE)for(var n of lE(t))pq.call(t,n)&&g4(e,n,t[n]);return e},qme=(e,t)=>{var n={};for(var r in e)hq.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&lE)for(var r of lE(e))t.indexOf(r)<0&&pq.call(e,r)&&(n[r]=e[r]);return n};const Yme={color:"gray",size:"md",variant:"subtle",loading:!1},mq=w.forwardRef((e,t)=>{const n=ct("ActionIcon",Yme,e),{className:r,color:i,children:s,radius:o,size:a,variant:u,gradient:l,disabled:c,loaderProps:f,loading:d,unstyled:h}=n,p=qme(n,["className","color","children","radius","size","variant","gradient","disabled","loaderProps","loading","unstyled"]),{classes:m,cx:y,theme:g}=Cme({size:a,radius:o,color:i,variant:u,gradient:l},{name:"ActionIcon",unstyled:h}),_=g.fn.variant({color:i,variant:u}),b=k.createElement(Lm,y4({color:_.color,size:g.fn.size({size:a,sizes:n0})-12},f));return k.createElement(ck,y4({className:y(m.root,r),ref:t,disabled:c,"data-disabled":c||void 0,"data-loading":d||void 0,unstyled:h},p),d?b:s)});mq.displayName="@mantine/core/ActionIcon";const fk=mq;function gq(e){const{children:t,target:n,className:r}=ct("Portal",{},e),i=ts(),[s,o]=w.useState(!1),a=w.useRef();return uk(()=>(o(!0),a.current=n?typeof n=="string"?document.querySelector(n):n:document.createElement("div"),n||document.body.appendChild(a.current),()=>{!n&&document.body.removeChild(a.current)}),[n]),s?b_.createPortal(k.createElement("div",{className:r,dir:i.dir},t),a.current):null}gq.displayName="@mantine/core/Portal";var Gme=Object.defineProperty,cE=Object.getOwnPropertySymbols,yq=Object.prototype.hasOwnProperty,_q=Object.prototype.propertyIsEnumerable,_4=(e,t,n)=>t in e?Gme(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Kme=(e,t)=>{for(var n in t||(t={}))yq.call(t,n)&&_4(e,n,t[n]);if(cE)for(var n of cE(t))_q.call(t,n)&&_4(e,n,t[n]);return e},Qme=(e,t)=>{var n={};for(var r in e)yq.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&cE)for(var r of cE(e))t.indexOf(r)<0&&_q.call(e,r)&&(n[r]=e[r]);return n};function S_(e){var t=e,{withinPortal:n=!0,children:r}=t,i=Qme(t,["withinPortal","children"]);return n?k.createElement(gq,Kme({},i),r):k.createElement(k.Fragment,null,r)}S_.displayName="@mantine/core/OptionalPortal";var Xme=Object.defineProperty,Jme=Object.defineProperties,Zme=Object.getOwnPropertyDescriptors,v4=Object.getOwnPropertySymbols,ege=Object.prototype.hasOwnProperty,tge=Object.prototype.propertyIsEnumerable,b4=(e,t,n)=>t in e?Xme(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,OC=(e,t)=>{for(var n in t||(t={}))ege.call(t,n)&&b4(e,n,t[n]);if(v4)for(var n of v4(t))tge.call(t,n)&&b4(e,n,t[n]);return e},E4=(e,t)=>Jme(e,Zme(t));function nge({variant:e,color:t,theme:n}){if(e==="filled")return{backgroundColor:n.fn.variant({variant:"filled",color:t}).background,color:n.white};if(e==="outline"){const i=n.fn.variant({variant:"outline",color:t});return{color:i.color,borderColor:i.border,backgroundColor:n.colorScheme==="dark"?n.colors.dark[6]:n.white}}const r=n.fn.variant({variant:"light",color:t});return{backgroundColor:r.background,color:r.color}}var rge=at((e,{color:t,radius:n,variant:r})=>({root:OC(E4(OC({},e.fn.fontStyles()),{position:"relative",overflow:"hidden",padding:`${e.spacing.sm}px ${e.spacing.md}px`,borderRadius:e.fn.radius(n),border:"1px solid transparent"}),nge({variant:r,color:t,theme:e})),wrapper:{display:"flex"},body:{flex:1},title:{boxSizing:"border-box",margin:0,marginBottom:7,display:"flex",alignItems:"center",justifyContent:"space-between",lineHeight:e.lineHeight,fontSize:e.fontSizes.sm,fontWeight:700,"&[data-with-close-button]":{paddingRight:e.spacing.md}},label:{display:"block",overflow:"hidden",textOverflow:"ellipsis"},icon:{lineHeight:1,width:20,height:20,display:"flex",alignItems:"center",justifyContent:"flex-start",marginRight:e.spacing.md,marginTop:1},message:E4(OC({},e.fn.fontStyles()),{lineHeight:e.lineHeight,textOverflow:"ellipsis",overflow:"hidden",fontSize:e.fontSizes.sm,color:r==="filled"?e.white:e.colorScheme==="dark"?r==="light"?e.white:e.colors.dark[0]:e.black}),closeButton:{position:"absolute",top:e.spacing.sm,right:e.spacing.sm,color:"inherit"}}));const ige=rge;var sge=Object.defineProperty,w4=Object.getOwnPropertySymbols,oge=Object.prototype.hasOwnProperty,age=Object.prototype.propertyIsEnumerable,T4=(e,t,n)=>t in e?sge(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,uge=(e,t)=>{for(var n in t||(t={}))oge.call(t,n)&&T4(e,n,t[n]);if(w4)for(var n of w4(t))age.call(t,n)&&T4(e,n,t[n]);return e};function vq(e){return k.createElement("svg",uge({viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),k.createElement("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}vq.displayName="@mantine/core/CloseIcon";var lge=Object.defineProperty,fE=Object.getOwnPropertySymbols,bq=Object.prototype.hasOwnProperty,Eq=Object.prototype.propertyIsEnumerable,S4=(e,t,n)=>t in e?lge(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,cge=(e,t)=>{for(var n in t||(t={}))bq.call(t,n)&&S4(e,n,t[n]);if(fE)for(var n of fE(t))Eq.call(t,n)&&S4(e,n,t[n]);return e},fge=(e,t)=>{var n={};for(var r in e)bq.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&fE)for(var r of fE(e))t.indexOf(r)<0&&Eq.call(e,r)&&(n[r]=e[r]);return n};const dge={xs:12,sm:14,md:16,lg:20,xl:24},hge={size:"md"},wq=w.forwardRef((e,t)=>{const n=ct("CloseButton",hge,e),{iconSize:r,size:i="md"}=n,s=fge(n,["iconSize","size"]),o=ts(),a=r||o.fn.size({size:i,sizes:dge});return k.createElement(fk,cge({size:i,ref:t},s),k.createElement(vq,{width:a,height:a}))});wq.displayName="@mantine/core/CloseButton";const zS=wq;var pge=Object.defineProperty,dE=Object.getOwnPropertySymbols,Tq=Object.prototype.hasOwnProperty,Sq=Object.prototype.propertyIsEnumerable,I4=(e,t,n)=>t in e?pge(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,mge=(e,t)=>{for(var n in t||(t={}))Tq.call(t,n)&&I4(e,n,t[n]);if(dE)for(var n of dE(t))Sq.call(t,n)&&I4(e,n,t[n]);return e},gge=(e,t)=>{var n={};for(var r in e)Tq.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&dE)for(var r of dE(e))t.indexOf(r)<0&&Sq.call(e,r)&&(n[r]=e[r]);return n};const yge={variant:"light"},Iq=w.forwardRef((e,t)=>{const n=ct("Alert",yge,e),{id:r,className:i,title:s,variant:o,children:a,color:u,classNames:l,icon:c,styles:f,onClose:d,radius:h,withCloseButton:p,closeButtonLabel:m,unstyled:y}=n,g=gge(n,["id","className","title","variant","children","color","classNames","icon","styles","onClose","radius","withCloseButton","closeButtonLabel","unstyled"]),{classes:_,cx:b}=ige({color:u,radius:h,variant:o},{classNames:l,styles:f,unstyled:y,name:"Alert"}),T=Fu(r),I=s&&`${T}-title`,E=`${T}-body`;return k.createElement(ut,mge({id:T,role:"alert","aria-labelledby":I,"aria-describedby":E,className:b(_.root,_[o],i),ref:t},g),k.createElement("div",{className:_.wrapper},c&&k.createElement("div",{className:_.icon},c),k.createElement("div",{className:_.body},s&&k.createElement("div",{className:_.title,"data-with-close-button":p||void 0},k.createElement("span",{id:I,className:_.label},s)),p&&k.createElement(zS,{className:_.closeButton,onClick:d,variant:"transparent",size:16,iconSize:16,"aria-label":m}),k.createElement("div",{id:E,className:_.message},a))))});Iq.displayName="@mantine/core/Alert";var _ge=Object.defineProperty,vge=Object.defineProperties,bge=Object.getOwnPropertyDescriptors,x4=Object.getOwnPropertySymbols,Ege=Object.prototype.hasOwnProperty,wge=Object.prototype.propertyIsEnumerable,C4=(e,t,n)=>t in e?_ge(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,jv=(e,t)=>{for(var n in t||(t={}))Ege.call(t,n)&&C4(e,n,t[n]);if(x4)for(var n of x4(t))wge.call(t,n)&&C4(e,n,t[n]);return e},Tge=(e,t)=>vge(e,bge(t));function Sge({underline:e,strikethrough:t}){const n=[];return e&&n.push("underline"),t&&n.push("line-through"),n.length>0?n.join(" "):"none"}function Ige({theme:e,color:t,variant:n}){return t==="dimmed"?e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6]:typeof t=="string"&&(t in e.colors||t.split(".")[0]in e.colors)?e.fn.variant({variant:"filled",color:t}).background:n==="link"?e.colors[e.primaryColor][e.colorScheme==="dark"?4:7]:t||"inherit"}function xge(e){return typeof e=="number"?{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:e,WebkitBoxOrient:"vertical"}:null}var Cge=at((e,{color:t,variant:n,size:r,lineClamp:i,inline:s,inherit:o,underline:a,gradient:u,weight:l,transform:c,align:f,strikethrough:d,italic:h})=>{const p=e.fn.variant({variant:"gradient",gradient:u});return{root:jv(Tge(jv(jv(jv({},e.fn.fontStyles()),e.fn.focusStyles()),xge(i)),{color:Ige({color:t,theme:e,variant:n}),fontFamily:o?"inherit":e.fontFamily,fontSize:o||r===void 0?"inherit":e.fn.size({size:r,sizes:e.fontSizes}),lineHeight:o?"inherit":s?1:e.lineHeight,textDecoration:Sge({underline:a,strikethrough:d}),WebkitTapHighlightColor:"transparent",fontWeight:o?"inherit":l,textTransform:c,textAlign:f,fontStyle:h?"italic":void 0}),e.fn.hover(n==="link"&&a===void 0?{textDecoration:"underline"}:void 0)),gradient:{backgroundImage:p.background,WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"}}});const Age=Cge;var Oge=Object.defineProperty,hE=Object.getOwnPropertySymbols,xq=Object.prototype.hasOwnProperty,Cq=Object.prototype.propertyIsEnumerable,A4=(e,t,n)=>t in e?Oge(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Pge=(e,t)=>{for(var n in t||(t={}))xq.call(t,n)&&A4(e,n,t[n]);if(hE)for(var n of hE(t))Cq.call(t,n)&&A4(e,n,t[n]);return e},Rge=(e,t)=>{var n={};for(var r in e)xq.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&hE)for(var r of hE(e))t.indexOf(r)<0&&Cq.call(e,r)&&(n[r]=e[r]);return n};const Nge={variant:"text"},Aq=w.forwardRef((e,t)=>{const n=ct("Text",Nge,e),{className:r,size:i,weight:s,transform:o,color:a,align:u,variant:l,lineClamp:c,gradient:f,inline:d,inherit:h,underline:p,strikethrough:m,italic:y,classNames:g,styles:_,unstyled:b,span:T}=n,I=Rge(n,["className","size","weight","transform","color","align","variant","lineClamp","gradient","inline","inherit","underline","strikethrough","italic","classNames","styles","unstyled","span"]),{classes:E,cx:S}=Age({variant:l,color:a,size:i,lineClamp:c,inline:d,inherit:h,underline:p,strikethrough:m,italic:y,weight:s,transform:o,align:u,gradient:f},{unstyled:b,name:"Text"});return k.createElement(ut,Pge({ref:t,className:S(E.root,{[E.gradient]:l==="gradient"},r),component:T?"span":"div"},I))});Aq.displayName="@mantine/core/Text";const Tt=Aq;var kge=at(()=>({root:{backgroundColor:"transparent",cursor:"pointer",padding:0,border:0}}));const Dge=kge;var $ge=Object.defineProperty,pE=Object.getOwnPropertySymbols,Oq=Object.prototype.hasOwnProperty,Pq=Object.prototype.propertyIsEnumerable,O4=(e,t,n)=>t in e?$ge(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,P4=(e,t)=>{for(var n in t||(t={}))Oq.call(t,n)&&O4(e,n,t[n]);if(pE)for(var n of pE(t))Pq.call(t,n)&&O4(e,n,t[n]);return e},Lge=(e,t)=>{var n={};for(var r in e)Oq.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&pE)for(var r of pE(e))t.indexOf(r)<0&&Pq.call(e,r)&&(n[r]=e[r]);return n};const Mge={},Rq=w.forwardRef((e,t)=>{const n=ct("Anchor",Mge,e),{component:r,className:i,unstyled:s}=n,o=Lge(n,["component","className","unstyled"]),{classes:a,cx:u}=Dge(null,{name:"Anchor",unstyled:s}),l=r==="button"?{type:"button"}:null;return k.createElement(Tt,P4(P4({component:r||"a",variant:"link",ref:t,className:u(a.root,i)},l),o))});Rq.displayName="@mantine/core/Anchor";const Nq=Rq,kq=w.createContext({}),Fge=kq.Provider;function Dq(){return w.useContext(kq)}function HS(e,t){if(!e)return[];const n=Object.keys(e).filter(r=>r!=="base").map(r=>[t.fn.size({size:r,sizes:t.breakpoints}),e[r]]);return n.sort((r,i)=>r[0]-i[0]),n}var Bge=Object.defineProperty,jge=Object.defineProperties,Uge=Object.getOwnPropertyDescriptors,R4=Object.getOwnPropertySymbols,Vge=Object.prototype.hasOwnProperty,zge=Object.prototype.propertyIsEnumerable,N4=(e,t,n)=>t in e?Bge(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Uv=(e,t)=>{for(var n in t||(t={}))Vge.call(t,n)&&N4(e,n,t[n]);if(R4)for(var n of R4(t))zge.call(t,n)&&N4(e,n,t[n]);return e},k4=(e,t)=>jge(e,Uge(t)),Hge=at((e,{height:t,width:n,fixed:r,position:i,hiddenBreakpoint:s,zIndex:o,section:a,withBorder:u})=>{const l=typeof n=="object"&&n!==null?HS(n,e).reduce((f,[d,h])=>(f[`@media (min-width: ${d}px)`]={width:h,minWidth:h},f),{}):null,c=u?{[a==="navbar"?"borderRight":"borderLeft"]:`1px solid ${e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[2]}`}:{};return{root:k4(Uv(Uv(k4(Uv(Uv({},e.fn.fontStyles()),i),{top:(i==null?void 0:i.top)||"var(--mantine-header-height)",bottom:0,zIndex:o,height:t||"calc(100vh - var(--mantine-header-height, 0px) - var(--mantine-footer-height, 0px))",width:(n==null?void 0:n.base)||"100%",position:r?"fixed":"static",boxSizing:"border-box",display:"flex",flexDirection:"column",backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.white}),c),l),{"&[data-hidden]":{[`@media (max-width: ${e.fn.size({size:s,sizes:e.breakpoints})-1}px)`]:{display:"none"}}})}});const Wge=Hge;var qge=Object.defineProperty,mE=Object.getOwnPropertySymbols,$q=Object.prototype.hasOwnProperty,Lq=Object.prototype.propertyIsEnumerable,D4=(e,t,n)=>t in e?qge(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$4=(e,t)=>{for(var n in t||(t={}))$q.call(t,n)&&D4(e,n,t[n]);if(mE)for(var n of mE(t))Lq.call(t,n)&&D4(e,n,t[n]);return e},Yge=(e,t)=>{var n={};for(var r in e)$q.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&mE)for(var r of mE(e))t.indexOf(r)<0&&Lq.call(e,r)&&(n[r]=e[r]);return n};const dk=w.forwardRef((e,t)=>{var n=e,{width:r,height:i,fixed:s=!1,position:o,zIndex:a=To("app"),hiddenBreakpoint:u="md",hidden:l=!1,withBorder:c=!0,className:f,classNames:d,styles:h,children:p,section:m,__staticSelector:y,unstyled:g}=n,_=Yge(n,["width","height","fixed","position","zIndex","hiddenBreakpoint","hidden","withBorder","className","classNames","styles","children","section","__staticSelector","unstyled"]);const b=Dq(),{classes:T,cx:I,theme:E}=Wge({width:r,height:i,fixed:b.fixed||s,position:o,hiddenBreakpoint:u,zIndex:b.zIndex||a,section:m,withBorder:c},{classNames:d,styles:h,name:y,unstyled:g}),S=HS(r,E).reduce((A,[P,V])=>(A[`@media (min-width: ${P}px)`]={[`--mantine-${m}-width`]:`${V}px`},A),{});return k.createElement(ut,$4({component:m==="navbar"?"nav":"aside",ref:t,"data-hidden":l||void 0,className:I(T.root,f)},_),p,k.createElement(UW,{styles:()=>({":root":$4({[`--mantine-${m}-width`]:r!=null&&r.base?`${r.base}px`:"0px"},S)})}))});dk.displayName="@mantine/core/HorizontalSection";var Gge=Object.defineProperty,gE=Object.getOwnPropertySymbols,Mq=Object.prototype.hasOwnProperty,Fq=Object.prototype.propertyIsEnumerable,L4=(e,t,n)=>t in e?Gge(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Kge=(e,t)=>{for(var n in t||(t={}))Mq.call(t,n)&&L4(e,n,t[n]);if(gE)for(var n of gE(t))Fq.call(t,n)&&L4(e,n,t[n]);return e},Qge=(e,t)=>{var n={};for(var r in e)Mq.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&gE)for(var r of gE(e))t.indexOf(r)<0&&Fq.call(e,r)&&(n[r]=e[r]);return n};const Bq=w.forwardRef((e,t)=>{var n=e,{children:r,grow:i=!1,sx:s}=n,o=Qge(n,["children","grow","sx"]);return k.createElement(ut,Kge({ref:t,sx:[{flex:i?1:0,boxSizing:"border-box"},...Rd(s)]},o),r)});Bq.displayName="@mantine/core/Section";const jq=Bq;var Xge=Object.defineProperty,M4=Object.getOwnPropertySymbols,Jge=Object.prototype.hasOwnProperty,Zge=Object.prototype.propertyIsEnumerable,F4=(e,t,n)=>t in e?Xge(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,e0e=(e,t)=>{for(var n in t||(t={}))Jge.call(t,n)&&F4(e,n,t[n]);if(M4)for(var n of M4(t))Zge.call(t,n)&&F4(e,n,t[n]);return e};const t0e={fixed:!1,position:{top:0,left:0},zIndex:To("app"),hiddenBreakpoint:"md",hidden:!1},C0=w.forwardRef((e,t)=>{const n=ct("Navbar",t0e,e);return k.createElement(dk,e0e({section:"navbar",__staticSelector:"Navbar",ref:t},n))});C0.Section=jq;C0.displayName="@mantine/core/Navbar";var n0e=Object.defineProperty,r0e=Object.defineProperties,i0e=Object.getOwnPropertyDescriptors,B4=Object.getOwnPropertySymbols,s0e=Object.prototype.hasOwnProperty,o0e=Object.prototype.propertyIsEnumerable,j4=(e,t,n)=>t in e?n0e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,PC=(e,t)=>{for(var n in t||(t={}))s0e.call(t,n)&&j4(e,n,t[n]);if(B4)for(var n of B4(t))o0e.call(t,n)&&j4(e,n,t[n]);return e},U4=(e,t)=>r0e(e,i0e(t)),a0e=at((e,{height:t,fixed:n,position:r,zIndex:i,borderPosition:s})=>{const o=typeof t=="object"&&t!==null?HS(t,e).reduce((a,[u,l])=>(a[`@media (min-width: ${u}px)`]={height:l,minHeight:l},a),{}):null;return{root:U4(PC(U4(PC(PC({},e.fn.fontStyles()),r),{zIndex:i,height:typeof t=="object"?(t==null?void 0:t.base)||"100%":t,maxHeight:typeof t=="object"?(t==null?void 0:t.base)||"100%":t,position:n?"fixed":"static",boxSizing:"border-box",backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.white}),o),{borderBottom:s==="bottom"?`1px solid ${e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[2]}`:void 0,borderTop:s==="top"?`1px solid ${e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[2]}`:void 0})}});const u0e=a0e;var l0e=Object.defineProperty,yE=Object.getOwnPropertySymbols,Uq=Object.prototype.hasOwnProperty,Vq=Object.prototype.propertyIsEnumerable,V4=(e,t,n)=>t in e?l0e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,z4=(e,t)=>{for(var n in t||(t={}))Uq.call(t,n)&&V4(e,n,t[n]);if(yE)for(var n of yE(t))Vq.call(t,n)&&V4(e,n,t[n]);return e},c0e=(e,t)=>{var n={};for(var r in e)Uq.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&yE)for(var r of yE(e))t.indexOf(r)<0&&Vq.call(e,r)&&(n[r]=e[r]);return n};const zq=w.forwardRef((e,t)=>{var n=e,{children:r,className:i,classNames:s,styles:o,height:a,fixed:u=!1,withBorder:l=!0,position:c,zIndex:f=To("app"),section:d,unstyled:h,__staticSelector:p}=n,m=c0e(n,["children","className","classNames","styles","height","fixed","withBorder","position","zIndex","section","unstyled","__staticSelector"]);const y=Dq(),{classes:g,cx:_,theme:b}=u0e({height:a,fixed:y.fixed||u,position:c,zIndex:y.zIndex||f,borderPosition:l?d==="header"?"bottom":"top":"none"},{name:p,classNames:s,styles:o,unstyled:h}),T=typeof a=="object"&&a!==null?HS(a,b).reduce((I,[E,S])=>(I[`@media (min-width: ${E}px)`]={[`--mantine-${d}-height`]:`${S}px`},I),{}):null;return k.createElement(ut,z4({component:d==="header"?"header":"footer",className:_(g.root,i),ref:t},m),r,k.createElement(UW,{styles:()=>({":root":z4({[`--mantine-${d}-height`]:typeof a=="object"?`${a==null?void 0:a.base}px`||"100%":`${a}px`},T)})}))});zq.displayName="@mantine/core/VerticalSection";var f0e=Object.defineProperty,d0e=Object.defineProperties,h0e=Object.getOwnPropertyDescriptors,H4=Object.getOwnPropertySymbols,p0e=Object.prototype.hasOwnProperty,m0e=Object.prototype.propertyIsEnumerable,W4=(e,t,n)=>t in e?f0e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,g0e=(e,t)=>{for(var n in t||(t={}))p0e.call(t,n)&&W4(e,n,t[n]);if(H4)for(var n of H4(t))m0e.call(t,n)&&W4(e,n,t[n]);return e},y0e=(e,t)=>d0e(e,h0e(t));const _0e={fixed:!1,position:{top:0,left:0,right:0},zIndex:To("app")},Hq=w.forwardRef((e,t)=>{const n=ct("Header",_0e,e);return k.createElement(zq,y0e(g0e({section:"header",__staticSelector:"Header"},n),{ref:t}))});Hq.displayName="@mantine/core/Header";var v0e=Object.defineProperty,q4=Object.getOwnPropertySymbols,b0e=Object.prototype.hasOwnProperty,E0e=Object.prototype.propertyIsEnumerable,Y4=(e,t,n)=>t in e?v0e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,w0e=(e,t)=>{for(var n in t||(t={}))b0e.call(t,n)&&Y4(e,n,t[n]);if(q4)for(var n of q4(t))E0e.call(t,n)&&Y4(e,n,t[n]);return e};const T0e={fixed:!1,position:{top:0,right:0},zIndex:To("app"),hiddenBreakpoint:"md",hidden:!1},Qh=w.forwardRef((e,t)=>{const n=ct("Aside",T0e,e);return k.createElement(dk,w0e({section:"aside",__staticSelector:"Aside",ref:t},n))});Qh.Section=jq;Qh.displayName="@mantine/core/Aside";var S0e=Object.defineProperty,G4=Object.getOwnPropertySymbols,I0e=Object.prototype.hasOwnProperty,x0e=Object.prototype.propertyIsEnumerable,K4=(e,t,n)=>t in e?S0e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,C0e=(e,t)=>{for(var n in t||(t={}))I0e.call(t,n)&&K4(e,n,t[n]);if(G4)for(var n of G4(t))x0e.call(t,n)&&K4(e,n,t[n]);return e};function A0e(e,t){const n=t.fn.size({size:e.padding,sizes:t.spacing}),r=e.navbarOffsetBreakpoint?t.fn.size({size:e.navbarOffsetBreakpoint,sizes:t.breakpoints}):null,i=e.asideOffsetBreakpoint?t.fn.size({size:e.asideOffsetBreakpoint,sizes:t.breakpoints}):null;return e.fixed?{minHeight:"100vh",paddingTop:`calc(var(--mantine-header-height, 0px) + ${n}px)`,paddingBottom:`calc(var(--mantine-footer-height, 0px) + ${n}px)`,paddingLeft:`calc(var(--mantine-navbar-width, 0px) + ${n}px)`,paddingRight:`calc(var(--mantine-aside-width, 0px) + ${n}px)`,[`@media (max-width: ${r-1}px)`]:{paddingLeft:n},[`@media (max-width: ${i-1}px)`]:{paddingRight:n}}:{padding:n}}var O0e=at((e,t)=>({root:{boxSizing:"border-box"},body:{display:"flex",boxSizing:"border-box"},main:C0e({flex:1,width:"100vw",boxSizing:"border-box"},A0e(t,e))}));const P0e=O0e;var R0e=Object.defineProperty,_E=Object.getOwnPropertySymbols,Wq=Object.prototype.hasOwnProperty,qq=Object.prototype.propertyIsEnumerable,Q4=(e,t,n)=>t in e?R0e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,N0e=(e,t)=>{for(var n in t||(t={}))Wq.call(t,n)&&Q4(e,n,t[n]);if(_E)for(var n of _E(t))qq.call(t,n)&&Q4(e,n,t[n]);return e},k0e=(e,t)=>{var n={};for(var r in e)Wq.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&_E)for(var r of _E(e))t.indexOf(r)<0&&qq.call(e,r)&&(n[r]=e[r]);return n};const D0e={fixed:!0,zIndex:To("app"),padding:"md"},Yq=w.forwardRef((e,t)=>{const n=ct("AppShell",D0e,e),{children:r,navbar:i,header:s,footer:o,aside:a,fixed:u,zIndex:l,padding:c,navbarOffsetBreakpoint:f,asideOffsetBreakpoint:d,className:h,styles:p,classNames:m,unstyled:y,hidden:g}=n,_=k0e(n,["children","navbar","header","footer","aside","fixed","zIndex","padding","navbarOffsetBreakpoint","asideOffsetBreakpoint","className","styles","classNames","unstyled","hidden"]),{classes:b,cx:T}=P0e({padding:c,fixed:u,navbarOffsetBreakpoint:f,asideOffsetBreakpoint:d},{styles:p,classNames:m,unstyled:y,name:"AppShell"});return g?k.createElement(k.Fragment,null,r):k.createElement(Fge,{value:{fixed:u,zIndex:l}},k.createElement(ut,N0e({className:T(b.root,h),ref:t},_),s,k.createElement("div",{className:b.body},i,k.createElement("main",{className:b.main},r),a),o))});Yq.displayName="@mantine/core/AppShell";const Vv={xs:1,sm:2,md:3,lg:4,xl:5};function zv(e,t){const n=e.fn.variant({variant:"outline",color:t}).border;return typeof t=="string"&&(t in e.colors||t.split(".")[0]in e.colors)?n:t===void 0?e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]:t}var $0e=at((e,{size:t,variant:n,color:r})=>({root:{},withLabel:{borderTop:"0 !important"},left:{"&::before":{display:"none"}},right:{"&::after":{display:"none"}},label:{display:"flex",alignItems:"center","&::before":{content:'""',flex:1,height:1,borderTop:`${e.fn.size({size:t,sizes:Vv})}px ${n} ${zv(e,r)}`,marginRight:e.spacing.xs},"&::after":{content:'""',flex:1,borderTop:`${e.fn.size({size:t,sizes:Vv})}px ${n} ${zv(e,r)}`,marginLeft:e.spacing.xs}},labelDefaultStyles:{color:r==="dark"?e.colors.dark[1]:e.fn.themeColor(r,e.colorScheme==="dark"?5:e.fn.primaryShade(),!1)},horizontal:{border:0,borderTopWidth:e.fn.size({size:t,sizes:Vv}),borderTopColor:zv(e,r),borderTopStyle:n,margin:0},vertical:{border:0,alignSelf:"stretch",height:"auto",borderLeftWidth:e.fn.size({size:t,sizes:Vv}),borderLeftColor:zv(e,r),borderLeftStyle:n}}));const L0e=$0e;var M0e=Object.defineProperty,F0e=Object.defineProperties,B0e=Object.getOwnPropertyDescriptors,vE=Object.getOwnPropertySymbols,Gq=Object.prototype.hasOwnProperty,Kq=Object.prototype.propertyIsEnumerable,X4=(e,t,n)=>t in e?M0e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,J4=(e,t)=>{for(var n in t||(t={}))Gq.call(t,n)&&X4(e,n,t[n]);if(vE)for(var n of vE(t))Kq.call(t,n)&&X4(e,n,t[n]);return e},j0e=(e,t)=>F0e(e,B0e(t)),U0e=(e,t)=>{var n={};for(var r in e)Gq.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&vE)for(var r of vE(e))t.indexOf(r)<0&&Kq.call(e,r)&&(n[r]=e[r]);return n};const V0e={orientation:"horizontal",size:"xs",labelPosition:"left",variant:"solid"},gd=w.forwardRef((e,t)=>{const n=ct("Divider",V0e,e),{className:r,color:i,orientation:s,size:o,label:a,labelPosition:u,labelProps:l,variant:c,styles:f,classNames:d,unstyled:h}=n,p=U0e(n,["className","color","orientation","size","label","labelPosition","labelProps","variant","styles","classNames","unstyled"]),{classes:m,cx:y}=L0e({color:i,size:o,variant:c},{classNames:d,styles:f,unstyled:h,name:"Divider"}),g=s==="vertical",_=s==="horizontal",b=!!a&&_,T=!(l!=null&&l.color);return k.createElement(ut,J4({ref:t,className:y(m.root,{[m.vertical]:g,[m.horizontal]:_,[m.withLabel]:b},r),role:"separator"},p),b&&k.createElement(Tt,j0e(J4({},l),{size:(l==null?void 0:l.size)||"xs",sx:{marginTop:2},className:y(m.label,m[u],{[m.labelDefaultStyles]:T})}),a))});gd.displayName="@mantine/core/Divider";var z0e=Object.defineProperty,H0e=Object.defineProperties,W0e=Object.getOwnPropertyDescriptors,Z4=Object.getOwnPropertySymbols,q0e=Object.prototype.hasOwnProperty,Y0e=Object.prototype.propertyIsEnumerable,e5=(e,t,n)=>t in e?z0e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,t5=(e,t)=>{for(var n in t||(t={}))q0e.call(t,n)&&e5(e,n,t[n]);if(Z4)for(var n of Z4(t))Y0e.call(t,n)&&e5(e,n,t[n]);return e},G0e=(e,t)=>H0e(e,W0e(t)),K0e=at((e,{size:t})=>({item:G0e(t5({},e.fn.fontStyles()),{boxSizing:"border-box",textAlign:"left",width:"100%",padding:`${e.fn.size({size:t,sizes:e.spacing})/1.5}px ${e.fn.size({size:t,sizes:e.spacing})}px`,cursor:"pointer",fontSize:e.fn.size({size:t,sizes:e.fontSizes}),color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,borderRadius:e.radius.sm,"&[data-hovered]":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[1]},"&[data-selected]":t5({backgroundColor:e.fn.variant({variant:"filled"}).background,color:e.fn.variant({variant:"filled"}).color},e.fn.hover({backgroundColor:e.fn.variant({variant:"filled"}).hover})),"&[data-disabled]":{cursor:"default",color:e.colors.dark[2]}}),nothingFound:{boxSizing:"border-box",color:e.colors.gray[6],paddingTop:e.fn.size({size:t,sizes:e.spacing})/2,paddingBottom:e.fn.size({size:t,sizes:e.spacing})/2,textAlign:"center"},separator:{boxSizing:"border-box",textAlign:"left",width:"100%",padding:`${e.fn.size({size:t,sizes:e.spacing})/1.5}px ${e.fn.size({size:t,sizes:e.spacing})}px`},separatorLabel:{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]}}));const Q0e=K0e;var X0e=Object.defineProperty,n5=Object.getOwnPropertySymbols,J0e=Object.prototype.hasOwnProperty,Z0e=Object.prototype.propertyIsEnumerable,r5=(e,t,n)=>t in e?X0e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,eye=(e,t)=>{for(var n in t||(t={}))J0e.call(t,n)&&r5(e,n,t[n]);if(n5)for(var n of n5(t))Z0e.call(t,n)&&r5(e,n,t[n]);return e};function hk({data:e,hovered:t,classNames:n,styles:r,isItemSelected:i,uuid:s,__staticSelector:o,onItemHover:a,onItemSelect:u,itemsRefs:l,itemComponent:c,size:f,nothingFound:d,creatable:h,createLabel:p,unstyled:m}){const{classes:y}=Q0e({size:f},{classNames:n,styles:r,unstyled:m,name:o}),g=[],_=[];let b=null;const T=(E,S)=>{const A=typeof i=="function"?i(E.value):!1;return k.createElement(c,eye({key:E.value,className:y.item,"data-disabled":E.disabled||void 0,"data-hovered":!E.disabled&&t===S||void 0,"data-selected":!E.disabled&&A||void 0,onMouseEnter:()=>a(S),id:`${s}-${S}`,role:"option",tabIndex:-1,"aria-selected":t===S,ref:P=>{l&&l.current&&(l.current[E.value]=P)},onMouseDown:E.disabled?null:P=>{P.preventDefault(),u(E)},disabled:E.disabled},E))};let I=null;if(e.forEach((E,S)=>{E.creatable?b=S:E.group?(I!==E.group&&(I=E.group,_.push(k.createElement("div",{className:y.separator,key:`__mantine-divider-${S}`},k.createElement(gd,{classNames:{label:y.separatorLabel},label:E.group})))),_.push(T(E,S))):g.push(T(E,S))}),h){const E=e[b];g.push(k.createElement("div",{key:Vpe(),className:y.item,"data-hovered":t===b||void 0,onMouseEnter:()=>a(b),onMouseDown:S=>{S.preventDefault(),u(E)},tabIndex:-1,ref:S=>{l&&l.current&&(l.current[E.value]=S)}},p))}return _.length>0&&g.length>0&&g.unshift(k.createElement("div",{className:y.separator,key:"empty-group-separator"},k.createElement(gd,null))),_.length>0||g.length>0?k.createElement(k.Fragment,null,_,g):k.createElement(Tt,{size:f,unstyled:m,className:y.nothingFound},d)}hk.displayName="@mantine/core/SelectItems";var tye=Object.defineProperty,bE=Object.getOwnPropertySymbols,Qq=Object.prototype.hasOwnProperty,Xq=Object.prototype.propertyIsEnumerable,i5=(e,t,n)=>t in e?tye(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,nye=(e,t)=>{for(var n in t||(t={}))Qq.call(t,n)&&i5(e,n,t[n]);if(bE)for(var n of bE(t))Xq.call(t,n)&&i5(e,n,t[n]);return e},rye=(e,t)=>{var n={};for(var r in e)Qq.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&bE)for(var r of bE(e))t.indexOf(r)<0&&Xq.call(e,r)&&(n[r]=e[r]);return n};const pk=w.forwardRef((e,t)=>{var n=e,{label:r,value:i}=n,s=rye(n,["label","value"]);return k.createElement("div",nye({ref:t},s),r||i)});pk.displayName="@mantine/core/DefaultItem";function iye(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Jq(...e){return t=>e.forEach(n=>iye(n,t))}function Jd(...e){return w.useCallback(Jq(...e),e)}const Zq=w.forwardRef((e,t)=>{const{children:n,...r}=e,i=w.Children.toArray(n),s=i.find(oye);if(s){const o=s.props.children,a=i.map(u=>u===s?w.Children.count(o)>1?w.Children.only(null):w.isValidElement(o)?o.props.children:null:u);return w.createElement(kP,cr({},r,{ref:t}),w.isValidElement(o)?w.cloneElement(o,void 0,a):null)}return w.createElement(kP,cr({},r,{ref:t}),n)});Zq.displayName="Slot";const kP=w.forwardRef((e,t)=>{const{children:n,...r}=e;return w.isValidElement(n)?w.cloneElement(n,{...aye(r,n.props),ref:Jq(t,n.ref)}):w.Children.count(n)>1?w.Children.only(null):null});kP.displayName="SlotClone";const sye=({children:e})=>w.createElement(w.Fragment,null,e);function oye(e){return w.isValidElement(e)&&e.type===sye}function aye(e,t){const n={...t};for(const r in t){const i=e[r],s=t[r];/^on[A-Z]/.test(r)?n[r]=(...a)=>{s==null||s(...a),i==null||i(...a)}:r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...e,...n}}const uye=["a","button","div","h2","h3","img","li","nav","ol","p","span","svg","ul"],I_=uye.reduce((e,t)=>{const n=w.forwardRef((r,i)=>{const{asChild:s,...o}=r,a=s?Zq:t;return w.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),w.createElement(a,cr({},o,{ref:i}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),DP=globalThis!=null&&globalThis.document?w.useLayoutEffect:()=>{};function lye(e,t){return w.useReducer((n,r)=>{const i=t[n][r];return i??n},e)}const x_=e=>{const{present:t,children:n}=e,r=cye(t),i=typeof n=="function"?n({present:r.isPresent}):w.Children.only(n),s=Jd(r.ref,i.ref);return typeof n=="function"||r.isPresent?w.cloneElement(i,{ref:s}):null};x_.displayName="Presence";function cye(e){const[t,n]=w.useState(),r=w.useRef({}),i=w.useRef(e),s=w.useRef("none"),o=e?"mounted":"unmounted",[a,u]=lye(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const l=Hv(r.current);s.current=a==="mounted"?l:"none"},[a]),DP(()=>{const l=r.current,c=i.current;if(c!==e){const d=s.current,h=Hv(l);e?u("MOUNT"):h==="none"||(l==null?void 0:l.display)==="none"?u("UNMOUNT"):u(c&&d!==h?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,u]),DP(()=>{if(t){const l=f=>{const h=Hv(r.current).includes(f.animationName);f.target===t&&h&&b_.flushSync(()=>u("ANIMATION_END"))},c=f=>{f.target===t&&(s.current=Hv(r.current))};return t.addEventListener("animationstart",c),t.addEventListener("animationcancel",l),t.addEventListener("animationend",l),()=>{t.removeEventListener("animationstart",c),t.removeEventListener("animationcancel",l),t.removeEventListener("animationend",l)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:w.useCallback(l=>{l&&(r.current=getComputedStyle(l)),n(l)},[])}}function Hv(e){return(e==null?void 0:e.animationName)||"none"}function fye(e,t=[]){let n=[];function r(s,o){const a=w.createContext(o),u=n.length;n=[...n,o];function l(f){const{scope:d,children:h,...p}=f,m=(d==null?void 0:d[e][u])||a,y=w.useMemo(()=>p,Object.values(p));return w.createElement(m.Provider,{value:y},h)}function c(f,d){const h=(d==null?void 0:d[e][u])||a,p=w.useContext(h);if(p)return p;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${s}\``)}return l.displayName=s+"Provider",[l,c]}const i=()=>{const s=n.map(o=>w.createContext(o));return function(a){const u=(a==null?void 0:a[e])||s;return w.useMemo(()=>({[`__scope${e}`]:{...a,[e]:u}}),[a,u])}};return i.scopeName=e,[r,dye(i,...t)]}function dye(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=r.reduce((a,{useScope:u,scopeName:l})=>{const f=u(s)[`__scope${l}`];return{...a,...f}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function Vf(e){const t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}const hye=w.createContext(void 0);function pye(e){const t=w.useContext(hye);return e||t||"ltr"}function mye(e,[t,n]){return Math.min(n,Math.max(t,e))}function yd(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function gye(e,t){return w.useReducer((n,r)=>{const i=t[n][r];return i??n},e)}const eY="ScrollArea",[tY,hrt]=fye(eY),[yye,Qo]=tY(eY),_ye=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:i,scrollHideDelay:s=600,...o}=e,[a,u]=w.useState(null),[l,c]=w.useState(null),[f,d]=w.useState(null),[h,p]=w.useState(null),[m,y]=w.useState(null),[g,_]=w.useState(0),[b,T]=w.useState(0),[I,E]=w.useState(!1),[S,A]=w.useState(!1),P=Jd(t,M=>u(M)),V=pye(i);return w.createElement(yye,{scope:n,type:r,dir:V,scrollHideDelay:s,scrollArea:a,viewport:l,onViewportChange:c,content:f,onContentChange:d,scrollbarX:h,onScrollbarXChange:p,scrollbarXEnabled:I,onScrollbarXEnabledChange:E,scrollbarY:m,onScrollbarYChange:y,scrollbarYEnabled:S,onScrollbarYEnabledChange:A,onCornerWidthChange:_,onCornerHeightChange:T},w.createElement(I_.div,cr({dir:V},o,{ref:P,style:{position:"relative","--radix-scroll-area-corner-width":g+"px","--radix-scroll-area-corner-height":b+"px",...e.style}})))}),vye="ScrollAreaViewport",bye=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,...i}=e,s=Qo(vye,n),o=w.useRef(null),a=Jd(t,o,s.onViewportChange);return w.createElement(w.Fragment,null,w.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"}}),w.createElement(I_.div,cr({"data-radix-scroll-area-viewport":""},i,{ref:a,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style}}),w.createElement("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"}},r)))}),Vl="ScrollAreaScrollbar",Eye=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Qo(Vl,e.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:o}=i,a=e.orientation==="horizontal";return w.useEffect(()=>(a?s(!0):o(!0),()=>{a?s(!1):o(!1)}),[a,s,o]),i.type==="hover"?w.createElement(wye,cr({},r,{ref:t,forceMount:n})):i.type==="scroll"?w.createElement(Tye,cr({},r,{ref:t,forceMount:n})):i.type==="auto"?w.createElement(nY,cr({},r,{ref:t,forceMount:n})):i.type==="always"?w.createElement(mk,cr({},r,{ref:t})):null}),wye=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Qo(Vl,e.__scopeScrollArea),[s,o]=w.useState(!1);return w.useEffect(()=>{const a=i.scrollArea;let u=0;if(a){const l=()=>{window.clearTimeout(u),o(!0)},c=()=>{u=window.setTimeout(()=>o(!1),i.scrollHideDelay)};return a.addEventListener("pointerenter",l),a.addEventListener("pointerleave",c),()=>{window.clearTimeout(u),a.removeEventListener("pointerenter",l),a.removeEventListener("pointerleave",c)}}},[i.scrollArea,i.scrollHideDelay]),w.createElement(x_,{present:n||s},w.createElement(nY,cr({"data-state":s?"visible":"hidden"},r,{ref:t})))}),Tye=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Qo(Vl,e.__scopeScrollArea),s=e.orientation==="horizontal",o=qS(()=>u("SCROLL_END"),100),[a,u]=gye("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return w.useEffect(()=>{if(a==="idle"){const l=window.setTimeout(()=>u("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(l)}},[a,i.scrollHideDelay,u]),w.useEffect(()=>{const l=i.viewport,c=s?"scrollLeft":"scrollTop";if(l){let f=l[c];const d=()=>{const h=l[c];f!==h&&(u("SCROLL"),o()),f=h};return l.addEventListener("scroll",d),()=>l.removeEventListener("scroll",d)}},[i.viewport,s,u,o]),w.createElement(x_,{present:n||a!=="hidden"},w.createElement(mk,cr({"data-state":a==="hidden"?"hidden":"visible"},r,{ref:t,onPointerEnter:yd(e.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:yd(e.onPointerLeave,()=>u("POINTER_LEAVE"))})))}),nY=w.forwardRef((e,t)=>{const n=Qo(Vl,e.__scopeScrollArea),{forceMount:r,...i}=e,[s,o]=w.useState(!1),a=e.orientation==="horizontal",u=qS(()=>{if(n.viewport){const l=n.viewport.offsetWidth{const{orientation:n="vertical",...r}=e,i=Qo(Vl,e.__scopeScrollArea),s=w.useRef(null),o=w.useRef(0),[a,u]=w.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=oY(a.viewport,a.content),c={...r,sizes:a,onSizesChange:u,hasThumb:l>0&&l<1,onThumbChange:d=>s.current=d,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:d=>o.current=d};function f(d,h){return Rye(d,o.current,a,h)}return n==="horizontal"?w.createElement(Sye,cr({},c,{ref:t,onThumbPositionChange:()=>{if(i.viewport&&s.current){const d=i.viewport.scrollLeft,h=s5(d,a,i.dir);s.current.style.transform=`translate3d(${h}px, 0, 0)`}},onWheelScroll:d=>{i.viewport&&(i.viewport.scrollLeft=d)},onDragScroll:d=>{i.viewport&&(i.viewport.scrollLeft=f(d,i.dir))}})):n==="vertical"?w.createElement(Iye,cr({},c,{ref:t,onThumbPositionChange:()=>{if(i.viewport&&s.current){const d=i.viewport.scrollTop,h=s5(d,a);s.current.style.transform=`translate3d(0, ${h}px, 0)`}},onWheelScroll:d=>{i.viewport&&(i.viewport.scrollTop=d)},onDragScroll:d=>{i.viewport&&(i.viewport.scrollTop=f(d))}})):null}),Sye=w.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,s=Qo(Vl,e.__scopeScrollArea),[o,a]=w.useState(),u=w.useRef(null),l=Jd(t,u,s.onScrollbarXChange);return w.useEffect(()=>{u.current&&a(getComputedStyle(u.current))},[u]),w.createElement(iY,cr({"data-orientation":"horizontal"},i,{ref:l,sizes:n,style:{bottom:0,left:s.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:s.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":WS(n)+"px",...e.style},onThumbPointerDown:c=>e.onThumbPointerDown(c.x),onDragScroll:c=>e.onDragScroll(c.x),onWheelScroll:(c,f)=>{if(s.viewport){const d=s.viewport.scrollLeft+c.deltaX;e.onWheelScroll(d),uY(d,f)&&c.preventDefault()}},onResize:()=>{u.current&&s.viewport&&o&&r({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:EE(o.paddingLeft),paddingEnd:EE(o.paddingRight)}})}}))}),Iye=w.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,s=Qo(Vl,e.__scopeScrollArea),[o,a]=w.useState(),u=w.useRef(null),l=Jd(t,u,s.onScrollbarYChange);return w.useEffect(()=>{u.current&&a(getComputedStyle(u.current))},[u]),w.createElement(iY,cr({"data-orientation":"vertical"},i,{ref:l,sizes:n,style:{top:0,right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":WS(n)+"px",...e.style},onThumbPointerDown:c=>e.onThumbPointerDown(c.y),onDragScroll:c=>e.onDragScroll(c.y),onWheelScroll:(c,f)=>{if(s.viewport){const d=s.viewport.scrollTop+c.deltaY;e.onWheelScroll(d),uY(d,f)&&c.preventDefault()}},onResize:()=>{u.current&&s.viewport&&o&&r({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:EE(o.paddingTop),paddingEnd:EE(o.paddingBottom)}})}}))}),[xye,rY]=tY(Vl),iY=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:s,onThumbPointerUp:o,onThumbPointerDown:a,onThumbPositionChange:u,onDragScroll:l,onWheelScroll:c,onResize:f,...d}=e,h=Qo(Vl,n),[p,m]=w.useState(null),y=Jd(t,P=>m(P)),g=w.useRef(null),_=w.useRef(""),b=h.viewport,T=r.content-r.viewport,I=Vf(c),E=Vf(u),S=qS(f,10);function A(P){if(g.current){const V=P.clientX-g.current.left,M=P.clientY-g.current.top;l({x:V,y:M})}}return w.useEffect(()=>{const P=V=>{const M=V.target;(p==null?void 0:p.contains(M))&&I(V,T)};return document.addEventListener("wheel",P,{passive:!1}),()=>document.removeEventListener("wheel",P,{passive:!1})},[b,p,T,I]),w.useEffect(E,[r,E]),Gp(p,S),Gp(h.content,S),w.createElement(xye,{scope:n,scrollbar:p,hasThumb:i,onThumbChange:Vf(s),onThumbPointerUp:Vf(o),onThumbPositionChange:E,onThumbPointerDown:Vf(a)},w.createElement(I_.div,cr({},d,{ref:y,style:{position:"absolute",...d.style},onPointerDown:yd(e.onPointerDown,P=>{P.button===0&&(P.target.setPointerCapture(P.pointerId),g.current=p.getBoundingClientRect(),_.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",A(P))}),onPointerMove:yd(e.onPointerMove,A),onPointerUp:yd(e.onPointerUp,P=>{P.target.releasePointerCapture(P.pointerId),document.body.style.webkitUserSelect=_.current,g.current=null})})))}),$P="ScrollAreaThumb",Cye=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=rY($P,e.__scopeScrollArea);return w.createElement(x_,{present:n||i.hasThumb},w.createElement(Aye,cr({ref:t},r)))}),Aye=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...i}=e,s=Qo($P,n),o=rY($P,n),{onThumbPositionChange:a}=o,u=Jd(t,f=>o.onThumbChange(f)),l=w.useRef(),c=qS(()=>{l.current&&(l.current(),l.current=void 0)},100);return w.useEffect(()=>{const f=s.viewport;if(f){const d=()=>{if(c(),!l.current){const h=Nye(f,a);l.current=h,a()}};return a(),f.addEventListener("scroll",d),()=>f.removeEventListener("scroll",d)}},[s.viewport,c,a]),w.createElement(I_.div,cr({"data-state":o.hasThumb?"visible":"hidden"},i,{ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:yd(e.onPointerDownCapture,f=>{const h=f.target.getBoundingClientRect(),p=f.clientX-h.left,m=f.clientY-h.top;o.onThumbPointerDown({x:p,y:m})}),onPointerUp:yd(e.onPointerUp,o.onThumbPointerUp)}))}),sY="ScrollAreaCorner",Oye=w.forwardRef((e,t)=>{const n=Qo(sY,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?w.createElement(Pye,cr({},e,{ref:t})):null}),Pye=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,i=Qo(sY,n),[s,o]=w.useState(0),[a,u]=w.useState(0),l=!!(s&&a);return Gp(i.scrollbarX,()=>{var c;const f=((c=i.scrollbarX)===null||c===void 0?void 0:c.offsetHeight)||0;i.onCornerHeightChange(f),u(f)}),Gp(i.scrollbarY,()=>{var c;const f=((c=i.scrollbarY)===null||c===void 0?void 0:c.offsetWidth)||0;i.onCornerWidthChange(f),o(f)}),l?w.createElement(I_.div,cr({},r,{ref:t,style:{width:s,height:a,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...e.style}})):null});function EE(e){return e?parseInt(e,10):0}function oY(e,t){const n=e/t;return isNaN(n)?0:n}function WS(e){const t=oY(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function Rye(e,t,n,r="ltr"){const i=WS(n),s=i/2,o=t||s,a=i-o,u=n.scrollbar.paddingStart+o,l=n.scrollbar.size-n.scrollbar.paddingEnd-a,c=n.content-n.viewport,f=r==="ltr"?[0,c]:[c*-1,0];return aY([u,l],f)(e)}function s5(e,t,n="ltr"){const r=WS(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-i,o=t.content-t.viewport,a=s-r,u=n==="ltr"?[0,o]:[o*-1,0],l=mye(e,u);return aY([0,o],[0,a])(l)}function aY(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function uY(e,t){return e>0&&e{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function i(){const s={left:e.scrollLeft,top:e.scrollTop},o=n.left!==s.left,a=n.top!==s.top;(o||a)&&t(),n=s,r=window.requestAnimationFrame(i)}(),()=>window.cancelAnimationFrame(r)};function qS(e,t){const n=Vf(e),r=w.useRef(0);return w.useEffect(()=>()=>window.clearTimeout(r.current),[]),w.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Gp(e,t){const n=Vf(t);DP(()=>{let r=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(e),()=>{window.cancelAnimationFrame(r),i.unobserve(e)}}},[e,n])}const kye=_ye,Dye=bye,o5=Eye,a5=Cye,$ye=Oye;var Lye=at((e,{scrollbarSize:t,offsetScrollbars:n,scrollbarHovered:r,hidden:i},s)=>({root:{overflow:"hidden"},viewport:{width:"100%",height:"100%",paddingRight:n?t:void 0,paddingBottom:n?t:void 0},scrollbar:{display:i?"none":"flex",userSelect:"none",touchAction:"none",boxSizing:"border-box",padding:t/5,transition:"background-color 150ms ease, opacity 150ms ease","&:hover":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[8]:e.colors.gray[0],[`& .${s("thumb")}`]:{backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.white,.5):e.fn.rgba(e.black,.5)}},'&[data-orientation="vertical"]':{width:t},'&[data-orientation="horizontal"]':{flexDirection:"column",height:t},'&[data-state="hidden"]':{display:"none",opacity:0}},thumb:{ref:s("thumb"),flex:1,backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.white,.4):e.fn.rgba(e.black,.4),borderRadius:t,position:"relative",transition:"background-color 150ms ease",display:i?"none":void 0,"&::before":{content:'""',position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"100%",height:"100%"}},corner:{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[0],transition:"opacity 150ms ease",opacity:r?1:0,display:i?"none":void 0}}));const Mye=Lye;var Fye=Object.defineProperty,Bye=Object.defineProperties,jye=Object.getOwnPropertyDescriptors,wE=Object.getOwnPropertySymbols,lY=Object.prototype.hasOwnProperty,cY=Object.prototype.propertyIsEnumerable,u5=(e,t,n)=>t in e?Fye(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,fY=(e,t)=>{for(var n in t||(t={}))lY.call(t,n)&&u5(e,n,t[n]);if(wE)for(var n of wE(t))cY.call(t,n)&&u5(e,n,t[n]);return e},Uye=(e,t)=>Bye(e,jye(t)),dY=(e,t)=>{var n={};for(var r in e)lY.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&wE)for(var r of wE(e))t.indexOf(r)<0&&cY.call(e,r)&&(n[r]=e[r]);return n};const hY={scrollbarSize:12,scrollHideDelay:1e3,type:"hover",offsetScrollbars:!1},YS=w.forwardRef((e,t)=>{const n=ct("ScrollArea",hY,e),{children:r,className:i,classNames:s,styles:o,scrollbarSize:a,scrollHideDelay:u,type:l,dir:c,offsetScrollbars:f,viewportRef:d,onScrollPositionChange:h,unstyled:p}=n,m=dY(n,["children","className","classNames","styles","scrollbarSize","scrollHideDelay","type","dir","offsetScrollbars","viewportRef","onScrollPositionChange","unstyled"]),[y,g]=w.useState(!1),_=ts(),{classes:b,cx:T}=Mye({scrollbarSize:a,offsetScrollbars:f,scrollbarHovered:y,hidden:l==="never"},{name:"ScrollArea",classNames:s,styles:o,unstyled:p});return k.createElement(kye,{type:l==="never"?"always":l,scrollHideDelay:u,dir:c||_.dir,ref:t,asChild:!0},k.createElement(ut,fY({className:T(b.root,i)},m),k.createElement(Dye,{className:b.viewport,ref:d,onScroll:typeof h=="function"?({currentTarget:I})=>h({x:I.scrollLeft,y:I.scrollTop}):void 0},r),k.createElement(o5,{orientation:"horizontal",className:b.scrollbar,forceMount:!0,onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1)},k.createElement(a5,{className:b.thumb})),k.createElement(o5,{orientation:"vertical",className:b.scrollbar,forceMount:!0,onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1)},k.createElement(a5,{className:b.thumb})),k.createElement($ye,{className:b.corner})))}),pY=w.forwardRef((e,t)=>{const n=ct("ScrollAreaAutosize",hY,e),{maxHeight:r,children:i,classNames:s,styles:o,scrollbarSize:a,scrollHideDelay:u,type:l,dir:c,offsetScrollbars:f,viewportRef:d,onScrollPositionChange:h,unstyled:p,sx:m}=n,y=dY(n,["maxHeight","children","classNames","styles","scrollbarSize","scrollHideDelay","type","dir","offsetScrollbars","viewportRef","onScrollPositionChange","unstyled","sx"]);return k.createElement(ut,Uye(fY({},y),{ref:t,sx:[{display:"flex",maxHeight:r},...Rd(m)]}),k.createElement(ut,{sx:{display:"flex",flexDirection:"column",flex:1}},k.createElement(YS,{classNames:s,styles:o,scrollHideDelay:u,scrollbarSize:a,type:l,dir:c,offsetScrollbars:f,viewportRef:d,onScrollPositionChange:h,unstyled:p},i)))});pY.displayName="@mantine/core/ScrollAreaAutosize";YS.displayName="@mantine/core/ScrollArea";YS.Autosize=pY;const r0=YS;var Vye=Object.defineProperty,zye=Object.defineProperties,Hye=Object.getOwnPropertyDescriptors,TE=Object.getOwnPropertySymbols,mY=Object.prototype.hasOwnProperty,gY=Object.prototype.propertyIsEnumerable,l5=(e,t,n)=>t in e?Vye(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,c5=(e,t)=>{for(var n in t||(t={}))mY.call(t,n)&&l5(e,n,t[n]);if(TE)for(var n of TE(t))gY.call(t,n)&&l5(e,n,t[n]);return e},Wye=(e,t)=>zye(e,Hye(t)),qye=(e,t)=>{var n={};for(var r in e)mY.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&TE)for(var r of TE(e))t.indexOf(r)<0&&gY.call(e,r)&&(n[r]=e[r]);return n};const GS=w.forwardRef((e,t)=>{var n=e,{style:r}=n,i=qye(n,["style"]);return k.createElement(r0,Wye(c5({},i),{style:c5({width:"100%"},r),viewportRef:t}),i.children)});GS.displayName="@mantine/core/SelectScrollArea";var Yye=at(()=>({dropdown:{},itemsWrapper:{padding:4,display:"flex",width:"100%",boxSizing:"border-box"}}));const Gye=Yye;function Sl(e){return e.split("-")[0]}function C_(e){return e.split("-")[1]}function Zd(e){return["top","bottom"].includes(Sl(e))?"x":"y"}function gk(e){return e==="y"?"height":"width"}function f5(e,t,n){let{reference:r,floating:i}=e;const s=r.x+r.width/2-i.width/2,o=r.y+r.height/2-i.height/2,a=Zd(t),u=gk(a),l=r[u]/2-i[u]/2,c=a==="x";let f;switch(Sl(t)){case"top":f={x:s,y:r.y-i.height};break;case"bottom":f={x:s,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:o};break;case"left":f={x:r.x-i.width,y:o};break;default:f={x:r.x,y:r.y}}switch(C_(t)){case"start":f[a]-=l*(n&&c?-1:1);break;case"end":f[a]+=l*(n&&c?-1:1)}return f}const Kye=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:o}=n,a=s.filter(Boolean),u=await(o.isRTL==null?void 0:o.isRTL(t));let l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:f}=f5(l,r,u),d=r,h={},p=0;for(let m=0;m({name:"arrow",options:e,async fn(t){const{element:n,padding:r=0}=e??{},{x:i,y:s,placement:o,rects:a,platform:u}=t;if(n==null)return{};const l=yk(r),c={x:i,y:s},f=Zd(o),d=C_(o),h=gk(f),p=await u.getDimensions(n),m=f==="y"?"top":"left",y=f==="y"?"bottom":"right",g=a.reference[h]+a.reference[f]-c[f]-a.floating[h],_=c[f]-a.reference[f],b=await(u.getOffsetParent==null?void 0:u.getOffsetParent(n));let T=b?f==="y"?b.clientHeight||0:b.clientWidth||0:0;T===0&&(T=a.floating[h]);const I=g/2-_/2,E=l[m],S=T-p[h]-l[y],A=T/2-p[h]/2+I,P=LP(E,A,S),V=(d==="start"?l[m]:l[y])>0&&A!==P&&a.reference[h]<=a.floating[h];return{[f]:c[f]-(V?AQye[t])}function Xye(e,t,n){n===void 0&&(n=!1);const r=C_(e),i=Zd(e),s=gk(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(o=SE(o)),{main:o,cross:SE(o)}}const Jye={start:"end",end:"start"};function h5(e){return e.replace(/start|end/g,t=>Jye[t])}const Zye=["top","right","bottom","left"];Zye.reduce((e,t)=>e.concat(t,t+"-start",t+"-end"),[]);const _Y=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:i,rects:s,initialPlacement:o,platform:a,elements:u}=t,{mainAxis:l=!0,crossAxis:c=!0,fallbackPlacements:f,fallbackStrategy:d="bestFit",flipAlignment:h=!0,...p}=e,m=Sl(r),y=f||(m===o||!h?[SE(o)]:function(A){const P=SE(A);return[h5(A),P,h5(P)]}(o)),g=[o,...y],_=await _k(t,p),b=[];let T=((n=i.flip)==null?void 0:n.overflows)||[];if(l&&b.push(_[m]),c){const{main:A,cross:P}=Xye(r,s,await(a.isRTL==null?void 0:a.isRTL(u.floating)));b.push(_[A],_[P])}if(T=[...T,{placement:r,overflows:b}],!b.every(A=>A<=0)){var I,E;const A=((I=(E=i.flip)==null?void 0:E.index)!=null?I:0)+1,P=g[A];if(P)return{data:{index:A,overflows:T},reset:{placement:P}};let V="bottom";switch(d){case"bestFit":{var S;const M=(S=T.map(H=>[H,H.overflows.filter(J=>J>0).reduce((J,Y)=>J+Y,0)]).sort((H,J)=>H[1]-J[1])[0])==null?void 0:S[0].placement;M&&(V=M);break}case"initialPlacement":V=o}if(r!==V)return{reset:{placement:V}}}return{}}}},vY=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,i=await async function(s,o){const{placement:a,platform:u,elements:l}=s,c=await(u.isRTL==null?void 0:u.isRTL(l.floating)),f=Sl(a),d=C_(a),h=Zd(a)==="x",p=["left","top"].includes(f)?-1:1,m=c&&h?-1:1,y=typeof o=="function"?o(s):o;let{mainAxis:g,crossAxis:_,alignmentAxis:b}=typeof y=="number"?{mainAxis:y,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...y};return d&&typeof b=="number"&&(_=d==="end"?-1*b:b),h?{x:_*m,y:g*p}:{x:g*p,y:_*m}}(t,e);return{x:n+i.x,y:r+i.y,data:i}}}};function bY(e){return e==="x"?"y":"x"}const vk=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:y=>{let{x:g,y:_}=y;return{x:g,y:_}}},...u}=e,l={x:n,y:r},c=await _k(t,u),f=Zd(Sl(i)),d=bY(f);let h=l[f],p=l[d];if(s){const y=f==="y"?"bottom":"right";h=LP(h+c[f==="y"?"top":"left"],h,h-c[y])}if(o){const y=d==="y"?"bottom":"right";p=LP(p+c[d==="y"?"top":"left"],p,p-c[y])}const m=a.fn({...t,[f]:h,[d]:p});return{...m,data:{x:m.x-n,y:m.y-r}}}}},e_e=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:s,middlewareData:o}=t,{offset:a=0,mainAxis:u=!0,crossAxis:l=!0}=e,c={x:n,y:r},f=Zd(i),d=bY(f);let h=c[f],p=c[d];const m=typeof a=="function"?a(t):a,y=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(u){const I=f==="y"?"height":"width",E=s.reference[f]-s.floating[I]+y.mainAxis,S=s.reference[f]+s.reference[I]-y.mainAxis;hS&&(h=S)}if(l){var g,_,b,T;const I=f==="y"?"width":"height",E=["top","left"].includes(Sl(i)),S=s.reference[d]-s.floating[I]+(E&&(g=(_=o.offset)==null?void 0:_[d])!=null?g:0)+(E?0:y.crossAxis),A=s.reference[d]+s.reference[I]+(E?0:(b=(T=o.offset)==null?void 0:T[d])!=null?b:0)-(E?y.crossAxis:0);pA&&(p=A)}return{[f]:h,[d]:p}}}},t_e=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:i,elements:s}=t,{apply:o=()=>{},...a}=e,u=await _k(t,a),l=Sl(n),c=C_(n);let f,d;l==="top"||l==="bottom"?(f=l,d=c===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(d=l,f=c==="end"?"top":"bottom");const h=lc(u.left,0),p=lc(u.right,0),m=lc(u.top,0),y=lc(u.bottom,0),g={availableHeight:r.floating.height-(["left","right"].includes(n)?2*(m!==0||y!==0?m+y:lc(u.top,u.bottom)):u[f]),availableWidth:r.floating.width-(["top","bottom"].includes(n)?2*(h!==0||p!==0?h+p:lc(u.left,u.right)):u[d])};await o({...t,...g});const _=await i.getDimensions(s.floating);return r.floating.width!==_.width||r.floating.height!==_.height?{reset:{rects:!0}}:{}}}},EY=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(t){var n;const{placement:r,elements:i,rects:s,platform:o,strategy:a}=t,{padding:u=2,x:l,y:c}=e,f=Ty(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({rect:s.reference,offsetParent:await(o.getOffsetParent==null?void 0:o.getOffsetParent(i.floating)),strategy:a}):s.reference),d=(n=await(o.getClientRects==null?void 0:o.getClientRects(i.reference)))!=null?n:[],h=yk(u),p=await o.getElementRects({reference:{getBoundingClientRect:function(){var m;if(d.length===2&&d[0].left>d[1].right&&l!=null&&c!=null)return(m=d.find(y=>l>y.left-h.left&&ly.top-h.top&&c=2){if(Zd(r)==="x"){const E=d[0],S=d[d.length-1],A=Sl(r)==="top",P=E.top,V=S.bottom,M=A?E.left:S.left,H=A?E.right:S.right;return{top:P,bottom:V,left:M,right:H,width:H-M,height:V-P,x:M,y:P}}const y=Sl(r)==="left",g=lc(...d.map(E=>E.right)),_=yY(...d.map(E=>E.left)),b=d.filter(E=>y?E.left===_:E.right===g),T=b[0].top,I=b[b.length-1].bottom;return{top:T,bottom:I,left:_,right:g,width:g-_,height:I-T,x:_,y:T}}return f}},floating:i.floating,strategy:a});return s.reference.x!==p.reference.x||s.reference.y!==p.reference.y||s.reference.width!==p.reference.width||s.reference.height!==p.reference.height?{reset:{rects:p}}:{}}}};function wY(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function zl(e){if(e==null)return window;if(!wY(e)){const t=e.ownerDocument;return t&&t.defaultView||window}return e}function Xc(e){return zl(e).getComputedStyle(e)}function Jc(e){return wY(e)?"":e?(e.nodeName||"").toLowerCase():""}function TY(){const e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(t=>t.brand+"/"+t.version).join(" "):navigator.userAgent}function Il(e){return e instanceof zl(e).HTMLElement}function dl(e){return e instanceof zl(e).Element}function p5(e){return typeof ShadowRoot>"u"?!1:e instanceof zl(e).ShadowRoot||e instanceof ShadowRoot}function KS(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Xc(e);return/auto|scroll|overlay|hidden/.test(t+r+n)&&!["inline","contents"].includes(i)}function n_e(e){return["table","td","th"].includes(Jc(e))}function MP(e){const t=/firefox/i.test(TY()),n=Xc(e),r=n.backdropFilter||n.WebkitBackdropFilter;return n.transform!=="none"||n.perspective!=="none"||!!r&&r!=="none"||t&&n.willChange==="filter"||t&&!!n.filter&&n.filter!=="none"||["transform","perspective"].some(i=>n.willChange.includes(i))||["paint","layout","strict","content"].some(i=>{const s=n.contain;return s!=null&&s.includes(i)})}function SY(){return!/^((?!chrome|android).)*safari/i.test(TY())}function bk(e){return["html","body","#document"].includes(Jc(e))}const m5=Math.min,A0=Math.max,IE=Math.round;function hl(e,t,n){var r,i,s,o;t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect();let u=1,l=1;t&&Il(e)&&(u=e.offsetWidth>0&&IE(a.width)/e.offsetWidth||1,l=e.offsetHeight>0&&IE(a.height)/e.offsetHeight||1);const c=dl(e)?zl(e):window,f=!SY()&&n,d=(a.left+(f&&(r=(i=c.visualViewport)==null?void 0:i.offsetLeft)!=null?r:0))/u,h=(a.top+(f&&(s=(o=c.visualViewport)==null?void 0:o.offsetTop)!=null?s:0))/l,p=a.width/u,m=a.height/l;return{width:p,height:m,top:h,right:d+p,bottom:h+m,left:d,x:d,y:h}}function Fc(e){return(t=e,(t instanceof zl(t).Node?e.ownerDocument:e.document)||window.document).documentElement;var t}function QS(e){return dl(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function IY(e){return hl(Fc(e)).left+QS(e).scrollLeft}function r_e(e,t,n){const r=Il(t),i=Fc(t),s=hl(e,r&&function(u){const l=hl(u);return IE(l.width)!==u.offsetWidth||IE(l.height)!==u.offsetHeight}(t),n==="fixed");let o={scrollLeft:0,scrollTop:0};const a={x:0,y:0};if(r||!r&&n!=="fixed")if((Jc(t)!=="body"||KS(i))&&(o=QS(t)),Il(t)){const u=hl(t,!0);a.x=u.x+t.clientLeft,a.y=u.y+t.clientTop}else i&&(a.x=IY(i));return{x:s.left+o.scrollLeft-a.x,y:s.top+o.scrollTop-a.y,width:s.width,height:s.height}}function xE(e){if(Jc(e)==="html")return e;const t=e.assignedSlot||e.parentNode||(p5(e)?e.host:null)||Fc(e);return p5(t)?t.host:t}function g5(e){return Il(e)&&Xc(e).position!=="fixed"?e.offsetParent:null}function y5(e){const t=zl(e);let n=g5(e);for(;n&&n_e(n)&&Xc(n).position==="static";)n=g5(n);return n&&(Jc(n)==="html"||Jc(n)==="body"&&Xc(n).position==="static"&&!MP(n))?t:n||function(r){let i=xE(r);for(;Il(i)&&!bk(i);){if(MP(i))return i;i=xE(i)}return null}(e)||t}function _5(e){if(Il(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=hl(e);return{width:t.width,height:t.height}}function xY(e){const t=xE(e);return bk(t)?e.ownerDocument.body:Il(t)&&KS(t)?t:xY(t)}function pl(e,t){var n;t===void 0&&(t=[]);const r=xY(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),s=zl(r),o=i?[s].concat(s.visualViewport||[],KS(r)?r:[]):r,a=t.concat(o);return i?a:a.concat(pl(o))}function v5(e,t,n){return t==="viewport"?Ty(function(r,i){const s=zl(r),o=Fc(r),a=s.visualViewport;let u=o.clientWidth,l=o.clientHeight,c=0,f=0;if(a){u=a.width,l=a.height;const d=SY();(d||!d&&i==="fixed")&&(c=a.offsetLeft,f=a.offsetTop)}return{width:u,height:l,x:c,y:f}}(e,n)):dl(t)?function(r,i){const s=hl(r,!1,i==="fixed"),o=s.top+r.clientTop,a=s.left+r.clientLeft;return{top:o,left:a,x:a,y:o,right:a+r.clientWidth,bottom:o+r.clientHeight,width:r.clientWidth,height:r.clientHeight}}(t,n):Ty(function(r){var i;const s=Fc(r),o=QS(r),a=(i=r.ownerDocument)==null?void 0:i.body,u=A0(s.scrollWidth,s.clientWidth,a?a.scrollWidth:0,a?a.clientWidth:0),l=A0(s.scrollHeight,s.clientHeight,a?a.scrollHeight:0,a?a.clientHeight:0);let c=-o.scrollLeft+IY(r);const f=-o.scrollTop;return Xc(a||s).direction==="rtl"&&(c+=A0(s.clientWidth,a?a.clientWidth:0)-u),{width:u,height:l,x:c,y:f}}(Fc(e)))}const i_e={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const s=n==="clippingAncestors"?function(l){let c=pl(l).filter(h=>dl(h)&&Jc(h)!=="body"),f=l,d=null;for(;dl(f)&&!bk(f);){const h=Xc(f);h.position==="static"&&d&&["absolute","fixed"].includes(d.position)&&!MP(f)?c=c.filter(p=>p!==f):d=h,f=xE(f)}return c}(t):[].concat(n),o=[...s,r],a=o[0],u=o.reduce((l,c)=>{const f=v5(t,c,i);return l.top=A0(f.top,l.top),l.right=m5(f.right,l.right),l.bottom=m5(f.bottom,l.bottom),l.left=A0(f.left,l.left),l},v5(t,a,i));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const i=Il(n),s=Fc(n);if(n===s)return t;let o={scrollLeft:0,scrollTop:0};const a={x:0,y:0};if((i||!i&&r!=="fixed")&&((Jc(n)!=="body"||KS(s))&&(o=QS(n)),Il(n))){const u=hl(n,!0);a.x=u.x+n.clientLeft,a.y=u.y+n.clientTop}return{...t,x:t.x-o.scrollLeft+a.x,y:t.y-o.scrollTop+a.y}},isElement:dl,getDimensions:_5,getOffsetParent:y5,getDocumentElement:Fc,getElementRects:e=>{let{reference:t,floating:n,strategy:r}=e;return{reference:r_e(t,y5(n),r),floating:{..._5(n),x:0,y:0}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>Xc(e).direction==="rtl"};function s_e(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=!0,animationFrame:a=!1}=r,u=i&&!a,l=u||s?[...dl(e)?pl(e):e.contextElement?pl(e.contextElement):[],...pl(t)]:[];l.forEach(h=>{u&&h.addEventListener("scroll",n,{passive:!0}),s&&h.addEventListener("resize",n)});let c,f=null;if(o){let h=!0;f=new ResizeObserver(()=>{h||n(),h=!1}),dl(e)&&!a&&f.observe(e),dl(e)||!e.contextElement||a||f.observe(e.contextElement),f.observe(t)}let d=a?hl(e):null;return a&&function h(){const p=hl(e);!d||p.x===d.x&&p.y===d.y&&p.width===d.width&&p.height===d.height||n(),d=p,c=requestAnimationFrame(h)}(),n(),()=>{var h;l.forEach(p=>{u&&p.removeEventListener("scroll",n),s&&p.removeEventListener("resize",n)}),(h=f)==null||h.disconnect(),f=null,a&&cancelAnimationFrame(c)}}const o_e=(e,t,n)=>Kye(e,t,{platform:i_e,...n});var FP=typeof document<"u"?w.useLayoutEffect:w.useEffect;function CE(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!CE(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const s=i[r];if(!(s==="_owner"&&e.$$typeof)&&!CE(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function a_e(e){const t=w.useRef(e);return FP(()=>{t.current=e}),t}function u_e(e){let{middleware:t=[],placement:n="bottom",strategy:r="absolute",whileElementsMounted:i}=e===void 0?{}:e;const[s,o]=w.useState({x:null,y:null,strategy:r,placement:n,middlewareData:{}}),[a,u]=w.useState(t);CE(a,t)||u(t);const l=w.useRef(null),c=w.useRef(null),f=w.useRef(null),d=w.useRef(s),h=a_e(i),p=w.useCallback(()=>{!l.current||!c.current||o_e(l.current,c.current,{middleware:a,placement:n,strategy:r}).then(T=>{m.current&&!CE(d.current,T)&&(d.current=T,b_.flushSync(()=>{o(T)}))})},[a,n,r]);FP(()=>{m.current&&p()},[p]);const m=w.useRef(!1);FP(()=>(m.current=!0,()=>{m.current=!1}),[]);const y=w.useCallback(()=>{if(typeof f.current=="function"&&(f.current(),f.current=null),l.current&&c.current)if(h.current){const T=h.current(l.current,c.current,p);f.current=T}else p()},[p,h]),g=w.useCallback(T=>{l.current=T,y()},[y]),_=w.useCallback(T=>{c.current=T,y()},[y]),b=w.useMemo(()=>({reference:l,floating:c}),[]);return w.useMemo(()=>({...s,update:p,refs:b,reference:g,floating:_}),[s,p,b,g,_])}const CY=e=>{const{element:t,padding:n}=e;function r(i){return Object.prototype.hasOwnProperty.call(i,"current")}return{name:"arrow",options:e,fn(i){return r(t)?t.current!=null?d5({element:t.current,padding:n}).fn(i):{}:t?d5({element:t,padding:n}).fn(i):{}}}};var Kp=typeof document<"u"?w.useLayoutEffect:w.useEffect;function l_e(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(i=>i(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){e.set(t,(e.get(t)||[]).filter(r=>r!==n))}}}let RC=!1,c_e=0;const b5=()=>"floating-ui-"+c_e++;function f_e(){const[e,t]=w.useState(()=>RC?b5():void 0);return Kp(()=>{e==null&&t(b5())},[]),w.useEffect(()=>{RC||(RC=!0)},[]),e}const E5=Id.useId,w5=E5??f_e,d_e=w.createContext(null),h_e=w.createContext(null),AY=()=>{var e,t;return(e=(t=w.useContext(d_e))==null?void 0:t.id)!=null?e:null},Ek=()=>w.useContext(h_e);function mc(e){var t;return(t=e==null?void 0:e.ownerDocument)!=null?t:document}function OY(e){var t;return(t=mc(e).defaultView)!=null?t:window}function Zf(e){return e?e instanceof OY(e).Element:!1}function p_e(e){return e?e instanceof OY(e).HTMLElement:!1}const T5=Id.useInsertionEffect;function m_e(e){const t=w.useRef(()=>{});return T5?T5(()=>{t.current=e}):t.current=e,w.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;il_e())[0],p=u_e({placement:i,middleware:s,strategy:o,whileElementsMounted:r}),m=m_e(n),y=w.useMemo(()=>({...p.refs,domReference:f}),[p.refs]),g=w.useMemo(()=>({...p,refs:y,dataRef:d,nodeId:a,events:h,open:t,onOpenChange:m,_:{domReference:u}}),[p,a,h,t,m,y,u]);Kp(()=>{const T=c==null?void 0:c.nodesRef.current.find(I=>I.id===a);T&&(T.context=g)});const{reference:_}=p,b=w.useCallback(T=>{(Zf(T)||T===null)&&(g.refs.domReference.current=T,l(T)),_(T)},[_,g.refs]);return w.useMemo(()=>({...p,context:g,refs:y,reference:b}),[p,y,g,b])}function NC(e,t,n){const r=new Map;return{...n==="floating"&&{tabIndex:-1},...e,...t.map(i=>i?i[n]:null).concat(e).reduce((i,s)=>(s&&Object.entries(s).forEach(o=>{let[a,u]=o;if(a.indexOf("on")===0){if(r.has(a)||r.set(a,[]),typeof u=="function"){var l;(l=r.get(a))==null||l.push(u),i[a]=function(){for(var c,f=arguments.length,d=new Array(f),h=0;hp(...d))}}}else i[a]=u}),i),{})}}const g_e=function(e){e===void 0&&(e=[]);const t=e,n=w.useCallback(s=>NC(s,e,"reference"),t),r=w.useCallback(s=>NC(s,e,"floating"),t),i=w.useCallback(s=>NC(s,e,"item"),t);return w.useMemo(()=>({getReferenceProps:n,getFloatingProps:r,getItemProps:i}),[n,r,i])};function kC(e,t){var n;let r=(n=e.filter(o=>{var a;return o.parentId===t&&((a=o.context)==null?void 0:a.open)}))!=null?n:[],i=r;for(;i.length;){var s;i=(s=e.filter(o=>{var a;return(a=i)==null?void 0:a.some(u=>{var l;return o.parentId===u.id&&((l=o.context)==null?void 0:l.open)})}))!=null?s:[],r=r.concat(i)}return r}function y_e(e){return"composedPath"in e?e.composedPath()[0]:e.target}function S5(e){const t=w.useRef(e);return Kp(()=>{t.current=e}),t}function __e(e){const t=w.useRef();return Kp(()=>{t.current=e},[e]),t.current}function eb(e,t,n){return n&&n!=="mouse"?0:typeof e=="number"?e:e==null?void 0:e[t]}const v_e=function(e,t){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:s=!1,restMs:o=0,move:a=!0}=t===void 0?{}:t;const{open:u,onOpenChange:l,dataRef:c,events:f,refs:d,_:h}=e,p=Ek(),m=AY(),y=S5(i),g=S5(r),_=__e(u),b=w.useRef(),T=w.useRef(),I=w.useRef(),E=w.useRef(),S=w.useRef(!0),A=w.useRef(!1),P=w.useCallback(()=>{var J;const Y=(J=c.current.openEvent)==null?void 0:J.type;return(Y==null?void 0:Y.includes("mouse"))&&Y!=="mousedown"},[c]);w.useEffect(()=>{if(!n)return;function J(){clearTimeout(T.current),clearTimeout(E.current),S.current=!0}return f.on("dismiss",J),()=>{f.off("dismiss",J)}},[n,f,d]),w.useEffect(()=>{if(!n||!y.current)return;function J(){P()&&l(!1)}const Y=mc(d.floating.current).documentElement;return Y.addEventListener("mouseleave",J),()=>{Y.removeEventListener("mouseleave",J)}},[d,l,n,y,c,P]);const V=w.useCallback(function(J){J===void 0&&(J=!0);const Y=eb(g.current,"close",b.current);Y&&!I.current?(clearTimeout(T.current),T.current=setTimeout(()=>l(!1),Y)):J&&(clearTimeout(T.current),l(!1))},[g,l]),M=w.useCallback(()=>{I.current&&(mc(d.floating.current).removeEventListener("pointermove",I.current),I.current=void 0)},[d]),H=w.useCallback(()=>{mc(d.floating.current).body.style.pointerEvents="",A.current=!1},[d]);return w.useEffect(()=>{if(!n)return;function J(){return c.current.openEvent?["click","mousedown"].includes(c.current.openEvent.type):!1}function Y(se){if(clearTimeout(T.current),S.current=!1,s&&b.current!=="mouse"||o>0&&eb(g.current,"open")===0)return;c.current.openEvent=se;const K=eb(g.current,"open",b.current);K?T.current=setTimeout(()=>{l(!0)},K):l(!0)}function ye(se){if(J())return;const K=mc(d.floating.current);if(clearTimeout(E.current),y.current){clearTimeout(T.current),I.current&&K.removeEventListener("pointermove",I.current),I.current=y.current({...e,tree:p,x:se.clientX,y:se.clientY,onClose(){H(),M(),V()}}),K.addEventListener("pointermove",I.current);return}V()}function he(se){J()||y.current==null||y.current({...e,tree:p,x:se.clientX,y:se.clientY,leave:!0,onClose(){H(),M(),V()}})(se)}const ve=d.floating.current,te=d.domReference.current;if(Zf(te))return u&&te.addEventListener("mouseleave",he),ve==null||ve.addEventListener("mouseleave",he),a&&te.addEventListener("mousemove",Y,{once:!0}),te.addEventListener("mouseenter",Y),te.addEventListener("mouseleave",ye),()=>{u&&te.removeEventListener("mouseleave",he),ve==null||ve.removeEventListener("mouseleave",he),a&&te.removeEventListener("mousemove",Y),te.removeEventListener("mouseenter",Y),te.removeEventListener("mouseleave",ye)}},[h.domReference,n,e,s,o,a,V,M,H,l,u,p,d,g,y,c]),Kp(()=>{if(n&&u&&y.current&&y.current.__options.blockPointerEvents&&P()){mc(d.floating.current).body.style.pointerEvents="none",A.current=!0;const ye=d.domReference.current,he=d.floating.current;if(Zf(ye)&&he){var J,Y;const ve=p==null||(J=p.nodesRef.current.find(te=>te.id===m))==null||(Y=J.context)==null?void 0:Y.refs.floating.current;return ve&&(ve.style.pointerEvents=""),ye.style.pointerEvents="auto",he.style.pointerEvents="auto",()=>{ye.style.pointerEvents="",he.style.pointerEvents=""}}}},[n,u,m,d,p,y,c,P]),Kp(()=>{_&&!u&&(b.current=void 0,M(),H())}),w.useEffect(()=>()=>{M(),clearTimeout(T.current),clearTimeout(E.current),A.current&&H()},[n,M,H]),w.useMemo(()=>{if(!n)return{};function J(Y){b.current=Y.pointerType}return{reference:{onPointerDown:J,onPointerEnter:J,onMouseMove(){u||o===0||(clearTimeout(E.current),E.current=setTimeout(()=>{S.current||l(!0)},o))}},floating:{onMouseEnter(){clearTimeout(T.current)},onMouseLeave(){V(!1)}}}},[n,o,u,l,V])},PY=w.createContext({delay:1e3,initialDelay:1e3,currentId:null,setCurrentId:()=>{},setState:()=>{}}),RY=()=>w.useContext(PY),b_e=e=>{let{children:t,delay:n}=e;const[r,i]=w.useState({delay:n,initialDelay:n,currentId:null}),s=w.useCallback(o=>{i(a=>({...a,currentId:o}))},[]);return w.createElement(PY.Provider,{value:w.useMemo(()=>({...r,setState:i,setCurrentId:s}),[r,i,s])},t)},E_e=(e,t)=>{let{open:n,onOpenChange:r}=e,{id:i}=t;const{currentId:s,initialDelay:o,setState:a}=RY();w.useEffect(()=>{s&&(a(u=>({...u,delay:{open:1,close:eb(o,"close")}})),s!==i&&r(!1))},[i,r,a,s,o]),w.useEffect(()=>{!n&&s===i&&(r(!1),a(u=>({...u,delay:o,currentId:null})))},[n,a,s,i,r,o])},w_e=function(e,t){let{open:n}=e,{enabled:r=!0,role:i="dialog"}=t===void 0?{}:t;const s=w5(),o=w5();return w.useMemo(()=>{const a={id:s,role:i};return r?i==="tooltip"?{reference:{"aria-describedby":n?s:void 0},floating:a}:{reference:{"aria-expanded":n?"true":"false","aria-haspopup":i==="alertdialog"?"dialog":i,"aria-controls":n?s:void 0,...i==="listbox"&&{role:"combobox"},...i==="menu"&&{id:o}},floating:{...a,...i==="menu"&&{"aria-labelledby":o}}}:{}},[r,i,n,s,o])};function DC(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}const T_e={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},S_e={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},I_e=function(e,t){let{open:n,onOpenChange:r,refs:i,events:s,nodeId:o}=e,{enabled:a=!0,escapeKey:u=!0,outsidePress:l=!0,outsidePressEvent:c="pointerdown",referencePress:f=!1,referencePressEvent:d="pointerdown",ancestorScroll:h=!1,bubbles:p=!0}=t===void 0?{}:t;const m=Ek(),y=AY()!=null,g=w.useRef(!1);return w.useEffect(()=>{if(!n||!a)return;function _(S){if(S.key==="Escape"){if(!p&&m&&kC(m.nodesRef.current,o).length>0)return;s.emit("dismiss",{preventScroll:!1}),r(!1)}}function b(S){const A=g.current;if(g.current=!1,A)return;const P=y_e(S);if(Zf(P)&&i.floating.current){var V;const H=(V=i.floating.current.ownerDocument.defaultView)!=null?V:window,J=P.scrollWidth>P.clientWidth,Y=P.scrollHeight>P.clientHeight;let ye=Y&&S.offsetX>P.clientWidth;if(Y&&H.getComputedStyle(P).direction==="rtl"&&(ye=S.offsetX<=P.offsetWidth-P.clientWidth),ye||J&&S.offsetY>P.clientHeight)return}const M=m&&kC(m.nodesRef.current,o).some(H=>{var J;return DC(S,(J=H.context)==null?void 0:J.refs.floating.current)});DC(S,i.floating.current)||DC(S,i.domReference.current)||M||!p&&m&&kC(m.nodesRef.current,o).length>0||(s.emit("dismiss",y?{preventScroll:!0}:!1),r(!1))}function T(){r(!1)}const I=mc(i.floating.current);u&&I.addEventListener("keydown",_),l&&I.addEventListener(c,b);let E=[];return h&&(Zf(i.domReference.current)&&(E=pl(i.domReference.current)),Zf(i.floating.current)&&(E=E.concat(pl(i.floating.current))),!Zf(i.reference.current)&&i.reference.current&&i.reference.current.contextElement&&(E=E.concat(pl(i.reference.current.contextElement)))),E=E.filter(S=>{var A;return S!==((A=I.defaultView)==null?void 0:A.visualViewport)}),E.forEach(S=>{S.addEventListener("scroll",T,{passive:!0})}),()=>{u&&I.removeEventListener("keydown",_),l&&I.removeEventListener(c,b),E.forEach(S=>{S.removeEventListener("scroll",T)})}},[u,l,c,s,m,o,n,r,h,a,p,i,y]),w.useEffect(()=>{g.current=!1},[l,c]),w.useMemo(()=>a?{reference:{[T_e[d]]:()=>{f&&(s.emit("dismiss"),r(!1))}},floating:{[S_e[c]]:()=>{g.current=!0}}}:{},[a,s,f,c,d,r])},x_e=function(e,t){let{open:n,onOpenChange:r,dataRef:i,refs:s,events:o}=e,{enabled:a=!0,keyboardOnly:u=!0}=t===void 0?{}:t;const l=w.useRef(""),c=w.useRef(!1),f=w.useRef();return w.useEffect(()=>{var d;if(!a)return;const p=(d=mc(s.floating.current).defaultView)!=null?d:window;function m(){!n&&p_e(s.domReference.current)&&s.domReference.current.blur()}return p.addEventListener("blur",m),()=>{p.removeEventListener("blur",m)}},[s,n,a]),w.useEffect(()=>{if(!a)return;function d(){c.current=!0}return o.on("dismiss",d),()=>{o.off("dismiss",d)}},[o,a]),w.useEffect(()=>()=>{clearTimeout(f.current)},[]),w.useMemo(()=>a?{reference:{onPointerDown(d){let{pointerType:h}=d;l.current=h,c.current=!!(h&&u)},onPointerLeave(){c.current=!1},onFocus(d){var h,p,m;c.current||d.type==="focus"&&((h=i.current.openEvent)==null?void 0:h.type)==="mousedown"&&(p=s.domReference.current)!=null&&p.contains((m=i.current.openEvent)==null?void 0:m.target)||(i.current.openEvent=d.nativeEvent,r(!0))},onBlur(d){const h=d.relatedTarget;f.current=setTimeout(()=>{var p,m;(p=s.floating.current)!=null&&p.contains(h)||(m=s.domReference.current)!=null&&m.contains(h)||(c.current=!1,r(!1))})}}}:{},[a,u,s,i,r])};function NY({opened:e,floating:t,positionDependencies:n}){const[r,i]=w.useState(0);w.useEffect(()=>{if(t.refs.reference.current&&t.refs.floating.current)return s_e(t.refs.reference.current,t.refs.floating.current,t.update)},[t.refs.reference,t.refs.floating,e,r]),fo(()=>{t.update()},n),fo(()=>{i(s=>s+1)},[e])}function C_e(e){const t=[vY(e.offset)];return e.middlewares.shift&&t.push(vk({limiter:e_e()})),e.middlewares.flip&&t.push(_Y()),e.middlewares.inline&&t.push(EY()),t.push(CY({element:e.arrowRef})),t}function A_e(e){const[t,n]=Oa({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),r=()=>{var o;(o=e.onClose)==null||o.call(e),n(!1)},i=()=>{var o,a;t?((o=e.onClose)==null||o.call(e),n(!1)):((a=e.onOpen)==null||a.call(e),n(!0))},s=wk({placement:e.position,middleware:[...C_e(e),...e.width==="target"?[t_e({apply({rects:o}){var a,u;Object.assign((u=(a=s.refs.floating.current)==null?void 0:a.style)!=null?u:{},{width:`${o.reference.width}px`})}})]:[]]});return NY({opened:e.opened,positionDependencies:e.positionDependencies,floating:s}),fo(()=>{var o;(o=e.onPositionChange)==null||o.call(e,s.placement)},[s.placement]),{floating:s,controlled:typeof e.opened=="boolean",opened:t,onClose:r,onToggle:i}}const kY={context:"Popover component was not found in the tree",children:"Popover.Target component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported"},[O_e,DY]=XN(kY.context);var P_e=Object.defineProperty,R_e=Object.defineProperties,N_e=Object.getOwnPropertyDescriptors,AE=Object.getOwnPropertySymbols,$Y=Object.prototype.hasOwnProperty,LY=Object.prototype.propertyIsEnumerable,I5=(e,t,n)=>t in e?P_e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Wv=(e,t)=>{for(var n in t||(t={}))$Y.call(t,n)&&I5(e,n,t[n]);if(AE)for(var n of AE(t))LY.call(t,n)&&I5(e,n,t[n]);return e},k_e=(e,t)=>R_e(e,N_e(t)),D_e=(e,t)=>{var n={};for(var r in e)$Y.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&AE)for(var r of AE(e))t.indexOf(r)<0&&LY.call(e,r)&&(n[r]=e[r]);return n};const MY=w.forwardRef((e,t)=>{var n=e,{children:r,refProp:i="ref",popupType:s="dialog"}=n,o=D_e(n,["children","refProp","popupType"]);if(!Dm(r))throw new Error(kY.children);const a=o,u=DY(),l=Ko(u.reference,r.ref,t),c=u.withRoles?{"aria-haspopup":s,"aria-expanded":u.opened,"aria-controls":u.getDropdownId(),id:u.getTargetId()}:{};return w.cloneElement(r,Wv(k_e(Wv(Wv(Wv({},a),c),u.targetProps),{className:mW(u.targetProps.className,a.className,r.props.className),[i]:l}),u.controlled?null:{onClick:u.onToggle}))});MY.displayName="@mantine/core/PopoverTarget";var $_e=at((e,{radius:t,shadow:n})=>({dropdown:{position:"absolute",backgroundColor:e.white,background:e.colorScheme==="dark"?e.colors.dark[6]:e.white,border:`1px solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2]}`,padding:`${e.spacing.sm}px ${e.spacing.md}px`,boxShadow:e.shadows[n]||n||"none",borderRadius:e.fn.radius(t),"&:focus":{outline:0}},arrow:{backgroundColor:"inherit",border:`1px solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2]}`,zIndex:1}}));const L_e=$_e;var M_e=Object.defineProperty,x5=Object.getOwnPropertySymbols,F_e=Object.prototype.hasOwnProperty,B_e=Object.prototype.propertyIsEnumerable,C5=(e,t,n)=>t in e?M_e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yh=(e,t)=>{for(var n in t||(t={}))F_e.call(t,n)&&C5(e,n,t[n]);if(x5)for(var n of x5(t))B_e.call(t,n)&&C5(e,n,t[n]);return e};const A5={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function FY({transition:e,state:t,duration:n,timingFunction:r}){const i={transitionDuration:`${n}ms`,transitionTimingFunction:r};return typeof e=="string"?e in Bv?yh(yh(yh({transitionProperty:Bv[e].transitionProperty},i),Bv[e].common),Bv[e][A5[t]]):null:yh(yh(yh({transitionProperty:e.transitionProperty},i),e.common),e[A5[t]])}function BY({duration:e,exitDuration:t,timingFunction:n,mounted:r,onEnter:i,onExit:s,onEntered:o,onExited:a}){const u=ts(),l=lk(),c=u.respectReducedMotion?l:!1,[f,d]=w.useState(r?"entered":"exited");let h=c?0:e;const p=w.useRef(-1),m=y=>{const g=y?i:s,_=y?o:a;if(d(y?"pre-entering":"pre-exiting"),window.clearTimeout(p.current),h=c?0:y?e:t,h===0)typeof g=="function"&&g(),typeof _=="function"&&_(),d(y?"entered":"exited");else{const b=window.setTimeout(()=>{typeof g=="function"&&g(),d(y?"entering":"exiting")},10);p.current=window.setTimeout(()=>{window.clearTimeout(b),typeof _=="function"&&_(),d(y?"entered":"exited")},h)}};return fo(()=>{m(r)},[r]),w.useEffect(()=>()=>window.clearTimeout(p.current),[]),{transitionDuration:h,transitionStatus:f,transitionTimingFunction:n||u.transitionTimingFunction}}function XS({transition:e,duration:t=250,exitDuration:n=t,mounted:r,children:i,timingFunction:s,onExit:o,onEntered:a,onEnter:u,onExited:l}){const{transitionDuration:c,transitionStatus:f,transitionTimingFunction:d}=BY({mounted:r,exitDuration:n,duration:t,timingFunction:s,onExit:o,onEntered:a,onEnter:u,onExited:l});return c===0?r?k.createElement(k.Fragment,null,i({})):null:f==="exited"?null:k.createElement(k.Fragment,null,i(FY({transition:e,duration:c,state:f,timingFunction:d})))}XS.displayName="@mantine/core/Transition";function jY({children:e,active:t=!0,refProp:n="ref"}){const r=qW(t),i=Ko(r,e==null?void 0:e.ref);return Dm(e)?w.cloneElement(e,{[n]:i}):e}jY.displayName="@mantine/core/FocusTrap";var j_e=Object.defineProperty,U_e=Object.defineProperties,V_e=Object.getOwnPropertyDescriptors,O5=Object.getOwnPropertySymbols,z_e=Object.prototype.hasOwnProperty,H_e=Object.prototype.propertyIsEnumerable,P5=(e,t,n)=>t in e?j_e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Jl=(e,t)=>{for(var n in t||(t={}))z_e.call(t,n)&&P5(e,n,t[n]);if(O5)for(var n of O5(t))H_e.call(t,n)&&P5(e,n,t[n]);return e},qv=(e,t)=>U_e(e,V_e(t));function R5(e,t,n){return e==="center"?{top:t}:e==="end"?{bottom:n}:e==="start"?{top:n}:{}}function N5(e,t,n,r){return e==="center"?{[r==="ltr"?"left":"right"]:t}:e==="end"?{[r==="ltr"?"right":"left"]:n}:e==="start"?{[r==="ltr"?"left":"right"]:n}:{}}const W_e={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function q_e({position:e,withBorder:t,arrowSize:n,arrowOffset:r,arrowRadius:i,arrowX:s,arrowY:o,dir:a}){const[u,l="center"]=e.split("-"),c={width:n,height:n,transform:"rotate(45deg)",position:"absolute",[W_e[u]]:i},f=t?-n/2-1:-n/2;return u==="left"?qv(Jl(Jl({},c),R5(l,o,r)),{right:f,borderLeft:0,borderBottom:0}):u==="right"?qv(Jl(Jl({},c),R5(l,o,r)),{left:f,borderRight:0,borderTop:0}):u==="top"?qv(Jl(Jl({},c),N5(l,s,r,a)),{bottom:f,borderTop:0,[a==="ltr"?"borderLeft":"borderRight"]:0}):u==="bottom"?qv(Jl(Jl({},c),N5(l,s,r,a)),{top:f,borderBottom:0,[a==="ltr"?"borderRight":"borderLeft"]:0}):{}}var Y_e=Object.defineProperty,G_e=Object.defineProperties,K_e=Object.getOwnPropertyDescriptors,OE=Object.getOwnPropertySymbols,UY=Object.prototype.hasOwnProperty,VY=Object.prototype.propertyIsEnumerable,k5=(e,t,n)=>t in e?Y_e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Q_e=(e,t)=>{for(var n in t||(t={}))UY.call(t,n)&&k5(e,n,t[n]);if(OE)for(var n of OE(t))VY.call(t,n)&&k5(e,n,t[n]);return e},X_e=(e,t)=>G_e(e,K_e(t)),J_e=(e,t)=>{var n={};for(var r in e)UY.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&OE)for(var r of OE(e))t.indexOf(r)<0&&VY.call(e,r)&&(n[r]=e[r]);return n};const Tk=w.forwardRef((e,t)=>{var n=e,{withBorder:r,position:i,arrowSize:s,arrowOffset:o,arrowRadius:a,visible:u,arrowX:l,arrowY:c}=n,f=J_e(n,["withBorder","position","arrowSize","arrowOffset","arrowRadius","visible","arrowX","arrowY"]);const d=ts();return u?k.createElement("div",X_e(Q_e({},f),{ref:t,style:q_e({withBorder:r,position:i,arrowSize:s,arrowOffset:o,arrowRadius:a,dir:d.dir,arrowX:l,arrowY:c})})):null});Tk.displayName="@mantine/core/FloatingArrow";var Z_e=Object.defineProperty,eve=Object.defineProperties,tve=Object.getOwnPropertyDescriptors,PE=Object.getOwnPropertySymbols,zY=Object.prototype.hasOwnProperty,HY=Object.prototype.propertyIsEnumerable,D5=(e,t,n)=>t in e?Z_e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Yv=(e,t)=>{for(var n in t||(t={}))zY.call(t,n)&&D5(e,n,t[n]);if(PE)for(var n of PE(t))HY.call(t,n)&&D5(e,n,t[n]);return e},$5=(e,t)=>eve(e,tve(t)),nve=(e,t)=>{var n={};for(var r in e)zY.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&PE)for(var r of PE(e))t.indexOf(r)<0&&HY.call(e,r)&&(n[r]=e[r]);return n};function WY(e){var t=e,{style:n,className:r,children:i,onKeyDownCapture:s}=t,o=nve(t,["style","className","children","onKeyDownCapture"]);const{classNames:a,styles:u,unstyled:l,staticSelector:c}=T_(),f=DY(),{classes:d,cx:h}=L_e({radius:f.radius,shadow:f.shadow},{name:c,classNames:a,styles:u,unstyled:l}),p=VW({opened:f.opened,shouldReturnFocus:f.returnFocus}),m=f.withRoles?{"aria-labelledby":f.getTargetId(),id:f.getDropdownId(),role:"dialog"}:{};return f.disabled?null:k.createElement(S_,{withinPortal:f.withinPortal},k.createElement(XS,{mounted:f.opened,transition:f.transition,duration:f.transitionDuration,exitDuration:typeof f.exitTransitionDuration=="number"?f.exitTransitionDuration:f.transitionDuration},y=>{var g,_;return k.createElement(jY,{active:f.trapFocus},k.createElement(ut,Yv($5(Yv({},m),{tabIndex:-1,ref:f.floating,style:$5(Yv(Yv({},n),y),{zIndex:f.zIndex,top:(g=f.y)!=null?g:0,left:(_=f.x)!=null?_:0,width:f.width==="target"?void 0:f.width}),className:h(d.dropdown,r),onKeyDownCapture:dde(f.onClose,{active:f.closeOnEscape,onTrigger:p,onKeyDown:s}),"data-position":f.placement}),o),i,k.createElement(Tk,{ref:f.arrowRef,arrowX:f.arrowX,arrowY:f.arrowY,visible:f.withArrow,withBorder:!0,position:f.placement,arrowSize:f.arrowSize,arrowRadius:f.arrowRadius,arrowOffset:f.arrowOffset,className:d.arrow})))}))}WY.displayName="@mantine/core/PopoverDropdown";function qY(e,t){if(e==="rtl"&&(t.includes("right")||t.includes("left"))){const[n,r]=t.split("-"),i=n==="right"?"left":"right";return r===void 0?i:`${i}-${r}`}return t}var L5=Object.getOwnPropertySymbols,rve=Object.prototype.hasOwnProperty,ive=Object.prototype.propertyIsEnumerable,sve=(e,t)=>{var n={};for(var r in e)rve.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&L5)for(var r of L5(e))t.indexOf(r)<0&&ive.call(e,r)&&(n[r]=e[r]);return n};const ove={position:"bottom",offset:8,positionDependencies:[],transition:"fade",transitionDuration:150,middlewares:{flip:!0,shift:!0,inline:!1},arrowSize:7,arrowOffset:5,arrowRadius:0,closeOnClickOutside:!0,withinPortal:!1,closeOnEscape:!0,trapFocus:!1,withRoles:!0,returnFocus:!1,clickOutsideEvents:["mousedown","touchstart"],zIndex:To("popover"),__staticSelector:"Popover",width:"max-content"};function Xo(e){var t,n,r,i,s,o;const a=w.useRef(null),u=ct("Popover",ove,e),{children:l,position:c,offset:f,onPositionChange:d,positionDependencies:h,opened:p,transition:m,transitionDuration:y,width:g,middlewares:_,withArrow:b,arrowSize:T,arrowOffset:I,arrowRadius:E,unstyled:S,classNames:A,styles:P,closeOnClickOutside:V,withinPortal:M,closeOnEscape:H,clickOutsideEvents:J,trapFocus:Y,onClose:ye,onOpen:he,onChange:ve,zIndex:te,radius:se,shadow:K,id:x,defaultOpened:C,exitTransitionDuration:z,__staticSelector:R,withRoles:O,disabled:q,returnFocus:le}=u,ae=sve(u,["children","position","offset","onPositionChange","positionDependencies","opened","transition","transitionDuration","width","middlewares","withArrow","arrowSize","arrowOffset","arrowRadius","unstyled","classNames","styles","closeOnClickOutside","withinPortal","closeOnEscape","clickOutsideEvents","trapFocus","onClose","onOpen","onChange","zIndex","radius","shadow","id","defaultOpened","exitTransitionDuration","__staticSelector","withRoles","disabled","returnFocus"]),[pe,me]=w.useState(null),[Se,ce]=w.useState(null),st=Fu(x),Ke=ts(),qe=A_e({middlewares:_,width:g,position:qY(Ke.dir,c),offset:f+(b?T/2:0),arrowRef:a,onPositionChange:d,positionDependencies:h,opened:p,defaultOpened:C,onChange:ve,onOpen:he,onClose:ye});dpe(()=>V&&qe.onClose(),J,[pe,Se]);const $e=w.useCallback(lt=>{me(lt),qe.floating.reference(lt)},[qe.floating.reference]),ot=w.useCallback(lt=>{ce(lt),qe.floating.floating(lt)},[qe.floating.floating]);return k.createElement(BW,{classNames:A,styles:P,unstyled:S,staticSelector:R},k.createElement(O_e,{value:{returnFocus:le,disabled:q,controlled:qe.controlled,reference:$e,floating:ot,x:qe.floating.x,y:qe.floating.y,arrowX:(r=(n=(t=qe.floating)==null?void 0:t.middlewareData)==null?void 0:n.arrow)==null?void 0:r.x,arrowY:(o=(s=(i=qe.floating)==null?void 0:i.middlewareData)==null?void 0:s.arrow)==null?void 0:o.y,opened:qe.opened,arrowRef:a,transition:m,transitionDuration:y,exitTransitionDuration:z,width:g,withArrow:b,arrowSize:T,arrowOffset:I,arrowRadius:E,placement:qe.floating.placement,trapFocus:Y,withinPortal:M,zIndex:te,radius:se,shadow:K,closeOnEscape:H,onClose:qe.onClose,onToggle:qe.onToggle,getTargetId:()=>`${st}-target`,getDropdownId:()=>`${st}-dropdown`,withRoles:O,targetProps:ae}},l))}Xo.Target=MY;Xo.Dropdown=WY;Xo.displayName="@mantine/core/Popover";var ave=Object.defineProperty,RE=Object.getOwnPropertySymbols,YY=Object.prototype.hasOwnProperty,GY=Object.prototype.propertyIsEnumerable,M5=(e,t,n)=>t in e?ave(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,uve=(e,t)=>{for(var n in t||(t={}))YY.call(t,n)&&M5(e,n,t[n]);if(RE)for(var n of RE(t))GY.call(t,n)&&M5(e,n,t[n]);return e},lve=(e,t)=>{var n={};for(var r in e)YY.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&RE)for(var r of RE(e))t.indexOf(r)<0&&GY.call(e,r)&&(n[r]=e[r]);return n};function cve(e){var t=e,{children:n,component:r="div",maxHeight:i=220,direction:s="column",id:o,innerRef:a,__staticSelector:u,styles:l,classNames:c,unstyled:f}=t,d=lve(t,["children","component","maxHeight","direction","id","innerRef","__staticSelector","styles","classNames","unstyled"]);const{classes:h}=Gye(null,{name:u,styles:l,classNames:c,unstyled:f});return k.createElement(Xo.Dropdown,uve({p:0,onMouseDown:p=>p.preventDefault()},d),k.createElement("div",{style:{maxHeight:i,display:"flex"}},k.createElement(ut,{component:r||"div",id:`${o}-items`,"aria-labelledby":`${o}-label`,role:"listbox",onMouseDown:p=>p.preventDefault(),style:{flex:1,overflowY:r!==GS?"auto":void 0},"data-combobox-popover":!0,ref:a},k.createElement("div",{className:h.itemsWrapper,style:{flexDirection:s}},n))))}function Bc({opened:e,transition:t="fade",transitionDuration:n=0,shadow:r,withinPortal:i,children:s,__staticSelector:o,onDirectionChange:a,switchDirectionOnFlip:u,zIndex:l,dropdownPosition:c,positionDependencies:f=[],classNames:d,styles:h,unstyled:p,readOnly:m}){return k.createElement(Xo,{unstyled:p,classNames:d,styles:h,width:"target",withRoles:!1,opened:e,middlewares:{flip:c==="flip",shift:!1},position:c==="flip"?"bottom":c,positionDependencies:f,zIndex:l,__staticSelector:o,withinPortal:i,transition:t,transitionDuration:n,shadow:r,disabled:m,onPositionChange:y=>u&&(a==null?void 0:a(y==="top"?"column-reverse":"column"))},s)}Bc.Target=Xo.Target;Bc.Dropdown=cve;var fve=Object.defineProperty,dve=Object.defineProperties,hve=Object.getOwnPropertyDescriptors,NE=Object.getOwnPropertySymbols,KY=Object.prototype.hasOwnProperty,QY=Object.prototype.propertyIsEnumerable,F5=(e,t,n)=>t in e?fve(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$C=(e,t)=>{for(var n in t||(t={}))KY.call(t,n)&&F5(e,n,t[n]);if(NE)for(var n of NE(t))QY.call(t,n)&&F5(e,n,t[n]);return e},pve=(e,t)=>dve(e,hve(t)),mve=(e,t)=>{var n={};for(var r in e)KY.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&NE)for(var r of NE(e))t.indexOf(r)<0&&QY.call(e,r)&&(n[r]=e[r]);return n};function XY(e,t,n){const r=ct(e,t,n),{label:i,description:s,error:o,required:a,classNames:u,styles:l,className:c,unstyled:f,__staticSelector:d,sx:h,errorProps:p,labelProps:m,descriptionProps:y,wrapperProps:g,id:_,size:b,style:T,inputContainer:I,inputWrapperOrder:E,withAsterisk:S}=r,A=mve(r,["label","description","error","required","classNames","styles","className","unstyled","__staticSelector","sx","errorProps","labelProps","descriptionProps","wrapperProps","id","size","style","inputContainer","inputWrapperOrder","withAsterisk"]),P=Fu(_),{systemStyles:V,rest:M}=Xd(A);return pve($C({},M),{classNames:u,styles:l,unstyled:f,wrapperProps:$C($C({label:i,description:s,error:o,required:a,classNames:u,className:c,__staticSelector:d,sx:h,errorProps:p,labelProps:m,descriptionProps:y,unstyled:f,styles:l,id:P,size:b,style:T,inputContainer:I,inputWrapperOrder:E,withAsterisk:S},g),V),inputProps:{required:a,classNames:u,styles:l,unstyled:f,id:P,size:b,__staticSelector:d,invalid:!!o}})}var gve=at((e,{size:t})=>({label:{display:"inline-block",fontSize:e.fn.size({size:t,sizes:e.fontSizes}),fontWeight:500,color:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[9],wordBreak:"break-word",cursor:"default",WebkitTapHighlightColor:"transparent"},required:{color:e.fn.variant({variant:"filled",color:"red"}).background}}));const yve=gve;var _ve=Object.defineProperty,kE=Object.getOwnPropertySymbols,JY=Object.prototype.hasOwnProperty,ZY=Object.prototype.propertyIsEnumerable,B5=(e,t,n)=>t in e?_ve(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,vve=(e,t)=>{for(var n in t||(t={}))JY.call(t,n)&&B5(e,n,t[n]);if(kE)for(var n of kE(t))ZY.call(t,n)&&B5(e,n,t[n]);return e},bve=(e,t)=>{var n={};for(var r in e)JY.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&kE)for(var r of kE(e))t.indexOf(r)<0&&ZY.call(e,r)&&(n[r]=e[r]);return n};const Sk=w.forwardRef((e,t)=>{var n=e,{labelElement:r="label",children:i,required:s,size:o="sm",classNames:a,styles:u,unstyled:l,className:c,htmlFor:f,__staticSelector:d}=n,h=bve(n,["labelElement","children","required","size","classNames","styles","unstyled","className","htmlFor","__staticSelector"]);const{classes:p,cx:m}=yve({size:o},{name:["InputWrapper",d],classNames:a,styles:u,unstyled:l});return k.createElement(ut,vve({component:r,ref:t,className:m(p.label,c),htmlFor:r==="label"?f:void 0},h),i,s&&k.createElement("span",{className:p.required,"aria-hidden":!0}," *"))});Sk.displayName="@mantine/core/InputLabel";var Eve=at((e,{size:t})=>({error:{wordBreak:"break-word",color:e.fn.variant({variant:"filled",color:"red"}).background,fontSize:e.fn.size({size:t,sizes:e.fontSizes})-2,lineHeight:1.2,display:"block"}}));const wve=Eve;var Tve=Object.defineProperty,DE=Object.getOwnPropertySymbols,eG=Object.prototype.hasOwnProperty,tG=Object.prototype.propertyIsEnumerable,j5=(e,t,n)=>t in e?Tve(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Sve=(e,t)=>{for(var n in t||(t={}))eG.call(t,n)&&j5(e,n,t[n]);if(DE)for(var n of DE(t))tG.call(t,n)&&j5(e,n,t[n]);return e},Ive=(e,t)=>{var n={};for(var r in e)eG.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&DE)for(var r of DE(e))t.indexOf(r)<0&&tG.call(e,r)&&(n[r]=e[r]);return n};const Ik=w.forwardRef((e,t)=>{var n=e,{children:r,className:i,classNames:s,styles:o,unstyled:a,size:u="sm",__staticSelector:l}=n,c=Ive(n,["children","className","classNames","styles","unstyled","size","__staticSelector"]);const{classes:f,cx:d}=wve({size:u},{name:["InputWrapper",l],classNames:s,styles:o,unstyled:a});return k.createElement(Tt,Sve({className:d(f.error,i),ref:t,role:"alert"},c),r)});Ik.displayName="@mantine/core/InputError";var xve=at((e,{size:t})=>({description:{wordBreak:"break-word",color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6],fontSize:e.fn.size({size:t,sizes:e.fontSizes})-2,lineHeight:1.2,display:"block"}}));const Cve=xve;var Ave=Object.defineProperty,$E=Object.getOwnPropertySymbols,nG=Object.prototype.hasOwnProperty,rG=Object.prototype.propertyIsEnumerable,U5=(e,t,n)=>t in e?Ave(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ove=(e,t)=>{for(var n in t||(t={}))nG.call(t,n)&&U5(e,n,t[n]);if($E)for(var n of $E(t))rG.call(t,n)&&U5(e,n,t[n]);return e},Pve=(e,t)=>{var n={};for(var r in e)nG.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&$E)for(var r of $E(e))t.indexOf(r)<0&&rG.call(e,r)&&(n[r]=e[r]);return n};const xk=w.forwardRef((e,t)=>{var n=e,{children:r,className:i,classNames:s,styles:o,unstyled:a,size:u="sm",__staticSelector:l}=n,c=Pve(n,["children","className","classNames","styles","unstyled","size","__staticSelector"]);const{classes:f,cx:d}=Cve({size:u},{name:["InputWrapper",l],classNames:s,styles:o,unstyled:a});return k.createElement(Tt,Ove({color:"dimmed",className:d(f.description,i),ref:t,unstyled:a},c),r)});xk.displayName="@mantine/core/InputDescription";const iG=w.createContext({offsetBottom:!1,offsetTop:!1}),Rve=iG.Provider,Nve=()=>w.useContext(iG);function kve(e,{hasDescription:t,hasError:n}){const r=e.findIndex(u=>u==="input"),i=e[r-1],s=e[r+1];return{offsetBottom:t&&s==="description"||n&&s==="error",offsetTop:t&&i==="description"||n&&i==="error"}}var Dve=Object.defineProperty,$ve=Object.defineProperties,Lve=Object.getOwnPropertyDescriptors,V5=Object.getOwnPropertySymbols,Mve=Object.prototype.hasOwnProperty,Fve=Object.prototype.propertyIsEnumerable,z5=(e,t,n)=>t in e?Dve(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Bve=(e,t)=>{for(var n in t||(t={}))Mve.call(t,n)&&z5(e,n,t[n]);if(V5)for(var n of V5(t))Fve.call(t,n)&&z5(e,n,t[n]);return e},jve=(e,t)=>$ve(e,Lve(t)),Uve=at(e=>({root:jve(Bve({},e.fn.fontStyles()),{lineHeight:e.lineHeight})}));const Vve=Uve;var zve=Object.defineProperty,Hve=Object.defineProperties,Wve=Object.getOwnPropertyDescriptors,LE=Object.getOwnPropertySymbols,sG=Object.prototype.hasOwnProperty,oG=Object.prototype.propertyIsEnumerable,H5=(e,t,n)=>t in e?zve(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Nf=(e,t)=>{for(var n in t||(t={}))sG.call(t,n)&&H5(e,n,t[n]);if(LE)for(var n of LE(t))oG.call(t,n)&&H5(e,n,t[n]);return e},W5=(e,t)=>Hve(e,Wve(t)),qve=(e,t)=>{var n={};for(var r in e)sG.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&LE)for(var r of LE(e))t.indexOf(r)<0&&oG.call(e,r)&&(n[r]=e[r]);return n};const Yve={labelElement:"label",size:"sm",inputContainer:e=>e,inputWrapperOrder:["label","description","input","error"]},aG=w.forwardRef((e,t)=>{const n=ct("InputWrapper",Yve,e),{className:r,label:i,children:s,required:o,id:a,error:u,description:l,labelElement:c,labelProps:f,descriptionProps:d,errorProps:h,classNames:p,styles:m,size:y,inputContainer:g,__staticSelector:_,unstyled:b,inputWrapperOrder:T,withAsterisk:I}=n,E=qve(n,["className","label","children","required","id","error","description","labelElement","labelProps","descriptionProps","errorProps","classNames","styles","size","inputContainer","__staticSelector","unstyled","inputWrapperOrder","withAsterisk"]),{classes:S,cx:A}=Vve(null,{classNames:p,styles:m,name:["InputWrapper",_],unstyled:b}),P={classNames:p,styles:m,unstyled:b,size:y,__staticSelector:_},V=typeof I=="boolean"?I:o,M=i&&k.createElement(Sk,Nf(Nf({key:"label",labelElement:c,id:a?`${a}-label`:void 0,htmlFor:a,required:V},P),f),i),H=l&&k.createElement(xk,W5(Nf(Nf({key:"description"},d),P),{size:(d==null?void 0:d.size)||P.size}),l),J=k.createElement(w.Fragment,{key:"input"},g(s)),Y=typeof u!="boolean"&&u&&k.createElement(Ik,W5(Nf(Nf({},h),P),{size:(h==null?void 0:h.size)||P.size,key:"error"}),u),ye=T.map(he=>{switch(he){case"label":return M;case"input":return J;case"description":return H;case"error":return Y;default:return null}});return k.createElement(Rve,{value:kve(T,{hasDescription:!!H,hasError:!!Y})},k.createElement(ut,Nf({className:A(S.root,r),ref:t},E),ye))});aG.displayName="@mantine/core/InputWrapper";var Gve=Object.defineProperty,Kve=Object.defineProperties,Qve=Object.getOwnPropertyDescriptors,q5=Object.getOwnPropertySymbols,Xve=Object.prototype.hasOwnProperty,Jve=Object.prototype.propertyIsEnumerable,Y5=(e,t,n)=>t in e?Gve(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,LC=(e,t)=>{for(var n in t||(t={}))Xve.call(t,n)&&Y5(e,n,t[n]);if(q5)for(var n of q5(t))Jve.call(t,n)&&Y5(e,n,t[n]);return e},G5=(e,t)=>Kve(e,Qve(t));const Ss={xs:30,sm:36,md:42,lg:50,xl:60};function Zve({theme:e,variant:t}){return t==="default"?{border:`1px solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]}`,backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.white,transition:"border-color 100ms ease","&:focus, &:focus-within":e.focusRingStyles.inputStyles(e)}:t==="filled"?{border:"1px solid transparent",backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1],"&:focus, &:focus-within":e.focusRingStyles.inputStyles(e)}:{borderWidth:0,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,backgroundColor:"transparent",minHeight:28,outline:0,"&:focus, &:focus-within":{outline:"none",borderColor:"transparent"},"&:disabled":{backgroundColor:"transparent","&:focus, &:focus-within":{outline:"none",borderColor:"transparent"}}}}var e1e=at((e,{size:t,multiline:n,radius:r,variant:i,invalid:s,rightSectionWidth:o,withRightSection:a,iconWidth:u,offsetBottom:l,offsetTop:c,pointer:f})=>{const d=e.fn.variant({variant:"filled",color:"red"}).background,h=i==="default"||i==="filled"?{minHeight:e.fn.size({size:t,sizes:Ss}),paddingLeft:e.fn.size({size:t,sizes:Ss})/3,paddingRight:a?o:e.fn.size({size:t,sizes:Ss})/3,borderRadius:e.fn.radius(r)}:null;return{wrapper:{position:"relative",marginTop:c?`calc(${e.spacing.xs}px / 2)`:void 0,marginBottom:l?`calc(${e.spacing.xs}px / 2)`:void 0},input:LC(G5(LC(G5(LC({},e.fn.fontStyles()),{height:n?i==="unstyled"?void 0:"auto":e.fn.size({size:t,sizes:Ss}),WebkitTapHighlightColor:"transparent",lineHeight:n?e.lineHeight:`${e.fn.size({size:t,sizes:Ss})-2}px`,appearance:"none",resize:"none",boxSizing:"border-box",fontSize:e.fn.size({size:t,sizes:e.fontSizes}),width:"100%",color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,display:"block",textAlign:"left",cursor:f?"pointer":void 0}),h),{"&:disabled":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[1],color:e.colors.dark[2],opacity:.6,cursor:"not-allowed","&::placeholder":{color:e.colors.dark[2]}},"&::placeholder":{opacity:1,userSelect:"none",color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]},"&::-webkit-inner-spin-button, &::-webkit-outer-spin-button, &::-webkit-search-decoration, &::-webkit-search-cancel-button, &::-webkit-search-results-button, &::-webkit-search-results-decoration":{appearance:"none"},"&[type=number]":{MozAppearance:"textfield"}}),Zve({theme:e,variant:i})),withIcon:{paddingLeft:typeof u=="number"?u:e.fn.size({size:t,sizes:Ss})},invalid:{color:d,borderColor:d,"&::placeholder":{opacity:1,color:d}},disabled:{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[1],color:e.colors.dark[2],opacity:.6,cursor:"not-allowed","&::placeholder":{color:e.colors.dark[2]}},icon:{pointerEvents:"none",position:"absolute",zIndex:1,left:0,top:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",width:typeof u=="number"?u:e.fn.size({size:t,sizes:Ss}),color:s?e.colors.red[e.colorScheme==="dark"?6:7]:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[5]},rightSection:{position:"absolute",top:0,bottom:0,right:0,display:"flex",alignItems:"center",justifyContent:"center",width:o}}});const t1e=e1e;var n1e=Object.defineProperty,r1e=Object.defineProperties,i1e=Object.getOwnPropertyDescriptors,ME=Object.getOwnPropertySymbols,uG=Object.prototype.hasOwnProperty,lG=Object.prototype.propertyIsEnumerable,K5=(e,t,n)=>t in e?n1e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Gv=(e,t)=>{for(var n in t||(t={}))uG.call(t,n)&&K5(e,n,t[n]);if(ME)for(var n of ME(t))lG.call(t,n)&&K5(e,n,t[n]);return e},Q5=(e,t)=>r1e(e,i1e(t)),s1e=(e,t)=>{var n={};for(var r in e)uG.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ME)for(var r of ME(e))t.indexOf(r)<0&&lG.call(e,r)&&(n[r]=e[r]);return n};const o1e={rightSectionWidth:36,size:"sm",variant:"default"},Mm=w.forwardRef((e,t)=>{const n=ct("Input",o1e,e),{className:r,invalid:i,required:s,disabled:o,variant:a,icon:u,style:l,rightSectionWidth:c,iconWidth:f,rightSection:d,rightSectionProps:h,radius:p,size:m,wrapperProps:y,classNames:g,styles:_,__staticSelector:b,multiline:T,sx:I,unstyled:E,pointer:S}=n,A=s1e(n,["className","invalid","required","disabled","variant","icon","style","rightSectionWidth","iconWidth","rightSection","rightSectionProps","radius","size","wrapperProps","classNames","styles","__staticSelector","multiline","sx","unstyled","pointer"]),{offsetBottom:P,offsetTop:V}=Nve(),{classes:M,cx:H}=t1e({radius:p,size:m,multiline:T,variant:a,invalid:i,rightSectionWidth:c,iconWidth:f,withRightSection:!!d,offsetBottom:P,offsetTop:V,pointer:S},{classNames:g,styles:_,name:["Input",b],unstyled:E}),{systemStyles:J,rest:Y}=Xd(A);return k.createElement(ut,Gv(Gv({className:H(M.wrapper,r),sx:I,style:l},J),y),u&&k.createElement("div",{className:M.icon},u),k.createElement(ut,Q5(Gv({component:"input"},Y),{ref:t,required:s,"aria-invalid":i,disabled:o,className:H(M[`${a}Variant`],M.input,{[M.withIcon]:u,[M.invalid]:i,[M.disabled]:o})})),d&&k.createElement("div",Q5(Gv({},h),{className:M.rightSection}),d))});Mm.displayName="@mantine/core/Input";Mm.Wrapper=aG;Mm.Label=Sk;Mm.Description=xk;Mm.Error=Ik;const Bs=Mm;var a1e=Object.defineProperty,u1e=Object.defineProperties,l1e=Object.getOwnPropertyDescriptors,X5=Object.getOwnPropertySymbols,c1e=Object.prototype.hasOwnProperty,f1e=Object.prototype.propertyIsEnumerable,J5=(e,t,n)=>t in e?a1e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,MC=(e,t)=>{for(var n in t||(t={}))c1e.call(t,n)&&J5(e,n,t[n]);if(X5)for(var n of X5(t))f1e.call(t,n)&&J5(e,n,t[n]);return e},d1e=(e,t)=>u1e(e,l1e(t));const FC={xs:{fontSize:9,height:16},sm:{fontSize:10,height:18},md:{fontSize:11,height:20},lg:{fontSize:13,height:26},xl:{fontSize:16,height:32}},h1e={xs:4,sm:4,md:6,lg:8,xl:10};function p1e({theme:e,variant:t,color:n,size:r,gradient:i}){if(t==="dot"){const o=e.fn.size({size:r,sizes:h1e});return{backgroundColor:"transparent",color:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[7],border:`1px solid ${e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[3]}`,paddingLeft:e.fn.size({size:r,sizes:e.spacing})/1.5-o/2,"&::before":{content:'""',display:"block",width:o,height:o,borderRadius:o,backgroundColor:e.fn.themeColor(n,e.colorScheme==="dark"?4:e.fn.primaryShade("light"),!0),marginRight:o}}}const s=e.fn.variant({color:n,variant:t,gradient:i});return{background:s.background,color:s.color,border:`${t==="gradient"?0:1}px solid ${s.border}`}}var m1e=at((e,{color:t,size:n,radius:r,gradient:i,fullWidth:s,variant:o})=>{const{fontSize:a,height:u}=n in FC?FC[n]:FC.md;return{leftSection:{marginRight:`calc(${e.spacing.xs}px / 2)`},rightSection:{marginLeft:`calc(${e.spacing.xs}px / 2)`},inner:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},root:MC(d1e(MC(MC({},e.fn.focusStyles()),e.fn.fontStyles()),{fontSize:a,height:u,WebkitTapHighlightColor:"transparent",lineHeight:`${u-2}px`,textDecoration:"none",padding:`0 ${e.fn.size({size:n,sizes:e.spacing})/1.5}px`,boxSizing:"border-box",display:s?"flex":"inline-flex",alignItems:"center",justifyContent:"center",width:s?"100%":"auto",textTransform:"uppercase",borderRadius:e.fn.radius(r),fontWeight:700,letterSpacing:.25,cursor:"inherit",textOverflow:"ellipsis",overflow:"hidden"}),p1e({theme:e,variant:o,color:t,size:n,gradient:i}))}});const g1e=m1e;var y1e=Object.defineProperty,FE=Object.getOwnPropertySymbols,cG=Object.prototype.hasOwnProperty,fG=Object.prototype.propertyIsEnumerable,Z5=(e,t,n)=>t in e?y1e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_1e=(e,t)=>{for(var n in t||(t={}))cG.call(t,n)&&Z5(e,n,t[n]);if(FE)for(var n of FE(t))fG.call(t,n)&&Z5(e,n,t[n]);return e},v1e=(e,t)=>{var n={};for(var r in e)cG.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&FE)for(var r of FE(e))t.indexOf(r)<0&&fG.call(e,r)&&(n[r]=e[r]);return n};const b1e={variant:"light",size:"md",radius:"xl"},dG=w.forwardRef((e,t)=>{const n=ct("Badge",b1e,e),{className:r,color:i,variant:s,fullWidth:o,children:a,size:u,leftSection:l,rightSection:c,radius:f,gradient:d,classNames:h,styles:p,unstyled:m}=n,y=v1e(n,["className","color","variant","fullWidth","children","size","leftSection","rightSection","radius","gradient","classNames","styles","unstyled"]),{classes:g,cx:_}=g1e({size:u,fullWidth:o,color:i,radius:f,variant:s,gradient:d},{classNames:h,styles:p,name:"Badge",unstyled:m});return k.createElement(ut,_1e({className:_(g.root,r),ref:t},y),l&&k.createElement("span",{className:g.leftSection},l),k.createElement("span",{className:g.inner},a),c&&k.createElement("span",{className:g.rightSection},c))});dG.displayName="@mantine/core/Badge";const E1e=dG;var w1e=at((e,{orientation:t,buttonBorderWidth:n})=>({root:{display:"flex",flexDirection:t==="vertical"?"column":"row","& [data-button]":{"&:first-of-type":{borderBottomRightRadius:0,[t==="vertical"?"borderBottomLeftRadius":"borderTopRightRadius"]:0,[t==="vertical"?"borderBottomWidth":"borderRightWidth"]:n/2},"&:last-of-type":{borderTopLeftRadius:0,[t==="vertical"?"borderTopRightRadius":"borderBottomLeftRadius"]:0,[t==="vertical"?"borderTopWidth":"borderLeftWidth"]:n/2},"&:not(:first-of-type):not(:last-of-type)":{borderRadius:0,[t==="vertical"?"borderTopWidth":"borderLeftWidth"]:n/2,[t==="vertical"?"borderBottomWidth":"borderRightWidth"]:n/2},"& + [data-button]":{[t==="vertical"?"marginTop":"marginLeft"]:-n,"@media (min-resolution: 192dpi)":{[t==="vertical"?"marginTop":"marginLeft"]:0}}}}}));const T1e=w1e;var S1e=Object.defineProperty,BE=Object.getOwnPropertySymbols,hG=Object.prototype.hasOwnProperty,pG=Object.prototype.propertyIsEnumerable,eF=(e,t,n)=>t in e?S1e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,I1e=(e,t)=>{for(var n in t||(t={}))hG.call(t,n)&&eF(e,n,t[n]);if(BE)for(var n of BE(t))pG.call(t,n)&&eF(e,n,t[n]);return e},x1e=(e,t)=>{var n={};for(var r in e)hG.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&BE)for(var r of BE(e))t.indexOf(r)<0&&pG.call(e,r)&&(n[r]=e[r]);return n};const C1e={orientation:"horizontal",buttonBorderWidth:1},mG=w.forwardRef((e,t)=>{const n=ct("ButtonGroup",C1e,e),{className:r,orientation:i,buttonBorderWidth:s,unstyled:o}=n,a=x1e(n,["className","orientation","buttonBorderWidth","unstyled"]),{classes:u,cx:l}=T1e({orientation:i,buttonBorderWidth:s},{name:"ButtonGroup",unstyled:o});return k.createElement(ut,I1e({className:l(u.root,r),ref:t},a))});mG.displayName="@mantine/core/ButtonGroup";var A1e=Object.defineProperty,O1e=Object.defineProperties,P1e=Object.getOwnPropertyDescriptors,tF=Object.getOwnPropertySymbols,R1e=Object.prototype.hasOwnProperty,N1e=Object.prototype.propertyIsEnumerable,nF=(e,t,n)=>t in e?A1e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,zf=(e,t)=>{for(var n in t||(t={}))R1e.call(t,n)&&nF(e,n,t[n]);if(tF)for(var n of tF(t))N1e.call(t,n)&&nF(e,n,t[n]);return e},BP=(e,t)=>O1e(e,P1e(t));const jP={xs:{height:Ss.xs,paddingLeft:14,paddingRight:14},sm:{height:Ss.sm,paddingLeft:18,paddingRight:18},md:{height:Ss.md,paddingLeft:22,paddingRight:22},lg:{height:Ss.lg,paddingLeft:26,paddingRight:26},xl:{height:Ss.xl,paddingLeft:32,paddingRight:32},"compact-xs":{height:22,paddingLeft:7,paddingRight:7},"compact-sm":{height:26,paddingLeft:8,paddingRight:8},"compact-md":{height:30,paddingLeft:10,paddingRight:10},"compact-lg":{height:34,paddingLeft:12,paddingRight:12},"compact-xl":{height:40,paddingLeft:14,paddingRight:14}};function k1e({compact:e,size:t,withLeftIcon:n,withRightIcon:r}){if(e)return jP[`compact-${t}`];const i=jP[t];return BP(zf({},i),{paddingLeft:n?i.paddingLeft/1.5:i.paddingLeft,paddingRight:r?i.paddingRight/1.5:i.paddingRight})}const D1e=e=>({display:e?"block":"inline-block",width:e?"100%":"auto"});function $1e({variant:e,theme:t,color:n,gradient:r}){const i=t.fn.variant({color:n,variant:e,gradient:r});return e==="gradient"?{border:0,backgroundImage:i.background,color:i.color,"&:hover":t.fn.hover({backgroundSize:"200%"})}:zf({border:`1px solid ${i.border}`,backgroundColor:i.background,color:i.color},t.fn.hover({backgroundColor:i.hover}))}var L1e=at((e,{color:t,size:n,radius:r,fullWidth:i,compact:s,gradient:o,variant:a,withLeftIcon:u,withRightIcon:l})=>({root:BP(zf(BP(zf(zf(zf(zf({},k1e({compact:s,size:n,withLeftIcon:u,withRightIcon:l})),e.fn.fontStyles()),e.fn.focusStyles()),D1e(i)),{borderRadius:e.fn.radius(r),fontWeight:600,position:"relative",lineHeight:1,fontSize:e.fn.size({size:n,sizes:e.fontSizes}),userSelect:"none",cursor:"pointer"}),$1e({variant:a,theme:e,color:t,gradient:o})),{"&:active":e.activeStyles,"&:disabled, &[data-disabled]":{borderColor:"transparent",backgroundColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2],color:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[5],cursor:"not-allowed",backgroundImage:"none",pointerEvents:"none","&:active":{transform:"none"}},"&[data-loading]":{pointerEvents:"none","&::before":{content:'""',position:"absolute",top:-1,left:-1,right:-1,bottom:-1,backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.colors.dark[7],.5):"rgba(255, 255, 255, .5)",borderRadius:e.fn.radius(r),cursor:"not-allowed"}}}),icon:{display:"flex",alignItems:"center"},leftIcon:{marginRight:10},rightIcon:{marginLeft:10},centerLoader:{position:"absolute",left:"50%",transform:"translateX(-50%)",opacity:.5},inner:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",overflow:"visible"},label:{whiteSpace:"nowrap",height:"100%",overflow:"hidden",display:"flex",alignItems:"center"}}));const M1e=L1e;var F1e=Object.defineProperty,jE=Object.getOwnPropertySymbols,gG=Object.prototype.hasOwnProperty,yG=Object.prototype.propertyIsEnumerable,rF=(e,t,n)=>t in e?F1e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,iF=(e,t)=>{for(var n in t||(t={}))gG.call(t,n)&&rF(e,n,t[n]);if(jE)for(var n of jE(t))yG.call(t,n)&&rF(e,n,t[n]);return e},B1e=(e,t)=>{var n={};for(var r in e)gG.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&jE)for(var r of jE(e))t.indexOf(r)<0&&yG.call(e,r)&&(n[r]=e[r]);return n};const j1e={size:"sm",type:"button",variant:"filled",loaderPosition:"left"},Ck=w.forwardRef((e,t)=>{const n=ct("Button",j1e,e),{className:r,size:i,color:s,type:o,disabled:a,children:u,leftIcon:l,rightIcon:c,fullWidth:f,variant:d,radius:h,uppercase:p,compact:m,loading:y,loaderPosition:g,loaderProps:_,gradient:b,classNames:T,styles:I,unstyled:E}=n,S=B1e(n,["className","size","color","type","disabled","children","leftIcon","rightIcon","fullWidth","variant","radius","uppercase","compact","loading","loaderPosition","loaderProps","gradient","classNames","styles","unstyled"]),{classes:A,cx:P,theme:V}=M1e({radius:h,color:s,size:i,fullWidth:f,compact:m,gradient:b,variant:d,withLeftIcon:!!l,withRightIcon:!!c},{name:"Button",unstyled:E,classNames:T,styles:I}),M=V.fn.variant({color:s,variant:d}),H=k.createElement(Lm,iF({color:M.color,size:V.fn.size({size:i,sizes:jP}).height/2},_));return k.createElement(ck,iF({className:P(A.root,r),type:o,disabled:a,"data-button":!0,"data-disabled":a||void 0,"data-loading":y||void 0,ref:t,unstyled:E},S),k.createElement("div",{className:A.inner},(l||y&&g==="left")&&k.createElement("span",{className:P(A.icon,A.leftIcon)},y&&g==="left"?H:l),y&&g==="center"&&k.createElement("span",{className:A.centerLoader},H),k.createElement("span",{className:A.label,style:{textTransform:p?"uppercase":void 0}},u),(c||y&&g==="right")&&k.createElement("span",{className:P(A.icon,A.rightIcon)},y&&g==="right"?H:c)))});Ck.displayName="@mantine/core/Button";Ck.Group=mG;const yu=Ck;var U1e=at((e,{radius:t,shadow:n,withBorder:r})=>({root:{outline:0,WebkitTapHighlightColor:"transparent",display:"block",textDecoration:"none",color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.white,boxSizing:"border-box",borderRadius:e.fn.radius(t),boxShadow:e.shadows[n]||n||"none",border:r?`1px solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3]}`:void 0}}));const V1e=U1e;var z1e=Object.defineProperty,UE=Object.getOwnPropertySymbols,_G=Object.prototype.hasOwnProperty,vG=Object.prototype.propertyIsEnumerable,sF=(e,t,n)=>t in e?z1e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,H1e=(e,t)=>{for(var n in t||(t={}))_G.call(t,n)&&sF(e,n,t[n]);if(UE)for(var n of UE(t))vG.call(t,n)&&sF(e,n,t[n]);return e},W1e=(e,t)=>{var n={};for(var r in e)_G.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&UE)for(var r of UE(e))t.indexOf(r)<0&&vG.call(e,r)&&(n[r]=e[r]);return n};const q1e={},bG=w.forwardRef((e,t)=>{const n=ct("Paper",q1e,e),{className:r,children:i,radius:s,withBorder:o,shadow:a,unstyled:u}=n,l=W1e(n,["className","children","radius","withBorder","shadow","unstyled"]),{classes:c,cx:f}=V1e({radius:s,shadow:a,withBorder:o},{name:"Paper",unstyled:u});return k.createElement(ut,H1e({className:f(c.root,r),ref:t},l),i)});bG.displayName="@mantine/core/Paper";const _d=bG,EG=w.createContext({padding:0}),Y1e=EG.Provider,G1e=()=>w.useContext(EG).padding;var K1e=at((e,{padding:t,withBorder:n,inheritPadding:r})=>{const i=e.fn.size({size:t,sizes:e.spacing}),s=-1*i,o=e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3];return{cardSection:{display:"block",marginLeft:s,marginRight:s,paddingLeft:r?i:void 0,paddingRight:r?i:void 0,borderTop:n&&`1px solid ${o}`,borderBottom:n&&`1px solid ${o}`,"& + &":{borderTop:0},"&[data-first]":{marginTop:s,borderTop:0,borderBottom:n&&`1px solid ${o}`},"&[data-last]":{marginBottom:s,borderBottom:0}}}});const Q1e=K1e;var X1e=Object.defineProperty,VE=Object.getOwnPropertySymbols,wG=Object.prototype.hasOwnProperty,TG=Object.prototype.propertyIsEnumerable,oF=(e,t,n)=>t in e?X1e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,J1e=(e,t)=>{for(var n in t||(t={}))wG.call(t,n)&&oF(e,n,t[n]);if(VE)for(var n of VE(t))TG.call(t,n)&&oF(e,n,t[n]);return e},Z1e=(e,t)=>{var n={};for(var r in e)wG.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&VE)for(var r of VE(e))t.indexOf(r)<0&&TG.call(e,r)&&(n[r]=e[r]);return n};const SG=w.forwardRef((e,t)=>{var n=e,{className:r,withBorder:i=!1,inheritPadding:s=!1,unstyled:o}=n,a=Z1e(n,["className","withBorder","inheritPadding","unstyled"]);const{classes:u,cx:l}=Q1e({padding:G1e(),withBorder:i,inheritPadding:s},{name:"Card",unstyled:o});return k.createElement(ut,J1e({className:l(u.cardSection,r),ref:t},a))});SG.displayName="@mantine/core/CardSection";const IG=SG;var ebe=at(e=>({root:{position:"relative",overflow:"hidden",backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.white}}));const tbe=ebe;var nbe=Object.defineProperty,zE=Object.getOwnPropertySymbols,xG=Object.prototype.hasOwnProperty,CG=Object.prototype.propertyIsEnumerable,aF=(e,t,n)=>t in e?nbe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,rbe=(e,t)=>{for(var n in t||(t={}))xG.call(t,n)&&aF(e,n,t[n]);if(zE)for(var n of zE(t))CG.call(t,n)&&aF(e,n,t[n]);return e},ibe=(e,t)=>{var n={};for(var r in e)xG.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&zE)for(var r of zE(e))t.indexOf(r)<0&&CG.call(e,r)&&(n[r]=e[r]);return n};const sbe={p:"md"},Ak=w.forwardRef((e,t)=>{const n=ct("Card",sbe,e),{className:r,p:i,radius:s,children:o,unstyled:a}=n,u=ibe(n,["className","p","radius","children","unstyled"]),{classes:l,cx:c}=tbe(null,{name:"Card",unstyled:a}),f=w.Children.toArray(o),d=f.map((h,p)=>typeof h=="object"&&h&&"type"in h&&h.type===IG?w.cloneElement(h,{padding:i,"data-first":p===0||void 0,"data-last":p===f.length-1||void 0}):h);return k.createElement(Y1e,{value:{padding:i}},k.createElement(_d,rbe({className:c(l.root,r),radius:s,p:i,ref:t},u),d))});Ak.Section=IG;Ak.displayName="@mantine/core/Card";const obe=Ak;var abe=Object.defineProperty,HE=Object.getOwnPropertySymbols,AG=Object.prototype.hasOwnProperty,OG=Object.prototype.propertyIsEnumerable,uF=(e,t,n)=>t in e?abe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ube=(e,t)=>{for(var n in t||(t={}))AG.call(t,n)&&uF(e,n,t[n]);if(HE)for(var n of HE(t))OG.call(t,n)&&uF(e,n,t[n]);return e},lbe=(e,t)=>{var n={};for(var r in e)AG.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&HE)for(var r of HE(e))t.indexOf(r)<0&&OG.call(e,r)&&(n[r]=e[r]);return n};const PG=w.forwardRef((e,t)=>{const n=ct("Center",{},e),{inline:r,sx:i}=n,s=lbe(n,["inline","sx"]);return k.createElement(ut,ube({ref:t,sx:[{display:r?"inline-flex":"flex",alignItems:"center",justifyContent:"center"},...Rd(i)]},s))});PG.displayName="@mantine/core/Center";const Nd=PG,RG=w.createContext(null),cbe=RG.Provider,fbe=()=>w.useContext(RG);function dbe(e){return w.Children.toArray(e).filter(Boolean)}const hbe={left:"flex-start",center:"center",right:"flex-end",apart:"space-between"};var pbe=at((e,{spacing:t,position:n,noWrap:r,grow:i,align:s,count:o})=>({root:{boxSizing:"border-box",display:"flex",flexDirection:"row",alignItems:s||"center",flexWrap:r?"nowrap":"wrap",justifyContent:hbe[n],gap:e.fn.size({size:t,sizes:e.spacing}),"& > *":{boxSizing:"border-box",maxWidth:i?`calc(${100/o}% - ${e.fn.size({size:t,sizes:e.spacing})-e.fn.size({size:t,sizes:e.spacing})/o}px)`:void 0,flexGrow:i?1:0}}}));const mbe=pbe;var gbe=Object.defineProperty,WE=Object.getOwnPropertySymbols,NG=Object.prototype.hasOwnProperty,kG=Object.prototype.propertyIsEnumerable,lF=(e,t,n)=>t in e?gbe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ybe=(e,t)=>{for(var n in t||(t={}))NG.call(t,n)&&lF(e,n,t[n]);if(WE)for(var n of WE(t))kG.call(t,n)&&lF(e,n,t[n]);return e},_be=(e,t)=>{var n={};for(var r in e)NG.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&WE)for(var r of WE(e))t.indexOf(r)<0&&kG.call(e,r)&&(n[r]=e[r]);return n};const vbe={position:"left",spacing:"md"},zo=w.forwardRef((e,t)=>{const n=ct("Group",vbe,e),{className:r,position:i,align:s,children:o,noWrap:a,grow:u,spacing:l,unstyled:c}=n,f=_be(n,["className","position","align","children","noWrap","grow","spacing","unstyled"]),d=dbe(o),{classes:h,cx:p}=mbe({align:s,grow:u,noWrap:a,spacing:l,position:i,count:d.length},{unstyled:c,name:"Group"});return k.createElement(ut,ybe({className:p(h.root,r),ref:t},f),d)});zo.displayName="@mantine/core/Group";var bbe=at((e,{spacing:t,align:n,justify:r})=>({root:{display:"flex",flexDirection:"column",alignItems:n,justifyContent:r,gap:e.fn.size({size:t,sizes:e.spacing})}}));const Ebe=bbe;var wbe=Object.defineProperty,qE=Object.getOwnPropertySymbols,DG=Object.prototype.hasOwnProperty,$G=Object.prototype.propertyIsEnumerable,cF=(e,t,n)=>t in e?wbe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Tbe=(e,t)=>{for(var n in t||(t={}))DG.call(t,n)&&cF(e,n,t[n]);if(qE)for(var n of qE(t))$G.call(t,n)&&cF(e,n,t[n]);return e},Sbe=(e,t)=>{var n={};for(var r in e)DG.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&qE)for(var r of qE(e))t.indexOf(r)<0&&$G.call(e,r)&&(n[r]=e[r]);return n};const Ibe={spacing:"md",align:"stretch",justify:"top"},au=w.forwardRef((e,t)=>{const n=ct("Stack",Ibe,e),{spacing:r,className:i,align:s,justify:o,unstyled:a}=n,u=Sbe(n,["spacing","className","align","justify","unstyled"]),{classes:l,cx:c}=Ebe({spacing:r,align:s,justify:o},{name:"Stack",unstyled:a});return k.createElement(ut,Tbe({className:c(l.root,i),ref:t},u))});au.displayName="@mantine/core/Stack";function LG({spacing:e,offset:t,orientation:n,children:r,role:i,unstyled:s}){return n==="horizontal"?k.createElement(zo,{pt:t,spacing:e,role:i,unstyled:s},r):k.createElement(au,{pt:t,spacing:e,role:i,unstyled:s},r)}var xbe=Object.defineProperty,YE=Object.getOwnPropertySymbols,MG=Object.prototype.hasOwnProperty,FG=Object.prototype.propertyIsEnumerable,fF=(e,t,n)=>t in e?xbe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,dF=(e,t)=>{for(var n in t||(t={}))MG.call(t,n)&&fF(e,n,t[n]);if(YE)for(var n of YE(t))FG.call(t,n)&&fF(e,n,t[n]);return e},Cbe=(e,t)=>{var n={};for(var r in e)MG.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&YE)for(var r of YE(e))t.indexOf(r)<0&&FG.call(e,r)&&(n[r]=e[r]);return n};const Abe={orientation:"horizontal",spacing:"lg",size:"sm",offset:"xs"},BG=w.forwardRef((e,t)=>{const n=ct("CheckboxGroup",Abe,e),{children:r,value:i,defaultValue:s,onChange:o,orientation:a,spacing:u,size:l,wrapperProps:c,offset:f}=n,d=Cbe(n,["children","value","defaultValue","onChange","orientation","spacing","size","wrapperProps","offset"]),[h,p]=Oa({value:i,defaultValue:s,finalValue:[],onChange:o}),m=y=>{const g=y.currentTarget.value;p(h.includes(g)?h.filter(_=>_!==g):[...h,g])};return k.createElement(cbe,{value:{value:h,onChange:m,size:l}},k.createElement(Bs.Wrapper,dF(dF({labelElement:"div",size:l,__staticSelector:"CheckboxGroup",ref:t},c),d),k.createElement(LG,{spacing:u,orientation:a,offset:f},r)))});BG.displayName="@mantine/core/CheckboxGroup";var Obe=Object.defineProperty,GE=Object.getOwnPropertySymbols,jG=Object.prototype.hasOwnProperty,UG=Object.prototype.propertyIsEnumerable,hF=(e,t,n)=>t in e?Obe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,UP=(e,t)=>{for(var n in t||(t={}))jG.call(t,n)&&hF(e,n,t[n]);if(GE)for(var n of GE(t))UG.call(t,n)&&hF(e,n,t[n]);return e},Pbe=(e,t)=>{var n={};for(var r in e)jG.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&GE)for(var r of GE(e))t.indexOf(r)<0&&UG.call(e,r)&&(n[r]=e[r]);return n};function Rbe(e){return k.createElement("svg",UP({viewBox:"0 0 10 7",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),k.createElement("path",{d:"M4 4.586L1.707 2.293A1 1 0 1 0 .293 3.707l3 3a.997.997 0 0 0 1.414 0l5-5A1 1 0 1 0 8.293.293L4 4.586z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}function Nbe(e){var t=e,{indeterminate:n}=t,r=Pbe(t,["indeterminate"]);return n?k.createElement("svg",UP({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 32 6"},r),k.createElement("rect",{width:"32",height:"6",fill:"currentColor",rx:"3"})):k.createElement(Rbe,UP({},r))}var kbe=Object.defineProperty,Dbe=Object.defineProperties,$be=Object.getOwnPropertyDescriptors,pF=Object.getOwnPropertySymbols,Lbe=Object.prototype.hasOwnProperty,Mbe=Object.prototype.propertyIsEnumerable,mF=(e,t,n)=>t in e?kbe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Fbe=(e,t)=>{for(var n in t||(t={}))Lbe.call(t,n)&&mF(e,n,t[n]);if(pF)for(var n of pF(t))Mbe.call(t,n)&&mF(e,n,t[n]);return e},Bbe=(e,t)=>Dbe(e,$be(t));const jbe={xs:16,sm:20,md:24,lg:30,xl:36},Ube={xs:8,sm:10,md:14,lg:16,xl:20};var Vbe=at((e,{size:t,radius:n,color:r,transitionDuration:i,labelPosition:s,error:o,indeterminate:a},u)=>{const l=e.fn.size({size:t,sizes:jbe}),c=e.fn.variant({variant:"filled",color:r}),f=e.fn.variant({variant:"filled",color:"red"}).background;return{icon:{ref:u("icon"),color:a?"inherit":e.white,transform:a?"none":"translateY(5px) scale(0.5)",opacity:a?1:0,transitionProperty:"opacity, transform",transitionTimingFunction:"ease",transitionDuration:`${i}ms`,pointerEvents:"none",width:e.fn.size({size:t,sizes:Ube}),position:"absolute",zIndex:1,top:0,bottom:0,left:0,right:0,margin:"auto","@media (prefers-reduced-motion)":{transitionDuration:e.respectReducedMotion?"0ms":void 0}},inner:{position:"relative",width:l,height:l,order:s==="left"?2:1},input:Bbe(Fbe({},e.fn.focusStyles()),{appearance:"none",backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.white,border:`1px solid ${o?f:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]}`,width:l,height:l,borderRadius:e.fn.radius(n),padding:0,display:"block",margin:0,transition:`border-color ${i}ms ease, background-color ${i}ms ease`,cursor:e.cursorType,"&:checked":{backgroundColor:c.background,borderColor:c.background,[`& + .${u("icon")}`]:{opacity:1,color:e.white,transform:"translateY(0) scale(1)"}},"&:disabled":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2],borderColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[3],cursor:"not-allowed",[`& + .${u("icon")}`]:{color:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[5]}}})}});const zbe=Vbe;var Hbe=Object.defineProperty,Wbe=Object.defineProperties,qbe=Object.getOwnPropertyDescriptors,gF=Object.getOwnPropertySymbols,Ybe=Object.prototype.hasOwnProperty,Gbe=Object.prototype.propertyIsEnumerable,yF=(e,t,n)=>t in e?Hbe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Kbe=(e,t)=>{for(var n in t||(t={}))Ybe.call(t,n)&&yF(e,n,t[n]);if(gF)for(var n of gF(t))Gbe.call(t,n)&&yF(e,n,t[n]);return e},Qbe=(e,t)=>Wbe(e,qbe(t));const Xbe={xs:16,sm:20,md:24,lg:30,xl:36};var Jbe=at((e,{labelPosition:t,size:n})=>({root:{},body:{display:"inline-flex"},labelWrapper:Qbe(Kbe({},e.fn.fontStyles()),{display:"inline-flex",flexDirection:"column",WebkitTapHighlightColor:"transparent",fontSize:e.fn.size({size:n,sizes:e.fontSizes}),lineHeight:`${e.fn.size({size:n,sizes:Xbe})}px`,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,cursor:e.cursorType,order:t==="left"?1:2}),description:{marginTop:`calc(${e.spacing.xs}px / 2)`,[t==="left"?"paddingRight":"paddingLeft"]:e.spacing.sm},error:{marginTop:`calc(${e.spacing.xs}px / 2)`,[t==="left"?"paddingRight":"paddingLeft"]:e.spacing.sm},label:{cursor:e.cursorType,[t==="left"?"paddingRight":"paddingLeft"]:e.spacing.sm,"&[data-disabled]":{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]}}}));const Zbe=Jbe;var eEe=Object.defineProperty,KE=Object.getOwnPropertySymbols,VG=Object.prototype.hasOwnProperty,zG=Object.prototype.propertyIsEnumerable,_F=(e,t,n)=>t in e?eEe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,tEe=(e,t)=>{for(var n in t||(t={}))VG.call(t,n)&&_F(e,n,t[n]);if(KE)for(var n of KE(t))zG.call(t,n)&&_F(e,n,t[n]);return e},nEe=(e,t)=>{var n={};for(var r in e)VG.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&KE)for(var r of KE(e))t.indexOf(r)<0&&zG.call(e,r)&&(n[r]=e[r]);return n};function Ok(e){var t=e,{__staticSelector:n,className:r,classNames:i,styles:s,unstyled:o,children:a,label:u,description:l,id:c,disabled:f,error:d,size:h,labelPosition:p}=t,m=nEe(t,["__staticSelector","className","classNames","styles","unstyled","children","label","description","id","disabled","error","size","labelPosition"]);const{classes:y,cx:g}=Zbe({size:h,labelPosition:p},{name:n,styles:s,classNames:i,unstyled:o});return k.createElement(ut,tEe({className:g(y.root,r)},m),k.createElement("div",{className:g(y.body)},a,k.createElement("div",{className:y.labelWrapper},u&&k.createElement("label",{className:y.label,"data-disabled":f||void 0,htmlFor:c},u),l&&k.createElement(Bs.Description,{className:y.description},l),d&&d!=="boolean"&&k.createElement(Bs.Error,{className:y.error},d))))}Ok.displayName="@mantine/core/InlineInput";var rEe=Object.defineProperty,QE=Object.getOwnPropertySymbols,HG=Object.prototype.hasOwnProperty,WG=Object.prototype.propertyIsEnumerable,vF=(e,t,n)=>t in e?rEe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Kv=(e,t)=>{for(var n in t||(t={}))HG.call(t,n)&&vF(e,n,t[n]);if(QE)for(var n of QE(t))WG.call(t,n)&&vF(e,n,t[n]);return e},iEe=(e,t)=>{var n={};for(var r in e)HG.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&QE)for(var r of QE(e))t.indexOf(r)<0&&WG.call(e,r)&&(n[r]=e[r]);return n};const sEe={size:"sm",transitionDuration:100,icon:Nbe,labelPosition:"right"},Qp=w.forwardRef((e,t)=>{const n=ct("Checkbox",sEe,e),{className:r,style:i,sx:s,checked:o,disabled:a,color:u,label:l,indeterminate:c,id:f,size:d,radius:h,wrapperProps:p,children:m,classNames:y,styles:g,transitionDuration:_,icon:b,unstyled:T,labelPosition:I,description:E,error:S}=n,A=iEe(n,["className","style","sx","checked","disabled","color","label","indeterminate","id","size","radius","wrapperProps","children","classNames","styles","transitionDuration","icon","unstyled","labelPosition","description","error"]),P=fbe(),V=Fu(f),{systemStyles:M,rest:H}=Xd(A),{classes:J}=zbe({size:(P==null?void 0:P.size)||d,radius:h,color:u,transitionDuration:_,labelPosition:I,error:!!S,indeterminate:c},{name:"Checkbox",classNames:y,styles:g,unstyled:T}),Y=P?{checked:P.value.includes(H.value),onChange:P.onChange}:{};return k.createElement(Ok,Kv(Kv({className:r,sx:s,style:i,id:V,size:(P==null?void 0:P.size)||d,labelPosition:I,label:l,description:E,error:S,disabled:a,__staticSelector:"Checkbox",classNames:y,styles:g,unstyled:T,"data-checked":Y.checked||void 0},M),p),k.createElement("div",{className:J.inner},k.createElement("input",Kv(Kv({id:V,ref:t,type:"checkbox",className:J.input,checked:o,disabled:a},H),Y)),k.createElement(b,{indeterminate:c,className:J.icon})))});Qp.displayName="@mantine/core/Checkbox";Qp.Group=BG;var oEe=at((e,{fluid:t,size:n,sizes:r})=>({root:{paddingLeft:e.spacing.md,paddingRight:e.spacing.md,maxWidth:t?"100%":e.fn.size({size:n,sizes:r}),marginLeft:"auto",marginRight:"auto"}}));const aEe=oEe;var uEe=Object.defineProperty,XE=Object.getOwnPropertySymbols,qG=Object.prototype.hasOwnProperty,YG=Object.prototype.propertyIsEnumerable,bF=(e,t,n)=>t in e?uEe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,lEe=(e,t)=>{for(var n in t||(t={}))qG.call(t,n)&&bF(e,n,t[n]);if(XE)for(var n of XE(t))YG.call(t,n)&&bF(e,n,t[n]);return e},cEe=(e,t)=>{var n={};for(var r in e)qG.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&XE)for(var r of XE(e))t.indexOf(r)<0&&YG.call(e,r)&&(n[r]=e[r]);return n};const fEe={sizes:{xs:540,sm:720,md:960,lg:1140,xl:1320}},GG=w.forwardRef((e,t)=>{const n=ct("Container",fEe,e),{className:r,fluid:i,size:s,unstyled:o,sizes:a}=n,u=cEe(n,["className","fluid","size","unstyled","sizes"]),{classes:l,cx:c}=aEe({fluid:i,size:s,sizes:a},{unstyled:o,name:"Container"});return k.createElement(ut,lEe({className:c(l.root,r),ref:t},u))});GG.displayName="@mantine/core/Container";function KG({transitions:e,duration:t=250,exitDuration:n=t,mounted:r,children:i,timingFunction:s,onExit:o,onEntered:a,onEnter:u,onExited:l}){const{transitionDuration:c,transitionStatus:f,transitionTimingFunction:d}=BY({mounted:r,duration:t,exitDuration:n,timingFunction:s,onExit:o,onEntered:a,onEnter:u,onExited:l});if(c===0)return r?k.createElement(k.Fragment,null,i({})):null;if(f==="exited")return null;const h=Object.keys(e).reduce((p,m)=>(p[m]=FY({duration:e[m].duration,transition:e[m].transition,timingFunction:e[m].timingFunction||d,state:f}),p),{});return k.createElement(k.Fragment,null,i(h))}KG.displayName="@mantine/core/GroupedTransition";var dEe=at((e,{zIndex:t})=>({root:{position:"absolute",top:0,bottom:0,left:0,right:0,zIndex:t}}));const hEe=dEe;var pEe=Object.defineProperty,mEe=Object.defineProperties,gEe=Object.getOwnPropertyDescriptors,JE=Object.getOwnPropertySymbols,QG=Object.prototype.hasOwnProperty,XG=Object.prototype.propertyIsEnumerable,EF=(e,t,n)=>t in e?pEe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,BC=(e,t)=>{for(var n in t||(t={}))QG.call(t,n)&&EF(e,n,t[n]);if(JE)for(var n of JE(t))XG.call(t,n)&&EF(e,n,t[n]);return e},yEe=(e,t)=>mEe(e,gEe(t)),_Ee=(e,t)=>{var n={};for(var r in e)QG.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&JE)for(var r of JE(e))t.indexOf(r)<0&&XG.call(e,r)&&(n[r]=e[r]);return n};const vEe={opacity:.6,color:"#fff",zIndex:To("modal"),radius:0,blur:0},JG=w.forwardRef((e,t)=>{const n=ct("Overlay",vEe,e),{opacity:r,blur:i,color:s,gradient:o,zIndex:a,radius:u,sx:l,unstyled:c,className:f}=n,d=_Ee(n,["opacity","blur","color","gradient","zIndex","radius","sx","unstyled","className"]),{classes:h,cx:p}=hEe({zIndex:a},{name:"Overlay",unstyled:c}),m=o?{backgroundImage:o}:{backgroundColor:s},y=g=>k.createElement(ut,BC({ref:t,className:p(h.root,f),sx:[_=>yEe(BC({},m),{opacity:r,borderRadius:_.fn.size({size:u,sizes:_.radius})}),...Rd(l)]},g));return i?k.createElement(ut,BC({className:p(h.root,f),sx:[{backdropFilter:`blur(${i}px)`},...Rd(l)]},d),y()):y(d)});JG.displayName="@mantine/core/Overlay";const bEe=JG,EEe={gap:{type:"spacing",property:"gap"},rowGap:{type:"spacing",property:"rowGap"},columnGap:{type:"spacing",property:"columnGap"},align:{type:"default",property:"alignItems"},justify:{type:"default",property:"justifyContent"},wrap:{type:"default",property:"flexWrap"},direction:{type:"default",property:"flexDirection"}};var wEe=Object.defineProperty,TEe=Object.defineProperties,SEe=Object.getOwnPropertyDescriptors,ZE=Object.getOwnPropertySymbols,ZG=Object.prototype.hasOwnProperty,eK=Object.prototype.propertyIsEnumerable,wF=(e,t,n)=>t in e?wEe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,IEe=(e,t)=>{for(var n in t||(t={}))ZG.call(t,n)&&wF(e,n,t[n]);if(ZE)for(var n of ZE(t))eK.call(t,n)&&wF(e,n,t[n]);return e},xEe=(e,t)=>TEe(e,SEe(t)),CEe=(e,t)=>{var n={};for(var r in e)ZG.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ZE)for(var r of ZE(e))t.indexOf(r)<0&&eK.call(e,r)&&(n[r]=e[r]);return n};const AEe={},kd=w.forwardRef((e,t)=>{const n=ct("Flex",AEe,e),{gap:r,rowGap:i,columnGap:s,align:o,justify:a,wrap:u,direction:l,sx:c}=n,f=CEe(n,["gap","rowGap","columnGap","align","justify","wrap","direction","sx"]);return k.createElement(ut,xEe(IEe({},f),{sx:[{display:"flex"},d=>NP({gap:r,rowGap:i,columnGap:s,align:o,justify:a,wrap:u,direction:l},d,EEe),...Rd(c)],ref:t}))});kd.displayName="@mantine/core/Flex";const tK=w.createContext(null),OEe=tK.Provider,PEe=()=>w.useContext(tK);var REe=Object.defineProperty,TF=Object.getOwnPropertySymbols,NEe=Object.prototype.hasOwnProperty,kEe=Object.prototype.propertyIsEnumerable,SF=(e,t,n)=>t in e?REe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,DEe=(e,t)=>{for(var n in t||(t={}))NEe.call(t,n)&&SF(e,n,t[n]);if(TF)for(var n of TF(t))kEe.call(t,n)&&SF(e,n,t[n]);return e};const Pk=(e,t)=>e==="content"?"auto":e==="auto"?"0px":e?`${100/(t/e)}%`:void 0,nK=(e,t,n)=>n||e==="auto"||e==="content"?"unset":Pk(e,t),rK=(e,t)=>{if(e)return e==="auto"||t?1:0},iK=(e,t)=>e===0?0:e?`${100/(t/e)}%`:void 0;function $Ee({sizes:e,offsets:t,orders:n,theme:r,columns:i,grow:s}){return Hde.reduce((o,a)=>(o[`@media (min-width: ${r.breakpoints[a]}px)`]={order:n[a],flexBasis:Pk(e[a],i),flexShrink:0,width:e[a]==="content"?"auto":void 0,maxWidth:nK(e[a],i,s),marginLeft:iK(t[a],i),flexGrow:rK(e[a],s)},o),{})}var LEe=at((e,{gutter:t,grow:n,offset:r,offsetXs:i,offsetSm:s,offsetMd:o,offsetLg:a,offsetXl:u,columns:l,span:c,xs:f,sm:d,md:h,lg:p,xl:m,order:y,orderXs:g,orderSm:_,orderMd:b,orderLg:T,orderXl:I})=>({root:DEe({boxSizing:"border-box",flexGrow:rK(c,n),order:y,padding:e.fn.size({size:t,sizes:e.spacing})/2,marginLeft:iK(r,l),flexBasis:Pk(c,l),flexShrink:0,width:c==="content"?"auto":void 0,maxWidth:nK(c,l,n)},$Ee({sizes:{xs:f,sm:d,md:h,lg:p,xl:m},offsets:{xs:i,sm:s,md:o,lg:a,xl:u},orders:{xs:g,sm:_,md:b,lg:T,xl:I},theme:e,columns:l,grow:n}))}));const MEe=LEe;var FEe=Object.defineProperty,ew=Object.getOwnPropertySymbols,sK=Object.prototype.hasOwnProperty,oK=Object.prototype.propertyIsEnumerable,IF=(e,t,n)=>t in e?FEe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,BEe=(e,t)=>{for(var n in t||(t={}))sK.call(t,n)&&IF(e,n,t[n]);if(ew)for(var n of ew(t))oK.call(t,n)&&IF(e,n,t[n]);return e},jEe=(e,t)=>{var n={};for(var r in e)sK.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ew)for(var r of ew(e))t.indexOf(r)<0&&oK.call(e,r)&&(n[r]=e[r]);return n};const UEe={};function VEe(e){return e==="auto"||e==="content"?!0:typeof e=="number"&&e>0&&e%1===0}const aK=w.forwardRef((e,t)=>{const n=ct("Grid.Col",UEe,e),{children:r,span:i,offset:s,offsetXs:o,offsetSm:a,offsetMd:u,offsetLg:l,offsetXl:c,xs:f,sm:d,md:h,lg:p,xl:m,order:y,orderXs:g,orderSm:_,orderMd:b,orderLg:T,orderXl:I,className:E,id:S,unstyled:A}=n,P=jEe(n,["children","span","offset","offsetXs","offsetSm","offsetMd","offsetLg","offsetXl","xs","sm","md","lg","xl","order","orderXs","orderSm","orderMd","orderLg","orderXl","className","id","unstyled"]),V=PEe();if(!V)throw new Error("[@mantine/core] Grid.Col was used outside of Grid context");const M=i||V.columns,{classes:H,cx:J}=MEe({gutter:V.gutter,offset:s,offsetXs:o,offsetSm:a,offsetMd:u,offsetLg:l,offsetXl:c,xs:f,sm:d,md:h,lg:p,xl:m,order:y,orderXs:g,orderSm:_,orderMd:b,orderLg:T,orderXl:I,grow:V.grow,columns:V.columns,span:M},{unstyled:A,name:"Col"});return!VEe(M)||M>V.columns?null:k.createElement(ut,BEe({className:J(H.root,E),ref:t},P),r)});aK.displayName="@mantine/core/Col";var zEe=at((e,{justify:t,align:n,gutter:r})=>({root:{margin:-e.fn.size({size:r,sizes:e.spacing})/2,display:"flex",flexWrap:"wrap",justifyContent:t,alignItems:n}}));const HEe=zEe;var WEe=Object.defineProperty,tw=Object.getOwnPropertySymbols,uK=Object.prototype.hasOwnProperty,lK=Object.prototype.propertyIsEnumerable,xF=(e,t,n)=>t in e?WEe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,qEe=(e,t)=>{for(var n in t||(t={}))uK.call(t,n)&&xF(e,n,t[n]);if(tw)for(var n of tw(t))lK.call(t,n)&&xF(e,n,t[n]);return e},YEe=(e,t)=>{var n={};for(var r in e)uK.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&tw)for(var r of tw(e))t.indexOf(r)<0&&lK.call(e,r)&&(n[r]=e[r]);return n};const GEe={gutter:"md",justify:"flex-start",align:"stretch",columns:12},il=w.forwardRef((e,t)=>{const n=ct("Grid",GEe,e),{gutter:r,children:i,grow:s,justify:o,align:a,columns:u,className:l,id:c,unstyled:f}=n,d=YEe(n,["gutter","children","grow","justify","align","columns","className","id","unstyled"]),{classes:h,cx:p}=HEe({gutter:r,justify:o,align:a},{unstyled:f,name:"Grid"});return k.createElement(OEe,{value:{gutter:r,grow:s,columns:u}},k.createElement(ut,qEe({className:p(h.root,l),ref:t},d),i))});il.Col=aK;il.displayName="@mantine/core/Grid";const cK={context:"HoverCard component was not found in the tree",children:"HoverCard.Target component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported"},[KEe,fK]=XN(cK.context);var QEe=Object.defineProperty,nw=Object.getOwnPropertySymbols,dK=Object.prototype.hasOwnProperty,hK=Object.prototype.propertyIsEnumerable,CF=(e,t,n)=>t in e?QEe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,XEe=(e,t)=>{for(var n in t||(t={}))dK.call(t,n)&&CF(e,n,t[n]);if(nw)for(var n of nw(t))hK.call(t,n)&&CF(e,n,t[n]);return e},JEe=(e,t)=>{var n={};for(var r in e)dK.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&nw)for(var r of nw(e))t.indexOf(r)<0&&hK.call(e,r)&&(n[r]=e[r]);return n};function pK(e){var t=e,{children:n,onMouseEnter:r,onMouseLeave:i}=t,s=JEe(t,["children","onMouseEnter","onMouseLeave"]);const o=fK(),a=oo(r,o.openDropdown),u=oo(i,o.closeDropdown);return k.createElement(Xo.Dropdown,XEe({onMouseEnter:a,onMouseLeave:u},s),n)}pK.displayName="@mantine/core/HoverCardDropdown";var ZEe=Object.defineProperty,rw=Object.getOwnPropertySymbols,mK=Object.prototype.hasOwnProperty,gK=Object.prototype.propertyIsEnumerable,AF=(e,t,n)=>t in e?ZEe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ewe=(e,t)=>{for(var n in t||(t={}))mK.call(t,n)&&AF(e,n,t[n]);if(rw)for(var n of rw(t))gK.call(t,n)&&AF(e,n,t[n]);return e},twe=(e,t)=>{var n={};for(var r in e)mK.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&rw)for(var r of rw(e))t.indexOf(r)<0&&gK.call(e,r)&&(n[r]=e[r]);return n};const yK=w.forwardRef((e,t)=>{var n=e,{children:r,refProp:i}=n,s=twe(n,["children","refProp"]);if(!Dm(r))throw new Error(cK.children);const o=fK(),a=oo(r.props.onMouseEnter,o.openDropdown),u=oo(r.props.onMouseLeave,o.closeDropdown);return k.createElement(Xo.Target,ewe({refProp:i,ref:t},s),w.cloneElement(r,{onMouseEnter:a,onMouseLeave:u}))});yK.displayName="@mantine/core/HoverCardTarget";function _K({open:e,close:t,openDelay:n,closeDelay:r}){const i=w.useRef(-1),s=w.useRef(-1),o=()=>{window.clearTimeout(i.current),window.clearTimeout(s.current)},a=()=>{o(),n===0?e():i.current=window.setTimeout(e,n)},u=()=>{o(),r===0?t():s.current=window.setTimeout(t,r)};return w.useEffect(()=>o,[]),{openDropdown:a,closeDropdown:u}}var nwe=Object.defineProperty,iw=Object.getOwnPropertySymbols,vK=Object.prototype.hasOwnProperty,bK=Object.prototype.propertyIsEnumerable,OF=(e,t,n)=>t in e?nwe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,rwe=(e,t)=>{for(var n in t||(t={}))vK.call(t,n)&&OF(e,n,t[n]);if(iw)for(var n of iw(t))bK.call(t,n)&&OF(e,n,t[n]);return e},iwe=(e,t)=>{var n={};for(var r in e)vK.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&iw)for(var r of iw(e))t.indexOf(r)<0&&bK.call(e,r)&&(n[r]=e[r]);return n};const swe={openDelay:0,closeDelay:150,initiallyOpened:!1};function gp(e){const t=ct("HoverCard",swe,e),{children:n,onOpen:r,onClose:i,openDelay:s,closeDelay:o,initiallyOpened:a}=t,u=iwe(t,["children","onOpen","onClose","openDelay","closeDelay","initiallyOpened"]),[l,{open:c,close:f}]=XW(a,{onClose:i,onOpen:r}),{openDropdown:d,closeDropdown:h}=_K({open:c,close:f,openDelay:s,closeDelay:o});return k.createElement(KEe,{value:{openDropdown:d,closeDropdown:h}},k.createElement(Xo,rwe({opened:l,__staticSelector:"HoverCard"},u),n))}gp.displayName="@mantine/core/HoverCard";gp.Target=yK;gp.Dropdown=pK;var owe=Object.defineProperty,PF=Object.getOwnPropertySymbols,awe=Object.prototype.hasOwnProperty,uwe=Object.prototype.propertyIsEnumerable,RF=(e,t,n)=>t in e?owe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,lwe=(e,t)=>{for(var n in t||(t={}))awe.call(t,n)&&RF(e,n,t[n]);if(PF)for(var n of PF(t))uwe.call(t,n)&&RF(e,n,t[n]);return e};function cwe(e){return k.createElement("svg",lwe({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),k.createElement("path",{d:"M2.5 1H12.5C13.3284 1 14 1.67157 14 2.5V12.5C14 13.3284 13.3284 14 12.5 14H2.5C1.67157 14 1 13.3284 1 12.5V2.5C1 1.67157 1.67157 1 2.5 1ZM2.5 2C2.22386 2 2 2.22386 2 2.5V8.3636L3.6818 6.6818C3.76809 6.59551 3.88572 6.54797 4.00774 6.55007C4.12975 6.55216 4.24568 6.60372 4.32895 6.69293L7.87355 10.4901L10.6818 7.6818C10.8575 7.50607 11.1425 7.50607 11.3182 7.6818L13 9.3636V2.5C13 2.22386 12.7761 2 12.5 2H2.5ZM2 12.5V9.6364L3.98887 7.64753L7.5311 11.4421L8.94113 13H2.5C2.22386 13 2 12.7761 2 12.5ZM12.5 13H10.155L8.48336 11.153L11 8.6364L13 10.6364V12.5C13 12.7761 12.7761 13 12.5 13ZM6.64922 5.5C6.64922 5.03013 7.03013 4.64922 7.5 4.64922C7.96987 4.64922 8.35078 5.03013 8.35078 5.5C8.35078 5.96987 7.96987 6.35078 7.5 6.35078C7.03013 6.35078 6.64922 5.96987 6.64922 5.5ZM7.5 3.74922C6.53307 3.74922 5.74922 4.53307 5.74922 5.5C5.74922 6.46693 6.53307 7.25078 7.5 7.25078C8.46693 7.25078 9.25078 6.46693 9.25078 5.5C9.25078 4.53307 8.46693 3.74922 7.5 3.74922Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}var fwe=Object.defineProperty,dwe=Object.defineProperties,hwe=Object.getOwnPropertyDescriptors,NF=Object.getOwnPropertySymbols,pwe=Object.prototype.hasOwnProperty,mwe=Object.prototype.propertyIsEnumerable,kF=(e,t,n)=>t in e?fwe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,DF=(e,t)=>{for(var n in t||(t={}))pwe.call(t,n)&&kF(e,n,t[n]);if(NF)for(var n of NF(t))mwe.call(t,n)&&kF(e,n,t[n]);return e},$F=(e,t)=>dwe(e,hwe(t)),gwe=at((e,{radius:t})=>({root:{},imageWrapper:{position:"relative"},figure:{margin:0},image:$F(DF({},e.fn.fontStyles()),{display:"block",width:"100%",height:"100%",border:0,borderRadius:e.fn.size({size:t,sizes:e.radius})}),caption:{color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[7],marginTop:e.spacing.xs},placeholder:$F(DF({},e.fn.cover()),{display:"flex",alignItems:"center",justifyContent:"center",color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6],backgroundColor:e.colorScheme==="dark"?e.colors.dark[8]:e.colors.gray[0],borderRadius:e.fn.size({size:t,sizes:e.radius})})}));const ywe=gwe;var _we=Object.defineProperty,sw=Object.getOwnPropertySymbols,EK=Object.prototype.hasOwnProperty,wK=Object.prototype.propertyIsEnumerable,LF=(e,t,n)=>t in e?_we(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,jC=(e,t)=>{for(var n in t||(t={}))EK.call(t,n)&&LF(e,n,t[n]);if(sw)for(var n of sw(t))wK.call(t,n)&&LF(e,n,t[n]);return e},vwe=(e,t)=>{var n={};for(var r in e)EK.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&sw)for(var r of sw(e))t.indexOf(r)<0&&wK.call(e,r)&&(n[r]=e[r]);return n};const bwe={fit:"cover",width:"100%",height:"auto",radius:0},A_=w.forwardRef((e,t)=>{const n=ct("Image",bwe,e),{className:r,alt:i,src:s,fit:o,width:a,height:u,radius:l,imageProps:c,withPlaceholder:f,placeholder:d,imageRef:h,classNames:p,styles:m,caption:y,unstyled:g,style:_}=n,b=vwe(n,["className","alt","src","fit","width","height","radius","imageProps","withPlaceholder","placeholder","imageRef","classNames","styles","caption","unstyled","style"]),{classes:T,cx:I}=ywe({radius:l},{classNames:p,styles:m,unstyled:g,name:"Image"}),[E,S]=w.useState(!s),A=f&&E;return fo(()=>{S(!1)},[s]),k.createElement(ut,jC({className:I(T.root,r),ref:t,style:jC({width:a},_)},b),k.createElement("figure",{className:T.figure},k.createElement("div",{className:T.imageWrapper},k.createElement("img",jC({className:T.image,src:s,alt:i,style:{objectFit:o,width:a,height:u},ref:h,onError:P=>{S(!0),typeof(c==null?void 0:c.onError)=="function"&&c.onError(P)}},c)),A&&k.createElement("div",{className:T.placeholder,title:i},d||k.createElement("div",null,k.createElement(cwe,{style:{width:40,height:40}})))),!!y&&k.createElement(Tt,{component:"figcaption",size:"sm",align:"center",className:T.caption},y)))});A_.displayName="@mantine/core/Image";function Ewe(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,s;for(s=0;s=0)&&(n[i]=e[i]);return n}var wwe=w.useLayoutEffect,Twe=function(t){var n=w.useRef(t);return wwe(function(){n.current=t}),n},MF=function(t,n){if(typeof t=="function"){t(n);return}t.current=n},Swe=function(t,n){var r=w.useRef();return w.useCallback(function(i){t.current=i,r.current&&MF(r.current,null),r.current=n,n&&MF(n,i)},[n])},FF={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},BF=function(t){Object.keys(FF).forEach(function(n){t.style.setProperty(n,FF[n],"important")})},Ks=null,Iwe=function(t,n){var r=t.scrollHeight;return n.sizingStyle.boxSizing==="border-box"?r+n.borderSize:r-n.paddingSize};function xwe(e,t,n,r){n===void 0&&(n=1),r===void 0&&(r=1/0),Ks||(Ks=document.createElement("textarea"),Ks.setAttribute("tabindex","-1"),Ks.setAttribute("aria-hidden","true"),BF(Ks)),Ks.parentNode===null&&document.body.appendChild(Ks);var i=e.paddingSize,s=e.borderSize,o=e.sizingStyle,a=o.boxSizing;Object.keys(o).forEach(function(d){var h=d;Ks.style[h]=o[h]}),BF(Ks),Ks.value=t;var u=Iwe(Ks,e);Ks.value="x";var l=Ks.scrollHeight-i,c=l*n;a==="border-box"&&(c=c+i+s),u=Math.max(c,u);var f=l*r;return a==="border-box"&&(f=f+i+s),u=Math.min(f,u),[u,l]}var jF=function(){},Cwe=function(t,n){return t.reduce(function(r,i){return r[i]=n[i],r},{})},Awe=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak"],Owe=!!document.documentElement.currentStyle,Pwe=function(t){var n=window.getComputedStyle(t);if(n===null)return null;var r=Cwe(Awe,n),i=r.boxSizing;if(i==="")return null;Owe&&i==="border-box"&&(r.width=parseFloat(r.width)+parseFloat(r.borderRightWidth)+parseFloat(r.borderLeftWidth)+parseFloat(r.paddingRight)+parseFloat(r.paddingLeft)+"px");var s=parseFloat(r.paddingBottom)+parseFloat(r.paddingTop),o=parseFloat(r.borderBottomWidth)+parseFloat(r.borderTopWidth);return{sizingStyle:r,paddingSize:s,borderSize:o}},Rwe=function(t){var n=Twe(t);w.useLayoutEffect(function(){var r=function(s){n.current(s)};return window.addEventListener("resize",r),function(){window.removeEventListener("resize",r)}},[])},Nwe=function(t,n){var r=t.cacheMeasurements,i=t.maxRows,s=t.minRows,o=t.onChange,a=o===void 0?jF:o,u=t.onHeightChange,l=u===void 0?jF:u,c=Ewe(t,["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"]),f=c.value!==void 0,d=w.useRef(null),h=Swe(d,n),p=w.useRef(0),m=w.useRef(),y=function(){var b=d.current,T=r&&m.current?m.current:Pwe(b);if(T){m.current=T;var I=xwe(T,b.value||b.placeholder||"x",s,i),E=I[0],S=I[1];p.current!==E&&(p.current=E,b.style.setProperty("height",E+"px","important"),l(E,{rowHeight:S}))}},g=function(b){f||y(),a(b)};return w.useLayoutEffect(y),Rwe(y),w.createElement("textarea",cr({},c,{onChange:g,ref:h}))},kwe=w.forwardRef(Nwe);const Dwe=kwe;var $we=at(e=>({input:{paddingTop:e.spacing.xs,paddingBottom:e.spacing.xs}}));const Lwe=$we;var Mwe=Object.defineProperty,Fwe=Object.defineProperties,Bwe=Object.getOwnPropertyDescriptors,ow=Object.getOwnPropertySymbols,TK=Object.prototype.hasOwnProperty,SK=Object.prototype.propertyIsEnumerable,UF=(e,t,n)=>t in e?Mwe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_h=(e,t)=>{for(var n in t||(t={}))TK.call(t,n)&&UF(e,n,t[n]);if(ow)for(var n of ow(t))SK.call(t,n)&&UF(e,n,t[n]);return e},UC=(e,t)=>Fwe(e,Bwe(t)),jwe=(e,t)=>{var n={};for(var r in e)TK.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ow)for(var r of ow(e))t.indexOf(r)<0&&SK.call(e,r)&&(n[r]=e[r]);return n};const Uwe={autosize:!1,size:"sm",__staticSelector:"Textarea"},IK=w.forwardRef((e,t)=>{const n=ct("Textarea",Uwe,e),{autosize:r,maxRows:i,minRows:s,label:o,error:a,description:u,id:l,className:c,required:f,style:d,wrapperProps:h,classNames:p,styles:m,size:y,__staticSelector:g,sx:_,errorProps:b,descriptionProps:T,labelProps:I,inputWrapperOrder:E,inputContainer:S,unstyled:A,withAsterisk:P}=n,V=jwe(n,["autosize","maxRows","minRows","label","error","description","id","className","required","style","wrapperProps","classNames","styles","size","__staticSelector","sx","errorProps","descriptionProps","labelProps","inputWrapperOrder","inputContainer","unstyled","withAsterisk"]),M=Fu(l),{classes:H,cx:J}=Lwe(),{systemStyles:Y,rest:ye}=Xd(V),he=_h({required:f,ref:t,invalid:!!a,id:M,classNames:UC(_h({},p),{input:J(H.input,p==null?void 0:p.input)}),styles:m,__staticSelector:g,size:y,multiline:!0,unstyled:A},ye);return k.createElement(Bs.Wrapper,_h(_h({label:o,error:a,id:M,description:u,required:f,style:d,className:c,classNames:p,styles:m,size:y,__staticSelector:g,sx:_,errorProps:b,labelProps:I,descriptionProps:T,inputContainer:S,inputWrapperOrder:E,unstyled:A,withAsterisk:P},Y),h),r?k.createElement(Bs,UC(_h({},he),{component:Dwe,maxRows:i,minRows:s})):k.createElement(Bs,UC(_h({},he),{component:"textarea",rows:s})))});IK.displayName="@mantine/core/Textarea";const xK=w.createContext(null);function Vwe(){return w.useContext(xK)||{}}var zwe=at((e,{spacing:t,center:n},r)=>({itemWrapper:{ref:r("itemWrapper"),display:"inline-flex",flexDirection:"column",whiteSpace:"normal"},item:{whiteSpace:"nowrap",lineHeight:n?1:e.lineHeight,"&:not(:first-of-type)":{marginTop:e.fn.size({size:t,sizes:e.spacing})}},withIcon:{listStyle:"none",[`& .${r("itemWrapper")}`]:{display:"inline-flex",alignItems:n?"center":"flex-start",flexDirection:"row"}},itemIcon:{display:"inline-block",verticalAlign:"middle",marginRight:e.spacing.sm}}));const Hwe=zwe;var Wwe=Object.defineProperty,aw=Object.getOwnPropertySymbols,CK=Object.prototype.hasOwnProperty,AK=Object.prototype.propertyIsEnumerable,VF=(e,t,n)=>t in e?Wwe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,qwe=(e,t)=>{for(var n in t||(t={}))CK.call(t,n)&&VF(e,n,t[n]);if(aw)for(var n of aw(t))AK.call(t,n)&&VF(e,n,t[n]);return e},Ywe=(e,t)=>{var n={};for(var r in e)CK.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&aw)for(var r of aw(e))t.indexOf(r)<0&&AK.call(e,r)&&(n[r]=e[r]);return n};function OK(e){var t=e,{className:n,children:r,icon:i}=t,s=Ywe(t,["className","children","icon"]);const{icon:o,spacing:a,center:u,listStyleType:l,size:c,withPadding:f}=Vwe(),{classNames:d,styles:h,unstyled:p}=T_(),m=i||o,{classes:y,cx:g}=Hwe({withPadding:f,size:c,listStyleType:l,center:u,spacing:a},{classNames:d,styles:h,unstyled:p,name:"List"});return k.createElement(ut,qwe({component:"li",className:g(y.item,{[y.withIcon]:m},n)},s),k.createElement("div",{className:y.itemWrapper},m&&k.createElement("span",{className:y.itemIcon},m),k.createElement("span",null,r)))}OK.displayName="@mantine/core/ListItem";var Gwe=Object.defineProperty,Kwe=Object.defineProperties,Qwe=Object.getOwnPropertyDescriptors,zF=Object.getOwnPropertySymbols,Xwe=Object.prototype.hasOwnProperty,Jwe=Object.prototype.propertyIsEnumerable,HF=(e,t,n)=>t in e?Gwe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Zwe=(e,t)=>{for(var n in t||(t={}))Xwe.call(t,n)&&HF(e,n,t[n]);if(zF)for(var n of zF(t))Jwe.call(t,n)&&HF(e,n,t[n]);return e},eTe=(e,t)=>Kwe(e,Qwe(t)),tTe=at((e,{withPadding:t,size:n,listStyleType:r})=>({root:eTe(Zwe({},e.fn.fontStyles()),{listStyleType:r,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,fontSize:e.fn.size({size:n,sizes:e.fontSizes}),lineHeight:e.lineHeight,margin:0,paddingLeft:t?e.spacing.xl:0,listStylePosition:"inside"})}));const nTe=tTe;var rTe=Object.defineProperty,uw=Object.getOwnPropertySymbols,PK=Object.prototype.hasOwnProperty,RK=Object.prototype.propertyIsEnumerable,WF=(e,t,n)=>t in e?rTe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,iTe=(e,t)=>{for(var n in t||(t={}))PK.call(t,n)&&WF(e,n,t[n]);if(uw)for(var n of uw(t))RK.call(t,n)&&WF(e,n,t[n]);return e},sTe=(e,t)=>{var n={};for(var r in e)PK.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&uw)for(var r of uw(e))t.indexOf(r)<0&&RK.call(e,r)&&(n[r]=e[r]);return n};const oTe={type:"unordered",size:"md",spacing:0},Xp=w.forwardRef((e,t)=>{const n=ct("List",oTe,e),{children:r,type:i,size:s,listStyleType:o,withPadding:a,center:u,spacing:l,icon:c,className:f,styles:d,classNames:h,unstyled:p}=n,m=sTe(n,["children","type","size","listStyleType","withPadding","center","spacing","icon","className","styles","classNames","unstyled"]),{classes:y,cx:g}=nTe({withPadding:a,size:s,listStyleType:o,center:u,spacing:l},{classNames:h,styles:d,name:"List",unstyled:p});return k.createElement(BW,{classNames:h,styles:d,unstyled:p},k.createElement(xK.Provider,{value:{spacing:l,center:u,icon:c,listStyleType:o,size:s,withPadding:a}},k.createElement(ut,iTe({component:i==="unordered"?"ul":"ol",className:g(y.root,f),ref:t},m),r)))});Xp.Item=OK;Xp.displayName="@mantine/core/List";var aTe=at(e=>({divider:{margin:`calc(${e.spacing.xs}px / 2) -5px`,borderTop:`1px solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2]}`}}));const uTe=aTe;var lTe=Object.defineProperty,lw=Object.getOwnPropertySymbols,NK=Object.prototype.hasOwnProperty,kK=Object.prototype.propertyIsEnumerable,qF=(e,t,n)=>t in e?lTe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,cTe=(e,t)=>{for(var n in t||(t={}))NK.call(t,n)&&qF(e,n,t[n]);if(lw)for(var n of lw(t))kK.call(t,n)&&qF(e,n,t[n]);return e},fTe=(e,t)=>{var n={};for(var r in e)NK.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&lw)for(var r of lw(e))t.indexOf(r)<0&&kK.call(e,r)&&(n[r]=e[r]);return n};function DK(e){var t=e,{children:n,className:r}=t,i=fTe(t,["children","className"]);const{classNames:s,styles:o,unstyled:a}=T_(),{classes:u,cx:l}=uTe(null,{name:"Menu",classNames:s,styles:o,unstyled:a});return k.createElement(ut,cTe({className:l(u.divider,r)},i))}DK.displayName="@mantine/core/MenuDivider";const $K={context:"Menu component was not found in the tree",children:"Menu.Target component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported"},[dTe,Rk]=XN($K.context);var hTe=Object.defineProperty,cw=Object.getOwnPropertySymbols,LK=Object.prototype.hasOwnProperty,MK=Object.prototype.propertyIsEnumerable,YF=(e,t,n)=>t in e?hTe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,pTe=(e,t)=>{for(var n in t||(t={}))LK.call(t,n)&&YF(e,n,t[n]);if(cw)for(var n of cw(t))MK.call(t,n)&&YF(e,n,t[n]);return e},mTe=(e,t)=>{var n={};for(var r in e)LK.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&cw)for(var r of cw(e))t.indexOf(r)<0&&MK.call(e,r)&&(n[r]=e[r]);return n};function FK(e){var t=e,{children:n,onMouseEnter:r,onMouseLeave:i}=t,s=mTe(t,["children","onMouseEnter","onMouseLeave"]);const o=w.useRef(),a=Rk(),u=f=>{(f.key==="ArrowUp"||f.key==="ArrowDown")&&(f.preventDefault(),o.current.querySelectorAll("[data-menu-item]")[0].focus())},l=oo(r,()=>a.trigger==="hover"&&a.openDropdown()),c=oo(i,()=>a.trigger==="hover"&&a.closeDropdown());return k.createElement(Xo.Dropdown,pTe({onMouseEnter:l,onMouseLeave:c,role:"menu","aria-orientation":"vertical"},s),k.createElement("div",{tabIndex:-1,"data-menu-dropdown":!0,"data-autofocus":!0,onKeyDown:u,ref:o,style:{outline:0}},n))}FK.displayName="@mantine/core/MenuDropdown";var gTe=Object.defineProperty,yTe=Object.defineProperties,_Te=Object.getOwnPropertyDescriptors,GF=Object.getOwnPropertySymbols,vTe=Object.prototype.hasOwnProperty,bTe=Object.prototype.propertyIsEnumerable,KF=(e,t,n)=>t in e?gTe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ETe=(e,t)=>{for(var n in t||(t={}))vTe.call(t,n)&&KF(e,n,t[n]);if(GF)for(var n of GF(t))bTe.call(t,n)&&KF(e,n,t[n]);return e},wTe=(e,t)=>yTe(e,_Te(t)),TTe=at((e,{color:t,radius:n})=>({item:wTe(ETe({},e.fn.fontStyles()),{WebkitTapHighlightColor:"transparent",fontSize:e.fontSizes.sm,border:0,backgroundColor:"transparent",outline:0,width:"100%",textAlign:"left",textDecoration:"none",boxSizing:"border-box",padding:`${e.spacing.xs}px ${e.spacing.sm}px`,cursor:"pointer",borderRadius:e.fn.radius(n),color:t?e.fn.variant({variant:"filled",primaryFallback:!1,color:t}).background:e.colorScheme==="dark"?e.colors.dark[0]:e.black,display:"flex",alignItems:"center","&:disabled":{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5],pointerEvents:"none",userSelect:"none"},"&[data-hovered]":{backgroundColor:t?e.fn.variant({variant:"light",color:t}).background:e.colorScheme==="dark"?e.fn.rgba(e.colors.dark[3],.35):e.colors.gray[0]}}),itemLabel:{flex:1},itemIcon:{display:"flex",justifyContent:"center",alignItems:"center",marginRight:e.spacing.xs},itemRightSection:{}}));const STe=TTe;var ITe=Object.defineProperty,xTe=Object.defineProperties,CTe=Object.getOwnPropertyDescriptors,fw=Object.getOwnPropertySymbols,BK=Object.prototype.hasOwnProperty,jK=Object.prototype.propertyIsEnumerable,QF=(e,t,n)=>t in e?ITe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ATe=(e,t)=>{for(var n in t||(t={}))BK.call(t,n)&&QF(e,n,t[n]);if(fw)for(var n of fw(t))jK.call(t,n)&&QF(e,n,t[n]);return e},OTe=(e,t)=>xTe(e,CTe(t)),PTe=(e,t)=>{var n={};for(var r in e)BK.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&fw)for(var r of fw(e))t.indexOf(r)<0&&jK.call(e,r)&&(n[r]=e[r]);return n};const UK=w.forwardRef((e,t)=>{var n=e,{children:r,className:i,color:s,closeMenuOnClick:o,icon:a,rightSection:u}=n,l=PTe(n,["children","className","color","closeMenuOnClick","icon","rightSection"]);const c=Rk(),{classNames:f,styles:d,unstyled:h}=T_(),{classes:p,cx:m,theme:y}=STe({radius:c.radius,color:s},{name:"Menu",classNames:f,styles:d,unstyled:h}),g=w.useRef(),_=c.getItemIndex(g.current),b=l,T=oo(b.onMouseLeave,()=>c.setHovered(-1)),I=oo(b.onMouseEnter,()=>c.setHovered(c.getItemIndex(g.current))),E=oo(b.onClick,()=>{typeof o=="boolean"?o&&c.closeDropdownImmediately():c.closeOnItemClick&&c.closeDropdownImmediately()}),S=oo(b.onFocus,()=>c.setHovered(c.getItemIndex(g.current)));return k.createElement(ut,OTe(ATe({component:"button",type:"button"},l),{tabIndex:-1,onFocus:S,className:m(p.item,i),ref:Ko(g,t),role:"menuitem","data-menu-item":!0,"data-hovered":c.hovered===_?!0:void 0,onMouseEnter:I,onMouseLeave:T,onClick:E,onKeyDown:lde({siblingSelector:"[data-menu-item]",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:c.loop,dir:y.dir,orientation:"vertical",onKeyDown:b.onKeydown})}),a&&k.createElement("div",{className:p.itemIcon},a),r&&k.createElement("div",{className:p.itemLabel},r),u&&k.createElement("div",{className:p.itemRightSection},u))});UK.displayName="@mantine/core/MenuItem";const RTe=UK;var NTe=at(e=>({label:{color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6],fontWeight:500,fontSize:e.fontSizes.xs,padding:`calc(${e.spacing.xs}px / 2) ${e.spacing.sm}px`,cursor:"default"}}));const kTe=NTe;var DTe=Object.defineProperty,dw=Object.getOwnPropertySymbols,VK=Object.prototype.hasOwnProperty,zK=Object.prototype.propertyIsEnumerable,XF=(e,t,n)=>t in e?DTe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$Te=(e,t)=>{for(var n in t||(t={}))VK.call(t,n)&&XF(e,n,t[n]);if(dw)for(var n of dw(t))zK.call(t,n)&&XF(e,n,t[n]);return e},LTe=(e,t)=>{var n={};for(var r in e)VK.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&dw)for(var r of dw(e))t.indexOf(r)<0&&zK.call(e,r)&&(n[r]=e[r]);return n};function HK(e){var t=e,{children:n,className:r}=t,i=LTe(t,["children","className"]);const{classNames:s,styles:o,unstyled:a}=T_(),{classes:u,cx:l}=kTe(null,{name:"Menu",classNames:s,styles:o,unstyled:a});return k.createElement(Tt,$Te({className:l(u.label,r)},i),n)}HK.displayName="@mantine/core/MenuLabel";var MTe=Object.defineProperty,hw=Object.getOwnPropertySymbols,WK=Object.prototype.hasOwnProperty,qK=Object.prototype.propertyIsEnumerable,JF=(e,t,n)=>t in e?MTe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,FTe=(e,t)=>{for(var n in t||(t={}))WK.call(t,n)&&JF(e,n,t[n]);if(hw)for(var n of hw(t))qK.call(t,n)&&JF(e,n,t[n]);return e},BTe=(e,t)=>{var n={};for(var r in e)WK.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&hw)for(var r of hw(e))t.indexOf(r)<0&&qK.call(e,r)&&(n[r]=e[r]);return n};const YK=w.forwardRef((e,t)=>{var n=e,{children:r,refProp:i="ref"}=n,s=BTe(n,["children","refProp"]);if(!Dm(r))throw new Error($K.children);const o=Rk(),a=oo(r.props.onClick,()=>o.trigger==="click"&&o.toggleDropdown()),u=oo(r.props.onMouseEnter,()=>o.trigger==="hover"&&o.openDropdown()),l=oo(r.props.onMouseLeave,()=>o.trigger==="hover"&&o.closeDropdown());return k.createElement(Xo.Target,FTe({refProp:i,popupType:"menu",ref:t},s),w.cloneElement(r,{onClick:a,onMouseEnter:u,onMouseLeave:l,"data-expanded":o.opened?!0:void 0}))});YK.displayName="@mantine/core/MenuTarget";var jTe=at({dropdown:{padding:4}});const UTe=jTe;var VTe=Object.defineProperty,zTe=Object.defineProperties,HTe=Object.getOwnPropertyDescriptors,pw=Object.getOwnPropertySymbols,GK=Object.prototype.hasOwnProperty,KK=Object.prototype.propertyIsEnumerable,ZF=(e,t,n)=>t in e?VTe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,e8=(e,t)=>{for(var n in t||(t={}))GK.call(t,n)&&ZF(e,n,t[n]);if(pw)for(var n of pw(t))KK.call(t,n)&&ZF(e,n,t[n]);return e},t8=(e,t)=>zTe(e,HTe(t)),WTe=(e,t)=>{var n={};for(var r in e)GK.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&pw)for(var r of pw(e))t.indexOf(r)<0&&KK.call(e,r)&&(n[r]=e[r]);return n};const qTe={closeOnItemClick:!0,loop:!0,trigger:"click",openDelay:0,closeDelay:100};function ko(e){const t=ct("Menu",qTe,e),{children:n,onOpen:r,onClose:i,opened:s,defaultOpened:o,onChange:a,closeOnItemClick:u,loop:l,closeOnEscape:c,trigger:f,openDelay:d,closeDelay:h,classNames:p,styles:m,unstyled:y,radius:g}=t,_=WTe(t,["children","onOpen","onClose","opened","defaultOpened","onChange","closeOnItemClick","loop","closeOnEscape","trigger","openDelay","closeDelay","classNames","styles","unstyled","radius"]),{classes:b,cx:T}=UTe(),[I,{setHovered:E,resetHovered:S}]=pde(),[A,P]=Oa({value:s,defaultValue:o,finalValue:!1,onChange:a}),V=()=>{P(!1),A&&(i==null||i())},M=()=>{P(!0),!A&&(r==null||r())},H=()=>A?V():M(),{openDropdown:J,closeDropdown:Y}=_K({open:M,close:V,closeDelay:h,openDelay:d}),ye=he=>cde("[data-menu-item]","[data-menu-dropdown]",he);return fo(()=>{S()},[A]),k.createElement(dTe,{value:{opened:A,toggleDropdown:H,getItemIndex:ye,hovered:I,setHovered:E,closeOnItemClick:u,closeDropdown:f==="click"?V:Y,openDropdown:f==="click"?M:J,closeDropdownImmediately:V,loop:l,trigger:f,radius:g}},k.createElement(Xo,t8(e8({},_),{radius:g,opened:A,onChange:P,defaultOpened:o,trapFocus:f==="click",closeOnEscape:c&&f==="click",__staticSelector:"Menu",classNames:t8(e8({},p),{dropdown:T(b.dropdown,p==null?void 0:p.dropdown)}),styles:m,unstyled:y,onClose:V,onOpen:M}),n))}ko.displayName="@mantine/core/Menu";ko.Item=RTe;ko.Label=HK;ko.Dropdown=FK;ko.Target=YK;ko.Divider=DK;var YTe=Object.defineProperty,n8=Object.getOwnPropertySymbols,GTe=Object.prototype.hasOwnProperty,KTe=Object.prototype.propertyIsEnumerable,r8=(e,t,n)=>t in e?YTe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,QTe=(e,t)=>{for(var n in t||(t={}))GTe.call(t,n)&&r8(e,n,t[n]);if(n8)for(var n of n8(t))KTe.call(t,n)&&r8(e,n,t[n]);return e};const XTe={xs:320,sm:380,md:440,lg:620,xl:780};function JTe(e){return e?{position:"absolute",top:0,left:0,right:0,bottom:0,maxHeight:"100vh",overflowY:"auto"}:{}}var ZTe=at((e,{overflow:t,size:n,centered:r,zIndex:i,fullScreen:s})=>({close:{},overlay:{display:s?"none":void 0},root:{position:"fixed",zIndex:i,top:0,left:0,right:0,bottom:0},inner:{position:"absolute",top:0,left:0,right:0,bottom:0,overflowY:"auto",padding:s?0:`${e.spacing.xl*2}px ${e.spacing.md}px`,display:"flex",justifyContent:"center",alignItems:r?"center":"flex-start"},title:{marginRight:e.spacing.md,textOverflow:"ellipsis",display:"block",wordBreak:"break-word"},modal:QTe({position:"relative",width:s?"100vw":e.fn.size({sizes:XTe,size:n}),borderRadius:s?0:void 0,outline:0,backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.white,marginTop:r?"auto":void 0,marginBottom:r?"auto":void 0,zIndex:1},JTe(s)),header:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:e.spacing.md,marginRight:-9},body:{maxHeight:t==="inside"?"calc(100vh - 185px)":null,overflowY:t==="inside"?"auto":null,wordBreak:"break-word"}}));const eSe=ZTe;var tSe=Object.defineProperty,mw=Object.getOwnPropertySymbols,QK=Object.prototype.hasOwnProperty,XK=Object.prototype.propertyIsEnumerable,i8=(e,t,n)=>t in e?tSe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,nSe=(e,t)=>{for(var n in t||(t={}))QK.call(t,n)&&i8(e,n,t[n]);if(mw)for(var n of mw(t))XK.call(t,n)&&i8(e,n,t[n]);return e},rSe=(e,t)=>{var n={};for(var r in e)QK.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&mw)for(var r of mw(e))t.indexOf(r)<0&&XK.call(e,r)&&(n[r]=e[r]);return n};const iSe={size:"md",transitionDuration:250,overflow:"outside",padding:"lg",shadow:"lg",closeOnClickOutside:!0,closeOnEscape:!0,trapFocus:!0,withCloseButton:!0,withinPortal:!0,lockScroll:!0,withFocusReturn:!0,overlayBlur:0,zIndex:To("modal"),exitTransitionDuration:0};function JS(e){const t=ct("Modal",iSe,e),{className:n,opened:r,title:i,onClose:s,children:o,withCloseButton:a,overlayOpacity:u,size:l,transitionDuration:c,exitTransitionDuration:f,closeButtonLabel:d,overlayColor:h,overflow:p,transition:m,padding:y,shadow:g,radius:_,id:b,classNames:T,styles:I,closeOnClickOutside:E,trapFocus:S,closeOnEscape:A,centered:P,target:V,withinPortal:M,zIndex:H,overlayBlur:J,transitionTimingFunction:Y,fullScreen:ye,unstyled:he,lockScroll:ve,withFocusReturn:te}=t,se=rSe(t,["className","opened","title","onClose","children","withCloseButton","overlayOpacity","size","transitionDuration","exitTransitionDuration","closeButtonLabel","overlayColor","overflow","transition","padding","shadow","radius","id","classNames","styles","closeOnClickOutside","trapFocus","closeOnEscape","centered","target","withinPortal","zIndex","overlayBlur","transitionTimingFunction","fullScreen","unstyled","lockScroll","withFocusReturn"]),K=Fu(b),x=`${K}-title`,C=`${K}-body`,{classes:z,cx:R,theme:O}=eSe({size:l,overflow:p,centered:P,zIndex:H,fullScreen:ye},{unstyled:he,classNames:T,styles:I,name:"Modal"}),q=qW(S&&r),le=w.useRef(null),ae=Ko(q,le),pe=typeof u=="number"?u:O.colorScheme==="dark"?.85:.75;Mpe(ve&&r);const me=st=>{!S&&st.key==="Escape"&&A&&s()};w.useEffect(()=>{if(!S)return window.addEventListener("keydown",me),()=>window.removeEventListener("keydown",me)},[S]),VW({opened:r,shouldReturnFocus:S&&te});const Se=w.useRef(null);RP("mousedown",st=>{Se.current=st.target});const ce=()=>{Se.current===le.current&&E&&s()};return k.createElement(S_,{withinPortal:M,target:V},k.createElement(KG,{mounted:r,duration:c,exitDuration:f,timingFunction:Y,transitions:{modal:{duration:c,transition:m||(ye?"fade":"pop")},overlay:{duration:c/2,transition:"fade",timingFunction:"ease"}}},st=>k.createElement(k.Fragment,null,k.createElement(ut,nSe({id:K,className:R(z.root,n)},se),k.createElement("div",{style:st.overlay},k.createElement(bEe,{className:z.overlay,sx:{position:"fixed"},zIndex:0,blur:J,color:h||(O.colorScheme==="dark"?O.colors.dark[9]:O.black),opacity:pe,unstyled:he})),k.createElement("div",{role:"presentation",className:z.inner,onClick:ce,onKeyDown:Ke=>{var qe;((qe=Ke.target)==null?void 0:qe.getAttribute("data-mantine-stop-propagation"))!=="true"&&Ke.key==="Escape"&&A&&s()},ref:ae},k.createElement(_d,{className:z.modal,shadow:g,p:y,radius:_,role:"dialog","aria-labelledby":x,"aria-describedby":C,"aria-modal":!0,tabIndex:-1,style:st.modal,unstyled:he,onClick:Ke=>Ke.stopPropagation()},(i||a)&&k.createElement("div",{className:z.header},k.createElement(Tt,{id:x,className:z.title},i),a&&k.createElement(zS,{iconSize:16,onClick:s,"aria-label":d,className:z.close})),k.createElement("div",{id:C,className:z.body},o)))))))}JS.displayName="@mantine/core/Modal";const sSe={xs:16,sm:22,md:26,lg:30,xl:36},oSe={xs:10,sm:12,md:14,lg:16,xl:18};var aSe=at((e,{size:t,disabled:n,radius:r,readOnly:i,variant:s})=>({defaultValue:{display:"flex",alignItems:"center",backgroundColor:n?e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[3]:e.colorScheme==="dark"?e.colors.dark[7]:s==="filled"?e.white:e.colors.gray[1],color:n?e.colorScheme==="dark"?e.colors.dark[1]:e.colors.gray[7]:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[7],height:e.fn.size({size:t,sizes:sSe}),paddingLeft:e.fn.size({size:t,sizes:e.spacing}),paddingRight:n||i?e.fn.size({size:t,sizes:e.spacing}):0,fontWeight:500,fontSize:e.fn.size({size:t,sizes:oSe}),borderRadius:e.fn.size({size:r,sizes:e.radius}),cursor:n?"not-allowed":"default",userSelect:"none",maxWidth:"calc(100% - 20px)"},defaultValueRemove:{color:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[7],marginLeft:e.fn.size({size:t,sizes:e.spacing})/6},defaultValueLabel:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}));const uSe=aSe;var lSe=Object.defineProperty,gw=Object.getOwnPropertySymbols,JK=Object.prototype.hasOwnProperty,ZK=Object.prototype.propertyIsEnumerable,s8=(e,t,n)=>t in e?lSe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,cSe=(e,t)=>{for(var n in t||(t={}))JK.call(t,n)&&s8(e,n,t[n]);if(gw)for(var n of gw(t))ZK.call(t,n)&&s8(e,n,t[n]);return e},fSe=(e,t)=>{var n={};for(var r in e)JK.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&gw)for(var r of gw(e))t.indexOf(r)<0&&ZK.call(e,r)&&(n[r]=e[r]);return n};const o8={xs:16,sm:22,md:24,lg:26,xl:30};function eQ(e){var t=e,{label:n,classNames:r,styles:i,className:s,onRemove:o,disabled:a,readOnly:u,size:l,radius:c="sm",variant:f}=t,d=fSe(t,["label","classNames","styles","className","onRemove","disabled","readOnly","size","radius","variant"]);const{classes:h,cx:p}=uSe({size:l,disabled:a,readOnly:u,radius:c,variant:f},{classNames:r,styles:i,name:"MultiSelect"});return k.createElement("div",cSe({className:p(h.defaultValue,s)},d),k.createElement("span",{className:h.defaultValueLabel},n),!a&&!u&&k.createElement(zS,{"aria-hidden":!0,onMouseDown:o,size:o8[l],radius:2,color:"blue",variant:"transparent",iconSize:o8[l]/2,className:h.defaultValueRemove,tabIndex:-1}))}eQ.displayName="@mantine/core/MultiSelect/DefaultValue";function dSe({data:e,searchable:t,limit:n,searchValue:r,filter:i,value:s}){if(!t&&s.length===0)return e;if(!t){const a=[];for(let u=0;ul===e[u].value&&!e[u].disabled)||a.push(e[u]);return a}const o=[];for(let a=0;au===e[a].value&&!e[a].disabled),e[a])&&o.push(e[a]),!(o.length>=n));a+=1);return o}var hSe=Object.defineProperty,yw=Object.getOwnPropertySymbols,tQ=Object.prototype.hasOwnProperty,nQ=Object.prototype.propertyIsEnumerable,a8=(e,t,n)=>t in e?hSe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,u8=(e,t)=>{for(var n in t||(t={}))tQ.call(t,n)&&a8(e,n,t[n]);if(yw)for(var n of yw(t))nQ.call(t,n)&&a8(e,n,t[n]);return e},pSe=(e,t)=>{var n={};for(var r in e)tQ.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&yw)for(var r of yw(e))t.indexOf(r)<0&&nQ.call(e,r)&&(n[r]=e[r]);return n};const mSe={xs:14,sm:18,md:20,lg:24,xl:28};function gSe(e){var t=e,{size:n,error:r,style:i}=t,s=pSe(t,["size","error","style"]);const o=ts(),a=o.fn.size({size:n,sizes:mSe});return k.createElement("svg",u8({width:a,height:a,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:u8({color:r?o.colors.red[6]:o.colors.gray[6]},i),"data-chevron":!0},s),k.createElement("path",{d:"M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}function rQ({shouldClear:e,clearButtonLabel:t,onClear:n,size:r,error:i,clearButtonTabIndex:s}){return e?k.createElement(zS,{variant:"transparent","aria-label":t,onClick:n,size:r,tabIndex:s,onMouseDown:o=>o.preventDefault()}):k.createElement(gSe,{error:i,size:r})}rQ.displayName="@mantine/core/SelectRightSection";var ySe=Object.defineProperty,_Se=Object.defineProperties,vSe=Object.getOwnPropertyDescriptors,_w=Object.getOwnPropertySymbols,iQ=Object.prototype.hasOwnProperty,sQ=Object.prototype.propertyIsEnumerable,l8=(e,t,n)=>t in e?ySe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,VC=(e,t)=>{for(var n in t||(t={}))iQ.call(t,n)&&l8(e,n,t[n]);if(_w)for(var n of _w(t))sQ.call(t,n)&&l8(e,n,t[n]);return e},c8=(e,t)=>_Se(e,vSe(t)),bSe=(e,t)=>{var n={};for(var r in e)iQ.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&_w)for(var r of _w(e))t.indexOf(r)<0&&sQ.call(e,r)&&(n[r]=e[r]);return n};const ESe={xs:24,sm:30,md:34,lg:44,xl:54};function oQ(e){var t=e,{styles:n,rightSection:r,rightSectionWidth:i,theme:s}=t,o=bSe(t,["styles","rightSection","rightSectionWidth","theme"]);if(r)return{rightSection:r,rightSectionWidth:i,styles:n};const a=typeof n=="function"?n(s):n;return{rightSectionWidth:s.fn.size({size:o.size,sizes:ESe}),rightSection:!o.readOnly&&!(o.disabled&&o.shouldClear)&&k.createElement(rQ,VC({},o)),styles:c8(VC({},a),{rightSection:c8(VC({},a==null?void 0:a.rightSection),{pointerEvents:o.shouldClear?void 0:"none"})})}}var wSe=Object.defineProperty,TSe=Object.defineProperties,SSe=Object.getOwnPropertyDescriptors,f8=Object.getOwnPropertySymbols,ISe=Object.prototype.hasOwnProperty,xSe=Object.prototype.propertyIsEnumerable,d8=(e,t,n)=>t in e?wSe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,CSe=(e,t)=>{for(var n in t||(t={}))ISe.call(t,n)&&d8(e,n,t[n]);if(f8)for(var n of f8(t))xSe.call(t,n)&&d8(e,n,t[n]);return e},ASe=(e,t)=>TSe(e,SSe(t)),OSe=at((e,{size:t,invalid:n})=>({wrapper:{position:"relative"},values:{minHeight:e.fn.size({size:t,sizes:Ss})-2,display:"flex",alignItems:"center",flexWrap:"wrap",marginLeft:`calc(${-e.spacing.xs}px / 2)`,boxSizing:"border-box"},value:{margin:`calc(${e.spacing.xs}px / 2 - 2px) calc(${e.spacing.xs}px / 2)`},searchInput:ASe(CSe({},e.fn.fontStyles()),{flex:1,minWidth:60,backgroundColor:"transparent",border:0,outline:0,fontSize:e.fn.size({size:t,sizes:e.fontSizes}),padding:0,marginLeft:`calc(${e.spacing.xs}px / 2)`,appearance:"none",color:"inherit",lineHeight:`${e.fn.size({size:t,sizes:Ss})-2}px`,"&::placeholder":{opacity:1,color:n?e.colors.red[e.colorScheme==="dark"?6:7]:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]},"&:disabled":{cursor:"not-allowed"}}),searchInputEmpty:{width:"100%"},searchInputInputHidden:{width:0,height:0,margin:0,overflow:"hidden"},searchInputPointer:{cursor:"pointer","&:disabled":{cursor:"not-allowed"}},input:{cursor:"pointer","&:disabled":{cursor:"not-allowed"}}}));const PSe=OSe;var RSe=Object.defineProperty,NSe=Object.defineProperties,kSe=Object.getOwnPropertyDescriptors,vw=Object.getOwnPropertySymbols,aQ=Object.prototype.hasOwnProperty,uQ=Object.prototype.propertyIsEnumerable,h8=(e,t,n)=>t in e?RSe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,vh=(e,t)=>{for(var n in t||(t={}))aQ.call(t,n)&&h8(e,n,t[n]);if(vw)for(var n of vw(t))uQ.call(t,n)&&h8(e,n,t[n]);return e},p8=(e,t)=>NSe(e,kSe(t)),DSe=(e,t)=>{var n={};for(var r in e)aQ.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&vw)for(var r of vw(e))t.indexOf(r)<0&&uQ.call(e,r)&&(n[r]=e[r]);return n};function $Se(e,t,n){return t?!1:n.label.toLowerCase().trim().includes(e.toLowerCase().trim())}function LSe(e,t){return!!e&&!t.some(n=>n.value.toLowerCase()===e.toLowerCase())}function m8(e,t){if(!Array.isArray(e))return;if(t.length===0)return[];const n=typeof t[0]=="object"?t.map(r=>r.value):t;return e.filter(r=>n.includes(r))}const MSe={size:"sm",valueComponent:eQ,itemComponent:pk,transition:"pop-top-left",transitionDuration:0,maxDropdownHeight:220,shadow:"sm",searchable:!1,filter:$Se,limit:1/0,clearSearchOnChange:!0,clearable:!1,clearSearchOnBlur:!1,disabled:!1,initiallyOpened:!1,creatable:!1,shouldCreate:LSe,switchDirectionOnFlip:!1,zIndex:To("popover"),selectOnBlur:!1,clearButtonTabIndex:0,positionDependencies:[]},lQ=w.forwardRef((e,t)=>{const n=ct("MultiSelect",MSe,e),{className:r,style:i,required:s,label:o,description:a,size:u,error:l,classNames:c,styles:f,wrapperProps:d,value:h,defaultValue:p,data:m,onChange:y,valueComponent:g,itemComponent:_,id:b,transition:T,transitionDuration:I,transitionTimingFunction:E,maxDropdownHeight:S,shadow:A,nothingFound:P,onFocus:V,onBlur:M,searchable:H,placeholder:J,filter:Y,limit:ye,clearSearchOnChange:he,clearable:ve,clearSearchOnBlur:te,clearButtonLabel:se,variant:K,onSearchChange:x,searchValue:C,disabled:z,initiallyOpened:R,radius:O,icon:q,rightSection:le,rightSectionWidth:ae,creatable:pe,getCreateLabel:me,shouldCreate:Se,onCreate:ce,sx:st,dropdownComponent:Ke,onDropdownClose:qe,onDropdownOpen:$e,maxSelectedValues:ot,withinPortal:lt,switchDirectionOnFlip:On,zIndex:Ue,selectOnBlur:Be,name:bt,dropdownPosition:je,errorProps:gt,labelProps:Gt,descriptionProps:an,clearButtonTabIndex:Gn,form:ue,positionDependencies:we,onKeyDown:Le,unstyled:rt,inputContainer:De,inputWrapperOrder:it,readOnly:Me,withAsterisk:Ze}=n,bn=DSe(n,["className","style","required","label","description","size","error","classNames","styles","wrapperProps","value","defaultValue","data","onChange","valueComponent","itemComponent","id","transition","transitionDuration","transitionTimingFunction","maxDropdownHeight","shadow","nothingFound","onFocus","onBlur","searchable","placeholder","filter","limit","clearSearchOnChange","clearable","clearSearchOnBlur","clearButtonLabel","variant","onSearchChange","searchValue","disabled","initiallyOpened","radius","icon","rightSection","rightSectionWidth","creatable","getCreateLabel","shouldCreate","onCreate","sx","dropdownComponent","onDropdownClose","onDropdownOpen","maxSelectedValues","withinPortal","switchDirectionOnFlip","zIndex","selectOnBlur","name","dropdownPosition","errorProps","labelProps","descriptionProps","clearButtonTabIndex","form","positionDependencies","onKeyDown","unstyled","inputContainer","inputWrapperOrder","readOnly","withAsterisk"]),{classes:Wt,cx:It,theme:Bn}=PSe({size:u,invalid:!!l},{classNames:c,styles:f,unstyled:rt,name:"MultiSelect"}),{systemStyles:En,rest:sa}=Xd(bn),fr=w.useRef(),Mi=w.useRef(),vr=w.useRef({}),$r=Fu(b),[dr,jn]=w.useState(R),[Zt,ri]=w.useState(-1),[br,Lr]=w.useState("column"),[yi,ms]=Oa({value:C,defaultValue:"",finalValue:void 0,onChange:x}),[Q,j]=w.useState(!1),{scrollIntoView:Z,targetRef:de,scrollableRef:fe}=KW({duration:0,offset:5,cancelable:!1,isList:!0}),He=pe&&typeof me=="function";let Te=null;const Ve=m.map(Ye=>typeof Ye=="string"?{label:Ye,value:Ye}:Ye),ft=hW({data:Ve}),[Je,mt]=Oa({value:m8(h,m),defaultValue:m8(p,m),finalValue:[],onChange:y}),Lt=w.useRef(!!ot&&ot{if(!Me){const zt=Je.filter(Hn=>Hn!==Ye);mt(zt),ot&&zt.length{ms(Ye.currentTarget.value),!z&&!Lt.current&&H&&jn(!0)},xn=Ye=>{typeof V=="function"&&V(Ye),!z&&!Lt.current&&H&&jn(!0)},Et=dSe({data:ft,searchable:H,searchValue:yi,limit:ye,filter:Y,value:Je}),mn=(Ye,zt,Hn)=>{let ii=Ye;for(;Hn(ii);)if(ii=zt(ii),!Et[ii].disabled)return ii;return Ye};fo(()=>{ri(-1)},[yi]),fo(()=>{!z&&Je.length>m.length&&jn(!1),ot&&Je.length=ot&&(Lt.current=!0,jn(!1))},[Je]);const tr=Ye=>{if(!Me)if(he&&ms(""),Je.includes(Ye.value))$n(Ye.value);else{if(Ye.creatable&&typeof ce=="function"){const zt=ce(Ye.value);typeof zt<"u"&&zt!==null&&mt(typeof zt=="string"?[...Je,zt]:[...Je,zt.value])}else mt([...Je,Ye.value]);Je.length===ot-1&&(Lt.current=!0,jn(!1)),Zt===Et.length-1&&ri(Et.length-2),Et.length===1&&jn(!1)}},Wr=Ye=>{typeof M=="function"&&M(Ye),Be&&Et[Zt]&&dr&&tr(Et[Zt]),te&&ms(""),jn(!1)},Pr=Ye=>{if(Q||(Le==null||Le(Ye),Me)||Ye.key!=="Backspace"&&ot&&Lt.current)return;const zt=br==="column",Hn=()=>{ri(gs=>{var N;const G=mn(gs,F=>F+1,F=>F{ri(gs=>{var N;const G=mn(gs,F=>F-1,F=>F>0);return dr&&(de.current=vr.current[(N=Et[G])==null?void 0:N.value],Z({alignment:zt?"start":"end"})),G})};switch(Ye.key){case"ArrowUp":{Ye.preventDefault(),jn(!0),zt?ii():Hn();break}case"ArrowDown":{Ye.preventDefault(),jn(!0),zt?Hn():ii();break}case"Enter":{Ye.preventDefault(),Et[Zt]&&dr?tr(Et[Zt]):jn(!0);break}case" ":{H||(Ye.preventDefault(),Et[Zt]&&dr?tr(Et[Zt]):jn(!0));break}case"Backspace":{Je.length>0&&yi.length===0&&(mt(Je.slice(0,-1)),jn(!0),ot&&(Lt.current=!1));break}case"Home":{if(!H){Ye.preventDefault(),dr||jn(!0);const gs=Et.findIndex(N=>!N.disabled);ri(gs),Z({alignment:zt?"end":"start"})}break}case"End":{if(!H){Ye.preventDefault(),dr||jn(!0);const gs=Et.map(N=>!!N.disabled).lastIndexOf(!1);ri(gs),Z({alignment:zt?"end":"start"})}break}case"Escape":jn(!1)}},is=Je.map(Ye=>{let zt=ft.find(Hn=>Hn.value===Ye&&!Hn.disabled);return!zt&&He&&(zt={value:Ye,label:Ye}),zt}).filter(Ye=>!!Ye).map(Ye=>k.createElement(g,p8(vh({},Ye),{variant:K,disabled:z,className:Wt.value,readOnly:Me,onRemove:zt=>{zt.preventDefault(),zt.stopPropagation(),$n(Ye.value)},key:Ye.value,size:u,styles:f,classNames:c,radius:O}))),_i=()=>{var Ye;ms(""),mt([]),(Ye=fr.current)==null||Ye.focus(),ot&&(Lt.current=!1)};He&&Se(yi,ft)&&(Te=me(yi),Et.push({label:yi,value:yi,creatable:!0}));const hr=!Me&&(Et.length>0?dr:dr&&!!P);return fo(()=>{const Ye=hr?$e:qe;typeof Ye=="function"&&Ye()},[hr]),k.createElement(Bs.Wrapper,vh(vh({required:s,id:$r,label:o,error:l,description:a,size:u,className:r,style:i,classNames:c,styles:f,__staticSelector:"MultiSelect",sx:st,errorProps:gt,descriptionProps:an,labelProps:Gt,inputContainer:De,inputWrapperOrder:it,unstyled:rt,withAsterisk:Ze},En),d),k.createElement(Bc,{opened:hr,transition:T,transitionDuration:I,shadow:"sm",withinPortal:lt,__staticSelector:"MultiSelect",onDirectionChange:Lr,switchDirectionOnFlip:On,zIndex:Ue,dropdownPosition:je,positionDependencies:we,classNames:c,styles:f,unstyled:rt},k.createElement(Bc.Target,null,k.createElement("div",{className:Wt.wrapper,role:"combobox","aria-haspopup":"listbox","aria-owns":dr&&hr?`${$r}-items`:null,"aria-controls":$r,"aria-expanded":dr,onMouseLeave:()=>ri(-1),tabIndex:-1,ref:Mi},k.createElement("input",{type:"hidden",name:bt,value:Je.join(","),form:ue,disabled:z}),k.createElement(Bs,vh({__staticSelector:"MultiSelect",style:{overflow:"hidden"},component:"div",multiline:!0,size:u,variant:K,disabled:z,invalid:!!l,required:s,radius:O,icon:q,unstyled:rt,onMouseDown:Ye=>{var zt;Ye.preventDefault(),!z&&!Lt.current&&jn(!dr),(zt=fr.current)==null||zt.focus()},classNames:p8(vh({},c),{input:It({[Wt.input]:!H},c==null?void 0:c.input)})},oQ({theme:Bn,rightSection:le,rightSectionWidth:ae,styles:f,size:u,shouldClear:ve&&Je.length>0,clearButtonLabel:se,onClear:_i,error:l,disabled:z,clearButtonTabIndex:Gn,readOnly:Me})),k.createElement("div",{className:Wt.values},is,k.createElement("input",vh({ref:Ko(t,fr),type:"search",id:$r,className:It(Wt.searchInput,{[Wt.searchInputPointer]:!H,[Wt.searchInputInputHidden]:!dr&&Je.length>0||!H&&Je.length>0,[Wt.searchInputEmpty]:Je.length===0}),onKeyDown:Pr,value:yi,onChange:pt,onFocus:xn,onBlur:Wr,readOnly:!H||Lt.current||Me,placeholder:Je.length===0?J:void 0,disabled:z,"data-mantine-stop-propagation":dr,autoComplete:"off",onCompositionStart:()=>j(!0),onCompositionEnd:()=>j(!1)},sa)))))),k.createElement(Bc.Dropdown,{component:Ke||GS,maxHeight:S,direction:br,id:$r,innerRef:fe,__staticSelector:"MultiSelect",classNames:c,styles:f},k.createElement(hk,{data:Et,hovered:Zt,classNames:c,styles:f,uuid:$r,__staticSelector:"MultiSelect",onItemHover:ri,onItemSelect:tr,itemsRefs:vr,itemComponent:_,size:u,nothingFound:P,creatable:pe&&!!Te,createLabel:Te,unstyled:rt}))))});lQ.displayName="@mantine/core/MultiSelect";const FSe=(e,t,n)=>Number.isInteger(e)&&e>=0&&t===0?"numeric":!Number.isInteger(e)&&e>=0&&t!==0?"decimal":Number.isInteger(e)&&e<0&&t===0||!Number.isInteger(e)&&e<0&&t!==0?n==="ios"?"text":"decimal":"numeric";function g8({direction:e,size:t}){return k.createElement("svg",{style:{transform:e==="up"?"rotate(180deg)":void 0},width:t,height:t,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},k.createElement("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}const cQ={xs:20,sm:24,md:30,lg:34,xl:36};var BSe=at((e,{radius:t,size:n})=>({rightSection:{display:"flex",flexDirection:"column",height:"calc(100% - 2px)",margin:1,marginRight:1,overflow:"hidden",borderTopRightRadius:e.fn.radius(t),borderBottomRightRadius:e.fn.radius(t)},control:{margin:0,position:"relative",flex:"0 0 50%",display:"flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",width:e.fn.size({size:n,sizes:cQ}),padding:0,WebkitTapHighlightColor:"transparent",borderBottom:`1px solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]}`,borderLeft:`1px solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]}`,borderTop:0,borderRight:0,backgroundColor:"transparent",marginRight:1,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,"&:not(:disabled):hover":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[0]},"&:disabled":{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[4]}},controlUp:{},controlDown:{borderBottom:0}}));const jSe=BSe;var USe=Object.defineProperty,VSe=Object.defineProperties,zSe=Object.getOwnPropertyDescriptors,bw=Object.getOwnPropertySymbols,fQ=Object.prototype.hasOwnProperty,dQ=Object.prototype.propertyIsEnumerable,y8=(e,t,n)=>t in e?USe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,zC=(e,t)=>{for(var n in t||(t={}))fQ.call(t,n)&&y8(e,n,t[n]);if(bw)for(var n of bw(t))dQ.call(t,n)&&y8(e,n,t[n]);return e},HSe=(e,t)=>VSe(e,zSe(t)),WSe=(e,t)=>{var n={};for(var r in e)fQ.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&bw)for(var r of bw(e))t.indexOf(r)<0&&dQ.call(e,r)&&(n[r]=e[r]);return n};const qSe={type:"text",size:"sm",__staticSelector:"TextInput"},Nk=w.forwardRef((e,t)=>{const n=XY("TextInput",qSe,e),{inputProps:r,wrapperProps:i}=n,s=WSe(n,["inputProps","wrapperProps"]);return k.createElement(Bs.Wrapper,zC({},i),k.createElement(Bs,HSe(zC(zC({},r),s),{ref:t})))});Nk.displayName="@mantine/core/TextInput";var YSe=Object.defineProperty,GSe=Object.defineProperties,KSe=Object.getOwnPropertyDescriptors,Ew=Object.getOwnPropertySymbols,hQ=Object.prototype.hasOwnProperty,pQ=Object.prototype.propertyIsEnumerable,_8=(e,t,n)=>t in e?YSe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,QSe=(e,t)=>{for(var n in t||(t={}))hQ.call(t,n)&&_8(e,n,t[n]);if(Ew)for(var n of Ew(t))pQ.call(t,n)&&_8(e,n,t[n]);return e},XSe=(e,t)=>GSe(e,KSe(t)),JSe=(e,t)=>{var n={};for(var r in e)hQ.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Ew)for(var r of Ew(e))t.indexOf(r)<0&&pQ.call(e,r)&&(n[r]=e[r]);return n};const ZSe=e=>e||"",eIe=e=>{if(e==="-")return e;let t=e;t[0]==="."&&(t=`0${e}`);const n=parseFloat(t);if(!Number.isNaN(n))return e},v8={xs:10,sm:14,md:16,lg:18,xl:20},tIe={step:1,hideControls:!1,size:"sm",precision:0,noClampOnBlur:!1,removeTrailingZeros:!1,formatter:ZSe,parser:eIe,type:"text"},mQ=w.forwardRef((e,t)=>{const n=ct("NumberInput",tIe,e),{disabled:r,value:i,onChange:s,decimalSeparator:o,min:a,max:u,startValue:l,step:c,stepHoldInterval:f,stepHoldDelay:d,onBlur:h,onFocus:p,onKeyDown:m,onKeyUp:y,hideControls:g,radius:_,variant:b,precision:T,removeTrailingZeros:I,defaultValue:E,noClampOnBlur:S,handlersRef:A,classNames:P,styles:V,size:M,rightSection:H,rightSectionWidth:J,formatter:Y,parser:ye,inputMode:he,unstyled:ve,type:te}=n,se=JSe(n,["disabled","value","onChange","decimalSeparator","min","max","startValue","step","stepHoldInterval","stepHoldDelay","onBlur","onFocus","onKeyDown","onKeyUp","hideControls","radius","variant","precision","removeTrailingZeros","defaultValue","noClampOnBlur","handlersRef","classNames","styles","size","rightSection","rightSectionWidth","formatter","parser","inputMode","unstyled","type"]),{classes:K,cx:x,theme:C}=jSe({radius:_,size:M},{classNames:P,styles:V,unstyled:ve,name:"NumberInput"}),z=De=>{if(De===void 0)return;let it=De.toFixed(T);return I&&T>0&&(it=it.replace(new RegExp(`[0]{0,${T}}$`),""),(it.endsWith(".")||it.endsWith(o))&&(it=it.slice(0,-1))),it},[R,O]=w.useState(!1),[q,le]=w.useState(typeof i=="number"?i:typeof E=="number"?E:void 0),ae=typeof i=="number"?i:q,[pe,me]=w.useState(typeof ae=="number"?z(ae):""),Se=w.useRef(),ce=De=>{De!==q&&!Number.isNaN(De)&&(typeof s=="function"&&s(De),le(De))},st=(De="")=>{let it=typeof De=="number"?String(De):De;return o&&(it=it.replace(/\./g,o)),Y(it)},Ke=De=>{let it=De;return o&&(it=it.replace(new RegExp(`\\${o}`,"g"),".")),ye(it)},qe=typeof a=="number"?a:-1/0,$e=typeof u=="number"?u:1/0,ot=w.useRef();ot.current=()=>{var De,it,Me;if(q===void 0)ce((De=l??a)!=null?De:0),me((Me=(it=z(l))!=null?it:z(a))!=null?Me:"0");else{const Ze=z(Mc(q+c,qe,$e));ce(parseFloat(Ze)),me(Ze)}};const lt=w.useRef();lt.current=()=>{var De,it,Me;if(q===void 0)ce((De=l??a)!=null?De:0),me((Me=(it=z(l))!=null?it:z(a))!=null?Me:"0");else{const Ze=z(Mc(q-c,qe,$e));ce(parseFloat(Ze)),me(Ze)}},YW(A,{increment:ot.current,decrement:lt.current}),w.useEffect(()=>{typeof i=="number"&&!R&&(le(i),me(z(i))),E===void 0&&i===void 0&&!R&&(le(i),me(""))},[i]);const On=d!==void 0&&f!==void 0,Ue=w.useRef(null),Be=w.useRef(0),bt=()=>{Ue.current&&window.clearTimeout(Ue.current),Ue.current=null,Be.current=0},je=De=>{De?ot.current():lt.current(),Be.current+=1},gt=De=>{if(je(De),On){const it=typeof f=="number"?f:f(Be.current);Ue.current=window.setTimeout(()=>gt(De),it)}},Gt=(De,it)=>{De.preventDefault(),Se.current.focus(),je(it),On&&(Ue.current=window.setTimeout(()=>gt(it),d))};w.useEffect(()=>(bt(),bt),[]);const an=k.createElement("div",{className:K.rightSection},k.createElement("button",{type:"button",tabIndex:-1,"aria-hidden":!0,disabled:ae>=u,className:x(K.control,K.controlUp),onPointerDown:De=>{Gt(De,!0)},onPointerUp:bt,onPointerLeave:bt},k.createElement(g8,{size:C.fn.size({size:M,sizes:v8}),direction:"up"})),k.createElement("button",{type:"button",tabIndex:-1,"aria-hidden":!0,disabled:ae<=a,className:x(K.control,K.controlDown),onPointerDown:De=>{Gt(De,!1)},onPointerUp:bt,onPointerLeave:bt},k.createElement(g8,{size:C.fn.size({size:M,sizes:v8}),direction:"down"}))),Gn=De=>{if(De.nativeEvent.isComposing)return;const Me=De.target.value,Ze=Ke(Me);me(Ze),Me===""||Me==="-"?ce(void 0):Me.trim()!==""&&!Number.isNaN(Ze)&&ce(parseFloat(Ze))},ue=De=>{var it;if(De.target.value==="")me(""),ce(void 0);else{let Me=De.target.value;(Me[0]===`${o}`||Me[0]===".")&&(Me=`0${Me}`);const Ze=Ke(Me),bn=Mc(parseFloat(Ze),qe,$e);Number.isNaN(bn)?me((it=z(ae))!=null?it:""):S||(me(z(bn)),ce(parseFloat(z(bn))))}O(!1),typeof h=="function"&&h(De)},we=De=>{O(!0),typeof p=="function"&&p(De)},Le=De=>{if(typeof m=="function"&&m(De),De.repeat&&On&&(De.key==="ArrowUp"||De.key==="ArrowDown")){De.preventDefault();return}De.key==="ArrowUp"?Gt(De,!0):De.key==="ArrowDown"&&Gt(De,!1)},rt=De=>{typeof y=="function"&&y(De),(De.key==="ArrowUp"||De.key==="ArrowDown")&&bt()};return k.createElement(Nk,XSe(QSe({},se),{type:te,variant:b,value:st(pe),disabled:r,ref:Ko(Se,t),onChange:Gn,onBlur:ue,onFocus:we,onKeyDown:Le,onKeyUp:rt,rightSection:H||(r||g||b==="unstyled"?null:an),rightSectionWidth:J||C.fn.size({size:M,sizes:cQ})+1,radius:_,max:u,min:a,step:c,size:M,styles:V,classNames:P,inputMode:he||FSe(c,T,Bpe()),__staticSelector:"NumberInput",unstyled:ve}))});mQ.displayName="@mantine/core/NumberInput";const b8={xs:3,sm:5,md:8,lg:12,xl:16},nIe=Uhe({from:{backgroundPosition:"0 0"},to:{backgroundPosition:"40px 0"}});var rIe=at((e,{color:t,radius:n,size:r,striped:i,animate:s})=>({root:{position:"relative",height:e.fn.size({size:r,sizes:b8}),backgroundColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2],borderRadius:e.fn.size({size:n,sizes:e.radius}),overflow:"hidden"},bar:{position:"absolute",top:0,bottom:0,left:0,height:"100%",display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:e.fn.variant({variant:"filled",primaryFallback:!1,color:t||e.primaryColor}).background,transition:"width 100ms linear",animation:s?`${nIe} 1000ms linear infinite`:"none",backgroundSize:"20px 20px",backgroundImage:i?"linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent)":"none","&:last-of-type":{borderTopRightRadius:e.fn.size({size:n,sizes:e.radius}),borderBottomRightRadius:e.fn.size({size:n,sizes:e.radius})},"&:first-of-type":{borderTopLeftRadius:e.fn.size({size:n,sizes:e.radius}),borderBottomLeftRadius:e.fn.size({size:n,sizes:e.radius})},"@media (prefers-reduced-motion)":{transitionDuration:e.respectReducedMotion?"0ms":void 0}},label:{color:e.white,fontSize:e.fn.size({size:r,sizes:b8})*.65,fontWeight:700,userSelect:"none",overflow:"hidden",whiteSpace:"nowrap"}}));const iIe=rIe,gQ=w.createContext(!1),sIe=gQ.Provider,oIe=()=>w.useContext(gQ);function yQ({children:e,openDelay:t=0,closeDelay:n=0}){return k.createElement(sIe,{value:!0},k.createElement(b_e,{delay:{open:t,close:n}},e))}yQ.displayName="@mantine/core/TooltipGroup";var aIe=Object.defineProperty,uIe=Object.defineProperties,lIe=Object.getOwnPropertyDescriptors,E8=Object.getOwnPropertySymbols,cIe=Object.prototype.hasOwnProperty,fIe=Object.prototype.propertyIsEnumerable,w8=(e,t,n)=>t in e?aIe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,T8=(e,t)=>{for(var n in t||(t={}))cIe.call(t,n)&&w8(e,n,t[n]);if(E8)for(var n of E8(t))fIe.call(t,n)&&w8(e,n,t[n]);return e},dIe=(e,t)=>uIe(e,lIe(t));function hIe(e,t){if(!t)return{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[9],color:e.white};const n=e.fn.variant({variant:"filled",color:t,primaryFallback:!1});return{backgroundColor:n.background,color:n.color}}var pIe=at((e,{color:t,radius:n,width:r,multiline:i})=>({tooltip:dIe(T8(T8({},e.fn.fontStyles()),hIe(e,t)),{lineHeight:e.lineHeight,fontSize:e.fontSizes.sm,borderRadius:e.fn.radius(n),padding:`calc(${e.spacing.xs}px / 2) ${e.spacing.xs}px`,position:"absolute",whiteSpace:i?"unset":"nowrap",pointerEvents:"none",width:r}),arrow:{backgroundColor:"inherit",border:0,zIndex:1}}));const _Q=pIe,vQ={children:"Tooltip component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported"};function mIe({offset:e,position:t}){const[n,r]=w.useState(!1),i=w.useRef(),{x:s,y:o,reference:a,floating:u,refs:l,update:c,placement:f}=wk({placement:t,middleware:[vk({crossAxis:!0,padding:5,rootBoundary:"document"})]}),d=f.includes("right")?e:t.includes("left")?e*-1:0,h=f.includes("bottom")?e:t.includes("top")?e*-1:0,p=w.useCallback(({clientX:m,clientY:y})=>{a({getBoundingClientRect(){return{width:0,height:0,x:m,y,left:m+d,top:y+h,right:m,bottom:y}}})},[a]);return w.useEffect(()=>{if(l.floating.current){const m=i.current;m.addEventListener("mousemove",p);const y=pl(l.floating.current);return y.forEach(g=>{g.addEventListener("scroll",c)}),()=>{m.removeEventListener("mousemove",p),y.forEach(g=>{g.removeEventListener("scroll",c)})}}},[a,l.floating,c,p,n]),{handleMouseMove:p,x:s,y:o,opened:n,setOpened:r,boundaryRef:i,floating:u}}var gIe=Object.defineProperty,yIe=Object.defineProperties,_Ie=Object.getOwnPropertyDescriptors,ww=Object.getOwnPropertySymbols,bQ=Object.prototype.hasOwnProperty,EQ=Object.prototype.propertyIsEnumerable,S8=(e,t,n)=>t in e?gIe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,HC=(e,t)=>{for(var n in t||(t={}))bQ.call(t,n)&&S8(e,n,t[n]);if(ww)for(var n of ww(t))EQ.call(t,n)&&S8(e,n,t[n]);return e},WC=(e,t)=>yIe(e,_Ie(t)),vIe=(e,t)=>{var n={};for(var r in e)bQ.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ww)for(var r of ww(e))t.indexOf(r)<0&&EQ.call(e,r)&&(n[r]=e[r]);return n};const bIe={refProp:"ref",withinPortal:!0,offset:10,position:"right",zIndex:To("popover")};function wQ(e){var t;const n=ct("TooltipFloating",bIe,e),{children:r,refProp:i,withinPortal:s,style:o,className:a,classNames:u,styles:l,unstyled:c,radius:f,color:d,label:h,offset:p,position:m,multiline:y,width:g,zIndex:_,disabled:b}=n,T=vIe(n,["children","refProp","withinPortal","style","className","classNames","styles","unstyled","radius","color","label","offset","position","multiline","width","zIndex","disabled"]),{handleMouseMove:I,x:E,y:S,opened:A,boundaryRef:P,floating:V,setOpened:M}=mIe({offset:p,position:m}),{classes:H,cx:J}=_Q({radius:f,color:d,multiline:y,width:g},{name:"Tooltip",classNames:u,styles:l,unstyled:c});if(!Dm(r))throw new Error(vQ.children);const Y=Ko(P,r.ref),ye=ve=>{var te,se;(se=(te=r.props).onMouseEnter)==null||se.call(te,ve),I(ve),M(!0)},he=ve=>{var te,se;(se=(te=r.props).onMouseLeave)==null||se.call(te,ve),M(!1)};return b?k.createElement(k.Fragment,null,r):k.createElement(k.Fragment,null,k.createElement(S_,{withinPortal:s},k.createElement(ut,WC(HC({},T),{ref:V,className:J(H.tooltip,a),style:WC(HC({},o),{zIndex:_,display:A?"block":"none",top:S??"",left:(t=Math.round(E))!=null?t:""})}),h)),w.cloneElement(r,WC(HC({},r.props),{[i]:Y,onMouseEnter:ye,onMouseLeave:he})))}wQ.displayName="@mantine/core/TooltipFloating";function EIe(e){const[t,n]=w.useState(!1),i=typeof e.opened=="boolean"?e.opened:t,s=oIe(),o=Fu(),{delay:a,currentId:u,setCurrentId:l}=RY(),c=w.useCallback(A=>{n(A),A&&l(o)},[l,o]),{x:f,y:d,reference:h,floating:p,context:m,refs:y,update:g,placement:_,middlewareData:{arrow:{x:b,y:T}={}}}=wk({placement:e.position,open:i,onOpenChange:c,middleware:[vY(e.offset),vk({padding:8}),_Y(),CY({element:e.arrowRef}),...e.inline?[EY()]:[]]}),{getReferenceProps:I,getFloatingProps:E}=g_e([v_e(m,{enabled:e.events.hover,delay:s?a:{open:e.openDelay,close:e.closeDelay},mouseOnly:!e.events.touch}),x_e(m,{enabled:e.events.focus,keyboardOnly:!0}),w_e(m,{role:"tooltip"}),I_e(m,{enabled:typeof e.opened===void 0}),E_e(m,{id:o})]);return NY({opened:i,positionDependencies:e.positionDependencies,floating:{refs:y,update:g}}),fo(()=>{var A;(A=e.onPositionChange)==null||A.call(e,_)},[_]),{x:f,y:d,arrowX:b,arrowY:T,reference:h,floating:p,getFloatingProps:E,getReferenceProps:I,isGroupPhase:i&&u&&u!==o,opened:i,placement:_}}var wIe=Object.defineProperty,TIe=Object.defineProperties,SIe=Object.getOwnPropertyDescriptors,Tw=Object.getOwnPropertySymbols,TQ=Object.prototype.hasOwnProperty,SQ=Object.prototype.propertyIsEnumerable,I8=(e,t,n)=>t in e?wIe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Og=(e,t)=>{for(var n in t||(t={}))TQ.call(t,n)&&I8(e,n,t[n]);if(Tw)for(var n of Tw(t))SQ.call(t,n)&&I8(e,n,t[n]);return e},IIe=(e,t)=>TIe(e,SIe(t)),xIe=(e,t)=>{var n={};for(var r in e)TQ.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Tw)for(var r of Tw(e))t.indexOf(r)<0&&SQ.call(e,r)&&(n[r]=e[r]);return n};const CIe={position:"top",refProp:"ref",withinPortal:!1,inline:!1,arrowSize:4,arrowOffset:5,arrowRadius:0,offset:5,transition:"fade",transitionDuration:100,width:"auto",events:{hover:!0,focus:!1,touch:!1},zIndex:To("popover"),positionDependencies:[]},ZS=w.forwardRef((e,t)=>{const n=w.useRef(null),r=ct("Tooltip",CIe,e),{children:i,position:s,refProp:o,label:a,openDelay:u,closeDelay:l,onPositionChange:c,opened:f,withinPortal:d,radius:h,color:p,classNames:m,styles:y,unstyled:g,style:_,className:b,withArrow:T,arrowSize:I,arrowOffset:E,arrowRadius:S,offset:A,transition:P,transitionDuration:V,multiline:M,width:H,events:J,zIndex:Y,disabled:ye,positionDependencies:he,onClick:ve,onMouseEnter:te,onMouseLeave:se,inline:K}=r,x=xIe(r,["children","position","refProp","label","openDelay","closeDelay","onPositionChange","opened","withinPortal","radius","color","classNames","styles","unstyled","style","className","withArrow","arrowSize","arrowOffset","arrowRadius","offset","transition","transitionDuration","multiline","width","events","zIndex","disabled","positionDependencies","onClick","onMouseEnter","onMouseLeave","inline"]),{classes:C,cx:z,theme:R}=_Q({radius:h,color:p,width:H,multiline:M},{name:"Tooltip",classNames:m,styles:y,unstyled:g}),O=EIe({position:qY(R.dir,s),closeDelay:l,openDelay:u,onPositionChange:c,opened:f,events:J,arrowRef:n,offset:A+(T?I/2:0),positionDependencies:[...he,i],inline:K});if(!Dm(i))throw new Error(vQ.children);const q=Ko(O.reference,i.ref,t);return k.createElement(k.Fragment,null,k.createElement(S_,{withinPortal:d},k.createElement(XS,{mounted:!ye&&O.opened,transition:P,duration:O.isGroupPhase?10:V},le=>{var ae,pe;return k.createElement(ut,Og(Og({},x),O.getFloatingProps({ref:O.floating,className:C.tooltip,style:IIe(Og(Og({},_),le),{zIndex:Y,top:(ae=O.y)!=null?ae:0,left:(pe=O.x)!=null?pe:0})})),a,k.createElement(Tk,{ref:n,arrowX:O.arrowX,arrowY:O.arrowY,visible:T,withBorder:!1,position:O.placement,arrowSize:I,arrowOffset:E,arrowRadius:S,className:C.arrow}))})),w.cloneElement(i,O.getReferenceProps(Og({onClick:ve,onMouseEnter:te,onMouseLeave:se,onMouseMove:e.onMouseMove,onPointerDown:e.onPointerDown,onPointerEnter:e.onPointerEnter,[o]:q,className:z(b,i.props.className)},i.props))))});ZS.Group=yQ;ZS.Floating=wQ;ZS.displayName="@mantine/core/Tooltip";const IQ=ZS;var AIe=Object.defineProperty,OIe=Object.defineProperties,PIe=Object.getOwnPropertyDescriptors,Sw=Object.getOwnPropertySymbols,xQ=Object.prototype.hasOwnProperty,CQ=Object.prototype.propertyIsEnumerable,x8=(e,t,n)=>t in e?AIe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,VP=(e,t)=>{for(var n in t||(t={}))xQ.call(t,n)&&x8(e,n,t[n]);if(Sw)for(var n of Sw(t))CQ.call(t,n)&&x8(e,n,t[n]);return e},AQ=(e,t)=>OIe(e,PIe(t)),C8=(e,t)=>{var n={};for(var r in e)xQ.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Sw)for(var r of Sw(e))t.indexOf(r)<0&&CQ.call(e,r)&&(n[r]=e[r]);return n};function RIe(e){return e.reduce((t,n)=>(t.sections.push(AQ(VP({},n),{accumulated:t.accumulated})),t.accumulated+=n.value,t),{accumulated:0,sections:[]}).sections}const NIe={size:"md",radius:"sm",striped:!1,animate:!1,label:""},OQ=w.forwardRef((e,t)=>{const n=ct("Progress",NIe,e),{className:r,value:i,color:s,size:o,radius:a,striped:u,animate:l,label:c,"aria-label":f,classNames:d,styles:h,sections:p,unstyled:m}=n,y=C8(n,["className","value","color","size","radius","striped","animate","label","aria-label","classNames","styles","sections","unstyled"]),{classes:g,cx:_,theme:b}=iIe({color:s,size:o,radius:a,striped:u||l,animate:l},{classNames:d,styles:h,unstyled:m,name:"Progress"}),T=Array.isArray(p)?RIe(p).map((I,E)=>{var S=I,{tooltip:A,accumulated:P,value:V,label:M,color:H}=S,J=C8(S,["tooltip","accumulated","value","label","color"]);return k.createElement(IQ.Floating,{label:A,disabled:!A,key:E},k.createElement(ut,AQ(VP({},J),{className:_(g.bar,J.className),sx:{width:`${V}%`,left:`${P}%`,backgroundColor:b.fn.variant({variant:"filled",primaryFallback:!1,color:H||b.primaryColor}).background}}),M&&k.createElement(Tt,{className:g.label},M)))}):null;return k.createElement(ut,VP({className:_(g.root,r),ref:t},y),T||k.createElement("div",{role:"progressbar","aria-valuemax":100,"aria-valuemin":0,"aria-valuenow":i,"aria-label":f,className:g.bar,style:{width:`${i}%`}},c?k.createElement(Tt,{className:g.label},c):""))});OQ.displayName="@mantine/core/Progress";var kIe=Object.defineProperty,A8=Object.getOwnPropertySymbols,DIe=Object.prototype.hasOwnProperty,$Ie=Object.prototype.propertyIsEnumerable,O8=(e,t,n)=>t in e?kIe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,LIe=(e,t)=>{for(var n in t||(t={}))DIe.call(t,n)&&O8(e,n,t[n]);if(A8)for(var n of A8(t))$Ie.call(t,n)&&O8(e,n,t[n]);return e};function MIe(e){return k.createElement("svg",LIe({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 5 5"},e),k.createElement("path",{fill:"currentColor",d:"M0 2.5a2.5 2.5 0 115 0 2.5 2.5 0 01-5 0z"}))}const PQ=w.createContext(null),FIe=PQ.Provider,BIe=()=>w.useContext(PQ);var jIe=Object.defineProperty,Iw=Object.getOwnPropertySymbols,RQ=Object.prototype.hasOwnProperty,NQ=Object.prototype.propertyIsEnumerable,P8=(e,t,n)=>t in e?jIe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,R8=(e,t)=>{for(var n in t||(t={}))RQ.call(t,n)&&P8(e,n,t[n]);if(Iw)for(var n of Iw(t))NQ.call(t,n)&&P8(e,n,t[n]);return e},UIe=(e,t)=>{var n={};for(var r in e)RQ.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Iw)for(var r of Iw(e))t.indexOf(r)<0&&NQ.call(e,r)&&(n[r]=e[r]);return n};const VIe={orientation:"horizontal",spacing:"lg",offset:"xs",size:"sm"},kQ=w.forwardRef((e,t)=>{const n=ct("RadioGroup",VIe,e),{children:r,value:i,defaultValue:s,onChange:o,orientation:a,spacing:u,size:l,wrapperProps:c,unstyled:f,offset:d,name:h}=n,p=UIe(n,["children","value","defaultValue","onChange","orientation","spacing","size","wrapperProps","unstyled","offset","name"]),[m,y]=Oa({value:i,defaultValue:s,finalValue:"",onChange:o}),g=_=>y(_.currentTarget.value);return k.createElement(FIe,{value:{value:m,onChange:g,size:l,name:h}},k.createElement(Bs.Wrapper,R8(R8({labelElement:"div",size:l,__staticSelector:"RadioGroup",ref:t,unstyled:f},c),p),k.createElement(LG,{spacing:u,orientation:a,unstyled:f,role:"radiogroup",offset:d},r)))});kQ.displayName="@mantine/core/RadioGroup";var zIe=Object.defineProperty,HIe=Object.defineProperties,WIe=Object.getOwnPropertyDescriptors,N8=Object.getOwnPropertySymbols,qIe=Object.prototype.hasOwnProperty,YIe=Object.prototype.propertyIsEnumerable,k8=(e,t,n)=>t in e?zIe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,GIe=(e,t)=>{for(var n in t||(t={}))qIe.call(t,n)&&k8(e,n,t[n]);if(N8)for(var n of N8(t))YIe.call(t,n)&&k8(e,n,t[n]);return e},KIe=(e,t)=>HIe(e,WIe(t));const qC={xs:16,sm:20,md:24,lg:30,xl:36},Qv={xs:6,sm:8,md:10,lg:14,xl:16};var QIe=at((e,{size:t,color:n,transitionDuration:r,labelPosition:i,error:s},o)=>{const a=e.fn.variant({variant:"filled",color:n}),u=e.fn.variant({variant:"filled",color:"red"}).background;return{inner:{order:i==="left"?2:1,position:"relative",alignSelf:"flex-start"},icon:{ref:o("icon"),color:e.white,opacity:0,transform:"scale(0.75) translateY(2px)",transition:`opacity ${r}ms ${e.transitionTimingFunction}`,pointerEvents:"none",width:e.fn.size({sizes:Qv,size:t}),height:e.fn.size({sizes:Qv,size:t}),position:"absolute",top:`calc(50% - ${e.fn.size({sizes:Qv,size:t})/2}px)`,left:`calc(50% - ${e.fn.size({sizes:Qv,size:t})/2}px)`},radio:KIe(GIe({},e.fn.focusStyles()),{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.white,border:`1px solid ${s?u:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]}`,position:"relative",appearance:"none",width:e.fn.size({sizes:qC,size:t}),height:e.fn.size({sizes:qC,size:t}),borderRadius:e.fn.size({sizes:qC,size:t}),margin:0,display:"flex",alignItems:"center",justifyContent:"center",transitionProperty:"background-color, border-color",transitionTimingFunction:e.transitionTimingFunction,transitionDuration:`${r}ms`,cursor:e.cursorType,"&:checked":{background:a.background,borderColor:a.background,[`& + .${o("icon")}`]:{opacity:1,transform:"scale(1)"}},"&:disabled":{borderColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[4],backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1],[`& + .${o("icon")}`]:{color:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[4]}}})}});const XIe=QIe;var JIe=Object.defineProperty,xw=Object.getOwnPropertySymbols,DQ=Object.prototype.hasOwnProperty,$Q=Object.prototype.propertyIsEnumerable,D8=(e,t,n)=>t in e?JIe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Xv=(e,t)=>{for(var n in t||(t={}))DQ.call(t,n)&&D8(e,n,t[n]);if(xw)for(var n of xw(t))$Q.call(t,n)&&D8(e,n,t[n]);return e},ZIe=(e,t)=>{var n={};for(var r in e)DQ.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&xw)for(var r of xw(e))t.indexOf(r)<0&&$Q.call(e,r)&&(n[r]=e[r]);return n};const exe={icon:MIe,transitionDuration:100,size:"sm",labelPosition:"right"},Cw=w.forwardRef((e,t)=>{var n,r;const i=ct("Radio",exe,e),{className:s,style:o,id:a,label:u,size:l,title:c,disabled:f,color:d,classNames:h,styles:p,sx:m,icon:y,transitionDuration:g,wrapperProps:_,unstyled:b,labelPosition:T,description:I,error:E}=i,S=ZIe(i,["className","style","id","label","size","title","disabled","color","classNames","styles","sx","icon","transitionDuration","wrapperProps","unstyled","labelPosition","description","error"]),A=BIe(),P=(n=A==null?void 0:A.size)!=null?n:l,V=e.size?l:P,{classes:M}=XIe({color:d,size:V,transitionDuration:g,labelPosition:T,error:!!E},{classNames:h,styles:p,unstyled:b,name:"Radio"}),{systemStyles:H,rest:J}=Xd(S),Y=Fu(a),ye=A?{checked:A.value===J.value,name:(r=J.name)!=null?r:A.name,onChange:A.onChange}:{};return k.createElement(Ok,Xv(Xv({className:s,sx:m,style:o,id:Y,size:V,labelPosition:T,label:u,description:I,error:E,disabled:f,__staticSelector:"Radio",classNames:h,styles:p,unstyled:b,"data-checked":ye.checked||void 0},H),_),k.createElement("div",{className:M.inner},k.createElement("input",Xv(Xv({ref:t,className:M.radio,type:"radio",id:Y,disabled:f},J),ye)),k.createElement(y,{className:M.icon,"aria-hidden":!0})))});Cw.displayName="@mantine/core/Radio";Cw.Group=kQ;var txe=Object.defineProperty,nxe=Object.defineProperties,rxe=Object.getOwnPropertyDescriptors,$8=Object.getOwnPropertySymbols,ixe=Object.prototype.hasOwnProperty,sxe=Object.prototype.propertyIsEnumerable,L8=(e,t,n)=>t in e?txe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Jv=(e,t)=>{for(var n in t||(t={}))ixe.call(t,n)&&L8(e,n,t[n]);if($8)for(var n of $8(t))sxe.call(t,n)&&L8(e,n,t[n]);return e},oxe=(e,t)=>nxe(e,rxe(t));const tb=4,M8={xs:"3px 6px",sm:"5px 10px",md:"7px 14px",lg:"9px 16px",xl:"12px 20px"};var axe=at((e,{fullWidth:t,color:n,radius:r,shouldAnimate:i,transitionDuration:s,transitionTimingFunction:o,size:a,orientation:u},l)=>{const c=u==="vertical",f=e.fn.variant({variant:"filled",color:n});return{label:oxe(Jv(Jv({ref:l("label")},e.fn.focusStyles()),e.fn.fontStyles()),{WebkitTapHighlightColor:"transparent",borderRadius:e.fn.radius(r),fontWeight:500,fontSize:a in e.fontSizes?e.fontSizes[a]:e.fontSizes.sm,cursor:"pointer",display:"block",textAlign:"center",padding:M8[a in M8?a:"sm"],whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",userSelect:"none",color:e.colorScheme==="dark"?e.colors.dark[1]:e.colors.gray[7],transition:`color ${i?0:s}ms ${o||e.transitionTimingFunction}`,"&:hover":{color:e.colorScheme==="dark"?e.colors.dark[0]:e.black}}),control:{ref:l("control"),position:"relative",boxSizing:"border-box",flex:1,zIndex:2,transition:`border-left-color ${i?0:s}ms ${o||e.transitionTimingFunction}`,"&:not(:first-of-type)":{borderStyle:"solid",borderWidth:c?"1px 0 0 0":"0 0 0 1px",borderColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3]}},input:{height:0,width:0,position:"absolute",overflow:"hidden",whiteSpace:"nowrap",opacity:0,"&:focus":{outline:"none",[`& + .${l("label")}`]:Jv({},e.focusRing==="always"||e.focusRing==="auto"?e.focusRingStyles.styles(e):e.focusRingStyles.resetStyles(e)),"&:focus:not(:focus-visible)":{[`& + .${l("label")}`]:Jv({},e.focusRing==="auto"||e.focusRing==="never"?e.focusRingStyles.resetStyles(e):null)}}},root:{position:"relative",display:t||c?"flex":"inline-flex",width:c&&!t?"max-content":"auto",flexDirection:c?"column":"row",backgroundColor:e.colorScheme==="dark"?e.colors.dark[8]:e.colors.gray[1],borderRadius:e.fn.radius(r),overflow:"hidden",padding:tb},controlActive:{borderLeftColor:"transparent !important",borderTopColor:"transparent !important",[`& + .${l("control")}`]:{borderLeftColor:"transparent !important",borderTopColor:"transparent !important"},borderRadius:e.fn.radius(r),boxShadow:i?n||e.colorScheme==="dark"?"none":e.shadows.xs:void 0,backgroundColor:i?n?f.background:e.colorScheme==="dark"?e.colors.dark[5]:e.white:void 0},labelActive:{"&, &:hover":{color:n||e.colorScheme==="dark"?e.white:e.black}},disabled:{"&, &:hover":{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5],cursor:"not-allowed"}},active:{boxSizing:"border-box",borderRadius:e.fn.radius(r),position:"absolute",zIndex:1,boxShadow:n||e.colorScheme==="dark"?"none":e.shadows.xs,transition:`transform ${i?0:s}ms ${e.transitionTimingFunction}, width ${i?0:s/2}ms ${o||e.transitionTimingFunction}`,backgroundColor:n?f.background:e.colorScheme==="dark"?e.colors.dark[5]:e.white}}});const uxe=axe;var lxe=Object.defineProperty,Aw=Object.getOwnPropertySymbols,LQ=Object.prototype.hasOwnProperty,MQ=Object.prototype.propertyIsEnumerable,F8=(e,t,n)=>t in e?lxe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,cxe=(e,t)=>{for(var n in t||(t={}))LQ.call(t,n)&&F8(e,n,t[n]);if(Aw)for(var n of Aw(t))MQ.call(t,n)&&F8(e,n,t[n]);return e},fxe=(e,t)=>{var n={};for(var r in e)LQ.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Aw)for(var r of Aw(e))t.indexOf(r)<0&&MQ.call(e,r)&&(n[r]=e[r]);return n};const dxe={disabled:!1,size:"sm",transitionDuration:200},FQ=w.forwardRef((e,t)=>{var n,r,i,s;const o=ct("SegmentedControl",dxe,e),{className:a,disabled:u,data:l,name:c,value:f,onChange:d,color:h,fullWidth:p,radius:m,size:y,transitionDuration:g,transitionTimingFunction:_,classNames:b,styles:T,defaultValue:I,orientation:E,unstyled:S}=o,A=fxe(o,["className","disabled","data","name","value","onChange","color","fullWidth","radius","size","transitionDuration","transitionTimingFunction","classNames","styles","defaultValue","orientation","unstyled"]),P=ts(),V=lk(),M=P.respectReducedMotion?V:!1,H=l.map(ae=>typeof ae=="string"?{label:ae,value:ae}:ae),J=w.useRef(),[Y,ye]=w.useState(!1),[he,ve]=Oa({value:f,defaultValue:I,finalValue:Array.isArray(H)&&(s=(i=(n=H.find(ae=>!ae.disabled))==null?void 0:n.value)!=null?i:(r=H[0])==null?void 0:r.value)!=null?s:null,onChange:d}),{classes:te,cx:se}=uxe({size:y,fullWidth:p,color:h,radius:m,shouldAnimate:M||!Y,transitionDuration:g,transitionTimingFunction:_,orientation:E},{classNames:b,styles:T,unstyled:S,name:"SegmentedControl"}),[K,x]=w.useState({width:0,height:0,translate:[0,0]}),C=Fu(c),z=w.useRef({}),[R,O]=QW();uk(()=>{J.current?ye(!0):(J.current=!0,ye(!1))}),w.useEffect(()=>{if(he in z.current&&R.current){const ae=z.current[he],pe=ae.getBoundingClientRect(),me=ae.offsetWidth/pe.width,Se=pe.width*me||0,ce=pe.height*me||0,st=O.width-ae.parentElement.offsetLeft+tb-Se,Ke=ae.parentElement.offsetLeft-tb;x({width:Se,height:ce,translate:[P.dir==="rtl"?st:Ke,ae.parentElement.offsetTop-tb]})}},[he,O]);const q=H.map(ae=>k.createElement("div",{className:se(te.control,{[te.controlActive]:he===ae.value}),key:ae.value},k.createElement("input",{className:te.input,disabled:u||ae.disabled,type:"radio",name:C,value:ae.value,id:`${C}-${ae.value}`,checked:he===ae.value,onChange:()=>ve(ae.value)}),k.createElement("label",{className:se(te.label,{[te.labelActive]:he===ae.value,[te.disabled]:u||ae.disabled}),htmlFor:`${C}-${ae.value}`,ref:pe=>{z.current[ae.value]=pe}},ae.label))),le=Ko(R,t);return H.length===0?null:k.createElement(ut,cxe({className:se(te.root,a),ref:le},A),typeof he=="string"&&Y&&k.createElement(ut,{component:"span",className:te.active,sx:{width:K.width,height:K.height,transform:`translate(${K.translate[0]}px, ${K.translate[1]}px )`}}),q)});FQ.displayName="@mantine/core/SegmentedControl";function hxe({data:e,searchable:t,limit:n,searchValue:r,filter:i,value:s,filterDataOnExactSearchMatch:o}){if(!t)return e;const a=s!=null&&e.find(l=>l.value===s)||null;if(a&&!o&&(a==null?void 0:a.label)===r)return e;const u=[];for(let l=0;l=n));l+=1);return u}var pxe=at(()=>({input:{"&:not(:disabled)":{cursor:"pointer","&::selection":{backgroundColor:"transparent"}}}}));const mxe=pxe;var gxe=Object.defineProperty,yxe=Object.defineProperties,_xe=Object.getOwnPropertyDescriptors,Ow=Object.getOwnPropertySymbols,BQ=Object.prototype.hasOwnProperty,jQ=Object.prototype.propertyIsEnumerable,B8=(e,t,n)=>t in e?gxe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Pg=(e,t)=>{for(var n in t||(t={}))BQ.call(t,n)&&B8(e,n,t[n]);if(Ow)for(var n of Ow(t))jQ.call(t,n)&&B8(e,n,t[n]);return e},YC=(e,t)=>yxe(e,_xe(t)),vxe=(e,t)=>{var n={};for(var r in e)BQ.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Ow)for(var r of Ow(e))t.indexOf(r)<0&&jQ.call(e,r)&&(n[r]=e[r]);return n};function bxe(e,t){return t.label.toLowerCase().trim().includes(e.toLowerCase().trim())}function Exe(e,t){return!!e&&!t.some(n=>n.label.toLowerCase()===e.toLowerCase())}const wxe={required:!1,size:"sm",shadow:"sm",itemComponent:pk,transition:"fade",transitionDuration:0,initiallyOpened:!1,filter:bxe,maxDropdownHeight:220,searchable:!1,clearable:!1,limit:1/0,disabled:!1,creatable:!1,shouldCreate:Exe,selectOnBlur:!1,switchDirectionOnFlip:!1,filterDataOnExactSearchMatch:!1,zIndex:To("popover"),clearButtonTabIndex:0,positionDependencies:[],dropdownPosition:"flip"},UQ=w.forwardRef((e,t)=>{const n=XY("Select",wxe,e),{inputProps:r,wrapperProps:i,shadow:s,data:o,value:a,defaultValue:u,onChange:l,itemComponent:c,onKeyDown:f,onBlur:d,onFocus:h,transition:p,transitionDuration:m,initiallyOpened:y,transitionTimingFunction:g,unstyled:_,classNames:b,styles:T,filter:I,maxDropdownHeight:E,searchable:S,clearable:A,nothingFound:P,clearButtonLabel:V,limit:M,disabled:H,onSearchChange:J,searchValue:Y,rightSection:ye,rightSectionWidth:he,creatable:ve,getCreateLabel:te,shouldCreate:se,selectOnBlur:K,onCreate:x,dropdownComponent:C,onDropdownClose:z,onDropdownOpen:R,withinPortal:O,switchDirectionOnFlip:q,zIndex:le,name:ae,dropdownPosition:pe,allowDeselect:me,placeholder:Se,filterDataOnExactSearchMatch:ce,clearButtonTabIndex:st,form:Ke,positionDependencies:qe,readOnly:$e}=n,ot=vxe(n,["inputProps","wrapperProps","shadow","data","value","defaultValue","onChange","itemComponent","onKeyDown","onBlur","onFocus","transition","transitionDuration","initiallyOpened","transitionTimingFunction","unstyled","classNames","styles","filter","maxDropdownHeight","searchable","clearable","nothingFound","clearButtonLabel","limit","disabled","onSearchChange","searchValue","rightSection","rightSectionWidth","creatable","getCreateLabel","shouldCreate","selectOnBlur","onCreate","dropdownComponent","onDropdownClose","onDropdownOpen","withinPortal","switchDirectionOnFlip","zIndex","name","dropdownPosition","allowDeselect","placeholder","filterDataOnExactSearchMatch","clearButtonTabIndex","form","positionDependencies","readOnly"]),{classes:lt,cx:On,theme:Ue}=mxe(),[Be,bt]=w.useState(y),[je,gt]=w.useState(-1),Gt=w.useRef(),an=w.useRef({}),[Gn,ue]=w.useState("column"),we=Gn==="column",{scrollIntoView:Le,targetRef:rt,scrollableRef:De}=KW({duration:0,offset:5,cancelable:!1,isList:!0}),it=me===void 0?A:me,Me=Te=>{if(Be!==Te){bt(Te);const Ve=Te?R:z;typeof Ve=="function"&&Ve()}},Ze=ve&&typeof te=="function";let bn=null;const Wt=o.map(Te=>typeof Te=="string"?{label:Te,value:Te}:Te),It=hW({data:Wt}),[Bn,En,sa]=Oa({value:a,defaultValue:u,finalValue:null,onChange:l}),fr=It.find(Te=>Te.value===Bn),[Mi,vr]=Oa({value:Y,defaultValue:(fr==null?void 0:fr.label)||"",finalValue:void 0,onChange:J}),$r=Te=>{vr(Te),S&&typeof J=="function"&&J(Te)},dr=()=>{var Te;$e||(En(null),sa||$r(""),(Te=Gt.current)==null||Te.focus())};w.useEffect(()=>{const Te=It.find(Ve=>Ve.value===Bn);Te?$r(Te.label):(!Ze||!Bn)&&$r("")},[Bn]),w.useEffect(()=>{fr&&(!S||!Be)&&$r(fr.label)},[fr==null?void 0:fr.label]);const jn=Te=>{if(!$e)if(it&&(fr==null?void 0:fr.value)===Te.value)En(null),Me(!1);else{if(Te.creatable&&typeof x=="function"){const Ve=x(Te.value);typeof Ve<"u"&&Ve!==null&&En(typeof Ve=="string"?Ve:Ve.value)}else En(Te.value);sa||$r(Te.label),gt(-1),Me(!1),Gt.current.focus()}},Zt=hxe({data:It,searchable:S,limit:M,searchValue:Mi,filter:I,filterDataOnExactSearchMatch:ce,value:Bn});Ze&&se(Mi,Zt)&&(bn=te(Mi),Zt.push({label:Mi,value:Mi,creatable:!0}));const ri=(Te,Ve,ft)=>{let Je=Te;for(;ft(Je);)if(Je=Ve(Je),!Zt[Je].disabled)return Je;return Te};fo(()=>{gt(-1)},[Mi]);const br=Bn?Zt.findIndex(Te=>Te.value===Bn):0,Lr=!$e&&(Zt.length>0?Be:Be&&!!P),yi=()=>{gt(Te=>{var Ve;const ft=ri(Te,Je=>Je-1,Je=>Je>0);return rt.current=an.current[(Ve=Zt[ft])==null?void 0:Ve.value],Lr&&Le({alignment:we?"start":"end"}),ft})},ms=()=>{gt(Te=>{var Ve;const ft=ri(Te,Je=>Je+1,Je=>Jewindow.setTimeout(()=>{var Te;rt.current=an.current[(Te=Zt[br])==null?void 0:Te.value],Le({alignment:we?"end":"start"})},0);fo(()=>{Lr&&Q()},[Lr]);const j=Te=>{switch(typeof f=="function"&&f(Te),Te.key){case"ArrowUp":{Te.preventDefault(),Be?we?yi():ms():(gt(br),Me(!0),Q());break}case"ArrowDown":{Te.preventDefault(),Be?we?ms():yi():(gt(br),Me(!0),Q());break}case"Home":{if(!S){Te.preventDefault(),Be||Me(!0);const Ve=Zt.findIndex(ft=>!ft.disabled);gt(Ve),Lr&&Le({alignment:we?"end":"start"})}break}case"End":{if(!S){Te.preventDefault(),Be||Me(!0);const Ve=Zt.map(ft=>!!ft.disabled).lastIndexOf(!1);gt(Ve),Lr&&Le({alignment:we?"end":"start"})}break}case"Escape":{Te.preventDefault(),Me(!1),gt(-1);break}case" ":{S||(Te.preventDefault(),Zt[je]&&Be?jn(Zt[je]):(Me(!0),gt(br),Q()));break}case"Enter":S||Te.preventDefault(),Zt[je]&&Be&&(Te.preventDefault(),jn(Zt[je]))}},Z=Te=>{typeof d=="function"&&d(Te);const Ve=It.find(ft=>ft.value===Bn);K&&Zt[je]&&Be&&jn(Zt[je]),$r((Ve==null?void 0:Ve.label)||""),Me(!1)},de=Te=>{typeof h=="function"&&h(Te),S&&Me(!0)},fe=Te=>{$e||($r(Te.currentTarget.value),A&&Te.currentTarget.value===""&&En(null),gt(-1),Me(!0))},He=()=>{$e||(Me(!Be),Bn&&!Be&>(br))};return k.createElement(Bs.Wrapper,YC(Pg({},i),{__staticSelector:"Select"}),k.createElement(Bc,{opened:Lr,transition:p,transitionDuration:m,shadow:"sm",withinPortal:O,__staticSelector:"Select",onDirectionChange:ue,switchDirectionOnFlip:q,zIndex:le,dropdownPosition:pe,positionDependencies:qe,classNames:b,styles:T,unstyled:_},k.createElement(Bc.Target,null,k.createElement("div",{role:"combobox","aria-haspopup":"listbox","aria-owns":Lr?`${r.id}-items`:null,"aria-controls":r.id,"aria-expanded":Lr,onMouseLeave:()=>gt(-1),tabIndex:-1},k.createElement("input",{type:"hidden",name:ae,value:Bn||"",form:Ke,disabled:H}),k.createElement(Bs,Pg(YC(Pg(Pg({autoComplete:"off",type:"search"},r),ot),{ref:Ko(t,Gt),onKeyDown:j,__staticSelector:"Select",value:Mi,placeholder:Se,onChange:fe,"aria-autocomplete":"list","aria-controls":Lr?`${r.id}-items`:null,"aria-activedescendant":je>=0?`${r.id}-${je}`:null,onMouseDown:He,onBlur:Z,onFocus:de,readOnly:!S||$e,disabled:H,"data-mantine-stop-propagation":Lr,name:null,classNames:YC(Pg({},b),{input:On({[lt.input]:!S},b==null?void 0:b.input)})}),oQ({theme:Ue,rightSection:ye,rightSectionWidth:he,styles:T,size:r.size,shouldClear:A&&!!fr,clearButtonLabel:V,onClear:dr,error:i.error,clearButtonTabIndex:st,disabled:H,readOnly:$e}))))),k.createElement(Bc.Dropdown,{component:C||GS,maxHeight:E,direction:Gn,id:r.id,innerRef:De,__staticSelector:"Select",classNames:b,styles:T},k.createElement(hk,{data:Zt,hovered:je,classNames:b,styles:T,isItemSelected:Te=>Te===Bn,uuid:r.id,__staticSelector:"Select",onItemHover:gt,onItemSelect:jn,itemsRefs:an,itemComponent:c,size:r.size,nothingFound:P,creatable:Ze&&!!bn,createLabel:bn,"aria-label":i.label,unstyled:_}))))});UQ.displayName="@mantine/core/Select";function Pw({value:e,min:t,max:n}){const r=(e-t)/(n-t)*100;return Math.min(Math.max(r,0),100)}function zP({value:e,containerWidth:t,min:n,max:r,step:i,precision:s}){const a=(t?Math.min(Math.max(e,0),t)/t:e)*(r-n),u=(a!==0?Math.round(a/i)*i:0)+n,l=Math.max(u,n);return s!==void 0?Number(l.toFixed(s)):l}var Txe=Object.defineProperty,Sxe=Object.defineProperties,Ixe=Object.getOwnPropertyDescriptors,j8=Object.getOwnPropertySymbols,xxe=Object.prototype.hasOwnProperty,Cxe=Object.prototype.propertyIsEnumerable,U8=(e,t,n)=>t in e?Txe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Axe=(e,t)=>{for(var n in t||(t={}))xxe.call(t,n)&&U8(e,n,t[n]);if(j8)for(var n of j8(t))Cxe.call(t,n)&&U8(e,n,t[n]);return e},Oxe=(e,t)=>Sxe(e,Ixe(t));const Ps={xs:4,sm:6,md:8,lg:10,xl:12};var Pxe=at((e,{size:t,disabled:n})=>({root:Oxe(Axe({},e.fn.fontStyles()),{WebkitTapHighlightColor:"transparent",outline:0,height:e.fn.size({sizes:Ps,size:t})*2,display:"flex",alignItems:"center",cursor:n?"not-allowed":"pointer",touchAction:"none"})}));const Rxe=Pxe;var Nxe=Object.defineProperty,kxe=Object.defineProperties,Dxe=Object.getOwnPropertyDescriptors,V8=Object.getOwnPropertySymbols,$xe=Object.prototype.hasOwnProperty,Lxe=Object.prototype.propertyIsEnumerable,z8=(e,t,n)=>t in e?Nxe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Mxe=(e,t)=>{for(var n in t||(t={}))$xe.call(t,n)&&z8(e,n,t[n]);if(V8)for(var n of V8(t))Lxe.call(t,n)&&z8(e,n,t[n]);return e},Fxe=(e,t)=>kxe(e,Dxe(t)),Bxe=at((e,{color:t,size:n,disabled:r,thumbSize:i})=>({label:{position:"absolute",top:-36,backgroundColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[9],fontSize:e.fontSizes.xs,color:e.white,padding:`calc(${e.spacing.xs}px / 2)`,borderRadius:e.radius.sm,whiteSpace:"nowrap",pointerEvents:"none",userSelect:"none",touchAction:"none"},thumb:Fxe(Mxe({},e.fn.focusStyles()),{boxSizing:"border-box",position:"absolute",display:r?"none":"flex",height:i||e.fn.size({sizes:Ps,size:n})*2,width:i||e.fn.size({sizes:Ps,size:n})*2,backgroundColor:e.colorScheme==="dark"?e.fn.themeColor(t,e.fn.primaryShade()):e.white,border:`4px solid ${e.colorScheme==="dark"?e.white:e.fn.themeColor(t,e.fn.primaryShade())}`,color:e.colorScheme==="dark"?e.white:e.fn.themeColor(t,e.fn.primaryShade()),transform:"translate(-50%, -50%)",top:"50%",cursor:"pointer",borderRadius:1e3,alignItems:"center",justifyContent:"center",transitionDuration:"100ms",transitionProperty:"box-shadow, transform",transitionTimingFunction:e.transitionTimingFunction,zIndex:3,userSelect:"none",touchAction:"none"}),dragging:{transform:"translate(-50%, -50%) scale(1.05)",boxShadow:e.shadows.sm}}));const jxe=Bxe,Rw=w.forwardRef(({max:e,min:t,value:n,position:r,label:i,dragging:s,onMouseDown:o,color:a,classNames:u,styles:l,size:c,labelTransition:f,labelTransitionDuration:d,labelTransitionTimingFunction:h,labelAlwaysOn:p,thumbLabel:m,onFocus:y,onBlur:g,showLabelOnHover:_,children:b=null,disabled:T,unstyled:I,thumbSize:E},S)=>{const{classes:A,cx:P,theme:V}=jxe({color:a,size:c,disabled:T,thumbSize:E},{classNames:u,styles:l,unstyled:I,name:"Slider"}),[M,H]=w.useState(!1),J=p||s||M||_;return k.createElement(ut,{tabIndex:0,role:"slider","aria-label":m,"aria-valuemax":e,"aria-valuemin":t,"aria-valuenow":n,ref:S,className:P(A.thumb,{[A.dragging]:s}),onFocus:()=>{H(!0),typeof y=="function"&&y()},onBlur:()=>{H(!1),typeof g=="function"&&g()},onTouchStart:o,onMouseDown:o,onClick:Y=>Y.stopPropagation(),style:{[V.dir==="rtl"?"right":"left"]:`${r}%`}},b,k.createElement(XS,{mounted:i!=null&&J,duration:d,transition:f,timingFunction:h||V.transitionTimingFunction},Y=>k.createElement("div",{style:Y,className:A.label},i)))});Rw.displayName="@mantine/core/SliderThumb";function Uxe({mark:e,offset:t,value:n,inverted:r=!1}){return r?typeof t=="number"&&e.value<=t||e.value>=n:typeof t=="number"?e.value>=t&&e.value<=n:e.value<=n}var Vxe=at((e,{size:t,color:n,disabled:r})=>({markWrapper:{position:"absolute",top:0,zIndex:2},mark:{boxSizing:"border-box",border:`${e.fn.size({size:t,sizes:Ps})>=8?"2px":"1px"} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2]}`,height:e.fn.size({sizes:Ps,size:t}),width:e.fn.size({sizes:Ps,size:t}),borderRadius:1e3,transform:`translateX(-${e.fn.size({sizes:Ps,size:t})/2}px)`,backgroundColor:e.white},markFilled:{borderColor:r?e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[4]:e.fn.variant({variant:"filled",color:n}).background},markLabel:{transform:"translate(-50%, 0)",fontSize:e.fontSizes.sm,color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6],marginTop:`calc(${e.spacing.xs}px / 2)`,whiteSpace:"nowrap"}}));const zxe=Vxe;function VQ({marks:e,color:t,size:n,min:r,max:i,value:s,classNames:o,styles:a,offset:u,onChange:l,disabled:c,unstyled:f,inverted:d}){const{classes:h,cx:p}=zxe({size:n,color:t,disabled:c},{classNames:o,styles:a,unstyled:f,name:"Slider"}),m=e.map((y,g)=>k.createElement(ut,{className:h.markWrapper,sx:{left:`${Pw({value:y.value,min:r,max:i})}%`},key:g},k.createElement("div",{className:p(h.mark,{[h.markFilled]:Uxe({mark:y,value:s,offset:u,inverted:d})})}),y.label&&k.createElement("div",{className:h.markLabel,onMouseDown:_=>{_.stopPropagation(),l(y.value)},onTouchStart:_=>{_.stopPropagation(),l(y.value)}},y.label)));return k.createElement("div",null,m)}VQ.displayName="@mantine/core/SliderMarks";var Hxe=at((e,{radius:t,size:n,color:r,disabled:i,inverted:s})=>({track:{position:"relative",height:e.fn.size({sizes:Ps,size:n}),width:"100%",marginRight:e.fn.size({size:n,sizes:Ps}),marginLeft:e.fn.size({size:n,sizes:Ps}),"&::before":{content:'""',position:"absolute",top:0,bottom:0,borderRadius:e.fn.size({size:t,sizes:e.radius}),right:-e.fn.size({size:n,sizes:Ps}),left:-e.fn.size({size:n,sizes:Ps}),backgroundColor:s?i?e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[4]:e.fn.variant({variant:"filled",color:r}).background:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2],zIndex:0}},bar:{position:"absolute",zIndex:1,top:0,bottom:0,backgroundColor:s?e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2]:i?e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[4]:e.fn.variant({variant:"filled",color:r}).background,borderRadius:e.fn.size({size:t,sizes:e.radius})}}));const Wxe=Hxe;var qxe=Object.defineProperty,Yxe=Object.defineProperties,Gxe=Object.getOwnPropertyDescriptors,Nw=Object.getOwnPropertySymbols,zQ=Object.prototype.hasOwnProperty,HQ=Object.prototype.propertyIsEnumerable,H8=(e,t,n)=>t in e?qxe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Kxe=(e,t)=>{for(var n in t||(t={}))zQ.call(t,n)&&H8(e,n,t[n]);if(Nw)for(var n of Nw(t))HQ.call(t,n)&&H8(e,n,t[n]);return e},Qxe=(e,t)=>Yxe(e,Gxe(t)),Xxe=(e,t)=>{var n={};for(var r in e)zQ.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Nw)for(var r of Nw(e))t.indexOf(r)<0&&HQ.call(e,r)&&(n[r]=e[r]);return n};function kk(e){var t=e,{filled:n,size:r,color:i,classNames:s,styles:o,radius:a,children:u,offset:l,onMouseLeave:c,onMouseEnter:f,disabled:d,marksOffset:h,unstyled:p,inverted:m}=t,y=Xxe(t,["filled","size","color","classNames","styles","radius","children","offset","onMouseLeave","onMouseEnter","disabled","marksOffset","unstyled","inverted"]);const{classes:g}=Wxe({color:i,size:r,radius:a,disabled:d,inverted:m},{classNames:s,styles:o,unstyled:p,name:"Slider"});return k.createElement("div",{className:g.track,onMouseLeave:c,onMouseEnter:f},k.createElement(ut,{className:g.bar,sx:_=>({left:`calc(${l}% - ${_.fn.size({size:r,sizes:Ps})}px)`,width:`calc(${n}% + ${_.fn.size({size:r,sizes:Ps})}px)`})}),u,k.createElement(VQ,Qxe(Kxe({},y),{size:r,color:i,offset:h,classNames:s,styles:o,disabled:d,unstyled:p,inverted:m})))}kk.displayName="@mantine/core/SliderTrack";var Jxe=Object.defineProperty,Zxe=Object.defineProperties,eCe=Object.getOwnPropertyDescriptors,kw=Object.getOwnPropertySymbols,WQ=Object.prototype.hasOwnProperty,qQ=Object.prototype.propertyIsEnumerable,W8=(e,t,n)=>t in e?Jxe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,tCe=(e,t)=>{for(var n in t||(t={}))WQ.call(t,n)&&W8(e,n,t[n]);if(kw)for(var n of kw(t))qQ.call(t,n)&&W8(e,n,t[n]);return e},nCe=(e,t)=>Zxe(e,eCe(t)),rCe=(e,t)=>{var n={};for(var r in e)WQ.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&kw)for(var r of kw(e))t.indexOf(r)<0&&qQ.call(e,r)&&(n[r]=e[r]);return n};const Dk=w.forwardRef((e,t)=>{var n=e,{className:r,size:i,classNames:s,styles:o,disabled:a,unstyled:u}=n,l=rCe(n,["className","size","classNames","styles","disabled","unstyled"]);const{classes:c,cx:f}=Rxe({size:i,disabled:a},{classNames:s,styles:o,unstyled:u,name:"Slider"});return k.createElement(ut,nCe(tCe({},l),{tabIndex:-1,className:f(c.root,r),ref:t}))});Dk.displayName="@mantine/core/SliderRoot";var iCe=Object.defineProperty,sCe=Object.defineProperties,oCe=Object.getOwnPropertyDescriptors,Dw=Object.getOwnPropertySymbols,YQ=Object.prototype.hasOwnProperty,GQ=Object.prototype.propertyIsEnumerable,q8=(e,t,n)=>t in e?iCe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,aCe=(e,t)=>{for(var n in t||(t={}))YQ.call(t,n)&&q8(e,n,t[n]);if(Dw)for(var n of Dw(t))GQ.call(t,n)&&q8(e,n,t[n]);return e},uCe=(e,t)=>sCe(e,oCe(t)),lCe=(e,t)=>{var n={};for(var r in e)YQ.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Dw)for(var r of Dw(e))t.indexOf(r)<0&&GQ.call(e,r)&&(n[r]=e[r]);return n};const cCe={size:"md",radius:"xl",min:0,max:100,step:1,marks:[],label:e=>e,labelTransition:"skew-down",labelTransitionDuration:0,labelAlwaysOn:!1,thumbLabel:"",showLabelOnHover:!0,disabled:!1,scale:e=>e},KQ=w.forwardRef((e,t)=>{const n=ct("Slider",cCe,e),{classNames:r,styles:i,color:s,value:o,onChange:a,onChangeEnd:u,size:l,radius:c,min:f,max:d,step:h,precision:p,defaultValue:m,name:y,marks:g,label:_,labelTransition:b,labelTransitionDuration:T,labelTransitionTimingFunction:I,labelAlwaysOn:E,thumbLabel:S,showLabelOnHover:A,thumbChildren:P,disabled:V,unstyled:M,thumbSize:H,scale:J,inverted:Y}=n,ye=lCe(n,["classNames","styles","color","value","onChange","onChangeEnd","size","radius","min","max","step","precision","defaultValue","name","marks","label","labelTransition","labelTransitionDuration","labelTransitionTimingFunction","labelAlwaysOn","thumbLabel","showLabelOnHover","thumbChildren","disabled","unstyled","thumbSize","scale","inverted"]),he=ts(),[ve,te]=w.useState(!1),[se,K]=Oa({value:typeof o=="number"?Mc(o,f,d):o,defaultValue:typeof m=="number"?Mc(m,f,d):m,finalValue:Mc(0,f,d),onChange:a}),x=w.useRef(se),C=w.useRef(),z=Pw({value:se,min:f,max:d}),R=J(se),O=typeof _=="function"?_(R):_,q=w.useCallback(({x:Se})=>{if(!V){const ce=zP({value:Se,min:f,max:d,step:h,precision:p});K(ce),x.current=ce}},[V,f,d,h,p]),{ref:le,active:ae}=GW(q,{onScrubEnd:()=>u==null?void 0:u(x.current)},he.dir),pe=Se=>{Se.stopPropagation()},me=Se=>{if(!V)switch(Se.key){case"ArrowUp":{Se.preventDefault(),C.current.focus();const ce=Math.min(Math.max(se+h,f),d);u==null||u(ce),K(ce);break}case"ArrowRight":{Se.preventDefault(),C.current.focus();const ce=Math.min(Math.max(he.dir==="rtl"?se-h:se+h,f),d);u==null||u(ce),K(ce);break}case"ArrowDown":{Se.preventDefault(),C.current.focus();const ce=Math.min(Math.max(se-h,f),d);u==null||u(ce),K(ce);break}case"ArrowLeft":{Se.preventDefault(),C.current.focus();const ce=Math.min(Math.max(he.dir==="rtl"?se+h:se-h,f),d);u==null||u(ce),K(ce);break}case"Home":{Se.preventDefault(),C.current.focus(),u==null||u(f),K(f);break}case"End":{Se.preventDefault(),C.current.focus(),u==null||u(d),K(d);break}}};return k.createElement(Dk,uCe(aCe({},ye),{size:l,ref:Ko(le,t),onKeyDownCapture:me,onMouseDownCapture:()=>{var Se;return(Se=le.current)==null?void 0:Se.focus()},classNames:r,styles:i,disabled:V,unstyled:M}),k.createElement(kk,{inverted:Y,offset:0,filled:z,marks:g,size:l,radius:c,color:s,min:f,max:d,value:R,onChange:K,onMouseEnter:A?()=>te(!0):void 0,onMouseLeave:A?()=>te(!1):void 0,classNames:r,styles:i,disabled:V,unstyled:M},k.createElement(Rw,{max:d,min:f,value:R,position:z,dragging:ae,color:s,size:l,label:O,ref:C,onMouseDown:pe,labelTransition:b,labelTransitionDuration:T,labelTransitionTimingFunction:I,labelAlwaysOn:E,classNames:r,styles:i,thumbLabel:S,showLabelOnHover:A&&ve,disabled:V,unstyled:M,thumbSize:H},P)),k.createElement("input",{type:"hidden",name:y,value:R}))});KQ.displayName="@mantine/core/Slider";function fCe(e){return"TouchEvent"in window&&e instanceof window.TouchEvent?e.touches[0].clientX:e.clientX}var dCe=Object.defineProperty,hCe=Object.defineProperties,pCe=Object.getOwnPropertyDescriptors,$w=Object.getOwnPropertySymbols,QQ=Object.prototype.hasOwnProperty,XQ=Object.prototype.propertyIsEnumerable,Y8=(e,t,n)=>t in e?dCe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,GC=(e,t)=>{for(var n in t||(t={}))QQ.call(t,n)&&Y8(e,n,t[n]);if($w)for(var n of $w(t))XQ.call(t,n)&&Y8(e,n,t[n]);return e},KC=(e,t)=>hCe(e,pCe(t)),mCe=(e,t)=>{var n={};for(var r in e)QQ.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&$w)for(var r of $w(e))t.indexOf(r)<0&&XQ.call(e,r)&&(n[r]=e[r]);return n};const gCe={size:"md",radius:"xl",min:0,max:100,minRange:10,step:1,marks:[],label:e=>e,labelTransition:"skew-down",labelTransitionDuration:0,labelAlwaysOn:!1,thumbFromLabel:"",thumbToLabel:"",showLabelOnHover:!0,disabled:!1,scale:e=>e},JQ=w.forwardRef((e,t)=>{const n=ct("RangeSlider",gCe,e),{classNames:r,styles:i,color:s,value:o,onChange:a,onChangeEnd:u,size:l,radius:c,min:f,max:d,minRange:h,step:p,precision:m,defaultValue:y,name:g,marks:_,label:b,labelTransition:T,labelTransitionDuration:I,labelTransitionTimingFunction:E,labelAlwaysOn:S,thumbFromLabel:A,thumbToLabel:P,showLabelOnHover:V,thumbChildren:M,disabled:H,unstyled:J,thumbSize:Y,scale:ye,inverted:he}=n,ve=mCe(n,["classNames","styles","color","value","onChange","onChangeEnd","size","radius","min","max","minRange","step","precision","defaultValue","name","marks","label","labelTransition","labelTransitionDuration","labelTransitionTimingFunction","labelAlwaysOn","thumbFromLabel","thumbToLabel","showLabelOnHover","thumbChildren","disabled","unstyled","thumbSize","scale","inverted"]),te=ts(),[se,K]=w.useState(-1),[x,C]=w.useState(!1),[z,R]=Oa({value:o,defaultValue:y,finalValue:[f,d],onChange:a}),O=w.useRef(z),q=w.useRef([]),le=w.useRef(void 0),ae=[Pw({value:z[0],min:f,max:d}),Pw({value:z[1],min:f,max:d})],pe=Ue=>{R(Ue),O.current=Ue};w.useEffect(()=>{Array.isArray(o)&&(O.current=o)},Array.isArray(o)?[o[0],o[1]]:[null,null]);const me=(Ue,Be,bt)=>{const je=[...O.current];je[Be]=Ue,Be===0&&(Ue>je[1]-(h-1e-9)&&(je[1]=Math.min(Ue+h,d)),Ue>(d-(h-1e-9)||f)&&(je[Be]=O.current[Be])),Be===1&&(Ue{if(!H){const Be=zP({value:Ue,min:f,max:d,step:p,precision:m});me(Be,le.current,!1)}},{ref:ce,active:st}=GW(({x:Ue})=>Se(Ue),{onScrubEnd:()=>u==null?void 0:u(O.current)},te.dir);function Ke(Ue,Be){Ue.stopPropagation(),le.current=Be}const qe=Ue=>{ce.current.focus();const Be=ce.current.getBoundingClientRect(),bt=fCe(Ue.nativeEvent),je=zP({value:bt-Be.left,max:d,min:f,step:p,containerWidth:Be.width}),gt=Math.abs(z[0]-je)>Math.abs(z[1]-je)?1:0,Gt=te.dir==="ltr"?gt:gt===1?0:1;le.current=Gt},$e=()=>se!==1&&se!==0?(K(0),0):se,ot=Ue=>{if(!H)switch(Ue.key){case"ArrowUp":{Ue.preventDefault();const Be=$e();q.current[Be].focus(),me(Math.min(Math.max(O.current[Be]+p,f),d),Be,!0);break}case"ArrowRight":{Ue.preventDefault();const Be=$e();q.current[Be].focus(),me(Math.min(Math.max(te.dir==="rtl"?O.current[Be]-p:O.current[Be]+p,f),d),Be,!0);break}case"ArrowDown":{Ue.preventDefault();const Be=$e();q.current[Be].focus(),me(Math.min(Math.max(O.current[Be]-p,f),d),Be,!0);break}case"ArrowLeft":{Ue.preventDefault();const Be=$e();q.current[Be].focus(),me(Math.min(Math.max(te.dir==="rtl"?O.current[Be]+p:O.current[Be]-p,f),d),Be,!0);break}}},lt={max:d,min:f,color:s,size:l,labelTransition:T,labelTransitionDuration:I,labelTransitionTimingFunction:E,labelAlwaysOn:S,onBlur:()=>K(-1),classNames:r,styles:i},On=Array.isArray(M);return k.createElement(Dk,KC(GC({},ve),{size:l,ref:Ko(ce,t),onTouchStartCapture:qe,onTouchEndCapture:()=>{le.current=-1},onMouseDownCapture:qe,onMouseUpCapture:()=>{le.current=-1},onKeyDownCapture:ot,styles:i,classNames:r,disabled:H,unstyled:J}),k.createElement(kk,{offset:ae[0],marksOffset:z[0],filled:ae[1]-ae[0],marks:_,inverted:he,size:l,radius:c,color:s,min:f,max:d,value:z[1],styles:i,classNames:r,onMouseEnter:V?()=>C(!0):void 0,onMouseLeave:V?()=>C(!1):void 0,onChange:Ue=>{const Be=Math.abs(z[0]-Ue)>Math.abs(z[1]-Ue)?1:0,bt=[...z];bt[Be]=Ue,pe(bt)},disabled:H,unstyled:J},k.createElement(Rw,KC(GC({},lt),{value:ye(z[0]),position:ae[0],dragging:st,label:typeof b=="function"?b(ye(z[0])):b,ref:Ue=>{q.current[0]=Ue},thumbLabel:A,onMouseDown:Ue=>Ke(Ue,0),onFocus:()=>K(0),showLabelOnHover:V&&x,disabled:H,unstyled:J,thumbSize:Y}),On?M[0]:M),k.createElement(Rw,KC(GC({},lt),{thumbLabel:P,value:ye(z[1]),position:ae[1],dragging:st,label:typeof b=="function"?b(ye(z[1])):b,ref:Ue=>{q.current[1]=Ue},onMouseDown:Ue=>Ke(Ue,1),onFocus:()=>K(1),showLabelOnHover:V&&x,disabled:H,unstyled:J,thumbSize:Y}),On?M[1]:M)),k.createElement("input",{type:"hidden",name:`${g}_from`,value:z[0]}),k.createElement("input",{type:"hidden",name:`${g}_to`,value:z[1]}))});JQ.displayName="@mantine/core/RangeSlider";var yCe=Object.defineProperty,Lw=Object.getOwnPropertySymbols,ZQ=Object.prototype.hasOwnProperty,eX=Object.prototype.propertyIsEnumerable,G8=(e,t,n)=>t in e?yCe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_Ce=(e,t)=>{for(var n in t||(t={}))ZQ.call(t,n)&&G8(e,n,t[n]);if(Lw)for(var n of Lw(t))eX.call(t,n)&&G8(e,n,t[n]);return e},vCe=(e,t)=>{var n={};for(var r in e)ZQ.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Lw)for(var r of Lw(e))t.indexOf(r)<0&&eX.call(e,r)&&(n[r]=e[r]);return n};const bCe={w:0,h:0},Jp=w.forwardRef((e,t)=>{const n=ct("Space",bCe,e),{w:r,h:i,sx:s}=n,o=vCe(n,["w","h","sx"]);return k.createElement(ut,_Ce({ref:t,sx:[a=>{const u=a.fn.size({size:r,sizes:a.spacing}),l=a.fn.size({size:i,sizes:a.spacing});return{width:u,height:l,minWidth:u,minHeight:l}},...Rd(s)]},o))});Jp.displayName="@mantine/core/Space";var ECe=Object.defineProperty,wCe=Object.defineProperties,TCe=Object.getOwnPropertyDescriptors,K8=Object.getOwnPropertySymbols,SCe=Object.prototype.hasOwnProperty,ICe=Object.prototype.propertyIsEnumerable,Q8=(e,t,n)=>t in e?ECe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,xCe=(e,t)=>{for(var n in t||(t={}))SCe.call(t,n)&&Q8(e,n,t[n]);if(K8)for(var n of K8(t))ICe.call(t,n)&&Q8(e,n,t[n]);return e},CCe=(e,t)=>wCe(e,TCe(t));function ACe(e,t,n){return typeof e<"u"?e in n.headings.sizes?n.headings.sizes[e].fontSize:e:n.headings.sizes[t].fontSize}function OCe(e,t,n){return typeof e<"u"&&e in n.headings.sizes?n.headings.sizes[e].lineHeight:n.headings.sizes[t].lineHeight}var PCe=at((e,{element:t,weight:n,size:r,inline:i})=>({root:CCe(xCe({},e.fn.fontStyles()),{fontFamily:e.headings.fontFamily,fontWeight:n||e.headings.sizes[t].fontWeight||e.headings.fontWeight,fontSize:ACe(r,t,e),lineHeight:i?1:OCe(r,t,e),margin:0})}));const RCe=PCe;var NCe=Object.defineProperty,Mw=Object.getOwnPropertySymbols,tX=Object.prototype.hasOwnProperty,nX=Object.prototype.propertyIsEnumerable,X8=(e,t,n)=>t in e?NCe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,kCe=(e,t)=>{for(var n in t||(t={}))tX.call(t,n)&&X8(e,n,t[n]);if(Mw)for(var n of Mw(t))nX.call(t,n)&&X8(e,n,t[n]);return e},DCe=(e,t)=>{var n={};for(var r in e)tX.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Mw)for(var r of Mw(e))t.indexOf(r)<0&&nX.call(e,r)&&(n[r]=e[r]);return n};const $Ce={order:1},cc=w.forwardRef((e,t)=>{const n=ct("Title",$Ce,e),{className:r,order:i,children:s,unstyled:o,size:a,weight:u,inline:l}=n,c=DCe(n,["className","order","children","unstyled","size","weight","inline"]),{classes:f,cx:d}=RCe({element:`h${i}`,weight:u,size:a,inline:l},{name:"Title",unstyled:o});return[1,2,3,4,5,6].includes(i)?k.createElement(Tt,kCe({component:`h${i}`,ref:t,className:d(f.root,r)},c),s):null});cc.displayName="@mantine/core/Title";var LCe=Object.defineProperty,MCe=Object.defineProperties,FCe=Object.getOwnPropertyDescriptors,J8=Object.getOwnPropertySymbols,BCe=Object.prototype.hasOwnProperty,jCe=Object.prototype.propertyIsEnumerable,Z8=(e,t,n)=>t in e?LCe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Zv=(e,t)=>{for(var n in t||(t={}))BCe.call(t,n)&&Z8(e,n,t[n]);if(J8)for(var n of J8(t))jCe.call(t,n)&&Z8(e,n,t[n]);return e},e1=(e,t)=>MCe(e,FCe(t)),UCe=at(e=>{const t=hde(e.headings.sizes).reduce((n,r)=>{const i=e.headings.sizes[r];return n[`& ${r}`]=e1(Zv({fontFamily:e.headings.fontFamily,fontWeight:i.fontWeight||e.headings.fontWeight,marginTop:typeof i.lineHeight=="number"?`calc(${e.spacing.xl}px * ${i.lineHeight})`:e.spacing.xl,marginBottom:e.spacing.sm},i),{"@media (max-width: 755px)":{fontSize:typeof i.fontSize=="number"&&i.fontSize/1.3}}),n},{});return{root:e1(Zv(e1(Zv({},e.fn.fontStyles()),{color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,lineHeight:e.lineHeight,fontSize:e.fontSizes.md,"@media (max-width: 755px)":{fontSize:e.fontSizes.sm}}),t),{"& .ql-align-center":{textAlign:"center"},"& .ql-align-right":{textAlign:"right"},"& .ql-align-left":{textAlign:"left"},"& img":{maxWidth:"100%",marginBottom:e.spacing.xs},"& p":{marginTop:0,marginBottom:e.spacing.lg},"& mark":{backgroundColor:e.fn.themeColor("yellow",e.colorScheme==="dark"?5:2),color:e.colorScheme==="dark"?e.colors.dark[9]:"inherit"},"& hr":{marginTop:e.spacing.md,marginBottom:e.spacing.sm,borderBottom:0,borderLeft:0,borderRight:0,borderTop:`1px dashed ${e.colors.gray[e.colorScheme==="dark"?4:6]}`},"& a":e1(Zv({},e.fn.focusStyles()),{color:e.colors[e.primaryColor][e.colorScheme==="dark"?4:6],textDecoration:"none","&:hover":{textDecoration:"underline"}}),"& pre":{padding:e.spacing.xs,lineHeight:e.lineHeight,margin:0,marginTop:e.spacing.md,marginBottom:e.spacing.md,overflowX:"auto",fontFamily:e.fontFamilyMonospace,fontSize:e.fontSizes.sm,borderRadius:e.radius.sm,backgroundColor:e.colorScheme==="dark"?e.colors.dark[8]:e.colors.gray[0],"& code":{backgroundColor:"transparent",padding:0,borderRadius:0,color:"inherit",border:0}},"& code":{lineHeight:e.lineHeight,padding:`1px calc(${e.spacing.xs}px / 1)`,borderRadius:e.radius.sm,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,backgroundColor:e.colorScheme==="dark"?e.colors.dark[9]:e.colors.gray[0],fontFamily:e.fontFamilyMonospace,fontSize:e.fontSizes.xs,border:`1px solid ${e.colorScheme==="dark"?e.colors.dark[9]:e.colors.gray[3]}`},"& ul, & ol":{marginBottom:e.spacing.md,paddingLeft:`calc(${e.spacing.lg}px * 2)`,"& li":{marginTop:e.spacing.xs}},"& table":{width:"100%",borderCollapse:"collapse",captionSide:"bottom",marginBottom:e.spacing.md,"& caption":{marginTop:e.spacing.xs,fontSize:e.fontSizes.sm,color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6]},"& th":{textAlign:"left",fontWeight:"bold",color:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[7],fontSize:14,padding:"7px 10px"},"& thead th":{borderBottom:`1px solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3]}`},"& tfoot th":{borderTop:`1px solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3]}`},"& td":{padding:"7px 10px",borderBottom:`1px solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3]}`,fontSize:14},"& tr:last-of-type td":{borderBottom:"none"}},"& blockquote":{fontSize:e.fontSizes.lg,lineHeight:e.lineHeight,margin:`${e.spacing.md}px 0`,borderTopRightRadius:e.radius.sm,borderBottomRightRadius:e.radius.sm,padding:`${e.spacing.md}px ${e.spacing.lg}px`,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,"& cite":{display:"block",fontSize:e.fontSizes.sm,marginTop:e.spacing.xs,color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6],overflow:"hidden",textOverflow:"ellipsis"}}})}});const VCe=UCe;var zCe=Object.defineProperty,Fw=Object.getOwnPropertySymbols,rX=Object.prototype.hasOwnProperty,iX=Object.prototype.propertyIsEnumerable,e9=(e,t,n)=>t in e?zCe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,HCe=(e,t)=>{for(var n in t||(t={}))rX.call(t,n)&&e9(e,n,t[n]);if(Fw)for(var n of Fw(t))iX.call(t,n)&&e9(e,n,t[n]);return e},WCe=(e,t)=>{var n={};for(var r in e)rX.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Fw)for(var r of Fw(e))t.indexOf(r)<0&&iX.call(e,r)&&(n[r]=e[r]);return n};const HP=w.forwardRef((e,t)=>{const n=ct("TypographyStylesProvider",{},e),{className:r,unstyled:i}=n,s=WCe(n,["className","unstyled"]),{classes:o,cx:a}=VCe(null,{name:"TypographyStylesProvider",unstyled:i});return k.createElement(ut,HCe({className:a(o.root,r),ref:t},s))});HP.displayName="@mantine/core/TypographyStylesProvider";function WP(e){const t=e.split("/")||[];return t[t.length-1].replace(/\.[^\.]+$/,"").replace(".","_").replace(" ","_").replace("/","_")}const Bu="/viz-guardrails-study/",qCe="https://github.com/revisit-studies/study/tree/main/public/";function YCe({globalConfig:e,studyConfigs:t}){const{configsList:n}=e,r=Qd();return $.jsxs(GG,{size:"xs",px:"xs",style:{marginTop:100,marginBottom:100},children:[$.jsx(A_,{maw:150,mx:"auto",mb:"xl",radius:"md",src:`${Bu}assets/revisitLogoSquare.svg`,alt:"reVISit"}),$.jsx(Tt,{children:"Select an experiment to launch:"}),n.map(i=>{const s=t[i];if(!s)return null;const o=WP(i);return $.jsx(ck,{onClick:()=>{r(`/${o}`)},my:"sm",style:{width:"100%"},children:$.jsxs(obe,{shadow:"sm",radius:"md",withBorder:!0,children:[$.jsx(Tt,{fw:"bold",children:s.studyMetadata.title}),$.jsxs(Tt,{c:"dimmed",children:["Authors:",s.studyMetadata.authors]}),$.jsx(Tt,{c:"dimmed",children:s.studyMetadata.description}),$.jsx(Tt,{c:"dimmed",ta:"right",style:{paddingRight:5},children:$.jsxs(Nq,{target:"_blank",onClick:a=>a.stopPropagation(),href:`${qCe}${o}`,children:["View source:"," ",o]})})]})},i)})]})}var sX={exports:{}},oX={};/** + `};function Dpe(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function $pe(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}function Lpe(){const e=document.createElement("style");return e.type="text/css",e.setAttribute("mantine-scroll-lock",""),e}function Mpe(e,t={disableBodyPadding:!1}){const[n,r]=w.useState(e||!1),i=w.useRef(0),{disableBodyPadding:s}=t,o=w.useRef(null),a=()=>{i.current=window.scrollY;const l=kpe({disableBodyPadding:s}),c=Lpe();Dpe(c,l),$pe(c),o.current=c},u=()=>{o!=null&&o.current&&(o.current.parentNode.removeChild(o.current),o.current=null)};return w.useEffect(()=>(n?a():u(),u),[n]),w.useEffect(()=>{e!==void 0&&r(e)},[e]),w.useEffect(()=>{e===void 0&&typeof window<"u"&&window.document.body.style.overflow==="hidden"&&r(!0)},[r]),[n,r]}function Fpe(){const{userAgent:e}=window.navigator,t=/(Macintosh)|(MacIntel)|(MacPPC)|(Mac68K)/i,n=/(Win32)|(Win64)|(Windows)|(WinCE)/i,r=/(iPhone)|(iPad)|(iPod)/i;return t.test(e)?"macos":r.test(e)?"ios":n.test(e)?"windows":/Android/i.test(e)?"android":/Linux/i.test(e)?"linux":"undetermined"}function Bpe(){return typeof window<"u"?Fpe():"undetermined"}function jpe(e){return t=>{if(!t)e(t);else if(typeof t=="function")e(t);else if(typeof t=="object"&&"nativeEvent"in t){const{currentTarget:n}=t;n.type==="checkbox"?e(n.checked):e(n.value)}else e(t)}}function Upe(e){const[t,n]=w.useState(e);return[t,jpe(n)]}function QW(e,t){const[n,r]=w.useState(e),i=()=>{var a;n||(r(!0),(a=t==null?void 0:t.onOpen)==null||a.call(t))},s=()=>{var a;n&&(r(!1),(a=t==null?void 0:t.onClose)==null||a.call(t))};return[n,{open:i,close:s,toggle:()=>{n?s():i()}}]}function Vpe(){return`mantine-${Math.random().toString(36).slice(2,11)}`}var e4=Object.getOwnPropertySymbols,zpe=Object.prototype.hasOwnProperty,Hpe=Object.prototype.propertyIsEnumerable,Wpe=(e,t)=>{var n={};for(var r in e)zpe.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&e4)for(var r of e4(e))t.indexOf(r)<0&&Hpe.call(e,r)&&(n[r]=e[r]);return n};function Xd(e){const t=e,{m:n,mx:r,my:i,mt:s,mb:o,ml:a,mr:u,p:l,px:c,py:f,pt:d,pb:h,pl:p,pr:m,bg:y,c:g,opacity:_,ff:b,fz:T,fw:I,lts:E,ta:S,lh:A,fs:P,tt:V,td:M,w:H,miw:J,maw:Y,h:ye,mih:he,mah:ve,bgsz:te,bgp:se,bgr:K,bga:x,pos:C,top:z,left:R,bottom:O,right:q,inset:le,display:ae}=t,pe=Wpe(t,["m","mx","my","mt","mb","ml","mr","p","px","py","pt","pb","pl","pr","bg","c","opacity","ff","fz","fw","lts","ta","lh","fs","tt","td","w","miw","maw","h","mih","mah","bgsz","bgp","bgr","bga","pos","top","left","bottom","right","inset","display"]);return{systemStyles:$W({m:n,mx:r,my:i,mt:s,mb:o,ml:a,mr:u,p:l,px:c,py:f,pt:d,pb:h,pl:p,pr:m,bg:y,c:g,opacity:_,ff:b,fz:T,fw:I,lts:E,ta:S,lh:A,fs:P,tt:V,td:M,w:H,miw:J,maw:Y,h:ye,mih:he,mah:ve,bgsz:te,bgp:se,bgr:K,bga:x,pos:C,top:z,left:R,bottom:O,right:q,inset:le,display:ae}),rest:pe}}function qpe(e,t){const n=Object.keys(e).filter(r=>r!=="base").sort((r,i)=>t.fn.size({size:r,sizes:t.breakpoints})-t.fn.size({size:i,sizes:t.breakpoints}));return"base"in e?["base",...n]:n}function Ype({value:e,theme:t,getValue:n,property:r}){if(e==null)return;if(typeof e=="object")return qpe(e,t).reduce((o,a)=>{if(a==="base"&&e.base!==void 0){const l=n(e.base,t);return Array.isArray(r)?(r.forEach(c=>{o[c]=l}),o):(o[r]=l,o)}const u=n(e[a],t);return Array.isArray(r)?(o[t.fn.largerThan(a)]={},r.forEach(l=>{o[t.fn.largerThan(a)][l]=u}),o):(o[t.fn.largerThan(a)]={[r]:u},o)},{});const i=n(e,t);return Array.isArray(r)?r.reduce((s,o)=>(s[o]=i,s),{}):{[r]:i}}function Gpe(e,t){return e==="dimmed"?t.colorScheme==="dark"?t.colors.dark[2]:t.colors.gray[6]:t.fn.variant({variant:"filled",color:e,primaryFallback:!1}).background}function Kpe(e){return e}function Qpe(e,t){return t.fn.size({size:e,sizes:t.fontSizes})}const Xpe=["-xs","-sm","-md","-lg","-xl"];function Jpe(e,t){return Xpe.includes(e)?t.fn.size({size:e.replace("-",""),sizes:t.spacing})*-1:t.fn.size({size:e,sizes:t.spacing})}const Zpe={color:Gpe,default:Kpe,fontSize:Qpe,spacing:Jpe},eme={m:{type:"spacing",property:"margin"},mt:{type:"spacing",property:"marginTop"},mb:{type:"spacing",property:"marginBottom"},ml:{type:"spacing",property:"marginLeft"},mr:{type:"spacing",property:"marginRight"},mx:{type:"spacing",property:["marginRight","marginLeft"]},my:{type:"spacing",property:["marginTop","marginBottom"]},p:{type:"spacing",property:"padding"},pt:{type:"spacing",property:"paddingTop"},pb:{type:"spacing",property:"paddingBottom"},pl:{type:"spacing",property:"paddingLeft"},pr:{type:"spacing",property:"paddingRight"},px:{type:"spacing",property:["paddingRight","paddingLeft"]},py:{type:"spacing",property:["paddingTop","paddingBottom"]},bg:{type:"color",property:"background"},c:{type:"color",property:"color"},opacity:{type:"default",property:"opacity"},ff:{type:"default",property:"fontFamily"},fz:{type:"fontSize",property:"fontSize"},fw:{type:"default",property:"fontWeight"},lts:{type:"default",property:"letterSpacing"},ta:{type:"default",property:"textAlign"},lh:{type:"default",property:"lineHeight"},fs:{type:"default",property:"fontStyle"},tt:{type:"default",property:"textTransform"},td:{type:"default",property:"textDecoration"},w:{type:"default",property:"width"},miw:{type:"default",property:"minWidth"},maw:{type:"default",property:"maxWidth"},h:{type:"default",property:"height"},mih:{type:"default",property:"minHeight"},mah:{type:"default",property:"maxHeight"},bgsz:{type:"default",property:"background-size"},bgp:{type:"default",property:"background-position"},bgr:{type:"default",property:"background-repeat"},bga:{type:"default",property:"background-attachment"},pos:{type:"default",property:"position"},top:{type:"default",property:"top"},left:{type:"default",property:"left"},bottom:{type:"default",property:"bottom"},right:{type:"default",property:"right"},inset:{type:"default",property:"inset"},display:{type:"default",property:"display"}};var tme=Object.defineProperty,t4=Object.getOwnPropertySymbols,nme=Object.prototype.hasOwnProperty,rme=Object.prototype.propertyIsEnumerable,n4=(e,t,n)=>t in e?tme(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,r4=(e,t)=>{for(var n in t||(t={}))nme.call(t,n)&&n4(e,n,t[n]);if(t4)for(var n of t4(t))rme.call(t,n)&&n4(e,n,t[n]);return e};function NP(e,t,n=eme){return Object.keys(n).reduce((i,s)=>(s in e&&e[s]!==void 0&&i.push(Ype({value:e[s],getValue:Zpe[n[s].type],property:n[s].property,theme:t})),i),[]).reduce((i,s)=>(Object.keys(s).forEach(o=>{typeof s[o]=="object"&&s[o]!==null&&o in i?i[o]=r4(r4({},i[o]),s[o]):i[o]=s[o]}),i),{})}function i4(e,t){return typeof e=="function"?e(t):e}function ime(e,t,n){const r=ts(),{css:i,cx:s}=jW();return Array.isArray(e)?s(n,i(NP(t,r)),e.map(o=>i(i4(o,r)))):s(n,i(i4(e,r)),i(NP(t,r)))}var sme=Object.defineProperty,rE=Object.getOwnPropertySymbols,XW=Object.prototype.hasOwnProperty,JW=Object.prototype.propertyIsEnumerable,s4=(e,t,n)=>t in e?sme(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ome=(e,t)=>{for(var n in t||(t={}))XW.call(t,n)&&s4(e,n,t[n]);if(rE)for(var n of rE(t))JW.call(t,n)&&s4(e,n,t[n]);return e},ame=(e,t)=>{var n={};for(var r in e)XW.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&rE)for(var r of rE(e))t.indexOf(r)<0&&JW.call(e,r)&&(n[r]=e[r]);return n};const ZW=w.forwardRef((e,t)=>{var n=e,{className:r,component:i,style:s,sx:o}=n,a=ame(n,["className","component","style","sx"]);const{systemStyles:u,rest:l}=Xd(a),c=i||"div";return k.createElement(c,ome({ref:t,className:ime(o,u,r),style:s},l))});ZW.displayName="@mantine/core/Box";const ut=ZW;var ume=Object.defineProperty,lme=Object.defineProperties,cme=Object.getOwnPropertyDescriptors,o4=Object.getOwnPropertySymbols,fme=Object.prototype.hasOwnProperty,dme=Object.prototype.propertyIsEnumerable,a4=(e,t,n)=>t in e?ume(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,u4=(e,t)=>{for(var n in t||(t={}))fme.call(t,n)&&a4(e,n,t[n]);if(o4)for(var n of o4(t))dme.call(t,n)&&a4(e,n,t[n]);return e},hme=(e,t)=>lme(e,cme(t)),pme=at(e=>({root:hme(u4(u4({},e.fn.focusStyles()),e.fn.fontStyles()),{cursor:"pointer",border:0,padding:0,appearance:"none",fontSize:e.fontSizes.md,backgroundColor:"transparent",textAlign:"left",color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,textDecoration:"none",boxSizing:"border-box"})}));const mme=pme;var gme=Object.defineProperty,iE=Object.getOwnPropertySymbols,eq=Object.prototype.hasOwnProperty,tq=Object.prototype.propertyIsEnumerable,l4=(e,t,n)=>t in e?gme(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yme=(e,t)=>{for(var n in t||(t={}))eq.call(t,n)&&l4(e,n,t[n]);if(iE)for(var n of iE(t))tq.call(t,n)&&l4(e,n,t[n]);return e},_me=(e,t)=>{var n={};for(var r in e)eq.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&iE)for(var r of iE(e))t.indexOf(r)<0&&tq.call(e,r)&&(n[r]=e[r]);return n};const nq=w.forwardRef((e,t)=>{const n=ct("UnstyledButton",{},e),{className:r,component:i="button",unstyled:s}=n,o=_me(n,["className","component","unstyled"]),{classes:a,cx:u}=mme(null,{name:"UnstyledButton",unstyled:s});return k.createElement(ut,yme({component:i,ref:t,className:u(a.root,r),type:i==="button"?"button":void 0},o))});nq.displayName="@mantine/core/UnstyledButton";const ck=nq;var vme=Object.defineProperty,bme=Object.defineProperties,Eme=Object.getOwnPropertyDescriptors,c4=Object.getOwnPropertySymbols,wme=Object.prototype.hasOwnProperty,Tme=Object.prototype.propertyIsEnumerable,f4=(e,t,n)=>t in e?vme(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,rq=(e,t)=>{for(var n in t||(t={}))wme.call(t,n)&&f4(e,n,t[n]);if(c4)for(var n of c4(t))Tme.call(t,n)&&f4(e,n,t[n]);return e},Sme=(e,t)=>bme(e,Eme(t));const n0={xs:18,sm:22,md:28,lg:34,xl:44};function Ime({variant:e,theme:t,color:n,gradient:r}){const i=t.fn.variant({color:n,variant:e,gradient:r});return e==="gradient"?{border:0,backgroundImage:i.background,color:i.color,"&:hover":t.fn.hover({backgroundSize:"200%"})}:rq({border:`1px solid ${i.border}`,backgroundColor:i.background,color:i.color},t.fn.hover({backgroundColor:i.hover}))}var xme=at((e,{color:t,size:n,radius:r,variant:i,gradient:s})=>({root:Sme(rq({},Ime({variant:i,theme:e,color:t,gradient:s})),{position:"relative",height:e.fn.size({size:n,sizes:n0}),minHeight:e.fn.size({size:n,sizes:n0}),width:e.fn.size({size:n,sizes:n0}),minWidth:e.fn.size({size:n,sizes:n0}),borderRadius:e.fn.radius(r),padding:0,lineHeight:1,display:"flex",alignItems:"center",justifyContent:"center","&:active":e.activeStyles,"&:disabled, &[data-disabled]":{color:e.colors.gray[e.colorScheme==="dark"?6:4],cursor:"not-allowed",backgroundColor:i==="transparent"?void 0:e.fn.themeColor("gray",e.colorScheme==="dark"?8:1),borderColor:i==="transparent"?void 0:e.fn.themeColor("gray",e.colorScheme==="dark"?8:1),backgroundImage:"none",pointerEvents:"none","&:active":{transform:"none"}},"&[data-loading]":{pointerEvents:"none","&::before":{content:'""',position:"absolute",top:-1,left:-1,right:-1,bottom:-1,backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.colors.dark[7],.5):"rgba(255, 255, 255, .5)",borderRadius:e.fn.radius(r),cursor:"not-allowed"}}})}));const Cme=xme;var Ame=Object.defineProperty,sE=Object.getOwnPropertySymbols,iq=Object.prototype.hasOwnProperty,sq=Object.prototype.propertyIsEnumerable,d4=(e,t,n)=>t in e?Ame(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ome=(e,t)=>{for(var n in t||(t={}))iq.call(t,n)&&d4(e,n,t[n]);if(sE)for(var n of sE(t))sq.call(t,n)&&d4(e,n,t[n]);return e},Pme=(e,t)=>{var n={};for(var r in e)iq.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&sE)for(var r of sE(e))t.indexOf(r)<0&&sq.call(e,r)&&(n[r]=e[r]);return n};function Rme(e){var t=e,{size:n,color:r}=t,i=Pme(t,["size","color"]);return k.createElement("svg",Ome({viewBox:"0 0 135 140",xmlns:"http://www.w3.org/2000/svg",fill:r,width:`${n}px`},i),k.createElement("rect",{y:"10",width:"15",height:"120",rx:"6"},k.createElement("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),k.createElement("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),k.createElement("rect",{x:"30",y:"10",width:"15",height:"120",rx:"6"},k.createElement("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),k.createElement("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),k.createElement("rect",{x:"60",width:"15",height:"140",rx:"6"},k.createElement("animate",{attributeName:"height",begin:"0s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),k.createElement("animate",{attributeName:"y",begin:"0s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),k.createElement("rect",{x:"90",y:"10",width:"15",height:"120",rx:"6"},k.createElement("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),k.createElement("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),k.createElement("rect",{x:"120",y:"10",width:"15",height:"120",rx:"6"},k.createElement("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),k.createElement("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})))}var Nme=Object.defineProperty,oE=Object.getOwnPropertySymbols,oq=Object.prototype.hasOwnProperty,aq=Object.prototype.propertyIsEnumerable,h4=(e,t,n)=>t in e?Nme(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,kme=(e,t)=>{for(var n in t||(t={}))oq.call(t,n)&&h4(e,n,t[n]);if(oE)for(var n of oE(t))aq.call(t,n)&&h4(e,n,t[n]);return e},Dme=(e,t)=>{var n={};for(var r in e)oq.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&oE)for(var r of oE(e))t.indexOf(r)<0&&aq.call(e,r)&&(n[r]=e[r]);return n};function $me(e){var t=e,{size:n,color:r}=t,i=Dme(t,["size","color"]);return k.createElement("svg",kme({width:`${n}px`,height:`${n}px`,viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",stroke:r},i),k.createElement("g",{fill:"none",fillRule:"evenodd"},k.createElement("g",{transform:"translate(2.5 2.5)",strokeWidth:"5"},k.createElement("circle",{strokeOpacity:".5",cx:"16",cy:"16",r:"16"}),k.createElement("path",{d:"M32 16c0-9.94-8.06-16-16-16"},k.createElement("animateTransform",{attributeName:"transform",type:"rotate",from:"0 16 16",to:"360 16 16",dur:"1s",repeatCount:"indefinite"})))))}var Lme=Object.defineProperty,aE=Object.getOwnPropertySymbols,uq=Object.prototype.hasOwnProperty,lq=Object.prototype.propertyIsEnumerable,p4=(e,t,n)=>t in e?Lme(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Mme=(e,t)=>{for(var n in t||(t={}))uq.call(t,n)&&p4(e,n,t[n]);if(aE)for(var n of aE(t))lq.call(t,n)&&p4(e,n,t[n]);return e},Fme=(e,t)=>{var n={};for(var r in e)uq.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&aE)for(var r of aE(e))t.indexOf(r)<0&&lq.call(e,r)&&(n[r]=e[r]);return n};function Bme(e){var t=e,{size:n,color:r}=t,i=Fme(t,["size","color"]);return k.createElement("svg",Mme({width:`${n}px`,height:`${n/4}px`,viewBox:"0 0 120 30",xmlns:"http://www.w3.org/2000/svg",fill:r},i),k.createElement("circle",{cx:"15",cy:"15",r:"15"},k.createElement("animate",{attributeName:"r",from:"15",to:"15",begin:"0s",dur:"0.8s",values:"15;9;15",calcMode:"linear",repeatCount:"indefinite"}),k.createElement("animate",{attributeName:"fill-opacity",from:"1",to:"1",begin:"0s",dur:"0.8s",values:"1;.5;1",calcMode:"linear",repeatCount:"indefinite"})),k.createElement("circle",{cx:"60",cy:"15",r:"9",fillOpacity:"0.3"},k.createElement("animate",{attributeName:"r",from:"9",to:"9",begin:"0s",dur:"0.8s",values:"9;15;9",calcMode:"linear",repeatCount:"indefinite"}),k.createElement("animate",{attributeName:"fill-opacity",from:"0.5",to:"0.5",begin:"0s",dur:"0.8s",values:".5;1;.5",calcMode:"linear",repeatCount:"indefinite"})),k.createElement("circle",{cx:"105",cy:"15",r:"15"},k.createElement("animate",{attributeName:"r",from:"15",to:"15",begin:"0s",dur:"0.8s",values:"15;9;15",calcMode:"linear",repeatCount:"indefinite"}),k.createElement("animate",{attributeName:"fill-opacity",from:"1",to:"1",begin:"0s",dur:"0.8s",values:"1;.5;1",calcMode:"linear",repeatCount:"indefinite"})))}var jme=Object.defineProperty,uE=Object.getOwnPropertySymbols,cq=Object.prototype.hasOwnProperty,fq=Object.prototype.propertyIsEnumerable,m4=(e,t,n)=>t in e?jme(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ume=(e,t)=>{for(var n in t||(t={}))cq.call(t,n)&&m4(e,n,t[n]);if(uE)for(var n of uE(t))fq.call(t,n)&&m4(e,n,t[n]);return e},Vme=(e,t)=>{var n={};for(var r in e)cq.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&uE)for(var r of uE(e))t.indexOf(r)<0&&fq.call(e,r)&&(n[r]=e[r]);return n};const AC={bars:Rme,oval:$me,dots:Bme},zme={xs:18,sm:22,md:36,lg:44,xl:58},Hme={size:"md"};function Lm(e){const t=ct("Loader",Hme,e),{size:n,color:r,variant:i}=t,s=Vme(t,["size","color","variant"]),o=ts(),a=i in AC?i:o.loader;return k.createElement(ut,Ume({role:"presentation",component:AC[a]||AC.bars,size:o.fn.size({size:n,sizes:zme}),color:o.fn.variant({variant:"filled",primaryFallback:!1,color:r||o.primaryColor}).background},s))}Lm.displayName="@mantine/core/Loader";var Wme=Object.defineProperty,lE=Object.getOwnPropertySymbols,dq=Object.prototype.hasOwnProperty,hq=Object.prototype.propertyIsEnumerable,g4=(e,t,n)=>t in e?Wme(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,y4=(e,t)=>{for(var n in t||(t={}))dq.call(t,n)&&g4(e,n,t[n]);if(lE)for(var n of lE(t))hq.call(t,n)&&g4(e,n,t[n]);return e},qme=(e,t)=>{var n={};for(var r in e)dq.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&lE)for(var r of lE(e))t.indexOf(r)<0&&hq.call(e,r)&&(n[r]=e[r]);return n};const Yme={color:"gray",size:"md",variant:"subtle",loading:!1},pq=w.forwardRef((e,t)=>{const n=ct("ActionIcon",Yme,e),{className:r,color:i,children:s,radius:o,size:a,variant:u,gradient:l,disabled:c,loaderProps:f,loading:d,unstyled:h}=n,p=qme(n,["className","color","children","radius","size","variant","gradient","disabled","loaderProps","loading","unstyled"]),{classes:m,cx:y,theme:g}=Cme({size:a,radius:o,color:i,variant:u,gradient:l},{name:"ActionIcon",unstyled:h}),_=g.fn.variant({color:i,variant:u}),b=k.createElement(Lm,y4({color:_.color,size:g.fn.size({size:a,sizes:n0})-12},f));return k.createElement(ck,y4({className:y(m.root,r),ref:t,disabled:c,"data-disabled":c||void 0,"data-loading":d||void 0,unstyled:h},p),d?b:s)});pq.displayName="@mantine/core/ActionIcon";const fk=pq;function mq(e){const{children:t,target:n,className:r}=ct("Portal",{},e),i=ts(),[s,o]=w.useState(!1),a=w.useRef();return uk(()=>(o(!0),a.current=n?typeof n=="string"?document.querySelector(n):n:document.createElement("div"),n||document.body.appendChild(a.current),()=>{!n&&document.body.removeChild(a.current)}),[n]),s?b_.createPortal(k.createElement("div",{className:r,dir:i.dir},t),a.current):null}mq.displayName="@mantine/core/Portal";var Gme=Object.defineProperty,cE=Object.getOwnPropertySymbols,gq=Object.prototype.hasOwnProperty,yq=Object.prototype.propertyIsEnumerable,_4=(e,t,n)=>t in e?Gme(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Kme=(e,t)=>{for(var n in t||(t={}))gq.call(t,n)&&_4(e,n,t[n]);if(cE)for(var n of cE(t))yq.call(t,n)&&_4(e,n,t[n]);return e},Qme=(e,t)=>{var n={};for(var r in e)gq.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&cE)for(var r of cE(e))t.indexOf(r)<0&&yq.call(e,r)&&(n[r]=e[r]);return n};function S_(e){var t=e,{withinPortal:n=!0,children:r}=t,i=Qme(t,["withinPortal","children"]);return n?k.createElement(mq,Kme({},i),r):k.createElement(k.Fragment,null,r)}S_.displayName="@mantine/core/OptionalPortal";var Xme=Object.defineProperty,Jme=Object.defineProperties,Zme=Object.getOwnPropertyDescriptors,v4=Object.getOwnPropertySymbols,ege=Object.prototype.hasOwnProperty,tge=Object.prototype.propertyIsEnumerable,b4=(e,t,n)=>t in e?Xme(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,OC=(e,t)=>{for(var n in t||(t={}))ege.call(t,n)&&b4(e,n,t[n]);if(v4)for(var n of v4(t))tge.call(t,n)&&b4(e,n,t[n]);return e},E4=(e,t)=>Jme(e,Zme(t));function nge({variant:e,color:t,theme:n}){if(e==="filled")return{backgroundColor:n.fn.variant({variant:"filled",color:t}).background,color:n.white};if(e==="outline"){const i=n.fn.variant({variant:"outline",color:t});return{color:i.color,borderColor:i.border,backgroundColor:n.colorScheme==="dark"?n.colors.dark[6]:n.white}}const r=n.fn.variant({variant:"light",color:t});return{backgroundColor:r.background,color:r.color}}var rge=at((e,{color:t,radius:n,variant:r})=>({root:OC(E4(OC({},e.fn.fontStyles()),{position:"relative",overflow:"hidden",padding:`${e.spacing.sm}px ${e.spacing.md}px`,borderRadius:e.fn.radius(n),border:"1px solid transparent"}),nge({variant:r,color:t,theme:e})),wrapper:{display:"flex"},body:{flex:1},title:{boxSizing:"border-box",margin:0,marginBottom:7,display:"flex",alignItems:"center",justifyContent:"space-between",lineHeight:e.lineHeight,fontSize:e.fontSizes.sm,fontWeight:700,"&[data-with-close-button]":{paddingRight:e.spacing.md}},label:{display:"block",overflow:"hidden",textOverflow:"ellipsis"},icon:{lineHeight:1,width:20,height:20,display:"flex",alignItems:"center",justifyContent:"flex-start",marginRight:e.spacing.md,marginTop:1},message:E4(OC({},e.fn.fontStyles()),{lineHeight:e.lineHeight,textOverflow:"ellipsis",overflow:"hidden",fontSize:e.fontSizes.sm,color:r==="filled"?e.white:e.colorScheme==="dark"?r==="light"?e.white:e.colors.dark[0]:e.black}),closeButton:{position:"absolute",top:e.spacing.sm,right:e.spacing.sm,color:"inherit"}}));const ige=rge;var sge=Object.defineProperty,w4=Object.getOwnPropertySymbols,oge=Object.prototype.hasOwnProperty,age=Object.prototype.propertyIsEnumerable,T4=(e,t,n)=>t in e?sge(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,uge=(e,t)=>{for(var n in t||(t={}))oge.call(t,n)&&T4(e,n,t[n]);if(w4)for(var n of w4(t))age.call(t,n)&&T4(e,n,t[n]);return e};function _q(e){return k.createElement("svg",uge({viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),k.createElement("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}_q.displayName="@mantine/core/CloseIcon";var lge=Object.defineProperty,fE=Object.getOwnPropertySymbols,vq=Object.prototype.hasOwnProperty,bq=Object.prototype.propertyIsEnumerable,S4=(e,t,n)=>t in e?lge(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,cge=(e,t)=>{for(var n in t||(t={}))vq.call(t,n)&&S4(e,n,t[n]);if(fE)for(var n of fE(t))bq.call(t,n)&&S4(e,n,t[n]);return e},fge=(e,t)=>{var n={};for(var r in e)vq.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&fE)for(var r of fE(e))t.indexOf(r)<0&&bq.call(e,r)&&(n[r]=e[r]);return n};const dge={xs:12,sm:14,md:16,lg:20,xl:24},hge={size:"md"},Eq=w.forwardRef((e,t)=>{const n=ct("CloseButton",hge,e),{iconSize:r,size:i="md"}=n,s=fge(n,["iconSize","size"]),o=ts(),a=r||o.fn.size({size:i,sizes:dge});return k.createElement(fk,cge({size:i,ref:t},s),k.createElement(_q,{width:a,height:a}))});Eq.displayName="@mantine/core/CloseButton";const zS=Eq;var pge=Object.defineProperty,dE=Object.getOwnPropertySymbols,wq=Object.prototype.hasOwnProperty,Tq=Object.prototype.propertyIsEnumerable,I4=(e,t,n)=>t in e?pge(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,mge=(e,t)=>{for(var n in t||(t={}))wq.call(t,n)&&I4(e,n,t[n]);if(dE)for(var n of dE(t))Tq.call(t,n)&&I4(e,n,t[n]);return e},gge=(e,t)=>{var n={};for(var r in e)wq.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&dE)for(var r of dE(e))t.indexOf(r)<0&&Tq.call(e,r)&&(n[r]=e[r]);return n};const yge={variant:"light"},Sq=w.forwardRef((e,t)=>{const n=ct("Alert",yge,e),{id:r,className:i,title:s,variant:o,children:a,color:u,classNames:l,icon:c,styles:f,onClose:d,radius:h,withCloseButton:p,closeButtonLabel:m,unstyled:y}=n,g=gge(n,["id","className","title","variant","children","color","classNames","icon","styles","onClose","radius","withCloseButton","closeButtonLabel","unstyled"]),{classes:_,cx:b}=ige({color:u,radius:h,variant:o},{classNames:l,styles:f,unstyled:y,name:"Alert"}),T=Fu(r),I=s&&`${T}-title`,E=`${T}-body`;return k.createElement(ut,mge({id:T,role:"alert","aria-labelledby":I,"aria-describedby":E,className:b(_.root,_[o],i),ref:t},g),k.createElement("div",{className:_.wrapper},c&&k.createElement("div",{className:_.icon},c),k.createElement("div",{className:_.body},s&&k.createElement("div",{className:_.title,"data-with-close-button":p||void 0},k.createElement("span",{id:I,className:_.label},s)),p&&k.createElement(zS,{className:_.closeButton,onClick:d,variant:"transparent",size:16,iconSize:16,"aria-label":m}),k.createElement("div",{id:E,className:_.message},a))))});Sq.displayName="@mantine/core/Alert";var _ge=Object.defineProperty,vge=Object.defineProperties,bge=Object.getOwnPropertyDescriptors,x4=Object.getOwnPropertySymbols,Ege=Object.prototype.hasOwnProperty,wge=Object.prototype.propertyIsEnumerable,C4=(e,t,n)=>t in e?_ge(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,jv=(e,t)=>{for(var n in t||(t={}))Ege.call(t,n)&&C4(e,n,t[n]);if(x4)for(var n of x4(t))wge.call(t,n)&&C4(e,n,t[n]);return e},Tge=(e,t)=>vge(e,bge(t));function Sge({underline:e,strikethrough:t}){const n=[];return e&&n.push("underline"),t&&n.push("line-through"),n.length>0?n.join(" "):"none"}function Ige({theme:e,color:t,variant:n}){return t==="dimmed"?e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6]:typeof t=="string"&&(t in e.colors||t.split(".")[0]in e.colors)?e.fn.variant({variant:"filled",color:t}).background:n==="link"?e.colors[e.primaryColor][e.colorScheme==="dark"?4:7]:t||"inherit"}function xge(e){return typeof e=="number"?{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:e,WebkitBoxOrient:"vertical"}:null}var Cge=at((e,{color:t,variant:n,size:r,lineClamp:i,inline:s,inherit:o,underline:a,gradient:u,weight:l,transform:c,align:f,strikethrough:d,italic:h})=>{const p=e.fn.variant({variant:"gradient",gradient:u});return{root:jv(Tge(jv(jv(jv({},e.fn.fontStyles()),e.fn.focusStyles()),xge(i)),{color:Ige({color:t,theme:e,variant:n}),fontFamily:o?"inherit":e.fontFamily,fontSize:o||r===void 0?"inherit":e.fn.size({size:r,sizes:e.fontSizes}),lineHeight:o?"inherit":s?1:e.lineHeight,textDecoration:Sge({underline:a,strikethrough:d}),WebkitTapHighlightColor:"transparent",fontWeight:o?"inherit":l,textTransform:c,textAlign:f,fontStyle:h?"italic":void 0}),e.fn.hover(n==="link"&&a===void 0?{textDecoration:"underline"}:void 0)),gradient:{backgroundImage:p.background,WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"}}});const Age=Cge;var Oge=Object.defineProperty,hE=Object.getOwnPropertySymbols,Iq=Object.prototype.hasOwnProperty,xq=Object.prototype.propertyIsEnumerable,A4=(e,t,n)=>t in e?Oge(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Pge=(e,t)=>{for(var n in t||(t={}))Iq.call(t,n)&&A4(e,n,t[n]);if(hE)for(var n of hE(t))xq.call(t,n)&&A4(e,n,t[n]);return e},Rge=(e,t)=>{var n={};for(var r in e)Iq.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&hE)for(var r of hE(e))t.indexOf(r)<0&&xq.call(e,r)&&(n[r]=e[r]);return n};const Nge={variant:"text"},Cq=w.forwardRef((e,t)=>{const n=ct("Text",Nge,e),{className:r,size:i,weight:s,transform:o,color:a,align:u,variant:l,lineClamp:c,gradient:f,inline:d,inherit:h,underline:p,strikethrough:m,italic:y,classNames:g,styles:_,unstyled:b,span:T}=n,I=Rge(n,["className","size","weight","transform","color","align","variant","lineClamp","gradient","inline","inherit","underline","strikethrough","italic","classNames","styles","unstyled","span"]),{classes:E,cx:S}=Age({variant:l,color:a,size:i,lineClamp:c,inline:d,inherit:h,underline:p,strikethrough:m,italic:y,weight:s,transform:o,align:u,gradient:f},{unstyled:b,name:"Text"});return k.createElement(ut,Pge({ref:t,className:S(E.root,{[E.gradient]:l==="gradient"},r),component:T?"span":"div"},I))});Cq.displayName="@mantine/core/Text";const Tt=Cq;var kge=at(()=>({root:{backgroundColor:"transparent",cursor:"pointer",padding:0,border:0}}));const Dge=kge;var $ge=Object.defineProperty,pE=Object.getOwnPropertySymbols,Aq=Object.prototype.hasOwnProperty,Oq=Object.prototype.propertyIsEnumerable,O4=(e,t,n)=>t in e?$ge(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,P4=(e,t)=>{for(var n in t||(t={}))Aq.call(t,n)&&O4(e,n,t[n]);if(pE)for(var n of pE(t))Oq.call(t,n)&&O4(e,n,t[n]);return e},Lge=(e,t)=>{var n={};for(var r in e)Aq.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&pE)for(var r of pE(e))t.indexOf(r)<0&&Oq.call(e,r)&&(n[r]=e[r]);return n};const Mge={},Pq=w.forwardRef((e,t)=>{const n=ct("Anchor",Mge,e),{component:r,className:i,unstyled:s}=n,o=Lge(n,["component","className","unstyled"]),{classes:a,cx:u}=Dge(null,{name:"Anchor",unstyled:s}),l=r==="button"?{type:"button"}:null;return k.createElement(Tt,P4(P4({component:r||"a",variant:"link",ref:t,className:u(a.root,i)},l),o))});Pq.displayName="@mantine/core/Anchor";const Rq=Pq,Nq=w.createContext({}),Fge=Nq.Provider;function kq(){return w.useContext(Nq)}function HS(e,t){if(!e)return[];const n=Object.keys(e).filter(r=>r!=="base").map(r=>[t.fn.size({size:r,sizes:t.breakpoints}),e[r]]);return n.sort((r,i)=>r[0]-i[0]),n}var Bge=Object.defineProperty,jge=Object.defineProperties,Uge=Object.getOwnPropertyDescriptors,R4=Object.getOwnPropertySymbols,Vge=Object.prototype.hasOwnProperty,zge=Object.prototype.propertyIsEnumerable,N4=(e,t,n)=>t in e?Bge(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Uv=(e,t)=>{for(var n in t||(t={}))Vge.call(t,n)&&N4(e,n,t[n]);if(R4)for(var n of R4(t))zge.call(t,n)&&N4(e,n,t[n]);return e},k4=(e,t)=>jge(e,Uge(t)),Hge=at((e,{height:t,width:n,fixed:r,position:i,hiddenBreakpoint:s,zIndex:o,section:a,withBorder:u})=>{const l=typeof n=="object"&&n!==null?HS(n,e).reduce((f,[d,h])=>(f[`@media (min-width: ${d}px)`]={width:h,minWidth:h},f),{}):null,c=u?{[a==="navbar"?"borderRight":"borderLeft"]:`1px solid ${e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[2]}`}:{};return{root:k4(Uv(Uv(k4(Uv(Uv({},e.fn.fontStyles()),i),{top:(i==null?void 0:i.top)||"var(--mantine-header-height)",bottom:0,zIndex:o,height:t||"calc(100vh - var(--mantine-header-height, 0px) - var(--mantine-footer-height, 0px))",width:(n==null?void 0:n.base)||"100%",position:r?"fixed":"static",boxSizing:"border-box",display:"flex",flexDirection:"column",backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.white}),c),l),{"&[data-hidden]":{[`@media (max-width: ${e.fn.size({size:s,sizes:e.breakpoints})-1}px)`]:{display:"none"}}})}});const Wge=Hge;var qge=Object.defineProperty,mE=Object.getOwnPropertySymbols,Dq=Object.prototype.hasOwnProperty,$q=Object.prototype.propertyIsEnumerable,D4=(e,t,n)=>t in e?qge(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$4=(e,t)=>{for(var n in t||(t={}))Dq.call(t,n)&&D4(e,n,t[n]);if(mE)for(var n of mE(t))$q.call(t,n)&&D4(e,n,t[n]);return e},Yge=(e,t)=>{var n={};for(var r in e)Dq.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&mE)for(var r of mE(e))t.indexOf(r)<0&&$q.call(e,r)&&(n[r]=e[r]);return n};const dk=w.forwardRef((e,t)=>{var n=e,{width:r,height:i,fixed:s=!1,position:o,zIndex:a=To("app"),hiddenBreakpoint:u="md",hidden:l=!1,withBorder:c=!0,className:f,classNames:d,styles:h,children:p,section:m,__staticSelector:y,unstyled:g}=n,_=Yge(n,["width","height","fixed","position","zIndex","hiddenBreakpoint","hidden","withBorder","className","classNames","styles","children","section","__staticSelector","unstyled"]);const b=kq(),{classes:T,cx:I,theme:E}=Wge({width:r,height:i,fixed:b.fixed||s,position:o,hiddenBreakpoint:u,zIndex:b.zIndex||a,section:m,withBorder:c},{classNames:d,styles:h,name:y,unstyled:g}),S=HS(r,E).reduce((A,[P,V])=>(A[`@media (min-width: ${P}px)`]={[`--mantine-${m}-width`]:`${V}px`},A),{});return k.createElement(ut,$4({component:m==="navbar"?"nav":"aside",ref:t,"data-hidden":l||void 0,className:I(T.root,f)},_),p,k.createElement(UW,{styles:()=>({":root":$4({[`--mantine-${m}-width`]:r!=null&&r.base?`${r.base}px`:"0px"},S)})}))});dk.displayName="@mantine/core/HorizontalSection";var Gge=Object.defineProperty,gE=Object.getOwnPropertySymbols,Lq=Object.prototype.hasOwnProperty,Mq=Object.prototype.propertyIsEnumerable,L4=(e,t,n)=>t in e?Gge(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Kge=(e,t)=>{for(var n in t||(t={}))Lq.call(t,n)&&L4(e,n,t[n]);if(gE)for(var n of gE(t))Mq.call(t,n)&&L4(e,n,t[n]);return e},Qge=(e,t)=>{var n={};for(var r in e)Lq.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&gE)for(var r of gE(e))t.indexOf(r)<0&&Mq.call(e,r)&&(n[r]=e[r]);return n};const Fq=w.forwardRef((e,t)=>{var n=e,{children:r,grow:i=!1,sx:s}=n,o=Qge(n,["children","grow","sx"]);return k.createElement(ut,Kge({ref:t,sx:[{flex:i?1:0,boxSizing:"border-box"},...Rd(s)]},o),r)});Fq.displayName="@mantine/core/Section";const Bq=Fq;var Xge=Object.defineProperty,M4=Object.getOwnPropertySymbols,Jge=Object.prototype.hasOwnProperty,Zge=Object.prototype.propertyIsEnumerable,F4=(e,t,n)=>t in e?Xge(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,e0e=(e,t)=>{for(var n in t||(t={}))Jge.call(t,n)&&F4(e,n,t[n]);if(M4)for(var n of M4(t))Zge.call(t,n)&&F4(e,n,t[n]);return e};const t0e={fixed:!1,position:{top:0,left:0},zIndex:To("app"),hiddenBreakpoint:"md",hidden:!1},C0=w.forwardRef((e,t)=>{const n=ct("Navbar",t0e,e);return k.createElement(dk,e0e({section:"navbar",__staticSelector:"Navbar",ref:t},n))});C0.Section=Bq;C0.displayName="@mantine/core/Navbar";var n0e=Object.defineProperty,r0e=Object.defineProperties,i0e=Object.getOwnPropertyDescriptors,B4=Object.getOwnPropertySymbols,s0e=Object.prototype.hasOwnProperty,o0e=Object.prototype.propertyIsEnumerable,j4=(e,t,n)=>t in e?n0e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,PC=(e,t)=>{for(var n in t||(t={}))s0e.call(t,n)&&j4(e,n,t[n]);if(B4)for(var n of B4(t))o0e.call(t,n)&&j4(e,n,t[n]);return e},U4=(e,t)=>r0e(e,i0e(t)),a0e=at((e,{height:t,fixed:n,position:r,zIndex:i,borderPosition:s})=>{const o=typeof t=="object"&&t!==null?HS(t,e).reduce((a,[u,l])=>(a[`@media (min-width: ${u}px)`]={height:l,minHeight:l},a),{}):null;return{root:U4(PC(U4(PC(PC({},e.fn.fontStyles()),r),{zIndex:i,height:typeof t=="object"?(t==null?void 0:t.base)||"100%":t,maxHeight:typeof t=="object"?(t==null?void 0:t.base)||"100%":t,position:n?"fixed":"static",boxSizing:"border-box",backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.white}),o),{borderBottom:s==="bottom"?`1px solid ${e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[2]}`:void 0,borderTop:s==="top"?`1px solid ${e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[2]}`:void 0})}});const u0e=a0e;var l0e=Object.defineProperty,yE=Object.getOwnPropertySymbols,jq=Object.prototype.hasOwnProperty,Uq=Object.prototype.propertyIsEnumerable,V4=(e,t,n)=>t in e?l0e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,z4=(e,t)=>{for(var n in t||(t={}))jq.call(t,n)&&V4(e,n,t[n]);if(yE)for(var n of yE(t))Uq.call(t,n)&&V4(e,n,t[n]);return e},c0e=(e,t)=>{var n={};for(var r in e)jq.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&yE)for(var r of yE(e))t.indexOf(r)<0&&Uq.call(e,r)&&(n[r]=e[r]);return n};const Vq=w.forwardRef((e,t)=>{var n=e,{children:r,className:i,classNames:s,styles:o,height:a,fixed:u=!1,withBorder:l=!0,position:c,zIndex:f=To("app"),section:d,unstyled:h,__staticSelector:p}=n,m=c0e(n,["children","className","classNames","styles","height","fixed","withBorder","position","zIndex","section","unstyled","__staticSelector"]);const y=kq(),{classes:g,cx:_,theme:b}=u0e({height:a,fixed:y.fixed||u,position:c,zIndex:y.zIndex||f,borderPosition:l?d==="header"?"bottom":"top":"none"},{name:p,classNames:s,styles:o,unstyled:h}),T=typeof a=="object"&&a!==null?HS(a,b).reduce((I,[E,S])=>(I[`@media (min-width: ${E}px)`]={[`--mantine-${d}-height`]:`${S}px`},I),{}):null;return k.createElement(ut,z4({component:d==="header"?"header":"footer",className:_(g.root,i),ref:t},m),r,k.createElement(UW,{styles:()=>({":root":z4({[`--mantine-${d}-height`]:typeof a=="object"?`${a==null?void 0:a.base}px`||"100%":`${a}px`},T)})}))});Vq.displayName="@mantine/core/VerticalSection";var f0e=Object.defineProperty,d0e=Object.defineProperties,h0e=Object.getOwnPropertyDescriptors,H4=Object.getOwnPropertySymbols,p0e=Object.prototype.hasOwnProperty,m0e=Object.prototype.propertyIsEnumerable,W4=(e,t,n)=>t in e?f0e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,g0e=(e,t)=>{for(var n in t||(t={}))p0e.call(t,n)&&W4(e,n,t[n]);if(H4)for(var n of H4(t))m0e.call(t,n)&&W4(e,n,t[n]);return e},y0e=(e,t)=>d0e(e,h0e(t));const _0e={fixed:!1,position:{top:0,left:0,right:0},zIndex:To("app")},zq=w.forwardRef((e,t)=>{const n=ct("Header",_0e,e);return k.createElement(Vq,y0e(g0e({section:"header",__staticSelector:"Header"},n),{ref:t}))});zq.displayName="@mantine/core/Header";var v0e=Object.defineProperty,q4=Object.getOwnPropertySymbols,b0e=Object.prototype.hasOwnProperty,E0e=Object.prototype.propertyIsEnumerable,Y4=(e,t,n)=>t in e?v0e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,w0e=(e,t)=>{for(var n in t||(t={}))b0e.call(t,n)&&Y4(e,n,t[n]);if(q4)for(var n of q4(t))E0e.call(t,n)&&Y4(e,n,t[n]);return e};const T0e={fixed:!1,position:{top:0,right:0},zIndex:To("app"),hiddenBreakpoint:"md",hidden:!1},Qh=w.forwardRef((e,t)=>{const n=ct("Aside",T0e,e);return k.createElement(dk,w0e({section:"aside",__staticSelector:"Aside",ref:t},n))});Qh.Section=Bq;Qh.displayName="@mantine/core/Aside";var S0e=Object.defineProperty,G4=Object.getOwnPropertySymbols,I0e=Object.prototype.hasOwnProperty,x0e=Object.prototype.propertyIsEnumerable,K4=(e,t,n)=>t in e?S0e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,C0e=(e,t)=>{for(var n in t||(t={}))I0e.call(t,n)&&K4(e,n,t[n]);if(G4)for(var n of G4(t))x0e.call(t,n)&&K4(e,n,t[n]);return e};function A0e(e,t){const n=t.fn.size({size:e.padding,sizes:t.spacing}),r=e.navbarOffsetBreakpoint?t.fn.size({size:e.navbarOffsetBreakpoint,sizes:t.breakpoints}):null,i=e.asideOffsetBreakpoint?t.fn.size({size:e.asideOffsetBreakpoint,sizes:t.breakpoints}):null;return e.fixed?{minHeight:"100vh",paddingTop:`calc(var(--mantine-header-height, 0px) + ${n}px)`,paddingBottom:`calc(var(--mantine-footer-height, 0px) + ${n}px)`,paddingLeft:`calc(var(--mantine-navbar-width, 0px) + ${n}px)`,paddingRight:`calc(var(--mantine-aside-width, 0px) + ${n}px)`,[`@media (max-width: ${r-1}px)`]:{paddingLeft:n},[`@media (max-width: ${i-1}px)`]:{paddingRight:n}}:{padding:n}}var O0e=at((e,t)=>({root:{boxSizing:"border-box"},body:{display:"flex",boxSizing:"border-box"},main:C0e({flex:1,width:"100vw",boxSizing:"border-box"},A0e(t,e))}));const P0e=O0e;var R0e=Object.defineProperty,_E=Object.getOwnPropertySymbols,Hq=Object.prototype.hasOwnProperty,Wq=Object.prototype.propertyIsEnumerable,Q4=(e,t,n)=>t in e?R0e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,N0e=(e,t)=>{for(var n in t||(t={}))Hq.call(t,n)&&Q4(e,n,t[n]);if(_E)for(var n of _E(t))Wq.call(t,n)&&Q4(e,n,t[n]);return e},k0e=(e,t)=>{var n={};for(var r in e)Hq.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&_E)for(var r of _E(e))t.indexOf(r)<0&&Wq.call(e,r)&&(n[r]=e[r]);return n};const D0e={fixed:!0,zIndex:To("app"),padding:"md"},qq=w.forwardRef((e,t)=>{const n=ct("AppShell",D0e,e),{children:r,navbar:i,header:s,footer:o,aside:a,fixed:u,zIndex:l,padding:c,navbarOffsetBreakpoint:f,asideOffsetBreakpoint:d,className:h,styles:p,classNames:m,unstyled:y,hidden:g}=n,_=k0e(n,["children","navbar","header","footer","aside","fixed","zIndex","padding","navbarOffsetBreakpoint","asideOffsetBreakpoint","className","styles","classNames","unstyled","hidden"]),{classes:b,cx:T}=P0e({padding:c,fixed:u,navbarOffsetBreakpoint:f,asideOffsetBreakpoint:d},{styles:p,classNames:m,unstyled:y,name:"AppShell"});return g?k.createElement(k.Fragment,null,r):k.createElement(Fge,{value:{fixed:u,zIndex:l}},k.createElement(ut,N0e({className:T(b.root,h),ref:t},_),s,k.createElement("div",{className:b.body},i,k.createElement("main",{className:b.main},r),a),o))});qq.displayName="@mantine/core/AppShell";const Vv={xs:1,sm:2,md:3,lg:4,xl:5};function zv(e,t){const n=e.fn.variant({variant:"outline",color:t}).border;return typeof t=="string"&&(t in e.colors||t.split(".")[0]in e.colors)?n:t===void 0?e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]:t}var $0e=at((e,{size:t,variant:n,color:r})=>({root:{},withLabel:{borderTop:"0 !important"},left:{"&::before":{display:"none"}},right:{"&::after":{display:"none"}},label:{display:"flex",alignItems:"center","&::before":{content:'""',flex:1,height:1,borderTop:`${e.fn.size({size:t,sizes:Vv})}px ${n} ${zv(e,r)}`,marginRight:e.spacing.xs},"&::after":{content:'""',flex:1,borderTop:`${e.fn.size({size:t,sizes:Vv})}px ${n} ${zv(e,r)}`,marginLeft:e.spacing.xs}},labelDefaultStyles:{color:r==="dark"?e.colors.dark[1]:e.fn.themeColor(r,e.colorScheme==="dark"?5:e.fn.primaryShade(),!1)},horizontal:{border:0,borderTopWidth:e.fn.size({size:t,sizes:Vv}),borderTopColor:zv(e,r),borderTopStyle:n,margin:0},vertical:{border:0,alignSelf:"stretch",height:"auto",borderLeftWidth:e.fn.size({size:t,sizes:Vv}),borderLeftColor:zv(e,r),borderLeftStyle:n}}));const L0e=$0e;var M0e=Object.defineProperty,F0e=Object.defineProperties,B0e=Object.getOwnPropertyDescriptors,vE=Object.getOwnPropertySymbols,Yq=Object.prototype.hasOwnProperty,Gq=Object.prototype.propertyIsEnumerable,X4=(e,t,n)=>t in e?M0e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,J4=(e,t)=>{for(var n in t||(t={}))Yq.call(t,n)&&X4(e,n,t[n]);if(vE)for(var n of vE(t))Gq.call(t,n)&&X4(e,n,t[n]);return e},j0e=(e,t)=>F0e(e,B0e(t)),U0e=(e,t)=>{var n={};for(var r in e)Yq.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&vE)for(var r of vE(e))t.indexOf(r)<0&&Gq.call(e,r)&&(n[r]=e[r]);return n};const V0e={orientation:"horizontal",size:"xs",labelPosition:"left",variant:"solid"},gd=w.forwardRef((e,t)=>{const n=ct("Divider",V0e,e),{className:r,color:i,orientation:s,size:o,label:a,labelPosition:u,labelProps:l,variant:c,styles:f,classNames:d,unstyled:h}=n,p=U0e(n,["className","color","orientation","size","label","labelPosition","labelProps","variant","styles","classNames","unstyled"]),{classes:m,cx:y}=L0e({color:i,size:o,variant:c},{classNames:d,styles:f,unstyled:h,name:"Divider"}),g=s==="vertical",_=s==="horizontal",b=!!a&&_,T=!(l!=null&&l.color);return k.createElement(ut,J4({ref:t,className:y(m.root,{[m.vertical]:g,[m.horizontal]:_,[m.withLabel]:b},r),role:"separator"},p),b&&k.createElement(Tt,j0e(J4({},l),{size:(l==null?void 0:l.size)||"xs",sx:{marginTop:2},className:y(m.label,m[u],{[m.labelDefaultStyles]:T})}),a))});gd.displayName="@mantine/core/Divider";var z0e=Object.defineProperty,H0e=Object.defineProperties,W0e=Object.getOwnPropertyDescriptors,Z4=Object.getOwnPropertySymbols,q0e=Object.prototype.hasOwnProperty,Y0e=Object.prototype.propertyIsEnumerable,e5=(e,t,n)=>t in e?z0e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,t5=(e,t)=>{for(var n in t||(t={}))q0e.call(t,n)&&e5(e,n,t[n]);if(Z4)for(var n of Z4(t))Y0e.call(t,n)&&e5(e,n,t[n]);return e},G0e=(e,t)=>H0e(e,W0e(t)),K0e=at((e,{size:t})=>({item:G0e(t5({},e.fn.fontStyles()),{boxSizing:"border-box",textAlign:"left",width:"100%",padding:`${e.fn.size({size:t,sizes:e.spacing})/1.5}px ${e.fn.size({size:t,sizes:e.spacing})}px`,cursor:"pointer",fontSize:e.fn.size({size:t,sizes:e.fontSizes}),color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,borderRadius:e.radius.sm,"&[data-hovered]":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[1]},"&[data-selected]":t5({backgroundColor:e.fn.variant({variant:"filled"}).background,color:e.fn.variant({variant:"filled"}).color},e.fn.hover({backgroundColor:e.fn.variant({variant:"filled"}).hover})),"&[data-disabled]":{cursor:"default",color:e.colors.dark[2]}}),nothingFound:{boxSizing:"border-box",color:e.colors.gray[6],paddingTop:e.fn.size({size:t,sizes:e.spacing})/2,paddingBottom:e.fn.size({size:t,sizes:e.spacing})/2,textAlign:"center"},separator:{boxSizing:"border-box",textAlign:"left",width:"100%",padding:`${e.fn.size({size:t,sizes:e.spacing})/1.5}px ${e.fn.size({size:t,sizes:e.spacing})}px`},separatorLabel:{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]}}));const Q0e=K0e;var X0e=Object.defineProperty,n5=Object.getOwnPropertySymbols,J0e=Object.prototype.hasOwnProperty,Z0e=Object.prototype.propertyIsEnumerable,r5=(e,t,n)=>t in e?X0e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,eye=(e,t)=>{for(var n in t||(t={}))J0e.call(t,n)&&r5(e,n,t[n]);if(n5)for(var n of n5(t))Z0e.call(t,n)&&r5(e,n,t[n]);return e};function hk({data:e,hovered:t,classNames:n,styles:r,isItemSelected:i,uuid:s,__staticSelector:o,onItemHover:a,onItemSelect:u,itemsRefs:l,itemComponent:c,size:f,nothingFound:d,creatable:h,createLabel:p,unstyled:m}){const{classes:y}=Q0e({size:f},{classNames:n,styles:r,unstyled:m,name:o}),g=[],_=[];let b=null;const T=(E,S)=>{const A=typeof i=="function"?i(E.value):!1;return k.createElement(c,eye({key:E.value,className:y.item,"data-disabled":E.disabled||void 0,"data-hovered":!E.disabled&&t===S||void 0,"data-selected":!E.disabled&&A||void 0,onMouseEnter:()=>a(S),id:`${s}-${S}`,role:"option",tabIndex:-1,"aria-selected":t===S,ref:P=>{l&&l.current&&(l.current[E.value]=P)},onMouseDown:E.disabled?null:P=>{P.preventDefault(),u(E)},disabled:E.disabled},E))};let I=null;if(e.forEach((E,S)=>{E.creatable?b=S:E.group?(I!==E.group&&(I=E.group,_.push(k.createElement("div",{className:y.separator,key:`__mantine-divider-${S}`},k.createElement(gd,{classNames:{label:y.separatorLabel},label:E.group})))),_.push(T(E,S))):g.push(T(E,S))}),h){const E=e[b];g.push(k.createElement("div",{key:Vpe(),className:y.item,"data-hovered":t===b||void 0,onMouseEnter:()=>a(b),onMouseDown:S=>{S.preventDefault(),u(E)},tabIndex:-1,ref:S=>{l&&l.current&&(l.current[E.value]=S)}},p))}return _.length>0&&g.length>0&&g.unshift(k.createElement("div",{className:y.separator,key:"empty-group-separator"},k.createElement(gd,null))),_.length>0||g.length>0?k.createElement(k.Fragment,null,_,g):k.createElement(Tt,{size:f,unstyled:m,className:y.nothingFound},d)}hk.displayName="@mantine/core/SelectItems";var tye=Object.defineProperty,bE=Object.getOwnPropertySymbols,Kq=Object.prototype.hasOwnProperty,Qq=Object.prototype.propertyIsEnumerable,i5=(e,t,n)=>t in e?tye(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,nye=(e,t)=>{for(var n in t||(t={}))Kq.call(t,n)&&i5(e,n,t[n]);if(bE)for(var n of bE(t))Qq.call(t,n)&&i5(e,n,t[n]);return e},rye=(e,t)=>{var n={};for(var r in e)Kq.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&bE)for(var r of bE(e))t.indexOf(r)<0&&Qq.call(e,r)&&(n[r]=e[r]);return n};const pk=w.forwardRef((e,t)=>{var n=e,{label:r,value:i}=n,s=rye(n,["label","value"]);return k.createElement("div",nye({ref:t},s),r||i)});pk.displayName="@mantine/core/DefaultItem";function iye(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Xq(...e){return t=>e.forEach(n=>iye(n,t))}function Jd(...e){return w.useCallback(Xq(...e),e)}const Jq=w.forwardRef((e,t)=>{const{children:n,...r}=e,i=w.Children.toArray(n),s=i.find(oye);if(s){const o=s.props.children,a=i.map(u=>u===s?w.Children.count(o)>1?w.Children.only(null):w.isValidElement(o)?o.props.children:null:u);return w.createElement(kP,cr({},r,{ref:t}),w.isValidElement(o)?w.cloneElement(o,void 0,a):null)}return w.createElement(kP,cr({},r,{ref:t}),n)});Jq.displayName="Slot";const kP=w.forwardRef((e,t)=>{const{children:n,...r}=e;return w.isValidElement(n)?w.cloneElement(n,{...aye(r,n.props),ref:Xq(t,n.ref)}):w.Children.count(n)>1?w.Children.only(null):null});kP.displayName="SlotClone";const sye=({children:e})=>w.createElement(w.Fragment,null,e);function oye(e){return w.isValidElement(e)&&e.type===sye}function aye(e,t){const n={...t};for(const r in t){const i=e[r],s=t[r];/^on[A-Z]/.test(r)?n[r]=(...a)=>{s==null||s(...a),i==null||i(...a)}:r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...e,...n}}const uye=["a","button","div","h2","h3","img","li","nav","ol","p","span","svg","ul"],I_=uye.reduce((e,t)=>{const n=w.forwardRef((r,i)=>{const{asChild:s,...o}=r,a=s?Jq:t;return w.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),w.createElement(a,cr({},o,{ref:i}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),DP=globalThis!=null&&globalThis.document?w.useLayoutEffect:()=>{};function lye(e,t){return w.useReducer((n,r)=>{const i=t[n][r];return i??n},e)}const x_=e=>{const{present:t,children:n}=e,r=cye(t),i=typeof n=="function"?n({present:r.isPresent}):w.Children.only(n),s=Jd(r.ref,i.ref);return typeof n=="function"||r.isPresent?w.cloneElement(i,{ref:s}):null};x_.displayName="Presence";function cye(e){const[t,n]=w.useState(),r=w.useRef({}),i=w.useRef(e),s=w.useRef("none"),o=e?"mounted":"unmounted",[a,u]=lye(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const l=Hv(r.current);s.current=a==="mounted"?l:"none"},[a]),DP(()=>{const l=r.current,c=i.current;if(c!==e){const d=s.current,h=Hv(l);e?u("MOUNT"):h==="none"||(l==null?void 0:l.display)==="none"?u("UNMOUNT"):u(c&&d!==h?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,u]),DP(()=>{if(t){const l=f=>{const h=Hv(r.current).includes(f.animationName);f.target===t&&h&&b_.flushSync(()=>u("ANIMATION_END"))},c=f=>{f.target===t&&(s.current=Hv(r.current))};return t.addEventListener("animationstart",c),t.addEventListener("animationcancel",l),t.addEventListener("animationend",l),()=>{t.removeEventListener("animationstart",c),t.removeEventListener("animationcancel",l),t.removeEventListener("animationend",l)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:w.useCallback(l=>{l&&(r.current=getComputedStyle(l)),n(l)},[])}}function Hv(e){return(e==null?void 0:e.animationName)||"none"}function fye(e,t=[]){let n=[];function r(s,o){const a=w.createContext(o),u=n.length;n=[...n,o];function l(f){const{scope:d,children:h,...p}=f,m=(d==null?void 0:d[e][u])||a,y=w.useMemo(()=>p,Object.values(p));return w.createElement(m.Provider,{value:y},h)}function c(f,d){const h=(d==null?void 0:d[e][u])||a,p=w.useContext(h);if(p)return p;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${s}\``)}return l.displayName=s+"Provider",[l,c]}const i=()=>{const s=n.map(o=>w.createContext(o));return function(a){const u=(a==null?void 0:a[e])||s;return w.useMemo(()=>({[`__scope${e}`]:{...a,[e]:u}}),[a,u])}};return i.scopeName=e,[r,dye(i,...t)]}function dye(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=r.reduce((a,{useScope:u,scopeName:l})=>{const f=u(s)[`__scope${l}`];return{...a,...f}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function Vf(e){const t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}const hye=w.createContext(void 0);function pye(e){const t=w.useContext(hye);return e||t||"ltr"}function mye(e,[t,n]){return Math.min(n,Math.max(t,e))}function yd(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function gye(e,t){return w.useReducer((n,r)=>{const i=t[n][r];return i??n},e)}const Zq="ScrollArea",[eY,hrt]=fye(Zq),[yye,Qo]=eY(Zq),_ye=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:i,scrollHideDelay:s=600,...o}=e,[a,u]=w.useState(null),[l,c]=w.useState(null),[f,d]=w.useState(null),[h,p]=w.useState(null),[m,y]=w.useState(null),[g,_]=w.useState(0),[b,T]=w.useState(0),[I,E]=w.useState(!1),[S,A]=w.useState(!1),P=Jd(t,M=>u(M)),V=pye(i);return w.createElement(yye,{scope:n,type:r,dir:V,scrollHideDelay:s,scrollArea:a,viewport:l,onViewportChange:c,content:f,onContentChange:d,scrollbarX:h,onScrollbarXChange:p,scrollbarXEnabled:I,onScrollbarXEnabledChange:E,scrollbarY:m,onScrollbarYChange:y,scrollbarYEnabled:S,onScrollbarYEnabledChange:A,onCornerWidthChange:_,onCornerHeightChange:T},w.createElement(I_.div,cr({dir:V},o,{ref:P,style:{position:"relative","--radix-scroll-area-corner-width":g+"px","--radix-scroll-area-corner-height":b+"px",...e.style}})))}),vye="ScrollAreaViewport",bye=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,...i}=e,s=Qo(vye,n),o=w.useRef(null),a=Jd(t,o,s.onViewportChange);return w.createElement(w.Fragment,null,w.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"}}),w.createElement(I_.div,cr({"data-radix-scroll-area-viewport":""},i,{ref:a,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style}}),w.createElement("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"}},r)))}),Vl="ScrollAreaScrollbar",Eye=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Qo(Vl,e.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:o}=i,a=e.orientation==="horizontal";return w.useEffect(()=>(a?s(!0):o(!0),()=>{a?s(!1):o(!1)}),[a,s,o]),i.type==="hover"?w.createElement(wye,cr({},r,{ref:t,forceMount:n})):i.type==="scroll"?w.createElement(Tye,cr({},r,{ref:t,forceMount:n})):i.type==="auto"?w.createElement(tY,cr({},r,{ref:t,forceMount:n})):i.type==="always"?w.createElement(mk,cr({},r,{ref:t})):null}),wye=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Qo(Vl,e.__scopeScrollArea),[s,o]=w.useState(!1);return w.useEffect(()=>{const a=i.scrollArea;let u=0;if(a){const l=()=>{window.clearTimeout(u),o(!0)},c=()=>{u=window.setTimeout(()=>o(!1),i.scrollHideDelay)};return a.addEventListener("pointerenter",l),a.addEventListener("pointerleave",c),()=>{window.clearTimeout(u),a.removeEventListener("pointerenter",l),a.removeEventListener("pointerleave",c)}}},[i.scrollArea,i.scrollHideDelay]),w.createElement(x_,{present:n||s},w.createElement(tY,cr({"data-state":s?"visible":"hidden"},r,{ref:t})))}),Tye=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Qo(Vl,e.__scopeScrollArea),s=e.orientation==="horizontal",o=qS(()=>u("SCROLL_END"),100),[a,u]=gye("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return w.useEffect(()=>{if(a==="idle"){const l=window.setTimeout(()=>u("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(l)}},[a,i.scrollHideDelay,u]),w.useEffect(()=>{const l=i.viewport,c=s?"scrollLeft":"scrollTop";if(l){let f=l[c];const d=()=>{const h=l[c];f!==h&&(u("SCROLL"),o()),f=h};return l.addEventListener("scroll",d),()=>l.removeEventListener("scroll",d)}},[i.viewport,s,u,o]),w.createElement(x_,{present:n||a!=="hidden"},w.createElement(mk,cr({"data-state":a==="hidden"?"hidden":"visible"},r,{ref:t,onPointerEnter:yd(e.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:yd(e.onPointerLeave,()=>u("POINTER_LEAVE"))})))}),tY=w.forwardRef((e,t)=>{const n=Qo(Vl,e.__scopeScrollArea),{forceMount:r,...i}=e,[s,o]=w.useState(!1),a=e.orientation==="horizontal",u=qS(()=>{if(n.viewport){const l=n.viewport.offsetWidth{const{orientation:n="vertical",...r}=e,i=Qo(Vl,e.__scopeScrollArea),s=w.useRef(null),o=w.useRef(0),[a,u]=w.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=sY(a.viewport,a.content),c={...r,sizes:a,onSizesChange:u,hasThumb:l>0&&l<1,onThumbChange:d=>s.current=d,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:d=>o.current=d};function f(d,h){return Rye(d,o.current,a,h)}return n==="horizontal"?w.createElement(Sye,cr({},c,{ref:t,onThumbPositionChange:()=>{if(i.viewport&&s.current){const d=i.viewport.scrollLeft,h=s5(d,a,i.dir);s.current.style.transform=`translate3d(${h}px, 0, 0)`}},onWheelScroll:d=>{i.viewport&&(i.viewport.scrollLeft=d)},onDragScroll:d=>{i.viewport&&(i.viewport.scrollLeft=f(d,i.dir))}})):n==="vertical"?w.createElement(Iye,cr({},c,{ref:t,onThumbPositionChange:()=>{if(i.viewport&&s.current){const d=i.viewport.scrollTop,h=s5(d,a);s.current.style.transform=`translate3d(0, ${h}px, 0)`}},onWheelScroll:d=>{i.viewport&&(i.viewport.scrollTop=d)},onDragScroll:d=>{i.viewport&&(i.viewport.scrollTop=f(d))}})):null}),Sye=w.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,s=Qo(Vl,e.__scopeScrollArea),[o,a]=w.useState(),u=w.useRef(null),l=Jd(t,u,s.onScrollbarXChange);return w.useEffect(()=>{u.current&&a(getComputedStyle(u.current))},[u]),w.createElement(rY,cr({"data-orientation":"horizontal"},i,{ref:l,sizes:n,style:{bottom:0,left:s.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:s.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":WS(n)+"px",...e.style},onThumbPointerDown:c=>e.onThumbPointerDown(c.x),onDragScroll:c=>e.onDragScroll(c.x),onWheelScroll:(c,f)=>{if(s.viewport){const d=s.viewport.scrollLeft+c.deltaX;e.onWheelScroll(d),aY(d,f)&&c.preventDefault()}},onResize:()=>{u.current&&s.viewport&&o&&r({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:EE(o.paddingLeft),paddingEnd:EE(o.paddingRight)}})}}))}),Iye=w.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,s=Qo(Vl,e.__scopeScrollArea),[o,a]=w.useState(),u=w.useRef(null),l=Jd(t,u,s.onScrollbarYChange);return w.useEffect(()=>{u.current&&a(getComputedStyle(u.current))},[u]),w.createElement(rY,cr({"data-orientation":"vertical"},i,{ref:l,sizes:n,style:{top:0,right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":WS(n)+"px",...e.style},onThumbPointerDown:c=>e.onThumbPointerDown(c.y),onDragScroll:c=>e.onDragScroll(c.y),onWheelScroll:(c,f)=>{if(s.viewport){const d=s.viewport.scrollTop+c.deltaY;e.onWheelScroll(d),aY(d,f)&&c.preventDefault()}},onResize:()=>{u.current&&s.viewport&&o&&r({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:EE(o.paddingTop),paddingEnd:EE(o.paddingBottom)}})}}))}),[xye,nY]=eY(Vl),rY=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:s,onThumbPointerUp:o,onThumbPointerDown:a,onThumbPositionChange:u,onDragScroll:l,onWheelScroll:c,onResize:f,...d}=e,h=Qo(Vl,n),[p,m]=w.useState(null),y=Jd(t,P=>m(P)),g=w.useRef(null),_=w.useRef(""),b=h.viewport,T=r.content-r.viewport,I=Vf(c),E=Vf(u),S=qS(f,10);function A(P){if(g.current){const V=P.clientX-g.current.left,M=P.clientY-g.current.top;l({x:V,y:M})}}return w.useEffect(()=>{const P=V=>{const M=V.target;(p==null?void 0:p.contains(M))&&I(V,T)};return document.addEventListener("wheel",P,{passive:!1}),()=>document.removeEventListener("wheel",P,{passive:!1})},[b,p,T,I]),w.useEffect(E,[r,E]),Gp(p,S),Gp(h.content,S),w.createElement(xye,{scope:n,scrollbar:p,hasThumb:i,onThumbChange:Vf(s),onThumbPointerUp:Vf(o),onThumbPositionChange:E,onThumbPointerDown:Vf(a)},w.createElement(I_.div,cr({},d,{ref:y,style:{position:"absolute",...d.style},onPointerDown:yd(e.onPointerDown,P=>{P.button===0&&(P.target.setPointerCapture(P.pointerId),g.current=p.getBoundingClientRect(),_.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",A(P))}),onPointerMove:yd(e.onPointerMove,A),onPointerUp:yd(e.onPointerUp,P=>{P.target.releasePointerCapture(P.pointerId),document.body.style.webkitUserSelect=_.current,g.current=null})})))}),$P="ScrollAreaThumb",Cye=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=nY($P,e.__scopeScrollArea);return w.createElement(x_,{present:n||i.hasThumb},w.createElement(Aye,cr({ref:t},r)))}),Aye=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...i}=e,s=Qo($P,n),o=nY($P,n),{onThumbPositionChange:a}=o,u=Jd(t,f=>o.onThumbChange(f)),l=w.useRef(),c=qS(()=>{l.current&&(l.current(),l.current=void 0)},100);return w.useEffect(()=>{const f=s.viewport;if(f){const d=()=>{if(c(),!l.current){const h=Nye(f,a);l.current=h,a()}};return a(),f.addEventListener("scroll",d),()=>f.removeEventListener("scroll",d)}},[s.viewport,c,a]),w.createElement(I_.div,cr({"data-state":o.hasThumb?"visible":"hidden"},i,{ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:yd(e.onPointerDownCapture,f=>{const h=f.target.getBoundingClientRect(),p=f.clientX-h.left,m=f.clientY-h.top;o.onThumbPointerDown({x:p,y:m})}),onPointerUp:yd(e.onPointerUp,o.onThumbPointerUp)}))}),iY="ScrollAreaCorner",Oye=w.forwardRef((e,t)=>{const n=Qo(iY,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?w.createElement(Pye,cr({},e,{ref:t})):null}),Pye=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,i=Qo(iY,n),[s,o]=w.useState(0),[a,u]=w.useState(0),l=!!(s&&a);return Gp(i.scrollbarX,()=>{var c;const f=((c=i.scrollbarX)===null||c===void 0?void 0:c.offsetHeight)||0;i.onCornerHeightChange(f),u(f)}),Gp(i.scrollbarY,()=>{var c;const f=((c=i.scrollbarY)===null||c===void 0?void 0:c.offsetWidth)||0;i.onCornerWidthChange(f),o(f)}),l?w.createElement(I_.div,cr({},r,{ref:t,style:{width:s,height:a,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...e.style}})):null});function EE(e){return e?parseInt(e,10):0}function sY(e,t){const n=e/t;return isNaN(n)?0:n}function WS(e){const t=sY(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function Rye(e,t,n,r="ltr"){const i=WS(n),s=i/2,o=t||s,a=i-o,u=n.scrollbar.paddingStart+o,l=n.scrollbar.size-n.scrollbar.paddingEnd-a,c=n.content-n.viewport,f=r==="ltr"?[0,c]:[c*-1,0];return oY([u,l],f)(e)}function s5(e,t,n="ltr"){const r=WS(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-i,o=t.content-t.viewport,a=s-r,u=n==="ltr"?[0,o]:[o*-1,0],l=mye(e,u);return oY([0,o],[0,a])(l)}function oY(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function aY(e,t){return e>0&&e{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function i(){const s={left:e.scrollLeft,top:e.scrollTop},o=n.left!==s.left,a=n.top!==s.top;(o||a)&&t(),n=s,r=window.requestAnimationFrame(i)}(),()=>window.cancelAnimationFrame(r)};function qS(e,t){const n=Vf(e),r=w.useRef(0);return w.useEffect(()=>()=>window.clearTimeout(r.current),[]),w.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Gp(e,t){const n=Vf(t);DP(()=>{let r=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(e),()=>{window.cancelAnimationFrame(r),i.unobserve(e)}}},[e,n])}const kye=_ye,Dye=bye,o5=Eye,a5=Cye,$ye=Oye;var Lye=at((e,{scrollbarSize:t,offsetScrollbars:n,scrollbarHovered:r,hidden:i},s)=>({root:{overflow:"hidden"},viewport:{width:"100%",height:"100%",paddingRight:n?t:void 0,paddingBottom:n?t:void 0},scrollbar:{display:i?"none":"flex",userSelect:"none",touchAction:"none",boxSizing:"border-box",padding:t/5,transition:"background-color 150ms ease, opacity 150ms ease","&:hover":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[8]:e.colors.gray[0],[`& .${s("thumb")}`]:{backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.white,.5):e.fn.rgba(e.black,.5)}},'&[data-orientation="vertical"]':{width:t},'&[data-orientation="horizontal"]':{flexDirection:"column",height:t},'&[data-state="hidden"]':{display:"none",opacity:0}},thumb:{ref:s("thumb"),flex:1,backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.white,.4):e.fn.rgba(e.black,.4),borderRadius:t,position:"relative",transition:"background-color 150ms ease",display:i?"none":void 0,"&::before":{content:'""',position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"100%",height:"100%"}},corner:{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[0],transition:"opacity 150ms ease",opacity:r?1:0,display:i?"none":void 0}}));const Mye=Lye;var Fye=Object.defineProperty,Bye=Object.defineProperties,jye=Object.getOwnPropertyDescriptors,wE=Object.getOwnPropertySymbols,uY=Object.prototype.hasOwnProperty,lY=Object.prototype.propertyIsEnumerable,u5=(e,t,n)=>t in e?Fye(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,cY=(e,t)=>{for(var n in t||(t={}))uY.call(t,n)&&u5(e,n,t[n]);if(wE)for(var n of wE(t))lY.call(t,n)&&u5(e,n,t[n]);return e},Uye=(e,t)=>Bye(e,jye(t)),fY=(e,t)=>{var n={};for(var r in e)uY.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&wE)for(var r of wE(e))t.indexOf(r)<0&&lY.call(e,r)&&(n[r]=e[r]);return n};const dY={scrollbarSize:12,scrollHideDelay:1e3,type:"hover",offsetScrollbars:!1},YS=w.forwardRef((e,t)=>{const n=ct("ScrollArea",dY,e),{children:r,className:i,classNames:s,styles:o,scrollbarSize:a,scrollHideDelay:u,type:l,dir:c,offsetScrollbars:f,viewportRef:d,onScrollPositionChange:h,unstyled:p}=n,m=fY(n,["children","className","classNames","styles","scrollbarSize","scrollHideDelay","type","dir","offsetScrollbars","viewportRef","onScrollPositionChange","unstyled"]),[y,g]=w.useState(!1),_=ts(),{classes:b,cx:T}=Mye({scrollbarSize:a,offsetScrollbars:f,scrollbarHovered:y,hidden:l==="never"},{name:"ScrollArea",classNames:s,styles:o,unstyled:p});return k.createElement(kye,{type:l==="never"?"always":l,scrollHideDelay:u,dir:c||_.dir,ref:t,asChild:!0},k.createElement(ut,cY({className:T(b.root,i)},m),k.createElement(Dye,{className:b.viewport,ref:d,onScroll:typeof h=="function"?({currentTarget:I})=>h({x:I.scrollLeft,y:I.scrollTop}):void 0},r),k.createElement(o5,{orientation:"horizontal",className:b.scrollbar,forceMount:!0,onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1)},k.createElement(a5,{className:b.thumb})),k.createElement(o5,{orientation:"vertical",className:b.scrollbar,forceMount:!0,onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1)},k.createElement(a5,{className:b.thumb})),k.createElement($ye,{className:b.corner})))}),hY=w.forwardRef((e,t)=>{const n=ct("ScrollAreaAutosize",dY,e),{maxHeight:r,children:i,classNames:s,styles:o,scrollbarSize:a,scrollHideDelay:u,type:l,dir:c,offsetScrollbars:f,viewportRef:d,onScrollPositionChange:h,unstyled:p,sx:m}=n,y=fY(n,["maxHeight","children","classNames","styles","scrollbarSize","scrollHideDelay","type","dir","offsetScrollbars","viewportRef","onScrollPositionChange","unstyled","sx"]);return k.createElement(ut,Uye(cY({},y),{ref:t,sx:[{display:"flex",maxHeight:r},...Rd(m)]}),k.createElement(ut,{sx:{display:"flex",flexDirection:"column",flex:1}},k.createElement(YS,{classNames:s,styles:o,scrollHideDelay:u,scrollbarSize:a,type:l,dir:c,offsetScrollbars:f,viewportRef:d,onScrollPositionChange:h,unstyled:p},i)))});hY.displayName="@mantine/core/ScrollAreaAutosize";YS.displayName="@mantine/core/ScrollArea";YS.Autosize=hY;const r0=YS;var Vye=Object.defineProperty,zye=Object.defineProperties,Hye=Object.getOwnPropertyDescriptors,TE=Object.getOwnPropertySymbols,pY=Object.prototype.hasOwnProperty,mY=Object.prototype.propertyIsEnumerable,l5=(e,t,n)=>t in e?Vye(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,c5=(e,t)=>{for(var n in t||(t={}))pY.call(t,n)&&l5(e,n,t[n]);if(TE)for(var n of TE(t))mY.call(t,n)&&l5(e,n,t[n]);return e},Wye=(e,t)=>zye(e,Hye(t)),qye=(e,t)=>{var n={};for(var r in e)pY.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&TE)for(var r of TE(e))t.indexOf(r)<0&&mY.call(e,r)&&(n[r]=e[r]);return n};const GS=w.forwardRef((e,t)=>{var n=e,{style:r}=n,i=qye(n,["style"]);return k.createElement(r0,Wye(c5({},i),{style:c5({width:"100%"},r),viewportRef:t}),i.children)});GS.displayName="@mantine/core/SelectScrollArea";var Yye=at(()=>({dropdown:{},itemsWrapper:{padding:4,display:"flex",width:"100%",boxSizing:"border-box"}}));const Gye=Yye;function Sl(e){return e.split("-")[0]}function C_(e){return e.split("-")[1]}function Zd(e){return["top","bottom"].includes(Sl(e))?"x":"y"}function gk(e){return e==="y"?"height":"width"}function f5(e,t,n){let{reference:r,floating:i}=e;const s=r.x+r.width/2-i.width/2,o=r.y+r.height/2-i.height/2,a=Zd(t),u=gk(a),l=r[u]/2-i[u]/2,c=a==="x";let f;switch(Sl(t)){case"top":f={x:s,y:r.y-i.height};break;case"bottom":f={x:s,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:o};break;case"left":f={x:r.x-i.width,y:o};break;default:f={x:r.x,y:r.y}}switch(C_(t)){case"start":f[a]-=l*(n&&c?-1:1);break;case"end":f[a]+=l*(n&&c?-1:1)}return f}const Kye=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:o}=n,a=s.filter(Boolean),u=await(o.isRTL==null?void 0:o.isRTL(t));let l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:f}=f5(l,r,u),d=r,h={},p=0;for(let m=0;m({name:"arrow",options:e,async fn(t){const{element:n,padding:r=0}=e??{},{x:i,y:s,placement:o,rects:a,platform:u}=t;if(n==null)return{};const l=yk(r),c={x:i,y:s},f=Zd(o),d=C_(o),h=gk(f),p=await u.getDimensions(n),m=f==="y"?"top":"left",y=f==="y"?"bottom":"right",g=a.reference[h]+a.reference[f]-c[f]-a.floating[h],_=c[f]-a.reference[f],b=await(u.getOffsetParent==null?void 0:u.getOffsetParent(n));let T=b?f==="y"?b.clientHeight||0:b.clientWidth||0:0;T===0&&(T=a.floating[h]);const I=g/2-_/2,E=l[m],S=T-p[h]-l[y],A=T/2-p[h]/2+I,P=LP(E,A,S),V=(d==="start"?l[m]:l[y])>0&&A!==P&&a.reference[h]<=a.floating[h];return{[f]:c[f]-(V?AQye[t])}function Xye(e,t,n){n===void 0&&(n=!1);const r=C_(e),i=Zd(e),s=gk(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(o=SE(o)),{main:o,cross:SE(o)}}const Jye={start:"end",end:"start"};function h5(e){return e.replace(/start|end/g,t=>Jye[t])}const Zye=["top","right","bottom","left"];Zye.reduce((e,t)=>e.concat(t,t+"-start",t+"-end"),[]);const yY=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:i,rects:s,initialPlacement:o,platform:a,elements:u}=t,{mainAxis:l=!0,crossAxis:c=!0,fallbackPlacements:f,fallbackStrategy:d="bestFit",flipAlignment:h=!0,...p}=e,m=Sl(r),y=f||(m===o||!h?[SE(o)]:function(A){const P=SE(A);return[h5(A),P,h5(P)]}(o)),g=[o,...y],_=await _k(t,p),b=[];let T=((n=i.flip)==null?void 0:n.overflows)||[];if(l&&b.push(_[m]),c){const{main:A,cross:P}=Xye(r,s,await(a.isRTL==null?void 0:a.isRTL(u.floating)));b.push(_[A],_[P])}if(T=[...T,{placement:r,overflows:b}],!b.every(A=>A<=0)){var I,E;const A=((I=(E=i.flip)==null?void 0:E.index)!=null?I:0)+1,P=g[A];if(P)return{data:{index:A,overflows:T},reset:{placement:P}};let V="bottom";switch(d){case"bestFit":{var S;const M=(S=T.map(H=>[H,H.overflows.filter(J=>J>0).reduce((J,Y)=>J+Y,0)]).sort((H,J)=>H[1]-J[1])[0])==null?void 0:S[0].placement;M&&(V=M);break}case"initialPlacement":V=o}if(r!==V)return{reset:{placement:V}}}return{}}}},_Y=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,i=await async function(s,o){const{placement:a,platform:u,elements:l}=s,c=await(u.isRTL==null?void 0:u.isRTL(l.floating)),f=Sl(a),d=C_(a),h=Zd(a)==="x",p=["left","top"].includes(f)?-1:1,m=c&&h?-1:1,y=typeof o=="function"?o(s):o;let{mainAxis:g,crossAxis:_,alignmentAxis:b}=typeof y=="number"?{mainAxis:y,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...y};return d&&typeof b=="number"&&(_=d==="end"?-1*b:b),h?{x:_*m,y:g*p}:{x:g*p,y:_*m}}(t,e);return{x:n+i.x,y:r+i.y,data:i}}}};function vY(e){return e==="x"?"y":"x"}const vk=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:y=>{let{x:g,y:_}=y;return{x:g,y:_}}},...u}=e,l={x:n,y:r},c=await _k(t,u),f=Zd(Sl(i)),d=vY(f);let h=l[f],p=l[d];if(s){const y=f==="y"?"bottom":"right";h=LP(h+c[f==="y"?"top":"left"],h,h-c[y])}if(o){const y=d==="y"?"bottom":"right";p=LP(p+c[d==="y"?"top":"left"],p,p-c[y])}const m=a.fn({...t,[f]:h,[d]:p});return{...m,data:{x:m.x-n,y:m.y-r}}}}},e_e=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:s,middlewareData:o}=t,{offset:a=0,mainAxis:u=!0,crossAxis:l=!0}=e,c={x:n,y:r},f=Zd(i),d=vY(f);let h=c[f],p=c[d];const m=typeof a=="function"?a(t):a,y=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(u){const I=f==="y"?"height":"width",E=s.reference[f]-s.floating[I]+y.mainAxis,S=s.reference[f]+s.reference[I]-y.mainAxis;hS&&(h=S)}if(l){var g,_,b,T;const I=f==="y"?"width":"height",E=["top","left"].includes(Sl(i)),S=s.reference[d]-s.floating[I]+(E&&(g=(_=o.offset)==null?void 0:_[d])!=null?g:0)+(E?0:y.crossAxis),A=s.reference[d]+s.reference[I]+(E?0:(b=(T=o.offset)==null?void 0:T[d])!=null?b:0)-(E?y.crossAxis:0);pA&&(p=A)}return{[f]:h,[d]:p}}}},t_e=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:i,elements:s}=t,{apply:o=()=>{},...a}=e,u=await _k(t,a),l=Sl(n),c=C_(n);let f,d;l==="top"||l==="bottom"?(f=l,d=c===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(d=l,f=c==="end"?"top":"bottom");const h=lc(u.left,0),p=lc(u.right,0),m=lc(u.top,0),y=lc(u.bottom,0),g={availableHeight:r.floating.height-(["left","right"].includes(n)?2*(m!==0||y!==0?m+y:lc(u.top,u.bottom)):u[f]),availableWidth:r.floating.width-(["top","bottom"].includes(n)?2*(h!==0||p!==0?h+p:lc(u.left,u.right)):u[d])};await o({...t,...g});const _=await i.getDimensions(s.floating);return r.floating.width!==_.width||r.floating.height!==_.height?{reset:{rects:!0}}:{}}}},bY=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(t){var n;const{placement:r,elements:i,rects:s,platform:o,strategy:a}=t,{padding:u=2,x:l,y:c}=e,f=Ty(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({rect:s.reference,offsetParent:await(o.getOffsetParent==null?void 0:o.getOffsetParent(i.floating)),strategy:a}):s.reference),d=(n=await(o.getClientRects==null?void 0:o.getClientRects(i.reference)))!=null?n:[],h=yk(u),p=await o.getElementRects({reference:{getBoundingClientRect:function(){var m;if(d.length===2&&d[0].left>d[1].right&&l!=null&&c!=null)return(m=d.find(y=>l>y.left-h.left&&ly.top-h.top&&c=2){if(Zd(r)==="x"){const E=d[0],S=d[d.length-1],A=Sl(r)==="top",P=E.top,V=S.bottom,M=A?E.left:S.left,H=A?E.right:S.right;return{top:P,bottom:V,left:M,right:H,width:H-M,height:V-P,x:M,y:P}}const y=Sl(r)==="left",g=lc(...d.map(E=>E.right)),_=gY(...d.map(E=>E.left)),b=d.filter(E=>y?E.left===_:E.right===g),T=b[0].top,I=b[b.length-1].bottom;return{top:T,bottom:I,left:_,right:g,width:g-_,height:I-T,x:_,y:T}}return f}},floating:i.floating,strategy:a});return s.reference.x!==p.reference.x||s.reference.y!==p.reference.y||s.reference.width!==p.reference.width||s.reference.height!==p.reference.height?{reset:{rects:p}}:{}}}};function EY(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function zl(e){if(e==null)return window;if(!EY(e)){const t=e.ownerDocument;return t&&t.defaultView||window}return e}function Xc(e){return zl(e).getComputedStyle(e)}function Jc(e){return EY(e)?"":e?(e.nodeName||"").toLowerCase():""}function wY(){const e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(t=>t.brand+"/"+t.version).join(" "):navigator.userAgent}function Il(e){return e instanceof zl(e).HTMLElement}function dl(e){return e instanceof zl(e).Element}function p5(e){return typeof ShadowRoot>"u"?!1:e instanceof zl(e).ShadowRoot||e instanceof ShadowRoot}function KS(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Xc(e);return/auto|scroll|overlay|hidden/.test(t+r+n)&&!["inline","contents"].includes(i)}function n_e(e){return["table","td","th"].includes(Jc(e))}function MP(e){const t=/firefox/i.test(wY()),n=Xc(e),r=n.backdropFilter||n.WebkitBackdropFilter;return n.transform!=="none"||n.perspective!=="none"||!!r&&r!=="none"||t&&n.willChange==="filter"||t&&!!n.filter&&n.filter!=="none"||["transform","perspective"].some(i=>n.willChange.includes(i))||["paint","layout","strict","content"].some(i=>{const s=n.contain;return s!=null&&s.includes(i)})}function TY(){return!/^((?!chrome|android).)*safari/i.test(wY())}function bk(e){return["html","body","#document"].includes(Jc(e))}const m5=Math.min,A0=Math.max,IE=Math.round;function hl(e,t,n){var r,i,s,o;t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect();let u=1,l=1;t&&Il(e)&&(u=e.offsetWidth>0&&IE(a.width)/e.offsetWidth||1,l=e.offsetHeight>0&&IE(a.height)/e.offsetHeight||1);const c=dl(e)?zl(e):window,f=!TY()&&n,d=(a.left+(f&&(r=(i=c.visualViewport)==null?void 0:i.offsetLeft)!=null?r:0))/u,h=(a.top+(f&&(s=(o=c.visualViewport)==null?void 0:o.offsetTop)!=null?s:0))/l,p=a.width/u,m=a.height/l;return{width:p,height:m,top:h,right:d+p,bottom:h+m,left:d,x:d,y:h}}function Fc(e){return(t=e,(t instanceof zl(t).Node?e.ownerDocument:e.document)||window.document).documentElement;var t}function QS(e){return dl(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function SY(e){return hl(Fc(e)).left+QS(e).scrollLeft}function r_e(e,t,n){const r=Il(t),i=Fc(t),s=hl(e,r&&function(u){const l=hl(u);return IE(l.width)!==u.offsetWidth||IE(l.height)!==u.offsetHeight}(t),n==="fixed");let o={scrollLeft:0,scrollTop:0};const a={x:0,y:0};if(r||!r&&n!=="fixed")if((Jc(t)!=="body"||KS(i))&&(o=QS(t)),Il(t)){const u=hl(t,!0);a.x=u.x+t.clientLeft,a.y=u.y+t.clientTop}else i&&(a.x=SY(i));return{x:s.left+o.scrollLeft-a.x,y:s.top+o.scrollTop-a.y,width:s.width,height:s.height}}function xE(e){if(Jc(e)==="html")return e;const t=e.assignedSlot||e.parentNode||(p5(e)?e.host:null)||Fc(e);return p5(t)?t.host:t}function g5(e){return Il(e)&&Xc(e).position!=="fixed"?e.offsetParent:null}function y5(e){const t=zl(e);let n=g5(e);for(;n&&n_e(n)&&Xc(n).position==="static";)n=g5(n);return n&&(Jc(n)==="html"||Jc(n)==="body"&&Xc(n).position==="static"&&!MP(n))?t:n||function(r){let i=xE(r);for(;Il(i)&&!bk(i);){if(MP(i))return i;i=xE(i)}return null}(e)||t}function _5(e){if(Il(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=hl(e);return{width:t.width,height:t.height}}function IY(e){const t=xE(e);return bk(t)?e.ownerDocument.body:Il(t)&&KS(t)?t:IY(t)}function pl(e,t){var n;t===void 0&&(t=[]);const r=IY(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),s=zl(r),o=i?[s].concat(s.visualViewport||[],KS(r)?r:[]):r,a=t.concat(o);return i?a:a.concat(pl(o))}function v5(e,t,n){return t==="viewport"?Ty(function(r,i){const s=zl(r),o=Fc(r),a=s.visualViewport;let u=o.clientWidth,l=o.clientHeight,c=0,f=0;if(a){u=a.width,l=a.height;const d=TY();(d||!d&&i==="fixed")&&(c=a.offsetLeft,f=a.offsetTop)}return{width:u,height:l,x:c,y:f}}(e,n)):dl(t)?function(r,i){const s=hl(r,!1,i==="fixed"),o=s.top+r.clientTop,a=s.left+r.clientLeft;return{top:o,left:a,x:a,y:o,right:a+r.clientWidth,bottom:o+r.clientHeight,width:r.clientWidth,height:r.clientHeight}}(t,n):Ty(function(r){var i;const s=Fc(r),o=QS(r),a=(i=r.ownerDocument)==null?void 0:i.body,u=A0(s.scrollWidth,s.clientWidth,a?a.scrollWidth:0,a?a.clientWidth:0),l=A0(s.scrollHeight,s.clientHeight,a?a.scrollHeight:0,a?a.clientHeight:0);let c=-o.scrollLeft+SY(r);const f=-o.scrollTop;return Xc(a||s).direction==="rtl"&&(c+=A0(s.clientWidth,a?a.clientWidth:0)-u),{width:u,height:l,x:c,y:f}}(Fc(e)))}const i_e={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const s=n==="clippingAncestors"?function(l){let c=pl(l).filter(h=>dl(h)&&Jc(h)!=="body"),f=l,d=null;for(;dl(f)&&!bk(f);){const h=Xc(f);h.position==="static"&&d&&["absolute","fixed"].includes(d.position)&&!MP(f)?c=c.filter(p=>p!==f):d=h,f=xE(f)}return c}(t):[].concat(n),o=[...s,r],a=o[0],u=o.reduce((l,c)=>{const f=v5(t,c,i);return l.top=A0(f.top,l.top),l.right=m5(f.right,l.right),l.bottom=m5(f.bottom,l.bottom),l.left=A0(f.left,l.left),l},v5(t,a,i));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const i=Il(n),s=Fc(n);if(n===s)return t;let o={scrollLeft:0,scrollTop:0};const a={x:0,y:0};if((i||!i&&r!=="fixed")&&((Jc(n)!=="body"||KS(s))&&(o=QS(n)),Il(n))){const u=hl(n,!0);a.x=u.x+n.clientLeft,a.y=u.y+n.clientTop}return{...t,x:t.x-o.scrollLeft+a.x,y:t.y-o.scrollTop+a.y}},isElement:dl,getDimensions:_5,getOffsetParent:y5,getDocumentElement:Fc,getElementRects:e=>{let{reference:t,floating:n,strategy:r}=e;return{reference:r_e(t,y5(n),r),floating:{..._5(n),x:0,y:0}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>Xc(e).direction==="rtl"};function s_e(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=!0,animationFrame:a=!1}=r,u=i&&!a,l=u||s?[...dl(e)?pl(e):e.contextElement?pl(e.contextElement):[],...pl(t)]:[];l.forEach(h=>{u&&h.addEventListener("scroll",n,{passive:!0}),s&&h.addEventListener("resize",n)});let c,f=null;if(o){let h=!0;f=new ResizeObserver(()=>{h||n(),h=!1}),dl(e)&&!a&&f.observe(e),dl(e)||!e.contextElement||a||f.observe(e.contextElement),f.observe(t)}let d=a?hl(e):null;return a&&function h(){const p=hl(e);!d||p.x===d.x&&p.y===d.y&&p.width===d.width&&p.height===d.height||n(),d=p,c=requestAnimationFrame(h)}(),n(),()=>{var h;l.forEach(p=>{u&&p.removeEventListener("scroll",n),s&&p.removeEventListener("resize",n)}),(h=f)==null||h.disconnect(),f=null,a&&cancelAnimationFrame(c)}}const o_e=(e,t,n)=>Kye(e,t,{platform:i_e,...n});var FP=typeof document<"u"?w.useLayoutEffect:w.useEffect;function CE(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!CE(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const s=i[r];if(!(s==="_owner"&&e.$$typeof)&&!CE(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function a_e(e){const t=w.useRef(e);return FP(()=>{t.current=e}),t}function u_e(e){let{middleware:t=[],placement:n="bottom",strategy:r="absolute",whileElementsMounted:i}=e===void 0?{}:e;const[s,o]=w.useState({x:null,y:null,strategy:r,placement:n,middlewareData:{}}),[a,u]=w.useState(t);CE(a,t)||u(t);const l=w.useRef(null),c=w.useRef(null),f=w.useRef(null),d=w.useRef(s),h=a_e(i),p=w.useCallback(()=>{!l.current||!c.current||o_e(l.current,c.current,{middleware:a,placement:n,strategy:r}).then(T=>{m.current&&!CE(d.current,T)&&(d.current=T,b_.flushSync(()=>{o(T)}))})},[a,n,r]);FP(()=>{m.current&&p()},[p]);const m=w.useRef(!1);FP(()=>(m.current=!0,()=>{m.current=!1}),[]);const y=w.useCallback(()=>{if(typeof f.current=="function"&&(f.current(),f.current=null),l.current&&c.current)if(h.current){const T=h.current(l.current,c.current,p);f.current=T}else p()},[p,h]),g=w.useCallback(T=>{l.current=T,y()},[y]),_=w.useCallback(T=>{c.current=T,y()},[y]),b=w.useMemo(()=>({reference:l,floating:c}),[]);return w.useMemo(()=>({...s,update:p,refs:b,reference:g,floating:_}),[s,p,b,g,_])}const xY=e=>{const{element:t,padding:n}=e;function r(i){return Object.prototype.hasOwnProperty.call(i,"current")}return{name:"arrow",options:e,fn(i){return r(t)?t.current!=null?d5({element:t.current,padding:n}).fn(i):{}:t?d5({element:t,padding:n}).fn(i):{}}}};var Kp=typeof document<"u"?w.useLayoutEffect:w.useEffect;function l_e(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(i=>i(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){e.set(t,(e.get(t)||[]).filter(r=>r!==n))}}}let RC=!1,c_e=0;const b5=()=>"floating-ui-"+c_e++;function f_e(){const[e,t]=w.useState(()=>RC?b5():void 0);return Kp(()=>{e==null&&t(b5())},[]),w.useEffect(()=>{RC||(RC=!0)},[]),e}const E5=Id.useId,w5=E5??f_e,d_e=w.createContext(null),h_e=w.createContext(null),CY=()=>{var e,t;return(e=(t=w.useContext(d_e))==null?void 0:t.id)!=null?e:null},Ek=()=>w.useContext(h_e);function mc(e){var t;return(t=e==null?void 0:e.ownerDocument)!=null?t:document}function AY(e){var t;return(t=mc(e).defaultView)!=null?t:window}function Zf(e){return e?e instanceof AY(e).Element:!1}function p_e(e){return e?e instanceof AY(e).HTMLElement:!1}const T5=Id.useInsertionEffect;function m_e(e){const t=w.useRef(()=>{});return T5?T5(()=>{t.current=e}):t.current=e,w.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;il_e())[0],p=u_e({placement:i,middleware:s,strategy:o,whileElementsMounted:r}),m=m_e(n),y=w.useMemo(()=>({...p.refs,domReference:f}),[p.refs]),g=w.useMemo(()=>({...p,refs:y,dataRef:d,nodeId:a,events:h,open:t,onOpenChange:m,_:{domReference:u}}),[p,a,h,t,m,y,u]);Kp(()=>{const T=c==null?void 0:c.nodesRef.current.find(I=>I.id===a);T&&(T.context=g)});const{reference:_}=p,b=w.useCallback(T=>{(Zf(T)||T===null)&&(g.refs.domReference.current=T,l(T)),_(T)},[_,g.refs]);return w.useMemo(()=>({...p,context:g,refs:y,reference:b}),[p,y,g,b])}function NC(e,t,n){const r=new Map;return{...n==="floating"&&{tabIndex:-1},...e,...t.map(i=>i?i[n]:null).concat(e).reduce((i,s)=>(s&&Object.entries(s).forEach(o=>{let[a,u]=o;if(a.indexOf("on")===0){if(r.has(a)||r.set(a,[]),typeof u=="function"){var l;(l=r.get(a))==null||l.push(u),i[a]=function(){for(var c,f=arguments.length,d=new Array(f),h=0;hp(...d))}}}else i[a]=u}),i),{})}}const g_e=function(e){e===void 0&&(e=[]);const t=e,n=w.useCallback(s=>NC(s,e,"reference"),t),r=w.useCallback(s=>NC(s,e,"floating"),t),i=w.useCallback(s=>NC(s,e,"item"),t);return w.useMemo(()=>({getReferenceProps:n,getFloatingProps:r,getItemProps:i}),[n,r,i])};function kC(e,t){var n;let r=(n=e.filter(o=>{var a;return o.parentId===t&&((a=o.context)==null?void 0:a.open)}))!=null?n:[],i=r;for(;i.length;){var s;i=(s=e.filter(o=>{var a;return(a=i)==null?void 0:a.some(u=>{var l;return o.parentId===u.id&&((l=o.context)==null?void 0:l.open)})}))!=null?s:[],r=r.concat(i)}return r}function y_e(e){return"composedPath"in e?e.composedPath()[0]:e.target}function S5(e){const t=w.useRef(e);return Kp(()=>{t.current=e}),t}function __e(e){const t=w.useRef();return Kp(()=>{t.current=e},[e]),t.current}function eb(e,t,n){return n&&n!=="mouse"?0:typeof e=="number"?e:e==null?void 0:e[t]}const v_e=function(e,t){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:s=!1,restMs:o=0,move:a=!0}=t===void 0?{}:t;const{open:u,onOpenChange:l,dataRef:c,events:f,refs:d,_:h}=e,p=Ek(),m=CY(),y=S5(i),g=S5(r),_=__e(u),b=w.useRef(),T=w.useRef(),I=w.useRef(),E=w.useRef(),S=w.useRef(!0),A=w.useRef(!1),P=w.useCallback(()=>{var J;const Y=(J=c.current.openEvent)==null?void 0:J.type;return(Y==null?void 0:Y.includes("mouse"))&&Y!=="mousedown"},[c]);w.useEffect(()=>{if(!n)return;function J(){clearTimeout(T.current),clearTimeout(E.current),S.current=!0}return f.on("dismiss",J),()=>{f.off("dismiss",J)}},[n,f,d]),w.useEffect(()=>{if(!n||!y.current)return;function J(){P()&&l(!1)}const Y=mc(d.floating.current).documentElement;return Y.addEventListener("mouseleave",J),()=>{Y.removeEventListener("mouseleave",J)}},[d,l,n,y,c,P]);const V=w.useCallback(function(J){J===void 0&&(J=!0);const Y=eb(g.current,"close",b.current);Y&&!I.current?(clearTimeout(T.current),T.current=setTimeout(()=>l(!1),Y)):J&&(clearTimeout(T.current),l(!1))},[g,l]),M=w.useCallback(()=>{I.current&&(mc(d.floating.current).removeEventListener("pointermove",I.current),I.current=void 0)},[d]),H=w.useCallback(()=>{mc(d.floating.current).body.style.pointerEvents="",A.current=!1},[d]);return w.useEffect(()=>{if(!n)return;function J(){return c.current.openEvent?["click","mousedown"].includes(c.current.openEvent.type):!1}function Y(se){if(clearTimeout(T.current),S.current=!1,s&&b.current!=="mouse"||o>0&&eb(g.current,"open")===0)return;c.current.openEvent=se;const K=eb(g.current,"open",b.current);K?T.current=setTimeout(()=>{l(!0)},K):l(!0)}function ye(se){if(J())return;const K=mc(d.floating.current);if(clearTimeout(E.current),y.current){clearTimeout(T.current),I.current&&K.removeEventListener("pointermove",I.current),I.current=y.current({...e,tree:p,x:se.clientX,y:se.clientY,onClose(){H(),M(),V()}}),K.addEventListener("pointermove",I.current);return}V()}function he(se){J()||y.current==null||y.current({...e,tree:p,x:se.clientX,y:se.clientY,leave:!0,onClose(){H(),M(),V()}})(se)}const ve=d.floating.current,te=d.domReference.current;if(Zf(te))return u&&te.addEventListener("mouseleave",he),ve==null||ve.addEventListener("mouseleave",he),a&&te.addEventListener("mousemove",Y,{once:!0}),te.addEventListener("mouseenter",Y),te.addEventListener("mouseleave",ye),()=>{u&&te.removeEventListener("mouseleave",he),ve==null||ve.removeEventListener("mouseleave",he),a&&te.removeEventListener("mousemove",Y),te.removeEventListener("mouseenter",Y),te.removeEventListener("mouseleave",ye)}},[h.domReference,n,e,s,o,a,V,M,H,l,u,p,d,g,y,c]),Kp(()=>{if(n&&u&&y.current&&y.current.__options.blockPointerEvents&&P()){mc(d.floating.current).body.style.pointerEvents="none",A.current=!0;const ye=d.domReference.current,he=d.floating.current;if(Zf(ye)&&he){var J,Y;const ve=p==null||(J=p.nodesRef.current.find(te=>te.id===m))==null||(Y=J.context)==null?void 0:Y.refs.floating.current;return ve&&(ve.style.pointerEvents=""),ye.style.pointerEvents="auto",he.style.pointerEvents="auto",()=>{ye.style.pointerEvents="",he.style.pointerEvents=""}}}},[n,u,m,d,p,y,c,P]),Kp(()=>{_&&!u&&(b.current=void 0,M(),H())}),w.useEffect(()=>()=>{M(),clearTimeout(T.current),clearTimeout(E.current),A.current&&H()},[n,M,H]),w.useMemo(()=>{if(!n)return{};function J(Y){b.current=Y.pointerType}return{reference:{onPointerDown:J,onPointerEnter:J,onMouseMove(){u||o===0||(clearTimeout(E.current),E.current=setTimeout(()=>{S.current||l(!0)},o))}},floating:{onMouseEnter(){clearTimeout(T.current)},onMouseLeave(){V(!1)}}}},[n,o,u,l,V])},OY=w.createContext({delay:1e3,initialDelay:1e3,currentId:null,setCurrentId:()=>{},setState:()=>{}}),PY=()=>w.useContext(OY),b_e=e=>{let{children:t,delay:n}=e;const[r,i]=w.useState({delay:n,initialDelay:n,currentId:null}),s=w.useCallback(o=>{i(a=>({...a,currentId:o}))},[]);return w.createElement(OY.Provider,{value:w.useMemo(()=>({...r,setState:i,setCurrentId:s}),[r,i,s])},t)},E_e=(e,t)=>{let{open:n,onOpenChange:r}=e,{id:i}=t;const{currentId:s,initialDelay:o,setState:a}=PY();w.useEffect(()=>{s&&(a(u=>({...u,delay:{open:1,close:eb(o,"close")}})),s!==i&&r(!1))},[i,r,a,s,o]),w.useEffect(()=>{!n&&s===i&&(r(!1),a(u=>({...u,delay:o,currentId:null})))},[n,a,s,i,r,o])},w_e=function(e,t){let{open:n}=e,{enabled:r=!0,role:i="dialog"}=t===void 0?{}:t;const s=w5(),o=w5();return w.useMemo(()=>{const a={id:s,role:i};return r?i==="tooltip"?{reference:{"aria-describedby":n?s:void 0},floating:a}:{reference:{"aria-expanded":n?"true":"false","aria-haspopup":i==="alertdialog"?"dialog":i,"aria-controls":n?s:void 0,...i==="listbox"&&{role:"combobox"},...i==="menu"&&{id:o}},floating:{...a,...i==="menu"&&{"aria-labelledby":o}}}:{}},[r,i,n,s,o])};function DC(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}const T_e={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},S_e={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},I_e=function(e,t){let{open:n,onOpenChange:r,refs:i,events:s,nodeId:o}=e,{enabled:a=!0,escapeKey:u=!0,outsidePress:l=!0,outsidePressEvent:c="pointerdown",referencePress:f=!1,referencePressEvent:d="pointerdown",ancestorScroll:h=!1,bubbles:p=!0}=t===void 0?{}:t;const m=Ek(),y=CY()!=null,g=w.useRef(!1);return w.useEffect(()=>{if(!n||!a)return;function _(S){if(S.key==="Escape"){if(!p&&m&&kC(m.nodesRef.current,o).length>0)return;s.emit("dismiss",{preventScroll:!1}),r(!1)}}function b(S){const A=g.current;if(g.current=!1,A)return;const P=y_e(S);if(Zf(P)&&i.floating.current){var V;const H=(V=i.floating.current.ownerDocument.defaultView)!=null?V:window,J=P.scrollWidth>P.clientWidth,Y=P.scrollHeight>P.clientHeight;let ye=Y&&S.offsetX>P.clientWidth;if(Y&&H.getComputedStyle(P).direction==="rtl"&&(ye=S.offsetX<=P.offsetWidth-P.clientWidth),ye||J&&S.offsetY>P.clientHeight)return}const M=m&&kC(m.nodesRef.current,o).some(H=>{var J;return DC(S,(J=H.context)==null?void 0:J.refs.floating.current)});DC(S,i.floating.current)||DC(S,i.domReference.current)||M||!p&&m&&kC(m.nodesRef.current,o).length>0||(s.emit("dismiss",y?{preventScroll:!0}:!1),r(!1))}function T(){r(!1)}const I=mc(i.floating.current);u&&I.addEventListener("keydown",_),l&&I.addEventListener(c,b);let E=[];return h&&(Zf(i.domReference.current)&&(E=pl(i.domReference.current)),Zf(i.floating.current)&&(E=E.concat(pl(i.floating.current))),!Zf(i.reference.current)&&i.reference.current&&i.reference.current.contextElement&&(E=E.concat(pl(i.reference.current.contextElement)))),E=E.filter(S=>{var A;return S!==((A=I.defaultView)==null?void 0:A.visualViewport)}),E.forEach(S=>{S.addEventListener("scroll",T,{passive:!0})}),()=>{u&&I.removeEventListener("keydown",_),l&&I.removeEventListener(c,b),E.forEach(S=>{S.removeEventListener("scroll",T)})}},[u,l,c,s,m,o,n,r,h,a,p,i,y]),w.useEffect(()=>{g.current=!1},[l,c]),w.useMemo(()=>a?{reference:{[T_e[d]]:()=>{f&&(s.emit("dismiss"),r(!1))}},floating:{[S_e[c]]:()=>{g.current=!0}}}:{},[a,s,f,c,d,r])},x_e=function(e,t){let{open:n,onOpenChange:r,dataRef:i,refs:s,events:o}=e,{enabled:a=!0,keyboardOnly:u=!0}=t===void 0?{}:t;const l=w.useRef(""),c=w.useRef(!1),f=w.useRef();return w.useEffect(()=>{var d;if(!a)return;const p=(d=mc(s.floating.current).defaultView)!=null?d:window;function m(){!n&&p_e(s.domReference.current)&&s.domReference.current.blur()}return p.addEventListener("blur",m),()=>{p.removeEventListener("blur",m)}},[s,n,a]),w.useEffect(()=>{if(!a)return;function d(){c.current=!0}return o.on("dismiss",d),()=>{o.off("dismiss",d)}},[o,a]),w.useEffect(()=>()=>{clearTimeout(f.current)},[]),w.useMemo(()=>a?{reference:{onPointerDown(d){let{pointerType:h}=d;l.current=h,c.current=!!(h&&u)},onPointerLeave(){c.current=!1},onFocus(d){var h,p,m;c.current||d.type==="focus"&&((h=i.current.openEvent)==null?void 0:h.type)==="mousedown"&&(p=s.domReference.current)!=null&&p.contains((m=i.current.openEvent)==null?void 0:m.target)||(i.current.openEvent=d.nativeEvent,r(!0))},onBlur(d){const h=d.relatedTarget;f.current=setTimeout(()=>{var p,m;(p=s.floating.current)!=null&&p.contains(h)||(m=s.domReference.current)!=null&&m.contains(h)||(c.current=!1,r(!1))})}}}:{},[a,u,s,i,r])};function RY({opened:e,floating:t,positionDependencies:n}){const[r,i]=w.useState(0);w.useEffect(()=>{if(t.refs.reference.current&&t.refs.floating.current)return s_e(t.refs.reference.current,t.refs.floating.current,t.update)},[t.refs.reference,t.refs.floating,e,r]),fo(()=>{t.update()},n),fo(()=>{i(s=>s+1)},[e])}function C_e(e){const t=[_Y(e.offset)];return e.middlewares.shift&&t.push(vk({limiter:e_e()})),e.middlewares.flip&&t.push(yY()),e.middlewares.inline&&t.push(bY()),t.push(xY({element:e.arrowRef})),t}function A_e(e){const[t,n]=Oa({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),r=()=>{var o;(o=e.onClose)==null||o.call(e),n(!1)},i=()=>{var o,a;t?((o=e.onClose)==null||o.call(e),n(!1)):((a=e.onOpen)==null||a.call(e),n(!0))},s=wk({placement:e.position,middleware:[...C_e(e),...e.width==="target"?[t_e({apply({rects:o}){var a,u;Object.assign((u=(a=s.refs.floating.current)==null?void 0:a.style)!=null?u:{},{width:`${o.reference.width}px`})}})]:[]]});return RY({opened:e.opened,positionDependencies:e.positionDependencies,floating:s}),fo(()=>{var o;(o=e.onPositionChange)==null||o.call(e,s.placement)},[s.placement]),{floating:s,controlled:typeof e.opened=="boolean",opened:t,onClose:r,onToggle:i}}const NY={context:"Popover component was not found in the tree",children:"Popover.Target component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported"},[O_e,kY]=XN(NY.context);var P_e=Object.defineProperty,R_e=Object.defineProperties,N_e=Object.getOwnPropertyDescriptors,AE=Object.getOwnPropertySymbols,DY=Object.prototype.hasOwnProperty,$Y=Object.prototype.propertyIsEnumerable,I5=(e,t,n)=>t in e?P_e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Wv=(e,t)=>{for(var n in t||(t={}))DY.call(t,n)&&I5(e,n,t[n]);if(AE)for(var n of AE(t))$Y.call(t,n)&&I5(e,n,t[n]);return e},k_e=(e,t)=>R_e(e,N_e(t)),D_e=(e,t)=>{var n={};for(var r in e)DY.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&AE)for(var r of AE(e))t.indexOf(r)<0&&$Y.call(e,r)&&(n[r]=e[r]);return n};const LY=w.forwardRef((e,t)=>{var n=e,{children:r,refProp:i="ref",popupType:s="dialog"}=n,o=D_e(n,["children","refProp","popupType"]);if(!Dm(r))throw new Error(NY.children);const a=o,u=kY(),l=Ko(u.reference,r.ref,t),c=u.withRoles?{"aria-haspopup":s,"aria-expanded":u.opened,"aria-controls":u.getDropdownId(),id:u.getTargetId()}:{};return w.cloneElement(r,Wv(k_e(Wv(Wv(Wv({},a),c),u.targetProps),{className:mW(u.targetProps.className,a.className,r.props.className),[i]:l}),u.controlled?null:{onClick:u.onToggle}))});LY.displayName="@mantine/core/PopoverTarget";var $_e=at((e,{radius:t,shadow:n})=>({dropdown:{position:"absolute",backgroundColor:e.white,background:e.colorScheme==="dark"?e.colors.dark[6]:e.white,border:`1px solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2]}`,padding:`${e.spacing.sm}px ${e.spacing.md}px`,boxShadow:e.shadows[n]||n||"none",borderRadius:e.fn.radius(t),"&:focus":{outline:0}},arrow:{backgroundColor:"inherit",border:`1px solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2]}`,zIndex:1}}));const L_e=$_e;var M_e=Object.defineProperty,x5=Object.getOwnPropertySymbols,F_e=Object.prototype.hasOwnProperty,B_e=Object.prototype.propertyIsEnumerable,C5=(e,t,n)=>t in e?M_e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yh=(e,t)=>{for(var n in t||(t={}))F_e.call(t,n)&&C5(e,n,t[n]);if(x5)for(var n of x5(t))B_e.call(t,n)&&C5(e,n,t[n]);return e};const A5={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function MY({transition:e,state:t,duration:n,timingFunction:r}){const i={transitionDuration:`${n}ms`,transitionTimingFunction:r};return typeof e=="string"?e in Bv?yh(yh(yh({transitionProperty:Bv[e].transitionProperty},i),Bv[e].common),Bv[e][A5[t]]):null:yh(yh(yh({transitionProperty:e.transitionProperty},i),e.common),e[A5[t]])}function FY({duration:e,exitDuration:t,timingFunction:n,mounted:r,onEnter:i,onExit:s,onEntered:o,onExited:a}){const u=ts(),l=lk(),c=u.respectReducedMotion?l:!1,[f,d]=w.useState(r?"entered":"exited");let h=c?0:e;const p=w.useRef(-1),m=y=>{const g=y?i:s,_=y?o:a;if(d(y?"pre-entering":"pre-exiting"),window.clearTimeout(p.current),h=c?0:y?e:t,h===0)typeof g=="function"&&g(),typeof _=="function"&&_(),d(y?"entered":"exited");else{const b=window.setTimeout(()=>{typeof g=="function"&&g(),d(y?"entering":"exiting")},10);p.current=window.setTimeout(()=>{window.clearTimeout(b),typeof _=="function"&&_(),d(y?"entered":"exited")},h)}};return fo(()=>{m(r)},[r]),w.useEffect(()=>()=>window.clearTimeout(p.current),[]),{transitionDuration:h,transitionStatus:f,transitionTimingFunction:n||u.transitionTimingFunction}}function XS({transition:e,duration:t=250,exitDuration:n=t,mounted:r,children:i,timingFunction:s,onExit:o,onEntered:a,onEnter:u,onExited:l}){const{transitionDuration:c,transitionStatus:f,transitionTimingFunction:d}=FY({mounted:r,exitDuration:n,duration:t,timingFunction:s,onExit:o,onEntered:a,onEnter:u,onExited:l});return c===0?r?k.createElement(k.Fragment,null,i({})):null:f==="exited"?null:k.createElement(k.Fragment,null,i(MY({transition:e,duration:c,state:f,timingFunction:d})))}XS.displayName="@mantine/core/Transition";function BY({children:e,active:t=!0,refProp:n="ref"}){const r=qW(t),i=Ko(r,e==null?void 0:e.ref);return Dm(e)?w.cloneElement(e,{[n]:i}):e}BY.displayName="@mantine/core/FocusTrap";var j_e=Object.defineProperty,U_e=Object.defineProperties,V_e=Object.getOwnPropertyDescriptors,O5=Object.getOwnPropertySymbols,z_e=Object.prototype.hasOwnProperty,H_e=Object.prototype.propertyIsEnumerable,P5=(e,t,n)=>t in e?j_e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Jl=(e,t)=>{for(var n in t||(t={}))z_e.call(t,n)&&P5(e,n,t[n]);if(O5)for(var n of O5(t))H_e.call(t,n)&&P5(e,n,t[n]);return e},qv=(e,t)=>U_e(e,V_e(t));function R5(e,t,n){return e==="center"?{top:t}:e==="end"?{bottom:n}:e==="start"?{top:n}:{}}function N5(e,t,n,r){return e==="center"?{[r==="ltr"?"left":"right"]:t}:e==="end"?{[r==="ltr"?"right":"left"]:n}:e==="start"?{[r==="ltr"?"left":"right"]:n}:{}}const W_e={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function q_e({position:e,withBorder:t,arrowSize:n,arrowOffset:r,arrowRadius:i,arrowX:s,arrowY:o,dir:a}){const[u,l="center"]=e.split("-"),c={width:n,height:n,transform:"rotate(45deg)",position:"absolute",[W_e[u]]:i},f=t?-n/2-1:-n/2;return u==="left"?qv(Jl(Jl({},c),R5(l,o,r)),{right:f,borderLeft:0,borderBottom:0}):u==="right"?qv(Jl(Jl({},c),R5(l,o,r)),{left:f,borderRight:0,borderTop:0}):u==="top"?qv(Jl(Jl({},c),N5(l,s,r,a)),{bottom:f,borderTop:0,[a==="ltr"?"borderLeft":"borderRight"]:0}):u==="bottom"?qv(Jl(Jl({},c),N5(l,s,r,a)),{top:f,borderBottom:0,[a==="ltr"?"borderRight":"borderLeft"]:0}):{}}var Y_e=Object.defineProperty,G_e=Object.defineProperties,K_e=Object.getOwnPropertyDescriptors,OE=Object.getOwnPropertySymbols,jY=Object.prototype.hasOwnProperty,UY=Object.prototype.propertyIsEnumerable,k5=(e,t,n)=>t in e?Y_e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Q_e=(e,t)=>{for(var n in t||(t={}))jY.call(t,n)&&k5(e,n,t[n]);if(OE)for(var n of OE(t))UY.call(t,n)&&k5(e,n,t[n]);return e},X_e=(e,t)=>G_e(e,K_e(t)),J_e=(e,t)=>{var n={};for(var r in e)jY.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&OE)for(var r of OE(e))t.indexOf(r)<0&&UY.call(e,r)&&(n[r]=e[r]);return n};const Tk=w.forwardRef((e,t)=>{var n=e,{withBorder:r,position:i,arrowSize:s,arrowOffset:o,arrowRadius:a,visible:u,arrowX:l,arrowY:c}=n,f=J_e(n,["withBorder","position","arrowSize","arrowOffset","arrowRadius","visible","arrowX","arrowY"]);const d=ts();return u?k.createElement("div",X_e(Q_e({},f),{ref:t,style:q_e({withBorder:r,position:i,arrowSize:s,arrowOffset:o,arrowRadius:a,dir:d.dir,arrowX:l,arrowY:c})})):null});Tk.displayName="@mantine/core/FloatingArrow";var Z_e=Object.defineProperty,eve=Object.defineProperties,tve=Object.getOwnPropertyDescriptors,PE=Object.getOwnPropertySymbols,VY=Object.prototype.hasOwnProperty,zY=Object.prototype.propertyIsEnumerable,D5=(e,t,n)=>t in e?Z_e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Yv=(e,t)=>{for(var n in t||(t={}))VY.call(t,n)&&D5(e,n,t[n]);if(PE)for(var n of PE(t))zY.call(t,n)&&D5(e,n,t[n]);return e},$5=(e,t)=>eve(e,tve(t)),nve=(e,t)=>{var n={};for(var r in e)VY.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&PE)for(var r of PE(e))t.indexOf(r)<0&&zY.call(e,r)&&(n[r]=e[r]);return n};function HY(e){var t=e,{style:n,className:r,children:i,onKeyDownCapture:s}=t,o=nve(t,["style","className","children","onKeyDownCapture"]);const{classNames:a,styles:u,unstyled:l,staticSelector:c}=T_(),f=kY(),{classes:d,cx:h}=L_e({radius:f.radius,shadow:f.shadow},{name:c,classNames:a,styles:u,unstyled:l}),p=VW({opened:f.opened,shouldReturnFocus:f.returnFocus}),m=f.withRoles?{"aria-labelledby":f.getTargetId(),id:f.getDropdownId(),role:"dialog"}:{};return f.disabled?null:k.createElement(S_,{withinPortal:f.withinPortal},k.createElement(XS,{mounted:f.opened,transition:f.transition,duration:f.transitionDuration,exitDuration:typeof f.exitTransitionDuration=="number"?f.exitTransitionDuration:f.transitionDuration},y=>{var g,_;return k.createElement(BY,{active:f.trapFocus},k.createElement(ut,Yv($5(Yv({},m),{tabIndex:-1,ref:f.floating,style:$5(Yv(Yv({},n),y),{zIndex:f.zIndex,top:(g=f.y)!=null?g:0,left:(_=f.x)!=null?_:0,width:f.width==="target"?void 0:f.width}),className:h(d.dropdown,r),onKeyDownCapture:fde(f.onClose,{active:f.closeOnEscape,onTrigger:p,onKeyDown:s}),"data-position":f.placement}),o),i,k.createElement(Tk,{ref:f.arrowRef,arrowX:f.arrowX,arrowY:f.arrowY,visible:f.withArrow,withBorder:!0,position:f.placement,arrowSize:f.arrowSize,arrowRadius:f.arrowRadius,arrowOffset:f.arrowOffset,className:d.arrow})))}))}HY.displayName="@mantine/core/PopoverDropdown";function WY(e,t){if(e==="rtl"&&(t.includes("right")||t.includes("left"))){const[n,r]=t.split("-"),i=n==="right"?"left":"right";return r===void 0?i:`${i}-${r}`}return t}var L5=Object.getOwnPropertySymbols,rve=Object.prototype.hasOwnProperty,ive=Object.prototype.propertyIsEnumerable,sve=(e,t)=>{var n={};for(var r in e)rve.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&L5)for(var r of L5(e))t.indexOf(r)<0&&ive.call(e,r)&&(n[r]=e[r]);return n};const ove={position:"bottom",offset:8,positionDependencies:[],transition:"fade",transitionDuration:150,middlewares:{flip:!0,shift:!0,inline:!1},arrowSize:7,arrowOffset:5,arrowRadius:0,closeOnClickOutside:!0,withinPortal:!1,closeOnEscape:!0,trapFocus:!1,withRoles:!0,returnFocus:!1,clickOutsideEvents:["mousedown","touchstart"],zIndex:To("popover"),__staticSelector:"Popover",width:"max-content"};function Xo(e){var t,n,r,i,s,o;const a=w.useRef(null),u=ct("Popover",ove,e),{children:l,position:c,offset:f,onPositionChange:d,positionDependencies:h,opened:p,transition:m,transitionDuration:y,width:g,middlewares:_,withArrow:b,arrowSize:T,arrowOffset:I,arrowRadius:E,unstyled:S,classNames:A,styles:P,closeOnClickOutside:V,withinPortal:M,closeOnEscape:H,clickOutsideEvents:J,trapFocus:Y,onClose:ye,onOpen:he,onChange:ve,zIndex:te,radius:se,shadow:K,id:x,defaultOpened:C,exitTransitionDuration:z,__staticSelector:R,withRoles:O,disabled:q,returnFocus:le}=u,ae=sve(u,["children","position","offset","onPositionChange","positionDependencies","opened","transition","transitionDuration","width","middlewares","withArrow","arrowSize","arrowOffset","arrowRadius","unstyled","classNames","styles","closeOnClickOutside","withinPortal","closeOnEscape","clickOutsideEvents","trapFocus","onClose","onOpen","onChange","zIndex","radius","shadow","id","defaultOpened","exitTransitionDuration","__staticSelector","withRoles","disabled","returnFocus"]),[pe,me]=w.useState(null),[Se,ce]=w.useState(null),st=Fu(x),Ke=ts(),qe=A_e({middlewares:_,width:g,position:WY(Ke.dir,c),offset:f+(b?T/2:0),arrowRef:a,onPositionChange:d,positionDependencies:h,opened:p,defaultOpened:C,onChange:ve,onOpen:he,onClose:ye});fpe(()=>V&&qe.onClose(),J,[pe,Se]);const $e=w.useCallback(lt=>{me(lt),qe.floating.reference(lt)},[qe.floating.reference]),ot=w.useCallback(lt=>{ce(lt),qe.floating.floating(lt)},[qe.floating.floating]);return k.createElement(BW,{classNames:A,styles:P,unstyled:S,staticSelector:R},k.createElement(O_e,{value:{returnFocus:le,disabled:q,controlled:qe.controlled,reference:$e,floating:ot,x:qe.floating.x,y:qe.floating.y,arrowX:(r=(n=(t=qe.floating)==null?void 0:t.middlewareData)==null?void 0:n.arrow)==null?void 0:r.x,arrowY:(o=(s=(i=qe.floating)==null?void 0:i.middlewareData)==null?void 0:s.arrow)==null?void 0:o.y,opened:qe.opened,arrowRef:a,transition:m,transitionDuration:y,exitTransitionDuration:z,width:g,withArrow:b,arrowSize:T,arrowOffset:I,arrowRadius:E,placement:qe.floating.placement,trapFocus:Y,withinPortal:M,zIndex:te,radius:se,shadow:K,closeOnEscape:H,onClose:qe.onClose,onToggle:qe.onToggle,getTargetId:()=>`${st}-target`,getDropdownId:()=>`${st}-dropdown`,withRoles:O,targetProps:ae}},l))}Xo.Target=LY;Xo.Dropdown=HY;Xo.displayName="@mantine/core/Popover";var ave=Object.defineProperty,RE=Object.getOwnPropertySymbols,qY=Object.prototype.hasOwnProperty,YY=Object.prototype.propertyIsEnumerable,M5=(e,t,n)=>t in e?ave(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,uve=(e,t)=>{for(var n in t||(t={}))qY.call(t,n)&&M5(e,n,t[n]);if(RE)for(var n of RE(t))YY.call(t,n)&&M5(e,n,t[n]);return e},lve=(e,t)=>{var n={};for(var r in e)qY.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&RE)for(var r of RE(e))t.indexOf(r)<0&&YY.call(e,r)&&(n[r]=e[r]);return n};function cve(e){var t=e,{children:n,component:r="div",maxHeight:i=220,direction:s="column",id:o,innerRef:a,__staticSelector:u,styles:l,classNames:c,unstyled:f}=t,d=lve(t,["children","component","maxHeight","direction","id","innerRef","__staticSelector","styles","classNames","unstyled"]);const{classes:h}=Gye(null,{name:u,styles:l,classNames:c,unstyled:f});return k.createElement(Xo.Dropdown,uve({p:0,onMouseDown:p=>p.preventDefault()},d),k.createElement("div",{style:{maxHeight:i,display:"flex"}},k.createElement(ut,{component:r||"div",id:`${o}-items`,"aria-labelledby":`${o}-label`,role:"listbox",onMouseDown:p=>p.preventDefault(),style:{flex:1,overflowY:r!==GS?"auto":void 0},"data-combobox-popover":!0,ref:a},k.createElement("div",{className:h.itemsWrapper,style:{flexDirection:s}},n))))}function Bc({opened:e,transition:t="fade",transitionDuration:n=0,shadow:r,withinPortal:i,children:s,__staticSelector:o,onDirectionChange:a,switchDirectionOnFlip:u,zIndex:l,dropdownPosition:c,positionDependencies:f=[],classNames:d,styles:h,unstyled:p,readOnly:m}){return k.createElement(Xo,{unstyled:p,classNames:d,styles:h,width:"target",withRoles:!1,opened:e,middlewares:{flip:c==="flip",shift:!1},position:c==="flip"?"bottom":c,positionDependencies:f,zIndex:l,__staticSelector:o,withinPortal:i,transition:t,transitionDuration:n,shadow:r,disabled:m,onPositionChange:y=>u&&(a==null?void 0:a(y==="top"?"column-reverse":"column"))},s)}Bc.Target=Xo.Target;Bc.Dropdown=cve;var fve=Object.defineProperty,dve=Object.defineProperties,hve=Object.getOwnPropertyDescriptors,NE=Object.getOwnPropertySymbols,GY=Object.prototype.hasOwnProperty,KY=Object.prototype.propertyIsEnumerable,F5=(e,t,n)=>t in e?fve(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$C=(e,t)=>{for(var n in t||(t={}))GY.call(t,n)&&F5(e,n,t[n]);if(NE)for(var n of NE(t))KY.call(t,n)&&F5(e,n,t[n]);return e},pve=(e,t)=>dve(e,hve(t)),mve=(e,t)=>{var n={};for(var r in e)GY.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&NE)for(var r of NE(e))t.indexOf(r)<0&&KY.call(e,r)&&(n[r]=e[r]);return n};function QY(e,t,n){const r=ct(e,t,n),{label:i,description:s,error:o,required:a,classNames:u,styles:l,className:c,unstyled:f,__staticSelector:d,sx:h,errorProps:p,labelProps:m,descriptionProps:y,wrapperProps:g,id:_,size:b,style:T,inputContainer:I,inputWrapperOrder:E,withAsterisk:S}=r,A=mve(r,["label","description","error","required","classNames","styles","className","unstyled","__staticSelector","sx","errorProps","labelProps","descriptionProps","wrapperProps","id","size","style","inputContainer","inputWrapperOrder","withAsterisk"]),P=Fu(_),{systemStyles:V,rest:M}=Xd(A);return pve($C({},M),{classNames:u,styles:l,unstyled:f,wrapperProps:$C($C({label:i,description:s,error:o,required:a,classNames:u,className:c,__staticSelector:d,sx:h,errorProps:p,labelProps:m,descriptionProps:y,unstyled:f,styles:l,id:P,size:b,style:T,inputContainer:I,inputWrapperOrder:E,withAsterisk:S},g),V),inputProps:{required:a,classNames:u,styles:l,unstyled:f,id:P,size:b,__staticSelector:d,invalid:!!o}})}var gve=at((e,{size:t})=>({label:{display:"inline-block",fontSize:e.fn.size({size:t,sizes:e.fontSizes}),fontWeight:500,color:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[9],wordBreak:"break-word",cursor:"default",WebkitTapHighlightColor:"transparent"},required:{color:e.fn.variant({variant:"filled",color:"red"}).background}}));const yve=gve;var _ve=Object.defineProperty,kE=Object.getOwnPropertySymbols,XY=Object.prototype.hasOwnProperty,JY=Object.prototype.propertyIsEnumerable,B5=(e,t,n)=>t in e?_ve(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,vve=(e,t)=>{for(var n in t||(t={}))XY.call(t,n)&&B5(e,n,t[n]);if(kE)for(var n of kE(t))JY.call(t,n)&&B5(e,n,t[n]);return e},bve=(e,t)=>{var n={};for(var r in e)XY.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&kE)for(var r of kE(e))t.indexOf(r)<0&&JY.call(e,r)&&(n[r]=e[r]);return n};const Sk=w.forwardRef((e,t)=>{var n=e,{labelElement:r="label",children:i,required:s,size:o="sm",classNames:a,styles:u,unstyled:l,className:c,htmlFor:f,__staticSelector:d}=n,h=bve(n,["labelElement","children","required","size","classNames","styles","unstyled","className","htmlFor","__staticSelector"]);const{classes:p,cx:m}=yve({size:o},{name:["InputWrapper",d],classNames:a,styles:u,unstyled:l});return k.createElement(ut,vve({component:r,ref:t,className:m(p.label,c),htmlFor:r==="label"?f:void 0},h),i,s&&k.createElement("span",{className:p.required,"aria-hidden":!0}," *"))});Sk.displayName="@mantine/core/InputLabel";var Eve=at((e,{size:t})=>({error:{wordBreak:"break-word",color:e.fn.variant({variant:"filled",color:"red"}).background,fontSize:e.fn.size({size:t,sizes:e.fontSizes})-2,lineHeight:1.2,display:"block"}}));const wve=Eve;var Tve=Object.defineProperty,DE=Object.getOwnPropertySymbols,ZY=Object.prototype.hasOwnProperty,eG=Object.prototype.propertyIsEnumerable,j5=(e,t,n)=>t in e?Tve(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Sve=(e,t)=>{for(var n in t||(t={}))ZY.call(t,n)&&j5(e,n,t[n]);if(DE)for(var n of DE(t))eG.call(t,n)&&j5(e,n,t[n]);return e},Ive=(e,t)=>{var n={};for(var r in e)ZY.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&DE)for(var r of DE(e))t.indexOf(r)<0&&eG.call(e,r)&&(n[r]=e[r]);return n};const Ik=w.forwardRef((e,t)=>{var n=e,{children:r,className:i,classNames:s,styles:o,unstyled:a,size:u="sm",__staticSelector:l}=n,c=Ive(n,["children","className","classNames","styles","unstyled","size","__staticSelector"]);const{classes:f,cx:d}=wve({size:u},{name:["InputWrapper",l],classNames:s,styles:o,unstyled:a});return k.createElement(Tt,Sve({className:d(f.error,i),ref:t,role:"alert"},c),r)});Ik.displayName="@mantine/core/InputError";var xve=at((e,{size:t})=>({description:{wordBreak:"break-word",color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6],fontSize:e.fn.size({size:t,sizes:e.fontSizes})-2,lineHeight:1.2,display:"block"}}));const Cve=xve;var Ave=Object.defineProperty,$E=Object.getOwnPropertySymbols,tG=Object.prototype.hasOwnProperty,nG=Object.prototype.propertyIsEnumerable,U5=(e,t,n)=>t in e?Ave(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ove=(e,t)=>{for(var n in t||(t={}))tG.call(t,n)&&U5(e,n,t[n]);if($E)for(var n of $E(t))nG.call(t,n)&&U5(e,n,t[n]);return e},Pve=(e,t)=>{var n={};for(var r in e)tG.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&$E)for(var r of $E(e))t.indexOf(r)<0&&nG.call(e,r)&&(n[r]=e[r]);return n};const xk=w.forwardRef((e,t)=>{var n=e,{children:r,className:i,classNames:s,styles:o,unstyled:a,size:u="sm",__staticSelector:l}=n,c=Pve(n,["children","className","classNames","styles","unstyled","size","__staticSelector"]);const{classes:f,cx:d}=Cve({size:u},{name:["InputWrapper",l],classNames:s,styles:o,unstyled:a});return k.createElement(Tt,Ove({color:"dimmed",className:d(f.description,i),ref:t,unstyled:a},c),r)});xk.displayName="@mantine/core/InputDescription";const rG=w.createContext({offsetBottom:!1,offsetTop:!1}),Rve=rG.Provider,Nve=()=>w.useContext(rG);function kve(e,{hasDescription:t,hasError:n}){const r=e.findIndex(u=>u==="input"),i=e[r-1],s=e[r+1];return{offsetBottom:t&&s==="description"||n&&s==="error",offsetTop:t&&i==="description"||n&&i==="error"}}var Dve=Object.defineProperty,$ve=Object.defineProperties,Lve=Object.getOwnPropertyDescriptors,V5=Object.getOwnPropertySymbols,Mve=Object.prototype.hasOwnProperty,Fve=Object.prototype.propertyIsEnumerable,z5=(e,t,n)=>t in e?Dve(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Bve=(e,t)=>{for(var n in t||(t={}))Mve.call(t,n)&&z5(e,n,t[n]);if(V5)for(var n of V5(t))Fve.call(t,n)&&z5(e,n,t[n]);return e},jve=(e,t)=>$ve(e,Lve(t)),Uve=at(e=>({root:jve(Bve({},e.fn.fontStyles()),{lineHeight:e.lineHeight})}));const Vve=Uve;var zve=Object.defineProperty,Hve=Object.defineProperties,Wve=Object.getOwnPropertyDescriptors,LE=Object.getOwnPropertySymbols,iG=Object.prototype.hasOwnProperty,sG=Object.prototype.propertyIsEnumerable,H5=(e,t,n)=>t in e?zve(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Nf=(e,t)=>{for(var n in t||(t={}))iG.call(t,n)&&H5(e,n,t[n]);if(LE)for(var n of LE(t))sG.call(t,n)&&H5(e,n,t[n]);return e},W5=(e,t)=>Hve(e,Wve(t)),qve=(e,t)=>{var n={};for(var r in e)iG.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&LE)for(var r of LE(e))t.indexOf(r)<0&&sG.call(e,r)&&(n[r]=e[r]);return n};const Yve={labelElement:"label",size:"sm",inputContainer:e=>e,inputWrapperOrder:["label","description","input","error"]},oG=w.forwardRef((e,t)=>{const n=ct("InputWrapper",Yve,e),{className:r,label:i,children:s,required:o,id:a,error:u,description:l,labelElement:c,labelProps:f,descriptionProps:d,errorProps:h,classNames:p,styles:m,size:y,inputContainer:g,__staticSelector:_,unstyled:b,inputWrapperOrder:T,withAsterisk:I}=n,E=qve(n,["className","label","children","required","id","error","description","labelElement","labelProps","descriptionProps","errorProps","classNames","styles","size","inputContainer","__staticSelector","unstyled","inputWrapperOrder","withAsterisk"]),{classes:S,cx:A}=Vve(null,{classNames:p,styles:m,name:["InputWrapper",_],unstyled:b}),P={classNames:p,styles:m,unstyled:b,size:y,__staticSelector:_},V=typeof I=="boolean"?I:o,M=i&&k.createElement(Sk,Nf(Nf({key:"label",labelElement:c,id:a?`${a}-label`:void 0,htmlFor:a,required:V},P),f),i),H=l&&k.createElement(xk,W5(Nf(Nf({key:"description"},d),P),{size:(d==null?void 0:d.size)||P.size}),l),J=k.createElement(w.Fragment,{key:"input"},g(s)),Y=typeof u!="boolean"&&u&&k.createElement(Ik,W5(Nf(Nf({},h),P),{size:(h==null?void 0:h.size)||P.size,key:"error"}),u),ye=T.map(he=>{switch(he){case"label":return M;case"input":return J;case"description":return H;case"error":return Y;default:return null}});return k.createElement(Rve,{value:kve(T,{hasDescription:!!H,hasError:!!Y})},k.createElement(ut,Nf({className:A(S.root,r),ref:t},E),ye))});oG.displayName="@mantine/core/InputWrapper";var Gve=Object.defineProperty,Kve=Object.defineProperties,Qve=Object.getOwnPropertyDescriptors,q5=Object.getOwnPropertySymbols,Xve=Object.prototype.hasOwnProperty,Jve=Object.prototype.propertyIsEnumerable,Y5=(e,t,n)=>t in e?Gve(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,LC=(e,t)=>{for(var n in t||(t={}))Xve.call(t,n)&&Y5(e,n,t[n]);if(q5)for(var n of q5(t))Jve.call(t,n)&&Y5(e,n,t[n]);return e},G5=(e,t)=>Kve(e,Qve(t));const Ss={xs:30,sm:36,md:42,lg:50,xl:60};function Zve({theme:e,variant:t}){return t==="default"?{border:`1px solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]}`,backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.white,transition:"border-color 100ms ease","&:focus, &:focus-within":e.focusRingStyles.inputStyles(e)}:t==="filled"?{border:"1px solid transparent",backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1],"&:focus, &:focus-within":e.focusRingStyles.inputStyles(e)}:{borderWidth:0,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,backgroundColor:"transparent",minHeight:28,outline:0,"&:focus, &:focus-within":{outline:"none",borderColor:"transparent"},"&:disabled":{backgroundColor:"transparent","&:focus, &:focus-within":{outline:"none",borderColor:"transparent"}}}}var e1e=at((e,{size:t,multiline:n,radius:r,variant:i,invalid:s,rightSectionWidth:o,withRightSection:a,iconWidth:u,offsetBottom:l,offsetTop:c,pointer:f})=>{const d=e.fn.variant({variant:"filled",color:"red"}).background,h=i==="default"||i==="filled"?{minHeight:e.fn.size({size:t,sizes:Ss}),paddingLeft:e.fn.size({size:t,sizes:Ss})/3,paddingRight:a?o:e.fn.size({size:t,sizes:Ss})/3,borderRadius:e.fn.radius(r)}:null;return{wrapper:{position:"relative",marginTop:c?`calc(${e.spacing.xs}px / 2)`:void 0,marginBottom:l?`calc(${e.spacing.xs}px / 2)`:void 0},input:LC(G5(LC(G5(LC({},e.fn.fontStyles()),{height:n?i==="unstyled"?void 0:"auto":e.fn.size({size:t,sizes:Ss}),WebkitTapHighlightColor:"transparent",lineHeight:n?e.lineHeight:`${e.fn.size({size:t,sizes:Ss})-2}px`,appearance:"none",resize:"none",boxSizing:"border-box",fontSize:e.fn.size({size:t,sizes:e.fontSizes}),width:"100%",color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,display:"block",textAlign:"left",cursor:f?"pointer":void 0}),h),{"&:disabled":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[1],color:e.colors.dark[2],opacity:.6,cursor:"not-allowed","&::placeholder":{color:e.colors.dark[2]}},"&::placeholder":{opacity:1,userSelect:"none",color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]},"&::-webkit-inner-spin-button, &::-webkit-outer-spin-button, &::-webkit-search-decoration, &::-webkit-search-cancel-button, &::-webkit-search-results-button, &::-webkit-search-results-decoration":{appearance:"none"},"&[type=number]":{MozAppearance:"textfield"}}),Zve({theme:e,variant:i})),withIcon:{paddingLeft:typeof u=="number"?u:e.fn.size({size:t,sizes:Ss})},invalid:{color:d,borderColor:d,"&::placeholder":{opacity:1,color:d}},disabled:{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[1],color:e.colors.dark[2],opacity:.6,cursor:"not-allowed","&::placeholder":{color:e.colors.dark[2]}},icon:{pointerEvents:"none",position:"absolute",zIndex:1,left:0,top:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",width:typeof u=="number"?u:e.fn.size({size:t,sizes:Ss}),color:s?e.colors.red[e.colorScheme==="dark"?6:7]:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[5]},rightSection:{position:"absolute",top:0,bottom:0,right:0,display:"flex",alignItems:"center",justifyContent:"center",width:o}}});const t1e=e1e;var n1e=Object.defineProperty,r1e=Object.defineProperties,i1e=Object.getOwnPropertyDescriptors,ME=Object.getOwnPropertySymbols,aG=Object.prototype.hasOwnProperty,uG=Object.prototype.propertyIsEnumerable,K5=(e,t,n)=>t in e?n1e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Gv=(e,t)=>{for(var n in t||(t={}))aG.call(t,n)&&K5(e,n,t[n]);if(ME)for(var n of ME(t))uG.call(t,n)&&K5(e,n,t[n]);return e},Q5=(e,t)=>r1e(e,i1e(t)),s1e=(e,t)=>{var n={};for(var r in e)aG.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ME)for(var r of ME(e))t.indexOf(r)<0&&uG.call(e,r)&&(n[r]=e[r]);return n};const o1e={rightSectionWidth:36,size:"sm",variant:"default"},Mm=w.forwardRef((e,t)=>{const n=ct("Input",o1e,e),{className:r,invalid:i,required:s,disabled:o,variant:a,icon:u,style:l,rightSectionWidth:c,iconWidth:f,rightSection:d,rightSectionProps:h,radius:p,size:m,wrapperProps:y,classNames:g,styles:_,__staticSelector:b,multiline:T,sx:I,unstyled:E,pointer:S}=n,A=s1e(n,["className","invalid","required","disabled","variant","icon","style","rightSectionWidth","iconWidth","rightSection","rightSectionProps","radius","size","wrapperProps","classNames","styles","__staticSelector","multiline","sx","unstyled","pointer"]),{offsetBottom:P,offsetTop:V}=Nve(),{classes:M,cx:H}=t1e({radius:p,size:m,multiline:T,variant:a,invalid:i,rightSectionWidth:c,iconWidth:f,withRightSection:!!d,offsetBottom:P,offsetTop:V,pointer:S},{classNames:g,styles:_,name:["Input",b],unstyled:E}),{systemStyles:J,rest:Y}=Xd(A);return k.createElement(ut,Gv(Gv({className:H(M.wrapper,r),sx:I,style:l},J),y),u&&k.createElement("div",{className:M.icon},u),k.createElement(ut,Q5(Gv({component:"input"},Y),{ref:t,required:s,"aria-invalid":i,disabled:o,className:H(M[`${a}Variant`],M.input,{[M.withIcon]:u,[M.invalid]:i,[M.disabled]:o})})),d&&k.createElement("div",Q5(Gv({},h),{className:M.rightSection}),d))});Mm.displayName="@mantine/core/Input";Mm.Wrapper=oG;Mm.Label=Sk;Mm.Description=xk;Mm.Error=Ik;const Bs=Mm;var a1e=Object.defineProperty,u1e=Object.defineProperties,l1e=Object.getOwnPropertyDescriptors,X5=Object.getOwnPropertySymbols,c1e=Object.prototype.hasOwnProperty,f1e=Object.prototype.propertyIsEnumerable,J5=(e,t,n)=>t in e?a1e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,MC=(e,t)=>{for(var n in t||(t={}))c1e.call(t,n)&&J5(e,n,t[n]);if(X5)for(var n of X5(t))f1e.call(t,n)&&J5(e,n,t[n]);return e},d1e=(e,t)=>u1e(e,l1e(t));const FC={xs:{fontSize:9,height:16},sm:{fontSize:10,height:18},md:{fontSize:11,height:20},lg:{fontSize:13,height:26},xl:{fontSize:16,height:32}},h1e={xs:4,sm:4,md:6,lg:8,xl:10};function p1e({theme:e,variant:t,color:n,size:r,gradient:i}){if(t==="dot"){const o=e.fn.size({size:r,sizes:h1e});return{backgroundColor:"transparent",color:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[7],border:`1px solid ${e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[3]}`,paddingLeft:e.fn.size({size:r,sizes:e.spacing})/1.5-o/2,"&::before":{content:'""',display:"block",width:o,height:o,borderRadius:o,backgroundColor:e.fn.themeColor(n,e.colorScheme==="dark"?4:e.fn.primaryShade("light"),!0),marginRight:o}}}const s=e.fn.variant({color:n,variant:t,gradient:i});return{background:s.background,color:s.color,border:`${t==="gradient"?0:1}px solid ${s.border}`}}var m1e=at((e,{color:t,size:n,radius:r,gradient:i,fullWidth:s,variant:o})=>{const{fontSize:a,height:u}=n in FC?FC[n]:FC.md;return{leftSection:{marginRight:`calc(${e.spacing.xs}px / 2)`},rightSection:{marginLeft:`calc(${e.spacing.xs}px / 2)`},inner:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},root:MC(d1e(MC(MC({},e.fn.focusStyles()),e.fn.fontStyles()),{fontSize:a,height:u,WebkitTapHighlightColor:"transparent",lineHeight:`${u-2}px`,textDecoration:"none",padding:`0 ${e.fn.size({size:n,sizes:e.spacing})/1.5}px`,boxSizing:"border-box",display:s?"flex":"inline-flex",alignItems:"center",justifyContent:"center",width:s?"100%":"auto",textTransform:"uppercase",borderRadius:e.fn.radius(r),fontWeight:700,letterSpacing:.25,cursor:"inherit",textOverflow:"ellipsis",overflow:"hidden"}),p1e({theme:e,variant:o,color:t,size:n,gradient:i}))}});const g1e=m1e;var y1e=Object.defineProperty,FE=Object.getOwnPropertySymbols,lG=Object.prototype.hasOwnProperty,cG=Object.prototype.propertyIsEnumerable,Z5=(e,t,n)=>t in e?y1e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_1e=(e,t)=>{for(var n in t||(t={}))lG.call(t,n)&&Z5(e,n,t[n]);if(FE)for(var n of FE(t))cG.call(t,n)&&Z5(e,n,t[n]);return e},v1e=(e,t)=>{var n={};for(var r in e)lG.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&FE)for(var r of FE(e))t.indexOf(r)<0&&cG.call(e,r)&&(n[r]=e[r]);return n};const b1e={variant:"light",size:"md",radius:"xl"},fG=w.forwardRef((e,t)=>{const n=ct("Badge",b1e,e),{className:r,color:i,variant:s,fullWidth:o,children:a,size:u,leftSection:l,rightSection:c,radius:f,gradient:d,classNames:h,styles:p,unstyled:m}=n,y=v1e(n,["className","color","variant","fullWidth","children","size","leftSection","rightSection","radius","gradient","classNames","styles","unstyled"]),{classes:g,cx:_}=g1e({size:u,fullWidth:o,color:i,radius:f,variant:s,gradient:d},{classNames:h,styles:p,name:"Badge",unstyled:m});return k.createElement(ut,_1e({className:_(g.root,r),ref:t},y),l&&k.createElement("span",{className:g.leftSection},l),k.createElement("span",{className:g.inner},a),c&&k.createElement("span",{className:g.rightSection},c))});fG.displayName="@mantine/core/Badge";const E1e=fG;var w1e=at((e,{orientation:t,buttonBorderWidth:n})=>({root:{display:"flex",flexDirection:t==="vertical"?"column":"row","& [data-button]":{"&:first-of-type":{borderBottomRightRadius:0,[t==="vertical"?"borderBottomLeftRadius":"borderTopRightRadius"]:0,[t==="vertical"?"borderBottomWidth":"borderRightWidth"]:n/2},"&:last-of-type":{borderTopLeftRadius:0,[t==="vertical"?"borderTopRightRadius":"borderBottomLeftRadius"]:0,[t==="vertical"?"borderTopWidth":"borderLeftWidth"]:n/2},"&:not(:first-of-type):not(:last-of-type)":{borderRadius:0,[t==="vertical"?"borderTopWidth":"borderLeftWidth"]:n/2,[t==="vertical"?"borderBottomWidth":"borderRightWidth"]:n/2},"& + [data-button]":{[t==="vertical"?"marginTop":"marginLeft"]:-n,"@media (min-resolution: 192dpi)":{[t==="vertical"?"marginTop":"marginLeft"]:0}}}}}));const T1e=w1e;var S1e=Object.defineProperty,BE=Object.getOwnPropertySymbols,dG=Object.prototype.hasOwnProperty,hG=Object.prototype.propertyIsEnumerable,eF=(e,t,n)=>t in e?S1e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,I1e=(e,t)=>{for(var n in t||(t={}))dG.call(t,n)&&eF(e,n,t[n]);if(BE)for(var n of BE(t))hG.call(t,n)&&eF(e,n,t[n]);return e},x1e=(e,t)=>{var n={};for(var r in e)dG.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&BE)for(var r of BE(e))t.indexOf(r)<0&&hG.call(e,r)&&(n[r]=e[r]);return n};const C1e={orientation:"horizontal",buttonBorderWidth:1},pG=w.forwardRef((e,t)=>{const n=ct("ButtonGroup",C1e,e),{className:r,orientation:i,buttonBorderWidth:s,unstyled:o}=n,a=x1e(n,["className","orientation","buttonBorderWidth","unstyled"]),{classes:u,cx:l}=T1e({orientation:i,buttonBorderWidth:s},{name:"ButtonGroup",unstyled:o});return k.createElement(ut,I1e({className:l(u.root,r),ref:t},a))});pG.displayName="@mantine/core/ButtonGroup";var A1e=Object.defineProperty,O1e=Object.defineProperties,P1e=Object.getOwnPropertyDescriptors,tF=Object.getOwnPropertySymbols,R1e=Object.prototype.hasOwnProperty,N1e=Object.prototype.propertyIsEnumerable,nF=(e,t,n)=>t in e?A1e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,zf=(e,t)=>{for(var n in t||(t={}))R1e.call(t,n)&&nF(e,n,t[n]);if(tF)for(var n of tF(t))N1e.call(t,n)&&nF(e,n,t[n]);return e},BP=(e,t)=>O1e(e,P1e(t));const jP={xs:{height:Ss.xs,paddingLeft:14,paddingRight:14},sm:{height:Ss.sm,paddingLeft:18,paddingRight:18},md:{height:Ss.md,paddingLeft:22,paddingRight:22},lg:{height:Ss.lg,paddingLeft:26,paddingRight:26},xl:{height:Ss.xl,paddingLeft:32,paddingRight:32},"compact-xs":{height:22,paddingLeft:7,paddingRight:7},"compact-sm":{height:26,paddingLeft:8,paddingRight:8},"compact-md":{height:30,paddingLeft:10,paddingRight:10},"compact-lg":{height:34,paddingLeft:12,paddingRight:12},"compact-xl":{height:40,paddingLeft:14,paddingRight:14}};function k1e({compact:e,size:t,withLeftIcon:n,withRightIcon:r}){if(e)return jP[`compact-${t}`];const i=jP[t];return BP(zf({},i),{paddingLeft:n?i.paddingLeft/1.5:i.paddingLeft,paddingRight:r?i.paddingRight/1.5:i.paddingRight})}const D1e=e=>({display:e?"block":"inline-block",width:e?"100%":"auto"});function $1e({variant:e,theme:t,color:n,gradient:r}){const i=t.fn.variant({color:n,variant:e,gradient:r});return e==="gradient"?{border:0,backgroundImage:i.background,color:i.color,"&:hover":t.fn.hover({backgroundSize:"200%"})}:zf({border:`1px solid ${i.border}`,backgroundColor:i.background,color:i.color},t.fn.hover({backgroundColor:i.hover}))}var L1e=at((e,{color:t,size:n,radius:r,fullWidth:i,compact:s,gradient:o,variant:a,withLeftIcon:u,withRightIcon:l})=>({root:BP(zf(BP(zf(zf(zf(zf({},k1e({compact:s,size:n,withLeftIcon:u,withRightIcon:l})),e.fn.fontStyles()),e.fn.focusStyles()),D1e(i)),{borderRadius:e.fn.radius(r),fontWeight:600,position:"relative",lineHeight:1,fontSize:e.fn.size({size:n,sizes:e.fontSizes}),userSelect:"none",cursor:"pointer"}),$1e({variant:a,theme:e,color:t,gradient:o})),{"&:active":e.activeStyles,"&:disabled, &[data-disabled]":{borderColor:"transparent",backgroundColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2],color:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[5],cursor:"not-allowed",backgroundImage:"none",pointerEvents:"none","&:active":{transform:"none"}},"&[data-loading]":{pointerEvents:"none","&::before":{content:'""',position:"absolute",top:-1,left:-1,right:-1,bottom:-1,backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.colors.dark[7],.5):"rgba(255, 255, 255, .5)",borderRadius:e.fn.radius(r),cursor:"not-allowed"}}}),icon:{display:"flex",alignItems:"center"},leftIcon:{marginRight:10},rightIcon:{marginLeft:10},centerLoader:{position:"absolute",left:"50%",transform:"translateX(-50%)",opacity:.5},inner:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",overflow:"visible"},label:{whiteSpace:"nowrap",height:"100%",overflow:"hidden",display:"flex",alignItems:"center"}}));const M1e=L1e;var F1e=Object.defineProperty,jE=Object.getOwnPropertySymbols,mG=Object.prototype.hasOwnProperty,gG=Object.prototype.propertyIsEnumerable,rF=(e,t,n)=>t in e?F1e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,iF=(e,t)=>{for(var n in t||(t={}))mG.call(t,n)&&rF(e,n,t[n]);if(jE)for(var n of jE(t))gG.call(t,n)&&rF(e,n,t[n]);return e},B1e=(e,t)=>{var n={};for(var r in e)mG.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&jE)for(var r of jE(e))t.indexOf(r)<0&&gG.call(e,r)&&(n[r]=e[r]);return n};const j1e={size:"sm",type:"button",variant:"filled",loaderPosition:"left"},Ck=w.forwardRef((e,t)=>{const n=ct("Button",j1e,e),{className:r,size:i,color:s,type:o,disabled:a,children:u,leftIcon:l,rightIcon:c,fullWidth:f,variant:d,radius:h,uppercase:p,compact:m,loading:y,loaderPosition:g,loaderProps:_,gradient:b,classNames:T,styles:I,unstyled:E}=n,S=B1e(n,["className","size","color","type","disabled","children","leftIcon","rightIcon","fullWidth","variant","radius","uppercase","compact","loading","loaderPosition","loaderProps","gradient","classNames","styles","unstyled"]),{classes:A,cx:P,theme:V}=M1e({radius:h,color:s,size:i,fullWidth:f,compact:m,gradient:b,variant:d,withLeftIcon:!!l,withRightIcon:!!c},{name:"Button",unstyled:E,classNames:T,styles:I}),M=V.fn.variant({color:s,variant:d}),H=k.createElement(Lm,iF({color:M.color,size:V.fn.size({size:i,sizes:jP}).height/2},_));return k.createElement(ck,iF({className:P(A.root,r),type:o,disabled:a,"data-button":!0,"data-disabled":a||void 0,"data-loading":y||void 0,ref:t,unstyled:E},S),k.createElement("div",{className:A.inner},(l||y&&g==="left")&&k.createElement("span",{className:P(A.icon,A.leftIcon)},y&&g==="left"?H:l),y&&g==="center"&&k.createElement("span",{className:A.centerLoader},H),k.createElement("span",{className:A.label,style:{textTransform:p?"uppercase":void 0}},u),(c||y&&g==="right")&&k.createElement("span",{className:P(A.icon,A.rightIcon)},y&&g==="right"?H:c)))});Ck.displayName="@mantine/core/Button";Ck.Group=pG;const yu=Ck;var U1e=at((e,{radius:t,shadow:n,withBorder:r})=>({root:{outline:0,WebkitTapHighlightColor:"transparent",display:"block",textDecoration:"none",color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.white,boxSizing:"border-box",borderRadius:e.fn.radius(t),boxShadow:e.shadows[n]||n||"none",border:r?`1px solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3]}`:void 0}}));const V1e=U1e;var z1e=Object.defineProperty,UE=Object.getOwnPropertySymbols,yG=Object.prototype.hasOwnProperty,_G=Object.prototype.propertyIsEnumerable,sF=(e,t,n)=>t in e?z1e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,H1e=(e,t)=>{for(var n in t||(t={}))yG.call(t,n)&&sF(e,n,t[n]);if(UE)for(var n of UE(t))_G.call(t,n)&&sF(e,n,t[n]);return e},W1e=(e,t)=>{var n={};for(var r in e)yG.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&UE)for(var r of UE(e))t.indexOf(r)<0&&_G.call(e,r)&&(n[r]=e[r]);return n};const q1e={},vG=w.forwardRef((e,t)=>{const n=ct("Paper",q1e,e),{className:r,children:i,radius:s,withBorder:o,shadow:a,unstyled:u}=n,l=W1e(n,["className","children","radius","withBorder","shadow","unstyled"]),{classes:c,cx:f}=V1e({radius:s,shadow:a,withBorder:o},{name:"Paper",unstyled:u});return k.createElement(ut,H1e({className:f(c.root,r),ref:t},l),i)});vG.displayName="@mantine/core/Paper";const _d=vG,bG=w.createContext({padding:0}),Y1e=bG.Provider,G1e=()=>w.useContext(bG).padding;var K1e=at((e,{padding:t,withBorder:n,inheritPadding:r})=>{const i=e.fn.size({size:t,sizes:e.spacing}),s=-1*i,o=e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3];return{cardSection:{display:"block",marginLeft:s,marginRight:s,paddingLeft:r?i:void 0,paddingRight:r?i:void 0,borderTop:n&&`1px solid ${o}`,borderBottom:n&&`1px solid ${o}`,"& + &":{borderTop:0},"&[data-first]":{marginTop:s,borderTop:0,borderBottom:n&&`1px solid ${o}`},"&[data-last]":{marginBottom:s,borderBottom:0}}}});const Q1e=K1e;var X1e=Object.defineProperty,VE=Object.getOwnPropertySymbols,EG=Object.prototype.hasOwnProperty,wG=Object.prototype.propertyIsEnumerable,oF=(e,t,n)=>t in e?X1e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,J1e=(e,t)=>{for(var n in t||(t={}))EG.call(t,n)&&oF(e,n,t[n]);if(VE)for(var n of VE(t))wG.call(t,n)&&oF(e,n,t[n]);return e},Z1e=(e,t)=>{var n={};for(var r in e)EG.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&VE)for(var r of VE(e))t.indexOf(r)<0&&wG.call(e,r)&&(n[r]=e[r]);return n};const TG=w.forwardRef((e,t)=>{var n=e,{className:r,withBorder:i=!1,inheritPadding:s=!1,unstyled:o}=n,a=Z1e(n,["className","withBorder","inheritPadding","unstyled"]);const{classes:u,cx:l}=Q1e({padding:G1e(),withBorder:i,inheritPadding:s},{name:"Card",unstyled:o});return k.createElement(ut,J1e({className:l(u.cardSection,r),ref:t},a))});TG.displayName="@mantine/core/CardSection";const SG=TG;var ebe=at(e=>({root:{position:"relative",overflow:"hidden",backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.white}}));const tbe=ebe;var nbe=Object.defineProperty,zE=Object.getOwnPropertySymbols,IG=Object.prototype.hasOwnProperty,xG=Object.prototype.propertyIsEnumerable,aF=(e,t,n)=>t in e?nbe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,rbe=(e,t)=>{for(var n in t||(t={}))IG.call(t,n)&&aF(e,n,t[n]);if(zE)for(var n of zE(t))xG.call(t,n)&&aF(e,n,t[n]);return e},ibe=(e,t)=>{var n={};for(var r in e)IG.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&zE)for(var r of zE(e))t.indexOf(r)<0&&xG.call(e,r)&&(n[r]=e[r]);return n};const sbe={p:"md"},Ak=w.forwardRef((e,t)=>{const n=ct("Card",sbe,e),{className:r,p:i,radius:s,children:o,unstyled:a}=n,u=ibe(n,["className","p","radius","children","unstyled"]),{classes:l,cx:c}=tbe(null,{name:"Card",unstyled:a}),f=w.Children.toArray(o),d=f.map((h,p)=>typeof h=="object"&&h&&"type"in h&&h.type===SG?w.cloneElement(h,{padding:i,"data-first":p===0||void 0,"data-last":p===f.length-1||void 0}):h);return k.createElement(Y1e,{value:{padding:i}},k.createElement(_d,rbe({className:c(l.root,r),radius:s,p:i,ref:t},u),d))});Ak.Section=SG;Ak.displayName="@mantine/core/Card";const obe=Ak;var abe=Object.defineProperty,HE=Object.getOwnPropertySymbols,CG=Object.prototype.hasOwnProperty,AG=Object.prototype.propertyIsEnumerable,uF=(e,t,n)=>t in e?abe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ube=(e,t)=>{for(var n in t||(t={}))CG.call(t,n)&&uF(e,n,t[n]);if(HE)for(var n of HE(t))AG.call(t,n)&&uF(e,n,t[n]);return e},lbe=(e,t)=>{var n={};for(var r in e)CG.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&HE)for(var r of HE(e))t.indexOf(r)<0&&AG.call(e,r)&&(n[r]=e[r]);return n};const OG=w.forwardRef((e,t)=>{const n=ct("Center",{},e),{inline:r,sx:i}=n,s=lbe(n,["inline","sx"]);return k.createElement(ut,ube({ref:t,sx:[{display:r?"inline-flex":"flex",alignItems:"center",justifyContent:"center"},...Rd(i)]},s))});OG.displayName="@mantine/core/Center";const Nd=OG,PG=w.createContext(null),cbe=PG.Provider,fbe=()=>w.useContext(PG);function dbe(e){return w.Children.toArray(e).filter(Boolean)}const hbe={left:"flex-start",center:"center",right:"flex-end",apart:"space-between"};var pbe=at((e,{spacing:t,position:n,noWrap:r,grow:i,align:s,count:o})=>({root:{boxSizing:"border-box",display:"flex",flexDirection:"row",alignItems:s||"center",flexWrap:r?"nowrap":"wrap",justifyContent:hbe[n],gap:e.fn.size({size:t,sizes:e.spacing}),"& > *":{boxSizing:"border-box",maxWidth:i?`calc(${100/o}% - ${e.fn.size({size:t,sizes:e.spacing})-e.fn.size({size:t,sizes:e.spacing})/o}px)`:void 0,flexGrow:i?1:0}}}));const mbe=pbe;var gbe=Object.defineProperty,WE=Object.getOwnPropertySymbols,RG=Object.prototype.hasOwnProperty,NG=Object.prototype.propertyIsEnumerable,lF=(e,t,n)=>t in e?gbe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ybe=(e,t)=>{for(var n in t||(t={}))RG.call(t,n)&&lF(e,n,t[n]);if(WE)for(var n of WE(t))NG.call(t,n)&&lF(e,n,t[n]);return e},_be=(e,t)=>{var n={};for(var r in e)RG.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&WE)for(var r of WE(e))t.indexOf(r)<0&&NG.call(e,r)&&(n[r]=e[r]);return n};const vbe={position:"left",spacing:"md"},zo=w.forwardRef((e,t)=>{const n=ct("Group",vbe,e),{className:r,position:i,align:s,children:o,noWrap:a,grow:u,spacing:l,unstyled:c}=n,f=_be(n,["className","position","align","children","noWrap","grow","spacing","unstyled"]),d=dbe(o),{classes:h,cx:p}=mbe({align:s,grow:u,noWrap:a,spacing:l,position:i,count:d.length},{unstyled:c,name:"Group"});return k.createElement(ut,ybe({className:p(h.root,r),ref:t},f),d)});zo.displayName="@mantine/core/Group";var bbe=at((e,{spacing:t,align:n,justify:r})=>({root:{display:"flex",flexDirection:"column",alignItems:n,justifyContent:r,gap:e.fn.size({size:t,sizes:e.spacing})}}));const Ebe=bbe;var wbe=Object.defineProperty,qE=Object.getOwnPropertySymbols,kG=Object.prototype.hasOwnProperty,DG=Object.prototype.propertyIsEnumerable,cF=(e,t,n)=>t in e?wbe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Tbe=(e,t)=>{for(var n in t||(t={}))kG.call(t,n)&&cF(e,n,t[n]);if(qE)for(var n of qE(t))DG.call(t,n)&&cF(e,n,t[n]);return e},Sbe=(e,t)=>{var n={};for(var r in e)kG.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&qE)for(var r of qE(e))t.indexOf(r)<0&&DG.call(e,r)&&(n[r]=e[r]);return n};const Ibe={spacing:"md",align:"stretch",justify:"top"},au=w.forwardRef((e,t)=>{const n=ct("Stack",Ibe,e),{spacing:r,className:i,align:s,justify:o,unstyled:a}=n,u=Sbe(n,["spacing","className","align","justify","unstyled"]),{classes:l,cx:c}=Ebe({spacing:r,align:s,justify:o},{name:"Stack",unstyled:a});return k.createElement(ut,Tbe({className:c(l.root,i),ref:t},u))});au.displayName="@mantine/core/Stack";function $G({spacing:e,offset:t,orientation:n,children:r,role:i,unstyled:s}){return n==="horizontal"?k.createElement(zo,{pt:t,spacing:e,role:i,unstyled:s},r):k.createElement(au,{pt:t,spacing:e,role:i,unstyled:s},r)}var xbe=Object.defineProperty,YE=Object.getOwnPropertySymbols,LG=Object.prototype.hasOwnProperty,MG=Object.prototype.propertyIsEnumerable,fF=(e,t,n)=>t in e?xbe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,dF=(e,t)=>{for(var n in t||(t={}))LG.call(t,n)&&fF(e,n,t[n]);if(YE)for(var n of YE(t))MG.call(t,n)&&fF(e,n,t[n]);return e},Cbe=(e,t)=>{var n={};for(var r in e)LG.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&YE)for(var r of YE(e))t.indexOf(r)<0&&MG.call(e,r)&&(n[r]=e[r]);return n};const Abe={orientation:"horizontal",spacing:"lg",size:"sm",offset:"xs"},FG=w.forwardRef((e,t)=>{const n=ct("CheckboxGroup",Abe,e),{children:r,value:i,defaultValue:s,onChange:o,orientation:a,spacing:u,size:l,wrapperProps:c,offset:f}=n,d=Cbe(n,["children","value","defaultValue","onChange","orientation","spacing","size","wrapperProps","offset"]),[h,p]=Oa({value:i,defaultValue:s,finalValue:[],onChange:o}),m=y=>{const g=y.currentTarget.value;p(h.includes(g)?h.filter(_=>_!==g):[...h,g])};return k.createElement(cbe,{value:{value:h,onChange:m,size:l}},k.createElement(Bs.Wrapper,dF(dF({labelElement:"div",size:l,__staticSelector:"CheckboxGroup",ref:t},c),d),k.createElement($G,{spacing:u,orientation:a,offset:f},r)))});FG.displayName="@mantine/core/CheckboxGroup";var Obe=Object.defineProperty,GE=Object.getOwnPropertySymbols,BG=Object.prototype.hasOwnProperty,jG=Object.prototype.propertyIsEnumerable,hF=(e,t,n)=>t in e?Obe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,UP=(e,t)=>{for(var n in t||(t={}))BG.call(t,n)&&hF(e,n,t[n]);if(GE)for(var n of GE(t))jG.call(t,n)&&hF(e,n,t[n]);return e},Pbe=(e,t)=>{var n={};for(var r in e)BG.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&GE)for(var r of GE(e))t.indexOf(r)<0&&jG.call(e,r)&&(n[r]=e[r]);return n};function Rbe(e){return k.createElement("svg",UP({viewBox:"0 0 10 7",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),k.createElement("path",{d:"M4 4.586L1.707 2.293A1 1 0 1 0 .293 3.707l3 3a.997.997 0 0 0 1.414 0l5-5A1 1 0 1 0 8.293.293L4 4.586z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}function Nbe(e){var t=e,{indeterminate:n}=t,r=Pbe(t,["indeterminate"]);return n?k.createElement("svg",UP({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 32 6"},r),k.createElement("rect",{width:"32",height:"6",fill:"currentColor",rx:"3"})):k.createElement(Rbe,UP({},r))}var kbe=Object.defineProperty,Dbe=Object.defineProperties,$be=Object.getOwnPropertyDescriptors,pF=Object.getOwnPropertySymbols,Lbe=Object.prototype.hasOwnProperty,Mbe=Object.prototype.propertyIsEnumerable,mF=(e,t,n)=>t in e?kbe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Fbe=(e,t)=>{for(var n in t||(t={}))Lbe.call(t,n)&&mF(e,n,t[n]);if(pF)for(var n of pF(t))Mbe.call(t,n)&&mF(e,n,t[n]);return e},Bbe=(e,t)=>Dbe(e,$be(t));const jbe={xs:16,sm:20,md:24,lg:30,xl:36},Ube={xs:8,sm:10,md:14,lg:16,xl:20};var Vbe=at((e,{size:t,radius:n,color:r,transitionDuration:i,labelPosition:s,error:o,indeterminate:a},u)=>{const l=e.fn.size({size:t,sizes:jbe}),c=e.fn.variant({variant:"filled",color:r}),f=e.fn.variant({variant:"filled",color:"red"}).background;return{icon:{ref:u("icon"),color:a?"inherit":e.white,transform:a?"none":"translateY(5px) scale(0.5)",opacity:a?1:0,transitionProperty:"opacity, transform",transitionTimingFunction:"ease",transitionDuration:`${i}ms`,pointerEvents:"none",width:e.fn.size({size:t,sizes:Ube}),position:"absolute",zIndex:1,top:0,bottom:0,left:0,right:0,margin:"auto","@media (prefers-reduced-motion)":{transitionDuration:e.respectReducedMotion?"0ms":void 0}},inner:{position:"relative",width:l,height:l,order:s==="left"?2:1},input:Bbe(Fbe({},e.fn.focusStyles()),{appearance:"none",backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.white,border:`1px solid ${o?f:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]}`,width:l,height:l,borderRadius:e.fn.radius(n),padding:0,display:"block",margin:0,transition:`border-color ${i}ms ease, background-color ${i}ms ease`,cursor:e.cursorType,"&:checked":{backgroundColor:c.background,borderColor:c.background,[`& + .${u("icon")}`]:{opacity:1,color:e.white,transform:"translateY(0) scale(1)"}},"&:disabled":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2],borderColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[3],cursor:"not-allowed",[`& + .${u("icon")}`]:{color:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[5]}}})}});const zbe=Vbe;var Hbe=Object.defineProperty,Wbe=Object.defineProperties,qbe=Object.getOwnPropertyDescriptors,gF=Object.getOwnPropertySymbols,Ybe=Object.prototype.hasOwnProperty,Gbe=Object.prototype.propertyIsEnumerable,yF=(e,t,n)=>t in e?Hbe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Kbe=(e,t)=>{for(var n in t||(t={}))Ybe.call(t,n)&&yF(e,n,t[n]);if(gF)for(var n of gF(t))Gbe.call(t,n)&&yF(e,n,t[n]);return e},Qbe=(e,t)=>Wbe(e,qbe(t));const Xbe={xs:16,sm:20,md:24,lg:30,xl:36};var Jbe=at((e,{labelPosition:t,size:n})=>({root:{},body:{display:"inline-flex"},labelWrapper:Qbe(Kbe({},e.fn.fontStyles()),{display:"inline-flex",flexDirection:"column",WebkitTapHighlightColor:"transparent",fontSize:e.fn.size({size:n,sizes:e.fontSizes}),lineHeight:`${e.fn.size({size:n,sizes:Xbe})}px`,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,cursor:e.cursorType,order:t==="left"?1:2}),description:{marginTop:`calc(${e.spacing.xs}px / 2)`,[t==="left"?"paddingRight":"paddingLeft"]:e.spacing.sm},error:{marginTop:`calc(${e.spacing.xs}px / 2)`,[t==="left"?"paddingRight":"paddingLeft"]:e.spacing.sm},label:{cursor:e.cursorType,[t==="left"?"paddingRight":"paddingLeft"]:e.spacing.sm,"&[data-disabled]":{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]}}}));const Zbe=Jbe;var eEe=Object.defineProperty,KE=Object.getOwnPropertySymbols,UG=Object.prototype.hasOwnProperty,VG=Object.prototype.propertyIsEnumerable,_F=(e,t,n)=>t in e?eEe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,tEe=(e,t)=>{for(var n in t||(t={}))UG.call(t,n)&&_F(e,n,t[n]);if(KE)for(var n of KE(t))VG.call(t,n)&&_F(e,n,t[n]);return e},nEe=(e,t)=>{var n={};for(var r in e)UG.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&KE)for(var r of KE(e))t.indexOf(r)<0&&VG.call(e,r)&&(n[r]=e[r]);return n};function Ok(e){var t=e,{__staticSelector:n,className:r,classNames:i,styles:s,unstyled:o,children:a,label:u,description:l,id:c,disabled:f,error:d,size:h,labelPosition:p}=t,m=nEe(t,["__staticSelector","className","classNames","styles","unstyled","children","label","description","id","disabled","error","size","labelPosition"]);const{classes:y,cx:g}=Zbe({size:h,labelPosition:p},{name:n,styles:s,classNames:i,unstyled:o});return k.createElement(ut,tEe({className:g(y.root,r)},m),k.createElement("div",{className:g(y.body)},a,k.createElement("div",{className:y.labelWrapper},u&&k.createElement("label",{className:y.label,"data-disabled":f||void 0,htmlFor:c},u),l&&k.createElement(Bs.Description,{className:y.description},l),d&&d!=="boolean"&&k.createElement(Bs.Error,{className:y.error},d))))}Ok.displayName="@mantine/core/InlineInput";var rEe=Object.defineProperty,QE=Object.getOwnPropertySymbols,zG=Object.prototype.hasOwnProperty,HG=Object.prototype.propertyIsEnumerable,vF=(e,t,n)=>t in e?rEe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Kv=(e,t)=>{for(var n in t||(t={}))zG.call(t,n)&&vF(e,n,t[n]);if(QE)for(var n of QE(t))HG.call(t,n)&&vF(e,n,t[n]);return e},iEe=(e,t)=>{var n={};for(var r in e)zG.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&QE)for(var r of QE(e))t.indexOf(r)<0&&HG.call(e,r)&&(n[r]=e[r]);return n};const sEe={size:"sm",transitionDuration:100,icon:Nbe,labelPosition:"right"},Qp=w.forwardRef((e,t)=>{const n=ct("Checkbox",sEe,e),{className:r,style:i,sx:s,checked:o,disabled:a,color:u,label:l,indeterminate:c,id:f,size:d,radius:h,wrapperProps:p,children:m,classNames:y,styles:g,transitionDuration:_,icon:b,unstyled:T,labelPosition:I,description:E,error:S}=n,A=iEe(n,["className","style","sx","checked","disabled","color","label","indeterminate","id","size","radius","wrapperProps","children","classNames","styles","transitionDuration","icon","unstyled","labelPosition","description","error"]),P=fbe(),V=Fu(f),{systemStyles:M,rest:H}=Xd(A),{classes:J}=zbe({size:(P==null?void 0:P.size)||d,radius:h,color:u,transitionDuration:_,labelPosition:I,error:!!S,indeterminate:c},{name:"Checkbox",classNames:y,styles:g,unstyled:T}),Y=P?{checked:P.value.includes(H.value),onChange:P.onChange}:{};return k.createElement(Ok,Kv(Kv({className:r,sx:s,style:i,id:V,size:(P==null?void 0:P.size)||d,labelPosition:I,label:l,description:E,error:S,disabled:a,__staticSelector:"Checkbox",classNames:y,styles:g,unstyled:T,"data-checked":Y.checked||void 0},M),p),k.createElement("div",{className:J.inner},k.createElement("input",Kv(Kv({id:V,ref:t,type:"checkbox",className:J.input,checked:o,disabled:a},H),Y)),k.createElement(b,{indeterminate:c,className:J.icon})))});Qp.displayName="@mantine/core/Checkbox";Qp.Group=FG;var oEe=at((e,{fluid:t,size:n,sizes:r})=>({root:{paddingLeft:e.spacing.md,paddingRight:e.spacing.md,maxWidth:t?"100%":e.fn.size({size:n,sizes:r}),marginLeft:"auto",marginRight:"auto"}}));const aEe=oEe;var uEe=Object.defineProperty,XE=Object.getOwnPropertySymbols,WG=Object.prototype.hasOwnProperty,qG=Object.prototype.propertyIsEnumerable,bF=(e,t,n)=>t in e?uEe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,lEe=(e,t)=>{for(var n in t||(t={}))WG.call(t,n)&&bF(e,n,t[n]);if(XE)for(var n of XE(t))qG.call(t,n)&&bF(e,n,t[n]);return e},cEe=(e,t)=>{var n={};for(var r in e)WG.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&XE)for(var r of XE(e))t.indexOf(r)<0&&qG.call(e,r)&&(n[r]=e[r]);return n};const fEe={sizes:{xs:540,sm:720,md:960,lg:1140,xl:1320}},YG=w.forwardRef((e,t)=>{const n=ct("Container",fEe,e),{className:r,fluid:i,size:s,unstyled:o,sizes:a}=n,u=cEe(n,["className","fluid","size","unstyled","sizes"]),{classes:l,cx:c}=aEe({fluid:i,size:s,sizes:a},{unstyled:o,name:"Container"});return k.createElement(ut,lEe({className:c(l.root,r),ref:t},u))});YG.displayName="@mantine/core/Container";function GG({transitions:e,duration:t=250,exitDuration:n=t,mounted:r,children:i,timingFunction:s,onExit:o,onEntered:a,onEnter:u,onExited:l}){const{transitionDuration:c,transitionStatus:f,transitionTimingFunction:d}=FY({mounted:r,duration:t,exitDuration:n,timingFunction:s,onExit:o,onEntered:a,onEnter:u,onExited:l});if(c===0)return r?k.createElement(k.Fragment,null,i({})):null;if(f==="exited")return null;const h=Object.keys(e).reduce((p,m)=>(p[m]=MY({duration:e[m].duration,transition:e[m].transition,timingFunction:e[m].timingFunction||d,state:f}),p),{});return k.createElement(k.Fragment,null,i(h))}GG.displayName="@mantine/core/GroupedTransition";var dEe=at((e,{zIndex:t})=>({root:{position:"absolute",top:0,bottom:0,left:0,right:0,zIndex:t}}));const hEe=dEe;var pEe=Object.defineProperty,mEe=Object.defineProperties,gEe=Object.getOwnPropertyDescriptors,JE=Object.getOwnPropertySymbols,KG=Object.prototype.hasOwnProperty,QG=Object.prototype.propertyIsEnumerable,EF=(e,t,n)=>t in e?pEe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,BC=(e,t)=>{for(var n in t||(t={}))KG.call(t,n)&&EF(e,n,t[n]);if(JE)for(var n of JE(t))QG.call(t,n)&&EF(e,n,t[n]);return e},yEe=(e,t)=>mEe(e,gEe(t)),_Ee=(e,t)=>{var n={};for(var r in e)KG.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&JE)for(var r of JE(e))t.indexOf(r)<0&&QG.call(e,r)&&(n[r]=e[r]);return n};const vEe={opacity:.6,color:"#fff",zIndex:To("modal"),radius:0,blur:0},XG=w.forwardRef((e,t)=>{const n=ct("Overlay",vEe,e),{opacity:r,blur:i,color:s,gradient:o,zIndex:a,radius:u,sx:l,unstyled:c,className:f}=n,d=_Ee(n,["opacity","blur","color","gradient","zIndex","radius","sx","unstyled","className"]),{classes:h,cx:p}=hEe({zIndex:a},{name:"Overlay",unstyled:c}),m=o?{backgroundImage:o}:{backgroundColor:s},y=g=>k.createElement(ut,BC({ref:t,className:p(h.root,f),sx:[_=>yEe(BC({},m),{opacity:r,borderRadius:_.fn.size({size:u,sizes:_.radius})}),...Rd(l)]},g));return i?k.createElement(ut,BC({className:p(h.root,f),sx:[{backdropFilter:`blur(${i}px)`},...Rd(l)]},d),y()):y(d)});XG.displayName="@mantine/core/Overlay";const bEe=XG,EEe={gap:{type:"spacing",property:"gap"},rowGap:{type:"spacing",property:"rowGap"},columnGap:{type:"spacing",property:"columnGap"},align:{type:"default",property:"alignItems"},justify:{type:"default",property:"justifyContent"},wrap:{type:"default",property:"flexWrap"},direction:{type:"default",property:"flexDirection"}};var wEe=Object.defineProperty,TEe=Object.defineProperties,SEe=Object.getOwnPropertyDescriptors,ZE=Object.getOwnPropertySymbols,JG=Object.prototype.hasOwnProperty,ZG=Object.prototype.propertyIsEnumerable,wF=(e,t,n)=>t in e?wEe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,IEe=(e,t)=>{for(var n in t||(t={}))JG.call(t,n)&&wF(e,n,t[n]);if(ZE)for(var n of ZE(t))ZG.call(t,n)&&wF(e,n,t[n]);return e},xEe=(e,t)=>TEe(e,SEe(t)),CEe=(e,t)=>{var n={};for(var r in e)JG.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ZE)for(var r of ZE(e))t.indexOf(r)<0&&ZG.call(e,r)&&(n[r]=e[r]);return n};const AEe={},kd=w.forwardRef((e,t)=>{const n=ct("Flex",AEe,e),{gap:r,rowGap:i,columnGap:s,align:o,justify:a,wrap:u,direction:l,sx:c}=n,f=CEe(n,["gap","rowGap","columnGap","align","justify","wrap","direction","sx"]);return k.createElement(ut,xEe(IEe({},f),{sx:[{display:"flex"},d=>NP({gap:r,rowGap:i,columnGap:s,align:o,justify:a,wrap:u,direction:l},d,EEe),...Rd(c)],ref:t}))});kd.displayName="@mantine/core/Flex";const eK=w.createContext(null),OEe=eK.Provider,PEe=()=>w.useContext(eK);var REe=Object.defineProperty,TF=Object.getOwnPropertySymbols,NEe=Object.prototype.hasOwnProperty,kEe=Object.prototype.propertyIsEnumerable,SF=(e,t,n)=>t in e?REe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,DEe=(e,t)=>{for(var n in t||(t={}))NEe.call(t,n)&&SF(e,n,t[n]);if(TF)for(var n of TF(t))kEe.call(t,n)&&SF(e,n,t[n]);return e};const Pk=(e,t)=>e==="content"?"auto":e==="auto"?"0px":e?`${100/(t/e)}%`:void 0,tK=(e,t,n)=>n||e==="auto"||e==="content"?"unset":Pk(e,t),nK=(e,t)=>{if(e)return e==="auto"||t?1:0},rK=(e,t)=>e===0?0:e?`${100/(t/e)}%`:void 0;function $Ee({sizes:e,offsets:t,orders:n,theme:r,columns:i,grow:s}){return zde.reduce((o,a)=>(o[`@media (min-width: ${r.breakpoints[a]}px)`]={order:n[a],flexBasis:Pk(e[a],i),flexShrink:0,width:e[a]==="content"?"auto":void 0,maxWidth:tK(e[a],i,s),marginLeft:rK(t[a],i),flexGrow:nK(e[a],s)},o),{})}var LEe=at((e,{gutter:t,grow:n,offset:r,offsetXs:i,offsetSm:s,offsetMd:o,offsetLg:a,offsetXl:u,columns:l,span:c,xs:f,sm:d,md:h,lg:p,xl:m,order:y,orderXs:g,orderSm:_,orderMd:b,orderLg:T,orderXl:I})=>({root:DEe({boxSizing:"border-box",flexGrow:nK(c,n),order:y,padding:e.fn.size({size:t,sizes:e.spacing})/2,marginLeft:rK(r,l),flexBasis:Pk(c,l),flexShrink:0,width:c==="content"?"auto":void 0,maxWidth:tK(c,l,n)},$Ee({sizes:{xs:f,sm:d,md:h,lg:p,xl:m},offsets:{xs:i,sm:s,md:o,lg:a,xl:u},orders:{xs:g,sm:_,md:b,lg:T,xl:I},theme:e,columns:l,grow:n}))}));const MEe=LEe;var FEe=Object.defineProperty,ew=Object.getOwnPropertySymbols,iK=Object.prototype.hasOwnProperty,sK=Object.prototype.propertyIsEnumerable,IF=(e,t,n)=>t in e?FEe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,BEe=(e,t)=>{for(var n in t||(t={}))iK.call(t,n)&&IF(e,n,t[n]);if(ew)for(var n of ew(t))sK.call(t,n)&&IF(e,n,t[n]);return e},jEe=(e,t)=>{var n={};for(var r in e)iK.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ew)for(var r of ew(e))t.indexOf(r)<0&&sK.call(e,r)&&(n[r]=e[r]);return n};const UEe={};function VEe(e){return e==="auto"||e==="content"?!0:typeof e=="number"&&e>0&&e%1===0}const oK=w.forwardRef((e,t)=>{const n=ct("Grid.Col",UEe,e),{children:r,span:i,offset:s,offsetXs:o,offsetSm:a,offsetMd:u,offsetLg:l,offsetXl:c,xs:f,sm:d,md:h,lg:p,xl:m,order:y,orderXs:g,orderSm:_,orderMd:b,orderLg:T,orderXl:I,className:E,id:S,unstyled:A}=n,P=jEe(n,["children","span","offset","offsetXs","offsetSm","offsetMd","offsetLg","offsetXl","xs","sm","md","lg","xl","order","orderXs","orderSm","orderMd","orderLg","orderXl","className","id","unstyled"]),V=PEe();if(!V)throw new Error("[@mantine/core] Grid.Col was used outside of Grid context");const M=i||V.columns,{classes:H,cx:J}=MEe({gutter:V.gutter,offset:s,offsetXs:o,offsetSm:a,offsetMd:u,offsetLg:l,offsetXl:c,xs:f,sm:d,md:h,lg:p,xl:m,order:y,orderXs:g,orderSm:_,orderMd:b,orderLg:T,orderXl:I,grow:V.grow,columns:V.columns,span:M},{unstyled:A,name:"Col"});return!VEe(M)||M>V.columns?null:k.createElement(ut,BEe({className:J(H.root,E),ref:t},P),r)});oK.displayName="@mantine/core/Col";var zEe=at((e,{justify:t,align:n,gutter:r})=>({root:{margin:-e.fn.size({size:r,sizes:e.spacing})/2,display:"flex",flexWrap:"wrap",justifyContent:t,alignItems:n}}));const HEe=zEe;var WEe=Object.defineProperty,tw=Object.getOwnPropertySymbols,aK=Object.prototype.hasOwnProperty,uK=Object.prototype.propertyIsEnumerable,xF=(e,t,n)=>t in e?WEe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,qEe=(e,t)=>{for(var n in t||(t={}))aK.call(t,n)&&xF(e,n,t[n]);if(tw)for(var n of tw(t))uK.call(t,n)&&xF(e,n,t[n]);return e},YEe=(e,t)=>{var n={};for(var r in e)aK.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&tw)for(var r of tw(e))t.indexOf(r)<0&&uK.call(e,r)&&(n[r]=e[r]);return n};const GEe={gutter:"md",justify:"flex-start",align:"stretch",columns:12},il=w.forwardRef((e,t)=>{const n=ct("Grid",GEe,e),{gutter:r,children:i,grow:s,justify:o,align:a,columns:u,className:l,id:c,unstyled:f}=n,d=YEe(n,["gutter","children","grow","justify","align","columns","className","id","unstyled"]),{classes:h,cx:p}=HEe({gutter:r,justify:o,align:a},{unstyled:f,name:"Grid"});return k.createElement(OEe,{value:{gutter:r,grow:s,columns:u}},k.createElement(ut,qEe({className:p(h.root,l),ref:t},d),i))});il.Col=oK;il.displayName="@mantine/core/Grid";const lK={context:"HoverCard component was not found in the tree",children:"HoverCard.Target component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported"},[KEe,cK]=XN(lK.context);var QEe=Object.defineProperty,nw=Object.getOwnPropertySymbols,fK=Object.prototype.hasOwnProperty,dK=Object.prototype.propertyIsEnumerable,CF=(e,t,n)=>t in e?QEe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,XEe=(e,t)=>{for(var n in t||(t={}))fK.call(t,n)&&CF(e,n,t[n]);if(nw)for(var n of nw(t))dK.call(t,n)&&CF(e,n,t[n]);return e},JEe=(e,t)=>{var n={};for(var r in e)fK.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&nw)for(var r of nw(e))t.indexOf(r)<0&&dK.call(e,r)&&(n[r]=e[r]);return n};function hK(e){var t=e,{children:n,onMouseEnter:r,onMouseLeave:i}=t,s=JEe(t,["children","onMouseEnter","onMouseLeave"]);const o=cK(),a=oo(r,o.openDropdown),u=oo(i,o.closeDropdown);return k.createElement(Xo.Dropdown,XEe({onMouseEnter:a,onMouseLeave:u},s),n)}hK.displayName="@mantine/core/HoverCardDropdown";var ZEe=Object.defineProperty,rw=Object.getOwnPropertySymbols,pK=Object.prototype.hasOwnProperty,mK=Object.prototype.propertyIsEnumerable,AF=(e,t,n)=>t in e?ZEe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ewe=(e,t)=>{for(var n in t||(t={}))pK.call(t,n)&&AF(e,n,t[n]);if(rw)for(var n of rw(t))mK.call(t,n)&&AF(e,n,t[n]);return e},twe=(e,t)=>{var n={};for(var r in e)pK.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&rw)for(var r of rw(e))t.indexOf(r)<0&&mK.call(e,r)&&(n[r]=e[r]);return n};const gK=w.forwardRef((e,t)=>{var n=e,{children:r,refProp:i}=n,s=twe(n,["children","refProp"]);if(!Dm(r))throw new Error(lK.children);const o=cK(),a=oo(r.props.onMouseEnter,o.openDropdown),u=oo(r.props.onMouseLeave,o.closeDropdown);return k.createElement(Xo.Target,ewe({refProp:i,ref:t},s),w.cloneElement(r,{onMouseEnter:a,onMouseLeave:u}))});gK.displayName="@mantine/core/HoverCardTarget";function yK({open:e,close:t,openDelay:n,closeDelay:r}){const i=w.useRef(-1),s=w.useRef(-1),o=()=>{window.clearTimeout(i.current),window.clearTimeout(s.current)},a=()=>{o(),n===0?e():i.current=window.setTimeout(e,n)},u=()=>{o(),r===0?t():s.current=window.setTimeout(t,r)};return w.useEffect(()=>o,[]),{openDropdown:a,closeDropdown:u}}var nwe=Object.defineProperty,iw=Object.getOwnPropertySymbols,_K=Object.prototype.hasOwnProperty,vK=Object.prototype.propertyIsEnumerable,OF=(e,t,n)=>t in e?nwe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,rwe=(e,t)=>{for(var n in t||(t={}))_K.call(t,n)&&OF(e,n,t[n]);if(iw)for(var n of iw(t))vK.call(t,n)&&OF(e,n,t[n]);return e},iwe=(e,t)=>{var n={};for(var r in e)_K.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&iw)for(var r of iw(e))t.indexOf(r)<0&&vK.call(e,r)&&(n[r]=e[r]);return n};const swe={openDelay:0,closeDelay:150,initiallyOpened:!1};function gp(e){const t=ct("HoverCard",swe,e),{children:n,onOpen:r,onClose:i,openDelay:s,closeDelay:o,initiallyOpened:a}=t,u=iwe(t,["children","onOpen","onClose","openDelay","closeDelay","initiallyOpened"]),[l,{open:c,close:f}]=QW(a,{onClose:i,onOpen:r}),{openDropdown:d,closeDropdown:h}=yK({open:c,close:f,openDelay:s,closeDelay:o});return k.createElement(KEe,{value:{openDropdown:d,closeDropdown:h}},k.createElement(Xo,rwe({opened:l,__staticSelector:"HoverCard"},u),n))}gp.displayName="@mantine/core/HoverCard";gp.Target=gK;gp.Dropdown=hK;var owe=Object.defineProperty,PF=Object.getOwnPropertySymbols,awe=Object.prototype.hasOwnProperty,uwe=Object.prototype.propertyIsEnumerable,RF=(e,t,n)=>t in e?owe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,lwe=(e,t)=>{for(var n in t||(t={}))awe.call(t,n)&&RF(e,n,t[n]);if(PF)for(var n of PF(t))uwe.call(t,n)&&RF(e,n,t[n]);return e};function cwe(e){return k.createElement("svg",lwe({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),k.createElement("path",{d:"M2.5 1H12.5C13.3284 1 14 1.67157 14 2.5V12.5C14 13.3284 13.3284 14 12.5 14H2.5C1.67157 14 1 13.3284 1 12.5V2.5C1 1.67157 1.67157 1 2.5 1ZM2.5 2C2.22386 2 2 2.22386 2 2.5V8.3636L3.6818 6.6818C3.76809 6.59551 3.88572 6.54797 4.00774 6.55007C4.12975 6.55216 4.24568 6.60372 4.32895 6.69293L7.87355 10.4901L10.6818 7.6818C10.8575 7.50607 11.1425 7.50607 11.3182 7.6818L13 9.3636V2.5C13 2.22386 12.7761 2 12.5 2H2.5ZM2 12.5V9.6364L3.98887 7.64753L7.5311 11.4421L8.94113 13H2.5C2.22386 13 2 12.7761 2 12.5ZM12.5 13H10.155L8.48336 11.153L11 8.6364L13 10.6364V12.5C13 12.7761 12.7761 13 12.5 13ZM6.64922 5.5C6.64922 5.03013 7.03013 4.64922 7.5 4.64922C7.96987 4.64922 8.35078 5.03013 8.35078 5.5C8.35078 5.96987 7.96987 6.35078 7.5 6.35078C7.03013 6.35078 6.64922 5.96987 6.64922 5.5ZM7.5 3.74922C6.53307 3.74922 5.74922 4.53307 5.74922 5.5C5.74922 6.46693 6.53307 7.25078 7.5 7.25078C8.46693 7.25078 9.25078 6.46693 9.25078 5.5C9.25078 4.53307 8.46693 3.74922 7.5 3.74922Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}var fwe=Object.defineProperty,dwe=Object.defineProperties,hwe=Object.getOwnPropertyDescriptors,NF=Object.getOwnPropertySymbols,pwe=Object.prototype.hasOwnProperty,mwe=Object.prototype.propertyIsEnumerable,kF=(e,t,n)=>t in e?fwe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,DF=(e,t)=>{for(var n in t||(t={}))pwe.call(t,n)&&kF(e,n,t[n]);if(NF)for(var n of NF(t))mwe.call(t,n)&&kF(e,n,t[n]);return e},$F=(e,t)=>dwe(e,hwe(t)),gwe=at((e,{radius:t})=>({root:{},imageWrapper:{position:"relative"},figure:{margin:0},image:$F(DF({},e.fn.fontStyles()),{display:"block",width:"100%",height:"100%",border:0,borderRadius:e.fn.size({size:t,sizes:e.radius})}),caption:{color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[7],marginTop:e.spacing.xs},placeholder:$F(DF({},e.fn.cover()),{display:"flex",alignItems:"center",justifyContent:"center",color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6],backgroundColor:e.colorScheme==="dark"?e.colors.dark[8]:e.colors.gray[0],borderRadius:e.fn.size({size:t,sizes:e.radius})})}));const ywe=gwe;var _we=Object.defineProperty,sw=Object.getOwnPropertySymbols,bK=Object.prototype.hasOwnProperty,EK=Object.prototype.propertyIsEnumerable,LF=(e,t,n)=>t in e?_we(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,jC=(e,t)=>{for(var n in t||(t={}))bK.call(t,n)&&LF(e,n,t[n]);if(sw)for(var n of sw(t))EK.call(t,n)&&LF(e,n,t[n]);return e},vwe=(e,t)=>{var n={};for(var r in e)bK.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&sw)for(var r of sw(e))t.indexOf(r)<0&&EK.call(e,r)&&(n[r]=e[r]);return n};const bwe={fit:"cover",width:"100%",height:"auto",radius:0},A_=w.forwardRef((e,t)=>{const n=ct("Image",bwe,e),{className:r,alt:i,src:s,fit:o,width:a,height:u,radius:l,imageProps:c,withPlaceholder:f,placeholder:d,imageRef:h,classNames:p,styles:m,caption:y,unstyled:g,style:_}=n,b=vwe(n,["className","alt","src","fit","width","height","radius","imageProps","withPlaceholder","placeholder","imageRef","classNames","styles","caption","unstyled","style"]),{classes:T,cx:I}=ywe({radius:l},{classNames:p,styles:m,unstyled:g,name:"Image"}),[E,S]=w.useState(!s),A=f&&E;return fo(()=>{S(!1)},[s]),k.createElement(ut,jC({className:I(T.root,r),ref:t,style:jC({width:a},_)},b),k.createElement("figure",{className:T.figure},k.createElement("div",{className:T.imageWrapper},k.createElement("img",jC({className:T.image,src:s,alt:i,style:{objectFit:o,width:a,height:u},ref:h,onError:P=>{S(!0),typeof(c==null?void 0:c.onError)=="function"&&c.onError(P)}},c)),A&&k.createElement("div",{className:T.placeholder,title:i},d||k.createElement("div",null,k.createElement(cwe,{style:{width:40,height:40}})))),!!y&&k.createElement(Tt,{component:"figcaption",size:"sm",align:"center",className:T.caption},y)))});A_.displayName="@mantine/core/Image";function Ewe(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,s;for(s=0;s=0)&&(n[i]=e[i]);return n}var wwe=w.useLayoutEffect,Twe=function(t){var n=w.useRef(t);return wwe(function(){n.current=t}),n},MF=function(t,n){if(typeof t=="function"){t(n);return}t.current=n},Swe=function(t,n){var r=w.useRef();return w.useCallback(function(i){t.current=i,r.current&&MF(r.current,null),r.current=n,n&&MF(n,i)},[n])},FF={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},BF=function(t){Object.keys(FF).forEach(function(n){t.style.setProperty(n,FF[n],"important")})},Ks=null,Iwe=function(t,n){var r=t.scrollHeight;return n.sizingStyle.boxSizing==="border-box"?r+n.borderSize:r-n.paddingSize};function xwe(e,t,n,r){n===void 0&&(n=1),r===void 0&&(r=1/0),Ks||(Ks=document.createElement("textarea"),Ks.setAttribute("tabindex","-1"),Ks.setAttribute("aria-hidden","true"),BF(Ks)),Ks.parentNode===null&&document.body.appendChild(Ks);var i=e.paddingSize,s=e.borderSize,o=e.sizingStyle,a=o.boxSizing;Object.keys(o).forEach(function(d){var h=d;Ks.style[h]=o[h]}),BF(Ks),Ks.value=t;var u=Iwe(Ks,e);Ks.value="x";var l=Ks.scrollHeight-i,c=l*n;a==="border-box"&&(c=c+i+s),u=Math.max(c,u);var f=l*r;return a==="border-box"&&(f=f+i+s),u=Math.min(f,u),[u,l]}var jF=function(){},Cwe=function(t,n){return t.reduce(function(r,i){return r[i]=n[i],r},{})},Awe=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak"],Owe=!!document.documentElement.currentStyle,Pwe=function(t){var n=window.getComputedStyle(t);if(n===null)return null;var r=Cwe(Awe,n),i=r.boxSizing;if(i==="")return null;Owe&&i==="border-box"&&(r.width=parseFloat(r.width)+parseFloat(r.borderRightWidth)+parseFloat(r.borderLeftWidth)+parseFloat(r.paddingRight)+parseFloat(r.paddingLeft)+"px");var s=parseFloat(r.paddingBottom)+parseFloat(r.paddingTop),o=parseFloat(r.borderBottomWidth)+parseFloat(r.borderTopWidth);return{sizingStyle:r,paddingSize:s,borderSize:o}},Rwe=function(t){var n=Twe(t);w.useLayoutEffect(function(){var r=function(s){n.current(s)};return window.addEventListener("resize",r),function(){window.removeEventListener("resize",r)}},[])},Nwe=function(t,n){var r=t.cacheMeasurements,i=t.maxRows,s=t.minRows,o=t.onChange,a=o===void 0?jF:o,u=t.onHeightChange,l=u===void 0?jF:u,c=Ewe(t,["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"]),f=c.value!==void 0,d=w.useRef(null),h=Swe(d,n),p=w.useRef(0),m=w.useRef(),y=function(){var b=d.current,T=r&&m.current?m.current:Pwe(b);if(T){m.current=T;var I=xwe(T,b.value||b.placeholder||"x",s,i),E=I[0],S=I[1];p.current!==E&&(p.current=E,b.style.setProperty("height",E+"px","important"),l(E,{rowHeight:S}))}},g=function(b){f||y(),a(b)};return w.useLayoutEffect(y),Rwe(y),w.createElement("textarea",cr({},c,{onChange:g,ref:h}))},kwe=w.forwardRef(Nwe);const Dwe=kwe;var $we=at(e=>({input:{paddingTop:e.spacing.xs,paddingBottom:e.spacing.xs}}));const Lwe=$we;var Mwe=Object.defineProperty,Fwe=Object.defineProperties,Bwe=Object.getOwnPropertyDescriptors,ow=Object.getOwnPropertySymbols,wK=Object.prototype.hasOwnProperty,TK=Object.prototype.propertyIsEnumerable,UF=(e,t,n)=>t in e?Mwe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_h=(e,t)=>{for(var n in t||(t={}))wK.call(t,n)&&UF(e,n,t[n]);if(ow)for(var n of ow(t))TK.call(t,n)&&UF(e,n,t[n]);return e},UC=(e,t)=>Fwe(e,Bwe(t)),jwe=(e,t)=>{var n={};for(var r in e)wK.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ow)for(var r of ow(e))t.indexOf(r)<0&&TK.call(e,r)&&(n[r]=e[r]);return n};const Uwe={autosize:!1,size:"sm",__staticSelector:"Textarea"},SK=w.forwardRef((e,t)=>{const n=ct("Textarea",Uwe,e),{autosize:r,maxRows:i,minRows:s,label:o,error:a,description:u,id:l,className:c,required:f,style:d,wrapperProps:h,classNames:p,styles:m,size:y,__staticSelector:g,sx:_,errorProps:b,descriptionProps:T,labelProps:I,inputWrapperOrder:E,inputContainer:S,unstyled:A,withAsterisk:P}=n,V=jwe(n,["autosize","maxRows","minRows","label","error","description","id","className","required","style","wrapperProps","classNames","styles","size","__staticSelector","sx","errorProps","descriptionProps","labelProps","inputWrapperOrder","inputContainer","unstyled","withAsterisk"]),M=Fu(l),{classes:H,cx:J}=Lwe(),{systemStyles:Y,rest:ye}=Xd(V),he=_h({required:f,ref:t,invalid:!!a,id:M,classNames:UC(_h({},p),{input:J(H.input,p==null?void 0:p.input)}),styles:m,__staticSelector:g,size:y,multiline:!0,unstyled:A},ye);return k.createElement(Bs.Wrapper,_h(_h({label:o,error:a,id:M,description:u,required:f,style:d,className:c,classNames:p,styles:m,size:y,__staticSelector:g,sx:_,errorProps:b,labelProps:I,descriptionProps:T,inputContainer:S,inputWrapperOrder:E,unstyled:A,withAsterisk:P},Y),h),r?k.createElement(Bs,UC(_h({},he),{component:Dwe,maxRows:i,minRows:s})):k.createElement(Bs,UC(_h({},he),{component:"textarea",rows:s})))});SK.displayName="@mantine/core/Textarea";const IK=w.createContext(null);function Vwe(){return w.useContext(IK)||{}}var zwe=at((e,{spacing:t,center:n},r)=>({itemWrapper:{ref:r("itemWrapper"),display:"inline-flex",flexDirection:"column",whiteSpace:"normal"},item:{whiteSpace:"nowrap",lineHeight:n?1:e.lineHeight,"&:not(:first-of-type)":{marginTop:e.fn.size({size:t,sizes:e.spacing})}},withIcon:{listStyle:"none",[`& .${r("itemWrapper")}`]:{display:"inline-flex",alignItems:n?"center":"flex-start",flexDirection:"row"}},itemIcon:{display:"inline-block",verticalAlign:"middle",marginRight:e.spacing.sm}}));const Hwe=zwe;var Wwe=Object.defineProperty,aw=Object.getOwnPropertySymbols,xK=Object.prototype.hasOwnProperty,CK=Object.prototype.propertyIsEnumerable,VF=(e,t,n)=>t in e?Wwe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,qwe=(e,t)=>{for(var n in t||(t={}))xK.call(t,n)&&VF(e,n,t[n]);if(aw)for(var n of aw(t))CK.call(t,n)&&VF(e,n,t[n]);return e},Ywe=(e,t)=>{var n={};for(var r in e)xK.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&aw)for(var r of aw(e))t.indexOf(r)<0&&CK.call(e,r)&&(n[r]=e[r]);return n};function AK(e){var t=e,{className:n,children:r,icon:i}=t,s=Ywe(t,["className","children","icon"]);const{icon:o,spacing:a,center:u,listStyleType:l,size:c,withPadding:f}=Vwe(),{classNames:d,styles:h,unstyled:p}=T_(),m=i||o,{classes:y,cx:g}=Hwe({withPadding:f,size:c,listStyleType:l,center:u,spacing:a},{classNames:d,styles:h,unstyled:p,name:"List"});return k.createElement(ut,qwe({component:"li",className:g(y.item,{[y.withIcon]:m},n)},s),k.createElement("div",{className:y.itemWrapper},m&&k.createElement("span",{className:y.itemIcon},m),k.createElement("span",null,r)))}AK.displayName="@mantine/core/ListItem";var Gwe=Object.defineProperty,Kwe=Object.defineProperties,Qwe=Object.getOwnPropertyDescriptors,zF=Object.getOwnPropertySymbols,Xwe=Object.prototype.hasOwnProperty,Jwe=Object.prototype.propertyIsEnumerable,HF=(e,t,n)=>t in e?Gwe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Zwe=(e,t)=>{for(var n in t||(t={}))Xwe.call(t,n)&&HF(e,n,t[n]);if(zF)for(var n of zF(t))Jwe.call(t,n)&&HF(e,n,t[n]);return e},eTe=(e,t)=>Kwe(e,Qwe(t)),tTe=at((e,{withPadding:t,size:n,listStyleType:r})=>({root:eTe(Zwe({},e.fn.fontStyles()),{listStyleType:r,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,fontSize:e.fn.size({size:n,sizes:e.fontSizes}),lineHeight:e.lineHeight,margin:0,paddingLeft:t?e.spacing.xl:0,listStylePosition:"inside"})}));const nTe=tTe;var rTe=Object.defineProperty,uw=Object.getOwnPropertySymbols,OK=Object.prototype.hasOwnProperty,PK=Object.prototype.propertyIsEnumerable,WF=(e,t,n)=>t in e?rTe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,iTe=(e,t)=>{for(var n in t||(t={}))OK.call(t,n)&&WF(e,n,t[n]);if(uw)for(var n of uw(t))PK.call(t,n)&&WF(e,n,t[n]);return e},sTe=(e,t)=>{var n={};for(var r in e)OK.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&uw)for(var r of uw(e))t.indexOf(r)<0&&PK.call(e,r)&&(n[r]=e[r]);return n};const oTe={type:"unordered",size:"md",spacing:0},Xp=w.forwardRef((e,t)=>{const n=ct("List",oTe,e),{children:r,type:i,size:s,listStyleType:o,withPadding:a,center:u,spacing:l,icon:c,className:f,styles:d,classNames:h,unstyled:p}=n,m=sTe(n,["children","type","size","listStyleType","withPadding","center","spacing","icon","className","styles","classNames","unstyled"]),{classes:y,cx:g}=nTe({withPadding:a,size:s,listStyleType:o,center:u,spacing:l},{classNames:h,styles:d,name:"List",unstyled:p});return k.createElement(BW,{classNames:h,styles:d,unstyled:p},k.createElement(IK.Provider,{value:{spacing:l,center:u,icon:c,listStyleType:o,size:s,withPadding:a}},k.createElement(ut,iTe({component:i==="unordered"?"ul":"ol",className:g(y.root,f),ref:t},m),r)))});Xp.Item=AK;Xp.displayName="@mantine/core/List";var aTe=at(e=>({divider:{margin:`calc(${e.spacing.xs}px / 2) -5px`,borderTop:`1px solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2]}`}}));const uTe=aTe;var lTe=Object.defineProperty,lw=Object.getOwnPropertySymbols,RK=Object.prototype.hasOwnProperty,NK=Object.prototype.propertyIsEnumerable,qF=(e,t,n)=>t in e?lTe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,cTe=(e,t)=>{for(var n in t||(t={}))RK.call(t,n)&&qF(e,n,t[n]);if(lw)for(var n of lw(t))NK.call(t,n)&&qF(e,n,t[n]);return e},fTe=(e,t)=>{var n={};for(var r in e)RK.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&lw)for(var r of lw(e))t.indexOf(r)<0&&NK.call(e,r)&&(n[r]=e[r]);return n};function kK(e){var t=e,{children:n,className:r}=t,i=fTe(t,["children","className"]);const{classNames:s,styles:o,unstyled:a}=T_(),{classes:u,cx:l}=uTe(null,{name:"Menu",classNames:s,styles:o,unstyled:a});return k.createElement(ut,cTe({className:l(u.divider,r)},i))}kK.displayName="@mantine/core/MenuDivider";const DK={context:"Menu component was not found in the tree",children:"Menu.Target component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported"},[dTe,Rk]=XN(DK.context);var hTe=Object.defineProperty,cw=Object.getOwnPropertySymbols,$K=Object.prototype.hasOwnProperty,LK=Object.prototype.propertyIsEnumerable,YF=(e,t,n)=>t in e?hTe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,pTe=(e,t)=>{for(var n in t||(t={}))$K.call(t,n)&&YF(e,n,t[n]);if(cw)for(var n of cw(t))LK.call(t,n)&&YF(e,n,t[n]);return e},mTe=(e,t)=>{var n={};for(var r in e)$K.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&cw)for(var r of cw(e))t.indexOf(r)<0&&LK.call(e,r)&&(n[r]=e[r]);return n};function MK(e){var t=e,{children:n,onMouseEnter:r,onMouseLeave:i}=t,s=mTe(t,["children","onMouseEnter","onMouseLeave"]);const o=w.useRef(),a=Rk(),u=f=>{(f.key==="ArrowUp"||f.key==="ArrowDown")&&(f.preventDefault(),o.current.querySelectorAll("[data-menu-item]")[0].focus())},l=oo(r,()=>a.trigger==="hover"&&a.openDropdown()),c=oo(i,()=>a.trigger==="hover"&&a.closeDropdown());return k.createElement(Xo.Dropdown,pTe({onMouseEnter:l,onMouseLeave:c,role:"menu","aria-orientation":"vertical"},s),k.createElement("div",{tabIndex:-1,"data-menu-dropdown":!0,"data-autofocus":!0,onKeyDown:u,ref:o,style:{outline:0}},n))}MK.displayName="@mantine/core/MenuDropdown";var gTe=Object.defineProperty,yTe=Object.defineProperties,_Te=Object.getOwnPropertyDescriptors,GF=Object.getOwnPropertySymbols,vTe=Object.prototype.hasOwnProperty,bTe=Object.prototype.propertyIsEnumerable,KF=(e,t,n)=>t in e?gTe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ETe=(e,t)=>{for(var n in t||(t={}))vTe.call(t,n)&&KF(e,n,t[n]);if(GF)for(var n of GF(t))bTe.call(t,n)&&KF(e,n,t[n]);return e},wTe=(e,t)=>yTe(e,_Te(t)),TTe=at((e,{color:t,radius:n})=>({item:wTe(ETe({},e.fn.fontStyles()),{WebkitTapHighlightColor:"transparent",fontSize:e.fontSizes.sm,border:0,backgroundColor:"transparent",outline:0,width:"100%",textAlign:"left",textDecoration:"none",boxSizing:"border-box",padding:`${e.spacing.xs}px ${e.spacing.sm}px`,cursor:"pointer",borderRadius:e.fn.radius(n),color:t?e.fn.variant({variant:"filled",primaryFallback:!1,color:t}).background:e.colorScheme==="dark"?e.colors.dark[0]:e.black,display:"flex",alignItems:"center","&:disabled":{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5],pointerEvents:"none",userSelect:"none"},"&[data-hovered]":{backgroundColor:t?e.fn.variant({variant:"light",color:t}).background:e.colorScheme==="dark"?e.fn.rgba(e.colors.dark[3],.35):e.colors.gray[0]}}),itemLabel:{flex:1},itemIcon:{display:"flex",justifyContent:"center",alignItems:"center",marginRight:e.spacing.xs},itemRightSection:{}}));const STe=TTe;var ITe=Object.defineProperty,xTe=Object.defineProperties,CTe=Object.getOwnPropertyDescriptors,fw=Object.getOwnPropertySymbols,FK=Object.prototype.hasOwnProperty,BK=Object.prototype.propertyIsEnumerable,QF=(e,t,n)=>t in e?ITe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ATe=(e,t)=>{for(var n in t||(t={}))FK.call(t,n)&&QF(e,n,t[n]);if(fw)for(var n of fw(t))BK.call(t,n)&&QF(e,n,t[n]);return e},OTe=(e,t)=>xTe(e,CTe(t)),PTe=(e,t)=>{var n={};for(var r in e)FK.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&fw)for(var r of fw(e))t.indexOf(r)<0&&BK.call(e,r)&&(n[r]=e[r]);return n};const jK=w.forwardRef((e,t)=>{var n=e,{children:r,className:i,color:s,closeMenuOnClick:o,icon:a,rightSection:u}=n,l=PTe(n,["children","className","color","closeMenuOnClick","icon","rightSection"]);const c=Rk(),{classNames:f,styles:d,unstyled:h}=T_(),{classes:p,cx:m,theme:y}=STe({radius:c.radius,color:s},{name:"Menu",classNames:f,styles:d,unstyled:h}),g=w.useRef(),_=c.getItemIndex(g.current),b=l,T=oo(b.onMouseLeave,()=>c.setHovered(-1)),I=oo(b.onMouseEnter,()=>c.setHovered(c.getItemIndex(g.current))),E=oo(b.onClick,()=>{typeof o=="boolean"?o&&c.closeDropdownImmediately():c.closeOnItemClick&&c.closeDropdownImmediately()}),S=oo(b.onFocus,()=>c.setHovered(c.getItemIndex(g.current)));return k.createElement(ut,OTe(ATe({component:"button",type:"button"},l),{tabIndex:-1,onFocus:S,className:m(p.item,i),ref:Ko(g,t),role:"menuitem","data-menu-item":!0,"data-hovered":c.hovered===_?!0:void 0,onMouseEnter:I,onMouseLeave:T,onClick:E,onKeyDown:ude({siblingSelector:"[data-menu-item]",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:c.loop,dir:y.dir,orientation:"vertical",onKeyDown:b.onKeydown})}),a&&k.createElement("div",{className:p.itemIcon},a),r&&k.createElement("div",{className:p.itemLabel},r),u&&k.createElement("div",{className:p.itemRightSection},u))});jK.displayName="@mantine/core/MenuItem";const RTe=jK;var NTe=at(e=>({label:{color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6],fontWeight:500,fontSize:e.fontSizes.xs,padding:`calc(${e.spacing.xs}px / 2) ${e.spacing.sm}px`,cursor:"default"}}));const kTe=NTe;var DTe=Object.defineProperty,dw=Object.getOwnPropertySymbols,UK=Object.prototype.hasOwnProperty,VK=Object.prototype.propertyIsEnumerable,XF=(e,t,n)=>t in e?DTe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$Te=(e,t)=>{for(var n in t||(t={}))UK.call(t,n)&&XF(e,n,t[n]);if(dw)for(var n of dw(t))VK.call(t,n)&&XF(e,n,t[n]);return e},LTe=(e,t)=>{var n={};for(var r in e)UK.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&dw)for(var r of dw(e))t.indexOf(r)<0&&VK.call(e,r)&&(n[r]=e[r]);return n};function zK(e){var t=e,{children:n,className:r}=t,i=LTe(t,["children","className"]);const{classNames:s,styles:o,unstyled:a}=T_(),{classes:u,cx:l}=kTe(null,{name:"Menu",classNames:s,styles:o,unstyled:a});return k.createElement(Tt,$Te({className:l(u.label,r)},i),n)}zK.displayName="@mantine/core/MenuLabel";var MTe=Object.defineProperty,hw=Object.getOwnPropertySymbols,HK=Object.prototype.hasOwnProperty,WK=Object.prototype.propertyIsEnumerable,JF=(e,t,n)=>t in e?MTe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,FTe=(e,t)=>{for(var n in t||(t={}))HK.call(t,n)&&JF(e,n,t[n]);if(hw)for(var n of hw(t))WK.call(t,n)&&JF(e,n,t[n]);return e},BTe=(e,t)=>{var n={};for(var r in e)HK.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&hw)for(var r of hw(e))t.indexOf(r)<0&&WK.call(e,r)&&(n[r]=e[r]);return n};const qK=w.forwardRef((e,t)=>{var n=e,{children:r,refProp:i="ref"}=n,s=BTe(n,["children","refProp"]);if(!Dm(r))throw new Error(DK.children);const o=Rk(),a=oo(r.props.onClick,()=>o.trigger==="click"&&o.toggleDropdown()),u=oo(r.props.onMouseEnter,()=>o.trigger==="hover"&&o.openDropdown()),l=oo(r.props.onMouseLeave,()=>o.trigger==="hover"&&o.closeDropdown());return k.createElement(Xo.Target,FTe({refProp:i,popupType:"menu",ref:t},s),w.cloneElement(r,{onClick:a,onMouseEnter:u,onMouseLeave:l,"data-expanded":o.opened?!0:void 0}))});qK.displayName="@mantine/core/MenuTarget";var jTe=at({dropdown:{padding:4}});const UTe=jTe;var VTe=Object.defineProperty,zTe=Object.defineProperties,HTe=Object.getOwnPropertyDescriptors,pw=Object.getOwnPropertySymbols,YK=Object.prototype.hasOwnProperty,GK=Object.prototype.propertyIsEnumerable,ZF=(e,t,n)=>t in e?VTe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,e8=(e,t)=>{for(var n in t||(t={}))YK.call(t,n)&&ZF(e,n,t[n]);if(pw)for(var n of pw(t))GK.call(t,n)&&ZF(e,n,t[n]);return e},t8=(e,t)=>zTe(e,HTe(t)),WTe=(e,t)=>{var n={};for(var r in e)YK.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&pw)for(var r of pw(e))t.indexOf(r)<0&&GK.call(e,r)&&(n[r]=e[r]);return n};const qTe={closeOnItemClick:!0,loop:!0,trigger:"click",openDelay:0,closeDelay:100};function ko(e){const t=ct("Menu",qTe,e),{children:n,onOpen:r,onClose:i,opened:s,defaultOpened:o,onChange:a,closeOnItemClick:u,loop:l,closeOnEscape:c,trigger:f,openDelay:d,closeDelay:h,classNames:p,styles:m,unstyled:y,radius:g}=t,_=WTe(t,["children","onOpen","onClose","opened","defaultOpened","onChange","closeOnItemClick","loop","closeOnEscape","trigger","openDelay","closeDelay","classNames","styles","unstyled","radius"]),{classes:b,cx:T}=UTe(),[I,{setHovered:E,resetHovered:S}]=hde(),[A,P]=Oa({value:s,defaultValue:o,finalValue:!1,onChange:a}),V=()=>{P(!1),A&&(i==null||i())},M=()=>{P(!0),!A&&(r==null||r())},H=()=>A?V():M(),{openDropdown:J,closeDropdown:Y}=yK({open:M,close:V,closeDelay:h,openDelay:d}),ye=he=>lde("[data-menu-item]","[data-menu-dropdown]",he);return fo(()=>{S()},[A]),k.createElement(dTe,{value:{opened:A,toggleDropdown:H,getItemIndex:ye,hovered:I,setHovered:E,closeOnItemClick:u,closeDropdown:f==="click"?V:Y,openDropdown:f==="click"?M:J,closeDropdownImmediately:V,loop:l,trigger:f,radius:g}},k.createElement(Xo,t8(e8({},_),{radius:g,opened:A,onChange:P,defaultOpened:o,trapFocus:f==="click",closeOnEscape:c&&f==="click",__staticSelector:"Menu",classNames:t8(e8({},p),{dropdown:T(b.dropdown,p==null?void 0:p.dropdown)}),styles:m,unstyled:y,onClose:V,onOpen:M}),n))}ko.displayName="@mantine/core/Menu";ko.Item=RTe;ko.Label=zK;ko.Dropdown=MK;ko.Target=qK;ko.Divider=kK;var YTe=Object.defineProperty,n8=Object.getOwnPropertySymbols,GTe=Object.prototype.hasOwnProperty,KTe=Object.prototype.propertyIsEnumerable,r8=(e,t,n)=>t in e?YTe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,QTe=(e,t)=>{for(var n in t||(t={}))GTe.call(t,n)&&r8(e,n,t[n]);if(n8)for(var n of n8(t))KTe.call(t,n)&&r8(e,n,t[n]);return e};const XTe={xs:320,sm:380,md:440,lg:620,xl:780};function JTe(e){return e?{position:"absolute",top:0,left:0,right:0,bottom:0,maxHeight:"100vh",overflowY:"auto"}:{}}var ZTe=at((e,{overflow:t,size:n,centered:r,zIndex:i,fullScreen:s})=>({close:{},overlay:{display:s?"none":void 0},root:{position:"fixed",zIndex:i,top:0,left:0,right:0,bottom:0},inner:{position:"absolute",top:0,left:0,right:0,bottom:0,overflowY:"auto",padding:s?0:`${e.spacing.xl*2}px ${e.spacing.md}px`,display:"flex",justifyContent:"center",alignItems:r?"center":"flex-start"},title:{marginRight:e.spacing.md,textOverflow:"ellipsis",display:"block",wordBreak:"break-word"},modal:QTe({position:"relative",width:s?"100vw":e.fn.size({sizes:XTe,size:n}),borderRadius:s?0:void 0,outline:0,backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.white,marginTop:r?"auto":void 0,marginBottom:r?"auto":void 0,zIndex:1},JTe(s)),header:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:e.spacing.md,marginRight:-9},body:{maxHeight:t==="inside"?"calc(100vh - 185px)":null,overflowY:t==="inside"?"auto":null,wordBreak:"break-word"}}));const eSe=ZTe;var tSe=Object.defineProperty,mw=Object.getOwnPropertySymbols,KK=Object.prototype.hasOwnProperty,QK=Object.prototype.propertyIsEnumerable,i8=(e,t,n)=>t in e?tSe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,nSe=(e,t)=>{for(var n in t||(t={}))KK.call(t,n)&&i8(e,n,t[n]);if(mw)for(var n of mw(t))QK.call(t,n)&&i8(e,n,t[n]);return e},rSe=(e,t)=>{var n={};for(var r in e)KK.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&mw)for(var r of mw(e))t.indexOf(r)<0&&QK.call(e,r)&&(n[r]=e[r]);return n};const iSe={size:"md",transitionDuration:250,overflow:"outside",padding:"lg",shadow:"lg",closeOnClickOutside:!0,closeOnEscape:!0,trapFocus:!0,withCloseButton:!0,withinPortal:!0,lockScroll:!0,withFocusReturn:!0,overlayBlur:0,zIndex:To("modal"),exitTransitionDuration:0};function JS(e){const t=ct("Modal",iSe,e),{className:n,opened:r,title:i,onClose:s,children:o,withCloseButton:a,overlayOpacity:u,size:l,transitionDuration:c,exitTransitionDuration:f,closeButtonLabel:d,overlayColor:h,overflow:p,transition:m,padding:y,shadow:g,radius:_,id:b,classNames:T,styles:I,closeOnClickOutside:E,trapFocus:S,closeOnEscape:A,centered:P,target:V,withinPortal:M,zIndex:H,overlayBlur:J,transitionTimingFunction:Y,fullScreen:ye,unstyled:he,lockScroll:ve,withFocusReturn:te}=t,se=rSe(t,["className","opened","title","onClose","children","withCloseButton","overlayOpacity","size","transitionDuration","exitTransitionDuration","closeButtonLabel","overlayColor","overflow","transition","padding","shadow","radius","id","classNames","styles","closeOnClickOutside","trapFocus","closeOnEscape","centered","target","withinPortal","zIndex","overlayBlur","transitionTimingFunction","fullScreen","unstyled","lockScroll","withFocusReturn"]),K=Fu(b),x=`${K}-title`,C=`${K}-body`,{classes:z,cx:R,theme:O}=eSe({size:l,overflow:p,centered:P,zIndex:H,fullScreen:ye},{unstyled:he,classNames:T,styles:I,name:"Modal"}),q=qW(S&&r),le=w.useRef(null),ae=Ko(q,le),pe=typeof u=="number"?u:O.colorScheme==="dark"?.85:.75;Mpe(ve&&r);const me=st=>{!S&&st.key==="Escape"&&A&&s()};w.useEffect(()=>{if(!S)return window.addEventListener("keydown",me),()=>window.removeEventListener("keydown",me)},[S]),VW({opened:r,shouldReturnFocus:S&&te});const Se=w.useRef(null);RP("mousedown",st=>{Se.current=st.target});const ce=()=>{Se.current===le.current&&E&&s()};return k.createElement(S_,{withinPortal:M,target:V},k.createElement(GG,{mounted:r,duration:c,exitDuration:f,timingFunction:Y,transitions:{modal:{duration:c,transition:m||(ye?"fade":"pop")},overlay:{duration:c/2,transition:"fade",timingFunction:"ease"}}},st=>k.createElement(k.Fragment,null,k.createElement(ut,nSe({id:K,className:R(z.root,n)},se),k.createElement("div",{style:st.overlay},k.createElement(bEe,{className:z.overlay,sx:{position:"fixed"},zIndex:0,blur:J,color:h||(O.colorScheme==="dark"?O.colors.dark[9]:O.black),opacity:pe,unstyled:he})),k.createElement("div",{role:"presentation",className:z.inner,onClick:ce,onKeyDown:Ke=>{var qe;((qe=Ke.target)==null?void 0:qe.getAttribute("data-mantine-stop-propagation"))!=="true"&&Ke.key==="Escape"&&A&&s()},ref:ae},k.createElement(_d,{className:z.modal,shadow:g,p:y,radius:_,role:"dialog","aria-labelledby":x,"aria-describedby":C,"aria-modal":!0,tabIndex:-1,style:st.modal,unstyled:he,onClick:Ke=>Ke.stopPropagation()},(i||a)&&k.createElement("div",{className:z.header},k.createElement(Tt,{id:x,className:z.title},i),a&&k.createElement(zS,{iconSize:16,onClick:s,"aria-label":d,className:z.close})),k.createElement("div",{id:C,className:z.body},o)))))))}JS.displayName="@mantine/core/Modal";const sSe={xs:16,sm:22,md:26,lg:30,xl:36},oSe={xs:10,sm:12,md:14,lg:16,xl:18};var aSe=at((e,{size:t,disabled:n,radius:r,readOnly:i,variant:s})=>({defaultValue:{display:"flex",alignItems:"center",backgroundColor:n?e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[3]:e.colorScheme==="dark"?e.colors.dark[7]:s==="filled"?e.white:e.colors.gray[1],color:n?e.colorScheme==="dark"?e.colors.dark[1]:e.colors.gray[7]:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[7],height:e.fn.size({size:t,sizes:sSe}),paddingLeft:e.fn.size({size:t,sizes:e.spacing}),paddingRight:n||i?e.fn.size({size:t,sizes:e.spacing}):0,fontWeight:500,fontSize:e.fn.size({size:t,sizes:oSe}),borderRadius:e.fn.size({size:r,sizes:e.radius}),cursor:n?"not-allowed":"default",userSelect:"none",maxWidth:"calc(100% - 20px)"},defaultValueRemove:{color:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[7],marginLeft:e.fn.size({size:t,sizes:e.spacing})/6},defaultValueLabel:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}));const uSe=aSe;var lSe=Object.defineProperty,gw=Object.getOwnPropertySymbols,XK=Object.prototype.hasOwnProperty,JK=Object.prototype.propertyIsEnumerable,s8=(e,t,n)=>t in e?lSe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,cSe=(e,t)=>{for(var n in t||(t={}))XK.call(t,n)&&s8(e,n,t[n]);if(gw)for(var n of gw(t))JK.call(t,n)&&s8(e,n,t[n]);return e},fSe=(e,t)=>{var n={};for(var r in e)XK.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&gw)for(var r of gw(e))t.indexOf(r)<0&&JK.call(e,r)&&(n[r]=e[r]);return n};const o8={xs:16,sm:22,md:24,lg:26,xl:30};function ZK(e){var t=e,{label:n,classNames:r,styles:i,className:s,onRemove:o,disabled:a,readOnly:u,size:l,radius:c="sm",variant:f}=t,d=fSe(t,["label","classNames","styles","className","onRemove","disabled","readOnly","size","radius","variant"]);const{classes:h,cx:p}=uSe({size:l,disabled:a,readOnly:u,radius:c,variant:f},{classNames:r,styles:i,name:"MultiSelect"});return k.createElement("div",cSe({className:p(h.defaultValue,s)},d),k.createElement("span",{className:h.defaultValueLabel},n),!a&&!u&&k.createElement(zS,{"aria-hidden":!0,onMouseDown:o,size:o8[l],radius:2,color:"blue",variant:"transparent",iconSize:o8[l]/2,className:h.defaultValueRemove,tabIndex:-1}))}ZK.displayName="@mantine/core/MultiSelect/DefaultValue";function dSe({data:e,searchable:t,limit:n,searchValue:r,filter:i,value:s}){if(!t&&s.length===0)return e;if(!t){const a=[];for(let u=0;ul===e[u].value&&!e[u].disabled)||a.push(e[u]);return a}const o=[];for(let a=0;au===e[a].value&&!e[a].disabled),e[a])&&o.push(e[a]),!(o.length>=n));a+=1);return o}var hSe=Object.defineProperty,yw=Object.getOwnPropertySymbols,eQ=Object.prototype.hasOwnProperty,tQ=Object.prototype.propertyIsEnumerable,a8=(e,t,n)=>t in e?hSe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,u8=(e,t)=>{for(var n in t||(t={}))eQ.call(t,n)&&a8(e,n,t[n]);if(yw)for(var n of yw(t))tQ.call(t,n)&&a8(e,n,t[n]);return e},pSe=(e,t)=>{var n={};for(var r in e)eQ.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&yw)for(var r of yw(e))t.indexOf(r)<0&&tQ.call(e,r)&&(n[r]=e[r]);return n};const mSe={xs:14,sm:18,md:20,lg:24,xl:28};function gSe(e){var t=e,{size:n,error:r,style:i}=t,s=pSe(t,["size","error","style"]);const o=ts(),a=o.fn.size({size:n,sizes:mSe});return k.createElement("svg",u8({width:a,height:a,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:u8({color:r?o.colors.red[6]:o.colors.gray[6]},i),"data-chevron":!0},s),k.createElement("path",{d:"M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}function nQ({shouldClear:e,clearButtonLabel:t,onClear:n,size:r,error:i,clearButtonTabIndex:s}){return e?k.createElement(zS,{variant:"transparent","aria-label":t,onClick:n,size:r,tabIndex:s,onMouseDown:o=>o.preventDefault()}):k.createElement(gSe,{error:i,size:r})}nQ.displayName="@mantine/core/SelectRightSection";var ySe=Object.defineProperty,_Se=Object.defineProperties,vSe=Object.getOwnPropertyDescriptors,_w=Object.getOwnPropertySymbols,rQ=Object.prototype.hasOwnProperty,iQ=Object.prototype.propertyIsEnumerable,l8=(e,t,n)=>t in e?ySe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,VC=(e,t)=>{for(var n in t||(t={}))rQ.call(t,n)&&l8(e,n,t[n]);if(_w)for(var n of _w(t))iQ.call(t,n)&&l8(e,n,t[n]);return e},c8=(e,t)=>_Se(e,vSe(t)),bSe=(e,t)=>{var n={};for(var r in e)rQ.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&_w)for(var r of _w(e))t.indexOf(r)<0&&iQ.call(e,r)&&(n[r]=e[r]);return n};const ESe={xs:24,sm:30,md:34,lg:44,xl:54};function sQ(e){var t=e,{styles:n,rightSection:r,rightSectionWidth:i,theme:s}=t,o=bSe(t,["styles","rightSection","rightSectionWidth","theme"]);if(r)return{rightSection:r,rightSectionWidth:i,styles:n};const a=typeof n=="function"?n(s):n;return{rightSectionWidth:s.fn.size({size:o.size,sizes:ESe}),rightSection:!o.readOnly&&!(o.disabled&&o.shouldClear)&&k.createElement(nQ,VC({},o)),styles:c8(VC({},a),{rightSection:c8(VC({},a==null?void 0:a.rightSection),{pointerEvents:o.shouldClear?void 0:"none"})})}}var wSe=Object.defineProperty,TSe=Object.defineProperties,SSe=Object.getOwnPropertyDescriptors,f8=Object.getOwnPropertySymbols,ISe=Object.prototype.hasOwnProperty,xSe=Object.prototype.propertyIsEnumerable,d8=(e,t,n)=>t in e?wSe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,CSe=(e,t)=>{for(var n in t||(t={}))ISe.call(t,n)&&d8(e,n,t[n]);if(f8)for(var n of f8(t))xSe.call(t,n)&&d8(e,n,t[n]);return e},ASe=(e,t)=>TSe(e,SSe(t)),OSe=at((e,{size:t,invalid:n})=>({wrapper:{position:"relative"},values:{minHeight:e.fn.size({size:t,sizes:Ss})-2,display:"flex",alignItems:"center",flexWrap:"wrap",marginLeft:`calc(${-e.spacing.xs}px / 2)`,boxSizing:"border-box"},value:{margin:`calc(${e.spacing.xs}px / 2 - 2px) calc(${e.spacing.xs}px / 2)`},searchInput:ASe(CSe({},e.fn.fontStyles()),{flex:1,minWidth:60,backgroundColor:"transparent",border:0,outline:0,fontSize:e.fn.size({size:t,sizes:e.fontSizes}),padding:0,marginLeft:`calc(${e.spacing.xs}px / 2)`,appearance:"none",color:"inherit",lineHeight:`${e.fn.size({size:t,sizes:Ss})-2}px`,"&::placeholder":{opacity:1,color:n?e.colors.red[e.colorScheme==="dark"?6:7]:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]},"&:disabled":{cursor:"not-allowed"}}),searchInputEmpty:{width:"100%"},searchInputInputHidden:{width:0,height:0,margin:0,overflow:"hidden"},searchInputPointer:{cursor:"pointer","&:disabled":{cursor:"not-allowed"}},input:{cursor:"pointer","&:disabled":{cursor:"not-allowed"}}}));const PSe=OSe;var RSe=Object.defineProperty,NSe=Object.defineProperties,kSe=Object.getOwnPropertyDescriptors,vw=Object.getOwnPropertySymbols,oQ=Object.prototype.hasOwnProperty,aQ=Object.prototype.propertyIsEnumerable,h8=(e,t,n)=>t in e?RSe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,vh=(e,t)=>{for(var n in t||(t={}))oQ.call(t,n)&&h8(e,n,t[n]);if(vw)for(var n of vw(t))aQ.call(t,n)&&h8(e,n,t[n]);return e},p8=(e,t)=>NSe(e,kSe(t)),DSe=(e,t)=>{var n={};for(var r in e)oQ.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&vw)for(var r of vw(e))t.indexOf(r)<0&&aQ.call(e,r)&&(n[r]=e[r]);return n};function $Se(e,t,n){return t?!1:n.label.toLowerCase().trim().includes(e.toLowerCase().trim())}function LSe(e,t){return!!e&&!t.some(n=>n.value.toLowerCase()===e.toLowerCase())}function m8(e,t){if(!Array.isArray(e))return;if(t.length===0)return[];const n=typeof t[0]=="object"?t.map(r=>r.value):t;return e.filter(r=>n.includes(r))}const MSe={size:"sm",valueComponent:ZK,itemComponent:pk,transition:"pop-top-left",transitionDuration:0,maxDropdownHeight:220,shadow:"sm",searchable:!1,filter:$Se,limit:1/0,clearSearchOnChange:!0,clearable:!1,clearSearchOnBlur:!1,disabled:!1,initiallyOpened:!1,creatable:!1,shouldCreate:LSe,switchDirectionOnFlip:!1,zIndex:To("popover"),selectOnBlur:!1,clearButtonTabIndex:0,positionDependencies:[]},uQ=w.forwardRef((e,t)=>{const n=ct("MultiSelect",MSe,e),{className:r,style:i,required:s,label:o,description:a,size:u,error:l,classNames:c,styles:f,wrapperProps:d,value:h,defaultValue:p,data:m,onChange:y,valueComponent:g,itemComponent:_,id:b,transition:T,transitionDuration:I,transitionTimingFunction:E,maxDropdownHeight:S,shadow:A,nothingFound:P,onFocus:V,onBlur:M,searchable:H,placeholder:J,filter:Y,limit:ye,clearSearchOnChange:he,clearable:ve,clearSearchOnBlur:te,clearButtonLabel:se,variant:K,onSearchChange:x,searchValue:C,disabled:z,initiallyOpened:R,radius:O,icon:q,rightSection:le,rightSectionWidth:ae,creatable:pe,getCreateLabel:me,shouldCreate:Se,onCreate:ce,sx:st,dropdownComponent:Ke,onDropdownClose:qe,onDropdownOpen:$e,maxSelectedValues:ot,withinPortal:lt,switchDirectionOnFlip:On,zIndex:Ue,selectOnBlur:Be,name:bt,dropdownPosition:je,errorProps:gt,labelProps:Gt,descriptionProps:an,clearButtonTabIndex:Gn,form:ue,positionDependencies:we,onKeyDown:Le,unstyled:rt,inputContainer:De,inputWrapperOrder:it,readOnly:Me,withAsterisk:Ze}=n,bn=DSe(n,["className","style","required","label","description","size","error","classNames","styles","wrapperProps","value","defaultValue","data","onChange","valueComponent","itemComponent","id","transition","transitionDuration","transitionTimingFunction","maxDropdownHeight","shadow","nothingFound","onFocus","onBlur","searchable","placeholder","filter","limit","clearSearchOnChange","clearable","clearSearchOnBlur","clearButtonLabel","variant","onSearchChange","searchValue","disabled","initiallyOpened","radius","icon","rightSection","rightSectionWidth","creatable","getCreateLabel","shouldCreate","onCreate","sx","dropdownComponent","onDropdownClose","onDropdownOpen","maxSelectedValues","withinPortal","switchDirectionOnFlip","zIndex","selectOnBlur","name","dropdownPosition","errorProps","labelProps","descriptionProps","clearButtonTabIndex","form","positionDependencies","onKeyDown","unstyled","inputContainer","inputWrapperOrder","readOnly","withAsterisk"]),{classes:Wt,cx:It,theme:Bn}=PSe({size:u,invalid:!!l},{classNames:c,styles:f,unstyled:rt,name:"MultiSelect"}),{systemStyles:En,rest:sa}=Xd(bn),fr=w.useRef(),Mi=w.useRef(),vr=w.useRef({}),$r=Fu(b),[dr,jn]=w.useState(R),[Zt,ri]=w.useState(-1),[br,Lr]=w.useState("column"),[yi,ms]=Oa({value:C,defaultValue:"",finalValue:void 0,onChange:x}),[Q,j]=w.useState(!1),{scrollIntoView:Z,targetRef:de,scrollableRef:fe}=KW({duration:0,offset:5,cancelable:!1,isList:!0}),He=pe&&typeof me=="function";let Te=null;const Ve=m.map(Ye=>typeof Ye=="string"?{label:Ye,value:Ye}:Ye),ft=hW({data:Ve}),[Je,mt]=Oa({value:m8(h,m),defaultValue:m8(p,m),finalValue:[],onChange:y}),Lt=w.useRef(!!ot&&ot{if(!Me){const zt=Je.filter(Hn=>Hn!==Ye);mt(zt),ot&&zt.length{ms(Ye.currentTarget.value),!z&&!Lt.current&&H&&jn(!0)},xn=Ye=>{typeof V=="function"&&V(Ye),!z&&!Lt.current&&H&&jn(!0)},Et=dSe({data:ft,searchable:H,searchValue:yi,limit:ye,filter:Y,value:Je}),mn=(Ye,zt,Hn)=>{let ii=Ye;for(;Hn(ii);)if(ii=zt(ii),!Et[ii].disabled)return ii;return Ye};fo(()=>{ri(-1)},[yi]),fo(()=>{!z&&Je.length>m.length&&jn(!1),ot&&Je.length=ot&&(Lt.current=!0,jn(!1))},[Je]);const tr=Ye=>{if(!Me)if(he&&ms(""),Je.includes(Ye.value))$n(Ye.value);else{if(Ye.creatable&&typeof ce=="function"){const zt=ce(Ye.value);typeof zt<"u"&&zt!==null&&mt(typeof zt=="string"?[...Je,zt]:[...Je,zt.value])}else mt([...Je,Ye.value]);Je.length===ot-1&&(Lt.current=!0,jn(!1)),Zt===Et.length-1&&ri(Et.length-2),Et.length===1&&jn(!1)}},Wr=Ye=>{typeof M=="function"&&M(Ye),Be&&Et[Zt]&&dr&&tr(Et[Zt]),te&&ms(""),jn(!1)},Pr=Ye=>{if(Q||(Le==null||Le(Ye),Me)||Ye.key!=="Backspace"&&ot&&Lt.current)return;const zt=br==="column",Hn=()=>{ri(gs=>{var N;const G=mn(gs,F=>F+1,F=>F{ri(gs=>{var N;const G=mn(gs,F=>F-1,F=>F>0);return dr&&(de.current=vr.current[(N=Et[G])==null?void 0:N.value],Z({alignment:zt?"start":"end"})),G})};switch(Ye.key){case"ArrowUp":{Ye.preventDefault(),jn(!0),zt?ii():Hn();break}case"ArrowDown":{Ye.preventDefault(),jn(!0),zt?Hn():ii();break}case"Enter":{Ye.preventDefault(),Et[Zt]&&dr?tr(Et[Zt]):jn(!0);break}case" ":{H||(Ye.preventDefault(),Et[Zt]&&dr?tr(Et[Zt]):jn(!0));break}case"Backspace":{Je.length>0&&yi.length===0&&(mt(Je.slice(0,-1)),jn(!0),ot&&(Lt.current=!1));break}case"Home":{if(!H){Ye.preventDefault(),dr||jn(!0);const gs=Et.findIndex(N=>!N.disabled);ri(gs),Z({alignment:zt?"end":"start"})}break}case"End":{if(!H){Ye.preventDefault(),dr||jn(!0);const gs=Et.map(N=>!!N.disabled).lastIndexOf(!1);ri(gs),Z({alignment:zt?"end":"start"})}break}case"Escape":jn(!1)}},is=Je.map(Ye=>{let zt=ft.find(Hn=>Hn.value===Ye&&!Hn.disabled);return!zt&&He&&(zt={value:Ye,label:Ye}),zt}).filter(Ye=>!!Ye).map(Ye=>k.createElement(g,p8(vh({},Ye),{variant:K,disabled:z,className:Wt.value,readOnly:Me,onRemove:zt=>{zt.preventDefault(),zt.stopPropagation(),$n(Ye.value)},key:Ye.value,size:u,styles:f,classNames:c,radius:O}))),_i=()=>{var Ye;ms(""),mt([]),(Ye=fr.current)==null||Ye.focus(),ot&&(Lt.current=!1)};He&&Se(yi,ft)&&(Te=me(yi),Et.push({label:yi,value:yi,creatable:!0}));const hr=!Me&&(Et.length>0?dr:dr&&!!P);return fo(()=>{const Ye=hr?$e:qe;typeof Ye=="function"&&Ye()},[hr]),k.createElement(Bs.Wrapper,vh(vh({required:s,id:$r,label:o,error:l,description:a,size:u,className:r,style:i,classNames:c,styles:f,__staticSelector:"MultiSelect",sx:st,errorProps:gt,descriptionProps:an,labelProps:Gt,inputContainer:De,inputWrapperOrder:it,unstyled:rt,withAsterisk:Ze},En),d),k.createElement(Bc,{opened:hr,transition:T,transitionDuration:I,shadow:"sm",withinPortal:lt,__staticSelector:"MultiSelect",onDirectionChange:Lr,switchDirectionOnFlip:On,zIndex:Ue,dropdownPosition:je,positionDependencies:we,classNames:c,styles:f,unstyled:rt},k.createElement(Bc.Target,null,k.createElement("div",{className:Wt.wrapper,role:"combobox","aria-haspopup":"listbox","aria-owns":dr&&hr?`${$r}-items`:null,"aria-controls":$r,"aria-expanded":dr,onMouseLeave:()=>ri(-1),tabIndex:-1,ref:Mi},k.createElement("input",{type:"hidden",name:bt,value:Je.join(","),form:ue,disabled:z}),k.createElement(Bs,vh({__staticSelector:"MultiSelect",style:{overflow:"hidden"},component:"div",multiline:!0,size:u,variant:K,disabled:z,invalid:!!l,required:s,radius:O,icon:q,unstyled:rt,onMouseDown:Ye=>{var zt;Ye.preventDefault(),!z&&!Lt.current&&jn(!dr),(zt=fr.current)==null||zt.focus()},classNames:p8(vh({},c),{input:It({[Wt.input]:!H},c==null?void 0:c.input)})},sQ({theme:Bn,rightSection:le,rightSectionWidth:ae,styles:f,size:u,shouldClear:ve&&Je.length>0,clearButtonLabel:se,onClear:_i,error:l,disabled:z,clearButtonTabIndex:Gn,readOnly:Me})),k.createElement("div",{className:Wt.values},is,k.createElement("input",vh({ref:Ko(t,fr),type:"search",id:$r,className:It(Wt.searchInput,{[Wt.searchInputPointer]:!H,[Wt.searchInputInputHidden]:!dr&&Je.length>0||!H&&Je.length>0,[Wt.searchInputEmpty]:Je.length===0}),onKeyDown:Pr,value:yi,onChange:pt,onFocus:xn,onBlur:Wr,readOnly:!H||Lt.current||Me,placeholder:Je.length===0?J:void 0,disabled:z,"data-mantine-stop-propagation":dr,autoComplete:"off",onCompositionStart:()=>j(!0),onCompositionEnd:()=>j(!1)},sa)))))),k.createElement(Bc.Dropdown,{component:Ke||GS,maxHeight:S,direction:br,id:$r,innerRef:fe,__staticSelector:"MultiSelect",classNames:c,styles:f},k.createElement(hk,{data:Et,hovered:Zt,classNames:c,styles:f,uuid:$r,__staticSelector:"MultiSelect",onItemHover:ri,onItemSelect:tr,itemsRefs:vr,itemComponent:_,size:u,nothingFound:P,creatable:pe&&!!Te,createLabel:Te,unstyled:rt}))))});uQ.displayName="@mantine/core/MultiSelect";const FSe=(e,t,n)=>Number.isInteger(e)&&e>=0&&t===0?"numeric":!Number.isInteger(e)&&e>=0&&t!==0?"decimal":Number.isInteger(e)&&e<0&&t===0||!Number.isInteger(e)&&e<0&&t!==0?n==="ios"?"text":"decimal":"numeric";function g8({direction:e,size:t}){return k.createElement("svg",{style:{transform:e==="up"?"rotate(180deg)":void 0},width:t,height:t,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},k.createElement("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}const lQ={xs:20,sm:24,md:30,lg:34,xl:36};var BSe=at((e,{radius:t,size:n})=>({rightSection:{display:"flex",flexDirection:"column",height:"calc(100% - 2px)",margin:1,marginRight:1,overflow:"hidden",borderTopRightRadius:e.fn.radius(t),borderBottomRightRadius:e.fn.radius(t)},control:{margin:0,position:"relative",flex:"0 0 50%",display:"flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",width:e.fn.size({size:n,sizes:lQ}),padding:0,WebkitTapHighlightColor:"transparent",borderBottom:`1px solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]}`,borderLeft:`1px solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]}`,borderTop:0,borderRight:0,backgroundColor:"transparent",marginRight:1,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,"&:not(:disabled):hover":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[0]},"&:disabled":{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[4]}},controlUp:{},controlDown:{borderBottom:0}}));const jSe=BSe;var USe=Object.defineProperty,VSe=Object.defineProperties,zSe=Object.getOwnPropertyDescriptors,bw=Object.getOwnPropertySymbols,cQ=Object.prototype.hasOwnProperty,fQ=Object.prototype.propertyIsEnumerable,y8=(e,t,n)=>t in e?USe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,zC=(e,t)=>{for(var n in t||(t={}))cQ.call(t,n)&&y8(e,n,t[n]);if(bw)for(var n of bw(t))fQ.call(t,n)&&y8(e,n,t[n]);return e},HSe=(e,t)=>VSe(e,zSe(t)),WSe=(e,t)=>{var n={};for(var r in e)cQ.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&bw)for(var r of bw(e))t.indexOf(r)<0&&fQ.call(e,r)&&(n[r]=e[r]);return n};const qSe={type:"text",size:"sm",__staticSelector:"TextInput"},Nk=w.forwardRef((e,t)=>{const n=QY("TextInput",qSe,e),{inputProps:r,wrapperProps:i}=n,s=WSe(n,["inputProps","wrapperProps"]);return k.createElement(Bs.Wrapper,zC({},i),k.createElement(Bs,HSe(zC(zC({},r),s),{ref:t})))});Nk.displayName="@mantine/core/TextInput";var YSe=Object.defineProperty,GSe=Object.defineProperties,KSe=Object.getOwnPropertyDescriptors,Ew=Object.getOwnPropertySymbols,dQ=Object.prototype.hasOwnProperty,hQ=Object.prototype.propertyIsEnumerable,_8=(e,t,n)=>t in e?YSe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,QSe=(e,t)=>{for(var n in t||(t={}))dQ.call(t,n)&&_8(e,n,t[n]);if(Ew)for(var n of Ew(t))hQ.call(t,n)&&_8(e,n,t[n]);return e},XSe=(e,t)=>GSe(e,KSe(t)),JSe=(e,t)=>{var n={};for(var r in e)dQ.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Ew)for(var r of Ew(e))t.indexOf(r)<0&&hQ.call(e,r)&&(n[r]=e[r]);return n};const ZSe=e=>e||"",eIe=e=>{if(e==="-")return e;let t=e;t[0]==="."&&(t=`0${e}`);const n=parseFloat(t);if(!Number.isNaN(n))return e},v8={xs:10,sm:14,md:16,lg:18,xl:20},tIe={step:1,hideControls:!1,size:"sm",precision:0,noClampOnBlur:!1,removeTrailingZeros:!1,formatter:ZSe,parser:eIe,type:"text"},pQ=w.forwardRef((e,t)=>{const n=ct("NumberInput",tIe,e),{disabled:r,value:i,onChange:s,decimalSeparator:o,min:a,max:u,startValue:l,step:c,stepHoldInterval:f,stepHoldDelay:d,onBlur:h,onFocus:p,onKeyDown:m,onKeyUp:y,hideControls:g,radius:_,variant:b,precision:T,removeTrailingZeros:I,defaultValue:E,noClampOnBlur:S,handlersRef:A,classNames:P,styles:V,size:M,rightSection:H,rightSectionWidth:J,formatter:Y,parser:ye,inputMode:he,unstyled:ve,type:te}=n,se=JSe(n,["disabled","value","onChange","decimalSeparator","min","max","startValue","step","stepHoldInterval","stepHoldDelay","onBlur","onFocus","onKeyDown","onKeyUp","hideControls","radius","variant","precision","removeTrailingZeros","defaultValue","noClampOnBlur","handlersRef","classNames","styles","size","rightSection","rightSectionWidth","formatter","parser","inputMode","unstyled","type"]),{classes:K,cx:x,theme:C}=jSe({radius:_,size:M},{classNames:P,styles:V,unstyled:ve,name:"NumberInput"}),z=De=>{if(De===void 0)return;let it=De.toFixed(T);return I&&T>0&&(it=it.replace(new RegExp(`[0]{0,${T}}$`),""),(it.endsWith(".")||it.endsWith(o))&&(it=it.slice(0,-1))),it},[R,O]=w.useState(!1),[q,le]=w.useState(typeof i=="number"?i:typeof E=="number"?E:void 0),ae=typeof i=="number"?i:q,[pe,me]=w.useState(typeof ae=="number"?z(ae):""),Se=w.useRef(),ce=De=>{De!==q&&!Number.isNaN(De)&&(typeof s=="function"&&s(De),le(De))},st=(De="")=>{let it=typeof De=="number"?String(De):De;return o&&(it=it.replace(/\./g,o)),Y(it)},Ke=De=>{let it=De;return o&&(it=it.replace(new RegExp(`\\${o}`,"g"),".")),ye(it)},qe=typeof a=="number"?a:-1/0,$e=typeof u=="number"?u:1/0,ot=w.useRef();ot.current=()=>{var De,it,Me;if(q===void 0)ce((De=l??a)!=null?De:0),me((Me=(it=z(l))!=null?it:z(a))!=null?Me:"0");else{const Ze=z(Mc(q+c,qe,$e));ce(parseFloat(Ze)),me(Ze)}};const lt=w.useRef();lt.current=()=>{var De,it,Me;if(q===void 0)ce((De=l??a)!=null?De:0),me((Me=(it=z(l))!=null?it:z(a))!=null?Me:"0");else{const Ze=z(Mc(q-c,qe,$e));ce(parseFloat(Ze)),me(Ze)}},YW(A,{increment:ot.current,decrement:lt.current}),w.useEffect(()=>{typeof i=="number"&&!R&&(le(i),me(z(i))),E===void 0&&i===void 0&&!R&&(le(i),me(""))},[i]);const On=d!==void 0&&f!==void 0,Ue=w.useRef(null),Be=w.useRef(0),bt=()=>{Ue.current&&window.clearTimeout(Ue.current),Ue.current=null,Be.current=0},je=De=>{De?ot.current():lt.current(),Be.current+=1},gt=De=>{if(je(De),On){const it=typeof f=="number"?f:f(Be.current);Ue.current=window.setTimeout(()=>gt(De),it)}},Gt=(De,it)=>{De.preventDefault(),Se.current.focus(),je(it),On&&(Ue.current=window.setTimeout(()=>gt(it),d))};w.useEffect(()=>(bt(),bt),[]);const an=k.createElement("div",{className:K.rightSection},k.createElement("button",{type:"button",tabIndex:-1,"aria-hidden":!0,disabled:ae>=u,className:x(K.control,K.controlUp),onPointerDown:De=>{Gt(De,!0)},onPointerUp:bt,onPointerLeave:bt},k.createElement(g8,{size:C.fn.size({size:M,sizes:v8}),direction:"up"})),k.createElement("button",{type:"button",tabIndex:-1,"aria-hidden":!0,disabled:ae<=a,className:x(K.control,K.controlDown),onPointerDown:De=>{Gt(De,!1)},onPointerUp:bt,onPointerLeave:bt},k.createElement(g8,{size:C.fn.size({size:M,sizes:v8}),direction:"down"}))),Gn=De=>{if(De.nativeEvent.isComposing)return;const Me=De.target.value,Ze=Ke(Me);me(Ze),Me===""||Me==="-"?ce(void 0):Me.trim()!==""&&!Number.isNaN(Ze)&&ce(parseFloat(Ze))},ue=De=>{var it;if(De.target.value==="")me(""),ce(void 0);else{let Me=De.target.value;(Me[0]===`${o}`||Me[0]===".")&&(Me=`0${Me}`);const Ze=Ke(Me),bn=Mc(parseFloat(Ze),qe,$e);Number.isNaN(bn)?me((it=z(ae))!=null?it:""):S||(me(z(bn)),ce(parseFloat(z(bn))))}O(!1),typeof h=="function"&&h(De)},we=De=>{O(!0),typeof p=="function"&&p(De)},Le=De=>{if(typeof m=="function"&&m(De),De.repeat&&On&&(De.key==="ArrowUp"||De.key==="ArrowDown")){De.preventDefault();return}De.key==="ArrowUp"?Gt(De,!0):De.key==="ArrowDown"&&Gt(De,!1)},rt=De=>{typeof y=="function"&&y(De),(De.key==="ArrowUp"||De.key==="ArrowDown")&&bt()};return k.createElement(Nk,XSe(QSe({},se),{type:te,variant:b,value:st(pe),disabled:r,ref:Ko(Se,t),onChange:Gn,onBlur:ue,onFocus:we,onKeyDown:Le,onKeyUp:rt,rightSection:H||(r||g||b==="unstyled"?null:an),rightSectionWidth:J||C.fn.size({size:M,sizes:lQ})+1,radius:_,max:u,min:a,step:c,size:M,styles:V,classNames:P,inputMode:he||FSe(c,T,Bpe()),__staticSelector:"NumberInput",unstyled:ve}))});pQ.displayName="@mantine/core/NumberInput";const b8={xs:3,sm:5,md:8,lg:12,xl:16},nIe=jhe({from:{backgroundPosition:"0 0"},to:{backgroundPosition:"40px 0"}});var rIe=at((e,{color:t,radius:n,size:r,striped:i,animate:s})=>({root:{position:"relative",height:e.fn.size({size:r,sizes:b8}),backgroundColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2],borderRadius:e.fn.size({size:n,sizes:e.radius}),overflow:"hidden"},bar:{position:"absolute",top:0,bottom:0,left:0,height:"100%",display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:e.fn.variant({variant:"filled",primaryFallback:!1,color:t||e.primaryColor}).background,transition:"width 100ms linear",animation:s?`${nIe} 1000ms linear infinite`:"none",backgroundSize:"20px 20px",backgroundImage:i?"linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent)":"none","&:last-of-type":{borderTopRightRadius:e.fn.size({size:n,sizes:e.radius}),borderBottomRightRadius:e.fn.size({size:n,sizes:e.radius})},"&:first-of-type":{borderTopLeftRadius:e.fn.size({size:n,sizes:e.radius}),borderBottomLeftRadius:e.fn.size({size:n,sizes:e.radius})},"@media (prefers-reduced-motion)":{transitionDuration:e.respectReducedMotion?"0ms":void 0}},label:{color:e.white,fontSize:e.fn.size({size:r,sizes:b8})*.65,fontWeight:700,userSelect:"none",overflow:"hidden",whiteSpace:"nowrap"}}));const iIe=rIe,mQ=w.createContext(!1),sIe=mQ.Provider,oIe=()=>w.useContext(mQ);function gQ({children:e,openDelay:t=0,closeDelay:n=0}){return k.createElement(sIe,{value:!0},k.createElement(b_e,{delay:{open:t,close:n}},e))}gQ.displayName="@mantine/core/TooltipGroup";var aIe=Object.defineProperty,uIe=Object.defineProperties,lIe=Object.getOwnPropertyDescriptors,E8=Object.getOwnPropertySymbols,cIe=Object.prototype.hasOwnProperty,fIe=Object.prototype.propertyIsEnumerable,w8=(e,t,n)=>t in e?aIe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,T8=(e,t)=>{for(var n in t||(t={}))cIe.call(t,n)&&w8(e,n,t[n]);if(E8)for(var n of E8(t))fIe.call(t,n)&&w8(e,n,t[n]);return e},dIe=(e,t)=>uIe(e,lIe(t));function hIe(e,t){if(!t)return{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[9],color:e.white};const n=e.fn.variant({variant:"filled",color:t,primaryFallback:!1});return{backgroundColor:n.background,color:n.color}}var pIe=at((e,{color:t,radius:n,width:r,multiline:i})=>({tooltip:dIe(T8(T8({},e.fn.fontStyles()),hIe(e,t)),{lineHeight:e.lineHeight,fontSize:e.fontSizes.sm,borderRadius:e.fn.radius(n),padding:`calc(${e.spacing.xs}px / 2) ${e.spacing.xs}px`,position:"absolute",whiteSpace:i?"unset":"nowrap",pointerEvents:"none",width:r}),arrow:{backgroundColor:"inherit",border:0,zIndex:1}}));const yQ=pIe,_Q={children:"Tooltip component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported"};function mIe({offset:e,position:t}){const[n,r]=w.useState(!1),i=w.useRef(),{x:s,y:o,reference:a,floating:u,refs:l,update:c,placement:f}=wk({placement:t,middleware:[vk({crossAxis:!0,padding:5,rootBoundary:"document"})]}),d=f.includes("right")?e:t.includes("left")?e*-1:0,h=f.includes("bottom")?e:t.includes("top")?e*-1:0,p=w.useCallback(({clientX:m,clientY:y})=>{a({getBoundingClientRect(){return{width:0,height:0,x:m,y,left:m+d,top:y+h,right:m,bottom:y}}})},[a]);return w.useEffect(()=>{if(l.floating.current){const m=i.current;m.addEventListener("mousemove",p);const y=pl(l.floating.current);return y.forEach(g=>{g.addEventListener("scroll",c)}),()=>{m.removeEventListener("mousemove",p),y.forEach(g=>{g.removeEventListener("scroll",c)})}}},[a,l.floating,c,p,n]),{handleMouseMove:p,x:s,y:o,opened:n,setOpened:r,boundaryRef:i,floating:u}}var gIe=Object.defineProperty,yIe=Object.defineProperties,_Ie=Object.getOwnPropertyDescriptors,ww=Object.getOwnPropertySymbols,vQ=Object.prototype.hasOwnProperty,bQ=Object.prototype.propertyIsEnumerable,S8=(e,t,n)=>t in e?gIe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,HC=(e,t)=>{for(var n in t||(t={}))vQ.call(t,n)&&S8(e,n,t[n]);if(ww)for(var n of ww(t))bQ.call(t,n)&&S8(e,n,t[n]);return e},WC=(e,t)=>yIe(e,_Ie(t)),vIe=(e,t)=>{var n={};for(var r in e)vQ.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ww)for(var r of ww(e))t.indexOf(r)<0&&bQ.call(e,r)&&(n[r]=e[r]);return n};const bIe={refProp:"ref",withinPortal:!0,offset:10,position:"right",zIndex:To("popover")};function EQ(e){var t;const n=ct("TooltipFloating",bIe,e),{children:r,refProp:i,withinPortal:s,style:o,className:a,classNames:u,styles:l,unstyled:c,radius:f,color:d,label:h,offset:p,position:m,multiline:y,width:g,zIndex:_,disabled:b}=n,T=vIe(n,["children","refProp","withinPortal","style","className","classNames","styles","unstyled","radius","color","label","offset","position","multiline","width","zIndex","disabled"]),{handleMouseMove:I,x:E,y:S,opened:A,boundaryRef:P,floating:V,setOpened:M}=mIe({offset:p,position:m}),{classes:H,cx:J}=yQ({radius:f,color:d,multiline:y,width:g},{name:"Tooltip",classNames:u,styles:l,unstyled:c});if(!Dm(r))throw new Error(_Q.children);const Y=Ko(P,r.ref),ye=ve=>{var te,se;(se=(te=r.props).onMouseEnter)==null||se.call(te,ve),I(ve),M(!0)},he=ve=>{var te,se;(se=(te=r.props).onMouseLeave)==null||se.call(te,ve),M(!1)};return b?k.createElement(k.Fragment,null,r):k.createElement(k.Fragment,null,k.createElement(S_,{withinPortal:s},k.createElement(ut,WC(HC({},T),{ref:V,className:J(H.tooltip,a),style:WC(HC({},o),{zIndex:_,display:A?"block":"none",top:S??"",left:(t=Math.round(E))!=null?t:""})}),h)),w.cloneElement(r,WC(HC({},r.props),{[i]:Y,onMouseEnter:ye,onMouseLeave:he})))}EQ.displayName="@mantine/core/TooltipFloating";function EIe(e){const[t,n]=w.useState(!1),i=typeof e.opened=="boolean"?e.opened:t,s=oIe(),o=Fu(),{delay:a,currentId:u,setCurrentId:l}=PY(),c=w.useCallback(A=>{n(A),A&&l(o)},[l,o]),{x:f,y:d,reference:h,floating:p,context:m,refs:y,update:g,placement:_,middlewareData:{arrow:{x:b,y:T}={}}}=wk({placement:e.position,open:i,onOpenChange:c,middleware:[_Y(e.offset),vk({padding:8}),yY(),xY({element:e.arrowRef}),...e.inline?[bY()]:[]]}),{getReferenceProps:I,getFloatingProps:E}=g_e([v_e(m,{enabled:e.events.hover,delay:s?a:{open:e.openDelay,close:e.closeDelay},mouseOnly:!e.events.touch}),x_e(m,{enabled:e.events.focus,keyboardOnly:!0}),w_e(m,{role:"tooltip"}),I_e(m,{enabled:typeof e.opened===void 0}),E_e(m,{id:o})]);return RY({opened:i,positionDependencies:e.positionDependencies,floating:{refs:y,update:g}}),fo(()=>{var A;(A=e.onPositionChange)==null||A.call(e,_)},[_]),{x:f,y:d,arrowX:b,arrowY:T,reference:h,floating:p,getFloatingProps:E,getReferenceProps:I,isGroupPhase:i&&u&&u!==o,opened:i,placement:_}}var wIe=Object.defineProperty,TIe=Object.defineProperties,SIe=Object.getOwnPropertyDescriptors,Tw=Object.getOwnPropertySymbols,wQ=Object.prototype.hasOwnProperty,TQ=Object.prototype.propertyIsEnumerable,I8=(e,t,n)=>t in e?wIe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Og=(e,t)=>{for(var n in t||(t={}))wQ.call(t,n)&&I8(e,n,t[n]);if(Tw)for(var n of Tw(t))TQ.call(t,n)&&I8(e,n,t[n]);return e},IIe=(e,t)=>TIe(e,SIe(t)),xIe=(e,t)=>{var n={};for(var r in e)wQ.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Tw)for(var r of Tw(e))t.indexOf(r)<0&&TQ.call(e,r)&&(n[r]=e[r]);return n};const CIe={position:"top",refProp:"ref",withinPortal:!1,inline:!1,arrowSize:4,arrowOffset:5,arrowRadius:0,offset:5,transition:"fade",transitionDuration:100,width:"auto",events:{hover:!0,focus:!1,touch:!1},zIndex:To("popover"),positionDependencies:[]},ZS=w.forwardRef((e,t)=>{const n=w.useRef(null),r=ct("Tooltip",CIe,e),{children:i,position:s,refProp:o,label:a,openDelay:u,closeDelay:l,onPositionChange:c,opened:f,withinPortal:d,radius:h,color:p,classNames:m,styles:y,unstyled:g,style:_,className:b,withArrow:T,arrowSize:I,arrowOffset:E,arrowRadius:S,offset:A,transition:P,transitionDuration:V,multiline:M,width:H,events:J,zIndex:Y,disabled:ye,positionDependencies:he,onClick:ve,onMouseEnter:te,onMouseLeave:se,inline:K}=r,x=xIe(r,["children","position","refProp","label","openDelay","closeDelay","onPositionChange","opened","withinPortal","radius","color","classNames","styles","unstyled","style","className","withArrow","arrowSize","arrowOffset","arrowRadius","offset","transition","transitionDuration","multiline","width","events","zIndex","disabled","positionDependencies","onClick","onMouseEnter","onMouseLeave","inline"]),{classes:C,cx:z,theme:R}=yQ({radius:h,color:p,width:H,multiline:M},{name:"Tooltip",classNames:m,styles:y,unstyled:g}),O=EIe({position:WY(R.dir,s),closeDelay:l,openDelay:u,onPositionChange:c,opened:f,events:J,arrowRef:n,offset:A+(T?I/2:0),positionDependencies:[...he,i],inline:K});if(!Dm(i))throw new Error(_Q.children);const q=Ko(O.reference,i.ref,t);return k.createElement(k.Fragment,null,k.createElement(S_,{withinPortal:d},k.createElement(XS,{mounted:!ye&&O.opened,transition:P,duration:O.isGroupPhase?10:V},le=>{var ae,pe;return k.createElement(ut,Og(Og({},x),O.getFloatingProps({ref:O.floating,className:C.tooltip,style:IIe(Og(Og({},_),le),{zIndex:Y,top:(ae=O.y)!=null?ae:0,left:(pe=O.x)!=null?pe:0})})),a,k.createElement(Tk,{ref:n,arrowX:O.arrowX,arrowY:O.arrowY,visible:T,withBorder:!1,position:O.placement,arrowSize:I,arrowOffset:E,arrowRadius:S,className:C.arrow}))})),w.cloneElement(i,O.getReferenceProps(Og({onClick:ve,onMouseEnter:te,onMouseLeave:se,onMouseMove:e.onMouseMove,onPointerDown:e.onPointerDown,onPointerEnter:e.onPointerEnter,[o]:q,className:z(b,i.props.className)},i.props))))});ZS.Group=gQ;ZS.Floating=EQ;ZS.displayName="@mantine/core/Tooltip";const SQ=ZS;var AIe=Object.defineProperty,OIe=Object.defineProperties,PIe=Object.getOwnPropertyDescriptors,Sw=Object.getOwnPropertySymbols,IQ=Object.prototype.hasOwnProperty,xQ=Object.prototype.propertyIsEnumerable,x8=(e,t,n)=>t in e?AIe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,VP=(e,t)=>{for(var n in t||(t={}))IQ.call(t,n)&&x8(e,n,t[n]);if(Sw)for(var n of Sw(t))xQ.call(t,n)&&x8(e,n,t[n]);return e},CQ=(e,t)=>OIe(e,PIe(t)),C8=(e,t)=>{var n={};for(var r in e)IQ.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Sw)for(var r of Sw(e))t.indexOf(r)<0&&xQ.call(e,r)&&(n[r]=e[r]);return n};function RIe(e){return e.reduce((t,n)=>(t.sections.push(CQ(VP({},n),{accumulated:t.accumulated})),t.accumulated+=n.value,t),{accumulated:0,sections:[]}).sections}const NIe={size:"md",radius:"sm",striped:!1,animate:!1,label:""},AQ=w.forwardRef((e,t)=>{const n=ct("Progress",NIe,e),{className:r,value:i,color:s,size:o,radius:a,striped:u,animate:l,label:c,"aria-label":f,classNames:d,styles:h,sections:p,unstyled:m}=n,y=C8(n,["className","value","color","size","radius","striped","animate","label","aria-label","classNames","styles","sections","unstyled"]),{classes:g,cx:_,theme:b}=iIe({color:s,size:o,radius:a,striped:u||l,animate:l},{classNames:d,styles:h,unstyled:m,name:"Progress"}),T=Array.isArray(p)?RIe(p).map((I,E)=>{var S=I,{tooltip:A,accumulated:P,value:V,label:M,color:H}=S,J=C8(S,["tooltip","accumulated","value","label","color"]);return k.createElement(SQ.Floating,{label:A,disabled:!A,key:E},k.createElement(ut,CQ(VP({},J),{className:_(g.bar,J.className),sx:{width:`${V}%`,left:`${P}%`,backgroundColor:b.fn.variant({variant:"filled",primaryFallback:!1,color:H||b.primaryColor}).background}}),M&&k.createElement(Tt,{className:g.label},M)))}):null;return k.createElement(ut,VP({className:_(g.root,r),ref:t},y),T||k.createElement("div",{role:"progressbar","aria-valuemax":100,"aria-valuemin":0,"aria-valuenow":i,"aria-label":f,className:g.bar,style:{width:`${i}%`}},c?k.createElement(Tt,{className:g.label},c):""))});AQ.displayName="@mantine/core/Progress";var kIe=Object.defineProperty,A8=Object.getOwnPropertySymbols,DIe=Object.prototype.hasOwnProperty,$Ie=Object.prototype.propertyIsEnumerable,O8=(e,t,n)=>t in e?kIe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,LIe=(e,t)=>{for(var n in t||(t={}))DIe.call(t,n)&&O8(e,n,t[n]);if(A8)for(var n of A8(t))$Ie.call(t,n)&&O8(e,n,t[n]);return e};function MIe(e){return k.createElement("svg",LIe({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 5 5"},e),k.createElement("path",{fill:"currentColor",d:"M0 2.5a2.5 2.5 0 115 0 2.5 2.5 0 01-5 0z"}))}const OQ=w.createContext(null),FIe=OQ.Provider,BIe=()=>w.useContext(OQ);var jIe=Object.defineProperty,Iw=Object.getOwnPropertySymbols,PQ=Object.prototype.hasOwnProperty,RQ=Object.prototype.propertyIsEnumerable,P8=(e,t,n)=>t in e?jIe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,R8=(e,t)=>{for(var n in t||(t={}))PQ.call(t,n)&&P8(e,n,t[n]);if(Iw)for(var n of Iw(t))RQ.call(t,n)&&P8(e,n,t[n]);return e},UIe=(e,t)=>{var n={};for(var r in e)PQ.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Iw)for(var r of Iw(e))t.indexOf(r)<0&&RQ.call(e,r)&&(n[r]=e[r]);return n};const VIe={orientation:"horizontal",spacing:"lg",offset:"xs",size:"sm"},NQ=w.forwardRef((e,t)=>{const n=ct("RadioGroup",VIe,e),{children:r,value:i,defaultValue:s,onChange:o,orientation:a,spacing:u,size:l,wrapperProps:c,unstyled:f,offset:d,name:h}=n,p=UIe(n,["children","value","defaultValue","onChange","orientation","spacing","size","wrapperProps","unstyled","offset","name"]),[m,y]=Oa({value:i,defaultValue:s,finalValue:"",onChange:o}),g=_=>y(_.currentTarget.value);return k.createElement(FIe,{value:{value:m,onChange:g,size:l,name:h}},k.createElement(Bs.Wrapper,R8(R8({labelElement:"div",size:l,__staticSelector:"RadioGroup",ref:t,unstyled:f},c),p),k.createElement($G,{spacing:u,orientation:a,unstyled:f,role:"radiogroup",offset:d},r)))});NQ.displayName="@mantine/core/RadioGroup";var zIe=Object.defineProperty,HIe=Object.defineProperties,WIe=Object.getOwnPropertyDescriptors,N8=Object.getOwnPropertySymbols,qIe=Object.prototype.hasOwnProperty,YIe=Object.prototype.propertyIsEnumerable,k8=(e,t,n)=>t in e?zIe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,GIe=(e,t)=>{for(var n in t||(t={}))qIe.call(t,n)&&k8(e,n,t[n]);if(N8)for(var n of N8(t))YIe.call(t,n)&&k8(e,n,t[n]);return e},KIe=(e,t)=>HIe(e,WIe(t));const qC={xs:16,sm:20,md:24,lg:30,xl:36},Qv={xs:6,sm:8,md:10,lg:14,xl:16};var QIe=at((e,{size:t,color:n,transitionDuration:r,labelPosition:i,error:s},o)=>{const a=e.fn.variant({variant:"filled",color:n}),u=e.fn.variant({variant:"filled",color:"red"}).background;return{inner:{order:i==="left"?2:1,position:"relative",alignSelf:"flex-start"},icon:{ref:o("icon"),color:e.white,opacity:0,transform:"scale(0.75) translateY(2px)",transition:`opacity ${r}ms ${e.transitionTimingFunction}`,pointerEvents:"none",width:e.fn.size({sizes:Qv,size:t}),height:e.fn.size({sizes:Qv,size:t}),position:"absolute",top:`calc(50% - ${e.fn.size({sizes:Qv,size:t})/2}px)`,left:`calc(50% - ${e.fn.size({sizes:Qv,size:t})/2}px)`},radio:KIe(GIe({},e.fn.focusStyles()),{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.white,border:`1px solid ${s?u:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]}`,position:"relative",appearance:"none",width:e.fn.size({sizes:qC,size:t}),height:e.fn.size({sizes:qC,size:t}),borderRadius:e.fn.size({sizes:qC,size:t}),margin:0,display:"flex",alignItems:"center",justifyContent:"center",transitionProperty:"background-color, border-color",transitionTimingFunction:e.transitionTimingFunction,transitionDuration:`${r}ms`,cursor:e.cursorType,"&:checked":{background:a.background,borderColor:a.background,[`& + .${o("icon")}`]:{opacity:1,transform:"scale(1)"}},"&:disabled":{borderColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[4],backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1],[`& + .${o("icon")}`]:{color:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[4]}}})}});const XIe=QIe;var JIe=Object.defineProperty,xw=Object.getOwnPropertySymbols,kQ=Object.prototype.hasOwnProperty,DQ=Object.prototype.propertyIsEnumerable,D8=(e,t,n)=>t in e?JIe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Xv=(e,t)=>{for(var n in t||(t={}))kQ.call(t,n)&&D8(e,n,t[n]);if(xw)for(var n of xw(t))DQ.call(t,n)&&D8(e,n,t[n]);return e},ZIe=(e,t)=>{var n={};for(var r in e)kQ.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&xw)for(var r of xw(e))t.indexOf(r)<0&&DQ.call(e,r)&&(n[r]=e[r]);return n};const exe={icon:MIe,transitionDuration:100,size:"sm",labelPosition:"right"},Cw=w.forwardRef((e,t)=>{var n,r;const i=ct("Radio",exe,e),{className:s,style:o,id:a,label:u,size:l,title:c,disabled:f,color:d,classNames:h,styles:p,sx:m,icon:y,transitionDuration:g,wrapperProps:_,unstyled:b,labelPosition:T,description:I,error:E}=i,S=ZIe(i,["className","style","id","label","size","title","disabled","color","classNames","styles","sx","icon","transitionDuration","wrapperProps","unstyled","labelPosition","description","error"]),A=BIe(),P=(n=A==null?void 0:A.size)!=null?n:l,V=e.size?l:P,{classes:M}=XIe({color:d,size:V,transitionDuration:g,labelPosition:T,error:!!E},{classNames:h,styles:p,unstyled:b,name:"Radio"}),{systemStyles:H,rest:J}=Xd(S),Y=Fu(a),ye=A?{checked:A.value===J.value,name:(r=J.name)!=null?r:A.name,onChange:A.onChange}:{};return k.createElement(Ok,Xv(Xv({className:s,sx:m,style:o,id:Y,size:V,labelPosition:T,label:u,description:I,error:E,disabled:f,__staticSelector:"Radio",classNames:h,styles:p,unstyled:b,"data-checked":ye.checked||void 0},H),_),k.createElement("div",{className:M.inner},k.createElement("input",Xv(Xv({ref:t,className:M.radio,type:"radio",id:Y,disabled:f},J),ye)),k.createElement(y,{className:M.icon,"aria-hidden":!0})))});Cw.displayName="@mantine/core/Radio";Cw.Group=NQ;var txe=Object.defineProperty,nxe=Object.defineProperties,rxe=Object.getOwnPropertyDescriptors,$8=Object.getOwnPropertySymbols,ixe=Object.prototype.hasOwnProperty,sxe=Object.prototype.propertyIsEnumerable,L8=(e,t,n)=>t in e?txe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Jv=(e,t)=>{for(var n in t||(t={}))ixe.call(t,n)&&L8(e,n,t[n]);if($8)for(var n of $8(t))sxe.call(t,n)&&L8(e,n,t[n]);return e},oxe=(e,t)=>nxe(e,rxe(t));const tb=4,M8={xs:"3px 6px",sm:"5px 10px",md:"7px 14px",lg:"9px 16px",xl:"12px 20px"};var axe=at((e,{fullWidth:t,color:n,radius:r,shouldAnimate:i,transitionDuration:s,transitionTimingFunction:o,size:a,orientation:u},l)=>{const c=u==="vertical",f=e.fn.variant({variant:"filled",color:n});return{label:oxe(Jv(Jv({ref:l("label")},e.fn.focusStyles()),e.fn.fontStyles()),{WebkitTapHighlightColor:"transparent",borderRadius:e.fn.radius(r),fontWeight:500,fontSize:a in e.fontSizes?e.fontSizes[a]:e.fontSizes.sm,cursor:"pointer",display:"block",textAlign:"center",padding:M8[a in M8?a:"sm"],whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",userSelect:"none",color:e.colorScheme==="dark"?e.colors.dark[1]:e.colors.gray[7],transition:`color ${i?0:s}ms ${o||e.transitionTimingFunction}`,"&:hover":{color:e.colorScheme==="dark"?e.colors.dark[0]:e.black}}),control:{ref:l("control"),position:"relative",boxSizing:"border-box",flex:1,zIndex:2,transition:`border-left-color ${i?0:s}ms ${o||e.transitionTimingFunction}`,"&:not(:first-of-type)":{borderStyle:"solid",borderWidth:c?"1px 0 0 0":"0 0 0 1px",borderColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3]}},input:{height:0,width:0,position:"absolute",overflow:"hidden",whiteSpace:"nowrap",opacity:0,"&:focus":{outline:"none",[`& + .${l("label")}`]:Jv({},e.focusRing==="always"||e.focusRing==="auto"?e.focusRingStyles.styles(e):e.focusRingStyles.resetStyles(e)),"&:focus:not(:focus-visible)":{[`& + .${l("label")}`]:Jv({},e.focusRing==="auto"||e.focusRing==="never"?e.focusRingStyles.resetStyles(e):null)}}},root:{position:"relative",display:t||c?"flex":"inline-flex",width:c&&!t?"max-content":"auto",flexDirection:c?"column":"row",backgroundColor:e.colorScheme==="dark"?e.colors.dark[8]:e.colors.gray[1],borderRadius:e.fn.radius(r),overflow:"hidden",padding:tb},controlActive:{borderLeftColor:"transparent !important",borderTopColor:"transparent !important",[`& + .${l("control")}`]:{borderLeftColor:"transparent !important",borderTopColor:"transparent !important"},borderRadius:e.fn.radius(r),boxShadow:i?n||e.colorScheme==="dark"?"none":e.shadows.xs:void 0,backgroundColor:i?n?f.background:e.colorScheme==="dark"?e.colors.dark[5]:e.white:void 0},labelActive:{"&, &:hover":{color:n||e.colorScheme==="dark"?e.white:e.black}},disabled:{"&, &:hover":{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5],cursor:"not-allowed"}},active:{boxSizing:"border-box",borderRadius:e.fn.radius(r),position:"absolute",zIndex:1,boxShadow:n||e.colorScheme==="dark"?"none":e.shadows.xs,transition:`transform ${i?0:s}ms ${e.transitionTimingFunction}, width ${i?0:s/2}ms ${o||e.transitionTimingFunction}`,backgroundColor:n?f.background:e.colorScheme==="dark"?e.colors.dark[5]:e.white}}});const uxe=axe;var lxe=Object.defineProperty,Aw=Object.getOwnPropertySymbols,$Q=Object.prototype.hasOwnProperty,LQ=Object.prototype.propertyIsEnumerable,F8=(e,t,n)=>t in e?lxe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,cxe=(e,t)=>{for(var n in t||(t={}))$Q.call(t,n)&&F8(e,n,t[n]);if(Aw)for(var n of Aw(t))LQ.call(t,n)&&F8(e,n,t[n]);return e},fxe=(e,t)=>{var n={};for(var r in e)$Q.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Aw)for(var r of Aw(e))t.indexOf(r)<0&&LQ.call(e,r)&&(n[r]=e[r]);return n};const dxe={disabled:!1,size:"sm",transitionDuration:200},MQ=w.forwardRef((e,t)=>{var n,r,i,s;const o=ct("SegmentedControl",dxe,e),{className:a,disabled:u,data:l,name:c,value:f,onChange:d,color:h,fullWidth:p,radius:m,size:y,transitionDuration:g,transitionTimingFunction:_,classNames:b,styles:T,defaultValue:I,orientation:E,unstyled:S}=o,A=fxe(o,["className","disabled","data","name","value","onChange","color","fullWidth","radius","size","transitionDuration","transitionTimingFunction","classNames","styles","defaultValue","orientation","unstyled"]),P=ts(),V=lk(),M=P.respectReducedMotion?V:!1,H=l.map(ae=>typeof ae=="string"?{label:ae,value:ae}:ae),J=w.useRef(),[Y,ye]=w.useState(!1),[he,ve]=Oa({value:f,defaultValue:I,finalValue:Array.isArray(H)&&(s=(i=(n=H.find(ae=>!ae.disabled))==null?void 0:n.value)!=null?i:(r=H[0])==null?void 0:r.value)!=null?s:null,onChange:d}),{classes:te,cx:se}=uxe({size:y,fullWidth:p,color:h,radius:m,shouldAnimate:M||!Y,transitionDuration:g,transitionTimingFunction:_,orientation:E},{classNames:b,styles:T,unstyled:S,name:"SegmentedControl"}),[K,x]=w.useState({width:0,height:0,translate:[0,0]}),C=Fu(c),z=w.useRef({}),[R,O]=Rpe();uk(()=>{J.current?ye(!0):(J.current=!0,ye(!1))}),w.useEffect(()=>{if(he in z.current&&R.current){const ae=z.current[he],pe=ae.getBoundingClientRect(),me=ae.offsetWidth/pe.width,Se=pe.width*me||0,ce=pe.height*me||0,st=O.width-ae.parentElement.offsetLeft+tb-Se,Ke=ae.parentElement.offsetLeft-tb;x({width:Se,height:ce,translate:[P.dir==="rtl"?st:Ke,ae.parentElement.offsetTop-tb]})}},[he,O]);const q=H.map(ae=>k.createElement("div",{className:se(te.control,{[te.controlActive]:he===ae.value}),key:ae.value},k.createElement("input",{className:te.input,disabled:u||ae.disabled,type:"radio",name:C,value:ae.value,id:`${C}-${ae.value}`,checked:he===ae.value,onChange:()=>ve(ae.value)}),k.createElement("label",{className:se(te.label,{[te.labelActive]:he===ae.value,[te.disabled]:u||ae.disabled}),htmlFor:`${C}-${ae.value}`,ref:pe=>{z.current[ae.value]=pe}},ae.label))),le=Ko(R,t);return H.length===0?null:k.createElement(ut,cxe({className:se(te.root,a),ref:le},A),typeof he=="string"&&Y&&k.createElement(ut,{component:"span",className:te.active,sx:{width:K.width,height:K.height,transform:`translate(${K.translate[0]}px, ${K.translate[1]}px )`}}),q)});MQ.displayName="@mantine/core/SegmentedControl";function hxe({data:e,searchable:t,limit:n,searchValue:r,filter:i,value:s,filterDataOnExactSearchMatch:o}){if(!t)return e;const a=s!=null&&e.find(l=>l.value===s)||null;if(a&&!o&&(a==null?void 0:a.label)===r)return e;const u=[];for(let l=0;l=n));l+=1);return u}var pxe=at(()=>({input:{"&:not(:disabled)":{cursor:"pointer","&::selection":{backgroundColor:"transparent"}}}}));const mxe=pxe;var gxe=Object.defineProperty,yxe=Object.defineProperties,_xe=Object.getOwnPropertyDescriptors,Ow=Object.getOwnPropertySymbols,FQ=Object.prototype.hasOwnProperty,BQ=Object.prototype.propertyIsEnumerable,B8=(e,t,n)=>t in e?gxe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Pg=(e,t)=>{for(var n in t||(t={}))FQ.call(t,n)&&B8(e,n,t[n]);if(Ow)for(var n of Ow(t))BQ.call(t,n)&&B8(e,n,t[n]);return e},YC=(e,t)=>yxe(e,_xe(t)),vxe=(e,t)=>{var n={};for(var r in e)FQ.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Ow)for(var r of Ow(e))t.indexOf(r)<0&&BQ.call(e,r)&&(n[r]=e[r]);return n};function bxe(e,t){return t.label.toLowerCase().trim().includes(e.toLowerCase().trim())}function Exe(e,t){return!!e&&!t.some(n=>n.label.toLowerCase()===e.toLowerCase())}const wxe={required:!1,size:"sm",shadow:"sm",itemComponent:pk,transition:"fade",transitionDuration:0,initiallyOpened:!1,filter:bxe,maxDropdownHeight:220,searchable:!1,clearable:!1,limit:1/0,disabled:!1,creatable:!1,shouldCreate:Exe,selectOnBlur:!1,switchDirectionOnFlip:!1,filterDataOnExactSearchMatch:!1,zIndex:To("popover"),clearButtonTabIndex:0,positionDependencies:[],dropdownPosition:"flip"},jQ=w.forwardRef((e,t)=>{const n=QY("Select",wxe,e),{inputProps:r,wrapperProps:i,shadow:s,data:o,value:a,defaultValue:u,onChange:l,itemComponent:c,onKeyDown:f,onBlur:d,onFocus:h,transition:p,transitionDuration:m,initiallyOpened:y,transitionTimingFunction:g,unstyled:_,classNames:b,styles:T,filter:I,maxDropdownHeight:E,searchable:S,clearable:A,nothingFound:P,clearButtonLabel:V,limit:M,disabled:H,onSearchChange:J,searchValue:Y,rightSection:ye,rightSectionWidth:he,creatable:ve,getCreateLabel:te,shouldCreate:se,selectOnBlur:K,onCreate:x,dropdownComponent:C,onDropdownClose:z,onDropdownOpen:R,withinPortal:O,switchDirectionOnFlip:q,zIndex:le,name:ae,dropdownPosition:pe,allowDeselect:me,placeholder:Se,filterDataOnExactSearchMatch:ce,clearButtonTabIndex:st,form:Ke,positionDependencies:qe,readOnly:$e}=n,ot=vxe(n,["inputProps","wrapperProps","shadow","data","value","defaultValue","onChange","itemComponent","onKeyDown","onBlur","onFocus","transition","transitionDuration","initiallyOpened","transitionTimingFunction","unstyled","classNames","styles","filter","maxDropdownHeight","searchable","clearable","nothingFound","clearButtonLabel","limit","disabled","onSearchChange","searchValue","rightSection","rightSectionWidth","creatable","getCreateLabel","shouldCreate","selectOnBlur","onCreate","dropdownComponent","onDropdownClose","onDropdownOpen","withinPortal","switchDirectionOnFlip","zIndex","name","dropdownPosition","allowDeselect","placeholder","filterDataOnExactSearchMatch","clearButtonTabIndex","form","positionDependencies","readOnly"]),{classes:lt,cx:On,theme:Ue}=mxe(),[Be,bt]=w.useState(y),[je,gt]=w.useState(-1),Gt=w.useRef(),an=w.useRef({}),[Gn,ue]=w.useState("column"),we=Gn==="column",{scrollIntoView:Le,targetRef:rt,scrollableRef:De}=KW({duration:0,offset:5,cancelable:!1,isList:!0}),it=me===void 0?A:me,Me=Te=>{if(Be!==Te){bt(Te);const Ve=Te?R:z;typeof Ve=="function"&&Ve()}},Ze=ve&&typeof te=="function";let bn=null;const Wt=o.map(Te=>typeof Te=="string"?{label:Te,value:Te}:Te),It=hW({data:Wt}),[Bn,En,sa]=Oa({value:a,defaultValue:u,finalValue:null,onChange:l}),fr=It.find(Te=>Te.value===Bn),[Mi,vr]=Oa({value:Y,defaultValue:(fr==null?void 0:fr.label)||"",finalValue:void 0,onChange:J}),$r=Te=>{vr(Te),S&&typeof J=="function"&&J(Te)},dr=()=>{var Te;$e||(En(null),sa||$r(""),(Te=Gt.current)==null||Te.focus())};w.useEffect(()=>{const Te=It.find(Ve=>Ve.value===Bn);Te?$r(Te.label):(!Ze||!Bn)&&$r("")},[Bn]),w.useEffect(()=>{fr&&(!S||!Be)&&$r(fr.label)},[fr==null?void 0:fr.label]);const jn=Te=>{if(!$e)if(it&&(fr==null?void 0:fr.value)===Te.value)En(null),Me(!1);else{if(Te.creatable&&typeof x=="function"){const Ve=x(Te.value);typeof Ve<"u"&&Ve!==null&&En(typeof Ve=="string"?Ve:Ve.value)}else En(Te.value);sa||$r(Te.label),gt(-1),Me(!1),Gt.current.focus()}},Zt=hxe({data:It,searchable:S,limit:M,searchValue:Mi,filter:I,filterDataOnExactSearchMatch:ce,value:Bn});Ze&&se(Mi,Zt)&&(bn=te(Mi),Zt.push({label:Mi,value:Mi,creatable:!0}));const ri=(Te,Ve,ft)=>{let Je=Te;for(;ft(Je);)if(Je=Ve(Je),!Zt[Je].disabled)return Je;return Te};fo(()=>{gt(-1)},[Mi]);const br=Bn?Zt.findIndex(Te=>Te.value===Bn):0,Lr=!$e&&(Zt.length>0?Be:Be&&!!P),yi=()=>{gt(Te=>{var Ve;const ft=ri(Te,Je=>Je-1,Je=>Je>0);return rt.current=an.current[(Ve=Zt[ft])==null?void 0:Ve.value],Lr&&Le({alignment:we?"start":"end"}),ft})},ms=()=>{gt(Te=>{var Ve;const ft=ri(Te,Je=>Je+1,Je=>Jewindow.setTimeout(()=>{var Te;rt.current=an.current[(Te=Zt[br])==null?void 0:Te.value],Le({alignment:we?"end":"start"})},0);fo(()=>{Lr&&Q()},[Lr]);const j=Te=>{switch(typeof f=="function"&&f(Te),Te.key){case"ArrowUp":{Te.preventDefault(),Be?we?yi():ms():(gt(br),Me(!0),Q());break}case"ArrowDown":{Te.preventDefault(),Be?we?ms():yi():(gt(br),Me(!0),Q());break}case"Home":{if(!S){Te.preventDefault(),Be||Me(!0);const Ve=Zt.findIndex(ft=>!ft.disabled);gt(Ve),Lr&&Le({alignment:we?"end":"start"})}break}case"End":{if(!S){Te.preventDefault(),Be||Me(!0);const Ve=Zt.map(ft=>!!ft.disabled).lastIndexOf(!1);gt(Ve),Lr&&Le({alignment:we?"end":"start"})}break}case"Escape":{Te.preventDefault(),Me(!1),gt(-1);break}case" ":{S||(Te.preventDefault(),Zt[je]&&Be?jn(Zt[je]):(Me(!0),gt(br),Q()));break}case"Enter":S||Te.preventDefault(),Zt[je]&&Be&&(Te.preventDefault(),jn(Zt[je]))}},Z=Te=>{typeof d=="function"&&d(Te);const Ve=It.find(ft=>ft.value===Bn);K&&Zt[je]&&Be&&jn(Zt[je]),$r((Ve==null?void 0:Ve.label)||""),Me(!1)},de=Te=>{typeof h=="function"&&h(Te),S&&Me(!0)},fe=Te=>{$e||($r(Te.currentTarget.value),A&&Te.currentTarget.value===""&&En(null),gt(-1),Me(!0))},He=()=>{$e||(Me(!Be),Bn&&!Be&>(br))};return k.createElement(Bs.Wrapper,YC(Pg({},i),{__staticSelector:"Select"}),k.createElement(Bc,{opened:Lr,transition:p,transitionDuration:m,shadow:"sm",withinPortal:O,__staticSelector:"Select",onDirectionChange:ue,switchDirectionOnFlip:q,zIndex:le,dropdownPosition:pe,positionDependencies:qe,classNames:b,styles:T,unstyled:_},k.createElement(Bc.Target,null,k.createElement("div",{role:"combobox","aria-haspopup":"listbox","aria-owns":Lr?`${r.id}-items`:null,"aria-controls":r.id,"aria-expanded":Lr,onMouseLeave:()=>gt(-1),tabIndex:-1},k.createElement("input",{type:"hidden",name:ae,value:Bn||"",form:Ke,disabled:H}),k.createElement(Bs,Pg(YC(Pg(Pg({autoComplete:"off",type:"search"},r),ot),{ref:Ko(t,Gt),onKeyDown:j,__staticSelector:"Select",value:Mi,placeholder:Se,onChange:fe,"aria-autocomplete":"list","aria-controls":Lr?`${r.id}-items`:null,"aria-activedescendant":je>=0?`${r.id}-${je}`:null,onMouseDown:He,onBlur:Z,onFocus:de,readOnly:!S||$e,disabled:H,"data-mantine-stop-propagation":Lr,name:null,classNames:YC(Pg({},b),{input:On({[lt.input]:!S},b==null?void 0:b.input)})}),sQ({theme:Ue,rightSection:ye,rightSectionWidth:he,styles:T,size:r.size,shouldClear:A&&!!fr,clearButtonLabel:V,onClear:dr,error:i.error,clearButtonTabIndex:st,disabled:H,readOnly:$e}))))),k.createElement(Bc.Dropdown,{component:C||GS,maxHeight:E,direction:Gn,id:r.id,innerRef:De,__staticSelector:"Select",classNames:b,styles:T},k.createElement(hk,{data:Zt,hovered:je,classNames:b,styles:T,isItemSelected:Te=>Te===Bn,uuid:r.id,__staticSelector:"Select",onItemHover:gt,onItemSelect:jn,itemsRefs:an,itemComponent:c,size:r.size,nothingFound:P,creatable:Ze&&!!bn,createLabel:bn,"aria-label":i.label,unstyled:_}))))});jQ.displayName="@mantine/core/Select";function Pw({value:e,min:t,max:n}){const r=(e-t)/(n-t)*100;return Math.min(Math.max(r,0),100)}function zP({value:e,containerWidth:t,min:n,max:r,step:i,precision:s}){const a=(t?Math.min(Math.max(e,0),t)/t:e)*(r-n),u=(a!==0?Math.round(a/i)*i:0)+n,l=Math.max(u,n);return s!==void 0?Number(l.toFixed(s)):l}var Txe=Object.defineProperty,Sxe=Object.defineProperties,Ixe=Object.getOwnPropertyDescriptors,j8=Object.getOwnPropertySymbols,xxe=Object.prototype.hasOwnProperty,Cxe=Object.prototype.propertyIsEnumerable,U8=(e,t,n)=>t in e?Txe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Axe=(e,t)=>{for(var n in t||(t={}))xxe.call(t,n)&&U8(e,n,t[n]);if(j8)for(var n of j8(t))Cxe.call(t,n)&&U8(e,n,t[n]);return e},Oxe=(e,t)=>Sxe(e,Ixe(t));const Ps={xs:4,sm:6,md:8,lg:10,xl:12};var Pxe=at((e,{size:t,disabled:n})=>({root:Oxe(Axe({},e.fn.fontStyles()),{WebkitTapHighlightColor:"transparent",outline:0,height:e.fn.size({sizes:Ps,size:t})*2,display:"flex",alignItems:"center",cursor:n?"not-allowed":"pointer",touchAction:"none"})}));const Rxe=Pxe;var Nxe=Object.defineProperty,kxe=Object.defineProperties,Dxe=Object.getOwnPropertyDescriptors,V8=Object.getOwnPropertySymbols,$xe=Object.prototype.hasOwnProperty,Lxe=Object.prototype.propertyIsEnumerable,z8=(e,t,n)=>t in e?Nxe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Mxe=(e,t)=>{for(var n in t||(t={}))$xe.call(t,n)&&z8(e,n,t[n]);if(V8)for(var n of V8(t))Lxe.call(t,n)&&z8(e,n,t[n]);return e},Fxe=(e,t)=>kxe(e,Dxe(t)),Bxe=at((e,{color:t,size:n,disabled:r,thumbSize:i})=>({label:{position:"absolute",top:-36,backgroundColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[9],fontSize:e.fontSizes.xs,color:e.white,padding:`calc(${e.spacing.xs}px / 2)`,borderRadius:e.radius.sm,whiteSpace:"nowrap",pointerEvents:"none",userSelect:"none",touchAction:"none"},thumb:Fxe(Mxe({},e.fn.focusStyles()),{boxSizing:"border-box",position:"absolute",display:r?"none":"flex",height:i||e.fn.size({sizes:Ps,size:n})*2,width:i||e.fn.size({sizes:Ps,size:n})*2,backgroundColor:e.colorScheme==="dark"?e.fn.themeColor(t,e.fn.primaryShade()):e.white,border:`4px solid ${e.colorScheme==="dark"?e.white:e.fn.themeColor(t,e.fn.primaryShade())}`,color:e.colorScheme==="dark"?e.white:e.fn.themeColor(t,e.fn.primaryShade()),transform:"translate(-50%, -50%)",top:"50%",cursor:"pointer",borderRadius:1e3,alignItems:"center",justifyContent:"center",transitionDuration:"100ms",transitionProperty:"box-shadow, transform",transitionTimingFunction:e.transitionTimingFunction,zIndex:3,userSelect:"none",touchAction:"none"}),dragging:{transform:"translate(-50%, -50%) scale(1.05)",boxShadow:e.shadows.sm}}));const jxe=Bxe,Rw=w.forwardRef(({max:e,min:t,value:n,position:r,label:i,dragging:s,onMouseDown:o,color:a,classNames:u,styles:l,size:c,labelTransition:f,labelTransitionDuration:d,labelTransitionTimingFunction:h,labelAlwaysOn:p,thumbLabel:m,onFocus:y,onBlur:g,showLabelOnHover:_,children:b=null,disabled:T,unstyled:I,thumbSize:E},S)=>{const{classes:A,cx:P,theme:V}=jxe({color:a,size:c,disabled:T,thumbSize:E},{classNames:u,styles:l,unstyled:I,name:"Slider"}),[M,H]=w.useState(!1),J=p||s||M||_;return k.createElement(ut,{tabIndex:0,role:"slider","aria-label":m,"aria-valuemax":e,"aria-valuemin":t,"aria-valuenow":n,ref:S,className:P(A.thumb,{[A.dragging]:s}),onFocus:()=>{H(!0),typeof y=="function"&&y()},onBlur:()=>{H(!1),typeof g=="function"&&g()},onTouchStart:o,onMouseDown:o,onClick:Y=>Y.stopPropagation(),style:{[V.dir==="rtl"?"right":"left"]:`${r}%`}},b,k.createElement(XS,{mounted:i!=null&&J,duration:d,transition:f,timingFunction:h||V.transitionTimingFunction},Y=>k.createElement("div",{style:Y,className:A.label},i)))});Rw.displayName="@mantine/core/SliderThumb";function Uxe({mark:e,offset:t,value:n,inverted:r=!1}){return r?typeof t=="number"&&e.value<=t||e.value>=n:typeof t=="number"?e.value>=t&&e.value<=n:e.value<=n}var Vxe=at((e,{size:t,color:n,disabled:r})=>({markWrapper:{position:"absolute",top:0,zIndex:2},mark:{boxSizing:"border-box",border:`${e.fn.size({size:t,sizes:Ps})>=8?"2px":"1px"} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2]}`,height:e.fn.size({sizes:Ps,size:t}),width:e.fn.size({sizes:Ps,size:t}),borderRadius:1e3,transform:`translateX(-${e.fn.size({sizes:Ps,size:t})/2}px)`,backgroundColor:e.white},markFilled:{borderColor:r?e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[4]:e.fn.variant({variant:"filled",color:n}).background},markLabel:{transform:"translate(-50%, 0)",fontSize:e.fontSizes.sm,color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6],marginTop:`calc(${e.spacing.xs}px / 2)`,whiteSpace:"nowrap"}}));const zxe=Vxe;function UQ({marks:e,color:t,size:n,min:r,max:i,value:s,classNames:o,styles:a,offset:u,onChange:l,disabled:c,unstyled:f,inverted:d}){const{classes:h,cx:p}=zxe({size:n,color:t,disabled:c},{classNames:o,styles:a,unstyled:f,name:"Slider"}),m=e.map((y,g)=>k.createElement(ut,{className:h.markWrapper,sx:{left:`${Pw({value:y.value,min:r,max:i})}%`},key:g},k.createElement("div",{className:p(h.mark,{[h.markFilled]:Uxe({mark:y,value:s,offset:u,inverted:d})})}),y.label&&k.createElement("div",{className:h.markLabel,onMouseDown:_=>{_.stopPropagation(),l(y.value)},onTouchStart:_=>{_.stopPropagation(),l(y.value)}},y.label)));return k.createElement("div",null,m)}UQ.displayName="@mantine/core/SliderMarks";var Hxe=at((e,{radius:t,size:n,color:r,disabled:i,inverted:s})=>({track:{position:"relative",height:e.fn.size({sizes:Ps,size:n}),width:"100%",marginRight:e.fn.size({size:n,sizes:Ps}),marginLeft:e.fn.size({size:n,sizes:Ps}),"&::before":{content:'""',position:"absolute",top:0,bottom:0,borderRadius:e.fn.size({size:t,sizes:e.radius}),right:-e.fn.size({size:n,sizes:Ps}),left:-e.fn.size({size:n,sizes:Ps}),backgroundColor:s?i?e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[4]:e.fn.variant({variant:"filled",color:r}).background:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2],zIndex:0}},bar:{position:"absolute",zIndex:1,top:0,bottom:0,backgroundColor:s?e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2]:i?e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[4]:e.fn.variant({variant:"filled",color:r}).background,borderRadius:e.fn.size({size:t,sizes:e.radius})}}));const Wxe=Hxe;var qxe=Object.defineProperty,Yxe=Object.defineProperties,Gxe=Object.getOwnPropertyDescriptors,Nw=Object.getOwnPropertySymbols,VQ=Object.prototype.hasOwnProperty,zQ=Object.prototype.propertyIsEnumerable,H8=(e,t,n)=>t in e?qxe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Kxe=(e,t)=>{for(var n in t||(t={}))VQ.call(t,n)&&H8(e,n,t[n]);if(Nw)for(var n of Nw(t))zQ.call(t,n)&&H8(e,n,t[n]);return e},Qxe=(e,t)=>Yxe(e,Gxe(t)),Xxe=(e,t)=>{var n={};for(var r in e)VQ.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Nw)for(var r of Nw(e))t.indexOf(r)<0&&zQ.call(e,r)&&(n[r]=e[r]);return n};function kk(e){var t=e,{filled:n,size:r,color:i,classNames:s,styles:o,radius:a,children:u,offset:l,onMouseLeave:c,onMouseEnter:f,disabled:d,marksOffset:h,unstyled:p,inverted:m}=t,y=Xxe(t,["filled","size","color","classNames","styles","radius","children","offset","onMouseLeave","onMouseEnter","disabled","marksOffset","unstyled","inverted"]);const{classes:g}=Wxe({color:i,size:r,radius:a,disabled:d,inverted:m},{classNames:s,styles:o,unstyled:p,name:"Slider"});return k.createElement("div",{className:g.track,onMouseLeave:c,onMouseEnter:f},k.createElement(ut,{className:g.bar,sx:_=>({left:`calc(${l}% - ${_.fn.size({size:r,sizes:Ps})}px)`,width:`calc(${n}% + ${_.fn.size({size:r,sizes:Ps})}px)`})}),u,k.createElement(UQ,Qxe(Kxe({},y),{size:r,color:i,offset:h,classNames:s,styles:o,disabled:d,unstyled:p,inverted:m})))}kk.displayName="@mantine/core/SliderTrack";var Jxe=Object.defineProperty,Zxe=Object.defineProperties,eCe=Object.getOwnPropertyDescriptors,kw=Object.getOwnPropertySymbols,HQ=Object.prototype.hasOwnProperty,WQ=Object.prototype.propertyIsEnumerable,W8=(e,t,n)=>t in e?Jxe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,tCe=(e,t)=>{for(var n in t||(t={}))HQ.call(t,n)&&W8(e,n,t[n]);if(kw)for(var n of kw(t))WQ.call(t,n)&&W8(e,n,t[n]);return e},nCe=(e,t)=>Zxe(e,eCe(t)),rCe=(e,t)=>{var n={};for(var r in e)HQ.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&kw)for(var r of kw(e))t.indexOf(r)<0&&WQ.call(e,r)&&(n[r]=e[r]);return n};const Dk=w.forwardRef((e,t)=>{var n=e,{className:r,size:i,classNames:s,styles:o,disabled:a,unstyled:u}=n,l=rCe(n,["className","size","classNames","styles","disabled","unstyled"]);const{classes:c,cx:f}=Rxe({size:i,disabled:a},{classNames:s,styles:o,unstyled:u,name:"Slider"});return k.createElement(ut,nCe(tCe({},l),{tabIndex:-1,className:f(c.root,r),ref:t}))});Dk.displayName="@mantine/core/SliderRoot";var iCe=Object.defineProperty,sCe=Object.defineProperties,oCe=Object.getOwnPropertyDescriptors,Dw=Object.getOwnPropertySymbols,qQ=Object.prototype.hasOwnProperty,YQ=Object.prototype.propertyIsEnumerable,q8=(e,t,n)=>t in e?iCe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,aCe=(e,t)=>{for(var n in t||(t={}))qQ.call(t,n)&&q8(e,n,t[n]);if(Dw)for(var n of Dw(t))YQ.call(t,n)&&q8(e,n,t[n]);return e},uCe=(e,t)=>sCe(e,oCe(t)),lCe=(e,t)=>{var n={};for(var r in e)qQ.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Dw)for(var r of Dw(e))t.indexOf(r)<0&&YQ.call(e,r)&&(n[r]=e[r]);return n};const cCe={size:"md",radius:"xl",min:0,max:100,step:1,marks:[],label:e=>e,labelTransition:"skew-down",labelTransitionDuration:0,labelAlwaysOn:!1,thumbLabel:"",showLabelOnHover:!0,disabled:!1,scale:e=>e},GQ=w.forwardRef((e,t)=>{const n=ct("Slider",cCe,e),{classNames:r,styles:i,color:s,value:o,onChange:a,onChangeEnd:u,size:l,radius:c,min:f,max:d,step:h,precision:p,defaultValue:m,name:y,marks:g,label:_,labelTransition:b,labelTransitionDuration:T,labelTransitionTimingFunction:I,labelAlwaysOn:E,thumbLabel:S,showLabelOnHover:A,thumbChildren:P,disabled:V,unstyled:M,thumbSize:H,scale:J,inverted:Y}=n,ye=lCe(n,["classNames","styles","color","value","onChange","onChangeEnd","size","radius","min","max","step","precision","defaultValue","name","marks","label","labelTransition","labelTransitionDuration","labelTransitionTimingFunction","labelAlwaysOn","thumbLabel","showLabelOnHover","thumbChildren","disabled","unstyled","thumbSize","scale","inverted"]),he=ts(),[ve,te]=w.useState(!1),[se,K]=Oa({value:typeof o=="number"?Mc(o,f,d):o,defaultValue:typeof m=="number"?Mc(m,f,d):m,finalValue:Mc(0,f,d),onChange:a}),x=w.useRef(se),C=w.useRef(),z=Pw({value:se,min:f,max:d}),R=J(se),O=typeof _=="function"?_(R):_,q=w.useCallback(({x:Se})=>{if(!V){const ce=zP({value:Se,min:f,max:d,step:h,precision:p});K(ce),x.current=ce}},[V,f,d,h,p]),{ref:le,active:ae}=GW(q,{onScrubEnd:()=>u==null?void 0:u(x.current)},he.dir),pe=Se=>{Se.stopPropagation()},me=Se=>{if(!V)switch(Se.key){case"ArrowUp":{Se.preventDefault(),C.current.focus();const ce=Math.min(Math.max(se+h,f),d);u==null||u(ce),K(ce);break}case"ArrowRight":{Se.preventDefault(),C.current.focus();const ce=Math.min(Math.max(he.dir==="rtl"?se-h:se+h,f),d);u==null||u(ce),K(ce);break}case"ArrowDown":{Se.preventDefault(),C.current.focus();const ce=Math.min(Math.max(se-h,f),d);u==null||u(ce),K(ce);break}case"ArrowLeft":{Se.preventDefault(),C.current.focus();const ce=Math.min(Math.max(he.dir==="rtl"?se+h:se-h,f),d);u==null||u(ce),K(ce);break}case"Home":{Se.preventDefault(),C.current.focus(),u==null||u(f),K(f);break}case"End":{Se.preventDefault(),C.current.focus(),u==null||u(d),K(d);break}}};return k.createElement(Dk,uCe(aCe({},ye),{size:l,ref:Ko(le,t),onKeyDownCapture:me,onMouseDownCapture:()=>{var Se;return(Se=le.current)==null?void 0:Se.focus()},classNames:r,styles:i,disabled:V,unstyled:M}),k.createElement(kk,{inverted:Y,offset:0,filled:z,marks:g,size:l,radius:c,color:s,min:f,max:d,value:R,onChange:K,onMouseEnter:A?()=>te(!0):void 0,onMouseLeave:A?()=>te(!1):void 0,classNames:r,styles:i,disabled:V,unstyled:M},k.createElement(Rw,{max:d,min:f,value:R,position:z,dragging:ae,color:s,size:l,label:O,ref:C,onMouseDown:pe,labelTransition:b,labelTransitionDuration:T,labelTransitionTimingFunction:I,labelAlwaysOn:E,classNames:r,styles:i,thumbLabel:S,showLabelOnHover:A&&ve,disabled:V,unstyled:M,thumbSize:H},P)),k.createElement("input",{type:"hidden",name:y,value:R}))});GQ.displayName="@mantine/core/Slider";function fCe(e){return"TouchEvent"in window&&e instanceof window.TouchEvent?e.touches[0].clientX:e.clientX}var dCe=Object.defineProperty,hCe=Object.defineProperties,pCe=Object.getOwnPropertyDescriptors,$w=Object.getOwnPropertySymbols,KQ=Object.prototype.hasOwnProperty,QQ=Object.prototype.propertyIsEnumerable,Y8=(e,t,n)=>t in e?dCe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,GC=(e,t)=>{for(var n in t||(t={}))KQ.call(t,n)&&Y8(e,n,t[n]);if($w)for(var n of $w(t))QQ.call(t,n)&&Y8(e,n,t[n]);return e},KC=(e,t)=>hCe(e,pCe(t)),mCe=(e,t)=>{var n={};for(var r in e)KQ.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&$w)for(var r of $w(e))t.indexOf(r)<0&&QQ.call(e,r)&&(n[r]=e[r]);return n};const gCe={size:"md",radius:"xl",min:0,max:100,minRange:10,step:1,marks:[],label:e=>e,labelTransition:"skew-down",labelTransitionDuration:0,labelAlwaysOn:!1,thumbFromLabel:"",thumbToLabel:"",showLabelOnHover:!0,disabled:!1,scale:e=>e},XQ=w.forwardRef((e,t)=>{const n=ct("RangeSlider",gCe,e),{classNames:r,styles:i,color:s,value:o,onChange:a,onChangeEnd:u,size:l,radius:c,min:f,max:d,minRange:h,step:p,precision:m,defaultValue:y,name:g,marks:_,label:b,labelTransition:T,labelTransitionDuration:I,labelTransitionTimingFunction:E,labelAlwaysOn:S,thumbFromLabel:A,thumbToLabel:P,showLabelOnHover:V,thumbChildren:M,disabled:H,unstyled:J,thumbSize:Y,scale:ye,inverted:he}=n,ve=mCe(n,["classNames","styles","color","value","onChange","onChangeEnd","size","radius","min","max","minRange","step","precision","defaultValue","name","marks","label","labelTransition","labelTransitionDuration","labelTransitionTimingFunction","labelAlwaysOn","thumbFromLabel","thumbToLabel","showLabelOnHover","thumbChildren","disabled","unstyled","thumbSize","scale","inverted"]),te=ts(),[se,K]=w.useState(-1),[x,C]=w.useState(!1),[z,R]=Oa({value:o,defaultValue:y,finalValue:[f,d],onChange:a}),O=w.useRef(z),q=w.useRef([]),le=w.useRef(void 0),ae=[Pw({value:z[0],min:f,max:d}),Pw({value:z[1],min:f,max:d})],pe=Ue=>{R(Ue),O.current=Ue};w.useEffect(()=>{Array.isArray(o)&&(O.current=o)},Array.isArray(o)?[o[0],o[1]]:[null,null]);const me=(Ue,Be,bt)=>{const je=[...O.current];je[Be]=Ue,Be===0&&(Ue>je[1]-(h-1e-9)&&(je[1]=Math.min(Ue+h,d)),Ue>(d-(h-1e-9)||f)&&(je[Be]=O.current[Be])),Be===1&&(Ue{if(!H){const Be=zP({value:Ue,min:f,max:d,step:p,precision:m});me(Be,le.current,!1)}},{ref:ce,active:st}=GW(({x:Ue})=>Se(Ue),{onScrubEnd:()=>u==null?void 0:u(O.current)},te.dir);function Ke(Ue,Be){Ue.stopPropagation(),le.current=Be}const qe=Ue=>{ce.current.focus();const Be=ce.current.getBoundingClientRect(),bt=fCe(Ue.nativeEvent),je=zP({value:bt-Be.left,max:d,min:f,step:p,containerWidth:Be.width}),gt=Math.abs(z[0]-je)>Math.abs(z[1]-je)?1:0,Gt=te.dir==="ltr"?gt:gt===1?0:1;le.current=Gt},$e=()=>se!==1&&se!==0?(K(0),0):se,ot=Ue=>{if(!H)switch(Ue.key){case"ArrowUp":{Ue.preventDefault();const Be=$e();q.current[Be].focus(),me(Math.min(Math.max(O.current[Be]+p,f),d),Be,!0);break}case"ArrowRight":{Ue.preventDefault();const Be=$e();q.current[Be].focus(),me(Math.min(Math.max(te.dir==="rtl"?O.current[Be]-p:O.current[Be]+p,f),d),Be,!0);break}case"ArrowDown":{Ue.preventDefault();const Be=$e();q.current[Be].focus(),me(Math.min(Math.max(O.current[Be]-p,f),d),Be,!0);break}case"ArrowLeft":{Ue.preventDefault();const Be=$e();q.current[Be].focus(),me(Math.min(Math.max(te.dir==="rtl"?O.current[Be]+p:O.current[Be]-p,f),d),Be,!0);break}}},lt={max:d,min:f,color:s,size:l,labelTransition:T,labelTransitionDuration:I,labelTransitionTimingFunction:E,labelAlwaysOn:S,onBlur:()=>K(-1),classNames:r,styles:i},On=Array.isArray(M);return k.createElement(Dk,KC(GC({},ve),{size:l,ref:Ko(ce,t),onTouchStartCapture:qe,onTouchEndCapture:()=>{le.current=-1},onMouseDownCapture:qe,onMouseUpCapture:()=>{le.current=-1},onKeyDownCapture:ot,styles:i,classNames:r,disabled:H,unstyled:J}),k.createElement(kk,{offset:ae[0],marksOffset:z[0],filled:ae[1]-ae[0],marks:_,inverted:he,size:l,radius:c,color:s,min:f,max:d,value:z[1],styles:i,classNames:r,onMouseEnter:V?()=>C(!0):void 0,onMouseLeave:V?()=>C(!1):void 0,onChange:Ue=>{const Be=Math.abs(z[0]-Ue)>Math.abs(z[1]-Ue)?1:0,bt=[...z];bt[Be]=Ue,pe(bt)},disabled:H,unstyled:J},k.createElement(Rw,KC(GC({},lt),{value:ye(z[0]),position:ae[0],dragging:st,label:typeof b=="function"?b(ye(z[0])):b,ref:Ue=>{q.current[0]=Ue},thumbLabel:A,onMouseDown:Ue=>Ke(Ue,0),onFocus:()=>K(0),showLabelOnHover:V&&x,disabled:H,unstyled:J,thumbSize:Y}),On?M[0]:M),k.createElement(Rw,KC(GC({},lt),{thumbLabel:P,value:ye(z[1]),position:ae[1],dragging:st,label:typeof b=="function"?b(ye(z[1])):b,ref:Ue=>{q.current[1]=Ue},onMouseDown:Ue=>Ke(Ue,1),onFocus:()=>K(1),showLabelOnHover:V&&x,disabled:H,unstyled:J,thumbSize:Y}),On?M[1]:M)),k.createElement("input",{type:"hidden",name:`${g}_from`,value:z[0]}),k.createElement("input",{type:"hidden",name:`${g}_to`,value:z[1]}))});XQ.displayName="@mantine/core/RangeSlider";var yCe=Object.defineProperty,Lw=Object.getOwnPropertySymbols,JQ=Object.prototype.hasOwnProperty,ZQ=Object.prototype.propertyIsEnumerable,G8=(e,t,n)=>t in e?yCe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_Ce=(e,t)=>{for(var n in t||(t={}))JQ.call(t,n)&&G8(e,n,t[n]);if(Lw)for(var n of Lw(t))ZQ.call(t,n)&&G8(e,n,t[n]);return e},vCe=(e,t)=>{var n={};for(var r in e)JQ.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Lw)for(var r of Lw(e))t.indexOf(r)<0&&ZQ.call(e,r)&&(n[r]=e[r]);return n};const bCe={w:0,h:0},Jp=w.forwardRef((e,t)=>{const n=ct("Space",bCe,e),{w:r,h:i,sx:s}=n,o=vCe(n,["w","h","sx"]);return k.createElement(ut,_Ce({ref:t,sx:[a=>{const u=a.fn.size({size:r,sizes:a.spacing}),l=a.fn.size({size:i,sizes:a.spacing});return{width:u,height:l,minWidth:u,minHeight:l}},...Rd(s)]},o))});Jp.displayName="@mantine/core/Space";var ECe=Object.defineProperty,wCe=Object.defineProperties,TCe=Object.getOwnPropertyDescriptors,K8=Object.getOwnPropertySymbols,SCe=Object.prototype.hasOwnProperty,ICe=Object.prototype.propertyIsEnumerable,Q8=(e,t,n)=>t in e?ECe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,xCe=(e,t)=>{for(var n in t||(t={}))SCe.call(t,n)&&Q8(e,n,t[n]);if(K8)for(var n of K8(t))ICe.call(t,n)&&Q8(e,n,t[n]);return e},CCe=(e,t)=>wCe(e,TCe(t));function ACe(e,t,n){return typeof e<"u"?e in n.headings.sizes?n.headings.sizes[e].fontSize:e:n.headings.sizes[t].fontSize}function OCe(e,t,n){return typeof e<"u"&&e in n.headings.sizes?n.headings.sizes[e].lineHeight:n.headings.sizes[t].lineHeight}var PCe=at((e,{element:t,weight:n,size:r,inline:i})=>({root:CCe(xCe({},e.fn.fontStyles()),{fontFamily:e.headings.fontFamily,fontWeight:n||e.headings.sizes[t].fontWeight||e.headings.fontWeight,fontSize:ACe(r,t,e),lineHeight:i?1:OCe(r,t,e),margin:0})}));const RCe=PCe;var NCe=Object.defineProperty,Mw=Object.getOwnPropertySymbols,eX=Object.prototype.hasOwnProperty,tX=Object.prototype.propertyIsEnumerable,X8=(e,t,n)=>t in e?NCe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,kCe=(e,t)=>{for(var n in t||(t={}))eX.call(t,n)&&X8(e,n,t[n]);if(Mw)for(var n of Mw(t))tX.call(t,n)&&X8(e,n,t[n]);return e},DCe=(e,t)=>{var n={};for(var r in e)eX.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Mw)for(var r of Mw(e))t.indexOf(r)<0&&tX.call(e,r)&&(n[r]=e[r]);return n};const $Ce={order:1},cc=w.forwardRef((e,t)=>{const n=ct("Title",$Ce,e),{className:r,order:i,children:s,unstyled:o,size:a,weight:u,inline:l}=n,c=DCe(n,["className","order","children","unstyled","size","weight","inline"]),{classes:f,cx:d}=RCe({element:`h${i}`,weight:u,size:a,inline:l},{name:"Title",unstyled:o});return[1,2,3,4,5,6].includes(i)?k.createElement(Tt,kCe({component:`h${i}`,ref:t,className:d(f.root,r)},c),s):null});cc.displayName="@mantine/core/Title";var LCe=Object.defineProperty,MCe=Object.defineProperties,FCe=Object.getOwnPropertyDescriptors,J8=Object.getOwnPropertySymbols,BCe=Object.prototype.hasOwnProperty,jCe=Object.prototype.propertyIsEnumerable,Z8=(e,t,n)=>t in e?LCe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Zv=(e,t)=>{for(var n in t||(t={}))BCe.call(t,n)&&Z8(e,n,t[n]);if(J8)for(var n of J8(t))jCe.call(t,n)&&Z8(e,n,t[n]);return e},e1=(e,t)=>MCe(e,FCe(t)),UCe=at(e=>{const t=dde(e.headings.sizes).reduce((n,r)=>{const i=e.headings.sizes[r];return n[`& ${r}`]=e1(Zv({fontFamily:e.headings.fontFamily,fontWeight:i.fontWeight||e.headings.fontWeight,marginTop:typeof i.lineHeight=="number"?`calc(${e.spacing.xl}px * ${i.lineHeight})`:e.spacing.xl,marginBottom:e.spacing.sm},i),{"@media (max-width: 755px)":{fontSize:typeof i.fontSize=="number"&&i.fontSize/1.3}}),n},{});return{root:e1(Zv(e1(Zv({},e.fn.fontStyles()),{color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,lineHeight:e.lineHeight,fontSize:e.fontSizes.md,"@media (max-width: 755px)":{fontSize:e.fontSizes.sm}}),t),{"& .ql-align-center":{textAlign:"center"},"& .ql-align-right":{textAlign:"right"},"& .ql-align-left":{textAlign:"left"},"& img":{maxWidth:"100%",marginBottom:e.spacing.xs},"& p":{marginTop:0,marginBottom:e.spacing.lg},"& mark":{backgroundColor:e.fn.themeColor("yellow",e.colorScheme==="dark"?5:2),color:e.colorScheme==="dark"?e.colors.dark[9]:"inherit"},"& hr":{marginTop:e.spacing.md,marginBottom:e.spacing.sm,borderBottom:0,borderLeft:0,borderRight:0,borderTop:`1px dashed ${e.colors.gray[e.colorScheme==="dark"?4:6]}`},"& a":e1(Zv({},e.fn.focusStyles()),{color:e.colors[e.primaryColor][e.colorScheme==="dark"?4:6],textDecoration:"none","&:hover":{textDecoration:"underline"}}),"& pre":{padding:e.spacing.xs,lineHeight:e.lineHeight,margin:0,marginTop:e.spacing.md,marginBottom:e.spacing.md,overflowX:"auto",fontFamily:e.fontFamilyMonospace,fontSize:e.fontSizes.sm,borderRadius:e.radius.sm,backgroundColor:e.colorScheme==="dark"?e.colors.dark[8]:e.colors.gray[0],"& code":{backgroundColor:"transparent",padding:0,borderRadius:0,color:"inherit",border:0}},"& code":{lineHeight:e.lineHeight,padding:`1px calc(${e.spacing.xs}px / 1)`,borderRadius:e.radius.sm,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,backgroundColor:e.colorScheme==="dark"?e.colors.dark[9]:e.colors.gray[0],fontFamily:e.fontFamilyMonospace,fontSize:e.fontSizes.xs,border:`1px solid ${e.colorScheme==="dark"?e.colors.dark[9]:e.colors.gray[3]}`},"& ul, & ol":{marginBottom:e.spacing.md,paddingLeft:`calc(${e.spacing.lg}px * 2)`,"& li":{marginTop:e.spacing.xs}},"& table":{width:"100%",borderCollapse:"collapse",captionSide:"bottom",marginBottom:e.spacing.md,"& caption":{marginTop:e.spacing.xs,fontSize:e.fontSizes.sm,color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6]},"& th":{textAlign:"left",fontWeight:"bold",color:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[7],fontSize:14,padding:"7px 10px"},"& thead th":{borderBottom:`1px solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3]}`},"& tfoot th":{borderTop:`1px solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3]}`},"& td":{padding:"7px 10px",borderBottom:`1px solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3]}`,fontSize:14},"& tr:last-of-type td":{borderBottom:"none"}},"& blockquote":{fontSize:e.fontSizes.lg,lineHeight:e.lineHeight,margin:`${e.spacing.md}px 0`,borderTopRightRadius:e.radius.sm,borderBottomRightRadius:e.radius.sm,padding:`${e.spacing.md}px ${e.spacing.lg}px`,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,"& cite":{display:"block",fontSize:e.fontSizes.sm,marginTop:e.spacing.xs,color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6],overflow:"hidden",textOverflow:"ellipsis"}}})}});const VCe=UCe;var zCe=Object.defineProperty,Fw=Object.getOwnPropertySymbols,nX=Object.prototype.hasOwnProperty,rX=Object.prototype.propertyIsEnumerable,e9=(e,t,n)=>t in e?zCe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,HCe=(e,t)=>{for(var n in t||(t={}))nX.call(t,n)&&e9(e,n,t[n]);if(Fw)for(var n of Fw(t))rX.call(t,n)&&e9(e,n,t[n]);return e},WCe=(e,t)=>{var n={};for(var r in e)nX.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Fw)for(var r of Fw(e))t.indexOf(r)<0&&rX.call(e,r)&&(n[r]=e[r]);return n};const HP=w.forwardRef((e,t)=>{const n=ct("TypographyStylesProvider",{},e),{className:r,unstyled:i}=n,s=WCe(n,["className","unstyled"]),{classes:o,cx:a}=VCe(null,{name:"TypographyStylesProvider",unstyled:i});return k.createElement(ut,HCe({className:a(o.root,r),ref:t},s))});HP.displayName="@mantine/core/TypographyStylesProvider";function WP(e){const t=e.split("/")||[];return t[t.length-1].replace(/\.[^\.]+$/,"").replace(".","_").replace(" ","_").replace("/","_")}const Bu="/viz-guardrails-study/",qCe="https://github.com/revisit-studies/study/tree/main/public/";function YCe({globalConfig:e,studyConfigs:t}){const{configsList:n}=e,r=Qd();return $.jsxs(YG,{size:"xs",px:"xs",style:{marginTop:100,marginBottom:100},children:[$.jsx(A_,{maw:150,mx:"auto",mb:"xl",radius:"md",src:`${Bu}assets/revisitLogoSquare.svg`,alt:"reVISit"}),$.jsx(Tt,{children:"Select an experiment to launch:"}),n.map(i=>{const s=t[i];if(!s)return null;const o=WP(i);return $.jsx(ck,{onClick:()=>{r(`/${o}`)},my:"sm",style:{width:"100%"},children:$.jsxs(obe,{shadow:"sm",radius:"md",withBorder:!0,children:[$.jsx(Tt,{fw:"bold",children:s.studyMetadata.title}),$.jsxs(Tt,{c:"dimmed",children:["Authors:",s.studyMetadata.authors]}),$.jsx(Tt,{c:"dimmed",children:s.studyMetadata.description}),$.jsx(Tt,{c:"dimmed",ta:"right",style:{paddingRight:5},children:$.jsxs(Rq,{target:"_blank",onClick:a=>a.stopPropagation(),href:`${qCe}${o}`,children:["View source:"," ",o]})})]})},i)})]})}var iX={exports:{}},sX={};/** * @license React * use-sync-external-store-shim.production.min.js * @@ -85,7 +85,7 @@ Error generating stack: `+s.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Zp=w;function GCe(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var KCe=typeof Object.is=="function"?Object.is:GCe,QCe=Zp.useState,XCe=Zp.useEffect,JCe=Zp.useLayoutEffect,ZCe=Zp.useDebugValue;function eAe(e,t){var n=t(),r=QCe({inst:{value:n,getSnapshot:t}}),i=r[0].inst,s=r[1];return JCe(function(){i.value=n,i.getSnapshot=t,QC(i)&&s({inst:i})},[e,n,t]),XCe(function(){return QC(i)&&s({inst:i}),e(function(){QC(i)&&s({inst:i})})},[e]),ZCe(n),n}function QC(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!KCe(e,n)}catch{return!0}}function tAe(e,t){return t()}var nAe=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?tAe:eAe;oX.useSyncExternalStore=Zp.useSyncExternalStore!==void 0?Zp.useSyncExternalStore:nAe;sX.exports=oX;var rAe=sX.exports,aX={exports:{}},uX={};/** + */var Zp=w;function GCe(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var KCe=typeof Object.is=="function"?Object.is:GCe,QCe=Zp.useState,XCe=Zp.useEffect,JCe=Zp.useLayoutEffect,ZCe=Zp.useDebugValue;function eAe(e,t){var n=t(),r=QCe({inst:{value:n,getSnapshot:t}}),i=r[0].inst,s=r[1];return JCe(function(){i.value=n,i.getSnapshot=t,QC(i)&&s({inst:i})},[e,n,t]),XCe(function(){return QC(i)&&s({inst:i}),e(function(){QC(i)&&s({inst:i})})},[e]),ZCe(n),n}function QC(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!KCe(e,n)}catch{return!0}}function tAe(e,t){return t()}var nAe=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?tAe:eAe;sX.useSyncExternalStore=Zp.useSyncExternalStore!==void 0?Zp.useSyncExternalStore:nAe;iX.exports=sX;var rAe=iX.exports,oX={exports:{}},aX={};/** * @license React * use-sync-external-store-shim/with-selector.production.min.js * @@ -93,7 +93,7 @@ Error generating stack: `+s.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var eI=w,iAe=rAe;function sAe(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var oAe=typeof Object.is=="function"?Object.is:sAe,aAe=iAe.useSyncExternalStore,uAe=eI.useRef,lAe=eI.useEffect,cAe=eI.useMemo,fAe=eI.useDebugValue;uX.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var s=uAe(null);if(s.current===null){var o={hasValue:!1,value:null};s.current=o}else o=s.current;s=cAe(function(){function u(h){if(!l){if(l=!0,c=h,h=r(h),i!==void 0&&o.hasValue){var p=o.value;if(i(p,h))return f=p}return f=h}if(p=f,oAe(c,h))return p;var m=r(h);return i!==void 0&&i(p,m)?p:(c=h,f=m)}var l=!1,c,f,d=n===void 0?null:n;return[function(){return u(t())},d===null?void 0:function(){return u(d())}]},[t,n,r,i]);var a=aAe(e,s[0],s[1]);return lAe(function(){o.hasValue=!0,o.value=a},[a]),fAe(a),a};aX.exports=uX;var dAe=aX.exports;function hAe(e){e()}let lX=hAe;const pAe=e=>lX=e,mAe=()=>lX,Zc=w.createContext(null);function cX(){return w.useContext(Zc)}const gAe=()=>{throw new Error("uSES not initialized!")};let fX=gAe;const yAe=e=>{fX=e},_Ae=(e,t)=>e===t;function vAe(e=Zc){const t=e===Zc?cX:()=>w.useContext(e);return function(r,i=_Ae){const{store:s,subscription:o,getServerState:a}=t(),u=fX(o.addNestedSub,s.getState,a||s.getState,r,i);return w.useDebugValue(u),u}}const bAe=vAe();var Fn={};/** + */var eI=w,iAe=rAe;function sAe(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var oAe=typeof Object.is=="function"?Object.is:sAe,aAe=iAe.useSyncExternalStore,uAe=eI.useRef,lAe=eI.useEffect,cAe=eI.useMemo,fAe=eI.useDebugValue;aX.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var s=uAe(null);if(s.current===null){var o={hasValue:!1,value:null};s.current=o}else o=s.current;s=cAe(function(){function u(h){if(!l){if(l=!0,c=h,h=r(h),i!==void 0&&o.hasValue){var p=o.value;if(i(p,h))return f=p}return f=h}if(p=f,oAe(c,h))return p;var m=r(h);return i!==void 0&&i(p,m)?p:(c=h,f=m)}var l=!1,c,f,d=n===void 0?null:n;return[function(){return u(t())},d===null?void 0:function(){return u(d())}]},[t,n,r,i]);var a=aAe(e,s[0],s[1]);return lAe(function(){o.hasValue=!0,o.value=a},[a]),fAe(a),a};oX.exports=aX;var dAe=oX.exports;function hAe(e){e()}let uX=hAe;const pAe=e=>uX=e,mAe=()=>uX,Zc=w.createContext(null);function lX(){return w.useContext(Zc)}const gAe=()=>{throw new Error("uSES not initialized!")};let cX=gAe;const yAe=e=>{cX=e},_Ae=(e,t)=>e===t;function vAe(e=Zc){const t=e===Zc?lX:()=>w.useContext(e);return function(r,i=_Ae){const{store:s,subscription:o,getServerState:a}=t(),u=cX(o.addNestedSub,s.getState,a||s.getState,r,i);return w.useDebugValue(u),u}}const bAe=vAe();var Fn={};/** * @license React * react-is.production.min.js * @@ -101,10 +101,10 @@ Error generating stack: `+s.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var $k=Symbol.for("react.element"),Lk=Symbol.for("react.portal"),tI=Symbol.for("react.fragment"),nI=Symbol.for("react.strict_mode"),rI=Symbol.for("react.profiler"),iI=Symbol.for("react.provider"),sI=Symbol.for("react.context"),EAe=Symbol.for("react.server_context"),oI=Symbol.for("react.forward_ref"),aI=Symbol.for("react.suspense"),uI=Symbol.for("react.suspense_list"),lI=Symbol.for("react.memo"),cI=Symbol.for("react.lazy"),wAe=Symbol.for("react.offscreen"),dX;dX=Symbol.for("react.module.reference");function Jo(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case $k:switch(e=e.type,e){case tI:case rI:case nI:case aI:case uI:return e;default:switch(e=e&&e.$$typeof,e){case EAe:case sI:case oI:case cI:case lI:case iI:return e;default:return t}}case Lk:return t}}}Fn.ContextConsumer=sI;Fn.ContextProvider=iI;Fn.Element=$k;Fn.ForwardRef=oI;Fn.Fragment=tI;Fn.Lazy=cI;Fn.Memo=lI;Fn.Portal=Lk;Fn.Profiler=rI;Fn.StrictMode=nI;Fn.Suspense=aI;Fn.SuspenseList=uI;Fn.isAsyncMode=function(){return!1};Fn.isConcurrentMode=function(){return!1};Fn.isContextConsumer=function(e){return Jo(e)===sI};Fn.isContextProvider=function(e){return Jo(e)===iI};Fn.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===$k};Fn.isForwardRef=function(e){return Jo(e)===oI};Fn.isFragment=function(e){return Jo(e)===tI};Fn.isLazy=function(e){return Jo(e)===cI};Fn.isMemo=function(e){return Jo(e)===lI};Fn.isPortal=function(e){return Jo(e)===Lk};Fn.isProfiler=function(e){return Jo(e)===rI};Fn.isStrictMode=function(e){return Jo(e)===nI};Fn.isSuspense=function(e){return Jo(e)===aI};Fn.isSuspenseList=function(e){return Jo(e)===uI};Fn.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===tI||e===rI||e===nI||e===aI||e===uI||e===wAe||typeof e=="object"&&e!==null&&(e.$$typeof===cI||e.$$typeof===lI||e.$$typeof===iI||e.$$typeof===sI||e.$$typeof===oI||e.$$typeof===dX||e.getModuleId!==void 0)};Fn.typeOf=Jo;function TAe(){const e=mAe();let t=null,n=null;return{clear(){t=null,n=null},notify(){e(()=>{let r=t;for(;r;)r.callback(),r=r.next})},get(){let r=[],i=t;for(;i;)r.push(i),i=i.next;return r},subscribe(r){let i=!0,s=n={callback:r,next:null,prev:n};return s.prev?s.prev.next=s:t=s,function(){!i||t===null||(i=!1,s.next?s.next.prev=s.prev:n=s.prev,s.prev?s.prev.next=s.next:t=s.next)}}}}const t9={notify(){},get:()=>[]};function SAe(e,t){let n,r=t9;function i(f){return u(),r.subscribe(f)}function s(){r.notify()}function o(){c.onStateChange&&c.onStateChange()}function a(){return!!n}function u(){n||(n=t?t.addNestedSub(o):e.subscribe(o),r=TAe())}function l(){n&&(n(),n=void 0,r.clear(),r=t9)}const c={addNestedSub:i,notifyNestedSubs:s,handleChangeWrapper:o,isSubscribed:a,trySubscribe:u,tryUnsubscribe:l,getListeners:()=>r};return c}const IAe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",xAe=IAe?w.useLayoutEffect:w.useEffect;function CAe({store:e,context:t,children:n,serverState:r}){const i=w.useMemo(()=>{const a=SAe(e);return{store:e,subscription:a,getServerState:r?()=>r:void 0}},[e,r]),s=w.useMemo(()=>e.getState(),[e]);xAe(()=>{const{subscription:a}=i;return a.onStateChange=a.notifyNestedSubs,a.trySubscribe(),s!==e.getState()&&a.notifyNestedSubs(),()=>{a.tryUnsubscribe(),a.onStateChange=void 0}},[i,s]);const o=t||Zc;return k.createElement(o.Provider,{value:i},n)}function hX(e=Zc){const t=e===Zc?cX:()=>w.useContext(e);return function(){const{store:r}=t();return r}}const AAe=hX();function OAe(e=Zc){const t=e===Zc?AAe:hX(e);return function(){return t().dispatch}}const pX=OAe();yAe(dAe.useSyncExternalStoreWithSelector);pAe(b_.unstable_batchedUpdates);const PAe={},RAe=Object.freeze(Object.defineProperty({__proto__:null,default:PAe},Symbol.toStringTag,{value:"Module"})),NAe=Due(RAe);var kAe=NAe;function DAe(e,t){var n,r="",i=0,s=!0,o=0,a;function u(){return a=e.charAt(o),o++,a}for(u(),a==="-"&&(r="-",u());a>="0"&&a<="9";)s&&(a=="0"?i++:s=!1),r+=a,u();if(s&&i--,a===".")for(r+=".";u()&&a>="0"&&a<="9";)r+=a;if(a==="e"||a==="E")for(r+=a,u(),(a==="-"||a==="+")&&(r+=a,u());a>="0"&&a<="9";)r+=a,u();for(;a&&a<=" ";)u();if(t&&(a===","||a==="}"||a==="]"||a==="#"||a==="/"&&(e[o]==="/"||e[o]==="*"))&&(a=0),n=+r,!(a||i||!isFinite(n)))return n}function $Ae(e,t){return Object.defineProperty&&Object.defineProperty(e,"__COMMENTS__",{enumerable:!1,writable:!0}),e.__COMMENTS__=t||{}}function LAe(e){Object.defineProperty(e,"__COMMENTS__",{value:void 0})}function MAe(e){return e.__COMMENTS__}function FAe(e){if(!e)return"";var t=e.split(` + */var $k=Symbol.for("react.element"),Lk=Symbol.for("react.portal"),tI=Symbol.for("react.fragment"),nI=Symbol.for("react.strict_mode"),rI=Symbol.for("react.profiler"),iI=Symbol.for("react.provider"),sI=Symbol.for("react.context"),EAe=Symbol.for("react.server_context"),oI=Symbol.for("react.forward_ref"),aI=Symbol.for("react.suspense"),uI=Symbol.for("react.suspense_list"),lI=Symbol.for("react.memo"),cI=Symbol.for("react.lazy"),wAe=Symbol.for("react.offscreen"),fX;fX=Symbol.for("react.module.reference");function Jo(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case $k:switch(e=e.type,e){case tI:case rI:case nI:case aI:case uI:return e;default:switch(e=e&&e.$$typeof,e){case EAe:case sI:case oI:case cI:case lI:case iI:return e;default:return t}}case Lk:return t}}}Fn.ContextConsumer=sI;Fn.ContextProvider=iI;Fn.Element=$k;Fn.ForwardRef=oI;Fn.Fragment=tI;Fn.Lazy=cI;Fn.Memo=lI;Fn.Portal=Lk;Fn.Profiler=rI;Fn.StrictMode=nI;Fn.Suspense=aI;Fn.SuspenseList=uI;Fn.isAsyncMode=function(){return!1};Fn.isConcurrentMode=function(){return!1};Fn.isContextConsumer=function(e){return Jo(e)===sI};Fn.isContextProvider=function(e){return Jo(e)===iI};Fn.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===$k};Fn.isForwardRef=function(e){return Jo(e)===oI};Fn.isFragment=function(e){return Jo(e)===tI};Fn.isLazy=function(e){return Jo(e)===cI};Fn.isMemo=function(e){return Jo(e)===lI};Fn.isPortal=function(e){return Jo(e)===Lk};Fn.isProfiler=function(e){return Jo(e)===rI};Fn.isStrictMode=function(e){return Jo(e)===nI};Fn.isSuspense=function(e){return Jo(e)===aI};Fn.isSuspenseList=function(e){return Jo(e)===uI};Fn.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===tI||e===rI||e===nI||e===aI||e===uI||e===wAe||typeof e=="object"&&e!==null&&(e.$$typeof===cI||e.$$typeof===lI||e.$$typeof===iI||e.$$typeof===sI||e.$$typeof===oI||e.$$typeof===fX||e.getModuleId!==void 0)};Fn.typeOf=Jo;function TAe(){const e=mAe();let t=null,n=null;return{clear(){t=null,n=null},notify(){e(()=>{let r=t;for(;r;)r.callback(),r=r.next})},get(){let r=[],i=t;for(;i;)r.push(i),i=i.next;return r},subscribe(r){let i=!0,s=n={callback:r,next:null,prev:n};return s.prev?s.prev.next=s:t=s,function(){!i||t===null||(i=!1,s.next?s.next.prev=s.prev:n=s.prev,s.prev?s.prev.next=s.next:t=s.next)}}}}const t9={notify(){},get:()=>[]};function SAe(e,t){let n,r=t9;function i(f){return u(),r.subscribe(f)}function s(){r.notify()}function o(){c.onStateChange&&c.onStateChange()}function a(){return!!n}function u(){n||(n=t?t.addNestedSub(o):e.subscribe(o),r=TAe())}function l(){n&&(n(),n=void 0,r.clear(),r=t9)}const c={addNestedSub:i,notifyNestedSubs:s,handleChangeWrapper:o,isSubscribed:a,trySubscribe:u,tryUnsubscribe:l,getListeners:()=>r};return c}const IAe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",xAe=IAe?w.useLayoutEffect:w.useEffect;function CAe({store:e,context:t,children:n,serverState:r}){const i=w.useMemo(()=>{const a=SAe(e);return{store:e,subscription:a,getServerState:r?()=>r:void 0}},[e,r]),s=w.useMemo(()=>e.getState(),[e]);xAe(()=>{const{subscription:a}=i;return a.onStateChange=a.notifyNestedSubs,a.trySubscribe(),s!==e.getState()&&a.notifyNestedSubs(),()=>{a.tryUnsubscribe(),a.onStateChange=void 0}},[i,s]);const o=t||Zc;return k.createElement(o.Provider,{value:i},n)}function dX(e=Zc){const t=e===Zc?lX:()=>w.useContext(e);return function(){const{store:r}=t();return r}}const AAe=dX();function OAe(e=Zc){const t=e===Zc?AAe:dX(e);return function(){return t().dispatch}}const hX=OAe();yAe(dAe.useSyncExternalStoreWithSelector);pAe(b_.unstable_batchedUpdates);const PAe={},RAe=Object.freeze(Object.defineProperty({__proto__:null,default:PAe},Symbol.toStringTag,{value:"Module"})),NAe=kue(RAe);var kAe=NAe;function DAe(e,t){var n,r="",i=0,s=!0,o=0,a;function u(){return a=e.charAt(o),o++,a}for(u(),a==="-"&&(r="-",u());a>="0"&&a<="9";)s&&(a=="0"?i++:s=!1),r+=a,u();if(s&&i--,a===".")for(r+=".";u()&&a>="0"&&a<="9";)r+=a;if(a==="e"||a==="E")for(r+=a,u(),(a==="-"||a==="+")&&(r+=a,u());a>="0"&&a<="9";)r+=a,u();for(;a&&a<=" ";)u();if(t&&(a===","||a==="}"||a==="]"||a==="#"||a==="/"&&(e[o]==="/"||e[o]==="*"))&&(a=0),n=+r,!(a||i||!isFinite(n)))return n}function $Ae(e,t){return Object.defineProperty&&Object.defineProperty(e,"__COMMENTS__",{enumerable:!1,writable:!0}),e.__COMMENTS__=t||{}}function LAe(e){Object.defineProperty(e,"__COMMENTS__",{value:void 0})}function MAe(e){return e.__COMMENTS__}function FAe(e){if(!e)return"";var t=e.split(` `),n,r,i,s;for(i=0;i" "){t[i]="# "+n;break}}return t.join(` `)}var fI={EOL:kAe.EOL||` -`,tryParseNumber:DAe,createComment:$Ae,removeComment:LAe,getComment:MAe,forceComment:FAe},BAe="3.2.1";function jAe(e,t){if(Object.prototype.toString.apply(e)!=="[object Array]"){if(e)throw new Error("dsf option must contain an array!");return n9}else if(e.length===0)return n9;var n=[];function r(i){return{}.toString.call(i)==="[object Function]"}return e.forEach(function(i){if(!i.name||!r(i.parse)||!r(i.stringify))throw new Error("extension does not match the DSF interface");n.push(function(){try{if(t=="parse")return i.parse.apply(null,arguments);if(t=="stringify"){var s=i.stringify.apply(null,arguments);if(s!==void 0&&(typeof s!="string"||s.length===0||s[0]==='"'||[].some.call(s,function(o){return VAe(o)})))throw new Error("value may not be empty, start with a quote or contain a punctuator character except colon: "+s);return s}else throw new Error("Invalid type")}catch(o){throw new Error("DSF-"+i.name+" failed; "+o.message)}})}),UAe.bind(null,n)}function UAe(e,t){if(e)for(var n=0;n0&&i[ye]!==` `;ye--,he++);for(;ye>0;ye--)i[ye]===` `&&ve++;throw new Error(Y+" at line "+ve+","+he+" >>>"+i.substr(s-he,20)+" ...")}function h(){return o=i.charAt(s),s++,o}function p(Y){return i.charAt(s+Y)}function m(Y){for(var ye="",he=o;h();){if(o===he)return h(),Y&&he==="'"&&o==="'"&&ye.length===0?(h(),y()):ye;if(o==="\\")if(h(),o==="u"){for(var ve=0,te=0;te<4;te++){h();var se=o.charCodeAt(0),K;o>="0"&&o<="9"?K=se-48:o>="a"&&o<="f"?K=se-97+10:o>="A"&&o<="F"?K=se-65+10:d("Bad \\u char "+o),ve=ve*16+K}ye+=String.fromCharCode(ve)}else if(typeof a[o]=="string")ye+=a[o];else break;else o===` @@ -153,31 +153,31 @@ Error generating stack: `+s.message+` * https://github.com/douglascrockford/JSON-js (json_parse.js, json2.js) */var i9=fI,GAe=BAe,s9=zAe,o9=HAe,KAe=YAe,QAe=Mk,Fk={parse:s9,stringify:o9,endOfLine:function(){return i9.EOL},setEndOfLine:function(e){(e===` `||e===`\r -`)&&(i9.EOL=e)},version:GAe,rt:{parse:function(e,t){return(t=t||{}).keepWsc=!0,s9(e,t)},stringify:function(e,t){return(t=t||{}).keepWsc=!0,o9(e,t)}},comments:KAe,dsf:QAe.std},GP={exports:{}},_X={},Ia={},em={},O_={},Yt={},Sy={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class n extends t{constructor(_){if(super(),!e.IDENTIFIER.test(_))throw new Error("CodeGen: name must be a valid identifier");this.str=_}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=n;class r extends t{constructor(_){super(),this._items=typeof _=="string"?[_]:_}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const _=this._items[0];return _===""||_==='""'}get str(){var _;return(_=this._str)!==null&&_!==void 0?_:this._str=this._items.reduce((b,T)=>`${b}${T}`,"")}get names(){var _;return(_=this._names)!==null&&_!==void 0?_:this._names=this._items.reduce((b,T)=>(T instanceof n&&(b[T.str]=(b[T.str]||0)+1),b),{})}}e._Code=r,e.nil=new r("");function i(g,..._){const b=[g[0]];let T=0;for(;T<_.length;)a(b,_[T]),b.push(g[++T]);return new r(b)}e._=i;const s=new r("+");function o(g,..._){const b=[h(g[0])];let T=0;for(;T<_.length;)b.push(s),a(b,_[T]),b.push(s,h(g[++T]));return u(b),new r(b)}e.str=o;function a(g,_){_ instanceof r?g.push(..._._items):_ instanceof n?g.push(_):g.push(f(_))}e.addCodeArg=a;function u(g){let _=1;for(;_{if(f.scopePath===void 0)throw new Error(`CodeGen: name "${f}" has no value`);return(0,t._)`${l}${f.scopePath}`})}scopeCode(l=this._values,c,f){return this._reduceValues(l,d=>{if(d.value===void 0)throw new Error(`CodeGen: name "${d}" has no value`);return d.value.code},c,f)}_reduceValues(l,c,f={},d){let h=t.nil;for(const p in l){const m=l[p];if(!m)continue;const y=f[p]=f[p]||new Map;m.forEach(g=>{if(y.has(g))return;y.set(g,r.Started);let _=c(g);if(_){const b=this.opts.es5?e.varKinds.var:e.varKinds.const;h=(0,t._)`${h}${b} ${g} = ${_};${this.opts._n}`}else if(_=d==null?void 0:d(g))h=(0,t._)`${h}${_}${this.opts._n}`;else throw new n(g);y.set(g,r.Completed)})}return h}}e.ValueScope=a})(KP);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=Sy,n=KP;var r=Sy;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return r.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return r.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return r.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}});var i=KP;Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return i.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return i.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return i.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return i.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class s{optimizeNodes(){return this}optimizeNames(R,O){return this}}class o extends s{constructor(R,O,q){super(),this.varKind=R,this.name=O,this.rhs=q}render({es5:R,_n:O}){const q=R?n.varKinds.var:this.varKind,le=this.rhs===void 0?"":` = ${this.rhs}`;return`${q} ${this.name}${le};`+O}optimizeNames(R,O){if(R[this.name.str])return this.rhs&&(this.rhs=Y(this.rhs,R,O)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class a extends s{constructor(R,O,q){super(),this.lhs=R,this.rhs=O,this.sideEffects=q}render({_n:R}){return`${this.lhs} = ${this.rhs};`+R}optimizeNames(R,O){if(!(this.lhs instanceof t.Name&&!R[this.lhs.str]&&!this.sideEffects))return this.rhs=Y(this.rhs,R,O),this}get names(){const R=this.lhs instanceof t.Name?{}:{...this.lhs.names};return J(R,this.rhs)}}class u extends a{constructor(R,O,q,le){super(R,q,le),this.op=O}render({_n:R}){return`${this.lhs} ${this.op}= ${this.rhs};`+R}}class l extends s{constructor(R){super(),this.label=R,this.names={}}render({_n:R}){return`${this.label}:`+R}}class c extends s{constructor(R){super(),this.label=R,this.names={}}render({_n:R}){return`break${this.label?` ${this.label}`:""};`+R}}class f extends s{constructor(R){super(),this.error=R}render({_n:R}){return`throw ${this.error};`+R}get names(){return this.error.names}}class d extends s{constructor(R){super(),this.code=R}render({_n:R}){return`${this.code};`+R}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(R,O){return this.code=Y(this.code,R,O),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class h extends s{constructor(R=[]){super(),this.nodes=R}render(R){return this.nodes.reduce((O,q)=>O+q.render(R),"")}optimizeNodes(){const{nodes:R}=this;let O=R.length;for(;O--;){const q=R[O].optimizeNodes();Array.isArray(q)?R.splice(O,1,...q):q?R[O]=q:R.splice(O,1)}return R.length>0?this:void 0}optimizeNames(R,O){const{nodes:q}=this;let le=q.length;for(;le--;){const ae=q[le];ae.optimizeNames(R,O)||(ye(R,ae.names),q.splice(le,1))}return q.length>0?this:void 0}get names(){return this.nodes.reduce((R,O)=>H(R,O.names),{})}}class p extends h{render(R){return"{"+R._n+super.render(R)+"}"+R._n}}class m extends h{}class y extends p{}y.kind="else";class g extends p{constructor(R,O){super(O),this.condition=R}render(R){let O=`if(${this.condition})`+super.render(R);return this.else&&(O+="else "+this.else.render(R)),O}optimizeNodes(){super.optimizeNodes();const R=this.condition;if(R===!0)return this.nodes;let O=this.else;if(O){const q=O.optimizeNodes();O=this.else=Array.isArray(q)?new y(q):q}if(O)return R===!1?O instanceof g?O:O.nodes:this.nodes.length?this:new g(he(R),O instanceof g?[O]:O.nodes);if(!(R===!1||!this.nodes.length))return this}optimizeNames(R,O){var q;if(this.else=(q=this.else)===null||q===void 0?void 0:q.optimizeNames(R,O),!!(super.optimizeNames(R,O)||this.else))return this.condition=Y(this.condition,R,O),this}get names(){const R=super.names;return J(R,this.condition),this.else&&H(R,this.else.names),R}}g.kind="if";class _ extends p{}_.kind="for";class b extends _{constructor(R){super(),this.iteration=R}render(R){return`for(${this.iteration})`+super.render(R)}optimizeNames(R,O){if(super.optimizeNames(R,O))return this.iteration=Y(this.iteration,R,O),this}get names(){return H(super.names,this.iteration.names)}}class T extends _{constructor(R,O,q,le){super(),this.varKind=R,this.name=O,this.from=q,this.to=le}render(R){const O=R.es5?n.varKinds.var:this.varKind,{name:q,from:le,to:ae}=this;return`for(${O} ${q}=${le}; ${q}<${ae}; ${q}++)`+super.render(R)}get names(){const R=J(super.names,this.from);return J(R,this.to)}}class I extends _{constructor(R,O,q,le){super(),this.loop=R,this.varKind=O,this.name=q,this.iterable=le}render(R){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(R)}optimizeNames(R,O){if(super.optimizeNames(R,O))return this.iterable=Y(this.iterable,R,O),this}get names(){return H(super.names,this.iterable.names)}}class E extends p{constructor(R,O,q){super(),this.name=R,this.args=O,this.async=q}render(R){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(R)}}E.kind="func";class S extends h{render(R){return"return "+super.render(R)}}S.kind="return";class A extends p{render(R){let O="try"+super.render(R);return this.catch&&(O+=this.catch.render(R)),this.finally&&(O+=this.finally.render(R)),O}optimizeNodes(){var R,O;return super.optimizeNodes(),(R=this.catch)===null||R===void 0||R.optimizeNodes(),(O=this.finally)===null||O===void 0||O.optimizeNodes(),this}optimizeNames(R,O){var q,le;return super.optimizeNames(R,O),(q=this.catch)===null||q===void 0||q.optimizeNames(R,O),(le=this.finally)===null||le===void 0||le.optimizeNames(R,O),this}get names(){const R=super.names;return this.catch&&H(R,this.catch.names),this.finally&&H(R,this.finally.names),R}}class P extends p{constructor(R){super(),this.error=R}render(R){return`catch(${this.error})`+super.render(R)}}P.kind="catch";class V extends p{render(R){return"finally"+super.render(R)}}V.kind="finally";class M{constructor(R,O={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...O,_n:O.lines?` -`:""},this._extScope=R,this._scope=new n.Scope({parent:R}),this._nodes=[new m]}toString(){return this._root.render(this.opts)}name(R){return this._scope.name(R)}scopeName(R){return this._extScope.name(R)}scopeValue(R,O){const q=this._extScope.value(R,O);return(this._values[q.prefix]||(this._values[q.prefix]=new Set)).add(q),q}getScopeValue(R,O){return this._extScope.getValue(R,O)}scopeRefs(R){return this._extScope.scopeRefs(R,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(R,O,q,le){const ae=this._scope.toName(O);return q!==void 0&&le&&(this._constants[ae.str]=q),this._leafNode(new o(R,ae,q)),ae}const(R,O,q){return this._def(n.varKinds.const,R,O,q)}let(R,O,q){return this._def(n.varKinds.let,R,O,q)}var(R,O,q){return this._def(n.varKinds.var,R,O,q)}assign(R,O,q){return this._leafNode(new a(R,O,q))}add(R,O){return this._leafNode(new u(R,e.operators.ADD,O))}code(R){return typeof R=="function"?R():R!==t.nil&&this._leafNode(new d(R)),this}object(...R){const O=["{"];for(const[q,le]of R)O.length>1&&O.push(","),O.push(q),(q!==le||this.opts.es5)&&(O.push(":"),(0,t.addCodeArg)(O,le));return O.push("}"),new t._Code(O)}if(R,O,q){if(this._blockNode(new g(R)),O&&q)this.code(O).else().code(q).endIf();else if(O)this.code(O).endIf();else if(q)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(R){return this._elseNode(new g(R))}else(){return this._elseNode(new y)}endIf(){return this._endBlockNode(g,y)}_for(R,O){return this._blockNode(R),O&&this.code(O).endFor(),this}for(R,O){return this._for(new b(R),O)}forRange(R,O,q,le,ae=this.opts.es5?n.varKinds.var:n.varKinds.let){const pe=this._scope.toName(R);return this._for(new T(ae,pe,O,q),()=>le(pe))}forOf(R,O,q,le=n.varKinds.const){const ae=this._scope.toName(R);if(this.opts.es5){const pe=O instanceof t.Name?O:this.var("_arr",O);return this.forRange("_i",0,(0,t._)`${pe}.length`,me=>{this.var(ae,(0,t._)`${pe}[${me}]`),q(ae)})}return this._for(new I("of",le,ae,O),()=>q(ae))}forIn(R,O,q,le=this.opts.es5?n.varKinds.var:n.varKinds.const){if(this.opts.ownProperties)return this.forOf(R,(0,t._)`Object.keys(${O})`,q);const ae=this._scope.toName(R);return this._for(new I("in",le,ae,O),()=>q(ae))}endFor(){return this._endBlockNode(_)}label(R){return this._leafNode(new l(R))}break(R){return this._leafNode(new c(R))}return(R){const O=new S;if(this._blockNode(O),this.code(R),O.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(S)}try(R,O,q){if(!O&&!q)throw new Error('CodeGen: "try" without "catch" and "finally"');const le=new A;if(this._blockNode(le),this.code(R),O){const ae=this.name("e");this._currNode=le.catch=new P(ae),O(ae)}return q&&(this._currNode=le.finally=new V,this.code(q)),this._endBlockNode(P,V)}throw(R){return this._leafNode(new f(R))}block(R,O){return this._blockStarts.push(this._nodes.length),R&&this.code(R).endBlock(O),this}endBlock(R){const O=this._blockStarts.pop();if(O===void 0)throw new Error("CodeGen: not in self-balancing block");const q=this._nodes.length-O;if(q<0||R!==void 0&&q!==R)throw new Error(`CodeGen: wrong number of nodes: ${q} vs ${R} expected`);return this._nodes.length=O,this}func(R,O=t.nil,q,le){return this._blockNode(new E(R,O,q)),le&&this.code(le).endFunc(),this}endFunc(){return this._endBlockNode(E)}optimize(R=1){for(;R-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(R){return this._currNode.nodes.push(R),this}_blockNode(R){this._currNode.nodes.push(R),this._nodes.push(R)}_endBlockNode(R,O){const q=this._currNode;if(q instanceof R||O&&q instanceof O)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${O?`${R.kind}/${O.kind}`:R.kind}"`)}_elseNode(R){const O=this._currNode;if(!(O instanceof g))throw new Error('CodeGen: "else" without "if"');return this._currNode=O.else=R,this}get _root(){return this._nodes[0]}get _currNode(){const R=this._nodes;return R[R.length-1]}set _currNode(R){const O=this._nodes;O[O.length-1]=R}}e.CodeGen=M;function H(z,R){for(const O in R)z[O]=(z[O]||0)+(R[O]||0);return z}function J(z,R){return R instanceof t._CodeOrName?H(z,R.names):z}function Y(z,R,O){if(z instanceof t.Name)return q(z);if(!le(z))return z;return new t._Code(z._items.reduce((ae,pe)=>(pe instanceof t.Name&&(pe=q(pe)),pe instanceof t._Code?ae.push(...pe._items):ae.push(pe),ae),[]));function q(ae){const pe=O[ae.str];return pe===void 0||R[ae.str]!==1?ae:(delete R[ae.str],pe)}function le(ae){return ae instanceof t._Code&&ae._items.some(pe=>pe instanceof t.Name&&R[pe.str]===1&&O[pe.str]!==void 0)}}function ye(z,R){for(const O in R)z[O]=(z[O]||0)-(R[O]||0)}function he(z){return typeof z=="boolean"||typeof z=="number"||z===null?!z:(0,t._)`!${C(z)}`}e.not=he;const ve=x(e.operators.AND);function te(...z){return z.reduce(ve)}e.and=te;const se=x(e.operators.OR);function K(...z){return z.reduce(se)}e.or=K;function x(z){return(R,O)=>R===t.nil?O:O===t.nil?R:(0,t._)`${C(R)} ${z} ${C(O)}`}function C(z){return z instanceof t.Name?z:(0,t._)`(${z})`}})(Yt);var pn={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.checkStrictMode=e.getErrorPath=e.Type=e.useFunc=e.setEvaluated=e.evaluatedPropsToName=e.mergeEvaluated=e.eachItem=e.unescapeJsonPointer=e.escapeJsonPointer=e.escapeFragment=e.unescapeFragment=e.schemaRefOrVal=e.schemaHasRulesButRef=e.schemaHasRules=e.checkUnknownRules=e.alwaysValidSchema=e.toHash=void 0;const t=Yt,n=Sy;function r(E){const S={};for(const A of E)S[A]=!0;return S}e.toHash=r;function i(E,S){return typeof S=="boolean"?S:Object.keys(S).length===0?!0:(s(E,S),!o(S,E.self.RULES.all))}e.alwaysValidSchema=i;function s(E,S=E.schema){const{opts:A,self:P}=E;if(!A.strictSchema||typeof S=="boolean")return;const V=P.RULES.keywords;for(const M in S)V[M]||I(E,`unknown keyword: "${M}"`)}e.checkUnknownRules=s;function o(E,S){if(typeof E=="boolean")return!E;for(const A in E)if(S[A])return!0;return!1}e.schemaHasRules=o;function a(E,S){if(typeof E=="boolean")return!E;for(const A in E)if(A!=="$ref"&&S.all[A])return!0;return!1}e.schemaHasRulesButRef=a;function u({topSchemaRef:E,schemaPath:S},A,P,V){if(!V){if(typeof A=="number"||typeof A=="boolean")return A;if(typeof A=="string")return(0,t._)`${A}`}return(0,t._)`${E}${S}${(0,t.getProperty)(P)}`}e.schemaRefOrVal=u;function l(E){return d(decodeURIComponent(E))}e.unescapeFragment=l;function c(E){return encodeURIComponent(f(E))}e.escapeFragment=c;function f(E){return typeof E=="number"?`${E}`:E.replace(/~/g,"~0").replace(/\//g,"~1")}e.escapeJsonPointer=f;function d(E){return E.replace(/~1/g,"/").replace(/~0/g,"~")}e.unescapeJsonPointer=d;function h(E,S){if(Array.isArray(E))for(const A of E)S(A);else S(E)}e.eachItem=h;function p({mergeNames:E,mergeToName:S,mergeValues:A,resultToName:P}){return(V,M,H,J)=>{const Y=H===void 0?M:H instanceof t.Name?(M instanceof t.Name?E(V,M,H):S(V,M,H),H):M instanceof t.Name?(S(V,H,M),M):A(M,H);return J===t.Name&&!(Y instanceof t.Name)?P(V,Y):Y}}e.mergeEvaluated={props:p({mergeNames:(E,S,A)=>E.if((0,t._)`${A} !== true && ${S} !== undefined`,()=>{E.if((0,t._)`${S} === true`,()=>E.assign(A,!0),()=>E.assign(A,(0,t._)`${A} || {}`).code((0,t._)`Object.assign(${A}, ${S})`))}),mergeToName:(E,S,A)=>E.if((0,t._)`${A} !== true`,()=>{S===!0?E.assign(A,!0):(E.assign(A,(0,t._)`${A} || {}`),y(E,A,S))}),mergeValues:(E,S)=>E===!0?!0:{...E,...S},resultToName:m}),items:p({mergeNames:(E,S,A)=>E.if((0,t._)`${A} !== true && ${S} !== undefined`,()=>E.assign(A,(0,t._)`${S} === true ? true : ${A} > ${S} ? ${A} : ${S}`)),mergeToName:(E,S,A)=>E.if((0,t._)`${A} !== true`,()=>E.assign(A,S===!0?!0:(0,t._)`${A} > ${S} ? ${A} : ${S}`)),mergeValues:(E,S)=>E===!0?!0:Math.max(E,S),resultToName:(E,S)=>E.var("items",S)})};function m(E,S){if(S===!0)return E.var("props",!0);const A=E.var("props",(0,t._)`{}`);return S!==void 0&&y(E,A,S),A}e.evaluatedPropsToName=m;function y(E,S,A){Object.keys(A).forEach(P=>E.assign((0,t._)`${S}${(0,t.getProperty)(P)}`,!0))}e.setEvaluated=y;const g={};function _(E,S){return E.scopeValue("func",{ref:S,code:g[S.code]||(g[S.code]=new n._Code(S.code))})}e.useFunc=_;var b;(function(E){E[E.Num=0]="Num",E[E.Str=1]="Str"})(b=e.Type||(e.Type={}));function T(E,S,A){if(E instanceof t.Name){const P=S===b.Num;return A?P?(0,t._)`"[" + ${E} + "]"`:(0,t._)`"['" + ${E} + "']"`:P?(0,t._)`"/" + ${E}`:(0,t._)`"/" + ${E}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return A?(0,t.getProperty)(E).toString():"/"+f(E)}e.getErrorPath=T;function I(E,S,A=E.opts.strictSchema){if(A){if(S=`strict mode: ${S}`,A===!0)throw new Error(S);E.self.logger.warn(S)}}e.checkStrictMode=I})(pn);var ju={};Object.defineProperty(ju,"__esModule",{value:!0});const ji=Yt,XAe={data:new ji.Name("data"),valCxt:new ji.Name("valCxt"),instancePath:new ji.Name("instancePath"),parentData:new ji.Name("parentData"),parentDataProperty:new ji.Name("parentDataProperty"),rootData:new ji.Name("rootData"),dynamicAnchors:new ji.Name("dynamicAnchors"),vErrors:new ji.Name("vErrors"),errors:new ji.Name("errors"),this:new ji.Name("this"),self:new ji.Name("self"),scope:new ji.Name("scope"),json:new ji.Name("json"),jsonPos:new ji.Name("jsonPos"),jsonLen:new ji.Name("jsonLen"),jsonPart:new ji.Name("jsonPart")};ju.default=XAe;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=Yt,n=pn,r=ju;e.keywordError={message:({keyword:y})=>(0,t.str)`must pass "${y}" keyword validation`},e.keyword$DataError={message:({keyword:y,schemaType:g})=>g?(0,t.str)`"${y}" keyword must be ${g} ($data)`:(0,t.str)`"${y}" keyword is invalid ($data)`};function i(y,g=e.keywordError,_,b){const{it:T}=y,{gen:I,compositeRule:E,allErrors:S}=T,A=f(y,g,_);b??(E||S)?u(I,A):l(T,(0,t._)`[${A}]`)}e.reportError=i;function s(y,g=e.keywordError,_){const{it:b}=y,{gen:T,compositeRule:I,allErrors:E}=b,S=f(y,g,_);u(T,S),I||E||l(b,r.default.vErrors)}e.reportExtraError=s;function o(y,g){y.assign(r.default.errors,g),y.if((0,t._)`${r.default.vErrors} !== null`,()=>y.if(g,()=>y.assign((0,t._)`${r.default.vErrors}.length`,g),()=>y.assign(r.default.vErrors,null)))}e.resetErrorsCount=o;function a({gen:y,keyword:g,schemaValue:_,data:b,errsCount:T,it:I}){if(T===void 0)throw new Error("ajv implementation error");const E=y.name("err");y.forRange("i",T,r.default.errors,S=>{y.const(E,(0,t._)`${r.default.vErrors}[${S}]`),y.if((0,t._)`${E}.instancePath === undefined`,()=>y.assign((0,t._)`${E}.instancePath`,(0,t.strConcat)(r.default.instancePath,I.errorPath))),y.assign((0,t._)`${E}.schemaPath`,(0,t.str)`${I.errSchemaPath}/${g}`),I.opts.verbose&&(y.assign((0,t._)`${E}.schema`,_),y.assign((0,t._)`${E}.data`,b))})}e.extendErrors=a;function u(y,g){const _=y.const("err",g);y.if((0,t._)`${r.default.vErrors} === null`,()=>y.assign(r.default.vErrors,(0,t._)`[${_}]`),(0,t._)`${r.default.vErrors}.push(${_})`),y.code((0,t._)`${r.default.errors}++`)}function l(y,g){const{gen:_,validateName:b,schemaEnv:T}=y;T.$async?_.throw((0,t._)`new ${y.ValidationError}(${g})`):(_.assign((0,t._)`${b}.errors`,g),_.return(!1))}const c={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function f(y,g,_){const{createErrors:b}=y.it;return b===!1?(0,t._)`{}`:d(y,g,_)}function d(y,g,_={}){const{gen:b,it:T}=y,I=[h(T,_),p(y,_)];return m(y,g,I),b.object(...I)}function h({errorPath:y},{instancePath:g}){const _=g?(0,t.str)`${y}${(0,n.getErrorPath)(g,n.Type.Str)}`:y;return[r.default.instancePath,(0,t.strConcat)(r.default.instancePath,_)]}function p({keyword:y,it:{errSchemaPath:g}},{schemaPath:_,parentSchema:b}){let T=b?g:(0,t.str)`${g}/${y}`;return _&&(T=(0,t.str)`${T}${(0,n.getErrorPath)(_,n.Type.Str)}`),[c.schemaPath,T]}function m(y,{params:g,message:_},b){const{keyword:T,data:I,schemaValue:E,it:S}=y,{opts:A,propertyName:P,topSchemaRef:V,schemaPath:M}=S;b.push([c.keyword,T],[c.params,typeof g=="function"?g(y):g||(0,t._)`{}`]),A.messages&&b.push([c.message,typeof _=="function"?_(y):_]),A.verbose&&b.push([c.schema,E],[c.parentSchema,(0,t._)`${V}${M}`],[r.default.data,I]),P&&b.push([c.propertyName,P])}})(O_);Object.defineProperty(em,"__esModule",{value:!0});em.boolOrEmptySchema=em.topBoolOrEmptySchema=void 0;const JAe=O_,ZAe=Yt,eOe=ju,tOe={message:"boolean schema is false"};function nOe(e){const{gen:t,schema:n,validateName:r}=e;n===!1?vX(e,!1):typeof n=="object"&&n.$async===!0?t.return(eOe.default.data):(t.assign((0,ZAe._)`${r}.errors`,null),t.return(!0))}em.topBoolOrEmptySchema=nOe;function rOe(e,t){const{gen:n,schema:r}=e;r===!1?(n.var(t,!1),vX(e)):n.var(t,!0)}em.boolOrEmptySchema=rOe;function vX(e,t){const{gen:n,data:r}=e,i={gen:n,keyword:"false schema",data:r,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,JAe.reportError)(i,tOe,void 0,t)}var P_={},Dd={};Object.defineProperty(Dd,"__esModule",{value:!0});Dd.getRules=Dd.isJSONType=void 0;const iOe=["string","number","integer","boolean","null","object","array"],sOe=new Set(iOe);function oOe(e){return typeof e=="string"&&sOe.has(e)}Dd.isJSONType=oOe;function aOe(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}Dd.getRules=aOe;var ml={};Object.defineProperty(ml,"__esModule",{value:!0});ml.shouldUseRule=ml.shouldUseGroup=ml.schemaHasRulesForType=void 0;function uOe({schema:e,self:t},n){const r=t.RULES.types[n];return r&&r!==!0&&bX(e,r)}ml.schemaHasRulesForType=uOe;function bX(e,t){return t.rules.some(n=>EX(e,n))}ml.shouldUseGroup=bX;function EX(e,t){var n;return e[t.keyword]!==void 0||((n=t.definition.implements)===null||n===void 0?void 0:n.some(r=>e[r]!==void 0))}ml.shouldUseRule=EX;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.reportTypeError=e.checkDataTypes=e.checkDataType=e.coerceAndCheckDataType=e.getJSONTypes=e.getSchemaTypes=e.DataType=void 0;const t=Dd,n=ml,r=O_,i=Yt,s=pn;var o;(function(b){b[b.Correct=0]="Correct",b[b.Wrong=1]="Wrong"})(o=e.DataType||(e.DataType={}));function a(b){const T=u(b.type);if(T.includes("null")){if(b.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!T.length&&b.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');b.nullable===!0&&T.push("null")}return T}e.getSchemaTypes=a;function u(b){const T=Array.isArray(b)?b:b?[b]:[];if(T.every(t.isJSONType))return T;throw new Error("type must be JSONType or JSONType[]: "+T.join(","))}e.getJSONTypes=u;function l(b,T){const{gen:I,data:E,opts:S}=b,A=f(T,S.coerceTypes),P=T.length>0&&!(A.length===0&&T.length===1&&(0,n.schemaHasRulesForType)(b,T[0]));if(P){const V=m(T,E,S.strictNumbers,o.Wrong);I.if(V,()=>{A.length?d(b,T,A):g(b)})}return P}e.coerceAndCheckDataType=l;const c=new Set(["string","number","integer","boolean","null"]);function f(b,T){return T?b.filter(I=>c.has(I)||T==="array"&&I==="array"):[]}function d(b,T,I){const{gen:E,data:S,opts:A}=b,P=E.let("dataType",(0,i._)`typeof ${S}`),V=E.let("coerced",(0,i._)`undefined`);A.coerceTypes==="array"&&E.if((0,i._)`${P} == 'object' && Array.isArray(${S}) && ${S}.length == 1`,()=>E.assign(S,(0,i._)`${S}[0]`).assign(P,(0,i._)`typeof ${S}`).if(m(T,S,A.strictNumbers),()=>E.assign(V,S))),E.if((0,i._)`${V} !== undefined`);for(const H of I)(c.has(H)||H==="array"&&A.coerceTypes==="array")&&M(H);E.else(),g(b),E.endIf(),E.if((0,i._)`${V} !== undefined`,()=>{E.assign(S,V),h(b,V)});function M(H){switch(H){case"string":E.elseIf((0,i._)`${P} == "number" || ${P} == "boolean"`).assign(V,(0,i._)`"" + ${S}`).elseIf((0,i._)`${S} === null`).assign(V,(0,i._)`""`);return;case"number":E.elseIf((0,i._)`${P} == "boolean" || ${S} === null +`)&&(i9.EOL=e)},version:GAe,rt:{parse:function(e,t){return(t=t||{}).keepWsc=!0,s9(e,t)},stringify:function(e,t){return(t=t||{}).keepWsc=!0,o9(e,t)}},comments:KAe,dsf:QAe.std},GP={exports:{}},yX={},Ia={},em={},O_={},Yt={},Sy={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class n extends t{constructor(_){if(super(),!e.IDENTIFIER.test(_))throw new Error("CodeGen: name must be a valid identifier");this.str=_}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=n;class r extends t{constructor(_){super(),this._items=typeof _=="string"?[_]:_}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const _=this._items[0];return _===""||_==='""'}get str(){var _;return(_=this._str)!==null&&_!==void 0?_:this._str=this._items.reduce((b,T)=>`${b}${T}`,"")}get names(){var _;return(_=this._names)!==null&&_!==void 0?_:this._names=this._items.reduce((b,T)=>(T instanceof n&&(b[T.str]=(b[T.str]||0)+1),b),{})}}e._Code=r,e.nil=new r("");function i(g,..._){const b=[g[0]];let T=0;for(;T<_.length;)a(b,_[T]),b.push(g[++T]);return new r(b)}e._=i;const s=new r("+");function o(g,..._){const b=[h(g[0])];let T=0;for(;T<_.length;)b.push(s),a(b,_[T]),b.push(s,h(g[++T]));return u(b),new r(b)}e.str=o;function a(g,_){_ instanceof r?g.push(..._._items):_ instanceof n?g.push(_):g.push(f(_))}e.addCodeArg=a;function u(g){let _=1;for(;_{if(f.scopePath===void 0)throw new Error(`CodeGen: name "${f}" has no value`);return(0,t._)`${l}${f.scopePath}`})}scopeCode(l=this._values,c,f){return this._reduceValues(l,d=>{if(d.value===void 0)throw new Error(`CodeGen: name "${d}" has no value`);return d.value.code},c,f)}_reduceValues(l,c,f={},d){let h=t.nil;for(const p in l){const m=l[p];if(!m)continue;const y=f[p]=f[p]||new Map;m.forEach(g=>{if(y.has(g))return;y.set(g,r.Started);let _=c(g);if(_){const b=this.opts.es5?e.varKinds.var:e.varKinds.const;h=(0,t._)`${h}${b} ${g} = ${_};${this.opts._n}`}else if(_=d==null?void 0:d(g))h=(0,t._)`${h}${_}${this.opts._n}`;else throw new n(g);y.set(g,r.Completed)})}return h}}e.ValueScope=a})(KP);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=Sy,n=KP;var r=Sy;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return r.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return r.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return r.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}});var i=KP;Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return i.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return i.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return i.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return i.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class s{optimizeNodes(){return this}optimizeNames(R,O){return this}}class o extends s{constructor(R,O,q){super(),this.varKind=R,this.name=O,this.rhs=q}render({es5:R,_n:O}){const q=R?n.varKinds.var:this.varKind,le=this.rhs===void 0?"":` = ${this.rhs}`;return`${q} ${this.name}${le};`+O}optimizeNames(R,O){if(R[this.name.str])return this.rhs&&(this.rhs=Y(this.rhs,R,O)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class a extends s{constructor(R,O,q){super(),this.lhs=R,this.rhs=O,this.sideEffects=q}render({_n:R}){return`${this.lhs} = ${this.rhs};`+R}optimizeNames(R,O){if(!(this.lhs instanceof t.Name&&!R[this.lhs.str]&&!this.sideEffects))return this.rhs=Y(this.rhs,R,O),this}get names(){const R=this.lhs instanceof t.Name?{}:{...this.lhs.names};return J(R,this.rhs)}}class u extends a{constructor(R,O,q,le){super(R,q,le),this.op=O}render({_n:R}){return`${this.lhs} ${this.op}= ${this.rhs};`+R}}class l extends s{constructor(R){super(),this.label=R,this.names={}}render({_n:R}){return`${this.label}:`+R}}class c extends s{constructor(R){super(),this.label=R,this.names={}}render({_n:R}){return`break${this.label?` ${this.label}`:""};`+R}}class f extends s{constructor(R){super(),this.error=R}render({_n:R}){return`throw ${this.error};`+R}get names(){return this.error.names}}class d extends s{constructor(R){super(),this.code=R}render({_n:R}){return`${this.code};`+R}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(R,O){return this.code=Y(this.code,R,O),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class h extends s{constructor(R=[]){super(),this.nodes=R}render(R){return this.nodes.reduce((O,q)=>O+q.render(R),"")}optimizeNodes(){const{nodes:R}=this;let O=R.length;for(;O--;){const q=R[O].optimizeNodes();Array.isArray(q)?R.splice(O,1,...q):q?R[O]=q:R.splice(O,1)}return R.length>0?this:void 0}optimizeNames(R,O){const{nodes:q}=this;let le=q.length;for(;le--;){const ae=q[le];ae.optimizeNames(R,O)||(ye(R,ae.names),q.splice(le,1))}return q.length>0?this:void 0}get names(){return this.nodes.reduce((R,O)=>H(R,O.names),{})}}class p extends h{render(R){return"{"+R._n+super.render(R)+"}"+R._n}}class m extends h{}class y extends p{}y.kind="else";class g extends p{constructor(R,O){super(O),this.condition=R}render(R){let O=`if(${this.condition})`+super.render(R);return this.else&&(O+="else "+this.else.render(R)),O}optimizeNodes(){super.optimizeNodes();const R=this.condition;if(R===!0)return this.nodes;let O=this.else;if(O){const q=O.optimizeNodes();O=this.else=Array.isArray(q)?new y(q):q}if(O)return R===!1?O instanceof g?O:O.nodes:this.nodes.length?this:new g(he(R),O instanceof g?[O]:O.nodes);if(!(R===!1||!this.nodes.length))return this}optimizeNames(R,O){var q;if(this.else=(q=this.else)===null||q===void 0?void 0:q.optimizeNames(R,O),!!(super.optimizeNames(R,O)||this.else))return this.condition=Y(this.condition,R,O),this}get names(){const R=super.names;return J(R,this.condition),this.else&&H(R,this.else.names),R}}g.kind="if";class _ extends p{}_.kind="for";class b extends _{constructor(R){super(),this.iteration=R}render(R){return`for(${this.iteration})`+super.render(R)}optimizeNames(R,O){if(super.optimizeNames(R,O))return this.iteration=Y(this.iteration,R,O),this}get names(){return H(super.names,this.iteration.names)}}class T extends _{constructor(R,O,q,le){super(),this.varKind=R,this.name=O,this.from=q,this.to=le}render(R){const O=R.es5?n.varKinds.var:this.varKind,{name:q,from:le,to:ae}=this;return`for(${O} ${q}=${le}; ${q}<${ae}; ${q}++)`+super.render(R)}get names(){const R=J(super.names,this.from);return J(R,this.to)}}class I extends _{constructor(R,O,q,le){super(),this.loop=R,this.varKind=O,this.name=q,this.iterable=le}render(R){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(R)}optimizeNames(R,O){if(super.optimizeNames(R,O))return this.iterable=Y(this.iterable,R,O),this}get names(){return H(super.names,this.iterable.names)}}class E extends p{constructor(R,O,q){super(),this.name=R,this.args=O,this.async=q}render(R){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(R)}}E.kind="func";class S extends h{render(R){return"return "+super.render(R)}}S.kind="return";class A extends p{render(R){let O="try"+super.render(R);return this.catch&&(O+=this.catch.render(R)),this.finally&&(O+=this.finally.render(R)),O}optimizeNodes(){var R,O;return super.optimizeNodes(),(R=this.catch)===null||R===void 0||R.optimizeNodes(),(O=this.finally)===null||O===void 0||O.optimizeNodes(),this}optimizeNames(R,O){var q,le;return super.optimizeNames(R,O),(q=this.catch)===null||q===void 0||q.optimizeNames(R,O),(le=this.finally)===null||le===void 0||le.optimizeNames(R,O),this}get names(){const R=super.names;return this.catch&&H(R,this.catch.names),this.finally&&H(R,this.finally.names),R}}class P extends p{constructor(R){super(),this.error=R}render(R){return`catch(${this.error})`+super.render(R)}}P.kind="catch";class V extends p{render(R){return"finally"+super.render(R)}}V.kind="finally";class M{constructor(R,O={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...O,_n:O.lines?` +`:""},this._extScope=R,this._scope=new n.Scope({parent:R}),this._nodes=[new m]}toString(){return this._root.render(this.opts)}name(R){return this._scope.name(R)}scopeName(R){return this._extScope.name(R)}scopeValue(R,O){const q=this._extScope.value(R,O);return(this._values[q.prefix]||(this._values[q.prefix]=new Set)).add(q),q}getScopeValue(R,O){return this._extScope.getValue(R,O)}scopeRefs(R){return this._extScope.scopeRefs(R,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(R,O,q,le){const ae=this._scope.toName(O);return q!==void 0&&le&&(this._constants[ae.str]=q),this._leafNode(new o(R,ae,q)),ae}const(R,O,q){return this._def(n.varKinds.const,R,O,q)}let(R,O,q){return this._def(n.varKinds.let,R,O,q)}var(R,O,q){return this._def(n.varKinds.var,R,O,q)}assign(R,O,q){return this._leafNode(new a(R,O,q))}add(R,O){return this._leafNode(new u(R,e.operators.ADD,O))}code(R){return typeof R=="function"?R():R!==t.nil&&this._leafNode(new d(R)),this}object(...R){const O=["{"];for(const[q,le]of R)O.length>1&&O.push(","),O.push(q),(q!==le||this.opts.es5)&&(O.push(":"),(0,t.addCodeArg)(O,le));return O.push("}"),new t._Code(O)}if(R,O,q){if(this._blockNode(new g(R)),O&&q)this.code(O).else().code(q).endIf();else if(O)this.code(O).endIf();else if(q)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(R){return this._elseNode(new g(R))}else(){return this._elseNode(new y)}endIf(){return this._endBlockNode(g,y)}_for(R,O){return this._blockNode(R),O&&this.code(O).endFor(),this}for(R,O){return this._for(new b(R),O)}forRange(R,O,q,le,ae=this.opts.es5?n.varKinds.var:n.varKinds.let){const pe=this._scope.toName(R);return this._for(new T(ae,pe,O,q),()=>le(pe))}forOf(R,O,q,le=n.varKinds.const){const ae=this._scope.toName(R);if(this.opts.es5){const pe=O instanceof t.Name?O:this.var("_arr",O);return this.forRange("_i",0,(0,t._)`${pe}.length`,me=>{this.var(ae,(0,t._)`${pe}[${me}]`),q(ae)})}return this._for(new I("of",le,ae,O),()=>q(ae))}forIn(R,O,q,le=this.opts.es5?n.varKinds.var:n.varKinds.const){if(this.opts.ownProperties)return this.forOf(R,(0,t._)`Object.keys(${O})`,q);const ae=this._scope.toName(R);return this._for(new I("in",le,ae,O),()=>q(ae))}endFor(){return this._endBlockNode(_)}label(R){return this._leafNode(new l(R))}break(R){return this._leafNode(new c(R))}return(R){const O=new S;if(this._blockNode(O),this.code(R),O.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(S)}try(R,O,q){if(!O&&!q)throw new Error('CodeGen: "try" without "catch" and "finally"');const le=new A;if(this._blockNode(le),this.code(R),O){const ae=this.name("e");this._currNode=le.catch=new P(ae),O(ae)}return q&&(this._currNode=le.finally=new V,this.code(q)),this._endBlockNode(P,V)}throw(R){return this._leafNode(new f(R))}block(R,O){return this._blockStarts.push(this._nodes.length),R&&this.code(R).endBlock(O),this}endBlock(R){const O=this._blockStarts.pop();if(O===void 0)throw new Error("CodeGen: not in self-balancing block");const q=this._nodes.length-O;if(q<0||R!==void 0&&q!==R)throw new Error(`CodeGen: wrong number of nodes: ${q} vs ${R} expected`);return this._nodes.length=O,this}func(R,O=t.nil,q,le){return this._blockNode(new E(R,O,q)),le&&this.code(le).endFunc(),this}endFunc(){return this._endBlockNode(E)}optimize(R=1){for(;R-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(R){return this._currNode.nodes.push(R),this}_blockNode(R){this._currNode.nodes.push(R),this._nodes.push(R)}_endBlockNode(R,O){const q=this._currNode;if(q instanceof R||O&&q instanceof O)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${O?`${R.kind}/${O.kind}`:R.kind}"`)}_elseNode(R){const O=this._currNode;if(!(O instanceof g))throw new Error('CodeGen: "else" without "if"');return this._currNode=O.else=R,this}get _root(){return this._nodes[0]}get _currNode(){const R=this._nodes;return R[R.length-1]}set _currNode(R){const O=this._nodes;O[O.length-1]=R}}e.CodeGen=M;function H(z,R){for(const O in R)z[O]=(z[O]||0)+(R[O]||0);return z}function J(z,R){return R instanceof t._CodeOrName?H(z,R.names):z}function Y(z,R,O){if(z instanceof t.Name)return q(z);if(!le(z))return z;return new t._Code(z._items.reduce((ae,pe)=>(pe instanceof t.Name&&(pe=q(pe)),pe instanceof t._Code?ae.push(...pe._items):ae.push(pe),ae),[]));function q(ae){const pe=O[ae.str];return pe===void 0||R[ae.str]!==1?ae:(delete R[ae.str],pe)}function le(ae){return ae instanceof t._Code&&ae._items.some(pe=>pe instanceof t.Name&&R[pe.str]===1&&O[pe.str]!==void 0)}}function ye(z,R){for(const O in R)z[O]=(z[O]||0)-(R[O]||0)}function he(z){return typeof z=="boolean"||typeof z=="number"||z===null?!z:(0,t._)`!${C(z)}`}e.not=he;const ve=x(e.operators.AND);function te(...z){return z.reduce(ve)}e.and=te;const se=x(e.operators.OR);function K(...z){return z.reduce(se)}e.or=K;function x(z){return(R,O)=>R===t.nil?O:O===t.nil?R:(0,t._)`${C(R)} ${z} ${C(O)}`}function C(z){return z instanceof t.Name?z:(0,t._)`(${z})`}})(Yt);var pn={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.checkStrictMode=e.getErrorPath=e.Type=e.useFunc=e.setEvaluated=e.evaluatedPropsToName=e.mergeEvaluated=e.eachItem=e.unescapeJsonPointer=e.escapeJsonPointer=e.escapeFragment=e.unescapeFragment=e.schemaRefOrVal=e.schemaHasRulesButRef=e.schemaHasRules=e.checkUnknownRules=e.alwaysValidSchema=e.toHash=void 0;const t=Yt,n=Sy;function r(E){const S={};for(const A of E)S[A]=!0;return S}e.toHash=r;function i(E,S){return typeof S=="boolean"?S:Object.keys(S).length===0?!0:(s(E,S),!o(S,E.self.RULES.all))}e.alwaysValidSchema=i;function s(E,S=E.schema){const{opts:A,self:P}=E;if(!A.strictSchema||typeof S=="boolean")return;const V=P.RULES.keywords;for(const M in S)V[M]||I(E,`unknown keyword: "${M}"`)}e.checkUnknownRules=s;function o(E,S){if(typeof E=="boolean")return!E;for(const A in E)if(S[A])return!0;return!1}e.schemaHasRules=o;function a(E,S){if(typeof E=="boolean")return!E;for(const A in E)if(A!=="$ref"&&S.all[A])return!0;return!1}e.schemaHasRulesButRef=a;function u({topSchemaRef:E,schemaPath:S},A,P,V){if(!V){if(typeof A=="number"||typeof A=="boolean")return A;if(typeof A=="string")return(0,t._)`${A}`}return(0,t._)`${E}${S}${(0,t.getProperty)(P)}`}e.schemaRefOrVal=u;function l(E){return d(decodeURIComponent(E))}e.unescapeFragment=l;function c(E){return encodeURIComponent(f(E))}e.escapeFragment=c;function f(E){return typeof E=="number"?`${E}`:E.replace(/~/g,"~0").replace(/\//g,"~1")}e.escapeJsonPointer=f;function d(E){return E.replace(/~1/g,"/").replace(/~0/g,"~")}e.unescapeJsonPointer=d;function h(E,S){if(Array.isArray(E))for(const A of E)S(A);else S(E)}e.eachItem=h;function p({mergeNames:E,mergeToName:S,mergeValues:A,resultToName:P}){return(V,M,H,J)=>{const Y=H===void 0?M:H instanceof t.Name?(M instanceof t.Name?E(V,M,H):S(V,M,H),H):M instanceof t.Name?(S(V,H,M),M):A(M,H);return J===t.Name&&!(Y instanceof t.Name)?P(V,Y):Y}}e.mergeEvaluated={props:p({mergeNames:(E,S,A)=>E.if((0,t._)`${A} !== true && ${S} !== undefined`,()=>{E.if((0,t._)`${S} === true`,()=>E.assign(A,!0),()=>E.assign(A,(0,t._)`${A} || {}`).code((0,t._)`Object.assign(${A}, ${S})`))}),mergeToName:(E,S,A)=>E.if((0,t._)`${A} !== true`,()=>{S===!0?E.assign(A,!0):(E.assign(A,(0,t._)`${A} || {}`),y(E,A,S))}),mergeValues:(E,S)=>E===!0?!0:{...E,...S},resultToName:m}),items:p({mergeNames:(E,S,A)=>E.if((0,t._)`${A} !== true && ${S} !== undefined`,()=>E.assign(A,(0,t._)`${S} === true ? true : ${A} > ${S} ? ${A} : ${S}`)),mergeToName:(E,S,A)=>E.if((0,t._)`${A} !== true`,()=>E.assign(A,S===!0?!0:(0,t._)`${A} > ${S} ? ${A} : ${S}`)),mergeValues:(E,S)=>E===!0?!0:Math.max(E,S),resultToName:(E,S)=>E.var("items",S)})};function m(E,S){if(S===!0)return E.var("props",!0);const A=E.var("props",(0,t._)`{}`);return S!==void 0&&y(E,A,S),A}e.evaluatedPropsToName=m;function y(E,S,A){Object.keys(A).forEach(P=>E.assign((0,t._)`${S}${(0,t.getProperty)(P)}`,!0))}e.setEvaluated=y;const g={};function _(E,S){return E.scopeValue("func",{ref:S,code:g[S.code]||(g[S.code]=new n._Code(S.code))})}e.useFunc=_;var b;(function(E){E[E.Num=0]="Num",E[E.Str=1]="Str"})(b=e.Type||(e.Type={}));function T(E,S,A){if(E instanceof t.Name){const P=S===b.Num;return A?P?(0,t._)`"[" + ${E} + "]"`:(0,t._)`"['" + ${E} + "']"`:P?(0,t._)`"/" + ${E}`:(0,t._)`"/" + ${E}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return A?(0,t.getProperty)(E).toString():"/"+f(E)}e.getErrorPath=T;function I(E,S,A=E.opts.strictSchema){if(A){if(S=`strict mode: ${S}`,A===!0)throw new Error(S);E.self.logger.warn(S)}}e.checkStrictMode=I})(pn);var ju={};Object.defineProperty(ju,"__esModule",{value:!0});const ji=Yt,XAe={data:new ji.Name("data"),valCxt:new ji.Name("valCxt"),instancePath:new ji.Name("instancePath"),parentData:new ji.Name("parentData"),parentDataProperty:new ji.Name("parentDataProperty"),rootData:new ji.Name("rootData"),dynamicAnchors:new ji.Name("dynamicAnchors"),vErrors:new ji.Name("vErrors"),errors:new ji.Name("errors"),this:new ji.Name("this"),self:new ji.Name("self"),scope:new ji.Name("scope"),json:new ji.Name("json"),jsonPos:new ji.Name("jsonPos"),jsonLen:new ji.Name("jsonLen"),jsonPart:new ji.Name("jsonPart")};ju.default=XAe;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=Yt,n=pn,r=ju;e.keywordError={message:({keyword:y})=>(0,t.str)`must pass "${y}" keyword validation`},e.keyword$DataError={message:({keyword:y,schemaType:g})=>g?(0,t.str)`"${y}" keyword must be ${g} ($data)`:(0,t.str)`"${y}" keyword is invalid ($data)`};function i(y,g=e.keywordError,_,b){const{it:T}=y,{gen:I,compositeRule:E,allErrors:S}=T,A=f(y,g,_);b??(E||S)?u(I,A):l(T,(0,t._)`[${A}]`)}e.reportError=i;function s(y,g=e.keywordError,_){const{it:b}=y,{gen:T,compositeRule:I,allErrors:E}=b,S=f(y,g,_);u(T,S),I||E||l(b,r.default.vErrors)}e.reportExtraError=s;function o(y,g){y.assign(r.default.errors,g),y.if((0,t._)`${r.default.vErrors} !== null`,()=>y.if(g,()=>y.assign((0,t._)`${r.default.vErrors}.length`,g),()=>y.assign(r.default.vErrors,null)))}e.resetErrorsCount=o;function a({gen:y,keyword:g,schemaValue:_,data:b,errsCount:T,it:I}){if(T===void 0)throw new Error("ajv implementation error");const E=y.name("err");y.forRange("i",T,r.default.errors,S=>{y.const(E,(0,t._)`${r.default.vErrors}[${S}]`),y.if((0,t._)`${E}.instancePath === undefined`,()=>y.assign((0,t._)`${E}.instancePath`,(0,t.strConcat)(r.default.instancePath,I.errorPath))),y.assign((0,t._)`${E}.schemaPath`,(0,t.str)`${I.errSchemaPath}/${g}`),I.opts.verbose&&(y.assign((0,t._)`${E}.schema`,_),y.assign((0,t._)`${E}.data`,b))})}e.extendErrors=a;function u(y,g){const _=y.const("err",g);y.if((0,t._)`${r.default.vErrors} === null`,()=>y.assign(r.default.vErrors,(0,t._)`[${_}]`),(0,t._)`${r.default.vErrors}.push(${_})`),y.code((0,t._)`${r.default.errors}++`)}function l(y,g){const{gen:_,validateName:b,schemaEnv:T}=y;T.$async?_.throw((0,t._)`new ${y.ValidationError}(${g})`):(_.assign((0,t._)`${b}.errors`,g),_.return(!1))}const c={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function f(y,g,_){const{createErrors:b}=y.it;return b===!1?(0,t._)`{}`:d(y,g,_)}function d(y,g,_={}){const{gen:b,it:T}=y,I=[h(T,_),p(y,_)];return m(y,g,I),b.object(...I)}function h({errorPath:y},{instancePath:g}){const _=g?(0,t.str)`${y}${(0,n.getErrorPath)(g,n.Type.Str)}`:y;return[r.default.instancePath,(0,t.strConcat)(r.default.instancePath,_)]}function p({keyword:y,it:{errSchemaPath:g}},{schemaPath:_,parentSchema:b}){let T=b?g:(0,t.str)`${g}/${y}`;return _&&(T=(0,t.str)`${T}${(0,n.getErrorPath)(_,n.Type.Str)}`),[c.schemaPath,T]}function m(y,{params:g,message:_},b){const{keyword:T,data:I,schemaValue:E,it:S}=y,{opts:A,propertyName:P,topSchemaRef:V,schemaPath:M}=S;b.push([c.keyword,T],[c.params,typeof g=="function"?g(y):g||(0,t._)`{}`]),A.messages&&b.push([c.message,typeof _=="function"?_(y):_]),A.verbose&&b.push([c.schema,E],[c.parentSchema,(0,t._)`${V}${M}`],[r.default.data,I]),P&&b.push([c.propertyName,P])}})(O_);Object.defineProperty(em,"__esModule",{value:!0});em.boolOrEmptySchema=em.topBoolOrEmptySchema=void 0;const JAe=O_,ZAe=Yt,eOe=ju,tOe={message:"boolean schema is false"};function nOe(e){const{gen:t,schema:n,validateName:r}=e;n===!1?_X(e,!1):typeof n=="object"&&n.$async===!0?t.return(eOe.default.data):(t.assign((0,ZAe._)`${r}.errors`,null),t.return(!0))}em.topBoolOrEmptySchema=nOe;function rOe(e,t){const{gen:n,schema:r}=e;r===!1?(n.var(t,!1),_X(e)):n.var(t,!0)}em.boolOrEmptySchema=rOe;function _X(e,t){const{gen:n,data:r}=e,i={gen:n,keyword:"false schema",data:r,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,JAe.reportError)(i,tOe,void 0,t)}var P_={},Dd={};Object.defineProperty(Dd,"__esModule",{value:!0});Dd.getRules=Dd.isJSONType=void 0;const iOe=["string","number","integer","boolean","null","object","array"],sOe=new Set(iOe);function oOe(e){return typeof e=="string"&&sOe.has(e)}Dd.isJSONType=oOe;function aOe(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}Dd.getRules=aOe;var ml={};Object.defineProperty(ml,"__esModule",{value:!0});ml.shouldUseRule=ml.shouldUseGroup=ml.schemaHasRulesForType=void 0;function uOe({schema:e,self:t},n){const r=t.RULES.types[n];return r&&r!==!0&&vX(e,r)}ml.schemaHasRulesForType=uOe;function vX(e,t){return t.rules.some(n=>bX(e,n))}ml.shouldUseGroup=vX;function bX(e,t){var n;return e[t.keyword]!==void 0||((n=t.definition.implements)===null||n===void 0?void 0:n.some(r=>e[r]!==void 0))}ml.shouldUseRule=bX;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.reportTypeError=e.checkDataTypes=e.checkDataType=e.coerceAndCheckDataType=e.getJSONTypes=e.getSchemaTypes=e.DataType=void 0;const t=Dd,n=ml,r=O_,i=Yt,s=pn;var o;(function(b){b[b.Correct=0]="Correct",b[b.Wrong=1]="Wrong"})(o=e.DataType||(e.DataType={}));function a(b){const T=u(b.type);if(T.includes("null")){if(b.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!T.length&&b.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');b.nullable===!0&&T.push("null")}return T}e.getSchemaTypes=a;function u(b){const T=Array.isArray(b)?b:b?[b]:[];if(T.every(t.isJSONType))return T;throw new Error("type must be JSONType or JSONType[]: "+T.join(","))}e.getJSONTypes=u;function l(b,T){const{gen:I,data:E,opts:S}=b,A=f(T,S.coerceTypes),P=T.length>0&&!(A.length===0&&T.length===1&&(0,n.schemaHasRulesForType)(b,T[0]));if(P){const V=m(T,E,S.strictNumbers,o.Wrong);I.if(V,()=>{A.length?d(b,T,A):g(b)})}return P}e.coerceAndCheckDataType=l;const c=new Set(["string","number","integer","boolean","null"]);function f(b,T){return T?b.filter(I=>c.has(I)||T==="array"&&I==="array"):[]}function d(b,T,I){const{gen:E,data:S,opts:A}=b,P=E.let("dataType",(0,i._)`typeof ${S}`),V=E.let("coerced",(0,i._)`undefined`);A.coerceTypes==="array"&&E.if((0,i._)`${P} == 'object' && Array.isArray(${S}) && ${S}.length == 1`,()=>E.assign(S,(0,i._)`${S}[0]`).assign(P,(0,i._)`typeof ${S}`).if(m(T,S,A.strictNumbers),()=>E.assign(V,S))),E.if((0,i._)`${V} !== undefined`);for(const H of I)(c.has(H)||H==="array"&&A.coerceTypes==="array")&&M(H);E.else(),g(b),E.endIf(),E.if((0,i._)`${V} !== undefined`,()=>{E.assign(S,V),h(b,V)});function M(H){switch(H){case"string":E.elseIf((0,i._)`${P} == "number" || ${P} == "boolean"`).assign(V,(0,i._)`"" + ${S}`).elseIf((0,i._)`${S} === null`).assign(V,(0,i._)`""`);return;case"number":E.elseIf((0,i._)`${P} == "boolean" || ${S} === null || (${P} == "string" && ${S} && ${S} == +${S})`).assign(V,(0,i._)`+${S}`);return;case"integer":E.elseIf((0,i._)`${P} === "boolean" || ${S} === null || (${P} === "string" && ${S} && ${S} == +${S} && !(${S} % 1))`).assign(V,(0,i._)`+${S}`);return;case"boolean":E.elseIf((0,i._)`${S} === "false" || ${S} === 0 || ${S} === null`).assign(V,!1).elseIf((0,i._)`${S} === "true" || ${S} === 1`).assign(V,!0);return;case"null":E.elseIf((0,i._)`${S} === "" || ${S} === 0 || ${S} === false`),E.assign(V,null);return;case"array":E.elseIf((0,i._)`${P} === "string" || ${P} === "number" - || ${P} === "boolean" || ${S} === null`).assign(V,(0,i._)`[${S}]`)}}}function h({gen:b,parentData:T,parentDataProperty:I},E){b.if((0,i._)`${T} !== undefined`,()=>b.assign((0,i._)`${T}[${I}]`,E))}function p(b,T,I,E=o.Correct){const S=E===o.Correct?i.operators.EQ:i.operators.NEQ;let A;switch(b){case"null":return(0,i._)`${T} ${S} null`;case"array":A=(0,i._)`Array.isArray(${T})`;break;case"object":A=(0,i._)`${T} && typeof ${T} == "object" && !Array.isArray(${T})`;break;case"integer":A=P((0,i._)`!(${T} % 1) && !isNaN(${T})`);break;case"number":A=P();break;default:return(0,i._)`typeof ${T} ${S} ${b}`}return E===o.Correct?A:(0,i.not)(A);function P(V=i.nil){return(0,i.and)((0,i._)`typeof ${T} == "number"`,V,I?(0,i._)`isFinite(${T})`:i.nil)}}e.checkDataType=p;function m(b,T,I,E){if(b.length===1)return p(b[0],T,I,E);let S;const A=(0,s.toHash)(b);if(A.array&&A.object){const P=(0,i._)`typeof ${T} != "object"`;S=A.null?P:(0,i._)`!${T} || ${P}`,delete A.null,delete A.array,delete A.object}else S=i.nil;A.number&&delete A.integer;for(const P in A)S=(0,i.and)(S,p(P,T,I,E));return S}e.checkDataTypes=m;const y={message:({schema:b})=>`must be ${b}`,params:({schema:b,schemaValue:T})=>typeof b=="string"?(0,i._)`{type: ${b}}`:(0,i._)`{type: ${T}}`};function g(b){const T=_(b);(0,r.reportError)(T,y)}e.reportTypeError=g;function _(b){const{gen:T,data:I,schema:E}=b,S=(0,s.schemaRefOrVal)(b,E,"type");return{gen:T,keyword:"type",data:I,schema:E.type,schemaCode:S,schemaValue:S,parentSchema:E,params:{},it:b}}})(P_);var dI={};Object.defineProperty(dI,"__esModule",{value:!0});dI.assignDefaults=void 0;const bh=Yt,lOe=pn;function cOe(e,t){const{properties:n,items:r}=e.schema;if(t==="object"&&n)for(const i in n)a9(e,i,n[i].default);else t==="array"&&Array.isArray(r)&&r.forEach((i,s)=>a9(e,s,i.default))}dI.assignDefaults=cOe;function a9(e,t,n){const{gen:r,compositeRule:i,data:s,opts:o}=e;if(n===void 0)return;const a=(0,bh._)`${s}${(0,bh.getProperty)(t)}`;if(i){(0,lOe.checkStrictMode)(e,`default is ignored for: ${a}`);return}let u=(0,bh._)`${a} === undefined`;o.useDefaults==="empty"&&(u=(0,bh._)`${u} || ${a} === null || ${a} === ""`),r.if(u,(0,bh._)`${a} = ${(0,bh.stringify)(n)}`)}var uu={},qt={};Object.defineProperty(qt,"__esModule",{value:!0});qt.validateUnion=qt.validateArray=qt.usePattern=qt.callValidateCode=qt.schemaProperties=qt.allSchemaProperties=qt.noPropertyInData=qt.propertyInData=qt.isOwnProperty=qt.hasPropFunc=qt.reportMissingProp=qt.checkMissingProp=qt.checkReportMissingProp=void 0;const Xn=Yt,Bk=pn,Zl=ju,fOe=pn;function dOe(e,t){const{gen:n,data:r,it:i}=e;n.if(Uk(n,r,t,i.opts.ownProperties),()=>{e.setParams({missingProperty:(0,Xn._)`${t}`},!0),e.error()})}qt.checkReportMissingProp=dOe;function hOe({gen:e,data:t,it:{opts:n}},r,i){return(0,Xn.or)(...r.map(s=>(0,Xn.and)(Uk(e,t,s,n.ownProperties),(0,Xn._)`${i} = ${s}`)))}qt.checkMissingProp=hOe;function pOe(e,t){e.setParams({missingProperty:t},!0),e.error()}qt.reportMissingProp=pOe;function wX(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Xn._)`Object.prototype.hasOwnProperty`})}qt.hasPropFunc=wX;function jk(e,t,n){return(0,Xn._)`${wX(e)}.call(${t}, ${n})`}qt.isOwnProperty=jk;function mOe(e,t,n,r){const i=(0,Xn._)`${t}${(0,Xn.getProperty)(n)} !== undefined`;return r?(0,Xn._)`${i} && ${jk(e,t,n)}`:i}qt.propertyInData=mOe;function Uk(e,t,n,r){const i=(0,Xn._)`${t}${(0,Xn.getProperty)(n)} === undefined`;return r?(0,Xn.or)(i,(0,Xn.not)(jk(e,t,n))):i}qt.noPropertyInData=Uk;function TX(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}qt.allSchemaProperties=TX;function gOe(e,t){return TX(t).filter(n=>!(0,Bk.alwaysValidSchema)(e,t[n]))}qt.schemaProperties=gOe;function yOe({schemaCode:e,data:t,it:{gen:n,topSchemaRef:r,schemaPath:i,errorPath:s},it:o},a,u,l){const c=l?(0,Xn._)`${e}, ${t}, ${r}${i}`:t,f=[[Zl.default.instancePath,(0,Xn.strConcat)(Zl.default.instancePath,s)],[Zl.default.parentData,o.parentData],[Zl.default.parentDataProperty,o.parentDataProperty],[Zl.default.rootData,Zl.default.rootData]];o.opts.dynamicRef&&f.push([Zl.default.dynamicAnchors,Zl.default.dynamicAnchors]);const d=(0,Xn._)`${c}, ${n.object(...f)}`;return u!==Xn.nil?(0,Xn._)`${a}.call(${u}, ${d})`:(0,Xn._)`${a}(${d})`}qt.callValidateCode=yOe;const _Oe=(0,Xn._)`new RegExp`;function vOe({gen:e,it:{opts:t}},n){const r=t.unicodeRegExp?"u":"",{regExp:i}=t.code,s=i(n,r);return e.scopeValue("pattern",{key:s.toString(),ref:s,code:(0,Xn._)`${i.code==="new RegExp"?_Oe:(0,fOe.useFunc)(e,i)}(${n}, ${r})`})}qt.usePattern=vOe;function bOe(e){const{gen:t,data:n,keyword:r,it:i}=e,s=t.name("valid");if(i.allErrors){const a=t.let("valid",!0);return o(()=>t.assign(a,!1)),a}return t.var(s,!0),o(()=>t.break()),s;function o(a){const u=t.const("len",(0,Xn._)`${n}.length`);t.forRange("i",0,u,l=>{e.subschema({keyword:r,dataProp:l,dataPropType:Bk.Type.Num},s),t.if((0,Xn.not)(s),a)})}}qt.validateArray=bOe;function EOe(e){const{gen:t,schema:n,keyword:r,it:i}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");if(n.some(u=>(0,Bk.alwaysValidSchema)(i,u))&&!i.opts.unevaluated)return;const o=t.let("valid",!1),a=t.name("_valid");t.block(()=>n.forEach((u,l)=>{const c=e.subschema({keyword:r,schemaProp:l,compositeRule:!0},a);t.assign(o,(0,Xn._)`${o} || ${a}`),e.mergeValidEvaluated(c,a)||t.if((0,Xn.not)(o))})),e.result(o,()=>e.reset(),()=>e.error(!0))}qt.validateUnion=EOe;Object.defineProperty(uu,"__esModule",{value:!0});uu.validateKeywordUsage=uu.validSchemaType=uu.funcKeywordCode=uu.macroKeywordCode=void 0;const as=Yt,Hf=ju,wOe=qt,TOe=O_;function SOe(e,t){const{gen:n,keyword:r,schema:i,parentSchema:s,it:o}=e,a=t.macro.call(o.self,i,s,o),u=SX(n,r,a);o.opts.validateSchema!==!1&&o.self.validateSchema(a,!0);const l=n.name("valid");e.subschema({schema:a,schemaPath:as.nil,errSchemaPath:`${o.errSchemaPath}/${r}`,topSchemaRef:u,compositeRule:!0},l),e.pass(l,()=>e.error(!0))}uu.macroKeywordCode=SOe;function IOe(e,t){var n;const{gen:r,keyword:i,schema:s,parentSchema:o,$data:a,it:u}=e;COe(u,t);const l=!a&&t.compile?t.compile.call(u.self,s,o,u):t.validate,c=SX(r,i,l),f=r.let("valid");e.block$data(f,d),e.ok((n=t.valid)!==null&&n!==void 0?n:f);function d(){if(t.errors===!1)m(),t.modifying&&u9(e),y(()=>e.error());else{const g=t.async?h():p();t.modifying&&u9(e),y(()=>xOe(e,g))}}function h(){const g=r.let("ruleErrs",null);return r.try(()=>m((0,as._)`await `),_=>r.assign(f,!1).if((0,as._)`${_} instanceof ${u.ValidationError}`,()=>r.assign(g,(0,as._)`${_}.errors`),()=>r.throw(_))),g}function p(){const g=(0,as._)`${c}.errors`;return r.assign(g,null),m(as.nil),g}function m(g=t.async?(0,as._)`await `:as.nil){const _=u.opts.passContext?Hf.default.this:Hf.default.self,b=!("compile"in t&&!a||t.schema===!1);r.assign(f,(0,as._)`${g}${(0,wOe.callValidateCode)(e,c,_,b)}`,t.modifying)}function y(g){var _;r.if((0,as.not)((_=t.valid)!==null&&_!==void 0?_:f),g)}}uu.funcKeywordCode=IOe;function u9(e){const{gen:t,data:n,it:r}=e;t.if(r.parentData,()=>t.assign(n,(0,as._)`${r.parentData}[${r.parentDataProperty}]`))}function xOe(e,t){const{gen:n}=e;n.if((0,as._)`Array.isArray(${t})`,()=>{n.assign(Hf.default.vErrors,(0,as._)`${Hf.default.vErrors} === null ? ${t} : ${Hf.default.vErrors}.concat(${t})`).assign(Hf.default.errors,(0,as._)`${Hf.default.vErrors}.length`),(0,TOe.extendErrors)(e)},()=>e.error())}function COe({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}function SX(e,t,n){if(n===void 0)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof n=="function"?{ref:n}:{ref:n,code:(0,as.stringify)(n)})}function AOe(e,t,n=!1){return!t.length||t.some(r=>r==="array"?Array.isArray(e):r==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==r||n&&typeof e>"u")}uu.validSchemaType=AOe;function OOe({schema:e,opts:t,self:n,errSchemaPath:r},i,s){if(Array.isArray(i.keyword)?!i.keyword.includes(s):i.keyword!==s)throw new Error("ajv implementation error");const o=i.dependencies;if(o!=null&&o.some(a=>!Object.prototype.hasOwnProperty.call(e,a)))throw new Error(`parent schema must have dependencies of ${s}: ${o.join(",")}`);if(i.validateSchema&&!i.validateSchema(e[s])){const u=`keyword "${s}" value is invalid at path "${r}": `+n.errorsText(i.validateSchema.errors);if(t.validateSchema==="log")n.logger.error(u);else throw new Error(u)}}uu.validateKeywordUsage=OOe;var jc={};Object.defineProperty(jc,"__esModule",{value:!0});jc.extendSubschemaMode=jc.extendSubschemaData=jc.getSubschema=void 0;const Ja=Yt,IX=pn;function POe(e,{keyword:t,schemaProp:n,schema:r,schemaPath:i,errSchemaPath:s,topSchemaRef:o}){if(t!==void 0&&r!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){const a=e.schema[t];return n===void 0?{schema:a,schemaPath:(0,Ja._)`${e.schemaPath}${(0,Ja.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:a[n],schemaPath:(0,Ja._)`${e.schemaPath}${(0,Ja.getProperty)(t)}${(0,Ja.getProperty)(n)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,IX.escapeFragment)(n)}`}}if(r!==void 0){if(i===void 0||s===void 0||o===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:r,schemaPath:i,topSchemaRef:o,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}jc.getSubschema=POe;function ROe(e,t,{dataProp:n,dataPropType:r,data:i,dataTypes:s,propertyName:o}){if(i!==void 0&&n!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:a}=t;if(n!==void 0){const{errorPath:l,dataPathArr:c,opts:f}=t,d=a.let("data",(0,Ja._)`${t.data}${(0,Ja.getProperty)(n)}`,!0);u(d),e.errorPath=(0,Ja.str)`${l}${(0,IX.getErrorPath)(n,r,f.jsPropertySyntax)}`,e.parentDataProperty=(0,Ja._)`${n}`,e.dataPathArr=[...c,e.parentDataProperty]}if(i!==void 0){const l=i instanceof Ja.Name?i:a.let("data",i,!0);u(l),o!==void 0&&(e.propertyName=o)}s&&(e.dataTypes=s);function u(l){e.data=l,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,l]}}jc.extendSubschemaData=ROe;function NOe(e,{jtdDiscriminator:t,jtdMetadata:n,compositeRule:r,createErrors:i,allErrors:s}){r!==void 0&&(e.compositeRule=r),i!==void 0&&(e.createErrors=i),s!==void 0&&(e.allErrors=s),e.jtdDiscriminator=t,e.jtdMetadata=n}jc.extendSubschemaMode=NOe;var Ai={},Vk=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var r,i,s;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(s=Object.keys(t),r=s.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,s[i]))return!1;for(i=r;i--!==0;){var o=s[i];if(!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n};const l9=ka(Vk);var xX={exports:{}},Ic=xX.exports=function(e,t,n){typeof t=="function"&&(n=t,t={}),n=t.cb||n;var r=typeof n=="function"?n:n.pre||function(){},i=n.post||function(){};nb(t,r,i,e,"",e)};Ic.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Ic.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Ic.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Ic.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function nb(e,t,n,r,i,s,o,a,u,l){if(r&&typeof r=="object"&&!Array.isArray(r)){t(r,i,s,o,a,u,l);for(var c in r){var f=r[c];if(Array.isArray(f)){if(c in Ic.arrayKeywords)for(var d=0;dt+=CX(r)),t===1/0))return 1/0}return t}function AX(e,t="",n){n!==!1&&(t=_p(t));const r=e.parse(t);return OX(e,r)}Ai.getFullPath=AX;function OX(e,t){return e.serialize(t).split("#")[0]+"#"}Ai._getFullPath=OX;const UOe=/#\/?$/;function _p(e){return e?e.replace(UOe,""):""}Ai.normalizeId=_p;function VOe(e,t,n){return n=_p(n),e.resolve(t,n)}Ai.resolveUrl=VOe;const zOe=/^[a-z_][-a-z0-9._]*$/i;function HOe(e,t){if(typeof e=="boolean")return{};const{schemaId:n,uriResolver:r}=this.opts,i=_p(e[n]||t),s={"":i},o=AX(r,i,!1),a={},u=new Set;return MOe(e,{allKeys:!0},(f,d,h,p)=>{if(p===void 0)return;const m=o+d;let y=s[p];typeof f[n]=="string"&&(y=g.call(this,f[n])),_.call(this,f.$anchor),_.call(this,f.$dynamicAnchor),s[d]=y;function g(b){const T=this.opts.uriResolver.resolve;if(b=_p(y?T(y,b):b),u.has(b))throw c(b);u.add(b);let I=this.refs[b];return typeof I=="string"&&(I=this.refs[I]),typeof I=="object"?l(f,I.schema,b):b!==_p(m)&&(b[0]==="#"?(l(f,a[b],b),a[b]=f):this.refs[b]=m),b}function _(b){if(typeof b=="string"){if(!zOe.test(b))throw new Error(`invalid anchor "${b}"`);g.call(this,`#${b}`)}}}),a;function l(f,d,h){if(d!==void 0&&!LOe(f,d))throw c(h)}function c(f){return new Error(`reference "${f}" resolves to more than one schema`)}}Ai.getSchemaRefs=HOe;Object.defineProperty(Ia,"__esModule",{value:!0});Ia.getData=Ia.KeywordCxt=Ia.validateFunctionCode=void 0;const PX=em,c9=P_,zk=ml,jw=P_,WOe=dI,N0=uu,XC=jc,et=Yt,yt=ju,qOe=Ai,gl=pn,Rg=O_;function YOe(e){if(kX(e)&&(DX(e),NX(e))){QOe(e);return}RX(e,()=>(0,PX.topBoolOrEmptySchema)(e))}Ia.validateFunctionCode=YOe;function RX({gen:e,validateName:t,schema:n,schemaEnv:r,opts:i},s){i.code.es5?e.func(t,(0,et._)`${yt.default.data}, ${yt.default.valCxt}`,r.$async,()=>{e.code((0,et._)`"use strict"; ${f9(n,i)}`),KOe(e,i),e.code(s)}):e.func(t,(0,et._)`${yt.default.data}, ${GOe(i)}`,r.$async,()=>e.code(f9(n,i)).code(s))}function GOe(e){return(0,et._)`{${yt.default.instancePath}="", ${yt.default.parentData}, ${yt.default.parentDataProperty}, ${yt.default.rootData}=${yt.default.data}${e.dynamicRef?(0,et._)`, ${yt.default.dynamicAnchors}={}`:et.nil}}={}`}function KOe(e,t){e.if(yt.default.valCxt,()=>{e.var(yt.default.instancePath,(0,et._)`${yt.default.valCxt}.${yt.default.instancePath}`),e.var(yt.default.parentData,(0,et._)`${yt.default.valCxt}.${yt.default.parentData}`),e.var(yt.default.parentDataProperty,(0,et._)`${yt.default.valCxt}.${yt.default.parentDataProperty}`),e.var(yt.default.rootData,(0,et._)`${yt.default.valCxt}.${yt.default.rootData}`),t.dynamicRef&&e.var(yt.default.dynamicAnchors,(0,et._)`${yt.default.valCxt}.${yt.default.dynamicAnchors}`)},()=>{e.var(yt.default.instancePath,(0,et._)`""`),e.var(yt.default.parentData,(0,et._)`undefined`),e.var(yt.default.parentDataProperty,(0,et._)`undefined`),e.var(yt.default.rootData,yt.default.data),t.dynamicRef&&e.var(yt.default.dynamicAnchors,(0,et._)`{}`)})}function QOe(e){const{schema:t,opts:n,gen:r}=e;RX(e,()=>{n.$comment&&t.$comment&&LX(e),tPe(e),r.let(yt.default.vErrors,null),r.let(yt.default.errors,0),n.unevaluated&&XOe(e),$X(e),iPe(e)})}function XOe(e){const{gen:t,validateName:n}=e;e.evaluated=t.const("evaluated",(0,et._)`${n}.evaluated`),t.if((0,et._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,et._)`${e.evaluated}.props`,(0,et._)`undefined`)),t.if((0,et._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,et._)`${e.evaluated}.items`,(0,et._)`undefined`))}function f9(e,t){const n=typeof e=="object"&&e[t.schemaId];return n&&(t.code.source||t.code.process)?(0,et._)`/*# sourceURL=${n} */`:et.nil}function JOe(e,t){if(kX(e)&&(DX(e),NX(e))){ZOe(e,t);return}(0,PX.boolOrEmptySchema)(e,t)}function NX({schema:e,self:t}){if(typeof e=="boolean")return!e;for(const n in e)if(t.RULES.all[n])return!0;return!1}function kX(e){return typeof e.schema!="boolean"}function ZOe(e,t){const{schema:n,gen:r,opts:i}=e;i.$comment&&n.$comment&&LX(e),nPe(e),rPe(e);const s=r.const("_errs",yt.default.errors);$X(e,s),r.var(t,(0,et._)`${s} === ${yt.default.errors}`)}function DX(e){(0,gl.checkUnknownRules)(e),ePe(e)}function $X(e,t){if(e.opts.jtd)return d9(e,[],!1,t);const n=(0,c9.getSchemaTypes)(e.schema),r=(0,c9.coerceAndCheckDataType)(e,n);d9(e,n,!r,t)}function ePe(e){const{schema:t,errSchemaPath:n,opts:r,self:i}=e;t.$ref&&r.ignoreKeywordsWithRef&&(0,gl.schemaHasRulesButRef)(t,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${n}"`)}function tPe(e){const{schema:t,opts:n}=e;t.default!==void 0&&n.useDefaults&&n.strictSchema&&(0,gl.checkStrictMode)(e,"default is ignored in the schema root")}function nPe(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,qOe.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function rPe(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}function LX({gen:e,schemaEnv:t,schema:n,errSchemaPath:r,opts:i}){const s=n.$comment;if(i.$comment===!0)e.code((0,et._)`${yt.default.self}.logger.log(${s})`);else if(typeof i.$comment=="function"){const o=(0,et.str)`${r}/$comment`,a=e.scopeValue("root",{ref:t.root});e.code((0,et._)`${yt.default.self}.opts.$comment(${s}, ${o}, ${a}.schema)`)}}function iPe(e){const{gen:t,schemaEnv:n,validateName:r,ValidationError:i,opts:s}=e;n.$async?t.if((0,et._)`${yt.default.errors} === 0`,()=>t.return(yt.default.data),()=>t.throw((0,et._)`new ${i}(${yt.default.vErrors})`)):(t.assign((0,et._)`${r}.errors`,yt.default.vErrors),s.unevaluated&&sPe(e),t.return((0,et._)`${yt.default.errors} === 0`))}function sPe({gen:e,evaluated:t,props:n,items:r}){n instanceof et.Name&&e.assign((0,et._)`${t}.props`,n),r instanceof et.Name&&e.assign((0,et._)`${t}.items`,r)}function d9(e,t,n,r){const{gen:i,schema:s,data:o,allErrors:a,opts:u,self:l}=e,{RULES:c}=l;if(s.$ref&&(u.ignoreKeywordsWithRef||!(0,gl.schemaHasRulesButRef)(s,c))){i.block(()=>BX(e,"$ref",c.all.$ref.definition));return}u.jtd||oPe(e,t),i.block(()=>{for(const d of c.rules)f(d);f(c.post)});function f(d){(0,zk.shouldUseGroup)(s,d)&&(d.type?(i.if((0,jw.checkDataType)(d.type,o,u.strictNumbers)),h9(e,d),t.length===1&&t[0]===d.type&&n&&(i.else(),(0,jw.reportTypeError)(e)),i.endIf()):h9(e,d),a||i.if((0,et._)`${yt.default.errors} === ${r||0}`))}}function h9(e,t){const{gen:n,schema:r,opts:{useDefaults:i}}=e;i&&(0,WOe.assignDefaults)(e,t.type),n.block(()=>{for(const s of t.rules)(0,zk.shouldUseRule)(r,s)&&BX(e,s.keyword,s.definition,t.type)})}function oPe(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(aPe(e,t),e.opts.allowUnionTypes||uPe(e,t),lPe(e,e.dataTypes))}function aPe(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(n=>{MX(e.dataTypes,n)||Hk(e,`type "${n}" not allowed by context "${e.dataTypes.join(",")}"`)}),fPe(e,t)}}function uPe(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&Hk(e,"use allowUnionTypes to allow union type keyword")}function lPe(e,t){const n=e.self.RULES.all;for(const r in n){const i=n[r];if(typeof i=="object"&&(0,zk.shouldUseRule)(e.schema,i)){const{type:s}=i.definition;s.length&&!s.some(o=>cPe(t,o))&&Hk(e,`missing type "${s.join(",")}" for keyword "${r}"`)}}}function cPe(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function MX(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function fPe(e,t){const n=[];for(const r of e.dataTypes)MX(t,r)?n.push(r):t.includes("integer")&&r==="number"&&n.push("integer");e.dataTypes=n}function Hk(e,t){const n=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${n}" (strictTypes)`,(0,gl.checkStrictMode)(e,t,e.opts.strictTypes)}class FX{constructor(t,n,r){if((0,N0.validateKeywordUsage)(t,n,r),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=r,this.data=t.data,this.schema=t.schema[r],this.$data=n.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,gl.schemaRefOrVal)(t,this.schema,r,this.$data),this.schemaType=n.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=n,this.$data)this.schemaCode=t.gen.const("vSchema",jX(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,N0.validSchemaType)(this.schema,n.schemaType,n.allowUndefined))throw new Error(`${r} value must be ${JSON.stringify(n.schemaType)}`);("code"in n?n.trackErrors:n.errors!==!1)&&(this.errsCount=t.gen.const("_errs",yt.default.errors))}result(t,n,r){this.failResult((0,et.not)(t),n,r)}failResult(t,n,r){this.gen.if(t),r?r():this.error(),n?(this.gen.else(),n(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(t,n){this.failResult((0,et.not)(t),void 0,n)}fail(t){if(t===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(t),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);const{schemaCode:n}=this;this.fail((0,et._)`${n} !== undefined && (${(0,et.or)(this.invalid$data(),t)})`)}error(t,n,r){if(n){this.setParams(n),this._error(t,r),this.setParams({});return}this._error(t,r)}_error(t,n){(t?Rg.reportExtraError:Rg.reportError)(this,this.def.error,n)}$dataError(){(0,Rg.reportError)(this,this.def.$dataError||Rg.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Rg.resetErrorsCount)(this.gen,this.errsCount)}ok(t){this.allErrors||this.gen.if(t)}setParams(t,n){n?Object.assign(this.params,t):this.params=t}block$data(t,n,r=et.nil){this.gen.block(()=>{this.check$data(t,r),n()})}check$data(t=et.nil,n=et.nil){if(!this.$data)return;const{gen:r,schemaCode:i,schemaType:s,def:o}=this;r.if((0,et.or)((0,et._)`${i} === undefined`,n)),t!==et.nil&&r.assign(t,!0),(s.length||o.validateSchema)&&(r.elseIf(this.invalid$data()),this.$dataError(),t!==et.nil&&r.assign(t,!1)),r.else()}invalid$data(){const{gen:t,schemaCode:n,schemaType:r,def:i,it:s}=this;return(0,et.or)(o(),a());function o(){if(r.length){if(!(n instanceof et.Name))throw new Error("ajv implementation error");const u=Array.isArray(r)?r:[r];return(0,et._)`${(0,jw.checkDataTypes)(u,n,s.opts.strictNumbers,jw.DataType.Wrong)}`}return et.nil}function a(){if(i.validateSchema){const u=t.scopeValue("validate$data",{ref:i.validateSchema});return(0,et._)`!${u}(${n})`}return et.nil}}subschema(t,n){const r=(0,XC.getSubschema)(this.it,t);(0,XC.extendSubschemaData)(r,this.it,t),(0,XC.extendSubschemaMode)(r,t);const i={...this.it,...r,items:void 0,props:void 0};return JOe(i,n),i}mergeEvaluated(t,n){const{it:r,gen:i}=this;r.opts.unevaluated&&(r.props!==!0&&t.props!==void 0&&(r.props=gl.mergeEvaluated.props(i,t.props,r.props,n)),r.items!==!0&&t.items!==void 0&&(r.items=gl.mergeEvaluated.items(i,t.items,r.items,n)))}mergeValidEvaluated(t,n){const{it:r,gen:i}=this;if(r.opts.unevaluated&&(r.props!==!0||r.items!==!0))return i.if(n,()=>this.mergeEvaluated(t,et.Name)),!0}}Ia.KeywordCxt=FX;function BX(e,t,n,r){const i=new FX(e,n,t);"code"in n?n.code(i,r):i.$data&&n.validate?(0,N0.funcKeywordCode)(i,n):"macro"in n?(0,N0.macroKeywordCode)(i,n):(n.compile||n.validate)&&(0,N0.funcKeywordCode)(i,n)}const dPe=/^\/(?:[^~]|~0|~1)*$/,hPe=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function jX(e,{dataLevel:t,dataNames:n,dataPathArr:r}){let i,s;if(e==="")return yt.default.rootData;if(e[0]==="/"){if(!dPe.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);i=e,s=yt.default.rootData}else{const l=hPe.exec(e);if(!l)throw new Error(`Invalid JSON-pointer: ${e}`);const c=+l[1];if(i=l[2],i==="#"){if(c>=t)throw new Error(u("property/index",c));return r[t-c]}if(c>t)throw new Error(u("data",c));if(s=n[t-c],!i)return s}let o=s;const a=i.split("/");for(const l of a)l&&(s=(0,et._)`${s}${(0,et.getProperty)((0,gl.unescapeJsonPointer)(l))}`,o=(0,et._)`${o} && ${s}`);return o;function u(l,c){return`Cannot access ${l} ${c} levels up, current level is ${t}`}}Ia.getData=jX;var R_={};Object.defineProperty(R_,"__esModule",{value:!0});class pPe extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}}R_.default=pPe;var N_={};Object.defineProperty(N_,"__esModule",{value:!0});const JC=Ai;class mPe extends Error{constructor(t,n,r,i){super(i||`can't resolve reference ${r} from id ${n}`),this.missingRef=(0,JC.resolveUrl)(t,n,r),this.missingSchema=(0,JC.normalizeId)((0,JC.getFullPath)(t,this.missingRef))}}N_.default=mPe;var Rs={};Object.defineProperty(Rs,"__esModule",{value:!0});Rs.resolveSchema=Rs.getCompilingSchema=Rs.resolveRef=Rs.compileSchema=Rs.SchemaEnv=void 0;const aa=Yt,gPe=R_,kf=ju,ya=Ai,p9=pn,yPe=Ia;class hI{constructor(t){var n;this.refs={},this.dynamicAnchors={};let r;typeof t.schema=="object"&&(r=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=(n=t.baseId)!==null&&n!==void 0?n:(0,ya.normalizeId)(r==null?void 0:r[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=r==null?void 0:r.$async,this.refs={}}}Rs.SchemaEnv=hI;function Wk(e){const t=UX.call(this,e);if(t)return t;const n=(0,ya.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:r,lines:i}=this.opts.code,{ownProperties:s}=this.opts,o=new aa.CodeGen(this.scope,{es5:r,lines:i,ownProperties:s});let a;e.$async&&(a=o.scopeValue("Error",{ref:gPe.default,code:(0,aa._)`require("ajv/dist/runtime/validation_error").default`}));const u=o.scopeName("validate");e.validateName=u;const l={gen:o,allErrors:this.opts.allErrors,data:kf.default.data,parentData:kf.default.parentData,parentDataProperty:kf.default.parentDataProperty,dataNames:[kf.default.data],dataPathArr:[aa.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:o.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,aa.stringify)(e.schema)}:{ref:e.schema}),validateName:u,ValidationError:a,schema:e.schema,schemaEnv:e,rootId:n,baseId:e.baseId||n,schemaPath:aa.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,aa._)`""`,opts:this.opts,self:this};let c;try{this._compilations.add(e),(0,yPe.validateFunctionCode)(l),o.optimize(this.opts.code.optimize);const f=o.toString();c=`${o.scopeRefs(kf.default.scope)}return ${f}`,this.opts.code.process&&(c=this.opts.code.process(c,e));const h=new Function(`${kf.default.self}`,`${kf.default.scope}`,c)(this,this.scope.get());if(this.scope.value(u,{ref:h}),h.errors=null,h.schema=e.schema,h.schemaEnv=e,e.$async&&(h.$async=!0),this.opts.code.source===!0&&(h.source={validateName:u,validateCode:f,scopeValues:o._values}),this.opts.unevaluated){const{props:p,items:m}=l;h.evaluated={props:p instanceof aa.Name?void 0:p,items:m instanceof aa.Name?void 0:m,dynamicProps:p instanceof aa.Name,dynamicItems:m instanceof aa.Name},h.source&&(h.source.evaluated=(0,aa.stringify)(h.evaluated))}return e.validate=h,e}catch(f){throw delete e.validate,delete e.validateName,c&&this.logger.error("Error compiling schema, function code:",c),f}finally{this._compilations.delete(e)}}Rs.compileSchema=Wk;function _Pe(e,t,n){var r;n=(0,ya.resolveUrl)(this.opts.uriResolver,t,n);const i=e.refs[n];if(i)return i;let s=EPe.call(this,e,n);if(s===void 0){const o=(r=e.localRefs)===null||r===void 0?void 0:r[n],{schemaId:a}=this.opts;o&&(s=new hI({schema:o,schemaId:a,root:e,baseId:t}))}if(s!==void 0)return e.refs[n]=vPe.call(this,s)}Rs.resolveRef=_Pe;function vPe(e){return(0,ya.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:Wk.call(this,e)}function UX(e){for(const t of this._compilations)if(bPe(t,e))return t}Rs.getCompilingSchema=UX;function bPe(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function EPe(e,t){let n;for(;typeof(n=this.refs[t])=="string";)t=n;return n||this.schemas[t]||pI.call(this,e,t)}function pI(e,t){const n=this.opts.uriResolver.parse(t),r=(0,ya._getFullPath)(this.opts.uriResolver,n);let i=(0,ya.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&r===i)return ZC.call(this,n,e);const s=(0,ya.normalizeId)(r),o=this.refs[s]||this.schemas[s];if(typeof o=="string"){const a=pI.call(this,e,o);return typeof(a==null?void 0:a.schema)!="object"?void 0:ZC.call(this,n,a)}if(typeof(o==null?void 0:o.schema)=="object"){if(o.validate||Wk.call(this,o),s===(0,ya.normalizeId)(t)){const{schema:a}=o,{schemaId:u}=this.opts,l=a[u];return l&&(i=(0,ya.resolveUrl)(this.opts.uriResolver,i,l)),new hI({schema:a,schemaId:u,root:e,baseId:i})}return ZC.call(this,n,o)}}Rs.resolveSchema=pI;const wPe=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function ZC(e,{baseId:t,schema:n,root:r}){var i;if(((i=e.fragment)===null||i===void 0?void 0:i[0])!=="/")return;for(const a of e.fragment.slice(1).split("/")){if(typeof n=="boolean")return;const u=n[(0,p9.unescapeFragment)(a)];if(u===void 0)return;n=u;const l=typeof n=="object"&&n[this.opts.schemaId];!wPe.has(a)&&l&&(t=(0,ya.resolveUrl)(this.opts.uriResolver,t,l))}let s;if(typeof n!="boolean"&&n.$ref&&!(0,p9.schemaHasRulesButRef)(n,this.RULES)){const a=(0,ya.resolveUrl)(this.opts.uriResolver,t,n.$ref);s=pI.call(this,r,a)}const{schemaId:o}=this.opts;if(s=s||new hI({schema:n,schemaId:o,root:r,baseId:t}),s.schema!==s.root.schema)return s}const TPe="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",SPe="Meta-schema for $data reference (JSON AnySchema extension proposal)",IPe="object",xPe=["$data"],CPe={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},APe=!1,OPe={$id:TPe,description:SPe,type:IPe,required:xPe,properties:CPe,additionalProperties:APe};var qk={},XP={exports:{}};/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */(function(e,t){(function(n,r){r(t)})(io,function(n){function r(){for(var Q=arguments.length,j=Array(Q),Z=0;Z1){j[0]=j[0].slice(0,-1);for(var de=j.length-1,fe=1;fe= 0x80 (not a basic code point)","invalid-input":"Invalid input"},M=m-y,H=Math.floor,J=String.fromCharCode;function Y(Q){throw new RangeError(V[Q])}function ye(Q,j){for(var Z=[],de=Q.length;de--;)Z[de]=j(Q[de]);return Z}function he(Q,j){var Z=Q.split("@"),de="";Z.length>1&&(de=Z[0]+"@",Q=Z[1]),Q=Q.replace(P,".");var fe=Q.split("."),He=ye(fe,j).join(".");return de+He}function ve(Q){for(var j=[],Z=0,de=Q.length;Z=55296&&fe<=56319&&Z>1,j+=H(j/Z);j>M*g>>1;fe+=m)j=H(j/M);return H(fe+(M+1)*j/(j+_))},C=function(j){var Z=[],de=j.length,fe=0,He=I,Te=T,Ve=j.lastIndexOf(E);Ve<0&&(Ve=0);for(var ft=0;ft=128&&Y("not-basic"),Z.push(j.charCodeAt(ft));for(var Je=Ve>0?Ve+1:0;Je=de&&Y("invalid-input");var pt=se(j.charCodeAt(Je++));(pt>=m||pt>H((p-fe)/Lt))&&Y("overflow"),fe+=pt*Lt;var xn=$n<=Te?y:$n>=Te+g?g:$n-Te;if(ptH(p/Et)&&Y("overflow"),Lt*=Et}var mn=Z.length+1;Te=x(fe-mt,mn,mt==0),H(fe/mn)>p-He&&Y("overflow"),He+=H(fe/mn),fe%=mn,Z.splice(fe++,0,He)}return String.fromCodePoint.apply(String,Z)},z=function(j){var Z=[];j=ve(j);var de=j.length,fe=I,He=0,Te=T,Ve=!0,ft=!1,Je=void 0;try{for(var mt=j[Symbol.iterator](),Lt;!(Ve=(Lt=mt.next()).done);Ve=!0){var $n=Lt.value;$n<128&&Z.push(J($n))}}catch(be){ft=!0,Je=be}finally{try{!Ve&&mt.return&&mt.return()}finally{if(ft)throw Je}}var pt=Z.length,xn=pt;for(pt&&Z.push(E);xn=fe&&_iH((p-He)/hr)&&Y("overflow"),He+=(Et-fe)*hr,fe=Et;var Ye=!0,zt=!1,Hn=void 0;try{for(var ii=j[Symbol.iterator](),gs;!(Ye=(gs=ii.next()).done);Ye=!0){var N=gs.value;if(Np&&Y("overflow"),N==fe){for(var G=He,F=m;;F+=m){var ne=F<=Te?y:F>=Te+g?g:F-Te;if(G>6|192).toString(16).toUpperCase()+"%"+(j&63|128).toString(16).toUpperCase():Z="%"+(j>>12|224).toString(16).toUpperCase()+"%"+(j>>6&63|128).toString(16).toUpperCase()+"%"+(j&63|128).toString(16).toUpperCase(),Z}function pe(Q){for(var j="",Z=0,de=Q.length;Z=194&&fe<224){if(de-Z>=6){var He=parseInt(Q.substr(Z+4,2),16);j+=String.fromCharCode((fe&31)<<6|He&63)}else j+=Q.substr(Z,6);Z+=6}else if(fe>=224){if(de-Z>=9){var Te=parseInt(Q.substr(Z+4,2),16),Ve=parseInt(Q.substr(Z+7,2),16);j+=String.fromCharCode((fe&15)<<12|(Te&63)<<6|Ve&63)}else j+=Q.substr(Z,9);Z+=9}else j+=Q.substr(Z,3),Z+=3}return j}function me(Q,j){function Z(de){var fe=pe(de);return fe.match(j.UNRESERVED)?fe:de}return Q.scheme&&(Q.scheme=String(Q.scheme).replace(j.PCT_ENCODED,Z).toLowerCase().replace(j.NOT_SCHEME,"")),Q.userinfo!==void 0&&(Q.userinfo=String(Q.userinfo).replace(j.PCT_ENCODED,Z).replace(j.NOT_USERINFO,ae).replace(j.PCT_ENCODED,o)),Q.host!==void 0&&(Q.host=String(Q.host).replace(j.PCT_ENCODED,Z).toLowerCase().replace(j.NOT_HOST,ae).replace(j.PCT_ENCODED,o)),Q.path!==void 0&&(Q.path=String(Q.path).replace(j.PCT_ENCODED,Z).replace(Q.scheme?j.NOT_PATH:j.NOT_PATH_NOSCHEME,ae).replace(j.PCT_ENCODED,o)),Q.query!==void 0&&(Q.query=String(Q.query).replace(j.PCT_ENCODED,Z).replace(j.NOT_QUERY,ae).replace(j.PCT_ENCODED,o)),Q.fragment!==void 0&&(Q.fragment=String(Q.fragment).replace(j.PCT_ENCODED,Z).replace(j.NOT_FRAGMENT,ae).replace(j.PCT_ENCODED,o)),Q}function Se(Q){return Q.replace(/^0*(.*)/,"$1")||"0"}function ce(Q,j){var Z=Q.match(j.IPV4ADDRESS)||[],de=d(Z,2),fe=de[1];return fe?fe.split(".").map(Se).join("."):Q}function st(Q,j){var Z=Q.match(j.IPV6ADDRESS)||[],de=d(Z,3),fe=de[1],He=de[2];if(fe){for(var Te=fe.toLowerCase().split("::").reverse(),Ve=d(Te,2),ft=Ve[0],Je=Ve[1],mt=Je?Je.split(":").map(Se):[],Lt=ft.split(":").map(Se),$n=j.IPV4ADDRESS.test(Lt[Lt.length-1]),pt=$n?7:8,xn=Lt.length-pt,Et=Array(pt),mn=0;mn1){var is=Et.slice(0,Wr.index),_i=Et.slice(Wr.index+Wr.length);Pr=is.join(":")+"::"+_i.join(":")}else Pr=Et.join(":");return He&&(Pr+="%"+He),Pr}else return Q}var Ke=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,qe="".match(/(){0}/)[1]===void 0;function $e(Q){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Z={},de=j.iri!==!1?f:c;j.reference==="suffix"&&(Q=(j.scheme?j.scheme+":":"")+"//"+Q);var fe=Q.match(Ke);if(fe){qe?(Z.scheme=fe[1],Z.userinfo=fe[3],Z.host=fe[4],Z.port=parseInt(fe[5],10),Z.path=fe[6]||"",Z.query=fe[7],Z.fragment=fe[8],isNaN(Z.port)&&(Z.port=fe[5])):(Z.scheme=fe[1]||void 0,Z.userinfo=Q.indexOf("@")!==-1?fe[3]:void 0,Z.host=Q.indexOf("//")!==-1?fe[4]:void 0,Z.port=parseInt(fe[5],10),Z.path=fe[6]||"",Z.query=Q.indexOf("?")!==-1?fe[7]:void 0,Z.fragment=Q.indexOf("#")!==-1?fe[8]:void 0,isNaN(Z.port)&&(Z.port=Q.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?fe[4]:void 0)),Z.host&&(Z.host=st(ce(Z.host,de),de)),Z.scheme===void 0&&Z.userinfo===void 0&&Z.host===void 0&&Z.port===void 0&&!Z.path&&Z.query===void 0?Z.reference="same-document":Z.scheme===void 0?Z.reference="relative":Z.fragment===void 0?Z.reference="absolute":Z.reference="uri",j.reference&&j.reference!=="suffix"&&j.reference!==Z.reference&&(Z.error=Z.error||"URI is not a "+j.reference+" reference.");var He=le[(j.scheme||Z.scheme||"").toLowerCase()];if(!j.unicodeSupport&&(!He||!He.unicodeSupport)){if(Z.host&&(j.domainHost||He&&He.domainHost))try{Z.host=q.toASCII(Z.host.replace(de.PCT_ENCODED,pe).toLowerCase())}catch(Te){Z.error=Z.error||"Host's domain name can not be converted to ASCII via punycode: "+Te}me(Z,c)}else me(Z,de);He&&He.parse&&He.parse(Z,j)}else Z.error=Z.error||"URI can not be parsed.";return Z}function ot(Q,j){var Z=j.iri!==!1?f:c,de=[];return Q.userinfo!==void 0&&(de.push(Q.userinfo),de.push("@")),Q.host!==void 0&&de.push(st(ce(String(Q.host),Z),Z).replace(Z.IPV6ADDRESS,function(fe,He,Te){return"["+He+(Te?"%25"+Te:"")+"]"})),(typeof Q.port=="number"||typeof Q.port=="string")&&(de.push(":"),de.push(String(Q.port))),de.length?de.join(""):void 0}var lt=/^\.\.?\//,On=/^\/\.(\/|$)/,Ue=/^\/\.\.(\/|$)/,Be=/^\/?(?:.|\n)*?(?=\/|$)/;function bt(Q){for(var j=[];Q.length;)if(Q.match(lt))Q=Q.replace(lt,"");else if(Q.match(On))Q=Q.replace(On,"/");else if(Q.match(Ue))Q=Q.replace(Ue,"/"),j.pop();else if(Q==="."||Q==="..")Q="";else{var Z=Q.match(Be);if(Z){var de=Z[0];Q=Q.slice(de.length),j.push(de)}else throw new Error("Unexpected dot segment condition")}return j.join("")}function je(Q){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Z=j.iri?f:c,de=[],fe=le[(j.scheme||Q.scheme||"").toLowerCase()];if(fe&&fe.serialize&&fe.serialize(Q,j),Q.host&&!Z.IPV6ADDRESS.test(Q.host)){if(j.domainHost||fe&&fe.domainHost)try{Q.host=j.iri?q.toUnicode(Q.host):q.toASCII(Q.host.replace(Z.PCT_ENCODED,pe).toLowerCase())}catch(Ve){Q.error=Q.error||"Host's domain name can not be converted to "+(j.iri?"Unicode":"ASCII")+" via punycode: "+Ve}}me(Q,Z),j.reference!=="suffix"&&Q.scheme&&(de.push(Q.scheme),de.push(":"));var He=ot(Q,j);if(He!==void 0&&(j.reference!=="suffix"&&de.push("//"),de.push(He),Q.path&&Q.path.charAt(0)!=="/"&&de.push("/")),Q.path!==void 0){var Te=Q.path;!j.absolutePath&&(!fe||!fe.absolutePath)&&(Te=bt(Te)),He===void 0&&(Te=Te.replace(/^\/\//,"/%2F")),de.push(Te)}return Q.query!==void 0&&(de.push("?"),de.push(Q.query)),Q.fragment!==void 0&&(de.push("#"),de.push(Q.fragment)),de.join("")}function gt(Q,j){var Z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},de=arguments[3],fe={};return de||(Q=$e(je(Q,Z),Z),j=$e(je(j,Z),Z)),Z=Z||{},!Z.tolerant&&j.scheme?(fe.scheme=j.scheme,fe.userinfo=j.userinfo,fe.host=j.host,fe.port=j.port,fe.path=bt(j.path||""),fe.query=j.query):(j.userinfo!==void 0||j.host!==void 0||j.port!==void 0?(fe.userinfo=j.userinfo,fe.host=j.host,fe.port=j.port,fe.path=bt(j.path||""),fe.query=j.query):(j.path?(j.path.charAt(0)==="/"?fe.path=bt(j.path):((Q.userinfo!==void 0||Q.host!==void 0||Q.port!==void 0)&&!Q.path?fe.path="/"+j.path:Q.path?fe.path=Q.path.slice(0,Q.path.lastIndexOf("/")+1)+j.path:fe.path=j.path,fe.path=bt(fe.path)),fe.query=j.query):(fe.path=Q.path,j.query!==void 0?fe.query=j.query:fe.query=Q.query),fe.userinfo=Q.userinfo,fe.host=Q.host,fe.port=Q.port),fe.scheme=Q.scheme),fe.fragment=j.fragment,fe}function Gt(Q,j,Z){var de=u({scheme:"null"},Z);return je(gt($e(Q,de),$e(j,de),de,!0),de)}function an(Q,j){return typeof Q=="string"?Q=je($e(Q,j),j):s(Q)==="object"&&(Q=$e(je(Q,j),j)),Q}function Gn(Q,j,Z){return typeof Q=="string"?Q=je($e(Q,Z),Z):s(Q)==="object"&&(Q=je(Q,Z)),typeof j=="string"?j=je($e(j,Z),Z):s(j)==="object"&&(j=je(j,Z)),Q===j}function ue(Q,j){return Q&&Q.toString().replace(!j||!j.iri?c.ESCAPE:f.ESCAPE,ae)}function we(Q,j){return Q&&Q.toString().replace(!j||!j.iri?c.PCT_ENCODED:f.PCT_ENCODED,pe)}var Le={scheme:"http",domainHost:!0,parse:function(j,Z){return j.host||(j.error=j.error||"HTTP URIs must have a host."),j},serialize:function(j,Z){var de=String(j.scheme).toLowerCase()==="https";return(j.port===(de?443:80)||j.port==="")&&(j.port=void 0),j.path||(j.path="/"),j}},rt={scheme:"https",domainHost:Le.domainHost,parse:Le.parse,serialize:Le.serialize};function De(Q){return typeof Q.secure=="boolean"?Q.secure:String(Q.scheme).toLowerCase()==="wss"}var it={scheme:"ws",domainHost:!0,parse:function(j,Z){var de=j;return de.secure=De(de),de.resourceName=(de.path||"/")+(de.query?"?"+de.query:""),de.path=void 0,de.query=void 0,de},serialize:function(j,Z){if((j.port===(De(j)?443:80)||j.port==="")&&(j.port=void 0),typeof j.secure=="boolean"&&(j.scheme=j.secure?"wss":"ws",j.secure=void 0),j.resourceName){var de=j.resourceName.split("?"),fe=d(de,2),He=fe[0],Te=fe[1];j.path=He&&He!=="/"?He:void 0,j.query=Te,j.resourceName=void 0}return j.fragment=void 0,j}},Me={scheme:"wss",domainHost:it.domainHost,parse:it.parse,serialize:it.serialize},Ze={},bn="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",Wt="[0-9A-Fa-f]",It=i(i("%[EFef]"+Wt+"%"+Wt+Wt+"%"+Wt+Wt)+"|"+i("%[89A-Fa-f]"+Wt+"%"+Wt+Wt)+"|"+i("%"+Wt+Wt)),Bn="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",En="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",sa=r(En,'[\\"\\\\]'),fr="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",Mi=new RegExp(bn,"g"),vr=new RegExp(It,"g"),$r=new RegExp(r("[^]",Bn,"[\\.]",'[\\"]',sa),"g"),dr=new RegExp(r("[^]",bn,fr),"g"),jn=dr;function Zt(Q){var j=pe(Q);return j.match(Mi)?j:Q}var ri={scheme:"mailto",parse:function(j,Z){var de=j,fe=de.to=de.path?de.path.split(","):[];if(de.path=void 0,de.query){for(var He=!1,Te={},Ve=de.query.split("&"),ft=0,Je=Ve.length;ftnew RegExp(K,x);h.code="new RegExp";const p=["removeAdditional","useDefaults","coerceTypes"],m=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),y={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},g={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},_=200;function b(K){var x,C,z,R,O,q,le,ae,pe,me,Se,ce,st,Ke,qe,$e,ot,lt,On,Ue,Be,bt,je,gt,Gt;const an=K.strict,Gn=(x=K.code)===null||x===void 0?void 0:x.optimize,ue=Gn===!0||Gn===void 0?1:Gn||0,we=(z=(C=K.code)===null||C===void 0?void 0:C.regExp)!==null&&z!==void 0?z:h,Le=(R=K.uriResolver)!==null&&R!==void 0?R:d.default;return{strictSchema:(q=(O=K.strictSchema)!==null&&O!==void 0?O:an)!==null&&q!==void 0?q:!0,strictNumbers:(ae=(le=K.strictNumbers)!==null&&le!==void 0?le:an)!==null&&ae!==void 0?ae:!0,strictTypes:(me=(pe=K.strictTypes)!==null&&pe!==void 0?pe:an)!==null&&me!==void 0?me:"log",strictTuples:(ce=(Se=K.strictTuples)!==null&&Se!==void 0?Se:an)!==null&&ce!==void 0?ce:"log",strictRequired:(Ke=(st=K.strictRequired)!==null&&st!==void 0?st:an)!==null&&Ke!==void 0?Ke:!1,code:K.code?{...K.code,optimize:ue,regExp:we}:{optimize:ue,regExp:we},loopRequired:(qe=K.loopRequired)!==null&&qe!==void 0?qe:_,loopEnum:($e=K.loopEnum)!==null&&$e!==void 0?$e:_,meta:(ot=K.meta)!==null&&ot!==void 0?ot:!0,messages:(lt=K.messages)!==null&<!==void 0?lt:!0,inlineRefs:(On=K.inlineRefs)!==null&&On!==void 0?On:!0,schemaId:(Ue=K.schemaId)!==null&&Ue!==void 0?Ue:"$id",addUsedSchema:(Be=K.addUsedSchema)!==null&&Be!==void 0?Be:!0,validateSchema:(bt=K.validateSchema)!==null&&bt!==void 0?bt:!0,validateFormats:(je=K.validateFormats)!==null&&je!==void 0?je:!0,unicodeRegExp:(gt=K.unicodeRegExp)!==null&>!==void 0?gt:!0,int32range:(Gt=K.int32range)!==null&&Gt!==void 0?Gt:!0,uriResolver:Le}}class T{constructor(x={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,x=this.opts={...x,...b(x)};const{es5:C,lines:z}=this.opts.code;this.scope=new a.ValueScope({scope:{},prefixes:m,es5:C,lines:z}),this.logger=H(x.logger);const R=x.validateFormats;x.validateFormats=!1,this.RULES=(0,s.getRules)(),I.call(this,y,x,"NOT SUPPORTED"),I.call(this,g,x,"DEPRECATED","warn"),this._metaOpts=V.call(this),x.formats&&A.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),x.keywords&&P.call(this,x.keywords),typeof x.meta=="object"&&this.addMetaSchema(x.meta),S.call(this),x.validateFormats=R}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:x,meta:C,schemaId:z}=this.opts;let R=f;z==="id"&&(R={...f},R.id=R.$id,delete R.$id),C&&x&&this.addMetaSchema(R,R[z],!1)}defaultMeta(){const{meta:x,schemaId:C}=this.opts;return this.opts.defaultMeta=typeof x=="object"?x[C]||x:void 0}validate(x,C){let z;if(typeof x=="string"){if(z=this.getSchema(x),!z)throw new Error(`no schema with key or ref "${x}"`)}else z=this.compile(x);const R=z(C);return"$async"in z||(this.errors=z.errors),R}compile(x,C){const z=this._addSchema(x,C);return z.validate||this._compileSchemaEnv(z)}compileAsync(x,C){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:z}=this.opts;return R.call(this,x,C);async function R(me,Se){await O.call(this,me.$schema);const ce=this._addSchema(me,Se);return ce.validate||q.call(this,ce)}async function O(me){me&&!this.getSchema(me)&&await R.call(this,{$ref:me},!0)}async function q(me){try{return this._compileSchemaEnv(me)}catch(Se){if(!(Se instanceof i.default))throw Se;return le.call(this,Se),await ae.call(this,Se.missingSchema),q.call(this,me)}}function le({missingSchema:me,missingRef:Se}){if(this.refs[me])throw new Error(`AnySchema ${me} is loaded but ${Se} cannot be resolved`)}async function ae(me){const Se=await pe.call(this,me);this.refs[me]||await O.call(this,Se.$schema),this.refs[me]||this.addSchema(Se,me,C)}async function pe(me){const Se=this._loading[me];if(Se)return Se;try{return await(this._loading[me]=z(me))}finally{delete this._loading[me]}}}addSchema(x,C,z,R=this.opts.validateSchema){if(Array.isArray(x)){for(const q of x)this.addSchema(q,void 0,z,R);return this}let O;if(typeof x=="object"){const{schemaId:q}=this.opts;if(O=x[q],O!==void 0&&typeof O!="string")throw new Error(`schema ${q} must be string`)}return C=(0,u.normalizeId)(C||O),this._checkUnique(C),this.schemas[C]=this._addSchema(x,z,C,R,!0),this}addMetaSchema(x,C,z=this.opts.validateSchema){return this.addSchema(x,C,!0,z),this}validateSchema(x,C){if(typeof x=="boolean")return!0;let z;if(z=x.$schema,z!==void 0&&typeof z!="string")throw new Error("$schema must be a string");if(z=z||this.opts.defaultMeta||this.defaultMeta(),!z)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const R=this.validate(z,x);if(!R&&C){const O="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(O);else throw new Error(O)}return R}getSchema(x){let C;for(;typeof(C=E.call(this,x))=="string";)x=C;if(C===void 0){const{schemaId:z}=this.opts,R=new o.SchemaEnv({schema:{},schemaId:z});if(C=o.resolveSchema.call(this,R,x),!C)return;this.refs[x]=C}return C.validate||this._compileSchemaEnv(C)}removeSchema(x){if(x instanceof RegExp)return this._removeAllSchemas(this.schemas,x),this._removeAllSchemas(this.refs,x),this;switch(typeof x){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const C=E.call(this,x);return typeof C=="object"&&this._cache.delete(C.schema),delete this.schemas[x],delete this.refs[x],this}case"object":{const C=x;this._cache.delete(C);let z=x[this.opts.schemaId];return z&&(z=(0,u.normalizeId)(z),delete this.schemas[z],delete this.refs[z]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(x){for(const C of x)this.addKeyword(C);return this}addKeyword(x,C){let z;if(typeof x=="string")z=x,typeof C=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),C.keyword=z);else if(typeof x=="object"&&C===void 0){if(C=x,z=C.keyword,Array.isArray(z)&&!z.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(Y.call(this,z,C),!C)return(0,c.eachItem)(z,O=>ye.call(this,O)),this;ve.call(this,C);const R={...C,type:(0,l.getJSONTypes)(C.type),schemaType:(0,l.getJSONTypes)(C.schemaType)};return(0,c.eachItem)(z,R.type.length===0?O=>ye.call(this,O,R):O=>R.type.forEach(q=>ye.call(this,O,R,q))),this}getKeyword(x){const C=this.RULES.all[x];return typeof C=="object"?C.definition:!!C}removeKeyword(x){const{RULES:C}=this;delete C.keywords[x],delete C.all[x];for(const z of C.rules){const R=z.rules.findIndex(O=>O.keyword===x);R>=0&&z.rules.splice(R,1)}return this}addFormat(x,C){return typeof C=="string"&&(C=new RegExp(C)),this.formats[x]=C,this}errorsText(x=this.errors,{separator:C=", ",dataVar:z="data"}={}){return!x||x.length===0?"No errors":x.map(R=>`${z}${R.instancePath} ${R.message}`).reduce((R,O)=>R+C+O)}$dataMetaSchema(x,C){const z=this.RULES.all;x=JSON.parse(JSON.stringify(x));for(const R of C){const O=R.split("/").slice(1);let q=x;for(const le of O)q=q[le];for(const le in z){const ae=z[le];if(typeof ae!="object")continue;const{$data:pe}=ae.definition,me=q[le];pe&&me&&(q[le]=se(me))}}return x}_removeAllSchemas(x,C){for(const z in x){const R=x[z];(!C||C.test(z))&&(typeof R=="string"?delete x[z]:R&&!R.meta&&(this._cache.delete(R.schema),delete x[z]))}}_addSchema(x,C,z,R=this.opts.validateSchema,O=this.opts.addUsedSchema){let q;const{schemaId:le}=this.opts;if(typeof x=="object")q=x[le];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof x!="boolean")throw new Error("schema must be object or boolean")}let ae=this._cache.get(x);if(ae!==void 0)return ae;z=(0,u.normalizeId)(q||z);const pe=u.getSchemaRefs.call(this,x,z);return ae=new o.SchemaEnv({schema:x,schemaId:le,meta:C,baseId:z,localRefs:pe}),this._cache.set(ae.schema,ae),O&&!z.startsWith("#")&&(z&&this._checkUnique(z),this.refs[z]=ae),R&&this.validateSchema(x,!0),ae}_checkUnique(x){if(this.schemas[x]||this.refs[x])throw new Error(`schema with key or id "${x}" already exists`)}_compileSchemaEnv(x){if(x.meta?this._compileMetaSchema(x):o.compileSchema.call(this,x),!x.validate)throw new Error("ajv implementation error");return x.validate}_compileMetaSchema(x){const C=this.opts;this.opts=this._metaOpts;try{o.compileSchema.call(this,x)}finally{this.opts=C}}}e.default=T,T.ValidationError=r.default,T.MissingRefError=i.default;function I(K,x,C,z="error"){for(const R in K){const O=R;O in x&&this.logger[z](`${C}: option ${R}. ${K[O]}`)}}function E(K){return K=(0,u.normalizeId)(K),this.schemas[K]||this.refs[K]}function S(){const K=this.opts.schemas;if(K)if(Array.isArray(K))this.addSchema(K);else for(const x in K)this.addSchema(K[x],x)}function A(){for(const K in this.opts.formats){const x=this.opts.formats[K];x&&this.addFormat(K,x)}}function P(K){if(Array.isArray(K)){this.addVocabulary(K);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const x in K){const C=K[x];C.keyword||(C.keyword=x),this.addKeyword(C)}}function V(){const K={...this.opts};for(const x of p)delete K[x];return K}const M={log(){},warn(){},error(){}};function H(K){if(K===!1)return M;if(K===void 0)return console;if(K.log&&K.warn&&K.error)return K;throw new Error("logger must implement log, warn and error methods")}const J=/^[a-z_$][a-z0-9_$:-]*$/i;function Y(K,x){const{RULES:C}=this;if((0,c.eachItem)(K,z=>{if(C.keywords[z])throw new Error(`Keyword ${z} is already defined`);if(!J.test(z))throw new Error(`Keyword ${z} has invalid name`)}),!!x&&x.$data&&!("code"in x||"validate"in x))throw new Error('$data keyword must have "code" or "validate" function')}function ye(K,x,C){var z;const R=x==null?void 0:x.post;if(C&&R)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:O}=this;let q=R?O.post:O.rules.find(({type:ae})=>ae===C);if(q||(q={type:C,rules:[]},O.rules.push(q)),O.keywords[K]=!0,!x)return;const le={keyword:K,definition:{...x,type:(0,l.getJSONTypes)(x.type),schemaType:(0,l.getJSONTypes)(x.schemaType)}};x.before?he.call(this,q,le,x.before):q.rules.push(le),O.all[K]=le,(z=x.implements)===null||z===void 0||z.forEach(ae=>this.addKeyword(ae))}function he(K,x,C){const z=K.rules.findIndex(R=>R.keyword===C);z>=0?K.rules.splice(z,0,x):(K.rules.push(x),this.logger.warn(`rule ${C} is not defined`))}function ve(K){let{metaSchema:x}=K;x!==void 0&&(K.$data&&this.opts.$data&&(x=se(x)),K.validateSchema=this.compile(x,!0))}const te={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function se(K){return{anyOf:[K,te]}}})(_X);var Yk={},Gk={},Kk={};Object.defineProperty(Kk,"__esModule",{value:!0});const RPe={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Kk.default=RPe;var $d={};Object.defineProperty($d,"__esModule",{value:!0});$d.callRef=$d.getValidate=void 0;const NPe=N_,m9=qt,ws=Yt,Eh=ju,g9=Rs,t1=pn,kPe={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:n,it:r}=e,{baseId:i,schemaEnv:s,validateName:o,opts:a,self:u}=r,{root:l}=s;if((n==="#"||n==="#/")&&i===l.baseId)return f();const c=g9.resolveRef.call(u,l,i,n);if(c===void 0)throw new NPe.default(r.opts.uriResolver,i,n);if(c instanceof g9.SchemaEnv)return d(c);return h(c);function f(){if(s===l)return rb(e,o,s,s.$async);const p=t.scopeValue("root",{ref:l});return rb(e,(0,ws._)`${p}.validate`,l,l.$async)}function d(p){const m=zX(e,p);rb(e,m,p,p.$async)}function h(p){const m=t.scopeValue("schema",a.code.source===!0?{ref:p,code:(0,ws.stringify)(p)}:{ref:p}),y=t.name("valid"),g=e.subschema({schema:p,dataTypes:[],schemaPath:ws.nil,topSchemaRef:m,errSchemaPath:n},y);e.mergeEvaluated(g),e.ok(y)}}};function zX(e,t){const{gen:n}=e;return t.validate?n.scopeValue("validate",{ref:t.validate}):(0,ws._)`${n.scopeValue("wrapper",{ref:t})}.validate`}$d.getValidate=zX;function rb(e,t,n,r){const{gen:i,it:s}=e,{allErrors:o,schemaEnv:a,opts:u}=s,l=u.passContext?Eh.default.this:ws.nil;r?c():f();function c(){if(!a.$async)throw new Error("async schema referenced by sync schema");const p=i.let("valid");i.try(()=>{i.code((0,ws._)`await ${(0,m9.callValidateCode)(e,t,l)}`),h(t),o||i.assign(p,!0)},m=>{i.if((0,ws._)`!(${m} instanceof ${s.ValidationError})`,()=>i.throw(m)),d(m),o||i.assign(p,!1)}),e.ok(p)}function f(){e.result((0,m9.callValidateCode)(e,t,l),()=>h(t),()=>d(t))}function d(p){const m=(0,ws._)`${p}.errors`;i.assign(Eh.default.vErrors,(0,ws._)`${Eh.default.vErrors} === null ? ${m} : ${Eh.default.vErrors}.concat(${m})`),i.assign(Eh.default.errors,(0,ws._)`${Eh.default.vErrors}.length`)}function h(p){var m;if(!s.opts.unevaluated)return;const y=(m=n==null?void 0:n.validate)===null||m===void 0?void 0:m.evaluated;if(s.props!==!0)if(y&&!y.dynamicProps)y.props!==void 0&&(s.props=t1.mergeEvaluated.props(i,y.props,s.props));else{const g=i.var("props",(0,ws._)`${p}.evaluated.props`);s.props=t1.mergeEvaluated.props(i,g,s.props,ws.Name)}if(s.items!==!0)if(y&&!y.dynamicItems)y.items!==void 0&&(s.items=t1.mergeEvaluated.items(i,y.items,s.items));else{const g=i.var("items",(0,ws._)`${p}.evaluated.items`);s.items=t1.mergeEvaluated.items(i,g,s.items,ws.Name)}}}$d.callRef=rb;$d.default=kPe;Object.defineProperty(Gk,"__esModule",{value:!0});const DPe=Kk,$Pe=$d,LPe=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",DPe.default,$Pe.default];Gk.default=LPe;var Qk={},Xk={};Object.defineProperty(Xk,"__esModule",{value:!0});const Uw=Yt,ec=Uw.operators,Vw={maximum:{okStr:"<=",ok:ec.LTE,fail:ec.GT},minimum:{okStr:">=",ok:ec.GTE,fail:ec.LT},exclusiveMaximum:{okStr:"<",ok:ec.LT,fail:ec.GTE},exclusiveMinimum:{okStr:">",ok:ec.GT,fail:ec.LTE}},MPe={message:({keyword:e,schemaCode:t})=>(0,Uw.str)`must be ${Vw[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,Uw._)`{comparison: ${Vw[e].okStr}, limit: ${t}}`},FPe={keyword:Object.keys(Vw),type:"number",schemaType:"number",$data:!0,error:MPe,code(e){const{keyword:t,data:n,schemaCode:r}=e;e.fail$data((0,Uw._)`${n} ${Vw[t].fail} ${r} || isNaN(${n})`)}};Xk.default=FPe;var Jk={};Object.defineProperty(Jk,"__esModule",{value:!0});const k0=Yt,BPe={message:({schemaCode:e})=>(0,k0.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,k0._)`{multipleOf: ${e}}`},jPe={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:BPe,code(e){const{gen:t,data:n,schemaCode:r,it:i}=e,s=i.opts.multipleOfPrecision,o=t.let("res"),a=s?(0,k0._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${s}`:(0,k0._)`${o} !== parseInt(${o})`;e.fail$data((0,k0._)`(${r} === 0 || (${o} = ${n}/${r}, ${a}))`)}};Jk.default=jPe;var Zk={},eD={};Object.defineProperty(eD,"__esModule",{value:!0});function HX(e){const t=e.length;let n=0,r=0,i;for(;r=55296&&i<=56319&&r(0,Wf._)`{limit: ${e}}`},HPe={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:zPe,code(e){const{keyword:t,data:n,schemaCode:r,it:i}=e,s=t==="maxLength"?Wf.operators.GT:Wf.operators.LT,o=i.opts.unicode===!1?(0,Wf._)`${n}.length`:(0,Wf._)`${(0,UPe.useFunc)(e.gen,VPe.default)}(${n})`;e.fail$data((0,Wf._)`${o} ${s} ${r}`)}};Zk.default=HPe;var tD={};Object.defineProperty(tD,"__esModule",{value:!0});const WPe=qt,zw=Yt,qPe={message:({schemaCode:e})=>(0,zw.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,zw._)`{pattern: ${e}}`},YPe={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:qPe,code(e){const{data:t,$data:n,schema:r,schemaCode:i,it:s}=e,o=s.opts.unicodeRegExp?"u":"",a=n?(0,zw._)`(new RegExp(${i}, ${o}))`:(0,WPe.usePattern)(e,r);e.fail$data((0,zw._)`!${a}.test(${t})`)}};tD.default=YPe;var nD={};Object.defineProperty(nD,"__esModule",{value:!0});const D0=Yt,GPe={message({keyword:e,schemaCode:t}){const n=e==="maxProperties"?"more":"fewer";return(0,D0.str)`must NOT have ${n} than ${t} properties`},params:({schemaCode:e})=>(0,D0._)`{limit: ${e}}`},KPe={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:GPe,code(e){const{keyword:t,data:n,schemaCode:r}=e,i=t==="maxProperties"?D0.operators.GT:D0.operators.LT;e.fail$data((0,D0._)`Object.keys(${n}).length ${i} ${r}`)}};nD.default=KPe;var rD={};Object.defineProperty(rD,"__esModule",{value:!0});const Ng=qt,$0=Yt,QPe=pn,XPe={message:({params:{missingProperty:e}})=>(0,$0.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,$0._)`{missingProperty: ${e}}`},JPe={keyword:"required",type:"object",schemaType:"array",$data:!0,error:XPe,code(e){const{gen:t,schema:n,schemaCode:r,data:i,$data:s,it:o}=e,{opts:a}=o;if(!s&&n.length===0)return;const u=n.length>=a.loopRequired;if(o.allErrors?l():c(),a.strictRequired){const h=e.parentSchema.properties,{definedProperties:p}=e.it;for(const m of n)if((h==null?void 0:h[m])===void 0&&!p.has(m)){const y=o.schemaEnv.baseId+o.errSchemaPath,g=`required property "${m}" is not defined at "${y}" (strictRequired)`;(0,QPe.checkStrictMode)(o,g,o.opts.strictRequired)}}function l(){if(u||s)e.block$data($0.nil,f);else for(const h of n)(0,Ng.checkReportMissingProp)(e,h)}function c(){const h=t.let("missing");if(u||s){const p=t.let("valid",!0);e.block$data(p,()=>d(h,p)),e.ok(p)}else t.if((0,Ng.checkMissingProp)(e,n,h)),(0,Ng.reportMissingProp)(e,h),t.else()}function f(){t.forOf("prop",r,h=>{e.setParams({missingProperty:h}),t.if((0,Ng.noPropertyInData)(t,i,h,a.ownProperties),()=>e.error())})}function d(h,p){e.setParams({missingProperty:h}),t.forOf(h,r,()=>{t.assign(p,(0,Ng.propertyInData)(t,i,h,a.ownProperties)),t.if((0,$0.not)(p),()=>{e.error(),t.break()})},$0.nil)}}};rD.default=JPe;var iD={};Object.defineProperty(iD,"__esModule",{value:!0});const L0=Yt,ZPe={message({keyword:e,schemaCode:t}){const n=e==="maxItems"?"more":"fewer";return(0,L0.str)`must NOT have ${n} than ${t} items`},params:({schemaCode:e})=>(0,L0._)`{limit: ${e}}`},e2e={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:ZPe,code(e){const{keyword:t,data:n,schemaCode:r}=e,i=t==="maxItems"?L0.operators.GT:L0.operators.LT;e.fail$data((0,L0._)`${n}.length ${i} ${r}`)}};iD.default=e2e;var sD={},k_={};Object.defineProperty(k_,"__esModule",{value:!0});const WX=Vk;WX.code='require("ajv/dist/runtime/equal").default';k_.default=WX;Object.defineProperty(sD,"__esModule",{value:!0});const eA=P_,wi=Yt,t2e=pn,n2e=k_,r2e={message:({params:{i:e,j:t}})=>(0,wi.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,wi._)`{i: ${e}, j: ${t}}`},i2e={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:r2e,code(e){const{gen:t,data:n,$data:r,schema:i,parentSchema:s,schemaCode:o,it:a}=e;if(!r&&!i)return;const u=t.let("valid"),l=s.items?(0,eA.getSchemaTypes)(s.items):[];e.block$data(u,c,(0,wi._)`${o} === false`),e.ok(u);function c(){const p=t.let("i",(0,wi._)`${n}.length`),m=t.let("j");e.setParams({i:p,j:m}),t.assign(u,!0),t.if((0,wi._)`${p} > 1`,()=>(f()?d:h)(p,m))}function f(){return l.length>0&&!l.some(p=>p==="object"||p==="array")}function d(p,m){const y=t.name("item"),g=(0,eA.checkDataTypes)(l,y,a.opts.strictNumbers,eA.DataType.Wrong),_=t.const("indices",(0,wi._)`{}`);t.for((0,wi._)`;${p}--;`,()=>{t.let(y,(0,wi._)`${n}[${p}]`),t.if(g,(0,wi._)`continue`),l.length>1&&t.if((0,wi._)`typeof ${y} == "string"`,(0,wi._)`${y} += "_"`),t.if((0,wi._)`typeof ${_}[${y}] == "number"`,()=>{t.assign(m,(0,wi._)`${_}[${y}]`),e.error(),t.assign(u,!1).break()}).code((0,wi._)`${_}[${y}] = ${p}`)})}function h(p,m){const y=(0,t2e.useFunc)(t,n2e.default),g=t.name("outer");t.label(g).for((0,wi._)`;${p}--;`,()=>t.for((0,wi._)`${m} = ${p}; ${m}--;`,()=>t.if((0,wi._)`${y}(${n}[${p}], ${n}[${m}])`,()=>{e.error(),t.assign(u,!1).break(g)})))}}};sD.default=i2e;var oD={};Object.defineProperty(oD,"__esModule",{value:!0});const JP=Yt,s2e=pn,o2e=k_,a2e={message:"must be equal to constant",params:({schemaCode:e})=>(0,JP._)`{allowedValue: ${e}}`},u2e={keyword:"const",$data:!0,error:a2e,code(e){const{gen:t,data:n,$data:r,schemaCode:i,schema:s}=e;r||s&&typeof s=="object"?e.fail$data((0,JP._)`!${(0,s2e.useFunc)(t,o2e.default)}(${n}, ${i})`):e.fail((0,JP._)`${s} !== ${n}`)}};oD.default=u2e;var aD={};Object.defineProperty(aD,"__esModule",{value:!0});const i0=Yt,l2e=pn,c2e=k_,f2e={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,i0._)`{allowedValues: ${e}}`},d2e={keyword:"enum",schemaType:"array",$data:!0,error:f2e,code(e){const{gen:t,data:n,$data:r,schema:i,schemaCode:s,it:o}=e;if(!r&&i.length===0)throw new Error("enum must have non-empty array");const a=i.length>=o.opts.loopEnum;let u;const l=()=>u??(u=(0,l2e.useFunc)(t,c2e.default));let c;if(a||r)c=t.let("valid"),e.block$data(c,f);else{if(!Array.isArray(i))throw new Error("ajv implementation error");const h=t.const("vSchema",s);c=(0,i0.or)(...i.map((p,m)=>d(h,m)))}e.pass(c);function f(){t.assign(c,!1),t.forOf("v",s,h=>t.if((0,i0._)`${l()}(${n}, ${h})`,()=>t.assign(c,!0).break()))}function d(h,p){const m=i[p];return typeof m=="object"&&m!==null?(0,i0._)`${l()}(${n}, ${h}[${p}])`:(0,i0._)`${n} === ${m}`}}};aD.default=d2e;Object.defineProperty(Qk,"__esModule",{value:!0});const h2e=Xk,p2e=Jk,m2e=Zk,g2e=tD,y2e=nD,_2e=rD,v2e=iD,b2e=sD,E2e=oD,w2e=aD,T2e=[h2e.default,p2e.default,m2e.default,g2e.default,y2e.default,_2e.default,v2e.default,b2e.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},E2e.default,w2e.default];Qk.default=T2e;var uD={},Fm={};Object.defineProperty(Fm,"__esModule",{value:!0});Fm.validateAdditionalItems=void 0;const qf=Yt,ZP=pn,S2e={message:({params:{len:e}})=>(0,qf.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,qf._)`{limit: ${e}}`},I2e={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:S2e,code(e){const{parentSchema:t,it:n}=e,{items:r}=t;if(!Array.isArray(r)){(0,ZP.checkStrictMode)(n,'"additionalItems" is ignored when "items" is not an array of schemas');return}qX(e,r)}};function qX(e,t){const{gen:n,schema:r,data:i,keyword:s,it:o}=e;o.items=!0;const a=n.const("len",(0,qf._)`${i}.length`);if(r===!1)e.setParams({len:t.length}),e.pass((0,qf._)`${a} <= ${t.length}`);else if(typeof r=="object"&&!(0,ZP.alwaysValidSchema)(o,r)){const l=n.var("valid",(0,qf._)`${a} <= ${t.length}`);n.if((0,qf.not)(l),()=>u(l)),e.ok(l)}function u(l){n.forRange("i",t.length,a,c=>{e.subschema({keyword:s,dataProp:c,dataPropType:ZP.Type.Num},l),o.allErrors||n.if((0,qf.not)(l),()=>n.break())})}}Fm.validateAdditionalItems=qX;Fm.default=I2e;var lD={},Bm={};Object.defineProperty(Bm,"__esModule",{value:!0});Bm.validateTuple=void 0;const y9=Yt,ib=pn,x2e=qt,C2e={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:n}=e;if(Array.isArray(t))return YX(e,"additionalItems",t);n.items=!0,!(0,ib.alwaysValidSchema)(n,t)&&e.ok((0,x2e.validateArray)(e))}};function YX(e,t,n=e.schema){const{gen:r,parentSchema:i,data:s,keyword:o,it:a}=e;c(i),a.opts.unevaluated&&n.length&&a.items!==!0&&(a.items=ib.mergeEvaluated.items(r,n.length,a.items));const u=r.name("valid"),l=r.const("len",(0,y9._)`${s}.length`);n.forEach((f,d)=>{(0,ib.alwaysValidSchema)(a,f)||(r.if((0,y9._)`${l} > ${d}`,()=>e.subschema({keyword:o,schemaProp:d,dataProp:d},u)),e.ok(u))});function c(f){const{opts:d,errSchemaPath:h}=a,p=n.length,m=p===f.minItems&&(p===f.maxItems||f[t]===!1);if(d.strictTuples&&!m){const y=`"${o}" is ${p}-tuple, but minItems or maxItems/${t} are not specified or different at path "${h}"`;(0,ib.checkStrictMode)(a,y,d.strictTuples)}}}Bm.validateTuple=YX;Bm.default=C2e;Object.defineProperty(lD,"__esModule",{value:!0});const A2e=Bm,O2e={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,A2e.validateTuple)(e,"items")};lD.default=O2e;var cD={};Object.defineProperty(cD,"__esModule",{value:!0});const _9=Yt,P2e=pn,R2e=qt,N2e=Fm,k2e={message:({params:{len:e}})=>(0,_9.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,_9._)`{limit: ${e}}`},D2e={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:k2e,code(e){const{schema:t,parentSchema:n,it:r}=e,{prefixItems:i}=n;r.items=!0,!(0,P2e.alwaysValidSchema)(r,t)&&(i?(0,N2e.validateAdditionalItems)(e,i):e.ok((0,R2e.validateArray)(e)))}};cD.default=D2e;var fD={};Object.defineProperty(fD,"__esModule",{value:!0});const Po=Yt,n1=pn,$2e={message:({params:{min:e,max:t}})=>t===void 0?(0,Po.str)`must contain at least ${e} valid item(s)`:(0,Po.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?(0,Po._)`{minContains: ${e}}`:(0,Po._)`{minContains: ${e}, maxContains: ${t}}`},L2e={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:$2e,code(e){const{gen:t,schema:n,parentSchema:r,data:i,it:s}=e;let o,a;const{minContains:u,maxContains:l}=r;s.opts.next?(o=u===void 0?1:u,a=l):o=1;const c=t.const("len",(0,Po._)`${i}.length`);if(e.setParams({min:o,max:a}),a===void 0&&o===0){(0,n1.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&o>a){(0,n1.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,n1.alwaysValidSchema)(s,n)){let m=(0,Po._)`${c} >= ${o}`;a!==void 0&&(m=(0,Po._)`${m} && ${c} <= ${a}`),e.pass(m);return}s.items=!0;const f=t.name("valid");a===void 0&&o===1?h(f,()=>t.if(f,()=>t.break())):o===0?(t.let(f,!0),a!==void 0&&t.if((0,Po._)`${i}.length > 0`,d)):(t.let(f,!1),d()),e.result(f,()=>e.reset());function d(){const m=t.name("_valid"),y=t.let("count",0);h(m,()=>t.if(m,()=>p(y)))}function h(m,y){t.forRange("i",0,c,g=>{e.subschema({keyword:"contains",dataProp:g,dataPropType:n1.Type.Num,compositeRule:!0},m),y()})}function p(m){t.code((0,Po._)`${m}++`),a===void 0?t.if((0,Po._)`${m} >= ${o}`,()=>t.assign(f,!0).break()):(t.if((0,Po._)`${m} > ${a}`,()=>t.assign(f,!1).break()),o===1?t.assign(f,!0):t.if((0,Po._)`${m} >= ${o}`,()=>t.assign(f,!0)))}}};fD.default=L2e;var GX={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=Yt,n=pn,r=qt;e.error={message:({params:{property:u,depsCount:l,deps:c}})=>{const f=l===1?"property":"properties";return(0,t.str)`must have ${f} ${c} when property ${u} is present`},params:({params:{property:u,depsCount:l,deps:c,missingProperty:f}})=>(0,t._)`{property: ${u}, + || ${P} === "boolean" || ${S} === null`).assign(V,(0,i._)`[${S}]`)}}}function h({gen:b,parentData:T,parentDataProperty:I},E){b.if((0,i._)`${T} !== undefined`,()=>b.assign((0,i._)`${T}[${I}]`,E))}function p(b,T,I,E=o.Correct){const S=E===o.Correct?i.operators.EQ:i.operators.NEQ;let A;switch(b){case"null":return(0,i._)`${T} ${S} null`;case"array":A=(0,i._)`Array.isArray(${T})`;break;case"object":A=(0,i._)`${T} && typeof ${T} == "object" && !Array.isArray(${T})`;break;case"integer":A=P((0,i._)`!(${T} % 1) && !isNaN(${T})`);break;case"number":A=P();break;default:return(0,i._)`typeof ${T} ${S} ${b}`}return E===o.Correct?A:(0,i.not)(A);function P(V=i.nil){return(0,i.and)((0,i._)`typeof ${T} == "number"`,V,I?(0,i._)`isFinite(${T})`:i.nil)}}e.checkDataType=p;function m(b,T,I,E){if(b.length===1)return p(b[0],T,I,E);let S;const A=(0,s.toHash)(b);if(A.array&&A.object){const P=(0,i._)`typeof ${T} != "object"`;S=A.null?P:(0,i._)`!${T} || ${P}`,delete A.null,delete A.array,delete A.object}else S=i.nil;A.number&&delete A.integer;for(const P in A)S=(0,i.and)(S,p(P,T,I,E));return S}e.checkDataTypes=m;const y={message:({schema:b})=>`must be ${b}`,params:({schema:b,schemaValue:T})=>typeof b=="string"?(0,i._)`{type: ${b}}`:(0,i._)`{type: ${T}}`};function g(b){const T=_(b);(0,r.reportError)(T,y)}e.reportTypeError=g;function _(b){const{gen:T,data:I,schema:E}=b,S=(0,s.schemaRefOrVal)(b,E,"type");return{gen:T,keyword:"type",data:I,schema:E.type,schemaCode:S,schemaValue:S,parentSchema:E,params:{},it:b}}})(P_);var dI={};Object.defineProperty(dI,"__esModule",{value:!0});dI.assignDefaults=void 0;const bh=Yt,lOe=pn;function cOe(e,t){const{properties:n,items:r}=e.schema;if(t==="object"&&n)for(const i in n)a9(e,i,n[i].default);else t==="array"&&Array.isArray(r)&&r.forEach((i,s)=>a9(e,s,i.default))}dI.assignDefaults=cOe;function a9(e,t,n){const{gen:r,compositeRule:i,data:s,opts:o}=e;if(n===void 0)return;const a=(0,bh._)`${s}${(0,bh.getProperty)(t)}`;if(i){(0,lOe.checkStrictMode)(e,`default is ignored for: ${a}`);return}let u=(0,bh._)`${a} === undefined`;o.useDefaults==="empty"&&(u=(0,bh._)`${u} || ${a} === null || ${a} === ""`),r.if(u,(0,bh._)`${a} = ${(0,bh.stringify)(n)}`)}var uu={},qt={};Object.defineProperty(qt,"__esModule",{value:!0});qt.validateUnion=qt.validateArray=qt.usePattern=qt.callValidateCode=qt.schemaProperties=qt.allSchemaProperties=qt.noPropertyInData=qt.propertyInData=qt.isOwnProperty=qt.hasPropFunc=qt.reportMissingProp=qt.checkMissingProp=qt.checkReportMissingProp=void 0;const Xn=Yt,Bk=pn,Zl=ju,fOe=pn;function dOe(e,t){const{gen:n,data:r,it:i}=e;n.if(Uk(n,r,t,i.opts.ownProperties),()=>{e.setParams({missingProperty:(0,Xn._)`${t}`},!0),e.error()})}qt.checkReportMissingProp=dOe;function hOe({gen:e,data:t,it:{opts:n}},r,i){return(0,Xn.or)(...r.map(s=>(0,Xn.and)(Uk(e,t,s,n.ownProperties),(0,Xn._)`${i} = ${s}`)))}qt.checkMissingProp=hOe;function pOe(e,t){e.setParams({missingProperty:t},!0),e.error()}qt.reportMissingProp=pOe;function EX(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Xn._)`Object.prototype.hasOwnProperty`})}qt.hasPropFunc=EX;function jk(e,t,n){return(0,Xn._)`${EX(e)}.call(${t}, ${n})`}qt.isOwnProperty=jk;function mOe(e,t,n,r){const i=(0,Xn._)`${t}${(0,Xn.getProperty)(n)} !== undefined`;return r?(0,Xn._)`${i} && ${jk(e,t,n)}`:i}qt.propertyInData=mOe;function Uk(e,t,n,r){const i=(0,Xn._)`${t}${(0,Xn.getProperty)(n)} === undefined`;return r?(0,Xn.or)(i,(0,Xn.not)(jk(e,t,n))):i}qt.noPropertyInData=Uk;function wX(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}qt.allSchemaProperties=wX;function gOe(e,t){return wX(t).filter(n=>!(0,Bk.alwaysValidSchema)(e,t[n]))}qt.schemaProperties=gOe;function yOe({schemaCode:e,data:t,it:{gen:n,topSchemaRef:r,schemaPath:i,errorPath:s},it:o},a,u,l){const c=l?(0,Xn._)`${e}, ${t}, ${r}${i}`:t,f=[[Zl.default.instancePath,(0,Xn.strConcat)(Zl.default.instancePath,s)],[Zl.default.parentData,o.parentData],[Zl.default.parentDataProperty,o.parentDataProperty],[Zl.default.rootData,Zl.default.rootData]];o.opts.dynamicRef&&f.push([Zl.default.dynamicAnchors,Zl.default.dynamicAnchors]);const d=(0,Xn._)`${c}, ${n.object(...f)}`;return u!==Xn.nil?(0,Xn._)`${a}.call(${u}, ${d})`:(0,Xn._)`${a}(${d})`}qt.callValidateCode=yOe;const _Oe=(0,Xn._)`new RegExp`;function vOe({gen:e,it:{opts:t}},n){const r=t.unicodeRegExp?"u":"",{regExp:i}=t.code,s=i(n,r);return e.scopeValue("pattern",{key:s.toString(),ref:s,code:(0,Xn._)`${i.code==="new RegExp"?_Oe:(0,fOe.useFunc)(e,i)}(${n}, ${r})`})}qt.usePattern=vOe;function bOe(e){const{gen:t,data:n,keyword:r,it:i}=e,s=t.name("valid");if(i.allErrors){const a=t.let("valid",!0);return o(()=>t.assign(a,!1)),a}return t.var(s,!0),o(()=>t.break()),s;function o(a){const u=t.const("len",(0,Xn._)`${n}.length`);t.forRange("i",0,u,l=>{e.subschema({keyword:r,dataProp:l,dataPropType:Bk.Type.Num},s),t.if((0,Xn.not)(s),a)})}}qt.validateArray=bOe;function EOe(e){const{gen:t,schema:n,keyword:r,it:i}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");if(n.some(u=>(0,Bk.alwaysValidSchema)(i,u))&&!i.opts.unevaluated)return;const o=t.let("valid",!1),a=t.name("_valid");t.block(()=>n.forEach((u,l)=>{const c=e.subschema({keyword:r,schemaProp:l,compositeRule:!0},a);t.assign(o,(0,Xn._)`${o} || ${a}`),e.mergeValidEvaluated(c,a)||t.if((0,Xn.not)(o))})),e.result(o,()=>e.reset(),()=>e.error(!0))}qt.validateUnion=EOe;Object.defineProperty(uu,"__esModule",{value:!0});uu.validateKeywordUsage=uu.validSchemaType=uu.funcKeywordCode=uu.macroKeywordCode=void 0;const as=Yt,Hf=ju,wOe=qt,TOe=O_;function SOe(e,t){const{gen:n,keyword:r,schema:i,parentSchema:s,it:o}=e,a=t.macro.call(o.self,i,s,o),u=TX(n,r,a);o.opts.validateSchema!==!1&&o.self.validateSchema(a,!0);const l=n.name("valid");e.subschema({schema:a,schemaPath:as.nil,errSchemaPath:`${o.errSchemaPath}/${r}`,topSchemaRef:u,compositeRule:!0},l),e.pass(l,()=>e.error(!0))}uu.macroKeywordCode=SOe;function IOe(e,t){var n;const{gen:r,keyword:i,schema:s,parentSchema:o,$data:a,it:u}=e;COe(u,t);const l=!a&&t.compile?t.compile.call(u.self,s,o,u):t.validate,c=TX(r,i,l),f=r.let("valid");e.block$data(f,d),e.ok((n=t.valid)!==null&&n!==void 0?n:f);function d(){if(t.errors===!1)m(),t.modifying&&u9(e),y(()=>e.error());else{const g=t.async?h():p();t.modifying&&u9(e),y(()=>xOe(e,g))}}function h(){const g=r.let("ruleErrs",null);return r.try(()=>m((0,as._)`await `),_=>r.assign(f,!1).if((0,as._)`${_} instanceof ${u.ValidationError}`,()=>r.assign(g,(0,as._)`${_}.errors`),()=>r.throw(_))),g}function p(){const g=(0,as._)`${c}.errors`;return r.assign(g,null),m(as.nil),g}function m(g=t.async?(0,as._)`await `:as.nil){const _=u.opts.passContext?Hf.default.this:Hf.default.self,b=!("compile"in t&&!a||t.schema===!1);r.assign(f,(0,as._)`${g}${(0,wOe.callValidateCode)(e,c,_,b)}`,t.modifying)}function y(g){var _;r.if((0,as.not)((_=t.valid)!==null&&_!==void 0?_:f),g)}}uu.funcKeywordCode=IOe;function u9(e){const{gen:t,data:n,it:r}=e;t.if(r.parentData,()=>t.assign(n,(0,as._)`${r.parentData}[${r.parentDataProperty}]`))}function xOe(e,t){const{gen:n}=e;n.if((0,as._)`Array.isArray(${t})`,()=>{n.assign(Hf.default.vErrors,(0,as._)`${Hf.default.vErrors} === null ? ${t} : ${Hf.default.vErrors}.concat(${t})`).assign(Hf.default.errors,(0,as._)`${Hf.default.vErrors}.length`),(0,TOe.extendErrors)(e)},()=>e.error())}function COe({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}function TX(e,t,n){if(n===void 0)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof n=="function"?{ref:n}:{ref:n,code:(0,as.stringify)(n)})}function AOe(e,t,n=!1){return!t.length||t.some(r=>r==="array"?Array.isArray(e):r==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==r||n&&typeof e>"u")}uu.validSchemaType=AOe;function OOe({schema:e,opts:t,self:n,errSchemaPath:r},i,s){if(Array.isArray(i.keyword)?!i.keyword.includes(s):i.keyword!==s)throw new Error("ajv implementation error");const o=i.dependencies;if(o!=null&&o.some(a=>!Object.prototype.hasOwnProperty.call(e,a)))throw new Error(`parent schema must have dependencies of ${s}: ${o.join(",")}`);if(i.validateSchema&&!i.validateSchema(e[s])){const u=`keyword "${s}" value is invalid at path "${r}": `+n.errorsText(i.validateSchema.errors);if(t.validateSchema==="log")n.logger.error(u);else throw new Error(u)}}uu.validateKeywordUsage=OOe;var jc={};Object.defineProperty(jc,"__esModule",{value:!0});jc.extendSubschemaMode=jc.extendSubschemaData=jc.getSubschema=void 0;const Ja=Yt,SX=pn;function POe(e,{keyword:t,schemaProp:n,schema:r,schemaPath:i,errSchemaPath:s,topSchemaRef:o}){if(t!==void 0&&r!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){const a=e.schema[t];return n===void 0?{schema:a,schemaPath:(0,Ja._)`${e.schemaPath}${(0,Ja.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:a[n],schemaPath:(0,Ja._)`${e.schemaPath}${(0,Ja.getProperty)(t)}${(0,Ja.getProperty)(n)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,SX.escapeFragment)(n)}`}}if(r!==void 0){if(i===void 0||s===void 0||o===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:r,schemaPath:i,topSchemaRef:o,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}jc.getSubschema=POe;function ROe(e,t,{dataProp:n,dataPropType:r,data:i,dataTypes:s,propertyName:o}){if(i!==void 0&&n!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:a}=t;if(n!==void 0){const{errorPath:l,dataPathArr:c,opts:f}=t,d=a.let("data",(0,Ja._)`${t.data}${(0,Ja.getProperty)(n)}`,!0);u(d),e.errorPath=(0,Ja.str)`${l}${(0,SX.getErrorPath)(n,r,f.jsPropertySyntax)}`,e.parentDataProperty=(0,Ja._)`${n}`,e.dataPathArr=[...c,e.parentDataProperty]}if(i!==void 0){const l=i instanceof Ja.Name?i:a.let("data",i,!0);u(l),o!==void 0&&(e.propertyName=o)}s&&(e.dataTypes=s);function u(l){e.data=l,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,l]}}jc.extendSubschemaData=ROe;function NOe(e,{jtdDiscriminator:t,jtdMetadata:n,compositeRule:r,createErrors:i,allErrors:s}){r!==void 0&&(e.compositeRule=r),i!==void 0&&(e.createErrors=i),s!==void 0&&(e.allErrors=s),e.jtdDiscriminator=t,e.jtdMetadata=n}jc.extendSubschemaMode=NOe;var Ai={},Vk=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var r,i,s;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(s=Object.keys(t),r=s.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,s[i]))return!1;for(i=r;i--!==0;){var o=s[i];if(!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n};const l9=ka(Vk);var IX={exports:{}},Ic=IX.exports=function(e,t,n){typeof t=="function"&&(n=t,t={}),n=t.cb||n;var r=typeof n=="function"?n:n.pre||function(){},i=n.post||function(){};nb(t,r,i,e,"",e)};Ic.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Ic.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Ic.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Ic.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function nb(e,t,n,r,i,s,o,a,u,l){if(r&&typeof r=="object"&&!Array.isArray(r)){t(r,i,s,o,a,u,l);for(var c in r){var f=r[c];if(Array.isArray(f)){if(c in Ic.arrayKeywords)for(var d=0;dt+=xX(r)),t===1/0))return 1/0}return t}function CX(e,t="",n){n!==!1&&(t=_p(t));const r=e.parse(t);return AX(e,r)}Ai.getFullPath=CX;function AX(e,t){return e.serialize(t).split("#")[0]+"#"}Ai._getFullPath=AX;const UOe=/#\/?$/;function _p(e){return e?e.replace(UOe,""):""}Ai.normalizeId=_p;function VOe(e,t,n){return n=_p(n),e.resolve(t,n)}Ai.resolveUrl=VOe;const zOe=/^[a-z_][-a-z0-9._]*$/i;function HOe(e,t){if(typeof e=="boolean")return{};const{schemaId:n,uriResolver:r}=this.opts,i=_p(e[n]||t),s={"":i},o=CX(r,i,!1),a={},u=new Set;return MOe(e,{allKeys:!0},(f,d,h,p)=>{if(p===void 0)return;const m=o+d;let y=s[p];typeof f[n]=="string"&&(y=g.call(this,f[n])),_.call(this,f.$anchor),_.call(this,f.$dynamicAnchor),s[d]=y;function g(b){const T=this.opts.uriResolver.resolve;if(b=_p(y?T(y,b):b),u.has(b))throw c(b);u.add(b);let I=this.refs[b];return typeof I=="string"&&(I=this.refs[I]),typeof I=="object"?l(f,I.schema,b):b!==_p(m)&&(b[0]==="#"?(l(f,a[b],b),a[b]=f):this.refs[b]=m),b}function _(b){if(typeof b=="string"){if(!zOe.test(b))throw new Error(`invalid anchor "${b}"`);g.call(this,`#${b}`)}}}),a;function l(f,d,h){if(d!==void 0&&!LOe(f,d))throw c(h)}function c(f){return new Error(`reference "${f}" resolves to more than one schema`)}}Ai.getSchemaRefs=HOe;Object.defineProperty(Ia,"__esModule",{value:!0});Ia.getData=Ia.KeywordCxt=Ia.validateFunctionCode=void 0;const OX=em,c9=P_,zk=ml,jw=P_,WOe=dI,N0=uu,XC=jc,et=Yt,yt=ju,qOe=Ai,gl=pn,Rg=O_;function YOe(e){if(NX(e)&&(kX(e),RX(e))){QOe(e);return}PX(e,()=>(0,OX.topBoolOrEmptySchema)(e))}Ia.validateFunctionCode=YOe;function PX({gen:e,validateName:t,schema:n,schemaEnv:r,opts:i},s){i.code.es5?e.func(t,(0,et._)`${yt.default.data}, ${yt.default.valCxt}`,r.$async,()=>{e.code((0,et._)`"use strict"; ${f9(n,i)}`),KOe(e,i),e.code(s)}):e.func(t,(0,et._)`${yt.default.data}, ${GOe(i)}`,r.$async,()=>e.code(f9(n,i)).code(s))}function GOe(e){return(0,et._)`{${yt.default.instancePath}="", ${yt.default.parentData}, ${yt.default.parentDataProperty}, ${yt.default.rootData}=${yt.default.data}${e.dynamicRef?(0,et._)`, ${yt.default.dynamicAnchors}={}`:et.nil}}={}`}function KOe(e,t){e.if(yt.default.valCxt,()=>{e.var(yt.default.instancePath,(0,et._)`${yt.default.valCxt}.${yt.default.instancePath}`),e.var(yt.default.parentData,(0,et._)`${yt.default.valCxt}.${yt.default.parentData}`),e.var(yt.default.parentDataProperty,(0,et._)`${yt.default.valCxt}.${yt.default.parentDataProperty}`),e.var(yt.default.rootData,(0,et._)`${yt.default.valCxt}.${yt.default.rootData}`),t.dynamicRef&&e.var(yt.default.dynamicAnchors,(0,et._)`${yt.default.valCxt}.${yt.default.dynamicAnchors}`)},()=>{e.var(yt.default.instancePath,(0,et._)`""`),e.var(yt.default.parentData,(0,et._)`undefined`),e.var(yt.default.parentDataProperty,(0,et._)`undefined`),e.var(yt.default.rootData,yt.default.data),t.dynamicRef&&e.var(yt.default.dynamicAnchors,(0,et._)`{}`)})}function QOe(e){const{schema:t,opts:n,gen:r}=e;PX(e,()=>{n.$comment&&t.$comment&&$X(e),tPe(e),r.let(yt.default.vErrors,null),r.let(yt.default.errors,0),n.unevaluated&&XOe(e),DX(e),iPe(e)})}function XOe(e){const{gen:t,validateName:n}=e;e.evaluated=t.const("evaluated",(0,et._)`${n}.evaluated`),t.if((0,et._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,et._)`${e.evaluated}.props`,(0,et._)`undefined`)),t.if((0,et._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,et._)`${e.evaluated}.items`,(0,et._)`undefined`))}function f9(e,t){const n=typeof e=="object"&&e[t.schemaId];return n&&(t.code.source||t.code.process)?(0,et._)`/*# sourceURL=${n} */`:et.nil}function JOe(e,t){if(NX(e)&&(kX(e),RX(e))){ZOe(e,t);return}(0,OX.boolOrEmptySchema)(e,t)}function RX({schema:e,self:t}){if(typeof e=="boolean")return!e;for(const n in e)if(t.RULES.all[n])return!0;return!1}function NX(e){return typeof e.schema!="boolean"}function ZOe(e,t){const{schema:n,gen:r,opts:i}=e;i.$comment&&n.$comment&&$X(e),nPe(e),rPe(e);const s=r.const("_errs",yt.default.errors);DX(e,s),r.var(t,(0,et._)`${s} === ${yt.default.errors}`)}function kX(e){(0,gl.checkUnknownRules)(e),ePe(e)}function DX(e,t){if(e.opts.jtd)return d9(e,[],!1,t);const n=(0,c9.getSchemaTypes)(e.schema),r=(0,c9.coerceAndCheckDataType)(e,n);d9(e,n,!r,t)}function ePe(e){const{schema:t,errSchemaPath:n,opts:r,self:i}=e;t.$ref&&r.ignoreKeywordsWithRef&&(0,gl.schemaHasRulesButRef)(t,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${n}"`)}function tPe(e){const{schema:t,opts:n}=e;t.default!==void 0&&n.useDefaults&&n.strictSchema&&(0,gl.checkStrictMode)(e,"default is ignored in the schema root")}function nPe(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,qOe.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function rPe(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}function $X({gen:e,schemaEnv:t,schema:n,errSchemaPath:r,opts:i}){const s=n.$comment;if(i.$comment===!0)e.code((0,et._)`${yt.default.self}.logger.log(${s})`);else if(typeof i.$comment=="function"){const o=(0,et.str)`${r}/$comment`,a=e.scopeValue("root",{ref:t.root});e.code((0,et._)`${yt.default.self}.opts.$comment(${s}, ${o}, ${a}.schema)`)}}function iPe(e){const{gen:t,schemaEnv:n,validateName:r,ValidationError:i,opts:s}=e;n.$async?t.if((0,et._)`${yt.default.errors} === 0`,()=>t.return(yt.default.data),()=>t.throw((0,et._)`new ${i}(${yt.default.vErrors})`)):(t.assign((0,et._)`${r}.errors`,yt.default.vErrors),s.unevaluated&&sPe(e),t.return((0,et._)`${yt.default.errors} === 0`))}function sPe({gen:e,evaluated:t,props:n,items:r}){n instanceof et.Name&&e.assign((0,et._)`${t}.props`,n),r instanceof et.Name&&e.assign((0,et._)`${t}.items`,r)}function d9(e,t,n,r){const{gen:i,schema:s,data:o,allErrors:a,opts:u,self:l}=e,{RULES:c}=l;if(s.$ref&&(u.ignoreKeywordsWithRef||!(0,gl.schemaHasRulesButRef)(s,c))){i.block(()=>FX(e,"$ref",c.all.$ref.definition));return}u.jtd||oPe(e,t),i.block(()=>{for(const d of c.rules)f(d);f(c.post)});function f(d){(0,zk.shouldUseGroup)(s,d)&&(d.type?(i.if((0,jw.checkDataType)(d.type,o,u.strictNumbers)),h9(e,d),t.length===1&&t[0]===d.type&&n&&(i.else(),(0,jw.reportTypeError)(e)),i.endIf()):h9(e,d),a||i.if((0,et._)`${yt.default.errors} === ${r||0}`))}}function h9(e,t){const{gen:n,schema:r,opts:{useDefaults:i}}=e;i&&(0,WOe.assignDefaults)(e,t.type),n.block(()=>{for(const s of t.rules)(0,zk.shouldUseRule)(r,s)&&FX(e,s.keyword,s.definition,t.type)})}function oPe(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(aPe(e,t),e.opts.allowUnionTypes||uPe(e,t),lPe(e,e.dataTypes))}function aPe(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(n=>{LX(e.dataTypes,n)||Hk(e,`type "${n}" not allowed by context "${e.dataTypes.join(",")}"`)}),fPe(e,t)}}function uPe(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&Hk(e,"use allowUnionTypes to allow union type keyword")}function lPe(e,t){const n=e.self.RULES.all;for(const r in n){const i=n[r];if(typeof i=="object"&&(0,zk.shouldUseRule)(e.schema,i)){const{type:s}=i.definition;s.length&&!s.some(o=>cPe(t,o))&&Hk(e,`missing type "${s.join(",")}" for keyword "${r}"`)}}}function cPe(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function LX(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function fPe(e,t){const n=[];for(const r of e.dataTypes)LX(t,r)?n.push(r):t.includes("integer")&&r==="number"&&n.push("integer");e.dataTypes=n}function Hk(e,t){const n=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${n}" (strictTypes)`,(0,gl.checkStrictMode)(e,t,e.opts.strictTypes)}class MX{constructor(t,n,r){if((0,N0.validateKeywordUsage)(t,n,r),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=r,this.data=t.data,this.schema=t.schema[r],this.$data=n.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,gl.schemaRefOrVal)(t,this.schema,r,this.$data),this.schemaType=n.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=n,this.$data)this.schemaCode=t.gen.const("vSchema",BX(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,N0.validSchemaType)(this.schema,n.schemaType,n.allowUndefined))throw new Error(`${r} value must be ${JSON.stringify(n.schemaType)}`);("code"in n?n.trackErrors:n.errors!==!1)&&(this.errsCount=t.gen.const("_errs",yt.default.errors))}result(t,n,r){this.failResult((0,et.not)(t),n,r)}failResult(t,n,r){this.gen.if(t),r?r():this.error(),n?(this.gen.else(),n(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(t,n){this.failResult((0,et.not)(t),void 0,n)}fail(t){if(t===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(t),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);const{schemaCode:n}=this;this.fail((0,et._)`${n} !== undefined && (${(0,et.or)(this.invalid$data(),t)})`)}error(t,n,r){if(n){this.setParams(n),this._error(t,r),this.setParams({});return}this._error(t,r)}_error(t,n){(t?Rg.reportExtraError:Rg.reportError)(this,this.def.error,n)}$dataError(){(0,Rg.reportError)(this,this.def.$dataError||Rg.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Rg.resetErrorsCount)(this.gen,this.errsCount)}ok(t){this.allErrors||this.gen.if(t)}setParams(t,n){n?Object.assign(this.params,t):this.params=t}block$data(t,n,r=et.nil){this.gen.block(()=>{this.check$data(t,r),n()})}check$data(t=et.nil,n=et.nil){if(!this.$data)return;const{gen:r,schemaCode:i,schemaType:s,def:o}=this;r.if((0,et.or)((0,et._)`${i} === undefined`,n)),t!==et.nil&&r.assign(t,!0),(s.length||o.validateSchema)&&(r.elseIf(this.invalid$data()),this.$dataError(),t!==et.nil&&r.assign(t,!1)),r.else()}invalid$data(){const{gen:t,schemaCode:n,schemaType:r,def:i,it:s}=this;return(0,et.or)(o(),a());function o(){if(r.length){if(!(n instanceof et.Name))throw new Error("ajv implementation error");const u=Array.isArray(r)?r:[r];return(0,et._)`${(0,jw.checkDataTypes)(u,n,s.opts.strictNumbers,jw.DataType.Wrong)}`}return et.nil}function a(){if(i.validateSchema){const u=t.scopeValue("validate$data",{ref:i.validateSchema});return(0,et._)`!${u}(${n})`}return et.nil}}subschema(t,n){const r=(0,XC.getSubschema)(this.it,t);(0,XC.extendSubschemaData)(r,this.it,t),(0,XC.extendSubschemaMode)(r,t);const i={...this.it,...r,items:void 0,props:void 0};return JOe(i,n),i}mergeEvaluated(t,n){const{it:r,gen:i}=this;r.opts.unevaluated&&(r.props!==!0&&t.props!==void 0&&(r.props=gl.mergeEvaluated.props(i,t.props,r.props,n)),r.items!==!0&&t.items!==void 0&&(r.items=gl.mergeEvaluated.items(i,t.items,r.items,n)))}mergeValidEvaluated(t,n){const{it:r,gen:i}=this;if(r.opts.unevaluated&&(r.props!==!0||r.items!==!0))return i.if(n,()=>this.mergeEvaluated(t,et.Name)),!0}}Ia.KeywordCxt=MX;function FX(e,t,n,r){const i=new MX(e,n,t);"code"in n?n.code(i,r):i.$data&&n.validate?(0,N0.funcKeywordCode)(i,n):"macro"in n?(0,N0.macroKeywordCode)(i,n):(n.compile||n.validate)&&(0,N0.funcKeywordCode)(i,n)}const dPe=/^\/(?:[^~]|~0|~1)*$/,hPe=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function BX(e,{dataLevel:t,dataNames:n,dataPathArr:r}){let i,s;if(e==="")return yt.default.rootData;if(e[0]==="/"){if(!dPe.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);i=e,s=yt.default.rootData}else{const l=hPe.exec(e);if(!l)throw new Error(`Invalid JSON-pointer: ${e}`);const c=+l[1];if(i=l[2],i==="#"){if(c>=t)throw new Error(u("property/index",c));return r[t-c]}if(c>t)throw new Error(u("data",c));if(s=n[t-c],!i)return s}let o=s;const a=i.split("/");for(const l of a)l&&(s=(0,et._)`${s}${(0,et.getProperty)((0,gl.unescapeJsonPointer)(l))}`,o=(0,et._)`${o} && ${s}`);return o;function u(l,c){return`Cannot access ${l} ${c} levels up, current level is ${t}`}}Ia.getData=BX;var R_={};Object.defineProperty(R_,"__esModule",{value:!0});class pPe extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}}R_.default=pPe;var N_={};Object.defineProperty(N_,"__esModule",{value:!0});const JC=Ai;class mPe extends Error{constructor(t,n,r,i){super(i||`can't resolve reference ${r} from id ${n}`),this.missingRef=(0,JC.resolveUrl)(t,n,r),this.missingSchema=(0,JC.normalizeId)((0,JC.getFullPath)(t,this.missingRef))}}N_.default=mPe;var Rs={};Object.defineProperty(Rs,"__esModule",{value:!0});Rs.resolveSchema=Rs.getCompilingSchema=Rs.resolveRef=Rs.compileSchema=Rs.SchemaEnv=void 0;const aa=Yt,gPe=R_,kf=ju,ya=Ai,p9=pn,yPe=Ia;class hI{constructor(t){var n;this.refs={},this.dynamicAnchors={};let r;typeof t.schema=="object"&&(r=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=(n=t.baseId)!==null&&n!==void 0?n:(0,ya.normalizeId)(r==null?void 0:r[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=r==null?void 0:r.$async,this.refs={}}}Rs.SchemaEnv=hI;function Wk(e){const t=jX.call(this,e);if(t)return t;const n=(0,ya.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:r,lines:i}=this.opts.code,{ownProperties:s}=this.opts,o=new aa.CodeGen(this.scope,{es5:r,lines:i,ownProperties:s});let a;e.$async&&(a=o.scopeValue("Error",{ref:gPe.default,code:(0,aa._)`require("ajv/dist/runtime/validation_error").default`}));const u=o.scopeName("validate");e.validateName=u;const l={gen:o,allErrors:this.opts.allErrors,data:kf.default.data,parentData:kf.default.parentData,parentDataProperty:kf.default.parentDataProperty,dataNames:[kf.default.data],dataPathArr:[aa.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:o.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,aa.stringify)(e.schema)}:{ref:e.schema}),validateName:u,ValidationError:a,schema:e.schema,schemaEnv:e,rootId:n,baseId:e.baseId||n,schemaPath:aa.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,aa._)`""`,opts:this.opts,self:this};let c;try{this._compilations.add(e),(0,yPe.validateFunctionCode)(l),o.optimize(this.opts.code.optimize);const f=o.toString();c=`${o.scopeRefs(kf.default.scope)}return ${f}`,this.opts.code.process&&(c=this.opts.code.process(c,e));const h=new Function(`${kf.default.self}`,`${kf.default.scope}`,c)(this,this.scope.get());if(this.scope.value(u,{ref:h}),h.errors=null,h.schema=e.schema,h.schemaEnv=e,e.$async&&(h.$async=!0),this.opts.code.source===!0&&(h.source={validateName:u,validateCode:f,scopeValues:o._values}),this.opts.unevaluated){const{props:p,items:m}=l;h.evaluated={props:p instanceof aa.Name?void 0:p,items:m instanceof aa.Name?void 0:m,dynamicProps:p instanceof aa.Name,dynamicItems:m instanceof aa.Name},h.source&&(h.source.evaluated=(0,aa.stringify)(h.evaluated))}return e.validate=h,e}catch(f){throw delete e.validate,delete e.validateName,c&&this.logger.error("Error compiling schema, function code:",c),f}finally{this._compilations.delete(e)}}Rs.compileSchema=Wk;function _Pe(e,t,n){var r;n=(0,ya.resolveUrl)(this.opts.uriResolver,t,n);const i=e.refs[n];if(i)return i;let s=EPe.call(this,e,n);if(s===void 0){const o=(r=e.localRefs)===null||r===void 0?void 0:r[n],{schemaId:a}=this.opts;o&&(s=new hI({schema:o,schemaId:a,root:e,baseId:t}))}if(s!==void 0)return e.refs[n]=vPe.call(this,s)}Rs.resolveRef=_Pe;function vPe(e){return(0,ya.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:Wk.call(this,e)}function jX(e){for(const t of this._compilations)if(bPe(t,e))return t}Rs.getCompilingSchema=jX;function bPe(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function EPe(e,t){let n;for(;typeof(n=this.refs[t])=="string";)t=n;return n||this.schemas[t]||pI.call(this,e,t)}function pI(e,t){const n=this.opts.uriResolver.parse(t),r=(0,ya._getFullPath)(this.opts.uriResolver,n);let i=(0,ya.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&r===i)return ZC.call(this,n,e);const s=(0,ya.normalizeId)(r),o=this.refs[s]||this.schemas[s];if(typeof o=="string"){const a=pI.call(this,e,o);return typeof(a==null?void 0:a.schema)!="object"?void 0:ZC.call(this,n,a)}if(typeof(o==null?void 0:o.schema)=="object"){if(o.validate||Wk.call(this,o),s===(0,ya.normalizeId)(t)){const{schema:a}=o,{schemaId:u}=this.opts,l=a[u];return l&&(i=(0,ya.resolveUrl)(this.opts.uriResolver,i,l)),new hI({schema:a,schemaId:u,root:e,baseId:i})}return ZC.call(this,n,o)}}Rs.resolveSchema=pI;const wPe=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function ZC(e,{baseId:t,schema:n,root:r}){var i;if(((i=e.fragment)===null||i===void 0?void 0:i[0])!=="/")return;for(const a of e.fragment.slice(1).split("/")){if(typeof n=="boolean")return;const u=n[(0,p9.unescapeFragment)(a)];if(u===void 0)return;n=u;const l=typeof n=="object"&&n[this.opts.schemaId];!wPe.has(a)&&l&&(t=(0,ya.resolveUrl)(this.opts.uriResolver,t,l))}let s;if(typeof n!="boolean"&&n.$ref&&!(0,p9.schemaHasRulesButRef)(n,this.RULES)){const a=(0,ya.resolveUrl)(this.opts.uriResolver,t,n.$ref);s=pI.call(this,r,a)}const{schemaId:o}=this.opts;if(s=s||new hI({schema:n,schemaId:o,root:r,baseId:t}),s.schema!==s.root.schema)return s}const TPe="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",SPe="Meta-schema for $data reference (JSON AnySchema extension proposal)",IPe="object",xPe=["$data"],CPe={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},APe=!1,OPe={$id:TPe,description:SPe,type:IPe,required:xPe,properties:CPe,additionalProperties:APe};var qk={},XP={exports:{}};/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */(function(e,t){(function(n,r){r(t)})(io,function(n){function r(){for(var Q=arguments.length,j=Array(Q),Z=0;Z1){j[0]=j[0].slice(0,-1);for(var de=j.length-1,fe=1;fe= 0x80 (not a basic code point)","invalid-input":"Invalid input"},M=m-y,H=Math.floor,J=String.fromCharCode;function Y(Q){throw new RangeError(V[Q])}function ye(Q,j){for(var Z=[],de=Q.length;de--;)Z[de]=j(Q[de]);return Z}function he(Q,j){var Z=Q.split("@"),de="";Z.length>1&&(de=Z[0]+"@",Q=Z[1]),Q=Q.replace(P,".");var fe=Q.split("."),He=ye(fe,j).join(".");return de+He}function ve(Q){for(var j=[],Z=0,de=Q.length;Z=55296&&fe<=56319&&Z>1,j+=H(j/Z);j>M*g>>1;fe+=m)j=H(j/M);return H(fe+(M+1)*j/(j+_))},C=function(j){var Z=[],de=j.length,fe=0,He=I,Te=T,Ve=j.lastIndexOf(E);Ve<0&&(Ve=0);for(var ft=0;ft=128&&Y("not-basic"),Z.push(j.charCodeAt(ft));for(var Je=Ve>0?Ve+1:0;Je=de&&Y("invalid-input");var pt=se(j.charCodeAt(Je++));(pt>=m||pt>H((p-fe)/Lt))&&Y("overflow"),fe+=pt*Lt;var xn=$n<=Te?y:$n>=Te+g?g:$n-Te;if(ptH(p/Et)&&Y("overflow"),Lt*=Et}var mn=Z.length+1;Te=x(fe-mt,mn,mt==0),H(fe/mn)>p-He&&Y("overflow"),He+=H(fe/mn),fe%=mn,Z.splice(fe++,0,He)}return String.fromCodePoint.apply(String,Z)},z=function(j){var Z=[];j=ve(j);var de=j.length,fe=I,He=0,Te=T,Ve=!0,ft=!1,Je=void 0;try{for(var mt=j[Symbol.iterator](),Lt;!(Ve=(Lt=mt.next()).done);Ve=!0){var $n=Lt.value;$n<128&&Z.push(J($n))}}catch(be){ft=!0,Je=be}finally{try{!Ve&&mt.return&&mt.return()}finally{if(ft)throw Je}}var pt=Z.length,xn=pt;for(pt&&Z.push(E);xn=fe&&_iH((p-He)/hr)&&Y("overflow"),He+=(Et-fe)*hr,fe=Et;var Ye=!0,zt=!1,Hn=void 0;try{for(var ii=j[Symbol.iterator](),gs;!(Ye=(gs=ii.next()).done);Ye=!0){var N=gs.value;if(Np&&Y("overflow"),N==fe){for(var G=He,F=m;;F+=m){var ne=F<=Te?y:F>=Te+g?g:F-Te;if(G>6|192).toString(16).toUpperCase()+"%"+(j&63|128).toString(16).toUpperCase():Z="%"+(j>>12|224).toString(16).toUpperCase()+"%"+(j>>6&63|128).toString(16).toUpperCase()+"%"+(j&63|128).toString(16).toUpperCase(),Z}function pe(Q){for(var j="",Z=0,de=Q.length;Z=194&&fe<224){if(de-Z>=6){var He=parseInt(Q.substr(Z+4,2),16);j+=String.fromCharCode((fe&31)<<6|He&63)}else j+=Q.substr(Z,6);Z+=6}else if(fe>=224){if(de-Z>=9){var Te=parseInt(Q.substr(Z+4,2),16),Ve=parseInt(Q.substr(Z+7,2),16);j+=String.fromCharCode((fe&15)<<12|(Te&63)<<6|Ve&63)}else j+=Q.substr(Z,9);Z+=9}else j+=Q.substr(Z,3),Z+=3}return j}function me(Q,j){function Z(de){var fe=pe(de);return fe.match(j.UNRESERVED)?fe:de}return Q.scheme&&(Q.scheme=String(Q.scheme).replace(j.PCT_ENCODED,Z).toLowerCase().replace(j.NOT_SCHEME,"")),Q.userinfo!==void 0&&(Q.userinfo=String(Q.userinfo).replace(j.PCT_ENCODED,Z).replace(j.NOT_USERINFO,ae).replace(j.PCT_ENCODED,o)),Q.host!==void 0&&(Q.host=String(Q.host).replace(j.PCT_ENCODED,Z).toLowerCase().replace(j.NOT_HOST,ae).replace(j.PCT_ENCODED,o)),Q.path!==void 0&&(Q.path=String(Q.path).replace(j.PCT_ENCODED,Z).replace(Q.scheme?j.NOT_PATH:j.NOT_PATH_NOSCHEME,ae).replace(j.PCT_ENCODED,o)),Q.query!==void 0&&(Q.query=String(Q.query).replace(j.PCT_ENCODED,Z).replace(j.NOT_QUERY,ae).replace(j.PCT_ENCODED,o)),Q.fragment!==void 0&&(Q.fragment=String(Q.fragment).replace(j.PCT_ENCODED,Z).replace(j.NOT_FRAGMENT,ae).replace(j.PCT_ENCODED,o)),Q}function Se(Q){return Q.replace(/^0*(.*)/,"$1")||"0"}function ce(Q,j){var Z=Q.match(j.IPV4ADDRESS)||[],de=d(Z,2),fe=de[1];return fe?fe.split(".").map(Se).join("."):Q}function st(Q,j){var Z=Q.match(j.IPV6ADDRESS)||[],de=d(Z,3),fe=de[1],He=de[2];if(fe){for(var Te=fe.toLowerCase().split("::").reverse(),Ve=d(Te,2),ft=Ve[0],Je=Ve[1],mt=Je?Je.split(":").map(Se):[],Lt=ft.split(":").map(Se),$n=j.IPV4ADDRESS.test(Lt[Lt.length-1]),pt=$n?7:8,xn=Lt.length-pt,Et=Array(pt),mn=0;mn1){var is=Et.slice(0,Wr.index),_i=Et.slice(Wr.index+Wr.length);Pr=is.join(":")+"::"+_i.join(":")}else Pr=Et.join(":");return He&&(Pr+="%"+He),Pr}else return Q}var Ke=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,qe="".match(/(){0}/)[1]===void 0;function $e(Q){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Z={},de=j.iri!==!1?f:c;j.reference==="suffix"&&(Q=(j.scheme?j.scheme+":":"")+"//"+Q);var fe=Q.match(Ke);if(fe){qe?(Z.scheme=fe[1],Z.userinfo=fe[3],Z.host=fe[4],Z.port=parseInt(fe[5],10),Z.path=fe[6]||"",Z.query=fe[7],Z.fragment=fe[8],isNaN(Z.port)&&(Z.port=fe[5])):(Z.scheme=fe[1]||void 0,Z.userinfo=Q.indexOf("@")!==-1?fe[3]:void 0,Z.host=Q.indexOf("//")!==-1?fe[4]:void 0,Z.port=parseInt(fe[5],10),Z.path=fe[6]||"",Z.query=Q.indexOf("?")!==-1?fe[7]:void 0,Z.fragment=Q.indexOf("#")!==-1?fe[8]:void 0,isNaN(Z.port)&&(Z.port=Q.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?fe[4]:void 0)),Z.host&&(Z.host=st(ce(Z.host,de),de)),Z.scheme===void 0&&Z.userinfo===void 0&&Z.host===void 0&&Z.port===void 0&&!Z.path&&Z.query===void 0?Z.reference="same-document":Z.scheme===void 0?Z.reference="relative":Z.fragment===void 0?Z.reference="absolute":Z.reference="uri",j.reference&&j.reference!=="suffix"&&j.reference!==Z.reference&&(Z.error=Z.error||"URI is not a "+j.reference+" reference.");var He=le[(j.scheme||Z.scheme||"").toLowerCase()];if(!j.unicodeSupport&&(!He||!He.unicodeSupport)){if(Z.host&&(j.domainHost||He&&He.domainHost))try{Z.host=q.toASCII(Z.host.replace(de.PCT_ENCODED,pe).toLowerCase())}catch(Te){Z.error=Z.error||"Host's domain name can not be converted to ASCII via punycode: "+Te}me(Z,c)}else me(Z,de);He&&He.parse&&He.parse(Z,j)}else Z.error=Z.error||"URI can not be parsed.";return Z}function ot(Q,j){var Z=j.iri!==!1?f:c,de=[];return Q.userinfo!==void 0&&(de.push(Q.userinfo),de.push("@")),Q.host!==void 0&&de.push(st(ce(String(Q.host),Z),Z).replace(Z.IPV6ADDRESS,function(fe,He,Te){return"["+He+(Te?"%25"+Te:"")+"]"})),(typeof Q.port=="number"||typeof Q.port=="string")&&(de.push(":"),de.push(String(Q.port))),de.length?de.join(""):void 0}var lt=/^\.\.?\//,On=/^\/\.(\/|$)/,Ue=/^\/\.\.(\/|$)/,Be=/^\/?(?:.|\n)*?(?=\/|$)/;function bt(Q){for(var j=[];Q.length;)if(Q.match(lt))Q=Q.replace(lt,"");else if(Q.match(On))Q=Q.replace(On,"/");else if(Q.match(Ue))Q=Q.replace(Ue,"/"),j.pop();else if(Q==="."||Q==="..")Q="";else{var Z=Q.match(Be);if(Z){var de=Z[0];Q=Q.slice(de.length),j.push(de)}else throw new Error("Unexpected dot segment condition")}return j.join("")}function je(Q){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Z=j.iri?f:c,de=[],fe=le[(j.scheme||Q.scheme||"").toLowerCase()];if(fe&&fe.serialize&&fe.serialize(Q,j),Q.host&&!Z.IPV6ADDRESS.test(Q.host)){if(j.domainHost||fe&&fe.domainHost)try{Q.host=j.iri?q.toUnicode(Q.host):q.toASCII(Q.host.replace(Z.PCT_ENCODED,pe).toLowerCase())}catch(Ve){Q.error=Q.error||"Host's domain name can not be converted to "+(j.iri?"Unicode":"ASCII")+" via punycode: "+Ve}}me(Q,Z),j.reference!=="suffix"&&Q.scheme&&(de.push(Q.scheme),de.push(":"));var He=ot(Q,j);if(He!==void 0&&(j.reference!=="suffix"&&de.push("//"),de.push(He),Q.path&&Q.path.charAt(0)!=="/"&&de.push("/")),Q.path!==void 0){var Te=Q.path;!j.absolutePath&&(!fe||!fe.absolutePath)&&(Te=bt(Te)),He===void 0&&(Te=Te.replace(/^\/\//,"/%2F")),de.push(Te)}return Q.query!==void 0&&(de.push("?"),de.push(Q.query)),Q.fragment!==void 0&&(de.push("#"),de.push(Q.fragment)),de.join("")}function gt(Q,j){var Z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},de=arguments[3],fe={};return de||(Q=$e(je(Q,Z),Z),j=$e(je(j,Z),Z)),Z=Z||{},!Z.tolerant&&j.scheme?(fe.scheme=j.scheme,fe.userinfo=j.userinfo,fe.host=j.host,fe.port=j.port,fe.path=bt(j.path||""),fe.query=j.query):(j.userinfo!==void 0||j.host!==void 0||j.port!==void 0?(fe.userinfo=j.userinfo,fe.host=j.host,fe.port=j.port,fe.path=bt(j.path||""),fe.query=j.query):(j.path?(j.path.charAt(0)==="/"?fe.path=bt(j.path):((Q.userinfo!==void 0||Q.host!==void 0||Q.port!==void 0)&&!Q.path?fe.path="/"+j.path:Q.path?fe.path=Q.path.slice(0,Q.path.lastIndexOf("/")+1)+j.path:fe.path=j.path,fe.path=bt(fe.path)),fe.query=j.query):(fe.path=Q.path,j.query!==void 0?fe.query=j.query:fe.query=Q.query),fe.userinfo=Q.userinfo,fe.host=Q.host,fe.port=Q.port),fe.scheme=Q.scheme),fe.fragment=j.fragment,fe}function Gt(Q,j,Z){var de=u({scheme:"null"},Z);return je(gt($e(Q,de),$e(j,de),de,!0),de)}function an(Q,j){return typeof Q=="string"?Q=je($e(Q,j),j):s(Q)==="object"&&(Q=$e(je(Q,j),j)),Q}function Gn(Q,j,Z){return typeof Q=="string"?Q=je($e(Q,Z),Z):s(Q)==="object"&&(Q=je(Q,Z)),typeof j=="string"?j=je($e(j,Z),Z):s(j)==="object"&&(j=je(j,Z)),Q===j}function ue(Q,j){return Q&&Q.toString().replace(!j||!j.iri?c.ESCAPE:f.ESCAPE,ae)}function we(Q,j){return Q&&Q.toString().replace(!j||!j.iri?c.PCT_ENCODED:f.PCT_ENCODED,pe)}var Le={scheme:"http",domainHost:!0,parse:function(j,Z){return j.host||(j.error=j.error||"HTTP URIs must have a host."),j},serialize:function(j,Z){var de=String(j.scheme).toLowerCase()==="https";return(j.port===(de?443:80)||j.port==="")&&(j.port=void 0),j.path||(j.path="/"),j}},rt={scheme:"https",domainHost:Le.domainHost,parse:Le.parse,serialize:Le.serialize};function De(Q){return typeof Q.secure=="boolean"?Q.secure:String(Q.scheme).toLowerCase()==="wss"}var it={scheme:"ws",domainHost:!0,parse:function(j,Z){var de=j;return de.secure=De(de),de.resourceName=(de.path||"/")+(de.query?"?"+de.query:""),de.path=void 0,de.query=void 0,de},serialize:function(j,Z){if((j.port===(De(j)?443:80)||j.port==="")&&(j.port=void 0),typeof j.secure=="boolean"&&(j.scheme=j.secure?"wss":"ws",j.secure=void 0),j.resourceName){var de=j.resourceName.split("?"),fe=d(de,2),He=fe[0],Te=fe[1];j.path=He&&He!=="/"?He:void 0,j.query=Te,j.resourceName=void 0}return j.fragment=void 0,j}},Me={scheme:"wss",domainHost:it.domainHost,parse:it.parse,serialize:it.serialize},Ze={},bn="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",Wt="[0-9A-Fa-f]",It=i(i("%[EFef]"+Wt+"%"+Wt+Wt+"%"+Wt+Wt)+"|"+i("%[89A-Fa-f]"+Wt+"%"+Wt+Wt)+"|"+i("%"+Wt+Wt)),Bn="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",En="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",sa=r(En,'[\\"\\\\]'),fr="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",Mi=new RegExp(bn,"g"),vr=new RegExp(It,"g"),$r=new RegExp(r("[^]",Bn,"[\\.]",'[\\"]',sa),"g"),dr=new RegExp(r("[^]",bn,fr),"g"),jn=dr;function Zt(Q){var j=pe(Q);return j.match(Mi)?j:Q}var ri={scheme:"mailto",parse:function(j,Z){var de=j,fe=de.to=de.path?de.path.split(","):[];if(de.path=void 0,de.query){for(var He=!1,Te={},Ve=de.query.split("&"),ft=0,Je=Ve.length;ftnew RegExp(K,x);h.code="new RegExp";const p=["removeAdditional","useDefaults","coerceTypes"],m=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),y={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},g={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},_=200;function b(K){var x,C,z,R,O,q,le,ae,pe,me,Se,ce,st,Ke,qe,$e,ot,lt,On,Ue,Be,bt,je,gt,Gt;const an=K.strict,Gn=(x=K.code)===null||x===void 0?void 0:x.optimize,ue=Gn===!0||Gn===void 0?1:Gn||0,we=(z=(C=K.code)===null||C===void 0?void 0:C.regExp)!==null&&z!==void 0?z:h,Le=(R=K.uriResolver)!==null&&R!==void 0?R:d.default;return{strictSchema:(q=(O=K.strictSchema)!==null&&O!==void 0?O:an)!==null&&q!==void 0?q:!0,strictNumbers:(ae=(le=K.strictNumbers)!==null&&le!==void 0?le:an)!==null&&ae!==void 0?ae:!0,strictTypes:(me=(pe=K.strictTypes)!==null&&pe!==void 0?pe:an)!==null&&me!==void 0?me:"log",strictTuples:(ce=(Se=K.strictTuples)!==null&&Se!==void 0?Se:an)!==null&&ce!==void 0?ce:"log",strictRequired:(Ke=(st=K.strictRequired)!==null&&st!==void 0?st:an)!==null&&Ke!==void 0?Ke:!1,code:K.code?{...K.code,optimize:ue,regExp:we}:{optimize:ue,regExp:we},loopRequired:(qe=K.loopRequired)!==null&&qe!==void 0?qe:_,loopEnum:($e=K.loopEnum)!==null&&$e!==void 0?$e:_,meta:(ot=K.meta)!==null&&ot!==void 0?ot:!0,messages:(lt=K.messages)!==null&<!==void 0?lt:!0,inlineRefs:(On=K.inlineRefs)!==null&&On!==void 0?On:!0,schemaId:(Ue=K.schemaId)!==null&&Ue!==void 0?Ue:"$id",addUsedSchema:(Be=K.addUsedSchema)!==null&&Be!==void 0?Be:!0,validateSchema:(bt=K.validateSchema)!==null&&bt!==void 0?bt:!0,validateFormats:(je=K.validateFormats)!==null&&je!==void 0?je:!0,unicodeRegExp:(gt=K.unicodeRegExp)!==null&>!==void 0?gt:!0,int32range:(Gt=K.int32range)!==null&&Gt!==void 0?Gt:!0,uriResolver:Le}}class T{constructor(x={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,x=this.opts={...x,...b(x)};const{es5:C,lines:z}=this.opts.code;this.scope=new a.ValueScope({scope:{},prefixes:m,es5:C,lines:z}),this.logger=H(x.logger);const R=x.validateFormats;x.validateFormats=!1,this.RULES=(0,s.getRules)(),I.call(this,y,x,"NOT SUPPORTED"),I.call(this,g,x,"DEPRECATED","warn"),this._metaOpts=V.call(this),x.formats&&A.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),x.keywords&&P.call(this,x.keywords),typeof x.meta=="object"&&this.addMetaSchema(x.meta),S.call(this),x.validateFormats=R}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:x,meta:C,schemaId:z}=this.opts;let R=f;z==="id"&&(R={...f},R.id=R.$id,delete R.$id),C&&x&&this.addMetaSchema(R,R[z],!1)}defaultMeta(){const{meta:x,schemaId:C}=this.opts;return this.opts.defaultMeta=typeof x=="object"?x[C]||x:void 0}validate(x,C){let z;if(typeof x=="string"){if(z=this.getSchema(x),!z)throw new Error(`no schema with key or ref "${x}"`)}else z=this.compile(x);const R=z(C);return"$async"in z||(this.errors=z.errors),R}compile(x,C){const z=this._addSchema(x,C);return z.validate||this._compileSchemaEnv(z)}compileAsync(x,C){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:z}=this.opts;return R.call(this,x,C);async function R(me,Se){await O.call(this,me.$schema);const ce=this._addSchema(me,Se);return ce.validate||q.call(this,ce)}async function O(me){me&&!this.getSchema(me)&&await R.call(this,{$ref:me},!0)}async function q(me){try{return this._compileSchemaEnv(me)}catch(Se){if(!(Se instanceof i.default))throw Se;return le.call(this,Se),await ae.call(this,Se.missingSchema),q.call(this,me)}}function le({missingSchema:me,missingRef:Se}){if(this.refs[me])throw new Error(`AnySchema ${me} is loaded but ${Se} cannot be resolved`)}async function ae(me){const Se=await pe.call(this,me);this.refs[me]||await O.call(this,Se.$schema),this.refs[me]||this.addSchema(Se,me,C)}async function pe(me){const Se=this._loading[me];if(Se)return Se;try{return await(this._loading[me]=z(me))}finally{delete this._loading[me]}}}addSchema(x,C,z,R=this.opts.validateSchema){if(Array.isArray(x)){for(const q of x)this.addSchema(q,void 0,z,R);return this}let O;if(typeof x=="object"){const{schemaId:q}=this.opts;if(O=x[q],O!==void 0&&typeof O!="string")throw new Error(`schema ${q} must be string`)}return C=(0,u.normalizeId)(C||O),this._checkUnique(C),this.schemas[C]=this._addSchema(x,z,C,R,!0),this}addMetaSchema(x,C,z=this.opts.validateSchema){return this.addSchema(x,C,!0,z),this}validateSchema(x,C){if(typeof x=="boolean")return!0;let z;if(z=x.$schema,z!==void 0&&typeof z!="string")throw new Error("$schema must be a string");if(z=z||this.opts.defaultMeta||this.defaultMeta(),!z)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const R=this.validate(z,x);if(!R&&C){const O="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(O);else throw new Error(O)}return R}getSchema(x){let C;for(;typeof(C=E.call(this,x))=="string";)x=C;if(C===void 0){const{schemaId:z}=this.opts,R=new o.SchemaEnv({schema:{},schemaId:z});if(C=o.resolveSchema.call(this,R,x),!C)return;this.refs[x]=C}return C.validate||this._compileSchemaEnv(C)}removeSchema(x){if(x instanceof RegExp)return this._removeAllSchemas(this.schemas,x),this._removeAllSchemas(this.refs,x),this;switch(typeof x){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const C=E.call(this,x);return typeof C=="object"&&this._cache.delete(C.schema),delete this.schemas[x],delete this.refs[x],this}case"object":{const C=x;this._cache.delete(C);let z=x[this.opts.schemaId];return z&&(z=(0,u.normalizeId)(z),delete this.schemas[z],delete this.refs[z]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(x){for(const C of x)this.addKeyword(C);return this}addKeyword(x,C){let z;if(typeof x=="string")z=x,typeof C=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),C.keyword=z);else if(typeof x=="object"&&C===void 0){if(C=x,z=C.keyword,Array.isArray(z)&&!z.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(Y.call(this,z,C),!C)return(0,c.eachItem)(z,O=>ye.call(this,O)),this;ve.call(this,C);const R={...C,type:(0,l.getJSONTypes)(C.type),schemaType:(0,l.getJSONTypes)(C.schemaType)};return(0,c.eachItem)(z,R.type.length===0?O=>ye.call(this,O,R):O=>R.type.forEach(q=>ye.call(this,O,R,q))),this}getKeyword(x){const C=this.RULES.all[x];return typeof C=="object"?C.definition:!!C}removeKeyword(x){const{RULES:C}=this;delete C.keywords[x],delete C.all[x];for(const z of C.rules){const R=z.rules.findIndex(O=>O.keyword===x);R>=0&&z.rules.splice(R,1)}return this}addFormat(x,C){return typeof C=="string"&&(C=new RegExp(C)),this.formats[x]=C,this}errorsText(x=this.errors,{separator:C=", ",dataVar:z="data"}={}){return!x||x.length===0?"No errors":x.map(R=>`${z}${R.instancePath} ${R.message}`).reduce((R,O)=>R+C+O)}$dataMetaSchema(x,C){const z=this.RULES.all;x=JSON.parse(JSON.stringify(x));for(const R of C){const O=R.split("/").slice(1);let q=x;for(const le of O)q=q[le];for(const le in z){const ae=z[le];if(typeof ae!="object")continue;const{$data:pe}=ae.definition,me=q[le];pe&&me&&(q[le]=se(me))}}return x}_removeAllSchemas(x,C){for(const z in x){const R=x[z];(!C||C.test(z))&&(typeof R=="string"?delete x[z]:R&&!R.meta&&(this._cache.delete(R.schema),delete x[z]))}}_addSchema(x,C,z,R=this.opts.validateSchema,O=this.opts.addUsedSchema){let q;const{schemaId:le}=this.opts;if(typeof x=="object")q=x[le];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof x!="boolean")throw new Error("schema must be object or boolean")}let ae=this._cache.get(x);if(ae!==void 0)return ae;z=(0,u.normalizeId)(q||z);const pe=u.getSchemaRefs.call(this,x,z);return ae=new o.SchemaEnv({schema:x,schemaId:le,meta:C,baseId:z,localRefs:pe}),this._cache.set(ae.schema,ae),O&&!z.startsWith("#")&&(z&&this._checkUnique(z),this.refs[z]=ae),R&&this.validateSchema(x,!0),ae}_checkUnique(x){if(this.schemas[x]||this.refs[x])throw new Error(`schema with key or id "${x}" already exists`)}_compileSchemaEnv(x){if(x.meta?this._compileMetaSchema(x):o.compileSchema.call(this,x),!x.validate)throw new Error("ajv implementation error");return x.validate}_compileMetaSchema(x){const C=this.opts;this.opts=this._metaOpts;try{o.compileSchema.call(this,x)}finally{this.opts=C}}}e.default=T,T.ValidationError=r.default,T.MissingRefError=i.default;function I(K,x,C,z="error"){for(const R in K){const O=R;O in x&&this.logger[z](`${C}: option ${R}. ${K[O]}`)}}function E(K){return K=(0,u.normalizeId)(K),this.schemas[K]||this.refs[K]}function S(){const K=this.opts.schemas;if(K)if(Array.isArray(K))this.addSchema(K);else for(const x in K)this.addSchema(K[x],x)}function A(){for(const K in this.opts.formats){const x=this.opts.formats[K];x&&this.addFormat(K,x)}}function P(K){if(Array.isArray(K)){this.addVocabulary(K);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const x in K){const C=K[x];C.keyword||(C.keyword=x),this.addKeyword(C)}}function V(){const K={...this.opts};for(const x of p)delete K[x];return K}const M={log(){},warn(){},error(){}};function H(K){if(K===!1)return M;if(K===void 0)return console;if(K.log&&K.warn&&K.error)return K;throw new Error("logger must implement log, warn and error methods")}const J=/^[a-z_$][a-z0-9_$:-]*$/i;function Y(K,x){const{RULES:C}=this;if((0,c.eachItem)(K,z=>{if(C.keywords[z])throw new Error(`Keyword ${z} is already defined`);if(!J.test(z))throw new Error(`Keyword ${z} has invalid name`)}),!!x&&x.$data&&!("code"in x||"validate"in x))throw new Error('$data keyword must have "code" or "validate" function')}function ye(K,x,C){var z;const R=x==null?void 0:x.post;if(C&&R)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:O}=this;let q=R?O.post:O.rules.find(({type:ae})=>ae===C);if(q||(q={type:C,rules:[]},O.rules.push(q)),O.keywords[K]=!0,!x)return;const le={keyword:K,definition:{...x,type:(0,l.getJSONTypes)(x.type),schemaType:(0,l.getJSONTypes)(x.schemaType)}};x.before?he.call(this,q,le,x.before):q.rules.push(le),O.all[K]=le,(z=x.implements)===null||z===void 0||z.forEach(ae=>this.addKeyword(ae))}function he(K,x,C){const z=K.rules.findIndex(R=>R.keyword===C);z>=0?K.rules.splice(z,0,x):(K.rules.push(x),this.logger.warn(`rule ${C} is not defined`))}function ve(K){let{metaSchema:x}=K;x!==void 0&&(K.$data&&this.opts.$data&&(x=se(x)),K.validateSchema=this.compile(x,!0))}const te={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function se(K){return{anyOf:[K,te]}}})(yX);var Yk={},Gk={},Kk={};Object.defineProperty(Kk,"__esModule",{value:!0});const RPe={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Kk.default=RPe;var $d={};Object.defineProperty($d,"__esModule",{value:!0});$d.callRef=$d.getValidate=void 0;const NPe=N_,m9=qt,ws=Yt,Eh=ju,g9=Rs,t1=pn,kPe={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:n,it:r}=e,{baseId:i,schemaEnv:s,validateName:o,opts:a,self:u}=r,{root:l}=s;if((n==="#"||n==="#/")&&i===l.baseId)return f();const c=g9.resolveRef.call(u,l,i,n);if(c===void 0)throw new NPe.default(r.opts.uriResolver,i,n);if(c instanceof g9.SchemaEnv)return d(c);return h(c);function f(){if(s===l)return rb(e,o,s,s.$async);const p=t.scopeValue("root",{ref:l});return rb(e,(0,ws._)`${p}.validate`,l,l.$async)}function d(p){const m=VX(e,p);rb(e,m,p,p.$async)}function h(p){const m=t.scopeValue("schema",a.code.source===!0?{ref:p,code:(0,ws.stringify)(p)}:{ref:p}),y=t.name("valid"),g=e.subschema({schema:p,dataTypes:[],schemaPath:ws.nil,topSchemaRef:m,errSchemaPath:n},y);e.mergeEvaluated(g),e.ok(y)}}};function VX(e,t){const{gen:n}=e;return t.validate?n.scopeValue("validate",{ref:t.validate}):(0,ws._)`${n.scopeValue("wrapper",{ref:t})}.validate`}$d.getValidate=VX;function rb(e,t,n,r){const{gen:i,it:s}=e,{allErrors:o,schemaEnv:a,opts:u}=s,l=u.passContext?Eh.default.this:ws.nil;r?c():f();function c(){if(!a.$async)throw new Error("async schema referenced by sync schema");const p=i.let("valid");i.try(()=>{i.code((0,ws._)`await ${(0,m9.callValidateCode)(e,t,l)}`),h(t),o||i.assign(p,!0)},m=>{i.if((0,ws._)`!(${m} instanceof ${s.ValidationError})`,()=>i.throw(m)),d(m),o||i.assign(p,!1)}),e.ok(p)}function f(){e.result((0,m9.callValidateCode)(e,t,l),()=>h(t),()=>d(t))}function d(p){const m=(0,ws._)`${p}.errors`;i.assign(Eh.default.vErrors,(0,ws._)`${Eh.default.vErrors} === null ? ${m} : ${Eh.default.vErrors}.concat(${m})`),i.assign(Eh.default.errors,(0,ws._)`${Eh.default.vErrors}.length`)}function h(p){var m;if(!s.opts.unevaluated)return;const y=(m=n==null?void 0:n.validate)===null||m===void 0?void 0:m.evaluated;if(s.props!==!0)if(y&&!y.dynamicProps)y.props!==void 0&&(s.props=t1.mergeEvaluated.props(i,y.props,s.props));else{const g=i.var("props",(0,ws._)`${p}.evaluated.props`);s.props=t1.mergeEvaluated.props(i,g,s.props,ws.Name)}if(s.items!==!0)if(y&&!y.dynamicItems)y.items!==void 0&&(s.items=t1.mergeEvaluated.items(i,y.items,s.items));else{const g=i.var("items",(0,ws._)`${p}.evaluated.items`);s.items=t1.mergeEvaluated.items(i,g,s.items,ws.Name)}}}$d.callRef=rb;$d.default=kPe;Object.defineProperty(Gk,"__esModule",{value:!0});const DPe=Kk,$Pe=$d,LPe=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",DPe.default,$Pe.default];Gk.default=LPe;var Qk={},Xk={};Object.defineProperty(Xk,"__esModule",{value:!0});const Uw=Yt,ec=Uw.operators,Vw={maximum:{okStr:"<=",ok:ec.LTE,fail:ec.GT},minimum:{okStr:">=",ok:ec.GTE,fail:ec.LT},exclusiveMaximum:{okStr:"<",ok:ec.LT,fail:ec.GTE},exclusiveMinimum:{okStr:">",ok:ec.GT,fail:ec.LTE}},MPe={message:({keyword:e,schemaCode:t})=>(0,Uw.str)`must be ${Vw[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,Uw._)`{comparison: ${Vw[e].okStr}, limit: ${t}}`},FPe={keyword:Object.keys(Vw),type:"number",schemaType:"number",$data:!0,error:MPe,code(e){const{keyword:t,data:n,schemaCode:r}=e;e.fail$data((0,Uw._)`${n} ${Vw[t].fail} ${r} || isNaN(${n})`)}};Xk.default=FPe;var Jk={};Object.defineProperty(Jk,"__esModule",{value:!0});const k0=Yt,BPe={message:({schemaCode:e})=>(0,k0.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,k0._)`{multipleOf: ${e}}`},jPe={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:BPe,code(e){const{gen:t,data:n,schemaCode:r,it:i}=e,s=i.opts.multipleOfPrecision,o=t.let("res"),a=s?(0,k0._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${s}`:(0,k0._)`${o} !== parseInt(${o})`;e.fail$data((0,k0._)`(${r} === 0 || (${o} = ${n}/${r}, ${a}))`)}};Jk.default=jPe;var Zk={},eD={};Object.defineProperty(eD,"__esModule",{value:!0});function zX(e){const t=e.length;let n=0,r=0,i;for(;r=55296&&i<=56319&&r(0,Wf._)`{limit: ${e}}`},HPe={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:zPe,code(e){const{keyword:t,data:n,schemaCode:r,it:i}=e,s=t==="maxLength"?Wf.operators.GT:Wf.operators.LT,o=i.opts.unicode===!1?(0,Wf._)`${n}.length`:(0,Wf._)`${(0,UPe.useFunc)(e.gen,VPe.default)}(${n})`;e.fail$data((0,Wf._)`${o} ${s} ${r}`)}};Zk.default=HPe;var tD={};Object.defineProperty(tD,"__esModule",{value:!0});const WPe=qt,zw=Yt,qPe={message:({schemaCode:e})=>(0,zw.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,zw._)`{pattern: ${e}}`},YPe={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:qPe,code(e){const{data:t,$data:n,schema:r,schemaCode:i,it:s}=e,o=s.opts.unicodeRegExp?"u":"",a=n?(0,zw._)`(new RegExp(${i}, ${o}))`:(0,WPe.usePattern)(e,r);e.fail$data((0,zw._)`!${a}.test(${t})`)}};tD.default=YPe;var nD={};Object.defineProperty(nD,"__esModule",{value:!0});const D0=Yt,GPe={message({keyword:e,schemaCode:t}){const n=e==="maxProperties"?"more":"fewer";return(0,D0.str)`must NOT have ${n} than ${t} properties`},params:({schemaCode:e})=>(0,D0._)`{limit: ${e}}`},KPe={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:GPe,code(e){const{keyword:t,data:n,schemaCode:r}=e,i=t==="maxProperties"?D0.operators.GT:D0.operators.LT;e.fail$data((0,D0._)`Object.keys(${n}).length ${i} ${r}`)}};nD.default=KPe;var rD={};Object.defineProperty(rD,"__esModule",{value:!0});const Ng=qt,$0=Yt,QPe=pn,XPe={message:({params:{missingProperty:e}})=>(0,$0.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,$0._)`{missingProperty: ${e}}`},JPe={keyword:"required",type:"object",schemaType:"array",$data:!0,error:XPe,code(e){const{gen:t,schema:n,schemaCode:r,data:i,$data:s,it:o}=e,{opts:a}=o;if(!s&&n.length===0)return;const u=n.length>=a.loopRequired;if(o.allErrors?l():c(),a.strictRequired){const h=e.parentSchema.properties,{definedProperties:p}=e.it;for(const m of n)if((h==null?void 0:h[m])===void 0&&!p.has(m)){const y=o.schemaEnv.baseId+o.errSchemaPath,g=`required property "${m}" is not defined at "${y}" (strictRequired)`;(0,QPe.checkStrictMode)(o,g,o.opts.strictRequired)}}function l(){if(u||s)e.block$data($0.nil,f);else for(const h of n)(0,Ng.checkReportMissingProp)(e,h)}function c(){const h=t.let("missing");if(u||s){const p=t.let("valid",!0);e.block$data(p,()=>d(h,p)),e.ok(p)}else t.if((0,Ng.checkMissingProp)(e,n,h)),(0,Ng.reportMissingProp)(e,h),t.else()}function f(){t.forOf("prop",r,h=>{e.setParams({missingProperty:h}),t.if((0,Ng.noPropertyInData)(t,i,h,a.ownProperties),()=>e.error())})}function d(h,p){e.setParams({missingProperty:h}),t.forOf(h,r,()=>{t.assign(p,(0,Ng.propertyInData)(t,i,h,a.ownProperties)),t.if((0,$0.not)(p),()=>{e.error(),t.break()})},$0.nil)}}};rD.default=JPe;var iD={};Object.defineProperty(iD,"__esModule",{value:!0});const L0=Yt,ZPe={message({keyword:e,schemaCode:t}){const n=e==="maxItems"?"more":"fewer";return(0,L0.str)`must NOT have ${n} than ${t} items`},params:({schemaCode:e})=>(0,L0._)`{limit: ${e}}`},e2e={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:ZPe,code(e){const{keyword:t,data:n,schemaCode:r}=e,i=t==="maxItems"?L0.operators.GT:L0.operators.LT;e.fail$data((0,L0._)`${n}.length ${i} ${r}`)}};iD.default=e2e;var sD={},k_={};Object.defineProperty(k_,"__esModule",{value:!0});const HX=Vk;HX.code='require("ajv/dist/runtime/equal").default';k_.default=HX;Object.defineProperty(sD,"__esModule",{value:!0});const eA=P_,wi=Yt,t2e=pn,n2e=k_,r2e={message:({params:{i:e,j:t}})=>(0,wi.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,wi._)`{i: ${e}, j: ${t}}`},i2e={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:r2e,code(e){const{gen:t,data:n,$data:r,schema:i,parentSchema:s,schemaCode:o,it:a}=e;if(!r&&!i)return;const u=t.let("valid"),l=s.items?(0,eA.getSchemaTypes)(s.items):[];e.block$data(u,c,(0,wi._)`${o} === false`),e.ok(u);function c(){const p=t.let("i",(0,wi._)`${n}.length`),m=t.let("j");e.setParams({i:p,j:m}),t.assign(u,!0),t.if((0,wi._)`${p} > 1`,()=>(f()?d:h)(p,m))}function f(){return l.length>0&&!l.some(p=>p==="object"||p==="array")}function d(p,m){const y=t.name("item"),g=(0,eA.checkDataTypes)(l,y,a.opts.strictNumbers,eA.DataType.Wrong),_=t.const("indices",(0,wi._)`{}`);t.for((0,wi._)`;${p}--;`,()=>{t.let(y,(0,wi._)`${n}[${p}]`),t.if(g,(0,wi._)`continue`),l.length>1&&t.if((0,wi._)`typeof ${y} == "string"`,(0,wi._)`${y} += "_"`),t.if((0,wi._)`typeof ${_}[${y}] == "number"`,()=>{t.assign(m,(0,wi._)`${_}[${y}]`),e.error(),t.assign(u,!1).break()}).code((0,wi._)`${_}[${y}] = ${p}`)})}function h(p,m){const y=(0,t2e.useFunc)(t,n2e.default),g=t.name("outer");t.label(g).for((0,wi._)`;${p}--;`,()=>t.for((0,wi._)`${m} = ${p}; ${m}--;`,()=>t.if((0,wi._)`${y}(${n}[${p}], ${n}[${m}])`,()=>{e.error(),t.assign(u,!1).break(g)})))}}};sD.default=i2e;var oD={};Object.defineProperty(oD,"__esModule",{value:!0});const JP=Yt,s2e=pn,o2e=k_,a2e={message:"must be equal to constant",params:({schemaCode:e})=>(0,JP._)`{allowedValue: ${e}}`},u2e={keyword:"const",$data:!0,error:a2e,code(e){const{gen:t,data:n,$data:r,schemaCode:i,schema:s}=e;r||s&&typeof s=="object"?e.fail$data((0,JP._)`!${(0,s2e.useFunc)(t,o2e.default)}(${n}, ${i})`):e.fail((0,JP._)`${s} !== ${n}`)}};oD.default=u2e;var aD={};Object.defineProperty(aD,"__esModule",{value:!0});const i0=Yt,l2e=pn,c2e=k_,f2e={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,i0._)`{allowedValues: ${e}}`},d2e={keyword:"enum",schemaType:"array",$data:!0,error:f2e,code(e){const{gen:t,data:n,$data:r,schema:i,schemaCode:s,it:o}=e;if(!r&&i.length===0)throw new Error("enum must have non-empty array");const a=i.length>=o.opts.loopEnum;let u;const l=()=>u??(u=(0,l2e.useFunc)(t,c2e.default));let c;if(a||r)c=t.let("valid"),e.block$data(c,f);else{if(!Array.isArray(i))throw new Error("ajv implementation error");const h=t.const("vSchema",s);c=(0,i0.or)(...i.map((p,m)=>d(h,m)))}e.pass(c);function f(){t.assign(c,!1),t.forOf("v",s,h=>t.if((0,i0._)`${l()}(${n}, ${h})`,()=>t.assign(c,!0).break()))}function d(h,p){const m=i[p];return typeof m=="object"&&m!==null?(0,i0._)`${l()}(${n}, ${h}[${p}])`:(0,i0._)`${n} === ${m}`}}};aD.default=d2e;Object.defineProperty(Qk,"__esModule",{value:!0});const h2e=Xk,p2e=Jk,m2e=Zk,g2e=tD,y2e=nD,_2e=rD,v2e=iD,b2e=sD,E2e=oD,w2e=aD,T2e=[h2e.default,p2e.default,m2e.default,g2e.default,y2e.default,_2e.default,v2e.default,b2e.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},E2e.default,w2e.default];Qk.default=T2e;var uD={},Fm={};Object.defineProperty(Fm,"__esModule",{value:!0});Fm.validateAdditionalItems=void 0;const qf=Yt,ZP=pn,S2e={message:({params:{len:e}})=>(0,qf.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,qf._)`{limit: ${e}}`},I2e={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:S2e,code(e){const{parentSchema:t,it:n}=e,{items:r}=t;if(!Array.isArray(r)){(0,ZP.checkStrictMode)(n,'"additionalItems" is ignored when "items" is not an array of schemas');return}WX(e,r)}};function WX(e,t){const{gen:n,schema:r,data:i,keyword:s,it:o}=e;o.items=!0;const a=n.const("len",(0,qf._)`${i}.length`);if(r===!1)e.setParams({len:t.length}),e.pass((0,qf._)`${a} <= ${t.length}`);else if(typeof r=="object"&&!(0,ZP.alwaysValidSchema)(o,r)){const l=n.var("valid",(0,qf._)`${a} <= ${t.length}`);n.if((0,qf.not)(l),()=>u(l)),e.ok(l)}function u(l){n.forRange("i",t.length,a,c=>{e.subschema({keyword:s,dataProp:c,dataPropType:ZP.Type.Num},l),o.allErrors||n.if((0,qf.not)(l),()=>n.break())})}}Fm.validateAdditionalItems=WX;Fm.default=I2e;var lD={},Bm={};Object.defineProperty(Bm,"__esModule",{value:!0});Bm.validateTuple=void 0;const y9=Yt,ib=pn,x2e=qt,C2e={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:n}=e;if(Array.isArray(t))return qX(e,"additionalItems",t);n.items=!0,!(0,ib.alwaysValidSchema)(n,t)&&e.ok((0,x2e.validateArray)(e))}};function qX(e,t,n=e.schema){const{gen:r,parentSchema:i,data:s,keyword:o,it:a}=e;c(i),a.opts.unevaluated&&n.length&&a.items!==!0&&(a.items=ib.mergeEvaluated.items(r,n.length,a.items));const u=r.name("valid"),l=r.const("len",(0,y9._)`${s}.length`);n.forEach((f,d)=>{(0,ib.alwaysValidSchema)(a,f)||(r.if((0,y9._)`${l} > ${d}`,()=>e.subschema({keyword:o,schemaProp:d,dataProp:d},u)),e.ok(u))});function c(f){const{opts:d,errSchemaPath:h}=a,p=n.length,m=p===f.minItems&&(p===f.maxItems||f[t]===!1);if(d.strictTuples&&!m){const y=`"${o}" is ${p}-tuple, but minItems or maxItems/${t} are not specified or different at path "${h}"`;(0,ib.checkStrictMode)(a,y,d.strictTuples)}}}Bm.validateTuple=qX;Bm.default=C2e;Object.defineProperty(lD,"__esModule",{value:!0});const A2e=Bm,O2e={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,A2e.validateTuple)(e,"items")};lD.default=O2e;var cD={};Object.defineProperty(cD,"__esModule",{value:!0});const _9=Yt,P2e=pn,R2e=qt,N2e=Fm,k2e={message:({params:{len:e}})=>(0,_9.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,_9._)`{limit: ${e}}`},D2e={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:k2e,code(e){const{schema:t,parentSchema:n,it:r}=e,{prefixItems:i}=n;r.items=!0,!(0,P2e.alwaysValidSchema)(r,t)&&(i?(0,N2e.validateAdditionalItems)(e,i):e.ok((0,R2e.validateArray)(e)))}};cD.default=D2e;var fD={};Object.defineProperty(fD,"__esModule",{value:!0});const Po=Yt,n1=pn,$2e={message:({params:{min:e,max:t}})=>t===void 0?(0,Po.str)`must contain at least ${e} valid item(s)`:(0,Po.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?(0,Po._)`{minContains: ${e}}`:(0,Po._)`{minContains: ${e}, maxContains: ${t}}`},L2e={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:$2e,code(e){const{gen:t,schema:n,parentSchema:r,data:i,it:s}=e;let o,a;const{minContains:u,maxContains:l}=r;s.opts.next?(o=u===void 0?1:u,a=l):o=1;const c=t.const("len",(0,Po._)`${i}.length`);if(e.setParams({min:o,max:a}),a===void 0&&o===0){(0,n1.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&o>a){(0,n1.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,n1.alwaysValidSchema)(s,n)){let m=(0,Po._)`${c} >= ${o}`;a!==void 0&&(m=(0,Po._)`${m} && ${c} <= ${a}`),e.pass(m);return}s.items=!0;const f=t.name("valid");a===void 0&&o===1?h(f,()=>t.if(f,()=>t.break())):o===0?(t.let(f,!0),a!==void 0&&t.if((0,Po._)`${i}.length > 0`,d)):(t.let(f,!1),d()),e.result(f,()=>e.reset());function d(){const m=t.name("_valid"),y=t.let("count",0);h(m,()=>t.if(m,()=>p(y)))}function h(m,y){t.forRange("i",0,c,g=>{e.subschema({keyword:"contains",dataProp:g,dataPropType:n1.Type.Num,compositeRule:!0},m),y()})}function p(m){t.code((0,Po._)`${m}++`),a===void 0?t.if((0,Po._)`${m} >= ${o}`,()=>t.assign(f,!0).break()):(t.if((0,Po._)`${m} > ${a}`,()=>t.assign(f,!1).break()),o===1?t.assign(f,!0):t.if((0,Po._)`${m} >= ${o}`,()=>t.assign(f,!0)))}}};fD.default=L2e;var YX={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=Yt,n=pn,r=qt;e.error={message:({params:{property:u,depsCount:l,deps:c}})=>{const f=l===1?"property":"properties";return(0,t.str)`must have ${f} ${c} when property ${u} is present`},params:({params:{property:u,depsCount:l,deps:c,missingProperty:f}})=>(0,t._)`{property: ${u}, missingProperty: ${f}, depsCount: ${l}, - deps: ${c}}`};const i={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(u){const[l,c]=s(u);o(u,l),a(u,c)}};function s({schema:u}){const l={},c={};for(const f in u){if(f==="__proto__")continue;const d=Array.isArray(u[f])?l:c;d[f]=u[f]}return[l,c]}function o(u,l=u.schema){const{gen:c,data:f,it:d}=u;if(Object.keys(l).length===0)return;const h=c.let("missing");for(const p in l){const m=l[p];if(m.length===0)continue;const y=(0,r.propertyInData)(c,f,p,d.opts.ownProperties);u.setParams({property:p,depsCount:m.length,deps:m.join(", ")}),d.allErrors?c.if(y,()=>{for(const g of m)(0,r.checkReportMissingProp)(u,g)}):(c.if((0,t._)`${y} && (${(0,r.checkMissingProp)(u,m,h)})`),(0,r.reportMissingProp)(u,h),c.else())}}e.validatePropertyDeps=o;function a(u,l=u.schema){const{gen:c,data:f,keyword:d,it:h}=u,p=c.name("valid");for(const m in l)(0,n.alwaysValidSchema)(h,l[m])||(c.if((0,r.propertyInData)(c,f,m,h.opts.ownProperties),()=>{const y=u.subschema({keyword:d,schemaProp:m},p);u.mergeValidEvaluated(y,p)},()=>c.var(p,!0)),u.ok(p))}e.validateSchemaDeps=a,e.default=i})(GX);var dD={};Object.defineProperty(dD,"__esModule",{value:!0});const KX=Yt,M2e=pn,F2e={message:"property name must be valid",params:({params:e})=>(0,KX._)`{propertyName: ${e.propertyName}}`},B2e={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:F2e,code(e){const{gen:t,schema:n,data:r,it:i}=e;if((0,M2e.alwaysValidSchema)(i,n))return;const s=t.name("valid");t.forIn("key",r,o=>{e.setParams({propertyName:o}),e.subschema({keyword:"propertyNames",data:o,dataTypes:["string"],propertyName:o,compositeRule:!0},s),t.if((0,KX.not)(s),()=>{e.error(!0),i.allErrors||t.break()})}),e.ok(s)}};dD.default=B2e;var mI={};Object.defineProperty(mI,"__esModule",{value:!0});const r1=qt,la=Yt,j2e=ju,i1=pn,U2e={message:"must NOT have additional properties",params:({params:e})=>(0,la._)`{additionalProperty: ${e.additionalProperty}}`},V2e={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:U2e,code(e){const{gen:t,schema:n,parentSchema:r,data:i,errsCount:s,it:o}=e;if(!s)throw new Error("ajv implementation error");const{allErrors:a,opts:u}=o;if(o.props=!0,u.removeAdditional!=="all"&&(0,i1.alwaysValidSchema)(o,n))return;const l=(0,r1.allSchemaProperties)(r.properties),c=(0,r1.allSchemaProperties)(r.patternProperties);f(),e.ok((0,la._)`${s} === ${j2e.default.errors}`);function f(){t.forIn("key",i,y=>{!l.length&&!c.length?p(y):t.if(d(y),()=>p(y))})}function d(y){let g;if(l.length>8){const _=(0,i1.schemaRefOrVal)(o,r.properties,"properties");g=(0,r1.isOwnProperty)(t,_,y)}else l.length?g=(0,la.or)(...l.map(_=>(0,la._)`${y} === ${_}`)):g=la.nil;return c.length&&(g=(0,la.or)(g,...c.map(_=>(0,la._)`${(0,r1.usePattern)(e,_)}.test(${y})`))),(0,la.not)(g)}function h(y){t.code((0,la._)`delete ${i}[${y}]`)}function p(y){if(u.removeAdditional==="all"||u.removeAdditional&&n===!1){h(y);return}if(n===!1){e.setParams({additionalProperty:y}),e.error(),a||t.break();return}if(typeof n=="object"&&!(0,i1.alwaysValidSchema)(o,n)){const g=t.name("valid");u.removeAdditional==="failing"?(m(y,g,!1),t.if((0,la.not)(g),()=>{e.reset(),h(y)})):(m(y,g),a||t.if((0,la.not)(g),()=>t.break()))}}function m(y,g,_){const b={keyword:"additionalProperties",dataProp:y,dataPropType:i1.Type.Str};_===!1&&Object.assign(b,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(b,g)}}};mI.default=V2e;var hD={};Object.defineProperty(hD,"__esModule",{value:!0});const z2e=Ia,v9=qt,tA=pn,b9=mI,H2e={keyword:"properties",type:"object",schemaType:"object",code(e){const{gen:t,schema:n,parentSchema:r,data:i,it:s}=e;s.opts.removeAdditional==="all"&&r.additionalProperties===void 0&&b9.default.code(new z2e.KeywordCxt(s,b9.default,"additionalProperties"));const o=(0,v9.allSchemaProperties)(n);for(const f of o)s.definedProperties.add(f);s.opts.unevaluated&&o.length&&s.props!==!0&&(s.props=tA.mergeEvaluated.props(t,(0,tA.toHash)(o),s.props));const a=o.filter(f=>!(0,tA.alwaysValidSchema)(s,n[f]));if(a.length===0)return;const u=t.name("valid");for(const f of a)l(f)?c(f):(t.if((0,v9.propertyInData)(t,i,f,s.opts.ownProperties)),c(f),s.allErrors||t.else().var(u,!0),t.endIf()),e.it.definedProperties.add(f),e.ok(u);function l(f){return s.opts.useDefaults&&!s.compositeRule&&n[f].default!==void 0}function c(f){e.subschema({keyword:"properties",schemaProp:f,dataProp:f},u)}}};hD.default=H2e;var pD={};Object.defineProperty(pD,"__esModule",{value:!0});const E9=qt,s1=Yt,w9=pn,T9=pn,W2e={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:n,data:r,parentSchema:i,it:s}=e,{opts:o}=s,a=(0,E9.allSchemaProperties)(n),u=a.filter(m=>(0,w9.alwaysValidSchema)(s,n[m]));if(a.length===0||u.length===a.length&&(!s.opts.unevaluated||s.props===!0))return;const l=o.strictSchema&&!o.allowMatchingProperties&&i.properties,c=t.name("valid");s.props!==!0&&!(s.props instanceof s1.Name)&&(s.props=(0,T9.evaluatedPropsToName)(t,s.props));const{props:f}=s;d();function d(){for(const m of a)l&&h(m),s.allErrors?p(m):(t.var(c,!0),p(m),t.if(c))}function h(m){for(const y in l)new RegExp(m).test(y)&&(0,w9.checkStrictMode)(s,`property ${y} matches pattern ${m} (use allowMatchingProperties)`)}function p(m){t.forIn("key",r,y=>{t.if((0,s1._)`${(0,E9.usePattern)(e,m)}.test(${y})`,()=>{const g=u.includes(m);g||e.subschema({keyword:"patternProperties",schemaProp:m,dataProp:y,dataPropType:T9.Type.Str},c),s.opts.unevaluated&&f!==!0?t.assign((0,s1._)`${f}[${y}]`,!0):!g&&!s.allErrors&&t.if((0,s1.not)(c),()=>t.break())})})}}};pD.default=W2e;var mD={};Object.defineProperty(mD,"__esModule",{value:!0});const q2e=pn,Y2e={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:n,it:r}=e;if((0,q2e.alwaysValidSchema)(r,n)){e.fail();return}const i=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),e.failResult(i,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};mD.default=Y2e;var gD={};Object.defineProperty(gD,"__esModule",{value:!0});const G2e=qt,K2e={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:G2e.validateUnion,error:{message:"must match a schema in anyOf"}};gD.default=K2e;var yD={};Object.defineProperty(yD,"__esModule",{value:!0});const sb=Yt,Q2e=pn,X2e={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,sb._)`{passingSchemas: ${e.passing}}`},J2e={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:X2e,code(e){const{gen:t,schema:n,parentSchema:r,it:i}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");if(i.opts.discriminator&&r.discriminator)return;const s=n,o=t.let("valid",!1),a=t.let("passing",null),u=t.name("_valid");e.setParams({passing:a}),t.block(l),e.result(o,()=>e.reset(),()=>e.error(!0));function l(){s.forEach((c,f)=>{let d;(0,Q2e.alwaysValidSchema)(i,c)?t.var(u,!0):d=e.subschema({keyword:"oneOf",schemaProp:f,compositeRule:!0},u),f>0&&t.if((0,sb._)`${u} && ${o}`).assign(o,!1).assign(a,(0,sb._)`[${a}, ${f}]`).else(),t.if(u,()=>{t.assign(o,!0),t.assign(a,f),d&&e.mergeEvaluated(d,sb.Name)})})}}};yD.default=J2e;var _D={};Object.defineProperty(_D,"__esModule",{value:!0});const Z2e=pn,eRe={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:n,it:r}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");const i=t.name("valid");n.forEach((s,o)=>{if((0,Z2e.alwaysValidSchema)(r,s))return;const a=e.subschema({keyword:"allOf",schemaProp:o},i);e.ok(i),e.mergeEvaluated(a)})}};_D.default=eRe;var vD={};Object.defineProperty(vD,"__esModule",{value:!0});const Hw=Yt,QX=pn,tRe={message:({params:e})=>(0,Hw.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,Hw._)`{failingKeyword: ${e.ifClause}}`},nRe={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:tRe,code(e){const{gen:t,parentSchema:n,it:r}=e;n.then===void 0&&n.else===void 0&&(0,QX.checkStrictMode)(r,'"if" without "then" and "else" is ignored');const i=S9(r,"then"),s=S9(r,"else");if(!i&&!s)return;const o=t.let("valid",!0),a=t.name("_valid");if(u(),e.reset(),i&&s){const c=t.let("ifClause");e.setParams({ifClause:c}),t.if(a,l("then",c),l("else",c))}else i?t.if(a,l("then")):t.if((0,Hw.not)(a),l("else"));e.pass(o,()=>e.error(!0));function u(){const c=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);e.mergeEvaluated(c)}function l(c,f){return()=>{const d=e.subschema({keyword:c},a);t.assign(o,a),e.mergeValidEvaluated(d,o),f?t.assign(f,(0,Hw._)`${c}`):e.setParams({ifClause:c})}}}};function S9(e,t){const n=e.schema[t];return n!==void 0&&!(0,QX.alwaysValidSchema)(e,n)}vD.default=nRe;var bD={};Object.defineProperty(bD,"__esModule",{value:!0});const rRe=pn,iRe={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:n}){t.if===void 0&&(0,rRe.checkStrictMode)(n,`"${e}" without "if" is ignored`)}};bD.default=iRe;Object.defineProperty(uD,"__esModule",{value:!0});const sRe=Fm,oRe=lD,aRe=Bm,uRe=cD,lRe=fD,cRe=GX,fRe=dD,dRe=mI,hRe=hD,pRe=pD,mRe=mD,gRe=gD,yRe=yD,_Re=_D,vRe=vD,bRe=bD;function ERe(e=!1){const t=[mRe.default,gRe.default,yRe.default,_Re.default,vRe.default,bRe.default,fRe.default,dRe.default,cRe.default,hRe.default,pRe.default];return e?t.push(oRe.default,uRe.default):t.push(sRe.default,aRe.default),t.push(lRe.default),t}uD.default=ERe;var ED={},wD={};Object.defineProperty(wD,"__esModule",{value:!0});const Nr=Yt,wRe={message:({schemaCode:e})=>(0,Nr.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,Nr._)`{format: ${e}}`},TRe={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:wRe,code(e,t){const{gen:n,data:r,$data:i,schema:s,schemaCode:o,it:a}=e,{opts:u,errSchemaPath:l,schemaEnv:c,self:f}=a;if(!u.validateFormats)return;i?d():h();function d(){const p=n.scopeValue("formats",{ref:f.formats,code:u.code.formats}),m=n.const("fDef",(0,Nr._)`${p}[${o}]`),y=n.let("fType"),g=n.let("format");n.if((0,Nr._)`typeof ${m} == "object" && !(${m} instanceof RegExp)`,()=>n.assign(y,(0,Nr._)`${m}.type || "string"`).assign(g,(0,Nr._)`${m}.validate`),()=>n.assign(y,(0,Nr._)`"string"`).assign(g,m)),e.fail$data((0,Nr.or)(_(),b()));function _(){return u.strictSchema===!1?Nr.nil:(0,Nr._)`${o} && !${g}`}function b(){const T=c.$async?(0,Nr._)`(${m}.async ? await ${g}(${r}) : ${g}(${r}))`:(0,Nr._)`${g}(${r})`,I=(0,Nr._)`(typeof ${g} == "function" ? ${T} : ${g}.test(${r}))`;return(0,Nr._)`${g} && ${g} !== true && ${y} === ${t} && !${I}`}}function h(){const p=f.formats[s];if(!p){_();return}if(p===!0)return;const[m,y,g]=b(p);m===t&&e.pass(T());function _(){if(u.strictSchema===!1){f.logger.warn(I());return}throw new Error(I());function I(){return`unknown format "${s}" ignored in schema at path "${l}"`}}function b(I){const E=I instanceof RegExp?(0,Nr.regexpCode)(I):u.code.formats?(0,Nr._)`${u.code.formats}${(0,Nr.getProperty)(s)}`:void 0,S=n.scopeValue("formats",{key:s,ref:I,code:E});return typeof I=="object"&&!(I instanceof RegExp)?[I.type||"string",I.validate,(0,Nr._)`${S}.validate`]:["string",I,S]}function T(){if(typeof p=="object"&&!(p instanceof RegExp)&&p.async){if(!c.$async)throw new Error("async format in sync schema");return(0,Nr._)`await ${g}(${r})`}return typeof y=="function"?(0,Nr._)`${g}(${r})`:(0,Nr._)`${g}.test(${r})`}}}};wD.default=TRe;Object.defineProperty(ED,"__esModule",{value:!0});const SRe=wD,IRe=[SRe.default];ED.default=IRe;var tm={};Object.defineProperty(tm,"__esModule",{value:!0});tm.contentVocabulary=tm.metadataVocabulary=void 0;tm.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];tm.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"];Object.defineProperty(Yk,"__esModule",{value:!0});const xRe=Gk,CRe=Qk,ARe=uD,ORe=ED,I9=tm,PRe=[xRe.default,CRe.default,(0,ARe.default)(),ORe.default,I9.metadataVocabulary,I9.contentVocabulary];Yk.default=PRe;var TD={},XX={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DiscrError=void 0,function(t){t.Tag="tag",t.Mapping="mapping"}(e.DiscrError||(e.DiscrError={}))})(XX);Object.defineProperty(TD,"__esModule",{value:!0});const Oh=Yt,e2=XX,x9=Rs,RRe=pn,NRe={message:({params:{discrError:e,tagName:t}})=>e===e2.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:n}})=>(0,Oh._)`{error: ${e}, tag: ${n}, tagValue: ${t}}`},kRe={keyword:"discriminator",type:"object",schemaType:"object",error:NRe,code(e){const{gen:t,data:n,schema:r,parentSchema:i,it:s}=e,{oneOf:o}=i;if(!s.opts.discriminator)throw new Error("discriminator: requires discriminator option");const a=r.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(r.mapping)throw new Error("discriminator: mapping is not supported");if(!o)throw new Error("discriminator: requires oneOf keyword");const u=t.let("valid",!1),l=t.const("tag",(0,Oh._)`${n}${(0,Oh.getProperty)(a)}`);t.if((0,Oh._)`typeof ${l} == "string"`,()=>c(),()=>e.error(!1,{discrError:e2.DiscrError.Tag,tag:l,tagName:a})),e.ok(u);function c(){const h=d();t.if(!1);for(const p in h)t.elseIf((0,Oh._)`${l} === ${p}`),t.assign(u,f(h[p]));t.else(),e.error(!1,{discrError:e2.DiscrError.Mapping,tag:l,tagName:a}),t.endIf()}function f(h){const p=t.name("valid"),m=e.subschema({keyword:"oneOf",schemaProp:h},p);return e.mergeEvaluated(m,Oh.Name),p}function d(){var h;const p={},m=g(i);let y=!0;for(let T=0;Tthis.addVocabulary(p)),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const p=this.opts.$data?this.$dataMetaSchema(s,o):s;this.addMetaSchema(p,a,!1),this.refs["http://json-schema.org/schema"]=a}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(a)?a:void 0)}}e.exports=t=u,Object.defineProperty(t,"__esModule",{value:!0}),t.default=u;var l=Ia;Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return l.KeywordCxt}});var c=Yt;Object.defineProperty(t,"_",{enumerable:!0,get:function(){return c._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return c.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return c.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return c.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return c.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return c.CodeGen}});var f=R_;Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return f.default}});var d=N_;Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return d.default}})})(GP,GP.exports);var URe=GP.exports;const JX=ka(URe),VRe="#/definitions/StudyConfig",zRe="http://json-schema.org/draft-07/schema#",HRe={Answer:{additionalProperties:!1,description:"The Answer interface is used to define the properties of an answer. Answers are used to define the correct answer for a task. These are generally used in training tasks.",properties:{acceptableHigh:{description:"The acceptable high value for the answer. This is used to define a range of acceptable answers.",type:"number"},acceptableLow:{description:"The acceptable low value for the answer. This is used to define a range of acceptable answers.",type:"number"},answer:{description:"The correct answer to the question."},id:{description:"The id of the answer. This is used to identify the answer in the data file.",type:"string"}},required:["id","answer"],type:"object"},CheckboxResponse:{additionalProperties:!1,description:"The CheckboxResponse interface is used to define the properties of a checkbox response. CheckboxResponses render as a checkbox input with user specified options.",properties:{correctAnswer:{description:"The correct answer to the response. This is used in the data download and can be shown in the admin panel."},hidden:{description:"Controls whether the response is hidden.",type:"boolean"},id:{description:"The id of the response. This is used to identify the response in the data file.",type:"string"},location:{$ref:"#/definitions/ResponseBlockLocation",description:"Controls the response location. These might be the same for all responses, or differ across responses."},options:{description:"The options that are displayed as checkboxes.",items:{$ref:"#/definitions/Option"},type:"array"},paramCapture:{description:"Use to capture querystring parameters in answers such as participant_name. See the examples for how this is used, but prefer uiConfig.urlParticipantIdParam if you are capturing a participant ID.",type:"string"},prompt:{description:"The prompt that is displayed to the participant. You can use markdown here to render images, links, etc.",type:"string"},required:{description:"Controls whether the response is required to be answered.",type:"boolean"},requiredLabel:{description:"You can provide a required label, which makes it so a participant has to answer with a response that matches label.",type:"string"},requiredValue:{description:"You can provide a required value, which makes it so a participant has to answer with that value."},type:{const:"checkbox",type:"string"}},required:["id","location","options","prompt","required","type"],type:"object"},DropdownResponse:{additionalProperties:!1,description:"The DropdownResponse interface is used to define the properties of a dropdown response. DropdownResponses render as a select input with user specified options.",properties:{correctAnswer:{description:"The correct answer to the response. This is used in the data download and can be shown in the admin panel."},hidden:{description:"Controls whether the response is hidden.",type:"boolean"},id:{description:"The id of the response. This is used to identify the response in the data file.",type:"string"},location:{$ref:"#/definitions/ResponseBlockLocation",description:"Controls the response location. These might be the same for all responses, or differ across responses."},options:{description:"The options that are displayed in the dropdown.",items:{$ref:"#/definitions/Option"},type:"array"},paramCapture:{description:"Use to capture querystring parameters in answers such as participant_name. See the examples for how this is used, but prefer uiConfig.urlParticipantIdParam if you are capturing a participant ID.",type:"string"},placeholder:{description:"The placeholder text that is displayed in the input.",type:"string"},prompt:{description:"The prompt that is displayed to the participant. You can use markdown here to render images, links, etc.",type:"string"},required:{description:"Controls whether the response is required to be answered.",type:"boolean"},requiredLabel:{description:"You can provide a required label, which makes it so a participant has to answer with a response that matches label.",type:"string"},requiredValue:{description:"You can provide a required value, which makes it so a participant has to answer with that value."},type:{const:"dropdown",type:"string"}},required:["id","location","options","prompt","required","type"],type:"object"},IFrameResponse:{additionalProperties:!1,description:"The IFrameResponse interface is used to define the properties of an iframe response. IFrameResponses render as a list, that is connected to a WebsiteComponent. When data is sent from the WebsiteComponent, it is displayed in the list.",properties:{correctAnswer:{description:"The correct answer to the response. This is used in the data download and can be shown in the admin panel."},hidden:{description:"Controls whether the response is hidden.",type:"boolean"},id:{description:"The id of the response. This is used to identify the response in the data file.",type:"string"},location:{$ref:"#/definitions/ResponseBlockLocation",description:"Controls the response location. These might be the same for all responses, or differ across responses."},paramCapture:{description:"Use to capture querystring parameters in answers such as participant_name. See the examples for how this is used, but prefer uiConfig.urlParticipantIdParam if you are capturing a participant ID.",type:"string"},prompt:{description:"The prompt that is displayed to the participant. You can use markdown here to render images, links, etc.",type:"string"},required:{description:"Controls whether the response is required to be answered.",type:"boolean"},requiredLabel:{description:"You can provide a required label, which makes it so a participant has to answer with a response that matches label.",type:"string"},requiredValue:{description:"You can provide a required value, which makes it so a participant has to answer with that value."},type:{const:"iframe",type:"string"}},required:["id","location","prompt","required","type"],type:"object"},ImageComponent:{additionalProperties:!1,description:"The ImageComponent interface is used to define the properties of an image component. This component is used to render an image with optional styling.",properties:{correctAnswer:{description:"The correct answer to the component. This is used for training trials where the user is shown the correct answer after a guess.",items:{$ref:"#/definitions/Answer"},type:"array"},description:{description:"The description of the component. This is used to identify and provide additional information for the component in the admin panel.",type:"string"},instruction:{description:"The instruction of the component. This is used to identify and provide additional information for the component in the admin panel.",type:"string"},instructionLocation:{$ref:"#/definitions/ResponseBlockLocation",description:"The location of the instructions."},meta:{additionalProperties:{},description:"The meta data for the component. This is used to identify and provide additional information for the component in the admin panel.",type:"object"},nextButtonLocation:{$ref:"#/definitions/ResponseBlockLocation",description:"The location of the next button."},nextButtonText:{description:"The text that is displayed on the next button.",type:"string"},path:{description:"The path to the image. This should be a relative path from the public folder.",type:"string"},response:{description:"The responses to the component",items:{$ref:"#/definitions/Response"},type:"array"},style:{additionalProperties:{type:"string"},description:"The style of the image. This is an object with css properties as keys and css values as values.",type:"object"},type:{const:"image",type:"string"}},required:["path","response","type"],type:"object"},IndividualComponent:{anyOf:[{$ref:"#/definitions/MarkdownComponent"},{$ref:"#/definitions/ReactComponent"},{$ref:"#/definitions/ImageComponent"},{$ref:"#/definitions/WebsiteComponent"},{$ref:"#/definitions/QuestionnaireComponent"}]},InheritedComponent:{additionalProperties:!1,description:"An InheritedComponent is a component that inherits properties from a baseComponent. This is used to avoid repeating properties in components. This also means that components in the baseComponents object can be partially defined, while components in the components object can inherit from them and must be fully defined and include all properties (after potentially merging with a base component).",properties:{baseComponent:{type:"string"},correctAnswer:{description:"The correct answer to the component. This is used for training trials where the user is shown the correct answer after a guess.",items:{$ref:"#/definitions/Answer"},type:"array"},description:{description:"The description of the component. This is used to identify and provide additional information for the component in the admin panel.",type:"string"},instruction:{description:"The instruction of the component. This is used to identify and provide additional information for the component in the admin panel.",type:"string"},instructionLocation:{$ref:"#/definitions/ResponseBlockLocation",description:"The location of the instructions."},meta:{additionalProperties:{},description:"The meta data for the component. This is used to identify and provide additional information for the component in the admin panel.",type:"object"},nextButtonLocation:{$ref:"#/definitions/ResponseBlockLocation",description:"The location of the next button."},nextButtonText:{description:"The text that is displayed on the next button.",type:"string"},parameters:{anyOf:[{additionalProperties:{},description:"The parameters that are passed to the react component. These can be used within your react component to render different things.",type:"object"},{additionalProperties:{},description:"The parameters that are passed to the website (iframe). These can be used within your website to render different things.",type:"object"}],description:"The parameters that are passed to the react component. These can be used within your react component to render different things."},path:{description:"The path to the markdown file. This should be a relative path from the public folder.",type:"string"},response:{description:"The responses to the component",items:{$ref:"#/definitions/Response"},type:"array"},style:{additionalProperties:{type:"string"},description:"The style of the image. This is an object with css properties as keys and css values as values.",type:"object"},type:{enum:["markdown","react-component","image","website","questionnaire"],type:"string"}},required:["baseComponent"],type:"object"},LikertResponse:{additionalProperties:!1,description:"The LikertResponse interface is used to define the properties of a likert response. LikertResponses render as radio buttons with a user specified number of options, which can be controlled through the preset. For example, preset: 5 will render 5 radio buttons, and preset: 7 will render 7 radio buttons. LikertResponses can also have a description, and left and right labels. The left and right labels are used to label the left and right ends of the likert scale with values such as 'Strongly Disagree' and 'Strongly Agree'.",properties:{correctAnswer:{description:"The correct answer to the response. This is used in the data download and can be shown in the admin panel."},desc:{description:"The description of the likert scale.",type:"string"},hidden:{description:"Controls whether the response is hidden.",type:"boolean"},id:{description:"The id of the response. This is used to identify the response in the data file.",type:"string"},leftLabel:{description:"The left label of the likert scale. E.g Strongly Disagree",type:"string"},location:{$ref:"#/definitions/ResponseBlockLocation",description:"Controls the response location. These might be the same for all responses, or differ across responses."},paramCapture:{description:"Use to capture querystring parameters in answers such as participant_name. See the examples for how this is used, but prefer uiConfig.urlParticipantIdParam if you are capturing a participant ID.",type:"string"},preset:{description:"The number of options to render.",type:"number"},prompt:{description:"The prompt that is displayed to the participant. You can use markdown here to render images, links, etc.",type:"string"},required:{description:"Controls whether the response is required to be answered.",type:"boolean"},requiredLabel:{description:"You can provide a required label, which makes it so a participant has to answer with a response that matches label.",type:"string"},requiredValue:{description:"You can provide a required value, which makes it so a participant has to answer with that value."},rightLabel:{description:"The right label of the likert scale. E.g Strongly Agree",type:"string"},type:{const:"likert",type:"string"}},required:["id","location","preset","prompt","required","type"],type:"object"},LongTextResponse:{additionalProperties:!1,description:"The LongTextResponse interface is used to define the properties of a long text response. LongTextResponses render as a text area that accepts any text and can optionally have a placeholder.",properties:{correctAnswer:{description:"The correct answer to the response. This is used in the data download and can be shown in the admin panel."},hidden:{description:"Controls whether the response is hidden.",type:"boolean"},id:{description:"The id of the response. This is used to identify the response in the data file.",type:"string"},location:{$ref:"#/definitions/ResponseBlockLocation",description:"Controls the response location. These might be the same for all responses, or differ across responses."},paramCapture:{description:"Use to capture querystring parameters in answers such as participant_name. See the examples for how this is used, but prefer uiConfig.urlParticipantIdParam if you are capturing a participant ID.",type:"string"},placeholder:{description:"The placeholder text that is displayed in the input.",type:"string"},prompt:{description:"The prompt that is displayed to the participant. You can use markdown here to render images, links, etc.",type:"string"},required:{description:"Controls whether the response is required to be answered.",type:"boolean"},requiredLabel:{description:"You can provide a required label, which makes it so a participant has to answer with a response that matches label.",type:"string"},requiredValue:{description:"You can provide a required value, which makes it so a participant has to answer with that value."},type:{const:"longText",type:"string"}},required:["id","location","prompt","required","type"],type:"object"},MarkdownComponent:{additionalProperties:!1,description:"The MarkdownComponent interface is used to define the properties of a markdown component. The components can be used to render many different things, such as consent forms, instructions, and debriefs. Additionally, you can use the markdown component to render images, videos, and other media, with supporting text.",properties:{correctAnswer:{description:"The correct answer to the component. This is used for training trials where the user is shown the correct answer after a guess.",items:{$ref:"#/definitions/Answer"},type:"array"},description:{description:"The description of the component. This is used to identify and provide additional information for the component in the admin panel.",type:"string"},instruction:{description:"The instruction of the component. This is used to identify and provide additional information for the component in the admin panel.",type:"string"},instructionLocation:{$ref:"#/definitions/ResponseBlockLocation",description:"The location of the instructions."},meta:{additionalProperties:{},description:"The meta data for the component. This is used to identify and provide additional information for the component in the admin panel.",type:"object"},nextButtonLocation:{$ref:"#/definitions/ResponseBlockLocation",description:"The location of the next button."},nextButtonText:{description:"The text that is displayed on the next button.",type:"string"},path:{description:"The path to the markdown file. This should be a relative path from the public folder.",type:"string"},response:{description:"The responses to the component",items:{$ref:"#/definitions/Response"},type:"array"},type:{const:"markdown",type:"string"}},required:["path","response","type"],type:"object"},NumericalResponse:{additionalProperties:!1,description:"The NumericalResponse interface is used to define the properties of a numerical response. NumericalResponses render as a text input that only accepts numbers, and can optionally have a min and max value, or a placeholder.",properties:{correctAnswer:{description:"The correct answer to the response. This is used in the data download and can be shown in the admin panel."},hidden:{description:"Controls whether the response is hidden.",type:"boolean"},id:{description:"The id of the response. This is used to identify the response in the data file.",type:"string"},location:{$ref:"#/definitions/ResponseBlockLocation",description:"Controls the response location. These might be the same for all responses, or differ across responses."},max:{description:"The maximum value that is accepted in the input.",type:"number"},min:{description:"The minimum value that is accepted in the input.",type:"number"},paramCapture:{description:"Use to capture querystring parameters in answers such as participant_name. See the examples for how this is used, but prefer uiConfig.urlParticipantIdParam if you are capturing a participant ID.",type:"string"},placeholder:{description:"The placeholder text that is displayed in the input.",type:"string"},prompt:{description:"The prompt that is displayed to the participant. You can use markdown here to render images, links, etc.",type:"string"},required:{description:"Controls whether the response is required to be answered.",type:"boolean"},requiredLabel:{description:"You can provide a required label, which makes it so a participant has to answer with a response that matches label.",type:"string"},requiredValue:{description:"You can provide a required value, which makes it so a participant has to answer with that value."},type:{const:"numerical",type:"string"}},required:["id","location","prompt","required","type"],type:"object"},Option:{additionalProperties:!1,description:"The Option interface is used to define the options for a dropdown, slider, radio, or checkbox response. The label is the text that is displayed to the user, and the value is the value that is stored in the data file. The Option interface is used in the Response interface.",properties:{label:{description:"The label displayed to participants.",type:"string"},value:{description:"The value stored in the participant's data.",type:["string","number"]}},required:["label","value"],type:"object"},OrderObject:{additionalProperties:!1,description:"The OrderObject interface is used to define the properties of an order object. This is used to define the order of components in a study. It supports random assignment of trials using a pure random assignment and a latin square.",properties:{components:{description:"The components that are included in the order.",items:{anyOf:[{type:"string"},{$ref:"#/definitions/OrderObject"}]},type:"array"},numSamples:{description:"The number of samples to use for the random assignments. This means you can randomize across 3 components while only showing a participant 2 at a time.",type:"number"},order:{description:"The type of order. This can be random (pure random), latinSquare (random with some guarantees), or fixed.",enum:["random","latinSquare","fixed"],type:"string"}},required:["order","components"],type:"object"},QuestionnaireComponent:{additionalProperties:!1,description:"The QuestionnaireComponent interface is used to define the properties of a questionnaire component. A QuestionnaireComponent is used to render questions with different response types. The response types are also defined with these documentation. The main use case of this component type is to ask participants questions, without using markdown, websites, images, etc.",properties:{correctAnswer:{description:"The correct answer to the component. This is used for training trials where the user is shown the correct answer after a guess.",items:{$ref:"#/definitions/Answer"},type:"array"},description:{description:"The description of the component. This is used to identify and provide additional information for the component in the admin panel.",type:"string"},instruction:{description:"The instruction of the component. This is used to identify and provide additional information for the component in the admin panel.",type:"string"},instructionLocation:{$ref:"#/definitions/ResponseBlockLocation",description:"The location of the instructions."},meta:{additionalProperties:{},description:"The meta data for the component. This is used to identify and provide additional information for the component in the admin panel.",type:"object"},nextButtonLocation:{$ref:"#/definitions/ResponseBlockLocation",description:"The location of the next button."},nextButtonText:{description:"The text that is displayed on the next button.",type:"string"},response:{description:"The responses to the component",items:{$ref:"#/definitions/Response"},type:"array"},type:{const:"questionnaire",type:"string"}},required:["response","type"],type:"object"},RadioResponse:{additionalProperties:!1,description:"The RadioResponse interface is used to define the properties of a radio response. RadioResponses render as a radio input with user specified options, and optionally left and right labels.",properties:{correctAnswer:{description:"The correct answer to the response. This is used in the data download and can be shown in the admin panel."},hidden:{description:"Controls whether the response is hidden.",type:"boolean"},id:{description:"The id of the response. This is used to identify the response in the data file.",type:"string"},leftLabel:{type:"string"},location:{$ref:"#/definitions/ResponseBlockLocation",description:"Controls the response location. These might be the same for all responses, or differ across responses."},options:{items:{$ref:"#/definitions/Option"},type:"array"},paramCapture:{description:"Use to capture querystring parameters in answers such as participant_name. See the examples for how this is used, but prefer uiConfig.urlParticipantIdParam if you are capturing a participant ID.",type:"string"},prompt:{description:"The prompt that is displayed to the participant. You can use markdown here to render images, links, etc.",type:"string"},required:{description:"Controls whether the response is required to be answered.",type:"boolean"},requiredLabel:{description:"You can provide a required label, which makes it so a participant has to answer with a response that matches label.",type:"string"},requiredValue:{description:"You can provide a required value, which makes it so a participant has to answer with that value."},rightLabel:{type:"string"},type:{const:"radio",type:"string"}},required:["id","location","options","prompt","required","type"],type:"object"},ReactComponent:{additionalProperties:!1,description:"The ReactComponent interface is used to define the properties of a react component. This component is used to render react code with certain parameters. These parameters can be used within your react code to render different things.",properties:{correctAnswer:{description:"The correct answer to the component. This is used for training trials where the user is shown the correct answer after a guess.",items:{$ref:"#/definitions/Answer"},type:"array"},description:{description:"The description of the component. This is used to identify and provide additional information for the component in the admin panel.",type:"string"},instruction:{description:"The instruction of the component. This is used to identify and provide additional information for the component in the admin panel.",type:"string"},instructionLocation:{$ref:"#/definitions/ResponseBlockLocation",description:"The location of the instructions."},meta:{additionalProperties:{},description:"The meta data for the component. This is used to identify and provide additional information for the component in the admin panel.",type:"object"},nextButtonLocation:{$ref:"#/definitions/ResponseBlockLocation",description:"The location of the next button."},nextButtonText:{description:"The text that is displayed on the next button.",type:"string"},parameters:{additionalProperties:{},description:"The parameters that are passed to the react component. These can be used within your react component to render different things.",type:"object"},path:{description:"The path to the react component. This should be a relative path from the src/public folder.",type:"string"},response:{description:"The responses to the component",items:{$ref:"#/definitions/Response"},type:"array"},type:{const:"react-component",type:"string"}},required:["path","response","type"],type:"object"},Response:{anyOf:[{$ref:"#/definitions/NumericalResponse"},{$ref:"#/definitions/ShortTextResponse"},{$ref:"#/definitions/LongTextResponse"},{$ref:"#/definitions/LikertResponse"},{$ref:"#/definitions/DropdownResponse"},{$ref:"#/definitions/SliderResponse"},{$ref:"#/definitions/RadioResponse"},{$ref:"#/definitions/CheckboxResponse"},{$ref:"#/definitions/IFrameResponse"}]},ResponseBlockLocation:{enum:["sidebar","aboveStimulus","belowStimulus"],type:"string"},ShortTextResponse:{additionalProperties:!1,description:"The ShortTextResponse interface is used to define the properties of a short text response. ShortTextResponses render as a text input that accepts any text and can optionally have a placeholder.",properties:{correctAnswer:{description:"The correct answer to the response. This is used in the data download and can be shown in the admin panel."},hidden:{description:"Controls whether the response is hidden.",type:"boolean"},id:{description:"The id of the response. This is used to identify the response in the data file.",type:"string"},location:{$ref:"#/definitions/ResponseBlockLocation",description:"Controls the response location. These might be the same for all responses, or differ across responses."},paramCapture:{description:"Use to capture querystring parameters in answers such as participant_name. See the examples for how this is used, but prefer uiConfig.urlParticipantIdParam if you are capturing a participant ID.",type:"string"},placeholder:{description:"The placeholder text that is displayed in the input.",type:"string"},prompt:{description:"The prompt that is displayed to the participant. You can use markdown here to render images, links, etc.",type:"string"},required:{description:"Controls whether the response is required to be answered.",type:"boolean"},requiredLabel:{description:"You can provide a required label, which makes it so a participant has to answer with a response that matches label.",type:"string"},requiredValue:{description:"You can provide a required value, which makes it so a participant has to answer with that value."},type:{const:"shortText",type:"string"}},required:["id","location","prompt","required","type"],type:"object"},SliderResponse:{additionalProperties:!1,description:"The SliderResponse interface is used to define the properties of a slider response. SliderResponses render as a slider input with user specified steps. For example, you could have steps of 0, 50, and 100.",properties:{correctAnswer:{description:"The correct answer to the response. This is used in the data download and can be shown in the admin panel."},hidden:{description:"Controls whether the response is hidden.",type:"boolean"},id:{description:"The id of the response. This is used to identify the response in the data file.",type:"string"},leftLabel:{description:"The left label of the likert scale. E.g Strongly Disagree",type:"string"},location:{$ref:"#/definitions/ResponseBlockLocation",description:"Controls the response location. These might be the same for all responses, or differ across responses."},options:{description:"This define the steps in the slider and the extent of the slider.",items:{$ref:"#/definitions/Option"},type:"array"},paramCapture:{description:"Use to capture querystring parameters in answers such as participant_name. See the examples for how this is used, but prefer uiConfig.urlParticipantIdParam if you are capturing a participant ID.",type:"string"},prompt:{description:"The prompt that is displayed to the participant. You can use markdown here to render images, links, etc.",type:"string"},required:{description:"Controls whether the response is required to be answered.",type:"boolean"},requiredLabel:{description:"You can provide a required label, which makes it so a participant has to answer with a response that matches label.",type:"string"},requiredValue:{description:"You can provide a required value, which makes it so a participant has to answer with that value."},rightLabel:{description:"The right label of the likert scale. E.g Strongly Agree",type:"string"},type:{const:"slider",type:"string"}},required:["id","location","options","prompt","required","type"],type:"object"},StudyConfig:{additionalProperties:!1,description:"The StudyConfig interface is used to define the properties of a study configuration. These are the hjson files that live in the public folder. In our repo, one example of this would be public/cleveland/config-cleveland.json.",properties:{$schema:{description:"A required json schema property. This should point to the github link for the version of the schema you would like. See examples for more information",type:"string"},baseComponents:{additionalProperties:{anyOf:[{$ref:"#/definitions/IndividualComponent"},{additionalProperties:!1,properties:{correctAnswer:{description:"The correct answer to the component. This is used for training trials where the user is shown the correct answer after a guess.",items:{$ref:"#/definitions/Answer"},type:"array"},description:{description:"The description of the component. This is used to identify and provide additional information for the component in the admin panel.",type:"string"},instruction:{description:"The instruction of the component. This is used to identify and provide additional information for the component in the admin panel.",type:"string"},instructionLocation:{$ref:"#/definitions/ResponseBlockLocation",description:"The location of the instructions."},meta:{additionalProperties:{},description:"The meta data for the component. This is used to identify and provide additional information for the component in the admin panel.",type:"object"},nextButtonLocation:{$ref:"#/definitions/ResponseBlockLocation",description:"The location of the next button."},nextButtonText:{description:"The text that is displayed on the next button.",type:"string"},parameters:{anyOf:[{additionalProperties:{},description:"The parameters that are passed to the react component. These can be used within your react component to render different things.",type:"object"},{additionalProperties:{},description:"The parameters that are passed to the website (iframe). These can be used within your website to render different things.",type:"object"}],description:"The parameters that are passed to the react component. These can be used within your react component to render different things."},path:{description:"The path to the markdown file. This should be a relative path from the public folder.",type:"string"},response:{description:"The responses to the component",items:{$ref:"#/definitions/Response"},type:"array"},style:{additionalProperties:{type:"string"},description:"The style of the image. This is an object with css properties as keys and css values as values.",type:"object"},type:{enum:["markdown","react-component","image","website","questionnaire"],type:"string"}},type:"object"}]},description:"The components that are used in the study (baseComponents allow PartialComponents which allows for inheriting from them in components).",type:"object"},components:{additionalProperties:{anyOf:[{$ref:"#/definitions/IndividualComponent"},{$ref:"#/definitions/InheritedComponent"}]},description:"The components that are used in the study. They must be fully defined here with all properties. Some properties may be inherited from baseComponents.",type:"object"},sequence:{$ref:"#/definitions/OrderObject",description:"The order of the components in the study. This might include some randomness."},studyMetadata:{$ref:"#/definitions/StudyMetadata",description:"The metadata for the study. This is used to identify the study and version in the data file."},uiConfig:{$ref:"#/definitions/UIConfig",description:"The UI configuration for the study. This is used to configure the UI of the app."}},required:["$schema","studyMetadata","uiConfig","components","sequence"],type:"object"},StudyMetadata:{additionalProperties:!1,description:"The StudyMetadata is used to describe certain properties of a study. Some of this data is displayed on the landing page when running the app, such as the title and description. This data is also included in the data file that is downloaded at the end of the study, to help identify the study and version.",properties:{authors:{description:"The authors of your study.",items:{type:"string"},type:"array"},date:{description:"The date of your study, may be useful for the researcher.",type:"string"},description:{description:"The description of your study, shown on the landing page.",type:"string"},organizations:{description:"The organizations that are associated with your study.",items:{type:"string"},type:"array"},title:{description:"The title of your study, shown on the landing page.",type:"string"},version:{description:"The version of your study, shown on the landing page and attached to participant data. This might be useful for seeing which version of the study a participant saw.",type:"string"}},required:["title","version","authors","date","description","organizations"],type:"object"},UIConfig:{additionalProperties:!1,description:"The UIConfig is used to configure the UI of the app. This includes the logo, contact email, and whether to show a progress bar. The UIConfig is also used to configure the sidebar, which can be used to display the task instructions and capture responses.",properties:{autoDownloadStudy:{description:"Controls whether the study data is automatically downloaded at the end of the study.",type:"boolean"},autoDownloadTime:{description:"The time in milliseconds to wait before automatically downloading the study data.",type:"number"},contactEmail:{description:"The email address that used during the study if a participant clicks contact.",type:"string"},helpTextPath:{description:"The path to the help text file. This is displayed when a participant clicks help. Markdown is supported.",type:"string"},logoPath:{description:"The path to the logo image. This is displayed on the landing page and the header.",type:"string"},sidebar:{description:"Controls whether the left sidebar is rendered at all. Required to be true if your response's location is set to sidebar for any question.",type:"boolean"},studyEndMsg:{description:"The message to display when the study ends.",type:"string"},urlParticipantIdParam:{description:"If the participant ID is passed in the URL, this is the name of the querystring parameter that is used to capture the participant ID (e.g. PROLIFIC_ID). This will allow a user to continue a study on different devices and browsers.",type:"string"},windowEventDebounceTime:{description:"Debounce time in milliseconds for automatically tracked window events. Defaults to 100. E.g 100 here means 1000ms / 100ms = 10 times a second, 200 here means 1000ms / 200ms = 5 times per second",type:"number"},withProgressBar:{description:"Controls whether the progress bar is rendered in the study.",type:"boolean"}},required:["contactEmail","logoPath","withProgressBar","sidebar"],type:"object"},WebsiteComponent:{additionalProperties:!1,description:"The WebsiteComponent interface is used to define the properties of a website component. A WebsiteComponent is used to render an iframe with a website inside of it. This can be used to display an external website or an html file that is located in the public folder.",properties:{correctAnswer:{description:"The correct answer to the component. This is used for training trials where the user is shown the correct answer after a guess.",items:{$ref:"#/definitions/Answer"},type:"array"},description:{description:"The description of the component. This is used to identify and provide additional information for the component in the admin panel.",type:"string"},instruction:{description:"The instruction of the component. This is used to identify and provide additional information for the component in the admin panel.",type:"string"},instructionLocation:{$ref:"#/definitions/ResponseBlockLocation",description:"The location of the instructions."},meta:{additionalProperties:{},description:"The meta data for the component. This is used to identify and provide additional information for the component in the admin panel.",type:"object"},nextButtonLocation:{$ref:"#/definitions/ResponseBlockLocation",description:"The location of the next button."},nextButtonText:{description:"The text that is displayed on the next button.",type:"string"},parameters:{additionalProperties:{},description:"The parameters that are passed to the website (iframe). These can be used within your website to render different things.",type:"object"},path:{description:"The path to the website. This should be a relative path from the public folder or could be an external website.",type:"string"},response:{description:"The responses to the component",items:{$ref:"#/definitions/Response"},type:"array"},type:{const:"website",type:"string"}},required:["path","response","type"],type:"object"}},WRe={$ref:VRe,$schema:zRe,definitions:HRe},qRe="#/definitions/GlobalConfig",YRe="http://json-schema.org/draft-07/schema#",GRe={GlobalConfig:{additionalProperties:!1,description:"The GlobalConfig is used to generate the list of available studies in the UI. This list is displayed on the landing page when running the app.",properties:{$schema:{description:"A required json schema property. This should point to the github link for the version of the schema you would like. See examples for more information",type:"string"},configs:{additionalProperties:{additionalProperties:!1,description:"The key is used to identify the study config file. This key is used in the configList property.",properties:{path:{description:"The path to the study config file. This should be a relative path from the public folder.",type:"string"}},required:["path"],type:"object"},description:"A required property that specifies the options for the configList property.",type:"object"},configsList:{description:"A required property that is used to generate the list of available studies in the UI. This list is displayed on the landing page when running the app.",items:{type:"string"},type:"array"}},required:["$schema","configs","configsList"],type:"object"}},KRe={$ref:qRe,$schema:YRe,definitions:GRe},ZX=new JX;ZX.addSchema(KRe);const C9=ZX.getSchema("#/definitions/GlobalConfig"),eJ=new JX;eJ.addSchema(WRe);const A9=eJ.getSchema("#/definitions/StudyConfig");function QRe(e){const t=[];return[e.configsList.every(r=>e.configs[r]===void 0?(t.push({message:`Config ${r} is not defined in configs object, but is present in configsList`}),!1):!0),t]}function gI(e){return e.baseComponent!==void 0}function XRe(e){const t=Fk.parse(e),n=C9(t),r=QRe(t);if(n&&r[0])return t;throw console.error("Global config parsing errors",[...C9.errors||[],...r[1]]),Error("There was an issue validating your file global.json")}function JRe(e){const t=[];return[Object.values(e.components).every(r=>{var i;return gI(r)?!!((i=e.baseComponents)!=null&&i[r.baseComponent]):!0}),t]}function tJ(e,t){const n=Fk.parse(e),r=A9(n),i=JRe(n);if(r&&i[0])return n;throw console.error(`${t} parsing errors`,[...A9.errors||[],...i[1]]),Error(`There was an issue validating your file ${t}`)}function _a(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r3?t.i-4:t.i:Array.isArray(e)?1:SD(e)?2:ID(e)?3:0}function vp(e,t){return jm(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function ZRe(e,t){return jm(e)===2?e.get(t):e[t]}function nJ(e,t,n){var r=jm(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function rJ(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function SD(e){return sNe&&e instanceof Map}function ID(e){return oNe&&e instanceof Set}function Lf(e){return e.o||e.t}function xD(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=sJ(e);delete t[or];for(var n=bp(t),r=0;r1&&(e.set=e.add=e.clear=e.delete=eNe),Object.freeze(e),t&&Ld(e,function(n,r){return CD(r,!0)},!0)),e}function eNe(){_a(2)}function AD(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function _u(e){var t=i2[e];return t||_a(18,e),t}function tNe(e,t){i2[e]||(i2[e]=t)}function t2(){return Iy}function nA(e,t){t&&(_u("Patches"),e.u=[],e.s=[],e.v=t)}function Ww(e){n2(e),e.p.forEach(nNe),e.p=null}function n2(e){e===Iy&&(Iy=e.l)}function O9(e){return Iy={p:[],l:Iy,h:e,m:!0,_:0}}function nNe(e){var t=e[or];t.i===0||t.i===1?t.j():t.O=!0}function rA(e,t){t._=t.p.length;var n=t.p[0],r=e!==void 0&&e!==n;return t.h.g||_u("ES5").S(t,e,r),r?(n[or].P&&(Ww(t),_a(4)),xl(e)&&(e=qw(t,e),t.l||Yw(t,e)),t.u&&_u("Patches").M(n[or].t,e,t.u,t.s)):e=qw(t,n,[]),Ww(t),t.u&&t.v(t.u,t.s),e!==iJ?e:void 0}function qw(e,t,n){if(AD(t))return t;var r=t[or];if(!r)return Ld(t,function(a,u){return P9(e,r,t,a,u,n)},!0),t;if(r.A!==e)return t;if(!r.P)return Yw(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var i=r.i===4||r.i===5?r.o=xD(r.k):r.o,s=i,o=!1;r.i===3&&(s=new Set(i),i.clear(),o=!0),Ld(s,function(a,u){return P9(e,r,i,a,u,n,o)}),Yw(e,i,!1),n&&e.u&&_u("Patches").N(r,n,e.u,e.s)}return r.o}function P9(e,t,n,r,i,s,o){if(ef(i)){var a=qw(e,i,s&&t&&t.i!==3&&!vp(t.R,r)?s.concat(r):void 0);if(nJ(n,r,a),!ef(a))return;e.m=!1}else o&&n.add(i);if(xl(i)&&!AD(i)){if(!e.h.D&&e._<1)return;qw(e,i),t&&t.A.l||Yw(e,i)}}function Yw(e,t,n){n===void 0&&(n=!1),!e.l&&e.h.D&&e.m&&CD(t,n)}function iA(e,t){var n=e[or];return(n?Lf(n):e)[t]}function R9(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function gc(e){e.P||(e.P=!0,e.l&&gc(e.l))}function sA(e){e.o||(e.o=xD(e.t))}function r2(e,t,n){var r=SD(t)?_u("MapSet").F(t,n):ID(t)?_u("MapSet").T(t,n):e.g?function(i,s){var o=Array.isArray(i),a={i:o?1:0,A:s?s.A:t2(),P:!1,I:!1,R:{},l:s,t:i,k:null,o:null,j:null,C:!1},u=a,l=xy;o&&(u=[a],l=s0);var c=Proxy.revocable(u,l),f=c.revoke,d=c.proxy;return a.k=d,a.j=f,d}(t,n):_u("ES5").J(t,n);return(n?n.A:t2()).p.push(r),r}function rNe(e){return ef(e)||_a(22,e),function t(n){if(!xl(n))return n;var r,i=n[or],s=jm(n);if(i){if(!i.P&&(i.i<4||!_u("ES5").K(i)))return i.t;i.I=!0,r=N9(n,s),i.I=!1}else r=N9(n,s);return Ld(r,function(o,a){i&&ZRe(i.t,o)===a||nJ(r,o,t(a))}),s===3?new Set(r):r}(e)}function N9(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return xD(e)}function iNe(){function e(s,o){var a=i[s];return a?a.enumerable=o:i[s]=a={configurable:!0,enumerable:o,get:function(){var u=this[or];return xy.get(u,s)},set:function(u){var l=this[or];xy.set(l,s,u)}},a}function t(s){for(var o=s.length-1;o>=0;o--){var a=s[o][or];if(!a.P)switch(a.i){case 5:r(a)&&gc(a);break;case 4:n(a)&&gc(a)}}}function n(s){for(var o=s.t,a=s.k,u=bp(a),l=u.length-1;l>=0;l--){var c=u[l];if(c!==or){var f=o[c];if(f===void 0&&!vp(o,c))return!0;var d=a[c],h=d&&d[or];if(h?h.t!==f:!rJ(d,f))return!0}}var p=!!o[or];return u.length!==bp(o).length+(p?0:1)}function r(s){var o=s.k;if(o.length!==s.t.length)return!0;var a=Object.getOwnPropertyDescriptor(o,o.length-1);if(a&&!a.get)return!0;for(var u=0;u1?g-1:0),b=1;b1?c-1:0),d=1;d=0;i--){var s=r[i];if(s.path.length===0&&s.op==="replace"){n=s.value;break}}i>-1&&(r=r.slice(i+1));var o=_u("Patches").$;return ef(n)?o(n,r):this.produce(n,function(a){return o(a,r)})},e}(),mo=new uNe,oJ=mo.produce;mo.produceWithPatches.bind(mo);mo.setAutoFreeze.bind(mo);mo.setUseProxies.bind(mo);mo.applyPatches.bind(mo);mo.createDraft.bind(mo);mo.finishDraft.bind(mo);function Cy(e){"@babel/helpers - typeof";return Cy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cy(e)}function lNe(e,t){if(Cy(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Cy(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function cNe(e){var t=lNe(e,"string");return Cy(t)=="symbol"?t:String(t)}function fNe(e,t,n){return t=cNe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function L9(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function M9(e){for(var t=1;t"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(zi(1));return n(aJ)(e,t)}if(typeof e!="function")throw new Error(zi(2));var i=e,s=t,o=[],a=o,u=!1;function l(){a===o&&(a=o.slice())}function c(){if(u)throw new Error(zi(3));return s}function f(m){if(typeof m!="function")throw new Error(zi(4));if(u)throw new Error(zi(5));var y=!0;return l(),a.push(m),function(){if(y){if(u)throw new Error(zi(6));y=!1,l();var _=a.indexOf(m);a.splice(_,1),o=null}}}function d(m){if(!dNe(m))throw new Error(zi(7));if(typeof m.type>"u")throw new Error(zi(8));if(u)throw new Error(zi(9));try{u=!0,s=i(s,m)}finally{u=!1}for(var y=o=a,g=0;g"u")throw new Error(zi(12));if(typeof n(void 0,{type:Gw.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(zi(13))})}function pNe(e){for(var t=Object.keys(e),n={},r=0;r"u")throw l&&l.type,new Error(zi(14));f[h]=y,c=c||y!==m}return c=c||s.length!==Object.keys(u).length,c?f:u}}function Kw(){for(var e=arguments.length,t=new Array(e),n=0;n0&&s[s.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]0)for(var b=h.getState(),T=Array.from(n.values()),I=0,E=T;I({[c]:{}}))},s=Object.assign({},...n.map(c=>({[c]:{aboveStimulus:{valid:!1,values:{}},belowStimulus:{valid:!1,values:{}},sidebar:{valid:!1,values:{}}}}))),o=Object.assign({},...n.map(c=>({[c]:{aboveStimulus:!0,belowStimulus:!0,sidebar:!0,values:{}}}))),a={studyId:e,answers:r||i,sequence:n,config:t,showAdmin:!1,showHelpText:!1,alertModal:{show:!1,message:""},trialValidation:r?o:s,iframeAnswers:[]},u=dJ({name:"storeSlice",initialState:a,reducers:{setConfig(c,f){c.config=f.payload},toggleShowAdmin:c=>{c.showAdmin=!c.showAdmin},toggleShowHelpText:c=>{c.showHelpText=!c.showHelpText},setAlertModal:(c,f)=>{c.alertModal=f.payload},setIframeAnswers:(c,f)=>{c.iframeAnswers=f.payload},updateResponseBlockValidation:(c,{payload:f})=>{!f.currentStep||f.currentStep.length===0||(c.trialValidation[f.currentStep]||(c.trialValidation[f.currentStep]={aboveStimulus:{valid:!1,values:{}},belowStimulus:{valid:!1,values:{}},sidebar:{valid:!1,values:{}},provenanceGraph:void 0}),c.trialValidation[f.currentStep][f.location]={valid:f.status,values:f.values},f.provenanceGraph&&(c.trialValidation[f.currentStep].provenanceGraph=f.provenanceGraph))},saveTrialAnswer(c,{payload:f}){const{currentStep:d,answer:h,startTime:p,endTime:m,provenanceGraph:y,windowEvents:g}=f;c.answers[d]={answer:h,startTime:p,endTime:m,provenanceGraph:y,windowEvents:g}}}});return{store:cJ({reducer:u.reducer,preloadedState:a}),actions:u.actions}}const wJ=w.createContext(null);function Hl(){return w.useContext(wJ).actions}const Wl=pX,Uu=bAe;function tke(e){return Uu(t=>{if(e===void 0||e.length===0)return!0;const n=Object.values(t.trialValidation[e]).every(r=>typeof r=="object"&&"valid"in r?r.valid:!0);return n?Object.values(n).every(r=>r):!1})}var Xw={exports:{}};Xw.exports;(function(e,t){var n=200,r="__lodash_hash_undefined__",i=800,s=16,o=9007199254740991,a="[object Arguments]",u="[object Array]",l="[object AsyncFunction]",c="[object Boolean]",f="[object Date]",d="[object Error]",h="[object Function]",p="[object GeneratorFunction]",m="[object Map]",y="[object Number]",g="[object Null]",_="[object Object]",b="[object Proxy]",T="[object RegExp]",I="[object Set]",E="[object String]",S="[object Undefined]",A="[object WeakMap]",P="[object ArrayBuffer]",V="[object DataView]",M="[object Float32Array]",H="[object Float64Array]",J="[object Int8Array]",Y="[object Int16Array]",ye="[object Int32Array]",he="[object Uint8Array]",ve="[object Uint8ClampedArray]",te="[object Uint16Array]",se="[object Uint32Array]",K=/[\\^$.*+?()[\]{}|]/g,x=/^\[object .+?Constructor\]$/,C=/^(?:0|[1-9]\d*)$/,z={};z[M]=z[H]=z[J]=z[Y]=z[ye]=z[he]=z[ve]=z[te]=z[se]=!0,z[a]=z[u]=z[P]=z[c]=z[V]=z[f]=z[d]=z[h]=z[m]=z[y]=z[_]=z[T]=z[I]=z[E]=z[A]=!1;var R=typeof io=="object"&&io&&io.Object===Object&&io,O=typeof self=="object"&&self&&self.Object===Object&&self,q=R||O||Function("return this")(),le=t&&!t.nodeType&&t,ae=le&&!0&&e&&!e.nodeType&&e,pe=ae&&ae.exports===le,me=pe&&R.process,Se=function(){try{var U=ae&&ae.require&&ae.require("util").types;return U||me&&me.binding&&me.binding("util")}catch{}}(),ce=Se&&Se.isTypedArray;function st(U,re,ge){switch(ge.length){case 0:return U.call(re);case 1:return U.call(re,ge[0]);case 2:return U.call(re,ge[0],ge[1]);case 3:return U.call(re,ge[0],ge[1],ge[2])}return U.apply(re,ge)}function Ke(U,re){for(var ge=-1,We=Array(U);++ge-1}function j(U,re){var ge=this.__data__,We=tr(ge,U);return We<0?(++this.size,ge.push([U,re])):ge[We][1]=re,this}br.prototype.clear=Lr,br.prototype.delete=yi,br.prototype.get=ms,br.prototype.has=Q,br.prototype.set=j;function Z(U){var re=-1,ge=U==null?0:U.length;for(this.clear();++re1?ge[un-1]:void 0,rr=un>2?ge[2]:void 0;for(Un=U.length>3&&typeof Un=="function"?(un--,Un):void 0,rr&&gn(ge[0],ge[1],rr)&&(Un=un<3?void 0:Un,un=1),re=Object(re);++We-1&&U%1==0&&U0){if(++re>=i)return arguments[0]}else re=0;return U.apply(void 0,arguments)}}function Hx(U){if(U!=null){try{return bt.call(U)}catch{}try{return U+""}catch{}}return""}function ph(U,re){return U===re||U!==U&&re!==re}var mh=_i(function(){return arguments}())?_i:function(U){return mg(U)&&je.call(U,"callee")&&!Me.call(U,"callee")},Wx=Array.isArray;function qx(U){return U!=null&&cL(U.length)&&!Yx(U)}function Iue(U){return mg(U)&&qx(U)}var lL=It||Pue;function Yx(U){if(!Rf(U))return!1;var re=is(U);return re==h||re==p||re==l||re==b}function cL(U){return typeof U=="number"&&U>-1&&U%1==0&&U<=o}function Rf(U){var re=typeof U;return U!=null&&(re=="object"||re=="function")}function mg(U){return U!=null&&typeof U=="object"}function xue(U){if(!mg(U)||is(U)!=_)return!1;var re=De(U);if(re===null)return!0;var ge=je.call(re,"constructor")&&re.constructor;return typeof ge=="function"&&ge instanceof ge&&bt.call(ge)==an}var fL=ce?qe(ce):Ye;function Cue(U){return ee(U,dL(U))}function dL(U){return qx(U)?xn(U,!0):zt(U)}var Aue=be(function(U,re,ge){Hn(U,re,ge)});function Oue(U){return function(){return U}}function hL(U){return U}function Pue(){return!1}e.exports=Aue})(Xw,Xw.exports);var nke=Xw.exports;const ND=ka(nke);function TJ(){return km().pathname.split("/")[1]}function Da(){return km().pathname.split("/")[2]}function kD(e){return structuredClone(e)}function DD(){const{answers:e}=Uu(n=>n),t=Da();return e[t]}const SJ=w.createContext(null);function rke(){const e=w.useContext(SJ);if(!e)throw new Error("useWindowEvents must be used within a WindowEventsProvider");return e}function ike(){const e=Da(),{sequence:t,trialValidation:n}=Uu(g=>g),r=DD(),i=Wl(),{saveTrialAnswer:s,setIframeAnswers:o}=Hl(),{storageEngine:a}=vf(),l=!tke(e),c=r==null?void 0:r.answer,f=Qd(),d=w.useMemo(()=>{const g=t.indexOf(e);return t[g+1]||"end"},[e,t]),h=`/${TJ()}/${d}`,p=w.useMemo(()=>Date.now(),[]),m=rke(),y=w.useCallback(()=>{const g=kD(n[e]),_=Object.values(g).reduce((E,S)=>Object.hasOwn(S,"values")?{...E,...S.values}:E,{}),{provenanceGraph:b}=g,T=Date.now(),I=m&&"current"in m&&m.current?m.current.splice(0,m.current.length):[];Object.keys(c||{}).length===0&&(i(s({currentStep:e,answer:_,startTime:p,endTime:T,provenanceGraph:b,windowEvents:I})),a&&a.saveAnswer(e,{answer:_,startTime:p,endTime:T,provenanceGraph:b,windowEvents:I}),i(o([]))),f(`${h}${window.location.search}`)},[o,a,i,c,n,f,p,e,s,h,m]);return{nextStep:d,isNextDisabled:l,goToNextStep:y}}function ske({label:e="Next",disabled:t=!1,setCheckClicked:n=()=>{},onClick:r}){const{isNextDisabled:i,goToNextStep:s}=ike(),o=w.useCallback(()=>{n(!1),r&&r(),s()},[s,r,n]);return $.jsx(yu,{type:"submit",disabled:t||i,onClick:o,children:e})}function u2(e){return e===null||typeof e!="object"?{}:Object.keys(e).reduce((t,n)=>{const r=e[n];return r!=null&&r!==!1&&(t[n]=r),t},{})}var oke=Object.defineProperty,Y9=Object.getOwnPropertySymbols,ake=Object.prototype.hasOwnProperty,uke=Object.prototype.propertyIsEnumerable,G9=(e,t,n)=>t in e?oke(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,lke=(e,t)=>{for(var n in t||(t={}))ake.call(t,n)&&G9(e,n,t[n]);if(Y9)for(var n of Y9(t))uke.call(t,n)&&G9(e,n,t[n]);return e};function IJ(e,t){if(t===null||typeof t!="object")return{};const n=lke({},t);return Object.keys(t).forEach(r=>{r.includes(`${String(e)}.`)&&delete n[r]}),n}const cke="__MANTINE_FORM_INDEX__";function K9(e,t){return t?typeof t=="boolean"?t:Array.isArray(t)?t.includes(e.replace(/[.][0-9]/g,`.${cke}`)):!1:!1}function Q9(e,t,n){typeof n.value=="object"&&(n.value=Xh(n.value)),!n.enumerable||n.get||n.set||!n.configurable||!n.writable||t==="__proto__"?Object.defineProperty(e,t,n):e[t]=n.value}function Xh(e){if(typeof e!="object")return e;var t=0,n,r,i,s=Object.prototype.toString.call(e);if(s==="[object Object]"?i=Object.create(e.__proto__||null):s==="[object Array]"?i=Array(e.length):s==="[object Set]"?(i=new Set,e.forEach(function(o){i.add(Xh(o))})):s==="[object Map]"?(i=new Map,e.forEach(function(o,a){i.set(Xh(a),Xh(o))})):s==="[object Date]"?i=new Date(+e):s==="[object RegExp]"?i=new RegExp(e.source,e.flags):s==="[object DataView]"?i=new e.constructor(Xh(e.buffer)):s==="[object ArrayBuffer]"?i=e.slice(0):s.slice(-6)==="Array]"&&(i=new e.constructor(e)),i){for(r=Object.getOwnPropertySymbols(e);t0,errors:t}}function l2(e,t,n="",r={}){return typeof e!="object"||e===null?r:Object.keys(e).reduce((i,s)=>{const o=e[s],a=`${n===""?"":`${n}.`}${s}`,u=Xu(a,t);let l=!1;return typeof o=="function"&&(i[a]=o(u,t,a)),typeof o=="object"&&Array.isArray(u)&&(l=!0,u.forEach((c,f)=>l2(o,t,`${a}.${f}`,i))),typeof o=="object"&&typeof u=="object"&&u!==null&&(l||l2(o,t,a,i)),i},r)}function c2(e,t){return X9(typeof e=="function"?e(t):l2(e,t))}function o1(e,t,n){if(typeof e!="string")return{hasError:!1,error:null};const r=c2(t,n),i=Object.keys(r.errors).find(s=>e.split(".").every((o,a)=>o===s.split(".")[a]));return{hasError:!!i,error:i?r.errors[i]:null}}function fke(e,{from:t,to:n},r){const i=Xu(e,r);if(!Array.isArray(i))return r;const s=[...i],o=i[t];return s.splice(t,1),s.splice(n,0,o),_I(e,s,r)}var dke=Object.defineProperty,J9=Object.getOwnPropertySymbols,hke=Object.prototype.hasOwnProperty,pke=Object.prototype.propertyIsEnumerable,Z9=(e,t,n)=>t in e?dke(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,mke=(e,t)=>{for(var n in t||(t={}))hke.call(t,n)&&Z9(e,n,t[n]);if(J9)for(var n of J9(t))pke.call(t,n)&&Z9(e,n,t[n]);return e};function gke(e,{from:t,to:n},r){const i=`${e}.${t}`,s=`${e}.${n}`,o=mke({},r);return Object.keys(r).every(a=>{let u,l;if(a.startsWith(i)&&(u=a,l=a.replace(i,s)),a.startsWith(s)&&(u=a.replace(s,i),l=a),u&&l){const c=o[u],f=o[l];return f===void 0?delete o[u]:o[u]=f,c===void 0?delete o[l]:o[l]=c,!1}return!0}),o}function yke(e,t,n){const r=Xu(e,n);return Array.isArray(r)?_I(e,r.filter((i,s)=>s!==t),n):n}var _ke=Object.defineProperty,eB=Object.getOwnPropertySymbols,vke=Object.prototype.hasOwnProperty,bke=Object.prototype.propertyIsEnumerable,tB=(e,t,n)=>t in e?_ke(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Eke=(e,t)=>{for(var n in t||(t={}))vke.call(t,n)&&tB(e,n,t[n]);if(eB)for(var n of eB(t))bke.call(t,n)&&tB(e,n,t[n]);return e};function nB(e,t){const n=e.substring(t.length+1).split(".")[0];return parseInt(n,10)}function rB(e,t,n,r){if(t===void 0)return n;const i=`${String(e)}`;let s=n;r===-1&&(s=IJ(`${i}.${t}`,s));const o=Eke({},s),a=new Set;return Object.entries(s).filter(([u])=>{if(!u.startsWith(`${i}.`))return!1;const l=nB(u,i);return Number.isNaN(l)?!1:l>=t}).forEach(([u,l])=>{const c=nB(u,i),f=u.replace(`${i}.${c}`,`${i}.${c+r}`);o[f]=l,a.add(f),a.has(u)||delete o[u]}),o}function wke(e,t,n,r){const i=Xu(e,r);if(!Array.isArray(i))return r;const s=[...i];return s.splice(typeof n=="number"?n:s.length,0,t),_I(e,s,r)}function iB(e,t){const n=Object.keys(e);if(typeof t=="string"){const r=n.filter(i=>i.startsWith(`${t}.`));return e[t]||r.some(i=>e[i])||!1}return n.some(r=>e[r])}function Tke(e){return t=>{if(!t)e(t);else if(typeof t=="function")e(t);else if(typeof t=="object"&&"nativeEvent"in t){const{currentTarget:n}=t;n instanceof HTMLInputElement?n.type==="checkbox"?e(n.checked):e(n.value):(n instanceof HTMLTextAreaElement||n instanceof HTMLSelectElement)&&e(n.value)}else e(t)}}var Ske=Object.defineProperty,Ike=Object.defineProperties,xke=Object.getOwnPropertyDescriptors,sB=Object.getOwnPropertySymbols,Cke=Object.prototype.hasOwnProperty,Ake=Object.prototype.propertyIsEnumerable,oB=(e,t,n)=>t in e?Ske(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,tc=(e,t)=>{for(var n in t||(t={}))Cke.call(t,n)&&oB(e,n,t[n]);if(sB)for(var n of sB(t))Ake.call(t,n)&&oB(e,n,t[n]);return e},lA=(e,t)=>Ike(e,xke(t));function Oke({initialValues:e={},initialErrors:t={},initialDirty:n={},initialTouched:r={},clearInputErrorOnChange:i=!0,validateInputOnChange:s=!1,validateInputOnBlur:o=!1,transformValues:a=l=>l,validate:u}={}){const[l,c]=w.useState(r),[f,d]=w.useState(n),[h,p]=w.useState(e),[m,y]=w.useState(u2(t)),g=w.useRef(e),_=O=>{g.current=O},b=w.useCallback(()=>c({}),[]),T=O=>{const q=O?tc(tc({},h),O):h;_(q),d({})},I=w.useCallback(O=>y(q=>u2(typeof O=="function"?O(q):O)),[]),E=w.useCallback(()=>y({}),[]),S=w.useCallback(()=>{p(e),E(),_(e),d({}),b()},[]),A=w.useCallback((O,q)=>I(le=>lA(tc({},le),{[O]:q})),[]),P=w.useCallback(O=>I(q=>{if(typeof O!="string")return q;const le=tc({},q);return delete le[O],le}),[]),V=w.useCallback(O=>d(q=>{if(typeof O!="string")return q;const le=IJ(O,q);return delete le[O],le}),[]),M=w.useCallback((O,q)=>{const le=K9(O,s);V(O),c(ae=>lA(tc({},ae),{[O]:!0})),p(ae=>{const pe=_I(O,q,ae);if(le){const me=o1(O,u,pe);me.hasError?A(O,me.error):P(O)}return pe}),!le&&i&&A(O,null)},[]),H=w.useCallback(O=>{p(q=>{const le=typeof O=="function"?O(q):O;return tc(tc({},q),le)}),i&&E()},[]),J=w.useCallback((O,q)=>{V(O),p(le=>fke(O,q,le)),y(le=>gke(O,q,le))},[]),Y=w.useCallback((O,q)=>{V(O),p(le=>yke(O,q,le)),y(le=>rB(O,q,le,-1))},[]),ye=w.useCallback((O,q,le)=>{V(O),p(ae=>wke(O,q,le,ae)),y(ae=>rB(O,le,ae,1))},[]),he=w.useCallback(()=>{const O=c2(u,h);return y(O.errors),O},[h,u]),ve=w.useCallback(O=>{const q=o1(O,u,h);return q.hasError?A(O,q.error):P(O),q},[h,u]),te=(O,{type:q="input",withError:le=!0,withFocus:ae=!0}={})=>{const me={onChange:Tke(Se=>M(O,Se))};return le&&(me.error=m[O]),q==="checkbox"?me.checked=Xu(O,h):me.value=Xu(O,h),ae&&(me.onFocus=()=>c(Se=>lA(tc({},Se),{[O]:!0})),me.onBlur=()=>{if(K9(O,o)){const Se=o1(O,u,h);Se.hasError?A(O,Se.error):P(O)}}),me},se=(O,q)=>le=>{le==null||le.preventDefault();const ae=he();ae.hasErrors?q==null||q(ae.errors,h,le):O==null||O(a(h),le)},K=O=>a(O||h),x=w.useCallback(O=>{O.preventDefault(),S()},[]),C=O=>{if(O){const le=Xu(O,f);if(typeof le=="boolean")return le;const ae=Xu(O,h),pe=Xu(O,g.current);return!l9(ae,pe)}return Object.keys(f).length>0?iB(f):!l9(h,g.current)},z=w.useCallback(O=>iB(l,O),[l]),R=w.useCallback(O=>O?!o1(O,u,h).hasError:!c2(u,h).hasErrors,[h,u]);return{values:h,errors:m,setValues:H,setErrors:I,setFieldValue:M,setFieldError:A,clearFieldError:P,clearErrors:E,reset:S,validate:he,validateField:ve,reorderListItem:J,removeListItem:Y,insertListItem:ye,getInputProps:te,onSubmit:se,onReset:x,isDirty:C,isTouched:z,setTouched:c,setDirty:d,resetTouched:b,resetDirty:T,isValid:R,getTransformedValues:K}}const Pke=new URLSearchParams(window.location.search),Rke=(e,t)=>{let n={};return e.forEach(r=>{const i=t?t[r.id]:{};if(i)n={...n,[r.id]:i};else{const s=r.paramCapture?Pke.get(r.paramCapture):"";n={...n,[r.id]:r.type==="iframe"?[]:s}}}),{...n}},Nke=e=>{let t={};return e.forEach(n=>{n.required&&(t={...t,[n.id]:r=>{if(Array.isArray(r)){if(n.requiredValue!=null&&!Array.isArray(n.requiredValue))return"Incorrect required value";if(n.requiredValue!=null&&Array.isArray(n.requiredValue)){if(n.requiredValue.length!==r.length)return"Incorrect input";const i=[...n.requiredValue].sort(),s=[...r].sort();return i.every((o,a)=>o===s[a])?null:"Incorrect input"}return r.length===0?"Empty input":null}return n.required&&n.requiredValue!=null&&r!=null?r.toString()!==n.requiredValue.toString()?"Incorrect input":null:n.required?r==null||r===""?"Empty input":null:r===null?"Empty input":null}})}),t};function kke(e,t,n){const[r,i]=w.useState(null),s=Oke({initialValues:Rke(e,n),validate:Nke(e)});return w.useEffect(()=>{r!==t&&(i(t),s.reset())},[r,s,t]),s}function eh(e,t,n){var o;const{requiredValue:r,requiredLabel:i}=e;let s="";return t.checked&&Array.isArray(r)?s=r&&[...r].sort().toString()!==[...t.checked].sort().toString()?`Please ${n?"select":"enter"} ${i||r.toString()} to continue.`:null:s=t.value&&r&&r.toString()!==t.value.toString()?`Please ${n?"select":"enter"} ${i||(n?(o=n.find(a=>a.value===r))==null?void 0:o.label:r.toString())} to continue.`:null,s}const aB=["http","https","mailto","tel"];function Dke(e){const t=(e||"").trim(),n=t.charAt(0);if(n==="#"||n==="/")return t;const r=t.indexOf(":");if(r===-1)return t;let i=-1;for(;++ii||(i=t.indexOf("#"),i!==-1&&r>i)?t:"javascript:void(0)"}/*! + deps: ${c}}`};const i={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(u){const[l,c]=s(u);o(u,l),a(u,c)}};function s({schema:u}){const l={},c={};for(const f in u){if(f==="__proto__")continue;const d=Array.isArray(u[f])?l:c;d[f]=u[f]}return[l,c]}function o(u,l=u.schema){const{gen:c,data:f,it:d}=u;if(Object.keys(l).length===0)return;const h=c.let("missing");for(const p in l){const m=l[p];if(m.length===0)continue;const y=(0,r.propertyInData)(c,f,p,d.opts.ownProperties);u.setParams({property:p,depsCount:m.length,deps:m.join(", ")}),d.allErrors?c.if(y,()=>{for(const g of m)(0,r.checkReportMissingProp)(u,g)}):(c.if((0,t._)`${y} && (${(0,r.checkMissingProp)(u,m,h)})`),(0,r.reportMissingProp)(u,h),c.else())}}e.validatePropertyDeps=o;function a(u,l=u.schema){const{gen:c,data:f,keyword:d,it:h}=u,p=c.name("valid");for(const m in l)(0,n.alwaysValidSchema)(h,l[m])||(c.if((0,r.propertyInData)(c,f,m,h.opts.ownProperties),()=>{const y=u.subschema({keyword:d,schemaProp:m},p);u.mergeValidEvaluated(y,p)},()=>c.var(p,!0)),u.ok(p))}e.validateSchemaDeps=a,e.default=i})(YX);var dD={};Object.defineProperty(dD,"__esModule",{value:!0});const GX=Yt,M2e=pn,F2e={message:"property name must be valid",params:({params:e})=>(0,GX._)`{propertyName: ${e.propertyName}}`},B2e={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:F2e,code(e){const{gen:t,schema:n,data:r,it:i}=e;if((0,M2e.alwaysValidSchema)(i,n))return;const s=t.name("valid");t.forIn("key",r,o=>{e.setParams({propertyName:o}),e.subschema({keyword:"propertyNames",data:o,dataTypes:["string"],propertyName:o,compositeRule:!0},s),t.if((0,GX.not)(s),()=>{e.error(!0),i.allErrors||t.break()})}),e.ok(s)}};dD.default=B2e;var mI={};Object.defineProperty(mI,"__esModule",{value:!0});const r1=qt,la=Yt,j2e=ju,i1=pn,U2e={message:"must NOT have additional properties",params:({params:e})=>(0,la._)`{additionalProperty: ${e.additionalProperty}}`},V2e={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:U2e,code(e){const{gen:t,schema:n,parentSchema:r,data:i,errsCount:s,it:o}=e;if(!s)throw new Error("ajv implementation error");const{allErrors:a,opts:u}=o;if(o.props=!0,u.removeAdditional!=="all"&&(0,i1.alwaysValidSchema)(o,n))return;const l=(0,r1.allSchemaProperties)(r.properties),c=(0,r1.allSchemaProperties)(r.patternProperties);f(),e.ok((0,la._)`${s} === ${j2e.default.errors}`);function f(){t.forIn("key",i,y=>{!l.length&&!c.length?p(y):t.if(d(y),()=>p(y))})}function d(y){let g;if(l.length>8){const _=(0,i1.schemaRefOrVal)(o,r.properties,"properties");g=(0,r1.isOwnProperty)(t,_,y)}else l.length?g=(0,la.or)(...l.map(_=>(0,la._)`${y} === ${_}`)):g=la.nil;return c.length&&(g=(0,la.or)(g,...c.map(_=>(0,la._)`${(0,r1.usePattern)(e,_)}.test(${y})`))),(0,la.not)(g)}function h(y){t.code((0,la._)`delete ${i}[${y}]`)}function p(y){if(u.removeAdditional==="all"||u.removeAdditional&&n===!1){h(y);return}if(n===!1){e.setParams({additionalProperty:y}),e.error(),a||t.break();return}if(typeof n=="object"&&!(0,i1.alwaysValidSchema)(o,n)){const g=t.name("valid");u.removeAdditional==="failing"?(m(y,g,!1),t.if((0,la.not)(g),()=>{e.reset(),h(y)})):(m(y,g),a||t.if((0,la.not)(g),()=>t.break()))}}function m(y,g,_){const b={keyword:"additionalProperties",dataProp:y,dataPropType:i1.Type.Str};_===!1&&Object.assign(b,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(b,g)}}};mI.default=V2e;var hD={};Object.defineProperty(hD,"__esModule",{value:!0});const z2e=Ia,v9=qt,tA=pn,b9=mI,H2e={keyword:"properties",type:"object",schemaType:"object",code(e){const{gen:t,schema:n,parentSchema:r,data:i,it:s}=e;s.opts.removeAdditional==="all"&&r.additionalProperties===void 0&&b9.default.code(new z2e.KeywordCxt(s,b9.default,"additionalProperties"));const o=(0,v9.allSchemaProperties)(n);for(const f of o)s.definedProperties.add(f);s.opts.unevaluated&&o.length&&s.props!==!0&&(s.props=tA.mergeEvaluated.props(t,(0,tA.toHash)(o),s.props));const a=o.filter(f=>!(0,tA.alwaysValidSchema)(s,n[f]));if(a.length===0)return;const u=t.name("valid");for(const f of a)l(f)?c(f):(t.if((0,v9.propertyInData)(t,i,f,s.opts.ownProperties)),c(f),s.allErrors||t.else().var(u,!0),t.endIf()),e.it.definedProperties.add(f),e.ok(u);function l(f){return s.opts.useDefaults&&!s.compositeRule&&n[f].default!==void 0}function c(f){e.subschema({keyword:"properties",schemaProp:f,dataProp:f},u)}}};hD.default=H2e;var pD={};Object.defineProperty(pD,"__esModule",{value:!0});const E9=qt,s1=Yt,w9=pn,T9=pn,W2e={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:n,data:r,parentSchema:i,it:s}=e,{opts:o}=s,a=(0,E9.allSchemaProperties)(n),u=a.filter(m=>(0,w9.alwaysValidSchema)(s,n[m]));if(a.length===0||u.length===a.length&&(!s.opts.unevaluated||s.props===!0))return;const l=o.strictSchema&&!o.allowMatchingProperties&&i.properties,c=t.name("valid");s.props!==!0&&!(s.props instanceof s1.Name)&&(s.props=(0,T9.evaluatedPropsToName)(t,s.props));const{props:f}=s;d();function d(){for(const m of a)l&&h(m),s.allErrors?p(m):(t.var(c,!0),p(m),t.if(c))}function h(m){for(const y in l)new RegExp(m).test(y)&&(0,w9.checkStrictMode)(s,`property ${y} matches pattern ${m} (use allowMatchingProperties)`)}function p(m){t.forIn("key",r,y=>{t.if((0,s1._)`${(0,E9.usePattern)(e,m)}.test(${y})`,()=>{const g=u.includes(m);g||e.subschema({keyword:"patternProperties",schemaProp:m,dataProp:y,dataPropType:T9.Type.Str},c),s.opts.unevaluated&&f!==!0?t.assign((0,s1._)`${f}[${y}]`,!0):!g&&!s.allErrors&&t.if((0,s1.not)(c),()=>t.break())})})}}};pD.default=W2e;var mD={};Object.defineProperty(mD,"__esModule",{value:!0});const q2e=pn,Y2e={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:n,it:r}=e;if((0,q2e.alwaysValidSchema)(r,n)){e.fail();return}const i=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),e.failResult(i,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};mD.default=Y2e;var gD={};Object.defineProperty(gD,"__esModule",{value:!0});const G2e=qt,K2e={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:G2e.validateUnion,error:{message:"must match a schema in anyOf"}};gD.default=K2e;var yD={};Object.defineProperty(yD,"__esModule",{value:!0});const sb=Yt,Q2e=pn,X2e={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,sb._)`{passingSchemas: ${e.passing}}`},J2e={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:X2e,code(e){const{gen:t,schema:n,parentSchema:r,it:i}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");if(i.opts.discriminator&&r.discriminator)return;const s=n,o=t.let("valid",!1),a=t.let("passing",null),u=t.name("_valid");e.setParams({passing:a}),t.block(l),e.result(o,()=>e.reset(),()=>e.error(!0));function l(){s.forEach((c,f)=>{let d;(0,Q2e.alwaysValidSchema)(i,c)?t.var(u,!0):d=e.subschema({keyword:"oneOf",schemaProp:f,compositeRule:!0},u),f>0&&t.if((0,sb._)`${u} && ${o}`).assign(o,!1).assign(a,(0,sb._)`[${a}, ${f}]`).else(),t.if(u,()=>{t.assign(o,!0),t.assign(a,f),d&&e.mergeEvaluated(d,sb.Name)})})}}};yD.default=J2e;var _D={};Object.defineProperty(_D,"__esModule",{value:!0});const Z2e=pn,eRe={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:n,it:r}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");const i=t.name("valid");n.forEach((s,o)=>{if((0,Z2e.alwaysValidSchema)(r,s))return;const a=e.subschema({keyword:"allOf",schemaProp:o},i);e.ok(i),e.mergeEvaluated(a)})}};_D.default=eRe;var vD={};Object.defineProperty(vD,"__esModule",{value:!0});const Hw=Yt,KX=pn,tRe={message:({params:e})=>(0,Hw.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,Hw._)`{failingKeyword: ${e.ifClause}}`},nRe={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:tRe,code(e){const{gen:t,parentSchema:n,it:r}=e;n.then===void 0&&n.else===void 0&&(0,KX.checkStrictMode)(r,'"if" without "then" and "else" is ignored');const i=S9(r,"then"),s=S9(r,"else");if(!i&&!s)return;const o=t.let("valid",!0),a=t.name("_valid");if(u(),e.reset(),i&&s){const c=t.let("ifClause");e.setParams({ifClause:c}),t.if(a,l("then",c),l("else",c))}else i?t.if(a,l("then")):t.if((0,Hw.not)(a),l("else"));e.pass(o,()=>e.error(!0));function u(){const c=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);e.mergeEvaluated(c)}function l(c,f){return()=>{const d=e.subschema({keyword:c},a);t.assign(o,a),e.mergeValidEvaluated(d,o),f?t.assign(f,(0,Hw._)`${c}`):e.setParams({ifClause:c})}}}};function S9(e,t){const n=e.schema[t];return n!==void 0&&!(0,KX.alwaysValidSchema)(e,n)}vD.default=nRe;var bD={};Object.defineProperty(bD,"__esModule",{value:!0});const rRe=pn,iRe={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:n}){t.if===void 0&&(0,rRe.checkStrictMode)(n,`"${e}" without "if" is ignored`)}};bD.default=iRe;Object.defineProperty(uD,"__esModule",{value:!0});const sRe=Fm,oRe=lD,aRe=Bm,uRe=cD,lRe=fD,cRe=YX,fRe=dD,dRe=mI,hRe=hD,pRe=pD,mRe=mD,gRe=gD,yRe=yD,_Re=_D,vRe=vD,bRe=bD;function ERe(e=!1){const t=[mRe.default,gRe.default,yRe.default,_Re.default,vRe.default,bRe.default,fRe.default,dRe.default,cRe.default,hRe.default,pRe.default];return e?t.push(oRe.default,uRe.default):t.push(sRe.default,aRe.default),t.push(lRe.default),t}uD.default=ERe;var ED={},wD={};Object.defineProperty(wD,"__esModule",{value:!0});const Nr=Yt,wRe={message:({schemaCode:e})=>(0,Nr.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,Nr._)`{format: ${e}}`},TRe={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:wRe,code(e,t){const{gen:n,data:r,$data:i,schema:s,schemaCode:o,it:a}=e,{opts:u,errSchemaPath:l,schemaEnv:c,self:f}=a;if(!u.validateFormats)return;i?d():h();function d(){const p=n.scopeValue("formats",{ref:f.formats,code:u.code.formats}),m=n.const("fDef",(0,Nr._)`${p}[${o}]`),y=n.let("fType"),g=n.let("format");n.if((0,Nr._)`typeof ${m} == "object" && !(${m} instanceof RegExp)`,()=>n.assign(y,(0,Nr._)`${m}.type || "string"`).assign(g,(0,Nr._)`${m}.validate`),()=>n.assign(y,(0,Nr._)`"string"`).assign(g,m)),e.fail$data((0,Nr.or)(_(),b()));function _(){return u.strictSchema===!1?Nr.nil:(0,Nr._)`${o} && !${g}`}function b(){const T=c.$async?(0,Nr._)`(${m}.async ? await ${g}(${r}) : ${g}(${r}))`:(0,Nr._)`${g}(${r})`,I=(0,Nr._)`(typeof ${g} == "function" ? ${T} : ${g}.test(${r}))`;return(0,Nr._)`${g} && ${g} !== true && ${y} === ${t} && !${I}`}}function h(){const p=f.formats[s];if(!p){_();return}if(p===!0)return;const[m,y,g]=b(p);m===t&&e.pass(T());function _(){if(u.strictSchema===!1){f.logger.warn(I());return}throw new Error(I());function I(){return`unknown format "${s}" ignored in schema at path "${l}"`}}function b(I){const E=I instanceof RegExp?(0,Nr.regexpCode)(I):u.code.formats?(0,Nr._)`${u.code.formats}${(0,Nr.getProperty)(s)}`:void 0,S=n.scopeValue("formats",{key:s,ref:I,code:E});return typeof I=="object"&&!(I instanceof RegExp)?[I.type||"string",I.validate,(0,Nr._)`${S}.validate`]:["string",I,S]}function T(){if(typeof p=="object"&&!(p instanceof RegExp)&&p.async){if(!c.$async)throw new Error("async format in sync schema");return(0,Nr._)`await ${g}(${r})`}return typeof y=="function"?(0,Nr._)`${g}(${r})`:(0,Nr._)`${g}.test(${r})`}}}};wD.default=TRe;Object.defineProperty(ED,"__esModule",{value:!0});const SRe=wD,IRe=[SRe.default];ED.default=IRe;var tm={};Object.defineProperty(tm,"__esModule",{value:!0});tm.contentVocabulary=tm.metadataVocabulary=void 0;tm.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];tm.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"];Object.defineProperty(Yk,"__esModule",{value:!0});const xRe=Gk,CRe=Qk,ARe=uD,ORe=ED,I9=tm,PRe=[xRe.default,CRe.default,(0,ARe.default)(),ORe.default,I9.metadataVocabulary,I9.contentVocabulary];Yk.default=PRe;var TD={},QX={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DiscrError=void 0,function(t){t.Tag="tag",t.Mapping="mapping"}(e.DiscrError||(e.DiscrError={}))})(QX);Object.defineProperty(TD,"__esModule",{value:!0});const Oh=Yt,e2=QX,x9=Rs,RRe=pn,NRe={message:({params:{discrError:e,tagName:t}})=>e===e2.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:n}})=>(0,Oh._)`{error: ${e}, tag: ${n}, tagValue: ${t}}`},kRe={keyword:"discriminator",type:"object",schemaType:"object",error:NRe,code(e){const{gen:t,data:n,schema:r,parentSchema:i,it:s}=e,{oneOf:o}=i;if(!s.opts.discriminator)throw new Error("discriminator: requires discriminator option");const a=r.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(r.mapping)throw new Error("discriminator: mapping is not supported");if(!o)throw new Error("discriminator: requires oneOf keyword");const u=t.let("valid",!1),l=t.const("tag",(0,Oh._)`${n}${(0,Oh.getProperty)(a)}`);t.if((0,Oh._)`typeof ${l} == "string"`,()=>c(),()=>e.error(!1,{discrError:e2.DiscrError.Tag,tag:l,tagName:a})),e.ok(u);function c(){const h=d();t.if(!1);for(const p in h)t.elseIf((0,Oh._)`${l} === ${p}`),t.assign(u,f(h[p]));t.else(),e.error(!1,{discrError:e2.DiscrError.Mapping,tag:l,tagName:a}),t.endIf()}function f(h){const p=t.name("valid"),m=e.subschema({keyword:"oneOf",schemaProp:h},p);return e.mergeEvaluated(m,Oh.Name),p}function d(){var h;const p={},m=g(i);let y=!0;for(let T=0;Tthis.addVocabulary(p)),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const p=this.opts.$data?this.$dataMetaSchema(s,o):s;this.addMetaSchema(p,a,!1),this.refs["http://json-schema.org/schema"]=a}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(a)?a:void 0)}}e.exports=t=u,Object.defineProperty(t,"__esModule",{value:!0}),t.default=u;var l=Ia;Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return l.KeywordCxt}});var c=Yt;Object.defineProperty(t,"_",{enumerable:!0,get:function(){return c._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return c.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return c.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return c.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return c.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return c.CodeGen}});var f=R_;Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return f.default}});var d=N_;Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return d.default}})})(GP,GP.exports);var URe=GP.exports;const XX=ka(URe),VRe="#/definitions/StudyConfig",zRe="http://json-schema.org/draft-07/schema#",HRe={Answer:{additionalProperties:!1,description:"The Answer interface is used to define the properties of an answer. Answers are used to define the correct answer for a task. These are generally used in training tasks.",properties:{acceptableHigh:{description:"The acceptable high value for the answer. This is used to define a range of acceptable answers.",type:"number"},acceptableLow:{description:"The acceptable low value for the answer. This is used to define a range of acceptable answers.",type:"number"},answer:{description:"The correct answer to the question."},id:{description:"The id of the answer. This is used to identify the answer in the data file.",type:"string"}},required:["id","answer"],type:"object"},CheckboxResponse:{additionalProperties:!1,description:"The CheckboxResponse interface is used to define the properties of a checkbox response. CheckboxResponses render as a checkbox input with user specified options.",properties:{correctAnswer:{description:"The correct answer to the response. This is used in the data download and can be shown in the admin panel."},hidden:{description:"Controls whether the response is hidden.",type:"boolean"},id:{description:"The id of the response. This is used to identify the response in the data file.",type:"string"},location:{$ref:"#/definitions/ResponseBlockLocation",description:"Controls the response location. These might be the same for all responses, or differ across responses."},options:{description:"The options that are displayed as checkboxes.",items:{$ref:"#/definitions/Option"},type:"array"},paramCapture:{description:"Use to capture querystring parameters in answers such as participant_name. See the examples for how this is used, but prefer uiConfig.urlParticipantIdParam if you are capturing a participant ID.",type:"string"},prompt:{description:"The prompt that is displayed to the participant. You can use markdown here to render images, links, etc.",type:"string"},required:{description:"Controls whether the response is required to be answered.",type:"boolean"},requiredLabel:{description:"You can provide a required label, which makes it so a participant has to answer with a response that matches label.",type:"string"},requiredValue:{description:"You can provide a required value, which makes it so a participant has to answer with that value."},type:{const:"checkbox",type:"string"}},required:["id","location","options","prompt","required","type"],type:"object"},DropdownResponse:{additionalProperties:!1,description:"The DropdownResponse interface is used to define the properties of a dropdown response. DropdownResponses render as a select input with user specified options.",properties:{correctAnswer:{description:"The correct answer to the response. This is used in the data download and can be shown in the admin panel."},hidden:{description:"Controls whether the response is hidden.",type:"boolean"},id:{description:"The id of the response. This is used to identify the response in the data file.",type:"string"},location:{$ref:"#/definitions/ResponseBlockLocation",description:"Controls the response location. These might be the same for all responses, or differ across responses."},options:{description:"The options that are displayed in the dropdown.",items:{$ref:"#/definitions/Option"},type:"array"},paramCapture:{description:"Use to capture querystring parameters in answers such as participant_name. See the examples for how this is used, but prefer uiConfig.urlParticipantIdParam if you are capturing a participant ID.",type:"string"},placeholder:{description:"The placeholder text that is displayed in the input.",type:"string"},prompt:{description:"The prompt that is displayed to the participant. You can use markdown here to render images, links, etc.",type:"string"},required:{description:"Controls whether the response is required to be answered.",type:"boolean"},requiredLabel:{description:"You can provide a required label, which makes it so a participant has to answer with a response that matches label.",type:"string"},requiredValue:{description:"You can provide a required value, which makes it so a participant has to answer with that value."},type:{const:"dropdown",type:"string"}},required:["id","location","options","prompt","required","type"],type:"object"},IFrameResponse:{additionalProperties:!1,description:"The IFrameResponse interface is used to define the properties of an iframe response. IFrameResponses render as a list, that is connected to a WebsiteComponent. When data is sent from the WebsiteComponent, it is displayed in the list.",properties:{correctAnswer:{description:"The correct answer to the response. This is used in the data download and can be shown in the admin panel."},hidden:{description:"Controls whether the response is hidden.",type:"boolean"},id:{description:"The id of the response. This is used to identify the response in the data file.",type:"string"},location:{$ref:"#/definitions/ResponseBlockLocation",description:"Controls the response location. These might be the same for all responses, or differ across responses."},paramCapture:{description:"Use to capture querystring parameters in answers such as participant_name. See the examples for how this is used, but prefer uiConfig.urlParticipantIdParam if you are capturing a participant ID.",type:"string"},prompt:{description:"The prompt that is displayed to the participant. You can use markdown here to render images, links, etc.",type:"string"},required:{description:"Controls whether the response is required to be answered.",type:"boolean"},requiredLabel:{description:"You can provide a required label, which makes it so a participant has to answer with a response that matches label.",type:"string"},requiredValue:{description:"You can provide a required value, which makes it so a participant has to answer with that value."},type:{const:"iframe",type:"string"}},required:["id","location","prompt","required","type"],type:"object"},ImageComponent:{additionalProperties:!1,description:"The ImageComponent interface is used to define the properties of an image component. This component is used to render an image with optional styling.",properties:{correctAnswer:{description:"The correct answer to the component. This is used for training trials where the user is shown the correct answer after a guess.",items:{$ref:"#/definitions/Answer"},type:"array"},description:{description:"The description of the component. This is used to identify and provide additional information for the component in the admin panel.",type:"string"},instruction:{description:"The instruction of the component. This is used to identify and provide additional information for the component in the admin panel.",type:"string"},instructionLocation:{$ref:"#/definitions/ResponseBlockLocation",description:"The location of the instructions."},meta:{additionalProperties:{},description:"The meta data for the component. This is used to identify and provide additional information for the component in the admin panel.",type:"object"},nextButtonLocation:{$ref:"#/definitions/ResponseBlockLocation",description:"The location of the next button."},nextButtonText:{description:"The text that is displayed on the next button.",type:"string"},path:{description:"The path to the image. This should be a relative path from the public folder.",type:"string"},response:{description:"The responses to the component",items:{$ref:"#/definitions/Response"},type:"array"},style:{additionalProperties:{type:"string"},description:"The style of the image. This is an object with css properties as keys and css values as values.",type:"object"},type:{const:"image",type:"string"}},required:["path","response","type"],type:"object"},IndividualComponent:{anyOf:[{$ref:"#/definitions/MarkdownComponent"},{$ref:"#/definitions/ReactComponent"},{$ref:"#/definitions/ImageComponent"},{$ref:"#/definitions/WebsiteComponent"},{$ref:"#/definitions/QuestionnaireComponent"}]},InheritedComponent:{additionalProperties:!1,description:"An InheritedComponent is a component that inherits properties from a baseComponent. This is used to avoid repeating properties in components. This also means that components in the baseComponents object can be partially defined, while components in the components object can inherit from them and must be fully defined and include all properties (after potentially merging with a base component).",properties:{baseComponent:{type:"string"},correctAnswer:{description:"The correct answer to the component. This is used for training trials where the user is shown the correct answer after a guess.",items:{$ref:"#/definitions/Answer"},type:"array"},description:{description:"The description of the component. This is used to identify and provide additional information for the component in the admin panel.",type:"string"},instruction:{description:"The instruction of the component. This is used to identify and provide additional information for the component in the admin panel.",type:"string"},instructionLocation:{$ref:"#/definitions/ResponseBlockLocation",description:"The location of the instructions."},meta:{additionalProperties:{},description:"The meta data for the component. This is used to identify and provide additional information for the component in the admin panel.",type:"object"},nextButtonLocation:{$ref:"#/definitions/ResponseBlockLocation",description:"The location of the next button."},nextButtonText:{description:"The text that is displayed on the next button.",type:"string"},parameters:{anyOf:[{additionalProperties:{},description:"The parameters that are passed to the react component. These can be used within your react component to render different things.",type:"object"},{additionalProperties:{},description:"The parameters that are passed to the website (iframe). These can be used within your website to render different things.",type:"object"}],description:"The parameters that are passed to the react component. These can be used within your react component to render different things."},path:{description:"The path to the markdown file. This should be a relative path from the public folder.",type:"string"},response:{description:"The responses to the component",items:{$ref:"#/definitions/Response"},type:"array"},style:{additionalProperties:{type:"string"},description:"The style of the image. This is an object with css properties as keys and css values as values.",type:"object"},type:{enum:["markdown","react-component","image","website","questionnaire"],type:"string"}},required:["baseComponent"],type:"object"},LikertResponse:{additionalProperties:!1,description:"The LikertResponse interface is used to define the properties of a likert response. LikertResponses render as radio buttons with a user specified number of options, which can be controlled through the preset. For example, preset: 5 will render 5 radio buttons, and preset: 7 will render 7 radio buttons. LikertResponses can also have a description, and left and right labels. The left and right labels are used to label the left and right ends of the likert scale with values such as 'Strongly Disagree' and 'Strongly Agree'.",properties:{correctAnswer:{description:"The correct answer to the response. This is used in the data download and can be shown in the admin panel."},desc:{description:"The description of the likert scale.",type:"string"},hidden:{description:"Controls whether the response is hidden.",type:"boolean"},id:{description:"The id of the response. This is used to identify the response in the data file.",type:"string"},leftLabel:{description:"The left label of the likert scale. E.g Strongly Disagree",type:"string"},location:{$ref:"#/definitions/ResponseBlockLocation",description:"Controls the response location. These might be the same for all responses, or differ across responses."},paramCapture:{description:"Use to capture querystring parameters in answers such as participant_name. See the examples for how this is used, but prefer uiConfig.urlParticipantIdParam if you are capturing a participant ID.",type:"string"},preset:{description:"The number of options to render.",type:"number"},prompt:{description:"The prompt that is displayed to the participant. You can use markdown here to render images, links, etc.",type:"string"},required:{description:"Controls whether the response is required to be answered.",type:"boolean"},requiredLabel:{description:"You can provide a required label, which makes it so a participant has to answer with a response that matches label.",type:"string"},requiredValue:{description:"You can provide a required value, which makes it so a participant has to answer with that value."},rightLabel:{description:"The right label of the likert scale. E.g Strongly Agree",type:"string"},type:{const:"likert",type:"string"}},required:["id","location","preset","prompt","required","type"],type:"object"},LongTextResponse:{additionalProperties:!1,description:"The LongTextResponse interface is used to define the properties of a long text response. LongTextResponses render as a text area that accepts any text and can optionally have a placeholder.",properties:{correctAnswer:{description:"The correct answer to the response. This is used in the data download and can be shown in the admin panel."},hidden:{description:"Controls whether the response is hidden.",type:"boolean"},id:{description:"The id of the response. This is used to identify the response in the data file.",type:"string"},location:{$ref:"#/definitions/ResponseBlockLocation",description:"Controls the response location. These might be the same for all responses, or differ across responses."},paramCapture:{description:"Use to capture querystring parameters in answers such as participant_name. See the examples for how this is used, but prefer uiConfig.urlParticipantIdParam if you are capturing a participant ID.",type:"string"},placeholder:{description:"The placeholder text that is displayed in the input.",type:"string"},prompt:{description:"The prompt that is displayed to the participant. You can use markdown here to render images, links, etc.",type:"string"},required:{description:"Controls whether the response is required to be answered.",type:"boolean"},requiredLabel:{description:"You can provide a required label, which makes it so a participant has to answer with a response that matches label.",type:"string"},requiredValue:{description:"You can provide a required value, which makes it so a participant has to answer with that value."},type:{const:"longText",type:"string"}},required:["id","location","prompt","required","type"],type:"object"},MarkdownComponent:{additionalProperties:!1,description:"The MarkdownComponent interface is used to define the properties of a markdown component. The components can be used to render many different things, such as consent forms, instructions, and debriefs. Additionally, you can use the markdown component to render images, videos, and other media, with supporting text.",properties:{correctAnswer:{description:"The correct answer to the component. This is used for training trials where the user is shown the correct answer after a guess.",items:{$ref:"#/definitions/Answer"},type:"array"},description:{description:"The description of the component. This is used to identify and provide additional information for the component in the admin panel.",type:"string"},instruction:{description:"The instruction of the component. This is used to identify and provide additional information for the component in the admin panel.",type:"string"},instructionLocation:{$ref:"#/definitions/ResponseBlockLocation",description:"The location of the instructions."},meta:{additionalProperties:{},description:"The meta data for the component. This is used to identify and provide additional information for the component in the admin panel.",type:"object"},nextButtonLocation:{$ref:"#/definitions/ResponseBlockLocation",description:"The location of the next button."},nextButtonText:{description:"The text that is displayed on the next button.",type:"string"},path:{description:"The path to the markdown file. This should be a relative path from the public folder.",type:"string"},response:{description:"The responses to the component",items:{$ref:"#/definitions/Response"},type:"array"},type:{const:"markdown",type:"string"}},required:["path","response","type"],type:"object"},NumericalResponse:{additionalProperties:!1,description:"The NumericalResponse interface is used to define the properties of a numerical response. NumericalResponses render as a text input that only accepts numbers, and can optionally have a min and max value, or a placeholder.",properties:{correctAnswer:{description:"The correct answer to the response. This is used in the data download and can be shown in the admin panel."},hidden:{description:"Controls whether the response is hidden.",type:"boolean"},id:{description:"The id of the response. This is used to identify the response in the data file.",type:"string"},location:{$ref:"#/definitions/ResponseBlockLocation",description:"Controls the response location. These might be the same for all responses, or differ across responses."},max:{description:"The maximum value that is accepted in the input.",type:"number"},min:{description:"The minimum value that is accepted in the input.",type:"number"},paramCapture:{description:"Use to capture querystring parameters in answers such as participant_name. See the examples for how this is used, but prefer uiConfig.urlParticipantIdParam if you are capturing a participant ID.",type:"string"},placeholder:{description:"The placeholder text that is displayed in the input.",type:"string"},prompt:{description:"The prompt that is displayed to the participant. You can use markdown here to render images, links, etc.",type:"string"},required:{description:"Controls whether the response is required to be answered.",type:"boolean"},requiredLabel:{description:"You can provide a required label, which makes it so a participant has to answer with a response that matches label.",type:"string"},requiredValue:{description:"You can provide a required value, which makes it so a participant has to answer with that value."},type:{const:"numerical",type:"string"}},required:["id","location","prompt","required","type"],type:"object"},Option:{additionalProperties:!1,description:"The Option interface is used to define the options for a dropdown, slider, radio, or checkbox response. The label is the text that is displayed to the user, and the value is the value that is stored in the data file. The Option interface is used in the Response interface.",properties:{label:{description:"The label displayed to participants.",type:"string"},value:{description:"The value stored in the participant's data.",type:["string","number"]}},required:["label","value"],type:"object"},OrderObject:{additionalProperties:!1,description:"The OrderObject interface is used to define the properties of an order object. This is used to define the order of components in a study. It supports random assignment of trials using a pure random assignment and a latin square.",properties:{components:{description:"The components that are included in the order.",items:{anyOf:[{type:"string"},{$ref:"#/definitions/OrderObject"}]},type:"array"},numSamples:{description:"The number of samples to use for the random assignments. This means you can randomize across 3 components while only showing a participant 2 at a time.",type:"number"},order:{description:"The type of order. This can be random (pure random), latinSquare (random with some guarantees), or fixed.",enum:["random","latinSquare","fixed"],type:"string"}},required:["order","components"],type:"object"},QuestionnaireComponent:{additionalProperties:!1,description:"The QuestionnaireComponent interface is used to define the properties of a questionnaire component. A QuestionnaireComponent is used to render questions with different response types. The response types are also defined with these documentation. The main use case of this component type is to ask participants questions, without using markdown, websites, images, etc.",properties:{correctAnswer:{description:"The correct answer to the component. This is used for training trials where the user is shown the correct answer after a guess.",items:{$ref:"#/definitions/Answer"},type:"array"},description:{description:"The description of the component. This is used to identify and provide additional information for the component in the admin panel.",type:"string"},instruction:{description:"The instruction of the component. This is used to identify and provide additional information for the component in the admin panel.",type:"string"},instructionLocation:{$ref:"#/definitions/ResponseBlockLocation",description:"The location of the instructions."},meta:{additionalProperties:{},description:"The meta data for the component. This is used to identify and provide additional information for the component in the admin panel.",type:"object"},nextButtonLocation:{$ref:"#/definitions/ResponseBlockLocation",description:"The location of the next button."},nextButtonText:{description:"The text that is displayed on the next button.",type:"string"},response:{description:"The responses to the component",items:{$ref:"#/definitions/Response"},type:"array"},type:{const:"questionnaire",type:"string"}},required:["response","type"],type:"object"},RadioResponse:{additionalProperties:!1,description:"The RadioResponse interface is used to define the properties of a radio response. RadioResponses render as a radio input with user specified options, and optionally left and right labels.",properties:{correctAnswer:{description:"The correct answer to the response. This is used in the data download and can be shown in the admin panel."},hidden:{description:"Controls whether the response is hidden.",type:"boolean"},id:{description:"The id of the response. This is used to identify the response in the data file.",type:"string"},leftLabel:{type:"string"},location:{$ref:"#/definitions/ResponseBlockLocation",description:"Controls the response location. These might be the same for all responses, or differ across responses."},options:{items:{$ref:"#/definitions/Option"},type:"array"},paramCapture:{description:"Use to capture querystring parameters in answers such as participant_name. See the examples for how this is used, but prefer uiConfig.urlParticipantIdParam if you are capturing a participant ID.",type:"string"},prompt:{description:"The prompt that is displayed to the participant. You can use markdown here to render images, links, etc.",type:"string"},required:{description:"Controls whether the response is required to be answered.",type:"boolean"},requiredLabel:{description:"You can provide a required label, which makes it so a participant has to answer with a response that matches label.",type:"string"},requiredValue:{description:"You can provide a required value, which makes it so a participant has to answer with that value."},rightLabel:{type:"string"},type:{const:"radio",type:"string"}},required:["id","location","options","prompt","required","type"],type:"object"},ReactComponent:{additionalProperties:!1,description:"The ReactComponent interface is used to define the properties of a react component. This component is used to render react code with certain parameters. These parameters can be used within your react code to render different things.",properties:{correctAnswer:{description:"The correct answer to the component. This is used for training trials where the user is shown the correct answer after a guess.",items:{$ref:"#/definitions/Answer"},type:"array"},description:{description:"The description of the component. This is used to identify and provide additional information for the component in the admin panel.",type:"string"},instruction:{description:"The instruction of the component. This is used to identify and provide additional information for the component in the admin panel.",type:"string"},instructionLocation:{$ref:"#/definitions/ResponseBlockLocation",description:"The location of the instructions."},meta:{additionalProperties:{},description:"The meta data for the component. This is used to identify and provide additional information for the component in the admin panel.",type:"object"},nextButtonLocation:{$ref:"#/definitions/ResponseBlockLocation",description:"The location of the next button."},nextButtonText:{description:"The text that is displayed on the next button.",type:"string"},parameters:{additionalProperties:{},description:"The parameters that are passed to the react component. These can be used within your react component to render different things.",type:"object"},path:{description:"The path to the react component. This should be a relative path from the src/public folder.",type:"string"},response:{description:"The responses to the component",items:{$ref:"#/definitions/Response"},type:"array"},type:{const:"react-component",type:"string"}},required:["path","response","type"],type:"object"},Response:{anyOf:[{$ref:"#/definitions/NumericalResponse"},{$ref:"#/definitions/ShortTextResponse"},{$ref:"#/definitions/LongTextResponse"},{$ref:"#/definitions/LikertResponse"},{$ref:"#/definitions/DropdownResponse"},{$ref:"#/definitions/SliderResponse"},{$ref:"#/definitions/RadioResponse"},{$ref:"#/definitions/CheckboxResponse"},{$ref:"#/definitions/IFrameResponse"}]},ResponseBlockLocation:{enum:["sidebar","aboveStimulus","belowStimulus"],type:"string"},ShortTextResponse:{additionalProperties:!1,description:"The ShortTextResponse interface is used to define the properties of a short text response. ShortTextResponses render as a text input that accepts any text and can optionally have a placeholder.",properties:{correctAnswer:{description:"The correct answer to the response. This is used in the data download and can be shown in the admin panel."},hidden:{description:"Controls whether the response is hidden.",type:"boolean"},id:{description:"The id of the response. This is used to identify the response in the data file.",type:"string"},location:{$ref:"#/definitions/ResponseBlockLocation",description:"Controls the response location. These might be the same for all responses, or differ across responses."},paramCapture:{description:"Use to capture querystring parameters in answers such as participant_name. See the examples for how this is used, but prefer uiConfig.urlParticipantIdParam if you are capturing a participant ID.",type:"string"},placeholder:{description:"The placeholder text that is displayed in the input.",type:"string"},prompt:{description:"The prompt that is displayed to the participant. You can use markdown here to render images, links, etc.",type:"string"},required:{description:"Controls whether the response is required to be answered.",type:"boolean"},requiredLabel:{description:"You can provide a required label, which makes it so a participant has to answer with a response that matches label.",type:"string"},requiredValue:{description:"You can provide a required value, which makes it so a participant has to answer with that value."},type:{const:"shortText",type:"string"}},required:["id","location","prompt","required","type"],type:"object"},SliderResponse:{additionalProperties:!1,description:"The SliderResponse interface is used to define the properties of a slider response. SliderResponses render as a slider input with user specified steps. For example, you could have steps of 0, 50, and 100.",properties:{correctAnswer:{description:"The correct answer to the response. This is used in the data download and can be shown in the admin panel."},hidden:{description:"Controls whether the response is hidden.",type:"boolean"},id:{description:"The id of the response. This is used to identify the response in the data file.",type:"string"},leftLabel:{description:"The left label of the likert scale. E.g Strongly Disagree",type:"string"},location:{$ref:"#/definitions/ResponseBlockLocation",description:"Controls the response location. These might be the same for all responses, or differ across responses."},options:{description:"This define the steps in the slider and the extent of the slider.",items:{$ref:"#/definitions/Option"},type:"array"},paramCapture:{description:"Use to capture querystring parameters in answers such as participant_name. See the examples for how this is used, but prefer uiConfig.urlParticipantIdParam if you are capturing a participant ID.",type:"string"},prompt:{description:"The prompt that is displayed to the participant. You can use markdown here to render images, links, etc.",type:"string"},required:{description:"Controls whether the response is required to be answered.",type:"boolean"},requiredLabel:{description:"You can provide a required label, which makes it so a participant has to answer with a response that matches label.",type:"string"},requiredValue:{description:"You can provide a required value, which makes it so a participant has to answer with that value."},rightLabel:{description:"The right label of the likert scale. E.g Strongly Agree",type:"string"},type:{const:"slider",type:"string"}},required:["id","location","options","prompt","required","type"],type:"object"},StudyConfig:{additionalProperties:!1,description:"The StudyConfig interface is used to define the properties of a study configuration. These are the hjson files that live in the public folder. In our repo, one example of this would be public/cleveland/config-cleveland.json.",properties:{$schema:{description:"A required json schema property. This should point to the github link for the version of the schema you would like. See examples for more information",type:"string"},baseComponents:{additionalProperties:{anyOf:[{$ref:"#/definitions/IndividualComponent"},{additionalProperties:!1,properties:{correctAnswer:{description:"The correct answer to the component. This is used for training trials where the user is shown the correct answer after a guess.",items:{$ref:"#/definitions/Answer"},type:"array"},description:{description:"The description of the component. This is used to identify and provide additional information for the component in the admin panel.",type:"string"},instruction:{description:"The instruction of the component. This is used to identify and provide additional information for the component in the admin panel.",type:"string"},instructionLocation:{$ref:"#/definitions/ResponseBlockLocation",description:"The location of the instructions."},meta:{additionalProperties:{},description:"The meta data for the component. This is used to identify and provide additional information for the component in the admin panel.",type:"object"},nextButtonLocation:{$ref:"#/definitions/ResponseBlockLocation",description:"The location of the next button."},nextButtonText:{description:"The text that is displayed on the next button.",type:"string"},parameters:{anyOf:[{additionalProperties:{},description:"The parameters that are passed to the react component. These can be used within your react component to render different things.",type:"object"},{additionalProperties:{},description:"The parameters that are passed to the website (iframe). These can be used within your website to render different things.",type:"object"}],description:"The parameters that are passed to the react component. These can be used within your react component to render different things."},path:{description:"The path to the markdown file. This should be a relative path from the public folder.",type:"string"},response:{description:"The responses to the component",items:{$ref:"#/definitions/Response"},type:"array"},style:{additionalProperties:{type:"string"},description:"The style of the image. This is an object with css properties as keys and css values as values.",type:"object"},type:{enum:["markdown","react-component","image","website","questionnaire"],type:"string"}},type:"object"}]},description:"The components that are used in the study (baseComponents allow PartialComponents which allows for inheriting from them in components).",type:"object"},components:{additionalProperties:{anyOf:[{$ref:"#/definitions/IndividualComponent"},{$ref:"#/definitions/InheritedComponent"}]},description:"The components that are used in the study. They must be fully defined here with all properties. Some properties may be inherited from baseComponents.",type:"object"},sequence:{$ref:"#/definitions/OrderObject",description:"The order of the components in the study. This might include some randomness."},studyMetadata:{$ref:"#/definitions/StudyMetadata",description:"The metadata for the study. This is used to identify the study and version in the data file."},uiConfig:{$ref:"#/definitions/UIConfig",description:"The UI configuration for the study. This is used to configure the UI of the app."}},required:["$schema","studyMetadata","uiConfig","components","sequence"],type:"object"},StudyMetadata:{additionalProperties:!1,description:"The StudyMetadata is used to describe certain properties of a study. Some of this data is displayed on the landing page when running the app, such as the title and description. This data is also included in the data file that is downloaded at the end of the study, to help identify the study and version.",properties:{authors:{description:"The authors of your study.",items:{type:"string"},type:"array"},date:{description:"The date of your study, may be useful for the researcher.",type:"string"},description:{description:"The description of your study, shown on the landing page.",type:"string"},organizations:{description:"The organizations that are associated with your study.",items:{type:"string"},type:"array"},title:{description:"The title of your study, shown on the landing page.",type:"string"},version:{description:"The version of your study, shown on the landing page and attached to participant data. This might be useful for seeing which version of the study a participant saw.",type:"string"}},required:["title","version","authors","date","description","organizations"],type:"object"},UIConfig:{additionalProperties:!1,description:"The UIConfig is used to configure the UI of the app. This includes the logo, contact email, and whether to show a progress bar. The UIConfig is also used to configure the sidebar, which can be used to display the task instructions and capture responses.",properties:{autoDownloadStudy:{description:"Controls whether the study data is automatically downloaded at the end of the study.",type:"boolean"},autoDownloadTime:{description:"The time in milliseconds to wait before automatically downloading the study data.",type:"number"},contactEmail:{description:"The email address that used during the study if a participant clicks contact.",type:"string"},helpTextPath:{description:"The path to the help text file. This is displayed when a participant clicks help. Markdown is supported.",type:"string"},logoPath:{description:"The path to the logo image. This is displayed on the landing page and the header.",type:"string"},sidebar:{description:"Controls whether the left sidebar is rendered at all. Required to be true if your response's location is set to sidebar for any question.",type:"boolean"},studyEndMsg:{description:"The message to display when the study ends.",type:"string"},urlParticipantIdParam:{description:"If the participant ID is passed in the URL, this is the name of the querystring parameter that is used to capture the participant ID (e.g. PROLIFIC_ID). This will allow a user to continue a study on different devices and browsers.",type:"string"},windowEventDebounceTime:{description:"Debounce time in milliseconds for automatically tracked window events. Defaults to 100. E.g 100 here means 1000ms / 100ms = 10 times a second, 200 here means 1000ms / 200ms = 5 times per second",type:"number"},withProgressBar:{description:"Controls whether the progress bar is rendered in the study.",type:"boolean"}},required:["contactEmail","logoPath","withProgressBar","sidebar"],type:"object"},WebsiteComponent:{additionalProperties:!1,description:"The WebsiteComponent interface is used to define the properties of a website component. A WebsiteComponent is used to render an iframe with a website inside of it. This can be used to display an external website or an html file that is located in the public folder.",properties:{correctAnswer:{description:"The correct answer to the component. This is used for training trials where the user is shown the correct answer after a guess.",items:{$ref:"#/definitions/Answer"},type:"array"},description:{description:"The description of the component. This is used to identify and provide additional information for the component in the admin panel.",type:"string"},instruction:{description:"The instruction of the component. This is used to identify and provide additional information for the component in the admin panel.",type:"string"},instructionLocation:{$ref:"#/definitions/ResponseBlockLocation",description:"The location of the instructions."},meta:{additionalProperties:{},description:"The meta data for the component. This is used to identify and provide additional information for the component in the admin panel.",type:"object"},nextButtonLocation:{$ref:"#/definitions/ResponseBlockLocation",description:"The location of the next button."},nextButtonText:{description:"The text that is displayed on the next button.",type:"string"},parameters:{additionalProperties:{},description:"The parameters that are passed to the website (iframe). These can be used within your website to render different things.",type:"object"},path:{description:"The path to the website. This should be a relative path from the public folder or could be an external website.",type:"string"},response:{description:"The responses to the component",items:{$ref:"#/definitions/Response"},type:"array"},type:{const:"website",type:"string"}},required:["path","response","type"],type:"object"}},WRe={$ref:VRe,$schema:zRe,definitions:HRe},qRe="#/definitions/GlobalConfig",YRe="http://json-schema.org/draft-07/schema#",GRe={GlobalConfig:{additionalProperties:!1,description:"The GlobalConfig is used to generate the list of available studies in the UI. This list is displayed on the landing page when running the app.",properties:{$schema:{description:"A required json schema property. This should point to the github link for the version of the schema you would like. See examples for more information",type:"string"},configs:{additionalProperties:{additionalProperties:!1,description:"The key is used to identify the study config file. This key is used in the configList property.",properties:{path:{description:"The path to the study config file. This should be a relative path from the public folder.",type:"string"}},required:["path"],type:"object"},description:"A required property that specifies the options for the configList property.",type:"object"},configsList:{description:"A required property that is used to generate the list of available studies in the UI. This list is displayed on the landing page when running the app.",items:{type:"string"},type:"array"}},required:["$schema","configs","configsList"],type:"object"}},KRe={$ref:qRe,$schema:YRe,definitions:GRe},JX=new XX;JX.addSchema(KRe);const C9=JX.getSchema("#/definitions/GlobalConfig"),ZX=new XX;ZX.addSchema(WRe);const A9=ZX.getSchema("#/definitions/StudyConfig");function QRe(e){const t=[];return[e.configsList.every(r=>e.configs[r]===void 0?(t.push({message:`Config ${r} is not defined in configs object, but is present in configsList`}),!1):!0),t]}function gI(e){return e.baseComponent!==void 0}function XRe(e){const t=Fk.parse(e),n=C9(t),r=QRe(t);if(n&&r[0])return t;throw console.error("Global config parsing errors",[...C9.errors||[],...r[1]]),Error("There was an issue validating your file global.json")}function JRe(e){const t=[];return[Object.values(e.components).every(r=>{var i;return gI(r)?!!((i=e.baseComponents)!=null&&i[r.baseComponent]):!0}),t]}function eJ(e,t){const n=Fk.parse(e),r=A9(n),i=JRe(n);if(r&&i[0])return n;throw console.error(`${t} parsing errors`,[...A9.errors||[],...i[1]]),Error(`There was an issue validating your file ${t}`)}function _a(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r3?t.i-4:t.i:Array.isArray(e)?1:SD(e)?2:ID(e)?3:0}function vp(e,t){return jm(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function ZRe(e,t){return jm(e)===2?e.get(t):e[t]}function tJ(e,t,n){var r=jm(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function nJ(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function SD(e){return sNe&&e instanceof Map}function ID(e){return oNe&&e instanceof Set}function Lf(e){return e.o||e.t}function xD(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=iJ(e);delete t[or];for(var n=bp(t),r=0;r1&&(e.set=e.add=e.clear=e.delete=eNe),Object.freeze(e),t&&Ld(e,function(n,r){return CD(r,!0)},!0)),e}function eNe(){_a(2)}function AD(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function _u(e){var t=i2[e];return t||_a(18,e),t}function tNe(e,t){i2[e]||(i2[e]=t)}function t2(){return Iy}function nA(e,t){t&&(_u("Patches"),e.u=[],e.s=[],e.v=t)}function Ww(e){n2(e),e.p.forEach(nNe),e.p=null}function n2(e){e===Iy&&(Iy=e.l)}function O9(e){return Iy={p:[],l:Iy,h:e,m:!0,_:0}}function nNe(e){var t=e[or];t.i===0||t.i===1?t.j():t.O=!0}function rA(e,t){t._=t.p.length;var n=t.p[0],r=e!==void 0&&e!==n;return t.h.g||_u("ES5").S(t,e,r),r?(n[or].P&&(Ww(t),_a(4)),xl(e)&&(e=qw(t,e),t.l||Yw(t,e)),t.u&&_u("Patches").M(n[or].t,e,t.u,t.s)):e=qw(t,n,[]),Ww(t),t.u&&t.v(t.u,t.s),e!==rJ?e:void 0}function qw(e,t,n){if(AD(t))return t;var r=t[or];if(!r)return Ld(t,function(a,u){return P9(e,r,t,a,u,n)},!0),t;if(r.A!==e)return t;if(!r.P)return Yw(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var i=r.i===4||r.i===5?r.o=xD(r.k):r.o,s=i,o=!1;r.i===3&&(s=new Set(i),i.clear(),o=!0),Ld(s,function(a,u){return P9(e,r,i,a,u,n,o)}),Yw(e,i,!1),n&&e.u&&_u("Patches").N(r,n,e.u,e.s)}return r.o}function P9(e,t,n,r,i,s,o){if(ef(i)){var a=qw(e,i,s&&t&&t.i!==3&&!vp(t.R,r)?s.concat(r):void 0);if(tJ(n,r,a),!ef(a))return;e.m=!1}else o&&n.add(i);if(xl(i)&&!AD(i)){if(!e.h.D&&e._<1)return;qw(e,i),t&&t.A.l||Yw(e,i)}}function Yw(e,t,n){n===void 0&&(n=!1),!e.l&&e.h.D&&e.m&&CD(t,n)}function iA(e,t){var n=e[or];return(n?Lf(n):e)[t]}function R9(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function gc(e){e.P||(e.P=!0,e.l&&gc(e.l))}function sA(e){e.o||(e.o=xD(e.t))}function r2(e,t,n){var r=SD(t)?_u("MapSet").F(t,n):ID(t)?_u("MapSet").T(t,n):e.g?function(i,s){var o=Array.isArray(i),a={i:o?1:0,A:s?s.A:t2(),P:!1,I:!1,R:{},l:s,t:i,k:null,o:null,j:null,C:!1},u=a,l=xy;o&&(u=[a],l=s0);var c=Proxy.revocable(u,l),f=c.revoke,d=c.proxy;return a.k=d,a.j=f,d}(t,n):_u("ES5").J(t,n);return(n?n.A:t2()).p.push(r),r}function rNe(e){return ef(e)||_a(22,e),function t(n){if(!xl(n))return n;var r,i=n[or],s=jm(n);if(i){if(!i.P&&(i.i<4||!_u("ES5").K(i)))return i.t;i.I=!0,r=N9(n,s),i.I=!1}else r=N9(n,s);return Ld(r,function(o,a){i&&ZRe(i.t,o)===a||tJ(r,o,t(a))}),s===3?new Set(r):r}(e)}function N9(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return xD(e)}function iNe(){function e(s,o){var a=i[s];return a?a.enumerable=o:i[s]=a={configurable:!0,enumerable:o,get:function(){var u=this[or];return xy.get(u,s)},set:function(u){var l=this[or];xy.set(l,s,u)}},a}function t(s){for(var o=s.length-1;o>=0;o--){var a=s[o][or];if(!a.P)switch(a.i){case 5:r(a)&&gc(a);break;case 4:n(a)&&gc(a)}}}function n(s){for(var o=s.t,a=s.k,u=bp(a),l=u.length-1;l>=0;l--){var c=u[l];if(c!==or){var f=o[c];if(f===void 0&&!vp(o,c))return!0;var d=a[c],h=d&&d[or];if(h?h.t!==f:!nJ(d,f))return!0}}var p=!!o[or];return u.length!==bp(o).length+(p?0:1)}function r(s){var o=s.k;if(o.length!==s.t.length)return!0;var a=Object.getOwnPropertyDescriptor(o,o.length-1);if(a&&!a.get)return!0;for(var u=0;u1?g-1:0),b=1;b1?c-1:0),d=1;d=0;i--){var s=r[i];if(s.path.length===0&&s.op==="replace"){n=s.value;break}}i>-1&&(r=r.slice(i+1));var o=_u("Patches").$;return ef(n)?o(n,r):this.produce(n,function(a){return o(a,r)})},e}(),mo=new uNe,sJ=mo.produce;mo.produceWithPatches.bind(mo);mo.setAutoFreeze.bind(mo);mo.setUseProxies.bind(mo);mo.applyPatches.bind(mo);mo.createDraft.bind(mo);mo.finishDraft.bind(mo);function Cy(e){"@babel/helpers - typeof";return Cy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cy(e)}function lNe(e,t){if(Cy(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Cy(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function cNe(e){var t=lNe(e,"string");return Cy(t)=="symbol"?t:String(t)}function fNe(e,t,n){return t=cNe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function L9(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function M9(e){for(var t=1;t"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(zi(1));return n(oJ)(e,t)}if(typeof e!="function")throw new Error(zi(2));var i=e,s=t,o=[],a=o,u=!1;function l(){a===o&&(a=o.slice())}function c(){if(u)throw new Error(zi(3));return s}function f(m){if(typeof m!="function")throw new Error(zi(4));if(u)throw new Error(zi(5));var y=!0;return l(),a.push(m),function(){if(y){if(u)throw new Error(zi(6));y=!1,l();var _=a.indexOf(m);a.splice(_,1),o=null}}}function d(m){if(!dNe(m))throw new Error(zi(7));if(typeof m.type>"u")throw new Error(zi(8));if(u)throw new Error(zi(9));try{u=!0,s=i(s,m)}finally{u=!1}for(var y=o=a,g=0;g"u")throw new Error(zi(12));if(typeof n(void 0,{type:Gw.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(zi(13))})}function pNe(e){for(var t=Object.keys(e),n={},r=0;r"u")throw l&&l.type,new Error(zi(14));f[h]=y,c=c||y!==m}return c=c||s.length!==Object.keys(u).length,c?f:u}}function Kw(){for(var e=arguments.length,t=new Array(e),n=0;n0&&s[s.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]0)for(var b=h.getState(),T=Array.from(n.values()),I=0,E=T;I({[c]:{}}))},s=Object.assign({},...n.map(c=>({[c]:{aboveStimulus:{valid:!1,values:{}},belowStimulus:{valid:!1,values:{}},sidebar:{valid:!1,values:{}}}}))),o=Object.assign({},...n.map(c=>({[c]:{aboveStimulus:!0,belowStimulus:!0,sidebar:!0,values:{}}}))),a={studyId:e,answers:r||i,sequence:n,config:t,showAdmin:!1,showHelpText:!1,alertModal:{show:!1,message:""},trialValidation:r?o:s,iframeAnswers:[]},u=fJ({name:"storeSlice",initialState:a,reducers:{setConfig(c,f){c.config=f.payload},toggleShowAdmin:c=>{c.showAdmin=!c.showAdmin},toggleShowHelpText:c=>{c.showHelpText=!c.showHelpText},setAlertModal:(c,f)=>{c.alertModal=f.payload},setIframeAnswers:(c,f)=>{c.iframeAnswers=f.payload},updateResponseBlockValidation:(c,{payload:f})=>{!f.currentStep||f.currentStep.length===0||(c.trialValidation[f.currentStep]||(c.trialValidation[f.currentStep]={aboveStimulus:{valid:!1,values:{}},belowStimulus:{valid:!1,values:{}},sidebar:{valid:!1,values:{}},provenanceGraph:void 0}),c.trialValidation[f.currentStep][f.location]={valid:f.status,values:f.values},f.provenanceGraph&&(c.trialValidation[f.currentStep].provenanceGraph=f.provenanceGraph))},saveTrialAnswer(c,{payload:f}){const{currentStep:d,answer:h,startTime:p,endTime:m,provenanceGraph:y,windowEvents:g}=f;c.answers[d]={answer:h,startTime:p,endTime:m,provenanceGraph:y,windowEvents:g}}}});return{store:lJ({reducer:u.reducer,preloadedState:a}),actions:u.actions}}const EJ=w.createContext(null);function Hl(){return w.useContext(EJ).actions}const Wl=hX,Uu=bAe;function tke(e){return Uu(t=>{if(e===void 0||e.length===0)return!0;const n=Object.values(t.trialValidation[e]).every(r=>typeof r=="object"&&"valid"in r?r.valid:!0);return n?Object.values(n).every(r=>r):!1})}var Xw={exports:{}};Xw.exports;(function(e,t){var n=200,r="__lodash_hash_undefined__",i=800,s=16,o=9007199254740991,a="[object Arguments]",u="[object Array]",l="[object AsyncFunction]",c="[object Boolean]",f="[object Date]",d="[object Error]",h="[object Function]",p="[object GeneratorFunction]",m="[object Map]",y="[object Number]",g="[object Null]",_="[object Object]",b="[object Proxy]",T="[object RegExp]",I="[object Set]",E="[object String]",S="[object Undefined]",A="[object WeakMap]",P="[object ArrayBuffer]",V="[object DataView]",M="[object Float32Array]",H="[object Float64Array]",J="[object Int8Array]",Y="[object Int16Array]",ye="[object Int32Array]",he="[object Uint8Array]",ve="[object Uint8ClampedArray]",te="[object Uint16Array]",se="[object Uint32Array]",K=/[\\^$.*+?()[\]{}|]/g,x=/^\[object .+?Constructor\]$/,C=/^(?:0|[1-9]\d*)$/,z={};z[M]=z[H]=z[J]=z[Y]=z[ye]=z[he]=z[ve]=z[te]=z[se]=!0,z[a]=z[u]=z[P]=z[c]=z[V]=z[f]=z[d]=z[h]=z[m]=z[y]=z[_]=z[T]=z[I]=z[E]=z[A]=!1;var R=typeof io=="object"&&io&&io.Object===Object&&io,O=typeof self=="object"&&self&&self.Object===Object&&self,q=R||O||Function("return this")(),le=t&&!t.nodeType&&t,ae=le&&!0&&e&&!e.nodeType&&e,pe=ae&&ae.exports===le,me=pe&&R.process,Se=function(){try{var U=ae&&ae.require&&ae.require("util").types;return U||me&&me.binding&&me.binding("util")}catch{}}(),ce=Se&&Se.isTypedArray;function st(U,re,ge){switch(ge.length){case 0:return U.call(re);case 1:return U.call(re,ge[0]);case 2:return U.call(re,ge[0],ge[1]);case 3:return U.call(re,ge[0],ge[1],ge[2])}return U.apply(re,ge)}function Ke(U,re){for(var ge=-1,We=Array(U);++ge-1}function j(U,re){var ge=this.__data__,We=tr(ge,U);return We<0?(++this.size,ge.push([U,re])):ge[We][1]=re,this}br.prototype.clear=Lr,br.prototype.delete=yi,br.prototype.get=ms,br.prototype.has=Q,br.prototype.set=j;function Z(U){var re=-1,ge=U==null?0:U.length;for(this.clear();++re1?ge[un-1]:void 0,rr=un>2?ge[2]:void 0;for(Un=U.length>3&&typeof Un=="function"?(un--,Un):void 0,rr&&gn(ge[0],ge[1],rr)&&(Un=un<3?void 0:Un,un=1),re=Object(re);++We-1&&U%1==0&&U0){if(++re>=i)return arguments[0]}else re=0;return U.apply(void 0,arguments)}}function Hx(U){if(U!=null){try{return bt.call(U)}catch{}try{return U+""}catch{}}return""}function ph(U,re){return U===re||U!==U&&re!==re}var mh=_i(function(){return arguments}())?_i:function(U){return mg(U)&&je.call(U,"callee")&&!Me.call(U,"callee")},Wx=Array.isArray;function qx(U){return U!=null&&cL(U.length)&&!Yx(U)}function Sue(U){return mg(U)&&qx(U)}var lL=It||Oue;function Yx(U){if(!Rf(U))return!1;var re=is(U);return re==h||re==p||re==l||re==b}function cL(U){return typeof U=="number"&&U>-1&&U%1==0&&U<=o}function Rf(U){var re=typeof U;return U!=null&&(re=="object"||re=="function")}function mg(U){return U!=null&&typeof U=="object"}function Iue(U){if(!mg(U)||is(U)!=_)return!1;var re=De(U);if(re===null)return!0;var ge=je.call(re,"constructor")&&re.constructor;return typeof ge=="function"&&ge instanceof ge&&bt.call(ge)==an}var fL=ce?qe(ce):Ye;function xue(U){return ee(U,dL(U))}function dL(U){return qx(U)?xn(U,!0):zt(U)}var Cue=be(function(U,re,ge){Hn(U,re,ge)});function Aue(U){return function(){return U}}function hL(U){return U}function Oue(){return!1}e.exports=Cue})(Xw,Xw.exports);var nke=Xw.exports;const ND=ka(nke);function wJ(){return km().pathname.split("/")[1]}function Da(){return km().pathname.split("/")[2]}function kD(e){return structuredClone(e)}function DD(){const{answers:e}=Uu(n=>n),t=Da();return e[t]}const TJ=w.createContext(null);function rke(){const e=w.useContext(TJ);if(!e)throw new Error("useWindowEvents must be used within a WindowEventsProvider");return e}function ike(){const e=Da(),{sequence:t,trialValidation:n}=Uu(g=>g),r=DD(),i=Wl(),{saveTrialAnswer:s,setIframeAnswers:o}=Hl(),{storageEngine:a}=vf(),l=!tke(e),c=r==null?void 0:r.answer,f=Qd(),d=w.useMemo(()=>{const g=t.indexOf(e);return t[g+1]||"end"},[e,t]),h=`/${wJ()}/${d}`,p=w.useMemo(()=>Date.now(),[]),m=rke(),y=w.useCallback(()=>{const g=kD(n[e]),_=Object.values(g).reduce((E,S)=>Object.hasOwn(S,"values")?{...E,...S.values}:E,{}),{provenanceGraph:b}=g,T=Date.now(),I=m&&"current"in m&&m.current?m.current.splice(0,m.current.length):[];Object.keys(c||{}).length===0&&(i(s({currentStep:e,answer:_,startTime:p,endTime:T,provenanceGraph:b,windowEvents:I})),a&&a.saveAnswer(e,{answer:_,startTime:p,endTime:T,provenanceGraph:b,windowEvents:I}),i(o([]))),f(`${h}${window.location.search}`)},[o,a,i,c,n,f,p,e,s,h,m]);return{nextStep:d,isNextDisabled:l,goToNextStep:y}}function ske({label:e="Next",disabled:t=!1,setCheckClicked:n=()=>{},onClick:r}){const{isNextDisabled:i,goToNextStep:s}=ike(),o=w.useCallback(()=>{n(!1),r&&r(),s()},[s,r,n]);return $.jsx(yu,{type:"submit",disabled:t||i,onClick:o,children:e})}function u2(e){return e===null||typeof e!="object"?{}:Object.keys(e).reduce((t,n)=>{const r=e[n];return r!=null&&r!==!1&&(t[n]=r),t},{})}var oke=Object.defineProperty,Y9=Object.getOwnPropertySymbols,ake=Object.prototype.hasOwnProperty,uke=Object.prototype.propertyIsEnumerable,G9=(e,t,n)=>t in e?oke(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,lke=(e,t)=>{for(var n in t||(t={}))ake.call(t,n)&&G9(e,n,t[n]);if(Y9)for(var n of Y9(t))uke.call(t,n)&&G9(e,n,t[n]);return e};function SJ(e,t){if(t===null||typeof t!="object")return{};const n=lke({},t);return Object.keys(t).forEach(r=>{r.includes(`${String(e)}.`)&&delete n[r]}),n}const cke="__MANTINE_FORM_INDEX__";function K9(e,t){return t?typeof t=="boolean"?t:Array.isArray(t)?t.includes(e.replace(/[.][0-9]/g,`.${cke}`)):!1:!1}function Q9(e,t,n){typeof n.value=="object"&&(n.value=Xh(n.value)),!n.enumerable||n.get||n.set||!n.configurable||!n.writable||t==="__proto__"?Object.defineProperty(e,t,n):e[t]=n.value}function Xh(e){if(typeof e!="object")return e;var t=0,n,r,i,s=Object.prototype.toString.call(e);if(s==="[object Object]"?i=Object.create(e.__proto__||null):s==="[object Array]"?i=Array(e.length):s==="[object Set]"?(i=new Set,e.forEach(function(o){i.add(Xh(o))})):s==="[object Map]"?(i=new Map,e.forEach(function(o,a){i.set(Xh(a),Xh(o))})):s==="[object Date]"?i=new Date(+e):s==="[object RegExp]"?i=new RegExp(e.source,e.flags):s==="[object DataView]"?i=new e.constructor(Xh(e.buffer)):s==="[object ArrayBuffer]"?i=e.slice(0):s.slice(-6)==="Array]"&&(i=new e.constructor(e)),i){for(r=Object.getOwnPropertySymbols(e);t0,errors:t}}function l2(e,t,n="",r={}){return typeof e!="object"||e===null?r:Object.keys(e).reduce((i,s)=>{const o=e[s],a=`${n===""?"":`${n}.`}${s}`,u=Xu(a,t);let l=!1;return typeof o=="function"&&(i[a]=o(u,t,a)),typeof o=="object"&&Array.isArray(u)&&(l=!0,u.forEach((c,f)=>l2(o,t,`${a}.${f}`,i))),typeof o=="object"&&typeof u=="object"&&u!==null&&(l||l2(o,t,a,i)),i},r)}function c2(e,t){return X9(typeof e=="function"?e(t):l2(e,t))}function o1(e,t,n){if(typeof e!="string")return{hasError:!1,error:null};const r=c2(t,n),i=Object.keys(r.errors).find(s=>e.split(".").every((o,a)=>o===s.split(".")[a]));return{hasError:!!i,error:i?r.errors[i]:null}}function fke(e,{from:t,to:n},r){const i=Xu(e,r);if(!Array.isArray(i))return r;const s=[...i],o=i[t];return s.splice(t,1),s.splice(n,0,o),_I(e,s,r)}var dke=Object.defineProperty,J9=Object.getOwnPropertySymbols,hke=Object.prototype.hasOwnProperty,pke=Object.prototype.propertyIsEnumerable,Z9=(e,t,n)=>t in e?dke(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,mke=(e,t)=>{for(var n in t||(t={}))hke.call(t,n)&&Z9(e,n,t[n]);if(J9)for(var n of J9(t))pke.call(t,n)&&Z9(e,n,t[n]);return e};function gke(e,{from:t,to:n},r){const i=`${e}.${t}`,s=`${e}.${n}`,o=mke({},r);return Object.keys(r).every(a=>{let u,l;if(a.startsWith(i)&&(u=a,l=a.replace(i,s)),a.startsWith(s)&&(u=a.replace(s,i),l=a),u&&l){const c=o[u],f=o[l];return f===void 0?delete o[u]:o[u]=f,c===void 0?delete o[l]:o[l]=c,!1}return!0}),o}function yke(e,t,n){const r=Xu(e,n);return Array.isArray(r)?_I(e,r.filter((i,s)=>s!==t),n):n}var _ke=Object.defineProperty,eB=Object.getOwnPropertySymbols,vke=Object.prototype.hasOwnProperty,bke=Object.prototype.propertyIsEnumerable,tB=(e,t,n)=>t in e?_ke(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Eke=(e,t)=>{for(var n in t||(t={}))vke.call(t,n)&&tB(e,n,t[n]);if(eB)for(var n of eB(t))bke.call(t,n)&&tB(e,n,t[n]);return e};function nB(e,t){const n=e.substring(t.length+1).split(".")[0];return parseInt(n,10)}function rB(e,t,n,r){if(t===void 0)return n;const i=`${String(e)}`;let s=n;r===-1&&(s=SJ(`${i}.${t}`,s));const o=Eke({},s),a=new Set;return Object.entries(s).filter(([u])=>{if(!u.startsWith(`${i}.`))return!1;const l=nB(u,i);return Number.isNaN(l)?!1:l>=t}).forEach(([u,l])=>{const c=nB(u,i),f=u.replace(`${i}.${c}`,`${i}.${c+r}`);o[f]=l,a.add(f),a.has(u)||delete o[u]}),o}function wke(e,t,n,r){const i=Xu(e,r);if(!Array.isArray(i))return r;const s=[...i];return s.splice(typeof n=="number"?n:s.length,0,t),_I(e,s,r)}function iB(e,t){const n=Object.keys(e);if(typeof t=="string"){const r=n.filter(i=>i.startsWith(`${t}.`));return e[t]||r.some(i=>e[i])||!1}return n.some(r=>e[r])}function Tke(e){return t=>{if(!t)e(t);else if(typeof t=="function")e(t);else if(typeof t=="object"&&"nativeEvent"in t){const{currentTarget:n}=t;n instanceof HTMLInputElement?n.type==="checkbox"?e(n.checked):e(n.value):(n instanceof HTMLTextAreaElement||n instanceof HTMLSelectElement)&&e(n.value)}else e(t)}}var Ske=Object.defineProperty,Ike=Object.defineProperties,xke=Object.getOwnPropertyDescriptors,sB=Object.getOwnPropertySymbols,Cke=Object.prototype.hasOwnProperty,Ake=Object.prototype.propertyIsEnumerable,oB=(e,t,n)=>t in e?Ske(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,tc=(e,t)=>{for(var n in t||(t={}))Cke.call(t,n)&&oB(e,n,t[n]);if(sB)for(var n of sB(t))Ake.call(t,n)&&oB(e,n,t[n]);return e},lA=(e,t)=>Ike(e,xke(t));function Oke({initialValues:e={},initialErrors:t={},initialDirty:n={},initialTouched:r={},clearInputErrorOnChange:i=!0,validateInputOnChange:s=!1,validateInputOnBlur:o=!1,transformValues:a=l=>l,validate:u}={}){const[l,c]=w.useState(r),[f,d]=w.useState(n),[h,p]=w.useState(e),[m,y]=w.useState(u2(t)),g=w.useRef(e),_=O=>{g.current=O},b=w.useCallback(()=>c({}),[]),T=O=>{const q=O?tc(tc({},h),O):h;_(q),d({})},I=w.useCallback(O=>y(q=>u2(typeof O=="function"?O(q):O)),[]),E=w.useCallback(()=>y({}),[]),S=w.useCallback(()=>{p(e),E(),_(e),d({}),b()},[]),A=w.useCallback((O,q)=>I(le=>lA(tc({},le),{[O]:q})),[]),P=w.useCallback(O=>I(q=>{if(typeof O!="string")return q;const le=tc({},q);return delete le[O],le}),[]),V=w.useCallback(O=>d(q=>{if(typeof O!="string")return q;const le=SJ(O,q);return delete le[O],le}),[]),M=w.useCallback((O,q)=>{const le=K9(O,s);V(O),c(ae=>lA(tc({},ae),{[O]:!0})),p(ae=>{const pe=_I(O,q,ae);if(le){const me=o1(O,u,pe);me.hasError?A(O,me.error):P(O)}return pe}),!le&&i&&A(O,null)},[]),H=w.useCallback(O=>{p(q=>{const le=typeof O=="function"?O(q):O;return tc(tc({},q),le)}),i&&E()},[]),J=w.useCallback((O,q)=>{V(O),p(le=>fke(O,q,le)),y(le=>gke(O,q,le))},[]),Y=w.useCallback((O,q)=>{V(O),p(le=>yke(O,q,le)),y(le=>rB(O,q,le,-1))},[]),ye=w.useCallback((O,q,le)=>{V(O),p(ae=>wke(O,q,le,ae)),y(ae=>rB(O,le,ae,1))},[]),he=w.useCallback(()=>{const O=c2(u,h);return y(O.errors),O},[h,u]),ve=w.useCallback(O=>{const q=o1(O,u,h);return q.hasError?A(O,q.error):P(O),q},[h,u]),te=(O,{type:q="input",withError:le=!0,withFocus:ae=!0}={})=>{const me={onChange:Tke(Se=>M(O,Se))};return le&&(me.error=m[O]),q==="checkbox"?me.checked=Xu(O,h):me.value=Xu(O,h),ae&&(me.onFocus=()=>c(Se=>lA(tc({},Se),{[O]:!0})),me.onBlur=()=>{if(K9(O,o)){const Se=o1(O,u,h);Se.hasError?A(O,Se.error):P(O)}}),me},se=(O,q)=>le=>{le==null||le.preventDefault();const ae=he();ae.hasErrors?q==null||q(ae.errors,h,le):O==null||O(a(h),le)},K=O=>a(O||h),x=w.useCallback(O=>{O.preventDefault(),S()},[]),C=O=>{if(O){const le=Xu(O,f);if(typeof le=="boolean")return le;const ae=Xu(O,h),pe=Xu(O,g.current);return!l9(ae,pe)}return Object.keys(f).length>0?iB(f):!l9(h,g.current)},z=w.useCallback(O=>iB(l,O),[l]),R=w.useCallback(O=>O?!o1(O,u,h).hasError:!c2(u,h).hasErrors,[h,u]);return{values:h,errors:m,setValues:H,setErrors:I,setFieldValue:M,setFieldError:A,clearFieldError:P,clearErrors:E,reset:S,validate:he,validateField:ve,reorderListItem:J,removeListItem:Y,insertListItem:ye,getInputProps:te,onSubmit:se,onReset:x,isDirty:C,isTouched:z,setTouched:c,setDirty:d,resetTouched:b,resetDirty:T,isValid:R,getTransformedValues:K}}const Pke=new URLSearchParams(window.location.search),Rke=(e,t)=>{let n={};return e.forEach(r=>{const i=t?t[r.id]:{};if(i)n={...n,[r.id]:i};else{const s=r.paramCapture?Pke.get(r.paramCapture):"";n={...n,[r.id]:r.type==="iframe"?[]:s}}}),{...n}},Nke=e=>{let t={};return e.forEach(n=>{n.required&&(t={...t,[n.id]:r=>{if(Array.isArray(r)){if(n.requiredValue!=null&&!Array.isArray(n.requiredValue))return"Incorrect required value";if(n.requiredValue!=null&&Array.isArray(n.requiredValue)){if(n.requiredValue.length!==r.length)return"Incorrect input";const i=[...n.requiredValue].sort(),s=[...r].sort();return i.every((o,a)=>o===s[a])?null:"Incorrect input"}return r.length===0?"Empty input":null}return n.required&&n.requiredValue!=null&&r!=null?r.toString()!==n.requiredValue.toString()?"Incorrect input":null:n.required?r==null||r===""?"Empty input":null:r===null?"Empty input":null}})}),t};function kke(e,t,n){const[r,i]=w.useState(null),s=Oke({initialValues:Rke(e,n),validate:Nke(e)});return w.useEffect(()=>{r!==t&&(i(t),s.reset())},[r,s,t]),s}function eh(e,t,n){var o;const{requiredValue:r,requiredLabel:i}=e;let s="";return t.checked&&Array.isArray(r)?s=r&&[...r].sort().toString()!==[...t.checked].sort().toString()?`Please ${n?"select":"enter"} ${i||r.toString()} to continue.`:null:s=t.value&&r&&r.toString()!==t.value.toString()?`Please ${n?"select":"enter"} ${i||(n?(o=n.find(a=>a.value===r))==null?void 0:o.label:r.toString())} to continue.`:null,s}const aB=["http","https","mailto","tel"];function Dke(e){const t=(e||"").trim(),n=t.charAt(0);if(n==="#"||n==="/")return t;const r=t.indexOf(":");if(r===-1)return t;let i=-1;for(;++ii||(i=t.indexOf("#"),i!==-1&&r>i)?t:"javascript:void(0)"}/*! * Determine if an object is a Buffer * * @author Feross Aboukhadijeh * @license MIT - */var $ke=function(t){return t!=null&&t.constructor!=null&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)};const $D=ka($ke);function Tp(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?uB(e.position):"start"in e||"end"in e?uB(e):"line"in e||"column"in e?f2(e):""}function f2(e){return lB(e&&e.line)+":"+lB(e&&e.column)}function uB(e){return f2(e&&e.start)+"-"+f2(e&&e.end)}function lB(e){return e&&typeof e=="number"?e:1}let Zo=class extends Error{constructor(t,n,r){const i=[null,null];let s={start:{line:null,column:null},end:{line:null,column:null}};if(super(),typeof n=="string"&&(r=n,n=void 0),typeof r=="string"){const o=r.indexOf(":");o===-1?i[1]=r:(i[0]=r.slice(0,o),i[1]=r.slice(o+1))}n&&("type"in n||"position"in n?n.position&&(s=n.position):"start"in n||"end"in n?s=n:("line"in n||"column"in n)&&(s.start=n)),this.name=Tp(n)||"1:1",this.message=typeof t=="object"?t.message:t,this.stack="",typeof t=="object"&&t.stack&&(this.stack=t.stack),this.reason=this.message,this.fatal,this.line=s.start.line,this.column=s.start.column,this.position=s,this.source=i[0],this.ruleId=i[1],this.file,this.actual,this.expected,this.url,this.note}};Zo.prototype.file="";Zo.prototype.name="";Zo.prototype.reason="";Zo.prototype.message="";Zo.prototype.stack="";Zo.prototype.fatal=null;Zo.prototype.column=null;Zo.prototype.line=null;Zo.prototype.source=null;Zo.prototype.ruleId=null;Zo.prototype.position=null;const za={basename:Lke,dirname:Mke,extname:Fke,join:Bke,sep:"/"};function Lke(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');M_(e);let n=0,r=-1,i=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.charCodeAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,a=t.length-1;for(;i--;)if(e.charCodeAt(i)===47){if(s){n=i+1;break}}else o<0&&(s=!0,o=i+1),a>-1&&(e.charCodeAt(i)===t.charCodeAt(a--)?a<0&&(r=i):(a=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function Mke(e){if(M_(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.charCodeAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.charCodeAt(0)===47?"/":".":t===1&&e.charCodeAt(0)===47?"//":e.slice(0,t)}function Fke(e){M_(e);let t=e.length,n=-1,r=0,i=-1,s=0,o;for(;t--;){const a=e.charCodeAt(t);if(a===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),a===46?i<0?i=t:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function Bke(...e){let t=-1,n;for(;++t0&&e.charCodeAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Uke(e,t){let n="",r=0,i=-1,s=0,o=-1,a,u;for(;++o<=e.length;){if(o2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),i=o,s=0;continue}}else if(n.length>0){n="",r=0,i=o,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,s=0}else a===46&&s>-1?s++:s=-1}return n}function M_(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Vke={cwd:zke};function zke(){return"/"}function d2(e){return e!==null&&typeof e=="object"&&e.href&&e.origin}function Hke(e){if(typeof e=="string")e=new URL(e);else if(!d2(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return Wke(e)}function Wke(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n"u"||ob.call(t,i)},gB=function(t,n){dB&&n.name==="__proto__"?dB(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},yB=function(t,n){if(n==="__proto__")if(ob.call(t,n)){if(hB)return hB(t,n).value}else return;return t[n]},Yke=function e(){var t,n,r,i,s,o,a=arguments[0],u=1,l=arguments.length,c=!1;for(typeof a=="boolean"&&(c=a,a=arguments[1]||{},u=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});uo.length;let u;a&&o.push(i);try{u=e.apply(this,o)}catch(l){const c=l;if(a&&n)throw c;return i(c)}a||(u instanceof Promise?u.then(s,i):u instanceof Error?i(u):s(u))}function i(o,...a){n||(n=!0,t(o,...a))}function s(o){i(null,o)}}class ea extends Error{constructor(t,n,r){const i=[null,null];let s={start:{line:null,column:null},end:{line:null,column:null}};if(super(),typeof n=="string"&&(r=n,n=void 0),typeof r=="string"){const o=r.indexOf(":");o===-1?i[1]=r:(i[0]=r.slice(0,o),i[1]=r.slice(o+1))}n&&("type"in n||"position"in n?n.position&&(s=n.position):"start"in n||"end"in n?s=n:("line"in n||"column"in n)&&(s.start=n)),this.name=Tp(n)||"1:1",this.message=typeof t=="object"?t.message:t,this.stack="",typeof t=="object"&&t.stack&&(this.stack=t.stack),this.reason=this.message,this.fatal,this.line=s.start.line,this.column=s.start.column,this.position=s,this.source=i[0],this.ruleId=i[1],this.file,this.actual,this.expected,this.url,this.note}}ea.prototype.file="";ea.prototype.name="";ea.prototype.reason="";ea.prototype.message="";ea.prototype.stack="";ea.prototype.fatal=null;ea.prototype.column=null;ea.prototype.line=null;ea.prototype.source=null;ea.prototype.ruleId=null;ea.prototype.position=null;const Ha={basename:Qke,dirname:Xke,extname:Jke,join:Zke,sep:"/"};function Qke(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');F_(e);let n=0,r=-1,i=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.charCodeAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,a=t.length-1;for(;i--;)if(e.charCodeAt(i)===47){if(s){n=i+1;break}}else o<0&&(s=!0,o=i+1),a>-1&&(e.charCodeAt(i)===t.charCodeAt(a--)?a<0&&(r=i):(a=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function Xke(e){if(F_(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.charCodeAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.charCodeAt(0)===47?"/":".":t===1&&e.charCodeAt(0)===47?"//":e.slice(0,t)}function Jke(e){F_(e);let t=e.length,n=-1,r=0,i=-1,s=0,o;for(;t--;){const a=e.charCodeAt(t);if(a===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),a===46?i<0?i=t:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function Zke(...e){let t=-1,n;for(;++t0&&e.charCodeAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function tDe(e,t){let n="",r=0,i=-1,s=0,o=-1,a,u;for(;++o<=e.length;){if(o2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),i=o,s=0;continue}}else if(n.length>0){n="",r=0,i=o,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,s=0}else a===46&&s>-1?s++:s=-1}return n}function F_(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const nDe={cwd:rDe};function rDe(){return"/"}function p2(e){return e!==null&&typeof e=="object"&&e.href&&e.origin}function iDe(e){if(typeof e=="string")e=new URL(e);else if(!p2(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return sDe(e)}function sDe(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n{if(E||!S||!A)I(E);else{const P=s.stringify(S,A);P==null||(cDe(P)?A.value=P:A.result=P),I(E,A)}});function I(E,S){E||!S?b(E):_?_(S):y(null,S)}}}function p(m){let y;s.freeze(),gA("processSync",s.Parser),yA("processSync",s.Compiler);const g=kg(m);return s.process(g,_),wB("processSync","process",y),g;function _(b){y=!0,fB(b)}}}function bB(e,t){return typeof e=="function"&&e.prototype&&(uDe(e.prototype)||t in e.prototype)}function uDe(e){let t;for(t in e)if(AJ.call(e,t))return!0;return!1}function gA(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `Parser`")}function yA(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `Compiler`")}function _A(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function EB(e){if(!h2(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function wB(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function kg(e){return lDe(e)?e:new oDe(e)}function lDe(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function cDe(e){return typeof e=="string"||$D(e)}function fDe(e,t){var{includeImageAlt:n=!0}=t||{};return PJ(e,n)}function PJ(e,t){return e&&typeof e=="object"&&(e.value||(t?e.alt:"")||"children"in e&&TB(e.children,t)||Array.isArray(e)&&TB(e,t))||""}function TB(e,t){for(var n=[],r=-1;++ri?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),[].splice.apply(e,o);else for(n&&[].splice.apply(e,[t,n]);s0?(Au(e,e.length,0,t),e):t}const SB={}.hasOwnProperty;function dDe(e){const t={};let n=-1;for(;++no))return;const S=t.events.length;let A=S,P,V;for(;A--;)if(t.events[A][0]==="exit"&&t.events[A][1].type==="chunkFlow"){if(P){V=t.events[A][1].end;break}P=!0}for(g(r),E=S;Eb;){const I=n[T];t.containerState=I[1],I[0].exit.call(t,e)}n.length=b}function _(){i.write([null]),s=void 0,i=void 0,t.containerState._closeFlow=void 0}}function SDe(e,t,n){return Vn(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function CB(e){if(e===null||Ho(e)||_De(e))return 1;if(vDe(e))return 2}function LD(e,t,n){const r=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f=Object.assign({},e[r][1].end),d=Object.assign({},e[n][1].start);AB(f,-u),AB(d,u),o={type:u>1?"strongSequence":"emphasisSequence",start:f,end:Object.assign({},e[r][1].end)},a={type:u>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[n][1].start),end:d},s={type:u>1?"strongText":"emphasisText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},i={type:u>1?"strong":"emphasis",start:Object.assign({},o.start),end:Object.assign({},a.end)},e[r][1].end=Object.assign({},o.start),e[n][1].start=Object.assign({},a.end),l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=Do(l,[["enter",e[r][1],t],["exit",e[r][1],t]])),l=Do(l,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",s,t]]),l=Do(l,LD(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=Do(l,[["exit",s,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(c=2,l=Do(l,[["enter",e[n][1],t],["exit",e[n][1],t]])):c=0,Au(e,r-1,n-r+3,l),n=r+l.length-c-2;break}}for(n=-1;++n=4?o(l):n(l)}function o(l){return l===null?u(l):wt(l)?e.attempt(LDe,o,u)(l):(e.enter("codeFlowValue"),a(l))}function a(l){return l===null||wt(l)?(e.exit("codeFlowValue"),o(l)):(e.consume(l),a)}function u(l){return e.exit("codeIndented"),t(l)}}function FDe(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):wt(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):Vn(e,s,"linePrefix",5)(o)}function s(o){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(o):wt(o)?i(o):n(o)}}const BDe={name:"codeText",tokenize:VDe,resolve:jDe,previous:UDe};function jDe(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function $J(e,t,n,r,i,s,o,a,u){const l=u||Number.POSITIVE_INFINITY;let c=0;return f;function f(g){return g===60?(e.enter(r),e.enter(i),e.enter(s),e.consume(g),e.exit(s),d):g===null||g===41||g2(g)?n(g):(e.enter(r),e.enter(o),e.enter(a),e.enter("chunkString",{contentType:"string"}),m(g))}function d(g){return g===62?(e.enter(s),e.consume(g),e.exit(s),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),h(g))}function h(g){return g===62?(e.exit("chunkString"),e.exit(a),d(g)):g===null||g===60||wt(g)?n(g):(e.consume(g),g===92?p:h)}function p(g){return g===60||g===62||g===92?(e.consume(g),h):h(g)}function m(g){return g===40?++c>l?n(g):(e.consume(g),m):g===41?c--?(e.consume(g),m):(e.exit("chunkString"),e.exit(a),e.exit(o),e.exit(r),t(g)):g===null||Ho(g)?c?n(g):(e.exit("chunkString"),e.exit(a),e.exit(o),e.exit(r),t(g)):g2(g)?n(g):(e.consume(g),g===92?y:m)}function y(g){return g===40||g===41||g===92?(e.consume(g),m):m(g)}}function LJ(e,t,n,r,i,s){const o=this;let a=0,u;return l;function l(h){return e.enter(r),e.enter(i),e.consume(h),e.exit(i),e.enter(s),c}function c(h){return h===null||h===91||h===93&&!u||h===94&&!a&&"_hiddenFootnoteSupport"in o.parser.constructs||a>999?n(h):h===93?(e.exit(s),e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):wt(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),f(h))}function f(h){return h===null||h===91||h===93||wt(h)||a++>999?(e.exit("chunkString"),c(h)):(e.consume(h),u=u||!Ur(h),h===92?d:f)}function d(h){return h===91||h===92||h===93?(e.consume(h),a++,f):f(h)}}function MJ(e,t,n,r,i,s){let o;return a;function a(d){return e.enter(r),e.enter(i),e.consume(d),e.exit(i),o=d===40?41:d,u}function u(d){return d===o?(e.enter(i),e.consume(d),e.exit(i),e.exit(r),t):(e.enter(s),l(d))}function l(d){return d===o?(e.exit(s),u(o)):d===null?n(d):wt(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),Vn(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(d))}function c(d){return d===o||d===null||wt(d)?(e.exit("chunkString"),l(d)):(e.consume(d),d===92?f:c)}function f(d){return d===o||d===92?(e.consume(d),c):c(d)}}function M0(e,t){let n;return r;function r(i){return wt(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Ur(i)?Vn(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}function Sp(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const KDe={name:"definition",tokenize:XDe},QDe={tokenize:JDe,partial:!0};function XDe(e,t,n){const r=this;let i;return s;function s(u){return e.enter("definition"),LJ.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(u)}function o(u){return i=Sp(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),u===58?(e.enter("definitionMarker"),e.consume(u),e.exit("definitionMarker"),M0(e,$J(e,e.attempt(QDe,Vn(e,a,"whitespace"),Vn(e,a,"whitespace")),n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString"))):n(u)}function a(u){return u===null||wt(u)?(e.exit("definition"),r.parser.defined.includes(i)||r.parser.defined.push(i),t(u)):n(u)}}function JDe(e,t,n){return r;function r(o){return Ho(o)?M0(e,i)(o):n(o)}function i(o){return o===34||o===39||o===40?MJ(e,Vn(e,s,"whitespace"),n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o):n(o)}function s(o){return o===null||wt(o)?t(o):n(o)}}const ZDe={name:"hardBreakEscape",tokenize:e$e};function e$e(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.enter("escapeMarker"),e.consume(s),i}function i(s){return wt(s)?(e.exit("escapeMarker"),e.exit("hardBreakEscape"),t(s)):n(s)}}const t$e={name:"headingAtx",tokenize:r$e,resolve:n$e};function n$e(e,t){let n=e.length-2,r=3,i,s;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},s={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Au(e,r,n-r+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])),e}function r$e(e,t,n){const r=this;let i=0;return s;function s(c){return e.enter("atxHeading"),e.enter("atxHeadingSequence"),o(c)}function o(c){return c===35&&i++<6?(e.consume(c),o):c===null||Ho(c)?(e.exit("atxHeadingSequence"),r.interrupt?t(c):a(c)):n(c)}function a(c){return c===35?(e.enter("atxHeadingSequence"),u(c)):c===null||wt(c)?(e.exit("atxHeading"),t(c)):Ur(c)?Vn(e,a,"whitespace")(c):(e.enter("atxHeadingText"),l(c))}function u(c){return c===35?(e.consume(c),u):(e.exit("atxHeadingSequence"),a(c))}function l(c){return c===null||c===35||Ho(c)?(e.exit("atxHeadingText"),a(c)):(e.consume(c),l)}}const i$e=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],RB=["pre","script","style","textarea"],s$e={name:"htmlFlow",tokenize:u$e,resolveTo:a$e,concrete:!0},o$e={tokenize:l$e,partial:!0};function a$e(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function u$e(e,t,n){const r=this;let i,s,o,a,u;return l;function l(C){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(C),c}function c(C){return C===33?(e.consume(C),f):C===47?(e.consume(C),p):C===63?(e.consume(C),i=3,r.interrupt?t:se):Za(C)?(e.consume(C),o=String.fromCharCode(C),s=!0,m):n(C)}function f(C){return C===45?(e.consume(C),i=2,d):C===91?(e.consume(C),i=5,o="CDATA[",a=0,h):Za(C)?(e.consume(C),i=4,r.interrupt?t:se):n(C)}function d(C){return C===45?(e.consume(C),r.interrupt?t:se):n(C)}function h(C){return C===o.charCodeAt(a++)?(e.consume(C),a===o.length?r.interrupt?t:M:h):n(C)}function p(C){return Za(C)?(e.consume(C),o=String.fromCharCode(C),m):n(C)}function m(C){return C===null||C===47||C===62||Ho(C)?C!==47&&s&&RB.includes(o.toLowerCase())?(i=1,r.interrupt?t(C):M(C)):i$e.includes(o.toLowerCase())?(i=6,C===47?(e.consume(C),y):r.interrupt?t(C):M(C)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(C):s?_(C):g(C)):C===45||ao(C)?(e.consume(C),o+=String.fromCharCode(C),m):n(C)}function y(C){return C===62?(e.consume(C),r.interrupt?t:M):n(C)}function g(C){return Ur(C)?(e.consume(C),g):P(C)}function _(C){return C===47?(e.consume(C),P):C===58||C===95||Za(C)?(e.consume(C),b):Ur(C)?(e.consume(C),_):P(C)}function b(C){return C===45||C===46||C===58||C===95||ao(C)?(e.consume(C),b):T(C)}function T(C){return C===61?(e.consume(C),I):Ur(C)?(e.consume(C),T):_(C)}function I(C){return C===null||C===60||C===61||C===62||C===96?n(C):C===34||C===39?(e.consume(C),u=C,E):Ur(C)?(e.consume(C),I):(u=null,S(C))}function E(C){return C===null||wt(C)?n(C):C===u?(e.consume(C),A):(e.consume(C),E)}function S(C){return C===null||C===34||C===39||C===60||C===61||C===62||C===96||Ho(C)?T(C):(e.consume(C),S)}function A(C){return C===47||C===62||Ur(C)?_(C):n(C)}function P(C){return C===62?(e.consume(C),V):n(C)}function V(C){return Ur(C)?(e.consume(C),V):C===null||wt(C)?M(C):n(C)}function M(C){return C===45&&i===2?(e.consume(C),ye):C===60&&i===1?(e.consume(C),he):C===62&&i===4?(e.consume(C),K):C===63&&i===3?(e.consume(C),se):C===93&&i===5?(e.consume(C),te):wt(C)&&(i===6||i===7)?e.check(o$e,K,H)(C):C===null||wt(C)?H(C):(e.consume(C),M)}function H(C){return e.exit("htmlFlowData"),J(C)}function J(C){return C===null?x(C):wt(C)?e.attempt({tokenize:Y,partial:!0},J,x)(C):(e.enter("htmlFlowData"),M(C))}function Y(C,z,R){return O;function O(le){return C.enter("lineEnding"),C.consume(le),C.exit("lineEnding"),q}function q(le){return r.parser.lazy[r.now().line]?R(le):z(le)}}function ye(C){return C===45?(e.consume(C),se):M(C)}function he(C){return C===47?(e.consume(C),o="",ve):M(C)}function ve(C){return C===62&&RB.includes(o.toLowerCase())?(e.consume(C),K):Za(C)&&o.length<8?(e.consume(C),o+=String.fromCharCode(C),ve):M(C)}function te(C){return C===93?(e.consume(C),se):M(C)}function se(C){return C===62?(e.consume(C),K):C===45&&i===2?(e.consume(C),se):M(C)}function K(C){return C===null||wt(C)?(e.exit("htmlFlowData"),x(C)):(e.consume(C),K)}function x(C){return e.exit("htmlFlow"),t(C)}}function l$e(e,t,n){return r;function r(i){return e.exit("htmlFlowData"),e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),e.attempt(vI,t,n)}}const c$e={name:"htmlText",tokenize:f$e};function f$e(e,t,n){const r=this;let i,s,o,a;return u;function u(x){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(x),l}function l(x){return x===33?(e.consume(x),c):x===47?(e.consume(x),S):x===63?(e.consume(x),I):Za(x)?(e.consume(x),V):n(x)}function c(x){return x===45?(e.consume(x),f):x===91?(e.consume(x),s="CDATA[",o=0,y):Za(x)?(e.consume(x),T):n(x)}function f(x){return x===45?(e.consume(x),d):n(x)}function d(x){return x===null||x===62?n(x):x===45?(e.consume(x),h):p(x)}function h(x){return x===null||x===62?n(x):p(x)}function p(x){return x===null?n(x):x===45?(e.consume(x),m):wt(x)?(a=p,te(x)):(e.consume(x),p)}function m(x){return x===45?(e.consume(x),K):p(x)}function y(x){return x===s.charCodeAt(o++)?(e.consume(x),o===s.length?g:y):n(x)}function g(x){return x===null?n(x):x===93?(e.consume(x),_):wt(x)?(a=g,te(x)):(e.consume(x),g)}function _(x){return x===93?(e.consume(x),b):g(x)}function b(x){return x===62?K(x):x===93?(e.consume(x),b):g(x)}function T(x){return x===null||x===62?K(x):wt(x)?(a=T,te(x)):(e.consume(x),T)}function I(x){return x===null?n(x):x===63?(e.consume(x),E):wt(x)?(a=I,te(x)):(e.consume(x),I)}function E(x){return x===62?K(x):I(x)}function S(x){return Za(x)?(e.consume(x),A):n(x)}function A(x){return x===45||ao(x)?(e.consume(x),A):P(x)}function P(x){return wt(x)?(a=P,te(x)):Ur(x)?(e.consume(x),P):K(x)}function V(x){return x===45||ao(x)?(e.consume(x),V):x===47||x===62||Ho(x)?M(x):n(x)}function M(x){return x===47?(e.consume(x),K):x===58||x===95||Za(x)?(e.consume(x),H):wt(x)?(a=M,te(x)):Ur(x)?(e.consume(x),M):K(x)}function H(x){return x===45||x===46||x===58||x===95||ao(x)?(e.consume(x),H):J(x)}function J(x){return x===61?(e.consume(x),Y):wt(x)?(a=J,te(x)):Ur(x)?(e.consume(x),J):M(x)}function Y(x){return x===null||x===60||x===61||x===62||x===96?n(x):x===34||x===39?(e.consume(x),i=x,ye):wt(x)?(a=Y,te(x)):Ur(x)?(e.consume(x),Y):(e.consume(x),i=void 0,ve)}function ye(x){return x===i?(e.consume(x),he):x===null?n(x):wt(x)?(a=ye,te(x)):(e.consume(x),ye)}function he(x){return x===62||x===47||Ho(x)?M(x):n(x)}function ve(x){return x===null||x===34||x===39||x===60||x===61||x===96?n(x):x===62||Ho(x)?M(x):(e.consume(x),ve)}function te(x){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),Vn(e,se,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function se(x){return e.enter("htmlTextData"),a(x)}function K(x){return x===62?(e.consume(x),e.exit("htmlTextData"),e.exit("htmlText"),t):n(x)}}const FD={name:"labelEnd",tokenize:y$e,resolveTo:g$e,resolveAll:m$e},d$e={tokenize:_$e},h$e={tokenize:v$e},p$e={tokenize:b$e};function m$e(e){let t=-1,n;for(;++t-1&&(o[0]=o[0].slice(r)),s>0&&o.push(e[i].slice(0,s))),o}function H$e(e,t){let n=-1;const r=[];let i;for(;++ne.length){for(;i--;)if(e.charCodeAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,a=t.length-1;for(;i--;)if(e.charCodeAt(i)===47){if(s){n=i+1;break}}else o<0&&(s=!0,o=i+1),a>-1&&(e.charCodeAt(i)===t.charCodeAt(a--)?a<0&&(r=i):(a=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function Mke(e){if(M_(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.charCodeAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.charCodeAt(0)===47?"/":".":t===1&&e.charCodeAt(0)===47?"//":e.slice(0,t)}function Fke(e){M_(e);let t=e.length,n=-1,r=0,i=-1,s=0,o;for(;t--;){const a=e.charCodeAt(t);if(a===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),a===46?i<0?i=t:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function Bke(...e){let t=-1,n;for(;++t0&&e.charCodeAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Uke(e,t){let n="",r=0,i=-1,s=0,o=-1,a,u;for(;++o<=e.length;){if(o2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),i=o,s=0;continue}}else if(n.length>0){n="",r=0,i=o,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,s=0}else a===46&&s>-1?s++:s=-1}return n}function M_(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Vke={cwd:zke};function zke(){return"/"}function d2(e){return e!==null&&typeof e=="object"&&e.href&&e.origin}function Hke(e){if(typeof e=="string")e=new URL(e);else if(!d2(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return Wke(e)}function Wke(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n"u"||ob.call(t,i)},gB=function(t,n){dB&&n.name==="__proto__"?dB(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},yB=function(t,n){if(n==="__proto__")if(ob.call(t,n)){if(hB)return hB(t,n).value}else return;return t[n]},Yke=function e(){var t,n,r,i,s,o,a=arguments[0],u=1,l=arguments.length,c=!1;for(typeof a=="boolean"&&(c=a,a=arguments[1]||{},u=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});uo.length;let u;a&&o.push(i);try{u=e.apply(this,o)}catch(l){const c=l;if(a&&n)throw c;return i(c)}a||(u instanceof Promise?u.then(s,i):u instanceof Error?i(u):s(u))}function i(o,...a){n||(n=!0,t(o,...a))}function s(o){i(null,o)}}class ea extends Error{constructor(t,n,r){const i=[null,null];let s={start:{line:null,column:null},end:{line:null,column:null}};if(super(),typeof n=="string"&&(r=n,n=void 0),typeof r=="string"){const o=r.indexOf(":");o===-1?i[1]=r:(i[0]=r.slice(0,o),i[1]=r.slice(o+1))}n&&("type"in n||"position"in n?n.position&&(s=n.position):"start"in n||"end"in n?s=n:("line"in n||"column"in n)&&(s.start=n)),this.name=Tp(n)||"1:1",this.message=typeof t=="object"?t.message:t,this.stack="",typeof t=="object"&&t.stack&&(this.stack=t.stack),this.reason=this.message,this.fatal,this.line=s.start.line,this.column=s.start.column,this.position=s,this.source=i[0],this.ruleId=i[1],this.file,this.actual,this.expected,this.url,this.note}}ea.prototype.file="";ea.prototype.name="";ea.prototype.reason="";ea.prototype.message="";ea.prototype.stack="";ea.prototype.fatal=null;ea.prototype.column=null;ea.prototype.line=null;ea.prototype.source=null;ea.prototype.ruleId=null;ea.prototype.position=null;const Ha={basename:Qke,dirname:Xke,extname:Jke,join:Zke,sep:"/"};function Qke(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');F_(e);let n=0,r=-1,i=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.charCodeAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,a=t.length-1;for(;i--;)if(e.charCodeAt(i)===47){if(s){n=i+1;break}}else o<0&&(s=!0,o=i+1),a>-1&&(e.charCodeAt(i)===t.charCodeAt(a--)?a<0&&(r=i):(a=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function Xke(e){if(F_(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.charCodeAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.charCodeAt(0)===47?"/":".":t===1&&e.charCodeAt(0)===47?"//":e.slice(0,t)}function Jke(e){F_(e);let t=e.length,n=-1,r=0,i=-1,s=0,o;for(;t--;){const a=e.charCodeAt(t);if(a===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),a===46?i<0?i=t:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function Zke(...e){let t=-1,n;for(;++t0&&e.charCodeAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function tDe(e,t){let n="",r=0,i=-1,s=0,o=-1,a,u;for(;++o<=e.length;){if(o2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),i=o,s=0;continue}}else if(n.length>0){n="",r=0,i=o,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,s=0}else a===46&&s>-1?s++:s=-1}return n}function F_(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const nDe={cwd:rDe};function rDe(){return"/"}function p2(e){return e!==null&&typeof e=="object"&&e.href&&e.origin}function iDe(e){if(typeof e=="string")e=new URL(e);else if(!p2(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return sDe(e)}function sDe(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n{if(E||!S||!A)I(E);else{const P=s.stringify(S,A);P==null||(cDe(P)?A.value=P:A.result=P),I(E,A)}});function I(E,S){E||!S?b(E):_?_(S):y(null,S)}}}function p(m){let y;s.freeze(),gA("processSync",s.Parser),yA("processSync",s.Compiler);const g=kg(m);return s.process(g,_),wB("processSync","process",y),g;function _(b){y=!0,fB(b)}}}function bB(e,t){return typeof e=="function"&&e.prototype&&(uDe(e.prototype)||t in e.prototype)}function uDe(e){let t;for(t in e)if(CJ.call(e,t))return!0;return!1}function gA(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `Parser`")}function yA(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `Compiler`")}function _A(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function EB(e){if(!h2(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function wB(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function kg(e){return lDe(e)?e:new oDe(e)}function lDe(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function cDe(e){return typeof e=="string"||$D(e)}function fDe(e,t){var{includeImageAlt:n=!0}=t||{};return OJ(e,n)}function OJ(e,t){return e&&typeof e=="object"&&(e.value||(t?e.alt:"")||"children"in e&&TB(e.children,t)||Array.isArray(e)&&TB(e,t))||""}function TB(e,t){for(var n=[],r=-1;++ri?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),[].splice.apply(e,o);else for(n&&[].splice.apply(e,[t,n]);s0?(Au(e,e.length,0,t),e):t}const SB={}.hasOwnProperty;function dDe(e){const t={};let n=-1;for(;++no))return;const S=t.events.length;let A=S,P,V;for(;A--;)if(t.events[A][0]==="exit"&&t.events[A][1].type==="chunkFlow"){if(P){V=t.events[A][1].end;break}P=!0}for(g(r),E=S;Eb;){const I=n[T];t.containerState=I[1],I[0].exit.call(t,e)}n.length=b}function _(){i.write([null]),s=void 0,i=void 0,t.containerState._closeFlow=void 0}}function SDe(e,t,n){return Vn(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function CB(e){if(e===null||Ho(e)||_De(e))return 1;if(vDe(e))return 2}function LD(e,t,n){const r=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f=Object.assign({},e[r][1].end),d=Object.assign({},e[n][1].start);AB(f,-u),AB(d,u),o={type:u>1?"strongSequence":"emphasisSequence",start:f,end:Object.assign({},e[r][1].end)},a={type:u>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[n][1].start),end:d},s={type:u>1?"strongText":"emphasisText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},i={type:u>1?"strong":"emphasis",start:Object.assign({},o.start),end:Object.assign({},a.end)},e[r][1].end=Object.assign({},o.start),e[n][1].start=Object.assign({},a.end),l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=Do(l,[["enter",e[r][1],t],["exit",e[r][1],t]])),l=Do(l,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",s,t]]),l=Do(l,LD(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=Do(l,[["exit",s,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(c=2,l=Do(l,[["enter",e[n][1],t],["exit",e[n][1],t]])):c=0,Au(e,r-1,n-r+3,l),n=r+l.length-c-2;break}}for(n=-1;++n=4?o(l):n(l)}function o(l){return l===null?u(l):wt(l)?e.attempt(LDe,o,u)(l):(e.enter("codeFlowValue"),a(l))}function a(l){return l===null||wt(l)?(e.exit("codeFlowValue"),o(l)):(e.consume(l),a)}function u(l){return e.exit("codeIndented"),t(l)}}function FDe(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):wt(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):Vn(e,s,"linePrefix",5)(o)}function s(o){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(o):wt(o)?i(o):n(o)}}const BDe={name:"codeText",tokenize:VDe,resolve:jDe,previous:UDe};function jDe(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function DJ(e,t,n,r,i,s,o,a,u){const l=u||Number.POSITIVE_INFINITY;let c=0;return f;function f(g){return g===60?(e.enter(r),e.enter(i),e.enter(s),e.consume(g),e.exit(s),d):g===null||g===41||g2(g)?n(g):(e.enter(r),e.enter(o),e.enter(a),e.enter("chunkString",{contentType:"string"}),m(g))}function d(g){return g===62?(e.enter(s),e.consume(g),e.exit(s),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),h(g))}function h(g){return g===62?(e.exit("chunkString"),e.exit(a),d(g)):g===null||g===60||wt(g)?n(g):(e.consume(g),g===92?p:h)}function p(g){return g===60||g===62||g===92?(e.consume(g),h):h(g)}function m(g){return g===40?++c>l?n(g):(e.consume(g),m):g===41?c--?(e.consume(g),m):(e.exit("chunkString"),e.exit(a),e.exit(o),e.exit(r),t(g)):g===null||Ho(g)?c?n(g):(e.exit("chunkString"),e.exit(a),e.exit(o),e.exit(r),t(g)):g2(g)?n(g):(e.consume(g),g===92?y:m)}function y(g){return g===40||g===41||g===92?(e.consume(g),m):m(g)}}function $J(e,t,n,r,i,s){const o=this;let a=0,u;return l;function l(h){return e.enter(r),e.enter(i),e.consume(h),e.exit(i),e.enter(s),c}function c(h){return h===null||h===91||h===93&&!u||h===94&&!a&&"_hiddenFootnoteSupport"in o.parser.constructs||a>999?n(h):h===93?(e.exit(s),e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):wt(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),f(h))}function f(h){return h===null||h===91||h===93||wt(h)||a++>999?(e.exit("chunkString"),c(h)):(e.consume(h),u=u||!Ur(h),h===92?d:f)}function d(h){return h===91||h===92||h===93?(e.consume(h),a++,f):f(h)}}function LJ(e,t,n,r,i,s){let o;return a;function a(d){return e.enter(r),e.enter(i),e.consume(d),e.exit(i),o=d===40?41:d,u}function u(d){return d===o?(e.enter(i),e.consume(d),e.exit(i),e.exit(r),t):(e.enter(s),l(d))}function l(d){return d===o?(e.exit(s),u(o)):d===null?n(d):wt(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),Vn(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(d))}function c(d){return d===o||d===null||wt(d)?(e.exit("chunkString"),l(d)):(e.consume(d),d===92?f:c)}function f(d){return d===o||d===92?(e.consume(d),c):c(d)}}function M0(e,t){let n;return r;function r(i){return wt(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Ur(i)?Vn(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}function Sp(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const KDe={name:"definition",tokenize:XDe},QDe={tokenize:JDe,partial:!0};function XDe(e,t,n){const r=this;let i;return s;function s(u){return e.enter("definition"),$J.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(u)}function o(u){return i=Sp(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),u===58?(e.enter("definitionMarker"),e.consume(u),e.exit("definitionMarker"),M0(e,DJ(e,e.attempt(QDe,Vn(e,a,"whitespace"),Vn(e,a,"whitespace")),n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString"))):n(u)}function a(u){return u===null||wt(u)?(e.exit("definition"),r.parser.defined.includes(i)||r.parser.defined.push(i),t(u)):n(u)}}function JDe(e,t,n){return r;function r(o){return Ho(o)?M0(e,i)(o):n(o)}function i(o){return o===34||o===39||o===40?LJ(e,Vn(e,s,"whitespace"),n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o):n(o)}function s(o){return o===null||wt(o)?t(o):n(o)}}const ZDe={name:"hardBreakEscape",tokenize:e$e};function e$e(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.enter("escapeMarker"),e.consume(s),i}function i(s){return wt(s)?(e.exit("escapeMarker"),e.exit("hardBreakEscape"),t(s)):n(s)}}const t$e={name:"headingAtx",tokenize:r$e,resolve:n$e};function n$e(e,t){let n=e.length-2,r=3,i,s;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},s={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Au(e,r,n-r+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])),e}function r$e(e,t,n){const r=this;let i=0;return s;function s(c){return e.enter("atxHeading"),e.enter("atxHeadingSequence"),o(c)}function o(c){return c===35&&i++<6?(e.consume(c),o):c===null||Ho(c)?(e.exit("atxHeadingSequence"),r.interrupt?t(c):a(c)):n(c)}function a(c){return c===35?(e.enter("atxHeadingSequence"),u(c)):c===null||wt(c)?(e.exit("atxHeading"),t(c)):Ur(c)?Vn(e,a,"whitespace")(c):(e.enter("atxHeadingText"),l(c))}function u(c){return c===35?(e.consume(c),u):(e.exit("atxHeadingSequence"),a(c))}function l(c){return c===null||c===35||Ho(c)?(e.exit("atxHeadingText"),a(c)):(e.consume(c),l)}}const i$e=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],RB=["pre","script","style","textarea"],s$e={name:"htmlFlow",tokenize:u$e,resolveTo:a$e,concrete:!0},o$e={tokenize:l$e,partial:!0};function a$e(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function u$e(e,t,n){const r=this;let i,s,o,a,u;return l;function l(C){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(C),c}function c(C){return C===33?(e.consume(C),f):C===47?(e.consume(C),p):C===63?(e.consume(C),i=3,r.interrupt?t:se):Za(C)?(e.consume(C),o=String.fromCharCode(C),s=!0,m):n(C)}function f(C){return C===45?(e.consume(C),i=2,d):C===91?(e.consume(C),i=5,o="CDATA[",a=0,h):Za(C)?(e.consume(C),i=4,r.interrupt?t:se):n(C)}function d(C){return C===45?(e.consume(C),r.interrupt?t:se):n(C)}function h(C){return C===o.charCodeAt(a++)?(e.consume(C),a===o.length?r.interrupt?t:M:h):n(C)}function p(C){return Za(C)?(e.consume(C),o=String.fromCharCode(C),m):n(C)}function m(C){return C===null||C===47||C===62||Ho(C)?C!==47&&s&&RB.includes(o.toLowerCase())?(i=1,r.interrupt?t(C):M(C)):i$e.includes(o.toLowerCase())?(i=6,C===47?(e.consume(C),y):r.interrupt?t(C):M(C)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(C):s?_(C):g(C)):C===45||ao(C)?(e.consume(C),o+=String.fromCharCode(C),m):n(C)}function y(C){return C===62?(e.consume(C),r.interrupt?t:M):n(C)}function g(C){return Ur(C)?(e.consume(C),g):P(C)}function _(C){return C===47?(e.consume(C),P):C===58||C===95||Za(C)?(e.consume(C),b):Ur(C)?(e.consume(C),_):P(C)}function b(C){return C===45||C===46||C===58||C===95||ao(C)?(e.consume(C),b):T(C)}function T(C){return C===61?(e.consume(C),I):Ur(C)?(e.consume(C),T):_(C)}function I(C){return C===null||C===60||C===61||C===62||C===96?n(C):C===34||C===39?(e.consume(C),u=C,E):Ur(C)?(e.consume(C),I):(u=null,S(C))}function E(C){return C===null||wt(C)?n(C):C===u?(e.consume(C),A):(e.consume(C),E)}function S(C){return C===null||C===34||C===39||C===60||C===61||C===62||C===96||Ho(C)?T(C):(e.consume(C),S)}function A(C){return C===47||C===62||Ur(C)?_(C):n(C)}function P(C){return C===62?(e.consume(C),V):n(C)}function V(C){return Ur(C)?(e.consume(C),V):C===null||wt(C)?M(C):n(C)}function M(C){return C===45&&i===2?(e.consume(C),ye):C===60&&i===1?(e.consume(C),he):C===62&&i===4?(e.consume(C),K):C===63&&i===3?(e.consume(C),se):C===93&&i===5?(e.consume(C),te):wt(C)&&(i===6||i===7)?e.check(o$e,K,H)(C):C===null||wt(C)?H(C):(e.consume(C),M)}function H(C){return e.exit("htmlFlowData"),J(C)}function J(C){return C===null?x(C):wt(C)?e.attempt({tokenize:Y,partial:!0},J,x)(C):(e.enter("htmlFlowData"),M(C))}function Y(C,z,R){return O;function O(le){return C.enter("lineEnding"),C.consume(le),C.exit("lineEnding"),q}function q(le){return r.parser.lazy[r.now().line]?R(le):z(le)}}function ye(C){return C===45?(e.consume(C),se):M(C)}function he(C){return C===47?(e.consume(C),o="",ve):M(C)}function ve(C){return C===62&&RB.includes(o.toLowerCase())?(e.consume(C),K):Za(C)&&o.length<8?(e.consume(C),o+=String.fromCharCode(C),ve):M(C)}function te(C){return C===93?(e.consume(C),se):M(C)}function se(C){return C===62?(e.consume(C),K):C===45&&i===2?(e.consume(C),se):M(C)}function K(C){return C===null||wt(C)?(e.exit("htmlFlowData"),x(C)):(e.consume(C),K)}function x(C){return e.exit("htmlFlow"),t(C)}}function l$e(e,t,n){return r;function r(i){return e.exit("htmlFlowData"),e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),e.attempt(vI,t,n)}}const c$e={name:"htmlText",tokenize:f$e};function f$e(e,t,n){const r=this;let i,s,o,a;return u;function u(x){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(x),l}function l(x){return x===33?(e.consume(x),c):x===47?(e.consume(x),S):x===63?(e.consume(x),I):Za(x)?(e.consume(x),V):n(x)}function c(x){return x===45?(e.consume(x),f):x===91?(e.consume(x),s="CDATA[",o=0,y):Za(x)?(e.consume(x),T):n(x)}function f(x){return x===45?(e.consume(x),d):n(x)}function d(x){return x===null||x===62?n(x):x===45?(e.consume(x),h):p(x)}function h(x){return x===null||x===62?n(x):p(x)}function p(x){return x===null?n(x):x===45?(e.consume(x),m):wt(x)?(a=p,te(x)):(e.consume(x),p)}function m(x){return x===45?(e.consume(x),K):p(x)}function y(x){return x===s.charCodeAt(o++)?(e.consume(x),o===s.length?g:y):n(x)}function g(x){return x===null?n(x):x===93?(e.consume(x),_):wt(x)?(a=g,te(x)):(e.consume(x),g)}function _(x){return x===93?(e.consume(x),b):g(x)}function b(x){return x===62?K(x):x===93?(e.consume(x),b):g(x)}function T(x){return x===null||x===62?K(x):wt(x)?(a=T,te(x)):(e.consume(x),T)}function I(x){return x===null?n(x):x===63?(e.consume(x),E):wt(x)?(a=I,te(x)):(e.consume(x),I)}function E(x){return x===62?K(x):I(x)}function S(x){return Za(x)?(e.consume(x),A):n(x)}function A(x){return x===45||ao(x)?(e.consume(x),A):P(x)}function P(x){return wt(x)?(a=P,te(x)):Ur(x)?(e.consume(x),P):K(x)}function V(x){return x===45||ao(x)?(e.consume(x),V):x===47||x===62||Ho(x)?M(x):n(x)}function M(x){return x===47?(e.consume(x),K):x===58||x===95||Za(x)?(e.consume(x),H):wt(x)?(a=M,te(x)):Ur(x)?(e.consume(x),M):K(x)}function H(x){return x===45||x===46||x===58||x===95||ao(x)?(e.consume(x),H):J(x)}function J(x){return x===61?(e.consume(x),Y):wt(x)?(a=J,te(x)):Ur(x)?(e.consume(x),J):M(x)}function Y(x){return x===null||x===60||x===61||x===62||x===96?n(x):x===34||x===39?(e.consume(x),i=x,ye):wt(x)?(a=Y,te(x)):Ur(x)?(e.consume(x),Y):(e.consume(x),i=void 0,ve)}function ye(x){return x===i?(e.consume(x),he):x===null?n(x):wt(x)?(a=ye,te(x)):(e.consume(x),ye)}function he(x){return x===62||x===47||Ho(x)?M(x):n(x)}function ve(x){return x===null||x===34||x===39||x===60||x===61||x===96?n(x):x===62||Ho(x)?M(x):(e.consume(x),ve)}function te(x){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),Vn(e,se,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function se(x){return e.enter("htmlTextData"),a(x)}function K(x){return x===62?(e.consume(x),e.exit("htmlTextData"),e.exit("htmlText"),t):n(x)}}const FD={name:"labelEnd",tokenize:y$e,resolveTo:g$e,resolveAll:m$e},d$e={tokenize:_$e},h$e={tokenize:v$e},p$e={tokenize:b$e};function m$e(e){let t=-1,n;for(;++t-1&&(o[0]=o[0].slice(r)),s>0&&o.push(e[i].slice(0,s))),o}function H$e(e,t){let n=-1;const r=[];let i;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCharCode(n)}const i3e=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function s3e(e){return e.replace(i3e,o3e)}function o3e(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),s=i===120||i===88;return jJ(n.slice(s?2:1),s?16:10)}return MD(n)||e}const _2={}.hasOwnProperty,a3e=function(e,t,n){return typeof t!="string"&&(n=t,t=void 0),u3e(n)(r3e(t3e(n).document().write(n3e()(e,t,!0))))};function u3e(e={}){const t=UJ({transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:u(Be),autolinkProtocol:H,autolinkEmail:H,atxHeading:u(ot),blockQuote:u(ce),characterEscape:H,characterReference:H,codeFenced:u(st),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:u(st,l),codeText:u(Ke,l),codeTextData:H,data:H,codeFlowValue:H,definition:u(qe),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:u($e),hardBreakEscape:u(lt),hardBreakTrailing:u(lt),htmlFlow:u(On,l),htmlFlowData:H,htmlText:u(On,l),htmlTextData:H,image:u(Ue),label:l,link:u(Be),listItem:u(je),listItemValue:m,listOrdered:u(bt,p),listUnordered:u(bt),paragraph:u(gt),reference:q,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:u(ot),strong:u(Gt),thematicBreak:u(Gn)},exit:{atxHeading:f(),atxHeadingSequence:A,autolink:f(),autolinkEmail:Se,autolinkProtocol:me,blockQuote:f(),characterEscapeValue:J,characterReferenceMarkerHexadecimal:ae,characterReferenceMarkerNumeric:ae,characterReferenceValue:pe,codeFenced:f(b),codeFencedFence:_,codeFencedFenceInfo:y,codeFencedFenceMeta:g,codeFlowValue:J,codeIndented:f(T),codeText:f(te),codeTextData:J,data:J,definition:f(),definitionDestinationString:S,definitionLabelString:I,definitionTitleString:E,emphasis:f(),hardBreakEscape:f(ye),hardBreakTrailing:f(ye),htmlFlow:f(he),htmlFlowData:J,htmlText:f(ve),htmlTextData:J,image:f(K),label:C,labelText:x,lineEnding:Y,link:f(se),listItem:f(),listOrdered:f(),listUnordered:f(),paragraph:f(),referenceString:le,resourceDestinationString:z,resourceTitleString:R,resource:O,setextHeading:f(M),setextHeadingLineSequence:V,setextHeadingText:P,strong:f(),thematicBreak:f()}},e.mdastExtensions||[]),n={};return r;function r(ue){let we={type:"root",children:[]};const Le=[we],rt=[],De=[],it={stack:Le,tokenStack:rt,config:t,enter:c,exit:d,buffer:l,resume:h,setData:s,getData:o};let Me=-1;for(;++Me0){const Ze=rt[rt.length-1];(Ze[1]||DB).call(it,void 0,Ze[0])}for(we.position={start:a(ue.length>0?ue[0][1].start:{line:1,column:1,offset:0}),end:a(ue.length>0?ue[ue.length-2][1].end:{line:1,column:1,offset:0})},Me=-1;++Me{const r=this.data("settings");return a3e(n,Object.assign({},r,e,{extensions:this.data("micromarkExtensions")||[],mdastExtensions:this.data("fromMarkdownExtensions")||[]}))}})}var Jr=function(e,t,n){var r={type:String(e)};return n==null&&(typeof t=="string"||Array.isArray(t))?n=t:Object.assign(r,t),Array.isArray(n)?r.children=n:n!=null&&(r.value=String(n)),r};const ub={}.hasOwnProperty;function f3e(e,t){const n=t.data||{};return"value"in t&&!(ub.call(n,"hName")||ub.call(n,"hProperties")||ub.call(n,"hChildren"))?e.augment(t,Jr("text",t.value)):e(t,"div",ns(e,t))}function VJ(e,t,n){const r=t&&t.type;let i;if(!r)throw new Error("Expected node, got `"+t+"`");return ub.call(e.handlers,r)?i=e.handlers[r]:e.passThrough&&e.passThrough.includes(r)?i=d3e:i=e.unknownHandler,(typeof i=="function"?i:f3e)(e,t,n)}function d3e(e,t){return"children"in t?{...t,children:ns(e,t)}:t}function ns(e,t){const n=[];if("children"in t){const r=t.children;let i=-1;for(;++i":""))+")"})),d;function d(){let h=[],p,m,y;if((!t||i(a,u,l[l.length-1]||null))&&(h=b3e(n(a,l)),h[0]===$B))return h;if(a.children&&h[0]!==_3e)for(m=(r?a.children.length:-1)+s,y=l.concat(a);m>-1&&m-1?r.offset:null}}}function E3e(e){return!e||!e.position||!e.position.start||!e.position.start.line||!e.position.start.column||!e.position.end||!e.position.end.line||!e.position.end.column}const LB={}.hasOwnProperty;function w3e(e){const t=Object.create(null);if(!e||!e.type)throw new Error("mdast-util-definitions expected node");return BD(e,"definition",r=>{const i=MB(r.identifier);i&&!LB.call(t,i)&&(t[i]=r)}),n;function n(r){const i=MB(r);return i&&LB.call(t,i)?t[i]:null}}function MB(e){return String(e||"").toUpperCase()}function Um(e){const t=[];let n=-1,r=0,i=0;for(;++n55295&&s<57344){const a=e.charCodeAt(n+1);s<56320&&a>56319&&a<57344?(o=String.fromCharCode(s,a),i=1):o="�"}else o=String.fromCharCode(s);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function sl(e,t){const n=[];let r=-1;for(t&&n.push(Jr("text",` +`;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&i)continue;o=" ";break}default:o=String.fromCharCode(s)}i=s===-2,r.push(o)}return r.join("")}const W$e={42:bs,43:bs,45:bs,48:bs,49:bs,50:bs,51:bs,52:bs,53:bs,54:bs,55:bs,56:bs,57:bs,62:PJ},q$e={91:KDe},Y$e={[-2]:vA,[-1]:vA,32:vA},G$e={35:t$e,42:ab,45:[NB,ab],60:s$e,61:NB,95:ab,96:PB,126:PB},K$e={38:NJ,92:RJ},Q$e={[-5]:bA,[-4]:bA,[-3]:bA,33:E$e,38:NJ,42:y2,60:[CDe,c$e],91:T$e,92:[ZDe,RJ],93:FD,95:y2,96:BDe},X$e={null:[y2,F$e]},J$e={null:[42,95]},Z$e={null:[]},e3e=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:J$e,contentInitial:q$e,disable:Z$e,document:W$e,flow:G$e,flowInitial:Y$e,insideSpan:X$e,string:K$e,text:Q$e},Symbol.toStringTag,{value:"Module"}));function t3e(e={}){const t=dDe([e3e].concat(e.extensions||[])),n={defined:[],lazy:{},constructs:t,content:r(bDe),document:r(wDe),flow:r(L$e),string:r(B$e),text:r(j$e)};return n;function r(i){return s;function s(o){return V$e(n,i,o)}}}const kB=/[\0\t\n\r]/g;function n3e(){let e=1,t="",n=!0,r;return i;function i(s,o,a){const u=[];let l,c,f,d,h;for(s=t+s.toString(o),f=0,t="",n&&(s.charCodeAt(0)===65279&&f++,n=void 0);f13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCharCode(n)}const i3e=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function s3e(e){return e.replace(i3e,o3e)}function o3e(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),s=i===120||i===88;return BJ(n.slice(s?2:1),s?16:10)}return MD(n)||e}const _2={}.hasOwnProperty,a3e=function(e,t,n){return typeof t!="string"&&(n=t,t=void 0),u3e(n)(r3e(t3e(n).document().write(n3e()(e,t,!0))))};function u3e(e={}){const t=jJ({transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:u(Be),autolinkProtocol:H,autolinkEmail:H,atxHeading:u(ot),blockQuote:u(ce),characterEscape:H,characterReference:H,codeFenced:u(st),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:u(st,l),codeText:u(Ke,l),codeTextData:H,data:H,codeFlowValue:H,definition:u(qe),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:u($e),hardBreakEscape:u(lt),hardBreakTrailing:u(lt),htmlFlow:u(On,l),htmlFlowData:H,htmlText:u(On,l),htmlTextData:H,image:u(Ue),label:l,link:u(Be),listItem:u(je),listItemValue:m,listOrdered:u(bt,p),listUnordered:u(bt),paragraph:u(gt),reference:q,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:u(ot),strong:u(Gt),thematicBreak:u(Gn)},exit:{atxHeading:f(),atxHeadingSequence:A,autolink:f(),autolinkEmail:Se,autolinkProtocol:me,blockQuote:f(),characterEscapeValue:J,characterReferenceMarkerHexadecimal:ae,characterReferenceMarkerNumeric:ae,characterReferenceValue:pe,codeFenced:f(b),codeFencedFence:_,codeFencedFenceInfo:y,codeFencedFenceMeta:g,codeFlowValue:J,codeIndented:f(T),codeText:f(te),codeTextData:J,data:J,definition:f(),definitionDestinationString:S,definitionLabelString:I,definitionTitleString:E,emphasis:f(),hardBreakEscape:f(ye),hardBreakTrailing:f(ye),htmlFlow:f(he),htmlFlowData:J,htmlText:f(ve),htmlTextData:J,image:f(K),label:C,labelText:x,lineEnding:Y,link:f(se),listItem:f(),listOrdered:f(),listUnordered:f(),paragraph:f(),referenceString:le,resourceDestinationString:z,resourceTitleString:R,resource:O,setextHeading:f(M),setextHeadingLineSequence:V,setextHeadingText:P,strong:f(),thematicBreak:f()}},e.mdastExtensions||[]),n={};return r;function r(ue){let we={type:"root",children:[]};const Le=[we],rt=[],De=[],it={stack:Le,tokenStack:rt,config:t,enter:c,exit:d,buffer:l,resume:h,setData:s,getData:o};let Me=-1;for(;++Me0){const Ze=rt[rt.length-1];(Ze[1]||DB).call(it,void 0,Ze[0])}for(we.position={start:a(ue.length>0?ue[0][1].start:{line:1,column:1,offset:0}),end:a(ue.length>0?ue[ue.length-2][1].end:{line:1,column:1,offset:0})},Me=-1;++Me{const r=this.data("settings");return a3e(n,Object.assign({},r,e,{extensions:this.data("micromarkExtensions")||[],mdastExtensions:this.data("fromMarkdownExtensions")||[]}))}})}var Jr=function(e,t,n){var r={type:String(e)};return n==null&&(typeof t=="string"||Array.isArray(t))?n=t:Object.assign(r,t),Array.isArray(n)?r.children=n:n!=null&&(r.value=String(n)),r};const ub={}.hasOwnProperty;function f3e(e,t){const n=t.data||{};return"value"in t&&!(ub.call(n,"hName")||ub.call(n,"hProperties")||ub.call(n,"hChildren"))?e.augment(t,Jr("text",t.value)):e(t,"div",ns(e,t))}function UJ(e,t,n){const r=t&&t.type;let i;if(!r)throw new Error("Expected node, got `"+t+"`");return ub.call(e.handlers,r)?i=e.handlers[r]:e.passThrough&&e.passThrough.includes(r)?i=d3e:i=e.unknownHandler,(typeof i=="function"?i:f3e)(e,t,n)}function d3e(e,t){return"children"in t?{...t,children:ns(e,t)}:t}function ns(e,t){const n=[];if("children"in t){const r=t.children;let i=-1;for(;++i":""))+")"})),d;function d(){let h=[],p,m,y;if((!t||i(a,u,l[l.length-1]||null))&&(h=b3e(n(a,l)),h[0]===$B))return h;if(a.children&&h[0]!==_3e)for(m=(r?a.children.length:-1)+s,y=l.concat(a);m>-1&&m-1?r.offset:null}}}function E3e(e){return!e||!e.position||!e.position.start||!e.position.start.line||!e.position.start.column||!e.position.end||!e.position.end.line||!e.position.end.column}const LB={}.hasOwnProperty;function w3e(e){const t=Object.create(null);if(!e||!e.type)throw new Error("mdast-util-definitions expected node");return BD(e,"definition",r=>{const i=MB(r.identifier);i&&!LB.call(t,i)&&(t[i]=r)}),n;function n(r){const i=MB(r);return i&&LB.call(t,i)?t[i]:null}}function MB(e){return String(e||"").toUpperCase()}function Um(e){const t=[];let n=-1,r=0,i=0;for(;++n55295&&s<57344){const a=e.charCodeAt(n+1);s<56320&&a>56319&&a<57344?(o=String.fromCharCode(s,a),i=1):o="�"}else o=String.fromCharCode(s);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function sl(e,t){const n=[];let r=-1;for(t&&n.push(Jr("text",` `));++r0&&n.push(Jr("text",` `)),n}function T3e(e){let t=-1;const n=[];for(;++t1?"-"+a:""),dataFootnoteBackref:!0,className:["data-footnote-backref"],ariaLabel:e.footnoteBackLabel},children:[{type:"text",value:"↩"}]};a>1&&f.children.push({type:"element",tagName:"sup",children:[{type:"text",value:String(a)}]}),u.length>0&&u.push({type:"text",value:" "}),u.push(f)}const l=i[i.length-1];if(l&&l.type==="element"&&l.tagName==="p"){const f=l.children[l.children.length-1];f&&f.type==="text"?f.value+=" ":l.children.push({type:"text",value:" "}),l.children.push(...u)}else i.push(...u);const c={type:"element",tagName:"li",properties:{id:e.clobberPrefix+"fn-"+o},children:sl(i,!0)};r.position&&(c.position=r.position),n.push(c)}return n.length===0?null:{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:e.footnoteLabelTagName,properties:{...JSON.parse(JSON.stringify(e.footnoteLabelProperties)),id:"footnote-label"},children:[Jr("text",e.footnoteLabel)]},{type:"text",value:` `},{type:"element",tagName:"ol",properties:{},children:sl(n,!0)},{type:"text",value:` `}]}}function S3e(e,t){return e(t,"blockquote",sl(ns(e,t),!0))}function I3e(e,t){return[e(t,"br"),Jr("text",` `)]}function x3e(e,t){const n=t.value?t.value+` -`:"",r=t.lang&&t.lang.match(/^[^ \t]+(?=[ \t]|$)/),i={};r&&(i.className=["language-"+r]);const s=e(t,"code",i,[Jr("text",n)]);return t.meta&&(s.data={meta:t.meta}),e(t.position,"pre",[s])}function C3e(e,t){return e(t,"del",ns(e,t))}function A3e(e,t){return e(t,"em",ns(e,t))}function YJ(e,t){const n=String(t.identifier),r=Um(n.toLowerCase()),i=e.footnoteOrder.indexOf(n);let s;i===-1?(e.footnoteOrder.push(n),e.footnoteCounts[n]=1,s=e.footnoteOrder.length):(e.footnoteCounts[n]++,s=i+1);const o=e.footnoteCounts[n];return e(t,"sup",[e(t.position,"a",{href:"#"+e.clobberPrefix+"fn-"+r,id:e.clobberPrefix+"fnref-"+r+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:"footnote-label"},[Jr("text",String(s))])])}function O3e(e,t){const n=e.footnoteById;let r=1;for(;r in n;)r++;const i=String(r);return n[i]={type:"footnoteDefinition",identifier:i,children:[{type:"paragraph",children:t.children}],position:t.position},YJ(e,{type:"footnoteReference",identifier:i,position:t.position})}function P3e(e,t){return e(t,"h"+t.depth,ns(e,t))}function R3e(e,t){return e.dangerous?e.augment(t,Jr("raw",t.value)):null}function GJ(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return Jr("text","!["+t.alt+r);const i=ns(e,t),s=i[0];s&&s.type==="text"?s.value="["+s.value:i.unshift(Jr("text","["));const o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push(Jr("text",r)),i}function N3e(e,t){const n=e.definition(t.identifier);if(!n)return GJ(e,t);const r={src:Um(n.url||""),alt:t.alt};return n.title!==null&&n.title!==void 0&&(r.title=n.title),e(t,"img",r)}function k3e(e,t){const n={src:Um(t.url),alt:t.alt};return t.title!==null&&t.title!==void 0&&(n.title=t.title),e(t,"img",n)}function D3e(e,t){return e(t,"code",[Jr("text",t.value.replace(/\r?\n|\r/g," "))])}function $3e(e,t){const n=e.definition(t.identifier);if(!n)return GJ(e,t);const r={href:Um(n.url||"")};return n.title!==null&&n.title!==void 0&&(r.title=n.title),e(t,"a",r,ns(e,t))}function L3e(e,t){const n={href:Um(t.url)};return t.title!==null&&t.title!==void 0&&(n.title=t.title),e(t,"a",n,ns(e,t))}function M3e(e,t,n){const r=ns(e,t),i=n?F3e(n):KJ(t),s={},o=[];if(typeof t.checked=="boolean"){let l;r[0]&&r[0].type==="element"&&r[0].tagName==="p"?l=r[0]:(l=e(null,"p",[]),r.unshift(l)),l.children.length>0&&l.children.unshift(Jr("text"," ")),l.children.unshift(e(null,"input",{type:"checkbox",checked:t.checked,disabled:!0})),s.className=["task-list-item"]}let a=-1;for(;++a1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:"footnote-label"},[Jr("text",String(s))])])}function O3e(e,t){const n=e.footnoteById;let r=1;for(;r in n;)r++;const i=String(r);return n[i]={type:"footnoteDefinition",identifier:i,children:[{type:"paragraph",children:t.children}],position:t.position},qJ(e,{type:"footnoteReference",identifier:i,position:t.position})}function P3e(e,t){return e(t,"h"+t.depth,ns(e,t))}function R3e(e,t){return e.dangerous?e.augment(t,Jr("raw",t.value)):null}function YJ(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return Jr("text","!["+t.alt+r);const i=ns(e,t),s=i[0];s&&s.type==="text"?s.value="["+s.value:i.unshift(Jr("text","["));const o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push(Jr("text",r)),i}function N3e(e,t){const n=e.definition(t.identifier);if(!n)return YJ(e,t);const r={src:Um(n.url||""),alt:t.alt};return n.title!==null&&n.title!==void 0&&(r.title=n.title),e(t,"img",r)}function k3e(e,t){const n={src:Um(t.url),alt:t.alt};return t.title!==null&&t.title!==void 0&&(n.title=t.title),e(t,"img",n)}function D3e(e,t){return e(t,"code",[Jr("text",t.value.replace(/\r?\n|\r/g," "))])}function $3e(e,t){const n=e.definition(t.identifier);if(!n)return YJ(e,t);const r={href:Um(n.url||"")};return n.title!==null&&n.title!==void 0&&(r.title=n.title),e(t,"a",r,ns(e,t))}function L3e(e,t){const n={href:Um(t.url)};return t.title!==null&&t.title!==void 0&&(n.title=t.title),e(t,"a",n,ns(e,t))}function M3e(e,t,n){const r=ns(e,t),i=n?F3e(n):GJ(t),s={},o=[];if(typeof t.checked=="boolean"){let l;r[0]&&r[0].type==="element"&&r[0].tagName==="p"?l=r[0]:(l=e(null,"p",[]),r.unshift(l)),l.children.length>0&&l.children.unshift(Jr("text"," ")),l.children.unshift(e(null,"input",{type:"checkbox",checked:t.checked,disabled:!0})),s.className=["task-list-item"]}let a=-1;for(;++a1}function B3e(e,t){const n={},r=t.ordered?"ol":"ul",i=ns(e,t);let s=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++s0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return s.push(jB(t.slice(i),i>0,!1)),s.join("")}function jB(e,t,n){let r=0,i=e.length;if(t){let s=e.codePointAt(r);for(;s===FB||s===BB;)r++,s=e.codePointAt(r)}if(n){let s=e.codePointAt(i-1);for(;s===FB||s===BB;)i--,s=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function W3e(e,t){return e.augment(t,Jr("text",H3e(String(t.value))))}function q3e(e,t){return e(t,"hr")}const Y3e={blockquote:S3e,break:I3e,code:x3e,delete:C3e,emphasis:A3e,footnoteReference:YJ,footnote:O3e,heading:P3e,html:R3e,imageReference:N3e,image:k3e,inlineCode:D3e,linkReference:$3e,link:L3e,listItem:M3e,list:B3e,paragraph:j3e,root:U3e,strong:V3e,table:z3e,text:W3e,thematicBreak:q3e,toml:a1,yaml:a1,definition:a1,footnoteDefinition:a1};function a1(){return null}const G3e={}.hasOwnProperty;function K3e(e,t){const n=t||{},r=n.allowDangerousHtml||!1,i={};return o.dangerous=r,o.clobberPrefix=n.clobberPrefix===void 0||n.clobberPrefix===null?"user-content-":n.clobberPrefix,o.footnoteLabel=n.footnoteLabel||"Footnotes",o.footnoteLabelTagName=n.footnoteLabelTagName||"h2",o.footnoteLabelProperties=n.footnoteLabelProperties||{className:["sr-only"]},o.footnoteBackLabel=n.footnoteBackLabel||"Back to content",o.definition=w3e(e),o.footnoteById=i,o.footnoteOrder=[],o.footnoteCounts={},o.augment=s,o.handlers={...Y3e,...n.handlers},o.unknownHandler=n.unknownHandler,o.passThrough=n.passThrough,BD(e,"footnoteDefinition",a=>{const u=String(a.identifier).toUpperCase();G3e.call(i,u)||(i[u]=a)}),o;function s(a,u){if(a&&"data"in a&&a.data){const l=a.data;l.hName&&(u.type!=="element"&&(u={type:"element",tagName:"",properties:{},children:[]}),u.tagName=l.hName),u.type==="element"&&l.hProperties&&(u.properties={...u.properties,...l.hProperties}),"children"in u&&u.children&&l.hChildren&&(u.children=l.hChildren)}if(a){const l="type"in a?a:{position:a};E3e(l)||(u.position={start:HJ(l),end:WJ(l)})}return u}function o(a,u,l,c){return Array.isArray(l)&&(c=l,l={}),s(a,{type:"element",tagName:u,properties:l||{},children:c||[]})}}function QJ(e,t){const n=K3e(e,t),r=VJ(n,e,null),i=T3e(n);return i&&r.children.push(Jr("text",` -`),i),Array.isArray(r)?{type:"root",children:r}:r}const Q3e=function(e,t){return e&&"run"in e?J3e(e,t):Z3e(e||t)},X3e=Q3e;function J3e(e,t){return(n,r,i)=>{e.run(QJ(n,t),r,s=>{i(s)})}}function Z3e(e){return t=>QJ(t,e)}var XJ={exports:{}},e6e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",t6e=e6e,n6e=t6e;function JJ(){}function ZJ(){}ZJ.resetWarningCache=JJ;var r6e=function(){function e(r,i,s,o,a,u){if(u!==n6e){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:ZJ,resetWarningCache:JJ};return n.PropTypes=n,n};XJ.exports=r6e();var i6e=XJ.exports;const ht=ka(i6e);let B_=class{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}};B_.prototype.property={};B_.prototype.normal={};B_.prototype.space=null;function eZ(e,t){const n={},r={};let i=-1;for(;++i4&&n.slice(0,4)==="data"&&l6e.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(VB,d6e);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!VB.test(s)){let o=s.replace(c6e,f6e);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=jD}return new i(r,t)}function f6e(e){return"-"+e.toLowerCase()}function d6e(e){return e.charAt(1).toUpperCase()}const zB={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},j_=eZ([rZ,nZ,oZ,aZ,a6e],"html"),zm=eZ([rZ,nZ,oZ,aZ,u6e],"svg");function h6e(e){if(e.allowedElements&&e.disallowedElements)throw new TypeError("Only one of `allowedElements` and `disallowedElements` should be defined");if(e.allowedElements||e.disallowedElements||e.allowElement)return t=>{BD(t,"element",(n,r,i)=>{const s=i;let o;if(e.allowedElements?o=!e.allowedElements.includes(n.tagName):e.disallowedElements&&(o=e.disallowedElements.includes(n.tagName)),!o&&e.allowElement&&typeof r=="number"&&(o=!e.allowElement(n,r,s)),o&&typeof r=="number")return e.unwrapDisallowed&&n.children?s.children.splice(r,1,...n.children):s.children.splice(r,1),r})}}var uZ={exports:{}},Dn={};/** +`)),e(t,"li",s,o)}function F3e(e){let t=e.spread;const n=e.children;let r=-1;for(;!t&&++r1}function B3e(e,t){const n={},r=t.ordered?"ol":"ul",i=ns(e,t);let s=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++s0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return s.push(jB(t.slice(i),i>0,!1)),s.join("")}function jB(e,t,n){let r=0,i=e.length;if(t){let s=e.codePointAt(r);for(;s===FB||s===BB;)r++,s=e.codePointAt(r)}if(n){let s=e.codePointAt(i-1);for(;s===FB||s===BB;)i--,s=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function W3e(e,t){return e.augment(t,Jr("text",H3e(String(t.value))))}function q3e(e,t){return e(t,"hr")}const Y3e={blockquote:S3e,break:I3e,code:x3e,delete:C3e,emphasis:A3e,footnoteReference:qJ,footnote:O3e,heading:P3e,html:R3e,imageReference:N3e,image:k3e,inlineCode:D3e,linkReference:$3e,link:L3e,listItem:M3e,list:B3e,paragraph:j3e,root:U3e,strong:V3e,table:z3e,text:W3e,thematicBreak:q3e,toml:a1,yaml:a1,definition:a1,footnoteDefinition:a1};function a1(){return null}const G3e={}.hasOwnProperty;function K3e(e,t){const n=t||{},r=n.allowDangerousHtml||!1,i={};return o.dangerous=r,o.clobberPrefix=n.clobberPrefix===void 0||n.clobberPrefix===null?"user-content-":n.clobberPrefix,o.footnoteLabel=n.footnoteLabel||"Footnotes",o.footnoteLabelTagName=n.footnoteLabelTagName||"h2",o.footnoteLabelProperties=n.footnoteLabelProperties||{className:["sr-only"]},o.footnoteBackLabel=n.footnoteBackLabel||"Back to content",o.definition=w3e(e),o.footnoteById=i,o.footnoteOrder=[],o.footnoteCounts={},o.augment=s,o.handlers={...Y3e,...n.handlers},o.unknownHandler=n.unknownHandler,o.passThrough=n.passThrough,BD(e,"footnoteDefinition",a=>{const u=String(a.identifier).toUpperCase();G3e.call(i,u)||(i[u]=a)}),o;function s(a,u){if(a&&"data"in a&&a.data){const l=a.data;l.hName&&(u.type!=="element"&&(u={type:"element",tagName:"",properties:{},children:[]}),u.tagName=l.hName),u.type==="element"&&l.hProperties&&(u.properties={...u.properties,...l.hProperties}),"children"in u&&u.children&&l.hChildren&&(u.children=l.hChildren)}if(a){const l="type"in a?a:{position:a};E3e(l)||(u.position={start:zJ(l),end:HJ(l)})}return u}function o(a,u,l,c){return Array.isArray(l)&&(c=l,l={}),s(a,{type:"element",tagName:u,properties:l||{},children:c||[]})}}function KJ(e,t){const n=K3e(e,t),r=UJ(n,e,null),i=T3e(n);return i&&r.children.push(Jr("text",` +`),i),Array.isArray(r)?{type:"root",children:r}:r}const Q3e=function(e,t){return e&&"run"in e?J3e(e,t):Z3e(e||t)},X3e=Q3e;function J3e(e,t){return(n,r,i)=>{e.run(KJ(n,t),r,s=>{i(s)})}}function Z3e(e){return t=>KJ(t,e)}var QJ={exports:{}},e6e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",t6e=e6e,n6e=t6e;function XJ(){}function JJ(){}JJ.resetWarningCache=XJ;var r6e=function(){function e(r,i,s,o,a,u){if(u!==n6e){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:JJ,resetWarningCache:XJ};return n.PropTypes=n,n};QJ.exports=r6e();var i6e=QJ.exports;const ht=ka(i6e);let B_=class{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}};B_.prototype.property={};B_.prototype.normal={};B_.prototype.space=null;function ZJ(e,t){const n={},r={};let i=-1;for(;++i4&&n.slice(0,4)==="data"&&l6e.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(VB,d6e);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!VB.test(s)){let o=s.replace(c6e,f6e);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=jD}return new i(r,t)}function f6e(e){return"-"+e.toLowerCase()}function d6e(e){return e.charAt(1).toUpperCase()}const zB={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},j_=ZJ([nZ,tZ,sZ,oZ,a6e],"html"),zm=ZJ([nZ,tZ,sZ,oZ,u6e],"svg");function h6e(e){if(e.allowedElements&&e.disallowedElements)throw new TypeError("Only one of `allowedElements` and `disallowedElements` should be defined");if(e.allowedElements||e.disallowedElements||e.allowElement)return t=>{BD(t,"element",(n,r,i)=>{const s=i;let o;if(e.allowedElements?o=!e.allowedElements.includes(n.tagName):e.disallowedElements&&(o=e.disallowedElements.includes(n.tagName)),!o&&e.allowElement&&typeof r=="number"&&(o=!e.allowElement(n,r,s)),o&&typeof r=="number")return e.unwrapDisallowed&&n.children?s.children.splice(r,1,...n.children):s.children.splice(r,1),r})}}var aZ={exports:{}},Dn={};/** * @license React * react-is.production.min.js * @@ -185,51 +185,51 @@ Error generating stack: `+s.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var UD=Symbol.for("react.element"),VD=Symbol.for("react.portal"),wI=Symbol.for("react.fragment"),TI=Symbol.for("react.strict_mode"),SI=Symbol.for("react.profiler"),II=Symbol.for("react.provider"),xI=Symbol.for("react.context"),p6e=Symbol.for("react.server_context"),CI=Symbol.for("react.forward_ref"),AI=Symbol.for("react.suspense"),OI=Symbol.for("react.suspense_list"),PI=Symbol.for("react.memo"),RI=Symbol.for("react.lazy"),m6e=Symbol.for("react.offscreen"),lZ;lZ=Symbol.for("react.module.reference");function na(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case UD:switch(e=e.type,e){case wI:case SI:case TI:case AI:case OI:return e;default:switch(e=e&&e.$$typeof,e){case p6e:case xI:case CI:case RI:case PI:case II:return e;default:return t}}case VD:return t}}}Dn.ContextConsumer=xI;Dn.ContextProvider=II;Dn.Element=UD;Dn.ForwardRef=CI;Dn.Fragment=wI;Dn.Lazy=RI;Dn.Memo=PI;Dn.Portal=VD;Dn.Profiler=SI;Dn.StrictMode=TI;Dn.Suspense=AI;Dn.SuspenseList=OI;Dn.isAsyncMode=function(){return!1};Dn.isConcurrentMode=function(){return!1};Dn.isContextConsumer=function(e){return na(e)===xI};Dn.isContextProvider=function(e){return na(e)===II};Dn.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===UD};Dn.isForwardRef=function(e){return na(e)===CI};Dn.isFragment=function(e){return na(e)===wI};Dn.isLazy=function(e){return na(e)===RI};Dn.isMemo=function(e){return na(e)===PI};Dn.isPortal=function(e){return na(e)===VD};Dn.isProfiler=function(e){return na(e)===SI};Dn.isStrictMode=function(e){return na(e)===TI};Dn.isSuspense=function(e){return na(e)===AI};Dn.isSuspenseList=function(e){return na(e)===OI};Dn.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===wI||e===SI||e===TI||e===AI||e===OI||e===m6e||typeof e=="object"&&e!==null&&(e.$$typeof===RI||e.$$typeof===PI||e.$$typeof===II||e.$$typeof===xI||e.$$typeof===CI||e.$$typeof===lZ||e.getModuleId!==void 0)};Dn.typeOf=na;uZ.exports=Dn;var g6e=uZ.exports;const y6e=ka(g6e);function _6e(e){const t=e&&typeof e=="object"&&e.type==="text"?e.value||"":e;return typeof t=="string"&&t.replace(/[ \t\n\f\r]/g,"")===""}function HB(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function cZ(e){return e.join(" ").trim()}function WB(e){const t=[],n=String(e||"");let r=n.indexOf(","),i=0,s=!1;for(;!s;){r===-1&&(r=n.length,s=!0);const o=n.slice(i,r).trim();(o||!s)&&t.push(o),i=r+1,r=n.indexOf(",",i)}return t}function fZ(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}var zD={exports:{}},qB=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,v6e=/\n/g,b6e=/^\s*/,E6e=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,w6e=/^:\s*/,T6e=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,S6e=/^[;\s]*/,I6e=/^\s+|\s+$/g,x6e=` -`,YB="/",GB="*",Yf="",C6e="comment",A6e="declaration",O6e=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(p){var m=p.match(v6e);m&&(n+=m.length);var y=p.lastIndexOf(x6e);r=~y?p.length-y:r+p.length}function s(){var p={line:n,column:r};return function(m){return m.position=new o(p),l(),m}}function o(p){this.start=p,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function a(p){var m=new Error(t.source+":"+n+":"+r+": "+p);if(m.reason=p,m.filename=t.source,m.line=n,m.column=r,m.source=e,!t.silent)throw m}function u(p){var m=p.exec(e);if(m){var y=m[0];return i(y),e=e.slice(y.length),m}}function l(){u(b6e)}function c(p){var m;for(p=p||[];m=f();)m!==!1&&p.push(m);return p}function f(){var p=s();if(!(YB!=e.charAt(0)||GB!=e.charAt(1))){for(var m=2;Yf!=e.charAt(m)&&(GB!=e.charAt(m)||YB!=e.charAt(m+1));)++m;if(m+=2,Yf===e.charAt(m-1))return a("End of comment missing");var y=e.slice(2,m-2);return r+=2,i(y),e=e.slice(m),r+=2,p({type:C6e,comment:y})}}function d(){var p=s(),m=u(E6e);if(m){if(f(),!u(w6e))return a("property missing ':'");var y=u(T6e),g=p({type:A6e,property:KB(m[0].replace(qB,Yf)),value:y?KB(y[0].replace(qB,Yf)):Yf});return u(S6e),g}}function h(){var p=[];c(p);for(var m;m=d();)m!==!1&&(p.push(m),c(p));return p}return l(),h()};function KB(e){return e?e.replace(I6e,Yf):Yf}var P6e=O6e;function dZ(e,t){var n=null;if(!e||typeof e!="string")return n;for(var r,i=P6e(e),s=typeof t=="function",o,a,u=0,l=i.length;u0?k.createElement(h,u,f):k.createElement(h,u)}function $6e(e){let t=-1;for(;++t for more info)`),delete u1[s]}const t=aDe().use(c3e).use(e.remarkPlugins||[]).use(X3e,{...e.remarkRehypeOptions,allowDangerousHtml:!0}).use(e.rehypePlugins||[]).use(h6e,e),n=new qke;typeof e.children=="string"?n.value=e.children:e.children!==void 0&&e.children!==null&&console.warn(`[react-markdown] Warning: please pass a string as \`children\` (not: \`${e.children}\`)`);const r=t.runSync(t.parse(n),n);if(r.type!=="root")throw new TypeError("Expected a `root` node");let i=k.createElement(k.Fragment,{},hZ({options:e,schema:j_,listDepth:0},r));return e.className&&(i=k.createElement("div",{className:e.className},i)),i}pZ.propTypes={children:ht.string,className:ht.string,allowElement:ht.func,allowedElements:ht.arrayOf(ht.string),disallowedElements:ht.arrayOf(ht.string),unwrapDisallowed:ht.bool,remarkPlugins:ht.arrayOf(ht.oneOfType([ht.object,ht.func,ht.arrayOf(ht.oneOfType([ht.bool,ht.string,ht.object,ht.func,ht.arrayOf(ht.any)]))])),rehypePlugins:ht.arrayOf(ht.oneOfType([ht.object,ht.func,ht.arrayOf(ht.oneOfType([ht.bool,ht.string,ht.object,ht.func,ht.arrayOf(ht.any)]))])),sourcePos:ht.bool,rawSourcePos:ht.bool,skipHtml:ht.bool,includeElementIndex:ht.bool,transformLinkUri:ht.oneOfType([ht.func,ht.bool]),linkTarget:ht.oneOfType([ht.func,ht.string]),transformImageUri:ht.func,components:ht.object};const mZ=-1,NI=0,Jw=1,Zw=2,HD=3,WD=4,qD=5,YD=6,gZ=7,yZ=8,XB=typeof self=="object"?self:globalThis,U6e=(e,t)=>{const n=(i,s)=>(e.set(s,i),i),r=i=>{if(e.has(i))return e.get(i);const[s,o]=t[i];switch(s){case NI:case mZ:return n(o,i);case Jw:{const a=n([],i);for(const u of o)a.push(r(u));return a}case Zw:{const a=n({},i);for(const[u,l]of o)a[r(u)]=r(l);return a}case HD:return n(new Date(o),i);case WD:{const{source:a,flags:u}=o;return n(new RegExp(a,u),i)}case qD:{const a=n(new Map,i);for(const[u,l]of o)a.set(r(u),r(l));return a}case YD:{const a=n(new Set,i);for(const u of o)a.add(r(u));return a}case gZ:{const{name:a,message:u}=o;return n(new XB[a](u),i)}case yZ:return n(BigInt(o),i);case"BigInt":return n(Object(BigInt(o)),i)}return n(new XB[s](o),i)};return r},JB=e=>U6e(new Map,e)(0),wh="",{toString:V6e}={},{keys:z6e}=Object,Dg=e=>{const t=typeof e;if(t!=="object"||!e)return[NI,t];const n=V6e.call(e).slice(8,-1);switch(n){case"Array":return[Jw,wh];case"Object":return[Zw,wh];case"Date":return[HD,wh];case"RegExp":return[WD,wh];case"Map":return[qD,wh];case"Set":return[YD,wh]}return n.includes("Array")?[Jw,n]:n.includes("Error")?[gZ,n]:[Zw,n]},l1=([e,t])=>e===NI&&(t==="function"||t==="symbol"),H6e=(e,t,n,r)=>{const i=(o,a)=>{const u=r.push(o)-1;return n.set(a,u),u},s=o=>{if(n.has(o))return n.get(o);let[a,u]=Dg(o);switch(a){case NI:{let c=o;switch(u){case"bigint":a=yZ,c=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);c=null;break;case"undefined":return i([mZ],o)}return i([a,c],o)}case Jw:{if(u)return i([u,[...o]],o);const c=[],f=i([a,c],o);for(const d of o)c.push(s(d));return f}case Zw:{if(u)switch(u){case"BigInt":return i([u,o.toString()],o);case"Boolean":case"Number":case"String":return i([u,o.valueOf()],o)}if(t&&"toJSON"in o)return s(o.toJSON());const c=[],f=i([a,c],o);for(const d of z6e(o))(e||!l1(Dg(o[d])))&&c.push([s(d),s(o[d])]);return f}case HD:return i([a,o.toISOString()],o);case WD:{const{source:c,flags:f}=o;return i([a,{source:c,flags:f}],o)}case qD:{const c=[],f=i([a,c],o);for(const[d,h]of o)(e||!(l1(Dg(d))||l1(Dg(h))))&&c.push([s(d),s(h)]);return f}case YD:{const c=[],f=i([a,c],o);for(const d of o)(e||!l1(Dg(d)))&&c.push(s(d));return f}}const{message:l}=o;return i([a,{name:u,message:l}],o)};return s},ZB=(e,{json:t,lossy:n}={})=>{const r=[];return H6e(!(t||n),!!t,new Map,r)(e),r},ej=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?JB(ZB(e,t)):structuredClone(e):(e,t)=>JB(ZB(e,t));const tj=/[#.]/g;function W6e(e,t){const n=e||"",r={};let i=0,s,o;for(;i-1&&ss)return{line:o+1,column:s-(o>0?n[o-1]:0)+1,offset:s}}}function i(s){const o=s&&s.line,a=s&&s.column;if(typeof o=="number"&&typeof a=="number"&&!Number.isNaN(o)&&!Number.isNaN(a)&&o-1 in n){const u=(n[o-2]||0)+a-1||0;if(u>-1&&u=55296&&e<=57343}function yLe(e){return e>=56320&&e<=57343}function _Le(e,t){return(e-55296)*1024+9216+t}function SZ(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function IZ(e){return e>=64976&&e<=65007||gLe.has(e)}var _e;(function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeValue="missing-attribute-value",e.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",e.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",e.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",e.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",e.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",e.missingDoctypePublicIdentifier="missing-doctype-public-identifier",e.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",e.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",e.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",e.cdataInHtmlContent="cdata-in-html-content",e.incorrectlyOpenedComment="incorrectly-opened-comment",e.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",e.eofInDoctype="eof-in-doctype",e.nestedComment="nested-comment",e.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",e.eofInComment="eof-in-comment",e.incorrectlyClosedComment="incorrectly-closed-comment",e.eofInCdata="eof-in-cdata",e.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",e.nullCharacterReference="null-character-reference",e.surrogateCharacterReference="surrogate-character-reference",e.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",e.controlCharacterReference="control-character-reference",e.noncharacterCharacterReference="noncharacter-character-reference",e.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",e.missingDoctypeName="missing-doctype-name",e.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",e.duplicateAttribute="duplicate-attribute",e.nonConformingDoctype="non-conforming-doctype",e.missingDoctype="missing-doctype",e.misplacedDoctype="misplaced-doctype",e.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",e.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",e.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",e.openElementsLeftAfterEof="open-elements-left-after-eof",e.abandonedHeadElementChild="abandoned-head-element-child",e.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",e.nestedNoscriptInHead="nested-noscript-in-head",e.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(_e=_e||(_e={}));const vLe=65536;class bLe{constructor(t){this.handler=t,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=vLe,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(t){const{line:n,col:r,offset:i}=this;return{code:t,startLine:n,endLine:n,startCol:r,endCol:r,startOffset:i,endOffset:i}}_err(t){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(t)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(t){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(yLe(n))return this.pos++,this._addGap(),_Le(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,L.EOF;return this._err(_e.surrogateInInputStream),t}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(t,n){this.html.length>0?this.html+=t:this.html=t,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(t){this.html=this.html.substring(0,this.pos+1)+t+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(t,n){if(this.pos+t.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(t,this.pos);for(let r=0;r=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,L.EOF;const r=this.html.charCodeAt(n);return r===L.CARRIAGE_RETURN?L.LINE_FEED:r}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,L.EOF;let t=this.html.charCodeAt(this.pos);return t===L.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,L.LINE_FEED):t===L.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,TZ(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===L.LINE_FEED||t===L.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){SZ(t)?this._err(_e.controlCharacterInInputStream):IZ(t)&&this._err(_e.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}const ic=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),ELe=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0)));var SA;const wLe=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),TLe=(SA=String.fromCodePoint)!==null&&SA!==void 0?SA:function(e){let t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|e&1023),t+=String.fromCharCode(e),t};function SLe(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=wLe.get(e))!==null&&t!==void 0?t:e}var fi;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(fi||(fi={}));const ILe=32;var lu;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(lu||(lu={}));function T2(e){return e>=fi.ZERO&&e<=fi.NINE}function xLe(e){return e>=fi.UPPER_A&&e<=fi.UPPER_F||e>=fi.LOWER_A&&e<=fi.LOWER_F}function CLe(e){return e>=fi.UPPER_A&&e<=fi.UPPER_Z||e>=fi.LOWER_A&&e<=fi.LOWER_Z||T2(e)}function ALe(e){return e===fi.EQUALS||CLe(e)}var oi;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(oi||(oi={}));var Gf;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(Gf||(Gf={}));class OLe{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=oi.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Gf.Strict}startEntity(t){this.decodeMode=t,this.state=oi.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case oi.EntityStart:return t.charCodeAt(n)===fi.NUM?(this.state=oi.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=oi.NamedEntity,this.stateNamedEntity(t,n));case oi.NumericStart:return this.stateNumericStart(t,n);case oi.NumericDecimal:return this.stateNumericDecimal(t,n);case oi.NumericHex:return this.stateNumericHex(t,n);case oi.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|ILe)===fi.LOWER_X?(this.state=oi.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=oi.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,r,i){if(n!==r){const s=r-n;this.result=this.result*Math.pow(i,s)+parseInt(t.substr(n,s),i),this.consumed+=s}}stateNumericHex(t,n){const r=n;for(;n>14;for(;n>14,s!==0){if(o===fi.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==Gf.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:r}=this,i=(r[n]&lu.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,i,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,r){const{decodeTree:i}=this;return this.emitCodePoint(n===1?i[t]&~lu.VALUE_LENGTH:i[t+1],r),n===3&&this.emitCodePoint(i[t+2],r),r}end(){var t;switch(this.state){case oi.NamedEntity:return this.result!==0&&(this.decodeMode!==Gf.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case oi.NumericDecimal:return this.emitNumericEntity(0,2);case oi.NumericHex:return this.emitNumericEntity(0,3);case oi.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case oi.EntityStart:return 0}}}function CZ(e){let t="";const n=new OLe(e,r=>t+=TLe(r));return function(i,s){let o=0,a=0;for(;(a=i.indexOf("&",a))>=0;){t+=i.slice(o,a),n.startEntity(s);const l=n.write(i,a+1);if(l<0){o=a+n.end();break}o=a+l,a=l===0?o+1:o}const u=t+i.slice(o);return t="",u}}function AZ(e,t,n,r){const i=(t&lu.BRANCH_LENGTH)>>7,s=t&lu.JUMP_TABLE;if(i===0)return s!==0&&r===s?n:-1;if(s){const u=r-s;return u<0||u>=i?-1:e[n+u]-1}let o=n,a=o+i-1;for(;o<=a;){const u=o+a>>>1,l=e[u];if(lr)a=u-1;else return e[u+i]}return-1}CZ(ic);CZ(ELe);var Ee;(function(e){e.HTML="http://www.w3.org/1999/xhtml",e.MATHML="http://www.w3.org/1998/Math/MathML",e.SVG="http://www.w3.org/2000/svg",e.XLINK="http://www.w3.org/1999/xlink",e.XML="http://www.w3.org/XML/1998/namespace",e.XMLNS="http://www.w3.org/2000/xmlns/"})(Ee=Ee||(Ee={}));var Vc;(function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"})(Vc=Vc||(Vc={}));var eo;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(eo=eo||(eo={}));var oe;(function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"})(oe=oe||(oe={}));var v;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SECTION=94]="SECTION",e[e.SELECT=95]="SELECT",e[e.SOURCE=96]="SOURCE",e[e.SMALL=97]="SMALL",e[e.SPAN=98]="SPAN",e[e.STRIKE=99]="STRIKE",e[e.STRONG=100]="STRONG",e[e.STYLE=101]="STYLE",e[e.SUB=102]="SUB",e[e.SUMMARY=103]="SUMMARY",e[e.SUP=104]="SUP",e[e.TABLE=105]="TABLE",e[e.TBODY=106]="TBODY",e[e.TEMPLATE=107]="TEMPLATE",e[e.TEXTAREA=108]="TEXTAREA",e[e.TFOOT=109]="TFOOT",e[e.TD=110]="TD",e[e.TH=111]="TH",e[e.THEAD=112]="THEAD",e[e.TITLE=113]="TITLE",e[e.TR=114]="TR",e[e.TRACK=115]="TRACK",e[e.TT=116]="TT",e[e.U=117]="U",e[e.UL=118]="UL",e[e.SVG=119]="SVG",e[e.VAR=120]="VAR",e[e.WBR=121]="WBR",e[e.XMP=122]="XMP"})(v=v||(v={}));const PLe=new Map([[oe.A,v.A],[oe.ADDRESS,v.ADDRESS],[oe.ANNOTATION_XML,v.ANNOTATION_XML],[oe.APPLET,v.APPLET],[oe.AREA,v.AREA],[oe.ARTICLE,v.ARTICLE],[oe.ASIDE,v.ASIDE],[oe.B,v.B],[oe.BASE,v.BASE],[oe.BASEFONT,v.BASEFONT],[oe.BGSOUND,v.BGSOUND],[oe.BIG,v.BIG],[oe.BLOCKQUOTE,v.BLOCKQUOTE],[oe.BODY,v.BODY],[oe.BR,v.BR],[oe.BUTTON,v.BUTTON],[oe.CAPTION,v.CAPTION],[oe.CENTER,v.CENTER],[oe.CODE,v.CODE],[oe.COL,v.COL],[oe.COLGROUP,v.COLGROUP],[oe.DD,v.DD],[oe.DESC,v.DESC],[oe.DETAILS,v.DETAILS],[oe.DIALOG,v.DIALOG],[oe.DIR,v.DIR],[oe.DIV,v.DIV],[oe.DL,v.DL],[oe.DT,v.DT],[oe.EM,v.EM],[oe.EMBED,v.EMBED],[oe.FIELDSET,v.FIELDSET],[oe.FIGCAPTION,v.FIGCAPTION],[oe.FIGURE,v.FIGURE],[oe.FONT,v.FONT],[oe.FOOTER,v.FOOTER],[oe.FOREIGN_OBJECT,v.FOREIGN_OBJECT],[oe.FORM,v.FORM],[oe.FRAME,v.FRAME],[oe.FRAMESET,v.FRAMESET],[oe.H1,v.H1],[oe.H2,v.H2],[oe.H3,v.H3],[oe.H4,v.H4],[oe.H5,v.H5],[oe.H6,v.H6],[oe.HEAD,v.HEAD],[oe.HEADER,v.HEADER],[oe.HGROUP,v.HGROUP],[oe.HR,v.HR],[oe.HTML,v.HTML],[oe.I,v.I],[oe.IMG,v.IMG],[oe.IMAGE,v.IMAGE],[oe.INPUT,v.INPUT],[oe.IFRAME,v.IFRAME],[oe.KEYGEN,v.KEYGEN],[oe.LABEL,v.LABEL],[oe.LI,v.LI],[oe.LINK,v.LINK],[oe.LISTING,v.LISTING],[oe.MAIN,v.MAIN],[oe.MALIGNMARK,v.MALIGNMARK],[oe.MARQUEE,v.MARQUEE],[oe.MATH,v.MATH],[oe.MENU,v.MENU],[oe.META,v.META],[oe.MGLYPH,v.MGLYPH],[oe.MI,v.MI],[oe.MO,v.MO],[oe.MN,v.MN],[oe.MS,v.MS],[oe.MTEXT,v.MTEXT],[oe.NAV,v.NAV],[oe.NOBR,v.NOBR],[oe.NOFRAMES,v.NOFRAMES],[oe.NOEMBED,v.NOEMBED],[oe.NOSCRIPT,v.NOSCRIPT],[oe.OBJECT,v.OBJECT],[oe.OL,v.OL],[oe.OPTGROUP,v.OPTGROUP],[oe.OPTION,v.OPTION],[oe.P,v.P],[oe.PARAM,v.PARAM],[oe.PLAINTEXT,v.PLAINTEXT],[oe.PRE,v.PRE],[oe.RB,v.RB],[oe.RP,v.RP],[oe.RT,v.RT],[oe.RTC,v.RTC],[oe.RUBY,v.RUBY],[oe.S,v.S],[oe.SCRIPT,v.SCRIPT],[oe.SECTION,v.SECTION],[oe.SELECT,v.SELECT],[oe.SOURCE,v.SOURCE],[oe.SMALL,v.SMALL],[oe.SPAN,v.SPAN],[oe.STRIKE,v.STRIKE],[oe.STRONG,v.STRONG],[oe.STYLE,v.STYLE],[oe.SUB,v.SUB],[oe.SUMMARY,v.SUMMARY],[oe.SUP,v.SUP],[oe.TABLE,v.TABLE],[oe.TBODY,v.TBODY],[oe.TEMPLATE,v.TEMPLATE],[oe.TEXTAREA,v.TEXTAREA],[oe.TFOOT,v.TFOOT],[oe.TD,v.TD],[oe.TH,v.TH],[oe.THEAD,v.THEAD],[oe.TITLE,v.TITLE],[oe.TR,v.TR],[oe.TRACK,v.TRACK],[oe.TT,v.TT],[oe.U,v.U],[oe.UL,v.UL],[oe.SVG,v.SVG],[oe.VAR,v.VAR],[oe.WBR,v.WBR],[oe.XMP,v.XMP]]);function Wm(e){var t;return(t=PLe.get(e))!==null&&t!==void 0?t:v.UNKNOWN}const Ae=v,RLe={[Ee.HTML]:new Set([Ae.ADDRESS,Ae.APPLET,Ae.AREA,Ae.ARTICLE,Ae.ASIDE,Ae.BASE,Ae.BASEFONT,Ae.BGSOUND,Ae.BLOCKQUOTE,Ae.BODY,Ae.BR,Ae.BUTTON,Ae.CAPTION,Ae.CENTER,Ae.COL,Ae.COLGROUP,Ae.DD,Ae.DETAILS,Ae.DIR,Ae.DIV,Ae.DL,Ae.DT,Ae.EMBED,Ae.FIELDSET,Ae.FIGCAPTION,Ae.FIGURE,Ae.FOOTER,Ae.FORM,Ae.FRAME,Ae.FRAMESET,Ae.H1,Ae.H2,Ae.H3,Ae.H4,Ae.H5,Ae.H6,Ae.HEAD,Ae.HEADER,Ae.HGROUP,Ae.HR,Ae.HTML,Ae.IFRAME,Ae.IMG,Ae.INPUT,Ae.LI,Ae.LINK,Ae.LISTING,Ae.MAIN,Ae.MARQUEE,Ae.MENU,Ae.META,Ae.NAV,Ae.NOEMBED,Ae.NOFRAMES,Ae.NOSCRIPT,Ae.OBJECT,Ae.OL,Ae.P,Ae.PARAM,Ae.PLAINTEXT,Ae.PRE,Ae.SCRIPT,Ae.SECTION,Ae.SELECT,Ae.SOURCE,Ae.STYLE,Ae.SUMMARY,Ae.TABLE,Ae.TBODY,Ae.TD,Ae.TEMPLATE,Ae.TEXTAREA,Ae.TFOOT,Ae.TH,Ae.THEAD,Ae.TITLE,Ae.TR,Ae.TRACK,Ae.UL,Ae.WBR,Ae.XMP]),[Ee.MATHML]:new Set([Ae.MI,Ae.MO,Ae.MN,Ae.MS,Ae.MTEXT,Ae.ANNOTATION_XML]),[Ee.SVG]:new Set([Ae.TITLE,Ae.FOREIGN_OBJECT,Ae.DESC]),[Ee.XLINK]:new Set,[Ee.XML]:new Set,[Ee.XMLNS]:new Set};function OZ(e){return e===Ae.H1||e===Ae.H2||e===Ae.H3||e===Ae.H4||e===Ae.H5||e===Ae.H6}oe.STYLE,oe.SCRIPT,oe.XMP,oe.IFRAME,oe.NOEMBED,oe.NOFRAMES,oe.PLAINTEXT;const NLe=new Map([[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);var B;(function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.NAMED_CHARACTER_REFERENCE=72]="NAMED_CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=73]="AMBIGUOUS_AMPERSAND",e[e.NUMERIC_CHARACTER_REFERENCE=74]="NUMERIC_CHARACTER_REFERENCE",e[e.HEXADEMICAL_CHARACTER_REFERENCE_START=75]="HEXADEMICAL_CHARACTER_REFERENCE_START",e[e.HEXADEMICAL_CHARACTER_REFERENCE=76]="HEXADEMICAL_CHARACTER_REFERENCE",e[e.DECIMAL_CHARACTER_REFERENCE=77]="DECIMAL_CHARACTER_REFERENCE",e[e.NUMERIC_CHARACTER_REFERENCE_END=78]="NUMERIC_CHARACTER_REFERENCE_END"})(B||(B={}));const Dr={DATA:B.DATA,RCDATA:B.RCDATA,RAWTEXT:B.RAWTEXT,SCRIPT_DATA:B.SCRIPT_DATA,PLAINTEXT:B.PLAINTEXT,CDATA_SECTION:B.CDATA_SECTION};function F0(e){return e>=L.DIGIT_0&&e<=L.DIGIT_9}function o0(e){return e>=L.LATIN_CAPITAL_A&&e<=L.LATIN_CAPITAL_Z}function kLe(e){return e>=L.LATIN_SMALL_A&&e<=L.LATIN_SMALL_Z}function sc(e){return kLe(e)||o0(e)}function S2(e){return sc(e)||F0(e)}function PZ(e){return e>=L.LATIN_CAPITAL_A&&e<=L.LATIN_CAPITAL_F}function RZ(e){return e>=L.LATIN_SMALL_A&&e<=L.LATIN_SMALL_F}function DLe(e){return F0(e)||PZ(e)||RZ(e)}function c1(e){return e+32}function NZ(e){return e===L.SPACE||e===L.LINE_FEED||e===L.TABULATION||e===L.FORM_FEED}function $Le(e){return e===L.EQUALS_SIGN||S2(e)}function sj(e){return NZ(e)||e===L.SOLIDUS||e===L.GREATER_THAN_SIGN}class LLe{constructor(t,n){this.options=t,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=B.DATA,this.returnState=B.DATA,this.charRefCode=-1,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new bLe(n),this.currentLocation=this.getCurrentLocation(-1)}_err(t){var n,r;(r=(n=this.handler).onParseError)===null||r===void 0||r.call(n,this.preprocessor.getError(t))}getCurrentLocation(t){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-t,startOffset:this.preprocessor.offset-t,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const t=this._consume();this._ensureHibernation()||this._callState(t)}this.inLoop=!1}}pause(){this.paused=!0}resume(t){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||t==null||t())}write(t,n,r){this.active=!0,this.preprocessor.write(t,n),this._runParsingLoop(),this.paused||r==null||r()}insertHtmlAtCurrentPos(t){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(t),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this._unconsume(this.consumedAfterSnapshot),this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_unconsume(t){this.consumedAfterSnapshot-=t,this.preprocessor.retreat(t)}_reconsumeInState(t,n){this.state=t,this._callState(n)}_advanceBy(t){this.consumedAfterSnapshot+=t;for(let n=0;n0&&this._err(_e.endTagWithAttributes),t.selfClosing&&this._err(_e.endTagWithTrailingSolidus),this.handler.onEndTag(t)),this.preprocessor.dropParsedChunk()}emitCurrentComment(t){this.prepareToken(t),this.handler.onComment(t),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(t){this.prepareToken(t),this.handler.onDoctype(t),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(t){if(this.currentCharacterToken){switch(t&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=t.startLine,this.currentCharacterToken.location.endCol=t.startCol,this.currentCharacterToken.location.endOffset=t.startOffset),this.currentCharacterToken.type){case Ht.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case Ht.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case Ht.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const t=this.getCurrentLocation(0);t&&(t.endLine=t.startLine,t.endCol=t.startCol,t.endOffset=t.startOffset),this._emitCurrentCharacterToken(t),this.handler.onEof({type:Ht.EOF,location:t}),this.active=!1}_appendCharToCurrentCharacterToken(t,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type!==t)this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();else{this.currentCharacterToken.chars+=n;return}this._createCharacterToken(t,n)}_emitCodePoint(t){const n=NZ(t)?Ht.WHITESPACE_CHARACTER:t===L.NULL?Ht.NULL_CHARACTER:Ht.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(Ht.CHARACTER,t)}_matchNamedCharacterReference(t){let n=null,r=0,i=!1;for(let s=0,o=ic[0];s>=0&&(s=AZ(ic,o,s+1,t),!(s<0));t=this._consume()){r+=1,o=ic[s];const a=o&lu.VALUE_LENGTH;if(a){const u=(a>>14)-1;if(t!==L.SEMICOLON&&this._isCharacterReferenceInAttribute()&&$Le(this.preprocessor.peek(1))?(n=[L.AMPERSAND],s+=u):(n=u===0?[ic[s]&~lu.VALUE_LENGTH]:u===1?[ic[++s]]:[ic[++s],ic[++s]],r=0,i=t!==L.SEMICOLON),u===0){this._consume();break}}}return this._unconsume(r),i&&!this.preprocessor.endOfChunkHit&&this._err(_e.missingSemicolonAfterCharacterReference),this._unconsume(1),n}_isCharacterReferenceInAttribute(){return this.returnState===B.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===B.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===B.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case B.DATA:{this._stateData(t);break}case B.RCDATA:{this._stateRcdata(t);break}case B.RAWTEXT:{this._stateRawtext(t);break}case B.SCRIPT_DATA:{this._stateScriptData(t);break}case B.PLAINTEXT:{this._statePlaintext(t);break}case B.TAG_OPEN:{this._stateTagOpen(t);break}case B.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case B.TAG_NAME:{this._stateTagName(t);break}case B.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case B.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case B.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case B.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case B.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case B.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case B.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case B.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case B.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case B.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case B.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case B.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case B.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case B.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case B.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case B.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case B.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case B.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case B.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case B.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case B.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case B.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case B.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case B.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case B.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case B.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case B.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case B.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case B.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case B.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case B.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case B.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case B.BOGUS_COMMENT:{this._stateBogusComment(t);break}case B.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case B.COMMENT_START:{this._stateCommentStart(t);break}case B.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case B.COMMENT:{this._stateComment(t);break}case B.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case B.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case B.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case B.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case B.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case B.COMMENT_END:{this._stateCommentEnd(t);break}case B.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case B.DOCTYPE:{this._stateDoctype(t);break}case B.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case B.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case B.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case B.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case B.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case B.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case B.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case B.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case B.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case B.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case B.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case B.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case B.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case B.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case B.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case B.CDATA_SECTION:{this._stateCdataSection(t);break}case B.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case B.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case B.CHARACTER_REFERENCE:{this._stateCharacterReference(t);break}case B.NAMED_CHARACTER_REFERENCE:{this._stateNamedCharacterReference(t);break}case B.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}case B.NUMERIC_CHARACTER_REFERENCE:{this._stateNumericCharacterReference(t);break}case B.HEXADEMICAL_CHARACTER_REFERENCE_START:{this._stateHexademicalCharacterReferenceStart(t);break}case B.HEXADEMICAL_CHARACTER_REFERENCE:{this._stateHexademicalCharacterReference(t);break}case B.DECIMAL_CHARACTER_REFERENCE:{this._stateDecimalCharacterReference(t);break}case B.NUMERIC_CHARACTER_REFERENCE_END:{this._stateNumericCharacterReferenceEnd(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case L.LESS_THAN_SIGN:{this.state=B.TAG_OPEN;break}case L.AMPERSAND:{this.returnState=B.DATA,this.state=B.CHARACTER_REFERENCE;break}case L.NULL:{this._err(_e.unexpectedNullCharacter),this._emitCodePoint(t);break}case L.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case L.AMPERSAND:{this.returnState=B.RCDATA,this.state=B.CHARACTER_REFERENCE;break}case L.LESS_THAN_SIGN:{this.state=B.RCDATA_LESS_THAN_SIGN;break}case L.NULL:{this._err(_e.unexpectedNullCharacter),this._emitChars(sr);break}case L.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case L.LESS_THAN_SIGN:{this.state=B.RAWTEXT_LESS_THAN_SIGN;break}case L.NULL:{this._err(_e.unexpectedNullCharacter),this._emitChars(sr);break}case L.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case L.LESS_THAN_SIGN:{this.state=B.SCRIPT_DATA_LESS_THAN_SIGN;break}case L.NULL:{this._err(_e.unexpectedNullCharacter),this._emitChars(sr);break}case L.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case L.NULL:{this._err(_e.unexpectedNullCharacter),this._emitChars(sr);break}case L.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(sc(t))this._createStartTagToken(),this.state=B.TAG_NAME,this._stateTagName(t);else switch(t){case L.EXCLAMATION_MARK:{this.state=B.MARKUP_DECLARATION_OPEN;break}case L.SOLIDUS:{this.state=B.END_TAG_OPEN;break}case L.QUESTION_MARK:{this._err(_e.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=B.BOGUS_COMMENT,this._stateBogusComment(t);break}case L.EOF:{this._err(_e.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(_e.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=B.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(sc(t))this._createEndTagToken(),this.state=B.TAG_NAME,this._stateTagName(t);else switch(t){case L.GREATER_THAN_SIGN:{this._err(_e.missingEndTagName),this.state=B.DATA;break}case L.EOF:{this._err(_e.eofBeforeTagName),this._emitChars("");break}case L.NULL:{this._err(_e.unexpectedNullCharacter),this.state=B.SCRIPT_DATA_ESCAPED,this._emitChars(sr);break}case L.EOF:{this._err(_e.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=B.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===L.SOLIDUS?this.state=B.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:sc(t)?(this._emitChars("<"),this.state=B.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=B.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){sc(t)?(this.state=B.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("");break}case L.NULL:{this._err(_e.unexpectedNullCharacter),this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(sr);break}case L.EOF:{this._err(_e.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===L.SOLIDUS?(this.state=B.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(_s.SCRIPT,!1)&&sj(this.preprocessor.peek(_s.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<_s.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=B.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateBeforeAttributeName(t){switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:break;case L.SOLIDUS:case L.GREATER_THAN_SIGN:case L.EOF:{this.state=B.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case L.EQUALS_SIGN:{this._err(_e.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=B.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=B.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateAttributeName(t){switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:case L.SOLIDUS:case L.GREATER_THAN_SIGN:case L.EOF:{this._leaveAttrName(),this.state=B.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case L.EQUALS_SIGN:{this._leaveAttrName(),this.state=B.BEFORE_ATTRIBUTE_VALUE;break}case L.QUOTATION_MARK:case L.APOSTROPHE:case L.LESS_THAN_SIGN:{this._err(_e.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case L.NULL:{this._err(_e.unexpectedNullCharacter),this.currentAttr.name+=sr;break}default:this.currentAttr.name+=String.fromCodePoint(o0(t)?c1(t):t)}}_stateAfterAttributeName(t){switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:break;case L.SOLIDUS:{this.state=B.SELF_CLOSING_START_TAG;break}case L.EQUALS_SIGN:{this.state=B.BEFORE_ATTRIBUTE_VALUE;break}case L.GREATER_THAN_SIGN:{this.state=B.DATA,this.emitCurrentTagToken();break}case L.EOF:{this._err(_e.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=B.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateBeforeAttributeValue(t){switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:break;case L.QUOTATION_MARK:{this.state=B.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case L.APOSTROPHE:{this.state=B.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case L.GREATER_THAN_SIGN:{this._err(_e.missingAttributeValue),this.state=B.DATA,this.emitCurrentTagToken();break}default:this.state=B.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case L.QUOTATION_MARK:{this.state=B.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case L.AMPERSAND:{this.returnState=B.ATTRIBUTE_VALUE_DOUBLE_QUOTED,this.state=B.CHARACTER_REFERENCE;break}case L.NULL:{this._err(_e.unexpectedNullCharacter),this.currentAttr.value+=sr;break}case L.EOF:{this._err(_e.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case L.APOSTROPHE:{this.state=B.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case L.AMPERSAND:{this.returnState=B.ATTRIBUTE_VALUE_SINGLE_QUOTED,this.state=B.CHARACTER_REFERENCE;break}case L.NULL:{this._err(_e.unexpectedNullCharacter),this.currentAttr.value+=sr;break}case L.EOF:{this._err(_e.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueUnquoted(t){switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:{this._leaveAttrValue(),this.state=B.BEFORE_ATTRIBUTE_NAME;break}case L.AMPERSAND:{this.returnState=B.ATTRIBUTE_VALUE_UNQUOTED,this.state=B.CHARACTER_REFERENCE;break}case L.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=B.DATA,this.emitCurrentTagToken();break}case L.NULL:{this._err(_e.unexpectedNullCharacter),this.currentAttr.value+=sr;break}case L.QUOTATION_MARK:case L.APOSTROPHE:case L.LESS_THAN_SIGN:case L.EQUALS_SIGN:case L.GRAVE_ACCENT:{this._err(_e.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case L.EOF:{this._err(_e.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAfterAttributeValueQuoted(t){switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:{this._leaveAttrValue(),this.state=B.BEFORE_ATTRIBUTE_NAME;break}case L.SOLIDUS:{this._leaveAttrValue(),this.state=B.SELF_CLOSING_START_TAG;break}case L.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=B.DATA,this.emitCurrentTagToken();break}case L.EOF:{this._err(_e.eofInTag),this._emitEOFToken();break}default:this._err(_e.missingWhitespaceBetweenAttributes),this.state=B.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case L.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=B.DATA,this.emitCurrentTagToken();break}case L.EOF:{this._err(_e.eofInTag),this._emitEOFToken();break}default:this._err(_e.unexpectedSolidusInTag),this.state=B.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){const n=this.currentToken;switch(t){case L.GREATER_THAN_SIGN:{this.state=B.DATA,this.emitCurrentComment(n);break}case L.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case L.NULL:{this._err(_e.unexpectedNullCharacter),n.data+=sr;break}default:n.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch(_s.DASH_DASH,!0)?(this._createCommentToken(_s.DASH_DASH.length+1),this.state=B.COMMENT_START):this._consumeSequenceIfMatch(_s.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(_s.DOCTYPE.length+1),this.state=B.DOCTYPE):this._consumeSequenceIfMatch(_s.CDATA_START,!0)?this.inForeignNode?this.state=B.CDATA_SECTION:(this._err(_e.cdataInHtmlContent),this._createCommentToken(_s.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=B.BOGUS_COMMENT):this._ensureHibernation()||(this._err(_e.incorrectlyOpenedComment),this._createCommentToken(2),this.state=B.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case L.HYPHEN_MINUS:{this.state=B.COMMENT_START_DASH;break}case L.GREATER_THAN_SIGN:{this._err(_e.abruptClosingOfEmptyComment),this.state=B.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=B.COMMENT,this._stateComment(t)}}_stateCommentStartDash(t){const n=this.currentToken;switch(t){case L.HYPHEN_MINUS:{this.state=B.COMMENT_END;break}case L.GREATER_THAN_SIGN:{this._err(_e.abruptClosingOfEmptyComment),this.state=B.DATA,this.emitCurrentComment(n);break}case L.EOF:{this._err(_e.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=B.COMMENT,this._stateComment(t)}}_stateComment(t){const n=this.currentToken;switch(t){case L.HYPHEN_MINUS:{this.state=B.COMMENT_END_DASH;break}case L.LESS_THAN_SIGN:{n.data+="<",this.state=B.COMMENT_LESS_THAN_SIGN;break}case L.NULL:{this._err(_e.unexpectedNullCharacter),n.data+=sr;break}case L.EOF:{this._err(_e.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(t)}}_stateCommentLessThanSign(t){const n=this.currentToken;switch(t){case L.EXCLAMATION_MARK:{n.data+="!",this.state=B.COMMENT_LESS_THAN_SIGN_BANG;break}case L.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=B.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===L.HYPHEN_MINUS?this.state=B.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=B.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===L.HYPHEN_MINUS?this.state=B.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=B.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==L.GREATER_THAN_SIGN&&t!==L.EOF&&this._err(_e.nestedComment),this.state=B.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){const n=this.currentToken;switch(t){case L.HYPHEN_MINUS:{this.state=B.COMMENT_END;break}case L.EOF:{this._err(_e.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=B.COMMENT,this._stateComment(t)}}_stateCommentEnd(t){const n=this.currentToken;switch(t){case L.GREATER_THAN_SIGN:{this.state=B.DATA,this.emitCurrentComment(n);break}case L.EXCLAMATION_MARK:{this.state=B.COMMENT_END_BANG;break}case L.HYPHEN_MINUS:{n.data+="-";break}case L.EOF:{this._err(_e.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=B.COMMENT,this._stateComment(t)}}_stateCommentEndBang(t){const n=this.currentToken;switch(t){case L.HYPHEN_MINUS:{n.data+="--!",this.state=B.COMMENT_END_DASH;break}case L.GREATER_THAN_SIGN:{this._err(_e.incorrectlyClosedComment),this.state=B.DATA,this.emitCurrentComment(n);break}case L.EOF:{this._err(_e.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=B.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:{this.state=B.BEFORE_DOCTYPE_NAME;break}case L.GREATER_THAN_SIGN:{this.state=B.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case L.EOF:{this._err(_e.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(_e.missingWhitespaceBeforeDoctypeName),this.state=B.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(o0(t))this._createDoctypeToken(String.fromCharCode(c1(t))),this.state=B.DOCTYPE_NAME;else switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:break;case L.NULL:{this._err(_e.unexpectedNullCharacter),this._createDoctypeToken(sr),this.state=B.DOCTYPE_NAME;break}case L.GREATER_THAN_SIGN:{this._err(_e.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=B.DATA;break}case L.EOF:{this._err(_e.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(t)),this.state=B.DOCTYPE_NAME}}_stateDoctypeName(t){const n=this.currentToken;switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:{this.state=B.AFTER_DOCTYPE_NAME;break}case L.GREATER_THAN_SIGN:{this.state=B.DATA,this.emitCurrentDoctype(n);break}case L.NULL:{this._err(_e.unexpectedNullCharacter),n.name+=sr;break}case L.EOF:{this._err(_e.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(o0(t)?c1(t):t)}}_stateAfterDoctypeName(t){const n=this.currentToken;switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:break;case L.GREATER_THAN_SIGN:{this.state=B.DATA,this.emitCurrentDoctype(n);break}case L.EOF:{this._err(_e.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(_s.PUBLIC,!1)?this.state=B.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(_s.SYSTEM,!1)?this.state=B.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(_e.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=B.BOGUS_DOCTYPE,this._stateBogusDoctype(t))}}_stateAfterDoctypePublicKeyword(t){const n=this.currentToken;switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:{this.state=B.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case L.QUOTATION_MARK:{this._err(_e.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=B.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case L.APOSTROPHE:{this._err(_e.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=B.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case L.GREATER_THAN_SIGN:{this._err(_e.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=B.DATA,this.emitCurrentDoctype(n);break}case L.EOF:{this._err(_e.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(_e.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=B.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:break;case L.QUOTATION_MARK:{n.publicId="",this.state=B.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case L.APOSTROPHE:{n.publicId="",this.state=B.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case L.GREATER_THAN_SIGN:{this._err(_e.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=B.DATA,this.emitCurrentDoctype(n);break}case L.EOF:{this._err(_e.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(_e.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=B.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case L.QUOTATION_MARK:{this.state=B.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case L.NULL:{this._err(_e.unexpectedNullCharacter),n.publicId+=sr;break}case L.GREATER_THAN_SIGN:{this._err(_e.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=B.DATA;break}case L.EOF:{this._err(_e.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateDoctypePublicIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case L.APOSTROPHE:{this.state=B.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case L.NULL:{this._err(_e.unexpectedNullCharacter),n.publicId+=sr;break}case L.GREATER_THAN_SIGN:{this._err(_e.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=B.DATA;break}case L.EOF:{this._err(_e.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateAfterDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:{this.state=B.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case L.GREATER_THAN_SIGN:{this.state=B.DATA,this.emitCurrentDoctype(n);break}case L.QUOTATION_MARK:{this._err(_e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=B.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case L.APOSTROPHE:{this._err(_e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=B.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case L.EOF:{this._err(_e.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(_e.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=B.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBetweenDoctypePublicAndSystemIdentifiers(t){const n=this.currentToken;switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:break;case L.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=B.DATA;break}case L.QUOTATION_MARK:{n.systemId="",this.state=B.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case L.APOSTROPHE:{n.systemId="",this.state=B.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case L.EOF:{this._err(_e.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(_e.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=B.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateAfterDoctypeSystemKeyword(t){const n=this.currentToken;switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:{this.state=B.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case L.QUOTATION_MARK:{this._err(_e.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=B.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case L.APOSTROPHE:{this._err(_e.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=B.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case L.GREATER_THAN_SIGN:{this._err(_e.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=B.DATA,this.emitCurrentDoctype(n);break}case L.EOF:{this._err(_e.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(_e.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=B.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:break;case L.QUOTATION_MARK:{n.systemId="",this.state=B.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case L.APOSTROPHE:{n.systemId="",this.state=B.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case L.GREATER_THAN_SIGN:{this._err(_e.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=B.DATA,this.emitCurrentDoctype(n);break}case L.EOF:{this._err(_e.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(_e.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=B.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case L.QUOTATION_MARK:{this.state=B.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case L.NULL:{this._err(_e.unexpectedNullCharacter),n.systemId+=sr;break}case L.GREATER_THAN_SIGN:{this._err(_e.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=B.DATA;break}case L.EOF:{this._err(_e.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateDoctypeSystemIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case L.APOSTROPHE:{this.state=B.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case L.NULL:{this._err(_e.unexpectedNullCharacter),n.systemId+=sr;break}case L.GREATER_THAN_SIGN:{this._err(_e.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=B.DATA;break}case L.EOF:{this._err(_e.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateAfterDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:break;case L.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=B.DATA;break}case L.EOF:{this._err(_e.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(_e.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=B.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){const n=this.currentToken;switch(t){case L.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=B.DATA;break}case L.NULL:{this._err(_e.unexpectedNullCharacter);break}case L.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(t){switch(t){case L.RIGHT_SQUARE_BRACKET:{this.state=B.CDATA_SECTION_BRACKET;break}case L.EOF:{this._err(_e.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===L.RIGHT_SQUARE_BRACKET?this.state=B.CDATA_SECTION_END:(this._emitChars("]"),this.state=B.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case L.GREATER_THAN_SIGN:{this.state=B.DATA;break}case L.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=B.CDATA_SECTION,this._stateCdataSection(t)}}_stateCharacterReference(t){t===L.NUMBER_SIGN?this.state=B.NUMERIC_CHARACTER_REFERENCE:S2(t)?(this.state=B.NAMED_CHARACTER_REFERENCE,this._stateNamedCharacterReference(t)):(this._flushCodePointConsumedAsCharacterReference(L.AMPERSAND),this._reconsumeInState(this.returnState,t))}_stateNamedCharacterReference(t){const n=this._matchNamedCharacterReference(t);if(!this._ensureHibernation())if(n){for(let r=0;r1114111)this._err(_e.characterReferenceOutsideUnicodeRange),this.charRefCode=L.REPLACEMENT_CHARACTER;else if(TZ(this.charRefCode))this._err(_e.surrogateCharacterReference),this.charRefCode=L.REPLACEMENT_CHARACTER;else if(IZ(this.charRefCode))this._err(_e.noncharacterCharacterReference);else if(SZ(this.charRefCode)||this.charRefCode===L.CARRIAGE_RETURN){this._err(_e.controlCharacterReference);const n=NLe.get(this.charRefCode);n!==void 0&&(this.charRefCode=n)}this._flushCodePointConsumedAsCharacterReference(this.charRefCode),this._reconsumeInState(this.returnState,t)}}const kZ=new Set([v.DD,v.DT,v.LI,v.OPTGROUP,v.OPTION,v.P,v.RB,v.RP,v.RT,v.RTC]),oj=new Set([...kZ,v.CAPTION,v.COLGROUP,v.TBODY,v.TD,v.TFOOT,v.TH,v.THEAD,v.TR]),f1=new Map([[v.APPLET,Ee.HTML],[v.CAPTION,Ee.HTML],[v.HTML,Ee.HTML],[v.MARQUEE,Ee.HTML],[v.OBJECT,Ee.HTML],[v.TABLE,Ee.HTML],[v.TD,Ee.HTML],[v.TEMPLATE,Ee.HTML],[v.TH,Ee.HTML],[v.ANNOTATION_XML,Ee.MATHML],[v.MI,Ee.MATHML],[v.MN,Ee.MATHML],[v.MO,Ee.MATHML],[v.MS,Ee.MATHML],[v.MTEXT,Ee.MATHML],[v.DESC,Ee.SVG],[v.FOREIGN_OBJECT,Ee.SVG],[v.TITLE,Ee.SVG]]),MLe=[v.H1,v.H2,v.H3,v.H4,v.H5,v.H6],FLe=[v.TR,v.TEMPLATE,v.HTML],BLe=[v.TBODY,v.TFOOT,v.THEAD,v.TEMPLATE,v.HTML],jLe=[v.TABLE,v.TEMPLATE,v.HTML],ULe=[v.TD,v.TH];class VLe{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(t,n,r){this.treeAdapter=n,this.handler=r,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=v.UNKNOWN,this.current=t}_indexOf(t){return this.items.lastIndexOf(t,this.stackTop)}_isInTemplate(){return this.currentTagId===v.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===Ee.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(t,n){this.stackTop++,this.items[this.stackTop]=t,this.current=t,this.tagIDs[this.stackTop]=n,this.currentTagId=n,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(t,n,!0)}pop(){const t=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!0)}replace(t,n){const r=this._indexOf(t);this.items[r]=n,r===this.stackTop&&(this.current=n)}insertAfter(t,n,r){const i=this._indexOf(t)+1;this.items.splice(i,0,n),this.tagIDs.splice(i,0,r),this.stackTop++,i===this.stackTop&&this._updateCurrentElement(),this.handler.onItemPush(this.current,this.currentTagId,i===this.stackTop)}popUntilTagNamePopped(t){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(t,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==Ee.HTML);this.shortenToLength(n<0?0:n)}shortenToLength(t){for(;this.stackTop>=t;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop=0;r--)if(t.includes(this.tagIDs[r])&&this.treeAdapter.getNamespaceURI(this.items[r])===n)return r;return-1}clearBackTo(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(r+1)}clearBackToTableContext(){this.clearBackTo(jLe,Ee.HTML)}clearBackToTableBodyContext(){this.clearBackTo(BLe,Ee.HTML)}clearBackToTableRowContext(){this.clearBackTo(FLe,Ee.HTML)}remove(t){const n=this._indexOf(t);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===v.BODY?this.items[1]:null}contains(t){return this._indexOf(t)>-1}getCommonAncestor(t){const n=this._indexOf(t)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===v.HTML}hasInScope(t){for(let n=this.stackTop;n>=0;n--){const r=this.tagIDs[n],i=this.treeAdapter.getNamespaceURI(this.items[n]);if(r===t&&i===Ee.HTML)return!0;if(f1.get(r)===i)return!1}return!0}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t],r=this.treeAdapter.getNamespaceURI(this.items[t]);if(OZ(n)&&r===Ee.HTML)return!0;if(f1.get(n)===r)return!1}return!0}hasInListItemScope(t){for(let n=this.stackTop;n>=0;n--){const r=this.tagIDs[n],i=this.treeAdapter.getNamespaceURI(this.items[n]);if(r===t&&i===Ee.HTML)return!0;if((r===v.UL||r===v.OL)&&i===Ee.HTML||f1.get(r)===i)return!1}return!0}hasInButtonScope(t){for(let n=this.stackTop;n>=0;n--){const r=this.tagIDs[n],i=this.treeAdapter.getNamespaceURI(this.items[n]);if(r===t&&i===Ee.HTML)return!0;if(r===v.BUTTON&&i===Ee.HTML||f1.get(r)===i)return!1}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--){const r=this.tagIDs[n];if(this.treeAdapter.getNamespaceURI(this.items[n])===Ee.HTML){if(r===t)return!0;if(r===v.TABLE||r===v.TEMPLATE||r===v.HTML)return!1}}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];if(this.treeAdapter.getNamespaceURI(this.items[t])===Ee.HTML){if(n===v.TBODY||n===v.THEAD||n===v.TFOOT)return!0;if(n===v.TABLE||n===v.HTML)return!1}}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--){const r=this.tagIDs[n];if(this.treeAdapter.getNamespaceURI(this.items[n])===Ee.HTML){if(r===t)return!0;if(r!==v.OPTION&&r!==v.OPTGROUP)return!1}}return!0}generateImpliedEndTags(){for(;kZ.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;oj.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==t&&oj.has(this.currentTagId);)this.pop()}}const IA=3;var ga;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(ga=ga||(ga={}));const aj={type:ga.Marker};class zLe{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const r=[],i=n.length,s=this.treeAdapter.getTagName(t),o=this.treeAdapter.getNamespaceURI(t);for(let a=0;a[o.name,o.value]));let s=0;for(let o=0;oi.get(u.name)===u.value)&&(s+=1,s>=IA&&this.entries.splice(a.idx,1))}}insertMarker(){this.entries.unshift(aj)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:ga.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:ga.Element,element:t,token:n})}removeEntry(t){const n=this.entries.indexOf(t);n>=0&&this.entries.splice(n,1)}clearToLastMarker(){const t=this.entries.indexOf(aj);t>=0?this.entries.splice(0,t+1):this.entries.length=0}getElementEntryInScopeWithTagName(t){const n=this.entries.find(r=>r.type===ga.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===ga.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===ga.Element&&n.element===t)}}function uj(e){return{nodeName:"#text",value:e,parentNode:null}}const Ph={createDocument(){return{nodeName:"#document",mode:eo.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:"#comment",data:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){const r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){const i=e.childNodes.find(s=>s.nodeName==="#documentType");if(i)i.name=t,i.publicId=n,i.systemId=r;else{const s={nodeName:"#documentType",name:t,publicId:n,systemId:r,parentNode:null};Ph.appendChild(e,s)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){const n=e.childNodes[e.childNodes.length-1];if(Ph.isTextNode(n)){n.value+=t;return}}Ph.appendChild(e,uj(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&Ph.isTextNode(r)?r.value+=t:Ph.insertBefore(e,uj(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(r=>r.name));for(let r=0;re.startsWith(n))}function KLe(e){return e.name===DZ&&e.publicId===null&&(e.systemId===null||e.systemId===HLe)}function QLe(e){if(e.name!==DZ)return eo.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===WLe)return eo.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),YLe.has(n))return eo.QUIRKS;let r=t===null?qLe:$Z;if(lj(n,r))return eo.QUIRKS;if(r=t===null?LZ:GLe,lj(n,r))return eo.LIMITED_QUIRKS}return eo.NO_QUIRKS}const cj={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},XLe="definitionurl",JLe="definitionURL",ZLe=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(e=>[e.toLowerCase(),e])),eMe=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:Ee.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:Ee.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:Ee.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:Ee.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:Ee.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:Ee.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:Ee.XLINK}],["xml:base",{prefix:"xml",name:"base",namespace:Ee.XML}],["xml:lang",{prefix:"xml",name:"lang",namespace:Ee.XML}],["xml:space",{prefix:"xml",name:"space",namespace:Ee.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:Ee.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:Ee.XMLNS}]]),tMe=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(e=>[e.toLowerCase(),e])),nMe=new Set([v.B,v.BIG,v.BLOCKQUOTE,v.BODY,v.BR,v.CENTER,v.CODE,v.DD,v.DIV,v.DL,v.DT,v.EM,v.EMBED,v.H1,v.H2,v.H3,v.H4,v.H5,v.H6,v.HEAD,v.HR,v.I,v.IMG,v.LI,v.LISTING,v.MENU,v.META,v.NOBR,v.OL,v.P,v.PRE,v.RUBY,v.S,v.SMALL,v.SPAN,v.STRONG,v.STRIKE,v.SUB,v.SUP,v.TABLE,v.TT,v.U,v.UL,v.VAR]);function rMe(e){const t=e.tagID;return t===v.FONT&&e.attrs.some(({name:r})=>r===Vc.COLOR||r===Vc.SIZE||r===Vc.FACE)||nMe.has(t)}function MZ(e){for(let t=0;t0&&this._setContextModes(t,n)}onItemPop(t,n){var r,i;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(i=(r=this.treeAdapter).onItemPop)===null||i===void 0||i.call(r,t,this.openElements.current),n){let s,o;this.openElements.stackTop===0&&this.fragmentContext?(s=this.fragmentContext,o=this.fragmentContextID):{current:s,currentTagId:o}=this.openElements,this._setContextModes(s,o)}}_setContextModes(t,n){const r=t===this.document||this.treeAdapter.getNamespaceURI(t)===Ee.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,Ee.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=W.TEXT}switchToPlaintextParsing(){this.insertionMode=W.TEXT,this.originalInsertionMode=W.IN_BODY,this.tokenizer.state=Dr.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let t=this.fragmentContext;for(;t;){if(this.treeAdapter.getTagName(t)===oe.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==Ee.HTML))switch(this.fragmentContextID){case v.TITLE:case v.TEXTAREA:{this.tokenizer.state=Dr.RCDATA;break}case v.STYLE:case v.XMP:case v.IFRAME:case v.NOEMBED:case v.NOFRAMES:case v.NOSCRIPT:{this.tokenizer.state=Dr.RAWTEXT;break}case v.SCRIPT:{this.tokenizer.state=Dr.SCRIPT_DATA;break}case v.PLAINTEXT:{this.tokenizer.state=Dr.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",r=t.publicId||"",i=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,i),t.location){const o=this.treeAdapter.getChildNodes(this.document).find(a=>this.treeAdapter.isDocumentTypeNode(a));o&&this.treeAdapter.setNodeSourceCodeLocation(o,t.location)}}_attachElementToTree(t,n){if(this.options.sourceCodeLocationInfo){const r=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(t,r)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const r=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(r,t)}}_appendElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location)}_insertElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location),this.openElements.push(r,t.tagID)}_insertFakeElement(t,n){const r=this.treeAdapter.createElement(t,Ee.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,Ee.HTML,t.attrs),r=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,r),this._attachElementToTree(n,t.location),this.openElements.push(n,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,null)}_insertFakeRootElement(){const t=this.treeAdapter.createElement(oe.HTML,Ee.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,v.HTML)}_appendCommentNode(t,n){const r=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(n,r),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,t.location)}_insertCharacters(t){let n,r;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:r}=this._findFosterParentingLocation(),r?this.treeAdapter.insertTextBefore(n,t.chars,r):this.treeAdapter.insertText(n,t.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,t.chars)),!t.location)return;const i=this.treeAdapter.getChildNodes(n),s=r?i.lastIndexOf(r):i.length,o=i[s-1];if(this.treeAdapter.getNodeSourceCodeLocation(o)){const{endLine:u,endCol:l,endOffset:c}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(o,{endLine:u,endCol:l,endOffset:c})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(o,t.location)}_adoptNodes(t,n){for(let r=this.treeAdapter.getFirstChild(t);r;r=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(n,r)}_setEndLocation(t,n){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&n.location){const r=n.location,i=this.treeAdapter.getTagName(t),s=n.type===Ht.END_TAG&&i===n.tagName?{endTag:{...r},endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,s)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let n,r;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,r=this.fragmentContextID):{current:n,currentTagId:r}=this.openElements,t.tagID===v.SVG&&this.treeAdapter.getTagName(n)===oe.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===Ee.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===v.MGLYPH||t.tagID===v.MALIGNMARK)&&!this._isIntegrationPoint(r,n,Ee.HTML)}_processToken(t){switch(t.type){case Ht.CHARACTER:{this.onCharacter(t);break}case Ht.NULL_CHARACTER:{this.onNullCharacter(t);break}case Ht.COMMENT:{this.onComment(t);break}case Ht.DOCTYPE:{this.onDoctype(t);break}case Ht.START_TAG:{this._processStartTag(t);break}case Ht.END_TAG:{this.onEndTag(t);break}case Ht.EOF:{this.onEof(t);break}case Ht.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){const i=this.treeAdapter.getNamespaceURI(n),s=this.treeAdapter.getAttrList(n);return aMe(t,i,s,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(i=>i.type===ga.Marker||this.openElements.contains(i.element)),r=n<0?t-1:n-1;for(let i=r;i>=0;i--){const s=this.activeFormattingElements.entries[i];this._insertElement(s.token,this.treeAdapter.getNamespaceURI(s.element)),s.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=W.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(v.P),this.openElements.popUntilTagNamePopped(v.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case v.TR:{this.insertionMode=W.IN_ROW;return}case v.TBODY:case v.THEAD:case v.TFOOT:{this.insertionMode=W.IN_TABLE_BODY;return}case v.CAPTION:{this.insertionMode=W.IN_CAPTION;return}case v.COLGROUP:{this.insertionMode=W.IN_COLUMN_GROUP;return}case v.TABLE:{this.insertionMode=W.IN_TABLE;return}case v.BODY:{this.insertionMode=W.IN_BODY;return}case v.FRAMESET:{this.insertionMode=W.IN_FRAMESET;return}case v.SELECT:{this._resetInsertionModeForSelect(t);return}case v.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case v.HTML:{this.insertionMode=this.headElement?W.AFTER_HEAD:W.BEFORE_HEAD;return}case v.TD:case v.TH:{if(t>0){this.insertionMode=W.IN_CELL;return}break}case v.HEAD:{if(t>0){this.insertionMode=W.IN_HEAD;return}break}}this.insertionMode=W.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===v.TEMPLATE)break;if(r===v.TABLE){this.insertionMode=W.IN_SELECT_IN_TABLE;return}}this.insertionMode=W.IN_SELECT}_isElementCausesFosterParenting(t){return BZ.has(t)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let t=this.openElements.stackTop;t>=0;t--){const n=this.openElements.items[t];switch(this.openElements.tagIDs[t]){case v.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===Ee.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case v.TABLE:{const r=this.treeAdapter.getParentNode(n);return r?{parent:r,beforeElement:n}:{parent:this.openElements.items[t-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(t){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,t,n.beforeElement):this.treeAdapter.appendChild(n.parent,t)}_isSpecialElement(t,n){const r=this.treeAdapter.getNamespaceURI(t);return RLe[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){U4e(this,t);return}switch(this.insertionMode){case W.INITIAL:{$g(this,t);break}case W.BEFORE_HTML:{B0(this,t);break}case W.BEFORE_HEAD:{j0(this,t);break}case W.IN_HEAD:{U0(this,t);break}case W.IN_HEAD_NO_SCRIPT:{V0(this,t);break}case W.AFTER_HEAD:{z0(this,t);break}case W.IN_BODY:case W.IN_CAPTION:case W.IN_CELL:case W.IN_TEMPLATE:{UZ(this,t);break}case W.TEXT:case W.IN_SELECT:case W.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case W.IN_TABLE:case W.IN_TABLE_BODY:case W.IN_ROW:{xA(this,t);break}case W.IN_TABLE_TEXT:{YZ(this,t);break}case W.IN_COLUMN_GROUP:{eT(this,t);break}case W.AFTER_BODY:{tT(this,t);break}case W.AFTER_AFTER_BODY:{cb(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){j4e(this,t);return}switch(this.insertionMode){case W.INITIAL:{$g(this,t);break}case W.BEFORE_HTML:{B0(this,t);break}case W.BEFORE_HEAD:{j0(this,t);break}case W.IN_HEAD:{U0(this,t);break}case W.IN_HEAD_NO_SCRIPT:{V0(this,t);break}case W.AFTER_HEAD:{z0(this,t);break}case W.TEXT:{this._insertCharacters(t);break}case W.IN_TABLE:case W.IN_TABLE_BODY:case W.IN_ROW:{xA(this,t);break}case W.IN_COLUMN_GROUP:{eT(this,t);break}case W.AFTER_BODY:{tT(this,t);break}case W.AFTER_AFTER_BODY:{cb(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){I2(this,t);return}switch(this.insertionMode){case W.INITIAL:case W.BEFORE_HTML:case W.BEFORE_HEAD:case W.IN_HEAD:case W.IN_HEAD_NO_SCRIPT:case W.AFTER_HEAD:case W.IN_BODY:case W.IN_TABLE:case W.IN_CAPTION:case W.IN_COLUMN_GROUP:case W.IN_TABLE_BODY:case W.IN_ROW:case W.IN_CELL:case W.IN_SELECT:case W.IN_SELECT_IN_TABLE:case W.IN_TEMPLATE:case W.IN_FRAMESET:case W.AFTER_FRAMESET:{I2(this,t);break}case W.IN_TABLE_TEXT:{Lg(this,t);break}case W.AFTER_BODY:{_Me(this,t);break}case W.AFTER_AFTER_BODY:case W.AFTER_AFTER_FRAMESET:{vMe(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case W.INITIAL:{bMe(this,t);break}case W.BEFORE_HEAD:case W.IN_HEAD:case W.IN_HEAD_NO_SCRIPT:case W.AFTER_HEAD:{this._err(t,_e.misplacedDoctype);break}case W.IN_TABLE_TEXT:{Lg(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,_e.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?V4e(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case W.INITIAL:{$g(this,t);break}case W.BEFORE_HTML:{EMe(this,t);break}case W.BEFORE_HEAD:{TMe(this,t);break}case W.IN_HEAD:{$a(this,t);break}case W.IN_HEAD_NO_SCRIPT:{xMe(this,t);break}case W.AFTER_HEAD:{AMe(this,t);break}case W.IN_BODY:{rs(this,t);break}case W.IN_TABLE:{nm(this,t);break}case W.IN_TABLE_TEXT:{Lg(this,t);break}case W.IN_CAPTION:{S4e(this,t);break}case W.IN_COLUMN_GROUP:{ZD(this,t);break}case W.IN_TABLE_BODY:{$I(this,t);break}case W.IN_ROW:{LI(this,t);break}case W.IN_CELL:{C4e(this,t);break}case W.IN_SELECT:{QZ(this,t);break}case W.IN_SELECT_IN_TABLE:{O4e(this,t);break}case W.IN_TEMPLATE:{R4e(this,t);break}case W.AFTER_BODY:{k4e(this,t);break}case W.IN_FRAMESET:{D4e(this,t);break}case W.AFTER_FRAMESET:{L4e(this,t);break}case W.AFTER_AFTER_BODY:{F4e(this,t);break}case W.AFTER_AFTER_FRAMESET:{B4e(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?z4e(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case W.INITIAL:{$g(this,t);break}case W.BEFORE_HTML:{wMe(this,t);break}case W.BEFORE_HEAD:{SMe(this,t);break}case W.IN_HEAD:{IMe(this,t);break}case W.IN_HEAD_NO_SCRIPT:{CMe(this,t);break}case W.AFTER_HEAD:{OMe(this,t);break}case W.IN_BODY:{DI(this,t);break}case W.TEXT:{p4e(this,t);break}case W.IN_TABLE:{Py(this,t);break}case W.IN_TABLE_TEXT:{Lg(this,t);break}case W.IN_CAPTION:{I4e(this,t);break}case W.IN_COLUMN_GROUP:{x4e(this,t);break}case W.IN_TABLE_BODY:{x2(this,t);break}case W.IN_ROW:{KZ(this,t);break}case W.IN_CELL:{A4e(this,t);break}case W.IN_SELECT:{XZ(this,t);break}case W.IN_SELECT_IN_TABLE:{P4e(this,t);break}case W.IN_TEMPLATE:{N4e(this,t);break}case W.AFTER_BODY:{ZZ(this,t);break}case W.IN_FRAMESET:{$4e(this,t);break}case W.AFTER_FRAMESET:{M4e(this,t);break}case W.AFTER_AFTER_BODY:{cb(this,t);break}}}onEof(t){switch(this.insertionMode){case W.INITIAL:{$g(this,t);break}case W.BEFORE_HTML:{B0(this,t);break}case W.BEFORE_HEAD:{j0(this,t);break}case W.IN_HEAD:{U0(this,t);break}case W.IN_HEAD_NO_SCRIPT:{V0(this,t);break}case W.AFTER_HEAD:{z0(this,t);break}case W.IN_BODY:case W.IN_TABLE:case W.IN_CAPTION:case W.IN_COLUMN_GROUP:case W.IN_TABLE_BODY:case W.IN_ROW:case W.IN_CELL:case W.IN_SELECT:case W.IN_SELECT_IN_TABLE:{WZ(this,t);break}case W.TEXT:{m4e(this,t);break}case W.IN_TABLE_TEXT:{Lg(this,t);break}case W.IN_TEMPLATE:{JZ(this,t);break}case W.AFTER_BODY:case W.IN_FRAMESET:case W.AFTER_FRAMESET:case W.AFTER_AFTER_BODY:case W.AFTER_AFTER_FRAMESET:{JD(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===L.LINE_FEED)){if(t.chars.length===1)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(t);return}switch(this.insertionMode){case W.IN_HEAD:case W.IN_HEAD_NO_SCRIPT:case W.AFTER_HEAD:case W.TEXT:case W.IN_COLUMN_GROUP:case W.IN_SELECT:case W.IN_SELECT_IN_TABLE:case W.IN_FRAMESET:case W.AFTER_FRAMESET:{this._insertCharacters(t);break}case W.IN_BODY:case W.IN_CAPTION:case W.IN_CELL:case W.IN_TEMPLATE:case W.AFTER_BODY:case W.AFTER_AFTER_BODY:case W.AFTER_AFTER_FRAMESET:{jZ(this,t);break}case W.IN_TABLE:case W.IN_TABLE_BODY:case W.IN_ROW:{xA(this,t);break}case W.IN_TABLE_TEXT:{qZ(this,t);break}}}};function dMe(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):HZ(e,t),n}function hMe(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){const i=e.openElements.items[r];if(i===t.element)break;e._isSpecialElement(i,e.openElements.tagIDs[r])&&(n=i)}return n||(e.openElements.shortenToLength(r<0?0:r),e.activeFormattingElements.removeEntry(t)),n}function pMe(e,t,n){let r=t,i=e.openElements.getCommonAncestor(t);for(let s=0,o=i;o!==n;s++,o=i){i=e.openElements.getCommonAncestor(o);const a=e.activeFormattingElements.getElementEntry(o),u=a&&s>=cMe;!a||u?(u&&e.activeFormattingElements.removeEntry(a),e.openElements.remove(o)):(o=mMe(e,a),r===t&&(e.activeFormattingElements.bookmark=a),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(o,r),r=o)}return r}function mMe(e,t){const n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function gMe(e,t,n){const r=e.treeAdapter.getTagName(t),i=Wm(r);if(e._isElementCausesFosterParenting(i))e._fosterParentElement(n);else{const s=e.treeAdapter.getNamespaceURI(t);i===v.TEMPLATE&&s===Ee.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function yMe(e,t,n){const r=e.treeAdapter.getNamespaceURI(n.element),{token:i}=n,s=e.treeAdapter.createElement(i.tagName,r,i.attrs);e._adoptNodes(t,s),e.treeAdapter.appendChild(t,s),e.activeFormattingElements.insertElementAfterBookmark(s,i),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,s,i.tagID)}function XD(e,t){for(let n=0;n=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const r=e.openElements.items[0],i=e.treeAdapter.getNodeSourceCodeLocation(r);if(i&&!i.endTag&&(e._setEndLocation(r,t),e.openElements.stackTop>=1)){const s=e.openElements.items[1],o=e.treeAdapter.getNodeSourceCodeLocation(s);o&&!o.endTag&&e._setEndLocation(s,t)}}}}function bMe(e,t){e._setDocumentType(t);const n=t.forceQuirks?eo.QUIRKS:QLe(t);KLe(t)||e._err(t,_e.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=W.BEFORE_HTML}function $g(e,t){e._err(t,_e.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,eo.QUIRKS),e.insertionMode=W.BEFORE_HTML,e._processToken(t)}function EMe(e,t){t.tagID===v.HTML?(e._insertElement(t,Ee.HTML),e.insertionMode=W.BEFORE_HEAD):B0(e,t)}function wMe(e,t){const n=t.tagID;(n===v.HTML||n===v.HEAD||n===v.BODY||n===v.BR)&&B0(e,t)}function B0(e,t){e._insertFakeRootElement(),e.insertionMode=W.BEFORE_HEAD,e._processToken(t)}function TMe(e,t){switch(t.tagID){case v.HTML:{rs(e,t);break}case v.HEAD:{e._insertElement(t,Ee.HTML),e.headElement=e.openElements.current,e.insertionMode=W.IN_HEAD;break}default:j0(e,t)}}function SMe(e,t){const n=t.tagID;n===v.HEAD||n===v.BODY||n===v.HTML||n===v.BR?j0(e,t):e._err(t,_e.endTagWithoutMatchingOpenElement)}function j0(e,t){e._insertFakeElement(oe.HEAD,v.HEAD),e.headElement=e.openElements.current,e.insertionMode=W.IN_HEAD,e._processToken(t)}function $a(e,t){switch(t.tagID){case v.HTML:{rs(e,t);break}case v.BASE:case v.BASEFONT:case v.BGSOUND:case v.LINK:case v.META:{e._appendElement(t,Ee.HTML),t.ackSelfClosing=!0;break}case v.TITLE:{e._switchToTextParsing(t,Dr.RCDATA);break}case v.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,Dr.RAWTEXT):(e._insertElement(t,Ee.HTML),e.insertionMode=W.IN_HEAD_NO_SCRIPT);break}case v.NOFRAMES:case v.STYLE:{e._switchToTextParsing(t,Dr.RAWTEXT);break}case v.SCRIPT:{e._switchToTextParsing(t,Dr.SCRIPT_DATA);break}case v.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=W.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(W.IN_TEMPLATE);break}case v.HEAD:{e._err(t,_e.misplacedStartTagForHeadElement);break}default:U0(e,t)}}function IMe(e,t){switch(t.tagID){case v.HEAD:{e.openElements.pop(),e.insertionMode=W.AFTER_HEAD;break}case v.BODY:case v.BR:case v.HTML:{U0(e,t);break}case v.TEMPLATE:{nh(e,t);break}default:e._err(t,_e.endTagWithoutMatchingOpenElement)}}function nh(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==v.TEMPLATE&&e._err(t,_e.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(v.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,_e.endTagWithoutMatchingOpenElement)}function U0(e,t){e.openElements.pop(),e.insertionMode=W.AFTER_HEAD,e._processToken(t)}function xMe(e,t){switch(t.tagID){case v.HTML:{rs(e,t);break}case v.BASEFONT:case v.BGSOUND:case v.HEAD:case v.LINK:case v.META:case v.NOFRAMES:case v.STYLE:{$a(e,t);break}case v.NOSCRIPT:{e._err(t,_e.nestedNoscriptInHead);break}default:V0(e,t)}}function CMe(e,t){switch(t.tagID){case v.NOSCRIPT:{e.openElements.pop(),e.insertionMode=W.IN_HEAD;break}case v.BR:{V0(e,t);break}default:e._err(t,_e.endTagWithoutMatchingOpenElement)}}function V0(e,t){const n=t.type===Ht.EOF?_e.openElementsLeftAfterEof:_e.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=W.IN_HEAD,e._processToken(t)}function AMe(e,t){switch(t.tagID){case v.HTML:{rs(e,t);break}case v.BODY:{e._insertElement(t,Ee.HTML),e.framesetOk=!1,e.insertionMode=W.IN_BODY;break}case v.FRAMESET:{e._insertElement(t,Ee.HTML),e.insertionMode=W.IN_FRAMESET;break}case v.BASE:case v.BASEFONT:case v.BGSOUND:case v.LINK:case v.META:case v.NOFRAMES:case v.SCRIPT:case v.STYLE:case v.TEMPLATE:case v.TITLE:{e._err(t,_e.abandonedHeadElementChild),e.openElements.push(e.headElement,v.HEAD),$a(e,t),e.openElements.remove(e.headElement);break}case v.HEAD:{e._err(t,_e.misplacedStartTagForHeadElement);break}default:z0(e,t)}}function OMe(e,t){switch(t.tagID){case v.BODY:case v.HTML:case v.BR:{z0(e,t);break}case v.TEMPLATE:{nh(e,t);break}default:e._err(t,_e.endTagWithoutMatchingOpenElement)}}function z0(e,t){e._insertFakeElement(oe.BODY,v.BODY),e.insertionMode=W.IN_BODY,kI(e,t)}function kI(e,t){switch(t.type){case Ht.CHARACTER:{UZ(e,t);break}case Ht.WHITESPACE_CHARACTER:{jZ(e,t);break}case Ht.COMMENT:{I2(e,t);break}case Ht.START_TAG:{rs(e,t);break}case Ht.END_TAG:{DI(e,t);break}case Ht.EOF:{WZ(e,t);break}}}function jZ(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function UZ(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function PMe(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function RMe(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function NMe(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,Ee.HTML),e.insertionMode=W.IN_FRAMESET)}function kMe(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,Ee.HTML)}function DMe(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),OZ(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,Ee.HTML)}function $Me(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,Ee.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function LMe(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,Ee.HTML),n||(e.formElement=e.openElements.current))}function MMe(e,t){e.framesetOk=!1;const n=t.tagID;for(let r=e.openElements.stackTop;r>=0;r--){const i=e.openElements.tagIDs[r];if(n===v.LI&&i===v.LI||(n===v.DD||n===v.DT)&&(i===v.DD||i===v.DT)){e.openElements.generateImpliedEndTagsWithExclusion(i),e.openElements.popUntilTagNamePopped(i);break}if(i!==v.ADDRESS&&i!==v.DIV&&i!==v.P&&e._isSpecialElement(e.openElements.items[r],i))break}e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,Ee.HTML)}function FMe(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,Ee.HTML),e.tokenizer.state=Dr.PLAINTEXT}function BMe(e,t){e.openElements.hasInScope(v.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(v.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,Ee.HTML),e.framesetOk=!1}function jMe(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(oe.A);n&&(XD(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,Ee.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function UMe(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Ee.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function VMe(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(v.NOBR)&&(XD(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,Ee.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function zMe(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Ee.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function HMe(e,t){e.treeAdapter.getDocumentMode(e.document)!==eo.QUIRKS&&e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,Ee.HTML),e.framesetOk=!1,e.insertionMode=W.IN_TABLE}function VZ(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Ee.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function zZ(e){const t=xZ(e,Vc.TYPE);return t!=null&&t.toLowerCase()===uMe}function WMe(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Ee.HTML),zZ(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function qMe(e,t){e._appendElement(t,Ee.HTML),t.ackSelfClosing=!0}function YMe(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._appendElement(t,Ee.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function GMe(e,t){t.tagName=oe.IMG,t.tagID=v.IMG,VZ(e,t)}function KMe(e,t){e._insertElement(t,Ee.HTML),e.skipNextNewLine=!0,e.tokenizer.state=Dr.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=W.TEXT}function QMe(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,Dr.RAWTEXT)}function XMe(e,t){e.framesetOk=!1,e._switchToTextParsing(t,Dr.RAWTEXT)}function hj(e,t){e._switchToTextParsing(t,Dr.RAWTEXT)}function JMe(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Ee.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===W.IN_TABLE||e.insertionMode===W.IN_CAPTION||e.insertionMode===W.IN_TABLE_BODY||e.insertionMode===W.IN_ROW||e.insertionMode===W.IN_CELL?W.IN_SELECT_IN_TABLE:W.IN_SELECT}function ZMe(e,t){e.openElements.currentTagId===v.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,Ee.HTML)}function e4e(e,t){e.openElements.hasInScope(v.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,Ee.HTML)}function t4e(e,t){e.openElements.hasInScope(v.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(v.RTC),e._insertElement(t,Ee.HTML)}function n4e(e,t){e._reconstructActiveFormattingElements(),MZ(t),QD(t),t.selfClosing?e._appendElement(t,Ee.MATHML):e._insertElement(t,Ee.MATHML),t.ackSelfClosing=!0}function r4e(e,t){e._reconstructActiveFormattingElements(),FZ(t),QD(t),t.selfClosing?e._appendElement(t,Ee.SVG):e._insertElement(t,Ee.SVG),t.ackSelfClosing=!0}function pj(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Ee.HTML)}function rs(e,t){switch(t.tagID){case v.I:case v.S:case v.B:case v.U:case v.EM:case v.TT:case v.BIG:case v.CODE:case v.FONT:case v.SMALL:case v.STRIKE:case v.STRONG:{UMe(e,t);break}case v.A:{jMe(e,t);break}case v.H1:case v.H2:case v.H3:case v.H4:case v.H5:case v.H6:{DMe(e,t);break}case v.P:case v.DL:case v.OL:case v.UL:case v.DIV:case v.DIR:case v.NAV:case v.MAIN:case v.MENU:case v.ASIDE:case v.CENTER:case v.FIGURE:case v.FOOTER:case v.HEADER:case v.HGROUP:case v.DIALOG:case v.DETAILS:case v.ADDRESS:case v.ARTICLE:case v.SECTION:case v.SUMMARY:case v.FIELDSET:case v.BLOCKQUOTE:case v.FIGCAPTION:{kMe(e,t);break}case v.LI:case v.DD:case v.DT:{MMe(e,t);break}case v.BR:case v.IMG:case v.WBR:case v.AREA:case v.EMBED:case v.KEYGEN:{VZ(e,t);break}case v.HR:{YMe(e,t);break}case v.RB:case v.RTC:{e4e(e,t);break}case v.RT:case v.RP:{t4e(e,t);break}case v.PRE:case v.LISTING:{$Me(e,t);break}case v.XMP:{QMe(e,t);break}case v.SVG:{r4e(e,t);break}case v.HTML:{PMe(e,t);break}case v.BASE:case v.LINK:case v.META:case v.STYLE:case v.TITLE:case v.SCRIPT:case v.BGSOUND:case v.BASEFONT:case v.TEMPLATE:{$a(e,t);break}case v.BODY:{RMe(e,t);break}case v.FORM:{LMe(e,t);break}case v.NOBR:{VMe(e,t);break}case v.MATH:{n4e(e,t);break}case v.TABLE:{HMe(e,t);break}case v.INPUT:{WMe(e,t);break}case v.PARAM:case v.TRACK:case v.SOURCE:{qMe(e,t);break}case v.IMAGE:{GMe(e,t);break}case v.BUTTON:{BMe(e,t);break}case v.APPLET:case v.OBJECT:case v.MARQUEE:{zMe(e,t);break}case v.IFRAME:{XMe(e,t);break}case v.SELECT:{JMe(e,t);break}case v.OPTION:case v.OPTGROUP:{ZMe(e,t);break}case v.NOEMBED:{hj(e,t);break}case v.FRAMESET:{NMe(e,t);break}case v.TEXTAREA:{KMe(e,t);break}case v.NOSCRIPT:{e.options.scriptingEnabled?hj(e,t):pj(e,t);break}case v.PLAINTEXT:{FMe(e,t);break}case v.COL:case v.TH:case v.TD:case v.TR:case v.HEAD:case v.FRAME:case v.TBODY:case v.TFOOT:case v.THEAD:case v.CAPTION:case v.COLGROUP:break;default:pj(e,t)}}function i4e(e,t){if(e.openElements.hasInScope(v.BODY)&&(e.insertionMode=W.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function s4e(e,t){e.openElements.hasInScope(v.BODY)&&(e.insertionMode=W.AFTER_BODY,ZZ(e,t))}function o4e(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function a4e(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(v.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(v.FORM):n&&e.openElements.remove(n))}function u4e(e){e.openElements.hasInButtonScope(v.P)||e._insertFakeElement(oe.P,v.P),e._closePElement()}function l4e(e){e.openElements.hasInListItemScope(v.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(v.LI),e.openElements.popUntilTagNamePopped(v.LI))}function c4e(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function f4e(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function d4e(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function h4e(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(oe.BR,v.BR),e.openElements.pop(),e.framesetOk=!1}function HZ(e,t){const n=t.tagName,r=t.tagID;for(let i=e.openElements.stackTop;i>0;i--){const s=e.openElements.items[i],o=e.openElements.tagIDs[i];if(r===o&&(r!==v.UNKNOWN||e.treeAdapter.getTagName(s)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=i&&e.openElements.shortenToLength(i);break}if(e._isSpecialElement(s,o))break}}function DI(e,t){switch(t.tagID){case v.A:case v.B:case v.I:case v.S:case v.U:case v.EM:case v.TT:case v.BIG:case v.CODE:case v.FONT:case v.NOBR:case v.SMALL:case v.STRIKE:case v.STRONG:{XD(e,t);break}case v.P:{u4e(e);break}case v.DL:case v.UL:case v.OL:case v.DIR:case v.DIV:case v.NAV:case v.PRE:case v.MAIN:case v.MENU:case v.ASIDE:case v.BUTTON:case v.CENTER:case v.FIGURE:case v.FOOTER:case v.HEADER:case v.HGROUP:case v.DIALOG:case v.ADDRESS:case v.ARTICLE:case v.DETAILS:case v.SECTION:case v.SUMMARY:case v.LISTING:case v.FIELDSET:case v.BLOCKQUOTE:case v.FIGCAPTION:{o4e(e,t);break}case v.LI:{l4e(e);break}case v.DD:case v.DT:{c4e(e,t);break}case v.H1:case v.H2:case v.H3:case v.H4:case v.H5:case v.H6:{f4e(e);break}case v.BR:{h4e(e);break}case v.BODY:{i4e(e,t);break}case v.HTML:{s4e(e,t);break}case v.FORM:{a4e(e);break}case v.APPLET:case v.OBJECT:case v.MARQUEE:{d4e(e,t);break}case v.TEMPLATE:{nh(e,t);break}default:HZ(e,t)}}function WZ(e,t){e.tmplInsertionModeStack.length>0?JZ(e,t):JD(e,t)}function p4e(e,t){var n;t.tagID===v.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function m4e(e,t){e._err(t,_e.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function xA(e,t){if(BZ.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=W.IN_TABLE_TEXT,t.type){case Ht.CHARACTER:{YZ(e,t);break}case Ht.WHITESPACE_CHARACTER:{qZ(e,t);break}}else U_(e,t)}function g4e(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,Ee.HTML),e.insertionMode=W.IN_CAPTION}function y4e(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Ee.HTML),e.insertionMode=W.IN_COLUMN_GROUP}function _4e(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(oe.COLGROUP,v.COLGROUP),e.insertionMode=W.IN_COLUMN_GROUP,ZD(e,t)}function v4e(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Ee.HTML),e.insertionMode=W.IN_TABLE_BODY}function b4e(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(oe.TBODY,v.TBODY),e.insertionMode=W.IN_TABLE_BODY,$I(e,t)}function E4e(e,t){e.openElements.hasInTableScope(v.TABLE)&&(e.openElements.popUntilTagNamePopped(v.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function w4e(e,t){zZ(t)?e._appendElement(t,Ee.HTML):U_(e,t),t.ackSelfClosing=!0}function T4e(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,Ee.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function nm(e,t){switch(t.tagID){case v.TD:case v.TH:case v.TR:{b4e(e,t);break}case v.STYLE:case v.SCRIPT:case v.TEMPLATE:{$a(e,t);break}case v.COL:{_4e(e,t);break}case v.FORM:{T4e(e,t);break}case v.TABLE:{E4e(e,t);break}case v.TBODY:case v.TFOOT:case v.THEAD:{v4e(e,t);break}case v.INPUT:{w4e(e,t);break}case v.CAPTION:{g4e(e,t);break}case v.COLGROUP:{y4e(e,t);break}default:U_(e,t)}}function Py(e,t){switch(t.tagID){case v.TABLE:{e.openElements.hasInTableScope(v.TABLE)&&(e.openElements.popUntilTagNamePopped(v.TABLE),e._resetInsertionMode());break}case v.TEMPLATE:{nh(e,t);break}case v.BODY:case v.CAPTION:case v.COL:case v.COLGROUP:case v.HTML:case v.TBODY:case v.TD:case v.TFOOT:case v.TH:case v.THEAD:case v.TR:break;default:U_(e,t)}}function U_(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,kI(e,t),e.fosterParentingEnabled=n}function qZ(e,t){e.pendingCharacterTokens.push(t)}function YZ(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function Lg(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n0&&e.openElements.currentTagId===v.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===v.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===v.OPTGROUP&&e.openElements.pop();break}case v.OPTION:{e.openElements.currentTagId===v.OPTION&&e.openElements.pop();break}case v.SELECT:{e.openElements.hasInSelectScope(v.SELECT)&&(e.openElements.popUntilTagNamePopped(v.SELECT),e._resetInsertionMode());break}case v.TEMPLATE:{nh(e,t);break}}}function O4e(e,t){const n=t.tagID;n===v.CAPTION||n===v.TABLE||n===v.TBODY||n===v.TFOOT||n===v.THEAD||n===v.TR||n===v.TD||n===v.TH?(e.openElements.popUntilTagNamePopped(v.SELECT),e._resetInsertionMode(),e._processStartTag(t)):QZ(e,t)}function P4e(e,t){const n=t.tagID;n===v.CAPTION||n===v.TABLE||n===v.TBODY||n===v.TFOOT||n===v.THEAD||n===v.TR||n===v.TD||n===v.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(v.SELECT),e._resetInsertionMode(),e.onEndTag(t)):XZ(e,t)}function R4e(e,t){switch(t.tagID){case v.BASE:case v.BASEFONT:case v.BGSOUND:case v.LINK:case v.META:case v.NOFRAMES:case v.SCRIPT:case v.STYLE:case v.TEMPLATE:case v.TITLE:{$a(e,t);break}case v.CAPTION:case v.COLGROUP:case v.TBODY:case v.TFOOT:case v.THEAD:{e.tmplInsertionModeStack[0]=W.IN_TABLE,e.insertionMode=W.IN_TABLE,nm(e,t);break}case v.COL:{e.tmplInsertionModeStack[0]=W.IN_COLUMN_GROUP,e.insertionMode=W.IN_COLUMN_GROUP,ZD(e,t);break}case v.TR:{e.tmplInsertionModeStack[0]=W.IN_TABLE_BODY,e.insertionMode=W.IN_TABLE_BODY,$I(e,t);break}case v.TD:case v.TH:{e.tmplInsertionModeStack[0]=W.IN_ROW,e.insertionMode=W.IN_ROW,LI(e,t);break}default:e.tmplInsertionModeStack[0]=W.IN_BODY,e.insertionMode=W.IN_BODY,rs(e,t)}}function N4e(e,t){t.tagID===v.TEMPLATE&&nh(e,t)}function JZ(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(v.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):JD(e,t)}function k4e(e,t){t.tagID===v.HTML?rs(e,t):tT(e,t)}function ZZ(e,t){var n;if(t.tagID===v.HTML){if(e.fragmentContext||(e.insertionMode=W.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===v.HTML){e._setEndLocation(e.openElements.items[0],t);const r=e.openElements.items[1];r&&!(!((n=e.treeAdapter.getNodeSourceCodeLocation(r))===null||n===void 0)&&n.endTag)&&e._setEndLocation(r,t)}}else tT(e,t)}function tT(e,t){e.insertionMode=W.IN_BODY,kI(e,t)}function D4e(e,t){switch(t.tagID){case v.HTML:{rs(e,t);break}case v.FRAMESET:{e._insertElement(t,Ee.HTML);break}case v.FRAME:{e._appendElement(t,Ee.HTML),t.ackSelfClosing=!0;break}case v.NOFRAMES:{$a(e,t);break}}}function $4e(e,t){t.tagID===v.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==v.FRAMESET&&(e.insertionMode=W.AFTER_FRAMESET))}function L4e(e,t){switch(t.tagID){case v.HTML:{rs(e,t);break}case v.NOFRAMES:{$a(e,t);break}}}function M4e(e,t){t.tagID===v.HTML&&(e.insertionMode=W.AFTER_AFTER_FRAMESET)}function F4e(e,t){t.tagID===v.HTML?rs(e,t):cb(e,t)}function cb(e,t){e.insertionMode=W.IN_BODY,kI(e,t)}function B4e(e,t){switch(t.tagID){case v.HTML:{rs(e,t);break}case v.NOFRAMES:{$a(e,t);break}}}function j4e(e,t){t.chars=sr,e._insertCharacters(t)}function U4e(e,t){e._insertCharacters(t),e.framesetOk=!1}function eee(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==Ee.HTML&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function V4e(e,t){if(rMe(t))eee(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===Ee.MATHML?MZ(t):r===Ee.SVG&&(iMe(t),FZ(t)),QD(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function z4e(e,t){if(t.tagID===v.P||t.tagID===v.BR){eee(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){const r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===Ee.HTML){e._endTagOutsideForeignContent(t);break}const i=e.treeAdapter.getTagName(r);if(i.toLowerCase()===t.tagName){t.tagName=i,e.openElements.shortenToLength(n);break}}}oe.AREA,oe.BASE,oe.BASEFONT,oe.BGSOUND,oe.BR,oe.COL,oe.EMBED,oe.FRAME,oe.HR,oe.IMG,oe.INPUT,oe.KEYGEN,oe.LINK,oe.META,oe.PARAM,oe.SOURCE,oe.TRACK,oe.WBR;const tee=nee("end"),rh=nee("start");function nee(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}const ree=function(e){if(e==null)return Y4e;if(typeof e=="function")return MI(e);if(typeof e=="object")return Array.isArray(e)?H4e(e):W4e(e);if(typeof e=="string")return q4e(e);throw new Error("Expected function, string, or object as test")};function H4e(e){const t=[];let n=-1;for(;++n":""))+")"})}return d;function d(){let h=iee,p,m,y;if((!t||s(u,l,c[c.length-1]||void 0))&&(h=J4e(n(u,c)),h[0]===mj))return h;if("children"in u&&u.children){const g=u;if(g.children&&h[0]!==Q4e)for(m=(r?g.children.length:-1)+o,y=c.concat(g);m>-1&&m$.jsx(A_,{...r}),p:({node:n,...r})=>$.jsx(Tt,{...r,pb:8}),h1:({node:n,...r})=>$.jsx(cc,{order:1,...r,pb:12}),h2:({node:n,...r})=>$.jsx(cc,{order:2,...r,pb:12}),h3:({node:n,...r})=>$.jsx(cc,{order:3,...r,pb:12}),h4:({node:n,...r})=>$.jsx(cc,{order:4,...r,pb:12}),h5:({node:n,...r})=>$.jsx(cc,{order:5,...r,pb:12}),h6:({node:n,...r})=>$.jsx(cc,{order:6,...r,pb:12}),a:({node:n,...r})=>$.jsx(Nq,{...r}),ul:({node:n,...r})=>$.jsx(Xp,{withPadding:!0,...r,pb:8}),ol:({node:n,...r})=>$.jsx(Xp,{type:"ordered",withPadding:!0,...r,pb:8})};return $.jsx("div",{style:{display:"inherit"},children:$.jsx(pZ,{components:t,rehypePlugins:[d5e],children:e})})}function h5e({response:e,disabled:t,answer:n}){const{prompt:r,required:i,options:s}=e;return $.jsx(Qp.Group,{label:$.jsx(Us,{text:r}),withAsterisk:i,...n,error:eh(e,n,s),size:"md",children:$.jsx(zo,{mt:"md",children:s.map(o=>$.jsx(Qp,{disabled:t,value:o.value,label:o.label},o.value))})})}function p5e({response:e,disabled:t,answer:n}){const{placeholder:r,prompt:i,required:s,options:o}=e;return $.jsx(UQ,{disabled:t,label:$.jsx(Us,{text:i}),placeholder:r,data:o,withAsterisk:s,radius:"md",size:"md",...n,error:eh(e,n,o)})}function m5e({response:e,answer:t}){const{prompt:n}=e;return $.jsxs($.Fragment,{children:[$.jsx(Tt,{fz:"md",fw:500,children:$.jsx(Us,{text:n})}),$.jsx(Xp,{children:Array.isArray(t.value)&&t.value.map(r=>$.jsx(Xp.Item,{children:r},r))})]})}function lee({response:e,disabled:t,answer:n}){const{prompt:r,required:i,options:s,leftLabel:o,rightLabel:a}=e;return $.jsxs(Cw.Group,{name:`radioInput${e.id}`,label:$.jsx(Us,{text:r}),withAsterisk:i,size:"md",...n,error:eh(e,n,s),children:[o?$.jsx(Tt,{children:o}):null,$.jsx(zo,{mt:"xs",children:s.map(u=>$.jsx(Cw,{disabled:t,value:u.value,label:u.label},u.label))}),$.jsx(Tt,{children:a})]},e.id)}function g5e({response:e,disabled:t,answer:n}){const{preset:r}=e,i=[];for(let o=1;o<=+r;o+=1)i.push({label:`${o}`,value:`${o}`});const s={...e,type:"radio",options:i};return $.jsx(lee,{disabled:t,response:s,answer:n})}function y5e({response:e,disabled:t,answer:n}){const{prompt:r,required:i,min:s,max:o,placeholder:a}=e;return $.jsx(mQ,{disabled:t,placeholder:a,label:$.jsx(Us,{text:r}),withAsterisk:i,radius:"md",size:"md",min:s,max:o,...n,error:eh(e,n)})}function _5e({response:e,disabled:t,answer:n}){const{prompt:r,options:i,leftLabel:s,rightLabel:o,required:a}=e,u=eh(e,n);return $.jsx(Bs.Wrapper,{withAsterisk:a,label:$.jsx(Us,{text:r}),error:u,size:"md",children:$.jsxs(zo,{children:[s?$.jsx(Nd,{children:$.jsx(Tt,{children:s})}):null,$.jsx(KQ,{disabled:t,label:null,sx:{marginTop:"15px",marginBottom:"15px",width:"400px"},marks:i,...n,defaultValue:50,thumbSize:n.value===""?.1:17,color:n.value===""?"gray.2":"blue",min:0,max:100,showLabelOnHover:!1,styles:l=>({markFilled:{borderColor:"#E9ECEF",backgroundColor:"white"},bar:{backgroundColor:"#E9ECEF"},markLabel:{fontSize:l.fontSizes.sm,marginBottom:5,marginTop:0}})}),o?$.jsx(Nd,{children:$.jsx(Tt,{children:o})}):null]})})}function v5e({response:e,disabled:t,answer:n}){const{placeholder:r,prompt:i,required:s}=e;return $.jsx(Nk,{disabled:t,placeholder:r,label:$.jsx(Us,{text:i}),radius:"md",size:"md",withAsterisk:s,...n,value:n.value||"",error:eh(e,n)})}function b5e({response:e,disabled:t,answer:n}){const{placeholder:r,prompt:i,required:s}=e;return $.jsx(IK,{disabled:t,placeholder:r,label:$.jsx(Us,{text:i}),radius:"md",size:"md",withAsterisk:s,...n,value:n.value||"",error:eh(e,n)})}function E5e({response:e,answer:t,storedAnswer:n}){const r=(n?{value:n}:t)||{value:void 0},i=!!n,[s]=QN(),o=w.useMemo(()=>{if(e.paramCapture){const a=s.get(e.paramCapture);return i||!!a}return i},[i,e.paramCapture,s]);return $.jsxs(ut,{sx:{margin:10,padding:5},children:[e.type==="numerical"&&$.jsx(y5e,{response:e,disabled:o,answer:r}),e.type==="shortText"&&$.jsx(v5e,{response:e,disabled:o,answer:r}),e.type==="longText"&&$.jsx(b5e,{response:e,disabled:o,answer:r}),e.type==="likert"&&$.jsx(g5e,{response:e,disabled:o,answer:r}),e.type==="dropdown"&&$.jsx(p5e,{response:e,disabled:o,answer:r}),e.type==="slider"&&$.jsx(_5e,{response:e,disabled:o,answer:r}),e.type==="radio"&&$.jsx(lee,{response:e,disabled:o,answer:r}),e.type==="checkbox"&&$.jsx(h5e,{response:e,disabled:o,answer:r}),e.type==="iframe"&&$.jsx(m5e,{response:e,answer:r})]})}function nT({config:e,location:t,status:n,style:r}){var y,g;const i=Da(),s=n==null?void 0:n.answer,o=e,a=((y=o==null?void 0:o.response)==null?void 0:y.filter(_=>_.location?_.location===t:t==="belowStimulus"))||[],u=Wl(),{updateResponseBlockValidation:l}=Hl(),c=kke(a,i,s||{}),[f,d]=w.useState(!1),{iframeAnswers:h}=Uu(_=>_),p=(((g=o==null?void 0:o.correctAnswer)==null?void 0:g.length)||0)>0,m=t===((o==null?void 0:o.nextButtonLocation)||"belowStimulus");return w.useEffect(()=>{const _=a.find(b=>b.type==="iframe");if(_){const b=_.id;c.setValues({...c.values,[b]:h})}},[h]),w.useEffect(()=>{u(l({location:t,currentStep:i,status:c.isValid(),values:kD(c.values)}))},[c.values,i,t]),$.jsxs("div",{style:r,children:[a.map(_=>{var b,T;return $.jsx(k.Fragment,{children:_.hidden?"":$.jsxs($.Fragment,{children:[$.jsx(E5e,{storedAnswer:s?s[_.id]:void 0,answer:{...c.getInputProps(_.id,{type:_.type==="checkbox"?"checkbox":"input"})},response:_}),p&&f&&$.jsx(Tt,{children:`The correct answer is: ${(T=(b=o.correctAnswer)==null?void 0:b.find(I=>I.id===_.id))==null?void 0:T.answer}`})]})},`${_.id}-${i}`)}),$.jsxs(zo,{position:"right",spacing:"xs",mt:"xl",children:[p&&m&&$.jsx(yu,{onClick:()=>d(!0),disabled:!c.isValid(),children:"Check Answer"}),m&&$.jsx(ske,{disabled:p&&!f,setCheckClicked:d,label:o.nextButtonText||"Next"})]})]})}const d1="@REVISIT_COMMS",w5e={minHeight:"500px",width:"100%",border:0,marginTop:"-50px"};function T5e({currentConfig:e}){const{setIframeAnswers:t}=Hl(),n=Wl(),r=pX(),i=w.useRef(null),s=w.useMemo(()=>crypto.randomUUID?crypto.randomUUID():`testID-${Date.now()}`,[]),o=Da(),a=Qd(),u=w.useCallback((l,c)=>{var f,d;(d=(f=i.current)==null?void 0:f.contentWindow)==null||d.postMessage({error:!1,type:`${d1}/${l}`,iframeId:s,message:c},"*")},[i,s]);return w.useEffect(()=>{const l=c=>{const{data:f}=c;if(typeof f=="object"&&s===f.iframeId)switch(f.type){case`${d1}/WINDOW_READY`:e.parameters&&u("STUDY_DATA",e.parameters);break;case`${d1}/READY`:i.current&&(i.current.style.height=`${f.message.documentHeight}px`);break;case`${d1}/ANSWERS`:n(t(f.message.answer));break}};return window.addEventListener("message",l),()=>window.removeEventListener("message",l)},[n,o,r,s,a,e,u]),$.jsx("div",{children:$.jsx("iframe",{ref:i,src:`${Bu}${e.path}?trialid=${o}&id=${s}`,style:w5e})})}const S5e={maxWidth:"100%"};function I5e({currentConfig:e}){const t={...S5e,...e.style};return $.jsx(A_,{mx:"auto",src:`${Bu}${e.path}`,style:t})}const x5e=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),vi={Purple:"#6D3E91",DarkOrange:"#C05917",LightTeal:"#58AC8C",Blue:"#286BBB",Maroon:"#883039",Camel:"#BC8E5A",MidnightBlue:"#00295B",DustyCoral:"#C15065",DarkOliveGreen:"#18470F",DarkCopper:"#9A5129",Peach:"#E56E5A",Mauve:"#A2559C",Turquoise:"#38AABA",OliveGreen:"#578145",Cherry:"#970046",Teal:"#00847E",RustyOrange:"#B13507",Denim:"#4C6A9C",Fuchsia:"#CF0A66",TealishGreen:"#00875E",Copper:"#B16214",DarkMauve:"#8C4569",Lime:"#3B8E1D",Coral:"#D73C50"},Th={DarkOrangeDarker:"#BE5915",PeachDarker:"#C4523E",LightTealDarker:"#2C8465",TurquoiseDarker:"#008291",CamelDarker:"#996D39",LimeDarker:"#338711"},e$=[vi.DustyCoral,Th.LightTealDarker,Th.DarkOrangeDarker,vi.Purple,vi.DarkOliveGreen,vi.Blue,vi.Maroon,Th.CamelDarker,vi.MidnightBlue,vi.DarkCopper,Th.PeachDarker,vi.Mauve,Th.TurquoiseDarker,vi.OliveGreen,vi.Cherry,vi.Teal,vi.RustyOrange,vi.Denim,vi.TealishGreen,vi.Copper,vi.DarkMauve,Th.LimeDarker,vi.Coral],C5e=Object.freeze(Object.defineProperty({__proto__:null,OwidDistinctLinesPalette:e$},Symbol.toStringTag,{value:"Module"}));function xp(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function A5e(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function t$(e){let t,n,r;e.length!==2?(t=xp,n=(a,u)=>xp(e(a),u),r=(a,u)=>e(a)-u):(t=e===xp||e===A5e?e:O5e,n=e,r=e);function i(a,u,l=0,c=a.length){if(l>>1;n(a[f],u)<0?l=f+1:c=f}while(l>>1;n(a[f],u)<=0?l=f+1:c=f}while(ll&&r(a[f-1],u)>-r(a[f],u)?f-1:f}return{left:i,center:o,right:s}}function O5e(){return 0}function P5e(e){return e===null?NaN:+e}function*R5e(e,t){if(t===void 0)for(let n of e)n!=null&&(n=+n)>=n&&(yield n);else{let n=-1;for(let r of e)(r=t(r,++n,e))!=null&&(r=+r)>=r&&(yield r)}}const N5e=t$(xp),k5e=N5e.right;t$(P5e).center;const D5e=k5e;function Cp(e,t){let n,r;if(t===void 0)for(const i of e)i!=null&&(n===void 0?i>=i&&(n=r=i):(n>i&&(n=i),r=s&&(n=r=s):(n>s&&(n=s),r=r.length)return n(s);const a=new C2,u=r[o++];let l=-1;for(const c of s){const f=u(c,++l,s),d=a.get(f);d?d.push(c):a.set(f,[c])}for(const[c,f]of a)a.set(c,i(f,o));return t(a)}(e,0)}function U5e(e=xp){if(e===xp)return cee;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function cee(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const V5e=Math.sqrt(50),z5e=Math.sqrt(10),H5e=Math.sqrt(2);function rT(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),s=r/Math.pow(10,i),o=s>=V5e?10:s>=z5e?5:s>=H5e?2:1;let a,u,l;return i<0?(l=Math.pow(10,-i)/o,a=Math.round(e*l),u=Math.round(t*l),a/lt&&--u,l=-l):(l=Math.pow(10,i)*o,a=Math.round(e/l),u=Math.round(t/l),a*lt&&--u),u0))return[];if(e===t)return[e];const r=t=i))return[];const a=s-i+1,u=new Array(a);if(r)if(o<0)for(let l=0;l=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n=i)&&(n=i)}return n}function sT(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function fee(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?cee:U5e(i);r>n;){if(r-n>600){const u=r-n+1,l=t-n+1,c=Math.log(u),f=.5*Math.exp(2*c/3),d=.5*Math.sqrt(c*f*(u-f)/u)*(l-u/2<0?-1:1),h=Math.max(n,Math.floor(t-l*f/u+d)),p=Math.min(r,Math.floor(t+(u-l)*f/u+d));fee(e,t,h,p,i)}const s=e[t];let o=n,a=r;for(Mg(e,n,t),i(e[r],s)>0&&Mg(e,n,r);o0;)--a}i(e[n],s)===0?Mg(e,n,a):(++a,Mg(e,a,r)),a<=t&&(n=a+1),t<=a&&(r=a-1)}return e}function Mg(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function CA(e,t,n){if(e=Float64Array.from(R5e(e,n)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return sT(e);if(t>=1)return iT(e);var r,i=(r-1)*t,s=Math.floor(i),o=iT(fee(e,s).subarray(0,s+1)),a=sT(e.subarray(s+1));return o+(a-o)*(i-s)}}function n$(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function dee(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function z_(){}var Ry=.7,oT=1/Ry,Ap="\\s*([+-]?\\d+)\\s*",Ny="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",bu="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",q5e=/^#([0-9a-f]{3,8})$/,Y5e=new RegExp(`^rgb\\(${Ap},${Ap},${Ap}\\)$`),G5e=new RegExp(`^rgb\\(${bu},${bu},${bu}\\)$`),K5e=new RegExp(`^rgba\\(${Ap},${Ap},${Ap},${Ny}\\)$`),Q5e=new RegExp(`^rgba\\(${bu},${bu},${bu},${Ny}\\)$`),X5e=new RegExp(`^hsl\\(${Ny},${bu},${bu}\\)$`),J5e=new RegExp(`^hsla\\(${Ny},${bu},${bu},${Ny}\\)$`),_j={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};n$(z_,ky,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:vj,formatHex:vj,formatHex8:Z5e,formatHsl:eFe,formatRgb:bj,toString:bj});function vj(){return this.rgb().formatHex()}function Z5e(){return this.rgb().formatHex8()}function eFe(){return hee(this).formatHsl()}function bj(){return this.rgb().formatRgb()}function ky(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=q5e.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Ej(t):n===3?new ks(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?h1(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?h1(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Y5e.exec(e))?new ks(t[1],t[2],t[3],1):(t=G5e.exec(e))?new ks(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=K5e.exec(e))?h1(t[1],t[2],t[3],t[4]):(t=Q5e.exec(e))?h1(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=X5e.exec(e))?Sj(t[1],t[2]/100,t[3]/100,1):(t=J5e.exec(e))?Sj(t[1],t[2]/100,t[3]/100,t[4]):_j.hasOwnProperty(e)?Ej(_j[e]):e==="transparent"?new ks(NaN,NaN,NaN,0):null}function Ej(e){return new ks(e>>16&255,e>>8&255,e&255,1)}function h1(e,t,n,r){return r<=0&&(e=t=n=NaN),new ks(e,t,n,r)}function tFe(e){return e instanceof z_||(e=ky(e)),e?(e=e.rgb(),new ks(e.r,e.g,e.b,e.opacity)):new ks}function P2(e,t,n,r){return arguments.length===1?tFe(e):new ks(e,t,n,r??1)}function ks(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}n$(ks,P2,dee(z_,{brighter(e){return e=e==null?oT:Math.pow(oT,e),new ks(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ry:Math.pow(Ry,e),new ks(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ks(vd(this.r),vd(this.g),vd(this.b),aT(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:wj,formatHex:wj,formatHex8:nFe,formatRgb:Tj,toString:Tj}));function wj(){return`#${td(this.r)}${td(this.g)}${td(this.b)}`}function nFe(){return`#${td(this.r)}${td(this.g)}${td(this.b)}${td((isNaN(this.opacity)?1:this.opacity)*255)}`}function Tj(){const e=aT(this.opacity);return`${e===1?"rgb(":"rgba("}${vd(this.r)}, ${vd(this.g)}, ${vd(this.b)}${e===1?")":`, ${e})`}`}function aT(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function vd(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function td(e){return e=vd(e),(e<16?"0":"")+e.toString(16)}function Sj(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new va(e,t,n,r)}function hee(e){if(e instanceof va)return new va(e.h,e.s,e.l,e.opacity);if(e instanceof z_||(e=ky(e)),!e)return new va;if(e instanceof va)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),s=Math.max(t,n,r),o=NaN,a=s-i,u=(s+i)/2;return a?(t===s?o=(n-r)/a+(n0&&u<1?0:o,new va(o,a,u,e.opacity)}function rFe(e,t,n,r){return arguments.length===1?hee(e):new va(e,t,n,r??1)}function va(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}n$(va,rFe,dee(z_,{brighter(e){return e=e==null?oT:Math.pow(oT,e),new va(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ry:Math.pow(Ry,e),new va(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new ks(AA(e>=240?e-240:e+120,i,r),AA(e,i,r),AA(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new va(Ij(this.h),p1(this.s),p1(this.l),aT(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=aT(this.opacity);return`${e===1?"hsl(":"hsla("}${Ij(this.h)}, ${p1(this.s)*100}%, ${p1(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Ij(e){return e=(e||0)%360,e<0?e+360:e}function p1(e){return Math.max(0,Math.min(1,e||0))}function AA(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const r$=e=>()=>e;function iFe(e,t){return function(n){return e+n*t}}function sFe(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function oFe(e){return(e=+e)==1?pee:function(t,n){return n-t?sFe(t,n,e):r$(isNaN(t)?n:t)}}function pee(e,t){var n=t-e;return n?iFe(e,n):r$(isNaN(e)?t:e)}const xj=function e(t){var n=oFe(t);function r(i,s){var o=n((i=P2(i)).r,(s=P2(s)).r),a=n(i.g,s.g),u=n(i.b,s.b),l=pee(i.opacity,s.opacity);return function(c){return i.r=o(c),i.g=a(c),i.b=u(c),i.opacity=l(c),i+""}}return r.gamma=e,r}(1);function aFe(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(s){for(i=0;in&&(s=t.slice(n,s),a[o]?a[o]+=s:a[++o]=s),(r=r[0])===(i=i[0])?a[o]?a[o]+=i:a[++o]=i:(a[++o]=null,u.push({i:o,x:uT(r,i)})),n=OA.lastIndex;return n=0))throw new Error(`invalid digits: ${e}`);if(t>15)return mee;const n=10**t;return function(r){this._+=r[0];for(let i=1,s=r.length;iMf)if(!(Math.abs(f*u-l*c)>Mf)||!s)this._append`L${this._x1=t},${this._y1=n}`;else{let h=r-o,p=i-a,m=u*u+l*l,y=h*h+p*p,g=Math.sqrt(m),_=Math.sqrt(d),b=s*Math.tan((N2-Math.acos((m+d-y)/(2*g*_)))/2),T=b/_,I=b/g;Math.abs(T-1)>Mf&&this._append`L${t+T*c},${n+T*f}`,this._append`A${s},${s},0,0,${+(f*h>c*p)},${this._x1=t+I*u},${this._y1=n+I*l}`}}arc(t,n,r,i,s,o){if(t=+t,n=+n,r=+r,o=!!o,r<0)throw new Error(`negative radius: ${r}`);let a=r*Math.cos(i),u=r*Math.sin(i),l=t+a,c=n+u,f=1^o,d=o?i-s:s-i;this._x1===null?this._append`M${l},${c}`:(Math.abs(this._x1-l)>Mf||Math.abs(this._y1-c)>Mf)&&this._append`L${l},${c}`,r&&(d<0&&(d=d%k2+k2),d>gFe?this._append`A${r},${r},0,1,${f},${t-a},${n-u}A${r},${r},0,1,${f},${this._x1=l},${this._y1=c}`:d>Mf&&this._append`A${r},${r},0,${+(d>=N2)},${f},${this._x1=t+r*Math.cos(s)},${this._y1=n+r*Math.sin(s)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}var Cj={},PA={},RA=34,Fg=10,NA=13;function gee(e){return new Function("d","return {"+e.map(function(t,n){return JSON.stringify(t)+": d["+n+'] || ""'}).join(",")+"}")}function vFe(e,t){var n=gee(e);return function(r,i){return t(n(r),i,e)}}function Aj(e){var t=Object.create(null),n=[];return e.forEach(function(r){for(var i in r)i in t||n.push(t[i]=i)}),n}function Es(e,t){var n=e+"",r=n.length;return r9999?"+"+Es(e,6):Es(e,4)}function EFe(e){var t=e.getUTCHours(),n=e.getUTCMinutes(),r=e.getUTCSeconds(),i=e.getUTCMilliseconds();return isNaN(e)?"Invalid Date":bFe(e.getUTCFullYear())+"-"+Es(e.getUTCMonth()+1,2)+"-"+Es(e.getUTCDate(),2)+(i?"T"+Es(t,2)+":"+Es(n,2)+":"+Es(r,2)+"."+Es(i,3)+"Z":r?"T"+Es(t,2)+":"+Es(n,2)+":"+Es(r,2)+"Z":n||t?"T"+Es(t,2)+":"+Es(n,2)+"Z":"")}function wFe(e){var t=new RegExp('["'+e+` -\r]`),n=e.charCodeAt(0);function r(f,d){var h,p,m=i(f,function(y,g){if(h)return h(y,g-1);p=y,h=d?vFe(y,d):gee(y)});return m.columns=p||[],m}function i(f,d){var h=[],p=f.length,m=0,y=0,g,_=p<=0,b=!1;f.charCodeAt(p-1)===Fg&&--p,f.charCodeAt(p-1)===NA&&--p;function T(){if(_)return PA;if(b)return b=!1,Cj;var E,S=m,A;if(f.charCodeAt(S)===RA){for(;m++=p?_=!0:(A=f.charCodeAt(m++))===Fg?b=!0:A===NA&&(b=!0,f.charCodeAt(m)===Fg&&++m),f.slice(S+1,E-1).replace(/""/g,'"')}for(;m0?k.createElement(h,u,f):k.createElement(h,u)}function $6e(e){let t=-1;for(;++t for more info)`),delete u1[s]}const t=aDe().use(c3e).use(e.remarkPlugins||[]).use(X3e,{...e.remarkRehypeOptions,allowDangerousHtml:!0}).use(e.rehypePlugins||[]).use(h6e,e),n=new qke;typeof e.children=="string"?n.value=e.children:e.children!==void 0&&e.children!==null&&console.warn(`[react-markdown] Warning: please pass a string as \`children\` (not: \`${e.children}\`)`);const r=t.runSync(t.parse(n),n);if(r.type!=="root")throw new TypeError("Expected a `root` node");let i=k.createElement(k.Fragment,{},dZ({options:e,schema:j_,listDepth:0},r));return e.className&&(i=k.createElement("div",{className:e.className},i)),i}hZ.propTypes={children:ht.string,className:ht.string,allowElement:ht.func,allowedElements:ht.arrayOf(ht.string),disallowedElements:ht.arrayOf(ht.string),unwrapDisallowed:ht.bool,remarkPlugins:ht.arrayOf(ht.oneOfType([ht.object,ht.func,ht.arrayOf(ht.oneOfType([ht.bool,ht.string,ht.object,ht.func,ht.arrayOf(ht.any)]))])),rehypePlugins:ht.arrayOf(ht.oneOfType([ht.object,ht.func,ht.arrayOf(ht.oneOfType([ht.bool,ht.string,ht.object,ht.func,ht.arrayOf(ht.any)]))])),sourcePos:ht.bool,rawSourcePos:ht.bool,skipHtml:ht.bool,includeElementIndex:ht.bool,transformLinkUri:ht.oneOfType([ht.func,ht.bool]),linkTarget:ht.oneOfType([ht.func,ht.string]),transformImageUri:ht.func,components:ht.object};const pZ=-1,NI=0,Jw=1,Zw=2,HD=3,WD=4,qD=5,YD=6,mZ=7,gZ=8,XB=typeof self=="object"?self:globalThis,U6e=(e,t)=>{const n=(i,s)=>(e.set(s,i),i),r=i=>{if(e.has(i))return e.get(i);const[s,o]=t[i];switch(s){case NI:case pZ:return n(o,i);case Jw:{const a=n([],i);for(const u of o)a.push(r(u));return a}case Zw:{const a=n({},i);for(const[u,l]of o)a[r(u)]=r(l);return a}case HD:return n(new Date(o),i);case WD:{const{source:a,flags:u}=o;return n(new RegExp(a,u),i)}case qD:{const a=n(new Map,i);for(const[u,l]of o)a.set(r(u),r(l));return a}case YD:{const a=n(new Set,i);for(const u of o)a.add(r(u));return a}case mZ:{const{name:a,message:u}=o;return n(new XB[a](u),i)}case gZ:return n(BigInt(o),i);case"BigInt":return n(Object(BigInt(o)),i)}return n(new XB[s](o),i)};return r},JB=e=>U6e(new Map,e)(0),wh="",{toString:V6e}={},{keys:z6e}=Object,Dg=e=>{const t=typeof e;if(t!=="object"||!e)return[NI,t];const n=V6e.call(e).slice(8,-1);switch(n){case"Array":return[Jw,wh];case"Object":return[Zw,wh];case"Date":return[HD,wh];case"RegExp":return[WD,wh];case"Map":return[qD,wh];case"Set":return[YD,wh]}return n.includes("Array")?[Jw,n]:n.includes("Error")?[mZ,n]:[Zw,n]},l1=([e,t])=>e===NI&&(t==="function"||t==="symbol"),H6e=(e,t,n,r)=>{const i=(o,a)=>{const u=r.push(o)-1;return n.set(a,u),u},s=o=>{if(n.has(o))return n.get(o);let[a,u]=Dg(o);switch(a){case NI:{let c=o;switch(u){case"bigint":a=gZ,c=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);c=null;break;case"undefined":return i([pZ],o)}return i([a,c],o)}case Jw:{if(u)return i([u,[...o]],o);const c=[],f=i([a,c],o);for(const d of o)c.push(s(d));return f}case Zw:{if(u)switch(u){case"BigInt":return i([u,o.toString()],o);case"Boolean":case"Number":case"String":return i([u,o.valueOf()],o)}if(t&&"toJSON"in o)return s(o.toJSON());const c=[],f=i([a,c],o);for(const d of z6e(o))(e||!l1(Dg(o[d])))&&c.push([s(d),s(o[d])]);return f}case HD:return i([a,o.toISOString()],o);case WD:{const{source:c,flags:f}=o;return i([a,{source:c,flags:f}],o)}case qD:{const c=[],f=i([a,c],o);for(const[d,h]of o)(e||!(l1(Dg(d))||l1(Dg(h))))&&c.push([s(d),s(h)]);return f}case YD:{const c=[],f=i([a,c],o);for(const d of o)(e||!l1(Dg(d)))&&c.push(s(d));return f}}const{message:l}=o;return i([a,{name:u,message:l}],o)};return s},ZB=(e,{json:t,lossy:n}={})=>{const r=[];return H6e(!(t||n),!!t,new Map,r)(e),r},ej=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?JB(ZB(e,t)):structuredClone(e):(e,t)=>JB(ZB(e,t));const tj=/[#.]/g;function W6e(e,t){const n=e||"",r={};let i=0,s,o;for(;i-1&&ss)return{line:o+1,column:s-(o>0?n[o-1]:0)+1,offset:s}}}function i(s){const o=s&&s.line,a=s&&s.column;if(typeof o=="number"&&typeof a=="number"&&!Number.isNaN(o)&&!Number.isNaN(a)&&o-1 in n){const u=(n[o-2]||0)+a-1||0;if(u>-1&&u=55296&&e<=57343}function yLe(e){return e>=56320&&e<=57343}function _Le(e,t){return(e-55296)*1024+9216+t}function TZ(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function SZ(e){return e>=64976&&e<=65007||gLe.has(e)}var _e;(function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeValue="missing-attribute-value",e.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",e.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",e.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",e.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",e.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",e.missingDoctypePublicIdentifier="missing-doctype-public-identifier",e.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",e.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",e.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",e.cdataInHtmlContent="cdata-in-html-content",e.incorrectlyOpenedComment="incorrectly-opened-comment",e.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",e.eofInDoctype="eof-in-doctype",e.nestedComment="nested-comment",e.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",e.eofInComment="eof-in-comment",e.incorrectlyClosedComment="incorrectly-closed-comment",e.eofInCdata="eof-in-cdata",e.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",e.nullCharacterReference="null-character-reference",e.surrogateCharacterReference="surrogate-character-reference",e.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",e.controlCharacterReference="control-character-reference",e.noncharacterCharacterReference="noncharacter-character-reference",e.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",e.missingDoctypeName="missing-doctype-name",e.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",e.duplicateAttribute="duplicate-attribute",e.nonConformingDoctype="non-conforming-doctype",e.missingDoctype="missing-doctype",e.misplacedDoctype="misplaced-doctype",e.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",e.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",e.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",e.openElementsLeftAfterEof="open-elements-left-after-eof",e.abandonedHeadElementChild="abandoned-head-element-child",e.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",e.nestedNoscriptInHead="nested-noscript-in-head",e.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(_e=_e||(_e={}));const vLe=65536;class bLe{constructor(t){this.handler=t,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=vLe,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(t){const{line:n,col:r,offset:i}=this;return{code:t,startLine:n,endLine:n,startCol:r,endCol:r,startOffset:i,endOffset:i}}_err(t){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(t)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(t){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(yLe(n))return this.pos++,this._addGap(),_Le(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,L.EOF;return this._err(_e.surrogateInInputStream),t}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(t,n){this.html.length>0?this.html+=t:this.html=t,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(t){this.html=this.html.substring(0,this.pos+1)+t+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(t,n){if(this.pos+t.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(t,this.pos);for(let r=0;r=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,L.EOF;const r=this.html.charCodeAt(n);return r===L.CARRIAGE_RETURN?L.LINE_FEED:r}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,L.EOF;let t=this.html.charCodeAt(this.pos);return t===L.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,L.LINE_FEED):t===L.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,wZ(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===L.LINE_FEED||t===L.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){TZ(t)?this._err(_e.controlCharacterInInputStream):SZ(t)&&this._err(_e.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}const ic=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),ELe=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0)));var SA;const wLe=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),TLe=(SA=String.fromCodePoint)!==null&&SA!==void 0?SA:function(e){let t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|e&1023),t+=String.fromCharCode(e),t};function SLe(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=wLe.get(e))!==null&&t!==void 0?t:e}var fi;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(fi||(fi={}));const ILe=32;var lu;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(lu||(lu={}));function T2(e){return e>=fi.ZERO&&e<=fi.NINE}function xLe(e){return e>=fi.UPPER_A&&e<=fi.UPPER_F||e>=fi.LOWER_A&&e<=fi.LOWER_F}function CLe(e){return e>=fi.UPPER_A&&e<=fi.UPPER_Z||e>=fi.LOWER_A&&e<=fi.LOWER_Z||T2(e)}function ALe(e){return e===fi.EQUALS||CLe(e)}var oi;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(oi||(oi={}));var Gf;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(Gf||(Gf={}));class OLe{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=oi.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Gf.Strict}startEntity(t){this.decodeMode=t,this.state=oi.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case oi.EntityStart:return t.charCodeAt(n)===fi.NUM?(this.state=oi.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=oi.NamedEntity,this.stateNamedEntity(t,n));case oi.NumericStart:return this.stateNumericStart(t,n);case oi.NumericDecimal:return this.stateNumericDecimal(t,n);case oi.NumericHex:return this.stateNumericHex(t,n);case oi.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|ILe)===fi.LOWER_X?(this.state=oi.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=oi.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,r,i){if(n!==r){const s=r-n;this.result=this.result*Math.pow(i,s)+parseInt(t.substr(n,s),i),this.consumed+=s}}stateNumericHex(t,n){const r=n;for(;n>14;for(;n>14,s!==0){if(o===fi.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==Gf.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:r}=this,i=(r[n]&lu.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,i,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,r){const{decodeTree:i}=this;return this.emitCodePoint(n===1?i[t]&~lu.VALUE_LENGTH:i[t+1],r),n===3&&this.emitCodePoint(i[t+2],r),r}end(){var t;switch(this.state){case oi.NamedEntity:return this.result!==0&&(this.decodeMode!==Gf.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case oi.NumericDecimal:return this.emitNumericEntity(0,2);case oi.NumericHex:return this.emitNumericEntity(0,3);case oi.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case oi.EntityStart:return 0}}}function xZ(e){let t="";const n=new OLe(e,r=>t+=TLe(r));return function(i,s){let o=0,a=0;for(;(a=i.indexOf("&",a))>=0;){t+=i.slice(o,a),n.startEntity(s);const l=n.write(i,a+1);if(l<0){o=a+n.end();break}o=a+l,a=l===0?o+1:o}const u=t+i.slice(o);return t="",u}}function CZ(e,t,n,r){const i=(t&lu.BRANCH_LENGTH)>>7,s=t&lu.JUMP_TABLE;if(i===0)return s!==0&&r===s?n:-1;if(s){const u=r-s;return u<0||u>=i?-1:e[n+u]-1}let o=n,a=o+i-1;for(;o<=a;){const u=o+a>>>1,l=e[u];if(lr)a=u-1;else return e[u+i]}return-1}xZ(ic);xZ(ELe);var Ee;(function(e){e.HTML="http://www.w3.org/1999/xhtml",e.MATHML="http://www.w3.org/1998/Math/MathML",e.SVG="http://www.w3.org/2000/svg",e.XLINK="http://www.w3.org/1999/xlink",e.XML="http://www.w3.org/XML/1998/namespace",e.XMLNS="http://www.w3.org/2000/xmlns/"})(Ee=Ee||(Ee={}));var Vc;(function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"})(Vc=Vc||(Vc={}));var eo;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(eo=eo||(eo={}));var oe;(function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"})(oe=oe||(oe={}));var v;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SECTION=94]="SECTION",e[e.SELECT=95]="SELECT",e[e.SOURCE=96]="SOURCE",e[e.SMALL=97]="SMALL",e[e.SPAN=98]="SPAN",e[e.STRIKE=99]="STRIKE",e[e.STRONG=100]="STRONG",e[e.STYLE=101]="STYLE",e[e.SUB=102]="SUB",e[e.SUMMARY=103]="SUMMARY",e[e.SUP=104]="SUP",e[e.TABLE=105]="TABLE",e[e.TBODY=106]="TBODY",e[e.TEMPLATE=107]="TEMPLATE",e[e.TEXTAREA=108]="TEXTAREA",e[e.TFOOT=109]="TFOOT",e[e.TD=110]="TD",e[e.TH=111]="TH",e[e.THEAD=112]="THEAD",e[e.TITLE=113]="TITLE",e[e.TR=114]="TR",e[e.TRACK=115]="TRACK",e[e.TT=116]="TT",e[e.U=117]="U",e[e.UL=118]="UL",e[e.SVG=119]="SVG",e[e.VAR=120]="VAR",e[e.WBR=121]="WBR",e[e.XMP=122]="XMP"})(v=v||(v={}));const PLe=new Map([[oe.A,v.A],[oe.ADDRESS,v.ADDRESS],[oe.ANNOTATION_XML,v.ANNOTATION_XML],[oe.APPLET,v.APPLET],[oe.AREA,v.AREA],[oe.ARTICLE,v.ARTICLE],[oe.ASIDE,v.ASIDE],[oe.B,v.B],[oe.BASE,v.BASE],[oe.BASEFONT,v.BASEFONT],[oe.BGSOUND,v.BGSOUND],[oe.BIG,v.BIG],[oe.BLOCKQUOTE,v.BLOCKQUOTE],[oe.BODY,v.BODY],[oe.BR,v.BR],[oe.BUTTON,v.BUTTON],[oe.CAPTION,v.CAPTION],[oe.CENTER,v.CENTER],[oe.CODE,v.CODE],[oe.COL,v.COL],[oe.COLGROUP,v.COLGROUP],[oe.DD,v.DD],[oe.DESC,v.DESC],[oe.DETAILS,v.DETAILS],[oe.DIALOG,v.DIALOG],[oe.DIR,v.DIR],[oe.DIV,v.DIV],[oe.DL,v.DL],[oe.DT,v.DT],[oe.EM,v.EM],[oe.EMBED,v.EMBED],[oe.FIELDSET,v.FIELDSET],[oe.FIGCAPTION,v.FIGCAPTION],[oe.FIGURE,v.FIGURE],[oe.FONT,v.FONT],[oe.FOOTER,v.FOOTER],[oe.FOREIGN_OBJECT,v.FOREIGN_OBJECT],[oe.FORM,v.FORM],[oe.FRAME,v.FRAME],[oe.FRAMESET,v.FRAMESET],[oe.H1,v.H1],[oe.H2,v.H2],[oe.H3,v.H3],[oe.H4,v.H4],[oe.H5,v.H5],[oe.H6,v.H6],[oe.HEAD,v.HEAD],[oe.HEADER,v.HEADER],[oe.HGROUP,v.HGROUP],[oe.HR,v.HR],[oe.HTML,v.HTML],[oe.I,v.I],[oe.IMG,v.IMG],[oe.IMAGE,v.IMAGE],[oe.INPUT,v.INPUT],[oe.IFRAME,v.IFRAME],[oe.KEYGEN,v.KEYGEN],[oe.LABEL,v.LABEL],[oe.LI,v.LI],[oe.LINK,v.LINK],[oe.LISTING,v.LISTING],[oe.MAIN,v.MAIN],[oe.MALIGNMARK,v.MALIGNMARK],[oe.MARQUEE,v.MARQUEE],[oe.MATH,v.MATH],[oe.MENU,v.MENU],[oe.META,v.META],[oe.MGLYPH,v.MGLYPH],[oe.MI,v.MI],[oe.MO,v.MO],[oe.MN,v.MN],[oe.MS,v.MS],[oe.MTEXT,v.MTEXT],[oe.NAV,v.NAV],[oe.NOBR,v.NOBR],[oe.NOFRAMES,v.NOFRAMES],[oe.NOEMBED,v.NOEMBED],[oe.NOSCRIPT,v.NOSCRIPT],[oe.OBJECT,v.OBJECT],[oe.OL,v.OL],[oe.OPTGROUP,v.OPTGROUP],[oe.OPTION,v.OPTION],[oe.P,v.P],[oe.PARAM,v.PARAM],[oe.PLAINTEXT,v.PLAINTEXT],[oe.PRE,v.PRE],[oe.RB,v.RB],[oe.RP,v.RP],[oe.RT,v.RT],[oe.RTC,v.RTC],[oe.RUBY,v.RUBY],[oe.S,v.S],[oe.SCRIPT,v.SCRIPT],[oe.SECTION,v.SECTION],[oe.SELECT,v.SELECT],[oe.SOURCE,v.SOURCE],[oe.SMALL,v.SMALL],[oe.SPAN,v.SPAN],[oe.STRIKE,v.STRIKE],[oe.STRONG,v.STRONG],[oe.STYLE,v.STYLE],[oe.SUB,v.SUB],[oe.SUMMARY,v.SUMMARY],[oe.SUP,v.SUP],[oe.TABLE,v.TABLE],[oe.TBODY,v.TBODY],[oe.TEMPLATE,v.TEMPLATE],[oe.TEXTAREA,v.TEXTAREA],[oe.TFOOT,v.TFOOT],[oe.TD,v.TD],[oe.TH,v.TH],[oe.THEAD,v.THEAD],[oe.TITLE,v.TITLE],[oe.TR,v.TR],[oe.TRACK,v.TRACK],[oe.TT,v.TT],[oe.U,v.U],[oe.UL,v.UL],[oe.SVG,v.SVG],[oe.VAR,v.VAR],[oe.WBR,v.WBR],[oe.XMP,v.XMP]]);function Wm(e){var t;return(t=PLe.get(e))!==null&&t!==void 0?t:v.UNKNOWN}const Ae=v,RLe={[Ee.HTML]:new Set([Ae.ADDRESS,Ae.APPLET,Ae.AREA,Ae.ARTICLE,Ae.ASIDE,Ae.BASE,Ae.BASEFONT,Ae.BGSOUND,Ae.BLOCKQUOTE,Ae.BODY,Ae.BR,Ae.BUTTON,Ae.CAPTION,Ae.CENTER,Ae.COL,Ae.COLGROUP,Ae.DD,Ae.DETAILS,Ae.DIR,Ae.DIV,Ae.DL,Ae.DT,Ae.EMBED,Ae.FIELDSET,Ae.FIGCAPTION,Ae.FIGURE,Ae.FOOTER,Ae.FORM,Ae.FRAME,Ae.FRAMESET,Ae.H1,Ae.H2,Ae.H3,Ae.H4,Ae.H5,Ae.H6,Ae.HEAD,Ae.HEADER,Ae.HGROUP,Ae.HR,Ae.HTML,Ae.IFRAME,Ae.IMG,Ae.INPUT,Ae.LI,Ae.LINK,Ae.LISTING,Ae.MAIN,Ae.MARQUEE,Ae.MENU,Ae.META,Ae.NAV,Ae.NOEMBED,Ae.NOFRAMES,Ae.NOSCRIPT,Ae.OBJECT,Ae.OL,Ae.P,Ae.PARAM,Ae.PLAINTEXT,Ae.PRE,Ae.SCRIPT,Ae.SECTION,Ae.SELECT,Ae.SOURCE,Ae.STYLE,Ae.SUMMARY,Ae.TABLE,Ae.TBODY,Ae.TD,Ae.TEMPLATE,Ae.TEXTAREA,Ae.TFOOT,Ae.TH,Ae.THEAD,Ae.TITLE,Ae.TR,Ae.TRACK,Ae.UL,Ae.WBR,Ae.XMP]),[Ee.MATHML]:new Set([Ae.MI,Ae.MO,Ae.MN,Ae.MS,Ae.MTEXT,Ae.ANNOTATION_XML]),[Ee.SVG]:new Set([Ae.TITLE,Ae.FOREIGN_OBJECT,Ae.DESC]),[Ee.XLINK]:new Set,[Ee.XML]:new Set,[Ee.XMLNS]:new Set};function AZ(e){return e===Ae.H1||e===Ae.H2||e===Ae.H3||e===Ae.H4||e===Ae.H5||e===Ae.H6}oe.STYLE,oe.SCRIPT,oe.XMP,oe.IFRAME,oe.NOEMBED,oe.NOFRAMES,oe.PLAINTEXT;const NLe=new Map([[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);var B;(function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.NAMED_CHARACTER_REFERENCE=72]="NAMED_CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=73]="AMBIGUOUS_AMPERSAND",e[e.NUMERIC_CHARACTER_REFERENCE=74]="NUMERIC_CHARACTER_REFERENCE",e[e.HEXADEMICAL_CHARACTER_REFERENCE_START=75]="HEXADEMICAL_CHARACTER_REFERENCE_START",e[e.HEXADEMICAL_CHARACTER_REFERENCE=76]="HEXADEMICAL_CHARACTER_REFERENCE",e[e.DECIMAL_CHARACTER_REFERENCE=77]="DECIMAL_CHARACTER_REFERENCE",e[e.NUMERIC_CHARACTER_REFERENCE_END=78]="NUMERIC_CHARACTER_REFERENCE_END"})(B||(B={}));const Dr={DATA:B.DATA,RCDATA:B.RCDATA,RAWTEXT:B.RAWTEXT,SCRIPT_DATA:B.SCRIPT_DATA,PLAINTEXT:B.PLAINTEXT,CDATA_SECTION:B.CDATA_SECTION};function F0(e){return e>=L.DIGIT_0&&e<=L.DIGIT_9}function o0(e){return e>=L.LATIN_CAPITAL_A&&e<=L.LATIN_CAPITAL_Z}function kLe(e){return e>=L.LATIN_SMALL_A&&e<=L.LATIN_SMALL_Z}function sc(e){return kLe(e)||o0(e)}function S2(e){return sc(e)||F0(e)}function OZ(e){return e>=L.LATIN_CAPITAL_A&&e<=L.LATIN_CAPITAL_F}function PZ(e){return e>=L.LATIN_SMALL_A&&e<=L.LATIN_SMALL_F}function DLe(e){return F0(e)||OZ(e)||PZ(e)}function c1(e){return e+32}function RZ(e){return e===L.SPACE||e===L.LINE_FEED||e===L.TABULATION||e===L.FORM_FEED}function $Le(e){return e===L.EQUALS_SIGN||S2(e)}function sj(e){return RZ(e)||e===L.SOLIDUS||e===L.GREATER_THAN_SIGN}class LLe{constructor(t,n){this.options=t,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=B.DATA,this.returnState=B.DATA,this.charRefCode=-1,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new bLe(n),this.currentLocation=this.getCurrentLocation(-1)}_err(t){var n,r;(r=(n=this.handler).onParseError)===null||r===void 0||r.call(n,this.preprocessor.getError(t))}getCurrentLocation(t){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-t,startOffset:this.preprocessor.offset-t,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const t=this._consume();this._ensureHibernation()||this._callState(t)}this.inLoop=!1}}pause(){this.paused=!0}resume(t){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||t==null||t())}write(t,n,r){this.active=!0,this.preprocessor.write(t,n),this._runParsingLoop(),this.paused||r==null||r()}insertHtmlAtCurrentPos(t){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(t),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this._unconsume(this.consumedAfterSnapshot),this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_unconsume(t){this.consumedAfterSnapshot-=t,this.preprocessor.retreat(t)}_reconsumeInState(t,n){this.state=t,this._callState(n)}_advanceBy(t){this.consumedAfterSnapshot+=t;for(let n=0;n0&&this._err(_e.endTagWithAttributes),t.selfClosing&&this._err(_e.endTagWithTrailingSolidus),this.handler.onEndTag(t)),this.preprocessor.dropParsedChunk()}emitCurrentComment(t){this.prepareToken(t),this.handler.onComment(t),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(t){this.prepareToken(t),this.handler.onDoctype(t),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(t){if(this.currentCharacterToken){switch(t&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=t.startLine,this.currentCharacterToken.location.endCol=t.startCol,this.currentCharacterToken.location.endOffset=t.startOffset),this.currentCharacterToken.type){case Ht.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case Ht.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case Ht.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const t=this.getCurrentLocation(0);t&&(t.endLine=t.startLine,t.endCol=t.startCol,t.endOffset=t.startOffset),this._emitCurrentCharacterToken(t),this.handler.onEof({type:Ht.EOF,location:t}),this.active=!1}_appendCharToCurrentCharacterToken(t,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type!==t)this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();else{this.currentCharacterToken.chars+=n;return}this._createCharacterToken(t,n)}_emitCodePoint(t){const n=RZ(t)?Ht.WHITESPACE_CHARACTER:t===L.NULL?Ht.NULL_CHARACTER:Ht.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(Ht.CHARACTER,t)}_matchNamedCharacterReference(t){let n=null,r=0,i=!1;for(let s=0,o=ic[0];s>=0&&(s=CZ(ic,o,s+1,t),!(s<0));t=this._consume()){r+=1,o=ic[s];const a=o&lu.VALUE_LENGTH;if(a){const u=(a>>14)-1;if(t!==L.SEMICOLON&&this._isCharacterReferenceInAttribute()&&$Le(this.preprocessor.peek(1))?(n=[L.AMPERSAND],s+=u):(n=u===0?[ic[s]&~lu.VALUE_LENGTH]:u===1?[ic[++s]]:[ic[++s],ic[++s]],r=0,i=t!==L.SEMICOLON),u===0){this._consume();break}}}return this._unconsume(r),i&&!this.preprocessor.endOfChunkHit&&this._err(_e.missingSemicolonAfterCharacterReference),this._unconsume(1),n}_isCharacterReferenceInAttribute(){return this.returnState===B.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===B.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===B.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case B.DATA:{this._stateData(t);break}case B.RCDATA:{this._stateRcdata(t);break}case B.RAWTEXT:{this._stateRawtext(t);break}case B.SCRIPT_DATA:{this._stateScriptData(t);break}case B.PLAINTEXT:{this._statePlaintext(t);break}case B.TAG_OPEN:{this._stateTagOpen(t);break}case B.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case B.TAG_NAME:{this._stateTagName(t);break}case B.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case B.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case B.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case B.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case B.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case B.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case B.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case B.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case B.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case B.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case B.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case B.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case B.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case B.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case B.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case B.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case B.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case B.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case B.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case B.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case B.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case B.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case B.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case B.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case B.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case B.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case B.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case B.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case B.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case B.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case B.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case B.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case B.BOGUS_COMMENT:{this._stateBogusComment(t);break}case B.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case B.COMMENT_START:{this._stateCommentStart(t);break}case B.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case B.COMMENT:{this._stateComment(t);break}case B.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case B.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case B.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case B.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case B.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case B.COMMENT_END:{this._stateCommentEnd(t);break}case B.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case B.DOCTYPE:{this._stateDoctype(t);break}case B.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case B.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case B.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case B.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case B.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case B.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case B.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case B.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case B.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case B.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case B.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case B.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case B.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case B.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case B.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case B.CDATA_SECTION:{this._stateCdataSection(t);break}case B.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case B.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case B.CHARACTER_REFERENCE:{this._stateCharacterReference(t);break}case B.NAMED_CHARACTER_REFERENCE:{this._stateNamedCharacterReference(t);break}case B.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}case B.NUMERIC_CHARACTER_REFERENCE:{this._stateNumericCharacterReference(t);break}case B.HEXADEMICAL_CHARACTER_REFERENCE_START:{this._stateHexademicalCharacterReferenceStart(t);break}case B.HEXADEMICAL_CHARACTER_REFERENCE:{this._stateHexademicalCharacterReference(t);break}case B.DECIMAL_CHARACTER_REFERENCE:{this._stateDecimalCharacterReference(t);break}case B.NUMERIC_CHARACTER_REFERENCE_END:{this._stateNumericCharacterReferenceEnd(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case L.LESS_THAN_SIGN:{this.state=B.TAG_OPEN;break}case L.AMPERSAND:{this.returnState=B.DATA,this.state=B.CHARACTER_REFERENCE;break}case L.NULL:{this._err(_e.unexpectedNullCharacter),this._emitCodePoint(t);break}case L.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case L.AMPERSAND:{this.returnState=B.RCDATA,this.state=B.CHARACTER_REFERENCE;break}case L.LESS_THAN_SIGN:{this.state=B.RCDATA_LESS_THAN_SIGN;break}case L.NULL:{this._err(_e.unexpectedNullCharacter),this._emitChars(sr);break}case L.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case L.LESS_THAN_SIGN:{this.state=B.RAWTEXT_LESS_THAN_SIGN;break}case L.NULL:{this._err(_e.unexpectedNullCharacter),this._emitChars(sr);break}case L.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case L.LESS_THAN_SIGN:{this.state=B.SCRIPT_DATA_LESS_THAN_SIGN;break}case L.NULL:{this._err(_e.unexpectedNullCharacter),this._emitChars(sr);break}case L.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case L.NULL:{this._err(_e.unexpectedNullCharacter),this._emitChars(sr);break}case L.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(sc(t))this._createStartTagToken(),this.state=B.TAG_NAME,this._stateTagName(t);else switch(t){case L.EXCLAMATION_MARK:{this.state=B.MARKUP_DECLARATION_OPEN;break}case L.SOLIDUS:{this.state=B.END_TAG_OPEN;break}case L.QUESTION_MARK:{this._err(_e.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=B.BOGUS_COMMENT,this._stateBogusComment(t);break}case L.EOF:{this._err(_e.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(_e.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=B.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(sc(t))this._createEndTagToken(),this.state=B.TAG_NAME,this._stateTagName(t);else switch(t){case L.GREATER_THAN_SIGN:{this._err(_e.missingEndTagName),this.state=B.DATA;break}case L.EOF:{this._err(_e.eofBeforeTagName),this._emitChars("");break}case L.NULL:{this._err(_e.unexpectedNullCharacter),this.state=B.SCRIPT_DATA_ESCAPED,this._emitChars(sr);break}case L.EOF:{this._err(_e.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=B.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===L.SOLIDUS?this.state=B.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:sc(t)?(this._emitChars("<"),this.state=B.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=B.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){sc(t)?(this.state=B.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("");break}case L.NULL:{this._err(_e.unexpectedNullCharacter),this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(sr);break}case L.EOF:{this._err(_e.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===L.SOLIDUS?(this.state=B.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(_s.SCRIPT,!1)&&sj(this.preprocessor.peek(_s.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<_s.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=B.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateBeforeAttributeName(t){switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:break;case L.SOLIDUS:case L.GREATER_THAN_SIGN:case L.EOF:{this.state=B.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case L.EQUALS_SIGN:{this._err(_e.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=B.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=B.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateAttributeName(t){switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:case L.SOLIDUS:case L.GREATER_THAN_SIGN:case L.EOF:{this._leaveAttrName(),this.state=B.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case L.EQUALS_SIGN:{this._leaveAttrName(),this.state=B.BEFORE_ATTRIBUTE_VALUE;break}case L.QUOTATION_MARK:case L.APOSTROPHE:case L.LESS_THAN_SIGN:{this._err(_e.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case L.NULL:{this._err(_e.unexpectedNullCharacter),this.currentAttr.name+=sr;break}default:this.currentAttr.name+=String.fromCodePoint(o0(t)?c1(t):t)}}_stateAfterAttributeName(t){switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:break;case L.SOLIDUS:{this.state=B.SELF_CLOSING_START_TAG;break}case L.EQUALS_SIGN:{this.state=B.BEFORE_ATTRIBUTE_VALUE;break}case L.GREATER_THAN_SIGN:{this.state=B.DATA,this.emitCurrentTagToken();break}case L.EOF:{this._err(_e.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=B.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateBeforeAttributeValue(t){switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:break;case L.QUOTATION_MARK:{this.state=B.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case L.APOSTROPHE:{this.state=B.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case L.GREATER_THAN_SIGN:{this._err(_e.missingAttributeValue),this.state=B.DATA,this.emitCurrentTagToken();break}default:this.state=B.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case L.QUOTATION_MARK:{this.state=B.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case L.AMPERSAND:{this.returnState=B.ATTRIBUTE_VALUE_DOUBLE_QUOTED,this.state=B.CHARACTER_REFERENCE;break}case L.NULL:{this._err(_e.unexpectedNullCharacter),this.currentAttr.value+=sr;break}case L.EOF:{this._err(_e.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case L.APOSTROPHE:{this.state=B.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case L.AMPERSAND:{this.returnState=B.ATTRIBUTE_VALUE_SINGLE_QUOTED,this.state=B.CHARACTER_REFERENCE;break}case L.NULL:{this._err(_e.unexpectedNullCharacter),this.currentAttr.value+=sr;break}case L.EOF:{this._err(_e.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueUnquoted(t){switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:{this._leaveAttrValue(),this.state=B.BEFORE_ATTRIBUTE_NAME;break}case L.AMPERSAND:{this.returnState=B.ATTRIBUTE_VALUE_UNQUOTED,this.state=B.CHARACTER_REFERENCE;break}case L.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=B.DATA,this.emitCurrentTagToken();break}case L.NULL:{this._err(_e.unexpectedNullCharacter),this.currentAttr.value+=sr;break}case L.QUOTATION_MARK:case L.APOSTROPHE:case L.LESS_THAN_SIGN:case L.EQUALS_SIGN:case L.GRAVE_ACCENT:{this._err(_e.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case L.EOF:{this._err(_e.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAfterAttributeValueQuoted(t){switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:{this._leaveAttrValue(),this.state=B.BEFORE_ATTRIBUTE_NAME;break}case L.SOLIDUS:{this._leaveAttrValue(),this.state=B.SELF_CLOSING_START_TAG;break}case L.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=B.DATA,this.emitCurrentTagToken();break}case L.EOF:{this._err(_e.eofInTag),this._emitEOFToken();break}default:this._err(_e.missingWhitespaceBetweenAttributes),this.state=B.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case L.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=B.DATA,this.emitCurrentTagToken();break}case L.EOF:{this._err(_e.eofInTag),this._emitEOFToken();break}default:this._err(_e.unexpectedSolidusInTag),this.state=B.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){const n=this.currentToken;switch(t){case L.GREATER_THAN_SIGN:{this.state=B.DATA,this.emitCurrentComment(n);break}case L.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case L.NULL:{this._err(_e.unexpectedNullCharacter),n.data+=sr;break}default:n.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch(_s.DASH_DASH,!0)?(this._createCommentToken(_s.DASH_DASH.length+1),this.state=B.COMMENT_START):this._consumeSequenceIfMatch(_s.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(_s.DOCTYPE.length+1),this.state=B.DOCTYPE):this._consumeSequenceIfMatch(_s.CDATA_START,!0)?this.inForeignNode?this.state=B.CDATA_SECTION:(this._err(_e.cdataInHtmlContent),this._createCommentToken(_s.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=B.BOGUS_COMMENT):this._ensureHibernation()||(this._err(_e.incorrectlyOpenedComment),this._createCommentToken(2),this.state=B.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case L.HYPHEN_MINUS:{this.state=B.COMMENT_START_DASH;break}case L.GREATER_THAN_SIGN:{this._err(_e.abruptClosingOfEmptyComment),this.state=B.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=B.COMMENT,this._stateComment(t)}}_stateCommentStartDash(t){const n=this.currentToken;switch(t){case L.HYPHEN_MINUS:{this.state=B.COMMENT_END;break}case L.GREATER_THAN_SIGN:{this._err(_e.abruptClosingOfEmptyComment),this.state=B.DATA,this.emitCurrentComment(n);break}case L.EOF:{this._err(_e.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=B.COMMENT,this._stateComment(t)}}_stateComment(t){const n=this.currentToken;switch(t){case L.HYPHEN_MINUS:{this.state=B.COMMENT_END_DASH;break}case L.LESS_THAN_SIGN:{n.data+="<",this.state=B.COMMENT_LESS_THAN_SIGN;break}case L.NULL:{this._err(_e.unexpectedNullCharacter),n.data+=sr;break}case L.EOF:{this._err(_e.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(t)}}_stateCommentLessThanSign(t){const n=this.currentToken;switch(t){case L.EXCLAMATION_MARK:{n.data+="!",this.state=B.COMMENT_LESS_THAN_SIGN_BANG;break}case L.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=B.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===L.HYPHEN_MINUS?this.state=B.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=B.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===L.HYPHEN_MINUS?this.state=B.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=B.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==L.GREATER_THAN_SIGN&&t!==L.EOF&&this._err(_e.nestedComment),this.state=B.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){const n=this.currentToken;switch(t){case L.HYPHEN_MINUS:{this.state=B.COMMENT_END;break}case L.EOF:{this._err(_e.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=B.COMMENT,this._stateComment(t)}}_stateCommentEnd(t){const n=this.currentToken;switch(t){case L.GREATER_THAN_SIGN:{this.state=B.DATA,this.emitCurrentComment(n);break}case L.EXCLAMATION_MARK:{this.state=B.COMMENT_END_BANG;break}case L.HYPHEN_MINUS:{n.data+="-";break}case L.EOF:{this._err(_e.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=B.COMMENT,this._stateComment(t)}}_stateCommentEndBang(t){const n=this.currentToken;switch(t){case L.HYPHEN_MINUS:{n.data+="--!",this.state=B.COMMENT_END_DASH;break}case L.GREATER_THAN_SIGN:{this._err(_e.incorrectlyClosedComment),this.state=B.DATA,this.emitCurrentComment(n);break}case L.EOF:{this._err(_e.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=B.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:{this.state=B.BEFORE_DOCTYPE_NAME;break}case L.GREATER_THAN_SIGN:{this.state=B.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case L.EOF:{this._err(_e.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(_e.missingWhitespaceBeforeDoctypeName),this.state=B.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(o0(t))this._createDoctypeToken(String.fromCharCode(c1(t))),this.state=B.DOCTYPE_NAME;else switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:break;case L.NULL:{this._err(_e.unexpectedNullCharacter),this._createDoctypeToken(sr),this.state=B.DOCTYPE_NAME;break}case L.GREATER_THAN_SIGN:{this._err(_e.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=B.DATA;break}case L.EOF:{this._err(_e.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(t)),this.state=B.DOCTYPE_NAME}}_stateDoctypeName(t){const n=this.currentToken;switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:{this.state=B.AFTER_DOCTYPE_NAME;break}case L.GREATER_THAN_SIGN:{this.state=B.DATA,this.emitCurrentDoctype(n);break}case L.NULL:{this._err(_e.unexpectedNullCharacter),n.name+=sr;break}case L.EOF:{this._err(_e.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(o0(t)?c1(t):t)}}_stateAfterDoctypeName(t){const n=this.currentToken;switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:break;case L.GREATER_THAN_SIGN:{this.state=B.DATA,this.emitCurrentDoctype(n);break}case L.EOF:{this._err(_e.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(_s.PUBLIC,!1)?this.state=B.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(_s.SYSTEM,!1)?this.state=B.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(_e.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=B.BOGUS_DOCTYPE,this._stateBogusDoctype(t))}}_stateAfterDoctypePublicKeyword(t){const n=this.currentToken;switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:{this.state=B.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case L.QUOTATION_MARK:{this._err(_e.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=B.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case L.APOSTROPHE:{this._err(_e.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=B.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case L.GREATER_THAN_SIGN:{this._err(_e.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=B.DATA,this.emitCurrentDoctype(n);break}case L.EOF:{this._err(_e.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(_e.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=B.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:break;case L.QUOTATION_MARK:{n.publicId="",this.state=B.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case L.APOSTROPHE:{n.publicId="",this.state=B.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case L.GREATER_THAN_SIGN:{this._err(_e.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=B.DATA,this.emitCurrentDoctype(n);break}case L.EOF:{this._err(_e.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(_e.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=B.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case L.QUOTATION_MARK:{this.state=B.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case L.NULL:{this._err(_e.unexpectedNullCharacter),n.publicId+=sr;break}case L.GREATER_THAN_SIGN:{this._err(_e.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=B.DATA;break}case L.EOF:{this._err(_e.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateDoctypePublicIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case L.APOSTROPHE:{this.state=B.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case L.NULL:{this._err(_e.unexpectedNullCharacter),n.publicId+=sr;break}case L.GREATER_THAN_SIGN:{this._err(_e.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=B.DATA;break}case L.EOF:{this._err(_e.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateAfterDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:{this.state=B.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case L.GREATER_THAN_SIGN:{this.state=B.DATA,this.emitCurrentDoctype(n);break}case L.QUOTATION_MARK:{this._err(_e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=B.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case L.APOSTROPHE:{this._err(_e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=B.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case L.EOF:{this._err(_e.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(_e.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=B.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBetweenDoctypePublicAndSystemIdentifiers(t){const n=this.currentToken;switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:break;case L.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=B.DATA;break}case L.QUOTATION_MARK:{n.systemId="",this.state=B.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case L.APOSTROPHE:{n.systemId="",this.state=B.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case L.EOF:{this._err(_e.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(_e.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=B.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateAfterDoctypeSystemKeyword(t){const n=this.currentToken;switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:{this.state=B.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case L.QUOTATION_MARK:{this._err(_e.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=B.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case L.APOSTROPHE:{this._err(_e.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=B.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case L.GREATER_THAN_SIGN:{this._err(_e.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=B.DATA,this.emitCurrentDoctype(n);break}case L.EOF:{this._err(_e.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(_e.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=B.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:break;case L.QUOTATION_MARK:{n.systemId="",this.state=B.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case L.APOSTROPHE:{n.systemId="",this.state=B.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case L.GREATER_THAN_SIGN:{this._err(_e.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=B.DATA,this.emitCurrentDoctype(n);break}case L.EOF:{this._err(_e.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(_e.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=B.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case L.QUOTATION_MARK:{this.state=B.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case L.NULL:{this._err(_e.unexpectedNullCharacter),n.systemId+=sr;break}case L.GREATER_THAN_SIGN:{this._err(_e.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=B.DATA;break}case L.EOF:{this._err(_e.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateDoctypeSystemIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case L.APOSTROPHE:{this.state=B.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case L.NULL:{this._err(_e.unexpectedNullCharacter),n.systemId+=sr;break}case L.GREATER_THAN_SIGN:{this._err(_e.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=B.DATA;break}case L.EOF:{this._err(_e.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateAfterDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:break;case L.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=B.DATA;break}case L.EOF:{this._err(_e.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(_e.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=B.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){const n=this.currentToken;switch(t){case L.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=B.DATA;break}case L.NULL:{this._err(_e.unexpectedNullCharacter);break}case L.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(t){switch(t){case L.RIGHT_SQUARE_BRACKET:{this.state=B.CDATA_SECTION_BRACKET;break}case L.EOF:{this._err(_e.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===L.RIGHT_SQUARE_BRACKET?this.state=B.CDATA_SECTION_END:(this._emitChars("]"),this.state=B.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case L.GREATER_THAN_SIGN:{this.state=B.DATA;break}case L.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=B.CDATA_SECTION,this._stateCdataSection(t)}}_stateCharacterReference(t){t===L.NUMBER_SIGN?this.state=B.NUMERIC_CHARACTER_REFERENCE:S2(t)?(this.state=B.NAMED_CHARACTER_REFERENCE,this._stateNamedCharacterReference(t)):(this._flushCodePointConsumedAsCharacterReference(L.AMPERSAND),this._reconsumeInState(this.returnState,t))}_stateNamedCharacterReference(t){const n=this._matchNamedCharacterReference(t);if(!this._ensureHibernation())if(n){for(let r=0;r1114111)this._err(_e.characterReferenceOutsideUnicodeRange),this.charRefCode=L.REPLACEMENT_CHARACTER;else if(wZ(this.charRefCode))this._err(_e.surrogateCharacterReference),this.charRefCode=L.REPLACEMENT_CHARACTER;else if(SZ(this.charRefCode))this._err(_e.noncharacterCharacterReference);else if(TZ(this.charRefCode)||this.charRefCode===L.CARRIAGE_RETURN){this._err(_e.controlCharacterReference);const n=NLe.get(this.charRefCode);n!==void 0&&(this.charRefCode=n)}this._flushCodePointConsumedAsCharacterReference(this.charRefCode),this._reconsumeInState(this.returnState,t)}}const NZ=new Set([v.DD,v.DT,v.LI,v.OPTGROUP,v.OPTION,v.P,v.RB,v.RP,v.RT,v.RTC]),oj=new Set([...NZ,v.CAPTION,v.COLGROUP,v.TBODY,v.TD,v.TFOOT,v.TH,v.THEAD,v.TR]),f1=new Map([[v.APPLET,Ee.HTML],[v.CAPTION,Ee.HTML],[v.HTML,Ee.HTML],[v.MARQUEE,Ee.HTML],[v.OBJECT,Ee.HTML],[v.TABLE,Ee.HTML],[v.TD,Ee.HTML],[v.TEMPLATE,Ee.HTML],[v.TH,Ee.HTML],[v.ANNOTATION_XML,Ee.MATHML],[v.MI,Ee.MATHML],[v.MN,Ee.MATHML],[v.MO,Ee.MATHML],[v.MS,Ee.MATHML],[v.MTEXT,Ee.MATHML],[v.DESC,Ee.SVG],[v.FOREIGN_OBJECT,Ee.SVG],[v.TITLE,Ee.SVG]]),MLe=[v.H1,v.H2,v.H3,v.H4,v.H5,v.H6],FLe=[v.TR,v.TEMPLATE,v.HTML],BLe=[v.TBODY,v.TFOOT,v.THEAD,v.TEMPLATE,v.HTML],jLe=[v.TABLE,v.TEMPLATE,v.HTML],ULe=[v.TD,v.TH];class VLe{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(t,n,r){this.treeAdapter=n,this.handler=r,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=v.UNKNOWN,this.current=t}_indexOf(t){return this.items.lastIndexOf(t,this.stackTop)}_isInTemplate(){return this.currentTagId===v.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===Ee.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(t,n){this.stackTop++,this.items[this.stackTop]=t,this.current=t,this.tagIDs[this.stackTop]=n,this.currentTagId=n,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(t,n,!0)}pop(){const t=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!0)}replace(t,n){const r=this._indexOf(t);this.items[r]=n,r===this.stackTop&&(this.current=n)}insertAfter(t,n,r){const i=this._indexOf(t)+1;this.items.splice(i,0,n),this.tagIDs.splice(i,0,r),this.stackTop++,i===this.stackTop&&this._updateCurrentElement(),this.handler.onItemPush(this.current,this.currentTagId,i===this.stackTop)}popUntilTagNamePopped(t){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(t,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==Ee.HTML);this.shortenToLength(n<0?0:n)}shortenToLength(t){for(;this.stackTop>=t;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop=0;r--)if(t.includes(this.tagIDs[r])&&this.treeAdapter.getNamespaceURI(this.items[r])===n)return r;return-1}clearBackTo(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(r+1)}clearBackToTableContext(){this.clearBackTo(jLe,Ee.HTML)}clearBackToTableBodyContext(){this.clearBackTo(BLe,Ee.HTML)}clearBackToTableRowContext(){this.clearBackTo(FLe,Ee.HTML)}remove(t){const n=this._indexOf(t);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===v.BODY?this.items[1]:null}contains(t){return this._indexOf(t)>-1}getCommonAncestor(t){const n=this._indexOf(t)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===v.HTML}hasInScope(t){for(let n=this.stackTop;n>=0;n--){const r=this.tagIDs[n],i=this.treeAdapter.getNamespaceURI(this.items[n]);if(r===t&&i===Ee.HTML)return!0;if(f1.get(r)===i)return!1}return!0}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t],r=this.treeAdapter.getNamespaceURI(this.items[t]);if(AZ(n)&&r===Ee.HTML)return!0;if(f1.get(n)===r)return!1}return!0}hasInListItemScope(t){for(let n=this.stackTop;n>=0;n--){const r=this.tagIDs[n],i=this.treeAdapter.getNamespaceURI(this.items[n]);if(r===t&&i===Ee.HTML)return!0;if((r===v.UL||r===v.OL)&&i===Ee.HTML||f1.get(r)===i)return!1}return!0}hasInButtonScope(t){for(let n=this.stackTop;n>=0;n--){const r=this.tagIDs[n],i=this.treeAdapter.getNamespaceURI(this.items[n]);if(r===t&&i===Ee.HTML)return!0;if(r===v.BUTTON&&i===Ee.HTML||f1.get(r)===i)return!1}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--){const r=this.tagIDs[n];if(this.treeAdapter.getNamespaceURI(this.items[n])===Ee.HTML){if(r===t)return!0;if(r===v.TABLE||r===v.TEMPLATE||r===v.HTML)return!1}}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];if(this.treeAdapter.getNamespaceURI(this.items[t])===Ee.HTML){if(n===v.TBODY||n===v.THEAD||n===v.TFOOT)return!0;if(n===v.TABLE||n===v.HTML)return!1}}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--){const r=this.tagIDs[n];if(this.treeAdapter.getNamespaceURI(this.items[n])===Ee.HTML){if(r===t)return!0;if(r!==v.OPTION&&r!==v.OPTGROUP)return!1}}return!0}generateImpliedEndTags(){for(;NZ.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;oj.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==t&&oj.has(this.currentTagId);)this.pop()}}const IA=3;var ga;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(ga=ga||(ga={}));const aj={type:ga.Marker};class zLe{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const r=[],i=n.length,s=this.treeAdapter.getTagName(t),o=this.treeAdapter.getNamespaceURI(t);for(let a=0;a[o.name,o.value]));let s=0;for(let o=0;oi.get(u.name)===u.value)&&(s+=1,s>=IA&&this.entries.splice(a.idx,1))}}insertMarker(){this.entries.unshift(aj)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:ga.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:ga.Element,element:t,token:n})}removeEntry(t){const n=this.entries.indexOf(t);n>=0&&this.entries.splice(n,1)}clearToLastMarker(){const t=this.entries.indexOf(aj);t>=0?this.entries.splice(0,t+1):this.entries.length=0}getElementEntryInScopeWithTagName(t){const n=this.entries.find(r=>r.type===ga.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===ga.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===ga.Element&&n.element===t)}}function uj(e){return{nodeName:"#text",value:e,parentNode:null}}const Ph={createDocument(){return{nodeName:"#document",mode:eo.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:"#comment",data:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){const r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){const i=e.childNodes.find(s=>s.nodeName==="#documentType");if(i)i.name=t,i.publicId=n,i.systemId=r;else{const s={nodeName:"#documentType",name:t,publicId:n,systemId:r,parentNode:null};Ph.appendChild(e,s)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){const n=e.childNodes[e.childNodes.length-1];if(Ph.isTextNode(n)){n.value+=t;return}}Ph.appendChild(e,uj(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&Ph.isTextNode(r)?r.value+=t:Ph.insertBefore(e,uj(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(r=>r.name));for(let r=0;re.startsWith(n))}function KLe(e){return e.name===kZ&&e.publicId===null&&(e.systemId===null||e.systemId===HLe)}function QLe(e){if(e.name!==kZ)return eo.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===WLe)return eo.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),YLe.has(n))return eo.QUIRKS;let r=t===null?qLe:DZ;if(lj(n,r))return eo.QUIRKS;if(r=t===null?$Z:GLe,lj(n,r))return eo.LIMITED_QUIRKS}return eo.NO_QUIRKS}const cj={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},XLe="definitionurl",JLe="definitionURL",ZLe=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(e=>[e.toLowerCase(),e])),eMe=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:Ee.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:Ee.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:Ee.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:Ee.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:Ee.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:Ee.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:Ee.XLINK}],["xml:base",{prefix:"xml",name:"base",namespace:Ee.XML}],["xml:lang",{prefix:"xml",name:"lang",namespace:Ee.XML}],["xml:space",{prefix:"xml",name:"space",namespace:Ee.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:Ee.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:Ee.XMLNS}]]),tMe=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(e=>[e.toLowerCase(),e])),nMe=new Set([v.B,v.BIG,v.BLOCKQUOTE,v.BODY,v.BR,v.CENTER,v.CODE,v.DD,v.DIV,v.DL,v.DT,v.EM,v.EMBED,v.H1,v.H2,v.H3,v.H4,v.H5,v.H6,v.HEAD,v.HR,v.I,v.IMG,v.LI,v.LISTING,v.MENU,v.META,v.NOBR,v.OL,v.P,v.PRE,v.RUBY,v.S,v.SMALL,v.SPAN,v.STRONG,v.STRIKE,v.SUB,v.SUP,v.TABLE,v.TT,v.U,v.UL,v.VAR]);function rMe(e){const t=e.tagID;return t===v.FONT&&e.attrs.some(({name:r})=>r===Vc.COLOR||r===Vc.SIZE||r===Vc.FACE)||nMe.has(t)}function LZ(e){for(let t=0;t0&&this._setContextModes(t,n)}onItemPop(t,n){var r,i;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(i=(r=this.treeAdapter).onItemPop)===null||i===void 0||i.call(r,t,this.openElements.current),n){let s,o;this.openElements.stackTop===0&&this.fragmentContext?(s=this.fragmentContext,o=this.fragmentContextID):{current:s,currentTagId:o}=this.openElements,this._setContextModes(s,o)}}_setContextModes(t,n){const r=t===this.document||this.treeAdapter.getNamespaceURI(t)===Ee.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,Ee.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=W.TEXT}switchToPlaintextParsing(){this.insertionMode=W.TEXT,this.originalInsertionMode=W.IN_BODY,this.tokenizer.state=Dr.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let t=this.fragmentContext;for(;t;){if(this.treeAdapter.getTagName(t)===oe.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==Ee.HTML))switch(this.fragmentContextID){case v.TITLE:case v.TEXTAREA:{this.tokenizer.state=Dr.RCDATA;break}case v.STYLE:case v.XMP:case v.IFRAME:case v.NOEMBED:case v.NOFRAMES:case v.NOSCRIPT:{this.tokenizer.state=Dr.RAWTEXT;break}case v.SCRIPT:{this.tokenizer.state=Dr.SCRIPT_DATA;break}case v.PLAINTEXT:{this.tokenizer.state=Dr.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",r=t.publicId||"",i=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,i),t.location){const o=this.treeAdapter.getChildNodes(this.document).find(a=>this.treeAdapter.isDocumentTypeNode(a));o&&this.treeAdapter.setNodeSourceCodeLocation(o,t.location)}}_attachElementToTree(t,n){if(this.options.sourceCodeLocationInfo){const r=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(t,r)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const r=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(r,t)}}_appendElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location)}_insertElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location),this.openElements.push(r,t.tagID)}_insertFakeElement(t,n){const r=this.treeAdapter.createElement(t,Ee.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,Ee.HTML,t.attrs),r=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,r),this._attachElementToTree(n,t.location),this.openElements.push(n,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,null)}_insertFakeRootElement(){const t=this.treeAdapter.createElement(oe.HTML,Ee.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,v.HTML)}_appendCommentNode(t,n){const r=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(n,r),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,t.location)}_insertCharacters(t){let n,r;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:r}=this._findFosterParentingLocation(),r?this.treeAdapter.insertTextBefore(n,t.chars,r):this.treeAdapter.insertText(n,t.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,t.chars)),!t.location)return;const i=this.treeAdapter.getChildNodes(n),s=r?i.lastIndexOf(r):i.length,o=i[s-1];if(this.treeAdapter.getNodeSourceCodeLocation(o)){const{endLine:u,endCol:l,endOffset:c}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(o,{endLine:u,endCol:l,endOffset:c})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(o,t.location)}_adoptNodes(t,n){for(let r=this.treeAdapter.getFirstChild(t);r;r=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(n,r)}_setEndLocation(t,n){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&n.location){const r=n.location,i=this.treeAdapter.getTagName(t),s=n.type===Ht.END_TAG&&i===n.tagName?{endTag:{...r},endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,s)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let n,r;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,r=this.fragmentContextID):{current:n,currentTagId:r}=this.openElements,t.tagID===v.SVG&&this.treeAdapter.getTagName(n)===oe.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===Ee.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===v.MGLYPH||t.tagID===v.MALIGNMARK)&&!this._isIntegrationPoint(r,n,Ee.HTML)}_processToken(t){switch(t.type){case Ht.CHARACTER:{this.onCharacter(t);break}case Ht.NULL_CHARACTER:{this.onNullCharacter(t);break}case Ht.COMMENT:{this.onComment(t);break}case Ht.DOCTYPE:{this.onDoctype(t);break}case Ht.START_TAG:{this._processStartTag(t);break}case Ht.END_TAG:{this.onEndTag(t);break}case Ht.EOF:{this.onEof(t);break}case Ht.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){const i=this.treeAdapter.getNamespaceURI(n),s=this.treeAdapter.getAttrList(n);return aMe(t,i,s,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(i=>i.type===ga.Marker||this.openElements.contains(i.element)),r=n<0?t-1:n-1;for(let i=r;i>=0;i--){const s=this.activeFormattingElements.entries[i];this._insertElement(s.token,this.treeAdapter.getNamespaceURI(s.element)),s.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=W.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(v.P),this.openElements.popUntilTagNamePopped(v.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case v.TR:{this.insertionMode=W.IN_ROW;return}case v.TBODY:case v.THEAD:case v.TFOOT:{this.insertionMode=W.IN_TABLE_BODY;return}case v.CAPTION:{this.insertionMode=W.IN_CAPTION;return}case v.COLGROUP:{this.insertionMode=W.IN_COLUMN_GROUP;return}case v.TABLE:{this.insertionMode=W.IN_TABLE;return}case v.BODY:{this.insertionMode=W.IN_BODY;return}case v.FRAMESET:{this.insertionMode=W.IN_FRAMESET;return}case v.SELECT:{this._resetInsertionModeForSelect(t);return}case v.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case v.HTML:{this.insertionMode=this.headElement?W.AFTER_HEAD:W.BEFORE_HEAD;return}case v.TD:case v.TH:{if(t>0){this.insertionMode=W.IN_CELL;return}break}case v.HEAD:{if(t>0){this.insertionMode=W.IN_HEAD;return}break}}this.insertionMode=W.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===v.TEMPLATE)break;if(r===v.TABLE){this.insertionMode=W.IN_SELECT_IN_TABLE;return}}this.insertionMode=W.IN_SELECT}_isElementCausesFosterParenting(t){return FZ.has(t)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let t=this.openElements.stackTop;t>=0;t--){const n=this.openElements.items[t];switch(this.openElements.tagIDs[t]){case v.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===Ee.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case v.TABLE:{const r=this.treeAdapter.getParentNode(n);return r?{parent:r,beforeElement:n}:{parent:this.openElements.items[t-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(t){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,t,n.beforeElement):this.treeAdapter.appendChild(n.parent,t)}_isSpecialElement(t,n){const r=this.treeAdapter.getNamespaceURI(t);return RLe[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){U4e(this,t);return}switch(this.insertionMode){case W.INITIAL:{$g(this,t);break}case W.BEFORE_HTML:{B0(this,t);break}case W.BEFORE_HEAD:{j0(this,t);break}case W.IN_HEAD:{U0(this,t);break}case W.IN_HEAD_NO_SCRIPT:{V0(this,t);break}case W.AFTER_HEAD:{z0(this,t);break}case W.IN_BODY:case W.IN_CAPTION:case W.IN_CELL:case W.IN_TEMPLATE:{jZ(this,t);break}case W.TEXT:case W.IN_SELECT:case W.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case W.IN_TABLE:case W.IN_TABLE_BODY:case W.IN_ROW:{xA(this,t);break}case W.IN_TABLE_TEXT:{qZ(this,t);break}case W.IN_COLUMN_GROUP:{eT(this,t);break}case W.AFTER_BODY:{tT(this,t);break}case W.AFTER_AFTER_BODY:{cb(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){j4e(this,t);return}switch(this.insertionMode){case W.INITIAL:{$g(this,t);break}case W.BEFORE_HTML:{B0(this,t);break}case W.BEFORE_HEAD:{j0(this,t);break}case W.IN_HEAD:{U0(this,t);break}case W.IN_HEAD_NO_SCRIPT:{V0(this,t);break}case W.AFTER_HEAD:{z0(this,t);break}case W.TEXT:{this._insertCharacters(t);break}case W.IN_TABLE:case W.IN_TABLE_BODY:case W.IN_ROW:{xA(this,t);break}case W.IN_COLUMN_GROUP:{eT(this,t);break}case W.AFTER_BODY:{tT(this,t);break}case W.AFTER_AFTER_BODY:{cb(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){I2(this,t);return}switch(this.insertionMode){case W.INITIAL:case W.BEFORE_HTML:case W.BEFORE_HEAD:case W.IN_HEAD:case W.IN_HEAD_NO_SCRIPT:case W.AFTER_HEAD:case W.IN_BODY:case W.IN_TABLE:case W.IN_CAPTION:case W.IN_COLUMN_GROUP:case W.IN_TABLE_BODY:case W.IN_ROW:case W.IN_CELL:case W.IN_SELECT:case W.IN_SELECT_IN_TABLE:case W.IN_TEMPLATE:case W.IN_FRAMESET:case W.AFTER_FRAMESET:{I2(this,t);break}case W.IN_TABLE_TEXT:{Lg(this,t);break}case W.AFTER_BODY:{_Me(this,t);break}case W.AFTER_AFTER_BODY:case W.AFTER_AFTER_FRAMESET:{vMe(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case W.INITIAL:{bMe(this,t);break}case W.BEFORE_HEAD:case W.IN_HEAD:case W.IN_HEAD_NO_SCRIPT:case W.AFTER_HEAD:{this._err(t,_e.misplacedDoctype);break}case W.IN_TABLE_TEXT:{Lg(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,_e.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?V4e(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case W.INITIAL:{$g(this,t);break}case W.BEFORE_HTML:{EMe(this,t);break}case W.BEFORE_HEAD:{TMe(this,t);break}case W.IN_HEAD:{$a(this,t);break}case W.IN_HEAD_NO_SCRIPT:{xMe(this,t);break}case W.AFTER_HEAD:{AMe(this,t);break}case W.IN_BODY:{rs(this,t);break}case W.IN_TABLE:{nm(this,t);break}case W.IN_TABLE_TEXT:{Lg(this,t);break}case W.IN_CAPTION:{S4e(this,t);break}case W.IN_COLUMN_GROUP:{ZD(this,t);break}case W.IN_TABLE_BODY:{$I(this,t);break}case W.IN_ROW:{LI(this,t);break}case W.IN_CELL:{C4e(this,t);break}case W.IN_SELECT:{KZ(this,t);break}case W.IN_SELECT_IN_TABLE:{O4e(this,t);break}case W.IN_TEMPLATE:{R4e(this,t);break}case W.AFTER_BODY:{k4e(this,t);break}case W.IN_FRAMESET:{D4e(this,t);break}case W.AFTER_FRAMESET:{L4e(this,t);break}case W.AFTER_AFTER_BODY:{F4e(this,t);break}case W.AFTER_AFTER_FRAMESET:{B4e(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?z4e(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case W.INITIAL:{$g(this,t);break}case W.BEFORE_HTML:{wMe(this,t);break}case W.BEFORE_HEAD:{SMe(this,t);break}case W.IN_HEAD:{IMe(this,t);break}case W.IN_HEAD_NO_SCRIPT:{CMe(this,t);break}case W.AFTER_HEAD:{OMe(this,t);break}case W.IN_BODY:{DI(this,t);break}case W.TEXT:{p4e(this,t);break}case W.IN_TABLE:{Py(this,t);break}case W.IN_TABLE_TEXT:{Lg(this,t);break}case W.IN_CAPTION:{I4e(this,t);break}case W.IN_COLUMN_GROUP:{x4e(this,t);break}case W.IN_TABLE_BODY:{x2(this,t);break}case W.IN_ROW:{GZ(this,t);break}case W.IN_CELL:{A4e(this,t);break}case W.IN_SELECT:{QZ(this,t);break}case W.IN_SELECT_IN_TABLE:{P4e(this,t);break}case W.IN_TEMPLATE:{N4e(this,t);break}case W.AFTER_BODY:{JZ(this,t);break}case W.IN_FRAMESET:{$4e(this,t);break}case W.AFTER_FRAMESET:{M4e(this,t);break}case W.AFTER_AFTER_BODY:{cb(this,t);break}}}onEof(t){switch(this.insertionMode){case W.INITIAL:{$g(this,t);break}case W.BEFORE_HTML:{B0(this,t);break}case W.BEFORE_HEAD:{j0(this,t);break}case W.IN_HEAD:{U0(this,t);break}case W.IN_HEAD_NO_SCRIPT:{V0(this,t);break}case W.AFTER_HEAD:{z0(this,t);break}case W.IN_BODY:case W.IN_TABLE:case W.IN_CAPTION:case W.IN_COLUMN_GROUP:case W.IN_TABLE_BODY:case W.IN_ROW:case W.IN_CELL:case W.IN_SELECT:case W.IN_SELECT_IN_TABLE:{HZ(this,t);break}case W.TEXT:{m4e(this,t);break}case W.IN_TABLE_TEXT:{Lg(this,t);break}case W.IN_TEMPLATE:{XZ(this,t);break}case W.AFTER_BODY:case W.IN_FRAMESET:case W.AFTER_FRAMESET:case W.AFTER_AFTER_BODY:case W.AFTER_AFTER_FRAMESET:{JD(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===L.LINE_FEED)){if(t.chars.length===1)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(t);return}switch(this.insertionMode){case W.IN_HEAD:case W.IN_HEAD_NO_SCRIPT:case W.AFTER_HEAD:case W.TEXT:case W.IN_COLUMN_GROUP:case W.IN_SELECT:case W.IN_SELECT_IN_TABLE:case W.IN_FRAMESET:case W.AFTER_FRAMESET:{this._insertCharacters(t);break}case W.IN_BODY:case W.IN_CAPTION:case W.IN_CELL:case W.IN_TEMPLATE:case W.AFTER_BODY:case W.AFTER_AFTER_BODY:case W.AFTER_AFTER_FRAMESET:{BZ(this,t);break}case W.IN_TABLE:case W.IN_TABLE_BODY:case W.IN_ROW:{xA(this,t);break}case W.IN_TABLE_TEXT:{WZ(this,t);break}}}};function dMe(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):zZ(e,t),n}function hMe(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){const i=e.openElements.items[r];if(i===t.element)break;e._isSpecialElement(i,e.openElements.tagIDs[r])&&(n=i)}return n||(e.openElements.shortenToLength(r<0?0:r),e.activeFormattingElements.removeEntry(t)),n}function pMe(e,t,n){let r=t,i=e.openElements.getCommonAncestor(t);for(let s=0,o=i;o!==n;s++,o=i){i=e.openElements.getCommonAncestor(o);const a=e.activeFormattingElements.getElementEntry(o),u=a&&s>=cMe;!a||u?(u&&e.activeFormattingElements.removeEntry(a),e.openElements.remove(o)):(o=mMe(e,a),r===t&&(e.activeFormattingElements.bookmark=a),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(o,r),r=o)}return r}function mMe(e,t){const n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function gMe(e,t,n){const r=e.treeAdapter.getTagName(t),i=Wm(r);if(e._isElementCausesFosterParenting(i))e._fosterParentElement(n);else{const s=e.treeAdapter.getNamespaceURI(t);i===v.TEMPLATE&&s===Ee.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function yMe(e,t,n){const r=e.treeAdapter.getNamespaceURI(n.element),{token:i}=n,s=e.treeAdapter.createElement(i.tagName,r,i.attrs);e._adoptNodes(t,s),e.treeAdapter.appendChild(t,s),e.activeFormattingElements.insertElementAfterBookmark(s,i),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,s,i.tagID)}function XD(e,t){for(let n=0;n=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const r=e.openElements.items[0],i=e.treeAdapter.getNodeSourceCodeLocation(r);if(i&&!i.endTag&&(e._setEndLocation(r,t),e.openElements.stackTop>=1)){const s=e.openElements.items[1],o=e.treeAdapter.getNodeSourceCodeLocation(s);o&&!o.endTag&&e._setEndLocation(s,t)}}}}function bMe(e,t){e._setDocumentType(t);const n=t.forceQuirks?eo.QUIRKS:QLe(t);KLe(t)||e._err(t,_e.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=W.BEFORE_HTML}function $g(e,t){e._err(t,_e.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,eo.QUIRKS),e.insertionMode=W.BEFORE_HTML,e._processToken(t)}function EMe(e,t){t.tagID===v.HTML?(e._insertElement(t,Ee.HTML),e.insertionMode=W.BEFORE_HEAD):B0(e,t)}function wMe(e,t){const n=t.tagID;(n===v.HTML||n===v.HEAD||n===v.BODY||n===v.BR)&&B0(e,t)}function B0(e,t){e._insertFakeRootElement(),e.insertionMode=W.BEFORE_HEAD,e._processToken(t)}function TMe(e,t){switch(t.tagID){case v.HTML:{rs(e,t);break}case v.HEAD:{e._insertElement(t,Ee.HTML),e.headElement=e.openElements.current,e.insertionMode=W.IN_HEAD;break}default:j0(e,t)}}function SMe(e,t){const n=t.tagID;n===v.HEAD||n===v.BODY||n===v.HTML||n===v.BR?j0(e,t):e._err(t,_e.endTagWithoutMatchingOpenElement)}function j0(e,t){e._insertFakeElement(oe.HEAD,v.HEAD),e.headElement=e.openElements.current,e.insertionMode=W.IN_HEAD,e._processToken(t)}function $a(e,t){switch(t.tagID){case v.HTML:{rs(e,t);break}case v.BASE:case v.BASEFONT:case v.BGSOUND:case v.LINK:case v.META:{e._appendElement(t,Ee.HTML),t.ackSelfClosing=!0;break}case v.TITLE:{e._switchToTextParsing(t,Dr.RCDATA);break}case v.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,Dr.RAWTEXT):(e._insertElement(t,Ee.HTML),e.insertionMode=W.IN_HEAD_NO_SCRIPT);break}case v.NOFRAMES:case v.STYLE:{e._switchToTextParsing(t,Dr.RAWTEXT);break}case v.SCRIPT:{e._switchToTextParsing(t,Dr.SCRIPT_DATA);break}case v.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=W.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(W.IN_TEMPLATE);break}case v.HEAD:{e._err(t,_e.misplacedStartTagForHeadElement);break}default:U0(e,t)}}function IMe(e,t){switch(t.tagID){case v.HEAD:{e.openElements.pop(),e.insertionMode=W.AFTER_HEAD;break}case v.BODY:case v.BR:case v.HTML:{U0(e,t);break}case v.TEMPLATE:{nh(e,t);break}default:e._err(t,_e.endTagWithoutMatchingOpenElement)}}function nh(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==v.TEMPLATE&&e._err(t,_e.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(v.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,_e.endTagWithoutMatchingOpenElement)}function U0(e,t){e.openElements.pop(),e.insertionMode=W.AFTER_HEAD,e._processToken(t)}function xMe(e,t){switch(t.tagID){case v.HTML:{rs(e,t);break}case v.BASEFONT:case v.BGSOUND:case v.HEAD:case v.LINK:case v.META:case v.NOFRAMES:case v.STYLE:{$a(e,t);break}case v.NOSCRIPT:{e._err(t,_e.nestedNoscriptInHead);break}default:V0(e,t)}}function CMe(e,t){switch(t.tagID){case v.NOSCRIPT:{e.openElements.pop(),e.insertionMode=W.IN_HEAD;break}case v.BR:{V0(e,t);break}default:e._err(t,_e.endTagWithoutMatchingOpenElement)}}function V0(e,t){const n=t.type===Ht.EOF?_e.openElementsLeftAfterEof:_e.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=W.IN_HEAD,e._processToken(t)}function AMe(e,t){switch(t.tagID){case v.HTML:{rs(e,t);break}case v.BODY:{e._insertElement(t,Ee.HTML),e.framesetOk=!1,e.insertionMode=W.IN_BODY;break}case v.FRAMESET:{e._insertElement(t,Ee.HTML),e.insertionMode=W.IN_FRAMESET;break}case v.BASE:case v.BASEFONT:case v.BGSOUND:case v.LINK:case v.META:case v.NOFRAMES:case v.SCRIPT:case v.STYLE:case v.TEMPLATE:case v.TITLE:{e._err(t,_e.abandonedHeadElementChild),e.openElements.push(e.headElement,v.HEAD),$a(e,t),e.openElements.remove(e.headElement);break}case v.HEAD:{e._err(t,_e.misplacedStartTagForHeadElement);break}default:z0(e,t)}}function OMe(e,t){switch(t.tagID){case v.BODY:case v.HTML:case v.BR:{z0(e,t);break}case v.TEMPLATE:{nh(e,t);break}default:e._err(t,_e.endTagWithoutMatchingOpenElement)}}function z0(e,t){e._insertFakeElement(oe.BODY,v.BODY),e.insertionMode=W.IN_BODY,kI(e,t)}function kI(e,t){switch(t.type){case Ht.CHARACTER:{jZ(e,t);break}case Ht.WHITESPACE_CHARACTER:{BZ(e,t);break}case Ht.COMMENT:{I2(e,t);break}case Ht.START_TAG:{rs(e,t);break}case Ht.END_TAG:{DI(e,t);break}case Ht.EOF:{HZ(e,t);break}}}function BZ(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function jZ(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function PMe(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function RMe(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function NMe(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,Ee.HTML),e.insertionMode=W.IN_FRAMESET)}function kMe(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,Ee.HTML)}function DMe(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),AZ(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,Ee.HTML)}function $Me(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,Ee.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function LMe(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,Ee.HTML),n||(e.formElement=e.openElements.current))}function MMe(e,t){e.framesetOk=!1;const n=t.tagID;for(let r=e.openElements.stackTop;r>=0;r--){const i=e.openElements.tagIDs[r];if(n===v.LI&&i===v.LI||(n===v.DD||n===v.DT)&&(i===v.DD||i===v.DT)){e.openElements.generateImpliedEndTagsWithExclusion(i),e.openElements.popUntilTagNamePopped(i);break}if(i!==v.ADDRESS&&i!==v.DIV&&i!==v.P&&e._isSpecialElement(e.openElements.items[r],i))break}e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,Ee.HTML)}function FMe(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,Ee.HTML),e.tokenizer.state=Dr.PLAINTEXT}function BMe(e,t){e.openElements.hasInScope(v.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(v.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,Ee.HTML),e.framesetOk=!1}function jMe(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(oe.A);n&&(XD(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,Ee.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function UMe(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Ee.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function VMe(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(v.NOBR)&&(XD(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,Ee.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function zMe(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Ee.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function HMe(e,t){e.treeAdapter.getDocumentMode(e.document)!==eo.QUIRKS&&e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,Ee.HTML),e.framesetOk=!1,e.insertionMode=W.IN_TABLE}function UZ(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Ee.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function VZ(e){const t=IZ(e,Vc.TYPE);return t!=null&&t.toLowerCase()===uMe}function WMe(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Ee.HTML),VZ(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function qMe(e,t){e._appendElement(t,Ee.HTML),t.ackSelfClosing=!0}function YMe(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._appendElement(t,Ee.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function GMe(e,t){t.tagName=oe.IMG,t.tagID=v.IMG,UZ(e,t)}function KMe(e,t){e._insertElement(t,Ee.HTML),e.skipNextNewLine=!0,e.tokenizer.state=Dr.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=W.TEXT}function QMe(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,Dr.RAWTEXT)}function XMe(e,t){e.framesetOk=!1,e._switchToTextParsing(t,Dr.RAWTEXT)}function hj(e,t){e._switchToTextParsing(t,Dr.RAWTEXT)}function JMe(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Ee.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===W.IN_TABLE||e.insertionMode===W.IN_CAPTION||e.insertionMode===W.IN_TABLE_BODY||e.insertionMode===W.IN_ROW||e.insertionMode===W.IN_CELL?W.IN_SELECT_IN_TABLE:W.IN_SELECT}function ZMe(e,t){e.openElements.currentTagId===v.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,Ee.HTML)}function e4e(e,t){e.openElements.hasInScope(v.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,Ee.HTML)}function t4e(e,t){e.openElements.hasInScope(v.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(v.RTC),e._insertElement(t,Ee.HTML)}function n4e(e,t){e._reconstructActiveFormattingElements(),LZ(t),QD(t),t.selfClosing?e._appendElement(t,Ee.MATHML):e._insertElement(t,Ee.MATHML),t.ackSelfClosing=!0}function r4e(e,t){e._reconstructActiveFormattingElements(),MZ(t),QD(t),t.selfClosing?e._appendElement(t,Ee.SVG):e._insertElement(t,Ee.SVG),t.ackSelfClosing=!0}function pj(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Ee.HTML)}function rs(e,t){switch(t.tagID){case v.I:case v.S:case v.B:case v.U:case v.EM:case v.TT:case v.BIG:case v.CODE:case v.FONT:case v.SMALL:case v.STRIKE:case v.STRONG:{UMe(e,t);break}case v.A:{jMe(e,t);break}case v.H1:case v.H2:case v.H3:case v.H4:case v.H5:case v.H6:{DMe(e,t);break}case v.P:case v.DL:case v.OL:case v.UL:case v.DIV:case v.DIR:case v.NAV:case v.MAIN:case v.MENU:case v.ASIDE:case v.CENTER:case v.FIGURE:case v.FOOTER:case v.HEADER:case v.HGROUP:case v.DIALOG:case v.DETAILS:case v.ADDRESS:case v.ARTICLE:case v.SECTION:case v.SUMMARY:case v.FIELDSET:case v.BLOCKQUOTE:case v.FIGCAPTION:{kMe(e,t);break}case v.LI:case v.DD:case v.DT:{MMe(e,t);break}case v.BR:case v.IMG:case v.WBR:case v.AREA:case v.EMBED:case v.KEYGEN:{UZ(e,t);break}case v.HR:{YMe(e,t);break}case v.RB:case v.RTC:{e4e(e,t);break}case v.RT:case v.RP:{t4e(e,t);break}case v.PRE:case v.LISTING:{$Me(e,t);break}case v.XMP:{QMe(e,t);break}case v.SVG:{r4e(e,t);break}case v.HTML:{PMe(e,t);break}case v.BASE:case v.LINK:case v.META:case v.STYLE:case v.TITLE:case v.SCRIPT:case v.BGSOUND:case v.BASEFONT:case v.TEMPLATE:{$a(e,t);break}case v.BODY:{RMe(e,t);break}case v.FORM:{LMe(e,t);break}case v.NOBR:{VMe(e,t);break}case v.MATH:{n4e(e,t);break}case v.TABLE:{HMe(e,t);break}case v.INPUT:{WMe(e,t);break}case v.PARAM:case v.TRACK:case v.SOURCE:{qMe(e,t);break}case v.IMAGE:{GMe(e,t);break}case v.BUTTON:{BMe(e,t);break}case v.APPLET:case v.OBJECT:case v.MARQUEE:{zMe(e,t);break}case v.IFRAME:{XMe(e,t);break}case v.SELECT:{JMe(e,t);break}case v.OPTION:case v.OPTGROUP:{ZMe(e,t);break}case v.NOEMBED:{hj(e,t);break}case v.FRAMESET:{NMe(e,t);break}case v.TEXTAREA:{KMe(e,t);break}case v.NOSCRIPT:{e.options.scriptingEnabled?hj(e,t):pj(e,t);break}case v.PLAINTEXT:{FMe(e,t);break}case v.COL:case v.TH:case v.TD:case v.TR:case v.HEAD:case v.FRAME:case v.TBODY:case v.TFOOT:case v.THEAD:case v.CAPTION:case v.COLGROUP:break;default:pj(e,t)}}function i4e(e,t){if(e.openElements.hasInScope(v.BODY)&&(e.insertionMode=W.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function s4e(e,t){e.openElements.hasInScope(v.BODY)&&(e.insertionMode=W.AFTER_BODY,JZ(e,t))}function o4e(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function a4e(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(v.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(v.FORM):n&&e.openElements.remove(n))}function u4e(e){e.openElements.hasInButtonScope(v.P)||e._insertFakeElement(oe.P,v.P),e._closePElement()}function l4e(e){e.openElements.hasInListItemScope(v.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(v.LI),e.openElements.popUntilTagNamePopped(v.LI))}function c4e(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function f4e(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function d4e(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function h4e(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(oe.BR,v.BR),e.openElements.pop(),e.framesetOk=!1}function zZ(e,t){const n=t.tagName,r=t.tagID;for(let i=e.openElements.stackTop;i>0;i--){const s=e.openElements.items[i],o=e.openElements.tagIDs[i];if(r===o&&(r!==v.UNKNOWN||e.treeAdapter.getTagName(s)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=i&&e.openElements.shortenToLength(i);break}if(e._isSpecialElement(s,o))break}}function DI(e,t){switch(t.tagID){case v.A:case v.B:case v.I:case v.S:case v.U:case v.EM:case v.TT:case v.BIG:case v.CODE:case v.FONT:case v.NOBR:case v.SMALL:case v.STRIKE:case v.STRONG:{XD(e,t);break}case v.P:{u4e(e);break}case v.DL:case v.UL:case v.OL:case v.DIR:case v.DIV:case v.NAV:case v.PRE:case v.MAIN:case v.MENU:case v.ASIDE:case v.BUTTON:case v.CENTER:case v.FIGURE:case v.FOOTER:case v.HEADER:case v.HGROUP:case v.DIALOG:case v.ADDRESS:case v.ARTICLE:case v.DETAILS:case v.SECTION:case v.SUMMARY:case v.LISTING:case v.FIELDSET:case v.BLOCKQUOTE:case v.FIGCAPTION:{o4e(e,t);break}case v.LI:{l4e(e);break}case v.DD:case v.DT:{c4e(e,t);break}case v.H1:case v.H2:case v.H3:case v.H4:case v.H5:case v.H6:{f4e(e);break}case v.BR:{h4e(e);break}case v.BODY:{i4e(e,t);break}case v.HTML:{s4e(e,t);break}case v.FORM:{a4e(e);break}case v.APPLET:case v.OBJECT:case v.MARQUEE:{d4e(e,t);break}case v.TEMPLATE:{nh(e,t);break}default:zZ(e,t)}}function HZ(e,t){e.tmplInsertionModeStack.length>0?XZ(e,t):JD(e,t)}function p4e(e,t){var n;t.tagID===v.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function m4e(e,t){e._err(t,_e.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function xA(e,t){if(FZ.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=W.IN_TABLE_TEXT,t.type){case Ht.CHARACTER:{qZ(e,t);break}case Ht.WHITESPACE_CHARACTER:{WZ(e,t);break}}else U_(e,t)}function g4e(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,Ee.HTML),e.insertionMode=W.IN_CAPTION}function y4e(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Ee.HTML),e.insertionMode=W.IN_COLUMN_GROUP}function _4e(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(oe.COLGROUP,v.COLGROUP),e.insertionMode=W.IN_COLUMN_GROUP,ZD(e,t)}function v4e(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Ee.HTML),e.insertionMode=W.IN_TABLE_BODY}function b4e(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(oe.TBODY,v.TBODY),e.insertionMode=W.IN_TABLE_BODY,$I(e,t)}function E4e(e,t){e.openElements.hasInTableScope(v.TABLE)&&(e.openElements.popUntilTagNamePopped(v.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function w4e(e,t){VZ(t)?e._appendElement(t,Ee.HTML):U_(e,t),t.ackSelfClosing=!0}function T4e(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,Ee.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function nm(e,t){switch(t.tagID){case v.TD:case v.TH:case v.TR:{b4e(e,t);break}case v.STYLE:case v.SCRIPT:case v.TEMPLATE:{$a(e,t);break}case v.COL:{_4e(e,t);break}case v.FORM:{T4e(e,t);break}case v.TABLE:{E4e(e,t);break}case v.TBODY:case v.TFOOT:case v.THEAD:{v4e(e,t);break}case v.INPUT:{w4e(e,t);break}case v.CAPTION:{g4e(e,t);break}case v.COLGROUP:{y4e(e,t);break}default:U_(e,t)}}function Py(e,t){switch(t.tagID){case v.TABLE:{e.openElements.hasInTableScope(v.TABLE)&&(e.openElements.popUntilTagNamePopped(v.TABLE),e._resetInsertionMode());break}case v.TEMPLATE:{nh(e,t);break}case v.BODY:case v.CAPTION:case v.COL:case v.COLGROUP:case v.HTML:case v.TBODY:case v.TD:case v.TFOOT:case v.TH:case v.THEAD:case v.TR:break;default:U_(e,t)}}function U_(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,kI(e,t),e.fosterParentingEnabled=n}function WZ(e,t){e.pendingCharacterTokens.push(t)}function qZ(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function Lg(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n0&&e.openElements.currentTagId===v.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===v.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===v.OPTGROUP&&e.openElements.pop();break}case v.OPTION:{e.openElements.currentTagId===v.OPTION&&e.openElements.pop();break}case v.SELECT:{e.openElements.hasInSelectScope(v.SELECT)&&(e.openElements.popUntilTagNamePopped(v.SELECT),e._resetInsertionMode());break}case v.TEMPLATE:{nh(e,t);break}}}function O4e(e,t){const n=t.tagID;n===v.CAPTION||n===v.TABLE||n===v.TBODY||n===v.TFOOT||n===v.THEAD||n===v.TR||n===v.TD||n===v.TH?(e.openElements.popUntilTagNamePopped(v.SELECT),e._resetInsertionMode(),e._processStartTag(t)):KZ(e,t)}function P4e(e,t){const n=t.tagID;n===v.CAPTION||n===v.TABLE||n===v.TBODY||n===v.TFOOT||n===v.THEAD||n===v.TR||n===v.TD||n===v.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(v.SELECT),e._resetInsertionMode(),e.onEndTag(t)):QZ(e,t)}function R4e(e,t){switch(t.tagID){case v.BASE:case v.BASEFONT:case v.BGSOUND:case v.LINK:case v.META:case v.NOFRAMES:case v.SCRIPT:case v.STYLE:case v.TEMPLATE:case v.TITLE:{$a(e,t);break}case v.CAPTION:case v.COLGROUP:case v.TBODY:case v.TFOOT:case v.THEAD:{e.tmplInsertionModeStack[0]=W.IN_TABLE,e.insertionMode=W.IN_TABLE,nm(e,t);break}case v.COL:{e.tmplInsertionModeStack[0]=W.IN_COLUMN_GROUP,e.insertionMode=W.IN_COLUMN_GROUP,ZD(e,t);break}case v.TR:{e.tmplInsertionModeStack[0]=W.IN_TABLE_BODY,e.insertionMode=W.IN_TABLE_BODY,$I(e,t);break}case v.TD:case v.TH:{e.tmplInsertionModeStack[0]=W.IN_ROW,e.insertionMode=W.IN_ROW,LI(e,t);break}default:e.tmplInsertionModeStack[0]=W.IN_BODY,e.insertionMode=W.IN_BODY,rs(e,t)}}function N4e(e,t){t.tagID===v.TEMPLATE&&nh(e,t)}function XZ(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(v.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):JD(e,t)}function k4e(e,t){t.tagID===v.HTML?rs(e,t):tT(e,t)}function JZ(e,t){var n;if(t.tagID===v.HTML){if(e.fragmentContext||(e.insertionMode=W.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===v.HTML){e._setEndLocation(e.openElements.items[0],t);const r=e.openElements.items[1];r&&!(!((n=e.treeAdapter.getNodeSourceCodeLocation(r))===null||n===void 0)&&n.endTag)&&e._setEndLocation(r,t)}}else tT(e,t)}function tT(e,t){e.insertionMode=W.IN_BODY,kI(e,t)}function D4e(e,t){switch(t.tagID){case v.HTML:{rs(e,t);break}case v.FRAMESET:{e._insertElement(t,Ee.HTML);break}case v.FRAME:{e._appendElement(t,Ee.HTML),t.ackSelfClosing=!0;break}case v.NOFRAMES:{$a(e,t);break}}}function $4e(e,t){t.tagID===v.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==v.FRAMESET&&(e.insertionMode=W.AFTER_FRAMESET))}function L4e(e,t){switch(t.tagID){case v.HTML:{rs(e,t);break}case v.NOFRAMES:{$a(e,t);break}}}function M4e(e,t){t.tagID===v.HTML&&(e.insertionMode=W.AFTER_AFTER_FRAMESET)}function F4e(e,t){t.tagID===v.HTML?rs(e,t):cb(e,t)}function cb(e,t){e.insertionMode=W.IN_BODY,kI(e,t)}function B4e(e,t){switch(t.tagID){case v.HTML:{rs(e,t);break}case v.NOFRAMES:{$a(e,t);break}}}function j4e(e,t){t.chars=sr,e._insertCharacters(t)}function U4e(e,t){e._insertCharacters(t),e.framesetOk=!1}function ZZ(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==Ee.HTML&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function V4e(e,t){if(rMe(t))ZZ(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===Ee.MATHML?LZ(t):r===Ee.SVG&&(iMe(t),MZ(t)),QD(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function z4e(e,t){if(t.tagID===v.P||t.tagID===v.BR){ZZ(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){const r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===Ee.HTML){e._endTagOutsideForeignContent(t);break}const i=e.treeAdapter.getTagName(r);if(i.toLowerCase()===t.tagName){t.tagName=i,e.openElements.shortenToLength(n);break}}}oe.AREA,oe.BASE,oe.BASEFONT,oe.BGSOUND,oe.BR,oe.COL,oe.EMBED,oe.FRAME,oe.HR,oe.IMG,oe.INPUT,oe.KEYGEN,oe.LINK,oe.META,oe.PARAM,oe.SOURCE,oe.TRACK,oe.WBR;const eee=tee("end"),rh=tee("start");function tee(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}const nee=function(e){if(e==null)return Y4e;if(typeof e=="function")return MI(e);if(typeof e=="object")return Array.isArray(e)?H4e(e):W4e(e);if(typeof e=="string")return q4e(e);throw new Error("Expected function, string, or object as test")};function H4e(e){const t=[];let n=-1;for(;++n":""))+")"})}return d;function d(){let h=ree,p,m,y;if((!t||s(u,l,c[c.length-1]||void 0))&&(h=J4e(n(u,c)),h[0]===mj))return h;if("children"in u&&u.children){const g=u;if(g.children&&h[0]!==Q4e)for(m=(r?g.children.length:-1)+o,y=c.concat(g);m>-1&&m$.jsx(A_,{...r}),p:({node:n,...r})=>$.jsx(Tt,{...r,pb:8}),h1:({node:n,...r})=>$.jsx(cc,{order:1,...r,pb:12}),h2:({node:n,...r})=>$.jsx(cc,{order:2,...r,pb:12}),h3:({node:n,...r})=>$.jsx(cc,{order:3,...r,pb:12}),h4:({node:n,...r})=>$.jsx(cc,{order:4,...r,pb:12}),h5:({node:n,...r})=>$.jsx(cc,{order:5,...r,pb:12}),h6:({node:n,...r})=>$.jsx(cc,{order:6,...r,pb:12}),a:({node:n,...r})=>$.jsx(Rq,{...r}),ul:({node:n,...r})=>$.jsx(Xp,{withPadding:!0,...r,pb:8}),ol:({node:n,...r})=>$.jsx(Xp,{type:"ordered",withPadding:!0,...r,pb:8})};return $.jsx("div",{style:{display:"inherit"},children:$.jsx(hZ,{components:t,rehypePlugins:[d5e],children:e})})}function h5e({response:e,disabled:t,answer:n}){const{prompt:r,required:i,options:s}=e;return $.jsx(Qp.Group,{label:$.jsx(Us,{text:r}),withAsterisk:i,...n,error:eh(e,n,s),size:"md",children:$.jsx(zo,{mt:"md",children:s.map(o=>$.jsx(Qp,{disabled:t,value:o.value,label:o.label},o.value))})})}function p5e({response:e,disabled:t,answer:n}){const{placeholder:r,prompt:i,required:s,options:o}=e;return $.jsx(jQ,{disabled:t,label:$.jsx(Us,{text:i}),placeholder:r,data:o,withAsterisk:s,radius:"md",size:"md",...n,error:eh(e,n,o)})}function m5e({response:e,answer:t}){const{prompt:n}=e;return $.jsxs($.Fragment,{children:[$.jsx(Tt,{fz:"md",fw:500,children:$.jsx(Us,{text:n})}),$.jsx(Xp,{children:Array.isArray(t.value)&&t.value.map(r=>$.jsx(Xp.Item,{children:r},r))})]})}function uee({response:e,disabled:t,answer:n}){const{prompt:r,required:i,options:s,leftLabel:o,rightLabel:a}=e;return $.jsxs(Cw.Group,{name:`radioInput${e.id}`,label:$.jsx(Us,{text:r}),withAsterisk:i,size:"md",...n,error:eh(e,n,s),children:[o?$.jsx(Tt,{children:o}):null,$.jsx(zo,{mt:"xs",children:s.map(u=>$.jsx(Cw,{disabled:t,value:u.value,label:u.label},u.label))}),$.jsx(Tt,{children:a})]},e.id)}function g5e({response:e,disabled:t,answer:n}){const{preset:r}=e,i=[];for(let o=1;o<=+r;o+=1)i.push({label:`${o}`,value:`${o}`});const s={...e,type:"radio",options:i};return $.jsx(uee,{disabled:t,response:s,answer:n})}function y5e({response:e,disabled:t,answer:n}){const{prompt:r,required:i,min:s,max:o,placeholder:a}=e;return $.jsx(pQ,{disabled:t,placeholder:a,label:$.jsx(Us,{text:r}),withAsterisk:i,radius:"md",size:"md",min:s,max:o,...n,error:eh(e,n)})}function _5e({response:e,disabled:t,answer:n}){const{prompt:r,options:i,leftLabel:s,rightLabel:o,required:a}=e,u=eh(e,n);return $.jsx(Bs.Wrapper,{withAsterisk:a,label:$.jsx(Us,{text:r}),error:u,size:"md",children:$.jsxs(zo,{children:[s?$.jsx(Nd,{children:$.jsx(Tt,{children:s})}):null,$.jsx(GQ,{disabled:t,label:null,sx:{marginTop:"15px",marginBottom:"15px",width:"400px"},marks:i,...n,defaultValue:50,thumbSize:n.value===""?.1:17,color:n.value===""?"gray.2":"blue",min:0,max:100,showLabelOnHover:!1,styles:l=>({markFilled:{borderColor:"#E9ECEF",backgroundColor:"white"},bar:{backgroundColor:"#E9ECEF"},markLabel:{fontSize:l.fontSizes.sm,marginBottom:5,marginTop:0}})}),o?$.jsx(Nd,{children:$.jsx(Tt,{children:o})}):null]})})}function v5e({response:e,disabled:t,answer:n}){const{placeholder:r,prompt:i,required:s}=e;return $.jsx(Nk,{disabled:t,placeholder:r,label:$.jsx(Us,{text:i}),radius:"md",size:"md",withAsterisk:s,...n,value:n.value||"",error:eh(e,n)})}function b5e({response:e,disabled:t,answer:n}){const{placeholder:r,prompt:i,required:s}=e;return $.jsx(SK,{disabled:t,placeholder:r,label:$.jsx(Us,{text:i}),radius:"md",size:"md",withAsterisk:s,...n,value:n.value||"",error:eh(e,n)})}function E5e({response:e,answer:t,storedAnswer:n}){const r=(n?{value:n}:t)||{value:void 0},i=!!n,[s]=QN(),o=w.useMemo(()=>{if(e.paramCapture){const a=s.get(e.paramCapture);return i||!!a}return i},[i,e.paramCapture,s]);return $.jsxs(ut,{sx:{margin:10,padding:5},children:[e.type==="numerical"&&$.jsx(y5e,{response:e,disabled:o,answer:r}),e.type==="shortText"&&$.jsx(v5e,{response:e,disabled:o,answer:r}),e.type==="longText"&&$.jsx(b5e,{response:e,disabled:o,answer:r}),e.type==="likert"&&$.jsx(g5e,{response:e,disabled:o,answer:r}),e.type==="dropdown"&&$.jsx(p5e,{response:e,disabled:o,answer:r}),e.type==="slider"&&$.jsx(_5e,{response:e,disabled:o,answer:r}),e.type==="radio"&&$.jsx(uee,{response:e,disabled:o,answer:r}),e.type==="checkbox"&&$.jsx(h5e,{response:e,disabled:o,answer:r}),e.type==="iframe"&&$.jsx(m5e,{response:e,answer:r})]})}function nT({config:e,location:t,status:n,style:r}){var y,g;const i=Da(),s=n==null?void 0:n.answer,o=e,a=((y=o==null?void 0:o.response)==null?void 0:y.filter(_=>_.location?_.location===t:t==="belowStimulus"))||[],u=Wl(),{updateResponseBlockValidation:l}=Hl(),c=kke(a,i,s||{}),[f,d]=w.useState(!1),{iframeAnswers:h}=Uu(_=>_),p=(((g=o==null?void 0:o.correctAnswer)==null?void 0:g.length)||0)>0,m=t===((o==null?void 0:o.nextButtonLocation)||"belowStimulus");return w.useEffect(()=>{const _=a.find(b=>b.type==="iframe");if(_){const b=_.id;c.setValues({...c.values,[b]:h})}},[h]),w.useEffect(()=>{u(l({location:t,currentStep:i,status:c.isValid(),values:kD(c.values)}))},[c.values,i,t]),$.jsxs("div",{style:r,children:[a.map(_=>{var b,T;return $.jsx(k.Fragment,{children:_.hidden?"":$.jsxs($.Fragment,{children:[$.jsx(E5e,{storedAnswer:s?s[_.id]:void 0,answer:{...c.getInputProps(_.id,{type:_.type==="checkbox"?"checkbox":"input"})},response:_}),p&&f&&$.jsx(Tt,{children:`The correct answer is: ${(T=(b=o.correctAnswer)==null?void 0:b.find(I=>I.id===_.id))==null?void 0:T.answer}`})]})},`${_.id}-${i}`)}),$.jsxs(zo,{position:"right",spacing:"xs",mt:"xl",children:[p&&m&&$.jsx(yu,{onClick:()=>d(!0),disabled:!c.isValid(),children:"Check Answer"}),m&&$.jsx(ske,{disabled:p&&!f,setCheckClicked:d,label:o.nextButtonText||"Next"})]})]})}const d1="@REVISIT_COMMS",w5e={minHeight:"500px",width:"100%",border:0,marginTop:"-50px"};function T5e({currentConfig:e}){const{setIframeAnswers:t}=Hl(),n=Wl(),r=hX(),i=w.useRef(null),s=w.useMemo(()=>crypto.randomUUID?crypto.randomUUID():`testID-${Date.now()}`,[]),o=Da(),a=Qd(),u=w.useCallback((l,c)=>{var f,d;(d=(f=i.current)==null?void 0:f.contentWindow)==null||d.postMessage({error:!1,type:`${d1}/${l}`,iframeId:s,message:c},"*")},[i,s]);return w.useEffect(()=>{const l=c=>{const{data:f}=c;if(typeof f=="object"&&s===f.iframeId)switch(f.type){case`${d1}/WINDOW_READY`:e.parameters&&u("STUDY_DATA",e.parameters);break;case`${d1}/READY`:i.current&&(i.current.style.height=`${f.message.documentHeight}px`);break;case`${d1}/ANSWERS`:n(t(f.message.answer));break}};return window.addEventListener("message",l),()=>window.removeEventListener("message",l)},[n,o,r,s,a,e,u]),$.jsx("div",{children:$.jsx("iframe",{ref:i,src:`${Bu}${e.path}?trialid=${o}&id=${s}`,style:w5e})})}const S5e={maxWidth:"100%"};function I5e({currentConfig:e}){const t={...S5e,...e.style};return $.jsx(A_,{mx:"auto",src:`${Bu}${e.path}`,style:t})}const x5e=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),vi={Purple:"#6D3E91",DarkOrange:"#C05917",LightTeal:"#58AC8C",Blue:"#286BBB",Maroon:"#883039",Camel:"#BC8E5A",MidnightBlue:"#00295B",DustyCoral:"#C15065",DarkOliveGreen:"#18470F",DarkCopper:"#9A5129",Peach:"#E56E5A",Mauve:"#A2559C",Turquoise:"#38AABA",OliveGreen:"#578145",Cherry:"#970046",Teal:"#00847E",RustyOrange:"#B13507",Denim:"#4C6A9C",Fuchsia:"#CF0A66",TealishGreen:"#00875E",Copper:"#B16214",DarkMauve:"#8C4569",Lime:"#3B8E1D",Coral:"#D73C50"},Th={DarkOrangeDarker:"#BE5915",PeachDarker:"#C4523E",LightTealDarker:"#2C8465",TurquoiseDarker:"#008291",CamelDarker:"#996D39",LimeDarker:"#338711"},e$=[vi.DustyCoral,Th.LightTealDarker,Th.DarkOrangeDarker,vi.Purple,vi.DarkOliveGreen,vi.Blue,vi.Maroon,Th.CamelDarker,vi.MidnightBlue,vi.DarkCopper,Th.PeachDarker,vi.Mauve,Th.TurquoiseDarker,vi.OliveGreen,vi.Cherry,vi.Teal,vi.RustyOrange,vi.Denim,vi.TealishGreen,vi.Copper,vi.DarkMauve,Th.LimeDarker,vi.Coral],C5e=Object.freeze(Object.defineProperty({__proto__:null,OwidDistinctLinesPalette:e$},Symbol.toStringTag,{value:"Module"}));function xp(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function A5e(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function t$(e){let t,n,r;e.length!==2?(t=xp,n=(a,u)=>xp(e(a),u),r=(a,u)=>e(a)-u):(t=e===xp||e===A5e?e:O5e,n=e,r=e);function i(a,u,l=0,c=a.length){if(l>>1;n(a[f],u)<0?l=f+1:c=f}while(l>>1;n(a[f],u)<=0?l=f+1:c=f}while(ll&&r(a[f-1],u)>-r(a[f],u)?f-1:f}return{left:i,center:o,right:s}}function O5e(){return 0}function P5e(e){return e===null?NaN:+e}function*R5e(e,t){if(t===void 0)for(let n of e)n!=null&&(n=+n)>=n&&(yield n);else{let n=-1;for(let r of e)(r=t(r,++n,e))!=null&&(r=+r)>=r&&(yield r)}}const N5e=t$(xp),k5e=N5e.right;t$(P5e).center;const D5e=k5e;function Cp(e,t){let n,r;if(t===void 0)for(const i of e)i!=null&&(n===void 0?i>=i&&(n=r=i):(n>i&&(n=i),r=s&&(n=r=s):(n>s&&(n=s),r=r.length)return n(s);const a=new C2,u=r[o++];let l=-1;for(const c of s){const f=u(c,++l,s),d=a.get(f);d?d.push(c):a.set(f,[c])}for(const[c,f]of a)a.set(c,i(f,o));return t(a)}(e,0)}function U5e(e=xp){if(e===xp)return lee;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function lee(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const V5e=Math.sqrt(50),z5e=Math.sqrt(10),H5e=Math.sqrt(2);function rT(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),s=r/Math.pow(10,i),o=s>=V5e?10:s>=z5e?5:s>=H5e?2:1;let a,u,l;return i<0?(l=Math.pow(10,-i)/o,a=Math.round(e*l),u=Math.round(t*l),a/lt&&--u,l=-l):(l=Math.pow(10,i)*o,a=Math.round(e/l),u=Math.round(t/l),a*lt&&--u),u0))return[];if(e===t)return[e];const r=t=i))return[];const a=s-i+1,u=new Array(a);if(r)if(o<0)for(let l=0;l=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n=i)&&(n=i)}return n}function sT(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function cee(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?lee:U5e(i);r>n;){if(r-n>600){const u=r-n+1,l=t-n+1,c=Math.log(u),f=.5*Math.exp(2*c/3),d=.5*Math.sqrt(c*f*(u-f)/u)*(l-u/2<0?-1:1),h=Math.max(n,Math.floor(t-l*f/u+d)),p=Math.min(r,Math.floor(t+(u-l)*f/u+d));cee(e,t,h,p,i)}const s=e[t];let o=n,a=r;for(Mg(e,n,t),i(e[r],s)>0&&Mg(e,n,r);o0;)--a}i(e[n],s)===0?Mg(e,n,a):(++a,Mg(e,a,r)),a<=t&&(n=a+1),t<=a&&(r=a-1)}return e}function Mg(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function CA(e,t,n){if(e=Float64Array.from(R5e(e,n)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return sT(e);if(t>=1)return iT(e);var r,i=(r-1)*t,s=Math.floor(i),o=iT(cee(e,s).subarray(0,s+1)),a=sT(e.subarray(s+1));return o+(a-o)*(i-s)}}function n$(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function fee(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function z_(){}var Ry=.7,oT=1/Ry,Ap="\\s*([+-]?\\d+)\\s*",Ny="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",bu="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",q5e=/^#([0-9a-f]{3,8})$/,Y5e=new RegExp(`^rgb\\(${Ap},${Ap},${Ap}\\)$`),G5e=new RegExp(`^rgb\\(${bu},${bu},${bu}\\)$`),K5e=new RegExp(`^rgba\\(${Ap},${Ap},${Ap},${Ny}\\)$`),Q5e=new RegExp(`^rgba\\(${bu},${bu},${bu},${Ny}\\)$`),X5e=new RegExp(`^hsl\\(${Ny},${bu},${bu}\\)$`),J5e=new RegExp(`^hsla\\(${Ny},${bu},${bu},${Ny}\\)$`),_j={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};n$(z_,ky,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:vj,formatHex:vj,formatHex8:Z5e,formatHsl:eFe,formatRgb:bj,toString:bj});function vj(){return this.rgb().formatHex()}function Z5e(){return this.rgb().formatHex8()}function eFe(){return dee(this).formatHsl()}function bj(){return this.rgb().formatRgb()}function ky(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=q5e.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Ej(t):n===3?new ks(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?h1(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?h1(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Y5e.exec(e))?new ks(t[1],t[2],t[3],1):(t=G5e.exec(e))?new ks(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=K5e.exec(e))?h1(t[1],t[2],t[3],t[4]):(t=Q5e.exec(e))?h1(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=X5e.exec(e))?Sj(t[1],t[2]/100,t[3]/100,1):(t=J5e.exec(e))?Sj(t[1],t[2]/100,t[3]/100,t[4]):_j.hasOwnProperty(e)?Ej(_j[e]):e==="transparent"?new ks(NaN,NaN,NaN,0):null}function Ej(e){return new ks(e>>16&255,e>>8&255,e&255,1)}function h1(e,t,n,r){return r<=0&&(e=t=n=NaN),new ks(e,t,n,r)}function tFe(e){return e instanceof z_||(e=ky(e)),e?(e=e.rgb(),new ks(e.r,e.g,e.b,e.opacity)):new ks}function P2(e,t,n,r){return arguments.length===1?tFe(e):new ks(e,t,n,r??1)}function ks(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}n$(ks,P2,fee(z_,{brighter(e){return e=e==null?oT:Math.pow(oT,e),new ks(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ry:Math.pow(Ry,e),new ks(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ks(vd(this.r),vd(this.g),vd(this.b),aT(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:wj,formatHex:wj,formatHex8:nFe,formatRgb:Tj,toString:Tj}));function wj(){return`#${td(this.r)}${td(this.g)}${td(this.b)}`}function nFe(){return`#${td(this.r)}${td(this.g)}${td(this.b)}${td((isNaN(this.opacity)?1:this.opacity)*255)}`}function Tj(){const e=aT(this.opacity);return`${e===1?"rgb(":"rgba("}${vd(this.r)}, ${vd(this.g)}, ${vd(this.b)}${e===1?")":`, ${e})`}`}function aT(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function vd(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function td(e){return e=vd(e),(e<16?"0":"")+e.toString(16)}function Sj(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new va(e,t,n,r)}function dee(e){if(e instanceof va)return new va(e.h,e.s,e.l,e.opacity);if(e instanceof z_||(e=ky(e)),!e)return new va;if(e instanceof va)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),s=Math.max(t,n,r),o=NaN,a=s-i,u=(s+i)/2;return a?(t===s?o=(n-r)/a+(n0&&u<1?0:o,new va(o,a,u,e.opacity)}function rFe(e,t,n,r){return arguments.length===1?dee(e):new va(e,t,n,r??1)}function va(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}n$(va,rFe,fee(z_,{brighter(e){return e=e==null?oT:Math.pow(oT,e),new va(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ry:Math.pow(Ry,e),new va(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new ks(AA(e>=240?e-240:e+120,i,r),AA(e,i,r),AA(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new va(Ij(this.h),p1(this.s),p1(this.l),aT(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=aT(this.opacity);return`${e===1?"hsl(":"hsla("}${Ij(this.h)}, ${p1(this.s)*100}%, ${p1(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Ij(e){return e=(e||0)%360,e<0?e+360:e}function p1(e){return Math.max(0,Math.min(1,e||0))}function AA(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const r$=e=>()=>e;function iFe(e,t){return function(n){return e+n*t}}function sFe(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function oFe(e){return(e=+e)==1?hee:function(t,n){return n-t?sFe(t,n,e):r$(isNaN(t)?n:t)}}function hee(e,t){var n=t-e;return n?iFe(e,n):r$(isNaN(e)?t:e)}const xj=function e(t){var n=oFe(t);function r(i,s){var o=n((i=P2(i)).r,(s=P2(s)).r),a=n(i.g,s.g),u=n(i.b,s.b),l=hee(i.opacity,s.opacity);return function(c){return i.r=o(c),i.g=a(c),i.b=u(c),i.opacity=l(c),i+""}}return r.gamma=e,r}(1);function aFe(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(s){for(i=0;in&&(s=t.slice(n,s),a[o]?a[o]+=s:a[++o]=s),(r=r[0])===(i=i[0])?a[o]?a[o]+=i:a[++o]=i:(a[++o]=null,u.push({i:o,x:uT(r,i)})),n=OA.lastIndex;return n=0))throw new Error(`invalid digits: ${e}`);if(t>15)return pee;const n=10**t;return function(r){this._+=r[0];for(let i=1,s=r.length;iMf)if(!(Math.abs(f*u-l*c)>Mf)||!s)this._append`L${this._x1=t},${this._y1=n}`;else{let h=r-o,p=i-a,m=u*u+l*l,y=h*h+p*p,g=Math.sqrt(m),_=Math.sqrt(d),b=s*Math.tan((N2-Math.acos((m+d-y)/(2*g*_)))/2),T=b/_,I=b/g;Math.abs(T-1)>Mf&&this._append`L${t+T*c},${n+T*f}`,this._append`A${s},${s},0,0,${+(f*h>c*p)},${this._x1=t+I*u},${this._y1=n+I*l}`}}arc(t,n,r,i,s,o){if(t=+t,n=+n,r=+r,o=!!o,r<0)throw new Error(`negative radius: ${r}`);let a=r*Math.cos(i),u=r*Math.sin(i),l=t+a,c=n+u,f=1^o,d=o?i-s:s-i;this._x1===null?this._append`M${l},${c}`:(Math.abs(this._x1-l)>Mf||Math.abs(this._y1-c)>Mf)&&this._append`L${l},${c}`,r&&(d<0&&(d=d%k2+k2),d>gFe?this._append`A${r},${r},0,1,${f},${t-a},${n-u}A${r},${r},0,1,${f},${this._x1=l},${this._y1=c}`:d>Mf&&this._append`A${r},${r},0,${+(d>=N2)},${f},${this._x1=t+r*Math.cos(s)},${this._y1=n+r*Math.sin(s)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}var Cj={},PA={},RA=34,Fg=10,NA=13;function mee(e){return new Function("d","return {"+e.map(function(t,n){return JSON.stringify(t)+": d["+n+'] || ""'}).join(",")+"}")}function vFe(e,t){var n=mee(e);return function(r,i){return t(n(r),i,e)}}function Aj(e){var t=Object.create(null),n=[];return e.forEach(function(r){for(var i in r)i in t||n.push(t[i]=i)}),n}function Es(e,t){var n=e+"",r=n.length;return r9999?"+"+Es(e,6):Es(e,4)}function EFe(e){var t=e.getUTCHours(),n=e.getUTCMinutes(),r=e.getUTCSeconds(),i=e.getUTCMilliseconds();return isNaN(e)?"Invalid Date":bFe(e.getUTCFullYear())+"-"+Es(e.getUTCMonth()+1,2)+"-"+Es(e.getUTCDate(),2)+(i?"T"+Es(t,2)+":"+Es(n,2)+":"+Es(r,2)+"."+Es(i,3)+"Z":r?"T"+Es(t,2)+":"+Es(n,2)+":"+Es(r,2)+"Z":n||t?"T"+Es(t,2)+":"+Es(n,2)+"Z":"")}function wFe(e){var t=new RegExp('["'+e+` +\r]`),n=e.charCodeAt(0);function r(f,d){var h,p,m=i(f,function(y,g){if(h)return h(y,g-1);p=y,h=d?vFe(y,d):mee(y)});return m.columns=p||[],m}function i(f,d){var h=[],p=f.length,m=0,y=0,g,_=p<=0,b=!1;f.charCodeAt(p-1)===Fg&&--p,f.charCodeAt(p-1)===NA&&--p;function T(){if(_)return PA;if(b)return b=!1,Cj;var E,S=m,A;if(f.charCodeAt(S)===RA){for(;m++=p?_=!0:(A=f.charCodeAt(m++))===Fg?b=!0:A===NA&&(b=!0,f.charCodeAt(m)===Fg&&++m),f.slice(S+1,E-1).replace(/""/g,'"')}for(;m=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function lT(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function rm(e){return e=lT(Math.abs(e)),e?e[1]:NaN}function PFe(e,t){return function(n,r){for(var i=n.length,s=[],o=0,a=e[0],u=0;i>0&&a>0&&(u+a+1>r&&(a=Math.max(1,r-u)),s.push(n.substring(i-=a,i+a)),!((u+=a+1)>r));)a=e[o=(o+1)%e.length];return s.reverse().join(t)}}function RFe(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var NFe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function cT(e){if(!(t=NFe.exec(e)))throw new Error("invalid format: "+e);var t;return new s$({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}cT.prototype=s$.prototype;function s$(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}s$.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function kFe(e){e:for(var t=e.length,n=1,r=-1,i;n0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var yee;function DFe(e,t){var n=lT(e,t);if(!n)return e+"";var r=n[0],i=n[1],s=i-(yee=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return s===o?r:s>o?r+new Array(s-o+1).join("0"):s>0?r.slice(0,s)+"."+r.slice(s):"0."+new Array(1-s).join("0")+lT(e,Math.max(0,t+s-1))[0]}function Oj(e,t){var n=lT(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const Pj={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:OFe,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>Oj(e*100,t),r:Oj,s:DFe,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Rj(e){return e}var Nj=Array.prototype.map,kj=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function $Fe(e){var t=e.grouping===void 0||e.thousands===void 0?Rj:PFe(Nj.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",s=e.numerals===void 0?Rj:RFe(Nj.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",a=e.minus===void 0?"−":e.minus+"",u=e.nan===void 0?"NaN":e.nan+"";function l(f){f=cT(f);var d=f.fill,h=f.align,p=f.sign,m=f.symbol,y=f.zero,g=f.width,_=f.comma,b=f.precision,T=f.trim,I=f.type;I==="n"?(_=!0,I="g"):Pj[I]||(b===void 0&&(b=12),T=!0,I="g"),(y||d==="0"&&h==="=")&&(y=!0,d="0",h="=");var E=m==="$"?n:m==="#"&&/[boxX]/.test(I)?"0"+I.toLowerCase():"",S=m==="$"?r:/[%p]/.test(I)?o:"",A=Pj[I],P=/[defgprs%]/.test(I);b=b===void 0?6:/[gprs]/.test(I)?Math.max(1,Math.min(21,b)):Math.max(0,Math.min(20,b));function V(M){var H=E,J=S,Y,ye,he;if(I==="c")J=A(M)+J,M="";else{M=+M;var ve=M<0||1/M<0;if(M=isNaN(M)?u:A(Math.abs(M),b),T&&(M=kFe(M)),ve&&+M==0&&p!=="+"&&(ve=!1),H=(ve?p==="("?p:a:p==="-"||p==="("?"":p)+H,J=(I==="s"?kj[8+yee/3]:"")+J+(ve&&p==="("?")":""),P){for(Y=-1,ye=M.length;++Yhe||he>57){J=(he===46?i+M.slice(Y+1):M.slice(Y))+J,M=M.slice(0,Y);break}}}_&&!y&&(M=t(M,1/0));var te=H.length+M.length+J.length,se=te>1)+H+M+J+se.slice(te);break;default:M=se+H+M+J;break}return s(M)}return V.toString=function(){return f+""},V}function c(f,d){var h=l((f=cT(f),f.type="f",f)),p=Math.max(-8,Math.min(8,Math.floor(rm(d)/3)))*3,m=Math.pow(10,-p),y=kj[8+p/3];return function(g){return h(m*g)+y}}return{format:l,formatPrefix:c}}var m1,zc,_ee;LFe({thousands:",",grouping:[3],currency:["$",""]});function LFe(e){return m1=$Fe(e),zc=m1.format,_ee=m1.formatPrefix,m1}function MFe(e){return Math.max(0,-rm(Math.abs(e)))}function FFe(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(rm(t)/3)))*3-rm(Math.abs(e)))}function BFe(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,rm(t)-rm(e))+1}function o$(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}const Dj=Symbol("implicit");function a$(){var e=new C2,t=[],n=[],r=Dj;function i(s){let o=e.get(s);if(o===void 0){if(r!==Dj)return r;e.set(s,o=t.push(s)-1)}return n[o%n.length]}return i.domain=function(s){if(!arguments.length)return t.slice();t=[],e=new C2;for(const o of s)e.has(o)||e.set(o,t.push(o)-1);return i},i.range=function(s){return arguments.length?(n=Array.from(s),i):n.slice()},i.unknown=function(s){return arguments.length?(r=s,i):r},i.copy=function(){return a$(t,n).unknown(r)},o$.apply(i,arguments),i}function jFe(e){return function(){return e}}function UFe(e){return+e}var $j=[0,1];function Zh(e){return e}function D2(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:jFe(isNaN(t)?NaN:.5)}function VFe(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function zFe(e,t,n){var r=e[0],i=e[1],s=t[0],o=t[1];return i2?HFe:zFe,u=l=null,f}function f(d){return d==null||isNaN(d=+d)?s:(u||(u=a(e.map(r),t,n)))(r(o(d)))}return f.invert=function(d){return o(i((l||(l=a(t,e.map(r),uT)))(d)))},f.domain=function(d){return arguments.length?(e=Array.from(d,UFe),c()):e.slice()},f.range=function(d){return arguments.length?(t=Array.from(d),c()):t.slice()},f.rangeRound=function(d){return t=Array.from(d),n=mFe,c()},f.clamp=function(d){return arguments.length?(o=d?!0:Zh,c()):o!==Zh},f.interpolate=function(d){return arguments.length?(n=d,c()):n},f.unknown=function(d){return arguments.length?(s=d,f):s},function(d,h){return r=d,i=h,c()}}function bee(){return WFe()(Zh,Zh)}function qFe(e,t,n,r){var i=O2(e,t,n),s;switch(r=cT(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(s=FFe(i,o))&&(r.precision=s),_ee(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(s=BFe(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=s-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(s=MFe(i))&&(r.precision=s-(r.type==="%")*2);break}}return zc(r)}function YFe(e){var t=e.domain;return e.ticks=function(n){var r=t();return W5e(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return qFe(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,s=r.length-1,o=r[i],a=r[s],u,l,c=10;for(a0;){if(l=A2(o,a,n),l===u)return r[i]=o,r[s]=a,t(r);if(l>0)o=Math.floor(o/l)*l,a=Math.ceil(a/l)*l;else if(l<0)o=Math.ceil(o*l)/l,a=Math.floor(a*l)/l;else break;u=l}return e},e}function FI(){var e=bee();return e.copy=function(){return vee(e,FI())},o$.apply(e,arguments),YFe(e)}function GFe(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],s=e[r],o;return s(e(s=new Date(+s)),s),i.ceil=s=>(e(s=new Date(s-1)),t(s,1),e(s),s),i.round=s=>{const o=i(s),a=i.ceil(s);return s-o(t(s=new Date(+s),o==null?1:Math.floor(o)),s),i.range=(s,o,a)=>{const u=[];if(s=i.ceil(s),a=a==null?1:Math.floor(a),!(s0))return u;let l;do u.push(l=new Date(+s)),t(s,a),e(s);while(lni(o=>{if(o>=o)for(;e(o),!s(o);)o.setTime(o-1)},(o,a)=>{if(o>=o)if(a<0)for(;++a<=0;)for(;t(o,-1),!s(o););else for(;--a>=0;)for(;t(o,1),!s(o););}),n&&(i.count=(s,o)=>(kA.setTime(+s),DA.setTime(+o),e(kA),e(DA),Math.floor(n(kA,DA))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(r?o=>r(o)%s===0:o=>i.count(0,o)%s===0):i)),i}const fT=ni(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);fT.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?ni(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):fT);fT.range;const ol=1e3,Uo=ol*60,al=Uo*60,Cl=al*24,u$=Cl*7,Lj=Cl*30,$A=Cl*365,ep=ni(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*ol)},(e,t)=>(t-e)/ol,e=>e.getUTCSeconds());ep.range;const l$=ni(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ol)},(e,t)=>{e.setTime(+e+t*Uo)},(e,t)=>(t-e)/Uo,e=>e.getMinutes());l$.range;const KFe=ni(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Uo)},(e,t)=>(t-e)/Uo,e=>e.getUTCMinutes());KFe.range;const c$=ni(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ol-e.getMinutes()*Uo)},(e,t)=>{e.setTime(+e+t*al)},(e,t)=>(t-e)/al,e=>e.getHours());c$.range;const QFe=ni(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*al)},(e,t)=>(t-e)/al,e=>e.getUTCHours());QFe.range;const H_=ni(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Uo)/Cl,e=>e.getDate()-1);H_.range;const f$=ni(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Cl,e=>e.getUTCDate()-1);f$.range;const XFe=ni(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Cl,e=>Math.floor(e/Cl));XFe.range;function ih(e){return ni(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Uo)/u$)}const BI=ih(0),dT=ih(1),JFe=ih(2),ZFe=ih(3),im=ih(4),e8e=ih(5),t8e=ih(6);BI.range;dT.range;JFe.range;ZFe.range;im.range;e8e.range;t8e.range;function sh(e){return ni(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/u$)}const Eee=sh(0),hT=sh(1),n8e=sh(2),r8e=sh(3),sm=sh(4),i8e=sh(5),s8e=sh(6);Eee.range;hT.range;n8e.range;r8e.range;sm.range;i8e.range;s8e.range;const d$=ni(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());d$.range;const o8e=ni(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());o8e.range;const Al=ni(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Al.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:ni(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});Al.range;const Md=ni(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Md.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:ni(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});Md.range;function a8e(e,t,n,r,i,s){const o=[[ep,1,ol],[ep,5,5*ol],[ep,15,15*ol],[ep,30,30*ol],[s,1,Uo],[s,5,5*Uo],[s,15,15*Uo],[s,30,30*Uo],[i,1,al],[i,3,3*al],[i,6,6*al],[i,12,12*al],[r,1,Cl],[r,2,2*Cl],[n,1,u$],[t,1,Lj],[t,3,3*Lj],[e,1,$A]];function a(l,c,f){const d=cy).right(o,d);if(h===o.length)return e.every(O2(l/$A,c/$A,f));if(h===0)return fT.every(Math.max(O2(l,c,f),1));const[p,m]=o[d/o[h-1][2]53)return null;"w"in ce||(ce.w=1),"Z"in ce?(Ke=MA(Bg(ce.y,0,1)),qe=Ke.getUTCDay(),Ke=qe>4||qe===0?hT.ceil(Ke):hT(Ke),Ke=f$.offset(Ke,(ce.V-1)*7),ce.y=Ke.getUTCFullYear(),ce.m=Ke.getUTCMonth(),ce.d=Ke.getUTCDate()+(ce.w+6)%7):(Ke=LA(Bg(ce.y,0,1)),qe=Ke.getDay(),Ke=qe>4||qe===0?dT.ceil(Ke):dT(Ke),Ke=H_.offset(Ke,(ce.V-1)*7),ce.y=Ke.getFullYear(),ce.m=Ke.getMonth(),ce.d=Ke.getDate()+(ce.w+6)%7)}else("W"in ce||"U"in ce)&&("w"in ce||(ce.w="u"in ce?ce.u%7:"W"in ce?1:0),qe="Z"in ce?MA(Bg(ce.y,0,1)).getUTCDay():LA(Bg(ce.y,0,1)).getDay(),ce.m=0,ce.d="W"in ce?(ce.w+6)%7+ce.W*7-(qe+5)%7:ce.w+ce.U*7-(qe+6)%7);return"Z"in ce?(ce.H+=ce.Z/100|0,ce.M+=ce.Z%100,MA(ce)):LA(ce)}}function A(pe,me,Se,ce){for(var st=0,Ke=me.length,qe=Se.length,$e,ot;st=qe)return-1;if($e=me.charCodeAt(st++),$e===37){if($e=me.charAt(st++),ot=I[$e in Mj?me.charAt(st++):$e],!ot||(ce=ot(pe,Se,ce))<0)return-1}else if($e!=Se.charCodeAt(ce++))return-1}return ce}function P(pe,me,Se){var ce=l.exec(me.slice(Se));return ce?(pe.p=c.get(ce[0].toLowerCase()),Se+ce[0].length):-1}function V(pe,me,Se){var ce=h.exec(me.slice(Se));return ce?(pe.w=p.get(ce[0].toLowerCase()),Se+ce[0].length):-1}function M(pe,me,Se){var ce=f.exec(me.slice(Se));return ce?(pe.w=d.get(ce[0].toLowerCase()),Se+ce[0].length):-1}function H(pe,me,Se){var ce=g.exec(me.slice(Se));return ce?(pe.m=_.get(ce[0].toLowerCase()),Se+ce[0].length):-1}function J(pe,me,Se){var ce=m.exec(me.slice(Se));return ce?(pe.m=y.get(ce[0].toLowerCase()),Se+ce[0].length):-1}function Y(pe,me,Se){return A(pe,t,me,Se)}function ye(pe,me,Se){return A(pe,n,me,Se)}function he(pe,me,Se){return A(pe,r,me,Se)}function ve(pe){return o[pe.getDay()]}function te(pe){return s[pe.getDay()]}function se(pe){return u[pe.getMonth()]}function K(pe){return a[pe.getMonth()]}function x(pe){return i[+(pe.getHours()>=12)]}function C(pe){return 1+~~(pe.getMonth()/3)}function z(pe){return o[pe.getUTCDay()]}function R(pe){return s[pe.getUTCDay()]}function O(pe){return u[pe.getUTCMonth()]}function q(pe){return a[pe.getUTCMonth()]}function le(pe){return i[+(pe.getUTCHours()>=12)]}function ae(pe){return 1+~~(pe.getUTCMonth()/3)}return{format:function(pe){var me=E(pe+="",b);return me.toString=function(){return pe},me},parse:function(pe){var me=S(pe+="",!1);return me.toString=function(){return pe},me},utcFormat:function(pe){var me=E(pe+="",T);return me.toString=function(){return pe},me},utcParse:function(pe){var me=S(pe+="",!0);return me.toString=function(){return pe},me}}}var Mj={"-":"",_:" ",0:"0"},mi=/^\s*\d+/,f8e=/^%/,d8e=/[\\^$*+?|[\]().{}]/g;function vn(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",s=i.length;return r+(s[t.toLowerCase(),n]))}function p8e(e,t,n){var r=mi.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function m8e(e,t,n){var r=mi.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function g8e(e,t,n){var r=mi.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function y8e(e,t,n){var r=mi.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function _8e(e,t,n){var r=mi.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function Fj(e,t,n){var r=mi.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function Bj(e,t,n){var r=mi.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function v8e(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function b8e(e,t,n){var r=mi.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function E8e(e,t,n){var r=mi.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function jj(e,t,n){var r=mi.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function w8e(e,t,n){var r=mi.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function Uj(e,t,n){var r=mi.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function T8e(e,t,n){var r=mi.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function S8e(e,t,n){var r=mi.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function I8e(e,t,n){var r=mi.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function x8e(e,t,n){var r=mi.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function C8e(e,t,n){var r=f8e.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function A8e(e,t,n){var r=mi.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function O8e(e,t,n){var r=mi.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function Vj(e,t){return vn(e.getDate(),t,2)}function P8e(e,t){return vn(e.getHours(),t,2)}function R8e(e,t){return vn(e.getHours()%12||12,t,2)}function N8e(e,t){return vn(1+H_.count(Al(e),e),t,3)}function wee(e,t){return vn(e.getMilliseconds(),t,3)}function k8e(e,t){return wee(e,t)+"000"}function D8e(e,t){return vn(e.getMonth()+1,t,2)}function $8e(e,t){return vn(e.getMinutes(),t,2)}function L8e(e,t){return vn(e.getSeconds(),t,2)}function M8e(e){var t=e.getDay();return t===0?7:t}function F8e(e,t){return vn(BI.count(Al(e)-1,e),t,2)}function Tee(e){var t=e.getDay();return t>=4||t===0?im(e):im.ceil(e)}function B8e(e,t){return e=Tee(e),vn(im.count(Al(e),e)+(Al(e).getDay()===4),t,2)}function j8e(e){return e.getDay()}function U8e(e,t){return vn(dT.count(Al(e)-1,e),t,2)}function V8e(e,t){return vn(e.getFullYear()%100,t,2)}function z8e(e,t){return e=Tee(e),vn(e.getFullYear()%100,t,2)}function H8e(e,t){return vn(e.getFullYear()%1e4,t,4)}function W8e(e,t){var n=e.getDay();return e=n>=4||n===0?im(e):im.ceil(e),vn(e.getFullYear()%1e4,t,4)}function q8e(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+vn(t/60|0,"0",2)+vn(t%60,"0",2)}function zj(e,t){return vn(e.getUTCDate(),t,2)}function Y8e(e,t){return vn(e.getUTCHours(),t,2)}function G8e(e,t){return vn(e.getUTCHours()%12||12,t,2)}function K8e(e,t){return vn(1+f$.count(Md(e),e),t,3)}function See(e,t){return vn(e.getUTCMilliseconds(),t,3)}function Q8e(e,t){return See(e,t)+"000"}function X8e(e,t){return vn(e.getUTCMonth()+1,t,2)}function J8e(e,t){return vn(e.getUTCMinutes(),t,2)}function Z8e(e,t){return vn(e.getUTCSeconds(),t,2)}function e9e(e){var t=e.getUTCDay();return t===0?7:t}function t9e(e,t){return vn(Eee.count(Md(e)-1,e),t,2)}function Iee(e){var t=e.getUTCDay();return t>=4||t===0?sm(e):sm.ceil(e)}function n9e(e,t){return e=Iee(e),vn(sm.count(Md(e),e)+(Md(e).getUTCDay()===4),t,2)}function r9e(e){return e.getUTCDay()}function i9e(e,t){return vn(hT.count(Md(e)-1,e),t,2)}function s9e(e,t){return vn(e.getUTCFullYear()%100,t,2)}function o9e(e,t){return e=Iee(e),vn(e.getUTCFullYear()%100,t,2)}function a9e(e,t){return vn(e.getUTCFullYear()%1e4,t,4)}function u9e(e,t){var n=e.getUTCDay();return e=n>=4||n===0?sm(e):sm.ceil(e),vn(e.getUTCFullYear()%1e4,t,4)}function l9e(){return"+0000"}function Hj(){return"%"}function Wj(e){return+e}function qj(e){return Math.floor(+e/1e3)}var Sh,xee,nd,h$;c9e({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function c9e(e){return Sh=c8e(e),xee=Sh.format,nd=Sh.parse,h$=Sh.utcFormat,Sh.utcParse,Sh}function f9e(e){return new Date(e)}function d9e(e){return e instanceof Date?+e:+new Date(+e)}function Cee(e,t,n,r,i,s,o,a,u,l){var c=bee(),f=c.invert,d=c.domain,h=l(".%L"),p=l(":%S"),m=l("%I:%M"),y=l("%I %p"),g=l("%a %d"),_=l("%b %d"),b=l("%B"),T=l("%Y");function I(E){return(u(E)=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new _Fe(t)}function Oee(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Pee(e){this._context=e}Pee.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Ree(e){return new Pee(e)}function Nee(e){return e[0]}function kee(e){return e[1]}function H0(e,t){var n=ai(!0),r=null,i=Ree,s=null,o=Aee(a);e=typeof e=="function"?e:e===void 0?Nee:ai(e),t=typeof t=="function"?t:t===void 0?kee:ai(t);function a(u){var l,c=(u=Oee(u)).length,f,d=!1,h;for(r==null&&(s=i(h=o())),l=0;l<=c;++l)!(l=h;--p)a.point(b[p],T[p]);a.lineEnd(),a.areaEnd()}g&&(b[d]=+e(y,d,f),T[d]=+t(y,d,f),a.point(r?+r(y,d,f):b[d],n?+n(y,d,f):T[d]))}if(_)return a=null,_+""||null}function c(){return H0().defined(i).curve(o).context(s)}return l.x=function(f){return arguments.length?(e=typeof f=="function"?f:ai(+f),r=null,l):e},l.x0=function(f){return arguments.length?(e=typeof f=="function"?f:ai(+f),l):e},l.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:ai(+f),l):r},l.y=function(f){return arguments.length?(t=typeof f=="function"?f:ai(+f),n=null,l):t},l.y0=function(f){return arguments.length?(t=typeof f=="function"?f:ai(+f),l):t},l.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:ai(+f),l):n},l.lineX0=l.lineY0=function(){return c().x(e).y(t)},l.lineY1=function(){return c().x(e).y(n)},l.lineX1=function(){return c().x(r).y(t)},l.defined=function(f){return arguments.length?(i=typeof f=="function"?f:ai(!!f),l):i},l.curve=function(f){return arguments.length?(o=f,s!=null&&(a=o(s)),l):o},l.context=function(f){return arguments.length?(f==null?s=a=null:a=o(s=f),l):s},l}function Yj(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function $ee(e){this._context=e}$ee.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Yj(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Yj(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function tp(e){return new $ee(e)}function a0(e,t,n){this.k=e,this.x=t,this.y=n}a0.prototype={constructor:a0,scale:function(e){return e===1?this:new a0(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new a0(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};a0.prototype;function h9e(){const e=new Map;return{listen(t,n){return e.has(t)||e.set(t,[]),e.get(t).push(n),()=>{e.set(t,(e.get(t)||[]).filter(r=>r!==n))}},fire(t,n){const r=e.get(t);r&&r.forEach(i=>i(n))}}}let g1;const p9e=new Uint8Array(16);function m9e(){if(!g1&&(g1=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!g1))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return g1(p9e)}const bi=[];for(let e=0;e<256;++e)bi.push((e+256).toString(16).slice(1));function g9e(e,t=0){return(bi[e[t+0]]+bi[e[t+1]]+bi[e[t+2]]+bi[e[t+3]]+"-"+bi[e[t+4]]+bi[e[t+5]]+"-"+bi[e[t+6]]+bi[e[t+7]]+"-"+bi[e[t+8]]+bi[e[t+9]]+"-"+bi[e[t+10]]+bi[e[t+11]]+bi[e[t+12]]+bi[e[t+13]]+bi[e[t+14]]+bi[e[t+15]]).toLowerCase()}const y9e=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Gj={randomUUID:y9e};function Kj(e,t,n){if(Gj.randomUUID&&!t&&!e)return Gj.randomUUID();e=e||{};const r=e.random||(e.rng||m9e)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let i=0;i<16;++i)t[n+i]=r[i];return t}return g9e(r)}let Eu=class{static get(){let t=Kj();for(;this.ids.has(t);)t=Kj();return this.ids.set(t,!0),t}};Eu.ids=new Map;function wu(e){return"parent"in e}function _9e(e){const{label:t=void 0,state:n,initialArtifact:r,initialMetadata:i}=e,s={annotation:[],bookmark:[]},o=Object.keys(i||{}).reduce((u,l)=>(u[l]=[],i&&i[l]&&u[l].push({type:l,id:Eu.get(),val:i[l],createdOn:Date.now()}),u),s),a=r?[{id:Eu.get(),createdOn:Date.now(),val:r}]:[];return{id:Eu.get(),label:t||"Root",event:"Root",children:[],level:0,createdOn:Date.now(),meta:o,artifacts:a,state:{type:"checkpoint",val:n}}}function v9e({parent:e,state:t,label:n,sideEffects:r={do:[],undo:[]},initialMetadata:i,initialArtifact:s,event:o}){const a={annotation:[],bookmark:[]},u=Object.keys(i||{}).reduce((c,f)=>(c[f]=[],i&&i[f]&&c[f].push({type:f,id:Eu.get(),val:i[f],createdOn:Date.now()}),c),a),l=s?[{id:Eu.get(),createdOn:Date.now(),val:s}]:[];return{id:Eu.get(),label:n,event:o,children:[],parent:e.id,createdOn:Date.now(),meta:u,artifacts:l,sideEffects:r,state:t,level:e.level+1}}function Ir(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r3?t.i-4:t.i:Array.isArray(e)?1:jI(e)?2:UI(e)?3:0}function $y(e,t){return nf(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function fb(e,t){return nf(e)===2?e.get(t):e[t]}function Lee(e,t,n){var r=nf(e);r===2?e.set(t,n):r===3?(e.delete(t),e.add(n)):e[t]=n}function b9e(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function jI(e){return x9e&&e instanceof Map}function UI(e){return C9e&&e instanceof Set}function Ff(e){return e.o||e.t}function p$(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=P9e(e);delete t[go];for(var n=v$(t),r=0;r1&&(e.set=e.add=e.clear=e.delete=E9e),Object.freeze(e),t&&om(e,function(n,r){return m$(r,!0)},!0)),e}function E9e(){Ir(2)}function g$(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function Tu(e){var t=F2[e];return t||Ir(18,e),t}function w9e(e,t){F2[e]||(F2[e]=t)}function Qj(){return{}.NODE_ENV==="production"||am||Ir(0),am}function FA(e,t){t&&(Tu("Patches"),e.u=[],e.s=[],e.v=t)}function pT(e){$2(e),e.p.forEach(T9e),e.p=null}function $2(e){e===am&&(am=e.l)}function Xj(e){return am={p:[],l:am,h:e,m:!0,_:0}}function T9e(e){var t=e[go];t.i===0||t.i===1?t.j():t.O=!0}function BA(e,t){t._=t.p.length;var n=t.p[0],r=e!==void 0&&e!==n;return t.h.g||Tu("ES5").S(t,e,r),r?(n[go].P&&(pT(t),Ir(4)),tf(e)&&(e=mT(t,e),t.l||gT(t,e)),t.u&&Tu("Patches").M(n[go].t,e,t.u,t.s)):e=mT(t,n,[]),pT(t),t.u&&t.v(t.u,t.s),e!==_$?e:void 0}function mT(e,t,n){if(g$(t))return t;var r=t[go];if(!r)return om(t,function(s,o){return Jj(e,r,t,s,o,n)},!0),t;if(r.A!==e)return t;if(!r.P)return gT(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var i=r.i===4||r.i===5?r.o=p$(r.k):r.o;om(r.i===3?new Set(i):i,function(s,o){return Jj(e,r,i,s,o,n)}),gT(e,i,!1),n&&e.u&&Tu("Patches").R(r,n,e.u,e.s)}return r.o}function Jj(e,t,n,r,i,s){if({}.NODE_ENV!=="production"&&i===n&&Ir(5),Fd(i)){var o=mT(e,i,s&&t&&t.i!==3&&!$y(t.D,r)?s.concat(r):void 0);if(Lee(n,r,o),!Fd(o))return;e.m=!1}if(tf(i)&&!g$(i)){if(!e.h.F&&e._<1)return;mT(e,i),t&&t.A.l||gT(e,i)}}function gT(e,t,n){n===void 0&&(n=!1),e.h.F&&e.m&&m$(t,n)}function jA(e,t){var n=e[go];return(n?Ff(n):e)[t]}function Zj(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function L2(e){e.P||(e.P=!0,e.l&&L2(e.l))}function UA(e){e.o||(e.o=p$(e.t))}function M2(e,t,n){var r=jI(t)?Tu("MapSet").N(t,n):UI(t)?Tu("MapSet").T(t,n):e.g?function(i,s){var o=Array.isArray(i),a={i:o?1:0,A:s?s.A:Qj(),P:!1,I:!1,D:{},l:s,t:i,k:null,o:null,j:null,C:!1},u=a,l=B2;o&&(u=[a],l=u0);var c=Proxy.revocable(u,l),f=c.revoke,d=c.proxy;return a.k=d,a.j=f,d}(t,n):Tu("ES5").J(t,n);return(n?n.A:Qj()).p.push(r),r}function S9e(e){return Fd(e)||Ir(22,e),function t(n){if(!tf(n))return n;var r,i=n[go],s=nf(n);if(i){if(!i.P&&(i.i<4||!Tu("ES5").K(i)))return i.t;i.I=!0,r=eU(n,s),i.I=!1}else r=eU(n,s);return om(r,function(o,a){i&&fb(i.t,o)===a||Lee(r,o,t(a))}),s===3?new Set(r):r}(e)}function eU(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return p$(e)}function I9e(){function e(r){if(!tf(r))return r;if(Array.isArray(r))return r.map(e);if(jI(r))return new Map(Array.from(r.entries()).map(function(o){return[o[0],e(o[1])]}));if(UI(r))return new Set(Array.from(r).map(e));var i=Object.create(Object.getPrototypeOf(r));for(var s in r)i[s]=e(r[s]);return $y(r,W0)&&(i[W0]=r[W0]),i}function t(r){return Fd(r)?e(r):r}var n="add";w9e("Patches",{$:function(r,i){return i.forEach(function(s){for(var o=s.path,a=s.op,u=r,l=0;l1?g-1:0),b=1;b1?c-1:0),d=1;d=0;i--){var s=r[i];if(s.path.length===0&&s.op==="replace"){n=s.value;break}}i>-1&&(r=r.slice(i+1));var o=Tu("Patches").$;return Fd(n)?o(n,r):this.produce(n,function(a){return o(a,r)})},e}(),yo=new R9e,N9e=yo.produce;yo.produceWithPatches.bind(yo);yo.setAutoFreeze.bind(yo);yo.setUseProxies.bind(yo);yo.applyPatches.bind(yo);yo.createDraft.bind(yo);yo.finishDraft.bind(yo);function k9e(e,t={}){const{artifact:n=void 0,metadata:r=void 0,rootLabel:i="Root"}=t,s=_9e({state:e,label:i,initialArtifact:n,initialMetadata:r}),o={nodes:{[s.id]:s},root:s.id,current:s.id};return dJ({name:"provenance-graph",initialState:o,reducers:{addMetadata(a,u){const{id:l,meta:c}=u.payload,f=a.nodes[l].meta,d=Object.keys(c).reduce((h,p)=>(h[p]||(h[p]=[]),h[p].push({type:p,id:Eu.get(),val:c[p],createdOn:Date.now()}),h),f);a.nodes[u.payload.id].meta=d},addArtifact(a,u){a.nodes[u.payload.id].artifacts.push({id:Eu.get(),createdOn:Date.now(),val:u.payload.artifact})},changeCurrent(a,u){a.current=u.payload},addNode(a,{payload:u}){a.nodes[u.id]=u,a.nodes[u.parent].children.push(u.id),a.current=u.id},load(a,{payload:u}){return u}}})}function D9e(e){const t=new Map,{reducer:n,actions:r,getInitialState:i}=k9e(e),s=ZNe();s.startListening({matcher:z9(r.changeCurrent,r.addNode),effect:(a,u)=>{u.cancelActiveListeners(),t.forEach(l=>{const c=z9(r.addNode)(a),{skipOnNew:f}=l.config;f&&c||l.func(c?"new":"traversal")})}});const o=cJ({reducer:n,middleware:a=>a().prepend(s.middleware)});return{initialState:i(),get backend(){return o.getState()},get current(){return o.getState().nodes[o.getState().current]},get root(){return o.getState().nodes[o.getState().root]},currentChange(a,u){const l={id:Eu.get(),func:a,config:u};return t.set(l.id,l),()=>t.delete(l.id)},update:o.dispatch,...r}}/*! +`)}function l(f){return f.map(c).join(e)}function c(f){return f==null?"":f instanceof Date?EFe(f):t.test(f+="")?'"'+f.replace(/"/g,'""')+'"':f}return{parse:r,parseRows:i,format:o,formatBody:a,formatRows:u,formatRow:l,formatValue:c}}var TFe=wFe(","),SFe=TFe.parse;function IFe(e){if(!e.ok)throw new Error(e.status+" "+e.statusText);return e.text()}function xFe(e,t){return fetch(e,t).then(IFe)}function CFe(e){return function(t,n,r){return arguments.length===2&&typeof n=="function"&&(r=n,n=void 0),xFe(t,n).then(function(i){return e(i,r)})}}var AFe=CFe(SFe);function OFe(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function lT(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function rm(e){return e=lT(Math.abs(e)),e?e[1]:NaN}function PFe(e,t){return function(n,r){for(var i=n.length,s=[],o=0,a=e[0],u=0;i>0&&a>0&&(u+a+1>r&&(a=Math.max(1,r-u)),s.push(n.substring(i-=a,i+a)),!((u+=a+1)>r));)a=e[o=(o+1)%e.length];return s.reverse().join(t)}}function RFe(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var NFe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function cT(e){if(!(t=NFe.exec(e)))throw new Error("invalid format: "+e);var t;return new s$({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}cT.prototype=s$.prototype;function s$(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}s$.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function kFe(e){e:for(var t=e.length,n=1,r=-1,i;n0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var gee;function DFe(e,t){var n=lT(e,t);if(!n)return e+"";var r=n[0],i=n[1],s=i-(gee=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return s===o?r:s>o?r+new Array(s-o+1).join("0"):s>0?r.slice(0,s)+"."+r.slice(s):"0."+new Array(1-s).join("0")+lT(e,Math.max(0,t+s-1))[0]}function Oj(e,t){var n=lT(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const Pj={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:OFe,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>Oj(e*100,t),r:Oj,s:DFe,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Rj(e){return e}var Nj=Array.prototype.map,kj=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function $Fe(e){var t=e.grouping===void 0||e.thousands===void 0?Rj:PFe(Nj.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",s=e.numerals===void 0?Rj:RFe(Nj.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",a=e.minus===void 0?"−":e.minus+"",u=e.nan===void 0?"NaN":e.nan+"";function l(f){f=cT(f);var d=f.fill,h=f.align,p=f.sign,m=f.symbol,y=f.zero,g=f.width,_=f.comma,b=f.precision,T=f.trim,I=f.type;I==="n"?(_=!0,I="g"):Pj[I]||(b===void 0&&(b=12),T=!0,I="g"),(y||d==="0"&&h==="=")&&(y=!0,d="0",h="=");var E=m==="$"?n:m==="#"&&/[boxX]/.test(I)?"0"+I.toLowerCase():"",S=m==="$"?r:/[%p]/.test(I)?o:"",A=Pj[I],P=/[defgprs%]/.test(I);b=b===void 0?6:/[gprs]/.test(I)?Math.max(1,Math.min(21,b)):Math.max(0,Math.min(20,b));function V(M){var H=E,J=S,Y,ye,he;if(I==="c")J=A(M)+J,M="";else{M=+M;var ve=M<0||1/M<0;if(M=isNaN(M)?u:A(Math.abs(M),b),T&&(M=kFe(M)),ve&&+M==0&&p!=="+"&&(ve=!1),H=(ve?p==="("?p:a:p==="-"||p==="("?"":p)+H,J=(I==="s"?kj[8+gee/3]:"")+J+(ve&&p==="("?")":""),P){for(Y=-1,ye=M.length;++Yhe||he>57){J=(he===46?i+M.slice(Y+1):M.slice(Y))+J,M=M.slice(0,Y);break}}}_&&!y&&(M=t(M,1/0));var te=H.length+M.length+J.length,se=te>1)+H+M+J+se.slice(te);break;default:M=se+H+M+J;break}return s(M)}return V.toString=function(){return f+""},V}function c(f,d){var h=l((f=cT(f),f.type="f",f)),p=Math.max(-8,Math.min(8,Math.floor(rm(d)/3)))*3,m=Math.pow(10,-p),y=kj[8+p/3];return function(g){return h(m*g)+y}}return{format:l,formatPrefix:c}}var m1,zc,yee;LFe({thousands:",",grouping:[3],currency:["$",""]});function LFe(e){return m1=$Fe(e),zc=m1.format,yee=m1.formatPrefix,m1}function MFe(e){return Math.max(0,-rm(Math.abs(e)))}function FFe(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(rm(t)/3)))*3-rm(Math.abs(e)))}function BFe(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,rm(t)-rm(e))+1}function o$(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}const Dj=Symbol("implicit");function a$(){var e=new C2,t=[],n=[],r=Dj;function i(s){let o=e.get(s);if(o===void 0){if(r!==Dj)return r;e.set(s,o=t.push(s)-1)}return n[o%n.length]}return i.domain=function(s){if(!arguments.length)return t.slice();t=[],e=new C2;for(const o of s)e.has(o)||e.set(o,t.push(o)-1);return i},i.range=function(s){return arguments.length?(n=Array.from(s),i):n.slice()},i.unknown=function(s){return arguments.length?(r=s,i):r},i.copy=function(){return a$(t,n).unknown(r)},o$.apply(i,arguments),i}function jFe(e){return function(){return e}}function UFe(e){return+e}var $j=[0,1];function Zh(e){return e}function D2(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:jFe(isNaN(t)?NaN:.5)}function VFe(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function zFe(e,t,n){var r=e[0],i=e[1],s=t[0],o=t[1];return i2?HFe:zFe,u=l=null,f}function f(d){return d==null||isNaN(d=+d)?s:(u||(u=a(e.map(r),t,n)))(r(o(d)))}return f.invert=function(d){return o(i((l||(l=a(t,e.map(r),uT)))(d)))},f.domain=function(d){return arguments.length?(e=Array.from(d,UFe),c()):e.slice()},f.range=function(d){return arguments.length?(t=Array.from(d),c()):t.slice()},f.rangeRound=function(d){return t=Array.from(d),n=mFe,c()},f.clamp=function(d){return arguments.length?(o=d?!0:Zh,c()):o!==Zh},f.interpolate=function(d){return arguments.length?(n=d,c()):n},f.unknown=function(d){return arguments.length?(s=d,f):s},function(d,h){return r=d,i=h,c()}}function vee(){return WFe()(Zh,Zh)}function qFe(e,t,n,r){var i=O2(e,t,n),s;switch(r=cT(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(s=FFe(i,o))&&(r.precision=s),yee(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(s=BFe(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=s-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(s=MFe(i))&&(r.precision=s-(r.type==="%")*2);break}}return zc(r)}function YFe(e){var t=e.domain;return e.ticks=function(n){var r=t();return W5e(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return qFe(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,s=r.length-1,o=r[i],a=r[s],u,l,c=10;for(a0;){if(l=A2(o,a,n),l===u)return r[i]=o,r[s]=a,t(r);if(l>0)o=Math.floor(o/l)*l,a=Math.ceil(a/l)*l;else if(l<0)o=Math.ceil(o*l)/l,a=Math.floor(a*l)/l;else break;u=l}return e},e}function FI(){var e=vee();return e.copy=function(){return _ee(e,FI())},o$.apply(e,arguments),YFe(e)}function GFe(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],s=e[r],o;return s(e(s=new Date(+s)),s),i.ceil=s=>(e(s=new Date(s-1)),t(s,1),e(s),s),i.round=s=>{const o=i(s),a=i.ceil(s);return s-o(t(s=new Date(+s),o==null?1:Math.floor(o)),s),i.range=(s,o,a)=>{const u=[];if(s=i.ceil(s),a=a==null?1:Math.floor(a),!(s0))return u;let l;do u.push(l=new Date(+s)),t(s,a),e(s);while(lni(o=>{if(o>=o)for(;e(o),!s(o);)o.setTime(o-1)},(o,a)=>{if(o>=o)if(a<0)for(;++a<=0;)for(;t(o,-1),!s(o););else for(;--a>=0;)for(;t(o,1),!s(o););}),n&&(i.count=(s,o)=>(kA.setTime(+s),DA.setTime(+o),e(kA),e(DA),Math.floor(n(kA,DA))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(r?o=>r(o)%s===0:o=>i.count(0,o)%s===0):i)),i}const fT=ni(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);fT.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?ni(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):fT);fT.range;const ol=1e3,Uo=ol*60,al=Uo*60,Cl=al*24,u$=Cl*7,Lj=Cl*30,$A=Cl*365,ep=ni(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*ol)},(e,t)=>(t-e)/ol,e=>e.getUTCSeconds());ep.range;const l$=ni(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ol)},(e,t)=>{e.setTime(+e+t*Uo)},(e,t)=>(t-e)/Uo,e=>e.getMinutes());l$.range;const KFe=ni(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Uo)},(e,t)=>(t-e)/Uo,e=>e.getUTCMinutes());KFe.range;const c$=ni(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ol-e.getMinutes()*Uo)},(e,t)=>{e.setTime(+e+t*al)},(e,t)=>(t-e)/al,e=>e.getHours());c$.range;const QFe=ni(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*al)},(e,t)=>(t-e)/al,e=>e.getUTCHours());QFe.range;const H_=ni(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Uo)/Cl,e=>e.getDate()-1);H_.range;const f$=ni(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Cl,e=>e.getUTCDate()-1);f$.range;const XFe=ni(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Cl,e=>Math.floor(e/Cl));XFe.range;function ih(e){return ni(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Uo)/u$)}const BI=ih(0),dT=ih(1),JFe=ih(2),ZFe=ih(3),im=ih(4),e8e=ih(5),t8e=ih(6);BI.range;dT.range;JFe.range;ZFe.range;im.range;e8e.range;t8e.range;function sh(e){return ni(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/u$)}const bee=sh(0),hT=sh(1),n8e=sh(2),r8e=sh(3),sm=sh(4),i8e=sh(5),s8e=sh(6);bee.range;hT.range;n8e.range;r8e.range;sm.range;i8e.range;s8e.range;const d$=ni(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());d$.range;const o8e=ni(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());o8e.range;const Al=ni(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Al.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:ni(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});Al.range;const Md=ni(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Md.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:ni(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});Md.range;function a8e(e,t,n,r,i,s){const o=[[ep,1,ol],[ep,5,5*ol],[ep,15,15*ol],[ep,30,30*ol],[s,1,Uo],[s,5,5*Uo],[s,15,15*Uo],[s,30,30*Uo],[i,1,al],[i,3,3*al],[i,6,6*al],[i,12,12*al],[r,1,Cl],[r,2,2*Cl],[n,1,u$],[t,1,Lj],[t,3,3*Lj],[e,1,$A]];function a(l,c,f){const d=cy).right(o,d);if(h===o.length)return e.every(O2(l/$A,c/$A,f));if(h===0)return fT.every(Math.max(O2(l,c,f),1));const[p,m]=o[d/o[h-1][2]53)return null;"w"in ce||(ce.w=1),"Z"in ce?(Ke=MA(Bg(ce.y,0,1)),qe=Ke.getUTCDay(),Ke=qe>4||qe===0?hT.ceil(Ke):hT(Ke),Ke=f$.offset(Ke,(ce.V-1)*7),ce.y=Ke.getUTCFullYear(),ce.m=Ke.getUTCMonth(),ce.d=Ke.getUTCDate()+(ce.w+6)%7):(Ke=LA(Bg(ce.y,0,1)),qe=Ke.getDay(),Ke=qe>4||qe===0?dT.ceil(Ke):dT(Ke),Ke=H_.offset(Ke,(ce.V-1)*7),ce.y=Ke.getFullYear(),ce.m=Ke.getMonth(),ce.d=Ke.getDate()+(ce.w+6)%7)}else("W"in ce||"U"in ce)&&("w"in ce||(ce.w="u"in ce?ce.u%7:"W"in ce?1:0),qe="Z"in ce?MA(Bg(ce.y,0,1)).getUTCDay():LA(Bg(ce.y,0,1)).getDay(),ce.m=0,ce.d="W"in ce?(ce.w+6)%7+ce.W*7-(qe+5)%7:ce.w+ce.U*7-(qe+6)%7);return"Z"in ce?(ce.H+=ce.Z/100|0,ce.M+=ce.Z%100,MA(ce)):LA(ce)}}function A(pe,me,Se,ce){for(var st=0,Ke=me.length,qe=Se.length,$e,ot;st=qe)return-1;if($e=me.charCodeAt(st++),$e===37){if($e=me.charAt(st++),ot=I[$e in Mj?me.charAt(st++):$e],!ot||(ce=ot(pe,Se,ce))<0)return-1}else if($e!=Se.charCodeAt(ce++))return-1}return ce}function P(pe,me,Se){var ce=l.exec(me.slice(Se));return ce?(pe.p=c.get(ce[0].toLowerCase()),Se+ce[0].length):-1}function V(pe,me,Se){var ce=h.exec(me.slice(Se));return ce?(pe.w=p.get(ce[0].toLowerCase()),Se+ce[0].length):-1}function M(pe,me,Se){var ce=f.exec(me.slice(Se));return ce?(pe.w=d.get(ce[0].toLowerCase()),Se+ce[0].length):-1}function H(pe,me,Se){var ce=g.exec(me.slice(Se));return ce?(pe.m=_.get(ce[0].toLowerCase()),Se+ce[0].length):-1}function J(pe,me,Se){var ce=m.exec(me.slice(Se));return ce?(pe.m=y.get(ce[0].toLowerCase()),Se+ce[0].length):-1}function Y(pe,me,Se){return A(pe,t,me,Se)}function ye(pe,me,Se){return A(pe,n,me,Se)}function he(pe,me,Se){return A(pe,r,me,Se)}function ve(pe){return o[pe.getDay()]}function te(pe){return s[pe.getDay()]}function se(pe){return u[pe.getMonth()]}function K(pe){return a[pe.getMonth()]}function x(pe){return i[+(pe.getHours()>=12)]}function C(pe){return 1+~~(pe.getMonth()/3)}function z(pe){return o[pe.getUTCDay()]}function R(pe){return s[pe.getUTCDay()]}function O(pe){return u[pe.getUTCMonth()]}function q(pe){return a[pe.getUTCMonth()]}function le(pe){return i[+(pe.getUTCHours()>=12)]}function ae(pe){return 1+~~(pe.getUTCMonth()/3)}return{format:function(pe){var me=E(pe+="",b);return me.toString=function(){return pe},me},parse:function(pe){var me=S(pe+="",!1);return me.toString=function(){return pe},me},utcFormat:function(pe){var me=E(pe+="",T);return me.toString=function(){return pe},me},utcParse:function(pe){var me=S(pe+="",!0);return me.toString=function(){return pe},me}}}var Mj={"-":"",_:" ",0:"0"},mi=/^\s*\d+/,f8e=/^%/,d8e=/[\\^$*+?|[\]().{}]/g;function vn(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",s=i.length;return r+(s[t.toLowerCase(),n]))}function p8e(e,t,n){var r=mi.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function m8e(e,t,n){var r=mi.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function g8e(e,t,n){var r=mi.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function y8e(e,t,n){var r=mi.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function _8e(e,t,n){var r=mi.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function Fj(e,t,n){var r=mi.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function Bj(e,t,n){var r=mi.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function v8e(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function b8e(e,t,n){var r=mi.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function E8e(e,t,n){var r=mi.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function jj(e,t,n){var r=mi.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function w8e(e,t,n){var r=mi.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function Uj(e,t,n){var r=mi.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function T8e(e,t,n){var r=mi.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function S8e(e,t,n){var r=mi.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function I8e(e,t,n){var r=mi.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function x8e(e,t,n){var r=mi.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function C8e(e,t,n){var r=f8e.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function A8e(e,t,n){var r=mi.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function O8e(e,t,n){var r=mi.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function Vj(e,t){return vn(e.getDate(),t,2)}function P8e(e,t){return vn(e.getHours(),t,2)}function R8e(e,t){return vn(e.getHours()%12||12,t,2)}function N8e(e,t){return vn(1+H_.count(Al(e),e),t,3)}function Eee(e,t){return vn(e.getMilliseconds(),t,3)}function k8e(e,t){return Eee(e,t)+"000"}function D8e(e,t){return vn(e.getMonth()+1,t,2)}function $8e(e,t){return vn(e.getMinutes(),t,2)}function L8e(e,t){return vn(e.getSeconds(),t,2)}function M8e(e){var t=e.getDay();return t===0?7:t}function F8e(e,t){return vn(BI.count(Al(e)-1,e),t,2)}function wee(e){var t=e.getDay();return t>=4||t===0?im(e):im.ceil(e)}function B8e(e,t){return e=wee(e),vn(im.count(Al(e),e)+(Al(e).getDay()===4),t,2)}function j8e(e){return e.getDay()}function U8e(e,t){return vn(dT.count(Al(e)-1,e),t,2)}function V8e(e,t){return vn(e.getFullYear()%100,t,2)}function z8e(e,t){return e=wee(e),vn(e.getFullYear()%100,t,2)}function H8e(e,t){return vn(e.getFullYear()%1e4,t,4)}function W8e(e,t){var n=e.getDay();return e=n>=4||n===0?im(e):im.ceil(e),vn(e.getFullYear()%1e4,t,4)}function q8e(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+vn(t/60|0,"0",2)+vn(t%60,"0",2)}function zj(e,t){return vn(e.getUTCDate(),t,2)}function Y8e(e,t){return vn(e.getUTCHours(),t,2)}function G8e(e,t){return vn(e.getUTCHours()%12||12,t,2)}function K8e(e,t){return vn(1+f$.count(Md(e),e),t,3)}function Tee(e,t){return vn(e.getUTCMilliseconds(),t,3)}function Q8e(e,t){return Tee(e,t)+"000"}function X8e(e,t){return vn(e.getUTCMonth()+1,t,2)}function J8e(e,t){return vn(e.getUTCMinutes(),t,2)}function Z8e(e,t){return vn(e.getUTCSeconds(),t,2)}function e9e(e){var t=e.getUTCDay();return t===0?7:t}function t9e(e,t){return vn(bee.count(Md(e)-1,e),t,2)}function See(e){var t=e.getUTCDay();return t>=4||t===0?sm(e):sm.ceil(e)}function n9e(e,t){return e=See(e),vn(sm.count(Md(e),e)+(Md(e).getUTCDay()===4),t,2)}function r9e(e){return e.getUTCDay()}function i9e(e,t){return vn(hT.count(Md(e)-1,e),t,2)}function s9e(e,t){return vn(e.getUTCFullYear()%100,t,2)}function o9e(e,t){return e=See(e),vn(e.getUTCFullYear()%100,t,2)}function a9e(e,t){return vn(e.getUTCFullYear()%1e4,t,4)}function u9e(e,t){var n=e.getUTCDay();return e=n>=4||n===0?sm(e):sm.ceil(e),vn(e.getUTCFullYear()%1e4,t,4)}function l9e(){return"+0000"}function Hj(){return"%"}function Wj(e){return+e}function qj(e){return Math.floor(+e/1e3)}var Sh,Iee,nd,h$;c9e({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function c9e(e){return Sh=c8e(e),Iee=Sh.format,nd=Sh.parse,h$=Sh.utcFormat,Sh.utcParse,Sh}function f9e(e){return new Date(e)}function d9e(e){return e instanceof Date?+e:+new Date(+e)}function xee(e,t,n,r,i,s,o,a,u,l){var c=vee(),f=c.invert,d=c.domain,h=l(".%L"),p=l(":%S"),m=l("%I:%M"),y=l("%I %p"),g=l("%a %d"),_=l("%b %d"),b=l("%B"),T=l("%Y");function I(E){return(u(E)=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new _Fe(t)}function Aee(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Oee(e){this._context=e}Oee.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Pee(e){return new Oee(e)}function Ree(e){return e[0]}function Nee(e){return e[1]}function H0(e,t){var n=ai(!0),r=null,i=Pee,s=null,o=Cee(a);e=typeof e=="function"?e:e===void 0?Ree:ai(e),t=typeof t=="function"?t:t===void 0?Nee:ai(t);function a(u){var l,c=(u=Aee(u)).length,f,d=!1,h;for(r==null&&(s=i(h=o())),l=0;l<=c;++l)!(l=h;--p)a.point(b[p],T[p]);a.lineEnd(),a.areaEnd()}g&&(b[d]=+e(y,d,f),T[d]=+t(y,d,f),a.point(r?+r(y,d,f):b[d],n?+n(y,d,f):T[d]))}if(_)return a=null,_+""||null}function c(){return H0().defined(i).curve(o).context(s)}return l.x=function(f){return arguments.length?(e=typeof f=="function"?f:ai(+f),r=null,l):e},l.x0=function(f){return arguments.length?(e=typeof f=="function"?f:ai(+f),l):e},l.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:ai(+f),l):r},l.y=function(f){return arguments.length?(t=typeof f=="function"?f:ai(+f),n=null,l):t},l.y0=function(f){return arguments.length?(t=typeof f=="function"?f:ai(+f),l):t},l.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:ai(+f),l):n},l.lineX0=l.lineY0=function(){return c().x(e).y(t)},l.lineY1=function(){return c().x(e).y(n)},l.lineX1=function(){return c().x(r).y(t)},l.defined=function(f){return arguments.length?(i=typeof f=="function"?f:ai(!!f),l):i},l.curve=function(f){return arguments.length?(o=f,s!=null&&(a=o(s)),l):o},l.context=function(f){return arguments.length?(f==null?s=a=null:a=o(s=f),l):s},l}function Yj(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function Dee(e){this._context=e}Dee.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Yj(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Yj(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function tp(e){return new Dee(e)}function a0(e,t,n){this.k=e,this.x=t,this.y=n}a0.prototype={constructor:a0,scale:function(e){return e===1?this:new a0(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new a0(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};a0.prototype;function h9e(){const e=new Map;return{listen(t,n){return e.has(t)||e.set(t,[]),e.get(t).push(n),()=>{e.set(t,(e.get(t)||[]).filter(r=>r!==n))}},fire(t,n){const r=e.get(t);r&&r.forEach(i=>i(n))}}}let g1;const p9e=new Uint8Array(16);function m9e(){if(!g1&&(g1=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!g1))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return g1(p9e)}const bi=[];for(let e=0;e<256;++e)bi.push((e+256).toString(16).slice(1));function g9e(e,t=0){return(bi[e[t+0]]+bi[e[t+1]]+bi[e[t+2]]+bi[e[t+3]]+"-"+bi[e[t+4]]+bi[e[t+5]]+"-"+bi[e[t+6]]+bi[e[t+7]]+"-"+bi[e[t+8]]+bi[e[t+9]]+"-"+bi[e[t+10]]+bi[e[t+11]]+bi[e[t+12]]+bi[e[t+13]]+bi[e[t+14]]+bi[e[t+15]]).toLowerCase()}const y9e=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Gj={randomUUID:y9e};function Kj(e,t,n){if(Gj.randomUUID&&!t&&!e)return Gj.randomUUID();e=e||{};const r=e.random||(e.rng||m9e)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let i=0;i<16;++i)t[n+i]=r[i];return t}return g9e(r)}let Eu=class{static get(){let t=Kj();for(;this.ids.has(t);)t=Kj();return this.ids.set(t,!0),t}};Eu.ids=new Map;function wu(e){return"parent"in e}function _9e(e){const{label:t=void 0,state:n,initialArtifact:r,initialMetadata:i}=e,s={annotation:[],bookmark:[]},o=Object.keys(i||{}).reduce((u,l)=>(u[l]=[],i&&i[l]&&u[l].push({type:l,id:Eu.get(),val:i[l],createdOn:Date.now()}),u),s),a=r?[{id:Eu.get(),createdOn:Date.now(),val:r}]:[];return{id:Eu.get(),label:t||"Root",event:"Root",children:[],level:0,createdOn:Date.now(),meta:o,artifacts:a,state:{type:"checkpoint",val:n}}}function v9e({parent:e,state:t,label:n,sideEffects:r={do:[],undo:[]},initialMetadata:i,initialArtifact:s,event:o}){const a={annotation:[],bookmark:[]},u=Object.keys(i||{}).reduce((c,f)=>(c[f]=[],i&&i[f]&&c[f].push({type:f,id:Eu.get(),val:i[f],createdOn:Date.now()}),c),a),l=s?[{id:Eu.get(),createdOn:Date.now(),val:s}]:[];return{id:Eu.get(),label:n,event:o,children:[],parent:e.id,createdOn:Date.now(),meta:u,artifacts:l,sideEffects:r,state:t,level:e.level+1}}function Ir(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r3?t.i-4:t.i:Array.isArray(e)?1:jI(e)?2:UI(e)?3:0}function $y(e,t){return nf(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function fb(e,t){return nf(e)===2?e.get(t):e[t]}function $ee(e,t,n){var r=nf(e);r===2?e.set(t,n):r===3?(e.delete(t),e.add(n)):e[t]=n}function b9e(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function jI(e){return x9e&&e instanceof Map}function UI(e){return C9e&&e instanceof Set}function Ff(e){return e.o||e.t}function p$(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=P9e(e);delete t[go];for(var n=v$(t),r=0;r1&&(e.set=e.add=e.clear=e.delete=E9e),Object.freeze(e),t&&om(e,function(n,r){return m$(r,!0)},!0)),e}function E9e(){Ir(2)}function g$(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function Tu(e){var t=F2[e];return t||Ir(18,e),t}function w9e(e,t){F2[e]||(F2[e]=t)}function Qj(){return{}.NODE_ENV==="production"||am||Ir(0),am}function FA(e,t){t&&(Tu("Patches"),e.u=[],e.s=[],e.v=t)}function pT(e){$2(e),e.p.forEach(T9e),e.p=null}function $2(e){e===am&&(am=e.l)}function Xj(e){return am={p:[],l:am,h:e,m:!0,_:0}}function T9e(e){var t=e[go];t.i===0||t.i===1?t.j():t.O=!0}function BA(e,t){t._=t.p.length;var n=t.p[0],r=e!==void 0&&e!==n;return t.h.g||Tu("ES5").S(t,e,r),r?(n[go].P&&(pT(t),Ir(4)),tf(e)&&(e=mT(t,e),t.l||gT(t,e)),t.u&&Tu("Patches").M(n[go].t,e,t.u,t.s)):e=mT(t,n,[]),pT(t),t.u&&t.v(t.u,t.s),e!==_$?e:void 0}function mT(e,t,n){if(g$(t))return t;var r=t[go];if(!r)return om(t,function(s,o){return Jj(e,r,t,s,o,n)},!0),t;if(r.A!==e)return t;if(!r.P)return gT(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var i=r.i===4||r.i===5?r.o=p$(r.k):r.o;om(r.i===3?new Set(i):i,function(s,o){return Jj(e,r,i,s,o,n)}),gT(e,i,!1),n&&e.u&&Tu("Patches").R(r,n,e.u,e.s)}return r.o}function Jj(e,t,n,r,i,s){if({}.NODE_ENV!=="production"&&i===n&&Ir(5),Fd(i)){var o=mT(e,i,s&&t&&t.i!==3&&!$y(t.D,r)?s.concat(r):void 0);if($ee(n,r,o),!Fd(o))return;e.m=!1}if(tf(i)&&!g$(i)){if(!e.h.F&&e._<1)return;mT(e,i),t&&t.A.l||gT(e,i)}}function gT(e,t,n){n===void 0&&(n=!1),e.h.F&&e.m&&m$(t,n)}function jA(e,t){var n=e[go];return(n?Ff(n):e)[t]}function Zj(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function L2(e){e.P||(e.P=!0,e.l&&L2(e.l))}function UA(e){e.o||(e.o=p$(e.t))}function M2(e,t,n){var r=jI(t)?Tu("MapSet").N(t,n):UI(t)?Tu("MapSet").T(t,n):e.g?function(i,s){var o=Array.isArray(i),a={i:o?1:0,A:s?s.A:Qj(),P:!1,I:!1,D:{},l:s,t:i,k:null,o:null,j:null,C:!1},u=a,l=B2;o&&(u=[a],l=u0);var c=Proxy.revocable(u,l),f=c.revoke,d=c.proxy;return a.k=d,a.j=f,d}(t,n):Tu("ES5").J(t,n);return(n?n.A:Qj()).p.push(r),r}function S9e(e){return Fd(e)||Ir(22,e),function t(n){if(!tf(n))return n;var r,i=n[go],s=nf(n);if(i){if(!i.P&&(i.i<4||!Tu("ES5").K(i)))return i.t;i.I=!0,r=eU(n,s),i.I=!1}else r=eU(n,s);return om(r,function(o,a){i&&fb(i.t,o)===a||$ee(r,o,t(a))}),s===3?new Set(r):r}(e)}function eU(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return p$(e)}function I9e(){function e(r){if(!tf(r))return r;if(Array.isArray(r))return r.map(e);if(jI(r))return new Map(Array.from(r.entries()).map(function(o){return[o[0],e(o[1])]}));if(UI(r))return new Set(Array.from(r).map(e));var i=Object.create(Object.getPrototypeOf(r));for(var s in r)i[s]=e(r[s]);return $y(r,W0)&&(i[W0]=r[W0]),i}function t(r){return Fd(r)?e(r):r}var n="add";w9e("Patches",{$:function(r,i){return i.forEach(function(s){for(var o=s.path,a=s.op,u=r,l=0;l1?g-1:0),b=1;b1?c-1:0),d=1;d=0;i--){var s=r[i];if(s.path.length===0&&s.op==="replace"){n=s.value;break}}i>-1&&(r=r.slice(i+1));var o=Tu("Patches").$;return Fd(n)?o(n,r):this.produce(n,function(a){return o(a,r)})},e}(),yo=new R9e,N9e=yo.produce;yo.produceWithPatches.bind(yo);yo.setAutoFreeze.bind(yo);yo.setUseProxies.bind(yo);yo.applyPatches.bind(yo);yo.createDraft.bind(yo);yo.finishDraft.bind(yo);function k9e(e,t={}){const{artifact:n=void 0,metadata:r=void 0,rootLabel:i="Root"}=t,s=_9e({state:e,label:i,initialArtifact:n,initialMetadata:r}),o={nodes:{[s.id]:s},root:s.id,current:s.id};return fJ({name:"provenance-graph",initialState:o,reducers:{addMetadata(a,u){const{id:l,meta:c}=u.payload,f=a.nodes[l].meta,d=Object.keys(c).reduce((h,p)=>(h[p]||(h[p]=[]),h[p].push({type:p,id:Eu.get(),val:c[p],createdOn:Date.now()}),h),f);a.nodes[u.payload.id].meta=d},addArtifact(a,u){a.nodes[u.payload.id].artifacts.push({id:Eu.get(),createdOn:Date.now(),val:u.payload.artifact})},changeCurrent(a,u){a.current=u.payload},addNode(a,{payload:u}){a.nodes[u.id]=u,a.nodes[u.parent].children.push(u.id),a.current=u.id},load(a,{payload:u}){return u}}})}function D9e(e){const t=new Map,{reducer:n,actions:r,getInitialState:i}=k9e(e),s=ZNe();s.startListening({matcher:z9(r.changeCurrent,r.addNode),effect:(a,u)=>{u.cancelActiveListeners(),t.forEach(l=>{const c=z9(r.addNode)(a),{skipOnNew:f}=l.config;f&&c||l.func(c?"new":"traversal")})}});const o=lJ({reducer:n,middleware:a=>a().prepend(s.middleware)});return{initialState:i(),get backend(){return o.getState()},get current(){return o.getState().nodes[o.getState().current]},get root(){return o.getState().nodes[o.getState().root]},currentChange(a,u){const l={id:Eu.get(),func:a,config:u};return t.set(l.id,l),()=>t.delete(l.id)},update:o.dispatch,...r}}/*! * https://github.com/Starcounter-Jack/JSON-Patch * (c) 2017-2022 Joachim Wester * MIT licensed - */var $9e=globalThis&&globalThis.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var s in i)i.hasOwnProperty(s)&&(r[s]=i[s])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),L9e=Object.prototype.hasOwnProperty;function j2(e,t){return L9e.call(e,t)}function U2(e){if(Array.isArray(e)){for(var t=new Array(e.length),n=0;n=48&&r<=57){t++;continue}return!1}return!0}function Bf(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function Mee(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function z2(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,n=e.length;t0&&u[c-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(n&&d===void 0&&(l[h]===void 0?d=u.slice(0,c).join("/"):c==f-1&&(d=t.path),d!==void 0&&p(t,0,e,d)),c++,Array.isArray(l)){if(h==="-")h=l.length;else{if(n&&!V2(h))throw new wr("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",s,t,e);V2(h)&&(h=~~h)}if(c>=f){if(n&&t.op==="add"&&h>l.length)throw new wr("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",s,t,e);var o=F9e[t.op].call(t,l,h,e);if(o.test===!1)throw new wr("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return o}}else if(c>=f){var o=np[t.op].call(t,l,h,e);if(o.test===!1)throw new wr("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return o}if(l=l[h],n&&c0)throw new wr('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",t,e,n);if((e.op==="move"||e.op==="copy")&&typeof e.from!="string")throw new wr("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,n);if((e.op==="add"||e.op==="replace"||e.op==="test")&&e.value===void 0)throw new wr("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,n);if((e.op==="add"||e.op==="replace"||e.op==="test")&&z2(e.value))throw new wr("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,n);if(n){if(e.op=="add"){var i=e.path.split("/").length,s=r.split("/").length;if(i!==s+1&&i!==s)throw new wr("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,n)}else if(e.op==="replace"||e.op==="remove"||e.op==="_get"){if(e.path!==r)throw new wr("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,n)}else if(e.op==="move"||e.op==="copy"){var o={op:"_get",path:e.from,value:void 0},a=Bee([o],n);if(a&&a.name==="OPERATION_PATH_UNRESOLVABLE")throw new wr("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,n)}}}else throw new wr("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,n)}function Bee(e,t,n){try{if(!Array.isArray(e))throw new wr("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)VI(Ds(t),Ds(e),n||!0);else{n=n||_T;for(var r=0;r=48&&r<=57){t++;continue}return!1}return!0}function Bf(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function Lee(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function z2(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,n=e.length;t0&&u[c-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(n&&d===void 0&&(l[h]===void 0?d=u.slice(0,c).join("/"):c==f-1&&(d=t.path),d!==void 0&&p(t,0,e,d)),c++,Array.isArray(l)){if(h==="-")h=l.length;else{if(n&&!V2(h))throw new wr("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",s,t,e);V2(h)&&(h=~~h)}if(c>=f){if(n&&t.op==="add"&&h>l.length)throw new wr("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",s,t,e);var o=F9e[t.op].call(t,l,h,e);if(o.test===!1)throw new wr("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return o}}else if(c>=f){var o=np[t.op].call(t,l,h,e);if(o.test===!1)throw new wr("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return o}if(l=l[h],n&&c0)throw new wr('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",t,e,n);if((e.op==="move"||e.op==="copy")&&typeof e.from!="string")throw new wr("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,n);if((e.op==="add"||e.op==="replace"||e.op==="test")&&e.value===void 0)throw new wr("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,n);if((e.op==="add"||e.op==="replace"||e.op==="test")&&z2(e.value))throw new wr("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,n);if(n){if(e.op=="add"){var i=e.path.split("/").length,s=r.split("/").length;if(i!==s+1&&i!==s)throw new wr("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,n)}else if(e.op==="replace"||e.op==="remove"||e.op==="_get"){if(e.path!==r)throw new wr("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,n)}else if(e.op==="move"||e.op==="copy"){var o={op:"_get",path:e.from,value:void 0},a=Fee([o],n);if(a&&a.name==="OPERATION_PATH_UNRESOLVABLE")throw new wr("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,n)}}}else throw new wr("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,n)}function Fee(e,t,n){try{if(!Array.isArray(e))throw new wr("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)VI(Ds(t),Ds(e),n||!0);else{n=n||_T;for(var r=0;r0&&(e.patches=[],e.callback&&e.callback(r)),r}function E$(e,t,n,r,i){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var s=U2(t),o=U2(e),a=!1,u=o.length-1;u>=0;u--){var l=o[u],c=e[l];if(j2(t,l)&&!(t[l]===void 0&&c!==void 0&&Array.isArray(t)===!1)){var f=t[l];typeof c=="object"&&c!=null&&typeof f=="object"&&f!=null&&Array.isArray(c)===Array.isArray(f)?E$(c,f,n,r+"/"+Bf(l),i):c!==f&&(i&&n.push({op:"test",path:r+"/"+Bf(l),value:Ds(c)}),n.push({op:"replace",path:r+"/"+Bf(l),value:Ds(f)}))}else Array.isArray(e)===Array.isArray(t)?(i&&n.push({op:"test",path:r+"/"+Bf(l),value:Ds(c)}),n.push({op:"remove",path:r+"/"+Bf(l)}),a=!0):(i&&n.push({op:"test",path:r,value:e}),n.push({op:"replace",path:r,value:t}))}if(!(!a&&s.length==o.length))for(var u=0;u(e.TRAVERSAL_START="Traversal_Start",e.TRAVERSAL_END="Traversal_End",e))(l0||{});function db(e,t){const n=e.state;if(n.type==="checkpoint")return n.val;const{checkpointRef:r}=n,i=t[r],s=Uee(i,e,t);s.shift();const o=s.map(u=>t[u]).map(u=>u.state.val).reduce((u,l)=>[...u,...l],[]),a=db(i,t);return VI(a,Ds(o),!0,!1).newDocument}function K9e(e,t){const n=Object.keys(e).length;return new Set(t.map(r=>r.path.split("/")[0])).size{n=!0}),r.listen(l0.TRAVERSAL_END,()=>{n=!1});const o={add(c,f=i.current.id){i.update(i.addMetadata({id:f,meta:c}))},latestOfType(c,f=i.current.id){var d;return(d=i.backend.nodes[f].meta[c])==null?void 0:d.at(-1)},allOfType(c,f=i.current.id){return i.backend.nodes[f].meta[c]},latest(c=i.current.id){const f=i.backend.nodes[c].meta,d=Object.keys(f).reduce((h,p)=>{const m=f[p].at(-1);return m&&(h[p]=m),h},{});return Object.keys(d).length>0?d:void 0},all(c=i.current.id){return i.backend.nodes[c].meta},types(c=i.current.id){return Object.keys(i.backend.nodes[c].meta)}},a={add(c,f=i.current.id){i.update(i.addArtifact({id:f,artifact:c}))},latest(c=i.current.id){return i.backend.nodes[c].artifacts.at(-1)},all(c=i.current.id){return i.backend.nodes[c].artifacts}},u={add(c,f=i.current.id){o.add({annotation:c},f)},latest(c=i.current.id){var f;return(f=o.latestOfType("annotation",c))==null?void 0:f.val},all(c=i.current.id){var f;return(f=o.allOfType("annotation",c))==null?void 0:f.map(d=>d.val)}},l={add(c=i.current.id){o.add({bookmark:!0},c)},remove(c=i.current.id){o.add({bookmark:!1},c)},is(c=i.current.id){var f;return!!((f=o.latestOfType("bookmark",c))!=null&&f.val)},toggle(c=i.current.id){l.is(c)?l.remove(c):l.add(c)}};return{registry:e,get isTraversing(){return n},getState(c=i.current){return db(c,i.backend.nodes)},graph:i,get current(){return i.current},get root(){return i.root},record({label:c,state:f,sideEffects:d,eventType:h,onlySideEffects:p=!1}){let m=null,y=null;const g=db(this.current,this.graph.backend.nodes);if(p)y={type:"checkpoint",val:f};else{const _=jee(g,f);if(K9e(f,_)==="checkpoint")y={type:"checkpoint",val:f};else{const b=this.current.state.type==="checkpoint"?this.current.id:this.current.state.checkpointRef;y={type:"patch",val:_,checkpointRef:b}}}if(!y)throw new Error(`Could not calculate new state. Previous state is: ${JSON.stringify(this.current.state,null,2)}`);if(m=v9e({label:c,state:y,parent:this.current,sideEffects:d,event:h}),!m)throw new Error("State Node creation failed!");i.update(i.addNode(m))},async apply(c,f){const d=e.get(f.type),h=db(this.current,this.graph.backend.nodes);if(d.config.hasSideEffects){const{do:p=f,undo:m}=d.func(f.payload);this.record({label:c,state:h,sideEffects:{do:[p],undo:[m]},eventType:d.config.eventType})}else{const p=d.func(h,f.payload);this.record({label:c,state:p,sideEffects:{do:[],undo:[]},eventType:d.config.eventType})}},async to(c){r.fire(l0.TRAVERSAL_START);const f=Uee(i.current,i.backend.nodes[c],i.backend.nodes),d=[];for(let h=0;h0?this.to(f.children[c==="oldest"?0:f.children.length-1]):Promise.resolve(console.warn("Already at latest in this branch!"))},currentChange(c,f=!1){return i.currentChange(c,{skipOnNew:f})},done(){console.log("Setup later for URL sharing.")},tree(){return Vee(i.root,i.backend.nodes)},on(c,f){r.listen(c,f)},export(){return JSON.stringify(i.backend)},exportObject(){return JSON.parse(JSON.stringify(i.backend))},import(c){const f=JSON.parse(c),d=f.current;f.current=f.root,i.update(i.load(f)),this.to(d)},importObject(c){const f=c.current;c.current=c.root,i.update(i.load(c)),this.to(f)},metadata:o,artifact:a,annotations:u,bookmarks:l}}function X9e(e,t,n){let[r,i]=[e,t];r.level>i.level&&([r,i]=[i,r]);let s=i.level-r.level;for(;wu(i)&&s!==0;)i=n[i.parent],s-=1;if(r.id===i.id)return r.id;for(;r.id!==i.id;)wu(r)&&(r=n[r.parent]),wu(i)&&(i=n[i.parent]);return r.id}function Uee(e,t,n){const r=X9e(e,t,n),i=n[r],s=[],o=[];let[a,u]=[e,t];for(;a.id!==i.id;)s.push(a),wu(a)&&(a=n[a.parent]);for(s.push(a);u.id!==i.id;)o.push(u),wu(u)&&(u=n[u.parent]);const l=o.reverse();return[...s,...l].map(c=>c.id)}function J9e(e,t){if(wu(e)&&e.parent===t.id)return!0;if(wu(t)&&t.parent===e.id)return!1;throw new Error("Incorrect use of function. Nodes are not connected to each other.")}function Vee(e,t){return{...e,children:e.children.map(n=>Vee(t[n],t)),name:`${e.label}`}}I9e();function Z9e(e){return e.length===2?N9e(e):e}class w${static create(){return new w$}constructor(){this.registry=new Map}has(t){return this.registry.has(t)}register(t,n,r){const i=n.length===2;if(n.length>2)throw new Error("Incorrect action function signature. Action function can only have two arguments at most!");if(this.has(t))throw new Error(`Already registered: ${t}`);const{label:s=t,eventType:o=t}=r||{};return this.registry.set(t,{func:Z9e(n),config:{hasSideEffects:!i,label:typeof s=="string"?()=>s:s,eventType:o}}),vu(t)}get(t){const n=this.registry.get(t);if(!n)throw new Error(`Not registered: ${t}`);return n}}var eBe="Expected a function",iU=NaN,tBe="[object Symbol]",nBe=/^\s+|\s+$/g,rBe=/^[-+]0x[0-9a-f]+$/i,iBe=/^0b[01]+$/i,sBe=/^0o[0-7]+$/i,oBe=parseInt,aBe=typeof io=="object"&&io&&io.Object===Object&&io,uBe=typeof self=="object"&&self&&self.Object===Object&&self,lBe=aBe||uBe||Function("return this")(),cBe=Object.prototype,fBe=cBe.toString,dBe=Math.max,hBe=Math.min,VA=function(){return lBe.Date.now()};function pBe(e,t,n){var r,i,s,o,a,u,l=0,c=!1,f=!1,d=!0;if(typeof e!="function")throw new TypeError(eBe);t=sU(t)||0,W2(n)&&(c=!!n.leading,f="maxWait"in n,s=f?dBe(sU(n.maxWait)||0,t):s,d="trailing"in n?!!n.trailing:d);function h(E){var S=r,A=i;return r=i=void 0,l=E,o=e.apply(A,S),o}function p(E){return l=E,a=setTimeout(g,t),c?h(E):o}function m(E){var S=E-u,A=E-l,P=t-S;return f?hBe(P,s-A):P}function y(E){var S=E-u,A=E-l;return u===void 0||S>=t||S<0||f&&A>=s}function g(){var E=VA();if(y(E))return _(E);a=setTimeout(g,m(E))}function _(E){return a=void 0,d&&r?h(E):(r=i=void 0,o)}function b(){a!==void 0&&clearTimeout(a),l=0,r=u=i=a=void 0}function T(){return a===void 0?o:_(VA())}function I(){var E=VA(),S=y(E);if(r=arguments,i=this,u=E,S){if(a===void 0)return p(u);if(f)return a=setTimeout(g,t),h(u)}return a===void 0&&(a=setTimeout(g,t)),o}return I.cancel=b,I.flush=T,I}function W2(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function mBe(e){return!!e&&typeof e=="object"}function gBe(e){return typeof e=="symbol"||mBe(e)&&fBe.call(e)==tBe}function sU(e){if(typeof e=="number")return e;if(gBe(e))return iU;if(W2(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=W2(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(nBe,"");var n=iBe.test(e);return n||sBe.test(e)?oBe(e.slice(2),n?2:8):rBe.test(e)?iU:+e}var yBe=pBe;const ja=ka(yBe);function zee({xScale:e,yRange:t,vertPosition:n,ticks:r,isDate:i=!1,showLines:s=!0}){const o=w.useMemo(()=>r.length>1?Math.abs(r[1].offset-r[0].offset):e.range()[0]-e.range()[1],[r,e]),a=w.useCallback(u=>(i?h$("%b%e, %Y"):zc(".2s"))(u),[i]);return $.jsxs($.Fragment,{children:[s?$.jsx("path",{transform:`translate(0, ${t[1]})`,d:["M",e.range()[0],0,"H",e.range()[1]].join(" "),fill:"none",stroke:"lightgray"}):null,r.map(({value:u,offset:l})=>$.jsxs("g",{transform:`translate(${l}, ${n})`,children:[$.jsx("line",{y2:"6",stroke:"currentColor"}),s?$.jsx("line",{y2:`${-(t[0]-t[1])}`,stroke:"lightgray"}):null,$.jsx("foreignObject",{x:0-o/2,y:10,width:o,height:20,children:$.jsx(Nd,{children:$.jsx(IQ,{withinPortal:!0,label:u,children:$.jsx(Tt,{px:2,size:10,style:{textAlign:"center",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},children:+u==0?0:a(i?new Date(u):u)})})})})]},u))]})}const _Be=Object.freeze(Object.defineProperty({__proto__:null,XAxis:zee},Symbol.toStringTag,{value:"Module"}));function Hee({dataset:e,yScale:t,xRange:n,horizontalPosition:r}){const i=w.useMemo(()=>t.ticks(6).map(o=>({value:o,yOffset:t(o)})),[t]),s=w.useMemo(()=>e==="clean_stocks"?zc(",.0%"):t.domain()[1]<5?zc(",.2r"):zc(",.0f"),[e,t]);return $.jsx($.Fragment,{children:i.map(({value:o,yOffset:a})=>$.jsxs("g",{transform:`translate(${r}, ${a})`,children:[$.jsx("line",{x2:`${n[1]-n[0]}`,stroke:`${o===0?"black":"gainsboro"}`,strokeWidth:o===0?1:.4}),$.jsx("text",{style:{dominantBaseline:"middle",fontSize:"10px",textAnchor:"end",transform:"translateX(-6px)",fill:"black",font:"Roboto"},children:s(o)},o)]},o))})}const vBe=Object.freeze(Object.defineProperty({__proto__:null,YAxis:Hee},Symbol.toStringTag,{value:"Module"})),Qs={top:30,left:40,right:100,bottom:50};function q2({parameters:e,data:t,items:n,selection:r,range:i,guardrail:s}){const[o,a]=w.useState(null),u=P=>r!=null&&r.includes(P)?!o||o.length===0?!0:o.includes(P):!1,l=w.useMemo(()=>{const P=n.filter(M=>r==null?void 0:r.includes(M.name)).map(M=>M.group);return n.filter(M=>P==null?void 0:P.includes(M.group)).filter(M=>!(r!=null&&r.includes(M.name))).map(M=>M.name)},[r,n]),c=w.useMemo(()=>{const P=n.map(J=>J.group),V=t.filter(J=>P==null?void 0:P.includes(J[e.group_var]));return[...B5e(V,J=>({mean:CA(J,.5,Y=>Y[e.y_var]),upperq:CA(J,.75,Y=>Y[e.y_var]),lowerq:CA(J,.25,Y=>Y[e.y_var])}),J=>J[e.x_var])].flatMap(([J,Y])=>({date:J,mean:Y.mean,upperq:Y.upperq,lowerq:Y.lowerq}))},[t,n,e]),f=800-Qs.left-Qs.right,d=400-Qs.top-Qs.bottom,{xMin:h,yMin:p,xMax:m,yMax:y}=w.useMemo(()=>{let P=[];switch(s){case"super_data":P=r==null?void 0:r.concat(l);break;default:P=r;break}const V=t.map(K=>+K[e.x_var]).filter(K=>K!==null),[M,H]=Cp(V),J=t.filter(K=>P.includes(K[e.cat_var])).map(K=>+K[e.y_var]).filter(K=>K!==null),[Y,ye]=e.dataset==="clean_stocks"?Cp(J):[0,Cp(J)[1]],[he,ve]=[sT(c.map(K=>K.lowerq)),iT(c.map(K=>K.upperq))],te=s==="super_summ"?sT([Y,he]):Y,se=s==="super_summ"?iT([ye,ve]):ye;return{xMin:M,xMax:H,yMin:te,yMax:se}},[t,r,i,s]),g=w.useMemo(()=>i?Dy([Qs.left,f+Qs.left]).domain(i):Dy([Qs.left,f+Qs.left]).domain([new Date(e.start_date),new Date(e.end_date)]),[f,m,h,i]),_=w.useMemo(()=>FI([d+Qs.top,Qs.top]).domain([p,y]).nice(),[d,y,p]),b=w.useMemo(()=>{const P=Array.from(new Set(t.map(V=>V[e.cat_var])));return a$(e$).domain(P)},[t]),T=w.useMemo(()=>{if(!g||!_)return;const P=H0();return P.x(M=>g(nd("%Y-%m-%d")(M[e.x_var]))),P.y(M=>_(M[e.y_var])),P.curve(tp),r==null?void 0:r.map(M=>({country:M,path:P(t.filter(H=>H[e.cat_var]===M))}))},[t,g,_,r,m,s]),I=w.useMemo(()=>{if(s!=="super_data")return null;const P=H0();return P.x(M=>g(nd("%Y-%m-%d")(M[e.x_var]))),P.y(M=>_(M[e.y_var])),P.curve(tp),l==null?void 0:l.map(M=>({country:M,path:P(t.filter(H=>H[e.cat_var]===M))}))},[t,g,_,r,m,s]),E=w.useMemo(()=>{if(s!=="super_summ")return null;const P=H0();P.x(J=>g(nd("%Y-%m-%d")(J.date))),P.y(J=>_(J.mean)),P.curve(tp);const V=P(c),M=Dee();M.x(J=>g(nd("%Y-%m-%d")(J.date))),M.y0(J=>_(J.lowerq)),M.y1(J=>_(J.upperq)),M.curve(tp);const H=M(c);return{meanLine:V,confidenceBands:H,data:c}},[t,g,_,r,m,s]),S=w.useMemo(()=>e.dataset==="clean_stocks"?"Market Index":"Average",[e]),A=w.useMemo(()=>{let V=null;switch(s){case"super_data":V=r==null?void 0:r.concat(I==null?void 0:I.map(H=>H.country));break;case"super_summ":V=r==null?void 0:r.concat([S]);break;default:V=r;break}const M=V==null?void 0:V.map(H=>({country:H,label_pos:H===S?E==null?void 0:E.data.slice(-1).map(J=>_(J.mean))[0]:t.filter(J=>J[e.cat_var]===H).slice(-1).map(J=>_(J[e.y_var]))[0]})).sort((H,J)=>H.label_pos=10||(M[H].label_pos=M[H].label_pos-10+J)}return M},[t,r,_,s]);return(r==null?void 0:r.length)===0?$.jsx(Nd,{style:{width:"800px",height:"400px"},children:$.jsx(Tt,{fs:"italic",c:"dimmed",children:"Select an item to view the chart."})}):$.jsxs("svg",{id:"baseLineChart",style:{height:"400px",width:"800px",fontFamily:'"Helvetica Neue", "Helvetica", "Arial", sans-serif'},children:[$.jsxs("g",{id:"axes",children:[$.jsx(zee,{isDate:!0,xScale:g,yRange:_.range(),vertPosition:d+Qs.top,showLines:!1,ticks:g.ticks(6).map(P=>({value:P.toString(),offset:g(P)}))}),$.jsx(Hee,{dataset:e.dataset,yScale:_,horizontalPosition:Qs.left,xRange:g.range()})]}),$.jsx("svg",{style:{width:`${f}`},children:I==null?void 0:I.map(P=>$.jsx("g",{children:$.jsx("path",{id:`${P.country}`,fill:"none",stroke:u(P.country)?b(P.country):"gray",strokeDasharray:"4,1",strokeWidth:.5,d:P.path},`${P.country}_key`)},`${P.country}_g`))},"control_lines"),$.jsx("svg",{style:{width:`${f}`},children:E?$.jsxs("g",{children:[$.jsx("path",{id:"confidenceBands",fill:"lightgray",opacity:.25,stroke:"none",d:E.confidenceBands},"confidenceBands_key"),$.jsx("path",{id:"meanLine",fill:"none",stroke:"gray",strokeDasharray:"4,1",strokeWidth:.5,d:E.meanLine},"meanLine_key")]},"summary_g"):null},"control_bands"),$.jsxs("svg",{style:{width:`${f}`},children:[T==null?void 0:T.map(P=>$.jsx("g",{children:$.jsx("path",{id:`${P.country}`,fill:"none",stroke:u(P.country)?b(P.country):"gainsboro",strokeWidth:o!=null&&o.includes(P.country)?2:1.5,d:P.path},`${P.country}_key`)},`${P.country}_g`)),A==null?void 0:A.map(P=>$.jsx("foreignObject",{x:f+Qs.left+5,y:P.label_pos-7,width:100,height:20,children:$.jsx(Tt,{px:2,size:10,color:u(P.country)?b(P.country):"silver",onMouseOver:V=>{const M=V.target;r!=null&&r.includes(M.innerText)&&a([M.innerText])},onMouseOut:()=>a([]),children:P.country.includes("Policy")?P.country.split("(Policy")[0]:P.country})},`${P.country}_label`))]},"lines")]})}const bBe=Object.freeze(Object.defineProperty({__proto__:null,LineChart:q2,default:q2},Symbol.toStringTag,{value:"Module"})),Ih={top:0,left:0,right:0,bottom:0},oU=20,zA=60;function Y2({parameters:e,data:t,items:n,selection:r,setSelection:i,trackSelection:s,range:o,guardrail:a}){const u=w.useMemo(()=>o?Dy([Ih.left,zA+Ih.left]).domain(o):Dy([Ih.left,zA+Ih.left]).domain([new Date(e.start_date),new Date(e.end_date)]),[e,o]),l=w.useMemo(()=>{const d=t.filter(m=>n==null?void 0:n.map(y=>y.name).includes(m[e.cat_var])).map(m=>+m[e.y_var]).filter(m=>m!==null),[h,p]=Cp(d);return FI([oU+Ih.top,Ih.top]).domain([h,p]).nice()},[e,t,n]),c=w.useMemo(()=>{const d=Array.from(new Set(t.map(h=>h[e.cat_var])));return a$(e$).domain(d)},[e,t]),f=w.useMemo(()=>{if(a!=="juxt_data")return null;const d=Dee();d.x(m=>u(nd("%Y-%m-%d")(m[e.x_var]))),d.y0(()=>l(0)),d.y1(m=>l(m[e.y_var])),d.curve(tp);const h=H0();return h.x(m=>u(nd("%Y-%m-%d")(m[e.x_var]))),h.y(m=>l(m[e.y_var])),h.curve(tp),n==null?void 0:n.map(m=>({country:m.name,path:h(t.filter(y=>y[e.cat_var]===m.name)),area:d(t.filter(y=>y[e.cat_var]===m.name))}))},[e,a,t,n,u,l]);return $.jsx(Qp.Group,{orientation:"vertical",onChange:d=>{i(d),s(d)},spacing:0,offset:"sm",children:n==null?void 0:n.map(d=>$.jsxs($.Fragment,{children:[d.name==="Eldoril North"?$.jsx(gd,{size:"xs",label:"Policy A",labelPosition:"left",color:"black"}):null,d.name==="Eldoril West"?$.jsx(gd,{size:"xs",label:"Policy B",labelPosition:"left",color:"black"}):null,d.name==="Silvoria North"?$.jsx(gd,{size:"xs",label:"Policy C",labelPosition:"left",color:"black"}):null,$.jsxs(il,{grow:!0,gutter:8,columns:2,children:[$.jsx(il.Col,{span:1,children:$.jsx(Qp,{value:d.name,label:d.name.includes("Policy")?d.name.split("(Policy")[0]:d.name,styles:a==="juxt_data"?{root:{display:"flex",alignItems:"flex-end",padding:"2px 0"}}:{},children:d.name},`${d.name}_checkbox`)},`${d.name}_grid1`),$.jsx(il.Col,{span:a==="juxt_data"?"auto":3,children:$.jsxs("svg",{style:{width:`${zA}`,height:`${oU}`},children:[$.jsx("path",{id:`${d.name}_sparkarea`,fill:r!=null&&r.includes(d.name)?c(d.name):"gray",stroke:"none",opacity:.25,d:f==null?void 0:f.filter(h=>h.country===d.name)[0].area},`${d.name}_sparkarea`),$.jsx("path",{id:`${d.name}_spark`,fill:"none",stroke:r!=null&&r.includes(d.name)?c(d.name):"gray",strokeWidth:.75,d:f==null?void 0:f.filter(h=>h.country===d.name)[0].path},`${d.name}_spark`)]},`${d.name}_sparksvg`)},`${d.name}_grid2`)]},`${d.name}_grid`)]}))})}const EBe=Object.freeze(Object.defineProperty({__proto__:null,Sidebar:Y2,default:Y2},Symbol.toStringTag,{value:"Module"}));function G2({parameters:e,setRange:t,trackRange:n}){function r(s){return Dy([0,100]).domain([new Date(e.start_date),new Date(e.end_date)]).invert(s)}function i(s){const o=r(s);return h$("%b %e, %Y")(o)}return $.jsx(JQ,{defaultValue:[0,100],label:s=>i(s),labelAlwaysOn:!0,disabled:!e.allow_time_slider,onChange:([s,o])=>{t([r(s),r(o)]),n([r(s),r(o)])}})}const wBe=Object.freeze(Object.defineProperty({__proto__:null,RangeSelector:G2,default:G2},Symbol.toStringTag,{value:"Module"}));function K2({guardrail:e,setGuardrail:t}){return $.jsxs($.Fragment,{children:[$.jsx(Tt,{children:"Guardrail:"}),$.jsx(FQ,{value:e,onChange:t,data:[{value:"none",label:"none"},{value:"super_data",label:"super_data"},{value:"super_summ",label:"super_summ"},{value:"juxt_data",label:"juxt_data"},{value:"juxt_summ",label:"juxt_summ"}]})]})}const TBe=Object.freeze(Object.defineProperty({__proto__:null,Selector:K2,default:K2},Symbol.toStringTag,{value:"Module"})),yn=Array.isArray;function Vs(e){return e!=null?yn(e)?e:[e]:[]}function SBe(e=0,t=1/0){return`${aU(e)} < row_number() && row_number() <= ${aU(t)}`}function aU(e){return e<0?`count() + ${e}`:e}class Wee{constructor(t){t&&(this._params=t)}params(t){return arguments.length?(t&&(this._params={...this._params,...t}),this):this._params}reify(t){return this.__reify(this,t)}count(t){return this.__count(this,t)}derive(t,n){return this.__derive(this,t,n)}filter(t){return this.__filter(this,t)}slice(t,n){return this.filter(SBe(t,n)).reify()}groupby(...t){return this.__groupby(this,t.flat())}orderby(...t){return this.__orderby(this,t.flat())}relocate(t,n){return this.__relocate(this,Vs(t),n)}rename(...t){return this.__rename(this,t.flat())}rollup(t){return this.__rollup(this,t)}sample(t,n){return this.__sample(this,t,n)}select(...t){return this.__select(this,t.flat())}ungroup(){return this.__ungroup(this)}unorder(){return this.__unorder(this)}dedupe(...t){return this.__dedupe(this,t.flat())}impute(t,n){return this.__impute(this,t,n)}fold(t,n){return this.__fold(this,t,n)}pivot(t,n,r){return this.__pivot(this,t,n,r)}spread(t,n){return this.__spread(this,t,n)}unroll(t,n){return this.__unroll(this,t,n)}lookup(t,n,...r){return this.__lookup(this,t,n,r.flat())}join(t,n,r,i){return this.__join(this,t,n,r,i)}join_left(t,n,r,i){const s={...i,left:!0,right:!1};return this.__join(this,t,n,r,s)}join_right(t,n,r,i){const s={...i,left:!1,right:!0};return this.__join(this,t,n,r,s)}join_full(t,n,r,i){const s={...i,left:!0,right:!0};return this.__join(this,t,n,r,s)}cross(t,n,r){return this.__cross(this,t,n,r)}semijoin(t,n){return this.__semijoin(this,t,n)}antijoin(t,n){return this.__antijoin(this,t,n)}concat(...t){return this.__concat(this,t.flat())}union(...t){return this.__union(this,t.flat())}intersect(...t){return this.__intersect(this,t.flat())}except(...t){return this.__except(this,t.flat())}}function jt(e){throw Error(e)}function cs(e){return typeof e=="number"}function er(e){return typeof e=="function"}function zI(e,t){const n=Array(e);if(er(t))for(let r=0;r=0;a=s.next(a+1))r[++o]=a;else for(let a=0;aa(l,c,u))}return(t||!i)&&(this._index=r),r}partitions(t=!0){if(this._partitions)return this._partitions;if(!this.isGrouped())return[this.indices(t)];const{keys:n,size:r}=this._group,i=zI(r,()=>[]),s=this._index,o=this.mask(),a=this.numRows();if(s&&this.isOrdered())for(let u=0,l;u=0;u=o.next(u+1))i[n[u]].push(u);else for(let u=0;uu(f,d,l))}return(t||!this.isOrdered())&&(this._partitions=i),i}scan(t,n,r=1/0,i=0){const s=this._mask,o=this._nrows,a=this._data;let u=i||0;if(u>o)return;const l=Math.min(o,u+r),c=()=>u=this._total;if(n&&this.isOrdered()||s&&this._index){const f=this.indices(),d=this._data;for(;u-1;u=s.next(u+1))t(u,a,c)}else for(;ur.push(s),!0,n-t,t),this.reify(r)}reduce(t){return this.__reduce(this,t)}},xBe=class{constructor(t){this.data=t}get length(){return this.data.length}get(t){return this.data[t]}[Symbol.iterator](){return this.data[Symbol.iterator]()}},CBe=function(e){return e&&er(e.get)?e:new xBe(e)};function Ol(e){return e instanceof Date}function Xi(e){return e===Object(e)}function vT(e){return e instanceof RegExp}function Li(e){return typeof e=="string"}function ABe(e,t){const n=r=>jt(`Illegal argument type: ${r||typeof e}`);return e instanceof Map?uU(e.entries(),t):Ol(e)?n("Date"):vT(e)?n("RegExp"):Li(e)?n():yn(e)?OBe(e,t):er(e[Symbol.iterator])?PBe(e,t):Xi(e)?uU(Object.entries(e),t):n()}function uU(e,t=["key","value"]){const n=[],r=[];for(const[s,o]of e)n.push(s),r.push(o);const i={};return t[0]&&(i[t[0]]=n),t[1]&&(i[t[1]]=r),i}function OBe(e,t){const n=e.length,r={},i=s=>r[s]=Array(n);if(n){t=t||Object.keys(e[0]);const s=t.map(i),o=s.length;for(let a=0;an[o]=[];let i,s;for(const o of e){i||(t=t||Object.keys(o),i=t.map(r),s=i.length);for(let a=0;ard(e)||Li(e),kBe={compact:e=>rd(e)?e.filter(t=>Ea(t)):e,concat:(...e)=>[].concat(...e),includes:(e,t,n)=>Vg(e)?e.includes(t,n):!1,indexof:(e,t)=>Vg(e)?e.indexOf(t):-1,join:(e,t)=>rd(e)?e.join(t):dn,lastindexof:(e,t)=>Vg(e)?e.lastIndexOf(t):-1,length:e=>Vg(e)?e.length:0,pluck:(e,t)=>rd(e)?e.map(n=>Ea(n)?n[t]:dn):dn,reverse:e=>rd(e)?e.slice().reverse():Li(e)?e.split("").reverse().join(""):dn,slice:(e,t,n)=>Vg(e)?e.slice(t,n):dn};function DBe(e,t,n,r,i){return e==null?null:en?1/0:(e=Math.max(t,Math.min(e,n)),t+r*Math.floor(1e-14+(e-t)/r+(i||0)))}function hb(e,t,n="0"){const r=e+"",i=r.length;return i(e<10?"0":"")+e,$Be=e=>e<0?"-"+hb(-e,6):e>9999?"+"+hb(e,6):hb(e,4);function qee(e,t,n,r,i,s,o,a,u){const l=a?"Z":"";return $Be(e)+"-"+Fa(t+1)+"-"+Fa(n)+(!u||o?"T"+Fa(r)+":"+Fa(i)+":"+Fa(s)+"."+hb(o,3)+l:s?"T"+Fa(r)+":"+Fa(i)+":"+Fa(s)+l:i||r||!a?"T"+Fa(r)+":"+Fa(i)+l:"")}function Yee(e,t){return isNaN(e)?"Invalid Date":qee(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds(),!1,t)}function HI(e,t){return isNaN(e)?"Invalid Date":qee(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds(),!0,t)}const LBe=/^([-+]\d{2})?\d{4}(-\d{2}(-\d{2})?)?(T\d{2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|[-+]\d{2}:\d{2})?)?$/;function MBe(e){return e.match(LBe)}function FBe(e,t=Date.parse){return MBe(e)?t(e):e}const Gee=6e4,Kee=864e5,Qee=6048e5,Sr=new Date,xr=new Date,Rr=e=>(Sr.setTime(typeof e=="string"?FBe(e):e),Sr);function BBe(e,t,n,r,i,s,o){return arguments.length?new Date(e,t||0,n??1,r||0,i||0,s||0,o||0):new Date(Date.now())}function jBe(e,t,n,r,i,s,o){return arguments.length?new Date(Date.UTC(e,t||0,n??1,r||0,i||0,s||0,o||0)):new Date(Date.now())}function UBe(e){xr.setTime(+e),xr.setHours(0,0,0,0),Sr.setTime(+xr),Sr.setMonth(0),Sr.setDate(1);const t=(xr.getTimezoneOffset()-Sr.getTimezoneOffset())*Gee;return Math.floor(1+(xr-Sr-t)/Kee)}function VBe(e){xr.setTime(+e),xr.setUTCHours(0,0,0,0);const t=Date.UTC(xr.getUTCFullYear(),0,1);return Math.floor(1+(xr-t)/Kee)}function zBe(e,t){const n=t||0;xr.setTime(+e),xr.setDate(xr.getDate()-(xr.getDay()+7-n)%7),xr.setHours(0,0,0,0),Sr.setTime(+e),Sr.setMonth(0),Sr.setDate(1),Sr.setDate(1-(Sr.getDay()+7-n)%7),Sr.setHours(0,0,0,0);const r=(xr.getTimezoneOffset()-Sr.getTimezoneOffset())*Gee;return Math.floor((1+(xr-Sr)-r)/Qee)}function HBe(e,t){const n=t||0;return xr.setTime(+e),xr.setUTCDate(xr.getUTCDate()-(xr.getUTCDay()+7-n)%7),xr.setUTCHours(0,0,0,0),Sr.setTime(+e),Sr.setUTCMonth(0),Sr.setUTCDate(1),Sr.setUTCDate(1-(Sr.getUTCDay()+7-n)%7),Sr.setUTCHours(0,0,0,0),Math.floor((1+(xr-Sr))/Qee)}const WBe={format_date:(e,t)=>Yee(Rr(e),!t),format_utcdate:(e,t)=>HI(Rr(e),!t),timestamp:e=>+Rr(e),year:e=>Rr(e).getFullYear(),quarter:e=>Math.floor(Rr(e).getMonth()/3),month:e=>Rr(e).getMonth(),date:e=>Rr(e).getDate(),dayofweek:e=>Rr(e).getDay(),hours:e=>Rr(e).getHours(),minutes:e=>Rr(e).getMinutes(),seconds:e=>Rr(e).getSeconds(),milliseconds:e=>Rr(e).getMilliseconds(),utcyear:e=>Rr(e).getUTCFullYear(),utcquarter:e=>Math.floor(Rr(e).getUTCMonth()/3),utcmonth:e=>Rr(e).getUTCMonth(),utcdate:e=>Rr(e).getUTCDate(),utcdayofweek:e=>Rr(e).getUTCDay(),utchours:e=>Rr(e).getUTCHours(),utcminutes:e=>Rr(e).getUTCMinutes(),utcseconds:e=>Rr(e).getUTCSeconds(),utcmilliseconds:e=>Rr(e).getUTCMilliseconds(),datetime:BBe,dayofyear:UBe,week:zBe,utcdatetime:jBe,utcdayofyear:VBe,utcweek:HBe,now:Date.now};function T$(e,t){return e==null||t==null||e!==e||t!==t?!1:e===t?!0:Ol(e)||Ol(t)?+e==+t:vT(e)&&vT(t)?e+""==t+"":Xi(e)&&Xi(t)?qBe(e,t):!1}function qBe(e,t){if(Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;if(e.length||t.length)return cU(e,t);const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length||(n.sort(),r.sort(),!cU(n,r,(s,o)=>s===o)))return!1;const i=n.length;for(let s=0;sJSON.parse(e),to_json:e=>JSON.stringify(e)};let GBe=Math.random;function Ym(){return GBe()}const KBe={random:Ym,is_nan:Number.isNaN,is_finite:Number.isFinite,abs:Math.abs,cbrt:Math.cbrt,ceil:Math.ceil,clz32:Math.clz32,exp:Math.exp,expm1:Math.expm1,floor:Math.floor,fround:Math.fround,greatest:Math.max,least:Math.min,log:Math.log,log10:Math.log10,log1p:Math.log1p,log2:Math.log2,pow:Math.pow,round:Math.round,sign:Math.sign,sqrt:Math.sqrt,trunc:Math.trunc,degrees:e=>180*e/Math.PI,radians:e=>Math.PI*e/180,acos:Math.acos,acosh:Math.acosh,asin:Math.asin,asinh:Math.asinh,atan:Math.atan,atan2:Math.atan2,atanh:Math.atanh,cos:Math.cos,cosh:Math.cosh,sin:Math.sin,sinh:Math.sinh,tan:Math.tan,tanh:Math.tanh};function S$(e){return e instanceof Map}function QBe(e){return e instanceof Set}function pb(e){return S$(e)||QBe(e)}function HA(e){return Array.from(e)}const XBe={has:(e,t)=>pb(e)?e.has(t):e!=null?Pa(e,t):!1,keys:e=>S$(e)?HA(e.keys()):e!=null?Object.keys(e):[],values:e=>pb(e)?HA(e.values()):e!=null?Object.values(e):[],entries:e=>pb(e)?HA(e.entries()):e!=null?Object.entries(e):[],object:e=>e?Object.fromEntries(e):dn};function JBe(e,t,n){if(t instanceof Map){if(t.has(e))return t.get(e)}else if(Pa(t,e))return t[e];return n!==void 0?n:e}function ZBe(e,t,n){let r=arguments.length;e=+e,t=+t,n=r<2?(t=e,e=0,1):r<3?1:+n,r=Math.max(0,Math.ceil((t-e)/n))|0;const i=new Array(r);for(let s=0;se==null?e:new Date(e),parse_float:e=>e==null?e:Number.parseFloat(e),parse_int:(e,t)=>e==null?e:Number.parseInt(e,t),endswith:(e,t,n)=>e==null?!1:String(e).endsWith(t,n),match:(e,t,n)=>{const r=e==null?e:String(e).match(t);return n==null||r==null?r:typeof n=="number"?r[n]:r.groups?r.groups[n]:null},normalize:(e,t)=>e==null?e:String(e).normalize(t),padend:(e,t,n)=>e==null?e:String(e).padEnd(t,n),padstart:(e,t,n)=>e==null?e:String(e).padStart(t,n),upper:e=>e==null?e:String(e).toUpperCase(),lower:e=>e==null?e:String(e).toLowerCase(),repeat:(e,t)=>e==null?e:String(e).repeat(t),replace:(e,t,n)=>e==null?e:String(e).replace(t,String(n)),substring:(e,t,n)=>e==null?e:String(e).substring(t,n),split:(e,t,n)=>e==null?[]:String(e).split(t,n),startswith:(e,t,n)=>e==null?!1:String(e).startsWith(t,n),trim:e=>e==null?e:String(e).trim()},rp={bin:DBe,equal:T$,recode:JBe,sequence:ZBe,...kBe,...WBe,...YBe,...KBe,...XBe,...eje};function My(e){return typeof e=="bigint"}function Ou(e){return e===void 0?e+"":My(e)?e+"n":JSON.stringify(e)}function Mt(e,t=[],n=[]){return new tje(e,Vs(t),Vs(n))}let tje=class{constructor(t,n,r){this.name=t,this.fields=n,this.params=r}toString(){const t=[...this.fields.map(n=>`d[${Ou(n)}]`),...this.params.map(Ou)];return`d => op.${this.name}(${t})`}toObject(){return{expr:this.toString(),func:!0}}};const Xee=e=>Mt("any",e),Jee=()=>Mt("count"),Zee=e=>Mt("array_agg",e),ete=e=>Mt("array_agg_distinct",e),tte=(e,t)=>Mt("map_agg",[e,t]),nte=(e,t)=>Mt("object_agg",[e,t]),rte=(e,t)=>Mt("entries_agg",[e,t]);({...rp});function nje(e,t){e=pb(e)?e:new Set(e);let n=t,r=0;for(;e.has(n);)n=t+ ++r;return n}function rje(e,t){if(!e||!t)return e;const{keys:n,rows:r,size:i}=e,s=new Int32Array(i);t.scan(c=>s[n[c]]=1);const o=s.reduce((c,f)=>c+f,0);if(o===i)return e;const a=Array(o);let u=0;for(let c=0;cl[c]=s[n[c]]),{...e,keys:l,rows:a,size:u}}function ije(e,t,n,r){const{keys:i,rows:s,size:o}=e;let a=s,u=o,l=null;if(n){l=new Int32Array(o),t(p=>l[i[p]]=1);const h=l.reduce((p,m)=>p+m,0);if(h!==o){a=Array(h),u=0;for(let p=0;pf[++c]=l[i[h]]:h=>f[++c]=i[h]),{...e,keys:f,rows:a,size:u}}function sje(e,t,n,r){const i=r==="map"||r===!0?tte:r==="entries"?rte:r==="object"?nte:jt('groups option must be "map", "entries", or "object".'),{names:s}=e.groups(),o=nje(e.columnNames(),"_");let a=e.select().reify(t).create({data:{[o]:n}}).rollup({[o]:Zee(o)});for(let u=s.length;--u>=0;)a=a.groupby(s.slice(0,u)).rollup({[o]:i(s[u],o)});return a.get(o)}const oje="ArrayPattern",aje="ArrowFunctionExpression",uje="FunctionExpression",Hc="Identifier",Gm="Literal",ite="MemberExpression",lje="ObjectExpression",ste="ObjectPattern",ote="Property",q_="Column",cje="Constant",fje="Dictionary",dje="Function",hje="Parameter",ate="Op",Wn=(e,t)=>{const n=pje[e.type];return n?n(e,t):jt(`Unsupported expression construct: ${e.type}`)},WA=(e,t)=>"("+Wn(e.left,t)+" "+e.operator+" "+Wn(e.right,t)+")",qA=(e,t)=>"("+Wa(e.params,t)+")=>"+Wn(e.body,t),fU=(e,t)=>Wn(e.callee,t)+"("+Wa(e.arguments,t)+")",Wa=(e,t,n=",")=>e.map(r=>Wn(r,t)).join(n),ute=e=>e.computed?`[${Ou(e.name)}]`:`.${e.name}`,dU=(e,t,n)=>{const r=e.table||"";return`data${r}${ute(e)}.${n}(${t.index}${r})`},pje={Constant:e=>e.raw,Column:(e,t)=>dU(e,t,"get"),Dictionary:(e,t)=>dU(e,t,"key"),Function:e=>`fn.${e.name}`,Parameter:e=>`$${ute(e)}`,Op:(e,t)=>`op(${Ou(e.name)},${t.op||t.index})`,Literal:e=>e.raw,Identifier:e=>e.name,TemplateLiteral:(e,t)=>{const{quasis:n,expressions:r}=e,i=r.length;let s=n[0].value.raw;for(let o=0;o{const n=!e.computed,r=Wn(e.object,t),i=Wn(e.property,t);return r+(n?"."+i:"["+i+"]")},CallExpression:fU,NewExpression:(e,t)=>"new "+fU(e,t),ArrayExpression:(e,t)=>"["+Wa(e.elements,t)+"]",AssignmentExpression:WA,BinaryExpression:WA,LogicalExpression:WA,UnaryExpression:(e,t)=>"("+e.operator+Wn(e.argument,t)+")",ConditionalExpression:(e,t)=>"("+Wn(e.test,t)+"?"+Wn(e.consequent,t)+":"+Wn(e.alternate,t)+")",ObjectExpression:(e,t)=>"({"+Wa(e.properties,t)+"})",Property:(e,t)=>{const n=Wn(e.key,t);return(e.computed?`[${n}]`:n)+":"+Wn(e.value,t)},ArrowFunctionExpression:qA,FunctionExpression:qA,FunctionDeclaration:qA,ArrayPattern:(e,t)=>"["+Wa(e.elements,t)+"]",ObjectPattern:(e,t)=>"{"+Wa(e.properties,t)+"}",VariableDeclaration:(e,t)=>e.kind+" "+Wa(e.declarations,t,","),VariableDeclarator:(e,t)=>Wn(e.id,t)+"="+Wn(e.init,t),SpreadElement:(e,t)=>"..."+Wn(e.argument,t),BlockStatement:(e,t)=>"{"+Wa(e.body,t,";")+";}",BreakStatement:()=>"break",ExpressionStatement:(e,t)=>Wn(e.expression,t),IfStatement:(e,t)=>"if ("+Wn(e.test,t)+")"+Wn(e.consequent,t)+(e.alternate?" else "+Wn(e.alternate,t):""),SwitchStatement:(e,t)=>"switch ("+Wn(e.discriminant,t)+") {"+Wa(e.cases,t,"")+"}",SwitchCase:(e,t)=>(e.test?"case "+Wn(e.test,t):"default")+": "+Wa(e.consequent,t,";")+";",ReturnStatement:(e,t)=>"return "+Wn(e.argument,t),Program:(e,t)=>Wn(e.body[0],t)};function bT(e,t={index:"row"}){return Wn(e,t)}function mje(e,t,n=15,r=!0,i=0,s){const a=Math.LN10;if(s==null){const u=Math.ceil(Math.log(n)/a),l=t-e||Math.abs(e)||1,c=[5,2];for(s=Math.max(i,Math.pow(10,Math.round(Math.log(l)/a)-u));Math.ceil(l/s)>n;)s*=10;const f=c.length;for(let d=0;d=i&&l/h<=n&&(s=h)}}if(r){let u=Math.log(s);const l=u>=0?0:~~(-u/a)+1,c=Math.pow(10,-l-1);u=Math.floor(e/s+c)*s,e=e0&&(t+=","),t+=`"${r}":${um(e[r])}`;return t+="}",t}function ET(e,t){const n=e.length;return n===1?(r,i)=>um(e[0](r,i)):(r,i)=>{let s="";for(let o=0;o0&&(s+="|");const a=e[o](r,i);if(t&&(a==null||a!==a))return null;s+=um(a)}return s}}function yje(){const e=new Map;return{count(){return e.size},values(){return Array.from(e.values(),t=>t.v)},increment(t){const n=um(t),r=e.get(n);r?++r.n:e.set(n,{v:t,n:1})},decrement(t){const n=um(t),r=e.get(n);r.n===1?e.delete(n):--r.n},forEach(t){e.forEach(({v:n,n:r})=>t(n,r))}}}function Qu(){}function _je(e,t=0,n=e.length){let r=e[t++];for(let i=t;iqr({value:e=>e.count}),param:[]},array_agg:{create:()=>qr({init:e=>e.values=!0,value:e=>e.list.values(e.stream)}),param:[1]},object_agg:{create:()=>qr({init:e=>e.values=!0,value:e=>Object.fromEntries(e.list.values())}),param:[2]},map_agg:{create:()=>qr({init:e=>e.values=!0,value:e=>new Map(e.list.values())}),param:[2]},entries_agg:{create:()=>qr({init:e=>e.values=!0,value:e=>e.list.values(e.stream)}),param:[2]},any:{create:()=>qr({add:(e,t)=>{e.any==null&&(e.any=t)},value:e=>e.valid?e.any:dn}),param:[1]},valid:{create:()=>qr({value:e=>e.valid}),param:[1]},invalid:{create:()=>qr({value:e=>e.count-e.valid}),param:[1]},distinct:{create:()=>({init:e=>e.distinct=yje(),value:e=>e.distinct.count()+(e.valid===e.count?0:1),add:(e,t)=>e.distinct.increment(t),rem:(e,t)=>e.distinct.decrement(t)}),param:[1]},array_agg_distinct:{create:()=>qr({value:e=>e.distinct.values()}),param:[1],req:["distinct"]},mode:{create:()=>qr({value:e=>{let t=dn,n=0;return e.distinct.forEach((r,i)=>{i>n&&(n=i,t=r)}),t}}),param:[1],req:["distinct"]},sum:{create:()=>({init:e=>e.sum=0,value:e=>e.valid?e.sum:dn,add:(e,t)=>My(t)?e.sum===0?e.sum=t:e.sum+=t:e.sum+=+t,rem:(e,t)=>e.sum-=t}),param:[1]},product:{create:()=>({init:e=>hU(e,1),value:e=>e.valid?e.product_v?hU(e,_je(e.list.values())):e.product:void 0,add:(e,t)=>My(t)&&e.product===1?e.product=t:e.product*=t,rem:(e,t)=>t==0||t===1/0||t===-1/0?e.product_v=!0:e.product/=t}),param:[1],stream:["array_agg"]},mean:{create:()=>({init:e=>e.mean=0,value:e=>e.valid?e.mean:dn,add:(e,t)=>{e.mean_d=t-e.mean,e.mean+=e.mean_d/e.valid},rem:(e,t)=>{e.mean_d=t-e.mean,e.mean-=e.valid?e.mean_d/e.valid:e.mean}}),param:[1]},average:{create:()=>qr({value:e=>e.valid?e.mean:dn}),param:[1],req:["mean"]},variance:{create:()=>({init:e=>e.dev=0,value:e=>e.valid>1?e.dev/(e.valid-1):dn,add:(e,t)=>e.dev+=e.mean_d*(t-e.mean),rem:(e,t)=>e.dev-=e.mean_d*(t-e.mean)}),param:[1],req:["mean"]},variancep:{create:()=>qr({value:e=>e.valid>1?e.dev/e.valid:dn}),param:[1],req:["variance"]},stdev:{create:()=>qr({value:e=>e.valid>1?Math.sqrt(e.dev/(e.valid-1)):dn}),param:[1],req:["variance"]},stdevp:{create:()=>qr({value:e=>e.valid>1?Math.sqrt(e.dev/e.valid):dn}),param:[1],req:["variance"]},min:{create:()=>({init:e=>e.min=dn,value:e=>e.min=Number.isNaN(e.min)?e.list.min():e.min,add:(e,t)=>{(t{t<=e.min&&(e.min=NaN)}}),param:[1],stream:["array_agg"]},max:{create:()=>({init:e=>e.max=dn,value:e=>e.max=Number.isNaN(e.max)?e.list.max():e.max,add:(e,t)=>{(t>e.max||e.max===dn)&&(e.max=t)},rem:(e,t)=>{t>=e.max&&(e.max=NaN)}}),param:[1],stream:["array_agg"]},quantile:{create:e=>qr({value:t=>t.list.quantile(e)}),param:[1,1],req:["array_agg"]},median:{create:()=>qr({value:e=>e.list.quantile(.5)}),param:[1],req:["array_agg"]},covariance:{create:()=>({init:e=>{e.cov=e.mean_x=e.mean_y=e.dev_x=e.dev_y=0},value:e=>e.valid>1?e.cov/(e.valid-1):dn,add:(e,t,n)=>{const r=t-e.mean_x,i=n-e.mean_y;e.mean_x+=r/e.valid,e.mean_y+=i/e.valid;const s=n-e.mean_y;e.dev_x+=r*(t-e.mean_x),e.dev_y+=i*s,e.cov+=r*s},rem:(e,t,n)=>{const r=t-e.mean_x,i=n-e.mean_y;e.mean_x-=e.valid?r/e.valid:e.mean_x,e.mean_y-=e.valid?i/e.valid:e.mean_y;const s=n-e.mean_y;e.dev_x-=r*(t-e.mean_x),e.dev_y-=i*s,e.cov-=r*s}}),param:[2]},covariancep:{create:()=>qr({value:e=>e.valid>1?e.cov/e.valid:dn}),param:[2],req:["covariance"]},corr:{create:()=>qr({value:e=>e.valid>1?e.cov/(Math.sqrt(e.dev_x)*Math.sqrt(e.dev_y)):dn}),param:[2],req:["covariance"]},bins:{create:(e,t,n,r)=>qr({value:i=>mje(i.min,i.max,e,t,n,r)}),param:[1,4],req:["min","max"]}},pU={create(){let e;return{init:()=>e=1,value:t=>{const n=t.index;return n&&!t.peer(n)?e=n+1:e}}},param:[]},mU={create(){let e;return{init:()=>e=0,value:t=>{const{index:n,peer:r,size:i}=t;let s=n;if(ee.index+1}},param:[]},rank:pU,avg_rank:{create(){let e,t;return{init:()=>(e=-1,t=1),value:n=>{const r=n.index;if(r>=e){for(t=e=r+1;n.peer(e);t+=++e);t/=e-r}return t}}},param:[]},dense_rank:{create(){let e;return{init:()=>e=1,value:t=>{const n=t.index;return n&&!t.peer(n)?++e:e}}},param:[]},percent_rank:{create(){const{init:e,value:t}=pU.create();return{init:e,value:n=>(t(n)-1)/(n.size-1)}},param:[]},cume_dist:mU,ntile:{create(e){e=+e,e>0||jt("ntile num must be greater than zero.");const{init:t,value:n}=mU.create();return{init:t,value:r=>Math.ceil(e*n(r))}},param:[0,1]},lag:{create(e,t=dn){return e=+e||1,{init:Qu,value:(n,r)=>{const i=n.index-e;return i>=0?n.value(i,r):t}}},param:[1,2]},lead:{create(e,t=dn){return e=+e||1,{init:Qu,value:(n,r)=>{const i=n.index+e;return ie.value(e.i0,t)}},param:[1]},last_value:{create(){return{init:Qu,value:(e,t)=>e.value(e.i1-1,t)}},param:[1]},nth_value:{create(e){return e=+e,e>0||jt("nth_value nth must be greater than zero."),{init:Qu,value:(t,n)=>{const r=t.i0+(e-1);return rt=e,value:(n,r)=>{const i=n.value(n.index,r);return Ea(i)?t=i:t}}},param:[1,1]},fill_up:{create(e=dn){let t,n;return{init:()=>(t=e,n=-1),value:(r,i)=>r.index<=n?t:(n=vje(r,i,r.index))>=0?t=r.value(n,i):(n=r.size,t=e)}},param:[1,1]}};function vje(e,t,n){for(const r=e.size;nzg(e,t,n),expr:(e,t)=>zg(`(row,data,op)=>${e}`,rp,t),expr2:(e,t)=>zg(`(row0,data0,row,data)=>${e}`,rp,t),join:(e,t)=>zg(`(row1,data1,row2,data2)=>${e}`,rp,t),param:(e,t)=>zg(e,rp,t)},bje={"==":1,"!=":1,"===":1,"!==":1};function pte(e,t,n=0,r,i){if(e.type=q_,e.name=t,e.table=n,i&&r&&er(r.keyFor)){const s=bje[i.operator]?i.left===e?i.right:i.left:i.callee&&i.callee.name==="equal"?i.arguments[i.arguments[0]===e?1:0]:null;s&&s.type===Gm&&Eje(i,e,s,r.keyFor(s.value))}return e}function Eje(e,t,n,r){return r<0?(e.type=Gm,e.value=!1,e.raw="false"):(t.type=fje,n.value=r,n.raw=r+""),!0}function WI(e){return yn(e)?e:S$(e)?e.entries():e?Object.entries(e):[]}const mte="row_object";function gte(e,t){e.type=lje;const n=e.properties=[];for(const r of WI(t)){const[i,s]=yn(r)?r:[r,r];n.push({type:ote,key:{type:Gm,raw:Ou(s)},value:pte({computed:!0},i)})}return e}function yte(e){return bT(gte({},e))}function _te(e){return C$.expr(yte(e))}function A$(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function rn(e){return this instanceof rn?(this.v=e,this):new rn(e)}function id(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(e,t||[]),i,s=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(d){r[d]&&(i[d]=function(h){return new Promise(function(p,m){s.push([d,h,p,m])>1||a(d,h)})})}function a(d,h){try{u(r[d](h))}catch(p){f(s[0][3],p)}}function u(d){d.value instanceof rn?Promise.resolve(d.value.v).then(l,c):f(s[0][2],d)}function l(d){a("next",d)}function c(d){a("throw",d)}function f(d,h){d(h),s.shift(),s.length&&a(s[0][0],s[0][1])}}function YA(e){var t,n;return t={},r("next"),r("throw",function(i){throw i}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(i,s){t[i]=e[i]?function(o){return(n=!n)?{value:rn(e[i](o)),done:!1}:s?s(o):o}:s}}function q0(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof gU=="function"?gU(e):e[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(s){n[s]=e[s]&&function(o){return new Promise(function(a,u){o=e[s](o),i(a,u,o.done,o.value)})}}function i(s,o,a,u){Promise.resolve(u).then(function(l){s({value:l,done:a})},o)}}const wje=new TextDecoder("utf-8"),Q2=e=>wje.decode(e),Tje=new TextEncoder,O$=e=>Tje.encode(e),[wrt,vte]=(()=>{const e=()=>{throw new Error("BigInt is not available in this environment")};function t(){throw e()}return t.asIntN=()=>{throw e()},t.asUintN=()=>{throw e()},typeof BigInt<"u"?[BigInt,!0]:[t,!1]})(),[oh,Trt]=(()=>{const e=()=>{throw new Error("BigInt64Array is not available in this environment")};class t{static get BYTES_PER_ELEMENT(){return 8}static of(){throw e()}static from(){throw e()}constructor(){throw e()}}return typeof BigInt64Array<"u"?[BigInt64Array,!0]:[t,!1]})(),[ah,Srt]=(()=>{const e=()=>{throw new Error("BigUint64Array is not available in this environment")};class t{static get BYTES_PER_ELEMENT(){return 8}static of(){throw e()}static from(){throw e()}constructor(){throw e()}}return typeof BigUint64Array<"u"?[BigUint64Array,!0]:[t,!1]})(),Sje=e=>typeof e=="boolean",Is=e=>typeof e=="function",wf=e=>e!=null&&Object(e)===e,qI=e=>wf(e)&&Is(e.then),P$=e=>wf(e)&&Is(e[Symbol.iterator]),YI=e=>wf(e)&&Is(e[Symbol.asyncIterator]),Ije=e=>wf(e)&&"done"in e&&"value"in e,bte=e=>"_getDOMStream"in e&&"_getNodeStream"in e,xje=e=>wf(e)&&Is(e.abort)&&Is(e.getWriter)&&!bte(e),Cje=e=>wf(e)&&Is(e.end)&&Is(e.write)&&Sje(e.writable)&&!bte(e),Aje=e=>wf(e)&&Is(e.clear)&&Is(e.bytes)&&Is(e.position)&&Is(e.setPosition)&&Is(e.capacity)&&Is(e.getBufferIdentifier)&&Is(e.createLong),R$=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;function Oje(e){const t=e[0]?[e[0]]:[];let n,r,i,s;for(let o,a,u=0,l=0,c=e.length;++uc+f.byteLength,0);let i,s,o,a=0,u=-1;const l=Math.min(t||Number.POSITIVE_INFINITY,r);for(const c=n.length;++uIi(Int32Array,e),Pn=e=>Ii(Uint8Array,e),X2=e=>(e.next(),e);function*Pje(e,t){const n=function*(i){yield i},r=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof R$?n(t):P$(t)?t:n(t);return yield*X2(function*(i){let s=null;do s=i.next(yield Ii(e,s));while(!s.done)}(r[Symbol.iterator]())),new e}const Rje=e=>Pje(Uint8Array,e);function Ete(e,t){return id(this,arguments,function*(){if(qI(t))return yield rn(yield rn(yield*YA(q0(Ete(e,yield rn(t))))));const r=function(o){return id(this,arguments,function*(){yield yield rn(yield rn(o))})},i=function(o){return id(this,arguments,function*(){yield rn(yield*YA(q0(X2(function*(a){let u=null;do u=a.next(yield u==null?void 0:u.value);while(!u.done)}(o[Symbol.iterator]())))))})},s=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof R$?r(t):P$(t)?i(t):YI(t)?t:r(t);return yield rn(yield*YA(q0(X2(function(o){return id(this,arguments,function*(){let a=null;do a=yield rn(o.next(yield yield rn(Ii(e,a))));while(!a.done)})}(s[Symbol.asyncIterator]()))))),yield rn(new e)})}const Nje=e=>Ete(Uint8Array,e);function N$(e,t,n){if(e!==0){n=n.slice(0,t+1);for(let r=-1;++r<=t;)n[r]+=e}return n}function kje(e,t){let n=0;const r=e.length;if(r!==t.length)return!1;if(r>0)do if(e[n]!==t[n])return!1;while(++n(e.next(),e);function*Dje(e){let t,n=!1,r=[],i,s,o,a=0;function u(){return s==="peek"?Pu(r,o)[0]:([i,r,a]=Pu(r,o),i)}({cmd:s,size:o}=yield null);const l=Rje(e)[Symbol.iterator]();try{do if({done:t,value:i}=Number.isNaN(o-a)?l.next():l.next(o-a),!t&&i.byteLength>0&&(r.push(i),a+=i.byteLength),t||o<=a)do({cmd:s,size:o}=yield u());while(o0&&(i.push(s),u+=s.byteLength),n||a<=u)do({cmd:o,size:a}=yield yield rn(l()));while(a0&&(i.push(Pn(s)),u+=s.byteLength),n||a<=u)do({cmd:o,size:a}=yield yield rn(l()));while(a{})}get closed(){return this.reader?this.reader.closed.catch(()=>{}):Promise.resolve()}releaseLock(){this.reader&&this.reader.releaseLock(),this.reader=null}cancel(t){return Ju(this,void 0,void 0,function*(){const{reader:n,source:r}=this;n&&(yield n.cancel(t).catch(()=>{})),r&&r.locked&&this.releaseLock()})}read(t){return Ju(this,void 0,void 0,function*(){if(t===0)return{done:this.reader==null,value:new Uint8Array(0)};const n=yield this.reader.read();return!n.done&&(n.value=Pn(n)),n})}}const GA=(e,t)=>{const n=i=>r([t,i]);let r;return[t,n,new Promise(i=>(r=i)&&e.once(t,n))]};function Fje(e){return id(this,arguments,function*(){const n=[];let r="error",i=!1,s=null,o,a,u=0,l=[],c;function f(){return o==="peek"?Pu(l,a)[0]:([c,l,u]=Pu(l,a),c)}if({cmd:o,size:a}=yield yield rn(null),e.isTTY)return yield yield rn(new Uint8Array(0)),yield rn(null);try{n[0]=GA(e,"end"),n[1]=GA(e,"error");do{if(n[2]=GA(e,"readable"),[r,s]=yield rn(Promise.race(n.map(h=>h[2]))),r==="error")break;if((i=r==="end")||(Number.isFinite(a-u)?(c=Pn(e.read(a-u)),c.byteLength0&&(l.push(c),u+=c.byteLength)),i||a<=u)do({cmd:o,size:a}=yield yield rn(f()));while(a{for(const[g,_]of h)e.off(g,_);try{const g=e.destroy;g&&g.call(e,p),p=void 0}catch(g){p=g||p}finally{p!=null?y(p):m()}})}})}var ro;(function(e){e[e.V1=0]="V1",e[e.V2=1]="V2",e[e.V3=2]="V3",e[e.V4=3]="V4",e[e.V5=4]="V5"})(ro||(ro={}));var Yo;(function(e){e[e.Sparse=0]="Sparse",e[e.Dense=1]="Dense"})(Yo||(Yo={}));var Ni;(function(e){e[e.HALF=0]="HALF",e[e.SINGLE=1]="SINGLE",e[e.DOUBLE=2]="DOUBLE"})(Ni||(Ni={}));var Ru;(function(e){e[e.DAY=0]="DAY",e[e.MILLISECOND=1]="MILLISECOND"})(Ru||(Ru={}));var sn;(function(e){e[e.SECOND=0]="SECOND",e[e.MILLISECOND=1]="MILLISECOND",e[e.MICROSECOND=2]="MICROSECOND",e[e.NANOSECOND=3]="NANOSECOND"})(sn||(sn={}));var Nu;(function(e){e[e.YEAR_MONTH=0]="YEAR_MONTH",e[e.DAY_TIME=1]="DAY_TIME",e[e.MONTH_DAY_NANO=2]="MONTH_DAY_NANO"})(Nu||(Nu={}));var ci;(function(e){e[e.NONE=0]="NONE",e[e.Schema=1]="Schema",e[e.DictionaryBatch=2]="DictionaryBatch",e[e.RecordBatch=3]="RecordBatch",e[e.Tensor=4]="Tensor",e[e.SparseTensor=5]="SparseTensor"})(ci||(ci={}));var X;(function(e){e[e.NONE=0]="NONE",e[e.Null=1]="Null",e[e.Int=2]="Int",e[e.Float=3]="Float",e[e.Binary=4]="Binary",e[e.Utf8=5]="Utf8",e[e.Bool=6]="Bool",e[e.Decimal=7]="Decimal",e[e.Date=8]="Date",e[e.Time=9]="Time",e[e.Timestamp=10]="Timestamp",e[e.Interval=11]="Interval",e[e.List=12]="List",e[e.Struct=13]="Struct",e[e.Union=14]="Union",e[e.FixedSizeBinary=15]="FixedSizeBinary",e[e.FixedSizeList=16]="FixedSizeList",e[e.Map=17]="Map",e[e.Dictionary=-1]="Dictionary",e[e.Int8=-2]="Int8",e[e.Int16=-3]="Int16",e[e.Int32=-4]="Int32",e[e.Int64=-5]="Int64",e[e.Uint8=-6]="Uint8",e[e.Uint16=-7]="Uint16",e[e.Uint32=-8]="Uint32",e[e.Uint64=-9]="Uint64",e[e.Float16=-10]="Float16",e[e.Float32=-11]="Float32",e[e.Float64=-12]="Float64",e[e.DateDay=-13]="DateDay",e[e.DateMillisecond=-14]="DateMillisecond",e[e.TimestampSecond=-15]="TimestampSecond",e[e.TimestampMillisecond=-16]="TimestampMillisecond",e[e.TimestampMicrosecond=-17]="TimestampMicrosecond",e[e.TimestampNanosecond=-18]="TimestampNanosecond",e[e.TimeSecond=-19]="TimeSecond",e[e.TimeMillisecond=-20]="TimeMillisecond",e[e.TimeMicrosecond=-21]="TimeMicrosecond",e[e.TimeNanosecond=-22]="TimeNanosecond",e[e.DenseUnion=-23]="DenseUnion",e[e.SparseUnion=-24]="SparseUnion",e[e.IntervalDayTime=-25]="IntervalDayTime",e[e.IntervalYearMonth=-26]="IntervalYearMonth"})(X||(X={}));var Yu;(function(e){e[e.OFFSET=0]="OFFSET",e[e.DATA=1]="DATA",e[e.VALIDITY=2]="VALIDITY",e[e.TYPE=3]="TYPE"})(Yu||(Yu={}));const Bje=void 0;function Wc(e){if(e===null)return"null";if(e===Bje)return"undefined";switch(typeof e){case"number":return`${e}`;case"bigint":return`${e}`;case"string":return`"${e}"`}return typeof e[Symbol.toPrimitive]=="function"?e[Symbol.toPrimitive]("string"):ArrayBuffer.isView(e)?e instanceof oh||e instanceof ah?`[${[...e].map(t=>Wc(t))}]`:`[${e}]`:ArrayBuffer.isView(e)?`[${e}]`:JSON.stringify(e,(t,n)=>typeof n=="bigint"?`${n}`:n)}const jje=Symbol.for("isArrowBigNum");function La(e,...t){return t.length===0?Object.setPrototypeOf(Ii(this.TypedArray,e),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(e,...t),this.constructor.prototype)}La.prototype[jje]=!0;La.prototype.toJSON=function(){return`"${Ed(this)}"`};La.prototype.valueOf=function(){return wte(this)};La.prototype.toString=function(){return Ed(this)};La.prototype[Symbol.toPrimitive]=function(e="default"){switch(e){case"number":return wte(this);case"string":return Ed(this);case"default":return J2(this)}return Ed(this)};function Op(...e){return La.apply(this,e)}function Pp(...e){return La.apply(this,e)}function Fy(...e){return La.apply(this,e)}Object.setPrototypeOf(Op.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(Pp.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(Fy.prototype,Object.create(Uint32Array.prototype));Object.assign(Op.prototype,La.prototype,{constructor:Op,signed:!0,TypedArray:Int32Array,BigIntArray:oh});Object.assign(Pp.prototype,La.prototype,{constructor:Pp,signed:!1,TypedArray:Uint32Array,BigIntArray:ah});Object.assign(Fy.prototype,La.prototype,{constructor:Fy,signed:!0,TypedArray:Uint32Array,BigIntArray:ah});function wte(e){const{buffer:t,byteOffset:n,length:r,signed:i}=e,s=new ah(t,n,r),o=i&&s[s.length-1]&BigInt(1)<e.byteLength===8?new e.BigIntArray(e.buffer,e.byteOffset,1)[0]:KA(e),Ed=e=>e.byteLength===8?`${new e.BigIntArray(e.buffer,e.byteOffset,1)[0]}`:KA(e)):(Ed=KA,J2=Ed);function KA(e){let t="";const n=new Uint32Array(2);let r=new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2);const i=new Uint32Array((r=new Uint16Array(r).reverse()).buffer);let s=-1;const o=r.length-1;do{for(n[0]=r[s=0];s(e.children=null,e.ArrayType=Array,e[Symbol.toStringTag]="DataType"))(Qt.prototype);let Pl=class extends Qt{toString(){return"Null"}get typeId(){return X.Null}};Ste=Symbol.toStringTag;Pl[Ste]=(e=>e[Symbol.toStringTag]="Null")(Pl.prototype);class fs extends Qt{constructor(t,n){super(),this.isSigned=t,this.bitWidth=n}get typeId(){return X.Int}get ArrayType(){switch(this.bitWidth){case 8:return this.isSigned?Int8Array:Uint8Array;case 16:return this.isSigned?Int16Array:Uint16Array;case 32:return this.isSigned?Int32Array:Uint32Array;case 64:return this.isSigned?oh:ah}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}}Ite=Symbol.toStringTag;fs[Ite]=(e=>(e.isSigned=null,e.bitWidth=null,e[Symbol.toStringTag]="Int"))(fs.prototype);class D$ extends fs{constructor(){super(!0,8)}get ArrayType(){return Int8Array}}class $$ extends fs{constructor(){super(!0,16)}get ArrayType(){return Int16Array}}class rf extends fs{constructor(){super(!0,32)}get ArrayType(){return Int32Array}}class L$ extends fs{constructor(){super(!0,64)}get ArrayType(){return oh}}class M$ extends fs{constructor(){super(!1,8)}get ArrayType(){return Uint8Array}}class F$ extends fs{constructor(){super(!1,16)}get ArrayType(){return Uint16Array}}class B$ extends fs{constructor(){super(!1,32)}get ArrayType(){return Uint32Array}}class j$ extends fs{constructor(){super(!1,64)}get ArrayType(){return ah}}Object.defineProperty(D$.prototype,"ArrayType",{value:Int8Array});Object.defineProperty($$.prototype,"ArrayType",{value:Int16Array});Object.defineProperty(rf.prototype,"ArrayType",{value:Int32Array});Object.defineProperty(L$.prototype,"ArrayType",{value:oh});Object.defineProperty(M$.prototype,"ArrayType",{value:Uint8Array});Object.defineProperty(F$.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(B$.prototype,"ArrayType",{value:Uint32Array});Object.defineProperty(j$.prototype,"ArrayType",{value:ah});class sf extends Qt{constructor(t){super(),this.precision=t}get typeId(){return X.Float}get ArrayType(){switch(this.precision){case Ni.HALF:return Uint16Array;case Ni.SINGLE:return Float32Array;case Ni.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}}xte=Symbol.toStringTag;sf[xte]=(e=>(e.precision=null,e[Symbol.toStringTag]="Float"))(sf.prototype);class Vte extends sf{constructor(){super(Ni.HALF)}}class U$ extends sf{constructor(){super(Ni.SINGLE)}}class V$ extends sf{constructor(){super(Ni.DOUBLE)}}Object.defineProperty(Vte.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(U$.prototype,"ArrayType",{value:Float32Array});Object.defineProperty(V$.prototype,"ArrayType",{value:Float64Array});let By=class extends Qt{constructor(){super()}get typeId(){return X.Binary}toString(){return"Binary"}};Cte=Symbol.toStringTag;By[Cte]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Binary"))(By.prototype);let lm=class extends Qt{constructor(){super()}get typeId(){return X.Utf8}toString(){return"Utf8"}};Ate=Symbol.toStringTag;lm[Ate]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Utf8"))(lm.prototype);let jy=class extends Qt{constructor(){super()}get typeId(){return X.Bool}toString(){return"Bool"}};Ote=Symbol.toStringTag;jy[Ote]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Bool"))(jy.prototype);let TT=class extends Qt{constructor(t,n,r=128){super(),this.scale=t,this.precision=n,this.bitWidth=r}get typeId(){return X.Decimal}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}};Pte=Symbol.toStringTag;TT[Pte]=(e=>(e.scale=null,e.precision=null,e.ArrayType=Uint32Array,e[Symbol.toStringTag]="Decimal"))(TT.prototype);class cm extends Qt{constructor(t){super(),this.unit=t}get typeId(){return X.Date}toString(){return`Date${(this.unit+1)*32}<${Ru[this.unit]}>`}}Rte=Symbol.toStringTag;cm[Rte]=(e=>(e.unit=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]="Date"))(cm.prototype);class Uje extends cm{constructor(){super(Ru.DAY)}}class Vje extends cm{constructor(){super(Ru.MILLISECOND)}}class Rl extends Qt{constructor(t,n){super(),this.unit=t,this.bitWidth=n}get typeId(){return X.Time}toString(){return`Time${this.bitWidth}<${sn[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return oh}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}}Nte=Symbol.toStringTag;Rl[Nte]=(e=>(e.unit=null,e.bitWidth=null,e[Symbol.toStringTag]="Time"))(Rl.prototype);class zje extends Rl{constructor(){super(sn.SECOND,32)}}class Hje extends Rl{constructor(){super(sn.MILLISECOND,32)}}class Wje extends Rl{constructor(){super(sn.MICROSECOND,64)}}class qje extends Rl{constructor(){super(sn.NANOSECOND,64)}}class ST extends Qt{constructor(t,n){super(),this.unit=t,this.timezone=n}get typeId(){return X.Timestamp}toString(){return`Timestamp<${sn[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}}kte=Symbol.toStringTag;ST[kte]=(e=>(e.unit=null,e.timezone=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]="Timestamp"))(ST.prototype);class fm extends Qt{constructor(t){super(),this.unit=t}get typeId(){return X.Interval}toString(){return`Interval<${Nu[this.unit]}>`}}Dte=Symbol.toStringTag;fm[Dte]=(e=>(e.unit=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]="Interval"))(fm.prototype);class Yje extends fm{constructor(){super(Nu.DAY_TIME)}}class Gje extends fm{constructor(){super(Nu.YEAR_MONTH)}}let dm=class extends Qt{constructor(t){super(),this.children=[t]}get typeId(){return X.List}toString(){return`List<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};$te=Symbol.toStringTag;dm[$te]=(e=>(e.children=null,e[Symbol.toStringTag]="List"))(dm.prototype);class Yi extends Qt{constructor(t){super(),this.children=t}get typeId(){return X.Struct}toString(){return`Struct<{${this.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}}Lte=Symbol.toStringTag;Yi[Lte]=(e=>(e.children=null,e[Symbol.toStringTag]="Struct"))(Yi.prototype);class Uy extends Qt{constructor(t,n,r){super(),this.mode=t,this.children=r,this.typeIds=n=Int32Array.from(n),this.typeIdToChildIndex=n.reduce((i,s,o)=>(i[s]=o)&&i||i,Object.create(null))}get typeId(){return X.Union}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(t=>`${t.type}`).join(" | ")}>`}}Mte=Symbol.toStringTag;Uy[Mte]=(e=>(e.mode=null,e.typeIds=null,e.children=null,e.typeIdToChildIndex=null,e.ArrayType=Int8Array,e[Symbol.toStringTag]="Union"))(Uy.prototype);let IT=class extends Qt{constructor(t){super(),this.byteWidth=t}get typeId(){return X.FixedSizeBinary}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};Fte=Symbol.toStringTag;IT[Fte]=(e=>(e.byteWidth=null,e.ArrayType=Uint8Array,e[Symbol.toStringTag]="FixedSizeBinary"))(IT.prototype);let hm=class extends Qt{constructor(t,n){super(),this.listSize=t,this.children=[n]}get typeId(){return X.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}};Bte=Symbol.toStringTag;hm[Bte]=(e=>(e.children=null,e.listSize=null,e[Symbol.toStringTag]="FixedSizeList"))(hm.prototype);class Vy extends Qt{constructor(t,n=!1){super(),this.children=[t],this.keysSorted=n}get typeId(){return X.Map}get keyType(){return this.children[0].type.children[0].type}get valueType(){return this.children[0].type.children[1].type}get childType(){return this.children[0].type}toString(){return`Map<{${this.children[0].type.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}}jte=Symbol.toStringTag;Vy[jte]=(e=>(e.children=null,e.keysSorted=null,e[Symbol.toStringTag]="Map_"))(Vy.prototype);const Kje=(e=>()=>++e)(-1);class of extends Qt{constructor(t,n,r,i){super(),this.indices=n,this.dictionary=t,this.isOrdered=i||!1,this.id=r==null?Kje():typeof r=="number"?r:r.low}get typeId(){return X.Dictionary}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}}Ute=Symbol.toStringTag;of[Ute]=(e=>(e.id=null,e.indices=null,e.isOrdered=null,e.dictionary=null,e[Symbol.toStringTag]="Dictionary"))(of.prototype);function Ga(e){const t=e;switch(e.typeId){case X.Decimal:return e.bitWidth/32;case X.Timestamp:return 2;case X.Date:return 1+t.unit;case X.Interval:return 1+t.unit;case X.FixedSizeList:return t.listSize;case X.FixedSizeBinary:return t.byteWidth;default:return 1}}class on{visitMany(t,...n){return t.map((r,i)=>this.visit(r,...n.map(s=>s[i])))}visit(...t){return this.getVisitFn(t[0],!1).apply(this,t)}getVisitFn(t,n=!0){return Qje(this,t,n)}getVisitFnByTypeId(t,n=!0){return Rh(this,t,n)}visitNull(t,...n){return null}visitBool(t,...n){return null}visitInt(t,...n){return null}visitFloat(t,...n){return null}visitUtf8(t,...n){return null}visitBinary(t,...n){return null}visitFixedSizeBinary(t,...n){return null}visitDate(t,...n){return null}visitTimestamp(t,...n){return null}visitTime(t,...n){return null}visitDecimal(t,...n){return null}visitList(t,...n){return null}visitStruct(t,...n){return null}visitUnion(t,...n){return null}visitDictionary(t,...n){return null}visitInterval(t,...n){return null}visitFixedSizeList(t,...n){return null}visitMap(t,...n){return null}}function Qje(e,t,n=!0){return typeof t=="number"?Rh(e,t,n):typeof t=="string"&&t in X?Rh(e,X[t],n):t&&t instanceof Qt?Rh(e,_U(t),n):t!=null&&t.type&&t.type instanceof Qt?Rh(e,_U(t.type),n):Rh(e,X.NONE,n)}function Rh(e,t,n=!0){let r=null;switch(t){case X.Null:r=e.visitNull;break;case X.Bool:r=e.visitBool;break;case X.Int:r=e.visitInt;break;case X.Int8:r=e.visitInt8||e.visitInt;break;case X.Int16:r=e.visitInt16||e.visitInt;break;case X.Int32:r=e.visitInt32||e.visitInt;break;case X.Int64:r=e.visitInt64||e.visitInt;break;case X.Uint8:r=e.visitUint8||e.visitInt;break;case X.Uint16:r=e.visitUint16||e.visitInt;break;case X.Uint32:r=e.visitUint32||e.visitInt;break;case X.Uint64:r=e.visitUint64||e.visitInt;break;case X.Float:r=e.visitFloat;break;case X.Float16:r=e.visitFloat16||e.visitFloat;break;case X.Float32:r=e.visitFloat32||e.visitFloat;break;case X.Float64:r=e.visitFloat64||e.visitFloat;break;case X.Utf8:r=e.visitUtf8;break;case X.Binary:r=e.visitBinary;break;case X.FixedSizeBinary:r=e.visitFixedSizeBinary;break;case X.Date:r=e.visitDate;break;case X.DateDay:r=e.visitDateDay||e.visitDate;break;case X.DateMillisecond:r=e.visitDateMillisecond||e.visitDate;break;case X.Timestamp:r=e.visitTimestamp;break;case X.TimestampSecond:r=e.visitTimestampSecond||e.visitTimestamp;break;case X.TimestampMillisecond:r=e.visitTimestampMillisecond||e.visitTimestamp;break;case X.TimestampMicrosecond:r=e.visitTimestampMicrosecond||e.visitTimestamp;break;case X.TimestampNanosecond:r=e.visitTimestampNanosecond||e.visitTimestamp;break;case X.Time:r=e.visitTime;break;case X.TimeSecond:r=e.visitTimeSecond||e.visitTime;break;case X.TimeMillisecond:r=e.visitTimeMillisecond||e.visitTime;break;case X.TimeMicrosecond:r=e.visitTimeMicrosecond||e.visitTime;break;case X.TimeNanosecond:r=e.visitTimeNanosecond||e.visitTime;break;case X.Decimal:r=e.visitDecimal;break;case X.List:r=e.visitList;break;case X.Struct:r=e.visitStruct;break;case X.Union:r=e.visitUnion;break;case X.DenseUnion:r=e.visitDenseUnion||e.visitUnion;break;case X.SparseUnion:r=e.visitSparseUnion||e.visitUnion;break;case X.Dictionary:r=e.visitDictionary;break;case X.Interval:r=e.visitInterval;break;case X.IntervalDayTime:r=e.visitIntervalDayTime||e.visitInterval;break;case X.IntervalYearMonth:r=e.visitIntervalYearMonth||e.visitInterval;break;case X.FixedSizeList:r=e.visitFixedSizeList;break;case X.Map:r=e.visitMap;break}if(typeof r=="function")return r;if(!n)return()=>null;throw new Error(`Unrecognized type '${X[t]}'`)}function _U(e){switch(e.typeId){case X.Null:return X.Null;case X.Int:{const{bitWidth:t,isSigned:n}=e;switch(t){case 8:return n?X.Int8:X.Uint8;case 16:return n?X.Int16:X.Uint16;case 32:return n?X.Int32:X.Uint32;case 64:return n?X.Int64:X.Uint64}return X.Int}case X.Float:switch(e.precision){case Ni.HALF:return X.Float16;case Ni.SINGLE:return X.Float32;case Ni.DOUBLE:return X.Float64}return X.Float;case X.Binary:return X.Binary;case X.Utf8:return X.Utf8;case X.Bool:return X.Bool;case X.Decimal:return X.Decimal;case X.Time:switch(e.unit){case sn.SECOND:return X.TimeSecond;case sn.MILLISECOND:return X.TimeMillisecond;case sn.MICROSECOND:return X.TimeMicrosecond;case sn.NANOSECOND:return X.TimeNanosecond}return X.Time;case X.Timestamp:switch(e.unit){case sn.SECOND:return X.TimestampSecond;case sn.MILLISECOND:return X.TimestampMillisecond;case sn.MICROSECOND:return X.TimestampMicrosecond;case sn.NANOSECOND:return X.TimestampNanosecond}return X.Timestamp;case X.Date:switch(e.unit){case Ru.DAY:return X.DateDay;case Ru.MILLISECOND:return X.DateMillisecond}return X.Date;case X.Interval:switch(e.unit){case Nu.DAY_TIME:return X.IntervalDayTime;case Nu.YEAR_MONTH:return X.IntervalYearMonth}return X.Interval;case X.Map:return X.Map;case X.List:return X.List;case X.Struct:return X.Struct;case X.Union:switch(e.mode){case Yo.Dense:return X.DenseUnion;case Yo.Sparse:return X.SparseUnion}return X.Union;case X.FixedSizeBinary:return X.FixedSizeBinary;case X.FixedSizeList:return X.FixedSizeList;case X.Dictionary:return X.Dictionary}throw new Error(`Unrecognized type '${X[e.typeId]}'`)}on.prototype.visitInt8=null;on.prototype.visitInt16=null;on.prototype.visitInt32=null;on.prototype.visitInt64=null;on.prototype.visitUint8=null;on.prototype.visitUint16=null;on.prototype.visitUint32=null;on.prototype.visitUint64=null;on.prototype.visitFloat16=null;on.prototype.visitFloat32=null;on.prototype.visitFloat64=null;on.prototype.visitDateDay=null;on.prototype.visitDateMillisecond=null;on.prototype.visitTimestampSecond=null;on.prototype.visitTimestampMillisecond=null;on.prototype.visitTimestampMicrosecond=null;on.prototype.visitTimestampNanosecond=null;on.prototype.visitTimeSecond=null;on.prototype.visitTimeMillisecond=null;on.prototype.visitTimeMicrosecond=null;on.prototype.visitTimeNanosecond=null;on.prototype.visitDenseUnion=null;on.prototype.visitSparseUnion=null;on.prototype.visitIntervalDayTime=null;on.prototype.visitIntervalYearMonth=null;const zte=new Float64Array(1),xh=new Uint32Array(zte.buffer);function Hte(e){const t=(e&31744)>>10,n=(e&1023)/1024,r=Math.pow(-1,(e&32768)>>15);switch(t){case 31:return r*(n?Number.NaN:1/0);case 0:return r*(n?6103515625e-14*n:0)}return r*Math.pow(2,t-15)*(1+n)}function Wte(e){if(e!==e)return 32256;zte[0]=e;const t=(xh[1]&2147483648)>>16&65535;let n=xh[1]&2146435072,r=0;return n>=1089470464?xh[0]>0?n=31744:(n=(n&2080374784)>>16,r=(xh[1]&1048575)>>10):n<=1056964608?(r=1048576+(xh[1]&1048575),r=1048576+(r<<(n>>20)-998)>>21,n=0):(n=n-1056964608>>10,r=(xh[1]&1048575)+512>>10),t|n|r&65535}class kt extends on{}function Ft(e){return(t,n,r)=>{if(t.setValid(n,r!=null))return e(t,n,r)}}const Xje=(e,t,n)=>{e[t]=Math.trunc(n/864e5)},z$=(e,t,n)=>{e[t]=Math.trunc(n%4294967296),e[t+1]=Math.trunc(n/4294967296)},Jje=(e,t,n)=>{e[t]=Math.trunc(n*1e3%4294967296),e[t+1]=Math.trunc(n*1e3/4294967296)},Zje=(e,t,n)=>{e[t]=Math.trunc(n*1e6%4294967296),e[t+1]=Math.trunc(n*1e6/4294967296)},qte=(e,t,n,r)=>{if(n+1{const i=e+n;r?t[i>>3]|=1<>3]&=~(1<{e[t]=n},H$=({values:e},t,n)=>{e[t]=n},Yte=({values:e},t,n)=>{e[t]=Wte(n)},tUe=(e,t,n)=>{switch(e.type.precision){case Ni.HALF:return Yte(e,t,n);case Ni.SINGLE:case Ni.DOUBLE:return H$(e,t,n)}},W$=({values:e},t,n)=>{Xje(e,t,n.valueOf())},q$=({values:e},t,n)=>{z$(e,t*2,n.valueOf())},Gte=({stride:e,values:t},n,r)=>{t.set(r.subarray(0,e),e*n)},nUe=({values:e,valueOffsets:t},n,r)=>qte(e,t,n,r),rUe=({values:e,valueOffsets:t},n,r)=>{qte(e,t,n,O$(r))},Kte=(e,t,n)=>{e.type.unit===Ru.DAY?W$(e,t,n):q$(e,t,n)},Y$=({values:e},t,n)=>z$(e,t*2,n/1e3),G$=({values:e},t,n)=>z$(e,t*2,n),K$=({values:e},t,n)=>Jje(e,t*2,n),Q$=({values:e},t,n)=>Zje(e,t*2,n),Qte=(e,t,n)=>{switch(e.type.unit){case sn.SECOND:return Y$(e,t,n);case sn.MILLISECOND:return G$(e,t,n);case sn.MICROSECOND:return K$(e,t,n);case sn.NANOSECOND:return Q$(e,t,n)}},X$=({values:e},t,n)=>{e[t]=n},J$=({values:e},t,n)=>{e[t]=n},Z$=({values:e},t,n)=>{e[t]=n},e3=({values:e},t,n)=>{e[t]=n},Xte=(e,t,n)=>{switch(e.type.unit){case sn.SECOND:return X$(e,t,n);case sn.MILLISECOND:return J$(e,t,n);case sn.MICROSECOND:return Z$(e,t,n);case sn.NANOSECOND:return e3(e,t,n)}},Jte=({values:e,stride:t},n,r)=>{e.set(r.subarray(0,t),t*n)},iUe=(e,t,n)=>{const r=e.children[0],i=e.valueOffsets,s=Go.getVisitFn(r);if(Array.isArray(n))for(let o=-1,a=i[t],u=i[t+1];a{const r=e.children[0],{valueOffsets:i}=e,s=Go.getVisitFn(r);let{[t]:o,[t+1]:a}=i;const u=n instanceof Map?n.entries():Object.entries(n);for(const l of u)if(s(r,o,l),++o>=a)break},oUe=(e,t)=>(n,r,i,s)=>r&&n(r,e,t[s]),aUe=(e,t)=>(n,r,i,s)=>r&&n(r,e,t.get(s)),uUe=(e,t)=>(n,r,i,s)=>r&&n(r,e,t.get(i.name)),lUe=(e,t)=>(n,r,i,s)=>r&&n(r,e,t[i.name]),cUe=(e,t,n)=>{const r=e.type.children.map(s=>Go.getVisitFn(s.type)),i=n instanceof Map?uUe(t,n):n instanceof _n?aUe(t,n):Array.isArray(n)?oUe(t,n):lUe(t,n);e.type.children.forEach((s,o)=>i(r[o],e.children[o],s,o))},fUe=(e,t,n)=>{e.type.mode===Yo.Dense?Zte(e,t,n):ene(e,t,n)},Zte=(e,t,n)=>{const r=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[r];Go.visit(i,e.valueOffsets[t],n)},ene=(e,t,n)=>{const r=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[r];Go.visit(i,t,n)},dUe=(e,t,n)=>{var r;(r=e.dictionary)===null||r===void 0||r.set(e.values[t],n)},tne=(e,t,n)=>{e.type.unit===Nu.DAY_TIME?t3(e,t,n):n3(e,t,n)},t3=({values:e},t,n)=>{e.set(n.subarray(0,2),2*t)},n3=({values:e},t,n)=>{e[t]=n[0]*12+n[1]%12},hUe=(e,t,n)=>{const{stride:r}=e,i=e.children[0],s=Go.getVisitFn(i);if(Array.isArray(n))for(let o=-1,a=t*r;++o`${Wc(t)}: ${Wc(n)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new pUe(this[pa],this[Rp])}}class pUe{constructor(t,n){this.childIndex=0,this.children=t.children,this.rowIndex=n,this.childFields=t.type.children,this.numChildren=this.childFields.length}[Symbol.iterator](){return this}next(){const t=this.childIndex;return tn.name)}has(t,n){return t[pa].type.children.findIndex(r=>r.name===n)!==-1}getOwnPropertyDescriptor(t,n){if(t[pa].type.children.findIndex(r=>r.name===n)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,n){if(Reflect.has(t,n))return t[n];const r=t[pa].type.children.findIndex(i=>i.name===n);if(r!==-1){const i=zs.visit(t[pa].children[r],t[Rp]);return Reflect.set(t,n,i),i}}set(t,n,r){const i=t[pa].type.children.findIndex(s=>s.name===n);return i!==-1?(Go.visit(t[pa].children[i],t[Rp],r),Reflect.set(t,n,r)):Reflect.has(t,n)||typeof n=="symbol"?Reflect.set(t,n,r):!1}}class At extends on{}function Dt(e){return(t,n)=>t.getValid(n)?e(t,n):null}const gUe=(e,t)=>864e5*e[t],i3=(e,t)=>4294967296*e[t+1]+(e[t]>>>0),yUe=(e,t)=>4294967296*(e[t+1]/1e3)+(e[t]>>>0)/1e3,_Ue=(e,t)=>4294967296*(e[t+1]/1e6)+(e[t]>>>0)/1e6,nne=e=>new Date(e),vUe=(e,t)=>nne(gUe(e,t)),bUe=(e,t)=>nne(i3(e,t)),EUe=(e,t)=>null,rne=(e,t,n)=>{if(n+1>=t.length)return null;const r=t[n],i=t[n+1];return e.subarray(r,i)},wUe=({offset:e,values:t},n)=>{const r=e+n;return(t[r>>3]&1<vUe(e,t),sne=({values:e},t)=>bUe(e,t*2),Tf=({stride:e,values:t},n)=>t[e*n],TUe=({stride:e,values:t},n)=>Hte(t[e*n]),one=({values:e},t)=>e[t],SUe=({stride:e,values:t},n)=>t.subarray(e*n,e*(n+1)),IUe=({values:e,valueOffsets:t},n)=>rne(e,t,n),xUe=({values:e,valueOffsets:t},n)=>{const r=rne(e,t,n);return r!==null?Q2(r):null},CUe=({values:e},t)=>e[t],AUe=({type:e,values:t},n)=>e.precision!==Ni.HALF?t[n]:Hte(t[n]),OUe=(e,t)=>e.type.unit===Ru.DAY?ine(e,t):sne(e,t),ane=({values:e},t)=>1e3*i3(e,t*2),une=({values:e},t)=>i3(e,t*2),lne=({values:e},t)=>yUe(e,t*2),cne=({values:e},t)=>_Ue(e,t*2),PUe=(e,t)=>{switch(e.type.unit){case sn.SECOND:return ane(e,t);case sn.MILLISECOND:return une(e,t);case sn.MICROSECOND:return lne(e,t);case sn.NANOSECOND:return cne(e,t)}},fne=({values:e},t)=>e[t],dne=({values:e},t)=>e[t],hne=({values:e},t)=>e[t],pne=({values:e},t)=>e[t],RUe=(e,t)=>{switch(e.type.unit){case sn.SECOND:return fne(e,t);case sn.MILLISECOND:return dne(e,t);case sn.MICROSECOND:return hne(e,t);case sn.NANOSECOND:return pne(e,t)}},NUe=({values:e,stride:t},n)=>k$.decimal(e.subarray(t*n,t*(n+1))),kUe=(e,t)=>{const{valueOffsets:n,stride:r,children:i}=e,{[t*r]:s,[t*r+1]:o}=n,u=i[0].slice(s,o-s);return new _n([u])},DUe=(e,t)=>{const{valueOffsets:n,children:r}=e,{[t]:i,[t+1]:s}=n,o=r[0];return new GI(o.slice(i,s-i))},$Ue=(e,t)=>new r3(e,t),LUe=(e,t)=>e.type.mode===Yo.Dense?mne(e,t):gne(e,t),mne=(e,t)=>{const n=e.type.typeIdToChildIndex[e.typeIds[t]],r=e.children[n];return zs.visit(r,e.valueOffsets[t])},gne=(e,t)=>{const n=e.type.typeIdToChildIndex[e.typeIds[t]],r=e.children[n];return zs.visit(r,t)},MUe=(e,t)=>{var n;return(n=e.dictionary)===null||n===void 0?void 0:n.get(e.values[t])},FUe=(e,t)=>e.type.unit===Nu.DAY_TIME?yne(e,t):_ne(e,t),yne=({values:e},t)=>e.subarray(2*t,2*(t+1)),_ne=({values:e},t)=>{const n=e[t],r=new Int32Array(2);return r[0]=Math.trunc(n/12),r[1]=Math.trunc(n%12),r},BUe=(e,t)=>{const{stride:n,children:r}=e,s=r[0].slice(t*n,n);return new _n([s])};At.prototype.visitNull=Dt(EUe);At.prototype.visitBool=Dt(wUe);At.prototype.visitInt=Dt(CUe);At.prototype.visitInt8=Dt(Tf);At.prototype.visitInt16=Dt(Tf);At.prototype.visitInt32=Dt(Tf);At.prototype.visitInt64=Dt(one);At.prototype.visitUint8=Dt(Tf);At.prototype.visitUint16=Dt(Tf);At.prototype.visitUint32=Dt(Tf);At.prototype.visitUint64=Dt(one);At.prototype.visitFloat=Dt(AUe);At.prototype.visitFloat16=Dt(TUe);At.prototype.visitFloat32=Dt(Tf);At.prototype.visitFloat64=Dt(Tf);At.prototype.visitUtf8=Dt(xUe);At.prototype.visitBinary=Dt(IUe);At.prototype.visitFixedSizeBinary=Dt(SUe);At.prototype.visitDate=Dt(OUe);At.prototype.visitDateDay=Dt(ine);At.prototype.visitDateMillisecond=Dt(sne);At.prototype.visitTimestamp=Dt(PUe);At.prototype.visitTimestampSecond=Dt(ane);At.prototype.visitTimestampMillisecond=Dt(une);At.prototype.visitTimestampMicrosecond=Dt(lne);At.prototype.visitTimestampNanosecond=Dt(cne);At.prototype.visitTime=Dt(RUe);At.prototype.visitTimeSecond=Dt(fne);At.prototype.visitTimeMillisecond=Dt(dne);At.prototype.visitTimeMicrosecond=Dt(hne);At.prototype.visitTimeNanosecond=Dt(pne);At.prototype.visitDecimal=Dt(NUe);At.prototype.visitList=Dt(kUe);At.prototype.visitStruct=Dt($Ue);At.prototype.visitUnion=Dt(LUe);At.prototype.visitDenseUnion=Dt(mne);At.prototype.visitSparseUnion=Dt(gne);At.prototype.visitDictionary=Dt(MUe);At.prototype.visitInterval=Dt(FUe);At.prototype.visitIntervalDayTime=Dt(yne);At.prototype.visitIntervalYearMonth=Dt(_ne);At.prototype.visitFixedSizeList=Dt(BUe);At.prototype.visitMap=Dt(DUe);const zs=new At,ba=Symbol.for("keys"),Np=Symbol.for("vals");class GI{constructor(t){return this[ba]=new _n([t.children[0]]).memoize(),this[Np]=t.children[1],new Proxy(this,new UUe)}[Symbol.iterator](){return new jUe(this[ba],this[Np])}get size(){return this[ba].length}toArray(){return Object.values(this.toJSON())}toJSON(){const t=this[ba],n=this[Np],r={};for(let i=-1,s=t.length;++i`${Wc(t)}: ${Wc(n)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}}class jUe{constructor(t,n){this.keys=t,this.vals=n,this.keyIndex=0,this.numKeys=t.length}[Symbol.iterator](){return this}next(){const t=this.keyIndex;return t===this.numKeys?{done:!0,value:null}:(this.keyIndex++,{done:!1,value:[this.keys.get(t),zs.visit(this.vals,t)]})}}class UUe{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[ba].toArray().map(String)}has(t,n){return t[ba].includes(n)}getOwnPropertyDescriptor(t,n){if(t[ba].indexOf(n)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,n){if(Reflect.has(t,n))return t[n];const r=t[ba].indexOf(n);if(r!==-1){const i=zs.visit(Reflect.get(t,Np),r);return Reflect.set(t,n,i),i}}set(t,n,r){const i=t[ba].indexOf(n);return i!==-1?(Go.visit(Reflect.get(t,Np),i,r),Reflect.set(t,n,r)):Reflect.has(t,n)?Reflect.set(t,n,r):!1}}Object.defineProperties(GI.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[ba]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Np]:{writable:!0,enumerable:!1,configurable:!1,value:null}});let vU;function vne(e,t,n,r){const{length:i=0}=e;let s=typeof t!="number"?0:t,o=typeof n!="number"?i:n;return s<0&&(s=(s%i+i)%i),o<0&&(o=(o%i+i)%i),oi&&(o=i),r?r(e,s,o):[s,o]}const bU=e=>e!==e;function Km(e){if(typeof e!=="object"||e===null)return bU(e)?bU:n=>n===e;if(e instanceof Date){const n=e.valueOf();return r=>r instanceof Date?r.valueOf()===n:!1}return ArrayBuffer.isView(e)?n=>n?kje(e,n):!1:e instanceof Map?zUe(e):Array.isArray(e)?VUe(e):e instanceof _n?HUe(e):WUe(e,!0)}function VUe(e){const t=[];for(let n=-1,r=e.length;++n!1;const r=[];for(let i=-1,s=n.length;++i{if(!n||typeof n!="object")return!1;switch(n.constructor){case Array:return qUe(e,n);case Map:return EU(e,n,n.keys());case GI:case r3:case Object:case void 0:return EU(e,n,t||Object.keys(n))}return n instanceof _n?YUe(e,n):!1}}function qUe(e,t){const n=e.length;if(t.length!==n)return!1;for(let r=-1;++r>r}function s3(e,t,n){const r=n.byteLength+7&-8;if(e>0||n.byteLength>3):Ene(new o3(n,e,t,null,bne)).subarray(0,r)),i}return n}function Ene(e){const t=[];let n=0,r=0,i=0;for(const o of e)o&&(i|=1<0)&&(t[n++]=i);const s=new Uint8Array(t.length+7&-8);return s.set(t),s}class o3{constructor(t,n,r,i,s){this.bytes=t,this.length=r,this.context=i,this.get=s,this.bit=n%8,this.byteIndex=n>>3,this.byte=t[this.byteIndex++],this.index=0}next(){return this.index>3<<3,i=t+(t%8===0?0:8-t%8);return Z2(e,t,i)+Z2(e,r,n)+KUe(e,i>>3,r-i>>3)}function KUe(e,t,n){let r=0,i=Math.trunc(t);const s=new DataView(e.buffer,e.byteOffset,e.byteLength),o=n===void 0?e.byteLength:i+n;for(;o-i>=4;)r+=QA(s.getUint32(i)),i+=4;for(;o-i>=2;)r+=QA(s.getUint16(i)),i+=2;for(;o-i>=1;)r+=QA(s.getUint8(i)),i+=1;return r}function QA(e){let t=Math.trunc(e);return t=t-(t>>>1&1431655765),t=(t&858993459)+(t>>>2&858993459),(t+(t>>>4)&252645135)*16843009>>>24}const QUe=-1;class Mn{constructor(t,n,r,i,s,o=[],a){this.type=t,this.children=o,this.dictionary=a,this.offset=Math.floor(Math.max(n||0,0)),this.length=Math.floor(Math.max(r||0,0)),this._nullCount=Math.floor(Math.max(i||0,-1));let u;s instanceof Mn?(this.stride=s.stride,this.values=s.values,this.typeIds=s.typeIds,this.nullBitmap=s.nullBitmap,this.valueOffsets=s.valueOffsets):(this.stride=Ga(t),s&&((u=s[0])&&(this.valueOffsets=u),(u=s[1])&&(this.values=u),(u=s[2])&&(this.nullBitmap=u),(u=s[3])&&(this.typeIds=u))),this.nullable=this._nullCount!==0&&this.nullBitmap&&this.nullBitmap.byteLength>0}get typeId(){return this.type.typeId}get ArrayType(){return this.type.ArrayType}get buffers(){return[this.valueOffsets,this.values,this.nullBitmap,this.typeIds]}get byteLength(){let t=0;const{valueOffsets:n,values:r,nullBitmap:i,typeIds:s}=this;return n&&(t+=n.byteLength),r&&(t+=r.byteLength),i&&(t+=i.byteLength),s&&(t+=s.byteLength),this.children.reduce((o,a)=>o+a.byteLength,t)}get nullCount(){let t=this._nullCount,n;return t<=QUe&&(n=this.nullBitmap)&&(this._nullCount=t=this.length-Z2(n,this.offset,this.offset+this.length)),t}getValid(t){if(this.nullable&&this.nullCount>0){const n=this.offset+t;return(this.nullBitmap[n>>3]&1<>3){const{nullBitmap:u}=this._changeLengthAndBackfillNullBitmap(this.length);Object.assign(this,{nullBitmap:u,_nullCount:0})}const{nullBitmap:r,offset:i}=this,s=i+t>>3,o=(i+t)%8,a=r[s]>>o&1;return n?a===0&&(r[s]|=1<>3).fill(255,0,n>>3);i[n>>3]=(1<0&&i.set(s3(this.offset,n,this.nullBitmap),0);const s=this.buffers;return s[Yu.VALIDITY]=i,this.clone(this.type,0,t,r+(t-n),s)}_sliceBuffers(t,n,r,i){let s;const{buffers:o}=this;return(s=o[Yu.TYPE])&&(o[Yu.TYPE]=s.subarray(t,t+n)),(s=o[Yu.OFFSET])&&(o[Yu.OFFSET]=s.subarray(t,t+n+1))||(s=o[Yu.DATA])&&(o[Yu.DATA]=i===6?s:s.subarray(r*t,r*(t+n))),o}_sliceChildren(t,n,r){return t.map(i=>i.slice(n,r))}}Mn.prototype.children=Object.freeze([]);class Y0 extends on{visit(t){return this.getVisitFn(t.type).call(this,t)}visitNull(t){const{["type"]:n,["offset"]:r=0,["length"]:i=0}=t;return new Mn(n,r,i,0)}visitBool(t){const{["type"]:n,["offset"]:r=0}=t,i=Pn(t.nullBitmap),s=Ii(n.ArrayType,t.data),{["length"]:o=s.length>>3,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Mn(n,r,o,a,[void 0,s,i])}visitInt(t){const{["type"]:n,["offset"]:r=0}=t,i=Pn(t.nullBitmap),s=Ii(n.ArrayType,t.data),{["length"]:o=s.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Mn(n,r,o,a,[void 0,s,i])}visitFloat(t){const{["type"]:n,["offset"]:r=0}=t,i=Pn(t.nullBitmap),s=Ii(n.ArrayType,t.data),{["length"]:o=s.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Mn(n,r,o,a,[void 0,s,i])}visitUtf8(t){const{["type"]:n,["offset"]:r=0}=t,i=Pn(t.data),s=Pn(t.nullBitmap),o=Hg(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:u=t.nullBitmap?-1:0}=t;return new Mn(n,r,a,u,[o,i,s])}visitBinary(t){const{["type"]:n,["offset"]:r=0}=t,i=Pn(t.data),s=Pn(t.nullBitmap),o=Hg(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:u=t.nullBitmap?-1:0}=t;return new Mn(n,r,a,u,[o,i,s])}visitFixedSizeBinary(t){const{["type"]:n,["offset"]:r=0}=t,i=Pn(t.nullBitmap),s=Ii(n.ArrayType,t.data),{["length"]:o=s.length/Ga(n),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Mn(n,r,o,a,[void 0,s,i])}visitDate(t){const{["type"]:n,["offset"]:r=0}=t,i=Pn(t.nullBitmap),s=Ii(n.ArrayType,t.data),{["length"]:o=s.length/Ga(n),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Mn(n,r,o,a,[void 0,s,i])}visitTimestamp(t){const{["type"]:n,["offset"]:r=0}=t,i=Pn(t.nullBitmap),s=Ii(n.ArrayType,t.data),{["length"]:o=s.length/Ga(n),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Mn(n,r,o,a,[void 0,s,i])}visitTime(t){const{["type"]:n,["offset"]:r=0}=t,i=Pn(t.nullBitmap),s=Ii(n.ArrayType,t.data),{["length"]:o=s.length/Ga(n),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Mn(n,r,o,a,[void 0,s,i])}visitDecimal(t){const{["type"]:n,["offset"]:r=0}=t,i=Pn(t.nullBitmap),s=Ii(n.ArrayType,t.data),{["length"]:o=s.length/Ga(n),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Mn(n,r,o,a,[void 0,s,i])}visitList(t){const{["type"]:n,["offset"]:r=0,["child"]:i}=t,s=Pn(t.nullBitmap),o=Hg(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:u=t.nullBitmap?-1:0}=t;return new Mn(n,r,a,u,[o,void 0,s],[i])}visitStruct(t){const{["type"]:n,["offset"]:r=0,["children"]:i=[]}=t,s=Pn(t.nullBitmap),{length:o=i.reduce((u,{length:l})=>Math.max(u,l),0),nullCount:a=t.nullBitmap?-1:0}=t;return new Mn(n,r,o,a,[void 0,void 0,s],i)}visitUnion(t){const{["type"]:n,["offset"]:r=0,["children"]:i=[]}=t,s=Pn(t.nullBitmap),o=Ii(n.ArrayType,t.typeIds),{["length"]:a=o.length,["nullCount"]:u=t.nullBitmap?-1:0}=t;if(Qt.isSparseUnion(n))return new Mn(n,r,a,u,[void 0,void 0,s,o],i);const l=Hg(t.valueOffsets);return new Mn(n,r,a,u,[l,void 0,s,o],i)}visitDictionary(t){const{["type"]:n,["offset"]:r=0}=t,i=Pn(t.nullBitmap),s=Ii(n.indices.ArrayType,t.data),{["dictionary"]:o=new _n([new Y0().visit({type:n.dictionary})])}=t,{["length"]:a=s.length,["nullCount"]:u=t.nullBitmap?-1:0}=t;return new Mn(n,r,a,u,[void 0,s,i],[],o)}visitInterval(t){const{["type"]:n,["offset"]:r=0}=t,i=Pn(t.nullBitmap),s=Ii(n.ArrayType,t.data),{["length"]:o=s.length/Ga(n),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Mn(n,r,o,a,[void 0,s,i])}visitFixedSizeList(t){const{["type"]:n,["offset"]:r=0,["child"]:i=new Y0().visit({type:n.valueType})}=t,s=Pn(t.nullBitmap),{["length"]:o=i.length/Ga(n),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Mn(n,r,o,a,[void 0,void 0,s],[i])}visitMap(t){const{["type"]:n,["offset"]:r=0,["child"]:i=new Y0().visit({type:n.childType})}=t,s=Pn(t.nullBitmap),o=Hg(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:u=t.nullBitmap?-1:0}=t;return new Mn(n,r,a,u,[o,void 0,s],[i])}}function Hi(e){return new Y0().visit(e)}class wU{constructor(t=0,n){this.numChunks=t,this.getChunkIterator=n,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndext+n.nullCount,0)}function Tne(e){return e.reduce((t,n,r)=>(t[r+1]=t[r]+n.length,t),new Uint32Array(e.length+1))}function Sne(e,t,n,r){const i=[];for(let s=-1,o=e.length;++s=r)break;if(n>=u+l)continue;if(u>=n&&u+l<=r){i.push(a);continue}const c=Math.max(0,n-u),f=Math.min(r-u,l);i.push(a.slice(c,f-c))}return i.length===0&&i.push(e[0].slice(0,0)),i}function a3(e,t,n,r){let i=0,s=0,o=t.length-1;do{if(i>=o-1)return n0?0:-1}function JUe(e,t){const{nullBitmap:n}=e;if(!n||e.nullCount<=0)return-1;let r=0;for(const i of new o3(n,e.offset+(t||0),e.length,n,bne)){if(!i)return r;++r}return-1}function Vt(e,t,n){if(t===void 0)return-1;if(t===null)return JUe(e,n);const r=zs.getVisitFn(e),i=Km(t);for(let s=(n||0)-1,o=e.length;++s{const i=e.data[r];return i.values.subarray(0,i.length)[Symbol.iterator]()});let n=0;return new wU(e.data.length,r=>{const s=e.data[r].length,o=e.slice(n,n+s);return n+=s,new ZUe(o)})}class ZUe{constructor(t){this.vector=t,this.index=0}next(){return this.indexe+t;class Sf extends on{visitNull(t,n){return 0}visitInt(t,n){return t.type.bitWidth/8}visitFloat(t,n){return t.type.ArrayType.BYTES_PER_ELEMENT}visitBool(t,n){return 1/8}visitDecimal(t,n){return t.type.bitWidth/8}visitDate(t,n){return(t.type.unit+1)*4}visitTime(t,n){return t.type.bitWidth/8}visitTimestamp(t,n){return t.type.unit===sn.SECOND?4:8}visitInterval(t,n){return(t.type.unit+1)*4}visitStruct(t,n){return t.children.reduce((r,i)=>r+ku.visit(i,n),0)}visitFixedSizeBinary(t,n){return t.type.byteWidth}visitMap(t,n){return 8+t.children.reduce((r,i)=>r+ku.visit(i,n),0)}visitDictionary(t,n){var r;return t.type.indices.bitWidth/8+(((r=t.dictionary)===null||r===void 0?void 0:r.getByteLength(t.values[n]))||0)}}const tVe=({valueOffsets:e},t)=>8+(e[t+1]-e[t]),nVe=({valueOffsets:e},t)=>8+(e[t+1]-e[t]),rVe=({valueOffsets:e,stride:t,children:n},r)=>{const i=n[0],{[r*t]:s}=e,{[r*t+1]:o}=e,a=ku.getVisitFn(i.type),u=i.slice(s,o-s);let l=8;for(let c=-1,f=o-s;++c{const r=t[0],i=r.slice(n*e,e),s=ku.getVisitFn(r.type);let o=0;for(let a=-1,u=i.length;++ae.type.mode===Yo.Dense?Ane(e,t):One(e,t),Ane=({type:e,children:t,typeIds:n,valueOffsets:r},i)=>{const s=e.typeIdToChildIndex[n[i]];return 8+ku.visit(t[s],r[i])},One=({children:e},t)=>4+ku.visitMany(e,e.map(()=>t)).reduce(eVe,0);Sf.prototype.visitUtf8=tVe;Sf.prototype.visitBinary=nVe;Sf.prototype.visitList=rVe;Sf.prototype.visitFixedSizeList=iVe;Sf.prototype.visitUnion=sVe;Sf.prototype.visitDenseUnion=Ane;Sf.prototype.visitSparseUnion=One;const ku=new Sf;var Pne;const Rne={},Nne={};class _n{constructor(t){var n,r,i;const s=t[0]instanceof _n?t.flatMap(a=>a.data):t;if(s.length===0||s.some(a=>!(a instanceof Mn)))throw new TypeError("Vector constructor expects an Array of Data instances.");const o=(n=s[0])===null||n===void 0?void 0:n.type;switch(s.length){case 0:this._offsets=[0];break;case 1:{const{get:a,set:u,indexOf:l,byteLength:c}=Rne[o.typeId],f=s[0];this.isValid=d=>u3(f,d),this.get=d=>a(f,d),this.set=(d,h)=>u(f,d,h),this.indexOf=d=>l(f,d),this.getByteLength=d=>c(f,d),this._offsets=[0,f.length];break}default:Object.setPrototypeOf(this,Nne[o.typeId]),this._offsets=Tne(s);break}this.data=s,this.type=o,this.stride=Ga(o),this.numChildren=(i=(r=o.children)===null||r===void 0?void 0:r.length)!==null&&i!==void 0?i:0,this.length=this._offsets[this._offsets.length-1]}get byteLength(){return this._byteLength===-1&&(this._byteLength=this.data.reduce((t,n)=>t+n.byteLength,0)),this._byteLength}get nullCount(){return this._nullCount===-1&&(this._nullCount=wne(this.data)),this._nullCount}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${X[this.type.typeId]}Vector`}isValid(t){return!1}get(t){return null}set(t,n){}indexOf(t,n){return-1}includes(t,n){return this.indexOf(t,n)>0}getByteLength(t){return 0}[Symbol.iterator](){return l3.visit(this)}concat(...t){return new _n(this.data.concat(t.flatMap(n=>n.data).flat(Number.POSITIVE_INFINITY)))}slice(t,n){return new _n(vne(this,t,n,({data:r,_offsets:i},s,o)=>Sne(r,i,s,o)))}toJSON(){return[...this]}toArray(){const{type:t,data:n,length:r,stride:i,ArrayType:s}=this;switch(t.typeId){case X.Int:case X.Float:case X.Decimal:case X.Time:case X.Timestamp:switch(n.length){case 0:return new s;case 1:return n[0].values.subarray(0,r*i);default:return n.reduce((o,{values:a,length:u})=>(o.array.set(a.subarray(0,u*i),o.offset),o.offset+=u*i,o),{array:new s(r*i),offset:0}).array}}return[...this]}toString(){return`[${[...this].join(",")}]`}getChild(t){var n;return this.getChildAt((n=this.type.children)===null||n===void 0?void 0:n.findIndex(r=>r.name===t))}getChildAt(t){return t>-1&&tn[t])):null}get isMemoized(){return Qt.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(Qt.isDictionary(this.type)){const t=new CT(this.data[0].dictionary),n=this.data.map(r=>{const i=r.clone();return i.dictionary=t,i});return new _n(n)}return new CT(this)}unmemoize(){if(Qt.isDictionary(this.type)&&this.isMemoized){const t=this.data[0].dictionary.unmemoize(),n=this.data.map(r=>{const i=r.clone();return i.dictionary=t,i});return new _n(n)}return this}}Pne=Symbol.toStringTag;_n[Pne]=(e=>{e.type=Qt.prototype,e.data=[],e.length=0,e.stride=1,e.numChildren=0,e._nullCount=-1,e._byteLength=-1,e._offsets=new Uint32Array([0]),e[Symbol.isConcatSpreadable]=!0;const t=Object.keys(X).map(n=>X[n]).filter(n=>typeof n=="number"&&n!==X.NONE);for(const n of t){const r=zs.getVisitFnByTypeId(n),i=Go.getVisitFnByTypeId(n),s=xT.getVisitFnByTypeId(n),o=ku.getVisitFnByTypeId(n);Rne[n]={get:r,set:i,indexOf:s,byteLength:o},Nne[n]=Object.create(e,{isValid:{value:kp(u3)},get:{value:kp(zs.getVisitFnByTypeId(n))},set:{value:Ine(Go.getVisitFnByTypeId(n))},indexOf:{value:xne(xT.getVisitFnByTypeId(n))},getByteLength:{value:kp(ku.getVisitFnByTypeId(n))}})}return"Vector"})(_n.prototype);class CT extends _n{constructor(t){super(t.data);const n=this.get,r=this.set,i=this.slice,s=new Array(this.length);Object.defineProperty(this,"get",{value(o){const a=s[o];if(a!==void 0)return a;const u=n.call(this,o);return s[o]=u,u}}),Object.defineProperty(this,"set",{value(o,a){r.call(this,o,a),s[o]=a}}),Object.defineProperty(this,"slice",{value:(o,a)=>new CT(i.call(this,o,a))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new _n(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}}function oVe(e){if(!e||e.length<=0)return function(i){return!0};let t="";const n=e.filter(r=>r===r);return n.length>0&&(t=` + */var b$=new WeakMap,U9e=function(){function e(t){this.observers=new Map,this.obj=t}return e}(),V9e=function(){function e(t,n){this.callback=t,this.observer=n}return e}();function z9e(e){return b$.get(e)}function H9e(e,t){return e.observers.get(t)}function W9e(e,t){e.observers.delete(t.callback)}function q9e(e,t){t.unobserve()}function Y9e(e,t){var n=[],r,i=z9e(e);if(!i)i=new U9e(e),b$.set(e,i);else{var s=H9e(i,t);r=s&&s.observer}if(r)return r;if(r={},i.value=Ds(e),t){r.callback=t,r.next=null;var o=function(){H2(r)},a=function(){clearTimeout(r.next),r.next=setTimeout(o)};typeof window<"u"&&(window.addEventListener("mouseup",a),window.addEventListener("keyup",a),window.addEventListener("mousedown",a),window.addEventListener("keydown",a),window.addEventListener("change",a))}return r.patches=n,r.object=e,r.unobserve=function(){H2(r),clearTimeout(r.next),W9e(i,r),typeof window<"u"&&(window.removeEventListener("mouseup",a),window.removeEventListener("keyup",a),window.removeEventListener("mousedown",a),window.removeEventListener("keydown",a),window.removeEventListener("change",a))},i.observers.set(t,new V9e(t,r)),r}function H2(e,t){t===void 0&&(t=!1);var n=b$.get(e.object);E$(n.value,e.object,e.patches,"",t),e.patches.length&&VI(n.value,e.patches);var r=e.patches;return r.length>0&&(e.patches=[],e.callback&&e.callback(r)),r}function E$(e,t,n,r,i){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var s=U2(t),o=U2(e),a=!1,u=o.length-1;u>=0;u--){var l=o[u],c=e[l];if(j2(t,l)&&!(t[l]===void 0&&c!==void 0&&Array.isArray(t)===!1)){var f=t[l];typeof c=="object"&&c!=null&&typeof f=="object"&&f!=null&&Array.isArray(c)===Array.isArray(f)?E$(c,f,n,r+"/"+Bf(l),i):c!==f&&(i&&n.push({op:"test",path:r+"/"+Bf(l),value:Ds(c)}),n.push({op:"replace",path:r+"/"+Bf(l),value:Ds(f)}))}else Array.isArray(e)===Array.isArray(t)?(i&&n.push({op:"test",path:r+"/"+Bf(l),value:Ds(c)}),n.push({op:"remove",path:r+"/"+Bf(l)}),a=!0):(i&&n.push({op:"test",path:r,value:e}),n.push({op:"replace",path:r,value:t}))}if(!(!a&&s.length==o.length))for(var u=0;u(e.TRAVERSAL_START="Traversal_Start",e.TRAVERSAL_END="Traversal_End",e))(l0||{});function db(e,t){const n=e.state;if(n.type==="checkpoint")return n.val;const{checkpointRef:r}=n,i=t[r],s=jee(i,e,t);s.shift();const o=s.map(u=>t[u]).map(u=>u.state.val).reduce((u,l)=>[...u,...l],[]),a=db(i,t);return VI(a,Ds(o),!0,!1).newDocument}function K9e(e,t){const n=Object.keys(e).length;return new Set(t.map(r=>r.path.split("/")[0])).size{n=!0}),r.listen(l0.TRAVERSAL_END,()=>{n=!1});const o={add(c,f=i.current.id){i.update(i.addMetadata({id:f,meta:c}))},latestOfType(c,f=i.current.id){var d;return(d=i.backend.nodes[f].meta[c])==null?void 0:d.at(-1)},allOfType(c,f=i.current.id){return i.backend.nodes[f].meta[c]},latest(c=i.current.id){const f=i.backend.nodes[c].meta,d=Object.keys(f).reduce((h,p)=>{const m=f[p].at(-1);return m&&(h[p]=m),h},{});return Object.keys(d).length>0?d:void 0},all(c=i.current.id){return i.backend.nodes[c].meta},types(c=i.current.id){return Object.keys(i.backend.nodes[c].meta)}},a={add(c,f=i.current.id){i.update(i.addArtifact({id:f,artifact:c}))},latest(c=i.current.id){return i.backend.nodes[c].artifacts.at(-1)},all(c=i.current.id){return i.backend.nodes[c].artifacts}},u={add(c,f=i.current.id){o.add({annotation:c},f)},latest(c=i.current.id){var f;return(f=o.latestOfType("annotation",c))==null?void 0:f.val},all(c=i.current.id){var f;return(f=o.allOfType("annotation",c))==null?void 0:f.map(d=>d.val)}},l={add(c=i.current.id){o.add({bookmark:!0},c)},remove(c=i.current.id){o.add({bookmark:!1},c)},is(c=i.current.id){var f;return!!((f=o.latestOfType("bookmark",c))!=null&&f.val)},toggle(c=i.current.id){l.is(c)?l.remove(c):l.add(c)}};return{registry:e,get isTraversing(){return n},getState(c=i.current){return db(c,i.backend.nodes)},graph:i,get current(){return i.current},get root(){return i.root},record({label:c,state:f,sideEffects:d,eventType:h,onlySideEffects:p=!1}){let m=null,y=null;const g=db(this.current,this.graph.backend.nodes);if(p)y={type:"checkpoint",val:f};else{const _=Bee(g,f);if(K9e(f,_)==="checkpoint")y={type:"checkpoint",val:f};else{const b=this.current.state.type==="checkpoint"?this.current.id:this.current.state.checkpointRef;y={type:"patch",val:_,checkpointRef:b}}}if(!y)throw new Error(`Could not calculate new state. Previous state is: ${JSON.stringify(this.current.state,null,2)}`);if(m=v9e({label:c,state:y,parent:this.current,sideEffects:d,event:h}),!m)throw new Error("State Node creation failed!");i.update(i.addNode(m))},async apply(c,f){const d=e.get(f.type),h=db(this.current,this.graph.backend.nodes);if(d.config.hasSideEffects){const{do:p=f,undo:m}=d.func(f.payload);this.record({label:c,state:h,sideEffects:{do:[p],undo:[m]},eventType:d.config.eventType})}else{const p=d.func(h,f.payload);this.record({label:c,state:p,sideEffects:{do:[],undo:[]},eventType:d.config.eventType})}},async to(c){r.fire(l0.TRAVERSAL_START);const f=jee(i.current,i.backend.nodes[c],i.backend.nodes),d=[];for(let h=0;h0?this.to(f.children[c==="oldest"?0:f.children.length-1]):Promise.resolve(console.warn("Already at latest in this branch!"))},currentChange(c,f=!1){return i.currentChange(c,{skipOnNew:f})},done(){console.log("Setup later for URL sharing.")},tree(){return Uee(i.root,i.backend.nodes)},on(c,f){r.listen(c,f)},export(){return JSON.stringify(i.backend)},exportObject(){return JSON.parse(JSON.stringify(i.backend))},import(c){const f=JSON.parse(c),d=f.current;f.current=f.root,i.update(i.load(f)),this.to(d)},importObject(c){const f=c.current;c.current=c.root,i.update(i.load(c)),this.to(f)},metadata:o,artifact:a,annotations:u,bookmarks:l}}function X9e(e,t,n){let[r,i]=[e,t];r.level>i.level&&([r,i]=[i,r]);let s=i.level-r.level;for(;wu(i)&&s!==0;)i=n[i.parent],s-=1;if(r.id===i.id)return r.id;for(;r.id!==i.id;)wu(r)&&(r=n[r.parent]),wu(i)&&(i=n[i.parent]);return r.id}function jee(e,t,n){const r=X9e(e,t,n),i=n[r],s=[],o=[];let[a,u]=[e,t];for(;a.id!==i.id;)s.push(a),wu(a)&&(a=n[a.parent]);for(s.push(a);u.id!==i.id;)o.push(u),wu(u)&&(u=n[u.parent]);const l=o.reverse();return[...s,...l].map(c=>c.id)}function J9e(e,t){if(wu(e)&&e.parent===t.id)return!0;if(wu(t)&&t.parent===e.id)return!1;throw new Error("Incorrect use of function. Nodes are not connected to each other.")}function Uee(e,t){return{...e,children:e.children.map(n=>Uee(t[n],t)),name:`${e.label}`}}I9e();function Z9e(e){return e.length===2?N9e(e):e}class w${static create(){return new w$}constructor(){this.registry=new Map}has(t){return this.registry.has(t)}register(t,n,r){const i=n.length===2;if(n.length>2)throw new Error("Incorrect action function signature. Action function can only have two arguments at most!");if(this.has(t))throw new Error(`Already registered: ${t}`);const{label:s=t,eventType:o=t}=r||{};return this.registry.set(t,{func:Z9e(n),config:{hasSideEffects:!i,label:typeof s=="string"?()=>s:s,eventType:o}}),vu(t)}get(t){const n=this.registry.get(t);if(!n)throw new Error(`Not registered: ${t}`);return n}}var eBe="Expected a function",iU=NaN,tBe="[object Symbol]",nBe=/^\s+|\s+$/g,rBe=/^[-+]0x[0-9a-f]+$/i,iBe=/^0b[01]+$/i,sBe=/^0o[0-7]+$/i,oBe=parseInt,aBe=typeof io=="object"&&io&&io.Object===Object&&io,uBe=typeof self=="object"&&self&&self.Object===Object&&self,lBe=aBe||uBe||Function("return this")(),cBe=Object.prototype,fBe=cBe.toString,dBe=Math.max,hBe=Math.min,VA=function(){return lBe.Date.now()};function pBe(e,t,n){var r,i,s,o,a,u,l=0,c=!1,f=!1,d=!0;if(typeof e!="function")throw new TypeError(eBe);t=sU(t)||0,W2(n)&&(c=!!n.leading,f="maxWait"in n,s=f?dBe(sU(n.maxWait)||0,t):s,d="trailing"in n?!!n.trailing:d);function h(E){var S=r,A=i;return r=i=void 0,l=E,o=e.apply(A,S),o}function p(E){return l=E,a=setTimeout(g,t),c?h(E):o}function m(E){var S=E-u,A=E-l,P=t-S;return f?hBe(P,s-A):P}function y(E){var S=E-u,A=E-l;return u===void 0||S>=t||S<0||f&&A>=s}function g(){var E=VA();if(y(E))return _(E);a=setTimeout(g,m(E))}function _(E){return a=void 0,d&&r?h(E):(r=i=void 0,o)}function b(){a!==void 0&&clearTimeout(a),l=0,r=u=i=a=void 0}function T(){return a===void 0?o:_(VA())}function I(){var E=VA(),S=y(E);if(r=arguments,i=this,u=E,S){if(a===void 0)return p(u);if(f)return a=setTimeout(g,t),h(u)}return a===void 0&&(a=setTimeout(g,t)),o}return I.cancel=b,I.flush=T,I}function W2(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function mBe(e){return!!e&&typeof e=="object"}function gBe(e){return typeof e=="symbol"||mBe(e)&&fBe.call(e)==tBe}function sU(e){if(typeof e=="number")return e;if(gBe(e))return iU;if(W2(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=W2(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(nBe,"");var n=iBe.test(e);return n||sBe.test(e)?oBe(e.slice(2),n?2:8):rBe.test(e)?iU:+e}var yBe=pBe;const ja=ka(yBe);function Vee({xScale:e,yRange:t,vertPosition:n,ticks:r,isDate:i=!1,showLines:s=!0}){const o=w.useMemo(()=>r.length>1?Math.abs(r[1].offset-r[0].offset):e.range()[0]-e.range()[1],[r,e]),a=w.useCallback(u=>(i?h$("%b%e, %Y"):zc(".2s"))(u),[i]);return $.jsxs($.Fragment,{children:[s?$.jsx("path",{transform:`translate(0, ${t[1]})`,d:["M",e.range()[0],0,"H",e.range()[1]].join(" "),fill:"none",stroke:"lightgray"}):null,r.map(({value:u,offset:l})=>$.jsxs("g",{transform:`translate(${l}, ${n})`,children:[$.jsx("line",{y2:"6",stroke:"currentColor"}),s?$.jsx("line",{y2:`${-(t[0]-t[1])}`,stroke:"lightgray"}):null,$.jsx("foreignObject",{x:0-o/2,y:10,width:o,height:20,children:$.jsx(Nd,{children:$.jsx(SQ,{withinPortal:!0,label:u,children:$.jsx(Tt,{px:2,size:10,style:{textAlign:"center",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},children:+u==0?0:a(i?new Date(u):u)})})})})]},u))]})}const _Be=Object.freeze(Object.defineProperty({__proto__:null,XAxis:Vee},Symbol.toStringTag,{value:"Module"}));function zee({dataset:e,yScale:t,xRange:n,horizontalPosition:r}){const i=w.useMemo(()=>t.ticks(6).map(o=>({value:o,yOffset:t(o)})),[t]),s=w.useMemo(()=>e==="clean_stocks"?zc(",.0%"):t.domain()[1]<5?zc(",.2r"):zc(",.0f"),[e,t]);return $.jsx($.Fragment,{children:i.map(({value:o,yOffset:a})=>$.jsxs("g",{transform:`translate(${r}, ${a})`,children:[$.jsx("line",{x2:`${n[1]-n[0]}`,stroke:`${o===0?"black":"gainsboro"}`,strokeWidth:o===0?1:.4}),$.jsx("text",{style:{dominantBaseline:"middle",fontSize:"10px",textAnchor:"end",transform:"translateX(-6px)",fill:"black",font:"Roboto"},children:s(o)},o)]},o))})}const vBe=Object.freeze(Object.defineProperty({__proto__:null,YAxis:zee},Symbol.toStringTag,{value:"Module"})),Qs={top:30,left:40,right:100,bottom:50};function q2({parameters:e,data:t,items:n,selection:r,range:i,guardrail:s}){const[o,a]=w.useState(null),u=P=>r!=null&&r.includes(P)?!o||o.length===0?!0:o.includes(P):!1,l=w.useMemo(()=>{const P=n.filter(M=>r==null?void 0:r.includes(M.name)).map(M=>M.group);return n.filter(M=>P==null?void 0:P.includes(M.group)).filter(M=>!(r!=null&&r.includes(M.name))).map(M=>M.name)},[r,n]),c=w.useMemo(()=>{const P=n.map(J=>J.group),V=t.filter(J=>P==null?void 0:P.includes(J[e.group_var]));return[...B5e(V,J=>({mean:CA(J,.5,Y=>Y[e.y_var]),upperq:CA(J,.75,Y=>Y[e.y_var]),lowerq:CA(J,.25,Y=>Y[e.y_var])}),J=>J[e.x_var])].flatMap(([J,Y])=>({date:J,mean:Y.mean,upperq:Y.upperq,lowerq:Y.lowerq}))},[t,n,e]),f=800-Qs.left-Qs.right,d=400-Qs.top-Qs.bottom,{xMin:h,yMin:p,xMax:m,yMax:y}=w.useMemo(()=>{let P=[];switch(s){case"super_data":P=r==null?void 0:r.concat(l);break;default:P=r;break}const V=t.map(K=>+K[e.x_var]).filter(K=>K!==null),[M,H]=Cp(V),J=t.filter(K=>P.includes(K[e.cat_var])).map(K=>+K[e.y_var]).filter(K=>K!==null),[Y,ye]=e.dataset==="clean_stocks"?Cp(J):[0,Cp(J)[1]],[he,ve]=[sT(c.map(K=>K.lowerq)),iT(c.map(K=>K.upperq))],te=s==="super_summ"?sT([Y,he]):Y,se=s==="super_summ"?iT([ye,ve]):ye;return{xMin:M,xMax:H,yMin:te,yMax:se}},[t,r,i,s]),g=w.useMemo(()=>i?Dy([Qs.left,f+Qs.left]).domain(i):Dy([Qs.left,f+Qs.left]).domain([new Date(e.start_date),new Date(e.end_date)]),[f,m,h,i]),_=w.useMemo(()=>FI([d+Qs.top,Qs.top]).domain([p,y]).nice(),[d,y,p]),b=w.useMemo(()=>{const P=Array.from(new Set(t.map(V=>V[e.cat_var])));return a$(e$).domain(P)},[t]),T=w.useMemo(()=>{if(!g||!_)return;const P=H0();return P.x(M=>g(nd("%Y-%m-%d")(M[e.x_var]))),P.y(M=>_(M[e.y_var])),P.curve(tp),r==null?void 0:r.map(M=>({country:M,path:P(t.filter(H=>H[e.cat_var]===M))}))},[t,g,_,r,m,s]),I=w.useMemo(()=>{if(s!=="super_data")return null;const P=H0();return P.x(M=>g(nd("%Y-%m-%d")(M[e.x_var]))),P.y(M=>_(M[e.y_var])),P.curve(tp),l==null?void 0:l.map(M=>({country:M,path:P(t.filter(H=>H[e.cat_var]===M))}))},[t,g,_,r,m,s]),E=w.useMemo(()=>{if(s!=="super_summ")return null;const P=H0();P.x(J=>g(nd("%Y-%m-%d")(J.date))),P.y(J=>_(J.mean)),P.curve(tp);const V=P(c),M=kee();M.x(J=>g(nd("%Y-%m-%d")(J.date))),M.y0(J=>_(J.lowerq)),M.y1(J=>_(J.upperq)),M.curve(tp);const H=M(c);return{meanLine:V,confidenceBands:H,data:c}},[t,g,_,r,m,s]),S=w.useMemo(()=>e.dataset==="clean_stocks"?"Market Index":"Average",[e]),A=w.useMemo(()=>{let V=null;switch(s){case"super_data":V=r==null?void 0:r.concat(I==null?void 0:I.map(H=>H.country));break;case"super_summ":V=r==null?void 0:r.concat([S]);break;default:V=r;break}const M=V==null?void 0:V.map(H=>({country:H,label_pos:H===S?E==null?void 0:E.data.slice(-1).map(J=>_(J.mean))[0]:t.filter(J=>J[e.cat_var]===H).slice(-1).map(J=>_(J[e.y_var]))[0]})).sort((H,J)=>H.label_pos=10||(M[H].label_pos=M[H].label_pos-10+J)}return M},[t,r,_,s]);return(r==null?void 0:r.length)===0?$.jsx(Nd,{style:{width:"800px",height:"400px"},children:$.jsx(Tt,{fs:"italic",c:"dimmed",children:"Select an item to view the chart."})}):$.jsxs("svg",{id:"baseLineChart",style:{height:"400px",width:"800px",fontFamily:'"Helvetica Neue", "Helvetica", "Arial", sans-serif'},children:[$.jsxs("g",{id:"axes",children:[$.jsx(Vee,{isDate:!0,xScale:g,yRange:_.range(),vertPosition:d+Qs.top,showLines:!1,ticks:g.ticks(6).map(P=>({value:P.toString(),offset:g(P)}))}),$.jsx(zee,{dataset:e.dataset,yScale:_,horizontalPosition:Qs.left,xRange:g.range()})]}),$.jsx("svg",{style:{width:`${f}`},children:I==null?void 0:I.map(P=>$.jsx("g",{children:$.jsx("path",{id:`${P.country}`,fill:"none",stroke:u(P.country)?b(P.country):"gray",strokeDasharray:"4,1",strokeWidth:.5,d:P.path},`${P.country}_key`)},`${P.country}_g`))},"control_lines"),$.jsx("svg",{style:{width:`${f}`},children:E?$.jsxs("g",{children:[$.jsx("path",{id:"confidenceBands",fill:"lightgray",opacity:.25,stroke:"none",d:E.confidenceBands},"confidenceBands_key"),$.jsx("path",{id:"meanLine",fill:"none",stroke:"gray",strokeDasharray:"4,1",strokeWidth:.5,d:E.meanLine},"meanLine_key")]},"summary_g"):null},"control_bands"),$.jsxs("svg",{style:{width:`${f}`},children:[T==null?void 0:T.map(P=>$.jsx("g",{children:$.jsx("path",{id:`${P.country}`,fill:"none",stroke:u(P.country)?b(P.country):"gainsboro",strokeWidth:o!=null&&o.includes(P.country)?2:1.5,d:P.path},`${P.country}_key`)},`${P.country}_g`)),A==null?void 0:A.map(P=>$.jsx("foreignObject",{x:f+Qs.left+5,y:P.label_pos-7,width:100,height:20,children:$.jsx(Tt,{px:2,size:10,color:u(P.country)?b(P.country):"silver",onMouseOver:V=>{const M=V.target;r!=null&&r.includes(M.innerText)&&a([M.innerText])},onMouseOut:()=>a([]),children:P.country.includes("Policy")?P.country.split("(Policy")[0]:P.country})},`${P.country}_label`))]},"lines")]})}const bBe=Object.freeze(Object.defineProperty({__proto__:null,LineChart:q2,default:q2},Symbol.toStringTag,{value:"Module"})),Ih={top:0,left:0,right:0,bottom:0},oU=20,zA=60;function Y2({parameters:e,data:t,items:n,selection:r,setSelection:i,trackSelection:s,range:o,guardrail:a}){const u=w.useMemo(()=>o?Dy([Ih.left,zA+Ih.left]).domain(o):Dy([Ih.left,zA+Ih.left]).domain([new Date(e.start_date),new Date(e.end_date)]),[e,o]),l=w.useMemo(()=>{const d=t.filter(m=>n==null?void 0:n.map(y=>y.name).includes(m[e.cat_var])).map(m=>+m[e.y_var]).filter(m=>m!==null),[h,p]=Cp(d);return FI([oU+Ih.top,Ih.top]).domain([h,p]).nice()},[e,t,n]),c=w.useMemo(()=>{const d=Array.from(new Set(t.map(h=>h[e.cat_var])));return a$(e$).domain(d)},[e,t]),f=w.useMemo(()=>{if(a!=="juxt_data")return null;const d=kee();d.x(m=>u(nd("%Y-%m-%d")(m[e.x_var]))),d.y0(()=>l(0)),d.y1(m=>l(m[e.y_var])),d.curve(tp);const h=H0();return h.x(m=>u(nd("%Y-%m-%d")(m[e.x_var]))),h.y(m=>l(m[e.y_var])),h.curve(tp),n==null?void 0:n.map(m=>({country:m.name,path:h(t.filter(y=>y[e.cat_var]===m.name)),area:d(t.filter(y=>y[e.cat_var]===m.name))}))},[e,a,t,n,u,l]);return $.jsx(Qp.Group,{orientation:"vertical",onChange:d=>{i(d),s(d)},spacing:0,offset:"sm",children:n==null?void 0:n.map(d=>$.jsxs($.Fragment,{children:[d.name==="Eldoril North"?$.jsx(gd,{size:"xs",label:"Policy A",labelPosition:"left",color:"black"}):null,d.name==="Eldoril West"?$.jsx(gd,{size:"xs",label:"Policy B",labelPosition:"left",color:"black"}):null,d.name==="Silvoria North"?$.jsx(gd,{size:"xs",label:"Policy C",labelPosition:"left",color:"black"}):null,$.jsxs(il,{grow:!0,gutter:8,columns:2,children:[$.jsx(il.Col,{span:1,children:$.jsx(Qp,{value:d.name,label:d.name.includes("Policy")?d.name.split("(Policy")[0]:d.name,styles:a==="juxt_data"?{root:{display:"flex",alignItems:"flex-end",padding:"2px 0"}}:{},children:d.name},`${d.name}_checkbox`)},`${d.name}_grid1`),$.jsx(il.Col,{span:a==="juxt_data"?"auto":3,children:$.jsxs("svg",{style:{width:`${zA}`,height:`${oU}`},children:[$.jsx("path",{id:`${d.name}_sparkarea`,fill:r!=null&&r.includes(d.name)?c(d.name):"gray",stroke:"none",opacity:.25,d:f==null?void 0:f.filter(h=>h.country===d.name)[0].area},`${d.name}_sparkarea`),$.jsx("path",{id:`${d.name}_spark`,fill:"none",stroke:r!=null&&r.includes(d.name)?c(d.name):"gray",strokeWidth:.75,d:f==null?void 0:f.filter(h=>h.country===d.name)[0].path},`${d.name}_spark`)]},`${d.name}_sparksvg`)},`${d.name}_grid2`)]},`${d.name}_grid`)]}))})}const EBe=Object.freeze(Object.defineProperty({__proto__:null,Sidebar:Y2,default:Y2},Symbol.toStringTag,{value:"Module"}));function G2({parameters:e,setRange:t,trackRange:n}){function r(s){return Dy([0,100]).domain([new Date(e.start_date),new Date(e.end_date)]).invert(s)}function i(s){const o=r(s);return h$("%b %e, %Y")(o)}return $.jsx(XQ,{defaultValue:[0,100],label:s=>i(s),labelAlwaysOn:!0,disabled:!e.allow_time_slider,onChange:([s,o])=>{t([r(s),r(o)]),n([r(s),r(o)])}})}const wBe=Object.freeze(Object.defineProperty({__proto__:null,RangeSelector:G2,default:G2},Symbol.toStringTag,{value:"Module"}));function K2({guardrail:e,setGuardrail:t}){return $.jsxs($.Fragment,{children:[$.jsx(Tt,{children:"Guardrail:"}),$.jsx(MQ,{value:e,onChange:t,data:[{value:"none",label:"none"},{value:"super_data",label:"super_data"},{value:"super_summ",label:"super_summ"},{value:"juxt_data",label:"juxt_data"},{value:"juxt_summ",label:"juxt_summ"}]})]})}const TBe=Object.freeze(Object.defineProperty({__proto__:null,Selector:K2,default:K2},Symbol.toStringTag,{value:"Module"})),yn=Array.isArray;function Vs(e){return e!=null?yn(e)?e:[e]:[]}function SBe(e=0,t=1/0){return`${aU(e)} < row_number() && row_number() <= ${aU(t)}`}function aU(e){return e<0?`count() + ${e}`:e}class Hee{constructor(t){t&&(this._params=t)}params(t){return arguments.length?(t&&(this._params={...this._params,...t}),this):this._params}reify(t){return this.__reify(this,t)}count(t){return this.__count(this,t)}derive(t,n){return this.__derive(this,t,n)}filter(t){return this.__filter(this,t)}slice(t,n){return this.filter(SBe(t,n)).reify()}groupby(...t){return this.__groupby(this,t.flat())}orderby(...t){return this.__orderby(this,t.flat())}relocate(t,n){return this.__relocate(this,Vs(t),n)}rename(...t){return this.__rename(this,t.flat())}rollup(t){return this.__rollup(this,t)}sample(t,n){return this.__sample(this,t,n)}select(...t){return this.__select(this,t.flat())}ungroup(){return this.__ungroup(this)}unorder(){return this.__unorder(this)}dedupe(...t){return this.__dedupe(this,t.flat())}impute(t,n){return this.__impute(this,t,n)}fold(t,n){return this.__fold(this,t,n)}pivot(t,n,r){return this.__pivot(this,t,n,r)}spread(t,n){return this.__spread(this,t,n)}unroll(t,n){return this.__unroll(this,t,n)}lookup(t,n,...r){return this.__lookup(this,t,n,r.flat())}join(t,n,r,i){return this.__join(this,t,n,r,i)}join_left(t,n,r,i){const s={...i,left:!0,right:!1};return this.__join(this,t,n,r,s)}join_right(t,n,r,i){const s={...i,left:!1,right:!0};return this.__join(this,t,n,r,s)}join_full(t,n,r,i){const s={...i,left:!0,right:!0};return this.__join(this,t,n,r,s)}cross(t,n,r){return this.__cross(this,t,n,r)}semijoin(t,n){return this.__semijoin(this,t,n)}antijoin(t,n){return this.__antijoin(this,t,n)}concat(...t){return this.__concat(this,t.flat())}union(...t){return this.__union(this,t.flat())}intersect(...t){return this.__intersect(this,t.flat())}except(...t){return this.__except(this,t.flat())}}function jt(e){throw Error(e)}function cs(e){return typeof e=="number"}function er(e){return typeof e=="function"}function zI(e,t){const n=Array(e);if(er(t))for(let r=0;r=0;a=s.next(a+1))r[++o]=a;else for(let a=0;aa(l,c,u))}return(t||!i)&&(this._index=r),r}partitions(t=!0){if(this._partitions)return this._partitions;if(!this.isGrouped())return[this.indices(t)];const{keys:n,size:r}=this._group,i=zI(r,()=>[]),s=this._index,o=this.mask(),a=this.numRows();if(s&&this.isOrdered())for(let u=0,l;u=0;u=o.next(u+1))i[n[u]].push(u);else for(let u=0;uu(f,d,l))}return(t||!this.isOrdered())&&(this._partitions=i),i}scan(t,n,r=1/0,i=0){const s=this._mask,o=this._nrows,a=this._data;let u=i||0;if(u>o)return;const l=Math.min(o,u+r),c=()=>u=this._total;if(n&&this.isOrdered()||s&&this._index){const f=this.indices(),d=this._data;for(;u-1;u=s.next(u+1))t(u,a,c)}else for(;ur.push(s),!0,n-t,t),this.reify(r)}reduce(t){return this.__reduce(this,t)}},xBe=class{constructor(t){this.data=t}get length(){return this.data.length}get(t){return this.data[t]}[Symbol.iterator](){return this.data[Symbol.iterator]()}},CBe=function(e){return e&&er(e.get)?e:new xBe(e)};function Ol(e){return e instanceof Date}function Xi(e){return e===Object(e)}function vT(e){return e instanceof RegExp}function Li(e){return typeof e=="string"}function ABe(e,t){const n=r=>jt(`Illegal argument type: ${r||typeof e}`);return e instanceof Map?uU(e.entries(),t):Ol(e)?n("Date"):vT(e)?n("RegExp"):Li(e)?n():yn(e)?OBe(e,t):er(e[Symbol.iterator])?PBe(e,t):Xi(e)?uU(Object.entries(e),t):n()}function uU(e,t=["key","value"]){const n=[],r=[];for(const[s,o]of e)n.push(s),r.push(o);const i={};return t[0]&&(i[t[0]]=n),t[1]&&(i[t[1]]=r),i}function OBe(e,t){const n=e.length,r={},i=s=>r[s]=Array(n);if(n){t=t||Object.keys(e[0]);const s=t.map(i),o=s.length;for(let a=0;an[o]=[];let i,s;for(const o of e){i||(t=t||Object.keys(o),i=t.map(r),s=i.length);for(let a=0;ard(e)||Li(e),kBe={compact:e=>rd(e)?e.filter(t=>Ea(t)):e,concat:(...e)=>[].concat(...e),includes:(e,t,n)=>Vg(e)?e.includes(t,n):!1,indexof:(e,t)=>Vg(e)?e.indexOf(t):-1,join:(e,t)=>rd(e)?e.join(t):dn,lastindexof:(e,t)=>Vg(e)?e.lastIndexOf(t):-1,length:e=>Vg(e)?e.length:0,pluck:(e,t)=>rd(e)?e.map(n=>Ea(n)?n[t]:dn):dn,reverse:e=>rd(e)?e.slice().reverse():Li(e)?e.split("").reverse().join(""):dn,slice:(e,t,n)=>Vg(e)?e.slice(t,n):dn};function DBe(e,t,n,r,i){return e==null?null:en?1/0:(e=Math.max(t,Math.min(e,n)),t+r*Math.floor(1e-14+(e-t)/r+(i||0)))}function hb(e,t,n="0"){const r=e+"",i=r.length;return i(e<10?"0":"")+e,$Be=e=>e<0?"-"+hb(-e,6):e>9999?"+"+hb(e,6):hb(e,4);function Wee(e,t,n,r,i,s,o,a,u){const l=a?"Z":"";return $Be(e)+"-"+Fa(t+1)+"-"+Fa(n)+(!u||o?"T"+Fa(r)+":"+Fa(i)+":"+Fa(s)+"."+hb(o,3)+l:s?"T"+Fa(r)+":"+Fa(i)+":"+Fa(s)+l:i||r||!a?"T"+Fa(r)+":"+Fa(i)+l:"")}function qee(e,t){return isNaN(e)?"Invalid Date":Wee(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds(),!1,t)}function HI(e,t){return isNaN(e)?"Invalid Date":Wee(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds(),!0,t)}const LBe=/^([-+]\d{2})?\d{4}(-\d{2}(-\d{2})?)?(T\d{2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|[-+]\d{2}:\d{2})?)?$/;function MBe(e){return e.match(LBe)}function FBe(e,t=Date.parse){return MBe(e)?t(e):e}const Yee=6e4,Gee=864e5,Kee=6048e5,Sr=new Date,xr=new Date,Rr=e=>(Sr.setTime(typeof e=="string"?FBe(e):e),Sr);function BBe(e,t,n,r,i,s,o){return arguments.length?new Date(e,t||0,n??1,r||0,i||0,s||0,o||0):new Date(Date.now())}function jBe(e,t,n,r,i,s,o){return arguments.length?new Date(Date.UTC(e,t||0,n??1,r||0,i||0,s||0,o||0)):new Date(Date.now())}function UBe(e){xr.setTime(+e),xr.setHours(0,0,0,0),Sr.setTime(+xr),Sr.setMonth(0),Sr.setDate(1);const t=(xr.getTimezoneOffset()-Sr.getTimezoneOffset())*Yee;return Math.floor(1+(xr-Sr-t)/Gee)}function VBe(e){xr.setTime(+e),xr.setUTCHours(0,0,0,0);const t=Date.UTC(xr.getUTCFullYear(),0,1);return Math.floor(1+(xr-t)/Gee)}function zBe(e,t){const n=t||0;xr.setTime(+e),xr.setDate(xr.getDate()-(xr.getDay()+7-n)%7),xr.setHours(0,0,0,0),Sr.setTime(+e),Sr.setMonth(0),Sr.setDate(1),Sr.setDate(1-(Sr.getDay()+7-n)%7),Sr.setHours(0,0,0,0);const r=(xr.getTimezoneOffset()-Sr.getTimezoneOffset())*Yee;return Math.floor((1+(xr-Sr)-r)/Kee)}function HBe(e,t){const n=t||0;return xr.setTime(+e),xr.setUTCDate(xr.getUTCDate()-(xr.getUTCDay()+7-n)%7),xr.setUTCHours(0,0,0,0),Sr.setTime(+e),Sr.setUTCMonth(0),Sr.setUTCDate(1),Sr.setUTCDate(1-(Sr.getUTCDay()+7-n)%7),Sr.setUTCHours(0,0,0,0),Math.floor((1+(xr-Sr))/Kee)}const WBe={format_date:(e,t)=>qee(Rr(e),!t),format_utcdate:(e,t)=>HI(Rr(e),!t),timestamp:e=>+Rr(e),year:e=>Rr(e).getFullYear(),quarter:e=>Math.floor(Rr(e).getMonth()/3),month:e=>Rr(e).getMonth(),date:e=>Rr(e).getDate(),dayofweek:e=>Rr(e).getDay(),hours:e=>Rr(e).getHours(),minutes:e=>Rr(e).getMinutes(),seconds:e=>Rr(e).getSeconds(),milliseconds:e=>Rr(e).getMilliseconds(),utcyear:e=>Rr(e).getUTCFullYear(),utcquarter:e=>Math.floor(Rr(e).getUTCMonth()/3),utcmonth:e=>Rr(e).getUTCMonth(),utcdate:e=>Rr(e).getUTCDate(),utcdayofweek:e=>Rr(e).getUTCDay(),utchours:e=>Rr(e).getUTCHours(),utcminutes:e=>Rr(e).getUTCMinutes(),utcseconds:e=>Rr(e).getUTCSeconds(),utcmilliseconds:e=>Rr(e).getUTCMilliseconds(),datetime:BBe,dayofyear:UBe,week:zBe,utcdatetime:jBe,utcdayofyear:VBe,utcweek:HBe,now:Date.now};function T$(e,t){return e==null||t==null||e!==e||t!==t?!1:e===t?!0:Ol(e)||Ol(t)?+e==+t:vT(e)&&vT(t)?e+""==t+"":Xi(e)&&Xi(t)?qBe(e,t):!1}function qBe(e,t){if(Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;if(e.length||t.length)return cU(e,t);const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length||(n.sort(),r.sort(),!cU(n,r,(s,o)=>s===o)))return!1;const i=n.length;for(let s=0;sJSON.parse(e),to_json:e=>JSON.stringify(e)};let GBe=Math.random;function Ym(){return GBe()}const KBe={random:Ym,is_nan:Number.isNaN,is_finite:Number.isFinite,abs:Math.abs,cbrt:Math.cbrt,ceil:Math.ceil,clz32:Math.clz32,exp:Math.exp,expm1:Math.expm1,floor:Math.floor,fround:Math.fround,greatest:Math.max,least:Math.min,log:Math.log,log10:Math.log10,log1p:Math.log1p,log2:Math.log2,pow:Math.pow,round:Math.round,sign:Math.sign,sqrt:Math.sqrt,trunc:Math.trunc,degrees:e=>180*e/Math.PI,radians:e=>Math.PI*e/180,acos:Math.acos,acosh:Math.acosh,asin:Math.asin,asinh:Math.asinh,atan:Math.atan,atan2:Math.atan2,atanh:Math.atanh,cos:Math.cos,cosh:Math.cosh,sin:Math.sin,sinh:Math.sinh,tan:Math.tan,tanh:Math.tanh};function S$(e){return e instanceof Map}function QBe(e){return e instanceof Set}function pb(e){return S$(e)||QBe(e)}function HA(e){return Array.from(e)}const XBe={has:(e,t)=>pb(e)?e.has(t):e!=null?Pa(e,t):!1,keys:e=>S$(e)?HA(e.keys()):e!=null?Object.keys(e):[],values:e=>pb(e)?HA(e.values()):e!=null?Object.values(e):[],entries:e=>pb(e)?HA(e.entries()):e!=null?Object.entries(e):[],object:e=>e?Object.fromEntries(e):dn};function JBe(e,t,n){if(t instanceof Map){if(t.has(e))return t.get(e)}else if(Pa(t,e))return t[e];return n!==void 0?n:e}function ZBe(e,t,n){let r=arguments.length;e=+e,t=+t,n=r<2?(t=e,e=0,1):r<3?1:+n,r=Math.max(0,Math.ceil((t-e)/n))|0;const i=new Array(r);for(let s=0;se==null?e:new Date(e),parse_float:e=>e==null?e:Number.parseFloat(e),parse_int:(e,t)=>e==null?e:Number.parseInt(e,t),endswith:(e,t,n)=>e==null?!1:String(e).endsWith(t,n),match:(e,t,n)=>{const r=e==null?e:String(e).match(t);return n==null||r==null?r:typeof n=="number"?r[n]:r.groups?r.groups[n]:null},normalize:(e,t)=>e==null?e:String(e).normalize(t),padend:(e,t,n)=>e==null?e:String(e).padEnd(t,n),padstart:(e,t,n)=>e==null?e:String(e).padStart(t,n),upper:e=>e==null?e:String(e).toUpperCase(),lower:e=>e==null?e:String(e).toLowerCase(),repeat:(e,t)=>e==null?e:String(e).repeat(t),replace:(e,t,n)=>e==null?e:String(e).replace(t,String(n)),substring:(e,t,n)=>e==null?e:String(e).substring(t,n),split:(e,t,n)=>e==null?[]:String(e).split(t,n),startswith:(e,t,n)=>e==null?!1:String(e).startsWith(t,n),trim:e=>e==null?e:String(e).trim()},rp={bin:DBe,equal:T$,recode:JBe,sequence:ZBe,...kBe,...WBe,...YBe,...KBe,...XBe,...eje};function My(e){return typeof e=="bigint"}function Ou(e){return e===void 0?e+"":My(e)?e+"n":JSON.stringify(e)}function Mt(e,t=[],n=[]){return new tje(e,Vs(t),Vs(n))}let tje=class{constructor(t,n,r){this.name=t,this.fields=n,this.params=r}toString(){const t=[...this.fields.map(n=>`d[${Ou(n)}]`),...this.params.map(Ou)];return`d => op.${this.name}(${t})`}toObject(){return{expr:this.toString(),func:!0}}};const Qee=e=>Mt("any",e),Xee=()=>Mt("count"),Jee=e=>Mt("array_agg",e),Zee=e=>Mt("array_agg_distinct",e),ete=(e,t)=>Mt("map_agg",[e,t]),tte=(e,t)=>Mt("object_agg",[e,t]),nte=(e,t)=>Mt("entries_agg",[e,t]);({...rp});function nje(e,t){e=pb(e)?e:new Set(e);let n=t,r=0;for(;e.has(n);)n=t+ ++r;return n}function rje(e,t){if(!e||!t)return e;const{keys:n,rows:r,size:i}=e,s=new Int32Array(i);t.scan(c=>s[n[c]]=1);const o=s.reduce((c,f)=>c+f,0);if(o===i)return e;const a=Array(o);let u=0;for(let c=0;cl[c]=s[n[c]]),{...e,keys:l,rows:a,size:u}}function ije(e,t,n,r){const{keys:i,rows:s,size:o}=e;let a=s,u=o,l=null;if(n){l=new Int32Array(o),t(p=>l[i[p]]=1);const h=l.reduce((p,m)=>p+m,0);if(h!==o){a=Array(h),u=0;for(let p=0;pf[++c]=l[i[h]]:h=>f[++c]=i[h]),{...e,keys:f,rows:a,size:u}}function sje(e,t,n,r){const i=r==="map"||r===!0?ete:r==="entries"?nte:r==="object"?tte:jt('groups option must be "map", "entries", or "object".'),{names:s}=e.groups(),o=nje(e.columnNames(),"_");let a=e.select().reify(t).create({data:{[o]:n}}).rollup({[o]:Jee(o)});for(let u=s.length;--u>=0;)a=a.groupby(s.slice(0,u)).rollup({[o]:i(s[u],o)});return a.get(o)}const oje="ArrayPattern",aje="ArrowFunctionExpression",uje="FunctionExpression",Hc="Identifier",Gm="Literal",rte="MemberExpression",lje="ObjectExpression",ite="ObjectPattern",ste="Property",q_="Column",cje="Constant",fje="Dictionary",dje="Function",hje="Parameter",ote="Op",Wn=(e,t)=>{const n=pje[e.type];return n?n(e,t):jt(`Unsupported expression construct: ${e.type}`)},WA=(e,t)=>"("+Wn(e.left,t)+" "+e.operator+" "+Wn(e.right,t)+")",qA=(e,t)=>"("+Wa(e.params,t)+")=>"+Wn(e.body,t),fU=(e,t)=>Wn(e.callee,t)+"("+Wa(e.arguments,t)+")",Wa=(e,t,n=",")=>e.map(r=>Wn(r,t)).join(n),ate=e=>e.computed?`[${Ou(e.name)}]`:`.${e.name}`,dU=(e,t,n)=>{const r=e.table||"";return`data${r}${ate(e)}.${n}(${t.index}${r})`},pje={Constant:e=>e.raw,Column:(e,t)=>dU(e,t,"get"),Dictionary:(e,t)=>dU(e,t,"key"),Function:e=>`fn.${e.name}`,Parameter:e=>`$${ate(e)}`,Op:(e,t)=>`op(${Ou(e.name)},${t.op||t.index})`,Literal:e=>e.raw,Identifier:e=>e.name,TemplateLiteral:(e,t)=>{const{quasis:n,expressions:r}=e,i=r.length;let s=n[0].value.raw;for(let o=0;o{const n=!e.computed,r=Wn(e.object,t),i=Wn(e.property,t);return r+(n?"."+i:"["+i+"]")},CallExpression:fU,NewExpression:(e,t)=>"new "+fU(e,t),ArrayExpression:(e,t)=>"["+Wa(e.elements,t)+"]",AssignmentExpression:WA,BinaryExpression:WA,LogicalExpression:WA,UnaryExpression:(e,t)=>"("+e.operator+Wn(e.argument,t)+")",ConditionalExpression:(e,t)=>"("+Wn(e.test,t)+"?"+Wn(e.consequent,t)+":"+Wn(e.alternate,t)+")",ObjectExpression:(e,t)=>"({"+Wa(e.properties,t)+"})",Property:(e,t)=>{const n=Wn(e.key,t);return(e.computed?`[${n}]`:n)+":"+Wn(e.value,t)},ArrowFunctionExpression:qA,FunctionExpression:qA,FunctionDeclaration:qA,ArrayPattern:(e,t)=>"["+Wa(e.elements,t)+"]",ObjectPattern:(e,t)=>"{"+Wa(e.properties,t)+"}",VariableDeclaration:(e,t)=>e.kind+" "+Wa(e.declarations,t,","),VariableDeclarator:(e,t)=>Wn(e.id,t)+"="+Wn(e.init,t),SpreadElement:(e,t)=>"..."+Wn(e.argument,t),BlockStatement:(e,t)=>"{"+Wa(e.body,t,";")+";}",BreakStatement:()=>"break",ExpressionStatement:(e,t)=>Wn(e.expression,t),IfStatement:(e,t)=>"if ("+Wn(e.test,t)+")"+Wn(e.consequent,t)+(e.alternate?" else "+Wn(e.alternate,t):""),SwitchStatement:(e,t)=>"switch ("+Wn(e.discriminant,t)+") {"+Wa(e.cases,t,"")+"}",SwitchCase:(e,t)=>(e.test?"case "+Wn(e.test,t):"default")+": "+Wa(e.consequent,t,";")+";",ReturnStatement:(e,t)=>"return "+Wn(e.argument,t),Program:(e,t)=>Wn(e.body[0],t)};function bT(e,t={index:"row"}){return Wn(e,t)}function mje(e,t,n=15,r=!0,i=0,s){const a=Math.LN10;if(s==null){const u=Math.ceil(Math.log(n)/a),l=t-e||Math.abs(e)||1,c=[5,2];for(s=Math.max(i,Math.pow(10,Math.round(Math.log(l)/a)-u));Math.ceil(l/s)>n;)s*=10;const f=c.length;for(let d=0;d=i&&l/h<=n&&(s=h)}}if(r){let u=Math.log(s);const l=u>=0?0:~~(-u/a)+1,c=Math.pow(10,-l-1);u=Math.floor(e/s+c)*s,e=e0&&(t+=","),t+=`"${r}":${um(e[r])}`;return t+="}",t}function ET(e,t){const n=e.length;return n===1?(r,i)=>um(e[0](r,i)):(r,i)=>{let s="";for(let o=0;o0&&(s+="|");const a=e[o](r,i);if(t&&(a==null||a!==a))return null;s+=um(a)}return s}}function yje(){const e=new Map;return{count(){return e.size},values(){return Array.from(e.values(),t=>t.v)},increment(t){const n=um(t),r=e.get(n);r?++r.n:e.set(n,{v:t,n:1})},decrement(t){const n=um(t),r=e.get(n);r.n===1?e.delete(n):--r.n},forEach(t){e.forEach(({v:n,n:r})=>t(n,r))}}}function Qu(){}function _je(e,t=0,n=e.length){let r=e[t++];for(let i=t;iqr({value:e=>e.count}),param:[]},array_agg:{create:()=>qr({init:e=>e.values=!0,value:e=>e.list.values(e.stream)}),param:[1]},object_agg:{create:()=>qr({init:e=>e.values=!0,value:e=>Object.fromEntries(e.list.values())}),param:[2]},map_agg:{create:()=>qr({init:e=>e.values=!0,value:e=>new Map(e.list.values())}),param:[2]},entries_agg:{create:()=>qr({init:e=>e.values=!0,value:e=>e.list.values(e.stream)}),param:[2]},any:{create:()=>qr({add:(e,t)=>{e.any==null&&(e.any=t)},value:e=>e.valid?e.any:dn}),param:[1]},valid:{create:()=>qr({value:e=>e.valid}),param:[1]},invalid:{create:()=>qr({value:e=>e.count-e.valid}),param:[1]},distinct:{create:()=>({init:e=>e.distinct=yje(),value:e=>e.distinct.count()+(e.valid===e.count?0:1),add:(e,t)=>e.distinct.increment(t),rem:(e,t)=>e.distinct.decrement(t)}),param:[1]},array_agg_distinct:{create:()=>qr({value:e=>e.distinct.values()}),param:[1],req:["distinct"]},mode:{create:()=>qr({value:e=>{let t=dn,n=0;return e.distinct.forEach((r,i)=>{i>n&&(n=i,t=r)}),t}}),param:[1],req:["distinct"]},sum:{create:()=>({init:e=>e.sum=0,value:e=>e.valid?e.sum:dn,add:(e,t)=>My(t)?e.sum===0?e.sum=t:e.sum+=t:e.sum+=+t,rem:(e,t)=>e.sum-=t}),param:[1]},product:{create:()=>({init:e=>hU(e,1),value:e=>e.valid?e.product_v?hU(e,_je(e.list.values())):e.product:void 0,add:(e,t)=>My(t)&&e.product===1?e.product=t:e.product*=t,rem:(e,t)=>t==0||t===1/0||t===-1/0?e.product_v=!0:e.product/=t}),param:[1],stream:["array_agg"]},mean:{create:()=>({init:e=>e.mean=0,value:e=>e.valid?e.mean:dn,add:(e,t)=>{e.mean_d=t-e.mean,e.mean+=e.mean_d/e.valid},rem:(e,t)=>{e.mean_d=t-e.mean,e.mean-=e.valid?e.mean_d/e.valid:e.mean}}),param:[1]},average:{create:()=>qr({value:e=>e.valid?e.mean:dn}),param:[1],req:["mean"]},variance:{create:()=>({init:e=>e.dev=0,value:e=>e.valid>1?e.dev/(e.valid-1):dn,add:(e,t)=>e.dev+=e.mean_d*(t-e.mean),rem:(e,t)=>e.dev-=e.mean_d*(t-e.mean)}),param:[1],req:["mean"]},variancep:{create:()=>qr({value:e=>e.valid>1?e.dev/e.valid:dn}),param:[1],req:["variance"]},stdev:{create:()=>qr({value:e=>e.valid>1?Math.sqrt(e.dev/(e.valid-1)):dn}),param:[1],req:["variance"]},stdevp:{create:()=>qr({value:e=>e.valid>1?Math.sqrt(e.dev/e.valid):dn}),param:[1],req:["variance"]},min:{create:()=>({init:e=>e.min=dn,value:e=>e.min=Number.isNaN(e.min)?e.list.min():e.min,add:(e,t)=>{(t{t<=e.min&&(e.min=NaN)}}),param:[1],stream:["array_agg"]},max:{create:()=>({init:e=>e.max=dn,value:e=>e.max=Number.isNaN(e.max)?e.list.max():e.max,add:(e,t)=>{(t>e.max||e.max===dn)&&(e.max=t)},rem:(e,t)=>{t>=e.max&&(e.max=NaN)}}),param:[1],stream:["array_agg"]},quantile:{create:e=>qr({value:t=>t.list.quantile(e)}),param:[1,1],req:["array_agg"]},median:{create:()=>qr({value:e=>e.list.quantile(.5)}),param:[1],req:["array_agg"]},covariance:{create:()=>({init:e=>{e.cov=e.mean_x=e.mean_y=e.dev_x=e.dev_y=0},value:e=>e.valid>1?e.cov/(e.valid-1):dn,add:(e,t,n)=>{const r=t-e.mean_x,i=n-e.mean_y;e.mean_x+=r/e.valid,e.mean_y+=i/e.valid;const s=n-e.mean_y;e.dev_x+=r*(t-e.mean_x),e.dev_y+=i*s,e.cov+=r*s},rem:(e,t,n)=>{const r=t-e.mean_x,i=n-e.mean_y;e.mean_x-=e.valid?r/e.valid:e.mean_x,e.mean_y-=e.valid?i/e.valid:e.mean_y;const s=n-e.mean_y;e.dev_x-=r*(t-e.mean_x),e.dev_y-=i*s,e.cov-=r*s}}),param:[2]},covariancep:{create:()=>qr({value:e=>e.valid>1?e.cov/e.valid:dn}),param:[2],req:["covariance"]},corr:{create:()=>qr({value:e=>e.valid>1?e.cov/(Math.sqrt(e.dev_x)*Math.sqrt(e.dev_y)):dn}),param:[2],req:["covariance"]},bins:{create:(e,t,n,r)=>qr({value:i=>mje(i.min,i.max,e,t,n,r)}),param:[1,4],req:["min","max"]}},pU={create(){let e;return{init:()=>e=1,value:t=>{const n=t.index;return n&&!t.peer(n)?e=n+1:e}}},param:[]},mU={create(){let e;return{init:()=>e=0,value:t=>{const{index:n,peer:r,size:i}=t;let s=n;if(ee.index+1}},param:[]},rank:pU,avg_rank:{create(){let e,t;return{init:()=>(e=-1,t=1),value:n=>{const r=n.index;if(r>=e){for(t=e=r+1;n.peer(e);t+=++e);t/=e-r}return t}}},param:[]},dense_rank:{create(){let e;return{init:()=>e=1,value:t=>{const n=t.index;return n&&!t.peer(n)?++e:e}}},param:[]},percent_rank:{create(){const{init:e,value:t}=pU.create();return{init:e,value:n=>(t(n)-1)/(n.size-1)}},param:[]},cume_dist:mU,ntile:{create(e){e=+e,e>0||jt("ntile num must be greater than zero.");const{init:t,value:n}=mU.create();return{init:t,value:r=>Math.ceil(e*n(r))}},param:[0,1]},lag:{create(e,t=dn){return e=+e||1,{init:Qu,value:(n,r)=>{const i=n.index-e;return i>=0?n.value(i,r):t}}},param:[1,2]},lead:{create(e,t=dn){return e=+e||1,{init:Qu,value:(n,r)=>{const i=n.index+e;return ie.value(e.i0,t)}},param:[1]},last_value:{create(){return{init:Qu,value:(e,t)=>e.value(e.i1-1,t)}},param:[1]},nth_value:{create(e){return e=+e,e>0||jt("nth_value nth must be greater than zero."),{init:Qu,value:(t,n)=>{const r=t.i0+(e-1);return rt=e,value:(n,r)=>{const i=n.value(n.index,r);return Ea(i)?t=i:t}}},param:[1,1]},fill_up:{create(e=dn){let t,n;return{init:()=>(t=e,n=-1),value:(r,i)=>r.index<=n?t:(n=vje(r,i,r.index))>=0?t=r.value(n,i):(n=r.size,t=e)}},param:[1,1]}};function vje(e,t,n){for(const r=e.size;nzg(e,t,n),expr:(e,t)=>zg(`(row,data,op)=>${e}`,rp,t),expr2:(e,t)=>zg(`(row0,data0,row,data)=>${e}`,rp,t),join:(e,t)=>zg(`(row1,data1,row2,data2)=>${e}`,rp,t),param:(e,t)=>zg(e,rp,t)},bje={"==":1,"!=":1,"===":1,"!==":1};function hte(e,t,n=0,r,i){if(e.type=q_,e.name=t,e.table=n,i&&r&&er(r.keyFor)){const s=bje[i.operator]?i.left===e?i.right:i.left:i.callee&&i.callee.name==="equal"?i.arguments[i.arguments[0]===e?1:0]:null;s&&s.type===Gm&&Eje(i,e,s,r.keyFor(s.value))}return e}function Eje(e,t,n,r){return r<0?(e.type=Gm,e.value=!1,e.raw="false"):(t.type=fje,n.value=r,n.raw=r+""),!0}function WI(e){return yn(e)?e:S$(e)?e.entries():e?Object.entries(e):[]}const pte="row_object";function mte(e,t){e.type=lje;const n=e.properties=[];for(const r of WI(t)){const[i,s]=yn(r)?r:[r,r];n.push({type:ste,key:{type:Gm,raw:Ou(s)},value:hte({computed:!0},i)})}return e}function gte(e){return bT(mte({},e))}function yte(e){return C$.expr(gte(e))}function A$(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function rn(e){return this instanceof rn?(this.v=e,this):new rn(e)}function id(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(e,t||[]),i,s=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(d){r[d]&&(i[d]=function(h){return new Promise(function(p,m){s.push([d,h,p,m])>1||a(d,h)})})}function a(d,h){try{u(r[d](h))}catch(p){f(s[0][3],p)}}function u(d){d.value instanceof rn?Promise.resolve(d.value.v).then(l,c):f(s[0][2],d)}function l(d){a("next",d)}function c(d){a("throw",d)}function f(d,h){d(h),s.shift(),s.length&&a(s[0][0],s[0][1])}}function YA(e){var t,n;return t={},r("next"),r("throw",function(i){throw i}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(i,s){t[i]=e[i]?function(o){return(n=!n)?{value:rn(e[i](o)),done:!1}:s?s(o):o}:s}}function q0(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof gU=="function"?gU(e):e[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(s){n[s]=e[s]&&function(o){return new Promise(function(a,u){o=e[s](o),i(a,u,o.done,o.value)})}}function i(s,o,a,u){Promise.resolve(u).then(function(l){s({value:l,done:a})},o)}}const wje=new TextDecoder("utf-8"),Q2=e=>wje.decode(e),Tje=new TextEncoder,O$=e=>Tje.encode(e),[wrt,_te]=(()=>{const e=()=>{throw new Error("BigInt is not available in this environment")};function t(){throw e()}return t.asIntN=()=>{throw e()},t.asUintN=()=>{throw e()},typeof BigInt<"u"?[BigInt,!0]:[t,!1]})(),[oh,Trt]=(()=>{const e=()=>{throw new Error("BigInt64Array is not available in this environment")};class t{static get BYTES_PER_ELEMENT(){return 8}static of(){throw e()}static from(){throw e()}constructor(){throw e()}}return typeof BigInt64Array<"u"?[BigInt64Array,!0]:[t,!1]})(),[ah,Srt]=(()=>{const e=()=>{throw new Error("BigUint64Array is not available in this environment")};class t{static get BYTES_PER_ELEMENT(){return 8}static of(){throw e()}static from(){throw e()}constructor(){throw e()}}return typeof BigUint64Array<"u"?[BigUint64Array,!0]:[t,!1]})(),Sje=e=>typeof e=="boolean",Is=e=>typeof e=="function",wf=e=>e!=null&&Object(e)===e,qI=e=>wf(e)&&Is(e.then),P$=e=>wf(e)&&Is(e[Symbol.iterator]),YI=e=>wf(e)&&Is(e[Symbol.asyncIterator]),Ije=e=>wf(e)&&"done"in e&&"value"in e,vte=e=>"_getDOMStream"in e&&"_getNodeStream"in e,xje=e=>wf(e)&&Is(e.abort)&&Is(e.getWriter)&&!vte(e),Cje=e=>wf(e)&&Is(e.end)&&Is(e.write)&&Sje(e.writable)&&!vte(e),Aje=e=>wf(e)&&Is(e.clear)&&Is(e.bytes)&&Is(e.position)&&Is(e.setPosition)&&Is(e.capacity)&&Is(e.getBufferIdentifier)&&Is(e.createLong),R$=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;function Oje(e){const t=e[0]?[e[0]]:[];let n,r,i,s;for(let o,a,u=0,l=0,c=e.length;++uc+f.byteLength,0);let i,s,o,a=0,u=-1;const l=Math.min(t||Number.POSITIVE_INFINITY,r);for(const c=n.length;++uIi(Int32Array,e),Pn=e=>Ii(Uint8Array,e),X2=e=>(e.next(),e);function*Pje(e,t){const n=function*(i){yield i},r=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof R$?n(t):P$(t)?t:n(t);return yield*X2(function*(i){let s=null;do s=i.next(yield Ii(e,s));while(!s.done)}(r[Symbol.iterator]())),new e}const Rje=e=>Pje(Uint8Array,e);function bte(e,t){return id(this,arguments,function*(){if(qI(t))return yield rn(yield rn(yield*YA(q0(bte(e,yield rn(t))))));const r=function(o){return id(this,arguments,function*(){yield yield rn(yield rn(o))})},i=function(o){return id(this,arguments,function*(){yield rn(yield*YA(q0(X2(function*(a){let u=null;do u=a.next(yield u==null?void 0:u.value);while(!u.done)}(o[Symbol.iterator]())))))})},s=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof R$?r(t):P$(t)?i(t):YI(t)?t:r(t);return yield rn(yield*YA(q0(X2(function(o){return id(this,arguments,function*(){let a=null;do a=yield rn(o.next(yield yield rn(Ii(e,a))));while(!a.done)})}(s[Symbol.asyncIterator]()))))),yield rn(new e)})}const Nje=e=>bte(Uint8Array,e);function N$(e,t,n){if(e!==0){n=n.slice(0,t+1);for(let r=-1;++r<=t;)n[r]+=e}return n}function kje(e,t){let n=0;const r=e.length;if(r!==t.length)return!1;if(r>0)do if(e[n]!==t[n])return!1;while(++n(e.next(),e);function*Dje(e){let t,n=!1,r=[],i,s,o,a=0;function u(){return s==="peek"?Pu(r,o)[0]:([i,r,a]=Pu(r,o),i)}({cmd:s,size:o}=yield null);const l=Rje(e)[Symbol.iterator]();try{do if({done:t,value:i}=Number.isNaN(o-a)?l.next():l.next(o-a),!t&&i.byteLength>0&&(r.push(i),a+=i.byteLength),t||o<=a)do({cmd:s,size:o}=yield u());while(o0&&(i.push(s),u+=s.byteLength),n||a<=u)do({cmd:o,size:a}=yield yield rn(l()));while(a0&&(i.push(Pn(s)),u+=s.byteLength),n||a<=u)do({cmd:o,size:a}=yield yield rn(l()));while(a{})}get closed(){return this.reader?this.reader.closed.catch(()=>{}):Promise.resolve()}releaseLock(){this.reader&&this.reader.releaseLock(),this.reader=null}cancel(t){return Ju(this,void 0,void 0,function*(){const{reader:n,source:r}=this;n&&(yield n.cancel(t).catch(()=>{})),r&&r.locked&&this.releaseLock()})}read(t){return Ju(this,void 0,void 0,function*(){if(t===0)return{done:this.reader==null,value:new Uint8Array(0)};const n=yield this.reader.read();return!n.done&&(n.value=Pn(n)),n})}}const GA=(e,t)=>{const n=i=>r([t,i]);let r;return[t,n,new Promise(i=>(r=i)&&e.once(t,n))]};function Fje(e){return id(this,arguments,function*(){const n=[];let r="error",i=!1,s=null,o,a,u=0,l=[],c;function f(){return o==="peek"?Pu(l,a)[0]:([c,l,u]=Pu(l,a),c)}if({cmd:o,size:a}=yield yield rn(null),e.isTTY)return yield yield rn(new Uint8Array(0)),yield rn(null);try{n[0]=GA(e,"end"),n[1]=GA(e,"error");do{if(n[2]=GA(e,"readable"),[r,s]=yield rn(Promise.race(n.map(h=>h[2]))),r==="error")break;if((i=r==="end")||(Number.isFinite(a-u)?(c=Pn(e.read(a-u)),c.byteLength0&&(l.push(c),u+=c.byteLength)),i||a<=u)do({cmd:o,size:a}=yield yield rn(f()));while(a{for(const[g,_]of h)e.off(g,_);try{const g=e.destroy;g&&g.call(e,p),p=void 0}catch(g){p=g||p}finally{p!=null?y(p):m()}})}})}var ro;(function(e){e[e.V1=0]="V1",e[e.V2=1]="V2",e[e.V3=2]="V3",e[e.V4=3]="V4",e[e.V5=4]="V5"})(ro||(ro={}));var Yo;(function(e){e[e.Sparse=0]="Sparse",e[e.Dense=1]="Dense"})(Yo||(Yo={}));var Ni;(function(e){e[e.HALF=0]="HALF",e[e.SINGLE=1]="SINGLE",e[e.DOUBLE=2]="DOUBLE"})(Ni||(Ni={}));var Ru;(function(e){e[e.DAY=0]="DAY",e[e.MILLISECOND=1]="MILLISECOND"})(Ru||(Ru={}));var sn;(function(e){e[e.SECOND=0]="SECOND",e[e.MILLISECOND=1]="MILLISECOND",e[e.MICROSECOND=2]="MICROSECOND",e[e.NANOSECOND=3]="NANOSECOND"})(sn||(sn={}));var Nu;(function(e){e[e.YEAR_MONTH=0]="YEAR_MONTH",e[e.DAY_TIME=1]="DAY_TIME",e[e.MONTH_DAY_NANO=2]="MONTH_DAY_NANO"})(Nu||(Nu={}));var ci;(function(e){e[e.NONE=0]="NONE",e[e.Schema=1]="Schema",e[e.DictionaryBatch=2]="DictionaryBatch",e[e.RecordBatch=3]="RecordBatch",e[e.Tensor=4]="Tensor",e[e.SparseTensor=5]="SparseTensor"})(ci||(ci={}));var X;(function(e){e[e.NONE=0]="NONE",e[e.Null=1]="Null",e[e.Int=2]="Int",e[e.Float=3]="Float",e[e.Binary=4]="Binary",e[e.Utf8=5]="Utf8",e[e.Bool=6]="Bool",e[e.Decimal=7]="Decimal",e[e.Date=8]="Date",e[e.Time=9]="Time",e[e.Timestamp=10]="Timestamp",e[e.Interval=11]="Interval",e[e.List=12]="List",e[e.Struct=13]="Struct",e[e.Union=14]="Union",e[e.FixedSizeBinary=15]="FixedSizeBinary",e[e.FixedSizeList=16]="FixedSizeList",e[e.Map=17]="Map",e[e.Dictionary=-1]="Dictionary",e[e.Int8=-2]="Int8",e[e.Int16=-3]="Int16",e[e.Int32=-4]="Int32",e[e.Int64=-5]="Int64",e[e.Uint8=-6]="Uint8",e[e.Uint16=-7]="Uint16",e[e.Uint32=-8]="Uint32",e[e.Uint64=-9]="Uint64",e[e.Float16=-10]="Float16",e[e.Float32=-11]="Float32",e[e.Float64=-12]="Float64",e[e.DateDay=-13]="DateDay",e[e.DateMillisecond=-14]="DateMillisecond",e[e.TimestampSecond=-15]="TimestampSecond",e[e.TimestampMillisecond=-16]="TimestampMillisecond",e[e.TimestampMicrosecond=-17]="TimestampMicrosecond",e[e.TimestampNanosecond=-18]="TimestampNanosecond",e[e.TimeSecond=-19]="TimeSecond",e[e.TimeMillisecond=-20]="TimeMillisecond",e[e.TimeMicrosecond=-21]="TimeMicrosecond",e[e.TimeNanosecond=-22]="TimeNanosecond",e[e.DenseUnion=-23]="DenseUnion",e[e.SparseUnion=-24]="SparseUnion",e[e.IntervalDayTime=-25]="IntervalDayTime",e[e.IntervalYearMonth=-26]="IntervalYearMonth"})(X||(X={}));var Yu;(function(e){e[e.OFFSET=0]="OFFSET",e[e.DATA=1]="DATA",e[e.VALIDITY=2]="VALIDITY",e[e.TYPE=3]="TYPE"})(Yu||(Yu={}));const Bje=void 0;function Wc(e){if(e===null)return"null";if(e===Bje)return"undefined";switch(typeof e){case"number":return`${e}`;case"bigint":return`${e}`;case"string":return`"${e}"`}return typeof e[Symbol.toPrimitive]=="function"?e[Symbol.toPrimitive]("string"):ArrayBuffer.isView(e)?e instanceof oh||e instanceof ah?`[${[...e].map(t=>Wc(t))}]`:`[${e}]`:ArrayBuffer.isView(e)?`[${e}]`:JSON.stringify(e,(t,n)=>typeof n=="bigint"?`${n}`:n)}const jje=Symbol.for("isArrowBigNum");function La(e,...t){return t.length===0?Object.setPrototypeOf(Ii(this.TypedArray,e),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(e,...t),this.constructor.prototype)}La.prototype[jje]=!0;La.prototype.toJSON=function(){return`"${Ed(this)}"`};La.prototype.valueOf=function(){return Ete(this)};La.prototype.toString=function(){return Ed(this)};La.prototype[Symbol.toPrimitive]=function(e="default"){switch(e){case"number":return Ete(this);case"string":return Ed(this);case"default":return J2(this)}return Ed(this)};function Op(...e){return La.apply(this,e)}function Pp(...e){return La.apply(this,e)}function Fy(...e){return La.apply(this,e)}Object.setPrototypeOf(Op.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(Pp.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(Fy.prototype,Object.create(Uint32Array.prototype));Object.assign(Op.prototype,La.prototype,{constructor:Op,signed:!0,TypedArray:Int32Array,BigIntArray:oh});Object.assign(Pp.prototype,La.prototype,{constructor:Pp,signed:!1,TypedArray:Uint32Array,BigIntArray:ah});Object.assign(Fy.prototype,La.prototype,{constructor:Fy,signed:!0,TypedArray:Uint32Array,BigIntArray:ah});function Ete(e){const{buffer:t,byteOffset:n,length:r,signed:i}=e,s=new ah(t,n,r),o=i&&s[s.length-1]&BigInt(1)<e.byteLength===8?new e.BigIntArray(e.buffer,e.byteOffset,1)[0]:KA(e),Ed=e=>e.byteLength===8?`${new e.BigIntArray(e.buffer,e.byteOffset,1)[0]}`:KA(e)):(Ed=KA,J2=Ed);function KA(e){let t="";const n=new Uint32Array(2);let r=new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2);const i=new Uint32Array((r=new Uint16Array(r).reverse()).buffer);let s=-1;const o=r.length-1;do{for(n[0]=r[s=0];s(e.children=null,e.ArrayType=Array,e[Symbol.toStringTag]="DataType"))(Qt.prototype);let Pl=class extends Qt{toString(){return"Null"}get typeId(){return X.Null}};Tte=Symbol.toStringTag;Pl[Tte]=(e=>e[Symbol.toStringTag]="Null")(Pl.prototype);class fs extends Qt{constructor(t,n){super(),this.isSigned=t,this.bitWidth=n}get typeId(){return X.Int}get ArrayType(){switch(this.bitWidth){case 8:return this.isSigned?Int8Array:Uint8Array;case 16:return this.isSigned?Int16Array:Uint16Array;case 32:return this.isSigned?Int32Array:Uint32Array;case 64:return this.isSigned?oh:ah}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}}Ste=Symbol.toStringTag;fs[Ste]=(e=>(e.isSigned=null,e.bitWidth=null,e[Symbol.toStringTag]="Int"))(fs.prototype);class D$ extends fs{constructor(){super(!0,8)}get ArrayType(){return Int8Array}}class $$ extends fs{constructor(){super(!0,16)}get ArrayType(){return Int16Array}}class rf extends fs{constructor(){super(!0,32)}get ArrayType(){return Int32Array}}class L$ extends fs{constructor(){super(!0,64)}get ArrayType(){return oh}}class M$ extends fs{constructor(){super(!1,8)}get ArrayType(){return Uint8Array}}class F$ extends fs{constructor(){super(!1,16)}get ArrayType(){return Uint16Array}}class B$ extends fs{constructor(){super(!1,32)}get ArrayType(){return Uint32Array}}class j$ extends fs{constructor(){super(!1,64)}get ArrayType(){return ah}}Object.defineProperty(D$.prototype,"ArrayType",{value:Int8Array});Object.defineProperty($$.prototype,"ArrayType",{value:Int16Array});Object.defineProperty(rf.prototype,"ArrayType",{value:Int32Array});Object.defineProperty(L$.prototype,"ArrayType",{value:oh});Object.defineProperty(M$.prototype,"ArrayType",{value:Uint8Array});Object.defineProperty(F$.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(B$.prototype,"ArrayType",{value:Uint32Array});Object.defineProperty(j$.prototype,"ArrayType",{value:ah});class sf extends Qt{constructor(t){super(),this.precision=t}get typeId(){return X.Float}get ArrayType(){switch(this.precision){case Ni.HALF:return Uint16Array;case Ni.SINGLE:return Float32Array;case Ni.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}}Ite=Symbol.toStringTag;sf[Ite]=(e=>(e.precision=null,e[Symbol.toStringTag]="Float"))(sf.prototype);class Ute extends sf{constructor(){super(Ni.HALF)}}class U$ extends sf{constructor(){super(Ni.SINGLE)}}class V$ extends sf{constructor(){super(Ni.DOUBLE)}}Object.defineProperty(Ute.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(U$.prototype,"ArrayType",{value:Float32Array});Object.defineProperty(V$.prototype,"ArrayType",{value:Float64Array});let By=class extends Qt{constructor(){super()}get typeId(){return X.Binary}toString(){return"Binary"}};xte=Symbol.toStringTag;By[xte]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Binary"))(By.prototype);let lm=class extends Qt{constructor(){super()}get typeId(){return X.Utf8}toString(){return"Utf8"}};Cte=Symbol.toStringTag;lm[Cte]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Utf8"))(lm.prototype);let jy=class extends Qt{constructor(){super()}get typeId(){return X.Bool}toString(){return"Bool"}};Ate=Symbol.toStringTag;jy[Ate]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Bool"))(jy.prototype);let TT=class extends Qt{constructor(t,n,r=128){super(),this.scale=t,this.precision=n,this.bitWidth=r}get typeId(){return X.Decimal}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}};Ote=Symbol.toStringTag;TT[Ote]=(e=>(e.scale=null,e.precision=null,e.ArrayType=Uint32Array,e[Symbol.toStringTag]="Decimal"))(TT.prototype);class cm extends Qt{constructor(t){super(),this.unit=t}get typeId(){return X.Date}toString(){return`Date${(this.unit+1)*32}<${Ru[this.unit]}>`}}Pte=Symbol.toStringTag;cm[Pte]=(e=>(e.unit=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]="Date"))(cm.prototype);class Uje extends cm{constructor(){super(Ru.DAY)}}class Vje extends cm{constructor(){super(Ru.MILLISECOND)}}class Rl extends Qt{constructor(t,n){super(),this.unit=t,this.bitWidth=n}get typeId(){return X.Time}toString(){return`Time${this.bitWidth}<${sn[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return oh}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}}Rte=Symbol.toStringTag;Rl[Rte]=(e=>(e.unit=null,e.bitWidth=null,e[Symbol.toStringTag]="Time"))(Rl.prototype);class zje extends Rl{constructor(){super(sn.SECOND,32)}}class Hje extends Rl{constructor(){super(sn.MILLISECOND,32)}}class Wje extends Rl{constructor(){super(sn.MICROSECOND,64)}}class qje extends Rl{constructor(){super(sn.NANOSECOND,64)}}class ST extends Qt{constructor(t,n){super(),this.unit=t,this.timezone=n}get typeId(){return X.Timestamp}toString(){return`Timestamp<${sn[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}}Nte=Symbol.toStringTag;ST[Nte]=(e=>(e.unit=null,e.timezone=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]="Timestamp"))(ST.prototype);class fm extends Qt{constructor(t){super(),this.unit=t}get typeId(){return X.Interval}toString(){return`Interval<${Nu[this.unit]}>`}}kte=Symbol.toStringTag;fm[kte]=(e=>(e.unit=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]="Interval"))(fm.prototype);class Yje extends fm{constructor(){super(Nu.DAY_TIME)}}class Gje extends fm{constructor(){super(Nu.YEAR_MONTH)}}let dm=class extends Qt{constructor(t){super(),this.children=[t]}get typeId(){return X.List}toString(){return`List<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};Dte=Symbol.toStringTag;dm[Dte]=(e=>(e.children=null,e[Symbol.toStringTag]="List"))(dm.prototype);class Yi extends Qt{constructor(t){super(),this.children=t}get typeId(){return X.Struct}toString(){return`Struct<{${this.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}}$te=Symbol.toStringTag;Yi[$te]=(e=>(e.children=null,e[Symbol.toStringTag]="Struct"))(Yi.prototype);class Uy extends Qt{constructor(t,n,r){super(),this.mode=t,this.children=r,this.typeIds=n=Int32Array.from(n),this.typeIdToChildIndex=n.reduce((i,s,o)=>(i[s]=o)&&i||i,Object.create(null))}get typeId(){return X.Union}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(t=>`${t.type}`).join(" | ")}>`}}Lte=Symbol.toStringTag;Uy[Lte]=(e=>(e.mode=null,e.typeIds=null,e.children=null,e.typeIdToChildIndex=null,e.ArrayType=Int8Array,e[Symbol.toStringTag]="Union"))(Uy.prototype);let IT=class extends Qt{constructor(t){super(),this.byteWidth=t}get typeId(){return X.FixedSizeBinary}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};Mte=Symbol.toStringTag;IT[Mte]=(e=>(e.byteWidth=null,e.ArrayType=Uint8Array,e[Symbol.toStringTag]="FixedSizeBinary"))(IT.prototype);let hm=class extends Qt{constructor(t,n){super(),this.listSize=t,this.children=[n]}get typeId(){return X.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}};Fte=Symbol.toStringTag;hm[Fte]=(e=>(e.children=null,e.listSize=null,e[Symbol.toStringTag]="FixedSizeList"))(hm.prototype);class Vy extends Qt{constructor(t,n=!1){super(),this.children=[t],this.keysSorted=n}get typeId(){return X.Map}get keyType(){return this.children[0].type.children[0].type}get valueType(){return this.children[0].type.children[1].type}get childType(){return this.children[0].type}toString(){return`Map<{${this.children[0].type.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}}Bte=Symbol.toStringTag;Vy[Bte]=(e=>(e.children=null,e.keysSorted=null,e[Symbol.toStringTag]="Map_"))(Vy.prototype);const Kje=(e=>()=>++e)(-1);class of extends Qt{constructor(t,n,r,i){super(),this.indices=n,this.dictionary=t,this.isOrdered=i||!1,this.id=r==null?Kje():typeof r=="number"?r:r.low}get typeId(){return X.Dictionary}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}}jte=Symbol.toStringTag;of[jte]=(e=>(e.id=null,e.indices=null,e.isOrdered=null,e.dictionary=null,e[Symbol.toStringTag]="Dictionary"))(of.prototype);function Ga(e){const t=e;switch(e.typeId){case X.Decimal:return e.bitWidth/32;case X.Timestamp:return 2;case X.Date:return 1+t.unit;case X.Interval:return 1+t.unit;case X.FixedSizeList:return t.listSize;case X.FixedSizeBinary:return t.byteWidth;default:return 1}}class on{visitMany(t,...n){return t.map((r,i)=>this.visit(r,...n.map(s=>s[i])))}visit(...t){return this.getVisitFn(t[0],!1).apply(this,t)}getVisitFn(t,n=!0){return Qje(this,t,n)}getVisitFnByTypeId(t,n=!0){return Rh(this,t,n)}visitNull(t,...n){return null}visitBool(t,...n){return null}visitInt(t,...n){return null}visitFloat(t,...n){return null}visitUtf8(t,...n){return null}visitBinary(t,...n){return null}visitFixedSizeBinary(t,...n){return null}visitDate(t,...n){return null}visitTimestamp(t,...n){return null}visitTime(t,...n){return null}visitDecimal(t,...n){return null}visitList(t,...n){return null}visitStruct(t,...n){return null}visitUnion(t,...n){return null}visitDictionary(t,...n){return null}visitInterval(t,...n){return null}visitFixedSizeList(t,...n){return null}visitMap(t,...n){return null}}function Qje(e,t,n=!0){return typeof t=="number"?Rh(e,t,n):typeof t=="string"&&t in X?Rh(e,X[t],n):t&&t instanceof Qt?Rh(e,_U(t),n):t!=null&&t.type&&t.type instanceof Qt?Rh(e,_U(t.type),n):Rh(e,X.NONE,n)}function Rh(e,t,n=!0){let r=null;switch(t){case X.Null:r=e.visitNull;break;case X.Bool:r=e.visitBool;break;case X.Int:r=e.visitInt;break;case X.Int8:r=e.visitInt8||e.visitInt;break;case X.Int16:r=e.visitInt16||e.visitInt;break;case X.Int32:r=e.visitInt32||e.visitInt;break;case X.Int64:r=e.visitInt64||e.visitInt;break;case X.Uint8:r=e.visitUint8||e.visitInt;break;case X.Uint16:r=e.visitUint16||e.visitInt;break;case X.Uint32:r=e.visitUint32||e.visitInt;break;case X.Uint64:r=e.visitUint64||e.visitInt;break;case X.Float:r=e.visitFloat;break;case X.Float16:r=e.visitFloat16||e.visitFloat;break;case X.Float32:r=e.visitFloat32||e.visitFloat;break;case X.Float64:r=e.visitFloat64||e.visitFloat;break;case X.Utf8:r=e.visitUtf8;break;case X.Binary:r=e.visitBinary;break;case X.FixedSizeBinary:r=e.visitFixedSizeBinary;break;case X.Date:r=e.visitDate;break;case X.DateDay:r=e.visitDateDay||e.visitDate;break;case X.DateMillisecond:r=e.visitDateMillisecond||e.visitDate;break;case X.Timestamp:r=e.visitTimestamp;break;case X.TimestampSecond:r=e.visitTimestampSecond||e.visitTimestamp;break;case X.TimestampMillisecond:r=e.visitTimestampMillisecond||e.visitTimestamp;break;case X.TimestampMicrosecond:r=e.visitTimestampMicrosecond||e.visitTimestamp;break;case X.TimestampNanosecond:r=e.visitTimestampNanosecond||e.visitTimestamp;break;case X.Time:r=e.visitTime;break;case X.TimeSecond:r=e.visitTimeSecond||e.visitTime;break;case X.TimeMillisecond:r=e.visitTimeMillisecond||e.visitTime;break;case X.TimeMicrosecond:r=e.visitTimeMicrosecond||e.visitTime;break;case X.TimeNanosecond:r=e.visitTimeNanosecond||e.visitTime;break;case X.Decimal:r=e.visitDecimal;break;case X.List:r=e.visitList;break;case X.Struct:r=e.visitStruct;break;case X.Union:r=e.visitUnion;break;case X.DenseUnion:r=e.visitDenseUnion||e.visitUnion;break;case X.SparseUnion:r=e.visitSparseUnion||e.visitUnion;break;case X.Dictionary:r=e.visitDictionary;break;case X.Interval:r=e.visitInterval;break;case X.IntervalDayTime:r=e.visitIntervalDayTime||e.visitInterval;break;case X.IntervalYearMonth:r=e.visitIntervalYearMonth||e.visitInterval;break;case X.FixedSizeList:r=e.visitFixedSizeList;break;case X.Map:r=e.visitMap;break}if(typeof r=="function")return r;if(!n)return()=>null;throw new Error(`Unrecognized type '${X[t]}'`)}function _U(e){switch(e.typeId){case X.Null:return X.Null;case X.Int:{const{bitWidth:t,isSigned:n}=e;switch(t){case 8:return n?X.Int8:X.Uint8;case 16:return n?X.Int16:X.Uint16;case 32:return n?X.Int32:X.Uint32;case 64:return n?X.Int64:X.Uint64}return X.Int}case X.Float:switch(e.precision){case Ni.HALF:return X.Float16;case Ni.SINGLE:return X.Float32;case Ni.DOUBLE:return X.Float64}return X.Float;case X.Binary:return X.Binary;case X.Utf8:return X.Utf8;case X.Bool:return X.Bool;case X.Decimal:return X.Decimal;case X.Time:switch(e.unit){case sn.SECOND:return X.TimeSecond;case sn.MILLISECOND:return X.TimeMillisecond;case sn.MICROSECOND:return X.TimeMicrosecond;case sn.NANOSECOND:return X.TimeNanosecond}return X.Time;case X.Timestamp:switch(e.unit){case sn.SECOND:return X.TimestampSecond;case sn.MILLISECOND:return X.TimestampMillisecond;case sn.MICROSECOND:return X.TimestampMicrosecond;case sn.NANOSECOND:return X.TimestampNanosecond}return X.Timestamp;case X.Date:switch(e.unit){case Ru.DAY:return X.DateDay;case Ru.MILLISECOND:return X.DateMillisecond}return X.Date;case X.Interval:switch(e.unit){case Nu.DAY_TIME:return X.IntervalDayTime;case Nu.YEAR_MONTH:return X.IntervalYearMonth}return X.Interval;case X.Map:return X.Map;case X.List:return X.List;case X.Struct:return X.Struct;case X.Union:switch(e.mode){case Yo.Dense:return X.DenseUnion;case Yo.Sparse:return X.SparseUnion}return X.Union;case X.FixedSizeBinary:return X.FixedSizeBinary;case X.FixedSizeList:return X.FixedSizeList;case X.Dictionary:return X.Dictionary}throw new Error(`Unrecognized type '${X[e.typeId]}'`)}on.prototype.visitInt8=null;on.prototype.visitInt16=null;on.prototype.visitInt32=null;on.prototype.visitInt64=null;on.prototype.visitUint8=null;on.prototype.visitUint16=null;on.prototype.visitUint32=null;on.prototype.visitUint64=null;on.prototype.visitFloat16=null;on.prototype.visitFloat32=null;on.prototype.visitFloat64=null;on.prototype.visitDateDay=null;on.prototype.visitDateMillisecond=null;on.prototype.visitTimestampSecond=null;on.prototype.visitTimestampMillisecond=null;on.prototype.visitTimestampMicrosecond=null;on.prototype.visitTimestampNanosecond=null;on.prototype.visitTimeSecond=null;on.prototype.visitTimeMillisecond=null;on.prototype.visitTimeMicrosecond=null;on.prototype.visitTimeNanosecond=null;on.prototype.visitDenseUnion=null;on.prototype.visitSparseUnion=null;on.prototype.visitIntervalDayTime=null;on.prototype.visitIntervalYearMonth=null;const Vte=new Float64Array(1),xh=new Uint32Array(Vte.buffer);function zte(e){const t=(e&31744)>>10,n=(e&1023)/1024,r=Math.pow(-1,(e&32768)>>15);switch(t){case 31:return r*(n?Number.NaN:1/0);case 0:return r*(n?6103515625e-14*n:0)}return r*Math.pow(2,t-15)*(1+n)}function Hte(e){if(e!==e)return 32256;Vte[0]=e;const t=(xh[1]&2147483648)>>16&65535;let n=xh[1]&2146435072,r=0;return n>=1089470464?xh[0]>0?n=31744:(n=(n&2080374784)>>16,r=(xh[1]&1048575)>>10):n<=1056964608?(r=1048576+(xh[1]&1048575),r=1048576+(r<<(n>>20)-998)>>21,n=0):(n=n-1056964608>>10,r=(xh[1]&1048575)+512>>10),t|n|r&65535}class kt extends on{}function Ft(e){return(t,n,r)=>{if(t.setValid(n,r!=null))return e(t,n,r)}}const Xje=(e,t,n)=>{e[t]=Math.trunc(n/864e5)},z$=(e,t,n)=>{e[t]=Math.trunc(n%4294967296),e[t+1]=Math.trunc(n/4294967296)},Jje=(e,t,n)=>{e[t]=Math.trunc(n*1e3%4294967296),e[t+1]=Math.trunc(n*1e3/4294967296)},Zje=(e,t,n)=>{e[t]=Math.trunc(n*1e6%4294967296),e[t+1]=Math.trunc(n*1e6/4294967296)},Wte=(e,t,n,r)=>{if(n+1{const i=e+n;r?t[i>>3]|=1<>3]&=~(1<{e[t]=n},H$=({values:e},t,n)=>{e[t]=n},qte=({values:e},t,n)=>{e[t]=Hte(n)},tUe=(e,t,n)=>{switch(e.type.precision){case Ni.HALF:return qte(e,t,n);case Ni.SINGLE:case Ni.DOUBLE:return H$(e,t,n)}},W$=({values:e},t,n)=>{Xje(e,t,n.valueOf())},q$=({values:e},t,n)=>{z$(e,t*2,n.valueOf())},Yte=({stride:e,values:t},n,r)=>{t.set(r.subarray(0,e),e*n)},nUe=({values:e,valueOffsets:t},n,r)=>Wte(e,t,n,r),rUe=({values:e,valueOffsets:t},n,r)=>{Wte(e,t,n,O$(r))},Gte=(e,t,n)=>{e.type.unit===Ru.DAY?W$(e,t,n):q$(e,t,n)},Y$=({values:e},t,n)=>z$(e,t*2,n/1e3),G$=({values:e},t,n)=>z$(e,t*2,n),K$=({values:e},t,n)=>Jje(e,t*2,n),Q$=({values:e},t,n)=>Zje(e,t*2,n),Kte=(e,t,n)=>{switch(e.type.unit){case sn.SECOND:return Y$(e,t,n);case sn.MILLISECOND:return G$(e,t,n);case sn.MICROSECOND:return K$(e,t,n);case sn.NANOSECOND:return Q$(e,t,n)}},X$=({values:e},t,n)=>{e[t]=n},J$=({values:e},t,n)=>{e[t]=n},Z$=({values:e},t,n)=>{e[t]=n},e3=({values:e},t,n)=>{e[t]=n},Qte=(e,t,n)=>{switch(e.type.unit){case sn.SECOND:return X$(e,t,n);case sn.MILLISECOND:return J$(e,t,n);case sn.MICROSECOND:return Z$(e,t,n);case sn.NANOSECOND:return e3(e,t,n)}},Xte=({values:e,stride:t},n,r)=>{e.set(r.subarray(0,t),t*n)},iUe=(e,t,n)=>{const r=e.children[0],i=e.valueOffsets,s=Go.getVisitFn(r);if(Array.isArray(n))for(let o=-1,a=i[t],u=i[t+1];a{const r=e.children[0],{valueOffsets:i}=e,s=Go.getVisitFn(r);let{[t]:o,[t+1]:a}=i;const u=n instanceof Map?n.entries():Object.entries(n);for(const l of u)if(s(r,o,l),++o>=a)break},oUe=(e,t)=>(n,r,i,s)=>r&&n(r,e,t[s]),aUe=(e,t)=>(n,r,i,s)=>r&&n(r,e,t.get(s)),uUe=(e,t)=>(n,r,i,s)=>r&&n(r,e,t.get(i.name)),lUe=(e,t)=>(n,r,i,s)=>r&&n(r,e,t[i.name]),cUe=(e,t,n)=>{const r=e.type.children.map(s=>Go.getVisitFn(s.type)),i=n instanceof Map?uUe(t,n):n instanceof _n?aUe(t,n):Array.isArray(n)?oUe(t,n):lUe(t,n);e.type.children.forEach((s,o)=>i(r[o],e.children[o],s,o))},fUe=(e,t,n)=>{e.type.mode===Yo.Dense?Jte(e,t,n):Zte(e,t,n)},Jte=(e,t,n)=>{const r=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[r];Go.visit(i,e.valueOffsets[t],n)},Zte=(e,t,n)=>{const r=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[r];Go.visit(i,t,n)},dUe=(e,t,n)=>{var r;(r=e.dictionary)===null||r===void 0||r.set(e.values[t],n)},ene=(e,t,n)=>{e.type.unit===Nu.DAY_TIME?t3(e,t,n):n3(e,t,n)},t3=({values:e},t,n)=>{e.set(n.subarray(0,2),2*t)},n3=({values:e},t,n)=>{e[t]=n[0]*12+n[1]%12},hUe=(e,t,n)=>{const{stride:r}=e,i=e.children[0],s=Go.getVisitFn(i);if(Array.isArray(n))for(let o=-1,a=t*r;++o`${Wc(t)}: ${Wc(n)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new pUe(this[pa],this[Rp])}}class pUe{constructor(t,n){this.childIndex=0,this.children=t.children,this.rowIndex=n,this.childFields=t.type.children,this.numChildren=this.childFields.length}[Symbol.iterator](){return this}next(){const t=this.childIndex;return tn.name)}has(t,n){return t[pa].type.children.findIndex(r=>r.name===n)!==-1}getOwnPropertyDescriptor(t,n){if(t[pa].type.children.findIndex(r=>r.name===n)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,n){if(Reflect.has(t,n))return t[n];const r=t[pa].type.children.findIndex(i=>i.name===n);if(r!==-1){const i=zs.visit(t[pa].children[r],t[Rp]);return Reflect.set(t,n,i),i}}set(t,n,r){const i=t[pa].type.children.findIndex(s=>s.name===n);return i!==-1?(Go.visit(t[pa].children[i],t[Rp],r),Reflect.set(t,n,r)):Reflect.has(t,n)||typeof n=="symbol"?Reflect.set(t,n,r):!1}}class At extends on{}function Dt(e){return(t,n)=>t.getValid(n)?e(t,n):null}const gUe=(e,t)=>864e5*e[t],i3=(e,t)=>4294967296*e[t+1]+(e[t]>>>0),yUe=(e,t)=>4294967296*(e[t+1]/1e3)+(e[t]>>>0)/1e3,_Ue=(e,t)=>4294967296*(e[t+1]/1e6)+(e[t]>>>0)/1e6,tne=e=>new Date(e),vUe=(e,t)=>tne(gUe(e,t)),bUe=(e,t)=>tne(i3(e,t)),EUe=(e,t)=>null,nne=(e,t,n)=>{if(n+1>=t.length)return null;const r=t[n],i=t[n+1];return e.subarray(r,i)},wUe=({offset:e,values:t},n)=>{const r=e+n;return(t[r>>3]&1<vUe(e,t),ine=({values:e},t)=>bUe(e,t*2),Tf=({stride:e,values:t},n)=>t[e*n],TUe=({stride:e,values:t},n)=>zte(t[e*n]),sne=({values:e},t)=>e[t],SUe=({stride:e,values:t},n)=>t.subarray(e*n,e*(n+1)),IUe=({values:e,valueOffsets:t},n)=>nne(e,t,n),xUe=({values:e,valueOffsets:t},n)=>{const r=nne(e,t,n);return r!==null?Q2(r):null},CUe=({values:e},t)=>e[t],AUe=({type:e,values:t},n)=>e.precision!==Ni.HALF?t[n]:zte(t[n]),OUe=(e,t)=>e.type.unit===Ru.DAY?rne(e,t):ine(e,t),one=({values:e},t)=>1e3*i3(e,t*2),ane=({values:e},t)=>i3(e,t*2),une=({values:e},t)=>yUe(e,t*2),lne=({values:e},t)=>_Ue(e,t*2),PUe=(e,t)=>{switch(e.type.unit){case sn.SECOND:return one(e,t);case sn.MILLISECOND:return ane(e,t);case sn.MICROSECOND:return une(e,t);case sn.NANOSECOND:return lne(e,t)}},cne=({values:e},t)=>e[t],fne=({values:e},t)=>e[t],dne=({values:e},t)=>e[t],hne=({values:e},t)=>e[t],RUe=(e,t)=>{switch(e.type.unit){case sn.SECOND:return cne(e,t);case sn.MILLISECOND:return fne(e,t);case sn.MICROSECOND:return dne(e,t);case sn.NANOSECOND:return hne(e,t)}},NUe=({values:e,stride:t},n)=>k$.decimal(e.subarray(t*n,t*(n+1))),kUe=(e,t)=>{const{valueOffsets:n,stride:r,children:i}=e,{[t*r]:s,[t*r+1]:o}=n,u=i[0].slice(s,o-s);return new _n([u])},DUe=(e,t)=>{const{valueOffsets:n,children:r}=e,{[t]:i,[t+1]:s}=n,o=r[0];return new GI(o.slice(i,s-i))},$Ue=(e,t)=>new r3(e,t),LUe=(e,t)=>e.type.mode===Yo.Dense?pne(e,t):mne(e,t),pne=(e,t)=>{const n=e.type.typeIdToChildIndex[e.typeIds[t]],r=e.children[n];return zs.visit(r,e.valueOffsets[t])},mne=(e,t)=>{const n=e.type.typeIdToChildIndex[e.typeIds[t]],r=e.children[n];return zs.visit(r,t)},MUe=(e,t)=>{var n;return(n=e.dictionary)===null||n===void 0?void 0:n.get(e.values[t])},FUe=(e,t)=>e.type.unit===Nu.DAY_TIME?gne(e,t):yne(e,t),gne=({values:e},t)=>e.subarray(2*t,2*(t+1)),yne=({values:e},t)=>{const n=e[t],r=new Int32Array(2);return r[0]=Math.trunc(n/12),r[1]=Math.trunc(n%12),r},BUe=(e,t)=>{const{stride:n,children:r}=e,s=r[0].slice(t*n,n);return new _n([s])};At.prototype.visitNull=Dt(EUe);At.prototype.visitBool=Dt(wUe);At.prototype.visitInt=Dt(CUe);At.prototype.visitInt8=Dt(Tf);At.prototype.visitInt16=Dt(Tf);At.prototype.visitInt32=Dt(Tf);At.prototype.visitInt64=Dt(sne);At.prototype.visitUint8=Dt(Tf);At.prototype.visitUint16=Dt(Tf);At.prototype.visitUint32=Dt(Tf);At.prototype.visitUint64=Dt(sne);At.prototype.visitFloat=Dt(AUe);At.prototype.visitFloat16=Dt(TUe);At.prototype.visitFloat32=Dt(Tf);At.prototype.visitFloat64=Dt(Tf);At.prototype.visitUtf8=Dt(xUe);At.prototype.visitBinary=Dt(IUe);At.prototype.visitFixedSizeBinary=Dt(SUe);At.prototype.visitDate=Dt(OUe);At.prototype.visitDateDay=Dt(rne);At.prototype.visitDateMillisecond=Dt(ine);At.prototype.visitTimestamp=Dt(PUe);At.prototype.visitTimestampSecond=Dt(one);At.prototype.visitTimestampMillisecond=Dt(ane);At.prototype.visitTimestampMicrosecond=Dt(une);At.prototype.visitTimestampNanosecond=Dt(lne);At.prototype.visitTime=Dt(RUe);At.prototype.visitTimeSecond=Dt(cne);At.prototype.visitTimeMillisecond=Dt(fne);At.prototype.visitTimeMicrosecond=Dt(dne);At.prototype.visitTimeNanosecond=Dt(hne);At.prototype.visitDecimal=Dt(NUe);At.prototype.visitList=Dt(kUe);At.prototype.visitStruct=Dt($Ue);At.prototype.visitUnion=Dt(LUe);At.prototype.visitDenseUnion=Dt(pne);At.prototype.visitSparseUnion=Dt(mne);At.prototype.visitDictionary=Dt(MUe);At.prototype.visitInterval=Dt(FUe);At.prototype.visitIntervalDayTime=Dt(gne);At.prototype.visitIntervalYearMonth=Dt(yne);At.prototype.visitFixedSizeList=Dt(BUe);At.prototype.visitMap=Dt(DUe);const zs=new At,ba=Symbol.for("keys"),Np=Symbol.for("vals");class GI{constructor(t){return this[ba]=new _n([t.children[0]]).memoize(),this[Np]=t.children[1],new Proxy(this,new UUe)}[Symbol.iterator](){return new jUe(this[ba],this[Np])}get size(){return this[ba].length}toArray(){return Object.values(this.toJSON())}toJSON(){const t=this[ba],n=this[Np],r={};for(let i=-1,s=t.length;++i`${Wc(t)}: ${Wc(n)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}}class jUe{constructor(t,n){this.keys=t,this.vals=n,this.keyIndex=0,this.numKeys=t.length}[Symbol.iterator](){return this}next(){const t=this.keyIndex;return t===this.numKeys?{done:!0,value:null}:(this.keyIndex++,{done:!1,value:[this.keys.get(t),zs.visit(this.vals,t)]})}}class UUe{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[ba].toArray().map(String)}has(t,n){return t[ba].includes(n)}getOwnPropertyDescriptor(t,n){if(t[ba].indexOf(n)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,n){if(Reflect.has(t,n))return t[n];const r=t[ba].indexOf(n);if(r!==-1){const i=zs.visit(Reflect.get(t,Np),r);return Reflect.set(t,n,i),i}}set(t,n,r){const i=t[ba].indexOf(n);return i!==-1?(Go.visit(Reflect.get(t,Np),i,r),Reflect.set(t,n,r)):Reflect.has(t,n)?Reflect.set(t,n,r):!1}}Object.defineProperties(GI.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[ba]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Np]:{writable:!0,enumerable:!1,configurable:!1,value:null}});let vU;function _ne(e,t,n,r){const{length:i=0}=e;let s=typeof t!="number"?0:t,o=typeof n!="number"?i:n;return s<0&&(s=(s%i+i)%i),o<0&&(o=(o%i+i)%i),oi&&(o=i),r?r(e,s,o):[s,o]}const bU=e=>e!==e;function Km(e){if(typeof e!=="object"||e===null)return bU(e)?bU:n=>n===e;if(e instanceof Date){const n=e.valueOf();return r=>r instanceof Date?r.valueOf()===n:!1}return ArrayBuffer.isView(e)?n=>n?kje(e,n):!1:e instanceof Map?zUe(e):Array.isArray(e)?VUe(e):e instanceof _n?HUe(e):WUe(e,!0)}function VUe(e){const t=[];for(let n=-1,r=e.length;++n!1;const r=[];for(let i=-1,s=n.length;++i{if(!n||typeof n!="object")return!1;switch(n.constructor){case Array:return qUe(e,n);case Map:return EU(e,n,n.keys());case GI:case r3:case Object:case void 0:return EU(e,n,t||Object.keys(n))}return n instanceof _n?YUe(e,n):!1}}function qUe(e,t){const n=e.length;if(t.length!==n)return!1;for(let r=-1;++r>r}function s3(e,t,n){const r=n.byteLength+7&-8;if(e>0||n.byteLength>3):bne(new o3(n,e,t,null,vne)).subarray(0,r)),i}return n}function bne(e){const t=[];let n=0,r=0,i=0;for(const o of e)o&&(i|=1<0)&&(t[n++]=i);const s=new Uint8Array(t.length+7&-8);return s.set(t),s}class o3{constructor(t,n,r,i,s){this.bytes=t,this.length=r,this.context=i,this.get=s,this.bit=n%8,this.byteIndex=n>>3,this.byte=t[this.byteIndex++],this.index=0}next(){return this.index>3<<3,i=t+(t%8===0?0:8-t%8);return Z2(e,t,i)+Z2(e,r,n)+KUe(e,i>>3,r-i>>3)}function KUe(e,t,n){let r=0,i=Math.trunc(t);const s=new DataView(e.buffer,e.byteOffset,e.byteLength),o=n===void 0?e.byteLength:i+n;for(;o-i>=4;)r+=QA(s.getUint32(i)),i+=4;for(;o-i>=2;)r+=QA(s.getUint16(i)),i+=2;for(;o-i>=1;)r+=QA(s.getUint8(i)),i+=1;return r}function QA(e){let t=Math.trunc(e);return t=t-(t>>>1&1431655765),t=(t&858993459)+(t>>>2&858993459),(t+(t>>>4)&252645135)*16843009>>>24}const QUe=-1;class Mn{constructor(t,n,r,i,s,o=[],a){this.type=t,this.children=o,this.dictionary=a,this.offset=Math.floor(Math.max(n||0,0)),this.length=Math.floor(Math.max(r||0,0)),this._nullCount=Math.floor(Math.max(i||0,-1));let u;s instanceof Mn?(this.stride=s.stride,this.values=s.values,this.typeIds=s.typeIds,this.nullBitmap=s.nullBitmap,this.valueOffsets=s.valueOffsets):(this.stride=Ga(t),s&&((u=s[0])&&(this.valueOffsets=u),(u=s[1])&&(this.values=u),(u=s[2])&&(this.nullBitmap=u),(u=s[3])&&(this.typeIds=u))),this.nullable=this._nullCount!==0&&this.nullBitmap&&this.nullBitmap.byteLength>0}get typeId(){return this.type.typeId}get ArrayType(){return this.type.ArrayType}get buffers(){return[this.valueOffsets,this.values,this.nullBitmap,this.typeIds]}get byteLength(){let t=0;const{valueOffsets:n,values:r,nullBitmap:i,typeIds:s}=this;return n&&(t+=n.byteLength),r&&(t+=r.byteLength),i&&(t+=i.byteLength),s&&(t+=s.byteLength),this.children.reduce((o,a)=>o+a.byteLength,t)}get nullCount(){let t=this._nullCount,n;return t<=QUe&&(n=this.nullBitmap)&&(this._nullCount=t=this.length-Z2(n,this.offset,this.offset+this.length)),t}getValid(t){if(this.nullable&&this.nullCount>0){const n=this.offset+t;return(this.nullBitmap[n>>3]&1<>3){const{nullBitmap:u}=this._changeLengthAndBackfillNullBitmap(this.length);Object.assign(this,{nullBitmap:u,_nullCount:0})}const{nullBitmap:r,offset:i}=this,s=i+t>>3,o=(i+t)%8,a=r[s]>>o&1;return n?a===0&&(r[s]|=1<>3).fill(255,0,n>>3);i[n>>3]=(1<0&&i.set(s3(this.offset,n,this.nullBitmap),0);const s=this.buffers;return s[Yu.VALIDITY]=i,this.clone(this.type,0,t,r+(t-n),s)}_sliceBuffers(t,n,r,i){let s;const{buffers:o}=this;return(s=o[Yu.TYPE])&&(o[Yu.TYPE]=s.subarray(t,t+n)),(s=o[Yu.OFFSET])&&(o[Yu.OFFSET]=s.subarray(t,t+n+1))||(s=o[Yu.DATA])&&(o[Yu.DATA]=i===6?s:s.subarray(r*t,r*(t+n))),o}_sliceChildren(t,n,r){return t.map(i=>i.slice(n,r))}}Mn.prototype.children=Object.freeze([]);class Y0 extends on{visit(t){return this.getVisitFn(t.type).call(this,t)}visitNull(t){const{["type"]:n,["offset"]:r=0,["length"]:i=0}=t;return new Mn(n,r,i,0)}visitBool(t){const{["type"]:n,["offset"]:r=0}=t,i=Pn(t.nullBitmap),s=Ii(n.ArrayType,t.data),{["length"]:o=s.length>>3,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Mn(n,r,o,a,[void 0,s,i])}visitInt(t){const{["type"]:n,["offset"]:r=0}=t,i=Pn(t.nullBitmap),s=Ii(n.ArrayType,t.data),{["length"]:o=s.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Mn(n,r,o,a,[void 0,s,i])}visitFloat(t){const{["type"]:n,["offset"]:r=0}=t,i=Pn(t.nullBitmap),s=Ii(n.ArrayType,t.data),{["length"]:o=s.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Mn(n,r,o,a,[void 0,s,i])}visitUtf8(t){const{["type"]:n,["offset"]:r=0}=t,i=Pn(t.data),s=Pn(t.nullBitmap),o=Hg(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:u=t.nullBitmap?-1:0}=t;return new Mn(n,r,a,u,[o,i,s])}visitBinary(t){const{["type"]:n,["offset"]:r=0}=t,i=Pn(t.data),s=Pn(t.nullBitmap),o=Hg(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:u=t.nullBitmap?-1:0}=t;return new Mn(n,r,a,u,[o,i,s])}visitFixedSizeBinary(t){const{["type"]:n,["offset"]:r=0}=t,i=Pn(t.nullBitmap),s=Ii(n.ArrayType,t.data),{["length"]:o=s.length/Ga(n),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Mn(n,r,o,a,[void 0,s,i])}visitDate(t){const{["type"]:n,["offset"]:r=0}=t,i=Pn(t.nullBitmap),s=Ii(n.ArrayType,t.data),{["length"]:o=s.length/Ga(n),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Mn(n,r,o,a,[void 0,s,i])}visitTimestamp(t){const{["type"]:n,["offset"]:r=0}=t,i=Pn(t.nullBitmap),s=Ii(n.ArrayType,t.data),{["length"]:o=s.length/Ga(n),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Mn(n,r,o,a,[void 0,s,i])}visitTime(t){const{["type"]:n,["offset"]:r=0}=t,i=Pn(t.nullBitmap),s=Ii(n.ArrayType,t.data),{["length"]:o=s.length/Ga(n),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Mn(n,r,o,a,[void 0,s,i])}visitDecimal(t){const{["type"]:n,["offset"]:r=0}=t,i=Pn(t.nullBitmap),s=Ii(n.ArrayType,t.data),{["length"]:o=s.length/Ga(n),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Mn(n,r,o,a,[void 0,s,i])}visitList(t){const{["type"]:n,["offset"]:r=0,["child"]:i}=t,s=Pn(t.nullBitmap),o=Hg(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:u=t.nullBitmap?-1:0}=t;return new Mn(n,r,a,u,[o,void 0,s],[i])}visitStruct(t){const{["type"]:n,["offset"]:r=0,["children"]:i=[]}=t,s=Pn(t.nullBitmap),{length:o=i.reduce((u,{length:l})=>Math.max(u,l),0),nullCount:a=t.nullBitmap?-1:0}=t;return new Mn(n,r,o,a,[void 0,void 0,s],i)}visitUnion(t){const{["type"]:n,["offset"]:r=0,["children"]:i=[]}=t,s=Pn(t.nullBitmap),o=Ii(n.ArrayType,t.typeIds),{["length"]:a=o.length,["nullCount"]:u=t.nullBitmap?-1:0}=t;if(Qt.isSparseUnion(n))return new Mn(n,r,a,u,[void 0,void 0,s,o],i);const l=Hg(t.valueOffsets);return new Mn(n,r,a,u,[l,void 0,s,o],i)}visitDictionary(t){const{["type"]:n,["offset"]:r=0}=t,i=Pn(t.nullBitmap),s=Ii(n.indices.ArrayType,t.data),{["dictionary"]:o=new _n([new Y0().visit({type:n.dictionary})])}=t,{["length"]:a=s.length,["nullCount"]:u=t.nullBitmap?-1:0}=t;return new Mn(n,r,a,u,[void 0,s,i],[],o)}visitInterval(t){const{["type"]:n,["offset"]:r=0}=t,i=Pn(t.nullBitmap),s=Ii(n.ArrayType,t.data),{["length"]:o=s.length/Ga(n),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Mn(n,r,o,a,[void 0,s,i])}visitFixedSizeList(t){const{["type"]:n,["offset"]:r=0,["child"]:i=new Y0().visit({type:n.valueType})}=t,s=Pn(t.nullBitmap),{["length"]:o=i.length/Ga(n),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Mn(n,r,o,a,[void 0,void 0,s],[i])}visitMap(t){const{["type"]:n,["offset"]:r=0,["child"]:i=new Y0().visit({type:n.childType})}=t,s=Pn(t.nullBitmap),o=Hg(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:u=t.nullBitmap?-1:0}=t;return new Mn(n,r,a,u,[o,void 0,s],[i])}}function Hi(e){return new Y0().visit(e)}class wU{constructor(t=0,n){this.numChunks=t,this.getChunkIterator=n,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndext+n.nullCount,0)}function wne(e){return e.reduce((t,n,r)=>(t[r+1]=t[r]+n.length,t),new Uint32Array(e.length+1))}function Tne(e,t,n,r){const i=[];for(let s=-1,o=e.length;++s=r)break;if(n>=u+l)continue;if(u>=n&&u+l<=r){i.push(a);continue}const c=Math.max(0,n-u),f=Math.min(r-u,l);i.push(a.slice(c,f-c))}return i.length===0&&i.push(e[0].slice(0,0)),i}function a3(e,t,n,r){let i=0,s=0,o=t.length-1;do{if(i>=o-1)return n0?0:-1}function JUe(e,t){const{nullBitmap:n}=e;if(!n||e.nullCount<=0)return-1;let r=0;for(const i of new o3(n,e.offset+(t||0),e.length,n,vne)){if(!i)return r;++r}return-1}function Vt(e,t,n){if(t===void 0)return-1;if(t===null)return JUe(e,n);const r=zs.getVisitFn(e),i=Km(t);for(let s=(n||0)-1,o=e.length;++s{const i=e.data[r];return i.values.subarray(0,i.length)[Symbol.iterator]()});let n=0;return new wU(e.data.length,r=>{const s=e.data[r].length,o=e.slice(n,n+s);return n+=s,new ZUe(o)})}class ZUe{constructor(t){this.vector=t,this.index=0}next(){return this.indexe+t;class Sf extends on{visitNull(t,n){return 0}visitInt(t,n){return t.type.bitWidth/8}visitFloat(t,n){return t.type.ArrayType.BYTES_PER_ELEMENT}visitBool(t,n){return 1/8}visitDecimal(t,n){return t.type.bitWidth/8}visitDate(t,n){return(t.type.unit+1)*4}visitTime(t,n){return t.type.bitWidth/8}visitTimestamp(t,n){return t.type.unit===sn.SECOND?4:8}visitInterval(t,n){return(t.type.unit+1)*4}visitStruct(t,n){return t.children.reduce((r,i)=>r+ku.visit(i,n),0)}visitFixedSizeBinary(t,n){return t.type.byteWidth}visitMap(t,n){return 8+t.children.reduce((r,i)=>r+ku.visit(i,n),0)}visitDictionary(t,n){var r;return t.type.indices.bitWidth/8+(((r=t.dictionary)===null||r===void 0?void 0:r.getByteLength(t.values[n]))||0)}}const tVe=({valueOffsets:e},t)=>8+(e[t+1]-e[t]),nVe=({valueOffsets:e},t)=>8+(e[t+1]-e[t]),rVe=({valueOffsets:e,stride:t,children:n},r)=>{const i=n[0],{[r*t]:s}=e,{[r*t+1]:o}=e,a=ku.getVisitFn(i.type),u=i.slice(s,o-s);let l=8;for(let c=-1,f=o-s;++c{const r=t[0],i=r.slice(n*e,e),s=ku.getVisitFn(r.type);let o=0;for(let a=-1,u=i.length;++ae.type.mode===Yo.Dense?Cne(e,t):Ane(e,t),Cne=({type:e,children:t,typeIds:n,valueOffsets:r},i)=>{const s=e.typeIdToChildIndex[n[i]];return 8+ku.visit(t[s],r[i])},Ane=({children:e},t)=>4+ku.visitMany(e,e.map(()=>t)).reduce(eVe,0);Sf.prototype.visitUtf8=tVe;Sf.prototype.visitBinary=nVe;Sf.prototype.visitList=rVe;Sf.prototype.visitFixedSizeList=iVe;Sf.prototype.visitUnion=sVe;Sf.prototype.visitDenseUnion=Cne;Sf.prototype.visitSparseUnion=Ane;const ku=new Sf;var One;const Pne={},Rne={};class _n{constructor(t){var n,r,i;const s=t[0]instanceof _n?t.flatMap(a=>a.data):t;if(s.length===0||s.some(a=>!(a instanceof Mn)))throw new TypeError("Vector constructor expects an Array of Data instances.");const o=(n=s[0])===null||n===void 0?void 0:n.type;switch(s.length){case 0:this._offsets=[0];break;case 1:{const{get:a,set:u,indexOf:l,byteLength:c}=Pne[o.typeId],f=s[0];this.isValid=d=>u3(f,d),this.get=d=>a(f,d),this.set=(d,h)=>u(f,d,h),this.indexOf=d=>l(f,d),this.getByteLength=d=>c(f,d),this._offsets=[0,f.length];break}default:Object.setPrototypeOf(this,Rne[o.typeId]),this._offsets=wne(s);break}this.data=s,this.type=o,this.stride=Ga(o),this.numChildren=(i=(r=o.children)===null||r===void 0?void 0:r.length)!==null&&i!==void 0?i:0,this.length=this._offsets[this._offsets.length-1]}get byteLength(){return this._byteLength===-1&&(this._byteLength=this.data.reduce((t,n)=>t+n.byteLength,0)),this._byteLength}get nullCount(){return this._nullCount===-1&&(this._nullCount=Ene(this.data)),this._nullCount}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${X[this.type.typeId]}Vector`}isValid(t){return!1}get(t){return null}set(t,n){}indexOf(t,n){return-1}includes(t,n){return this.indexOf(t,n)>0}getByteLength(t){return 0}[Symbol.iterator](){return l3.visit(this)}concat(...t){return new _n(this.data.concat(t.flatMap(n=>n.data).flat(Number.POSITIVE_INFINITY)))}slice(t,n){return new _n(_ne(this,t,n,({data:r,_offsets:i},s,o)=>Tne(r,i,s,o)))}toJSON(){return[...this]}toArray(){const{type:t,data:n,length:r,stride:i,ArrayType:s}=this;switch(t.typeId){case X.Int:case X.Float:case X.Decimal:case X.Time:case X.Timestamp:switch(n.length){case 0:return new s;case 1:return n[0].values.subarray(0,r*i);default:return n.reduce((o,{values:a,length:u})=>(o.array.set(a.subarray(0,u*i),o.offset),o.offset+=u*i,o),{array:new s(r*i),offset:0}).array}}return[...this]}toString(){return`[${[...this].join(",")}]`}getChild(t){var n;return this.getChildAt((n=this.type.children)===null||n===void 0?void 0:n.findIndex(r=>r.name===t))}getChildAt(t){return t>-1&&tn[t])):null}get isMemoized(){return Qt.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(Qt.isDictionary(this.type)){const t=new CT(this.data[0].dictionary),n=this.data.map(r=>{const i=r.clone();return i.dictionary=t,i});return new _n(n)}return new CT(this)}unmemoize(){if(Qt.isDictionary(this.type)&&this.isMemoized){const t=this.data[0].dictionary.unmemoize(),n=this.data.map(r=>{const i=r.clone();return i.dictionary=t,i});return new _n(n)}return this}}One=Symbol.toStringTag;_n[One]=(e=>{e.type=Qt.prototype,e.data=[],e.length=0,e.stride=1,e.numChildren=0,e._nullCount=-1,e._byteLength=-1,e._offsets=new Uint32Array([0]),e[Symbol.isConcatSpreadable]=!0;const t=Object.keys(X).map(n=>X[n]).filter(n=>typeof n=="number"&&n!==X.NONE);for(const n of t){const r=zs.getVisitFnByTypeId(n),i=Go.getVisitFnByTypeId(n),s=xT.getVisitFnByTypeId(n),o=ku.getVisitFnByTypeId(n);Pne[n]={get:r,set:i,indexOf:s,byteLength:o},Rne[n]=Object.create(e,{isValid:{value:kp(u3)},get:{value:kp(zs.getVisitFnByTypeId(n))},set:{value:Sne(Go.getVisitFnByTypeId(n))},indexOf:{value:Ine(xT.getVisitFnByTypeId(n))},getByteLength:{value:kp(ku.getVisitFnByTypeId(n))}})}return"Vector"})(_n.prototype);class CT extends _n{constructor(t){super(t.data);const n=this.get,r=this.set,i=this.slice,s=new Array(this.length);Object.defineProperty(this,"get",{value(o){const a=s[o];if(a!==void 0)return a;const u=n.call(this,o);return s[o]=u,u}}),Object.defineProperty(this,"set",{value(o,a){r.call(this,o,a),s[o]=a}}),Object.defineProperty(this,"slice",{value:(o,a)=>new CT(i.call(this,o,a))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new _n(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}}function oVe(e){if(!e||e.length<=0)return function(i){return!0};let t="";const n=e.filter(r=>r===r);return n.length>0&&(t=` switch (x) {${n.map(r=>` case ${aVe(r)}:`).join("")} return false; }`),e.length!==n.length&&(t=`if (x !== x) return false; ${t}`),new Function("x",`${t} -return true;`)}function aVe(e){return typeof e!="bigint"?Wc(e):vte?`${Wc(e)}n`:`"${Wc(e)}"`}const XA=(e,t)=>(Math.ceil(e)*t+63&-64||64)/t,uVe=(e,t=0)=>e.length>=t?e.subarray(0,t):wT(new e.constructor(t),e,0);class QI{constructor(t,n=1){this.buffer=t,this.stride=n,this.BYTES_PER_ELEMENT=t.BYTES_PER_ELEMENT,this.ArrayType=t.constructor,this._resize(this.length=Math.ceil(t.length/n))}get byteLength(){return Math.ceil(this.length*this.stride)*this.BYTES_PER_ELEMENT}get reservedLength(){return this.buffer.length/this.stride}get reservedByteLength(){return this.buffer.byteLength}set(t,n){return this}append(t){return this.set(this.length,t)}reserve(t){if(t>0){this.length+=t;const n=this.stride,r=this.length*n,i=this.buffer.length;r>=i&&this._resize(i===0?XA(r*1,this.BYTES_PER_ELEMENT):XA(r*2,this.BYTES_PER_ELEMENT))}return this}flush(t=this.length){t=XA(t*this.stride,this.BYTES_PER_ELEMENT);const n=uVe(this.buffer,t);return this.clear(),n}clear(){return this.length=0,this._resize(0),this}_resize(t){return this.buffer=wT(new this.ArrayType(t),this.buffer)}}QI.prototype.offset=0;class Y_ extends QI{last(){return this.get(this.length-1)}get(t){return this.buffer[t]}set(t,n){return this.reserve(t-this.length+1),this.buffer[t*this.stride]=n,this}}class kne extends Y_{constructor(t=new Uint8Array(0)){super(t,1/8),this.numValid=0}get numInvalid(){return this.length-this.numValid}get(t){return this.buffer[t>>3]>>t%8&1}set(t,n){const{buffer:r}=this.reserve(t-this.length+1),i=t>>3,s=t%8,o=r[i]>>s&1;return n?o===0&&(r[i]|=1<this.length&&this.set(t-1,0),super.flush(t+1)}}let Ws=class{constructor({type:t,nullValues:n}){this.length=0,this.finished=!1,this.type=t,this.children=[],this.nullValues=n,this.stride=Ga(t),this._nulls=new kne,n&&n.length>0&&(this._isValid=oVe(n))}static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t){throw new Error('"throughDOM" not available in this environment')}toVector(){return new _n([this.flush()])}get ArrayType(){return this.type.ArrayType}get nullCount(){return this._nulls.numInvalid}get numChildren(){return this.children.length}get byteLength(){let t=0;const{_offsets:n,_values:r,_nulls:i,_typeIds:s,children:o}=this;return n&&(t+=n.byteLength),r&&(t+=r.byteLength),i&&(t+=i.byteLength),s&&(t+=s.byteLength),o.reduce((a,u)=>a+u.byteLength,t)}get reservedLength(){return this._nulls.reservedLength}get reservedByteLength(){let t=0;return this._offsets&&(t+=this._offsets.reservedByteLength),this._values&&(t+=this._values.reservedByteLength),this._nulls&&(t+=this._nulls.reservedByteLength),this._typeIds&&(t+=this._typeIds.reservedByteLength),this.children.reduce((n,r)=>n+r.reservedByteLength,t)}get valueOffsets(){return this._offsets?this._offsets.buffer:null}get values(){return this._values?this._values.buffer:null}get nullBitmap(){return this._nulls?this._nulls.buffer:null}get typeIds(){return this._typeIds?this._typeIds.buffer:null}append(t){return this.set(this.length,t)}isValid(t){return this._isValid(t)}set(t,n){return this.setValid(t,this.isValid(n))&&this.setValue(t,n),this}setValue(t,n){this._setValue(this,t,n)}setValid(t,n){return this.length=this._nulls.set(t,+n).length,n}addChild(t,n=`${this.numChildren}`){throw new Error(`Cannot append children to non-nested type "${this.type}"`)}getChildAt(t){return this.children[t]||null}flush(){let t,n,r,i;const{type:s,length:o,nullCount:a,_typeIds:u,_offsets:l,_values:c,_nulls:f}=this;(n=u==null?void 0:u.flush(o))?i=l==null?void 0:l.flush(o):(i=l==null?void 0:l.flush(o))?t=c==null?void 0:c.flush(l.last()):t=c==null?void 0:c.flush(o),a>0&&(r=f==null?void 0:f.flush(o));const d=this.children.map(h=>h.flush());return this.clear(),Hi({type:s,length:o,nullCount:a,children:d,child:d[0],data:t,typeIds:n,nullBitmap:r,valueOffsets:i})}finish(){this.finished=!0;for(const t of this.children)t.finish();return this}clear(){var t,n,r,i;this.length=0,(t=this._nulls)===null||t===void 0||t.clear(),(n=this._values)===null||n===void 0||n.clear(),(r=this._offsets)===null||r===void 0||r.clear(),(i=this._typeIds)===null||i===void 0||i.clear();for(const s of this.children)s.clear();return this}};Ws.prototype.length=1;Ws.prototype.stride=1;Ws.prototype.children=null;Ws.prototype.finished=!1;Ws.prototype.nullValues=null;Ws.prototype._isValid=()=>!0;class If extends Ws{constructor(t){super(t),this._values=new Y_(new this.ArrayType(0),this.stride)}setValue(t,n){const r=this._values;return r.reserve(t-r.length+1),super.setValue(t,n)}}class XI extends Ws{constructor(t){super(t),this._pendingLength=0,this._offsets=new Dne}setValue(t,n){const r=this._pending||(this._pending=new Map),i=r.get(t);i&&(this._pendingLength-=i.length),this._pendingLength+=n instanceof GI?n[ba].length:n.length,r.set(t,n)}setValid(t,n){return super.setValid(t,n)?!0:((this._pending||(this._pending=new Map)).set(t,void 0),!1)}clear(){return this._pendingLength=0,this._pending=void 0,super.clear()}flush(){return this._flush(),super.flush()}finish(){return this._flush(),super.finish()}_flush(){const t=this._pending,n=this._pendingLength;return this._pendingLength=0,this._pending=void 0,t&&t.size>0&&this._flushPending(t,n),this}}class eR{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}offset(){return this.bb.readInt64(this.bb_pos)}metaDataLength(){return this.bb.readInt32(this.bb_pos+8)}bodyLength(){return this.bb.readInt64(this.bb_pos+16)}static sizeOf(){return 24}static createBlock(t,n,r,i){return t.prep(8,24),t.writeInt64(i),t.pad(4),t.writeInt32(r),t.writeInt64(n),t.offset()}}const JA=2,eu=4,Zu=4,zn=4,fc=new Int32Array(2),TU=new Float32Array(fc.buffer),SU=new Float64Array(fc.buffer),_1=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;let yl=class tR{constructor(t,n){this.low=t|0,this.high=n|0}static create(t,n){return t==0&&n==0?tR.ZERO:new tR(t,n)}toFloat64(){return(this.low>>>0)+this.high*4294967296}equals(t){return this.low==t.low&&this.high==t.high}};yl.ZERO=new yl(0,0);var nR;(function(e){e[e.UTF8_BYTES=1]="UTF8_BYTES",e[e.UTF16_STRING=2]="UTF16_STRING"})(nR||(nR={}));let AT=class $ne{constructor(t){this.bytes_=t,this.position_=0}static allocate(t){return new $ne(new Uint8Array(t))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(t){this.position_=t}capacity(){return this.bytes_.length}readInt8(t){return this.readUint8(t)<<24>>24}readUint8(t){return this.bytes_[t]}readInt16(t){return this.readUint16(t)<<16>>16}readUint16(t){return this.bytes_[t]|this.bytes_[t+1]<<8}readInt32(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24}readUint32(t){return this.readInt32(t)>>>0}readInt64(t){return new yl(this.readInt32(t),this.readInt32(t+4))}readUint64(t){return new yl(this.readUint32(t),this.readUint32(t+4))}readFloat32(t){return fc[0]=this.readInt32(t),TU[0]}readFloat64(t){return fc[_1?0:1]=this.readInt32(t),fc[_1?1:0]=this.readInt32(t+4),SU[0]}writeInt8(t,n){this.bytes_[t]=n}writeUint8(t,n){this.bytes_[t]=n}writeInt16(t,n){this.bytes_[t]=n,this.bytes_[t+1]=n>>8}writeUint16(t,n){this.bytes_[t]=n,this.bytes_[t+1]=n>>8}writeInt32(t,n){this.bytes_[t]=n,this.bytes_[t+1]=n>>8,this.bytes_[t+2]=n>>16,this.bytes_[t+3]=n>>24}writeUint32(t,n){this.bytes_[t]=n,this.bytes_[t+1]=n>>8,this.bytes_[t+2]=n>>16,this.bytes_[t+3]=n>>24}writeInt64(t,n){this.writeInt32(t,n.low),this.writeInt32(t+4,n.high)}writeUint64(t,n){this.writeUint32(t,n.low),this.writeUint32(t+4,n.high)}writeFloat32(t,n){TU[0]=n,this.writeInt32(t,fc[0])}writeFloat64(t,n){SU[0]=n,this.writeInt32(t,fc[_1?0:1]),this.writeInt32(t+4,fc[_1?1:0])}getBufferIdentifier(){if(this.bytes_.length>10)+55296,(o&1023)+56320))}return i}__union_with_string(t,n){return typeof t=="string"?this.__string(n):this.__union(t,n)}__indirect(t){return t+this.readInt32(t)}__vector(t){return t+this.readInt32(t)+eu}__vector_len(t){return this.readInt32(t+this.readInt32(t))}__has_identifier(t){if(t.length!=Zu)throw new Error("FlatBuffers: file identifier must be length "+Zu);for(let n=0;nthis.minalign&&(this.minalign=t);const r=~(this.bb.capacity()-this.space+n)+1&t-1;for(;this.space=0&&this.vtable[n]==0;n--);const r=n+1;for(;n>=0;n--)this.addInt16(this.vtable[n]!=0?t-this.vtable[n]:0);const i=2;this.addInt16(t-this.object_start);const s=(r+i)*JA;this.addInt16(s);let o=0;const a=this.space;e:for(n=0;n=0;o--)this.writeInt8(s.charCodeAt(o))}this.prep(this.minalign,eu+i),this.addOffset(t),i&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(t,n){this.finish(t,n,!0)}requiredField(t,n){const r=this.bb.capacity()-t,i=r-this.bb.readInt32(r);if(!(this.bb.readInt16(i+n)!=0))throw new Error("FlatBuffers: field "+n+" must be set")}startVector(t,n,r){this.notNested(),this.vector_num_elems=n,this.prep(eu,t*n),this.prep(r,t*n)}endVector(){return this.writeInt32(this.vector_num_elems),this.offset()}createSharedString(t){if(!t)return 0;if(this.string_maps||(this.string_maps=new Map),this.string_maps.has(t))return this.string_maps.get(t);const n=this.createString(t);return this.string_maps.set(t,n),n}createString(t){if(!t)return 0;let n;if(t instanceof Uint8Array)n=t;else{n=[];let r=0;for(;r=56320)i=s;else{const o=t.charCodeAt(r++);i=(s<<10)+o+-56613888}i<128?n.push(i):(i<2048?n.push(i>>6&31|192):(i<65536?n.push(i>>12&15|224):n.push(i>>18&7|240,i>>12&63|128),n.push(i>>6&63|128)),n.push(i&63|128))}}this.addInt8(0),this.startVector(1,n.length,1),this.bb.setPosition(this.space-=n.length);for(let r=0,i=this.space,s=this.bb.bytes();r=0;r--)t.addInt32(n[r]);return t.endVector()}static startTypeIdsVector(t,n){t.startVector(4,n,4)}static endUnion(t){return t.endObject()}static createUnion(t,n,r){return As.startUnion(t),As.addMode(t,n),As.addTypeIds(t,r),As.endUnion(t)}}class cd{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsUtf8(t,n){return(n||new cd).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUtf8(t,n){return t.setPosition(t.position()+zn),(n||new cd).__init(t.readInt32(t.position())+t.position(),t)}static startUtf8(t){t.startObject(0)}static endUtf8(t){return t.endObject()}static createUtf8(t){return cd.startUtf8(t),cd.endUtf8(t)}}var pr;(function(e){e[e.NONE=0]="NONE",e[e.Null=1]="Null",e[e.Int=2]="Int",e[e.FloatingPoint=3]="FloatingPoint",e[e.Binary=4]="Binary",e[e.Utf8=5]="Utf8",e[e.Bool=6]="Bool",e[e.Decimal=7]="Decimal",e[e.Date=8]="Date",e[e.Time=9]="Time",e[e.Timestamp=10]="Timestamp",e[e.Interval=11]="Interval",e[e.List=12]="List",e[e.Struct_=13]="Struct_",e[e.Union=14]="Union",e[e.FixedSizeBinary=15]="FixedSizeBinary",e[e.FixedSizeList=16]="FixedSizeList",e[e.Map=17]="Map",e[e.Duration=18]="Duration",e[e.LargeBinary=19]="LargeBinary",e[e.LargeUtf8=20]="LargeUtf8",e[e.LargeList=21]="LargeList"})(pr||(pr={}));let Ao=class yb{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsField(t,n){return(n||new yb).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsField(t,n){return t.setPosition(t.position()+zn),(n||new yb).__init(t.readInt32(t.position())+t.position(),t)}name(t){const n=this.bb.__offset(this.bb_pos,4);return n?this.bb.__string(this.bb_pos+n,t):null}nullable(){const t=this.bb.__offset(this.bb_pos,6);return t?!!this.bb.readInt8(this.bb_pos+t):!1}typeType(){const t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readUint8(this.bb_pos+t):pr.NONE}type(t){const n=this.bb.__offset(this.bb_pos,10);return n?this.bb.__union(t,this.bb_pos+n):null}dictionary(t){const n=this.bb.__offset(this.bb_pos,12);return n?(t||new el).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}children(t,n){const r=this.bb.__offset(this.bb_pos,14);return r?(n||new yb).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+t*4),this.bb):null}childrenLength(){const t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,n){const r=this.bb.__offset(this.bb_pos,16);return r?(n||new Gr).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+t*4),this.bb):null}customMetadataLength(){const t=this.bb.__offset(this.bb_pos,16);return t?this.bb.__vector_len(this.bb_pos+t):0}static startField(t){t.startObject(7)}static addName(t,n){t.addFieldOffset(0,n,0)}static addNullable(t,n){t.addFieldInt8(1,+n,0)}static addTypeType(t,n){t.addFieldInt8(2,n,pr.NONE)}static addType(t,n){t.addFieldOffset(3,n,0)}static addDictionary(t,n){t.addFieldOffset(4,n,0)}static addChildren(t,n){t.addFieldOffset(5,n,0)}static createChildrenVector(t,n){t.startVector(4,n.length,4);for(let r=n.length-1;r>=0;r--)t.addOffset(n[r]);return t.endVector()}static startChildrenVector(t,n){t.startVector(4,n,4)}static addCustomMetadata(t,n){t.addFieldOffset(6,n,0)}static createCustomMetadataVector(t,n){t.startVector(4,n.length,4);for(let r=n.length-1;r>=0;r--)t.addOffset(n[r]);return t.endVector()}static startCustomMetadataVector(t,n){t.startVector(4,n,4)}static endField(t){return t.endObject()}},qa=class Wu{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsSchema(t,n){return(n||new Wu).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSchema(t,n){return t.setPosition(t.position()+zn),(n||new Wu).__init(t.readInt32(t.position())+t.position(),t)}endianness(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):mm.Little}fields(t,n){const r=this.bb.__offset(this.bb_pos,6);return r?(n||new Ao).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+t*4),this.bb):null}fieldsLength(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,n){const r=this.bb.__offset(this.bb_pos,8);return r?(n||new Gr).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+t*4),this.bb):null}customMetadataLength(){const t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}features(t){const n=this.bb.__offset(this.bb_pos,10);return n?this.bb.readInt64(this.bb.__vector(this.bb_pos+n)+t*8):this.bb.createLong(0,0)}featuresLength(){const t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}static startSchema(t){t.startObject(4)}static addEndianness(t,n){t.addFieldInt16(0,n,mm.Little)}static addFields(t,n){t.addFieldOffset(1,n,0)}static createFieldsVector(t,n){t.startVector(4,n.length,4);for(let r=n.length-1;r>=0;r--)t.addOffset(n[r]);return t.endVector()}static startFieldsVector(t,n){t.startVector(4,n,4)}static addCustomMetadata(t,n){t.addFieldOffset(2,n,0)}static createCustomMetadataVector(t,n){t.startVector(4,n.length,4);for(let r=n.length-1;r>=0;r--)t.addOffset(n[r]);return t.endVector()}static startCustomMetadataVector(t,n){t.startVector(4,n,4)}static addFeatures(t,n){t.addFieldOffset(3,n,0)}static createFeaturesVector(t,n){t.startVector(8,n.length,8);for(let r=n.length-1;r>=0;r--)t.addInt64(n[r]);return t.endVector()}static startFeaturesVector(t,n){t.startVector(8,n,8)}static endSchema(t){return t.endObject()}static finishSchemaBuffer(t,n){t.finish(n)}static finishSizePrefixedSchemaBuffer(t,n){t.finish(n,void 0,!0)}static createSchema(t,n,r,i,s){return Wu.startSchema(t),Wu.addEndianness(t,n),Wu.addFields(t,r),Wu.addCustomMetadata(t,i),Wu.addFeatures(t,s),Wu.endSchema(t)}};class Js{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsFooter(t,n){return(n||new Js).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFooter(t,n){return t.setPosition(t.position()+zn),(n||new Js).__init(t.readInt32(t.position())+t.position(),t)}version(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):pm.V1}schema(t){const n=this.bb.__offset(this.bb_pos,6);return n?(t||new qa).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}dictionaries(t,n){const r=this.bb.__offset(this.bb_pos,8);return r?(n||new eR).__init(this.bb.__vector(this.bb_pos+r)+t*24,this.bb):null}dictionariesLength(){const t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}recordBatches(t,n){const r=this.bb.__offset(this.bb_pos,10);return r?(n||new eR).__init(this.bb.__vector(this.bb_pos+r)+t*24,this.bb):null}recordBatchesLength(){const t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,n){const r=this.bb.__offset(this.bb_pos,12);return r?(n||new Gr).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+t*4),this.bb):null}customMetadataLength(){const t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}static startFooter(t){t.startObject(5)}static addVersion(t,n){t.addFieldInt16(0,n,pm.V1)}static addSchema(t,n){t.addFieldOffset(1,n,0)}static addDictionaries(t,n){t.addFieldOffset(2,n,0)}static startDictionariesVector(t,n){t.startVector(24,n,8)}static addRecordBatches(t,n){t.addFieldOffset(3,n,0)}static startRecordBatchesVector(t,n){t.startVector(24,n,8)}static addCustomMetadata(t,n){t.addFieldOffset(4,n,0)}static createCustomMetadataVector(t,n){t.startVector(4,n.length,4);for(let r=n.length-1;r>=0;r--)t.addOffset(n[r]);return t.endVector()}static startCustomMetadataVector(t,n){t.startVector(4,n,4)}static endFooter(t){return t.endObject()}static finishFooterBuffer(t,n){t.finish(n)}static finishSizePrefixedFooterBuffer(t,n){t.finish(n,void 0,!0)}}class An{constructor(t=[],n,r){this.fields=t||[],this.metadata=n||new Map,r||(r=rR(t)),this.dictionaries=r}get[Symbol.toStringTag](){return"Schema"}get names(){return this.fields.map(t=>t.name)}toString(){return`Schema<{ ${this.fields.map((t,n)=>`${n}: ${t}`).join(", ")} }>`}select(t){const n=new Set(t),r=this.fields.filter(i=>n.has(i.name));return new An(r,this.metadata)}selectAt(t){const n=t.map(r=>this.fields[r]).filter(Boolean);return new An(n,this.metadata)}assign(...t){const n=t[0]instanceof An?t[0]:Array.isArray(t[0])?new An(t[0]):new An(t),r=[...this.fields],i=v1(v1(new Map,this.metadata),n.metadata),s=n.fields.filter(a=>{const u=r.findIndex(l=>l.name===a.name);return~u?(r[u]=a.clone({metadata:v1(v1(new Map,r[u].metadata),a.metadata)}))&&!1:!0}),o=rR(s,new Map);return new An([...r,...s],i,new Map([...this.dictionaries,...o]))}}An.prototype.fields=null;An.prototype.metadata=null;An.prototype.dictionaries=null;class In{constructor(t,n,r=!1,i){this.name=t,this.type=n,this.nullable=r,this.metadata=i||new Map}static new(...t){let[n,r,i,s]=t;return t[0]&&typeof t[0]=="object"&&({name:n}=t[0],r===void 0&&(r=t[0].type),i===void 0&&(i=t[0].nullable),s===void 0&&(s=t[0].metadata)),new In(`${n}`,r,i,s)}get typeId(){return this.type.typeId}get[Symbol.toStringTag](){return"Field"}toString(){return`${this.name}: ${this.type}`}clone(...t){let[n,r,i,s]=t;return!t[0]||typeof t[0]!="object"?[n=this.name,r=this.type,i=this.nullable,s=this.metadata]=t:{name:n=this.name,type:r=this.type,nullable:i=this.nullable,metadata:s=this.metadata}=t[0],In.new(n,r,i,s)}}In.prototype.type=null;In.prototype.name=null;In.prototype.nullable=null;In.prototype.metadata=null;function v1(e,t){return new Map([...e||new Map,...t||new Map])}function rR(e,t=new Map){for(let n=-1,r=e.length;++n0&&rR(s.children,t)}return t}var IU=yl,lVe=Lne,cVe=AT;class iR{constructor(t,n=ro.V4,r,i){this.schema=t,this.version=n,r&&(this._recordBatches=r),i&&(this._dictionaryBatches=i)}static decode(t){t=new cVe(Pn(t));const n=Js.getRootAsFooter(t),r=An.decode(n.schema());return new fVe(r,n)}static encode(t){const n=new lVe,r=An.encode(n,t.schema);Js.startRecordBatchesVector(n,t.numRecordBatches);for(const o of[...t.recordBatches()].slice().reverse())af.encode(n,o);const i=n.endVector();Js.startDictionariesVector(n,t.numDictionaries);for(const o of[...t.dictionaryBatches()].slice().reverse())af.encode(n,o);const s=n.endVector();return Js.startFooter(n),Js.addSchema(n,r),Js.addVersion(n,ro.V4),Js.addRecordBatches(n,i),Js.addDictionaries(n,s),Js.finishFooterBuffer(n,Js.endFooter(n)),n.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}*recordBatches(){for(let t,n=-1,r=this.numRecordBatches;++n=0&&t=0&&t=0&&t=0&&tthis._closedPromiseResolve=t)}get closed(){return this._closedPromise}cancel(t){return Ju(this,void 0,void 0,function*(){yield this.return(t)})}write(t){this._ensureOpen()&&(this.resolvers.length<=0?this._values.push(t):this.resolvers.shift().resolve({done:!1,value:t}))}abort(t){this._closedPromiseResolve&&(this.resolvers.length<=0?this._error={error:t}:this.resolvers.shift().reject({done:!0,value:t}))}close(){if(this._closedPromiseResolve){const{resolvers:t}=this;for(;t.length>0;)t.shift().resolve(b1);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(t){return yU.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,t)}toNodeStream(t){return yU.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,t)}throw(t){return Ju(this,void 0,void 0,function*(){return yield this.abort(t),b1})}return(t){return Ju(this,void 0,void 0,function*(){return yield this.close(),b1})}read(t){return Ju(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return Ju(this,void 0,void 0,function*(){return(yield this.next(t,"peek")).value})}next(...t){return this._values.length>0?Promise.resolve({done:!1,value:this._values.shift()}):this._error?Promise.reject({done:!0,value:this._error.error}):this._closedPromiseResolve?new Promise((n,r)=>{this.resolvers.push({resolve:n,reject:r})}):Promise.resolve(b1)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error("AsyncQueue is closed")}}class ZA extends dVe{write(t){if((t=Pn(t)).byteLength>0)return super.write(t)}toString(t=!1){return t?Q2(this.toUint8Array(!0)):this.toUint8Array(!1).then(Q2)}toUint8Array(t=!1){return t?Pu(this._values)[0]:Ju(this,void 0,void 0,function*(){var n,r;const i=[];let s=0;try{for(var o=q0(this),a;a=yield o.next(),!a.done;){const u=a.value;i.push(u),s+=u.byteLength}}catch(u){n={error:u}}finally{try{a&&!a.done&&(r=o.return)&&(yield r.call(o))}finally{if(n)throw n.error}}return Pu(i,s)[0]})}}class Bne extends XI{constructor(t){super(t),this._values=new QI(new Uint8Array(0))}get byteLength(){let t=this._pendingLength+this.length*4;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),t}setValue(t,n){return super.setValue(t,Pn(n))}_flushPending(t,n){const r=this._offsets,i=this._values.reserve(n).buffer;let s=0;for(const[o,a]of t)if(a===void 0)r.set(o,0);else{const u=a.length;i.set(a,s),r.set(o,u),s+=u}}}class hVe extends Ws{constructor(t){super(t),this._values=new kne}setValue(t,n){this._values.set(t,+n)}}class JI extends If{}JI.prototype._setValue=Kte;class jne extends JI{}jne.prototype._setValue=W$;class Une extends JI{}Une.prototype._setValue=q$;class Vne extends If{}Vne.prototype._setValue=Jte;class pVe extends Ws{constructor({type:t,nullValues:n,dictionaryHashFunction:r}){super({type:new of(t.dictionary,t.indices,t.id,t.isOrdered)}),this._nulls=null,this._dictionaryOffset=0,this._keysToIndices=Object.create(null),this.indices=DT({type:this.type.indices,nullValues:n}),this.dictionary=DT({type:this.type.dictionary,nullValues:null}),typeof r=="function"&&(this.valueToKey=r)}get values(){return this.indices.values}get nullCount(){return this.indices.nullCount}get nullBitmap(){return this.indices.nullBitmap}get byteLength(){return this.indices.byteLength+this.dictionary.byteLength}get reservedLength(){return this.indices.reservedLength+this.dictionary.reservedLength}get reservedByteLength(){return this.indices.reservedByteLength+this.dictionary.reservedByteLength}isValid(t){return this.indices.isValid(t)}setValid(t,n){const r=this.indices;return n=r.setValid(t,n),this.length=r.length,n}setValue(t,n){const r=this._keysToIndices,i=this.valueToKey(n);let s=r[i];return s===void 0&&(r[i]=s=this._dictionaryOffset+this.dictionary.append(n).length-1),this.indices.setValue(t,s)}flush(){const t=this.type,n=this._dictionary,r=this.dictionary.toVector(),i=this.indices.flush().clone(t);return i.dictionary=n?n.concat(r):r,this.finished||(this._dictionaryOffset+=r.length),this._dictionary=i.dictionary,this.clear(),i}finish(){return this.indices.finish(),this.dictionary.finish(),this._dictionaryOffset=0,this._keysToIndices=Object.create(null),super.finish()}clear(){return this.indices.clear(),this.dictionary.clear(),super.clear()}valueToKey(t){return typeof t=="string"?t:`${t}`}}class zne extends If{}zne.prototype._setValue=Gte;class mVe extends Ws{setValue(t,n){const[r]=this.children,i=t*this.stride;for(let s=-1,o=n.length;++s0)throw new Error("FixedSizeListBuilder can only have one child.");const r=this.children.push(t);return this.type=new hm(this.type.listSize,new In(n,t.type,!0)),r}}class ZI extends If{setValue(t,n){this._values.set(t,n)}}class gVe extends ZI{setValue(t,n){super.setValue(t,Wte(n))}}class yVe extends ZI{}class _Ve extends ZI{}class ex extends If{}ex.prototype._setValue=tne;class Hne extends ex{}Hne.prototype._setValue=t3;class Wne extends ex{}Wne.prototype._setValue=n3;class Yl extends If{setValue(t,n){this._values.set(t,n)}}class vVe extends Yl{}class bVe extends Yl{}class EVe extends Yl{}class wVe extends Yl{}class TVe extends Yl{}class SVe extends Yl{}class IVe extends Yl{}class xVe extends Yl{}class CVe extends XI{constructor(t){super(t),this._offsets=new Dne}addChild(t,n="0"){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=t,this.type=new dm(new In(n,t.type,!0)),this.numChildren-1}_flushPending(t){const n=this._offsets,[r]=this.children;for(const[i,s]of t)if(typeof s>"u")n.set(i,0);else{const o=s.length,a=n.set(i,o).buffer[i];for(let u=-1;++u0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=t,this.type=new Vy(new In(n,t.type,!0),this.type.keysSorted),this.numChildren-1}_flushPending(t){const n=this._offsets,[r]=this.children;for(const[i,s]of t)if(s===void 0)n.set(i,0);else{let{[i]:o,[i+1]:a}=n.set(i,s.size).buffer;for(const u of s.entries())if(r.set(o,u),++o>=a)break}}}class OVe extends Ws{setValue(t,n){}setValid(t,n){return this.length=Math.max(t+1,this.length),n}}class PVe extends Ws{setValue(t,n){const{children:r,type:i}=this;switch(Array.isArray(n)||n.constructor){case!0:return i.children.forEach((s,o)=>r[o].set(t,n[o]));case Map:return i.children.forEach((s,o)=>r[o].set(t,n.get(s.name)));default:return i.children.forEach((s,o)=>r[o].set(t,n[s.name]))}}setValid(t,n){return super.setValid(t,n)||this.children.forEach(r=>r.setValid(t,n)),n}addChild(t,n=`${this.numChildren}`){const r=this.children.push(t);return this.type=new Yi([...this.type.children,new In(n,t.type,!0)]),r}}class Qm extends If{}Qm.prototype._setValue=Qte;class qne extends Qm{}qne.prototype._setValue=Y$;class Yne extends Qm{}Yne.prototype._setValue=G$;class Gne extends Qm{}Gne.prototype._setValue=K$;class Kne extends Qm{}Kne.prototype._setValue=Q$;class Xm extends If{}Xm.prototype._setValue=Xte;class Qne extends Xm{}Qne.prototype._setValue=X$;class Xne extends Xm{}Xne.prototype._setValue=J$;class Jne extends Xm{}Jne.prototype._setValue=Z$;class Zne extends Xm{}Zne.prototype._setValue=e3;class c3 extends Ws{constructor(t){super(t),this._typeIds=new Y_(new Int8Array(0),1),typeof t.valueToChildTypeId=="function"&&(this._valueToChildTypeId=t.valueToChildTypeId)}get typeIdToChildIndex(){return this.type.typeIdToChildIndex}append(t,n){return this.set(this.length,t,n)}set(t,n,r){return r===void 0&&(r=this._valueToChildTypeId(this,n,t)),this.setValid(t,this.isValid(n))&&this.setValue(t,n,r),this}setValue(t,n,r){this._typeIds.set(t,r);const i=this.type.typeIdToChildIndex[r],s=this.children[i];s==null||s.set(t,n)}addChild(t,n=`${this.children.length}`){const r=this.children.push(t),{type:{children:i,mode:s,typeIds:o}}=this,a=[...i,new In(n,t.type)];return this.type=new Uy(s,[...o,r],a),r}_valueToChildTypeId(t,n,r){throw new Error("Cannot map UnionBuilder value to child typeId. Pass the `childTypeId` as the second argument to unionBuilder.append(), or supply a `valueToChildTypeId` function as part of the UnionBuilder constructor options.")}}class RVe extends c3{}class NVe extends c3{constructor(t){super(t),this._offsets=new Y_(new Int32Array(0))}setValue(t,n,r){const i=this._typeIds.set(t,r).buffer[t],s=this.getChildAt(this.type.typeIdToChildIndex[i]),o=this._offsets.set(t,s.length).buffer[t];s==null||s.set(o,n)}}class ere extends XI{constructor(t){super(t),this._values=new QI(new Uint8Array(0))}get byteLength(){let t=this._pendingLength+this.length*4;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),t}setValue(t,n){return super.setValue(t,O$(n))}_flushPending(t,n){}}ere.prototype._flushPending=Bne.prototype._flushPending;class kVe extends on{visitNull(){return OVe}visitBool(){return hVe}visitInt(){return Yl}visitInt8(){return vVe}visitInt16(){return bVe}visitInt32(){return EVe}visitInt64(){return wVe}visitUint8(){return TVe}visitUint16(){return SVe}visitUint32(){return IVe}visitUint64(){return xVe}visitFloat(){return ZI}visitFloat16(){return gVe}visitFloat32(){return yVe}visitFloat64(){return _Ve}visitUtf8(){return ere}visitBinary(){return Bne}visitFixedSizeBinary(){return zne}visitDate(){return JI}visitDateDay(){return jne}visitDateMillisecond(){return Une}visitTimestamp(){return Qm}visitTimestampSecond(){return qne}visitTimestampMillisecond(){return Yne}visitTimestampMicrosecond(){return Gne}visitTimestampNanosecond(){return Kne}visitTime(){return Xm}visitTimeSecond(){return Qne}visitTimeMillisecond(){return Xne}visitTimeMicrosecond(){return Jne}visitTimeNanosecond(){return Zne}visitDecimal(){return Vne}visitList(){return CVe}visitStruct(){return PVe}visitUnion(){return c3}visitDenseUnion(){return NVe}visitSparseUnion(){return RVe}visitDictionary(){return pVe}visitInterval(){return ex}visitIntervalDayTime(){return Hne}visitIntervalYearMonth(){return Wne}visitFixedSizeList(){return mVe}visitMap(){return AVe}}const DVe=new kVe;class Rt extends on{compareSchemas(t,n){return t===n||n instanceof t.constructor&&this.compareManyFields(t.fields,n.fields)}compareManyFields(t,n){return t===n||Array.isArray(t)&&Array.isArray(n)&&t.length===n.length&&t.every((r,i)=>this.compareFields(r,n[i]))}compareFields(t,n){return t===n||n instanceof t.constructor&&t.name===n.name&&t.nullable===n.nullable&&this.visit(t.type,n.type)}}function qs(e,t){return t instanceof e.constructor}function G_(e,t){return e===t||qs(e,t)}function Gl(e,t){return e===t||qs(e,t)&&e.bitWidth===t.bitWidth&&e.isSigned===t.isSigned}function tx(e,t){return e===t||qs(e,t)&&e.precision===t.precision}function $Ve(e,t){return e===t||qs(e,t)&&e.byteWidth===t.byteWidth}function f3(e,t){return e===t||qs(e,t)&&e.unit===t.unit}function K_(e,t){return e===t||qs(e,t)&&e.unit===t.unit&&e.timezone===t.timezone}function Q_(e,t){return e===t||qs(e,t)&&e.unit===t.unit&&e.bitWidth===t.bitWidth}function LVe(e,t){return e===t||qs(e,t)&&e.children.length===t.children.length&&uf.compareManyFields(e.children,t.children)}function MVe(e,t){return e===t||qs(e,t)&&e.children.length===t.children.length&&uf.compareManyFields(e.children,t.children)}function d3(e,t){return e===t||qs(e,t)&&e.mode===t.mode&&e.typeIds.every((n,r)=>n===t.typeIds[r])&&uf.compareManyFields(e.children,t.children)}function FVe(e,t){return e===t||qs(e,t)&&e.id===t.id&&e.isOrdered===t.isOrdered&&uf.visit(e.indices,t.indices)&&uf.visit(e.dictionary,t.dictionary)}function h3(e,t){return e===t||qs(e,t)&&e.unit===t.unit}function BVe(e,t){return e===t||qs(e,t)&&e.listSize===t.listSize&&e.children.length===t.children.length&&uf.compareManyFields(e.children,t.children)}function jVe(e,t){return e===t||qs(e,t)&&e.keysSorted===t.keysSorted&&e.children.length===t.children.length&&uf.compareManyFields(e.children,t.children)}Rt.prototype.visitNull=G_;Rt.prototype.visitBool=G_;Rt.prototype.visitInt=Gl;Rt.prototype.visitInt8=Gl;Rt.prototype.visitInt16=Gl;Rt.prototype.visitInt32=Gl;Rt.prototype.visitInt64=Gl;Rt.prototype.visitUint8=Gl;Rt.prototype.visitUint16=Gl;Rt.prototype.visitUint32=Gl;Rt.prototype.visitUint64=Gl;Rt.prototype.visitFloat=tx;Rt.prototype.visitFloat16=tx;Rt.prototype.visitFloat32=tx;Rt.prototype.visitFloat64=tx;Rt.prototype.visitUtf8=G_;Rt.prototype.visitBinary=G_;Rt.prototype.visitFixedSizeBinary=$Ve;Rt.prototype.visitDate=f3;Rt.prototype.visitDateDay=f3;Rt.prototype.visitDateMillisecond=f3;Rt.prototype.visitTimestamp=K_;Rt.prototype.visitTimestampSecond=K_;Rt.prototype.visitTimestampMillisecond=K_;Rt.prototype.visitTimestampMicrosecond=K_;Rt.prototype.visitTimestampNanosecond=K_;Rt.prototype.visitTime=Q_;Rt.prototype.visitTimeSecond=Q_;Rt.prototype.visitTimeMillisecond=Q_;Rt.prototype.visitTimeMicrosecond=Q_;Rt.prototype.visitTimeNanosecond=Q_;Rt.prototype.visitDecimal=G_;Rt.prototype.visitList=LVe;Rt.prototype.visitStruct=MVe;Rt.prototype.visitUnion=d3;Rt.prototype.visitDenseUnion=d3;Rt.prototype.visitSparseUnion=d3;Rt.prototype.visitDictionary=FVe;Rt.prototype.visitInterval=h3;Rt.prototype.visitIntervalDayTime=h3;Rt.prototype.visitIntervalYearMonth=h3;Rt.prototype.visitFixedSizeList=BVe;Rt.prototype.visitMap=jVe;const uf=new Rt;function sR(e,t){return uf.compareSchemas(e,t)}function DT(e){const t=e.type,n=new(DVe.getVisitFn(t)())(e);if(t.children&&t.children.length>0){const r=e.children||[],i={nullValues:e.nullValues},s=Array.isArray(r)?(o,a)=>r[a]||i:({name:o})=>r[o]||i;for(const[o,a]of t.children.entries()){const{type:u}=a,l=s(a,o);n.children.push(DT(Object.assign(Object.assign({},l),{type:u})))}}return n}function eO(e,t){return UVe(e,t.map(n=>n.data.concat()))}function UVe(e,t){const n=[...e.fields],r=[],i={numBatches:t.reduce((f,d)=>Math.max(f,d.length),0)};let s=0,o=0,a=-1;const u=t.length;let l,c=[];for(;i.numBatches-- >0;){for(o=Number.POSITIVE_INFINITY,a=-1;++a0&&(r[s++]=Hi({type:new Yi(n),length:o,nullCount:0,children:c.slice()})))}return[e=e.assign(n),r.map(f=>new no(e,f))]}function VVe(e,t,n,r,i){var s;const o=(t+63&-64)>>3;for(let a=-1,u=r.length;++a=t)c===t?n[a]=l:(n[a]=l.slice(0,t),i.numBatches=Math.max(i.numBatches,r[a].unshift(l.slice(t,c-t))));else{const f=e[a];e[a]=f.clone({nullable:!0}),n[a]=(s=l==null?void 0:l._changeLengthAndBackfillNullBitmap(t))!==null&&s!==void 0?s:Hi({type:f.type,length:t,nullCount:t,nullBitmap:new Uint8Array(o)})}}return n}var tre;class Os{constructor(...t){var n,r;if(t.length===0)return this.batches=[],this.schema=new An([]),this._offsets=[0],this;let i,s;t[0]instanceof An&&(i=t.shift()),t[t.length-1]instanceof Uint32Array&&(s=t.pop());const o=u=>{if(u){if(u instanceof no)return[u];if(u instanceof Os)return u.batches;if(u instanceof Mn){if(u.type instanceof Yi)return[new no(new An(u.type.children),u)]}else{if(Array.isArray(u))return u.flatMap(l=>o(l));if(typeof u[Symbol.iterator]=="function")return[...u].flatMap(l=>o(l));if(typeof u=="object"){const l=Object.keys(u),c=l.map(h=>new _n([u[h]])),f=new An(l.map((h,p)=>new In(String(h),c[p].type))),[,d]=eO(f,c);return d.length===0?[new no(u)]:d}}}return[]},a=t.flatMap(u=>o(u));if(i=(r=i??((n=a[0])===null||n===void 0?void 0:n.schema))!==null&&r!==void 0?r:new An([]),!(i instanceof An))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");for(const u of a){if(!(u instanceof no))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");if(!sR(i,u.schema))throw new TypeError("Table and inner RecordBatch schemas must be equivalent.")}this.schema=i,this.batches=a,this._offsets=s??Tne(this.data)}get data(){return this.batches.map(({data:t})=>t)}get numCols(){return this.schema.fields.length}get numRows(){return this.data.reduce((t,n)=>t+n.length,0)}get nullCount(){return this._nullCount===-1&&(this._nullCount=wne(this.data)),this._nullCount}isValid(t){return!1}get(t){return null}set(t,n){}indexOf(t,n){return-1}getByteLength(t){return 0}[Symbol.iterator](){return this.batches.length>0?l3.visit(new _n(this.data)):new Array(0)[Symbol.iterator]()}toArray(){return[...this]}toString(){return`[ +return true;`)}function aVe(e){return typeof e!="bigint"?Wc(e):_te?`${Wc(e)}n`:`"${Wc(e)}"`}const XA=(e,t)=>(Math.ceil(e)*t+63&-64||64)/t,uVe=(e,t=0)=>e.length>=t?e.subarray(0,t):wT(new e.constructor(t),e,0);class QI{constructor(t,n=1){this.buffer=t,this.stride=n,this.BYTES_PER_ELEMENT=t.BYTES_PER_ELEMENT,this.ArrayType=t.constructor,this._resize(this.length=Math.ceil(t.length/n))}get byteLength(){return Math.ceil(this.length*this.stride)*this.BYTES_PER_ELEMENT}get reservedLength(){return this.buffer.length/this.stride}get reservedByteLength(){return this.buffer.byteLength}set(t,n){return this}append(t){return this.set(this.length,t)}reserve(t){if(t>0){this.length+=t;const n=this.stride,r=this.length*n,i=this.buffer.length;r>=i&&this._resize(i===0?XA(r*1,this.BYTES_PER_ELEMENT):XA(r*2,this.BYTES_PER_ELEMENT))}return this}flush(t=this.length){t=XA(t*this.stride,this.BYTES_PER_ELEMENT);const n=uVe(this.buffer,t);return this.clear(),n}clear(){return this.length=0,this._resize(0),this}_resize(t){return this.buffer=wT(new this.ArrayType(t),this.buffer)}}QI.prototype.offset=0;class Y_ extends QI{last(){return this.get(this.length-1)}get(t){return this.buffer[t]}set(t,n){return this.reserve(t-this.length+1),this.buffer[t*this.stride]=n,this}}class Nne extends Y_{constructor(t=new Uint8Array(0)){super(t,1/8),this.numValid=0}get numInvalid(){return this.length-this.numValid}get(t){return this.buffer[t>>3]>>t%8&1}set(t,n){const{buffer:r}=this.reserve(t-this.length+1),i=t>>3,s=t%8,o=r[i]>>s&1;return n?o===0&&(r[i]|=1<this.length&&this.set(t-1,0),super.flush(t+1)}}let Ws=class{constructor({type:t,nullValues:n}){this.length=0,this.finished=!1,this.type=t,this.children=[],this.nullValues=n,this.stride=Ga(t),this._nulls=new Nne,n&&n.length>0&&(this._isValid=oVe(n))}static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t){throw new Error('"throughDOM" not available in this environment')}toVector(){return new _n([this.flush()])}get ArrayType(){return this.type.ArrayType}get nullCount(){return this._nulls.numInvalid}get numChildren(){return this.children.length}get byteLength(){let t=0;const{_offsets:n,_values:r,_nulls:i,_typeIds:s,children:o}=this;return n&&(t+=n.byteLength),r&&(t+=r.byteLength),i&&(t+=i.byteLength),s&&(t+=s.byteLength),o.reduce((a,u)=>a+u.byteLength,t)}get reservedLength(){return this._nulls.reservedLength}get reservedByteLength(){let t=0;return this._offsets&&(t+=this._offsets.reservedByteLength),this._values&&(t+=this._values.reservedByteLength),this._nulls&&(t+=this._nulls.reservedByteLength),this._typeIds&&(t+=this._typeIds.reservedByteLength),this.children.reduce((n,r)=>n+r.reservedByteLength,t)}get valueOffsets(){return this._offsets?this._offsets.buffer:null}get values(){return this._values?this._values.buffer:null}get nullBitmap(){return this._nulls?this._nulls.buffer:null}get typeIds(){return this._typeIds?this._typeIds.buffer:null}append(t){return this.set(this.length,t)}isValid(t){return this._isValid(t)}set(t,n){return this.setValid(t,this.isValid(n))&&this.setValue(t,n),this}setValue(t,n){this._setValue(this,t,n)}setValid(t,n){return this.length=this._nulls.set(t,+n).length,n}addChild(t,n=`${this.numChildren}`){throw new Error(`Cannot append children to non-nested type "${this.type}"`)}getChildAt(t){return this.children[t]||null}flush(){let t,n,r,i;const{type:s,length:o,nullCount:a,_typeIds:u,_offsets:l,_values:c,_nulls:f}=this;(n=u==null?void 0:u.flush(o))?i=l==null?void 0:l.flush(o):(i=l==null?void 0:l.flush(o))?t=c==null?void 0:c.flush(l.last()):t=c==null?void 0:c.flush(o),a>0&&(r=f==null?void 0:f.flush(o));const d=this.children.map(h=>h.flush());return this.clear(),Hi({type:s,length:o,nullCount:a,children:d,child:d[0],data:t,typeIds:n,nullBitmap:r,valueOffsets:i})}finish(){this.finished=!0;for(const t of this.children)t.finish();return this}clear(){var t,n,r,i;this.length=0,(t=this._nulls)===null||t===void 0||t.clear(),(n=this._values)===null||n===void 0||n.clear(),(r=this._offsets)===null||r===void 0||r.clear(),(i=this._typeIds)===null||i===void 0||i.clear();for(const s of this.children)s.clear();return this}};Ws.prototype.length=1;Ws.prototype.stride=1;Ws.prototype.children=null;Ws.prototype.finished=!1;Ws.prototype.nullValues=null;Ws.prototype._isValid=()=>!0;class If extends Ws{constructor(t){super(t),this._values=new Y_(new this.ArrayType(0),this.stride)}setValue(t,n){const r=this._values;return r.reserve(t-r.length+1),super.setValue(t,n)}}class XI extends Ws{constructor(t){super(t),this._pendingLength=0,this._offsets=new kne}setValue(t,n){const r=this._pending||(this._pending=new Map),i=r.get(t);i&&(this._pendingLength-=i.length),this._pendingLength+=n instanceof GI?n[ba].length:n.length,r.set(t,n)}setValid(t,n){return super.setValid(t,n)?!0:((this._pending||(this._pending=new Map)).set(t,void 0),!1)}clear(){return this._pendingLength=0,this._pending=void 0,super.clear()}flush(){return this._flush(),super.flush()}finish(){return this._flush(),super.finish()}_flush(){const t=this._pending,n=this._pendingLength;return this._pendingLength=0,this._pending=void 0,t&&t.size>0&&this._flushPending(t,n),this}}class eR{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}offset(){return this.bb.readInt64(this.bb_pos)}metaDataLength(){return this.bb.readInt32(this.bb_pos+8)}bodyLength(){return this.bb.readInt64(this.bb_pos+16)}static sizeOf(){return 24}static createBlock(t,n,r,i){return t.prep(8,24),t.writeInt64(i),t.pad(4),t.writeInt32(r),t.writeInt64(n),t.offset()}}const JA=2,eu=4,Zu=4,zn=4,fc=new Int32Array(2),TU=new Float32Array(fc.buffer),SU=new Float64Array(fc.buffer),_1=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;let yl=class tR{constructor(t,n){this.low=t|0,this.high=n|0}static create(t,n){return t==0&&n==0?tR.ZERO:new tR(t,n)}toFloat64(){return(this.low>>>0)+this.high*4294967296}equals(t){return this.low==t.low&&this.high==t.high}};yl.ZERO=new yl(0,0);var nR;(function(e){e[e.UTF8_BYTES=1]="UTF8_BYTES",e[e.UTF16_STRING=2]="UTF16_STRING"})(nR||(nR={}));let AT=class Dne{constructor(t){this.bytes_=t,this.position_=0}static allocate(t){return new Dne(new Uint8Array(t))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(t){this.position_=t}capacity(){return this.bytes_.length}readInt8(t){return this.readUint8(t)<<24>>24}readUint8(t){return this.bytes_[t]}readInt16(t){return this.readUint16(t)<<16>>16}readUint16(t){return this.bytes_[t]|this.bytes_[t+1]<<8}readInt32(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24}readUint32(t){return this.readInt32(t)>>>0}readInt64(t){return new yl(this.readInt32(t),this.readInt32(t+4))}readUint64(t){return new yl(this.readUint32(t),this.readUint32(t+4))}readFloat32(t){return fc[0]=this.readInt32(t),TU[0]}readFloat64(t){return fc[_1?0:1]=this.readInt32(t),fc[_1?1:0]=this.readInt32(t+4),SU[0]}writeInt8(t,n){this.bytes_[t]=n}writeUint8(t,n){this.bytes_[t]=n}writeInt16(t,n){this.bytes_[t]=n,this.bytes_[t+1]=n>>8}writeUint16(t,n){this.bytes_[t]=n,this.bytes_[t+1]=n>>8}writeInt32(t,n){this.bytes_[t]=n,this.bytes_[t+1]=n>>8,this.bytes_[t+2]=n>>16,this.bytes_[t+3]=n>>24}writeUint32(t,n){this.bytes_[t]=n,this.bytes_[t+1]=n>>8,this.bytes_[t+2]=n>>16,this.bytes_[t+3]=n>>24}writeInt64(t,n){this.writeInt32(t,n.low),this.writeInt32(t+4,n.high)}writeUint64(t,n){this.writeUint32(t,n.low),this.writeUint32(t+4,n.high)}writeFloat32(t,n){TU[0]=n,this.writeInt32(t,fc[0])}writeFloat64(t,n){SU[0]=n,this.writeInt32(t,fc[_1?0:1]),this.writeInt32(t+4,fc[_1?1:0])}getBufferIdentifier(){if(this.bytes_.length>10)+55296,(o&1023)+56320))}return i}__union_with_string(t,n){return typeof t=="string"?this.__string(n):this.__union(t,n)}__indirect(t){return t+this.readInt32(t)}__vector(t){return t+this.readInt32(t)+eu}__vector_len(t){return this.readInt32(t+this.readInt32(t))}__has_identifier(t){if(t.length!=Zu)throw new Error("FlatBuffers: file identifier must be length "+Zu);for(let n=0;nthis.minalign&&(this.minalign=t);const r=~(this.bb.capacity()-this.space+n)+1&t-1;for(;this.space=0&&this.vtable[n]==0;n--);const r=n+1;for(;n>=0;n--)this.addInt16(this.vtable[n]!=0?t-this.vtable[n]:0);const i=2;this.addInt16(t-this.object_start);const s=(r+i)*JA;this.addInt16(s);let o=0;const a=this.space;e:for(n=0;n=0;o--)this.writeInt8(s.charCodeAt(o))}this.prep(this.minalign,eu+i),this.addOffset(t),i&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(t,n){this.finish(t,n,!0)}requiredField(t,n){const r=this.bb.capacity()-t,i=r-this.bb.readInt32(r);if(!(this.bb.readInt16(i+n)!=0))throw new Error("FlatBuffers: field "+n+" must be set")}startVector(t,n,r){this.notNested(),this.vector_num_elems=n,this.prep(eu,t*n),this.prep(r,t*n)}endVector(){return this.writeInt32(this.vector_num_elems),this.offset()}createSharedString(t){if(!t)return 0;if(this.string_maps||(this.string_maps=new Map),this.string_maps.has(t))return this.string_maps.get(t);const n=this.createString(t);return this.string_maps.set(t,n),n}createString(t){if(!t)return 0;let n;if(t instanceof Uint8Array)n=t;else{n=[];let r=0;for(;r=56320)i=s;else{const o=t.charCodeAt(r++);i=(s<<10)+o+-56613888}i<128?n.push(i):(i<2048?n.push(i>>6&31|192):(i<65536?n.push(i>>12&15|224):n.push(i>>18&7|240,i>>12&63|128),n.push(i>>6&63|128)),n.push(i&63|128))}}this.addInt8(0),this.startVector(1,n.length,1),this.bb.setPosition(this.space-=n.length);for(let r=0,i=this.space,s=this.bb.bytes();r=0;r--)t.addInt32(n[r]);return t.endVector()}static startTypeIdsVector(t,n){t.startVector(4,n,4)}static endUnion(t){return t.endObject()}static createUnion(t,n,r){return As.startUnion(t),As.addMode(t,n),As.addTypeIds(t,r),As.endUnion(t)}}class cd{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsUtf8(t,n){return(n||new cd).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUtf8(t,n){return t.setPosition(t.position()+zn),(n||new cd).__init(t.readInt32(t.position())+t.position(),t)}static startUtf8(t){t.startObject(0)}static endUtf8(t){return t.endObject()}static createUtf8(t){return cd.startUtf8(t),cd.endUtf8(t)}}var pr;(function(e){e[e.NONE=0]="NONE",e[e.Null=1]="Null",e[e.Int=2]="Int",e[e.FloatingPoint=3]="FloatingPoint",e[e.Binary=4]="Binary",e[e.Utf8=5]="Utf8",e[e.Bool=6]="Bool",e[e.Decimal=7]="Decimal",e[e.Date=8]="Date",e[e.Time=9]="Time",e[e.Timestamp=10]="Timestamp",e[e.Interval=11]="Interval",e[e.List=12]="List",e[e.Struct_=13]="Struct_",e[e.Union=14]="Union",e[e.FixedSizeBinary=15]="FixedSizeBinary",e[e.FixedSizeList=16]="FixedSizeList",e[e.Map=17]="Map",e[e.Duration=18]="Duration",e[e.LargeBinary=19]="LargeBinary",e[e.LargeUtf8=20]="LargeUtf8",e[e.LargeList=21]="LargeList"})(pr||(pr={}));let Ao=class yb{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsField(t,n){return(n||new yb).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsField(t,n){return t.setPosition(t.position()+zn),(n||new yb).__init(t.readInt32(t.position())+t.position(),t)}name(t){const n=this.bb.__offset(this.bb_pos,4);return n?this.bb.__string(this.bb_pos+n,t):null}nullable(){const t=this.bb.__offset(this.bb_pos,6);return t?!!this.bb.readInt8(this.bb_pos+t):!1}typeType(){const t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readUint8(this.bb_pos+t):pr.NONE}type(t){const n=this.bb.__offset(this.bb_pos,10);return n?this.bb.__union(t,this.bb_pos+n):null}dictionary(t){const n=this.bb.__offset(this.bb_pos,12);return n?(t||new el).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}children(t,n){const r=this.bb.__offset(this.bb_pos,14);return r?(n||new yb).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+t*4),this.bb):null}childrenLength(){const t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,n){const r=this.bb.__offset(this.bb_pos,16);return r?(n||new Gr).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+t*4),this.bb):null}customMetadataLength(){const t=this.bb.__offset(this.bb_pos,16);return t?this.bb.__vector_len(this.bb_pos+t):0}static startField(t){t.startObject(7)}static addName(t,n){t.addFieldOffset(0,n,0)}static addNullable(t,n){t.addFieldInt8(1,+n,0)}static addTypeType(t,n){t.addFieldInt8(2,n,pr.NONE)}static addType(t,n){t.addFieldOffset(3,n,0)}static addDictionary(t,n){t.addFieldOffset(4,n,0)}static addChildren(t,n){t.addFieldOffset(5,n,0)}static createChildrenVector(t,n){t.startVector(4,n.length,4);for(let r=n.length-1;r>=0;r--)t.addOffset(n[r]);return t.endVector()}static startChildrenVector(t,n){t.startVector(4,n,4)}static addCustomMetadata(t,n){t.addFieldOffset(6,n,0)}static createCustomMetadataVector(t,n){t.startVector(4,n.length,4);for(let r=n.length-1;r>=0;r--)t.addOffset(n[r]);return t.endVector()}static startCustomMetadataVector(t,n){t.startVector(4,n,4)}static endField(t){return t.endObject()}},qa=class Wu{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsSchema(t,n){return(n||new Wu).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSchema(t,n){return t.setPosition(t.position()+zn),(n||new Wu).__init(t.readInt32(t.position())+t.position(),t)}endianness(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):mm.Little}fields(t,n){const r=this.bb.__offset(this.bb_pos,6);return r?(n||new Ao).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+t*4),this.bb):null}fieldsLength(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,n){const r=this.bb.__offset(this.bb_pos,8);return r?(n||new Gr).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+t*4),this.bb):null}customMetadataLength(){const t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}features(t){const n=this.bb.__offset(this.bb_pos,10);return n?this.bb.readInt64(this.bb.__vector(this.bb_pos+n)+t*8):this.bb.createLong(0,0)}featuresLength(){const t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}static startSchema(t){t.startObject(4)}static addEndianness(t,n){t.addFieldInt16(0,n,mm.Little)}static addFields(t,n){t.addFieldOffset(1,n,0)}static createFieldsVector(t,n){t.startVector(4,n.length,4);for(let r=n.length-1;r>=0;r--)t.addOffset(n[r]);return t.endVector()}static startFieldsVector(t,n){t.startVector(4,n,4)}static addCustomMetadata(t,n){t.addFieldOffset(2,n,0)}static createCustomMetadataVector(t,n){t.startVector(4,n.length,4);for(let r=n.length-1;r>=0;r--)t.addOffset(n[r]);return t.endVector()}static startCustomMetadataVector(t,n){t.startVector(4,n,4)}static addFeatures(t,n){t.addFieldOffset(3,n,0)}static createFeaturesVector(t,n){t.startVector(8,n.length,8);for(let r=n.length-1;r>=0;r--)t.addInt64(n[r]);return t.endVector()}static startFeaturesVector(t,n){t.startVector(8,n,8)}static endSchema(t){return t.endObject()}static finishSchemaBuffer(t,n){t.finish(n)}static finishSizePrefixedSchemaBuffer(t,n){t.finish(n,void 0,!0)}static createSchema(t,n,r,i,s){return Wu.startSchema(t),Wu.addEndianness(t,n),Wu.addFields(t,r),Wu.addCustomMetadata(t,i),Wu.addFeatures(t,s),Wu.endSchema(t)}};class Js{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsFooter(t,n){return(n||new Js).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFooter(t,n){return t.setPosition(t.position()+zn),(n||new Js).__init(t.readInt32(t.position())+t.position(),t)}version(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):pm.V1}schema(t){const n=this.bb.__offset(this.bb_pos,6);return n?(t||new qa).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}dictionaries(t,n){const r=this.bb.__offset(this.bb_pos,8);return r?(n||new eR).__init(this.bb.__vector(this.bb_pos+r)+t*24,this.bb):null}dictionariesLength(){const t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}recordBatches(t,n){const r=this.bb.__offset(this.bb_pos,10);return r?(n||new eR).__init(this.bb.__vector(this.bb_pos+r)+t*24,this.bb):null}recordBatchesLength(){const t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,n){const r=this.bb.__offset(this.bb_pos,12);return r?(n||new Gr).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+t*4),this.bb):null}customMetadataLength(){const t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}static startFooter(t){t.startObject(5)}static addVersion(t,n){t.addFieldInt16(0,n,pm.V1)}static addSchema(t,n){t.addFieldOffset(1,n,0)}static addDictionaries(t,n){t.addFieldOffset(2,n,0)}static startDictionariesVector(t,n){t.startVector(24,n,8)}static addRecordBatches(t,n){t.addFieldOffset(3,n,0)}static startRecordBatchesVector(t,n){t.startVector(24,n,8)}static addCustomMetadata(t,n){t.addFieldOffset(4,n,0)}static createCustomMetadataVector(t,n){t.startVector(4,n.length,4);for(let r=n.length-1;r>=0;r--)t.addOffset(n[r]);return t.endVector()}static startCustomMetadataVector(t,n){t.startVector(4,n,4)}static endFooter(t){return t.endObject()}static finishFooterBuffer(t,n){t.finish(n)}static finishSizePrefixedFooterBuffer(t,n){t.finish(n,void 0,!0)}}class An{constructor(t=[],n,r){this.fields=t||[],this.metadata=n||new Map,r||(r=rR(t)),this.dictionaries=r}get[Symbol.toStringTag](){return"Schema"}get names(){return this.fields.map(t=>t.name)}toString(){return`Schema<{ ${this.fields.map((t,n)=>`${n}: ${t}`).join(", ")} }>`}select(t){const n=new Set(t),r=this.fields.filter(i=>n.has(i.name));return new An(r,this.metadata)}selectAt(t){const n=t.map(r=>this.fields[r]).filter(Boolean);return new An(n,this.metadata)}assign(...t){const n=t[0]instanceof An?t[0]:Array.isArray(t[0])?new An(t[0]):new An(t),r=[...this.fields],i=v1(v1(new Map,this.metadata),n.metadata),s=n.fields.filter(a=>{const u=r.findIndex(l=>l.name===a.name);return~u?(r[u]=a.clone({metadata:v1(v1(new Map,r[u].metadata),a.metadata)}))&&!1:!0}),o=rR(s,new Map);return new An([...r,...s],i,new Map([...this.dictionaries,...o]))}}An.prototype.fields=null;An.prototype.metadata=null;An.prototype.dictionaries=null;class In{constructor(t,n,r=!1,i){this.name=t,this.type=n,this.nullable=r,this.metadata=i||new Map}static new(...t){let[n,r,i,s]=t;return t[0]&&typeof t[0]=="object"&&({name:n}=t[0],r===void 0&&(r=t[0].type),i===void 0&&(i=t[0].nullable),s===void 0&&(s=t[0].metadata)),new In(`${n}`,r,i,s)}get typeId(){return this.type.typeId}get[Symbol.toStringTag](){return"Field"}toString(){return`${this.name}: ${this.type}`}clone(...t){let[n,r,i,s]=t;return!t[0]||typeof t[0]!="object"?[n=this.name,r=this.type,i=this.nullable,s=this.metadata]=t:{name:n=this.name,type:r=this.type,nullable:i=this.nullable,metadata:s=this.metadata}=t[0],In.new(n,r,i,s)}}In.prototype.type=null;In.prototype.name=null;In.prototype.nullable=null;In.prototype.metadata=null;function v1(e,t){return new Map([...e||new Map,...t||new Map])}function rR(e,t=new Map){for(let n=-1,r=e.length;++n0&&rR(s.children,t)}return t}var IU=yl,lVe=$ne,cVe=AT;class iR{constructor(t,n=ro.V4,r,i){this.schema=t,this.version=n,r&&(this._recordBatches=r),i&&(this._dictionaryBatches=i)}static decode(t){t=new cVe(Pn(t));const n=Js.getRootAsFooter(t),r=An.decode(n.schema());return new fVe(r,n)}static encode(t){const n=new lVe,r=An.encode(n,t.schema);Js.startRecordBatchesVector(n,t.numRecordBatches);for(const o of[...t.recordBatches()].slice().reverse())af.encode(n,o);const i=n.endVector();Js.startDictionariesVector(n,t.numDictionaries);for(const o of[...t.dictionaryBatches()].slice().reverse())af.encode(n,o);const s=n.endVector();return Js.startFooter(n),Js.addSchema(n,r),Js.addVersion(n,ro.V4),Js.addRecordBatches(n,i),Js.addDictionaries(n,s),Js.finishFooterBuffer(n,Js.endFooter(n)),n.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}*recordBatches(){for(let t,n=-1,r=this.numRecordBatches;++n=0&&t=0&&t=0&&t=0&&tthis._closedPromiseResolve=t)}get closed(){return this._closedPromise}cancel(t){return Ju(this,void 0,void 0,function*(){yield this.return(t)})}write(t){this._ensureOpen()&&(this.resolvers.length<=0?this._values.push(t):this.resolvers.shift().resolve({done:!1,value:t}))}abort(t){this._closedPromiseResolve&&(this.resolvers.length<=0?this._error={error:t}:this.resolvers.shift().reject({done:!0,value:t}))}close(){if(this._closedPromiseResolve){const{resolvers:t}=this;for(;t.length>0;)t.shift().resolve(b1);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(t){return yU.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,t)}toNodeStream(t){return yU.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,t)}throw(t){return Ju(this,void 0,void 0,function*(){return yield this.abort(t),b1})}return(t){return Ju(this,void 0,void 0,function*(){return yield this.close(),b1})}read(t){return Ju(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return Ju(this,void 0,void 0,function*(){return(yield this.next(t,"peek")).value})}next(...t){return this._values.length>0?Promise.resolve({done:!1,value:this._values.shift()}):this._error?Promise.reject({done:!0,value:this._error.error}):this._closedPromiseResolve?new Promise((n,r)=>{this.resolvers.push({resolve:n,reject:r})}):Promise.resolve(b1)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error("AsyncQueue is closed")}}class ZA extends dVe{write(t){if((t=Pn(t)).byteLength>0)return super.write(t)}toString(t=!1){return t?Q2(this.toUint8Array(!0)):this.toUint8Array(!1).then(Q2)}toUint8Array(t=!1){return t?Pu(this._values)[0]:Ju(this,void 0,void 0,function*(){var n,r;const i=[];let s=0;try{for(var o=q0(this),a;a=yield o.next(),!a.done;){const u=a.value;i.push(u),s+=u.byteLength}}catch(u){n={error:u}}finally{try{a&&!a.done&&(r=o.return)&&(yield r.call(o))}finally{if(n)throw n.error}}return Pu(i,s)[0]})}}class Fne extends XI{constructor(t){super(t),this._values=new QI(new Uint8Array(0))}get byteLength(){let t=this._pendingLength+this.length*4;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),t}setValue(t,n){return super.setValue(t,Pn(n))}_flushPending(t,n){const r=this._offsets,i=this._values.reserve(n).buffer;let s=0;for(const[o,a]of t)if(a===void 0)r.set(o,0);else{const u=a.length;i.set(a,s),r.set(o,u),s+=u}}}class hVe extends Ws{constructor(t){super(t),this._values=new Nne}setValue(t,n){this._values.set(t,+n)}}class JI extends If{}JI.prototype._setValue=Gte;class Bne extends JI{}Bne.prototype._setValue=W$;class jne extends JI{}jne.prototype._setValue=q$;class Une extends If{}Une.prototype._setValue=Xte;class pVe extends Ws{constructor({type:t,nullValues:n,dictionaryHashFunction:r}){super({type:new of(t.dictionary,t.indices,t.id,t.isOrdered)}),this._nulls=null,this._dictionaryOffset=0,this._keysToIndices=Object.create(null),this.indices=DT({type:this.type.indices,nullValues:n}),this.dictionary=DT({type:this.type.dictionary,nullValues:null}),typeof r=="function"&&(this.valueToKey=r)}get values(){return this.indices.values}get nullCount(){return this.indices.nullCount}get nullBitmap(){return this.indices.nullBitmap}get byteLength(){return this.indices.byteLength+this.dictionary.byteLength}get reservedLength(){return this.indices.reservedLength+this.dictionary.reservedLength}get reservedByteLength(){return this.indices.reservedByteLength+this.dictionary.reservedByteLength}isValid(t){return this.indices.isValid(t)}setValid(t,n){const r=this.indices;return n=r.setValid(t,n),this.length=r.length,n}setValue(t,n){const r=this._keysToIndices,i=this.valueToKey(n);let s=r[i];return s===void 0&&(r[i]=s=this._dictionaryOffset+this.dictionary.append(n).length-1),this.indices.setValue(t,s)}flush(){const t=this.type,n=this._dictionary,r=this.dictionary.toVector(),i=this.indices.flush().clone(t);return i.dictionary=n?n.concat(r):r,this.finished||(this._dictionaryOffset+=r.length),this._dictionary=i.dictionary,this.clear(),i}finish(){return this.indices.finish(),this.dictionary.finish(),this._dictionaryOffset=0,this._keysToIndices=Object.create(null),super.finish()}clear(){return this.indices.clear(),this.dictionary.clear(),super.clear()}valueToKey(t){return typeof t=="string"?t:`${t}`}}class Vne extends If{}Vne.prototype._setValue=Yte;class mVe extends Ws{setValue(t,n){const[r]=this.children,i=t*this.stride;for(let s=-1,o=n.length;++s0)throw new Error("FixedSizeListBuilder can only have one child.");const r=this.children.push(t);return this.type=new hm(this.type.listSize,new In(n,t.type,!0)),r}}class ZI extends If{setValue(t,n){this._values.set(t,n)}}class gVe extends ZI{setValue(t,n){super.setValue(t,Hte(n))}}class yVe extends ZI{}class _Ve extends ZI{}class ex extends If{}ex.prototype._setValue=ene;class zne extends ex{}zne.prototype._setValue=t3;class Hne extends ex{}Hne.prototype._setValue=n3;class Yl extends If{setValue(t,n){this._values.set(t,n)}}class vVe extends Yl{}class bVe extends Yl{}class EVe extends Yl{}class wVe extends Yl{}class TVe extends Yl{}class SVe extends Yl{}class IVe extends Yl{}class xVe extends Yl{}class CVe extends XI{constructor(t){super(t),this._offsets=new kne}addChild(t,n="0"){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=t,this.type=new dm(new In(n,t.type,!0)),this.numChildren-1}_flushPending(t){const n=this._offsets,[r]=this.children;for(const[i,s]of t)if(typeof s>"u")n.set(i,0);else{const o=s.length,a=n.set(i,o).buffer[i];for(let u=-1;++u0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=t,this.type=new Vy(new In(n,t.type,!0),this.type.keysSorted),this.numChildren-1}_flushPending(t){const n=this._offsets,[r]=this.children;for(const[i,s]of t)if(s===void 0)n.set(i,0);else{let{[i]:o,[i+1]:a}=n.set(i,s.size).buffer;for(const u of s.entries())if(r.set(o,u),++o>=a)break}}}class OVe extends Ws{setValue(t,n){}setValid(t,n){return this.length=Math.max(t+1,this.length),n}}class PVe extends Ws{setValue(t,n){const{children:r,type:i}=this;switch(Array.isArray(n)||n.constructor){case!0:return i.children.forEach((s,o)=>r[o].set(t,n[o]));case Map:return i.children.forEach((s,o)=>r[o].set(t,n.get(s.name)));default:return i.children.forEach((s,o)=>r[o].set(t,n[s.name]))}}setValid(t,n){return super.setValid(t,n)||this.children.forEach(r=>r.setValid(t,n)),n}addChild(t,n=`${this.numChildren}`){const r=this.children.push(t);return this.type=new Yi([...this.type.children,new In(n,t.type,!0)]),r}}class Qm extends If{}Qm.prototype._setValue=Kte;class Wne extends Qm{}Wne.prototype._setValue=Y$;class qne extends Qm{}qne.prototype._setValue=G$;class Yne extends Qm{}Yne.prototype._setValue=K$;class Gne extends Qm{}Gne.prototype._setValue=Q$;class Xm extends If{}Xm.prototype._setValue=Qte;class Kne extends Xm{}Kne.prototype._setValue=X$;class Qne extends Xm{}Qne.prototype._setValue=J$;class Xne extends Xm{}Xne.prototype._setValue=Z$;class Jne extends Xm{}Jne.prototype._setValue=e3;class c3 extends Ws{constructor(t){super(t),this._typeIds=new Y_(new Int8Array(0),1),typeof t.valueToChildTypeId=="function"&&(this._valueToChildTypeId=t.valueToChildTypeId)}get typeIdToChildIndex(){return this.type.typeIdToChildIndex}append(t,n){return this.set(this.length,t,n)}set(t,n,r){return r===void 0&&(r=this._valueToChildTypeId(this,n,t)),this.setValid(t,this.isValid(n))&&this.setValue(t,n,r),this}setValue(t,n,r){this._typeIds.set(t,r);const i=this.type.typeIdToChildIndex[r],s=this.children[i];s==null||s.set(t,n)}addChild(t,n=`${this.children.length}`){const r=this.children.push(t),{type:{children:i,mode:s,typeIds:o}}=this,a=[...i,new In(n,t.type)];return this.type=new Uy(s,[...o,r],a),r}_valueToChildTypeId(t,n,r){throw new Error("Cannot map UnionBuilder value to child typeId. Pass the `childTypeId` as the second argument to unionBuilder.append(), or supply a `valueToChildTypeId` function as part of the UnionBuilder constructor options.")}}class RVe extends c3{}class NVe extends c3{constructor(t){super(t),this._offsets=new Y_(new Int32Array(0))}setValue(t,n,r){const i=this._typeIds.set(t,r).buffer[t],s=this.getChildAt(this.type.typeIdToChildIndex[i]),o=this._offsets.set(t,s.length).buffer[t];s==null||s.set(o,n)}}class Zne extends XI{constructor(t){super(t),this._values=new QI(new Uint8Array(0))}get byteLength(){let t=this._pendingLength+this.length*4;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),t}setValue(t,n){return super.setValue(t,O$(n))}_flushPending(t,n){}}Zne.prototype._flushPending=Fne.prototype._flushPending;class kVe extends on{visitNull(){return OVe}visitBool(){return hVe}visitInt(){return Yl}visitInt8(){return vVe}visitInt16(){return bVe}visitInt32(){return EVe}visitInt64(){return wVe}visitUint8(){return TVe}visitUint16(){return SVe}visitUint32(){return IVe}visitUint64(){return xVe}visitFloat(){return ZI}visitFloat16(){return gVe}visitFloat32(){return yVe}visitFloat64(){return _Ve}visitUtf8(){return Zne}visitBinary(){return Fne}visitFixedSizeBinary(){return Vne}visitDate(){return JI}visitDateDay(){return Bne}visitDateMillisecond(){return jne}visitTimestamp(){return Qm}visitTimestampSecond(){return Wne}visitTimestampMillisecond(){return qne}visitTimestampMicrosecond(){return Yne}visitTimestampNanosecond(){return Gne}visitTime(){return Xm}visitTimeSecond(){return Kne}visitTimeMillisecond(){return Qne}visitTimeMicrosecond(){return Xne}visitTimeNanosecond(){return Jne}visitDecimal(){return Une}visitList(){return CVe}visitStruct(){return PVe}visitUnion(){return c3}visitDenseUnion(){return NVe}visitSparseUnion(){return RVe}visitDictionary(){return pVe}visitInterval(){return ex}visitIntervalDayTime(){return zne}visitIntervalYearMonth(){return Hne}visitFixedSizeList(){return mVe}visitMap(){return AVe}}const DVe=new kVe;class Rt extends on{compareSchemas(t,n){return t===n||n instanceof t.constructor&&this.compareManyFields(t.fields,n.fields)}compareManyFields(t,n){return t===n||Array.isArray(t)&&Array.isArray(n)&&t.length===n.length&&t.every((r,i)=>this.compareFields(r,n[i]))}compareFields(t,n){return t===n||n instanceof t.constructor&&t.name===n.name&&t.nullable===n.nullable&&this.visit(t.type,n.type)}}function qs(e,t){return t instanceof e.constructor}function G_(e,t){return e===t||qs(e,t)}function Gl(e,t){return e===t||qs(e,t)&&e.bitWidth===t.bitWidth&&e.isSigned===t.isSigned}function tx(e,t){return e===t||qs(e,t)&&e.precision===t.precision}function $Ve(e,t){return e===t||qs(e,t)&&e.byteWidth===t.byteWidth}function f3(e,t){return e===t||qs(e,t)&&e.unit===t.unit}function K_(e,t){return e===t||qs(e,t)&&e.unit===t.unit&&e.timezone===t.timezone}function Q_(e,t){return e===t||qs(e,t)&&e.unit===t.unit&&e.bitWidth===t.bitWidth}function LVe(e,t){return e===t||qs(e,t)&&e.children.length===t.children.length&&uf.compareManyFields(e.children,t.children)}function MVe(e,t){return e===t||qs(e,t)&&e.children.length===t.children.length&&uf.compareManyFields(e.children,t.children)}function d3(e,t){return e===t||qs(e,t)&&e.mode===t.mode&&e.typeIds.every((n,r)=>n===t.typeIds[r])&&uf.compareManyFields(e.children,t.children)}function FVe(e,t){return e===t||qs(e,t)&&e.id===t.id&&e.isOrdered===t.isOrdered&&uf.visit(e.indices,t.indices)&&uf.visit(e.dictionary,t.dictionary)}function h3(e,t){return e===t||qs(e,t)&&e.unit===t.unit}function BVe(e,t){return e===t||qs(e,t)&&e.listSize===t.listSize&&e.children.length===t.children.length&&uf.compareManyFields(e.children,t.children)}function jVe(e,t){return e===t||qs(e,t)&&e.keysSorted===t.keysSorted&&e.children.length===t.children.length&&uf.compareManyFields(e.children,t.children)}Rt.prototype.visitNull=G_;Rt.prototype.visitBool=G_;Rt.prototype.visitInt=Gl;Rt.prototype.visitInt8=Gl;Rt.prototype.visitInt16=Gl;Rt.prototype.visitInt32=Gl;Rt.prototype.visitInt64=Gl;Rt.prototype.visitUint8=Gl;Rt.prototype.visitUint16=Gl;Rt.prototype.visitUint32=Gl;Rt.prototype.visitUint64=Gl;Rt.prototype.visitFloat=tx;Rt.prototype.visitFloat16=tx;Rt.prototype.visitFloat32=tx;Rt.prototype.visitFloat64=tx;Rt.prototype.visitUtf8=G_;Rt.prototype.visitBinary=G_;Rt.prototype.visitFixedSizeBinary=$Ve;Rt.prototype.visitDate=f3;Rt.prototype.visitDateDay=f3;Rt.prototype.visitDateMillisecond=f3;Rt.prototype.visitTimestamp=K_;Rt.prototype.visitTimestampSecond=K_;Rt.prototype.visitTimestampMillisecond=K_;Rt.prototype.visitTimestampMicrosecond=K_;Rt.prototype.visitTimestampNanosecond=K_;Rt.prototype.visitTime=Q_;Rt.prototype.visitTimeSecond=Q_;Rt.prototype.visitTimeMillisecond=Q_;Rt.prototype.visitTimeMicrosecond=Q_;Rt.prototype.visitTimeNanosecond=Q_;Rt.prototype.visitDecimal=G_;Rt.prototype.visitList=LVe;Rt.prototype.visitStruct=MVe;Rt.prototype.visitUnion=d3;Rt.prototype.visitDenseUnion=d3;Rt.prototype.visitSparseUnion=d3;Rt.prototype.visitDictionary=FVe;Rt.prototype.visitInterval=h3;Rt.prototype.visitIntervalDayTime=h3;Rt.prototype.visitIntervalYearMonth=h3;Rt.prototype.visitFixedSizeList=BVe;Rt.prototype.visitMap=jVe;const uf=new Rt;function sR(e,t){return uf.compareSchemas(e,t)}function DT(e){const t=e.type,n=new(DVe.getVisitFn(t)())(e);if(t.children&&t.children.length>0){const r=e.children||[],i={nullValues:e.nullValues},s=Array.isArray(r)?(o,a)=>r[a]||i:({name:o})=>r[o]||i;for(const[o,a]of t.children.entries()){const{type:u}=a,l=s(a,o);n.children.push(DT(Object.assign(Object.assign({},l),{type:u})))}}return n}function eO(e,t){return UVe(e,t.map(n=>n.data.concat()))}function UVe(e,t){const n=[...e.fields],r=[],i={numBatches:t.reduce((f,d)=>Math.max(f,d.length),0)};let s=0,o=0,a=-1;const u=t.length;let l,c=[];for(;i.numBatches-- >0;){for(o=Number.POSITIVE_INFINITY,a=-1;++a0&&(r[s++]=Hi({type:new Yi(n),length:o,nullCount:0,children:c.slice()})))}return[e=e.assign(n),r.map(f=>new no(e,f))]}function VVe(e,t,n,r,i){var s;const o=(t+63&-64)>>3;for(let a=-1,u=r.length;++a=t)c===t?n[a]=l:(n[a]=l.slice(0,t),i.numBatches=Math.max(i.numBatches,r[a].unshift(l.slice(t,c-t))));else{const f=e[a];e[a]=f.clone({nullable:!0}),n[a]=(s=l==null?void 0:l._changeLengthAndBackfillNullBitmap(t))!==null&&s!==void 0?s:Hi({type:f.type,length:t,nullCount:t,nullBitmap:new Uint8Array(o)})}}return n}var ere;class Os{constructor(...t){var n,r;if(t.length===0)return this.batches=[],this.schema=new An([]),this._offsets=[0],this;let i,s;t[0]instanceof An&&(i=t.shift()),t[t.length-1]instanceof Uint32Array&&(s=t.pop());const o=u=>{if(u){if(u instanceof no)return[u];if(u instanceof Os)return u.batches;if(u instanceof Mn){if(u.type instanceof Yi)return[new no(new An(u.type.children),u)]}else{if(Array.isArray(u))return u.flatMap(l=>o(l));if(typeof u[Symbol.iterator]=="function")return[...u].flatMap(l=>o(l));if(typeof u=="object"){const l=Object.keys(u),c=l.map(h=>new _n([u[h]])),f=new An(l.map((h,p)=>new In(String(h),c[p].type))),[,d]=eO(f,c);return d.length===0?[new no(u)]:d}}}return[]},a=t.flatMap(u=>o(u));if(i=(r=i??((n=a[0])===null||n===void 0?void 0:n.schema))!==null&&r!==void 0?r:new An([]),!(i instanceof An))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");for(const u of a){if(!(u instanceof no))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");if(!sR(i,u.schema))throw new TypeError("Table and inner RecordBatch schemas must be equivalent.")}this.schema=i,this.batches=a,this._offsets=s??wne(this.data)}get data(){return this.batches.map(({data:t})=>t)}get numCols(){return this.schema.fields.length}get numRows(){return this.data.reduce((t,n)=>t+n.length,0)}get nullCount(){return this._nullCount===-1&&(this._nullCount=Ene(this.data)),this._nullCount}isValid(t){return!1}get(t){return null}set(t,n){}indexOf(t,n){return-1}getByteLength(t){return 0}[Symbol.iterator](){return this.batches.length>0?l3.visit(new _n(this.data)):new Array(0)[Symbol.iterator]()}toArray(){return[...this]}toString(){return`[ ${this.toArray().join(`, `)} -]`}concat(...t){const n=this.schema,r=this.data.concat(t.flatMap(({data:i})=>i));return new Os(n,r.map(i=>new no(n,i)))}slice(t,n){const r=this.schema;[t,n]=vne({length:this.numRows},t,n);const i=Sne(this.data,this._offsets,t,n);return new Os(r,i.map(s=>new no(r,s)))}getChild(t){return this.getChildAt(this.schema.fields.findIndex(n=>n.name===t))}getChildAt(t){if(t>-1&&tr.children[t]);if(n.length===0){const{type:r}=this.schema.fields[t],i=Hi({type:r,length:0,nullCount:0});n.push(i._changeLengthAndBackfillNullBitmap(this.numRows))}return new _n(n)}return null}setChild(t,n){var r;return this.setChildAt((r=this.schema.fields)===null||r===void 0?void 0:r.findIndex(i=>i.name===t),n)}setChildAt(t,n){let r=this.schema,i=[...this.batches];if(t>-1&&tthis.getChildAt(l));[s[t],a[t]]=[o,n],[r,i]=eO(r,a)}return new Os(r,i)}select(t){const n=this.schema.fields.reduce((r,i,s)=>r.set(i.name,s),new Map);return this.selectAt(t.map(r=>n.get(r)).filter(r=>r>-1))}selectAt(t){const n=this.schema.selectAt(t),r=this.batches.map(i=>i.selectAt(t));return new Os(n,r)}assign(t){const n=this.schema.fields,[r,i]=t.schema.fields.reduce((a,u,l)=>{const[c,f]=a,d=n.findIndex(h=>h.name===u.name);return~d?f[d]=l:c.push(l),a},[[],[]]),s=this.schema.assign(t.schema),o=[...n.map((a,u)=>[u,i[u]]).map(([a,u])=>u===void 0?this.getChildAt(a):t.getChildAt(u)),...r.map(a=>t.getChildAt(a))].filter(Boolean);return new Os(...eO(s,o))}}tre=Symbol.toStringTag;Os[tre]=(e=>(e.schema=null,e.batches=[],e._offsets=new Uint32Array([0]),e._nullCount=-1,e[Symbol.isConcatSpreadable]=!0,e.isValid=kp(u3),e.get=kp(zs.getVisitFn(X.Struct)),e.set=Ine(Go.getVisitFn(X.Struct)),e.indexOf=xne(xT.getVisitFn(X.Struct)),e.getByteLength=kp(ku.getVisitFn(X.Struct)),"Table"))(Os.prototype);var nre;let no=class f0{constructor(...t){switch(t.length){case 2:{if([this.schema]=t,!(this.schema instanceof An))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");if([,this.data=Hi({nullCount:0,type:new Yi(this.schema.fields),children:this.schema.fields.map(n=>Hi({type:n.type,nullCount:0}))})]=t,!(this.data instanceof Mn))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=xU(this.schema,this.data.children);break}case 1:{const[n]=t,{fields:r,children:i,length:s}=Object.keys(n).reduce((u,l,c)=>(u.children[c]=n[l],u.length=Math.max(u.length,n[l].length),u.fields[c]=In.new({name:l,type:n[l].type,nullable:!0}),u),{length:0,fields:new Array,children:new Array}),o=new An(r),a=Hi({type:new Yi(r),length:s,children:i,nullCount:0});[this.schema,this.data]=xU(o,a.children,s);break}default:throw new TypeError("RecordBatch constructor expects an Object mapping names to child Data, or a [Schema, Data] pair.")}}get dictionaries(){return this._dictionaries||(this._dictionaries=rre(this.schema.fields,this.data.children))}get numCols(){return this.schema.fields.length}get numRows(){return this.data.length}get nullCount(){return this.data.nullCount}isValid(t){return this.data.getValid(t)}get(t){return zs.visit(this.data,t)}set(t,n){return Go.visit(this.data,t,n)}indexOf(t,n){return xT.visit(this.data,t,n)}getByteLength(t){return ku.visit(this.data,t)}[Symbol.iterator](){return l3.visit(new _n([this.data]))}toArray(){return[...this]}concat(...t){return new Os(this.schema,[this,...t])}slice(t,n){const[r]=new _n([this.data]).slice(t,n).data;return new f0(this.schema,r)}getChild(t){var n;return this.getChildAt((n=this.schema.fields)===null||n===void 0?void 0:n.findIndex(r=>r.name===t))}getChildAt(t){return t>-1&&ti.name===t),n)}setChildAt(t,n){let r=this.schema,i=this.data;if(t>-1&&ta.name===s);~o&&(i[o]=this.data.children[o])}return new f0(n,Hi({type:r,length:this.numRows,children:i}))}selectAt(t){const n=this.schema.selectAt(t),r=t.map(s=>this.data.children[s]).filter(Boolean),i=Hi({type:new Yi(n.fields),length:this.numRows,children:r});return new f0(n,i)}};nre=Symbol.toStringTag;no[nre]=(e=>(e._nullCount=-1,e[Symbol.isConcatSpreadable]=!0,"RecordBatch"))(no.prototype);function xU(e,t,n=t.reduce((r,i)=>Math.max(r,i.length),0)){var r;const i=[...e.fields],s=[...t],o=(n+63&-64)>>3;for(const[a,u]of e.fields.entries()){const l=t[a];(!l||l.length!==n)&&(i[a]=u.clone({nullable:!0}),s[a]=(r=l==null?void 0:l._changeLengthAndBackfillNullBitmap(n))!==null&&r!==void 0?r:Hi({type:u.type,length:n,nullCount:n,nullBitmap:new Uint8Array(o)}))}return[e.assign(i),Hi({type:new Yi(i),length:n,children:s})]}function rre(e,t,n=new Map){for(let r=-1,i=e.length;++r0&&rre(o.children,a.children,n)}return n}class zVe extends no{constructor(t){const n=t.fields.map(i=>Hi({type:i.type})),r=Hi({type:new Yi(t.fields),nullCount:0,children:n});super(t,r)}}var $T;(function(e){e[e.BUFFER=0]="BUFFER"})($T||($T={}));var LT;(function(e){e[e.LZ4_FRAME=0]="LZ4_FRAME",e[e.ZSTD=1]="ZSTD"})(LT||(LT={}));class dc{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsBodyCompression(t,n){return(n||new dc).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBodyCompression(t,n){return t.setPosition(t.position()+zn),(n||new dc).__init(t.readInt32(t.position())+t.position(),t)}codec(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt8(this.bb_pos+t):LT.LZ4_FRAME}method(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt8(this.bb_pos+t):$T.BUFFER}static startBodyCompression(t){t.startObject(2)}static addCodec(t,n){t.addFieldInt8(0,n,LT.LZ4_FRAME)}static addMethod(t,n){t.addFieldInt8(1,n,$T.BUFFER)}static endBodyCompression(t){return t.endObject()}static createBodyCompression(t,n,r){return dc.startBodyCompression(t),dc.addCodec(t,n),dc.addMethod(t,r),dc.endBodyCompression(t)}}class ire{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}offset(){return this.bb.readInt64(this.bb_pos)}length(){return this.bb.readInt64(this.bb_pos+8)}static sizeOf(){return 16}static createBuffer(t,n,r){return t.prep(8,16),t.writeInt64(r),t.writeInt64(n),t.offset()}}let sre=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}length(){return this.bb.readInt64(this.bb_pos)}nullCount(){return this.bb.readInt64(this.bb_pos+8)}static sizeOf(){return 16}static createFieldNode(t,n,r){return t.prep(8,16),t.writeInt64(r),t.writeInt64(n),t.offset()}},Gu=class oR{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsRecordBatch(t,n){return(n||new oR).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsRecordBatch(t,n){return t.setPosition(t.position()+zn),(n||new oR).__init(t.readInt32(t.position())+t.position(),t)}length(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}nodes(t,n){const r=this.bb.__offset(this.bb_pos,6);return r?(n||new sre).__init(this.bb.__vector(this.bb_pos+r)+t*16,this.bb):null}nodesLength(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}buffers(t,n){const r=this.bb.__offset(this.bb_pos,8);return r?(n||new ire).__init(this.bb.__vector(this.bb_pos+r)+t*16,this.bb):null}buffersLength(){const t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}compression(t){const n=this.bb.__offset(this.bb_pos,10);return n?(t||new dc).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}static startRecordBatch(t){t.startObject(4)}static addLength(t,n){t.addFieldInt64(0,n,t.createLong(0,0))}static addNodes(t,n){t.addFieldOffset(1,n,0)}static startNodesVector(t,n){t.startVector(16,n,8)}static addBuffers(t,n){t.addFieldOffset(2,n,0)}static startBuffersVector(t,n){t.startVector(16,n,8)}static addCompression(t,n){t.addFieldOffset(3,n,0)}static endRecordBatch(t){return t.endObject()}},Dh=class aR{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsDictionaryBatch(t,n){return(n||new aR).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDictionaryBatch(t,n){return t.setPosition(t.position()+zn),(n||new aR).__init(t.readInt32(t.position())+t.position(),t)}id(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}data(t){const n=this.bb.__offset(this.bb_pos,6);return n?(t||new Gu).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}isDelta(){const t=this.bb.__offset(this.bb_pos,8);return t?!!this.bb.readInt8(this.bb_pos+t):!1}static startDictionaryBatch(t){t.startObject(3)}static addId(t,n){t.addFieldInt64(0,n,t.createLong(0,0))}static addData(t,n){t.addFieldOffset(1,n,0)}static addIsDelta(t,n){t.addFieldInt8(2,+n,0)}static endDictionaryBatch(t){return t.endObject()}};var MT;(function(e){e[e.NONE=0]="NONE",e[e.Schema=1]="Schema",e[e.DictionaryBatch=2]="DictionaryBatch",e[e.RecordBatch=3]="RecordBatch",e[e.Tensor=4]="Tensor",e[e.SparseTensor=5]="SparseTensor"})(MT||(MT={}));let nc=class Ua{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsMessage(t,n){return(n||new Ua).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMessage(t,n){return t.setPosition(t.position()+zn),(n||new Ua).__init(t.readInt32(t.position())+t.position(),t)}version(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):pm.V1}headerType(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):MT.NONE}header(t){const n=this.bb.__offset(this.bb_pos,8);return n?this.bb.__union(t,this.bb_pos+n):null}bodyLength(){const t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}customMetadata(t,n){const r=this.bb.__offset(this.bb_pos,12);return r?(n||new Gr).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+t*4),this.bb):null}customMetadataLength(){const t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}static startMessage(t){t.startObject(5)}static addVersion(t,n){t.addFieldInt16(0,n,pm.V1)}static addHeaderType(t,n){t.addFieldInt8(1,n,MT.NONE)}static addHeader(t,n){t.addFieldOffset(2,n,0)}static addBodyLength(t,n){t.addFieldInt64(3,n,t.createLong(0,0))}static addCustomMetadata(t,n){t.addFieldOffset(4,n,0)}static createCustomMetadataVector(t,n){t.startVector(4,n.length,4);for(let r=n.length-1;r>=0;r--)t.addOffset(n[r]);return t.endVector()}static startCustomMetadataVector(t,n){t.startVector(4,n,4)}static endMessage(t){return t.endObject()}static finishMessageBuffer(t,n){t.finish(n)}static finishSizePrefixedMessageBuffer(t,n){t.finish(n,void 0,!0)}static createMessage(t,n,r,i,s,o){return Ua.startMessage(t),Ua.addVersion(t,n),Ua.addHeaderType(t,r),Ua.addHeader(t,i),Ua.addBodyLength(t,s),Ua.addCustomMetadata(t,o),Ua.endMessage(t)}};var HVe=yl;class WVe extends on{visit(t,n){return t==null||n==null?void 0:super.visit(t,n)}visitNull(t,n){return ud.startNull(n),ud.endNull(n)}visitInt(t,n){return to.startInt(n),to.addBitWidth(n,t.bitWidth),to.addIsSigned(n,t.isSigned),to.endInt(n)}visitFloat(t,n){return ru.startFloatingPoint(n),ru.addPrecision(n,t.precision),ru.endFloatingPoint(n)}visitBinary(t,n){return sd.startBinary(n),sd.endBinary(n)}visitBool(t,n){return od.startBool(n),od.endBool(n)}visitUtf8(t,n){return cd.startUtf8(n),cd.endUtf8(n)}visitDecimal(t,n){return xs.startDecimal(n),xs.addScale(n,t.scale),xs.addPrecision(n,t.precision),xs.addBitWidth(n,t.bitWidth),xs.endDecimal(n)}visitDate(t,n){return mb.startDate(n),mb.addUnit(n,t.unit),mb.endDate(n)}visitTime(t,n){return $o.startTime(n),$o.addUnit(n,t.unit),$o.addBitWidth(n,t.bitWidth),$o.endTime(n)}visitTimestamp(t,n){const r=t.timezone&&n.createString(t.timezone)||void 0;return c0.startTimestamp(n),c0.addUnit(n,t.unit),r!==void 0&&c0.addTimezone(n,r),c0.endTimestamp(n)}visitInterval(t,n){return iu.startInterval(n),iu.addUnit(n,t.unit),iu.endInterval(n)}visitList(t,n){return ad.startList(n),ad.endList(n)}visitStruct(t,n){return ld.startStruct_(n),ld.endStruct_(n)}visitUnion(t,n){As.startTypeIdsVector(n,t.typeIds.length);const r=As.createTypeIdsVector(n,t.typeIds);return As.startUnion(n),As.addMode(n,t.mode),As.addTypeIds(n,r),As.endUnion(n)}visitDictionary(t,n){const r=this.visit(t.indices,n);return el.startDictionaryEncoding(n),el.addId(n,new HVe(t.id,0)),el.addIsOrdered(n,t.isOrdered),r!==void 0&&el.addIndexType(n,r),el.endDictionaryEncoding(n)}visitFixedSizeBinary(t,n){return tu.startFixedSizeBinary(n),tu.addByteWidth(n,t.byteWidth),tu.endFixedSizeBinary(n)}visitFixedSizeList(t,n){return nu.startFixedSizeList(n),nu.addListSize(n,t.listSize),nu.endFixedSizeList(n)}visitMap(t,n){return gb.startMap(n),gb.addKeysSorted(n,t.keysSorted),gb.endMap(n)}}const tO=new WVe;function qVe(e,t=new Map){return new An(GVe(e,t),_b(e.customMetadata),t)}function ore(e){return new _o(e.count,are(e.columns),ure(e.columns))}function YVe(e){return new Du(ore(e.data),e.id,e.isDelta)}function GVe(e,t){return(e.fields||[]).filter(Boolean).map(n=>In.fromJSON(n,t))}function CU(e,t){return(e.children||[]).filter(Boolean).map(n=>In.fromJSON(n,t))}function are(e){return(e||[]).reduce((t,n)=>[...t,new uh(n.count,KVe(n.VALIDITY)),...are(n.children)],[])}function ure(e,t=[]){for(let n=-1,r=(e||[]).length;++nt+ +(n===0),0)}function QVe(e,t){let n,r,i,s,o,a;return!t||!(s=e.dictionary)?(o=OU(e,CU(e,t)),i=new In(e.name,o,e.nullable,_b(e.customMetadata))):t.has(n=s.id)?(r=(r=s.indexType)?AU(r):new rf,a=new of(t.get(n),r,n,s.isOrdered),i=new In(e.name,a,e.nullable,_b(e.customMetadata))):(r=(r=s.indexType)?AU(r):new rf,t.set(n,o=OU(e,CU(e,t))),a=new of(o,r,n,s.isOrdered),i=new In(e.name,a,e.nullable,_b(e.customMetadata))),i||null}function _b(e){return new Map(Object.entries(e||{}))}function AU(e){return new fs(e.isSigned,e.bitWidth)}function OU(e,t){const n=e.type.name;switch(n){case"NONE":return new Pl;case"null":return new Pl;case"binary":return new By;case"utf8":return new lm;case"bool":return new jy;case"list":return new dm((t||[])[0]);case"struct":return new Yi(t||[]);case"struct_":return new Yi(t||[])}switch(n){case"int":{const r=e.type;return new fs(r.isSigned,r.bitWidth)}case"floatingpoint":{const r=e.type;return new sf(Ni[r.precision])}case"decimal":{const r=e.type;return new TT(r.scale,r.precision,r.bitWidth)}case"date":{const r=e.type;return new cm(Ru[r.unit])}case"time":{const r=e.type;return new Rl(sn[r.unit],r.bitWidth)}case"timestamp":{const r=e.type;return new ST(sn[r.unit],r.timezone)}case"interval":{const r=e.type;return new fm(Nu[r.unit])}case"union":{const r=e.type;return new Uy(Yo[r.mode],r.typeIds||[],t||[])}case"fixedsizebinary":{const r=e.type;return new IT(r.byteWidth)}case"fixedsizelist":{const r=e.type;return new hm(r.listSize,(t||[])[0])}case"map":{const r=e.type;return new Vy((t||[])[0],r.keysSorted)}}throw new Error(`Unrecognized type: "${n}"`)}var Bd=yl,XVe=Lne,JVe=AT;class su{constructor(t,n,r,i){this._version=n,this._headerType=r,this.body=new Uint8Array(0),i&&(this._createHeader=()=>i),this._bodyLength=typeof t=="number"?t:t.low}static fromJSON(t,n){const r=new su(0,ro.V4,n);return r._createHeader=ZVe(t,n),r}static decode(t){t=new JVe(Pn(t));const n=nc.getRootAsMessage(t),r=n.bodyLength(),i=n.version(),s=n.headerType(),o=new su(r,i,s);return o._createHeader=e7e(n,s),o}static encode(t){const n=new XVe;let r=-1;return t.isSchema()?r=An.encode(n,t.header()):t.isRecordBatch()?r=_o.encode(n,t.header()):t.isDictionaryBatch()&&(r=Du.encode(n,t.header())),nc.startMessage(n),nc.addVersion(n,ro.V4),nc.addHeader(n,r),nc.addHeaderType(n,t.headerType),nc.addBodyLength(n,new Bd(t.bodyLength,0)),nc.finishMessageBuffer(n,nc.endMessage(n)),n.asUint8Array()}static from(t,n=0){if(t instanceof An)return new su(0,ro.V4,ci.Schema,t);if(t instanceof _o)return new su(n,ro.V4,ci.RecordBatch,t);if(t instanceof Du)return new su(n,ro.V4,ci.DictionaryBatch,t);throw new Error(`Unrecognized Message header: ${t}`)}get type(){return this.headerType}get version(){return this._version}get headerType(){return this._headerType}get bodyLength(){return this._bodyLength}header(){return this._createHeader()}isSchema(){return this.headerType===ci.Schema}isRecordBatch(){return this.headerType===ci.RecordBatch}isDictionaryBatch(){return this.headerType===ci.DictionaryBatch}}class _o{constructor(t,n,r){this._nodes=n,this._buffers=r,this._length=typeof t=="number"?t:t.low}get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}}class Du{constructor(t,n,r=!1){this._data=t,this._isDelta=r,this._id=typeof n=="number"?n:n.low}get id(){return this._id}get data(){return this._data}get isDelta(){return this._isDelta}get length(){return this.data.length}get nodes(){return this.data.nodes}get buffers(){return this.data.buffers}}class cu{constructor(t,n){this.offset=typeof t=="number"?t:t.low,this.length=typeof n=="number"?n:n.low}}class uh{constructor(t,n){this.length=typeof t=="number"?t:t.low,this.nullCount=typeof n=="number"?n:n.low}}function ZVe(e,t){return()=>{switch(t){case ci.Schema:return An.fromJSON(e);case ci.RecordBatch:return _o.fromJSON(e);case ci.DictionaryBatch:return Du.fromJSON(e)}throw new Error(`Unrecognized Message type: { name: ${ci[t]}, type: ${t} }`)}}function e7e(e,t){return()=>{switch(t){case ci.Schema:return An.decode(e.header(new qa));case ci.RecordBatch:return _o.decode(e.header(new Gu),e.version());case ci.DictionaryBatch:return Du.decode(e.header(new Dh),e.version())}throw new Error(`Unrecognized Message type: { name: ${ci[t]}, type: ${t} }`)}}In.encode=f7e;In.decode=l7e;In.fromJSON=QVe;An.encode=c7e;An.decode=t7e;An.fromJSON=qVe;_o.encode=d7e;_o.decode=n7e;_o.fromJSON=ore;Du.encode=h7e;Du.decode=r7e;Du.fromJSON=YVe;uh.encode=p7e;uh.decode=s7e;cu.encode=m7e;cu.decode=i7e;function t7e(e,t=new Map){const n=u7e(e,t);return new An(n,vb(e),t)}function n7e(e,t=ro.V4){if(e.compression()!==null)throw new Error("Record batch compression not implemented");return new _o(e.length(),o7e(e),a7e(e,t))}function r7e(e,t=ro.V4){return new Du(_o.decode(e.data(),t),e.id(),e.isDelta())}function i7e(e){return new cu(e.offset(),e.length())}function s7e(e){return new uh(e.length(),e.nullCount())}function o7e(e){const t=[];for(let n,r=-1,i=-1,s=e.nodesLength();++rIn.encode(e,s));qa.startFieldsVector(e,n.length);const r=qa.createFieldsVector(e,n),i=t.metadata&&t.metadata.size>0?qa.createCustomMetadataVector(e,[...t.metadata].map(([s,o])=>{const a=e.createString(`${s}`),u=e.createString(`${o}`);return Gr.startKeyValue(e),Gr.addKey(e,a),Gr.addValue(e,u),Gr.endKeyValue(e)})):-1;return qa.startSchema(e),qa.addFields(e,r),qa.addEndianness(e,g7e?mm.Little:mm.Big),i!==-1&&qa.addCustomMetadata(e,i),qa.endSchema(e)}function f7e(e,t){let n=-1,r=-1,i=-1;const s=t.type;let o=t.typeId;Qt.isDictionary(s)?(o=s.dictionary.typeId,i=tO.visit(s,e),r=tO.visit(s.dictionary,e)):r=tO.visit(s,e);const a=(s.children||[]).map(c=>In.encode(e,c)),u=Ao.createChildrenVector(e,a),l=t.metadata&&t.metadata.size>0?Ao.createCustomMetadataVector(e,[...t.metadata].map(([c,f])=>{const d=e.createString(`${c}`),h=e.createString(`${f}`);return Gr.startKeyValue(e),Gr.addKey(e,d),Gr.addValue(e,h),Gr.endKeyValue(e)})):-1;return t.name&&(n=e.createString(t.name)),Ao.startField(e),Ao.addType(e,r),Ao.addTypeType(e,o),Ao.addChildren(e,u),Ao.addNullable(e,!!t.nullable),n!==-1&&Ao.addName(e,n),i!==-1&&Ao.addDictionary(e,i),l!==-1&&Ao.addCustomMetadata(e,l),Ao.endField(e)}function d7e(e,t){const n=t.nodes||[],r=t.buffers||[];Gu.startNodesVector(e,n.length);for(const o of n.slice().reverse())uh.encode(e,o);const i=e.endVector();Gu.startBuffersVector(e,r.length);for(const o of r.slice().reverse())cu.encode(e,o);const s=e.endVector();return Gu.startRecordBatch(e),Gu.addLength(e,new Bd(t.length,0)),Gu.addNodes(e,i),Gu.addBuffers(e,s),Gu.endRecordBatch(e)}function h7e(e,t){const n=_o.encode(e,t.data);return Dh.startDictionaryBatch(e),Dh.addId(e,new Bd(t.id,0)),Dh.addIsDelta(e,t.isDelta),Dh.addData(e,n),Dh.endDictionaryBatch(e)}function p7e(e,t){return sre.createFieldNode(e,new Bd(t.length,0),new Bd(t.nullCount,0))}function m7e(e,t){return ire.createBuffer(e,new Bd(t.offset,0),new Bd(t.length,0))}const g7e=(()=>{const e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),new Int16Array(e)[0]===256})(),uR="ARROW1",p3=new Uint8Array(uR.length);for(let e=0;ei.flatMap(s=>Array.isArray(s)?n(s):s instanceof no?s.data.children:s.data),r=new Hr;return r.visitMany(n(t)),r}visit(t){if(t instanceof _n)return this.visitMany(t.data),this;const{type:n}=t;if(!Qt.isDictionary(n)){const{length:r,nullCount:i}=t;if(r>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");Qt.isNull(n)||xa.call(this,i<=0?new Uint8Array(0):s3(t.offset,r,t.nullBitmap)),this.nodes.push(new uh(r,i))}return super.visit(t)}visitNull(t){return this}visitDictionary(t){return this.visit(t.clone(t.type.indices))}get nodes(){return this._nodes}get buffers(){return this._buffers}get byteLength(){return this._byteLength}get bufferRegions(){return this._bufferRegions}}function xa(e){const t=e.byteLength+7&-8;return this.buffers.push(e),this.bufferRegions.push(new cu(this._byteLength,t)),this._byteLength+=t,this}function y7e(e){const{type:t,length:n,typeIds:r,valueOffsets:i}=e;if(xa.call(this,r),t.mode===Yo.Sparse)return lR.call(this,e);if(t.mode===Yo.Dense){if(e.offset<=0)return xa.call(this,i),lR.call(this,e);{const s=r.reduce((c,f)=>Math.max(c,f),r[0]),o=new Int32Array(s+1),a=new Int32Array(s+1).fill(-1),u=new Int32Array(n),l=N$(-i[0],n,i);for(let c,f,d=-1;++d=e.length?xa.call(this,new Uint8Array(0)):(t=e.values)instanceof Uint8Array?xa.call(this,s3(e.offset,e.length,t)):xa.call(this,Ene(e.values))}function xf(e){return xa.call(this,e.values.subarray(0,e.length*e.stride))}function lre(e){const{length:t,values:n,valueOffsets:r}=e,i=r[0],s=r[t],o=Math.min(s-i,n.byteLength-i);return xa.call(this,N$(-r[0],t,r)),xa.call(this,n.subarray(i,i+o)),this}function m3(e){const{length:t,valueOffsets:n}=e;return n&&xa.call(this,N$(n[0],t,n)),this.visit(e.children[0])}function lR(e){return this.visitMany(e.type.children.map((t,n)=>e.children[n]).filter(Boolean))[0]}Hr.prototype.visitBool=_7e;Hr.prototype.visitInt=xf;Hr.prototype.visitFloat=xf;Hr.prototype.visitUtf8=lre;Hr.prototype.visitBinary=lre;Hr.prototype.visitFixedSizeBinary=xf;Hr.prototype.visitDate=xf;Hr.prototype.visitTimestamp=xf;Hr.prototype.visitTime=xf;Hr.prototype.visitDecimal=xf;Hr.prototype.visitList=m3;Hr.prototype.visitStruct=lR;Hr.prototype.visitUnion=y7e;Hr.prototype.visitInterval=xf;Hr.prototype.visitFixedSizeList=m3;Hr.prototype.visitMap=m3;class cre extends Fne{constructor(t){super(),this._position=0,this._started=!1,this._sink=new ZA,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._dictionaryDeltaOffsets=new Map,wf(t)||(t={autoDestroy:!0,writeLegacyIpcFormat:!1}),this._autoDestroy=typeof t.autoDestroy=="boolean"?t.autoDestroy:!0,this._writeLegacyIpcFormat=typeof t.writeLegacyIpcFormat=="boolean"?t.writeLegacyIpcFormat:!1}static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t,n){throw new Error('"throughDOM" not available in this environment')}toString(t=!1){return this._sink.toString(t)}toUint8Array(t=!1){return this._sink.toUint8Array(t)}writeAll(t){return qI(t)?t.then(n=>this.writeAll(n)):YI(t)?v3(this,t):_3(this,t)}get closed(){return this._sink.closed}[Symbol.asyncIterator](){return this._sink[Symbol.asyncIterator]()}toDOMStream(t){return this._sink.toDOMStream(t)}toNodeStream(t){return this._sink.toNodeStream(t)}close(){return this.reset()._sink.close()}abort(t){return this.reset()._sink.abort(t)}finish(){return this._autoDestroy?this.close():this.reset(this._sink,this._schema),this}reset(t=this._sink,n=null){return t===this._sink||t instanceof ZA?this._sink=t:(this._sink=new ZA,t&&xje(t)?this.toDOMStream({type:"bytes"}).pipeTo(t):t&&Cje(t)&&this.toNodeStream({objectMode:!1}).pipe(t)),this._started&&this._schema&&this._writeFooter(this._schema),this._started=!1,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._dictionaryDeltaOffsets=new Map,(!n||!sR(n,this._schema))&&(n==null?(this._position=0,this._schema=null):(this._started=!0,this._schema=n,this._writeSchema(n))),this}write(t){let n=null;if(this._sink){if(t==null)return this.finish()&&void 0;if(t instanceof Os&&!(n=t.schema))return this.finish()&&void 0;if(t instanceof no&&!(n=t.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(n&&!sR(n,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,n)}t instanceof no?t instanceof zVe||this._writeRecordBatch(t):t instanceof Os?this.writeAll(t.batches):P$(t)&&this.writeAll(t)}_writeMessage(t,n=8){const r=n-1,i=su.encode(t),s=i.byteLength,o=this._writeLegacyIpcFormat?4:8,a=s+o+r&~r,u=a-s-o;return t.headerType===ci.RecordBatch?this._recordBatchBlocks.push(new af(a,t.bodyLength,this._position)):t.headerType===ci.DictionaryBatch&&this._dictionaryBlocks.push(new af(a,t.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(a-o)),s>0&&this._write(i),this._writePadding(u)}_write(t){if(this._started){const n=Pn(t);n&&n.byteLength>0&&(this._sink.write(n),this._position+=n.byteLength)}return this}_writeSchema(t){return this._writeMessage(su.from(t))}_writeFooter(t){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(p3)}_writePadding(t){return t>0?this._write(new Uint8Array(t)):this}_writeRecordBatch(t){const{byteLength:n,nodes:r,bufferRegions:i,buffers:s}=Hr.assemble(t),o=new _o(t.numRows,r,i),a=su.from(o,n);return this._writeDictionaries(t)._writeMessage(a)._writeBodyBuffers(s)}_writeDictionaryBatch(t,n,r=!1){this._dictionaryDeltaOffsets.set(n,t.length+(this._dictionaryDeltaOffsets.get(n)||0));const{byteLength:i,nodes:s,bufferRegions:o,buffers:a}=Hr.assemble(new _n([t])),u=new _o(t.length,s,o),l=new Du(u,n,r),c=su.from(l,i);return this._writeMessage(c)._writeBodyBuffers(a)}_writeBodyBuffers(t){let n,r,i;for(let s=-1,o=t.length;++s0&&(this._write(n),(i=(r+7&-8)-r)>0&&this._writePadding(i));return this}_writeDictionaries(t){for(let[n,r]of t.dictionaries){let i=this._dictionaryDeltaOffsets.get(n)||0;if(i===0||(r=r==null?void 0:r.slice(i)).length>0)for(const s of r.data)this._writeDictionaryBatch(s,n,i>0),i+=s.length}return this}}class g3 extends cre{static writeAll(t,n){const r=new g3(n);return qI(t)?t.then(i=>r.writeAll(i)):YI(t)?v3(r,t):_3(r,t)}}class y3 extends cre{static writeAll(t){const n=new y3;return qI(t)?t.then(r=>n.writeAll(r)):YI(t)?v3(n,t):_3(n,t)}constructor(){super(),this._autoDestroy=!0}_writeSchema(t){return this._writeMagic()._writePadding(2)}_writeFooter(t){const n=iR.encode(new iR(t,ro.V4,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(t)._write(n)._write(Int32Array.of(n.byteLength))._writeMagic()}}function _3(e,t){let n=t;t instanceof Os&&(n=t.batches,e.reset(void 0,t.schema));for(const r of n)e.write(r);return e.finish()}function v3(e,t){var n,r,i,s;return Ju(this,void 0,void 0,function*(){try{for(n=q0(t);r=yield n.next(),!r.done;){const o=r.value;e.write(o)}}catch(o){i={error:o}}finally{try{r&&!r.done&&(s=n.return)&&(yield s.call(n))}finally{if(i)throw i.error}}return e.finish()})}function v7e(e,t="stream"){return(t==="stream"?g3:y3).writeAll(e).toUint8Array(!0)}function b3(e,t=1){return(e*t+63&-64||64)/t}function lf(e,t,n=e.BYTES_PER_ELEMENT){return new e(b3(t,n))}function E3(e){return e instanceof Mn?e:new Mn(e.type,0,e.length,e.nulls,e.buffers,null,e.dict)}function b7e(e){return new _n([E3(e)])}const w3=new TextEncoder;function E7e(e,t,n){const r=w3.encode(n);return e.set(r,t),r.length}function w7e(e,t,n){return w3.encodeInto(n,e.subarray(t)).written}const T7e=w3.encodeInto?w7e:E7e;function kU(e,t){const n=lf(e.ArrayType,t);return{set(r,i){n[i]=r},data:()=>({type:e,length:t,buffers:[null,n]})}}function S7e(e,t){const n=lf(e.ArrayType,t/8);return{set(r,i){r&&(n[i>>3]|=1<({type:e,length:t,buffers:[null,n]})}}function I7e(e,t){const n=lf(e.ArrayType,t);return{set(r,i){n[i]=r/864e5|0},data:()=>({type:e,length:t,buffers:[null,n]})}}function x7e(e,t){const n=lf(e.ArrayType,t<<1);return{set(r,i){const s=i<<1;n[s]=r%4294967296|0,n[s+1]=r/4294967296|0},data:()=>({type:e,length:t,buffers:[null,n]})}}function C7e(e){const t=DT({type:e,nullValues:[null,void 0]});return{set(n,r){t.set(r,n)},data:()=>t.finish().flush()}}function A7e(e,t,n){const r=lf(Int32Array,t+1),i=lf(Uint8Array,3*n);let s=0;return{set(o,a){s+=T7e(i,s,o),r[a+1]=s},data:()=>{const o=b3(s),a=i.length>o?i.subarray(0,o):i;return{type:e,length:t,buffers:[r,a]}}}}function O7e(e,t){const n=[],r=lf(e.indices.ArrayType,t),i=Object.create(null);let s=-1,o=0;return{set(a,u){const l=String(a);let c=i[l];c===void 0&&(o+=l.length,i[l]=c=++s,n.push(l)),r[u]=c},data:()=>({type:e,length:t,buffers:[null,r],dict:P7e(e.dictionary,n,o)})}}function P7e(e,t,n){const r=A7e(e,t.length,n);return t.forEach(r.set),b7e(r.data())}function R7e(e,t){const n=lf(Uint8Array,t/8);let r=0;return{set(i,s){i==null?++r:(e.set(i,s),n[s>>3]|=1<{const i=e.data();return r&&(i.nulls=r,i.buffers[2]=n),i}}}function N7e(e,t,n=!0){let r;switch(e.typeId){case X.Int:r=e.bitWidth<64?kU:null;break;case X.Float:r=e.precision>0?kU:null;break;case X.Dictionary:r=e.dictionary.typeId===X.Utf8&&e.indices.typeId===X.Int&&e.indices.bitWidth<64?O7e:null;break;case X.Bool:r=S7e;break;case X.Date:r=e.unit?x7e:I7e;break}return r==null?C7e(e):n?R7e(r(e,t),t):r(e,t)}function k7e(e,t){const n=e.length,r=b3(n,e.BYTES_PER_ELEMENT);let i=e;return n!==r&&(i=new e.constructor(r),i.set(e)),E3({type:t,length:n,buffers:[null,i]})}function fre(e,t,n,r,i=!0){const s=N7e(r,e,i);return t(n,s.set),E3(s.data())}function T3(e){if(e instanceof Qt||e==null)return e;switch(e){case X.Binary:return new By;case X.Bool:return new jy;case X.DateDay:return new Uje;case X.DateMillisecond:case X.Date:return new Vje;case X.Dictionary:return new of(new lm,new rf);case X.Float16:return new Vte;case X.Float32:return new U$;case X.Float64:case X.Float:return new V$;case X.Int8:return new D$;case X.Int16:return new $$;case X.Int32:case X.Int:return new rf;case X.Int64:return new L$;case X.IntervalDayTime:return new Yje;case X.Interval:case X.IntervalYearMonth:return new Gje;case X.Null:return new Pl;case X.TimeMicrosecond:return new Wje;case X.TimeMillisecond:case X.Time:return new Hje;case X.TimeNanosecond:return new qje;case X.TimeSecond:return new zje;case X.Uint8:return new M$;case X.Uint16:return new F$;case X.Uint32:return new B$;case X.Uint64:return new j$;case X.Utf8:return new lm;default:jt(`Unsupported type code: ${Ou(e)}. Use a data type constructor instead?`)}}function D7e(e){return e.getUTCHours()===0&&e.getUTCMinutes()===0&&e.getUTCSeconds()===0&&e.getUTCMilliseconds()===0}function dre(e,t){const n=cR();return e(t,n.add),n}function cR(){const e={count:0,nulls:0,bools:0,nums:0,ints:0,bigints:0,min:1/0,max:-1/0,digits:0,dates:0,utcdays:0,strings:0,strlen:0,arrays:0,minlen:1/0,maxlen:0,structs:0,add(t){if(++e.count,t==null){++e.nulls;return}const n=typeof t;if(n==="string")++e.strings;else if(n==="number")++e.nums,te.max&&(e.max=t),Number.isInteger(t)&&++e.ints;else if(n==="boolean")++e.bools;else if(n==="object")if(Ol(t))++e.dates,D7e(t)&&++e.utcdays;else if(rd(t)){++e.arrays,t.lengthe.maxlen&&(e.maxlen=t.length);const r=e.array_prof||(e.array_prof=cR());t.forEach(r.add)}else{++e.structs;const r=e.struct_prof||(e.struct_prof={});for(const i in t)(r[i]||(r[i]=cR())).add(t[i])}else n==="bigint"&&(++e.bigints,te.max&&(e.max=t))},type(){return T3($7e(e))}};return e}function $7e(e){const t=e.count-e.nulls;if(t===0)return X.Null;if(e.ints===t){const n=Math.max(Math.abs(e.min)-1,e.max);return e.min<0?n>=2**31?X.Float64:n<128?X.Int8:n<32768?X.Int16:X.Int32:n>=2**32?X.Float64:n<256?X.Uint8:n<65536?X.Uint16:X.Uint32}else{if(e.nums===t)return X.Float64;if(e.bigints===t){const n=-e.min>e.max?-e.min-1n:e.max;return e.min<0?n<2**63?X.Int64:jt(`BigInt exceeds 64 bits: ${n}`):e.max<2**64?X.Uint64:jt(`BigInt exceeds 64 bits: ${e.max}`)}else{if(e.bools===t)return X.Bool;if(e.utcdays===t)return X.DateDay;if(e.dates===t)return X.DateMillisecond;if(e.arrays===t){const n=In.new("value",e.array_prof.type(),!0);return e.minlen===e.maxlen?new hm(e.minlen,n):new dm(n)}else if(e.structs===t){const n=e.struct_prof;return new Yi(Object.keys(n).map(r=>In.new(r,n[r].type(),!0)))}else{if(e.strings>0)return X.Dictionary;jt("Type inference failure")}}}}function L7e(e,t,n,r,i,s=!0){if(i=T3(i),!i){const o=dre(r,t);s=o.nulls>0,i=o.type()}return fre(n,r,t,i,s)}function M7e(e,t,n,r,i,s=!0){i=T3(i);const o=e.column(t),a=!(e.isFiltered()||e.isOrdered()),u=F7e(o);if(u&&a&&DU(u.type,i))return u;const l=o.data;if(W_(l)){const c=B7e(l);if(a&&c&&DU(c,i))return k7e(l,c);i=i||c,s=!1}if(!i){const c=dre(r,o);s=c.nulls>0,i=c.type()}return fre(n,r,o,i,s)}function F7e(e){return e instanceof _n?e:e.vector instanceof _n?e.vector:null}function B7e(e){const n={Float32Array:U$,Float64Array:V$,Int8Array:D$,Int16Array:$$,Int32Array:rf,Uint8Array:M$,Uint16Array:F$,Uint32Array:B$,BigInt64Array:L$,BigUint64Array:j$}[e.constructor.name];return n?new n:null}function DU(e,t){return!e||!t?!0:e.compareTo(t)}function j7e(e,t,n){const r=Math.min(e.length,n+t);return(i,s)=>{for(let o=n;o{let o=-1;r&&rd(i.data)?i.data.forEach(s):e.scan(a=>s(i.get(a),++o),!0,t,n)}}const V7e=()=>jt("Apache Arrow not imported, see https://github.com/uwdata/arquero#usage");function z7e(){try{return Os}catch{V7e()}}function hre(e,t={}){const{types:n={}}=t,{dataFrom:r,names:i,nrows:s,scan:o}=H7e(e,t),a={};i.forEach(l=>{const c=r(e,l,s,o,n[l]);c.length!==s&&jt("Column length mismatch"),a[l]=c});const u=z7e();return new u(a)}function H7e(e,t){const{columns:n,limit:r=1/0,offset:i=0}=t,s=er(n)?n(e):yn(n)?n:null;if(yn(e))return{dataFrom:L7e,names:s||Object.keys(e[0]),nrows:Math.min(r,e.length-i),scan:j7e(e,r,i)};if(W7e(e))return{dataFrom:M7e,names:s||e.columnNames(),nrows:Math.min(r,e.numRows()-i),scan:U7e(e,r,i)};jt("Unsupported input data type")}function W7e(e){return e&&er(e.reify)}function q7e(e,t={}){const{format:n,...r}=t,i=n||"stream";if(!["stream","file"].includes(i))throw Error("Unrecognised output format");return v7e(hre(e,r),n)}function Y7e(e){return e.getUTCHours()===0&&e.getUTCMinutes()===0&&e.getUTCSeconds()===0&&e.getUTCMilliseconds()===0}function G7e(e,t={}){let n=0,r=0,i=0,s=0,o=0,a=0;return e(u=>{if(++n,u==null){++r;return}const l=typeof u;if(l==="object"&&Ol(u))++i,Y7e(u)&&++s;else if(l==="number"&&(++o,u===u&&(u|0)!==u)){const c=u+"",f=c.indexOf(".");if(f>=0){const d=c.indexOf("e"),h=d>0?d:c.length;a=Math.max(a,h-f-1)}}}),{align:(r+o+i)/n>.5?"r":"l",format:{utc:i===s,digits:Math.min(a,t.maxdigits||6)}}}function nx(e,t){return er(t)?t(e):t||e.columnNames()}function pre(e,t,n){const r=n.format||{},i=n.align||{},s={},o={};return t.forEach(a=>{const u=G7e(K7e(e,a),n);o[a]=i[a]||u.align,s[a]=r[a]||u.format}),{align:o,format:s}}function K7e(e,t){const n=e.column(t);return r=>e.scan(i=>r(n.get(i)))}function S3(e,t,n=100,r,i){const s=e.data(),o=t.length;e.scan(a=>{i.row(a);for(let u=0;ui));return new Os(n,r.map(i=>new no(n,i)))}slice(t,n){const r=this.schema;[t,n]=_ne({length:this.numRows},t,n);const i=Tne(this.data,this._offsets,t,n);return new Os(r,i.map(s=>new no(r,s)))}getChild(t){return this.getChildAt(this.schema.fields.findIndex(n=>n.name===t))}getChildAt(t){if(t>-1&&tr.children[t]);if(n.length===0){const{type:r}=this.schema.fields[t],i=Hi({type:r,length:0,nullCount:0});n.push(i._changeLengthAndBackfillNullBitmap(this.numRows))}return new _n(n)}return null}setChild(t,n){var r;return this.setChildAt((r=this.schema.fields)===null||r===void 0?void 0:r.findIndex(i=>i.name===t),n)}setChildAt(t,n){let r=this.schema,i=[...this.batches];if(t>-1&&tthis.getChildAt(l));[s[t],a[t]]=[o,n],[r,i]=eO(r,a)}return new Os(r,i)}select(t){const n=this.schema.fields.reduce((r,i,s)=>r.set(i.name,s),new Map);return this.selectAt(t.map(r=>n.get(r)).filter(r=>r>-1))}selectAt(t){const n=this.schema.selectAt(t),r=this.batches.map(i=>i.selectAt(t));return new Os(n,r)}assign(t){const n=this.schema.fields,[r,i]=t.schema.fields.reduce((a,u,l)=>{const[c,f]=a,d=n.findIndex(h=>h.name===u.name);return~d?f[d]=l:c.push(l),a},[[],[]]),s=this.schema.assign(t.schema),o=[...n.map((a,u)=>[u,i[u]]).map(([a,u])=>u===void 0?this.getChildAt(a):t.getChildAt(u)),...r.map(a=>t.getChildAt(a))].filter(Boolean);return new Os(...eO(s,o))}}ere=Symbol.toStringTag;Os[ere]=(e=>(e.schema=null,e.batches=[],e._offsets=new Uint32Array([0]),e._nullCount=-1,e[Symbol.isConcatSpreadable]=!0,e.isValid=kp(u3),e.get=kp(zs.getVisitFn(X.Struct)),e.set=Sne(Go.getVisitFn(X.Struct)),e.indexOf=Ine(xT.getVisitFn(X.Struct)),e.getByteLength=kp(ku.getVisitFn(X.Struct)),"Table"))(Os.prototype);var tre;let no=class f0{constructor(...t){switch(t.length){case 2:{if([this.schema]=t,!(this.schema instanceof An))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");if([,this.data=Hi({nullCount:0,type:new Yi(this.schema.fields),children:this.schema.fields.map(n=>Hi({type:n.type,nullCount:0}))})]=t,!(this.data instanceof Mn))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=xU(this.schema,this.data.children);break}case 1:{const[n]=t,{fields:r,children:i,length:s}=Object.keys(n).reduce((u,l,c)=>(u.children[c]=n[l],u.length=Math.max(u.length,n[l].length),u.fields[c]=In.new({name:l,type:n[l].type,nullable:!0}),u),{length:0,fields:new Array,children:new Array}),o=new An(r),a=Hi({type:new Yi(r),length:s,children:i,nullCount:0});[this.schema,this.data]=xU(o,a.children,s);break}default:throw new TypeError("RecordBatch constructor expects an Object mapping names to child Data, or a [Schema, Data] pair.")}}get dictionaries(){return this._dictionaries||(this._dictionaries=nre(this.schema.fields,this.data.children))}get numCols(){return this.schema.fields.length}get numRows(){return this.data.length}get nullCount(){return this.data.nullCount}isValid(t){return this.data.getValid(t)}get(t){return zs.visit(this.data,t)}set(t,n){return Go.visit(this.data,t,n)}indexOf(t,n){return xT.visit(this.data,t,n)}getByteLength(t){return ku.visit(this.data,t)}[Symbol.iterator](){return l3.visit(new _n([this.data]))}toArray(){return[...this]}concat(...t){return new Os(this.schema,[this,...t])}slice(t,n){const[r]=new _n([this.data]).slice(t,n).data;return new f0(this.schema,r)}getChild(t){var n;return this.getChildAt((n=this.schema.fields)===null||n===void 0?void 0:n.findIndex(r=>r.name===t))}getChildAt(t){return t>-1&&ti.name===t),n)}setChildAt(t,n){let r=this.schema,i=this.data;if(t>-1&&ta.name===s);~o&&(i[o]=this.data.children[o])}return new f0(n,Hi({type:r,length:this.numRows,children:i}))}selectAt(t){const n=this.schema.selectAt(t),r=t.map(s=>this.data.children[s]).filter(Boolean),i=Hi({type:new Yi(n.fields),length:this.numRows,children:r});return new f0(n,i)}};tre=Symbol.toStringTag;no[tre]=(e=>(e._nullCount=-1,e[Symbol.isConcatSpreadable]=!0,"RecordBatch"))(no.prototype);function xU(e,t,n=t.reduce((r,i)=>Math.max(r,i.length),0)){var r;const i=[...e.fields],s=[...t],o=(n+63&-64)>>3;for(const[a,u]of e.fields.entries()){const l=t[a];(!l||l.length!==n)&&(i[a]=u.clone({nullable:!0}),s[a]=(r=l==null?void 0:l._changeLengthAndBackfillNullBitmap(n))!==null&&r!==void 0?r:Hi({type:u.type,length:n,nullCount:n,nullBitmap:new Uint8Array(o)}))}return[e.assign(i),Hi({type:new Yi(i),length:n,children:s})]}function nre(e,t,n=new Map){for(let r=-1,i=e.length;++r0&&nre(o.children,a.children,n)}return n}class zVe extends no{constructor(t){const n=t.fields.map(i=>Hi({type:i.type})),r=Hi({type:new Yi(t.fields),nullCount:0,children:n});super(t,r)}}var $T;(function(e){e[e.BUFFER=0]="BUFFER"})($T||($T={}));var LT;(function(e){e[e.LZ4_FRAME=0]="LZ4_FRAME",e[e.ZSTD=1]="ZSTD"})(LT||(LT={}));class dc{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsBodyCompression(t,n){return(n||new dc).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBodyCompression(t,n){return t.setPosition(t.position()+zn),(n||new dc).__init(t.readInt32(t.position())+t.position(),t)}codec(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt8(this.bb_pos+t):LT.LZ4_FRAME}method(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt8(this.bb_pos+t):$T.BUFFER}static startBodyCompression(t){t.startObject(2)}static addCodec(t,n){t.addFieldInt8(0,n,LT.LZ4_FRAME)}static addMethod(t,n){t.addFieldInt8(1,n,$T.BUFFER)}static endBodyCompression(t){return t.endObject()}static createBodyCompression(t,n,r){return dc.startBodyCompression(t),dc.addCodec(t,n),dc.addMethod(t,r),dc.endBodyCompression(t)}}class rre{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}offset(){return this.bb.readInt64(this.bb_pos)}length(){return this.bb.readInt64(this.bb_pos+8)}static sizeOf(){return 16}static createBuffer(t,n,r){return t.prep(8,16),t.writeInt64(r),t.writeInt64(n),t.offset()}}let ire=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}length(){return this.bb.readInt64(this.bb_pos)}nullCount(){return this.bb.readInt64(this.bb_pos+8)}static sizeOf(){return 16}static createFieldNode(t,n,r){return t.prep(8,16),t.writeInt64(r),t.writeInt64(n),t.offset()}},Gu=class oR{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsRecordBatch(t,n){return(n||new oR).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsRecordBatch(t,n){return t.setPosition(t.position()+zn),(n||new oR).__init(t.readInt32(t.position())+t.position(),t)}length(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}nodes(t,n){const r=this.bb.__offset(this.bb_pos,6);return r?(n||new ire).__init(this.bb.__vector(this.bb_pos+r)+t*16,this.bb):null}nodesLength(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}buffers(t,n){const r=this.bb.__offset(this.bb_pos,8);return r?(n||new rre).__init(this.bb.__vector(this.bb_pos+r)+t*16,this.bb):null}buffersLength(){const t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}compression(t){const n=this.bb.__offset(this.bb_pos,10);return n?(t||new dc).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}static startRecordBatch(t){t.startObject(4)}static addLength(t,n){t.addFieldInt64(0,n,t.createLong(0,0))}static addNodes(t,n){t.addFieldOffset(1,n,0)}static startNodesVector(t,n){t.startVector(16,n,8)}static addBuffers(t,n){t.addFieldOffset(2,n,0)}static startBuffersVector(t,n){t.startVector(16,n,8)}static addCompression(t,n){t.addFieldOffset(3,n,0)}static endRecordBatch(t){return t.endObject()}},Dh=class aR{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsDictionaryBatch(t,n){return(n||new aR).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDictionaryBatch(t,n){return t.setPosition(t.position()+zn),(n||new aR).__init(t.readInt32(t.position())+t.position(),t)}id(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}data(t){const n=this.bb.__offset(this.bb_pos,6);return n?(t||new Gu).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}isDelta(){const t=this.bb.__offset(this.bb_pos,8);return t?!!this.bb.readInt8(this.bb_pos+t):!1}static startDictionaryBatch(t){t.startObject(3)}static addId(t,n){t.addFieldInt64(0,n,t.createLong(0,0))}static addData(t,n){t.addFieldOffset(1,n,0)}static addIsDelta(t,n){t.addFieldInt8(2,+n,0)}static endDictionaryBatch(t){return t.endObject()}};var MT;(function(e){e[e.NONE=0]="NONE",e[e.Schema=1]="Schema",e[e.DictionaryBatch=2]="DictionaryBatch",e[e.RecordBatch=3]="RecordBatch",e[e.Tensor=4]="Tensor",e[e.SparseTensor=5]="SparseTensor"})(MT||(MT={}));let nc=class Ua{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsMessage(t,n){return(n||new Ua).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMessage(t,n){return t.setPosition(t.position()+zn),(n||new Ua).__init(t.readInt32(t.position())+t.position(),t)}version(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):pm.V1}headerType(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):MT.NONE}header(t){const n=this.bb.__offset(this.bb_pos,8);return n?this.bb.__union(t,this.bb_pos+n):null}bodyLength(){const t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}customMetadata(t,n){const r=this.bb.__offset(this.bb_pos,12);return r?(n||new Gr).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+t*4),this.bb):null}customMetadataLength(){const t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}static startMessage(t){t.startObject(5)}static addVersion(t,n){t.addFieldInt16(0,n,pm.V1)}static addHeaderType(t,n){t.addFieldInt8(1,n,MT.NONE)}static addHeader(t,n){t.addFieldOffset(2,n,0)}static addBodyLength(t,n){t.addFieldInt64(3,n,t.createLong(0,0))}static addCustomMetadata(t,n){t.addFieldOffset(4,n,0)}static createCustomMetadataVector(t,n){t.startVector(4,n.length,4);for(let r=n.length-1;r>=0;r--)t.addOffset(n[r]);return t.endVector()}static startCustomMetadataVector(t,n){t.startVector(4,n,4)}static endMessage(t){return t.endObject()}static finishMessageBuffer(t,n){t.finish(n)}static finishSizePrefixedMessageBuffer(t,n){t.finish(n,void 0,!0)}static createMessage(t,n,r,i,s,o){return Ua.startMessage(t),Ua.addVersion(t,n),Ua.addHeaderType(t,r),Ua.addHeader(t,i),Ua.addBodyLength(t,s),Ua.addCustomMetadata(t,o),Ua.endMessage(t)}};var HVe=yl;class WVe extends on{visit(t,n){return t==null||n==null?void 0:super.visit(t,n)}visitNull(t,n){return ud.startNull(n),ud.endNull(n)}visitInt(t,n){return to.startInt(n),to.addBitWidth(n,t.bitWidth),to.addIsSigned(n,t.isSigned),to.endInt(n)}visitFloat(t,n){return ru.startFloatingPoint(n),ru.addPrecision(n,t.precision),ru.endFloatingPoint(n)}visitBinary(t,n){return sd.startBinary(n),sd.endBinary(n)}visitBool(t,n){return od.startBool(n),od.endBool(n)}visitUtf8(t,n){return cd.startUtf8(n),cd.endUtf8(n)}visitDecimal(t,n){return xs.startDecimal(n),xs.addScale(n,t.scale),xs.addPrecision(n,t.precision),xs.addBitWidth(n,t.bitWidth),xs.endDecimal(n)}visitDate(t,n){return mb.startDate(n),mb.addUnit(n,t.unit),mb.endDate(n)}visitTime(t,n){return $o.startTime(n),$o.addUnit(n,t.unit),$o.addBitWidth(n,t.bitWidth),$o.endTime(n)}visitTimestamp(t,n){const r=t.timezone&&n.createString(t.timezone)||void 0;return c0.startTimestamp(n),c0.addUnit(n,t.unit),r!==void 0&&c0.addTimezone(n,r),c0.endTimestamp(n)}visitInterval(t,n){return iu.startInterval(n),iu.addUnit(n,t.unit),iu.endInterval(n)}visitList(t,n){return ad.startList(n),ad.endList(n)}visitStruct(t,n){return ld.startStruct_(n),ld.endStruct_(n)}visitUnion(t,n){As.startTypeIdsVector(n,t.typeIds.length);const r=As.createTypeIdsVector(n,t.typeIds);return As.startUnion(n),As.addMode(n,t.mode),As.addTypeIds(n,r),As.endUnion(n)}visitDictionary(t,n){const r=this.visit(t.indices,n);return el.startDictionaryEncoding(n),el.addId(n,new HVe(t.id,0)),el.addIsOrdered(n,t.isOrdered),r!==void 0&&el.addIndexType(n,r),el.endDictionaryEncoding(n)}visitFixedSizeBinary(t,n){return tu.startFixedSizeBinary(n),tu.addByteWidth(n,t.byteWidth),tu.endFixedSizeBinary(n)}visitFixedSizeList(t,n){return nu.startFixedSizeList(n),nu.addListSize(n,t.listSize),nu.endFixedSizeList(n)}visitMap(t,n){return gb.startMap(n),gb.addKeysSorted(n,t.keysSorted),gb.endMap(n)}}const tO=new WVe;function qVe(e,t=new Map){return new An(GVe(e,t),_b(e.customMetadata),t)}function sre(e){return new _o(e.count,ore(e.columns),are(e.columns))}function YVe(e){return new Du(sre(e.data),e.id,e.isDelta)}function GVe(e,t){return(e.fields||[]).filter(Boolean).map(n=>In.fromJSON(n,t))}function CU(e,t){return(e.children||[]).filter(Boolean).map(n=>In.fromJSON(n,t))}function ore(e){return(e||[]).reduce((t,n)=>[...t,new uh(n.count,KVe(n.VALIDITY)),...ore(n.children)],[])}function are(e,t=[]){for(let n=-1,r=(e||[]).length;++nt+ +(n===0),0)}function QVe(e,t){let n,r,i,s,o,a;return!t||!(s=e.dictionary)?(o=OU(e,CU(e,t)),i=new In(e.name,o,e.nullable,_b(e.customMetadata))):t.has(n=s.id)?(r=(r=s.indexType)?AU(r):new rf,a=new of(t.get(n),r,n,s.isOrdered),i=new In(e.name,a,e.nullable,_b(e.customMetadata))):(r=(r=s.indexType)?AU(r):new rf,t.set(n,o=OU(e,CU(e,t))),a=new of(o,r,n,s.isOrdered),i=new In(e.name,a,e.nullable,_b(e.customMetadata))),i||null}function _b(e){return new Map(Object.entries(e||{}))}function AU(e){return new fs(e.isSigned,e.bitWidth)}function OU(e,t){const n=e.type.name;switch(n){case"NONE":return new Pl;case"null":return new Pl;case"binary":return new By;case"utf8":return new lm;case"bool":return new jy;case"list":return new dm((t||[])[0]);case"struct":return new Yi(t||[]);case"struct_":return new Yi(t||[])}switch(n){case"int":{const r=e.type;return new fs(r.isSigned,r.bitWidth)}case"floatingpoint":{const r=e.type;return new sf(Ni[r.precision])}case"decimal":{const r=e.type;return new TT(r.scale,r.precision,r.bitWidth)}case"date":{const r=e.type;return new cm(Ru[r.unit])}case"time":{const r=e.type;return new Rl(sn[r.unit],r.bitWidth)}case"timestamp":{const r=e.type;return new ST(sn[r.unit],r.timezone)}case"interval":{const r=e.type;return new fm(Nu[r.unit])}case"union":{const r=e.type;return new Uy(Yo[r.mode],r.typeIds||[],t||[])}case"fixedsizebinary":{const r=e.type;return new IT(r.byteWidth)}case"fixedsizelist":{const r=e.type;return new hm(r.listSize,(t||[])[0])}case"map":{const r=e.type;return new Vy((t||[])[0],r.keysSorted)}}throw new Error(`Unrecognized type: "${n}"`)}var Bd=yl,XVe=$ne,JVe=AT;class su{constructor(t,n,r,i){this._version=n,this._headerType=r,this.body=new Uint8Array(0),i&&(this._createHeader=()=>i),this._bodyLength=typeof t=="number"?t:t.low}static fromJSON(t,n){const r=new su(0,ro.V4,n);return r._createHeader=ZVe(t,n),r}static decode(t){t=new JVe(Pn(t));const n=nc.getRootAsMessage(t),r=n.bodyLength(),i=n.version(),s=n.headerType(),o=new su(r,i,s);return o._createHeader=e7e(n,s),o}static encode(t){const n=new XVe;let r=-1;return t.isSchema()?r=An.encode(n,t.header()):t.isRecordBatch()?r=_o.encode(n,t.header()):t.isDictionaryBatch()&&(r=Du.encode(n,t.header())),nc.startMessage(n),nc.addVersion(n,ro.V4),nc.addHeader(n,r),nc.addHeaderType(n,t.headerType),nc.addBodyLength(n,new Bd(t.bodyLength,0)),nc.finishMessageBuffer(n,nc.endMessage(n)),n.asUint8Array()}static from(t,n=0){if(t instanceof An)return new su(0,ro.V4,ci.Schema,t);if(t instanceof _o)return new su(n,ro.V4,ci.RecordBatch,t);if(t instanceof Du)return new su(n,ro.V4,ci.DictionaryBatch,t);throw new Error(`Unrecognized Message header: ${t}`)}get type(){return this.headerType}get version(){return this._version}get headerType(){return this._headerType}get bodyLength(){return this._bodyLength}header(){return this._createHeader()}isSchema(){return this.headerType===ci.Schema}isRecordBatch(){return this.headerType===ci.RecordBatch}isDictionaryBatch(){return this.headerType===ci.DictionaryBatch}}class _o{constructor(t,n,r){this._nodes=n,this._buffers=r,this._length=typeof t=="number"?t:t.low}get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}}class Du{constructor(t,n,r=!1){this._data=t,this._isDelta=r,this._id=typeof n=="number"?n:n.low}get id(){return this._id}get data(){return this._data}get isDelta(){return this._isDelta}get length(){return this.data.length}get nodes(){return this.data.nodes}get buffers(){return this.data.buffers}}class cu{constructor(t,n){this.offset=typeof t=="number"?t:t.low,this.length=typeof n=="number"?n:n.low}}class uh{constructor(t,n){this.length=typeof t=="number"?t:t.low,this.nullCount=typeof n=="number"?n:n.low}}function ZVe(e,t){return()=>{switch(t){case ci.Schema:return An.fromJSON(e);case ci.RecordBatch:return _o.fromJSON(e);case ci.DictionaryBatch:return Du.fromJSON(e)}throw new Error(`Unrecognized Message type: { name: ${ci[t]}, type: ${t} }`)}}function e7e(e,t){return()=>{switch(t){case ci.Schema:return An.decode(e.header(new qa));case ci.RecordBatch:return _o.decode(e.header(new Gu),e.version());case ci.DictionaryBatch:return Du.decode(e.header(new Dh),e.version())}throw new Error(`Unrecognized Message type: { name: ${ci[t]}, type: ${t} }`)}}In.encode=f7e;In.decode=l7e;In.fromJSON=QVe;An.encode=c7e;An.decode=t7e;An.fromJSON=qVe;_o.encode=d7e;_o.decode=n7e;_o.fromJSON=sre;Du.encode=h7e;Du.decode=r7e;Du.fromJSON=YVe;uh.encode=p7e;uh.decode=s7e;cu.encode=m7e;cu.decode=i7e;function t7e(e,t=new Map){const n=u7e(e,t);return new An(n,vb(e),t)}function n7e(e,t=ro.V4){if(e.compression()!==null)throw new Error("Record batch compression not implemented");return new _o(e.length(),o7e(e),a7e(e,t))}function r7e(e,t=ro.V4){return new Du(_o.decode(e.data(),t),e.id(),e.isDelta())}function i7e(e){return new cu(e.offset(),e.length())}function s7e(e){return new uh(e.length(),e.nullCount())}function o7e(e){const t=[];for(let n,r=-1,i=-1,s=e.nodesLength();++rIn.encode(e,s));qa.startFieldsVector(e,n.length);const r=qa.createFieldsVector(e,n),i=t.metadata&&t.metadata.size>0?qa.createCustomMetadataVector(e,[...t.metadata].map(([s,o])=>{const a=e.createString(`${s}`),u=e.createString(`${o}`);return Gr.startKeyValue(e),Gr.addKey(e,a),Gr.addValue(e,u),Gr.endKeyValue(e)})):-1;return qa.startSchema(e),qa.addFields(e,r),qa.addEndianness(e,g7e?mm.Little:mm.Big),i!==-1&&qa.addCustomMetadata(e,i),qa.endSchema(e)}function f7e(e,t){let n=-1,r=-1,i=-1;const s=t.type;let o=t.typeId;Qt.isDictionary(s)?(o=s.dictionary.typeId,i=tO.visit(s,e),r=tO.visit(s.dictionary,e)):r=tO.visit(s,e);const a=(s.children||[]).map(c=>In.encode(e,c)),u=Ao.createChildrenVector(e,a),l=t.metadata&&t.metadata.size>0?Ao.createCustomMetadataVector(e,[...t.metadata].map(([c,f])=>{const d=e.createString(`${c}`),h=e.createString(`${f}`);return Gr.startKeyValue(e),Gr.addKey(e,d),Gr.addValue(e,h),Gr.endKeyValue(e)})):-1;return t.name&&(n=e.createString(t.name)),Ao.startField(e),Ao.addType(e,r),Ao.addTypeType(e,o),Ao.addChildren(e,u),Ao.addNullable(e,!!t.nullable),n!==-1&&Ao.addName(e,n),i!==-1&&Ao.addDictionary(e,i),l!==-1&&Ao.addCustomMetadata(e,l),Ao.endField(e)}function d7e(e,t){const n=t.nodes||[],r=t.buffers||[];Gu.startNodesVector(e,n.length);for(const o of n.slice().reverse())uh.encode(e,o);const i=e.endVector();Gu.startBuffersVector(e,r.length);for(const o of r.slice().reverse())cu.encode(e,o);const s=e.endVector();return Gu.startRecordBatch(e),Gu.addLength(e,new Bd(t.length,0)),Gu.addNodes(e,i),Gu.addBuffers(e,s),Gu.endRecordBatch(e)}function h7e(e,t){const n=_o.encode(e,t.data);return Dh.startDictionaryBatch(e),Dh.addId(e,new Bd(t.id,0)),Dh.addIsDelta(e,t.isDelta),Dh.addData(e,n),Dh.endDictionaryBatch(e)}function p7e(e,t){return ire.createFieldNode(e,new Bd(t.length,0),new Bd(t.nullCount,0))}function m7e(e,t){return rre.createBuffer(e,new Bd(t.offset,0),new Bd(t.length,0))}const g7e=(()=>{const e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),new Int16Array(e)[0]===256})(),uR="ARROW1",p3=new Uint8Array(uR.length);for(let e=0;ei.flatMap(s=>Array.isArray(s)?n(s):s instanceof no?s.data.children:s.data),r=new Hr;return r.visitMany(n(t)),r}visit(t){if(t instanceof _n)return this.visitMany(t.data),this;const{type:n}=t;if(!Qt.isDictionary(n)){const{length:r,nullCount:i}=t;if(r>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");Qt.isNull(n)||xa.call(this,i<=0?new Uint8Array(0):s3(t.offset,r,t.nullBitmap)),this.nodes.push(new uh(r,i))}return super.visit(t)}visitNull(t){return this}visitDictionary(t){return this.visit(t.clone(t.type.indices))}get nodes(){return this._nodes}get buffers(){return this._buffers}get byteLength(){return this._byteLength}get bufferRegions(){return this._bufferRegions}}function xa(e){const t=e.byteLength+7&-8;return this.buffers.push(e),this.bufferRegions.push(new cu(this._byteLength,t)),this._byteLength+=t,this}function y7e(e){const{type:t,length:n,typeIds:r,valueOffsets:i}=e;if(xa.call(this,r),t.mode===Yo.Sparse)return lR.call(this,e);if(t.mode===Yo.Dense){if(e.offset<=0)return xa.call(this,i),lR.call(this,e);{const s=r.reduce((c,f)=>Math.max(c,f),r[0]),o=new Int32Array(s+1),a=new Int32Array(s+1).fill(-1),u=new Int32Array(n),l=N$(-i[0],n,i);for(let c,f,d=-1;++d=e.length?xa.call(this,new Uint8Array(0)):(t=e.values)instanceof Uint8Array?xa.call(this,s3(e.offset,e.length,t)):xa.call(this,bne(e.values))}function xf(e){return xa.call(this,e.values.subarray(0,e.length*e.stride))}function ure(e){const{length:t,values:n,valueOffsets:r}=e,i=r[0],s=r[t],o=Math.min(s-i,n.byteLength-i);return xa.call(this,N$(-r[0],t,r)),xa.call(this,n.subarray(i,i+o)),this}function m3(e){const{length:t,valueOffsets:n}=e;return n&&xa.call(this,N$(n[0],t,n)),this.visit(e.children[0])}function lR(e){return this.visitMany(e.type.children.map((t,n)=>e.children[n]).filter(Boolean))[0]}Hr.prototype.visitBool=_7e;Hr.prototype.visitInt=xf;Hr.prototype.visitFloat=xf;Hr.prototype.visitUtf8=ure;Hr.prototype.visitBinary=ure;Hr.prototype.visitFixedSizeBinary=xf;Hr.prototype.visitDate=xf;Hr.prototype.visitTimestamp=xf;Hr.prototype.visitTime=xf;Hr.prototype.visitDecimal=xf;Hr.prototype.visitList=m3;Hr.prototype.visitStruct=lR;Hr.prototype.visitUnion=y7e;Hr.prototype.visitInterval=xf;Hr.prototype.visitFixedSizeList=m3;Hr.prototype.visitMap=m3;class lre extends Mne{constructor(t){super(),this._position=0,this._started=!1,this._sink=new ZA,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._dictionaryDeltaOffsets=new Map,wf(t)||(t={autoDestroy:!0,writeLegacyIpcFormat:!1}),this._autoDestroy=typeof t.autoDestroy=="boolean"?t.autoDestroy:!0,this._writeLegacyIpcFormat=typeof t.writeLegacyIpcFormat=="boolean"?t.writeLegacyIpcFormat:!1}static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t,n){throw new Error('"throughDOM" not available in this environment')}toString(t=!1){return this._sink.toString(t)}toUint8Array(t=!1){return this._sink.toUint8Array(t)}writeAll(t){return qI(t)?t.then(n=>this.writeAll(n)):YI(t)?v3(this,t):_3(this,t)}get closed(){return this._sink.closed}[Symbol.asyncIterator](){return this._sink[Symbol.asyncIterator]()}toDOMStream(t){return this._sink.toDOMStream(t)}toNodeStream(t){return this._sink.toNodeStream(t)}close(){return this.reset()._sink.close()}abort(t){return this.reset()._sink.abort(t)}finish(){return this._autoDestroy?this.close():this.reset(this._sink,this._schema),this}reset(t=this._sink,n=null){return t===this._sink||t instanceof ZA?this._sink=t:(this._sink=new ZA,t&&xje(t)?this.toDOMStream({type:"bytes"}).pipeTo(t):t&&Cje(t)&&this.toNodeStream({objectMode:!1}).pipe(t)),this._started&&this._schema&&this._writeFooter(this._schema),this._started=!1,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._dictionaryDeltaOffsets=new Map,(!n||!sR(n,this._schema))&&(n==null?(this._position=0,this._schema=null):(this._started=!0,this._schema=n,this._writeSchema(n))),this}write(t){let n=null;if(this._sink){if(t==null)return this.finish()&&void 0;if(t instanceof Os&&!(n=t.schema))return this.finish()&&void 0;if(t instanceof no&&!(n=t.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(n&&!sR(n,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,n)}t instanceof no?t instanceof zVe||this._writeRecordBatch(t):t instanceof Os?this.writeAll(t.batches):P$(t)&&this.writeAll(t)}_writeMessage(t,n=8){const r=n-1,i=su.encode(t),s=i.byteLength,o=this._writeLegacyIpcFormat?4:8,a=s+o+r&~r,u=a-s-o;return t.headerType===ci.RecordBatch?this._recordBatchBlocks.push(new af(a,t.bodyLength,this._position)):t.headerType===ci.DictionaryBatch&&this._dictionaryBlocks.push(new af(a,t.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(a-o)),s>0&&this._write(i),this._writePadding(u)}_write(t){if(this._started){const n=Pn(t);n&&n.byteLength>0&&(this._sink.write(n),this._position+=n.byteLength)}return this}_writeSchema(t){return this._writeMessage(su.from(t))}_writeFooter(t){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(p3)}_writePadding(t){return t>0?this._write(new Uint8Array(t)):this}_writeRecordBatch(t){const{byteLength:n,nodes:r,bufferRegions:i,buffers:s}=Hr.assemble(t),o=new _o(t.numRows,r,i),a=su.from(o,n);return this._writeDictionaries(t)._writeMessage(a)._writeBodyBuffers(s)}_writeDictionaryBatch(t,n,r=!1){this._dictionaryDeltaOffsets.set(n,t.length+(this._dictionaryDeltaOffsets.get(n)||0));const{byteLength:i,nodes:s,bufferRegions:o,buffers:a}=Hr.assemble(new _n([t])),u=new _o(t.length,s,o),l=new Du(u,n,r),c=su.from(l,i);return this._writeMessage(c)._writeBodyBuffers(a)}_writeBodyBuffers(t){let n,r,i;for(let s=-1,o=t.length;++s0&&(this._write(n),(i=(r+7&-8)-r)>0&&this._writePadding(i));return this}_writeDictionaries(t){for(let[n,r]of t.dictionaries){let i=this._dictionaryDeltaOffsets.get(n)||0;if(i===0||(r=r==null?void 0:r.slice(i)).length>0)for(const s of r.data)this._writeDictionaryBatch(s,n,i>0),i+=s.length}return this}}class g3 extends lre{static writeAll(t,n){const r=new g3(n);return qI(t)?t.then(i=>r.writeAll(i)):YI(t)?v3(r,t):_3(r,t)}}class y3 extends lre{static writeAll(t){const n=new y3;return qI(t)?t.then(r=>n.writeAll(r)):YI(t)?v3(n,t):_3(n,t)}constructor(){super(),this._autoDestroy=!0}_writeSchema(t){return this._writeMagic()._writePadding(2)}_writeFooter(t){const n=iR.encode(new iR(t,ro.V4,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(t)._write(n)._write(Int32Array.of(n.byteLength))._writeMagic()}}function _3(e,t){let n=t;t instanceof Os&&(n=t.batches,e.reset(void 0,t.schema));for(const r of n)e.write(r);return e.finish()}function v3(e,t){var n,r,i,s;return Ju(this,void 0,void 0,function*(){try{for(n=q0(t);r=yield n.next(),!r.done;){const o=r.value;e.write(o)}}catch(o){i={error:o}}finally{try{r&&!r.done&&(s=n.return)&&(yield s.call(n))}finally{if(i)throw i.error}}return e.finish()})}function v7e(e,t="stream"){return(t==="stream"?g3:y3).writeAll(e).toUint8Array(!0)}function b3(e,t=1){return(e*t+63&-64||64)/t}function lf(e,t,n=e.BYTES_PER_ELEMENT){return new e(b3(t,n))}function E3(e){return e instanceof Mn?e:new Mn(e.type,0,e.length,e.nulls,e.buffers,null,e.dict)}function b7e(e){return new _n([E3(e)])}const w3=new TextEncoder;function E7e(e,t,n){const r=w3.encode(n);return e.set(r,t),r.length}function w7e(e,t,n){return w3.encodeInto(n,e.subarray(t)).written}const T7e=w3.encodeInto?w7e:E7e;function kU(e,t){const n=lf(e.ArrayType,t);return{set(r,i){n[i]=r},data:()=>({type:e,length:t,buffers:[null,n]})}}function S7e(e,t){const n=lf(e.ArrayType,t/8);return{set(r,i){r&&(n[i>>3]|=1<({type:e,length:t,buffers:[null,n]})}}function I7e(e,t){const n=lf(e.ArrayType,t);return{set(r,i){n[i]=r/864e5|0},data:()=>({type:e,length:t,buffers:[null,n]})}}function x7e(e,t){const n=lf(e.ArrayType,t<<1);return{set(r,i){const s=i<<1;n[s]=r%4294967296|0,n[s+1]=r/4294967296|0},data:()=>({type:e,length:t,buffers:[null,n]})}}function C7e(e){const t=DT({type:e,nullValues:[null,void 0]});return{set(n,r){t.set(r,n)},data:()=>t.finish().flush()}}function A7e(e,t,n){const r=lf(Int32Array,t+1),i=lf(Uint8Array,3*n);let s=0;return{set(o,a){s+=T7e(i,s,o),r[a+1]=s},data:()=>{const o=b3(s),a=i.length>o?i.subarray(0,o):i;return{type:e,length:t,buffers:[r,a]}}}}function O7e(e,t){const n=[],r=lf(e.indices.ArrayType,t),i=Object.create(null);let s=-1,o=0;return{set(a,u){const l=String(a);let c=i[l];c===void 0&&(o+=l.length,i[l]=c=++s,n.push(l)),r[u]=c},data:()=>({type:e,length:t,buffers:[null,r],dict:P7e(e.dictionary,n,o)})}}function P7e(e,t,n){const r=A7e(e,t.length,n);return t.forEach(r.set),b7e(r.data())}function R7e(e,t){const n=lf(Uint8Array,t/8);let r=0;return{set(i,s){i==null?++r:(e.set(i,s),n[s>>3]|=1<{const i=e.data();return r&&(i.nulls=r,i.buffers[2]=n),i}}}function N7e(e,t,n=!0){let r;switch(e.typeId){case X.Int:r=e.bitWidth<64?kU:null;break;case X.Float:r=e.precision>0?kU:null;break;case X.Dictionary:r=e.dictionary.typeId===X.Utf8&&e.indices.typeId===X.Int&&e.indices.bitWidth<64?O7e:null;break;case X.Bool:r=S7e;break;case X.Date:r=e.unit?x7e:I7e;break}return r==null?C7e(e):n?R7e(r(e,t),t):r(e,t)}function k7e(e,t){const n=e.length,r=b3(n,e.BYTES_PER_ELEMENT);let i=e;return n!==r&&(i=new e.constructor(r),i.set(e)),E3({type:t,length:n,buffers:[null,i]})}function cre(e,t,n,r,i=!0){const s=N7e(r,e,i);return t(n,s.set),E3(s.data())}function T3(e){if(e instanceof Qt||e==null)return e;switch(e){case X.Binary:return new By;case X.Bool:return new jy;case X.DateDay:return new Uje;case X.DateMillisecond:case X.Date:return new Vje;case X.Dictionary:return new of(new lm,new rf);case X.Float16:return new Ute;case X.Float32:return new U$;case X.Float64:case X.Float:return new V$;case X.Int8:return new D$;case X.Int16:return new $$;case X.Int32:case X.Int:return new rf;case X.Int64:return new L$;case X.IntervalDayTime:return new Yje;case X.Interval:case X.IntervalYearMonth:return new Gje;case X.Null:return new Pl;case X.TimeMicrosecond:return new Wje;case X.TimeMillisecond:case X.Time:return new Hje;case X.TimeNanosecond:return new qje;case X.TimeSecond:return new zje;case X.Uint8:return new M$;case X.Uint16:return new F$;case X.Uint32:return new B$;case X.Uint64:return new j$;case X.Utf8:return new lm;default:jt(`Unsupported type code: ${Ou(e)}. Use a data type constructor instead?`)}}function D7e(e){return e.getUTCHours()===0&&e.getUTCMinutes()===0&&e.getUTCSeconds()===0&&e.getUTCMilliseconds()===0}function fre(e,t){const n=cR();return e(t,n.add),n}function cR(){const e={count:0,nulls:0,bools:0,nums:0,ints:0,bigints:0,min:1/0,max:-1/0,digits:0,dates:0,utcdays:0,strings:0,strlen:0,arrays:0,minlen:1/0,maxlen:0,structs:0,add(t){if(++e.count,t==null){++e.nulls;return}const n=typeof t;if(n==="string")++e.strings;else if(n==="number")++e.nums,te.max&&(e.max=t),Number.isInteger(t)&&++e.ints;else if(n==="boolean")++e.bools;else if(n==="object")if(Ol(t))++e.dates,D7e(t)&&++e.utcdays;else if(rd(t)){++e.arrays,t.lengthe.maxlen&&(e.maxlen=t.length);const r=e.array_prof||(e.array_prof=cR());t.forEach(r.add)}else{++e.structs;const r=e.struct_prof||(e.struct_prof={});for(const i in t)(r[i]||(r[i]=cR())).add(t[i])}else n==="bigint"&&(++e.bigints,te.max&&(e.max=t))},type(){return T3($7e(e))}};return e}function $7e(e){const t=e.count-e.nulls;if(t===0)return X.Null;if(e.ints===t){const n=Math.max(Math.abs(e.min)-1,e.max);return e.min<0?n>=2**31?X.Float64:n<128?X.Int8:n<32768?X.Int16:X.Int32:n>=2**32?X.Float64:n<256?X.Uint8:n<65536?X.Uint16:X.Uint32}else{if(e.nums===t)return X.Float64;if(e.bigints===t){const n=-e.min>e.max?-e.min-1n:e.max;return e.min<0?n<2**63?X.Int64:jt(`BigInt exceeds 64 bits: ${n}`):e.max<2**64?X.Uint64:jt(`BigInt exceeds 64 bits: ${e.max}`)}else{if(e.bools===t)return X.Bool;if(e.utcdays===t)return X.DateDay;if(e.dates===t)return X.DateMillisecond;if(e.arrays===t){const n=In.new("value",e.array_prof.type(),!0);return e.minlen===e.maxlen?new hm(e.minlen,n):new dm(n)}else if(e.structs===t){const n=e.struct_prof;return new Yi(Object.keys(n).map(r=>In.new(r,n[r].type(),!0)))}else{if(e.strings>0)return X.Dictionary;jt("Type inference failure")}}}}function L7e(e,t,n,r,i,s=!0){if(i=T3(i),!i){const o=fre(r,t);s=o.nulls>0,i=o.type()}return cre(n,r,t,i,s)}function M7e(e,t,n,r,i,s=!0){i=T3(i);const o=e.column(t),a=!(e.isFiltered()||e.isOrdered()),u=F7e(o);if(u&&a&&DU(u.type,i))return u;const l=o.data;if(W_(l)){const c=B7e(l);if(a&&c&&DU(c,i))return k7e(l,c);i=i||c,s=!1}if(!i){const c=fre(r,o);s=c.nulls>0,i=c.type()}return cre(n,r,o,i,s)}function F7e(e){return e instanceof _n?e:e.vector instanceof _n?e.vector:null}function B7e(e){const n={Float32Array:U$,Float64Array:V$,Int8Array:D$,Int16Array:$$,Int32Array:rf,Uint8Array:M$,Uint16Array:F$,Uint32Array:B$,BigInt64Array:L$,BigUint64Array:j$}[e.constructor.name];return n?new n:null}function DU(e,t){return!e||!t?!0:e.compareTo(t)}function j7e(e,t,n){const r=Math.min(e.length,n+t);return(i,s)=>{for(let o=n;o{let o=-1;r&&rd(i.data)?i.data.forEach(s):e.scan(a=>s(i.get(a),++o),!0,t,n)}}const V7e=()=>jt("Apache Arrow not imported, see https://github.com/uwdata/arquero#usage");function z7e(){try{return Os}catch{V7e()}}function dre(e,t={}){const{types:n={}}=t,{dataFrom:r,names:i,nrows:s,scan:o}=H7e(e,t),a={};i.forEach(l=>{const c=r(e,l,s,o,n[l]);c.length!==s&&jt("Column length mismatch"),a[l]=c});const u=z7e();return new u(a)}function H7e(e,t){const{columns:n,limit:r=1/0,offset:i=0}=t,s=er(n)?n(e):yn(n)?n:null;if(yn(e))return{dataFrom:L7e,names:s||Object.keys(e[0]),nrows:Math.min(r,e.length-i),scan:j7e(e,r,i)};if(W7e(e))return{dataFrom:M7e,names:s||e.columnNames(),nrows:Math.min(r,e.numRows()-i),scan:U7e(e,r,i)};jt("Unsupported input data type")}function W7e(e){return e&&er(e.reify)}function q7e(e,t={}){const{format:n,...r}=t,i=n||"stream";if(!["stream","file"].includes(i))throw Error("Unrecognised output format");return v7e(dre(e,r),n)}function Y7e(e){return e.getUTCHours()===0&&e.getUTCMinutes()===0&&e.getUTCSeconds()===0&&e.getUTCMilliseconds()===0}function G7e(e,t={}){let n=0,r=0,i=0,s=0,o=0,a=0;return e(u=>{if(++n,u==null){++r;return}const l=typeof u;if(l==="object"&&Ol(u))++i,Y7e(u)&&++s;else if(l==="number"&&(++o,u===u&&(u|0)!==u)){const c=u+"",f=c.indexOf(".");if(f>=0){const d=c.indexOf("e"),h=d>0?d:c.length;a=Math.max(a,h-f-1)}}}),{align:(r+o+i)/n>.5?"r":"l",format:{utc:i===s,digits:Math.min(a,t.maxdigits||6)}}}function nx(e,t){return er(t)?t(e):t||e.columnNames()}function hre(e,t,n){const r=n.format||{},i=n.align||{},s={},o={};return t.forEach(a=>{const u=G7e(K7e(e,a),n);o[a]=i[a]||u.align,s[a]=r[a]||u.format}),{align:o,format:s}}function K7e(e,t){const n=e.column(t);return r=>e.scan(i=>r(n.get(i)))}function S3(e,t,n=100,r,i){const s=e.data(),o=t.length;e.scan(a=>{i.row(a);for(let u=0;ul==null?"":Ol(l)?HI(l,!0):s.test(l+="")?'"'+l.replace(/"/g,'""')+'"':l,a=n.map(o);let u="";return S3(e,n,t.limit||1/0,t.offset,{row(){u+=a.join(i)+` -`},cell(l,c,f){a[f]=o(r[c]?r[c](l):l)}}),u+a.join(i)}function mre(e,t={}){if(er(t))return t(e)+"";const n=typeof e;if(n==="object"){if(Ol(e))return t.utc?HI(e):Yee(e);{const r=JSON.stringify(e,(s,o)=>W_(o)?Array.from(o):o),i=t.maxlen||30;return r.length>i?r.slice(0,28)+"…"+(r[0]==="["?"]":"}"):r}}else if(n==="number"){const r=t.digits||0;let i;return e!==0&&((i=Math.abs(e))>=1e18||im==="c"?"center":m==="r"?"right":"left",u=m=>m.replace(/&/g,"&").replace(//g,">"),l=(m,y)=>u(mre(m,y)),c=o?(m,y)=>m==null?o(m):l(m,y):l;let f=-1,d=-1;const h=(m,y,g)=>{const _=g?a(r[y]):"",b=s[m]&&s[m](y,d,f)||"",T=(_?`text-align: ${_};`+(b?" ":""):"")+b;return`<${m}${T?` style="${T}"`:""}>`};let p=h("table")+h("thead")+h("tr",f)+n.map(m=>`${h("th",m,1)}${m}`).join("")+""+h("tbody");return S3(e,n,t.limit,t.offset,{row(m){f=m,p+=(++d?"":"")+h("tr")},cell(m,y){p+=h("td",y,1)+c(m,i[y])+""}}),p+""}function J7e(e){return rx(e.style,t=>er(t)?t:()=>t)}function Z7e(e,t=!0,n=!1){return e===void 0||e?t:n}const eze=e=>Ol(e)?HI(e,!0):e;function tze(e,t={}){const n=Z7e(t.schema),r=t.format||{},i=nx(e,t.columns);let s="{";return n&&(s+='"schema":{"fields":'+JSON.stringify(i.map(o=>({name:o})))+'},"data":{'),i.forEach((o,a)=>{s+=(a?",":"")+JSON.stringify(o)+":[";const u=e.column(o),l=r[o]||eze;let c=-1;e.scan(f=>{const d=u.get(f);s+=(++c?",":"")+JSON.stringify(l(d))},!0,t.limit,t.offset),s+="]"}),s+"}"+(n?"}":"")}function nze(e,t={}){const n=nx(e,t.columns),{align:r,format:i}=pre(e,n,t),s=u=>u==="c"?":-:":u==="r"?"-:":":-",o=u=>u.replace(/\|/g,"\\|");let a="|"+n.map(o).join("|")+`| +`},cell(l,c,f){a[f]=o(r[c]?r[c](l):l)}}),u+a.join(i)}function pre(e,t={}){if(er(t))return t(e)+"";const n=typeof e;if(n==="object"){if(Ol(e))return t.utc?HI(e):qee(e);{const r=JSON.stringify(e,(s,o)=>W_(o)?Array.from(o):o),i=t.maxlen||30;return r.length>i?r.slice(0,28)+"…"+(r[0]==="["?"]":"}"):r}}else if(n==="number"){const r=t.digits||0;let i;return e!==0&&((i=Math.abs(e))>=1e18||im==="c"?"center":m==="r"?"right":"left",u=m=>m.replace(/&/g,"&").replace(//g,">"),l=(m,y)=>u(pre(m,y)),c=o?(m,y)=>m==null?o(m):l(m,y):l;let f=-1,d=-1;const h=(m,y,g)=>{const _=g?a(r[y]):"",b=s[m]&&s[m](y,d,f)||"",T=(_?`text-align: ${_};`+(b?" ":""):"")+b;return`<${m}${T?` style="${T}"`:""}>`};let p=h("table")+h("thead")+h("tr",f)+n.map(m=>`${h("th",m,1)}${m}`).join("")+""+h("tbody");return S3(e,n,t.limit,t.offset,{row(m){f=m,p+=(++d?"":"")+h("tr")},cell(m,y){p+=h("td",y,1)+c(m,i[y])+""}}),p+""}function J7e(e){return rx(e.style,t=>er(t)?t:()=>t)}function Z7e(e,t=!0,n=!1){return e===void 0||e?t:n}const eze=e=>Ol(e)?HI(e,!0):e;function tze(e,t={}){const n=Z7e(t.schema),r=t.format||{},i=nx(e,t.columns);let s="{";return n&&(s+='"schema":{"fields":'+JSON.stringify(i.map(o=>({name:o})))+'},"data":{'),i.forEach((o,a)=>{s+=(a?",":"")+JSON.stringify(o)+":[";const u=e.column(o),l=r[o]||eze;let c=-1;e.scan(f=>{const d=u.get(f);s+=(++c?",":"")+JSON.stringify(l(d))},!0,t.limit,t.offset),s+="]"}),s+"}"+(n?"}":"")}function nze(e,t={}){const n=nx(e,t.columns),{align:r,format:i}=hre(e,n,t),s=u=>u==="c"?":-:":u==="r"?"-:":":-",o=u=>u.replace(/\|/g,"\\|");let a="|"+n.map(o).join("|")+`| |`+n.map(u=>s(r[u])).join("|")+"|";return S3(e,n,t.limit,t.offset,{row(){a+=` -|`},cell(u,l){a+=o(mre(u,i[l]))+"|"}}),a+` -`}function gre(e,t){for(const[n,r]of WI(t))e.set(n,r);return e}function rze(e){return e.replace(/[.*+\-?^${}()|[\]\\]/g,"\\$&")}function Nl(e,t,n=new Map){return t=cs(t)?e.columnName(t):t,Li(t)?n.set(t,t):yn(t)?t.forEach(r=>Nl(e,r,n)):er(t)?Nl(e,t(e),n):Xi(t)?gre(n,t):jt(`Invalid column selection: ${Ou(t)}`),n}function ix(e,t){return e.toObject=t,e}function yre(e){return yn(e)?e.map(yre):e&&e.toObject?e.toObject():e}function ym(){return ix(e=>e.columnNames(),()=>({all:[]}))}function _re(...e){return e=e.flat(),ix(t=>{const n=Nl(t,e);return t.columnNames(r=>!n.has(r))},()=>({not:yre(e)}))}function ize(e,t){return ix(n=>{let r=cs(e)?e:n.columnIndex(e),i=cs(t)?t:n.columnIndex(t);if(i({range:[e,t]}))}function sze(e){return Li(e)&&(e=RegExp(rze(e))),ix(t=>t.columnNames(n=>e.test(n)),()=>({matches:[e.source,e.flags]}))}function oze(e){return W_(e.data)?e.data.constructor:Array}class tl extends IBe{static from(t,n){return new tl(ABe(t,n),n)}static new(t,n){if(t instanceof tl)return t;const r={},i=[];for(const[s,o]of WI(t))r[s]=o,i.push(s);return new tl(r,n||i)}constructor(t,n,r,i,s,o){rx(t,CBe,t),n=n||Object.keys(t);const a=n.length?t[n[0]].length:0;super(n,a,t,r,i,s,o)}create({data:t,names:n,filter:r,groups:i,order:s}){const o=r!==void 0?r:this.mask();return new tl(t||this._data,n||(t?null:this._names),o,i!==void 0?i:rje(this._group,r&&o),s!==void 0?s:this._order,this._params)}assign(...t){const n=this.numRows(),r=this.reify(),i=So(r).groupby(r.groups());return t.forEach(s=>{s=tl.new(s),s.numRows()!==n&&jt("Assign row counts do not match"),s=s.reify(),s.columnNames(o=>i.add(o,s.column(o)))}),this.create(i.new())}columns(){return this._data}column(t){return this._data[t]}columnAt(t){return this._data[this._names[t]]}array(t,n=Array){const r=this.column(t),i=new n(this.numRows());let s=-1;return this.scan(o=>i[++s]=r.get(o),!0),i}get(t,n=0){const r=this.column(t);return this.isFiltered()||this.isOrdered()?r.get(this.indices()[n]):r.get(n)}getter(t){const n=this.column(t),r=this.isFiltered()||this.isOrdered()?this.indices():null;return r?i=>n.get(r[i]):n?i=>n.get(i):jt(`Unrecognized column: ${t}`)}object(t=0){return $U(this)(t)}objects(t={}){const{grouped:n,limit:r,offset:i}=t,s=Nl(this,t.columns||ym()),o=_te(s),a=[];if(this.scan((u,l)=>a.push(o(u,l)),!0,r,i),n&&this.isGrouped()){const u=[];return this.scan(l=>u.push(l),!0,r,i),sje(this,u,a,n)}return a}*[Symbol.iterator](){const t=$U(this),n=this.numRows();for(let r=0;rt.forEach(u):u=>this.scan(u,!0),a=r.length;i={};for(let u=0;uf[++d]=c.get(h))}this.isGrouped()&&(s=ije(this.groups(),o,!!t,n))}return this.create({data:i,names:r,groups:s,filter:null,order:null})}transform(...t){return t.flat().reduce((n,r)=>r(n),this)}toArrow(t){return hre(this,t)}toArrowBuffer(t){return q7e(this,t)}toCSV(t){return Q7e(this,t)}toHTML(t){return X7e(this,t)}toJSON(t){return tze(this,t)}toMarkdown(t){return nze(this,t)}}function $U(e){let t=e._builder;if(!t){const n=_te(e.columnNames()),r=e.data();if(e.isOrdered()||e.isFiltered()){const i=e.indices();t=s=>n(i[s],r)}else t=i=>n(i,r);e._builder=t}return t}class aze{constructor(t){this._outputs=t}size(){return this._outputs.length}outputs(){return this._outputs}init(){return{}}add(){}rem(){}write(){}}function cn(e,t,n,r){const i=n[e.type]||n.Default;if(i&&i(e,t,r)===!1)return;const s=uze[e.type];s&&s(e,t,n)}const E1=(e,t,n)=>{cn(e.argument,t,n,e)},nO=(e,t,n)=>{cn(e.left,t,n,e),cn(e.right,t,n,e)},LU=(e,t,n)=>{cn(e.test,t,n,e),cn(e.consequent,t,n,e),e.alternate&&cn(e.alternate,t,n,e)},rO=(e,t,n)=>{Ya(e.params,t,n,e),cn(e.body,t,n,e)},MU=(e,t,n)=>{cn(e.callee,t,n,e),Ya(e.arguments,t,n,e)},Ya=(e,t,n,r)=>{e.forEach(i=>cn(i,t,n,r))},uze={TemplateLiteral:(e,t,n)=>{Ya(e.expressions,t,n,e),Ya(e.quasis,t,n,e)},MemberExpression:(e,t,n)=>{cn(e.object,t,n,e),cn(e.property,t,n,e)},CallExpression:MU,NewExpression:MU,ArrayExpression:(e,t,n)=>{Ya(e.elements,t,n,e)},AssignmentExpression:nO,AwaitExpression:E1,BinaryExpression:nO,LogicalExpression:nO,UnaryExpression:E1,UpdateExpression:E1,ConditionalExpression:LU,ObjectExpression:(e,t,n)=>{Ya(e.properties,t,n,e)},Property:(e,t,n)=>{cn(e.key,t,n,e),cn(e.value,t,n,e)},ArrowFunctionExpression:rO,FunctionExpression:rO,FunctionDeclaration:rO,VariableDeclaration:(e,t,n)=>{Ya(e.declarations,t,n,e)},VariableDeclarator:(e,t,n)=>{cn(e.id,t,n,e),cn(e.init,t,n,e)},SpreadElement:(e,t,n)=>{cn(e.argument,t,n,e)},BlockStatement:(e,t,n)=>{Ya(e.body,t,n,e)},ExpressionStatement:(e,t,n)=>{cn(e.expression,t,n,e)},IfStatement:LU,ForStatement:(e,t,n)=>{cn(e.init,t,n,e),cn(e.test,t,n,e),cn(e.update,t,n,e),cn(e.body,t,n,e)},WhileStatement:(e,t,n)=>{cn(e.test,t,n,e),cn(e.body,t,n,e)},DoWhileStatement:(e,t,n)=>{cn(e.body,t,n,e),cn(e.test,t,n,e)},SwitchStatement:(e,t,n)=>{cn(e.discriminant,t,n,e),Ya(e.cases,t,n,e)},SwitchCase:(e,t,n)=>{e.test&&cn(e.test,t,n,e),Ya(e.consequent,t,n,e)},ReturnStatement:E1,Program:(e,t,n)=>{cn(e.body[0],t,n,e)}};function vre(e){delete e.start,delete e.end,delete e.optional}function FU(e){vre(e),delete e.object,delete e.property,delete e.computed,e.table||delete e.table}function lze(e){return cn(e,null,{Column:FU,Constant:FU,Default:vre}),e}function Kr(e,t){return t&&t.type===e}function cze(e){return Kr(uje,e)||Kr(aje,e)}function fze(e){return er(e)?e:()=>e}const dze="Escaped functions are not valid as rollup or pivot values.";function hze(e,t,n){e.aggronly&&jt(dze);const r="(row,data)=>fn("+yte(e.table.columnNames())+",$)";return{escape:C$.escape(r,fze(t.expr),n)}}var pze=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,983,6,110,6,6,9,4759,9,787719,239],bre=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,757,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],mze="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࢘-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・",Ere="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꟊꟐꟑꟓꟕ-ꟙꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",iO={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},sO="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",gze={5:sO,"5module":sO+" export import",6:sO+" const class extends export import super"},yze=/^in(stanceof)?$/,_ze=new RegExp("["+Ere+"]"),vze=new RegExp("["+Ere+mze+"]");function fR(e,t){for(var n=65536,r=0;re)return!1;if(n+=t[r+1],n>=e)return!0}return!1}function kl(e,t){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&_ze.test(String.fromCharCode(e)):t===!1?!1:fR(e,bre)}function _m(e,t){return e<48?e===36:e<58?!0:e<65?!1:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&vze.test(String.fromCharCode(e)):t===!1?!1:fR(e,bre)||fR(e,pze)}var fn=function(t,n){n===void 0&&(n={}),this.label=t,this.keyword=n.keyword,this.beforeExpr=!!n.beforeExpr,this.startsExpr=!!n.startsExpr,this.isLoop=!!n.isLoop,this.isAssign=!!n.isAssign,this.prefix=!!n.prefix,this.postfix=!!n.postfix,this.binop=n.binop||null,this.updateContext=null};function xo(e,t){return new fn(e,{beforeExpr:!0,binop:t})}var Co={beforeExpr:!0},vs={startsExpr:!0},I3={};function tn(e,t){return t===void 0&&(t={}),t.keyword=e,I3[e]=new fn(e,t)}var D={num:new fn("num",vs),regexp:new fn("regexp",vs),string:new fn("string",vs),name:new fn("name",vs),privateId:new fn("privateId",vs),eof:new fn("eof"),bracketL:new fn("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new fn("]"),braceL:new fn("{",{beforeExpr:!0,startsExpr:!0}),braceR:new fn("}"),parenL:new fn("(",{beforeExpr:!0,startsExpr:!0}),parenR:new fn(")"),comma:new fn(",",Co),semi:new fn(";",Co),colon:new fn(":",Co),dot:new fn("."),question:new fn("?",Co),questionDot:new fn("?."),arrow:new fn("=>",Co),template:new fn("template"),invalidTemplate:new fn("invalidTemplate"),ellipsis:new fn("...",Co),backQuote:new fn("`",vs),dollarBraceL:new fn("${",{beforeExpr:!0,startsExpr:!0}),eq:new fn("=",{beforeExpr:!0,isAssign:!0}),assign:new fn("_=",{beforeExpr:!0,isAssign:!0}),incDec:new fn("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new fn("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:xo("||",1),logicalAND:xo("&&",2),bitwiseOR:xo("|",3),bitwiseXOR:xo("^",4),bitwiseAND:xo("&",5),equality:xo("==/!=/===/!==",6),relational:xo("/<=/>=",7),bitShift:xo("<>/>>>",8),plusMin:new fn("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:xo("%",10),star:xo("*",10),slash:xo("/",10),starstar:new fn("**",{beforeExpr:!0}),coalesce:xo("??",1),_break:tn("break"),_case:tn("case",Co),_catch:tn("catch"),_continue:tn("continue"),_debugger:tn("debugger"),_default:tn("default",Co),_do:tn("do",{isLoop:!0,beforeExpr:!0}),_else:tn("else",Co),_finally:tn("finally"),_for:tn("for",{isLoop:!0}),_function:tn("function",vs),_if:tn("if"),_return:tn("return",Co),_switch:tn("switch"),_throw:tn("throw",Co),_try:tn("try"),_var:tn("var"),_const:tn("const"),_while:tn("while",{isLoop:!0}),_with:tn("with"),_new:tn("new",{beforeExpr:!0,startsExpr:!0}),_this:tn("this",vs),_super:tn("super",vs),_class:tn("class",vs),_extends:tn("extends",Co),_export:tn("export"),_import:tn("import",vs),_null:tn("null",vs),_true:tn("true",vs),_false:tn("false",vs),_in:tn("in",{beforeExpr:!0,binop:7}),_instanceof:tn("instanceof",{beforeExpr:!0,binop:7}),_typeof:tn("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:tn("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:tn("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},ra=/\r\n?|\n|\u2028|\u2029/,bze=new RegExp(ra.source,"g");function Jm(e){return e===10||e===13||e===8232||e===8233}function wre(e,t,n){n===void 0&&(n=e.length);for(var r=t;r>10)+55296,(e&1023)+56320))}var Tze=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,zy=function(t,n){this.line=t,this.column=n};zy.prototype.offset=function(t){return new zy(this.line,this.column+t)};var sx=function(t,n,r){this.start=n,this.end=r,t.sourceFile!==null&&(this.source=t.sourceFile)};function Ire(e,t){for(var n=1,r=0;;){var i=wre(e,r,t);if(i<0)return new zy(n,t-r);++n,r=i}}var dR={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},UU=!1;function Sze(e){var t={};for(var n in dR)t[n]=e&&X_(e,n)?e[n]:dR[n];if(t.ecmaVersion==="latest"?t.ecmaVersion=1e8:t.ecmaVersion==null?(!UU&&typeof console=="object"&&console.warn&&(UU=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required. -Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),t.allowReserved==null&&(t.allowReserved=t.ecmaVersion<5),(!e||e.allowHashBang==null)&&(t.allowHashBang=t.ecmaVersion>=14),BU(t.onToken)){var r=t.onToken;t.onToken=function(i){return r.push(i)}}return BU(t.onComment)&&(t.onComment=Ize(t,t.onComment)),t}function Ize(e,t){return function(n,r,i,s,o,a){var u={type:n?"Block":"Line",value:r,start:i,end:s};e.locations&&(u.loc=new sx(this,o,a)),e.ranges&&(u.range=[i,s]),t.push(u)}}var Hy=1,Zm=2,x3=4,xre=8,Cre=16,Are=32,C3=64,Ore=128,J_=256,A3=Hy|Zm|J_;function O3(e,t){return Zm|(e?x3:0)|(t?xre:0)}var FT=0,P3=1,Kl=2,Pre=3,Rre=4,Nre=5,ti=function(t,n,r){this.options=t=Sze(t),this.sourceFile=t.sourceFile,this.keywords=xc(gze[t.ecmaVersion>=6?6:t.sourceType==="module"?"5module":5]);var i="";t.allowReserved!==!0&&(i=iO[t.ecmaVersion>=6?6:t.ecmaVersion===5?5:3],t.sourceType==="module"&&(i+=" await")),this.reservedWords=xc(i);var s=(i?i+" ":"")+iO.strict;this.reservedWordsStrict=xc(s),this.reservedWordsStrictBind=xc(s+" "+iO.strictBind),this.input=String(n),this.containsEsc=!1,r?(this.pos=r,this.lineStart=this.input.lastIndexOf(` -`,r-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(ra).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=D.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=t.sourceType==="module",this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&t.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(Hy),this.regexpState=null,this.privateNameStack=[]},Vu={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};ti.prototype.parse=function(){var t=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(t)};Vu.inFunction.get=function(){return(this.currentVarScope().flags&Zm)>0};Vu.inGenerator.get=function(){return(this.currentVarScope().flags&xre)>0&&!this.currentVarScope().inClassFieldInit};Vu.inAsync.get=function(){return(this.currentVarScope().flags&x3)>0&&!this.currentVarScope().inClassFieldInit};Vu.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e];if(t.inClassFieldInit||t.flags&J_)return!1;if(t.flags&Zm)return(t.flags&x3)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};Vu.allowSuper.get=function(){var e=this.currentThisScope(),t=e.flags,n=e.inClassFieldInit;return(t&C3)>0||n||this.options.allowSuperOutsideMethod};Vu.allowDirectSuper.get=function(){return(this.currentThisScope().flags&Ore)>0};Vu.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};Vu.allowNewDotTarget.get=function(){var e=this.currentThisScope(),t=e.flags,n=e.inClassFieldInit;return(t&(Zm|J_))>0||n};Vu.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&J_)>0};ti.extend=function(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];for(var r=this,i=0;i=,?^&]/.test(i)||i==="!"&&this.input.charAt(r+1)==="=")}e+=t[0].length,Lo.lastIndex=e,e+=Lo.exec(this.input)[0].length,this.input[e]===";"&&e++}};ps.eat=function(e){return this.type===e?(this.next(),!0):!1};ps.isContextual=function(e){return this.type===D.name&&this.value===e&&!this.containsEsc};ps.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1};ps.expectContextual=function(e){this.eatContextual(e)||this.unexpected()};ps.canInsertSemicolon=function(){return this.type===D.eof||this.type===D.braceR||ra.test(this.input.slice(this.lastTokEnd,this.start))};ps.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0};ps.semicolon=function(){!this.eat(D.semi)&&!this.insertSemicolon()&&this.unexpected()};ps.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0};ps.expect=function(e){this.eat(e)||this.unexpected()};ps.unexpected=function(e){this.raise(e??this.start,"Unexpected token")};var ox=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};ps.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var n=t?e.parenthesizedAssign:e.parenthesizedBind;n>-1&&this.raiseRecoverable(n,t?"Assigning to rvalue":"Parenthesized pattern")}};ps.checkExpressionErrors=function(e,t){if(!e)return!1;var n=e.shorthandAssign,r=e.doubleProto;if(!t)return n>=0||r>=0;n>=0&&this.raise(n,"Shorthand property assignments are valid only in destructuring patterns"),r>=0&&this.raiseRecoverable(r,"Redefinition of __proto__ property")};ps.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos55295&&r<56320)return!0;if(kl(r,!0)){for(var i=n+1;_m(r=this.input.charCodeAt(i),!0);)++i;if(r===92||r>55295&&r<56320)return!0;var s=this.input.slice(n,i);if(!yze.test(s))return!0}return!1};nt.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;Lo.lastIndex=this.pos;var e=Lo.exec(this.input),t=this.pos+e[0].length,n;return!ra.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)==="function"&&(t+8===this.input.length||!(_m(n=this.input.charCodeAt(t+8))||n>55295&&n<56320))};nt.parseStatement=function(e,t,n){var r=this.type,i=this.startNode(),s;switch(this.isLet(e)&&(r=D._var,s="let"),r){case D._break:case D._continue:return this.parseBreakContinueStatement(i,r.keyword);case D._debugger:return this.parseDebuggerStatement(i);case D._do:return this.parseDoStatement(i);case D._for:return this.parseForStatement(i);case D._function:return e&&(this.strict||e!=="if"&&e!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(i,!1,!e);case D._class:return e&&this.unexpected(),this.parseClass(i,!0);case D._if:return this.parseIfStatement(i);case D._return:return this.parseReturnStatement(i);case D._switch:return this.parseSwitchStatement(i);case D._throw:return this.parseThrowStatement(i);case D._try:return this.parseTryStatement(i);case D._const:case D._var:return s=s||this.value,e&&s!=="var"&&this.unexpected(),this.parseVarStatement(i,s);case D._while:return this.parseWhileStatement(i);case D._with:return this.parseWithStatement(i);case D.braceL:return this.parseBlock(!0,i);case D.semi:return this.parseEmptyStatement(i);case D._export:case D._import:if(this.options.ecmaVersion>10&&r===D._import){Lo.lastIndex=this.pos;var o=Lo.exec(this.input),a=this.pos+o[0].length,u=this.input.charCodeAt(a);if(u===40||u===46)return this.parseExpressionStatement(i,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),r===D._import?this.parseImport(i):this.parseExport(i,n);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(i,!0,!e);var l=this.value,c=this.parseExpression();return r===D.name&&c.type==="Identifier"&&this.eat(D.colon)?this.parseLabeledStatement(i,l,c,e):this.parseExpressionStatement(i,c)}};nt.parseBreakContinueStatement=function(e,t){var n=t==="break";this.next(),this.eat(D.semi)||this.insertSemicolon()?e.label=null:this.type!==D.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var r=0;r=6?this.eat(D.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")};nt.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(R3),this.enterScope(0),this.expect(D.parenL),this.type===D.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var n=this.isLet();if(this.type===D._var||this.type===D._const||n){var r=this.startNode(),i=n?"let":this.value;return this.next(),this.parseVar(r,!0,i),this.finishNode(r,"VariableDeclaration"),(this.type===D._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&r.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===D._in?t>-1&&this.unexpected(t):e.await=t>-1),this.parseForIn(e,r)):(t>-1&&this.unexpected(t),this.parseFor(e,r))}var s=this.isContextual("let"),o=!1,a=new ox,u=this.parseExpression(t>-1?"await":!0,a);return this.type===D._in||(o=this.options.ecmaVersion>=6&&this.isContextual("of"))?(this.options.ecmaVersion>=9&&(this.type===D._in?t>-1&&this.unexpected(t):e.await=t>-1),s&&o&&this.raise(u.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(u,!1,a),this.checkLValPattern(u),this.parseForIn(e,u)):(this.checkExpressionErrors(a,!0),t>-1&&this.unexpected(t),this.parseFor(e,u))};nt.parseFunctionStatement=function(e,t,n){return this.next(),this.parseFunction(e,G0|(n?0:hR),!1,t)};nt.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(D._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")};nt.parseReturnStatement=function(e){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,"'return' outside of function"),this.next(),this.eat(D.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")};nt.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(D.braceL),this.labels.push(Cze),this.enterScope(0);for(var t,n=!1;this.type!==D.braceR;)if(this.type===D._case||this.type===D._default){var r=this.type===D._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),r?t.test=this.parseExpression():(n&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),n=!0,t.test=null),this.expect(D.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")};nt.parseThrowStatement=function(e){return this.next(),ra.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var Aze=[];nt.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),t=e.type==="Identifier";return this.enterScope(t?Are:0),this.checkLValPattern(e,t?Rre:Kl),this.expect(D.parenR),e};nt.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===D._catch){var t=this.startNode();this.next(),this.eat(D.parenL)?t.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0)),t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,"CatchClause")}return e.finalizer=this.eat(D._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")};nt.parseVarStatement=function(e,t,n){return this.next(),this.parseVar(e,!1,t,n),this.semicolon(),this.finishNode(e,"VariableDeclaration")};nt.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(R3),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")};nt.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")};nt.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")};nt.parseLabeledStatement=function(e,t,n,r){for(var i=0,s=this.labels;i=0;u--){var l=this.labels[u];if(l.statementStart===e.start)l.statementStart=this.start,l.kind=a;else break}return this.labels.push({name:t,kind:a,statementStart:this.start}),e.body=this.parseStatement(r?r.indexOf("label")===-1?r+"label":r:"label"),this.labels.pop(),e.label=n,this.finishNode(e,"LabeledStatement")};nt.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")};nt.parseBlock=function(e,t,n){for(e===void 0&&(e=!0),t===void 0&&(t=this.startNode()),t.body=[],this.expect(D.braceL),e&&this.enterScope(0);this.type!==D.braceR;){var r=this.parseStatement(null);t.body.push(r)}return n&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,"BlockStatement")};nt.parseFor=function(e,t){return e.init=t,this.expect(D.semi),e.test=this.type===D.semi?null:this.parseExpression(),this.expect(D.semi),e.update=this.type===D.parenR?null:this.parseExpression(),this.expect(D.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")};nt.parseForIn=function(e,t){var n=this.type===D._in;return this.next(),t.type==="VariableDeclaration"&&t.declarations[0].init!=null&&(!n||this.options.ecmaVersion<8||this.strict||t.kind!=="var"||t.declarations[0].id.type!=="Identifier")&&this.raise(t.start,(n?"for-in":"for-of")+" loop variable declaration may not have an initializer"),e.left=t,e.right=n?this.parseExpression():this.parseMaybeAssign(),this.expect(D.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,n?"ForInStatement":"ForOfStatement")};nt.parseVar=function(e,t,n,r){for(e.declarations=[],e.kind=n;;){var i=this.startNode();if(this.parseVarId(i,n),this.eat(D.eq)?i.init=this.parseMaybeAssign(t):!r&&n==="const"&&!(this.type===D._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():!r&&i.id.type!=="Identifier"&&!(t&&(this.type===D._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):i.init=null,e.declarations.push(this.finishNode(i,"VariableDeclarator")),!this.eat(D.comma))break}return e};nt.parseVarId=function(e,t){e.id=this.parseBindingAtom(),this.checkLValPattern(e.id,t==="var"?P3:Kl,!1)};var G0=1,hR=2,kre=4;nt.parseFunction=function(e,t,n,r,i){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!r)&&(this.type===D.star&&t&hR&&this.unexpected(),e.generator=this.eat(D.star)),this.options.ecmaVersion>=8&&(e.async=!!r),t&G0&&(e.id=t&kre&&this.type!==D.name?null:this.parseIdent(),e.id&&!(t&hR)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?P3:Kl:Pre));var s=this.yieldPos,o=this.awaitPos,a=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(O3(e.async,e.generator)),t&G0||(e.id=this.type===D.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,n,!1,i),this.yieldPos=s,this.awaitPos=o,this.awaitIdentPos=a,this.finishNode(e,t&G0?"FunctionDeclaration":"FunctionExpression")};nt.parseFunctionParams=function(e){this.expect(D.parenL),e.params=this.parseBindingList(D.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};nt.parseClass=function(e,t){this.next();var n=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var r=this.enterClassBody(),i=this.startNode(),s=!1;for(i.body=[],this.expect(D.braceL);this.type!==D.braceR;){var o=this.parseClassElement(e.superClass!==null);o&&(i.body.push(o),o.type==="MethodDefinition"&&o.kind==="constructor"?(s&&this.raiseRecoverable(o.start,"Duplicate constructor in the same class"),s=!0):o.key&&o.key.type==="PrivateIdentifier"&&Oze(r,o)&&this.raiseRecoverable(o.key.start,"Identifier '#"+o.key.name+"' has already been declared"))}return this.strict=n,this.next(),e.body=this.finishNode(i,"ClassBody"),this.exitClassBody(),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")};nt.parseClassElement=function(e){if(this.eat(D.semi))return null;var t=this.options.ecmaVersion,n=this.startNode(),r="",i=!1,s=!1,o="method",a=!1;if(this.eatContextual("static")){if(t>=13&&this.eat(D.braceL))return this.parseClassStaticBlock(n),n;this.isClassElementNameStart()||this.type===D.star?a=!0:r="static"}if(n.static=a,!r&&t>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===D.star)&&!this.canInsertSemicolon()?s=!0:r="async"),!r&&(t>=9||!s)&&this.eat(D.star)&&(i=!0),!r&&!s&&!i){var u=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?o=u:r=u)}if(r?(n.computed=!1,n.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),n.key.name=r,this.finishNode(n.key,"Identifier")):this.parseClassElementName(n),t<13||this.type===D.parenL||o!=="method"||i||s){var l=!n.static&&BT(n,"constructor"),c=l&&e;l&&o!=="method"&&this.raise(n.key.start,"Constructor can't have get/set modifier"),n.kind=l?"constructor":o,this.parseClassMethod(n,i,s,c)}else this.parseClassField(n);return n};nt.isClassElementNameStart=function(){return this.type===D.name||this.type===D.privateId||this.type===D.num||this.type===D.string||this.type===D.bracketL||this.type.keyword};nt.parseClassElementName=function(e){this.type===D.privateId?(this.value==="constructor"&&this.raise(this.start,"Classes can't have an element named '#constructor'"),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)};nt.parseClassMethod=function(e,t,n,r){var i=e.key;e.kind==="constructor"?(t&&this.raise(i.start,"Constructor can't be a generator"),n&&this.raise(i.start,"Constructor can't be an async method")):e.static&&BT(e,"prototype")&&this.raise(i.start,"Classes may not have a static property named prototype");var s=e.value=this.parseMethod(t,n,r);return e.kind==="get"&&s.params.length!==0&&this.raiseRecoverable(s.start,"getter should have no params"),e.kind==="set"&&s.params.length!==1&&this.raiseRecoverable(s.start,"setter should have exactly one param"),e.kind==="set"&&s.params[0].type==="RestElement"&&this.raiseRecoverable(s.params[0].start,"Setter cannot use rest params"),this.finishNode(e,"MethodDefinition")};nt.parseClassField=function(e){if(BT(e,"constructor")?this.raise(e.key.start,"Classes can't have a field named 'constructor'"):e.static&&BT(e,"prototype")&&this.raise(e.key.start,"Classes can't have a static field named 'prototype'"),this.eat(D.eq)){var t=this.currentThisScope(),n=t.inClassFieldInit;t.inClassFieldInit=!0,e.value=this.parseMaybeAssign(),t.inClassFieldInit=n}else e.value=null;return this.semicolon(),this.finishNode(e,"PropertyDefinition")};nt.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(J_|C3);this.type!==D.braceR;){var n=this.parseStatement(null);e.body.push(n)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,"StaticBlock")};nt.parseClassId=function(e,t){this.type===D.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,Kl,!1)):(t===!0&&this.unexpected(),e.id=null)};nt.parseClassSuper=function(e){e.superClass=this.eat(D._extends)?this.parseExprSubscripts(null,!1):null};nt.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared};nt.exitClassBody=function(){var e=this.privateNameStack.pop(),t=e.declared,n=e.used;if(this.options.checkPrivateFields)for(var r=this.privateNameStack.length,i=r===0?null:this.privateNameStack[r-1],s=0;s=11&&(this.eatContextual("as")?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==D.string&&this.unexpected(),e.source=this.parseExprAtom(),this.semicolon(),this.finishNode(e,"ExportAllDeclaration")};nt.parseExport=function(e,t){if(this.next(),this.eat(D.star))return this.parseExportAllDeclaration(e,t);if(this.eat(D._default))return this.checkExport(t,"default",this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),e.declaration.type==="VariableDeclaration"?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null;else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))this.type!==D.string&&this.unexpected(),e.source=this.parseExprAtom();else{for(var n=0,r=e.specifiers;n=13&&this.type===D.string){var e=this.parseLiteral(this.value);return Tze.test(e.value)&&this.raise(e.start,"An export name cannot include a lone surrogate."),e}return this.parseIdent(!0)};nt.adaptDirectivePrologue=function(e){for(var t=0;t=5&&e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value=="string"&&(this.input[e.start]==='"'||this.input[e.start]==="'")};var ia=ti.prototype;ia.toAssignable=function(e,t,n){if(this.options.ecmaVersion>=6&&e)switch(e.type){case"Identifier":this.inAsync&&e.name==="await"&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern",n&&this.checkPatternErrors(n,!0);for(var r=0,i=e.properties;r=8&&!a&&u.name==="async"&&!this.canInsertSemicolon()&&this.eat(D._function))return this.overrideContext(lr.f_expr),this.parseFunction(this.startNodeAt(s,o),0,!1,!0,t);if(i&&!this.canInsertSemicolon()){if(this.eat(D.arrow))return this.parseArrowExpression(this.startNodeAt(s,o),[u],!1,t);if(this.options.ecmaVersion>=8&&u.name==="async"&&this.type===D.name&&!a&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return u=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(D.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(s,o),[u],!0,t)}return u;case D.regexp:var l=this.value;return r=this.parseLiteral(l.value),r.regex={pattern:l.pattern,flags:l.flags},r;case D.num:case D.string:return this.parseLiteral(this.value);case D._null:case D._true:case D._false:return r=this.startNode(),r.value=this.type===D._null?null:this.type===D._true,r.raw=this.type.keyword,this.next(),this.finishNode(r,"Literal");case D.parenL:var c=this.start,f=this.parseParenAndDistinguishExpression(i,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(f)&&(e.parenthesizedAssign=c),e.parenthesizedBind<0&&(e.parenthesizedBind=c)),f;case D.bracketL:return r=this.startNode(),this.next(),r.elements=this.parseExprList(D.bracketR,!0,!0,e),this.finishNode(r,"ArrayExpression");case D.braceL:return this.overrideContext(lr.b_expr),this.parseObj(!1,e);case D._function:return r=this.startNode(),this.next(),this.parseFunction(r,0);case D._class:return this.parseClass(this.startNode(),!1);case D._new:return this.parseNew();case D.backQuote:return this.parseTemplate();case D._import:return this.options.ecmaVersion>=11?this.parseExprImport(n):this.unexpected();default:return this.parseExprAtomDefault()}};vt.parseExprAtomDefault=function(){this.unexpected()};vt.parseExprImport=function(e){var t=this.startNode();this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import");var n=this.parseIdent(!0);if(this.type===D.parenL&&!e)return this.parseDynamicImport(t);if(this.type===D.dot)return t.meta=n,this.parseImportMeta(t);this.unexpected()};vt.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),!this.eat(D.parenR)){var t=this.start;this.eat(D.comma)&&this.eat(D.parenR)?this.raiseRecoverable(t,"Trailing comma is not allowed in import()"):this.unexpected(t)}return this.finishNode(e,"ImportExpression")};vt.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="meta"&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),t&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")};vt.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),t.raw.charCodeAt(t.raw.length-1)===110&&(t.bigint=t.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(t,"Literal")};vt.parseParenExpression=function(){this.expect(D.parenL);var e=this.parseExpression();return this.expect(D.parenR),e};vt.shouldParseArrow=function(e){return!this.canInsertSemicolon()};vt.parseParenAndDistinguishExpression=function(e,t){var n=this.start,r=this.startLoc,i,s=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var o=this.start,a=this.startLoc,u=[],l=!0,c=!1,f=new ox,d=this.yieldPos,h=this.awaitPos,p;for(this.yieldPos=0,this.awaitPos=0;this.type!==D.parenR;)if(l?l=!1:this.expect(D.comma),s&&this.afterTrailingComma(D.parenR,!0)){c=!0;break}else if(this.type===D.ellipsis){p=this.start,u.push(this.parseParenItem(this.parseRestBinding())),this.type===D.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else u.push(this.parseMaybeAssign(!1,f,this.parseParenItem));var m=this.lastTokEnd,y=this.lastTokEndLoc;if(this.expect(D.parenR),e&&this.shouldParseArrow(u)&&this.eat(D.arrow))return this.checkPatternErrors(f,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=d,this.awaitPos=h,this.parseParenArrowList(n,r,u,t);(!u.length||c)&&this.unexpected(this.lastTokStart),p&&this.unexpected(p),this.checkExpressionErrors(f,!0),this.yieldPos=d||this.yieldPos,this.awaitPos=h||this.awaitPos,u.length>1?(i=this.startNodeAt(o,a),i.expressions=u,this.finishNodeAt(i,"SequenceExpression",m,y)):i=u[0]}else i=this.parseParenExpression();if(this.options.preserveParens){var g=this.startNodeAt(n,r);return g.expression=i,this.finishNode(g,"ParenthesizedExpression")}else return i};vt.parseParenItem=function(e){return e};vt.parseParenArrowList=function(e,t,n,r){return this.parseArrowExpression(this.startNodeAt(e,t),n,!1,r)};var Pze=[];vt.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===D.dot){var t=this.startNodeAt(e.start,e.startLoc);t.name="new",e.meta=this.finishNode(t,"Identifier"),this.next();var n=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="target"&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),n&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(e.start,"'new.target' can only be used in functions and class static block"),this.finishNode(e,"MetaProperty")}var r=this.start,i=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),r,i,!0,!1),this.eat(D.parenL)?e.arguments=this.parseExprList(D.parenR,this.options.ecmaVersion>=8,!1):e.arguments=Pze,this.finishNode(e,"NewExpression")};vt.parseTemplateElement=function(e){var t=e.isTagged,n=this.startNode();return this.type===D.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),n.value={raw:this.value,cooked:null}):n.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,` -`),cooked:this.value},this.next(),n.tail=this.type===D.backQuote,this.finishNode(n,"TemplateElement")};vt.parseTemplate=function(e){e===void 0&&(e={});var t=e.isTagged;t===void 0&&(t=!1);var n=this.startNode();this.next(),n.expressions=[];var r=this.parseTemplateElement({isTagged:t});for(n.quasis=[r];!r.tail;)this.type===D.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(D.dollarBraceL),n.expressions.push(this.parseExpression()),this.expect(D.braceR),n.quasis.push(r=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(n,"TemplateLiteral")};vt.isAsyncProp=function(e){return!e.computed&&e.key.type==="Identifier"&&e.key.name==="async"&&(this.type===D.name||this.type===D.num||this.type===D.string||this.type===D.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===D.star)&&!ra.test(this.input.slice(this.lastTokEnd,this.start))};vt.parseObj=function(e,t){var n=this.startNode(),r=!0,i={};for(n.properties=[],this.next();!this.eat(D.braceR);){if(r)r=!1;else if(this.expect(D.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(D.braceR))break;var s=this.parseProperty(e,t);e||this.checkPropClash(s,i,t),n.properties.push(s)}return this.finishNode(n,e?"ObjectPattern":"ObjectExpression")};vt.parseProperty=function(e,t){var n=this.startNode(),r,i,s,o;if(this.options.ecmaVersion>=9&&this.eat(D.ellipsis))return e?(n.argument=this.parseIdent(!1),this.type===D.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(n,"RestElement")):(n.argument=this.parseMaybeAssign(!1,t),this.type===D.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(n,"SpreadElement"));this.options.ecmaVersion>=6&&(n.method=!1,n.shorthand=!1,(e||t)&&(s=this.start,o=this.startLoc),e||(r=this.eat(D.star)));var a=this.containsEsc;return this.parsePropertyName(n),!e&&!a&&this.options.ecmaVersion>=8&&!r&&this.isAsyncProp(n)?(i=!0,r=this.options.ecmaVersion>=9&&this.eat(D.star),this.parsePropertyName(n)):i=!1,this.parsePropertyValue(n,e,r,i,s,o,t,a),this.finishNode(n,"Property")};vt.parseGetterSetter=function(e){e.kind=e.key.name,this.parsePropertyName(e),e.value=this.parseMethod(!1);var t=e.kind==="get"?0:1;if(e.value.params.length!==t){var n=e.value.start;e.kind==="get"?this.raiseRecoverable(n,"getter should have no params"):this.raiseRecoverable(n,"setter should have exactly one param")}else e.kind==="set"&&e.value.params[0].type==="RestElement"&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")};vt.parsePropertyValue=function(e,t,n,r,i,s,o,a){(n||r)&&this.type===D.colon&&this.unexpected(),this.eat(D.colon)?(e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,o),e.kind="init"):this.options.ecmaVersion>=6&&this.type===D.parenL?(t&&this.unexpected(),e.kind="init",e.method=!0,e.value=this.parseMethod(n,r)):!t&&!a&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&this.type!==D.comma&&this.type!==D.braceR&&this.type!==D.eq?((n||r)&&this.unexpected(),this.parseGetterSetter(e)):this.options.ecmaVersion>=6&&!e.computed&&e.key.type==="Identifier"?((n||r)&&this.unexpected(),this.checkUnreserved(e.key),e.key.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=i),e.kind="init",t?e.value=this.parseMaybeDefault(i,s,this.copyNode(e.key)):this.type===D.eq&&o?(o.shorthandAssign<0&&(o.shorthandAssign=this.start),e.value=this.parseMaybeDefault(i,s,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.shorthand=!0):this.unexpected()};vt.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(D.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(D.bracketR),e.key;e.computed=!1}return e.key=this.type===D.num||this.type===D.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};vt.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)};vt.parseMethod=function(e,t,n){var r=this.startNode(),i=this.yieldPos,s=this.awaitPos,o=this.awaitIdentPos;return this.initFunction(r),this.options.ecmaVersion>=6&&(r.generator=e),this.options.ecmaVersion>=8&&(r.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(O3(t,r.generator)|C3|(n?Ore:0)),this.expect(D.parenL),r.params=this.parseBindingList(D.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(r,!1,!0,!1),this.yieldPos=i,this.awaitPos=s,this.awaitIdentPos=o,this.finishNode(r,"FunctionExpression")};vt.parseArrowExpression=function(e,t,n,r){var i=this.yieldPos,s=this.awaitPos,o=this.awaitIdentPos;return this.enterScope(O3(n,!1)|Cre),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!n),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1,r),this.yieldPos=i,this.awaitPos=s,this.awaitIdentPos=o,this.finishNode(e,"ArrowFunctionExpression")};vt.parseFunctionBody=function(e,t,n,r){var i=t&&this.type!==D.braceL,s=this.strict,o=!1;if(i)e.body=this.parseMaybeAssign(r),e.expression=!0,this.checkParams(e,!1);else{var a=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);(!s||a)&&(o=this.strictDirective(this.end),o&&a&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list"));var u=this.labels;this.labels=[],o&&(this.strict=!0),this.checkParams(e,!s&&!o&&!t&&!n&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,Nre),e.body=this.parseBlock(!1,void 0,o&&!s),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=u}this.exitScope()};vt.isSimpleParamList=function(e){for(var t=0,n=e;t-1||i.functions.indexOf(e)>-1||i.var.indexOf(e)>-1,i.lexical.push(e),this.inModule&&i.flags&Hy&&delete this.undefinedExports[e]}else if(t===Rre){var s=this.currentScope();s.lexical.push(e)}else if(t===Pre){var o=this.currentScope();this.treatFunctionsAsVar?r=o.lexical.indexOf(e)>-1:r=o.lexical.indexOf(e)>-1||o.var.indexOf(e)>-1,o.functions.push(e)}else for(var a=this.scopeStack.length-1;a>=0;--a){var u=this.scopeStack[a];if(u.lexical.indexOf(e)>-1&&!(u.flags&Are&&u.lexical[0]===e)||!this.treatFunctionsAsVarInScope(u)&&u.functions.indexOf(e)>-1){r=!0;break}if(u.var.push(e),this.inModule&&u.flags&Hy&&delete this.undefinedExports[e],u.flags&A3)break}r&&this.raiseRecoverable(n,"Identifier '"+e+"' has already been declared")};Cf.checkLocalExport=function(e){this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1&&(this.undefinedExports[e.name]=e)};Cf.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};Cf.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&A3)return t}};Cf.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&A3&&!(t.flags&Cre))return t}};var ax=function(t,n,r){this.type="",this.start=n,this.end=0,t.options.locations&&(this.loc=new sx(t,r)),t.options.directSourceFile&&(this.sourceFile=t.options.directSourceFile),t.options.ranges&&(this.range=[n,0])},Z_=ti.prototype;Z_.startNode=function(){return new ax(this,this.start,this.startLoc)};Z_.startNodeAt=function(e,t){return new ax(this,e,t)};function $re(e,t,n,r){return e.type=t,e.end=n,this.options.locations&&(e.loc.end=r),this.options.ranges&&(e.range[1]=n),e}Z_.finishNode=function(e,t){return $re.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)};Z_.finishNodeAt=function(e,t,n,r){return $re.call(this,e,t,n,r)};Z_.copyNode=function(e){var t=new ax(this,e.start,this.startLoc);for(var n in e)t[n]=e[n];return t};var Lre="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",Mre=Lre+" Extended_Pictographic",Fre=Mre,Bre=Fre+" EBase EComp EMod EPres ExtPict",jre=Bre,Nze=jre,kze={9:Lre,10:Mre,11:Fre,12:Bre,13:jre,14:Nze},Dze="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",$ze={9:"",10:"",11:"",12:"",13:"",14:Dze},VU="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",Ure="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",Vre=Ure+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",zre=Vre+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",Hre=zre+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",Wre=Hre+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",Lze=Wre+" Hrkt Katakana_Or_Hiragana Kawi Nag_Mundari Nagm Unknown Zzzz",Mze={9:Ure,10:Vre,11:zre,12:Hre,13:Wre,14:Lze},qre={};function Fze(e){var t=qre[e]={binary:xc(kze[e]+" "+VU),binaryOfStrings:xc($ze[e]),nonBinary:{General_Category:xc(VU),Script:xc(Mze[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}for(var oO=0,zU=[9,10,11,12,13,14];oO=6?"uy":"")+(t.options.ecmaVersion>=9?"s":"")+(t.options.ecmaVersion>=13?"d":"")+(t.options.ecmaVersion>=15?"v":""),this.unicodeProperties=qre[t.options.ecmaVersion>=14?14:t.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=[],this.backReferenceNames=[]};zu.prototype.reset=function(t,n,r){var i=r.indexOf("v")!==-1,s=r.indexOf("u")!==-1;this.start=t|0,this.source=n+"",this.flags=r,i&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=s&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=s&&this.parser.options.ecmaVersion>=9)};zu.prototype.raise=function(t){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+t)};zu.prototype.at=function(t,n){n===void 0&&(n=!1);var r=this.source,i=r.length;if(t>=i)return-1;var s=r.charCodeAt(t);if(!(n||this.switchU)||s<=55295||s>=57344||t+1>=i)return s;var o=r.charCodeAt(t+1);return o>=56320&&o<=57343?(s<<10)+o-56613888:s};zu.prototype.nextIndex=function(t,n){n===void 0&&(n=!1);var r=this.source,i=r.length;if(t>=i)return i;var s=r.charCodeAt(t),o;return!(n||this.switchU)||s<=55295||s>=57344||t+1>=i||(o=r.charCodeAt(t+1))<56320||o>57343?t+1:t+2};zu.prototype.current=function(t){return t===void 0&&(t=!1),this.at(this.pos,t)};zu.prototype.lookahead=function(t){return t===void 0&&(t=!1),this.at(this.nextIndex(this.pos,t),t)};zu.prototype.advance=function(t){t===void 0&&(t=!1),this.pos=this.nextIndex(this.pos,t)};zu.prototype.eat=function(t,n){return n===void 0&&(n=!1),this.current(n)===t?(this.advance(n),!0):!1};zu.prototype.eatChars=function(t,n){n===void 0&&(n=!1);for(var r=this.pos,i=0,s=t;i-1&&this.raise(e.start,"Duplicate regular expression flag"),o==="u"&&(r=!0),o==="v"&&(i=!0)}this.options.ecmaVersion>=15&&r&&i&&this.raise(e.start,"Invalid regular expression flag")};Ge.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&e.groupNames.length>0&&(e.switchN=!0,this.regexp_pattern(e))};Ge.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames.length=0,e.backReferenceNames.length=0,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(var t=0,n=e.backReferenceNames;t=9&&(n=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!n,!0}return e.pos=t,!1};Ge.regexp_eatQuantifier=function(e,t){return t===void 0&&(t=!1),this.regexp_eatQuantifierPrefix(e,t)?(e.eat(63),!0):!1};Ge.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)};Ge.regexp_eatBracedQuantifier=function(e,t){var n=e.pos;if(e.eat(123)){var r=0,i=-1;if(this.regexp_eatDecimalDigits(e)&&(r=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(i=e.lastIntValue),e.eat(125)))return i!==-1&&i=9?this.regexp_groupSpecifier(e):e.current()===63&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise("Unterminated group")}return!1};Ge.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)};Ge.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1};Ge.regexp_eatSyntaxCharacter=function(e){var t=e.current();return Yre(t)?(e.lastIntValue=t,e.advance(),!0):!1};function Yre(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}Ge.regexp_eatPatternCharacters=function(e){for(var t=e.pos,n=0;(n=e.current())!==-1&&!Yre(n);)e.advance();return e.pos!==t};Ge.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return t!==-1&&t!==36&&!(t>=40&&t<=43)&&t!==46&&t!==63&&t!==91&&t!==94&&t!==124?(e.advance(),!0):!1};Ge.regexp_groupSpecifier=function(e){if(e.eat(63)){if(this.regexp_eatGroupName(e)){e.groupNames.indexOf(e.lastStringValue)!==-1&&e.raise("Duplicate capture group name"),e.groupNames.push(e.lastStringValue);return}e.raise("Invalid group")}};Ge.regexp_eatGroupName=function(e){if(e.lastStringValue="",e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise("Invalid capture group name")}return!1};Ge.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=cf(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=cf(e.lastIntValue);return!0}return!1};Ge.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,r=e.current(n);return e.advance(n),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n)&&(r=e.lastIntValue),jze(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function jze(e){return kl(e,!0)||e===36||e===95}Ge.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,r=e.current(n);return e.advance(n),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n)&&(r=e.lastIntValue),Uze(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function Uze(e){return _m(e,!0)||e===36||e===95||e===8204||e===8205}Ge.regexp_eatAtomEscape=function(e){return this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e)?!0:(e.switchU&&(e.current()===99&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),!1)};Ge.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var n=e.lastIntValue;if(e.switchU)return n>e.maxBackReference&&(e.maxBackReference=n),!0;if(n<=e.numCapturingParens)return!0;e.pos=t}return!1};Ge.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1};Ge.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)};Ge.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1};Ge.regexp_eatZero=function(e){return e.current()===48&&!ux(e.lookahead())?(e.lastIntValue=0,e.advance(),!0):!1};Ge.regexp_eatControlEscape=function(e){var t=e.current();return t===116?(e.lastIntValue=9,e.advance(),!0):t===110?(e.lastIntValue=10,e.advance(),!0):t===118?(e.lastIntValue=11,e.advance(),!0):t===102?(e.lastIntValue=12,e.advance(),!0):t===114?(e.lastIntValue=13,e.advance(),!0):!1};Ge.regexp_eatControlLetter=function(e){var t=e.current();return Gre(t)?(e.lastIntValue=t%32,e.advance(),!0):!1};function Gre(e){return e>=65&&e<=90||e>=97&&e<=122}Ge.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){t===void 0&&(t=!1);var n=e.pos,r=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var i=e.lastIntValue;if(r&&i>=55296&&i<=56319){var s=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var o=e.lastIntValue;if(o>=56320&&o<=57343)return e.lastIntValue=(i-55296)*1024+(o-56320)+65536,!0}e.pos=s,e.lastIntValue=i}return!0}if(r&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&Vze(e.lastIntValue))return!0;r&&e.raise("Invalid unicode escape"),e.pos=n}return!1};function Vze(e){return e>=0&&e<=1114111}Ge.regexp_eatIdentityEscape=function(e){if(e.switchU)return this.regexp_eatSyntaxCharacter(e)?!0:e.eat(47)?(e.lastIntValue=47,!0):!1;var t=e.current();return t!==99&&(!e.switchN||t!==107)?(e.lastIntValue=t,e.advance(),!0):!1};Ge.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do e.lastIntValue=10*e.lastIntValue+(t-48),e.advance();while((t=e.current())>=48&&t<=57);return!0}return!1};var Kre=0,Dl=1,Mo=2;Ge.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(zze(t))return e.lastIntValue=-1,e.advance(),Dl;var n=!1;if(e.switchU&&this.options.ecmaVersion>=9&&((n=t===80)||t===112)){e.lastIntValue=-1,e.advance();var r;if(e.eat(123)&&(r=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return n&&r===Mo&&e.raise("Invalid property name"),r;e.raise("Invalid property name")}return Kre};function zze(e){return e===100||e===68||e===115||e===83||e===119||e===87}Ge.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var n=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,n,r),Dl}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var i=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,i)}return Kre};Ge.regexp_validateUnicodePropertyNameAndValue=function(e,t,n){X_(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(n)||e.raise("Invalid property value")};Ge.regexp_validateUnicodePropertyNameOrValue=function(e,t){if(e.unicodeProperties.binary.test(t))return Dl;if(e.switchV&&e.unicodeProperties.binaryOfStrings.test(t))return Mo;e.raise("Invalid property name")};Ge.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";Qre(t=e.current());)e.lastStringValue+=cf(t),e.advance();return e.lastStringValue!==""};function Qre(e){return Gre(e)||e===95}Ge.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";Hze(t=e.current());)e.lastStringValue+=cf(t),e.advance();return e.lastStringValue!==""};function Hze(e){return Qre(e)||ux(e)}Ge.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)};Ge.regexp_eatCharacterClass=function(e){if(e.eat(91)){var t=e.eat(94),n=this.regexp_classContents(e);return e.eat(93)||e.raise("Unterminated character class"),t&&n===Mo&&e.raise("Negated character class may contain strings"),!0}return!1};Ge.regexp_classContents=function(e){return e.current()===93?Dl:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),Dl)};Ge.regexp_nonEmptyClassRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var n=e.lastIntValue;e.switchU&&(t===-1||n===-1)&&e.raise("Invalid character class"),t!==-1&&n!==-1&&t>n&&e.raise("Range out of order in character class")}}};Ge.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var n=e.current();(n===99||Zre(n))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=t}var r=e.current();return r!==93?(e.lastIntValue=r,e.advance(),!0):!1};Ge.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)};Ge.regexp_classSetExpression=function(e){var t=Dl,n;if(!this.regexp_eatClassSetRange(e))if(n=this.regexp_eatClassSetOperand(e)){n===Mo&&(t=Mo);for(var r=e.pos;e.eatChars([38,38]);){if(e.current()!==38&&(n=this.regexp_eatClassSetOperand(e))){n!==Mo&&(t=Dl);continue}e.raise("Invalid character in character class")}if(r!==e.pos)return t;for(;e.eatChars([45,45]);)this.regexp_eatClassSetOperand(e)||e.raise("Invalid character in character class");if(r!==e.pos)return t}else e.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(e)){if(n=this.regexp_eatClassSetOperand(e),!n)return t;n===Mo&&(t=Mo)}};Ge.regexp_eatClassSetRange=function(e){var t=e.pos;if(this.regexp_eatClassSetCharacter(e)){var n=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){var r=e.lastIntValue;return n!==-1&&r!==-1&&n>r&&e.raise("Range out of order in character class"),!0}e.pos=t}return!1};Ge.regexp_eatClassSetOperand=function(e){return this.regexp_eatClassSetCharacter(e)?Dl:this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)};Ge.regexp_eatNestedClass=function(e){var t=e.pos;if(e.eat(91)){var n=e.eat(94),r=this.regexp_classContents(e);if(e.eat(93))return n&&r===Mo&&e.raise("Negated character class may contain strings"),r;e.pos=t}if(e.eat(92)){var i=this.regexp_eatCharacterClassEscape(e);if(i)return i;e.pos=t}return null};Ge.regexp_eatClassStringDisjunction=function(e){var t=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){var n=this.regexp_classStringDisjunctionContents(e);if(e.eat(125))return n}else e.raise("Invalid escape");e.pos=t}return null};Ge.regexp_classStringDisjunctionContents=function(e){for(var t=this.regexp_classString(e);e.eat(124);)this.regexp_classString(e)===Mo&&(t=Mo);return t};Ge.regexp_classString=function(e){for(var t=0;this.regexp_eatClassSetCharacter(e);)t++;return t===1?Dl:Mo};Ge.regexp_eatClassSetCharacter=function(e){var t=e.pos;if(e.eat(92))return this.regexp_eatCharacterEscape(e)||this.regexp_eatClassSetReservedPunctuator(e)?!0:e.eat(98)?(e.lastIntValue=8,!0):(e.pos=t,!1);var n=e.current();return n<0||n===e.lookahead()&&Wze(n)||qze(n)?!1:(e.advance(),e.lastIntValue=n,!0)};function Wze(e){return e===33||e>=35&&e<=38||e>=42&&e<=44||e===46||e>=58&&e<=64||e===94||e===96||e===126}function qze(e){return e===40||e===41||e===45||e===47||e>=91&&e<=93||e>=123&&e<=125}Ge.regexp_eatClassSetReservedPunctuator=function(e){var t=e.current();return Yze(t)?(e.lastIntValue=t,e.advance(),!0):!1};function Yze(e){return e===33||e===35||e===37||e===38||e===44||e===45||e>=58&&e<=62||e===64||e===96||e===126}Ge.regexp_eatClassControlLetter=function(e){var t=e.current();return ux(t)||t===95?(e.lastIntValue=t%32,e.advance(),!0):!1};Ge.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise("Invalid escape"),e.pos=t}return!1};Ge.regexp_eatDecimalDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;ux(n=e.current());)e.lastIntValue=10*e.lastIntValue+(n-48),e.advance();return e.pos!==t};function ux(e){return e>=48&&e<=57}Ge.regexp_eatHexDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;Xre(n=e.current());)e.lastIntValue=16*e.lastIntValue+Jre(n),e.advance();return e.pos!==t};function Xre(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function Jre(e){return e>=65&&e<=70?10+(e-65):e>=97&&e<=102?10+(e-97):e-48}Ge.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var n=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=t*64+n*8+e.lastIntValue:e.lastIntValue=t*8+n}else e.lastIntValue=t;return!0}return!1};Ge.regexp_eatOctalDigit=function(e){var t=e.current();return Zre(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)};function Zre(e){return e>=48&&e<=55}Ge.regexp_eatFixedHexDigits=function(e,t){var n=e.pos;e.lastIntValue=0;for(var r=0;r=this.input.length)return this.finishToken(D.eof);if(e.override)return e.override(this);this.readToken(this.fullCharCodeAtPos())};Jt.readToken=function(e){return kl(e,this.options.ecmaVersion>=6)||e===92?this.readWord():this.getTokenFromCode(e)};Jt.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);if(e<=55295||e>=56320)return e;var t=this.input.charCodeAt(this.pos+1);return t<=56319||t>=57344?e:(e<<10)+t-56613888};Jt.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,n=this.input.indexOf("*/",this.pos+=2);if(n===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=n+2,this.options.locations)for(var r=void 0,i=t;(r=wre(this.input,i,this.pos))>-1;)++this.curLine,i=this.lineStart=r;this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,n),t,this.pos,e,this.curPosition())};Jt.skipLineComment=function(e){for(var t=this.pos,n=this.options.onComment&&this.curPosition(),r=this.input.charCodeAt(this.pos+=e);this.pos8&&e<14||e>=5760&&Tre.test(String.fromCharCode(e)))++this.pos;else break e}}};Jt.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var n=this.type;this.type=e,this.value=t,this.updateContext(n)};Jt.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&e===46&&t===46?(this.pos+=3,this.finishToken(D.ellipsis)):(++this.pos,this.finishToken(D.dot))};Jt.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):e===61?this.finishOp(D.assign,2):this.finishOp(D.slash,1)};Jt.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),n=1,r=e===42?D.star:D.modulo;return this.options.ecmaVersion>=7&&e===42&&t===42&&(++n,r=D.starstar,t=this.input.charCodeAt(this.pos+2)),t===61?this.finishOp(D.assign,n+1):this.finishOp(r,n)};Jt.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);if(t===e){if(this.options.ecmaVersion>=12){var n=this.input.charCodeAt(this.pos+2);if(n===61)return this.finishOp(D.assign,3)}return this.finishOp(e===124?D.logicalOR:D.logicalAND,2)}return t===61?this.finishOp(D.assign,2):this.finishOp(e===124?D.bitwiseOR:D.bitwiseAND,1)};Jt.readToken_caret=function(){var e=this.input.charCodeAt(this.pos+1);return e===61?this.finishOp(D.assign,2):this.finishOp(D.bitwiseXOR,1)};Jt.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?t===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||ra.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(D.incDec,2):t===61?this.finishOp(D.assign,2):this.finishOp(D.plusMin,1)};Jt.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),n=1;return t===e?(n=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+n)===61?this.finishOp(D.assign,n+1):this.finishOp(D.bitShift,n)):t===33&&e===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(t===61&&(n=2),this.finishOp(D.relational,n))};Jt.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return t===61?this.finishOp(D.equality,this.input.charCodeAt(this.pos+2)===61?3:2):e===61&&t===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(D.arrow)):this.finishOp(e===61?D.eq:D.prefix,1)};Jt.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(t===46){var n=this.input.charCodeAt(this.pos+2);if(n<48||n>57)return this.finishOp(D.questionDot,2)}if(t===63){if(e>=12){var r=this.input.charCodeAt(this.pos+2);if(r===61)return this.finishOp(D.assign,3)}return this.finishOp(D.coalesce,2)}}return this.finishOp(D.question,1)};Jt.readToken_numberSign=function(){var e=this.options.ecmaVersion,t=35;if(e>=13&&(++this.pos,t=this.fullCharCodeAtPos(),kl(t,!0)||t===92))return this.finishToken(D.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+cf(t)+"'")};Jt.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(D.parenL);case 41:return++this.pos,this.finishToken(D.parenR);case 59:return++this.pos,this.finishToken(D.semi);case 44:return++this.pos,this.finishToken(D.comma);case 91:return++this.pos,this.finishToken(D.bracketL);case 93:return++this.pos,this.finishToken(D.bracketR);case 123:return++this.pos,this.finishToken(D.braceL);case 125:return++this.pos,this.finishToken(D.braceR);case 58:return++this.pos,this.finishToken(D.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(D.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(t===120||t===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(t===111||t===79)return this.readRadixNumber(8);if(t===98||t===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(D.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+cf(e)+"'")};Jt.finishOp=function(e,t){var n=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,n)};Jt.readRegexp=function(){for(var e,t,n=this.pos;;){this.pos>=this.input.length&&this.raise(n,"Unterminated regular expression");var r=this.input.charAt(this.pos);if(ra.test(r)&&this.raise(n,"Unterminated regular expression"),e)e=!1;else{if(r==="[")t=!0;else if(r==="]"&&t)t=!1;else if(r==="/"&&!t)break;e=r==="\\"}++this.pos}var i=this.input.slice(n,this.pos);++this.pos;var s=this.pos,o=this.readWord1();this.containsEsc&&this.unexpected(s);var a=this.regexpState||(this.regexpState=new zu(this));a.reset(n,i,o),this.validateRegExpFlags(a),this.validateRegExpPattern(a);var u=null;try{u=new RegExp(i,o)}catch{}return this.finishToken(D.regexp,{pattern:i,flags:o,value:u})};Jt.readInt=function(e,t,n){for(var r=this.options.ecmaVersion>=12&&t===void 0,i=n&&this.input.charCodeAt(this.pos)===48,s=this.pos,o=0,a=0,u=0,l=t??1/0;u=97?f=c-97+10:c>=65?f=c-65+10:c>=48&&c<=57?f=c-48:f=1/0,f>=e)break;a=c,o=o*e+f}return r&&a===95&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===s||t!=null&&this.pos-s!==t?null:o};function Gze(e,t){return t?parseInt(e,8):parseFloat(e.replace(/_/g,""))}function eie(e){return typeof BigInt!="function"?null:BigInt(e.replace(/_/g,""))}Jt.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var n=this.readInt(e);return n==null&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(n=eie(this.input.slice(t,this.pos)),++this.pos):kl(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(D.num,n)};Jt.readNumber=function(e){var t=this.pos;!e&&this.readInt(10,void 0,!0)===null&&this.raise(t,"Invalid number");var n=this.pos-t>=2&&this.input.charCodeAt(t)===48;n&&this.strict&&this.raise(t,"Invalid number");var r=this.input.charCodeAt(this.pos);if(!n&&!e&&this.options.ecmaVersion>=11&&r===110){var i=eie(this.input.slice(t,this.pos));return++this.pos,kl(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(D.num,i)}n&&/[89]/.test(this.input.slice(t,this.pos))&&(n=!1),r===46&&!n&&(++this.pos,this.readInt(10),r=this.input.charCodeAt(this.pos)),(r===69||r===101)&&!n&&(r=this.input.charCodeAt(++this.pos),(r===43||r===45)&&++this.pos,this.readInt(10)===null&&this.raise(t,"Invalid number")),kl(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var s=Gze(this.input.slice(t,this.pos),n);return this.finishToken(D.num,s)};Jt.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),t;if(e===123){this.options.ecmaVersion<6&&this.unexpected();var n=++this.pos;t=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,t>1114111&&this.invalidStringToken(n,"Code point out of bounds")}else t=this.readHexChar(4);return t};Jt.readString=function(e){for(var t="",n=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var r=this.input.charCodeAt(this.pos);if(r===e)break;r===92?(t+=this.input.slice(n,this.pos),t+=this.readEscapedChar(!1),n=this.pos):r===8232||r===8233?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(Jm(r)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return t+=this.input.slice(n,this.pos++),this.finishToken(D.string,t)};var tie={};Jt.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e===tie)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=!1};Jt.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw tie;this.raise(e,t)};Jt.readTmplToken=function(){for(var e="",t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var n=this.input.charCodeAt(this.pos);if(n===96||n===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===D.template||this.type===D.invalidTemplate)?n===36?(this.pos+=2,this.finishToken(D.dollarBraceL)):(++this.pos,this.finishToken(D.backQuote)):(e+=this.input.slice(t,this.pos),this.finishToken(D.template,e));if(n===92)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(Jm(n)){switch(e+=this.input.slice(t,this.pos),++this.pos,n){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:e+=` +|`},cell(u,l){a+=o(pre(u,i[l]))+"|"}}),a+` +`}function mre(e,t){for(const[n,r]of WI(t))e.set(n,r);return e}function rze(e){return e.replace(/[.*+\-?^${}()|[\]\\]/g,"\\$&")}function Nl(e,t,n=new Map){return t=cs(t)?e.columnName(t):t,Li(t)?n.set(t,t):yn(t)?t.forEach(r=>Nl(e,r,n)):er(t)?Nl(e,t(e),n):Xi(t)?mre(n,t):jt(`Invalid column selection: ${Ou(t)}`),n}function ix(e,t){return e.toObject=t,e}function gre(e){return yn(e)?e.map(gre):e&&e.toObject?e.toObject():e}function ym(){return ix(e=>e.columnNames(),()=>({all:[]}))}function yre(...e){return e=e.flat(),ix(t=>{const n=Nl(t,e);return t.columnNames(r=>!n.has(r))},()=>({not:gre(e)}))}function ize(e,t){return ix(n=>{let r=cs(e)?e:n.columnIndex(e),i=cs(t)?t:n.columnIndex(t);if(i({range:[e,t]}))}function sze(e){return Li(e)&&(e=RegExp(rze(e))),ix(t=>t.columnNames(n=>e.test(n)),()=>({matches:[e.source,e.flags]}))}function oze(e){return W_(e.data)?e.data.constructor:Array}class tl extends IBe{static from(t,n){return new tl(ABe(t,n),n)}static new(t,n){if(t instanceof tl)return t;const r={},i=[];for(const[s,o]of WI(t))r[s]=o,i.push(s);return new tl(r,n||i)}constructor(t,n,r,i,s,o){rx(t,CBe,t),n=n||Object.keys(t);const a=n.length?t[n[0]].length:0;super(n,a,t,r,i,s,o)}create({data:t,names:n,filter:r,groups:i,order:s}){const o=r!==void 0?r:this.mask();return new tl(t||this._data,n||(t?null:this._names),o,i!==void 0?i:rje(this._group,r&&o),s!==void 0?s:this._order,this._params)}assign(...t){const n=this.numRows(),r=this.reify(),i=So(r).groupby(r.groups());return t.forEach(s=>{s=tl.new(s),s.numRows()!==n&&jt("Assign row counts do not match"),s=s.reify(),s.columnNames(o=>i.add(o,s.column(o)))}),this.create(i.new())}columns(){return this._data}column(t){return this._data[t]}columnAt(t){return this._data[this._names[t]]}array(t,n=Array){const r=this.column(t),i=new n(this.numRows());let s=-1;return this.scan(o=>i[++s]=r.get(o),!0),i}get(t,n=0){const r=this.column(t);return this.isFiltered()||this.isOrdered()?r.get(this.indices()[n]):r.get(n)}getter(t){const n=this.column(t),r=this.isFiltered()||this.isOrdered()?this.indices():null;return r?i=>n.get(r[i]):n?i=>n.get(i):jt(`Unrecognized column: ${t}`)}object(t=0){return $U(this)(t)}objects(t={}){const{grouped:n,limit:r,offset:i}=t,s=Nl(this,t.columns||ym()),o=yte(s),a=[];if(this.scan((u,l)=>a.push(o(u,l)),!0,r,i),n&&this.isGrouped()){const u=[];return this.scan(l=>u.push(l),!0,r,i),sje(this,u,a,n)}return a}*[Symbol.iterator](){const t=$U(this),n=this.numRows();for(let r=0;rt.forEach(u):u=>this.scan(u,!0),a=r.length;i={};for(let u=0;uf[++d]=c.get(h))}this.isGrouped()&&(s=ije(this.groups(),o,!!t,n))}return this.create({data:i,names:r,groups:s,filter:null,order:null})}transform(...t){return t.flat().reduce((n,r)=>r(n),this)}toArrow(t){return dre(this,t)}toArrowBuffer(t){return q7e(this,t)}toCSV(t){return Q7e(this,t)}toHTML(t){return X7e(this,t)}toJSON(t){return tze(this,t)}toMarkdown(t){return nze(this,t)}}function $U(e){let t=e._builder;if(!t){const n=yte(e.columnNames()),r=e.data();if(e.isOrdered()||e.isFiltered()){const i=e.indices();t=s=>n(i[s],r)}else t=i=>n(i,r);e._builder=t}return t}class aze{constructor(t){this._outputs=t}size(){return this._outputs.length}outputs(){return this._outputs}init(){return{}}add(){}rem(){}write(){}}function cn(e,t,n,r){const i=n[e.type]||n.Default;if(i&&i(e,t,r)===!1)return;const s=uze[e.type];s&&s(e,t,n)}const E1=(e,t,n)=>{cn(e.argument,t,n,e)},nO=(e,t,n)=>{cn(e.left,t,n,e),cn(e.right,t,n,e)},LU=(e,t,n)=>{cn(e.test,t,n,e),cn(e.consequent,t,n,e),e.alternate&&cn(e.alternate,t,n,e)},rO=(e,t,n)=>{Ya(e.params,t,n,e),cn(e.body,t,n,e)},MU=(e,t,n)=>{cn(e.callee,t,n,e),Ya(e.arguments,t,n,e)},Ya=(e,t,n,r)=>{e.forEach(i=>cn(i,t,n,r))},uze={TemplateLiteral:(e,t,n)=>{Ya(e.expressions,t,n,e),Ya(e.quasis,t,n,e)},MemberExpression:(e,t,n)=>{cn(e.object,t,n,e),cn(e.property,t,n,e)},CallExpression:MU,NewExpression:MU,ArrayExpression:(e,t,n)=>{Ya(e.elements,t,n,e)},AssignmentExpression:nO,AwaitExpression:E1,BinaryExpression:nO,LogicalExpression:nO,UnaryExpression:E1,UpdateExpression:E1,ConditionalExpression:LU,ObjectExpression:(e,t,n)=>{Ya(e.properties,t,n,e)},Property:(e,t,n)=>{cn(e.key,t,n,e),cn(e.value,t,n,e)},ArrowFunctionExpression:rO,FunctionExpression:rO,FunctionDeclaration:rO,VariableDeclaration:(e,t,n)=>{Ya(e.declarations,t,n,e)},VariableDeclarator:(e,t,n)=>{cn(e.id,t,n,e),cn(e.init,t,n,e)},SpreadElement:(e,t,n)=>{cn(e.argument,t,n,e)},BlockStatement:(e,t,n)=>{Ya(e.body,t,n,e)},ExpressionStatement:(e,t,n)=>{cn(e.expression,t,n,e)},IfStatement:LU,ForStatement:(e,t,n)=>{cn(e.init,t,n,e),cn(e.test,t,n,e),cn(e.update,t,n,e),cn(e.body,t,n,e)},WhileStatement:(e,t,n)=>{cn(e.test,t,n,e),cn(e.body,t,n,e)},DoWhileStatement:(e,t,n)=>{cn(e.body,t,n,e),cn(e.test,t,n,e)},SwitchStatement:(e,t,n)=>{cn(e.discriminant,t,n,e),Ya(e.cases,t,n,e)},SwitchCase:(e,t,n)=>{e.test&&cn(e.test,t,n,e),Ya(e.consequent,t,n,e)},ReturnStatement:E1,Program:(e,t,n)=>{cn(e.body[0],t,n,e)}};function _re(e){delete e.start,delete e.end,delete e.optional}function FU(e){_re(e),delete e.object,delete e.property,delete e.computed,e.table||delete e.table}function lze(e){return cn(e,null,{Column:FU,Constant:FU,Default:_re}),e}function Kr(e,t){return t&&t.type===e}function cze(e){return Kr(uje,e)||Kr(aje,e)}function fze(e){return er(e)?e:()=>e}const dze="Escaped functions are not valid as rollup or pivot values.";function hze(e,t,n){e.aggronly&&jt(dze);const r="(row,data)=>fn("+gte(e.table.columnNames())+",$)";return{escape:C$.escape(r,fze(t.expr),n)}}var pze=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,983,6,110,6,6,9,4759,9,787719,239],vre=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,757,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],mze="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࢘-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・",bre="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꟊꟐꟑꟓꟕ-ꟙꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",iO={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},sO="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",gze={5:sO,"5module":sO+" export import",6:sO+" const class extends export import super"},yze=/^in(stanceof)?$/,_ze=new RegExp("["+bre+"]"),vze=new RegExp("["+bre+mze+"]");function fR(e,t){for(var n=65536,r=0;re)return!1;if(n+=t[r+1],n>=e)return!0}return!1}function kl(e,t){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&_ze.test(String.fromCharCode(e)):t===!1?!1:fR(e,vre)}function _m(e,t){return e<48?e===36:e<58?!0:e<65?!1:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&vze.test(String.fromCharCode(e)):t===!1?!1:fR(e,vre)||fR(e,pze)}var fn=function(t,n){n===void 0&&(n={}),this.label=t,this.keyword=n.keyword,this.beforeExpr=!!n.beforeExpr,this.startsExpr=!!n.startsExpr,this.isLoop=!!n.isLoop,this.isAssign=!!n.isAssign,this.prefix=!!n.prefix,this.postfix=!!n.postfix,this.binop=n.binop||null,this.updateContext=null};function xo(e,t){return new fn(e,{beforeExpr:!0,binop:t})}var Co={beforeExpr:!0},vs={startsExpr:!0},I3={};function tn(e,t){return t===void 0&&(t={}),t.keyword=e,I3[e]=new fn(e,t)}var D={num:new fn("num",vs),regexp:new fn("regexp",vs),string:new fn("string",vs),name:new fn("name",vs),privateId:new fn("privateId",vs),eof:new fn("eof"),bracketL:new fn("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new fn("]"),braceL:new fn("{",{beforeExpr:!0,startsExpr:!0}),braceR:new fn("}"),parenL:new fn("(",{beforeExpr:!0,startsExpr:!0}),parenR:new fn(")"),comma:new fn(",",Co),semi:new fn(";",Co),colon:new fn(":",Co),dot:new fn("."),question:new fn("?",Co),questionDot:new fn("?."),arrow:new fn("=>",Co),template:new fn("template"),invalidTemplate:new fn("invalidTemplate"),ellipsis:new fn("...",Co),backQuote:new fn("`",vs),dollarBraceL:new fn("${",{beforeExpr:!0,startsExpr:!0}),eq:new fn("=",{beforeExpr:!0,isAssign:!0}),assign:new fn("_=",{beforeExpr:!0,isAssign:!0}),incDec:new fn("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new fn("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:xo("||",1),logicalAND:xo("&&",2),bitwiseOR:xo("|",3),bitwiseXOR:xo("^",4),bitwiseAND:xo("&",5),equality:xo("==/!=/===/!==",6),relational:xo("/<=/>=",7),bitShift:xo("<>/>>>",8),plusMin:new fn("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:xo("%",10),star:xo("*",10),slash:xo("/",10),starstar:new fn("**",{beforeExpr:!0}),coalesce:xo("??",1),_break:tn("break"),_case:tn("case",Co),_catch:tn("catch"),_continue:tn("continue"),_debugger:tn("debugger"),_default:tn("default",Co),_do:tn("do",{isLoop:!0,beforeExpr:!0}),_else:tn("else",Co),_finally:tn("finally"),_for:tn("for",{isLoop:!0}),_function:tn("function",vs),_if:tn("if"),_return:tn("return",Co),_switch:tn("switch"),_throw:tn("throw",Co),_try:tn("try"),_var:tn("var"),_const:tn("const"),_while:tn("while",{isLoop:!0}),_with:tn("with"),_new:tn("new",{beforeExpr:!0,startsExpr:!0}),_this:tn("this",vs),_super:tn("super",vs),_class:tn("class",vs),_extends:tn("extends",Co),_export:tn("export"),_import:tn("import",vs),_null:tn("null",vs),_true:tn("true",vs),_false:tn("false",vs),_in:tn("in",{beforeExpr:!0,binop:7}),_instanceof:tn("instanceof",{beforeExpr:!0,binop:7}),_typeof:tn("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:tn("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:tn("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},ra=/\r\n?|\n|\u2028|\u2029/,bze=new RegExp(ra.source,"g");function Jm(e){return e===10||e===13||e===8232||e===8233}function Ere(e,t,n){n===void 0&&(n=e.length);for(var r=t;r>10)+55296,(e&1023)+56320))}var Tze=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,zy=function(t,n){this.line=t,this.column=n};zy.prototype.offset=function(t){return new zy(this.line,this.column+t)};var sx=function(t,n,r){this.start=n,this.end=r,t.sourceFile!==null&&(this.source=t.sourceFile)};function Sre(e,t){for(var n=1,r=0;;){var i=Ere(e,r,t);if(i<0)return new zy(n,t-r);++n,r=i}}var dR={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},UU=!1;function Sze(e){var t={};for(var n in dR)t[n]=e&&X_(e,n)?e[n]:dR[n];if(t.ecmaVersion==="latest"?t.ecmaVersion=1e8:t.ecmaVersion==null?(!UU&&typeof console=="object"&&console.warn&&(UU=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required. +Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),t.allowReserved==null&&(t.allowReserved=t.ecmaVersion<5),(!e||e.allowHashBang==null)&&(t.allowHashBang=t.ecmaVersion>=14),BU(t.onToken)){var r=t.onToken;t.onToken=function(i){return r.push(i)}}return BU(t.onComment)&&(t.onComment=Ize(t,t.onComment)),t}function Ize(e,t){return function(n,r,i,s,o,a){var u={type:n?"Block":"Line",value:r,start:i,end:s};e.locations&&(u.loc=new sx(this,o,a)),e.ranges&&(u.range=[i,s]),t.push(u)}}var Hy=1,Zm=2,x3=4,Ire=8,xre=16,Cre=32,C3=64,Are=128,J_=256,A3=Hy|Zm|J_;function O3(e,t){return Zm|(e?x3:0)|(t?Ire:0)}var FT=0,P3=1,Kl=2,Ore=3,Pre=4,Rre=5,ti=function(t,n,r){this.options=t=Sze(t),this.sourceFile=t.sourceFile,this.keywords=xc(gze[t.ecmaVersion>=6?6:t.sourceType==="module"?"5module":5]);var i="";t.allowReserved!==!0&&(i=iO[t.ecmaVersion>=6?6:t.ecmaVersion===5?5:3],t.sourceType==="module"&&(i+=" await")),this.reservedWords=xc(i);var s=(i?i+" ":"")+iO.strict;this.reservedWordsStrict=xc(s),this.reservedWordsStrictBind=xc(s+" "+iO.strictBind),this.input=String(n),this.containsEsc=!1,r?(this.pos=r,this.lineStart=this.input.lastIndexOf(` +`,r-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(ra).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=D.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=t.sourceType==="module",this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&t.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(Hy),this.regexpState=null,this.privateNameStack=[]},Vu={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};ti.prototype.parse=function(){var t=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(t)};Vu.inFunction.get=function(){return(this.currentVarScope().flags&Zm)>0};Vu.inGenerator.get=function(){return(this.currentVarScope().flags&Ire)>0&&!this.currentVarScope().inClassFieldInit};Vu.inAsync.get=function(){return(this.currentVarScope().flags&x3)>0&&!this.currentVarScope().inClassFieldInit};Vu.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e];if(t.inClassFieldInit||t.flags&J_)return!1;if(t.flags&Zm)return(t.flags&x3)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};Vu.allowSuper.get=function(){var e=this.currentThisScope(),t=e.flags,n=e.inClassFieldInit;return(t&C3)>0||n||this.options.allowSuperOutsideMethod};Vu.allowDirectSuper.get=function(){return(this.currentThisScope().flags&Are)>0};Vu.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};Vu.allowNewDotTarget.get=function(){var e=this.currentThisScope(),t=e.flags,n=e.inClassFieldInit;return(t&(Zm|J_))>0||n};Vu.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&J_)>0};ti.extend=function(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];for(var r=this,i=0;i=,?^&]/.test(i)||i==="!"&&this.input.charAt(r+1)==="=")}e+=t[0].length,Lo.lastIndex=e,e+=Lo.exec(this.input)[0].length,this.input[e]===";"&&e++}};ps.eat=function(e){return this.type===e?(this.next(),!0):!1};ps.isContextual=function(e){return this.type===D.name&&this.value===e&&!this.containsEsc};ps.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1};ps.expectContextual=function(e){this.eatContextual(e)||this.unexpected()};ps.canInsertSemicolon=function(){return this.type===D.eof||this.type===D.braceR||ra.test(this.input.slice(this.lastTokEnd,this.start))};ps.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0};ps.semicolon=function(){!this.eat(D.semi)&&!this.insertSemicolon()&&this.unexpected()};ps.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0};ps.expect=function(e){this.eat(e)||this.unexpected()};ps.unexpected=function(e){this.raise(e??this.start,"Unexpected token")};var ox=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};ps.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var n=t?e.parenthesizedAssign:e.parenthesizedBind;n>-1&&this.raiseRecoverable(n,t?"Assigning to rvalue":"Parenthesized pattern")}};ps.checkExpressionErrors=function(e,t){if(!e)return!1;var n=e.shorthandAssign,r=e.doubleProto;if(!t)return n>=0||r>=0;n>=0&&this.raise(n,"Shorthand property assignments are valid only in destructuring patterns"),r>=0&&this.raiseRecoverable(r,"Redefinition of __proto__ property")};ps.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos55295&&r<56320)return!0;if(kl(r,!0)){for(var i=n+1;_m(r=this.input.charCodeAt(i),!0);)++i;if(r===92||r>55295&&r<56320)return!0;var s=this.input.slice(n,i);if(!yze.test(s))return!0}return!1};nt.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;Lo.lastIndex=this.pos;var e=Lo.exec(this.input),t=this.pos+e[0].length,n;return!ra.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)==="function"&&(t+8===this.input.length||!(_m(n=this.input.charCodeAt(t+8))||n>55295&&n<56320))};nt.parseStatement=function(e,t,n){var r=this.type,i=this.startNode(),s;switch(this.isLet(e)&&(r=D._var,s="let"),r){case D._break:case D._continue:return this.parseBreakContinueStatement(i,r.keyword);case D._debugger:return this.parseDebuggerStatement(i);case D._do:return this.parseDoStatement(i);case D._for:return this.parseForStatement(i);case D._function:return e&&(this.strict||e!=="if"&&e!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(i,!1,!e);case D._class:return e&&this.unexpected(),this.parseClass(i,!0);case D._if:return this.parseIfStatement(i);case D._return:return this.parseReturnStatement(i);case D._switch:return this.parseSwitchStatement(i);case D._throw:return this.parseThrowStatement(i);case D._try:return this.parseTryStatement(i);case D._const:case D._var:return s=s||this.value,e&&s!=="var"&&this.unexpected(),this.parseVarStatement(i,s);case D._while:return this.parseWhileStatement(i);case D._with:return this.parseWithStatement(i);case D.braceL:return this.parseBlock(!0,i);case D.semi:return this.parseEmptyStatement(i);case D._export:case D._import:if(this.options.ecmaVersion>10&&r===D._import){Lo.lastIndex=this.pos;var o=Lo.exec(this.input),a=this.pos+o[0].length,u=this.input.charCodeAt(a);if(u===40||u===46)return this.parseExpressionStatement(i,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),r===D._import?this.parseImport(i):this.parseExport(i,n);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(i,!0,!e);var l=this.value,c=this.parseExpression();return r===D.name&&c.type==="Identifier"&&this.eat(D.colon)?this.parseLabeledStatement(i,l,c,e):this.parseExpressionStatement(i,c)}};nt.parseBreakContinueStatement=function(e,t){var n=t==="break";this.next(),this.eat(D.semi)||this.insertSemicolon()?e.label=null:this.type!==D.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var r=0;r=6?this.eat(D.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")};nt.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(R3),this.enterScope(0),this.expect(D.parenL),this.type===D.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var n=this.isLet();if(this.type===D._var||this.type===D._const||n){var r=this.startNode(),i=n?"let":this.value;return this.next(),this.parseVar(r,!0,i),this.finishNode(r,"VariableDeclaration"),(this.type===D._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&r.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===D._in?t>-1&&this.unexpected(t):e.await=t>-1),this.parseForIn(e,r)):(t>-1&&this.unexpected(t),this.parseFor(e,r))}var s=this.isContextual("let"),o=!1,a=new ox,u=this.parseExpression(t>-1?"await":!0,a);return this.type===D._in||(o=this.options.ecmaVersion>=6&&this.isContextual("of"))?(this.options.ecmaVersion>=9&&(this.type===D._in?t>-1&&this.unexpected(t):e.await=t>-1),s&&o&&this.raise(u.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(u,!1,a),this.checkLValPattern(u),this.parseForIn(e,u)):(this.checkExpressionErrors(a,!0),t>-1&&this.unexpected(t),this.parseFor(e,u))};nt.parseFunctionStatement=function(e,t,n){return this.next(),this.parseFunction(e,G0|(n?0:hR),!1,t)};nt.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(D._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")};nt.parseReturnStatement=function(e){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,"'return' outside of function"),this.next(),this.eat(D.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")};nt.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(D.braceL),this.labels.push(Cze),this.enterScope(0);for(var t,n=!1;this.type!==D.braceR;)if(this.type===D._case||this.type===D._default){var r=this.type===D._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),r?t.test=this.parseExpression():(n&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),n=!0,t.test=null),this.expect(D.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")};nt.parseThrowStatement=function(e){return this.next(),ra.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var Aze=[];nt.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),t=e.type==="Identifier";return this.enterScope(t?Cre:0),this.checkLValPattern(e,t?Pre:Kl),this.expect(D.parenR),e};nt.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===D._catch){var t=this.startNode();this.next(),this.eat(D.parenL)?t.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0)),t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,"CatchClause")}return e.finalizer=this.eat(D._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")};nt.parseVarStatement=function(e,t,n){return this.next(),this.parseVar(e,!1,t,n),this.semicolon(),this.finishNode(e,"VariableDeclaration")};nt.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(R3),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")};nt.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")};nt.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")};nt.parseLabeledStatement=function(e,t,n,r){for(var i=0,s=this.labels;i=0;u--){var l=this.labels[u];if(l.statementStart===e.start)l.statementStart=this.start,l.kind=a;else break}return this.labels.push({name:t,kind:a,statementStart:this.start}),e.body=this.parseStatement(r?r.indexOf("label")===-1?r+"label":r:"label"),this.labels.pop(),e.label=n,this.finishNode(e,"LabeledStatement")};nt.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")};nt.parseBlock=function(e,t,n){for(e===void 0&&(e=!0),t===void 0&&(t=this.startNode()),t.body=[],this.expect(D.braceL),e&&this.enterScope(0);this.type!==D.braceR;){var r=this.parseStatement(null);t.body.push(r)}return n&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,"BlockStatement")};nt.parseFor=function(e,t){return e.init=t,this.expect(D.semi),e.test=this.type===D.semi?null:this.parseExpression(),this.expect(D.semi),e.update=this.type===D.parenR?null:this.parseExpression(),this.expect(D.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")};nt.parseForIn=function(e,t){var n=this.type===D._in;return this.next(),t.type==="VariableDeclaration"&&t.declarations[0].init!=null&&(!n||this.options.ecmaVersion<8||this.strict||t.kind!=="var"||t.declarations[0].id.type!=="Identifier")&&this.raise(t.start,(n?"for-in":"for-of")+" loop variable declaration may not have an initializer"),e.left=t,e.right=n?this.parseExpression():this.parseMaybeAssign(),this.expect(D.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,n?"ForInStatement":"ForOfStatement")};nt.parseVar=function(e,t,n,r){for(e.declarations=[],e.kind=n;;){var i=this.startNode();if(this.parseVarId(i,n),this.eat(D.eq)?i.init=this.parseMaybeAssign(t):!r&&n==="const"&&!(this.type===D._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():!r&&i.id.type!=="Identifier"&&!(t&&(this.type===D._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):i.init=null,e.declarations.push(this.finishNode(i,"VariableDeclarator")),!this.eat(D.comma))break}return e};nt.parseVarId=function(e,t){e.id=this.parseBindingAtom(),this.checkLValPattern(e.id,t==="var"?P3:Kl,!1)};var G0=1,hR=2,Nre=4;nt.parseFunction=function(e,t,n,r,i){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!r)&&(this.type===D.star&&t&hR&&this.unexpected(),e.generator=this.eat(D.star)),this.options.ecmaVersion>=8&&(e.async=!!r),t&G0&&(e.id=t&Nre&&this.type!==D.name?null:this.parseIdent(),e.id&&!(t&hR)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?P3:Kl:Ore));var s=this.yieldPos,o=this.awaitPos,a=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(O3(e.async,e.generator)),t&G0||(e.id=this.type===D.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,n,!1,i),this.yieldPos=s,this.awaitPos=o,this.awaitIdentPos=a,this.finishNode(e,t&G0?"FunctionDeclaration":"FunctionExpression")};nt.parseFunctionParams=function(e){this.expect(D.parenL),e.params=this.parseBindingList(D.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};nt.parseClass=function(e,t){this.next();var n=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var r=this.enterClassBody(),i=this.startNode(),s=!1;for(i.body=[],this.expect(D.braceL);this.type!==D.braceR;){var o=this.parseClassElement(e.superClass!==null);o&&(i.body.push(o),o.type==="MethodDefinition"&&o.kind==="constructor"?(s&&this.raiseRecoverable(o.start,"Duplicate constructor in the same class"),s=!0):o.key&&o.key.type==="PrivateIdentifier"&&Oze(r,o)&&this.raiseRecoverable(o.key.start,"Identifier '#"+o.key.name+"' has already been declared"))}return this.strict=n,this.next(),e.body=this.finishNode(i,"ClassBody"),this.exitClassBody(),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")};nt.parseClassElement=function(e){if(this.eat(D.semi))return null;var t=this.options.ecmaVersion,n=this.startNode(),r="",i=!1,s=!1,o="method",a=!1;if(this.eatContextual("static")){if(t>=13&&this.eat(D.braceL))return this.parseClassStaticBlock(n),n;this.isClassElementNameStart()||this.type===D.star?a=!0:r="static"}if(n.static=a,!r&&t>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===D.star)&&!this.canInsertSemicolon()?s=!0:r="async"),!r&&(t>=9||!s)&&this.eat(D.star)&&(i=!0),!r&&!s&&!i){var u=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?o=u:r=u)}if(r?(n.computed=!1,n.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),n.key.name=r,this.finishNode(n.key,"Identifier")):this.parseClassElementName(n),t<13||this.type===D.parenL||o!=="method"||i||s){var l=!n.static&&BT(n,"constructor"),c=l&&e;l&&o!=="method"&&this.raise(n.key.start,"Constructor can't have get/set modifier"),n.kind=l?"constructor":o,this.parseClassMethod(n,i,s,c)}else this.parseClassField(n);return n};nt.isClassElementNameStart=function(){return this.type===D.name||this.type===D.privateId||this.type===D.num||this.type===D.string||this.type===D.bracketL||this.type.keyword};nt.parseClassElementName=function(e){this.type===D.privateId?(this.value==="constructor"&&this.raise(this.start,"Classes can't have an element named '#constructor'"),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)};nt.parseClassMethod=function(e,t,n,r){var i=e.key;e.kind==="constructor"?(t&&this.raise(i.start,"Constructor can't be a generator"),n&&this.raise(i.start,"Constructor can't be an async method")):e.static&&BT(e,"prototype")&&this.raise(i.start,"Classes may not have a static property named prototype");var s=e.value=this.parseMethod(t,n,r);return e.kind==="get"&&s.params.length!==0&&this.raiseRecoverable(s.start,"getter should have no params"),e.kind==="set"&&s.params.length!==1&&this.raiseRecoverable(s.start,"setter should have exactly one param"),e.kind==="set"&&s.params[0].type==="RestElement"&&this.raiseRecoverable(s.params[0].start,"Setter cannot use rest params"),this.finishNode(e,"MethodDefinition")};nt.parseClassField=function(e){if(BT(e,"constructor")?this.raise(e.key.start,"Classes can't have a field named 'constructor'"):e.static&&BT(e,"prototype")&&this.raise(e.key.start,"Classes can't have a static field named 'prototype'"),this.eat(D.eq)){var t=this.currentThisScope(),n=t.inClassFieldInit;t.inClassFieldInit=!0,e.value=this.parseMaybeAssign(),t.inClassFieldInit=n}else e.value=null;return this.semicolon(),this.finishNode(e,"PropertyDefinition")};nt.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(J_|C3);this.type!==D.braceR;){var n=this.parseStatement(null);e.body.push(n)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,"StaticBlock")};nt.parseClassId=function(e,t){this.type===D.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,Kl,!1)):(t===!0&&this.unexpected(),e.id=null)};nt.parseClassSuper=function(e){e.superClass=this.eat(D._extends)?this.parseExprSubscripts(null,!1):null};nt.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared};nt.exitClassBody=function(){var e=this.privateNameStack.pop(),t=e.declared,n=e.used;if(this.options.checkPrivateFields)for(var r=this.privateNameStack.length,i=r===0?null:this.privateNameStack[r-1],s=0;s=11&&(this.eatContextual("as")?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==D.string&&this.unexpected(),e.source=this.parseExprAtom(),this.semicolon(),this.finishNode(e,"ExportAllDeclaration")};nt.parseExport=function(e,t){if(this.next(),this.eat(D.star))return this.parseExportAllDeclaration(e,t);if(this.eat(D._default))return this.checkExport(t,"default",this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),e.declaration.type==="VariableDeclaration"?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null;else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))this.type!==D.string&&this.unexpected(),e.source=this.parseExprAtom();else{for(var n=0,r=e.specifiers;n=13&&this.type===D.string){var e=this.parseLiteral(this.value);return Tze.test(e.value)&&this.raise(e.start,"An export name cannot include a lone surrogate."),e}return this.parseIdent(!0)};nt.adaptDirectivePrologue=function(e){for(var t=0;t=5&&e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value=="string"&&(this.input[e.start]==='"'||this.input[e.start]==="'")};var ia=ti.prototype;ia.toAssignable=function(e,t,n){if(this.options.ecmaVersion>=6&&e)switch(e.type){case"Identifier":this.inAsync&&e.name==="await"&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern",n&&this.checkPatternErrors(n,!0);for(var r=0,i=e.properties;r=8&&!a&&u.name==="async"&&!this.canInsertSemicolon()&&this.eat(D._function))return this.overrideContext(lr.f_expr),this.parseFunction(this.startNodeAt(s,o),0,!1,!0,t);if(i&&!this.canInsertSemicolon()){if(this.eat(D.arrow))return this.parseArrowExpression(this.startNodeAt(s,o),[u],!1,t);if(this.options.ecmaVersion>=8&&u.name==="async"&&this.type===D.name&&!a&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return u=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(D.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(s,o),[u],!0,t)}return u;case D.regexp:var l=this.value;return r=this.parseLiteral(l.value),r.regex={pattern:l.pattern,flags:l.flags},r;case D.num:case D.string:return this.parseLiteral(this.value);case D._null:case D._true:case D._false:return r=this.startNode(),r.value=this.type===D._null?null:this.type===D._true,r.raw=this.type.keyword,this.next(),this.finishNode(r,"Literal");case D.parenL:var c=this.start,f=this.parseParenAndDistinguishExpression(i,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(f)&&(e.parenthesizedAssign=c),e.parenthesizedBind<0&&(e.parenthesizedBind=c)),f;case D.bracketL:return r=this.startNode(),this.next(),r.elements=this.parseExprList(D.bracketR,!0,!0,e),this.finishNode(r,"ArrayExpression");case D.braceL:return this.overrideContext(lr.b_expr),this.parseObj(!1,e);case D._function:return r=this.startNode(),this.next(),this.parseFunction(r,0);case D._class:return this.parseClass(this.startNode(),!1);case D._new:return this.parseNew();case D.backQuote:return this.parseTemplate();case D._import:return this.options.ecmaVersion>=11?this.parseExprImport(n):this.unexpected();default:return this.parseExprAtomDefault()}};vt.parseExprAtomDefault=function(){this.unexpected()};vt.parseExprImport=function(e){var t=this.startNode();this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import");var n=this.parseIdent(!0);if(this.type===D.parenL&&!e)return this.parseDynamicImport(t);if(this.type===D.dot)return t.meta=n,this.parseImportMeta(t);this.unexpected()};vt.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),!this.eat(D.parenR)){var t=this.start;this.eat(D.comma)&&this.eat(D.parenR)?this.raiseRecoverable(t,"Trailing comma is not allowed in import()"):this.unexpected(t)}return this.finishNode(e,"ImportExpression")};vt.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="meta"&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),t&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")};vt.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),t.raw.charCodeAt(t.raw.length-1)===110&&(t.bigint=t.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(t,"Literal")};vt.parseParenExpression=function(){this.expect(D.parenL);var e=this.parseExpression();return this.expect(D.parenR),e};vt.shouldParseArrow=function(e){return!this.canInsertSemicolon()};vt.parseParenAndDistinguishExpression=function(e,t){var n=this.start,r=this.startLoc,i,s=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var o=this.start,a=this.startLoc,u=[],l=!0,c=!1,f=new ox,d=this.yieldPos,h=this.awaitPos,p;for(this.yieldPos=0,this.awaitPos=0;this.type!==D.parenR;)if(l?l=!1:this.expect(D.comma),s&&this.afterTrailingComma(D.parenR,!0)){c=!0;break}else if(this.type===D.ellipsis){p=this.start,u.push(this.parseParenItem(this.parseRestBinding())),this.type===D.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else u.push(this.parseMaybeAssign(!1,f,this.parseParenItem));var m=this.lastTokEnd,y=this.lastTokEndLoc;if(this.expect(D.parenR),e&&this.shouldParseArrow(u)&&this.eat(D.arrow))return this.checkPatternErrors(f,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=d,this.awaitPos=h,this.parseParenArrowList(n,r,u,t);(!u.length||c)&&this.unexpected(this.lastTokStart),p&&this.unexpected(p),this.checkExpressionErrors(f,!0),this.yieldPos=d||this.yieldPos,this.awaitPos=h||this.awaitPos,u.length>1?(i=this.startNodeAt(o,a),i.expressions=u,this.finishNodeAt(i,"SequenceExpression",m,y)):i=u[0]}else i=this.parseParenExpression();if(this.options.preserveParens){var g=this.startNodeAt(n,r);return g.expression=i,this.finishNode(g,"ParenthesizedExpression")}else return i};vt.parseParenItem=function(e){return e};vt.parseParenArrowList=function(e,t,n,r){return this.parseArrowExpression(this.startNodeAt(e,t),n,!1,r)};var Pze=[];vt.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===D.dot){var t=this.startNodeAt(e.start,e.startLoc);t.name="new",e.meta=this.finishNode(t,"Identifier"),this.next();var n=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="target"&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),n&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(e.start,"'new.target' can only be used in functions and class static block"),this.finishNode(e,"MetaProperty")}var r=this.start,i=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),r,i,!0,!1),this.eat(D.parenL)?e.arguments=this.parseExprList(D.parenR,this.options.ecmaVersion>=8,!1):e.arguments=Pze,this.finishNode(e,"NewExpression")};vt.parseTemplateElement=function(e){var t=e.isTagged,n=this.startNode();return this.type===D.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),n.value={raw:this.value,cooked:null}):n.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,` +`),cooked:this.value},this.next(),n.tail=this.type===D.backQuote,this.finishNode(n,"TemplateElement")};vt.parseTemplate=function(e){e===void 0&&(e={});var t=e.isTagged;t===void 0&&(t=!1);var n=this.startNode();this.next(),n.expressions=[];var r=this.parseTemplateElement({isTagged:t});for(n.quasis=[r];!r.tail;)this.type===D.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(D.dollarBraceL),n.expressions.push(this.parseExpression()),this.expect(D.braceR),n.quasis.push(r=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(n,"TemplateLiteral")};vt.isAsyncProp=function(e){return!e.computed&&e.key.type==="Identifier"&&e.key.name==="async"&&(this.type===D.name||this.type===D.num||this.type===D.string||this.type===D.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===D.star)&&!ra.test(this.input.slice(this.lastTokEnd,this.start))};vt.parseObj=function(e,t){var n=this.startNode(),r=!0,i={};for(n.properties=[],this.next();!this.eat(D.braceR);){if(r)r=!1;else if(this.expect(D.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(D.braceR))break;var s=this.parseProperty(e,t);e||this.checkPropClash(s,i,t),n.properties.push(s)}return this.finishNode(n,e?"ObjectPattern":"ObjectExpression")};vt.parseProperty=function(e,t){var n=this.startNode(),r,i,s,o;if(this.options.ecmaVersion>=9&&this.eat(D.ellipsis))return e?(n.argument=this.parseIdent(!1),this.type===D.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(n,"RestElement")):(n.argument=this.parseMaybeAssign(!1,t),this.type===D.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(n,"SpreadElement"));this.options.ecmaVersion>=6&&(n.method=!1,n.shorthand=!1,(e||t)&&(s=this.start,o=this.startLoc),e||(r=this.eat(D.star)));var a=this.containsEsc;return this.parsePropertyName(n),!e&&!a&&this.options.ecmaVersion>=8&&!r&&this.isAsyncProp(n)?(i=!0,r=this.options.ecmaVersion>=9&&this.eat(D.star),this.parsePropertyName(n)):i=!1,this.parsePropertyValue(n,e,r,i,s,o,t,a),this.finishNode(n,"Property")};vt.parseGetterSetter=function(e){e.kind=e.key.name,this.parsePropertyName(e),e.value=this.parseMethod(!1);var t=e.kind==="get"?0:1;if(e.value.params.length!==t){var n=e.value.start;e.kind==="get"?this.raiseRecoverable(n,"getter should have no params"):this.raiseRecoverable(n,"setter should have exactly one param")}else e.kind==="set"&&e.value.params[0].type==="RestElement"&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")};vt.parsePropertyValue=function(e,t,n,r,i,s,o,a){(n||r)&&this.type===D.colon&&this.unexpected(),this.eat(D.colon)?(e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,o),e.kind="init"):this.options.ecmaVersion>=6&&this.type===D.parenL?(t&&this.unexpected(),e.kind="init",e.method=!0,e.value=this.parseMethod(n,r)):!t&&!a&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&this.type!==D.comma&&this.type!==D.braceR&&this.type!==D.eq?((n||r)&&this.unexpected(),this.parseGetterSetter(e)):this.options.ecmaVersion>=6&&!e.computed&&e.key.type==="Identifier"?((n||r)&&this.unexpected(),this.checkUnreserved(e.key),e.key.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=i),e.kind="init",t?e.value=this.parseMaybeDefault(i,s,this.copyNode(e.key)):this.type===D.eq&&o?(o.shorthandAssign<0&&(o.shorthandAssign=this.start),e.value=this.parseMaybeDefault(i,s,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.shorthand=!0):this.unexpected()};vt.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(D.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(D.bracketR),e.key;e.computed=!1}return e.key=this.type===D.num||this.type===D.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};vt.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)};vt.parseMethod=function(e,t,n){var r=this.startNode(),i=this.yieldPos,s=this.awaitPos,o=this.awaitIdentPos;return this.initFunction(r),this.options.ecmaVersion>=6&&(r.generator=e),this.options.ecmaVersion>=8&&(r.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(O3(t,r.generator)|C3|(n?Are:0)),this.expect(D.parenL),r.params=this.parseBindingList(D.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(r,!1,!0,!1),this.yieldPos=i,this.awaitPos=s,this.awaitIdentPos=o,this.finishNode(r,"FunctionExpression")};vt.parseArrowExpression=function(e,t,n,r){var i=this.yieldPos,s=this.awaitPos,o=this.awaitIdentPos;return this.enterScope(O3(n,!1)|xre),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!n),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1,r),this.yieldPos=i,this.awaitPos=s,this.awaitIdentPos=o,this.finishNode(e,"ArrowFunctionExpression")};vt.parseFunctionBody=function(e,t,n,r){var i=t&&this.type!==D.braceL,s=this.strict,o=!1;if(i)e.body=this.parseMaybeAssign(r),e.expression=!0,this.checkParams(e,!1);else{var a=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);(!s||a)&&(o=this.strictDirective(this.end),o&&a&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list"));var u=this.labels;this.labels=[],o&&(this.strict=!0),this.checkParams(e,!s&&!o&&!t&&!n&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,Rre),e.body=this.parseBlock(!1,void 0,o&&!s),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=u}this.exitScope()};vt.isSimpleParamList=function(e){for(var t=0,n=e;t-1||i.functions.indexOf(e)>-1||i.var.indexOf(e)>-1,i.lexical.push(e),this.inModule&&i.flags&Hy&&delete this.undefinedExports[e]}else if(t===Pre){var s=this.currentScope();s.lexical.push(e)}else if(t===Ore){var o=this.currentScope();this.treatFunctionsAsVar?r=o.lexical.indexOf(e)>-1:r=o.lexical.indexOf(e)>-1||o.var.indexOf(e)>-1,o.functions.push(e)}else for(var a=this.scopeStack.length-1;a>=0;--a){var u=this.scopeStack[a];if(u.lexical.indexOf(e)>-1&&!(u.flags&Cre&&u.lexical[0]===e)||!this.treatFunctionsAsVarInScope(u)&&u.functions.indexOf(e)>-1){r=!0;break}if(u.var.push(e),this.inModule&&u.flags&Hy&&delete this.undefinedExports[e],u.flags&A3)break}r&&this.raiseRecoverable(n,"Identifier '"+e+"' has already been declared")};Cf.checkLocalExport=function(e){this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1&&(this.undefinedExports[e.name]=e)};Cf.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};Cf.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&A3)return t}};Cf.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&A3&&!(t.flags&xre))return t}};var ax=function(t,n,r){this.type="",this.start=n,this.end=0,t.options.locations&&(this.loc=new sx(t,r)),t.options.directSourceFile&&(this.sourceFile=t.options.directSourceFile),t.options.ranges&&(this.range=[n,0])},Z_=ti.prototype;Z_.startNode=function(){return new ax(this,this.start,this.startLoc)};Z_.startNodeAt=function(e,t){return new ax(this,e,t)};function Dre(e,t,n,r){return e.type=t,e.end=n,this.options.locations&&(e.loc.end=r),this.options.ranges&&(e.range[1]=n),e}Z_.finishNode=function(e,t){return Dre.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)};Z_.finishNodeAt=function(e,t,n,r){return Dre.call(this,e,t,n,r)};Z_.copyNode=function(e){var t=new ax(this,e.start,this.startLoc);for(var n in e)t[n]=e[n];return t};var $re="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",Lre=$re+" Extended_Pictographic",Mre=Lre,Fre=Mre+" EBase EComp EMod EPres ExtPict",Bre=Fre,Nze=Bre,kze={9:$re,10:Lre,11:Mre,12:Fre,13:Bre,14:Nze},Dze="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",$ze={9:"",10:"",11:"",12:"",13:"",14:Dze},VU="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",jre="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",Ure=jre+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",Vre=Ure+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",zre=Vre+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",Hre=zre+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",Lze=Hre+" Hrkt Katakana_Or_Hiragana Kawi Nag_Mundari Nagm Unknown Zzzz",Mze={9:jre,10:Ure,11:Vre,12:zre,13:Hre,14:Lze},Wre={};function Fze(e){var t=Wre[e]={binary:xc(kze[e]+" "+VU),binaryOfStrings:xc($ze[e]),nonBinary:{General_Category:xc(VU),Script:xc(Mze[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}for(var oO=0,zU=[9,10,11,12,13,14];oO=6?"uy":"")+(t.options.ecmaVersion>=9?"s":"")+(t.options.ecmaVersion>=13?"d":"")+(t.options.ecmaVersion>=15?"v":""),this.unicodeProperties=Wre[t.options.ecmaVersion>=14?14:t.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=[],this.backReferenceNames=[]};zu.prototype.reset=function(t,n,r){var i=r.indexOf("v")!==-1,s=r.indexOf("u")!==-1;this.start=t|0,this.source=n+"",this.flags=r,i&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=s&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=s&&this.parser.options.ecmaVersion>=9)};zu.prototype.raise=function(t){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+t)};zu.prototype.at=function(t,n){n===void 0&&(n=!1);var r=this.source,i=r.length;if(t>=i)return-1;var s=r.charCodeAt(t);if(!(n||this.switchU)||s<=55295||s>=57344||t+1>=i)return s;var o=r.charCodeAt(t+1);return o>=56320&&o<=57343?(s<<10)+o-56613888:s};zu.prototype.nextIndex=function(t,n){n===void 0&&(n=!1);var r=this.source,i=r.length;if(t>=i)return i;var s=r.charCodeAt(t),o;return!(n||this.switchU)||s<=55295||s>=57344||t+1>=i||(o=r.charCodeAt(t+1))<56320||o>57343?t+1:t+2};zu.prototype.current=function(t){return t===void 0&&(t=!1),this.at(this.pos,t)};zu.prototype.lookahead=function(t){return t===void 0&&(t=!1),this.at(this.nextIndex(this.pos,t),t)};zu.prototype.advance=function(t){t===void 0&&(t=!1),this.pos=this.nextIndex(this.pos,t)};zu.prototype.eat=function(t,n){return n===void 0&&(n=!1),this.current(n)===t?(this.advance(n),!0):!1};zu.prototype.eatChars=function(t,n){n===void 0&&(n=!1);for(var r=this.pos,i=0,s=t;i-1&&this.raise(e.start,"Duplicate regular expression flag"),o==="u"&&(r=!0),o==="v"&&(i=!0)}this.options.ecmaVersion>=15&&r&&i&&this.raise(e.start,"Invalid regular expression flag")};Ge.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&e.groupNames.length>0&&(e.switchN=!0,this.regexp_pattern(e))};Ge.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames.length=0,e.backReferenceNames.length=0,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(var t=0,n=e.backReferenceNames;t=9&&(n=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!n,!0}return e.pos=t,!1};Ge.regexp_eatQuantifier=function(e,t){return t===void 0&&(t=!1),this.regexp_eatQuantifierPrefix(e,t)?(e.eat(63),!0):!1};Ge.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)};Ge.regexp_eatBracedQuantifier=function(e,t){var n=e.pos;if(e.eat(123)){var r=0,i=-1;if(this.regexp_eatDecimalDigits(e)&&(r=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(i=e.lastIntValue),e.eat(125)))return i!==-1&&i=9?this.regexp_groupSpecifier(e):e.current()===63&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise("Unterminated group")}return!1};Ge.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)};Ge.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1};Ge.regexp_eatSyntaxCharacter=function(e){var t=e.current();return qre(t)?(e.lastIntValue=t,e.advance(),!0):!1};function qre(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}Ge.regexp_eatPatternCharacters=function(e){for(var t=e.pos,n=0;(n=e.current())!==-1&&!qre(n);)e.advance();return e.pos!==t};Ge.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return t!==-1&&t!==36&&!(t>=40&&t<=43)&&t!==46&&t!==63&&t!==91&&t!==94&&t!==124?(e.advance(),!0):!1};Ge.regexp_groupSpecifier=function(e){if(e.eat(63)){if(this.regexp_eatGroupName(e)){e.groupNames.indexOf(e.lastStringValue)!==-1&&e.raise("Duplicate capture group name"),e.groupNames.push(e.lastStringValue);return}e.raise("Invalid group")}};Ge.regexp_eatGroupName=function(e){if(e.lastStringValue="",e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise("Invalid capture group name")}return!1};Ge.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=cf(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=cf(e.lastIntValue);return!0}return!1};Ge.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,r=e.current(n);return e.advance(n),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n)&&(r=e.lastIntValue),jze(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function jze(e){return kl(e,!0)||e===36||e===95}Ge.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,r=e.current(n);return e.advance(n),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n)&&(r=e.lastIntValue),Uze(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function Uze(e){return _m(e,!0)||e===36||e===95||e===8204||e===8205}Ge.regexp_eatAtomEscape=function(e){return this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e)?!0:(e.switchU&&(e.current()===99&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),!1)};Ge.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var n=e.lastIntValue;if(e.switchU)return n>e.maxBackReference&&(e.maxBackReference=n),!0;if(n<=e.numCapturingParens)return!0;e.pos=t}return!1};Ge.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1};Ge.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)};Ge.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1};Ge.regexp_eatZero=function(e){return e.current()===48&&!ux(e.lookahead())?(e.lastIntValue=0,e.advance(),!0):!1};Ge.regexp_eatControlEscape=function(e){var t=e.current();return t===116?(e.lastIntValue=9,e.advance(),!0):t===110?(e.lastIntValue=10,e.advance(),!0):t===118?(e.lastIntValue=11,e.advance(),!0):t===102?(e.lastIntValue=12,e.advance(),!0):t===114?(e.lastIntValue=13,e.advance(),!0):!1};Ge.regexp_eatControlLetter=function(e){var t=e.current();return Yre(t)?(e.lastIntValue=t%32,e.advance(),!0):!1};function Yre(e){return e>=65&&e<=90||e>=97&&e<=122}Ge.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){t===void 0&&(t=!1);var n=e.pos,r=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var i=e.lastIntValue;if(r&&i>=55296&&i<=56319){var s=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var o=e.lastIntValue;if(o>=56320&&o<=57343)return e.lastIntValue=(i-55296)*1024+(o-56320)+65536,!0}e.pos=s,e.lastIntValue=i}return!0}if(r&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&Vze(e.lastIntValue))return!0;r&&e.raise("Invalid unicode escape"),e.pos=n}return!1};function Vze(e){return e>=0&&e<=1114111}Ge.regexp_eatIdentityEscape=function(e){if(e.switchU)return this.regexp_eatSyntaxCharacter(e)?!0:e.eat(47)?(e.lastIntValue=47,!0):!1;var t=e.current();return t!==99&&(!e.switchN||t!==107)?(e.lastIntValue=t,e.advance(),!0):!1};Ge.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do e.lastIntValue=10*e.lastIntValue+(t-48),e.advance();while((t=e.current())>=48&&t<=57);return!0}return!1};var Gre=0,Dl=1,Mo=2;Ge.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(zze(t))return e.lastIntValue=-1,e.advance(),Dl;var n=!1;if(e.switchU&&this.options.ecmaVersion>=9&&((n=t===80)||t===112)){e.lastIntValue=-1,e.advance();var r;if(e.eat(123)&&(r=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return n&&r===Mo&&e.raise("Invalid property name"),r;e.raise("Invalid property name")}return Gre};function zze(e){return e===100||e===68||e===115||e===83||e===119||e===87}Ge.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var n=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,n,r),Dl}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var i=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,i)}return Gre};Ge.regexp_validateUnicodePropertyNameAndValue=function(e,t,n){X_(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(n)||e.raise("Invalid property value")};Ge.regexp_validateUnicodePropertyNameOrValue=function(e,t){if(e.unicodeProperties.binary.test(t))return Dl;if(e.switchV&&e.unicodeProperties.binaryOfStrings.test(t))return Mo;e.raise("Invalid property name")};Ge.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";Kre(t=e.current());)e.lastStringValue+=cf(t),e.advance();return e.lastStringValue!==""};function Kre(e){return Yre(e)||e===95}Ge.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";Hze(t=e.current());)e.lastStringValue+=cf(t),e.advance();return e.lastStringValue!==""};function Hze(e){return Kre(e)||ux(e)}Ge.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)};Ge.regexp_eatCharacterClass=function(e){if(e.eat(91)){var t=e.eat(94),n=this.regexp_classContents(e);return e.eat(93)||e.raise("Unterminated character class"),t&&n===Mo&&e.raise("Negated character class may contain strings"),!0}return!1};Ge.regexp_classContents=function(e){return e.current()===93?Dl:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),Dl)};Ge.regexp_nonEmptyClassRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var n=e.lastIntValue;e.switchU&&(t===-1||n===-1)&&e.raise("Invalid character class"),t!==-1&&n!==-1&&t>n&&e.raise("Range out of order in character class")}}};Ge.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var n=e.current();(n===99||Jre(n))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=t}var r=e.current();return r!==93?(e.lastIntValue=r,e.advance(),!0):!1};Ge.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)};Ge.regexp_classSetExpression=function(e){var t=Dl,n;if(!this.regexp_eatClassSetRange(e))if(n=this.regexp_eatClassSetOperand(e)){n===Mo&&(t=Mo);for(var r=e.pos;e.eatChars([38,38]);){if(e.current()!==38&&(n=this.regexp_eatClassSetOperand(e))){n!==Mo&&(t=Dl);continue}e.raise("Invalid character in character class")}if(r!==e.pos)return t;for(;e.eatChars([45,45]);)this.regexp_eatClassSetOperand(e)||e.raise("Invalid character in character class");if(r!==e.pos)return t}else e.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(e)){if(n=this.regexp_eatClassSetOperand(e),!n)return t;n===Mo&&(t=Mo)}};Ge.regexp_eatClassSetRange=function(e){var t=e.pos;if(this.regexp_eatClassSetCharacter(e)){var n=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){var r=e.lastIntValue;return n!==-1&&r!==-1&&n>r&&e.raise("Range out of order in character class"),!0}e.pos=t}return!1};Ge.regexp_eatClassSetOperand=function(e){return this.regexp_eatClassSetCharacter(e)?Dl:this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)};Ge.regexp_eatNestedClass=function(e){var t=e.pos;if(e.eat(91)){var n=e.eat(94),r=this.regexp_classContents(e);if(e.eat(93))return n&&r===Mo&&e.raise("Negated character class may contain strings"),r;e.pos=t}if(e.eat(92)){var i=this.regexp_eatCharacterClassEscape(e);if(i)return i;e.pos=t}return null};Ge.regexp_eatClassStringDisjunction=function(e){var t=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){var n=this.regexp_classStringDisjunctionContents(e);if(e.eat(125))return n}else e.raise("Invalid escape");e.pos=t}return null};Ge.regexp_classStringDisjunctionContents=function(e){for(var t=this.regexp_classString(e);e.eat(124);)this.regexp_classString(e)===Mo&&(t=Mo);return t};Ge.regexp_classString=function(e){for(var t=0;this.regexp_eatClassSetCharacter(e);)t++;return t===1?Dl:Mo};Ge.regexp_eatClassSetCharacter=function(e){var t=e.pos;if(e.eat(92))return this.regexp_eatCharacterEscape(e)||this.regexp_eatClassSetReservedPunctuator(e)?!0:e.eat(98)?(e.lastIntValue=8,!0):(e.pos=t,!1);var n=e.current();return n<0||n===e.lookahead()&&Wze(n)||qze(n)?!1:(e.advance(),e.lastIntValue=n,!0)};function Wze(e){return e===33||e>=35&&e<=38||e>=42&&e<=44||e===46||e>=58&&e<=64||e===94||e===96||e===126}function qze(e){return e===40||e===41||e===45||e===47||e>=91&&e<=93||e>=123&&e<=125}Ge.regexp_eatClassSetReservedPunctuator=function(e){var t=e.current();return Yze(t)?(e.lastIntValue=t,e.advance(),!0):!1};function Yze(e){return e===33||e===35||e===37||e===38||e===44||e===45||e>=58&&e<=62||e===64||e===96||e===126}Ge.regexp_eatClassControlLetter=function(e){var t=e.current();return ux(t)||t===95?(e.lastIntValue=t%32,e.advance(),!0):!1};Ge.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise("Invalid escape"),e.pos=t}return!1};Ge.regexp_eatDecimalDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;ux(n=e.current());)e.lastIntValue=10*e.lastIntValue+(n-48),e.advance();return e.pos!==t};function ux(e){return e>=48&&e<=57}Ge.regexp_eatHexDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;Qre(n=e.current());)e.lastIntValue=16*e.lastIntValue+Xre(n),e.advance();return e.pos!==t};function Qre(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function Xre(e){return e>=65&&e<=70?10+(e-65):e>=97&&e<=102?10+(e-97):e-48}Ge.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var n=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=t*64+n*8+e.lastIntValue:e.lastIntValue=t*8+n}else e.lastIntValue=t;return!0}return!1};Ge.regexp_eatOctalDigit=function(e){var t=e.current();return Jre(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)};function Jre(e){return e>=48&&e<=55}Ge.regexp_eatFixedHexDigits=function(e,t){var n=e.pos;e.lastIntValue=0;for(var r=0;r=this.input.length)return this.finishToken(D.eof);if(e.override)return e.override(this);this.readToken(this.fullCharCodeAtPos())};Jt.readToken=function(e){return kl(e,this.options.ecmaVersion>=6)||e===92?this.readWord():this.getTokenFromCode(e)};Jt.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);if(e<=55295||e>=56320)return e;var t=this.input.charCodeAt(this.pos+1);return t<=56319||t>=57344?e:(e<<10)+t-56613888};Jt.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,n=this.input.indexOf("*/",this.pos+=2);if(n===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=n+2,this.options.locations)for(var r=void 0,i=t;(r=Ere(this.input,i,this.pos))>-1;)++this.curLine,i=this.lineStart=r;this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,n),t,this.pos,e,this.curPosition())};Jt.skipLineComment=function(e){for(var t=this.pos,n=this.options.onComment&&this.curPosition(),r=this.input.charCodeAt(this.pos+=e);this.pos8&&e<14||e>=5760&&wre.test(String.fromCharCode(e)))++this.pos;else break e}}};Jt.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var n=this.type;this.type=e,this.value=t,this.updateContext(n)};Jt.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&e===46&&t===46?(this.pos+=3,this.finishToken(D.ellipsis)):(++this.pos,this.finishToken(D.dot))};Jt.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):e===61?this.finishOp(D.assign,2):this.finishOp(D.slash,1)};Jt.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),n=1,r=e===42?D.star:D.modulo;return this.options.ecmaVersion>=7&&e===42&&t===42&&(++n,r=D.starstar,t=this.input.charCodeAt(this.pos+2)),t===61?this.finishOp(D.assign,n+1):this.finishOp(r,n)};Jt.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);if(t===e){if(this.options.ecmaVersion>=12){var n=this.input.charCodeAt(this.pos+2);if(n===61)return this.finishOp(D.assign,3)}return this.finishOp(e===124?D.logicalOR:D.logicalAND,2)}return t===61?this.finishOp(D.assign,2):this.finishOp(e===124?D.bitwiseOR:D.bitwiseAND,1)};Jt.readToken_caret=function(){var e=this.input.charCodeAt(this.pos+1);return e===61?this.finishOp(D.assign,2):this.finishOp(D.bitwiseXOR,1)};Jt.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?t===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||ra.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(D.incDec,2):t===61?this.finishOp(D.assign,2):this.finishOp(D.plusMin,1)};Jt.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),n=1;return t===e?(n=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+n)===61?this.finishOp(D.assign,n+1):this.finishOp(D.bitShift,n)):t===33&&e===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(t===61&&(n=2),this.finishOp(D.relational,n))};Jt.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return t===61?this.finishOp(D.equality,this.input.charCodeAt(this.pos+2)===61?3:2):e===61&&t===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(D.arrow)):this.finishOp(e===61?D.eq:D.prefix,1)};Jt.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(t===46){var n=this.input.charCodeAt(this.pos+2);if(n<48||n>57)return this.finishOp(D.questionDot,2)}if(t===63){if(e>=12){var r=this.input.charCodeAt(this.pos+2);if(r===61)return this.finishOp(D.assign,3)}return this.finishOp(D.coalesce,2)}}return this.finishOp(D.question,1)};Jt.readToken_numberSign=function(){var e=this.options.ecmaVersion,t=35;if(e>=13&&(++this.pos,t=this.fullCharCodeAtPos(),kl(t,!0)||t===92))return this.finishToken(D.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+cf(t)+"'")};Jt.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(D.parenL);case 41:return++this.pos,this.finishToken(D.parenR);case 59:return++this.pos,this.finishToken(D.semi);case 44:return++this.pos,this.finishToken(D.comma);case 91:return++this.pos,this.finishToken(D.bracketL);case 93:return++this.pos,this.finishToken(D.bracketR);case 123:return++this.pos,this.finishToken(D.braceL);case 125:return++this.pos,this.finishToken(D.braceR);case 58:return++this.pos,this.finishToken(D.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(D.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(t===120||t===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(t===111||t===79)return this.readRadixNumber(8);if(t===98||t===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(D.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+cf(e)+"'")};Jt.finishOp=function(e,t){var n=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,n)};Jt.readRegexp=function(){for(var e,t,n=this.pos;;){this.pos>=this.input.length&&this.raise(n,"Unterminated regular expression");var r=this.input.charAt(this.pos);if(ra.test(r)&&this.raise(n,"Unterminated regular expression"),e)e=!1;else{if(r==="[")t=!0;else if(r==="]"&&t)t=!1;else if(r==="/"&&!t)break;e=r==="\\"}++this.pos}var i=this.input.slice(n,this.pos);++this.pos;var s=this.pos,o=this.readWord1();this.containsEsc&&this.unexpected(s);var a=this.regexpState||(this.regexpState=new zu(this));a.reset(n,i,o),this.validateRegExpFlags(a),this.validateRegExpPattern(a);var u=null;try{u=new RegExp(i,o)}catch{}return this.finishToken(D.regexp,{pattern:i,flags:o,value:u})};Jt.readInt=function(e,t,n){for(var r=this.options.ecmaVersion>=12&&t===void 0,i=n&&this.input.charCodeAt(this.pos)===48,s=this.pos,o=0,a=0,u=0,l=t??1/0;u=97?f=c-97+10:c>=65?f=c-65+10:c>=48&&c<=57?f=c-48:f=1/0,f>=e)break;a=c,o=o*e+f}return r&&a===95&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===s||t!=null&&this.pos-s!==t?null:o};function Gze(e,t){return t?parseInt(e,8):parseFloat(e.replace(/_/g,""))}function Zre(e){return typeof BigInt!="function"?null:BigInt(e.replace(/_/g,""))}Jt.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var n=this.readInt(e);return n==null&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(n=Zre(this.input.slice(t,this.pos)),++this.pos):kl(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(D.num,n)};Jt.readNumber=function(e){var t=this.pos;!e&&this.readInt(10,void 0,!0)===null&&this.raise(t,"Invalid number");var n=this.pos-t>=2&&this.input.charCodeAt(t)===48;n&&this.strict&&this.raise(t,"Invalid number");var r=this.input.charCodeAt(this.pos);if(!n&&!e&&this.options.ecmaVersion>=11&&r===110){var i=Zre(this.input.slice(t,this.pos));return++this.pos,kl(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(D.num,i)}n&&/[89]/.test(this.input.slice(t,this.pos))&&(n=!1),r===46&&!n&&(++this.pos,this.readInt(10),r=this.input.charCodeAt(this.pos)),(r===69||r===101)&&!n&&(r=this.input.charCodeAt(++this.pos),(r===43||r===45)&&++this.pos,this.readInt(10)===null&&this.raise(t,"Invalid number")),kl(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var s=Gze(this.input.slice(t,this.pos),n);return this.finishToken(D.num,s)};Jt.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),t;if(e===123){this.options.ecmaVersion<6&&this.unexpected();var n=++this.pos;t=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,t>1114111&&this.invalidStringToken(n,"Code point out of bounds")}else t=this.readHexChar(4);return t};Jt.readString=function(e){for(var t="",n=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var r=this.input.charCodeAt(this.pos);if(r===e)break;r===92?(t+=this.input.slice(n,this.pos),t+=this.readEscapedChar(!1),n=this.pos):r===8232||r===8233?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(Jm(r)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return t+=this.input.slice(n,this.pos++),this.finishToken(D.string,t)};var eie={};Jt.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e===eie)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=!1};Jt.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw eie;this.raise(e,t)};Jt.readTmplToken=function(){for(var e="",t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var n=this.input.charCodeAt(this.pos);if(n===96||n===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===D.template||this.type===D.invalidTemplate)?n===36?(this.pos+=2,this.finishToken(D.dollarBraceL)):(++this.pos,this.finishToken(D.backQuote)):(e+=this.input.slice(t,this.pos),this.finishToken(D.template,e));if(n===92)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(Jm(n)){switch(e+=this.input.slice(t,this.pos),++this.pos,n){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:e+=` `;break;default:e+=String.fromCharCode(n);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}};Jt.readInvalidTemplateToken=function(){for(;this.pos=48&&t<=55){var r=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],i=parseInt(r,8);return i>255&&(r=r.slice(0,-1),i=parseInt(r,8)),this.pos+=r.length-1,t=this.input.charCodeAt(this.pos),(r!=="0"||t===56||t===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-r.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(i)}return Jm(t)?"":String.fromCharCode(t)}};Jt.readHexChar=function(e){var t=this.pos,n=this.readInt(16,e);return n===null&&this.invalidStringToken(t,"Bad character escape sequence"),n};Jt.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,n=this.pos,r=this.options.ecmaVersion>=6;this.pos(t,n)=>n.error(t,e+" not allowed"),tHe=Si("Aggregate function"),nHe=Si("Window function"),rHe="Invalid argument",D3="Invalid column reference",iHe=D3+" (must be input to an aggregate function)",nie="Invalid function call",sHe="Invalid member expression",oHe="Invalid operator parameter",aHe="Invalid param reference",uHe="Invalid variable reference",lHe="Variable not accessible in operator call",cHe="Unsupported variable declaration",fHe="Unsupported destructuring pattern",rie="Table expressions do not support closures",iie="Use aq.escape(fn) to use a function as-is (including closures)",dHe="use table.params({ name: value }) to define dynamic parameters",hHe="use aq.addFunction(name, fn) to add new op functions",pHe=` -Note: ${rie}. ${iie}, or ${dHe}.`,sie=` -Note: ${rie}. ${iie}, or ${hHe}.`,mHe=`The ${mte} method is not valid in multi-table expressions.`;function gHe(e,t){const n=yHe(t);let r=e.root=n;return e.spec=t,e.tuple=null,e.tuple1=null,e.tuple2=null,e.$param=null,e.$op=0,e.scope=new Set,e.paramsRef=new Map,e.columnRef=new Map,cze(r)?(vHe(r,e),r=r.body):e.join?(e.scope.add(e.tuple1=Zze),e.scope.add(e.tuple2=eHe),e.scope.add(e.$param=HU)):(e.scope.add(e.tuple=Jze),e.scope.add(e.$param=HU)),cn(r,e,$3),e.root}function yHe(e){try{const t=e.field?_He(e):yn(e)?Ou(e):e;return Qze(`expr=(${t})`,Xze).body[0].expression.right}catch{jt(`Expression parse error: ${e+""}`)}}function _He(e){const t=JSON.stringify(e+"");return e.table?`(a,b)=>b[${t}]`:`d=>d[${t}]`}const $3={FunctionDeclaration:Si("Function definitions"),ForStatement:Si("For loops"),ForOfStatement:Si("For-of loops"),ForInStatement:Si("For-in loops"),WhileStatement:Si("While loops"),DoWhileStatement:Si("Do-while loops"),AwaitExpression:Si("Await expressions"),ArrowFunctionExpression:Si("Function definitions"),AssignmentExpression:Si("Assignments"),FunctionExpression:Si("Function definitions"),NewExpression:Si('Use of "new"'),UpdateExpression:Si("Update expressions"),VariableDeclarator(e,t){gR(e.id,t)},Identifier(e,t,n){uie(e,t,n)&&!t.scope.has(e.name)&&t.error(e,uHe,pHe)},CallExpression(e,t){const n=oie(e.callee),r=dte(n)||hte(n);if(r){if((t.join||t.aggregate===!1)&&I$(n)&&tHe(e,t),(t.join||t.window===!1)&&x$(n)&&nHe(e,t),t.$op=1,t.ast)mR(e,n,t),e.arguments.forEach(i=>cn(i,t,pR));else{const i=t.op(bHe(t,r,n,e.arguments));Object.assign(e,{type:ate,name:i.id})}return t.$op=0,!1}else fte(n)?mR(e,n,t):t.error(e,nie,sie)},MemberExpression(e,t,n){const{object:r,property:i}=e;if(!Kr(Hc,r))return;const{name:s}=r;if(aie(e)&&Kr(Hc,i)&&Pa(k3,i.name)){fie(e,i.name);return}const o=s===t.tuple?0:s===t.tuple1?1:s===t.tuple2?2:-1;if(o>=0)return WU(e,o,t,lie,n);if(s===t.$param)return WU(e,o,t,wHe);t.paramsRef.has(s)?Wy(e,t.paramsRef.get(s)):t.columnRef.has(s)?cie(r,s,t,e):Pa(t.params,s)&&Wy(r,s)}};function WU(e,t,n,r,i){const{property:s,computed:o}=e;let a;if(!o)a=s.name;else if(Kr(Gm,s))a=s.value;else try{cn(s,n,$3,e),a=n.param(s)}catch{n.error(e,sHe)}return r(e,a,t,n,i),!1}const pR={...$3,VariableDeclarator:Si("Variable declaration in operator call"),Identifier(e,t,n){uie(e,t,n)&&t.error(e,lHe)},CallExpression(e,t){const n=oie(e.callee);fte(n)?mR(e,n,t):t.error(e,nie,sie)}};function vHe(e,t){e.generator&&Si("Generator functions")(e,t),e.async&&Si("Async functions")(e,t);const{params:n}=e,r=n.length,i=o=>(a,u)=>t.columnRef.set(a,[u,o]),s=(o,a)=>t.paramsRef.set(o,a);r&&(t.join?(Wg(t,n[0],"tuple1",i(1)),r>1&&Wg(t,n[1],"tuple2",i(2)),r>2&&Wg(t,n[2],"$param",s)):(Wg(t,n[0],"tuple",i(0)),r>1&&Wg(t,n[1],"$param",s))),t.root=e.body}function Wg(e,t,n,r){Kr(Hc,t)?(e.scope.add(t.name),e[n]=t.name):Kr(ste,t)&&t.properties.forEach(i=>{const s=Kr(Hc,i.key)?i.key.name:Kr(Gm,i.key)?i.key.value:e.error(i,rHe);Kr(Hc,i.value)||e.error(i.value,fHe),r(i.value.name,s)})}function bHe(e,t,n,r){const i=[],s=[],o=t.param[0]||0,a=o+(t.param[1]||0);return r.forEach((u,l)=>{l0?r.join[n-1]:null,o=s&&s.column(t);s&&!o&&r.error(e,D3),r.aggronly&&!r.$op&&r.error(e,iHe),pte(e,t,n,o,i)}function cie(e,t,n,r){const[i,s]=n.columnRef.get(t);lie(e,i,s,n,r)}function wHe(e,t,n,r){r.params&&!Pa(r.params,t)&&r.error(e,aHe),Wy(e,t)}function Wy(e,t){e.type=hje,e.name=t}function fie(e,t){e.type=cje,e.name=t,e.raw=k3[t]}function mR(e,t,n){if(t===mte){const r=n.table;r||n.error(e,mHe),gte(e,e.arguments.length?e.arguments.map(i=>{const s=n.param(i),o=cs(s)?r.columnName(s):s;return r.column(o)||n.error(i,D3),o}):r.columnNames())}else e.callee={type:dje,name:t}}function gR(e,t){Kr(Hc,e)?t.scope.add(e.name):Kr(oje,e)?e.elements.forEach(n=>gR(n,t)):Kr(ste,e)?e.properties.forEach(n=>gR(n.value,t)):t.error(e.id,cHe)}const THe={[q_]:1,[ate]:1};function Hs(e,t={}){const n=t.generate||bT,r=t.compiler||C$,i=IHe(t),s={},o={},a=[],u=[];let l=0,c=-1;const f=t.join?r.join:t.index==1?r.expr2:r.expr,d={op(m){const y=SHe(m);return o[y]||(m.id=++c,o[y]=m)},field(m){const y=n(m);return s[y]||(s[y]=++l)},param(m){return Kr(Gm,m)?m.value:r.param(n(m),i)},value(m,y){a.push(m);const g=y.escape||(t.ast?lze(y):f(n(y),i));u.push(g),THe[y.type]&&g!==y&&Xi(g)&&(g.field=y.name)},error(m,y,g=""){const _=m.start-6,b=m.end-6,T=String(d.spec).slice(_,b);jt(`${y}: "${T}"${g}`)}};Object.assign(d,t,{params:i});for(const[m,y]of WI(e))d.value(m+"",y.escape?hze(d,y,i):gHe(d,y));if(t.ast)return{names:a,exprs:u};const h=[];for(const m in s)h[s[m]]=r.expr(m,i);const p=Object.values(o);return p.forEach(m=>m.fields=m.fields.map(y=>h[y])),{names:a,exprs:u,ops:p}}function SHe(e){let t=`${e.name}(${e.fields.concat(e.params).join(",")})`;if(e.frame){const n=e.frame.map(r=>Number.isFinite(r)?Math.abs(r):-1);t+=`[${n},${!!e.peers}]`}return t}function IHe(e){return(e.table?aO(e.table):e.join?{...aO(e.join[1]),...aO(e.join[0])}:{})||{}}function aO(e){return e&&er(e.params)?e.params():{}}const die="Expr",fa="ExprList",hie="ExprNumber",d0="ExprObject",ip="JoinKeys",UT="JoinValues",Oo="Options",L3="OrderKeys",oc="SelectionList",Kf="TableRef",sp="TableRefList",xHe="Descending",CHe="Query",AHe="Selection",OHe="Verb",PHe="Window";function lx(e,t){return e&&e.expr?new qU({...e,...t}):new qU(t,e)}class qU{constructor(t,n){this.expr=n,Object.assign(this,t)}toString(){return String(this.expr)}toObject(){return{...this,expr:this.toString(),...er(this.expr)?{func:!0}:{}}}}function RHe(e){return lx(e,{desc:!0})}function jd(e,t,n=0){const r=n?{field:!0,table:n}:{field:!0};return lx(e,t?{expr:t,...r}:r)}function NHe(e,t,n){return lx(e,{window:{frame:t||[-1/0,0],peers:!!n}})}function kHe(e){const t=n=>n;return t.toString=()=>e,t}function YU(e,t){return t=t&&er(t.query)?t.query():t,t&&er(t.evaluate)?t.evaluate(null,e):e(t)}function pie(e){return Xi(e)&&(yn(e.all)||yn(e.matches)||yn(e.not)||yn(e.range))}function qy(e){return e&&er(e.toObject)?e.toObject():er(e)?{expr:String(e),func:!0}:yn(e)?e.map(qy):Xi(e)?rx(e,t=>qy(t)):e}function M3(e){return yn(e)?e.map(M3):Xi(e)?yn(e.verbs)?B3.from(e):yn(e.all)?ym():yn(e.range)?ize(...e.range):yn(e.match)?sze(RegExp(...e.match)):yn(e.not)?_re(e.not.map(qy)):DHe(e):e}function DHe(e){let t=e,n=e.expr;if(n!=null){if(e.field===!0?t=n=jd(n):e.func===!0&&(t=n=kHe(n)),Xi(e.window)){const{frame:r,peers:i}=e.window;t=n=NHe(n,r,i)}e.desc===!0&&(t=RHe(n))}return e===t?rx(e,r=>M3(r)):t}function $He(e){return yn(e)?e.map(LHe):e}function LHe(e){const t=[];return Vs(e).forEach(n=>{cs(n)?t.push(n):Li(n)?t.push(jd(n,null)):Xi(n)&&n.expr||er(n)?t.push(n):jt(`Invalid key value: ${n+""}`)}),t}function MHe(e){return yn(e)?e.map(FHe):e}function FHe(e,t){return t<2?Vs(e):e}function BHe(e){const t=[];return e.forEach(n=>{const r=n.expr!=null?n.expr:n;if(Xi(r)&&!er(r))for(const i in r)t.push(r[i]);else n=cs(r)?r:Li(r)?jd(n):er(r)?n:jt(`Invalid orderby field: ${n+""}`),t.push(n)}),t}const jHe={[die]:_ie,[fa]:vm,[hie]:qHe,[d0]:ff,[ip]:YHe,[UT]:GHe,[L3]:vm,[oc]:HHe};function UHe(e,t,n){return t===Kf?GU(e):t===sp?e.map(GU):mie(qy(e),t,n)}function mie(e,t,n){return t===Oo?e&&VHe(e,n):jHe[t](e)}function VHe(e,t={}){const n={};for(const r in e){const i=e[r];n[r]=t[r]?mie(i,t[r]):i}return n}function zHe(e,t){return Hs({expr:e},{...t,ast:!0}).exprs[0]}function F3(e){return{type:q_,name:e}}function gie(e){return{type:q_,index:e}}function ff(e,t){if(Li(e))return zHe(e,t);if(e.expr){let n;if(e.field===!0?n=F3(e.expr):e.func===!0&&(n=ff(e.expr,t)),n)return e.desc&&(n={type:xHe,expr:n}),e.window&&(n={type:PHe,expr:n,...e.window}),n}return Object.keys(e).map(n=>({...ff(e[n],t),as:n}))}function yie(e){const t=AHe;return e.all?{type:t,operator:"all"}:e.not?{type:t,operator:"not",arguments:vm(e.not)}:e.range?{type:t,operator:"range",arguments:vm(e.range)}:e.matches?{type:t,operator:"matches",arguments:e.matches}:jt("Invalid input")}function HHe(e){return Vs(e).map(WHe).flat()}function WHe(e){return pie(e)?yie(e):cs(e)?gie(e):Li(e)?F3(e):Xi(e)?Object.keys(e).map(t=>({type:q_,name:t,as:e[t]})):jt("Invalid input")}function _ie(e){return pie(e)?yie(e):cs(e)?gie(e):Li(e)?F3(e):Xi(e)?ff(e):jt("Invalid input")}function vm(e){return Vs(e).map(_ie).flat()}function qHe(e){return cs(e)?e:ff(e)}function YHe(e){return yn(e)?e.map(vm):ff(e,{join:!0})}function GHe(e){return yn(e)?e.map((t,n)=>n<2?vm(t):ff(t,{join:!0})):ff(e,{join:!0})}function GU(e){return e&&er(e.toAST)?e.toAST():e}class vie{constructor(t,n=[],r=[]){this.verb=t,this.schema=n,n.forEach((i,s)=>{const o=i.type,a=r[s],u=o===ip?$He(a):o===UT?MHe(a):o===L3?BHe(a):a;this[i.name]=u!==void 0?u:i.default})}static from(t){const n=yR[t.verb],r=(n.schema||[]).map(({name:i})=>M3(t[i]));return n(...r)}evaluate(t,n){const r=this.schema.map(({name:i,type:s})=>{const o=this[i];return s===Kf?YU(n,o):s===sp?o.map(a=>YU(n,a)):o});return t[this.verb](...r)}toObject(){const t={verb:this.verb};return this.schema.forEach(({name:n})=>{t[n]=qy(this[n])}),t}toAST(){const t={type:OHe,verb:this.verb};return this.schema.forEach(({name:n,type:r,props:i})=>{t[n]=UHe(this[n],r,i)}),t}}function Ln(e,t){return Object.assign((...n)=>new vie(e,t,n),{schema:t})}const yR={count:Ln("count",[{name:"options",type:Oo}]),derive:Ln("derive",[{name:"values",type:d0},{name:"options",type:Oo,props:{before:oc,after:oc}}]),filter:Ln("filter",[{name:"criteria",type:d0}]),groupby:Ln("groupby",[{name:"keys",type:fa}]),orderby:Ln("orderby",[{name:"keys",type:L3}]),relocate:Ln("relocate",[{name:"columns",type:oc},{name:"options",type:Oo,props:{before:oc,after:oc}}]),rename:Ln("rename",[{name:"columns",type:oc}]),rollup:Ln("rollup",[{name:"values",type:d0}]),sample:Ln("sample",[{name:"size",type:hie},{name:"options",type:Oo,props:{weight:die}}]),select:Ln("select",[{name:"columns",type:oc}]),ungroup:Ln("ungroup"),unorder:Ln("unorder"),reify:Ln("reify"),dedupe:Ln("dedupe",[{name:"keys",type:fa,default:[]}]),impute:Ln("impute",[{name:"values",type:d0},{name:"options",type:Oo,props:{expand:fa}}]),fold:Ln("fold",[{name:"values",type:fa},{name:"options",type:Oo}]),pivot:Ln("pivot",[{name:"keys",type:fa},{name:"values",type:fa},{name:"options",type:Oo}]),spread:Ln("spread",[{name:"values",type:fa},{name:"options",type:Oo}]),unroll:Ln("unroll",[{name:"values",type:fa},{name:"options",type:Oo,props:{drop:fa}}]),lookup:Ln("lookup",[{name:"table",type:Kf},{name:"on",type:ip},{name:"values",type:fa}]),join:Ln("join",[{name:"table",type:Kf},{name:"on",type:ip},{name:"values",type:UT},{name:"options",type:Oo}]),cross:Ln("cross",[{name:"table",type:Kf},{name:"values",type:UT},{name:"options",type:Oo}]),semijoin:Ln("semijoin",[{name:"table",type:Kf},{name:"on",type:ip}]),antijoin:Ln("antijoin",[{name:"table",type:Kf},{name:"on",type:ip}]),concat:Ln("concat",[{name:"tables",type:sp}]),union:Ln("union",[{name:"tables",type:sp}]),intersect:Ln("intersect",[{name:"tables",type:sp}]),except:Ln("except",[{name:"tables",type:sp}])};let B3=class bie extends Wee{constructor(t,n,r){super(n),this._verbs=t||[],this._table=r}static from({verbs:t,table:n,params:r}){return new bie(t.map(vie.from),r,n)}get[Symbol.toStringTag](){return this._verbs?`Query: ${this._verbs.length} verbs`+(this._table?` on '${this._table}'`:""):"Object"}get length(){return this._verbs.length}get tableName(){return this._table}params(t){return arguments.length?(this._params={...this._params,...t},this):this._params}evaluate(t,n){t=t||n(this._table);for(const r of this._verbs)t=r.evaluate(t.params(this._params),n);return t}toObject(){return KU(this,"toObject")}toJSON(){return this.toObject()}toAST(){return KU(this,"toAST",{type:CHe})}};function KU(e,t,n){return{...n,verbs:e._verbs.map(r=>r[t]()),...e._params?{params:e._params}:null,...e._table?{table:e._table}:null}}function KHe(e,t){return new B3(e._verbs.concat(t),e._params,e._table)}for(const e in yR){const t=yR[e];B3.prototype["__"+e]=function(n,...r){return KHe(n,t(...r))}}function tg(e,t,...n){const r=["_","$"],i=r.slice(0,n.length);return i.push('"use strict"; const '+n.map((s,o)=>s.map((a,u)=>`${r[o]}${u} = ${r[o]}[${u}]`).join(", ")).join(", ")+`; return (${e}) => ${t};`),Function(...i)(...n)}function QHe(e,t=[]){return e.groupby(t.length?t:e.columnNames()).filter("row_number() === 1").ungroup().reify()}function j3(e,t){const n=So();return t.forEach((r,i)=>{const s=Li(r)?r:i;if(s){const o=e.column(i)||jt(`Unrecognized column: ${i}`);n.add(s,o)}}),e.create(n)}function Eie(e,t,{before:n,after:r}={}){const i=n!=null,s=r!=null;i||s||jt("relocate requires a before or after option."),i&&s&&jt("relocate accepts only one of the before or after options."),t=Nl(e,t);const o=[...Nl(e,i?n:r).keys()],a=i?o[0]:o.pop(),u=new Map;return e.columnNames().forEach(l=>{const c=!t.has(l);if(l===a){s&&c&&u.set(l,l);for(const[f,d]of t)u.set(f,d);if(s)return}c&&u.set(l,l)}),j3(e,u)}function ev(e,t=r=>r,n=""){const r=e.length;if(!r)return"";let i=t(e[0],0);for(let s=1;st?1:e>=t?0:NaN}function XHe(e,t=0,n=e.length){let r=n?e[t++]:dn;for(let i=t;ie[i]&&(r=e[i]);return r}function JHe(e,t=0,n=e.length){let r=n?e[t++]:dn;for(let i=t;i=1)return w1(e[n-1]);const r=(n-1)*t,i=Math.floor(r),s=w1(e[i]);return My(s)?s:s+(w1(e[i+1])-s)*(r-i)}class eWe{constructor(t){this._values=t||[],this._sorted=null,this._start=0}values(t){return this._start&&(this._values=this._values.slice(this._start),this._start=0),t?this._values.slice():this._values}add(t){this._values.push(t),this._sorted=null}rem(){this._start+=1,this._sorted=null}min(){return this._sorted&&this._sorted.length?this._sorted[0]:XHe(this._values,this._start)}max(){return this._sorted&&this._sorted.length?this._sorted[this._sorted.length-1]:JHe(this._values,this._start)}quantile(t){return this._sorted||(this._sorted=this.values(!0),this._sorted.sort(U3)),ZHe(this._sorted,t)}}const VT=(e,t,n)=>tg(t,"{"+ev(e,(r,i)=>`_${i}.${n}(${t});`)+"}",e);function tWe(e,t){const{ops:n,output:r}=nWe(e,t),i=e[0].fields,s=i.length,o=s===0?V3:s===1?rWe:s===2?iWe:jt("Unsupported field count: "+s);return new o(i,n,r,t)}function nWe(e,t){const n={},r=[];function i(o,a=[]){const u=o+":"+a;if(n[u])return n[u];const l=dte(o),c=l.create(...a);return t<0&&l.stream&&l.stream.forEach(f=>i(f,[])),l.req&&l.req.forEach(f=>i(f,[])),n[u]=c,r.push(c),c}const s=e.map(o=>{const a=i(o.name,o.params);return a.output=o.id,a});return{ops:r,output:s}}class V3 extends aze{constructor(t,n,r,i){super(r),this._op=n,this._fields=t,this._stream=!!i}init(){const t={count:0,valid:0,stream:this._stream};return this._op.forEach(n=>n.init(t)),t.values&&(t.list=new eWe),t}write(t,n,r){const i=this._outputs,s=i.length;for(let o=0;os[a][i[u]]:a=>s[a][0];n=n.map(a=>u=>a(u,r,o))}return n}function ng(e,t,n){if(!t.length)return n;const r=wie(t),i=e.groups(),s=i?i.size:1;return n=n||zI(t.length,()=>Array(s)),s>1?r.forEach(o=>{const a=Sie(e,o,i);for(let u=0;u{const a=Tie(e,o);o.write(a,n,0)}),n}function wie(e,t){const n=[],r={};for(const i of e){const s=i.fields.map(o=>o+"").join(",");(r[s]||(r[s]=[])).push(i)}for(const i in r)n.push(tWe(r[i],t));return n}function Tie(e,t){const n=t.init(),r=e.totalRows(),i=e.data(),s=e.mask();if(e.isOrdered()){const o=e.indices();for(let a=0;a=0;o=s.next(o+1))t.add(n,o,i);else for(let o=0;ot.init()),o=e.data();if(e.isOrdered()){const a=e.indices(),u=a.length;for(let l=0;l=0;u=a.next(u+1))t.add(s[r[u]],u,o)}else{const a=e.totalRows();for(let u=0;u>>1;e(t[s],n)<0?r=s+1:i=s}return r},right(t,n,r,i){for(r==null&&(r=0),i==null&&(i=t.length);r>>1;e(t[s],n)>0?i=s:r=s+1}return r}}}const QU=xie(U3);function sWe(e,t,n,r,i){let s,o,a,u,l;const c=m=>o[m-1]===o[m],f=r.length,d=i.length,h=r.length?tg(["w","r","k"],"{"+ev(r,(m,y)=>`r[_${y}.id][k]=_${y}.value(w,_${y}.get);`)+"}",r):()=>{},p={i0:0,i1:0,index:0,size:0,peer:c,init(m,y,g,_){p.index=p.i0=p.i1=0,p.size=y.length,s=m,o=y,u=g,l=_,a=i?i.map(b=>b.init()):null;for(let b=0;b0&&c(p.i0)&&(p.i0=QU.left(o,o[p.i0])),p.i1<_&&c(p.i1)&&(p.i1=QU.right(o,o[p.i1-1])));for(let I=0;I(e.frame||[null,null]).map(t=>Number.isFinite(t)?Math.abs(t):null),aWe=e=>!!e.peers;function uWe(e){const{id:t,name:n,fields:r=[],params:i=[]}=e,s=hte(n).create(...i);return r.length&&(s.get=r[0]),s.id=t,s}function lWe(e,t,n,r={},i){const s=e.data(),o=cWe(i,s),a=o.length,u=tg(["r","d","op"],"{"+ev(t,(l,c)=>`_${c}[r] = $${c}(r, d, op);`)+"}",t,n);e.partitions().forEach((l,c)=>{const f=l.length,d=fWe(e,l);for(let p=0;pr[p][c];for(let p=0;p{const i=oWe(r),s=aWe(r),o=`${i},${s}`,{aggOps:a,winOps:u}=n[o]||(n[o]={frame:i,peers:s,aggOps:[],winOps:[]});I$(r.name)?a.push(r):u.push(uWe(r))}),Object.values(n).map(r=>sWe(t,r.frame,r.peers,r.winOps,wie(r.aggOps,r.frame[0]!=null?-1:1)))}function fWe(e,t){if(e.isOrdered()){const n=e.comparator(),r=e.data(),i=t.length,s=new Uint32Array(i);for(let o=1,a=0;oo.add(d,Array(s))),[u,l]=hWe(r),c=e.isGrouped()?e.groups().size:1,f=ng(e,u,zI(r.length,()=>Array(c)));return l.length?lWe(e,a,n,f,l):pWe(e,a,n,f),e.create(o)}function hWe(e){const t=[],n=[],r=e.length;for(let i=0;ir[l][o[c]]:l=>r[l][0],u=t.length;for(let l=0;l=0;d=i.next(d+1))f[d]=c(d,s,a);else{const d=e.totalRows();for(let h=0;h!e.column(i)),n)}function gWe(e,t){if(t.length===0)return e;const n=e.columnNames();return t.reduce((r,i)=>r.antijoin(i.select(n)),e).dedupe()}const T1=2147483648,yWe=4294967295;class Cie{constructor(t){this._size=t,this._bits=new Uint32Array(Math.ceil(t/32))}get length(){return this._size}count(){const t=this._bits.length;let n=0;for(let r=0;r>5]&T1>>>t}set(t){this._bits[t>>5]|=T1>>>t}clear(t){this._bits[t>>5]&=~(T1>>>t)}scan(t){for(let n=this.next(0);n>=0;n=this.next(n+1))t(n)}next(t){const n=this._bits,r=n.length;let i=t>>5,s=n[i]&yWe>>>t;for(;i=0;)n=this.next(n+1);return n}not(){const t=this._bits,n=t.length;for(let i=0;i>r-1),this}and(t){if(t){const n=this._bits,r=t._bits,i=n.length;for(let s=0;s=0;o=r.next(o+1))t(o,i)&&s.set(o);else for(let o=0;oi[s]}return _We(e,r)}function Aie(e,{names:t=[],exprs:n=[],ops:r=[]},i={}){if(!t.length)return e;const s=i.limit>0?+i.limit:1/0,o=i.index?i.index===!0?"index":i.index+"":null,a=new Set(i.drop),u=lh(e,r,n),l=So(),c=new Set(t),f=[],d=[],h=[];e.columnNames().forEach(T=>{if(!a.has(T)){const I=l.add(T,[]);c.has(T)||(f.push(e.column(T)),d.push(I))}}),t.forEach(T=>{a.has(T)||(l.has(T)||l.add(T,[]),h.push(l.data[T]))});const p=o?l.add(o,[]):null;let m=0;const y=f.length,g=h.length,_=(T,I)=>{for(let E=0;E{for(let E=0;E{};if(g===1){const T=u[0],I=h[0];e.scan((E,S)=>{const A=Vs(T(E,S)),P=Math.min(A.length,s);_(E,P);for(let V=0;V{let E=0;const S=u.map(A=>{const P=Vs(A(T,I));return E=Math.min(Math.max(E,P.length),s),P});_(T,E);for(let A=0;At,(u,l)=>a.map(c=>c(u,l))]},{...i,drop:t})}function Ra(e,t,n,r={window:!1}){const i=new Map,s=o=>{o=cs(o)?t.columnName(o):o,Li(o)?i.set(o,jd(o)):er(o)?Nl(t,o).forEach(s):Xi(o)?gre(i,o):jt(`Invalid ${e} value: ${o+""}`)};return Vs(n).forEach(s),r.preparse&&r.preparse(i),Hs(i,{table:t,...r})}function EWe(e,t,n){return bWe(e,Ra("fold",e,t),n)}function XU(e,t,n,r){const i=n&&n.length;return wWe(i?TWe(e,n,r):e,t,i)}function wWe(e,{names:t,exprs:n,ops:r},i){const s=lh(e,r,n),o=i?null:So(e),a=e.totalRows();return t.forEach((u,l)=>{const c=e.column(u),f=i?c.data:o.add(u,Array(a)),d=s[l];e.scan(h=>{const p=c.get(h);f[h]=Ea(p)?p:d(h)})}),i?e:e.create(o)}function TWe(e,t,n){const r=e.groups(),i=e.data(),s=(r?r.names:[]).concat(t),o=(r?r.get:[]).concat(t.map(p=>e.getter(p))),a=new Set,u=ET(o);e.scan((p,m)=>a.add(u(p,m)));const l=e.columnNames(),c=So(),f=l.map(p=>c.add(p,[]));l.forEach((p,m)=>{const y=i[p],g=f[m];e.scan(_=>g.push(y.get(_)))});const d=ET(o.map((p,m)=>y=>y[m])),h=tg("v","{"+f.map((p,m)=>`_${m}.push(v[$${m}]);`).join("")+"}",f,l.map(p=>s.indexOf(p)));if(r){let p=r.keys.length;const m=n.reduce((g,_)=>g*_.length,r.size),y=new Uint32Array(m+(p-a.size));y.set(r.keys),JU(r,n,(g,_)=>{a.has(d(g))||(h(g),y[p++]=_[0])}),c.groupby({...r,keys:y})}else JU(r,n,p=>{a.has(d(p))||h(p)});return e.create(c.new())}function JU(e,t,n){const r=e?e.get.length:0,i=e?1:0,s=i+t.length,o=new Int32Array(s),a=new Int32Array(s),u=[];if(e){const{get:c,rows:f,size:d}=e;o[0]=d,u.push((h,p)=>{const m=f[p];for(let y=0;y{const d=f+r;o[f+i]=c.length,u.push((h,p)=>h[d]=c[p])});const l=Array(r+t.length);for(let c=0;c=0;){const f=++a[c];fr[u][l],a=e.length;for(let u=0;u1){const c=i.add(e[u],Array(s));for(let f=0;fe.column(r)?0:jt(`Invalid impute column ${Ou(r)}`)),n.expand){const r={preparse:xWe,aggronly:!0},i=Ra("impute",e,n.expand,r),s=H3(e.ungroup(),i);return XU(e,t,i.names,i.names.map(o=>s.get(o,0)))}else return XU(e,t)}function xWe(e){e.forEach((t,n)=>t.field?e.set(n,ete(t+"")):0)}function CWe(e,t){const n=e.columnNames();return t.length?t.reduce((r,i)=>r.semijoin(i.select(n)),e).dedupe():e.reify([])}function Oie(e,t){const n=new Map;return e.scan((r,i)=>{const s=t(r,i);s!=null&&s===s&&n.set(s,r)}),n}function AWe(e,t,n){const r=new Map,i=e.length;for(let s=0;s`_${i}.push($${i}(${n}));`)+"}",e,t)}function PWe(e,t,n,{names:r,exprs:i},s={}){const o=e.data(),a=e.indices(!1),u=a.length,l=new Int32Array(u),c=t.data(),f=t.indices(!1),d=f.length,h=new Int32Array(d),p=r.length,m=So(),y=Array(p),g=Array(p);for(let T=0;T=c?(f=r,d=t,h=a,p=s,m=i,y=n,g=u,_=o):(f=i,d=n,h=u,p=o,m=r,y=t,g=a,_=s,b=(E,S,A,P)=>e(A,P,E,S));const T=AWe(_,m,y),I=p.length;for(let E=0;E{s=cs(s)?t.columnName(s):s,Li(s)?r.set(o,jd(s)):er(s)||Xi(s)&&s.expr?r.set(o,s):jt(`Invalid ${e} key value: ${s+""}`)});const i=Hs(r,{table:t,aggregate:!1,window:!1});return ET(i.exprs,!0)}function kWe(e,t){const n=new Set(t);return e.filter(r=>n.has(r))}function W3(e,t,n){if(n)Li(n)?n=[n,n]:yn(n)&&n.length===1&&(n=[n[0],n[0]]);else{const r=kWe(e.columnNames(),t.columnNames());r.length||jt("Natural join requires shared column names."),n=[r,r]}return n}function Pie(e,t,n,r){return n.length!==r.length&&jt("Mismatched number of join keys"),[zT("join",e,n),zT("join",t,r)]}const DWe={aggregate:!1,window:!1},$We={...DWe,index:1};function ZU(e,t,n,r,i={}){n=W3(e,t,n);const s={join:[e,t]};let o;if(yn(n)){const[a,u]=n.map(Vs);o=Pie(e,t,a,u),r||(r=LWe(e,a,u,i))}else o=Hs({on:n},s).exprs[0],r||(r=[ym(),ym()]);return PWe(e,t,o,MWe(e,t,r,s,i&&i.suffix),i)}function LWe(e,t,n,r){const i=[];t.forEach((o,a)=>Li(o)&&o===n[a]?i.push(o):0);const s=_re(i);if(r.left&&r.right){const o=new Set(i);return[e.columnNames().map(a=>{const u=`[${Ou(a)}]`;return o.has(a)?{[a]:`(a, b) => a${u} == null ? b${u} : a${u}`}:a}),s]}return r.right?[s,ym()]:[ym(),s]}function MWe(e,t,n,r,i=[]){if(yn(n)){let s,o,a,u=n.length;s=o=a={names:[],exprs:[]},u--&&(s=Ra("join",e,n[0],r)),u--&&(o=Ra("join",t,n[1],$We)),u--&&(a=Hs(n[2],r));const l=new Set,c=new Set(s.names);return o.names.forEach(f=>{c.has(f)&&l.add(f)}),l.size&&(eV(s.names,l,i[0]||"_1"),eV(o.names,l,i[1]||"_2")),{names:s.names.concat(o.names,a.names),exprs:s.exprs.concat(o.exprs,a.exprs)}}else return Hs(n,r)}function eV(e,t,n){e.forEach((r,i)=>t.has(r)?e[i]=r+n:0)}function FWe(e,t,n,r={}){const i=new Cie(e.totalRows());return(yn(n)?BWe:jWe)(i,e,t,n),r.anti&&i.not().and(e.mask()),e.create({filter:i})}function BWe(e,t,n,[r,i]){const s=Oie(n,i);t.scan((o,a)=>{s.get(r(o,a))>=0&&e.set(o)})}function jWe(e,t,n,r){const i=t.numRows(),s=n.numRows(),o=t.data(),a=n.data();if(t.isFiltered()||n.isFiltered()){const u=t.indices(!1),l=n.indices(!1);for(let c=0;ca.add(d,Array(u).fill(dn)));const l=Oie(t,r),c=tg(["lr","rr","data"],"{"+ev(i,(d,h)=>`_[${h}][lr] = $[${h}](rr, data);`)+"}",i.map(d=>a.data[d]),lh(t,o,s)),f=t.data();return e.scan((d,h)=>{const p=l.get(n(d,h));p>=0&&c(d,p,f)}),e.create(a)}function VWe(e,t,n,r){return n=W3(e,t,n),UWe(e,t,[zT("lookup",e,n[0]),zT("lookup",t,n[1])],Ra("lookup",t,r))}const _R=(e,t)=>e??t;function zWe(e,t,n,r={}){const{keys:i,keyColumn:s}=HWe(e,t,r),o=_R(r.valueSeparator,"_"),a=n.names.length>1?(l,c)=>c+o+i[l]:l=>i[l],u=i.map(l=>ng(e,n.ops.map(c=>{if(c.name==="count"){const d=h=>l===s[h]?1:NaN;return d.toString=()=>l+":1",{...c,name:"sum",fields:[d]}}const f=c.fields.map(d=>{const h=(p,m)=>l===s[p]?d(p,m):NaN;return h.toString=()=>l+":"+d,h});return{...c,fields:f}})));return e.create(WWe(n,a,e.groups(),u))}function HWe(e,t,n){const r=n.limit>0?+n.limit:1/0,i=_R(n.sort,!0),s=_R(n.keySeparator,"_"),o=lh(e,t.ops,t.exprs),a=o.length===1?o[0]:(f,d)=>o.map(h=>h(f,d)).join(s),u=Array(e.totalRows());e.scan((f,d)=>u[f]=a(f,d));const l=ng(e.ungroup(),[{id:0,name:"array_agg_distinct",fields:[f=>u[f]],params:[]}])[0][0],c=i?l.sort():l;return{keys:Number.isFinite(r)?c.slice(0,r):c,keyColumn:u}}function WWe({names:e,exprs:t},n,r,i){const s=r?r.size:1,o=So(),a=i.length,u=e.length;let l;const c=(f,d)=>l[f][d];r&&Iie(o,r);for(let f=0;f1)for(let h=0;ht.field?e.set(n,Xee(t+"")):0)}function GWe(e,t){const n=new Map;return e.columnNames(r=>(n.set(r,r),0)),j3(e,Nl(e,t,n))}function nV(e,t){return H3(e,Hs(t,{table:e,aggronly:!0,window:!1}))}function KWe(e,t,n,r){return(t?r?XWe:QWe:r?ZWe:JWe)(e.length,e,n,r)}function QWe(e,t,n){const r=n.length;for(let i=0;i=r)return n;for(let i=0;i=i)return n;const s=new Float32Array(i),o=new Uint32Array(i);for(let a=0;as[a]-s[u]);for(let a=0;a{let d=t(f);return a+=d=i?d:Math.min(c.length,d),d});const u=new Uint32Array(a);let l=0;return o.forEach((c,f)=>{const d=t[f],h=u.subarray(l,l+=d);!i&&d===c.length?h.set(c):KWe(h,i,c,n)}),s!==!1&&(o.length>1||!i)&&eqe(u),e.reify(u)}function nqe(e,t,n={}){return tqe(e,rqe(e,t),iqe(e,n.weight),n)}const Rie=e=>t=>e.get(t)||0;function rqe(e,t){return cs(t)?()=>t:Rie(H3(e,Hs({size:t},{table:e,window:!1})).column("size"))}function iqe(e,t){return t==null?null:(t=cs(t)?e.columnName(t):t,Rie(Li(t)?e.column(t):z3(e,Hs({w:t},{table:e}),{drop:!0}).column("w")))}function sqe(e,t){return j3(e,Nl(e,t))}function oqe(e,{names:t,exprs:n,ops:r=[]},i={}){if(t.length===0)return e;const s=t.length===1&&i.as||[],o=i.drop==null?!0:!!i.drop,a=i.limit==null?s.length||1/0:Math.max(1,+i.limit||1),u=lh(e,r,n),l=So(),c=t.reduce((d,h,p)=>d.set(h,p),new Map),f=(d,h)=>{const p=aqe(e,u[d],a),m=p.length;for(let y=0;y{c.has(d)?(o||l.add(d,e.column(d)),f(c.get(d),d),c.delete(d)):l.add(d,e.column(d))}),c.forEach(f),e.create(l)}function aqe(e,t,n){const r=e.totalRows(),i=[];return e.scan((s,o)=>{const a=Vs(t(s,o)),u=Math.min(a.length,n);for(;i.length=0;h=d.next(h+1)){const p=o(h,f)+"",m=l[p];u[h]=m??(l[p]=c.push(h)-1)}else for(let h=0;hp=>h(p,f))),{keys:u,get:s,names:t,rows:c,size:c.length}}function hqe(e,t){return fqe(e,Ra("groupby",e,t))}function pqe(e,t){return e.create({order:t})}const mqe=(e,t,n,r)=>`((u = ${e}) < (v = ${t}) || u == null) && v != null ? ${n} +`;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return cf(this.readCodePoint());case 116:return" ";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),e){var n=this.pos-1;this.invalidStringToken(n,"Invalid escape sequence in template string")}default:if(t>=48&&t<=55){var r=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],i=parseInt(r,8);return i>255&&(r=r.slice(0,-1),i=parseInt(r,8)),this.pos+=r.length-1,t=this.input.charCodeAt(this.pos),(r!=="0"||t===56||t===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-r.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(i)}return Jm(t)?"":String.fromCharCode(t)}};Jt.readHexChar=function(e){var t=this.pos,n=this.readInt(16,e);return n===null&&this.invalidStringToken(t,"Bad character escape sequence"),n};Jt.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,n=this.pos,r=this.options.ecmaVersion>=6;this.pos(t,n)=>n.error(t,e+" not allowed"),tHe=Si("Aggregate function"),nHe=Si("Window function"),rHe="Invalid argument",D3="Invalid column reference",iHe=D3+" (must be input to an aggregate function)",tie="Invalid function call",sHe="Invalid member expression",oHe="Invalid operator parameter",aHe="Invalid param reference",uHe="Invalid variable reference",lHe="Variable not accessible in operator call",cHe="Unsupported variable declaration",fHe="Unsupported destructuring pattern",nie="Table expressions do not support closures",rie="Use aq.escape(fn) to use a function as-is (including closures)",dHe="use table.params({ name: value }) to define dynamic parameters",hHe="use aq.addFunction(name, fn) to add new op functions",pHe=` +Note: ${nie}. ${rie}, or ${dHe}.`,iie=` +Note: ${nie}. ${rie}, or ${hHe}.`,mHe=`The ${pte} method is not valid in multi-table expressions.`;function gHe(e,t){const n=yHe(t);let r=e.root=n;return e.spec=t,e.tuple=null,e.tuple1=null,e.tuple2=null,e.$param=null,e.$op=0,e.scope=new Set,e.paramsRef=new Map,e.columnRef=new Map,cze(r)?(vHe(r,e),r=r.body):e.join?(e.scope.add(e.tuple1=Zze),e.scope.add(e.tuple2=eHe),e.scope.add(e.$param=HU)):(e.scope.add(e.tuple=Jze),e.scope.add(e.$param=HU)),cn(r,e,$3),e.root}function yHe(e){try{const t=e.field?_He(e):yn(e)?Ou(e):e;return Qze(`expr=(${t})`,Xze).body[0].expression.right}catch{jt(`Expression parse error: ${e+""}`)}}function _He(e){const t=JSON.stringify(e+"");return e.table?`(a,b)=>b[${t}]`:`d=>d[${t}]`}const $3={FunctionDeclaration:Si("Function definitions"),ForStatement:Si("For loops"),ForOfStatement:Si("For-of loops"),ForInStatement:Si("For-in loops"),WhileStatement:Si("While loops"),DoWhileStatement:Si("Do-while loops"),AwaitExpression:Si("Await expressions"),ArrowFunctionExpression:Si("Function definitions"),AssignmentExpression:Si("Assignments"),FunctionExpression:Si("Function definitions"),NewExpression:Si('Use of "new"'),UpdateExpression:Si("Update expressions"),VariableDeclarator(e,t){gR(e.id,t)},Identifier(e,t,n){aie(e,t,n)&&!t.scope.has(e.name)&&t.error(e,uHe,pHe)},CallExpression(e,t){const n=sie(e.callee),r=fte(n)||dte(n);if(r){if((t.join||t.aggregate===!1)&&I$(n)&&tHe(e,t),(t.join||t.window===!1)&&x$(n)&&nHe(e,t),t.$op=1,t.ast)mR(e,n,t),e.arguments.forEach(i=>cn(i,t,pR));else{const i=t.op(bHe(t,r,n,e.arguments));Object.assign(e,{type:ote,name:i.id})}return t.$op=0,!1}else cte(n)?mR(e,n,t):t.error(e,tie,iie)},MemberExpression(e,t,n){const{object:r,property:i}=e;if(!Kr(Hc,r))return;const{name:s}=r;if(oie(e)&&Kr(Hc,i)&&Pa(k3,i.name)){cie(e,i.name);return}const o=s===t.tuple?0:s===t.tuple1?1:s===t.tuple2?2:-1;if(o>=0)return WU(e,o,t,uie,n);if(s===t.$param)return WU(e,o,t,wHe);t.paramsRef.has(s)?Wy(e,t.paramsRef.get(s)):t.columnRef.has(s)?lie(r,s,t,e):Pa(t.params,s)&&Wy(r,s)}};function WU(e,t,n,r,i){const{property:s,computed:o}=e;let a;if(!o)a=s.name;else if(Kr(Gm,s))a=s.value;else try{cn(s,n,$3,e),a=n.param(s)}catch{n.error(e,sHe)}return r(e,a,t,n,i),!1}const pR={...$3,VariableDeclarator:Si("Variable declaration in operator call"),Identifier(e,t,n){aie(e,t,n)&&t.error(e,lHe)},CallExpression(e,t){const n=sie(e.callee);cte(n)?mR(e,n,t):t.error(e,tie,iie)}};function vHe(e,t){e.generator&&Si("Generator functions")(e,t),e.async&&Si("Async functions")(e,t);const{params:n}=e,r=n.length,i=o=>(a,u)=>t.columnRef.set(a,[u,o]),s=(o,a)=>t.paramsRef.set(o,a);r&&(t.join?(Wg(t,n[0],"tuple1",i(1)),r>1&&Wg(t,n[1],"tuple2",i(2)),r>2&&Wg(t,n[2],"$param",s)):(Wg(t,n[0],"tuple",i(0)),r>1&&Wg(t,n[1],"$param",s))),t.root=e.body}function Wg(e,t,n,r){Kr(Hc,t)?(e.scope.add(t.name),e[n]=t.name):Kr(ite,t)&&t.properties.forEach(i=>{const s=Kr(Hc,i.key)?i.key.name:Kr(Gm,i.key)?i.key.value:e.error(i,rHe);Kr(Hc,i.value)||e.error(i.value,fHe),r(i.value.name,s)})}function bHe(e,t,n,r){const i=[],s=[],o=t.param[0]||0,a=o+(t.param[1]||0);return r.forEach((u,l)=>{l0?r.join[n-1]:null,o=s&&s.column(t);s&&!o&&r.error(e,D3),r.aggronly&&!r.$op&&r.error(e,iHe),hte(e,t,n,o,i)}function lie(e,t,n,r){const[i,s]=n.columnRef.get(t);uie(e,i,s,n,r)}function wHe(e,t,n,r){r.params&&!Pa(r.params,t)&&r.error(e,aHe),Wy(e,t)}function Wy(e,t){e.type=hje,e.name=t}function cie(e,t){e.type=cje,e.name=t,e.raw=k3[t]}function mR(e,t,n){if(t===pte){const r=n.table;r||n.error(e,mHe),mte(e,e.arguments.length?e.arguments.map(i=>{const s=n.param(i),o=cs(s)?r.columnName(s):s;return r.column(o)||n.error(i,D3),o}):r.columnNames())}else e.callee={type:dje,name:t}}function gR(e,t){Kr(Hc,e)?t.scope.add(e.name):Kr(oje,e)?e.elements.forEach(n=>gR(n,t)):Kr(ite,e)?e.properties.forEach(n=>gR(n.value,t)):t.error(e.id,cHe)}const THe={[q_]:1,[ote]:1};function Hs(e,t={}){const n=t.generate||bT,r=t.compiler||C$,i=IHe(t),s={},o={},a=[],u=[];let l=0,c=-1;const f=t.join?r.join:t.index==1?r.expr2:r.expr,d={op(m){const y=SHe(m);return o[y]||(m.id=++c,o[y]=m)},field(m){const y=n(m);return s[y]||(s[y]=++l)},param(m){return Kr(Gm,m)?m.value:r.param(n(m),i)},value(m,y){a.push(m);const g=y.escape||(t.ast?lze(y):f(n(y),i));u.push(g),THe[y.type]&&g!==y&&Xi(g)&&(g.field=y.name)},error(m,y,g=""){const _=m.start-6,b=m.end-6,T=String(d.spec).slice(_,b);jt(`${y}: "${T}"${g}`)}};Object.assign(d,t,{params:i});for(const[m,y]of WI(e))d.value(m+"",y.escape?hze(d,y,i):gHe(d,y));if(t.ast)return{names:a,exprs:u};const h=[];for(const m in s)h[s[m]]=r.expr(m,i);const p=Object.values(o);return p.forEach(m=>m.fields=m.fields.map(y=>h[y])),{names:a,exprs:u,ops:p}}function SHe(e){let t=`${e.name}(${e.fields.concat(e.params).join(",")})`;if(e.frame){const n=e.frame.map(r=>Number.isFinite(r)?Math.abs(r):-1);t+=`[${n},${!!e.peers}]`}return t}function IHe(e){return(e.table?aO(e.table):e.join?{...aO(e.join[1]),...aO(e.join[0])}:{})||{}}function aO(e){return e&&er(e.params)?e.params():{}}const fie="Expr",fa="ExprList",die="ExprNumber",d0="ExprObject",ip="JoinKeys",UT="JoinValues",Oo="Options",L3="OrderKeys",oc="SelectionList",Kf="TableRef",sp="TableRefList",xHe="Descending",CHe="Query",AHe="Selection",OHe="Verb",PHe="Window";function lx(e,t){return e&&e.expr?new qU({...e,...t}):new qU(t,e)}class qU{constructor(t,n){this.expr=n,Object.assign(this,t)}toString(){return String(this.expr)}toObject(){return{...this,expr:this.toString(),...er(this.expr)?{func:!0}:{}}}}function RHe(e){return lx(e,{desc:!0})}function jd(e,t,n=0){const r=n?{field:!0,table:n}:{field:!0};return lx(e,t?{expr:t,...r}:r)}function NHe(e,t,n){return lx(e,{window:{frame:t||[-1/0,0],peers:!!n}})}function kHe(e){const t=n=>n;return t.toString=()=>e,t}function YU(e,t){return t=t&&er(t.query)?t.query():t,t&&er(t.evaluate)?t.evaluate(null,e):e(t)}function hie(e){return Xi(e)&&(yn(e.all)||yn(e.matches)||yn(e.not)||yn(e.range))}function qy(e){return e&&er(e.toObject)?e.toObject():er(e)?{expr:String(e),func:!0}:yn(e)?e.map(qy):Xi(e)?rx(e,t=>qy(t)):e}function M3(e){return yn(e)?e.map(M3):Xi(e)?yn(e.verbs)?B3.from(e):yn(e.all)?ym():yn(e.range)?ize(...e.range):yn(e.match)?sze(RegExp(...e.match)):yn(e.not)?yre(e.not.map(qy)):DHe(e):e}function DHe(e){let t=e,n=e.expr;if(n!=null){if(e.field===!0?t=n=jd(n):e.func===!0&&(t=n=kHe(n)),Xi(e.window)){const{frame:r,peers:i}=e.window;t=n=NHe(n,r,i)}e.desc===!0&&(t=RHe(n))}return e===t?rx(e,r=>M3(r)):t}function $He(e){return yn(e)?e.map(LHe):e}function LHe(e){const t=[];return Vs(e).forEach(n=>{cs(n)?t.push(n):Li(n)?t.push(jd(n,null)):Xi(n)&&n.expr||er(n)?t.push(n):jt(`Invalid key value: ${n+""}`)}),t}function MHe(e){return yn(e)?e.map(FHe):e}function FHe(e,t){return t<2?Vs(e):e}function BHe(e){const t=[];return e.forEach(n=>{const r=n.expr!=null?n.expr:n;if(Xi(r)&&!er(r))for(const i in r)t.push(r[i]);else n=cs(r)?r:Li(r)?jd(n):er(r)?n:jt(`Invalid orderby field: ${n+""}`),t.push(n)}),t}const jHe={[fie]:yie,[fa]:vm,[die]:qHe,[d0]:ff,[ip]:YHe,[UT]:GHe,[L3]:vm,[oc]:HHe};function UHe(e,t,n){return t===Kf?GU(e):t===sp?e.map(GU):pie(qy(e),t,n)}function pie(e,t,n){return t===Oo?e&&VHe(e,n):jHe[t](e)}function VHe(e,t={}){const n={};for(const r in e){const i=e[r];n[r]=t[r]?pie(i,t[r]):i}return n}function zHe(e,t){return Hs({expr:e},{...t,ast:!0}).exprs[0]}function F3(e){return{type:q_,name:e}}function mie(e){return{type:q_,index:e}}function ff(e,t){if(Li(e))return zHe(e,t);if(e.expr){let n;if(e.field===!0?n=F3(e.expr):e.func===!0&&(n=ff(e.expr,t)),n)return e.desc&&(n={type:xHe,expr:n}),e.window&&(n={type:PHe,expr:n,...e.window}),n}return Object.keys(e).map(n=>({...ff(e[n],t),as:n}))}function gie(e){const t=AHe;return e.all?{type:t,operator:"all"}:e.not?{type:t,operator:"not",arguments:vm(e.not)}:e.range?{type:t,operator:"range",arguments:vm(e.range)}:e.matches?{type:t,operator:"matches",arguments:e.matches}:jt("Invalid input")}function HHe(e){return Vs(e).map(WHe).flat()}function WHe(e){return hie(e)?gie(e):cs(e)?mie(e):Li(e)?F3(e):Xi(e)?Object.keys(e).map(t=>({type:q_,name:t,as:e[t]})):jt("Invalid input")}function yie(e){return hie(e)?gie(e):cs(e)?mie(e):Li(e)?F3(e):Xi(e)?ff(e):jt("Invalid input")}function vm(e){return Vs(e).map(yie).flat()}function qHe(e){return cs(e)?e:ff(e)}function YHe(e){return yn(e)?e.map(vm):ff(e,{join:!0})}function GHe(e){return yn(e)?e.map((t,n)=>n<2?vm(t):ff(t,{join:!0})):ff(e,{join:!0})}function GU(e){return e&&er(e.toAST)?e.toAST():e}class _ie{constructor(t,n=[],r=[]){this.verb=t,this.schema=n,n.forEach((i,s)=>{const o=i.type,a=r[s],u=o===ip?$He(a):o===UT?MHe(a):o===L3?BHe(a):a;this[i.name]=u!==void 0?u:i.default})}static from(t){const n=yR[t.verb],r=(n.schema||[]).map(({name:i})=>M3(t[i]));return n(...r)}evaluate(t,n){const r=this.schema.map(({name:i,type:s})=>{const o=this[i];return s===Kf?YU(n,o):s===sp?o.map(a=>YU(n,a)):o});return t[this.verb](...r)}toObject(){const t={verb:this.verb};return this.schema.forEach(({name:n})=>{t[n]=qy(this[n])}),t}toAST(){const t={type:OHe,verb:this.verb};return this.schema.forEach(({name:n,type:r,props:i})=>{t[n]=UHe(this[n],r,i)}),t}}function Ln(e,t){return Object.assign((...n)=>new _ie(e,t,n),{schema:t})}const yR={count:Ln("count",[{name:"options",type:Oo}]),derive:Ln("derive",[{name:"values",type:d0},{name:"options",type:Oo,props:{before:oc,after:oc}}]),filter:Ln("filter",[{name:"criteria",type:d0}]),groupby:Ln("groupby",[{name:"keys",type:fa}]),orderby:Ln("orderby",[{name:"keys",type:L3}]),relocate:Ln("relocate",[{name:"columns",type:oc},{name:"options",type:Oo,props:{before:oc,after:oc}}]),rename:Ln("rename",[{name:"columns",type:oc}]),rollup:Ln("rollup",[{name:"values",type:d0}]),sample:Ln("sample",[{name:"size",type:die},{name:"options",type:Oo,props:{weight:fie}}]),select:Ln("select",[{name:"columns",type:oc}]),ungroup:Ln("ungroup"),unorder:Ln("unorder"),reify:Ln("reify"),dedupe:Ln("dedupe",[{name:"keys",type:fa,default:[]}]),impute:Ln("impute",[{name:"values",type:d0},{name:"options",type:Oo,props:{expand:fa}}]),fold:Ln("fold",[{name:"values",type:fa},{name:"options",type:Oo}]),pivot:Ln("pivot",[{name:"keys",type:fa},{name:"values",type:fa},{name:"options",type:Oo}]),spread:Ln("spread",[{name:"values",type:fa},{name:"options",type:Oo}]),unroll:Ln("unroll",[{name:"values",type:fa},{name:"options",type:Oo,props:{drop:fa}}]),lookup:Ln("lookup",[{name:"table",type:Kf},{name:"on",type:ip},{name:"values",type:fa}]),join:Ln("join",[{name:"table",type:Kf},{name:"on",type:ip},{name:"values",type:UT},{name:"options",type:Oo}]),cross:Ln("cross",[{name:"table",type:Kf},{name:"values",type:UT},{name:"options",type:Oo}]),semijoin:Ln("semijoin",[{name:"table",type:Kf},{name:"on",type:ip}]),antijoin:Ln("antijoin",[{name:"table",type:Kf},{name:"on",type:ip}]),concat:Ln("concat",[{name:"tables",type:sp}]),union:Ln("union",[{name:"tables",type:sp}]),intersect:Ln("intersect",[{name:"tables",type:sp}]),except:Ln("except",[{name:"tables",type:sp}])};let B3=class vie extends Hee{constructor(t,n,r){super(n),this._verbs=t||[],this._table=r}static from({verbs:t,table:n,params:r}){return new vie(t.map(_ie.from),r,n)}get[Symbol.toStringTag](){return this._verbs?`Query: ${this._verbs.length} verbs`+(this._table?` on '${this._table}'`:""):"Object"}get length(){return this._verbs.length}get tableName(){return this._table}params(t){return arguments.length?(this._params={...this._params,...t},this):this._params}evaluate(t,n){t=t||n(this._table);for(const r of this._verbs)t=r.evaluate(t.params(this._params),n);return t}toObject(){return KU(this,"toObject")}toJSON(){return this.toObject()}toAST(){return KU(this,"toAST",{type:CHe})}};function KU(e,t,n){return{...n,verbs:e._verbs.map(r=>r[t]()),...e._params?{params:e._params}:null,...e._table?{table:e._table}:null}}function KHe(e,t){return new B3(e._verbs.concat(t),e._params,e._table)}for(const e in yR){const t=yR[e];B3.prototype["__"+e]=function(n,...r){return KHe(n,t(...r))}}function tg(e,t,...n){const r=["_","$"],i=r.slice(0,n.length);return i.push('"use strict"; const '+n.map((s,o)=>s.map((a,u)=>`${r[o]}${u} = ${r[o]}[${u}]`).join(", ")).join(", ")+`; return (${e}) => ${t};`),Function(...i)(...n)}function QHe(e,t=[]){return e.groupby(t.length?t:e.columnNames()).filter("row_number() === 1").ungroup().reify()}function j3(e,t){const n=So();return t.forEach((r,i)=>{const s=Li(r)?r:i;if(s){const o=e.column(i)||jt(`Unrecognized column: ${i}`);n.add(s,o)}}),e.create(n)}function bie(e,t,{before:n,after:r}={}){const i=n!=null,s=r!=null;i||s||jt("relocate requires a before or after option."),i&&s&&jt("relocate accepts only one of the before or after options."),t=Nl(e,t);const o=[...Nl(e,i?n:r).keys()],a=i?o[0]:o.pop(),u=new Map;return e.columnNames().forEach(l=>{const c=!t.has(l);if(l===a){s&&c&&u.set(l,l);for(const[f,d]of t)u.set(f,d);if(s)return}c&&u.set(l,l)}),j3(e,u)}function ev(e,t=r=>r,n=""){const r=e.length;if(!r)return"";let i=t(e[0],0);for(let s=1;st?1:e>=t?0:NaN}function XHe(e,t=0,n=e.length){let r=n?e[t++]:dn;for(let i=t;ie[i]&&(r=e[i]);return r}function JHe(e,t=0,n=e.length){let r=n?e[t++]:dn;for(let i=t;i=1)return w1(e[n-1]);const r=(n-1)*t,i=Math.floor(r),s=w1(e[i]);return My(s)?s:s+(w1(e[i+1])-s)*(r-i)}class eWe{constructor(t){this._values=t||[],this._sorted=null,this._start=0}values(t){return this._start&&(this._values=this._values.slice(this._start),this._start=0),t?this._values.slice():this._values}add(t){this._values.push(t),this._sorted=null}rem(){this._start+=1,this._sorted=null}min(){return this._sorted&&this._sorted.length?this._sorted[0]:XHe(this._values,this._start)}max(){return this._sorted&&this._sorted.length?this._sorted[this._sorted.length-1]:JHe(this._values,this._start)}quantile(t){return this._sorted||(this._sorted=this.values(!0),this._sorted.sort(U3)),ZHe(this._sorted,t)}}const VT=(e,t,n)=>tg(t,"{"+ev(e,(r,i)=>`_${i}.${n}(${t});`)+"}",e);function tWe(e,t){const{ops:n,output:r}=nWe(e,t),i=e[0].fields,s=i.length,o=s===0?V3:s===1?rWe:s===2?iWe:jt("Unsupported field count: "+s);return new o(i,n,r,t)}function nWe(e,t){const n={},r=[];function i(o,a=[]){const u=o+":"+a;if(n[u])return n[u];const l=fte(o),c=l.create(...a);return t<0&&l.stream&&l.stream.forEach(f=>i(f,[])),l.req&&l.req.forEach(f=>i(f,[])),n[u]=c,r.push(c),c}const s=e.map(o=>{const a=i(o.name,o.params);return a.output=o.id,a});return{ops:r,output:s}}class V3 extends aze{constructor(t,n,r,i){super(r),this._op=n,this._fields=t,this._stream=!!i}init(){const t={count:0,valid:0,stream:this._stream};return this._op.forEach(n=>n.init(t)),t.values&&(t.list=new eWe),t}write(t,n,r){const i=this._outputs,s=i.length;for(let o=0;os[a][i[u]]:a=>s[a][0];n=n.map(a=>u=>a(u,r,o))}return n}function ng(e,t,n){if(!t.length)return n;const r=Eie(t),i=e.groups(),s=i?i.size:1;return n=n||zI(t.length,()=>Array(s)),s>1?r.forEach(o=>{const a=Tie(e,o,i);for(let u=0;u{const a=wie(e,o);o.write(a,n,0)}),n}function Eie(e,t){const n=[],r={};for(const i of e){const s=i.fields.map(o=>o+"").join(",");(r[s]||(r[s]=[])).push(i)}for(const i in r)n.push(tWe(r[i],t));return n}function wie(e,t){const n=t.init(),r=e.totalRows(),i=e.data(),s=e.mask();if(e.isOrdered()){const o=e.indices();for(let a=0;a=0;o=s.next(o+1))t.add(n,o,i);else for(let o=0;ot.init()),o=e.data();if(e.isOrdered()){const a=e.indices(),u=a.length;for(let l=0;l=0;u=a.next(u+1))t.add(s[r[u]],u,o)}else{const a=e.totalRows();for(let u=0;u>>1;e(t[s],n)<0?r=s+1:i=s}return r},right(t,n,r,i){for(r==null&&(r=0),i==null&&(i=t.length);r>>1;e(t[s],n)>0?i=s:r=s+1}return r}}}const QU=Iie(U3);function sWe(e,t,n,r,i){let s,o,a,u,l;const c=m=>o[m-1]===o[m],f=r.length,d=i.length,h=r.length?tg(["w","r","k"],"{"+ev(r,(m,y)=>`r[_${y}.id][k]=_${y}.value(w,_${y}.get);`)+"}",r):()=>{},p={i0:0,i1:0,index:0,size:0,peer:c,init(m,y,g,_){p.index=p.i0=p.i1=0,p.size=y.length,s=m,o=y,u=g,l=_,a=i?i.map(b=>b.init()):null;for(let b=0;b0&&c(p.i0)&&(p.i0=QU.left(o,o[p.i0])),p.i1<_&&c(p.i1)&&(p.i1=QU.right(o,o[p.i1-1])));for(let I=0;I(e.frame||[null,null]).map(t=>Number.isFinite(t)?Math.abs(t):null),aWe=e=>!!e.peers;function uWe(e){const{id:t,name:n,fields:r=[],params:i=[]}=e,s=dte(n).create(...i);return r.length&&(s.get=r[0]),s.id=t,s}function lWe(e,t,n,r={},i){const s=e.data(),o=cWe(i,s),a=o.length,u=tg(["r","d","op"],"{"+ev(t,(l,c)=>`_${c}[r] = $${c}(r, d, op);`)+"}",t,n);e.partitions().forEach((l,c)=>{const f=l.length,d=fWe(e,l);for(let p=0;pr[p][c];for(let p=0;p{const i=oWe(r),s=aWe(r),o=`${i},${s}`,{aggOps:a,winOps:u}=n[o]||(n[o]={frame:i,peers:s,aggOps:[],winOps:[]});I$(r.name)?a.push(r):u.push(uWe(r))}),Object.values(n).map(r=>sWe(t,r.frame,r.peers,r.winOps,Eie(r.aggOps,r.frame[0]!=null?-1:1)))}function fWe(e,t){if(e.isOrdered()){const n=e.comparator(),r=e.data(),i=t.length,s=new Uint32Array(i);for(let o=1,a=0;oo.add(d,Array(s))),[u,l]=hWe(r),c=e.isGrouped()?e.groups().size:1,f=ng(e,u,zI(r.length,()=>Array(c)));return l.length?lWe(e,a,n,f,l):pWe(e,a,n,f),e.create(o)}function hWe(e){const t=[],n=[],r=e.length;for(let i=0;ir[l][o[c]]:l=>r[l][0],u=t.length;for(let l=0;l=0;d=i.next(d+1))f[d]=c(d,s,a);else{const d=e.totalRows();for(let h=0;h!e.column(i)),n)}function gWe(e,t){if(t.length===0)return e;const n=e.columnNames();return t.reduce((r,i)=>r.antijoin(i.select(n)),e).dedupe()}const T1=2147483648,yWe=4294967295;class xie{constructor(t){this._size=t,this._bits=new Uint32Array(Math.ceil(t/32))}get length(){return this._size}count(){const t=this._bits.length;let n=0;for(let r=0;r>5]&T1>>>t}set(t){this._bits[t>>5]|=T1>>>t}clear(t){this._bits[t>>5]&=~(T1>>>t)}scan(t){for(let n=this.next(0);n>=0;n=this.next(n+1))t(n)}next(t){const n=this._bits,r=n.length;let i=t>>5,s=n[i]&yWe>>>t;for(;i=0;)n=this.next(n+1);return n}not(){const t=this._bits,n=t.length;for(let i=0;i>r-1),this}and(t){if(t){const n=this._bits,r=t._bits,i=n.length;for(let s=0;s=0;o=r.next(o+1))t(o,i)&&s.set(o);else for(let o=0;oi[s]}return _We(e,r)}function Cie(e,{names:t=[],exprs:n=[],ops:r=[]},i={}){if(!t.length)return e;const s=i.limit>0?+i.limit:1/0,o=i.index?i.index===!0?"index":i.index+"":null,a=new Set(i.drop),u=lh(e,r,n),l=So(),c=new Set(t),f=[],d=[],h=[];e.columnNames().forEach(T=>{if(!a.has(T)){const I=l.add(T,[]);c.has(T)||(f.push(e.column(T)),d.push(I))}}),t.forEach(T=>{a.has(T)||(l.has(T)||l.add(T,[]),h.push(l.data[T]))});const p=o?l.add(o,[]):null;let m=0;const y=f.length,g=h.length,_=(T,I)=>{for(let E=0;E{for(let E=0;E{};if(g===1){const T=u[0],I=h[0];e.scan((E,S)=>{const A=Vs(T(E,S)),P=Math.min(A.length,s);_(E,P);for(let V=0;V{let E=0;const S=u.map(A=>{const P=Vs(A(T,I));return E=Math.min(Math.max(E,P.length),s),P});_(T,E);for(let A=0;At,(u,l)=>a.map(c=>c(u,l))]},{...i,drop:t})}function Ra(e,t,n,r={window:!1}){const i=new Map,s=o=>{o=cs(o)?t.columnName(o):o,Li(o)?i.set(o,jd(o)):er(o)?Nl(t,o).forEach(s):Xi(o)?mre(i,o):jt(`Invalid ${e} value: ${o+""}`)};return Vs(n).forEach(s),r.preparse&&r.preparse(i),Hs(i,{table:t,...r})}function EWe(e,t,n){return bWe(e,Ra("fold",e,t),n)}function XU(e,t,n,r){const i=n&&n.length;return wWe(i?TWe(e,n,r):e,t,i)}function wWe(e,{names:t,exprs:n,ops:r},i){const s=lh(e,r,n),o=i?null:So(e),a=e.totalRows();return t.forEach((u,l)=>{const c=e.column(u),f=i?c.data:o.add(u,Array(a)),d=s[l];e.scan(h=>{const p=c.get(h);f[h]=Ea(p)?p:d(h)})}),i?e:e.create(o)}function TWe(e,t,n){const r=e.groups(),i=e.data(),s=(r?r.names:[]).concat(t),o=(r?r.get:[]).concat(t.map(p=>e.getter(p))),a=new Set,u=ET(o);e.scan((p,m)=>a.add(u(p,m)));const l=e.columnNames(),c=So(),f=l.map(p=>c.add(p,[]));l.forEach((p,m)=>{const y=i[p],g=f[m];e.scan(_=>g.push(y.get(_)))});const d=ET(o.map((p,m)=>y=>y[m])),h=tg("v","{"+f.map((p,m)=>`_${m}.push(v[$${m}]);`).join("")+"}",f,l.map(p=>s.indexOf(p)));if(r){let p=r.keys.length;const m=n.reduce((g,_)=>g*_.length,r.size),y=new Uint32Array(m+(p-a.size));y.set(r.keys),JU(r,n,(g,_)=>{a.has(d(g))||(h(g),y[p++]=_[0])}),c.groupby({...r,keys:y})}else JU(r,n,p=>{a.has(d(p))||h(p)});return e.create(c.new())}function JU(e,t,n){const r=e?e.get.length:0,i=e?1:0,s=i+t.length,o=new Int32Array(s),a=new Int32Array(s),u=[];if(e){const{get:c,rows:f,size:d}=e;o[0]=d,u.push((h,p)=>{const m=f[p];for(let y=0;y{const d=f+r;o[f+i]=c.length,u.push((h,p)=>h[d]=c[p])});const l=Array(r+t.length);for(let c=0;c=0;){const f=++a[c];fr[u][l],a=e.length;for(let u=0;u1){const c=i.add(e[u],Array(s));for(let f=0;fe.column(r)?0:jt(`Invalid impute column ${Ou(r)}`)),n.expand){const r={preparse:xWe,aggronly:!0},i=Ra("impute",e,n.expand,r),s=H3(e.ungroup(),i);return XU(e,t,i.names,i.names.map(o=>s.get(o,0)))}else return XU(e,t)}function xWe(e){e.forEach((t,n)=>t.field?e.set(n,Zee(t+"")):0)}function CWe(e,t){const n=e.columnNames();return t.length?t.reduce((r,i)=>r.semijoin(i.select(n)),e).dedupe():e.reify([])}function Aie(e,t){const n=new Map;return e.scan((r,i)=>{const s=t(r,i);s!=null&&s===s&&n.set(s,r)}),n}function AWe(e,t,n){const r=new Map,i=e.length;for(let s=0;s`_${i}.push($${i}(${n}));`)+"}",e,t)}function PWe(e,t,n,{names:r,exprs:i},s={}){const o=e.data(),a=e.indices(!1),u=a.length,l=new Int32Array(u),c=t.data(),f=t.indices(!1),d=f.length,h=new Int32Array(d),p=r.length,m=So(),y=Array(p),g=Array(p);for(let T=0;T=c?(f=r,d=t,h=a,p=s,m=i,y=n,g=u,_=o):(f=i,d=n,h=u,p=o,m=r,y=t,g=a,_=s,b=(E,S,A,P)=>e(A,P,E,S));const T=AWe(_,m,y),I=p.length;for(let E=0;E{s=cs(s)?t.columnName(s):s,Li(s)?r.set(o,jd(s)):er(s)||Xi(s)&&s.expr?r.set(o,s):jt(`Invalid ${e} key value: ${s+""}`)});const i=Hs(r,{table:t,aggregate:!1,window:!1});return ET(i.exprs,!0)}function kWe(e,t){const n=new Set(t);return e.filter(r=>n.has(r))}function W3(e,t,n){if(n)Li(n)?n=[n,n]:yn(n)&&n.length===1&&(n=[n[0],n[0]]);else{const r=kWe(e.columnNames(),t.columnNames());r.length||jt("Natural join requires shared column names."),n=[r,r]}return n}function Oie(e,t,n,r){return n.length!==r.length&&jt("Mismatched number of join keys"),[zT("join",e,n),zT("join",t,r)]}const DWe={aggregate:!1,window:!1},$We={...DWe,index:1};function ZU(e,t,n,r,i={}){n=W3(e,t,n);const s={join:[e,t]};let o;if(yn(n)){const[a,u]=n.map(Vs);o=Oie(e,t,a,u),r||(r=LWe(e,a,u,i))}else o=Hs({on:n},s).exprs[0],r||(r=[ym(),ym()]);return PWe(e,t,o,MWe(e,t,r,s,i&&i.suffix),i)}function LWe(e,t,n,r){const i=[];t.forEach((o,a)=>Li(o)&&o===n[a]?i.push(o):0);const s=yre(i);if(r.left&&r.right){const o=new Set(i);return[e.columnNames().map(a=>{const u=`[${Ou(a)}]`;return o.has(a)?{[a]:`(a, b) => a${u} == null ? b${u} : a${u}`}:a}),s]}return r.right?[s,ym()]:[ym(),s]}function MWe(e,t,n,r,i=[]){if(yn(n)){let s,o,a,u=n.length;s=o=a={names:[],exprs:[]},u--&&(s=Ra("join",e,n[0],r)),u--&&(o=Ra("join",t,n[1],$We)),u--&&(a=Hs(n[2],r));const l=new Set,c=new Set(s.names);return o.names.forEach(f=>{c.has(f)&&l.add(f)}),l.size&&(eV(s.names,l,i[0]||"_1"),eV(o.names,l,i[1]||"_2")),{names:s.names.concat(o.names,a.names),exprs:s.exprs.concat(o.exprs,a.exprs)}}else return Hs(n,r)}function eV(e,t,n){e.forEach((r,i)=>t.has(r)?e[i]=r+n:0)}function FWe(e,t,n,r={}){const i=new xie(e.totalRows());return(yn(n)?BWe:jWe)(i,e,t,n),r.anti&&i.not().and(e.mask()),e.create({filter:i})}function BWe(e,t,n,[r,i]){const s=Aie(n,i);t.scan((o,a)=>{s.get(r(o,a))>=0&&e.set(o)})}function jWe(e,t,n,r){const i=t.numRows(),s=n.numRows(),o=t.data(),a=n.data();if(t.isFiltered()||n.isFiltered()){const u=t.indices(!1),l=n.indices(!1);for(let c=0;ca.add(d,Array(u).fill(dn)));const l=Aie(t,r),c=tg(["lr","rr","data"],"{"+ev(i,(d,h)=>`_[${h}][lr] = $[${h}](rr, data);`)+"}",i.map(d=>a.data[d]),lh(t,o,s)),f=t.data();return e.scan((d,h)=>{const p=l.get(n(d,h));p>=0&&c(d,p,f)}),e.create(a)}function VWe(e,t,n,r){return n=W3(e,t,n),UWe(e,t,[zT("lookup",e,n[0]),zT("lookup",t,n[1])],Ra("lookup",t,r))}const _R=(e,t)=>e??t;function zWe(e,t,n,r={}){const{keys:i,keyColumn:s}=HWe(e,t,r),o=_R(r.valueSeparator,"_"),a=n.names.length>1?(l,c)=>c+o+i[l]:l=>i[l],u=i.map(l=>ng(e,n.ops.map(c=>{if(c.name==="count"){const d=h=>l===s[h]?1:NaN;return d.toString=()=>l+":1",{...c,name:"sum",fields:[d]}}const f=c.fields.map(d=>{const h=(p,m)=>l===s[p]?d(p,m):NaN;return h.toString=()=>l+":"+d,h});return{...c,fields:f}})));return e.create(WWe(n,a,e.groups(),u))}function HWe(e,t,n){const r=n.limit>0?+n.limit:1/0,i=_R(n.sort,!0),s=_R(n.keySeparator,"_"),o=lh(e,t.ops,t.exprs),a=o.length===1?o[0]:(f,d)=>o.map(h=>h(f,d)).join(s),u=Array(e.totalRows());e.scan((f,d)=>u[f]=a(f,d));const l=ng(e.ungroup(),[{id:0,name:"array_agg_distinct",fields:[f=>u[f]],params:[]}])[0][0],c=i?l.sort():l;return{keys:Number.isFinite(r)?c.slice(0,r):c,keyColumn:u}}function WWe({names:e,exprs:t},n,r,i){const s=r?r.size:1,o=So(),a=i.length,u=e.length;let l;const c=(f,d)=>l[f][d];r&&Sie(o,r);for(let f=0;f1)for(let h=0;ht.field?e.set(n,Qee(t+"")):0)}function GWe(e,t){const n=new Map;return e.columnNames(r=>(n.set(r,r),0)),j3(e,Nl(e,t,n))}function nV(e,t){return H3(e,Hs(t,{table:e,aggronly:!0,window:!1}))}function KWe(e,t,n,r){return(t?r?XWe:QWe:r?ZWe:JWe)(e.length,e,n,r)}function QWe(e,t,n){const r=n.length;for(let i=0;i=r)return n;for(let i=0;i=i)return n;const s=new Float32Array(i),o=new Uint32Array(i);for(let a=0;as[a]-s[u]);for(let a=0;a{let d=t(f);return a+=d=i?d:Math.min(c.length,d),d});const u=new Uint32Array(a);let l=0;return o.forEach((c,f)=>{const d=t[f],h=u.subarray(l,l+=d);!i&&d===c.length?h.set(c):KWe(h,i,c,n)}),s!==!1&&(o.length>1||!i)&&eqe(u),e.reify(u)}function nqe(e,t,n={}){return tqe(e,rqe(e,t),iqe(e,n.weight),n)}const Pie=e=>t=>e.get(t)||0;function rqe(e,t){return cs(t)?()=>t:Pie(H3(e,Hs({size:t},{table:e,window:!1})).column("size"))}function iqe(e,t){return t==null?null:(t=cs(t)?e.columnName(t):t,Pie(Li(t)?e.column(t):z3(e,Hs({w:t},{table:e}),{drop:!0}).column("w")))}function sqe(e,t){return j3(e,Nl(e,t))}function oqe(e,{names:t,exprs:n,ops:r=[]},i={}){if(t.length===0)return e;const s=t.length===1&&i.as||[],o=i.drop==null?!0:!!i.drop,a=i.limit==null?s.length||1/0:Math.max(1,+i.limit||1),u=lh(e,r,n),l=So(),c=t.reduce((d,h,p)=>d.set(h,p),new Map),f=(d,h)=>{const p=aqe(e,u[d],a),m=p.length;for(let y=0;y{c.has(d)?(o||l.add(d,e.column(d)),f(c.get(d),d),c.delete(d)):l.add(d,e.column(d))}),c.forEach(f),e.create(l)}function aqe(e,t,n){const r=e.totalRows(),i=[];return e.scan((s,o)=>{const a=Vs(t(s,o)),u=Math.min(a.length,n);for(;i.length=0;h=d.next(h+1)){const p=o(h,f)+"",m=l[p];u[h]=m??(l[p]=c.push(h)-1)}else for(let h=0;hp=>h(p,f))),{keys:u,get:s,names:t,rows:c,size:c.length}}function hqe(e,t){return fqe(e,Ra("groupby",e,t))}function pqe(e,t){return e.create({order:t})}const mqe=(e,t,n,r)=>`((u = ${e}) < (v = ${t}) || u == null) && v != null ? ${n} : (u > v || v == null) && u != null ? ${r} : ((v = v instanceof Date ? +v : v), (u = u instanceof Date ? +u : u)) !== u && v === v ? ${n} - : v !== v && u === u ? ${r} : `;function gqe(e,t){const n=[],r=[],i=[];let s=null,o="0",a="0";e.isGrouped()&&(s=e.groups().keys,o="ka",a="kb");const{ops:u}=Hs(t,{table:e,value:(h,p)=>{if(n.push(h),p.escape){const m=y=>`fn[${i.length}](${y}, data)`;r.push([m("a"),m("b")]),i.push(p.escape)}else r.push([bT(p,{index:"a",op:o}),bT(p,{index:"b",op:a})])},window:!1}),l=ng(e,u),c=(h,p)=>l[h][p],f=n.length;let d="return (a, b) => {"+(c&&e.isGrouped()?"const ka = keys[a], kb = keys[b];":"")+"let u, v; return ";for(let h=0;hr.set(++n+"",s);return t.forEach(s=>{const o=s.expr!=null?s.expr:s;if(Xi(o)&&!er(o))for(const a in o)i(o[a]);else i(cs(o)?jd(s,e.columnName(o)):Li(o)?jd(s):er(o)?s:jt(`Invalid orderby field: ${s+""}`))}),gqe(e,r)}function vqe(e,t){const n=e.numRows(),r=n+t.reduce((o,a)=>o+a.numRows(),0);if(n===r)return e;const i=[e,...t],s=So();return e.columnNames().forEach(o=>{const a=Array(r);let u=0;i.forEach(l=>{const c=l.column(o)||{get:()=>dn};l.scan(f=>a[u++]=c.get(f))}),s.add(o,a)}),e.create(s.new())}function bqe(e,t){const n=So(),r=e.groups(),{get:i,names:s=[],rows:o,size:a=1}=r||{},u=new Uint32Array(a+1);s.forEach(d=>n.add(d,null));const l=r?Sie(e,t,r):[Tie(e,t)];t.outputs().map(d=>n.add(d,[]));const c=u.length-1;let f=0;for(let d=0;d{const m=n.data[h]=Array(f),y=i[p];for(let g=0,_=0;gtV(e,t,n,{anti:!0}),__count:(e,t={})=>nV(e,{[t.as||"count"]:Jee()}),__cross:(e,t,n,r)=>ZU(e,t,()=>!0,n,{...r,left:!0,right:!0}),__concat:vqe,__dedupe:QHe,__derive:mWe,__except:gWe,__filter:vWe,__fold:EWe,__impute:IWe,__intersect:CWe,__join:ZU,__lookup:VWe,__pivot:qWe,__relocate:Eie,__rename:GWe,__rollup:nV,__sample:nqe,__select:sqe,__semijoin:tV,__spread:uqe,__union:lqe,__unroll:cqe,__groupby:hqe,__orderby:yqe,__ungroup:Eqe,__unorder:wqe,__reduce:bqe};Object.assign(tl.prototype,Tqe);function Sqe(e,t){return tl.from(e,t)}function Iqe(e){return lx(e,{escape:!0,toString(){jt("Escaped values can not be serialized.")}})}tl.prototype;const ua={top:30,left:60,right:80,bottom:50};function Nie({data:e,selection:t,parameters:n}){const[r,{width:i,height:s}]=QW(),o=w.useMemo(()=>{const c=e.map(f=>({...f,value:+f[n.y_var]}));return Sqe(c)},[e,n]),a=w.useMemo(()=>{const c=Cp(o.filter(Iqe(f=>t.includes(f[n.cat_var]))).array("value"));return n.dataset==="clean_stocks"?c:[0,c[1]]},[o,t,n]),u=w.useMemo(()=>FI([ua.top,s-ua.bottom]).domain(Cp(o.array("value")).reverse()),[o,s]),l=n.dataset==="clean_stocks"?zc(".0%"):zc(",.0f");return(t==null?void 0:t.length)===0?null:$.jsxs("svg",{ref:r,style:{height:"400px",width:"60px",overflow:"visible"},children:[$.jsx("rect",{y:u(a[1]),height:u(a[0])-u(a[1]),x:ua.left-10,width:10,opacity:.1,fill:"black"}),$.jsx("text",{style:{fontSize:10,dominantBaseline:"middle",textAnchor:"middle",fontFamily:'"Helvetica Neue", Helvetica, Arial, sans-serif'},x:25,y:ua.top-5,children:l(u.domain()[0])}),$.jsx("text",{style:{fontSize:10,dominantBaseline:"middle",textAnchor:"middle",fontFamily:'"Helvetica Neue", Helvetica, Arial, sans-serif'},x:25,y:s-ua.bottom+8,children:l(u.domain()[1])}),$.jsx("text",{style:{fontSize:10,dominantBaseline:"middle",fontFamily:'"Helvetica Neue", Helvetica, Arial, sans-serif'},x:ua.left-5,y:u(a[0]),children:l(a[0])}),$.jsx("text",{style:{fontSize:10,dominantBaseline:"middle",fontFamily:'"Helvetica Neue", Helvetica, Arial, sans-serif'},x:ua.left-5,y:u(a[1]),children:l(a[1])}),e.map(c=>$.jsx("rect",{opacity:.2,fill:+c[n.y_var]>0?"steelblue":"firebrick",x:0,width:50,y:u(+c[n.y_var]),height:1},"strip")),$.jsx("line",{strokeWidth:2,stroke:"black",style:{fontSize:10,dominantBaseline:"middle"},x1:0,x2:50,y1:u(a[0]),y2:u(a[0])}),$.jsx("line",{strokeWidth:2,stroke:"black",x1:0,x2:50,y1:u(a[1]),y2:u(a[1])}),$.jsx("line",{strokeWidth:2,stroke:"black",x1:0,x2:0,y1:u(a[1]),y2:u(a[0])}),$.jsx("line",{strokeWidth:2,stroke:"black",x1:50,x2:50,y1:u(a[1]),y2:u(a[0])}),$.jsx("path",{fill:"black",opacity:"0.1",d:`M${ua.left}, ${u(a[1])} L ${i+20+33}, ${ua.top} L ${i+20+33}, ${s-ua.bottom} L ${ua.left}, ${u(a[0])}`})]})}const xqe=Object.freeze(Object.defineProperty({__proto__:null,StripPlot:Nie},Symbol.toStringTag,{value:"Module"}));function kie({parameters:e}){const t=e.dataset==="clean_data"?$.jsxs(HP,{children:["Select any subset of countries to the left of the visualization to support the prompt at the top of the page.",$.jsx("h4",{children:"Background:"}),"You live in a fantasy world that consists of your home country, as well as other 15 countries located across 5 continents: Eldoril, Thundoril, Aerion, Silvoria, and Mystara. Countries within each continent are similar to each other in size and demographics.",$.jsx("h4",{children:"Scenario:"}),"You are an analyst for the Viral Disease Policy Center of your home country at time when there is a new viral disease called",$.jsx("i",{children:" Celestial Sniffles"}),". Luckily, your country has not been affected yet and has time to prepare and decide on a policy to combat it. You have access to the infection data from other countries that implemented one of the 3 available policies: A, B, or C. However, due to socioeconomic factors, the Surgeon General in your country has",$.jsx("i",{children:" already decided on a policy"}),".",$.jsx("h4",{children:"Task:"}),"You are tasked with leading the promotion efforts that make the case for the chosen policy. In the experiment, you will use an interactive data explorer that shows infection data from other countries. You should select a view that best shows (and convinces the population) that your country's"," ",$.jsx("b",{children:"chosen policy is the best policy to combat the disease"}),". After finalizing the view, click the camera button and add a caption or a slogan that will go along with your visualization."]}):$.jsxs(HP,{children:["Select any subset of stocks to the left of the visualization to support the prompt at the top of the page.",$.jsx("h4",{children:"Scenario:"})," ","You are a financial advisor. Your client approached you asking for help in picking a new investment—an industry fund that equally invests within a single industry. The client prefers to make their decisions"," ",$.jsx("i",{children:"solely based on the data"}),", and not based on any inside knowledge about the type of industry. However, your boss"," ",$.jsx("i",{children:"does"})," ","have inside knowledge and orders you to recommend a specific industry (which is ultimately in the best interest of the client). You cannot disclose this to the client and have to use data to support your recommendations.",$.jsx("h4",{children:"Task:"})," ","In the experiment, you will use an interactive data explorer that shows performance of different stocks from a variety of industries. You should select a view that best shows (and convinces your client) that"," ",$.jsx("b",{children:"the chosen industry fund would be the best investment with the highest returns"}),". After finalizing the view, click the camera button and add a caption or a slogan that will go along with your visualization."]});return $.jsx(zo,{position:"right",children:$.jsxs(gp,{width:800,shadow:"md",children:[$.jsx(gp.Target,{children:$.jsx(yu,{variant:"light",color:"gray",compact:!0,children:"Help"})}),$.jsx(gp.Dropdown,{children:$.jsx(Tt,{size:"sm",children:t})})]})})}const Cqe=Object.freeze(Object.defineProperty({__proto__:null,Help:kie},Symbol.toStringTag,{value:"Module"}));function rV({parameters:e,setAnswer:t}){const[n,r]=w.useState(null),[i,s]=w.useState([]),[o,a]=w.useState(null),[u,l]=w.useState([new Date(e.start_date),new Date(e.end_date)]),[c,f]=w.useState(e.guardrail);w.useEffect(()=>{AFe(`./data/${e.dataset}.csv`).then(_=>{r(_),a(Array.from(new Set(_.map(b=>JSON.stringify({name:b[e.cat_var],group:b[e.group_var]})))).map(b=>JSON.parse(b)))})},[e]);const d=w.useMemo(()=>n&&u?n.filter(_=>new Date(_[e.x_var]).getTime()>=u[0].getTime()).filter(_=>new Date(_[e.x_var]).getTime()<=u[1].getTime()):null,[n,u]),{actions:h,trrack:p}=w.useMemo(()=>{const _=w$.create(),b=_.register("selection",(E,S)=>(E.selection=S,E)),T=_.register("range",(E,S)=>(E.range=S,E)),I=Q9e({registry:_,initialState:{selection:[],range:[e.start_date,e.end_date]}});return{actions:{selection:b,range:T},trrack:I}},[]),m=w.useCallback(_=>{p.apply("Change daterange",h.range([_[0].toISOString().slice(0,10),_[1].toISOString().slice(0,10)]))},[p,h,l]),y=w.useMemo(()=>ja(m,200),[m]),g=w.useCallback(_=>{p.apply("Change selection",h.selection(_)),t({status:!0,provenanceGraph:p.graph.backend,answers:{}})},[p,h,t]);return d&&o&&u&&i?$.jsxs(au,{children:[e.allow_guardrail_selector?$.jsx(_d,{shadow:"sm",radius:"md",p:"md",style:{width:"500px"},children:$.jsx(K2,{guardrail:c,setGuardrail:f})}):null,$.jsx(kd,{children:$.jsx(_d,{shadow:"md",radius:"md",p:"md",withBorder:!0,children:$.jsxs(zo,{children:[$.jsx(Y2,{parameters:e,data:d,items:o,selection:i,setSelection:s,trackSelection:g,range:u,guardrail:c}),$.jsx(gd,{orientation:"vertical",size:"xs"}),$.jsxs(au,{children:[$.jsxs(zo,{position:"apart",children:[$.jsxs(au,{spacing:0,justify:"flex-start",children:[$.jsx(Tt,{fw:500,children:e.dataset==="clean_stocks"?"Percent change in stock price":"Infections per million people"}),c==="super_summ"?$.jsx(Tt,{fz:"xs",c:"dimmed",children:"Shaded area represents the middle 50% of all values."}):null,c==="juxt_summ"?$.jsx(Tt,{fz:"xs",c:"dimmed",children:"Bar on the left highlights the range of selection among all data."}):null]}),$.jsx(kie,{parameters:e})]}),$.jsxs(au,{children:[$.jsxs(zo,{children:[c==="juxt_summ"?$.jsx(Nie,{parameters:e,data:d,selection:i}):null,$.jsx(q2,{parameters:e,data:d,items:o,selection:i,range:u,guardrail:c})]}),e.allow_time_slider?$.jsx("div",{style:{width:"500px"},children:$.jsx(G2,{parameters:e,setRange:l,trackRange:y})}):null]})]})]})})})]}):$.jsx(Lm,{})}const Aqe=Object.freeze(Object.defineProperty({__proto__:null,DataExplorer:rV,default:rV},Symbol.toStringTag,{value:"Module"})),Oqe=Object.assign({"../public/brush-interactions/types.ts":x5e,"../public/viz-guardrails/Color.tsx":C5e,"../public/viz-guardrails/DataExplorer.tsx":Aqe,"../public/viz-guardrails/Help.tsx":Cqe,"../public/viz-guardrails/LineChart.tsx":bBe,"../public/viz-guardrails/RangeSelector.tsx":wBe,"../public/viz-guardrails/Selector.tsx":TBe,"../public/viz-guardrails/Sidebar.tsx":EBe,"../public/viz-guardrails/StripPlot.tsx":xqe,"../public/viz-guardrails/XAxis.tsx":_Be,"../public/viz-guardrails/YAxis.tsx":vBe});function Pqe({currentConfig:e}){const t=Da(),n=`../public/${e.path}`,r=Oqe[n].default,i=Wl(),{updateResponseBlockValidation:s,setIframeAnswers:o}=Hl();function a({status:u,provenanceGraph:l,answers:c}){i(s({location:"sidebar",currentStep:t,status:u,values:c,provenanceGraph:l})),i(o(Object.values(c).map(f=>f)))}return $.jsx(w.Suspense,{fallback:$.jsx("div",{children:"Loading..."}),children:$.jsx(r,{parameters:e.parameters,setAnswer:a})})}function Rqe({currentConfig:e}){const[t,n]=w.useState(null);return w.useEffect(()=>{fetch(`${Bu}${e.path}`).then(r=>r.text()).then(r=>n(r))},[e]),t===null?null:$.jsx("div",{style:{maxWidth:700,margin:"0 0"},children:$.jsx(Us,{text:t})})}function bm(){return Uu(e=>e.config)}function Die(){const e=Da(),{setAlertModal:t}=Hl(),n=Wl();w.useEffect(()=>{(new URLSearchParams(window.location.search).get("admin")||"f")==="t"||(window.history.pushState(null,"",window.location.href),window.onpopstate=()=>{window.history.pushState(null,"",window.location.href),n(t({show:!0,message:"Using the browser's back button is prohibited during the study."}))})},[e,t,n])}function Nqe(){var f;const e=bm(),t=Da(),n=e.components[t],r=DD(),i=gI(n)&&e.baseComponents?ND({},(f=e.baseComponents)==null?void 0:f[n.baseComponent],n):n,s=i.instruction||"",{instructionLocation:o}=i,a=e.uiConfig.sidebar&&(o==="sidebar"||o===void 0);Die();const{storageEngine:u}=vf(),l=Wl(),{setAlertModal:c}=Hl();return w.useEffect(()=>{(u==null?void 0:u.getEngine())!=="firebase"&&l(c({show:!0,message:"There was an issue connecting to the firebase database. This could be caused by a network issue or your adblocker. If you are using an adblocker, please disable it for this website and refresh."}))},[c,u,l]),$.jsxs($.Fragment,{children:[o==="aboveStimulus"&&$.jsx(Us,{text:s}),$.jsx(nT,{status:r,config:i,location:"aboveStimulus"},`${t}-above-response-block`),$.jsxs(w.Suspense,{fallback:$.jsx("div",{children:"Loading..."}),children:[i.type==="markdown"&&$.jsx(Rqe,{currentConfig:i}),i.type==="website"&&$.jsx(T5e,{currentConfig:i}),i.type==="image"&&$.jsx(I5e,{currentConfig:i}),i.type==="react-component"&&$.jsx(Pqe,{currentConfig:i})]},`${t}-stimulus`),(o==="belowStimulus"||o===void 0&&!a)&&$.jsx(Us,{text:s}),$.jsx("div",{style:{maxWidth:800,margin:"0 0"},children:$.jsx(nT,{status:r,config:i,location:"belowStimulus"},`${t}-below-response-block`)})]})}function kqe(e){const[t]=QN();return $.jsx(ede,{...e,to:{pathname:e.to,search:t.toString()}})}var Dqe={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},$qe=Object.defineProperty,Lqe=Object.defineProperties,Mqe=Object.getOwnPropertyDescriptors,HT=Object.getOwnPropertySymbols,$ie=Object.prototype.hasOwnProperty,Lie=Object.prototype.propertyIsEnumerable,iV=(e,t,n)=>t in e?$qe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,sV=(e,t)=>{for(var n in t||(t={}))$ie.call(t,n)&&iV(e,n,t[n]);if(HT)for(var n of HT(t))Lie.call(t,n)&&iV(e,n,t[n]);return e},Fqe=(e,t)=>Lqe(e,Mqe(t)),Bqe=(e,t)=>{var n={};for(var r in e)$ie.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&HT)for(var r of HT(e))t.indexOf(r)<0&&Lie.call(e,r)&&(n[r]=e[r]);return n},Ql=(e,t,n)=>{const r=w.forwardRef((i,s)=>{var o=i,{color:a="currentColor",size:u=24,stroke:l=2,children:c}=o,f=Bqe(o,["color","size","stroke","children"]);return w.createElement("svg",sV(Fqe(sV({ref:s},Dqe),{width:u,height:u,stroke:a,strokeWidth:l,className:`tabler-icon tabler-icon-${e}`}),f),[...n.map(([d,h])=>w.createElement(d,h)),...c||[]])});return r.propTypes={color:ht.string,size:ht.oneOfType([ht.string,ht.number]),stroke:ht.oneOfType([ht.string,ht.number])},r.displayName=`${t}`,r},jqe=Ql("alert-circle","IconAlertCircle",[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M12 8v4",key:"svg-1"}],["path",{d:"M12 16h.01",key:"svg-2"}]]),Uqe=Ql("arrow-right","IconArrowRight",[["path",{d:"M5 12l14 0",key:"svg-0"}],["path",{d:"M13 18l6 -6",key:"svg-1"}],["path",{d:"M13 6l6 6",key:"svg-2"}]]),Vqe=Ql("arrows-shuffle","IconArrowsShuffle",[["path",{d:"M18 4l3 3l-3 3",key:"svg-0"}],["path",{d:"M18 20l3 -3l-3 -3",key:"svg-1"}],["path",{d:"M3 7h3a5 5 0 0 1 5 5a5 5 0 0 0 5 5h5",key:"svg-2"}],["path",{d:"M21 7h-5a4.978 4.978 0 0 0 -3 1m-4 8a4.984 4.984 0 0 1 -3 1h-3",key:"svg-3"}]]),zqe=Ql("code-dots","IconCodeDots",[["path",{d:"M15 12h.01",key:"svg-0"}],["path",{d:"M12 12h.01",key:"svg-1"}],["path",{d:"M9 12h.01",key:"svg-2"}],["path",{d:"M6 19a2 2 0 0 1 -2 -2v-4l-1 -1l1 -1v-4a2 2 0 0 1 2 -2",key:"svg-3"}],["path",{d:"M18 19a2 2 0 0 0 2 -2v-4l1 -1l-1 -1v-4a2 2 0 0 0 -2 -2",key:"svg-4"}]]),Hqe=Ql("code-plus","IconCodePlus",[["path",{d:"M9 12h6",key:"svg-0"}],["path",{d:"M12 9v6",key:"svg-1"}],["path",{d:"M6 19a2 2 0 0 1 -2 -2v-4l-1 -1l1 -1v-4a2 2 0 0 1 2 -2",key:"svg-2"}],["path",{d:"M18 19a2 2 0 0 0 2 -2v-4l1 -1l-1 -1v-4a2 2 0 0 0 -2 -2",key:"svg-3"}]]),Wqe=Ql("dots-vertical","IconDotsVertical",[["path",{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-0"}],["path",{d:"M12 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-1"}],["path",{d:"M12 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-2"}]]),qqe=Ql("mail","IconMail",[["path",{d:"M3 7a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-10z",key:"svg-0"}],["path",{d:"M3 7l9 6l9 -6",key:"svg-1"}]]),oV=Ql("schema","IconSchema",[["path",{d:"M5 2h5v4h-5z",key:"svg-0"}],["path",{d:"M15 10h5v4h-5z",key:"svg-1"}],["path",{d:"M5 18h5v4h-5z",key:"svg-2"}],["path",{d:"M5 10h5v4h-5z",key:"svg-3"}],["path",{d:"M10 12h5",key:"svg-4"}],["path",{d:"M7.5 6v4",key:"svg-5"}],["path",{d:"M7.5 14v4",key:"svg-6"}]]),Mie=Ql("table","IconTable",[["path",{d:"M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14z",key:"svg-0"}],["path",{d:"M3 10h18",key:"svg-1"}],["path",{d:"M10 3v18",key:"svg-2"}]]);const vR=["description","instruction","answer","correctAnswer","startTime","endTime","duration","taskOrder"],bb=["participantId","trialId","responseId"];function Eb(e,t){const n=`data:text/json;charset=utf-8,${encodeURIComponent(e)}`,r=document.createElement("a");r.setAttribute("href",n),r.setAttribute("download",t),document.body.appendChild(r),r.click(),r.remove()}function Yqe(e,t,n){return Object.entries(t.components).map(([r,i])=>{const s=gI(i)&&i.baseComponent&&t.baseComponents?ND({},t.baseComponents[i.baseComponent],i):i,o=e.answers[r],a=o!==void 0?o:{answer:{},startTime:-1,endTime:-1,windowEvents:[]},u=a.endTime-a.startTime;return Object.entries(a.answer).map(([c,f])=>{const d={participantId:e.participantId,trialId:r,responseId:c,startTime:new Date(a.startTime).toUTCString(),endTime:new Date(a.endTime).toUTCString(),duration:u};return n.includes("description")&&(d.description=s.description),n.includes("instruction")&&(d.instruction=s.instruction),n.includes("answer")&&(d.answer=f),n.includes("correctAnswer")&&(d.correctAnswer=s.correctAnswer),n.includes("taskOrder")&&(d.taskOrder=e.sequence.indexOf(r)),d}).flat()}).flat()}async function Gqe(e,t,n,r=[...bb,...vR]){const s=(await t.getAllParticipantsData()).map(l=>Yqe(l,n,r)).flat(),o=l=>l.replace(/"/g,'""'),a=s.map(l=>r.map(c=>l===null?"":typeof l[c]=="string"?`"${o(l[c])}"`:JSON.stringify(l[c])).join(",")),u=[r.join(","),...a].join(` -`);Eb(u,e)}function Kqe({opened:e,close:t,filename:n,studyConfig:r}){const[i,s]=Upe([...bb,...vR]),o=w.useCallback(l=>{bb.every(c=>l.includes(c))&&s(l)},[s]),a=w.useMemo(()=>[...bb,...vR],[]),{storageEngine:u}=vf();return u?$.jsxs(JS,{opened:e,size:"lg",onClose:t,title:$.jsx(Tt,{size:"xl",children:"Download Tidy CSV"}),centered:!0,radius:"md",padding:"xl",children:[$.jsx(ut,{children:$.jsx(lQ,{searchable:!0,limit:30,nothingFound:"Property not found",data:a,value:i,onChange:o,label:$.jsx(Tt,{fw:"bold",size:"lg",children:"Select properties to include in tidy csv:"}),placeholder:"Select atleast one property"})}),$.jsxs(kd,{mt:"xl",direction:{base:"column",sm:"row"},gap:{base:"sm",sm:"lg"},justify:{sm:"space-around"},children:[$.jsx(yu,{leftIcon:$.jsx(Mie,{}),onClick:()=>Gqe(n,u,r,i),children:"Download"}),$.jsx(yu,{onClick:t,color:"red",children:"Close"})]})]}):null}function Qqe({studyConfig:e}){const{storageEngine:t}=vf(),[n,{open:r,close:i}]=XW(!1),[s,o]=w.useState(),[a,u]=w.useState(""),l=e.studyMetadata.title.replace(" ","_");w.useEffect(()=>{async function m(){if(t){const y=await t.getCurrentParticipantId(),g=await t.getParticipantData();u(y),o(g)}}m()},[t]);const c=w.useCallback(async()=>{Eb(JSON.stringify(s,null,2),`${l}_${a}.json`)},[s]),f=e.uiConfig.autoDownloadStudy||!1,d=f&&e.uiConfig.autoDownloadTime||-1,[h,p]=w.useState(Math.floor(d/1e3));return w.useEffect(()=>{const m=setInterval(()=>{p(y=>y-1)},1e3);return h<=0?(c(),clearInterval(m),()=>clearInterval(m)):()=>clearInterval(m)},[h]),$.jsxs(au,{children:[$.jsx(yu,{leftIcon:$.jsx(zqe,{}),mt:"1em",mr:"0.5em",onClick:()=>Eb(JSON.stringify(s,null,2),`${l}_${a}.json`),display:"block",children:"Download Current (JSON)"}),$.jsx(yu,{disabled:!(t!=null&&t.isConnected()),leftIcon:$.jsx(Hqe,{}),mt:"1em",mr:"0.5em",onClick:async()=>{if(!t)return;const m=await t.getAllParticipantsData();Eb(JSON.stringify(m,null,2),`${l}_all.json`)},display:"block",children:"Download All (JSON)"}),$.jsx(yu,{disabled:!(t!=null&&t.isConnected()),leftIcon:$.jsx(Mie,{}),mt:"1em",mr:"0.5em",onClick:r,display:"block",children:"Download All (Tidy)"}),f&&$.jsxs(Tt,{size:"lg",children:["Study results will be downloaded in"," ",h," ","seconds. If the download does not start automatically, click above to download."]}),$.jsx(Kqe,{opened:n,close:i,filename:`${l}_${a}.csv`,studyConfig:e})]})}function Fie({order:e}){const{studyId:t=null}=KN(),n=Da(),r=Qd();return $.jsx(au,{spacing:"xs",children:e.components.map((i,s)=>typeof i=="string"?$.jsx(zo,{children:$.jsx(E1e,{style:{cursor:"pointer"},color:i===n?"red":"blue",onClick:()=>r(`/${t}/${i}`),size:"xs",children:i},i)},s):$.jsx(au,{spacing:"xs",children:$.jsxs(zo,{spacing:"xs",style:{width:"100%"},noWrap:!0,align:"center",position:"center",children:[i.order==="random"||i.order==="latinSquare"?$.jsx(Vqe,{textAnchor:"middle"}):null,$.jsx(au,{style:{width:"100%"},children:$.jsx(Fie,{order:i})})]})},s))})}function Xqe(){const{showAdmin:e,sequence:t}=Uu(a=>a),n=Qd(),{studyId:r=null}=KN(),i=Da(),s=bm(),o=t.map(a=>({...s.components[a],id:a}));return e||i==="end"&&s.uiConfig.autoDownloadStudy?$.jsx(Qh,{p:"0",width:{base:300},style:{zIndex:0},children:$.jsxs(r0,{p:"0",children:[$.jsx(Qh.Section,{grow:!0,component:r0,px:"xs",my:"lg",children:$.jsx(Fie,{order:s.sequence})}),$.jsx(Qh.Section,{grow:!0,component:r0,px:"xs",my:"lg",children:i==="end"&&$.jsx(Qqe,{studyConfig:s})}),$.jsx(Qh.Section,{grow:!0,component:r0,px:"xs",my:"lg",children:o.map((a,u)=>$.jsxs(k.Fragment,{children:[$.jsxs(_d,{radius:0,p:0,withBorder:!0,children:[$.jsx(_d,{radius:0,p:"xl",children:$.jsxs(kd,{style:{justifyContent:"space-between"},children:[$.jsxs(Tt,{c:"gray.9",children:[$.jsxs(Tt,{span:!0,fw:700,inherit:!0,children:["Task"," ",u+1,":"]})," ",a.id]}),$.jsx(Jp,{}),$.jsx(fk,{bg:"white",onClick:()=>n(`/${r}/${a.id}`),children:$.jsx(Uqe,{size:"1.125rem"})})]})}),$.jsxs(_d,{radius:0,p:"xl",children:[a.description&&$.jsxs(Tt,{fw:900,children:["Description:"," ",$.jsx(Tt,{fw:400,component:"span",children:a.description})]}),a.meta&&$.jsx(Tt,{fw:900,children:"Task Meta:"}),a.meta&&Object.keys(a.meta).map(l=>$.jsxs(Tt,{children:[l,":",a.meta[l]]},l))]})]}),$.jsx(Jp,{h:"md"})]},`admin_${a.id}`))})]})}):null}function Jqe(){const{config:e,sequence:t}=Uu(b=>b),n=Wl(),{toggleShowHelpText:r,toggleShowAdmin:i}=Hl(),{storageEngine:s}=vf(),o=Da(),a=e!==null?t.indexOf(o):0,u=t.length-1,l=a/u*100,[c,f]=w.useState(!1),d=e==null?void 0:e.uiConfig.logoPath,h=e==null?void 0:e.uiConfig.withProgressBar,[p]=w.useState(new URLSearchParams(window.location.search)),m=p.get("admin")||"f",y=TJ(),g=Vfe(`/${y}`);function _(){s==null||s.nextParticipant(e).then(()=>{window.location.href=g}).catch(b=>{console.error(b)})}return $.jsx(Hq,{height:"70",p:"md",children:$.jsxs(il,{mt:-7,align:"center",children:[$.jsx(il.Col,{span:4,children:$.jsxs(kd,{align:"center",children:[$.jsx(A_,{maw:40,src:`${Bu}${d}`,alt:"Study Logo"}),$.jsx(Jp,{w:"md"}),$.jsx(cc,{order:4,children:e==null?void 0:e.studyMetadata.title})]})}),$.jsx(il.Col,{span:4,children:h&&$.jsx(OQ,{radius:"md",size:"lg",value:l})}),$.jsx(il.Col,{span:4,children:$.jsxs(kd,{align:"center",justify:"flex-end",children:[(e==null?void 0:e.uiConfig.helpTextPath)!==void 0&&$.jsx(yu,{variant:"outline",onClick:()=>n(r()),children:"Help"}),$.jsx(Jp,{w:"md"}),m==="t"&&$.jsxs(ko,{shadow:"md",width:200,zIndex:1,opened:c,onChange:f,children:[$.jsx(ko.Target,{children:$.jsx(fk,{size:"lg",children:$.jsx(Wqe,{})})}),$.jsxs(ko.Dropdown,{children:[$.jsx(ko.Item,{icon:$.jsx(oV,{size:14}),onClick:()=>n(i()),children:"Admin Mode"}),$.jsx(ko.Item,{component:"a",href:e!==null?`mailto:${e.uiConfig.contactEmail}`:void 0,icon:$.jsx(qqe,{size:14}),children:"Contact"}),$.jsx(ko.Item,{icon:$.jsx(oV,{size:14}),onClick:()=>_(),children:"Next Participant"})]})]})]})})]})})}function Zqe(){var u;const e=(u=bm())==null?void 0:u.uiConfig.sidebar,t=bm(),n=Da(),r=t.components[n],i=w.useMemo(()=>{var l;return r?gI(r)&&t.baseComponents?ND({},(l=t.baseComponents)==null?void 0:l[r.baseComponent],r):r:null},[r]),s=DD(),o=(i==null?void 0:i.instruction)||"",a=(i==null?void 0:i.instructionLocation)==="sidebar"||(i==null?void 0:i.instructionLocation)===void 0;return e&&i?$.jsxs(C0,{bg:"gray.1",display:"block",width:{base:300},style:{zIndex:0,overflowY:"scroll"},children:[a&&o!==""&&$.jsx(C0.Section,{bg:"gray.3",p:"xl",children:$.jsxs(Tt,{c:"gray.9",children:[$.jsx(Tt,{span:!0,c:"orange.8",fw:700,inherit:!0,children:"Task:"}),$.jsx(Us,{text:o})]})}),$.jsx(C0.Section,{p:"xl",children:$.jsx(nT,{status:s,config:i,location:"sidebar"},`${n}-sidebar-response-block`)})]}):$.jsx(nT,{status:s,config:i,location:"sidebar",style:{display:"hidden"}},`${n}-sidebar-response-block`)}function eYe(){const{showHelpText:e,config:t}=Uu(o=>o),n=Wl(),{toggleShowHelpText:r}=Hl(),[i,s]=w.useState("");return w.useEffect(()=>{t&&t.uiConfig.helpTextPath&&fetch(`${Bu}${t.uiConfig.helpTextPath}`).then(o=>o.text()).then(o=>s(o))},[t]),$.jsx(JS,{size:"70%",opened:e,withCloseButton:!1,onClose:()=>n(r()),children:$.jsx(Us,{text:i})})}function tYe(){const{alertModal:e}=Uu(o=>o),{setAlertModal:t}=Hl(),n=Wl(),[r,i]=w.useState(e.show),s=w.useCallback(()=>n(t({...e,show:!1})),[e,t,n]);return w.useEffect(()=>i(e.show),[e.show]),$.jsx(JS,{opened:r,centered:!0,size:"lg",withCloseButton:!1,styles:{modal:{padding:"0 !important"}},onClose:s,children:$.jsxs(Iq,{color:"red",radius:"xs",p:"lg",title:"Alert",icon:$.jsx(jqe,{}),onClose:s,styles:{root:{backgroundColor:"unset"}},children:[$.jsx(Tt,{my:"md",children:e.message}),$.jsx(ut,{style:{float:"right"},color:"red",children:$.jsx(yu,{onClick:s,color:"red",variant:"filled",children:"Continue Study"})})]})})}function nYe(){const e=w.useRef([]),n=bm().uiConfig.windowEventDebounceTime??100;return w.useEffect(()=>{const r=ja(d=>{e.current.push([Date.now(),"focus",d.target instanceof HTMLElement?d.target.tagName:""])},n,{maxWait:n}),i=ja(d=>{e.current.push([Date.now(),"input",d.data??""])},n,{maxWait:n}),s=ja(d=>{e.current.push([Date.now(),"keypress",d.key])},n,{maxWait:n}),o=ja(d=>{e.current.push([Date.now(),"mousedown",[d.clientX,d.clientY]])},n,{maxWait:n}),a=ja(d=>{e.current.push([Date.now(),"mouseup",[d.clientX,d.clientY]])},n,{maxWait:n}),u=ja(()=>{e.current.push([Date.now(),"resize",[window.innerWidth,window.innerHeight]])},n,{maxWait:n}),l=ja(d=>{e.current.push([Date.now(),"mousemove",[d.clientX,d.clientY]])},n,{maxWait:n}),c=ja(()=>{e.current.push([Date.now(),"scroll",[window.scrollX,window.scrollY]])},n,{maxWait:n}),f=ja(()=>{e.current.push([Date.now(),"visibility",document.visibilityState])},n,{maxWait:n});return window.addEventListener("focus",r,!0),window.addEventListener("input",i),window.addEventListener("keypress",s),window.addEventListener("mousedown",o),window.addEventListener("mouseup",a),window.addEventListener("resize",u),window.addEventListener("mousemove",l),window.addEventListener("scroll",c),document.addEventListener("visibilitychange",f),()=>{window.removeEventListener("focus",r,!0),window.removeEventListener("input",i),window.removeEventListener("keypress",s),window.addEventListener("mousedown",o),window.addEventListener("mouseup",a),window.removeEventListener("resize",u),window.removeEventListener("mousemove",l),window.removeEventListener("scroll",c),document.removeEventListener("visibilitychange",f)}},[]),$.jsx(SJ.Provider,{value:e,children:$.jsxs(Yq,{navbar:$.jsx(Zqe,{}),aside:$.jsx(Xqe,{}),header:$.jsx(Jqe,{}),children:[$.jsx(eYe,{}),$.jsx(tYe,{}),$.jsx(tde,{})]})})}function rYe(){const e=bm(),{storageEngine:t}=vf(),{answers:n}=Uu(s=>s),[r,i]=w.useState(!1);return w.useEffect(()=>{const s=setInterval(async()=>{await t.verifyCompletion(n)&&(i(!0),clearInterval(s))},1e3)},[]),Die(),$.jsx(Nd,{style:{height:"100%"},children:$.jsx(kd,{direction:"column",children:r?$.jsx(Tt,{size:"xl",display:"block",children:e.uiConfig.studyEndMsg?$.jsx(Us,{text:e.uiConfig.studyEndMsg}):"Thank you for completing the study. You may close this window now."}):$.jsxs($.Fragment,{children:[$.jsx(Tt,{size:"xl",display:"block",children:"Please wait while your answers are uploaded."}),$.jsx(Jp,{h:"lg"}),$.jsx(Nd,{children:$.jsx(Lm,{color:"blue"})})]})})})}function iYe(e,t=!1){return typeof e=="number"?aV(e,t):aV(e.length,t).map(r=>r.map(i=>e[i]))}function aV(e,t){if(e<0)throw new Error("Latin square size must be > 0");if(e==0)return[];if(e==1)return[[0]];let n=new Array(e);for(let s=0;s(a+1)%e);r.push(o),i=o}if(t&&e%2>0)for(let s=0;s.5-Math.random());e.components=r}else e.order==="latinSquare"&&t&&(e.components=t[n].pop().map(r=>r.startsWith("_orderObj")?e.components[+r.slice(9)]:r));return e.components.slice(0,e.numSamples?e.numSamples:void 0).flat()}function sYe(e,t){const n=kD(e);return Bie(n,t,"root"),n.components.slice(0,e.numSamples?e.numSamples:void 0).flat()}function jie(e,t,n,r=0){const i=n.length>0?`${n}-${r}`:"root";e.order==="latinSquare"&&t.push(i),e.components.forEach((s,o)=>{typeof s!="string"&&jie(s,t,i,o)})}function oYe(e){const t=[];return jie(e,t,"",0),t}function uV(e,t){const n=t.split("-");let r={};n.forEach(o=>{o==="root"?r=e.sequence:r=r.components[+o]});const i=r.components.map((o,a)=>typeof o=="string"?o:`_orderObj${a}`);return iYe(i.sort(()=>.5-Math.random()),!0)}function aYe(e,t=1e3){const r=oYe(e.sequence).map(s=>({[s]:uV(e,s)})).reduce((s,o)=>({...s,...o}),{}),i=[];return Array.from({length:t}).forEach(()=>{const s=sYe(e.sequence,r);s.push("end"),i.push(s),Object.entries(r).forEach(([o,a])=>{a.length===0&&(r[o]=uV(e,o))})}),i}async function uYe(e,t){const n=await(await fetch(`${Bu}${e}`)).text();return tJ(n,t)}function lYe(e,t,n){const r=[];if(e&&t&&n){const i=[];i.push({path:"/",element:$.jsx(kqe,{to:`${n[0]}`,replace:!0})}),n.forEach(o=>{o==="end"?i.push({path:"/end",element:$.jsx(rYe,{})}):i.push({path:`/${o}`,element:$.jsx(Nqe,{})})});const s={element:$.jsx(nYe,{}),children:i};r.push(s)}return r}function cYe({globalConfig:e}){const{studyId:t}=KN();if(!t||!e.configsList.find(f=>WP(f)))throw new Error("Study id invalid");const[n,r]=w.useState(null);w.useEffect(()=>{const f=e.configsList.find(d=>WP(d)===t);if(f){const d=e.configs[f];uYe(`${d.path}`,f).then(h=>{r(h)})}},[e,t]);const[i,s]=w.useState([]),[o,a]=w.useState(null),{storageEngine:u}=vf(),[l]=QN();w.useEffect(()=>{async function f(){if(!u||!n||!t)return;await u.initializeStudyDb(t,n),await u.getSequenceArray()||await u.setSequenceArray(await aYe(n));const h=n.uiConfig.urlParticipantIdParam&&l.get(n.uiConfig.urlParticipantIdParam)||void 0,p=Object.fromEntries(l.entries()),m=await u.initializeParticipantSession(p,n,h),y=await eke(t,n,m.sequence,m.answers);a(y),s(lYe(t,n,m.sequence))}f()},[u,n,t,l]);const c=dW(i);return!c||!o?$.jsx(ut,{style:{height:"100vh"},children:$.jsx(Nd,{style:{height:"100%"},children:$.jsx(Lm,{style:{height:"100%"},size:60})})}):$.jsx(wJ.Provider,{value:o,children:$.jsx(CAe,{store:o.store,children:c})})}async function fYe(){const t=await(await fetch(`${Bu}configs/global.json`)).text();return XRe(t)}async function dYe(e){const t={},n=e.configsList.map(i=>`${Bu}${e.configs[i].path}`),r=await Promise.all(n.map(i=>fetch(i))).then(i=>Promise.all(i.map(s=>s.text()))).then(i=>Promise.all(i.map((s,o)=>tJ(s,e.configsList[o]))));return e.configsList.forEach((i,s)=>{t[i]=r[s]}),t}function hYe(){const[e,t]=w.useState(null),[n,r]=w.useState({});return w.useEffect(()=>{async function i(){e&&r(await dYe(e))}i()},[e]),w.useEffect(()=>{e||fYe().then(i=>{t(i)})},[e]),e?$.jsx(sde,{basename:Bu,children:$.jsxs(rde,{children:[$.jsx(IP,{path:"/",element:$.jsx(YCe,{globalConfig:e,studyConfigs:n})}),$.jsx(IP,{path:"/:studyId/*",element:$.jsx(cYe,{globalConfig:e})})]})}):null}function S1(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 Uie={exports:{}};/*! + : v !== v && u === u ? ${r} : `;function gqe(e,t){const n=[],r=[],i=[];let s=null,o="0",a="0";e.isGrouped()&&(s=e.groups().keys,o="ka",a="kb");const{ops:u}=Hs(t,{table:e,value:(h,p)=>{if(n.push(h),p.escape){const m=y=>`fn[${i.length}](${y}, data)`;r.push([m("a"),m("b")]),i.push(p.escape)}else r.push([bT(p,{index:"a",op:o}),bT(p,{index:"b",op:a})])},window:!1}),l=ng(e,u),c=(h,p)=>l[h][p],f=n.length;let d="return (a, b) => {"+(c&&e.isGrouped()?"const ka = keys[a], kb = keys[b];":"")+"let u, v; return ";for(let h=0;hr.set(++n+"",s);return t.forEach(s=>{const o=s.expr!=null?s.expr:s;if(Xi(o)&&!er(o))for(const a in o)i(o[a]);else i(cs(o)?jd(s,e.columnName(o)):Li(o)?jd(s):er(o)?s:jt(`Invalid orderby field: ${s+""}`))}),gqe(e,r)}function vqe(e,t){const n=e.numRows(),r=n+t.reduce((o,a)=>o+a.numRows(),0);if(n===r)return e;const i=[e,...t],s=So();return e.columnNames().forEach(o=>{const a=Array(r);let u=0;i.forEach(l=>{const c=l.column(o)||{get:()=>dn};l.scan(f=>a[u++]=c.get(f))}),s.add(o,a)}),e.create(s.new())}function bqe(e,t){const n=So(),r=e.groups(),{get:i,names:s=[],rows:o,size:a=1}=r||{},u=new Uint32Array(a+1);s.forEach(d=>n.add(d,null));const l=r?Tie(e,t,r):[wie(e,t)];t.outputs().map(d=>n.add(d,[]));const c=u.length-1;let f=0;for(let d=0;d{const m=n.data[h]=Array(f),y=i[p];for(let g=0,_=0;gtV(e,t,n,{anti:!0}),__count:(e,t={})=>nV(e,{[t.as||"count"]:Xee()}),__cross:(e,t,n,r)=>ZU(e,t,()=>!0,n,{...r,left:!0,right:!0}),__concat:vqe,__dedupe:QHe,__derive:mWe,__except:gWe,__filter:vWe,__fold:EWe,__impute:IWe,__intersect:CWe,__join:ZU,__lookup:VWe,__pivot:qWe,__relocate:bie,__rename:GWe,__rollup:nV,__sample:nqe,__select:sqe,__semijoin:tV,__spread:uqe,__union:lqe,__unroll:cqe,__groupby:hqe,__orderby:yqe,__ungroup:Eqe,__unorder:wqe,__reduce:bqe};Object.assign(tl.prototype,Tqe);function Sqe(e,t){return tl.from(e,t)}function Iqe(e){return lx(e,{escape:!0,toString(){jt("Escaped values can not be serialized.")}})}tl.prototype;const ua={top:30,left:60,right:80,bottom:50};function Rie({data:e,selection:t,parameters:n}){const s=w.useMemo(()=>{const l=e.map(c=>({...c,value:+c[n.y_var]}));return Sqe(l)},[e,n]),o=w.useMemo(()=>{const l=Cp(s.filter(Iqe(c=>t.includes(c[n.cat_var]))).array("value"));return n.dataset==="clean_stocks"?l:[0,l[1]]},[s,t,n]),a=w.useMemo(()=>FI([ua.top,400-ua.bottom]).domain(Cp(s.array("value")).reverse()),[s,400]),u=n.dataset==="clean_stocks"?zc(".0%"):zc(",.0f");return(t==null?void 0:t.length)===0?null:$.jsxs("svg",{style:{height:"400px",width:"60px",overflow:"visible"},children:[$.jsx("rect",{y:a(o[1]),height:a(o[0])-a(o[1]),x:ua.left-10,width:10,opacity:.1,fill:"black"}),$.jsx("text",{style:{fontSize:10,dominantBaseline:"middle",textAnchor:"middle",fontFamily:'"Helvetica Neue", Helvetica, Arial, sans-serif'},x:25,y:ua.top-5,children:u(a.domain()[0])}),$.jsx("text",{style:{fontSize:10,dominantBaseline:"middle",textAnchor:"middle",fontFamily:'"Helvetica Neue", Helvetica, Arial, sans-serif'},x:25,y:400-ua.bottom+8,children:u(a.domain()[1])}),$.jsx("text",{style:{fontSize:10,dominantBaseline:"middle",fontFamily:'"Helvetica Neue", Helvetica, Arial, sans-serif'},x:ua.left-5,y:a(o[0]),children:u(o[0])}),$.jsx("text",{style:{fontSize:10,dominantBaseline:"middle",fontFamily:'"Helvetica Neue", Helvetica, Arial, sans-serif'},x:ua.left-5,y:a(o[1]),children:u(o[1])}),e.map(l=>$.jsx("rect",{opacity:.2,fill:+l[n.y_var]>0?"steelblue":"firebrick",x:0,width:50,y:a(+l[n.y_var]),height:1},"strip")),$.jsx("line",{strokeWidth:2,stroke:"black",style:{fontSize:10,dominantBaseline:"middle"},x1:0,x2:50,y1:a(o[0]),y2:a(o[0])}),$.jsx("line",{strokeWidth:2,stroke:"black",x1:0,x2:50,y1:a(o[1]),y2:a(o[1])}),$.jsx("line",{strokeWidth:2,stroke:"black",x1:0,x2:0,y1:a(o[1]),y2:a(o[0])}),$.jsx("line",{strokeWidth:2,stroke:"black",x1:50,x2:50,y1:a(o[1]),y2:a(o[0])}),$.jsx("path",{fill:"black",opacity:"0.1",d:`M${ua.left}, ${a(o[1])} L 113, ${ua.top} L 113, ${400-ua.bottom} L ${ua.left}, ${a(o[0])}`})]})}const xqe=Object.freeze(Object.defineProperty({__proto__:null,StripPlot:Rie},Symbol.toStringTag,{value:"Module"}));function Nie({parameters:e}){const t=e.dataset==="clean_data"?$.jsxs(HP,{children:["Select any subset of countries to the left of the visualization to support the prompt at the top of the page.",$.jsx("h4",{children:"Background:"}),"You live in a fantasy world that consists of your home country, as well as other 15 countries located across 5 continents: Eldoril, Thundoril, Aerion, Silvoria, and Mystara. Countries within each continent are similar to each other in size and demographics.",$.jsx("h4",{children:"Scenario:"}),"You are an analyst for the Viral Disease Policy Center of your home country at time when there is a new viral disease called",$.jsx("i",{children:" Celestial Sniffles"}),". Luckily, your country has not been affected yet and has time to prepare and decide on a policy to combat it. You have access to the infection data from other countries that implemented one of the 3 available policies: A, B, or C. However, due to socioeconomic factors, the Surgeon General in your country has",$.jsx("i",{children:" already decided on a policy"}),".",$.jsx("h4",{children:"Task:"}),"You are tasked with leading the promotion efforts that make the case for the chosen policy. In the experiment, you will use an interactive data explorer that shows infection data from other countries. You should select a view that best shows (and convinces the population) that your country's"," ",$.jsx("b",{children:"chosen policy is the best policy to combat the disease"}),". After finalizing the view, click the camera button and add a caption or a slogan that will go along with your visualization."]}):$.jsxs(HP,{children:["Select any subset of stocks to the left of the visualization to support the prompt at the top of the page.",$.jsx("h4",{children:"Scenario:"})," ","You are a financial advisor. Your client approached you asking for help in picking a new investment—an industry fund that equally invests within a single industry. The client prefers to make their decisions"," ",$.jsx("i",{children:"solely based on the data"}),", and not based on any inside knowledge about the type of industry. However, your boss"," ",$.jsx("i",{children:"does"})," ","have inside knowledge and orders you to recommend a specific industry (which is ultimately in the best interest of the client). You cannot disclose this to the client and have to use data to support your recommendations.",$.jsx("h4",{children:"Task:"})," ","In the experiment, you will use an interactive data explorer that shows performance of different stocks from a variety of industries. You should select a view that best shows (and convinces your client) that"," ",$.jsx("b",{children:"the chosen industry fund would be the best investment with the highest returns"}),". After finalizing the view, click the camera button and add a caption or a slogan that will go along with your visualization."]});return $.jsx(zo,{position:"right",children:$.jsxs(gp,{width:800,shadow:"md",children:[$.jsx(gp.Target,{children:$.jsx(yu,{variant:"light",color:"gray",compact:!0,children:"Help"})}),$.jsx(gp.Dropdown,{children:$.jsx(Tt,{size:"sm",children:t})})]})})}const Cqe=Object.freeze(Object.defineProperty({__proto__:null,Help:Nie},Symbol.toStringTag,{value:"Module"}));function rV({parameters:e,setAnswer:t}){const[n,r]=w.useState(null),[i,s]=w.useState([]),[o,a]=w.useState(null),[u,l]=w.useState([new Date(e.start_date),new Date(e.end_date)]),[c,f]=w.useState(e.guardrail);w.useEffect(()=>{AFe(`./data/${e.dataset}.csv`).then(_=>{r(_),a(Array.from(new Set(_.map(b=>JSON.stringify({name:b[e.cat_var],group:b[e.group_var]})))).map(b=>JSON.parse(b)))})},[e]);const d=w.useMemo(()=>n&&u?n.filter(_=>new Date(_[e.x_var]).getTime()>=u[0].getTime()).filter(_=>new Date(_[e.x_var]).getTime()<=u[1].getTime()):null,[n,u]),{actions:h,trrack:p}=w.useMemo(()=>{const _=w$.create(),b=_.register("selection",(E,S)=>(E.selection=S,E)),T=_.register("range",(E,S)=>(E.range=S,E)),I=Q9e({registry:_,initialState:{selection:[],range:[e.start_date,e.end_date]}});return{actions:{selection:b,range:T},trrack:I}},[]),m=w.useCallback(_=>{p.apply("Change daterange",h.range([_[0].toISOString().slice(0,10),_[1].toISOString().slice(0,10)]))},[p,h,l]),y=w.useMemo(()=>ja(m,200),[m]),g=w.useCallback(_=>{p.apply("Change selection",h.selection(_)),t({status:!0,provenanceGraph:p.graph.backend,answers:{}})},[p,h,t]);return d&&o&&u&&i?$.jsxs(au,{children:[e.allow_guardrail_selector?$.jsx(_d,{shadow:"sm",radius:"md",p:"md",style:{width:"500px"},children:$.jsx(K2,{guardrail:c,setGuardrail:f})}):null,$.jsx(kd,{children:$.jsx(_d,{shadow:"md",radius:"md",p:"md",withBorder:!0,children:$.jsxs(zo,{children:[$.jsx(Y2,{parameters:e,data:d,items:o,selection:i,setSelection:s,trackSelection:g,range:u,guardrail:c}),$.jsx(gd,{orientation:"vertical",size:"xs"}),$.jsxs(au,{children:[$.jsxs(zo,{position:"apart",children:[$.jsxs(au,{spacing:0,justify:"flex-start",children:[$.jsx(Tt,{fw:500,children:e.dataset==="clean_stocks"?"Percent change in stock price":"Infections per million people"}),c==="super_summ"?$.jsx(Tt,{fz:"xs",c:"dimmed",children:"Shaded area represents the middle 50% of all values."}):null,c==="juxt_summ"?$.jsx(Tt,{fz:"xs",c:"dimmed",children:"Bar on the left highlights the range of selection among all data."}):null]}),$.jsx(Nie,{parameters:e})]}),$.jsxs(au,{children:[$.jsxs(zo,{children:[c==="juxt_summ"?$.jsx(Rie,{parameters:e,data:d,selection:i}):null,$.jsx(q2,{parameters:e,data:d,items:o,selection:i,range:u,guardrail:c})]}),e.allow_time_slider?$.jsx("div",{style:{width:"500px"},children:$.jsx(G2,{parameters:e,setRange:l,trackRange:y})}):null]})]})]})})})]}):$.jsx(Lm,{})}const Aqe=Object.freeze(Object.defineProperty({__proto__:null,DataExplorer:rV,default:rV},Symbol.toStringTag,{value:"Module"})),Oqe=Object.assign({"../public/brush-interactions/types.ts":x5e,"../public/viz-guardrails/Color.tsx":C5e,"../public/viz-guardrails/DataExplorer.tsx":Aqe,"../public/viz-guardrails/Help.tsx":Cqe,"../public/viz-guardrails/LineChart.tsx":bBe,"../public/viz-guardrails/RangeSelector.tsx":wBe,"../public/viz-guardrails/Selector.tsx":TBe,"../public/viz-guardrails/Sidebar.tsx":EBe,"../public/viz-guardrails/StripPlot.tsx":xqe,"../public/viz-guardrails/XAxis.tsx":_Be,"../public/viz-guardrails/YAxis.tsx":vBe});function Pqe({currentConfig:e}){const t=Da(),n=`../public/${e.path}`,r=Oqe[n].default,i=Wl(),{updateResponseBlockValidation:s,setIframeAnswers:o}=Hl();function a({status:u,provenanceGraph:l,answers:c}){i(s({location:"sidebar",currentStep:t,status:u,values:c,provenanceGraph:l})),i(o(Object.values(c).map(f=>f)))}return $.jsx(w.Suspense,{fallback:$.jsx("div",{children:"Loading..."}),children:$.jsx(r,{parameters:e.parameters,setAnswer:a})})}function Rqe({currentConfig:e}){const[t,n]=w.useState(null);return w.useEffect(()=>{fetch(`${Bu}${e.path}`).then(r=>r.text()).then(r=>n(r))},[e]),t===null?null:$.jsx("div",{style:{maxWidth:700,margin:"0 0"},children:$.jsx(Us,{text:t})})}function bm(){return Uu(e=>e.config)}function kie(){const e=Da(),{setAlertModal:t}=Hl(),n=Wl();w.useEffect(()=>{(new URLSearchParams(window.location.search).get("admin")||"f")==="t"||(window.history.pushState(null,"",window.location.href),window.onpopstate=()=>{window.history.pushState(null,"",window.location.href),n(t({show:!0,message:"Using the browser's back button is prohibited during the study."}))})},[e,t,n])}function Nqe(){var f;const e=bm(),t=Da(),n=e.components[t],r=DD(),i=gI(n)&&e.baseComponents?ND({},(f=e.baseComponents)==null?void 0:f[n.baseComponent],n):n,s=i.instruction||"",{instructionLocation:o}=i,a=e.uiConfig.sidebar&&(o==="sidebar"||o===void 0);kie();const{storageEngine:u}=vf(),l=Wl(),{setAlertModal:c}=Hl();return w.useEffect(()=>{(u==null?void 0:u.getEngine())!=="firebase"&&l(c({show:!0,message:"There was an issue connecting to the firebase database. This could be caused by a network issue or your adblocker. If you are using an adblocker, please disable it for this website and refresh."}))},[c,u,l]),$.jsxs($.Fragment,{children:[o==="aboveStimulus"&&$.jsx(Us,{text:s}),$.jsx(nT,{status:r,config:i,location:"aboveStimulus"},`${t}-above-response-block`),$.jsxs(w.Suspense,{fallback:$.jsx("div",{children:"Loading..."}),children:[i.type==="markdown"&&$.jsx(Rqe,{currentConfig:i}),i.type==="website"&&$.jsx(T5e,{currentConfig:i}),i.type==="image"&&$.jsx(I5e,{currentConfig:i}),i.type==="react-component"&&$.jsx(Pqe,{currentConfig:i})]},`${t}-stimulus`),(o==="belowStimulus"||o===void 0&&!a)&&$.jsx(Us,{text:s}),$.jsx("div",{style:{maxWidth:800,margin:"0 0"},children:$.jsx(nT,{status:r,config:i,location:"belowStimulus"},`${t}-below-response-block`)})]})}function kqe(e){const[t]=QN();return $.jsx(Zfe,{...e,to:{pathname:e.to,search:t.toString()}})}var Dqe={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},$qe=Object.defineProperty,Lqe=Object.defineProperties,Mqe=Object.getOwnPropertyDescriptors,HT=Object.getOwnPropertySymbols,Die=Object.prototype.hasOwnProperty,$ie=Object.prototype.propertyIsEnumerable,iV=(e,t,n)=>t in e?$qe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,sV=(e,t)=>{for(var n in t||(t={}))Die.call(t,n)&&iV(e,n,t[n]);if(HT)for(var n of HT(t))$ie.call(t,n)&&iV(e,n,t[n]);return e},Fqe=(e,t)=>Lqe(e,Mqe(t)),Bqe=(e,t)=>{var n={};for(var r in e)Die.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&HT)for(var r of HT(e))t.indexOf(r)<0&&$ie.call(e,r)&&(n[r]=e[r]);return n},Ql=(e,t,n)=>{const r=w.forwardRef((i,s)=>{var o=i,{color:a="currentColor",size:u=24,stroke:l=2,children:c}=o,f=Bqe(o,["color","size","stroke","children"]);return w.createElement("svg",sV(Fqe(sV({ref:s},Dqe),{width:u,height:u,stroke:a,strokeWidth:l,className:`tabler-icon tabler-icon-${e}`}),f),[...n.map(([d,h])=>w.createElement(d,h)),...c||[]])});return r.propTypes={color:ht.string,size:ht.oneOfType([ht.string,ht.number]),stroke:ht.oneOfType([ht.string,ht.number])},r.displayName=`${t}`,r},jqe=Ql("alert-circle","IconAlertCircle",[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M12 8v4",key:"svg-1"}],["path",{d:"M12 16h.01",key:"svg-2"}]]),Uqe=Ql("arrow-right","IconArrowRight",[["path",{d:"M5 12l14 0",key:"svg-0"}],["path",{d:"M13 18l6 -6",key:"svg-1"}],["path",{d:"M13 6l6 6",key:"svg-2"}]]),Vqe=Ql("arrows-shuffle","IconArrowsShuffle",[["path",{d:"M18 4l3 3l-3 3",key:"svg-0"}],["path",{d:"M18 20l3 -3l-3 -3",key:"svg-1"}],["path",{d:"M3 7h3a5 5 0 0 1 5 5a5 5 0 0 0 5 5h5",key:"svg-2"}],["path",{d:"M21 7h-5a4.978 4.978 0 0 0 -3 1m-4 8a4.984 4.984 0 0 1 -3 1h-3",key:"svg-3"}]]),zqe=Ql("code-dots","IconCodeDots",[["path",{d:"M15 12h.01",key:"svg-0"}],["path",{d:"M12 12h.01",key:"svg-1"}],["path",{d:"M9 12h.01",key:"svg-2"}],["path",{d:"M6 19a2 2 0 0 1 -2 -2v-4l-1 -1l1 -1v-4a2 2 0 0 1 2 -2",key:"svg-3"}],["path",{d:"M18 19a2 2 0 0 0 2 -2v-4l1 -1l-1 -1v-4a2 2 0 0 0 -2 -2",key:"svg-4"}]]),Hqe=Ql("code-plus","IconCodePlus",[["path",{d:"M9 12h6",key:"svg-0"}],["path",{d:"M12 9v6",key:"svg-1"}],["path",{d:"M6 19a2 2 0 0 1 -2 -2v-4l-1 -1l1 -1v-4a2 2 0 0 1 2 -2",key:"svg-2"}],["path",{d:"M18 19a2 2 0 0 0 2 -2v-4l1 -1l-1 -1v-4a2 2 0 0 0 -2 -2",key:"svg-3"}]]),Wqe=Ql("dots-vertical","IconDotsVertical",[["path",{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-0"}],["path",{d:"M12 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-1"}],["path",{d:"M12 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-2"}]]),qqe=Ql("mail","IconMail",[["path",{d:"M3 7a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-10z",key:"svg-0"}],["path",{d:"M3 7l9 6l9 -6",key:"svg-1"}]]),oV=Ql("schema","IconSchema",[["path",{d:"M5 2h5v4h-5z",key:"svg-0"}],["path",{d:"M15 10h5v4h-5z",key:"svg-1"}],["path",{d:"M5 18h5v4h-5z",key:"svg-2"}],["path",{d:"M5 10h5v4h-5z",key:"svg-3"}],["path",{d:"M10 12h5",key:"svg-4"}],["path",{d:"M7.5 6v4",key:"svg-5"}],["path",{d:"M7.5 14v4",key:"svg-6"}]]),Lie=Ql("table","IconTable",[["path",{d:"M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14z",key:"svg-0"}],["path",{d:"M3 10h18",key:"svg-1"}],["path",{d:"M10 3v18",key:"svg-2"}]]);const vR=["description","instruction","answer","correctAnswer","startTime","endTime","duration","taskOrder"],bb=["participantId","trialId","responseId"];function Eb(e,t){const n=`data:text/json;charset=utf-8,${encodeURIComponent(e)}`,r=document.createElement("a");r.setAttribute("href",n),r.setAttribute("download",t),document.body.appendChild(r),r.click(),r.remove()}function Yqe(e,t,n){return Object.entries(t.components).map(([r,i])=>{const s=gI(i)&&i.baseComponent&&t.baseComponents?ND({},t.baseComponents[i.baseComponent],i):i,o=e.answers[r],a=o!==void 0?o:{answer:{},startTime:-1,endTime:-1,windowEvents:[]},u=a.endTime-a.startTime;return Object.entries(a.answer).map(([c,f])=>{const d={participantId:e.participantId,trialId:r,responseId:c,startTime:new Date(a.startTime).toUTCString(),endTime:new Date(a.endTime).toUTCString(),duration:u};return n.includes("description")&&(d.description=s.description),n.includes("instruction")&&(d.instruction=s.instruction),n.includes("answer")&&(d.answer=f),n.includes("correctAnswer")&&(d.correctAnswer=s.correctAnswer),n.includes("taskOrder")&&(d.taskOrder=e.sequence.indexOf(r)),d}).flat()}).flat()}async function Gqe(e,t,n,r=[...bb,...vR]){const s=(await t.getAllParticipantsData()).map(l=>Yqe(l,n,r)).flat(),o=l=>l.replace(/"/g,'""'),a=s.map(l=>r.map(c=>l===null?"":typeof l[c]=="string"?`"${o(l[c])}"`:JSON.stringify(l[c])).join(",")),u=[r.join(","),...a].join(` +`);Eb(u,e)}function Kqe({opened:e,close:t,filename:n,studyConfig:r}){const[i,s]=Upe([...bb,...vR]),o=w.useCallback(l=>{bb.every(c=>l.includes(c))&&s(l)},[s]),a=w.useMemo(()=>[...bb,...vR],[]),{storageEngine:u}=vf();return u?$.jsxs(JS,{opened:e,size:"lg",onClose:t,title:$.jsx(Tt,{size:"xl",children:"Download Tidy CSV"}),centered:!0,radius:"md",padding:"xl",children:[$.jsx(ut,{children:$.jsx(uQ,{searchable:!0,limit:30,nothingFound:"Property not found",data:a,value:i,onChange:o,label:$.jsx(Tt,{fw:"bold",size:"lg",children:"Select properties to include in tidy csv:"}),placeholder:"Select atleast one property"})}),$.jsxs(kd,{mt:"xl",direction:{base:"column",sm:"row"},gap:{base:"sm",sm:"lg"},justify:{sm:"space-around"},children:[$.jsx(yu,{leftIcon:$.jsx(Lie,{}),onClick:()=>Gqe(n,u,r,i),children:"Download"}),$.jsx(yu,{onClick:t,color:"red",children:"Close"})]})]}):null}function Qqe({studyConfig:e}){const{storageEngine:t}=vf(),[n,{open:r,close:i}]=QW(!1),[s,o]=w.useState(),[a,u]=w.useState(""),l=e.studyMetadata.title.replace(" ","_");w.useEffect(()=>{async function m(){if(t){const y=await t.getCurrentParticipantId(),g=await t.getParticipantData();u(y),o(g)}}m()},[t]);const c=w.useCallback(async()=>{Eb(JSON.stringify(s,null,2),`${l}_${a}.json`)},[s]),f=e.uiConfig.autoDownloadStudy||!1,d=f&&e.uiConfig.autoDownloadTime||-1,[h,p]=w.useState(Math.floor(d/1e3));return w.useEffect(()=>{const m=setInterval(()=>{p(y=>y-1)},1e3);return h<=0?(c(),clearInterval(m),()=>clearInterval(m)):()=>clearInterval(m)},[h]),$.jsxs(au,{children:[$.jsx(yu,{leftIcon:$.jsx(zqe,{}),mt:"1em",mr:"0.5em",onClick:()=>Eb(JSON.stringify(s,null,2),`${l}_${a}.json`),display:"block",children:"Download Current (JSON)"}),$.jsx(yu,{disabled:!(t!=null&&t.isConnected()),leftIcon:$.jsx(Hqe,{}),mt:"1em",mr:"0.5em",onClick:async()=>{if(!t)return;const m=await t.getAllParticipantsData();Eb(JSON.stringify(m,null,2),`${l}_all.json`)},display:"block",children:"Download All (JSON)"}),$.jsx(yu,{disabled:!(t!=null&&t.isConnected()),leftIcon:$.jsx(Lie,{}),mt:"1em",mr:"0.5em",onClick:r,display:"block",children:"Download All (Tidy)"}),f&&$.jsxs(Tt,{size:"lg",children:["Study results will be downloaded in"," ",h," ","seconds. If the download does not start automatically, click above to download."]}),$.jsx(Kqe,{opened:n,close:i,filename:`${l}_${a}.csv`,studyConfig:e})]})}function Mie({order:e}){const{studyId:t=null}=KN(),n=Da(),r=Qd();return $.jsx(au,{spacing:"xs",children:e.components.map((i,s)=>typeof i=="string"?$.jsx(zo,{children:$.jsx(E1e,{style:{cursor:"pointer"},color:i===n?"red":"blue",onClick:()=>r(`/${t}/${i}`),size:"xs",children:i},i)},s):$.jsx(au,{spacing:"xs",children:$.jsxs(zo,{spacing:"xs",style:{width:"100%"},noWrap:!0,align:"center",position:"center",children:[i.order==="random"||i.order==="latinSquare"?$.jsx(Vqe,{textAnchor:"middle"}):null,$.jsx(au,{style:{width:"100%"},children:$.jsx(Mie,{order:i})})]})},s))})}function Xqe(){const{showAdmin:e,sequence:t}=Uu(a=>a),n=Qd(),{studyId:r=null}=KN(),i=Da(),s=bm(),o=t.map(a=>({...s.components[a],id:a}));return e||i==="end"&&s.uiConfig.autoDownloadStudy?$.jsx(Qh,{p:"0",width:{base:300},style:{zIndex:0},children:$.jsxs(r0,{p:"0",children:[$.jsx(Qh.Section,{grow:!0,component:r0,px:"xs",my:"lg",children:$.jsx(Mie,{order:s.sequence})}),$.jsx(Qh.Section,{grow:!0,component:r0,px:"xs",my:"lg",children:i==="end"&&$.jsx(Qqe,{studyConfig:s})}),$.jsx(Qh.Section,{grow:!0,component:r0,px:"xs",my:"lg",children:o.map((a,u)=>$.jsxs(k.Fragment,{children:[$.jsxs(_d,{radius:0,p:0,withBorder:!0,children:[$.jsx(_d,{radius:0,p:"xl",children:$.jsxs(kd,{style:{justifyContent:"space-between"},children:[$.jsxs(Tt,{c:"gray.9",children:[$.jsxs(Tt,{span:!0,fw:700,inherit:!0,children:["Task"," ",u+1,":"]})," ",a.id]}),$.jsx(Jp,{}),$.jsx(fk,{bg:"white",onClick:()=>n(`/${r}/${a.id}`),children:$.jsx(Uqe,{size:"1.125rem"})})]})}),$.jsxs(_d,{radius:0,p:"xl",children:[a.description&&$.jsxs(Tt,{fw:900,children:["Description:"," ",$.jsx(Tt,{fw:400,component:"span",children:a.description})]}),a.meta&&$.jsx(Tt,{fw:900,children:"Task Meta:"}),a.meta&&Object.keys(a.meta).map(l=>$.jsxs(Tt,{children:[l,":",a.meta[l]]},l))]})]}),$.jsx(Jp,{h:"md"})]},`admin_${a.id}`))})]})}):null}function Jqe(){const{config:e,sequence:t}=Uu(b=>b),n=Wl(),{toggleShowHelpText:r,toggleShowAdmin:i}=Hl(),{storageEngine:s}=vf(),o=Da(),a=e!==null?t.indexOf(o):0,u=t.length-1,l=a/u*100,[c,f]=w.useState(!1),d=e==null?void 0:e.uiConfig.logoPath,h=e==null?void 0:e.uiConfig.withProgressBar,[p]=w.useState(new URLSearchParams(window.location.search)),m=p.get("admin")||"f",y=wJ(),g=Ufe(`/${y}`);function _(){s==null||s.nextParticipant(e).then(()=>{window.location.href=g}).catch(b=>{console.error(b)})}return $.jsx(zq,{height:"70",p:"md",children:$.jsxs(il,{mt:-7,align:"center",children:[$.jsx(il.Col,{span:4,children:$.jsxs(kd,{align:"center",children:[$.jsx(A_,{maw:40,src:`${Bu}${d}`,alt:"Study Logo"}),$.jsx(Jp,{w:"md"}),$.jsx(cc,{order:4,children:e==null?void 0:e.studyMetadata.title})]})}),$.jsx(il.Col,{span:4,children:h&&$.jsx(AQ,{radius:"md",size:"lg",value:l})}),$.jsx(il.Col,{span:4,children:$.jsxs(kd,{align:"center",justify:"flex-end",children:[(e==null?void 0:e.uiConfig.helpTextPath)!==void 0&&$.jsx(yu,{variant:"outline",onClick:()=>n(r()),children:"Help"}),$.jsx(Jp,{w:"md"}),m==="t"&&$.jsxs(ko,{shadow:"md",width:200,zIndex:1,opened:c,onChange:f,children:[$.jsx(ko.Target,{children:$.jsx(fk,{size:"lg",children:$.jsx(Wqe,{})})}),$.jsxs(ko.Dropdown,{children:[$.jsx(ko.Item,{icon:$.jsx(oV,{size:14}),onClick:()=>n(i()),children:"Admin Mode"}),$.jsx(ko.Item,{component:"a",href:e!==null?`mailto:${e.uiConfig.contactEmail}`:void 0,icon:$.jsx(qqe,{size:14}),children:"Contact"}),$.jsx(ko.Item,{icon:$.jsx(oV,{size:14}),onClick:()=>_(),children:"Next Participant"})]})]})]})})]})})}function Zqe(){var u;const e=(u=bm())==null?void 0:u.uiConfig.sidebar,t=bm(),n=Da(),r=t.components[n],i=w.useMemo(()=>{var l;return r?gI(r)&&t.baseComponents?ND({},(l=t.baseComponents)==null?void 0:l[r.baseComponent],r):r:null},[r]),s=DD(),o=(i==null?void 0:i.instruction)||"",a=(i==null?void 0:i.instructionLocation)==="sidebar"||(i==null?void 0:i.instructionLocation)===void 0;return e&&i?$.jsxs(C0,{bg:"gray.1",display:"block",width:{base:300},style:{zIndex:0,overflowY:"scroll"},children:[a&&o!==""&&$.jsx(C0.Section,{bg:"gray.3",p:"xl",children:$.jsxs(Tt,{c:"gray.9",children:[$.jsx(Tt,{span:!0,c:"orange.8",fw:700,inherit:!0,children:"Task:"}),$.jsx(Us,{text:o})]})}),$.jsx(C0.Section,{p:"xl",children:$.jsx(nT,{status:s,config:i,location:"sidebar"},`${n}-sidebar-response-block`)})]}):$.jsx(nT,{status:s,config:i,location:"sidebar",style:{display:"hidden"}},`${n}-sidebar-response-block`)}function eYe(){const{showHelpText:e,config:t}=Uu(o=>o),n=Wl(),{toggleShowHelpText:r}=Hl(),[i,s]=w.useState("");return w.useEffect(()=>{t&&t.uiConfig.helpTextPath&&fetch(`${Bu}${t.uiConfig.helpTextPath}`).then(o=>o.text()).then(o=>s(o))},[t]),$.jsx(JS,{size:"70%",opened:e,withCloseButton:!1,onClose:()=>n(r()),children:$.jsx(Us,{text:i})})}function tYe(){const{alertModal:e}=Uu(o=>o),{setAlertModal:t}=Hl(),n=Wl(),[r,i]=w.useState(e.show),s=w.useCallback(()=>n(t({...e,show:!1})),[e,t,n]);return w.useEffect(()=>i(e.show),[e.show]),$.jsx(JS,{opened:r,centered:!0,size:"lg",withCloseButton:!1,styles:{modal:{padding:"0 !important"}},onClose:s,children:$.jsxs(Sq,{color:"red",radius:"xs",p:"lg",title:"Alert",icon:$.jsx(jqe,{}),onClose:s,styles:{root:{backgroundColor:"unset"}},children:[$.jsx(Tt,{my:"md",children:e.message}),$.jsx(ut,{style:{float:"right"},color:"red",children:$.jsx(yu,{onClick:s,color:"red",variant:"filled",children:"Continue Study"})})]})})}function nYe(){const e=w.useRef([]),n=bm().uiConfig.windowEventDebounceTime??100;return w.useEffect(()=>{const r=ja(d=>{e.current.push([Date.now(),"focus",d.target instanceof HTMLElement?d.target.tagName:""])},n,{maxWait:n}),i=ja(d=>{e.current.push([Date.now(),"input",d.data??""])},n,{maxWait:n}),s=ja(d=>{e.current.push([Date.now(),"keypress",d.key])},n,{maxWait:n}),o=ja(d=>{e.current.push([Date.now(),"mousedown",[d.clientX,d.clientY]])},n,{maxWait:n}),a=ja(d=>{e.current.push([Date.now(),"mouseup",[d.clientX,d.clientY]])},n,{maxWait:n}),u=ja(()=>{e.current.push([Date.now(),"resize",[window.innerWidth,window.innerHeight]])},n,{maxWait:n}),l=ja(d=>{e.current.push([Date.now(),"mousemove",[d.clientX,d.clientY]])},n,{maxWait:n}),c=ja(()=>{e.current.push([Date.now(),"scroll",[window.scrollX,window.scrollY]])},n,{maxWait:n}),f=ja(()=>{e.current.push([Date.now(),"visibility",document.visibilityState])},n,{maxWait:n});return window.addEventListener("focus",r,!0),window.addEventListener("input",i),window.addEventListener("keypress",s),window.addEventListener("mousedown",o),window.addEventListener("mouseup",a),window.addEventListener("resize",u),window.addEventListener("mousemove",l),window.addEventListener("scroll",c),document.addEventListener("visibilitychange",f),()=>{window.removeEventListener("focus",r,!0),window.removeEventListener("input",i),window.removeEventListener("keypress",s),window.addEventListener("mousedown",o),window.addEventListener("mouseup",a),window.removeEventListener("resize",u),window.removeEventListener("mousemove",l),window.removeEventListener("scroll",c),document.removeEventListener("visibilitychange",f)}},[]),$.jsx(TJ.Provider,{value:e,children:$.jsxs(qq,{navbar:$.jsx(Zqe,{}),aside:$.jsx(Xqe,{}),header:$.jsx(Jqe,{}),children:[$.jsx(eYe,{}),$.jsx(tYe,{}),$.jsx(ede,{})]})})}function rYe(){const e=bm(),{storageEngine:t}=vf(),{answers:n}=Uu(s=>s),[r,i]=w.useState(!1);return w.useEffect(()=>{const s=setInterval(async()=>{await t.verifyCompletion(n)&&(i(!0),clearInterval(s))},1e3)},[]),kie(),$.jsx(Nd,{style:{height:"100%"},children:$.jsx(kd,{direction:"column",children:r?$.jsx(Tt,{size:"xl",display:"block",children:e.uiConfig.studyEndMsg?$.jsx(Us,{text:e.uiConfig.studyEndMsg}):"Thank you for completing the study. You may close this window now."}):$.jsxs($.Fragment,{children:[$.jsx(Tt,{size:"xl",display:"block",children:"Please wait while your answers are uploaded."}),$.jsx(Jp,{h:"lg"}),$.jsx(Nd,{children:$.jsx(Lm,{color:"blue"})})]})})})}function iYe(e,t=!1){return typeof e=="number"?aV(e,t):aV(e.length,t).map(r=>r.map(i=>e[i]))}function aV(e,t){if(e<0)throw new Error("Latin square size must be > 0");if(e==0)return[];if(e==1)return[[0]];let n=new Array(e);for(let s=0;s(a+1)%e);r.push(o),i=o}if(t&&e%2>0)for(let s=0;s.5-Math.random());e.components=r}else e.order==="latinSquare"&&t&&(e.components=t[n].pop().map(r=>r.startsWith("_orderObj")?e.components[+r.slice(9)]:r));return e.components.slice(0,e.numSamples?e.numSamples:void 0).flat()}function sYe(e,t){const n=kD(e);return Fie(n,t,"root"),n.components.slice(0,e.numSamples?e.numSamples:void 0).flat()}function Bie(e,t,n,r=0){const i=n.length>0?`${n}-${r}`:"root";e.order==="latinSquare"&&t.push(i),e.components.forEach((s,o)=>{typeof s!="string"&&Bie(s,t,i,o)})}function oYe(e){const t=[];return Bie(e,t,"",0),t}function uV(e,t){const n=t.split("-");let r={};n.forEach(o=>{o==="root"?r=e.sequence:r=r.components[+o]});const i=r.components.map((o,a)=>typeof o=="string"?o:`_orderObj${a}`);return iYe(i.sort(()=>.5-Math.random()),!0)}function aYe(e,t=1e3){const r=oYe(e.sequence).map(s=>({[s]:uV(e,s)})).reduce((s,o)=>({...s,...o}),{}),i=[];return Array.from({length:t}).forEach(()=>{const s=sYe(e.sequence,r);s.push("end"),i.push(s),Object.entries(r).forEach(([o,a])=>{a.length===0&&(r[o]=uV(e,o))})}),i}async function uYe(e,t){const n=await(await fetch(`${Bu}${e}`)).text();return eJ(n,t)}function lYe(e,t,n){const r=[];if(e&&t&&n){const i=[];i.push({path:"/",element:$.jsx(kqe,{to:`${n[0]}`,replace:!0})}),n.forEach(o=>{o==="end"?i.push({path:"/end",element:$.jsx(rYe,{})}):i.push({path:`/${o}`,element:$.jsx(Nqe,{})})});const s={element:$.jsx(nYe,{}),children:i};r.push(s)}return r}function cYe({globalConfig:e}){const{studyId:t}=KN();if(!t||!e.configsList.find(f=>WP(f)))throw new Error("Study id invalid");const[n,r]=w.useState(null);w.useEffect(()=>{const f=e.configsList.find(d=>WP(d)===t);if(f){const d=e.configs[f];uYe(`${d.path}`,f).then(h=>{r(h)})}},[e,t]);const[i,s]=w.useState([]),[o,a]=w.useState(null),{storageEngine:u}=vf(),[l]=QN();w.useEffect(()=>{async function f(){if(!u||!n||!t)return;await u.initializeStudyDb(t,n),await u.getSequenceArray()||await u.setSequenceArray(await aYe(n));const h=n.uiConfig.urlParticipantIdParam&&l.get(n.uiConfig.urlParticipantIdParam)||void 0,p=Object.fromEntries(l.entries()),m=await u.initializeParticipantSession(p,n,h),y=await eke(t,n,m.sequence,m.answers);a(y),s(lYe(t,n,m.sequence))}f()},[u,n,t,l]);const c=dW(i);return!c||!o?$.jsx(ut,{style:{height:"100vh"},children:$.jsx(Nd,{style:{height:"100%"},children:$.jsx(Lm,{style:{height:"100%"},size:60})})}):$.jsx(EJ.Provider,{value:o,children:$.jsx(CAe,{store:o.store,children:c})})}async function fYe(){const t=await(await fetch(`${Bu}configs/global.json`)).text();return XRe(t)}async function dYe(e){const t={},n=e.configsList.map(i=>`${Bu}${e.configs[i].path}`),r=await Promise.all(n.map(i=>fetch(i))).then(i=>Promise.all(i.map(s=>s.text()))).then(i=>Promise.all(i.map((s,o)=>eJ(s,e.configsList[o]))));return e.configsList.forEach((i,s)=>{t[i]=r[s]}),t}function hYe(){const[e,t]=w.useState(null),[n,r]=w.useState({});return w.useEffect(()=>{async function i(){e&&r(await dYe(e))}i()},[e]),w.useEffect(()=>{e||fYe().then(i=>{t(i)})},[e]),e?$.jsx(ide,{basename:Bu,children:$.jsxs(nde,{children:[$.jsx(IP,{path:"/",element:$.jsx(YCe,{globalConfig:e,studyConfigs:n})}),$.jsx(IP,{path:"/:studyId/*",element:$.jsx(cYe,{globalConfig:e})})]})}):null}function S1(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 jie={exports:{}};/*! localForage -- Offline Storage, Improved Version 1.10.0 https://localforage.github.io/localForage (c) 2013-2017 Mozilla, Apache License 2.0 -*/(function(e,t){(function(n){e.exports=n()})(function(){return function n(r,i,s){function o(l,c){if(!i[l]){if(!r[l]){var f=typeof S1=="function"&&S1;if(!c&&f)return f(l,!0);if(a)return a(l,!0);var d=new Error("Cannot find module '"+l+"'");throw d.code="MODULE_NOT_FOUND",d}var h=i[l]={exports:{}};r[l][0].call(h.exports,function(p){var m=r[l][1][p];return o(m||p)},h,h.exports,n,r,i,s)}return i[l].exports}for(var a=typeof S1=="function"&&S1,u=0;u"u"&&n(3);var f=Promise;function d(N,G){G&&N.then(function(F){G(null,F)},function(F){G(F)})}function h(N,G,F){typeof G=="function"&&N.then(G),typeof F=="function"&&N.catch(F)}function p(N){return typeof N!="string"&&(console.warn(N+" used as a key, but it is not a string."),N=String(N)),N}function m(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var y="local-forage-detect-blob-support",g=void 0,_={},b=Object.prototype.toString,T="readonly",I="readwrite";function E(N){for(var G=N.length,F=new ArrayBuffer(G),ne=new Uint8Array(F),ie=0;ie=43)}}).catch(function(){return!1})}function A(N){return typeof g=="boolean"?f.resolve(g):S(N).then(function(G){return g=G,g})}function P(N){var G=_[N.name],F={};F.promise=new f(function(ne,ie){F.resolve=ne,F.reject=ie}),G.deferredOperations.push(F),G.dbReady?G.dbReady=G.dbReady.then(function(){return F.promise}):G.dbReady=F.promise}function V(N){var G=_[N.name],F=G.deferredOperations.pop();if(F)return F.resolve(),F.promise}function M(N,G){var F=_[N.name],ne=F.deferredOperations.pop();if(ne)return ne.reject(G),ne.promise}function H(N,G){return new f(function(F,ne){if(_[N.name]=_[N.name]||C(),N.db)if(G)P(N),N.db.close();else return F(N.db);var ie=[N.name];G&&ie.push(N.version);var ee=u.open.apply(u,ie);G&&(ee.onupgradeneeded=function(be){var Ie=ee.result;try{Ie.createObjectStore(N.storeName),be.oldVersion<=1&&Ie.createObjectStore(y)}catch(Oe){if(Oe.name==="ConstraintError")console.warn('The database "'+N.name+'" has been upgraded from version '+be.oldVersion+" to version "+be.newVersion+', but the storage "'+N.storeName+'" already exists.');else throw Oe}}),ee.onerror=function(be){be.preventDefault(),ne(ee.error)},ee.onsuccess=function(){var be=ee.result;be.onversionchange=function(Ie){Ie.target.close()},F(be),V(N)}})}function J(N){return H(N,!1)}function Y(N){return H(N,!0)}function ye(N,G){if(!N.db)return!0;var F=!N.db.objectStoreNames.contains(N.storeName),ne=N.versionN.db.version;if(ne&&(N.version!==G&&console.warn('The database "'+N.name+`" can't be downgraded from version `+N.db.version+" to version "+N.version+"."),N.version=N.db.version),ie||F){if(F){var ee=N.db.version+1;ee>N.version&&(N.version=ee)}return!0}return!1}function he(N){return new f(function(G,F){var ne=new FileReader;ne.onerror=F,ne.onloadend=function(ie){var ee=btoa(ie.target.result||"");G({__local_forage_encoded_blob:!0,data:ee,type:N.type})},ne.readAsBinaryString(N)})}function ve(N){var G=E(atob(N.data));return c([G],{type:N.type})}function te(N){return N&&N.__local_forage_encoded_blob}function se(N){var G=this,F=G._initReady().then(function(){var ne=_[G._dbInfo.name];if(ne&&ne.dbReady)return ne.dbReady});return h(F,N,N),F}function K(N){P(N);for(var G=_[N.name],F=G.forages,ne=0;ne0&&(!N.db||ee.name==="InvalidStateError"||ee.name==="NotFoundError"))return f.resolve().then(function(){if(!N.db||ee.name==="NotFoundError"&&!N.db.objectStoreNames.contains(N.storeName)&&N.version<=N.db.version)return N.db&&(N.version=N.db.version+1),Y(N)}).then(function(){return K(N).then(function(){x(N,G,F,ne-1)})}).catch(F);F(ee)}}function C(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function z(N){var G=this,F={db:null};if(N)for(var ne in N)F[ne]=N[ne];var ie=_[F.name];ie||(ie=C(),_[F.name]=ie),ie.forages.push(G),G._initReady||(G._initReady=G.ready,G.ready=se);var ee=[];function be(){return f.resolve()}for(var Ie=0;Ie>4,ke[ie++]=(be&15)<<4|Ie>>2,ke[ie++]=(Ie&3)<<6|Oe&63;return Pe}function Me(N){var G=new Uint8Array(N),F="",ne;for(ne=0;ne>2],F+=qe[(G[ne]&3)<<4|G[ne+1]>>4],F+=qe[(G[ne+1]&15)<<2|G[ne+2]>>6],F+=qe[G[ne+2]&63];return G.length%3===2?F=F.substring(0,F.length-1)+"=":G.length%3===1&&(F=F.substring(0,F.length-2)+"=="),F}function Ze(N,G){var F="";if(N&&(F=De.call(N)),N&&(F==="[object ArrayBuffer]"||N.buffer&&De.call(N.buffer)==="[object ArrayBuffer]")){var ne,ie=lt;N instanceof ArrayBuffer?(ne=N,ie+=Ue):(ne=N.buffer,F==="[object Int8Array]"?ie+=bt:F==="[object Uint8Array]"?ie+=je:F==="[object Uint8ClampedArray]"?ie+=gt:F==="[object Int16Array]"?ie+=Gt:F==="[object Uint16Array]"?ie+=Gn:F==="[object Int32Array]"?ie+=an:F==="[object Uint32Array]"?ie+=ue:F==="[object Float32Array]"?ie+=we:F==="[object Float64Array]"?ie+=Le:G(new Error("Failed to get type for BinaryArray"))),G(ie+Me(ne))}else if(F==="[object Blob]"){var ee=new FileReader;ee.onload=function(){var be=$e+N.type+"~"+Me(this.result);G(lt+Be+be)},ee.readAsArrayBuffer(N)}else try{G(JSON.stringify(N))}catch(be){console.error("Couldn't convert value into a JSON string: ",N),G(null,be)}}function bn(N){if(N.substring(0,On)!==lt)return JSON.parse(N);var G=N.substring(rt),F=N.substring(On,rt),ne;if(F===Be&&ot.test(G)){var ie=G.match(ot);ne=ie[1],G=G.substring(ie[0].length)}var ee=it(G);switch(F){case Ue:return ee;case Be:return c([ee],{type:ne});case bt:return new Int8Array(ee);case je:return new Uint8Array(ee);case gt:return new Uint8ClampedArray(ee);case Gt:return new Int16Array(ee);case Gn:return new Uint16Array(ee);case an:return new Int32Array(ee);case ue:return new Uint32Array(ee);case we:return new Float32Array(ee);case Le:return new Float64Array(ee);default:throw new Error("Unkown type: "+F)}}var Wt={serialize:Ze,deserialize:bn,stringToBuffer:it,bufferToString:Me};function It(N,G,F,ne){N.executeSql("CREATE TABLE IF NOT EXISTS "+G.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],F,ne)}function Bn(N){var G=this,F={db:null};if(N)for(var ne in N)F[ne]=typeof N[ne]!="string"?N[ne].toString():N[ne];var ie=new f(function(ee,be){try{F.db=openDatabase(F.name,String(F.version),F.description,F.size)}catch(Ie){return be(Ie)}F.db.transaction(function(Ie){It(Ie,F,function(){G._dbInfo=F,ee()},function(Oe,Pe){be(Pe)})},be)});return F.serializer=Wt,ie}function En(N,G,F,ne,ie,ee){N.executeSql(F,ne,ie,function(be,Ie){Ie.code===Ie.SYNTAX_ERR?be.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[G.storeName],function(Oe,Pe){Pe.rows.length?ee(Oe,Ie):It(Oe,G,function(){Oe.executeSql(F,ne,ie,ee)},ee)},ee):ee(be,Ie)},ee)}function sa(N,G){var F=this;N=p(N);var ne=new f(function(ie,ee){F.ready().then(function(){var be=F._dbInfo;be.db.transaction(function(Ie){En(Ie,be,"SELECT * FROM "+be.storeName+" WHERE key = ? LIMIT 1",[N],function(Oe,Pe){var ke=Pe.rows.length?Pe.rows.item(0).value:null;ke&&(ke=be.serializer.deserialize(ke)),ie(ke)},function(Oe,Pe){ee(Pe)})})}).catch(ee)});return d(ne,G),ne}function fr(N,G){var F=this,ne=new f(function(ie,ee){F.ready().then(function(){var be=F._dbInfo;be.db.transaction(function(Ie){En(Ie,be,"SELECT * FROM "+be.storeName,[],function(Oe,Pe){for(var ke=Pe.rows,Qe=ke.length,Bt=0;Bt0){be(Mi.apply(ie,[N,Oe,F,ne-1]));return}Ie(Bt)}})})}).catch(Ie)});return d(ee,F),ee}function vr(N,G,F){return Mi.apply(this,[N,G,F,1])}function $r(N,G){var F=this;N=p(N);var ne=new f(function(ie,ee){F.ready().then(function(){var be=F._dbInfo;be.db.transaction(function(Ie){En(Ie,be,"DELETE FROM "+be.storeName+" WHERE key = ?",[N],function(){ie()},function(Oe,Pe){ee(Pe)})})}).catch(ee)});return d(ne,G),ne}function dr(N){var G=this,F=new f(function(ne,ie){G.ready().then(function(){var ee=G._dbInfo;ee.db.transaction(function(be){En(be,ee,"DELETE FROM "+ee.storeName,[],function(){ne()},function(Ie,Oe){ie(Oe)})})}).catch(ie)});return d(F,N),F}function jn(N){var G=this,F=new f(function(ne,ie){G.ready().then(function(){var ee=G._dbInfo;ee.db.transaction(function(be){En(be,ee,"SELECT COUNT(key) as c FROM "+ee.storeName,[],function(Ie,Oe){var Pe=Oe.rows.item(0).c;ne(Pe)},function(Ie,Oe){ie(Oe)})})}).catch(ie)});return d(F,N),F}function Zt(N,G){var F=this,ne=new f(function(ie,ee){F.ready().then(function(){var be=F._dbInfo;be.db.transaction(function(Ie){En(Ie,be,"SELECT key FROM "+be.storeName+" WHERE id = ? LIMIT 1",[N+1],function(Oe,Pe){var ke=Pe.rows.length?Pe.rows.item(0).key:null;ie(ke)},function(Oe,Pe){ee(Pe)})})}).catch(ee)});return d(ne,G),ne}function ri(N){var G=this,F=new f(function(ne,ie){G.ready().then(function(){var ee=G._dbInfo;ee.db.transaction(function(be){En(be,ee,"SELECT key FROM "+ee.storeName,[],function(Ie,Oe){for(var Pe=[],ke=0;ke '__WebKitDatabaseInfoTable__'",[],function(ie,ee){for(var be=[],Ie=0;Ie0}function de(N){var G=this,F={};if(N)for(var ne in N)F[ne]=N[ne];return F.keyPrefix=Q(N,G._defaultConfig),Z()?(G._dbInfo=F,F.serializer=Wt,f.resolve()):f.reject()}function fe(N){var G=this,F=G.ready().then(function(){for(var ne=G._dbInfo.keyPrefix,ie=localStorage.length-1;ie>=0;ie--){var ee=localStorage.key(ie);ee.indexOf(ne)===0&&localStorage.removeItem(ee)}});return d(F,N),F}function He(N,G){var F=this;N=p(N);var ne=F.ready().then(function(){var ie=F._dbInfo,ee=localStorage.getItem(ie.keyPrefix+N);return ee&&(ee=ie.serializer.deserialize(ee)),ee});return d(ne,G),ne}function Te(N,G){var F=this,ne=F.ready().then(function(){for(var ie=F._dbInfo,ee=ie.keyPrefix,be=ee.length,Ie=localStorage.length,Oe=1,Pe=0;Pe=0;be--){var Ie=localStorage.key(be);Ie.indexOf(ee)===0&&localStorage.removeItem(Ie)}}):ie=f.reject("Invalid arguments"),d(ie,G),ie}var pt={_driver:"localStorageWrapper",_initStorage:de,_support:ms(),iterate:Te,getItem:He,setItem:Lt,removeItem:mt,clear:fe,length:Je,key:Ve,keys:ft,dropInstance:$n},xn=function(G,F){return G===F||typeof G=="number"&&typeof F=="number"&&isNaN(G)&&isNaN(F)},Et=function(G,F){for(var ne=G.length,ie=0;ie"u"?"undefined":s(F))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var ne in F){if(ne==="storeName"&&(F[ne]=F[ne].replace(/\W/g,"_")),ne==="version"&&typeof F[ne]!="number")return new Error("Database version must be a number.");this._config[ne]=F[ne]}return"driver"in F&&F.driver?this.setDriver(this._config.driver):!0}else return typeof F=="string"?this._config[F]:this._config},N.prototype.defineDriver=function(F,ne,ie){var ee=new f(function(be,Ie){try{var Oe=F._driver,Pe=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!F._driver){Ie(Pe);return}for(var ke=hr.concat("_initStorage"),Qe=0,Bt=ke.length;Qes.toString(16).padStart(2,"0")).join("")}class vYe extends zie{constructor(){super("localStorage");Gs(this,"studyDatabase")}async connect(){this.connected=!0}async initializeStudyDb(n,r){this.studyDatabase=await Vie.createInstance({name:n});const i=await Dp(JSON.stringify(r)),s=await this.studyDatabase.getItem("configs");await this.studyDatabase.setItem("configs",{...s,[i]:r})}async initializeParticipantSession(n,r,i){var u;if(!this._verifyStudyDatabase(this.studyDatabase))throw new Error("Study database not initialized");if(await this.getCurrentParticipantId(i),!this.currentParticipantId)throw new Error("Participant not initialized");const s=await this.studyDatabase.getItem(this.currentParticipantId);if(s)return s;const o=await Dp(JSON.stringify(r)),a={participantId:this.currentParticipantId,participantConfigHash:o,sequence:await this.getSequence(),answers:{},searchParams:n};return await((u=this.studyDatabase)==null?void 0:u.setItem(this.currentParticipantId,a)),a}async getCurrentParticipantId(n){if(!this._verifyStudyDatabase(this.studyDatabase))throw new Error("Study database not initialized");const r=await this.studyDatabase.getItem("currentParticipant");if(n)return this.currentParticipantId=n,await this.studyDatabase.setItem("currentParticipant",n),n;if(r)return this.currentParticipantId=r,r;const i=cV();return await this.studyDatabase.setItem("currentParticipant",i),this.currentParticipantId=i,i}async clearCurrentParticipantId(){if(!this._verifyStudyDatabase(this.studyDatabase))throw new Error("Study database not initialized");await this.studyDatabase.removeItem("currentParticipant")}async saveAnswer(n,r){if(!this._verifyStudyDatabase(this.studyDatabase))throw new Error("Study database not initialized");if(!this.currentParticipantId)throw new Error("Participant not initialized");const i=await this.studyDatabase.getItem(this.currentParticipantId);if(!i)throw new Error("Participant not initialized");i.answers[n]=r,await this.studyDatabase.setItem(this.currentParticipantId,i)}async setSequenceArray(n){if(!this._verifyStudyDatabase(this.studyDatabase))throw new Error("Study database not initialized");this.studyDatabase.setItem("sequenceArray",n)}async getSequence(){if(!this._verifyStudyDatabase(this.studyDatabase))throw new Error("Study database not initialized");const n=await this.studyDatabase.getItem("sequenceArray");if(!n)throw new Error("Latin square not initialized");const r=n.pop();if(!r)throw new Error("Latin square is empty");return await this.studyDatabase.setItem("sequenceArray",n),r}async getSequenceArray(){if(!this._verifyStudyDatabase(this.studyDatabase))throw new Error("Study database not initialized");return await this.studyDatabase.getItem("sequenceArray")}async getAllParticipantsData(){if(!this._verifyStudyDatabase(this.studyDatabase))throw new Error("Study database not initialized");const n=[];return await this.studyDatabase.iterate((r,i)=>{i!=="config"&&i!=="currentParticipant"&&i!=="sequenceArray"&&n.push(r)}),n}async getParticipantData(){if(!this._verifyStudyDatabase(this.studyDatabase))throw new Error("Study database not initialized");const n=await this.studyDatabase.getItem("currentParticipant");return n?await this.studyDatabase.getItem(n):null}async nextParticipant(n){if(!this._verifyStudyDatabase(this.studyDatabase))throw new Error("Study database not initialized");const r=cV();this.studyDatabase.setItem("currentParticipant",r),this.currentParticipantId=r;let i=await this.studyDatabase.getItem(r);if(!i){const s=await Dp(JSON.stringify(n)),o={participantId:r,participantConfigHash:s,sequence:await this.getSequence(),answers:{},searchParams:{}};await this.studyDatabase.setItem(r,o),i=o}return i}async verifyCompletion(){if(!this._verifyStudyDatabase(this.studyDatabase))throw new Error("Study database not initialized");const n=await this.getParticipantData();if(!n)throw new Error("Participant not initialized");return n.sequence.every(i=>i==="end"?!0:n.answers[i]!==void 0)}_verifyStudyDatabase(n){return n!==void 0}}var fV={};/** +*/(function(e,t){(function(n){e.exports=n()})(function(){return function n(r,i,s){function o(l,c){if(!i[l]){if(!r[l]){var f=typeof S1=="function"&&S1;if(!c&&f)return f(l,!0);if(a)return a(l,!0);var d=new Error("Cannot find module '"+l+"'");throw d.code="MODULE_NOT_FOUND",d}var h=i[l]={exports:{}};r[l][0].call(h.exports,function(p){var m=r[l][1][p];return o(m||p)},h,h.exports,n,r,i,s)}return i[l].exports}for(var a=typeof S1=="function"&&S1,u=0;u"u"&&n(3);var f=Promise;function d(N,G){G&&N.then(function(F){G(null,F)},function(F){G(F)})}function h(N,G,F){typeof G=="function"&&N.then(G),typeof F=="function"&&N.catch(F)}function p(N){return typeof N!="string"&&(console.warn(N+" used as a key, but it is not a string."),N=String(N)),N}function m(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var y="local-forage-detect-blob-support",g=void 0,_={},b=Object.prototype.toString,T="readonly",I="readwrite";function E(N){for(var G=N.length,F=new ArrayBuffer(G),ne=new Uint8Array(F),ie=0;ie=43)}}).catch(function(){return!1})}function A(N){return typeof g=="boolean"?f.resolve(g):S(N).then(function(G){return g=G,g})}function P(N){var G=_[N.name],F={};F.promise=new f(function(ne,ie){F.resolve=ne,F.reject=ie}),G.deferredOperations.push(F),G.dbReady?G.dbReady=G.dbReady.then(function(){return F.promise}):G.dbReady=F.promise}function V(N){var G=_[N.name],F=G.deferredOperations.pop();if(F)return F.resolve(),F.promise}function M(N,G){var F=_[N.name],ne=F.deferredOperations.pop();if(ne)return ne.reject(G),ne.promise}function H(N,G){return new f(function(F,ne){if(_[N.name]=_[N.name]||C(),N.db)if(G)P(N),N.db.close();else return F(N.db);var ie=[N.name];G&&ie.push(N.version);var ee=u.open.apply(u,ie);G&&(ee.onupgradeneeded=function(be){var Ie=ee.result;try{Ie.createObjectStore(N.storeName),be.oldVersion<=1&&Ie.createObjectStore(y)}catch(Oe){if(Oe.name==="ConstraintError")console.warn('The database "'+N.name+'" has been upgraded from version '+be.oldVersion+" to version "+be.newVersion+', but the storage "'+N.storeName+'" already exists.');else throw Oe}}),ee.onerror=function(be){be.preventDefault(),ne(ee.error)},ee.onsuccess=function(){var be=ee.result;be.onversionchange=function(Ie){Ie.target.close()},F(be),V(N)}})}function J(N){return H(N,!1)}function Y(N){return H(N,!0)}function ye(N,G){if(!N.db)return!0;var F=!N.db.objectStoreNames.contains(N.storeName),ne=N.versionN.db.version;if(ne&&(N.version!==G&&console.warn('The database "'+N.name+`" can't be downgraded from version `+N.db.version+" to version "+N.version+"."),N.version=N.db.version),ie||F){if(F){var ee=N.db.version+1;ee>N.version&&(N.version=ee)}return!0}return!1}function he(N){return new f(function(G,F){var ne=new FileReader;ne.onerror=F,ne.onloadend=function(ie){var ee=btoa(ie.target.result||"");G({__local_forage_encoded_blob:!0,data:ee,type:N.type})},ne.readAsBinaryString(N)})}function ve(N){var G=E(atob(N.data));return c([G],{type:N.type})}function te(N){return N&&N.__local_forage_encoded_blob}function se(N){var G=this,F=G._initReady().then(function(){var ne=_[G._dbInfo.name];if(ne&&ne.dbReady)return ne.dbReady});return h(F,N,N),F}function K(N){P(N);for(var G=_[N.name],F=G.forages,ne=0;ne0&&(!N.db||ee.name==="InvalidStateError"||ee.name==="NotFoundError"))return f.resolve().then(function(){if(!N.db||ee.name==="NotFoundError"&&!N.db.objectStoreNames.contains(N.storeName)&&N.version<=N.db.version)return N.db&&(N.version=N.db.version+1),Y(N)}).then(function(){return K(N).then(function(){x(N,G,F,ne-1)})}).catch(F);F(ee)}}function C(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function z(N){var G=this,F={db:null};if(N)for(var ne in N)F[ne]=N[ne];var ie=_[F.name];ie||(ie=C(),_[F.name]=ie),ie.forages.push(G),G._initReady||(G._initReady=G.ready,G.ready=se);var ee=[];function be(){return f.resolve()}for(var Ie=0;Ie>4,ke[ie++]=(be&15)<<4|Ie>>2,ke[ie++]=(Ie&3)<<6|Oe&63;return Pe}function Me(N){var G=new Uint8Array(N),F="",ne;for(ne=0;ne>2],F+=qe[(G[ne]&3)<<4|G[ne+1]>>4],F+=qe[(G[ne+1]&15)<<2|G[ne+2]>>6],F+=qe[G[ne+2]&63];return G.length%3===2?F=F.substring(0,F.length-1)+"=":G.length%3===1&&(F=F.substring(0,F.length-2)+"=="),F}function Ze(N,G){var F="";if(N&&(F=De.call(N)),N&&(F==="[object ArrayBuffer]"||N.buffer&&De.call(N.buffer)==="[object ArrayBuffer]")){var ne,ie=lt;N instanceof ArrayBuffer?(ne=N,ie+=Ue):(ne=N.buffer,F==="[object Int8Array]"?ie+=bt:F==="[object Uint8Array]"?ie+=je:F==="[object Uint8ClampedArray]"?ie+=gt:F==="[object Int16Array]"?ie+=Gt:F==="[object Uint16Array]"?ie+=Gn:F==="[object Int32Array]"?ie+=an:F==="[object Uint32Array]"?ie+=ue:F==="[object Float32Array]"?ie+=we:F==="[object Float64Array]"?ie+=Le:G(new Error("Failed to get type for BinaryArray"))),G(ie+Me(ne))}else if(F==="[object Blob]"){var ee=new FileReader;ee.onload=function(){var be=$e+N.type+"~"+Me(this.result);G(lt+Be+be)},ee.readAsArrayBuffer(N)}else try{G(JSON.stringify(N))}catch(be){console.error("Couldn't convert value into a JSON string: ",N),G(null,be)}}function bn(N){if(N.substring(0,On)!==lt)return JSON.parse(N);var G=N.substring(rt),F=N.substring(On,rt),ne;if(F===Be&&ot.test(G)){var ie=G.match(ot);ne=ie[1],G=G.substring(ie[0].length)}var ee=it(G);switch(F){case Ue:return ee;case Be:return c([ee],{type:ne});case bt:return new Int8Array(ee);case je:return new Uint8Array(ee);case gt:return new Uint8ClampedArray(ee);case Gt:return new Int16Array(ee);case Gn:return new Uint16Array(ee);case an:return new Int32Array(ee);case ue:return new Uint32Array(ee);case we:return new Float32Array(ee);case Le:return new Float64Array(ee);default:throw new Error("Unkown type: "+F)}}var Wt={serialize:Ze,deserialize:bn,stringToBuffer:it,bufferToString:Me};function It(N,G,F,ne){N.executeSql("CREATE TABLE IF NOT EXISTS "+G.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],F,ne)}function Bn(N){var G=this,F={db:null};if(N)for(var ne in N)F[ne]=typeof N[ne]!="string"?N[ne].toString():N[ne];var ie=new f(function(ee,be){try{F.db=openDatabase(F.name,String(F.version),F.description,F.size)}catch(Ie){return be(Ie)}F.db.transaction(function(Ie){It(Ie,F,function(){G._dbInfo=F,ee()},function(Oe,Pe){be(Pe)})},be)});return F.serializer=Wt,ie}function En(N,G,F,ne,ie,ee){N.executeSql(F,ne,ie,function(be,Ie){Ie.code===Ie.SYNTAX_ERR?be.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[G.storeName],function(Oe,Pe){Pe.rows.length?ee(Oe,Ie):It(Oe,G,function(){Oe.executeSql(F,ne,ie,ee)},ee)},ee):ee(be,Ie)},ee)}function sa(N,G){var F=this;N=p(N);var ne=new f(function(ie,ee){F.ready().then(function(){var be=F._dbInfo;be.db.transaction(function(Ie){En(Ie,be,"SELECT * FROM "+be.storeName+" WHERE key = ? LIMIT 1",[N],function(Oe,Pe){var ke=Pe.rows.length?Pe.rows.item(0).value:null;ke&&(ke=be.serializer.deserialize(ke)),ie(ke)},function(Oe,Pe){ee(Pe)})})}).catch(ee)});return d(ne,G),ne}function fr(N,G){var F=this,ne=new f(function(ie,ee){F.ready().then(function(){var be=F._dbInfo;be.db.transaction(function(Ie){En(Ie,be,"SELECT * FROM "+be.storeName,[],function(Oe,Pe){for(var ke=Pe.rows,Qe=ke.length,Bt=0;Bt0){be(Mi.apply(ie,[N,Oe,F,ne-1]));return}Ie(Bt)}})})}).catch(Ie)});return d(ee,F),ee}function vr(N,G,F){return Mi.apply(this,[N,G,F,1])}function $r(N,G){var F=this;N=p(N);var ne=new f(function(ie,ee){F.ready().then(function(){var be=F._dbInfo;be.db.transaction(function(Ie){En(Ie,be,"DELETE FROM "+be.storeName+" WHERE key = ?",[N],function(){ie()},function(Oe,Pe){ee(Pe)})})}).catch(ee)});return d(ne,G),ne}function dr(N){var G=this,F=new f(function(ne,ie){G.ready().then(function(){var ee=G._dbInfo;ee.db.transaction(function(be){En(be,ee,"DELETE FROM "+ee.storeName,[],function(){ne()},function(Ie,Oe){ie(Oe)})})}).catch(ie)});return d(F,N),F}function jn(N){var G=this,F=new f(function(ne,ie){G.ready().then(function(){var ee=G._dbInfo;ee.db.transaction(function(be){En(be,ee,"SELECT COUNT(key) as c FROM "+ee.storeName,[],function(Ie,Oe){var Pe=Oe.rows.item(0).c;ne(Pe)},function(Ie,Oe){ie(Oe)})})}).catch(ie)});return d(F,N),F}function Zt(N,G){var F=this,ne=new f(function(ie,ee){F.ready().then(function(){var be=F._dbInfo;be.db.transaction(function(Ie){En(Ie,be,"SELECT key FROM "+be.storeName+" WHERE id = ? LIMIT 1",[N+1],function(Oe,Pe){var ke=Pe.rows.length?Pe.rows.item(0).key:null;ie(ke)},function(Oe,Pe){ee(Pe)})})}).catch(ee)});return d(ne,G),ne}function ri(N){var G=this,F=new f(function(ne,ie){G.ready().then(function(){var ee=G._dbInfo;ee.db.transaction(function(be){En(be,ee,"SELECT key FROM "+ee.storeName,[],function(Ie,Oe){for(var Pe=[],ke=0;ke '__WebKitDatabaseInfoTable__'",[],function(ie,ee){for(var be=[],Ie=0;Ie0}function de(N){var G=this,F={};if(N)for(var ne in N)F[ne]=N[ne];return F.keyPrefix=Q(N,G._defaultConfig),Z()?(G._dbInfo=F,F.serializer=Wt,f.resolve()):f.reject()}function fe(N){var G=this,F=G.ready().then(function(){for(var ne=G._dbInfo.keyPrefix,ie=localStorage.length-1;ie>=0;ie--){var ee=localStorage.key(ie);ee.indexOf(ne)===0&&localStorage.removeItem(ee)}});return d(F,N),F}function He(N,G){var F=this;N=p(N);var ne=F.ready().then(function(){var ie=F._dbInfo,ee=localStorage.getItem(ie.keyPrefix+N);return ee&&(ee=ie.serializer.deserialize(ee)),ee});return d(ne,G),ne}function Te(N,G){var F=this,ne=F.ready().then(function(){for(var ie=F._dbInfo,ee=ie.keyPrefix,be=ee.length,Ie=localStorage.length,Oe=1,Pe=0;Pe=0;be--){var Ie=localStorage.key(be);Ie.indexOf(ee)===0&&localStorage.removeItem(Ie)}}):ie=f.reject("Invalid arguments"),d(ie,G),ie}var pt={_driver:"localStorageWrapper",_initStorage:de,_support:ms(),iterate:Te,getItem:He,setItem:Lt,removeItem:mt,clear:fe,length:Je,key:Ve,keys:ft,dropInstance:$n},xn=function(G,F){return G===F||typeof G=="number"&&typeof F=="number"&&isNaN(G)&&isNaN(F)},Et=function(G,F){for(var ne=G.length,ie=0;ie"u"?"undefined":s(F))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var ne in F){if(ne==="storeName"&&(F[ne]=F[ne].replace(/\W/g,"_")),ne==="version"&&typeof F[ne]!="number")return new Error("Database version must be a number.");this._config[ne]=F[ne]}return"driver"in F&&F.driver?this.setDriver(this._config.driver):!0}else return typeof F=="string"?this._config[F]:this._config},N.prototype.defineDriver=function(F,ne,ie){var ee=new f(function(be,Ie){try{var Oe=F._driver,Pe=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!F._driver){Ie(Pe);return}for(var ke=hr.concat("_initStorage"),Qe=0,Bt=ke.length;Qes.toString(16).padStart(2,"0")).join("")}class vYe extends Vie{constructor(){super("localStorage");Gs(this,"studyDatabase")}async connect(){this.connected=!0}async initializeStudyDb(n,r){this.studyDatabase=await Uie.createInstance({name:n});const i=await Dp(JSON.stringify(r)),s=await this.studyDatabase.getItem("configs");await this.studyDatabase.setItem("configs",{...s,[i]:r})}async initializeParticipantSession(n,r,i){var u;if(!this._verifyStudyDatabase(this.studyDatabase))throw new Error("Study database not initialized");if(await this.getCurrentParticipantId(i),!this.currentParticipantId)throw new Error("Participant not initialized");const s=await this.studyDatabase.getItem(this.currentParticipantId);if(s)return s;const o=await Dp(JSON.stringify(r)),a={participantId:this.currentParticipantId,participantConfigHash:o,sequence:await this.getSequence(),answers:{},searchParams:n};return await((u=this.studyDatabase)==null?void 0:u.setItem(this.currentParticipantId,a)),a}async getCurrentParticipantId(n){if(!this._verifyStudyDatabase(this.studyDatabase))throw new Error("Study database not initialized");const r=await this.studyDatabase.getItem("currentParticipant");if(n)return this.currentParticipantId=n,await this.studyDatabase.setItem("currentParticipant",n),n;if(r)return this.currentParticipantId=r,r;const i=cV();return await this.studyDatabase.setItem("currentParticipant",i),this.currentParticipantId=i,i}async clearCurrentParticipantId(){if(!this._verifyStudyDatabase(this.studyDatabase))throw new Error("Study database not initialized");await this.studyDatabase.removeItem("currentParticipant")}async saveAnswer(n,r){if(!this._verifyStudyDatabase(this.studyDatabase))throw new Error("Study database not initialized");if(!this.currentParticipantId)throw new Error("Participant not initialized");const i=await this.studyDatabase.getItem(this.currentParticipantId);if(!i)throw new Error("Participant not initialized");i.answers[n]=r,await this.studyDatabase.setItem(this.currentParticipantId,i)}async setSequenceArray(n){if(!this._verifyStudyDatabase(this.studyDatabase))throw new Error("Study database not initialized");this.studyDatabase.setItem("sequenceArray",n)}async getSequence(){if(!this._verifyStudyDatabase(this.studyDatabase))throw new Error("Study database not initialized");const n=await this.studyDatabase.getItem("sequenceArray");if(!n)throw new Error("Latin square not initialized");const r=n.pop();if(!r)throw new Error("Latin square is empty");return await this.studyDatabase.setItem("sequenceArray",n),r}async getSequenceArray(){if(!this._verifyStudyDatabase(this.studyDatabase))throw new Error("Study database not initialized");return await this.studyDatabase.getItem("sequenceArray")}async getAllParticipantsData(){if(!this._verifyStudyDatabase(this.studyDatabase))throw new Error("Study database not initialized");const n=[];return await this.studyDatabase.iterate((r,i)=>{i!=="config"&&i!=="currentParticipant"&&i!=="sequenceArray"&&n.push(r)}),n}async getParticipantData(){if(!this._verifyStudyDatabase(this.studyDatabase))throw new Error("Study database not initialized");const n=await this.studyDatabase.getItem("currentParticipant");return n?await this.studyDatabase.getItem(n):null}async nextParticipant(n){if(!this._verifyStudyDatabase(this.studyDatabase))throw new Error("Study database not initialized");const r=cV();this.studyDatabase.setItem("currentParticipant",r),this.currentParticipantId=r;let i=await this.studyDatabase.getItem(r);if(!i){const s=await Dp(JSON.stringify(n)),o={participantId:r,participantConfigHash:s,sequence:await this.getSequence(),answers:{},searchParams:{}};await this.studyDatabase.setItem(r,o),i=o}return i}async verifyCompletion(){if(!this._verifyStudyDatabase(this.studyDatabase))throw new Error("Study database not initialized");const n=await this.getParticipantData();if(!n)throw new Error("Participant not initialized");return n.sequence.every(i=>i==="end"?!0:n.answers[i]!==void 0)}_verifyStudyDatabase(n){return n!==void 0}}var fV={};/** * @license * Copyright 2017 Google LLC * @@ -244,7 +244,7 @@ Note: ${rie}. ${iie}, or ${hHe}.`,mHe=`The ${mte} method is not valid in multi-t * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const Hie=function(e){const t=[];let n=0;for(let r=0;r>6|192,t[n++]=i&63|128):(i&64512)===55296&&r+1>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=i&63|128):(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=i&63|128)}return t},bYe=function(e){const t=[];let n=0,r=0;for(;n191&&i<224){const s=e[n++];t[r++]=String.fromCharCode((i&31)<<6|s&63)}else if(i>239&&i<365){const s=e[n++],o=e[n++],a=e[n++],u=((i&7)<<18|(s&63)<<12|(o&63)<<6|a&63)-65536;t[r++]=String.fromCharCode(55296+(u>>10)),t[r++]=String.fromCharCode(56320+(u&1023))}else{const s=e[n++],o=e[n++];t[r++]=String.fromCharCode((i&15)<<12|(s&63)<<6|o&63)}}return t.join("")},q3={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let i=0;i>2,f=(s&3)<<4|a>>4;let d=(a&15)<<2|l>>6,h=l&63;u||(h=64,o||(d=64)),r.push(n[c],n[f],n[d],n[h])}return r.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(Hie(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):bYe(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(e,t){this.init_();const n=t?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let i=0;i>4;if(r.push(d),l!==64){const h=a<<4&240|l>>2;if(r.push(h),f!==64){const p=l<<6&192|f;r.push(p)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let e=0;e=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}};class EYe extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const wYe=function(e){const t=Hie(e);return q3.encodeByteArray(t,!0)},WT=function(e){return wYe(e).replace(/\./g,"")},Wie=function(e){try{return q3.decodeString(e,!0)}catch(t){console.error("base64Decode failed: ",t)}return null};/** + */const zie=function(e){const t=[];let n=0;for(let r=0;r>6|192,t[n++]=i&63|128):(i&64512)===55296&&r+1>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=i&63|128):(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=i&63|128)}return t},bYe=function(e){const t=[];let n=0,r=0;for(;n191&&i<224){const s=e[n++];t[r++]=String.fromCharCode((i&31)<<6|s&63)}else if(i>239&&i<365){const s=e[n++],o=e[n++],a=e[n++],u=((i&7)<<18|(s&63)<<12|(o&63)<<6|a&63)-65536;t[r++]=String.fromCharCode(55296+(u>>10)),t[r++]=String.fromCharCode(56320+(u&1023))}else{const s=e[n++],o=e[n++];t[r++]=String.fromCharCode((i&15)<<12|(s&63)<<6|o&63)}}return t.join("")},q3={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let i=0;i>2,f=(s&3)<<4|a>>4;let d=(a&15)<<2|l>>6,h=l&63;u||(h=64,o||(d=64)),r.push(n[c],n[f],n[d],n[h])}return r.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(zie(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):bYe(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(e,t){this.init_();const n=t?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let i=0;i>4;if(r.push(d),l!==64){const h=a<<4&240|l>>2;if(r.push(h),f!==64){const p=l<<6&192|f;r.push(p)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let e=0;e=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}};class EYe extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const wYe=function(e){const t=zie(e);return q3.encodeByteArray(t,!0)},WT=function(e){return wYe(e).replace(/\./g,"")},Hie=function(e){try{return q3.decodeString(e,!0)}catch(t){console.error("base64Decode failed: ",t)}return null};/** * @license * Copyright 2022 Google LLC * @@ -259,7 +259,7 @@ Note: ${rie}. ${iie}, or ${hHe}.`,mHe=`The ${mte} method is not valid in multi-t * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function qie(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("Unable to locate global object.")}/** + */function Wie(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("Unable to locate global object.")}/** * @license * Copyright 2022 Google LLC * @@ -274,7 +274,7 @@ Note: ${rie}. ${iie}, or ${hHe}.`,mHe=`The ${mte} method is not valid in multi-t * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const TYe=()=>qie().__FIREBASE_DEFAULTS__,SYe=()=>{if(typeof process>"u"||typeof fV>"u")return;const e=fV.__FIREBASE_DEFAULTS__;if(e)return JSON.parse(e)},IYe=()=>{if(typeof document>"u")return;let e;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const t=e&&Wie(e[1]);return t&&JSON.parse(t)},Y3=()=>{try{return TYe()||SYe()||IYe()}catch(e){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`);return}},Yie=e=>{var t,n;return(n=(t=Y3())===null||t===void 0?void 0:t.emulatorHosts)===null||n===void 0?void 0:n[e]},xYe=e=>{const t=Yie(e);if(!t)return;const n=t.lastIndexOf(":");if(n<=0||n+1===t.length)throw new Error(`Invalid host ${t} with no separate hostname and port!`);const r=parseInt(t.substring(n+1),10);return t[0]==="["?[t.substring(1,n-1),r]:[t.substring(0,n),r]},Gie=()=>{var e;return(e=Y3())===null||e===void 0?void 0:e.config},Kie=e=>{var t;return(t=Y3())===null||t===void 0?void 0:t[`_${e}`]};/** + */const TYe=()=>Wie().__FIREBASE_DEFAULTS__,SYe=()=>{if(typeof process>"u"||typeof fV>"u")return;const e=fV.__FIREBASE_DEFAULTS__;if(e)return JSON.parse(e)},IYe=()=>{if(typeof document>"u")return;let e;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const t=e&&Hie(e[1]);return t&&JSON.parse(t)},Y3=()=>{try{return TYe()||SYe()||IYe()}catch(e){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`);return}},qie=e=>{var t,n;return(n=(t=Y3())===null||t===void 0?void 0:t.emulatorHosts)===null||n===void 0?void 0:n[e]},xYe=e=>{const t=qie(e);if(!t)return;const n=t.lastIndexOf(":");if(n<=0||n+1===t.length)throw new Error(`Invalid host ${t} with no separate hostname and port!`);const r=parseInt(t.substring(n+1),10);return t[0]==="["?[t.substring(1,n-1),r]:[t.substring(0,n),r]},Yie=()=>{var e;return(e=Y3())===null||e===void 0?void 0:e.config},Gie=e=>{var t;return(t=Y3())===null||t===void 0?void 0:t[`_${e}`]};/** * @license * Copyright 2017 Google LLC * @@ -454,7 +454,7 @@ Note: ${rie}. ${iie}, or ${hHe}.`,mHe=`The ${mte} method is not valid in multi-t * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */var nn;(function(e){e[e.DEBUG=0]="DEBUG",e[e.VERBOSE=1]="VERBOSE",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"})(nn||(nn={}));const QYe={debug:nn.DEBUG,verbose:nn.VERBOSE,info:nn.INFO,warn:nn.WARN,error:nn.ERROR,silent:nn.SILENT},XYe=nn.INFO,JYe={[nn.DEBUG]:"log",[nn.VERBOSE]:"log",[nn.INFO]:"info",[nn.WARN]:"warn",[nn.ERROR]:"error"},ZYe=(e,t,...n)=>{if(tt.some(n=>e instanceof n);let hV,pV;function tGe(){return hV||(hV=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function nGe(){return pV||(pV=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const Qie=new WeakMap,bR=new WeakMap,Xie=new WeakMap,lO=new WeakMap,K3=new WeakMap;function rGe(e){const t=new Promise((n,r)=>{const i=()=>{e.removeEventListener("success",s),e.removeEventListener("error",o)},s=()=>{n(qc(e.result)),i()},o=()=>{r(e.error),i()};e.addEventListener("success",s),e.addEventListener("error",o)});return t.then(n=>{n instanceof IDBCursor&&Qie.set(n,e)}).catch(()=>{}),K3.set(t,e),t}function iGe(e){if(bR.has(e))return;const t=new Promise((n,r)=>{const i=()=>{e.removeEventListener("complete",s),e.removeEventListener("error",o),e.removeEventListener("abort",o)},s=()=>{n(),i()},o=()=>{r(e.error||new DOMException("AbortError","AbortError")),i()};e.addEventListener("complete",s),e.addEventListener("error",o),e.addEventListener("abort",o)});bR.set(e,t)}let ER={get(e,t,n){if(e instanceof IDBTransaction){if(t==="done")return bR.get(e);if(t==="objectStoreNames")return e.objectStoreNames||Xie.get(e);if(t==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return qc(e[t])},set(e,t,n){return e[t]=n,!0},has(e,t){return e instanceof IDBTransaction&&(t==="done"||t==="store")?!0:t in e}};function sGe(e){ER=e(ER)}function oGe(e){return e===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(t,...n){const r=e.call(cO(this),t,...n);return Xie.set(r,t.sort?t.sort():[t]),qc(r)}:nGe().includes(e)?function(...t){return e.apply(cO(this),t),qc(Qie.get(this))}:function(...t){return qc(e.apply(cO(this),t))}}function aGe(e){return typeof e=="function"?oGe(e):(e instanceof IDBTransaction&&iGe(e),eGe(e,tGe())?new Proxy(e,ER):e)}function qc(e){if(e instanceof IDBRequest)return rGe(e);if(lO.has(e))return lO.get(e);const t=aGe(e);return t!==e&&(lO.set(e,t),K3.set(t,e)),t}const cO=e=>K3.get(e);function uGe(e,t,{blocked:n,upgrade:r,blocking:i,terminated:s}={}){const o=indexedDB.open(e,t),a=qc(o);return r&&o.addEventListener("upgradeneeded",u=>{r(qc(o.result),u.oldVersion,u.newVersion,qc(o.transaction),u)}),n&&o.addEventListener("blocked",u=>n(u.oldVersion,u.newVersion,u)),a.then(u=>{s&&u.addEventListener("close",()=>s()),i&&u.addEventListener("versionchange",l=>i(l.oldVersion,l.newVersion,l))}).catch(()=>{}),a}const lGe=["get","getKey","getAll","getAllKeys","count"],cGe=["put","add","delete","clear"],fO=new Map;function mV(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if(fO.get(t))return fO.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,i=cGe.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(i||lGe.includes(n)))return;const s=async function(o,...a){const u=this.transaction(o,i?"readwrite":"readonly");let l=u.store;return r&&(l=l.index(a.shift())),(await Promise.all([l[n](...a),i&&u.done]))[0]};return fO.set(t,s),s}sGe(e=>({...e,get:(t,n,r)=>mV(t,n)||e.get(t,n,r),has:(t,n)=>!!mV(t,n)||e.has(t,n)}));/** + */var nn;(function(e){e[e.DEBUG=0]="DEBUG",e[e.VERBOSE=1]="VERBOSE",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"})(nn||(nn={}));const QYe={debug:nn.DEBUG,verbose:nn.VERBOSE,info:nn.INFO,warn:nn.WARN,error:nn.ERROR,silent:nn.SILENT},XYe=nn.INFO,JYe={[nn.DEBUG]:"log",[nn.VERBOSE]:"log",[nn.INFO]:"info",[nn.WARN]:"warn",[nn.ERROR]:"error"},ZYe=(e,t,...n)=>{if(tt.some(n=>e instanceof n);let hV,pV;function tGe(){return hV||(hV=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function nGe(){return pV||(pV=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const Kie=new WeakMap,bR=new WeakMap,Qie=new WeakMap,lO=new WeakMap,K3=new WeakMap;function rGe(e){const t=new Promise((n,r)=>{const i=()=>{e.removeEventListener("success",s),e.removeEventListener("error",o)},s=()=>{n(qc(e.result)),i()},o=()=>{r(e.error),i()};e.addEventListener("success",s),e.addEventListener("error",o)});return t.then(n=>{n instanceof IDBCursor&&Kie.set(n,e)}).catch(()=>{}),K3.set(t,e),t}function iGe(e){if(bR.has(e))return;const t=new Promise((n,r)=>{const i=()=>{e.removeEventListener("complete",s),e.removeEventListener("error",o),e.removeEventListener("abort",o)},s=()=>{n(),i()},o=()=>{r(e.error||new DOMException("AbortError","AbortError")),i()};e.addEventListener("complete",s),e.addEventListener("error",o),e.addEventListener("abort",o)});bR.set(e,t)}let ER={get(e,t,n){if(e instanceof IDBTransaction){if(t==="done")return bR.get(e);if(t==="objectStoreNames")return e.objectStoreNames||Qie.get(e);if(t==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return qc(e[t])},set(e,t,n){return e[t]=n,!0},has(e,t){return e instanceof IDBTransaction&&(t==="done"||t==="store")?!0:t in e}};function sGe(e){ER=e(ER)}function oGe(e){return e===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(t,...n){const r=e.call(cO(this),t,...n);return Qie.set(r,t.sort?t.sort():[t]),qc(r)}:nGe().includes(e)?function(...t){return e.apply(cO(this),t),qc(Kie.get(this))}:function(...t){return qc(e.apply(cO(this),t))}}function aGe(e){return typeof e=="function"?oGe(e):(e instanceof IDBTransaction&&iGe(e),eGe(e,tGe())?new Proxy(e,ER):e)}function qc(e){if(e instanceof IDBRequest)return rGe(e);if(lO.has(e))return lO.get(e);const t=aGe(e);return t!==e&&(lO.set(e,t),K3.set(t,e)),t}const cO=e=>K3.get(e);function uGe(e,t,{blocked:n,upgrade:r,blocking:i,terminated:s}={}){const o=indexedDB.open(e,t),a=qc(o);return r&&o.addEventListener("upgradeneeded",u=>{r(qc(o.result),u.oldVersion,u.newVersion,qc(o.transaction),u)}),n&&o.addEventListener("blocked",u=>n(u.oldVersion,u.newVersion,u)),a.then(u=>{s&&u.addEventListener("close",()=>s()),i&&u.addEventListener("versionchange",l=>i(l.oldVersion,l.newVersion,l))}).catch(()=>{}),a}const lGe=["get","getKey","getAll","getAllKeys","count"],cGe=["put","add","delete","clear"],fO=new Map;function mV(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if(fO.get(t))return fO.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,i=cGe.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(i||lGe.includes(n)))return;const s=async function(o,...a){const u=this.transaction(o,i?"readwrite":"readonly");let l=u.store;return r&&(l=l.index(a.shift())),(await Promise.all([l[n](...a),i&&u.done]))[0]};return fO.set(t,s),s}sGe(e=>({...e,get:(t,n,r)=>mV(t,n)||e.get(t,n,r),has:(t,n)=>!!mV(t,n)||e.has(t,n)}));/** * @license * Copyright 2019 Google LLC * @@ -559,7 +559,7 @@ Note: ${rie}. ${iie}, or ${hHe}.`,mHe=`The ${mte} method is not valid in multi-t * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const ch=MGe;function Jie(e,t={}){let n=e;typeof t!="object"&&(t={name:t});const r=Object.assign({name:TR,automaticDataCollectionEnabled:!1},t),i=r.name;if(typeof i!="string"||!i)throw Yc.create("bad-app-name",{appName:String(i)});if(n||(n=Gie()),!n)throw Yc.create("no-options");const s=qT.get(i);if(s){if(Gy(n,s.options)&&Gy(r,s.config))return s;throw Yc.create("duplicate-app",{appName:i})}const o=new KYe(i);for(const u of SR.values())o.addComponent(u);const a=new UGe(n,r,o);return qT.set(i,a),a}function Q3(e=TR){const t=qT.get(e);if(!t&&e===TR&&Gie())return Jie();if(!t)throw Yc.create("no-app",{appName:e});return t}function Ca(e,t,n){var r;let i=(r=FGe[e])!==null&&r!==void 0?r:e;n&&(i+=`-${n}`);const s=i.match(/\s|\//),o=t.match(/\s|\//);if(s||o){const a=[`Unable to register library "${i}" with version "${t}":`];s&&a.push(`library name "${i}" contains illegal characters (whitespace or "/")`),s&&o&&a.push("and"),o&&a.push(`version name "${t}" contains illegal characters (whitespace or "/")`),Ud.warn(a.join(" "));return}$l(new $u(`${i}-version`,()=>({library:i,version:t}),"VERSION"))}/** + */const ch=MGe;function Xie(e,t={}){let n=e;typeof t!="object"&&(t={name:t});const r=Object.assign({name:TR,automaticDataCollectionEnabled:!1},t),i=r.name;if(typeof i!="string"||!i)throw Yc.create("bad-app-name",{appName:String(i)});if(n||(n=Yie()),!n)throw Yc.create("no-options");const s=qT.get(i);if(s){if(Gy(n,s.options)&&Gy(r,s.config))return s;throw Yc.create("duplicate-app",{appName:i})}const o=new KYe(i);for(const u of SR.values())o.addComponent(u);const a=new UGe(n,r,o);return qT.set(i,a),a}function Q3(e=TR){const t=qT.get(e);if(!t&&e===TR&&Yie())return Xie();if(!t)throw Yc.create("no-app",{appName:e});return t}function Ca(e,t,n){var r;let i=(r=FGe[e])!==null&&r!==void 0?r:e;n&&(i+=`-${n}`);const s=i.match(/\s|\//),o=t.match(/\s|\//);if(s||o){const a=[`Unable to register library "${i}" with version "${t}":`];s&&a.push(`library name "${i}" contains illegal characters (whitespace or "/")`),s&&o&&a.push("and"),o&&a.push(`version name "${t}" contains illegal characters (whitespace or "/")`),Ud.warn(a.join(" "));return}$l(new $u(`${i}-version`,()=>({library:i,version:t}),"VERSION"))}/** * @license * Copyright 2021 Google LLC * @@ -574,7 +574,7 @@ Note: ${rie}. ${iie}, or ${hHe}.`,mHe=`The ${mte} method is not valid in multi-t * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const VGe="firebase-heartbeat-database",zGe=1,Ky="firebase-heartbeat-store";let dO=null;function Zie(){return dO||(dO=uGe(VGe,zGe,{upgrade:(e,t)=>{switch(t){case 0:e.createObjectStore(Ky)}}}).catch(e=>{throw Yc.create("idb-open",{originalErrorMessage:e.message})})),dO}async function HGe(e){try{return await(await Zie()).transaction(Ky).objectStore(Ky).get(ese(e))}catch(t){if(t instanceof Hu)Ud.warn(t.message);else{const n=Yc.create("idb-get",{originalErrorMessage:t==null?void 0:t.message});Ud.warn(n.message)}}}async function yV(e,t){try{const r=(await Zie()).transaction(Ky,"readwrite");await r.objectStore(Ky).put(t,ese(e)),await r.done}catch(n){if(n instanceof Hu)Ud.warn(n.message);else{const r=Yc.create("idb-set",{originalErrorMessage:n==null?void 0:n.message});Ud.warn(r.message)}}}function ese(e){return`${e.name}!${e.options.appId}`}/** + */const VGe="firebase-heartbeat-database",zGe=1,Ky="firebase-heartbeat-store";let dO=null;function Jie(){return dO||(dO=uGe(VGe,zGe,{upgrade:(e,t)=>{switch(t){case 0:e.createObjectStore(Ky)}}}).catch(e=>{throw Yc.create("idb-open",{originalErrorMessage:e.message})})),dO}async function HGe(e){try{return await(await Jie()).transaction(Ky).objectStore(Ky).get(Zie(e))}catch(t){if(t instanceof Hu)Ud.warn(t.message);else{const n=Yc.create("idb-get",{originalErrorMessage:t==null?void 0:t.message});Ud.warn(n.message)}}}async function yV(e,t){try{const r=(await Jie()).transaction(Ky,"readwrite");await r.objectStore(Ky).put(t,Zie(e)),await r.done}catch(n){if(n instanceof Hu)Ud.warn(n.message);else{const r=Yc.create("idb-set",{originalErrorMessage:n==null?void 0:n.message});Ud.warn(r.message)}}}function Zie(e){return`${e.name}!${e.options.appId}`}/** * @license * Copyright 2021 Google LLC * @@ -634,7 +634,7 @@ Note: ${rie}. ${iie}, or ${hHe}.`,mHe=`The ${mte} method is not valid in multi-t * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const tse="firebasestorage.googleapis.com",nse="storageBucket",ZGe=2*60*1e3,eKe=10*60*1e3;/** + */const ese="firebasestorage.googleapis.com",tse="storageBucket",ZGe=2*60*1e3,eKe=10*60*1e3;/** * @license * Copyright 2017 Google LLC * @@ -650,7 +650,7 @@ Note: ${rie}. ${iie}, or ${hHe}.`,mHe=`The ${mte} method is not valid in multi-t * See the License for the specific language governing permissions and * limitations under the License. */class Or extends Hu{constructor(t,n,r=0){super(hO(t),`Firebase Storage: ${n} (${hO(t)})`),this.status_=r,this.customData={serverResponse:null},this._baseMessage=this.message,Object.setPrototypeOf(this,Or.prototype)}get status(){return this.status_}set status(t){this.status_=t}_codeEquals(t){return hO(t)===this.code}get serverResponse(){return this.customData.serverResponse}set serverResponse(t){this.customData.serverResponse=t,this.customData.serverResponse?this.message=`${this._baseMessage} -${this.customData.serverResponse}`:this.message=this._baseMessage}}var Cr;(function(e){e.UNKNOWN="unknown",e.OBJECT_NOT_FOUND="object-not-found",e.BUCKET_NOT_FOUND="bucket-not-found",e.PROJECT_NOT_FOUND="project-not-found",e.QUOTA_EXCEEDED="quota-exceeded",e.UNAUTHENTICATED="unauthenticated",e.UNAUTHORIZED="unauthorized",e.UNAUTHORIZED_APP="unauthorized-app",e.RETRY_LIMIT_EXCEEDED="retry-limit-exceeded",e.INVALID_CHECKSUM="invalid-checksum",e.CANCELED="canceled",e.INVALID_EVENT_NAME="invalid-event-name",e.INVALID_URL="invalid-url",e.INVALID_DEFAULT_BUCKET="invalid-default-bucket",e.NO_DEFAULT_BUCKET="no-default-bucket",e.CANNOT_SLICE_BLOB="cannot-slice-blob",e.SERVER_FILE_WRONG_SIZE="server-file-wrong-size",e.NO_DOWNLOAD_URL="no-download-url",e.INVALID_ARGUMENT="invalid-argument",e.INVALID_ARGUMENT_COUNT="invalid-argument-count",e.APP_DELETED="app-deleted",e.INVALID_ROOT_OPERATION="invalid-root-operation",e.INVALID_FORMAT="invalid-format",e.INTERNAL_ERROR="internal-error",e.UNSUPPORTED_ENVIRONMENT="unsupported-environment"})(Cr||(Cr={}));function hO(e){return"storage/"+e}function X3(){const e="An unknown error occurred, please check the error payload for server response.";return new Or(Cr.UNKNOWN,e)}function tKe(e){return new Or(Cr.OBJECT_NOT_FOUND,"Object '"+e+"' does not exist.")}function nKe(e){return new Or(Cr.QUOTA_EXCEEDED,"Quota for bucket '"+e+"' exceeded, please view quota on https://firebase.google.com/pricing/.")}function rKe(){const e="User is not authenticated, please authenticate using Firebase Authentication and try again.";return new Or(Cr.UNAUTHENTICATED,e)}function iKe(){return new Or(Cr.UNAUTHORIZED_APP,"This app does not have permission to access Firebase Storage on this project.")}function sKe(e){return new Or(Cr.UNAUTHORIZED,"User does not have permission to access '"+e+"'.")}function oKe(){return new Or(Cr.RETRY_LIMIT_EXCEEDED,"Max retry time for operation exceeded, please try again.")}function aKe(){return new Or(Cr.CANCELED,"User canceled the upload/download.")}function uKe(e){return new Or(Cr.INVALID_URL,"Invalid URL '"+e+"'.")}function lKe(e){return new Or(Cr.INVALID_DEFAULT_BUCKET,"Invalid default bucket '"+e+"'.")}function cKe(){return new Or(Cr.NO_DEFAULT_BUCKET,"No default bucket found. Did you set the '"+nse+"' property when initializing the app?")}function fKe(){return new Or(Cr.CANNOT_SLICE_BLOB,"Cannot slice blob for upload. Please retry the upload.")}function dKe(){return new Or(Cr.NO_DOWNLOAD_URL,"The given file does not have any download URLs.")}function hKe(e){return new Or(Cr.UNSUPPORTED_ENVIRONMENT,`${e} is missing. Make sure to install the required polyfills. See https://firebase.google.com/docs/web/environments-js-sdk#polyfills for more information.`)}function IR(e){return new Or(Cr.INVALID_ARGUMENT,e)}function rse(){return new Or(Cr.APP_DELETED,"The Firebase app was deleted.")}function pKe(e){return new Or(Cr.INVALID_ROOT_OPERATION,"The operation '"+e+"' cannot be performed on a root reference, create a non-root reference using child, such as .child('file.png').")}function K0(e,t){return new Or(Cr.INVALID_FORMAT,"String does not match format '"+e+"': "+t)}function qg(e){throw new Or(Cr.INTERNAL_ERROR,"Internal error: "+e)}/** +${this.customData.serverResponse}`:this.message=this._baseMessage}}var Cr;(function(e){e.UNKNOWN="unknown",e.OBJECT_NOT_FOUND="object-not-found",e.BUCKET_NOT_FOUND="bucket-not-found",e.PROJECT_NOT_FOUND="project-not-found",e.QUOTA_EXCEEDED="quota-exceeded",e.UNAUTHENTICATED="unauthenticated",e.UNAUTHORIZED="unauthorized",e.UNAUTHORIZED_APP="unauthorized-app",e.RETRY_LIMIT_EXCEEDED="retry-limit-exceeded",e.INVALID_CHECKSUM="invalid-checksum",e.CANCELED="canceled",e.INVALID_EVENT_NAME="invalid-event-name",e.INVALID_URL="invalid-url",e.INVALID_DEFAULT_BUCKET="invalid-default-bucket",e.NO_DEFAULT_BUCKET="no-default-bucket",e.CANNOT_SLICE_BLOB="cannot-slice-blob",e.SERVER_FILE_WRONG_SIZE="server-file-wrong-size",e.NO_DOWNLOAD_URL="no-download-url",e.INVALID_ARGUMENT="invalid-argument",e.INVALID_ARGUMENT_COUNT="invalid-argument-count",e.APP_DELETED="app-deleted",e.INVALID_ROOT_OPERATION="invalid-root-operation",e.INVALID_FORMAT="invalid-format",e.INTERNAL_ERROR="internal-error",e.UNSUPPORTED_ENVIRONMENT="unsupported-environment"})(Cr||(Cr={}));function hO(e){return"storage/"+e}function X3(){const e="An unknown error occurred, please check the error payload for server response.";return new Or(Cr.UNKNOWN,e)}function tKe(e){return new Or(Cr.OBJECT_NOT_FOUND,"Object '"+e+"' does not exist.")}function nKe(e){return new Or(Cr.QUOTA_EXCEEDED,"Quota for bucket '"+e+"' exceeded, please view quota on https://firebase.google.com/pricing/.")}function rKe(){const e="User is not authenticated, please authenticate using Firebase Authentication and try again.";return new Or(Cr.UNAUTHENTICATED,e)}function iKe(){return new Or(Cr.UNAUTHORIZED_APP,"This app does not have permission to access Firebase Storage on this project.")}function sKe(e){return new Or(Cr.UNAUTHORIZED,"User does not have permission to access '"+e+"'.")}function oKe(){return new Or(Cr.RETRY_LIMIT_EXCEEDED,"Max retry time for operation exceeded, please try again.")}function aKe(){return new Or(Cr.CANCELED,"User canceled the upload/download.")}function uKe(e){return new Or(Cr.INVALID_URL,"Invalid URL '"+e+"'.")}function lKe(e){return new Or(Cr.INVALID_DEFAULT_BUCKET,"Invalid default bucket '"+e+"'.")}function cKe(){return new Or(Cr.NO_DEFAULT_BUCKET,"No default bucket found. Did you set the '"+tse+"' property when initializing the app?")}function fKe(){return new Or(Cr.CANNOT_SLICE_BLOB,"Cannot slice blob for upload. Please retry the upload.")}function dKe(){return new Or(Cr.NO_DOWNLOAD_URL,"The given file does not have any download URLs.")}function hKe(e){return new Or(Cr.UNSUPPORTED_ENVIRONMENT,`${e} is missing. Make sure to install the required polyfills. See https://firebase.google.com/docs/web/environments-js-sdk#polyfills for more information.`)}function IR(e){return new Or(Cr.INVALID_ARGUMENT,e)}function nse(){return new Or(Cr.APP_DELETED,"The Firebase app was deleted.")}function pKe(e){return new Or(Cr.INVALID_ROOT_OPERATION,"The operation '"+e+"' cannot be performed on a root reference, create a non-root reference using child, such as .child('file.png').")}function K0(e,t){return new Or(Cr.INVALID_FORMAT,"String does not match format '"+e+"': "+t)}function qg(e){throw new Or(Cr.INTERNAL_ERROR,"Internal error: "+e)}/** * @license * Copyright 2017 Google LLC * @@ -665,7 +665,7 @@ ${this.customData.serverResponse}`:this.message=this._baseMessage}}var Cr;(funct * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class uo{constructor(t,n){this.bucket=t,this.path_=n}get path(){return this.path_}get isRoot(){return this.path.length===0}fullServerUrl(){const t=encodeURIComponent;return"/b/"+t(this.bucket)+"/o/"+t(this.path)}bucketOnlyServerUrl(){return"/b/"+encodeURIComponent(this.bucket)+"/o"}static makeFromBucketSpec(t,n){let r;try{r=uo.makeFromUrl(t,n)}catch{return new uo(t,"")}if(r.path==="")return r;throw lKe(t)}static makeFromUrl(t,n){let r=null;const i="([A-Za-z0-9.\\-_]+)";function s(T){T.path.charAt(T.path.length-1)==="/"&&(T.path_=T.path_.slice(0,-1))}const o="(/(.*))?$",a=new RegExp("^gs://"+i+o,"i"),u={bucket:1,path:3};function l(T){T.path_=decodeURIComponent(T.path)}const c="v[A-Za-z0-9_]+",f=n.replace(/[.]/g,"\\."),d="(/([^?#]*).*)?$",h=new RegExp(`^https?://${f}/${c}/b/${i}/o${d}`,"i"),p={bucket:1,path:3},m=n===tse?"(?:storage.googleapis.com|storage.cloud.google.com)":n,y="([^?#]*)",g=new RegExp(`^https?://${m}/${i}/${y}`,"i"),b=[{regex:a,indices:u,postModify:s},{regex:h,indices:p,postModify:l},{regex:g,indices:{bucket:1,path:2},postModify:l}];for(let T=0;T{this.resolve_=h,this.reject_=p,this.start_()})}start_(){const t=(r,i)=>{if(i){r(!1,new x1(!1,null,!0));return}const s=this.connectionFactory_();this.pendingConnection_=s;const o=a=>{const u=a.loaded,l=a.lengthComputable?a.total:-1;this.progressCallback_!==null&&this.progressCallback_(u,l)};this.progressCallback_!==null&&s.addUploadProgressListener(o),s.send(this.url_,this.method_,this.body_,this.headers_).then(()=>{this.progressCallback_!==null&&s.removeUploadProgressListener(o),this.pendingConnection_=null;const a=s.getErrorCode()===wd.NO_ERROR,u=s.getStatus();if(!a||bKe(u,this.additionalRetryCodes_)&&this.retry){const c=s.getErrorCode()===wd.ABORT;r(!1,new x1(!1,null,c));return}const l=this.successCodes_.indexOf(u)!==-1;r(!0,new x1(l,s))})},n=(r,i)=>{const s=this.resolve_,o=this.reject_,a=i.connection;if(i.wasSuccessCode)try{const u=this.callback_(a,a.getResponse());_Ke(u)?s(u):s()}catch(u){o(u)}else if(a!==null){const u=X3();u.serverResponse=a.getErrorText(),this.errorCallback_?o(this.errorCallback_(a,u)):o(u)}else if(i.canceled){const u=this.appDelete_?rse():aKe();o(u)}else{const u=oKe();o(u)}};this.canceled_?n(!1,new x1(!1,null,!0)):this.backoffId_=gKe(t,n,this.timeout_)}getPromise(){return this.promise_}cancel(t){this.canceled_=!0,this.appDelete_=t||!1,this.backoffId_!==null&&yKe(this.backoffId_),this.pendingConnection_!==null&&this.pendingConnection_.abort()}}class x1{constructor(t,n,r){this.wasSuccessCode=t,this.connection=n,this.canceled=!!r}}function wKe(e,t){t!==null&&t.length>0&&(e.Authorization="Firebase "+t)}function TKe(e,t){e["X-Firebase-Storage-Version"]="webjs/"+(t??"AppManager")}function SKe(e,t){t&&(e["X-Firebase-GMPID"]=t)}function IKe(e,t){t!==null&&(e["X-Firebase-AppCheck"]=t)}function xKe(e,t,n,r,i,s,o=!0){const a=ise(e.urlParams),u=e.url+a,l=Object.assign({},e.headers);return SKe(l,t),wKe(l,n),TKe(l,s),IKe(l,r),new EKe(u,e.method,l,e.body,e.successCodes,e.additionalRetryCodes,e.handler,e.errorHandler,e.timeout,e.progressCallback,i,o)}/** + */class EKe{constructor(t,n,r,i,s,o,a,u,l,c,f,d=!0){this.url_=t,this.method_=n,this.headers_=r,this.body_=i,this.successCodes_=s,this.additionalRetryCodes_=o,this.callback_=a,this.errorCallback_=u,this.timeout_=l,this.progressCallback_=c,this.connectionFactory_=f,this.retry=d,this.pendingConnection_=null,this.backoffId_=null,this.canceled_=!1,this.appDelete_=!1,this.promise_=new Promise((h,p)=>{this.resolve_=h,this.reject_=p,this.start_()})}start_(){const t=(r,i)=>{if(i){r(!1,new x1(!1,null,!0));return}const s=this.connectionFactory_();this.pendingConnection_=s;const o=a=>{const u=a.loaded,l=a.lengthComputable?a.total:-1;this.progressCallback_!==null&&this.progressCallback_(u,l)};this.progressCallback_!==null&&s.addUploadProgressListener(o),s.send(this.url_,this.method_,this.body_,this.headers_).then(()=>{this.progressCallback_!==null&&s.removeUploadProgressListener(o),this.pendingConnection_=null;const a=s.getErrorCode()===wd.NO_ERROR,u=s.getStatus();if(!a||bKe(u,this.additionalRetryCodes_)&&this.retry){const c=s.getErrorCode()===wd.ABORT;r(!1,new x1(!1,null,c));return}const l=this.successCodes_.indexOf(u)!==-1;r(!0,new x1(l,s))})},n=(r,i)=>{const s=this.resolve_,o=this.reject_,a=i.connection;if(i.wasSuccessCode)try{const u=this.callback_(a,a.getResponse());_Ke(u)?s(u):s()}catch(u){o(u)}else if(a!==null){const u=X3();u.serverResponse=a.getErrorText(),this.errorCallback_?o(this.errorCallback_(a,u)):o(u)}else if(i.canceled){const u=this.appDelete_?nse():aKe();o(u)}else{const u=oKe();o(u)}};this.canceled_?n(!1,new x1(!1,null,!0)):this.backoffId_=gKe(t,n,this.timeout_)}getPromise(){return this.promise_}cancel(t){this.canceled_=!0,this.appDelete_=t||!1,this.backoffId_!==null&&yKe(this.backoffId_),this.pendingConnection_!==null&&this.pendingConnection_.abort()}}class x1{constructor(t,n,r){this.wasSuccessCode=t,this.connection=n,this.canceled=!!r}}function wKe(e,t){t!==null&&t.length>0&&(e.Authorization="Firebase "+t)}function TKe(e,t){e["X-Firebase-Storage-Version"]="webjs/"+(t??"AppManager")}function SKe(e,t){t&&(e["X-Firebase-GMPID"]=t)}function IKe(e,t){t!==null&&(e["X-Firebase-AppCheck"]=t)}function xKe(e,t,n,r,i,s,o=!0){const a=rse(e.urlParams),u=e.url+a,l=Object.assign({},e.headers);return SKe(l,t),wKe(l,n),TKe(l,s),IKe(l,r),new EKe(u,e.method,l,e.body,e.successCodes,e.additionalRetryCodes,e.handler,e.errorHandler,e.timeout,e.progressCallback,i,o)}/** * @license * Copyright 2017 Google LLC * @@ -800,7 +800,7 @@ ${this.customData.serverResponse}`:this.message=this._baseMessage}}var Cr;(funct * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const fu={RAW:"raw",BASE64:"base64",BASE64URL:"base64url",DATA_URL:"data_url"};class pO{constructor(t,n){this.data=t,this.contentType=n||null}}function RKe(e,t){switch(e){case fu.RAW:return new pO(sse(t));case fu.BASE64:case fu.BASE64URL:return new pO(ose(e,t));case fu.DATA_URL:return new pO(kKe(t),DKe(t))}throw X3()}function sse(e){const t=[];for(let n=0;n>6,128|r&63);else if((r&64512)===55296)if(!(n>18,128|r>>12&63,128|r>>6&63,128|r&63)}else(r&64512)===56320?t.push(239,191,189):t.push(224|r>>12,128|r>>6&63,128|r&63)}return new Uint8Array(t)}function NKe(e){let t;try{t=decodeURIComponent(e)}catch{throw K0(fu.DATA_URL,"Malformed data URL.")}return sse(t)}function ose(e,t){switch(e){case fu.BASE64:{const i=t.indexOf("-")!==-1,s=t.indexOf("_")!==-1;if(i||s)throw K0(e,"Invalid character '"+(i?"-":"_")+"' found: is it base64url encoded?");break}case fu.BASE64URL:{const i=t.indexOf("+")!==-1,s=t.indexOf("/")!==-1;if(i||s)throw K0(e,"Invalid character '"+(i?"+":"/")+"' found: is it base64 encoded?");t=t.replace(/-/g,"+").replace(/_/g,"/");break}}let n;try{n=PKe(t)}catch(i){throw i.message.includes("polyfill")?i:K0(e,"Invalid character found")}const r=new Uint8Array(n.length);for(let i=0;i][;base64],");const r=n[1]||null;r!=null&&(this.base64=$Ke(r,";base64"),this.contentType=this.base64?r.substring(0,r.length-7):r),this.rest=t.substring(t.indexOf(",")+1)}}function kKe(e){const t=new ase(e);return t.base64?ose(fu.BASE64,t.rest):NKe(t.rest)}function DKe(e){return new ase(e).contentType}function $Ke(e,t){return e.length>=t.length?e.substring(e.length-t.length)===t:!1}/** + */const fu={RAW:"raw",BASE64:"base64",BASE64URL:"base64url",DATA_URL:"data_url"};class pO{constructor(t,n){this.data=t,this.contentType=n||null}}function RKe(e,t){switch(e){case fu.RAW:return new pO(ise(t));case fu.BASE64:case fu.BASE64URL:return new pO(sse(e,t));case fu.DATA_URL:return new pO(kKe(t),DKe(t))}throw X3()}function ise(e){const t=[];for(let n=0;n>6,128|r&63);else if((r&64512)===55296)if(!(n>18,128|r>>12&63,128|r>>6&63,128|r&63)}else(r&64512)===56320?t.push(239,191,189):t.push(224|r>>12,128|r>>6&63,128|r&63)}return new Uint8Array(t)}function NKe(e){let t;try{t=decodeURIComponent(e)}catch{throw K0(fu.DATA_URL,"Malformed data URL.")}return ise(t)}function sse(e,t){switch(e){case fu.BASE64:{const i=t.indexOf("-")!==-1,s=t.indexOf("_")!==-1;if(i||s)throw K0(e,"Invalid character '"+(i?"-":"_")+"' found: is it base64url encoded?");break}case fu.BASE64URL:{const i=t.indexOf("+")!==-1,s=t.indexOf("/")!==-1;if(i||s)throw K0(e,"Invalid character '"+(i?"+":"/")+"' found: is it base64 encoded?");t=t.replace(/-/g,"+").replace(/_/g,"/");break}}let n;try{n=PKe(t)}catch(i){throw i.message.includes("polyfill")?i:K0(e,"Invalid character found")}const r=new Uint8Array(n.length);for(let i=0;i][;base64],");const r=n[1]||null;r!=null&&(this.base64=$Ke(r,";base64"),this.contentType=this.base64?r.substring(0,r.length-7):r),this.rest=t.substring(t.indexOf(",")+1)}}function kKe(e){const t=new ose(e);return t.base64?sse(fu.BASE64,t.rest):NKe(t.rest)}function DKe(e){return new ose(e).contentType}function $Ke(e,t){return e.length>=t.length?e.substring(e.length-t.length)===t:!1}/** * @license * Copyright 2017 Google LLC * @@ -830,7 +830,7 @@ ${this.customData.serverResponse}`:this.message=this._baseMessage}}var Cr;(funct * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function use(e){let t;try{t=JSON.parse(e)}catch{return null}return vKe(t)?t:null}/** + */function ase(e){let t;try{t=JSON.parse(e)}catch{return null}return vKe(t)?t:null}/** * @license * Copyright 2017 Google LLC * @@ -845,7 +845,7 @@ ${this.customData.serverResponse}`:this.message=this._baseMessage}}var Cr;(funct * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function LKe(e){if(e.length===0)return null;const t=e.lastIndexOf("/");return t===-1?"":e.slice(0,t)}function MKe(e,t){const n=t.split("/").filter(r=>r.length>0).join("/");return e.length===0?n:e+"/"+n}function lse(e){const t=e.lastIndexOf("/",e.length-2);return t===-1?e:e.slice(t+1)}/** + */function LKe(e){if(e.length===0)return null;const t=e.lastIndexOf("/");return t===-1?"":e.slice(0,t)}function MKe(e,t){const n=t.split("/").filter(r=>r.length>0).join("/");return e.length===0?n:e+"/"+n}function use(e){const t=e.lastIndexOf("/",e.length-2);return t===-1?e:e.slice(t+1)}/** * @license * Copyright 2017 Google LLC * @@ -860,7 +860,7 @@ ${this.customData.serverResponse}`:this.message=this._baseMessage}}var Cr;(funct * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function FKe(e,t){return t}class ss{constructor(t,n,r,i){this.server=t,this.local=n||t,this.writable=!!r,this.xform=i||FKe}}let C1=null;function BKe(e){return!J3(e)||e.length<2?e:lse(e)}function cse(){if(C1)return C1;const e=[];e.push(new ss("bucket")),e.push(new ss("generation")),e.push(new ss("metageneration")),e.push(new ss("name","fullPath",!0));function t(s,o){return BKe(o)}const n=new ss("name");n.xform=t,e.push(n);function r(s,o){return o!==void 0?Number(o):o}const i=new ss("size");return i.xform=r,e.push(i),e.push(new ss("timeCreated")),e.push(new ss("updated")),e.push(new ss("md5Hash",null,!0)),e.push(new ss("cacheControl",null,!0)),e.push(new ss("contentDisposition",null,!0)),e.push(new ss("contentEncoding",null,!0)),e.push(new ss("contentLanguage",null,!0)),e.push(new ss("contentType",null,!0)),e.push(new ss("metadata","customMetadata",!0)),C1=e,C1}function jKe(e,t){function n(){const r=e.bucket,i=e.fullPath,s=new uo(r,i);return t._makeStorageReference(s)}Object.defineProperty(e,"ref",{get:n})}function UKe(e,t,n){const r={};r.type="file";const i=n.length;for(let s=0;s{const c=e.bucket,f=e.fullPath,d="/b/"+o(c)+"/o/"+o(f),h=e6(d,n,r),p=ise({alt:"media",token:l});return h+p})[0]}function zKe(e,t){const n={},r=t.length;for(let i=0;i{const c=e.bucket,f=e.fullPath,d="/b/"+o(c)+"/o/"+o(f),h=e6(d,n,r),p=rse({alt:"media",token:l});return h+p})[0]}function zKe(e,t){const n={},r=t.length;for(let i=0;i{this.xhr_.addEventListener("abort",()=>{this.errorCode_=wd.ABORT,t()}),this.xhr_.addEventListener("error",()=>{this.errorCode_=wd.NETWORK_ERROR,t()}),this.xhr_.addEventListener("load",()=>{t()})})}send(t,n,r,i){if(this.sent_)throw qg("cannot .send() more than once");if(this.sent_=!0,this.xhr_.open(n,t,!0),i!==void 0)for(const s in i)i.hasOwnProperty(s)&&this.xhr_.setRequestHeader(s,i[s].toString());return r!==void 0?this.xhr_.send(r):this.xhr_.send(),this.sendPromise_}getErrorCode(){if(!this.sent_)throw qg("cannot .getErrorCode() before sending");return this.errorCode_}getStatus(){if(!this.sent_)throw qg("cannot .getStatus() before sending");try{return this.xhr_.status}catch{return-1}}getResponse(){if(!this.sent_)throw qg("cannot .getResponse() before sending");return this.xhr_.response}getErrorText(){if(!this.sent_)throw qg("cannot .getErrorText() before sending");return this.xhr_.statusText}abort(){this.xhr_.abort()}getResponseHeader(t){return this.xhr_.getResponseHeader(t)}addUploadProgressListener(t){this.xhr_.upload!=null&&this.xhr_.upload.addEventListener("progress",t)}removeUploadProgressListener(t){this.xhr_.upload!=null&&this.xhr_.upload.removeEventListener("progress",t)}}class JKe extends XKe{initXhr(){this.xhr_.responseType="text"}}function mse(){return new JKe}/** +--`+u+"--",h=yc.getBlob(f,r,d);if(h===null)throw fKe();const p={name:l.fullPath},m=e6(s,e.host,e._protocol),y="POST",g=e.maxUploadRetryTime,_=new fse(m,y,HKe(e,n),g);return _.urlParams=p,_.headers=o,_.body=h.uploadData(),_.errorHandler=hse(t),_}class XKe{constructor(){this.sent_=!1,this.xhr_=new XMLHttpRequest,this.initXhr(),this.errorCode_=wd.NO_ERROR,this.sendPromise_=new Promise(t=>{this.xhr_.addEventListener("abort",()=>{this.errorCode_=wd.ABORT,t()}),this.xhr_.addEventListener("error",()=>{this.errorCode_=wd.NETWORK_ERROR,t()}),this.xhr_.addEventListener("load",()=>{t()})})}send(t,n,r,i){if(this.sent_)throw qg("cannot .send() more than once");if(this.sent_=!0,this.xhr_.open(n,t,!0),i!==void 0)for(const s in i)i.hasOwnProperty(s)&&this.xhr_.setRequestHeader(s,i[s].toString());return r!==void 0?this.xhr_.send(r):this.xhr_.send(),this.sendPromise_}getErrorCode(){if(!this.sent_)throw qg("cannot .getErrorCode() before sending");return this.errorCode_}getStatus(){if(!this.sent_)throw qg("cannot .getStatus() before sending");try{return this.xhr_.status}catch{return-1}}getResponse(){if(!this.sent_)throw qg("cannot .getResponse() before sending");return this.xhr_.response}getErrorText(){if(!this.sent_)throw qg("cannot .getErrorText() before sending");return this.xhr_.statusText}abort(){this.xhr_.abort()}getResponseHeader(t){return this.xhr_.getResponseHeader(t)}addUploadProgressListener(t){this.xhr_.upload!=null&&this.xhr_.upload.addEventListener("progress",t)}removeUploadProgressListener(t){this.xhr_.upload!=null&&this.xhr_.upload.removeEventListener("progress",t)}}class JKe extends XKe{initXhr(){this.xhr_.responseType="text"}}function pse(){return new JKe}/** * @license * Copyright 2019 Google LLC * @@ -898,7 +898,7 @@ Content-Type: `+l.contentType+`\r * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class Vd{constructor(t,n){this._service=t,n instanceof uo?this._location=n:this._location=uo.makeFromUrl(n,t.host)}toString(){return"gs://"+this._location.bucket+"/"+this._location.path}_newRef(t,n){return new Vd(t,n)}get root(){const t=new uo(this._location.bucket,"");return this._newRef(this._service,t)}get bucket(){return this._location.bucket}get fullPath(){return this._location.path}get name(){return lse(this._location.path)}get storage(){return this._service}get parent(){const t=LKe(this._location.path);if(t===null)return null;const n=new uo(this._location.bucket,t);return new Vd(this._service,n)}_throwIfRoot(t){if(this._location.path==="")throw pKe(t)}}function ZKe(e,t,n){e._throwIfRoot("uploadBytes");const r=QKe(e.storage,e._location,cse(),new yc(t,!0),n);return e.storage.makeRequestWithTokens(r,mse).then(i=>({metadata:i,ref:e}))}function eQe(e){e._throwIfRoot("getDownloadURL");const t=YKe(e.storage,e._location,cse());return e.storage.makeRequestWithTokens(t,mse).then(n=>{if(n===null)throw dKe();return n})}function tQe(e,t){const n=MKe(e._location.path,t),r=new uo(e._location.bucket,n);return new Vd(e.storage,r)}/** + */class Vd{constructor(t,n){this._service=t,n instanceof uo?this._location=n:this._location=uo.makeFromUrl(n,t.host)}toString(){return"gs://"+this._location.bucket+"/"+this._location.path}_newRef(t,n){return new Vd(t,n)}get root(){const t=new uo(this._location.bucket,"");return this._newRef(this._service,t)}get bucket(){return this._location.bucket}get fullPath(){return this._location.path}get name(){return use(this._location.path)}get storage(){return this._service}get parent(){const t=LKe(this._location.path);if(t===null)return null;const n=new uo(this._location.bucket,t);return new Vd(this._service,n)}_throwIfRoot(t){if(this._location.path==="")throw pKe(t)}}function ZKe(e,t,n){e._throwIfRoot("uploadBytes");const r=QKe(e.storage,e._location,lse(),new yc(t,!0),n);return e.storage.makeRequestWithTokens(r,pse).then(i=>({metadata:i,ref:e}))}function eQe(e){e._throwIfRoot("getDownloadURL");const t=YKe(e.storage,e._location,lse());return e.storage.makeRequestWithTokens(t,pse).then(n=>{if(n===null)throw dKe();return n})}function tQe(e,t){const n=MKe(e._location.path,t),r=new uo(e._location.bucket,n);return new Vd(e.storage,r)}/** * @license * Copyright 2017 Google LLC * @@ -913,7 +913,7 @@ Content-Type: `+l.contentType+`\r * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function nQe(e){return/^[A-Za-z]+:\/\//.test(e)}function rQe(e,t){return new Vd(e,t)}function gse(e,t){if(e instanceof t6){const n=e;if(n._bucket==null)throw cKe();const r=new Vd(n,n._bucket);return t!=null?gse(r,t):r}else return t!==void 0?tQe(e,t):e}function iQe(e,t){if(t&&nQe(t)){if(e instanceof t6)return rQe(e,t);throw IR("To use ref(service, url), the first argument must be a Storage instance.")}else return gse(e,t)}function wV(e,t){const n=t==null?void 0:t[nse];return n==null?null:uo.makeFromBucketSpec(n,e)}function sQe(e,t,n,r={}){e.host=`${t}:${n}`,e._protocol="http";const{mockUserToken:i}=r;i&&(e._overrideAuthToken=typeof i=="string"?i:CYe(i,e.app.options.projectId))}class t6{constructor(t,n,r,i,s){this.app=t,this._authProvider=n,this._appCheckProvider=r,this._url=i,this._firebaseVersion=s,this._bucket=null,this._host=tse,this._protocol="https",this._appId=null,this._deleted=!1,this._maxOperationRetryTime=ZGe,this._maxUploadRetryTime=eKe,this._requests=new Set,i!=null?this._bucket=uo.makeFromBucketSpec(i,this._host):this._bucket=wV(this._host,this.app.options)}get host(){return this._host}set host(t){this._host=t,this._url!=null?this._bucket=uo.makeFromBucketSpec(this._url,t):this._bucket=wV(t,this.app.options)}get maxUploadRetryTime(){return this._maxUploadRetryTime}set maxUploadRetryTime(t){EV("time",0,Number.POSITIVE_INFINITY,t),this._maxUploadRetryTime=t}get maxOperationRetryTime(){return this._maxOperationRetryTime}set maxOperationRetryTime(t){EV("time",0,Number.POSITIVE_INFINITY,t),this._maxOperationRetryTime=t}async _getAuthToken(){if(this._overrideAuthToken)return this._overrideAuthToken;const t=this._authProvider.getImmediate({optional:!0});if(t){const n=await t.getToken();if(n!==null)return n.accessToken}return null}async _getAppCheckToken(){const t=this._appCheckProvider.getImmediate({optional:!0});return t?(await t.getToken()).token:null}_delete(){return this._deleted||(this._deleted=!0,this._requests.forEach(t=>t.cancel()),this._requests.clear()),Promise.resolve()}_makeStorageReference(t){return new Vd(this,t)}_makeRequest(t,n,r,i,s=!0){if(this._deleted)return new mKe(rse());{const o=xKe(t,this._appId,r,i,n,this._firebaseVersion,s);return this._requests.add(o),o.getPromise().then(()=>this._requests.delete(o),()=>this._requests.delete(o)),o}}async makeRequestWithTokens(t,n){const[r,i]=await Promise.all([this._getAuthToken(),this._getAppCheckToken()]);return this._makeRequest(t,n,r,i).getPromise()}}const TV="@firebase/storage",SV="0.12.0";/** + */function nQe(e){return/^[A-Za-z]+:\/\//.test(e)}function rQe(e,t){return new Vd(e,t)}function mse(e,t){if(e instanceof t6){const n=e;if(n._bucket==null)throw cKe();const r=new Vd(n,n._bucket);return t!=null?mse(r,t):r}else return t!==void 0?tQe(e,t):e}function iQe(e,t){if(t&&nQe(t)){if(e instanceof t6)return rQe(e,t);throw IR("To use ref(service, url), the first argument must be a Storage instance.")}else return mse(e,t)}function wV(e,t){const n=t==null?void 0:t[tse];return n==null?null:uo.makeFromBucketSpec(n,e)}function sQe(e,t,n,r={}){e.host=`${t}:${n}`,e._protocol="http";const{mockUserToken:i}=r;i&&(e._overrideAuthToken=typeof i=="string"?i:CYe(i,e.app.options.projectId))}class t6{constructor(t,n,r,i,s){this.app=t,this._authProvider=n,this._appCheckProvider=r,this._url=i,this._firebaseVersion=s,this._bucket=null,this._host=ese,this._protocol="https",this._appId=null,this._deleted=!1,this._maxOperationRetryTime=ZGe,this._maxUploadRetryTime=eKe,this._requests=new Set,i!=null?this._bucket=uo.makeFromBucketSpec(i,this._host):this._bucket=wV(this._host,this.app.options)}get host(){return this._host}set host(t){this._host=t,this._url!=null?this._bucket=uo.makeFromBucketSpec(this._url,t):this._bucket=wV(t,this.app.options)}get maxUploadRetryTime(){return this._maxUploadRetryTime}set maxUploadRetryTime(t){EV("time",0,Number.POSITIVE_INFINITY,t),this._maxUploadRetryTime=t}get maxOperationRetryTime(){return this._maxOperationRetryTime}set maxOperationRetryTime(t){EV("time",0,Number.POSITIVE_INFINITY,t),this._maxOperationRetryTime=t}async _getAuthToken(){if(this._overrideAuthToken)return this._overrideAuthToken;const t=this._authProvider.getImmediate({optional:!0});if(t){const n=await t.getToken();if(n!==null)return n.accessToken}return null}async _getAppCheckToken(){const t=this._appCheckProvider.getImmediate({optional:!0});return t?(await t.getToken()).token:null}_delete(){return this._deleted||(this._deleted=!0,this._requests.forEach(t=>t.cancel()),this._requests.clear()),Promise.resolve()}_makeStorageReference(t){return new Vd(this,t)}_makeRequest(t,n,r,i,s=!0){if(this._deleted)return new mKe(nse());{const o=xKe(t,this._appId,r,i,n,this._firebaseVersion,s);return this._requests.add(o),o.getPromise().then(()=>this._requests.delete(o),()=>this._requests.delete(o)),o}}async makeRequestWithTokens(t,n){const[r,i]=await Promise.all([this._getAuthToken(),this._getAppCheckToken()]);return this._makeRequest(t,n,r,i).getPromise()}}const TV="@firebase/storage",SV="0.12.0";/** * @license * Copyright 2020 Google LLC * @@ -928,15 +928,15 @@ Content-Type: `+l.contentType+`\r * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const yse="storage";function oQe(e,t,n){return e=Zi(e),ZKe(e,t,n)}function aQe(e){return e=Zi(e),eQe(e)}function IV(e,t){return e=Zi(e),iQe(e,t)}function xV(e=Q3(),t){e=Zi(e);const r=ig(e,yse).getImmediate({identifier:t}),i=xYe("storage");return i&&uQe(r,...i),r}function uQe(e,t,n,r={}){sQe(e,t,n,r)}function lQe(e,{instanceIdentifier:t}){const n=e.getProvider("app").getImmediate(),r=e.getProvider("auth-internal"),i=e.getProvider("app-check-internal");return new t6(n,r,i,t,ch)}function cQe(){$l(new $u(yse,lQe,"PUBLIC").setMultipleInstances(!0)),Ca(TV,SV,""),Ca(TV,SV,"esm2017")}cQe();var fQe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Fe,n6=n6||{},St=fQe||self;function fx(e){var t=typeof e;return t=t!="object"?t:e?Array.isArray(e)?"array":t:"null",t=="array"||t=="object"&&typeof e.length=="number"}function nv(e){var t=typeof e;return t=="object"&&e!=null||t=="function"}function dQe(e){return Object.prototype.hasOwnProperty.call(e,mO)&&e[mO]||(e[mO]=++hQe)}var mO="closure_uid_"+(1e9*Math.random()>>>0),hQe=0;function pQe(e,t,n){return e.call.apply(e.bind,arguments)}function mQe(e,t,n){if(!e)throw Error();if(2{};St.addEventListener("test",n,t),St.removeEventListener("test",n,t)}catch{}return e}();function Qy(e){return/^[\s\xa0]*$/.test(e)}function dx(){var e=St.navigator;return e&&(e=e.userAgent)?e:""}function ou(e){return dx().indexOf(e)!=-1}function i6(e){return i6[" "](e),e}i6[" "]=function(){};function _Qe(e,t){var n=cXe;return Object.prototype.hasOwnProperty.call(n,e)?n[e]:n[e]=t(e)}var vQe=ou("Opera"),Em=ou("Trident")||ou("MSIE"),vse=ou("Edge"),xR=vse||Em,bse=ou("Gecko")&&!(dx().toLowerCase().indexOf("webkit")!=-1&&!ou("Edge"))&&!(ou("Trident")||ou("MSIE"))&&!ou("Edge"),bQe=dx().toLowerCase().indexOf("webkit")!=-1&&!ou("Edge");function Ese(){var e=St.document;return e?e.documentMode:void 0}var CR;e:{var gO="",yO=function(){var e=dx();if(bse)return/rv:([^\);]+)(\)|;)/.exec(e);if(vse)return/Edge\/([\d\.]+)/.exec(e);if(Em)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(e);if(bQe)return/WebKit\/(\S+)/.exec(e);if(vQe)return/(?:Version)[ \/]?(\S+)/.exec(e)}();if(yO&&(gO=yO?yO[1]:""),Em){var _O=Ese();if(_O!=null&&_O>parseFloat(gO)){CR=String(_O);break e}}CR=gO}var AR;if(St.document&&Em){var AV=Ese();AR=AV||parseInt(CR,10)||void 0}else AR=void 0;var EQe=AR;function Xy(e,t){if(Ki.call(this,e?e.type:""),this.relatedTarget=this.g=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.state=null,this.pointerId=0,this.pointerType="",this.i=null,e){var n=this.type=e.type,r=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:null;if(this.target=e.target||e.srcElement,this.g=t,t=e.relatedTarget){if(bse){e:{try{i6(t.nodeName);var i=!0;break e}catch{}i=!1}i||(t=null)}}else n=="mouseover"?t=e.fromElement:n=="mouseout"&&(t=e.toElement);this.relatedTarget=t,r?(this.clientX=r.clientX!==void 0?r.clientX:r.pageX,this.clientY=r.clientY!==void 0?r.clientY:r.pageY,this.screenX=r.screenX||0,this.screenY=r.screenY||0):(this.clientX=e.clientX!==void 0?e.clientX:e.pageX,this.clientY=e.clientY!==void 0?e.clientY:e.pageY,this.screenX=e.screenX||0,this.screenY=e.screenY||0),this.button=e.button,this.key=e.key||"",this.ctrlKey=e.ctrlKey,this.altKey=e.altKey,this.shiftKey=e.shiftKey,this.metaKey=e.metaKey,this.pointerId=e.pointerId||0,this.pointerType=typeof e.pointerType=="string"?e.pointerType:wQe[e.pointerType]||"",this.state=e.state,this.i=e,e.defaultPrevented&&Xy.$.h.call(this)}}gi(Xy,Ki);var wQe={2:"touch",3:"pen",4:"mouse"};Xy.prototype.h=function(){Xy.$.h.call(this);var e=this.i;e.preventDefault?e.preventDefault():e.returnValue=!1};var rv="closure_listenable_"+(1e6*Math.random()|0),TQe=0;function SQe(e,t,n,r,i){this.listener=e,this.proxy=null,this.src=t,this.type=n,this.capture=!!r,this.la=i,this.key=++TQe,this.fa=this.ia=!1}function hx(e){e.fa=!0,e.listener=null,e.proxy=null,e.src=null,e.la=null}function s6(e,t,n){for(const r in e)t.call(n,e[r],r,e)}function IQe(e,t){for(const n in e)t.call(void 0,e[n],n,e)}function wse(e){const t={};for(const n in e)t[n]=e[n];return t}const OV="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function Tse(e,t){let n,r;for(let i=1;i>>0);function l6(e){return typeof e=="function"?e:(e[bO]||(e[bO]=function(t){return e.handleEvent(t)}),e[bO])}function hi(){Af.call(this),this.i=new px(this),this.S=this,this.J=null}gi(hi,Af);hi.prototype[rv]=!0;hi.prototype.removeEventListener=function(e,t,n,r){Cse(this,e,t,n,r)};function ki(e,t){var n,r=e.J;if(r)for(n=[];r;r=r.J)n.push(r);if(e=e.S,r=t.type||t,typeof t=="string")t=new Ki(t,e);else if(t instanceof Ki)t.target=t.target||e;else{var i=t;t=new Ki(r,e),Tse(t,i)}if(i=!0,n)for(var s=n.length-1;0<=s;s--){var o=t.g=n[s];i=O1(o,r,!0,t)&&i}if(o=t.g=e,i=O1(o,r,!0,t)&&i,i=O1(o,r,!1,t)&&i,n)for(s=0;snew RQe,e=>e.reset());class RQe{constructor(){this.next=this.g=this.h=null}set(t,n){this.h=t,this.g=n,this.next=null}reset(){this.next=this.g=this.h=null}}function NQe(e){var t=1;e=e.split(":");const n=[];for(;0{throw e},0)}let Jy,Zy=!1,f6=new PQe,Pse=()=>{const e=St.Promise.resolve(void 0);Jy=()=>{e.then(DQe)}};var DQe=()=>{for(var e;e=OQe();){try{e.h.call(e.g)}catch(n){kQe(n)}var t=Ose;t.j(e),100>t.h&&(t.h++,e.next=t.g,t.g=e)}Zy=!1};function mx(e,t){hi.call(this),this.h=e||1,this.g=t||St,this.j=Gi(this.qb,this),this.l=Date.now()}gi(mx,hi);Fe=mx.prototype;Fe.ga=!1;Fe.T=null;Fe.qb=function(){if(this.ga){var e=Date.now()-this.l;0{e.g=null,e.i&&(e.i=!1,Rse(e))},e.j);const t=e.h;e.h=null,e.m.apply(null,t)}class $Qe extends Af{constructor(t,n){super(),this.m=t,this.j=n,this.h=null,this.i=!1,this.g=null}l(t){this.h=arguments,this.g?this.i=!0:Rse(this)}N(){super.N(),this.g&&(St.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}}function e_(e){Af.call(this),this.h=e,this.g={}}gi(e_,Af);var PV=[];function Nse(e,t,n,r){Array.isArray(n)||(n&&(PV[0]=n.toString()),n=PV);for(var i=0;i>>0),hQe=0;function pQe(e,t,n){return e.call.apply(e.bind,arguments)}function mQe(e,t,n){if(!e)throw Error();if(2{};St.addEventListener("test",n,t),St.removeEventListener("test",n,t)}catch{}return e}();function Qy(e){return/^[\s\xa0]*$/.test(e)}function dx(){var e=St.navigator;return e&&(e=e.userAgent)?e:""}function ou(e){return dx().indexOf(e)!=-1}function i6(e){return i6[" "](e),e}i6[" "]=function(){};function _Qe(e,t){var n=cXe;return Object.prototype.hasOwnProperty.call(n,e)?n[e]:n[e]=t(e)}var vQe=ou("Opera"),Em=ou("Trident")||ou("MSIE"),_se=ou("Edge"),xR=_se||Em,vse=ou("Gecko")&&!(dx().toLowerCase().indexOf("webkit")!=-1&&!ou("Edge"))&&!(ou("Trident")||ou("MSIE"))&&!ou("Edge"),bQe=dx().toLowerCase().indexOf("webkit")!=-1&&!ou("Edge");function bse(){var e=St.document;return e?e.documentMode:void 0}var CR;e:{var gO="",yO=function(){var e=dx();if(vse)return/rv:([^\);]+)(\)|;)/.exec(e);if(_se)return/Edge\/([\d\.]+)/.exec(e);if(Em)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(e);if(bQe)return/WebKit\/(\S+)/.exec(e);if(vQe)return/(?:Version)[ \/]?(\S+)/.exec(e)}();if(yO&&(gO=yO?yO[1]:""),Em){var _O=bse();if(_O!=null&&_O>parseFloat(gO)){CR=String(_O);break e}}CR=gO}var AR;if(St.document&&Em){var AV=bse();AR=AV||parseInt(CR,10)||void 0}else AR=void 0;var EQe=AR;function Xy(e,t){if(Ki.call(this,e?e.type:""),this.relatedTarget=this.g=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.state=null,this.pointerId=0,this.pointerType="",this.i=null,e){var n=this.type=e.type,r=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:null;if(this.target=e.target||e.srcElement,this.g=t,t=e.relatedTarget){if(vse){e:{try{i6(t.nodeName);var i=!0;break e}catch{}i=!1}i||(t=null)}}else n=="mouseover"?t=e.fromElement:n=="mouseout"&&(t=e.toElement);this.relatedTarget=t,r?(this.clientX=r.clientX!==void 0?r.clientX:r.pageX,this.clientY=r.clientY!==void 0?r.clientY:r.pageY,this.screenX=r.screenX||0,this.screenY=r.screenY||0):(this.clientX=e.clientX!==void 0?e.clientX:e.pageX,this.clientY=e.clientY!==void 0?e.clientY:e.pageY,this.screenX=e.screenX||0,this.screenY=e.screenY||0),this.button=e.button,this.key=e.key||"",this.ctrlKey=e.ctrlKey,this.altKey=e.altKey,this.shiftKey=e.shiftKey,this.metaKey=e.metaKey,this.pointerId=e.pointerId||0,this.pointerType=typeof e.pointerType=="string"?e.pointerType:wQe[e.pointerType]||"",this.state=e.state,this.i=e,e.defaultPrevented&&Xy.$.h.call(this)}}gi(Xy,Ki);var wQe={2:"touch",3:"pen",4:"mouse"};Xy.prototype.h=function(){Xy.$.h.call(this);var e=this.i;e.preventDefault?e.preventDefault():e.returnValue=!1};var rv="closure_listenable_"+(1e6*Math.random()|0),TQe=0;function SQe(e,t,n,r,i){this.listener=e,this.proxy=null,this.src=t,this.type=n,this.capture=!!r,this.la=i,this.key=++TQe,this.fa=this.ia=!1}function hx(e){e.fa=!0,e.listener=null,e.proxy=null,e.src=null,e.la=null}function s6(e,t,n){for(const r in e)t.call(n,e[r],r,e)}function IQe(e,t){for(const n in e)t.call(void 0,e[n],n,e)}function Ese(e){const t={};for(const n in e)t[n]=e[n];return t}const OV="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function wse(e,t){let n,r;for(let i=1;i>>0);function l6(e){return typeof e=="function"?e:(e[bO]||(e[bO]=function(t){return e.handleEvent(t)}),e[bO])}function hi(){Af.call(this),this.i=new px(this),this.S=this,this.J=null}gi(hi,Af);hi.prototype[rv]=!0;hi.prototype.removeEventListener=function(e,t,n,r){xse(this,e,t,n,r)};function ki(e,t){var n,r=e.J;if(r)for(n=[];r;r=r.J)n.push(r);if(e=e.S,r=t.type||t,typeof t=="string")t=new Ki(t,e);else if(t instanceof Ki)t.target=t.target||e;else{var i=t;t=new Ki(r,e),wse(t,i)}if(i=!0,n)for(var s=n.length-1;0<=s;s--){var o=t.g=n[s];i=O1(o,r,!0,t)&&i}if(o=t.g=e,i=O1(o,r,!0,t)&&i,i=O1(o,r,!1,t)&&i,n)for(s=0;snew RQe,e=>e.reset());class RQe{constructor(){this.next=this.g=this.h=null}set(t,n){this.h=t,this.g=n,this.next=null}reset(){this.next=this.g=this.h=null}}function NQe(e){var t=1;e=e.split(":");const n=[];for(;0{throw e},0)}let Jy,Zy=!1,f6=new PQe,Ose=()=>{const e=St.Promise.resolve(void 0);Jy=()=>{e.then(DQe)}};var DQe=()=>{for(var e;e=OQe();){try{e.h.call(e.g)}catch(n){kQe(n)}var t=Ase;t.j(e),100>t.h&&(t.h++,e.next=t.g,t.g=e)}Zy=!1};function mx(e,t){hi.call(this),this.h=e||1,this.g=t||St,this.j=Gi(this.qb,this),this.l=Date.now()}gi(mx,hi);Fe=mx.prototype;Fe.ga=!1;Fe.T=null;Fe.qb=function(){if(this.ga){var e=Date.now()-this.l;0{e.g=null,e.i&&(e.i=!1,Pse(e))},e.j);const t=e.h;e.h=null,e.m.apply(null,t)}class $Qe extends Af{constructor(t,n){super(),this.m=t,this.j=n,this.h=null,this.i=!1,this.g=null}l(t){this.h=arguments,this.g?this.i=!0:Pse(this)}N(){super.N(),this.g&&(St.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}}function e_(e){Af.call(this),this.h=e,this.g={}}gi(e_,Af);var PV=[];function Rse(e,t,n,r){Array.isArray(n)||(n&&(PV[0]=n.toString()),n=PV);for(var i=0;ir.length)){var i=r[1];if(Array.isArray(i)&&!(1>i.length)){var s=i[0];if(s!="noop"&&s!="stop"&&s!="close")for(var o=1;oc)&&(c!=3||xR||this.g&&(this.h.h||this.g.ja()||LV(this.g)))){this.J||c!=4||t==7||(t==8||0>=f?t_(3):t_(2)),bx(this);var n=this.g.da();this.ca=n;t:if(Vse(this)){var r=LV(this.g);e="";var i=r.length,s=du(this.g)==4;if(!this.h.i){if(typeof TextDecoder>"u"){fd(this),Q0(this);var o="";break t}this.h.i=new St.TextDecoder}for(t=0;tt.length?NR:(t=t.slice(r,r+n),e.o=r+n,t)))}Fe.cancel=function(){this.J=!0,fd(this)};function av(e){e.Y=Date.now()+e.P,Hse(e,e.P)}function Hse(e,t){if(e.C!=null)throw Error("WatchDog timer not null");e.C=iv(Gi(e.lb,e),t)}function bx(e){e.C&&(St.clearTimeout(e.C),e.C=null)}Fe.lb=function(){this.C=null;const e=Date.now();0<=e-this.Y?(FQe(this.j,this.B),this.L!=2&&(t_(),us(17)),fd(this),this.s=2,Q0(this)):Hse(this,this.Y-e)};function Q0(e){e.l.H==0||e.J||doe(e.l,e)}function fd(e){bx(e);var t=e.M;t&&typeof t.sa=="function"&&t.sa(),e.M=null,d6(e.V),kse(e.U),e.g&&(t=e.g,e.g=null,t.abort(),t.sa())}function DR(e,t){try{var n=e.l;if(n.H!=0&&(n.g==e||$R(n.i,e))){if(!e.K&&$R(n.i,e)&&n.H==3){try{var r=n.Ja.g.parse(t)}catch{r=null}if(Array.isArray(r)&&r.length==3){var i=r;if(i[0]==0){e:if(!n.u){if(n.g)if(n.g.G+3e3i[2]&&n.G&&n.A==0&&!n.v&&(n.v=iv(Gi(n.ib,n),6e3));if(1>=Jse(n.i)&&n.oa){try{n.oa()}catch{}n.oa=void 0}}else dd(n,11)}else if((e.K||n.g==e)&&KT(n),!Qy(t))for(i=n.Ja.g.parse(t),t=0;tt)throw Error("Bad port number "+t);e.m=t}else e.m=null}function kV(e,t,n){t instanceof n_?(e.i=t,QQe(e.i,e.h)):(n||(t=p0(t,GQe)),e.i=new n_(t,e.h))}function Jn(e,t,n){e.i.set(t,n)}function Ex(e){return Jn(e,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),e}function h0(e,t){return e?t?decodeURI(e.replace(/%25/g,"%2525")):decodeURIComponent(e):""}function p0(e,t,n){return typeof e=="string"?(e=encodeURI(e).replace(t,WQe),n&&(e=e.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),e):null}function WQe(e){return e=e.charCodeAt(0),"%"+(e>>4&15).toString(16)+(e&15).toString(16)}var DV=/[#\/\?@]/g,qQe=/[#\?:]/g,YQe=/[#\?]/g,GQe=/[#\?@]/g,KQe=/#/g;function n_(e,t){this.h=this.g=null,this.i=e||null,this.j=!!t}function Of(e){e.g||(e.g=new Map,e.h=0,e.i&&HQe(e.i,function(t,n){e.add(decodeURIComponent(t.replace(/\+/g," ")),n)}))}Fe=n_.prototype;Fe.add=function(e,t){Of(this),this.i=null,e=sg(this,e);var n=this.g.get(e);return n||this.g.set(e,n=[]),n.push(t),this.h+=1,this};function Yse(e,t){Of(e),t=sg(e,t),e.g.has(t)&&(e.i=null,e.h-=e.g.get(t).length,e.g.delete(t))}function Gse(e,t){return Of(e),t=sg(e,t),e.g.has(t)}Fe.forEach=function(e,t){Of(this),this.g.forEach(function(n,r){n.forEach(function(i){e.call(t,i,r,this)},this)},this)};Fe.ta=function(){Of(this);const e=Array.from(this.g.values()),t=Array.from(this.g.keys()),n=[];for(let r=0;r=e.j:!1}function Jse(e){return e.h?1:e.g?e.g.size:0}function $R(e,t){return e.h?e.h==t:e.g?e.g.has(t):!1}function y6(e,t){e.g?e.g.add(t):e.h=t}function Zse(e,t){e.h&&e.h==t?e.h=null:e.g&&e.g.has(t)&&e.g.delete(t)}Qse.prototype.cancel=function(){if(this.i=eoe(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&this.g.size!==0){for(const e of this.g.values())e.cancel();this.g.clear()}};function eoe(e){if(e.h!=null)return e.i.concat(e.h.F);if(e.g!=null&&e.g.size!==0){let t=e.i;for(const n of e.g.values())t=t.concat(n.F);return t}return r6(e.i)}var ZQe=class{stringify(e){return St.JSON.stringify(e,void 0)}parse(e){return St.JSON.parse(e,void 0)}};function eXe(){this.g=new ZQe}function tXe(e,t,n){const r=n||"";try{Wse(e,function(i,s){let o=i;nv(i)&&(o=c6(i)),t.push(r+s+"="+encodeURIComponent(o))})}catch(i){throw t.push(r+"type="+encodeURIComponent("_badmap")),i}}function nXe(e,t){const n=new gx;if(St.Image){const r=new Image;r.onload=A1(P1,n,r,"TestLoadImage: loaded",!0,t),r.onerror=A1(P1,n,r,"TestLoadImage: error",!1,t),r.onabort=A1(P1,n,r,"TestLoadImage: abort",!1,t),r.ontimeout=A1(P1,n,r,"TestLoadImage: timeout",!1,t),St.setTimeout(function(){r.ontimeout&&r.ontimeout()},1e4),r.src=e}else t(!1)}function P1(e,t,n,r,i){try{t.onload=null,t.onerror=null,t.onabort=null,t.ontimeout=null,i(r)}catch{}}function wx(e){this.l=e.ec||null,this.j=e.ob||!1}gi(wx,p6);wx.prototype.g=function(){return new Tx(this.l,this.j)};wx.prototype.i=function(e){return function(){return e}}({});function Tx(e,t){hi.call(this),this.F=e,this.u=t,this.m=void 0,this.readyState=_6,this.status=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.v=new Headers,this.h=null,this.C="GET",this.B="",this.g=!1,this.A=this.j=this.l=null}gi(Tx,hi);var _6=0;Fe=Tx.prototype;Fe.open=function(e,t){if(this.readyState!=_6)throw this.abort(),Error("Error reopening a connection");this.C=e,this.B=t,this.readyState=1,r_(this)};Fe.send=function(e){if(this.readyState!=1)throw this.abort(),Error("need to call open() first. ");this.g=!0;const t={headers:this.v,method:this.C,credentials:this.m,cache:void 0};e&&(t.body=e),(this.F||St).fetch(new Request(this.B,t)).then(this.$a.bind(this),this.ka.bind(this))};Fe.abort=function(){this.response=this.responseText="",this.v=new Headers,this.status=0,this.j&&this.j.cancel("Request was aborted.").catch(()=>{}),1<=this.readyState&&this.g&&this.readyState!=4&&(this.g=!1,uv(this)),this.readyState=_6};Fe.$a=function(e){if(this.g&&(this.l=e,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=e.headers,this.readyState=2,r_(this)),this.g&&(this.readyState=3,r_(this),this.g)))if(this.responseType==="arraybuffer")e.arrayBuffer().then(this.Ya.bind(this),this.ka.bind(this));else if(typeof St.ReadableStream<"u"&&"body"in e){if(this.j=e.body.getReader(),this.u){if(this.responseType)throw Error('responseType must be empty for "streamBinaryChunks" mode responses.');this.response=[]}else this.response=this.responseText="",this.A=new TextDecoder;toe(this)}else e.text().then(this.Za.bind(this),this.ka.bind(this))};function toe(e){e.j.read().then(e.Xa.bind(e)).catch(e.ka.bind(e))}Fe.Xa=function(e){if(this.g){if(this.u&&e.value)this.response.push(e.value);else if(!this.u){var t=e.value?e.value:new Uint8Array(0);(t=this.A.decode(t,{stream:!e.done}))&&(this.response=this.responseText+=t)}e.done?uv(this):r_(this),this.readyState==3&&toe(this)}};Fe.Za=function(e){this.g&&(this.response=this.responseText=e,uv(this))};Fe.Ya=function(e){this.g&&(this.response=e,uv(this))};Fe.ka=function(){this.g&&uv(this)};function uv(e){e.readyState=4,e.l=null,e.j=null,e.A=null,r_(e)}Fe.setRequestHeader=function(e,t){this.v.append(e,t)};Fe.getResponseHeader=function(e){return this.h&&this.h.get(e.toLowerCase())||""};Fe.getAllResponseHeaders=function(){if(!this.h)return"";const e=[],t=this.h.entries();for(var n=t.next();!n.done;)n=n.value,e.push(n[0]+": "+n[1]),n=t.next();return e.join(`\r -`)};function r_(e){e.onreadystatechange&&e.onreadystatechange.call(e)}Object.defineProperty(Tx.prototype,"withCredentials",{get:function(){return this.m==="include"},set:function(e){this.m=e?"include":"same-origin"}});var rXe=St.JSON.parse;function Ar(e){hi.call(this),this.headers=new Map,this.u=e||null,this.h=!1,this.C=this.g=null,this.I="",this.m=0,this.j="",this.l=this.G=this.v=this.F=!1,this.B=0,this.A=null,this.K=noe,this.L=this.M=!1}gi(Ar,hi);var noe="",iXe=/^https?$/i,sXe=["POST","PUT"];Fe=Ar.prototype;Fe.Oa=function(e){this.M=e};Fe.ha=function(e,t,n,r){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.I+"; newUri="+e);t=t?t.toUpperCase():"GET",this.I=e,this.j="",this.m=0,this.F=!1,this.h=!0,this.g=this.u?this.u.g():RR.g(),this.C=this.u?NV(this.u):NV(RR),this.g.onreadystatechange=Gi(this.La,this);try{this.G=!0,this.g.open(t,String(e),!0),this.G=!1}catch(s){$V(this,s);return}if(e=n||"",n=new Map(this.headers),r)if(Object.getPrototypeOf(r)===Object.prototype)for(var i in r)n.set(i,r[i]);else if(typeof r.keys=="function"&&typeof r.get=="function")for(const s of r.keys())n.set(s,r.get(s));else throw Error("Unknown input type for opt_headers: "+String(r));r=Array.from(n.keys()).find(s=>s.toLowerCase()=="content-type"),i=St.FormData&&e instanceof St.FormData,!(0<=_se(sXe,t))||r||i||n.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");for(const[s,o]of n)this.g.setRequestHeader(s,o);this.K&&(this.g.responseType=this.K),"withCredentials"in this.g&&this.g.withCredentials!==this.M&&(this.g.withCredentials=this.M);try{soe(this),0{}:null;e.g=null,e.C=null,t||ki(e,"ready");try{n.onreadystatechange=r}catch{}}}function soe(e){e.g&&e.L&&(e.g.ontimeout=null),e.A&&(St.clearTimeout(e.A),e.A=null)}Fe.isActive=function(){return!!this.g};function du(e){return e.g?e.g.readyState:0}Fe.da=function(){try{return 2=e.i.j-(e.m?1:0)?!1:e.m?(e.j=t.F.concat(e.j),!0):e.H==1||e.H==2||e.C>=(e.cb?0:e.eb)?!1:(e.m=iv(Gi(e.Na,e,t),hoe(e,e.C)),e.C++,!0)}Fe.Na=function(e){if(this.m)if(this.m=null,this.H==1){if(!e){this.W=Math.floor(1e5*Math.random()),e=this.W++;const i=new ov(this,this.l,e);let s=this.s;if(this.U&&(s?(s=wse(s),Tse(s,this.U)):s=this.U),this.o!==null||this.O||(i.I=s,s=null),this.P)e:{for(var t=0,n=0;nl)s=Math.max(0,i[u].g-100),a=!1;else try{tXe(c,o,"req"+l+"_")}catch{r&&r(c)}}if(a){r=o.join("&");break e}}}return e=e.j.splice(0,n),t.F=e,r}function coe(e){if(!e.g&&!e.u){e.ba=1;var t=e.Ma;Jy||Pse(),Zy||(Jy(),Zy=!0),f6.add(t,e),e.A=0}}function E6(e){return e.g||e.u||3<=e.A?!1:(e.ba++,e.u=iv(Gi(e.Ma,e),hoe(e,e.A)),e.A++,!0)}Fe.Ma=function(){if(this.u=null,foe(this),this.ca&&!(this.M||this.g==null||0>=this.S)){var e=2*this.S;this.l.info("BP detection timer enabled: "+e),this.B=iv(Gi(this.jb,this),e)}};Fe.jb=function(){this.B&&(this.B=null,this.l.info("BP detection timeout reached."),this.l.info("Buffering proxy detected and switch to long-polling!"),this.G=!1,this.M=!0,us(10),Ix(this),foe(this))};function w6(e){e.B!=null&&(St.clearTimeout(e.B),e.B=null)}function foe(e){e.g=new ov(e,e.l,"rpc",e.ba),e.o===null&&(e.g.I=e.s),e.g.O=0;var t=Ll(e.wa);Jn(t,"RID","rpc"),Jn(t,"SID",e.K),Jn(t,"AID",e.V),Jn(t,"CI",e.G?"0":"1"),!e.G&&e.qa&&Jn(t,"TO",e.qa),Jn(t,"TYPE","xmlhttp"),lv(e,t),e.o&&e.s&&v6(t,e.o,e.s),e.L&&e.g.setTimeout(e.L);var n=e.g;e=e.pa,n.L=1,n.A=Ex(Ll(t)),n.u=null,n.S=!0,Use(n,e)}Fe.ib=function(){this.v!=null&&(this.v=null,Ix(this),E6(this),us(19))};function KT(e){e.v!=null&&(St.clearTimeout(e.v),e.v=null)}function doe(e,t){var n=null;if(e.g==t){KT(e),w6(e),e.g=null;var r=2}else if($R(e.i,t))n=t.F,Zse(e.i,t),r=1;else return;if(e.H!=0){if(t.i)if(r==1){n=t.u?t.u.length:0,t=Date.now()-t.G;var i=e.C;r=yx(),ki(r,new Lse(r,n)),xx(e)}else coe(e);else if(i=t.s,i==3||i==0&&0i;++i)r[i]=t.charCodeAt(n++)|t.charCodeAt(n++)<<8|t.charCodeAt(n++)<<16|t.charCodeAt(n++)<<24;else for(i=0;16>i;++i)r[i]=t[n++]|t[n++]<<8|t[n++]<<16|t[n++]<<24;t=e.g[0],n=e.g[1],i=e.g[2];var s=e.g[3],o=t+(s^n&(i^s))+r[0]+3614090360&4294967295;t=n+(o<<7&4294967295|o>>>25),o=s+(i^t&(n^i))+r[1]+3905402710&4294967295,s=t+(o<<12&4294967295|o>>>20),o=i+(n^s&(t^n))+r[2]+606105819&4294967295,i=s+(o<<17&4294967295|o>>>15),o=n+(t^i&(s^t))+r[3]+3250441966&4294967295,n=i+(o<<22&4294967295|o>>>10),o=t+(s^n&(i^s))+r[4]+4118548399&4294967295,t=n+(o<<7&4294967295|o>>>25),o=s+(i^t&(n^i))+r[5]+1200080426&4294967295,s=t+(o<<12&4294967295|o>>>20),o=i+(n^s&(t^n))+r[6]+2821735955&4294967295,i=s+(o<<17&4294967295|o>>>15),o=n+(t^i&(s^t))+r[7]+4249261313&4294967295,n=i+(o<<22&4294967295|o>>>10),o=t+(s^n&(i^s))+r[8]+1770035416&4294967295,t=n+(o<<7&4294967295|o>>>25),o=s+(i^t&(n^i))+r[9]+2336552879&4294967295,s=t+(o<<12&4294967295|o>>>20),o=i+(n^s&(t^n))+r[10]+4294925233&4294967295,i=s+(o<<17&4294967295|o>>>15),o=n+(t^i&(s^t))+r[11]+2304563134&4294967295,n=i+(o<<22&4294967295|o>>>10),o=t+(s^n&(i^s))+r[12]+1804603682&4294967295,t=n+(o<<7&4294967295|o>>>25),o=s+(i^t&(n^i))+r[13]+4254626195&4294967295,s=t+(o<<12&4294967295|o>>>20),o=i+(n^s&(t^n))+r[14]+2792965006&4294967295,i=s+(o<<17&4294967295|o>>>15),o=n+(t^i&(s^t))+r[15]+1236535329&4294967295,n=i+(o<<22&4294967295|o>>>10),o=t+(i^s&(n^i))+r[1]+4129170786&4294967295,t=n+(o<<5&4294967295|o>>>27),o=s+(n^i&(t^n))+r[6]+3225465664&4294967295,s=t+(o<<9&4294967295|o>>>23),o=i+(t^n&(s^t))+r[11]+643717713&4294967295,i=s+(o<<14&4294967295|o>>>18),o=n+(s^t&(i^s))+r[0]+3921069994&4294967295,n=i+(o<<20&4294967295|o>>>12),o=t+(i^s&(n^i))+r[5]+3593408605&4294967295,t=n+(o<<5&4294967295|o>>>27),o=s+(n^i&(t^n))+r[10]+38016083&4294967295,s=t+(o<<9&4294967295|o>>>23),o=i+(t^n&(s^t))+r[15]+3634488961&4294967295,i=s+(o<<14&4294967295|o>>>18),o=n+(s^t&(i^s))+r[4]+3889429448&4294967295,n=i+(o<<20&4294967295|o>>>12),o=t+(i^s&(n^i))+r[9]+568446438&4294967295,t=n+(o<<5&4294967295|o>>>27),o=s+(n^i&(t^n))+r[14]+3275163606&4294967295,s=t+(o<<9&4294967295|o>>>23),o=i+(t^n&(s^t))+r[3]+4107603335&4294967295,i=s+(o<<14&4294967295|o>>>18),o=n+(s^t&(i^s))+r[8]+1163531501&4294967295,n=i+(o<<20&4294967295|o>>>12),o=t+(i^s&(n^i))+r[13]+2850285829&4294967295,t=n+(o<<5&4294967295|o>>>27),o=s+(n^i&(t^n))+r[2]+4243563512&4294967295,s=t+(o<<9&4294967295|o>>>23),o=i+(t^n&(s^t))+r[7]+1735328473&4294967295,i=s+(o<<14&4294967295|o>>>18),o=n+(s^t&(i^s))+r[12]+2368359562&4294967295,n=i+(o<<20&4294967295|o>>>12),o=t+(n^i^s)+r[5]+4294588738&4294967295,t=n+(o<<4&4294967295|o>>>28),o=s+(t^n^i)+r[8]+2272392833&4294967295,s=t+(o<<11&4294967295|o>>>21),o=i+(s^t^n)+r[11]+1839030562&4294967295,i=s+(o<<16&4294967295|o>>>16),o=n+(i^s^t)+r[14]+4259657740&4294967295,n=i+(o<<23&4294967295|o>>>9),o=t+(n^i^s)+r[1]+2763975236&4294967295,t=n+(o<<4&4294967295|o>>>28),o=s+(t^n^i)+r[4]+1272893353&4294967295,s=t+(o<<11&4294967295|o>>>21),o=i+(s^t^n)+r[7]+4139469664&4294967295,i=s+(o<<16&4294967295|o>>>16),o=n+(i^s^t)+r[10]+3200236656&4294967295,n=i+(o<<23&4294967295|o>>>9),o=t+(n^i^s)+r[13]+681279174&4294967295,t=n+(o<<4&4294967295|o>>>28),o=s+(t^n^i)+r[0]+3936430074&4294967295,s=t+(o<<11&4294967295|o>>>21),o=i+(s^t^n)+r[3]+3572445317&4294967295,i=s+(o<<16&4294967295|o>>>16),o=n+(i^s^t)+r[6]+76029189&4294967295,n=i+(o<<23&4294967295|o>>>9),o=t+(n^i^s)+r[9]+3654602809&4294967295,t=n+(o<<4&4294967295|o>>>28),o=s+(t^n^i)+r[12]+3873151461&4294967295,s=t+(o<<11&4294967295|o>>>21),o=i+(s^t^n)+r[15]+530742520&4294967295,i=s+(o<<16&4294967295|o>>>16),o=n+(i^s^t)+r[2]+3299628645&4294967295,n=i+(o<<23&4294967295|o>>>9),o=t+(i^(n|~s))+r[0]+4096336452&4294967295,t=n+(o<<6&4294967295|o>>>26),o=s+(n^(t|~i))+r[7]+1126891415&4294967295,s=t+(o<<10&4294967295|o>>>22),o=i+(t^(s|~n))+r[14]+2878612391&4294967295,i=s+(o<<15&4294967295|o>>>17),o=n+(s^(i|~t))+r[5]+4237533241&4294967295,n=i+(o<<21&4294967295|o>>>11),o=t+(i^(n|~s))+r[12]+1700485571&4294967295,t=n+(o<<6&4294967295|o>>>26),o=s+(n^(t|~i))+r[3]+2399980690&4294967295,s=t+(o<<10&4294967295|o>>>22),o=i+(t^(s|~n))+r[10]+4293915773&4294967295,i=s+(o<<15&4294967295|o>>>17),o=n+(s^(i|~t))+r[1]+2240044497&4294967295,n=i+(o<<21&4294967295|o>>>11),o=t+(i^(n|~s))+r[8]+1873313359&4294967295,t=n+(o<<6&4294967295|o>>>26),o=s+(n^(t|~i))+r[15]+4264355552&4294967295,s=t+(o<<10&4294967295|o>>>22),o=i+(t^(s|~n))+r[6]+2734768916&4294967295,i=s+(o<<15&4294967295|o>>>17),o=n+(s^(i|~t))+r[13]+1309151649&4294967295,n=i+(o<<21&4294967295|o>>>11),o=t+(i^(n|~s))+r[4]+4149444226&4294967295,t=n+(o<<6&4294967295|o>>>26),o=s+(n^(t|~i))+r[11]+3174756917&4294967295,s=t+(o<<10&4294967295|o>>>22),o=i+(t^(s|~n))+r[2]+718787259&4294967295,i=s+(o<<15&4294967295|o>>>17),o=n+(s^(i|~t))+r[9]+3951481745&4294967295,e.g[0]=e.g[0]+t&4294967295,e.g[1]=e.g[1]+(i+(o<<21&4294967295|o>>>11))&4294967295,e.g[2]=e.g[2]+i&4294967295,e.g[3]=e.g[3]+s&4294967295}Na.prototype.j=function(e,t){t===void 0&&(t=e.length);for(var n=t-this.blockSize,r=this.m,i=this.h,s=0;sthis.h?this.blockSize:2*this.blockSize)-this.h);e[0]=128;for(var t=1;tt;++t)for(var r=0;32>r;r+=8)e[n++]=this.g[t]>>>r&255;return e};function Nn(e,t){this.h=t;for(var n=[],r=!0,i=e.length-1;0<=i;i--){var s=e[i]|0;r&&s==t||(n[i]=s,r=!1)}this.g=n}var cXe={};function T6(e){return-128<=e&&128>e?_Qe(e,function(t){return new Nn([t|0],0>t?-1:0)}):new Nn([e|0],0>e?-1:0)}function hu(e){if(isNaN(e)||!isFinite(e))return $p;if(0>e)return Oi(hu(-e));for(var t=[],n=1,r=0;e>=n;r++)t[r]=e/n|0,n*=LR;return new Nn(t,0)}function boe(e,t){if(e.length==0)throw Error("number format error: empty string");if(t=t||10,2>t||36s?(s=hu(Math.pow(t,s)),r=r.R(s).add(hu(o))):(r=r.R(n),r=r.add(hu(o)))}return r}var LR=4294967296,$p=T6(0),MR=T6(1),FV=T6(16777216);Fe=Nn.prototype;Fe.ea=function(){if(Fo(this))return-Oi(this).ea();for(var e=0,t=1,n=0;ne||36>>0).toString(e);if(n=i,ul(n))return s+r;for(;6>s.length;)s="0"+s;r=s+r}};Fe.D=function(e){return 0>e?0:e>>16)+(this.D(i)>>>16)+(e.D(i)>>>16);r=o>>>16,s&=65535,o&=65535,n[i]=o<<16|s}return new Nn(n,n[n.length-1]&-2147483648?-1:0)};function XT(e,t){return e.add(Oi(t))}Fe.R=function(e){if(ul(this)||ul(e))return $p;if(Fo(this))return Fo(e)?Oi(this).R(Oi(e)):Oi(Oi(this).R(e));if(Fo(e))return Oi(this.R(Oi(e)));if(0>this.X(FV)&&0>e.X(FV))return hu(this.ea()*e.ea());for(var t=this.g.length+e.g.length,n=[],r=0;r<2*t;r++)n[r]=0;for(r=0;r>>16,o=this.D(r)&65535,a=e.D(i)>>>16,u=e.D(i)&65535;n[2*r+2*i]+=o*u,R1(n,2*r+2*i),n[2*r+2*i+1]+=s*u,R1(n,2*r+2*i+1),n[2*r+2*i+1]+=o*a,R1(n,2*r+2*i+1),n[2*r+2*i+2]+=s*a,R1(n,2*r+2*i+2)}for(r=0;r>>16,e[t]&=65535,t++}function Gg(e,t){this.g=e,this.h=t}function JT(e,t){if(ul(t))throw Error("division by zero");if(ul(e))return new Gg($p,$p);if(Fo(e))return t=JT(Oi(e),t),new Gg(Oi(t.g),Oi(t.h));if(Fo(t))return t=JT(e,Oi(t)),new Gg(Oi(t.g),t.h);if(30=r.X(e);)n=BV(n),r=BV(r);var i=Ch(n,1),s=Ch(r,1);for(r=Ch(r,2),n=Ch(n,2);!ul(r);){var o=s.add(r);0>=o.X(e)&&(i=i.add(n),s=o),r=Ch(r,1),n=Ch(n,1)}return t=XT(e,i.R(t)),new Gg(i,t)}for(i=$p;0<=e.X(t);){for(n=Math.max(1,Math.floor(e.ea()/t.ea())),r=Math.ceil(Math.log(n)/Math.LN2),r=48>=r?1:Math.pow(2,r-48),s=hu(n),o=s.R(t);Fo(o)||0>>31;return new Nn(n,e.h)}function Ch(e,t){var n=t>>5;t%=32;for(var r=e.g.length-n,i=[],s=0;s>>t|e.D(s+n+1)<<32-t:e.D(s+n);return new Nn(i,e.h)}QT.prototype.createWebChannel=QT.prototype.g;vo.prototype.send=vo.prototype.u;vo.prototype.open=vo.prototype.m;vo.prototype.close=vo.prototype.close;_x.NO_ERROR=0;_x.TIMEOUT=8;_x.HTTP_ERROR=6;Mse.COMPLETE="complete";Fse.EventType=sv;sv.OPEN="a";sv.CLOSE="b";sv.ERROR="c";sv.MESSAGE="d";hi.prototype.listen=hi.prototype.O;Ar.prototype.listenOnce=Ar.prototype.P;Ar.prototype.getLastError=Ar.prototype.Sa;Ar.prototype.getLastErrorCode=Ar.prototype.Ia;Ar.prototype.getStatus=Ar.prototype.da;Ar.prototype.getResponseJson=Ar.prototype.Wa;Ar.prototype.getResponseText=Ar.prototype.ja;Ar.prototype.send=Ar.prototype.ha;Ar.prototype.setWithCredentials=Ar.prototype.Oa;Na.prototype.digest=Na.prototype.l;Na.prototype.reset=Na.prototype.reset;Na.prototype.update=Na.prototype.j;Nn.prototype.add=Nn.prototype.add;Nn.prototype.multiply=Nn.prototype.R;Nn.prototype.modulo=Nn.prototype.gb;Nn.prototype.compare=Nn.prototype.X;Nn.prototype.toNumber=Nn.prototype.ea;Nn.prototype.toString=Nn.prototype.toString;Nn.prototype.getBits=Nn.prototype.D;Nn.fromNumber=hu;Nn.fromString=boe;var fXe=function(){return new QT},dXe=function(){return yx()},wO=_x,hXe=Mse,pXe=fh,jV={xb:0,Ab:1,Bb:2,Ub:3,Zb:4,Wb:5,Xb:6,Vb:7,Tb:8,Yb:9,PROXY:10,NOPROXY:11,Rb:12,Nb:13,Ob:14,Mb:15,Pb:16,Qb:17,tb:18,sb:19,ub:20},N1=Fse,mXe=Ar,gXe=Na,Lp=Nn;const UV="@firebase/firestore";/** +`+s+" "+o})}function op(e,t,n,r){e.info(function(){return"XMLHTTP TEXT ("+t+"): "+BQe(e,n)+(r?" "+r:"")})}function FQe(e,t){e.info(function(){return"TIMEOUT: "+t})}gx.prototype.info=function(){};function BQe(e,t){if(!e.g)return t;if(!t)return null;try{var n=JSON.parse(t);if(n){for(e=0;er.length)){var i=r[1];if(Array.isArray(i)&&!(1>i.length)){var s=i[0];if(s!="noop"&&s!="stop"&&s!="close")for(var o=1;oc)&&(c!=3||xR||this.g&&(this.h.h||this.g.ja()||LV(this.g)))){this.J||c!=4||t==7||(t==8||0>=f?t_(3):t_(2)),bx(this);var n=this.g.da();this.ca=n;t:if(Use(this)){var r=LV(this.g);e="";var i=r.length,s=du(this.g)==4;if(!this.h.i){if(typeof TextDecoder>"u"){fd(this),Q0(this);var o="";break t}this.h.i=new St.TextDecoder}for(t=0;tt.length?NR:(t=t.slice(r,r+n),e.o=r+n,t)))}Fe.cancel=function(){this.J=!0,fd(this)};function av(e){e.Y=Date.now()+e.P,zse(e,e.P)}function zse(e,t){if(e.C!=null)throw Error("WatchDog timer not null");e.C=iv(Gi(e.lb,e),t)}function bx(e){e.C&&(St.clearTimeout(e.C),e.C=null)}Fe.lb=function(){this.C=null;const e=Date.now();0<=e-this.Y?(FQe(this.j,this.B),this.L!=2&&(t_(),us(17)),fd(this),this.s=2,Q0(this)):zse(this,this.Y-e)};function Q0(e){e.l.H==0||e.J||foe(e.l,e)}function fd(e){bx(e);var t=e.M;t&&typeof t.sa=="function"&&t.sa(),e.M=null,d6(e.V),Nse(e.U),e.g&&(t=e.g,e.g=null,t.abort(),t.sa())}function DR(e,t){try{var n=e.l;if(n.H!=0&&(n.g==e||$R(n.i,e))){if(!e.K&&$R(n.i,e)&&n.H==3){try{var r=n.Ja.g.parse(t)}catch{r=null}if(Array.isArray(r)&&r.length==3){var i=r;if(i[0]==0){e:if(!n.u){if(n.g)if(n.g.G+3e3i[2]&&n.G&&n.A==0&&!n.v&&(n.v=iv(Gi(n.ib,n),6e3));if(1>=Xse(n.i)&&n.oa){try{n.oa()}catch{}n.oa=void 0}}else dd(n,11)}else if((e.K||n.g==e)&&KT(n),!Qy(t))for(i=n.Ja.g.parse(t),t=0;tt)throw Error("Bad port number "+t);e.m=t}else e.m=null}function kV(e,t,n){t instanceof n_?(e.i=t,QQe(e.i,e.h)):(n||(t=p0(t,GQe)),e.i=new n_(t,e.h))}function Jn(e,t,n){e.i.set(t,n)}function Ex(e){return Jn(e,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),e}function h0(e,t){return e?t?decodeURI(e.replace(/%25/g,"%2525")):decodeURIComponent(e):""}function p0(e,t,n){return typeof e=="string"?(e=encodeURI(e).replace(t,WQe),n&&(e=e.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),e):null}function WQe(e){return e=e.charCodeAt(0),"%"+(e>>4&15).toString(16)+(e&15).toString(16)}var DV=/[#\/\?@]/g,qQe=/[#\?:]/g,YQe=/[#\?]/g,GQe=/[#\?@]/g,KQe=/#/g;function n_(e,t){this.h=this.g=null,this.i=e||null,this.j=!!t}function Of(e){e.g||(e.g=new Map,e.h=0,e.i&&HQe(e.i,function(t,n){e.add(decodeURIComponent(t.replace(/\+/g," ")),n)}))}Fe=n_.prototype;Fe.add=function(e,t){Of(this),this.i=null,e=sg(this,e);var n=this.g.get(e);return n||this.g.set(e,n=[]),n.push(t),this.h+=1,this};function qse(e,t){Of(e),t=sg(e,t),e.g.has(t)&&(e.i=null,e.h-=e.g.get(t).length,e.g.delete(t))}function Yse(e,t){return Of(e),t=sg(e,t),e.g.has(t)}Fe.forEach=function(e,t){Of(this),this.g.forEach(function(n,r){n.forEach(function(i){e.call(t,i,r,this)},this)},this)};Fe.ta=function(){Of(this);const e=Array.from(this.g.values()),t=Array.from(this.g.keys()),n=[];for(let r=0;r=e.j:!1}function Xse(e){return e.h?1:e.g?e.g.size:0}function $R(e,t){return e.h?e.h==t:e.g?e.g.has(t):!1}function y6(e,t){e.g?e.g.add(t):e.h=t}function Jse(e,t){e.h&&e.h==t?e.h=null:e.g&&e.g.has(t)&&e.g.delete(t)}Kse.prototype.cancel=function(){if(this.i=Zse(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&this.g.size!==0){for(const e of this.g.values())e.cancel();this.g.clear()}};function Zse(e){if(e.h!=null)return e.i.concat(e.h.F);if(e.g!=null&&e.g.size!==0){let t=e.i;for(const n of e.g.values())t=t.concat(n.F);return t}return r6(e.i)}var ZQe=class{stringify(e){return St.JSON.stringify(e,void 0)}parse(e){return St.JSON.parse(e,void 0)}};function eXe(){this.g=new ZQe}function tXe(e,t,n){const r=n||"";try{Hse(e,function(i,s){let o=i;nv(i)&&(o=c6(i)),t.push(r+s+"="+encodeURIComponent(o))})}catch(i){throw t.push(r+"type="+encodeURIComponent("_badmap")),i}}function nXe(e,t){const n=new gx;if(St.Image){const r=new Image;r.onload=A1(P1,n,r,"TestLoadImage: loaded",!0,t),r.onerror=A1(P1,n,r,"TestLoadImage: error",!1,t),r.onabort=A1(P1,n,r,"TestLoadImage: abort",!1,t),r.ontimeout=A1(P1,n,r,"TestLoadImage: timeout",!1,t),St.setTimeout(function(){r.ontimeout&&r.ontimeout()},1e4),r.src=e}else t(!1)}function P1(e,t,n,r,i){try{t.onload=null,t.onerror=null,t.onabort=null,t.ontimeout=null,i(r)}catch{}}function wx(e){this.l=e.ec||null,this.j=e.ob||!1}gi(wx,p6);wx.prototype.g=function(){return new Tx(this.l,this.j)};wx.prototype.i=function(e){return function(){return e}}({});function Tx(e,t){hi.call(this),this.F=e,this.u=t,this.m=void 0,this.readyState=_6,this.status=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.v=new Headers,this.h=null,this.C="GET",this.B="",this.g=!1,this.A=this.j=this.l=null}gi(Tx,hi);var _6=0;Fe=Tx.prototype;Fe.open=function(e,t){if(this.readyState!=_6)throw this.abort(),Error("Error reopening a connection");this.C=e,this.B=t,this.readyState=1,r_(this)};Fe.send=function(e){if(this.readyState!=1)throw this.abort(),Error("need to call open() first. ");this.g=!0;const t={headers:this.v,method:this.C,credentials:this.m,cache:void 0};e&&(t.body=e),(this.F||St).fetch(new Request(this.B,t)).then(this.$a.bind(this),this.ka.bind(this))};Fe.abort=function(){this.response=this.responseText="",this.v=new Headers,this.status=0,this.j&&this.j.cancel("Request was aborted.").catch(()=>{}),1<=this.readyState&&this.g&&this.readyState!=4&&(this.g=!1,uv(this)),this.readyState=_6};Fe.$a=function(e){if(this.g&&(this.l=e,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=e.headers,this.readyState=2,r_(this)),this.g&&(this.readyState=3,r_(this),this.g)))if(this.responseType==="arraybuffer")e.arrayBuffer().then(this.Ya.bind(this),this.ka.bind(this));else if(typeof St.ReadableStream<"u"&&"body"in e){if(this.j=e.body.getReader(),this.u){if(this.responseType)throw Error('responseType must be empty for "streamBinaryChunks" mode responses.');this.response=[]}else this.response=this.responseText="",this.A=new TextDecoder;eoe(this)}else e.text().then(this.Za.bind(this),this.ka.bind(this))};function eoe(e){e.j.read().then(e.Xa.bind(e)).catch(e.ka.bind(e))}Fe.Xa=function(e){if(this.g){if(this.u&&e.value)this.response.push(e.value);else if(!this.u){var t=e.value?e.value:new Uint8Array(0);(t=this.A.decode(t,{stream:!e.done}))&&(this.response=this.responseText+=t)}e.done?uv(this):r_(this),this.readyState==3&&eoe(this)}};Fe.Za=function(e){this.g&&(this.response=this.responseText=e,uv(this))};Fe.Ya=function(e){this.g&&(this.response=e,uv(this))};Fe.ka=function(){this.g&&uv(this)};function uv(e){e.readyState=4,e.l=null,e.j=null,e.A=null,r_(e)}Fe.setRequestHeader=function(e,t){this.v.append(e,t)};Fe.getResponseHeader=function(e){return this.h&&this.h.get(e.toLowerCase())||""};Fe.getAllResponseHeaders=function(){if(!this.h)return"";const e=[],t=this.h.entries();for(var n=t.next();!n.done;)n=n.value,e.push(n[0]+": "+n[1]),n=t.next();return e.join(`\r +`)};function r_(e){e.onreadystatechange&&e.onreadystatechange.call(e)}Object.defineProperty(Tx.prototype,"withCredentials",{get:function(){return this.m==="include"},set:function(e){this.m=e?"include":"same-origin"}});var rXe=St.JSON.parse;function Ar(e){hi.call(this),this.headers=new Map,this.u=e||null,this.h=!1,this.C=this.g=null,this.I="",this.m=0,this.j="",this.l=this.G=this.v=this.F=!1,this.B=0,this.A=null,this.K=toe,this.L=this.M=!1}gi(Ar,hi);var toe="",iXe=/^https?$/i,sXe=["POST","PUT"];Fe=Ar.prototype;Fe.Oa=function(e){this.M=e};Fe.ha=function(e,t,n,r){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.I+"; newUri="+e);t=t?t.toUpperCase():"GET",this.I=e,this.j="",this.m=0,this.F=!1,this.h=!0,this.g=this.u?this.u.g():RR.g(),this.C=this.u?NV(this.u):NV(RR),this.g.onreadystatechange=Gi(this.La,this);try{this.G=!0,this.g.open(t,String(e),!0),this.G=!1}catch(s){$V(this,s);return}if(e=n||"",n=new Map(this.headers),r)if(Object.getPrototypeOf(r)===Object.prototype)for(var i in r)n.set(i,r[i]);else if(typeof r.keys=="function"&&typeof r.get=="function")for(const s of r.keys())n.set(s,r.get(s));else throw Error("Unknown input type for opt_headers: "+String(r));r=Array.from(n.keys()).find(s=>s.toLowerCase()=="content-type"),i=St.FormData&&e instanceof St.FormData,!(0<=yse(sXe,t))||r||i||n.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");for(const[s,o]of n)this.g.setRequestHeader(s,o);this.K&&(this.g.responseType=this.K),"withCredentials"in this.g&&this.g.withCredentials!==this.M&&(this.g.withCredentials=this.M);try{ioe(this),0{}:null;e.g=null,e.C=null,t||ki(e,"ready");try{n.onreadystatechange=r}catch{}}}function ioe(e){e.g&&e.L&&(e.g.ontimeout=null),e.A&&(St.clearTimeout(e.A),e.A=null)}Fe.isActive=function(){return!!this.g};function du(e){return e.g?e.g.readyState:0}Fe.da=function(){try{return 2=e.i.j-(e.m?1:0)?!1:e.m?(e.j=t.F.concat(e.j),!0):e.H==1||e.H==2||e.C>=(e.cb?0:e.eb)?!1:(e.m=iv(Gi(e.Na,e,t),doe(e,e.C)),e.C++,!0)}Fe.Na=function(e){if(this.m)if(this.m=null,this.H==1){if(!e){this.W=Math.floor(1e5*Math.random()),e=this.W++;const i=new ov(this,this.l,e);let s=this.s;if(this.U&&(s?(s=Ese(s),wse(s,this.U)):s=this.U),this.o!==null||this.O||(i.I=s,s=null),this.P)e:{for(var t=0,n=0;nl)s=Math.max(0,i[u].g-100),a=!1;else try{tXe(c,o,"req"+l+"_")}catch{r&&r(c)}}if(a){r=o.join("&");break e}}}return e=e.j.splice(0,n),t.F=e,r}function loe(e){if(!e.g&&!e.u){e.ba=1;var t=e.Ma;Jy||Ose(),Zy||(Jy(),Zy=!0),f6.add(t,e),e.A=0}}function E6(e){return e.g||e.u||3<=e.A?!1:(e.ba++,e.u=iv(Gi(e.Ma,e),doe(e,e.A)),e.A++,!0)}Fe.Ma=function(){if(this.u=null,coe(this),this.ca&&!(this.M||this.g==null||0>=this.S)){var e=2*this.S;this.l.info("BP detection timer enabled: "+e),this.B=iv(Gi(this.jb,this),e)}};Fe.jb=function(){this.B&&(this.B=null,this.l.info("BP detection timeout reached."),this.l.info("Buffering proxy detected and switch to long-polling!"),this.G=!1,this.M=!0,us(10),Ix(this),coe(this))};function w6(e){e.B!=null&&(St.clearTimeout(e.B),e.B=null)}function coe(e){e.g=new ov(e,e.l,"rpc",e.ba),e.o===null&&(e.g.I=e.s),e.g.O=0;var t=Ll(e.wa);Jn(t,"RID","rpc"),Jn(t,"SID",e.K),Jn(t,"AID",e.V),Jn(t,"CI",e.G?"0":"1"),!e.G&&e.qa&&Jn(t,"TO",e.qa),Jn(t,"TYPE","xmlhttp"),lv(e,t),e.o&&e.s&&v6(t,e.o,e.s),e.L&&e.g.setTimeout(e.L);var n=e.g;e=e.pa,n.L=1,n.A=Ex(Ll(t)),n.u=null,n.S=!0,jse(n,e)}Fe.ib=function(){this.v!=null&&(this.v=null,Ix(this),E6(this),us(19))};function KT(e){e.v!=null&&(St.clearTimeout(e.v),e.v=null)}function foe(e,t){var n=null;if(e.g==t){KT(e),w6(e),e.g=null;var r=2}else if($R(e.i,t))n=t.F,Jse(e.i,t),r=1;else return;if(e.H!=0){if(t.i)if(r==1){n=t.u?t.u.length:0,t=Date.now()-t.G;var i=e.C;r=yx(),ki(r,new $se(r,n)),xx(e)}else loe(e);else if(i=t.s,i==3||i==0&&0i;++i)r[i]=t.charCodeAt(n++)|t.charCodeAt(n++)<<8|t.charCodeAt(n++)<<16|t.charCodeAt(n++)<<24;else for(i=0;16>i;++i)r[i]=t[n++]|t[n++]<<8|t[n++]<<16|t[n++]<<24;t=e.g[0],n=e.g[1],i=e.g[2];var s=e.g[3],o=t+(s^n&(i^s))+r[0]+3614090360&4294967295;t=n+(o<<7&4294967295|o>>>25),o=s+(i^t&(n^i))+r[1]+3905402710&4294967295,s=t+(o<<12&4294967295|o>>>20),o=i+(n^s&(t^n))+r[2]+606105819&4294967295,i=s+(o<<17&4294967295|o>>>15),o=n+(t^i&(s^t))+r[3]+3250441966&4294967295,n=i+(o<<22&4294967295|o>>>10),o=t+(s^n&(i^s))+r[4]+4118548399&4294967295,t=n+(o<<7&4294967295|o>>>25),o=s+(i^t&(n^i))+r[5]+1200080426&4294967295,s=t+(o<<12&4294967295|o>>>20),o=i+(n^s&(t^n))+r[6]+2821735955&4294967295,i=s+(o<<17&4294967295|o>>>15),o=n+(t^i&(s^t))+r[7]+4249261313&4294967295,n=i+(o<<22&4294967295|o>>>10),o=t+(s^n&(i^s))+r[8]+1770035416&4294967295,t=n+(o<<7&4294967295|o>>>25),o=s+(i^t&(n^i))+r[9]+2336552879&4294967295,s=t+(o<<12&4294967295|o>>>20),o=i+(n^s&(t^n))+r[10]+4294925233&4294967295,i=s+(o<<17&4294967295|o>>>15),o=n+(t^i&(s^t))+r[11]+2304563134&4294967295,n=i+(o<<22&4294967295|o>>>10),o=t+(s^n&(i^s))+r[12]+1804603682&4294967295,t=n+(o<<7&4294967295|o>>>25),o=s+(i^t&(n^i))+r[13]+4254626195&4294967295,s=t+(o<<12&4294967295|o>>>20),o=i+(n^s&(t^n))+r[14]+2792965006&4294967295,i=s+(o<<17&4294967295|o>>>15),o=n+(t^i&(s^t))+r[15]+1236535329&4294967295,n=i+(o<<22&4294967295|o>>>10),o=t+(i^s&(n^i))+r[1]+4129170786&4294967295,t=n+(o<<5&4294967295|o>>>27),o=s+(n^i&(t^n))+r[6]+3225465664&4294967295,s=t+(o<<9&4294967295|o>>>23),o=i+(t^n&(s^t))+r[11]+643717713&4294967295,i=s+(o<<14&4294967295|o>>>18),o=n+(s^t&(i^s))+r[0]+3921069994&4294967295,n=i+(o<<20&4294967295|o>>>12),o=t+(i^s&(n^i))+r[5]+3593408605&4294967295,t=n+(o<<5&4294967295|o>>>27),o=s+(n^i&(t^n))+r[10]+38016083&4294967295,s=t+(o<<9&4294967295|o>>>23),o=i+(t^n&(s^t))+r[15]+3634488961&4294967295,i=s+(o<<14&4294967295|o>>>18),o=n+(s^t&(i^s))+r[4]+3889429448&4294967295,n=i+(o<<20&4294967295|o>>>12),o=t+(i^s&(n^i))+r[9]+568446438&4294967295,t=n+(o<<5&4294967295|o>>>27),o=s+(n^i&(t^n))+r[14]+3275163606&4294967295,s=t+(o<<9&4294967295|o>>>23),o=i+(t^n&(s^t))+r[3]+4107603335&4294967295,i=s+(o<<14&4294967295|o>>>18),o=n+(s^t&(i^s))+r[8]+1163531501&4294967295,n=i+(o<<20&4294967295|o>>>12),o=t+(i^s&(n^i))+r[13]+2850285829&4294967295,t=n+(o<<5&4294967295|o>>>27),o=s+(n^i&(t^n))+r[2]+4243563512&4294967295,s=t+(o<<9&4294967295|o>>>23),o=i+(t^n&(s^t))+r[7]+1735328473&4294967295,i=s+(o<<14&4294967295|o>>>18),o=n+(s^t&(i^s))+r[12]+2368359562&4294967295,n=i+(o<<20&4294967295|o>>>12),o=t+(n^i^s)+r[5]+4294588738&4294967295,t=n+(o<<4&4294967295|o>>>28),o=s+(t^n^i)+r[8]+2272392833&4294967295,s=t+(o<<11&4294967295|o>>>21),o=i+(s^t^n)+r[11]+1839030562&4294967295,i=s+(o<<16&4294967295|o>>>16),o=n+(i^s^t)+r[14]+4259657740&4294967295,n=i+(o<<23&4294967295|o>>>9),o=t+(n^i^s)+r[1]+2763975236&4294967295,t=n+(o<<4&4294967295|o>>>28),o=s+(t^n^i)+r[4]+1272893353&4294967295,s=t+(o<<11&4294967295|o>>>21),o=i+(s^t^n)+r[7]+4139469664&4294967295,i=s+(o<<16&4294967295|o>>>16),o=n+(i^s^t)+r[10]+3200236656&4294967295,n=i+(o<<23&4294967295|o>>>9),o=t+(n^i^s)+r[13]+681279174&4294967295,t=n+(o<<4&4294967295|o>>>28),o=s+(t^n^i)+r[0]+3936430074&4294967295,s=t+(o<<11&4294967295|o>>>21),o=i+(s^t^n)+r[3]+3572445317&4294967295,i=s+(o<<16&4294967295|o>>>16),o=n+(i^s^t)+r[6]+76029189&4294967295,n=i+(o<<23&4294967295|o>>>9),o=t+(n^i^s)+r[9]+3654602809&4294967295,t=n+(o<<4&4294967295|o>>>28),o=s+(t^n^i)+r[12]+3873151461&4294967295,s=t+(o<<11&4294967295|o>>>21),o=i+(s^t^n)+r[15]+530742520&4294967295,i=s+(o<<16&4294967295|o>>>16),o=n+(i^s^t)+r[2]+3299628645&4294967295,n=i+(o<<23&4294967295|o>>>9),o=t+(i^(n|~s))+r[0]+4096336452&4294967295,t=n+(o<<6&4294967295|o>>>26),o=s+(n^(t|~i))+r[7]+1126891415&4294967295,s=t+(o<<10&4294967295|o>>>22),o=i+(t^(s|~n))+r[14]+2878612391&4294967295,i=s+(o<<15&4294967295|o>>>17),o=n+(s^(i|~t))+r[5]+4237533241&4294967295,n=i+(o<<21&4294967295|o>>>11),o=t+(i^(n|~s))+r[12]+1700485571&4294967295,t=n+(o<<6&4294967295|o>>>26),o=s+(n^(t|~i))+r[3]+2399980690&4294967295,s=t+(o<<10&4294967295|o>>>22),o=i+(t^(s|~n))+r[10]+4293915773&4294967295,i=s+(o<<15&4294967295|o>>>17),o=n+(s^(i|~t))+r[1]+2240044497&4294967295,n=i+(o<<21&4294967295|o>>>11),o=t+(i^(n|~s))+r[8]+1873313359&4294967295,t=n+(o<<6&4294967295|o>>>26),o=s+(n^(t|~i))+r[15]+4264355552&4294967295,s=t+(o<<10&4294967295|o>>>22),o=i+(t^(s|~n))+r[6]+2734768916&4294967295,i=s+(o<<15&4294967295|o>>>17),o=n+(s^(i|~t))+r[13]+1309151649&4294967295,n=i+(o<<21&4294967295|o>>>11),o=t+(i^(n|~s))+r[4]+4149444226&4294967295,t=n+(o<<6&4294967295|o>>>26),o=s+(n^(t|~i))+r[11]+3174756917&4294967295,s=t+(o<<10&4294967295|o>>>22),o=i+(t^(s|~n))+r[2]+718787259&4294967295,i=s+(o<<15&4294967295|o>>>17),o=n+(s^(i|~t))+r[9]+3951481745&4294967295,e.g[0]=e.g[0]+t&4294967295,e.g[1]=e.g[1]+(i+(o<<21&4294967295|o>>>11))&4294967295,e.g[2]=e.g[2]+i&4294967295,e.g[3]=e.g[3]+s&4294967295}Na.prototype.j=function(e,t){t===void 0&&(t=e.length);for(var n=t-this.blockSize,r=this.m,i=this.h,s=0;sthis.h?this.blockSize:2*this.blockSize)-this.h);e[0]=128;for(var t=1;tt;++t)for(var r=0;32>r;r+=8)e[n++]=this.g[t]>>>r&255;return e};function Nn(e,t){this.h=t;for(var n=[],r=!0,i=e.length-1;0<=i;i--){var s=e[i]|0;r&&s==t||(n[i]=s,r=!1)}this.g=n}var cXe={};function T6(e){return-128<=e&&128>e?_Qe(e,function(t){return new Nn([t|0],0>t?-1:0)}):new Nn([e|0],0>e?-1:0)}function hu(e){if(isNaN(e)||!isFinite(e))return $p;if(0>e)return Oi(hu(-e));for(var t=[],n=1,r=0;e>=n;r++)t[r]=e/n|0,n*=LR;return new Nn(t,0)}function voe(e,t){if(e.length==0)throw Error("number format error: empty string");if(t=t||10,2>t||36s?(s=hu(Math.pow(t,s)),r=r.R(s).add(hu(o))):(r=r.R(n),r=r.add(hu(o)))}return r}var LR=4294967296,$p=T6(0),MR=T6(1),FV=T6(16777216);Fe=Nn.prototype;Fe.ea=function(){if(Fo(this))return-Oi(this).ea();for(var e=0,t=1,n=0;ne||36>>0).toString(e);if(n=i,ul(n))return s+r;for(;6>s.length;)s="0"+s;r=s+r}};Fe.D=function(e){return 0>e?0:e>>16)+(this.D(i)>>>16)+(e.D(i)>>>16);r=o>>>16,s&=65535,o&=65535,n[i]=o<<16|s}return new Nn(n,n[n.length-1]&-2147483648?-1:0)};function XT(e,t){return e.add(Oi(t))}Fe.R=function(e){if(ul(this)||ul(e))return $p;if(Fo(this))return Fo(e)?Oi(this).R(Oi(e)):Oi(Oi(this).R(e));if(Fo(e))return Oi(this.R(Oi(e)));if(0>this.X(FV)&&0>e.X(FV))return hu(this.ea()*e.ea());for(var t=this.g.length+e.g.length,n=[],r=0;r<2*t;r++)n[r]=0;for(r=0;r>>16,o=this.D(r)&65535,a=e.D(i)>>>16,u=e.D(i)&65535;n[2*r+2*i]+=o*u,R1(n,2*r+2*i),n[2*r+2*i+1]+=s*u,R1(n,2*r+2*i+1),n[2*r+2*i+1]+=o*a,R1(n,2*r+2*i+1),n[2*r+2*i+2]+=s*a,R1(n,2*r+2*i+2)}for(r=0;r>>16,e[t]&=65535,t++}function Gg(e,t){this.g=e,this.h=t}function JT(e,t){if(ul(t))throw Error("division by zero");if(ul(e))return new Gg($p,$p);if(Fo(e))return t=JT(Oi(e),t),new Gg(Oi(t.g),Oi(t.h));if(Fo(t))return t=JT(e,Oi(t)),new Gg(Oi(t.g),t.h);if(30=r.X(e);)n=BV(n),r=BV(r);var i=Ch(n,1),s=Ch(r,1);for(r=Ch(r,2),n=Ch(n,2);!ul(r);){var o=s.add(r);0>=o.X(e)&&(i=i.add(n),s=o),r=Ch(r,1),n=Ch(n,1)}return t=XT(e,i.R(t)),new Gg(i,t)}for(i=$p;0<=e.X(t);){for(n=Math.max(1,Math.floor(e.ea()/t.ea())),r=Math.ceil(Math.log(n)/Math.LN2),r=48>=r?1:Math.pow(2,r-48),s=hu(n),o=s.R(t);Fo(o)||0>>31;return new Nn(n,e.h)}function Ch(e,t){var n=t>>5;t%=32;for(var r=e.g.length-n,i=[],s=0;s>>t|e.D(s+n+1)<<32-t:e.D(s+n);return new Nn(i,e.h)}QT.prototype.createWebChannel=QT.prototype.g;vo.prototype.send=vo.prototype.u;vo.prototype.open=vo.prototype.m;vo.prototype.close=vo.prototype.close;_x.NO_ERROR=0;_x.TIMEOUT=8;_x.HTTP_ERROR=6;Lse.COMPLETE="complete";Mse.EventType=sv;sv.OPEN="a";sv.CLOSE="b";sv.ERROR="c";sv.MESSAGE="d";hi.prototype.listen=hi.prototype.O;Ar.prototype.listenOnce=Ar.prototype.P;Ar.prototype.getLastError=Ar.prototype.Sa;Ar.prototype.getLastErrorCode=Ar.prototype.Ia;Ar.prototype.getStatus=Ar.prototype.da;Ar.prototype.getResponseJson=Ar.prototype.Wa;Ar.prototype.getResponseText=Ar.prototype.ja;Ar.prototype.send=Ar.prototype.ha;Ar.prototype.setWithCredentials=Ar.prototype.Oa;Na.prototype.digest=Na.prototype.l;Na.prototype.reset=Na.prototype.reset;Na.prototype.update=Na.prototype.j;Nn.prototype.add=Nn.prototype.add;Nn.prototype.multiply=Nn.prototype.R;Nn.prototype.modulo=Nn.prototype.gb;Nn.prototype.compare=Nn.prototype.X;Nn.prototype.toNumber=Nn.prototype.ea;Nn.prototype.toString=Nn.prototype.toString;Nn.prototype.getBits=Nn.prototype.D;Nn.fromNumber=hu;Nn.fromString=voe;var fXe=function(){return new QT},dXe=function(){return yx()},wO=_x,hXe=Lse,pXe=fh,jV={xb:0,Ab:1,Bb:2,Ub:3,Zb:4,Wb:5,Xb:6,Vb:7,Tb:8,Yb:9,PROXY:10,NOPROXY:11,Rb:12,Nb:13,Ob:14,Mb:15,Pb:16,Qb:17,tb:18,sb:19,ub:20},N1=Mse,mXe=Ar,gXe=Na,Lp=Nn;const UV="@firebase/firestore";/** * @license * Copyright 2017 Google LLC * @@ -1086,7 +1086,7 @@ Content-Type: `+l.contentType+`\r * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class Eoe{static newId(){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=Math.floor(256/t.length)*t.length;let r="";for(;r.length<20;){const i=SXe(40);for(let s=0;st?1:0}function wm(e,t,n){return e.length===t.length&&e.every((r,i)=>n(r,t[i]))}/** + */class boe{static newId(){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=Math.floor(256/t.length)*t.length;let r="";for(;r.length<20;){const i=SXe(40);for(let s=0;st?1:0}function wm(e,t,n){return e.length===t.length&&e.every((r,i)=>n(r,t[i]))}/** * @license * Copyright 2017 Google LLC * @@ -1221,7 +1221,7 @@ Content-Type: `+l.contentType+`\r * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function VV(e){let t=0;for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}function ug(e,t){for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t(n,e[n])}function woe(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}/** + */function VV(e){let t=0;for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}function ug(e,t){for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t(n,e[n])}function Eoe(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}/** * @license * Copyright 2017 Google LLC * @@ -1281,7 +1281,7 @@ Content-Type: `+l.contentType+`\r * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class Toe extends Error{constructor(){super(...arguments),this.name="Base64DecodeError"}}/** + */class woe extends Error{constructor(){super(...arguments),this.name="Base64DecodeError"}}/** * @license * Copyright 2020 Google LLC * @@ -1296,7 +1296,7 @@ Content-Type: `+l.contentType+`\r * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class es{constructor(t){this.binaryString=t}static fromBase64String(t){const n=function(i){try{return atob(i)}catch(s){throw typeof DOMException<"u"&&s instanceof DOMException?new Toe("Invalid base64 string: "+s):s}}(t);return new es(n)}static fromUint8Array(t){const n=function(i){let s="";for(let o=0;ott{if(!n.isImmediateParentOf(a)){const u=this.getFieldsMap(n);this.applyChanges(u,r,i),r={},i=[],n=a.popLast()}o?r[a.lastSegment()]=X0(o):i.push(a.lastSegment())});const s=this.getFieldsMap(n);this.applyChanges(s,r,i)}delete(t){const n=this.field(t.popLast());wb(n)&&n.mapValue.fields&&delete n.mapValue.fields[t.lastSegment()]}isEqual(t){return Lu(this.value,t.value)}getFieldsMap(t){let n=this.value;n.mapValue.fields||(n.mapValue={fields:{}});for(let r=0;rt[i]=s);for(const i of r)delete t[i]}clone(){return new Bo(X0(this.value))}}function Soe(e){const t=[];return ug(e.fields,(n,r)=>{const i=new Pi([n]);if(wb(r)){const s=Soe(r.mapValue).fields;if(s.length===0)t.push(i);else for(const o of s)t.push(i.child(o))}else t.push(i)}),new wa(t)}/** + */class Bo{constructor(t){this.value=t}static empty(){return new Bo({mapValue:{}})}field(t){if(t.isEmpty())return this.value;{let n=this.value;for(let r=0;r{if(!n.isImmediateParentOf(a)){const u=this.getFieldsMap(n);this.applyChanges(u,r,i),r={},i=[],n=a.popLast()}o?r[a.lastSegment()]=X0(o):i.push(a.lastSegment())});const s=this.getFieldsMap(n);this.applyChanges(s,r,i)}delete(t){const n=this.field(t.popLast());wb(n)&&n.mapValue.fields&&delete n.mapValue.fields[t.lastSegment()]}isEqual(t){return Lu(this.value,t.value)}getFieldsMap(t){let n=this.value;n.mapValue.fields||(n.mapValue={fields:{}});for(let r=0;rt[i]=s);for(const i of r)delete t[i]}clone(){return new Bo(X0(this.value))}}function Toe(e){const t=[];return ug(e.fields,(n,r)=>{const i=new Pi([n]);if(wb(r)){const s=Toe(r.mapValue).fields;if(s.length===0)t.push(i);else for(const o of s)t.push(i.child(o))}else t.push(i)}),new wa(t)}/** * @license * Copyright 2017 Google LLC * @@ -1416,7 +1416,7 @@ Content-Type: `+l.contentType+`\r * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class Ioe{}class Qr extends Ioe{constructor(t,n,r){super(),this.field=t,this.op=n,this.value=r}static create(t,n,r){return t.isKeyField()?n==="in"||n==="not-in"?this.createKeyFieldInFilter(t,n,r):new MXe(t,n,r):n==="array-contains"?new jXe(t,r):n==="in"?new UXe(t,r):n==="not-in"?new VXe(t,r):n==="array-contains-any"?new zXe(t,r):new Qr(t,n,r)}static createKeyFieldInFilter(t,n,r){return n==="in"?new FXe(t,r):new BXe(t,r)}matches(t){const n=t.data.field(this.field);return this.op==="!="?n!==null&&this.matchesComparison(Tm(n,this.value)):n!==null&&Wd(this.value)===Wd(n)&&this.matchesComparison(Tm(n,this.value))}matchesComparison(t){switch(this.op){case"<":return t<0;case"<=":return t<=0;case"==":return t===0;case"!=":return t!==0;case">":return t>0;case">=":return t>=0;default:return _t()}}isInequality(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}getFlattenedFilters(){return[this]}getFilters(){return[this]}}class Mu extends Ioe{constructor(t,n){super(),this.filters=t,this.op=n,this.ue=null}static create(t,n){return new Mu(t,n)}matches(t){return xoe(this)?this.filters.find(n=>!n.matches(t))===void 0:this.filters.find(n=>n.matches(t))!==void 0}getFlattenedFilters(){return this.ue!==null||(this.ue=this.filters.reduce((t,n)=>t.concat(n.getFlattenedFilters()),[])),this.ue}getFilters(){return Object.assign([],this.filters)}}function xoe(e){return e.op==="and"}function Coe(e){return LXe(e)&&xoe(e)}function LXe(e){for(const t of e.filters)if(t instanceof Mu)return!1;return!0}function jR(e){if(e instanceof Qr)return e.field.canonicalString()+e.op.toString()+Sm(e.value);if(Coe(e))return e.filters.map(t=>jR(t)).join(",");{const t=e.filters.map(n=>jR(n)).join(",");return`${e.op}(${t})`}}function Aoe(e,t){return e instanceof Qr?function(r,i){return i instanceof Qr&&r.op===i.op&&r.field.isEqual(i.field)&&Lu(r.value,i.value)}(e,t):e instanceof Mu?function(r,i){return i instanceof Mu&&r.op===i.op&&r.filters.length===i.filters.length?r.filters.reduce((s,o,a)=>s&&Aoe(o,i.filters[a]),!0):!1}(e,t):void _t()}function Ooe(e){return e instanceof Qr?function(n){return`${n.field.canonicalString()} ${n.op} ${Sm(n.value)}`}(e):e instanceof Mu?function(n){return n.op.toString()+" {"+n.getFilters().map(Ooe).join(" ,")+"}"}(e):"Filter"}class MXe extends Qr{constructor(t,n,r){super(t,n,r),this.key=dt.fromName(r.referenceValue)}matches(t){const n=dt.comparator(t.key,this.key);return this.matchesComparison(n)}}class FXe extends Qr{constructor(t,n){super(t,"in",n),this.keys=Poe("in",n)}matches(t){return this.keys.some(n=>n.isEqual(t.key))}}class BXe extends Qr{constructor(t,n){super(t,"not-in",n),this.keys=Poe("not-in",n)}matches(t){return!this.keys.some(n=>n.isEqual(t.key))}}function Poe(e,t){var n;return(((n=t.arrayValue)===null||n===void 0?void 0:n.values)||[]).map(r=>dt.fromName(r.referenceValue))}class jXe extends Qr{constructor(t,n){super(t,"array-contains",n)}matches(t){const n=t.data.field(this.field);return A6(n)&&u_(n.arrayValue,this.value)}}class UXe extends Qr{constructor(t,n){super(t,"in",n)}matches(t){const n=t.data.field(this.field);return n!==null&&u_(this.value.arrayValue,n)}}class VXe extends Qr{constructor(t,n){super(t,"not-in",n)}matches(t){if(u_(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;const n=t.data.field(this.field);return n!==null&&!u_(this.value.arrayValue,n)}}class zXe extends Qr{constructor(t,n){super(t,"array-contains-any",n)}matches(t){const n=t.data.field(this.field);return!(!A6(n)||!n.arrayValue.values)&&n.arrayValue.values.some(r=>u_(this.value.arrayValue,r))}}/** + */class Soe{}class Qr extends Soe{constructor(t,n,r){super(),this.field=t,this.op=n,this.value=r}static create(t,n,r){return t.isKeyField()?n==="in"||n==="not-in"?this.createKeyFieldInFilter(t,n,r):new MXe(t,n,r):n==="array-contains"?new jXe(t,r):n==="in"?new UXe(t,r):n==="not-in"?new VXe(t,r):n==="array-contains-any"?new zXe(t,r):new Qr(t,n,r)}static createKeyFieldInFilter(t,n,r){return n==="in"?new FXe(t,r):new BXe(t,r)}matches(t){const n=t.data.field(this.field);return this.op==="!="?n!==null&&this.matchesComparison(Tm(n,this.value)):n!==null&&Wd(this.value)===Wd(n)&&this.matchesComparison(Tm(n,this.value))}matchesComparison(t){switch(this.op){case"<":return t<0;case"<=":return t<=0;case"==":return t===0;case"!=":return t!==0;case">":return t>0;case">=":return t>=0;default:return _t()}}isInequality(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}getFlattenedFilters(){return[this]}getFilters(){return[this]}}class Mu extends Soe{constructor(t,n){super(),this.filters=t,this.op=n,this.ue=null}static create(t,n){return new Mu(t,n)}matches(t){return Ioe(this)?this.filters.find(n=>!n.matches(t))===void 0:this.filters.find(n=>n.matches(t))!==void 0}getFlattenedFilters(){return this.ue!==null||(this.ue=this.filters.reduce((t,n)=>t.concat(n.getFlattenedFilters()),[])),this.ue}getFilters(){return Object.assign([],this.filters)}}function Ioe(e){return e.op==="and"}function xoe(e){return LXe(e)&&Ioe(e)}function LXe(e){for(const t of e.filters)if(t instanceof Mu)return!1;return!0}function jR(e){if(e instanceof Qr)return e.field.canonicalString()+e.op.toString()+Sm(e.value);if(xoe(e))return e.filters.map(t=>jR(t)).join(",");{const t=e.filters.map(n=>jR(n)).join(",");return`${e.op}(${t})`}}function Coe(e,t){return e instanceof Qr?function(r,i){return i instanceof Qr&&r.op===i.op&&r.field.isEqual(i.field)&&Lu(r.value,i.value)}(e,t):e instanceof Mu?function(r,i){return i instanceof Mu&&r.op===i.op&&r.filters.length===i.filters.length?r.filters.reduce((s,o,a)=>s&&Coe(o,i.filters[a]),!0):!1}(e,t):void _t()}function Aoe(e){return e instanceof Qr?function(n){return`${n.field.canonicalString()} ${n.op} ${Sm(n.value)}`}(e):e instanceof Mu?function(n){return n.op.toString()+" {"+n.getFilters().map(Aoe).join(" ,")+"}"}(e):"Filter"}class MXe extends Qr{constructor(t,n,r){super(t,n,r),this.key=dt.fromName(r.referenceValue)}matches(t){const n=dt.comparator(t.key,this.key);return this.matchesComparison(n)}}class FXe extends Qr{constructor(t,n){super(t,"in",n),this.keys=Ooe("in",n)}matches(t){return this.keys.some(n=>n.isEqual(t.key))}}class BXe extends Qr{constructor(t,n){super(t,"not-in",n),this.keys=Ooe("not-in",n)}matches(t){return!this.keys.some(n=>n.isEqual(t.key))}}function Ooe(e,t){var n;return(((n=t.arrayValue)===null||n===void 0?void 0:n.values)||[]).map(r=>dt.fromName(r.referenceValue))}class jXe extends Qr{constructor(t,n){super(t,"array-contains",n)}matches(t){const n=t.data.field(this.field);return A6(n)&&u_(n.arrayValue,this.value)}}class UXe extends Qr{constructor(t,n){super(t,"in",n)}matches(t){const n=t.data.field(this.field);return n!==null&&u_(this.value.arrayValue,n)}}class VXe extends Qr{constructor(t,n){super(t,"not-in",n)}matches(t){if(u_(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;const n=t.data.field(this.field);return n!==null&&!u_(this.value.arrayValue,n)}}class zXe extends Qr{constructor(t,n){super(t,"array-contains-any",n)}matches(t){const n=t.data.field(this.field);return!(!A6(n)||!n.arrayValue.values)&&n.arrayValue.values.some(r=>u_(this.value.arrayValue,r))}}/** * @license * Copyright 2019 Google LLC * @@ -1431,7 +1431,7 @@ Content-Type: `+l.contentType+`\r * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class HXe{constructor(t,n=null,r=[],i=[],s=null,o=null,a=null){this.path=t,this.collectionGroup=n,this.orderBy=r,this.filters=i,this.limit=s,this.startAt=o,this.endAt=a,this.ce=null}}function KV(e,t=null,n=[],r=[],i=null,s=null,o=null){return new HXe(e,t,n,r,i,s,o)}function O6(e){const t=Nt(e);if(t.ce===null){let n=t.path.canonicalString();t.collectionGroup!==null&&(n+="|cg:"+t.collectionGroup),n+="|f:",n+=t.filters.map(r=>jR(r)).join(","),n+="|ob:",n+=t.orderBy.map(r=>function(s){return s.field.canonicalString()+s.dir}(r)).join(","),Cx(t.limit)||(n+="|l:",n+=t.limit),t.startAt&&(n+="|lb:",n+=t.startAt.inclusive?"b:":"a:",n+=t.startAt.position.map(r=>Sm(r)).join(",")),t.endAt&&(n+="|ub:",n+=t.endAt.inclusive?"a:":"b:",n+=t.endAt.position.map(r=>Sm(r)).join(",")),t.ce=n}return t.ce}function P6(e,t){if(e.limit!==t.limit||e.orderBy.length!==t.orderBy.length)return!1;for(let n=0;njR(r)).join(","),n+="|ob:",n+=t.orderBy.map(r=>function(s){return s.field.canonicalString()+s.dir}(r)).join(","),Cx(t.limit)||(n+="|l:",n+=t.limit),t.startAt&&(n+="|lb:",n+=t.startAt.inclusive?"b:":"a:",n+=t.startAt.position.map(r=>Sm(r)).join(",")),t.endAt&&(n+="|ub:",n+=t.endAt.inclusive?"a:":"b:",n+=t.endAt.position.map(r=>Sm(r)).join(",")),t.ce=n}return t.ce}function P6(e,t){if(e.limit!==t.limit||e.orderBy.length!==t.orderBy.length)return!1;for(let n=0;n0?t.explicitOrderBy[t.explicitOrderBy.length-1].dir:"asc";(function(o){let a=new Di(Pi.comparator);return o.filters.forEach(u=>{u.getFlattenedFilters().forEach(l=>{l.isInequality()&&(a=a.add(l.field))})}),a})(t).forEach(s=>{n.has(s.canonicalString())||s.isKeyField()||t.le.push(new tS(s,r))}),n.has(Pi.keyField().canonicalString())||t.le.push(new tS(Pi.keyField(),r))}return t.le}function Su(e){const t=Nt(e);return t.he||(t.he=YXe(t,J0(e))),t.he}function YXe(e,t){if(e.limitType==="F")return KV(e.path,e.collectionGroup,t,e.filters,e.limit,e.startAt,e.endAt);{t=t.map(i=>{const s=i.dir==="desc"?"asc":"desc";return new tS(i.field,s)});const n=e.endAt?new eS(e.endAt.position,e.endAt.inclusive):null,r=e.startAt?new eS(e.startAt.position,e.startAt.inclusive):null;return KV(e.path,e.collectionGroup,t,e.filters,e.limit,n,r)}}function VR(e,t,n){return new Ax(e.path,e.collectionGroup,e.explicitOrderBy.slice(),e.filters.slice(),t,n,e.startAt,e.endAt)}function Ox(e,t){return P6(Su(e),Su(t))&&e.limitType===t.limitType}function Roe(e){return`${O6(Su(e))}|lt:${e.limitType}`}function $h(e){return`Query(target=${function(n){let r=n.path.canonicalString();return n.collectionGroup!==null&&(r+=" collectionGroup="+n.collectionGroup),n.filters.length>0&&(r+=`, filters: [${n.filters.map(i=>Ooe(i)).join(", ")}]`),Cx(n.limit)||(r+=", limit: "+n.limit),n.orderBy.length>0&&(r+=`, orderBy: [${n.orderBy.map(i=>function(o){return`${o.field.canonicalString()} (${o.dir})`}(i)).join(", ")}]`),n.startAt&&(r+=", startAt: ",r+=n.startAt.inclusive?"b:":"a:",r+=n.startAt.position.map(i=>Sm(i)).join(",")),n.endAt&&(r+=", endAt: ",r+=n.endAt.inclusive?"a:":"b:",r+=n.endAt.position.map(i=>Sm(i)).join(",")),`Target(${r})`}(Su(e))}; limitType=${e.limitType})`}function Px(e,t){return t.isFoundDocument()&&function(r,i){const s=i.key.path;return r.collectionGroup!==null?i.key.hasCollectionId(r.collectionGroup)&&r.path.isPrefixOf(s):dt.isDocumentKey(r.path)?r.path.isEqual(s):r.path.isImmediateParentOf(s)}(e,t)&&function(r,i){for(const s of J0(r))if(!s.field.isKeyField()&&i.data.field(s.field)===null)return!1;return!0}(e,t)&&function(r,i){for(const s of r.filters)if(!s.matches(i))return!1;return!0}(e,t)&&function(r,i){return!(r.startAt&&!function(o,a,u){const l=YV(o,a,u);return o.inclusive?l<=0:l<0}(r.startAt,J0(r),i)||r.endAt&&!function(o,a,u){const l=YV(o,a,u);return o.inclusive?l>=0:l>0}(r.endAt,J0(r),i))}(e,t)}function GXe(e){return e.collectionGroup||(e.path.length%2==1?e.path.lastSegment():e.path.get(e.path.length-2))}function Noe(e){return(t,n)=>{let r=!1;for(const i of J0(e)){const s=KXe(i,t,n);if(s!==0)return s;r=r||i.field.isKeyField()}return 0}}function KXe(e,t,n){const r=e.field.isKeyField()?dt.comparator(t.key,n.key):function(s,o,a){const u=o.data.field(s),l=a.data.field(s);return u!==null&&l!==null?Tm(u,l):_t()}(e.field,t,n);switch(e.dir){case"asc":return r;case"desc":return-1*r;default:return _t()}}/** + */class Ax{constructor(t,n=null,r=[],i=[],s=null,o="F",a=null,u=null){this.path=t,this.collectionGroup=n,this.explicitOrderBy=r,this.filters=i,this.limit=s,this.limitType=o,this.startAt=a,this.endAt=u,this.le=null,this.he=null,this.Pe=null,this.startAt,this.endAt}}function WXe(e,t,n,r,i,s,o,a){return new Ax(e,t,n,r,i,s,o,a)}function R6(e){return new Ax(e)}function QV(e){return e.filters.length===0&&e.limit===null&&e.startAt==null&&e.endAt==null&&(e.explicitOrderBy.length===0||e.explicitOrderBy.length===1&&e.explicitOrderBy[0].field.isKeyField())}function qXe(e){return e.collectionGroup!==null}function J0(e){const t=Nt(e);if(t.le===null){t.le=[];const n=new Set;for(const s of t.explicitOrderBy)t.le.push(s),n.add(s.field.canonicalString());const r=t.explicitOrderBy.length>0?t.explicitOrderBy[t.explicitOrderBy.length-1].dir:"asc";(function(o){let a=new Di(Pi.comparator);return o.filters.forEach(u=>{u.getFlattenedFilters().forEach(l=>{l.isInequality()&&(a=a.add(l.field))})}),a})(t).forEach(s=>{n.has(s.canonicalString())||s.isKeyField()||t.le.push(new tS(s,r))}),n.has(Pi.keyField().canonicalString())||t.le.push(new tS(Pi.keyField(),r))}return t.le}function Su(e){const t=Nt(e);return t.he||(t.he=YXe(t,J0(e))),t.he}function YXe(e,t){if(e.limitType==="F")return KV(e.path,e.collectionGroup,t,e.filters,e.limit,e.startAt,e.endAt);{t=t.map(i=>{const s=i.dir==="desc"?"asc":"desc";return new tS(i.field,s)});const n=e.endAt?new eS(e.endAt.position,e.endAt.inclusive):null,r=e.startAt?new eS(e.startAt.position,e.startAt.inclusive):null;return KV(e.path,e.collectionGroup,t,e.filters,e.limit,n,r)}}function VR(e,t,n){return new Ax(e.path,e.collectionGroup,e.explicitOrderBy.slice(),e.filters.slice(),t,n,e.startAt,e.endAt)}function Ox(e,t){return P6(Su(e),Su(t))&&e.limitType===t.limitType}function Poe(e){return`${O6(Su(e))}|lt:${e.limitType}`}function $h(e){return`Query(target=${function(n){let r=n.path.canonicalString();return n.collectionGroup!==null&&(r+=" collectionGroup="+n.collectionGroup),n.filters.length>0&&(r+=`, filters: [${n.filters.map(i=>Aoe(i)).join(", ")}]`),Cx(n.limit)||(r+=", limit: "+n.limit),n.orderBy.length>0&&(r+=`, orderBy: [${n.orderBy.map(i=>function(o){return`${o.field.canonicalString()} (${o.dir})`}(i)).join(", ")}]`),n.startAt&&(r+=", startAt: ",r+=n.startAt.inclusive?"b:":"a:",r+=n.startAt.position.map(i=>Sm(i)).join(",")),n.endAt&&(r+=", endAt: ",r+=n.endAt.inclusive?"a:":"b:",r+=n.endAt.position.map(i=>Sm(i)).join(",")),`Target(${r})`}(Su(e))}; limitType=${e.limitType})`}function Px(e,t){return t.isFoundDocument()&&function(r,i){const s=i.key.path;return r.collectionGroup!==null?i.key.hasCollectionId(r.collectionGroup)&&r.path.isPrefixOf(s):dt.isDocumentKey(r.path)?r.path.isEqual(s):r.path.isImmediateParentOf(s)}(e,t)&&function(r,i){for(const s of J0(r))if(!s.field.isKeyField()&&i.data.field(s.field)===null)return!1;return!0}(e,t)&&function(r,i){for(const s of r.filters)if(!s.matches(i))return!1;return!0}(e,t)&&function(r,i){return!(r.startAt&&!function(o,a,u){const l=YV(o,a,u);return o.inclusive?l<=0:l<0}(r.startAt,J0(r),i)||r.endAt&&!function(o,a,u){const l=YV(o,a,u);return o.inclusive?l>=0:l>0}(r.endAt,J0(r),i))}(e,t)}function GXe(e){return e.collectionGroup||(e.path.length%2==1?e.path.lastSegment():e.path.get(e.path.length-2))}function Roe(e){return(t,n)=>{let r=!1;for(const i of J0(e)){const s=KXe(i,t,n);if(s!==0)return s;r=r||i.field.isKeyField()}return 0}}function KXe(e,t,n){const r=e.field.isKeyField()?dt.comparator(t.key,n.key):function(s,o,a){const u=o.data.field(s),l=a.data.field(s);return u!==null&&l!==null?Tm(u,l):_t()}(e.field,t,n);switch(e.dir){case"asc":return r;case"desc":return-1*r;default:return _t()}}/** * @license * Copyright 2017 Google LLC * @@ -1461,7 +1461,7 @@ Content-Type: `+l.contentType+`\r * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class lg{constructor(t,n){this.mapKeyFn=t,this.equalsFn=n,this.inner={},this.innerSize=0}get(t){const n=this.mapKeyFn(t),r=this.inner[n];if(r!==void 0){for(const[i,s]of r)if(this.equalsFn(i,t))return s}}has(t){return this.get(t)!==void 0}set(t,n){const r=this.mapKeyFn(t),i=this.inner[r];if(i===void 0)return this.inner[r]=[[t,n]],void this.innerSize++;for(let s=0;s{for(const[i,s]of r)t(i,s)})}isEmpty(){return woe(this.inner)}size(){return this.innerSize}}/** + */class lg{constructor(t,n){this.mapKeyFn=t,this.equalsFn=n,this.inner={},this.innerSize=0}get(t){const n=this.mapKeyFn(t),r=this.inner[n];if(r!==void 0){for(const[i,s]of r)if(this.equalsFn(i,t))return s}}has(t){return this.get(t)!==void 0}set(t,n){const r=this.mapKeyFn(t),i=this.inner[r];if(i===void 0)return this.inner[r]=[[t,n]],void this.innerSize++;for(let s=0;s{for(const[i,s]of r)t(i,s)})}isEmpty(){return Eoe(this.inner)}size(){return this.innerSize}}/** * @license * Copyright 2017 Google LLC * @@ -1476,7 +1476,7 @@ Content-Type: `+l.contentType+`\r * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const QXe=new _r(dt.comparator);function Fl(){return QXe}const koe=new _r(dt.comparator);function m0(...e){let t=koe;for(const n of e)t=t.insert(n.key,n);return t}function Doe(e){let t=koe;return e.forEach((n,r)=>t=t.insert(n,r.overlayedDocument)),t}function hd(){return Z0()}function $oe(){return Z0()}function Z0(){return new lg(e=>e.toString(),(e,t)=>e.isEqual(t))}const XXe=new _r(dt.comparator),JXe=new Di(dt.comparator);function Kt(...e){let t=JXe;for(const n of e)t=t.add(n);return t}const ZXe=new Di(Sn);function eJe(){return ZXe}/** + */const QXe=new _r(dt.comparator);function Fl(){return QXe}const Noe=new _r(dt.comparator);function m0(...e){let t=Noe;for(const n of e)t=t.insert(n.key,n);return t}function koe(e){let t=Noe;return e.forEach((n,r)=>t=t.insert(n,r.overlayedDocument)),t}function hd(){return Z0()}function Doe(){return Z0()}function Z0(){return new lg(e=>e.toString(),(e,t)=>e.isEqual(t))}const XXe=new _r(dt.comparator),JXe=new Di(dt.comparator);function Kt(...e){let t=JXe;for(const n of e)t=t.add(n);return t}const ZXe=new Di(Sn);function eJe(){return ZXe}/** * @license * Copyright 2020 Google LLC * @@ -1491,7 +1491,7 @@ Content-Type: `+l.contentType+`\r * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function Loe(e,t){if(e.useProto3Json){if(isNaN(t))return{doubleValue:"NaN"};if(t===1/0)return{doubleValue:"Infinity"};if(t===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:ZT(t)?"-0":t}}function Moe(e){return{integerValue:""+e}}function tJe(e,t){return RXe(t)?Moe(t):Loe(e,t)}/** + */function $oe(e,t){if(e.useProto3Json){if(isNaN(t))return{doubleValue:"NaN"};if(t===1/0)return{doubleValue:"Infinity"};if(t===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:ZT(t)?"-0":t}}function Loe(e){return{integerValue:""+e}}function tJe(e,t){return RXe(t)?Loe(t):$oe(e,t)}/** * @license * Copyright 2018 Google LLC * @@ -1506,7 +1506,7 @@ Content-Type: `+l.contentType+`\r * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class Rx{constructor(){this._=void 0}}function nJe(e,t,n){return e instanceof nS?function(i,s){const o={fields:{__type__:{stringValue:"server_timestamp"},__local_write_time__:{timestampValue:{seconds:i.seconds,nanos:i.nanoseconds}}}};return s&&x6(s)&&(s=C6(s)),s&&(o.fields.__previous_value__=s),{mapValue:o}}(n,t):e instanceof l_?Boe(e,t):e instanceof c_?joe(e,t):function(i,s){const o=Foe(i,s),a=XV(o)+XV(i.Ie);return BR(o)&&BR(i.Ie)?Moe(a):Loe(i.serializer,a)}(e,t)}function rJe(e,t,n){return e instanceof l_?Boe(e,t):e instanceof c_?joe(e,t):n}function Foe(e,t){return e instanceof rS?function(r){return BR(r)||function(s){return!!s&&"doubleValue"in s}(r)}(t)?t:{integerValue:0}:null}class nS extends Rx{}class l_ extends Rx{constructor(t){super(),this.elements=t}}function Boe(e,t){const n=Uoe(t);for(const r of e.elements)n.some(i=>Lu(i,r))||n.push(r);return{arrayValue:{values:n}}}class c_ extends Rx{constructor(t){super(),this.elements=t}}function joe(e,t){let n=Uoe(t);for(const r of e.elements)n=n.filter(i=>!Lu(i,r));return{arrayValue:{values:n}}}class rS extends Rx{constructor(t,n){super(),this.serializer=t,this.Ie=n}}function XV(e){return Br(e.integerValue||e.doubleValue)}function Uoe(e){return A6(e)&&e.arrayValue.values?e.arrayValue.values.slice():[]}function iJe(e,t){return e.field.isEqual(t.field)&&function(r,i){return r instanceof l_&&i instanceof l_||r instanceof c_&&i instanceof c_?wm(r.elements,i.elements,Lu):r instanceof rS&&i instanceof rS?Lu(r.Ie,i.Ie):r instanceof nS&&i instanceof nS}(e.transform,t.transform)}class sJe{constructor(t,n){this.version=t,this.transformResults=n}}class vl{constructor(t,n){this.updateTime=t,this.exists=n}static none(){return new vl}static exists(t){return new vl(void 0,t)}static updateTime(t){return new vl(t)}get isNone(){return this.updateTime===void 0&&this.exists===void 0}isEqual(t){return this.exists===t.exists&&(this.updateTime?!!t.updateTime&&this.updateTime.isEqual(t.updateTime):!t.updateTime)}}function Tb(e,t){return e.updateTime!==void 0?t.isFoundDocument()&&t.version.isEqual(e.updateTime):e.exists===void 0||e.exists===t.isFoundDocument()}class Nx{}function Voe(e,t){if(!e.hasLocalMutations||t&&t.fields.length===0)return null;if(t===null)return e.isNoDocument()?new Hoe(e.key,vl.none()):new dv(e.key,e.data,vl.none());{const n=e.data,r=Bo.empty();let i=new Di(Pi.comparator);for(let s of t.fields)if(!i.has(s)){let o=n.field(s);o===null&&s.length>1&&(s=s.popLast(),o=n.field(s)),o===null?r.delete(s):r.set(s,o),i=i.add(s)}return new dh(e.key,r,new wa(i.toArray()),vl.none())}}function oJe(e,t,n){e instanceof dv?function(i,s,o){const a=i.value.clone(),u=ZV(i.fieldTransforms,s,o.transformResults);a.setAll(u),s.convertToFoundDocument(o.version,a).setHasCommittedMutations()}(e,t,n):e instanceof dh?function(i,s,o){if(!Tb(i.precondition,s))return void s.convertToUnknownDocument(o.version);const a=ZV(i.fieldTransforms,s,o.transformResults),u=s.data;u.setAll(zoe(i)),u.setAll(a),s.convertToFoundDocument(o.version,u).setHasCommittedMutations()}(e,t,n):function(i,s,o){s.convertToNoDocument(o.version).setHasCommittedMutations()}(0,t,n)}function ey(e,t,n,r){return e instanceof dv?function(s,o,a,u){if(!Tb(s.precondition,o))return a;const l=s.value.clone(),c=e7(s.fieldTransforms,u,o);return l.setAll(c),o.convertToFoundDocument(o.version,l).setHasLocalMutations(),null}(e,t,n,r):e instanceof dh?function(s,o,a,u){if(!Tb(s.precondition,o))return a;const l=e7(s.fieldTransforms,u,o),c=o.data;return c.setAll(zoe(s)),c.setAll(l),o.convertToFoundDocument(o.version,c).setHasLocalMutations(),a===null?null:a.unionWith(s.fieldMask.fields).unionWith(s.fieldTransforms.map(f=>f.field))}(e,t,n,r):function(s,o,a){return Tb(s.precondition,o)?(o.convertToNoDocument(o.version).setHasLocalMutations(),null):a}(e,t,n)}function aJe(e,t){let n=null;for(const r of e.fieldTransforms){const i=t.data.field(r.field),s=Foe(r.transform,i||null);s!=null&&(n===null&&(n=Bo.empty()),n.set(r.field,s))}return n||null}function JV(e,t){return e.type===t.type&&!!e.key.isEqual(t.key)&&!!e.precondition.isEqual(t.precondition)&&!!function(r,i){return r===void 0&&i===void 0||!(!r||!i)&&wm(r,i,(s,o)=>iJe(s,o))}(e.fieldTransforms,t.fieldTransforms)&&(e.type===0?e.value.isEqual(t.value):e.type!==1||e.data.isEqual(t.data)&&e.fieldMask.isEqual(t.fieldMask))}class dv extends Nx{constructor(t,n,r,i=[]){super(),this.key=t,this.value=n,this.precondition=r,this.fieldTransforms=i,this.type=0}getFieldMask(){return null}}class dh extends Nx{constructor(t,n,r,i,s=[]){super(),this.key=t,this.data=n,this.fieldMask=r,this.precondition=i,this.fieldTransforms=s,this.type=1}getFieldMask(){return this.fieldMask}}function zoe(e){const t=new Map;return e.fieldMask.fields.forEach(n=>{if(!n.isEmpty()){const r=e.data.field(n);t.set(n,r)}}),t}function ZV(e,t,n){const r=new Map;Yn(e.length===n.length);for(let i=0;iLu(i,r))||n.push(r);return{arrayValue:{values:n}}}class c_ extends Rx{constructor(t){super(),this.elements=t}}function Boe(e,t){let n=joe(t);for(const r of e.elements)n=n.filter(i=>!Lu(i,r));return{arrayValue:{values:n}}}class rS extends Rx{constructor(t,n){super(),this.serializer=t,this.Ie=n}}function XV(e){return Br(e.integerValue||e.doubleValue)}function joe(e){return A6(e)&&e.arrayValue.values?e.arrayValue.values.slice():[]}function iJe(e,t){return e.field.isEqual(t.field)&&function(r,i){return r instanceof l_&&i instanceof l_||r instanceof c_&&i instanceof c_?wm(r.elements,i.elements,Lu):r instanceof rS&&i instanceof rS?Lu(r.Ie,i.Ie):r instanceof nS&&i instanceof nS}(e.transform,t.transform)}class sJe{constructor(t,n){this.version=t,this.transformResults=n}}class vl{constructor(t,n){this.updateTime=t,this.exists=n}static none(){return new vl}static exists(t){return new vl(void 0,t)}static updateTime(t){return new vl(t)}get isNone(){return this.updateTime===void 0&&this.exists===void 0}isEqual(t){return this.exists===t.exists&&(this.updateTime?!!t.updateTime&&this.updateTime.isEqual(t.updateTime):!t.updateTime)}}function Tb(e,t){return e.updateTime!==void 0?t.isFoundDocument()&&t.version.isEqual(e.updateTime):e.exists===void 0||e.exists===t.isFoundDocument()}class Nx{}function Uoe(e,t){if(!e.hasLocalMutations||t&&t.fields.length===0)return null;if(t===null)return e.isNoDocument()?new zoe(e.key,vl.none()):new dv(e.key,e.data,vl.none());{const n=e.data,r=Bo.empty();let i=new Di(Pi.comparator);for(let s of t.fields)if(!i.has(s)){let o=n.field(s);o===null&&s.length>1&&(s=s.popLast(),o=n.field(s)),o===null?r.delete(s):r.set(s,o),i=i.add(s)}return new dh(e.key,r,new wa(i.toArray()),vl.none())}}function oJe(e,t,n){e instanceof dv?function(i,s,o){const a=i.value.clone(),u=ZV(i.fieldTransforms,s,o.transformResults);a.setAll(u),s.convertToFoundDocument(o.version,a).setHasCommittedMutations()}(e,t,n):e instanceof dh?function(i,s,o){if(!Tb(i.precondition,s))return void s.convertToUnknownDocument(o.version);const a=ZV(i.fieldTransforms,s,o.transformResults),u=s.data;u.setAll(Voe(i)),u.setAll(a),s.convertToFoundDocument(o.version,u).setHasCommittedMutations()}(e,t,n):function(i,s,o){s.convertToNoDocument(o.version).setHasCommittedMutations()}(0,t,n)}function ey(e,t,n,r){return e instanceof dv?function(s,o,a,u){if(!Tb(s.precondition,o))return a;const l=s.value.clone(),c=e7(s.fieldTransforms,u,o);return l.setAll(c),o.convertToFoundDocument(o.version,l).setHasLocalMutations(),null}(e,t,n,r):e instanceof dh?function(s,o,a,u){if(!Tb(s.precondition,o))return a;const l=e7(s.fieldTransforms,u,o),c=o.data;return c.setAll(Voe(s)),c.setAll(l),o.convertToFoundDocument(o.version,c).setHasLocalMutations(),a===null?null:a.unionWith(s.fieldMask.fields).unionWith(s.fieldTransforms.map(f=>f.field))}(e,t,n,r):function(s,o,a){return Tb(s.precondition,o)?(o.convertToNoDocument(o.version).setHasLocalMutations(),null):a}(e,t,n)}function aJe(e,t){let n=null;for(const r of e.fieldTransforms){const i=t.data.field(r.field),s=Moe(r.transform,i||null);s!=null&&(n===null&&(n=Bo.empty()),n.set(r.field,s))}return n||null}function JV(e,t){return e.type===t.type&&!!e.key.isEqual(t.key)&&!!e.precondition.isEqual(t.precondition)&&!!function(r,i){return r===void 0&&i===void 0||!(!r||!i)&&wm(r,i,(s,o)=>iJe(s,o))}(e.fieldTransforms,t.fieldTransforms)&&(e.type===0?e.value.isEqual(t.value):e.type!==1||e.data.isEqual(t.data)&&e.fieldMask.isEqual(t.fieldMask))}class dv extends Nx{constructor(t,n,r,i=[]){super(),this.key=t,this.value=n,this.precondition=r,this.fieldTransforms=i,this.type=0}getFieldMask(){return null}}class dh extends Nx{constructor(t,n,r,i,s=[]){super(),this.key=t,this.data=n,this.fieldMask=r,this.precondition=i,this.fieldTransforms=s,this.type=1}getFieldMask(){return this.fieldMask}}function Voe(e){const t=new Map;return e.fieldMask.fields.forEach(n=>{if(!n.isEmpty()){const r=e.data.field(n);t.set(n,r)}}),t}function ZV(e,t,n){const r=new Map;Yn(e.length===n.length);for(let i=0;i{const s=t.get(i.key),o=s.overlayedDocument;let a=this.applyToLocalView(o,s.mutatedFields);a=n.has(i.key)?null:a;const u=Voe(o,a);u!==null&&r.set(i.key,u),o.isValidDocument()||o.convertToNoDocument(xt.min())}),r}keys(){return this.mutations.reduce((t,n)=>t.add(n.key),Kt())}isEqual(t){return this.batchId===t.batchId&&wm(this.mutations,t.mutations,(n,r)=>JV(n,r))&&wm(this.baseMutations,t.baseMutations,(n,r)=>JV(n,r))}}class N6{constructor(t,n,r,i){this.batch=t,this.commitVersion=n,this.mutationResults=r,this.docVersions=i}static from(t,n,r){Yn(t.mutations.length===r.length);let i=function(){return XXe}();const s=t.mutations;for(let o=0;o{const s=t.get(i.key),o=s.overlayedDocument;let a=this.applyToLocalView(o,s.mutatedFields);a=n.has(i.key)?null:a;const u=Uoe(o,a);u!==null&&r.set(i.key,u),o.isValidDocument()||o.convertToNoDocument(xt.min())}),r}keys(){return this.mutations.reduce((t,n)=>t.add(n.key),Kt())}isEqual(t){return this.batchId===t.batchId&&wm(this.mutations,t.mutations,(n,r)=>JV(n,r))&&wm(this.baseMutations,t.baseMutations,(n,r)=>JV(n,r))}}class N6{constructor(t,n,r,i){this.batch=t,this.commitVersion=n,this.mutationResults=r,this.docVersions=i}static from(t,n,r){Yn(t.mutations.length===r.length);let i=function(){return XXe}();const s=t.mutations;for(let o=0;o0&&(this.Se=!0,this.ye=t)}ve(){let t=Kt(),n=Kt(),r=Kt();return this.pe.forEach((i,s)=>{switch(s){case 0:t=t.add(i);break;case 2:n=n.add(i);break;case 1:r=r.add(i);break;default:_t()}}),new hv(this.ye,this.we,t,n,r)}Fe(){this.Se=!1,this.pe=s7()}Me(t,n){this.Se=!0,this.pe=this.pe.insert(t,n)}xe(t){this.Se=!0,this.pe=this.pe.remove(t)}Oe(){this.ge+=1}Ne(){this.ge-=1,Yn(this.ge>=0)}Be(){this.Se=!0,this.we=!0}}class mJe{constructor(t){this.Le=t,this.ke=new Map,this.qe=Fl(),this.Qe=i7(),this.Ke=new _r(Sn)}$e(t){for(const n of t.Ve)t.me&&t.me.isFoundDocument()?this.Ue(n,t.me):this.We(n,t.key,t.me);for(const n of t.removedTargetIds)this.We(n,t.key,t.me)}Ge(t){this.forEachTarget(t,n=>{const r=this.ze(n);switch(t.state){case 0:this.je(n)&&r.Ce(t.resumeToken);break;case 1:r.Ne(),r.be||r.Fe(),r.Ce(t.resumeToken);break;case 2:r.Ne(),r.be||this.removeTarget(n);break;case 3:this.je(n)&&(r.Be(),r.Ce(t.resumeToken));break;case 4:this.je(n)&&(this.He(n),r.Ce(t.resumeToken));break;default:_t()}})}forEachTarget(t,n){t.targetIds.length>0?t.targetIds.forEach(n):this.ke.forEach((r,i)=>{this.je(i)&&n(i)})}Je(t){const n=t.targetId,r=t.fe.count,i=this.Ye(n);if(i){const s=i.target;if(UR(s))if(r===0){const o=new dt(s.path);this.We(n,o,qi.newNoDocument(o,xt.min()))}else Yn(r===1);else{const o=this.Ze(n);if(o!==r){const a=this.Xe(t),u=a?this.et(a,t,o):1;if(u!==0){this.He(n);const l=u===2?"TargetPurposeExistenceFilterMismatchBloom":"TargetPurposeExistenceFilterMismatch";this.Ke=this.Ke.insert(n,l)}}}}}Xe(t){const n=t.fe.unchangedNames;if(!n||!n.bits)return null;const{bits:{bitmap:r="",padding:i=0},hashCount:s=0}=n;let o,a;try{o=Hd(r).toUint8Array()}catch(u){if(u instanceof Toe)return i_("Decoding the base64 bloom filter in existence filter failed ("+u.message+"); ignoring the bloom filter and falling back to full re-query."),null;throw u}try{a=new k6(o,i,s)}catch(u){return i_(u instanceof g0?"BloomFilter error: ":"Applying bloom filter failed: ",u),null}return a.Te===0?null:a}et(t,n,r){return n.fe.count===r-this.rt(t,n.targetId)?0:2}rt(t,n){const r=this.Le.getRemoteKeysForTarget(n);let i=0;return r.forEach(s=>{const o=this.Le.nt(),a=`projects/${o.projectId}/databases/${o.database}/documents/${s.path.canonicalString()}`;t.mightContain(a)||(this.We(n,s,null),i++)}),i}it(t){const n=new Map;this.ke.forEach((s,o)=>{const a=this.Ye(o);if(a){if(s.current&&UR(a.target)){const u=new dt(a.target.path);this.qe.get(u)!==null||this.st(o,u)||this.We(o,u,qi.newNoDocument(u,t))}s.De&&(n.set(o,s.ve()),s.Fe())}});let r=Kt();this.Qe.forEach((s,o)=>{let a=!0;o.forEachWhile(u=>{const l=this.Ye(u);return!l||l.purpose==="TargetPurposeLimboResolution"||(a=!1,!1)}),a&&(r=r.add(s))}),this.qe.forEach((s,o)=>o.setReadTime(t));const i=new kx(t,n,this.Ke,this.qe,r);return this.qe=Fl(),this.Qe=i7(),this.Ke=new _r(Sn),i}Ue(t,n){if(!this.je(t))return;const r=this.st(t,n.key)?2:0;this.ze(t).Me(n.key,r),this.qe=this.qe.insert(n.key,n),this.Qe=this.Qe.insert(n.key,this.ot(n.key).add(t))}We(t,n,r){if(!this.je(t))return;const i=this.ze(t);this.st(t,n)?i.Me(n,1):i.xe(n),this.Qe=this.Qe.insert(n,this.ot(n).delete(t)),r&&(this.qe=this.qe.insert(n,r))}removeTarget(t){this.ke.delete(t)}Ze(t){const n=this.ze(t).ve();return this.Le.getRemoteKeysForTarget(t).size+n.addedDocuments.size-n.removedDocuments.size}Oe(t){this.ze(t).Oe()}ze(t){let n=this.ke.get(t);return n||(n=new r7,this.ke.set(t,n)),n}ot(t){let n=this.Qe.get(t);return n||(n=new Di(Sn),this.Qe=this.Qe.insert(t,n)),n}je(t){const n=this.Ye(t)!==null;return n||Xe("WatchChangeAggregator","Detected inactive target",t),n}Ye(t){const n=this.ke.get(t);return n&&n.be?null:this.Le._t(t)}He(t){this.ke.set(t,new r7),this.Le.getRemoteKeysForTarget(t).forEach(n=>{this.We(t,n,null)})}st(t,n){return this.Le.getRemoteKeysForTarget(t).has(n)}}function i7(){return new _r(dt.comparator)}function s7(){return new _r(dt.comparator)}const gJe={asc:"ASCENDING",desc:"DESCENDING"},yJe={"<":"LESS_THAN","<=":"LESS_THAN_OR_EQUAL",">":"GREATER_THAN",">=":"GREATER_THAN_OR_EQUAL","==":"EQUAL","!=":"NOT_EQUAL","array-contains":"ARRAY_CONTAINS",in:"IN","not-in":"NOT_IN","array-contains-any":"ARRAY_CONTAINS_ANY"},_Je={and:"AND",or:"OR"};class vJe{constructor(t,n){this.databaseId=t,this.useProto3Json=n}}function zR(e,t){return e.useProto3Json||Cx(t)?t:{value:t}}function iS(e,t){return e.useProto3Json?`${new Date(1e3*t.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")}.${("000000000"+t.nanoseconds).slice(-9)}Z`:{seconds:""+t.seconds,nanos:t.nanoseconds}}function Goe(e,t){return e.useProto3Json?t.toBase64():t.toUint8Array()}function bJe(e,t){return iS(e,t.toTimestamp())}function Iu(e){return Yn(!!e),xt.fromTimestamp(function(n){const r=hf(n);return new Zr(r.seconds,r.nanos)}(e))}function D6(e,t){return function(r){return new ur(["projects",r.projectId,"databases",r.database])}(e).child("documents").child(t).canonicalString()}function Koe(e){const t=ur.fromString(e);return Yn(Zoe(t)),t}function HR(e,t){return D6(e.databaseId,t.path)}function TO(e,t){const n=Koe(t);if(n.get(1)!==e.databaseId.projectId)throw new tt(xe.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+n.get(1)+" vs "+e.databaseId.projectId);if(n.get(3)!==e.databaseId.database)throw new tt(xe.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+n.get(3)+" vs "+e.databaseId.database);return new dt(Qoe(n))}function WR(e,t){return D6(e.databaseId,t)}function EJe(e){const t=Koe(e);return t.length===4?ur.emptyPath():Qoe(t)}function qR(e){return new ur(["projects",e.databaseId.projectId,"databases",e.databaseId.database]).canonicalString()}function Qoe(e){return Yn(e.length>4&&e.get(4)==="documents"),e.popFirst(5)}function o7(e,t,n){return{name:HR(e,t),fields:n.value.mapValue.fields}}function wJe(e,t){let n;if("targetChange"in t){t.targetChange;const r=function(l){return l==="NO_CHANGE"?0:l==="ADD"?1:l==="REMOVE"?2:l==="CURRENT"?3:l==="RESET"?4:_t()}(t.targetChange.targetChangeType||"NO_CHANGE"),i=t.targetChange.targetIds||[],s=function(l,c){return l.useProto3Json?(Yn(c===void 0||typeof c=="string"),es.fromBase64String(c||"")):(Yn(c===void 0||c instanceof Uint8Array),es.fromUint8Array(c||new Uint8Array))}(e,t.targetChange.resumeToken),o=t.targetChange.cause,a=o&&function(l){const c=l.code===void 0?xe.UNKNOWN:Woe(l.code);return new tt(c,l.message||"")}(o);n=new Yoe(r,i,s,a||null)}else if("documentChange"in t){t.documentChange;const r=t.documentChange;r.document,r.document.name,r.document.updateTime;const i=TO(e,r.document.name),s=Iu(r.document.updateTime),o=r.document.createTime?Iu(r.document.createTime):xt.min(),a=new Bo({mapValue:{fields:r.document.fields}}),u=qi.newFoundDocument(i,s,o,a),l=r.targetIds||[],c=r.removedTargetIds||[];n=new Sb(l,c,u.key,u)}else if("documentDelete"in t){t.documentDelete;const r=t.documentDelete;r.document;const i=TO(e,r.document),s=r.readTime?Iu(r.readTime):xt.min(),o=qi.newNoDocument(i,s),a=r.removedTargetIds||[];n=new Sb([],a,o.key,o)}else if("documentRemove"in t){t.documentRemove;const r=t.documentRemove;r.document;const i=TO(e,r.document),s=r.removedTargetIds||[];n=new Sb([],s,i,null)}else{if(!("filter"in t))return _t();{t.filter;const r=t.filter;r.targetId;const{count:i=0,unchangedNames:s}=r,o=new fJe(i,s),a=r.targetId;n=new qoe(a,o)}}return n}function TJe(e,t){let n;if(t instanceof dv)n={update:o7(e,t.key,t.value)};else if(t instanceof Hoe)n={delete:HR(e,t.key)};else if(t instanceof dh)n={update:o7(e,t.key,t.data),updateMask:NJe(t.fieldMask)};else{if(!(t instanceof uJe))return _t();n={verify:HR(e,t.key)}}return t.fieldTransforms.length>0&&(n.updateTransforms=t.fieldTransforms.map(r=>function(s,o){const a=o.transform;if(a instanceof nS)return{fieldPath:o.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(a instanceof l_)return{fieldPath:o.field.canonicalString(),appendMissingElements:{values:a.elements}};if(a instanceof c_)return{fieldPath:o.field.canonicalString(),removeAllFromArray:{values:a.elements}};if(a instanceof rS)return{fieldPath:o.field.canonicalString(),increment:a.Ie};throw _t()}(0,r))),t.precondition.isNone||(n.currentDocument=function(i,s){return s.updateTime!==void 0?{updateTime:bJe(i,s.updateTime)}:s.exists!==void 0?{exists:s.exists}:_t()}(e,t.precondition)),n}function SJe(e,t){return e&&e.length>0?(Yn(t!==void 0),e.map(n=>function(i,s){let o=i.updateTime?Iu(i.updateTime):Iu(s);return o.isEqual(xt.min())&&(o=Iu(s)),new sJe(o,i.transformResults||[])}(n,t))):[]}function IJe(e,t){return{documents:[WR(e,t.path)]}}function xJe(e,t){const n={structuredQuery:{}},r=t.path;t.collectionGroup!==null?(n.parent=WR(e,r),n.structuredQuery.from=[{collectionId:t.collectionGroup,allDescendants:!0}]):(n.parent=WR(e,r.popLast()),n.structuredQuery.from=[{collectionId:r.lastSegment()}]);const i=function(u){if(u.length!==0)return Joe(Mu.create(u,"and"))}(t.filters);i&&(n.structuredQuery.where=i);const s=function(u){if(u.length!==0)return u.map(l=>function(f){return{field:Lh(f.field),direction:OJe(f.dir)}}(l))}(t.orderBy);s&&(n.structuredQuery.orderBy=s);const o=zR(e,t.limit);return o!==null&&(n.structuredQuery.limit=o),t.startAt&&(n.structuredQuery.startAt=function(u){return{before:u.inclusive,values:u.position}}(t.startAt)),t.endAt&&(n.structuredQuery.endAt=function(u){return{before:!u.inclusive,values:u.position}}(t.endAt)),n}function CJe(e){let t=EJe(e.parent);const n=e.structuredQuery,r=n.from?n.from.length:0;let i=null;if(r>0){Yn(r===1);const c=n.from[0];c.allDescendants?i=c.collectionId:t=t.child(c.collectionId)}let s=[];n.where&&(s=function(f){const d=Xoe(f);return d instanceof Mu&&Coe(d)?d.getFilters():[d]}(n.where));let o=[];n.orderBy&&(o=function(f){return f.map(d=>function(p){return new tS(Mh(p.field),function(y){switch(y){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(p.direction))}(d))}(n.orderBy));let a=null;n.limit&&(a=function(f){let d;return d=typeof f=="object"?f.value:f,Cx(d)?null:d}(n.limit));let u=null;n.startAt&&(u=function(f){const d=!!f.before,h=f.values||[];return new eS(h,d)}(n.startAt));let l=null;return n.endAt&&(l=function(f){const d=!f.before,h=f.values||[];return new eS(h,d)}(n.endAt)),WXe(t,i,o,s,a,"F",u,l)}function AJe(e,t){const n=function(i){switch(i){case"TargetPurposeListen":return null;case"TargetPurposeExistenceFilterMismatch":return"existence-filter-mismatch";case"TargetPurposeExistenceFilterMismatchBloom":return"existence-filter-mismatch-bloom";case"TargetPurposeLimboResolution":return"limbo-document";default:return _t()}}(t.purpose);return n==null?null:{"goog-listen-tags":n}}function Xoe(e){return e.unaryFilter!==void 0?function(n){switch(n.unaryFilter.op){case"IS_NAN":const r=Mh(n.unaryFilter.field);return Qr.create(r,"==",{doubleValue:NaN});case"IS_NULL":const i=Mh(n.unaryFilter.field);return Qr.create(i,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":const s=Mh(n.unaryFilter.field);return Qr.create(s,"!=",{doubleValue:NaN});case"IS_NOT_NULL":const o=Mh(n.unaryFilter.field);return Qr.create(o,"!=",{nullValue:"NULL_VALUE"});default:return _t()}}(e):e.fieldFilter!==void 0?function(n){return Qr.create(Mh(n.fieldFilter.field),function(i){switch(i){case"EQUAL":return"==";case"NOT_EQUAL":return"!=";case"GREATER_THAN":return">";case"GREATER_THAN_OR_EQUAL":return">=";case"LESS_THAN":return"<";case"LESS_THAN_OR_EQUAL":return"<=";case"ARRAY_CONTAINS":return"array-contains";case"IN":return"in";case"NOT_IN":return"not-in";case"ARRAY_CONTAINS_ANY":return"array-contains-any";default:return _t()}}(n.fieldFilter.op),n.fieldFilter.value)}(e):e.compositeFilter!==void 0?function(n){return Mu.create(n.compositeFilter.filters.map(r=>Xoe(r)),function(i){switch(i){case"AND":return"and";case"OR":return"or";default:return _t()}}(n.compositeFilter.op))}(e):_t()}function OJe(e){return gJe[e]}function PJe(e){return yJe[e]}function RJe(e){return _Je[e]}function Lh(e){return{fieldPath:e.canonicalString()}}function Mh(e){return Pi.fromServerFormat(e.fieldPath)}function Joe(e){return e instanceof Qr?function(n){if(n.op==="=="){if(qV(n.value))return{unaryFilter:{field:Lh(n.field),op:"IS_NAN"}};if(WV(n.value))return{unaryFilter:{field:Lh(n.field),op:"IS_NULL"}}}else if(n.op==="!="){if(qV(n.value))return{unaryFilter:{field:Lh(n.field),op:"IS_NOT_NAN"}};if(WV(n.value))return{unaryFilter:{field:Lh(n.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:Lh(n.field),op:PJe(n.op),value:n.value}}}(e):e instanceof Mu?function(n){const r=n.getFilters().map(i=>Joe(i));return r.length===1?r[0]:{compositeFilter:{op:RJe(n.op),filters:r}}}(e):_t()}function NJe(e){const t=[];return e.fields.forEach(n=>t.push(n.canonicalString())),{fieldPaths:t}}function Zoe(e){return e.length>=4&&e.get(0)==="projects"&&e.get(2)==="databases"}/** + */class Sb{constructor(t,n,r,i){this.Ve=t,this.removedTargetIds=n,this.key=r,this.me=i}}class Woe{constructor(t,n){this.targetId=t,this.fe=n}}class qoe{constructor(t,n,r=es.EMPTY_BYTE_STRING,i=null){this.state=t,this.targetIds=n,this.resumeToken=r,this.cause=i}}class r7{constructor(){this.ge=0,this.pe=s7(),this.ye=es.EMPTY_BYTE_STRING,this.we=!1,this.Se=!0}get current(){return this.we}get resumeToken(){return this.ye}get be(){return this.ge!==0}get De(){return this.Se}Ce(t){t.approximateByteSize()>0&&(this.Se=!0,this.ye=t)}ve(){let t=Kt(),n=Kt(),r=Kt();return this.pe.forEach((i,s)=>{switch(s){case 0:t=t.add(i);break;case 2:n=n.add(i);break;case 1:r=r.add(i);break;default:_t()}}),new hv(this.ye,this.we,t,n,r)}Fe(){this.Se=!1,this.pe=s7()}Me(t,n){this.Se=!0,this.pe=this.pe.insert(t,n)}xe(t){this.Se=!0,this.pe=this.pe.remove(t)}Oe(){this.ge+=1}Ne(){this.ge-=1,Yn(this.ge>=0)}Be(){this.Se=!0,this.we=!0}}class mJe{constructor(t){this.Le=t,this.ke=new Map,this.qe=Fl(),this.Qe=i7(),this.Ke=new _r(Sn)}$e(t){for(const n of t.Ve)t.me&&t.me.isFoundDocument()?this.Ue(n,t.me):this.We(n,t.key,t.me);for(const n of t.removedTargetIds)this.We(n,t.key,t.me)}Ge(t){this.forEachTarget(t,n=>{const r=this.ze(n);switch(t.state){case 0:this.je(n)&&r.Ce(t.resumeToken);break;case 1:r.Ne(),r.be||r.Fe(),r.Ce(t.resumeToken);break;case 2:r.Ne(),r.be||this.removeTarget(n);break;case 3:this.je(n)&&(r.Be(),r.Ce(t.resumeToken));break;case 4:this.je(n)&&(this.He(n),r.Ce(t.resumeToken));break;default:_t()}})}forEachTarget(t,n){t.targetIds.length>0?t.targetIds.forEach(n):this.ke.forEach((r,i)=>{this.je(i)&&n(i)})}Je(t){const n=t.targetId,r=t.fe.count,i=this.Ye(n);if(i){const s=i.target;if(UR(s))if(r===0){const o=new dt(s.path);this.We(n,o,qi.newNoDocument(o,xt.min()))}else Yn(r===1);else{const o=this.Ze(n);if(o!==r){const a=this.Xe(t),u=a?this.et(a,t,o):1;if(u!==0){this.He(n);const l=u===2?"TargetPurposeExistenceFilterMismatchBloom":"TargetPurposeExistenceFilterMismatch";this.Ke=this.Ke.insert(n,l)}}}}}Xe(t){const n=t.fe.unchangedNames;if(!n||!n.bits)return null;const{bits:{bitmap:r="",padding:i=0},hashCount:s=0}=n;let o,a;try{o=Hd(r).toUint8Array()}catch(u){if(u instanceof woe)return i_("Decoding the base64 bloom filter in existence filter failed ("+u.message+"); ignoring the bloom filter and falling back to full re-query."),null;throw u}try{a=new k6(o,i,s)}catch(u){return i_(u instanceof g0?"BloomFilter error: ":"Applying bloom filter failed: ",u),null}return a.Te===0?null:a}et(t,n,r){return n.fe.count===r-this.rt(t,n.targetId)?0:2}rt(t,n){const r=this.Le.getRemoteKeysForTarget(n);let i=0;return r.forEach(s=>{const o=this.Le.nt(),a=`projects/${o.projectId}/databases/${o.database}/documents/${s.path.canonicalString()}`;t.mightContain(a)||(this.We(n,s,null),i++)}),i}it(t){const n=new Map;this.ke.forEach((s,o)=>{const a=this.Ye(o);if(a){if(s.current&&UR(a.target)){const u=new dt(a.target.path);this.qe.get(u)!==null||this.st(o,u)||this.We(o,u,qi.newNoDocument(u,t))}s.De&&(n.set(o,s.ve()),s.Fe())}});let r=Kt();this.Qe.forEach((s,o)=>{let a=!0;o.forEachWhile(u=>{const l=this.Ye(u);return!l||l.purpose==="TargetPurposeLimboResolution"||(a=!1,!1)}),a&&(r=r.add(s))}),this.qe.forEach((s,o)=>o.setReadTime(t));const i=new kx(t,n,this.Ke,this.qe,r);return this.qe=Fl(),this.Qe=i7(),this.Ke=new _r(Sn),i}Ue(t,n){if(!this.je(t))return;const r=this.st(t,n.key)?2:0;this.ze(t).Me(n.key,r),this.qe=this.qe.insert(n.key,n),this.Qe=this.Qe.insert(n.key,this.ot(n.key).add(t))}We(t,n,r){if(!this.je(t))return;const i=this.ze(t);this.st(t,n)?i.Me(n,1):i.xe(n),this.Qe=this.Qe.insert(n,this.ot(n).delete(t)),r&&(this.qe=this.qe.insert(n,r))}removeTarget(t){this.ke.delete(t)}Ze(t){const n=this.ze(t).ve();return this.Le.getRemoteKeysForTarget(t).size+n.addedDocuments.size-n.removedDocuments.size}Oe(t){this.ze(t).Oe()}ze(t){let n=this.ke.get(t);return n||(n=new r7,this.ke.set(t,n)),n}ot(t){let n=this.Qe.get(t);return n||(n=new Di(Sn),this.Qe=this.Qe.insert(t,n)),n}je(t){const n=this.Ye(t)!==null;return n||Xe("WatchChangeAggregator","Detected inactive target",t),n}Ye(t){const n=this.ke.get(t);return n&&n.be?null:this.Le._t(t)}He(t){this.ke.set(t,new r7),this.Le.getRemoteKeysForTarget(t).forEach(n=>{this.We(t,n,null)})}st(t,n){return this.Le.getRemoteKeysForTarget(t).has(n)}}function i7(){return new _r(dt.comparator)}function s7(){return new _r(dt.comparator)}const gJe={asc:"ASCENDING",desc:"DESCENDING"},yJe={"<":"LESS_THAN","<=":"LESS_THAN_OR_EQUAL",">":"GREATER_THAN",">=":"GREATER_THAN_OR_EQUAL","==":"EQUAL","!=":"NOT_EQUAL","array-contains":"ARRAY_CONTAINS",in:"IN","not-in":"NOT_IN","array-contains-any":"ARRAY_CONTAINS_ANY"},_Je={and:"AND",or:"OR"};class vJe{constructor(t,n){this.databaseId=t,this.useProto3Json=n}}function zR(e,t){return e.useProto3Json||Cx(t)?t:{value:t}}function iS(e,t){return e.useProto3Json?`${new Date(1e3*t.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")}.${("000000000"+t.nanoseconds).slice(-9)}Z`:{seconds:""+t.seconds,nanos:t.nanoseconds}}function Yoe(e,t){return e.useProto3Json?t.toBase64():t.toUint8Array()}function bJe(e,t){return iS(e,t.toTimestamp())}function Iu(e){return Yn(!!e),xt.fromTimestamp(function(n){const r=hf(n);return new Zr(r.seconds,r.nanos)}(e))}function D6(e,t){return function(r){return new ur(["projects",r.projectId,"databases",r.database])}(e).child("documents").child(t).canonicalString()}function Goe(e){const t=ur.fromString(e);return Yn(Joe(t)),t}function HR(e,t){return D6(e.databaseId,t.path)}function TO(e,t){const n=Goe(t);if(n.get(1)!==e.databaseId.projectId)throw new tt(xe.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+n.get(1)+" vs "+e.databaseId.projectId);if(n.get(3)!==e.databaseId.database)throw new tt(xe.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+n.get(3)+" vs "+e.databaseId.database);return new dt(Koe(n))}function WR(e,t){return D6(e.databaseId,t)}function EJe(e){const t=Goe(e);return t.length===4?ur.emptyPath():Koe(t)}function qR(e){return new ur(["projects",e.databaseId.projectId,"databases",e.databaseId.database]).canonicalString()}function Koe(e){return Yn(e.length>4&&e.get(4)==="documents"),e.popFirst(5)}function o7(e,t,n){return{name:HR(e,t),fields:n.value.mapValue.fields}}function wJe(e,t){let n;if("targetChange"in t){t.targetChange;const r=function(l){return l==="NO_CHANGE"?0:l==="ADD"?1:l==="REMOVE"?2:l==="CURRENT"?3:l==="RESET"?4:_t()}(t.targetChange.targetChangeType||"NO_CHANGE"),i=t.targetChange.targetIds||[],s=function(l,c){return l.useProto3Json?(Yn(c===void 0||typeof c=="string"),es.fromBase64String(c||"")):(Yn(c===void 0||c instanceof Uint8Array),es.fromUint8Array(c||new Uint8Array))}(e,t.targetChange.resumeToken),o=t.targetChange.cause,a=o&&function(l){const c=l.code===void 0?xe.UNKNOWN:Hoe(l.code);return new tt(c,l.message||"")}(o);n=new qoe(r,i,s,a||null)}else if("documentChange"in t){t.documentChange;const r=t.documentChange;r.document,r.document.name,r.document.updateTime;const i=TO(e,r.document.name),s=Iu(r.document.updateTime),o=r.document.createTime?Iu(r.document.createTime):xt.min(),a=new Bo({mapValue:{fields:r.document.fields}}),u=qi.newFoundDocument(i,s,o,a),l=r.targetIds||[],c=r.removedTargetIds||[];n=new Sb(l,c,u.key,u)}else if("documentDelete"in t){t.documentDelete;const r=t.documentDelete;r.document;const i=TO(e,r.document),s=r.readTime?Iu(r.readTime):xt.min(),o=qi.newNoDocument(i,s),a=r.removedTargetIds||[];n=new Sb([],a,o.key,o)}else if("documentRemove"in t){t.documentRemove;const r=t.documentRemove;r.document;const i=TO(e,r.document),s=r.removedTargetIds||[];n=new Sb([],s,i,null)}else{if(!("filter"in t))return _t();{t.filter;const r=t.filter;r.targetId;const{count:i=0,unchangedNames:s}=r,o=new fJe(i,s),a=r.targetId;n=new Woe(a,o)}}return n}function TJe(e,t){let n;if(t instanceof dv)n={update:o7(e,t.key,t.value)};else if(t instanceof zoe)n={delete:HR(e,t.key)};else if(t instanceof dh)n={update:o7(e,t.key,t.data),updateMask:NJe(t.fieldMask)};else{if(!(t instanceof uJe))return _t();n={verify:HR(e,t.key)}}return t.fieldTransforms.length>0&&(n.updateTransforms=t.fieldTransforms.map(r=>function(s,o){const a=o.transform;if(a instanceof nS)return{fieldPath:o.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(a instanceof l_)return{fieldPath:o.field.canonicalString(),appendMissingElements:{values:a.elements}};if(a instanceof c_)return{fieldPath:o.field.canonicalString(),removeAllFromArray:{values:a.elements}};if(a instanceof rS)return{fieldPath:o.field.canonicalString(),increment:a.Ie};throw _t()}(0,r))),t.precondition.isNone||(n.currentDocument=function(i,s){return s.updateTime!==void 0?{updateTime:bJe(i,s.updateTime)}:s.exists!==void 0?{exists:s.exists}:_t()}(e,t.precondition)),n}function SJe(e,t){return e&&e.length>0?(Yn(t!==void 0),e.map(n=>function(i,s){let o=i.updateTime?Iu(i.updateTime):Iu(s);return o.isEqual(xt.min())&&(o=Iu(s)),new sJe(o,i.transformResults||[])}(n,t))):[]}function IJe(e,t){return{documents:[WR(e,t.path)]}}function xJe(e,t){const n={structuredQuery:{}},r=t.path;t.collectionGroup!==null?(n.parent=WR(e,r),n.structuredQuery.from=[{collectionId:t.collectionGroup,allDescendants:!0}]):(n.parent=WR(e,r.popLast()),n.structuredQuery.from=[{collectionId:r.lastSegment()}]);const i=function(u){if(u.length!==0)return Xoe(Mu.create(u,"and"))}(t.filters);i&&(n.structuredQuery.where=i);const s=function(u){if(u.length!==0)return u.map(l=>function(f){return{field:Lh(f.field),direction:OJe(f.dir)}}(l))}(t.orderBy);s&&(n.structuredQuery.orderBy=s);const o=zR(e,t.limit);return o!==null&&(n.structuredQuery.limit=o),t.startAt&&(n.structuredQuery.startAt=function(u){return{before:u.inclusive,values:u.position}}(t.startAt)),t.endAt&&(n.structuredQuery.endAt=function(u){return{before:!u.inclusive,values:u.position}}(t.endAt)),n}function CJe(e){let t=EJe(e.parent);const n=e.structuredQuery,r=n.from?n.from.length:0;let i=null;if(r>0){Yn(r===1);const c=n.from[0];c.allDescendants?i=c.collectionId:t=t.child(c.collectionId)}let s=[];n.where&&(s=function(f){const d=Qoe(f);return d instanceof Mu&&xoe(d)?d.getFilters():[d]}(n.where));let o=[];n.orderBy&&(o=function(f){return f.map(d=>function(p){return new tS(Mh(p.field),function(y){switch(y){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(p.direction))}(d))}(n.orderBy));let a=null;n.limit&&(a=function(f){let d;return d=typeof f=="object"?f.value:f,Cx(d)?null:d}(n.limit));let u=null;n.startAt&&(u=function(f){const d=!!f.before,h=f.values||[];return new eS(h,d)}(n.startAt));let l=null;return n.endAt&&(l=function(f){const d=!f.before,h=f.values||[];return new eS(h,d)}(n.endAt)),WXe(t,i,o,s,a,"F",u,l)}function AJe(e,t){const n=function(i){switch(i){case"TargetPurposeListen":return null;case"TargetPurposeExistenceFilterMismatch":return"existence-filter-mismatch";case"TargetPurposeExistenceFilterMismatchBloom":return"existence-filter-mismatch-bloom";case"TargetPurposeLimboResolution":return"limbo-document";default:return _t()}}(t.purpose);return n==null?null:{"goog-listen-tags":n}}function Qoe(e){return e.unaryFilter!==void 0?function(n){switch(n.unaryFilter.op){case"IS_NAN":const r=Mh(n.unaryFilter.field);return Qr.create(r,"==",{doubleValue:NaN});case"IS_NULL":const i=Mh(n.unaryFilter.field);return Qr.create(i,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":const s=Mh(n.unaryFilter.field);return Qr.create(s,"!=",{doubleValue:NaN});case"IS_NOT_NULL":const o=Mh(n.unaryFilter.field);return Qr.create(o,"!=",{nullValue:"NULL_VALUE"});default:return _t()}}(e):e.fieldFilter!==void 0?function(n){return Qr.create(Mh(n.fieldFilter.field),function(i){switch(i){case"EQUAL":return"==";case"NOT_EQUAL":return"!=";case"GREATER_THAN":return">";case"GREATER_THAN_OR_EQUAL":return">=";case"LESS_THAN":return"<";case"LESS_THAN_OR_EQUAL":return"<=";case"ARRAY_CONTAINS":return"array-contains";case"IN":return"in";case"NOT_IN":return"not-in";case"ARRAY_CONTAINS_ANY":return"array-contains-any";default:return _t()}}(n.fieldFilter.op),n.fieldFilter.value)}(e):e.compositeFilter!==void 0?function(n){return Mu.create(n.compositeFilter.filters.map(r=>Qoe(r)),function(i){switch(i){case"AND":return"and";case"OR":return"or";default:return _t()}}(n.compositeFilter.op))}(e):_t()}function OJe(e){return gJe[e]}function PJe(e){return yJe[e]}function RJe(e){return _Je[e]}function Lh(e){return{fieldPath:e.canonicalString()}}function Mh(e){return Pi.fromServerFormat(e.fieldPath)}function Xoe(e){return e instanceof Qr?function(n){if(n.op==="=="){if(qV(n.value))return{unaryFilter:{field:Lh(n.field),op:"IS_NAN"}};if(WV(n.value))return{unaryFilter:{field:Lh(n.field),op:"IS_NULL"}}}else if(n.op==="!="){if(qV(n.value))return{unaryFilter:{field:Lh(n.field),op:"IS_NOT_NAN"}};if(WV(n.value))return{unaryFilter:{field:Lh(n.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:Lh(n.field),op:PJe(n.op),value:n.value}}}(e):e instanceof Mu?function(n){const r=n.getFilters().map(i=>Xoe(i));return r.length===1?r[0]:{compositeFilter:{op:RJe(n.op),filters:r}}}(e):_t()}function NJe(e){const t=[];return e.fields.forEach(n=>t.push(n.canonicalString())),{fieldPaths:t}}function Joe(e){return e.length>=4&&e.get(0)==="projects"&&e.get(2)==="databases"}/** * @license * Copyright 2017 Google LLC * @@ -1749,7 +1749,7 @@ Content-Type: `+l.contentType+`\r * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class BJe{constructor(t,n,r,i){this.remoteDocumentCache=t,this.mutationQueue=n,this.documentOverlayCache=r,this.indexManager=i}getDocument(t,n){let r=null;return this.documentOverlayCache.getOverlay(t,n).next(i=>(r=i,this.remoteDocumentCache.getEntry(t,n))).next(i=>(r!==null&&ey(r.mutation,i,wa.empty(),Zr.now()),i))}getDocuments(t,n){return this.remoteDocumentCache.getEntries(t,n).next(r=>this.getLocalViewOfDocuments(t,r,Kt()).next(()=>r))}getLocalViewOfDocuments(t,n,r=Kt()){const i=hd();return this.populateOverlays(t,i,n).next(()=>this.computeViews(t,n,i,r).next(s=>{let o=m0();return s.forEach((a,u)=>{o=o.insert(a,u.overlayedDocument)}),o}))}getOverlayedDocuments(t,n){const r=hd();return this.populateOverlays(t,r,n).next(()=>this.computeViews(t,n,r,Kt()))}populateOverlays(t,n,r){const i=[];return r.forEach(s=>{n.has(s)||i.push(s)}),this.documentOverlayCache.getOverlays(t,i).next(s=>{s.forEach((o,a)=>{n.set(o,a)})})}computeViews(t,n,r,i){let s=Fl();const o=Z0(),a=function(){return Z0()}();return n.forEach((u,l)=>{const c=r.get(l.key);i.has(l.key)&&(c===void 0||c.mutation instanceof dh)?s=s.insert(l.key,l):c!==void 0?(o.set(l.key,c.mutation.getFieldMask()),ey(c.mutation,l,c.mutation.getFieldMask(),Zr.now())):o.set(l.key,wa.empty())}),this.recalculateAndSaveOverlays(t,s).next(u=>(u.forEach((l,c)=>o.set(l,c)),n.forEach((l,c)=>{var f;return a.set(l,new FJe(c,(f=o.get(l))!==null&&f!==void 0?f:null))}),a))}recalculateAndSaveOverlays(t,n){const r=Z0();let i=new _r((o,a)=>o-a),s=Kt();return this.mutationQueue.getAllMutationBatchesAffectingDocumentKeys(t,n).next(o=>{for(const a of o)a.keys().forEach(u=>{const l=n.get(u);if(l===null)return;let c=r.get(u)||wa.empty();c=a.applyToLocalView(l,c),r.set(u,c);const f=(i.get(a.batchId)||Kt()).add(u);i=i.insert(a.batchId,f)})}).next(()=>{const o=[],a=i.getReverseIterator();for(;a.hasNext();){const u=a.getNext(),l=u.key,c=u.value,f=$oe();c.forEach(d=>{if(!s.has(d)){const h=Voe(n.get(d),r.get(d));h!==null&&f.set(d,h),s=s.add(d)}}),o.push(this.documentOverlayCache.saveOverlays(t,l,f))}return Ce.waitFor(o)}).next(()=>r)}recalculateAndSaveOverlaysForDocumentKeys(t,n){return this.remoteDocumentCache.getEntries(t,n).next(r=>this.recalculateAndSaveOverlays(t,r))}getDocumentsMatchingQuery(t,n,r,i){return function(o){return dt.isDocumentKey(o.path)&&o.collectionGroup===null&&o.filters.length===0}(n)?this.getDocumentsMatchingDocumentQuery(t,n.path):qXe(n)?this.getDocumentsMatchingCollectionGroupQuery(t,n,r,i):this.getDocumentsMatchingCollectionQuery(t,n,r,i)}getNextDocuments(t,n,r,i){return this.remoteDocumentCache.getAllFromCollectionGroup(t,n,r,i).next(s=>{const o=i-s.size>0?this.documentOverlayCache.getOverlaysForCollectionGroup(t,n,r.largestBatchId,i-s.size):Ce.resolve(hd());let a=-1,u=s;return o.next(l=>Ce.forEach(l,(c,f)=>(a{u=u.insert(c,d)}))).next(()=>this.populateOverlays(t,l,s)).next(()=>this.computeViews(t,u,l,Kt())).next(c=>({batchId:a,changes:Doe(c)})))})}getDocumentsMatchingDocumentQuery(t,n){return this.getDocument(t,new dt(n)).next(r=>{let i=m0();return r.isFoundDocument()&&(i=i.insert(r.key,r)),i})}getDocumentsMatchingCollectionGroupQuery(t,n,r,i){const s=n.collectionGroup;let o=m0();return this.indexManager.getCollectionParents(t,s).next(a=>Ce.forEach(a,u=>{const l=function(f,d){return new Ax(d,null,f.explicitOrderBy.slice(),f.filters.slice(),f.limit,f.limitType,f.startAt,f.endAt)}(n,u.child(s));return this.getDocumentsMatchingCollectionQuery(t,l,r,i).next(c=>{c.forEach((f,d)=>{o=o.insert(f,d)})})}).next(()=>o))}getDocumentsMatchingCollectionQuery(t,n,r,i){let s;return this.documentOverlayCache.getOverlaysForCollection(t,n.path,r.largestBatchId).next(o=>(s=o,this.remoteDocumentCache.getDocumentsMatchingQuery(t,n,r,s,i))).next(o=>{s.forEach((u,l)=>{const c=l.getKey();o.get(c)===null&&(o=o.insert(c,qi.newInvalidDocument(c)))});let a=m0();return o.forEach((u,l)=>{const c=s.get(u);c!==void 0&&ey(c.mutation,l,wa.empty(),Zr.now()),Px(n,l)&&(a=a.insert(u,l))}),a})}}/** + */class BJe{constructor(t,n,r,i){this.remoteDocumentCache=t,this.mutationQueue=n,this.documentOverlayCache=r,this.indexManager=i}getDocument(t,n){let r=null;return this.documentOverlayCache.getOverlay(t,n).next(i=>(r=i,this.remoteDocumentCache.getEntry(t,n))).next(i=>(r!==null&&ey(r.mutation,i,wa.empty(),Zr.now()),i))}getDocuments(t,n){return this.remoteDocumentCache.getEntries(t,n).next(r=>this.getLocalViewOfDocuments(t,r,Kt()).next(()=>r))}getLocalViewOfDocuments(t,n,r=Kt()){const i=hd();return this.populateOverlays(t,i,n).next(()=>this.computeViews(t,n,i,r).next(s=>{let o=m0();return s.forEach((a,u)=>{o=o.insert(a,u.overlayedDocument)}),o}))}getOverlayedDocuments(t,n){const r=hd();return this.populateOverlays(t,r,n).next(()=>this.computeViews(t,n,r,Kt()))}populateOverlays(t,n,r){const i=[];return r.forEach(s=>{n.has(s)||i.push(s)}),this.documentOverlayCache.getOverlays(t,i).next(s=>{s.forEach((o,a)=>{n.set(o,a)})})}computeViews(t,n,r,i){let s=Fl();const o=Z0(),a=function(){return Z0()}();return n.forEach((u,l)=>{const c=r.get(l.key);i.has(l.key)&&(c===void 0||c.mutation instanceof dh)?s=s.insert(l.key,l):c!==void 0?(o.set(l.key,c.mutation.getFieldMask()),ey(c.mutation,l,c.mutation.getFieldMask(),Zr.now())):o.set(l.key,wa.empty())}),this.recalculateAndSaveOverlays(t,s).next(u=>(u.forEach((l,c)=>o.set(l,c)),n.forEach((l,c)=>{var f;return a.set(l,new FJe(c,(f=o.get(l))!==null&&f!==void 0?f:null))}),a))}recalculateAndSaveOverlays(t,n){const r=Z0();let i=new _r((o,a)=>o-a),s=Kt();return this.mutationQueue.getAllMutationBatchesAffectingDocumentKeys(t,n).next(o=>{for(const a of o)a.keys().forEach(u=>{const l=n.get(u);if(l===null)return;let c=r.get(u)||wa.empty();c=a.applyToLocalView(l,c),r.set(u,c);const f=(i.get(a.batchId)||Kt()).add(u);i=i.insert(a.batchId,f)})}).next(()=>{const o=[],a=i.getReverseIterator();for(;a.hasNext();){const u=a.getNext(),l=u.key,c=u.value,f=Doe();c.forEach(d=>{if(!s.has(d)){const h=Uoe(n.get(d),r.get(d));h!==null&&f.set(d,h),s=s.add(d)}}),o.push(this.documentOverlayCache.saveOverlays(t,l,f))}return Ce.waitFor(o)}).next(()=>r)}recalculateAndSaveOverlaysForDocumentKeys(t,n){return this.remoteDocumentCache.getEntries(t,n).next(r=>this.recalculateAndSaveOverlays(t,r))}getDocumentsMatchingQuery(t,n,r,i){return function(o){return dt.isDocumentKey(o.path)&&o.collectionGroup===null&&o.filters.length===0}(n)?this.getDocumentsMatchingDocumentQuery(t,n.path):qXe(n)?this.getDocumentsMatchingCollectionGroupQuery(t,n,r,i):this.getDocumentsMatchingCollectionQuery(t,n,r,i)}getNextDocuments(t,n,r,i){return this.remoteDocumentCache.getAllFromCollectionGroup(t,n,r,i).next(s=>{const o=i-s.size>0?this.documentOverlayCache.getOverlaysForCollectionGroup(t,n,r.largestBatchId,i-s.size):Ce.resolve(hd());let a=-1,u=s;return o.next(l=>Ce.forEach(l,(c,f)=>(a{u=u.insert(c,d)}))).next(()=>this.populateOverlays(t,l,s)).next(()=>this.computeViews(t,u,l,Kt())).next(c=>({batchId:a,changes:koe(c)})))})}getDocumentsMatchingDocumentQuery(t,n){return this.getDocument(t,new dt(n)).next(r=>{let i=m0();return r.isFoundDocument()&&(i=i.insert(r.key,r)),i})}getDocumentsMatchingCollectionGroupQuery(t,n,r,i){const s=n.collectionGroup;let o=m0();return this.indexManager.getCollectionParents(t,s).next(a=>Ce.forEach(a,u=>{const l=function(f,d){return new Ax(d,null,f.explicitOrderBy.slice(),f.filters.slice(),f.limit,f.limitType,f.startAt,f.endAt)}(n,u.child(s));return this.getDocumentsMatchingCollectionQuery(t,l,r,i).next(c=>{c.forEach((f,d)=>{o=o.insert(f,d)})})}).next(()=>o))}getDocumentsMatchingCollectionQuery(t,n,r,i){let s;return this.documentOverlayCache.getOverlaysForCollection(t,n.path,r.largestBatchId).next(o=>(s=o,this.remoteDocumentCache.getDocumentsMatchingQuery(t,n,r,s,i))).next(o=>{s.forEach((u,l)=>{const c=l.getKey();o.get(c)===null&&(o=o.insert(c,qi.newInvalidDocument(c)))});let a=m0();return o.forEach((u,l)=>{const c=s.get(u);c!==void 0&&ey(c.mutation,l,wa.empty(),Zr.now()),Px(n,l)&&(a=a.insert(u,l))}),a})}}/** * @license * Copyright 2020 Google LLC * @@ -1899,7 +1899,7 @@ Content-Type: `+l.contentType+`\r * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class KJe{constructor(){this.Ki=!1,this.$i=!1,this.Ui=100,this.Wi=8}initialize(t,n){this.Gi=t,this.indexManager=n,this.Ki=!0}getDocumentsMatchingQuery(t,n,r,i){const s={result:null};return this.zi(t,n).next(o=>{s.result=o}).next(()=>{if(!s.result)return this.ji(t,n,i,r).next(o=>{s.result=o})}).next(()=>{if(s.result)return;const o=new GJe;return this.Hi(t,n,o).next(a=>{if(s.result=a,this.$i)return this.Ji(t,n,o,a.size)})}).next(()=>s.result)}Ji(t,n,r,i){return r.documentReadCountthis.Wi*i?(Kg()<=nn.DEBUG&&Xe("QueryEngine","The SDK decides to create cache indexes for query:",$h(n),"as using cache indexes may help improve performance."),this.indexManager.createTargetIndexes(t,Su(n))):Ce.resolve())}zi(t,n){if(QV(n))return Ce.resolve(null);let r=Su(n);return this.indexManager.getIndexType(t,r).next(i=>i===0?null:(n.limit!==null&&i===1&&(n=VR(n,null,"F"),r=Su(n)),this.indexManager.getDocumentsMatchingTarget(t,r).next(s=>{const o=Kt(...s);return this.Gi.getDocuments(t,o).next(a=>this.indexManager.getMinOffset(t,r).next(u=>{const l=this.Yi(n,a);return this.Zi(n,l,o,u.readTime)?this.zi(t,VR(n,null,"F")):this.Xi(t,l,n,u)}))})))}ji(t,n,r,i){return QV(n)||i.isEqual(xt.min())?Ce.resolve(null):this.Gi.getDocuments(t,r).next(s=>{const o=this.Yi(n,s);return this.Zi(n,o,r,i)?Ce.resolve(null):(Kg()<=nn.DEBUG&&Xe("QueryEngine","Re-using previous result from %s to execute query: %s",i.toString(),$h(n)),this.Xi(t,o,n,xXe(i,-1)).next(a=>a))})}Yi(t,n){let r=new Di(Noe(t));return n.forEach((i,s)=>{Px(t,s)&&(r=r.add(s))}),r}Zi(t,n,r,i){if(t.limit===null)return!1;if(r.size!==n.size)return!0;const s=t.limitType==="F"?n.last():n.first();return!!s&&(s.hasPendingWrites||s.version.compareTo(i)>0)}Hi(t,n,r){return Kg()<=nn.DEBUG&&Xe("QueryEngine","Using full collection scan to execute query:",$h(n)),this.Gi.getDocumentsMatchingQuery(t,n,df.min(),r)}Xi(t,n,r,i){return this.Gi.getDocumentsMatchingQuery(t,r,i).next(s=>(n.forEach(o=>{s=s.insert(o.key,o)}),s))}}/** + */class KJe{constructor(){this.Ki=!1,this.$i=!1,this.Ui=100,this.Wi=8}initialize(t,n){this.Gi=t,this.indexManager=n,this.Ki=!0}getDocumentsMatchingQuery(t,n,r,i){const s={result:null};return this.zi(t,n).next(o=>{s.result=o}).next(()=>{if(!s.result)return this.ji(t,n,i,r).next(o=>{s.result=o})}).next(()=>{if(s.result)return;const o=new GJe;return this.Hi(t,n,o).next(a=>{if(s.result=a,this.$i)return this.Ji(t,n,o,a.size)})}).next(()=>s.result)}Ji(t,n,r,i){return r.documentReadCountthis.Wi*i?(Kg()<=nn.DEBUG&&Xe("QueryEngine","The SDK decides to create cache indexes for query:",$h(n),"as using cache indexes may help improve performance."),this.indexManager.createTargetIndexes(t,Su(n))):Ce.resolve())}zi(t,n){if(QV(n))return Ce.resolve(null);let r=Su(n);return this.indexManager.getIndexType(t,r).next(i=>i===0?null:(n.limit!==null&&i===1&&(n=VR(n,null,"F"),r=Su(n)),this.indexManager.getDocumentsMatchingTarget(t,r).next(s=>{const o=Kt(...s);return this.Gi.getDocuments(t,o).next(a=>this.indexManager.getMinOffset(t,r).next(u=>{const l=this.Yi(n,a);return this.Zi(n,l,o,u.readTime)?this.zi(t,VR(n,null,"F")):this.Xi(t,l,n,u)}))})))}ji(t,n,r,i){return QV(n)||i.isEqual(xt.min())?Ce.resolve(null):this.Gi.getDocuments(t,r).next(s=>{const o=this.Yi(n,s);return this.Zi(n,o,r,i)?Ce.resolve(null):(Kg()<=nn.DEBUG&&Xe("QueryEngine","Re-using previous result from %s to execute query: %s",i.toString(),$h(n)),this.Xi(t,o,n,xXe(i,-1)).next(a=>a))})}Yi(t,n){let r=new Di(Roe(t));return n.forEach((i,s)=>{Px(t,s)&&(r=r.add(s))}),r}Zi(t,n,r,i){if(t.limit===null)return!1;if(r.size!==n.size)return!0;const s=t.limitType==="F"?n.last():n.first();return!!s&&(s.hasPendingWrites||s.version.compareTo(i)>0)}Hi(t,n,r){return Kg()<=nn.DEBUG&&Xe("QueryEngine","Using full collection scan to execute query:",$h(n)),this.Gi.getDocumentsMatchingQuery(t,n,df.min(),r)}Xi(t,n,r,i){return this.Gi.getDocumentsMatchingQuery(t,r,i).next(s=>(n.forEach(o=>{s=s.insert(o.key,o)}),s))}}/** * @license * Copyright 2020 Google LLC * @@ -1914,7 +1914,7 @@ Content-Type: `+l.contentType+`\r * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class QJe{constructor(t,n,r,i){this.persistence=t,this.es=n,this.serializer=i,this.ts=new _r(Sn),this.ns=new lg(s=>O6(s),P6),this.rs=new Map,this.ss=t.getRemoteDocumentCache(),this.qr=t.getTargetCache(),this.Kr=t.getBundleCache(),this.os(r)}os(t){this.documentOverlayCache=this.persistence.getDocumentOverlayCache(t),this.indexManager=this.persistence.getIndexManager(t),this.mutationQueue=this.persistence.getMutationQueue(t,this.indexManager),this.localDocuments=new BJe(this.ss,this.mutationQueue,this.documentOverlayCache,this.indexManager),this.ss.setIndexManager(this.indexManager),this.es.initialize(this.localDocuments,this.indexManager)}collectGarbage(t){return this.persistence.runTransaction("Collect garbage","readwrite-primary",n=>t.collect(n,this.ts))}}function XJe(e,t,n,r){return new QJe(e,t,n,r)}async function eae(e,t){const n=Nt(e);return await n.persistence.runTransaction("Handle user change","readonly",r=>{let i;return n.mutationQueue.getAllMutationBatches(r).next(s=>(i=s,n.os(t),n.mutationQueue.getAllMutationBatches(r))).next(s=>{const o=[],a=[];let u=Kt();for(const l of i){o.push(l.batchId);for(const c of l.mutations)u=u.add(c.key)}for(const l of s){a.push(l.batchId);for(const c of l.mutations)u=u.add(c.key)}return n.localDocuments.getDocuments(r,u).next(l=>({_s:l,removedBatchIds:o,addedBatchIds:a}))})})}function JJe(e,t){const n=Nt(e);return n.persistence.runTransaction("Acknowledge batch","readwrite-primary",r=>{const i=t.batch.keys(),s=n.ss.newChangeBuffer({trackRemovals:!0});return function(a,u,l,c){const f=l.batch,d=f.keys();let h=Ce.resolve();return d.forEach(p=>{h=h.next(()=>c.getEntry(u,p)).next(m=>{const y=l.docVersions.get(p);Yn(y!==null),m.version.compareTo(y)<0&&(f.applyToRemoteDocument(m,l),m.isValidDocument()&&(m.setReadTime(l.commitVersion),c.addEntry(m)))})}),h.next(()=>a.mutationQueue.removeMutationBatch(u,f))}(n,r,t,s).next(()=>s.apply(r)).next(()=>n.mutationQueue.performConsistencyCheck(r)).next(()=>n.documentOverlayCache.removeOverlaysForBatchId(r,i,t.batch.batchId)).next(()=>n.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(r,function(a){let u=Kt();for(let l=0;l0&&(u=u.add(a.batch.mutations[l].key));return u}(t))).next(()=>n.localDocuments.getDocuments(r,i))})}function tae(e){const t=Nt(e);return t.persistence.runTransaction("Get last remote snapshot version","readonly",n=>t.qr.getLastRemoteSnapshotVersion(n))}function ZJe(e,t){const n=Nt(e),r=t.snapshotVersion;let i=n.ts;return n.persistence.runTransaction("Apply remote event","readwrite-primary",s=>{const o=n.ss.newChangeBuffer({trackRemovals:!0});i=n.ts;const a=[];t.targetChanges.forEach((c,f)=>{const d=i.get(f);if(!d)return;a.push(n.qr.removeMatchingKeys(s,c.removedDocuments,f).next(()=>n.qr.addMatchingKeys(s,c.addedDocuments,f)));let h=d.withSequenceNumber(s.currentSequenceNumber);t.targetMismatches.get(f)!==null?h=h.withResumeToken(es.EMPTY_BYTE_STRING,xt.min()).withLastLimboFreeSnapshotVersion(xt.min()):c.resumeToken.approximateByteSize()>0&&(h=h.withResumeToken(c.resumeToken,r)),i=i.insert(f,h),function(m,y,g){return m.resumeToken.approximateByteSize()===0||y.snapshotVersion.toMicroseconds()-m.snapshotVersion.toMicroseconds()>=3e8?!0:g.addedDocuments.size+g.modifiedDocuments.size+g.removedDocuments.size>0}(d,h,c)&&a.push(n.qr.updateTargetData(s,h))});let u=Fl(),l=Kt();if(t.documentUpdates.forEach(c=>{t.resolvedLimboDocuments.has(c)&&a.push(n.persistence.referenceDelegate.updateLimboDocument(s,c))}),a.push(eZe(s,o,t.documentUpdates).next(c=>{u=c.us,l=c.cs})),!r.isEqual(xt.min())){const c=n.qr.getLastRemoteSnapshotVersion(s).next(f=>n.qr.setTargetsMetadata(s,s.currentSequenceNumber,r));a.push(c)}return Ce.waitFor(a).next(()=>o.apply(s)).next(()=>n.localDocuments.getLocalViewOfDocuments(s,u,l)).next(()=>u)}).then(s=>(n.ts=i,s))}function eZe(e,t,n){let r=Kt(),i=Kt();return n.forEach(s=>r=r.add(s)),t.getEntries(e,r).next(s=>{let o=Fl();return n.forEach((a,u)=>{const l=s.get(a);u.isFoundDocument()!==l.isFoundDocument()&&(i=i.add(a)),u.isNoDocument()&&u.version.isEqual(xt.min())?(t.removeEntry(a,u.readTime),o=o.insert(a,u)):!l.isValidDocument()||u.version.compareTo(l.version)>0||u.version.compareTo(l.version)===0&&l.hasPendingWrites?(t.addEntry(u),o=o.insert(a,u)):Xe("LocalStore","Ignoring outdated watch update for ",a,". Current version:",l.version," Watch version:",u.version)}),{us:o,cs:i}})}function tZe(e,t){const n=Nt(e);return n.persistence.runTransaction("Get next mutation batch","readonly",r=>(t===void 0&&(t=-1),n.mutationQueue.getNextMutationBatchAfterBatchId(r,t)))}function nZe(e,t){const n=Nt(e);return n.persistence.runTransaction("Allocate target","readwrite",r=>{let i;return n.qr.getTargetData(r,t).next(s=>s?(i=s,Ce.resolve(i)):n.qr.allocateTargetId(r).next(o=>(i=new Cc(t,o,"TargetPurposeListen",r.currentSequenceNumber),n.qr.addTargetData(r,i).next(()=>i))))}).then(r=>{const i=n.ts.get(r.targetId);return(i===null||r.snapshotVersion.compareTo(i.snapshotVersion)>0)&&(n.ts=n.ts.insert(r.targetId,r),n.ns.set(t,r.targetId)),r})}async function YR(e,t,n){const r=Nt(e),i=r.ts.get(t),s=n?"readwrite":"readwrite-primary";try{n||await r.persistence.runTransaction("Release target",s,o=>r.persistence.referenceDelegate.removeTarget(o,i))}catch(o){if(!fv(o))throw o;Xe("LocalStore",`Failed to update sequence numbers for target ${t}: ${o}`)}r.ts=r.ts.remove(t),r.ns.delete(i.target)}function a7(e,t,n){const r=Nt(e);let i=xt.min(),s=Kt();return r.persistence.runTransaction("Execute query","readwrite",o=>function(u,l,c){const f=Nt(u),d=f.ns.get(c);return d!==void 0?Ce.resolve(f.ts.get(d)):f.qr.getTargetData(l,c)}(r,o,Su(t)).next(a=>{if(a)return i=a.lastLimboFreeSnapshotVersion,r.qr.getMatchingKeysForTargetId(o,a.targetId).next(u=>{s=u})}).next(()=>r.es.getDocumentsMatchingQuery(o,t,n?i:xt.min(),n?s:Kt())).next(a=>(rZe(r,GXe(t),a),{documents:a,ls:s})))}function rZe(e,t,n){let r=e.rs.get(t)||xt.min();n.forEach((i,s)=>{s.readTime.compareTo(r)>0&&(r=s.readTime)}),e.rs.set(t,r)}class u7{constructor(){this.activeTargetIds=eJe()}ds(t){this.activeTargetIds=this.activeTargetIds.add(t)}As(t){this.activeTargetIds=this.activeTargetIds.delete(t)}Es(){const t={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(t)}}class iZe{constructor(){this.eo=new u7,this.no={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(t){}updateMutationState(t,n,r){}addLocalQueryTarget(t){return this.eo.ds(t),this.no[t]||"not-current"}updateQueryState(t,n,r){this.no[t]=n}removeLocalQueryTarget(t){this.eo.As(t)}isLocalQueryTarget(t){return this.eo.activeTargetIds.has(t)}clearQueryState(t){delete this.no[t]}getAllActiveQueryTargets(){return this.eo.activeTargetIds}isActiveQueryTarget(t){return this.eo.activeTargetIds.has(t)}start(){return this.eo=new u7,Promise.resolve()}handleUserChange(t,n,r){}setOnlineState(t){}shutdown(){}writeSequenceNumber(t){}notifyBundleLoaded(t){}}/** + */class QJe{constructor(t,n,r,i){this.persistence=t,this.es=n,this.serializer=i,this.ts=new _r(Sn),this.ns=new lg(s=>O6(s),P6),this.rs=new Map,this.ss=t.getRemoteDocumentCache(),this.qr=t.getTargetCache(),this.Kr=t.getBundleCache(),this.os(r)}os(t){this.documentOverlayCache=this.persistence.getDocumentOverlayCache(t),this.indexManager=this.persistence.getIndexManager(t),this.mutationQueue=this.persistence.getMutationQueue(t,this.indexManager),this.localDocuments=new BJe(this.ss,this.mutationQueue,this.documentOverlayCache,this.indexManager),this.ss.setIndexManager(this.indexManager),this.es.initialize(this.localDocuments,this.indexManager)}collectGarbage(t){return this.persistence.runTransaction("Collect garbage","readwrite-primary",n=>t.collect(n,this.ts))}}function XJe(e,t,n,r){return new QJe(e,t,n,r)}async function Zoe(e,t){const n=Nt(e);return await n.persistence.runTransaction("Handle user change","readonly",r=>{let i;return n.mutationQueue.getAllMutationBatches(r).next(s=>(i=s,n.os(t),n.mutationQueue.getAllMutationBatches(r))).next(s=>{const o=[],a=[];let u=Kt();for(const l of i){o.push(l.batchId);for(const c of l.mutations)u=u.add(c.key)}for(const l of s){a.push(l.batchId);for(const c of l.mutations)u=u.add(c.key)}return n.localDocuments.getDocuments(r,u).next(l=>({_s:l,removedBatchIds:o,addedBatchIds:a}))})})}function JJe(e,t){const n=Nt(e);return n.persistence.runTransaction("Acknowledge batch","readwrite-primary",r=>{const i=t.batch.keys(),s=n.ss.newChangeBuffer({trackRemovals:!0});return function(a,u,l,c){const f=l.batch,d=f.keys();let h=Ce.resolve();return d.forEach(p=>{h=h.next(()=>c.getEntry(u,p)).next(m=>{const y=l.docVersions.get(p);Yn(y!==null),m.version.compareTo(y)<0&&(f.applyToRemoteDocument(m,l),m.isValidDocument()&&(m.setReadTime(l.commitVersion),c.addEntry(m)))})}),h.next(()=>a.mutationQueue.removeMutationBatch(u,f))}(n,r,t,s).next(()=>s.apply(r)).next(()=>n.mutationQueue.performConsistencyCheck(r)).next(()=>n.documentOverlayCache.removeOverlaysForBatchId(r,i,t.batch.batchId)).next(()=>n.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(r,function(a){let u=Kt();for(let l=0;l0&&(u=u.add(a.batch.mutations[l].key));return u}(t))).next(()=>n.localDocuments.getDocuments(r,i))})}function eae(e){const t=Nt(e);return t.persistence.runTransaction("Get last remote snapshot version","readonly",n=>t.qr.getLastRemoteSnapshotVersion(n))}function ZJe(e,t){const n=Nt(e),r=t.snapshotVersion;let i=n.ts;return n.persistence.runTransaction("Apply remote event","readwrite-primary",s=>{const o=n.ss.newChangeBuffer({trackRemovals:!0});i=n.ts;const a=[];t.targetChanges.forEach((c,f)=>{const d=i.get(f);if(!d)return;a.push(n.qr.removeMatchingKeys(s,c.removedDocuments,f).next(()=>n.qr.addMatchingKeys(s,c.addedDocuments,f)));let h=d.withSequenceNumber(s.currentSequenceNumber);t.targetMismatches.get(f)!==null?h=h.withResumeToken(es.EMPTY_BYTE_STRING,xt.min()).withLastLimboFreeSnapshotVersion(xt.min()):c.resumeToken.approximateByteSize()>0&&(h=h.withResumeToken(c.resumeToken,r)),i=i.insert(f,h),function(m,y,g){return m.resumeToken.approximateByteSize()===0||y.snapshotVersion.toMicroseconds()-m.snapshotVersion.toMicroseconds()>=3e8?!0:g.addedDocuments.size+g.modifiedDocuments.size+g.removedDocuments.size>0}(d,h,c)&&a.push(n.qr.updateTargetData(s,h))});let u=Fl(),l=Kt();if(t.documentUpdates.forEach(c=>{t.resolvedLimboDocuments.has(c)&&a.push(n.persistence.referenceDelegate.updateLimboDocument(s,c))}),a.push(eZe(s,o,t.documentUpdates).next(c=>{u=c.us,l=c.cs})),!r.isEqual(xt.min())){const c=n.qr.getLastRemoteSnapshotVersion(s).next(f=>n.qr.setTargetsMetadata(s,s.currentSequenceNumber,r));a.push(c)}return Ce.waitFor(a).next(()=>o.apply(s)).next(()=>n.localDocuments.getLocalViewOfDocuments(s,u,l)).next(()=>u)}).then(s=>(n.ts=i,s))}function eZe(e,t,n){let r=Kt(),i=Kt();return n.forEach(s=>r=r.add(s)),t.getEntries(e,r).next(s=>{let o=Fl();return n.forEach((a,u)=>{const l=s.get(a);u.isFoundDocument()!==l.isFoundDocument()&&(i=i.add(a)),u.isNoDocument()&&u.version.isEqual(xt.min())?(t.removeEntry(a,u.readTime),o=o.insert(a,u)):!l.isValidDocument()||u.version.compareTo(l.version)>0||u.version.compareTo(l.version)===0&&l.hasPendingWrites?(t.addEntry(u),o=o.insert(a,u)):Xe("LocalStore","Ignoring outdated watch update for ",a,". Current version:",l.version," Watch version:",u.version)}),{us:o,cs:i}})}function tZe(e,t){const n=Nt(e);return n.persistence.runTransaction("Get next mutation batch","readonly",r=>(t===void 0&&(t=-1),n.mutationQueue.getNextMutationBatchAfterBatchId(r,t)))}function nZe(e,t){const n=Nt(e);return n.persistence.runTransaction("Allocate target","readwrite",r=>{let i;return n.qr.getTargetData(r,t).next(s=>s?(i=s,Ce.resolve(i)):n.qr.allocateTargetId(r).next(o=>(i=new Cc(t,o,"TargetPurposeListen",r.currentSequenceNumber),n.qr.addTargetData(r,i).next(()=>i))))}).then(r=>{const i=n.ts.get(r.targetId);return(i===null||r.snapshotVersion.compareTo(i.snapshotVersion)>0)&&(n.ts=n.ts.insert(r.targetId,r),n.ns.set(t,r.targetId)),r})}async function YR(e,t,n){const r=Nt(e),i=r.ts.get(t),s=n?"readwrite":"readwrite-primary";try{n||await r.persistence.runTransaction("Release target",s,o=>r.persistence.referenceDelegate.removeTarget(o,i))}catch(o){if(!fv(o))throw o;Xe("LocalStore",`Failed to update sequence numbers for target ${t}: ${o}`)}r.ts=r.ts.remove(t),r.ns.delete(i.target)}function a7(e,t,n){const r=Nt(e);let i=xt.min(),s=Kt();return r.persistence.runTransaction("Execute query","readwrite",o=>function(u,l,c){const f=Nt(u),d=f.ns.get(c);return d!==void 0?Ce.resolve(f.ts.get(d)):f.qr.getTargetData(l,c)}(r,o,Su(t)).next(a=>{if(a)return i=a.lastLimboFreeSnapshotVersion,r.qr.getMatchingKeysForTargetId(o,a.targetId).next(u=>{s=u})}).next(()=>r.es.getDocumentsMatchingQuery(o,t,n?i:xt.min(),n?s:Kt())).next(a=>(rZe(r,GXe(t),a),{documents:a,ls:s})))}function rZe(e,t,n){let r=e.rs.get(t)||xt.min();n.forEach((i,s)=>{s.readTime.compareTo(r)>0&&(r=s.readTime)}),e.rs.set(t,r)}class u7{constructor(){this.activeTargetIds=eJe()}ds(t){this.activeTargetIds=this.activeTargetIds.add(t)}As(t){this.activeTargetIds=this.activeTargetIds.delete(t)}Es(){const t={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(t)}}class iZe{constructor(){this.eo=new u7,this.no={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(t){}updateMutationState(t,n,r){}addLocalQueryTarget(t){return this.eo.ds(t),this.no[t]||"not-current"}updateQueryState(t,n,r){this.no[t]=n}removeLocalQueryTarget(t){this.eo.As(t)}isLocalQueryTarget(t){return this.eo.activeTargetIds.has(t)}clearQueryState(t){delete this.no[t]}getAllActiveQueryTargets(){return this.eo.activeTargetIds}isActiveQueryTarget(t){return this.eo.activeTargetIds.has(t)}start(){return this.eo=new u7,Promise.resolve()}handleUserChange(t,n,r){}setOnlineState(t){}shutdown(){}writeSequenceNumber(t){}notifyBundleLoaded(t){}}/** * @license * Copyright 2019 Google LLC * @@ -2004,7 +2004,7 @@ Content-Type: `+l.contentType+`\r * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const Ui="WebChannelConnection";class uZe extends class{constructor(n){this.databaseInfo=n,this.databaseId=n.databaseId;const r=n.ssl?"https":"http",i=encodeURIComponent(this.databaseId.projectId),s=encodeURIComponent(this.databaseId.database);this.mo=r+"://"+n.host,this.fo=`projects/${i}/databases/${s}`,this.po=this.databaseId.database==="(default)"?`project_id=${i}`:`project_id=${i}&database_id=${s}`}get yo(){return!1}wo(n,r,i,s,o){const a=SO(),u=this.So(n,r);Xe("RestConnection",`Sending RPC '${n}' ${a}:`,u,i);const l={"google-cloud-resource-prefix":this.fo,"x-goog-request-params":this.po};return this.bo(l,s,o),this.Do(n,u,l,i).then(c=>(Xe("RestConnection",`Received RPC '${n}' ${a}: `,c),c),c=>{throw i_("RestConnection",`RPC '${n}' ${a} failed with error: `,c,"url: ",u,"request:",i),c})}Co(n,r,i,s,o,a){return this.wo(n,r,i,s,o)}bo(n,r,i){n["X-Goog-Api-Client"]=function(){return"gl-js/ fire/"+ag}(),n["Content-Type"]="text/plain",this.databaseInfo.appId&&(n["X-Firebase-GMPID"]=this.databaseInfo.appId),r&&r.headers.forEach((s,o)=>n[o]=s),i&&i.headers.forEach((s,o)=>n[o]=s)}So(n,r){const i=oZe[n];return`${this.mo}/v1/${r}:${i}`}}{constructor(t){super(t),this.forceLongPolling=t.forceLongPolling,this.autoDetectLongPolling=t.autoDetectLongPolling,this.useFetchStreams=t.useFetchStreams,this.longPollingOptions=t.longPollingOptions}Do(t,n,r,i){const s=SO();return new Promise((o,a)=>{const u=new mXe;u.setWithCredentials(!0),u.listenOnce(hXe.COMPLETE,()=>{try{switch(u.getLastErrorCode()){case wO.NO_ERROR:const c=u.getResponseJson();Xe(Ui,`XHR for RPC '${t}' ${s} received:`,JSON.stringify(c)),o(c);break;case wO.TIMEOUT:Xe(Ui,`RPC '${t}' ${s} timed out`),a(new tt(xe.DEADLINE_EXCEEDED,"Request time out"));break;case wO.HTTP_ERROR:const f=u.getStatus();if(Xe(Ui,`RPC '${t}' ${s} failed with status:`,f,"response text:",u.getResponseText()),f>0){let d=u.getResponseJson();Array.isArray(d)&&(d=d[0]);const h=d==null?void 0:d.error;if(h&&h.status&&h.message){const p=function(y){const g=y.toLowerCase().replace(/_/g,"-");return Object.values(xe).indexOf(g)>=0?g:xe.UNKNOWN}(h.status);a(new tt(p,h.message))}else a(new tt(xe.UNKNOWN,"Server responded with status "+u.getStatus()))}else a(new tt(xe.UNAVAILABLE,"Connection failed."));break;default:_t()}}finally{Xe(Ui,`RPC '${t}' ${s} completed.`)}});const l=JSON.stringify(i);Xe(Ui,`RPC '${t}' ${s} sending request:`,i),u.send(n,"POST",l,r,15)})}vo(t,n,r){const i=SO(),s=[this.mo,"/","google.firestore.v1.Firestore","/",t,"/channel"],o=fXe(),a=dXe(),u={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:`projects/${this.databaseId.projectId}/databases/${this.databaseId.database}`},sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling,detectBufferingProxy:this.autoDetectLongPolling},l=this.longPollingOptions.timeoutSeconds;l!==void 0&&(u.longPollingTimeout=Math.round(1e3*l)),this.useFetchStreams&&(u.useFetchStreams=!0),this.bo(u.initMessageHeaders,n,r),u.encodeInitMessageHeaders=!0;const c=s.join("");Xe(Ui,`Creating RPC '${t}' stream ${i}: ${c}`,u);const f=o.createWebChannel(c,u);let d=!1,h=!1;const p=new aZe({co:y=>{h?Xe(Ui,`Not sending because RPC '${t}' stream ${i} is closed:`,y):(d||(Xe(Ui,`Opening RPC '${t}' stream ${i} transport.`),f.open(),d=!0),Xe(Ui,`RPC '${t}' stream ${i} sending:`,y),f.send(y))},lo:()=>f.close()}),m=(y,g,_)=>{y.listen(g,b=>{try{_(b)}catch(T){setTimeout(()=>{throw T},0)}})};return m(f,N1.EventType.OPEN,()=>{h||Xe(Ui,`RPC '${t}' stream ${i} transport opened.`)}),m(f,N1.EventType.CLOSE,()=>{h||(h=!0,Xe(Ui,`RPC '${t}' stream ${i} transport closed`),p.Ro())}),m(f,N1.EventType.ERROR,y=>{h||(h=!0,i_(Ui,`RPC '${t}' stream ${i} transport errored:`,y),p.Ro(new tt(xe.UNAVAILABLE,"The operation could not be completed")))}),m(f,N1.EventType.MESSAGE,y=>{var g;if(!h){const _=y.data[0];Yn(!!_);const b=_,T=b.error||((g=b[0])===null||g===void 0?void 0:g.error);if(T){Xe(Ui,`RPC '${t}' stream ${i} received error:`,T);const I=T.status;let E=function(P){const V=Mr[P];if(V!==void 0)return Woe(V)}(I),S=T.message;E===void 0&&(E=xe.INTERNAL,S="Unknown error status: "+I+" with message "+T.message),h=!0,p.Ro(new tt(E,S)),f.close()}else Xe(Ui,`RPC '${t}' stream ${i} received:`,_),p.Vo(_)}}),m(a,pXe.STAT_EVENT,y=>{y.stat===jV.PROXY?Xe(Ui,`RPC '${t}' stream ${i} detected buffering proxy`):y.stat===jV.NOPROXY&&Xe(Ui,`RPC '${t}' stream ${i} detected no buffering proxy`)}),setTimeout(()=>{p.Ao()},0),p}}function IO(){return typeof document<"u"?document:null}/** + */const Ui="WebChannelConnection";class uZe extends class{constructor(n){this.databaseInfo=n,this.databaseId=n.databaseId;const r=n.ssl?"https":"http",i=encodeURIComponent(this.databaseId.projectId),s=encodeURIComponent(this.databaseId.database);this.mo=r+"://"+n.host,this.fo=`projects/${i}/databases/${s}`,this.po=this.databaseId.database==="(default)"?`project_id=${i}`:`project_id=${i}&database_id=${s}`}get yo(){return!1}wo(n,r,i,s,o){const a=SO(),u=this.So(n,r);Xe("RestConnection",`Sending RPC '${n}' ${a}:`,u,i);const l={"google-cloud-resource-prefix":this.fo,"x-goog-request-params":this.po};return this.bo(l,s,o),this.Do(n,u,l,i).then(c=>(Xe("RestConnection",`Received RPC '${n}' ${a}: `,c),c),c=>{throw i_("RestConnection",`RPC '${n}' ${a} failed with error: `,c,"url: ",u,"request:",i),c})}Co(n,r,i,s,o,a){return this.wo(n,r,i,s,o)}bo(n,r,i){n["X-Goog-Api-Client"]=function(){return"gl-js/ fire/"+ag}(),n["Content-Type"]="text/plain",this.databaseInfo.appId&&(n["X-Firebase-GMPID"]=this.databaseInfo.appId),r&&r.headers.forEach((s,o)=>n[o]=s),i&&i.headers.forEach((s,o)=>n[o]=s)}So(n,r){const i=oZe[n];return`${this.mo}/v1/${r}:${i}`}}{constructor(t){super(t),this.forceLongPolling=t.forceLongPolling,this.autoDetectLongPolling=t.autoDetectLongPolling,this.useFetchStreams=t.useFetchStreams,this.longPollingOptions=t.longPollingOptions}Do(t,n,r,i){const s=SO();return new Promise((o,a)=>{const u=new mXe;u.setWithCredentials(!0),u.listenOnce(hXe.COMPLETE,()=>{try{switch(u.getLastErrorCode()){case wO.NO_ERROR:const c=u.getResponseJson();Xe(Ui,`XHR for RPC '${t}' ${s} received:`,JSON.stringify(c)),o(c);break;case wO.TIMEOUT:Xe(Ui,`RPC '${t}' ${s} timed out`),a(new tt(xe.DEADLINE_EXCEEDED,"Request time out"));break;case wO.HTTP_ERROR:const f=u.getStatus();if(Xe(Ui,`RPC '${t}' ${s} failed with status:`,f,"response text:",u.getResponseText()),f>0){let d=u.getResponseJson();Array.isArray(d)&&(d=d[0]);const h=d==null?void 0:d.error;if(h&&h.status&&h.message){const p=function(y){const g=y.toLowerCase().replace(/_/g,"-");return Object.values(xe).indexOf(g)>=0?g:xe.UNKNOWN}(h.status);a(new tt(p,h.message))}else a(new tt(xe.UNKNOWN,"Server responded with status "+u.getStatus()))}else a(new tt(xe.UNAVAILABLE,"Connection failed."));break;default:_t()}}finally{Xe(Ui,`RPC '${t}' ${s} completed.`)}});const l=JSON.stringify(i);Xe(Ui,`RPC '${t}' ${s} sending request:`,i),u.send(n,"POST",l,r,15)})}vo(t,n,r){const i=SO(),s=[this.mo,"/","google.firestore.v1.Firestore","/",t,"/channel"],o=fXe(),a=dXe(),u={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:`projects/${this.databaseId.projectId}/databases/${this.databaseId.database}`},sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling,detectBufferingProxy:this.autoDetectLongPolling},l=this.longPollingOptions.timeoutSeconds;l!==void 0&&(u.longPollingTimeout=Math.round(1e3*l)),this.useFetchStreams&&(u.useFetchStreams=!0),this.bo(u.initMessageHeaders,n,r),u.encodeInitMessageHeaders=!0;const c=s.join("");Xe(Ui,`Creating RPC '${t}' stream ${i}: ${c}`,u);const f=o.createWebChannel(c,u);let d=!1,h=!1;const p=new aZe({co:y=>{h?Xe(Ui,`Not sending because RPC '${t}' stream ${i} is closed:`,y):(d||(Xe(Ui,`Opening RPC '${t}' stream ${i} transport.`),f.open(),d=!0),Xe(Ui,`RPC '${t}' stream ${i} sending:`,y),f.send(y))},lo:()=>f.close()}),m=(y,g,_)=>{y.listen(g,b=>{try{_(b)}catch(T){setTimeout(()=>{throw T},0)}})};return m(f,N1.EventType.OPEN,()=>{h||Xe(Ui,`RPC '${t}' stream ${i} transport opened.`)}),m(f,N1.EventType.CLOSE,()=>{h||(h=!0,Xe(Ui,`RPC '${t}' stream ${i} transport closed`),p.Ro())}),m(f,N1.EventType.ERROR,y=>{h||(h=!0,i_(Ui,`RPC '${t}' stream ${i} transport errored:`,y),p.Ro(new tt(xe.UNAVAILABLE,"The operation could not be completed")))}),m(f,N1.EventType.MESSAGE,y=>{var g;if(!h){const _=y.data[0];Yn(!!_);const b=_,T=b.error||((g=b[0])===null||g===void 0?void 0:g.error);if(T){Xe(Ui,`RPC '${t}' stream ${i} received error:`,T);const I=T.status;let E=function(P){const V=Mr[P];if(V!==void 0)return Hoe(V)}(I),S=T.message;E===void 0&&(E=xe.INTERNAL,S="Unknown error status: "+I+" with message "+T.message),h=!0,p.Ro(new tt(E,S)),f.close()}else Xe(Ui,`RPC '${t}' stream ${i} received:`,_),p.Vo(_)}}),m(a,pXe.STAT_EVENT,y=>{y.stat===jV.PROXY?Xe(Ui,`RPC '${t}' stream ${i} detected buffering proxy`):y.stat===jV.NOPROXY&&Xe(Ui,`RPC '${t}' stream ${i} detected no buffering proxy`)}),setTimeout(()=>{p.Ao()},0),p}}function IO(){return typeof document<"u"?document:null}/** * @license * Copyright 2020 Google LLC * @@ -2034,7 +2034,7 @@ Content-Type: `+l.contentType+`\r * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class nae{constructor(t,n,r=1e3,i=1.5,s=6e4){this.si=t,this.timerId=n,this.Fo=r,this.Mo=i,this.xo=s,this.Oo=0,this.No=null,this.Bo=Date.now(),this.reset()}reset(){this.Oo=0}Lo(){this.Oo=this.xo}ko(t){this.cancel();const n=Math.floor(this.Oo+this.qo()),r=Math.max(0,Date.now()-this.Bo),i=Math.max(0,n-r);i>0&&Xe("ExponentialBackoff",`Backing off for ${i} ms (base delay: ${this.Oo} ms, delay with jitter: ${n} ms, last attempt: ${r} ms ago)`),this.No=this.si.enqueueAfterDelay(this.timerId,i,()=>(this.Bo=Date.now(),t())),this.Oo*=this.Mo,this.Oothis.xo&&(this.Oo=this.xo)}Qo(){this.No!==null&&(this.No.skipDelay(),this.No=null)}cancel(){this.No!==null&&(this.No.cancel(),this.No=null)}qo(){return(Math.random()-.5)*this.Oo}}/** + */class tae{constructor(t,n,r=1e3,i=1.5,s=6e4){this.si=t,this.timerId=n,this.Fo=r,this.Mo=i,this.xo=s,this.Oo=0,this.No=null,this.Bo=Date.now(),this.reset()}reset(){this.Oo=0}Lo(){this.Oo=this.xo}ko(t){this.cancel();const n=Math.floor(this.Oo+this.qo()),r=Math.max(0,Date.now()-this.Bo),i=Math.max(0,n-r);i>0&&Xe("ExponentialBackoff",`Backing off for ${i} ms (base delay: ${this.Oo} ms, delay with jitter: ${n} ms, last attempt: ${r} ms ago)`),this.No=this.si.enqueueAfterDelay(this.timerId,i,()=>(this.Bo=Date.now(),t())),this.Oo*=this.Mo,this.Oothis.xo&&(this.Oo=this.xo)}Qo(){this.No!==null&&(this.No.skipDelay(),this.No=null)}cancel(){this.No!==null&&(this.No.cancel(),this.No=null)}qo(){return(Math.random()-.5)*this.Oo}}/** * @license * Copyright 2017 Google LLC * @@ -2049,7 +2049,7 @@ Content-Type: `+l.contentType+`\r * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class rae{constructor(t,n,r,i,s,o,a,u){this.si=t,this.Ko=r,this.$o=i,this.connection=s,this.authCredentialsProvider=o,this.appCheckCredentialsProvider=a,this.listener=u,this.state=0,this.Uo=0,this.Wo=null,this.Go=null,this.stream=null,this.zo=new nae(t,n)}jo(){return this.state===1||this.state===5||this.Ho()}Ho(){return this.state===2||this.state===3}start(){this.state!==4?this.auth():this.Jo()}async stop(){this.jo()&&await this.close(0)}Yo(){this.state=0,this.zo.reset()}Zo(){this.Ho()&&this.Wo===null&&(this.Wo=this.si.enqueueAfterDelay(this.Ko,6e4,()=>this.Xo()))}e_(t){this.t_(),this.stream.send(t)}async Xo(){if(this.Ho())return this.close(0)}t_(){this.Wo&&(this.Wo.cancel(),this.Wo=null)}n_(){this.Go&&(this.Go.cancel(),this.Go=null)}async close(t,n){this.t_(),this.n_(),this.zo.cancel(),this.Uo++,t!==4?this.zo.reset():n&&n.code===xe.RESOURCE_EXHAUSTED?(Ml(n.toString()),Ml("Using maximum backoff delay to prevent overloading the backend."),this.zo.Lo()):n&&n.code===xe.UNAUTHENTICATED&&this.state!==3&&(this.authCredentialsProvider.invalidateToken(),this.appCheckCredentialsProvider.invalidateToken()),this.stream!==null&&(this.r_(),this.stream.close(),this.stream=null),this.state=t,await this.listener.Io(n)}r_(){}auth(){this.state=1;const t=this.i_(this.Uo),n=this.Uo;Promise.all([this.authCredentialsProvider.getToken(),this.appCheckCredentialsProvider.getToken()]).then(([r,i])=>{this.Uo===n&&this.s_(r,i)},r=>{t(()=>{const i=new tt(xe.UNKNOWN,"Fetching auth token failed: "+r.message);return this.o_(i)})})}s_(t,n){const r=this.i_(this.Uo);this.stream=this.__(t,n),this.stream.ho(()=>{r(()=>(this.state=2,this.Go=this.si.enqueueAfterDelay(this.$o,1e4,()=>(this.Ho()&&(this.state=3),Promise.resolve())),this.listener.ho()))}),this.stream.Io(i=>{r(()=>this.o_(i))}),this.stream.onMessage(i=>{r(()=>this.onMessage(i))})}Jo(){this.state=5,this.zo.ko(async()=>{this.state=0,this.start()})}o_(t){return Xe("PersistentStream",`close with error: ${t}`),this.stream=null,this.close(4,t)}i_(t){return n=>{this.si.enqueueAndForget(()=>this.Uo===t?n():(Xe("PersistentStream","stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve()))}}}class lZe extends rae{constructor(t,n,r,i,s,o){super(t,"listen_stream_connection_backoff","listen_stream_idle","health_check_timeout",n,r,i,o),this.serializer=s}__(t,n){return this.connection.vo("Listen",t,n)}onMessage(t){this.zo.reset();const n=wJe(this.serializer,t),r=function(s){if(!("targetChange"in s))return xt.min();const o=s.targetChange;return o.targetIds&&o.targetIds.length?xt.min():o.readTime?Iu(o.readTime):xt.min()}(t);return this.listener.a_(n,r)}u_(t){const n={};n.database=qR(this.serializer),n.addTarget=function(s,o){let a;const u=o.target;if(a=UR(u)?{documents:IJe(s,u)}:{query:xJe(s,u)},a.targetId=o.targetId,o.resumeToken.approximateByteSize()>0){a.resumeToken=Goe(s,o.resumeToken);const l=zR(s,o.expectedCount);l!==null&&(a.expectedCount=l)}else if(o.snapshotVersion.compareTo(xt.min())>0){a.readTime=iS(s,o.snapshotVersion.toTimestamp());const l=zR(s,o.expectedCount);l!==null&&(a.expectedCount=l)}return a}(this.serializer,t);const r=AJe(this.serializer,t);r&&(n.labels=r),this.e_(n)}c_(t){const n={};n.database=qR(this.serializer),n.removeTarget=t,this.e_(n)}}class cZe extends rae{constructor(t,n,r,i,s,o){super(t,"write_stream_connection_backoff","write_stream_idle","health_check_timeout",n,r,i,o),this.serializer=s,this.l_=!1}get h_(){return this.l_}start(){this.l_=!1,this.lastStreamToken=void 0,super.start()}r_(){this.l_&&this.P_([])}__(t,n){return this.connection.vo("Write",t,n)}onMessage(t){if(Yn(!!t.streamToken),this.lastStreamToken=t.streamToken,this.l_){this.zo.reset();const n=SJe(t.writeResults,t.commitTime),r=Iu(t.commitTime);return this.listener.I_(r,n)}return Yn(!t.writeResults||t.writeResults.length===0),this.l_=!0,this.listener.T_()}E_(){const t={};t.database=qR(this.serializer),this.e_(t)}P_(t){const n={streamToken:this.lastStreamToken,writes:t.map(r=>TJe(this.serializer,r))};this.e_(n)}}/** + */class nae{constructor(t,n,r,i,s,o,a,u){this.si=t,this.Ko=r,this.$o=i,this.connection=s,this.authCredentialsProvider=o,this.appCheckCredentialsProvider=a,this.listener=u,this.state=0,this.Uo=0,this.Wo=null,this.Go=null,this.stream=null,this.zo=new tae(t,n)}jo(){return this.state===1||this.state===5||this.Ho()}Ho(){return this.state===2||this.state===3}start(){this.state!==4?this.auth():this.Jo()}async stop(){this.jo()&&await this.close(0)}Yo(){this.state=0,this.zo.reset()}Zo(){this.Ho()&&this.Wo===null&&(this.Wo=this.si.enqueueAfterDelay(this.Ko,6e4,()=>this.Xo()))}e_(t){this.t_(),this.stream.send(t)}async Xo(){if(this.Ho())return this.close(0)}t_(){this.Wo&&(this.Wo.cancel(),this.Wo=null)}n_(){this.Go&&(this.Go.cancel(),this.Go=null)}async close(t,n){this.t_(),this.n_(),this.zo.cancel(),this.Uo++,t!==4?this.zo.reset():n&&n.code===xe.RESOURCE_EXHAUSTED?(Ml(n.toString()),Ml("Using maximum backoff delay to prevent overloading the backend."),this.zo.Lo()):n&&n.code===xe.UNAUTHENTICATED&&this.state!==3&&(this.authCredentialsProvider.invalidateToken(),this.appCheckCredentialsProvider.invalidateToken()),this.stream!==null&&(this.r_(),this.stream.close(),this.stream=null),this.state=t,await this.listener.Io(n)}r_(){}auth(){this.state=1;const t=this.i_(this.Uo),n=this.Uo;Promise.all([this.authCredentialsProvider.getToken(),this.appCheckCredentialsProvider.getToken()]).then(([r,i])=>{this.Uo===n&&this.s_(r,i)},r=>{t(()=>{const i=new tt(xe.UNKNOWN,"Fetching auth token failed: "+r.message);return this.o_(i)})})}s_(t,n){const r=this.i_(this.Uo);this.stream=this.__(t,n),this.stream.ho(()=>{r(()=>(this.state=2,this.Go=this.si.enqueueAfterDelay(this.$o,1e4,()=>(this.Ho()&&(this.state=3),Promise.resolve())),this.listener.ho()))}),this.stream.Io(i=>{r(()=>this.o_(i))}),this.stream.onMessage(i=>{r(()=>this.onMessage(i))})}Jo(){this.state=5,this.zo.ko(async()=>{this.state=0,this.start()})}o_(t){return Xe("PersistentStream",`close with error: ${t}`),this.stream=null,this.close(4,t)}i_(t){return n=>{this.si.enqueueAndForget(()=>this.Uo===t?n():(Xe("PersistentStream","stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve()))}}}class lZe extends nae{constructor(t,n,r,i,s,o){super(t,"listen_stream_connection_backoff","listen_stream_idle","health_check_timeout",n,r,i,o),this.serializer=s}__(t,n){return this.connection.vo("Listen",t,n)}onMessage(t){this.zo.reset();const n=wJe(this.serializer,t),r=function(s){if(!("targetChange"in s))return xt.min();const o=s.targetChange;return o.targetIds&&o.targetIds.length?xt.min():o.readTime?Iu(o.readTime):xt.min()}(t);return this.listener.a_(n,r)}u_(t){const n={};n.database=qR(this.serializer),n.addTarget=function(s,o){let a;const u=o.target;if(a=UR(u)?{documents:IJe(s,u)}:{query:xJe(s,u)},a.targetId=o.targetId,o.resumeToken.approximateByteSize()>0){a.resumeToken=Yoe(s,o.resumeToken);const l=zR(s,o.expectedCount);l!==null&&(a.expectedCount=l)}else if(o.snapshotVersion.compareTo(xt.min())>0){a.readTime=iS(s,o.snapshotVersion.toTimestamp());const l=zR(s,o.expectedCount);l!==null&&(a.expectedCount=l)}return a}(this.serializer,t);const r=AJe(this.serializer,t);r&&(n.labels=r),this.e_(n)}c_(t){const n={};n.database=qR(this.serializer),n.removeTarget=t,this.e_(n)}}class cZe extends nae{constructor(t,n,r,i,s,o){super(t,"write_stream_connection_backoff","write_stream_idle","health_check_timeout",n,r,i,o),this.serializer=s,this.l_=!1}get h_(){return this.l_}start(){this.l_=!1,this.lastStreamToken=void 0,super.start()}r_(){this.l_&&this.P_([])}__(t,n){return this.connection.vo("Write",t,n)}onMessage(t){if(Yn(!!t.streamToken),this.lastStreamToken=t.streamToken,this.l_){this.zo.reset();const n=SJe(t.writeResults,t.commitTime),r=Iu(t.commitTime);return this.listener.I_(r,n)}return Yn(!t.writeResults||t.writeResults.length===0),this.l_=!0,this.listener.T_()}E_(){const t={};t.database=qR(this.serializer),this.e_(t)}P_(t){const n={streamToken:this.lastStreamToken,writes:t.map(r=>TJe(this.serializer,r))};this.e_(n)}}/** * @license * Copyright 2017 Google LLC * @@ -2080,7 +2080,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class hZe{constructor(t,n,r,i,s){this.localStore=t,this.datastore=n,this.asyncQueue=r,this.remoteSyncer={},this.b_=[],this.D_=new Map,this.C_=new Set,this.v_=[],this.F_=s,this.F_.ro(o=>{r.enqueueAndForget(async()=>{hh(this)&&(Xe("RemoteStore","Restarting streams for network reachability change."),await async function(u){const l=Nt(u);l.C_.add(4),await mv(l),l.M_.set("Unknown"),l.C_.delete(4),await pv(l)}(this))})}),this.M_=new dZe(r,i)}}async function pv(e){if(hh(e))for(const t of e.v_)await t(!0)}async function mv(e){for(const t of e.v_)await t(!1)}function iae(e,t){const n=Nt(e);n.D_.has(t.targetId)||(n.D_.set(t.targetId,t),j6(n)?B6(n):cg(n).Ho()&&F6(n,t))}function sae(e,t){const n=Nt(e),r=cg(n);n.D_.delete(t),r.Ho()&&oae(n,t),n.D_.size===0&&(r.Ho()?r.Zo():hh(n)&&n.M_.set("Unknown"))}function F6(e,t){if(e.x_.Oe(t.targetId),t.resumeToken.approximateByteSize()>0||t.snapshotVersion.compareTo(xt.min())>0){const n=e.remoteSyncer.getRemoteKeysForTarget(t.targetId).size;t=t.withExpectedCount(n)}cg(e).u_(t)}function oae(e,t){e.x_.Oe(t),cg(e).c_(t)}function B6(e){e.x_=new mJe({getRemoteKeysForTarget:t=>e.remoteSyncer.getRemoteKeysForTarget(t),_t:t=>e.D_.get(t)||null,nt:()=>e.datastore.serializer.databaseId}),cg(e).start(),e.M_.g_()}function j6(e){return hh(e)&&!cg(e).jo()&&e.D_.size>0}function hh(e){return Nt(e).C_.size===0}function aae(e){e.x_=void 0}async function pZe(e){e.D_.forEach((t,n)=>{F6(e,t)})}async function mZe(e,t){aae(e),j6(e)?(e.M_.w_(t),B6(e)):e.M_.set("Unknown")}async function gZe(e,t,n){if(e.M_.set("Online"),t instanceof Yoe&&t.state===2&&t.cause)try{await async function(i,s){const o=s.cause;for(const a of s.targetIds)i.D_.has(a)&&(await i.remoteSyncer.rejectListen(a,o),i.D_.delete(a),i.x_.removeTarget(a))}(e,t)}catch(r){Xe("RemoteStore","Failed to remove targets %s: %s ",t.targetIds.join(","),r),await sS(e,r)}else if(t instanceof Sb?e.x_.$e(t):t instanceof qoe?e.x_.Je(t):e.x_.Ge(t),!n.isEqual(xt.min()))try{const r=await tae(e.localStore);n.compareTo(r)>=0&&await function(s,o){const a=s.x_.it(o);return a.targetChanges.forEach((u,l)=>{if(u.resumeToken.approximateByteSize()>0){const c=s.D_.get(l);c&&s.D_.set(l,c.withResumeToken(u.resumeToken,o))}}),a.targetMismatches.forEach((u,l)=>{const c=s.D_.get(u);if(!c)return;s.D_.set(u,c.withResumeToken(es.EMPTY_BYTE_STRING,c.snapshotVersion)),oae(s,u);const f=new Cc(c.target,u,l,c.sequenceNumber);F6(s,f)}),s.remoteSyncer.applyRemoteEvent(a)}(e,n)}catch(r){Xe("RemoteStore","Failed to raise snapshot:",r),await sS(e,r)}}async function sS(e,t,n){if(!fv(t))throw t;e.C_.add(1),await mv(e),e.M_.set("Offline"),n||(n=()=>tae(e.localStore)),e.asyncQueue.enqueueRetryable(async()=>{Xe("RemoteStore","Retrying IndexedDB access"),await n(),e.C_.delete(1),await pv(e)})}function uae(e,t){return t().catch(n=>sS(e,n,t))}async function $x(e){const t=Nt(e),n=pf(t);let r=t.b_.length>0?t.b_[t.b_.length-1].batchId:-1;for(;yZe(t);)try{const i=await tZe(t.localStore,r);if(i===null){t.b_.length===0&&n.Zo();break}r=i.batchId,_Ze(t,i)}catch(i){await sS(t,i)}lae(t)&&cae(t)}function yZe(e){return hh(e)&&e.b_.length<10}function _Ze(e,t){e.b_.push(t);const n=pf(e);n.Ho()&&n.h_&&n.P_(t.mutations)}function lae(e){return hh(e)&&!pf(e).jo()&&e.b_.length>0}function cae(e){pf(e).start()}async function vZe(e){pf(e).E_()}async function bZe(e){const t=pf(e);for(const n of e.b_)t.P_(n.mutations)}async function EZe(e,t,n){const r=e.b_.shift(),i=N6.from(r,t,n);await uae(e,()=>e.remoteSyncer.applySuccessfulWrite(i)),await $x(e)}async function wZe(e,t){t&&pf(e).h_&&await async function(r,i){if(function(o){return dJe(o)&&o!==xe.ABORTED}(i.code)){const s=r.b_.shift();pf(r).Yo(),await uae(r,()=>r.remoteSyncer.rejectFailedWrite(s.batchId,i)),await $x(r)}}(e,t),lae(e)&&cae(e)}async function c7(e,t){const n=Nt(e);n.asyncQueue.verifyOperationInProgress(),Xe("RemoteStore","RemoteStore received new credentials");const r=hh(n);n.C_.add(3),await mv(n),r&&n.M_.set("Unknown"),await n.remoteSyncer.handleCredentialChange(t),n.C_.delete(3),await pv(n)}async function TZe(e,t){const n=Nt(e);t?(n.C_.delete(2),await pv(n)):t||(n.C_.add(2),await mv(n),n.M_.set("Unknown"))}function cg(e){return e.O_||(e.O_=function(n,r,i){const s=Nt(n);return s.A_(),new lZe(r,s.connection,s.authCredentials,s.appCheckCredentials,s.serializer,i)}(e.datastore,e.asyncQueue,{ho:pZe.bind(null,e),Io:mZe.bind(null,e),a_:gZe.bind(null,e)}),e.v_.push(async t=>{t?(e.O_.Yo(),j6(e)?B6(e):e.M_.set("Unknown")):(await e.O_.stop(),aae(e))})),e.O_}function pf(e){return e.N_||(e.N_=function(n,r,i){const s=Nt(n);return s.A_(),new cZe(r,s.connection,s.authCredentials,s.appCheckCredentials,s.serializer,i)}(e.datastore,e.asyncQueue,{ho:vZe.bind(null,e),Io:wZe.bind(null,e),T_:bZe.bind(null,e),I_:EZe.bind(null,e)}),e.v_.push(async t=>{t?(e.N_.Yo(),await $x(e)):(await e.N_.stop(),e.b_.length>0&&(Xe("RemoteStore",`Stopping write stream with ${e.b_.length} pending writes`),e.b_=[]))})),e.N_}/** + */class hZe{constructor(t,n,r,i,s){this.localStore=t,this.datastore=n,this.asyncQueue=r,this.remoteSyncer={},this.b_=[],this.D_=new Map,this.C_=new Set,this.v_=[],this.F_=s,this.F_.ro(o=>{r.enqueueAndForget(async()=>{hh(this)&&(Xe("RemoteStore","Restarting streams for network reachability change."),await async function(u){const l=Nt(u);l.C_.add(4),await mv(l),l.M_.set("Unknown"),l.C_.delete(4),await pv(l)}(this))})}),this.M_=new dZe(r,i)}}async function pv(e){if(hh(e))for(const t of e.v_)await t(!0)}async function mv(e){for(const t of e.v_)await t(!1)}function rae(e,t){const n=Nt(e);n.D_.has(t.targetId)||(n.D_.set(t.targetId,t),j6(n)?B6(n):cg(n).Ho()&&F6(n,t))}function iae(e,t){const n=Nt(e),r=cg(n);n.D_.delete(t),r.Ho()&&sae(n,t),n.D_.size===0&&(r.Ho()?r.Zo():hh(n)&&n.M_.set("Unknown"))}function F6(e,t){if(e.x_.Oe(t.targetId),t.resumeToken.approximateByteSize()>0||t.snapshotVersion.compareTo(xt.min())>0){const n=e.remoteSyncer.getRemoteKeysForTarget(t.targetId).size;t=t.withExpectedCount(n)}cg(e).u_(t)}function sae(e,t){e.x_.Oe(t),cg(e).c_(t)}function B6(e){e.x_=new mJe({getRemoteKeysForTarget:t=>e.remoteSyncer.getRemoteKeysForTarget(t),_t:t=>e.D_.get(t)||null,nt:()=>e.datastore.serializer.databaseId}),cg(e).start(),e.M_.g_()}function j6(e){return hh(e)&&!cg(e).jo()&&e.D_.size>0}function hh(e){return Nt(e).C_.size===0}function oae(e){e.x_=void 0}async function pZe(e){e.D_.forEach((t,n)=>{F6(e,t)})}async function mZe(e,t){oae(e),j6(e)?(e.M_.w_(t),B6(e)):e.M_.set("Unknown")}async function gZe(e,t,n){if(e.M_.set("Online"),t instanceof qoe&&t.state===2&&t.cause)try{await async function(i,s){const o=s.cause;for(const a of s.targetIds)i.D_.has(a)&&(await i.remoteSyncer.rejectListen(a,o),i.D_.delete(a),i.x_.removeTarget(a))}(e,t)}catch(r){Xe("RemoteStore","Failed to remove targets %s: %s ",t.targetIds.join(","),r),await sS(e,r)}else if(t instanceof Sb?e.x_.$e(t):t instanceof Woe?e.x_.Je(t):e.x_.Ge(t),!n.isEqual(xt.min()))try{const r=await eae(e.localStore);n.compareTo(r)>=0&&await function(s,o){const a=s.x_.it(o);return a.targetChanges.forEach((u,l)=>{if(u.resumeToken.approximateByteSize()>0){const c=s.D_.get(l);c&&s.D_.set(l,c.withResumeToken(u.resumeToken,o))}}),a.targetMismatches.forEach((u,l)=>{const c=s.D_.get(u);if(!c)return;s.D_.set(u,c.withResumeToken(es.EMPTY_BYTE_STRING,c.snapshotVersion)),sae(s,u);const f=new Cc(c.target,u,l,c.sequenceNumber);F6(s,f)}),s.remoteSyncer.applyRemoteEvent(a)}(e,n)}catch(r){Xe("RemoteStore","Failed to raise snapshot:",r),await sS(e,r)}}async function sS(e,t,n){if(!fv(t))throw t;e.C_.add(1),await mv(e),e.M_.set("Offline"),n||(n=()=>eae(e.localStore)),e.asyncQueue.enqueueRetryable(async()=>{Xe("RemoteStore","Retrying IndexedDB access"),await n(),e.C_.delete(1),await pv(e)})}function aae(e,t){return t().catch(n=>sS(e,n,t))}async function $x(e){const t=Nt(e),n=pf(t);let r=t.b_.length>0?t.b_[t.b_.length-1].batchId:-1;for(;yZe(t);)try{const i=await tZe(t.localStore,r);if(i===null){t.b_.length===0&&n.Zo();break}r=i.batchId,_Ze(t,i)}catch(i){await sS(t,i)}uae(t)&&lae(t)}function yZe(e){return hh(e)&&e.b_.length<10}function _Ze(e,t){e.b_.push(t);const n=pf(e);n.Ho()&&n.h_&&n.P_(t.mutations)}function uae(e){return hh(e)&&!pf(e).jo()&&e.b_.length>0}function lae(e){pf(e).start()}async function vZe(e){pf(e).E_()}async function bZe(e){const t=pf(e);for(const n of e.b_)t.P_(n.mutations)}async function EZe(e,t,n){const r=e.b_.shift(),i=N6.from(r,t,n);await aae(e,()=>e.remoteSyncer.applySuccessfulWrite(i)),await $x(e)}async function wZe(e,t){t&&pf(e).h_&&await async function(r,i){if(function(o){return dJe(o)&&o!==xe.ABORTED}(i.code)){const s=r.b_.shift();pf(r).Yo(),await aae(r,()=>r.remoteSyncer.rejectFailedWrite(s.batchId,i)),await $x(r)}}(e,t),uae(e)&&lae(e)}async function c7(e,t){const n=Nt(e);n.asyncQueue.verifyOperationInProgress(),Xe("RemoteStore","RemoteStore received new credentials");const r=hh(n);n.C_.add(3),await mv(n),r&&n.M_.set("Unknown"),await n.remoteSyncer.handleCredentialChange(t),n.C_.delete(3),await pv(n)}async function TZe(e,t){const n=Nt(e);t?(n.C_.delete(2),await pv(n)):t||(n.C_.add(2),await mv(n),n.M_.set("Unknown"))}function cg(e){return e.O_||(e.O_=function(n,r,i){const s=Nt(n);return s.A_(),new lZe(r,s.connection,s.authCredentials,s.appCheckCredentials,s.serializer,i)}(e.datastore,e.asyncQueue,{ho:pZe.bind(null,e),Io:mZe.bind(null,e),a_:gZe.bind(null,e)}),e.v_.push(async t=>{t?(e.O_.Yo(),j6(e)?B6(e):e.M_.set("Unknown")):(await e.O_.stop(),oae(e))})),e.O_}function pf(e){return e.N_||(e.N_=function(n,r,i){const s=Nt(n);return s.A_(),new cZe(r,s.connection,s.authCredentials,s.appCheckCredentials,s.serializer,i)}(e.datastore,e.asyncQueue,{ho:vZe.bind(null,e),Io:wZe.bind(null,e),T_:bZe.bind(null,e),I_:EZe.bind(null,e)}),e.v_.push(async t=>{t?(e.N_.Yo(),await $x(e)):(await e.N_.stop(),e.b_.length>0&&(Xe("RemoteStore",`Stopping write stream with ${e.b_.length} pending writes`),e.b_=[]))})),e.N_}/** * @license * Copyright 2017 Google LLC * @@ -2143,7 +2143,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class SZe{constructor(){this.k_=void 0,this.listeners=[]}}class IZe{constructor(){this.queries=new lg(t=>Roe(t),Ox),this.onlineState="Unknown",this.q_=new Set}}async function fae(e,t){const n=Nt(e),r=t.query;let i=!1,s=n.queries.get(r);if(s||(i=!0,s=new SZe),i)try{s.k_=await n.onListen(r)}catch(o){const a=V6(o,`Initialization of query '${$h(t.query)}' failed`);return void t.onError(a)}n.queries.set(r,s),s.listeners.push(t),t.Q_(n.onlineState),s.k_&&t.K_(s.k_)&&z6(n)}async function dae(e,t){const n=Nt(e),r=t.query;let i=!1;const s=n.queries.get(r);if(s){const o=s.listeners.indexOf(t);o>=0&&(s.listeners.splice(o,1),i=s.listeners.length===0)}if(i)return n.queries.delete(r),n.onUnlisten(r)}function xZe(e,t){const n=Nt(e);let r=!1;for(const i of t){const s=i.query,o=n.queries.get(s);if(o){for(const a of o.listeners)a.K_(i)&&(r=!0);o.k_=i}}r&&z6(n)}function CZe(e,t,n){const r=Nt(e),i=r.queries.get(t);if(i)for(const s of i.listeners)s.onError(n);r.queries.delete(t)}function z6(e){e.q_.forEach(t=>{t.next()})}class hae{constructor(t,n,r){this.query=t,this.U_=n,this.W_=!1,this.G_=null,this.onlineState="Unknown",this.options=r||{}}K_(t){if(!this.options.includeMetadataChanges){const r=[];for(const i of t.docChanges)i.type!==3&&r.push(i);t=new xm(t.query,t.docs,t.oldDocs,r,t.mutatedKeys,t.fromCache,t.syncStateChanged,!0,t.hasCachedResults)}let n=!1;return this.W_?this.z_(t)&&(this.U_.next(t),n=!0):this.j_(t,this.onlineState)&&(this.H_(t),n=!0),this.G_=t,n}onError(t){this.U_.error(t)}Q_(t){this.onlineState=t;let n=!1;return this.G_&&!this.W_&&this.j_(this.G_,t)&&(this.H_(this.G_),n=!0),n}j_(t,n){if(!t.fromCache)return!0;const r=n!=="Offline";return(!this.options.J_||!r)&&(!t.docs.isEmpty()||t.hasCachedResults||n==="Offline")}z_(t){if(t.docChanges.length>0)return!0;const n=this.G_&&this.G_.hasPendingWrites!==t.hasPendingWrites;return!(!t.syncStateChanged&&!n)&&this.options.includeMetadataChanges===!0}H_(t){t=xm.fromInitialDocuments(t.query,t.docs,t.mutatedKeys,t.fromCache,t.hasCachedResults),this.W_=!0,this.U_.next(t)}}/** + */class SZe{constructor(){this.k_=void 0,this.listeners=[]}}class IZe{constructor(){this.queries=new lg(t=>Poe(t),Ox),this.onlineState="Unknown",this.q_=new Set}}async function cae(e,t){const n=Nt(e),r=t.query;let i=!1,s=n.queries.get(r);if(s||(i=!0,s=new SZe),i)try{s.k_=await n.onListen(r)}catch(o){const a=V6(o,`Initialization of query '${$h(t.query)}' failed`);return void t.onError(a)}n.queries.set(r,s),s.listeners.push(t),t.Q_(n.onlineState),s.k_&&t.K_(s.k_)&&z6(n)}async function fae(e,t){const n=Nt(e),r=t.query;let i=!1;const s=n.queries.get(r);if(s){const o=s.listeners.indexOf(t);o>=0&&(s.listeners.splice(o,1),i=s.listeners.length===0)}if(i)return n.queries.delete(r),n.onUnlisten(r)}function xZe(e,t){const n=Nt(e);let r=!1;for(const i of t){const s=i.query,o=n.queries.get(s);if(o){for(const a of o.listeners)a.K_(i)&&(r=!0);o.k_=i}}r&&z6(n)}function CZe(e,t,n){const r=Nt(e),i=r.queries.get(t);if(i)for(const s of i.listeners)s.onError(n);r.queries.delete(t)}function z6(e){e.q_.forEach(t=>{t.next()})}class dae{constructor(t,n,r){this.query=t,this.U_=n,this.W_=!1,this.G_=null,this.onlineState="Unknown",this.options=r||{}}K_(t){if(!this.options.includeMetadataChanges){const r=[];for(const i of t.docChanges)i.type!==3&&r.push(i);t=new xm(t.query,t.docs,t.oldDocs,r,t.mutatedKeys,t.fromCache,t.syncStateChanged,!0,t.hasCachedResults)}let n=!1;return this.W_?this.z_(t)&&(this.U_.next(t),n=!0):this.j_(t,this.onlineState)&&(this.H_(t),n=!0),this.G_=t,n}onError(t){this.U_.error(t)}Q_(t){this.onlineState=t;let n=!1;return this.G_&&!this.W_&&this.j_(this.G_,t)&&(this.H_(this.G_),n=!0),n}j_(t,n){if(!t.fromCache)return!0;const r=n!=="Offline";return(!this.options.J_||!r)&&(!t.docs.isEmpty()||t.hasCachedResults||n==="Offline")}z_(t){if(t.docChanges.length>0)return!0;const n=this.G_&&this.G_.hasPendingWrites!==t.hasPendingWrites;return!(!t.syncStateChanged&&!n)&&this.options.includeMetadataChanges===!0}H_(t){t=xm.fromInitialDocuments(t.query,t.docs,t.mutatedKeys,t.fromCache,t.hasCachedResults),this.W_=!0,this.U_.next(t)}}/** * @license * Copyright 2017 Google LLC * @@ -2158,7 +2158,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class pae{constructor(t){this.key=t}}class mae{constructor(t){this.key=t}}class AZe{constructor(t,n){this.query=t,this.ia=n,this.sa=null,this.hasCachedResults=!1,this.current=!1,this.oa=Kt(),this.mutatedKeys=Kt(),this._a=Noe(t),this.aa=new Mp(this._a)}get ua(){return this.ia}ca(t,n){const r=n?n.la:new f7,i=n?n.aa:this.aa;let s=n?n.mutatedKeys:this.mutatedKeys,o=i,a=!1;const u=this.query.limitType==="F"&&i.size===this.query.limit?i.last():null,l=this.query.limitType==="L"&&i.size===this.query.limit?i.first():null;if(t.inorderTraversal((c,f)=>{const d=i.get(c),h=Px(this.query,f)?f:null,p=!!d&&this.mutatedKeys.has(d.key),m=!!h&&(h.hasLocalMutations||this.mutatedKeys.has(h.key)&&h.hasCommittedMutations);let y=!1;d&&h?d.data.isEqual(h.data)?p!==m&&(r.track({type:3,doc:h}),y=!0):this.ha(d,h)||(r.track({type:2,doc:h}),y=!0,(u&&this._a(h,u)>0||l&&this._a(h,l)<0)&&(a=!0)):!d&&h?(r.track({type:0,doc:h}),y=!0):d&&!h&&(r.track({type:1,doc:d}),y=!0,(u||l)&&(a=!0)),y&&(h?(o=o.add(h),s=m?s.add(c):s.delete(c)):(o=o.delete(c),s=s.delete(c)))}),this.query.limit!==null)for(;o.size>this.query.limit;){const c=this.query.limitType==="F"?o.last():o.first();o=o.delete(c.key),s=s.delete(c.key),r.track({type:1,doc:c})}return{aa:o,la:r,Zi:a,mutatedKeys:s}}ha(t,n){return t.hasLocalMutations&&n.hasCommittedMutations&&!n.hasLocalMutations}applyChanges(t,n,r,i){const s=this.aa;this.aa=t.aa,this.mutatedKeys=t.mutatedKeys;const o=t.la.L_();o.sort((c,f)=>function(h,p){const m=y=>{switch(y){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return _t()}};return m(h)-m(p)}(c.type,f.type)||this._a(c.doc,f.doc)),this.Pa(r),i=i!=null&&i;const a=n&&!i?this.Ia():[],u=this.oa.size===0&&this.current&&!i?1:0,l=u!==this.sa;return this.sa=u,o.length!==0||l?{snapshot:new xm(this.query,t.aa,s,o,t.mutatedKeys,u===0,l,!1,!!r&&r.resumeToken.approximateByteSize()>0),Ta:a}:{Ta:a}}Q_(t){return this.current&&t==="Offline"?(this.current=!1,this.applyChanges({aa:this.aa,la:new f7,mutatedKeys:this.mutatedKeys,Zi:!1},!1)):{Ta:[]}}Ea(t){return!this.ia.has(t)&&!!this.aa.has(t)&&!this.aa.get(t).hasLocalMutations}Pa(t){t&&(t.addedDocuments.forEach(n=>this.ia=this.ia.add(n)),t.modifiedDocuments.forEach(n=>{}),t.removedDocuments.forEach(n=>this.ia=this.ia.delete(n)),this.current=t.current)}Ia(){if(!this.current)return[];const t=this.oa;this.oa=Kt(),this.aa.forEach(r=>{this.Ea(r.key)&&(this.oa=this.oa.add(r.key))});const n=[];return t.forEach(r=>{this.oa.has(r)||n.push(new mae(r))}),this.oa.forEach(r=>{t.has(r)||n.push(new pae(r))}),n}da(t){this.ia=t.ls,this.oa=Kt();const n=this.ca(t.documents);return this.applyChanges(n,!0)}Aa(){return xm.fromInitialDocuments(this.query,this.aa,this.mutatedKeys,this.sa===0,this.hasCachedResults)}}class OZe{constructor(t,n,r){this.query=t,this.targetId=n,this.view=r}}class PZe{constructor(t){this.key=t,this.Ra=!1}}class RZe{constructor(t,n,r,i,s,o){this.localStore=t,this.remoteStore=n,this.eventManager=r,this.sharedClientState=i,this.currentUser=s,this.maxConcurrentLimboResolutions=o,this.Va={},this.ma=new lg(a=>Roe(a),Ox),this.fa=new Map,this.ga=new Set,this.pa=new _r(dt.comparator),this.ya=new Map,this.wa=new $6,this.Sa={},this.ba=new Map,this.Da=Im.Nn(),this.onlineState="Unknown",this.Ca=void 0}get isPrimaryClient(){return this.Ca===!0}}async function NZe(e,t){const n=VZe(e);let r,i;const s=n.ma.get(t);if(s)r=s.targetId,n.sharedClientState.addLocalQueryTarget(r),i=s.view.Aa();else{const o=await nZe(n.localStore,Su(t)),a=n.sharedClientState.addLocalQueryTarget(o.targetId);r=o.targetId,i=await kZe(n,t,r,a==="current",o.resumeToken),n.isPrimaryClient&&iae(n.remoteStore,o)}return i}async function kZe(e,t,n,r,i){e.va=(f,d,h)=>async function(m,y,g,_){let b=y.view.ca(g);b.Zi&&(b=await a7(m.localStore,y.query,!1).then(({documents:S})=>y.view.ca(S,b)));const T=_&&_.targetChanges.get(y.targetId),I=_&&_.targetMismatches.get(y.targetId)!=null,E=y.view.applyChanges(b,m.isPrimaryClient,T,I);return h7(m,y.targetId,E.Ta),E.snapshot}(e,f,d,h);const s=await a7(e.localStore,t,!0),o=new AZe(t,s.ls),a=o.ca(s.documents),u=hv.createSynthesizedTargetChangeForCurrentChange(n,r&&e.onlineState!=="Offline",i),l=o.applyChanges(a,e.isPrimaryClient,u);h7(e,n,l.Ta);const c=new OZe(t,n,o);return e.ma.set(t,c),e.fa.has(n)?e.fa.get(n).push(t):e.fa.set(n,[t]),l.snapshot}async function DZe(e,t){const n=Nt(e),r=n.ma.get(t),i=n.fa.get(r.targetId);if(i.length>1)return n.fa.set(r.targetId,i.filter(s=>!Ox(s,t))),void n.ma.delete(t);n.isPrimaryClient?(n.sharedClientState.removeLocalQueryTarget(r.targetId),n.sharedClientState.isActiveQueryTarget(r.targetId)||await YR(n.localStore,r.targetId,!1).then(()=>{n.sharedClientState.clearQueryState(r.targetId),sae(n.remoteStore,r.targetId),GR(n,r.targetId)}).catch(cv)):(GR(n,r.targetId),await YR(n.localStore,r.targetId,!0))}async function $Ze(e,t,n){const r=zZe(e);try{const i=await function(o,a){const u=Nt(o),l=Zr.now(),c=a.reduce((h,p)=>h.add(p.key),Kt());let f,d;return u.persistence.runTransaction("Locally write mutations","readwrite",h=>{let p=Fl(),m=Kt();return u.ss.getEntries(h,c).next(y=>{p=y,p.forEach((g,_)=>{_.isValidDocument()||(m=m.add(g))})}).next(()=>u.localDocuments.getOverlayedDocuments(h,p)).next(y=>{f=y;const g=[];for(const _ of a){const b=aJe(_,f.get(_.key).overlayedDocument);b!=null&&g.push(new dh(_.key,b,Soe(b.value.mapValue),vl.exists(!0)))}return u.mutationQueue.addMutationBatch(h,l,g,a)}).next(y=>{d=y;const g=y.applyToLocalDocumentSet(f,m);return u.documentOverlayCache.saveOverlays(h,y.batchId,g)})}).then(()=>({batchId:d.batchId,changes:Doe(f)}))}(r.localStore,t);r.sharedClientState.addPendingMutation(i.batchId),function(o,a,u){let l=o.Sa[o.currentUser.toKey()];l||(l=new _r(Sn)),l=l.insert(a,u),o.Sa[o.currentUser.toKey()]=l}(r,i.batchId,n),await gv(r,i.changes),await $x(r.remoteStore)}catch(i){const s=V6(i,"Failed to persist write");n.reject(s)}}async function gae(e,t){const n=Nt(e);try{const r=await ZJe(n.localStore,t);t.targetChanges.forEach((i,s)=>{const o=n.ya.get(s);o&&(Yn(i.addedDocuments.size+i.modifiedDocuments.size+i.removedDocuments.size<=1),i.addedDocuments.size>0?o.Ra=!0:i.modifiedDocuments.size>0?Yn(o.Ra):i.removedDocuments.size>0&&(Yn(o.Ra),o.Ra=!1))}),await gv(n,r,t)}catch(r){await cv(r)}}function d7(e,t,n){const r=Nt(e);if(r.isPrimaryClient&&n===0||!r.isPrimaryClient&&n===1){const i=[];r.ma.forEach((s,o)=>{const a=o.view.Q_(t);a.snapshot&&i.push(a.snapshot)}),function(o,a){const u=Nt(o);u.onlineState=a;let l=!1;u.queries.forEach((c,f)=>{for(const d of f.listeners)d.Q_(a)&&(l=!0)}),l&&z6(u)}(r.eventManager,t),i.length&&r.Va.a_(i),r.onlineState=t,r.isPrimaryClient&&r.sharedClientState.setOnlineState(t)}}async function LZe(e,t,n){const r=Nt(e);r.sharedClientState.updateQueryState(t,"rejected",n);const i=r.ya.get(t),s=i&&i.key;if(s){let o=new _r(dt.comparator);o=o.insert(s,qi.newNoDocument(s,xt.min()));const a=Kt().add(s),u=new kx(xt.min(),new Map,new _r(Sn),o,a);await gae(r,u),r.pa=r.pa.remove(s),r.ya.delete(t),H6(r)}else await YR(r.localStore,t,!1).then(()=>GR(r,t,n)).catch(cv)}async function MZe(e,t){const n=Nt(e),r=t.batch.batchId;try{const i=await JJe(n.localStore,t);_ae(n,r,null),yae(n,r),n.sharedClientState.updateMutationState(r,"acknowledged"),await gv(n,i)}catch(i){await cv(i)}}async function FZe(e,t,n){const r=Nt(e);try{const i=await function(o,a){const u=Nt(o);return u.persistence.runTransaction("Reject batch","readwrite-primary",l=>{let c;return u.mutationQueue.lookupMutationBatch(l,a).next(f=>(Yn(f!==null),c=f.keys(),u.mutationQueue.removeMutationBatch(l,f))).next(()=>u.mutationQueue.performConsistencyCheck(l)).next(()=>u.documentOverlayCache.removeOverlaysForBatchId(l,c,a)).next(()=>u.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(l,c)).next(()=>u.localDocuments.getDocuments(l,c))})}(r.localStore,t);_ae(r,t,n),yae(r,t),r.sharedClientState.updateMutationState(t,"rejected",n),await gv(r,i)}catch(i){await cv(i)}}function yae(e,t){(e.ba.get(t)||[]).forEach(n=>{n.resolve()}),e.ba.delete(t)}function _ae(e,t,n){const r=Nt(e);let i=r.Sa[r.currentUser.toKey()];if(i){const s=i.get(t);s&&(n?s.reject(n):s.resolve(),i=i.remove(t)),r.Sa[r.currentUser.toKey()]=i}}function GR(e,t,n=null){e.sharedClientState.removeLocalQueryTarget(t);for(const r of e.fa.get(t))e.ma.delete(r),n&&e.Va.Fa(r,n);e.fa.delete(t),e.isPrimaryClient&&e.wa.Rr(t).forEach(r=>{e.wa.containsKey(r)||vae(e,r)})}function vae(e,t){e.ga.delete(t.path.canonicalString());const n=e.pa.get(t);n!==null&&(sae(e.remoteStore,n),e.pa=e.pa.remove(t),e.ya.delete(n),H6(e))}function h7(e,t,n){for(const r of n)r instanceof pae?(e.wa.addReference(r.key,t),BZe(e,r)):r instanceof mae?(Xe("SyncEngine","Document no longer in limbo: "+r.key),e.wa.removeReference(r.key,t),e.wa.containsKey(r.key)||vae(e,r.key)):_t()}function BZe(e,t){const n=t.key,r=n.path.canonicalString();e.pa.get(n)||e.ga.has(r)||(Xe("SyncEngine","New document in limbo: "+n),e.ga.add(r),H6(e))}function H6(e){for(;e.ga.size>0&&e.pa.size{o.push(r.va(u,t,n).then(l=>{if((l||n)&&r.isPrimaryClient&&r.sharedClientState.updateQueryState(u.targetId,l!=null&&l.fromCache?"not-current":"current"),l){i.push(l);const c=M6.Qi(u.targetId,l);s.push(c)}}))}),await Promise.all(o),r.Va.a_(i),await async function(u,l){const c=Nt(u);try{await c.persistence.runTransaction("notifyLocalViewChanges","readwrite",f=>Ce.forEach(l,d=>Ce.forEach(d.ki,h=>c.persistence.referenceDelegate.addReference(f,d.targetId,h)).next(()=>Ce.forEach(d.qi,h=>c.persistence.referenceDelegate.removeReference(f,d.targetId,h)))))}catch(f){if(!fv(f))throw f;Xe("LocalStore","Failed to update sequence numbers: "+f)}for(const f of l){const d=f.targetId;if(!f.fromCache){const h=c.ts.get(d),p=h.snapshotVersion,m=h.withLastLimboFreeSnapshotVersion(p);c.ts=c.ts.insert(d,m)}}}(r.localStore,s))}async function jZe(e,t){const n=Nt(e);if(!n.currentUser.isEqual(t)){Xe("SyncEngine","User change. New user:",t.toKey());const r=await eae(n.localStore,t);n.currentUser=t,function(s,o){s.ba.forEach(a=>{a.forEach(u=>{u.reject(new tt(xe.CANCELLED,o))})}),s.ba.clear()}(n,"'waitForPendingWrites' promise is rejected due to a user change."),n.sharedClientState.handleUserChange(t,r.removedBatchIds,r.addedBatchIds),await gv(n,r._s)}}function UZe(e,t){const n=Nt(e),r=n.ya.get(t);if(r&&r.Ra)return Kt().add(r.key);{let i=Kt();const s=n.fa.get(t);if(!s)return i;for(const o of s){const a=n.ma.get(o);i=i.unionWith(a.view.ua)}return i}}function VZe(e){const t=Nt(e);return t.remoteStore.remoteSyncer.applyRemoteEvent=gae.bind(null,t),t.remoteStore.remoteSyncer.getRemoteKeysForTarget=UZe.bind(null,t),t.remoteStore.remoteSyncer.rejectListen=LZe.bind(null,t),t.Va.a_=xZe.bind(null,t.eventManager),t.Va.Fa=CZe.bind(null,t.eventManager),t}function zZe(e){const t=Nt(e);return t.remoteStore.remoteSyncer.applySuccessfulWrite=MZe.bind(null,t),t.remoteStore.remoteSyncer.rejectFailedWrite=FZe.bind(null,t),t}class p7{constructor(){this.synchronizeTabs=!1}async initialize(t){this.serializer=Dx(t.databaseInfo.databaseId),this.sharedClientState=this.createSharedClientState(t),this.persistence=this.createPersistence(t),await this.persistence.start(),this.localStore=this.createLocalStore(t),this.gcScheduler=this.createGarbageCollectionScheduler(t,this.localStore),this.indexBackfillerScheduler=this.createIndexBackfillerScheduler(t,this.localStore)}createGarbageCollectionScheduler(t,n){return null}createIndexBackfillerScheduler(t,n){return null}createLocalStore(t){return XJe(this.persistence,new KJe,t.initialUser,this.serializer)}createPersistence(t){return new qJe(L6.jr,this.serializer)}createSharedClientState(t){return new iZe}async terminate(){this.gcScheduler&&this.gcScheduler.stop(),await this.sharedClientState.shutdown(),await this.persistence.shutdown()}}class HZe{async initialize(t,n){this.localStore||(this.localStore=t.localStore,this.sharedClientState=t.sharedClientState,this.datastore=this.createDatastore(n),this.remoteStore=this.createRemoteStore(n),this.eventManager=this.createEventManager(n),this.syncEngine=this.createSyncEngine(n,!t.synchronizeTabs),this.sharedClientState.onlineStateHandler=r=>d7(this.syncEngine,r,1),this.remoteStore.remoteSyncer.handleCredentialChange=jZe.bind(null,this.syncEngine),await TZe(this.remoteStore,this.syncEngine.isPrimaryClient))}createEventManager(t){return function(){return new IZe}()}createDatastore(t){const n=Dx(t.databaseInfo.databaseId),r=function(s){return new uZe(s)}(t.databaseInfo);return function(s,o,a,u){return new fZe(s,o,a,u)}(t.authCredentials,t.appCheckCredentials,r,n)}createRemoteStore(t){return function(r,i,s,o,a){return new hZe(r,i,s,o,a)}(this.localStore,this.datastore,t.asyncQueue,n=>d7(this.syncEngine,n,0),function(){return l7.D()?new l7:new sZe}())}createSyncEngine(t,n){return function(i,s,o,a,u,l,c){const f=new RZe(i,s,o,a,u,l);return c&&(f.Ca=!0),f}(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,t.initialUser,t.maxConcurrentLimboResolutions,n)}terminate(){return async function(n){const r=Nt(n);Xe("RemoteStore","RemoteStore shutting down."),r.C_.add(5),await mv(r),r.F_.shutdown(),r.M_.set("Unknown")}(this.remoteStore)}}/** + */class hae{constructor(t){this.key=t}}class pae{constructor(t){this.key=t}}class AZe{constructor(t,n){this.query=t,this.ia=n,this.sa=null,this.hasCachedResults=!1,this.current=!1,this.oa=Kt(),this.mutatedKeys=Kt(),this._a=Roe(t),this.aa=new Mp(this._a)}get ua(){return this.ia}ca(t,n){const r=n?n.la:new f7,i=n?n.aa:this.aa;let s=n?n.mutatedKeys:this.mutatedKeys,o=i,a=!1;const u=this.query.limitType==="F"&&i.size===this.query.limit?i.last():null,l=this.query.limitType==="L"&&i.size===this.query.limit?i.first():null;if(t.inorderTraversal((c,f)=>{const d=i.get(c),h=Px(this.query,f)?f:null,p=!!d&&this.mutatedKeys.has(d.key),m=!!h&&(h.hasLocalMutations||this.mutatedKeys.has(h.key)&&h.hasCommittedMutations);let y=!1;d&&h?d.data.isEqual(h.data)?p!==m&&(r.track({type:3,doc:h}),y=!0):this.ha(d,h)||(r.track({type:2,doc:h}),y=!0,(u&&this._a(h,u)>0||l&&this._a(h,l)<0)&&(a=!0)):!d&&h?(r.track({type:0,doc:h}),y=!0):d&&!h&&(r.track({type:1,doc:d}),y=!0,(u||l)&&(a=!0)),y&&(h?(o=o.add(h),s=m?s.add(c):s.delete(c)):(o=o.delete(c),s=s.delete(c)))}),this.query.limit!==null)for(;o.size>this.query.limit;){const c=this.query.limitType==="F"?o.last():o.first();o=o.delete(c.key),s=s.delete(c.key),r.track({type:1,doc:c})}return{aa:o,la:r,Zi:a,mutatedKeys:s}}ha(t,n){return t.hasLocalMutations&&n.hasCommittedMutations&&!n.hasLocalMutations}applyChanges(t,n,r,i){const s=this.aa;this.aa=t.aa,this.mutatedKeys=t.mutatedKeys;const o=t.la.L_();o.sort((c,f)=>function(h,p){const m=y=>{switch(y){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return _t()}};return m(h)-m(p)}(c.type,f.type)||this._a(c.doc,f.doc)),this.Pa(r),i=i!=null&&i;const a=n&&!i?this.Ia():[],u=this.oa.size===0&&this.current&&!i?1:0,l=u!==this.sa;return this.sa=u,o.length!==0||l?{snapshot:new xm(this.query,t.aa,s,o,t.mutatedKeys,u===0,l,!1,!!r&&r.resumeToken.approximateByteSize()>0),Ta:a}:{Ta:a}}Q_(t){return this.current&&t==="Offline"?(this.current=!1,this.applyChanges({aa:this.aa,la:new f7,mutatedKeys:this.mutatedKeys,Zi:!1},!1)):{Ta:[]}}Ea(t){return!this.ia.has(t)&&!!this.aa.has(t)&&!this.aa.get(t).hasLocalMutations}Pa(t){t&&(t.addedDocuments.forEach(n=>this.ia=this.ia.add(n)),t.modifiedDocuments.forEach(n=>{}),t.removedDocuments.forEach(n=>this.ia=this.ia.delete(n)),this.current=t.current)}Ia(){if(!this.current)return[];const t=this.oa;this.oa=Kt(),this.aa.forEach(r=>{this.Ea(r.key)&&(this.oa=this.oa.add(r.key))});const n=[];return t.forEach(r=>{this.oa.has(r)||n.push(new pae(r))}),this.oa.forEach(r=>{t.has(r)||n.push(new hae(r))}),n}da(t){this.ia=t.ls,this.oa=Kt();const n=this.ca(t.documents);return this.applyChanges(n,!0)}Aa(){return xm.fromInitialDocuments(this.query,this.aa,this.mutatedKeys,this.sa===0,this.hasCachedResults)}}class OZe{constructor(t,n,r){this.query=t,this.targetId=n,this.view=r}}class PZe{constructor(t){this.key=t,this.Ra=!1}}class RZe{constructor(t,n,r,i,s,o){this.localStore=t,this.remoteStore=n,this.eventManager=r,this.sharedClientState=i,this.currentUser=s,this.maxConcurrentLimboResolutions=o,this.Va={},this.ma=new lg(a=>Poe(a),Ox),this.fa=new Map,this.ga=new Set,this.pa=new _r(dt.comparator),this.ya=new Map,this.wa=new $6,this.Sa={},this.ba=new Map,this.Da=Im.Nn(),this.onlineState="Unknown",this.Ca=void 0}get isPrimaryClient(){return this.Ca===!0}}async function NZe(e,t){const n=VZe(e);let r,i;const s=n.ma.get(t);if(s)r=s.targetId,n.sharedClientState.addLocalQueryTarget(r),i=s.view.Aa();else{const o=await nZe(n.localStore,Su(t)),a=n.sharedClientState.addLocalQueryTarget(o.targetId);r=o.targetId,i=await kZe(n,t,r,a==="current",o.resumeToken),n.isPrimaryClient&&rae(n.remoteStore,o)}return i}async function kZe(e,t,n,r,i){e.va=(f,d,h)=>async function(m,y,g,_){let b=y.view.ca(g);b.Zi&&(b=await a7(m.localStore,y.query,!1).then(({documents:S})=>y.view.ca(S,b)));const T=_&&_.targetChanges.get(y.targetId),I=_&&_.targetMismatches.get(y.targetId)!=null,E=y.view.applyChanges(b,m.isPrimaryClient,T,I);return h7(m,y.targetId,E.Ta),E.snapshot}(e,f,d,h);const s=await a7(e.localStore,t,!0),o=new AZe(t,s.ls),a=o.ca(s.documents),u=hv.createSynthesizedTargetChangeForCurrentChange(n,r&&e.onlineState!=="Offline",i),l=o.applyChanges(a,e.isPrimaryClient,u);h7(e,n,l.Ta);const c=new OZe(t,n,o);return e.ma.set(t,c),e.fa.has(n)?e.fa.get(n).push(t):e.fa.set(n,[t]),l.snapshot}async function DZe(e,t){const n=Nt(e),r=n.ma.get(t),i=n.fa.get(r.targetId);if(i.length>1)return n.fa.set(r.targetId,i.filter(s=>!Ox(s,t))),void n.ma.delete(t);n.isPrimaryClient?(n.sharedClientState.removeLocalQueryTarget(r.targetId),n.sharedClientState.isActiveQueryTarget(r.targetId)||await YR(n.localStore,r.targetId,!1).then(()=>{n.sharedClientState.clearQueryState(r.targetId),iae(n.remoteStore,r.targetId),GR(n,r.targetId)}).catch(cv)):(GR(n,r.targetId),await YR(n.localStore,r.targetId,!0))}async function $Ze(e,t,n){const r=zZe(e);try{const i=await function(o,a){const u=Nt(o),l=Zr.now(),c=a.reduce((h,p)=>h.add(p.key),Kt());let f,d;return u.persistence.runTransaction("Locally write mutations","readwrite",h=>{let p=Fl(),m=Kt();return u.ss.getEntries(h,c).next(y=>{p=y,p.forEach((g,_)=>{_.isValidDocument()||(m=m.add(g))})}).next(()=>u.localDocuments.getOverlayedDocuments(h,p)).next(y=>{f=y;const g=[];for(const _ of a){const b=aJe(_,f.get(_.key).overlayedDocument);b!=null&&g.push(new dh(_.key,b,Toe(b.value.mapValue),vl.exists(!0)))}return u.mutationQueue.addMutationBatch(h,l,g,a)}).next(y=>{d=y;const g=y.applyToLocalDocumentSet(f,m);return u.documentOverlayCache.saveOverlays(h,y.batchId,g)})}).then(()=>({batchId:d.batchId,changes:koe(f)}))}(r.localStore,t);r.sharedClientState.addPendingMutation(i.batchId),function(o,a,u){let l=o.Sa[o.currentUser.toKey()];l||(l=new _r(Sn)),l=l.insert(a,u),o.Sa[o.currentUser.toKey()]=l}(r,i.batchId,n),await gv(r,i.changes),await $x(r.remoteStore)}catch(i){const s=V6(i,"Failed to persist write");n.reject(s)}}async function mae(e,t){const n=Nt(e);try{const r=await ZJe(n.localStore,t);t.targetChanges.forEach((i,s)=>{const o=n.ya.get(s);o&&(Yn(i.addedDocuments.size+i.modifiedDocuments.size+i.removedDocuments.size<=1),i.addedDocuments.size>0?o.Ra=!0:i.modifiedDocuments.size>0?Yn(o.Ra):i.removedDocuments.size>0&&(Yn(o.Ra),o.Ra=!1))}),await gv(n,r,t)}catch(r){await cv(r)}}function d7(e,t,n){const r=Nt(e);if(r.isPrimaryClient&&n===0||!r.isPrimaryClient&&n===1){const i=[];r.ma.forEach((s,o)=>{const a=o.view.Q_(t);a.snapshot&&i.push(a.snapshot)}),function(o,a){const u=Nt(o);u.onlineState=a;let l=!1;u.queries.forEach((c,f)=>{for(const d of f.listeners)d.Q_(a)&&(l=!0)}),l&&z6(u)}(r.eventManager,t),i.length&&r.Va.a_(i),r.onlineState=t,r.isPrimaryClient&&r.sharedClientState.setOnlineState(t)}}async function LZe(e,t,n){const r=Nt(e);r.sharedClientState.updateQueryState(t,"rejected",n);const i=r.ya.get(t),s=i&&i.key;if(s){let o=new _r(dt.comparator);o=o.insert(s,qi.newNoDocument(s,xt.min()));const a=Kt().add(s),u=new kx(xt.min(),new Map,new _r(Sn),o,a);await mae(r,u),r.pa=r.pa.remove(s),r.ya.delete(t),H6(r)}else await YR(r.localStore,t,!1).then(()=>GR(r,t,n)).catch(cv)}async function MZe(e,t){const n=Nt(e),r=t.batch.batchId;try{const i=await JJe(n.localStore,t);yae(n,r,null),gae(n,r),n.sharedClientState.updateMutationState(r,"acknowledged"),await gv(n,i)}catch(i){await cv(i)}}async function FZe(e,t,n){const r=Nt(e);try{const i=await function(o,a){const u=Nt(o);return u.persistence.runTransaction("Reject batch","readwrite-primary",l=>{let c;return u.mutationQueue.lookupMutationBatch(l,a).next(f=>(Yn(f!==null),c=f.keys(),u.mutationQueue.removeMutationBatch(l,f))).next(()=>u.mutationQueue.performConsistencyCheck(l)).next(()=>u.documentOverlayCache.removeOverlaysForBatchId(l,c,a)).next(()=>u.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(l,c)).next(()=>u.localDocuments.getDocuments(l,c))})}(r.localStore,t);yae(r,t,n),gae(r,t),r.sharedClientState.updateMutationState(t,"rejected",n),await gv(r,i)}catch(i){await cv(i)}}function gae(e,t){(e.ba.get(t)||[]).forEach(n=>{n.resolve()}),e.ba.delete(t)}function yae(e,t,n){const r=Nt(e);let i=r.Sa[r.currentUser.toKey()];if(i){const s=i.get(t);s&&(n?s.reject(n):s.resolve(),i=i.remove(t)),r.Sa[r.currentUser.toKey()]=i}}function GR(e,t,n=null){e.sharedClientState.removeLocalQueryTarget(t);for(const r of e.fa.get(t))e.ma.delete(r),n&&e.Va.Fa(r,n);e.fa.delete(t),e.isPrimaryClient&&e.wa.Rr(t).forEach(r=>{e.wa.containsKey(r)||_ae(e,r)})}function _ae(e,t){e.ga.delete(t.path.canonicalString());const n=e.pa.get(t);n!==null&&(iae(e.remoteStore,n),e.pa=e.pa.remove(t),e.ya.delete(n),H6(e))}function h7(e,t,n){for(const r of n)r instanceof hae?(e.wa.addReference(r.key,t),BZe(e,r)):r instanceof pae?(Xe("SyncEngine","Document no longer in limbo: "+r.key),e.wa.removeReference(r.key,t),e.wa.containsKey(r.key)||_ae(e,r.key)):_t()}function BZe(e,t){const n=t.key,r=n.path.canonicalString();e.pa.get(n)||e.ga.has(r)||(Xe("SyncEngine","New document in limbo: "+n),e.ga.add(r),H6(e))}function H6(e){for(;e.ga.size>0&&e.pa.size{o.push(r.va(u,t,n).then(l=>{if((l||n)&&r.isPrimaryClient&&r.sharedClientState.updateQueryState(u.targetId,l!=null&&l.fromCache?"not-current":"current"),l){i.push(l);const c=M6.Qi(u.targetId,l);s.push(c)}}))}),await Promise.all(o),r.Va.a_(i),await async function(u,l){const c=Nt(u);try{await c.persistence.runTransaction("notifyLocalViewChanges","readwrite",f=>Ce.forEach(l,d=>Ce.forEach(d.ki,h=>c.persistence.referenceDelegate.addReference(f,d.targetId,h)).next(()=>Ce.forEach(d.qi,h=>c.persistence.referenceDelegate.removeReference(f,d.targetId,h)))))}catch(f){if(!fv(f))throw f;Xe("LocalStore","Failed to update sequence numbers: "+f)}for(const f of l){const d=f.targetId;if(!f.fromCache){const h=c.ts.get(d),p=h.snapshotVersion,m=h.withLastLimboFreeSnapshotVersion(p);c.ts=c.ts.insert(d,m)}}}(r.localStore,s))}async function jZe(e,t){const n=Nt(e);if(!n.currentUser.isEqual(t)){Xe("SyncEngine","User change. New user:",t.toKey());const r=await Zoe(n.localStore,t);n.currentUser=t,function(s,o){s.ba.forEach(a=>{a.forEach(u=>{u.reject(new tt(xe.CANCELLED,o))})}),s.ba.clear()}(n,"'waitForPendingWrites' promise is rejected due to a user change."),n.sharedClientState.handleUserChange(t,r.removedBatchIds,r.addedBatchIds),await gv(n,r._s)}}function UZe(e,t){const n=Nt(e),r=n.ya.get(t);if(r&&r.Ra)return Kt().add(r.key);{let i=Kt();const s=n.fa.get(t);if(!s)return i;for(const o of s){const a=n.ma.get(o);i=i.unionWith(a.view.ua)}return i}}function VZe(e){const t=Nt(e);return t.remoteStore.remoteSyncer.applyRemoteEvent=mae.bind(null,t),t.remoteStore.remoteSyncer.getRemoteKeysForTarget=UZe.bind(null,t),t.remoteStore.remoteSyncer.rejectListen=LZe.bind(null,t),t.Va.a_=xZe.bind(null,t.eventManager),t.Va.Fa=CZe.bind(null,t.eventManager),t}function zZe(e){const t=Nt(e);return t.remoteStore.remoteSyncer.applySuccessfulWrite=MZe.bind(null,t),t.remoteStore.remoteSyncer.rejectFailedWrite=FZe.bind(null,t),t}class p7{constructor(){this.synchronizeTabs=!1}async initialize(t){this.serializer=Dx(t.databaseInfo.databaseId),this.sharedClientState=this.createSharedClientState(t),this.persistence=this.createPersistence(t),await this.persistence.start(),this.localStore=this.createLocalStore(t),this.gcScheduler=this.createGarbageCollectionScheduler(t,this.localStore),this.indexBackfillerScheduler=this.createIndexBackfillerScheduler(t,this.localStore)}createGarbageCollectionScheduler(t,n){return null}createIndexBackfillerScheduler(t,n){return null}createLocalStore(t){return XJe(this.persistence,new KJe,t.initialUser,this.serializer)}createPersistence(t){return new qJe(L6.jr,this.serializer)}createSharedClientState(t){return new iZe}async terminate(){this.gcScheduler&&this.gcScheduler.stop(),await this.sharedClientState.shutdown(),await this.persistence.shutdown()}}class HZe{async initialize(t,n){this.localStore||(this.localStore=t.localStore,this.sharedClientState=t.sharedClientState,this.datastore=this.createDatastore(n),this.remoteStore=this.createRemoteStore(n),this.eventManager=this.createEventManager(n),this.syncEngine=this.createSyncEngine(n,!t.synchronizeTabs),this.sharedClientState.onlineStateHandler=r=>d7(this.syncEngine,r,1),this.remoteStore.remoteSyncer.handleCredentialChange=jZe.bind(null,this.syncEngine),await TZe(this.remoteStore,this.syncEngine.isPrimaryClient))}createEventManager(t){return function(){return new IZe}()}createDatastore(t){const n=Dx(t.databaseInfo.databaseId),r=function(s){return new uZe(s)}(t.databaseInfo);return function(s,o,a,u){return new fZe(s,o,a,u)}(t.authCredentials,t.appCheckCredentials,r,n)}createRemoteStore(t){return function(r,i,s,o,a){return new hZe(r,i,s,o,a)}(this.localStore,this.datastore,t.asyncQueue,n=>d7(this.syncEngine,n,0),function(){return l7.D()?new l7:new sZe}())}createSyncEngine(t,n){return function(i,s,o,a,u,l,c){const f=new RZe(i,s,o,a,u,l);return c&&(f.Ca=!0),f}(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,t.initialUser,t.maxConcurrentLimboResolutions,n)}terminate(){return async function(n){const r=Nt(n);Xe("RemoteStore","RemoteStore shutting down."),r.C_.add(5),await mv(r),r.F_.shutdown(),r.M_.set("Unknown")}(this.remoteStore)}}/** * @license * Copyright 2020 Google LLC * @@ -2188,7 +2188,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class bae{constructor(t){this.observer=t,this.muted=!1}next(t){this.observer.next&&this.Oa(this.observer.next,t)}error(t){this.observer.error?this.Oa(this.observer.error,t):Ml("Uncaught Error in snapshot listener:",t.toString())}Na(){this.muted=!0}Oa(t,n){this.muted||setTimeout(()=>{this.muted||t(n)},0)}}/** + */class vae{constructor(t){this.observer=t,this.muted=!1}next(t){this.observer.next&&this.Oa(this.observer.next,t)}error(t){this.observer.error?this.Oa(this.observer.error,t):Ml("Uncaught Error in snapshot listener:",t.toString())}Na(){this.muted=!0}Oa(t,n){this.muted||setTimeout(()=>{this.muted||t(n)},0)}}/** * @license * Copyright 2017 Google LLC * @@ -2203,7 +2203,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class WZe{constructor(t,n,r,i){this.authCredentials=t,this.appCheckCredentials=n,this.asyncQueue=r,this.databaseInfo=i,this.user=Ts.UNAUTHENTICATED,this.clientId=Eoe.newId(),this.authCredentialListener=()=>Promise.resolve(),this.appCheckCredentialListener=()=>Promise.resolve(),this.authCredentials.start(r,async s=>{Xe("FirestoreClient","Received user=",s.uid),await this.authCredentialListener(s),this.user=s}),this.appCheckCredentials.start(r,s=>(Xe("FirestoreClient","Received new app check token=",s),this.appCheckCredentialListener(s,this.user)))}async getConfiguration(){return{asyncQueue:this.asyncQueue,databaseInfo:this.databaseInfo,clientId:this.clientId,authCredentials:this.authCredentials,appCheckCredentials:this.appCheckCredentials,initialUser:this.user,maxConcurrentLimboResolutions:100}}setCredentialChangeListener(t){this.authCredentialListener=t}setAppCheckTokenChangeListener(t){this.appCheckCredentialListener=t}verifyNotTerminated(){if(this.asyncQueue.isShuttingDown)throw new tt(xe.FAILED_PRECONDITION,"The client has already been terminated.")}terminate(){this.asyncQueue.enterRestrictedMode();const t=new _l;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted(async()=>{try{this._onlineComponents&&await this._onlineComponents.terminate(),this._offlineComponents&&await this._offlineComponents.terminate(),this.authCredentials.shutdown(),this.appCheckCredentials.shutdown(),t.resolve()}catch(n){const r=V6(n,"Failed to shutdown persistence");t.reject(r)}}),t.promise}}async function xO(e,t){e.asyncQueue.verifyOperationInProgress(),Xe("FirestoreClient","Initializing OfflineComponentProvider");const n=await e.getConfiguration();await t.initialize(n);let r=n.initialUser;e.setCredentialChangeListener(async i=>{r.isEqual(i)||(await eae(t.localStore,i),r=i)}),t.persistence.setDatabaseDeletedListener(()=>e.terminate()),e._offlineComponents=t}async function m7(e,t){e.asyncQueue.verifyOperationInProgress();const n=await Eae(e);Xe("FirestoreClient","Initializing OnlineComponentProvider");const r=await e.getConfiguration();await t.initialize(n,r),e.setCredentialChangeListener(i=>c7(t.remoteStore,i)),e.setAppCheckTokenChangeListener((i,s)=>c7(t.remoteStore,s)),e._onlineComponents=t}function qZe(e){return e.name==="FirebaseError"?e.code===xe.FAILED_PRECONDITION||e.code===xe.UNIMPLEMENTED:!(typeof DOMException<"u"&&e instanceof DOMException)||e.code===22||e.code===20||e.code===11}async function Eae(e){if(!e._offlineComponents)if(e._uninitializedComponentsProvider){Xe("FirestoreClient","Using user provided OfflineComponentProvider");try{await xO(e,e._uninitializedComponentsProvider._offline)}catch(t){const n=t;if(!qZe(n))throw n;i_("Error using user provided cache. Falling back to memory cache: "+n),await xO(e,new p7)}}else Xe("FirestoreClient","Using default OfflineComponentProvider"),await xO(e,new p7);return e._offlineComponents}async function W6(e){return e._onlineComponents||(e._uninitializedComponentsProvider?(Xe("FirestoreClient","Using user provided OnlineComponentProvider"),await m7(e,e._uninitializedComponentsProvider._online)):(Xe("FirestoreClient","Using default OnlineComponentProvider"),await m7(e,new HZe))),e._onlineComponents}function YZe(e){return Eae(e).then(t=>t.persistence)}function GZe(e){return W6(e).then(t=>t.remoteStore)}function KZe(e){return W6(e).then(t=>t.syncEngine)}async function wae(e){const t=await W6(e),n=t.eventManager;return n.onListen=NZe.bind(null,t.syncEngine),n.onUnlisten=DZe.bind(null,t.syncEngine),n}function QZe(e){return e.asyncQueue.enqueue(async()=>{const t=await YZe(e),n=await GZe(e);return t.setNetworkEnabled(!0),function(i){const s=Nt(i);return s.C_.delete(0),pv(s)}(n)})}function XZe(e,t,n={}){const r=new _l;return e.asyncQueue.enqueueAndForget(async()=>function(s,o,a,u,l){const c=new bae({next:d=>{o.enqueueAndForget(()=>dae(s,f));const h=d.docs.has(a);!h&&d.fromCache?l.reject(new tt(xe.UNAVAILABLE,"Failed to get document because the client is offline.")):h&&d.fromCache&&u&&u.source==="server"?l.reject(new tt(xe.UNAVAILABLE,'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to "server" to retrieve the cached document.)')):l.resolve(d)},error:d=>l.reject(d)}),f=new hae(R6(a.path),c,{includeMetadataChanges:!0,J_:!0});return fae(s,f)}(await wae(e),e.asyncQueue,t,n,r)),r.promise}function JZe(e,t,n={}){const r=new _l;return e.asyncQueue.enqueueAndForget(async()=>function(s,o,a,u,l){const c=new bae({next:d=>{o.enqueueAndForget(()=>dae(s,f)),d.fromCache&&u.source==="server"?l.reject(new tt(xe.UNAVAILABLE,'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to "server" to retrieve the cached documents.)')):l.resolve(d)},error:d=>l.reject(d)}),f=new hae(a,c,{includeMetadataChanges:!0,J_:!0});return fae(s,f)}(await wae(e),e.asyncQueue,t,n,r)),r.promise}/** + */class WZe{constructor(t,n,r,i){this.authCredentials=t,this.appCheckCredentials=n,this.asyncQueue=r,this.databaseInfo=i,this.user=Ts.UNAUTHENTICATED,this.clientId=boe.newId(),this.authCredentialListener=()=>Promise.resolve(),this.appCheckCredentialListener=()=>Promise.resolve(),this.authCredentials.start(r,async s=>{Xe("FirestoreClient","Received user=",s.uid),await this.authCredentialListener(s),this.user=s}),this.appCheckCredentials.start(r,s=>(Xe("FirestoreClient","Received new app check token=",s),this.appCheckCredentialListener(s,this.user)))}async getConfiguration(){return{asyncQueue:this.asyncQueue,databaseInfo:this.databaseInfo,clientId:this.clientId,authCredentials:this.authCredentials,appCheckCredentials:this.appCheckCredentials,initialUser:this.user,maxConcurrentLimboResolutions:100}}setCredentialChangeListener(t){this.authCredentialListener=t}setAppCheckTokenChangeListener(t){this.appCheckCredentialListener=t}verifyNotTerminated(){if(this.asyncQueue.isShuttingDown)throw new tt(xe.FAILED_PRECONDITION,"The client has already been terminated.")}terminate(){this.asyncQueue.enterRestrictedMode();const t=new _l;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted(async()=>{try{this._onlineComponents&&await this._onlineComponents.terminate(),this._offlineComponents&&await this._offlineComponents.terminate(),this.authCredentials.shutdown(),this.appCheckCredentials.shutdown(),t.resolve()}catch(n){const r=V6(n,"Failed to shutdown persistence");t.reject(r)}}),t.promise}}async function xO(e,t){e.asyncQueue.verifyOperationInProgress(),Xe("FirestoreClient","Initializing OfflineComponentProvider");const n=await e.getConfiguration();await t.initialize(n);let r=n.initialUser;e.setCredentialChangeListener(async i=>{r.isEqual(i)||(await Zoe(t.localStore,i),r=i)}),t.persistence.setDatabaseDeletedListener(()=>e.terminate()),e._offlineComponents=t}async function m7(e,t){e.asyncQueue.verifyOperationInProgress();const n=await bae(e);Xe("FirestoreClient","Initializing OnlineComponentProvider");const r=await e.getConfiguration();await t.initialize(n,r),e.setCredentialChangeListener(i=>c7(t.remoteStore,i)),e.setAppCheckTokenChangeListener((i,s)=>c7(t.remoteStore,s)),e._onlineComponents=t}function qZe(e){return e.name==="FirebaseError"?e.code===xe.FAILED_PRECONDITION||e.code===xe.UNIMPLEMENTED:!(typeof DOMException<"u"&&e instanceof DOMException)||e.code===22||e.code===20||e.code===11}async function bae(e){if(!e._offlineComponents)if(e._uninitializedComponentsProvider){Xe("FirestoreClient","Using user provided OfflineComponentProvider");try{await xO(e,e._uninitializedComponentsProvider._offline)}catch(t){const n=t;if(!qZe(n))throw n;i_("Error using user provided cache. Falling back to memory cache: "+n),await xO(e,new p7)}}else Xe("FirestoreClient","Using default OfflineComponentProvider"),await xO(e,new p7);return e._offlineComponents}async function W6(e){return e._onlineComponents||(e._uninitializedComponentsProvider?(Xe("FirestoreClient","Using user provided OnlineComponentProvider"),await m7(e,e._uninitializedComponentsProvider._online)):(Xe("FirestoreClient","Using default OnlineComponentProvider"),await m7(e,new HZe))),e._onlineComponents}function YZe(e){return bae(e).then(t=>t.persistence)}function GZe(e){return W6(e).then(t=>t.remoteStore)}function KZe(e){return W6(e).then(t=>t.syncEngine)}async function Eae(e){const t=await W6(e),n=t.eventManager;return n.onListen=NZe.bind(null,t.syncEngine),n.onUnlisten=DZe.bind(null,t.syncEngine),n}function QZe(e){return e.asyncQueue.enqueue(async()=>{const t=await YZe(e),n=await GZe(e);return t.setNetworkEnabled(!0),function(i){const s=Nt(i);return s.C_.delete(0),pv(s)}(n)})}function XZe(e,t,n={}){const r=new _l;return e.asyncQueue.enqueueAndForget(async()=>function(s,o,a,u,l){const c=new vae({next:d=>{o.enqueueAndForget(()=>fae(s,f));const h=d.docs.has(a);!h&&d.fromCache?l.reject(new tt(xe.UNAVAILABLE,"Failed to get document because the client is offline.")):h&&d.fromCache&&u&&u.source==="server"?l.reject(new tt(xe.UNAVAILABLE,'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to "server" to retrieve the cached document.)')):l.resolve(d)},error:d=>l.reject(d)}),f=new dae(R6(a.path),c,{includeMetadataChanges:!0,J_:!0});return cae(s,f)}(await Eae(e),e.asyncQueue,t,n,r)),r.promise}function JZe(e,t,n={}){const r=new _l;return e.asyncQueue.enqueueAndForget(async()=>function(s,o,a,u,l){const c=new vae({next:d=>{o.enqueueAndForget(()=>fae(s,f)),d.fromCache&&u.source==="server"?l.reject(new tt(xe.UNAVAILABLE,'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to "server" to retrieve the cached documents.)')):l.resolve(d)},error:d=>l.reject(d)}),f=new dae(a,c,{includeMetadataChanges:!0,J_:!0});return cae(s,f)}(await Eae(e),e.asyncQueue,t,n,r)),r.promise}/** * @license * Copyright 2023 Google LLC * @@ -2218,7 +2218,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function Tae(e){const t={};return e.timeoutSeconds!==void 0&&(t.timeoutSeconds=e.timeoutSeconds),t}/** + */function wae(e){const t={};return e.timeoutSeconds!==void 0&&(t.timeoutSeconds=e.timeoutSeconds),t}/** * @license * Copyright 2020 Google LLC * @@ -2248,7 +2248,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function Sae(e,t,n){if(!n)throw new tt(xe.INVALID_ARGUMENT,`Function ${e}() cannot be called with an empty ${t}.`)}function ZZe(e,t,n,r){if(t===!0&&r===!0)throw new tt(xe.INVALID_ARGUMENT,`${e} and ${n} cannot be used together.`)}function y7(e){if(!dt.isDocumentKey(e))throw new tt(xe.INVALID_ARGUMENT,`Invalid document reference. Document references must have an even number of segments, but ${e} has ${e.length}.`)}function _7(e){if(dt.isDocumentKey(e))throw new tt(xe.INVALID_ARGUMENT,`Invalid collection reference. Collection references must have an odd number of segments, but ${e} has ${e.length}.`)}function q6(e){if(e===void 0)return"undefined";if(e===null)return"null";if(typeof e=="string")return e.length>20&&(e=`${e.substring(0,20)}...`),JSON.stringify(e);if(typeof e=="number"||typeof e=="boolean")return""+e;if(typeof e=="object"){if(e instanceof Array)return"an array";{const t=function(r){return r.constructor?r.constructor.name:null}(e);return t?`a custom ${t} object`:"an object"}}return typeof e=="function"?"a function":_t()}function qd(e,t){if("_delegate"in e&&(e=e._delegate),!(e instanceof t)){if(t.name===e.constructor.name)throw new tt(xe.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{const n=q6(e);throw new tt(xe.INVALID_ARGUMENT,`Expected type '${t.name}', but it was: ${n}`)}}return e}/** + */function Tae(e,t,n){if(!n)throw new tt(xe.INVALID_ARGUMENT,`Function ${e}() cannot be called with an empty ${t}.`)}function ZZe(e,t,n,r){if(t===!0&&r===!0)throw new tt(xe.INVALID_ARGUMENT,`${e} and ${n} cannot be used together.`)}function y7(e){if(!dt.isDocumentKey(e))throw new tt(xe.INVALID_ARGUMENT,`Invalid document reference. Document references must have an even number of segments, but ${e} has ${e.length}.`)}function _7(e){if(dt.isDocumentKey(e))throw new tt(xe.INVALID_ARGUMENT,`Invalid collection reference. Collection references must have an odd number of segments, but ${e} has ${e.length}.`)}function q6(e){if(e===void 0)return"undefined";if(e===null)return"null";if(typeof e=="string")return e.length>20&&(e=`${e.substring(0,20)}...`),JSON.stringify(e);if(typeof e=="number"||typeof e=="boolean")return""+e;if(typeof e=="object"){if(e instanceof Array)return"an array";{const t=function(r){return r.constructor?r.constructor.name:null}(e);return t?`a custom ${t} object`:"an object"}}return typeof e=="function"?"a function":_t()}function qd(e,t){if("_delegate"in e&&(e=e._delegate),!(e instanceof t)){if(t.name===e.constructor.name)throw new tt(xe.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{const n=q6(e);throw new tt(xe.INVALID_ARGUMENT,`Expected type '${t.name}', but it was: ${n}`)}}return e}/** * @license * Copyright 2020 Google LLC * @@ -2263,7 +2263,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class v7{constructor(t){var n,r;if(t.host===void 0){if(t.ssl!==void 0)throw new tt(xe.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host="firestore.googleapis.com",this.ssl=!0}else this.host=t.host,this.ssl=(n=t.ssl)===null||n===void 0||n;if(this.credentials=t.credentials,this.ignoreUndefinedProperties=!!t.ignoreUndefinedProperties,this.localCache=t.localCache,t.cacheSizeBytes===void 0)this.cacheSizeBytes=41943040;else{if(t.cacheSizeBytes!==-1&&t.cacheSizeBytes<1048576)throw new tt(xe.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=t.cacheSizeBytes}ZZe("experimentalForceLongPolling",t.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",t.experimentalAutoDetectLongPolling),this.experimentalForceLongPolling=!!t.experimentalForceLongPolling,this.experimentalForceLongPolling?this.experimentalAutoDetectLongPolling=!1:t.experimentalAutoDetectLongPolling===void 0?this.experimentalAutoDetectLongPolling=!0:this.experimentalAutoDetectLongPolling=!!t.experimentalAutoDetectLongPolling,this.experimentalLongPollingOptions=Tae((r=t.experimentalLongPollingOptions)!==null&&r!==void 0?r:{}),function(s){if(s.timeoutSeconds!==void 0){if(isNaN(s.timeoutSeconds))throw new tt(xe.INVALID_ARGUMENT,`invalid long polling timeout: ${s.timeoutSeconds} (must not be NaN)`);if(s.timeoutSeconds<5)throw new tt(xe.INVALID_ARGUMENT,`invalid long polling timeout: ${s.timeoutSeconds} (minimum allowed value is 5)`);if(s.timeoutSeconds>30)throw new tt(xe.INVALID_ARGUMENT,`invalid long polling timeout: ${s.timeoutSeconds} (maximum allowed value is 30)`)}}(this.experimentalLongPollingOptions),this.useFetchStreams=!!t.useFetchStreams}isEqual(t){return this.host===t.host&&this.ssl===t.ssl&&this.credentials===t.credentials&&this.cacheSizeBytes===t.cacheSizeBytes&&this.experimentalForceLongPolling===t.experimentalForceLongPolling&&this.experimentalAutoDetectLongPolling===t.experimentalAutoDetectLongPolling&&function(r,i){return r.timeoutSeconds===i.timeoutSeconds}(this.experimentalLongPollingOptions,t.experimentalLongPollingOptions)&&this.ignoreUndefinedProperties===t.ignoreUndefinedProperties&&this.useFetchStreams===t.useFetchStreams}}class Y6{constructor(t,n,r,i){this._authCredentials=t,this._appCheckCredentials=n,this._databaseId=r,this._app=i,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new v7({}),this._settingsFrozen=!1}get app(){if(!this._app)throw new tt(xe.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._app}get _initialized(){return this._settingsFrozen}get _terminated(){return this._terminateTask!==void 0}_setSettings(t){if(this._settingsFrozen)throw new tt(xe.FAILED_PRECONDITION,"Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");this._settings=new v7(t),t.credentials!==void 0&&(this._authCredentials=function(r){if(!r)return new _Xe;switch(r.type){case"firstParty":return new EXe(r.sessionIndex||"0",r.iamToken||null,r.authTokenFactory||null);case"provider":return r.client;default:throw new tt(xe.INVALID_ARGUMENT,"makeAuthCredentialsProvider failed due to invalid credential type")}}(t.credentials))}_getSettings(){return this._settings}_freezeSettings(){return this._settingsFrozen=!0,this._settings}_delete(){return this._terminateTask||(this._terminateTask=this._terminate()),this._terminateTask}toJSON(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}}_terminate(){return function(n){const r=g7.get(n);r&&(Xe("ComponentProvider","Removing Datastore"),g7.delete(n),r.terminate())}(this),Promise.resolve()}}/** + */class v7{constructor(t){var n,r;if(t.host===void 0){if(t.ssl!==void 0)throw new tt(xe.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host="firestore.googleapis.com",this.ssl=!0}else this.host=t.host,this.ssl=(n=t.ssl)===null||n===void 0||n;if(this.credentials=t.credentials,this.ignoreUndefinedProperties=!!t.ignoreUndefinedProperties,this.localCache=t.localCache,t.cacheSizeBytes===void 0)this.cacheSizeBytes=41943040;else{if(t.cacheSizeBytes!==-1&&t.cacheSizeBytes<1048576)throw new tt(xe.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=t.cacheSizeBytes}ZZe("experimentalForceLongPolling",t.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",t.experimentalAutoDetectLongPolling),this.experimentalForceLongPolling=!!t.experimentalForceLongPolling,this.experimentalForceLongPolling?this.experimentalAutoDetectLongPolling=!1:t.experimentalAutoDetectLongPolling===void 0?this.experimentalAutoDetectLongPolling=!0:this.experimentalAutoDetectLongPolling=!!t.experimentalAutoDetectLongPolling,this.experimentalLongPollingOptions=wae((r=t.experimentalLongPollingOptions)!==null&&r!==void 0?r:{}),function(s){if(s.timeoutSeconds!==void 0){if(isNaN(s.timeoutSeconds))throw new tt(xe.INVALID_ARGUMENT,`invalid long polling timeout: ${s.timeoutSeconds} (must not be NaN)`);if(s.timeoutSeconds<5)throw new tt(xe.INVALID_ARGUMENT,`invalid long polling timeout: ${s.timeoutSeconds} (minimum allowed value is 5)`);if(s.timeoutSeconds>30)throw new tt(xe.INVALID_ARGUMENT,`invalid long polling timeout: ${s.timeoutSeconds} (maximum allowed value is 30)`)}}(this.experimentalLongPollingOptions),this.useFetchStreams=!!t.useFetchStreams}isEqual(t){return this.host===t.host&&this.ssl===t.ssl&&this.credentials===t.credentials&&this.cacheSizeBytes===t.cacheSizeBytes&&this.experimentalForceLongPolling===t.experimentalForceLongPolling&&this.experimentalAutoDetectLongPolling===t.experimentalAutoDetectLongPolling&&function(r,i){return r.timeoutSeconds===i.timeoutSeconds}(this.experimentalLongPollingOptions,t.experimentalLongPollingOptions)&&this.ignoreUndefinedProperties===t.ignoreUndefinedProperties&&this.useFetchStreams===t.useFetchStreams}}class Y6{constructor(t,n,r,i){this._authCredentials=t,this._appCheckCredentials=n,this._databaseId=r,this._app=i,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new v7({}),this._settingsFrozen=!1}get app(){if(!this._app)throw new tt(xe.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._app}get _initialized(){return this._settingsFrozen}get _terminated(){return this._terminateTask!==void 0}_setSettings(t){if(this._settingsFrozen)throw new tt(xe.FAILED_PRECONDITION,"Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");this._settings=new v7(t),t.credentials!==void 0&&(this._authCredentials=function(r){if(!r)return new _Xe;switch(r.type){case"firstParty":return new EXe(r.sessionIndex||"0",r.iamToken||null,r.authTokenFactory||null);case"provider":return r.client;default:throw new tt(xe.INVALID_ARGUMENT,"makeAuthCredentialsProvider failed due to invalid credential type")}}(t.credentials))}_getSettings(){return this._settings}_freezeSettings(){return this._settingsFrozen=!0,this._settings}_delete(){return this._terminateTask||(this._terminateTask=this._terminate()),this._terminateTask}toJSON(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}}_terminate(){return function(n){const r=g7.get(n);r&&(Xe("ComponentProvider","Removing Datastore"),g7.delete(n),r.terminate())}(this),Promise.resolve()}}/** * @license * Copyright 2020 Google LLC * @@ -2278,7 +2278,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class Lx{constructor(t,n,r){this.converter=n,this._query=r,this.type="query",this.firestore=t}withConverter(t){return new Lx(this.firestore,t,this._query)}}class ho{constructor(t,n,r){this.converter=n,this._key=r,this.type="document",this.firestore=t}get _path(){return this._key.path}get id(){return this._key.path.lastSegment()}get path(){return this._key.path.canonicalString()}get parent(){return new Gc(this.firestore,this.converter,this._key.path.popLast())}withConverter(t){return new ho(this.firestore,t,this._key)}}class Gc extends Lx{constructor(t,n,r){super(t,n,R6(r)),this._path=r,this.type="collection"}get id(){return this._query.path.lastSegment()}get path(){return this._query.path.canonicalString()}get parent(){const t=this._path.popLast();return t.isEmpty()?null:new ho(this.firestore,null,new dt(t))}withConverter(t){return new Gc(this.firestore,t,this._path)}}function b7(e,t,...n){if(e=Zi(e),Sae("collection","path",t),e instanceof Y6){const r=ur.fromString(t,...n);return _7(r),new Gc(e,null,r)}{if(!(e instanceof ho||e instanceof Gc))throw new tt(xe.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const r=e._path.child(ur.fromString(t,...n));return _7(r),new Gc(e.firestore,null,r)}}function Ba(e,t,...n){if(e=Zi(e),arguments.length===1&&(t=Eoe.newId()),Sae("doc","path",t),e instanceof Y6){const r=ur.fromString(t,...n);return y7(r),new ho(e,null,new dt(r))}{if(!(e instanceof ho||e instanceof Gc))throw new tt(xe.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const r=e._path.child(ur.fromString(t,...n));return y7(r),new ho(e.firestore,e instanceof Gc?e.converter:null,new dt(r))}}/** + */class Lx{constructor(t,n,r){this.converter=n,this._query=r,this.type="query",this.firestore=t}withConverter(t){return new Lx(this.firestore,t,this._query)}}class ho{constructor(t,n,r){this.converter=n,this._key=r,this.type="document",this.firestore=t}get _path(){return this._key.path}get id(){return this._key.path.lastSegment()}get path(){return this._key.path.canonicalString()}get parent(){return new Gc(this.firestore,this.converter,this._key.path.popLast())}withConverter(t){return new ho(this.firestore,t,this._key)}}class Gc extends Lx{constructor(t,n,r){super(t,n,R6(r)),this._path=r,this.type="collection"}get id(){return this._query.path.lastSegment()}get path(){return this._query.path.canonicalString()}get parent(){const t=this._path.popLast();return t.isEmpty()?null:new ho(this.firestore,null,new dt(t))}withConverter(t){return new Gc(this.firestore,t,this._path)}}function b7(e,t,...n){if(e=Zi(e),Tae("collection","path",t),e instanceof Y6){const r=ur.fromString(t,...n);return _7(r),new Gc(e,null,r)}{if(!(e instanceof ho||e instanceof Gc))throw new tt(xe.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const r=e._path.child(ur.fromString(t,...n));return _7(r),new Gc(e.firestore,null,r)}}function Ba(e,t,...n){if(e=Zi(e),arguments.length===1&&(t=boe.newId()),Tae("doc","path",t),e instanceof Y6){const r=ur.fromString(t,...n);return y7(r),new ho(e,null,new dt(r))}{if(!(e instanceof ho||e instanceof Gc))throw new tt(xe.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const r=e._path.child(ur.fromString(t,...n));return y7(r),new ho(e.firestore,e instanceof Gc?e.converter:null,new dt(r))}}/** * @license * Copyright 2020 Google LLC * @@ -2293,8 +2293,8 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class eet{constructor(){this.Ja=Promise.resolve(),this.Ya=[],this.Za=!1,this.Xa=[],this.eu=null,this.tu=!1,this.nu=!1,this.ru=[],this.zo=new nae(this,"async_queue_retry"),this.iu=()=>{const n=IO();n&&Xe("AsyncQueue","Visibility state changed to "+n.visibilityState),this.zo.Qo()};const t=IO();t&&typeof t.addEventListener=="function"&&t.addEventListener("visibilitychange",this.iu)}get isShuttingDown(){return this.Za}enqueueAndForget(t){this.enqueue(t)}enqueueAndForgetEvenWhileRestricted(t){this.su(),this.ou(t)}enterRestrictedMode(t){if(!this.Za){this.Za=!0,this.nu=t||!1;const n=IO();n&&typeof n.removeEventListener=="function"&&n.removeEventListener("visibilitychange",this.iu)}}enqueue(t){if(this.su(),this.Za)return new Promise(()=>{});const n=new _l;return this.ou(()=>this.Za&&this.nu?Promise.resolve():(t().then(n.resolve,n.reject),n.promise)).then(()=>n.promise)}enqueueRetryable(t){this.enqueueAndForget(()=>(this.Ya.push(t),this._u()))}async _u(){if(this.Ya.length!==0){try{await this.Ya[0](),this.Ya.shift(),this.zo.reset()}catch(t){if(!fv(t))throw t;Xe("AsyncQueue","Operation failed with retryable error: "+t)}this.Ya.length>0&&this.zo.ko(()=>this._u())}}ou(t){const n=this.Ja.then(()=>(this.tu=!0,t().catch(r=>{this.eu=r,this.tu=!1;const i=function(o){let a=o.message||"";return o.stack&&(a=o.stack.includes(o.message)?o.stack:o.message+` -`+o.stack),a}(r);throw Ml("INTERNAL UNHANDLED ERROR: ",i),r}).then(r=>(this.tu=!1,r))));return this.Ja=n,n}enqueueAfterDelay(t,n,r){this.su(),this.ru.indexOf(t)>-1&&(n=0);const i=U6.createAndSchedule(this,t,n,r,s=>this.au(s));return this.Xa.push(i),i}su(){this.eu&&_t()}verifyOperationInProgress(){}async uu(){let t;do t=this.Ja,await t;while(t!==this.Ja)}cu(t){for(const n of this.Xa)if(n.timerId===t)return!0;return!1}lu(t){return this.uu().then(()=>{this.Xa.sort((n,r)=>n.targetTimeMs-r.targetTimeMs);for(const n of this.Xa)if(n.skipDelay(),t!=="all"&&n.timerId===t)break;return this.uu()})}hu(t){this.ru.push(t)}au(t){const n=this.Xa.indexOf(t);this.Xa.splice(n,1)}}class yv extends Y6{constructor(t,n,r,i){super(t,n,r,i),this.type="firestore",this._queue=function(){return new eet}(),this._persistenceKey=(i==null?void 0:i.name)||"[DEFAULT]"}_terminate(){return this._firestoreClient||Iae(this),this._firestoreClient.terminate()}}function tet(e,t,n){n||(n="(default)");const r=ig(e,"firestore");if(r.isInitialized(n)){const i=r.getImmediate({identifier:n}),s=r.getOptions(n);if(Gy(s,t))return i;throw new tt(xe.FAILED_PRECONDITION,"initializeFirestore() has already been called with different options. To avoid this error, call initializeFirestore() with the same options as when it was originally called, or call getFirestore() to return the already initialized instance.")}if(t.cacheSizeBytes!==void 0&&t.localCache!==void 0)throw new tt(xe.INVALID_ARGUMENT,"cache and cacheSizeBytes cannot be specified at the same time as cacheSizeBytes willbe deprecated. Instead, specify the cache size in the cache object");if(t.cacheSizeBytes!==void 0&&t.cacheSizeBytes!==-1&&t.cacheSizeBytes<1048576)throw new tt(xe.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");return r.initialize({options:t,instanceIdentifier:n})}function Mx(e){return e._firestoreClient||Iae(e),e._firestoreClient.verifyNotTerminated(),e._firestoreClient}function Iae(e){var t,n,r;const i=e._freezeSettings(),s=function(a,u,l,c){return new kXe(a,u,l,c.host,c.ssl,c.experimentalForceLongPolling,c.experimentalAutoDetectLongPolling,Tae(c.experimentalLongPollingOptions),c.useFetchStreams)}(e._databaseId,((t=e._app)===null||t===void 0?void 0:t.options.appId)||"",e._persistenceKey,i);e._firestoreClient=new WZe(e._authCredentials,e._appCheckCredentials,e._queue,s),!((n=i.localCache)===null||n===void 0)&&n._offlineComponentProvider&&(!((r=i.localCache)===null||r===void 0)&&r._onlineComponentProvider)&&(e._firestoreClient._uninitializedComponentsProvider={_offlineKind:i.localCache.kind,_offline:i.localCache._offlineComponentProvider,_online:i.localCache._onlineComponentProvider})}function net(e){return QZe(Mx(e=qd(e,yv)))}/** + */class eet{constructor(){this.Ja=Promise.resolve(),this.Ya=[],this.Za=!1,this.Xa=[],this.eu=null,this.tu=!1,this.nu=!1,this.ru=[],this.zo=new tae(this,"async_queue_retry"),this.iu=()=>{const n=IO();n&&Xe("AsyncQueue","Visibility state changed to "+n.visibilityState),this.zo.Qo()};const t=IO();t&&typeof t.addEventListener=="function"&&t.addEventListener("visibilitychange",this.iu)}get isShuttingDown(){return this.Za}enqueueAndForget(t){this.enqueue(t)}enqueueAndForgetEvenWhileRestricted(t){this.su(),this.ou(t)}enterRestrictedMode(t){if(!this.Za){this.Za=!0,this.nu=t||!1;const n=IO();n&&typeof n.removeEventListener=="function"&&n.removeEventListener("visibilitychange",this.iu)}}enqueue(t){if(this.su(),this.Za)return new Promise(()=>{});const n=new _l;return this.ou(()=>this.Za&&this.nu?Promise.resolve():(t().then(n.resolve,n.reject),n.promise)).then(()=>n.promise)}enqueueRetryable(t){this.enqueueAndForget(()=>(this.Ya.push(t),this._u()))}async _u(){if(this.Ya.length!==0){try{await this.Ya[0](),this.Ya.shift(),this.zo.reset()}catch(t){if(!fv(t))throw t;Xe("AsyncQueue","Operation failed with retryable error: "+t)}this.Ya.length>0&&this.zo.ko(()=>this._u())}}ou(t){const n=this.Ja.then(()=>(this.tu=!0,t().catch(r=>{this.eu=r,this.tu=!1;const i=function(o){let a=o.message||"";return o.stack&&(a=o.stack.includes(o.message)?o.stack:o.message+` +`+o.stack),a}(r);throw Ml("INTERNAL UNHANDLED ERROR: ",i),r}).then(r=>(this.tu=!1,r))));return this.Ja=n,n}enqueueAfterDelay(t,n,r){this.su(),this.ru.indexOf(t)>-1&&(n=0);const i=U6.createAndSchedule(this,t,n,r,s=>this.au(s));return this.Xa.push(i),i}su(){this.eu&&_t()}verifyOperationInProgress(){}async uu(){let t;do t=this.Ja,await t;while(t!==this.Ja)}cu(t){for(const n of this.Xa)if(n.timerId===t)return!0;return!1}lu(t){return this.uu().then(()=>{this.Xa.sort((n,r)=>n.targetTimeMs-r.targetTimeMs);for(const n of this.Xa)if(n.skipDelay(),t!=="all"&&n.timerId===t)break;return this.uu()})}hu(t){this.ru.push(t)}au(t){const n=this.Xa.indexOf(t);this.Xa.splice(n,1)}}class yv extends Y6{constructor(t,n,r,i){super(t,n,r,i),this.type="firestore",this._queue=function(){return new eet}(),this._persistenceKey=(i==null?void 0:i.name)||"[DEFAULT]"}_terminate(){return this._firestoreClient||Sae(this),this._firestoreClient.terminate()}}function tet(e,t,n){n||(n="(default)");const r=ig(e,"firestore");if(r.isInitialized(n)){const i=r.getImmediate({identifier:n}),s=r.getOptions(n);if(Gy(s,t))return i;throw new tt(xe.FAILED_PRECONDITION,"initializeFirestore() has already been called with different options. To avoid this error, call initializeFirestore() with the same options as when it was originally called, or call getFirestore() to return the already initialized instance.")}if(t.cacheSizeBytes!==void 0&&t.localCache!==void 0)throw new tt(xe.INVALID_ARGUMENT,"cache and cacheSizeBytes cannot be specified at the same time as cacheSizeBytes willbe deprecated. Instead, specify the cache size in the cache object");if(t.cacheSizeBytes!==void 0&&t.cacheSizeBytes!==-1&&t.cacheSizeBytes<1048576)throw new tt(xe.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");return r.initialize({options:t,instanceIdentifier:n})}function Mx(e){return e._firestoreClient||Sae(e),e._firestoreClient.verifyNotTerminated(),e._firestoreClient}function Sae(e){var t,n,r;const i=e._freezeSettings(),s=function(a,u,l,c){return new kXe(a,u,l,c.host,c.ssl,c.experimentalForceLongPolling,c.experimentalAutoDetectLongPolling,wae(c.experimentalLongPollingOptions),c.useFetchStreams)}(e._databaseId,((t=e._app)===null||t===void 0?void 0:t.options.appId)||"",e._persistenceKey,i);e._firestoreClient=new WZe(e._authCredentials,e._appCheckCredentials,e._queue,s),!((n=i.localCache)===null||n===void 0)&&n._offlineComponentProvider&&(!((r=i.localCache)===null||r===void 0)&&r._onlineComponentProvider)&&(e._firestoreClient._uninitializedComponentsProvider={_offlineKind:i.localCache.kind,_offline:i.localCache._offlineComponentProvider,_online:i.localCache._onlineComponentProvider})}function net(e){return QZe(Mx(e=qd(e,yv)))}/** * @license * Copyright 2020 Google LLC * @@ -2339,7 +2339,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class xae{constructor(t){this._methodName=t}}/** + */class Iae{constructor(t){this._methodName=t}}/** * @license * Copyright 2017 Google LLC * @@ -2369,7 +2369,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const ret=/^__.*__$/;class iet{constructor(t,n,r){this.data=t,this.fieldMask=n,this.fieldTransforms=r}toMutation(t,n){return this.fieldMask!==null?new dh(t,this.data,this.fieldMask,n,this.fieldTransforms):new dv(t,this.data,n,this.fieldTransforms)}}function Cae(e){switch(e){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw _t()}}class Q6{constructor(t,n,r,i,s,o){this.settings=t,this.databaseId=n,this.serializer=r,this.ignoreUndefinedProperties=i,s===void 0&&this.Pu(),this.fieldTransforms=s||[],this.fieldMask=o||[]}get path(){return this.settings.path}get Iu(){return this.settings.Iu}Tu(t){return new Q6(Object.assign(Object.assign({},this.settings),t),this.databaseId,this.serializer,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)}Eu(t){var n;const r=(n=this.path)===null||n===void 0?void 0:n.child(t),i=this.Tu({path:r,du:!1});return i.Au(t),i}Ru(t){var n;const r=(n=this.path)===null||n===void 0?void 0:n.child(t),i=this.Tu({path:r,du:!1});return i.Pu(),i}Vu(t){return this.Tu({path:void 0,du:!0})}mu(t){return oS(t,this.settings.methodName,this.settings.fu||!1,this.path,this.settings.gu)}contains(t){return this.fieldMask.find(n=>t.isPrefixOf(n))!==void 0||this.fieldTransforms.find(n=>t.isPrefixOf(n.field))!==void 0}Pu(){if(this.path)for(let t=0;tu.covers(f.field))}else u=null,l=o.fieldTransforms;return new iet(new Bo(a),u,l)}function Aae(e,t){if(Pae(e=Zi(e)))return Rae("Unsupported field value:",t,e),Oae(e,t);if(e instanceof xae)return function(r,i){if(!Cae(i.Iu))throw i.mu(`${r._methodName}() can only be used with update() and set()`);if(!i.path)throw i.mu(`${r._methodName}() is not currently supported inside arrays`);const s=r._toFieldTransform(i);s&&i.fieldTransforms.push(s)}(e,t),null;if(e===void 0&&t.ignoreUndefinedProperties)return null;if(t.path&&t.fieldMask.push(t.path),e instanceof Array){if(t.settings.du&&t.Iu!==4)throw t.mu("Nested arrays are not supported");return function(r,i){const s=[];let o=0;for(const a of r){let u=Aae(a,i.Vu(o));u==null&&(u={nullValue:"NULL_VALUE"}),s.push(u),o++}return{arrayValue:{values:s}}}(e,t)}return function(r,i){if((r=Zi(r))===null)return{nullValue:"NULL_VALUE"};if(typeof r=="number")return tJe(i.serializer,r);if(typeof r=="boolean")return{booleanValue:r};if(typeof r=="string")return{stringValue:r};if(r instanceof Date){const s=Zr.fromDate(r);return{timestampValue:iS(i.serializer,s)}}if(r instanceof Zr){const s=new Zr(r.seconds,1e3*Math.floor(r.nanoseconds/1e3));return{timestampValue:iS(i.serializer,s)}}if(r instanceof K6)return{geoPointValue:{latitude:r.latitude,longitude:r.longitude}};if(r instanceof Cm)return{bytesValue:Goe(i.serializer,r._byteString)};if(r instanceof ho){const s=i.databaseId,o=r.firestore._databaseId;if(!o.isEqual(s))throw i.mu(`Document reference is for database ${o.projectId}/${o.database} but should be for database ${s.projectId}/${s.database}`);return{referenceValue:D6(r.firestore._databaseId||i.databaseId,r._key.path)}}throw i.mu(`Unsupported field value: ${q6(r)}`)}(e,t)}function Oae(e,t){const n={};return woe(e)?t.path&&t.path.length>0&&t.fieldMask.push(t.path):ug(e,(r,i)=>{const s=Aae(i,t.Eu(r));s!=null&&(n[r]=s)}),{mapValue:{fields:n}}}function Pae(e){return!(typeof e!="object"||e===null||e instanceof Array||e instanceof Date||e instanceof Zr||e instanceof K6||e instanceof Cm||e instanceof ho||e instanceof xae)}function Rae(e,t,n){if(!Pae(n)||!function(i){return typeof i=="object"&&i!==null&&(Object.getPrototypeOf(i)===Object.prototype||Object.getPrototypeOf(i)===null)}(n)){const r=q6(n);throw r==="an object"?t.mu(e+" a custom object"):t.mu(e+" "+r)}}function uet(e,t,n){if((t=Zi(t))instanceof G6)return t._internalPath;if(typeof t=="string")return Nae(e,t);throw oS("Field path arguments must be of type string or ",e,!1,void 0,n)}const cet=new RegExp("[~\\*/\\[\\]]");function Nae(e,t,n){if(t.search(cet)>=0)throw oS(`Invalid field path (${t}). Paths must not contain '~', '*', '/', '[', or ']'`,e,!1,void 0,n);try{return new G6(...t.split("."))._internalPath}catch{throw oS(`Invalid field path (${t}). Paths must not be empty, begin with '.', end with '.', or contain '..'`,e,!1,void 0,n)}}function oS(e,t,n,r,i){const s=r&&!r.isEmpty(),o=i!==void 0;let a=`Function ${t}() called with invalid data`;n&&(a+=" (via `toFirestore()`)"),a+=". ";let u="";return(s||o)&&(u+=" (found",s&&(u+=` in field ${r}`),o&&(u+=` in document ${i}`),u+=")"),new tt(xe.INVALID_ARGUMENT,a+e+u)}function fet(e,t){return e.some(n=>n.isEqual(t))}/** + */const ret=/^__.*__$/;class iet{constructor(t,n,r){this.data=t,this.fieldMask=n,this.fieldTransforms=r}toMutation(t,n){return this.fieldMask!==null?new dh(t,this.data,this.fieldMask,n,this.fieldTransforms):new dv(t,this.data,n,this.fieldTransforms)}}function xae(e){switch(e){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw _t()}}class Q6{constructor(t,n,r,i,s,o){this.settings=t,this.databaseId=n,this.serializer=r,this.ignoreUndefinedProperties=i,s===void 0&&this.Pu(),this.fieldTransforms=s||[],this.fieldMask=o||[]}get path(){return this.settings.path}get Iu(){return this.settings.Iu}Tu(t){return new Q6(Object.assign(Object.assign({},this.settings),t),this.databaseId,this.serializer,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)}Eu(t){var n;const r=(n=this.path)===null||n===void 0?void 0:n.child(t),i=this.Tu({path:r,du:!1});return i.Au(t),i}Ru(t){var n;const r=(n=this.path)===null||n===void 0?void 0:n.child(t),i=this.Tu({path:r,du:!1});return i.Pu(),i}Vu(t){return this.Tu({path:void 0,du:!0})}mu(t){return oS(t,this.settings.methodName,this.settings.fu||!1,this.path,this.settings.gu)}contains(t){return this.fieldMask.find(n=>t.isPrefixOf(n))!==void 0||this.fieldTransforms.find(n=>t.isPrefixOf(n.field))!==void 0}Pu(){if(this.path)for(let t=0;tu.covers(f.field))}else u=null,l=o.fieldTransforms;return new iet(new Bo(a),u,l)}function Cae(e,t){if(Oae(e=Zi(e)))return Pae("Unsupported field value:",t,e),Aae(e,t);if(e instanceof Iae)return function(r,i){if(!xae(i.Iu))throw i.mu(`${r._methodName}() can only be used with update() and set()`);if(!i.path)throw i.mu(`${r._methodName}() is not currently supported inside arrays`);const s=r._toFieldTransform(i);s&&i.fieldTransforms.push(s)}(e,t),null;if(e===void 0&&t.ignoreUndefinedProperties)return null;if(t.path&&t.fieldMask.push(t.path),e instanceof Array){if(t.settings.du&&t.Iu!==4)throw t.mu("Nested arrays are not supported");return function(r,i){const s=[];let o=0;for(const a of r){let u=Cae(a,i.Vu(o));u==null&&(u={nullValue:"NULL_VALUE"}),s.push(u),o++}return{arrayValue:{values:s}}}(e,t)}return function(r,i){if((r=Zi(r))===null)return{nullValue:"NULL_VALUE"};if(typeof r=="number")return tJe(i.serializer,r);if(typeof r=="boolean")return{booleanValue:r};if(typeof r=="string")return{stringValue:r};if(r instanceof Date){const s=Zr.fromDate(r);return{timestampValue:iS(i.serializer,s)}}if(r instanceof Zr){const s=new Zr(r.seconds,1e3*Math.floor(r.nanoseconds/1e3));return{timestampValue:iS(i.serializer,s)}}if(r instanceof K6)return{geoPointValue:{latitude:r.latitude,longitude:r.longitude}};if(r instanceof Cm)return{bytesValue:Yoe(i.serializer,r._byteString)};if(r instanceof ho){const s=i.databaseId,o=r.firestore._databaseId;if(!o.isEqual(s))throw i.mu(`Document reference is for database ${o.projectId}/${o.database} but should be for database ${s.projectId}/${s.database}`);return{referenceValue:D6(r.firestore._databaseId||i.databaseId,r._key.path)}}throw i.mu(`Unsupported field value: ${q6(r)}`)}(e,t)}function Aae(e,t){const n={};return Eoe(e)?t.path&&t.path.length>0&&t.fieldMask.push(t.path):ug(e,(r,i)=>{const s=Cae(i,t.Eu(r));s!=null&&(n[r]=s)}),{mapValue:{fields:n}}}function Oae(e){return!(typeof e!="object"||e===null||e instanceof Array||e instanceof Date||e instanceof Zr||e instanceof K6||e instanceof Cm||e instanceof ho||e instanceof Iae)}function Pae(e,t,n){if(!Oae(n)||!function(i){return typeof i=="object"&&i!==null&&(Object.getPrototypeOf(i)===Object.prototype||Object.getPrototypeOf(i)===null)}(n)){const r=q6(n);throw r==="an object"?t.mu(e+" a custom object"):t.mu(e+" "+r)}}function uet(e,t,n){if((t=Zi(t))instanceof G6)return t._internalPath;if(typeof t=="string")return Rae(e,t);throw oS("Field path arguments must be of type string or ",e,!1,void 0,n)}const cet=new RegExp("[~\\*/\\[\\]]");function Rae(e,t,n){if(t.search(cet)>=0)throw oS(`Invalid field path (${t}). Paths must not contain '~', '*', '/', '[', or ']'`,e,!1,void 0,n);try{return new G6(...t.split("."))._internalPath}catch{throw oS(`Invalid field path (${t}). Paths must not be empty, begin with '.', end with '.', or contain '..'`,e,!1,void 0,n)}}function oS(e,t,n,r,i){const s=r&&!r.isEmpty(),o=i!==void 0;let a=`Function ${t}() called with invalid data`;n&&(a+=" (via `toFirestore()`)"),a+=". ";let u="";return(s||o)&&(u+=" (found",s&&(u+=` in field ${r}`),o&&(u+=` in document ${i}`),u+=")"),new tt(xe.INVALID_ARGUMENT,a+e+u)}function fet(e,t){return e.some(n=>n.isEqual(t))}/** * @license * Copyright 2020 Google LLC * @@ -2384,7 +2384,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class kae{constructor(t,n,r,i,s){this._firestore=t,this._userDataWriter=n,this._key=r,this._document=i,this._converter=s}get id(){return this._key.path.lastSegment()}get ref(){return new ho(this._firestore,this._converter,this._key)}exists(){return this._document!==null}data(){if(this._document){if(this._converter){const t=new det(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(t)}return this._userDataWriter.convertValue(this._document.data.value)}}get(t){if(this._document){const n=this._document.data.field(Dae("DocumentSnapshot.get",t));if(n!==null)return this._userDataWriter.convertValue(n)}}}class det extends kae{data(){return super.data()}}function Dae(e,t){return typeof t=="string"?Nae(e,t):t instanceof G6?t._internalPath:t._delegate._internalPath}/** + */class Nae{constructor(t,n,r,i,s){this._firestore=t,this._userDataWriter=n,this._key=r,this._document=i,this._converter=s}get id(){return this._key.path.lastSegment()}get ref(){return new ho(this._firestore,this._converter,this._key)}exists(){return this._document!==null}data(){if(this._document){if(this._converter){const t=new det(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(t)}return this._userDataWriter.convertValue(this._document.data.value)}}get(t){if(this._document){const n=this._document.data.field(kae("DocumentSnapshot.get",t));if(n!==null)return this._userDataWriter.convertValue(n)}}}class det extends Nae{data(){return super.data()}}function kae(e,t){return typeof t=="string"?Rae(e,t):t instanceof G6?t._internalPath:t._delegate._internalPath}/** * @license * Copyright 2020 Google LLC * @@ -2399,7 +2399,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function het(e){if(e.limitType==="L"&&e.explicitOrderBy.length===0)throw new tt(xe.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}class pet{convertValue(t,n="none"){switch(Wd(t)){case 0:return null;case 1:return t.booleanValue;case 2:return Br(t.integerValue||t.doubleValue);case 3:return this.convertTimestamp(t.timestampValue);case 4:return this.convertServerTimestamp(t,n);case 5:return t.stringValue;case 6:return this.convertBytes(Hd(t.bytesValue));case 7:return this.convertReference(t.referenceValue);case 8:return this.convertGeoPoint(t.geoPointValue);case 9:return this.convertArray(t.arrayValue,n);case 10:return this.convertObject(t.mapValue,n);default:throw _t()}}convertObject(t,n){return this.convertObjectMap(t.fields,n)}convertObjectMap(t,n="none"){const r={};return ug(t,(i,s)=>{r[i]=this.convertValue(s,n)}),r}convertGeoPoint(t){return new K6(Br(t.latitude),Br(t.longitude))}convertArray(t,n){return(t.values||[]).map(r=>this.convertValue(r,n))}convertServerTimestamp(t,n){switch(n){case"previous":const r=C6(t);return r==null?null:this.convertValue(r,n);case"estimate":return this.convertTimestamp(o_(t));default:return null}}convertTimestamp(t){const n=hf(t);return new Zr(n.seconds,n.nanos)}convertDocumentKey(t,n){const r=ur.fromString(t);Yn(Zoe(r));const i=new a_(r.get(1),r.get(3)),s=new dt(r.popFirst(5));return i.isEqual(n)||Ml(`Document ${s} contains a document reference within a different database (${i.projectId}/${i.database}) which is not supported. It will be treated as a reference in the current database (${n.projectId}/${n.database}) instead.`),s}}/** + */function het(e){if(e.limitType==="L"&&e.explicitOrderBy.length===0)throw new tt(xe.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}class pet{convertValue(t,n="none"){switch(Wd(t)){case 0:return null;case 1:return t.booleanValue;case 2:return Br(t.integerValue||t.doubleValue);case 3:return this.convertTimestamp(t.timestampValue);case 4:return this.convertServerTimestamp(t,n);case 5:return t.stringValue;case 6:return this.convertBytes(Hd(t.bytesValue));case 7:return this.convertReference(t.referenceValue);case 8:return this.convertGeoPoint(t.geoPointValue);case 9:return this.convertArray(t.arrayValue,n);case 10:return this.convertObject(t.mapValue,n);default:throw _t()}}convertObject(t,n){return this.convertObjectMap(t.fields,n)}convertObjectMap(t,n="none"){const r={};return ug(t,(i,s)=>{r[i]=this.convertValue(s,n)}),r}convertGeoPoint(t){return new K6(Br(t.latitude),Br(t.longitude))}convertArray(t,n){return(t.values||[]).map(r=>this.convertValue(r,n))}convertServerTimestamp(t,n){switch(n){case"previous":const r=C6(t);return r==null?null:this.convertValue(r,n);case"estimate":return this.convertTimestamp(o_(t));default:return null}}convertTimestamp(t){const n=hf(t);return new Zr(n.seconds,n.nanos)}convertDocumentKey(t,n){const r=ur.fromString(t);Yn(Joe(r));const i=new a_(r.get(1),r.get(3)),s=new dt(r.popFirst(5));return i.isEqual(n)||Ml(`Document ${s} contains a document reference within a different database (${i.projectId}/${i.database}) which is not supported. It will be treated as a reference in the current database (${n.projectId}/${n.database}) instead.`),s}}/** * @license * Copyright 2020 Google LLC * @@ -2429,7 +2429,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class y0{constructor(t,n){this.hasPendingWrites=t,this.fromCache=n}isEqual(t){return this.hasPendingWrites===t.hasPendingWrites&&this.fromCache===t.fromCache}}class $ae extends kae{constructor(t,n,r,i,s,o){super(t,n,r,i,o),this._firestore=t,this._firestoreImpl=t,this.metadata=s}exists(){return super.exists()}data(t={}){if(this._document){if(this._converter){const n=new Ib(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(n,t)}return this._userDataWriter.convertValue(this._document.data.value,t.serverTimestamps)}}get(t,n={}){if(this._document){const r=this._document.data.field(Dae("DocumentSnapshot.get",t));if(r!==null)return this._userDataWriter.convertValue(r,n.serverTimestamps)}}}class Ib extends $ae{data(t={}){return super.data(t)}}class get{constructor(t,n,r,i){this._firestore=t,this._userDataWriter=n,this._snapshot=i,this.metadata=new y0(i.hasPendingWrites,i.fromCache),this.query=r}get docs(){const t=[];return this.forEach(n=>t.push(n)),t}get size(){return this._snapshot.docs.size}get empty(){return this.size===0}forEach(t,n){this._snapshot.docs.forEach(r=>{t.call(n,new Ib(this._firestore,this._userDataWriter,r.key,r,new y0(this._snapshot.mutatedKeys.has(r.key),this._snapshot.fromCache),this.query.converter))})}docChanges(t={}){const n=!!t.includeMetadataChanges;if(n&&this._snapshot.excludesMetadataChanges)throw new tt(xe.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===n||(this._cachedChanges=function(i,s){if(i._snapshot.oldDocs.isEmpty()){let o=0;return i._snapshot.docChanges.map(a=>{const u=new Ib(i._firestore,i._userDataWriter,a.doc.key,a.doc,new y0(i._snapshot.mutatedKeys.has(a.doc.key),i._snapshot.fromCache),i.query.converter);return a.doc,{type:"added",doc:u,oldIndex:-1,newIndex:o++}})}{let o=i._snapshot.oldDocs;return i._snapshot.docChanges.filter(a=>s||a.type!==3).map(a=>{const u=new Ib(i._firestore,i._userDataWriter,a.doc.key,a.doc,new y0(i._snapshot.mutatedKeys.has(a.doc.key),i._snapshot.fromCache),i.query.converter);let l=-1,c=-1;return a.type!==0&&(l=o.indexOf(a.doc.key),o=o.delete(a.doc.key)),a.type!==1&&(o=o.add(a.doc),c=o.indexOf(a.doc.key)),{type:yet(a.type),doc:u,oldIndex:l,newIndex:c}})}}(this,n),this._cachedChangesIncludeMetadataChanges=n),this._cachedChanges}}function yet(e){switch(e){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return _t()}}/** + */class y0{constructor(t,n){this.hasPendingWrites=t,this.fromCache=n}isEqual(t){return this.hasPendingWrites===t.hasPendingWrites&&this.fromCache===t.fromCache}}class Dae extends Nae{constructor(t,n,r,i,s,o){super(t,n,r,i,o),this._firestore=t,this._firestoreImpl=t,this.metadata=s}exists(){return super.exists()}data(t={}){if(this._document){if(this._converter){const n=new Ib(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(n,t)}return this._userDataWriter.convertValue(this._document.data.value,t.serverTimestamps)}}get(t,n={}){if(this._document){const r=this._document.data.field(kae("DocumentSnapshot.get",t));if(r!==null)return this._userDataWriter.convertValue(r,n.serverTimestamps)}}}class Ib extends Dae{data(t={}){return super.data(t)}}class get{constructor(t,n,r,i){this._firestore=t,this._userDataWriter=n,this._snapshot=i,this.metadata=new y0(i.hasPendingWrites,i.fromCache),this.query=r}get docs(){const t=[];return this.forEach(n=>t.push(n)),t}get size(){return this._snapshot.docs.size}get empty(){return this.size===0}forEach(t,n){this._snapshot.docs.forEach(r=>{t.call(n,new Ib(this._firestore,this._userDataWriter,r.key,r,new y0(this._snapshot.mutatedKeys.has(r.key),this._snapshot.fromCache),this.query.converter))})}docChanges(t={}){const n=!!t.includeMetadataChanges;if(n&&this._snapshot.excludesMetadataChanges)throw new tt(xe.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===n||(this._cachedChanges=function(i,s){if(i._snapshot.oldDocs.isEmpty()){let o=0;return i._snapshot.docChanges.map(a=>{const u=new Ib(i._firestore,i._userDataWriter,a.doc.key,a.doc,new y0(i._snapshot.mutatedKeys.has(a.doc.key),i._snapshot.fromCache),i.query.converter);return a.doc,{type:"added",doc:u,oldIndex:-1,newIndex:o++}})}{let o=i._snapshot.oldDocs;return i._snapshot.docChanges.filter(a=>s||a.type!==3).map(a=>{const u=new Ib(i._firestore,i._userDataWriter,a.doc.key,a.doc,new y0(i._snapshot.mutatedKeys.has(a.doc.key),i._snapshot.fromCache),i.query.converter);let l=-1,c=-1;return a.type!==0&&(l=o.indexOf(a.doc.key),o=o.delete(a.doc.key)),a.type!==1&&(o=o.add(a.doc),c=o.indexOf(a.doc.key)),{type:yet(a.type),doc:u,oldIndex:l,newIndex:c}})}}(this,n),this._cachedChangesIncludeMetadataChanges=n),this._cachedChanges}}function yet(e){switch(e){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return _t()}}/** * @license * Copyright 2020 Google LLC * @@ -2444,7 +2444,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function Qg(e){e=qd(e,ho);const t=qd(e.firestore,yv);return XZe(Mx(t),e._key).then(n=>bet(t,e,n))}class Lae extends pet{constructor(t){super(),this.firestore=t}convertBytes(t){return new Cm(t)}convertReference(t){const n=this.convertDocumentKey(t,this.firestore._databaseId);return new ho(this.firestore,null,n)}}function _et(e){e=qd(e,Lx);const t=qd(e.firestore,yv),n=Mx(t),r=new Lae(t);return het(e._query),JZe(n,e._query).then(i=>new get(t,r,e,i))}function Xg(e,t,n){e=qd(e,ho);const r=qd(e.firestore,yv),i=met(e.converter,t,n);return vet(r,[aet(oet(r),"setDoc",e._key,i,e.converter!==null,n).toMutation(e._key,vl.none())])}function vet(e,t){return function(r,i){const s=new _l;return r.asyncQueue.enqueueAndForget(async()=>$Ze(await KZe(r),i,s)),s.promise}(Mx(e),t)}function bet(e,t,n){const r=n.docs.get(t._key),i=new Lae(e);return new $ae(e,i,t._key,r,new y0(n.hasPendingWrites,n.fromCache),t.converter)}(function(t,n=!0){(function(i){ag=i})(ch),$l(new $u("firestore",(r,{instanceIdentifier:i,options:s})=>{const o=r.getProvider("app").getImmediate(),a=new yv(new vXe(r.getProvider("auth-internal")),new TXe(r.getProvider("app-check-internal")),function(l,c){if(!Object.prototype.hasOwnProperty.apply(l.options,["projectId"]))throw new tt(xe.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new a_(l.options.projectId,c)}(o,i),o);return s=Object.assign({useFetchStreams:n},s),a._setSettings(s),a},"PUBLIC").setMultipleInstances(!0)),Ca(UV,"4.4.0",t),Ca(UV,"4.4.0","esm2017")})();/** + */function Qg(e){e=qd(e,ho);const t=qd(e.firestore,yv);return XZe(Mx(t),e._key).then(n=>bet(t,e,n))}class $ae extends pet{constructor(t){super(),this.firestore=t}convertBytes(t){return new Cm(t)}convertReference(t){const n=this.convertDocumentKey(t,this.firestore._databaseId);return new ho(this.firestore,null,n)}}function _et(e){e=qd(e,Lx);const t=qd(e.firestore,yv),n=Mx(t),r=new $ae(t);return het(e._query),JZe(n,e._query).then(i=>new get(t,r,e,i))}function Xg(e,t,n){e=qd(e,ho);const r=qd(e.firestore,yv),i=met(e.converter,t,n);return vet(r,[aet(oet(r),"setDoc",e._key,i,e.converter!==null,n).toMutation(e._key,vl.none())])}function vet(e,t){return function(r,i){const s=new _l;return r.asyncQueue.enqueueAndForget(async()=>$Ze(await KZe(r),i,s)),s.promise}(Mx(e),t)}function bet(e,t,n){const r=n.docs.get(t._key),i=new $ae(e);return new Dae(e,i,t._key,r,new y0(n.hasPendingWrites,n.fromCache),t.converter)}(function(t,n=!0){(function(i){ag=i})(ch),$l(new $u("firestore",(r,{instanceIdentifier:i,options:s})=>{const o=r.getProvider("app").getImmediate(),a=new yv(new vXe(r.getProvider("auth-internal")),new TXe(r.getProvider("app-check-internal")),function(l,c){if(!Object.prototype.hasOwnProperty.apply(l.options,["projectId"]))throw new tt(xe.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new a_(l.options.projectId,c)}(o,i),o);return s=Object.assign({useFetchStreams:n},s),a._setSettings(s),a},"PUBLIC").setMultipleInstances(!0)),Ca(UV,"4.4.0",t),Ca(UV,"4.4.0","esm2017")})();/** * @license * Copyright 2020 Google LLC * @@ -2459,7 +2459,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const KR=new Map,Mae={activated:!1,tokenObservers:[]},Eet={initialized:!1,enabled:!1};function ei(e){return KR.get(e)||Object.assign({},Mae)}function wet(e,t){return KR.set(e,t),KR.get(e)}function Fx(){return Eet}/** + */const KR=new Map,Lae={activated:!1,tokenObservers:[]},Eet={initialized:!1,enabled:!1};function ei(e){return KR.get(e)||Object.assign({},Lae)}function wet(e,t){return KR.set(e,t),KR.get(e)}function Fx(){return Eet}/** * @license * Copyright 2020 Google LLC * @@ -2474,7 +2474,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const Fae="https://content-firebaseappcheck.googleapis.com/v1",Tet="exchangeRecaptchaV3Token",Iet="exchangeDebugToken",E7={OFFSET_DURATION:5*60*1e3,RETRIAL_MIN_WAIT:30*1e3,RETRIAL_MAX_WAIT:16*60*1e3},xet=24*60*60*1e3;/** + */const Mae="https://content-firebaseappcheck.googleapis.com/v1",Tet="exchangeRecaptchaV3Token",Iet="exchangeDebugToken",E7={OFFSET_DURATION:5*60*1e3,RETRIAL_MIN_WAIT:30*1e3,RETRIAL_MAX_WAIT:16*60*1e3},xet=24*60*60*1e3;/** * @license * Copyright 2020 Google LLC * @@ -2519,7 +2519,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function w7(e=!1){var t;return e?(t=self.grecaptcha)===null||t===void 0?void 0:t.enterprise:self.grecaptcha}function X6(e){if(!ei(e).activated)throw $s.create("use-before-activation",{appName:e.name})}function Bae(e){const t=Math.round(e/1e3),n=Math.floor(t/(3600*24)),r=Math.floor((t-n*3600*24)/3600),i=Math.floor((t-n*3600*24-r*3600)/60),s=t-n*3600*24-r*3600-i*60;let o="";return n&&(o+=L1(n)+"d:"),r&&(o+=L1(r)+"h:"),o+=L1(i)+"m:"+L1(s)+"s",o}function L1(e){return e===0?"00":e>=10?e.toString():"0"+e}/** + */function w7(e=!1){var t;return e?(t=self.grecaptcha)===null||t===void 0?void 0:t.enterprise:self.grecaptcha}function X6(e){if(!ei(e).activated)throw $s.create("use-before-activation",{appName:e.name})}function Fae(e){const t=Math.round(e/1e3),n=Math.floor(t/(3600*24)),r=Math.floor((t-n*3600*24)/3600),i=Math.floor((t-n*3600*24-r*3600)/60),s=t-n*3600*24-r*3600-i*60;let o="";return n&&(o+=L1(n)+"d:"),r&&(o+=L1(r)+"h:"),o+=L1(i)+"m:"+L1(s)+"s",o}function L1(e){return e===0?"00":e>=10?e.toString():"0"+e}/** * @license * Copyright 2020 Google LLC * @@ -2534,7 +2534,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */async function J6({url:e,body:t},n){const r={"Content-Type":"application/json"},i=n.getImmediate({optional:!0});if(i){const f=await i.getHeartbeatsHeader();f&&(r["X-Firebase-Client"]=f)}const s={method:"POST",body:JSON.stringify(t),headers:r};let o;try{o=await fetch(e,s)}catch(f){throw $s.create("fetch-network-error",{originalErrorMessage:f==null?void 0:f.message})}if(o.status!==200)throw $s.create("fetch-status-error",{httpStatus:o.status});let a;try{a=await o.json()}catch(f){throw $s.create("fetch-parse-error",{originalErrorMessage:f==null?void 0:f.message})}const u=a.ttl.match(/^([\d.]+)(s)$/);if(!u||!u[2]||isNaN(Number(u[1])))throw $s.create("fetch-parse-error",{originalErrorMessage:`ttl field (timeToLive) is not in standard Protobuf Duration format: ${a.ttl}`});const l=Number(u[1])*1e3,c=Date.now();return{token:a.token,expireTimeMillis:c+l,issuedAtTimeMillis:c}}function Pet(e,t){const{projectId:n,appId:r,apiKey:i}=e.options;return{url:`${Fae}/projects/${n}/apps/${r}:${Tet}?key=${i}`,body:{recaptcha_v3_token:t}}}function jae(e,t){const{projectId:n,appId:r,apiKey:i}=e.options;return{url:`${Fae}/projects/${n}/apps/${r}:${Iet}?key=${i}`,body:{debug_token:t}}}/** + */async function J6({url:e,body:t},n){const r={"Content-Type":"application/json"},i=n.getImmediate({optional:!0});if(i){const f=await i.getHeartbeatsHeader();f&&(r["X-Firebase-Client"]=f)}const s={method:"POST",body:JSON.stringify(t),headers:r};let o;try{o=await fetch(e,s)}catch(f){throw $s.create("fetch-network-error",{originalErrorMessage:f==null?void 0:f.message})}if(o.status!==200)throw $s.create("fetch-status-error",{httpStatus:o.status});let a;try{a=await o.json()}catch(f){throw $s.create("fetch-parse-error",{originalErrorMessage:f==null?void 0:f.message})}const u=a.ttl.match(/^([\d.]+)(s)$/);if(!u||!u[2]||isNaN(Number(u[1])))throw $s.create("fetch-parse-error",{originalErrorMessage:`ttl field (timeToLive) is not in standard Protobuf Duration format: ${a.ttl}`});const l=Number(u[1])*1e3,c=Date.now();return{token:a.token,expireTimeMillis:c+l,issuedAtTimeMillis:c}}function Pet(e,t){const{projectId:n,appId:r,apiKey:i}=e.options;return{url:`${Mae}/projects/${n}/apps/${r}:${Tet}?key=${i}`,body:{recaptcha_v3_token:t}}}function Bae(e,t){const{projectId:n,appId:r,apiKey:i}=e.options;return{url:`${Mae}/projects/${n}/apps/${r}:${Iet}?key=${i}`,body:{debug_token:t}}}/** * @license * Copyright 2020 Google LLC * @@ -2549,7 +2549,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const Ret="firebase-app-check-database",Net=1,f_="firebase-app-check-store",Uae="debug-token";let M1=null;function Vae(){return M1||(M1=new Promise((e,t)=>{try{const n=indexedDB.open(Ret,Net);n.onsuccess=r=>{e(r.target.result)},n.onerror=r=>{var i;t($s.create("storage-open",{originalErrorMessage:(i=r.target.error)===null||i===void 0?void 0:i.message}))},n.onupgradeneeded=r=>{const i=r.target.result;switch(r.oldVersion){case 0:i.createObjectStore(f_,{keyPath:"compositeKey"})}}}catch(n){t($s.create("storage-open",{originalErrorMessage:n==null?void 0:n.message}))}}),M1)}function ket(e){return Hae(Wae(e))}function Det(e,t){return zae(Wae(e),t)}function $et(e){return zae(Uae,e)}function Let(){return Hae(Uae)}async function zae(e,t){const r=(await Vae()).transaction(f_,"readwrite"),s=r.objectStore(f_).put({compositeKey:e,value:t});return new Promise((o,a)=>{s.onsuccess=u=>{o()},r.onerror=u=>{var l;a($s.create("storage-set",{originalErrorMessage:(l=u.target.error)===null||l===void 0?void 0:l.message}))}})}async function Hae(e){const n=(await Vae()).transaction(f_,"readonly"),i=n.objectStore(f_).get(e);return new Promise((s,o)=>{i.onsuccess=a=>{const u=a.target.result;s(u?u.value:void 0)},n.onerror=a=>{var u;o($s.create("storage-get",{originalErrorMessage:(u=a.target.error)===null||u===void 0?void 0:u.message}))}})}function Wae(e){return`${e.options.appId}-${e.name}`}/** + */const Ret="firebase-app-check-database",Net=1,f_="firebase-app-check-store",jae="debug-token";let M1=null;function Uae(){return M1||(M1=new Promise((e,t)=>{try{const n=indexedDB.open(Ret,Net);n.onsuccess=r=>{e(r.target.result)},n.onerror=r=>{var i;t($s.create("storage-open",{originalErrorMessage:(i=r.target.error)===null||i===void 0?void 0:i.message}))},n.onupgradeneeded=r=>{const i=r.target.result;switch(r.oldVersion){case 0:i.createObjectStore(f_,{keyPath:"compositeKey"})}}}catch(n){t($s.create("storage-open",{originalErrorMessage:n==null?void 0:n.message}))}}),M1)}function ket(e){return zae(Hae(e))}function Det(e,t){return Vae(Hae(e),t)}function $et(e){return Vae(jae,e)}function Let(){return zae(jae)}async function Vae(e,t){const r=(await Uae()).transaction(f_,"readwrite"),s=r.objectStore(f_).put({compositeKey:e,value:t});return new Promise((o,a)=>{s.onsuccess=u=>{o()},r.onerror=u=>{var l;a($s.create("storage-set",{originalErrorMessage:(l=u.target.error)===null||l===void 0?void 0:l.message}))}})}async function zae(e){const n=(await Uae()).transaction(f_,"readonly"),i=n.objectStore(f_).get(e);return new Promise((s,o)=>{i.onsuccess=a=>{const u=a.target.result;s(u?u.value:void 0)},n.onerror=a=>{var u;o($s.create("storage-get",{originalErrorMessage:(u=a.target.error)===null||u===void 0?void 0:u.message}))}})}function Hae(e){return`${e.options.appId}-${e.name}`}/** * @license * Copyright 2020 Google LLC * @@ -2596,7 +2596,7 @@ This typically indicates that your device does not have a healthy Internet conne * limitations under the License. */function Z6(){return Fx().enabled}async function eL(){const e=Fx();if(e.enabled&&e.token)return e.token.promise;throw Error(` Can't get debug token in production mode. - `)}function Bet(){const e=qie(),t=Fx();if(t.initialized=!0,typeof e.FIREBASE_APPCHECK_DEBUG_TOKEN!="string"&&e.FIREBASE_APPCHECK_DEBUG_TOKEN!==!0)return;t.enabled=!0;const n=new Yy;t.token=n,typeof e.FIREBASE_APPCHECK_DEBUG_TOKEN=="string"?n.resolve(e.FIREBASE_APPCHECK_DEBUG_TOKEN):n.resolve(Fet())}/** + `)}function Bet(){const e=Wie(),t=Fx();if(t.initialized=!0,typeof e.FIREBASE_APPCHECK_DEBUG_TOKEN!="string"&&e.FIREBASE_APPCHECK_DEBUG_TOKEN!==!0)return;t.enabled=!0;const n=new Yy;t.token=n,typeof e.FIREBASE_APPCHECK_DEBUG_TOKEN=="string"?n.resolve(e.FIREBASE_APPCHECK_DEBUG_TOKEN):n.resolve(Fet())}/** * @license * Copyright 2020 Google LLC * @@ -2611,7 +2611,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const jet={error:"UNKNOWN_ERROR"};function Uet(e){return q3.encodeString(JSON.stringify(e),!1)}async function QR(e,t=!1){const n=e.app;X6(n);const r=ei(n);let i=r.token,s;if(i&&!ap(i)&&(r.token=void 0,i=void 0),!i){const u=await r.cachedTokenPromise;u&&(ap(u)?i=u:await CO(n,void 0))}if(!t&&i&&ap(i))return{token:i.token};let o=!1;if(Z6()){r.exchangeTokenPromise||(r.exchangeTokenPromise=J6(jae(n,await eL()),e.heartbeatServiceProvider).finally(()=>{r.exchangeTokenPromise=void 0}),o=!0);const u=await r.exchangeTokenPromise;return await CO(n,u),r.token=u,{token:u.token}}try{r.exchangeTokenPromise||(r.exchangeTokenPromise=r.provider.getToken().finally(()=>{r.exchangeTokenPromise=void 0}),o=!0),i=await ei(n).exchangeTokenPromise}catch(u){u.code==="appCheck/throttled"?d_.warn(u.message):d_.error(u),s=u}let a;return i?s?ap(i)?a={token:i.token,internalError:s}:a=S7(s):(a={token:i.token},r.token=i,await CO(n,i)):a=S7(s),o&&Gae(n,a),a}async function Vet(e){const t=e.app;X6(t);const{provider:n}=ei(t);if(Z6()){const r=await eL(),{token:i}=await J6(jae(t,r),e.heartbeatServiceProvider);return{token:i}}else{const{token:r}=await n.getToken();return{token:r}}}function qae(e,t,n,r){const{app:i}=e,s=ei(i),o={next:n,error:r,type:t};if(s.tokenObservers=[...s.tokenObservers,o],s.token&&ap(s.token)){const a=s.token;Promise.resolve().then(()=>{n({token:a.token}),T7(e)}).catch(()=>{})}s.cachedTokenPromise.then(()=>T7(e))}function Yae(e,t){const n=ei(e),r=n.tokenObservers.filter(i=>i.next!==t);r.length===0&&n.tokenRefresher&&n.tokenRefresher.isRunning()&&n.tokenRefresher.stop(),n.tokenObservers=r}function T7(e){const{app:t}=e,n=ei(t);let r=n.tokenRefresher;r||(r=zet(e),n.tokenRefresher=r),!r.isRunning()&&n.isTokenAutoRefreshEnabled&&r.start()}function zet(e){const{app:t}=e;return new Cet(async()=>{const n=ei(t);let r;if(n.token?r=await QR(e,!0):r=await QR(e),r.error)throw r.error;if(r.internalError)throw r.internalError},()=>!0,()=>{const n=ei(t);if(n.token){let r=n.token.issuedAtTimeMillis+(n.token.expireTimeMillis-n.token.issuedAtTimeMillis)*.5+3e5;const i=n.token.expireTimeMillis-5*60*1e3;return r=Math.min(r,i),Math.max(0,r-Date.now())}else return 0},E7.RETRIAL_MIN_WAIT,E7.RETRIAL_MAX_WAIT)}function Gae(e,t){const n=ei(e).tokenObservers;for(const r of n)try{r.type==="EXTERNAL"&&t.error!=null?r.error(t.error):r.next(t)}catch{}}function ap(e){return e.expireTimeMillis-Date.now()>0}function S7(e){return{token:Uet(jet),error:e}}/** + */const jet={error:"UNKNOWN_ERROR"};function Uet(e){return q3.encodeString(JSON.stringify(e),!1)}async function QR(e,t=!1){const n=e.app;X6(n);const r=ei(n);let i=r.token,s;if(i&&!ap(i)&&(r.token=void 0,i=void 0),!i){const u=await r.cachedTokenPromise;u&&(ap(u)?i=u:await CO(n,void 0))}if(!t&&i&&ap(i))return{token:i.token};let o=!1;if(Z6()){r.exchangeTokenPromise||(r.exchangeTokenPromise=J6(Bae(n,await eL()),e.heartbeatServiceProvider).finally(()=>{r.exchangeTokenPromise=void 0}),o=!0);const u=await r.exchangeTokenPromise;return await CO(n,u),r.token=u,{token:u.token}}try{r.exchangeTokenPromise||(r.exchangeTokenPromise=r.provider.getToken().finally(()=>{r.exchangeTokenPromise=void 0}),o=!0),i=await ei(n).exchangeTokenPromise}catch(u){u.code==="appCheck/throttled"?d_.warn(u.message):d_.error(u),s=u}let a;return i?s?ap(i)?a={token:i.token,internalError:s}:a=S7(s):(a={token:i.token},r.token=i,await CO(n,i)):a=S7(s),o&&Yae(n,a),a}async function Vet(e){const t=e.app;X6(t);const{provider:n}=ei(t);if(Z6()){const r=await eL(),{token:i}=await J6(Bae(t,r),e.heartbeatServiceProvider);return{token:i}}else{const{token:r}=await n.getToken();return{token:r}}}function Wae(e,t,n,r){const{app:i}=e,s=ei(i),o={next:n,error:r,type:t};if(s.tokenObservers=[...s.tokenObservers,o],s.token&&ap(s.token)){const a=s.token;Promise.resolve().then(()=>{n({token:a.token}),T7(e)}).catch(()=>{})}s.cachedTokenPromise.then(()=>T7(e))}function qae(e,t){const n=ei(e),r=n.tokenObservers.filter(i=>i.next!==t);r.length===0&&n.tokenRefresher&&n.tokenRefresher.isRunning()&&n.tokenRefresher.stop(),n.tokenObservers=r}function T7(e){const{app:t}=e,n=ei(t);let r=n.tokenRefresher;r||(r=zet(e),n.tokenRefresher=r),!r.isRunning()&&n.isTokenAutoRefreshEnabled&&r.start()}function zet(e){const{app:t}=e;return new Cet(async()=>{const n=ei(t);let r;if(n.token?r=await QR(e,!0):r=await QR(e),r.error)throw r.error;if(r.internalError)throw r.internalError},()=>!0,()=>{const n=ei(t);if(n.token){let r=n.token.issuedAtTimeMillis+(n.token.expireTimeMillis-n.token.issuedAtTimeMillis)*.5+3e5;const i=n.token.expireTimeMillis-5*60*1e3;return r=Math.min(r,i),Math.max(0,r-Date.now())}else return 0},E7.RETRIAL_MIN_WAIT,E7.RETRIAL_MAX_WAIT)}function Yae(e,t){const n=ei(e).tokenObservers;for(const r of n)try{r.type==="EXTERNAL"&&t.error!=null?r.error(t.error):r.next(t)}catch{}}function ap(e){return e.expireTimeMillis-Date.now()>0}function S7(e){return{token:Uet(jet),error:e}}/** * @license * Copyright 2020 Google LLC * @@ -2626,7 +2626,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class Het{constructor(t,n){this.app=t,this.heartbeatServiceProvider=n}_delete(){const{tokenObservers:t}=ei(this.app);for(const n of t)Yae(this.app,n.next);return Promise.resolve()}}function Wet(e,t){return new Het(e,t)}function qet(e){return{getToken:t=>QR(e,t),getLimitedUseToken:()=>Vet(e),addTokenListener:t=>qae(e,"INTERNAL",t),removeTokenListener:t=>Yae(e.app,t)}}const Yet="@firebase/app-check",Get="0.8.0";/** + */class Het{constructor(t,n){this.app=t,this.heartbeatServiceProvider=n}_delete(){const{tokenObservers:t}=ei(this.app);for(const n of t)qae(this.app,n.next);return Promise.resolve()}}function Wet(e,t){return new Het(e,t)}function qet(e){return{getToken:t=>QR(e,t),getLimitedUseToken:()=>Vet(e),addTokenListener:t=>Wae(e,"INTERNAL",t),removeTokenListener:t=>qae(e.app,t)}}const Yet="@firebase/app-check",Get="0.8.0";/** * @license * Copyright 2020 Google LLC * @@ -2656,7 +2656,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class tL{constructor(t){this._siteKey=t,this._throttleData=null}async getToken(){var t,n,r;ntt(this._throttleData);const i=await Jet(this._app).catch(o=>{throw $s.create("recaptcha-error")});if(!(!((t=ei(this._app).reCAPTCHAState)===null||t===void 0)&&t.succeeded))throw $s.create("recaptcha-error");let s;try{s=await J6(Pet(this._app,i),this._heartbeatServiceProvider)}catch(o){throw!((n=o.code)===null||n===void 0)&&n.includes("fetch-status-error")?(this._throttleData=ttt(Number((r=o.customData)===null||r===void 0?void 0:r.httpStatus),this._throttleData),$s.create("throttled",{time:Bae(this._throttleData.allowRequestsAfter-Date.now()),httpStatus:this._throttleData.httpStatus})):o}return this._throttleData=null,s}initialize(t){this._app=t,this._heartbeatServiceProvider=ig(t,"heartbeat"),Qet(t,this._siteKey).catch(()=>{})}isEqual(t){return t instanceof tL?this._siteKey===t._siteKey:!1}}function ttt(e,t){if(e===404||e===403)return{backoffCount:1,allowRequestsAfter:Date.now()+xet,httpStatus:e};{const n=t?t.backoffCount:0,r=WYe(n,1e3,2);return{backoffCount:n+1,allowRequestsAfter:Date.now()+r,httpStatus:e}}}function ntt(e){if(e&&Date.now()-e.allowRequestsAfter<=0)throw $s.create("throttled",{time:Bae(e.allowRequestsAfter-Date.now()),httpStatus:e.httpStatus})}/** + */class tL{constructor(t){this._siteKey=t,this._throttleData=null}async getToken(){var t,n,r;ntt(this._throttleData);const i=await Jet(this._app).catch(o=>{throw $s.create("recaptcha-error")});if(!(!((t=ei(this._app).reCAPTCHAState)===null||t===void 0)&&t.succeeded))throw $s.create("recaptcha-error");let s;try{s=await J6(Pet(this._app,i),this._heartbeatServiceProvider)}catch(o){throw!((n=o.code)===null||n===void 0)&&n.includes("fetch-status-error")?(this._throttleData=ttt(Number((r=o.customData)===null||r===void 0?void 0:r.httpStatus),this._throttleData),$s.create("throttled",{time:Fae(this._throttleData.allowRequestsAfter-Date.now()),httpStatus:this._throttleData.httpStatus})):o}return this._throttleData=null,s}initialize(t){this._app=t,this._heartbeatServiceProvider=ig(t,"heartbeat"),Qet(t,this._siteKey).catch(()=>{})}isEqual(t){return t instanceof tL?this._siteKey===t._siteKey:!1}}function ttt(e,t){if(e===404||e===403)return{backoffCount:1,allowRequestsAfter:Date.now()+xet,httpStatus:e};{const n=t?t.backoffCount:0,r=WYe(n,1e3,2);return{backoffCount:n+1,allowRequestsAfter:Date.now()+r,httpStatus:e}}}function ntt(e){if(e&&Date.now()-e.allowRequestsAfter<=0)throw $s.create("throttled",{time:Fae(e.allowRequestsAfter-Date.now()),httpStatus:e.httpStatus})}/** * @license * Copyright 2020 Google LLC * @@ -2671,7 +2671,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function rtt(e=Q3(),t){e=Zi(e);const n=ig(e,"app-check");if(Fx().initialized||Bet(),Z6()&&eL().then(i=>console.log(`App Check debug token: ${i}. You will need to add it to your app's App Check settings in the Firebase console for it to work.`)),n.isInitialized()){const i=n.getImmediate(),s=n.getOptions();if(s.isTokenAutoRefreshEnabled===t.isTokenAutoRefreshEnabled&&s.provider.isEqual(t.provider))return i;throw $s.create("already-initialized",{appName:e.name})}const r=n.initialize({options:t});return itt(e,t.provider,t.isTokenAutoRefreshEnabled),ei(e).isTokenAutoRefreshEnabled&&qae(r,"INTERNAL",()=>{}),r}function itt(e,t,n){const r=wet(e,Object.assign({},Mae));r.activated=!0,r.provider=t,r.cachedTokenPromise=Met(e).then(i=>(i&&ap(i)&&(r.token=i,Gae(e,{token:i.token})),i)),r.isTokenAutoRefreshEnabled=n===void 0?e.automaticDataCollectionEnabled:n,r.provider.initialize(e)}const stt="app-check",x7="app-check-internal";function ott(){$l(new $u(stt,e=>{const t=e.getProvider("app").getImmediate(),n=e.getProvider("heartbeat");return Wet(t,n)},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,t,n)=>{e.getProvider(x7).initialize()})),$l(new $u(x7,e=>{const t=e.getProvider("app-check").getImmediate();return qet(t)},"PUBLIC").setInstantiationMode("EXPLICIT")),Ca(Yet,Get)}ott();function Kae(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}const att=Kae,Qae=new rg("auth","Firebase",Kae());/** + */function rtt(e=Q3(),t){e=Zi(e);const n=ig(e,"app-check");if(Fx().initialized||Bet(),Z6()&&eL().then(i=>console.log(`App Check debug token: ${i}. You will need to add it to your app's App Check settings in the Firebase console for it to work.`)),n.isInitialized()){const i=n.getImmediate(),s=n.getOptions();if(s.isTokenAutoRefreshEnabled===t.isTokenAutoRefreshEnabled&&s.provider.isEqual(t.provider))return i;throw $s.create("already-initialized",{appName:e.name})}const r=n.initialize({options:t});return itt(e,t.provider,t.isTokenAutoRefreshEnabled),ei(e).isTokenAutoRefreshEnabled&&Wae(r,"INTERNAL",()=>{}),r}function itt(e,t,n){const r=wet(e,Object.assign({},Lae));r.activated=!0,r.provider=t,r.cachedTokenPromise=Met(e).then(i=>(i&&ap(i)&&(r.token=i,Yae(e,{token:i.token})),i)),r.isTokenAutoRefreshEnabled=n===void 0?e.automaticDataCollectionEnabled:n,r.provider.initialize(e)}const stt="app-check",x7="app-check-internal";function ott(){$l(new $u(stt,e=>{const t=e.getProvider("app").getImmediate(),n=e.getProvider("heartbeat");return Wet(t,n)},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,t,n)=>{e.getProvider(x7).initialize()})),$l(new $u(x7,e=>{const t=e.getProvider("app-check").getImmediate();return qet(t)},"PUBLIC").setInstantiationMode("EXPLICIT")),Ca(Yet,Get)}ott();function Gae(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}const att=Gae,Kae=new rg("auth","Firebase",Gae());/** * @license * Copyright 2020 Google LLC * @@ -2701,7 +2701,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function Bl(e,...t){throw nL(e,...t)}function xu(e,...t){return nL(e,...t)}function ltt(e,t,n){const r=Object.assign(Object.assign({},att()),{[t]:n});return new rg("auth","Firebase",r).create(t,{appName:e.name})}function nL(e,...t){if(typeof e!="string"){const n=t[0],r=[...t.slice(1)];return r[0]&&(r[0].appName=e.name),e._errorFactory.create(n,...r)}return Qae.create(e,...t)}function Ct(e,t,...n){if(!e)throw nL(t,...n)}function ll(e){const t="INTERNAL ASSERTION FAILED: "+e;throw xb(t),new Error(t)}function jl(e,t){e||ll(t)}/** + */function Bl(e,...t){throw nL(e,...t)}function xu(e,...t){return nL(e,...t)}function ltt(e,t,n){const r=Object.assign(Object.assign({},att()),{[t]:n});return new rg("auth","Firebase",r).create(t,{appName:e.name})}function nL(e,...t){if(typeof e!="string"){const n=t[0],r=[...t.slice(1)];return r[0]&&(r[0].appName=e.name),e._errorFactory.create(n,...r)}return Kae.create(e,...t)}function Ct(e,t,...n){if(!e)throw nL(t,...n)}function ll(e){const t="INTERNAL ASSERTION FAILED: "+e;throw xb(t),new Error(t)}function jl(e,t){e||ll(t)}/** * @license * Copyright 2020 Google LLC * @@ -2776,7 +2776,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class Xae{static initialize(t,n,r){this.fetchImpl=t,n&&(this.headersImpl=n),r&&(this.responseImpl=r)}static fetch(){if(this.fetchImpl)return this.fetchImpl;if(typeof self<"u"&&"fetch"in self)return self.fetch;if(typeof globalThis<"u"&&globalThis.fetch)return globalThis.fetch;if(typeof fetch<"u")return fetch;ll("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){if(this.headersImpl)return this.headersImpl;if(typeof self<"u"&&"Headers"in self)return self.Headers;if(typeof globalThis<"u"&&globalThis.Headers)return globalThis.Headers;if(typeof Headers<"u")return Headers;ll("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){if(this.responseImpl)return this.responseImpl;if(typeof self<"u"&&"Response"in self)return self.Response;if(typeof globalThis<"u"&&globalThis.Response)return globalThis.Response;if(typeof Response<"u")return Response;ll("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}/** + */class Qae{static initialize(t,n,r){this.fetchImpl=t,n&&(this.headersImpl=n),r&&(this.responseImpl=r)}static fetch(){if(this.fetchImpl)return this.fetchImpl;if(typeof self<"u"&&"fetch"in self)return self.fetch;if(typeof globalThis<"u"&&globalThis.fetch)return globalThis.fetch;if(typeof fetch<"u")return fetch;ll("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){if(this.headersImpl)return this.headersImpl;if(typeof self<"u"&&"Headers"in self)return self.Headers;if(typeof globalThis<"u"&&globalThis.Headers)return globalThis.Headers;if(typeof Headers<"u")return Headers;ll("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){if(this.responseImpl)return this.responseImpl;if(typeof self<"u"&&"Response"in self)return self.Response;if(typeof globalThis<"u"&&globalThis.Response)return globalThis.Response;if(typeof Response<"u")return Response;ll("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}/** * @license * Copyright 2020 Google LLC * @@ -2806,7 +2806,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const ptt=new _v(3e4,6e4);function Bx(e,t){return e.tenantId&&!t.tenantId?Object.assign(Object.assign({},t),{tenantId:e.tenantId}):t}async function fg(e,t,n,r,i={}){return Jae(e,i,async()=>{let s={},o={};r&&(t==="GET"?o=r:s={body:JSON.stringify(r)});const a=tv(Object.assign({key:e.config.apiKey},o)).slice(1),u=await e._getAdditionalHeaders();return u["Content-Type"]="application/json",e.languageCode&&(u["X-Firebase-Locale"]=e.languageCode),Xae.fetch()(eue(e,e.config.apiHost,n,a),Object.assign({method:t,headers:u,referrerPolicy:"no-referrer"},s))})}async function Jae(e,t,n){e._canInitEmulator=!1;const r=Object.assign(Object.assign({},htt),t);try{const i=new mtt(e),s=await Promise.race([n(),i.promise]);i.clearNetworkTimeout();const o=await s.json();if("needConfirmation"in o)throw F1(e,"account-exists-with-different-credential",o);if(s.ok&&!("errorMessage"in o))return o;{const a=s.ok?o.errorMessage:o.error.message,[u,l]=a.split(" : ");if(u==="FEDERATED_USER_ID_ALREADY_LINKED")throw F1(e,"credential-already-in-use",o);if(u==="EMAIL_EXISTS")throw F1(e,"email-already-in-use",o);if(u==="USER_DISABLED")throw F1(e,"user-disabled",o);const c=r[u]||u.toLowerCase().replace(/[_\s]+/g,"-");if(l)throw ltt(e,c,l);Bl(e,c)}}catch(i){if(i instanceof Hu)throw i;Bl(e,"network-request-failed",{message:String(i)})}}async function Zae(e,t,n,r,i={}){const s=await fg(e,t,n,r,i);return"mfaPendingCredential"in s&&Bl(e,"multi-factor-auth-required",{_serverResponse:s}),s}function eue(e,t,n,r){const i=`${t}${n}?${r}`;return e.config.emulator?rL(e.config,i):`${e.config.apiScheme}://${i}`}class mtt{constructor(t){this.auth=t,this.timer=null,this.promise=new Promise((n,r)=>{this.timer=setTimeout(()=>r(xu(this.auth,"network-request-failed")),ptt.get())})}clearNetworkTimeout(){clearTimeout(this.timer)}}function F1(e,t,n){const r={appName:e.name};n.email&&(r.email=n.email),n.phoneNumber&&(r.phoneNumber=n.phoneNumber);const i=xu(e,t,r);return i.customData._tokenResponse=n,i}/** + */const ptt=new _v(3e4,6e4);function Bx(e,t){return e.tenantId&&!t.tenantId?Object.assign(Object.assign({},t),{tenantId:e.tenantId}):t}async function fg(e,t,n,r,i={}){return Xae(e,i,async()=>{let s={},o={};r&&(t==="GET"?o=r:s={body:JSON.stringify(r)});const a=tv(Object.assign({key:e.config.apiKey},o)).slice(1),u=await e._getAdditionalHeaders();return u["Content-Type"]="application/json",e.languageCode&&(u["X-Firebase-Locale"]=e.languageCode),Qae.fetch()(Zae(e,e.config.apiHost,n,a),Object.assign({method:t,headers:u,referrerPolicy:"no-referrer"},s))})}async function Xae(e,t,n){e._canInitEmulator=!1;const r=Object.assign(Object.assign({},htt),t);try{const i=new mtt(e),s=await Promise.race([n(),i.promise]);i.clearNetworkTimeout();const o=await s.json();if("needConfirmation"in o)throw F1(e,"account-exists-with-different-credential",o);if(s.ok&&!("errorMessage"in o))return o;{const a=s.ok?o.errorMessage:o.error.message,[u,l]=a.split(" : ");if(u==="FEDERATED_USER_ID_ALREADY_LINKED")throw F1(e,"credential-already-in-use",o);if(u==="EMAIL_EXISTS")throw F1(e,"email-already-in-use",o);if(u==="USER_DISABLED")throw F1(e,"user-disabled",o);const c=r[u]||u.toLowerCase().replace(/[_\s]+/g,"-");if(l)throw ltt(e,c,l);Bl(e,c)}}catch(i){if(i instanceof Hu)throw i;Bl(e,"network-request-failed",{message:String(i)})}}async function Jae(e,t,n,r,i={}){const s=await fg(e,t,n,r,i);return"mfaPendingCredential"in s&&Bl(e,"multi-factor-auth-required",{_serverResponse:s}),s}function Zae(e,t,n,r){const i=`${t}${n}?${r}`;return e.config.emulator?rL(e.config,i):`${e.config.apiScheme}://${i}`}class mtt{constructor(t){this.auth=t,this.timer=null,this.promise=new Promise((n,r)=>{this.timer=setTimeout(()=>r(xu(this.auth,"network-request-failed")),ptt.get())})}clearNetworkTimeout(){clearTimeout(this.timer)}}function F1(e,t,n){const r={appName:e.name};n.email&&(r.email=n.email),n.phoneNumber&&(r.phoneNumber=n.phoneNumber);const i=xu(e,t,r);return i.customData._tokenResponse=n,i}/** * @license * Copyright 2020 Google LLC * @@ -2836,7 +2836,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function ty(e){if(e)try{const t=new Date(Number(e));if(!isNaN(t.getTime()))return t.toUTCString()}catch{}}async function _tt(e,t=!1){const n=Zi(e),r=await n.getIdToken(t),i=iL(r);Ct(i&&i.exp&&i.auth_time&&i.iat,n.auth,"internal-error");const s=typeof i.firebase=="object"?i.firebase:void 0,o=s==null?void 0:s.sign_in_provider;return{claims:i,token:r,authTime:ty(AO(i.auth_time)),issuedAtTime:ty(AO(i.iat)),expirationTime:ty(AO(i.exp)),signInProvider:o||null,signInSecondFactor:(s==null?void 0:s.sign_in_second_factor)||null}}function AO(e){return Number(e)*1e3}function iL(e){const[t,n,r]=e.split(".");if(t===void 0||n===void 0||r===void 0)return xb("JWT malformed, contained fewer than 3 sections"),null;try{const i=Wie(n);return i?JSON.parse(i):(xb("Failed to decode base64 JWT payload"),null)}catch(i){return xb("Caught error parsing JWT payload as JSON",i==null?void 0:i.toString()),null}}function vtt(e){const t=iL(e);return Ct(t,"internal-error"),Ct(typeof t.exp<"u","internal-error"),Ct(typeof t.iat<"u","internal-error"),Number(t.exp)-Number(t.iat)}/** + */function ty(e){if(e)try{const t=new Date(Number(e));if(!isNaN(t.getTime()))return t.toUTCString()}catch{}}async function _tt(e,t=!1){const n=Zi(e),r=await n.getIdToken(t),i=iL(r);Ct(i&&i.exp&&i.auth_time&&i.iat,n.auth,"internal-error");const s=typeof i.firebase=="object"?i.firebase:void 0,o=s==null?void 0:s.sign_in_provider;return{claims:i,token:r,authTime:ty(AO(i.auth_time)),issuedAtTime:ty(AO(i.iat)),expirationTime:ty(AO(i.exp)),signInProvider:o||null,signInSecondFactor:(s==null?void 0:s.sign_in_second_factor)||null}}function AO(e){return Number(e)*1e3}function iL(e){const[t,n,r]=e.split(".");if(t===void 0||n===void 0||r===void 0)return xb("JWT malformed, contained fewer than 3 sections"),null;try{const i=Hie(n);return i?JSON.parse(i):(xb("Failed to decode base64 JWT payload"),null)}catch(i){return xb("Caught error parsing JWT payload as JSON",i==null?void 0:i.toString()),null}}function vtt(e){const t=iL(e);return Ct(t,"internal-error"),Ct(typeof t.exp<"u","internal-error"),Ct(typeof t.iat<"u","internal-error"),Number(t.exp)-Number(t.iat)}/** * @license * Copyright 2020 Google LLC * @@ -2881,7 +2881,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class tue{constructor(t,n){this.createdAt=t,this.lastLoginAt=n,this._initializeTime()}_initializeTime(){this.lastSignInTime=ty(this.lastLoginAt),this.creationTime=ty(this.createdAt)}_copy(t){this.createdAt=t.createdAt,this.lastLoginAt=t.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}/** + */class eue{constructor(t,n){this.createdAt=t,this.lastLoginAt=n,this._initializeTime()}_initializeTime(){this.lastSignInTime=ty(this.lastLoginAt),this.creationTime=ty(this.createdAt)}_copy(t){this.createdAt=t.createdAt,this.lastLoginAt=t.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}/** * @license * Copyright 2019 Google LLC * @@ -2896,7 +2896,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */async function uS(e){var t;const n=e.auth,r=await e.getIdToken(),i=await h_(e,ytt(n,{idToken:r}));Ct(i==null?void 0:i.users.length,n,"internal-error");const s=i.users[0];e._notifyReloadListener(s);const o=!((t=s.providerUserInfo)===null||t===void 0)&&t.length?Stt(s.providerUserInfo):[],a=Ttt(e.providerData,o),u=e.isAnonymous,l=!(e.email&&s.passwordHash)&&!(a!=null&&a.length),c=u?l:!1,f={uid:s.localId,displayName:s.displayName||null,photoURL:s.photoUrl||null,email:s.email||null,emailVerified:s.emailVerified||!1,phoneNumber:s.phoneNumber||null,tenantId:s.tenantId||null,providerData:a,metadata:new tue(s.createdAt,s.lastLoginAt),isAnonymous:c};Object.assign(e,f)}async function wtt(e){const t=Zi(e);await uS(t),await t.auth._persistUserIfCurrent(t),t.auth._notifyListenersIfCurrent(t)}function Ttt(e,t){return[...e.filter(r=>!t.some(i=>i.providerId===r.providerId)),...t]}function Stt(e){return e.map(t=>{var{providerId:n}=t,r=A$(t,["providerId"]);return{providerId:n,uid:r.rawId||"",displayName:r.displayName||null,email:r.email||null,phoneNumber:r.phoneNumber||null,photoURL:r.photoUrl||null}})}/** + */async function uS(e){var t;const n=e.auth,r=await e.getIdToken(),i=await h_(e,ytt(n,{idToken:r}));Ct(i==null?void 0:i.users.length,n,"internal-error");const s=i.users[0];e._notifyReloadListener(s);const o=!((t=s.providerUserInfo)===null||t===void 0)&&t.length?Stt(s.providerUserInfo):[],a=Ttt(e.providerData,o),u=e.isAnonymous,l=!(e.email&&s.passwordHash)&&!(a!=null&&a.length),c=u?l:!1,f={uid:s.localId,displayName:s.displayName||null,photoURL:s.photoUrl||null,email:s.email||null,emailVerified:s.emailVerified||!1,phoneNumber:s.phoneNumber||null,tenantId:s.tenantId||null,providerData:a,metadata:new eue(s.createdAt,s.lastLoginAt),isAnonymous:c};Object.assign(e,f)}async function wtt(e){const t=Zi(e);await uS(t),await t.auth._persistUserIfCurrent(t),t.auth._notifyListenersIfCurrent(t)}function Ttt(e,t){return[...e.filter(r=>!t.some(i=>i.providerId===r.providerId)),...t]}function Stt(e){return e.map(t=>{var{providerId:n}=t,r=A$(t,["providerId"]);return{providerId:n,uid:r.rawId||"",displayName:r.displayName||null,email:r.email||null,phoneNumber:r.phoneNumber||null,photoURL:r.photoUrl||null}})}/** * @license * Copyright 2020 Google LLC * @@ -2911,7 +2911,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */async function Itt(e,t){const n=await Jae(e,{},async()=>{const r=tv({grant_type:"refresh_token",refresh_token:t}).slice(1),{tokenApiHost:i,apiKey:s}=e.config,o=eue(e,i,"/v1/token",`key=${s}`),a=await e._getAdditionalHeaders();return a["Content-Type"]="application/x-www-form-urlencoded",Xae.fetch()(o,{method:"POST",headers:a,body:r})});return{accessToken:n.access_token,expiresIn:n.expires_in,refreshToken:n.refresh_token}}async function xtt(e,t){return fg(e,"POST","/v2/accounts:revokeToken",Bx(e,t))}/** + */async function Itt(e,t){const n=await Xae(e,{},async()=>{const r=tv({grant_type:"refresh_token",refresh_token:t}).slice(1),{tokenApiHost:i,apiKey:s}=e.config,o=Zae(e,i,"/v1/token",`key=${s}`),a=await e._getAdditionalHeaders();return a["Content-Type"]="application/x-www-form-urlencoded",Qae.fetch()(o,{method:"POST",headers:a,body:r})});return{accessToken:n.access_token,expiresIn:n.expires_in,refreshToken:n.refresh_token}}async function xtt(e,t){return fg(e,"POST","/v2/accounts:revokeToken",Bx(e,t))}/** * @license * Copyright 2020 Google LLC * @@ -2941,7 +2941,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function rc(e,t){Ct(typeof e=="string"||typeof e>"u","internal-error",{appName:t})}class Sd{constructor(t){var{uid:n,auth:r,stsTokenManager:i}=t,s=A$(t,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new Ett(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=n,this.auth=r,this.stsTokenManager=i,this.accessToken=i.accessToken,this.displayName=s.displayName||null,this.email=s.email||null,this.emailVerified=s.emailVerified||!1,this.phoneNumber=s.phoneNumber||null,this.photoURL=s.photoURL||null,this.isAnonymous=s.isAnonymous||!1,this.tenantId=s.tenantId||null,this.providerData=s.providerData?[...s.providerData]:[],this.metadata=new tue(s.createdAt||void 0,s.lastLoginAt||void 0)}async getIdToken(t){const n=await h_(this,this.stsTokenManager.getToken(this.auth,t));return Ct(n,this.auth,"internal-error"),this.accessToken!==n&&(this.accessToken=n,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),n}getIdTokenResult(t){return _tt(this,t)}reload(){return wtt(this)}_assign(t){this!==t&&(Ct(this.uid===t.uid,this.auth,"internal-error"),this.displayName=t.displayName,this.photoURL=t.photoURL,this.email=t.email,this.emailVerified=t.emailVerified,this.phoneNumber=t.phoneNumber,this.isAnonymous=t.isAnonymous,this.tenantId=t.tenantId,this.providerData=t.providerData.map(n=>Object.assign({},n)),this.metadata._copy(t.metadata),this.stsTokenManager._assign(t.stsTokenManager))}_clone(t){const n=new Sd(Object.assign(Object.assign({},this),{auth:t,stsTokenManager:this.stsTokenManager._clone()}));return n.metadata._copy(this.metadata),n}_onReload(t){Ct(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=t,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(t){this.reloadListener?this.reloadListener(t):this.reloadUserInfo=t}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(t,n=!1){let r=!1;t.idToken&&t.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(t),r=!0),n&&await uS(this),await this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)}async delete(){const t=await this.getIdToken();return await h_(this,gtt(this.auth,{idToken:t})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return Object.assign(Object.assign({uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(t=>Object.assign({},t)),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId},this.metadata.toJSON()),{apiKey:this.auth.config.apiKey,appName:this.auth.name})}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(t,n){var r,i,s,o,a,u,l,c;const f=(r=n.displayName)!==null&&r!==void 0?r:void 0,d=(i=n.email)!==null&&i!==void 0?i:void 0,h=(s=n.phoneNumber)!==null&&s!==void 0?s:void 0,p=(o=n.photoURL)!==null&&o!==void 0?o:void 0,m=(a=n.tenantId)!==null&&a!==void 0?a:void 0,y=(u=n._redirectEventId)!==null&&u!==void 0?u:void 0,g=(l=n.createdAt)!==null&&l!==void 0?l:void 0,_=(c=n.lastLoginAt)!==null&&c!==void 0?c:void 0,{uid:b,emailVerified:T,isAnonymous:I,providerData:E,stsTokenManager:S}=n;Ct(b&&S,t,"internal-error");const A=p_.fromJSON(this.name,S);Ct(typeof b=="string",t,"internal-error"),rc(f,t.name),rc(d,t.name),Ct(typeof T=="boolean",t,"internal-error"),Ct(typeof I=="boolean",t,"internal-error"),rc(h,t.name),rc(p,t.name),rc(m,t.name),rc(y,t.name),rc(g,t.name),rc(_,t.name);const P=new Sd({uid:b,auth:t,email:d,emailVerified:T,displayName:f,isAnonymous:I,photoURL:p,phoneNumber:h,tenantId:m,stsTokenManager:A,createdAt:g,lastLoginAt:_});return E&&Array.isArray(E)&&(P.providerData=E.map(V=>Object.assign({},V))),y&&(P._redirectEventId=y),P}static async _fromIdTokenResponse(t,n,r=!1){const i=new p_;i.updateFromServerResponse(n);const s=new Sd({uid:n.localId,auth:t,stsTokenManager:i,isAnonymous:r});return await uS(s),s}}/** + */function rc(e,t){Ct(typeof e=="string"||typeof e>"u","internal-error",{appName:t})}class Sd{constructor(t){var{uid:n,auth:r,stsTokenManager:i}=t,s=A$(t,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new Ett(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=n,this.auth=r,this.stsTokenManager=i,this.accessToken=i.accessToken,this.displayName=s.displayName||null,this.email=s.email||null,this.emailVerified=s.emailVerified||!1,this.phoneNumber=s.phoneNumber||null,this.photoURL=s.photoURL||null,this.isAnonymous=s.isAnonymous||!1,this.tenantId=s.tenantId||null,this.providerData=s.providerData?[...s.providerData]:[],this.metadata=new eue(s.createdAt||void 0,s.lastLoginAt||void 0)}async getIdToken(t){const n=await h_(this,this.stsTokenManager.getToken(this.auth,t));return Ct(n,this.auth,"internal-error"),this.accessToken!==n&&(this.accessToken=n,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),n}getIdTokenResult(t){return _tt(this,t)}reload(){return wtt(this)}_assign(t){this!==t&&(Ct(this.uid===t.uid,this.auth,"internal-error"),this.displayName=t.displayName,this.photoURL=t.photoURL,this.email=t.email,this.emailVerified=t.emailVerified,this.phoneNumber=t.phoneNumber,this.isAnonymous=t.isAnonymous,this.tenantId=t.tenantId,this.providerData=t.providerData.map(n=>Object.assign({},n)),this.metadata._copy(t.metadata),this.stsTokenManager._assign(t.stsTokenManager))}_clone(t){const n=new Sd(Object.assign(Object.assign({},this),{auth:t,stsTokenManager:this.stsTokenManager._clone()}));return n.metadata._copy(this.metadata),n}_onReload(t){Ct(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=t,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(t){this.reloadListener?this.reloadListener(t):this.reloadUserInfo=t}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(t,n=!1){let r=!1;t.idToken&&t.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(t),r=!0),n&&await uS(this),await this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)}async delete(){const t=await this.getIdToken();return await h_(this,gtt(this.auth,{idToken:t})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return Object.assign(Object.assign({uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(t=>Object.assign({},t)),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId},this.metadata.toJSON()),{apiKey:this.auth.config.apiKey,appName:this.auth.name})}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(t,n){var r,i,s,o,a,u,l,c;const f=(r=n.displayName)!==null&&r!==void 0?r:void 0,d=(i=n.email)!==null&&i!==void 0?i:void 0,h=(s=n.phoneNumber)!==null&&s!==void 0?s:void 0,p=(o=n.photoURL)!==null&&o!==void 0?o:void 0,m=(a=n.tenantId)!==null&&a!==void 0?a:void 0,y=(u=n._redirectEventId)!==null&&u!==void 0?u:void 0,g=(l=n.createdAt)!==null&&l!==void 0?l:void 0,_=(c=n.lastLoginAt)!==null&&c!==void 0?c:void 0,{uid:b,emailVerified:T,isAnonymous:I,providerData:E,stsTokenManager:S}=n;Ct(b&&S,t,"internal-error");const A=p_.fromJSON(this.name,S);Ct(typeof b=="string",t,"internal-error"),rc(f,t.name),rc(d,t.name),Ct(typeof T=="boolean",t,"internal-error"),Ct(typeof I=="boolean",t,"internal-error"),rc(h,t.name),rc(p,t.name),rc(m,t.name),rc(y,t.name),rc(g,t.name),rc(_,t.name);const P=new Sd({uid:b,auth:t,email:d,emailVerified:T,displayName:f,isAnonymous:I,photoURL:p,phoneNumber:h,tenantId:m,stsTokenManager:A,createdAt:g,lastLoginAt:_});return E&&Array.isArray(E)&&(P.providerData=E.map(V=>Object.assign({},V))),y&&(P._redirectEventId=y),P}static async _fromIdTokenResponse(t,n,r=!1){const i=new p_;i.updateFromServerResponse(n);const s=new Sd({uid:n.localId,auth:t,stsTokenManager:i,isAnonymous:r});return await uS(s),s}}/** * @license * Copyright 2020 Google LLC * @@ -2971,7 +2971,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class nue{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(t,n){this.storage[t]=n}async _get(t){const n=this.storage[t];return n===void 0?null:n}async _remove(t){delete this.storage[t]}_addListener(t,n){}_removeListener(t,n){}}nue.type="NONE";const O7=nue;/** + */class tue{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(t,n){this.storage[t]=n}async _get(t){const n=this.storage[t];return n===void 0?null:n}async _remove(t){delete this.storage[t]}_addListener(t,n){}_removeListener(t,n){}}tue.type="NONE";const O7=tue;/** * @license * Copyright 2019 Google LLC * @@ -3001,7 +3001,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function P7(e){const t=e.toLowerCase();if(t.includes("opera/")||t.includes("opr/")||t.includes("opios/"))return"Opera";if(sue(t))return"IEMobile";if(t.includes("msie")||t.includes("trident/"))return"IE";if(t.includes("edge/"))return"Edge";if(rue(t))return"Firefox";if(t.includes("silk/"))return"Silk";if(aue(t))return"Blackberry";if(uue(t))return"Webos";if(sL(t))return"Safari";if((t.includes("chrome/")||iue(t))&&!t.includes("edge/"))return"Chrome";if(oue(t))return"Android";{const n=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,r=e.match(n);if((r==null?void 0:r.length)===2)return r[1]}return"Other"}function rue(e=Ji()){return/firefox\//i.test(e)}function sL(e=Ji()){const t=e.toLowerCase();return t.includes("safari/")&&!t.includes("chrome/")&&!t.includes("crios/")&&!t.includes("android")}function iue(e=Ji()){return/crios\//i.test(e)}function sue(e=Ji()){return/iemobile/i.test(e)}function oue(e=Ji()){return/android/i.test(e)}function aue(e=Ji()){return/blackberry/i.test(e)}function uue(e=Ji()){return/webos/i.test(e)}function jx(e=Ji()){return/iphone|ipad|ipod/i.test(e)||/macintosh/i.test(e)&&/mobile/i.test(e)}function Ctt(e=Ji()){var t;return jx(e)&&!!(!((t=window.navigator)===null||t===void 0)&&t.standalone)}function Att(){return RYe()&&document.documentMode===10}function lue(e=Ji()){return jx(e)||oue(e)||uue(e)||aue(e)||/windows phone/i.test(e)||sue(e)}function Ott(){try{return!!(window&&window!==window.top)}catch{return!1}}/** + */function P7(e){const t=e.toLowerCase();if(t.includes("opera/")||t.includes("opr/")||t.includes("opios/"))return"Opera";if(iue(t))return"IEMobile";if(t.includes("msie")||t.includes("trident/"))return"IE";if(t.includes("edge/"))return"Edge";if(nue(t))return"Firefox";if(t.includes("silk/"))return"Silk";if(oue(t))return"Blackberry";if(aue(t))return"Webos";if(sL(t))return"Safari";if((t.includes("chrome/")||rue(t))&&!t.includes("edge/"))return"Chrome";if(sue(t))return"Android";{const n=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,r=e.match(n);if((r==null?void 0:r.length)===2)return r[1]}return"Other"}function nue(e=Ji()){return/firefox\//i.test(e)}function sL(e=Ji()){const t=e.toLowerCase();return t.includes("safari/")&&!t.includes("chrome/")&&!t.includes("crios/")&&!t.includes("android")}function rue(e=Ji()){return/crios\//i.test(e)}function iue(e=Ji()){return/iemobile/i.test(e)}function sue(e=Ji()){return/android/i.test(e)}function oue(e=Ji()){return/blackberry/i.test(e)}function aue(e=Ji()){return/webos/i.test(e)}function jx(e=Ji()){return/iphone|ipad|ipod/i.test(e)||/macintosh/i.test(e)&&/mobile/i.test(e)}function Ctt(e=Ji()){var t;return jx(e)&&!!(!((t=window.navigator)===null||t===void 0)&&t.standalone)}function Att(){return RYe()&&document.documentMode===10}function uue(e=Ji()){return jx(e)||sue(e)||aue(e)||oue(e)||/windows phone/i.test(e)||iue(e)}function Ott(){try{return!!(window&&window!==window.top)}catch{return!1}}/** * @license * Copyright 2020 Google LLC * @@ -3016,7 +3016,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function cue(e,t=[]){let n;switch(e){case"Browser":n=P7(Ji());break;case"Worker":n=`${P7(Ji())}-${e}`;break;default:n=e}const r=t.length?t.join(","):"FirebaseCore-web";return`${n}/JsCore/${ch}/${r}`}/** + */function lue(e,t=[]){let n;switch(e){case"Browser":n=P7(Ji());break;case"Worker":n=`${P7(Ji())}-${e}`;break;default:n=e}const r=t.length?t.join(","):"FirebaseCore-web";return`${n}/JsCore/${ch}/${r}`}/** * @license * Copyright 2022 Google LLC * @@ -3076,7 +3076,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class Dtt{constructor(t,n,r,i){this.app=t,this.heartbeatServiceProvider=n,this.appCheckServiceProvider=r,this.config=i,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new R7(this),this.idTokenSubscription=new R7(this),this.beforeStateQueue=new Ptt(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=Qae,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=t.name,this.clientVersion=i.sdkClientVersion}_initializeWithPersistence(t,n){return n&&(this._popupRedirectResolver=cl(n)),this._initializationPromise=this.queue(async()=>{var r,i;if(!this._deleted&&(this.persistenceManager=await Fp.create(this,t),!this._deleted)){if(!((r=this._popupRedirectResolver)===null||r===void 0)&&r._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch{}await this.initializeCurrentUser(n),this.lastNotifiedUid=((i=this.currentUser)===null||i===void 0?void 0:i.uid)||null,!this._deleted&&(this._isInitialized=!0)}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const t=await this.assertedPersistence.getCurrentUser();if(!(!this.currentUser&&!t)){if(this.currentUser&&t&&this.currentUser.uid===t.uid){this._currentUser._assign(t),await this.currentUser.getIdToken();return}await this._updateCurrentUser(t,!0)}}async initializeCurrentUser(t){var n;const r=await this.assertedPersistence.getCurrentUser();let i=r,s=!1;if(t&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const o=(n=this.redirectUser)===null||n===void 0?void 0:n._redirectEventId,a=i==null?void 0:i._redirectEventId,u=await this.tryRedirectSignIn(t);(!o||o===a)&&(u!=null&&u.user)&&(i=u.user,s=!0)}if(!i)return this.directlySetCurrentUser(null);if(!i._redirectEventId){if(s)try{await this.beforeStateQueue.runMiddleware(i)}catch(o){i=r,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(o))}return i?this.reloadAndSetCurrentUserOrClear(i):this.directlySetCurrentUser(null)}return Ct(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===i._redirectEventId?this.directlySetCurrentUser(i):this.reloadAndSetCurrentUserOrClear(i)}async tryRedirectSignIn(t){let n=null;try{n=await this._popupRedirectResolver._completeRedirectFn(this,t,!0)}catch{await this._setRedirectUser(null)}return n}async reloadAndSetCurrentUserOrClear(t){try{await uS(t)}catch(n){if((n==null?void 0:n.code)!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(t)}useDeviceLanguage(){this.languageCode=dtt()}async _delete(){this._deleted=!0}async updateCurrentUser(t){const n=t?Zi(t):null;return n&&Ct(n.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(n&&n._clone(this))}async _updateCurrentUser(t,n=!1){if(!this._deleted)return t&&Ct(this.tenantId===t.tenantId,this,"tenant-id-mismatch"),n||await this.beforeStateQueue.runMiddleware(t),this.queue(async()=>{await this.directlySetCurrentUser(t),this.notifyAuthListeners()})}async signOut(){return await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0)}setPersistence(t){return this.queue(async()=>{await this.assertedPersistence.setPersistence(cl(t))})}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(t){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const n=this._getPasswordPolicyInternal();return n.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):n.validatePassword(t)}_getPasswordPolicyInternal(){return this.tenantId===null?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const t=await Rtt(this),n=new ktt(t);this.tenantId===null?this._projectPasswordPolicy=n:this._tenantPasswordPolicies[this.tenantId]=n}_getPersistence(){return this.assertedPersistence.persistence.type}_updateErrorMap(t){this._errorFactory=new rg("auth","Firebase",t())}onAuthStateChanged(t,n,r){return this.registerStateListener(this.authStateSubscription,t,n,r)}beforeAuthStateChanged(t,n){return this.beforeStateQueue.pushCallback(t,n)}onIdTokenChanged(t,n,r){return this.registerStateListener(this.idTokenSubscription,t,n,r)}authStateReady(){return new Promise((t,n)=>{if(this.currentUser)t();else{const r=this.onAuthStateChanged(()=>{r(),t()},n)}})}async revokeAccessToken(t){if(this.currentUser){const n=await this.currentUser.getIdToken(),r={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:t,idToken:n};this.tenantId!=null&&(r.tenantId=this.tenantId),await xtt(this,r)}}toJSON(){var t;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:(t=this._currentUser)===null||t===void 0?void 0:t.toJSON()}}async _setRedirectUser(t,n){const r=await this.getOrInitRedirectPersistenceManager(n);return t===null?r.removeCurrentUser():r.setCurrentUser(t)}async getOrInitRedirectPersistenceManager(t){if(!this.redirectPersistenceManager){const n=t&&cl(t)||this._popupRedirectResolver;Ct(n,this,"argument-error"),this.redirectPersistenceManager=await Fp.create(this,[cl(n._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(t){var n,r;return this._isInitialized&&await this.queue(async()=>{}),((n=this._currentUser)===null||n===void 0?void 0:n._redirectEventId)===t?this._currentUser:((r=this.redirectUser)===null||r===void 0?void 0:r._redirectEventId)===t?this.redirectUser:null}async _persistUserIfCurrent(t){if(t===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(t))}_notifyListenersIfCurrent(t){t===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var t,n;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const r=(n=(t=this.currentUser)===null||t===void 0?void 0:t.uid)!==null&&n!==void 0?n:null;this.lastNotifiedUid!==r&&(this.lastNotifiedUid=r,this.authStateSubscription.next(this.currentUser))}registerStateListener(t,n,r,i){if(this._deleted)return()=>{};const s=typeof n=="function"?n:n.next.bind(n);let o=!1;const a=this._isInitialized?Promise.resolve():this._initializationPromise;if(Ct(a,this,"internal-error"),a.then(()=>{o||s(this.currentUser)}),typeof n=="function"){const u=t.addObserver(n,r,i);return()=>{o=!0,u()}}else{const u=t.addObserver(n);return()=>{o=!0,u()}}}async directlySetCurrentUser(t){this.currentUser&&this.currentUser!==t&&this._currentUser._stopProactiveRefresh(),t&&this.isProactiveRefreshEnabled&&t._startProactiveRefresh(),this.currentUser=t,t?await this.assertedPersistence.setCurrentUser(t):await this.assertedPersistence.removeCurrentUser()}queue(t){return this.operations=this.operations.then(t,t),this.operations}get assertedPersistence(){return Ct(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(t){!t||this.frameworks.includes(t)||(this.frameworks.push(t),this.frameworks.sort(),this.clientVersion=cue(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var t;const n={"X-Client-Version":this.clientVersion};this.app.options.appId&&(n["X-Firebase-gmpid"]=this.app.options.appId);const r=await((t=this.heartbeatServiceProvider.getImmediate({optional:!0}))===null||t===void 0?void 0:t.getHeartbeatsHeader());r&&(n["X-Firebase-Client"]=r);const i=await this._getAppCheckToken();return i&&(n["X-Firebase-AppCheck"]=i),n}async _getAppCheckToken(){var t;const n=await((t=this.appCheckServiceProvider.getImmediate({optional:!0}))===null||t===void 0?void 0:t.getToken());return n!=null&&n.error&&utt(`Error while retrieving App Check token: ${n.error}`),n==null?void 0:n.token}}function Ux(e){return Zi(e)}class R7{constructor(t){this.auth=t,this.observer=null,this.addObserver=MYe(n=>this.observer=n)}get next(){return Ct(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}/** + */class Dtt{constructor(t,n,r,i){this.app=t,this.heartbeatServiceProvider=n,this.appCheckServiceProvider=r,this.config=i,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new R7(this),this.idTokenSubscription=new R7(this),this.beforeStateQueue=new Ptt(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=Kae,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=t.name,this.clientVersion=i.sdkClientVersion}_initializeWithPersistence(t,n){return n&&(this._popupRedirectResolver=cl(n)),this._initializationPromise=this.queue(async()=>{var r,i;if(!this._deleted&&(this.persistenceManager=await Fp.create(this,t),!this._deleted)){if(!((r=this._popupRedirectResolver)===null||r===void 0)&&r._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch{}await this.initializeCurrentUser(n),this.lastNotifiedUid=((i=this.currentUser)===null||i===void 0?void 0:i.uid)||null,!this._deleted&&(this._isInitialized=!0)}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const t=await this.assertedPersistence.getCurrentUser();if(!(!this.currentUser&&!t)){if(this.currentUser&&t&&this.currentUser.uid===t.uid){this._currentUser._assign(t),await this.currentUser.getIdToken();return}await this._updateCurrentUser(t,!0)}}async initializeCurrentUser(t){var n;const r=await this.assertedPersistence.getCurrentUser();let i=r,s=!1;if(t&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const o=(n=this.redirectUser)===null||n===void 0?void 0:n._redirectEventId,a=i==null?void 0:i._redirectEventId,u=await this.tryRedirectSignIn(t);(!o||o===a)&&(u!=null&&u.user)&&(i=u.user,s=!0)}if(!i)return this.directlySetCurrentUser(null);if(!i._redirectEventId){if(s)try{await this.beforeStateQueue.runMiddleware(i)}catch(o){i=r,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(o))}return i?this.reloadAndSetCurrentUserOrClear(i):this.directlySetCurrentUser(null)}return Ct(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===i._redirectEventId?this.directlySetCurrentUser(i):this.reloadAndSetCurrentUserOrClear(i)}async tryRedirectSignIn(t){let n=null;try{n=await this._popupRedirectResolver._completeRedirectFn(this,t,!0)}catch{await this._setRedirectUser(null)}return n}async reloadAndSetCurrentUserOrClear(t){try{await uS(t)}catch(n){if((n==null?void 0:n.code)!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(t)}useDeviceLanguage(){this.languageCode=dtt()}async _delete(){this._deleted=!0}async updateCurrentUser(t){const n=t?Zi(t):null;return n&&Ct(n.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(n&&n._clone(this))}async _updateCurrentUser(t,n=!1){if(!this._deleted)return t&&Ct(this.tenantId===t.tenantId,this,"tenant-id-mismatch"),n||await this.beforeStateQueue.runMiddleware(t),this.queue(async()=>{await this.directlySetCurrentUser(t),this.notifyAuthListeners()})}async signOut(){return await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0)}setPersistence(t){return this.queue(async()=>{await this.assertedPersistence.setPersistence(cl(t))})}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(t){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const n=this._getPasswordPolicyInternal();return n.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):n.validatePassword(t)}_getPasswordPolicyInternal(){return this.tenantId===null?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const t=await Rtt(this),n=new ktt(t);this.tenantId===null?this._projectPasswordPolicy=n:this._tenantPasswordPolicies[this.tenantId]=n}_getPersistence(){return this.assertedPersistence.persistence.type}_updateErrorMap(t){this._errorFactory=new rg("auth","Firebase",t())}onAuthStateChanged(t,n,r){return this.registerStateListener(this.authStateSubscription,t,n,r)}beforeAuthStateChanged(t,n){return this.beforeStateQueue.pushCallback(t,n)}onIdTokenChanged(t,n,r){return this.registerStateListener(this.idTokenSubscription,t,n,r)}authStateReady(){return new Promise((t,n)=>{if(this.currentUser)t();else{const r=this.onAuthStateChanged(()=>{r(),t()},n)}})}async revokeAccessToken(t){if(this.currentUser){const n=await this.currentUser.getIdToken(),r={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:t,idToken:n};this.tenantId!=null&&(r.tenantId=this.tenantId),await xtt(this,r)}}toJSON(){var t;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:(t=this._currentUser)===null||t===void 0?void 0:t.toJSON()}}async _setRedirectUser(t,n){const r=await this.getOrInitRedirectPersistenceManager(n);return t===null?r.removeCurrentUser():r.setCurrentUser(t)}async getOrInitRedirectPersistenceManager(t){if(!this.redirectPersistenceManager){const n=t&&cl(t)||this._popupRedirectResolver;Ct(n,this,"argument-error"),this.redirectPersistenceManager=await Fp.create(this,[cl(n._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(t){var n,r;return this._isInitialized&&await this.queue(async()=>{}),((n=this._currentUser)===null||n===void 0?void 0:n._redirectEventId)===t?this._currentUser:((r=this.redirectUser)===null||r===void 0?void 0:r._redirectEventId)===t?this.redirectUser:null}async _persistUserIfCurrent(t){if(t===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(t))}_notifyListenersIfCurrent(t){t===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var t,n;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const r=(n=(t=this.currentUser)===null||t===void 0?void 0:t.uid)!==null&&n!==void 0?n:null;this.lastNotifiedUid!==r&&(this.lastNotifiedUid=r,this.authStateSubscription.next(this.currentUser))}registerStateListener(t,n,r,i){if(this._deleted)return()=>{};const s=typeof n=="function"?n:n.next.bind(n);let o=!1;const a=this._isInitialized?Promise.resolve():this._initializationPromise;if(Ct(a,this,"internal-error"),a.then(()=>{o||s(this.currentUser)}),typeof n=="function"){const u=t.addObserver(n,r,i);return()=>{o=!0,u()}}else{const u=t.addObserver(n);return()=>{o=!0,u()}}}async directlySetCurrentUser(t){this.currentUser&&this.currentUser!==t&&this._currentUser._stopProactiveRefresh(),t&&this.isProactiveRefreshEnabled&&t._startProactiveRefresh(),this.currentUser=t,t?await this.assertedPersistence.setCurrentUser(t):await this.assertedPersistence.removeCurrentUser()}queue(t){return this.operations=this.operations.then(t,t),this.operations}get assertedPersistence(){return Ct(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(t){!t||this.frameworks.includes(t)||(this.frameworks.push(t),this.frameworks.sort(),this.clientVersion=lue(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var t;const n={"X-Client-Version":this.clientVersion};this.app.options.appId&&(n["X-Firebase-gmpid"]=this.app.options.appId);const r=await((t=this.heartbeatServiceProvider.getImmediate({optional:!0}))===null||t===void 0?void 0:t.getHeartbeatsHeader());r&&(n["X-Firebase-Client"]=r);const i=await this._getAppCheckToken();return i&&(n["X-Firebase-AppCheck"]=i),n}async _getAppCheckToken(){var t;const n=await((t=this.appCheckServiceProvider.getImmediate({optional:!0}))===null||t===void 0?void 0:t.getToken());return n!=null&&n.error&&utt(`Error while retrieving App Check token: ${n.error}`),n==null?void 0:n.token}}function Ux(e){return Zi(e)}class R7{constructor(t){this.auth=t,this.observer=null,this.addObserver=MYe(n=>this.observer=n)}get next(){return Ct(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}/** * @license * Copyright 2020 Google LLC * @@ -3106,7 +3106,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function Ftt(e,t){const n=ig(e,"auth");if(n.isInitialized()){const i=n.getImmediate(),s=n.getOptions();if(Gy(s,t??{}))return i;Bl(i,"already-initialized")}return n.initialize({options:t})}function Btt(e,t){const n=(t==null?void 0:t.persistence)||[],r=(Array.isArray(n)?n:[n]).map(cl);t!=null&&t.errorMap&&e._updateErrorMap(t.errorMap),e._initializeWithPersistence(r,t==null?void 0:t.popupRedirectResolver)}function jtt(e,t,n){const r=Ux(e);Ct(r._canInitEmulator,r,"emulator-config-failed"),Ct(/^https?:\/\//.test(t),r,"invalid-emulator-scheme");const i=!!(n!=null&&n.disableWarnings),s=fue(t),{host:o,port:a}=Utt(t),u=a===null?"":`:${a}`;r.config.emulator={url:`${s}//${o}${u}/`},r.settings.appVerificationDisabledForTesting=!0,r.emulatorConfig=Object.freeze({host:o,port:a,protocol:s.replace(":",""),options:Object.freeze({disableWarnings:i})}),i||Vtt()}function fue(e){const t=e.indexOf(":");return t<0?"":e.substr(0,t+1)}function Utt(e){const t=fue(e),n=/(\/\/)?([^?#/]+)/.exec(e.substr(t.length));if(!n)return{host:"",port:null};const r=n[2].split("@").pop()||"",i=/^(\[[^\]]+\])(:|$)/.exec(r);if(i){const s=i[1];return{host:s,port:N7(r.substr(s.length+1))}}else{const[s,o]=r.split(":");return{host:s,port:N7(o)}}}function N7(e){if(!e)return null;const t=Number(e);return isNaN(t)?null:t}function Vtt(){function e(){const t=document.createElement("p"),n=t.style;t.innerText="Running in emulator mode. Do not use with production credentials.",n.position="fixed",n.width="100%",n.backgroundColor="#ffffff",n.border=".1em solid #000000",n.color="#b50000",n.bottom="0px",n.left="0px",n.margin="0px",n.zIndex="10000",n.textAlign="center",t.classList.add("firebase-emulator-warning"),document.body.appendChild(t)}typeof console<"u"&&typeof console.info=="function"&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only. Do not use with production credentials."),typeof window<"u"&&typeof document<"u"&&(document.readyState==="loading"?window.addEventListener("DOMContentLoaded",e):e())}/** + */function Ftt(e,t){const n=ig(e,"auth");if(n.isInitialized()){const i=n.getImmediate(),s=n.getOptions();if(Gy(s,t??{}))return i;Bl(i,"already-initialized")}return n.initialize({options:t})}function Btt(e,t){const n=(t==null?void 0:t.persistence)||[],r=(Array.isArray(n)?n:[n]).map(cl);t!=null&&t.errorMap&&e._updateErrorMap(t.errorMap),e._initializeWithPersistence(r,t==null?void 0:t.popupRedirectResolver)}function jtt(e,t,n){const r=Ux(e);Ct(r._canInitEmulator,r,"emulator-config-failed"),Ct(/^https?:\/\//.test(t),r,"invalid-emulator-scheme");const i=!!(n!=null&&n.disableWarnings),s=cue(t),{host:o,port:a}=Utt(t),u=a===null?"":`:${a}`;r.config.emulator={url:`${s}//${o}${u}/`},r.settings.appVerificationDisabledForTesting=!0,r.emulatorConfig=Object.freeze({host:o,port:a,protocol:s.replace(":",""),options:Object.freeze({disableWarnings:i})}),i||Vtt()}function cue(e){const t=e.indexOf(":");return t<0?"":e.substr(0,t+1)}function Utt(e){const t=cue(e),n=/(\/\/)?([^?#/]+)/.exec(e.substr(t.length));if(!n)return{host:"",port:null};const r=n[2].split("@").pop()||"",i=/^(\[[^\]]+\])(:|$)/.exec(r);if(i){const s=i[1];return{host:s,port:N7(r.substr(s.length+1))}}else{const[s,o]=r.split(":");return{host:s,port:N7(o)}}}function N7(e){if(!e)return null;const t=Number(e);return isNaN(t)?null:t}function Vtt(){function e(){const t=document.createElement("p"),n=t.style;t.innerText="Running in emulator mode. Do not use with production credentials.",n.position="fixed",n.width="100%",n.backgroundColor="#ffffff",n.border=".1em solid #000000",n.color="#b50000",n.bottom="0px",n.left="0px",n.margin="0px",n.zIndex="10000",n.textAlign="center",t.classList.add("firebase-emulator-warning"),document.body.appendChild(t)}typeof console<"u"&&typeof console.info=="function"&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only. Do not use with production credentials."),typeof window<"u"&&typeof document<"u"&&(document.readyState==="loading"?window.addEventListener("DOMContentLoaded",e):e())}/** * @license * Copyright 2020 Google LLC * @@ -3121,7 +3121,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class due{constructor(t,n){this.providerId=t,this.signInMethod=n}toJSON(){return ll("not implemented")}_getIdTokenResponse(t){return ll("not implemented")}_linkToIdToken(t,n){return ll("not implemented")}_getReauthenticationResolver(t){return ll("not implemented")}}/** + */class fue{constructor(t,n){this.providerId=t,this.signInMethod=n}toJSON(){return ll("not implemented")}_getIdTokenResponse(t){return ll("not implemented")}_linkToIdToken(t,n){return ll("not implemented")}_getReauthenticationResolver(t){return ll("not implemented")}}/** * @license * Copyright 2020 Google LLC * @@ -3136,7 +3136,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */async function Bp(e,t){return Zae(e,"POST","/v1/accounts:signInWithIdp",Bx(e,t))}/** + */async function Bp(e,t){return Jae(e,"POST","/v1/accounts:signInWithIdp",Bx(e,t))}/** * @license * Copyright 2020 Google LLC * @@ -3151,7 +3151,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const ztt="http://localhost";class Yd extends due{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(t){const n=new Yd(t.providerId,t.signInMethod);return t.idToken||t.accessToken?(t.idToken&&(n.idToken=t.idToken),t.accessToken&&(n.accessToken=t.accessToken),t.nonce&&!t.pendingToken&&(n.nonce=t.nonce),t.pendingToken&&(n.pendingToken=t.pendingToken)):t.oauthToken&&t.oauthTokenSecret?(n.accessToken=t.oauthToken,n.secret=t.oauthTokenSecret):Bl("argument-error"),n}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(t){const n=typeof t=="string"?JSON.parse(t):t,{providerId:r,signInMethod:i}=n,s=A$(n,["providerId","signInMethod"]);if(!r||!i)return null;const o=new Yd(r,i);return o.idToken=s.idToken||void 0,o.accessToken=s.accessToken||void 0,o.secret=s.secret,o.nonce=s.nonce,o.pendingToken=s.pendingToken||null,o}_getIdTokenResponse(t){const n=this.buildRequest();return Bp(t,n)}_linkToIdToken(t,n){const r=this.buildRequest();return r.idToken=n,Bp(t,r)}_getReauthenticationResolver(t){const n=this.buildRequest();return n.autoCreate=!1,Bp(t,n)}buildRequest(){const t={requestUri:ztt,returnSecureToken:!0};if(this.pendingToken)t.pendingToken=this.pendingToken;else{const n={};this.idToken&&(n.id_token=this.idToken),this.accessToken&&(n.access_token=this.accessToken),this.secret&&(n.oauth_token_secret=this.secret),n.providerId=this.providerId,this.nonce&&!this.pendingToken&&(n.nonce=this.nonce),t.postBody=tv(n)}return t}}/** + */const ztt="http://localhost";class Yd extends fue{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(t){const n=new Yd(t.providerId,t.signInMethod);return t.idToken||t.accessToken?(t.idToken&&(n.idToken=t.idToken),t.accessToken&&(n.accessToken=t.accessToken),t.nonce&&!t.pendingToken&&(n.nonce=t.nonce),t.pendingToken&&(n.pendingToken=t.pendingToken)):t.oauthToken&&t.oauthTokenSecret?(n.accessToken=t.oauthToken,n.secret=t.oauthTokenSecret):Bl("argument-error"),n}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(t){const n=typeof t=="string"?JSON.parse(t):t,{providerId:r,signInMethod:i}=n,s=A$(n,["providerId","signInMethod"]);if(!r||!i)return null;const o=new Yd(r,i);return o.idToken=s.idToken||void 0,o.accessToken=s.accessToken||void 0,o.secret=s.secret,o.nonce=s.nonce,o.pendingToken=s.pendingToken||null,o}_getIdTokenResponse(t){const n=this.buildRequest();return Bp(t,n)}_linkToIdToken(t,n){const r=this.buildRequest();return r.idToken=n,Bp(t,r)}_getReauthenticationResolver(t){const n=this.buildRequest();return n.autoCreate=!1,Bp(t,n)}buildRequest(){const t={requestUri:ztt,returnSecureToken:!0};if(this.pendingToken)t.pendingToken=this.pendingToken;else{const n={};this.idToken&&(n.id_token=this.idToken),this.accessToken&&(n.access_token=this.accessToken),this.secret&&(n.oauth_token_secret=this.secret),n.providerId=this.providerId,this.nonce&&!this.pendingToken&&(n.nonce=this.nonce),t.postBody=tv(n)}return t}}/** * @license * Copyright 2020 Google LLC * @@ -3166,7 +3166,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class hue{constructor(t){this.providerId=t,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(t){this.defaultLanguageCode=t}setCustomParameters(t){return this.customParameters=t,this}getCustomParameters(){return this.customParameters}}/** + */class due{constructor(t){this.providerId=t,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(t){this.defaultLanguageCode=t}setCustomParameters(t){return this.customParameters=t,this}getCustomParameters(){return this.customParameters}}/** * @license * Copyright 2019 Google LLC * @@ -3181,7 +3181,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class vv extends hue{constructor(){super(...arguments),this.scopes=[]}addScope(t){return this.scopes.includes(t)||this.scopes.push(t),this}getScopes(){return[...this.scopes]}}/** + */class vv extends due{constructor(){super(...arguments),this.scopes=[]}addScope(t){return this.scopes.includes(t)||this.scopes.push(t),this}getScopes(){return[...this.scopes]}}/** * @license * Copyright 2020 Google LLC * @@ -3256,7 +3256,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */async function Htt(e,t){return Zae(e,"POST","/v1/accounts:signUp",Bx(e,t))}/** + */async function Htt(e,t){return Jae(e,"POST","/v1/accounts:signUp",Bx(e,t))}/** * @license * Copyright 2020 Google LLC * @@ -3301,7 +3301,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class lS extends Hu{constructor(t,n,r,i){var s;super(n.code,n.message),this.operationType=r,this.user=i,Object.setPrototypeOf(this,lS.prototype),this.customData={appName:t.name,tenantId:(s=t.tenantId)!==null&&s!==void 0?s:void 0,_serverResponse:n.customData._serverResponse,operationType:r}}static _fromErrorAndOperation(t,n,r,i){return new lS(t,n,r,i)}}function pue(e,t,n,r){return(t==="reauthenticate"?n._getReauthenticationResolver(e):n._getIdTokenResponse(e)).catch(s=>{throw s.code==="auth/multi-factor-auth-required"?lS._fromErrorAndOperation(e,s,t,r):s})}async function qtt(e,t,n=!1){const r=await h_(e,t._linkToIdToken(e.auth,await e.getIdToken()),n);return mf._forOperation(e,"link",r)}/** + */class lS extends Hu{constructor(t,n,r,i){var s;super(n.code,n.message),this.operationType=r,this.user=i,Object.setPrototypeOf(this,lS.prototype),this.customData={appName:t.name,tenantId:(s=t.tenantId)!==null&&s!==void 0?s:void 0,_serverResponse:n.customData._serverResponse,operationType:r}}static _fromErrorAndOperation(t,n,r,i){return new lS(t,n,r,i)}}function hue(e,t,n,r){return(t==="reauthenticate"?n._getReauthenticationResolver(e):n._getIdTokenResponse(e)).catch(s=>{throw s.code==="auth/multi-factor-auth-required"?lS._fromErrorAndOperation(e,s,t,r):s})}async function qtt(e,t,n=!1){const r=await h_(e,t._linkToIdToken(e.auth,await e.getIdToken()),n);return mf._forOperation(e,"link",r)}/** * @license * Copyright 2019 Google LLC * @@ -3316,7 +3316,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */async function Ytt(e,t,n=!1){const{auth:r}=e,i="reauthenticate";try{const s=await h_(e,pue(r,i,t,e),n);Ct(s.idToken,r,"internal-error");const o=iL(s.idToken);Ct(o,r,"internal-error");const{sub:a}=o;return Ct(e.uid===a,r,"user-mismatch"),mf._forOperation(e,i,s)}catch(s){throw(s==null?void 0:s.code)==="auth/user-not-found"&&Bl(r,"user-mismatch"),s}}/** + */async function Ytt(e,t,n=!1){const{auth:r}=e,i="reauthenticate";try{const s=await h_(e,hue(r,i,t,e),n);Ct(s.idToken,r,"internal-error");const o=iL(s.idToken);Ct(o,r,"internal-error");const{sub:a}=o;return Ct(e.uid===a,r,"user-mismatch"),mf._forOperation(e,i,s)}catch(s){throw(s==null?void 0:s.code)==="auth/user-not-found"&&Bl(r,"user-mismatch"),s}}/** * @license * Copyright 2020 Google LLC * @@ -3331,7 +3331,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */async function Gtt(e,t,n=!1){const r="signIn",i=await pue(e,r,t),s=await mf._fromIdTokenResponse(e,r,i);return n||await e._updateCurrentUser(s.user),s}function Ktt(e,t,n,r){return Zi(e).onIdTokenChanged(t,n,r)}function Qtt(e,t,n){return Zi(e).beforeAuthStateChanged(t,n)}const cS="__sak";/** + */async function Gtt(e,t,n=!1){const r="signIn",i=await hue(e,r,t),s=await mf._fromIdTokenResponse(e,r,i);return n||await e._updateCurrentUser(s.user),s}function Ktt(e,t,n,r){return Zi(e).onIdTokenChanged(t,n,r)}function Qtt(e,t,n){return Zi(e).beforeAuthStateChanged(t,n)}const cS="__sak";/** * @license * Copyright 2019 Google LLC * @@ -3346,7 +3346,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class mue{constructor(t,n){this.storageRetriever=t,this.type=n}_isAvailable(){try{return this.storage?(this.storage.setItem(cS,"1"),this.storage.removeItem(cS),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(t,n){return this.storage.setItem(t,JSON.stringify(n)),Promise.resolve()}_get(t){const n=this.storage.getItem(t);return Promise.resolve(n?JSON.parse(n):null)}_remove(t){return this.storage.removeItem(t),Promise.resolve()}get storage(){return this.storageRetriever()}}/** + */class pue{constructor(t,n){this.storageRetriever=t,this.type=n}_isAvailable(){try{return this.storage?(this.storage.setItem(cS,"1"),this.storage.removeItem(cS),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(t,n){return this.storage.setItem(t,JSON.stringify(n)),Promise.resolve()}_get(t){const n=this.storage.getItem(t);return Promise.resolve(n?JSON.parse(n):null)}_remove(t){return this.storage.removeItem(t),Promise.resolve()}get storage(){return this.storageRetriever()}}/** * @license * Copyright 2020 Google LLC * @@ -3361,7 +3361,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function Xtt(){const e=Ji();return sL(e)||jx(e)}const Jtt=1e3,Ztt=10;class gue extends mue{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(t,n)=>this.onStorageEvent(t,n),this.listeners={},this.localCache={},this.pollTimer=null,this.safariLocalStorageNotSynced=Xtt()&&Ott(),this.fallbackToPolling=lue(),this._shouldAllowMigration=!0}forAllChangedKeys(t){for(const n of Object.keys(this.listeners)){const r=this.storage.getItem(n),i=this.localCache[n];r!==i&&t(n,i,r)}}onStorageEvent(t,n=!1){if(!t.key){this.forAllChangedKeys((o,a,u)=>{this.notifyListeners(o,u)});return}const r=t.key;if(n?this.detachListener():this.stopPolling(),this.safariLocalStorageNotSynced){const o=this.storage.getItem(r);if(t.newValue!==o)t.newValue!==null?this.storage.setItem(r,t.newValue):this.storage.removeItem(r);else if(this.localCache[r]===t.newValue&&!n)return}const i=()=>{const o=this.storage.getItem(r);!n&&this.localCache[r]===o||this.notifyListeners(r,o)},s=this.storage.getItem(r);Att()&&s!==t.newValue&&t.newValue!==t.oldValue?setTimeout(i,Ztt):i()}notifyListeners(t,n){this.localCache[t]=n;const r=this.listeners[t];if(r)for(const i of Array.from(r))i(n&&JSON.parse(n))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((t,n,r)=>{this.onStorageEvent(new StorageEvent("storage",{key:t,oldValue:n,newValue:r}),!0)})},Jtt)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(t,n){Object.keys(this.listeners).length===0&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[t]||(this.listeners[t]=new Set,this.localCache[t]=this.storage.getItem(t)),this.listeners[t].add(n)}_removeListener(t,n){this.listeners[t]&&(this.listeners[t].delete(n),this.listeners[t].size===0&&delete this.listeners[t]),Object.keys(this.listeners).length===0&&(this.detachListener(),this.stopPolling())}async _set(t,n){await super._set(t,n),this.localCache[t]=JSON.stringify(n)}async _get(t){const n=await super._get(t);return this.localCache[t]=JSON.stringify(n),n}async _remove(t){await super._remove(t),delete this.localCache[t]}}gue.type="LOCAL";const ent=gue;/** + */function Xtt(){const e=Ji();return sL(e)||jx(e)}const Jtt=1e3,Ztt=10;class mue extends pue{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(t,n)=>this.onStorageEvent(t,n),this.listeners={},this.localCache={},this.pollTimer=null,this.safariLocalStorageNotSynced=Xtt()&&Ott(),this.fallbackToPolling=uue(),this._shouldAllowMigration=!0}forAllChangedKeys(t){for(const n of Object.keys(this.listeners)){const r=this.storage.getItem(n),i=this.localCache[n];r!==i&&t(n,i,r)}}onStorageEvent(t,n=!1){if(!t.key){this.forAllChangedKeys((o,a,u)=>{this.notifyListeners(o,u)});return}const r=t.key;if(n?this.detachListener():this.stopPolling(),this.safariLocalStorageNotSynced){const o=this.storage.getItem(r);if(t.newValue!==o)t.newValue!==null?this.storage.setItem(r,t.newValue):this.storage.removeItem(r);else if(this.localCache[r]===t.newValue&&!n)return}const i=()=>{const o=this.storage.getItem(r);!n&&this.localCache[r]===o||this.notifyListeners(r,o)},s=this.storage.getItem(r);Att()&&s!==t.newValue&&t.newValue!==t.oldValue?setTimeout(i,Ztt):i()}notifyListeners(t,n){this.localCache[t]=n;const r=this.listeners[t];if(r)for(const i of Array.from(r))i(n&&JSON.parse(n))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((t,n,r)=>{this.onStorageEvent(new StorageEvent("storage",{key:t,oldValue:n,newValue:r}),!0)})},Jtt)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(t,n){Object.keys(this.listeners).length===0&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[t]||(this.listeners[t]=new Set,this.localCache[t]=this.storage.getItem(t)),this.listeners[t].add(n)}_removeListener(t,n){this.listeners[t]&&(this.listeners[t].delete(n),this.listeners[t].size===0&&delete this.listeners[t]),Object.keys(this.listeners).length===0&&(this.detachListener(),this.stopPolling())}async _set(t,n){await super._set(t,n),this.localCache[t]=JSON.stringify(n)}async _get(t){const n=await super._get(t);return this.localCache[t]=JSON.stringify(n),n}async _remove(t){await super._remove(t),delete this.localCache[t]}}mue.type="LOCAL";const ent=mue;/** * @license * Copyright 2020 Google LLC * @@ -3376,7 +3376,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class yue extends mue{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(t,n){}_removeListener(t,n){}}yue.type="SESSION";const _ue=yue;/** + */class gue extends pue{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(t,n){}_removeListener(t,n){}}gue.type="SESSION";const yue=gue;/** * @license * Copyright 2019 Google LLC * @@ -3466,7 +3466,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function vue(){return typeof Cu().WorkerGlobalScope<"u"&&typeof Cu().importScripts=="function"}async function int(){if(!(navigator!=null&&navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function snt(){var e;return((e=navigator==null?void 0:navigator.serviceWorker)===null||e===void 0?void 0:e.controller)||null}function ont(){return vue()?self:null}/** + */function _ue(){return typeof Cu().WorkerGlobalScope<"u"&&typeof Cu().importScripts=="function"}async function int(){if(!(navigator!=null&&navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function snt(){var e;return((e=navigator==null?void 0:navigator.serviceWorker)===null||e===void 0?void 0:e.controller)||null}function ont(){return _ue()?self:null}/** * @license * Copyright 2019 Google LLC * @@ -3481,7 +3481,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const bue="firebaseLocalStorageDb",ant=1,fS="firebaseLocalStorage",Eue="fbase_key";class bv{constructor(t){this.request=t}toPromise(){return new Promise((t,n)=>{this.request.addEventListener("success",()=>{t(this.request.result)}),this.request.addEventListener("error",()=>{n(this.request.error)})})}}function zx(e,t){return e.transaction([fS],t?"readwrite":"readonly").objectStore(fS)}function unt(){const e=indexedDB.deleteDatabase(bue);return new bv(e).toPromise()}function JR(){const e=indexedDB.open(bue,ant);return new Promise((t,n)=>{e.addEventListener("error",()=>{n(e.error)}),e.addEventListener("upgradeneeded",()=>{const r=e.result;try{r.createObjectStore(fS,{keyPath:Eue})}catch(i){n(i)}}),e.addEventListener("success",async()=>{const r=e.result;r.objectStoreNames.contains(fS)?t(r):(r.close(),await unt(),t(await JR()))})})}async function D7(e,t,n){const r=zx(e,!0).put({[Eue]:t,value:n});return new bv(r).toPromise()}async function lnt(e,t){const n=zx(e,!1).get(t),r=await new bv(n).toPromise();return r===void 0?null:r.value}function $7(e,t){const n=zx(e,!0).delete(t);return new bv(n).toPromise()}const cnt=800,fnt=3;class wue{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){return this.db?this.db:(this.db=await JR(),this.db)}async _withRetries(t){let n=0;for(;;)try{const r=await this._openDb();return await t(r)}catch(r){if(n++>fnt)throw r;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return vue()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=Vx._getInstance(ont()),this.receiver._subscribe("keyChanged",async(t,n)=>({keyProcessed:(await this._poll()).includes(n.key)})),this.receiver._subscribe("ping",async(t,n)=>["keyChanged"])}async initializeSender(){var t,n;if(this.activeServiceWorker=await int(),!this.activeServiceWorker)return;this.sender=new nnt(this.activeServiceWorker);const r=await this.sender._send("ping",{},800);r&&!((t=r[0])===null||t===void 0)&&t.fulfilled&&!((n=r[0])===null||n===void 0)&&n.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(t){if(!(!this.sender||!this.activeServiceWorker||snt()!==this.activeServiceWorker))try{await this.sender._send("keyChanged",{key:t},this.serviceWorkerReceiverAvailable?800:50)}catch{}}async _isAvailable(){try{if(!indexedDB)return!1;const t=await JR();return await D7(t,cS,"1"),await $7(t,cS),!0}catch{}return!1}async _withPendingWrite(t){this.pendingWrites++;try{await t()}finally{this.pendingWrites--}}async _set(t,n){return this._withPendingWrite(async()=>(await this._withRetries(r=>D7(r,t,n)),this.localCache[t]=n,this.notifyServiceWorker(t)))}async _get(t){const n=await this._withRetries(r=>lnt(r,t));return this.localCache[t]=n,n}async _remove(t){return this._withPendingWrite(async()=>(await this._withRetries(n=>$7(n,t)),delete this.localCache[t],this.notifyServiceWorker(t)))}async _poll(){const t=await this._withRetries(i=>{const s=zx(i,!1).getAll();return new bv(s).toPromise()});if(!t)return[];if(this.pendingWrites!==0)return[];const n=[],r=new Set;for(const{fbase_key:i,value:s}of t)r.add(i),JSON.stringify(this.localCache[i])!==JSON.stringify(s)&&(this.notifyListeners(i,s),n.push(i));for(const i of Object.keys(this.localCache))this.localCache[i]&&!r.has(i)&&(this.notifyListeners(i,null),n.push(i));return n}notifyListeners(t,n){this.localCache[t]=n;const r=this.listeners[t];if(r)for(const i of Array.from(r))i(n)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),cnt)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(t,n){Object.keys(this.listeners).length===0&&this.startPolling(),this.listeners[t]||(this.listeners[t]=new Set,this._get(t)),this.listeners[t].add(n)}_removeListener(t,n){this.listeners[t]&&(this.listeners[t].delete(n),this.listeners[t].size===0&&delete this.listeners[t]),Object.keys(this.listeners).length===0&&this.stopPolling()}}wue.type="LOCAL";const dnt=wue;new _v(3e4,6e4);/** + */const vue="firebaseLocalStorageDb",ant=1,fS="firebaseLocalStorage",bue="fbase_key";class bv{constructor(t){this.request=t}toPromise(){return new Promise((t,n)=>{this.request.addEventListener("success",()=>{t(this.request.result)}),this.request.addEventListener("error",()=>{n(this.request.error)})})}}function zx(e,t){return e.transaction([fS],t?"readwrite":"readonly").objectStore(fS)}function unt(){const e=indexedDB.deleteDatabase(vue);return new bv(e).toPromise()}function JR(){const e=indexedDB.open(vue,ant);return new Promise((t,n)=>{e.addEventListener("error",()=>{n(e.error)}),e.addEventListener("upgradeneeded",()=>{const r=e.result;try{r.createObjectStore(fS,{keyPath:bue})}catch(i){n(i)}}),e.addEventListener("success",async()=>{const r=e.result;r.objectStoreNames.contains(fS)?t(r):(r.close(),await unt(),t(await JR()))})})}async function D7(e,t,n){const r=zx(e,!0).put({[bue]:t,value:n});return new bv(r).toPromise()}async function lnt(e,t){const n=zx(e,!1).get(t),r=await new bv(n).toPromise();return r===void 0?null:r.value}function $7(e,t){const n=zx(e,!0).delete(t);return new bv(n).toPromise()}const cnt=800,fnt=3;class Eue{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){return this.db?this.db:(this.db=await JR(),this.db)}async _withRetries(t){let n=0;for(;;)try{const r=await this._openDb();return await t(r)}catch(r){if(n++>fnt)throw r;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return _ue()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=Vx._getInstance(ont()),this.receiver._subscribe("keyChanged",async(t,n)=>({keyProcessed:(await this._poll()).includes(n.key)})),this.receiver._subscribe("ping",async(t,n)=>["keyChanged"])}async initializeSender(){var t,n;if(this.activeServiceWorker=await int(),!this.activeServiceWorker)return;this.sender=new nnt(this.activeServiceWorker);const r=await this.sender._send("ping",{},800);r&&!((t=r[0])===null||t===void 0)&&t.fulfilled&&!((n=r[0])===null||n===void 0)&&n.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(t){if(!(!this.sender||!this.activeServiceWorker||snt()!==this.activeServiceWorker))try{await this.sender._send("keyChanged",{key:t},this.serviceWorkerReceiverAvailable?800:50)}catch{}}async _isAvailable(){try{if(!indexedDB)return!1;const t=await JR();return await D7(t,cS,"1"),await $7(t,cS),!0}catch{}return!1}async _withPendingWrite(t){this.pendingWrites++;try{await t()}finally{this.pendingWrites--}}async _set(t,n){return this._withPendingWrite(async()=>(await this._withRetries(r=>D7(r,t,n)),this.localCache[t]=n,this.notifyServiceWorker(t)))}async _get(t){const n=await this._withRetries(r=>lnt(r,t));return this.localCache[t]=n,n}async _remove(t){return this._withPendingWrite(async()=>(await this._withRetries(n=>$7(n,t)),delete this.localCache[t],this.notifyServiceWorker(t)))}async _poll(){const t=await this._withRetries(i=>{const s=zx(i,!1).getAll();return new bv(s).toPromise()});if(!t)return[];if(this.pendingWrites!==0)return[];const n=[],r=new Set;for(const{fbase_key:i,value:s}of t)r.add(i),JSON.stringify(this.localCache[i])!==JSON.stringify(s)&&(this.notifyListeners(i,s),n.push(i));for(const i of Object.keys(this.localCache))this.localCache[i]&&!r.has(i)&&(this.notifyListeners(i,null),n.push(i));return n}notifyListeners(t,n){this.localCache[t]=n;const r=this.listeners[t];if(r)for(const i of Array.from(r))i(n)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),cnt)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(t,n){Object.keys(this.listeners).length===0&&this.startPolling(),this.listeners[t]||(this.listeners[t]=new Set,this._get(t)),this.listeners[t].add(n)}_removeListener(t,n){this.listeners[t]&&(this.listeners[t].delete(n),this.listeners[t].size===0&&delete this.listeners[t]),Object.keys(this.listeners).length===0&&this.stopPolling()}}Eue.type="LOCAL";const dnt=Eue;new _v(3e4,6e4);/** * @license * Copyright 2021 Google LLC * @@ -3511,7 +3511,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class aL extends due{constructor(t){super("custom","custom"),this.params=t}_getIdTokenResponse(t){return Bp(t,this._buildIdpRequest())}_linkToIdToken(t,n){return Bp(t,this._buildIdpRequest(n))}_getReauthenticationResolver(t){return Bp(t,this._buildIdpRequest())}_buildIdpRequest(t){const n={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return t&&(n.idToken=t),n}}function pnt(e){return Gtt(e.auth,new aL(e),e.bypassAuthState)}function mnt(e){const{auth:t,user:n}=e;return Ct(n,t,"internal-error"),Ytt(n,new aL(e),e.bypassAuthState)}async function gnt(e){const{auth:t,user:n}=e;return Ct(n,t,"internal-error"),qtt(n,new aL(e),e.bypassAuthState)}/** + */class aL extends fue{constructor(t){super("custom","custom"),this.params=t}_getIdTokenResponse(t){return Bp(t,this._buildIdpRequest())}_linkToIdToken(t,n){return Bp(t,this._buildIdpRequest(n))}_getReauthenticationResolver(t){return Bp(t,this._buildIdpRequest())}_buildIdpRequest(t){const n={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return t&&(n.idToken=t),n}}function pnt(e){return Gtt(e.auth,new aL(e),e.bypassAuthState)}function mnt(e){const{auth:t,user:n}=e;return Ct(n,t,"internal-error"),Ytt(n,new aL(e),e.bypassAuthState)}async function gnt(e){const{auth:t,user:n}=e;return Ct(n,t,"internal-error"),qtt(n,new aL(e),e.bypassAuthState)}/** * @license * Copyright 2020 Google LLC * @@ -3526,7 +3526,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class Tue{constructor(t,n,r,i,s=!1){this.auth=t,this.resolver=r,this.user=i,this.bypassAuthState=s,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(n)?n:[n]}execute(){return new Promise(async(t,n)=>{this.pendingPromise={resolve:t,reject:n};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(r){this.reject(r)}})}async onAuthEvent(t){const{urlResponse:n,sessionId:r,postBody:i,tenantId:s,error:o,type:a}=t;if(o){this.reject(o);return}const u={auth:this.auth,requestUri:n,sessionId:r,tenantId:s||void 0,postBody:i||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(a)(u))}catch(l){this.reject(l)}}onError(t){this.reject(t)}getIdpTask(t){switch(t){case"signInViaPopup":case"signInViaRedirect":return pnt;case"linkViaPopup":case"linkViaRedirect":return gnt;case"reauthViaPopup":case"reauthViaRedirect":return mnt;default:Bl(this.auth,"internal-error")}}resolve(t){jl(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(t),this.unregisterAndCleanUp()}reject(t){jl(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(t),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}/** + */class wue{constructor(t,n,r,i,s=!1){this.auth=t,this.resolver=r,this.user=i,this.bypassAuthState=s,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(n)?n:[n]}execute(){return new Promise(async(t,n)=>{this.pendingPromise={resolve:t,reject:n};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(r){this.reject(r)}})}async onAuthEvent(t){const{urlResponse:n,sessionId:r,postBody:i,tenantId:s,error:o,type:a}=t;if(o){this.reject(o);return}const u={auth:this.auth,requestUri:n,sessionId:r,tenantId:s||void 0,postBody:i||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(a)(u))}catch(l){this.reject(l)}}onError(t){this.reject(t)}getIdpTask(t){switch(t){case"signInViaPopup":case"signInViaRedirect":return pnt;case"linkViaPopup":case"linkViaRedirect":return gnt;case"reauthViaPopup":case"reauthViaRedirect":return mnt;default:Bl(this.auth,"internal-error")}}resolve(t){jl(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(t),this.unregisterAndCleanUp()}reject(t){jl(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(t),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}/** * @license * Copyright 2020 Google LLC * @@ -3541,7 +3541,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const ynt=new _v(2e3,1e4);class up extends Tue{constructor(t,n,r,i,s){super(t,n,i,s),this.provider=r,this.authWindow=null,this.pollId=null,up.currentPopupAction&&up.currentPopupAction.cancel(),up.currentPopupAction=this}async executeNotNull(){const t=await this.execute();return Ct(t,this.auth,"internal-error"),t}async onExecution(){jl(this.filter.length===1,"Popup operations only handle one event");const t=oL();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],t),this.authWindow.associatedEvent=t,this.resolver._originValidation(this.auth).catch(n=>{this.reject(n)}),this.resolver._isIframeWebStorageSupported(this.auth,n=>{n||this.reject(xu(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var t;return((t=this.authWindow)===null||t===void 0?void 0:t.associatedEvent)||null}cancel(){this.reject(xu(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,up.currentPopupAction=null}pollUserCancellation(){const t=()=>{var n,r;if(!((r=(n=this.authWindow)===null||n===void 0?void 0:n.window)===null||r===void 0)&&r.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(xu(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(t,ynt.get())};t()}}up.currentPopupAction=null;/** + */const ynt=new _v(2e3,1e4);class up extends wue{constructor(t,n,r,i,s){super(t,n,i,s),this.provider=r,this.authWindow=null,this.pollId=null,up.currentPopupAction&&up.currentPopupAction.cancel(),up.currentPopupAction=this}async executeNotNull(){const t=await this.execute();return Ct(t,this.auth,"internal-error"),t}async onExecution(){jl(this.filter.length===1,"Popup operations only handle one event");const t=oL();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],t),this.authWindow.associatedEvent=t,this.resolver._originValidation(this.auth).catch(n=>{this.reject(n)}),this.resolver._isIframeWebStorageSupported(this.auth,n=>{n||this.reject(xu(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var t;return((t=this.authWindow)===null||t===void 0?void 0:t.associatedEvent)||null}cancel(){this.reject(xu(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,up.currentPopupAction=null}pollUserCancellation(){const t=()=>{var n,r;if(!((r=(n=this.authWindow)===null||n===void 0?void 0:n.window)===null||r===void 0)&&r.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(xu(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(t,ynt.get())};t()}}up.currentPopupAction=null;/** * @license * Copyright 2020 Google LLC * @@ -3556,7 +3556,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const _nt="pendingRedirect",Ab=new Map;class vnt extends Tue{constructor(t,n,r=!1){super(t,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],n,void 0,r),this.eventId=null}async execute(){let t=Ab.get(this.auth._key());if(!t){try{const r=await bnt(this.resolver,this.auth)?await super.execute():null;t=()=>Promise.resolve(r)}catch(n){t=()=>Promise.reject(n)}Ab.set(this.auth._key(),t)}return this.bypassAuthState||Ab.set(this.auth._key(),()=>Promise.resolve(null)),t()}async onAuthEvent(t){if(t.type==="signInViaRedirect")return super.onAuthEvent(t);if(t.type==="unknown"){this.resolve(null);return}if(t.eventId){const n=await this.auth._redirectUserForId(t.eventId);if(n)return this.user=n,super.onAuthEvent(t);this.resolve(null)}}async onExecution(){}cleanUp(){}}async function bnt(e,t){const n=Tnt(t),r=wnt(e);if(!await r._isAvailable())return!1;const i=await r._get(n)==="true";return await r._remove(n),i}function Ent(e,t){Ab.set(e._key(),t)}function wnt(e){return cl(e._redirectPersistence)}function Tnt(e){return Cb(_nt,e.config.apiKey,e.name)}async function Snt(e,t,n=!1){const r=Ux(e),i=hnt(r,t),o=await new vnt(r,i,n).execute();return o&&!n&&(delete o.user._redirectEventId,await r._persistUserIfCurrent(o.user),await r._setRedirectUser(null,t)),o}/** + */const _nt="pendingRedirect",Ab=new Map;class vnt extends wue{constructor(t,n,r=!1){super(t,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],n,void 0,r),this.eventId=null}async execute(){let t=Ab.get(this.auth._key());if(!t){try{const r=await bnt(this.resolver,this.auth)?await super.execute():null;t=()=>Promise.resolve(r)}catch(n){t=()=>Promise.reject(n)}Ab.set(this.auth._key(),t)}return this.bypassAuthState||Ab.set(this.auth._key(),()=>Promise.resolve(null)),t()}async onAuthEvent(t){if(t.type==="signInViaRedirect")return super.onAuthEvent(t);if(t.type==="unknown"){this.resolve(null);return}if(t.eventId){const n=await this.auth._redirectUserForId(t.eventId);if(n)return this.user=n,super.onAuthEvent(t);this.resolve(null)}}async onExecution(){}cleanUp(){}}async function bnt(e,t){const n=Tnt(t),r=wnt(e);if(!await r._isAvailable())return!1;const i=await r._get(n)==="true";return await r._remove(n),i}function Ent(e,t){Ab.set(e._key(),t)}function wnt(e){return cl(e._redirectPersistence)}function Tnt(e){return Cb(_nt,e.config.apiKey,e.name)}async function Snt(e,t,n=!1){const r=Ux(e),i=hnt(r,t),o=await new vnt(r,i,n).execute();return o&&!n&&(delete o.user._redirectEventId,await r._persistUserIfCurrent(o.user),await r._setRedirectUser(null,t)),o}/** * @license * Copyright 2020 Google LLC * @@ -3571,7 +3571,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const Int=10*60*1e3;class xnt{constructor(t){this.auth=t,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(t){this.consumers.add(t),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,t)&&(this.sendToConsumer(this.queuedRedirectEvent,t),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(t){this.consumers.delete(t)}onEvent(t){if(this.hasEventBeenHandled(t))return!1;let n=!1;return this.consumers.forEach(r=>{this.isEventForConsumer(t,r)&&(n=!0,this.sendToConsumer(t,r),this.saveEventToCache(t))}),this.hasHandledPotentialRedirect||!Cnt(t)||(this.hasHandledPotentialRedirect=!0,n||(this.queuedRedirectEvent=t,n=!0)),n}sendToConsumer(t,n){var r;if(t.error&&!Sue(t)){const i=((r=t.error.code)===null||r===void 0?void 0:r.split("auth/")[1])||"internal-error";n.onError(xu(this.auth,i))}else n.onAuthEvent(t)}isEventForConsumer(t,n){const r=n.eventId===null||!!t.eventId&&t.eventId===n.eventId;return n.filter.includes(t.type)&&r}hasEventBeenHandled(t){return Date.now()-this.lastProcessedEventTime>=Int&&this.cachedEventUids.clear(),this.cachedEventUids.has(L7(t))}saveEventToCache(t){this.cachedEventUids.add(L7(t)),this.lastProcessedEventTime=Date.now()}}function L7(e){return[e.type,e.eventId,e.sessionId,e.tenantId].filter(t=>t).join("-")}function Sue({type:e,error:t}){return e==="unknown"&&(t==null?void 0:t.code)==="auth/no-auth-event"}function Cnt(e){switch(e.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return Sue(e);default:return!1}}/** + */const Int=10*60*1e3;class xnt{constructor(t){this.auth=t,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(t){this.consumers.add(t),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,t)&&(this.sendToConsumer(this.queuedRedirectEvent,t),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(t){this.consumers.delete(t)}onEvent(t){if(this.hasEventBeenHandled(t))return!1;let n=!1;return this.consumers.forEach(r=>{this.isEventForConsumer(t,r)&&(n=!0,this.sendToConsumer(t,r),this.saveEventToCache(t))}),this.hasHandledPotentialRedirect||!Cnt(t)||(this.hasHandledPotentialRedirect=!0,n||(this.queuedRedirectEvent=t,n=!0)),n}sendToConsumer(t,n){var r;if(t.error&&!Tue(t)){const i=((r=t.error.code)===null||r===void 0?void 0:r.split("auth/")[1])||"internal-error";n.onError(xu(this.auth,i))}else n.onAuthEvent(t)}isEventForConsumer(t,n){const r=n.eventId===null||!!t.eventId&&t.eventId===n.eventId;return n.filter.includes(t.type)&&r}hasEventBeenHandled(t){return Date.now()-this.lastProcessedEventTime>=Int&&this.cachedEventUids.clear(),this.cachedEventUids.has(L7(t))}saveEventToCache(t){this.cachedEventUids.add(L7(t)),this.lastProcessedEventTime=Date.now()}}function L7(e){return[e.type,e.eventId,e.sessionId,e.tenantId].filter(t=>t).join("-")}function Tue({type:e,error:t}){return e==="unknown"&&(t==null?void 0:t.code)==="auth/no-auth-event"}function Cnt(e){switch(e.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return Tue(e);default:return!1}}/** * @license * Copyright 2020 Google LLC * @@ -3646,7 +3646,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const znt={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},Hnt=500,Wnt=600,qnt="_blank",Ynt="http://localhost";class F7{constructor(t){this.window=t,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function Gnt(e,t,n,r=Hnt,i=Wnt){const s=Math.max((window.screen.availHeight-i)/2,0).toString(),o=Math.max((window.screen.availWidth-r)/2,0).toString();let a="";const u=Object.assign(Object.assign({},znt),{width:r.toString(),height:i.toString(),top:s,left:o}),l=Ji().toLowerCase();n&&(a=iue(l)?qnt:n),rue(l)&&(t=t||Ynt,u.scrollbars="yes");const c=Object.entries(u).reduce((d,[h,p])=>`${d}${h}=${p},`,"");if(Ctt(l)&&a!=="_self")return Knt(t||"",a),new F7(null);const f=window.open(t||"",a,c);Ct(f,e,"popup-blocked");try{f.focus()}catch{}return new F7(f)}function Knt(e,t){const n=document.createElement("a");n.href=e,n.target=t;const r=document.createEvent("MouseEvent");r.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),n.dispatchEvent(r)}/** + */const znt={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},Hnt=500,Wnt=600,qnt="_blank",Ynt="http://localhost";class F7{constructor(t){this.window=t,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function Gnt(e,t,n,r=Hnt,i=Wnt){const s=Math.max((window.screen.availHeight-i)/2,0).toString(),o=Math.max((window.screen.availWidth-r)/2,0).toString();let a="";const u=Object.assign(Object.assign({},znt),{width:r.toString(),height:i.toString(),top:s,left:o}),l=Ji().toLowerCase();n&&(a=rue(l)?qnt:n),nue(l)&&(t=t||Ynt,u.scrollbars="yes");const c=Object.entries(u).reduce((d,[h,p])=>`${d}${h}=${p},`,"");if(Ctt(l)&&a!=="_self")return Knt(t||"",a),new F7(null);const f=window.open(t||"",a,c);Ct(f,e,"popup-blocked");try{f.focus()}catch{}return new F7(f)}function Knt(e,t){const n=document.createElement("a");n.href=e,n.target=t;const r=document.createEvent("MouseEvent");r.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),n.dispatchEvent(r)}/** * @license * Copyright 2021 Google LLC * @@ -3661,7 +3661,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const Qnt="__/auth/handler",Xnt="emulator/auth/handler",Jnt=encodeURIComponent("fac");async function B7(e,t,n,r,i,s){Ct(e.config.authDomain,e,"auth-domain-config-required"),Ct(e.config.apiKey,e,"invalid-api-key");const o={apiKey:e.config.apiKey,appName:e.name,authType:n,redirectUrl:r,v:ch,eventId:i};if(t instanceof hue){t.setDefaultLanguage(e.languageCode),o.providerId=t.providerId||"",LYe(t.getCustomParameters())||(o.customParameters=JSON.stringify(t.getCustomParameters()));for(const[c,f]of Object.entries(s||{}))o[c]=f}if(t instanceof vv){const c=t.getScopes().filter(f=>f!=="");c.length>0&&(o.scopes=c.join(","))}e.tenantId&&(o.tid=e.tenantId);const a=o;for(const c of Object.keys(a))a[c]===void 0&&delete a[c];const u=await e._getAppCheckToken(),l=u?`#${Jnt}=${encodeURIComponent(u)}`:"";return`${Znt(e)}?${tv(a).slice(1)}${l}`}function Znt({config:e}){return e.emulator?rL(e,Xnt):`https://${e.authDomain}/${Qnt}`}/** + */const Qnt="__/auth/handler",Xnt="emulator/auth/handler",Jnt=encodeURIComponent("fac");async function B7(e,t,n,r,i,s){Ct(e.config.authDomain,e,"auth-domain-config-required"),Ct(e.config.apiKey,e,"invalid-api-key");const o={apiKey:e.config.apiKey,appName:e.name,authType:n,redirectUrl:r,v:ch,eventId:i};if(t instanceof due){t.setDefaultLanguage(e.languageCode),o.providerId=t.providerId||"",LYe(t.getCustomParameters())||(o.customParameters=JSON.stringify(t.getCustomParameters()));for(const[c,f]of Object.entries(s||{}))o[c]=f}if(t instanceof vv){const c=t.getScopes().filter(f=>f!=="");c.length>0&&(o.scopes=c.join(","))}e.tenantId&&(o.tid=e.tenantId);const a=o;for(const c of Object.keys(a))a[c]===void 0&&delete a[c];const u=await e._getAppCheckToken(),l=u?`#${Jnt}=${encodeURIComponent(u)}`:"";return`${Znt(e)}?${tv(a).slice(1)}${l}`}function Znt({config:e}){return e.emulator?rL(e,Xnt):`https://${e.authDomain}/${Qnt}`}/** * @license * Copyright 2020 Google LLC * @@ -3676,7 +3676,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const OO="webStorageSupport";class ert{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=_ue,this._completeRedirectFn=Snt,this._overrideRedirectResult=Ent}async _openPopup(t,n,r,i){var s;jl((s=this.eventManagers[t._key()])===null||s===void 0?void 0:s.manager,"_initialize() not called before _openPopup()");const o=await B7(t,n,r,XR(),i);return Gnt(t,o,oL())}async _openRedirect(t,n,r,i){await this._originValidation(t);const s=await B7(t,n,r,XR(),i);return rnt(s),new Promise(()=>{})}_initialize(t){const n=t._key();if(this.eventManagers[n]){const{manager:i,promise:s}=this.eventManagers[n];return i?Promise.resolve(i):(jl(s,"If manager is not set, promise should be"),s)}const r=this.initAndGetManager(t);return this.eventManagers[n]={promise:r},r.catch(()=>{delete this.eventManagers[n]}),r}async initAndGetManager(t){const n=await Vnt(t),r=new xnt(t);return n.register("authEvent",i=>(Ct(i==null?void 0:i.authEvent,t,"invalid-auth-event"),{status:r.onEvent(i.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[t._key()]={manager:r},this.iframes[t._key()]=n,r}_isIframeWebStorageSupported(t,n){this.iframes[t._key()].send(OO,{type:OO},i=>{var s;const o=(s=i==null?void 0:i[0])===null||s===void 0?void 0:s[OO];o!==void 0&&n(!!o),Bl(t,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(t){const n=t._key();return this.originValidationPromises[n]||(this.originValidationPromises[n]=Rnt(t)),this.originValidationPromises[n]}get _shouldInitProactively(){return lue()||sL()||jx()}}const trt=ert;var j7="@firebase/auth",U7="1.5.0";/** + */const OO="webStorageSupport";class ert{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=yue,this._completeRedirectFn=Snt,this._overrideRedirectResult=Ent}async _openPopup(t,n,r,i){var s;jl((s=this.eventManagers[t._key()])===null||s===void 0?void 0:s.manager,"_initialize() not called before _openPopup()");const o=await B7(t,n,r,XR(),i);return Gnt(t,o,oL())}async _openRedirect(t,n,r,i){await this._originValidation(t);const s=await B7(t,n,r,XR(),i);return rnt(s),new Promise(()=>{})}_initialize(t){const n=t._key();if(this.eventManagers[n]){const{manager:i,promise:s}=this.eventManagers[n];return i?Promise.resolve(i):(jl(s,"If manager is not set, promise should be"),s)}const r=this.initAndGetManager(t);return this.eventManagers[n]={promise:r},r.catch(()=>{delete this.eventManagers[n]}),r}async initAndGetManager(t){const n=await Vnt(t),r=new xnt(t);return n.register("authEvent",i=>(Ct(i==null?void 0:i.authEvent,t,"invalid-auth-event"),{status:r.onEvent(i.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[t._key()]={manager:r},this.iframes[t._key()]=n,r}_isIframeWebStorageSupported(t,n){this.iframes[t._key()].send(OO,{type:OO},i=>{var s;const o=(s=i==null?void 0:i[0])===null||s===void 0?void 0:s[OO];o!==void 0&&n(!!o),Bl(t,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(t){const n=t._key();return this.originValidationPromises[n]||(this.originValidationPromises[n]=Rnt(t)),this.originValidationPromises[n]}get _shouldInitProactively(){return uue()||sL()||jx()}}const trt=ert;var j7="@firebase/auth",U7="1.5.0";/** * @license * Copyright 2020 Google LLC * @@ -3706,7 +3706,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function rrt(e){switch(e){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";default:return}}function irt(e){$l(new $u("auth",(t,{options:n})=>{const r=t.getProvider("app").getImmediate(),i=t.getProvider("heartbeat"),s=t.getProvider("app-check-internal"),{apiKey:o,authDomain:a}=r.options;Ct(o&&!o.includes(":"),"invalid-api-key",{appName:r.name});const u={apiKey:o,authDomain:a,clientPlatform:e,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:cue(e)},l=new Dtt(r,i,s,u);return Btt(l,n),l},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((t,n,r)=>{t.getProvider("auth-internal").initialize()})),$l(new $u("auth-internal",t=>{const n=Ux(t.getProvider("auth").getImmediate());return(r=>new nrt(r))(n)},"PRIVATE").setInstantiationMode("EXPLICIT")),Ca(j7,U7,rrt(e)),Ca(j7,U7,"esm2017")}/** + */function rrt(e){switch(e){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";default:return}}function irt(e){$l(new $u("auth",(t,{options:n})=>{const r=t.getProvider("app").getImmediate(),i=t.getProvider("heartbeat"),s=t.getProvider("app-check-internal"),{apiKey:o,authDomain:a}=r.options;Ct(o&&!o.includes(":"),"invalid-api-key",{appName:r.name});const u={apiKey:o,authDomain:a,clientPlatform:e,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:lue(e)},l=new Dtt(r,i,s,u);return Btt(l,n),l},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((t,n,r)=>{t.getProvider("auth-internal").initialize()})),$l(new $u("auth-internal",t=>{const n=Ux(t.getProvider("auth").getImmediate());return(r=>new nrt(r))(n)},"PRIVATE").setInstantiationMode("EXPLICIT")),Ca(j7,U7,rrt(e)),Ca(j7,U7,"esm2017")}/** * @license * Copyright 2021 Google LLC * @@ -3721,7 +3721,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const srt=5*60,ort=Kie("authIdTokenMaxAge")||srt;let V7=null;const art=e=>async t=>{const n=t&&await t.getIdTokenResult(),r=n&&(new Date().getTime()-Date.parse(n.issuedAtTime))/1e3;if(r&&r>ort)return;const i=n==null?void 0:n.token;V7!==i&&(V7=i,await fetch(e,{method:i?"POST":"DELETE",headers:i?{Authorization:`Bearer ${i}`}:{}}))};function urt(e=Q3()){const t=ig(e,"auth");if(t.isInitialized())return t.getImmediate();const n=Ftt(e,{popupRedirectResolver:trt,persistence:[dnt,ent,_ue]}),r=Kie("authTokenSyncURL");if(r){const s=art(r);Qtt(n,s,()=>s(n.currentUser)),Ktt(n,o=>s(o))}const i=Yie("auth");return i&&jtt(n,`http://${i}`),n}irt("Browser");class lrt extends zie{constructor(){super("firebase");Gs(this,"RECAPTCHAV3TOKEN","6Ldz_WQpAAAAAITx1qzoXnBDQMP8Zpub5MVyMl0k");Gs(this,"firestore");Gs(this,"collectionPrefix","prod-");Gs(this,"studyCollection");Gs(this,"studyId","");Gs(this,"localForage",Vie.createInstance({name:"currentParticipantId"}));Gs(this,"localProvenanceCopy",{});Gs(this,"localWindowEvents",{});const n=Fk.parse(` + */const srt=5*60,ort=Gie("authIdTokenMaxAge")||srt;let V7=null;const art=e=>async t=>{const n=t&&await t.getIdTokenResult(),r=n&&(new Date().getTime()-Date.parse(n.issuedAtTime))/1e3;if(r&&r>ort)return;const i=n==null?void 0:n.token;V7!==i&&(V7=i,await fetch(e,{method:i?"POST":"DELETE",headers:i?{Authorization:`Bearer ${i}`}:{}}))};function urt(e=Q3()){const t=ig(e,"auth");if(t.isInitialized())return t.getImmediate();const n=Ftt(e,{popupRedirectResolver:trt,persistence:[dnt,ent,yue]}),r=Gie("authTokenSyncURL");if(r){const s=art(r);Qtt(n,s,()=>s(n.currentUser)),Ktt(n,o=>s(o))}const i=qie("auth");return i&&jtt(n,`http://${i}`),n}irt("Browser");class lrt extends Vie{constructor(){super("firebase");Gs(this,"RECAPTCHAV3TOKEN","6Ldz_WQpAAAAAITx1qzoXnBDQMP8Zpub5MVyMl0k");Gs(this,"firestore");Gs(this,"collectionPrefix","prod-");Gs(this,"studyCollection");Gs(this,"studyId","");Gs(this,"localForage",Uie.createInstance({name:"currentParticipantId"}));Gs(this,"localProvenanceCopy",{});Gs(this,"localWindowEvents",{});const n=Fk.parse(` { apiKey: "AIzaSyBWe6l3RbrOhakYL3k4vVId26UCKVIOX0U", authDomain: "viz-guardrails.firebaseapp.com", @@ -3731,4 +3731,4 @@ This typically indicates that your device does not have a healthy Internet conne appId: "1:975745336400:web:e7607abb512ff88d36bd55", measurementId: "G-6KWR7L44G0" } -`),r=Jie(n);this.firestore=tet(r,{});try{rtt(r,{provider:new tL(this.RECAPTCHAV3TOKEN),isTokenAutoRefreshEnabled:!1})}catch{console.warn("Failed to initialize Firebase App Check")}}async connect(){try{const n=urt();if(await Wtt(n),!n.currentUser)throw new Error("Login failed with firebase");await net(this.firestore);const r=await Ba(this.firestore,".info/connected");await Qg(r),this.connected=!0}catch{console.warn("Failed to connect to Firebase")}}async initializeStudyDb(n,r){const i=await Dp(JSON.stringify(r));this.studyCollection=b7(this.firestore,`${this.collectionPrefix}${n}`),this.studyId=n;const s=Ba(this.studyCollection,"configs"),o=b7(s,"configs"),a=Ba(o,i);return await Xg(a,r)}async initializeParticipantSession(n,r,i){if(!this._verifyStudyDatabase(this.studyCollection))throw new Error("Study database not initialized");if(await this.getCurrentParticipantId(i),!this.currentParticipantId)throw new Error("Participant not initialized");const s=Ba(this.studyCollection,this.currentParticipantId),o=(await Qg(s)).data();if(this.localProvenanceCopy=await this._getFromFirebaseStorage(this.currentParticipantId,"provenance"),this.localWindowEvents=await this._getFromFirebaseStorage(this.currentParticipantId,"windowEvents"),Object.entries(this.localWindowEvents).forEach(([l,c])=>{o!==null&&(c===void 0||c.length===0?o.answers[l].windowEvents=[]:o.answers[l].windowEvents=c)}),o)return o;const a=await Dp(JSON.stringify(r)),u={participantId:this.currentParticipantId,participantConfigHash:a,sequence:await this.getSequence(),answers:{},searchParams:n};return await Xg(s,u),u}async getCurrentParticipantId(n){const r=await this.localForage.getItem("currentParticipantId");if(n)return this.currentParticipantId=n,await this.localForage.setItem("currentParticipantId",n),n;if(r)return this.currentParticipantId=r,r;if(!this._verifyStudyDatabase(this.studyCollection))throw new Error("Study database not initialized");const i=Ba(this.studyCollection);return this.currentParticipantId=i.id,await this.localForage.setItem("currentParticipantId",this.currentParticipantId),this.currentParticipantId}async clearCurrentParticipantId(){return await this.localForage.removeItem("currentParticipantId")}async saveAnswer(n,r){if(!this._verifyStudyDatabase(this.studyCollection))throw new Error("Study database not initialized");if(!this.currentParticipantId)throw new Error("Participant not initialized");const i=Ba(this.studyCollection,this.currentParticipantId),s={answer:r.answer,startTime:r.startTime,endTime:r.endTime};await Xg(i,{answers:{[n]:s}},{merge:!0}),r.provenanceGraph&&(this.localProvenanceCopy[n]=r.provenanceGraph,await this._pushToFirebaseStorage("provenance")),this.localWindowEvents[n]=r.windowEvents,await this._pushToFirebaseStorage("windowEvents")}async setSequenceArray(n){if(!this._verifyStudyDatabase(this.studyCollection))throw new Error("Study database not initialized");const r=n.map(o=>o.join(",")),i=Ba(this.studyCollection,"sequenceArray");return await Xg(i,{sequenceArray:r})}async getSequenceArray(){if(!this._verifyStudyDatabase(this.studyCollection))throw new Error("Study database not initialized");const n=Ba(this.studyCollection,"sequenceArray"),r=(await Qg(n)).data();return r===void 0?null:r.sequenceArray.map(i=>i.split(","))}async getSequence(){if(!this._verifyStudyDatabase(this.studyCollection))throw new Error("Study database not initialized");const n=await this.getSequenceArray();if(!n)throw new Error("Latin square not initialized");const r=n.pop();if(!r)throw new Error("Latin square is empty");return await this.setSequenceArray(n),r}async getAllParticipantsData(){if(!this._verifyStudyDatabase(this.studyCollection))throw new Error("Study database not initialized");const n=await _et(this.studyCollection),r=[],i=n.docs.map(async s=>{if(s.id==="config"||s.id==="sequenceArray")return;const o=s.data(),a=await this._getFromFirebaseStorage(o.participantId,"provenance"),u=await this._getFromFirebaseStorage(o.participantId,"windowEvents");o.answers=Object.fromEntries(Object.entries(o.answers).map(([l,c])=>{if(c===void 0)return[l,c];const f=a[l],d=u[l];return[l,{...c,provenanceGraph:f,windowEvents:d}]})),r.push(o)});return await Promise.all(i),r}async getParticipantData(){if(!this._verifyStudyDatabase(this.studyCollection))throw new Error("Study database not initialized");await this.getCurrentParticipantId();let n=null;if(this.currentParticipantId!==null){const r=Ba(this.studyCollection,this.currentParticipantId);if(n=(await Qg(r)).data(),n!==null){const i=await this._getFromFirebaseStorage(this.currentParticipantId,"provenance"),s=await this._getFromFirebaseStorage(this.currentParticipantId,"windowEvents");Object.entries(n.answers).forEach(([o,a])=>{a!==void 0&&(a.provenanceGraph=i[o],a.windowEvents=s[o])})}}return n}async nextParticipant(n){if(!this._verifyStudyDatabase(this.studyCollection))throw new Error("Study database not initialized");const r=Ba(this.studyCollection),i=r.id;await this.localForage.setItem("currentParticipantId",i),this.currentParticipantId=i;let s=null;if(this.currentParticipantId!==null&&(s=(await Qg(r)).data()),!s){const o=await Dp(JSON.stringify(n)),a={participantId:i,participantConfigHash:o,sequence:await this.getSequence(),answers:{},searchParams:{}};await Xg(r,a),s=a}return s}async verifyCompletion(){if(!this._verifyStudyDatabase(this.studyCollection))throw new Error("Study database not initialized");const n=await this.getParticipantData();if(!n)throw new Error("Participant not initialized");return n.sequence.every(i=>i==="end"?!0:n.answers[i]!==void 0)}_verifyStudyDatabase(n){return n!==void 0}async _getFromFirebaseStorage(n,r){const i=xV(),s=IV(i,`${this.studyId}/${n}_${r}`);let o={};try{const a=await aQe(s),l=await(await fetch(a)).text();o=JSON.parse(l)}catch{console.warn(`Participant ${n} does not have ${r} for ${this.studyId}.`)}return o}async _pushToFirebaseStorage(n){const r=n==="provenance"?this.localProvenanceCopy:this.localWindowEvents;if(Object.keys(r).length>0){const i=xV(),s=IV(i,`${this.studyId}/${this.currentParticipantId}_${n}`),o=new Blob([JSON.stringify(r)],{type:"application/json"});await oQe(s,o)}}}async function crt(){let e,t=!1;{const n=new lrt;await n.connect(),n.isConnected()?e=n:t=!0}if(t){const n=new vYe;await n.connect(),e=n}return e}function frt(){const{storageEngine:e,setStorageEngine:t}=vf();return w.useEffect(()=>{if(e!==void 0)return;async function n(){const r=await crt();t(r)}n()},[t,e]),$.jsx(hYe,{})}PO.createRoot(document.getElementById("root")).render($.jsx(k.StrictMode,{children:$.jsx(sfe,{children:$.jsx(frt,{})})})); +`),r=Xie(n);this.firestore=tet(r,{});try{rtt(r,{provider:new tL(this.RECAPTCHAV3TOKEN),isTokenAutoRefreshEnabled:!1})}catch{console.warn("Failed to initialize Firebase App Check")}}async connect(){try{const n=urt();if(await Wtt(n),!n.currentUser)throw new Error("Login failed with firebase");await net(this.firestore);const r=await Ba(this.firestore,".info/connected");await Qg(r),this.connected=!0}catch{console.warn("Failed to connect to Firebase")}}async initializeStudyDb(n,r){const i=await Dp(JSON.stringify(r));this.studyCollection=b7(this.firestore,`${this.collectionPrefix}${n}`),this.studyId=n;const s=Ba(this.studyCollection,"configs"),o=b7(s,"configs"),a=Ba(o,i);return await Xg(a,r)}async initializeParticipantSession(n,r,i){if(!this._verifyStudyDatabase(this.studyCollection))throw new Error("Study database not initialized");if(await this.getCurrentParticipantId(i),!this.currentParticipantId)throw new Error("Participant not initialized");const s=Ba(this.studyCollection,this.currentParticipantId),o=(await Qg(s)).data();if(this.localProvenanceCopy=await this._getFromFirebaseStorage(this.currentParticipantId,"provenance"),this.localWindowEvents=await this._getFromFirebaseStorage(this.currentParticipantId,"windowEvents"),Object.entries(this.localWindowEvents).forEach(([l,c])=>{o!==null&&(c===void 0||c.length===0?o.answers[l].windowEvents=[]:o.answers[l].windowEvents=c)}),o)return o;const a=await Dp(JSON.stringify(r)),u={participantId:this.currentParticipantId,participantConfigHash:a,sequence:await this.getSequence(),answers:{},searchParams:n};return await Xg(s,u),u}async getCurrentParticipantId(n){const r=await this.localForage.getItem("currentParticipantId");if(n)return this.currentParticipantId=n,await this.localForage.setItem("currentParticipantId",n),n;if(r)return this.currentParticipantId=r,r;if(!this._verifyStudyDatabase(this.studyCollection))throw new Error("Study database not initialized");const i=Ba(this.studyCollection);return this.currentParticipantId=i.id,await this.localForage.setItem("currentParticipantId",this.currentParticipantId),this.currentParticipantId}async clearCurrentParticipantId(){return await this.localForage.removeItem("currentParticipantId")}async saveAnswer(n,r){if(!this._verifyStudyDatabase(this.studyCollection))throw new Error("Study database not initialized");if(!this.currentParticipantId)throw new Error("Participant not initialized");const i=Ba(this.studyCollection,this.currentParticipantId),s={answer:r.answer,startTime:r.startTime,endTime:r.endTime};await Xg(i,{answers:{[n]:s}},{merge:!0}),r.provenanceGraph&&(this.localProvenanceCopy[n]=r.provenanceGraph,await this._pushToFirebaseStorage("provenance")),this.localWindowEvents[n]=r.windowEvents,await this._pushToFirebaseStorage("windowEvents")}async setSequenceArray(n){if(!this._verifyStudyDatabase(this.studyCollection))throw new Error("Study database not initialized");const r=n.map(o=>o.join(",")),i=Ba(this.studyCollection,"sequenceArray");return await Xg(i,{sequenceArray:r})}async getSequenceArray(){if(!this._verifyStudyDatabase(this.studyCollection))throw new Error("Study database not initialized");const n=Ba(this.studyCollection,"sequenceArray"),r=(await Qg(n)).data();return r===void 0?null:r.sequenceArray.map(i=>i.split(","))}async getSequence(){if(!this._verifyStudyDatabase(this.studyCollection))throw new Error("Study database not initialized");const n=await this.getSequenceArray();if(!n)throw new Error("Latin square not initialized");const r=n.pop();if(!r)throw new Error("Latin square is empty");return await this.setSequenceArray(n),r}async getAllParticipantsData(){if(!this._verifyStudyDatabase(this.studyCollection))throw new Error("Study database not initialized");const n=await _et(this.studyCollection),r=[],i=n.docs.map(async s=>{if(s.id==="config"||s.id==="sequenceArray")return;const o=s.data(),a=await this._getFromFirebaseStorage(o.participantId,"provenance"),u=await this._getFromFirebaseStorage(o.participantId,"windowEvents");o.answers=Object.fromEntries(Object.entries(o.answers).map(([l,c])=>{if(c===void 0)return[l,c];const f=a[l],d=u[l];return[l,{...c,provenanceGraph:f,windowEvents:d}]})),r.push(o)});return await Promise.all(i),r}async getParticipantData(){if(!this._verifyStudyDatabase(this.studyCollection))throw new Error("Study database not initialized");await this.getCurrentParticipantId();let n=null;if(this.currentParticipantId!==null){const r=Ba(this.studyCollection,this.currentParticipantId);if(n=(await Qg(r)).data(),n!==null){const i=await this._getFromFirebaseStorage(this.currentParticipantId,"provenance"),s=await this._getFromFirebaseStorage(this.currentParticipantId,"windowEvents");Object.entries(n.answers).forEach(([o,a])=>{a!==void 0&&(a.provenanceGraph=i[o],a.windowEvents=s[o])})}}return n}async nextParticipant(n){if(!this._verifyStudyDatabase(this.studyCollection))throw new Error("Study database not initialized");const r=Ba(this.studyCollection),i=r.id;await this.localForage.setItem("currentParticipantId",i),this.currentParticipantId=i;let s=null;if(this.currentParticipantId!==null&&(s=(await Qg(r)).data()),!s){const o=await Dp(JSON.stringify(n)),a={participantId:i,participantConfigHash:o,sequence:await this.getSequence(),answers:{},searchParams:{}};await Xg(r,a),s=a}return s}async verifyCompletion(){if(!this._verifyStudyDatabase(this.studyCollection))throw new Error("Study database not initialized");const n=await this.getParticipantData();if(!n)throw new Error("Participant not initialized");return n.sequence.every(i=>i==="end"?!0:n.answers[i]!==void 0)}_verifyStudyDatabase(n){return n!==void 0}async _getFromFirebaseStorage(n,r){const i=xV(),s=IV(i,`${this.studyId}/${n}_${r}`);let o={};try{const a=await aQe(s),l=await(await fetch(a)).text();o=JSON.parse(l)}catch{console.warn(`Participant ${n} does not have ${r} for ${this.studyId}.`)}return o}async _pushToFirebaseStorage(n){const r=n==="provenance"?this.localProvenanceCopy:this.localWindowEvents;if(Object.keys(r).length>0){const i=xV(),s=IV(i,`${this.studyId}/${this.currentParticipantId}_${n}`),o=new Blob([JSON.stringify(r)],{type:"application/json"});await oQe(s,o)}}}async function crt(){let e,t=!1;{const n=new lrt;await n.connect(),n.isConnected()?e=n:t=!0}if(t){const n=new vYe;await n.connect(),e=n}return e}function frt(){const{storageEngine:e,setStorageEngine:t}=vf();return w.useEffect(()=>{if(e!==void 0)return;async function n(){const r=await crt();t(r)}n()},[t,e]),$.jsx(hYe,{})}PO.createRoot(document.getElementById("root")).render($.jsx(k.StrictMode,{children:$.jsx(ife,{children:$.jsx(frt,{})})})); diff --git a/index.html b/index.html index a27a3deb3..ffbe79730 100644 --- a/index.html +++ b/index.html @@ -29,7 +29,7 @@ }(window.location)) - +