var na=Object.defineProperty;var ga=(o,e,s)=>e in o?na(o,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[e]=s;var or=(o,e,s)=>ga(o,typeof e!="symbol"?e+"":e,s);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))a(c);new MutationObserver(c=>{for(const d of c)if(d.type==="childList")for(const h of d.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&a(h)}).observe(document,{childList:!0,subtree:!0});function s(c){const d={};return c.integrity&&(d.integrity=c.integrity),c.referrerPolicy&&(d.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?d.credentials="include":c.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function a(c){if(c.ep)return;c.ep=!0;const d=s(c);fetch(c.href,d)}})();var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getAugmentedNamespace(o){if(o.__esModule)return o;var e=o.default;if(typeof e=="function"){var s=function a(){return this instanceof a?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};s.prototype=e.prototype}else s={};return Object.defineProperty(s,"__esModule",{value:!0}),Object.keys(o).forEach(function(a){var c=Object.getOwnPropertyDescriptor(o,a);Object.defineProperty(s,a,c.get?c:{enumerable:!0,get:function(){return o[a]}})}),s}var jsxRuntime={exports:{}},reactJsxRuntime_production_min={},react={exports:{}},react_production_min={};/**
* @license React
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var l$1=Symbol.for("react.element"),n$1=Symbol.for("react.portal"),p$2=Symbol.for("react.fragment"),q$1=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),t=Symbol.for("react.provider"),u=Symbol.for("react.context"),v$1=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),z$1=Symbol.iterator;function A$1(o){return o===null||typeof o!="object"?null:(o=z$1&&o[z$1]||o["@@iterator"],typeof o=="function"?o:null)}var B$1={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C$1=Object.assign,D$1={};function E$1(o,e,s){this.props=o,this.context=e,this.refs=D$1,this.updater=s||B$1}E$1.prototype.isReactComponent={};E$1.prototype.setState=function(o,e){if(typeof o!="object"&&typeof o!="function"&&o!=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,o,e,"setState")};E$1.prototype.forceUpdate=function(o){this.updater.enqueueForceUpdate(this,o,"forceUpdate")};function F(){}F.prototype=E$1.prototype;function G$1(o,e,s){this.props=o,this.context=e,this.refs=D$1,this.updater=s||B$1}var H$1=G$1.prototype=new F;H$1.constructor=G$1;C$1(H$1,E$1.prototype);H$1.isPureReactComponent=!0;var I$1=Array.isArray,J=Object.prototype.hasOwnProperty,K$1={current:null},L$1={key:!0,ref:!0,__self:!0,__source:!0};function M$1(o,e,s){var a,c={},d=null,h=null;if(e!=null)for(a in e.ref!==void 0&&(h=e.ref),e.key!==void 0&&(d=""+e.key),e)J.call(e,a)&&!L$1.hasOwnProperty(a)&&(c[a]=e[a]);var b=arguments.length-2;if(b===1)c.children=s;else if(1<b){for(var j=Array(b),$=0;$<b;$++)j[$]=arguments[$+2];c.children=j}if(o&&o.defaultProps)for(a in b=o.defaultProps,b)c[a]===void 0&&(c[a]=b[a]);return{$$typeof:l$1,type:o,key:d,ref:h,props:c,_owner:K$1.current}}function N$1(o,e){return{$$typeof:l$1,type:o.type,key:e,ref:o.ref,props:o.props,_owner:o._owner}}function O$1(o){return typeof o=="object"&&o!==null&&o.$$typeof===l$1}function escape(o){var e={"=":"=0",":":"=2"};return"$"+o.replace(/[=:]/g,function(s){return e[s]})}var P$1=/\/+/g;function Q$1(o,e){return typeof o=="object"&&o!==null&&o.key!=null?escape(""+o.key):e.toString(36)}function R$1(o,e,s,a,c){var d=typeof o;(d==="undefined"||d==="boolean")&&(o=null);var h=!1;if(o===null)h=!0;else switch(d){case"string":case"number":h=!0;break;case"object":switch(o.$$typeof){case l$1:case n$1:h=!0}}if(h)return h=o,c=c(h),o=a===""?"."+Q$1(h,0):a,I$1(c)?(s="",o!=null&&(s=o.replace(P$1,"$&/")+"/"),R$1(c,e,s,"",function($){return $})):c!=null&&(O$1(c)&&(c=N$1(c,s+(!c.key||h&&h.key===c.key?"":(""+c.key).replace(P$1,"$&/")+"/")+o)),e.push(c)),1;if(h=0,a=a===""?".":a+":",I$1(o))for(var b=0;b<o.length;b++){d=o[b];var j=a+Q$1(d,b);h+=R$1(d,e,s,j,c)}else if(j=A$1(o),typeof j=="function")for(o=j.call(o),b=0;!(d=o.next()).done;)d=d.value,j=a+Q$1(d,b++),h+=R$1(d,e,s,j,c);else if(d==="object")throw e=String(o),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return h}function S$1(o,e,s){if(o==null)return o;var a=[],c=0;return R$1(o,a,"","",function(d){return e.call(s,d,c++)}),a}function T$1(o){if(o._status===-1){var e=o._result;e=e(),e.then(function(s){(o._status===0||o._status===-1)&&(o._status=1,o._result=s)},function(s){(o._status===0||o._status===-1)&&(o._status=2,o._result=s)}),o._status===-1&&(o._status=0,o._result=e)}if(o._status===1)return o._result.default;throw o._result}var U$1={current:null},V$1={transition:null},W$1={ReactCurrentDispatcher:U$1,ReactCurrentBatchConfig:V$1,ReactCurrentOwner:K$1};function X$2(){throw Error("act(...) is not supported in production builds of React.")}react_production_min.Children={map:S$1,forEach:function(o,e,s){S$1(o,function(){e.apply(this,arguments)},s)},count:function(o){var e=0;return S$1(o,function(){e++}),e},toArray:function(o){return S$1(o,function(e){return e})||[]},only:function(o){if(!O$1(o))throw Error("React.Children.only expected to receive a single React element child.");return o}};react_production_min.Component=E$1;react_production_min.Fragment=p$2;react_production_min.Profiler=r;react_production_min.PureComponent=G$1;react_production_min.StrictMode=q$1;react_production_min.Suspense=w;react_production_min.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=W$1;react_production_min.act=X$2;react_production_min.cloneElement=function(o,e,s){if(o==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+o+".");var a=C$1({},o.props),c=o.key,d=o.ref,h=o._owner;if(e!=null){if(e.ref!==void 0&&(d=e.ref,h=K$1.current),e.key!==void 0&&(c=""+e.key),o.type&&o.type.defaultProps)var b=o.type.defaultProps;for(j in e)J.call(e,j)&&!L$1.hasOwnProperty(j)&&(a[j]=e[j]===void 0&&b!==void 0?b[j]:e[j])}var j=arguments.length-2;if(j===1)a.children=s;else if(1<j){b=Array(j);for(var $=0;$<j;$++)b[$]=arguments[$+2];a.children=b}return{$$typeof:l$1,type:o.type,key:c,ref:d,props:a,_owner:h}};react_production_min.createContext=function(o){return o={$$typeof:u,_currentValue:o,_currentValue2:o,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},o.Provider={$$typeof:t,_context:o},o.Consumer=o};react_production_min.createElement=M$1;react_production_min.createFactory=function(o){var e=M$1.bind(null,o);return e.type=o,e};react_production_min.createRef=function(){return{current:null}};react_production_min.forwardRef=function(o){return{$$typeof:v$1,render:o}};react_production_min.isValidElement=O$1;react_production_min.lazy=function(o){return{$$typeof:y,_payload:{_status:-1,_result:o},_init:T$1}};react_production_min.memo=function(o,e){return{$$typeof:x,type:o,compare:e===void 0?null:e}};react_production_min.startTransition=function(o){var e=V$1.transition;V$1.transition={};try{o()}finally{V$1.transition=e}};react_production_min.unstable_act=X$2;react_production_min.useCallback=function(o,e){return U$1.current.useCallback(o,e)};react_production_min.useContext=function(o){return U$1.current.useContext(o)};react_production_min.useDebugValue=function(){};react_production_min.useDeferredValue=function(o){return U$1.current.useDeferredValue(o)};react_production_min.useEffect=function(o,e){return U$1.current.useEffect(o,e)};react_production_min.useId=function(){return U$1.current.useId()};react_production_min.useImperativeHandle=function(o,e,s){return U$1.current.useImperativeHandle(o,e,s)};react_production_min.useInsertionEffect=function(o,e){return U$1.current.useInsertionEffect(o,e)};react_production_min.useLayoutEffect=function(o,e){return U$1.current.useLayoutEffect(o,e)};react_production_min.useMemo=function(o,e){return U$1.current.useMemo(o,e)};react_production_min.useReducer=function(o,e,s){return U$1.current.useReducer(o,e,s)};react_production_min.useRef=function(o){return U$1.current.useRef(o)};react_production_min.useState=function(o){return U$1.current.useState(o)};react_production_min.useSyncExternalStore=function(o,e,s){return U$1.current.useSyncExternalStore(o,e,s)};react_production_min.useTransition=function(){return U$1.current.useTransition()};react_production_min.version="18.3.1";react.exports=react_production_min;var reactExports=react.exports;/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var f=reactExports,k=Symbol.for("react.element"),l=Symbol.for("react.fragment"),m$1=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p$1={key:!0,ref:!0,__self:!0,__source:!0};function q(o,e,s){var a,c={},d=null,h=null;s!==void 0&&(d=""+s),e.key!==void 0&&(d=""+e.key),e.ref!==void 0&&(h=e.ref);for(a in e)m$1.call(e,a)&&!p$1.hasOwnProperty(a)&&(c[a]=e[a]);if(o&&o.defaultProps)for(a in e=o.defaultProps,e)c[a]===void 0&&(c[a]=e[a]);return{$$typeof:k,type:o,key:d,ref:h,props:c,_owner:n.current}}reactJsxRuntime_production_min.Fragment=l;reactJsxRuntime_production_min.jsx=q;reactJsxRuntime_production_min.jsxs=q;jsxRuntime.exports=reactJsxRuntime_production_min;var jsxRuntimeExports=jsxRuntime.exports,reactDom={exports:{}},reactDom_production_min={},scheduler={exports:{}},scheduler_production_min={};/**
* @license React
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/(function(o){function e(Lt,Vt){var nr=Lt.length;Lt.push(Vt);e:for(;0<nr;){var Zt=nr-1>>>1,sr=Lt[Zt];if(0<c(sr,Vt))Lt[Zt]=Vt,Lt[nr]=sr,nr=Zt;else break e}}function s(Lt){return Lt.length===0?null:Lt[0]}function a(Lt){if(Lt.length===0)return null;var Vt=Lt[0],nr=Lt.pop();if(nr!==Vt){Lt[0]=nr;e:for(var Zt=0,sr=Lt.length,Mr=sr>>>1;Zt<Mr;){var ir=2*(Zt+1)-1,Cr=Lt[ir],It=ir+1,tr=Lt[It];if(0>c(Cr,nr))It<sr&&0>c(tr,Cr)?(Lt[Zt]=tr,Lt[It]=nr,Zt=It):(Lt[Zt]=Cr,Lt[ir]=nr,Zt=ir);else if(It<sr&&0>c(tr,nr))Lt[Zt]=tr,Lt[It]=nr,Zt=It;else break e}}return Vt}function c(Lt,Vt){var nr=Lt.sortIndex-Vt.sortIndex;return nr!==0?nr:Lt.id-Vt.id}if(typeof performance=="object"&&typeof performance.now=="function"){var d=performance;o.unstable_now=function(){return d.now()}}else{var h=Date,b=h.now();o.unstable_now=function(){return h.now()-b}}var j=[],$=[],_e=1,it=null,at=3,lt=!1,dt=!1,mt=!1,vt=typeof setTimeout=="function"?setTimeout:null,tt=typeof clearTimeout=="function"?clearTimeout:null,nt=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function ot(Lt){for(var Vt=s($);Vt!==null;){if(Vt.callback===null)a($);else if(Vt.startTime<=Lt)a($),Vt.sortIndex=Vt.expirationTime,e(j,Vt);else break;Vt=s($)}}function ht(Lt){if(mt=!1,ot(Lt),!dt)if(s(j)!==null)dt=!0,Dt(xt);else{var Vt=s($);Vt!==null&&gr(ht,Vt.startTime-Lt)}}function xt(Lt,Vt){dt=!1,mt&&(mt=!1,tt(Rt),Rt=-1),lt=!0;var nr=at;try{for(ot(Vt),it=s(j);it!==null&&(!(it.expirationTime>Vt)||Lt&&!Ht());){var Zt=it.callback;if(typeof Zt=="function"){it.callback=null,at=it.priorityLevel;var sr=Zt(it.expirationTime<=Vt);Vt=o.unstable_now(),typeof sr=="function"?it.callback=sr:it===s(j)&&a(j),ot(Vt)}else a(j);it=s(j)}if(it!==null)var Mr=!0;else{var ir=s($);ir!==null&&gr(ht,ir.startTime-Vt),Mr=!1}return Mr}finally{it=null,at=nr,lt=!1}}var Et=!1,_t=null,Rt=-1,Bt=5,Mt=-1;function Ht(){return!(o.unstable_now()-Mt<Bt)}function er(){if(_t!==null){var Lt=o.unstable_now();Mt=Lt;var Vt=!0;try{Vt=_t(!0,Lt)}finally{Vt?Yt():(Et=!1,_t=null)}}else Et=!1}var Yt;if(typeof nt=="function")Yt=function(){nt(er)};else if(typeof MessageChannel<"u"){var rr=new MessageChannel,Jt=rr.port2;rr.port1.onmessage=er,Yt=function(){Jt.postMessage(null)}}else Yt=function(){vt(er,0)};function Dt(Lt){_t=Lt,Et||(Et=!0,Yt())}function gr(Lt,Vt){Rt=vt(function(){Lt(o.unstable_now())},Vt)}o.unstable_IdlePriority=5,o.unstable_ImmediatePriority=1,o.unstable_LowPriority=4,o.unstable_NormalPriority=3,o.unstable_Profiling=null,o.unstable_UserBlockingPriority=2,o.unstable_cancelCallback=function(Lt){Lt.callback=null},o.unstable_continueExecution=function(){dt||lt||(dt=!0,Dt(xt))},o.unstable_forceFrameRate=function(Lt){0>Lt||125<Lt?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Bt=0<Lt?Math.floor(1e3/Lt):5},o.unstable_getCurrentPriorityLevel=function(){return at},o.unstable_getFirstCallbackNode=function(){return s(j)},o.unstable_next=function(Lt){switch(at){case 1:case 2:case 3:var Vt=3;break;default:Vt=at}var nr=at;at=Vt;try{return Lt()}finally{at=nr}},o.unstable_pauseExecution=function(){},o.unstable_requestPaint=function(){},o.unstable_runWithPriority=function(Lt,Vt){switch(Lt){case 1:case 2:case 3:case 4:case 5:break;default:Lt=3}var nr=at;at=Lt;try{return Vt()}finally{at=nr}},o.unstable_scheduleCallback=function(Lt,Vt,nr){var Zt=o.unstable_now();switch(typeof nr=="object"&&nr!==null?(nr=nr.delay,nr=typeof nr=="number"&&0<nr?Zt+nr:Zt):nr=Zt,Lt){case 1:var sr=-1;break;case 2:sr=250;break;case 5:sr=1073741823;break;case 4:sr=1e4;break;default:sr=5e3}return sr=nr+sr,Lt={id:_e++,callback:Vt,priorityLevel:Lt,startTime:nr,expirationTime:sr,sortIndex:-1},nr>Zt?(Lt.sortIndex=nr,e($,Lt),s(j)===null&&Lt===s($)&&(mt?(tt(Rt),Rt=-1):mt=!0,gr(ht,nr-Zt))):(Lt.sortIndex=sr,e(j,Lt),dt||lt||(dt=!0,Dt(xt))),Lt},o.unstable_shouldYield=Ht,o.unstable_wrapCallback=function(Lt){var Vt=at;return function(){var nr=at;at=Vt;try{return Lt.apply(this,arguments)}finally{at=nr}}}})(scheduler_production_min);scheduler.exports=scheduler_production_min;var schedulerExports=scheduler.exports;/**
* @license React
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var aa=reactExports,ca=schedulerExports;function p(o){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+o,s=1;s<arguments.length;s++)e+="&args[]="+encodeURIComponent(arguments[s]);return"Minified React error #"+o+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var da=new Set,ea={};function fa(o,e){ha(o,e),ha(o+"Capture",e)}function ha(o,e){for(ea[o]=e,o=0;o<e.length;o++)da.add(e[o])}var ia=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ja=Object.prototype.hasOwnProperty,ka=/^[: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]*$/,la={},ma={};function oa(o){return ja.call(ma,o)?!0:ja.call(la,o)?!1:ka.test(o)?ma[o]=!0:(la[o]=!0,!1)}function pa(o,e,s,a){if(s!==null&&s.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return a?!1:s!==null?!s.acceptsBooleans:(o=o.toLowerCase().slice(0,5),o!=="data-"&&o!=="aria-");default:return!1}}function qa(o,e,s,a){if(e===null||typeof e>"u"||pa(o,e,s,a))return!0;if(a)return!1;if(s!==null)switch(s.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function v(o,e,s,a,c,d,h){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=a,this.attributeNamespace=c,this.mustUseProperty=s,this.propertyName=o,this.type=e,this.sanitizeURL=d,this.removeEmptyString=h}var z={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(o){z[o]=new v(o,0,!1,o,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(o){var e=o[0];z[e]=new v(e,1,!1,o[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(o){z[o]=new v(o,2,!1,o.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(o){z[o]=new v(o,2,!1,o,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(o){z[o]=new v(o,3,!1,o.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(o){z[o]=new v(o,3,!0,o,null,!1,!1)});["capture","download"].forEach(function(o){z[o]=new v(o,4,!1,o,null,!1,!1)});["cols","rows","size","span"].forEach(function(o){z[o]=new v(o,6,!1,o,null,!1,!1)});["rowSpan","start"].forEach(function(o){z[o]=new v(o,5,!1,o.toLowerCase(),null,!1,!1)});var ra=/[\-:]([a-z])/g;function sa(o){return o[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(o){var e=o.replace(ra,sa);z[e]=new v(e,1,!1,o,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(o){var e=o.replace(ra,sa);z[e]=new v(e,1,!1,o,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(o){var e=o.replace(ra,sa);z[e]=new v(e,1,!1,o,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(o){z[o]=new v(o,1,!1,o.toLowerCase(),null,!1,!1)});z.xlinkHref=new v("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(o){z[o]=new v(o,1,!1,o.toLowerCase(),null,!0,!0)});function ta(o,e,s,a){var c=z.hasOwnProperty(e)?z[e]:null;(c!==null?c.type!==0:a||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(qa(e,s,c,a)&&(s=null),a||c===null?oa(e)&&(s===null?o.removeAttribute(e):o.setAttribute(e,""+s)):c.mustUseProperty?o[c.propertyName]=s===null?c.type===3?!1:"":s:(e=c.attributeName,a=c.attributeNamespace,s===null?o.removeAttribute(e):(c=c.type,s=c===3||c===4&&s===!0?"":""+s,a?o.setAttributeNS(a,e,s):o.setAttribute(e,s))))}var ua=aa.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,va=Symbol.for("react.element"),wa=Symbol.for("react.portal"),ya=Symbol.for("react.fragment"),za=Symbol.for("react.strict_mode"),Aa=Symbol.for("react.profiler"),Ba=Symbol.for("react.provider"),Ca=Symbol.for("react.context"),Da=Symbol.for("react.forward_ref"),Ea=Symbol.for("react.suspense"),Fa=Symbol.for("react.suspense_list"),Ga=Symbol.for("react.memo"),Ha=Symbol.for("react.lazy"),Ia=Symbol.for("react.offscreen"),Ja=Symbol.iterator;function Ka(o){return o===null||typeof o!="object"?null:(o=Ja&&o[Ja]||o["@@iterator"],typeof o=="function"?o:null)}var A=Object.assign,La;function Ma(o){if(La===void 0)try{throw Error()}catch(s){var e=s.stack.trim().match(/\n( *(at )?)/);La=e&&e[1]||""}return`
`+La+o}var Na=!1;function Oa(o,e){if(!o||Na)return"";Na=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(e,[])}catch($){var a=$}Reflect.construct(o,[],e)}else{try{e.call()}catch($){a=$}o.call(e.prototype)}else{try{throw Error()}catch($){a=$}o()}}catch($){if($&&a&&typeof $.stack=="string"){for(var c=$.stack.split(`
`),d=a.stack.split(`
`),h=c.length-1,b=d.length-1;1<=h&&0<=b&&c[h]!==d[b];)b--;for(;1<=h&&0<=b;h--,b--)if(c[h]!==d[b]){if(h!==1||b!==1)do if(h--,b--,0>b||c[h]!==d[b]){var j=`
`+c[h].replace(" at new "," at ");return o.displayName&&j.includes("<anonymous>")&&(j=j.replace("<anonymous>",o.displayName)),j}while(1<=h&&0<=b);break}}}finally{Na=!1,Error.prepareStackTrace=s}return(o=o?o.displayName||o.name:"")?Ma(o):""}function Pa(o){switch(o.tag){case 5:return Ma(o.type);case 16:return Ma("Lazy");case 13:return Ma("Suspense");case 19:return Ma("SuspenseList");case 0:case 2:case 15:return o=Oa(o.type,!1),o;case 11:return o=Oa(o.type.render,!1),o;case 1:return o=Oa(o.type,!0),o;default:return""}}function Qa(o){if(o==null)return null;if(typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case ya:return"Fragment";case wa:return"Portal";case Aa:return"Profiler";case za:return"StrictMode";case Ea:return"Suspense";case Fa:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case Ca:return(o.displayName||"Context")+".Consumer";case Ba:return(o._context.displayName||"Context")+".Provider";case Da:var e=o.render;return o=o.displayName,o||(o=e.displayName||e.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case Ga:return e=o.displayName||null,e!==null?e:Qa(o.type)||"Memo";case Ha:e=o._payload,o=o._init;try{return Qa(o(e))}catch{}}return null}function Ra(o){var e=o.type;switch(o.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return o=e.render,o=o.displayName||o.name||"",e.displayName||(o!==""?"ForwardRef("+o+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Qa(e);case 8:return e===za?"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 e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Sa(o){switch(typeof o){case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function Ta(o){var e=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function Ua(o){var e=Ta(o)?"checked":"value",s=Object.getOwnPropertyDescriptor(o.constructor.prototype,e),a=""+o[e];if(!o.hasOwnProperty(e)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var c=s.get,d=s.set;return Object.defineProperty(o,e,{configurable:!0,get:function(){return c.call(this)},set:function(h){a=""+h,d.call(this,h)}}),Object.defineProperty(o,e,{enumerable:s.enumerable}),{getValue:function(){return a},setValue:function(h){a=""+h},stopTracking:function(){o._valueTracker=null,delete o[e]}}}}function Va(o){o._valueTracker||(o._valueTracker=Ua(o))}function Wa(o){if(!o)return!1;var e=o._valueTracker;if(!e)return!0;var s=e.getValue(),a="";return o&&(a=Ta(o)?o.checked?"true":"false":o.value),o=a,o!==s?(e.setValue(o),!0):!1}function Xa(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}function Ya(o,e){var s=e.checked;return A({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:s??o._wrapperState.initialChecked})}function Za(o,e){var s=e.defaultValue==null?"":e.defaultValue,a=e.checked!=null?e.checked:e.defaultChecked;s=Sa(e.value!=null?e.value:s),o._wrapperState={initialChecked:a,initialValue:s,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function ab(o,e){e=e.checked,e!=null&&ta(o,"checked",e,!1)}function bb(o,e){ab(o,e);var s=Sa(e.value),a=e.type;if(s!=null)a==="number"?(s===0&&o.value===""||o.value!=s)&&(o.value=""+s):o.value!==""+s&&(o.value=""+s);else if(a==="submit"||a==="reset"){o.removeAttribute("value");return}e.hasOwnProperty("value")?cb(o,e.type,s):e.hasOwnProperty("defaultValue")&&cb(o,e.type,Sa(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(o.defaultChecked=!!e.defaultChecked)}function db$1(o,e,s){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var a=e.type;if(!(a!=="submit"&&a!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+o._wrapperState.initialValue,s||e===o.value||(o.value=e),o.defaultValue=e}s=o.name,s!==""&&(o.name=""),o.defaultChecked=!!o._wrapperState.initialChecked,s!==""&&(o.name=s)}function cb(o,e,s){(e!=="number"||Xa(o.ownerDocument)!==o)&&(s==null?o.defaultValue=""+o._wrapperState.initialValue:o.defaultValue!==""+s&&(o.defaultValue=""+s))}var eb=Array.isArray;function fb(o,e,s,a){if(o=o.options,e){e={};for(var c=0;c<s.length;c++)e["$"+s[c]]=!0;for(s=0;s<o.length;s++)c=e.hasOwnProperty("$"+o[s].value),o[s].selected!==c&&(o[s].selected=c),c&&a&&(o[s].defaultSelected=!0)}else{for(s=""+Sa(s),e=null,c=0;c<o.length;c++){if(o[c].value===s){o[c].selected=!0,a&&(o[c].defaultSelected=!0);return}e!==null||o[c].disabled||(e=o[c])}e!==null&&(e.selected=!0)}}function gb(o,e){if(e.dangerouslySetInnerHTML!=null)throw Error(p(91));return A({},e,{value:void 0,defaultValue:void 0,children:""+o._wrapperState.initialValue})}function hb(o,e){var s=e.value;if(s==null){if(s=e.children,e=e.defaultValue,s!=null){if(e!=null)throw Error(p(92));if(eb(s)){if(1<s.length)throw Error(p(93));s=s[0]}e=s}e==null&&(e=""),s=e}o._wrapperState={initialValue:Sa(s)}}function ib(o,e){var s=Sa(e.value),a=Sa(e.defaultValue);s!=null&&(s=""+s,s!==o.value&&(o.value=s),e.defaultValue==null&&o.defaultValue!==s&&(o.defaultValue=s)),a!=null&&(o.defaultValue=""+a)}function jb(o){var e=o.textContent;e===o._wrapperState.initialValue&&e!==""&&e!==null&&(o.value=e)}function kb(o){switch(o){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function lb(o,e){return o==null||o==="http://www.w3.org/1999/xhtml"?kb(e):o==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":o}var mb,nb=function(o){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,s,a,c){MSApp.execUnsafeLocalFunction(function(){return o(e,s,a,c)})}:o}(function(o,e){if(o.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in o)o.innerHTML=e;else{for(mb=mb||document.createElement("div"),mb.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=mb.firstChild;o.firstChild;)o.removeChild(o.firstChild);for(;e.firstChild;)o.appendChild(e.firstChild)}});function ob(o,e){if(e){var s=o.firstChild;if(s&&s===o.lastChild&&s.nodeType===3){s.nodeValue=e;return}}o.textContent=e}var pb={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},qb=["Webkit","ms","Moz","O"];Object.keys(pb).forEach(function(o){qb.forEach(function(e){e=e+o.charAt(0).toUpperCase()+o.substring(1),pb[e]=pb[o]})});function rb(o,e,s){return e==null||typeof e=="boolean"||e===""?"":s||typeof e!="number"||e===0||pb.hasOwnProperty(o)&&pb[o]?(""+e).trim():e+"px"}function sb(o,e){o=o.style;for(var s in e)if(e.hasOwnProperty(s)){var a=s.indexOf("--")===0,c=rb(s,e[s],a);s==="float"&&(s="cssFloat"),a?o.setProperty(s,c):o[s]=c}}var tb=A({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 ub(o,e){if(e){if(tb[o]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(p(137,o));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(p(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(p(61))}if(e.style!=null&&typeof e.style!="object")throw Error(p(62))}}function vb(o,e){if(o.indexOf("-")===-1)return typeof e.is=="string";switch(o){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 wb=null;function xb(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var yb=null,zb=null,Ab=null;function Bb(o){if(o=Cb(o)){if(typeof yb!="function")throw Error(p(280));var e=o.stateNode;e&&(e=Db(e),yb(o.stateNode,o.type,e))}}function Eb(o){zb?Ab?Ab.push(o):Ab=[o]:zb=o}function Fb(){if(zb){var o=zb,e=Ab;if(Ab=zb=null,Bb(o),e)for(o=0;o<e.length;o++)Bb(e[o])}}function Gb(o,e){return o(e)}function Hb(){}var Ib=!1;function Jb(o,e,s){if(Ib)return o(e,s);Ib=!0;try{return Gb(o,e,s)}finally{Ib=!1,(zb!==null||Ab!==null)&&(Hb(),Fb())}}function Kb(o,e){var s=o.stateNode;if(s===null)return null;var a=Db(s);if(a===null)return null;s=a[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(a=!a.disabled)||(o=o.type,a=!(o==="button"||o==="input"||o==="select"||o==="textarea")),o=!a;break e;default:o=!1}if(o)return null;if(s&&typeof s!="function")throw Error(p(231,e,typeof s));return s}var Lb=!1;if(ia)try{var Mb={};Object.defineProperty(Mb,"passive",{get:function(){Lb=!0}}),window.addEventListener("test",Mb,Mb),window.removeEventListener("test",Mb,Mb)}catch{Lb=!1}function Nb(o,e,s,a,c,d,h,b,j){var $=Array.prototype.slice.call(arguments,3);try{e.apply(s,$)}catch(_e){this.onError(_e)}}var Ob=!1,Pb=null,Qb=!1,Rb=null,Sb={onError:function(o){Ob=!0,Pb=o}};function Tb(o,e,s,a,c,d,h,b,j){Ob=!1,Pb=null,Nb.apply(Sb,arguments)}function Ub(o,e,s,a,c,d,h,b,j){if(Tb.apply(this,arguments),Ob){if(Ob){var $=Pb;Ob=!1,Pb=null}else throw Error(p(198));Qb||(Qb=!0,Rb=$)}}function Vb(o){var e=o,s=o;if(o.alternate)for(;e.return;)e=e.return;else{o=e;do e=o,e.flags&4098&&(s=e.return),o=e.return;while(o)}return e.tag===3?s:null}function Wb(o){if(o.tag===13){var e=o.memoizedState;if(e===null&&(o=o.alternate,o!==null&&(e=o.memoizedState)),e!==null)return e.dehydrated}return null}function Xb(o){if(Vb(o)!==o)throw Error(p(188))}function Yb(o){var e=o.alternate;if(!e){if(e=Vb(o),e===null)throw Error(p(188));return e!==o?null:o}for(var s=o,a=e;;){var c=s.return;if(c===null)break;var d=c.alternate;if(d===null){if(a=c.return,a!==null){s=a;continue}break}if(c.child===d.child){for(d=c.child;d;){if(d===s)return Xb(c),o;if(d===a)return Xb(c),e;d=d.sibling}throw Error(p(188))}if(s.return!==a.return)s=c,a=d;else{for(var h=!1,b=c.child;b;){if(b===s){h=!0,s=c,a=d;break}if(b===a){h=!0,a=c,s=d;break}b=b.sibling}if(!h){for(b=d.child;b;){if(b===s){h=!0,s=d,a=c;break}if(b===a){h=!0,a=d,s=c;break}b=b.sibling}if(!h)throw Error(p(189))}}if(s.alternate!==a)throw Error(p(190))}if(s.tag!==3)throw Error(p(188));return s.stateNode.current===s?o:e}function Zb(o){return o=Yb(o),o!==null?$b(o):null}function $b(o){if(o.tag===5||o.tag===6)return o;for(o=o.child;o!==null;){var e=$b(o);if(e!==null)return e;o=o.sibling}return null}var ac=ca.unstable_scheduleCallback,bc=ca.unstable_cancelCallback,cc=ca.unstable_shouldYield,dc=ca.unstable_requestPaint,B=ca.unstable_now,ec=ca.unstable_getCurrentPriorityLevel,fc=ca.unstable_ImmediatePriority,gc=ca.unstable_UserBlockingPriority,hc=ca.unstable_NormalPriority,ic=ca.unstable_LowPriority,jc=ca.unstable_IdlePriority,kc=null,lc=null;function mc(o){if(lc&&typeof lc.onCommitFiberRoot=="function")try{lc.onCommitFiberRoot(kc,o,void 0,(o.current.flags&128)===128)}catch{}}var oc=Math.clz32?Math.clz32:nc,pc=Math.log,qc=Math.LN2;function nc(o){return o>>>=0,o===0?32:31-(pc(o)/qc|0)|0}var rc=64,sc=4194304;function tc(o){switch(o&-o){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 o&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return o&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return o}}function uc(o,e){var s=o.pendingLanes;if(s===0)return 0;var a=0,c=o.suspendedLanes,d=o.pingedLanes,h=s&268435455;if(h!==0){var b=h&~c;b!==0?a=tc(b):(d&=h,d!==0&&(a=tc(d)))}else h=s&~c,h!==0?a=tc(h):d!==0&&(a=tc(d));if(a===0)return 0;if(e!==0&&e!==a&&!(e&c)&&(c=a&-a,d=e&-e,c>=d||c===16&&(d&4194240)!==0))return e;if(a&4&&(a|=s&16),e=o.entangledLanes,e!==0)for(o=o.entanglements,e&=a;0<e;)s=31-oc(e),c=1<<s,a|=o[s],e&=~c;return a}function vc(o,e){switch(o){case 1:case 2:case 4:return e+250;case 8:case 16:case 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+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function wc(o,e){for(var s=o.suspendedLanes,a=o.pingedLanes,c=o.expirationTimes,d=o.pendingLanes;0<d;){var h=31-oc(d),b=1<<h,j=c[h];j===-1?(!(b&s)||b&a)&&(c[h]=vc(b,e)):j<=e&&(o.expiredLanes|=b),d&=~b}}function xc(o){return o=o.pendingLanes&-1073741825,o!==0?o:o&1073741824?1073741824:0}function yc(){var o=rc;return rc<<=1,!(rc&4194240)&&(rc=64),o}function zc(o){for(var e=[],s=0;31>s;s++)e.push(o);return e}function Ac(o,e,s){o.pendingLanes|=e,e!==536870912&&(o.suspendedLanes=0,o.pingedLanes=0),o=o.eventTimes,e=31-oc(e),o[e]=s}function Bc(o,e){var s=o.pendingLanes&~e;o.pendingLanes=e,o.suspendedLanes=0,o.pingedLanes=0,o.expiredLanes&=e,o.mutableReadLanes&=e,o.entangledLanes&=e,e=o.entanglements;var a=o.eventTimes;for(o=o.expirationTimes;0<s;){var c=31-oc(s),d=1<<c;e[c]=0,a[c]=-1,o[c]=-1,s&=~d}}function Cc(o,e){var s=o.entangledLanes|=e;for(o=o.entanglements;s;){var a=31-oc(s),c=1<<a;c&e|o[a]&e&&(o[a]|=e),s&=~c}}var C=0;function Dc(o){return o&=-o,1<o?4<o?o&268435455?16:536870912:4:1}var Ec,Fc,Gc,Hc,Ic,Jc=!1,Kc=[],Lc=null,Mc=null,Nc=null,Oc=new Map,Pc=new Map,Qc=[],Rc="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Sc(o,e){switch(o){case"focusin":case"focusout":Lc=null;break;case"dragenter":case"dragleave":Mc=null;break;case"mouseover":case"mouseout":Nc=null;break;case"pointerover":case"pointerout":Oc.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":Pc.delete(e.pointerId)}}function Tc(o,e,s,a,c,d){return o===null||o.nativeEvent!==d?(o={blockedOn:e,domEventName:s,eventSystemFlags:a,nativeEvent:d,targetContainers:[c]},e!==null&&(e=Cb(e),e!==null&&Fc(e)),o):(o.eventSystemFlags|=a,e=o.targetContainers,c!==null&&e.indexOf(c)===-1&&e.push(c),o)}function Uc(o,e,s,a,c){switch(e){case"focusin":return Lc=Tc(Lc,o,e,s,a,c),!0;case"dragenter":return Mc=Tc(Mc,o,e,s,a,c),!0;case"mouseover":return Nc=Tc(Nc,o,e,s,a,c),!0;case"pointerover":var d=c.pointerId;return Oc.set(d,Tc(Oc.get(d)||null,o,e,s,a,c)),!0;case"gotpointercapture":return d=c.pointerId,Pc.set(d,Tc(Pc.get(d)||null,o,e,s,a,c)),!0}return!1}function Vc(o){var e=Wc(o.target);if(e!==null){var s=Vb(e);if(s!==null){if(e=s.tag,e===13){if(e=Wb(s),e!==null){o.blockedOn=e,Ic(o.priority,function(){Gc(s)});return}}else if(e===3&&s.stateNode.current.memoizedState.isDehydrated){o.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}o.blockedOn=null}function Xc(o){if(o.blockedOn!==null)return!1;for(var e=o.targetContainers;0<e.length;){var s=Yc(o.domEventName,o.eventSystemFlags,e[0],o.nativeEvent);if(s===null){s=o.nativeEvent;var a=new s.constructor(s.type,s);wb=a,s.target.dispatchEvent(a),wb=null}else return e=Cb(s),e!==null&&Fc(e),o.blockedOn=s,!1;e.shift()}return!0}function Zc(o,e,s){Xc(o)&&s.delete(e)}function $c(){Jc=!1,Lc!==null&&Xc(Lc)&&(Lc=null),Mc!==null&&Xc(Mc)&&(Mc=null),Nc!==null&&Xc(Nc)&&(Nc=null),Oc.forEach(Zc),Pc.forEach(Zc)}function ad(o,e){o.blockedOn===e&&(o.blockedOn=null,Jc||(Jc=!0,ca.unstable_scheduleCallback(ca.unstable_NormalPriority,$c)))}function bd(o){function e(c){return ad(c,o)}if(0<Kc.length){ad(Kc[0],o);for(var s=1;s<Kc.length;s++){var a=Kc[s];a.blockedOn===o&&(a.blockedOn=null)}}for(Lc!==null&&ad(Lc,o),Mc!==null&&ad(Mc,o),Nc!==null&&ad(Nc,o),Oc.forEach(e),Pc.forEach(e),s=0;s<Qc.length;s++)a=Qc[s],a.blockedOn===o&&(a.blockedOn=null);for(;0<Qc.length&&(s=Qc[0],s.blockedOn===null);)Vc(s),s.blockedOn===null&&Qc.shift()}var cd=ua.ReactCurrentBatchConfig,dd=!0;function ed(o,e,s,a){var c=C,d=cd.transition;cd.transition=null;try{C=1,fd(o,e,s,a)}finally{C=c,cd.transition=d}}function gd(o,e,s,a){var c=C,d=cd.transition;cd.transition=null;try{C=4,fd(o,e,s,a)}finally{C=c,cd.transition=d}}function fd(o,e,s,a){if(dd){var c=Yc(o,e,s,a);if(c===null)hd(o,e,a,id$1,s),Sc(o,a);else if(Uc(c,o,e,s,a))a.stopPropagation();else if(Sc(o,a),e&4&&-1<Rc.indexOf(o)){for(;c!==null;){var d=Cb(c);if(d!==null&&Ec(d),d=Yc(o,e,s,a),d===null&&hd(o,e,a,id$1,s),d===c)break;c=d}c!==null&&a.stopPropagation()}else hd(o,e,a,null,s)}}var id$1=null;function Yc(o,e,s,a){if(id$1=null,o=xb(a),o=Wc(o),o!==null)if(e=Vb(o),e===null)o=null;else if(s=e.tag,s===13){if(o=Wb(e),o!==null)return o;o=null}else if(s===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;o=null}else e!==o&&(o=null);return id$1=o,null}function jd(o){switch(o){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(ec()){case fc:return 1;case gc:return 4;case hc:case ic:return 16;case jc:return 536870912;default:return 16}default:return 16}}var kd=null,ld=null,md=null;function nd(){if(md)return md;var o,e=ld,s=e.length,a,c="value"in kd?kd.value:kd.textContent,d=c.length;for(o=0;o<s&&e[o]===c[o];o++);var h=s-o;for(a=1;a<=h&&e[s-a]===c[d-a];a++);return md=c.slice(o,1<a?1-a:void 0)}function od(o){var e=o.keyCode;return"charCode"in o?(o=o.charCode,o===0&&e===13&&(o=13)):o=e,o===10&&(o=13),32<=o||o===13?o:0}function pd(){return!0}function qd(){return!1}function rd(o){function e(s,a,c,d,h){this._reactName=s,this._targetInst=c,this.type=a,this.nativeEvent=d,this.target=h,this.currentTarget=null;for(var b in o)o.hasOwnProperty(b)&&(s=o[b],this[b]=s?s(d):d[b]);return this.isDefaultPrevented=(d.defaultPrevented!=null?d.defaultPrevented:d.returnValue===!1)?pd:qd,this.isPropagationStopped=qd,this}return A(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=pd)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=pd)},persist:function(){},isPersistent:pd}),e}var sd={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},td=rd(sd),ud=A({},sd,{view:0,detail:0}),vd=rd(ud),wd,xd,yd,Ad=A({},ud,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:zd,button:0,buttons:0,relatedTarget:function(o){return o.relatedTarget===void 0?o.fromElement===o.srcElement?o.toElement:o.fromElement:o.relatedTarget},movementX:function(o){return"movementX"in o?o.movementX:(o!==yd&&(yd&&o.type==="mousemove"?(wd=o.screenX-yd.screenX,xd=o.screenY-yd.screenY):xd=wd=0,yd=o),wd)},movementY:function(o){return"movementY"in o?o.movementY:xd}}),Bd=rd(Ad),Cd=A({},Ad,{dataTransfer:0}),Dd=rd(Cd),Ed=A({},ud,{relatedTarget:0}),Fd=rd(Ed),Gd=A({},sd,{animationName:0,elapsedTime:0,pseudoElement:0}),Hd=rd(Gd),Id=A({},sd,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),Jd=rd(Id),Kd=A({},sd,{data:0}),Ld=rd(Kd),Md={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Nd={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Od={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Pd(o){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(o):(o=Od[o])?!!e[o]:!1}function zd(){return Pd}var Qd=A({},ud,{key:function(o){if(o.key){var e=Md[o.key]||o.key;if(e!=="Unidentified")return e}return o.type==="keypress"?(o=od(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?Nd[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:zd,charCode:function(o){return o.type==="keypress"?od(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?od(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),Rd=rd(Qd),Sd=A({},Ad,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Td=rd(Sd),Ud=A({},ud,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:zd}),Vd=rd(Ud),Wd=A({},sd,{propertyName:0,elapsedTime:0,pseudoElement:0}),Xd=rd(Wd),Yd=A({},Ad,{deltaX:function(o){return"deltaX"in o?o.deltaX:"wheelDeltaX"in o?-o.wheelDeltaX:0},deltaY:function(o){return"deltaY"in o?o.deltaY:"wheelDeltaY"in o?-o.wheelDeltaY:"wheelDelta"in o?-o.wheelDelta:0},deltaZ:0,deltaMode:0}),Zd=rd(Yd),$d=[9,13,27,32],ae=ia&&"CompositionEvent"in window,be=null;ia&&"documentMode"in document&&(be=document.documentMode);var ce=ia&&"TextEvent"in window&&!be,de=ia&&(!ae||be&&8<be&&11>=be),ee=" ",fe=!1;function ge(o,e){switch(o){case"keyup":return $d.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function he(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var ie=!1;function je(o,e){switch(o){case"compositionend":return he(e);case"keypress":return e.which!==32?null:(fe=!0,ee);case"textInput":return o=e.data,o===ee&&fe?null:o;default:return null}}function ke(o,e){if(ie)return o==="compositionend"||!ae&&ge(o,e)?(o=nd(),md=ld=kd=null,ie=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return de&&e.locale!=="ko"?null:e.data;default:return null}}var le={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function me(o){var e=o&&o.nodeName&&o.nodeName.toLowerCase();return e==="input"?!!le[o.type]:e==="textarea"}function ne(o,e,s,a){Eb(a),e=oe(e,"onChange"),0<e.length&&(s=new td("onChange","change",null,s,a),o.push({event:s,listeners:e}))}var pe=null,qe=null;function re(o){se(o,0)}function te(o){var e=ue(o);if(Wa(e))return o}function ve(o,e){if(o==="change")return e}var we=!1;if(ia){var xe;if(ia){var ye="oninput"in document;if(!ye){var ze=document.createElement("div");ze.setAttribute("oninput","return;"),ye=typeof ze.oninput=="function"}xe=ye}else xe=!1;we=xe&&(!document.documentMode||9<document.documentMode)}function Ae(){pe&&(pe.detachEvent("onpropertychange",Be),qe=pe=null)}function Be(o){if(o.propertyName==="value"&&te(qe)){var e=[];ne(e,qe,o,xb(o)),Jb(re,e)}}function Ce(o,e,s){o==="focusin"?(Ae(),pe=e,qe=s,pe.attachEvent("onpropertychange",Be)):o==="focusout"&&Ae()}function De(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return te(qe)}function Ee(o,e){if(o==="click")return te(e)}function Fe(o,e){if(o==="input"||o==="change")return te(e)}function Ge(o,e){return o===e&&(o!==0||1/o===1/e)||o!==o&&e!==e}var He=typeof Object.is=="function"?Object.is:Ge;function Ie(o,e){if(He(o,e))return!0;if(typeof o!="object"||o===null||typeof e!="object"||e===null)return!1;var s=Object.keys(o),a=Object.keys(e);if(s.length!==a.length)return!1;for(a=0;a<s.length;a++){var c=s[a];if(!ja.call(e,c)||!He(o[c],e[c]))return!1}return!0}function Je(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function Ke(o,e){var s=Je(o);o=0;for(var a;s;){if(s.nodeType===3){if(a=o+s.textContent.length,o<=e&&a>=e)return{node:s,offset:e-o};o=a}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Je(s)}}function Le(o,e){return o&&e?o===e?!0:o&&o.nodeType===3?!1:e&&e.nodeType===3?Le(o,e.parentNode):"contains"in o?o.contains(e):o.compareDocumentPosition?!!(o.compareDocumentPosition(e)&16):!1:!1}function Me(){for(var o=window,e=Xa();e instanceof o.HTMLIFrameElement;){try{var s=typeof e.contentWindow.location.href=="string"}catch{s=!1}if(s)o=e.contentWindow;else break;e=Xa(o.document)}return e}function Ne(o){var e=o&&o.nodeName&&o.nodeName.toLowerCase();return e&&(e==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||e==="textarea"||o.contentEditable==="true")}function Oe(o){var e=Me(),s=o.focusedElem,a=o.selectionRange;if(e!==s&&s&&s.ownerDocument&&Le(s.ownerDocument.documentElement,s)){if(a!==null&&Ne(s)){if(e=a.start,o=a.end,o===void 0&&(o=e),"selectionStart"in s)s.selectionStart=e,s.selectionEnd=Math.min(o,s.value.length);else if(o=(e=s.ownerDocument||document)&&e.defaultView||window,o.getSelection){o=o.getSelection();var c=s.textContent.length,d=Math.min(a.start,c);a=a.end===void 0?d:Math.min(a.end,c),!o.extend&&d>a&&(c=a,a=d,d=c),c=Ke(s,d);var h=Ke(s,a);c&&h&&(o.rangeCount!==1||o.anchorNode!==c.node||o.anchorOffset!==c.offset||o.focusNode!==h.node||o.focusOffset!==h.offset)&&(e=e.createRange(),e.setStart(c.node,c.offset),o.removeAllRanges(),d>a?(o.addRange(e),o.extend(h.node,h.offset)):(e.setEnd(h.node,h.offset),o.addRange(e)))}}for(e=[],o=s;o=o.parentNode;)o.nodeType===1&&e.push({element:o,left:o.scrollLeft,top:o.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;s<e.length;s++)o=e[s],o.element.scrollLeft=o.left,o.element.scrollTop=o.top}}var Pe=ia&&"documentMode"in document&&11>=document.documentMode,Qe=null,Re=null,Se=null,Te=!1;function Ue(o,e,s){var a=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Te||Qe==null||Qe!==Xa(a)||(a=Qe,"selectionStart"in a&&Ne(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),Se&&Ie(Se,a)||(Se=a,a=oe(Re,"onSelect"),0<a.length&&(e=new td("onSelect","select",null,e,s),o.push({event:e,listeners:a}),e.target=Qe)))}function Ve(o,e){var s={};return s[o.toLowerCase()]=e.toLowerCase(),s["Webkit"+o]="webkit"+e,s["Moz"+o]="moz"+e,s}var We={animationend:Ve("Animation","AnimationEnd"),animationiteration:Ve("Animation","AnimationIteration"),animationstart:Ve("Animation","AnimationStart"),transitionend:Ve("Transition","TransitionEnd")},Xe={},Ye={};ia&&(Ye=document.createElement("div").style,"AnimationEvent"in window||(delete We.animationend.animation,delete We.animationiteration.animation,delete We.animationstart.animation),"TransitionEvent"in window||delete We.transitionend.transition);function Ze(o){if(Xe[o])return Xe[o];if(!We[o])return o;var e=We[o],s;for(s in e)if(e.hasOwnProperty(s)&&s in Ye)return Xe[o]=e[s];return o}var $e=Ze("animationend"),af=Ze("animationiteration"),bf=Ze("animationstart"),cf=Ze("transitionend"),df=new Map,ef="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function ff(o,e){df.set(o,e),fa(e,[o])}for(var gf=0;gf<ef.length;gf++){var hf=ef[gf],jf=hf.toLowerCase(),kf=hf[0].toUpperCase()+hf.slice(1);ff(jf,"on"+kf)}ff($e,"onAnimationEnd");ff(af,"onAnimationIteration");ff(bf,"onAnimationStart");ff("dblclick","onDoubleClick");ff("focusin","onFocus");ff("focusout","onBlur");ff(cf,"onTransitionEnd");ha("onMouseEnter",["mouseout","mouseover"]);ha("onMouseLeave",["mouseout","mouseover"]);ha("onPointerEnter",["pointerout","pointerover"]);ha("onPointerLeave",["pointerout","pointerover"]);fa("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));fa("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));fa("onBeforeInput",["compositionend","keypress","textInput","paste"]);fa("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));fa("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));fa("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var lf="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),mf=new Set("cancel close invalid load scroll toggle".split(" ").concat(lf));function nf(o,e,s){var a=o.type||"unknown-event";o.currentTarget=s,Ub(a,e,void 0,o),o.currentTarget=null}function se(o,e){e=(e&4)!==0;for(var s=0;s<o.length;s++){var a=o[s],c=a.event;a=a.listeners;e:{var d=void 0;if(e)for(var h=a.length-1;0<=h;h--){var b=a[h],j=b.instance,$=b.currentTarget;if(b=b.listener,j!==d&&c.isPropagationStopped())break e;nf(c,b,$),d=j}else for(h=0;h<a.length;h++){if(b=a[h],j=b.instance,$=b.currentTarget,b=b.listener,j!==d&&c.isPropagationStopped())break e;nf(c,b,$),d=j}}}if(Qb)throw o=Rb,Qb=!1,Rb=null,o}function D(o,e){var s=e[of];s===void 0&&(s=e[of]=new Set);var a=o+"__bubble";s.has(a)||(pf(e,o,2,!1),s.add(a))}function qf(o,e,s){var a=0;e&&(a|=4),pf(s,o,a,e)}var rf="_reactListening"+Math.random().toString(36).slice(2);function sf(o){if(!o[rf]){o[rf]=!0,da.forEach(function(s){s!=="selectionchange"&&(mf.has(s)||qf(s,!1,o),qf(s,!0,o))});var e=o.nodeType===9?o:o.ownerDocument;e===null||e[rf]||(e[rf]=!0,qf("selectionchange",!1,e))}}function pf(o,e,s,a){switch(jd(e)){case 1:var c=ed;break;case 4:c=gd;break;default:c=fd}s=c.bind(null,e,s,o),c=void 0,!Lb||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(c=!0),a?c!==void 0?o.addEventListener(e,s,{capture:!0,passive:c}):o.addEventListener(e,s,!0):c!==void 0?o.addEventListener(e,s,{passive:c}):o.addEventListener(e,s,!1)}function hd(o,e,s,a,c){var d=a;if(!(e&1)&&!(e&2)&&a!==null)e:for(;;){if(a===null)return;var h=a.tag;if(h===3||h===4){var b=a.stateNode.containerInfo;if(b===c||b.nodeType===8&&b.parentNode===c)break;if(h===4)for(h=a.return;h!==null;){var j=h.tag;if((j===3||j===4)&&(j=h.stateNode.containerInfo,j===c||j.nodeType===8&&j.parentNode===c))return;h=h.return}for(;b!==null;){if(h=Wc(b),h===null)return;if(j=h.tag,j===5||j===6){a=d=h;continue e}b=b.parentNode}}a=a.return}Jb(function(){var $=d,_e=xb(s),it=[];e:{var at=df.get(o);if(at!==void 0){var lt=td,dt=o;switch(o){case"keypress":if(od(s)===0)break e;case"keydown":case"keyup":lt=Rd;break;case"focusin":dt="focus",lt=Fd;break;case"focusout":dt="blur",lt=Fd;break;case"beforeblur":case"afterblur":lt=Fd;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":lt=Bd;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":lt=Dd;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":lt=Vd;break;case $e:case af:case bf:lt=Hd;break;case cf:lt=Xd;break;case"scroll":lt=vd;break;case"wheel":lt=Zd;break;case"copy":case"cut":case"paste":lt=Jd;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":lt=Td}var mt=(e&4)!==0,vt=!mt&&o==="scroll",tt=mt?at!==null?at+"Capture":null:at;mt=[];for(var nt=$,ot;nt!==null;){ot=nt;var ht=ot.stateNode;if(ot.tag===5&&ht!==null&&(ot=ht,tt!==null&&(ht=Kb(nt,tt),ht!=null&&mt.push(tf(nt,ht,ot)))),vt)break;nt=nt.return}0<mt.length&&(at=new lt(at,dt,null,s,_e),it.push({event:at,listeners:mt}))}}if(!(e&7)){e:{if(at=o==="mouseover"||o==="pointerover",lt=o==="mouseout"||o==="pointerout",at&&s!==wb&&(dt=s.relatedTarget||s.fromElement)&&(Wc(dt)||dt[uf]))break e;if((lt||at)&&(at=_e.window===_e?_e:(at=_e.ownerDocument)?at.defaultView||at.parentWindow:window,lt?(dt=s.relatedTarget||s.toElement,lt=$,dt=dt?Wc(dt):null,dt!==null&&(vt=Vb(dt),dt!==vt||dt.tag!==5&&dt.tag!==6)&&(dt=null)):(lt=null,dt=$),lt!==dt)){if(mt=Bd,ht="onMouseLeave",tt="onMouseEnter",nt="mouse",(o==="pointerout"||o==="pointerover")&&(mt=Td,ht="onPointerLeave",tt="onPointerEnter",nt="pointer"),vt=lt==null?at:ue(lt),ot=dt==null?at:ue(dt),at=new mt(ht,nt+"leave",lt,s,_e),at.target=vt,at.relatedTarget=ot,ht=null,Wc(_e)===$&&(mt=new mt(tt,nt+"enter",dt,s,_e),mt.target=ot,mt.relatedTarget=vt,ht=mt),vt=ht,lt&&dt)t:{for(mt=lt,tt=dt,nt=0,ot=mt;ot;ot=vf(ot))nt++;for(ot=0,ht=tt;ht;ht=vf(ht))ot++;for(;0<nt-ot;)mt=vf(mt),nt--;for(;0<ot-nt;)tt=vf(tt),ot--;for(;nt--;){if(mt===tt||tt!==null&&mt===tt.alternate)break t;mt=vf(mt),tt=vf(tt)}mt=null}else mt=null;lt!==null&&wf(it,at,lt,mt,!1),dt!==null&&vt!==null&&wf(it,vt,dt,mt,!0)}}e:{if(at=$?ue($):window,lt=at.nodeName&&at.nodeName.toLowerCase(),lt==="select"||lt==="input"&&at.type==="file")var xt=ve;else if(me(at))if(we)xt=Fe;else{xt=De;var Et=Ce}else(lt=at.nodeName)&<.toLowerCase()==="input"&&(at.type==="checkbox"||at.type==="radio")&&(xt=Ee);if(xt&&(xt=xt(o,$))){ne(it,xt,s,_e);break e}Et&&Et(o,at,$),o==="focusout"&&(Et=at._wrapperState)&&Et.controlled&&at.type==="number"&&cb(at,"number",at.value)}switch(Et=$?ue($):window,o){case"focusin":(me(Et)||Et.contentEditable==="true")&&(Qe=Et,Re=$,Se=null);break;case"focusout":Se=Re=Qe=null;break;case"mousedown":Te=!0;break;case"contextmenu":case"mouseup":case"dragend":Te=!1,Ue(it,s,_e);break;case"selectionchange":if(Pe)break;case"keydown":case"keyup":Ue(it,s,_e)}var _t;if(ae)e:{switch(o){case"compositionstart":var Rt="onCompositionStart";break e;case"compositionend":Rt="onCompositionEnd";break e;case"compositionupdate":Rt="onCompositionUpdate";break e}Rt=void 0}else ie?ge(o,s)&&(Rt="onCompositionEnd"):o==="keydown"&&s.keyCode===229&&(Rt="onCompositionStart");Rt&&(de&&s.locale!=="ko"&&(ie||Rt!=="onCompositionStart"?Rt==="onCompositionEnd"&&ie&&(_t=nd()):(kd=_e,ld="value"in kd?kd.value:kd.textContent,ie=!0)),Et=oe($,Rt),0<Et.length&&(Rt=new Ld(Rt,o,null,s,_e),it.push({event:Rt,listeners:Et}),_t?Rt.data=_t:(_t=he(s),_t!==null&&(Rt.data=_t)))),(_t=ce?je(o,s):ke(o,s))&&($=oe($,"onBeforeInput"),0<$.length&&(_e=new Ld("onBeforeInput","beforeinput",null,s,_e),it.push({event:_e,listeners:$}),_e.data=_t))}se(it,e)})}function tf(o,e,s){return{instance:o,listener:e,currentTarget:s}}function oe(o,e){for(var s=e+"Capture",a=[];o!==null;){var c=o,d=c.stateNode;c.tag===5&&d!==null&&(c=d,d=Kb(o,s),d!=null&&a.unshift(tf(o,d,c)),d=Kb(o,e),d!=null&&a.push(tf(o,d,c))),o=o.return}return a}function vf(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5);return o||null}function wf(o,e,s,a,c){for(var d=e._reactName,h=[];s!==null&&s!==a;){var b=s,j=b.alternate,$=b.stateNode;if(j!==null&&j===a)break;b.tag===5&&$!==null&&(b=$,c?(j=Kb(s,d),j!=null&&h.unshift(tf(s,j,b))):c||(j=Kb(s,d),j!=null&&h.push(tf(s,j,b)))),s=s.return}h.length!==0&&o.push({event:e,listeners:h})}var xf=/\r\n?/g,yf=/\u0000|\uFFFD/g;function zf(o){return(typeof o=="string"?o:""+o).replace(xf,`
`).replace(yf,"")}function Af(o,e,s){if(e=zf(e),zf(o)!==e&&s)throw Error(p(425))}function Bf(){}var Cf=null,Df=null;function Ef(o,e){return o==="textarea"||o==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var Ff=typeof setTimeout=="function"?setTimeout:void 0,Gf=typeof clearTimeout=="function"?clearTimeout:void 0,Hf=typeof Promise=="function"?Promise:void 0,Jf=typeof queueMicrotask=="function"?queueMicrotask:typeof Hf<"u"?function(o){return Hf.resolve(null).then(o).catch(If)}:Ff;function If(o){setTimeout(function(){throw o})}function Kf(o,e){var s=e,a=0;do{var c=s.nextSibling;if(o.removeChild(s),c&&c.nodeType===8)if(s=c.data,s==="/$"){if(a===0){o.removeChild(c),bd(e);return}a--}else s!=="$"&&s!=="$?"&&s!=="$!"||a++;s=c}while(s);bd(e)}function Lf(o){for(;o!=null;o=o.nextSibling){var e=o.nodeType;if(e===1||e===3)break;if(e===8){if(e=o.data,e==="$"||e==="$!"||e==="$?")break;if(e==="/$")return null}}return o}function Mf(o){o=o.previousSibling;for(var e=0;o;){if(o.nodeType===8){var s=o.data;if(s==="$"||s==="$!"||s==="$?"){if(e===0)return o;e--}else s==="/$"&&e++}o=o.previousSibling}return null}var Nf=Math.random().toString(36).slice(2),Of="__reactFiber$"+Nf,Pf="__reactProps$"+Nf,uf="__reactContainer$"+Nf,of="__reactEvents$"+Nf,Qf="__reactListeners$"+Nf,Rf="__reactHandles$"+Nf;function Wc(o){var e=o[Of];if(e)return e;for(var s=o.parentNode;s;){if(e=s[uf]||s[Of]){if(s=e.alternate,e.child!==null||s!==null&&s.child!==null)for(o=Mf(o);o!==null;){if(s=o[Of])return s;o=Mf(o)}return e}o=s,s=o.parentNode}return null}function Cb(o){return o=o[Of]||o[uf],!o||o.tag!==5&&o.tag!==6&&o.tag!==13&&o.tag!==3?null:o}function ue(o){if(o.tag===5||o.tag===6)return o.stateNode;throw Error(p(33))}function Db(o){return o[Pf]||null}var Sf=[],Tf=-1;function Uf(o){return{current:o}}function E(o){0>Tf||(o.current=Sf[Tf],Sf[Tf]=null,Tf--)}function G(o,e){Tf++,Sf[Tf]=o.current,o.current=e}var Vf={},H=Uf(Vf),Wf=Uf(!1),Xf=Vf;function Yf(o,e){var s=o.type.contextTypes;if(!s)return Vf;var a=o.stateNode;if(a&&a.__reactInternalMemoizedUnmaskedChildContext===e)return a.__reactInternalMemoizedMaskedChildContext;var c={},d;for(d in s)c[d]=e[d];return a&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=e,o.__reactInternalMemoizedMaskedChildContext=c),c}function Zf(o){return o=o.childContextTypes,o!=null}function $f(){E(Wf),E(H)}function ag(o,e,s){if(H.current!==Vf)throw Error(p(168));G(H,e),G(Wf,s)}function bg(o,e,s){var a=o.stateNode;if(e=e.childContextTypes,typeof a.getChildContext!="function")return s;a=a.getChildContext();for(var c in a)if(!(c in e))throw Error(p(108,Ra(o)||"Unknown",c));return A({},s,a)}function cg(o){return o=(o=o.stateNode)&&o.__reactInternalMemoizedMergedChildContext||Vf,Xf=H.current,G(H,o),G(Wf,Wf.current),!0}function dg(o,e,s){var a=o.stateNode;if(!a)throw Error(p(169));s?(o=bg(o,e,Xf),a.__reactInternalMemoizedMergedChildContext=o,E(Wf),E(H),G(H,o)):E(Wf),G(Wf,s)}var eg=null,fg=!1,gg=!1;function hg(o){eg===null?eg=[o]:eg.push(o)}function ig(o){fg=!0,hg(o)}function jg(){if(!gg&&eg!==null){gg=!0;var o=0,e=C;try{var s=eg;for(C=1;o<s.length;o++){var a=s[o];do a=a(!0);while(a!==null)}eg=null,fg=!1}catch(c){throw eg!==null&&(eg=eg.slice(o+1)),ac(fc,jg),c}finally{C=e,gg=!1}}return null}var kg=[],lg=0,mg=null,ng=0,og=[],pg=0,qg=null,rg=1,sg="";function tg(o,e){kg[lg++]=ng,kg[lg++]=mg,mg=o,ng=e}function ug(o,e,s){og[pg++]=rg,og[pg++]=sg,og[pg++]=qg,qg=o;var a=rg;o=sg;var c=32-oc(a)-1;a&=~(1<<c),s+=1;var d=32-oc(e)+c;if(30<d){var h=c-c%5;d=(a&(1<<h)-1).toString(32),a>>=h,c-=h,rg=1<<32-oc(e)+c|s<<c|a,sg=d+o}else rg=1<<d|s<<c|a,sg=o}function vg(o){o.return!==null&&(tg(o,1),ug(o,1,0))}function wg(o){for(;o===mg;)mg=kg[--lg],kg[lg]=null,ng=kg[--lg],kg[lg]=null;for(;o===qg;)qg=og[--pg],og[pg]=null,sg=og[--pg],og[pg]=null,rg=og[--pg],og[pg]=null}var xg=null,yg=null,I=!1,zg=null;function Ag(o,e){var s=Bg(5,null,null,0);s.elementType="DELETED",s.stateNode=e,s.return=o,e=o.deletions,e===null?(o.deletions=[s],o.flags|=16):e.push(s)}function Cg(o,e){switch(o.tag){case 5:var s=o.type;return e=e.nodeType!==1||s.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(o.stateNode=e,xg=o,yg=Lf(e.firstChild),!0):!1;case 6:return e=o.pendingProps===""||e.nodeType!==3?null:e,e!==null?(o.stateNode=e,xg=o,yg=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(s=qg!==null?{id:rg,overflow:sg}:null,o.memoizedState={dehydrated:e,treeContext:s,retryLane:1073741824},s=Bg(18,null,null,0),s.stateNode=e,s.return=o,o.child=s,xg=o,yg=null,!0):!1;default:return!1}}function Dg(o){return(o.mode&1)!==0&&(o.flags&128)===0}function Eg(o){if(I){var e=yg;if(e){var s=e;if(!Cg(o,e)){if(Dg(o))throw Error(p(418));e=Lf(s.nextSibling);var a=xg;e&&Cg(o,e)?Ag(a,s):(o.flags=o.flags&-4097|2,I=!1,xg=o)}}else{if(Dg(o))throw Error(p(418));o.flags=o.flags&-4097|2,I=!1,xg=o}}}function Fg(o){for(o=o.return;o!==null&&o.tag!==5&&o.tag!==3&&o.tag!==13;)o=o.return;xg=o}function Gg(o){if(o!==xg)return!1;if(!I)return Fg(o),I=!0,!1;var e;if((e=o.tag!==3)&&!(e=o.tag!==5)&&(e=o.type,e=e!=="head"&&e!=="body"&&!Ef(o.type,o.memoizedProps)),e&&(e=yg)){if(Dg(o))throw Hg(),Error(p(418));for(;e;)Ag(o,e),e=Lf(e.nextSibling)}if(Fg(o),o.tag===13){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(p(317));e:{for(o=o.nextSibling,e=0;o;){if(o.nodeType===8){var s=o.data;if(s==="/$"){if(e===0){yg=Lf(o.nextSibling);break e}e--}else s!=="$"&&s!=="$!"&&s!=="$?"||e++}o=o.nextSibling}yg=null}}else yg=xg?Lf(o.stateNode.nextSibling):null;return!0}function Hg(){for(var o=yg;o;)o=Lf(o.nextSibling)}function Ig(){yg=xg=null,I=!1}function Jg(o){zg===null?zg=[o]:zg.push(o)}var Kg=ua.ReactCurrentBatchConfig;function Lg(o,e,s){if(o=s.ref,o!==null&&typeof o!="function"&&typeof o!="object"){if(s._owner){if(s=s._owner,s){if(s.tag!==1)throw Error(p(309));var a=s.stateNode}if(!a)throw Error(p(147,o));var c=a,d=""+o;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===d?e.ref:(e=function(h){var b=c.refs;h===null?delete b[d]:b[d]=h},e._stringRef=d,e)}if(typeof o!="string")throw Error(p(284));if(!s._owner)throw Error(p(290,o))}return o}function Mg(o,e){throw o=Object.prototype.toString.call(e),Error(p(31,o==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":o))}function Ng(o){var e=o._init;return e(o._payload)}function Og(o){function e(tt,nt){if(o){var ot=tt.deletions;ot===null?(tt.deletions=[nt],tt.flags|=16):ot.push(nt)}}function s(tt,nt){if(!o)return null;for(;nt!==null;)e(tt,nt),nt=nt.sibling;return null}function a(tt,nt){for(tt=new Map;nt!==null;)nt.key!==null?tt.set(nt.key,nt):tt.set(nt.index,nt),nt=nt.sibling;return tt}function c(tt,nt){return tt=Pg(tt,nt),tt.index=0,tt.sibling=null,tt}function d(tt,nt,ot){return tt.index=ot,o?(ot=tt.alternate,ot!==null?(ot=ot.index,ot<nt?(tt.flags|=2,nt):ot):(tt.flags|=2,nt)):(tt.flags|=1048576,nt)}function h(tt){return o&&tt.alternate===null&&(tt.flags|=2),tt}function b(tt,nt,ot,ht){return nt===null||nt.tag!==6?(nt=Qg(ot,tt.mode,ht),nt.return=tt,nt):(nt=c(nt,ot),nt.return=tt,nt)}function j(tt,nt,ot,ht){var xt=ot.type;return xt===ya?_e(tt,nt,ot.props.children,ht,ot.key):nt!==null&&(nt.elementType===xt||typeof xt=="object"&&xt!==null&&xt.$$typeof===Ha&&Ng(xt)===nt.type)?(ht=c(nt,ot.props),ht.ref=Lg(tt,nt,ot),ht.return=tt,ht):(ht=Rg(ot.type,ot.key,ot.props,null,tt.mode,ht),ht.ref=Lg(tt,nt,ot),ht.return=tt,ht)}function $(tt,nt,ot,ht){return nt===null||nt.tag!==4||nt.stateNode.containerInfo!==ot.containerInfo||nt.stateNode.implementation!==ot.implementation?(nt=Sg(ot,tt.mode,ht),nt.return=tt,nt):(nt=c(nt,ot.children||[]),nt.return=tt,nt)}function _e(tt,nt,ot,ht,xt){return nt===null||nt.tag!==7?(nt=Tg(ot,tt.mode,ht,xt),nt.return=tt,nt):(nt=c(nt,ot),nt.return=tt,nt)}function it(tt,nt,ot){if(typeof nt=="string"&&nt!==""||typeof nt=="number")return nt=Qg(""+nt,tt.mode,ot),nt.return=tt,nt;if(typeof nt=="object"&&nt!==null){switch(nt.$$typeof){case va:return ot=Rg(nt.type,nt.key,nt.props,null,tt.mode,ot),ot.ref=Lg(tt,null,nt),ot.return=tt,ot;case wa:return nt=Sg(nt,tt.mode,ot),nt.return=tt,nt;case Ha:var ht=nt._init;return it(tt,ht(nt._payload),ot)}if(eb(nt)||Ka(nt))return nt=Tg(nt,tt.mode,ot,null),nt.return=tt,nt;Mg(tt,nt)}return null}function at(tt,nt,ot,ht){var xt=nt!==null?nt.key:null;if(typeof ot=="string"&&ot!==""||typeof ot=="number")return xt!==null?null:b(tt,nt,""+ot,ht);if(typeof ot=="object"&&ot!==null){switch(ot.$$typeof){case va:return ot.key===xt?j(tt,nt,ot,ht):null;case wa:return ot.key===xt?$(tt,nt,ot,ht):null;case Ha:return xt=ot._init,at(tt,nt,xt(ot._payload),ht)}if(eb(ot)||Ka(ot))return xt!==null?null:_e(tt,nt,ot,ht,null);Mg(tt,ot)}return null}function lt(tt,nt,ot,ht,xt){if(typeof ht=="string"&&ht!==""||typeof ht=="number")return tt=tt.get(ot)||null,b(nt,tt,""+ht,xt);if(typeof ht=="object"&&ht!==null){switch(ht.$$typeof){case va:return tt=tt.get(ht.key===null?ot:ht.key)||null,j(nt,tt,ht,xt);case wa:return tt=tt.get(ht.key===null?ot:ht.key)||null,$(nt,tt,ht,xt);case Ha:var Et=ht._init;return lt(tt,nt,ot,Et(ht._payload),xt)}if(eb(ht)||Ka(ht))return tt=tt.get(ot)||null,_e(nt,tt,ht,xt,null);Mg(nt,ht)}return null}function dt(tt,nt,ot,ht){for(var xt=null,Et=null,_t=nt,Rt=nt=0,Bt=null;_t!==null&&Rt<ot.length;Rt++){_t.index>Rt?(Bt=_t,_t=null):Bt=_t.sibling;var Mt=at(tt,_t,ot[Rt],ht);if(Mt===null){_t===null&&(_t=Bt);break}o&&_t&&Mt.alternate===null&&e(tt,_t),nt=d(Mt,nt,Rt),Et===null?xt=Mt:Et.sibling=Mt,Et=Mt,_t=Bt}if(Rt===ot.length)return s(tt,_t),I&&tg(tt,Rt),xt;if(_t===null){for(;Rt<ot.length;Rt++)_t=it(tt,ot[Rt],ht),_t!==null&&(nt=d(_t,nt,Rt),Et===null?xt=_t:Et.sibling=_t,Et=_t);return I&&tg(tt,Rt),xt}for(_t=a(tt,_t);Rt<ot.length;Rt++)Bt=lt(_t,tt,Rt,ot[Rt],ht),Bt!==null&&(o&&Bt.alternate!==null&&_t.delete(Bt.key===null?Rt:Bt.key),nt=d(Bt,nt,Rt),Et===null?xt=Bt:Et.sibling=Bt,Et=Bt);return o&&_t.forEach(function(Ht){return e(tt,Ht)}),I&&tg(tt,Rt),xt}function mt(tt,nt,ot,ht){var xt=Ka(ot);if(typeof xt!="function")throw Error(p(150));if(ot=xt.call(ot),ot==null)throw Error(p(151));for(var Et=xt=null,_t=nt,Rt=nt=0,Bt=null,Mt=ot.next();_t!==null&&!Mt.done;Rt++,Mt=ot.next()){_t.index>Rt?(Bt=_t,_t=null):Bt=_t.sibling;var Ht=at(tt,_t,Mt.value,ht);if(Ht===null){_t===null&&(_t=Bt);break}o&&_t&&Ht.alternate===null&&e(tt,_t),nt=d(Ht,nt,Rt),Et===null?xt=Ht:Et.sibling=Ht,Et=Ht,_t=Bt}if(Mt.done)return s(tt,_t),I&&tg(tt,Rt),xt;if(_t===null){for(;!Mt.done;Rt++,Mt=ot.next())Mt=it(tt,Mt.value,ht),Mt!==null&&(nt=d(Mt,nt,Rt),Et===null?xt=Mt:Et.sibling=Mt,Et=Mt);return I&&tg(tt,Rt),xt}for(_t=a(tt,_t);!Mt.done;Rt++,Mt=ot.next())Mt=lt(_t,tt,Rt,Mt.value,ht),Mt!==null&&(o&&Mt.alternate!==null&&_t.delete(Mt.key===null?Rt:Mt.key),nt=d(Mt,nt,Rt),Et===null?xt=Mt:Et.sibling=Mt,Et=Mt);return o&&_t.forEach(function(er){return e(tt,er)}),I&&tg(tt,Rt),xt}function vt(tt,nt,ot,ht){if(typeof ot=="object"&&ot!==null&&ot.type===ya&&ot.key===null&&(ot=ot.props.children),typeof ot=="object"&&ot!==null){switch(ot.$$typeof){case va:e:{for(var xt=ot.key,Et=nt;Et!==null;){if(Et.key===xt){if(xt=ot.type,xt===ya){if(Et.tag===7){s(tt,Et.sibling),nt=c(Et,ot.props.children),nt.return=tt,tt=nt;break e}}else if(Et.elementType===xt||typeof xt=="object"&&xt!==null&&xt.$$typeof===Ha&&Ng(xt)===Et.type){s(tt,Et.sibling),nt=c(Et,ot.props),nt.ref=Lg(tt,Et,ot),nt.return=tt,tt=nt;break e}s(tt,Et);break}else e(tt,Et);Et=Et.sibling}ot.type===ya?(nt=Tg(ot.props.children,tt.mode,ht,ot.key),nt.return=tt,tt=nt):(ht=Rg(ot.type,ot.key,ot.props,null,tt.mode,ht),ht.ref=Lg(tt,nt,ot),ht.return=tt,tt=ht)}return h(tt);case wa:e:{for(Et=ot.key;nt!==null;){if(nt.key===Et)if(nt.tag===4&&nt.stateNode.containerInfo===ot.containerInfo&&nt.stateNode.implementation===ot.implementation){s(tt,nt.sibling),nt=c(nt,ot.children||[]),nt.return=tt,tt=nt;break e}else{s(tt,nt);break}else e(tt,nt);nt=nt.sibling}nt=Sg(ot,tt.mode,ht),nt.return=tt,tt=nt}return h(tt);case Ha:return Et=ot._init,vt(tt,nt,Et(ot._payload),ht)}if(eb(ot))return dt(tt,nt,ot,ht);if(Ka(ot))return mt(tt,nt,ot,ht);Mg(tt,ot)}return typeof ot=="string"&&ot!==""||typeof ot=="number"?(ot=""+ot,nt!==null&&nt.tag===6?(s(tt,nt.sibling),nt=c(nt,ot),nt.return=tt,tt=nt):(s(tt,nt),nt=Qg(ot,tt.mode,ht),nt.return=tt,tt=nt),h(tt)):s(tt,nt)}return vt}var Ug=Og(!0),Vg=Og(!1),Wg=Uf(null),Xg=null,Yg=null,Zg=null;function $g(){Zg=Yg=Xg=null}function ah(o){var e=Wg.current;E(Wg),o._currentValue=e}function bh(o,e,s){for(;o!==null;){var a=o.alternate;if((o.childLanes&e)!==e?(o.childLanes|=e,a!==null&&(a.childLanes|=e)):a!==null&&(a.childLanes&e)!==e&&(a.childLanes|=e),o===s)break;o=o.return}}function ch(o,e){Xg=o,Zg=Yg=null,o=o.dependencies,o!==null&&o.firstContext!==null&&(o.lanes&e&&(dh=!0),o.firstContext=null)}function eh(o){var e=o._currentValue;if(Zg!==o)if(o={context:o,memoizedValue:e,next:null},Yg===null){if(Xg===null)throw Error(p(308));Yg=o,Xg.dependencies={lanes:0,firstContext:o}}else Yg=Yg.next=o;return e}var fh=null;function gh(o){fh===null?fh=[o]:fh.push(o)}function hh(o,e,s,a){var c=e.interleaved;return c===null?(s.next=s,gh(e)):(s.next=c.next,c.next=s),e.interleaved=s,ih(o,a)}function ih(o,e){o.lanes|=e;var s=o.alternate;for(s!==null&&(s.lanes|=e),s=o,o=o.return;o!==null;)o.childLanes|=e,s=o.alternate,s!==null&&(s.childLanes|=e),s=o,o=o.return;return s.tag===3?s.stateNode:null}var jh=!1;function kh(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function lh(o,e){o=o.updateQueue,e.updateQueue===o&&(e.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,effects:o.effects})}function mh(o,e){return{eventTime:o,lane:e,tag:0,payload:null,callback:null,next:null}}function nh(o,e,s){var a=o.updateQueue;if(a===null)return null;if(a=a.shared,K&2){var c=a.pending;return c===null?e.next=e:(e.next=c.next,c.next=e),a.pending=e,ih(o,s)}return c=a.interleaved,c===null?(e.next=e,gh(a)):(e.next=c.next,c.next=e),a.interleaved=e,ih(o,s)}function oh(o,e,s){if(e=e.updateQueue,e!==null&&(e=e.shared,(s&4194240)!==0)){var a=e.lanes;a&=o.pendingLanes,s|=a,e.lanes=s,Cc(o,s)}}function ph(o,e){var s=o.updateQueue,a=o.alternate;if(a!==null&&(a=a.updateQueue,s===a)){var c=null,d=null;if(s=s.firstBaseUpdate,s!==null){do{var h={eventTime:s.eventTime,lane:s.lane,tag:s.tag,payload:s.payload,callback:s.callback,next:null};d===null?c=d=h:d=d.next=h,s=s.next}while(s!==null);d===null?c=d=e:d=d.next=e}else c=d=e;s={baseState:a.baseState,firstBaseUpdate:c,lastBaseUpdate:d,shared:a.shared,effects:a.effects},o.updateQueue=s;return}o=s.lastBaseUpdate,o===null?s.firstBaseUpdate=e:o.next=e,s.lastBaseUpdate=e}function qh(o,e,s,a){var c=o.updateQueue;jh=!1;var d=c.firstBaseUpdate,h=c.lastBaseUpdate,b=c.shared.pending;if(b!==null){c.shared.pending=null;var j=b,$=j.next;j.next=null,h===null?d=$:h.next=$,h=j;var _e=o.alternate;_e!==null&&(_e=_e.updateQueue,b=_e.lastBaseUpdate,b!==h&&(b===null?_e.firstBaseUpdate=$:b.next=$,_e.lastBaseUpdate=j))}if(d!==null){var it=c.baseState;h=0,_e=$=j=null,b=d;do{var at=b.lane,lt=b.eventTime;if((a&at)===at){_e!==null&&(_e=_e.next={eventTime:lt,lane:0,tag:b.tag,payload:b.payload,callback:b.callback,next:null});e:{var dt=o,mt=b;switch(at=e,lt=s,mt.tag){case 1:if(dt=mt.payload,typeof dt=="function"){it=dt.call(lt,it,at);break e}it=dt;break e;case 3:dt.flags=dt.flags&-65537|128;case 0:if(dt=mt.payload,at=typeof dt=="function"?dt.call(lt,it,at):dt,at==null)break e;it=A({},it,at);break e;case 2:jh=!0}}b.callback!==null&&b.lane!==0&&(o.flags|=64,at=c.effects,at===null?c.effects=[b]:at.push(b))}else lt={eventTime:lt,lane:at,tag:b.tag,payload:b.payload,callback:b.callback,next:null},_e===null?($=_e=lt,j=it):_e=_e.next=lt,h|=at;if(b=b.next,b===null){if(b=c.shared.pending,b===null)break;at=b,b=at.next,at.next=null,c.lastBaseUpdate=at,c.shared.pending=null}}while(!0);if(_e===null&&(j=it),c.baseState=j,c.firstBaseUpdate=$,c.lastBaseUpdate=_e,e=c.shared.interleaved,e!==null){c=e;do h|=c.lane,c=c.next;while(c!==e)}else d===null&&(c.shared.lanes=0);rh|=h,o.lanes=h,o.memoizedState=it}}function sh(o,e,s){if(o=e.effects,e.effects=null,o!==null)for(e=0;e<o.length;e++){var a=o[e],c=a.callback;if(c!==null){if(a.callback=null,a=s,typeof c!="function")throw Error(p(191,c));c.call(a)}}}var th={},uh=Uf(th),vh=Uf(th),wh=Uf(th);function xh(o){if(o===th)throw Error(p(174));return o}function yh(o,e){switch(G(wh,e),G(vh,o),G(uh,th),o=e.nodeType,o){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:lb(null,"");break;default:o=o===8?e.parentNode:e,e=o.namespaceURI||null,o=o.tagName,e=lb(e,o)}E(uh),G(uh,e)}function zh(){E(uh),E(vh),E(wh)}function Ah(o){xh(wh.current);var e=xh(uh.current),s=lb(e,o.type);e!==s&&(G(vh,o),G(uh,s))}function Bh(o){vh.current===o&&(E(uh),E(vh))}var L=Uf(0);function Ch(o){for(var e=o;e!==null;){if(e.tag===13){var s=e.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||s.data==="$?"||s.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===o)break;for(;e.sibling===null;){if(e.return===null||e.return===o)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var Dh=[];function Eh(){for(var o=0;o<Dh.length;o++)Dh[o]._workInProgressVersionPrimary=null;Dh.length=0}var Fh=ua.ReactCurrentDispatcher,Gh=ua.ReactCurrentBatchConfig,Hh=0,M=null,N=null,O=null,Ih=!1,Jh=!1,Kh=0,Lh=0;function P(){throw Error(p(321))}function Mh(o,e){if(e===null)return!1;for(var s=0;s<e.length&&s<o.length;s++)if(!He(o[s],e[s]))return!1;return!0}function Nh(o,e,s,a,c,d){if(Hh=d,M=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,Fh.current=o===null||o.memoizedState===null?Oh:Ph,o=s(a,c),Jh){d=0;do{if(Jh=!1,Kh=0,25<=d)throw Error(p(301));d+=1,O=N=null,e.updateQueue=null,Fh.current=Qh,o=s(a,c)}while(Jh)}if(Fh.current=Rh,e=N!==null&&N.next!==null,Hh=0,O=N=M=null,Ih=!1,e)throw Error(p(300));return o}function Sh(){var o=Kh!==0;return Kh=0,o}function Th(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return O===null?M.memoizedState=O=o:O=O.next=o,O}function Uh(){if(N===null){var o=M.alternate;o=o!==null?o.memoizedState:null}else o=N.next;var e=O===null?M.memoizedState:O.next;if(e!==null)O=e,N=o;else{if(o===null)throw Error(p(310));N=o,o={memoizedState:N.memoizedState,baseState:N.baseState,baseQueue:N.baseQueue,queue:N.queue,next:null},O===null?M.memoizedState=O=o:O=O.next=o}return O}function Vh(o,e){return typeof e=="function"?e(o):e}function Wh(o){var e=Uh(),s=e.queue;if(s===null)throw Error(p(311));s.lastRenderedReducer=o;var a=N,c=a.baseQueue,d=s.pending;if(d!==null){if(c!==null){var h=c.next;c.next=d.next,d.next=h}a.baseQueue=c=d,s.pending=null}if(c!==null){d=c.next,a=a.baseState;var b=h=null,j=null,$=d;do{var _e=$.lane;if((Hh&_e)===_e)j!==null&&(j=j.next={lane:0,action:$.action,hasEagerState:$.hasEagerState,eagerState:$.eagerState,next:null}),a=$.hasEagerState?$.eagerState:o(a,$.action);else{var it={lane:_e,action:$.action,hasEagerState:$.hasEagerState,eagerState:$.eagerState,next:null};j===null?(b=j=it,h=a):j=j.next=it,M.lanes|=_e,rh|=_e}$=$.next}while($!==null&&$!==d);j===null?h=a:j.next=b,He(a,e.memoizedState)||(dh=!0),e.memoizedState=a,e.baseState=h,e.baseQueue=j,s.lastRenderedState=a}if(o=s.interleaved,o!==null){c=o;do d=c.lane,M.lanes|=d,rh|=d,c=c.next;while(c!==o)}else c===null&&(s.lanes=0);return[e.memoizedState,s.dispatch]}function Xh(o){var e=Uh(),s=e.queue;if(s===null)throw Error(p(311));s.lastRenderedReducer=o;var a=s.dispatch,c=s.pending,d=e.memoizedState;if(c!==null){s.pending=null;var h=c=c.next;do d=o(d,h.action),h=h.next;while(h!==c);He(d,e.memoizedState)||(dh=!0),e.memoizedState=d,e.baseQueue===null&&(e.baseState=d),s.lastRenderedState=d}return[d,a]}function Yh(){}function Zh(o,e){var s=M,a=Uh(),c=e(),d=!He(a.memoizedState,c);if(d&&(a.memoizedState=c,dh=!0),a=a.queue,$h(ai.bind(null,s,a,o),[o]),a.getSnapshot!==e||d||O!==null&&O.memoizedState.tag&1){if(s.flags|=2048,bi(9,ci.bind(null,s,a,c,e),void 0,null),Q===null)throw Error(p(349));Hh&30||di(s,e,c)}return c}function di(o,e,s){o.flags|=16384,o={getSnapshot:e,value:s},e=M.updateQueue,e===null?(e={lastEffect:null,stores:null},M.updateQueue=e,e.stores=[o]):(s=e.stores,s===null?e.stores=[o]:s.push(o))}function ci(o,e,s,a){e.value=s,e.getSnapshot=a,ei(e)&&fi(o)}function ai(o,e,s){return s(function(){ei(e)&&fi(o)})}function ei(o){var e=o.getSnapshot;o=o.value;try{var s=e();return!He(o,s)}catch{return!0}}function fi(o){var e=ih(o,1);e!==null&&gi(e,o,1,-1)}function hi(o){var e=Th();return typeof o=="function"&&(o=o()),e.memoizedState=e.baseState=o,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Vh,lastRenderedState:o},e.queue=o,o=o.dispatch=ii.bind(null,M,o),[e.memoizedState,o]}function bi(o,e,s,a){return o={tag:o,create:e,destroy:s,deps:a,next:null},e=M.updateQueue,e===null?(e={lastEffect:null,stores:null},M.updateQueue=e,e.lastEffect=o.next=o):(s=e.lastEffect,s===null?e.lastEffect=o.next=o:(a=s.next,s.next=o,o.next=a,e.lastEffect=o)),o}function ji(){return Uh().memoizedState}function ki(o,e,s,a){var c=Th();M.flags|=o,c.memoizedState=bi(1|e,s,void 0,a===void 0?null:a)}function li(o,e,s,a){var c=Uh();a=a===void 0?null:a;var d=void 0;if(N!==null){var h=N.memoizedState;if(d=h.destroy,a!==null&&Mh(a,h.deps)){c.memoizedState=bi(e,s,d,a);return}}M.flags|=o,c.memoizedState=bi(1|e,s,d,a)}function mi(o,e){return ki(8390656,8,o,e)}function $h(o,e){return li(2048,8,o,e)}function ni(o,e){return li(4,2,o,e)}function oi(o,e){return li(4,4,o,e)}function pi(o,e){if(typeof e=="function")return o=o(),e(o),function(){e(null)};if(e!=null)return o=o(),e.current=o,function(){e.current=null}}function qi(o,e,s){return s=s!=null?s.concat([o]):null,li(4,4,pi.bind(null,e,o),s)}function ri(){}function si(o,e){var s=Uh();e=e===void 0?null:e;var a=s.memoizedState;return a!==null&&e!==null&&Mh(e,a[1])?a[0]:(s.memoizedState=[o,e],o)}function ti(o,e){var s=Uh();e=e===void 0?null:e;var a=s.memoizedState;return a!==null&&e!==null&&Mh(e,a[1])?a[0]:(o=o(),s.memoizedState=[o,e],o)}function ui(o,e,s){return Hh&21?(He(s,e)||(s=yc(),M.lanes|=s,rh|=s,o.baseState=!0),e):(o.baseState&&(o.baseState=!1,dh=!0),o.memoizedState=s)}function vi(o,e){var s=C;C=s!==0&&4>s?s:4,o(!0);var a=Gh.transition;Gh.transition={};try{o(!1),e()}finally{C=s,Gh.transition=a}}function wi(){return Uh().memoizedState}function xi(o,e,s){var a=yi(o);if(s={lane:a,action:s,hasEagerState:!1,eagerState:null,next:null},zi(o))Ai(e,s);else if(s=hh(o,e,s,a),s!==null){var c=R();gi(s,o,a,c),Bi(s,e,a)}}function ii(o,e,s){var a=yi(o),c={lane:a,action:s,hasEagerState:!1,eagerState:null,next:null};if(zi(o))Ai(e,c);else{var d=o.alternate;if(o.lanes===0&&(d===null||d.lanes===0)&&(d=e.lastRenderedReducer,d!==null))try{var h=e.lastRenderedState,b=d(h,s);if(c.hasEagerState=!0,c.eagerState=b,He(b,h)){var j=e.interleaved;j===null?(c.next=c,gh(e)):(c.next=j.next,j.next=c),e.interleaved=c;return}}catch{}finally{}s=hh(o,e,c,a),s!==null&&(c=R(),gi(s,o,a,c),Bi(s,e,a))}}function zi(o){var e=o.alternate;return o===M||e!==null&&e===M}function Ai(o,e){Jh=Ih=!0;var s=o.pending;s===null?e.next=e:(e.next=s.next,s.next=e),o.pending=e}function Bi(o,e,s){if(s&4194240){var a=e.lanes;a&=o.pendingLanes,s|=a,e.lanes=s,Cc(o,s)}}var Rh={readContext:eh,useCallback:P,useContext:P,useEffect:P,useImperativeHandle:P,useInsertionEffect:P,useLayoutEffect:P,useMemo:P,useReducer:P,useRef:P,useState:P,useDebugValue:P,useDeferredValue:P,useTransition:P,useMutableSource:P,useSyncExternalStore:P,useId:P,unstable_isNewReconciler:!1},Oh={readContext:eh,useCallback:function(o,e){return Th().memoizedState=[o,e===void 0?null:e],o},useContext:eh,useEffect:mi,useImperativeHandle:function(o,e,s){return s=s!=null?s.concat([o]):null,ki(4194308,4,pi.bind(null,e,o),s)},useLayoutEffect:function(o,e){return ki(4194308,4,o,e)},useInsertionEffect:function(o,e){return ki(4,2,o,e)},useMemo:function(o,e){var s=Th();return e=e===void 0?null:e,o=o(),s.memoizedState=[o,e],o},useReducer:function(o,e,s){var a=Th();return e=s!==void 0?s(e):e,a.memoizedState=a.baseState=e,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:e},a.queue=o,o=o.dispatch=xi.bind(null,M,o),[a.memoizedState,o]},useRef:function(o){var e=Th();return o={current:o},e.memoizedState=o},useState:hi,useDebugValue:ri,useDeferredValue:function(o){return Th().memoizedState=o},useTransition:function(){var o=hi(!1),e=o[0];return o=vi.bind(null,o[1]),Th().memoizedState=o,[e,o]},useMutableSource:function(){},useSyncExternalStore:function(o,e,s){var a=M,c=Th();if(I){if(s===void 0)throw Error(p(407));s=s()}else{if(s=e(),Q===null)throw Error(p(349));Hh&30||di(a,e,s)}c.memoizedState=s;var d={value:s,getSnapshot:e};return c.queue=d,mi(ai.bind(null,a,d,o),[o]),a.flags|=2048,bi(9,ci.bind(null,a,d,s,e),void 0,null),s},useId:function(){var o=Th(),e=Q.identifierPrefix;if(I){var s=sg,a=rg;s=(a&~(1<<32-oc(a)-1)).toString(32)+s,e=":"+e+"R"+s,s=Kh++,0<s&&(e+="H"+s.toString(32)),e+=":"}else s=Lh++,e=":"+e+"r"+s.toString(32)+":";return o.memoizedState=e},unstable_isNewReconciler:!1},Ph={readContext:eh,useCallback:si,useContext:eh,useEffect:$h,useImperativeHandle:qi,useInsertionEffect:ni,useLayoutEffect:oi,useMemo:ti,useReducer:Wh,useRef:ji,useState:function(){return Wh(Vh)},useDebugValue:ri,useDeferredValue:function(o){var e=Uh();return ui(e,N.memoizedState,o)},useTransition:function(){var o=Wh(Vh)[0],e=Uh().memoizedState;return[o,e]},useMutableSource:Yh,useSyncExternalStore:Zh,useId:wi,unstable_isNewReconciler:!1},Qh={readContext:eh,useCallback:si,useContext:eh,useEffect:$h,useImperativeHandle:qi,useInsertionEffect:ni,useLayoutEffect:oi,useMemo:ti,useReducer:Xh,useRef:ji,useState:function(){return Xh(Vh)},useDebugValue:ri,useDeferredValue:function(o){var e=Uh();return N===null?e.memoizedState=o:ui(e,N.memoizedState,o)},useTransition:function(){var o=Xh(Vh)[0],e=Uh().memoizedState;return[o,e]},useMutableSource:Yh,useSyncExternalStore:Zh,useId:wi,unstable_isNewReconciler:!1};function Ci(o,e){if(o&&o.defaultProps){e=A({},e),o=o.defaultProps;for(var s in o)e[s]===void 0&&(e[s]=o[s]);return e}return e}function Di(o,e,s,a){e=o.memoizedState,s=s(a,e),s=s==null?e:A({},e,s),o.memoizedState=s,o.lanes===0&&(o.updateQueue.baseState=s)}var Ei={isMounted:function(o){return(o=o._reactInternals)?Vb(o)===o:!1},enqueueSetState:function(o,e,s){o=o._reactInternals;var a=R(),c=yi(o),d=mh(a,c);d.payload=e,s!=null&&(d.callback=s),e=nh(o,d,c),e!==null&&(gi(e,o,c,a),oh(e,o,c))},enqueueReplaceState:function(o,e,s){o=o._reactInternals;var a=R(),c=yi(o),d=mh(a,c);d.tag=1,d.payload=e,s!=null&&(d.callback=s),e=nh(o,d,c),e!==null&&(gi(e,o,c,a),oh(e,o,c))},enqueueForceUpdate:function(o,e){o=o._reactInternals;var s=R(),a=yi(o),c=mh(s,a);c.tag=2,e!=null&&(c.callback=e),e=nh(o,c,a),e!==null&&(gi(e,o,a,s),oh(e,o,a))}};function Fi(o,e,s,a,c,d,h){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(a,d,h):e.prototype&&e.prototype.isPureReactComponent?!Ie(s,a)||!Ie(c,d):!0}function Gi(o,e,s){var a=!1,c=Vf,d=e.contextType;return typeof d=="object"&&d!==null?d=eh(d):(c=Zf(e)?Xf:H.current,a=e.contextTypes,d=(a=a!=null)?Yf(o,c):Vf),e=new e(s,d),o.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=Ei,o.stateNode=e,e._reactInternals=o,a&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=c,o.__reactInternalMemoizedMaskedChildContext=d),e}function Hi(o,e,s,a){o=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(s,a),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(s,a),e.state!==o&&Ei.enqueueReplaceState(e,e.state,null)}function Ii(o,e,s,a){var c=o.stateNode;c.props=s,c.state=o.memoizedState,c.refs={},kh(o);var d=e.contextType;typeof d=="object"&&d!==null?c.context=eh(d):(d=Zf(e)?Xf:H.current,c.context=Yf(o,d)),c.state=o.memoizedState,d=e.getDerivedStateFromProps,typeof d=="function"&&(Di(o,e,d,s),c.state=o.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof c.getSnapshotBeforeUpdate=="function"||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(e=c.state,typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount(),e!==c.state&&Ei.enqueueReplaceState(c,c.state,null),qh(o,s,c,a),c.state=o.memoizedState),typeof c.componentDidMount=="function"&&(o.flags|=4194308)}function Ji(o,e){try{var s="",a=e;do s+=Pa(a),a=a.return;while(a);var c=s}catch(d){c=`
Error generating stack: `+d.message+`
`+d.stack}return{value:o,source:e,stack:c,digest:null}}function Ki(o,e,s){return{value:o,source:null,stack:s??null,digest:e??null}}function Li(o,e){try{console.error(e.value)}catch(s){setTimeout(function(){throw s})}}var Mi=typeof WeakMap=="function"?WeakMap:Map;function Ni(o,e,s){s=mh(-1,s),s.tag=3,s.payload={element:null};var a=e.value;return s.callback=function(){Oi||(Oi=!0,Pi=a),Li(o,e)},s}function Qi(o,e,s){s=mh(-1,s),s.tag=3;var a=o.type.getDerivedStateFromError;if(typeof a=="function"){var c=e.value;s.payload=function(){return a(c)},s.callback=function(){Li(o,e)}}var d=o.stateNode;return d!==null&&typeof d.componentDidCatch=="function"&&(s.callback=function(){Li(o,e),typeof a!="function"&&(Ri===null?Ri=new Set([this]):Ri.add(this));var h=e.stack;this.componentDidCatch(e.value,{componentStack:h!==null?h:""})}),s}function Si(o,e,s){var a=o.pingCache;if(a===null){a=o.pingCache=new Mi;var c=new Set;a.set(e,c)}else c=a.get(e),c===void 0&&(c=new Set,a.set(e,c));c.has(s)||(c.add(s),o=Ti.bind(null,o,e,s),e.then(o,o))}function Ui(o){do{var e;if((e=o.tag===13)&&(e=o.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return o;o=o.return}while(o!==null);return null}function Vi(o,e,s,a,c){return o.mode&1?(o.flags|=65536,o.lanes=c,o):(o===e?o.flags|=65536:(o.flags|=128,s.flags|=131072,s.flags&=-52805,s.tag===1&&(s.alternate===null?s.tag=17:(e=mh(-1,1),e.tag=2,nh(s,e,1))),s.lanes|=1),o)}var Wi=ua.ReactCurrentOwner,dh=!1;function Xi(o,e,s,a){e.child=o===null?Vg(e,null,s,a):Ug(e,o.child,s,a)}function Yi(o,e,s,a,c){s=s.render;var d=e.ref;return ch(e,c),a=Nh(o,e,s,a,d,c),s=Sh(),o!==null&&!dh?(e.updateQueue=o.updateQueue,e.flags&=-2053,o.lanes&=~c,Zi(o,e,c)):(I&&s&&vg(e),e.flags|=1,Xi(o,e,a,c),e.child)}function $i(o,e,s,a,c){if(o===null){var d=s.type;return typeof d=="function"&&!aj(d)&&d.defaultProps===void 0&&s.compare===null&&s.defaultProps===void 0?(e.tag=15,e.type=d,bj(o,e,d,a,c)):(o=Rg(s.type,null,a,e,e.mode,c),o.ref=e.ref,o.return=e,e.child=o)}if(d=o.child,!(o.lanes&c)){var h=d.memoizedProps;if(s=s.compare,s=s!==null?s:Ie,s(h,a)&&o.ref===e.ref)return Zi(o,e,c)}return e.flags|=1,o=Pg(d,a),o.ref=e.ref,o.return=e,e.child=o}function bj(o,e,s,a,c){if(o!==null){var d=o.memoizedProps;if(Ie(d,a)&&o.ref===e.ref)if(dh=!1,e.pendingProps=a=d,(o.lanes&c)!==0)o.flags&131072&&(dh=!0);else return e.lanes=o.lanes,Zi(o,e,c)}return cj(o,e,s,a,c)}function dj(o,e,s){var a=e.pendingProps,c=a.children,d=o!==null?o.memoizedState:null;if(a.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},G(ej,fj),fj|=s;else{if(!(s&1073741824))return o=d!==null?d.baseLanes|s:s,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:o,cachePool:null,transitions:null},e.updateQueue=null,G(ej,fj),fj|=o,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},a=d!==null?d.baseLanes:s,G(ej,fj),fj|=a}else d!==null?(a=d.baseLanes|s,e.memoizedState=null):a=s,G(ej,fj),fj|=a;return Xi(o,e,c,s),e.child}function gj(o,e){var s=e.ref;(o===null&&s!==null||o!==null&&o.ref!==s)&&(e.flags|=512,e.flags|=2097152)}function cj(o,e,s,a,c){var d=Zf(s)?Xf:H.current;return d=Yf(e,d),ch(e,c),s=Nh(o,e,s,a,d,c),a=Sh(),o!==null&&!dh?(e.updateQueue=o.updateQueue,e.flags&=-2053,o.lanes&=~c,Zi(o,e,c)):(I&&a&&vg(e),e.flags|=1,Xi(o,e,s,c),e.child)}function hj(o,e,s,a,c){if(Zf(s)){var d=!0;cg(e)}else d=!1;if(ch(e,c),e.stateNode===null)ij(o,e),Gi(e,s,a),Ii(e,s,a,c),a=!0;else if(o===null){var h=e.stateNode,b=e.memoizedProps;h.props=b;var j=h.context,$=s.contextType;typeof $=="object"&&$!==null?$=eh($):($=Zf(s)?Xf:H.current,$=Yf(e,$));var _e=s.getDerivedStateFromProps,it=typeof _e=="function"||typeof h.getSnapshotBeforeUpdate=="function";it||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(b!==a||j!==$)&&Hi(e,h,a,$),jh=!1;var at=e.memoizedState;h.state=at,qh(e,a,h,c),j=e.memoizedState,b!==a||at!==j||Wf.current||jh?(typeof _e=="function"&&(Di(e,s,_e,a),j=e.memoizedState),(b=jh||Fi(e,s,b,a,at,j,$))?(it||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(e.flags|=4194308)):(typeof h.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=a,e.memoizedState=j),h.props=a,h.state=j,h.context=$,a=b):(typeof h.componentDidMount=="function"&&(e.flags|=4194308),a=!1)}else{h=e.stateNode,lh(o,e),b=e.memoizedProps,$=e.type===e.elementType?b:Ci(e.type,b),h.props=$,it=e.pendingProps,at=h.context,j=s.contextType,typeof j=="object"&&j!==null?j=eh(j):(j=Zf(s)?Xf:H.current,j=Yf(e,j));var lt=s.getDerivedStateFromProps;(_e=typeof lt=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(b!==it||at!==j)&&Hi(e,h,a,j),jh=!1,at=e.memoizedState,h.state=at,qh(e,a,h,c);var dt=e.memoizedState;b!==it||at!==dt||Wf.current||jh?(typeof lt=="function"&&(Di(e,s,lt,a),dt=e.memoizedState),($=jh||Fi(e,s,$,a,at,dt,j)||!1)?(_e||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(a,dt,j),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(a,dt,j)),typeof h.componentDidUpdate=="function"&&(e.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof h.componentDidUpdate!="function"||b===o.memoizedProps&&at===o.memoizedState||(e.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||b===o.memoizedProps&&at===o.memoizedState||(e.flags|=1024),e.memoizedProps=a,e.memoizedState=dt),h.props=a,h.state=dt,h.context=j,a=$):(typeof h.componentDidUpdate!="function"||b===o.memoizedProps&&at===o.memoizedState||(e.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||b===o.memoizedProps&&at===o.memoizedState||(e.flags|=1024),a=!1)}return jj(o,e,s,a,d,c)}function jj(o,e,s,a,c,d){gj(o,e);var h=(e.flags&128)!==0;if(!a&&!h)return c&&dg(e,s,!1),Zi(o,e,d);a=e.stateNode,Wi.current=e;var b=h&&typeof s.getDerivedStateFromError!="function"?null:a.render();return e.flags|=1,o!==null&&h?(e.child=Ug(e,o.child,null,d),e.child=Ug(e,null,b,d)):Xi(o,e,b,d),e.memoizedState=a.state,c&&dg(e,s,!0),e.child}function kj(o){var e=o.stateNode;e.pendingContext?ag(o,e.pendingContext,e.pendingContext!==e.context):e.context&&ag(o,e.context,!1),yh(o,e.containerInfo)}function lj(o,e,s,a,c){return Ig(),Jg(c),e.flags|=256,Xi(o,e,s,a),e.child}var mj={dehydrated:null,treeContext:null,retryLane:0};function nj(o){return{baseLanes:o,cachePool:null,transitions:null}}function oj(o,e,s){var a=e.pendingProps,c=L.current,d=!1,h=(e.flags&128)!==0,b;if((b=h)||(b=o!==null&&o.memoizedState===null?!1:(c&2)!==0),b?(d=!0,e.flags&=-129):(o===null||o.memoizedState!==null)&&(c|=1),G(L,c&1),o===null)return Eg(e),o=e.memoizedState,o!==null&&(o=o.dehydrated,o!==null)?(e.mode&1?o.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(h=a.children,o=a.fallback,d?(a=e.mode,d=e.child,h={mode:"hidden",children:h},!(a&1)&&d!==null?(d.childLanes=0,d.pendingProps=h):d=pj(h,a,0,null),o=Tg(o,a,s,null),d.return=e,o.return=e,d.sibling=o,e.child=d,e.child.memoizedState=nj(s),e.memoizedState=mj,o):qj(e,h));if(c=o.memoizedState,c!==null&&(b=c.dehydrated,b!==null))return rj(o,e,h,a,b,c,s);if(d){d=a.fallback,h=e.mode,c=o.child,b=c.sibling;var j={mode:"hidden",children:a.children};return!(h&1)&&e.child!==c?(a=e.child,a.childLanes=0,a.pendingProps=j,e.deletions=null):(a=Pg(c,j),a.subtreeFlags=c.subtreeFlags&14680064),b!==null?d=Pg(b,d):(d=Tg(d,h,s,null),d.flags|=2),d.return=e,a.return=e,a.sibling=d,e.child=a,a=d,d=e.child,h=o.child.memoizedState,h=h===null?nj(s):{baseLanes:h.baseLanes|s,cachePool:null,transitions:h.transitions},d.memoizedState=h,d.childLanes=o.childLanes&~s,e.memoizedState=mj,a}return d=o.child,o=d.sibling,a=Pg(d,{mode:"visible",children:a.children}),!(e.mode&1)&&(a.lanes=s),a.return=e,a.sibling=null,o!==null&&(s=e.deletions,s===null?(e.deletions=[o],e.flags|=16):s.push(o)),e.child=a,e.memoizedState=null,a}function qj(o,e){return e=pj({mode:"visible",children:e},o.mode,0,null),e.return=o,o.child=e}function sj(o,e,s,a){return a!==null&&Jg(a),Ug(e,o.child,null,s),o=qj(e,e.pendingProps.children),o.flags|=2,e.memoizedState=null,o}function rj(o,e,s,a,c,d,h){if(s)return e.flags&256?(e.flags&=-257,a=Ki(Error(p(422))),sj(o,e,h,a)):e.memoizedState!==null?(e.child=o.child,e.flags|=128,null):(d=a.fallback,c=e.mode,a=pj({mode:"visible",children:a.children},c,0,null),d=Tg(d,c,h,null),d.flags|=2,a.return=e,d.return=e,a.sibling=d,e.child=a,e.mode&1&&Ug(e,o.child,null,h),e.child.memoizedState=nj(h),e.memoizedState=mj,d);if(!(e.mode&1))return sj(o,e,h,null);if(c.data==="$!"){if(a=c.nextSibling&&c.nextSibling.dataset,a)var b=a.dgst;return a=b,d=Error(p(419)),a=Ki(d,a,void 0),sj(o,e,h,a)}if(b=(h&o.childLanes)!==0,dh||b){if(a=Q,a!==null){switch(h&-h){case 4:c=2;break;case 16:c=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:c=32;break;case 536870912:c=268435456;break;default:c=0}c=c&(a.suspendedLanes|h)?0:c,c!==0&&c!==d.retryLane&&(d.retryLane=c,ih(o,c),gi(a,o,c,-1))}return tj(),a=Ki(Error(p(421))),sj(o,e,h,a)}return c.data==="$?"?(e.flags|=128,e.child=o.child,e=uj.bind(null,o),c._reactRetry=e,null):(o=d.treeContext,yg=Lf(c.nextSibling),xg=e,I=!0,zg=null,o!==null&&(og[pg++]=rg,og[pg++]=sg,og[pg++]=qg,rg=o.id,sg=o.overflow,qg=e),e=qj(e,a.children),e.flags|=4096,e)}function vj(o,e,s){o.lanes|=e;var a=o.alternate;a!==null&&(a.lanes|=e),bh(o.return,e,s)}function wj(o,e,s,a,c){var d=o.memoizedState;d===null?o.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:a,tail:s,tailMode:c}:(d.isBackwards=e,d.rendering=null,d.renderingStartTime=0,d.last=a,d.tail=s,d.tailMode=c)}function xj(o,e,s){var a=e.pendingProps,c=a.revealOrder,d=a.tail;if(Xi(o,e,a.children,s),a=L.current,a&2)a=a&1|2,e.flags|=128;else{if(o!==null&&o.flags&128)e:for(o=e.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&vj(o,s,e);else if(o.tag===19)vj(o,s,e);else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===e)break e;for(;o.sibling===null;){if(o.return===null||o.return===e)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}a&=1}if(G(L,a),!(e.mode&1))e.memoizedState=null;else switch(c){case"forwards":for(s=e.child,c=null;s!==null;)o=s.alternate,o!==null&&Ch(o)===null&&(c=s),s=s.sibling;s=c,s===null?(c=e.child,e.child=null):(c=s.sibling,s.sibling=null),wj(e,!1,c,s,d);break;case"backwards":for(s=null,c=e.child,e.child=null;c!==null;){if(o=c.alternate,o!==null&&Ch(o)===null){e.child=c;break}o=c.sibling,c.sibling=s,s=c,c=o}wj(e,!0,s,null,d);break;case"together":wj(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function ij(o,e){!(e.mode&1)&&o!==null&&(o.alternate=null,e.alternate=null,e.flags|=2)}function Zi(o,e,s){if(o!==null&&(e.dependencies=o.dependencies),rh|=e.lanes,!(s&e.childLanes))return null;if(o!==null&&e.child!==o.child)throw Error(p(153));if(e.child!==null){for(o=e.child,s=Pg(o,o.pendingProps),e.child=s,s.return=e;o.sibling!==null;)o=o.sibling,s=s.sibling=Pg(o,o.pendingProps),s.return=e;s.sibling=null}return e.child}function yj(o,e,s){switch(e.tag){case 3:kj(e),Ig();break;case 5:Ah(e);break;case 1:Zf(e.type)&&cg(e);break;case 4:yh(e,e.stateNode.containerInfo);break;case 10:var a=e.type._context,c=e.memoizedProps.value;G(Wg,a._currentValue),a._currentValue=c;break;case 13:if(a=e.memoizedState,a!==null)return a.dehydrated!==null?(G(L,L.current&1),e.flags|=128,null):s&e.child.childLanes?oj(o,e,s):(G(L,L.current&1),o=Zi(o,e,s),o!==null?o.sibling:null);G(L,L.current&1);break;case 19:if(a=(s&e.childLanes)!==0,o.flags&128){if(a)return xj(o,e,s);e.flags|=128}if(c=e.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),G(L,L.current),a)break;return null;case 22:case 23:return e.lanes=0,dj(o,e,s)}return Zi(o,e,s)}var zj,Aj,Bj,Cj;zj=function(o,e){for(var s=e.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===e)break;for(;s.sibling===null;){if(s.return===null||s.return===e)return;s=s.return}s.sibling.return=s.return,s=s.sibling}};Aj=function(){};Bj=function(o,e,s,a){var c=o.memoizedProps;if(c!==a){o=e.stateNode,xh(uh.current);var d=null;switch(s){case"input":c=Ya(o,c),a=Ya(o,a),d=[];break;case"select":c=A({},c,{value:void 0}),a=A({},a,{value:void 0}),d=[];break;case"textarea":c=gb(o,c),a=gb(o,a),d=[];break;default:typeof c.onClick!="function"&&typeof a.onClick=="function"&&(o.onclick=Bf)}ub(s,a);var h;s=null;for($ in c)if(!a.hasOwnProperty($)&&c.hasOwnProperty($)&&c[$]!=null)if($==="style"){var b=c[$];for(h in b)b.hasOwnProperty(h)&&(s||(s={}),s[h]="")}else $!=="dangerouslySetInnerHTML"&&$!=="children"&&$!=="suppressContentEditableWarning"&&$!=="suppressHydrationWarning"&&$!=="autoFocus"&&(ea.hasOwnProperty($)?d||(d=[]):(d=d||[]).push($,null));for($ in a){var j=a[$];if(b=c!=null?c[$]:void 0,a.hasOwnProperty($)&&j!==b&&(j!=null||b!=null))if($==="style")if(b){for(h in b)!b.hasOwnProperty(h)||j&&j.hasOwnProperty(h)||(s||(s={}),s[h]="");for(h in j)j.hasOwnProperty(h)&&b[h]!==j[h]&&(s||(s={}),s[h]=j[h])}else s||(d||(d=[]),d.push($,s)),s=j;else $==="dangerouslySetInnerHTML"?(j=j?j.__html:void 0,b=b?b.__html:void 0,j!=null&&b!==j&&(d=d||[]).push($,j)):$==="children"?typeof j!="string"&&typeof j!="number"||(d=d||[]).push($,""+j):$!=="suppressContentEditableWarning"&&$!=="suppressHydrationWarning"&&(ea.hasOwnProperty($)?(j!=null&&$==="onScroll"&&D("scroll",o),d||b===j||(d=[])):(d=d||[]).push($,j))}s&&(d=d||[]).push("style",s);var $=d;(e.updateQueue=$)&&(e.flags|=4)}};Cj=function(o,e,s,a){s!==a&&(e.flags|=4)};function Dj(o,e){if(!I)switch(o.tailMode){case"hidden":e=o.tail;for(var s=null;e!==null;)e.alternate!==null&&(s=e),e=e.sibling;s===null?o.tail=null:s.sibling=null;break;case"collapsed":s=o.tail;for(var a=null;s!==null;)s.alternate!==null&&(a=s),s=s.sibling;a===null?e||o.tail===null?o.tail=null:o.tail.sibling=null:a.sibling=null}}function S(o){var e=o.alternate!==null&&o.alternate.child===o.child,s=0,a=0;if(e)for(var c=o.child;c!==null;)s|=c.lanes|c.childLanes,a|=c.subtreeFlags&14680064,a|=c.flags&14680064,c.return=o,c=c.sibling;else for(c=o.child;c!==null;)s|=c.lanes|c.childLanes,a|=c.subtreeFlags,a|=c.flags,c.return=o,c=c.sibling;return o.subtreeFlags|=a,o.childLanes=s,e}function Ej(o,e,s){var a=e.pendingProps;switch(wg(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return S(e),null;case 1:return Zf(e.type)&&$f(),S(e),null;case 3:return a=e.stateNode,zh(),E(Wf),E(H),Eh(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(o===null||o.child===null)&&(Gg(e)?e.flags|=4:o===null||o.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,zg!==null&&(Fj(zg),zg=null))),Aj(o,e),S(e),null;case 5:Bh(e);var c=xh(wh.current);if(s=e.type,o!==null&&e.stateNode!=null)Bj(o,e,s,a,c),o.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!a){if(e.stateNode===null)throw Error(p(166));return S(e),null}if(o=xh(uh.current),Gg(e)){a=e.stateNode,s=e.type;var d=e.memoizedProps;switch(a[Of]=e,a[Pf]=d,o=(e.mode&1)!==0,s){case"dialog":D("cancel",a),D("close",a);break;case"iframe":case"object":case"embed":D("load",a);break;case"video":case"audio":for(c=0;c<lf.length;c++)D(lf[c],a);break;case"source":D("error",a);break;case"img":case"image":case"link":D("error",a),D("load",a);break;case"details":D("toggle",a);break;case"input":Za(a,d),D("invalid",a);break;case"select":a._wrapperState={wasMultiple:!!d.multiple},D("invalid",a);break;case"textarea":hb(a,d),D("invalid",a)}ub(s,d),c=null;for(var h in d)if(d.hasOwnProperty(h)){var b=d[h];h==="children"?typeof b=="string"?a.textContent!==b&&(d.suppressHydrationWarning!==!0&&Af(a.textContent,b,o),c=["children",b]):typeof b=="number"&&a.textContent!==""+b&&(d.suppressHydrationWarning!==!0&&Af(a.textContent,b,o),c=["children",""+b]):ea.hasOwnProperty(h)&&b!=null&&h==="onScroll"&&D("scroll",a)}switch(s){case"input":Va(a),db$1(a,d,!0);break;case"textarea":Va(a),jb(a);break;case"select":case"option":break;default:typeof d.onClick=="function"&&(a.onclick=Bf)}a=c,e.updateQueue=a,a!==null&&(e.flags|=4)}else{h=c.nodeType===9?c:c.ownerDocument,o==="http://www.w3.org/1999/xhtml"&&(o=kb(s)),o==="http://www.w3.org/1999/xhtml"?s==="script"?(o=h.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild)):typeof a.is=="string"?o=h.createElement(s,{is:a.is}):(o=h.createElement(s),s==="select"&&(h=o,a.multiple?h.multiple=!0:a.size&&(h.size=a.size))):o=h.createElementNS(o,s),o[Of]=e,o[Pf]=a,zj(o,e,!1,!1),e.stateNode=o;e:{switch(h=vb(s,a),s){case"dialog":D("cancel",o),D("close",o),c=a;break;case"iframe":case"object":case"embed":D("load",o),c=a;break;case"video":case"audio":for(c=0;c<lf.length;c++)D(lf[c],o);c=a;break;case"source":D("error",o),c=a;break;case"img":case"image":case"link":D("error",o),D("load",o),c=a;break;case"details":D("toggle",o),c=a;break;case"input":Za(o,a),c=Ya(o,a),D("invalid",o);break;case"option":c=a;break;case"select":o._wrapperState={wasMultiple:!!a.multiple},c=A({},a,{value:void 0}),D("invalid",o);break;case"textarea":hb(o,a),c=gb(o,a),D("invalid",o);break;default:c=a}ub(s,c),b=c;for(d in b)if(b.hasOwnProperty(d)){var j=b[d];d==="style"?sb(o,j):d==="dangerouslySetInnerHTML"?(j=j?j.__html:void 0,j!=null&&nb(o,j)):d==="children"?typeof j=="string"?(s!=="textarea"||j!=="")&&ob(o,j):typeof j=="number"&&ob(o,""+j):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&(ea.hasOwnProperty(d)?j!=null&&d==="onScroll"&&D("scroll",o):j!=null&&ta(o,d,j,h))}switch(s){case"input":Va(o),db$1(o,a,!1);break;case"textarea":Va(o),jb(o);break;case"option":a.value!=null&&o.setAttribute("value",""+Sa(a.value));break;case"select":o.multiple=!!a.multiple,d=a.value,d!=null?fb(o,!!a.multiple,d,!1):a.defaultValue!=null&&fb(o,!!a.multiple,a.defaultValue,!0);break;default:typeof c.onClick=="function"&&(o.onclick=Bf)}switch(s){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}}a&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return S(e),null;case 6:if(o&&e.stateNode!=null)Cj(o,e,o.memoizedProps,a);else{if(typeof a!="string"&&e.stateNode===null)throw Error(p(166));if(s=xh(wh.current),xh(uh.current),Gg(e)){if(a=e.stateNode,s=e.memoizedProps,a[Of]=e,(d=a.nodeValue!==s)&&(o=xg,o!==null))switch(o.tag){case 3:Af(a.nodeValue,s,(o.mode&1)!==0);break;case 5:o.memoizedProps.suppressHydrationWarning!==!0&&Af(a.nodeValue,s,(o.mode&1)!==0)}d&&(e.flags|=4)}else a=(s.nodeType===9?s:s.ownerDocument).createTextNode(a),a[Of]=e,e.stateNode=a}return S(e),null;case 13:if(E(L),a=e.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(I&&yg!==null&&e.mode&1&&!(e.flags&128))Hg(),Ig(),e.flags|=98560,d=!1;else if(d=Gg(e),a!==null&&a.dehydrated!==null){if(o===null){if(!d)throw Error(p(318));if(d=e.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(p(317));d[Of]=e}else Ig(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;S(e),d=!1}else zg!==null&&(Fj(zg),zg=null),d=!0;if(!d)return e.flags&65536?e:null}return e.flags&128?(e.lanes=s,e):(a=a!==null,a!==(o!==null&&o.memoizedState!==null)&&a&&(e.child.flags|=8192,e.mode&1&&(o===null||L.current&1?T===0&&(T=3):tj())),e.updateQueue!==null&&(e.flags|=4),S(e),null);case 4:return zh(),Aj(o,e),o===null&&sf(e.stateNode.containerInfo),S(e),null;case 10:return ah(e.type._context),S(e),null;case 17:return Zf(e.type)&&$f(),S(e),null;case 19:if(E(L),d=e.memoizedState,d===null)return S(e),null;if(a=(e.flags&128)!==0,h=d.rendering,h===null)if(a)Dj(d,!1);else{if(T!==0||o!==null&&o.flags&128)for(o=e.child;o!==null;){if(h=Ch(o),h!==null){for(e.flags|=128,Dj(d,!1),a=h.updateQueue,a!==null&&(e.updateQueue=a,e.flags|=4),e.subtreeFlags=0,a=s,s=e.child;s!==null;)d=s,o=a,d.flags&=14680066,h=d.alternate,h===null?(d.childLanes=0,d.lanes=o,d.child=null,d.subtreeFlags=0,d.memoizedProps=null,d.memoizedState=null,d.updateQueue=null,d.dependencies=null,d.stateNode=null):(d.childLanes=h.childLanes,d.lanes=h.lanes,d.child=h.child,d.subtreeFlags=0,d.deletions=null,d.memoizedProps=h.memoizedProps,d.memoizedState=h.memoizedState,d.updateQueue=h.updateQueue,d.type=h.type,o=h.dependencies,d.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),s=s.sibling;return G(L,L.current&1|2),e.child}o=o.sibling}d.tail!==null&&B()>Gj&&(e.flags|=128,a=!0,Dj(d,!1),e.lanes=4194304)}else{if(!a)if(o=Ch(h),o!==null){if(e.flags|=128,a=!0,s=o.updateQueue,s!==null&&(e.updateQueue=s,e.flags|=4),Dj(d,!0),d.tail===null&&d.tailMode==="hidden"&&!h.alternate&&!I)return S(e),null}else 2*B()-d.renderingStartTime>Gj&&s!==1073741824&&(e.flags|=128,a=!0,Dj(d,!1),e.lanes=4194304);d.isBackwards?(h.sibling=e.child,e.child=h):(s=d.last,s!==null?s.sibling=h:e.child=h,d.last=h)}return d.tail!==null?(e=d.tail,d.rendering=e,d.tail=e.sibling,d.renderingStartTime=B(),e.sibling=null,s=L.current,G(L,a?s&1|2:s&1),e):(S(e),null);case 22:case 23:return Hj(),a=e.memoizedState!==null,o!==null&&o.memoizedState!==null!==a&&(e.flags|=8192),a&&e.mode&1?fj&1073741824&&(S(e),e.subtreeFlags&6&&(e.flags|=8192)):S(e),null;case 24:return null;case 25:return null}throw Error(p(156,e.tag))}function Ij(o,e){switch(wg(e),e.tag){case 1:return Zf(e.type)&&$f(),o=e.flags,o&65536?(e.flags=o&-65537|128,e):null;case 3:return zh(),E(Wf),E(H),Eh(),o=e.flags,o&65536&&!(o&128)?(e.flags=o&-65537|128,e):null;case 5:return Bh(e),null;case 13:if(E(L),o=e.memoizedState,o!==null&&o.dehydrated!==null){if(e.alternate===null)throw Error(p(340));Ig()}return o=e.flags,o&65536?(e.flags=o&-65537|128,e):null;case 19:return E(L),null;case 4:return zh(),null;case 10:return ah(e.type._context),null;case 22:case 23:return Hj(),null;case 24:return null;default:return null}}var Jj=!1,U=!1,Kj=typeof WeakSet=="function"?WeakSet:Set,V=null;function Lj(o,e){var s=o.ref;if(s!==null)if(typeof s=="function")try{s(null)}catch(a){W(o,e,a)}else s.current=null}function Mj(o,e,s){try{s()}catch(a){W(o,e,a)}}var Nj=!1;function Oj(o,e){if(Cf=dd,o=Me(),Ne(o)){if("selectionStart"in o)var s={start:o.selectionStart,end:o.selectionEnd};else e:{s=(s=o.ownerDocument)&&s.defaultView||window;var a=s.getSelection&&s.getSelection();if(a&&a.rangeCount!==0){s=a.anchorNode;var c=a.anchorOffset,d=a.focusNode;a=a.focusOffset;try{s.nodeType,d.nodeType}catch{s=null;break e}var h=0,b=-1,j=-1,$=0,_e=0,it=o,at=null;t:for(;;){for(var lt;it!==s||c!==0&&it.nodeType!==3||(b=h+c),it!==d||a!==0&&it.nodeType!==3||(j=h+a),it.nodeType===3&&(h+=it.nodeValue.length),(lt=it.firstChild)!==null;)at=it,it=lt;for(;;){if(it===o)break t;if(at===s&&++$===c&&(b=h),at===d&&++_e===a&&(j=h),(lt=it.nextSibling)!==null)break;it=at,at=it.parentNode}it=lt}s=b===-1||j===-1?null:{start:b,end:j}}else s=null}s=s||{start:0,end:0}}else s=null;for(Df={focusedElem:o,selectionRange:s},dd=!1,V=e;V!==null;)if(e=V,o=e.child,(e.subtreeFlags&1028)!==0&&o!==null)o.return=e,V=o;else for(;V!==null;){e=V;try{var dt=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(dt!==null){var mt=dt.memoizedProps,vt=dt.memoizedState,tt=e.stateNode,nt=tt.getSnapshotBeforeUpdate(e.elementType===e.type?mt:Ci(e.type,mt),vt);tt.__reactInternalSnapshotBeforeUpdate=nt}break;case 3:var ot=e.stateNode.containerInfo;ot.nodeType===1?ot.textContent="":ot.nodeType===9&&ot.documentElement&&ot.removeChild(ot.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(p(163))}}catch(ht){W(e,e.return,ht)}if(o=e.sibling,o!==null){o.return=e.return,V=o;break}V=e.return}return dt=Nj,Nj=!1,dt}function Pj(o,e,s){var a=e.updateQueue;if(a=a!==null?a.lastEffect:null,a!==null){var c=a=a.next;do{if((c.tag&o)===o){var d=c.destroy;c.destroy=void 0,d!==void 0&&Mj(e,s,d)}c=c.next}while(c!==a)}}function Qj(o,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var s=e=e.next;do{if((s.tag&o)===o){var a=s.create;s.destroy=a()}s=s.next}while(s!==e)}}function Rj(o){var e=o.ref;if(e!==null){var s=o.stateNode;switch(o.tag){case 5:o=s;break;default:o=s}typeof e=="function"?e(o):e.current=o}}function Sj(o){var e=o.alternate;e!==null&&(o.alternate=null,Sj(e)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(e=o.stateNode,e!==null&&(delete e[Of],delete e[Pf],delete e[of],delete e[Qf],delete e[Rf])),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}function Tj(o){return o.tag===5||o.tag===3||o.tag===4}function Uj(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||Tj(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function Vj(o,e,s){var a=o.tag;if(a===5||a===6)o=o.stateNode,e?s.nodeType===8?s.parentNode.insertBefore(o,e):s.insertBefore(o,e):(s.nodeType===8?(e=s.parentNode,e.insertBefore(o,s)):(e=s,e.appendChild(o)),s=s._reactRootContainer,s!=null||e.onclick!==null||(e.onclick=Bf));else if(a!==4&&(o=o.child,o!==null))for(Vj(o,e,s),o=o.sibling;o!==null;)Vj(o,e,s),o=o.sibling}function Wj(o,e,s){var a=o.tag;if(a===5||a===6)o=o.stateNode,e?s.insertBefore(o,e):s.appendChild(o);else if(a!==4&&(o=o.child,o!==null))for(Wj(o,e,s),o=o.sibling;o!==null;)Wj(o,e,s),o=o.sibling}var X$1=null,Xj=!1;function Yj(o,e,s){for(s=s.child;s!==null;)Zj(o,e,s),s=s.sibling}function Zj(o,e,s){if(lc&&typeof lc.onCommitFiberUnmount=="function")try{lc.onCommitFiberUnmount(kc,s)}catch{}switch(s.tag){case 5:U||Lj(s,e);case 6:var a=X$1,c=Xj;X$1=null,Yj(o,e,s),X$1=a,Xj=c,X$1!==null&&(Xj?(o=X$1,s=s.stateNode,o.nodeType===8?o.parentNode.removeChild(s):o.removeChild(s)):X$1.removeChild(s.stateNode));break;case 18:X$1!==null&&(Xj?(o=X$1,s=s.stateNode,o.nodeType===8?Kf(o.parentNode,s):o.nodeType===1&&Kf(o,s),bd(o)):Kf(X$1,s.stateNode));break;case 4:a=X$1,c=Xj,X$1=s.stateNode.containerInfo,Xj=!0,Yj(o,e,s),X$1=a,Xj=c;break;case 0:case 11:case 14:case 15:if(!U&&(a=s.updateQueue,a!==null&&(a=a.lastEffect,a!==null))){c=a=a.next;do{var d=c,h=d.destroy;d=d.tag,h!==void 0&&(d&2||d&4)&&Mj(s,e,h),c=c.next}while(c!==a)}Yj(o,e,s);break;case 1:if(!U&&(Lj(s,e),a=s.stateNode,typeof a.componentWillUnmount=="function"))try{a.props=s.memoizedProps,a.state=s.memoizedState,a.componentWillUnmount()}catch(b){W(s,e,b)}Yj(o,e,s);break;case 21:Yj(o,e,s);break;case 22:s.mode&1?(U=(a=U)||s.memoizedState!==null,Yj(o,e,s),U=a):Yj(o,e,s);break;default:Yj(o,e,s)}}function ak(o){var e=o.updateQueue;if(e!==null){o.updateQueue=null;var s=o.stateNode;s===null&&(s=o.stateNode=new Kj),e.forEach(function(a){var c=bk.bind(null,o,a);s.has(a)||(s.add(a),a.then(c,c))})}}function ck(o,e){var s=e.deletions;if(s!==null)for(var a=0;a<s.length;a++){var c=s[a];try{var d=o,h=e,b=h;e:for(;b!==null;){switch(b.tag){case 5:X$1=b.stateNode,Xj=!1;break e;case 3:X$1=b.stateNode.containerInfo,Xj=!0;break e;case 4:X$1=b.stateNode.containerInfo,Xj=!0;break e}b=b.return}if(X$1===null)throw Error(p(160));Zj(d,h,c),X$1=null,Xj=!1;var j=c.alternate;j!==null&&(j.return=null),c.return=null}catch($){W(c,e,$)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)dk(e,o),e=e.sibling}function dk(o,e){var s=o.alternate,a=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:if(ck(e,o),ek(o),a&4){try{Pj(3,o,o.return),Qj(3,o)}catch(mt){W(o,o.return,mt)}try{Pj(5,o,o.return)}catch(mt){W(o,o.return,mt)}}break;case 1:ck(e,o),ek(o),a&512&&s!==null&&Lj(s,s.return);break;case 5:if(ck(e,o),ek(o),a&512&&s!==null&&Lj(s,s.return),o.flags&32){var c=o.stateNode;try{ob(c,"")}catch(mt){W(o,o.return,mt)}}if(a&4&&(c=o.stateNode,c!=null)){var d=o.memoizedProps,h=s!==null?s.memoizedProps:d,b=o.type,j=o.updateQueue;if(o.updateQueue=null,j!==null)try{b==="input"&&d.type==="radio"&&d.name!=null&&ab(c,d),vb(b,h);var $=vb(b,d);for(h=0;h<j.length;h+=2){var _e=j[h],it=j[h+1];_e==="style"?sb(c,it):_e==="dangerouslySetInnerHTML"?nb(c,it):_e==="children"?ob(c,it):ta(c,_e,it,$)}switch(b){case"input":bb(c,d);break;case"textarea":ib(c,d);break;case"select":var at=c._wrapperState.wasMultiple;c._wrapperState.wasMultiple=!!d.multiple;var lt=d.value;lt!=null?fb(c,!!d.multiple,lt,!1):at!==!!d.multiple&&(d.defaultValue!=null?fb(c,!!d.multiple,d.defaultValue,!0):fb(c,!!d.multiple,d.multiple?[]:"",!1))}c[Pf]=d}catch(mt){W(o,o.return,mt)}}break;case 6:if(ck(e,o),ek(o),a&4){if(o.stateNode===null)throw Error(p(162));c=o.stateNode,d=o.memoizedProps;try{c.nodeValue=d}catch(mt){W(o,o.return,mt)}}break;case 3:if(ck(e,o),ek(o),a&4&&s!==null&&s.memoizedState.isDehydrated)try{bd(e.containerInfo)}catch(mt){W(o,o.return,mt)}break;case 4:ck(e,o),ek(o);break;case 13:ck(e,o),ek(o),c=o.child,c.flags&8192&&(d=c.memoizedState!==null,c.stateNode.isHidden=d,!d||c.alternate!==null&&c.alternate.memoizedState!==null||(fk=B())),a&4&&ak(o);break;case 22:if(_e=s!==null&&s.memoizedState!==null,o.mode&1?(U=($=U)||_e,ck(e,o),U=$):ck(e,o),ek(o),a&8192){if($=o.memoizedState!==null,(o.stateNode.isHidden=$)&&!_e&&o.mode&1)for(V=o,_e=o.child;_e!==null;){for(it=V=_e;V!==null;){switch(at=V,lt=at.child,at.tag){case 0:case 11:case 14:case 15:Pj(4,at,at.return);break;case 1:Lj(at,at.return);var dt=at.stateNode;if(typeof dt.componentWillUnmount=="function"){a=at,s=at.return;try{e=a,dt.props=e.memoizedProps,dt.state=e.memoizedState,dt.componentWillUnmount()}catch(mt){W(a,s,mt)}}break;case 5:Lj(at,at.return);break;case 22:if(at.memoizedState!==null){gk(it);continue}}lt!==null?(lt.return=at,V=lt):gk(it)}_e=_e.sibling}e:for(_e=null,it=o;;){if(it.tag===5){if(_e===null){_e=it;try{c=it.stateNode,$?(d=c.style,typeof d.setProperty=="function"?d.setProperty("display","none","important"):d.display="none"):(b=it.stateNode,j=it.memoizedProps.style,h=j!=null&&j.hasOwnProperty("display")?j.display:null,b.style.display=rb("display",h))}catch(mt){W(o,o.return,mt)}}}else if(it.tag===6){if(_e===null)try{it.stateNode.nodeValue=$?"":it.memoizedProps}catch(mt){W(o,o.return,mt)}}else if((it.tag!==22&&it.tag!==23||it.memoizedState===null||it===o)&&it.child!==null){it.child.return=it,it=it.child;continue}if(it===o)break e;for(;it.sibling===null;){if(it.return===null||it.return===o)break e;_e===it&&(_e=null),it=it.return}_e===it&&(_e=null),it.sibling.return=it.return,it=it.sibling}}break;case 19:ck(e,o),ek(o),a&4&&ak(o);break;case 21:break;default:ck(e,o),ek(o)}}function ek(o){var e=o.flags;if(e&2){try{e:{for(var s=o.return;s!==null;){if(Tj(s)){var a=s;break e}s=s.return}throw Error(p(160))}switch(a.tag){case 5:var c=a.stateNode;a.flags&32&&(ob(c,""),a.flags&=-33);var d=Uj(o);Wj(o,d,c);break;case 3:case 4:var h=a.stateNode.containerInfo,b=Uj(o);Vj(o,b,h);break;default:throw Error(p(161))}}catch(j){W(o,o.return,j)}o.flags&=-3}e&4096&&(o.flags&=-4097)}function hk(o,e,s){V=o,ik(o)}function ik(o,e,s){for(var a=(o.mode&1)!==0;V!==null;){var c=V,d=c.child;if(c.tag===22&&a){var h=c.memoizedState!==null||Jj;if(!h){var b=c.alternate,j=b!==null&&b.memoizedState!==null||U;b=Jj;var $=U;if(Jj=h,(U=j)&&!$)for(V=c;V!==null;)h=V,j=h.child,h.tag===22&&h.memoizedState!==null?jk(c):j!==null?(j.return=h,V=j):jk(c);for(;d!==null;)V=d,ik(d),d=d.sibling;V=c,Jj=b,U=$}kk(o)}else c.subtreeFlags&8772&&d!==null?(d.return=c,V=d):kk(o)}}function kk(o){for(;V!==null;){var e=V;if(e.flags&8772){var s=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:U||Qj(5,e);break;case 1:var a=e.stateNode;if(e.flags&4&&!U)if(s===null)a.componentDidMount();else{var c=e.elementType===e.type?s.memoizedProps:Ci(e.type,s.memoizedProps);a.componentDidUpdate(c,s.memoizedState,a.__reactInternalSnapshotBeforeUpdate)}var d=e.updateQueue;d!==null&&sh(e,d,a);break;case 3:var h=e.updateQueue;if(h!==null){if(s=null,e.child!==null)switch(e.child.tag){case 5:s=e.child.stateNode;break;case 1:s=e.child.stateNode}sh(e,h,s)}break;case 5:var b=e.stateNode;if(s===null&&e.flags&4){s=b;var j=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":j.autoFocus&&s.focus();break;case"img":j.src&&(s.src=j.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(e.memoizedState===null){var $=e.alternate;if($!==null){var _e=$.memoizedState;if(_e!==null){var it=_e.dehydrated;it!==null&&bd(it)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(p(163))}U||e.flags&512&&Rj(e)}catch(at){W(e,e.return,at)}}if(e===o){V=null;break}if(s=e.sibling,s!==null){s.return=e.return,V=s;break}V=e.return}}function gk(o){for(;V!==null;){var e=V;if(e===o){V=null;break}var s=e.sibling;if(s!==null){s.return=e.return,V=s;break}V=e.return}}function jk(o){for(;V!==null;){var e=V;try{switch(e.tag){case 0:case 11:case 15:var s=e.return;try{Qj(4,e)}catch(j){W(e,s,j)}break;case 1:var a=e.stateNode;if(typeof a.componentDidMount=="function"){var c=e.return;try{a.componentDidMount()}catch(j){W(e,c,j)}}var d=e.return;try{Rj(e)}catch(j){W(e,d,j)}break;case 5:var h=e.return;try{Rj(e)}catch(j){W(e,h,j)}}}catch(j){W(e,e.return,j)}if(e===o){V=null;break}var b=e.sibling;if(b!==null){b.return=e.return,V=b;break}V=e.return}}var lk=Math.ceil,mk=ua.ReactCurrentDispatcher,nk=ua.ReactCurrentOwner,ok=ua.ReactCurrentBatchConfig,K=0,Q=null,Y=null,Z=0,fj=0,ej=Uf(0),T=0,pk=null,rh=0,qk=0,rk=0,sk=null,tk=null,fk=0,Gj=1/0,uk=null,Oi=!1,Pi=null,Ri=null,vk=!1,wk=null,xk=0,yk=0,zk=null,Ak=-1,Bk=0;function R(){return K&6?B():Ak!==-1?Ak:Ak=B()}function yi(o){return o.mode&1?K&2&&Z!==0?Z&-Z:Kg.transition!==null?(Bk===0&&(Bk=yc()),Bk):(o=C,o!==0||(o=window.event,o=o===void 0?16:jd(o.type)),o):1}function gi(o,e,s,a){if(50<yk)throw yk=0,zk=null,Error(p(185));Ac(o,s,a),(!(K&2)||o!==Q)&&(o===Q&&(!(K&2)&&(qk|=s),T===4&&Ck(o,Z)),Dk(o,a),s===1&&K===0&&!(e.mode&1)&&(Gj=B()+500,fg&&jg()))}function Dk(o,e){var s=o.callbackNode;wc(o,e);var a=uc(o,o===Q?Z:0);if(a===0)s!==null&&bc(s),o.callbackNode=null,o.callbackPriority=0;else if(e=a&-a,o.callbackPriority!==e){if(s!=null&&bc(s),e===1)o.tag===0?ig(Ek.bind(null,o)):hg(Ek.bind(null,o)),Jf(function(){!(K&6)&&jg()}),s=null;else{switch(Dc(a)){case 1:s=fc;break;case 4:s=gc;break;case 16:s=hc;break;case 536870912:s=jc;break;default:s=hc}s=Fk(s,Gk.bind(null,o))}o.callbackPriority=e,o.callbackNode=s}}function Gk(o,e){if(Ak=-1,Bk=0,K&6)throw Error(p(327));var s=o.callbackNode;if(Hk()&&o.callbackNode!==s)return null;var a=uc(o,o===Q?Z:0);if(a===0)return null;if(a&30||a&o.expiredLanes||e)e=Ik(o,a);else{e=a;var c=K;K|=2;var d=Jk();(Q!==o||Z!==e)&&(uk=null,Gj=B()+500,Kk(o,e));do try{Lk();break}catch(b){Mk(o,b)}while(!0);$g(),mk.current=d,K=c,Y!==null?e=0:(Q=null,Z=0,e=T)}if(e!==0){if(e===2&&(c=xc(o),c!==0&&(a=c,e=Nk(o,c))),e===1)throw s=pk,Kk(o,0),Ck(o,a),Dk(o,B()),s;if(e===6)Ck(o,a);else{if(c=o.current.alternate,!(a&30)&&!Ok(c)&&(e=Ik(o,a),e===2&&(d=xc(o),d!==0&&(a=d,e=Nk(o,d))),e===1))throw s=pk,Kk(o,0),Ck(o,a),Dk(o,B()),s;switch(o.finishedWork=c,o.finishedLanes=a,e){case 0:case 1:throw Error(p(345));case 2:Pk(o,tk,uk);break;case 3:if(Ck(o,a),(a&130023424)===a&&(e=fk+500-B(),10<e)){if(uc(o,0)!==0)break;if(c=o.suspendedLanes,(c&a)!==a){R(),o.pingedLanes|=o.suspendedLanes&c;break}o.timeoutHandle=Ff(Pk.bind(null,o,tk,uk),e);break}Pk(o,tk,uk);break;case 4:if(Ck(o,a),(a&4194240)===a)break;for(e=o.eventTimes,c=-1;0<a;){var h=31-oc(a);d=1<<h,h=e[h],h>c&&(c=h),a&=~d}if(a=c,a=B()-a,a=(120>a?120:480>a?480:1080>a?1080:1920>a?1920:3e3>a?3e3:4320>a?4320:1960*lk(a/1960))-a,10<a){o.timeoutHandle=Ff(Pk.bind(null,o,tk,uk),a);break}Pk(o,tk,uk);break;case 5:Pk(o,tk,uk);break;default:throw Error(p(329))}}}return Dk(o,B()),o.callbackNode===s?Gk.bind(null,o):null}function Nk(o,e){var s=sk;return o.current.memoizedState.isDehydrated&&(Kk(o,e).flags|=256),o=Ik(o,e),o!==2&&(e=tk,tk=s,e!==null&&Fj(e)),o}function Fj(o){tk===null?tk=o:tk.push.apply(tk,o)}function Ok(o){for(var e=o;;){if(e.flags&16384){var s=e.updateQueue;if(s!==null&&(s=s.stores,s!==null))for(var a=0;a<s.length;a++){var c=s[a],d=c.getSnapshot;c=c.value;try{if(!He(d(),c))return!1}catch{return!1}}}if(s=e.child,e.subtreeFlags&16384&&s!==null)s.return=e,e=s;else{if(e===o)break;for(;e.sibling===null;){if(e.return===null||e.return===o)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function Ck(o,e){for(e&=~rk,e&=~qk,o.suspendedLanes|=e,o.pingedLanes&=~e,o=o.expirationTimes;0<e;){var s=31-oc(e),a=1<<s;o[s]=-1,e&=~a}}function Ek(o){if(K&6)throw Error(p(327));Hk();var e=uc(o,0);if(!(e&1))return Dk(o,B()),null;var s=Ik(o,e);if(o.tag!==0&&s===2){var a=xc(o);a!==0&&(e=a,s=Nk(o,a))}if(s===1)throw s=pk,Kk(o,0),Ck(o,e),Dk(o,B()),s;if(s===6)throw Error(p(345));return o.finishedWork=o.current.alternate,o.finishedLanes=e,Pk(o,tk,uk),Dk(o,B()),null}function Qk(o,e){var s=K;K|=1;try{return o(e)}finally{K=s,K===0&&(Gj=B()+500,fg&&jg())}}function Rk(o){wk!==null&&wk.tag===0&&!(K&6)&&Hk();var e=K;K|=1;var s=ok.transition,a=C;try{if(ok.transition=null,C=1,o)return o()}finally{C=a,ok.transition=s,K=e,!(K&6)&&jg()}}function Hj(){fj=ej.current,E(ej)}function Kk(o,e){o.finishedWork=null,o.finishedLanes=0;var s=o.timeoutHandle;if(s!==-1&&(o.timeoutHandle=-1,Gf(s)),Y!==null)for(s=Y.return;s!==null;){var a=s;switch(wg(a),a.tag){case 1:a=a.type.childContextTypes,a!=null&&$f();break;case 3:zh(),E(Wf),E(H),Eh();break;case 5:Bh(a);break;case 4:zh();break;case 13:E(L);break;case 19:E(L);break;case 10:ah(a.type._context);break;case 22:case 23:Hj()}s=s.return}if(Q=o,Y=o=Pg(o.current,null),Z=fj=e,T=0,pk=null,rk=qk=rh=0,tk=sk=null,fh!==null){for(e=0;e<fh.length;e++)if(s=fh[e],a=s.interleaved,a!==null){s.interleaved=null;var c=a.next,d=s.pending;if(d!==null){var h=d.next;d.next=c,a.next=h}s.pending=a}fh=null}return o}function Mk(o,e){do{var s=Y;try{if($g(),Fh.current=Rh,Ih){for(var a=M.memoizedState;a!==null;){var c=a.queue;c!==null&&(c.pending=null),a=a.next}Ih=!1}if(Hh=0,O=N=M=null,Jh=!1,Kh=0,nk.current=null,s===null||s.return===null){T=1,pk=e,Y=null;break}e:{var d=o,h=s.return,b=s,j=e;if(e=Z,b.flags|=32768,j!==null&&typeof j=="object"&&typeof j.then=="function"){var $=j,_e=b,it=_e.tag;if(!(_e.mode&1)&&(it===0||it===11||it===15)){var at=_e.alternate;at?(_e.updateQueue=at.updateQueue,_e.memoizedState=at.memoizedState,_e.lanes=at.lanes):(_e.updateQueue=null,_e.memoizedState=null)}var lt=Ui(h);if(lt!==null){lt.flags&=-257,Vi(lt,h,b,d,e),lt.mode&1&&Si(d,$,e),e=lt,j=$;var dt=e.updateQueue;if(dt===null){var mt=new Set;mt.add(j),e.updateQueue=mt}else dt.add(j);break e}else{if(!(e&1)){Si(d,$,e),tj();break e}j=Error(p(426))}}else if(I&&b.mode&1){var vt=Ui(h);if(vt!==null){!(vt.flags&65536)&&(vt.flags|=256),Vi(vt,h,b,d,e),Jg(Ji(j,b));break e}}d=j=Ji(j,b),T!==4&&(T=2),sk===null?sk=[d]:sk.push(d),d=h;do{switch(d.tag){case 3:d.flags|=65536,e&=-e,d.lanes|=e;var tt=Ni(d,j,e);ph(d,tt);break e;case 1:b=j;var nt=d.type,ot=d.stateNode;if(!(d.flags&128)&&(typeof nt.getDerivedStateFromError=="function"||ot!==null&&typeof ot.componentDidCatch=="function"&&(Ri===null||!Ri.has(ot)))){d.flags|=65536,e&=-e,d.lanes|=e;var ht=Qi(d,b,e);ph(d,ht);break e}}d=d.return}while(d!==null)}Sk(s)}catch(xt){e=xt,Y===s&&s!==null&&(Y=s=s.return);continue}break}while(!0)}function Jk(){var o=mk.current;return mk.current=Rh,o===null?Rh:o}function tj(){(T===0||T===3||T===2)&&(T=4),Q===null||!(rh&268435455)&&!(qk&268435455)||Ck(Q,Z)}function Ik(o,e){var s=K;K|=2;var a=Jk();(Q!==o||Z!==e)&&(uk=null,Kk(o,e));do try{Tk();break}catch(c){Mk(o,c)}while(!0);if($g(),K=s,mk.current=a,Y!==null)throw Error(p(261));return Q=null,Z=0,T}function Tk(){for(;Y!==null;)Uk(Y)}function Lk(){for(;Y!==null&&!cc();)Uk(Y)}function Uk(o){var e=Vk(o.alternate,o,fj);o.memoizedProps=o.pendingProps,e===null?Sk(o):Y=e,nk.current=null}function Sk(o){var e=o;do{var s=e.alternate;if(o=e.return,e.flags&32768){if(s=Ij(s,e),s!==null){s.flags&=32767,Y=s;return}if(o!==null)o.flags|=32768,o.subtreeFlags=0,o.deletions=null;else{T=6,Y=null;return}}else if(s=Ej(s,e,fj),s!==null){Y=s;return}if(e=e.sibling,e!==null){Y=e;return}Y=e=o}while(e!==null);T===0&&(T=5)}function Pk(o,e,s){var a=C,c=ok.transition;try{ok.transition=null,C=1,Wk(o,e,s,a)}finally{ok.transition=c,C=a}return null}function Wk(o,e,s,a){do Hk();while(wk!==null);if(K&6)throw Error(p(327));s=o.finishedWork;var c=o.finishedLanes;if(s===null)return null;if(o.finishedWork=null,o.finishedLanes=0,s===o.current)throw Error(p(177));o.callbackNode=null,o.callbackPriority=0;var d=s.lanes|s.childLanes;if(Bc(o,d),o===Q&&(Y=Q=null,Z=0),!(s.subtreeFlags&2064)&&!(s.flags&2064)||vk||(vk=!0,Fk(hc,function(){return Hk(),null})),d=(s.flags&15990)!==0,s.subtreeFlags&15990||d){d=ok.transition,ok.transition=null;var h=C;C=1;var b=K;K|=4,nk.current=null,Oj(o,s),dk(s,o),Oe(Df),dd=!!Cf,Df=Cf=null,o.current=s,hk(s),dc(),K=b,C=h,ok.transition=d}else o.current=s;if(vk&&(vk=!1,wk=o,xk=c),d=o.pendingLanes,d===0&&(Ri=null),mc(s.stateNode),Dk(o,B()),e!==null)for(a=o.onRecoverableError,s=0;s<e.length;s++)c=e[s],a(c.value,{componentStack:c.stack,digest:c.digest});if(Oi)throw Oi=!1,o=Pi,Pi=null,o;return xk&1&&o.tag!==0&&Hk(),d=o.pendingLanes,d&1?o===zk?yk++:(yk=0,zk=o):yk=0,jg(),null}function Hk(){if(wk!==null){var o=Dc(xk),e=ok.transition,s=C;try{if(ok.transition=null,C=16>o?16:o,wk===null)var a=!1;else{if(o=wk,wk=null,xk=0,K&6)throw Error(p(331));var c=K;for(K|=4,V=o.current;V!==null;){var d=V,h=d.child;if(V.flags&16){var b=d.deletions;if(b!==null){for(var j=0;j<b.length;j++){var $=b[j];for(V=$;V!==null;){var _e=V;switch(_e.tag){case 0:case 11:case 15:Pj(8,_e,d)}var it=_e.child;if(it!==null)it.return=_e,V=it;else for(;V!==null;){_e=V;var at=_e.sibling,lt=_e.return;if(Sj(_e),_e===$){V=null;break}if(at!==null){at.return=lt,V=at;break}V=lt}}}var dt=d.alternate;if(dt!==null){var mt=dt.child;if(mt!==null){dt.child=null;do{var vt=mt.sibling;mt.sibling=null,mt=vt}while(mt!==null)}}V=d}}if(d.subtreeFlags&2064&&h!==null)h.return=d,V=h;else e:for(;V!==null;){if(d=V,d.flags&2048)switch(d.tag){case 0:case 11:case 15:Pj(9,d,d.return)}var tt=d.sibling;if(tt!==null){tt.return=d.return,V=tt;break e}V=d.return}}var nt=o.current;for(V=nt;V!==null;){h=V;var ot=h.child;if(h.subtreeFlags&2064&&ot!==null)ot.return=h,V=ot;else e:for(h=nt;V!==null;){if(b=V,b.flags&2048)try{switch(b.tag){case 0:case 11:case 15:Qj(9,b)}}catch(xt){W(b,b.return,xt)}if(b===h){V=null;break e}var ht=b.sibling;if(ht!==null){ht.return=b.return,V=ht;break e}V=b.return}}if(K=c,jg(),lc&&typeof lc.onPostCommitFiberRoot=="function")try{lc.onPostCommitFiberRoot(kc,o)}catch{}a=!0}return a}finally{C=s,ok.transition=e}}return!1}function Xk(o,e,s){e=Ji(s,e),e=Ni(o,e,1),o=nh(o,e,1),e=R(),o!==null&&(Ac(o,1,e),Dk(o,e))}function W(o,e,s){if(o.tag===3)Xk(o,o,s);else for(;e!==null;){if(e.tag===3){Xk(e,o,s);break}else if(e.tag===1){var a=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(Ri===null||!Ri.has(a))){o=Ji(s,o),o=Qi(e,o,1),e=nh(e,o,1),o=R(),e!==null&&(Ac(e,1,o),Dk(e,o));break}}e=e.return}}function Ti(o,e,s){var a=o.pingCache;a!==null&&a.delete(e),e=R(),o.pingedLanes|=o.suspendedLanes&s,Q===o&&(Z&s)===s&&(T===4||T===3&&(Z&130023424)===Z&&500>B()-fk?Kk(o,0):rk|=s),Dk(o,e)}function Yk(o,e){e===0&&(o.mode&1?(e=sc,sc<<=1,!(sc&130023424)&&(sc=4194304)):e=1);var s=R();o=ih(o,e),o!==null&&(Ac(o,e,s),Dk(o,s))}function uj(o){var e=o.memoizedState,s=0;e!==null&&(s=e.retryLane),Yk(o,s)}function bk(o,e){var s=0;switch(o.tag){case 13:var a=o.stateNode,c=o.memoizedState;c!==null&&(s=c.retryLane);break;case 19:a=o.stateNode;break;default:throw Error(p(314))}a!==null&&a.delete(e),Yk(o,s)}var Vk;Vk=function(o,e,s){if(o!==null)if(o.memoizedProps!==e.pendingProps||Wf.current)dh=!0;else{if(!(o.lanes&s)&&!(e.flags&128))return dh=!1,yj(o,e,s);dh=!!(o.flags&131072)}else dh=!1,I&&e.flags&1048576&&ug(e,ng,e.index);switch(e.lanes=0,e.tag){case 2:var a=e.type;ij(o,e),o=e.pendingProps;var c=Yf(e,H.current);ch(e,s),c=Nh(null,e,a,o,c,s);var d=Sh();return e.flags|=1,typeof c=="object"&&c!==null&&typeof c.render=="function"&&c.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Zf(a)?(d=!0,cg(e)):d=!1,e.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,kh(e),c.updater=Ei,e.stateNode=c,c._reactInternals=e,Ii(e,a,o,s),e=jj(null,e,a,!0,d,s)):(e.tag=0,I&&d&&vg(e),Xi(null,e,c,s),e=e.child),e;case 16:a=e.elementType;e:{switch(ij(o,e),o=e.pendingProps,c=a._init,a=c(a._payload),e.type=a,c=e.tag=Zk(a),o=Ci(a,o),c){case 0:e=cj(null,e,a,o,s);break e;case 1:e=hj(null,e,a,o,s);break e;case 11:e=Yi(null,e,a,o,s);break e;case 14:e=$i(null,e,a,Ci(a.type,o),s);break e}throw Error(p(306,a,""))}return e;case 0:return a=e.type,c=e.pendingProps,c=e.elementType===a?c:Ci(a,c),cj(o,e,a,c,s);case 1:return a=e.type,c=e.pendingProps,c=e.elementType===a?c:Ci(a,c),hj(o,e,a,c,s);case 3:e:{if(kj(e),o===null)throw Error(p(387));a=e.pendingProps,d=e.memoizedState,c=d.element,lh(o,e),qh(e,a,null,s);var h=e.memoizedState;if(a=h.element,d.isDehydrated)if(d={element:a,isDehydrated:!1,cache:h.cache,pendingSuspenseBoundaries:h.pendingSuspenseBoundaries,transitions:h.transitions},e.updateQueue.baseState=d,e.memoizedState=d,e.flags&256){c=Ji(Error(p(423)),e),e=lj(o,e,a,s,c);break e}else if(a!==c){c=Ji(Error(p(424)),e),e=lj(o,e,a,s,c);break e}else for(yg=Lf(e.stateNode.containerInfo.firstChild),xg=e,I=!0,zg=null,s=Vg(e,null,a,s),e.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(Ig(),a===c){e=Zi(o,e,s);break e}Xi(o,e,a,s)}e=e.child}return e;case 5:return Ah(e),o===null&&Eg(e),a=e.type,c=e.pendingProps,d=o!==null?o.memoizedProps:null,h=c.children,Ef(a,c)?h=null:d!==null&&Ef(a,d)&&(e.flags|=32),gj(o,e),Xi(o,e,h,s),e.child;case 6:return o===null&&Eg(e),null;case 13:return oj(o,e,s);case 4:return yh(e,e.stateNode.containerInfo),a=e.pendingProps,o===null?e.child=Ug(e,null,a,s):Xi(o,e,a,s),e.child;case 11:return a=e.type,c=e.pendingProps,c=e.elementType===a?c:Ci(a,c),Yi(o,e,a,c,s);case 7:return Xi(o,e,e.pendingProps,s),e.child;case 8:return Xi(o,e,e.pendingProps.children,s),e.child;case 12:return Xi(o,e,e.pendingProps.children,s),e.child;case 10:e:{if(a=e.type._context,c=e.pendingProps,d=e.memoizedProps,h=c.value,G(Wg,a._currentValue),a._currentValue=h,d!==null)if(He(d.value,h)){if(d.children===c.children&&!Wf.current){e=Zi(o,e,s);break e}}else for(d=e.child,d!==null&&(d.return=e);d!==null;){var b=d.dependencies;if(b!==null){h=d.child;for(var j=b.firstContext;j!==null;){if(j.context===a){if(d.tag===1){j=mh(-1,s&-s),j.tag=2;var $=d.updateQueue;if($!==null){$=$.shared;var _e=$.pending;_e===null?j.next=j:(j.next=_e.next,_e.next=j),$.pending=j}}d.lanes|=s,j=d.alternate,j!==null&&(j.lanes|=s),bh(d.return,s,e),b.lanes|=s;break}j=j.next}}else if(d.tag===10)h=d.type===e.type?null:d.child;else if(d.tag===18){if(h=d.return,h===null)throw Error(p(341));h.lanes|=s,b=h.alternate,b!==null&&(b.lanes|=s),bh(h,s,e),h=d.sibling}else h=d.child;if(h!==null)h.return=d;else for(h=d;h!==null;){if(h===e){h=null;break}if(d=h.sibling,d!==null){d.return=h.return,h=d;break}h=h.return}d=h}Xi(o,e,c.children,s),e=e.child}return e;case 9:return c=e.type,a=e.pendingProps.children,ch(e,s),c=eh(c),a=a(c),e.flags|=1,Xi(o,e,a,s),e.child;case 14:return a=e.type,c=Ci(a,e.pendingProps),c=Ci(a.type,c),$i(o,e,a,c,s);case 15:return bj(o,e,e.type,e.pendingProps,s);case 17:return a=e.type,c=e.pendingProps,c=e.elementType===a?c:Ci(a,c),ij(o,e),e.tag=1,Zf(a)?(o=!0,cg(e)):o=!1,ch(e,s),Gi(e,a,c),Ii(e,a,c,s),jj(null,e,a,!0,o,s);case 19:return xj(o,e,s);case 22:return dj(o,e,s)}throw Error(p(156,e.tag))};function Fk(o,e){return ac(o,e)}function $k(o,e,s,a){this.tag=o,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Bg(o,e,s,a){return new $k(o,e,s,a)}function aj(o){return o=o.prototype,!(!o||!o.isReactComponent)}function Zk(o){if(typeof o=="function")return aj(o)?1:0;if(o!=null){if(o=o.$$typeof,o===Da)return 11;if(o===Ga)return 14}return 2}function Pg(o,e){var s=o.alternate;return s===null?(s=Bg(o.tag,e,o.key,o.mode),s.elementType=o.elementType,s.type=o.type,s.stateNode=o.stateNode,s.alternate=o,o.alternate=s):(s.pendingProps=e,s.type=o.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=o.flags&14680064,s.childLanes=o.childLanes,s.lanes=o.lanes,s.child=o.child,s.memoizedProps=o.memoizedProps,s.memoizedState=o.memoizedState,s.updateQueue=o.updateQueue,e=o.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},s.sibling=o.sibling,s.index=o.index,s.ref=o.ref,s}function Rg(o,e,s,a,c,d){var h=2;if(a=o,typeof o=="function")aj(o)&&(h=1);else if(typeof o=="string")h=5;else e:switch(o){case ya:return Tg(s.children,c,d,e);case za:h=8,c|=8;break;case Aa:return o=Bg(12,s,e,c|2),o.elementType=Aa,o.lanes=d,o;case Ea:return o=Bg(13,s,e,c),o.elementType=Ea,o.lanes=d,o;case Fa:return o=Bg(19,s,e,c),o.elementType=Fa,o.lanes=d,o;case Ia:return pj(s,c,d,e);default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case Ba:h=10;break e;case Ca:h=9;break e;case Da:h=11;break e;case Ga:h=14;break e;case Ha:h=16,a=null;break e}throw Error(p(130,o==null?o:typeof o,""))}return e=Bg(h,s,e,c),e.elementType=o,e.type=a,e.lanes=d,e}function Tg(o,e,s,a){return o=Bg(7,o,a,e),o.lanes=s,o}function pj(o,e,s,a){return o=Bg(22,o,a,e),o.elementType=Ia,o.lanes=s,o.stateNode={isHidden:!1},o}function Qg(o,e,s){return o=Bg(6,o,null,e),o.lanes=s,o}function Sg(o,e,s){return e=Bg(4,o.children!==null?o.children:[],o.key,e),e.lanes=s,e.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},e}function al(o,e,s,a,c){this.tag=e,this.containerInfo=o,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=zc(0),this.expirationTimes=zc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=zc(0),this.identifierPrefix=a,this.onRecoverableError=c,this.mutableSourceEagerHydrationData=null}function bl(o,e,s,a,c,d,h,b,j){return o=new al(o,e,s,b,j),e===1?(e=1,d===!0&&(e|=8)):e=0,d=Bg(3,null,null,e),o.current=d,d.stateNode=o,d.memoizedState={element:a,isDehydrated:s,cache:null,transitions:null,pendingSuspenseBoundaries:null},kh(d),o}function cl(o,e,s){var a=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:wa,key:a==null?null:""+a,children:o,containerInfo:e,implementation:s}}function dl(o){if(!o)return Vf;o=o._reactInternals;e:{if(Vb(o)!==o||o.tag!==1)throw Error(p(170));var e=o;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(Zf(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(p(171))}if(o.tag===1){var s=o.type;if(Zf(s))return bg(o,s,e)}return e}function el(o,e,s,a,c,d,h,b,j){return o=bl(s,a,!0,o,c,d,h,b,j),o.context=dl(null),s=o.current,a=R(),c=yi(s),d=mh(a,c),d.callback=e??null,nh(s,d,c),o.current.lanes=c,Ac(o,c,a),Dk(o,a),o}function fl(o,e,s,a){var c=e.current,d=R(),h=yi(c);return s=dl(s),e.context===null?e.context=s:e.pendingContext=s,e=mh(d,h),e.payload={element:o},a=a===void 0?null:a,a!==null&&(e.callback=a),o=nh(c,e,h),o!==null&&(gi(o,c,h,d),oh(o,c,h)),h}function gl(o){if(o=o.current,!o.child)return null;switch(o.child.tag){case 5:return o.child.stateNode;default:return o.child.stateNode}}function hl(o,e){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var s=o.retryLane;o.retryLane=s!==0&&s<e?s:e}}function il(o,e){hl(o,e),(o=o.alternate)&&hl(o,e)}function jl(){return null}var kl=typeof reportError=="function"?reportError:function(o){console.error(o)};function ll(o){this._internalRoot=o}ml.prototype.render=ll.prototype.render=function(o){var e=this._internalRoot;if(e===null)throw Error(p(409));fl(o,e,null,null)};ml.prototype.unmount=ll.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var e=o.containerInfo;Rk(function(){fl(null,o,null,null)}),e[uf]=null}};function ml(o){this._internalRoot=o}ml.prototype.unstable_scheduleHydration=function(o){if(o){var e=Hc();o={blockedOn:null,target:o,priority:e};for(var s=0;s<Qc.length&&e!==0&&e<Qc[s].priority;s++);Qc.splice(s,0,o),s===0&&Vc(o)}};function nl(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)}function ol(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11&&(o.nodeType!==8||o.nodeValue!==" react-mount-point-unstable "))}function pl(){}function ql(o,e,s,a,c){if(c){if(typeof a=="function"){var d=a;a=function(){var $=gl(h);d.call($)}}var h=el(e,a,o,0,null,!1,!1,"",pl);return o._reactRootContainer=h,o[uf]=h.current,sf(o.nodeType===8?o.parentNode:o),Rk(),h}for(;c=o.lastChild;)o.removeChild(c);if(typeof a=="function"){var b=a;a=function(){var $=gl(j);b.call($)}}var j=bl(o,0,!1,null,null,!1,!1,"",pl);return o._reactRootContainer=j,o[uf]=j.current,sf(o.nodeType===8?o.parentNode:o),Rk(function(){fl(e,j,s,a)}),j}function rl(o,e,s,a,c){var d=s._reactRootContainer;if(d){var h=d;if(typeof c=="function"){var b=c;c=function(){var j=gl(h);b.call(j)}}fl(e,h,o,c)}else h=ql(s,e,o,c,a);return gl(h)}Ec=function(o){switch(o.tag){case 3:var e=o.stateNode;if(e.current.memoizedState.isDehydrated){var s=tc(e.pendingLanes);s!==0&&(Cc(e,s|1),Dk(e,B()),!(K&6)&&(Gj=B()+500,jg()))}break;case 13:Rk(function(){var a=ih(o,1);if(a!==null){var c=R();gi(a,o,1,c)}}),il(o,1)}};Fc=function(o){if(o.tag===13){var e=ih(o,134217728);if(e!==null){var s=R();gi(e,o,134217728,s)}il(o,134217728)}};Gc=function(o){if(o.tag===13){var e=yi(o),s=ih(o,e);if(s!==null){var a=R();gi(s,o,e,a)}il(o,e)}};Hc=function(){return C};Ic=function(o,e){var s=C;try{return C=o,e()}finally{C=s}};yb=function(o,e,s){switch(e){case"input":if(bb(o,s),e=s.name,s.type==="radio"&&e!=null){for(s=o;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<s.length;e++){var a=s[e];if(a!==o&&a.form===o.form){var c=Db(a);if(!c)throw Error(p(90));Wa(a),bb(a,c)}}}break;case"textarea":ib(o,s);break;case"select":e=s.value,e!=null&&fb(o,!!s.multiple,e,!1)}};Gb=Qk;Hb=Rk;var sl={usingClientEntryPoint:!1,Events:[Cb,ue,Db,Eb,Fb,Qk]},tl={findFiberByHostInstance:Wc,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},ul={bundleType:tl.bundleType,version:tl.version,rendererPackageName:tl.rendererPackageName,rendererConfig:tl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ua.ReactCurrentDispatcher,findHostInstanceByFiber:function(o){return o=Zb(o),o===null?null:o.stateNode},findFiberByHostInstance:tl.findFiberByHostInstance||jl,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var vl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!vl.isDisabled&&vl.supportsFiber)try{kc=vl.inject(ul),lc=vl}catch{}}reactDom_production_min.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=sl;reactDom_production_min.createPortal=function(o,e){var s=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!nl(e))throw Error(p(200));return cl(o,e,null,s)};reactDom_production_min.createRoot=function(o,e){if(!nl(o))throw Error(p(299));var s=!1,a="",c=kl;return e!=null&&(e.unstable_strictMode===!0&&(s=!0),e.identifierPrefix!==void 0&&(a=e.identifierPrefix),e.onRecoverableError!==void 0&&(c=e.onRecoverableError)),e=bl(o,1,!1,null,null,s,!1,a,c),o[uf]=e.current,sf(o.nodeType===8?o.parentNode:o),new ll(e)};reactDom_production_min.findDOMNode=function(o){if(o==null)return null;if(o.nodeType===1)return o;var e=o._reactInternals;if(e===void 0)throw typeof o.render=="function"?Error(p(188)):(o=Object.keys(o).join(","),Error(p(268,o)));return o=Zb(e),o=o===null?null:o.stateNode,o};reactDom_production_min.flushSync=function(o){return Rk(o)};reactDom_production_min.hydrate=function(o,e,s){if(!ol(e))throw Error(p(200));return rl(null,o,e,!0,s)};reactDom_production_min.hydrateRoot=function(o,e,s){if(!nl(o))throw Error(p(405));var a=s!=null&&s.hydratedSources||null,c=!1,d="",h=kl;if(s!=null&&(s.unstable_strictMode===!0&&(c=!0),s.identifierPrefix!==void 0&&(d=s.identifierPrefix),s.onRecoverableError!==void 0&&(h=s.onRecoverableError)),e=el(e,null,o,1,s??null,c,!1,d,h),o[uf]=e.current,sf(o),a)for(o=0;o<a.length;o++)s=a[o],c=s._getVersion,c=c(s._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[s,c]:e.mutableSourceEagerHydrationData.push(s,c);return new ml(e)};reactDom_production_min.render=function(o,e,s){if(!ol(e))throw Error(p(200));return rl(null,o,e,!1,s)};reactDom_production_min.unmountComponentAtNode=function(o){if(!ol(o))throw Error(p(40));return o._reactRootContainer?(Rk(function(){rl(null,null,o,!1,function(){o._reactRootContainer=null,o[uf]=null})}),!0):!1};reactDom_production_min.unstable_batchedUpdates=Qk;reactDom_production_min.unstable_renderSubtreeIntoContainer=function(o,e,s,a){if(!ol(s))throw Error(p(200));if(o==null||o._reactInternals===void 0)throw Error(p(38));return rl(o,e,s,!1,a)};reactDom_production_min.version="18.3.1-next-f1338f8080-20240426";function checkDCE(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE)}catch(o){console.error(o)}}checkDCE(),reactDom.exports=reactDom_production_min;var reactDomExports=reactDom.exports,createRoot,m=reactDomExports;createRoot=m.createRoot,m.hydrateRoot;/**
* react-router v7.18.2
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/var ABSOLUTE_URL_REGEX=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,PROTOCOL_RELATIVE_URL_REGEX=/^[\\/]{2}/;function normalizeProtocolRelativeUrl(o,e){return e+o.replace(/\\/g,"/")}var PopStateEventType="popstate";function isLocation(o){return typeof o=="object"&&o!=null&&"pathname"in o&&"search"in o&&"hash"in o&&"state"in o&&"key"in o}function createBrowserHistory(o={}){function e(a,c){var $;let d=($=c.state)==null?void 0:$.masked,{pathname:h,search:b,hash:j}=d||a.location;return createLocation("",{pathname:h,search:b,hash:j},c.state&&c.state.usr||null,c.state&&c.state.key||"default",d?{pathname:a.location.pathname,search:a.location.search,hash:a.location.hash}:void 0)}function s(a,c){return typeof c=="string"?c:createPath(c)}return getUrlBasedHistory(e,s,null,o)}function invariant(o,e){if(o===!1||o===null||typeof o>"u")throw new Error(e)}function warning(o,e){if(!o){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function createKey(){return Math.random().toString(36).substring(2,10)}function getHistoryState(o,e){return{usr:o.state,key:o.key,idx:e,masked:o.mask?{pathname:o.pathname,search:o.search,hash:o.hash}:void 0}}function createLocation(o,e,s=null,a,c){return{pathname:typeof o=="string"?o:o.pathname,search:"",hash:"",...typeof e=="string"?parsePath(e):e,state:s,key:e&&e.key||a||createKey(),mask:c}}function createPath({pathname:o="/",search:e="",hash:s=""}){return e&&e!=="?"&&(o+=e.charAt(0)==="?"?e:"?"+e),s&&s!=="#"&&(o+=s.charAt(0)==="#"?s:"#"+s),o}function parsePath(o){let e={};if(o){let s=o.indexOf("#");s>=0&&(e.hash=o.substring(s),o=o.substring(0,s));let a=o.indexOf("?");a>=0&&(e.search=o.substring(a),o=o.substring(0,a)),o&&(e.pathname=o)}return e}function getUrlBasedHistory(o,e,s,a={}){let{window:c=document.defaultView,v5Compat:d=!1}=a,h=c.history,b="POP",j=null,$=_e();$==null&&($=0,h.replaceState({...h.state,idx:$},""));function _e(){return(h.state||{idx:null}).idx}function it(){b="POP";let vt=_e(),tt=vt==null?null:vt-$;$=vt,j&&j({action:b,location:mt.location,delta:tt})}function at(vt,tt){b="PUSH";let nt=isLocation(vt)?vt:createLocation(mt.location,vt,tt);$=_e()+1;let ot=getHistoryState(nt,$),ht=mt.createHref(nt.mask||nt);try{h.pushState(ot,"",ht)}catch(xt){if(xt instanceof DOMException&&xt.name==="DataCloneError")throw xt;c.location.assign(ht)}d&&j&&j({action:b,location:mt.location,delta:1})}function lt(vt,tt){b="REPLACE";let nt=isLocation(vt)?vt:createLocation(mt.location,vt,tt);$=_e();let ot=getHistoryState(nt,$),ht=mt.createHref(nt.mask||nt);h.replaceState(ot,"",ht),d&&j&&j({action:b,location:mt.location,delta:0})}function dt(vt){return createBrowserURLImpl(c,vt)}let mt={get action(){return b},get location(){return o(c,h)},listen(vt){if(j)throw new Error("A history only accepts one active listener");return c.addEventListener(PopStateEventType,it),j=vt,()=>{c.removeEventListener(PopStateEventType,it),j=null}},createHref(vt){return e(c,vt)},createURL:dt,encodeLocation(vt){let tt=dt(vt);return{pathname:tt.pathname,search:tt.search,hash:tt.hash}},push:at,replace:lt,go(vt){return h.go(vt)}};return mt}function createBrowserURLImpl(o,e,s=!1){let a="http://localhost";o&&(a=o.location.origin!=="null"?o.location.origin:o.location.href),invariant(a,"No window.location.(origin|href) available to create URL");let c=typeof e=="string"?e:createPath(e);return c=c.replace(/ $/,"%20"),!s&&PROTOCOL_RELATIVE_URL_REGEX.test(c)&&(c=a+c),new URL(c,a)}function matchRoutes(o,e,s="/"){return matchRoutesImpl(o,e,s,!1)}function matchRoutesImpl(o,e,s,a,c){let d=typeof e=="string"?parsePath(e):e,h=stripBasename(d.pathname||"/",s);if(h==null)return null;let b=flattenAndRankRoutes(o),j=null,$=decodePath(h);for(let _e=0;j==null&&_e<b.length;++_e)j=matchRouteBranch(b[_e],$,a);return j}function flattenAndRankRoutes(o){let e=flattenRoutes(o);return rankRouteBranches(e),e}function flattenRoutes(o,e=[],s=[],a="",c=!1){let d=(h,b,j=c,$)=>{let _e={relativePath:$===void 0?h.path||"":$,caseSensitive:h.caseSensitive===!0,childrenIndex:b,route:h};if(_e.relativePath.startsWith("/")){if(!_e.relativePath.startsWith(a)&&j)return;invariant(_e.relativePath.startsWith(a),`Absolute route path "${_e.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),_e.relativePath=_e.relativePath.slice(a.length)}let it=joinPaths([a,_e.relativePath]),at=s.concat(_e);h.children&&h.children.length>0&&(invariant(h.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${it}".`),flattenRoutes(h.children,e,at,it,j)),!(h.path==null&&!h.index)&&e.push({path:it,score:computeScore(it,h.index),routesMeta:at.map((lt,dt)=>{let[mt,vt]=compilePath(lt.relativePath,lt.caseSensitive,dt===at.length-1);return{...lt,matcher:mt,compiledParams:vt}})})};return o.forEach((h,b)=>{var j;if(h.path===""||!((j=h.path)!=null&&j.includes("?")))d(h,b);else for(let $ of explodeOptionalSegments(h.path))d(h,b,!0,$)}),e}function explodeOptionalSegments(o){let e=o.split("/");if(e.length===0)return[];let[s,...a]=e,c=s.endsWith("?"),d=s.replace(/\?$/,"");if(a.length===0)return c?[d,""]:[d];let h=explodeOptionalSegments(a.join("/")),b=[];return b.push(...h.map(j=>j===""?d:[d,j].join("/"))),c&&b.push(...h),b.map(j=>o.startsWith("/")&&j===""?"/":j)}function rankRouteBranches(o){o.sort((e,s)=>e.score!==s.score?s.score-e.score:compareIndexes(e.routesMeta.map(a=>a.childrenIndex),s.routesMeta.map(a=>a.childrenIndex)))}var paramRe=/^:[\w-]+$/,dynamicSegmentValue=3,indexRouteValue=2,emptySegmentValue=1,staticSegmentValue=10,splatPenalty=-2,isSplat=o=>o==="*";function computeScore(o,e){let s=o.split("/"),a=s.length;return s.some(isSplat)&&(a+=splatPenalty),e&&(a+=indexRouteValue),s.filter(c=>!isSplat(c)).reduce((c,d)=>c+(paramRe.test(d)?dynamicSegmentValue:d===""?emptySegmentValue:staticSegmentValue),a)}function compareIndexes(o,e){return o.length===e.length&&o.slice(0,-1).every((a,c)=>a===e[c])?o[o.length-1]-e[e.length-1]:0}function matchRouteBranch(o,e,s=!1){let{routesMeta:a}=o,c={},d="/",h=[];for(let b=0;b<a.length;++b){let j=a[b],$=b===a.length-1,_e=d==="/"?e:e.slice(d.length)||"/",it={path:j.relativePath,caseSensitive:j.caseSensitive,end:$},at=j.matcher&&j.compiledParams?matchPathImpl(it,_e,j.matcher,j.compiledParams):matchPath(it,_e),lt=j.route;if(!at&&$&&s&&!a[a.length-1].route.index&&(at=matchPath({path:j.relativePath,caseSensitive:j.caseSensitive,end:!1},_e)),!at)return null;Object.assign(c,at.params),h.push({params:c,pathname:joinPaths([d,at.pathname]),pathnameBase:normalizePathname(joinPaths([d,at.pathnameBase])),route:lt}),at.pathnameBase!=="/"&&(d=joinPaths([d,at.pathnameBase]))}return h}function matchPath(o,e){typeof o=="string"&&(o={path:o,caseSensitive:!1,end:!0});let[s,a]=compilePath(o.path,o.caseSensitive,o.end);return matchPathImpl(o,e,s,a)}function matchPathImpl(o,e,s,a){let c=e.match(s);if(!c)return null;let d=c[0],h=d.replace(/(.)\/+$/,"$1"),b=c.slice(1);return{params:a.reduce(($,{paramName:_e,isOptional:it},at)=>{if(_e==="*"){let dt=b[at]||"";h=d.slice(0,d.length-dt.length).replace(/(.)\/+$/,"$1")}const lt=b[at];return it&&!lt?$[_e]=void 0:$[_e]=(lt||"").replace(/%2F/g,"/"),$},{}),pathname:d,pathnameBase:h,pattern:o}}function compilePath(o,e=!1,s=!0){warning(o==="*"||!o.endsWith("*")||o.endsWith("/*"),`Route path "${o}" will be treated as if it were "${o.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${o.replace(/\*$/,"/*")}".`);let a=[],c="^"+o.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(h,b,j,$,_e)=>{if(a.push({paramName:b,isOptional:j!=null}),j){let it=_e.charAt($+h.length);return it&&it!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return o.endsWith("*")?(a.push({paramName:"*"}),c+=o==="*"||o==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):s?c+="\\/*$":o!==""&&o!=="/"&&(c+="(?:(?=\\/|$))"),[new RegExp(c,e?void 0:"i"),a]}function decodePath(o){try{return o.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return warning(!1,`The URL path "${o}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${e}).`),o}}function stripBasename(o,e){if(e==="/")return o;if(!o.toLowerCase().startsWith(e.toLowerCase()))return null;let s=e.endsWith("/")?e.length-1:e.length,a=o.charAt(s);return a&&a!=="/"?null:o.slice(s)||"/"}function resolvePath(o,e="/"){let{pathname:s,search:a="",hash:c=""}=typeof o=="string"?parsePath(o):o,d;return s?(s=removeDoubleSlashes(s),s.startsWith("/")?d=resolvePathname(s.substring(1),"/"):d=resolvePathname(s,e)):d=e,{pathname:d,search:normalizeSearch(a),hash:normalizeHash(c)}}function resolvePathname(o,e){let s=removeTrailingSlash(e).split("/");return o.split("/").forEach(c=>{c===".."?s.length>1&&s.pop():c!=="."&&s.push(c)}),s.length>1?s.join("/"):"/"}function getInvalidPathError(o,e,s,a){return`Cannot include a '${o}' character in a manually specified \`to.${e}\` field [${JSON.stringify(a)}]. Please separate it out to the \`to.${s}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function getPathContributingMatches(o){return o.filter((e,s)=>s===0||e.route.path&&e.route.path.length>0)}function getResolveToMatches(o){let e=getPathContributingMatches(o);return e.map((s,a)=>a===e.length-1?s.pathname:s.pathnameBase)}function resolveTo(o,e,s,a=!1){let c;typeof o=="string"?c=parsePath(o):(c={...o},invariant(!c.pathname||!c.pathname.includes("?"),getInvalidPathError("?","pathname","search",c)),invariant(!c.pathname||!c.pathname.includes("#"),getInvalidPathError("#","pathname","hash",c)),invariant(!c.search||!c.search.includes("#"),getInvalidPathError("#","search","hash",c)));let d=o===""||c.pathname==="",h=d?"/":c.pathname,b;if(h==null)b=s;else{let it=e.length-1;if(!a&&h.startsWith("..")){let at=h.split("/");for(;at[0]==="..";)at.shift(),it-=1;c.pathname=at.join("/")}b=it>=0?e[it]:"/"}let j=resolvePath(c,b),$=h&&h!=="/"&&h.endsWith("/"),_e=(d||h===".")&&s.endsWith("/");return!j.pathname.endsWith("/")&&($||_e)&&(j.pathname+="/"),j}var removeDoubleSlashes=o=>o.replace(/[\\/]{2,}/g,"/"),joinPaths=o=>removeDoubleSlashes(o.join("/")),removeTrailingSlash=o=>o.replace(/\/+$/,""),normalizePathname=o=>removeTrailingSlash(o).replace(/^\/*/,"/"),normalizeSearch=o=>!o||o==="?"?"":o.startsWith("?")?o:"?"+o,normalizeHash=o=>!o||o==="#"?"":o.startsWith("#")?o:"#"+o,ErrorResponseImpl=class{constructor(o,e,s,a=!1){this.status=o,this.statusText=e||"",this.internal=a,s instanceof Error?(this.data=s.toString(),this.error=s):this.data=s}};function isRouteErrorResponse(o){return o!=null&&typeof o.status=="number"&&typeof o.statusText=="string"&&typeof o.internal=="boolean"&&"data"in o}function getRoutePattern(o){let e=o.map(s=>s.route.path).filter(Boolean);return joinPaths(e)||"/"}var isBrowser=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function parseToInfo(o,e){let s=o;if(typeof s!="string"||!ABSOLUTE_URL_REGEX.test(s))return{absoluteURL:void 0,isExternal:!1,to:s};let a=s,c=!1;if(isBrowser)try{let d=new URL(window.location.href),h=PROTOCOL_RELATIVE_URL_REGEX.test(s)?new URL(normalizeProtocolRelativeUrl(s,d.protocol)):new URL(s),b=stripBasename(h.pathname,e);h.origin===d.origin&&b!=null?s=b+h.search+h.hash:c=!0}catch{warning(!1,`<Link to="${s}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:a,isExternal:c,to:s}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var validMutationMethodsArr=["POST","PUT","PATCH","DELETE"];new Set(validMutationMethodsArr);var validRequestMethodsArr=["GET",...validMutationMethodsArr];new Set(validRequestMethodsArr);var invalidProtocols=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function hasInvalidProtocol(o){try{return invalidProtocols.includes(new URL(o).protocol)}catch{return!1}}var DataRouterContext=reactExports.createContext(null);DataRouterContext.displayName="DataRouter";var DataRouterStateContext=reactExports.createContext(null);DataRouterStateContext.displayName="DataRouterState";var RSCRouterContext=reactExports.createContext(!1);function useIsRSCRouterContext(){return reactExports.useContext(RSCRouterContext)}var ViewTransitionContext=reactExports.createContext({isTransitioning:!1});ViewTransitionContext.displayName="ViewTransition";var FetchersContext=reactExports.createContext(new Map);FetchersContext.displayName="Fetchers";var AwaitContext=reactExports.createContext(null);AwaitContext.displayName="Await";var NavigationContext=reactExports.createContext(null);NavigationContext.displayName="Navigation";var LocationContext=reactExports.createContext(null);LocationContext.displayName="Location";var RouteContext=reactExports.createContext({outlet:null,matches:[],isDataRoute:!1});RouteContext.displayName="Route";var RouteErrorContext=reactExports.createContext(null);RouteErrorContext.displayName="RouteError";var ERROR_DIGEST_BASE="REACT_ROUTER_ERROR",ERROR_DIGEST_REDIRECT="REDIRECT",ERROR_DIGEST_ROUTE_ERROR_RESPONSE="ROUTE_ERROR_RESPONSE";function decodeRedirectErrorDigest(o){if(o.startsWith(`${ERROR_DIGEST_BASE}:${ERROR_DIGEST_REDIRECT}:{`))try{let e=JSON.parse(o.slice(28));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.location=="string"&&typeof e.reloadDocument=="boolean"&&typeof e.replace=="boolean")return e}catch{}}function decodeRouteErrorResponseDigest(o){if(o.startsWith(`${ERROR_DIGEST_BASE}:${ERROR_DIGEST_ROUTE_ERROR_RESPONSE}:{`))try{let e=JSON.parse(o.slice(40));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string")return new ErrorResponseImpl(e.status,e.statusText,e.data)}catch{}}function useHref(o,{relative:e}={}){invariant(useInRouterContext(),"useHref() may be used only in the context of a <Router> component.");let{basename:s,navigator:a}=reactExports.useContext(NavigationContext),{hash:c,pathname:d,search:h}=useResolvedPath(o,{relative:e}),b=d;return s!=="/"&&(b=d==="/"?s:joinPaths([s,d])),a.createHref({pathname:b,search:h,hash:c})}function useInRouterContext(){return reactExports.useContext(LocationContext)!=null}function useLocation(){return invariant(useInRouterContext(),"useLocation() may be used only in the context of a <Router> component."),reactExports.useContext(LocationContext).location}var navigateEffectWarning="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function useIsomorphicLayoutEffect(o){reactExports.useContext(NavigationContext).static||reactExports.useLayoutEffect(o)}function useNavigate(){let{isDataRoute:o}=reactExports.useContext(RouteContext);return o?useNavigateStable():useNavigateUnstable()}function useNavigateUnstable(){invariant(useInRouterContext(),"useNavigate() may be used only in the context of a <Router> component.");let o=reactExports.useContext(DataRouterContext),{basename:e,navigator:s}=reactExports.useContext(NavigationContext),{matches:a}=reactExports.useContext(RouteContext),{pathname:c}=useLocation(),d=JSON.stringify(getResolveToMatches(a)),h=reactExports.useRef(!1);return useIsomorphicLayoutEffect(()=>{h.current=!0}),reactExports.useCallback((j,$={})=>{if(warning(h.current,navigateEffectWarning),!h.current)return;if(typeof j=="number"){s.go(j);return}let _e=resolveTo(j,JSON.parse(d),c,$.relative==="path");o==null&&e!=="/"&&(_e.pathname=_e.pathname==="/"?e:joinPaths([e,_e.pathname])),($.replace?s.replace:s.push)(_e,$.state,$)},[e,s,d,c,o])}reactExports.createContext(null);function useParams(){let{matches:o}=reactExports.useContext(RouteContext),e=o[o.length-1];return(e==null?void 0:e.params)??{}}function useResolvedPath(o,{relative:e}={}){let{matches:s}=reactExports.useContext(RouteContext),{pathname:a}=useLocation(),c=JSON.stringify(getResolveToMatches(s));return reactExports.useMemo(()=>resolveTo(o,JSON.parse(c),a,e==="path"),[o,c,a,e])}function useRoutes(o,e){return useRoutesImpl(o,e)}function useRoutesImpl(o,e,s){var vt;invariant(useInRouterContext(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=reactExports.useContext(NavigationContext),{matches:c}=reactExports.useContext(RouteContext),d=c[c.length-1],h=d?d.params:{},b=d?d.pathname:"/",j=d?d.pathnameBase:"/",$=d&&d.route;{let tt=$&&$.path||"";warningOnce(b,!$||tt.endsWith("*")||tt.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${b}" (under <Route path="${tt}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
Please change the parent <Route path="${tt}"> to <Route path="${tt==="/"?"*":`${tt}/*`}">.`)}let _e=useLocation(),it;if(e){let tt=typeof e=="string"?parsePath(e):e;invariant(j==="/"||((vt=tt.pathname)==null?void 0:vt.startsWith(j)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${j}" but pathname "${tt.pathname}" was given in the \`location\` prop.`),it=tt}else it=_e;let at=it.pathname||"/",lt=at;if(j!=="/"){let tt=j.replace(/^\//,"").split("/");lt="/"+at.replace(/^\//,"").split("/").slice(tt.length).join("/")}let dt=s&&s.state.matches.length?s.state.matches.map(tt=>Object.assign(tt,{route:s.manifest[tt.route.id]||tt.route})):matchRoutes(o,{pathname:lt});warning($||dt!=null,`No routes matched location "${it.pathname}${it.search}${it.hash}" `),warning(dt==null||dt[dt.length-1].route.element!==void 0||dt[dt.length-1].route.Component!==void 0||dt[dt.length-1].route.lazy!==void 0,`Matched leaf route at location "${it.pathname}${it.search}${it.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let mt=_renderMatches(dt&&dt.map(tt=>Object.assign({},tt,{params:Object.assign({},h,tt.params),pathname:joinPaths([j,a.encodeLocation?a.encodeLocation(tt.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:tt.pathname]),pathnameBase:tt.pathnameBase==="/"?j:joinPaths([j,a.encodeLocation?a.encodeLocation(tt.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:tt.pathnameBase])})),c,s);return e&&mt?reactExports.createElement(LocationContext.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...it},navigationType:"POP"}},mt):mt}function DefaultErrorComponent(){let o=useRouteError(),e=isRouteErrorResponse(o)?`${o.status} ${o.statusText}`:o instanceof Error?o.message:JSON.stringify(o),s=o instanceof Error?o.stack:null,a="rgba(200,200,200, 0.5)",c={padding:"0.5rem",backgroundColor:a},d={padding:"2px 4px",backgroundColor:a},h=null;return console.error("Error handled by React Router default ErrorBoundary:",o),h=reactExports.createElement(reactExports.Fragment,null,reactExports.createElement("p",null,"💿 Hey developer 👋"),reactExports.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",reactExports.createElement("code",{style:d},"ErrorBoundary")," or"," ",reactExports.createElement("code",{style:d},"errorElement")," prop on your route.")),reactExports.createElement(reactExports.Fragment,null,reactExports.createElement("h2",null,"Unexpected Application Error!"),reactExports.createElement("h3",{style:{fontStyle:"italic"}},e),s?reactExports.createElement("pre",{style:c},s):null,h)}var defaultErrorElement=reactExports.createElement(DefaultErrorComponent,null),RenderErrorBoundary=class extends reactExports.Component{constructor(o){super(o),this.state={location:o.location,revalidation:o.revalidation,error:o.error}}static getDerivedStateFromError(o){return{error:o}}static getDerivedStateFromProps(o,e){return e.location!==o.location||e.revalidation!=="idle"&&o.revalidation==="idle"?{error:o.error,location:o.location,revalidation:o.revalidation}:{error:o.error!==void 0?o.error:e.error,location:e.location,revalidation:o.revalidation||e.revalidation}}componentDidCatch(o,e){this.props.onError?this.props.onError(o,e):console.error("React Router caught the following error during render",o)}render(){let o=this.state.error;if(this.context&&typeof o=="object"&&o&&"digest"in o&&typeof o.digest=="string"){const s=decodeRouteErrorResponseDigest(o.digest);s&&(o=s)}let e=o!==void 0?reactExports.createElement(RouteContext.Provider,{value:this.props.routeContext},reactExports.createElement(RouteErrorContext.Provider,{value:o,children:this.props.component})):this.props.children;return this.context?reactExports.createElement(RSCErrorHandler,{error:o},e):e}};RenderErrorBoundary.contextType=RSCRouterContext;var errorRedirectHandledMap=new WeakMap;function RSCErrorHandler({children:o,error:e}){let{basename:s}=reactExports.useContext(NavigationContext);if(typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let a=decodeRedirectErrorDigest(e.digest);if(a){let c=errorRedirectHandledMap.get(e);if(c)throw c;let d=parseToInfo(a.location,s),h=d.absoluteURL||d.to;if(hasInvalidProtocol(h))throw new Error("Invalid redirect location");if(isBrowser&&!errorRedirectHandledMap.get(e))if(d.isExternal||a.reloadDocument)window.location.href=h;else{const b=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(d.to,{replace:a.replace}));throw errorRedirectHandledMap.set(e,b),b}return reactExports.createElement("meta",{httpEquiv:"refresh",content:`0;url=${h}`})}}return o}function RenderedRoute({routeContext:o,match:e,children:s}){let a=reactExports.useContext(DataRouterContext);return a&&a.static&&a.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=e.route.id),reactExports.createElement(RouteContext.Provider,{value:o},s)}function _renderMatches(o,e=[],s){let a=s==null?void 0:s.state;if(o==null){if(!a)return null;if(a.errors)o=a.matches;else if(e.length===0&&!a.initialized&&a.matches.length>0)o=a.matches;else return null}let c=o,d=a==null?void 0:a.errors;if(d!=null){let _e=c.findIndex(it=>it.route.id&&(d==null?void 0:d[it.route.id])!==void 0);invariant(_e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(d).join(",")}`),c=c.slice(0,Math.min(c.length,_e+1))}let h=!1,b=-1;if(s&&a){h=a.renderFallback;for(let _e=0;_e<c.length;_e++){let it=c[_e];if((it.route.HydrateFallback||it.route.hydrateFallbackElement)&&(b=_e),it.route.id){let{loaderData:at,errors:lt}=a,dt=it.route.loader&&!at.hasOwnProperty(it.route.id)&&(!lt||lt[it.route.id]===void 0);if(it.route.lazy||dt){s.isStatic&&(h=!0),b>=0?c=c.slice(0,b+1):c=[c[0]];break}}}}let j=s==null?void 0:s.onError,$=a&&j?(_e,it)=>{var at,lt;j(_e,{location:a.location,params:((lt=(at=a.matches)==null?void 0:at[0])==null?void 0:lt.params)??{},pattern:getRoutePattern(a.matches),errorInfo:it})}:void 0;return c.reduceRight((_e,it,at)=>{let lt,dt=!1,mt=null,vt=null;a&&(lt=d&&it.route.id?d[it.route.id]:void 0,mt=it.route.errorElement||defaultErrorElement,h&&(b<0&&at===0?(warningOnce("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),dt=!0,vt=null):b===at&&(dt=!0,vt=it.route.hydrateFallbackElement||null)));let tt=e.concat(c.slice(0,at+1)),nt=()=>{let ot;return lt?ot=mt:dt?ot=vt:it.route.Component?ot=reactExports.createElement(it.route.Component,null):it.route.element?ot=it.route.element:ot=_e,reactExports.createElement(RenderedRoute,{match:it,routeContext:{outlet:_e,matches:tt,isDataRoute:a!=null},children:ot})};return a&&(it.route.ErrorBoundary||it.route.errorElement||at===0)?reactExports.createElement(RenderErrorBoundary,{location:a.location,revalidation:a.revalidation,component:mt,error:lt,children:nt(),routeContext:{outlet:null,matches:tt,isDataRoute:!0},onError:$}):nt()},null)}function getDataRouterConsoleError(o){return`${o} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function useDataRouterContext(o){let e=reactExports.useContext(DataRouterContext);return invariant(e,getDataRouterConsoleError(o)),e}function useDataRouterState(o){let e=reactExports.useContext(DataRouterStateContext);return invariant(e,getDataRouterConsoleError(o)),e}function useRouteContext(o){let e=reactExports.useContext(RouteContext);return invariant(e,getDataRouterConsoleError(o)),e}function useCurrentRouteId(o){let e=useRouteContext(o),s=e.matches[e.matches.length-1];return invariant(s.route.id,`${o} can only be used on routes that contain a unique "id"`),s.route.id}function useRouteId(){return useCurrentRouteId("useRouteId")}function useRouteError(){var a;let o=reactExports.useContext(RouteErrorContext),e=useDataRouterState("useRouteError"),s=useCurrentRouteId("useRouteError");return o!==void 0?o:(a=e.errors)==null?void 0:a[s]}function useNavigateStable(){let{router:o}=useDataRouterContext("useNavigate"),e=useCurrentRouteId("useNavigate"),s=reactExports.useRef(!1);return useIsomorphicLayoutEffect(()=>{s.current=!0}),reactExports.useCallback(async(c,d={})=>{warning(s.current,navigateEffectWarning),s.current&&(typeof c=="number"?await o.navigate(c):await o.navigate(c,{fromRouteId:e,...d}))},[o,e])}var alreadyWarned={};function warningOnce(o,e,s){!e&&!alreadyWarned[o]&&(alreadyWarned[o]=!0,warning(!1,s))}reactExports.memo(DataRoutes2);function DataRoutes2({routes:o,manifest:e,future:s,state:a,isStatic:c,onError:d}){return useRoutesImpl(o,void 0,{manifest:e,state:a,isStatic:c,onError:d})}function Navigate({to:o,replace:e,state:s,relative:a}){invariant(useInRouterContext(),"<Navigate> may be used only in the context of a <Router> component.");let{static:c}=reactExports.useContext(NavigationContext);warning(!c,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:d}=reactExports.useContext(RouteContext),{pathname:h}=useLocation(),b=useNavigate(),j=resolveTo(o,getResolveToMatches(d),h,a==="path"),$=JSON.stringify(j);return reactExports.useEffect(()=>{b(JSON.parse($),{replace:e,state:s,relative:a})},[b,$,a,e,s]),null}function Route(o){invariant(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function Router({basename:o="/",children:e=null,location:s,navigationType:a="POP",navigator:c,static:d=!1,useTransitions:h}){invariant(!useInRouterContext(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let b=o.replace(/^\/*/,"/"),j=reactExports.useMemo(()=>({basename:b,navigator:c,static:d,useTransitions:h,future:{}}),[b,c,d,h]);typeof s=="string"&&(s=parsePath(s));let{pathname:$="/",search:_e="",hash:it="",state:at=null,key:lt="default",mask:dt}=s,mt=reactExports.useMemo(()=>{let vt=stripBasename($,b);return vt==null?null:{location:{pathname:vt,search:_e,hash:it,state:at,key:lt,mask:dt},navigationType:a}},[b,$,_e,it,at,lt,a,dt]);return warning(mt!=null,`<Router basename="${b}"> is not able to match the URL "${$}${_e}${it}" because it does not start with the basename, so the <Router> won't render anything.`),mt==null?null:reactExports.createElement(NavigationContext.Provider,{value:j},reactExports.createElement(LocationContext.Provider,{children:e,value:mt}))}function Routes({children:o,location:e}){return useRoutes(createRoutesFromChildren(o),e)}function createRoutesFromChildren(o,e=[]){let s=[];return reactExports.Children.forEach(o,(a,c)=>{if(!reactExports.isValidElement(a))return;let d=[...e,c];if(a.type===reactExports.Fragment){s.push.apply(s,createRoutesFromChildren(a.props.children,d));return}invariant(a.type===Route,`[${typeof a.type=="string"?a.type:a.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),invariant(!a.props.index||!a.props.children,"An index route cannot have child routes.");let h={id:a.props.id||d.join("-"),caseSensitive:a.props.caseSensitive,element:a.props.element,Component:a.props.Component,index:a.props.index,path:a.props.path,middleware:a.props.middleware,loader:a.props.loader,action:a.props.action,hydrateFallbackElement:a.props.hydrateFallbackElement,HydrateFallback:a.props.HydrateFallback,errorElement:a.props.errorElement,ErrorBoundary:a.props.ErrorBoundary,hasErrorBoundary:a.props.hasErrorBoundary===!0||a.props.ErrorBoundary!=null||a.props.errorElement!=null,shouldRevalidate:a.props.shouldRevalidate,handle:a.props.handle,lazy:a.props.lazy};a.props.children&&(h.children=createRoutesFromChildren(a.props.children,d)),s.push(h)}),s}var defaultMethod="get",defaultEncType="application/x-www-form-urlencoded";function isHtmlElement(o){return typeof HTMLElement<"u"&&o instanceof HTMLElement}function isButtonElement(o){return isHtmlElement(o)&&o.tagName.toLowerCase()==="button"}function isFormElement(o){return isHtmlElement(o)&&o.tagName.toLowerCase()==="form"}function isInputElement(o){return isHtmlElement(o)&&o.tagName.toLowerCase()==="input"}function isModifiedEvent(o){return!!(o.metaKey||o.altKey||o.ctrlKey||o.shiftKey)}function shouldProcessLinkClick(o,e){return o.button===0&&(!e||e==="_self")&&!isModifiedEvent(o)}function createSearchParams(o=""){return new URLSearchParams(typeof o=="string"||Array.isArray(o)||o instanceof URLSearchParams?o:Object.keys(o).reduce((e,s)=>{let a=o[s];return e.concat(Array.isArray(a)?a.map(c=>[s,c]):[[s,a]])},[]))}function getSearchParamsForLocation(o,e){let s=createSearchParams(o);return e&&e.forEach((a,c)=>{s.has(c)||e.getAll(c).forEach(d=>{s.append(c,d)})}),s}var _formDataSupportsSubmitter=null;function isFormDataSubmitterSupported(){if(_formDataSupportsSubmitter===null)try{new FormData(document.createElement("form"),0),_formDataSupportsSubmitter=!1}catch{_formDataSupportsSubmitter=!0}return _formDataSupportsSubmitter}var supportedFormEncTypes=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function getFormEncType(o){return o!=null&&!supportedFormEncTypes.has(o)?(warning(!1,`"${o}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${defaultEncType}"`),null):o}function getFormSubmissionInfo(o,e){let s,a,c,d,h;if(isFormElement(o)){let b=o.getAttribute("action");a=b?stripBasename(b,e):null,s=o.getAttribute("method")||defaultMethod,c=getFormEncType(o.getAttribute("enctype"))||defaultEncType,d=new FormData(o)}else if(isButtonElement(o)||isInputElement(o)&&(o.type==="submit"||o.type==="image")){let b=o.form;if(b==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let j=o.getAttribute("formaction")||b.getAttribute("action");if(a=j?stripBasename(j,e):null,s=o.getAttribute("formmethod")||b.getAttribute("method")||defaultMethod,c=getFormEncType(o.getAttribute("formenctype"))||getFormEncType(b.getAttribute("enctype"))||defaultEncType,d=new FormData(b,o),!isFormDataSubmitterSupported()){let{name:$,type:_e,value:it}=o;if(_e==="image"){let at=$?`${$}.`:"";d.append(`${at}x`,"0"),d.append(`${at}y`,"0")}else $&&d.append($,it)}}else{if(isHtmlElement(o))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');s=defaultMethod,a=null,c=defaultEncType,h=o}return d&&c==="text/plain"&&(h=d,d=void 0),{action:a,method:s.toLowerCase(),encType:c,formData:d,body:h}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function invariant2(o,e){if(o===!1||o===null||typeof o>"u")throw new Error(e)}function singleFetchUrl(o,e,s,a){let c=typeof o=="string"?new URL(o,typeof window>"u"?"server://singlefetch/":window.location.origin):o;return s?c.pathname.endsWith("/")?c.pathname=`${c.pathname}_.${a}`:c.pathname=`${c.pathname}.${a}`:c.pathname==="/"?c.pathname=`_root.${a}`:e&&stripBasename(c.pathname,e)==="/"?c.pathname=`${removeTrailingSlash(e)}/_root.${a}`:c.pathname=`${removeTrailingSlash(c.pathname)}.${a}`,c}async function loadRouteModule(o,e){if(o.id in e)return e[o.id];try{let s=await import(o.module);return e[o.id]=s,s}catch(s){return console.error(`Error loading route module \`${o.module}\`, reloading page...`),console.error(s),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function isHtmlLinkDescriptor(o){return o==null?!1:o.href==null?o.rel==="preload"&&typeof o.imageSrcSet=="string"&&typeof o.imageSizes=="string":typeof o.rel=="string"&&typeof o.href=="string"}async function getKeyedPrefetchLinks(o,e,s){let a=await Promise.all(o.map(async c=>{let d=e.routes[c.route.id];if(d){let h=await loadRouteModule(d,s);return h.links?h.links():[]}return[]}));return dedupeLinkDescriptors(a.flat(1).filter(isHtmlLinkDescriptor).filter(c=>c.rel==="stylesheet"||c.rel==="preload").map(c=>c.rel==="stylesheet"?{...c,rel:"prefetch",as:"style"}:{...c,rel:"prefetch"}))}function getNewMatchesForLinks(o,e,s,a,c,d){let h=(j,$)=>s[$]?j.route.id!==s[$].route.id:!0,b=(j,$)=>{var _e;return s[$].pathname!==j.pathname||((_e=s[$].route.path)==null?void 0:_e.endsWith("*"))&&s[$].params["*"]!==j.params["*"]};return d==="assets"?e.filter((j,$)=>h(j,$)||b(j,$)):d==="data"?e.filter((j,$)=>{var it;let _e=a.routes[j.route.id];if(!_e||!_e.hasLoader)return!1;if(h(j,$)||b(j,$))return!0;if(j.route.shouldRevalidate){let at=j.route.shouldRevalidate({currentUrl:new URL(c.pathname+c.search+c.hash,window.origin),currentParams:((it=s[0])==null?void 0:it.params)||{},nextUrl:new URL(o,window.origin),nextParams:j.params,defaultShouldRevalidate:!0});if(typeof at=="boolean")return at}return!0}):[]}function getModuleLinkHrefs(o,e,{includeHydrateFallback:s}={}){return dedupeHrefs(o.map(a=>{let c=e.routes[a.route.id];if(!c)return[];let d=[c.module];return c.clientActionModule&&(d=d.concat(c.clientActionModule)),c.clientLoaderModule&&(d=d.concat(c.clientLoaderModule)),s&&c.hydrateFallbackModule&&(d=d.concat(c.hydrateFallbackModule)),c.imports&&(d=d.concat(c.imports)),d}).flat(1))}function dedupeHrefs(o){return[...new Set(o)]}function sortKeys(o){let e={},s=Object.keys(o).sort();for(let a of s)e[a]=o[a];return e}function dedupeLinkDescriptors(o,e){let s=new Set;return new Set(e),o.reduce((a,c)=>{let d=JSON.stringify(sortKeys(c));return s.has(d)||(s.add(d),a.push({key:d,link:c})),a},[])}function useDataRouterContext2(){let o=reactExports.useContext(DataRouterContext);return invariant2(o,"You must render this element inside a <DataRouterContext.Provider> element"),o}function useDataRouterStateContext(){let o=reactExports.useContext(DataRouterStateContext);return invariant2(o,"You must render this element inside a <DataRouterStateContext.Provider> element"),o}var FrameworkContext=reactExports.createContext(void 0);FrameworkContext.displayName="FrameworkContext";function useFrameworkContext(){let o=reactExports.useContext(FrameworkContext);return invariant2(o,"You must render this element inside a <HydratedRouter> element"),o}function usePrefetchBehavior(o,e){let s=reactExports.useContext(FrameworkContext),[a,c]=reactExports.useState(!1),[d,h]=reactExports.useState(!1),{onFocus:b,onBlur:j,onMouseEnter:$,onMouseLeave:_e,onTouchStart:it}=e,at=reactExports.useRef(null);reactExports.useEffect(()=>{if(o==="render"&&h(!0),o==="viewport"){let mt=tt=>{tt.forEach(nt=>{h(nt.isIntersecting)})},vt=new IntersectionObserver(mt,{threshold:.5});return at.current&&vt.observe(at.current),()=>{vt.disconnect()}}},[o]),reactExports.useEffect(()=>{if(a){let mt=setTimeout(()=>{h(!0)},100);return()=>{clearTimeout(mt)}}},[a]);let lt=()=>{c(!0)},dt=()=>{c(!1),h(!1)};return s?o!=="intent"?[d,at,{}]:[d,at,{onFocus:composeEventHandlers(b,lt),onBlur:composeEventHandlers(j,dt),onMouseEnter:composeEventHandlers($,lt),onMouseLeave:composeEventHandlers(_e,dt),onTouchStart:composeEventHandlers(it,lt)}]:[!1,at,{}]}function composeEventHandlers(o,e){return s=>{o&&o(s),s.defaultPrevented||e(s)}}function PrefetchPageLinks({page:o,...e}){let s=useIsRSCRouterContext(),{nonce:a}=useFrameworkContext(),{router:c}=useDataRouterContext2(),d=reactExports.useMemo(()=>matchRoutes(c.routes,o,c.basename),[c.routes,o,c.basename]);return d?(e.nonce==null&&a&&(e={...e,nonce:a}),s?reactExports.createElement(RSCPrefetchPageLinksImpl,{page:o,matches:d,...e}):reactExports.createElement(PrefetchPageLinksImpl,{page:o,matches:d,...e})):null}function useKeyedPrefetchLinks(o){let{manifest:e,routeModules:s}=useFrameworkContext(),[a,c]=reactExports.useState([]);return reactExports.useEffect(()=>{let d=!1;return getKeyedPrefetchLinks(o,e,s).then(h=>{d||c(h)}),()=>{d=!0}},[o,e,s]),a}function RSCPrefetchPageLinksImpl({page:o,matches:e,...s}){let a=useLocation(),{future:c}=useFrameworkContext(),{basename:d}=useDataRouterContext2(),h=reactExports.useMemo(()=>{if(o===a.pathname+a.search+a.hash)return[];let b=singleFetchUrl(o,d,c.v8_trailingSlashAwareDataRequests,"rsc"),j=!1,$=[];for(let _e of e)typeof _e.route.shouldRevalidate=="function"?j=!0:$.push(_e.route.id);return j&&$.length>0&&b.searchParams.set("_routes",$.join(",")),[b.pathname+b.search]},[d,c.v8_trailingSlashAwareDataRequests,o,a,e]);return reactExports.createElement(reactExports.Fragment,null,h.map(b=>reactExports.createElement("link",{key:b,rel:"prefetch",as:"fetch",href:b,...s})))}function PrefetchPageLinksImpl({page:o,matches:e,...s}){let a=useLocation(),{future:c,manifest:d,routeModules:h}=useFrameworkContext(),{basename:b}=useDataRouterContext2(),{loaderData:j,matches:$}=useDataRouterStateContext(),_e=reactExports.useMemo(()=>getNewMatchesForLinks(o,e,$,d,a,"data"),[o,e,$,d,a]),it=reactExports.useMemo(()=>getNewMatchesForLinks(o,e,$,d,a,"assets"),[o,e,$,d,a]),at=reactExports.useMemo(()=>{if(o===a.pathname+a.search+a.hash)return[];let mt=new Set,vt=!1;if(e.forEach(nt=>{var ht;let ot=d.routes[nt.route.id];!ot||!ot.hasLoader||(!_e.some(xt=>xt.route.id===nt.route.id)&&nt.route.id in j&&((ht=h[nt.route.id])!=null&&ht.shouldRevalidate)||ot.hasClientLoader?vt=!0:mt.add(nt.route.id))}),mt.size===0)return[];let tt=singleFetchUrl(o,b,c.v8_trailingSlashAwareDataRequests,"data");return vt&&mt.size>0&&tt.searchParams.set("_routes",e.filter(nt=>mt.has(nt.route.id)).map(nt=>nt.route.id).join(",")),[tt.pathname+tt.search]},[b,c.v8_trailingSlashAwareDataRequests,j,a,d,_e,e,o,h]),lt=reactExports.useMemo(()=>getModuleLinkHrefs(it,d),[it,d]),dt=useKeyedPrefetchLinks(it);return reactExports.createElement(reactExports.Fragment,null,at.map(mt=>reactExports.createElement("link",{key:mt,rel:"prefetch",as:"fetch",href:mt,...s})),lt.map(mt=>reactExports.createElement("link",{key:mt,rel:"modulepreload",href:mt,...s})),dt.map(({key:mt,link:vt})=>reactExports.createElement("link",{key:mt,nonce:s.nonce,...vt,crossOrigin:vt.crossOrigin??s.crossOrigin})))}function mergeRefs(...o){return e=>{o.forEach(s=>{typeof s=="function"?s(e):s!=null&&(s.current=e)})}}var isBrowser2=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{isBrowser2&&(window.__reactRouterVersion="7.18.2")}catch{}function BrowserRouter({basename:o,children:e,useTransitions:s,window:a}){let c=reactExports.useRef();c.current==null&&(c.current=createBrowserHistory({window:a,v5Compat:!0}));let d=c.current,[h,b]=reactExports.useState({action:d.action,location:d.location}),j=reactExports.useCallback($=>{s===!1?b($):reactExports.startTransition(()=>b($))},[s]);return reactExports.useLayoutEffect(()=>d.listen(j),[d,j]),reactExports.createElement(Router,{basename:o,children:e,location:h.location,navigationType:h.action,navigator:d,useTransitions:s})}var Link=reactExports.forwardRef(function({onClick:e,discover:s="render",prefetch:a="none",relative:c,reloadDocument:d,replace:h,mask:b,state:j,target:$,to:_e,preventScrollReset:it,viewTransition:at,defaultShouldRevalidate:lt,...dt},mt){let{basename:vt,navigator:tt,useTransitions:nt}=reactExports.useContext(NavigationContext),ot=typeof _e=="string"&&ABSOLUTE_URL_REGEX.test(_e),ht=parseToInfo(_e,vt);_e=ht.to;let xt=useHref(_e,{relative:c}),Et=useLocation(),_t=null;if(b){let Jt=resolveTo(b,[],Et.mask?Et.mask.pathname:"/",!0);vt!=="/"&&(Jt.pathname=Jt.pathname==="/"?vt:joinPaths([vt,Jt.pathname])),_t=tt.createHref(Jt)}let[Rt,Bt,Mt]=usePrefetchBehavior(a,dt),Ht=useLinkClickHandler(_e,{replace:h,mask:b,state:j,target:$,preventScrollReset:it,relative:c,viewTransition:at,defaultShouldRevalidate:lt,useTransitions:nt});function er(Jt){e&&e(Jt),Jt.defaultPrevented||Ht(Jt)}let Yt=!(ht.isExternal||d),rr=reactExports.createElement("a",{...dt,...Mt,href:(Yt?_t:void 0)||ht.absoluteURL||xt,onClick:Yt?er:e,ref:mergeRefs(mt,Bt),target:$,"data-discover":!ot&&s==="render"?"true":void 0});return Rt&&!ot?reactExports.createElement(reactExports.Fragment,null,rr,reactExports.createElement(PrefetchPageLinks,{page:xt})):rr});Link.displayName="Link";var NavLink=reactExports.forwardRef(function({"aria-current":e="page",caseSensitive:s=!1,className:a="",end:c=!1,style:d,to:h,viewTransition:b,children:j,...$},_e){let it=useResolvedPath(h,{relative:$.relative}),at=useLocation(),lt=reactExports.useContext(DataRouterStateContext),{navigator:dt,basename:mt}=reactExports.useContext(NavigationContext),vt=lt!=null&&useViewTransitionState(it)&&b===!0,tt=dt.encodeLocation?dt.encodeLocation(it).pathname:it.pathname,nt=at.pathname,ot=lt&<.navigation&<.navigation.location?lt.navigation.location.pathname:null;s||(nt=nt.toLowerCase(),ot=ot?ot.toLowerCase():null,tt=tt.toLowerCase()),ot&&mt&&(ot=stripBasename(ot,mt)||ot);const ht=tt!=="/"&&tt.endsWith("/")?tt.length-1:tt.length;let xt=nt===tt||!c&&nt.startsWith(tt)&&nt.charAt(ht)==="/",Et=ot!=null&&(ot===tt||!c&&ot.startsWith(tt)&&ot.charAt(tt.length)==="/"),_t={isActive:xt,isPending:Et,isTransitioning:vt},Rt=xt?e:void 0,Bt;typeof a=="function"?Bt=a(_t):Bt=[a,xt?"active":null,Et?"pending":null,vt?"transitioning":null].filter(Boolean).join(" ");let Mt=typeof d=="function"?d(_t):d;return reactExports.createElement(Link,{...$,"aria-current":Rt,className:Bt,ref:_e,style:Mt,to:h,viewTransition:b},typeof j=="function"?j(_t):j)});NavLink.displayName="NavLink";var Form=reactExports.forwardRef(({discover:o="render",fetcherKey:e,navigate:s,reloadDocument:a,replace:c,state:d,method:h=defaultMethod,action:b,onSubmit:j,relative:$,preventScrollReset:_e,viewTransition:it,defaultShouldRevalidate:at,...lt},dt)=>{let{useTransitions:mt}=reactExports.useContext(NavigationContext),vt=useSubmit(),tt=useFormAction(b,{relative:$}),nt=h.toLowerCase()==="get"?"get":"post",ot=typeof b=="string"&&ABSOLUTE_URL_REGEX.test(b),ht=xt=>{if(j&&j(xt),xt.defaultPrevented)return;xt.preventDefault();let Et=xt.nativeEvent.submitter,_t=(Et==null?void 0:Et.getAttribute("formmethod"))||h,Rt=()=>vt(Et||xt.currentTarget,{fetcherKey:e,method:_t,navigate:s,replace:c,state:d,relative:$,preventScrollReset:_e,viewTransition:it,defaultShouldRevalidate:at});mt&&s!==!1?reactExports.startTransition(()=>Rt()):Rt()};return reactExports.createElement("form",{ref:dt,method:nt,action:tt,onSubmit:a?j:ht,...lt,"data-discover":!ot&&o==="render"?"true":void 0})});Form.displayName="Form";function getDataRouterConsoleError2(o){return`${o} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function useDataRouterContext3(o){let e=reactExports.useContext(DataRouterContext);return invariant(e,getDataRouterConsoleError2(o)),e}function useLinkClickHandler(o,{target:e,replace:s,mask:a,state:c,preventScrollReset:d,relative:h,viewTransition:b,defaultShouldRevalidate:j,useTransitions:$}={}){let _e=useNavigate(),it=useLocation(),at=useResolvedPath(o,{relative:h});return reactExports.useCallback(lt=>{if(shouldProcessLinkClick(lt,e)){lt.preventDefault();let dt=s!==void 0?s:createPath(it)===createPath(at),mt=()=>_e(o,{replace:dt,mask:a,state:c,preventScrollReset:d,relative:h,viewTransition:b,defaultShouldRevalidate:j});$?reactExports.startTransition(()=>mt()):mt()}},[it,_e,at,s,a,c,e,o,d,h,b,j,$])}function useSearchParams(o){warning(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let e=reactExports.useRef(createSearchParams(o)),s=reactExports.useRef(!1),a=useLocation(),c=reactExports.useMemo(()=>getSearchParamsForLocation(a.search,s.current?null:e.current),[a.search]),d=useNavigate(),h=reactExports.useCallback((b,j)=>{const $=createSearchParams(typeof b=="function"?b(new URLSearchParams(c)):b);s.current=!0,d("?"+$,j)},[d,c]);return[c,h]}var fetcherId=0,getUniqueFetcherId=()=>`__${String(++fetcherId)}__`;function useSubmit(){let{router:o}=useDataRouterContext3("useSubmit"),{basename:e}=reactExports.useContext(NavigationContext),s=useRouteId(),a=o.fetch,c=o.navigate;return reactExports.useCallback(async(d,h={})=>{let{action:b,method:j,encType:$,formData:_e,body:it}=getFormSubmissionInfo(d,e);if(h.navigate===!1){let at=h.fetcherKey||getUniqueFetcherId();await a(at,s,h.action||b,{defaultShouldRevalidate:h.defaultShouldRevalidate,preventScrollReset:h.preventScrollReset,formData:_e,body:it,formMethod:h.method||j,formEncType:h.encType||$,flushSync:h.flushSync})}else await c(h.action||b,{defaultShouldRevalidate:h.defaultShouldRevalidate,preventScrollReset:h.preventScrollReset,formData:_e,body:it,formMethod:h.method||j,formEncType:h.encType||$,replace:h.replace,state:h.state,fromRouteId:s,flushSync:h.flushSync,viewTransition:h.viewTransition})},[a,c,e,s])}function useFormAction(o,{relative:e}={}){let{basename:s}=reactExports.useContext(NavigationContext),a=reactExports.useContext(RouteContext);invariant(a,"useFormAction must be used inside a RouteContext");let[c]=a.matches.slice(-1),d={...useResolvedPath(o||".",{relative:e})},h=useLocation();if(o==null){d.search=h.search;let b=new URLSearchParams(d.search),j=b.getAll("index");if(j.some(_e=>_e==="")){b.delete("index"),j.filter(it=>it).forEach(it=>b.append("index",it));let _e=b.toString();d.search=_e?`?${_e}`:""}}return(!o||o===".")&&c.route.index&&(d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index"),s!=="/"&&(d.pathname=d.pathname==="/"?s:joinPaths([s,d.pathname])),createPath(d)}function useViewTransitionState(o,{relative:e}={}){let s=reactExports.useContext(ViewTransitionContext);invariant(s!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=useDataRouterContext3("useViewTransitionState"),c=useResolvedPath(o,{relative:e});if(!s.isTransitioning)return!1;let d=stripBasename(s.currentLocation.pathname,a)||s.currentLocation.pathname,h=stripBasename(s.nextLocation.pathname,a)||s.nextLocation.pathname;return matchPath(c.pathname,h)!=null||matchPath(c.pathname,d)!=null}var browser$3={},Client$1={},helper={};(function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.BODY_VERBS=o.HTTP_VERBS=o.helper=void 0,o.parseMethodName=c;class e{isPrimitive(h){return typeof h=="string"||typeof h=="number"||typeof h=="boolean"||typeof h>"u"||h===null||typeof h=="symbol"}isPrimitiveByTypeName(h){return h==null?!0:["string","number","boolean","undefined","symbol"].indexOf(h)>-1}}o.helper=new e,o.HTTP_VERBS=["delete","patch","post","put","get"],o.BODY_VERBS=["post","put","patch"];const s=[["create","post"],["update","put"],["remove","delete"]];function a(d){return d.replace(/([A-Z]+)([A-Z][a-z])/g,"$1-$2").replace(/([a-z\d])([A-Z])/g,"$1-$2").toLowerCase()}function c(d){var h;const b=d.toLowerCase();for(const[_e,it]of s)if(b.startsWith(_e)){const at=d.slice(_e.length);return{verb:it,qualifier:at?"/"+a(at):""}}const j=(h=o.HTTP_VERBS.find(_e=>b.startsWith(_e)))!==null&&h!==void 0?h:"get",$=d.slice(j.length);return{verb:j,qualifier:$?"/"+a($):""}}})(helper);var GhostProxy$1={};Object.defineProperty(GhostProxy$1,"__esModule",{value:!0});GhostProxy$1.GhostProxy=void 0;class GhostProxy{static create(e){const s=(a,c)=>({get:function(d,h){const b=c?`${c}.${h}`:h;return d[h]||(d[h]={}),new Proxy((...j)=>typeof d[h]=="function"?d[h](...j):a(b,...j),s(a,b))}});return new Proxy({},s(e))}}GhostProxy$1.GhostProxy=GhostProxy;var __awaiter$c=commonjsGlobal&&commonjsGlobal.__awaiter||function(o,e,s,a){function c(d){return d instanceof s?d:new s(function(h){h(d)})}return new(s||(s=Promise))(function(d,h){function b(_e){try{$(a.next(_e))}catch(it){h(it)}}function j(_e){try{$(a.throw(_e))}catch(it){h(it)}}function $(_e){_e.done?d(_e.value):c(_e.value).then(b,j)}$((a=a.apply(o,e||[])).next())})};Object.defineProperty(Client$1,"__esModule",{value:!0});Client$1.ModuleOptions=Client$1.Client=void 0;const helper_1=helper,GhostProxy_1=GhostProxy$1;function buildUrl(o,e,s,a){const c=o.split("."),d=c[c.length-1],h=c.slice(0,-1),{verb:b,qualifier:j}=(0,helper_1.parseMethodName)(d),$=b.toUpperCase(),_e=[];let it;for(const vt of e)vt!=null&&typeof vt=="object"?it=vt:vt!==void 0&&_e.push(encodeURIComponent(String(vt)));const at=h.length?h.join("/"):a??"",lt=at?"/"+at.toLowerCase():"",dt=s+lt+j+(_e.length?"/"+_e.join("/"):""),mt=helper_1.BODY_VERBS.includes(b);return{url:dt,method:$,body:mt?it:void 0}}class Client{constructor(e){this.options=e,this.options=Object.assign(Object.assign({},new ModuleOptions$5),e),this.ghost=GhostProxy_1.GhostProxy.create(this.customHandler.bind(this))}static fromUrl(e,s){return __awaiter$c(this,void 0,void 0,function*(){const a=new URL(e),c=a.pathname.split("/").filter(Boolean)[0],d=Object.assign({urlPrefix:`${a.protocol}//${a.host}`,customRoot:c},s);return new Client(d)})}customHandler(e,...s){return __awaiter$c(this,void 0,void 0,function*(){var a,c,d;const{url:h,method:b,body:j}=buildUrl(e,s,(c=(a=this.options)===null||a===void 0?void 0:a.urlPrefix)!==null&&c!==void 0?c:"",(d=this.options)===null||d===void 0?void 0:d.customRoot),$=yield fetch(h,{method:b,headers:{"Content-Type":"application/json"},body:j!==void 0?JSON.stringify(j):void 0});if(!$.ok)throw new Error(`${$.status} ${$.statusText} — ${b} ${h}`);return $.json()})}}Client$1.Client=Client;let ModuleOptions$5=class{constructor(){this.urlPrefix=""}};Client$1.ModuleOptions=ModuleOptions$5;(function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.GhostProxy=o.ModuleOptions=o.Client=void 0;var e=Client$1;Object.defineProperty(o,"Client",{enumerable:!0,get:function(){return e.Client}}),Object.defineProperty(o,"ModuleOptions",{enumerable:!0,get:function(){return e.ModuleOptions}});var s=GhostProxy$1;Object.defineProperty(o,"GhostProxy",{enumerable:!0,get:function(){return s.GhostProxy}})})(browser$3);const client=new browser$3.Client({urlPrefix:"/api"}),api=client.ghost,scriptRel="modulepreload",assetsURL=function(o){return"/"+o},seen={},__vitePreload=function(e,s,a){let c=Promise.resolve();if(s&&s.length>0){document.getElementsByTagName("link");const h=document.querySelector("meta[property=csp-nonce]"),b=(h==null?void 0:h.nonce)||(h==null?void 0:h.getAttribute("nonce"));c=Promise.allSettled(s.map(j=>{if(j=assetsURL(j),j in seen)return;seen[j]=!0;const $=j.endsWith(".css"),_e=$?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${j}"]${_e}`))return;const it=document.createElement("link");if(it.rel=$?"stylesheet":scriptRel,$||(it.as="script"),it.crossOrigin="",it.href=j,b&&it.setAttribute("nonce",b),document.head.appendChild(it),$)return new Promise((at,lt)=>{it.addEventListener("load",at),it.addEventListener("error",()=>lt(new Error(`Unable to preload CSS for ${j}`)))})}))}function d(h){const b=new Event("vite:preloadError",{cancelable:!0});if(b.payload=h,window.dispatchEvent(b),!b.defaultPrevented)throw h}return c.then(h=>{for(const b of h||[])b.status==="rejected"&&d(b.reason);return e().catch(d)})},PROTOCOL_VERSION=1;function pathKey(o){const e=o.lastIndexOf("/");return e>=0?o.slice(e+1):o}function toBase64(o){let e="";for(let s=0;s<o.length;s++)e+=String.fromCharCode(o[s]);return btoa(e)}function fromBase64(o){const e=atob(o),s=new Uint8Array(e.length);for(let a=0;a<e.length;a++)s[a]=e.charCodeAt(a);return s}function defaultUrl(){var e;if(typeof window<"u"&&window.location)return`${window.location.protocol==="https:"?"wss":"ws"}://${window.location.host}/db`;const o=globalThis.process;return(e=o==null?void 0:o.env)!=null&&e.BODDB_URL?o.env.BODDB_URL.replace(/^http/,"ws"):"ws://localhost:4460"}class BodClientOptions{constructor(){this.url=defaultUrl(),this.reconnect=!0,this.reconnectInterval=1e3,this.maxReconnectInterval=3e4,this.requestTimeout=3e4,this.offlineQueue=!1,this.offlineQueueCap=100}}class BodClient{constructor(e){if(this.ws=null,this.msgId=0,this.pending=new Map,this.valueCbs=new Map,this.childCbs=new Map,this.activeSubs=new Set,this.streamCbs=new Map,this.activeStreamSubs=new Set,this.vfsDownloadCbs=new Map,this.closed=!1,this._browserAuth=null,this.reconnectTimer=null,this.connectPromise=null,this._authToken=null,this._deviceFingerprint=null,this._welcomeListeners=new Set,this._pendingWelcome=null,this._authComplete=!1,this._offlineQueue=[],this._rec=null,this._recCap=5e3,this.serverInfo=null,this._memStorage=null,this.options={...new BodClientOptions,...e},this.reconnectDelay=this.options.reconnectInterval,this.auth=new AuthFacade(this),typeof localStorage<"u")try{const s=localStorage.getItem("BOD_WS_RECORD");if(s){const a=Number(s);this._recCap=Number.isFinite(a)&&a>0?a:5e3,this._rec=[]}}catch{}}_recPush(e,s,a=!1){this._rec&&(this._rec.push(a?{t:Date.now(),dir:e,data:s,parseError:a}:{t:Date.now(),dir:e,data:s}),this._rec.length>this._recCap&&this._rec.splice(0,this._rec.length-this._recCap))}startRecording(e=5e3){this._recCap=e,this._rec=this._rec??[]}stopRecording(){const e=this._rec??[];return this._rec=null,e}getRecording(){return this._rec??[]}clearRecording(){this._rec&&(this._rec.length=0)}dumpRecording(e="array"){const s=this.getRecording();return e==="json"?JSON.stringify(s,null,2):s}onWelcome(e){return this._welcomeListeners.add(e),()=>{this._welcomeListeners.delete(e)}}get deviceFingerprint(){return this._deviceFingerprint}get authToken(){return this._authToken}async connect(){var e;if(((e=this.ws)==null?void 0:e.readyState)!==WebSocket.OPEN)return this.connectPromise?this.connectPromise:(this.closed=!1,this.connectPromise=new Promise((s,a)=>{const c=new WebSocket(this.options.url);c.onopen=async()=>{var d,h;this._recPush("open",{url:this.options.url}),this.ws=c,this.reconnectDelay=this.options.reconnectInterval,(d=this.onStatusChange)==null||d.call(this,!0);try{if(await((h=this.onConnect)==null?void 0:h.call(this)),this.options.autoAuth&&!this.options.keyAuth){const b=await this._ensureDeviceKeys();this.options.keyAuth={publicKey:b.publicKey,signFn:b.signFn},await this.send("auth-register-device",{publicKey:b.publicKey,displayName:typeof this.options.autoAuth=="object"?this.options.autoAuth.displayName:void 0})}if(this.options.keyAuth){if(this._authToken)try{await this.send("auth",{token:this._authToken})}catch{this._authToken=null}if(!this._authToken){const b=await this.send("auth-challenge",{}),j=await this.options.keyAuth.signFn(b.nonce),$=await this.send("auth-verify",{publicKey:this.options.keyAuth.publicKey,signature:j,nonce:b.nonce});this._authToken=$.token}}else if(this.options.auth){const b=await this.options.auth();b&&await this.send("auth",{token:b})}if(this._authComplete=!0,this._pendingWelcome){this.serverInfo=this._pendingWelcome;for(const b of this._welcomeListeners)b(this.serverInfo);this._pendingWelcome=null}if(this.activeSubs.size>0){const b=[...this.activeSubs].map(j=>{const $=j.indexOf(":"),_e=j.slice(0,$),it=j.slice($+1),at=_e.endsWith("-shallow"),lt=at?_e.slice(0,-8):_e;return{path:it,event:lt,...at?{shallow:!0}:{}}});try{await this.send("batch-sub",{subscriptions:b})}catch{for(const j of b)await this.send("sub",j)}}for(const b of this.activeStreamSubs){const[j,$]=this.splitStreamKey(b);await this.send("stream-sub",{path:j,groupId:$})}await this._flushOfflineQueue(),this.connectPromise=null,s()}catch(b){this.connectPromise=null,a(b)}},c.onmessage=d=>{var j,$;let h;try{h=JSON.parse(typeof d.data=="string"?d.data:d.data.toString()),this._recPush("recv",h)}catch(_e){throw this._recPush("recv",d.data,!0),_e}if(h.type==="welcome"){const _e={protocolVersion:h.protocolVersion,serverVersion:h.serverVersion};if(this._authComplete){this.serverInfo=_e;for(const it of this._welcomeListeners)it(this.serverInfo)}else this._pendingWelcome=_e;h.protocolVersion!==PROTOCOL_VERSION&&(console.warn(`[BodClient] Protocol mismatch: client=${PROTOCOL_VERSION} server=${h.protocolVersion} (v${h.serverVersion})`),($=(j=this.options).onVersionMismatch)==null||$.call(j,{clientProtocol:PROTOCOL_VERSION,serverProtocol:h.protocolVersion,serverVersion:h.serverVersion}));return}if(h.type==="value"){const _e=new ValueSnapshot(h.path,h.data,h.updatedAt),it=this.valueCbs.get(h.path);if(it)for(const lt of it)lt(_e);const at=this.valueCbs.get(`${h.path}\0shallow`);if(at)for(const lt of at)lt(_e);return}if(h.type==="stream"){const _e=`${h.path}:${h.groupId}`,it=this.streamCbs.get(_e);if(it)for(const at of it)at(h.events);return}if(h.type==="child"){const _e={type:h.event,key:h.key,path:h.path+"/"+h.key,val:()=>h.data},it=this.childCbs.get(h.path);if(it)for(const lt of it)lt(_e);const at=this.childCbs.get(`${h.path}\0shallow`);if(at)for(const lt of at)lt(_e);return}if(h.type==="vfs-download-chunk"){const _e=this.vfsDownloadCbs.get(h.transferId);if(_e)for(const it of _e)it(h);return}const b=this.pending.get(h.id);b&&(this.pending.delete(h.id),h.ok?b.resolve(h):b.reject(new Error(h.error||"Unknown error")))},c.onclose=d=>{var h;this._recPush("close",{code:d==null?void 0:d.code,reason:d==null?void 0:d.reason}),this.ws=null,this.serverInfo=null,this._pendingWelcome=null,this._authComplete=!1,(h=this.onStatusChange)==null||h.call(this,!1);for(const[,b]of this.pending)b.reject(new Error("Connection closed"));this.pending.clear(),!this.closed&&this.options.reconnect&&this.scheduleReconnect(),this.connectPromise&&(this.connectPromise=null,a(new Error(`WebSocket connection failed (${this.options.url})`)))},c.onerror=()=>{this._recPush("error","ws error")}}),this.connectPromise)}disconnect(){var e;this.closed=!0,this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),(e=this.ws)==null||e.close(),this.ws=null,this.pending.clear();for(const s of this._offlineQueue)s.reject(new Error("Client disconnected"));this._offlineQueue=[]}scheduleReconnect(){this.closed||(this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect().catch(()=>{this.reconnectDelay=Math.min(this.reconnectDelay*2,this.options.maxReconnectInterval)})},this.reconnectDelay))}_enqueueWrite(e,s){return new Promise((a,c)=>{var h;const d=this._writeDedupKey(e,s);if(d){const b=this._offlineQueue.findIndex(j=>j.dedupKey===d);b!==-1&&(this._offlineQueue[b].resolve({ok:!0,data:null}),this._offlineQueue.splice(b,1))}this._offlineQueue.length>=this.options.offlineQueueCap&&this._offlineQueue.shift().reject(new Error("Offline queue full — dropped")),this._offlineQueue.push({op:e,params:s,resolve:a,reject:c,dedupKey:d}),(h=this.onOfflineQueue)==null||h.call(this,this._offlineQueue.length)})}_writeDedupKey(e,s){if(e==="push"||e==="batch"||e==="update"&&s.updates)return null;const a=s.path;return a?`${e}:${a}`:null}async _flushOfflineQueue(){var s;if(this._offlineQueue.length===0)return;const e=this._offlineQueue.splice(0);(s=this.onOfflineFlush)==null||s.call(this,e.length);for(const a of e)try{const c=await this.sendRaw(a.op,a.params);a.resolve(c)}catch(c){a.reject(c instanceof Error?c:new Error(String(c)))}}nextId(){return String(++this.msgId)}async sendRaw(e,s={},a=!1){return a&&this.options.offlineQueue&&(!this.ws||this.ws.readyState!==WebSocket.OPEN)&&!this.closed?this._enqueueWrite(e,s):((!this.ws||this.ws.readyState!==WebSocket.OPEN)&&await this.connect(),new Promise((c,d)=>{if(!this.ws||this.ws.readyState!==WebSocket.OPEN)return d(new Error("Not connected"));const h=this.nextId();let b=null;const j=()=>{b&&(clearTimeout(b),b=null)};this.pending.set(h,{resolve:$=>{j(),c($)},reject:$=>{j(),d($)}}),this.options.requestTimeout>0&&(b=setTimeout(()=>{this.pending.delete(h),d(new Error(`Request timeout after ${this.options.requestTimeout}ms`))},this.options.requestTimeout)),this._recPush("send",{id:h,op:e,...s}),this.ws.send(JSON.stringify({id:h,op:e,...s}))}))}async send(e,s={},a=!1){return(await this.sendRaw(e,s,a)).data??null}async get(e){return this.send("get",{path:e})}async getSnapshot(e){const s=await this.sendRaw("get",{path:e});return new ValueSnapshot(e,s.data??null,s.updatedAt)}async getShallow(e,s,a){return this.send("get",{path:e??"",shallow:!0,...s!==void 0?{limit:s}:{},...a!==void 0?{offset:a}:{}})}async set(e,s,a){await this.send("set",{path:e,value:s,...a!=null&&a.ttl?{ttl:a.ttl}:{},...(a==null?void 0:a.flatten)!==void 0?{flatten:a.flatten}:{}},!0)}async update(e,s,a){await this.send("update",{path:e,value:s,...a!=null&&a.ttl?{ttl:a.ttl}:{},...(a==null?void 0:a.flatten)!==void 0?{flatten:a.flatten}:{}},!0)}async updateMulti(e){await this.send("update",{updates:e},!0)}async delete(e){await this.send("delete",{path:e},!0)}async batch(e){return this.send("batch",{operations:e},!0)}async push(e,s,a){return this.send("push",{path:e,value:s,idempotencyKey:a==null?void 0:a.idempotencyKey,ttl:a==null?void 0:a.ttl},!0)}query(e){return new ClientQueryBuilder(this,e)}_query(e,s,a,c,d){return this.send("query",{path:e,filters:s,order:a,limit:c,offset:d})}on(e,s,a){var b;const c=!((a==null?void 0:a.deep)??!1),d=`value${c?"-shallow":""}:${e}`,h=c?`${e}\0shallow`:e;return this.valueCbs.has(h)||this.valueCbs.set(h,new Set),this.valueCbs.get(h).add(s),this.activeSubs.has(d)||(this.activeSubs.add(d),((b=this.ws)==null?void 0:b.readyState)===WebSocket.OPEN&&this.send("sub",{path:e,event:"value",...c?{shallow:!0}:{}}).catch(()=>{})),()=>{var j,$,_e;(j=this.valueCbs.get(h))==null||j.delete(s),(($=this.valueCbs.get(h))==null?void 0:$.size)===0&&(this.valueCbs.delete(h),this.activeSubs.delete(d),((_e=this.ws)==null?void 0:_e.readyState)===WebSocket.OPEN&&this.send("unsub",{path:e,event:"value",...c?{shallow:!0}:{}}).catch(()=>{}))}}onChild(e,s,a){var b;const c=!((a==null?void 0:a.deep)??!1),d=`child${c?"-shallow":""}:${e}`,h=c?`${e}\0shallow`:e;return this.childCbs.has(h)||this.childCbs.set(h,new Set),this.childCbs.get(h).add(s),this.activeSubs.has(d)||(this.activeSubs.add(d),((b=this.ws)==null?void 0:b.readyState)===WebSocket.OPEN&&this.send("sub",{path:e,event:"child",...c?{shallow:!0}:{}}).catch(()=>{})),()=>{var j,$,_e;(j=this.childCbs.get(h))==null||j.delete(s),(($=this.childCbs.get(h))==null?void 0:$.size)===0&&(this.childCbs.delete(h),this.activeSubs.delete(d),((_e=this.ws)==null?void 0:_e.readyState)===WebSocket.OPEN&&this.send("unsub",{path:e,event:"child",...c?{shallow:!0}:{}}).catch(()=>{}))}}mq(e){return new MQReader(this,e)}_mqSend(e,s){return this.send(e,s)}stream(e,s){return new StreamReader(this,e,s)}_streamOn(e,s,a){var d;const c=`${e}:${s}`;return this.streamCbs.has(c)||this.streamCbs.set(c,new Set),this.streamCbs.get(c).add(a),this.activeStreamSubs.has(c)||(this.activeStreamSubs.add(c),((d=this.ws)==null?void 0:d.readyState)===WebSocket.OPEN&&this.send("stream-sub",{path:e,groupId:s}).catch(()=>{})),()=>{var h,b,j;(h=this.streamCbs.get(c))==null||h.delete(a),((b=this.streamCbs.get(c))==null?void 0:b.size)===0&&(this.streamCbs.delete(c),this.activeStreamSubs.delete(c),((j=this.ws)==null?void 0:j.readyState)===WebSocket.OPEN&&this.send("stream-unsub",{path:e,groupId:s}).catch(()=>{}))}}_streamRead(e,s,a){return this.send("stream-read",{path:e,groupId:s,limit:a})}_streamAck(e,s,a){return this.send("stream-ack",{path:e,groupId:s,key:a})}splitStreamKey(e){const s=e.lastIndexOf(":");return[e.slice(0,s),e.slice(s+1)]}async search(e){return this.send("fts-search",e)}async index(e,s){const a={path:e};Array.isArray(s)?a.fields=s:a.content=s,await this.send("fts-index",a)}async vectorSearch(e){return this.send("vector-search",e)}async vectorStore(e,s){await this.send("vector-store",{path:e,embedding:s})}async streamSnapshot(e){return this.send("stream-snapshot",{path:e})}async streamMaterialize(e,s){return this.send("stream-materialize",{path:e,...s})}async streamCompact(e,s){return this.send("stream-compact",{path:e,...s})}async streamReset(e){await this.send("stream-reset",{path:e})}get connected(){var e;return((e=this.ws)==null?void 0:e.readyState)===WebSocket.OPEN}onDisconnect(e){return new OnDisconnectRef(this,e)}reconnect(){this.closed=!1,this.connect()}_sendRaw(e,s={}){return this.sendRaw(e,s)}get httpUrl(){return this.options.url.replace(/^ws(s?):\/\//,"http$1://")}vfs(){return new VFSClient(this)}_send(e,s={}){return this.send(e,s)}_onDownloadChunk(e,s){return this.vfsDownloadCbs.has(e)||this.vfsDownloadCbs.set(e,new Set),this.vfsDownloadCbs.get(e).add(s),()=>{var a,c;(a=this.vfsDownloadCbs.get(e))==null||a.delete(s),((c=this.vfsDownloadCbs.get(e))==null?void 0:c.size)===0&&this.vfsDownloadCbs.delete(e)}}async _ensureDeviceKeys(){this._browserAuth??(this._browserAuth=await __vitePreload(()=>import("./keyAuth.browser-CUFzj5iL.js"),[]));const e=this._browserAuth,s=this._getStorage(),a=s.get("boddb-device-pubkey");if(a){const d=s.get("boddb-device-privkey");return this._deviceFingerprint=s.get("boddb-device-fp")??null,{publicKey:a,signFn:h=>e.sign(h,d)}}const c=await e.generateKeyPair();return s.set("boddb-device-pubkey",c.publicKeyBase64),s.set("boddb-device-privkey",c.privateKeyBase64),s.set("boddb-device-fp",c.fingerprint),this._deviceFingerprint=c.fingerprint,{publicKey:c.publicKeyBase64,signFn:d=>e.sign(d,c.privateKeyBase64)}}_getStorage(){return typeof this.options.autoAuth=="object"&&this.options.autoAuth.storage?this.options.autoAuth.storage:typeof localStorage<"u"?{get:e=>localStorage.getItem(e),set:(e,s)=>localStorage.setItem(e,s),remove:e=>localStorage.removeItem(e)}:(this._memStorage||(this._memStorage=new Map),{get:e=>this._memStorage.get(e)??null,set:(e,s)=>this._memStorage.set(e,s),remove:e=>this._memStorage.delete(e)})}}class AuthFacade{constructor(e){this.client=e}async registerDevice(e,s){return this.client._send("auth-register-device",{publicKey:e,displayName:s})}async authenticate(e,s){const a=await this.client._send("auth-challenge",{}),c=await s(a.nonce);return this.client._send("auth-verify",{publicKey:e,signature:c,nonce:a.nonce})}async linkDevice(e,s,a,c){return this.client._send("auth-link-device",{accountFingerprint:e,password:s,devicePublicKey:a,deviceName:c})}async linkDeviceByName(e,s,a,c){return this.client._send("auth-link-device",{displayName:e,password:s,devicePublicKey:a,deviceName:c})}async revokeSession(e){await this.client._send("auth-revoke-session",{sid:e})}async revokeDevice(e,s){await this.client._send("auth-revoke-device",{accountFingerprint:e,deviceFingerprint:s})}async changePassword(e,s,a){await this.client._send("auth-change-password",{fingerprint:e,oldPassword:s,newPassword:a})}async createAccount(e,s,a,c){return this.client._send("auth-create-account",{password:e,roles:s,displayName:a,devicePublicKey:c})}async createRole(e){await this.client._send("auth-create-role",{role:e})}async deleteRole(e){await this.client._send("auth-delete-role",{roleId:e})}async updateRoles(e,s){await this.client._send("auth-update-roles",{accountFingerprint:e,roles:s})}async listAccounts(){return this.client._send("auth-list-accounts",{})}async listRoles(){return this.client._send("auth-list-roles",{})}async listDevices(e){return this.client._send("auth-list-devices",{accountFingerprint:e})}async listSessions(e){return this.client._send("auth-list-sessions",{accountFingerprint:e})}async requestApproval(e){return this.client._send("auth-request-approval",{publicKey:e})}async approveDevice(e){return this.client._send("auth-approve-device",{requestId:e})}async listAccountFingerprints(){return this.client._send("auth-list-account-fingerprints",{})}async hasAccounts(){return(await this.client._send("auth-has-accounts",{})).hasAccounts}async getAccountInfo(e){return this.client._send("auth-account-info",{accountFingerprint:e})}async pollApproval(e){return this.client._send("auth-poll-approval",{requestId:e})}}class ValueSnapshot{constructor(e,s,a){this.path=e,this.data=s,this.updatedAt=a}val(){return this.data}get key(){return pathKey(this.path)}exists(){return this.data!==null&&this.data!==void 0}}class StreamReader{constructor(e,s,a){this.client=e,this.path=s,this.groupId=a}on(e){return this.client._streamOn(this.path,this.groupId,s=>{e(s.map(a=>({key:a.key,val:()=>a.data})))})}async read(e){return(await this.client._streamRead(this.path,this.groupId,e)).map(a=>({key:a.key,val:()=>a.data}))}async ack(e){return this.client._streamAck(this.path,this.groupId,e)}}class ClientQueryBuilder{constructor(e,s){this.client=e,this.basePath=s,this.filters=[]}where(e,s,a){return this.filters.push({field:e,op:s,value:a}),this}order(e,s="asc"){return this.orderClause={field:e,dir:s},this}limit(e){return this.limitVal=e,this}offset(e){return this.offsetVal=e,this}get(){return this.client._query(this.basePath,this.filters.length?this.filters:void 0,this.orderClause,this.limitVal,this.offsetVal)}}class MQMessageSnapshot{constructor(e,s,a,c,d){this.key=e,this.path=s,this.deliveryCount=a,this.status=c,this.data=d}val(){return this.data}exists(){return this.data!==null&&this.data!==void 0}}class VFSClient{constructor(e){this.client=e}async upload(e,s,a){const c=`${this.client.httpUrl}/files/${e}`,h=await(await fetch(c,{method:"POST",body:new Blob([s]),headers:{"Content-Type":a||"application/octet-stream"}})).json();if(!h.ok)throw new Error(h.error||"Upload failed");return h.data}async download(e){const s=`${this.client.httpUrl}/files/${e}`,a=await fetch(s);if(!a.ok)throw new Error("Download failed");return new Uint8Array(await a.arrayBuffer())}async uploadWS(e,s,a){const c=await this.client._send("vfs-upload-init",{path:e,size:s.byteLength,mime:a}),d=toBase64(s),h=48e3,b=Math.ceil(d.length/h)||1;for(let j=0;j<b;j++){const $=d.slice(j*h,(j+1)*h);await this.client._send("vfs-upload-chunk",{transferId:c,data:$,seq:j})}return await this.client._send("vfs-upload-done",{transferId:c})}async downloadWS(e){const s=await this.client._send("vfs-download-init",{path:e}),a=[];return new Promise((c,d)=>{const h=setTimeout(()=>{b(),d(new Error("Download timeout"))},3e4),b=this.client._onDownloadChunk(s.transferId,j=>{a[j.seq]=j.data,j.done&&(clearTimeout(h),b(),c(fromBase64(a.join(""))))})})}async stat(e){return await this.client._send("vfs-stat",{path:e})}async list(e){return await this.client._send("vfs-list",{path:e})}async tree(e,s){return await this.client._send("vfs-tree",{path:e,...s})}async delete(e){await this.client._send("vfs-delete",{path:e})}async mkdir(e){return await this.client._send("vfs-mkdir",{path:e})}async move(e,s){return await this.client._send("vfs-move",{path:e,dst:s})}async uploadResumable(e,s,a){var $;const c=(a==null?void 0:a.chunkSize)||262144,d=s.byteLength,b=(await this.client._send("vfs-resumable-init",{path:e,totalSize:d,mime:a==null?void 0:a.mime})).sessionId;let j=0;for(;j<d;){const _e=Math.min(j+c,d),it=s.slice(j,_e),at=toBase64(it);j=(await this.client._send("vfs-resumable-chunk",{sessionId:b,offset:j,data:at})).receivedBytes,($=a==null?void 0:a.onProgress)==null||$.call(a,j,d)}return await this.client._send("vfs-resumable-done",{sessionId:b})}async resumeUpload(e,s,a){var j;const c=(a==null?void 0:a.chunkSize)||262144,d=await this.client._send("vfs-resumable-status",{sessionId:e});let h=d.receivedBytes;const b=d.totalSize;for(;h<b;){const $=Math.min(h+c,b),_e=s.slice(h,$),it=toBase64(_e);h=(await this.client._send("vfs-resumable-chunk",{sessionId:e,offset:h,data:it})).receivedBytes,(j=a==null?void 0:a.onProgress)==null||j.call(a,h,b)}return await this.client._send("vfs-resumable-done",{sessionId:e})}async getUploadStatus(e){return await this.client._send("vfs-resumable-status",{sessionId:e})}async updateMetadata(e,s){return await this.client._send("vfs-update-metadata",{path:e,...s})}async presign(e,s){const a=(s==null?void 0:s.method)||"GET",c=await this.client._send("vfs-presign",{path:e,expiresIn:s==null?void 0:s.expiresIn,method:a});return`${this.client.httpUrl}/files/${e}?sig=${c.sig}&exp=${c.exp}`}}class MQReader{constructor(e,s){this.client=e,this.queue=s}async push(e,s){return this.client._mqSend("mq-push",{path:this.queue,value:e,idempotencyKey:s==null?void 0:s.idempotencyKey})}async fetch(e){return(await this.client._mqSend("mq-fetch",{path:this.queue,count:e})).map(a=>new MQMessageSnapshot(a.key,a.path,a.deliveryCount,a.status,a.data))}async ack(e){await this.client._mqSend("mq-ack",{path:this.queue,key:e})}async nack(e){await this.client._mqSend("mq-nack",{path:this.queue,key:e})}async peek(e){return(await this.client._mqSend("mq-peek",{path:this.queue,count:e})).map(a=>new MQMessageSnapshot(a.key,a.path,a.deliveryCount,a.status,a.data))}async dlq(){return(await this.client._mqSend("mq-dlq",{path:this.queue})).map(s=>new MQMessageSnapshot(s.key,s.path,s.deliveryCount,s.status,s.data))}async purge(e){return this.client._mqSend("mq-purge",{path:this.queue,all:e==null?void 0:e.all})}}class OnDisconnectRef{constructor(e,s){this.client=e,this.path=s}async set(e){await this.client._send("on-disconnect-set",{path:this.path,value:e})}async update(e){await this.client._send("on-disconnect-update",{path:this.path,value:e})}async delete(){await this.client._send("on-disconnect-delete",{path:this.path})}async cancel(){await this.client._send("on-disconnect-cancel",{path:this.path})}}const wsProto=window.location.protocol==="https:"?"wss:":"ws:",DB_URL=`${wsProto}//${window.location.host}/db`,db=new BodClient({url:DB_URL});let connecting=!1;async function ensureConnected(){if(!(db.connected||connecting)){connecting=!0;try{await db.connect()}finally{connecting=!1}}}const styles={scheduled:"bg-violet-500/10 text-violet-400",waiting:"bg-amber-500/10 text-amber-400",live:"bg-emerald-500/10 text-emerald-400",ended:"bg-zinc-500/10 text-zinc-500"};function StatusBadge({status:o,size:e="sm"}){const s=e==="xs"?"text-[10px]":"text-[11px]";return jsxRuntimeExports.jsxs("span",{className:`${s} font-semibold uppercase tracking-wider px-2 py-0.5 rounded-full ${styles[o]??styles.ended}`,children:[o==="live"&&jsxRuntimeExports.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full bg-emerald-400 mr-1.5 animate-pulse"}),o]})}const STORAGE_KEY$3="theme";function nextMorning(){const o=new Date;return o.setDate(o.getDate()+1),o.setHours(6,0,0,0),o.getTime()}function readStored(){try{const o=localStorage.getItem(STORAGE_KEY$3);if(!o)return null;const{value:e,expires:s}=JSON.parse(o);return Date.now()>s?(localStorage.removeItem(STORAGE_KEY$3),null):e}catch{return null}}function systemTheme(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function applyTheme(o){document.documentElement.classList.toggle("dark",o==="dark"),document.documentElement.classList.toggle("light",o==="light")}function useTheme(){const[o,e]=reactExports.useState(()=>readStored()??systemTheme());reactExports.useEffect(()=>{applyTheme(o)},[o]),reactExports.useEffect(()=>{if(readStored())return;const a=window.matchMedia("(prefers-color-scheme: dark)"),c=d=>{readStored()||e(d.matches?"dark":"light")};return a.addEventListener("change",c),()=>a.removeEventListener("change",c)},[]);function s(){const a=o==="dark"?"light":"dark";localStorage.setItem(STORAGE_KEY$3,JSON.stringify({value:a,expires:nextMorning()})),e(a)}return{theme:o,toggle:s}}function ThemeToggle(){const{theme:o,toggle:e}=useTheme();return jsxRuntimeExports.jsx("button",{onClick:e,"aria-label":"Toggle theme",className:"w-8 h-8 flex items-center justify-center rounded-lg text-muted hover:text-text hover:bg-surface-2 transition-colors",children:o==="dark"?jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("circle",{cx:"12",cy:"12",r:"4"}),jsxRuntimeExports.jsx("path",{d:"M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41"})]}):jsxRuntimeExports.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntimeExports.jsx("path",{d:"M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z"})})})}function bytesToHex(o){return Array.from(o,e=>e.toString(16).padStart(2,"0")).join("")}function randomId(o=8){if(typeof crypto<"u"){if(typeof crypto.randomUUID=="function")return crypto.randomUUID().replace(/-/g,"").slice(0,o);if(typeof crypto.getRandomValues=="function"){const e=new Uint8Array(Math.ceil(o/2));return crypto.getRandomValues(e),bytesToHex(e).slice(0,o)}}return Array.from({length:o},()=>(Math.random()*16|0).toString(16)).join("")}const STORAGE_KEY$2="para-li-identity";function loadIdentity(){try{const o=localStorage.getItem(STORAGE_KEY$2);return o?JSON.parse(o):null}catch{return null}}function saveIdentity(o){localStorage.setItem(STORAGE_KEY$2,JSON.stringify(o))}function useIdentity(){const[o,e]=reactExports.useState(loadIdentity);return{identity:o,setName:a=>{const c=(o==null?void 0:o.id)??randomId(8),d={displayName:a,id:c};return saveIdentity(d),e(d),d}}}const MODE_LABELS$1={"hot-seat":"Hot Seat",roundtable:"Roundtable","co-learning":"Co-Learning",panel:"Panel",game:"Game Show"};function LobbyPage(){const[o,e]=reactExports.useState([]),[s,a]=reactExports.useState(!0),c=useNavigate(),[d,h]=useSearchParams(),{identity:b}=useIdentity(),[j,$]=reactExports.useState("");return reactExports.useEffect(()=>{if(d.get("kicked")){$("You were removed from the room by the host"),h({},{replace:!0});const _e=setTimeout(()=>$(""),4e3);return()=>clearTimeout(_e)}},[]),reactExports.useEffect(()=>{api.lobby.get().then(e).catch(()=>{}).finally(()=>a(!1))},[]),reactExports.useEffect(()=>{let _e=!1;const it=[];return ensureConnected().then(()=>{_e||it.push(db.onChild("lobby",at=>{const lt=at.val();at.type==="added"?e(dt=>dt.some(mt=>mt.id===at.key)?dt:[{...lt,id:at.key},...dt]):at.type==="changed"?e(dt=>dt.map(mt=>mt.id===at.key?{...lt,id:at.key}:mt)):at.type==="removed"&&e(dt=>dt.filter(mt=>mt.id!==at.key))}))}),()=>{_e=!0,it.forEach(at=>at())}},[]),jsxRuntimeExports.jsxs("div",{className:"min-h-dvh flex flex-col",children:[j&&jsxRuntimeExports.jsx("div",{className:"fixed top-4 left-1/2 -translate-x-1/2 z-[100] px-4 py-2.5 rounded-lg bg-red-500/90 text-white text-sm font-medium shadow-lg",children:j}),jsxRuntimeExports.jsx("header",{className:"border-b border-border/60 backdrop-blur-xl bg-bg/80 sticky top-0 z-50",children:jsxRuntimeExports.jsxs("div",{className:"max-w-5xl mx-auto flex items-center justify-between px-6 h-14",children:[jsxRuntimeExports.jsx("span",{className:"text-[15px] font-semibold tracking-tight",children:"Para"}),jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntimeExports.jsx(ThemeToggle,{}),b&&jsxRuntimeExports.jsx("button",{onClick:()=>c("/profile"),className:"px-2.5 h-8 rounded-lg bg-surface border border-border/60 text-[13px] text-muted hover:text-text hover:border-border-hover transition-colors",children:b.displayName}),jsxRuntimeExports.jsx(Link,{to:"/create",className:"inline-flex items-center gap-1.5 px-4 h-8 rounded-lg bg-white text-black text-[13px] font-medium hover:bg-zinc-200 transition-colors",children:"Create Room"})]})]})}),jsxRuntimeExports.jsxs("main",{className:"flex-1 max-w-5xl w-full mx-auto px-6 py-12",children:[jsxRuntimeExports.jsxs("div",{className:"mb-12",children:[jsxRuntimeExports.jsx("h1",{className:"text-3xl font-bold tracking-tight",children:"Live Rooms"}),jsxRuntimeExports.jsx("p",{className:"text-muted mt-2 text-[15px]",children:"Join a live AI-hosted session with real people."})]}),s?jsxRuntimeExports.jsx("div",{className:"flex items-center justify-center py-24 text-muted text-sm",children:"Loading..."}):o.length===0?jsxRuntimeExports.jsxs("div",{className:"flex flex-col items-center justify-center py-24 text-center",children:[jsxRuntimeExports.jsx("div",{className:"w-12 h-12 rounded-full bg-surface-2 flex items-center justify-center mb-4",children:jsxRuntimeExports.jsx("svg",{className:"w-5 h-5 text-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:jsxRuntimeExports.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 18.75a6 6 0 006-6v-1.5m-6 7.5a6 6 0 01-6-6v-1.5m6 7.5v3.75m-3.75 0h7.5M12 15.75a3 3 0 01-3-3V4.5a3 3 0 116 0v8.25a3 3 0 01-3 3z"})})}),jsxRuntimeExports.jsx("p",{className:"text-muted text-sm mb-1",children:"No live rooms right now"}),jsxRuntimeExports.jsx("p",{className:"text-zinc-600 text-xs mb-6",children:"Be the first to start a session"}),jsxRuntimeExports.jsx(Link,{to:"/create",className:"inline-flex items-center px-5 h-9 rounded-lg bg-white text-black text-sm font-medium hover:bg-zinc-200 transition-colors",children:"Create a room"})]}):jsxRuntimeExports.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:o.map(_e=>{const it=_e.status==="live",at=_e.status==="scheduled";return jsxRuntimeExports.jsxs("button",{onClick:()=>c(`/room/${_e.id}`),className:`group text-left p-5 rounded-xl bg-surface border transition-all duration-150 hover:bg-surface-2 ${it?"border-accent/40 hover:border-accent/60 shadow-[0_0_12px_-3px] shadow-accent/20":at?"border-violet-500/40 hover:border-violet-500/60 shadow-[0_0_12px_-3px] shadow-violet-500/20":"border-border/60 hover:border-border-hover"}`,children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between mb-3",children:[jsxRuntimeExports.jsx(StatusBadge,{status:_e.status}),jsxRuntimeExports.jsx("span",{className:"text-[11px] text-muted uppercase tracking-wider font-medium",children:MODE_LABELS$1[_e.mode]??_e.mode})]}),jsxRuntimeExports.jsx("h3",{className:"text-[15px] font-semibold mb-3 group-hover:text-text transition-colors",children:_e.title||jsxRuntimeExports.jsx("span",{className:"text-muted italic font-normal",children:"Untitled"})}),it&&_e.hotSeatName&&jsxRuntimeExports.jsxs("p",{className:"text-xs text-accent mb-2 truncate",children:[_e.hotSeatName," is on the hot seat"]}),jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between text-xs text-muted",children:[jsxRuntimeExports.jsx("span",{children:_e.hostName}),jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-3",children:[_e.status!=="scheduled"&&jsxRuntimeExports.jsxs("span",{className:"flex items-center gap-1",children:[jsxRuntimeExports.jsx("span",{className:`inline-block w-1.5 h-1.5 rounded-full ${it?"bg-accent animate-pulse":"bg-accent/60"}`}),_e.participantCount]}),_e.status==="scheduled"&&_e.scheduledFor?jsxRuntimeExports.jsx("span",{className:"text-violet-400",children:new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}).format(_e.scheduledFor)}):jsxRuntimeExports.jsx(ElapsedTime,{createdAt:_e.createdAt})]})]})]},_e.id)})})]})]})}function ElapsedTime({createdAt:o}){const[e,s]=reactExports.useState(Date.now());reactExports.useEffect(()=>{const c=setInterval(()=>s(Date.now()),6e4);return()=>clearInterval(c)},[]);const a=reactExports.useMemo(()=>{const c=Math.floor((e-(Number(o)||e))/6e4);return c<1?"just now":c<60?`${c}m`:`${Math.floor(c/60)}h ${c%60}m`},[e,o]);return jsxRuntimeExports.jsx("span",{children:a})}function toLocalDateTimeString(o){const e=new Date(o),s=a=>String(a).padStart(2,"0");return`${e.getFullYear()}-${s(e.getMonth()+1)}-${s(e.getDate())}T${s(e.getHours())}:${s(e.getMinutes())}`}const MODES=[{value:"hot-seat",label:"Hot Seat",desc:"1 speaker + audience + AI host"},{value:"roundtable",label:"Roundtable",desc:"Group voice discussion with AI facilitator"}];function CreatePage(){const o=useNavigate(),{identity:e,setName:s}=useIdentity(),[a,c]=reactExports.useState(""),[d,h]=reactExports.useState((e==null?void 0:e.displayName)??""),[b,j]=reactExports.useState("hot-seat"),[$,_e]=reactExports.useState(!0),[it,at]=reactExports.useState(!1),[lt,dt]=reactExports.useState(""),[mt,vt]=reactExports.useState("default"),[tt,nt]=reactExports.useState([]),[ot,ht]=reactExports.useState(!1),[xt,Et]=reactExports.useState("");reactExports.useEffect(()=>{api.hosts.getList().then(Rt=>nt(Rt)).catch(()=>{})},[]);const _t=async Rt=>{if(Rt.preventDefault(),!(!a.trim()||!d.trim())){ht(!0),Et("");try{const Bt=s(d.trim()),Mt=it&<?new Date(lt).getTime():void 0,Ht=await api.rooms.post({title:a.trim(),mode:b,expertId:mt,displayName:d.trim(),userId:Bt.id,isPublic:$,...Mt?{scheduledFor:Mt}:{}});Ht.participantId&&sessionStorage.setItem(`room:${Ht.roomId}`,Ht.participantId),o(`/room/${Ht.roomId}`)}catch(Bt){Et(Bt instanceof Error?Bt.message:"Failed to create room")}finally{ht(!1)}}};return jsxRuntimeExports.jsxs("div",{className:"min-h-dvh flex flex-col",children:[jsxRuntimeExports.jsx("header",{className:"border-b border-border/60 backdrop-blur-xl bg-bg/80 sticky top-0 z-50",children:jsxRuntimeExports.jsxs("div",{className:"max-w-5xl mx-auto flex items-center justify-between px-6 h-14",children:[jsxRuntimeExports.jsx(Link,{to:"/",className:"text-[15px] font-semibold tracking-tight text-muted hover:text-text transition-colors",children:"Para"}),jsxRuntimeExports.jsx(ThemeToggle,{})]})}),jsxRuntimeExports.jsx("main",{className:"flex-1 flex items-start justify-center px-6 py-16",children:jsxRuntimeExports.jsxs("div",{className:"w-full max-w-md",children:[jsxRuntimeExports.jsx("h1",{className:"text-2xl font-bold tracking-tight mb-1",children:"Create a room"}),jsxRuntimeExports.jsx("p",{className:"text-muted text-[15px] mb-8",children:"Start a live AI-hosted session."}),jsxRuntimeExports.jsxs("form",{onSubmit:_t,className:"space-y-5",children:[jsxRuntimeExports.jsx(Field$1,{label:"Your name",children:jsxRuntimeExports.jsx("input",{type:"text",value:d,onChange:Rt=>h(Rt.target.value),placeholder:"How others will see you",required:!0,className:"input"})}),jsxRuntimeExports.jsx(Field$1,{label:"Room title",children:jsxRuntimeExports.jsx("input",{type:"text",value:a,onChange:Rt=>c(Rt.target.value),placeholder:"e.g. Startup pitch review",required:!0,className:"input"})}),jsxRuntimeExports.jsx(Field$1,{label:"Mode",children:jsxRuntimeExports.jsx("div",{className:"grid grid-cols-2 gap-2",children:MODES.map(Rt=>jsxRuntimeExports.jsxs("button",{type:"button",onClick:()=>j(Rt.value),className:`text-left p-3 rounded-lg border transition-all duration-150 ${b===Rt.value?"border-accent bg-accent/5 ring-1 ring-accent/30":"border-border/60 bg-surface hover:border-border-hover"}`,children:[jsxRuntimeExports.jsx("div",{className:`text-sm font-medium ${b===Rt.value?"text-accent":""}`,children:Rt.label}),jsxRuntimeExports.jsx("div",{className:"text-[11px] text-muted mt-0.5 leading-tight",children:Rt.desc})]},Rt.value))})}),tt.length>0&&jsxRuntimeExports.jsx(Field$1,{label:"AI Host",children:jsxRuntimeExports.jsx("div",{className:"grid grid-cols-2 gap-2",children:tt.map(Rt=>jsxRuntimeExports.jsxs("button",{type:"button",onClick:()=>vt(Rt.key),className:`text-left p-3 rounded-lg border transition-all duration-150 ${mt===Rt.key?"border-accent bg-accent/5 ring-1 ring-accent/30":"border-border/60 bg-surface hover:border-border-hover"}`,children:[jsxRuntimeExports.jsx("div",{className:`text-sm font-medium ${mt===Rt.key?"text-accent":""}`,children:Rt.name}),jsxRuntimeExports.jsxs("div",{className:"text-[11px] text-muted mt-0.5 leading-tight line-clamp-1",children:[Rt.personaEssence.slice(0,60),"..."]})]},Rt.key))})}),jsxRuntimeExports.jsxs("label",{className:"flex items-center gap-3 cursor-pointer group",children:[jsxRuntimeExports.jsx("input",{type:"checkbox",checked:$,onChange:Rt=>_e(Rt.target.checked),className:"sr-only peer"}),jsxRuntimeExports.jsx("div",{className:`w-9 h-5 rounded-full transition-colors relative ${$?"bg-accent":"bg-surface-2"}`,children:jsxRuntimeExports.jsx("div",{className:`absolute top-0.5 w-4 h-4 rounded-full bg-white shadow transition-transform ${$?"translate-x-4":"translate-x-0.5"}`})}),jsxRuntimeExports.jsx("span",{className:"text-sm text-muted group-hover:text-text-secondary transition-colors",children:"Visible in lobby"})]}),jsxRuntimeExports.jsxs("label",{className:"flex items-center gap-3 cursor-pointer group",children:[jsxRuntimeExports.jsx("input",{type:"checkbox",checked:it,onChange:Rt=>at(Rt.target.checked),className:"sr-only peer"}),jsxRuntimeExports.jsx("div",{className:`w-9 h-5 rounded-full transition-colors relative ${it?"bg-violet-500":"bg-surface-2"}`,children:jsxRuntimeExports.jsx("div",{className:`absolute top-0.5 w-4 h-4 rounded-full bg-white shadow transition-transform ${it?"translate-x-4":"translate-x-0.5"}`})}),jsxRuntimeExports.jsx("span",{className:"text-sm text-muted group-hover:text-text-secondary transition-colors",children:"Schedule for later"})]}),it&&jsxRuntimeExports.jsx(Field$1,{label:"Date & time",children:jsxRuntimeExports.jsx("input",{type:"datetime-local",value:lt,onChange:Rt=>dt(Rt.target.value),min:toLocalDateTimeString(Date.now()+5*6e4),required:it,className:"input"})}),xt&&jsxRuntimeExports.jsx("p",{className:"text-danger text-sm",children:xt}),jsxRuntimeExports.jsx("button",{type:"submit",disabled:ot||!a.trim()||!d.trim()||it&&!lt,className:`w-full h-10 rounded-lg text-sm font-semibold disabled:opacity-40 disabled:cursor-not-allowed transition-colors ${it?"bg-violet-500 text-white hover:bg-violet-400":"bg-white text-black hover:bg-zinc-200"}`,children:ot?"Creating...":it?"Schedule Room":"Create & Join"})]})]})})]})}function Field$1({label:o,children:e}){return jsxRuntimeExports.jsxs("div",{className:"space-y-2",children:[jsxRuntimeExports.jsx("label",{className:"text-[13px] font-medium text-muted",children:o}),e]})}function useDebug(){return typeof window>"u"?!1:new URLSearchParams(window.location.search).has("debug")||localStorage.getItem("debug")==="true"}class AudioStreamPlayer{constructor(e){or(this,"ctx");or(this,"gainNode");or(this,"nextStartTime",0);or(this,"activeSources",[]);or(this,"remainder",null);or(this,"pcmSampleRate",44100);this.ctx=e??new AudioContext({sampleRate:44100}),this.gainNode=this.ctx.createGain(),this.gainNode.connect(this.ctx.destination)}async ensureResumed(){this.ctx.state==="suspended"&&await this.ctx.resume()}feedPCM(e){this.ctx.state==="suspended"&&this.ctx.resume();let s=new Uint8Array(e);if(this.remainder){const $=new Uint8Array(this.remainder.length+s.length);$.set(this.remainder),$.set(s,this.remainder.length),s=$,this.remainder=null}const a=s.length%4;if(a>0&&(this.remainder=s.slice(s.length-a),s=s.slice(0,s.length-a)),s.length===0)return;const c=new Float32Array(s.buffer,s.byteOffset,s.length/4);if(c.length===0)return;const d=this.ctx.createBuffer(1,c.length,this.pcmSampleRate);d.getChannelData(0).set(c);const h=this.ctx.createBufferSource();h.buffer=d,h.connect(this.gainNode);const b=this.ctx.currentTime,j=Math.max(b+.01,this.nextStartTime);h.start(j),this.nextStartTime=j+d.duration,this.activeSources.push(h),h.onended=()=>{this.activeSources=this.activeSources.filter($=>$!==h)}}mute(){this.gainNode.gain.value=0}unmute(){this.gainNode.gain.value=1}setVolume(e){this.gainNode.gain.value=e}get muted(){return this.gainNode.gain.value===0}stop(){for(const e of this.activeSources)try{e.stop()}catch{}this.activeSources=[],this.nextStartTime=0,this.remainder=null}setSampleRate(e){this.pcmSampleRate=e}async resume(){this.ctx.state==="suspended"&&await this.ctx.resume()}getScheduledUntil(){return this.nextStartTime}getCurrentTime(){return this.ctx.currentTime}getContext(){return this.ctx}dispose(){this.stop(),this.ctx.state!=="closed"&&this.ctx.close().catch(()=>{})}}var browser_essentials={},essentials={},helpers={},build$1={},Deferred$3={},__await=commonjsGlobal&&commonjsGlobal.__await||function(o){return this instanceof __await?(this.v=o,this):new __await(o)},__asyncGenerator=commonjsGlobal&&commonjsGlobal.__asyncGenerator||function(o,e,s){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var a=s.apply(o,e||[]),c,d=[];return c={},h("next"),h("throw"),h("return"),c[Symbol.asyncIterator]=function(){return this},c;function h(at){a[at]&&(c[at]=function(lt){return new Promise(function(dt,mt){d.push([at,lt,dt,mt])>1||b(at,lt)})})}function b(at,lt){try{j(a[at](lt))}catch(dt){it(d[0][3],dt)}}function j(at){at.value instanceof __await?Promise.resolve(at.value.v).then($,_e):it(d[0][2],at)}function $(at){b("next",at)}function _e(at){b("throw",at)}function it(at,lt){at(lt),d.shift(),d.length&&b(d[0][0],d[0][1])}};Object.defineProperty(Deferred$3,"__esModule",{value:!0});let Deferred$2=class Os{constructor(){this._progressHandlers=[],this._progressQueue=[],this._progressResolvers=[],this._progressDone=!1,this._settled=!1,this._promise=new Promise((e,s)=>{this._resolve=e,this._reject=s})}getPromise(){return this._promise}resolve(e){this._settled=!0,this._finishProgress(),this._resolve(e)}reject(e){this._settled=!0,this._finishProgress(),this._reject(e)}onProgress(e){this._progressHandlers.push(e)}reportProgress(e){for(const s of this._progressHandlers)s(e);this._progressResolvers.length?this._progressResolvers.shift()({value:e,done:!1}):this._progressQueue.push(e)}_finishProgress(){for(this._progressDone=!0;this._progressResolvers.length;)this._progressResolvers.shift()({value:void 0,done:!0})}[Symbol.asyncIterator](){return __asyncGenerator(this,arguments,function*(){for(;!this._progressDone||this._progressQueue.length;)if(this._progressQueue.length){const s=this._progressQueue.shift();s!==void 0&&(yield yield __await(s))}else{if(this._progressDone)break;{const s=yield __await(new Promise(a=>{this._progressResolvers.push(({value:c})=>a(c))}));s!==void 0&&(yield yield __await(s))}}})}catch(e){return Promise.prototype.catch.apply(this._promise,arguments)}then(e,s){return Promise.prototype.then.apply(this._promise,arguments)}finally(e){return Promise.prototype.finally.apply(this._promise,arguments)}get[Symbol.toStringTag](){return this.promise.toString()}done(e,s){(arguments.length?this._promise.then.apply(this._promise,arguments):this._promise).then(void 0,function(c){setTimeout(function(){throw c},0)})}isSettled(){return this._settled}promise(){return this.getPromise()}static new(){return new Os}};Deferred$3.default=Deferred$2;var debounce$3={};Object.defineProperty(debounce$3,"__esModule",{value:!0});const debounce$2=(o,e,s=!1,a=!0)=>{var c;return function(){var d=this,h=arguments,b=function(){c=null,a&&o.apply(d,h)},j=s&&!c;clearTimeout(c),c=setTimeout(b,e),j&&o.apply(d,h)}};debounce$3.default=debounce$2;var throttle$3={};Object.defineProperty(throttle$3,"__esModule",{value:!0});const throttle$2=(o,e,s=!0,a=!1)=>{var c;return function(){var d=this,h=arguments,b=function(){c=null,(!s||a)&&o.apply(d,h)};c==null&&(c=setTimeout(b,e),s&&o.apply(d,h))}};throttle$3.default=throttle$2;var delay$3={},__awaiter$b=commonjsGlobal&&commonjsGlobal.__awaiter||function(o,e,s,a){function c(d){return d instanceof s?d:new s(function(h){h(d)})}return new(s||(s=Promise))(function(d,h){function b(_e){try{$(a.next(_e))}catch(it){h(it)}}function j(_e){try{$(a.throw(_e))}catch(it){h(it)}}function $(_e){_e.done?d(_e.value):c(_e.value).then(b,j)}$((a=a.apply(o,e||[])).next())})};Object.defineProperty(delay$3,"__esModule",{value:!0});const Deferred_1$7=Deferred$3,delay$2=o=>__awaiter$b(void 0,void 0,void 0,function*(){let e=Deferred_1$7.default.new();return setTimeout(()=>e.resolve(),o),e});delay$3.default=delay$2;var isAsync$3={};Object.defineProperty(isAsync$3,"__esModule",{value:!0});const isAsync$2=function(o){const e=o.toString().trim();return!!(e.match(/^async /)||e.match(/return _ref[^\.]*\.apply/)||e.match(/__awaiter/))};isAsync$3.default=isAsync$2;var waitUntil$3={},async$3={},__awaiter$a=commonjsGlobal&&commonjsGlobal.__awaiter||function(o,e,s,a){function c(d){return d instanceof s?d:new s(function(h){h(d)})}return new(s||(s=Promise))(function(d,h){function b(_e){try{$(a.next(_e))}catch(it){h(it)}}function j(_e){try{$(a.throw(_e))}catch(it){h(it)}}function $(_e){_e.done?d(_e.value):c(_e.value).then(b,j)}$((a=a.apply(o,e||[])).next())})};Object.defineProperty(async$3,"__esModule",{value:!0});const Deferred_1$6=Deferred$3,isAsync_1$2=isAsync$3,async$2=function(o){if(isAsync_1$2.default(o))return o;let e=Deferred_1$6.default.new();return function(){return __awaiter$a(this,arguments,void 0,function*(){let a=arguments;try{let c=o.apply(o,a);return e.resolve(c),c}catch(c){return e.reject(c),null}})}};async$3.default=async$2;var __awaiter$9=commonjsGlobal&&commonjsGlobal.__awaiter||function(o,e,s,a){function c(d){return d instanceof s?d:new s(function(h){h(d)})}return new(s||(s=Promise))(function(d,h){function b(_e){try{$(a.next(_e))}catch(it){h(it)}}function j(_e){try{$(a.throw(_e))}catch(it){h(it)}}function $(_e){_e.done?d(_e.value):c(_e.value).then(b,j)}$((a=a.apply(o,e||[])).next())})};Object.defineProperty(waitUntil$3,"__esModule",{value:!0});const Deferred_1$5=Deferred$3,async_1$2=async$3,waitUntil$2=(o,e=null,s=10,a=5e3)=>__awaiter$9(void 0,void 0,void 0,function*(){var c=new Date;c.setMilliseconds(c.getMilliseconds()+a);var d=async_1$2.default(o);let h=Deferred_1$5.default.new();if(yield d()){let j=e?e():null;return h.resolve(j)}var b=setInterval(()=>__awaiter$9(void 0,void 0,void 0,function*(){if(new Date>c)return clearInterval(b),h.reject();if(yield d()){clearInterval(b);let j=e?e():null;return h.resolve(j)}}),s);return h});waitUntil$3.default=waitUntil$2;var measurements$2={};(function(o){var e=commonjsGlobal&&commonjsGlobal.__awaiter||function(a,c,d,h){function b(j){return j instanceof d?j:new d(function($){$(j)})}return new(d||(d=Promise))(function(j,$){function _e(lt){try{at(h.next(lt))}catch(dt){$(dt)}}function it(lt){try{at(h.throw(lt))}catch(dt){$(dt)}}function at(lt){lt.done?j(lt.value):b(lt.value).then(_e,it)}at((h=h.apply(a,c||[])).next())})};Object.defineProperty(o,"__esModule",{value:!0}),o.getMeasureAndReset=o.peekMeasure=o.startMeasure=o.measure=void 0;let s={};o.measure=function(a){return e(this,void 0,void 0,function*(){const c=new Date().getTime();return yield a(),new Date().getTime()-c})},o.startMeasure=function(a="_"){return s[a]!=null?o.peekMeasure(a):(s[a]=new Date().getTime(),0)},o.peekMeasure=function(a="_"){return s[a]==null?0:new Date().getTime()-s[a]},o.getMeasureAndReset=function(a="_"){let c=o.peekMeasure(a);return s[a]=null,c}})(measurements$2);var chain$2={},__awaiter$8=commonjsGlobal&&commonjsGlobal.__awaiter||function(o,e,s,a){function c(d){return d instanceof s?d:new s(function(h){h(d)})}return new(s||(s=Promise))(function(d,h){function b(_e){try{$(a.next(_e))}catch(it){h(it)}}function j(_e){try{$(a.throw(_e))}catch(it){h(it)}}function $(_e){_e.done?d(_e.value):c(_e.value).then(b,j)}$((a=a.apply(o,e||[])).next())})};Object.defineProperty(chain$2,"__esModule",{value:!0});chain$2.chainTasks=void 0;chain$2.chainTasks=(o,e)=>__awaiter$8(void 0,void 0,void 0,function*(){for(var s=0,a=0;a<o.length;a++){var c=o[a];yield c().then(()=>{e&&e(s++)})}});var sleep$3={},__awaiter$7=commonjsGlobal&&commonjsGlobal.__awaiter||function(o,e,s,a){function c(d){return d instanceof s?d:new s(function(h){h(d)})}return new(s||(s=Promise))(function(d,h){function b(_e){try{$(a.next(_e))}catch(it){h(it)}}function j(_e){try{$(a.throw(_e))}catch(it){h(it)}}function $(_e){_e.done?d(_e.value):c(_e.value).then(b,j)}$((a=a.apply(o,e||[])).next())})};Object.defineProperty(sleep$3,"__esModule",{value:!0});const sleep$2=o=>__awaiter$7(void 0,void 0,void 0,function*(){return new Promise(e=>setTimeout(e,o))});sleep$3.default=sleep$2;var concurrent={},__awaiter$6=commonjsGlobal&&commonjsGlobal.__awaiter||function(o,e,s,a){function c(d){return d instanceof s?d:new s(function(h){h(d)})}return new(s||(s=Promise))(function(d,h){function b(_e){try{$(a.next(_e))}catch(it){h(it)}}function j(_e){try{$(a.throw(_e))}catch(it){h(it)}}function $(_e){_e.done?d(_e.value):c(_e.value).then(b,j)}$((a=a.apply(o,e||[])).next())})};Object.defineProperty(concurrent,"__esModule",{value:!0});concurrent.concurrent=void 0;const Deferred_1$4=Deferred$3;concurrent.concurrent=(o,e)=>__awaiter$6(void 0,void 0,void 0,function*(){const s=new Deferred_1$4.default;for(var a=0,c=0;c<o.length;c++){var d=o[c];yield d.then((...h)=>{e&&e.call(this,{result:h,promise:d,counter:a}),a++})}return yield Promise.all(o),s.resolve(a),s});(function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.concurrent=o.async=o.sleep=o.chain=o.measurements=o.waitUntil=o.isAsync=o.delay=o.throttle=o.debounce=o.Deferred=void 0;const e=Deferred$3;o.Deferred=e.default;const s=debounce$3;o.debounce=s.default;const a=throttle$3;o.throttle=a.default;const c=delay$3;o.delay=c.default;const d=isAsync$3;o.isAsync=d.default;const h=waitUntil$3;o.waitUntil=h.default;const b=measurements$2;o.measurements=b;const j=chain$2;o.chain=j;const $=sleep$3;o.sleep=$.default;const _e=async$3;o.async=_e.default;const it=concurrent;Object.defineProperty(o,"concurrent",{enumerable:!0,get:function(){return it.concurrent}})})(build$1);var extensions={},ArrayExtensions$1={};Object.defineProperty(ArrayExtensions$1,"__esModule",{value:!0});ArrayExtensions$1.ArrayExtensions=void 0;class ArrayExtensions{}ArrayExtensions$1.ArrayExtensions=ArrayExtensions;ArrayExtensions.each=function(o){const e=this;if(Array.isArray(e))e.forEach((s,a)=>o(s,a,e));else for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&o(e[s],s,e)};ArrayExtensions.diff=function(o,e){return this.filter(function(s){return o.indexOf(s)<0})};ArrayExtensions.myFilter=function(o){var e=[];for(var s of this)o(s)&&e.push(s);return e};ArrayExtensions.contains=function(o){return this.indexOf(o)!=-1};ArrayExtensions.myFilterSingle=function(o){var e=null;for(var s of this)if(o(s)){e=s;break}return e};ArrayExtensions.remove=function(o){var e=this.indexOf(o);return e>-1&&this.splice(e,1),this};ArrayExtensions.removeAt=function(o,e=void 0){return o>-1&&(this===null||this===void 0?void 0:this.length)>o&&(e?this.splice(o,1,e):this.splice(o,1)),this};ArrayExtensions.move=function(o,e){return this.splice(e,0,this.splice(o,1)[0]),this};ArrayExtensions.last=function(o=-1){return this==null||this.length==0?null:(o==0&&(o=-1),this[this.length+o])};ArrayExtensions.removeDuplicates=function(){if(this==null||this.length==0)return null;const o=this;return[...new Set(o)]};ArrayExtensions.removeEmpty=function(){return ArrayExtensions.myFilter.call(this,o=>o!=null)};var DateExtensions$1={};Object.defineProperty(DateExtensions$1,"__esModule",{value:!0});DateExtensions$1.DateExtensions=void 0;class DateExtensions{}DateExtensions$1.DateExtensions=DateExtensions;DateExtensions.isValid=function(){return this.getTime()===this.getTime()&&this.getTime()!=new Date(null).getTime()};DateExtensions.dateFormat=function(){var o=/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,e=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,s=/[^-+\dA-Z]/g;return function(a,c,d){if(arguments.length==1&&Object.prototype.toString.call(a)=="[object String]"&&!/\d/.test(a)&&(c=a,a=void 0),a=a?new Date(a):new Date,isNaN(a))throw SyntaxError("invalid date");c=String(DateExtensions.masks[c]||c||DateExtensions.masks.default),c.slice(0,4)=="UTC:"&&(c=c.slice(4),d=!0);var h=d?"getUTC":"get",b=a[h+"Date"](),j=a[h+"Day"](),$=a[h+"Month"](),_e=a[h+"FullYear"](),it=a[h+"Hours"](),at=a[h+"Minutes"](),lt=a[h+"Seconds"](),dt=a[h+"Milliseconds"](),mt=d?0:a.getTimezoneOffset(),vt={d:b,dd:DateExtensions.pad(b),ddd:DateExtensions.i18n.dayNames[j],dddd:DateExtensions.i18n.dayNames[j+7],m:$+1,mm:DateExtensions.pad($+1),mmm:DateExtensions.i18n.monthNames[$],mmmm:DateExtensions.i18n.monthNames[$+12],yy:String(_e).slice(2),yyyy:_e,h:it%12||12,hh:DateExtensions.pad(it%12||12),H:it,HH:DateExtensions.pad(it),M:at,MM:DateExtensions.pad(at),s:lt,ss:DateExtensions.pad(lt),l:DateExtensions.pad(dt,3),L:DateExtensions.pad(dt>99?Math.round(dt/10):dt),t:it<12?"a":"p",tt:it<12?"am":"pm",T:"T",TTT:it<12?"A":"P",TT:it<12?"AM":"PM",Z:"Z",ZZ:d?"UTC":(String(a).match(e)||[""]).pop().replace(s,""),o:(mt>0?"-":"+")+DateExtensions.pad(Math.floor(Math.abs(mt)/60)*100+Math.abs(mt)%60,4),S:["th","st","nd","rd"][b%10>3?0:(b%100-b%10!=10)*b%10]};return c.replace(o,function(tt){return tt in vt?vt[tt]:tt.slice(1,tt.length-1)})}}();DateExtensions.pad=function(o,e){for(o=String(o),e=e||2;o.length<e;)o="0"+o;return o};DateExtensions.masks={default:"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"};DateExtensions.i18n={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"]};DateExtensions.formatx=function(o,e=null){return o==null?this:this.dateFormat(this,o,e)};DateExtensions.format=function(o,e=null){return isNaN(this.getTime())?null:this.dateFormat(this,o,e)};DateExtensions.fromJson=function(o){if(o==null||o=="")return null;var e=o.replace("/Date(","").replace(")/","");return new Date(parseInt(e,10))};DateExtensions.toJson=function(){return"/Date("+this.getTime()+")/"};DateExtensions.addHours=function(o){return this.addMilliseconds(o*60*60*1e3)};DateExtensions.addMinutes=function(o){return this.addMilliseconds(o*60*1e3)};DateExtensions.addDays=function(o){var e=new Date(this.valueOf());return e.setDate(e.getDate()+o),e};DateExtensions.addMilliseconds=function(o){let e=new Date(this);return e.setTime(e.getTime()+o),e};DateExtensions.toUTC=function(){var o=new Date(this),e=/GMT([\-\+]?\d{4})/,s=e.exec(o.toString())[1],a=parseInt(s)/100,c=parseInt(s)%100;return o.setHours(o.getHours()-a),o.setMinutes(o.getMinutes()-c),o};DateExtensions.toISOStringUTC=function(o=!1){return this.formatx("yyyy-mm-ddTHH:MM:ss.lZ",!o)};DateExtensions.toTimezone=function(o){const e=this;return new Date((typeof e=="string"?new Date(e):e).toLocaleString("en-US",{timeZone:o}))};var NumberExtensions$1={};Object.defineProperty(NumberExtensions$1,"__esModule",{value:!0});NumberExtensions$1.numberExtensions=NumberExtensions$1.NumberExtensions=void 0;class NumberExtensions{}NumberExtensions$1.NumberExtensions=NumberExtensions;NumberExtensions.toFixedNum=function(o=2,e=10){var s=Math.pow(e||10,o);return Math.round(this*s)/s};NumberExtensions$1.numberExtensions=new NumberExtensions;var ObjectExtensions={},ObjectHelpers={},StringExtensions={},hasRequiredStringExtensions;function requireStringExtensions(){if(hasRequiredStringExtensions)return StringExtensions;hasRequiredStringExtensions=1,Object.defineProperty(StringExtensions,"__esModule",{value:!0}),StringExtensions.StringExtensions=void 0;const o=requireObjectHelpers();let e=class{};return StringExtensions.StringExtensions=e,e.capitalize=function(){const s=this;return s?s.charAt(0).toUpperCase()+s.slice(1).toLowerCase():""},e.ellipsis=function(s){let a=this;return a.length>s&&(a=a.substr(0,s),a+="..."),a},e.kebabCase=function(){return this.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()},e.camelize=function(){return this.replace(/(?:^\w|[A-Z]|\b\w)/g,function(s,a){return a==0?s.toLowerCase():s.toUpperCase()}).replace(/\s+|\-/g,"")},e.padNumber=function(s,a="0"){var c=this+"";return c.length>=s?c:new Array(s-c.length+1).join(a)+c},e.contains=function(s){return this.indexOf(s)>=0},e.hashCode=function(){var s=0;if(this.length==0)return s.toString();for(var a=0;a<this.length;a++){var c=this.charCodeAt(a);s=(s<<5)-s+c,s=s&s}return s.toString()},e.removeLastPart=function(s="/"){let a=this.split(s);return a.pop(),a.join(s)},e.isEmpty=function(s=null){var a=s??this;return a?a.trim().length==0:!0},e.format=function(d){var a,c,d=[],h=this,b=arguments[0];if(b!==null&&typeof b=="object"){var j=(a=arguments[1])!==null&&a!==void 0?a:!1;const it=(c=[...h==null?void 0:h.matchAll(/\{\{(.*?)\}\}/g)])===null||c===void 0?void 0:c.map(at=>at[1]);for(const at of it){let lt=o.objectHelpers.getDeep(b,at,".");if(lt==null){if(!j)continue;lt=""}h=h.replace("{{"+at+"}}",lt)}}else{for(var $=0;$<arguments.length-0;$++)d[$]=arguments[$+0];d.length>0&&Array.isArray(d[0])&&(d=d[0]),h=this.replace(/{{(\d+)}}/g,function(_e,it){return typeof d[it]<"u"?d[it]:_e})}return h},e.replaceAt=function(s,a){return this.substr(0,s)+a+this.substr(s+a.length)},e.replaceAll=function(s,a){if(s==null)return null;const c=String(s).replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return this.replace(new RegExp(c,"g"),a)},e.getAbbreviation=function(){var s,a;return this==null||this===""?null:(a=(s=this.match(/\b([A-Z])/g))===null||s===void 0?void 0:s.join(""))!==null&&a!==void 0?a:this[0].toUpperCase()},e.isDateString=function(s=!0){return!!(/(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))/.test(this)||s&&/^(0[1-9]|1[0-2])\/(0[1-9]|1\d|2\d|3[01])\/(\d{2,4})$/.test(this))},StringExtensions}var MyLodash$1={};Object.defineProperty(MyLodash$1,"__esModule",{value:!0});MyLodash$1.MyLodash=void 0;class MyLodash{static forEach(e,s){if(Array.isArray(e))e.forEach((a,c)=>s(a,c,e));else for(const a in e)Object.prototype.hasOwnProperty.call(e,a)&&s(e[a],a,e)}static mixin(e){for(const[s,a]of Object.entries(e))MyLodash[s]=a}static transform(e,s,a){a===void 0&&(a=Array.isArray(e)?[]:{});const c=Array.isArray(e);for(const d in e)if(Object.prototype.hasOwnProperty.call(e,d)){const h=e[d],b=c?Number(d):d;if(s(a,h,b,e)===!1)break}return a}static transform3(e,s,a,c){const d=Array.isArray(e);if(a==null)if(d)a=[];else{const h=e&&e.constructor,b=h&&h.prototype;a=Object.create(b)}if(s){const h=s.bind(c);(d?(j,$)=>j.forEach($):(j,$)=>{for(const _e in j)Object.prototype.hasOwnProperty.call(j,_e)&&$(j[_e],_e,j)})(e,(j,$)=>{h(a,j,$,e)})}return a}static transform2(e,s,a){a=a??(Array.isArray(this)?[]:{});for(let c=0;c<e.length&&s(a,e[c],c,e);c++);return a}static reduce(e,s,a){return MyLodash.forEach(e,(c,d)=>{a=s(a,c,d,e)}),a}static map(e,s){const a=[];return MyLodash.forEach(e,(c,d)=>{a.push(s(c,d,e))}),a}static mapKeys(e,s){const a={};return MyLodash.forEach(e,(c,d)=>{const h=s(c,d,e);a[h]=c}),a}static mapValues(e,s){const a={};return MyLodash.forEach(e,(c,d)=>{a[d]=s(c,d,e)}),a}static each(e,s){MyLodash.forEach(e,s)}static toPairs(e){return Object.entries(e)}static repeat(e,s){return e.repeat(s)}static join(e,s=","){return e.join(s)}static has(e,s){return s.split(".").reduce((a,c)=>a&&a[c],e)!==void 0}static isEqual(e,s){return JSON.stringify(e)===JSON.stringify(s)}static isPlainObject(e){return e!==null&&typeof e=="object"&&(e.constructor===Object||Object.getPrototypeOf(e)===null)}static isString(e){return typeof e=="string"}static isObject(e){return e!==null&&typeof e=="object"}static toUpperCase(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.toUpperCase()}}MyLodash$1.MyLodash=MyLodash;var hasRequiredObjectHelpers;function requireObjectHelpers(){return hasRequiredObjectHelpers||(hasRequiredObjectHelpers=1,function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.objectHelpers=o.ObjectHelpers=void 0;const e=requireStringExtensions(),s=MyLodash$1;class a{constructor(){}}a.___func=()=>{};class c{constructor(){this.globalProperties=[...Object.getOwnPropertyNames(a),...Object.getOwnPropertyNames(new Object),...Object.getOwnPropertyNames(a.prototype),...Object.getOwnPropertyNames(a.__proto__)],this.ARGUMENT_NAMES=/([^\s,]+)/g,this.STRIP_COMMENTS=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm,this.class2type={"[object Boolean]":"boolean","[object Number]":"number","[object String]":"string","[object Function]":"function","[object Array]":"array","[object Date]":"date","[object RegExp]":"regexp","[object Object]":"object"}}diff(h,b,j=!1){const $=(_e,it,at=!1)=>{let lt=s.MyLodash.transform(_e,(dt,mt,vt)=>{if(!s.MyLodash.isEqual(mt,it[vt])){if(at&&this.isEmpty(mt)){dt=null;return}dt[vt]=s.MyLodash.isObject(mt)&&s.MyLodash.isObject(it[vt])?$(mt,it[vt],at):mt,at&&this.isEmpty(dt[vt])&&delete dt[vt]}});return this.isDate(_e)&&(lt=_e),at&&this.isEmpty(lt)?null:lt};return $(h,b,j)}isObject(h){return h!=null&&h.isProxy?typeof h=="object"&&h.constructor==Object:s.MyLodash.isPlainObject(h)}isString(h){return s.MyLodash.isString(h)}isFunction(h){var b=this.type(h)==="function";if(!b)return!1;var j=h.toString().replace(this.STRIP_COMMENTS,"");return j.match(/\s*class\s+/)==null}isArray(h){return Array.isArray?Array.isArray(h):this.type(h)==="array"}isWindow(h){return h!=null&&(h==h.window||typeof commonjsGlobal<"u"&&h==commonjsGlobal)}isNumeric(h){return!isNaN(parseFloat(h))&&isFinite(h)}type(h){return h==null?String(h):h.isProxy?"object":this.class2type[toString.call(h)]||"object"}isPlainObject(h){var b=Object.prototype.hasOwnProperty;if(!h||this.type(h)!=="object"||h.nodeType)return!1;try{if(h.constructor&&!b.call(h,"constructor")&&!b.call(h.constructor.prototype,"isPrototypeOf"))return!1}catch{return!1}var j;for(j in h);return j===void 0||b.call(h,j)}isDefined(h,b){return typeof h>"u"?!1:b!=null?s.MyLodash.has(h,b):!0}clone(h,b={}){return this.merge(!0,b,h)}merge(...h){var b,j,$,_e,it,at,lt=arguments[0],dt=1,mt=arguments.length,vt=!0;for(typeof lt=="boolean"&&(vt=lt,lt=arguments[1]||{},dt=2),typeof lt!="object"&&!o.objectHelpers.isFunction(lt)&&(lt={}),mt===dt&&(lt=this,--dt),dt;dt<mt;dt++)if((b=arguments[dt])!=null){const tt=[...Object.getOwnPropertyNames(arguments[dt]),...Object.getOwnPropertySymbols(arguments[dt])];for(j of tt)$=lt[j],_e=b[j],lt!==_e&&(vt&&_e&&(o.objectHelpers.isPlainObject(_e)||(it=o.objectHelpers.isArray(_e)))?(it?(it=!1,at=$&&o.objectHelpers.isArray($)?$:[]):at=$&&o.objectHelpers.isPlainObject($)?$:{},lt[j]=o.objectHelpers.merge(vt,at,_e)):_e!==void 0&&(lt[j]=_e))}return lt}shallowCopy(h){return this.merge(!1,{},h)}getDeep(h,b,j="/"){let $=b.split(j),_e=h;do{if($.length==0)return _e;let it=$.shift();it!=""&&(_e=_e[it])}while(_e!=null);return _e}isNull(h){return h==null||h==null}isEmptyObject(h){if(h==null)return!0;const b=this.getCustomProperties(h);if(b.length==0)return!0;for(var j in b)return!1;return!0}isEmptyString(h){return h==null||h==""}isEmpty(h){if(h==null)return!0;for(var b in h)if(h.hasOwnProperty(b))return!1;return JSON.stringify(h)===JSON.stringify({})}isDate(h){return typeof(h==null?void 0:h.getMonth)=="function"}makeEmpty(h){return s.MyLodash.each(Object.keys(h),b=>{if(h.hasOwnProperty(b))if(Array.isArray(h[b]))h[b]=[];else if(typeof h[b]=="object"){if(h[b]==null){h[b]=null;return}this.makeEmpty(h[b])}else h[b]=""}),h}getCustomProperties(h){var b=[...Object.getOwnPropertyNames(h),...Object.getOwnPropertySymbols(h)];const j=$=>this.globalProperties.indexOf($)===-1;return b.filter(j)}spawnHierarchy(h,b={},j=null,$="."){let _e=h.split($);b==null&&(b={});let it=b,at=null,lt=null;for(let dt=0;dt<_e.length;dt++)at=_e[dt],it==null&&(it=lt[_e[dt-1]]={}),typeof it[at]>"u"&&(it[at]={}),lt=it,it=it[at];return lt[at]=j,b}objectToKeyValue(h){const b=this.getCustomProperties(h);let j={};for(let $ of b){const _e=h[$];if(this.isObject(_e)){const it=this.objectToKeyValue(_e);for(let at in it)j[$+"/"+at]=it[at]}else j[$]=_e}return j}keyValueToObject(h,b=!1){let j={};for(let $ in h){let _e=h[$];if(b&&this.isString(_e))try{_e=JSON.parse(_e)}catch{}o.objectHelpers.spawnHierarchy($,j,_e,"/")}return j}flatterObjectToDotNotation(h,b,j="."){let $={};for(var _e of Object.keys(h)){let it=b==null||b==""?"":b+j,at=h[_e];at&&typeof at=="object"&&Array.isArray(at)==!1&&at._bsontype==null&&typeof at.getMonth!="function"?$={...$,...this.flatterObjectToDotNotation(h[_e],it+_e,j)}:$[it+_e]=h[_e]}return $}getObjectHash(h){return h==null?"":e.StringExtensions.hashCode.call(JSON.stringify(h))}excludeKeys(h,...b){return b.reduce((j,$)=>{const{[$]:_e,...it}=j;return it},h)}}o.ObjectHelpers=c,o.objectHelpers=new c}(ObjectHelpers)),ObjectHelpers}(function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.objectExtensions=o.ObjectExtensions=void 0;const e=requireObjectHelpers();class s{extend(c,d){for(let h of s.__getCustomProperties.call(d))c[h]=d[h];for(let h of s.__getCustomProperties.call(d.__proto__))c[h]=d.__proto__[h];return c}}o.ObjectExtensions=s,s.__getCustomProperties=function(){return e.objectHelpers.getCustomProperties(this)},s.__extend=function(a){return o.objectExtensions.extend(this,a)},o.objectExtensions=new s})(ObjectExtensions);Object.defineProperty(extensions,"__esModule",{value:!0});extensions.extensions=extensions.Extensions=void 0;const ArrayExtensions_1$1=ArrayExtensions$1,DateExtensions_1=DateExtensions$1,NumberExtensions_1=NumberExtensions$1,ObjectExtensions_1$1=ObjectExtensions,StringExtensions_1$2=requireStringExtensions();class Extensions{constructor(){this.object=ObjectExtensions_1$1.ObjectExtensions,this.string=StringExtensions_1$2.StringExtensions,this.date=DateExtensions_1.DateExtensions,this.array=ArrayExtensions_1$1.ArrayExtensions,this.number=NumberExtensions_1.NumberExtensions}applyObjectExtensions(){ObjectExtensions_1$1.ObjectExtensions.__extend.call(Object.prototype,ObjectExtensions_1$1.ObjectExtensions)}applyStringExtensions(){ObjectExtensions_1$1.ObjectExtensions.__extend.call(String.prototype,StringExtensions_1$2.StringExtensions)}applyDateExtensions(){ObjectExtensions_1$1.ObjectExtensions.__extend.call(Date.prototype,DateExtensions_1.DateExtensions)}applyArrayExtensions(){ObjectExtensions_1$1.ObjectExtensions.__extend.call(Array.prototype,ArrayExtensions_1$1.ArrayExtensions)}applyNumberExtensions(){ObjectExtensions_1$1.ObjectExtensions.__extend.call(Number.prototype,NumberExtensions_1.NumberExtensions)}applyAllExtensions(){this.applyStringExtensions(),this.applyDateExtensions(),this.applyArrayExtensions(),this.applyNumberExtensions()}}extensions.Extensions=Extensions;extensions.extensions=new Extensions;var log$5={},define_process_env_default={};Object.defineProperty(log$5,"__esModule",{value:!0});log$5.log=log$5.LogLevel=log$5.ConsoleColors=log$5.Log=void 0;log$5.isComponentDebugEnabled=isComponentDebugEnabled;const extensions_1$1=extensions;extensions_1$1.extensions.applyDateExtensions();class Log{constructor(e=LogLevel.Verbose){this.colors=ConsoleColors,this.isDebug=!1,this.isConsole=!0,this.isShowStacktrace=!1,this.isShowPrefix=!0,this.severities=LogLevel,this.filterLevel=LogLevel.Verbose,this.isBrowser=typeof window<"u"&&window.document!=null&&typeof process>"u",this.isShowTime=!this.isBrowser,this.filterLevel=e}debug(e,...s){return this.write(this.severities.Debug,e,s)}d(e,...s){return this.write(this.severities.Debug,e,s)}verbose(e,...s){return this.write(this.severities.Verbose,e,s)}v(e,...s){return this.write(this.severities.Verbose,e,s)}info(e,...s){return this.write(this.severities.Info,e,s)}i(e,...s){return this.write(this.severities.Info,e,s)}warning(e,...s){return this.write(this.severities.Warning,e,s)}w(e,...s){return this.write(this.severities.Warning,e,s)}error(e,...s){return this.write(this.severities.Error,e,s)}e(e,...s){return this.write(this.severities.Error,e,s)}fatal(e,...s){return this.write(this.severities.Fatal,e,s)}forComponent(e){const s=this,a=`[${e}]`,c=()=>isComponentDebugEnabled(e);return{debug:(d,...h)=>{if(!c())return;const b=s.isDebug;s.isDebug=!0;try{return s.debug(`${a} ${d}`,...h)}finally{s.isDebug=b}},verbose:(d,...h)=>{if(!c())return;const b=s.filterLevel;s.filterLevel<LogLevel.Verbose&&(s.filterLevel=LogLevel.Verbose);try{return s.verbose(`${a} ${d}`,...h)}finally{s.filterLevel=b}},info:(d,...h)=>s.info(`${a} ${d}`,...h),warn:(d,...h)=>s.warning(`${a} ${d}`,...h),warning:(d,...h)=>s.warning(`${a} ${d}`,...h),error:(d,...h)=>s.error(`${a} ${d}`,...h),fatal:(d,...h)=>s.fatal(`${a} ${d}`,...h)}}write(e,s,a=[]){var c=this.isShowTime?"["+new Date().format("HH:MM:ss.l")+"]":"",d="",h="log";if(e==this.severities.Debug&&!this.isDebug||e!=this.severities.Debug&&e>this.filterLevel)return;switch(e){case this.severities.Debug:h="log",d=" [DBG]";break;case this.severities.Verbose:h="log",d=" [v]";break;case this.severities.Info:h="info",d=" [>>]";break;case this.severities.Warning:h="warn",d=" [*]";break;case this.severities.Error:h="error",d=" [!]";break;case this.severities.Fatal:h="error",d=" [!!!]";break}d+=" ",this.isShowPrefix||(d="");var b="";this.isShowStacktrace&&(b=this.getStackTrace());const j=JSON.stringify(a||"");typeof s=="object"&&(s==null?void 0:s.constructor)==Object&&(s=JSON.stringify(s));var $=`${d}${c} ${s} ${b}`;if(this.isBrowser){var $=`${d}${c} ${s} %c${b}`;a.length==0?console[h].call(console,$,"font-size:8px;"):console[h].call(console,$,"font-size:8px;",j)}else this.isConsole?console[h].call(console,$,a.length==0?"":this.color(j,this.colors.fgYellow)):console[h].call(console,$,j);return s+" "+j}color(e,s){var a=null;if(s.startsWith("\x1B[")?a=s:a=ConsoleColors["fg"+s.capitalize()],a==null&&ConsoleColors[s]==null)throw"given color ({0}) is not supported. options: black, red, green, yellow, blue, magenta, cyan, white".format(s);return a+e+ConsoleColors.reset}getStackTrace(){try{var e=new Error,s=e.stack,a=s.split(`
`),c=4;return a.length<c&&(c=a.length-1),a[c].replace(/^\s+/g,`
`)}catch{}}}log$5.Log=Log;var ConsoleColors;(function(o){o.reset="\x1B[0m",o.bright="\x1B[1m",o.dim="\x1B[2m",o.underscore="\x1B[4m",o.blink="\x1B[5m",o.reverse="\x1B[7m",o.hidden="\x1B[8m",o.fgBlack="\x1B[30m",o.fgRed="\x1B[31m",o.fgGreen="\x1B[32m",o.fgYellow="\x1B[33m",o.fgBlue="\x1B[34m",o.fgMagenta="\x1B[35m",o.fgCyan="\x1B[36m",o.fgWhite="\x1B[37m",o.bgBlack="\x1B[40m",o.bgRed="\x1B[41m",o.bgGreen="\x1B[42m",o.bgYellow="\x1B[43m",o.bgBlue="\x1B[44m",o.bgMagenta="\x1B[45m",o.bgCyan="\x1B[46m",o.bgWhite="\x1B[47m"})(ConsoleColors||(log$5.ConsoleColors=ConsoleColors={}));var LogLevel;(function(o){o[o.None=0]="None",o[o.Fatal=1]="Fatal",o[o.Error=2]="Error",o[o.Warning=4]="Warning",o[o.Info=8]="Info",o[o.Verbose=16]="Verbose",o[o.Debug=32]="Debug",o[o.All=255]="All"})(LogLevel||(log$5.LogLevel=LogLevel={}));function isComponentDebugEnabled(o){var e;let s="";try{typeof process<"u"&&(!((e=define_process_env_default)===null||e===void 0)&&e.DEBUG)?s=define_process_env_default.DEBUG:typeof localStorage<"u"&&(s=localStorage.getItem("DEBUG")||"")}catch{}return s?s.split(",").map(a=>a.trim()).some(a=>a==="*"||a===o):!1}log$5.log=new Log;var Measurement$1={};Object.defineProperty(Measurement$1,"__esModule",{value:!0});Measurement$1.ModuleOptions=Measurement$1.Measurement=void 0;const log_1$5=log$5;class Measurement{constructor(e,s){this.options=s,this.options={...new ModuleOptions$4,...s},this.id=e}static start(e,s){const a=new Measurement(e,s);return a.start(),a}static async measure(e,s,a){const c=Measurement.start(s,a);return await e(),c.stop(),c.peek()}start(){this.startTime=new Date().getTime()}stop(){var e;this.endTime=new Date().getTime();const s=this.peek();return!((e=this.options)===null||e===void 0)&&e.autoPrint&&log_1$5.log.d(`Measurement: ${this.id} took ${s}ms`),s}reset(){this.start()}peek(e){var s,a;return((a=(s=e==null?void 0:e.getTime())!==null&&s!==void 0?s:this.endTime)!==null&&a!==void 0?a:new Date().getTime())-this.startTime}}Measurement$1.Measurement=Measurement;let ModuleOptions$4=class{constructor(){this.autoPrint=!1}};Measurement$1.ModuleOptions=ModuleOptions$4;var Hash$1={};Object.defineProperty(Hash$1,"__esModule",{value:!0});Hash$1.Hash=void 0;class Hash{static sha256(e){return SHA256.hash(e)}static sha1(e){return SHA1.hash(e)}}Hash$1.Hash=Hash;class SHA256{static hash(e){function s(vt,tt){return tt>>>vt|tt<<32-vt}function a(vt){return s(2,vt)^s(13,vt)^s(22,vt)}function c(vt){return s(6,vt)^s(11,vt)^s(25,vt)}function d(vt){return s(7,vt)^s(18,vt)^vt>>>3}function h(vt){return s(17,vt)^s(19,vt)^vt>>>10}function b(vt,tt,nt){return vt&tt^~vt&nt}function j(vt,tt,nt){return vt&tt^vt&nt^tt&nt}const $=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function _e(vt){return vt.map(function(tt){return("0"+(tt>>24&255).toString(16)).slice(-2)+("0"+(tt>>16&255).toString(16)).slice(-2)+("0"+(tt>>8&255).toString(16)).slice(-2)+("0"+(tt&255).toString(16)).slice(-2)}).join("")}function it(vt){let tt=[],nt,ot,ht,xt,Et,_t,Rt,Bt,Mt,Ht;nt=at[0],ot=at[1],ht=at[2],xt=at[3],Et=at[4],_t=at[5],Rt=at[6],Bt=at[7];for(let er=0;er<64;er++)er<16?tt[er]=vt[er]|0:tt[er]=h(tt[er-2])+tt[er-7]+d(tt[er-15])+tt[er-16],Mt=Bt+c(Et)+b(Et,_t,Rt)+$[er]+tt[er],Ht=a(nt)+j(nt,ot,ht),Bt=Rt,Rt=_t,_t=Et,Et=xt+Mt|0,xt=ht,ht=ot,ot=nt,nt=Mt+Ht|0;return at[0]=at[0]+nt|0,at[1]=at[1]+ot|0,at[2]=at[2]+ht|0,at[3]=at[3]+xt|0,at[4]=at[4]+Et|0,at[5]=at[5]+_t|0,at[6]=at[6]+Rt|0,at[7]=at[7]+Bt|0,at}let at=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225];e+="";let lt=e.length/4+2,dt=Math.ceil(lt/16),mt=new Array(dt);for(let vt=0;vt<dt;vt++){mt[vt]=new Array(16);for(let tt=0;tt<16;tt++)mt[vt][tt]=e.charCodeAt(vt*64+tt*4)<<24|e.charCodeAt(vt*64+tt*4+1)<<16|e.charCodeAt(vt*64+tt*4+2)<<8|e.charCodeAt(vt*64+tt*4+3)}mt[dt-1][14]=(e.length-1)*8/Math.pow(2,32),mt[dt-1][14]=Math.floor(mt[dt-1][14]),mt[dt-1][15]=(e.length-1)*8&4294967295;for(let vt=0;vt<dt;vt++)it(mt[vt]);return _e(at)}}class SHA1{static hash(e){function s(it,at){return at<<it|at>>>32-it}let a=1732584193,c=4023233417,d=2562383102,h=271733878,b=3285377520;e+="";let j=e.length/4+2,$=Math.ceil(j/16),_e=new Array($);for(let it=0;it<$;it++){_e[it]=new Array(16);for(let at=0;at<16;at++)_e[it][at]=e.charCodeAt(it*64+at*4)<<24|e.charCodeAt(it*64+at*4+1)<<16|e.charCodeAt(it*64+at*4+2)<<8|e.charCodeAt(it*64+at*4+3)}_e[$-1][14]=(e.length-1)*8/Math.pow(2,32),_e[$-1][14]=Math.floor(_e[$-1][14]),_e[$-1][15]=(e.length-1)*8&4294967295;for(let it=0;it<$;it++){let at=new Array(80);for(let nt=0;nt<16;nt++)at[nt]=_e[it][nt];for(let nt=16;nt<80;nt++)at[nt]=s(1,at[nt-3]^at[nt-8]^at[nt-14]^at[nt-16]);let lt=a,dt=c,mt=d,vt=h,tt=b;for(let nt=0;nt<80;nt++){let ot=s(5,lt)+SHA1.f(nt,dt,mt,vt)+tt+at[nt]+SHA1.K(nt);tt=vt,vt=mt,mt=s(30,dt),dt=lt,lt=ot}a=a+lt|0,c=c+dt|0,d=d+mt|0,h=h+vt|0,b=b+tt|0}return SHA1.toHexStr(a)+SHA1.toHexStr(c)+SHA1.toHexStr(d)+SHA1.toHexStr(h)+SHA1.toHexStr(b)}static f(e,s,a,c){return e<20?s&a|~s&c:e<40?s^a^c:e<60?s&a|s&c|a&c:s^a^c}static K(e){return e<20?1518500249:e<40?1859775393:e<60?2400959708:3395469782}static toHexStr(e){let s="",a;for(let c=7;c>=0;c--)a=e>>>c*4&15,s+=a.toString(16);return s}}var jsYaml={},loader={},common={},hasRequiredCommon;function requireCommon(){if(hasRequiredCommon)return common;hasRequiredCommon=1;function o(h){return typeof h>"u"||h===null}function e(h){return typeof h=="object"&&h!==null}function s(h){return Array.isArray(h)?h:o(h)?[]:[h]}function a(h,b){if(b){const j=Object.keys(b);for(let $=0,_e=j.length;$<_e;$+=1){const it=j[$];h[it]=b[it]}}return h}function c(h,b){let j="";for(let $=0;$<b;$+=1)j+=h;return j}function d(h){return h===0&&Number.NEGATIVE_INFINITY===1/h}return common.isNothing=o,common.isObject=e,common.toArray=s,common.repeat=c,common.isNegativeZero=d,common.extend=a,common}var exception,hasRequiredException;function requireException(){if(hasRequiredException)return exception;hasRequiredException=1;function o(s,a){let c="";const d=s.reason||"(unknown reason)";return s.mark?(s.mark.name&&(c+='in "'+s.mark.name+'" '),c+="("+(s.mark.line+1)+":"+(s.mark.column+1)+")",!a&&s.mark.snippet&&(c+=`
`+s.mark.snippet),d+" "+c):d}function e(s,a){Error.call(this),this.name="YAMLException",this.reason=s,this.mark=a,this.message=o(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e.prototype.toString=function(a){return this.name+": "+o(this,a)},exception=e,exception}var snippet,hasRequiredSnippet;function requireSnippet(){if(hasRequiredSnippet)return snippet;hasRequiredSnippet=1;const o=requireCommon();function e(c,d,h,b,j){let $="",_e="";const it=Math.floor(j/2)-1;return b-d>it&&($=" ... ",d=b-it+$.length),h-b>it&&(_e=" ...",h=b+it-_e.length),{str:$+c.slice(d,h).replace(/\t/g,"→")+_e,pos:b-d+$.length}}function s(c,d){return o.repeat(" ",d-c.length)+c}function a(c,d){if(d=Object.create(d||null),!c.buffer)return null;d.maxLength||(d.maxLength=79),typeof d.indent!="number"&&(d.indent=1),typeof d.linesBefore!="number"&&(d.linesBefore=3),typeof d.linesAfter!="number"&&(d.linesAfter=2);const h=/\r?\n|\r|\0/g,b=[0],j=[];let $,_e=-1;for(;$=h.exec(c.buffer);)j.push($.index),b.push($.index+$[0].length),c.position<=$.index&&_e<0&&(_e=b.length-2);_e<0&&(_e=b.length-1);let it="";const at=Math.min(c.line+d.linesAfter,j.length).toString().length,lt=d.maxLength-(d.indent+at+3);for(let mt=1;mt<=d.linesBefore&&!(_e-mt<0);mt++){const vt=e(c.buffer,b[_e-mt],j[_e-mt],c.position-(b[_e]-b[_e-mt]),lt);it=o.repeat(" ",d.indent)+s((c.line-mt+1).toString(),at)+" | "+vt.str+`
`+it}const dt=e(c.buffer,b[_e],j[_e],c.position,lt);it+=o.repeat(" ",d.indent)+s((c.line+1).toString(),at)+" | "+dt.str+`
`,it+=o.repeat("-",d.indent+at+3+dt.pos)+`^
`;for(let mt=1;mt<=d.linesAfter&&!(_e+mt>=j.length);mt++){const vt=e(c.buffer,b[_e+mt],j[_e+mt],c.position-(b[_e]-b[_e+mt]),lt);it+=o.repeat(" ",d.indent)+s((c.line+mt+1).toString(),at)+" | "+vt.str+`
`}return it.replace(/\n$/,"")}return snippet=a,snippet}var type,hasRequiredType;function requireType(){if(hasRequiredType)return type;hasRequiredType=1;const o=requireException(),e=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],s=["scalar","sequence","mapping"];function a(d){const h={};return d!==null&&Object.keys(d).forEach(function(b){d[b].forEach(function(j){h[String(j)]=b})}),h}function c(d,h){if(h=h||{},Object.keys(h).forEach(function(b){if(e.indexOf(b)===-1)throw new o('Unknown option "'+b+'" is met in definition of "'+d+'" YAML type.')}),this.options=h,this.tag=d,this.kind=h.kind||null,this.resolve=h.resolve||function(){return!0},this.construct=h.construct||function(b){return b},this.instanceOf=h.instanceOf||null,this.predicate=h.predicate||null,this.represent=h.represent||null,this.representName=h.representName||null,this.defaultStyle=h.defaultStyle||null,this.multi=h.multi||!1,this.styleAliases=a(h.styleAliases||null),s.indexOf(this.kind)===-1)throw new o('Unknown kind "'+this.kind+'" is specified for "'+d+'" YAML type.')}return type=c,type}var schema,hasRequiredSchema;function requireSchema(){if(hasRequiredSchema)return schema;hasRequiredSchema=1;const o=requireException(),e=requireType();function s(d,h){const b=[];return d[h].forEach(function(j){let $=b.length;b.forEach(function(_e,it){_e.tag===j.tag&&_e.kind===j.kind&&_e.multi===j.multi&&($=it)}),b[$]=j}),b}function a(){const d={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function h(b){b.multi?(d.multi[b.kind].push(b),d.multi.fallback.push(b)):d[b.kind][b.tag]=d.fallback[b.tag]=b}for(let b=0,j=arguments.length;b<j;b+=1)arguments[b].forEach(h);return d}function c(d){return this.extend(d)}return c.prototype.extend=function(h){let b=[],j=[];if(h instanceof e)j.push(h);else if(Array.isArray(h))j=j.concat(h);else if(h&&(Array.isArray(h.implicit)||Array.isArray(h.explicit)))h.implicit&&(b=b.concat(h.implicit)),h.explicit&&(j=j.concat(h.explicit));else throw new o("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");b.forEach(function(_e){if(!(_e instanceof e))throw new o("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(_e.loadKind&&_e.loadKind!=="scalar")throw new o("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(_e.multi)throw new o("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),j.forEach(function(_e){if(!(_e instanceof e))throw new o("Specified list of YAML types (or a single Type object) contains a non-Type object.")});const $=Object.create(c.prototype);return $.implicit=(this.implicit||[]).concat(b),$.explicit=(this.explicit||[]).concat(j),$.compiledImplicit=s($,"implicit"),$.compiledExplicit=s($,"explicit"),$.compiledTypeMap=a($.compiledImplicit,$.compiledExplicit),$},schema=c,schema}var str,hasRequiredStr;function requireStr(){if(hasRequiredStr)return str;hasRequiredStr=1;const o=requireType();return str=new o("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),str}var seq,hasRequiredSeq;function requireSeq(){if(hasRequiredSeq)return seq;hasRequiredSeq=1;const o=requireType();return seq=new o("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),seq}var map,hasRequiredMap;function requireMap(){if(hasRequiredMap)return map;hasRequiredMap=1;const o=requireType();return map=new o("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),map}var failsafe,hasRequiredFailsafe;function requireFailsafe(){if(hasRequiredFailsafe)return failsafe;hasRequiredFailsafe=1;const o=requireSchema();return failsafe=new o({explicit:[requireStr(),requireSeq(),requireMap()]}),failsafe}var _null,hasRequired_null;function require_null(){if(hasRequired_null)return _null;hasRequired_null=1;const o=requireType();function e(c){if(c===null)return!0;const d=c.length;return d===1&&c==="~"||d===4&&(c==="null"||c==="Null"||c==="NULL")}function s(){return null}function a(c){return c===null}return _null=new o("tag:yaml.org,2002:null",{kind:"scalar",resolve:e,construct:s,predicate:a,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"}),_null}var bool,hasRequiredBool;function requireBool(){if(hasRequiredBool)return bool;hasRequiredBool=1;const o=requireType();function e(c){if(c===null)return!1;const d=c.length;return d===4&&(c==="true"||c==="True"||c==="TRUE")||d===5&&(c==="false"||c==="False"||c==="FALSE")}function s(c){return c==="true"||c==="True"||c==="TRUE"}function a(c){return Object.prototype.toString.call(c)==="[object Boolean]"}return bool=new o("tag:yaml.org,2002:bool",{kind:"scalar",resolve:e,construct:s,predicate:a,represent:{lowercase:function(c){return c?"true":"false"},uppercase:function(c){return c?"TRUE":"FALSE"},camelcase:function(c){return c?"True":"False"}},defaultStyle:"lowercase"}),bool}var int,hasRequiredInt;function requireInt(){if(hasRequiredInt)return int;hasRequiredInt=1;const o=requireCommon(),e=requireType();function s($){return $>=48&&$<=57||$>=65&&$<=70||$>=97&&$<=102}function a($){return $>=48&&$<=55}function c($){return $>=48&&$<=57}function d($){if($===null)return!1;const _e=$.length;let it=0,at=!1;if(!_e)return!1;let lt=$[it];if((lt==="-"||lt==="+")&&(lt=$[++it]),lt==="0"){if(it+1===_e)return!0;if(lt=$[++it],lt==="b"){for(it++;it<_e;it++){if(lt=$[it],lt!=="0"&<!=="1")return!1;at=!0}return at&&isFinite(h($))}if(lt==="x"){for(it++;it<_e;it++){if(!s($.charCodeAt(it)))return!1;at=!0}return at&&isFinite(h($))}if(lt==="o"){for(it++;it<_e;it++){if(!a($.charCodeAt(it)))return!1;at=!0}return at&&isFinite(h($))}}for(;it<_e;it++){if(!c($.charCodeAt(it)))return!1;at=!0}return at?isFinite(h($)):!1}function h($){let _e=$,it=1,at=_e[0];if((at==="-"||at==="+")&&(at==="-"&&(it=-1),_e=_e.slice(1),at=_e[0]),_e==="0")return 0;if(at==="0"){if(_e[1]==="b")return it*parseInt(_e.slice(2),2);if(_e[1]==="x")return it*parseInt(_e.slice(2),16);if(_e[1]==="o")return it*parseInt(_e.slice(2),8)}return it*parseInt(_e,10)}function b($){return h($)}function j($){return Object.prototype.toString.call($)==="[object Number]"&&$%1===0&&!o.isNegativeZero($)}return int=new e("tag:yaml.org,2002:int",{kind:"scalar",resolve:d,construct:b,predicate:j,represent:{binary:function($){return $>=0?"0b"+$.toString(2):"-0b"+$.toString(2).slice(1)},octal:function($){return $>=0?"0o"+$.toString(8):"-0o"+$.toString(8).slice(1)},decimal:function($){return $.toString(10)},hexadecimal:function($){return $>=0?"0x"+$.toString(16).toUpperCase():"-0x"+$.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),int}var float,hasRequiredFloat;function requireFloat(){if(hasRequiredFloat)return float;hasRequiredFloat=1;const o=requireCommon(),e=requireType(),s=new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),a=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function c($){return $===null||!s.test($)?!1:isFinite(parseFloat($,10))?!0:a.test($)}function d($){let _e=$.toLowerCase();const it=_e[0]==="-"?-1:1;return"+-".indexOf(_e[0])>=0&&(_e=_e.slice(1)),_e===".inf"?it===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:_e===".nan"?NaN:it*parseFloat(_e,10)}const h=/^[-+]?[0-9]+e/;function b($,_e){if(isNaN($))switch(_e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===$)switch(_e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===$)switch(_e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(o.isNegativeZero($))return"-0.0";const it=$.toString(10);return h.test(it)?it.replace("e",".e"):it}function j($){return Object.prototype.toString.call($)==="[object Number]"&&($%1!==0||o.isNegativeZero($))}return float=new e("tag:yaml.org,2002:float",{kind:"scalar",resolve:c,construct:d,predicate:j,represent:b,defaultStyle:"lowercase"}),float}var json,hasRequiredJson;function requireJson(){return hasRequiredJson||(hasRequiredJson=1,json=requireFailsafe().extend({implicit:[require_null(),requireBool(),requireInt(),requireFloat()]})),json}var core,hasRequiredCore;function requireCore(){return hasRequiredCore||(hasRequiredCore=1,core=requireJson()),core}var timestamp,hasRequiredTimestamp;function requireTimestamp(){if(hasRequiredTimestamp)return timestamp;hasRequiredTimestamp=1;const o=requireType(),e=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),s=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function a(h){return h===null?!1:e.exec(h)!==null||s.exec(h)!==null}function c(h){let b=0,j=null,$=e.exec(h);if($===null&&($=s.exec(h)),$===null)throw new Error("Date resolve error");const _e=+$[1],it=+$[2]-1,at=+$[3];if(!$[4])return new Date(Date.UTC(_e,it,at));const lt=+$[4],dt=+$[5],mt=+$[6];if($[7]){for(b=$[7].slice(0,3);b.length<3;)b+="0";b=+b}if($[9]){const tt=+$[10],nt=+($[11]||0);j=(tt*60+nt)*6e4,$[9]==="-"&&(j=-j)}const vt=new Date(Date.UTC(_e,it,at,lt,dt,mt,b));return j&&vt.setTime(vt.getTime()-j),vt}function d(h){return h.toISOString()}return timestamp=new o("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:a,construct:c,instanceOf:Date,represent:d}),timestamp}var merge$1,hasRequiredMerge;function requireMerge(){if(hasRequiredMerge)return merge$1;hasRequiredMerge=1;const o=requireType();function e(s){return s==="<<"||s===null}return merge$1=new o("tag:yaml.org,2002:merge",{kind:"scalar",resolve:e}),merge$1}var binary,hasRequiredBinary;function requireBinary(){if(hasRequiredBinary)return binary;hasRequiredBinary=1;const o=requireType(),e=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
\r`;function s(h){if(h===null)return!1;let b=0;const j=h.length,$=e;for(let _e=0;_e<j;_e++){const it=$.indexOf(h.charAt(_e));if(!(it>64)){if(it<0)return!1;b+=6}}return b%8===0}function a(h){const b=h.replace(/[\r\n=]/g,""),j=b.length,$=e;let _e=0;const it=[];for(let lt=0;lt<j;lt++)lt%4===0&<&&(it.push(_e>>16&255),it.push(_e>>8&255),it.push(_e&255)),_e=_e<<6|$.indexOf(b.charAt(lt));const at=j%4*6;return at===0?(it.push(_e>>16&255),it.push(_e>>8&255),it.push(_e&255)):at===18?(it.push(_e>>10&255),it.push(_e>>2&255)):at===12&&it.push(_e>>4&255),new Uint8Array(it)}function c(h){let b="",j=0;const $=h.length,_e=e;for(let at=0;at<$;at++)at%3===0&&at&&(b+=_e[j>>18&63],b+=_e[j>>12&63],b+=_e[j>>6&63],b+=_e[j&63]),j=(j<<8)+h[at];const it=$%3;return it===0?(b+=_e[j>>18&63],b+=_e[j>>12&63],b+=_e[j>>6&63],b+=_e[j&63]):it===2?(b+=_e[j>>10&63],b+=_e[j>>4&63],b+=_e[j<<2&63],b+=_e[64]):it===1&&(b+=_e[j>>2&63],b+=_e[j<<4&63],b+=_e[64],b+=_e[64]),b}function d(h){return Object.prototype.toString.call(h)==="[object Uint8Array]"}return binary=new o("tag:yaml.org,2002:binary",{kind:"scalar",resolve:s,construct:a,predicate:d,represent:c}),binary}var omap,hasRequiredOmap;function requireOmap(){if(hasRequiredOmap)return omap;hasRequiredOmap=1;const o=requireType(),e=Object.prototype.hasOwnProperty,s=Object.prototype.toString;function a(d){if(d===null)return!0;const h=[],b=d;for(let j=0,$=b.length;j<$;j+=1){const _e=b[j];let it=!1;if(s.call(_e)!=="[object Object]")return!1;let at;for(at in _e)if(e.call(_e,at))if(!it)it=!0;else return!1;if(!it)return!1;if(h.indexOf(at)===-1)h.push(at);else return!1}return!0}function c(d){return d!==null?d:[]}return omap=new o("tag:yaml.org,2002:omap",{kind:"sequence",resolve:a,construct:c}),omap}var pairs,hasRequiredPairs;function requirePairs(){if(hasRequiredPairs)return pairs;hasRequiredPairs=1;const o=requireType(),e=Object.prototype.toString;function s(c){if(c===null)return!0;const d=c,h=new Array(d.length);for(let b=0,j=d.length;b<j;b+=1){const $=d[b];if(e.call($)!=="[object Object]")return!1;const _e=Object.keys($);if(_e.length!==1)return!1;h[b]=[_e[0],$[_e[0]]]}return!0}function a(c){if(c===null)return[];const d=c,h=new Array(d.length);for(let b=0,j=d.length;b<j;b+=1){const $=d[b],_e=Object.keys($);h[b]=[_e[0],$[_e[0]]]}return h}return pairs=new o("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:s,construct:a}),pairs}var set,hasRequiredSet;function requireSet(){if(hasRequiredSet)return set;hasRequiredSet=1;const o=requireType(),e=Object.prototype.hasOwnProperty;function s(c){if(c===null)return!0;const d=c;for(const h in d)if(e.call(d,h)&&d[h]!==null)return!1;return!0}function a(c){return c!==null?c:{}}return set=new o("tag:yaml.org,2002:set",{kind:"mapping",resolve:s,construct:a}),set}var _default,hasRequired_default;function require_default(){return hasRequired_default||(hasRequired_default=1,_default=requireCore().extend({implicit:[requireTimestamp(),requireMerge()],explicit:[requireBinary(),requireOmap(),requirePairs(),requireSet()]})),_default}var hasRequiredLoader;function requireLoader(){if(hasRequiredLoader)return loader;hasRequiredLoader=1;const o=requireCommon(),e=requireException(),s=requireSnippet(),a=require_default(),c=Object.prototype.hasOwnProperty,d=1,h=2,b=3,j=4,$=1,_e=2,it=3,at=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,lt=/[\x85\u2028\u2029]/,dt=/[,\[\]{}]/,mt=/^(?:!|!!|![0-9A-Za-z-]+!)$/,vt=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function tt(g){return Object.prototype.toString.call(g)}function nt(g){return g===10||g===13}function ot(g){return g===9||g===32}function ht(g){return g===9||g===32||g===10||g===13}function xt(g){return g===44||g===91||g===93||g===123||g===125}function Et(g){if(g>=48&&g<=57)return g-48;const et=g|32;return et>=97&&et<=102?et-97+10:-1}function _t(g){return g===120?2:g===117?4:g===85?8:0}function Rt(g){return g>=48&&g<=57?g-48:-1}function Bt(g){switch(g){case 48:return"\0";case 97:return"\x07";case 98:return"\b";case 116:return" ";case 9:return" ";case 110:return`
`;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"
";case 95:return" ";case 76:return"\u2028";case 80:return"\u2029";default:return""}}function Mt(g){return g<=65535?String.fromCharCode(g):String.fromCharCode((g-65536>>10)+55296,(g-65536&1023)+56320)}function Ht(g,et,st){et==="__proto__"?Object.defineProperty(g,et,{configurable:!0,enumerable:!0,writable:!0,value:st}):g[et]=st}const er=new Array(256),Yt=new Array(256);for(let g=0;g<256;g++)er[g]=Bt(g)?1:0,Yt[g]=Bt(g);function rr(g,et){this.input=g,this.filename=et.filename||null,this.schema=et.schema||a,this.onWarning=et.onWarning||null,this.legacy=et.legacy||!1,this.json=et.json||!1,this.listener=et.listener||null,this.maxDepth=typeof et.maxDepth=="number"?et.maxDepth:100,this.maxTotalMergeKeys=typeof et.maxTotalMergeKeys=="number"?et.maxTotalMergeKeys:1e4,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=g.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.depth=0,this.totalMergeKeys=0,this.firstTabInLine=-1,this.documents=[],this.anchorMapTransactions=[]}function Jt(g,et){const st={name:g.filename,buffer:g.input.slice(0,-1),position:g.position,line:g.line,column:g.position-g.lineStart};return st.snippet=s(st),new e(et,st)}function Dt(g,et){throw Jt(g,et)}function gr(g,et){g.onWarning&&g.onWarning.call(null,Jt(g,et))}function Lt(g,et,st){const ft=g.anchorMapTransactions;if(ft.length!==0){const gt=ft[ft.length-1];c.call(gt,et)||(gt[et]={existed:c.call(g.anchorMap,et),value:g.anchorMap[et]})}g.anchorMap[et]=st}function Vt(g){g.anchorMapTransactions.push(Object.create(null))}function nr(g){const et=g.anchorMapTransactions.pop(),st=g.anchorMapTransactions;if(st.length===0)return;const ft=st[st.length-1],gt=Object.keys(et);for(let wt=0,ut=gt.length;wt<ut;wt+=1){const bt=gt[wt];c.call(ft,bt)||(ft[bt]=et[bt])}}function Zt(g){const et=g.anchorMapTransactions.pop(),st=Object.keys(et);for(let ft=st.length-1;ft>=0;ft-=1){const gt=et[st[ft]];gt.existed?g.anchorMap[st[ft]]=gt.value:delete g.anchorMap[st[ft]]}}function sr(g){return{position:g.position,line:g.line,lineStart:g.lineStart,lineIndent:g.lineIndent,firstTabInLine:g.firstTabInLine,tag:g.tag,anchor:g.anchor,kind:g.kind,result:g.result}}function Mr(g,et){g.position=et.position,g.line=et.line,g.lineStart=et.lineStart,g.lineIndent=et.lineIndent,g.firstTabInLine=et.firstTabInLine,g.tag=et.tag,g.anchor=et.anchor,g.kind=et.kind,g.result=et.result}const ir={YAML:function(et,st,ft){et.version!==null&&Dt(et,"duplication of %YAML directive"),ft.length!==1&&Dt(et,"YAML directive accepts exactly one argument");const gt=/^([0-9]+)\.([0-9]+)$/.exec(ft[0]);gt===null&&Dt(et,"ill-formed argument of the YAML directive");const wt=parseInt(gt[1],10),ut=parseInt(gt[2],10);wt!==1&&Dt(et,"unacceptable YAML version of the document"),et.version=ft[0],et.checkLineBreaks=ut<2,ut!==1&&ut!==2&&gr(et,"unsupported YAML version of the document")},TAG:function(et,st,ft){let gt;ft.length!==2&&Dt(et,"TAG directive accepts exactly two arguments");const wt=ft[0];gt=ft[1],mt.test(wt)||Dt(et,"ill-formed tag handle (first argument) of the TAG directive"),c.call(et.tagMap,wt)&&Dt(et,'there is a previously declared suffix for "'+wt+'" tag handle'),vt.test(gt)||Dt(et,"ill-formed tag prefix (second argument) of the TAG directive");try{gt=decodeURIComponent(gt)}catch{Dt(et,"tag prefix is malformed: "+gt)}et.tagMap[wt]=gt}};function Cr(g,et,st,ft){if(et<st){const gt=g.input.slice(et,st);if(ft)for(let wt=0,ut=gt.length;wt<ut;wt+=1){const bt=gt.charCodeAt(wt);bt===9||bt>=32&&bt<=1114111||Dt(g,"expected valid JSON character")}else at.test(gt)&&Dt(g,"the stream contains non-printable characters");g.result+=gt}}function It(g,et,st,ft){o.isObject(st)||Dt(g,"cannot merge mappings; the provided source object is unacceptable");const gt=Object.keys(st);for(let wt=0,ut=gt.length;wt<ut;wt+=1){const bt=gt[wt];g.maxTotalMergeKeys!==-1&&++g.totalMergeKeys>g.maxTotalMergeKeys&&Dt(g,"merge keys exceeded maxTotalMergeKeys ("+g.maxTotalMergeKeys+")"),c.call(et,bt)||(Ht(et,bt,st[bt]),ft[bt]=!0)}}function tr(g,et,st,ft,gt,wt,ut,bt,Pt){if(Array.isArray(gt)){gt=Array.prototype.slice.call(gt);for(let Ct=0,kt=gt.length;Ct<kt;Ct+=1)Array.isArray(gt[Ct])&&Dt(g,"nested arrays are not supported inside keys"),typeof gt=="object"&&tt(gt[Ct])==="[object Object]"&&(gt[Ct]="[object Object]")}if(typeof gt=="object"&&tt(gt)==="[object Object]"&&(gt="[object Object]"),gt=String(gt),et===null&&(et={}),ft==="tag:yaml.org,2002:merge")if(Array.isArray(wt))for(let Ct=0,kt=wt.length;Ct<kt;Ct+=1)It(g,et,wt[Ct],st);else It(g,et,wt,st);else!g.json&&!c.call(st,gt)&&c.call(et,gt)&&(g.line=ut||g.line,g.lineStart=bt||g.lineStart,g.position=Pt||g.position,Dt(g,"duplicated mapping key")),Ht(et,gt,wt),delete st[gt];return et}function fr(g){const et=g.input.charCodeAt(g.position);et===10?g.position++:et===13?(g.position++,g.input.charCodeAt(g.position)===10&&g.position++):Dt(g,"a line break is expected"),g.line+=1,g.lineStart=g.position,g.firstTabInLine=-1}function Ft(g,et,st){let ft=0,gt=g.input.charCodeAt(g.position);for(;gt!==0;){for(;ot(gt);)gt===9&&g.firstTabInLine===-1&&(g.firstTabInLine=g.position),gt=g.input.charCodeAt(++g.position);if(et&>===35)do gt=g.input.charCodeAt(++g.position);while(gt!==10&>!==13&>!==0);if(nt(gt))for(fr(g),gt=g.input.charCodeAt(g.position),ft++,g.lineIndent=0;gt===32;)g.lineIndent++,gt=g.input.charCodeAt(++g.position);else break}return st!==-1&&ft!==0&&g.lineIndent<st&&gr(g,"deficient indentation"),ft}function lr(g){let et=g.position,st=g.input.charCodeAt(et);return!!((st===45||st===46)&&st===g.input.charCodeAt(et+1)&&st===g.input.charCodeAt(et+2)&&(et+=3,st=g.input.charCodeAt(et),st===0||ht(st)))}function Or(g,et){et===1?g.result+=" ":et>1&&(g.result+=o.repeat(`
`,et-1))}function Sr(g,et,st){let ft,gt,wt,ut,bt,Pt;const Ct=g.kind,kt=g.result;let $t=g.input.charCodeAt(g.position);if(ht($t)||xt($t)||$t===35||$t===38||$t===42||$t===33||$t===124||$t===62||$t===39||$t===34||$t===37||$t===64||$t===96)return!1;if($t===63||$t===45){const Ot=g.input.charCodeAt(g.position+1);if(ht(Ot)||st&&xt(Ot))return!1}for(g.kind="scalar",g.result="",ft=gt=g.position,wt=!1;$t!==0;){if($t===58){const Ot=g.input.charCodeAt(g.position+1);if(ht(Ot)||st&&xt(Ot))break}else if($t===35){const Ot=g.input.charCodeAt(g.position-1);if(ht(Ot))break}else{if(g.position===g.lineStart&&lr(g)||st&&xt($t))break;if(nt($t))if(ut=g.line,bt=g.lineStart,Pt=g.lineIndent,Ft(g,!1,-1),g.lineIndent>=et){wt=!0,$t=g.input.charCodeAt(g.position);continue}else{g.position=gt,g.line=ut,g.lineStart=bt,g.lineIndent=Pt;break}}wt&&(Cr(g,ft,gt,!1),Or(g,g.line-ut),ft=gt=g.position,wt=!1),ot($t)||(gt=g.position+1),$t=g.input.charCodeAt(++g.position)}return Cr(g,ft,gt,!1),g.result?!0:(g.kind=Ct,g.result=kt,!1)}function Nr(g,et){let st,ft,gt=g.input.charCodeAt(g.position);if(gt!==39)return!1;for(g.kind="scalar",g.result="",g.position++,st=ft=g.position;(gt=g.input.charCodeAt(g.position))!==0;)if(gt===39)if(Cr(g,st,g.position,!0),gt=g.input.charCodeAt(++g.position),gt===39)st=g.position,g.position++,ft=g.position;else return!0;else nt(gt)?(Cr(g,st,ft,!0),Or(g,Ft(g,!1,et)),st=ft=g.position):g.position===g.lineStart&&lr(g)?Dt(g,"unexpected end of the document within a single quoted scalar"):(g.position++,ot(gt)||(ft=g.position));Dt(g,"unexpected end of the stream within a single quoted scalar")}function Tr(g,et){let st,ft,gt,wt=g.input.charCodeAt(g.position);if(wt!==34)return!1;for(g.kind="scalar",g.result="",g.position++,st=ft=g.position;(wt=g.input.charCodeAt(g.position))!==0;){if(wt===34)return Cr(g,st,g.position,!0),g.position++,!0;if(wt===92){if(Cr(g,st,g.position,!0),wt=g.input.charCodeAt(++g.position),nt(wt))Ft(g,!1,et);else if(wt<256&&er[wt])g.result+=Yt[wt],g.position++;else if((gt=_t(wt))>0){let ut=gt,bt=0;for(;ut>0;ut--)wt=g.input.charCodeAt(++g.position),(gt=Et(wt))>=0?bt=(bt<<4)+gt:Dt(g,"expected hexadecimal character");g.result+=Mt(bt),g.position++}else Dt(g,"unknown escape sequence");st=ft=g.position}else nt(wt)?(Cr(g,st,ft,!0),Or(g,Ft(g,!1,et)),st=ft=g.position):g.position===g.lineStart&&lr(g)?Dt(g,"unexpected end of the document within a double quoted scalar"):(g.position++,ot(wt)||(ft=g.position))}Dt(g,"unexpected end of the stream within a double quoted scalar")}function Kr(g,et){let st=!0,ft,gt,wt;const ut=g.tag;let bt;const Pt=g.anchor;let Ct,kt,$t,Ot;const Gt=Object.create(null);let zt,Xt,cr,_r=g.input.charCodeAt(g.position);if(_r===91)Ct=93,Ot=!1,bt=[];else if(_r===123)Ct=125,Ot=!0,bt={};else return!1;for(g.anchor!==null&&Lt(g,g.anchor,bt),_r=g.input.charCodeAt(++g.position);_r!==0;){if(Ft(g,!0,et),_r=g.input.charCodeAt(g.position),_r===Ct)return g.position++,g.tag=ut,g.anchor=Pt,g.kind=Ot?"mapping":"sequence",g.result=bt,!0;if(st?_r===44&&Dt(g,"expected the node content, but found ','"):Dt(g,"missed comma between flow collection entries"),Xt=zt=cr=null,kt=$t=!1,_r===63){const $r=g.input.charCodeAt(g.position+1);ht($r)&&(kt=$t=!0,g.position++,Ft(g,!0,et))}ft=g.line,gt=g.lineStart,wt=g.position,vr(g,et,d,!1,!0),Xt=g.tag,zt=g.result,Ft(g,!0,et),_r=g.input.charCodeAt(g.position),($t||g.line===ft)&&_r===58&&(kt=!0,_r=g.input.charCodeAt(++g.position),Ft(g,!0,et),vr(g,et,d,!1,!0),cr=g.result),Ot?tr(g,bt,Gt,Xt,zt,cr,ft,gt,wt):kt?bt.push(tr(g,null,Gt,Xt,zt,cr,ft,gt,wt)):bt.push(zt),Ft(g,!0,et),_r=g.input.charCodeAt(g.position),_r===44?(st=!0,_r=g.input.charCodeAt(++g.position)):st=!1}Dt(g,"unexpected end of the stream within a flow collection")}function qt(g,et){let st,ft=$,gt=!1,wt=!1,ut=et,bt=0,Pt=!1,Ct,kt=g.input.charCodeAt(g.position);if(kt===124)st=!1;else if(kt===62)st=!0;else return!1;for(g.kind="scalar",g.result="";kt!==0;)if(kt=g.input.charCodeAt(++g.position),kt===43||kt===45)$===ft?ft=kt===43?it:_e:Dt(g,"repeat of a chomping mode identifier");else if((Ct=Rt(kt))>=0)Ct===0?Dt(g,"bad explicit indentation width of a block scalar; it cannot be less than one"):wt?Dt(g,"repeat of an indentation width identifier"):(ut=et+Ct-1,wt=!0);else break;if(ot(kt)){do kt=g.input.charCodeAt(++g.position);while(ot(kt));if(kt===35)do kt=g.input.charCodeAt(++g.position);while(!nt(kt)&&kt!==0)}for(;kt!==0;){for(fr(g),g.lineIndent=0,kt=g.input.charCodeAt(g.position);(!wt||g.lineIndent<ut)&&kt===32;)g.lineIndent++,kt=g.input.charCodeAt(++g.position);if(!wt&&g.lineIndent>ut&&(ut=g.lineIndent),nt(kt)){bt++;continue}if(!wt&&ut===0&&Dt(g,"missing indentation for block scalar"),g.lineIndent<ut){ft===it?g.result+=o.repeat(`
`,gt?1+bt:bt):ft===$&>&&(g.result+=`
`);break}st?ot(kt)?(Pt=!0,g.result+=o.repeat(`
`,gt?1+bt:bt)):Pt?(Pt=!1,g.result+=o.repeat(`
`,bt+1)):bt===0?gt&&(g.result+=" "):g.result+=o.repeat(`
`,bt):g.result+=o.repeat(`
`,gt?1+bt:bt),gt=!0,wt=!0,bt=0;const $t=g.position;for(;!nt(kt)&&kt!==0;)kt=g.input.charCodeAt(++g.position);Cr(g,$t,g.position,!1)}return!0}function ar(g,et){const st=g.tag,ft=g.anchor,gt=[];let wt=!1;if(g.firstTabInLine!==-1)return!1;g.anchor!==null&&Lt(g,g.anchor,gt);let ut=g.input.charCodeAt(g.position);for(;ut!==0&&(g.firstTabInLine!==-1&&(g.position=g.firstTabInLine,Dt(g,"tab characters must not be used in indentation")),ut===45);){const bt=g.input.charCodeAt(g.position+1);if(!ht(bt))break;if(wt=!0,g.position++,Ft(g,!0,-1)&&g.lineIndent<=et){gt.push(null),ut=g.input.charCodeAt(g.position);continue}const Pt=g.line;if(vr(g,et,b,!1,!0),gt.push(g.result),Ft(g,!0,-1),ut=g.input.charCodeAt(g.position),(g.line===Pt||g.lineIndent>et)&&ut!==0)Dt(g,"bad indentation of a sequence entry");else if(g.lineIndent<et)break}return wt?(g.tag=st,g.anchor=ft,g.kind="sequence",g.result=gt,!0):!1}function yr(g,et,st){let ft,gt,wt,ut;const bt=g.tag,Pt=g.anchor,Ct={},kt=Object.create(null);let $t=null,Ot=null,Gt=null,zt=!1,Xt=!1;if(g.firstTabInLine!==-1)return!1;g.anchor!==null&&Lt(g,g.anchor,Ct);let cr=g.input.charCodeAt(g.position);for(;cr!==0;){!zt&&g.firstTabInLine!==-1&&(g.position=g.firstTabInLine,Dt(g,"tab characters must not be used in indentation"));const _r=g.input.charCodeAt(g.position+1),$r=g.line;if((cr===63||cr===58)&&ht(_r))cr===63?(zt&&(tr(g,Ct,kt,$t,Ot,null,gt,wt,ut),$t=Ot=Gt=null),Xt=!0,zt=!0,ft=!0):zt?(zt=!1,ft=!0):Dt(g,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),g.position+=1,cr=_r;else{if(gt=g.line,wt=g.lineStart,ut=g.position,!vr(g,st,h,!1,!0))break;if(g.line===$r){for(cr=g.input.charCodeAt(g.position);ot(cr);)cr=g.input.charCodeAt(++g.position);if(cr===58)cr=g.input.charCodeAt(++g.position),ht(cr)||Dt(g,"a whitespace character is expected after the key-value separator within a block mapping"),zt&&(tr(g,Ct,kt,$t,Ot,null,gt,wt,ut),$t=Ot=Gt=null),Xt=!0,zt=!1,ft=!1,$t=g.tag,Ot=g.result;else if(Xt)Dt(g,"can not read an implicit mapping pair; a colon is missed");else return g.tag=bt,g.anchor=Pt,!0}else if(Xt)Dt(g,"can not read a block mapping entry; a multiline key may not be an implicit key");else return g.tag=bt,g.anchor=Pt,!0}if((g.line===$r||g.lineIndent>et)&&(zt&&(gt=g.line,wt=g.lineStart,ut=g.position),vr(g,et,j,!0,ft)&&(zt?Ot=g.result:Gt=g.result),zt||(tr(g,Ct,kt,$t,Ot,Gt,gt,wt,ut),$t=Ot=Gt=null),Ft(g,!0,-1),cr=g.input.charCodeAt(g.position)),(g.line===$r||g.lineIndent>et)&&cr!==0)Dt(g,"bad indentation of a mapping entry");else if(g.lineIndent<et)break}return zt&&tr(g,Ct,kt,$t,Ot,null,gt,wt,ut),Xt&&(g.tag=bt,g.anchor=Pt,g.kind="mapping",g.result=Ct),Xt}function xr(g){let et=!1,st=!1,ft,gt,wt=g.input.charCodeAt(g.position);if(wt!==33)return!1;g.tag!==null&&Dt(g,"duplication of a tag property"),wt=g.input.charCodeAt(++g.position),wt===60?(et=!0,wt=g.input.charCodeAt(++g.position)):wt===33?(st=!0,ft="!!",wt=g.input.charCodeAt(++g.position)):ft="!";let ut=g.position;if(et){do wt=g.input.charCodeAt(++g.position);while(wt!==0&&wt!==62);g.position<g.length?(gt=g.input.slice(ut,g.position),wt=g.input.charCodeAt(++g.position)):Dt(g,"unexpected end of the stream within a verbatim tag")}else{for(;wt!==0&&!ht(wt);)wt===33&&(st?Dt(g,"tag suffix cannot contain exclamation marks"):(ft=g.input.slice(ut-1,g.position+1),mt.test(ft)||Dt(g,"named tag handle cannot contain such characters"),st=!0,ut=g.position+1)),wt=g.input.charCodeAt(++g.position);gt=g.input.slice(ut,g.position),dt.test(gt)&&Dt(g,"tag suffix cannot contain flow indicator characters")}gt&&!vt.test(gt)&&Dt(g,"tag name cannot contain such characters: "+gt);try{gt=decodeURIComponent(gt)}catch{Dt(g,"tag name is malformed: "+gt)}return et?g.tag=gt:c.call(g.tagMap,ft)?g.tag=g.tagMap[ft]+gt:ft==="!"?g.tag="!"+gt:ft==="!!"?g.tag="tag:yaml.org,2002:"+gt:Dt(g,'undeclared tag handle "'+ft+'"'),!0}function Rr(g){let et=g.input.charCodeAt(g.position);if(et!==38)return!1;g.anchor!==null&&Dt(g,"duplication of an anchor property"),et=g.input.charCodeAt(++g.position);const st=g.position;for(;et!==0&&!ht(et)&&!xt(et);)et=g.input.charCodeAt(++g.position);return g.position===st&&Dt(g,"name of an anchor node must contain at least one character"),g.anchor=g.input.slice(st,g.position),!0}function Er(g){let et=g.input.charCodeAt(g.position);if(et!==42)return!1;et=g.input.charCodeAt(++g.position);const st=g.position;for(;et!==0&&!ht(et)&&!xt(et);)et=g.input.charCodeAt(++g.position);g.position===st&&Dt(g,"name of an alias node must contain at least one character");const ft=g.input.slice(st,g.position);return c.call(g.anchorMap,ft)||Dt(g,'unidentified alias "'+ft+'"'),g.result=g.anchorMap[ft],Ft(g,!0,-1),!0}function wr(g,et,st,ft){const gt=sr(g);return Vt(g),Mr(g,et),g.tag=null,g.anchor=null,g.kind=null,g.result=null,yr(g,st,ft)&&g.kind==="mapping"?(nr(g),!0):(Zt(g),Mr(g,gt),!1)}function vr(g,et,st,ft,gt){let wt,ut,bt=1,Pt=!1,Ct=!1,kt=null,$t,Ot,Gt;g.depth>=g.maxDepth&&Dt(g,"nesting exceeded maxDepth ("+g.maxDepth+")"),g.depth+=1,g.listener!==null&&g.listener("open",g),g.tag=null,g.anchor=null,g.kind=null,g.result=null;const zt=wt=ut=j===st||b===st;if(ft&&Ft(g,!0,-1)&&(Pt=!0,g.lineIndent>et?bt=1:g.lineIndent===et?bt=0:g.lineIndent<et&&(bt=-1)),bt===1)for(;;){const Xt=g.input.charCodeAt(g.position),cr=sr(g);if(Pt&&(Xt===33&&g.tag!==null||Xt===38&&g.anchor!==null)||!xr(g)&&!Rr(g))break;kt===null&&(kt=cr),Ft(g,!0,-1)?(Pt=!0,ut=zt,g.lineIndent>et?bt=1:g.lineIndent===et?bt=0:g.lineIndent<et&&(bt=-1)):ut=!1}if(ut&&(ut=Pt||gt),bt===1||j===st)if(d===st||h===st?Ot=et:Ot=et+1,Gt=g.position-g.lineStart,bt===1)if(ut&&(ar(g,Gt)||yr(g,Gt,Ot))||Kr(g,Ot))Ct=!0;else{const Xt=g.input.charCodeAt(g.position);kt!==null&&zt&&!ut&&Xt!==124&&Xt!==62&&wr(g,kt,kt.position-kt.lineStart,Ot)||wt&&qt(g,Ot)||Nr(g,Ot)||Tr(g,Ot)?Ct=!0:Er(g)?(Ct=!0,(g.tag!==null||g.anchor!==null)&&Dt(g,"alias node should not have any properties")):Sr(g,Ot,d===st)&&(Ct=!0,g.tag===null&&(g.tag="?")),g.anchor!==null&&Lt(g,g.anchor,g.result)}else bt===0&&(Ct=ut&&ar(g,Gt));if(g.tag===null)g.anchor!==null&&Lt(g,g.anchor,g.result);else if(g.tag==="?"){g.result!==null&&g.kind!=="scalar"&&Dt(g,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+g.kind+'"');for(let Xt=0,cr=g.implicitTypes.length;Xt<cr;Xt+=1)if($t=g.implicitTypes[Xt],$t.resolve(g.result)){g.result=$t.construct(g.result),g.tag=$t.tag,g.anchor!==null&&Lt(g,g.anchor,g.result);break}}else if(g.tag!=="!"){if(c.call(g.typeMap[g.kind||"fallback"],g.tag))$t=g.typeMap[g.kind||"fallback"][g.tag];else{$t=null;const Xt=g.typeMap.multi[g.kind||"fallback"];for(let cr=0,_r=Xt.length;cr<_r;cr+=1)if(g.tag.slice(0,Xt[cr].tag.length)===Xt[cr].tag){$t=Xt[cr];break}}$t||Dt(g,"unknown tag !<"+g.tag+">"),g.result!==null&&$t.kind!==g.kind&&Dt(g,"unacceptable node kind for !<"+g.tag+'> tag; it should be "'+$t.kind+'", not "'+g.kind+'"'),$t.resolve(g.result,g.tag)?(g.result=$t.construct(g.result,g.tag),g.anchor!==null&&Lt(g,g.anchor,g.result)):Dt(g,"cannot resolve a node with !<"+g.tag+"> explicit tag")}return g.listener!==null&&g.listener("close",g),g.depth-=1,g.tag!==null||g.anchor!==null||Ct}function zr(g){const et=g.position;let st=!1,ft;for(g.version=null,g.checkLineBreaks=g.legacy,g.tagMap=Object.create(null),g.anchorMap=Object.create(null);(ft=g.input.charCodeAt(g.position))!==0&&(Ft(g,!0,-1),ft=g.input.charCodeAt(g.position),!(g.lineIndent>0||ft!==37));){st=!0,ft=g.input.charCodeAt(++g.position);let gt=g.position;for(;ft!==0&&!ht(ft);)ft=g.input.charCodeAt(++g.position);const wt=g.input.slice(gt,g.position),ut=[];for(wt.length<1&&Dt(g,"directive name must not be less than one character in length");ft!==0;){for(;ot(ft);)ft=g.input.charCodeAt(++g.position);if(ft===35){do ft=g.input.charCodeAt(++g.position);while(ft!==0&&!nt(ft));break}if(nt(ft))break;for(gt=g.position;ft!==0&&!ht(ft);)ft=g.input.charCodeAt(++g.position);ut.push(g.input.slice(gt,g.position))}ft!==0&&fr(g),c.call(ir,wt)?ir[wt](g,wt,ut):gr(g,'unknown document directive "'+wt+'"')}if(Ft(g,!0,-1),g.lineIndent===0&&g.input.charCodeAt(g.position)===45&&g.input.charCodeAt(g.position+1)===45&&g.input.charCodeAt(g.position+2)===45?(g.position+=3,Ft(g,!0,-1)):st&&Dt(g,"directives end mark is expected"),vr(g,g.lineIndent-1,j,!1,!0),Ft(g,!0,-1),g.checkLineBreaks&<.test(g.input.slice(et,g.position))&&gr(g,"non-ASCII line breaks are interpreted as content"),g.documents.push(g.result),g.position===g.lineStart&&lr(g)){g.input.charCodeAt(g.position)===46&&(g.position+=3,Ft(g,!0,-1));return}g.position<g.length-1&&Dt(g,"end of the stream or a document separator is expected")}function Dr(g,et){g=String(g),et=et||{},g.length!==0&&(g.charCodeAt(g.length-1)!==10&&g.charCodeAt(g.length-1)!==13&&(g+=`
`),g.charCodeAt(0)===65279&&(g=g.slice(1)));const st=new rr(g,et),ft=g.indexOf("\0");for(ft!==-1&&(st.position=ft,Dt(st,"null byte is not allowed in input")),st.input+="\0";st.input.charCodeAt(st.position)===32;)st.lineIndent+=1,st.position+=1;for(;st.position<st.length-1;)zr(st);return st.documents}function Fr(g,et,st){et!==null&&typeof et=="object"&&typeof st>"u"&&(st=et,et=null);const ft=Dr(g,st);if(typeof et!="function")return ft;for(let gt=0,wt=ft.length;gt<wt;gt+=1)et(ft[gt])}function pt(g,et){const st=Dr(g,et);if(st.length!==0){if(st.length===1)return st[0];throw new e("expected a single document in the stream, but found more")}}return loader.loadAll=Fr,loader.load=pt,loader}var dumper={},hasRequiredDumper;function requireDumper(){if(hasRequiredDumper)return dumper;hasRequiredDumper=1;const o=requireCommon(),e=requireException(),s=require_default(),a=Object.prototype.toString,c=Object.prototype.hasOwnProperty,d=65279,h=9,b=10,j=13,$=32,_e=33,it=34,at=35,lt=37,dt=38,mt=39,vt=42,tt=44,nt=45,ot=58,ht=61,xt=62,Et=63,_t=64,Rt=91,Bt=93,Mt=96,Ht=123,er=124,Yt=125,rr={};rr[0]="\\0",rr[7]="\\a",rr[8]="\\b",rr[9]="\\t",rr[10]="\\n",rr[11]="\\v",rr[12]="\\f",rr[13]="\\r",rr[27]="\\e",rr[34]='\\"',rr[92]="\\\\",rr[133]="\\N",rr[160]="\\_",rr[8232]="\\L",rr[8233]="\\P";const Jt=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],Dt=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function gr(ut,bt){if(bt===null)return{};const Pt={},Ct=Object.keys(bt);for(let kt=0,$t=Ct.length;kt<$t;kt+=1){let Ot=Ct[kt],Gt=String(bt[Ot]);Ot.slice(0,2)==="!!"&&(Ot="tag:yaml.org,2002:"+Ot.slice(2));const zt=ut.compiledTypeMap.fallback[Ot];zt&&c.call(zt.styleAliases,Gt)&&(Gt=zt.styleAliases[Gt]),Pt[Ot]=Gt}return Pt}function Lt(ut){let bt,Pt;const Ct=ut.toString(16).toUpperCase();if(ut<=255)bt="x",Pt=2;else if(ut<=65535)bt="u",Pt=4;else if(ut<=4294967295)bt="U",Pt=8;else throw new e("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+bt+o.repeat("0",Pt-Ct.length)+Ct}const Vt=1,nr=2;function Zt(ut){this.schema=ut.schema||s,this.indent=Math.max(1,ut.indent||2),this.noArrayIndent=ut.noArrayIndent||!1,this.skipInvalid=ut.skipInvalid||!1,this.flowLevel=o.isNothing(ut.flowLevel)?-1:ut.flowLevel,this.styleMap=gr(this.schema,ut.styles||null),this.sortKeys=ut.sortKeys||!1,this.lineWidth=ut.lineWidth||80,this.noRefs=ut.noRefs||!1,this.noCompatMode=ut.noCompatMode||!1,this.condenseFlow=ut.condenseFlow||!1,this.quotingType=ut.quotingType==='"'?nr:Vt,this.forceQuotes=ut.forceQuotes||!1,this.replacer=typeof ut.replacer=="function"?ut.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function sr(ut,bt){const Pt=o.repeat(" ",bt);let Ct=0,kt="";const $t=ut.length;for(;Ct<$t;){let Ot;const Gt=ut.indexOf(`
`,Ct);Gt===-1?(Ot=ut.slice(Ct),Ct=$t):(Ot=ut.slice(Ct,Gt+1),Ct=Gt+1),Ot.length&&Ot!==`
`&&(kt+=Pt),kt+=Ot}return kt}function Mr(ut,bt){return`
`+o.repeat(" ",ut.indent*bt)}function ir(ut,bt){for(let Pt=0,Ct=ut.implicitTypes.length;Pt<Ct;Pt+=1)if(ut.implicitTypes[Pt].resolve(bt))return!0;return!1}function Cr(ut){return ut===$||ut===h}function It(ut){return ut>=32&&ut<=126||ut>=161&&ut<=55295&&ut!==8232&&ut!==8233||ut>=57344&&ut<=65533&&ut!==d||ut>=65536&&ut<=1114111}function tr(ut){return It(ut)&&ut!==d&&ut!==j&&ut!==b}function fr(ut,bt,Pt){const Ct=tr(ut),kt=Ct&&!Cr(ut);return(Pt?Ct:Ct&&ut!==tt&&ut!==Rt&&ut!==Bt&&ut!==Ht&&ut!==Yt)&&ut!==at&&!(bt===ot&&!kt)||tr(bt)&&!Cr(bt)&&ut===at||bt===ot&&kt}function Ft(ut){return It(ut)&&ut!==d&&!Cr(ut)&&ut!==nt&&ut!==Et&&ut!==ot&&ut!==tt&&ut!==Rt&&ut!==Bt&&ut!==Ht&&ut!==Yt&&ut!==at&&ut!==dt&&ut!==vt&&ut!==_e&&ut!==er&&ut!==ht&&ut!==xt&&ut!==mt&&ut!==it&&ut!==lt&&ut!==_t&&ut!==Mt}function lr(ut){return!Cr(ut)&&ut!==ot}function Or(ut,bt){const Pt=ut.charCodeAt(bt);let Ct;return Pt>=55296&&Pt<=56319&&bt+1<ut.length&&(Ct=ut.charCodeAt(bt+1),Ct>=56320&&Ct<=57343)?(Pt-55296)*1024+Ct-56320+65536:Pt}function Sr(ut){return/^\n* /.test(ut)}const Nr=1,Tr=2,Kr=3,qt=4,ar=5;function yr(ut,bt,Pt,Ct,kt,$t,Ot,Gt){let zt,Xt=0,cr=null,_r=!1,$r=!1;const bn=Ct!==-1;let sn=-1,en=Ft(Or(ut,0))&&lr(Or(ut,ut.length-1));if(bt||Ot)for(zt=0;zt<ut.length;Xt>=65536?zt+=2:zt++){if(Xt=Or(ut,zt),!It(Xt))return ar;en=en&&fr(Xt,cr,Gt),cr=Xt}else{for(zt=0;zt<ut.length;Xt>=65536?zt+=2:zt++){if(Xt=Or(ut,zt),Xt===b)_r=!0,bn&&($r=$r||zt-sn-1>Ct&&ut[sn+1]!==" ",sn=zt);else if(!It(Xt))return ar;en=en&&fr(Xt,cr,Gt),cr=Xt}$r=$r||bn&&zt-sn-1>Ct&&ut[sn+1]!==" "}return!_r&&!$r?en&&!Ot&&!kt(ut)?Nr:$t===nr?ar:Tr:Pt>9&&Sr(ut)?ar:Ot?$t===nr?ar:Tr:$r?qt:Kr}function xr(ut,bt,Pt,Ct,kt){ut.dump=function(){if(bt.length===0)return ut.quotingType===nr?'""':"''";if(!ut.noCompatMode&&(Jt.indexOf(bt)!==-1||Dt.test(bt)))return ut.quotingType===nr?'"'+bt+'"':"'"+bt+"'";const $t=ut.indent*Math.max(1,Pt),Ot=ut.lineWidth===-1?-1:Math.max(Math.min(ut.lineWidth,40),ut.lineWidth-$t),Gt=Ct||ut.flowLevel>-1&&Pt>=ut.flowLevel;function zt(Xt){return ir(ut,Xt)}switch(yr(bt,Gt,ut.indent,Ot,zt,ut.quotingType,ut.forceQuotes&&!Ct,kt)){case Nr:return bt;case Tr:return"'"+bt.replace(/'/g,"''")+"'";case Kr:return"|"+Rr(bt,ut.indent)+Er(sr(bt,$t));case qt:return">"+Rr(bt,ut.indent)+Er(sr(wr(bt,Ot),$t));case ar:return'"'+zr(bt)+'"';default:throw new e("impossible error: invalid scalar style")}}()}function Rr(ut,bt){const Pt=Sr(ut)?String(bt):"",Ct=ut[ut.length-1]===`
`,$t=Ct&&(ut[ut.length-2]===`
`||ut===`
`)?"+":Ct?"":"-";return Pt+$t+`
`}function Er(ut){return ut[ut.length-1]===`
`?ut.slice(0,-1):ut}function wr(ut,bt){const Pt=/(\n+)([^\n]*)/g;let Ct=function(){let Gt=ut.indexOf(`
`);return Gt=Gt!==-1?Gt:ut.length,Pt.lastIndex=Gt,vr(ut.slice(0,Gt),bt)}(),kt=ut[0]===`
`||ut[0]===" ",$t,Ot;for(;Ot=Pt.exec(ut);){const Gt=Ot[1],zt=Ot[2];$t=zt[0]===" ",Ct+=Gt+(!kt&&!$t&&zt!==""?`
`:"")+vr(zt,bt),kt=$t}return Ct}function vr(ut,bt){if(ut===""||ut[0]===" ")return ut;const Pt=/ [^ ]/g;let Ct,kt=0,$t,Ot=0,Gt=0,zt="";for(;Ct=Pt.exec(ut);)Gt=Ct.index,Gt-kt>bt&&($t=Ot>kt?Ot:Gt,zt+=`
`+ut.slice(kt,$t),kt=$t+1),Ot=Gt;return zt+=`
`,ut.length-kt>bt&&Ot>kt?zt+=ut.slice(kt,Ot)+`
`+ut.slice(Ot+1):zt+=ut.slice(kt),zt.slice(1)}function zr(ut){let bt="",Pt=0;for(let Ct=0;Ct<ut.length;Pt>=65536?Ct+=2:Ct++){Pt=Or(ut,Ct);const kt=rr[Pt];!kt&&It(Pt)?(bt+=ut[Ct],Pt>=65536&&(bt+=ut[Ct+1])):bt+=kt||Lt(Pt)}return bt}function Dr(ut,bt,Pt){let Ct="";const kt=ut.tag;for(let $t=0,Ot=Pt.length;$t<Ot;$t+=1){let Gt=Pt[$t];ut.replacer&&(Gt=ut.replacer.call(Pt,String($t),Gt)),(st(ut,bt,Gt,!1,!1)||typeof Gt>"u"&&st(ut,bt,null,!1,!1))&&(Ct!==""&&(Ct+=","+(ut.condenseFlow?"":" ")),Ct+=ut.dump)}ut.tag=kt,ut.dump="["+Ct+"]"}function Fr(ut,bt,Pt,Ct){let kt="";const $t=ut.tag;for(let Ot=0,Gt=Pt.length;Ot<Gt;Ot+=1){let zt=Pt[Ot];ut.replacer&&(zt=ut.replacer.call(Pt,String(Ot),zt)),(st(ut,bt+1,zt,!0,!0,!1,!0)||typeof zt>"u"&&st(ut,bt+1,null,!0,!0,!1,!0))&&((!Ct||kt!=="")&&(kt+=Mr(ut,bt)),ut.dump&&b===ut.dump.charCodeAt(0)?kt+="-":kt+="- ",kt+=ut.dump)}ut.tag=$t,ut.dump=kt||"[]"}function pt(ut,bt,Pt){let Ct="";const kt=ut.tag,$t=Object.keys(Pt);for(let Ot=0,Gt=$t.length;Ot<Gt;Ot+=1){let zt="";Ct!==""&&(zt+=", "),ut.condenseFlow&&(zt+='"');const Xt=$t[Ot];let cr=Pt[Xt];ut.replacer&&(cr=ut.replacer.call(Pt,Xt,cr)),st(ut,bt,Xt,!1,!1)&&(ut.dump.length>1024&&(zt+="? "),zt+=ut.dump+(ut.condenseFlow?'"':"")+":"+(ut.condenseFlow?"":" "),st(ut,bt,cr,!1,!1)&&(zt+=ut.dump,Ct+=zt))}ut.tag=kt,ut.dump="{"+Ct+"}"}function g(ut,bt,Pt,Ct){let kt="";const $t=ut.tag,Ot=Object.keys(Pt);if(ut.sortKeys===!0)Ot.sort();else if(typeof ut.sortKeys=="function")Ot.sort(ut.sortKeys);else if(ut.sortKeys)throw new e("sortKeys must be a boolean or a function");for(let Gt=0,zt=Ot.length;Gt<zt;Gt+=1){let Xt="";(!Ct||kt!=="")&&(Xt+=Mr(ut,bt));const cr=Ot[Gt];let _r=Pt[cr];if(ut.replacer&&(_r=ut.replacer.call(Pt,cr,_r)),!st(ut,bt+1,cr,!0,!0,!0))continue;const $r=ut.tag!==null&&ut.tag!=="?"||ut.dump&&ut.dump.length>1024;$r&&(ut.dump&&b===ut.dump.charCodeAt(0)?Xt+="?":Xt+="? "),Xt+=ut.dump,$r&&(Xt+=Mr(ut,bt)),st(ut,bt+1,_r,!0,$r)&&(ut.dump&&b===ut.dump.charCodeAt(0)?Xt+=":":Xt+=": ",Xt+=ut.dump,kt+=Xt)}ut.tag=$t,ut.dump=kt||"{}"}function et(ut,bt,Pt){const Ct=Pt?ut.explicitTypes:ut.implicitTypes;for(let kt=0,$t=Ct.length;kt<$t;kt+=1){const Ot=Ct[kt];if((Ot.instanceOf||Ot.predicate)&&(!Ot.instanceOf||typeof bt=="object"&&bt instanceof Ot.instanceOf)&&(!Ot.predicate||Ot.predicate(bt))){if(Pt?Ot.multi&&Ot.representName?ut.tag=Ot.representName(bt):ut.tag=Ot.tag:ut.tag="?",Ot.represent){const Gt=ut.styleMap[Ot.tag]||Ot.defaultStyle;let zt;if(a.call(Ot.represent)==="[object Function]")zt=Ot.represent(bt,Gt);else if(c.call(Ot.represent,Gt))zt=Ot.represent[Gt](bt,Gt);else throw new e("!<"+Ot.tag+'> tag resolver accepts not "'+Gt+'" style');ut.dump=zt}return!0}}return!1}function st(ut,bt,Pt,Ct,kt,$t,Ot){ut.tag=null,ut.dump=Pt,et(ut,Pt,!1)||et(ut,Pt,!0);const Gt=a.call(ut.dump),zt=Ct;Ct&&(Ct=ut.flowLevel<0||ut.flowLevel>bt);const Xt=Gt==="[object Object]"||Gt==="[object Array]";let cr,_r;if(Xt&&(cr=ut.duplicates.indexOf(Pt),_r=cr!==-1),(ut.tag!==null&&ut.tag!=="?"||_r||ut.indent!==2&&bt>0)&&(kt=!1),_r&&ut.usedDuplicates[cr])ut.dump="*ref_"+cr;else{if(Xt&&_r&&!ut.usedDuplicates[cr]&&(ut.usedDuplicates[cr]=!0),Gt==="[object Object]")Ct&&Object.keys(ut.dump).length!==0?(g(ut,bt,ut.dump,kt),_r&&(ut.dump="&ref_"+cr+ut.dump)):(pt(ut,bt,ut.dump),_r&&(ut.dump="&ref_"+cr+" "+ut.dump));else if(Gt==="[object Array]")Ct&&ut.dump.length!==0?(ut.noArrayIndent&&!Ot&&bt>0?Fr(ut,bt-1,ut.dump,kt):Fr(ut,bt,ut.dump,kt),_r&&(ut.dump="&ref_"+cr+ut.dump)):(Dr(ut,bt,ut.dump),_r&&(ut.dump="&ref_"+cr+" "+ut.dump));else if(Gt==="[object String]")ut.tag!=="?"&&xr(ut,ut.dump,bt,$t,zt);else{if(Gt==="[object Undefined]")return!1;if(ut.skipInvalid)return!1;throw new e("unacceptable kind of an object to dump "+Gt)}if(ut.tag!==null&&ut.tag!=="?"){let $r=encodeURI(ut.tag[0]==="!"?ut.tag.slice(1):ut.tag).replace(/!/g,"%21");ut.tag[0]==="!"?$r="!"+$r:$r.slice(0,18)==="tag:yaml.org,2002:"?$r="!!"+$r.slice(18):$r="!<"+$r+">",ut.dump=$r+" "+ut.dump}}return!0}function ft(ut,bt){const Pt=[],Ct=[];gt(ut,Pt,Ct);const kt=Ct.length;for(let $t=0;$t<kt;$t+=1)bt.duplicates.push(Pt[Ct[$t]]);bt.usedDuplicates=new Array(kt)}function gt(ut,bt,Pt){if(ut!==null&&typeof ut=="object"){const Ct=bt.indexOf(ut);if(Ct!==-1)Pt.indexOf(Ct)===-1&&Pt.push(Ct);else if(bt.push(ut),Array.isArray(ut))for(let kt=0,$t=ut.length;kt<$t;kt+=1)gt(ut[kt],bt,Pt);else{const kt=Object.keys(ut);for(let $t=0,Ot=kt.length;$t<Ot;$t+=1)gt(ut[kt[$t]],bt,Pt)}}}function wt(ut,bt){bt=bt||{};const Pt=new Zt(bt);Pt.noRefs||ft(ut,Pt);let Ct=ut;return Pt.replacer&&(Ct=Pt.replacer.call({"":Ct},"",Ct)),st(Pt,0,Ct,!0,!0)?Pt.dump+`
`:""}return dumper.dump=wt,dumper}var hasRequiredJsYaml;function requireJsYaml(){if(hasRequiredJsYaml)return jsYaml;hasRequiredJsYaml=1;const o=requireLoader(),e=requireDumper();function s(a,c){return function(){throw new Error("Function yaml."+a+" is removed in js-yaml 4. Use yaml."+c+" instead, which is now safe by default.")}}return jsYaml.Type=requireType(),jsYaml.Schema=requireSchema(),jsYaml.FAILSAFE_SCHEMA=requireFailsafe(),jsYaml.JSON_SCHEMA=requireJson(),jsYaml.CORE_SCHEMA=requireCore(),jsYaml.DEFAULT_SCHEMA=require_default(),jsYaml.load=o.load,jsYaml.loadAll=o.loadAll,jsYaml.dump=e.dump,jsYaml.YAMLException=requireException(),jsYaml.types={binary:requireBinary(),float:requireFloat(),map:requireMap(),null:require_null(),pairs:requirePairs(),set:requireSet(),timestamp:requireTimestamp(),bool:requireBool(),int:requireInt(),merge:requireMerge(),omap:requireOmap(),seq:requireSeq(),str:requireStr()},jsYaml.safeLoad=s("safeLoad","load"),jsYaml.safeLoadAll=s("safeLoadAll","loadAll"),jsYaml.safeDump=s("safeDump","dump"),jsYaml}(function(o){var e=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(vt,tt,nt,ot){ot===void 0&&(ot=nt);var ht=Object.getOwnPropertyDescriptor(tt,nt);(!ht||("get"in ht?!tt.__esModule:ht.writable||ht.configurable))&&(ht={enumerable:!0,get:function(){return tt[nt]}}),Object.defineProperty(vt,ot,ht)}:function(vt,tt,nt,ot){ot===void 0&&(ot=nt),vt[ot]=tt[nt]}),s=commonjsGlobal&&commonjsGlobal.__setModuleDefault||(Object.create?function(vt,tt){Object.defineProperty(vt,"default",{enumerable:!0,value:tt})}:function(vt,tt){vt.default=tt}),a=commonjsGlobal&&commonjsGlobal.__importStar||function(){var vt=function(tt){return vt=Object.getOwnPropertyNames||function(nt){var ot=[];for(var ht in nt)Object.prototype.hasOwnProperty.call(nt,ht)&&(ot[ot.length]=ht);return ot},vt(tt)};return function(tt){if(tt&&tt.__esModule)return tt;var nt={};if(tt!=null)for(var ot=vt(tt),ht=0;ht<ot.length;ht++)ot[ht]!=="default"&&e(nt,tt,ot[ht]);return s(nt,tt),nt}}();Object.defineProperty(o,"__esModule",{value:!0}),o.SemverPart=o.helpers=o.Helpers=o.Deferred=void 0;const c=a(build$1),d=build$1;Object.defineProperty(o,"Deferred",{enumerable:!0,get:function(){return d.Deferred}});const h=extensions,b=log$5,j=requireObjectHelpers(),$=requireStringExtensions(),_e=DateExtensions$1,it=Measurement$1,at=Hash$1,lt=MyLodash$1;class dt{constructor(){this.measure=it.Measurement.measure,this.Measurement=it.Measurement,this.ObjectHelpers=j.objectHelpers,this.hash=at.Hash,this.extensions=h.extensions,this.keys=tt=>tt==null?[]:Object.keys(tt),this.values=tt=>tt==null?[]:Object.values(tt),this.enumToArray=tt=>Object.keys(tt).map(nt=>tt[nt]).filter(nt=>typeof nt=="string"),this.initConcurrency(),this.isBrowser=typeof window<"u"}bufferToArrayBuffer(tt){for(var nt=new ArrayBuffer(tt.length),ot=new Uint8Array(nt),ht=0;ht<tt.length;++ht)ot[ht]=tt[ht];return nt}arrayBufferToBuffer(tt){for(var nt=Buffer.alloc(tt.byteLength),ot=new Uint8Array(tt),ht=0;ht<nt.length;++ht)nt[ht]=ot[ht];return nt}newPromise(){var tt=new d.Deferred;return tt}parseJsonFileStripComments(tt){const nt=new RegExp(/(?:^|\s)\/\/(.+?)$/,"gm"),ot=tt.replace(nt,"").trim();return JSON.parse(ot)}parseConfig(tt,nt){try{var ot=this.parseJsonFileStripComments(tt);ot.private=j.objectHelpers.merge(ot.private,ot.envs[nt].private),delete ot.envs[nt].private,ot=j.objectHelpers.merge(ot,ot.envs[nt]),delete ot.envs;var ht=JSON.stringify(ot);return ht=$.StringExtensions.format.call(ht,j.objectHelpers.merge(ot,ot.private)),ot=JSON.parse(ht),ot}catch(xt){b.log.error("parseConfig error: ",xt)}}formatify(tt,...nt){var ot=JSON.stringify(tt);const ht=(nt==null?void 0:nt.length)>1?nt[nt.length-1]:null;return ot=$.StringExtensions.format.call(ot,j.objectHelpers.merge(tt,...nt),ht),ot=ot.replace(/\n/gi,"\\n"),JSON.parse(ot)}hexc(tt){try{var nt=tt.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);delete nt[0];for(var ot=1;ot<=3;++ot)nt[ot]=parseInt(nt[ot]).toString(16),nt[ot].length==1&&(nt[ot]="0"+nt[ot]);return"#"+nt.join("")}catch{return}}parse(tt){return JSON.parse(tt)}jsonify(tt,nt=!1){return nt?nt?JSON.stringify(tt):JSON.stringify(tt,function(ot,ht){return ht instanceof Array?JSON.stringify(ht):ht},4):JSON.stringify(tt,null,2)}newGuid(tt=!1){var nt=tt?"-":"";function ot(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)}return ot()+ot()+nt+ot()+nt+ot()+nt+ot()+nt+ot()+ot()+ot()}stringifyOnce(tt,nt=null,ot=null){var ht=[],xt=[];function Et(_t,Rt){if(ht.length>2e3)return"object too long";var Bt=!1;if(ht.forEach(function(Ht,er){Ht===Rt&&(Bt=er)}),_t=="")return ht.push(tt),xt.push("root"),Rt;if(Bt+""!="false"&&typeof Rt=="object")return xt[Bt]=="root"?"(pointer to root)":"(see "+(Rt&&Rt.constructor?Rt.constructor.name.toLowerCase():typeof Rt)+" with key "+xt[Bt]+")";var Mt=_t||"(empty key)";return ht.push(Rt),xt.push(Mt),nt?nt(_t,Rt):Rt}return JSON.stringify(tt,Et,ot)}getMatch(tt,nt,ot){ot||(ot=1);var ht=[],xt=RegExp(nt,"g");let Et;for(;(Et=xt.exec(tt))&&(ht.push(Et[ot]),xt.lastIndex!=0););return ht}getMatches(tt,nt,ot=null){let ht=1e4;var xt=[],Et=RegExp(nt,"g");let _t;for(;(_t=Et.exec(tt))&&(xt.push(_t),Et.lastIndex!=0);)if(ht--<=0)throw"getMatches: something went wrong!";return ot==null?xt:typeof ot=="number"?lt.MyLodash.map(xt,Rt=>Rt[ot]):typeof ot=="string"?lt.MyLodash.map(xt,Rt=>Rt.groups[ot]):typeof ot=="boolean"?lt.MyLodash.map(xt,Rt=>Rt.groups):xt}base64ToUint8Array(tt){for(var nt=lt.MyLodash.repeat("=",(4-tt.length%4)%4),ot=(tt+nt).replace(/\-/g,"+").replace(/_/g,"/"),ht=Buffer.from(ot,"base64").toString("binary"),xt=new Uint8Array(ht.length),Et=0;Et<ht.length;++Et)xt[Et]=ht.charCodeAt(Et);return xt}getParamNames(tt){var nt=tt.toString().replace(j.objectHelpers.STRIP_COMMENTS,"");if(nt.match(/^\s*class\s+/)!=null)return null;var ot=nt.match(/^\(?(?:async\s?)?(?:function\s?)?\(?([\w\d\,\s\$\_]+)\)?/);if(ot==null||ot.length<1)return null;var ht=ot[1].replace(/\s/g,""),xt=ht.split(",");return xt===null&&(xt=[]),xt}randomNumber(tt,nt){return tt==null&&(tt=100),nt==null&&(nt=0),Math.floor(Math.random()*(tt-nt+1))+nt}shuffle(tt){var nt=j.objectHelpers.clone(tt,[]),ot,ht,xt;for(xt=nt.length;xt;xt--)ot=Math.floor(Math.random()*xt),ht=nt[xt-1],nt[xt-1]=nt[ot],nt[ot]=ht;return nt}async fileStreamToBuffer(tt){let nt=this.newPromise(),ot=[];return tt.readable||nt.reject("fileStreamToBuffer: ex: stream no readable!"),tt.on("error",ht=>{nt.reject(ht)}),tt.on("data",ht=>{ot.push(ht)}),tt.on("close",()=>{nt.resolve(Buffer.concat(ot))}),nt}getObjectByPath(tt,nt=null){nt==null&&(nt=window||commonjsGlobal),tt=tt.replace(/\[(\w+)\]/g,".$1"),tt=tt.replace(/^\./,"");for(var ot=tt.split("."),ht=0,xt=ot.length;ht<xt;++ht){var Et=ot[ht];if(Et in nt)nt=nt[Et];else return}return nt}getEnumKeyFromValue(tt,nt){return Object.keys(tt).find(ot=>tt[ot]===nt)}querialize(tt,nt){if(tt==null||tt.length<1)return null;var ot=[];for(var ht in tt)tt.hasOwnProperty(ht)&&ot.push(encodeURIComponent(ht)+"="+encodeURIComponent(tt[ht]));return(nt?"":"?")+ot.join("&")}toUnicode(tt){for(var nt="",ot=0;ot<tt.length;ot++){for(var ht=tt.charCodeAt(ot).toString(16).toUpperCase();ht.length<4;)ht="0"+ht;ht="\\u"+ht,nt+=ht}return nt}parseUrl(tt){var nt,ot,ht,xt,Et,_t,Rt,Bt,Mt;let Ht=(nt=this.getMatches(tt,/((?<protocol>\w+):\/\/(?<subdomain>([\w\d-]+\.)+)?(?<domainName>[\w\d-]+)\.(?<domainExt>[\w\d-]+))?\/(?<path>[^\?]+)\/?([\?\&](?<queryParams>.*))?/g,!0))===null||nt===void 0?void 0:nt[0];const er=(ot=Ht==null?void 0:Ht.queryParams)!==null&&ot!==void 0?ot:(xt=(ht=this.getMatches(tt,/[\?\&](.*)/))===null||ht===void 0?void 0:ht[0])===null||xt===void 0?void 0:xt[1];if(er&&Ht==null&&(Ht={queryParams:er,path:null,segments:[]}),Ht==null)return null;!((Et=Ht.subdomain)===null||Et===void 0)&&Et.endsWith(".")&&(Ht.subdomain=Ht.subdomain.slice(0,-1)),!((_t=Ht.path)===null||_t===void 0)&&_t.endsWith("/")&&(Ht.path=Ht.path.slice(0,-1));const Yt=(Rt=Ht.queryParams)===null||Rt===void 0?void 0:Rt.split("&").reduce((rr,Jt)=>{const Dt=Jt.split("=");return rr[Dt[0]]=Dt[1]||!0,rr},{});return{...Ht,segments:(Mt=(Bt=Ht.path)===null||Bt===void 0?void 0:Bt.split("/"))!==null&&Mt!==void 0?Mt:null,params:Yt}}stringToColour(tt){for(var nt=0,ot=0;ot<tt.length;ot++)nt=tt.charCodeAt(ot)+((nt<<5)-nt);for(var ht="#",ot=0;ot<3;ot++){var xt=nt>>ot*8&255;ht+=("00"+xt.toString(16)).substr(-2)}return ht}for(tt,nt,ot=0,ht=1){const xt=[];for(let Et=ot;Et<nt;Et+=ht)xt.push(tt(Et));return xt}each(tt,nt){let ot=0;for(let ht of tt)nt(ht,ot),ot++;return tt}eachPair(tt,nt){for(let[ot,ht,xt]of this.setToArr(tt))nt(ot,ht,xt)}setToArr(tt){let nt=-1;return Object.entries(tt).map(([ot,ht])=>(nt++,[ht,ot,nt]))}csvToJson(tt,nt=",",ot=!0){let ht=0,xt=null,Et=null,_t=0,Rt=!1,Bt=!1,Mt="",Ht=[],er={},Yt=[],rr=[];const Jt=/[\n\r]/gi,Dt=/[\"]/gi,gr=new RegExp(`[${nt}]`,"gi");for(;ht<tt.length;){xt=tt[ht],Et=ht<tt.length?tt[ht+1]:null;try{const Lt=(Et==null?void 0:Et.match(gr))||(Et==null?void 0:Et.match(Jt))||ht==tt.length-1;if(xt.match(Jt)){_t==0&&(Yt=Ht.map(Vt=>Vt.replace(/[\'\"]/g,"")),Mt=""),_t!=0&&(Ht.length!=Yt.length||Rt)&&Mt.length!=0?Mt+=`
`:Ht=[],_t++;continue}else xt.match(Dt)&&(!Rt&&ht==tt.length-1&&(Mt+=xt),!Rt&&(tt==null?void 0:tt[ht-1])==" "&&(Mt=Mt.trim()),!Rt&&Mt.length==0&&(Rt=!0),Bt=!Bt,Rt&&Lt&&!Bt&&(Rt=!1));if(!Rt&&(xt.match(gr)||ht==tt.length-1||Et.match(Jt))){(!xt.match(gr)&&!xt.match(Dt)||xt.match(Dt)&&Lt)&&(Mt+=xt),ot&&(Mt=Mt.replace(/^\s*[\'\"]\s*([\s\S]+?)?\s*[\'\"]\s*?$/gi,"$1").trim()),_t>0&&(er[Yt[Ht.length]]=Mt.replace(/\"\"/gi,'"')),Ht.push(Mt),Mt="",Ht.length==Yt.length&&(rr.push(er),er={});continue}Mt+=xt}finally{ht++}}return rr}jsonToCsv(tt){tt=typeof tt=="string"?JSON.parse(tt):tt;const nt=new Set,ot=Array.isArray(tt);let ht;if(ot)tt.forEach((_t,Rt)=>{Object.keys(_t).forEach(Bt=>nt.add(Bt))}),ht=tt.map((_t,Rt)=>({key:Rt+1,..._t}));else{for(let _t in tt)tt.hasOwnProperty(_t)&&Object.keys(tt[_t]).forEach(Rt=>nt.add(Rt));ht=Object.keys(tt).map(_t=>({key:_t,...tt[_t]}))}const xt=Array.from(nt).sort();let Et=","+xt.join(",")+`
`;return ht.forEach(_t=>{let Rt=[_t.key];xt.forEach(Bt=>{const Mt=_t[Bt]!==void 0?_t[Bt]:"";Rt.push(Mt)}),Et+=Rt.join(",")+`
`}),Et}median(tt){const nt=[...tt];if(nt.length===0)throw new Error("No inputs");nt.sort(function(ht,xt){return ht-xt});var ot=Math.floor(nt.length/2);return nt.length%2?nt[ot]:(nt[ot-1]+nt[ot])/2}average(tt){return tt.reduce((ht,xt)=>ht+xt,0)/tt.length||0}std(tt){const nt=tt.reduce((ht,xt)=>ht+xt)/tt.length,ot=tt.reduce((ht,xt)=>ht+(xt-nt)**2,0)/(tt.length-1);return Math.sqrt(ot)}humanizeTime(tt){tt<10&&(tt=10);const nt=Math.floor(tt/1e3%60),ot=Math.floor(tt/1e3/60%60),ht=parseInt(tt/(1e3*60*60));return[_e.DateExtensions.pad(ht.toString(),2),_e.DateExtensions.pad(ot.toString(),2),_e.DateExtensions.pad(nt.toString(),2)].join(":")}bumpVersion(tt,nt=mt.Patch,ot){if(nt=="replace")return ot.toString();const ht=this.parseSemVer(tt);ht[nt]=ot??parseInt(ht[nt])+1;let xt=!1;return lt.MyLodash.forEach(Object.values(mt),Et=>{if(!(Et!=nt&&!xt)){if(Et==nt){xt=!0;return}ht[Et]=0}}),Object.values(ht).join(".")}parseSemVer(tt){var nt;return(nt=this.getMatches(tt,/^(?<major>\d+)\.(?<minor>\d+)\.(?<patch>\d+)$/,!0))===null||nt===void 0?void 0:nt[0]}dictToArray(tt){var nt=lt.MyLodash.toPairs(tt),ot=[];return lt.MyLodash.each(nt,ht=>{const xt=ht[0];let Et=ht[1];j.objectHelpers.isObject(Et)?Et.id==null?Et.id=xt:Et._id=xt:Et={id:xt,val:Et},ot.push(Et)}),ot}arrayToDic(tt){return lt.MyLodash.transform(tt,(nt,ot)=>nt[ot]=!0,{})}escapeRegExp(tt){return tt.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}fixYaml(tt){const nt=this.getMatches(tt,/(?<valueOnly>(?<spacer>\s*-\s*)"(?<value2>.*)")|(?<key>\w+):\s*"(?<value>.*)"/);for(let ot of nt){let ht="";if(ot.groups.key&&ot.groups.value){const xt=ot.groups.value.replace(/\\\\/gi,"\\").replace(/\\(\W)/g,"$1").replace(/\\(\w)/g,"").replace(/"/g,"'");ht=`${ot.groups.key}: "${xt}"`}else if(ot.groups.valueOnly){const xt=ot.groups.value2.replace(/"/g,"'");ht=`${ot.groups.spacer}"${xt}"`}else continue;ht!=ot[0]&&(tt=tt.replace(ot[0],ht))}return tt}sanitize(tt,nt=[]){const ot=new Set(nt.map(Et=>Et.toLowerCase())),ht=/<\/?([a-z][a-z0-9]*)\b[^>]*>/gi;return tt.replace(ht,(Et,_t)=>ot.has(_t.toLowerCase())?Et:"")}bytesToBase64(tt){return btoa(String.fromCharCode(...tt))}bytesToBase64URL(tt){return this.bytesToBase64(tt).replaceAll("+","-").replaceAll("/","_").replaceAll("=","")}base64ToBytes(tt){return Uint8Array.from(atob(tt),nt=>nt.charCodeAt(0))}base64URLToBytes(tt){return this.base64ToBytes(tt.replaceAll("-","+").replaceAll("_","/"))}base64encode(tt,nt=new TextEncoder){return this.bytesToBase64(nt.encode(tt))}base64URLencode(tt,nt=new TextEncoder){return this.bytesToBase64URL(nt.encode(tt))}base64decode(tt,nt=new TextDecoder){return nt.decode(this.base64ToBytes(tt))}base64URLdecode(tt,nt=new TextDecoder){return nt.decode(this.base64URLToBytes(tt))}initConcurrency(){this.concurrency=c,this.Deferred=c.Deferred,this.throttle=c.throttle,this.debounce=c.debounce,this.delay=c.delay,this.async=c.async,this.isAsync=c.isAsync,this.forceAsync=c.async,this.waitUntil=c.waitUntil,this.chainTasks=c.chain.chainTasks,this.concurrent=c.concurrent,this.sleep=c.sleep}formatNumber(tt){return tt>=1e12?(tt/1e12).toFixed(0)+"t":tt>=1e9?(tt/1e9).toFixed(0)+"b":tt>=1e6?(tt/1e6).toFixed(0)+"m":tt>=1e3?(tt/1e3).toFixed(0)+"k":tt.toFixed(0)}getFileExtension(tt){return tt?tt.slice((tt.lastIndexOf(".")-1>>>0)+2):null}getFileNameOnly(tt){return tt?tt.slice(0,tt.lastIndexOf(".")):null}getFileNameFromUrl(tt){var nt,ot;if(!tt)return null;const ht=decodeURIComponent(tt);let xt=(ot=(nt=ht==null?void 0:ht.split("/"))===null||nt===void 0?void 0:nt.reverse())===null||ot===void 0?void 0:ot[0];return xt=xt==null?void 0:xt.replace("?alt=media",""),xt}ensureItemsPerRow(tt,nt=2){const ot=tt.length%nt;if(ot!==0){const ht=nt-ot;for(let xt=0;xt<ht;xt++)tt.push(null)}return tt}ensureKeysPerRow(tt,nt=2){const ot=Object.keys(tt).length%nt;if(ot===0)return tt;const ht=j.objectHelpers.clone(tt),xt=nt-ot;for(let Et=0;Et<xt;Et++)ht["_"+Et]=null;return ht}removeNulls(tt){return tt.filter(nt=>nt!=null)}blobToDataURI(tt){const nt=this.newPromise(),ot=new FileReader;return ot.onload=function(ht){var xt;const Et=(xt=ht.target)===null||xt===void 0?void 0:xt.result;nt.resolve(Et)},ot.onerror=function(ht){nt.reject(ht)},ot.readAsDataURL(tt),nt}dataURItoBlob(tt){const nt=tt.split(",")[0].indexOf("base64")>=0?atob(tt.split(",")[1]):unescape(tt.split(",")[1]),ot=tt.split(",")[0].split(":")[1].split(";")[0],ht=nt.length,xt=new Uint8Array(ht);for(let Et=0;Et<ht;Et++)xt[Et]=nt.charCodeAt(Et);return new Blob([xt],{type:ot})}blobToFile(tt,nt){return new File([tt],nt,{type:tt.type})}async blobToUint8Array(tt){const nt=await tt.arrayBuffer();return new Uint8Array(nt)}async parseYaml(tt){var nt,ot,ht;let xt=(ot=(nt=this.di)===null||nt===void 0?void 0:nt.get)===null||ot===void 0?void 0:ot.call(nt,"yaml");return xt||(xt=await Promise.resolve().then(()=>a(requireJsYaml())),!((ht=this.di)===null||ht===void 0)&&ht.register&&this.di.register("yaml",xt)),tt=this.extractBlock(tt,"yml"),b.log.verbose("helpers:parseYaml:",tt),await xt.load(tt==null?void 0:tt.trim())}extractBlock(tt,nt){const ht=tt.replace(/\\`/g,"`").replace(/\\n/g,`
`).replace(/\\"/g,'"').match(new RegExp(`\`\`\`${nt}([\\s\\S]*?)\`\`\``));return ht?ht[1]:tt}}o.Helpers=dt,o.helpers=new dt;var mt;(function(vt){vt.Major="major",vt.Minor="minor",vt.Patch="patch"})(mt||(o.SemverPart=mt={}))})(helpers);var Callbacks$1={},dependencyInjector={},DependencyInjector$1={},build={},Deferred$1={};Object.defineProperty(Deferred$1,"__esModule",{value:!0});class Deferred{constructor(){this._settled=!1,this._promise=new Promise((e,s)=>{this._resolve=e,this._reject=s})}getPromise(){return this._promise}resolve(e){this._settled=!0,this._resolve(e)}reject(e){this._settled=!0,this._reject(e)}catch(e){return Promise.prototype.catch.apply(this._promise,arguments)}then(e,s){return Promise.prototype.then.apply(this._promise,arguments)}finally(e){return Promise.prototype.finally.apply(this._promise,arguments)}get[Symbol.toStringTag](){return this.promise.toString()}done(e,s){(arguments.length?this._promise.then.apply(this._promise,arguments):this._promise).then(void 0,function(c){setTimeout(function(){throw c},0)})}isSettled(){return this._settled}promise(){return this.getPromise()}static new(){return new Deferred}}Deferred$1.default=Deferred;var debounce$1={};Object.defineProperty(debounce$1,"__esModule",{value:!0});const debounce=(o,e,s=!1,a=!0)=>{var c;return function(){var d=this,h=arguments,b=function(){c=null,a&&o.apply(d,h)},j=s&&!c;clearTimeout(c),c=setTimeout(b,e),j&&o.apply(d,h)}};debounce$1.default=debounce;var throttle$1={};Object.defineProperty(throttle$1,"__esModule",{value:!0});const throttle=(o,e,s=!0)=>{var a;return function(){var c=this,d=arguments,h=function(){a=null,s||o.apply(c,d)};a==null&&(a=setTimeout(h,e),s&&o.apply(c,d))}};throttle$1.default=throttle;var delay$1={},__awaiter$5=commonjsGlobal&&commonjsGlobal.__awaiter||function(o,e,s,a){function c(d){return d instanceof s?d:new s(function(h){h(d)})}return new(s||(s=Promise))(function(d,h){function b(_e){try{$(a.next(_e))}catch(it){h(it)}}function j(_e){try{$(a.throw(_e))}catch(it){h(it)}}function $(_e){_e.done?d(_e.value):c(_e.value).then(b,j)}$((a=a.apply(o,e||[])).next())})};Object.defineProperty(delay$1,"__esModule",{value:!0});const Deferred_1$3=Deferred$1,delay=o=>__awaiter$5(void 0,void 0,void 0,function*(){let e=Deferred_1$3.default.new();return setTimeout(()=>e.resolve(),o),e});delay$1.default=delay;var isAsync$1={};Object.defineProperty(isAsync$1,"__esModule",{value:!0});const isAsync=function(o){const e=o.toString().trim();return!!(e.match(/^async /)||e.match(/return _ref[^\.]*\.apply/)||e.match(/__awaiter/))};isAsync$1.default=isAsync;var waitUntil$1={},async$1={},__awaiter$4=commonjsGlobal&&commonjsGlobal.__awaiter||function(o,e,s,a){function c(d){return d instanceof s?d:new s(function(h){h(d)})}return new(s||(s=Promise))(function(d,h){function b(_e){try{$(a.next(_e))}catch(it){h(it)}}function j(_e){try{$(a.throw(_e))}catch(it){h(it)}}function $(_e){_e.done?d(_e.value):c(_e.value).then(b,j)}$((a=a.apply(o,e||[])).next())})};Object.defineProperty(async$1,"__esModule",{value:!0});const Deferred_1$2=Deferred$1,isAsync_1$1=isAsync$1,async=function(o){if(isAsync_1$1.default(o))return o;let e=Deferred_1$2.default.new();return function(){return __awaiter$4(this,arguments,void 0,function*(){let a=arguments;try{let c=o.apply(o,a);return e.resolve(c),c}catch(c){return e.reject(c),null}})}};async$1.default=async;var __awaiter$3=commonjsGlobal&&commonjsGlobal.__awaiter||function(o,e,s,a){function c(d){return d instanceof s?d:new s(function(h){h(d)})}return new(s||(s=Promise))(function(d,h){function b(_e){try{$(a.next(_e))}catch(it){h(it)}}function j(_e){try{$(a.throw(_e))}catch(it){h(it)}}function $(_e){_e.done?d(_e.value):c(_e.value).then(b,j)}$((a=a.apply(o,e||[])).next())})};Object.defineProperty(waitUntil$1,"__esModule",{value:!0});const Deferred_1$1=Deferred$1,async_1$1=async$1,waitUntil=(o,e=null,s=10,a=5e3)=>__awaiter$3(void 0,void 0,void 0,function*(){var c=new Date;c.setMilliseconds(c.getMilliseconds()+a);var d=async_1$1.default(o);let h=Deferred_1$1.default.new();if(yield d()){let j=e?e():null;return h.resolve(j)}var b=setInterval(()=>__awaiter$3(void 0,void 0,void 0,function*(){if(new Date>c)return clearInterval(b),h.reject();if(yield d()){clearInterval(b);let j=e?e():null;return h.resolve(j)}}),s);return h});waitUntil$1.default=waitUntil;var measurements$1={};(function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.getMeasureAndReset=o.getMeasure=o.measure=void 0;let e={};o.measure=function(s="_"){return e[s]!=null?o.getMeasure(s):(e[s]=new Date().getTime(),0)},o.getMeasure=function(s="_"){return e[s]==null?0:new Date().getTime()-e[s]},o.getMeasureAndReset=function(s="_"){let a=o.getMeasure(s);return e[s]=null,a}})(measurements$1);var chain$1={},__awaiter$2=commonjsGlobal&&commonjsGlobal.__awaiter||function(o,e,s,a){function c(d){return d instanceof s?d:new s(function(h){h(d)})}return new(s||(s=Promise))(function(d,h){function b(_e){try{$(a.next(_e))}catch(it){h(it)}}function j(_e){try{$(a.throw(_e))}catch(it){h(it)}}function $(_e){_e.done?d(_e.value):c(_e.value).then(b,j)}$((a=a.apply(o,e||[])).next())})};Object.defineProperty(chain$1,"__esModule",{value:!0});chain$1.chainTasks=void 0;chain$1.chainTasks=(o,e)=>__awaiter$2(void 0,void 0,void 0,function*(){for(var s=0,a=0;a<o.length;a++){var c=o[a];yield c().then(()=>{e&&e(s++)})}});var sleep$1={},__awaiter$1=commonjsGlobal&&commonjsGlobal.__awaiter||function(o,e,s,a){function c(d){return d instanceof s?d:new s(function(h){h(d)})}return new(s||(s=Promise))(function(d,h){function b(_e){try{$(a.next(_e))}catch(it){h(it)}}function j(_e){try{$(a.throw(_e))}catch(it){h(it)}}function $(_e){_e.done?d(_e.value):c(_e.value).then(b,j)}$((a=a.apply(o,e||[])).next())})};Object.defineProperty(sleep$1,"__esModule",{value:!0});const sleep=o=>__awaiter$1(void 0,void 0,void 0,function*(){return new Promise(e=>setTimeout(e,o))});sleep$1.default=sleep;Object.defineProperty(build,"__esModule",{value:!0});build.async=build.sleep=build.chain=build.measurements=build.waitUntil=build.isAsync=build.delay=build.throttle=build.debounce=build.Deferred=void 0;const Deferred_1=Deferred$1;build.Deferred=Deferred_1.default;const debounce_1=debounce$1;build.debounce=debounce_1.default;const throttle_1=throttle$1;build.throttle=throttle_1.default;const delay_1=delay$1;build.delay=delay_1.default;const isAsync_1=isAsync$1;build.isAsync=isAsync_1.default;const waitUntil_1=waitUntil$1;build.waitUntil=waitUntil_1.default;const measurements=measurements$1;build.measurements=measurements;const chain=chain$1;build.chain=chain;const sleep_1=sleep$1;build.sleep=sleep_1.default;const async_1=async$1;build.async=async_1.default;var Helpers$1={};Object.defineProperty(Helpers$1,"__esModule",{value:!0});class Helpers{static isArray(e){return Array.isArray?Array.isArray(e):toString.call(e)==="[object Array]"}}Helpers$1.default=Helpers;Helpers.STRIP_COMMENTS=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm;Helpers.ARGUMENT_NAMES=/([^\s,]+)/g;Helpers.getParamNames=function(o){const e=o.toString().replace(Helpers.STRIP_COMMENTS,"");let s=null;if(e.match(/^\s*class\s+/)!=null?s=e.match(/(?:constructor\s?)\(?([\w\d\,\s\$\_]+)\)?/):s=e.match(/^\(?(?:async\s?)?(?:function\*?\s[\w\d]+\s?)?\(?([\w\d\,\s\$\_]+)\)?/),s==null||s.length<1)return null;let c=s[1].replace(/\s/g,"").split(",");return c===null&&(c=[]),c};Helpers.getKeys=o=>Object.keys(o);Helpers.isEmpty=o=>{if(o==null)return!0;for(const e in o)if(o.hasOwnProperty(e))return!1;return JSON.stringify(o)===JSON.stringify({})};Helpers.removeItemFromArr=(o,e)=>{const s=o.indexOf(e);return s>-1&&o.splice(s,1),o};Helpers.tryGetInstanceTypeName=function(o){var e,s,a;if(o==null)return null;if(typeof o=="function"){if(o.name=="")throw new Error("Helpers:tryGetInstanceName: Cannot imply instance name from anonymous functions");return o.name}return!((e=o.constructor)===null||e===void 0)&&e.name&&((s=o.constructor)===null||s===void 0?void 0:s.name)!="Function"?(a=o.constructor)===null||a===void 0?void 0:a.name:typeof o};var __awaiter=commonjsGlobal&&commonjsGlobal.__awaiter||function(o,e,s,a){function c(d){return d instanceof s?d:new s(function(h){h(d)})}return new(s||(s=Promise))(function(d,h){function b(_e){try{$(a.next(_e))}catch(it){h(it)}}function j(_e){try{$(a.throw(_e))}catch(it){h(it)}}function $(_e){_e.done?d(_e.value):c(_e.value).then(b,j)}$((a=a.apply(o,e||[])).next())})};Object.defineProperty(DependencyInjector$1,"__esModule",{value:!0});DependencyInjector$1.ModuleOptions=DependencyInjector$1.DependencyInjector=void 0;const concurrency_libx_js_1$1=build,Helpers_1=Helpers$1;class DependencyInjector{constructor(e,s){this.modules={},this.parent=null,this._options=new ModuleOptions$3,this._pendingRequireRequests=[],this._options=Object.assign(Object.assign({},this._options),s),this.parent=e}get proxy(){return new Proxy({},{get:(e,s)=>{const a=s,c=this.modules[a];if(c!=null)return c;if(this.parent!=null){const d=this.parent.modules[a];if(d!=null)return d}return new Proxy({},{get:(d,h)=>(...b)=>__awaiter(this,void 0,void 0,function*(){return(yield this.require(a))[h](...b)})})}})}register(e,s,a=!1){return __awaiter(this,void 0,void 0,function*(){if(e==null)throw"DependencyInjector: identifier cannot be null";if(this.modules[e]!=null&&a)throw`DependencyInjector: Module already exists!, identifier: ${e.toString()}`;this.modules[e]=s;const c=s instanceof Promise?yield s:s;return this.modules[e]=c,this._recheckPendingRequireRequestsAndTrigger(e,c),c})}registerAsync(e,s,a=!1){return __awaiter(this,void 0,void 0,function*(){if(e==null)throw"DependencyInjector: identifier cannot be null";if(this.modules[e]!=null&&a)throw`DependencyInjector: Module already exists!, identifier: ${e.toString()}`;this.modules[e]=s;const c=s instanceof Promise?yield s:s;return this.modules[e]=c,this._recheckPendingRequireRequestsAndTrigger(e,c),c})}get(e){return this.modules[e]}require(e){return __awaiter(this,void 0,void 0,function*(){return yield this.requireSingle(e)})}requireMany(e){return __awaiter(this,void 0,void 0,function*(){const s=[];for(let a of e){const c=this.requireSingle(a);s.push(c)}return yield Promise.all(s)})}inject(e,s){return __awaiter(this,void 0,void 0,function*(){s==null&&(s=Helpers_1.default.getParamNames(e));const a=yield this.requireMany(s);return e.apply(e,a)})}initiate(e,s){return __awaiter(this,void 0,void 0,function*(){const a=s||Helpers_1.default.getParamNames(e),c=yield this.requireMany(a);return Reflect.construct(e,c)})}injectAndRegister(e,s){return __awaiter(this,void 0,void 0,function*(){const a=yield this.inject(s);return this.register(e,a)})}hasPendingRequireRequests(){return this._pendingRequireRequests.length>0}unregister(e){delete this.modules[e]}requireSingle(e){return __awaiter(this,void 0,void 0,function*(){let s=this.modules[e];if(s==null&&this.parent!=null&&(s=this.parent.modules[e]),s!=null)return s;const a=new PendingRequireRequest(e);return this._pendingRequireRequests.push(a),a.promise})}_recheckPendingRequireRequestsAndTrigger(e,s){for(let a of[...this._pendingRequireRequests])a.moduleIdentifier==e&&(a.promise.resolve(s),Helpers_1.default.removeItemFromArr(this._pendingRequireRequests,a))}}DependencyInjector$1.DependencyInjector=DependencyInjector;class PendingRequireRequest{constructor(e){this.moduleIdentifier=e,this.promise=new concurrency_libx_js_1$1.Deferred}onResolve(e){return this.promise.resolve(e)}}let ModuleOptions$3=class{};DependencyInjector$1.ModuleOptions=ModuleOptions$3;DependencyInjector$1.default=new DependencyInjector;Object.defineProperty(dependencyInjector,"__esModule",{value:!0});dependencyInjector.di=void 0;const DependencyInjector_1=DependencyInjector$1;dependencyInjector.di=new DependencyInjector_1.DependencyInjector;Object.defineProperty(Callbacks$1,"__esModule",{value:!0});Callbacks$1.ModuleOptions=Callbacks$1.Callbacks=void 0;const concurrency_libx_js_1=build$1,helpers_1$6=helpers,dependencyInjector_1$1=dependencyInjector,ArrayExtensions_1=ArrayExtensions$1;class Callbacks{constructor(e){this.options=new ModuleOptions$2,this.options={...this.options,...e},this.counter=0,this.list={},this.options.cb!=null&&this.subscribe(this.options.cb)}subscribe(e){this.list[this.counter]=e;var s=this.counter;return this.counter++,s}once(e){let s=this,a=this.subscribe(function(){s.clear(a),e.apply(null,arguments)})}until(e){let s=this.subscribe(e);return()=>{this.clear(s)}}trigger(...e){const s=helpers_1$6.helpers.newPromise(),a=[];return ArrayExtensions_1.ArrayExtensions.each.call(this.list,c=>{if(c==null)return;const d=(0,concurrency_libx_js_1.async)(c).apply(c,e);a.push(d)}),Promise.all(a).then(()=>{s.resolve()}).catch(c=>{s.reject(c)}),s}unsubscribe(e){return this.clear(e)}clear(e){delete this.list[e],this.counter--}clearAll(){delete this.list,this.list={},this.counter=0}getSubscribersCount(){return this.counter}}Callbacks$1.Callbacks=Callbacks;let ModuleOptions$2=class{};Callbacks$1.ModuleOptions=ModuleOptions$2;dependencyInjector_1$1.di.register("Callbacks",Callbacks);var buffer={},base64Js={};base64Js.byteLength=byteLength;base64Js.toByteArray=toByteArray;base64Js.fromByteArray=fromByteArray;var lookup=[],revLookup=[],Arr=typeof Uint8Array<"u"?Uint8Array:Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var i=0,len=code.length;i<len;++i)lookup[i]=code[i],revLookup[code.charCodeAt(i)]=i;revLookup[45]=62;revLookup[95]=63;function getLens(o){var e=o.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var s=o.indexOf("=");s===-1&&(s=e);var a=s===e?0:4-s%4;return[s,a]}function byteLength(o){var e=getLens(o),s=e[0],a=e[1];return(s+a)*3/4-a}function _byteLength(o,e,s){return(e+s)*3/4-s}function toByteArray(o){var e,s=getLens(o),a=s[0],c=s[1],d=new Arr(_byteLength(o,a,c)),h=0,b=c>0?a-4:a,j;for(j=0;j<b;j+=4)e=revLookup[o.charCodeAt(j)]<<18|revLookup[o.charCodeAt(j+1)]<<12|revLookup[o.charCodeAt(j+2)]<<6|revLookup[o.charCodeAt(j+3)],d[h++]=e>>16&255,d[h++]=e>>8&255,d[h++]=e&255;return c===2&&(e=revLookup[o.charCodeAt(j)]<<2|revLookup[o.charCodeAt(j+1)]>>4,d[h++]=e&255),c===1&&(e=revLookup[o.charCodeAt(j)]<<10|revLookup[o.charCodeAt(j+1)]<<4|revLookup[o.charCodeAt(j+2)]>>2,d[h++]=e>>8&255,d[h++]=e&255),d}function tripletToBase64(o){return lookup[o>>18&63]+lookup[o>>12&63]+lookup[o>>6&63]+lookup[o&63]}function encodeChunk(o,e,s){for(var a,c=[],d=e;d<s;d+=3)a=(o[d]<<16&16711680)+(o[d+1]<<8&65280)+(o[d+2]&255),c.push(tripletToBase64(a));return c.join("")}function fromByteArray(o){for(var e,s=o.length,a=s%3,c=[],d=16383,h=0,b=s-a;h<b;h+=d)c.push(encodeChunk(o,h,h+d>b?b:h+d));return a===1?(e=o[s-1],c.push(lookup[e>>2]+lookup[e<<4&63]+"==")):a===2&&(e=(o[s-2]<<8)+o[s-1],c.push(lookup[e>>10]+lookup[e>>4&63]+lookup[e<<2&63]+"=")),c.join("")}var ieee754={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */ieee754.read=function(o,e,s,a,c){var d,h,b=c*8-a-1,j=(1<<b)-1,$=j>>1,_e=-7,it=s?c-1:0,at=s?-1:1,lt=o[e+it];for(it+=at,d=lt&(1<<-_e)-1,lt>>=-_e,_e+=b;_e>0;d=d*256+o[e+it],it+=at,_e-=8);for(h=d&(1<<-_e)-1,d>>=-_e,_e+=a;_e>0;h=h*256+o[e+it],it+=at,_e-=8);if(d===0)d=1-$;else{if(d===j)return h?NaN:(lt?-1:1)*(1/0);h=h+Math.pow(2,a),d=d-$}return(lt?-1:1)*h*Math.pow(2,d-a)};ieee754.write=function(o,e,s,a,c,d){var h,b,j,$=d*8-c-1,_e=(1<<$)-1,it=_e>>1,at=c===23?Math.pow(2,-24)-Math.pow(2,-77):0,lt=a?0:d-1,dt=a?1:-1,mt=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(b=isNaN(e)?1:0,h=_e):(h=Math.floor(Math.log(e)/Math.LN2),e*(j=Math.pow(2,-h))<1&&(h--,j*=2),h+it>=1?e+=at/j:e+=at*Math.pow(2,1-it),e*j>=2&&(h++,j/=2),h+it>=_e?(b=0,h=_e):h+it>=1?(b=(e*j-1)*Math.pow(2,c),h=h+it):(b=e*Math.pow(2,it-1)*Math.pow(2,c),h=0));c>=8;o[s+lt]=b&255,lt+=dt,b/=256,c-=8);for(h=h<<c|b,$+=c;$>0;o[s+lt]=h&255,lt+=dt,h/=256,$-=8);o[s+lt-dt]|=mt*128};/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/(function(o){const e=base64Js,s=ieee754,a=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;o.Buffer=b,o.SlowBuffer=nt,o.INSPECT_MAX_BYTES=50;const c=2147483647;o.kMaxLength=c,b.TYPED_ARRAY_SUPPORT=d(),!b.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function d(){try{const pt=new Uint8Array(1),g={foo:function(){return 42}};return Object.setPrototypeOf(g,Uint8Array.prototype),Object.setPrototypeOf(pt,g),pt.foo()===42}catch{return!1}}Object.defineProperty(b.prototype,"parent",{enumerable:!0,get:function(){if(b.isBuffer(this))return this.buffer}}),Object.defineProperty(b.prototype,"offset",{enumerable:!0,get:function(){if(b.isBuffer(this))return this.byteOffset}});function h(pt){if(pt>c)throw new RangeError('The value "'+pt+'" is invalid for option "size"');const g=new Uint8Array(pt);return Object.setPrototypeOf(g,b.prototype),g}function b(pt,g,et){if(typeof pt=="number"){if(typeof g=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return it(pt)}return j(pt,g,et)}b.poolSize=8192;function j(pt,g,et){if(typeof pt=="string")return at(pt,g);if(ArrayBuffer.isView(pt))return dt(pt);if(pt==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof pt);if(wr(pt,ArrayBuffer)||pt&&wr(pt.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(wr(pt,SharedArrayBuffer)||pt&&wr(pt.buffer,SharedArrayBuffer)))return mt(pt,g,et);if(typeof pt=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const st=pt.valueOf&&pt.valueOf();if(st!=null&&st!==pt)return b.from(st,g,et);const ft=vt(pt);if(ft)return ft;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof pt[Symbol.toPrimitive]=="function")return b.from(pt[Symbol.toPrimitive]("string"),g,et);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof pt)}b.from=function(pt,g,et){return j(pt,g,et)},Object.setPrototypeOf(b.prototype,Uint8Array.prototype),Object.setPrototypeOf(b,Uint8Array);function $(pt){if(typeof pt!="number")throw new TypeError('"size" argument must be of type number');if(pt<0)throw new RangeError('The value "'+pt+'" is invalid for option "size"')}function _e(pt,g,et){return $(pt),pt<=0?h(pt):g!==void 0?typeof et=="string"?h(pt).fill(g,et):h(pt).fill(g):h(pt)}b.alloc=function(pt,g,et){return _e(pt,g,et)};function it(pt){return $(pt),h(pt<0?0:tt(pt)|0)}b.allocUnsafe=function(pt){return it(pt)},b.allocUnsafeSlow=function(pt){return it(pt)};function at(pt,g){if((typeof g!="string"||g==="")&&(g="utf8"),!b.isEncoding(g))throw new TypeError("Unknown encoding: "+g);const et=ot(pt,g)|0;let st=h(et);const ft=st.write(pt,g);return ft!==et&&(st=st.slice(0,ft)),st}function lt(pt){const g=pt.length<0?0:tt(pt.length)|0,et=h(g);for(let st=0;st<g;st+=1)et[st]=pt[st]&255;return et}function dt(pt){if(wr(pt,Uint8Array)){const g=new Uint8Array(pt);return mt(g.buffer,g.byteOffset,g.byteLength)}return lt(pt)}function mt(pt,g,et){if(g<0||pt.byteLength<g)throw new RangeError('"offset" is outside of buffer bounds');if(pt.byteLength<g+(et||0))throw new RangeError('"length" is outside of buffer bounds');let st;return g===void 0&&et===void 0?st=new Uint8Array(pt):et===void 0?st=new Uint8Array(pt,g):st=new Uint8Array(pt,g,et),Object.setPrototypeOf(st,b.prototype),st}function vt(pt){if(b.isBuffer(pt)){const g=tt(pt.length)|0,et=h(g);return et.length===0||pt.copy(et,0,0,g),et}if(pt.length!==void 0)return typeof pt.length!="number"||vr(pt.length)?h(0):lt(pt);if(pt.type==="Buffer"&&Array.isArray(pt.data))return lt(pt.data)}function tt(pt){if(pt>=c)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+c.toString(16)+" bytes");return pt|0}function nt(pt){return+pt!=pt&&(pt=0),b.alloc(+pt)}b.isBuffer=function(g){return g!=null&&g._isBuffer===!0&&g!==b.prototype},b.compare=function(g,et){if(wr(g,Uint8Array)&&(g=b.from(g,g.offset,g.byteLength)),wr(et,Uint8Array)&&(et=b.from(et,et.offset,et.byteLength)),!b.isBuffer(g)||!b.isBuffer(et))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(g===et)return 0;let st=g.length,ft=et.length;for(let gt=0,wt=Math.min(st,ft);gt<wt;++gt)if(g[gt]!==et[gt]){st=g[gt],ft=et[gt];break}return st<ft?-1:ft<st?1:0},b.isEncoding=function(g){switch(String(g).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},b.concat=function(g,et){if(!Array.isArray(g))throw new TypeError('"list" argument must be an Array of Buffers');if(g.length===0)return b.alloc(0);let st;if(et===void 0)for(et=0,st=0;st<g.length;++st)et+=g[st].length;const ft=b.allocUnsafe(et);let gt=0;for(st=0;st<g.length;++st){let wt=g[st];if(wr(wt,Uint8Array))gt+wt.length>ft.length?(b.isBuffer(wt)||(wt=b.from(wt)),wt.copy(ft,gt)):Uint8Array.prototype.set.call(ft,wt,gt);else if(b.isBuffer(wt))wt.copy(ft,gt);else throw new TypeError('"list" argument must be an Array of Buffers');gt+=wt.length}return ft};function ot(pt,g){if(b.isBuffer(pt))return pt.length;if(ArrayBuffer.isView(pt)||wr(pt,ArrayBuffer))return pt.byteLength;if(typeof pt!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof pt);const et=pt.length,st=arguments.length>2&&arguments[2]===!0;if(!st&&et===0)return 0;let ft=!1;for(;;)switch(g){case"ascii":case"latin1":case"binary":return et;case"utf8":case"utf-8":return ar(pt).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return et*2;case"hex":return et>>>1;case"base64":return Rr(pt).length;default:if(ft)return st?-1:ar(pt).length;g=(""+g).toLowerCase(),ft=!0}}b.byteLength=ot;function ht(pt,g,et){let st=!1;if((g===void 0||g<0)&&(g=0),g>this.length||((et===void 0||et>this.length)&&(et=this.length),et<=0)||(et>>>=0,g>>>=0,et<=g))return"";for(pt||(pt="utf8");;)switch(pt){case"hex":return Vt(this,g,et);case"utf8":case"utf-8":return rr(this,g,et);case"ascii":return gr(this,g,et);case"latin1":case"binary":return Lt(this,g,et);case"base64":return Yt(this,g,et);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return nr(this,g,et);default:if(st)throw new TypeError("Unknown encoding: "+pt);pt=(pt+"").toLowerCase(),st=!0}}b.prototype._isBuffer=!0;function xt(pt,g,et){const st=pt[g];pt[g]=pt[et],pt[et]=st}b.prototype.swap16=function(){const g=this.length;if(g%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let et=0;et<g;et+=2)xt(this,et,et+1);return this},b.prototype.swap32=function(){const g=this.length;if(g%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let et=0;et<g;et+=4)xt(this,et,et+3),xt(this,et+1,et+2);return this},b.prototype.swap64=function(){const g=this.length;if(g%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let et=0;et<g;et+=8)xt(this,et,et+7),xt(this,et+1,et+6),xt(this,et+2,et+5),xt(this,et+3,et+4);return this},b.prototype.toString=function(){const g=this.length;return g===0?"":arguments.length===0?rr(this,0,g):ht.apply(this,arguments)},b.prototype.toLocaleString=b.prototype.toString,b.prototype.equals=function(g){if(!b.isBuffer(g))throw new TypeError("Argument must be a Buffer");return this===g?!0:b.compare(this,g)===0},b.prototype.inspect=function(){let g="";const et=o.INSPECT_MAX_BYTES;return g=this.toString("hex",0,et).replace(/(.{2})/g,"$1 ").trim(),this.length>et&&(g+=" ... "),"<Buffer "+g+">"},a&&(b.prototype[a]=b.prototype.inspect),b.prototype.compare=function(g,et,st,ft,gt){if(wr(g,Uint8Array)&&(g=b.from(g,g.offset,g.byteLength)),!b.isBuffer(g))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof g);if(et===void 0&&(et=0),st===void 0&&(st=g?g.length:0),ft===void 0&&(ft=0),gt===void 0&&(gt=this.length),et<0||st>g.length||ft<0||gt>this.length)throw new RangeError("out of range index");if(ft>=gt&&et>=st)return 0;if(ft>=gt)return-1;if(et>=st)return 1;if(et>>>=0,st>>>=0,ft>>>=0,gt>>>=0,this===g)return 0;let wt=gt-ft,ut=st-et;const bt=Math.min(wt,ut),Pt=this.slice(ft,gt),Ct=g.slice(et,st);for(let kt=0;kt<bt;++kt)if(Pt[kt]!==Ct[kt]){wt=Pt[kt],ut=Ct[kt];break}return wt<ut?-1:ut<wt?1:0};function Et(pt,g,et,st,ft){if(pt.length===0)return-1;if(typeof et=="string"?(st=et,et=0):et>2147483647?et=2147483647:et<-2147483648&&(et=-2147483648),et=+et,vr(et)&&(et=ft?0:pt.length-1),et<0&&(et=pt.length+et),et>=pt.length){if(ft)return-1;et=pt.length-1}else if(et<0)if(ft)et=0;else return-1;if(typeof g=="string"&&(g=b.from(g,st)),b.isBuffer(g))return g.length===0?-1:_t(pt,g,et,st,ft);if(typeof g=="number")return g=g&255,typeof Uint8Array.prototype.indexOf=="function"?ft?Uint8Array.prototype.indexOf.call(pt,g,et):Uint8Array.prototype.lastIndexOf.call(pt,g,et):_t(pt,[g],et,st,ft);throw new TypeError("val must be string, number or Buffer")}function _t(pt,g,et,st,ft){let gt=1,wt=pt.length,ut=g.length;if(st!==void 0&&(st=String(st).toLowerCase(),st==="ucs2"||st==="ucs-2"||st==="utf16le"||st==="utf-16le")){if(pt.length<2||g.length<2)return-1;gt=2,wt/=2,ut/=2,et/=2}function bt(Ct,kt){return gt===1?Ct[kt]:Ct.readUInt16BE(kt*gt)}let Pt;if(ft){let Ct=-1;for(Pt=et;Pt<wt;Pt++)if(bt(pt,Pt)===bt(g,Ct===-1?0:Pt-Ct)){if(Ct===-1&&(Ct=Pt),Pt-Ct+1===ut)return Ct*gt}else Ct!==-1&&(Pt-=Pt-Ct),Ct=-1}else for(et+ut>wt&&(et=wt-ut),Pt=et;Pt>=0;Pt--){let Ct=!0;for(let kt=0;kt<ut;kt++)if(bt(pt,Pt+kt)!==bt(g,kt)){Ct=!1;break}if(Ct)return Pt}return-1}b.prototype.includes=function(g,et,st){return this.indexOf(g,et,st)!==-1},b.prototype.indexOf=function(g,et,st){return Et(this,g,et,st,!0)},b.prototype.lastIndexOf=function(g,et,st){return Et(this,g,et,st,!1)};function Rt(pt,g,et,st){et=Number(et)||0;const ft=pt.length-et;st?(st=Number(st),st>ft&&(st=ft)):st=ft;const gt=g.length;st>gt/2&&(st=gt/2);let wt;for(wt=0;wt<st;++wt){const ut=parseInt(g.substr(wt*2,2),16);if(vr(ut))return wt;pt[et+wt]=ut}return wt}function Bt(pt,g,et,st){return Er(ar(g,pt.length-et),pt,et,st)}function Mt(pt,g,et,st){return Er(yr(g),pt,et,st)}function Ht(pt,g,et,st){return Er(Rr(g),pt,et,st)}function er(pt,g,et,st){return Er(xr(g,pt.length-et),pt,et,st)}b.prototype.write=function(g,et,st,ft){if(et===void 0)ft="utf8",st=this.length,et=0;else if(st===void 0&&typeof et=="string")ft=et,st=this.length,et=0;else if(isFinite(et))et=et>>>0,isFinite(st)?(st=st>>>0,ft===void 0&&(ft="utf8")):(ft=st,st=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const gt=this.length-et;if((st===void 0||st>gt)&&(st=gt),g.length>0&&(st<0||et<0)||et>this.length)throw new RangeError("Attempt to write outside buffer bounds");ft||(ft="utf8");let wt=!1;for(;;)switch(ft){case"hex":return Rt(this,g,et,st);case"utf8":case"utf-8":return Bt(this,g,et,st);case"ascii":case"latin1":case"binary":return Mt(this,g,et,st);case"base64":return Ht(this,g,et,st);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return er(this,g,et,st);default:if(wt)throw new TypeError("Unknown encoding: "+ft);ft=(""+ft).toLowerCase(),wt=!0}},b.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Yt(pt,g,et){return g===0&&et===pt.length?e.fromByteArray(pt):e.fromByteArray(pt.slice(g,et))}function rr(pt,g,et){et=Math.min(pt.length,et);const st=[];let ft=g;for(;ft<et;){const gt=pt[ft];let wt=null,ut=gt>239?4:gt>223?3:gt>191?2:1;if(ft+ut<=et){let bt,Pt,Ct,kt;switch(ut){case 1:gt<128&&(wt=gt);break;case 2:bt=pt[ft+1],(bt&192)===128&&(kt=(gt&31)<<6|bt&63,kt>127&&(wt=kt));break;case 3:bt=pt[ft+1],Pt=pt[ft+2],(bt&192)===128&&(Pt&192)===128&&(kt=(gt&15)<<12|(bt&63)<<6|Pt&63,kt>2047&&(kt<55296||kt>57343)&&(wt=kt));break;case 4:bt=pt[ft+1],Pt=pt[ft+2],Ct=pt[ft+3],(bt&192)===128&&(Pt&192)===128&&(Ct&192)===128&&(kt=(gt&15)<<18|(bt&63)<<12|(Pt&63)<<6|Ct&63,kt>65535&&kt<1114112&&(wt=kt))}}wt===null?(wt=65533,ut=1):wt>65535&&(wt-=65536,st.push(wt>>>10&1023|55296),wt=56320|wt&1023),st.push(wt),ft+=ut}return Dt(st)}const Jt=4096;function Dt(pt){const g=pt.length;if(g<=Jt)return String.fromCharCode.apply(String,pt);let et="",st=0;for(;st<g;)et+=String.fromCharCode.apply(String,pt.slice(st,st+=Jt));return et}function gr(pt,g,et){let st="";et=Math.min(pt.length,et);for(let ft=g;ft<et;++ft)st+=String.fromCharCode(pt[ft]&127);return st}function Lt(pt,g,et){let st="";et=Math.min(pt.length,et);for(let ft=g;ft<et;++ft)st+=String.fromCharCode(pt[ft]);return st}function Vt(pt,g,et){const st=pt.length;(!g||g<0)&&(g=0),(!et||et<0||et>st)&&(et=st);let ft="";for(let gt=g;gt<et;++gt)ft+=zr[pt[gt]];return ft}function nr(pt,g,et){const st=pt.slice(g,et);let ft="";for(let gt=0;gt<st.length-1;gt+=2)ft+=String.fromCharCode(st[gt]+st[gt+1]*256);return ft}b.prototype.slice=function(g,et){const st=this.length;g=~~g,et=et===void 0?st:~~et,g<0?(g+=st,g<0&&(g=0)):g>st&&(g=st),et<0?(et+=st,et<0&&(et=0)):et>st&&(et=st),et<g&&(et=g);const ft=this.subarray(g,et);return Object.setPrototypeOf(ft,b.prototype),ft};function Zt(pt,g,et){if(pt%1!==0||pt<0)throw new RangeError("offset is not uint");if(pt+g>et)throw new RangeError("Trying to access beyond buffer length")}b.prototype.readUintLE=b.prototype.readUIntLE=function(g,et,st){g=g>>>0,et=et>>>0,st||Zt(g,et,this.length);let ft=this[g],gt=1,wt=0;for(;++wt<et&&(gt*=256);)ft+=this[g+wt]*gt;return ft},b.prototype.readUintBE=b.prototype.readUIntBE=function(g,et,st){g=g>>>0,et=et>>>0,st||Zt(g,et,this.length);let ft=this[g+--et],gt=1;for(;et>0&&(gt*=256);)ft+=this[g+--et]*gt;return ft},b.prototype.readUint8=b.prototype.readUInt8=function(g,et){return g=g>>>0,et||Zt(g,1,this.length),this[g]},b.prototype.readUint16LE=b.prototype.readUInt16LE=function(g,et){return g=g>>>0,et||Zt(g,2,this.length),this[g]|this[g+1]<<8},b.prototype.readUint16BE=b.prototype.readUInt16BE=function(g,et){return g=g>>>0,et||Zt(g,2,this.length),this[g]<<8|this[g+1]},b.prototype.readUint32LE=b.prototype.readUInt32LE=function(g,et){return g=g>>>0,et||Zt(g,4,this.length),(this[g]|this[g+1]<<8|this[g+2]<<16)+this[g+3]*16777216},b.prototype.readUint32BE=b.prototype.readUInt32BE=function(g,et){return g=g>>>0,et||Zt(g,4,this.length),this[g]*16777216+(this[g+1]<<16|this[g+2]<<8|this[g+3])},b.prototype.readBigUInt64LE=Dr(function(g){g=g>>>0,Nr(g,"offset");const et=this[g],st=this[g+7];(et===void 0||st===void 0)&&Tr(g,this.length-8);const ft=et+this[++g]*2**8+this[++g]*2**16+this[++g]*2**24,gt=this[++g]+this[++g]*2**8+this[++g]*2**16+st*2**24;return BigInt(ft)+(BigInt(gt)<<BigInt(32))}),b.prototype.readBigUInt64BE=Dr(function(g){g=g>>>0,Nr(g,"offset");const et=this[g],st=this[g+7];(et===void 0||st===void 0)&&Tr(g,this.length-8);const ft=et*2**24+this[++g]*2**16+this[++g]*2**8+this[++g],gt=this[++g]*2**24+this[++g]*2**16+this[++g]*2**8+st;return(BigInt(ft)<<BigInt(32))+BigInt(gt)}),b.prototype.readIntLE=function(g,et,st){g=g>>>0,et=et>>>0,st||Zt(g,et,this.length);let ft=this[g],gt=1,wt=0;for(;++wt<et&&(gt*=256);)ft+=this[g+wt]*gt;return gt*=128,ft>=gt&&(ft-=Math.pow(2,8*et)),ft},b.prototype.readIntBE=function(g,et,st){g=g>>>0,et=et>>>0,st||Zt(g,et,this.length);let ft=et,gt=1,wt=this[g+--ft];for(;ft>0&&(gt*=256);)wt+=this[g+--ft]*gt;return gt*=128,wt>=gt&&(wt-=Math.pow(2,8*et)),wt},b.prototype.readInt8=function(g,et){return g=g>>>0,et||Zt(g,1,this.length),this[g]&128?(255-this[g]+1)*-1:this[g]},b.prototype.readInt16LE=function(g,et){g=g>>>0,et||Zt(g,2,this.length);const st=this[g]|this[g+1]<<8;return st&32768?st|4294901760:st},b.prototype.readInt16BE=function(g,et){g=g>>>0,et||Zt(g,2,this.length);const st=this[g+1]|this[g]<<8;return st&32768?st|4294901760:st},b.prototype.readInt32LE=function(g,et){return g=g>>>0,et||Zt(g,4,this.length),this[g]|this[g+1]<<8|this[g+2]<<16|this[g+3]<<24},b.prototype.readInt32BE=function(g,et){return g=g>>>0,et||Zt(g,4,this.length),this[g]<<24|this[g+1]<<16|this[g+2]<<8|this[g+3]},b.prototype.readBigInt64LE=Dr(function(g){g=g>>>0,Nr(g,"offset");const et=this[g],st=this[g+7];(et===void 0||st===void 0)&&Tr(g,this.length-8);const ft=this[g+4]+this[g+5]*2**8+this[g+6]*2**16+(st<<24);return(BigInt(ft)<<BigInt(32))+BigInt(et+this[++g]*2**8+this[++g]*2**16+this[++g]*2**24)}),b.prototype.readBigInt64BE=Dr(function(g){g=g>>>0,Nr(g,"offset");const et=this[g],st=this[g+7];(et===void 0||st===void 0)&&Tr(g,this.length-8);const ft=(et<<24)+this[++g]*2**16+this[++g]*2**8+this[++g];return(BigInt(ft)<<BigInt(32))+BigInt(this[++g]*2**24+this[++g]*2**16+this[++g]*2**8+st)}),b.prototype.readFloatLE=function(g,et){return g=g>>>0,et||Zt(g,4,this.length),s.read(this,g,!0,23,4)},b.prototype.readFloatBE=function(g,et){return g=g>>>0,et||Zt(g,4,this.length),s.read(this,g,!1,23,4)},b.prototype.readDoubleLE=function(g,et){return g=g>>>0,et||Zt(g,8,this.length),s.read(this,g,!0,52,8)},b.prototype.readDoubleBE=function(g,et){return g=g>>>0,et||Zt(g,8,this.length),s.read(this,g,!1,52,8)};function sr(pt,g,et,st,ft,gt){if(!b.isBuffer(pt))throw new TypeError('"buffer" argument must be a Buffer instance');if(g>ft||g<gt)throw new RangeError('"value" argument is out of bounds');if(et+st>pt.length)throw new RangeError("Index out of range")}b.prototype.writeUintLE=b.prototype.writeUIntLE=function(g,et,st,ft){if(g=+g,et=et>>>0,st=st>>>0,!ft){const ut=Math.pow(2,8*st)-1;sr(this,g,et,st,ut,0)}let gt=1,wt=0;for(this[et]=g&255;++wt<st&&(gt*=256);)this[et+wt]=g/gt&255;return et+st},b.prototype.writeUintBE=b.prototype.writeUIntBE=function(g,et,st,ft){if(g=+g,et=et>>>0,st=st>>>0,!ft){const ut=Math.pow(2,8*st)-1;sr(this,g,et,st,ut,0)}let gt=st-1,wt=1;for(this[et+gt]=g&255;--gt>=0&&(wt*=256);)this[et+gt]=g/wt&255;return et+st},b.prototype.writeUint8=b.prototype.writeUInt8=function(g,et,st){return g=+g,et=et>>>0,st||sr(this,g,et,1,255,0),this[et]=g&255,et+1},b.prototype.writeUint16LE=b.prototype.writeUInt16LE=function(g,et,st){return g=+g,et=et>>>0,st||sr(this,g,et,2,65535,0),this[et]=g&255,this[et+1]=g>>>8,et+2},b.prototype.writeUint16BE=b.prototype.writeUInt16BE=function(g,et,st){return g=+g,et=et>>>0,st||sr(this,g,et,2,65535,0),this[et]=g>>>8,this[et+1]=g&255,et+2},b.prototype.writeUint32LE=b.prototype.writeUInt32LE=function(g,et,st){return g=+g,et=et>>>0,st||sr(this,g,et,4,4294967295,0),this[et+3]=g>>>24,this[et+2]=g>>>16,this[et+1]=g>>>8,this[et]=g&255,et+4},b.prototype.writeUint32BE=b.prototype.writeUInt32BE=function(g,et,st){return g=+g,et=et>>>0,st||sr(this,g,et,4,4294967295,0),this[et]=g>>>24,this[et+1]=g>>>16,this[et+2]=g>>>8,this[et+3]=g&255,et+4};function Mr(pt,g,et,st,ft){Sr(g,st,ft,pt,et,7);let gt=Number(g&BigInt(4294967295));pt[et++]=gt,gt=gt>>8,pt[et++]=gt,gt=gt>>8,pt[et++]=gt,gt=gt>>8,pt[et++]=gt;let wt=Number(g>>BigInt(32)&BigInt(4294967295));return pt[et++]=wt,wt=wt>>8,pt[et++]=wt,wt=wt>>8,pt[et++]=wt,wt=wt>>8,pt[et++]=wt,et}function ir(pt,g,et,st,ft){Sr(g,st,ft,pt,et,7);let gt=Number(g&BigInt(4294967295));pt[et+7]=gt,gt=gt>>8,pt[et+6]=gt,gt=gt>>8,pt[et+5]=gt,gt=gt>>8,pt[et+4]=gt;let wt=Number(g>>BigInt(32)&BigInt(4294967295));return pt[et+3]=wt,wt=wt>>8,pt[et+2]=wt,wt=wt>>8,pt[et+1]=wt,wt=wt>>8,pt[et]=wt,et+8}b.prototype.writeBigUInt64LE=Dr(function(g,et=0){return Mr(this,g,et,BigInt(0),BigInt("0xffffffffffffffff"))}),b.prototype.writeBigUInt64BE=Dr(function(g,et=0){return ir(this,g,et,BigInt(0),BigInt("0xffffffffffffffff"))}),b.prototype.writeIntLE=function(g,et,st,ft){if(g=+g,et=et>>>0,!ft){const bt=Math.pow(2,8*st-1);sr(this,g,et,st,bt-1,-bt)}let gt=0,wt=1,ut=0;for(this[et]=g&255;++gt<st&&(wt*=256);)g<0&&ut===0&&this[et+gt-1]!==0&&(ut=1),this[et+gt]=(g/wt>>0)-ut&255;return et+st},b.prototype.writeIntBE=function(g,et,st,ft){if(g=+g,et=et>>>0,!ft){const bt=Math.pow(2,8*st-1);sr(this,g,et,st,bt-1,-bt)}let gt=st-1,wt=1,ut=0;for(this[et+gt]=g&255;--gt>=0&&(wt*=256);)g<0&&ut===0&&this[et+gt+1]!==0&&(ut=1),this[et+gt]=(g/wt>>0)-ut&255;return et+st},b.prototype.writeInt8=function(g,et,st){return g=+g,et=et>>>0,st||sr(this,g,et,1,127,-128),g<0&&(g=255+g+1),this[et]=g&255,et+1},b.prototype.writeInt16LE=function(g,et,st){return g=+g,et=et>>>0,st||sr(this,g,et,2,32767,-32768),this[et]=g&255,this[et+1]=g>>>8,et+2},b.prototype.writeInt16BE=function(g,et,st){return g=+g,et=et>>>0,st||sr(this,g,et,2,32767,-32768),this[et]=g>>>8,this[et+1]=g&255,et+2},b.prototype.writeInt32LE=function(g,et,st){return g=+g,et=et>>>0,st||sr(this,g,et,4,2147483647,-2147483648),this[et]=g&255,this[et+1]=g>>>8,this[et+2]=g>>>16,this[et+3]=g>>>24,et+4},b.prototype.writeInt32BE=function(g,et,st){return g=+g,et=et>>>0,st||sr(this,g,et,4,2147483647,-2147483648),g<0&&(g=4294967295+g+1),this[et]=g>>>24,this[et+1]=g>>>16,this[et+2]=g>>>8,this[et+3]=g&255,et+4},b.prototype.writeBigInt64LE=Dr(function(g,et=0){return Mr(this,g,et,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),b.prototype.writeBigInt64BE=Dr(function(g,et=0){return ir(this,g,et,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Cr(pt,g,et,st,ft,gt){if(et+st>pt.length)throw new RangeError("Index out of range");if(et<0)throw new RangeError("Index out of range")}function It(pt,g,et,st,ft){return g=+g,et=et>>>0,ft||Cr(pt,g,et,4),s.write(pt,g,et,st,23,4),et+4}b.prototype.writeFloatLE=function(g,et,st){return It(this,g,et,!0,st)},b.prototype.writeFloatBE=function(g,et,st){return It(this,g,et,!1,st)};function tr(pt,g,et,st,ft){return g=+g,et=et>>>0,ft||Cr(pt,g,et,8),s.write(pt,g,et,st,52,8),et+8}b.prototype.writeDoubleLE=function(g,et,st){return tr(this,g,et,!0,st)},b.prototype.writeDoubleBE=function(g,et,st){return tr(this,g,et,!1,st)},b.prototype.copy=function(g,et,st,ft){if(!b.isBuffer(g))throw new TypeError("argument should be a Buffer");if(st||(st=0),!ft&&ft!==0&&(ft=this.length),et>=g.length&&(et=g.length),et||(et=0),ft>0&&ft<st&&(ft=st),ft===st||g.length===0||this.length===0)return 0;if(et<0)throw new RangeError("targetStart out of bounds");if(st<0||st>=this.length)throw new RangeError("Index out of range");if(ft<0)throw new RangeError("sourceEnd out of bounds");ft>this.length&&(ft=this.length),g.length-et<ft-st&&(ft=g.length-et+st);const gt=ft-st;return this===g&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(et,st,ft):Uint8Array.prototype.set.call(g,this.subarray(st,ft),et),gt},b.prototype.fill=function(g,et,st,ft){if(typeof g=="string"){if(typeof et=="string"?(ft=et,et=0,st=this.length):typeof st=="string"&&(ft=st,st=this.length),ft!==void 0&&typeof ft!="string")throw new TypeError("encoding must be a string");if(typeof ft=="string"&&!b.isEncoding(ft))throw new TypeError("Unknown encoding: "+ft);if(g.length===1){const wt=g.charCodeAt(0);(ft==="utf8"&&wt<128||ft==="latin1")&&(g=wt)}}else typeof g=="number"?g=g&255:typeof g=="boolean"&&(g=Number(g));if(et<0||this.length<et||this.length<st)throw new RangeError("Out of range index");if(st<=et)return this;et=et>>>0,st=st===void 0?this.length:st>>>0,g||(g=0);let gt;if(typeof g=="number")for(gt=et;gt<st;++gt)this[gt]=g;else{const wt=b.isBuffer(g)?g:b.from(g,ft),ut=wt.length;if(ut===0)throw new TypeError('The value "'+g+'" is invalid for argument "value"');for(gt=0;gt<st-et;++gt)this[gt+et]=wt[gt%ut]}return this};const fr={};function Ft(pt,g,et){fr[pt]=class extends et{constructor(){super(),Object.defineProperty(this,"message",{value:g.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${pt}]`,this.stack,delete this.name}get code(){return pt}set code(ft){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:ft,writable:!0})}toString(){return`${this.name} [${pt}]: ${this.message}`}}}Ft("ERR_BUFFER_OUT_OF_BOUNDS",function(pt){return pt?`${pt} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Ft("ERR_INVALID_ARG_TYPE",function(pt,g){return`The "${pt}" argument must be of type number. Received type ${typeof g}`},TypeError),Ft("ERR_OUT_OF_RANGE",function(pt,g,et){let st=`The value of "${pt}" is out of range.`,ft=et;return Number.isInteger(et)&&Math.abs(et)>2**32?ft=lr(String(et)):typeof et=="bigint"&&(ft=String(et),(et>BigInt(2)**BigInt(32)||et<-(BigInt(2)**BigInt(32)))&&(ft=lr(ft)),ft+="n"),st+=` It must be ${g}. Received ${ft}`,st},RangeError);function lr(pt){let g="",et=pt.length;const st=pt[0]==="-"?1:0;for(;et>=st+4;et-=3)g=`_${pt.slice(et-3,et)}${g}`;return`${pt.slice(0,et)}${g}`}function Or(pt,g,et){Nr(g,"offset"),(pt[g]===void 0||pt[g+et]===void 0)&&Tr(g,pt.length-(et+1))}function Sr(pt,g,et,st,ft,gt){if(pt>et||pt<g){const wt=typeof g=="bigint"?"n":"";let ut;throw g===0||g===BigInt(0)?ut=`>= 0${wt} and < 2${wt} ** ${(gt+1)*8}${wt}`:ut=`>= -(2${wt} ** ${(gt+1)*8-1}${wt}) and < 2 ** ${(gt+1)*8-1}${wt}`,new fr.ERR_OUT_OF_RANGE("value",ut,pt)}Or(st,ft,gt)}function Nr(pt,g){if(typeof pt!="number")throw new fr.ERR_INVALID_ARG_TYPE(g,"number",pt)}function Tr(pt,g,et){throw Math.floor(pt)!==pt?(Nr(pt,et),new fr.ERR_OUT_OF_RANGE("offset","an integer",pt)):g<0?new fr.ERR_BUFFER_OUT_OF_BOUNDS:new fr.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${g}`,pt)}const Kr=/[^+/0-9A-Za-z-_]/g;function qt(pt){if(pt=pt.split("=")[0],pt=pt.trim().replace(Kr,""),pt.length<2)return"";for(;pt.length%4!==0;)pt=pt+"=";return pt}function ar(pt,g){g=g||1/0;let et;const st=pt.length;let ft=null;const gt=[];for(let wt=0;wt<st;++wt){if(et=pt.charCodeAt(wt),et>55295&&et<57344){if(!ft){if(et>56319){(g-=3)>-1&>.push(239,191,189);continue}else if(wt+1===st){(g-=3)>-1&>.push(239,191,189);continue}ft=et;continue}if(et<56320){(g-=3)>-1&>.push(239,191,189),ft=et;continue}et=(ft-55296<<10|et-56320)+65536}else ft&&(g-=3)>-1&>.push(239,191,189);if(ft=null,et<128){if((g-=1)<0)break;gt.push(et)}else if(et<2048){if((g-=2)<0)break;gt.push(et>>6|192,et&63|128)}else if(et<65536){if((g-=3)<0)break;gt.push(et>>12|224,et>>6&63|128,et&63|128)}else if(et<1114112){if((g-=4)<0)break;gt.push(et>>18|240,et>>12&63|128,et>>6&63|128,et&63|128)}else throw new Error("Invalid code point")}return gt}function yr(pt){const g=[];for(let et=0;et<pt.length;++et)g.push(pt.charCodeAt(et)&255);return g}function xr(pt,g){let et,st,ft;const gt=[];for(let wt=0;wt<pt.length&&!((g-=2)<0);++wt)et=pt.charCodeAt(wt),st=et>>8,ft=et%256,gt.push(ft),gt.push(st);return gt}function Rr(pt){return e.toByteArray(qt(pt))}function Er(pt,g,et,st){let ft;for(ft=0;ft<st&&!(ft+et>=g.length||ft>=pt.length);++ft)g[ft+et]=pt[ft];return ft}function wr(pt,g){return pt instanceof g||pt!=null&&pt.constructor!=null&&pt.constructor.name!=null&&pt.constructor.name===g.name}function vr(pt){return pt!==pt}const zr=function(){const pt="0123456789abcdef",g=new Array(256);for(let et=0;et<16;++et){const st=et*16;for(let ft=0;ft<16;++ft)g[st+ft]=pt[et]+pt[ft]}return g}();function Dr(pt){return typeof BigInt>"u"?Fr:pt}function Fr(){throw new Error("BigInt not supported")}})(buffer);var BitwiseEnumHelper$1={};Object.defineProperty(BitwiseEnumHelper$1,"__esModule",{value:!0});BitwiseEnumHelper$1.BitwiseEnumHelper=void 0;class BitwiseEnumHelper{static combine(...e){let s=null;for(let a of e)s=s|a;return s}static has(e,s){return(e&s)===s}static doesNotHave(e,s){return(e&s)!==s}static getValues(e,s){const a=[];for(let c of Object.keys(e))e[c]&s&&a.push(e[c]);return a.length>0?a:null}static getValueNames(e,s){const a=[];for(let c of Object.keys(e))e[c]&s&&a.push(c);return a.length>0?a:null}}BitwiseEnumHelper$1.BitwiseEnumHelper=BitwiseEnumHelper;var ObjectId$1={};Object.defineProperty(ObjectId$1,"__esModule",{value:!0});ObjectId$1.ObjectId=void 0;class ObjectId{static new(e=new Date().getTime(),s=!0){var a=(e/1e3|0).toString(16);return a+"xxxxxxxxxxxxxxxx".replace(/[x]/g,()=>s?(Math.random()*16|0).toString(16):"0").toLowerCase()}static toDate(e){return new Date(parseInt(e.substring(0,8),16)*1e3)}}ObjectId$1.ObjectId=ObjectId;var Time$1={},Exceptions={};Object.defineProperty(Exceptions,"__esModule",{value:!0});Exceptions.NotImplemented=Exceptions.HttpErrorDuplicate=Exceptions.HttpErrorNotFound=Exceptions.HttpErrorBadRequest=Exceptions.HttpError=Exceptions.ErrorDuplicate=Exceptions.ErrorNotFound=Exceptions.Exception=void 0;class Exception extends Error{constructor(e,s,a){let c="";try{c=JSON.stringify(s)}catch{}let d=e;c!=""&&(d+=`
Metadata: `+c),super(d),this.name="Exception",this.message=e,this.metadataObj=s,this.metadata=c,this.stack=a}metadataPretty(){return JSON.stringify(this.metadataObj,null,2)}static fromError(e){return new Exception(e.message,e,e.stack)}static assert(e,s,a,c=Exception){let d=e;Array.isArray(e)||(d=[e]);for(let h of d)if(h===null||typeof h=="boolean"&&h!==!0)throw new c(s,a)}toString(){return this.message+=`
Metadata: `+this.metadata}}Exceptions.Exception=Exception;class ErrorNotFound extends Exception{constructor(e,s,a){super("Requested item not found",s,a)}}Exceptions.ErrorNotFound=ErrorNotFound;class ErrorDuplicate extends Exception{constructor(e,s,a){super(e||"Requested item conflicts with exists",{metadata:s},a)}}Exceptions.ErrorDuplicate=ErrorDuplicate;class HttpError extends Exception{constructor(e,s,a,c){super(s,a,c),this.statusCode=e}static tryGetErrorCode(e,s){return e==null?s:e instanceof HttpError?e.statusCode:e instanceof ErrorNotFound?new HttpErrorNotFound(e.message,e.metadata,e.stack).statusCode:e instanceof ErrorDuplicate?new HttpErrorDuplicate(e.message,e.metadata,e.stack).statusCode:s}}Exceptions.HttpError=HttpError;class HttpErrorBadRequest extends HttpError{constructor(e,s,a){super(400,e,s,a)}}Exceptions.HttpErrorBadRequest=HttpErrorBadRequest;class HttpErrorNotFound extends HttpError{constructor(e,s,a){super(404,e,s,a)}}Exceptions.HttpErrorNotFound=HttpErrorNotFound;class HttpErrorDuplicate extends HttpError{constructor(e,s,a){super(409,e,s,a)}}Exceptions.HttpErrorDuplicate=HttpErrorDuplicate;class NotImplemented extends Exception{constructor(){super("Not Implemented!")}}Exceptions.NotImplemented=NotImplemented;Exceptions.default=Exception;var __importDefault$2=commonjsGlobal&&commonjsGlobal.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(Time$1,"__esModule",{value:!0});Time$1.Time=void 0;const StringExtensions_1$1=requireStringExtensions(),helpers_1$5=helpers,Exceptions_1$2=__importDefault$2(Exceptions);class Time{constructor(e,s,a){this.timezone=s,this.baseTimestamp=a,this.offsetHours=0,this.totalSeconds=0,this.isUTC=()=>this.offsetHours==0;const c=e==null;a=a!=null?new Date(a.getTime()):new Date,c&&(e=`${a.getUTCHours()}:${a.getUTCMinutes()}:${a.getUTCSeconds()}`);const d=Time.parse(e);s!=null&&!c&&(this.offsetHours=Time.getTimezoneOffset(s,a),d.hours=d.hours-Math.floor(this.offsetHours),d.minutes=Math.abs(d.minutes-this.offsetHours%1*60)),a.setUTCHours(d.hours,d.minutes,d.seconds),this.totalSeconds=(d.seconds||0)+d.minutes*60+d.hours*60*60}get hour(){return Time.totalSecondsToHoursMinutesSeconds(this.totalSeconds).hours}set hour(e){this.totalSeconds=this.totalSeconds-Math.floor(this.totalSeconds/60/60)*60*60+e*60*60}get min(){return Time.totalSecondsToHoursMinutesSeconds(this.totalSeconds).minutes}set min(e){this.totalSeconds=this.totalSeconds-Math.floor(this.totalSeconds%3600/60)*60+e*60}get sec(){return Time.totalSecondsToHoursMinutesSeconds(this.totalSeconds).seconds}set sec(e){this.totalSeconds=this.totalSeconds-Math.floor(this.totalSeconds%60)+e}add(e,s=0,a=0){this.totalSeconds+=e*60*60+s*60+a}subtract(e,s=0,a=0){this.totalSeconds-=e*60*60+s*60+a}static parse(e){var s,a,c,d;const h=helpers_1$5.helpers.getMatches(e,/(?<hour>\d+)\:(?<min>\d+)(\:(?<sec>\d+))?\s?(?<timezone>.*)?/,!0);if(h==null||h.length==0)throw new Exceptions_1$2.default("Time: Unable to parse time input",{input:e});return{hours:parseInt((s=h[0])===null||s===void 0?void 0:s.hour)||0,minutes:parseInt((a=h[0])===null||a===void 0?void 0:a.min)||0,seconds:parseInt((c=h[0])===null||c===void 0?void 0:c.sec)||0,timezone:(d=h[0])===null||d===void 0?void 0:d.timezone}}static formDate(e){const s=e.getUTCHours(),a=e.getUTCMinutes(),c=e.getUTCSeconds();return new Time(`${s}:${a}:${c}`,null,e)}toDate(e){const s=e!=null?new Date(e||this.baseTimestamp):new Date;return s.setUTCHours(this.hour,this.min,this.sec,0),s}compare(e){const s=this.totalSeconds,a=e.totalSeconds;return s==a?0:s>a?1:s<a?-1:null}toString(e,s,a=!1,c=!1){let d=this.offsetHours;const h=e||this.timezone;let b="";h!=null&&(d=Time.getTimezoneOffset(h,this.toDate(s||this.baseTimestamp)),b=` ${Time.getTimeZoneName(h,s||this.baseTimestamp,!0)}`);let j=this.totalSeconds<0;const $=Time.totalSecondsToHoursMinutesSeconds(this.totalSeconds+d*60*60);let _e=j?"-":"",it=StringExtensions_1$1.StringExtensions.padNumber.call(Math.abs(c?$.hours:$.hours%24),2),at=StringExtensions_1$1.StringExtensions.padNumber.call(Math.abs($.minutes),2),lt=a==!0&&this.sec!=null?`:${StringExtensions_1$1.StringExtensions.padNumber.call(Math.abs($.seconds),2)}`:"";return`${_e}${it}:${at}${lt}${b}`}static getTimezoneOffset(e,s=new Date){s=new Date(s),s.setMilliseconds(0);const a=s.getTimezoneOffset()/60*-1,c=s.toLocaleString("en-US",{timeZone:e}),d=new Date(c),h=(d.getTime()-s.getTime())/1e3/60/60;return a+h}static getLocalTimezone(){return Intl.DateTimeFormat().resolvedOptions().timeZone}static getTimeZoneName(e,s=new Date,a=!0){const c=Intl.DateTimeFormat("en",{timeZoneName:"long",timeZone:e});let d=c.formatToParts(s||new Date).find(h=>h.type==="timeZoneName").value;return d.startsWith("GMT")&&(d=c.formatToParts(null).find(h=>h.type==="timeZoneName").value),a&&!d.startsWith("GMT")&&(d=StringExtensions_1$1.StringExtensions.getAbbreviation.call(d)),d}static totalSecondsToHoursMinutesSeconds(e){return{hours:Math.floor(e/3600),minutes:Math.floor(e%3600/60),seconds:Math.floor(e%60)}}}Time$1.Time=Time;Time.TimeZones=["Europe/Andorra","Asia/Dubai","Asia/Kabul","Europe/Tirane","Asia/Yerevan","Antarctica/Casey","Antarctica/Davis","Antarctica/DumontDUrville","Antarctica/Mawson","Antarctica/Palmer","Antarctica/Rothera","Antarctica/Syowa","Antarctica/Troll","Antarctica/Vostok","America/Argentina/Buenos_Aires","America/Argentina/Cordoba","America/Argentina/Salta","America/Argentina/Jujuy","America/Argentina/Tucuman","America/Argentina/Catamarca","America/Argentina/La_Rioja","America/Argentina/San_Juan","America/Argentina/Mendoza","America/Argentina/San_Luis","America/Argentina/Rio_Gallegos","America/Argentina/Ushuaia","Pacific/Pago_Pago","Europe/Vienna","Australia/Lord_Howe","Antarctica/Macquarie","Australia/Hobart","Australia/Currie","Australia/Melbourne","Australia/Sydney","Australia/Broken_Hill","Australia/Brisbane","Australia/Lindeman","Australia/Adelaide","Australia/Darwin","Australia/Perth","Australia/Eucla","Asia/Baku","America/Barbados","Asia/Dhaka","Europe/Brussels","Europe/Sofia","Atlantic/Bermuda","Asia/Brunei","America/La_Paz","America/Noronha","America/Belem","America/Fortaleza","America/Recife","America/Araguaina","America/Maceio","America/Bahia","America/Sao_Paulo","America/Campo_Grande","America/Cuiaba","America/Santarem","America/Porto_Velho","America/Boa_Vista","America/Manaus","America/Eirunepe","America/Rio_Branco","America/Nassau","Asia/Thimphu","Europe/Minsk","America/Belize","America/St_Johns","America/Halifax","America/Glace_Bay","America/Moncton","America/Goose_Bay","America/Blanc-Sablon","America/Toronto","America/Nipigon","America/Thunder_Bay","America/Iqaluit","America/Pangnirtung","America/Atikokan","America/Winnipeg","America/Rainy_River","America/Resolute","America/Rankin_Inlet","America/Regina","America/Swift_Current","America/Edmonton","America/Cambridge_Bay","America/Yellowknife","America/Inuvik","America/Creston","America/Dawson_Creek","America/Fort_Nelson","America/Vancouver","America/Whitehorse","America/Dawson","Indian/Cocos","Europe/Zurich","Africa/Abidjan","Pacific/Rarotonga","America/Santiago","America/Punta_Arenas","Pacific/Easter","Asia/Shanghai","Asia/Urumqi","America/Bogota","America/Costa_Rica","America/Havana","Atlantic/Cape_Verde","America/Curacao","Indian/Christmas","Asia/Nicosia","Asia/Famagusta","Europe/Prague","Europe/Berlin","Europe/Copenhagen","America/Santo_Domingo","Africa/Algiers","America/Guayaquil","Pacific/Galapagos","Europe/Tallinn","Africa/Cairo","Africa/El_Aaiun","Europe/Madrid","Africa/Ceuta","Atlantic/Canary","Europe/Helsinki","Pacific/Fiji","Atlantic/Stanley","Pacific/Chuuk","Pacific/Pohnpei","Pacific/Kosrae","Atlantic/Faroe","Europe/Paris","Europe/London","Asia/Tbilisi","America/Cayenne","Africa/Accra","Europe/Gibraltar","America/Godthab","America/Danmarkshavn","America/Scoresbysund","America/Thule","Europe/Athens","Atlantic/South_Georgia","America/Guatemala","Pacific/Guam","Africa/Bissau","America/Guyana","Asia/Hong_Kong","America/Tegucigalpa","America/Port-au-Prince","Europe/Budapest","Asia/Jakarta","Asia/Pontianak","Asia/Makassar","Asia/Jayapura","Europe/Dublin","Asia/Jerusalem","Asia/Kolkata","Indian/Chagos","Asia/Baghdad","Asia/Tehran","Atlantic/Reykjavik","Europe/Rome","America/Jamaica","Asia/Amman","Asia/Tokyo","Africa/Nairobi","Asia/Bishkek","Pacific/Tarawa","Pacific/Enderbury","Pacific/Kiritimati","Asia/Pyongyang","Asia/Seoul","Asia/Almaty","Asia/Qyzylorda","Asia/Qostanay","Asia/Aqtobe","Asia/Aqtau","Asia/Atyrau","Asia/Oral","Asia/Beirut","Asia/Colombo","Africa/Monrovia","Europe/Vilnius","Europe/Luxembourg","Europe/Riga","Africa/Tripoli","Africa/Casablanca","Europe/Monaco","Europe/Chisinau","Pacific/Majuro","Pacific/Kwajalein","Asia/Yangon","Asia/Ulaanbaatar","Asia/Hovd","Asia/Choibalsan","Asia/Macau","America/Martinique","Europe/Malta","Indian/Mauritius","Indian/Maldives","America/Mexico_City","America/Cancun","America/Merida","America/Monterrey","America/Matamoros","America/Mazatlan","America/Chihuahua","America/Ojinaga","America/Hermosillo","America/Tijuana","America/Bahia_Banderas","Asia/Kuala_Lumpur","Asia/Kuching","Africa/Maputo","Africa/Windhoek","Pacific/Noumea","Pacific/Norfolk","Africa/Lagos","America/Managua","Europe/Amsterdam","Europe/Oslo","Asia/Kathmandu","Pacific/Nauru","Pacific/Niue","Pacific/Auckland","Pacific/Chatham","America/Panama","America/Lima","Pacific/Tahiti","Pacific/Marquesas","Pacific/Gambier","Pacific/Port_Moresby","Pacific/Bougainville","Asia/Manila","Asia/Karachi","Europe/Warsaw","America/Miquelon","Pacific/Pitcairn","America/Puerto_Rico","Asia/Gaza","Asia/Hebron","Europe/Lisbon","Atlantic/Madeira","Atlantic/Azores","Pacific/Palau","America/Asuncion","Asia/Qatar","Indian/Reunion","Europe/Bucharest","Europe/Belgrade","Europe/Kaliningrad","Europe/Moscow","Europe/Simferopol","Europe/Kirov","Europe/Astrakhan","Europe/Volgograd","Europe/Saratov","Europe/Ulyanovsk","Europe/Samara","Asia/Yekaterinburg","Asia/Omsk","Asia/Novosibirsk","Asia/Barnaul","Asia/Tomsk","Asia/Novokuznetsk","Asia/Krasnoyarsk","Asia/Irkutsk","Asia/Chita","Asia/Yakutsk","Asia/Khandyga","Asia/Vladivostok","Asia/Ust-Nera","Asia/Magadan","Asia/Sakhalin","Asia/Srednekolymsk","Asia/Kamchatka","Asia/Anadyr","Asia/Riyadh","Pacific/Guadalcanal","Indian/Mahe","Africa/Khartoum","Europe/Stockholm","Asia/Singapore","America/Paramaribo","Africa/Juba","Africa/Sao_Tome","America/El_Salvador","Asia/Damascus","America/Grand_Turk","Africa/Ndjamena","Indian/Kerguelen","Asia/Bangkok","Asia/Dushanbe","Pacific/Fakaofo","Asia/Dili","Asia/Ashgabat","Africa/Tunis","Pacific/Tongatapu","Europe/Istanbul","America/Port_of_Spain","Pacific/Funafuti","Asia/Taipei","Europe/Kiev","Europe/Uzhgorod","Europe/Zaporozhye","Pacific/Wake","America/New_York","America/Detroit","America/Kentucky/Louisville","America/Kentucky/Monticello","America/Indiana/Indianapolis","America/Indiana/Vincennes","America/Indiana/Winamac","America/Indiana/Marengo","America/Indiana/Petersburg","America/Indiana/Vevay","America/Chicago","America/Indiana/Tell_City","America/Indiana/Knox","America/Menominee","America/North_Dakota/Center","America/North_Dakota/New_Salem","America/North_Dakota/Beulah","America/Denver","America/Boise","America/Phoenix","America/Los_Angeles","America/Anchorage","America/Juneau","America/Sitka","America/Metlakatla","America/Yakutat","America/Nome","America/Adak","Pacific/Honolulu","America/Montevideo","Asia/Samarkand","Asia/Tashkent","America/Caracas","Asia/Ho_Chi_Minh","Pacific/Efate","Pacific/Wallis","Pacific/Apia","Africa/Johannesburg"];Object.defineProperty(essentials,"__esModule",{value:!0});essentials.libx=void 0;const helpers_1$4=helpers,Callbacks_1$1=Callbacks$1,log_1$4=log$5,buffer_1=buffer,extensions_1=extensions,dependencyInjector_1=dependencyInjector,ObjectHelpers_1$4=requireObjectHelpers(),ObjectExtensions_1=ObjectExtensions,BitwiseEnumHelper_1=BitwiseEnumHelper$1,ObjectId_1=ObjectId$1,Time_1=Time$1;try{typeof commonjsGlobal<"u"&&!commonjsGlobal._libx_avoidExtensions&&extensions_1.extensions.applyAllExtensions()}catch(o){console.warn("libx: failed to apply extensions",o)}const libxBase={$:{},Callbacks:Callbacks_1$1.Callbacks,Buffer:buffer_1.Buffer,extensions:extensions_1.extensions,log:log_1$4.log,di:dependencyInjector_1.di,enum:BitwiseEnumHelper_1.BitwiseEnumHelper,objectId:ObjectId_1.ObjectId,Time:Time_1.Time},exLibx=ObjectExtensions_1.objectExtensions.extend(libxBase,ObjectHelpers_1$4.objectHelpers),exLibx2=ObjectExtensions_1.objectExtensions.extend(exLibx,helpers_1$4.helpers);essentials.libx=exLibx2;var browser$2={},browserHelpers={},Network={};const __viteBrowserExternal={},__viteBrowserExternal$1=Object.freeze(Object.defineProperty({__proto__:null,default:__viteBrowserExternal},Symbol.toStringTag,{value:"Module"})),require$$2=getAugmentedNamespace(__viteBrowserExternal$1);var axios$2={exports:{}},bind$2=function(e,s){return function(){return e.apply(s,arguments)}},bind$1=bind$2,toString$1=Object.prototype.toString,kindOf=function(o){return function(e){var s=toString$1.call(e);return o[s]||(o[s]=s.slice(8,-1).toLowerCase())}}(Object.create(null));function kindOfTest(o){return o=o.toLowerCase(),function(s){return kindOf(s)===o}}function isArray(o){return Array.isArray(o)}function isUndefined(o){return typeof o>"u"}function isBuffer(o){return o!==null&&!isUndefined(o)&&o.constructor!==null&&!isUndefined(o.constructor)&&typeof o.constructor.isBuffer=="function"&&o.constructor.isBuffer(o)}var isArrayBuffer=kindOfTest("ArrayBuffer");function isArrayBufferView(o){var e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(o):e=o&&o.buffer&&isArrayBuffer(o.buffer),e}function isString(o){return typeof o=="string"}function isNumber(o){return typeof o=="number"}function isObject(o){return o!==null&&typeof o=="object"}function isPlainObject(o){if(kindOf(o)!=="object")return!1;var e=Object.getPrototypeOf(o);return e===null||e===Object.prototype}function isEmptyObject(o){return o&&Object.keys(o).length===0&&Object.getPrototypeOf(o)===Object.prototype}var isDate=kindOfTest("Date"),isFile=kindOfTest("File"),isBlob=kindOfTest("Blob"),isFileList=kindOfTest("FileList");function isFunction(o){return toString$1.call(o)==="[object Function]"}function isStream(o){return isObject(o)&&isFunction(o.pipe)}function isFormData(o){var e="[object FormData]";return o&&(typeof FormData=="function"&&o instanceof FormData||toString$1.call(o)===e||isFunction(o.toString)&&o.toString()===e)}var isURLSearchParams=kindOfTest("URLSearchParams");function trim(o){return o.trim?o.trim():o.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}function isStandardBrowserEnv(){var o;return typeof navigator<"u"&&((o=navigator.product)==="ReactNative"||o==="NativeScript"||o==="NS")?!1:typeof window<"u"&&typeof document<"u"}function forEach(o,e){if(!(o===null||typeof o>"u"))if(typeof o!="object"&&(o=[o]),isArray(o))for(var s=0,a=o.length;s<a;s++)e.call(null,o[s],s,o);else for(var c in o)Object.prototype.hasOwnProperty.call(o,c)&&e.call(null,o[c],c,o)}function merge(){var o={};function e(c,d){isPlainObject(o[d])&&isPlainObject(c)?o[d]=merge(o[d],c):isPlainObject(c)?o[d]=merge({},c):isArray(c)?o[d]=c.slice():o[d]=c}for(var s=0,a=arguments.length;s<a;s++)forEach(arguments[s],e);return o}function extend(o,e,s){return forEach(e,function(c,d){s&&typeof c=="function"?o[d]=bind$1(c,s):o[d]=c}),o}function stripBOM(o){return o.charCodeAt(0)===65279&&(o=o.slice(1)),o}function inherits(o,e,s,a){o.prototype=Object.create(e.prototype,a),o.prototype.constructor=o,s&&Object.assign(o.prototype,s)}function toFlatObject(o,e,s,a){var c,d,h,b={};if(e=e||{},o==null)return e;do{for(c=Object.getOwnPropertyNames(o),d=c.length;d-- >0;)h=c[d],(!a||a(h,o,e))&&!b[h]&&(e[h]=o[h],b[h]=!0);o=s!==!1&&Object.getPrototypeOf(o)}while(o&&(!s||s(o,e))&&o!==Object.prototype);return e}function endsWith(o,e,s){o=String(o),(s===void 0||s>o.length)&&(s=o.length),s-=e.length;var a=o.indexOf(e,s);return a!==-1&&a===s}function toArray(o){if(!o)return null;if(isArray(o))return o;var e=o.length;if(!isNumber(e))return null;for(var s=new Array(e);e-- >0;)s[e]=o[e];return s}var isTypedArray=function(o){return function(e){return o&&e instanceof o}}(typeof Uint8Array<"u"&&Object.getPrototypeOf(Uint8Array));function forEachEntry(o,e){for(var s=o&&o[Symbol.iterator],a=s.call(o),c;(c=a.next())&&!c.done;){var d=c.value;e.call(o,d[0],d[1])}}function matchAll(o,e){for(var s,a=[];(s=o.exec(e))!==null;)a.push(s);return a}var isHTMLForm=kindOfTest("HTMLFormElement"),hasOwnProperty=function(e){return function(s,a){return e.call(s,a)}}(Object.prototype.hasOwnProperty),utils$d={isArray,isArrayBuffer,isBuffer,isFormData,isArrayBufferView,isString,isNumber,isObject,isPlainObject,isEmptyObject,isUndefined,isDate,isFile,isBlob,isFunction,isStream,isURLSearchParams,isStandardBrowserEnv,forEach,merge,extend,trim,stripBOM,inherits,toFlatObject,kindOf,kindOfTest,endsWith,toArray,isTypedArray,isFileList,forEachEntry,matchAll,isHTMLForm,hasOwnProperty},utils$c=utils$d;function AxiosError$3(o,e,s,a,c){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=o,this.name="AxiosError",e&&(this.code=e),s&&(this.config=s),a&&(this.request=a),c&&(this.response=c)}utils$c.inherits(AxiosError$3,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var prototype$1=AxiosError$3.prototype,descriptors={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(function(o){descriptors[o]={value:o}});Object.defineProperties(AxiosError$3,descriptors);Object.defineProperty(prototype$1,"isAxiosError",{value:!0});AxiosError$3.from=function(o,e,s,a,c,d){var h=Object.create(prototype$1);return utils$c.toFlatObject(o,h,function(j){return j!==Error.prototype}),AxiosError$3.call(h,o.message,e,s,a,c),h.cause=o,h.name=o.name,d&&Object.assign(h,d),h};var AxiosError_1=AxiosError$3,browser$1=typeof self=="object"?self.FormData:window.FormData,FormData$1=browser$1,utils$b=utils$d,AxiosError$2=AxiosError_1,envFormData=FormData$1;function isVisitable(o){return utils$b.isPlainObject(o)||utils$b.isArray(o)}function removeBrackets(o){return utils$b.endsWith(o,"[]")?o.slice(0,-2):o}function renderKey(o,e,s){return o?o.concat(e).map(function(c,d){return c=removeBrackets(c),!s&&d?"["+c+"]":c}).join(s?".":""):e}function isFlatArray(o){return utils$b.isArray(o)&&!o.some(isVisitable)}var predicates=utils$b.toFlatObject(utils$b,{},null,function(e){return/^is[A-Z]/.test(e)});function isSpecCompliant(o){return o&&utils$b.isFunction(o.append)&&o[Symbol.toStringTag]==="FormData"&&o[Symbol.iterator]}function toFormData$3(o,e,s){if(!utils$b.isObject(o))throw new TypeError("target must be an object");e=e||new(envFormData||FormData),s=utils$b.toFlatObject(s,{metaTokens:!0,dots:!1,indexes:!1},!1,function(mt,vt){return!utils$b.isUndefined(vt[mt])});var a=s.metaTokens,c=s.visitor||_e,d=s.dots,h=s.indexes,b=s.Blob||typeof Blob<"u"&&Blob,j=b&&isSpecCompliant(e);if(!utils$b.isFunction(c))throw new TypeError("visitor must be a function");function $(dt){if(dt===null)return"";if(utils$b.isDate(dt))return dt.toISOString();if(!j&&utils$b.isBlob(dt))throw new AxiosError$2("Blob is not supported. Use a Buffer instead.");return utils$b.isArrayBuffer(dt)||utils$b.isTypedArray(dt)?j&&typeof Blob=="function"?new Blob([dt]):Buffer.from(dt):dt}function _e(dt,mt,vt){var tt=dt;if(dt&&!vt&&typeof dt=="object"){if(utils$b.endsWith(mt,"{}"))mt=a?mt:mt.slice(0,-2),dt=JSON.stringify(dt);else if(utils$b.isArray(dt)&&isFlatArray(dt)||utils$b.isFileList(dt)||utils$b.endsWith(mt,"[]")&&(tt=utils$b.toArray(dt)))return mt=removeBrackets(mt),tt.forEach(function(ot,ht){!(utils$b.isUndefined(ot)||ot===null)&&e.append(h===!0?renderKey([mt],ht,d):h===null?mt:mt+"[]",$(ot))}),!1}return isVisitable(dt)?!0:(e.append(renderKey(vt,mt,d),$(dt)),!1)}var it=[],at=Object.assign(predicates,{defaultVisitor:_e,convertValue:$,isVisitable});function lt(dt,mt){if(!utils$b.isUndefined(dt)){if(it.indexOf(dt)!==-1)throw Error("Circular reference detected in "+mt.join("."));it.push(dt),utils$b.forEach(dt,function(tt,nt){var ot=!(utils$b.isUndefined(tt)||tt===null)&&c.call(e,tt,utils$b.isString(nt)?nt.trim():nt,mt,at);ot===!0&<(tt,mt?mt.concat(nt):[nt])}),it.pop()}}if(!utils$b.isObject(o))throw new TypeError("data must be an object");return lt(o),e}var toFormData_1=toFormData$3,toFormData$2=toFormData_1;function encode$1(o){var e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(o).replace(/[!'\(\)~]|%20|%00/g,function(a){return e[a]})}function AxiosURLSearchParams$2(o,e){this._pairs=[],o&&toFormData$2(o,this,e)}var prototype=AxiosURLSearchParams$2.prototype;prototype.append=function(e,s){this._pairs.push([e,s])};prototype.toString=function(e){var s=e?function(a){return e.call(this,a,encode$1)}:encode$1;return this._pairs.map(function(c){return s(c[0])+"="+s(c[1])},"").join("&")};var AxiosURLSearchParams_1=AxiosURLSearchParams$2,utils$a=utils$d,AxiosURLSearchParams$1=AxiosURLSearchParams_1;function encode(o){return encodeURIComponent(o).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var buildURL$1=function(e,s,a){if(!s)return e;var c=e.indexOf("#");c!==-1&&(e=e.slice(0,c));var d=a&&a.encode||encode,h=a&&a.serialize,b;return h?b=h(s,a):b=utils$a.isURLSearchParams(s)?s.toString():new AxiosURLSearchParams$1(s,a).toString(d),b&&(e+=(e.indexOf("?")===-1?"?":"&")+b),e},utils$9=utils$d;function InterceptorManager$1(){this.handlers=[]}InterceptorManager$1.prototype.use=function(e,s,a){return this.handlers.push({fulfilled:e,rejected:s,synchronous:a?a.synchronous:!1,runWhen:a?a.runWhen:null}),this.handlers.length-1};InterceptorManager$1.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)};InterceptorManager$1.prototype.clear=function(){this.handlers&&(this.handlers=[])};InterceptorManager$1.prototype.forEach=function(e){utils$9.forEach(this.handlers,function(a){a!==null&&e(a)})};var InterceptorManager_1=InterceptorManager$1,utils$8=utils$d,normalizeHeaderName$2=function(e,s){utils$8.forEach(e,function(c,d){d!==s&&d.toUpperCase()===s.toUpperCase()&&(e[s]=c,delete e[d])})},transitional={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},AxiosURLSearchParams=AxiosURLSearchParams_1,URLSearchParams_1=typeof URLSearchParams<"u"?URLSearchParams:AxiosURLSearchParams,FormData_1=FormData,browser={classes:{URLSearchParams:URLSearchParams_1,FormData:FormData_1,Blob},protocols:["http","https","file","blob","url","data"]},platform$2=browser,utils$7=utils$d,toFormData$1=toFormData_1,platform$1=platform$2,toURLEncodedForm$1=function(e,s){return toFormData$1(e,new platform$1.classes.URLSearchParams,Object.assign({visitor:function(a,c,d,h){return platform$1.isNode&&utils$7.isBuffer(a)?(this.append(c,a.toString("base64")),!1):h.defaultVisitor.apply(this,arguments)}},s))},utils$6=utils$d;function parsePropPath(o){return utils$6.matchAll(/\w+|\[(\w*)]/g,o).map(function(e){return e[0]==="[]"?"":e[1]||e[0]})}function arrayToObject(o){var e={},s=Object.keys(o),a,c=s.length,d;for(a=0;a<c;a++)d=s[a],e[d]=o[d];return e}function formDataToJSON$2(o){function e(a,c,d,h){var b=a[h++];if(b==="__proto__")return!0;var j=Number.isFinite(+b),$=h>=a.length;if(b=!b&&utils$6.isArray(d)?d.length:b,$)return utils$6.hasOwnProperty(d,b)?d[b]=[d[b],c]:d[b]=c,!j;(!d[b]||!utils$6.isObject(d[b]))&&(d[b]=[]);var _e=e(a,c,d[b],h);return _e&&utils$6.isArray(d[b])&&(d[b]=arrayToObject(d[b])),!j}if(utils$6.isFormData(o)&&utils$6.isFunction(o.entries)){var s={};return utils$6.forEachEntry(o,function(a,c){e(parsePropPath(a),c,s,0)}),s}return null}var formDataToJSON_1=formDataToJSON$2,settle,hasRequiredSettle;function requireSettle(){if(hasRequiredSettle)return settle;hasRequiredSettle=1;var o=AxiosError_1;return settle=function(s,a,c){var d=c.config.validateStatus;!c.status||!d||d(c.status)?s(c):a(new o("Request failed with status code "+c.status,[o.ERR_BAD_REQUEST,o.ERR_BAD_RESPONSE][Math.floor(c.status/100)-4],c.config,c.request,c))},settle}var cookies,hasRequiredCookies;function requireCookies(){if(hasRequiredCookies)return cookies;hasRequiredCookies=1;var o=utils$d;return cookies=o.isStandardBrowserEnv()?function(){return{write:function(a,c,d,h,b,j){var $=[];$.push(a+"="+encodeURIComponent(c)),o.isNumber(d)&&$.push("expires="+new Date(d).toGMTString()),o.isString(h)&&$.push("path="+h),o.isString(b)&&$.push("domain="+b),j===!0&&$.push("secure"),document.cookie=$.join("; ")},read:function(a){var c=document.cookie.match(new RegExp("(^|;\\s*)("+a+")=([^;]*)"));return c?decodeURIComponent(c[3]):null},remove:function(a){this.write(a,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}(),cookies}var isAbsoluteURL$1=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)},combineURLs$1=function(e,s){return s?e.replace(/\/?\/$/,"")+"/"+s.replace(/^\/+/,""):e},isAbsoluteURL=isAbsoluteURL$1,combineURLs=combineURLs$1,buildFullPath$1=function(e,s){return e&&!isAbsoluteURL(s)?combineURLs(e,s):s},parseHeaders,hasRequiredParseHeaders;function requireParseHeaders(){if(hasRequiredParseHeaders)return parseHeaders;hasRequiredParseHeaders=1;var o=utils$d,e=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];return parseHeaders=function(a){var c={},d,h,b;return a&&o.forEach(a.split(`
`),function($){if(b=$.indexOf(":"),d=o.trim($.slice(0,b)).toLowerCase(),h=o.trim($.slice(b+1)),d){if(c[d]&&e.indexOf(d)>=0)return;d==="set-cookie"?c[d]=(c[d]?c[d]:[]).concat([h]):c[d]=c[d]?c[d]+", "+h:h}}),c},parseHeaders}var isURLSameOrigin,hasRequiredIsURLSameOrigin;function requireIsURLSameOrigin(){if(hasRequiredIsURLSameOrigin)return isURLSameOrigin;hasRequiredIsURLSameOrigin=1;var o=utils$d;return isURLSameOrigin=o.isStandardBrowserEnv()?function(){var s=/(msie|trident)/i.test(navigator.userAgent),a=document.createElement("a"),c;function d(h){var b=h;return s&&(a.setAttribute("href",b),b=a.href),a.setAttribute("href",b),{href:a.href,protocol:a.protocol?a.protocol.replace(/:$/,""):"",host:a.host,search:a.search?a.search.replace(/^\?/,""):"",hash:a.hash?a.hash.replace(/^#/,""):"",hostname:a.hostname,port:a.port,pathname:a.pathname.charAt(0)==="/"?a.pathname:"/"+a.pathname}}return c=d(window.location.href),function(b){var j=o.isString(b)?d(b):b;return j.protocol===c.protocol&&j.host===c.host}}():function(){return function(){return!0}}(),isURLSameOrigin}var CanceledError_1,hasRequiredCanceledError;function requireCanceledError(){if(hasRequiredCanceledError)return CanceledError_1;hasRequiredCanceledError=1;var o=AxiosError_1,e=utils$d;function s(a,c,d){o.call(this,a??"canceled",o.ERR_CANCELED,c,d),this.name="CanceledError"}return e.inherits(s,o,{__CANCEL__:!0}),CanceledError_1=s,CanceledError_1}var parseProtocol,hasRequiredParseProtocol;function requireParseProtocol(){return hasRequiredParseProtocol||(hasRequiredParseProtocol=1,parseProtocol=function(e){var s=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return s&&s[1]||""}),parseProtocol}var xhr,hasRequiredXhr;function requireXhr(){if(hasRequiredXhr)return xhr;hasRequiredXhr=1;var o=utils$d,e=requireSettle(),s=requireCookies(),a=buildURL$1,c=buildFullPath$1,d=requireParseHeaders(),h=requireIsURLSameOrigin(),b=transitional,j=AxiosError_1,$=requireCanceledError(),_e=requireParseProtocol(),it=platform$2;return xhr=function(lt){return new Promise(function(mt,vt){var tt=lt.data,nt=lt.headers,ot=lt.responseType,ht=lt.withXSRFToken,xt;function Et(){lt.cancelToken&<.cancelToken.unsubscribe(xt),lt.signal&<.signal.removeEventListener("abort",xt)}o.isFormData(tt)&&o.isStandardBrowserEnv()&&delete nt["Content-Type"];var _t=new XMLHttpRequest;if(lt.auth){var Rt=lt.auth.username||"",Bt=lt.auth.password?unescape(encodeURIComponent(lt.auth.password)):"";nt.Authorization="Basic "+btoa(Rt+":"+Bt)}var Mt=c(lt.baseURL,lt.url);_t.open(lt.method.toUpperCase(),a(Mt,lt.params,lt.paramsSerializer),!0),_t.timeout=lt.timeout;function Ht(){if(_t){var rr="getAllResponseHeaders"in _t?d(_t.getAllResponseHeaders()):null,Jt=!ot||ot==="text"||ot==="json"?_t.responseText:_t.response,Dt={data:Jt,status:_t.status,statusText:_t.statusText,headers:rr,config:lt,request:_t};e(function(Lt){mt(Lt),Et()},function(Lt){vt(Lt),Et()},Dt),_t=null}}if("onloadend"in _t?_t.onloadend=Ht:_t.onreadystatechange=function(){!_t||_t.readyState!==4||_t.status===0&&!(_t.responseURL&&_t.responseURL.indexOf("file:")===0)||setTimeout(Ht)},_t.onabort=function(){_t&&(vt(new j("Request aborted",j.ECONNABORTED,lt,_t)),_t=null)},_t.onerror=function(){vt(new j("Network Error",j.ERR_NETWORK,lt,_t)),_t=null},_t.ontimeout=function(){var Jt=lt.timeout?"timeout of "+lt.timeout+"ms exceeded":"timeout exceeded",Dt=lt.transitional||b;lt.timeoutErrorMessage&&(Jt=lt.timeoutErrorMessage),vt(new j(Jt,Dt.clarifyTimeoutError?j.ETIMEDOUT:j.ECONNABORTED,lt,_t)),_t=null},o.isStandardBrowserEnv()&&(ht&&o.isFunction(ht)&&(ht=ht(lt)),ht||ht!==!1&&h(Mt))){var er=lt.xsrfHeaderName&<.xsrfCookieName&&s.read(lt.xsrfCookieName);er&&(nt[lt.xsrfHeaderName]=er)}"setRequestHeader"in _t&&o.forEach(nt,function(Jt,Dt){typeof tt>"u"&&Dt.toLowerCase()==="content-type"?delete nt[Dt]:_t.setRequestHeader(Dt,Jt)}),o.isUndefined(lt.withCredentials)||(_t.withCredentials=!!lt.withCredentials),ot&&ot!=="json"&&(_t.responseType=lt.responseType),typeof lt.onDownloadProgress=="function"&&_t.addEventListener("progress",lt.onDownloadProgress),typeof lt.onUploadProgress=="function"&&_t.upload&&_t.upload.addEventListener("progress",lt.onUploadProgress),(lt.cancelToken||lt.signal)&&(xt=function(rr){_t&&(vt(!rr||rr.type?new $(null,lt,_t):rr),_t.abort(),_t=null)},lt.cancelToken&<.cancelToken.subscribe(xt),lt.signal&&(lt.signal.aborted?xt():lt.signal.addEventListener("abort",xt))),!tt&&tt!==!1&&tt!==0&&tt!==""&&(tt=null);var Yt=_e(Mt);if(Yt&&it.protocols.indexOf(Yt)===-1){vt(new j("Unsupported protocol "+Yt+":",j.ERR_BAD_REQUEST,lt));return}_t.send(tt)})},xhr}var utils$5=utils$d,normalizeHeaderName$1=normalizeHeaderName$2,AxiosError$1=AxiosError_1,transitionalDefaults=transitional,toFormData=toFormData_1,toURLEncodedForm=toURLEncodedForm$1,platform=platform$2,formDataToJSON$1=formDataToJSON_1,DEFAULT_CONTENT_TYPE={"Content-Type":"application/x-www-form-urlencoded"};function setContentTypeIfUnset(o,e){!utils$5.isUndefined(o)&&utils$5.isUndefined(o["Content-Type"])&&(o["Content-Type"]=e)}function getDefaultAdapter(){var o;return(typeof XMLHttpRequest<"u"||typeof process<"u"&&Object.prototype.toString.call(process)==="[object process]")&&(o=requireXhr()),o}function stringifySafely(o,e,s){if(utils$5.isString(o))try{return(e||JSON.parse)(o),utils$5.trim(o)}catch(a){if(a.name!=="SyntaxError")throw a}return(s||JSON.stringify)(o)}var defaults$3={transitional:transitionalDefaults,adapter:getDefaultAdapter(),transformRequest:[function(e,s){normalizeHeaderName$1(s,"Accept"),normalizeHeaderName$1(s,"Content-Type");var a=s&&s["Content-Type"]||"",c=a.indexOf("application/json")>-1,d=utils$5.isObject(e);d&&utils$5.isHTMLForm(e)&&(e=new FormData(e));var h=utils$5.isFormData(e);if(h)return c?JSON.stringify(formDataToJSON$1(e)):e;if(utils$5.isArrayBuffer(e)||utils$5.isBuffer(e)||utils$5.isStream(e)||utils$5.isFile(e)||utils$5.isBlob(e))return e;if(utils$5.isArrayBufferView(e))return e.buffer;if(utils$5.isURLSearchParams(e))return setContentTypeIfUnset(s,"application/x-www-form-urlencoded;charset=utf-8"),e.toString();var b;if(d){if(a.indexOf("application/x-www-form-urlencoded")!==-1)return toURLEncodedForm(e,this.formSerializer).toString();if((b=utils$5.isFileList(e))||a.indexOf("multipart/form-data")>-1){var j=this.env&&this.env.FormData;return toFormData(b?{"files[]":e}:e,j&&new j,this.formSerializer)}}return d||c?(setContentTypeIfUnset(s,"application/json"),stringifySafely(e)):e}],transformResponse:[function(e){var s=this.transitional||defaults$3.transitional,a=s&&s.forcedJSONParsing,c=this.responseType==="json";if(e&&utils$5.isString(e)&&(a&&!this.responseType||c)){var d=s&&s.silentJSONParsing,h=!d&&c;try{return JSON.parse(e)}catch(b){if(h)throw b.name==="SyntaxError"?AxiosError$1.from(b,AxiosError$1.ERR_BAD_RESPONSE,this,null,this.response):b}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:platform.classes.FormData,Blob:platform.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};utils$5.forEach(["delete","get","head"],function(e){defaults$3.headers[e]={}});utils$5.forEach(["post","put","patch"],function(e){defaults$3.headers[e]=utils$5.merge(DEFAULT_CONTENT_TYPE)});var defaults_1=defaults$3,utils$4=utils$d,defaults$2=defaults_1,transformData$1=function(e,s,a,c){var d=this||defaults$2;return utils$4.forEach(c,function(b){e=b.call(d,e,s,a)}),e},isCancel$1,hasRequiredIsCancel;function requireIsCancel(){return hasRequiredIsCancel||(hasRequiredIsCancel=1,isCancel$1=function(e){return!!(e&&e.__CANCEL__)}),isCancel$1}var utils$3=utils$d,transformData=transformData$1,isCancel=requireIsCancel(),defaults$1=defaults_1,CanceledError=requireCanceledError(),normalizeHeaderName=normalizeHeaderName$2;function throwIfCancellationRequested(o){if(o.cancelToken&&o.cancelToken.throwIfRequested(),o.signal&&o.signal.aborted)throw new CanceledError}var dispatchRequest$1=function(e){throwIfCancellationRequested(e),e.headers=e.headers||{},e.data=transformData.call(e,e.data,e.headers,null,e.transformRequest),normalizeHeaderName(e.headers,"Accept"),normalizeHeaderName(e.headers,"Content-Type"),e.headers=utils$3.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),utils$3.forEach(["delete","get","head","post","put","patch","common"],function(c){delete e.headers[c]});var s=e.adapter||defaults$1.adapter;return s(e).then(function(c){return throwIfCancellationRequested(e),c.data=transformData.call(e,c.data,c.headers,c.status,e.transformResponse),c},function(c){return isCancel(c)||(throwIfCancellationRequested(e),c&&c.response&&(c.response.data=transformData.call(e,c.response.data,c.response.headers,c.response.status,e.transformResponse))),Promise.reject(c)})},utils$2=utils$d,mergeConfig$2=function(e,s){s=s||{};var a={};function c(_e,it){return utils$2.isPlainObject(_e)&&utils$2.isPlainObject(it)?utils$2.merge(_e,it):utils$2.isEmptyObject(it)?utils$2.merge({},_e):utils$2.isPlainObject(it)?utils$2.merge({},it):utils$2.isArray(it)?it.slice():it}function d(_e){if(utils$2.isUndefined(s[_e])){if(!utils$2.isUndefined(e[_e]))return c(void 0,e[_e])}else return c(e[_e],s[_e])}function h(_e){if(!utils$2.isUndefined(s[_e]))return c(void 0,s[_e])}function b(_e){if(utils$2.isUndefined(s[_e])){if(!utils$2.isUndefined(e[_e]))return c(void 0,e[_e])}else return c(void 0,s[_e])}function j(_e){if(_e in s)return c(e[_e],s[_e]);if(_e in e)return c(void 0,e[_e])}var $={url:h,method:h,data:h,baseURL:b,transformRequest:b,transformResponse:b,paramsSerializer:b,timeout:b,timeoutMessage:b,withCredentials:b,withXSRFToken:b,adapter:b,responseType:b,xsrfCookieName:b,xsrfHeaderName:b,onUploadProgress:b,onDownloadProgress:b,decompress:b,maxContentLength:b,maxBodyLength:b,beforeRedirect:b,transport:b,httpAgent:b,httpsAgent:b,cancelToken:b,socketPath:b,responseEncoding:b,validateStatus:j};return utils$2.forEach(Object.keys(e).concat(Object.keys(s)),function(it){var at=$[it]||d,lt=at(it);utils$2.isUndefined(lt)&&at!==j||(a[it]=lt)}),a},data,hasRequiredData;function requireData(){return hasRequiredData||(hasRequiredData=1,data={version:"0.29.0"}),data}var VERSION=requireData().version,AxiosError=AxiosError_1,validators$1={};["object","boolean","number","function","string","symbol"].forEach(function(o,e){validators$1[o]=function(a){return typeof a===o||"a"+(e<1?"n ":" ")+o}});var deprecatedWarnings={};validators$1.transitional=function(e,s,a){function c(d,h){return"[Axios v"+VERSION+"] Transitional option '"+d+"'"+h+(a?". "+a:"")}return function(d,h,b){if(e===!1)throw new AxiosError(c(h," has been removed"+(s?" in "+s:"")),AxiosError.ERR_DEPRECATED);return s&&!deprecatedWarnings[h]&&(deprecatedWarnings[h]=!0,console.warn(c(h," has been deprecated since v"+s+" and will be removed in the near future"))),e?e(d,h,b):!0}};function assertOptions(o,e,s){if(typeof o!="object")throw new AxiosError("options must be an object",AxiosError.ERR_BAD_OPTION_VALUE);for(var a=Object.keys(o),c=a.length;c-- >0;){var d=a[c],h=e[d];if(h){var b=o[d],j=b===void 0||h(b,d,o);if(j!==!0)throw new AxiosError("option "+d+" must be "+j,AxiosError.ERR_BAD_OPTION_VALUE);continue}if(s!==!0)throw new AxiosError("Unknown option "+d,AxiosError.ERR_BAD_OPTION)}}var validator$1={assertOptions,validators:validators$1},utils$1=utils$d,buildURL=buildURL$1,InterceptorManager=InterceptorManager_1,dispatchRequest=dispatchRequest$1,mergeConfig$1=mergeConfig$2,buildFullPath=buildFullPath$1,validator=validator$1,validators=validator.validators;function Axios$1(o){this.defaults=o,this.interceptors={request:new InterceptorManager,response:new InterceptorManager}}Axios$1.prototype.request=function(e,s){typeof e=="string"?(s=s||{},s.url=e):s=e||{},s=mergeConfig$1(this.defaults,s),s.method?s.method=s.method.toLowerCase():this.defaults.method?s.method=this.defaults.method.toLowerCase():s.method="get";var a=s.transitional;a!==void 0&&validator.assertOptions(a,{silentJSONParsing:validators.transitional(validators.boolean),forcedJSONParsing:validators.transitional(validators.boolean),clarifyTimeoutError:validators.transitional(validators.boolean)},!1);var c=s.paramsSerializer;c!=null&&(utils$1.isFunction(c)?s.paramsSerializer={serialize:c}:validator.assertOptions(c,{encode:validators.function,serialize:validators.function},!0));var d=[],h=!0;this.interceptors.request.forEach(function(dt){typeof dt.runWhen=="function"&&dt.runWhen(s)===!1||(h=h&&dt.synchronous,d.unshift(dt.fulfilled,dt.rejected))});var b=[];this.interceptors.response.forEach(function(dt){b.push(dt.fulfilled,dt.rejected)});var j;if(!h){var $=[dispatchRequest,void 0];for(Array.prototype.unshift.apply($,d),$=$.concat(b),j=Promise.resolve(s);$.length;)j=j.then($.shift(),$.shift());return j}for(var _e=s;d.length;){var it=d.shift(),at=d.shift();try{_e=it(_e)}catch(lt){at(lt);break}}try{j=dispatchRequest(_e)}catch(lt){return Promise.reject(lt)}for(;b.length;)j=j.then(b.shift(),b.shift());return j};Axios$1.prototype.getUri=function(e){e=mergeConfig$1(this.defaults,e);var s=buildFullPath(e.baseURL,e.url);return buildURL(s,e.params,e.paramsSerializer)};utils$1.forEach(["delete","get","head","options"],function(e){Axios$1.prototype[e]=function(s,a){return this.request(mergeConfig$1(a||{},{method:e,url:s,data:(a||{}).data}))}});utils$1.forEach(["post","put","patch"],function(e){function s(a){return function(d,h,b){return this.request(mergeConfig$1(b||{},{method:e,headers:a?{"Content-Type":"multipart/form-data"}:{},url:d,data:h}))}}Axios$1.prototype[e]=s(),Axios$1.prototype[e+"Form"]=s(!0)});var Axios_1=Axios$1,CancelToken_1,hasRequiredCancelToken;function requireCancelToken(){if(hasRequiredCancelToken)return CancelToken_1;hasRequiredCancelToken=1;var o=requireCanceledError();function e(s){if(typeof s!="function")throw new TypeError("executor must be a function.");var a;this.promise=new Promise(function(h){a=h});var c=this;this.promise.then(function(d){if(c._listeners){for(var h=c._listeners.length;h-- >0;)c._listeners[h](d);c._listeners=null}}),this.promise.then=function(d){var h,b=new Promise(function(j){c.subscribe(j),h=j}).then(d);return b.cancel=function(){c.unsubscribe(h)},b},s(function(h,b,j){c.reason||(c.reason=new o(h,b,j),a(c.reason))})}return e.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},e.prototype.subscribe=function(a){if(this.reason){a(this.reason);return}this._listeners?this._listeners.push(a):this._listeners=[a]},e.prototype.unsubscribe=function(a){if(this._listeners){var c=this._listeners.indexOf(a);c!==-1&&this._listeners.splice(c,1)}},e.source=function(){var a,c=new e(function(h){a=h});return{token:c,cancel:a}},CancelToken_1=e,CancelToken_1}var spread,hasRequiredSpread;function requireSpread(){return hasRequiredSpread||(hasRequiredSpread=1,spread=function(e){return function(a){return e.apply(null,a)}}),spread}var isAxiosError,hasRequiredIsAxiosError;function requireIsAxiosError(){if(hasRequiredIsAxiosError)return isAxiosError;hasRequiredIsAxiosError=1;var o=utils$d;return isAxiosError=function(s){return o.isObject(s)&&s.isAxiosError===!0},isAxiosError}var utils=utils$d,bind=bind$2,Axios=Axios_1,mergeConfig=mergeConfig$2,defaults=defaults_1,formDataToJSON=formDataToJSON_1;function createInstance(o){var e=new Axios(o),s=bind(Axios.prototype.request,e);return utils.extend(s,Axios.prototype,e),utils.extend(s,e),s.create=function(c){return createInstance(mergeConfig(o,c))},s}var axios$1=createInstance(defaults);axios$1.Axios=Axios;axios$1.CanceledError=requireCanceledError();axios$1.CancelToken=requireCancelToken();axios$1.isCancel=requireIsCancel();axios$1.VERSION=requireData().version;axios$1.toFormData=toFormData_1;axios$1.AxiosError=AxiosError_1;axios$1.Cancel=axios$1.CanceledError;axios$1.all=function(e){return Promise.all(e)};axios$1.spread=requireSpread();axios$1.isAxiosError=requireIsAxiosError();axios$1.formToJSON=function(o){return formDataToJSON(utils.isHTMLForm(o)?new FormData(o):o)};axios$2.exports=axios$1;axios$2.exports.default=axios$1;var axiosExports=axios$2.exports,axios=axiosExports,Streams$1={},polyfill_min={exports:{}};/**
* @license
* web-streams-polyfill v3.3.3
* Copyright 2024 Mattias Buelens, Diwank Singh Tomer and other contributors.
* This code is released under the MIT license.
* SPDX-License-Identifier: MIT
*/var hasRequiredPolyfill_min;function requirePolyfill_min(){return hasRequiredPolyfill_min||(hasRequiredPolyfill_min=1,function(o,e){(function(s,a){a(e)})(commonjsGlobal,function(s){var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol:function(_){return"Symbol(".concat(_,")")};function c(_,rt){var ct,yt,St,Tt,jt={label:0,sent:function(){if(1&St[0])throw St[1];return St[1]},trys:[],ops:[]};return Tt={next:At(0),throw:At(1),return:At(2)},typeof Symbol=="function"&&(Tt[Symbol.iterator]=function(){return this}),Tt;function At(Nt){return function(Qt){return function(Kt){if(ct)throw new TypeError("Generator is already executing.");for(;Tt&&(Tt=0,Kt[0]&&(jt=0)),jt;)try{if(ct=1,yt&&(St=2&Kt[0]?yt.return:Kt[0]?yt.throw||((St=yt.return)&&St.call(yt),0):yt.next)&&!(St=St.call(yt,Kt[1])).done)return St;switch(yt=0,St&&(Kt=[2&Kt[0],St.value]),Kt[0]){case 0:case 1:St=Kt;break;case 4:return jt.label++,{value:Kt[1],done:!1};case 5:jt.label++,yt=Kt[1],Kt=[0];continue;case 7:Kt=jt.ops.pop(),jt.trys.pop();continue;default:if(St=jt.trys,!((St=St.length>0&&St[St.length-1])||Kt[0]!==6&&Kt[0]!==2)){jt=0;continue}if(Kt[0]===3&&(!St||Kt[1]>St[0]&&Kt[1]<St[3])){jt.label=Kt[1];break}if(Kt[0]===6&&jt.label<St[1]){jt.label=St[1],St=Kt;break}if(St&&jt.label<St[2]){jt.label=St[2],jt.ops.push(Kt);break}St[2]&&jt.ops.pop(),jt.trys.pop();continue}Kt=rt.call(_,jt)}catch(dr){Kt=[6,dr],yt=0}finally{ct=St=0}if(5&Kt[0])throw Kt[1];return{value:Kt[0]?Kt[1]:void 0,done:!0}}([Nt,Qt])}}}function d(_){var rt=typeof Symbol=="function"&&Symbol.iterator,ct=rt&&_[rt],yt=0;if(ct)return ct.call(_);if(_&&typeof _.length=="number")return{next:function(){return _&&yt>=_.length&&(_=void 0),{value:_&&_[yt++],done:!_}}};throw new TypeError(rt?"Object is not iterable.":"Symbol.iterator is not defined.")}function h(_){return this instanceof h?(this.v=_,this):new h(_)}function b(_,rt,ct){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var yt,St=ct.apply(_,rt||[]),Tt=[];return yt={},jt("next"),jt("throw"),jt("return"),yt[Symbol.asyncIterator]=function(){return this},yt;function jt(dr){St[dr]&&(yt[dr]=function(Wt){return new Promise(function(pr,Ur){Tt.push([dr,Wt,pr,Ur])>1||At(dr,Wt)})})}function At(dr,Wt){try{(pr=St[dr](Wt)).value instanceof h?Promise.resolve(pr.value.v).then(Nt,Qt):Kt(Tt[0][2],pr)}catch(Ur){Kt(Tt[0][3],Ur)}var pr}function Nt(dr){At("next",dr)}function Qt(dr){At("throw",dr)}function Kt(dr,Wt){dr(Wt),Tt.shift(),Tt.length&&At(Tt[0][0],Tt[0][1])}}function j(_){var rt,ct;return rt={},yt("next"),yt("throw",function(St){throw St}),yt("return"),rt[Symbol.iterator]=function(){return this},rt;function yt(St,Tt){rt[St]=_[St]?function(jt){return(ct=!ct)?{value:h(_[St](jt)),done:!1}:Tt?Tt(jt):jt}:Tt}}function $(_){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var rt,ct=_[Symbol.asyncIterator];return ct?ct.call(_):(_=d(_),rt={},yt("next"),yt("throw"),yt("return"),rt[Symbol.asyncIterator]=function(){return this},rt);function yt(St){rt[St]=_[St]&&function(Tt){return new Promise(function(jt,At){(function(Nt,Qt,Kt,dr){Promise.resolve(dr).then(function(Wt){Nt({value:Wt,done:Kt})},Qt)})(jt,At,(Tt=_[St](Tt)).done,Tt.value)})}}}function _e(){}function it(_){return typeof _=="object"&&_!==null||typeof _=="function"}typeof SuppressedError=="function"&&SuppressedError;var at=_e;function lt(_,rt){try{Object.defineProperty(_,"name",{value:rt,configurable:!0})}catch{}}var dt=Promise,mt=Promise.prototype.then,vt=Promise.reject.bind(dt);function tt(_){return new dt(_)}function nt(_){return tt(function(rt){return rt(_)})}function ot(_){return vt(_)}function ht(_,rt,ct){return mt.call(_,rt,ct)}function xt(_,rt,ct){ht(ht(_,rt,ct),void 0,at)}function Et(_,rt){xt(_,rt)}function _t(_,rt){xt(_,void 0,rt)}function Rt(_,rt,ct){return ht(_,rt,ct)}function Bt(_){ht(_,void 0,at)}var Mt=function(_){if(typeof queueMicrotask=="function")Mt=queueMicrotask;else{var rt=nt(void 0);Mt=function(ct){return ht(rt,ct)}}return Mt(_)};function Ht(_,rt,ct){if(typeof _!="function")throw new TypeError("Argument is not a function");return Function.prototype.apply.call(_,rt,ct)}function er(_,rt,ct){try{return nt(Ht(_,rt,ct))}catch(yt){return ot(yt)}}var Yt=function(){function _(){this._cursor=0,this._size=0,this._front={_elements:[],_next:void 0},this._back=this._front,this._cursor=0,this._size=0}return Object.defineProperty(_.prototype,"length",{get:function(){return this._size},enumerable:!1,configurable:!0}),_.prototype.push=function(rt){var ct=this._back,yt=ct;ct._elements.length===16383&&(yt={_elements:[],_next:void 0}),ct._elements.push(rt),yt!==ct&&(this._back=yt,ct._next=yt),++this._size},_.prototype.shift=function(){var rt=this._front,ct=rt,yt=this._cursor,St=yt+1,Tt=rt._elements,jt=Tt[yt];return St===16384&&(ct=rt._next,St=0),--this._size,this._cursor=St,rt!==ct&&(this._front=ct),Tt[yt]=void 0,jt},_.prototype.forEach=function(rt){for(var ct=this._cursor,yt=this._front,St=yt._elements;!(ct===St.length&&yt._next===void 0||ct===St.length&&(ct=0,(St=(yt=yt._next)._elements).length===0));)rt(St[ct]),++ct},_.prototype.peek=function(){var rt=this._front,ct=this._cursor;return rt._elements[ct]},_}(),rr=a("[[AbortSteps]]"),Jt=a("[[ErrorSteps]]"),Dt=a("[[CancelSteps]]"),gr=a("[[PullSteps]]"),Lt=a("[[ReleaseSteps]]");function Vt(_,rt){_._ownerReadableStream=rt,rt._reader=_,rt._state==="readable"?Mr(_):rt._state==="closed"?function(ct){Mr(ct),It(ct)}(_):ir(_,rt._storedError)}function nr(_,rt){return pn(_._ownerReadableStream,rt)}function Zt(_){var rt=_._ownerReadableStream;rt._state==="readable"?Cr(_,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):function(ct,yt){ir(ct,yt)}(_,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),rt._readableStreamController[Lt](),rt._reader=void 0,_._ownerReadableStream=void 0}function sr(_){return new TypeError("Cannot "+_+" a stream using a released reader")}function Mr(_){_._closedPromise=tt(function(rt,ct){_._closedPromise_resolve=rt,_._closedPromise_reject=ct})}function ir(_,rt){Mr(_),Cr(_,rt)}function Cr(_,rt){_._closedPromise_reject!==void 0&&(Bt(_._closedPromise),_._closedPromise_reject(rt),_._closedPromise_resolve=void 0,_._closedPromise_reject=void 0)}function It(_){_._closedPromise_resolve!==void 0&&(_._closedPromise_resolve(void 0),_._closedPromise_resolve=void 0,_._closedPromise_reject=void 0)}var tr=Number.isFinite||function(_){return typeof _=="number"&&isFinite(_)},fr=Math.trunc||function(_){return _<0?Math.ceil(_):Math.floor(_)};function Ft(_,rt){if(_!==void 0&&typeof(ct=_)!="object"&&typeof ct!="function")throw new TypeError("".concat(rt," is not an object."));var ct}function lr(_,rt){if(typeof _!="function")throw new TypeError("".concat(rt," is not a function."))}function Or(_,rt){if(!function(ct){return typeof ct=="object"&&ct!==null||typeof ct=="function"}(_))throw new TypeError("".concat(rt," is not an object."))}function Sr(_,rt,ct){if(_===void 0)throw new TypeError("Parameter ".concat(rt," is required in '").concat(ct,"'."))}function Nr(_,rt,ct){if(_===void 0)throw new TypeError("".concat(rt," is required in '").concat(ct,"'."))}function Tr(_){return Number(_)}function Kr(_){return _===0?0:_}function qt(_,rt){var ct=Number.MAX_SAFE_INTEGER,yt=Number(_);if(yt=Kr(yt),!tr(yt))throw new TypeError("".concat(rt," is not a finite number"));if((yt=function(St){return Kr(fr(St))}(yt))<0||yt>ct)throw new TypeError("".concat(rt," is outside the accepted range of ").concat(0," to ").concat(ct,", inclusive"));return tr(yt)&&yt!==0?yt:0}function ar(_,rt){if(!_n(_))throw new TypeError("".concat(rt," is not a ReadableStream."))}function yr(_){return new Fr(_)}function xr(_,rt){_._reader._readRequests.push(rt)}function Rr(_,rt,ct){var yt=_._reader._readRequests.shift();ct?yt._closeSteps():yt._chunkSteps(rt)}function Er(_){return _._reader._readRequests.length}function wr(_){var rt=_._reader;return rt!==void 0&&!!pt(rt)}var vr,zr,Dr,Fr=function(){function _(rt){if(Sr(rt,1,"ReadableStreamDefaultReader"),ar(rt,"First parameter"),Sn(rt))throw new TypeError("This stream has already been locked for exclusive reading by another reader");Vt(this,rt),this._readRequests=new Yt}return Object.defineProperty(_.prototype,"closed",{get:function(){return pt(this)?this._closedPromise:ot(st("closed"))},enumerable:!1,configurable:!0}),_.prototype.cancel=function(rt){return rt===void 0&&(rt=void 0),pt(this)?this._ownerReadableStream===void 0?ot(sr("cancel")):nr(this,rt):ot(st("cancel"))},_.prototype.read=function(){if(!pt(this))return ot(st("read"));if(this._ownerReadableStream===void 0)return ot(sr("read from"));var rt,ct,yt=tt(function(St,Tt){rt=St,ct=Tt});return g(this,{_chunkSteps:function(St){return rt({value:St,done:!1})},_closeSteps:function(){return rt({value:void 0,done:!0})},_errorSteps:function(St){return ct(St)}}),yt},_.prototype.releaseLock=function(){if(!pt(this))throw st("releaseLock");this._ownerReadableStream!==void 0&&function(rt){Zt(rt);var ct=new TypeError("Reader was released");et(rt,ct)}(this)},_}();function pt(_){return!!it(_)&&!!Object.prototype.hasOwnProperty.call(_,"_readRequests")&&_ instanceof Fr}function g(_,rt){var ct=_._ownerReadableStream;ct._disturbed=!0,ct._state==="closed"?rt._closeSteps():ct._state==="errored"?rt._errorSteps(ct._storedError):ct._readableStreamController[gr](rt)}function et(_,rt){var ct=_._readRequests;_._readRequests=new Yt,ct.forEach(function(yt){yt._errorSteps(rt)})}function st(_){return new TypeError("ReadableStreamDefaultReader.prototype.".concat(_," can only be used on a ReadableStreamDefaultReader"))}function ft(_){return _.slice()}function gt(_,rt,ct,yt,St){new Uint8Array(_).set(new Uint8Array(ct,yt,St),rt)}Object.defineProperties(Fr.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),lt(Fr.prototype.cancel,"cancel"),lt(Fr.prototype.read,"read"),lt(Fr.prototype.releaseLock,"releaseLock"),typeof a.toStringTag=="symbol"&&Object.defineProperty(Fr.prototype,a.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0});var wt=function(_){return(wt=typeof _.transfer=="function"?function(rt){return rt.transfer()}:typeof structuredClone=="function"?function(rt){return structuredClone(rt,{transfer:[rt]})}:function(rt){return rt})(_)},ut=function(_){return(ut=typeof _.detached=="boolean"?function(rt){return rt.detached}:function(rt){return rt.byteLength===0})(_)};function bt(_,rt,ct){if(_.slice)return _.slice(rt,ct);var yt=ct-rt,St=new ArrayBuffer(yt);return gt(St,0,_,rt,yt),St}function Pt(_,rt){var ct=_[rt];if(ct!=null){if(typeof ct!="function")throw new TypeError("".concat(String(rt)," is not a function"));return ct}}var Ct,kt=(Dr=(vr=a.asyncIterator)!==null&&vr!==void 0?vr:(zr=a.for)===null||zr===void 0?void 0:zr.call(a,"Symbol.asyncIterator"))!==null&&Dr!==void 0?Dr:"@@asyncIterator";function $t(_,rt,ct){if(rt===void 0&&(rt="sync"),ct===void 0)if(rt==="async"){if((ct=Pt(_,kt))===void 0)return function(St){var Tt,jt=((Tt={})[a.iterator]=function(){return St.iterator},Tt),At=function(){return b(this,arguments,function(){return c(this,function(Nt){switch(Nt.label){case 0:return[5,d(j($(jt)))];case 1:case 2:return[4,h.apply(void 0,[Nt.sent()])];case 3:return[2,Nt.sent()]}})})}();return{iterator:At,nextMethod:At.next,done:!1}}($t(_,"sync",Pt(_,a.iterator)))}else ct=Pt(_,a.iterator);if(ct===void 0)throw new TypeError("The object is not iterable");var yt=Ht(ct,_,[]);if(!it(yt))throw new TypeError("The iterator method must return an object");return{iterator:yt,nextMethod:yt.next,done:!1}}var Ot=((Ct={})[kt]=function(){return this},Ct);Object.defineProperty(Ot,kt,{enumerable:!1});var Gt=function(){function _(rt,ct){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=rt,this._preventCancel=ct}return _.prototype.next=function(){var rt=this,ct=function(){return rt._nextSteps()};return this._ongoingPromise=this._ongoingPromise?Rt(this._ongoingPromise,ct,ct):ct(),this._ongoingPromise},_.prototype.return=function(rt){var ct=this,yt=function(){return ct._returnSteps(rt)};return this._ongoingPromise?Rt(this._ongoingPromise,yt,yt):yt()},_.prototype._nextSteps=function(){var rt=this;if(this._isFinished)return Promise.resolve({value:void 0,done:!0});var ct,yt,St=this._reader,Tt=tt(function(jt,At){ct=jt,yt=At});return g(St,{_chunkSteps:function(jt){rt._ongoingPromise=void 0,Mt(function(){return ct({value:jt,done:!1})})},_closeSteps:function(){rt._ongoingPromise=void 0,rt._isFinished=!0,Zt(St),ct({value:void 0,done:!0})},_errorSteps:function(jt){rt._ongoingPromise=void 0,rt._isFinished=!0,Zt(St),yt(jt)}}),Tt},_.prototype._returnSteps=function(rt){if(this._isFinished)return Promise.resolve({value:rt,done:!0});this._isFinished=!0;var ct=this._reader;if(!this._preventCancel){var yt=nr(ct,rt);return Zt(ct),Rt(yt,function(){return{value:rt,done:!0}})}return Zt(ct),nt({value:rt,done:!0})},_}(),zt={next:function(){return Xt(this)?this._asyncIteratorImpl.next():ot(cr("next"))},return:function(_){return Xt(this)?this._asyncIteratorImpl.return(_):ot(cr("return"))}};function Xt(_){if(!it(_)||!Object.prototype.hasOwnProperty.call(_,"_asyncIteratorImpl"))return!1;try{return _._asyncIteratorImpl instanceof Gt}catch{return!1}}function cr(_){return new TypeError("ReadableStreamAsyncIterator.".concat(_," can only be used on a ReadableSteamAsyncIterator"))}Object.setPrototypeOf(zt,Ot);var _r=Number.isNaN||function(_){return _!=_};function $r(_){var rt=bt(_.buffer,_.byteOffset,_.byteOffset+_.byteLength);return new Uint8Array(rt)}function bn(_){var rt=_._queue.shift();return _._queueTotalSize-=rt.size,_._queueTotalSize<0&&(_._queueTotalSize=0),rt.value}function sn(_,rt,ct){if(typeof(yt=ct)!="number"||_r(yt)||yt<0||ct===1/0)throw new RangeError("Size must be a finite, non-NaN, non-negative number.");var yt;_._queue.push({value:rt,size:ct}),_._queueTotalSize+=ct}function en(_){_._queue=new Yt,_._queueTotalSize=0}function Ln(_){return _===DataView}var un=function(){function _(){throw new TypeError("Illegal constructor")}return Object.defineProperty(_.prototype,"view",{get:function(){if(!Ut(this))throw So("view");return this._view},enumerable:!1,configurable:!0}),_.prototype.respond=function(rt){if(!Ut(this))throw So("respond");if(Sr(rt,1,"respond"),rt=qt(rt,"First parameter"),this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");if(ut(this._view.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be used as a response");to(this._associatedReadableByteStreamController,rt)},_.prototype.respondWithNewView=function(rt){if(!Ut(this))throw So("respondWithNewView");if(Sr(rt,1,"respondWithNewView"),!ArrayBuffer.isView(rt))throw new TypeError("You can only respond with array buffer views");if(this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");if(ut(rt.buffer))throw new TypeError("The given view's buffer has been detached and so cannot be used as a response");ro(this._associatedReadableByteStreamController,rt)},_}();Object.defineProperties(un.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),lt(un.prototype.respond,"respond"),lt(un.prototype.respondWithNewView,"respondWithNewView"),typeof a.toStringTag=="symbol"&&Object.defineProperty(un.prototype,a.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});var an=function(){function _(){throw new TypeError("Illegal constructor")}return Object.defineProperty(_.prototype,"byobRequest",{get:function(){if(!hn(this))throw Hn("byobRequest");return _o(this)},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"desiredSize",{get:function(){if(!hn(this))throw Hn("desiredSize");return Wo(this)},enumerable:!1,configurable:!0}),_.prototype.close=function(){if(!hn(this))throw Hn("close");if(this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");var rt=this._controlledReadableByteStream._state;if(rt!=="readable")throw new TypeError("The stream (in ".concat(rt," state) is not in the readable state and cannot be closed"));qn(this)},_.prototype.enqueue=function(rt){if(!hn(this))throw Hn("enqueue");if(Sr(rt,1,"enqueue"),!ArrayBuffer.isView(rt))throw new TypeError("chunk must be an array buffer view");if(rt.byteLength===0)throw new TypeError("chunk must have non-zero byteLength");if(rt.buffer.byteLength===0)throw new TypeError("chunk's buffer must have non-zero byteLength");if(this._closeRequested)throw new TypeError("stream is closed or draining");var ct=this._controlledReadableByteStream._state;if(ct!=="readable")throw new TypeError("The stream (in ".concat(ct," state) is not in the readable state and cannot be enqueued to"));eo(this,rt)},_.prototype.error=function(rt){if(rt===void 0&&(rt=void 0),!hn(this))throw Hn("error");cn(this,rt)},_.prototype[Dt]=function(rt){hr(this),en(this);var ct=this._cancelAlgorithm(rt);return _i(this),ct},_.prototype[gr]=function(rt){var ct=this._controlledReadableByteStream;if(this._queueTotalSize>0)zo(this,rt);else{var yt=this._autoAllocateChunkSize;if(yt!==void 0){var St=void 0;try{St=new ArrayBuffer(yt)}catch(jt){return void rt._errorSteps(jt)}var Tt={buffer:St,bufferByteLength:yt,byteOffset:0,byteLength:yt,bytesFilled:0,minimumFill:1,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(Tt)}xr(ct,rt),ur(this)}},_.prototype[Lt]=function(){if(this._pendingPullIntos.length>0){var rt=this._pendingPullIntos.peek();rt.readerType="none",this._pendingPullIntos=new Yt,this._pendingPullIntos.push(rt)}},_}();function hn(_){return!!it(_)&&!!Object.prototype.hasOwnProperty.call(_,"_controlledReadableByteStream")&&_ instanceof an}function Ut(_){return!!it(_)&&!!Object.prototype.hasOwnProperty.call(_,"_associatedReadableByteStreamController")&&_ instanceof un}function ur(_){var rt=function(ct){var yt=ct._controlledReadableByteStream;if(yt._state!=="readable"||ct._closeRequested||!ct._started)return!1;if(wr(yt)&&Er(yt)>0||Ro(yt)&&Yo(yt)>0)return!0;var St=Wo(ct);return St>0}(_);rt&&(_._pulling?_._pullAgain=!0:(_._pulling=!0,xt(_._pullAlgorithm(),function(){return _._pulling=!1,_._pullAgain&&(_._pullAgain=!1,ur(_)),null},function(ct){return cn(_,ct),null})))}function hr(_){Gr(_),_._pendingPullIntos=new Yt}function mr(_,rt){var ct=!1;_._state==="closed"&&(ct=!0);var yt=Br(rt);rt.readerType==="default"?Rr(_,yt,ct):function(St,Tt,jt){var At=St._reader,Nt=At._readIntoRequests.shift();jt?Nt._closeSteps(Tt):Nt._chunkSteps(Tt)}(_,yt,ct)}function Br(_){var rt=_.bytesFilled,ct=_.elementSize;return new _.viewConstructor(_.buffer,_.byteOffset,rt/ct)}function Wr(_,rt,ct,yt){_._queue.push({buffer:rt,byteOffset:ct,byteLength:yt}),_._queueTotalSize+=yt}function En(_,rt,ct,yt){var St;try{St=bt(rt,ct,ct+yt)}catch(Tt){throw cn(_,Tt),Tt}Wr(_,St,0,yt)}function Fn(_,rt){rt.bytesFilled>0&&En(_,rt.buffer,rt.byteOffset,rt.bytesFilled),Nn(_)}function Bn(_,rt){var ct=Math.min(_._queueTotalSize,rt.byteLength-rt.bytesFilled),yt=rt.bytesFilled+ct,St=ct,Tt=!1,jt=yt-yt%rt.elementSize;jt>=rt.minimumFill&&(St=jt-rt.bytesFilled,Tt=!0);for(var At=_._queue;St>0;){var Nt=At.peek(),Qt=Math.min(St,Nt.byteLength),Kt=rt.byteOffset+rt.bytesFilled;gt(rt.buffer,Kt,Nt.buffer,Nt.byteOffset,Qt),Nt.byteLength===Qt?At.shift():(Nt.byteOffset+=Qt,Nt.byteLength-=Qt),_._queueTotalSize-=Qt,Pr(_,Qt,rt),St-=Qt}return Tt}function Pr(_,rt,ct){ct.bytesFilled+=rt}function Jr(_){_._queueTotalSize===0&&_._closeRequested?(_i(_),Yn(_._controlledReadableByteStream)):ur(_)}function Gr(_){_._byobRequest!==null&&(_._byobRequest._associatedReadableByteStreamController=void 0,_._byobRequest._view=null,_._byobRequest=null)}function dn(_){for(;_._pendingPullIntos.length>0;){if(_._queueTotalSize===0)return;var rt=_._pendingPullIntos.peek();Bn(_,rt)&&(Nn(_),mr(_._controlledReadableByteStream,rt))}}function Zn(_,rt,ct,yt){var St,Tt=_._controlledReadableByteStream,jt=rt.constructor,At=function(Vr){return Ln(Vr)?1:Vr.BYTES_PER_ELEMENT}(jt),Nt=rt.byteOffset,Qt=rt.byteLength,Kt=ct*At;try{St=wt(rt.buffer)}catch(Vr){return void yt._errorSteps(Vr)}var dr={buffer:St,bufferByteLength:St.byteLength,byteOffset:Nt,byteLength:Qt,bytesFilled:0,minimumFill:Kt,elementSize:At,viewConstructor:jt,readerType:"byob"};if(_._pendingPullIntos.length>0)return _._pendingPullIntos.push(dr),void Ko(Tt,yt);if(Tt._state!=="closed"){if(_._queueTotalSize>0){if(Bn(_,dr)){var Wt=Br(dr);return Jr(_),void yt._chunkSteps(Wt)}if(_._closeRequested){var pr=new TypeError("Insufficient bytes to fill elements in the given buffer");return cn(_,pr),void yt._errorSteps(pr)}}_._pendingPullIntos.push(dr),Ko(Tt,yt),ur(_)}else{var Ur=new jt(dr.buffer,dr.byteOffset,0);yt._closeSteps(Ur)}}function Un(_,rt){var ct=_._pendingPullIntos.peek();Gr(_),_._controlledReadableByteStream._state==="closed"?function(yt,St){St.readerType==="none"&&Nn(yt);var Tt=yt._controlledReadableByteStream;if(Ro(Tt))for(;Yo(Tt)>0;)mr(Tt,Nn(yt))}(_,ct):function(yt,St,Tt){if(Pr(0,St,Tt),Tt.readerType==="none")return Fn(yt,Tt),void dn(yt);if(!(Tt.bytesFilled<Tt.minimumFill)){Nn(yt);var jt=Tt.bytesFilled%Tt.elementSize;if(jt>0){var At=Tt.byteOffset+Tt.bytesFilled;En(yt,Tt.buffer,At-jt,jt)}Tt.bytesFilled-=jt,mr(yt._controlledReadableByteStream,Tt),dn(yt)}}(_,rt,ct),ur(_)}function Nn(_){return _._pendingPullIntos.shift()}function _i(_){_._pullAlgorithm=void 0,_._cancelAlgorithm=void 0}function qn(_){var rt=_._controlledReadableByteStream;if(!_._closeRequested&&rt._state==="readable")if(_._queueTotalSize>0)_._closeRequested=!0;else{if(_._pendingPullIntos.length>0){var ct=_._pendingPullIntos.peek();if(ct.bytesFilled%ct.elementSize!=0){var yt=new TypeError("Insufficient bytes to fill elements in the given buffer");throw cn(_,yt),yt}}_i(_),Yn(rt)}}function eo(_,rt){var ct=_._controlledReadableByteStream;if(!_._closeRequested&&ct._state==="readable"){var yt=rt.buffer,St=rt.byteOffset,Tt=rt.byteLength;if(ut(yt))throw new TypeError("chunk's buffer is detached and so cannot be enqueued");var jt=wt(yt);if(_._pendingPullIntos.length>0){var At=_._pendingPullIntos.peek();if(ut(At.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be filled with an enqueued chunk");Gr(_),At.buffer=wt(At.buffer),At.readerType==="none"&&Fn(_,At)}wr(ct)?(function(Nt){for(var Qt=Nt._controlledReadableByteStream._reader;Qt._readRequests.length>0;){if(Nt._queueTotalSize===0)return;zo(Nt,Qt._readRequests.shift())}}(_),Er(ct)===0?Wr(_,jt,St,Tt):(_._pendingPullIntos.length>0&&Nn(_),Rr(ct,new Uint8Array(jt,St,Tt),!1))):Ro(ct)?(Wr(_,jt,St,Tt),dn(_)):Wr(_,jt,St,Tt),ur(_)}}function cn(_,rt){var ct=_._controlledReadableByteStream;ct._state==="readable"&&(hr(_),en(_),_i(_),bs(ct,rt))}function zo(_,rt){var ct=_._queue.shift();_._queueTotalSize-=ct.byteLength,Jr(_);var yt=new Uint8Array(ct.buffer,ct.byteOffset,ct.byteLength);rt._chunkSteps(yt)}function _o(_){if(_._byobRequest===null&&_._pendingPullIntos.length>0){var rt=_._pendingPullIntos.peek(),ct=new Uint8Array(rt.buffer,rt.byteOffset+rt.bytesFilled,rt.byteLength-rt.bytesFilled),yt=Object.create(un.prototype);(function(St,Tt,jt){St._associatedReadableByteStreamController=Tt,St._view=jt})(yt,_,ct),_._byobRequest=yt}return _._byobRequest}function Wo(_){var rt=_._controlledReadableByteStream._state;return rt==="errored"?null:rt==="closed"?0:_._strategyHWM-_._queueTotalSize}function to(_,rt){var ct=_._pendingPullIntos.peek();if(_._controlledReadableByteStream._state==="closed"){if(rt!==0)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream")}else{if(rt===0)throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream");if(ct.bytesFilled+rt>ct.byteLength)throw new RangeError("bytesWritten out of range")}ct.buffer=wt(ct.buffer),Un(_,rt)}function ro(_,rt){var ct=_._pendingPullIntos.peek();if(_._controlledReadableByteStream._state==="closed"){if(rt.byteLength!==0)throw new TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream")}else if(rt.byteLength===0)throw new TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream");if(ct.byteOffset+ct.bytesFilled!==rt.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(ct.bufferByteLength!==rt.buffer.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");if(ct.bytesFilled+rt.byteLength>ct.byteLength)throw new RangeError("The region specified by view is larger than byobRequest");var yt=rt.byteLength;ct.buffer=wt(rt.buffer),Un(_,yt)}function Vo(_,rt,ct,yt,St,Tt,jt){rt._controlledReadableByteStream=_,rt._pullAgain=!1,rt._pulling=!1,rt._byobRequest=null,rt._queue=rt._queueTotalSize=void 0,en(rt),rt._closeRequested=!1,rt._started=!1,rt._strategyHWM=Tt,rt._pullAlgorithm=yt,rt._cancelAlgorithm=St,rt._autoAllocateChunkSize=jt,rt._pendingPullIntos=new Yt,_._readableStreamController=rt,xt(nt(ct()),function(){return rt._started=!0,ur(rt),null},function(At){return cn(rt,At),null})}function So(_){return new TypeError("ReadableStreamBYOBRequest.prototype.".concat(_," can only be used on a ReadableStreamBYOBRequest"))}function Hn(_){return new TypeError("ReadableByteStreamController.prototype.".concat(_," can only be used on a ReadableByteStreamController"))}function Is(_,rt){if((_="".concat(_))!=="byob")throw new TypeError("".concat(rt," '").concat(_,"' is not a valid enumeration value for ReadableStreamReaderMode"));return _}function Go(_){return new yn(_)}function Ko(_,rt){_._reader._readIntoRequests.push(rt)}function Yo(_){return _._reader._readIntoRequests.length}function Ro(_){var rt=_._reader;return rt!==void 0&&!!jn(rt)}Object.defineProperties(an.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),lt(an.prototype.close,"close"),lt(an.prototype.enqueue,"enqueue"),lt(an.prototype.error,"error"),typeof a.toStringTag=="symbol"&&Object.defineProperty(an.prototype,a.toStringTag,{value:"ReadableByteStreamController",configurable:!0});var yn=function(){function _(rt){if(Sr(rt,1,"ReadableStreamBYOBReader"),ar(rt,"First parameter"),Sn(rt))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!hn(rt._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");Vt(this,rt),this._readIntoRequests=new Yt}return Object.defineProperty(_.prototype,"closed",{get:function(){return jn(this)?this._closedPromise:ot(no("closed"))},enumerable:!1,configurable:!0}),_.prototype.cancel=function(rt){return rt===void 0&&(rt=void 0),jn(this)?this._ownerReadableStream===void 0?ot(sr("cancel")):nr(this,rt):ot(no("cancel"))},_.prototype.read=function(rt,ct){if(ct===void 0&&(ct={}),!jn(this))return ot(no("read"));if(!ArrayBuffer.isView(rt))return ot(new TypeError("view must be an array buffer view"));if(rt.byteLength===0)return ot(new TypeError("view must have non-zero byteLength"));if(rt.buffer.byteLength===0)return ot(new TypeError("view's buffer must have non-zero byteLength"));if(ut(rt.buffer))return ot(new TypeError("view's buffer has been detached"));var yt;try{yt=function(Nt,Qt){var Kt;return Ft(Nt,Qt),{min:qt((Kt=Nt==null?void 0:Nt.min)!==null&&Kt!==void 0?Kt:1,"".concat(Qt," has member 'min' that"))}}(ct,"options")}catch(Nt){return ot(Nt)}var St,Tt,jt=yt.min;if(jt===0)return ot(new TypeError("options.min must be greater than 0"));if(function(Nt){return Ln(Nt.constructor)}(rt)){if(jt>rt.byteLength)return ot(new RangeError("options.min must be less than or equal to view's byteLength"))}else if(jt>rt.length)return ot(new RangeError("options.min must be less than or equal to view's length"));if(this._ownerReadableStream===void 0)return ot(sr("read from"));var At=tt(function(Nt,Qt){St=Nt,Tt=Qt});return Qo(this,rt,jt,{_chunkSteps:function(Nt){return St({value:Nt,done:!1})},_closeSteps:function(Nt){return St({value:Nt,done:!0})},_errorSteps:function(Nt){return Tt(Nt)}}),At},_.prototype.releaseLock=function(){if(!jn(this))throw no("releaseLock");this._ownerReadableStream!==void 0&&function(rt){Zt(rt);var ct=new TypeError("Reader was released");Jo(rt,ct)}(this)},_}();function jn(_){return!!it(_)&&!!Object.prototype.hasOwnProperty.call(_,"_readIntoRequests")&&_ instanceof yn}function Qo(_,rt,ct,yt){var St=_._ownerReadableStream;St._disturbed=!0,St._state==="errored"?yt._errorSteps(St._storedError):Zn(St._readableStreamController,rt,ct,yt)}function Jo(_,rt){var ct=_._readIntoRequests;_._readIntoRequests=new Yt,ct.forEach(function(yt){yt._errorSteps(rt)})}function no(_){return new TypeError("ReadableStreamBYOBReader.prototype.".concat(_," can only be used on a ReadableStreamBYOBReader"))}function zn(_,rt){var ct=_.highWaterMark;if(ct===void 0)return rt;if(_r(ct)||ct<0)throw new RangeError("Invalid highWaterMark");return ct}function io(_){var rt=_.size;return rt||function(){return 1}}function oo(_,rt){Ft(_,rt);var ct=_==null?void 0:_.highWaterMark,yt=_==null?void 0:_.size;return{highWaterMark:ct===void 0?void 0:Tr(ct),size:yt===void 0?void 0:Ms(yt,"".concat(rt," has member 'size' that"))}}function Ms(_,rt){return lr(_,rt),function(ct){return Tr(_(ct))}}function Ds(_,rt,ct){return lr(_,ct),function(yt){return er(_,rt,[yt])}}function Ls(_,rt,ct){return lr(_,ct),function(){return er(_,rt,[])}}function Fs(_,rt,ct){return lr(_,ct),function(yt){return Ht(_,rt,[yt])}}function Bs(_,rt,ct){return lr(_,ct),function(yt,St){return er(_,rt,[yt,St])}}function Xo(_,rt){if(!$n(_))throw new TypeError("".concat(rt," is not a WritableStream."))}Object.defineProperties(yn.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),lt(yn.prototype.cancel,"cancel"),lt(yn.prototype.read,"read"),lt(yn.prototype.releaseLock,"releaseLock"),typeof a.toStringTag=="symbol"&&Object.defineProperty(yn.prototype,a.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});var Us=typeof AbortController=="function",vn=function(){function _(rt,ct){rt===void 0&&(rt={}),ct===void 0&&(ct={}),rt===void 0?rt=null:Or(rt,"First parameter");var yt=oo(ct,"Second parameter"),St=function(jt,At){Ft(jt,At);var Nt=jt==null?void 0:jt.abort,Qt=jt==null?void 0:jt.close,Kt=jt==null?void 0:jt.start,dr=jt==null?void 0:jt.type,Wt=jt==null?void 0:jt.write;return{abort:Nt===void 0?void 0:Ds(Nt,jt,"".concat(At," has member 'abort' that")),close:Qt===void 0?void 0:Ls(Qt,jt,"".concat(At," has member 'close' that")),start:Kt===void 0?void 0:Fs(Kt,jt,"".concat(At," has member 'start' that")),write:Wt===void 0?void 0:Bs(Wt,jt,"".concat(At," has member 'write' that")),type:dr}}(rt,"First parameter");if(ts(this),St.type!==void 0)throw new RangeError("Invalid type is specified");var Tt=io(yt);(function(jt,At,Nt,Qt){var Kt,dr,Wt,pr,Ur=Object.create(Cn.prototype);Kt=At.start!==void 0?function(){return At.start(Ur)}:function(){},dr=At.write!==void 0?function(Vr){return At.write(Vr,Ur)}:function(){return nt(void 0)},Wt=At.close!==void 0?function(){return At.close()}:function(){return nt(void 0)},pr=At.abort!==void 0?function(Vr){return At.abort(Vr)}:function(){return nt(void 0)},ls(jt,Ur,Kt,dr,Wt,pr,Nt,Qt)})(this,St,zn(yt,1),Tt)}return Object.defineProperty(_.prototype,"locked",{get:function(){if(!$n(this))throw co("locked");return On(this)},enumerable:!1,configurable:!0}),_.prototype.abort=function(rt){return rt===void 0&&(rt=void 0),$n(this)?On(this)?ot(new TypeError("Cannot abort a stream that already has a writer")):so(this,rt):ot(co("abort"))},_.prototype.close=function(){return $n(this)?On(this)?ot(new TypeError("Cannot close a stream that already has a writer")):mn(this)?ot(new TypeError("Cannot close an already-closing stream")):rs(this):ot(co("close"))},_.prototype.getWriter=function(){if(!$n(this))throw co("getWriter");return Zo(this)},_}();function Zo(_){return new gn(_)}function ts(_){_._state="writable",_._storedError=void 0,_._writer=void 0,_._writableStreamController=void 0,_._writeRequests=new Yt,_._inFlightWriteRequest=void 0,_._closeRequest=void 0,_._inFlightCloseRequest=void 0,_._pendingAbortRequest=void 0,_._backpressure=!1}function $n(_){return!!it(_)&&!!Object.prototype.hasOwnProperty.call(_,"_writableStreamController")&&_ instanceof vn}function On(_){return _._writer!==void 0}function so(_,rt){var ct;if(_._state==="closed"||_._state==="errored")return nt(void 0);_._writableStreamController._abortReason=rt,(ct=_._writableStreamController._abortController)===null||ct===void 0||ct.abort(rt);var yt=_._state;if(yt==="closed"||yt==="errored")return nt(void 0);if(_._pendingAbortRequest!==void 0)return _._pendingAbortRequest._promise;var St=!1;yt==="erroring"&&(St=!0,rt=void 0);var Tt=tt(function(jt,At){_._pendingAbortRequest={_promise:void 0,_resolve:jt,_reject:At,_reason:rt,_wasAlreadyErroring:St}});return _._pendingAbortRequest._promise=Tt,St||ko(_,rt),Tt}function rs(_){var rt=_._state;if(rt==="closed"||rt==="errored")return ot(new TypeError("The stream (in ".concat(rt," state) is not in the writable state and cannot be closed")));var ct,yt=tt(function(Tt,jt){var At={_resolve:Tt,_reject:jt};_._closeRequest=At}),St=_._writer;return St!==void 0&&_._backpressure&&rt==="writable"&&Io(St),sn(ct=_._writableStreamController,as,0),uo(ct),yt}function jo(_,rt){_._state!=="writable"?Co(_):ko(_,rt)}function ko(_,rt){var ct=_._writableStreamController;_._state="erroring",_._storedError=rt;var yt=_._writer;yt!==void 0&&is(yt,rt),!function(St){return!(St._inFlightWriteRequest===void 0&&St._inFlightCloseRequest===void 0)}(_)&&ct._started&&Co(_)}function Co(_){_._state="errored",_._writableStreamController[Jt]();var rt=_._storedError;if(_._writeRequests.forEach(function(yt){yt._reject(rt)}),_._writeRequests=new Yt,_._pendingAbortRequest!==void 0){var ct=_._pendingAbortRequest;if(_._pendingAbortRequest=void 0,ct._wasAlreadyErroring)return ct._reject(rt),void ao(_);xt(_._writableStreamController[rr](ct._reason),function(){return ct._resolve(),ao(_),null},function(yt){return ct._reject(yt),ao(_),null})}else ao(_)}function mn(_){return _._closeRequest!==void 0||_._inFlightCloseRequest!==void 0}function ao(_){_._closeRequest!==void 0&&(_._closeRequest._reject(_._storedError),_._closeRequest=void 0);var rt=_._writer;rt!==void 0&&$o(rt,_._storedError)}function To(_,rt){var ct=_._writer;ct!==void 0&&rt!==_._backpressure&&(rt?function(yt){po(yt)}(ct):Io(ct)),_._backpressure=rt}Object.defineProperties(vn.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),lt(vn.prototype.abort,"abort"),lt(vn.prototype.close,"close"),lt(vn.prototype.getWriter,"getWriter"),typeof a.toStringTag=="symbol"&&Object.defineProperty(vn.prototype,a.toStringTag,{value:"WritableStream",configurable:!0});var gn=function(){function _(rt){if(Sr(rt,1,"WritableStreamDefaultWriter"),Xo(rt,"First parameter"),On(rt))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=rt,rt._writer=this;var ct,yt=rt._state;if(yt==="writable")!mn(rt)&&rt._backpressure?po(this):ps(this),fo(this);else if(yt==="erroring")Oo(this,rt._storedError),fo(this);else if(yt==="closed")ps(this),fo(ct=this),fs(ct);else{var St=rt._storedError;Oo(this,St),ds(this,St)}}return Object.defineProperty(_.prototype,"closed",{get:function(){return kn(this)?this._closedPromise:ot(Tn("closed"))},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"desiredSize",{get:function(){if(!kn(this))throw Tn("desiredSize");if(this._ownerWritableStream===void 0)throw Vn("desiredSize");return function(rt){var ct=rt._ownerWritableStream,yt=ct._state;return yt==="errored"||yt==="erroring"?null:yt==="closed"?0:us(ct._writableStreamController)}(this)},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"ready",{get:function(){return kn(this)?this._readyPromise:ot(Tn("ready"))},enumerable:!1,configurable:!0}),_.prototype.abort=function(rt){return rt===void 0&&(rt=void 0),kn(this)?this._ownerWritableStream===void 0?ot(Vn("abort")):function(ct,yt){return so(ct._ownerWritableStream,yt)}(this,rt):ot(Tn("abort"))},_.prototype.close=function(){if(!kn(this))return ot(Tn("close"));var rt=this._ownerWritableStream;return rt===void 0?ot(Vn("close")):mn(rt)?ot(new TypeError("Cannot close an already-closing stream")):ns(this)},_.prototype.releaseLock=function(){if(!kn(this))throw Tn("releaseLock");this._ownerWritableStream!==void 0&&os(this)},_.prototype.write=function(rt){return rt===void 0&&(rt=void 0),kn(this)?this._ownerWritableStream===void 0?ot(Vn("write to")):ss(this,rt):ot(Tn("write"))},_}();function kn(_){return!!it(_)&&!!Object.prototype.hasOwnProperty.call(_,"_ownerWritableStream")&&_ instanceof gn}function ns(_){return rs(_._ownerWritableStream)}function qs(_,rt){_._closedPromiseState==="pending"?$o(_,rt):function(ct,yt){ds(ct,yt)}(_,rt)}function is(_,rt){_._readyPromiseState==="pending"?hs(_,rt):function(ct,yt){Oo(ct,yt)}(_,rt)}function os(_){var rt=_._ownerWritableStream,ct=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");is(_,ct),qs(_,ct),rt._writer=void 0,_._ownerWritableStream=void 0}function ss(_,rt){var ct=_._ownerWritableStream,yt=ct._writableStreamController,St=function(At,Nt){try{return At._strategySizeAlgorithm(Nt)}catch(Qt){return Wn(At,Qt),1}}(yt,rt);if(ct!==_._ownerWritableStream)return ot(Vn("write to"));var Tt=ct._state;if(Tt==="errored")return ot(ct._storedError);if(mn(ct)||Tt==="closed")return ot(new TypeError("The stream is closing or closed and cannot be written to"));if(Tt==="erroring")return ot(ct._storedError);var jt=function(At){return tt(function(Nt,Qt){var Kt={_resolve:Nt,_reject:Qt};At._writeRequests.push(Kt)})}(ct);return function(At,Nt,Qt){try{sn(At,Nt,Qt)}catch(dr){return void Wn(At,dr)}var Kt=At._controlledWritableStream;!mn(Kt)&&Kt._state==="writable"&&To(Kt,Po(At)),uo(At)}(yt,rt,St),jt}Object.defineProperties(gn.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),lt(gn.prototype.abort,"abort"),lt(gn.prototype.close,"close"),lt(gn.prototype.releaseLock,"releaseLock"),lt(gn.prototype.write,"write"),typeof a.toStringTag=="symbol"&&Object.defineProperty(gn.prototype,a.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});var as={},Cn=function(){function _(){throw new TypeError("Illegal constructor")}return Object.defineProperty(_.prototype,"abortReason",{get:function(){if(!Ao(this))throw No("abortReason");return this._abortReason},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"signal",{get:function(){if(!Ao(this))throw No("signal");if(this._abortController===void 0)throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported");return this._abortController.signal},enumerable:!1,configurable:!0}),_.prototype.error=function(rt){if(rt===void 0&&(rt=void 0),!Ao(this))throw No("error");this._controlledWritableStream._state==="writable"&&cs(this,rt)},_.prototype[rr]=function(rt){var ct=this._abortAlgorithm(rt);return lo(this),ct},_.prototype[Jt]=function(){en(this)},_}();function Ao(_){return!!it(_)&&!!Object.prototype.hasOwnProperty.call(_,"_controlledWritableStream")&&_ instanceof Cn}function ls(_,rt,ct,yt,St,Tt,jt,At){rt._controlledWritableStream=_,_._writableStreamController=rt,rt._queue=void 0,rt._queueTotalSize=void 0,en(rt),rt._abortReason=void 0,rt._abortController=function(){if(Us)return new AbortController}(),rt._started=!1,rt._strategySizeAlgorithm=At,rt._strategyHWM=jt,rt._writeAlgorithm=yt,rt._closeAlgorithm=St,rt._abortAlgorithm=Tt;var Nt=Po(rt);To(_,Nt),xt(nt(ct()),function(){return rt._started=!0,uo(rt),null},function(Qt){return rt._started=!0,jo(_,Qt),null})}function lo(_){_._writeAlgorithm=void 0,_._closeAlgorithm=void 0,_._abortAlgorithm=void 0,_._strategySizeAlgorithm=void 0}function us(_){return _._strategyHWM-_._queueTotalSize}function uo(_){var rt=_._controlledWritableStream;if(_._started&&rt._inFlightWriteRequest===void 0)if(rt._state!=="erroring"){if(_._queue.length!==0){var ct=_._queue.peek().value;ct===as?function(yt){var St=yt._controlledWritableStream;(function(jt){jt._inFlightCloseRequest=jt._closeRequest,jt._closeRequest=void 0})(St),bn(yt);var Tt=yt._closeAlgorithm();lo(yt),xt(Tt,function(){return function(jt){jt._inFlightCloseRequest._resolve(void 0),jt._inFlightCloseRequest=void 0,jt._state==="erroring"&&(jt._storedError=void 0,jt._pendingAbortRequest!==void 0&&(jt._pendingAbortRequest._resolve(),jt._pendingAbortRequest=void 0)),jt._state="closed";var At=jt._writer;At!==void 0&&fs(At)}(St),null},function(jt){return function(At,Nt){At._inFlightCloseRequest._reject(Nt),At._inFlightCloseRequest=void 0,At._pendingAbortRequest!==void 0&&(At._pendingAbortRequest._reject(Nt),At._pendingAbortRequest=void 0),jo(At,Nt)}(St,jt),null})}(_):function(yt,St){var Tt=yt._controlledWritableStream;(function(At){At._inFlightWriteRequest=At._writeRequests.shift()})(Tt);var jt=yt._writeAlgorithm(St);xt(jt,function(){(function(Qt){Qt._inFlightWriteRequest._resolve(void 0),Qt._inFlightWriteRequest=void 0})(Tt);var At=Tt._state;if(bn(yt),!mn(Tt)&&At==="writable"){var Nt=Po(yt);To(Tt,Nt)}return uo(yt),null},function(At){return Tt._state==="writable"&&lo(yt),function(Nt,Qt){Nt._inFlightWriteRequest._reject(Qt),Nt._inFlightWriteRequest=void 0,jo(Nt,Qt)}(Tt,At),null})}(_,ct)}}else Co(rt)}function Wn(_,rt){_._controlledWritableStream._state==="writable"&&cs(_,rt)}function Po(_){return us(_)<=0}function cs(_,rt){var ct=_._controlledWritableStream;lo(_),ko(ct,rt)}function co(_){return new TypeError("WritableStream.prototype.".concat(_," can only be used on a WritableStream"))}function No(_){return new TypeError("WritableStreamDefaultController.prototype.".concat(_," can only be used on a WritableStreamDefaultController"))}function Tn(_){return new TypeError("WritableStreamDefaultWriter.prototype.".concat(_," can only be used on a WritableStreamDefaultWriter"))}function Vn(_){return new TypeError("Cannot "+_+" a stream using a released writer")}function fo(_){_._closedPromise=tt(function(rt,ct){_._closedPromise_resolve=rt,_._closedPromise_reject=ct,_._closedPromiseState="pending"})}function ds(_,rt){fo(_),$o(_,rt)}function $o(_,rt){_._closedPromise_reject!==void 0&&(Bt(_._closedPromise),_._closedPromise_reject(rt),_._closedPromise_resolve=void 0,_._closedPromise_reject=void 0,_._closedPromiseState="rejected")}function fs(_){_._closedPromise_resolve!==void 0&&(_._closedPromise_resolve(void 0),_._closedPromise_resolve=void 0,_._closedPromise_reject=void 0,_._closedPromiseState="resolved")}function po(_){_._readyPromise=tt(function(rt,ct){_._readyPromise_resolve=rt,_._readyPromise_reject=ct}),_._readyPromiseState="pending"}function Oo(_,rt){po(_),hs(_,rt)}function ps(_){po(_),Io(_)}function hs(_,rt){_._readyPromise_reject!==void 0&&(Bt(_._readyPromise),_._readyPromise_reject(rt),_._readyPromise_resolve=void 0,_._readyPromise_reject=void 0,_._readyPromiseState="rejected")}function Io(_){_._readyPromise_resolve!==void 0&&(_._readyPromise_resolve(void 0),_._readyPromise_resolve=void 0,_._readyPromise_reject=void 0,_._readyPromiseState="fulfilled")}Object.defineProperties(Cn.prototype,{abortReason:{enumerable:!0},signal:{enumerable:!0},error:{enumerable:!0}}),typeof a.toStringTag=="symbol"&&Object.defineProperty(Cn.prototype,a.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});var ho=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof commonjsGlobal<"u"?commonjsGlobal:void 0,ms,Hs=(function(_){if(typeof _!="function"&&typeof _!="object"||_.name!=="DOMException")return!1;try{return new _,!0}catch{return!1}}(ms=ho==null?void 0:ho.DOMException)?ms:void 0)||function(){var _=function(rt,ct){this.message=rt||"",this.name=ct||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)};return lt(_,"DOMException"),_.prototype=Object.create(Error.prototype),Object.defineProperty(_.prototype,"constructor",{value:_,writable:!0,configurable:!0}),_}();function gs(_,rt,ct,yt,St,Tt){var jt=yr(_),At=Zo(rt);_._disturbed=!0;var Nt=!1,Qt=nt(void 0);return tt(function(Kt,dr){var Wt,pr,Ur,Vr;if(Tt!==void 0){if(Wt=function(){var Lr=Tt.reason!==void 0?Tt.reason:new Hs("Aborted","AbortError"),jr=[];yt||jr.push(function(){return rt._state==="writable"?so(rt,Lr):nt(void 0)}),St||jr.push(function(){return _._state==="readable"?pn(_,Lr):nt(void 0)}),Ir(function(){return Promise.all(jr.map(function(kr){return kr()}))},!0,Lr)},Tt.aborted)return void Wt();Tt.addEventListener("abort",Wt)}if(Yr(_,jt._closedPromise,function(Lr){return yt?tn(!0,Lr):Ir(function(){return so(rt,Lr)},!0,Lr),null}),Yr(rt,At._closedPromise,function(Lr){return St?tn(!0,Lr):Ir(function(){return pn(_,Lr)},!0,Lr),null}),pr=_,Ur=jt._closedPromise,Vr=function(){return ct?tn():Ir(function(){return function(Lr){var jr=Lr._ownerWritableStream,kr=jr._state;return mn(jr)||kr==="closed"?nt(void 0):kr==="errored"?ot(jr._storedError):ns(Lr)}(At)}),null},pr._state==="closed"?Vr():Et(Ur,Vr),mn(rt)||rt._state==="closed"){var on=new TypeError("the destination writable stream closed before all data could be piped to it");St?tn(!0,on):Ir(function(){return pn(_,on)},!0,on)}function Qr(){var Lr=Qt;return ht(Qt,function(){return Lr!==Qt?Qr():void 0})}function Yr(Lr,jr,kr){Lr._state==="errored"?kr(Lr._storedError):_t(jr,kr)}function Ir(Lr,jr,kr){function br(){return xt(Lr(),function(){return rn(jr,kr)},function(qr){return rn(!0,qr)}),null}Nt||(Nt=!0,rt._state!=="writable"||mn(rt)?br():Et(Qr(),br))}function tn(Lr,jr){Nt||(Nt=!0,rt._state!=="writable"||mn(rt)?rn(Lr,jr):Et(Qr(),function(){return rn(Lr,jr)}))}function rn(Lr,jr){return os(At),Zt(jt),Tt!==void 0&&Tt.removeEventListener("abort",Wt),Lr?dr(jr):Kt(void 0),null}Bt(tt(function(Lr,jr){(function kr(br){br?Lr():ht(Nt?nt(!0):ht(At._readyPromise,function(){return tt(function(qr,Ar){g(jt,{_chunkSteps:function(Hr){Qt=ht(ss(At,Hr),void 0,_e),qr(!1)},_closeSteps:function(){return qr(!0)},_errorSteps:Ar})})}),kr,jr)})(!1)}))})}var xn=function(){function _(){throw new TypeError("Illegal constructor")}return Object.defineProperty(_.prototype,"desiredSize",{get:function(){if(!mo(this))throw xo("desiredSize");return Mo(this)},enumerable:!1,configurable:!0}),_.prototype.close=function(){if(!mo(this))throw xo("close");if(!Mn(this))throw new TypeError("The stream is not in a state that permits close");An(this)},_.prototype.enqueue=function(rt){if(rt===void 0&&(rt=void 0),!mo(this))throw xo("enqueue");if(!Mn(this))throw new TypeError("The stream is not in a state that permits enqueue");return In(this,rt)},_.prototype.error=function(rt){if(rt===void 0&&(rt=void 0),!mo(this))throw xo("error");fn(this,rt)},_.prototype[Dt]=function(rt){en(this);var ct=this._cancelAlgorithm(rt);return go(this),ct},_.prototype[gr]=function(rt){var ct=this._controlledReadableStream;if(this._queue.length>0){var yt=bn(this);this._closeRequested&&this._queue.length===0?(go(this),Yn(ct)):Gn(this),rt._chunkSteps(yt)}else xr(ct,rt),Gn(this)},_.prototype[Lt]=function(){},_}();function mo(_){return!!it(_)&&!!Object.prototype.hasOwnProperty.call(_,"_controlledReadableStream")&&_ instanceof xn}function Gn(_){xs(_)&&(_._pulling?_._pullAgain=!0:(_._pulling=!0,xt(_._pullAlgorithm(),function(){return _._pulling=!1,_._pullAgain&&(_._pullAgain=!1,Gn(_)),null},function(rt){return fn(_,rt),null})))}function xs(_){var rt=_._controlledReadableStream;return!!Mn(_)&&!!_._started&&(!!(Sn(rt)&&Er(rt)>0)||Mo(_)>0)}function go(_){_._pullAlgorithm=void 0,_._cancelAlgorithm=void 0,_._strategySizeAlgorithm=void 0}function An(_){if(Mn(_)){var rt=_._controlledReadableStream;_._closeRequested=!0,_._queue.length===0&&(go(_),Yn(rt))}}function In(_,rt){if(Mn(_)){var ct=_._controlledReadableStream;if(Sn(ct)&&Er(ct)>0)Rr(ct,rt,!1);else{var yt=void 0;try{yt=_._strategySizeAlgorithm(rt)}catch(St){throw fn(_,St),St}try{sn(_,rt,yt)}catch(St){throw fn(_,St),St}}Gn(_)}}function fn(_,rt){var ct=_._controlledReadableStream;ct._state==="readable"&&(en(_),go(_),bs(ct,rt))}function Mo(_){var rt=_._controlledReadableStream._state;return rt==="errored"?null:rt==="closed"?0:_._strategyHWM-_._queueTotalSize}function Mn(_){var rt=_._controlledReadableStream._state;return!_._closeRequested&&rt==="readable"}function ys(_,rt,ct,yt,St,Tt,jt){rt._controlledReadableStream=_,rt._queue=void 0,rt._queueTotalSize=void 0,en(rt),rt._started=!1,rt._closeRequested=!1,rt._pullAgain=!1,rt._pulling=!1,rt._strategySizeAlgorithm=jt,rt._strategyHWM=Tt,rt._pullAlgorithm=yt,rt._cancelAlgorithm=St,_._readableStreamController=rt,xt(nt(ct()),function(){return rt._started=!0,Gn(rt),null},function(At){return fn(rt,At),null})}function xo(_){return new TypeError("ReadableStreamDefaultController.prototype.".concat(_," can only be used on a ReadableStreamDefaultController"))}function zs(_,rt){return hn(_._readableStreamController)?function(ct){var yt,St,Tt,jt,At,Nt=yr(ct),Qt=!1,Kt=!1,dr=!1,Wt=!1,pr=!1,Ur=tt(function(jr){At=jr});function Vr(jr){_t(jr._closedPromise,function(kr){return jr!==Nt||(cn(Tt._readableStreamController,kr),cn(jt._readableStreamController,kr),Wt&&pr||At(void 0)),null})}function on(){jn(Nt)&&(Zt(Nt),Vr(Nt=yr(ct))),g(Nt,{_chunkSteps:function(jr){Mt(function(){Kt=!1,dr=!1;var kr=jr,br=jr;if(!Wt&&!pr)try{br=$r(jr)}catch(qr){return cn(Tt._readableStreamController,qr),cn(jt._readableStreamController,qr),void At(pn(ct,qr))}Wt||eo(Tt._readableStreamController,kr),pr||eo(jt._readableStreamController,br),Qt=!1,Kt?Yr():dr&&Ir()})},_closeSteps:function(){Qt=!1,Wt||qn(Tt._readableStreamController),pr||qn(jt._readableStreamController),Tt._readableStreamController._pendingPullIntos.length>0&&to(Tt._readableStreamController,0),jt._readableStreamController._pendingPullIntos.length>0&&to(jt._readableStreamController,0),Wt&&pr||At(void 0)},_errorSteps:function(){Qt=!1}})}function Qr(jr,kr){pt(Nt)&&(Zt(Nt),Vr(Nt=Go(ct)));var br=kr?jt:Tt,qr=kr?Tt:jt;Qo(Nt,jr,1,{_chunkSteps:function(Ar){Mt(function(){Kt=!1,dr=!1;var Hr=kr?pr:Wt;if(kr?Wt:pr)Hr||ro(br._readableStreamController,Ar);else{var nn=void 0;try{nn=$r(Ar)}catch(Zr){return cn(br._readableStreamController,Zr),cn(qr._readableStreamController,Zr),void At(pn(ct,Zr))}Hr||ro(br._readableStreamController,Ar),eo(qr._readableStreamController,nn)}Qt=!1,Kt?Yr():dr&&Ir()})},_closeSteps:function(Ar){Qt=!1;var Hr=kr?pr:Wt,nn=kr?Wt:pr;Hr||qn(br._readableStreamController),nn||qn(qr._readableStreamController),Ar!==void 0&&(Hr||ro(br._readableStreamController,Ar),!nn&&qr._readableStreamController._pendingPullIntos.length>0&&to(qr._readableStreamController,0)),Hr&&nn||At(void 0)},_errorSteps:function(){Qt=!1}})}function Yr(){if(Qt)return Kt=!0,nt(void 0);Qt=!0;var jr=_o(Tt._readableStreamController);return jr===null?on():Qr(jr._view,!1),nt(void 0)}function Ir(){if(Qt)return dr=!0,nt(void 0);Qt=!0;var jr=_o(jt._readableStreamController);return jr===null?on():Qr(jr._view,!0),nt(void 0)}function tn(jr){if(Wt=!0,yt=jr,pr){var kr=ft([yt,St]),br=pn(ct,kr);At(br)}return Ur}function rn(jr){if(pr=!0,St=jr,Wt){var kr=ft([yt,St]),br=pn(ct,kr);At(br)}return Ur}function Lr(){}return Tt=ws(Lr,Yr,tn),jt=ws(Lr,Ir,rn),Vr(Nt),[Tt,jt]}(_):function(ct,yt){var St,Tt,jt,At,Nt,Qt=yr(ct),Kt=!1,dr=!1,Wt=!1,pr=!1,Ur=tt(function(Ir){Nt=Ir});function Vr(){return Kt?(dr=!0,nt(void 0)):(Kt=!0,g(Qt,{_chunkSteps:function(Ir){Mt(function(){dr=!1;var tn=Ir,rn=Ir;Wt||In(jt._readableStreamController,tn),pr||In(At._readableStreamController,rn),Kt=!1,dr&&Vr()})},_closeSteps:function(){Kt=!1,Wt||An(jt._readableStreamController),pr||An(At._readableStreamController),Wt&&pr||Nt(void 0)},_errorSteps:function(){Kt=!1}}),nt(void 0))}function on(Ir){if(Wt=!0,St=Ir,pr){var tn=ft([St,Tt]),rn=pn(ct,tn);Nt(rn)}return Ur}function Qr(Ir){if(pr=!0,Tt=Ir,Wt){var tn=ft([St,Tt]),rn=pn(ct,tn);Nt(rn)}return Ur}function Yr(){}return jt=Kn(Yr,Vr,on),At=Kn(Yr,Vr,Qr),_t(Qt._closedPromise,function(Ir){return fn(jt._readableStreamController,Ir),fn(At._readableStreamController,Ir),Wt&&pr||Nt(void 0),null}),[jt,At]}(_)}function Ws(_){return it(rt=_)&&rt.getReader!==void 0?function(ct){var yt;function St(){var jt;try{jt=ct.read()}catch(At){return ot(At)}return Rt(jt,function(At){if(!it(At))throw new TypeError("The promise returned by the reader.read() method must fulfill with an object");if(At.done)An(yt._readableStreamController);else{var Nt=At.value;In(yt._readableStreamController,Nt)}})}function Tt(jt){try{return nt(ct.cancel(jt))}catch(At){return ot(At)}}return yt=Kn(_e,St,Tt,0),yt}(_.getReader()):function(ct){var yt,St=$t(ct,"async");function Tt(){var At;try{At=function(Nt){var Qt=Ht(Nt.nextMethod,Nt.iterator,[]);if(!it(Qt))throw new TypeError("The iterator.next() method must return an object");return Qt}(St)}catch(Nt){return ot(Nt)}return Rt(nt(At),function(Nt){if(!it(Nt))throw new TypeError("The promise returned by the iterator.next() method must fulfill with an object");var Qt=function(dr){return!!dr.done}(Nt);if(Qt)An(yt._readableStreamController);else{var Kt=function(dr){return dr.value}(Nt);In(yt._readableStreamController,Kt)}})}function jt(At){var Nt,Qt,Kt=St.iterator;try{Nt=Pt(Kt,"return")}catch(dr){return ot(dr)}if(Nt===void 0)return nt(void 0);try{Qt=Ht(Nt,Kt,[At])}catch(dr){return ot(dr)}return Rt(nt(Qt),function(dr){if(!it(dr))throw new TypeError("The promise returned by the iterator.return() method must fulfill with an object")})}return yt=Kn(_e,Tt,jt,0),yt}(_);var rt}function Vs(_,rt,ct){return lr(_,ct),function(yt){return er(_,rt,[yt])}}function Gs(_,rt,ct){return lr(_,ct),function(yt){return er(_,rt,[yt])}}function Ks(_,rt,ct){return lr(_,ct),function(yt){return Ht(_,rt,[yt])}}function Ys(_,rt){if((_="".concat(_))!=="bytes")throw new TypeError("".concat(rt," '").concat(_,"' is not a valid enumeration value for ReadableStreamType"));return _}function vs(_,rt){Ft(_,rt);var ct=_==null?void 0:_.preventAbort,yt=_==null?void 0:_.preventCancel,St=_==null?void 0:_.preventClose,Tt=_==null?void 0:_.signal;return Tt!==void 0&&function(jt,At){if(!function(Nt){if(typeof Nt!="object"||Nt===null)return!1;try{return typeof Nt.aborted=="boolean"}catch{return!1}}(jt))throw new TypeError("".concat(At," is not an AbortSignal."))}(Tt,"".concat(rt," has member 'signal' that")),{preventAbort:!!ct,preventCancel:!!yt,preventClose:!!St,signal:Tt}}Object.defineProperties(xn.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),lt(xn.prototype.close,"close"),lt(xn.prototype.enqueue,"enqueue"),lt(xn.prototype.error,"error"),typeof a.toStringTag=="symbol"&&Object.defineProperty(xn.prototype,a.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});var Xr=function(){function _(rt,ct){rt===void 0&&(rt={}),ct===void 0&&(ct={}),rt===void 0?rt=null:Or(rt,"First parameter");var yt=oo(ct,"Second parameter"),St=function(jt,At){Ft(jt,At);var Nt=jt,Qt=Nt==null?void 0:Nt.autoAllocateChunkSize,Kt=Nt==null?void 0:Nt.cancel,dr=Nt==null?void 0:Nt.pull,Wt=Nt==null?void 0:Nt.start,pr=Nt==null?void 0:Nt.type;return{autoAllocateChunkSize:Qt===void 0?void 0:qt(Qt,"".concat(At," has member 'autoAllocateChunkSize' that")),cancel:Kt===void 0?void 0:Vs(Kt,Nt,"".concat(At," has member 'cancel' that")),pull:dr===void 0?void 0:Gs(dr,Nt,"".concat(At," has member 'pull' that")),start:Wt===void 0?void 0:Ks(Wt,Nt,"".concat(At," has member 'start' that")),type:pr===void 0?void 0:Ys(pr,"".concat(At," has member 'type' that"))}}(rt,"First parameter");if(Do(this),St.type==="bytes"){if(yt.size!==void 0)throw new RangeError("The strategy for a byte stream cannot have a size function");(function(jt,At,Nt){var Qt,Kt,dr,Wt=Object.create(an.prototype);Qt=At.start!==void 0?function(){return At.start(Wt)}:function(){},Kt=At.pull!==void 0?function(){return At.pull(Wt)}:function(){return nt(void 0)},dr=At.cancel!==void 0?function(Ur){return At.cancel(Ur)}:function(){return nt(void 0)};var pr=At.autoAllocateChunkSize;if(pr===0)throw new TypeError("autoAllocateChunkSize must be greater than 0");Vo(jt,Wt,Qt,Kt,dr,Nt,pr)})(this,St,zn(yt,0))}else{var Tt=io(yt);(function(jt,At,Nt,Qt){var Kt,dr,Wt,pr=Object.create(xn.prototype);Kt=At.start!==void 0?function(){return At.start(pr)}:function(){},dr=At.pull!==void 0?function(){return At.pull(pr)}:function(){return nt(void 0)},Wt=At.cancel!==void 0?function(Ur){return At.cancel(Ur)}:function(){return nt(void 0)},ys(jt,pr,Kt,dr,Wt,Nt,Qt)})(this,St,zn(yt,1),Tt)}}return Object.defineProperty(_.prototype,"locked",{get:function(){if(!_n(this))throw Pn("locked");return Sn(this)},enumerable:!1,configurable:!0}),_.prototype.cancel=function(rt){return rt===void 0&&(rt=void 0),_n(this)?Sn(this)?ot(new TypeError("Cannot cancel a stream that already has a reader")):pn(this,rt):ot(Pn("cancel"))},_.prototype.getReader=function(rt){if(rt===void 0&&(rt=void 0),!_n(this))throw Pn("getReader");return function(ct,yt){Ft(ct,yt);var St=ct==null?void 0:ct.mode;return{mode:St===void 0?void 0:Is(St,"".concat(yt," has member 'mode' that"))}}(rt,"First parameter").mode===void 0?yr(this):Go(this)},_.prototype.pipeThrough=function(rt,ct){if(ct===void 0&&(ct={}),!_n(this))throw Pn("pipeThrough");Sr(rt,1,"pipeThrough");var yt=function(Tt,jt){Ft(Tt,jt);var At=Tt==null?void 0:Tt.readable;Nr(At,"readable","ReadableWritablePair"),ar(At,"".concat(jt," has member 'readable' that"));var Nt=Tt==null?void 0:Tt.writable;return Nr(Nt,"writable","ReadableWritablePair"),Xo(Nt,"".concat(jt," has member 'writable' that")),{readable:At,writable:Nt}}(rt,"First parameter"),St=vs(ct,"Second parameter");if(Sn(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(On(yt.writable))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");return Bt(gs(this,yt.writable,St.preventClose,St.preventAbort,St.preventCancel,St.signal)),yt.readable},_.prototype.pipeTo=function(rt,ct){if(ct===void 0&&(ct={}),!_n(this))return ot(Pn("pipeTo"));if(rt===void 0)return ot("Parameter 1 is required in 'pipeTo'.");if(!$n(rt))return ot(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));var yt;try{yt=vs(ct,"Second parameter")}catch(St){return ot(St)}return Sn(this)?ot(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):On(rt)?ot(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):gs(this,rt,yt.preventClose,yt.preventAbort,yt.preventCancel,yt.signal)},_.prototype.tee=function(){if(!_n(this))throw Pn("tee");return ft(zs(this))},_.prototype.values=function(rt){if(rt===void 0&&(rt=void 0),!_n(this))throw Pn("values");var ct,yt,St,Tt,jt,At=function(Nt,Qt){Ft(Nt,Qt);var Kt=Nt==null?void 0:Nt.preventCancel;return{preventCancel:!!Kt}}(rt,"First parameter");return ct=this,yt=At.preventCancel,St=yr(ct),Tt=new Gt(St,yt),(jt=Object.create(zt))._asyncIteratorImpl=Tt,jt},_.prototype[kt]=function(rt){return this.values(rt)},_.from=function(rt){return Ws(rt)},_}();function Kn(_,rt,ct,yt,St){yt===void 0&&(yt=1),St===void 0&&(St=function(){return 1});var Tt=Object.create(Xr.prototype);return Do(Tt),ys(Tt,Object.create(xn.prototype),_,rt,ct,yt,St),Tt}function ws(_,rt,ct){var yt=Object.create(Xr.prototype);return Do(yt),Vo(yt,Object.create(an.prototype),_,rt,ct,0,void 0),yt}function Do(_){_._state="readable",_._reader=void 0,_._storedError=void 0,_._disturbed=!1}function _n(_){return!!it(_)&&!!Object.prototype.hasOwnProperty.call(_,"_readableStreamController")&&_ instanceof Xr}function Sn(_){return _._reader!==void 0}function pn(_,rt){if(_._disturbed=!0,_._state==="closed")return nt(void 0);if(_._state==="errored")return ot(_._storedError);Yn(_);var ct=_._reader;if(ct!==void 0&&jn(ct)){var yt=ct._readIntoRequests;ct._readIntoRequests=new Yt,yt.forEach(function(St){St._closeSteps(void 0)})}return Rt(_._readableStreamController[Dt](rt),_e)}function Yn(_){_._state="closed";var rt=_._reader;if(rt!==void 0&&(It(rt),pt(rt))){var ct=rt._readRequests;rt._readRequests=new Yt,ct.forEach(function(yt){yt._closeSteps()})}}function bs(_,rt){_._state="errored",_._storedError=rt;var ct=_._reader;ct!==void 0&&(Cr(ct,rt),pt(ct)?et(ct,rt):Jo(ct,rt))}function Pn(_){return new TypeError("ReadableStream.prototype.".concat(_," can only be used on a ReadableStream"))}function Es(_,rt){Ft(_,rt);var ct=_==null?void 0:_.highWaterMark;return Nr(ct,"highWaterMark","QueuingStrategyInit"),{highWaterMark:Tr(ct)}}Object.defineProperties(Xr,{from:{enumerable:!0}}),Object.defineProperties(Xr.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),lt(Xr.from,"from"),lt(Xr.prototype.cancel,"cancel"),lt(Xr.prototype.getReader,"getReader"),lt(Xr.prototype.pipeThrough,"pipeThrough"),lt(Xr.prototype.pipeTo,"pipeTo"),lt(Xr.prototype.tee,"tee"),lt(Xr.prototype.values,"values"),typeof a.toStringTag=="symbol"&&Object.defineProperty(Xr.prototype,a.toStringTag,{value:"ReadableStream",configurable:!0}),Object.defineProperty(Xr.prototype,kt,{value:Xr.prototype.values,writable:!0,configurable:!0});var _s=function(_){return _.byteLength};lt(_s,"size");var Qn=function(){function _(rt){Sr(rt,1,"ByteLengthQueuingStrategy"),rt=Es(rt,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=rt.highWaterMark}return Object.defineProperty(_.prototype,"highWaterMark",{get:function(){if(!Rs(this))throw Ss("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"size",{get:function(){if(!Rs(this))throw Ss("size");return _s},enumerable:!1,configurable:!0}),_}();function Ss(_){return new TypeError("ByteLengthQueuingStrategy.prototype.".concat(_," can only be used on a ByteLengthQueuingStrategy"))}function Rs(_){return!!it(_)&&!!Object.prototype.hasOwnProperty.call(_,"_byteLengthQueuingStrategyHighWaterMark")&&_ instanceof Qn}Object.defineProperties(Qn.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof a.toStringTag=="symbol"&&Object.defineProperty(Qn.prototype,a.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});var js=function(){return 1};lt(js,"size");var Jn=function(){function _(rt){Sr(rt,1,"CountQueuingStrategy"),rt=Es(rt,"First parameter"),this._countQueuingStrategyHighWaterMark=rt.highWaterMark}return Object.defineProperty(_.prototype,"highWaterMark",{get:function(){if(!Cs(this))throw ks("highWaterMark");return this._countQueuingStrategyHighWaterMark},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"size",{get:function(){if(!Cs(this))throw ks("size");return js},enumerable:!1,configurable:!0}),_}();function ks(_){return new TypeError("CountQueuingStrategy.prototype.".concat(_," can only be used on a CountQueuingStrategy"))}function Cs(_){return!!it(_)&&!!Object.prototype.hasOwnProperty.call(_,"_countQueuingStrategyHighWaterMark")&&_ instanceof Jn}function Qs(_,rt,ct){return lr(_,ct),function(yt){return er(_,rt,[yt])}}function Js(_,rt,ct){return lr(_,ct),function(yt){return Ht(_,rt,[yt])}}function Xs(_,rt,ct){return lr(_,ct),function(yt,St){return er(_,rt,[yt,St])}}function Zs(_,rt,ct){return lr(_,ct),function(yt){return er(_,rt,[yt])}}Object.defineProperties(Jn.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof a.toStringTag=="symbol"&&Object.defineProperty(Jn.prototype,a.toStringTag,{value:"CountQueuingStrategy",configurable:!0});var Xn=function(){function _(rt,ct,yt){rt===void 0&&(rt={}),ct===void 0&&(ct={}),yt===void 0&&(yt={}),rt===void 0&&(rt=null);var St=oo(ct,"Second parameter"),Tt=oo(yt,"Third parameter"),jt=function(Wt,pr){Ft(Wt,pr);var Ur=Wt==null?void 0:Wt.cancel,Vr=Wt==null?void 0:Wt.flush,on=Wt==null?void 0:Wt.readableType,Qr=Wt==null?void 0:Wt.start,Yr=Wt==null?void 0:Wt.transform,Ir=Wt==null?void 0:Wt.writableType;return{cancel:Ur===void 0?void 0:Zs(Ur,Wt,"".concat(pr," has member 'cancel' that")),flush:Vr===void 0?void 0:Qs(Vr,Wt,"".concat(pr," has member 'flush' that")),readableType:on,start:Qr===void 0?void 0:Js(Qr,Wt,"".concat(pr," has member 'start' that")),transform:Yr===void 0?void 0:Xs(Yr,Wt,"".concat(pr," has member 'transform' that")),writableType:Ir}}(rt,"First parameter");if(jt.readableType!==void 0)throw new RangeError("Invalid readableType specified");if(jt.writableType!==void 0)throw new RangeError("Invalid writableType specified");var At,Nt=zn(Tt,0),Qt=io(Tt),Kt=zn(St,1),dr=io(St);(function(Wt,pr,Ur,Vr,on,Qr){function Yr(){return pr}function Ir(kr){return function(br,qr){var Ar=br._transformStreamController;return br._backpressure?Rt(br._backpressureChangePromise,function(){var Hr=br._writable;if(Hr._state==="erroring")throw Hr._storedError;return Ns(Ar,qr)}):Ns(Ar,qr)}(Wt,kr)}function tn(kr){return function(br,qr){var Ar=br._transformStreamController;if(Ar._finishPromise!==void 0)return Ar._finishPromise;var Hr=br._readable;Ar._finishPromise=tt(function(Zr,Ho){Ar._finishPromise_resolve=Zr,Ar._finishPromise_reject=Ho});var nn=Ar._cancelAlgorithm(qr);return wo(Ar),xt(nn,function(){return Hr._state==="errored"?Dn(Ar,Hr._storedError):(fn(Hr._readableStreamController,qr),Bo(Ar)),null},function(Zr){return fn(Hr._readableStreamController,Zr),Dn(Ar,Zr),null}),Ar._finishPromise}(Wt,kr)}function rn(){return function(kr){var br=kr._transformStreamController;if(br._finishPromise!==void 0)return br._finishPromise;var qr=kr._readable;br._finishPromise=tt(function(Hr,nn){br._finishPromise_resolve=Hr,br._finishPromise_reject=nn});var Ar=br._flushAlgorithm();return wo(br),xt(Ar,function(){return qr._state==="errored"?Dn(br,qr._storedError):(An(qr._readableStreamController),Bo(br)),null},function(Hr){return fn(qr._readableStreamController,Hr),Dn(br,Hr),null}),br._finishPromise}(Wt)}function Lr(){return function(kr){return yo(kr,!1),kr._backpressureChangePromise}(Wt)}function jr(kr){return function(br,qr){var Ar=br._transformStreamController;if(Ar._finishPromise!==void 0)return Ar._finishPromise;var Hr=br._writable;Ar._finishPromise=tt(function(Zr,Ho){Ar._finishPromise_resolve=Zr,Ar._finishPromise_reject=Ho});var nn=Ar._cancelAlgorithm(qr);return wo(Ar),xt(nn,function(){return Hr._state==="errored"?Dn(Ar,Hr._storedError):(Wn(Hr._writableStreamController,qr),Fo(br),Bo(Ar)),null},function(Zr){return Wn(Hr._writableStreamController,Zr),Fo(br),Dn(Ar,Zr),null}),Ar._finishPromise}(Wt,kr)}Wt._writable=function(kr,br,qr,Ar,Hr,nn){Hr===void 0&&(Hr=1),nn===void 0&&(nn=function(){return 1});var Zr=Object.create(vn.prototype);return ts(Zr),ls(Zr,Object.create(Cn.prototype),kr,br,qr,Ar,Hr,nn),Zr}(Yr,Ir,rn,tn,Ur,Vr),Wt._readable=Kn(Yr,Lr,jr,on,Qr),Wt._backpressure=void 0,Wt._backpressureChangePromise=void 0,Wt._backpressureChangePromise_resolve=void 0,yo(Wt,!0),Wt._transformStreamController=void 0})(this,tt(function(Wt){At=Wt}),Kt,dr,Nt,Qt),function(Wt,pr){var Ur,Vr,on,Qr=Object.create(wn.prototype);Ur=pr.transform!==void 0?function(Yr){return pr.transform(Yr,Qr)}:function(Yr){try{return Ps(Qr,Yr),nt(void 0)}catch(Ir){return ot(Ir)}},Vr=pr.flush!==void 0?function(){return pr.flush(Qr)}:function(){return nt(void 0)},on=pr.cancel!==void 0?function(Yr){return pr.cancel(Yr)}:function(){return nt(void 0)},function(Yr,Ir,tn,rn,Lr){Ir._controlledTransformStream=Yr,Yr._transformStreamController=Ir,Ir._transformAlgorithm=tn,Ir._flushAlgorithm=rn,Ir._cancelAlgorithm=Lr,Ir._finishPromise=void 0,Ir._finishPromise_resolve=void 0,Ir._finishPromise_reject=void 0}(Wt,Qr,Ur,Vr,on)}(this,jt),jt.start!==void 0?At(jt.start(this._transformStreamController)):At(void 0)}return Object.defineProperty(_.prototype,"readable",{get:function(){if(!Ts(this))throw $s("readable");return this._readable},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"writable",{get:function(){if(!Ts(this))throw $s("writable");return this._writable},enumerable:!1,configurable:!0}),_}();function Ts(_){return!!it(_)&&!!Object.prototype.hasOwnProperty.call(_,"_transformStreamController")&&_ instanceof Xn}function As(_,rt){fn(_._readable._readableStreamController,rt),Lo(_,rt)}function Lo(_,rt){wo(_._transformStreamController),Wn(_._writable._writableStreamController,rt),Fo(_)}function Fo(_){_._backpressure&&yo(_,!1)}function yo(_,rt){_._backpressureChangePromise!==void 0&&_._backpressureChangePromise_resolve(),_._backpressureChangePromise=tt(function(ct){_._backpressureChangePromise_resolve=ct}),_._backpressure=rt}Object.defineProperties(Xn.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),typeof a.toStringTag=="symbol"&&Object.defineProperty(Xn.prototype,a.toStringTag,{value:"TransformStream",configurable:!0});var wn=function(){function _(){throw new TypeError("Illegal constructor")}return Object.defineProperty(_.prototype,"desiredSize",{get:function(){if(!vo(this))throw bo("desiredSize");return Mo(this._controlledTransformStream._readable._readableStreamController)},enumerable:!1,configurable:!0}),_.prototype.enqueue=function(rt){if(rt===void 0&&(rt=void 0),!vo(this))throw bo("enqueue");Ps(this,rt)},_.prototype.error=function(rt){if(rt===void 0&&(rt=void 0),!vo(this))throw bo("error");var ct;ct=rt,As(this._controlledTransformStream,ct)},_.prototype.terminate=function(){if(!vo(this))throw bo("terminate");(function(rt){var ct=rt._controlledTransformStream;An(ct._readable._readableStreamController);var yt=new TypeError("TransformStream terminated");Lo(ct,yt)})(this)},_}();function vo(_){return!!it(_)&&!!Object.prototype.hasOwnProperty.call(_,"_controlledTransformStream")&&_ instanceof wn}function wo(_){_._transformAlgorithm=void 0,_._flushAlgorithm=void 0,_._cancelAlgorithm=void 0}function Ps(_,rt){var ct=_._controlledTransformStream,yt=ct._readable._readableStreamController;if(!Mn(yt))throw new TypeError("Readable side is not in a state that permits enqueue");try{In(yt,rt)}catch(Tt){throw Lo(ct,Tt),ct._readable._storedError}var St=function(Tt){return!xs(Tt)}(yt);St!==ct._backpressure&&yo(ct,!0)}function Ns(_,rt){return Rt(_._transformAlgorithm(rt),void 0,function(ct){throw As(_._controlledTransformStream,ct),ct})}function bo(_){return new TypeError("TransformStreamDefaultController.prototype.".concat(_," can only be used on a TransformStreamDefaultController"))}function Bo(_){_._finishPromise_resolve!==void 0&&(_._finishPromise_resolve(),_._finishPromise_resolve=void 0,_._finishPromise_reject=void 0)}function Dn(_,rt){_._finishPromise_reject!==void 0&&(Bt(_._finishPromise),_._finishPromise_reject(rt),_._finishPromise_resolve=void 0,_._finishPromise_reject=void 0)}function $s(_){return new TypeError("TransformStream.prototype.".concat(_," can only be used on a TransformStream"))}Object.defineProperties(wn.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),lt(wn.prototype.enqueue,"enqueue"),lt(wn.prototype.error,"error"),lt(wn.prototype.terminate,"terminate"),typeof a.toStringTag=="symbol"&&Object.defineProperty(wn.prototype,a.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});var Uo={ReadableStream:Xr,ReadableStreamDefaultController:xn,ReadableByteStreamController:an,ReadableStreamBYOBRequest:un,ReadableStreamDefaultReader:Fr,ReadableStreamBYOBReader:yn,WritableStream:vn,WritableStreamDefaultController:Cn,WritableStreamDefaultWriter:gn,ByteLengthQueuingStrategy:Qn,CountQueuingStrategy:Jn,TransformStream:Xn,TransformStreamDefaultController:wn};if(ho!==void 0)for(var qo in Uo)Object.prototype.hasOwnProperty.call(Uo,qo)&&Object.defineProperty(ho,qo,{value:Uo[qo],writable:!0,configurable:!0});s.ByteLengthQueuingStrategy=Qn,s.CountQueuingStrategy=Jn,s.ReadableByteStreamController=an,s.ReadableStream=Xr,s.ReadableStreamBYOBReader=yn,s.ReadableStreamBYOBRequest=un,s.ReadableStreamDefaultController=xn,s.ReadableStreamDefaultReader=Fr,s.TransformStream=Xn,s.TransformStreamDefaultController=wn,s.WritableStream=vn,s.WritableStreamDefaultController=Cn,s.WritableStreamDefaultWriter=gn})}(polyfill_min,polyfill_min.exports)),polyfill_min.exports}var __importDefault$1=commonjsGlobal&&commonjsGlobal.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(Streams$1,"__esModule",{value:!0});Streams$1.ModuleOptions=Streams$1.Streams=void 0;const Exceptions_1$1=__importDefault$1(Exceptions),helpers_1$3=helpers,defaultStreamOptions={headers:{},onProgress:null,method:"GET",encoding:"utf-8",body:null,useEventBuffering:!1};class Streams{constructor(e){this.options=e,this.options={...new ModuleOptions$1,...e}}static async pipeReaderToWriter(e,s){const a=new TextEncoder;for(;;){const{value:c,done:d}=await e.read(),h=a.encode(c);if(await s.write(h),d)break}s.close()}static async readStreamToString(e){const s=e.getReader(),a=[];for(;;){const{done:b,value:j}=await s.read();if(b)break;a.push(j)}const c=new Uint8Array(a.reduce((b,j)=>b+j.length,0));let d=0;for(const b of a)c.set(b,d),d+=b.length;return new TextDecoder().decode(c)}static async asyncIterableToStream(e,s,a){typeof TransformStream>"u"&&(commonjsGlobal.TransformStream=requirePolyfill_min().TransformStream);let{readable:c,writable:d}=new TransformStream,h=d.getWriter();const b=new TextEncoder;let j="";return e.then(async $=>{try{for await(const _e of $){let it=s?s(_e)||"":_e.toString();j+=it,h.write(b.encode(it))}}catch(_e){h.write(b.encode("Error while iterating: "+_e))}}).catch($=>{h.write(b.encode("Error in completion: "+$))}).finally(async()=>{h.close(),a&&a(j)}),c}static async getStream(e,s,a=defaultStreamOptions){const c=helpers_1$3.helpers.newPromise();return(async()=>{var d,h,b;try{a.body!=null&&((a.method==null||a.method=="GET")&&(a.method="POST"),((d=a.headers)===null||d===void 0?void 0:d["Content-Type"])==null&&(a.headers={"Content-Type":"application/json; charset=UTF-8",...a.headers}));const j=await fetch(e,{headers:a.headers,body:JSON.stringify(a.body),method:a.method});if(!j.ok)return c.reject(new Exceptions_1$1.default(`getStream: HTTP error! Status: ${j.status}`,await j.text()));let $="";const _e=new TextDecoder((h=a.encoding)!==null&&h!==void 0?h:defaultStreamOptions.encoding),it=j.body.getReader();let at="";for(;;){const{done:lt,value:dt}=await it.read();if(lt){a.useEventBuffering&&(s==null||s(at)),c.resolve($);break}const mt=_e.decode(dt);if(a.useEventBuffering&&!(mt.startsWith("event: ")&&at.length>0)){at+=mt;continue}a.useEventBuffering?s==null||s(at):s==null||s(mt),$+=mt,(b=a.onProgress)===null||b===void 0||b.call(a,$),at=mt}}catch(j){c.reject(Exceptions_1$1.default.fromError(j))}})(),c}}Streams$1.Streams=Streams;let ModuleOptions$1=class{};Streams$1.ModuleOptions=ModuleOptions$1;(function(o){var e=commonjsGlobal&&commonjsGlobal.__importDefault||function(mt){return mt&&mt.__esModule?mt:{default:mt}};Object.defineProperty(o,"__esModule",{value:!0}),o.network=o.Network=void 0;const s=e(require$$2),a=e(require$$2),c=e(require$$2),d=e(axios),h=e(browser$1),b=helpers,j=dependencyInjector,$=buffer,_e=log$5,it=requireObjectHelpers(),at=Streams$1;class lt{constructor(){this.url=c.default,this.helper=new dt,this.httpGetJson=async(vt,tt={})=>{let nt={"content-type":"application/json; charset=UTF-8"};tt.cors&&(nt=null),tt=it.objectHelpers.merge({},tt,{headers:nt,enc:"utf-8"});let ot=await this.httpGet(vt,tt);return JSON.parse(ot)},this.httpGetString=async(vt,tt={})=>(tt=it.objectHelpers.merge({},tt,{enc:"utf-8"}),(await this.httpGet(vt,tt)).toString()),this.httpGet=async(vt,tt={})=>await this.httpRequest(vt,null,"GET",tt),this.httpPost=async(vt,tt,nt={})=>await this.httpRequest(vt,tt,"POST",nt),this.httpPostJson=async(vt,tt,nt={})=>{let ot=await this.httpRequest(vt,tt,"POST",nt);return ot==null?null:JSON.parse(ot.toString())},this.httpRequest=async(vt,tt,nt,ot={})=>{var ht=b.helpers.newPromise();vt=this.helper.fixUrl(vt);var xt=this.helper.parseUrl(vt),Et={headers:{Accept:"*/*"},cors:!1,enc:null,method:nt||"GET",withCredentials:!1,dataType:"json",autoParse:!1,formData:null};it.objectHelpers.clone(ot,Et),it.objectHelpers.clone(xt,Et),Et.dataType!=null&&Et.headers["content-type"]==null&&(Et.dataType=="json"&&!Et.cors?Et.headers["content-type"]="application/json; charset=UTF-8":Et.dataType=="formData"&&(Et.headers["content-type"]="multipart/form-data"));var _t=s.default;xt.protocol=="https:"&&(_t=a.default),Et.dataType=="formData"&&(Et.formData=tt);var Rt=_t.request(Et,Mt=>{Et.enc&&Mt.setEncoding(Et.enc);var Ht=[];Mt.on("data",function(er){Ht.push($.Buffer.from(er))}),Mt.on("end",function(){let er=null;if(Ht!=null&&(Ht.length==1?er=Ht[0]:er=$.Buffer.concat(Ht)),Mt.statusCode==200)return ht.resolve(er);ht.reject({statusCode:Mt.statusCode,response:er.toString()})})});if(tt!=null){var Bt=tt;Et.dataType=="json"&&(Bt=JSON.stringify(tt),Rt.write(Bt))}return Rt.on("error",function(Mt){_e.log.error(Mt.message),ht.reject(Mt)}),Rt.end(),ht},this.request=async(vt,tt,nt=null,ot=null,ht={})=>{let xt=b.helpers.newPromise(),Et={method:vt};return tt=this.helper.fixUrl(tt),ht=it.objectHelpers.merge(ht,Et,{url:tt}),ht.data=ot,ht.responseType==null&&(ht.responseType="arraybuffer"),(0,d.default)(ht).then(_t=>{xt.resolve(_t.data)}).catch(_t=>xt.reject(_t)),xt},this.get=async(vt,tt=null,nt={})=>{if(tt!=null){let ot=!vt.contains("?"),ht=this.helper.toQueryString(tt,!ot);vt+=ot?ht:"&"+ht}return nt=it.objectHelpers.merge(nt,{url:vt}),await this.request("GET",vt,tt,null,nt)},this.post=async(vt,tt=null,nt={})=>(b.helpers.newPromise(),nt=it.objectHelpers.merge(nt,{url:vt}),await this.request("POST",vt,null,tt,nt)),this.upload=async(vt,tt,nt={})=>{let ot=b.helpers.newPromise(),ht=new h.default;if(ht.append("file",tt),nt.data!=null){let xt=it.objectHelpers.getCustomProperties(nt.data);for(let Et of xt)ht.append(Et,nt.data[Et])}return d.default.create({headers:ht.getHeaders()}).post(vt,ht).then(xt=>{ot.resolve(xt.data)}).catch(xt=>ot.reject(xt)),ot},this.getStream=at.Streams.getStream}}o.Network=lt;class dt{constructor(){this.toQueryString=(vt,tt=!1)=>b.helpers.querialize(vt,tt)}fixUrl(vt,tt){var nt="://",ot=vt.indexOf(nt);if(ot>-1){var ht=vt.slice(0,ot),xt=vt.slice(ot+3);xt=xt.replace(/([^:]\/)\/+/g,"$1"),vt=ht+nt+xt}else vt=vt.replace(/([^:]\/)\/+/g,"$1");tt=tt||"";var Et=ot>-1;return vt=this.cleanUrl((Et?"":tt)+vt),vt}parseUrl(vt){return c.default.parse(vt)}cleanUrl(vt){return vt==null?null:vt.replace(new RegExp("([^:]/)/+","g"),"$1")}}o.network=new lt,j.di.register("network",o.network)})(Network);Object.defineProperty(browserHelpers,"__esModule",{value:!0});browserHelpers.browserHelpers=browserHelpers.BrowserHelpers=void 0;const helpers_1$2=helpers,MyLodash_1=MyLodash$1,ObjectHelpers_1$3=requireObjectHelpers(),log_1$3=log$5,Network_1=Network;class BrowserHelpers{constructor(){this.isiOS=()=>/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,this.urlize=function(e){var s="";for(var a in e)e[a]!=null&&(s!=""&&(s+="&"),s+=a+"="+encodeURIComponent(e[a]));return s},this.cleanUrl=function(e){return e==null?null:e.replace(new RegExp("([^:]/)/+","g"),"$1")},this.querialize=function(e,s){if(e==null||e.length<1)return null;var a=[];for(var c in e)e.hasOwnProperty(c)&&a.push(encodeURIComponent(c)+"="+encodeURIComponent(e[c]));return(s?"":"?")+a.join("&")},this.injectScript=function(e,s,a=document,c={}){var d=a.getElementsByTagName("head")[0],h=a.createElement("script");for(let b of Object.keys(c))h.setAttribute(b,c[b]);h.type="text/javascript",h.onreadystatechange=function(){this.readyState=="complete"&&s(e)},h.onload=s,h.src=e,d.appendChild(h)},this.injectCss=function(e,s=document){var a=s.createElement("link");a.setAttribute("rel","stylesheet"),a.setAttribute("type","text/css"),a.setAttribute("href",e),typeof a<"u"&&s.getElementsByTagName("head")[0].appendChild(a)},this.reload=()=>{window.location.reload()},this.events={subscribe:(e,s)=>{document.addEventListener(e,s)},broadcast:e=>{var s=document.createEvent("Event");s.initEvent(e),document.dispatchEvent(s)}},this.messages={subscribe:(e,s)=>{document.addEventListener(e,function(a){s(a.detail.message)})},broadcast:(e,s)=>{var a=new CustomEvent(e,{detail:{message:s}});document.dispatchEvent(a)}},this.uploadFile=function(e,s,a){var c=new FormData;c.append("file",s[0]),c.append("destFolder","cvs"),Network_1.network.httpPost("api/uploadFile",c,{withCredentials:!0,headers:{"Content-Type":void 0,destFolder:e}}).then(function(d){log_1$3.log.verbose("uploadFile:success",d),a(s[0],d)}).catch(function(d){log_1$3.log.error("File upload failed!",d)})},this.isIframe=function(){try{return window.self!==window.top}catch{return!0}},this.copyToClipboard=e=>{let s,a,c=helpers_1$2.helpers.newPromise();function d(){return navigator.userAgent.match(/ipad|iphone/i)}function h($){s=document.createElement("textArea"),s.value=$,document.body.appendChild(s)}function b(){var $,_e;d()?($=document.createRange(),$.selectNodeContents(s),_e=window.getSelection(),_e.removeAllRanges(),_e.addRange($),s.setSelectionRange(0,999999)):s.select()}function j(){document.execCommand("copy"),document.body.removeChild(s)}return a=function($){h($),b(),j(),c.resolve($)},a(e),c},this.getHost=function(e){var s=e||location.href,a;return s.indexOf("://")>-1?a=s.split("/")[2]:a=s.split("/")[0],a=a.split("?")[0],s.substr(0,s.indexOf("://")+3)+a+"/"},this.getParameters=function(e){return e==null&&(e=location.search),e.startsWith("?")||(e="?"+e),e=e.replace(/(?![?&])([^=&?]+)(\=)?([^&]+)?/g,"$1=$3"),e=e.substring(1),e==null||e==""?{}:JSON.parse('{"'+decodeURI(e).replace(/\"/g,'\\"').replace(/&/g,'","').replace(/=/g,'":"')+'"}')},this.getAttributes=function(e,s){var a={};return jQuery.each(e[0].attributes,function(c,d){var h=d.name;if(s!=null){var b=h.match(s);if(b==null)return;h=b[1]}h=h.replace("-","_"),a[h]=d.value}),a},this.getSubDomain=()=>{var e=window.location.host.split(".");return e.length>2?e[0]:null},this.getDomain=()=>{var e=window.location.host.split(".");return e.length>2?e[1]:e.length>1?e[0]:null},this.localDownload=(e,s,a="data:text/plain;charset=utf-8")=>{var c=a+","+e,d=document.createElement("a");d.href=c,d.download=s,document.body.appendChild(d),d.click(),document.body.removeChild(d)},this.localDownloadBlob=(e,s,a="octet/stream;charset=utf-8")=>{var c=document.createElement("a");document.body.appendChild(c),c.style="display: none",ObjectHelpers_1$3.objectHelpers.isObject(e)&&(e=JSON.stringify(e));var d=new Blob([e],{type:a}),h=window.URL.createObjectURL(d);c.href=h,c.download=s,c.click(),window.URL.revokeObjectURL(h)},this.jQueryExt={setup:function(e){e.postJson=function(s,a){var c=e.ajax({url:s,type:"POST",dataType:"json",data:JSON.stringify(a),contentType:"application/json; charset=utf-8"});return c},e.getJson=function(s){for(var a=[],c=0;c<arguments.length-1;c++)a[c]=arguments[c+1];var d=s.format(a);return e.when(e.getJSON(d))},e.getJsonSync=function(s){for(var a=[],c=0;c<arguments.length-1;c++)a[c]=arguments[c+1];var d=s.format(a),h=e.ajax({url:d,type:"GET",async:!1,cache:!1,dataType:"json",contentType:"application/json; charset=utf-8"});return e.when(h)},e.expr[":"].hasText=function(s,a,c){return s.textContent.trim()==c[3]}},applyReveal:function(){jQuery().viewportChecker!=null&&(jQuery("[reveal-reset]").viewportChecker({classToAdd:"visible animated",removeClassAfterAnimation:!1,repeat:!0,offset:"10%",callbackFunction:function(e,s){var a=jQuery(e);s=="add"?a.addClass(a.attr("reveal-reset")):a.removeClass(a.attr("reveal-reset"))}}),jQuery("[reveal]").viewportChecker({classToAdd:"visible animated",removeClassAfterAnimation:!1,offset:"10%",callbackFunction:function(e,s){var a=jQuery(e);s=="add"?a.addClass(a.attr("reveal")):a.removeClass(a.attr("reveal"))}}))}},this.getImageMeta=function(e){var s=helpers_1$2.helpers.newPromise(),a=new Image;return a.addEventListener("load",function(){s.resolve({width:this.naturalWidth,height:a.naturalHeight})}),a.src=e,s.promise()},this.imgToBase64=async(e,s=null)=>{var a=helpers_1$2.helpers.newPromise(),c=new Image;return c.crossOrigin="Anonymous",c.onload=function(){var d=document.createElement("CANVAS"),h=d.getContext("2d"),b;d.height=c.naturalHeight,d.width=c.naturalWidth,h.drawImage(this,0,0),b=d.toDataURL(s),a.resolve(b)},c.src=e,(c.complete||c.complete===void 0)&&(c.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==",c.src=e),a.promise()},this.queryString=function(e,s=window.location.href){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var a="[\\?&]"+e+"=([^&#]*)",c=new RegExp(a),d=c.exec(s);return d==null?"":decodeURIComponent(d[1].replace(/\+/g," "))},this.getIdFromUrl=function(){var e=window.location.pathname.match(/\/(\d*)$/);return e==null||e.length<2?null:parseInt(e[1])},this.ScreenSize={xs:"xs",sm:"sm",md:"md",lg:"lg",xl:"xl"},helpers_1$2.helpers.isBrowser&&(typeof jQuery<"u"?jQuery(document).ready(function(){this.jQueryExt.applyReveal()}):log_1$3.log&&log_1$3.log.debug("helpers: jQuery is not defined, skipping jQuery libx setup..."),console&&(console.watch=this.watch))}enableLogDisplay(){let e=document.querySelector("#log");e==null&&alert("app.enableLogDisplay: Could not find #log!"),["log","warn","error"].forEach(function(s){console[s]=function(a,c,d){return function(h){a(MyLodash_1.MyLodash.join(arguments,""));var b=document.createElement("code");b.style="display:block;",b.classList.add(c),b.textContent=c+": "+MyLodash_1.MyLodash.join(arguments,""),d.appendChild(b),d.scrollTo(0,d.scrollHeight)}}(console[s].bind(console),s,e)})}watch(e,s){var a="$_"+s+"_$";e[a]=e[s],Object.defineProperty(e,s,{get:function(){return e[a]},set:function(c){debugger;e[a]=c}})}isRTL(e){return/[\u0590-\u05FF\u0600-\u06FF\u0680-\u06FF\u0700-\u074F\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDCF\uFDF0-\uFDFF\uFE70-\uFEFF\u200F]/.test(e)}applyAutoDir(e=".auto-dir",s=!1,a=1){setTimeout(()=>{const c=helpers_1$2.helpers.Measurement.start();document.querySelectorAll(e).forEach(h=>{let b=h.value;if(ObjectHelpers_1$3.objectHelpers.isEmptyString(h.textContent)||(b=h.textContent),ObjectHelpers_1$3.objectHelpers.isEmptyString(b)&&(b=h.placeholder),!this.isRTL(b)){s&&h.setAttribute("dir","ltr");return}h.setAttribute("dir","rtl")}),log_1$3.log.debug(`browserHelpers:applyAutoDir: dur: ${c.peek()}ms`)},a)}applyAutoDirDebounced(e=100,s=".auto-dir",a=!0){return helpers_1$2.helpers.debounce(()=>{this.applyAutoDir(s,a)},e)}getScreenSize(){const e=window.innerWidth;return e<=599?this.ScreenSize.xs:e<=959?this.ScreenSize.sm:e<=1279?this.ScreenSize.md:e<=1919?this.ScreenSize.lg:this.ScreenSize.xl}async resizeImageFile(e,s,a="#111",c="image/jpeg"){if(!e.type.match(/image.*/))throw new Error("Not an image");const d=new FileReader,h=helpers_1$2.helpers.newPromise();d.onload=$=>{try{h.resolve($.target.result)}catch(_e){h.reject(_e)}},d.readAsDataURL(e);const b=await h,j=await this.resizeImage(b,s,a,c);return helpers_1$2.helpers.dataURItoBlob(j)}async resizeImage(e,s,a="#111",c="image/jpeg",d=.85){const h=new Image,b=document.createElement("canvas"),j=()=>{let _e=h.width,it=h.height;log_1$3.log.verbose(`browserHelpers:resizeImage: Original dimensions: ${_e}x${it}`),_e>it?_e>s&&(it*=s/_e,_e=s):it>s&&(_e*=s/it,it=s),log_1$3.log.verbose(`browserHelpers:resizeImage: Target dimensions: ${Math.round(_e)}x${Math.round(it)}`),b.width=_e,b.height=it;const at=b.getContext("2d");at.fillStyle=a,at.fillRect(0,0,_e,it),at.drawImage(h,0,0,_e,it);const lt=b.toDataURL(c,d),dt=lt.length*2/1024;return log_1$3.log.verbose(`browserHelpers:resizeImage: Result size: ${dt.toFixed(0)}KB`),lt},$=helpers_1$2.helpers.newPromise();return h.onload=()=>{try{const _e=j();$.resolve(_e)}catch(_e){log_1$3.log.error("browserHelpers:resizeImage: Error during resize:",_e),$.reject(_e)}},h.onerror=_e=>{log_1$3.log.error("browserHelpers:resizeImage: Image load error:",_e),$.reject(_e)},h.crossOrigin="anonymous",h.src=e,await $}async copyOrDownloadCanvas(e,s){if(!/Mobile|Android|iPhone|iPad|iPod/i.test(navigator.userAgent))await this.copyCanvasToClipboard(e);else try{const c=helpers_1$2.helpers.newPromise();await e.toBlob(h=>c.resolve(h));const d=await c;this.localDownloadBlob(d,`${s}.png`)}catch(c){throw log_1$3.log.error("browserHelpers:copyOrDownloadCanvas: Failed to download as file!",c)}}async copyCanvasToClipboard(e){try{if(!await this.askClipboardWritePermission())throw new Error("Don't have permissions to copy");const a=helpers_1$2.helpers.newPromise();await e.toBlob(d=>a.resolve(d));const c=await a;await this.writeToClipboard(c),log_1$3.log.info("browserHelpers:copyCanvasToClipboard: Copied!")}catch(s){throw log_1$3.log.error("browserHelpers:copyCanvasToClipboard: Failed! Error:",(s==null?void 0:s.message)||s)}}async writeToClipboard(e){const s=[new ClipboardItem({[e.type]:e})];await navigator.clipboard.write(s)}async askClipboardWritePermission(){try{const{state:e}=await navigator.permissions.query({name:"clipboard-write"});return e==="granted"}catch{return!1}}async fileToAudio(e){const s=new Audio;s.src=URL.createObjectURL(e);const a=helpers_1$2.helpers.newPromise();return s.onloadedmetadata=()=>a.resolve(s),s.onerror=c=>a.reject(c),a}getMediaSource(){if("ManagedMediaSource"in window)return new window.ManagedMediaSource;if("MediaSource"in window)return new MediaSource;throw new Error("MediaSource API is not supported on this device.")}base64ToMP3(e,s="audio.mp3"){const a=atob(e),c=[];for(let j=0;j<a.length;j+=512){const $=a.slice(j,j+512),_e=new Array($.length);for(let it=0;it<$.length;it++)_e[it]=$.charCodeAt(it);c.push(new Uint8Array(_e))}const d=new Blob(c,{type:"audio/mp3"}),h=URL.createObjectURL(d),b=document.createElement("a");b.href=h,b.download=s,document.body.appendChild(b),b.click(),document.body.removeChild(b),URL.revokeObjectURL(h)}blur(){var e;(e=document.activeElement)===null||e===void 0||e.blur()}decodeHTMLEntities(e){const s=document.createElement("textarea");return s.innerHTML=e,s.value}scrollTo(e,s){const{double:a=!1,smooth:c=!0}=s||{},d=document.querySelector(e);return d?(d.scrollIntoView({behavior:c?"smooth":"auto",block:"start"}),a&&setTimeout(()=>{d.scrollIntoView({behavior:c?"smooth":"auto",block:"start"})},1e3),d):null}showModal(e){var s;(s=document.getElementById(e))===null||s===void 0||s.showModal()}closeModal(e){var s;(s=document.getElementById(e))===null||s===void 0||s.close()}autoGrowTextarea(e){const s=e.target,a=120;s.style.height="auto",s.scrollHeight>a?s.style.height=a+"px":s.style.height=s.scrollHeight+"px"}getPageMetadata(){const e={title:document.title,description:"",ogImage:""},s=document.getElementsByTagName("meta");for(let a of s)a.getAttribute("name")==="description"?e.description=a.getAttribute("content")||"":a.getAttribute("property")==="og:image"&&(e.ogImage=a.getAttribute("content")||"");return e}getReferrer(){const e=document.referrer;if(!e)return"";try{return new URL(e).hostname.replace(/^www\./,"")}catch{return""}}}browserHelpers.BrowserHelpers=BrowserHelpers;browserHelpers.browserHelpers=new BrowserHelpers;var ImageCompressor$1={};Object.defineProperty(ImageCompressor$1,"__esModule",{value:!0});ImageCompressor$1.ImageCompressorOptions=ImageCompressor$1.ImageCompressor=void 0;class ImageCompressor{constructor(e){this.options={...new ImageCompressorOptions,...e}}static fitToMaxEdge(e,s,a){const c=Math.min(1,a/Math.max(e,s));return{width:Math.max(1,Math.round(e*c)),height:Math.max(1,Math.round(s*c)),scale:c}}static qualityLadder(e,s,a){const c=[];for(let d=e;d>s+1e-9;d-=a)c.push(Math.round(d*100)/100);return c.push(Math.round(s*100)/100),c}static dataUrlBytes(e){const s=e.indexOf(","),a=s>=0?e.slice(s+1):e;let c=0;return a.endsWith("==")?c=2:a.endsWith("=")&&(c=1),Math.floor(a.length*3/4)-c}static pickMime(e,s){for(const a of e)if(s(a))return a;return"image/jpeg"}static isWorthStep(e,s,a){return e<=0?!0:(e-s)/e>=a}static selectQuality(e,s,a){let c=null;for(const d of e){const h=s(d);if(a.targetBytes!=null){if(h<=a.targetBytes)return{quality:d,bytes:h};c={quality:d,bytes:h};continue}if(c&&!ImageCompressor.isWorthStep(c.bytes,h,a.minGainRatio))return c;c={quality:d,bytes:h}}return c}async compress(e){const s=this.options,a=await this._decode(e),{width:c,height:d}=ImageCompressor.fitToMaxEdge(a.width,a.height,s.maxEdge),h=document.createElement("canvas");h.width=c,h.height=d,h.getContext("2d").drawImage(a,0,0,c,d);const b=ImageCompressor.pickMime(s.mimePreference,mt=>h.toDataURL(mt,.5).startsWith(`data:${mt}`)),j=ImageCompressor.qualityLadder(s.maxQuality,s.minQuality,s.qualityStep),$=new Map,_e=mt=>($.has(mt)||$.set(mt,h.toDataURL(b,mt)),$.get(mt)),{quality:it,bytes:at}=ImageCompressor.selectQuality(j,mt=>ImageCompressor.dataUrlBytes(_e(mt)),{targetBytes:s.targetBytes,minGainRatio:s.minGainRatio}),dt={dataUrl:_e(it),mime:b,quality:it,width:c,height:d,bytes:at};return s.outputBlob&&(dt.blob=await new Promise((mt,vt)=>h.toBlob(tt=>tt?mt(tt):vt(new Error("ImageCompressor: encode to blob failed")),b,it))),dt}async _decode(e){const s=typeof e=="string"?e:URL.createObjectURL(e);try{return await new Promise((a,c)=>{const d=new Image;d.onload=()=>a(d),d.onerror=()=>c(new Error("ImageCompressor: image decode failed")),d.src=s})}finally{typeof e!="string"&&URL.revokeObjectURL(s)}}}ImageCompressor$1.ImageCompressor=ImageCompressor;class ImageCompressorOptions{constructor(){this.maxEdge=1800,this.mimePreference=["image/webp","image/jpeg"],this.maxQuality=.85,this.minQuality=.5,this.qualityStep=.07,this.minGainRatio=.15,this.outputBlob=!1}}ImageCompressor$1.ImageCompressorOptions=ImageCompressorOptions;function commonjsRequire(o){throw new Error('Could not dynamically require "'+o+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var require$1={};Object.defineProperty(require$1,"__esModule",{value:!0});const req=function(){if(typeof window>"u")return commonjsRequire;var mod={};return function(o){var e=function(lt,dt,mt){this.name="RequireError",this.message=lt};e.prototype=Object.create(Error.prototype),typeof new Error().fileName=="string"&&self.addEventListener("error",function(lt){if(lt.error instanceof Error){if(s[0])throw lt.preventDefault(),new lt.error.constructor(lt.error.message,s[0].uri,lt.error.lineNumber);var dt=lt.error.stack.match(/^[^\n@]*@([^\n]+):\d+:\d+/);if(dt===null)console.warn("libx.browser.require: unable to read file name from stack");else if(lt.error.fileName!=dt[1])throw lt.preventDefault(),new lt.error.constructor(lt.error.message,dt[1],lt.error.lineNumber)}},!1);var s=Array(),a=URL?new URL(location.href):document.createElement("A");try{var c=new Object;Object.defineProperty(c,"foo",{value:"bar",configurable:!0}),delete c.foo}catch(lt){console.warn("Falling back to DOM workaround for defineProperty: "+lt),c=document.createElement("DIV")}for(var d=new Object,h=mod&&mod.requirePath!==void 0?mod.requirePath.slice(0):["./"],b=mod&&mod.requireCompiler!==void 0?mod.requireCompiler:null,j=[location.origin,location.href.substr(0,location.href.lastIndexOf("/")+1)],$=0;$<h.length;$++)a.href=(h[$][0]=="."?j[1]:j[0])+h[$],h[$]=a.href;for(var _e in mod&&mod.requirePreloaded)c["$"+at(_e).id]=mod.requirePreloaded[_e].toString();for(var _e in mod&&mod.requireOverrides)c["$"+at(_e).id]=mod.requireOverrides[_e];mod=async function(lt,dt,mt){return new Promise((vt,tt)=>{if(lt instanceof Array){for(var nt=new Array,ot=lt.length,ht=0;ht<lt.length;ht++)(function(Bt,Mt){nt.push(mod(Bt,dt&&function(Ht){nt[Mt]=Ht,--ot==0&&dt(nt)},mt))})(lt[ht],ht);return nt}mt=mt!==void 0?mt:b;var xt=at(lt),Et="$"+xt.id;if(c[Et])return typeof c[Et]=="string"&&o(xt,c,s,c[Et]),dt&&setTimeout(function(){dt(c[Et])},0),vt(c[Et]);var _t=new XMLHttpRequest;dt&&(_t[_t.onload===null?"onload":"onreadystatechange"]=Rt),_t.addEventListener("load",Rt),_t.open("GET",xt.uri,!0),d[Et]=d[Et]++||1,_t.send(),!dt&&Rt();function Rt(){try{if(_t.readyState!=4)return;if(_t.status!=200&&new e("unable to load "+xt.id+" ("+_t.status+" "+_t.statusText+")"),_t.status==200&&d[Et]--,d[Et]){if(console.warn("module locked: "+xt.id),d[Et]<=5)return;dt&&setTimeout(Rt,0);return}if(!c[Et]){var Bt=mt?mt(_t.responseText):_t.responseText;o(xt,c,s,Bt,typeof dt=="boolean")}!dt&&Rt(),dt&&dt(c[Et]),vt(c[Et])}catch(Mt){tt(Mt)}}})};function it(lt){var dt=lt.startsWith("//"),mt=lt.replace(/[\/]+/g,"/").replace(":/","://");return dt&&(mt=mt.replace(/^\//,"//")),mt}function at(lt){if(lt.indexOf("http://")==0||lt.indexOf("https://")==0||lt.indexOf("//")==0||lt.indexOf("://")!=-1)return{id:lt,uri:it(lt)};if(lt.indexOf("/")==0){var vt=h[0].substr(0,h[0].indexOf("/",h[0].indexOf("://")+3));return{id:lt,uri:it(vt+"/"+lt)}}return{id:lt,uri:it(lt)};var dt,mt,vt}if(mod===void 0)try{Object.defineProperty("require",{value:mod}),Object.defineProperty(mod,"resolve",{value:at}),Object.defineProperty(mod,"path",{get:function(){return h.slice(0)}})}catch{mod.resolve=at,mod.path=h.slice(0)}}(function(module){var global=self,exports=new Object;Object.defineProperty(module,"exports",{get:function(){return exports},set:function(o){exports=o}}),arguments[2].unshift(module),Object.defineProperty(arguments[1],"$"+module.id,{get:function(){return exports}});var content=arguments[3],isNotModule=arguments[4];if(isNotModule===!0)eval(content);else{var extra='var __moduleUri = "'+module.uri+`";
`;module.uri.endsWith(".js")||(content="module.exports = "+content);var script=`function(){
`+extra+content+`
}`;let wrapper="("+script+`)();
//# sourceURL=`+module.uri;eval(wrapper)}if(typeof module.id!="string")for(id in module)arguments[1]["$"+mod.resolve(id).id]=module[id].toString();arguments[2].shift()}),mod}();window.libx==null&&(window.libx={});window.libx.require=req;require$1.default=req;var __spreadArray=function(o,e,s){if(s||arguments.length===2)for(var a=0,c=e.length,d;a<c;a++)(d||!(a in e))&&(d||(d=Array.prototype.slice.call(e,0,a)),d[a]=e[a]);return o.concat(d||Array.prototype.slice.call(e))},BrowserInfo=function(){function o(e,s,a){this.name=e,this.version=s,this.os=a,this.type="browser"}return o}(),NodeInfo=function(){function o(e){this.version=e,this.type="node",this.name="node",this.os=process.platform}return o}(),SearchBotDeviceInfo=function(){function o(e,s,a,c){this.name=e,this.version=s,this.os=a,this.bot=c,this.type="bot-device"}return o}(),BotInfo=function(){function o(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return o}(),ReactNativeInfo=function(){function o(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return o}(),SEARCHBOX_UA_REGEX=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,SEARCHBOT_OS_REGEX=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,REQUIRED_VERSION_PARTS=3,userAgentRules=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",SEARCHBOX_UA_REGEX]],operatingSystemRules=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function detect(o){return o?parseUserAgent(o):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new ReactNativeInfo:typeof navigator<"u"?parseUserAgent(navigator.userAgent):getNodeVersion()}function matchUserAgent(o){return o!==""&&userAgentRules.reduce(function(e,s){var a=s[0],c=s[1];if(e)return e;var d=c.exec(o);return!!d&&[a,d]},!1)}function browserName(o){var e=matchUserAgent(o);return e?e[0]:null}function parseUserAgent(o){var e=matchUserAgent(o);if(!e)return null;var s=e[0],a=e[1];if(s==="searchbot")return new BotInfo;var c=a[1]&&a[1].split(".").join("_").split("_").slice(0,3);c?c.length<REQUIRED_VERSION_PARTS&&(c=__spreadArray(__spreadArray([],c,!0),createVersionParts(REQUIRED_VERSION_PARTS-c.length),!0)):c=[];var d=c.join("."),h=detectOS(o),b=SEARCHBOT_OS_REGEX.exec(o);return b&&b[1]?new SearchBotDeviceInfo(s,d,h,b[1]):new BrowserInfo(s,d,h)}function detectOS(o){for(var e=0,s=operatingSystemRules.length;e<s;e++){var a=operatingSystemRules[e],c=a[0],d=a[1],h=d.exec(o);if(h)return c}return null}function getNodeVersion(){var o=typeof process<"u"&&process.version;return o?new NodeInfo(process.version.slice(1)):null}function createVersionParts(o){for(var e=[],s=0;s<o;s++)e.push("0");return e}const es=Object.freeze(Object.defineProperty({__proto__:null,BotInfo,BrowserInfo,NodeInfo,ReactNativeInfo,SearchBotDeviceInfo,browserName,detect,detectOS,getNodeVersion,parseUserAgent},Symbol.toStringTag,{value:"Module"})),require$$3=getAugmentedNamespace(es);(function(o){var e=commonjsGlobal&&commonjsGlobal.__importDefault||function(b){return b&&b.__esModule?b:{default:b}};Object.defineProperty(o,"__esModule",{value:!0}),o.browser=o.ImageCompressorOptions=o.ImageCompressor=void 0;const s=browserHelpers;var a=ImageCompressor$1;Object.defineProperty(o,"ImageCompressor",{enumerable:!0,get:function(){return a.ImageCompressor}}),Object.defineProperty(o,"ImageCompressorOptions",{enumerable:!0,get:function(){return a.ImageCompressorOptions}});const c=e(require$1),d=require$$3,h=(b=null)=>(0,d.detect)(b||navigator.userAgent);o.browser={helpers:s.browserHelpers,require:c.default,detect:d.detect,getBrowserInfo:h,parseUserAgent:d.parseUserAgent}})(browser$2);var DeepProxy$1={};Object.defineProperty(DeepProxy$1,"__esModule",{value:!0});const helpers_1$1=helpers,Exceptions_1=Exceptions,ObjectHelpers_1$2=requireObjectHelpers(),log_1$2=log$5;class DeepProxy{constructor(e=null,s,a=!0){var c;if(this.handler=s,this.isDeep=a,this.proxy=null,this._skip=!1,this.preproxy=new WeakMap,this.delimiter="/",this.input=e,this.proxy=this.proxify(e,"",!0),!((c=this.input)===null||c===void 0)&&c.isProxy)throw new Exceptions_1.Exception("DeepProxy:ctor: input cannot be proxy!");this.target=e}static create(e=null,s,a=!0){return new DeepProxy(e,s,a).proxy}set(e,s,a,c,d){var h;return log_1$2.log.debug("DeepProxy:set",s,a,c),!((h=this.handler)===null||h===void 0)&&h.set&&this.handler.set(e,s,a,c),this.isDeep&&!(c!=null&&c.isProxy)&&(c=this.proxify(c,s+this.delimiter+a,!0)),e[a]=c,c==null&&Reflect.has(e,a)&&(log_1$2.log.debug("set: has existing value"),this.unproxy(e,s+this.delimiter+a)),!0}async skip(e,s){e==null||typeof e!="function"||this._skip||(s==null&&(s=!0),s&&(this._skip=!0),await e(),s&&(this._skip=!1))}wrapHandler(e){return{get:(a,c)=>{var d,h;if(c=="isProxy")return!0;if(c=="toString")return()=>helpers_1$1.helpers.stringifyOnce(a,null,2);if(c=="toJSON")return()=>helpers_1$1.helpers.stringifyOnce(a,null,2);let b=null;return!((d=this.handler)===null||d===void 0)&&d.get&&(b=this.handler.get(a,e,c)),b==null&&(b=a[c]||((h=ObjectHelpers_1$2.objectHelpers.getDeep(this.input,e))===null||h===void 0?void 0:h[c])),b},set:(a,c,d,h)=>{var b;return this.skip(()=>{ObjectHelpers_1$2.objectHelpers.getDeep(this.input,e)[c]=d}),!((b=this.handler)===null||b===void 0)&&b.preSet&&this.handler.preSet(a,e,c,d)==!1?null:this.set(a,e,c,d,h)},deleteProperty:(a,c)=>{var d,h;if(log_1$2.log.debug("deleteProperty: ",c),Reflect.has(a,c)){let b=null;return this.unproxy(a,c),delete ObjectHelpers_1$2.objectHelpers.getDeep(this.input,e)[c],b=Reflect.deleteProperty(a,c),b&&(!((d=this.handler)===null||d===void 0)&&d.preSet)&&this.handler.preSet(a,e,c,null),b&&(!((h=this.handler)===null||h===void 0)&&h.set)&&this.handler.set(a,e,c,null),b}return!1}}}unproxy(e,s){if(this.preproxy.has(e[s])&&(e[s]=this.preproxy.get(e[s]),this.preproxy.delete(e[s])),this.isDeep&&e[s]!=null)for(let a of Object.keys(e[s]))this.isDeep&&typeof e[s][a]=="object"&&this.unproxy(e[s],a)}proxify(e,s,a=!1){if(e==null)return null;let c=a?ObjectHelpers_1$2.objectHelpers.clone(e):e;if(this.isDeep&&(ObjectHelpers_1$2.objectHelpers.isObject(e)||ObjectHelpers_1$2.objectHelpers.isArray(e)))for(let h of Object.keys(c)){const b=c[h];typeof b=="object"&&!(b!=null&&b.isProxy)&&(c[h]=this.proxify(b,s+this.delimiter+h))}else return e;let d=new Proxy(c,this.wrapHandler(s));return this.preproxy.set(d,c),d}}DeepProxy$1.default=DeepProxy;var ProxyCache$1={},Cache$1={},LocalStorageMock$1={},interfaces={};(function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.DynamicProps=o.Deferred=void 0;var e=build$1;Object.defineProperty(o,"Deferred",{enumerable:!0,get:function(){return e.Deferred}});const s=class{};o.DynamicProps=s})(interfaces);Object.defineProperty(LocalStorageMock$1,"__esModule",{value:!0});LocalStorageMock$1.LocalStorageMock=void 0;const interfaces_1=interfaces;class LocalStorageMock extends interfaces_1.DynamicProps{constructor(){super(),this.store=null,this.store={}}clear(){this.store={}}getItem(e){return this.store[e]||null}setItem(e,s){this.store[e]=s.toString()}removeItem(e){delete this.store[e]}static safeGetLocalStorage(){let e=null;try{e=window.localStorage}catch{}return e==null&&(e=new LocalStorageMock),e}}LocalStorageMock$1.LocalStorageMock=LocalStorageMock;Object.defineProperty(Cache$1,"__esModule",{value:!0});Cache$1.Cache=void 0;const StringExtensions_1=requireStringExtensions(),helpers_1=helpers,ObjectHelpers_1$1=requireObjectHelpers(),Callbacks_1=Callbacks$1,log_1$1=log$5,LocalStorageMock_1=LocalStorageMock$1;let localStorage$1=LocalStorageMock_1.LocalStorageMock.safeGetLocalStorage();class Cache{constructor(e,s=Cache._DefaultExpiryMS,a,c=null){this.delimiter="/",this.onChange=new Callbacks_1.Callbacks,this.listenersMap={},a&&(this.delimiter=a),this.prefix=e,s!=null&&(this._expiryPeriodMS=s),(this===null||this===void 0?void 0:this.prefix)!=""&&!this.prefix.endsWith&&(this.prefix+=this.delimiter),this.store=c||localStorage$1,this.onChange.subscribe((d,h)=>this.changesListener(d,h))}get(e,s=!1){if(s||this.isExpired(e))return null;const a=this.prefix+this.delimiter+e;let c=this.store[a];if(c!=null)try{return JSON.parse(c)}catch(d){return log_1$1.log.w("Cache:get: Failed to parse content",d),null}else if(c==null)return this.getAll(a)}set(e,s){(s==null||this.isEmpty(s))&&this.delete(e),this.store[this.prefix+this.delimiter+e]=helpers_1.helpers.jsonify(s,!0),this._expiryPeriodMS!=0&&this._expiryPeriodMS!=null&&this.setExpiry(e),this.onChange.trigger(e,s)}delete(e){const s=this.prefix+this.delimiter+e;for(const a in this.store)a.startsWith(s)&&delete this.store[a];this.onChange.trigger(e,null)}push(e,s){this.store[this.prefix+this.delimiter+e]==null&&(this.store[this.prefix+this.delimiter+e]=[]),this.store[this.prefix+this.delimiter+e].push(s),this.onChange.trigger(e,this.store[this.prefix+this.delimiter+e])}listen(e="/",s){this.listenersMap[e]=s}unlisten(e){delete this.listenersMap[e]}isExpired(e){if(this._expiryPeriodMS==0)return!1;let s=this.store[`${this.prefix}/__expiry/${e}`];if(s==null)return!0;let a=new Date(s);return a==null?!0:!(a>new Date)}setExpiry(e,s=null){let a=new Date().addMilliseconds(s||this._expiryPeriodMS);return this.store[`${this.prefix}/__expiry/${e}`]=a,a}clear(e){for(let s in this.store)s.startsWith(e||this.prefix)&&(delete this.store[s],this.onChange.trigger(s,null))}getAll(e){let s=null;e=e||this.prefix;for(let a in this.store){const c=a;if(!a.startsWith(e||this.prefix)||(a=a.substr(e.length+1),StringExtensions_1.StringExtensions.contains.call(a,"__expiry")))continue;let d=this.store[c];try{d=JSON.parse(d)}catch{}s=ObjectHelpers_1$1.objectHelpers.spawnHierarchy(a,s,d,"/")}return s}isEmpty(e){return Array.isArray(e)?e.length===0:typeof e=="object"&&e!==null?Object.keys(e).length===0:!1}fixPath(e){return e.replace(/\/\//g,"/")}changesListener(e,s){const a=this.listenersMap["/"];a!=null&&a(e,s);const c=this.listenersMap[e];c!=null&&c(e,s)}}Cache$1.Cache=Cache;Cache._DefaultExpiryMS=5*60*1e3;var __importDefault=commonjsGlobal&&commonjsGlobal.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(ProxyCache$1,"__esModule",{value:!0});ProxyCache$1.ModuleOptions=ProxyCache$1.ProxyCache=void 0;const ObjectHelpers_1=requireObjectHelpers(),Cache_1=Cache$1,log_1=log$5,DeepProxy_1=__importDefault(DeepProxy$1);class ProxyCache{constructor(e,s,a){this._cache=null,this._options=new ModuleOptions,this._options={...this._options,...a},this._cache=new Cache_1.Cache(e,0,"/",this._options.store);const c={...s,...this._cache.getAll()};this.storeObjectAsKeyValueCache("",c),this._deepProxy=new DeepProxy_1.default(c,{get:(d,h,b)=>{var j,$;h=h+"/"+b.toString(),h.startsWith("/")&&(h=h.substr(1)),log_1.log.debug(`ProxyCache:get: ${h}`,b);let _e=null;d[b]!=null&&(_e=d[b]);const it=this._cache.get(h);return((j=this._options.customHandler)===null||j===void 0?void 0:j.get)!=null?($=this._options.customHandler)===null||$===void 0?void 0:$.get(d,h,b):!(_e!=null&&_e.isProxy)&&!ObjectHelpers_1.objectHelpers.isObject(_e)&&it!=_e?it:_e},set:(d,h,b,j)=>{var $,_e;h=h+"/"+b.toString(),h.startsWith("/")&&(h=h.substr(1)),log_1.log.debug(`ProxyCache:changes: ${h}`,b),(($=this._options.customHandler)===null||$===void 0?void 0:$.set)!=null&&((_e=this._options.customHandler)===null||_e===void 0||_e.set(d,h,b,j)),j!=null?this.storeObjectAsKeyValueCache(h,j):(h.startsWith("/")&&(h=h.substr(1,h.length)),log_1.log.debug(`ProxyCache:delete: ${h}`,b),this._cache.delete(h))}},!0),this.proxy=this._deepProxy.proxy}set(e,s,a){return ObjectHelpers_1.objectHelpers.merge.call(this,this.proxy,s)}storeObjectAsKeyValueCache(e,s){if(e.startsWith("/")&&(e=e.substr(1)),ObjectHelpers_1.objectHelpers.isObject(s)){const a=ObjectHelpers_1.objectHelpers.objectToKeyValue(s);e!=""&&!e.endsWith("/")&&(e+="/");for(let c in a){const d=a[c];d!=null&&this._cache.set(e+c,d)}}else this._cache.set(e,s)}}ProxyCache$1.ProxyCache=ProxyCache;class ModuleOptions{}ProxyCache$1.ModuleOptions=ModuleOptions;(function(o){var e=commonjsGlobal&&commonjsGlobal.__importDefault||function(b){return b&&b.__esModule?b:{default:b}};Object.defineProperty(o,"__esModule",{value:!0}),o.libx=void 0;const s=essentials,a=browser$2,c=ObjectExtensions,d=e(DeepProxy$1),h=ProxyCache$1;o.libx=c.objectExtensions.extend(s.libx,{browser:a.browser,ProxyCache:h.ProxyCache,DeepProxy:d.default}),window.libx==null?window.libx=o.libx:window.libx={...window.libx,...o.libx}})(browser_essentials);browser_essentials.libx.log.isShowTime=!0;browser_essentials.libx.log.isShowPrefix=!1;window.libx=browser_essentials.libx;const ENV_DEBUG="* # all (default)";function getSetting(){try{return localStorage.getItem("DEBUG")??ENV_DEBUG??"*"}catch{return ENV_DEBUG}}function isEnabled(o){const e=getSetting();return e==="*"||e.split(",").map(s=>s.trim()).includes(o)}function fmt(o,e){return`${o} ${e.map(s=>typeof s=="string"?s:JSON.stringify(s)).join(" ")}`}function makeLogger(o){const e=`[${o}]`;return{debug:(...s)=>{isEnabled(o)&&browser_essentials.libx.log.verbose(fmt(e,s))},verbose:(...s)=>{isEnabled(o)&&browser_essentials.libx.log.verbose(fmt(e,s))},info:(...s)=>browser_essentials.libx.log.info(fmt(e,s)),warn:(...s)=>browser_essentials.libx.log.warning(fmt(e,s)),error:(...s)=>browser_essentials.libx.log.error(fmt(e,s))}}const logger={forComponent:makeLogger},log$4=logger.forComponent("WebRTCPeer"),Eo=class Eo{constructor(){or(this,"pc",null);or(this,"micSender",null);or(this,"audioEl",null);or(this,"combinedStream",null);or(this,"_connected",!1);or(this,"_playbackPaused",!1);or(this,"onRemoteTrack",null);or(this,"onConnected",null);or(this,"onDisconnect",null)}get connected(){return this._connected}get remoteStream(){return this.combinedStream}async connect(e,s,a,c,d){this.stop();const h=new RTCPeerConnection({iceServers:[{urls:"stun:stun.l.google.com:19302"},...Eo.extraIceServers]});this.pc=h,this.combinedStream=new MediaStream,this.audioEl=document.createElement("audio"),this.audioEl.autoplay=!0,this.audioEl.setAttribute("playsinline",""),this.audioEl.style.display="none",document.body.appendChild(this.audioEl),this.audioEl.srcObject=this.combinedStream,log$4.info("playback ready",{mode:"audio-element"}),h.ontrack=at=>{var dt;const lt=at.track;log$4.info("remote track received",{kind:lt.kind,id:lt.id.slice(0,8),readyState:lt.readyState,muted:lt.muted}),lt.addEventListener("unmute",()=>{if(log$4.info("track unmuted",{id:lt.id.slice(0,8),paused:this._playbackPaused}),this.combinedStream.getTrackById(lt.id)||this.combinedStream.addTrack(lt),this._playbackPaused){lt.enabled=!1;return}this.audioEl&&(this.audioEl.srcObject=this.combinedStream,this.audioEl.play().catch(()=>{}))}),(dt=this.onRemoteTrack)==null||dt.call(this,lt,this.combinedStream)},h.onicecandidate=at=>{at.candidate&&e.send(JSON.stringify({type:"ice",candidate:at.candidate,peerId:a}))},h.onconnectionstatechange=()=>{var at,lt,dt,mt,vt,tt;if(log$4.info("connection state",h.connectionState),h.connectionState==="connected"){this._connected=!0,this._negotiationTimeout&&(clearTimeout(this._negotiationTimeout),this._negotiationTimeout=null),this._disconnectTimer&&(clearTimeout(this._disconnectTimer),this._disconnectTimer=null),(at=this.audioEl)!=null&&at.paused&&this.audioEl.play().catch(()=>{log$4.debug("audio play deferred (waiting for user gesture)");const ot=()=>{var ht;(ht=this.audioEl)==null||ht.play().catch(()=>{}),document.removeEventListener("click",ot),document.removeEventListener("touchstart",ot)};document.addEventListener("click",ot),document.addEventListener("touchstart",ot)});const nt=((lt=this.combinedStream)==null?void 0:lt.getTracks())||[];log$4.info("connected",{paused:(dt=this.audioEl)==null?void 0:dt.paused,volume:(mt=this.audioEl)==null?void 0:mt.volume,trackCount:nt.length,trackStates:nt.map(ot=>({id:ot.id.slice(0,8),muted:ot.muted}))}),this._statsTimer=setInterval(async()=>{if(!(!this.pc||this.pc.connectionState!=="connected"))try{const ot=await this.pc.getStats(),ht=[];ot.forEach(xt=>{xt.type==="inbound-rtp"&&xt.kind==="audio"&&ht.push({ssrc:xt.ssrc,pkts:xt.packetsReceived,bytes:xt.bytesReceived,lost:xt.packetsLost})})}catch{}},5e3),(vt=this.onConnected)==null||vt.call(this)}else h.connectionState==="failed"?(this._connected=!1,(tt=this.onDisconnect)==null||tt.call(this)):h.connectionState==="disconnected"&&(log$4.info("connection disconnected, waiting for recovery..."),this._disconnectTimer=setTimeout(()=>{var nt;h.connectionState==="disconnected"||h.connectionState==="failed"?(log$4.warn("connection did not recover"),this._connected=!1,(nt=this.onDisconnect)==null||nt.call(this)):log$4.info("connection recovered",{state:h.connectionState})},5e3))},h.addTransceiver("audio",{direction:"sendrecv"}),h.addTransceiver("audio",{direction:"recvonly"});let b=!1;const j=[],$=()=>{for(const at of j)h.addIceCandidate(at).catch(lt=>log$4.error("addIceCandidate failed",{error:lt.message}));j.length=0},_e=at=>{if(typeof at.data=="string")try{const lt=JSON.parse(at.data);lt.type==="answer"&<.peerId===a&<.sdp?h.setRemoteDescription({type:"answer",sdp:lt.sdp}).then(()=>{b=!0,$()}).catch(dt=>log$4.error("setRemoteDescription failed",dt)):lt.type==="ice"&<.peerId===a&<.candidate&&(b?h.addIceCandidate(lt.candidate).catch(()=>{}):j.push(lt.candidate))}catch{}};e.addEventListener("message",_e),this._wsHandler=_e,this._ws=e;const it=await h.createOffer();await h.setLocalDescription(it),e.send(JSON.stringify({type:"offer",sdp:it.sdp,peerId:a,role:c})),log$4.info("offer sent",{roomId:s,peerId:a,role:c}),this._negotiationTimeout=setTimeout(()=>{var at;(h.connectionState==="new"||h.connectionState==="connecting")&&(log$4.warn("negotiation timeout — no answer received in 10s"),this._connected=!1,(at=this.onDisconnect)==null||at.call(this))},1e4)}async addMicTrack(e){if(!this.pc)return;const s=e.getAudioTracks()[0];if(!s){log$4.warn("no audio track in stream");return}const a=this.pc.getTransceivers();log$4.info("mic track setup",{trackState:s.readyState,trackEnabled:s.enabled,senderCount:this.pc.getSenders().length,transceivers:a.map(h=>{var b,j;return{direction:h.direction,currentDirection:h.currentDirection,mid:h.mid,senderTrack:((j=(b=h.sender.track)==null?void 0:b.id)==null?void 0:j.slice(0,8))??"null"}})});const c=a.find(h=>h.direction==="sendrecv"||h.currentDirection==="sendrecv");if(s.addEventListener("ended",()=>{log$4.warn("mic track ended unexpectedly",{id:s.id.slice(0,8)}),this.micSender=null}),c?(await c.sender.replaceTrack(s),this.micSender=c.sender,log$4.info("mic track added",{senderTrack:s.id.slice(0,8),mid:c.mid})):(this.micSender=this.pc.addTrack(s,e),log$4.info("mic track added (new sender)")),this.audioEl&&this.audioEl.play().catch(()=>{}),/iphone|ipad|ipod/i.test(navigator.userAgent)&&this.micSender)try{const h=s.getSettings().deviceId,j=(await navigator.mediaDevices.getUserMedia({audio:{deviceId:h}})).getAudioTracks()[0];j&&this.micSender&&(await this.micSender.replaceTrack(j),s.stop(),log$4.info("iOS: mic track recreated",{id:j.id.slice(0,8)}))}catch(h){log$4.warn("iOS mic track recreation failed, keeping original",h)}}resumePlayback(){var e;this._playbackPaused=!1,(e=this.combinedStream)==null||e.getTracks().forEach(s=>{s.enabled=!0})}removeMicTrack(){var e;!this.pc||!this.micSender||((e=this.micSender.track)==null||e.stop(),this.micSender.replaceTrack(null),this.micSender=null,log$4.info("mic track removed"),this.audioEl&&this.audioEl.play().catch(()=>{}))}async getTrackStats(){const e=this.pc;if(!e)return null;const s=await Promise.all(e.getReceivers().filter(c=>{var d;return((d=c.track)==null?void 0:d.kind)==="audio"}).map(async c=>({track:c.track,stats:await c.getStats()})));if(!this.pc)return null;const a=await Promise.all(e.getSenders().filter(c=>!c.track||c.track.kind==="audio").map(async c=>({track:c.track,stats:await c.getStats()})));return{receivers:s,senders:a}}async getDebugInfo(){if(!this.pc)return null;const e={pcState:this.pc.connectionState,iceState:this.pc.iceConnectionState};this.audioEl&&(e.audio={paused:this.audioEl.paused,volume:this.audioEl.volume,currentTime:Math.round(this.audioEl.currentTime*10)/10,readyState:this.audioEl.readyState}),this.combinedStream&&(e.tracks=this.combinedStream.getTracks().map(c=>({id:c.id.slice(0,8),muted:c.muted,readyState:c.readyState})));const s=await this.pc.getStats(),a=[];return s.forEach(c=>{c.type==="inbound-rtp"&&c.kind==="audio"?a.push({dir:"in",ssrc:c.ssrc,pkts:c.packetsReceived,bytes:c.bytesReceived,lost:c.packetsLost}):c.type==="outbound-rtp"&&c.kind==="audio"&&a.push({dir:"out",ssrc:c.ssrc,pkts:c.packetsSent,bytes:c.bytesSent})}),e.rtp=a,e}getDebugState(){var e,s,a,c,d,h;return{connected:this._connected,playbackPaused:this._playbackPaused,audioElPaused:((e=this.audioEl)==null?void 0:e.paused)??null,audioElVolume:((s=this.audioEl)==null?void 0:s.volume)??null,audioElCurrentTime:((a=this.audioEl)==null?void 0:a.currentTime)??null,trackCount:((c=this.combinedStream)==null?void 0:c.getTracks().length)??0,trackStates:((d=this.combinedStream)==null?void 0:d.getTracks().map(b=>({muted:b.muted,readyState:b.readyState})))??[],pcState:((h=this.pc)==null?void 0:h.connectionState)??null}}async setOutputDevice(e){if(this.audioEl&&"setSinkId"in this.audioEl)try{await this.audioEl.setSinkId(e)}catch(s){log$4.warn("setSinkId failed",{deviceId:e,error:s.message})}}pausePlayback(){var e;this._playbackPaused=!0,(e=this.combinedStream)==null||e.getTracks().forEach(s=>{s.enabled=!1})}mute(){this.audioEl&&(this.audioEl.volume=0)}unmute(){this.audioEl&&(this.audioEl.volume=1)}setVolume(e){this.audioEl&&(this.audioEl.volume=Math.max(0,Math.min(1,e)))}stop(){this._negotiationTimeout&&(clearTimeout(this._negotiationTimeout),this._negotiationTimeout=null),this._disconnectTimer&&(clearTimeout(this._disconnectTimer),this._disconnectTimer=null),this._statsTimer&&(clearInterval(this._statsTimer),this._statsTimer=null);const e=this._ws,s=this._wsHandler;e&&s&&e.removeEventListener("message",s),this._ws=null,this._wsHandler=null,this.micSender=null,this.audioEl&&(this.audioEl.srcObject=null,this.audioEl.remove(),this.audioEl=null),this.combinedStream=null,this.pc&&(this.pc.close(),this.pc=null),this._connected=!1,this._playbackPaused=!1}};or(Eo,"extraIceServers",[]);let WebRTCPeer=Eo;const log$3=logger.forComponent("AudioReceiver");class AudioReceiverOptions{constructor(){or(this,"transport","both");or(this,"audioContext");or(this,"peerId");or(this,"role","listener");or(this,"webAudioPlayback",!1)}}const Rn=class Rn{constructor(e){or(this,"ws",null);or(this,"player",null);or(this,"rtcPeer",null);or(this,"_rtcConnected",!1);or(this,"_connected",!1);or(this,"backchannelPending",!1);or(this,"_channel",null);or(this,"events",{});or(this,"_micStream",null);or(this,"_rtcReconnectTimer",null);or(this,"_rtcReconnectAttempts",0);this.options=e,this.options={...new AudioReceiverOptions,...e}}opts(){return this.options}get connected(){return this._connected}get rtcConnected(){return this._rtcConnected}get channel(){return this._channel}get audioPlayer(){return this.player}get webrtcPeer(){return this.rtcPeer}on(e){return this.events={...this.events,...e},this}subscribe(e){this.unsubscribe(),this._channel=e;const s=this.opts(),a=s.audioContext??new AudioContext({sampleRate:44100});this.player=new AudioStreamPlayer(a);const c=location.protocol==="https:"?"wss:":"ws:",d=new WebSocket(`${c}//${location.host}/audio-ws/room/${e}`);d.binaryType="arraybuffer",this.ws=d,d.onopen=async()=>{var b,j;this._connected=!0,log$3.info("subscribed",{channel:e}),(j=(b=this.events).onConnect)==null||j.call(b),(s.transport==="webrtc"||s.transport==="both")&&s.peerId&&(await Rn.loadIceServers(),this.negotiateWebRTC(d,e,s.peerId,s.role))},d.onmessage=h=>{typeof h.data=="string"?this.handleJsonMessage(h.data):this.handleBinaryMessage(h.data)},d.onclose=()=>{var h,b;this._connected=!1,log$3.debug("unsubscribed",{channel:e}),(b=(h=this.events).onDisconnect)==null||b.call(h)},d.onerror=()=>{var h,b;log$3.warn("WS error",{channel:e}),(b=(h=this.events).onError)==null||b.call(h,"WebSocket error")}}handleJsonMessage(e){var s,a,c,d,h,b,j,$,_e,it,at,lt,dt,mt,vt,tt,nt,ot,ht;try{const xt=JSON.parse(e);xt.type==="start"?(log$3.info("TTS start",{textLen:(s=xt.text)==null?void 0:s.length,sampleRate:xt.sampleRate}),(a=this.player)==null||a.stop(),xt.sampleRate&&((c=this.player)==null||c.setSampleRate(xt.sampleRate)),(d=this.player)==null||d.ensureResumed(),(b=(h=this.events).onTTSStart)==null||b.call(h,xt.text||"",xt.spokenWords)):xt.type==="timestamps"?($=(j=this.events).onTimestamps)==null||$.call(j,xt.words,xt.start,xt.end):xt.type==="end"?(log$3.debug("TTS end",{interrupted:xt.interrupted}),(it=(_e=this.events).onTTSEnd)==null||it.call(_e,xt.interrupted??!1)):xt.type==="tts-pause"?(log$3.debug("TTS pause"),(lt=(at=this.events).onTTSPause)==null||lt.call(at)):xt.type==="tts-resume"?(log$3.debug("TTS resume"),(mt=(dt=this.events).onTTSResume)==null||mt.call(dt)):xt.type==="backchannel"?(log$3.debug("backchannel clip incoming",{text:xt.text}),this.backchannelPending=!0,xt.sampleRate&&((vt=this.player)==null||vt.setSampleRate(xt.sampleRate)),xt.text&&((nt=(tt=this.events).onBackchannel)==null||nt.call(tt,xt.text))):xt.type==="peers"&&((ht=(ot=this.events).onPeers)==null||ht.call(ot,xt.peers||[]))}catch{}}handleBinaryMessage(e){var c,d,h,b,j;if(this.backchannelPending){this.backchannelPending=!1,(c=this.player)==null||c.ensureResumed(),(d=this.player)==null||d.feedPCM(e);return}const s=this.opts().transport;(s==="ws"||s==="both"&&!this._rtcConnected)&&((h=this.player)==null||h.feedPCM(e)),(j=(b=this.events).onPCMChunk)==null||j.call(b,e)}static async loadIceServers(){if(!Rn._iceLoaded){try{const e=await fetch("/api/tokens/ice");if(e.ok){const{iceServers:s}=await e.json();s!=null&&s.length&&(WebRTCPeer.extraIceServers=s,log$3.info("ICE servers loaded",{count:s.length}))}}catch{}Rn._iceLoaded=!0}}negotiateWebRTC(e,s,a,c){var h;(h=this.rtcPeer)==null||h.stop(),this._rtcReconnectAttempts=0;const d=new WebRTCPeer;this.rtcPeer=d,d.onConnected=()=>{var b,j;this._rtcConnected=!0,this._rtcReconnectAttempts=0,log$3.info("WebRTC connected",{channel:s}),(j=(b=this.events).onWebRTCConnected)==null||j.call(b)},d.onDisconnect=()=>{var b,j;this._rtcConnected=!1,log$3.warn("WebRTC disconnected",{channel:s}),(j=(b=this.events).onWebRTCDisconnected)==null||j.call(b),this.scheduleRtcReconnect(s,a,c)},d.connect(e,s,a,c,this.opts().audioContext).catch(b=>{var j,$;log$3.warn("WebRTC negotiation failed",b),this._rtcConnected=!1,($=(j=this.events).onError)==null||$.call(j,`WebRTC failed: ${b.message}`),this.scheduleRtcReconnect(s,a,c)})}scheduleRtcReconnect(e,s,a){var d;if(this._rtcReconnectAttempts>=Rn.MAX_RECONNECT_ATTEMPTS){log$3.error("WebRTC max reconnect attempts reached",{channel:e});return}if(((d=this.ws)==null?void 0:d.readyState)!==WebSocket.OPEN)return;this._rtcReconnectAttempts++;const c=Math.min(2e3*this._rtcReconnectAttempts,1e4);log$3.info("WebRTC reconnecting",{channel:e,attempt:this._rtcReconnectAttempts,delayMs:c}),this._rtcReconnectTimer=setTimeout(()=>{var h,b;if(((h=this.ws)==null?void 0:h.readyState)===WebSocket.OPEN){(b=this.rtcPeer)==null||b.stop();const j=new WebRTCPeer;this.rtcPeer=j,j.onConnected=()=>{var $,_e;this._rtcConnected=!0,this._rtcReconnectAttempts=0,log$3.info("WebRTC reconnected",{channel:e}),this._micStream&&j.addMicTrack(this._micStream),(_e=($=this.events).onWebRTCConnected)==null||_e.call($)},j.onDisconnect=()=>{var $,_e;this._rtcConnected=!1,log$3.warn("WebRTC disconnected (retry)",{channel:e}),(_e=($=this.events).onWebRTCDisconnected)==null||_e.call($),this.scheduleRtcReconnect(e,s,a)},j.connect(this.ws,e,s,a,this.opts().audioContext).catch($=>{log$3.warn("WebRTC reconnect failed",$),this._rtcConnected=!1,this.scheduleRtcReconnect(e,s,a)})}},c)}addMicTrack(e){var s;this._micStream=e,(s=this.rtcPeer)==null||s.addMicTrack(e)}removeMicTrack(){var e;this._micStream=null,(e=this.rtcPeer)==null||e.removeMicTrack()}async setOutputDevice(e){var s;await((s=this.rtcPeer)==null?void 0:s.setOutputDevice(e))}resumePlayback(){var e;(e=this.rtcPeer)==null||e.resumePlayback()}mute(){var e,s;(e=this.player)==null||e.mute(),(s=this.rtcPeer)==null||s.mute()}unmute(){var e,s;(e=this.player)==null||e.unmute(),(s=this.rtcPeer)==null||s.unmute()}setVolume(e){var s,a;(s=this.player)==null||s.setVolume(e),(a=this.rtcPeer)==null||a.setVolume(e)}get muted(){var e;return((e=this.player)==null?void 0:e.muted)??!1}stopPlayback(){var e;(e=this.player)==null||e.stop()}pausePlayback(){var e,s;(e=this.player)==null||e.stop(),(s=this.rtcPeer)==null||s.pausePlayback()}getDebugState(){var e,s,a;return{wsState:((e=this.ws)==null?void 0:e.readyState)??null,rtcConnected:((s=this.rtcPeer)==null?void 0:s.connected)??!1,rtc:((a=this.rtcPeer)==null?void 0:a.getDebugState())??null}}getScheduledUntil(){var e;return((e=this.player)==null?void 0:e.getScheduledUntil())??0}getCurrentTime(){var e;return((e=this.player)==null?void 0:e.getCurrentTime())??0}sendTTSPause(){var e;((e=this.ws)==null?void 0:e.readyState)===WebSocket.OPEN&&this.ws.send(JSON.stringify({type:"tts-pause"}))}sendTTSResume(){var e;((e=this.ws)==null?void 0:e.readyState)===WebSocket.OPEN&&this.ws.send(JSON.stringify({type:"tts-resume"}))}sendMicroEvent(e,s,a){var c;((c=this.ws)==null?void 0:c.readyState)===WebSocket.OPEN&&this.ws.send(JSON.stringify({type:"micro",event:e,...s&&{transcript:s,wordCount:s.trim().split(/\s+/).length},...a&&{participantId:a}}))}getWebSocket(){return this.ws}unsubscribe(){var e,s,a;this._rtcReconnectTimer&&(clearTimeout(this._rtcReconnectTimer),this._rtcReconnectTimer=null),(e=this.ws)==null||e.close(),this.ws=null,(s=this.rtcPeer)==null||s.stop(),this.rtcPeer=null,this._rtcConnected=!1,this._micStream=null,(a=this.player)==null||a.stop(),this.player=null,this._connected=!1,this._channel=null}dispose(){this.unsubscribe()}};or(Rn,"MAX_RECONNECT_ATTEMPTS",5),or(Rn,"_iceLoaded",!1);let AudioReceiver=Rn;class WordSyncPlayer{constructor(e){or(this,"_spokenCount",0);or(this,"timeouts",[]);or(this,"wordStarts",[]);or(this,"_gen",0);or(this,"onChange",null);this.getCtxTime=e}get spokenCount(){return this._spokenCount}get totalWords(){return this.wordStarts.length}onTimestamps(e,s,a,c){const d=this.getCtxTime(),h=s[0]??0;for(let b=0;b<e.length;b++){const j=s[b]-h,_e=(c+j-d)*1e3;this.wordStarts.push(s[b]),this.scheduleWord(_e)}}onTimestampsAbsolute(e,s,a,c=!1){for(let h=0;h<e.length;h++)this.wordStarts.push(s[h]);if(c)return;const d=this.getCtxTime();for(let h=e.length;h>0;h--){const b=this.wordStarts.length-h,$=(a+this.wordStarts[b]-d)*1e3;this.scheduleWord($)}}pause(){this._gen++;for(const e of this.timeouts)clearTimeout(e);this.timeouts=[]}rescheduleFrom(e){for(const a of this.timeouts)clearTimeout(a);this.timeouts=[];const s=this.getCtxTime();for(let a=this._spokenCount;a<this.wordStarts.length;a++){const d=(e+this.wordStarts[a]-s)*1e3;this.scheduleWord(d)}}scheduleWord(e){const s=this._gen,a=setTimeout(()=>{var c;this._gen===s&&(this._spokenCount++,(c=this.onChange)==null||c.call(this,this._spokenCount))},Math.max(0,e));this.timeouts.push(a)}revealAll(e){var s;for(const a of this.timeouts)clearTimeout(a);this.timeouts=[],this._spokenCount=e,(s=this.onChange)==null||s.call(this,this._spokenCount)}getDebugState(){return{spokenCount:this._spokenCount,totalWords:this.wordStarts.length,pendingTimers:this.timeouts.length}}reset(){var e;this._gen++;for(const s of this.timeouts)clearTimeout(s);this.timeouts=[],this.wordStarts=[],this._spokenCount=0,(e=this.onChange)==null||e.call(this,0)}}const log$2=logger.forComponent("EnergyMonitor"),ln=class ln{constructor(){or(this,"analyser",null);or(this,"source",null);or(this,"intervalId",null);or(this,"_active",!1);or(this,"buffer",null);or(this,"_suppressed",!1);or(this,"minFrames",2);or(this,"windowSize",5);or(this,"window",[]);or(this,"ambientEma",0);or(this,"frameCount",0);or(this,"onVoiceDetected",null);or(this,"ctx",null);or(this,"streamGetter",null);or(this,"deadFrames",0);or(this,"poll",()=>{var h;if(!this._active||(!this.analyser||!this.buffer)&&!this.tryReconnect())return;this.analyser.getByteTimeDomainData(this.buffer);let e=0;for(let b=0;b<this.buffer.length;b++){const j=(this.buffer[b]-128)/128;e+=j*j}const s=Math.sqrt(e/this.buffer.length);if(s===0&&this.streamGetter){if(this.deadFrames++,this.deadFrames>=40){this.deadFrames=0,this.tryReconnect();return}}else this.deadFrames=0;const a=this.frameCount<ln.CALIBRATION?.2:ln.ALPHA;if(this.ambientEma=this.ambientEma===0?s:this.ambientEma*(1-a)+s*a,this.frameCount++,this._suppressed||this.frameCount<=ln.CALIBRATION)return;const c=Math.max(this.ambientEma*ln.MULTIPLIER,ln.FLOOR);this.window.push(s>c),this.window.length>this.windowSize&&this.window.shift();const d=this.window.filter(Boolean).length;d>=this.minFrames&&(log$2.debug("voice detected",{rms:s.toFixed(3),ambient:this.ambientEma.toFixed(4),threshold:c.toFixed(4),hits:d}),this._suppressed=!0,(h=this.onVoiceDetected)==null||h.call(this))})}start(e,s){this.stop(),this.ctx=s;const a=typeof e=="function"?e():e;this.streamGetter=typeof e=="function"?e:null,a&&(this.connectStream(a,s),this._active=!0,this._suppressed=!1,this.window=[],this.ambientEma=0,this.frameCount=0,this.intervalId=setInterval(this.poll,50),log$2.debug("started (adaptive)",{floor:ln.FLOOR,multiplier:ln.MULTIPLIER}))}connectStream(e,s){var a;(a=this.source)==null||a.disconnect(),this.analyser=s.createAnalyser(),this.analyser.fftSize=256,this.buffer=new Uint8Array(this.analyser.frequencyBinCount),this.source=s.createMediaStreamSource(e),this.source.connect(this.analyser)}tryReconnect(){if(!this.streamGetter||!this.ctx)return!1;const e=this.streamGetter();return!e||!e.getAudioTracks().some(s=>s.readyState==="live")?!1:(log$2.debug("reconnecting to new stream"),this.connectStream(e,this.ctx),!0)}stop(){var e;this._active=!1,this._suppressed=!1,this.intervalId!==null&&(clearInterval(this.intervalId),this.intervalId=null),(e=this.source)==null||e.disconnect(),this.source=null,this.analyser=null,this.buffer=null,this.window=[],this.ambientEma=0,this.frameCount=0,this.deadFrames=0,this.ctx=null,this.streamGetter=null}suppress(){this._suppressed=!0,this.window=[]}unsuppress(){this._suppressed=!1,this.window=[]}get active(){return this._active}};or(ln,"ALPHA",.02),or(ln,"MULTIPLIER",3.5),or(ln,"FLOOR",.008),or(ln,"CALIBRATION",20);let EnergyMonitor=ln;class AudioStreamingError extends Error{constructor(e,s,a,c){super(e),this.code=s,this.audioId=a,this.originalError=c,this.name="AudioStreamingError"}}class PermissionError extends AudioStreamingError{constructor(e,s){super(e,"PERMISSION_ERROR",void 0,s)}}class PermissionManager{constructor(){this._currentStream=null,this._permissionState={status:"unknown",isSupported:!1},this._initialize()}static getInstance(){return PermissionManager._instance||(PermissionManager._instance=new PermissionManager),PermissionManager._instance}_initialize(){this._permissionState.isSupported=this._isGetUserMediaSupported(),this._permissionState.isSupported&&this._checkInitialPermissionState()}_isGetUserMediaSupported(){var e;return!!((e=navigator.mediaDevices)!=null&&e.getUserMedia||navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia)}async _checkInitialPermissionState(){if("permissions"in navigator&&"query"in navigator.permissions)try{const e=await navigator.permissions.query({name:"microphone"});this._permissionState.status=e.state,e.addEventListener("change",()=>{this._permissionState.status=e.state})}catch{this._permissionState.status="prompt"}else this._permissionState.status="prompt"}async requestPermission(e={}){if(!this._permissionState.isSupported){const s=new PermissionError("getUserMedia is not supported in this browser");return{granted:!1,state:{...this._permissionState,error:s},error:s}}try{const s=this._buildMediaConstraints(e),a=await this._getUserMedia(s);return this._permissionState.status="granted",this._currentStream=a,{granted:!0,state:{...this._permissionState},stream:a}}catch(s){const a=this._handlePermissionError(s);return this._permissionState.error=a,{granted:!1,state:{...this._permissionState},error:a}}}_buildMediaConstraints(e){const s={echoCancellation:e.echoCancellation??!0,noiseSuppression:e.noiseSuppression??!0,autoGainControl:e.autoGainControl??!0};if(e.deviceId&&(s.deviceId=e.deviceId),e.sampleRate&&(s.sampleRate=e.sampleRate),e.channelCount&&(s.channelCount=e.channelCount),this._isSafari()){const a={echoCancellation:s.echoCancellation,noiseSuppression:s.noiseSuppression,autoGainControl:s.autoGainControl};return s.deviceId&&(a.deviceId=s.deviceId),{audio:a}}return{audio:s}}async _getUserMedia(e){var a;if((a=navigator.mediaDevices)!=null&&a.getUserMedia)return await navigator.mediaDevices.getUserMedia(e);const s=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia;if(!s)throw new Error("getUserMedia is not supported");return new Promise((c,d)=>{s.call(navigator,e,c,d)})}_handlePermissionError(e){let s="Unknown permission error",a="unknown";return e.name==="NotAllowedError"||e.name==="PermissionDeniedError"?(s="Microphone access was denied by the user. Please enable microphone permissions in your browser settings.",a="denied"):e.name==="NotFoundError"||e.name==="DevicesNotFoundError"?(s="No microphone device was found. Please check that a microphone is connected and try again.",a="denied"):e.name==="NotSupportedError"?(s="Microphone access is not supported in this browser or context (HTTPS required).",a="denied"):e.name==="NotReadableError"||e.name==="TrackStartError"?(s="The microphone is already in use by another application. Please close other applications using the microphone and try again.",a="denied"):e.name==="OverconstrainedError"||e.name==="ConstraintNotSatisfiedError"?(s="The requested audio constraints could not be satisfied. Please try with different settings.",a="denied"):e.name==="SecurityError"?(s="Microphone access blocked due to security restrictions. Please ensure you are using HTTPS and try again.",a="denied"):e.name==="AbortError"&&(s="Permission request was cancelled or interrupted.",a="prompt"),this._permissionState.status=a,new PermissionError(s,e)}async checkPermissionState(){if(!this._permissionState.isSupported)return{...this._permissionState};if("permissions"in navigator&&"query"in navigator.permissions)try{const e=await navigator.permissions.query({name:"microphone"});this._permissionState.status=e.state}catch{}return{...this._permissionState}}stopCurrentStream(){this._currentStream&&(this._currentStream.getTracks().forEach(e=>{e.stop()}),this._currentStream=null)}getCurrentStream(){return this._currentStream}getPermissionErrorGuidance(e){const s=[];return e.message.includes("denied")?(s.push("Click the microphone icon in your browser's address bar"),s.push('Select "Always allow" for microphone access'),s.push("Refresh the page and try again")):e.message.includes("not found")?(s.push("Check that your microphone is properly connected"),s.push("Try selecting a different microphone in your browser settings"),s.push("Restart your browser if the issue persists")):e.message.includes("in use")?(s.push("Close other applications that might be using your microphone"),s.push("Check for other browser tabs using the microphone"),s.push("Restart your browser if necessary")):e.message.includes("HTTPS")?(s.push("Microphone access requires a secure connection (HTTPS)"),s.push("Try accessing the site via HTTPS"),s.push("Contact the site administrator if the issue persists")):(s.push("Try refreshing the page"),s.push("Check your browser's microphone permissions"),s.push("Try using a different browser if the issue persists")),s}async testMicrophoneAccess(e={}){const s=await this.requestPermission(e);return s.stream&&s.stream.getTracks().forEach(a=>a.stop()),{...s,stream:void 0}}async getAudioInputDevices(){var e;if(!((e=navigator.mediaDevices)!=null&&e.enumerateDevices))throw new PermissionError("Device enumeration is not supported");try{return(await navigator.mediaDevices.enumerateDevices()).filter(a=>a.kind==="audioinput")}catch(s){throw new PermissionError("Failed to enumerate audio devices",s)}}async getAudioOutputDevices(){var e;if(!((e=navigator.mediaDevices)!=null&&e.enumerateDevices))throw new PermissionError("Device enumeration is not supported");try{return(await navigator.mediaDevices.enumerateDevices()).filter(a=>a.kind==="audiooutput")}catch(s){throw new PermissionError("Failed to enumerate audio devices",s)}}_isSafari(){const e=navigator.userAgent.toLowerCase();return e.includes("safari")&&!e.includes("chrome")}getBrowserSpecificGuidance(){const e=navigator.userAgent.toLowerCase();return e.includes("chrome")?["Chrome: Click the microphone icon in the address bar",'Select "Always allow" for this site',"Check chrome://settings/content/microphone for global settings"]:e.includes("firefox")?["Firefox: Click the shield icon or microphone icon in the address bar",'Select "Allow" and check "Remember this decision"',"Check about:preferences#privacy for global settings"]:this._isSafari()?["Safari: Check Safari > Preferences > Websites > Microphone",'Set this website to "Allow"',"Ensure microphone access is enabled in System Preferences > Security & Privacy"]:e.includes("edge")?["Edge: Click the microphone icon in the address bar",'Select "Always allow on this site"',"Check edge://settings/content/microphone for global settings"]:["Check your browser's microphone permissions for this site","Look for a microphone icon in the address bar","Ensure microphone access is enabled in your browser settings"]}getCapabilities(){var e;return{isSupported:this._permissionState.isSupported,hasPermissionsAPI:"permissions"in navigator&&"query"in navigator.permissions,hasEnumerateDevices:!!((e=navigator.mediaDevices)!=null&&e.enumerateDevices),currentStatus:this._permissionState.status,browser:this._getBrowserInfo()}}_getBrowserInfo(){const e=navigator.userAgent.toLowerCase();return e.includes("chrome")?"chrome":e.includes("firefox")?"firefox":this._isSafari()?"safari":e.includes("edge")?"edge":"unknown"}dispose(){this.stopCurrentStream(),this._permissionState={status:"unknown",isSupported:!1}}}class DeviceManager{static async enumerateDevices(){var e;if(!((e=navigator.mediaDevices)!=null&&e.enumerateDevices))throw new Error("Device enumeration is not supported in this browser");try{const a=await PermissionManager.getInstance().checkPermissionState(),c=await navigator.mediaDevices.enumerateDevices(),d=c.filter(b=>b.kind==="audioinput"&&b.deviceId&&b.deviceId.length>0).map((b,j)=>{var $;return{deviceId:b.deviceId,kind:b.kind,groupId:b.groupId,label:b.label||`Microphone ${j+1}`,toJSON:($=b.toJSON)==null?void 0:$.bind(b)}}),h=c.filter(b=>b.kind==="audiooutput"&&b.deviceId&&b.deviceId.length>0).map((b,j)=>{var $;return{deviceId:b.deviceId,kind:b.kind,groupId:b.groupId,label:b.label||`Speaker ${j+1}`,toJSON:($=b.toJSON)==null?void 0:$.bind(b)}});return{inputs:d,outputs:h}}catch(s){throw new Error(`Failed to enumerate devices: ${s.message}`)}}static buildConstraints(e={}){const s={echoCancellation:e.echoCancellation??!0,noiseSuppression:e.noiseSuppression??!0,autoGainControl:e.autoGainControl??!0};if(e.deviceId&&(s.deviceId={exact:e.deviceId}),e.channelCount!==void 0&&(s.channelCount=e.channelCount),e.sampleRate!==void 0&&(s.sampleRate=e.sampleRate),this._isSafari()){const a={echoCancellation:s.echoCancellation,noiseSuppression:s.noiseSuppression,autoGainControl:s.autoGainControl};return s.deviceId&&(a.deviceId=s.deviceId),a}return s}static supportsOutputSelection(){return"setSinkId"in HTMLAudioElement.prototype||"setSinkId"in HTMLVideoElement.prototype}static async applyOutputDevice(e,s){if(!this.supportsOutputSelection())return console.warn("Output device selection (setSinkId) is not supported in this browser"),!1;try{return await e.setSinkId(s),!0}catch(a){return console.warn(`Failed to set output device: ${a.message}`),!1}}static onDeviceChange(e,s=300){var c;if(!((c=navigator.mediaDevices)!=null&&c.addEventListener))return console.warn("Device change detection is not supported in this browser"),()=>{};this.deviceChangeHandler||(this.deviceChangeHandler=()=>{this.debounceTimeout&&clearTimeout(this.debounceTimeout),this.debounceTimeout=setTimeout(()=>{console.log(`🎤 Device change detected, notifying ${this.deviceChangeListeners.size} listener(s)`),this.deviceChangeListeners.forEach((d,h)=>{try{h()}catch(b){console.error("Error in device change callback:",b)}})},s)},navigator.mediaDevices.addEventListener("devicechange",this.deviceChangeHandler));const a=()=>{var d;this.deviceChangeListeners.delete(e),this.deviceChangeListeners.size===0&&this.deviceChangeHandler&&(this.debounceTimeout&&(clearTimeout(this.debounceTimeout),this.debounceTimeout=null),(d=navigator.mediaDevices)==null||d.removeEventListener("devicechange",this.deviceChangeHandler),this.deviceChangeHandler=null)};return this.deviceChangeListeners.set(e,{cleanup:a}),console.log(`🎤 Registered device change listener (total: ${this.deviceChangeListeners.size})`),a}static findDeviceByLabel(e,s){return e.find(a=>a.label===s)||null}static getDeviceLabel(e,s=0){if(e.label&&e.label.trim()!=="")return e.label;const a=e.kind==="audioinput"?"Microphone":e.kind==="audiooutput"?"Speaker":"Device";return e.deviceId&&e.deviceId!=="default"?`${a} (${e.deviceId.substring(0,6)})`:`${a} ${s+1}`}static _isSafari(){const e=navigator.userAgent.toLowerCase();return e.includes("safari")&&!e.includes("chrome")}static dispose(){var e;this.deviceChangeListeners.forEach(s=>s.cleanup()),this.deviceChangeListeners.clear(),this.debounceTimeout&&(clearTimeout(this.debounceTimeout),this.debounceTimeout=null),this.deviceChangeHandler&&((e=navigator.mediaDevices)==null||e.removeEventListener("devicechange",this.deviceChangeHandler),this.deviceChangeHandler=null)}}DeviceManager.deviceChangeListeners=new Map;DeviceManager.deviceChangeHandler=null;DeviceManager.debounceTimeout=null;class AudioContextManager{constructor(e={}){this._audioContext=null,this._isLocked=!0,this._autoUnlockRegistered=!1,this._unlockHandlers=[],this._silentAudioElement=null,this._iosAudioUnlocked=!1,this._unlockInProgress=!1,this._hasPlayedRealAudio=!1,this._speakerStream=null,this._options={sampleRate:e.sampleRate??44100,latencyHint:e.latencyHint??"interactive",autoUnlock:e.autoUnlock??!1,audioSessionType:e.audioSessionType??"playback"},this._platform=this._detectPlatform(),this._options.autoUnlock&&this.registerAutoUnlock()}getContext(){return this._audioContext||(this._audioContext=new AudioContext({sampleRate:this._options.sampleRate,latencyHint:this._options.latencyHint}),this._audioContext.state==="running"&&(this._isLocked=!1)),this._audioContext}needsUnlock(){return this._audioContext?this._audioContext.state==="suspended"||this._isLocked:this._platform==="ios"||this._platform==="android"}async ensureUnlocked(){const e=this.getContext();if(e.state==="running")return this._isLocked=!1,!0;try{await e.resume(),(this._platform==="ios"||this._platform==="safari")&&await this._unlockIOSAudio(e);const a=e.state;return this._isLocked=a!=="running",!this._isLocked}catch(a){return console.warn("[AudioContextManager] Failed to unlock audio context:",a),!1}}registerAutoUnlock(){if(this._autoUnlockRegistered)return;const e=async()=>{await this.ensureUnlocked()&&this._removeUnlockHandlers()};["click","touchstart","touchend","keydown"].forEach(a=>{const c=()=>{e()};document.addEventListener(a,c,{once:!0,passive:!0}),this._unlockHandlers.push(()=>{document.removeEventListener(a,c)})}),this._autoUnlockRegistered=!0}getPlatformGuidance(){switch(this._platform){case"ios":return["Tap the screen to enable audio","Audio playback requires user interaction on iOS","Use headphones for better audio quality","Silent mode bypass is automatically enabled"];case"android":return["Tap the screen to enable audio","Grant microphone permission when prompted","Check volume settings if no sound"];case"safari":return["Click anywhere to enable audio","Safari requires user interaction for audio playback","Ensure autoplay is allowed in browser settings"];case"desktop":default:return["Click to start audio if needed","Grant microphone permission when prompted"]}}getState(){const e=this._audioContext;return{platform:this._platform,isLocked:this._isLocked,contextState:e?e.state:"suspended",autoUnlockRegistered:this._autoUnlockRegistered,iosAudioUnlocked:this._iosAudioUnlocked}}async dispose(){this._removeUnlockHandlers(),this._silentAudioElement&&(this._silentAudioElement.pause(),this._silentAudioElement.src="",this._silentAudioElement.remove(),this._silentAudioElement=null),this._audioContext&&(this._audioContext.state!=="closed"&&await this._audioContext.close(),this._audioContext=null),this._isLocked=!0,this._iosAudioUnlocked=!1,this._unlockInProgress=!1,this._hasPlayedRealAudio=!1,this._autoUnlockRegistered=!1,this.releaseSpeakerRouting()}_detectPlatform(){var a;const e=navigator.userAgent.toLowerCase(),s=((a=navigator.platform)==null?void 0:a.toLowerCase())||"";return/iphone|ipad|ipod/.test(e)||s.includes("mac")&&"ontouchend"in document?"ios":/android/.test(e)?"android":/safari/.test(e)&&!/chrome/.test(e)?"safari":"desktop"}_getSilentWav(e){return AudioContextManager.SILENT_WAV_44100}async _unlockIOSAudio(e){if(!(this._iosAudioUnlocked||this._unlockInProgress)){this._unlockInProgress=!0;try{if("audioSession"in navigator)try{const s=this._options.audioSessionType||"playback";navigator.audioSession.type=s==="play-and-record"?"play-and-record":"playback",console.log(`[AudioContextManager] ✓ AudioSession set to ${s} mode`)}catch(s){console.warn("[AudioContextManager] AudioSession API failed:",s)}if(!this._silentAudioElement){const s=document.createElement("audio");s.setAttribute("x-webkit-airplay","deny"),s.preload="auto",s.loop=!0,s.volume=.01,s.src=this._getSilentWav(e.sampleRate),s.style.position="fixed",s.style.left="-9999px",s.style.opacity="0",s.style.pointerEvents="none",document.body.appendChild(s),s.load(),this._silentAudioElement=s;try{await s.play(),console.log("[AudioContextManager] ✓ Silent HTML audio playing (silent mode bypass active)"),this._iosAudioUnlocked=!0}catch(a){console.warn("[AudioContextManager] Silent HTML audio play failed:",a),s.remove(),this._silentAudioElement=null}}await this._playSilentBuffer(e)}finally{this._unlockInProgress=!1}}}stopSilentAudioLoop(){this._silentAudioElement&&this._iosAudioUnlocked&&!this._hasPlayedRealAudio&&(this._hasPlayedRealAudio=!0,this._silentAudioElement.loop=!1,console.log("[AudioContextManager] Silent audio loop will stop after first real audio playback"))}async _playSilentBuffer(e){return new Promise(s=>{const a=e.createBuffer(1,1,e.sampleRate),c=e.createBufferSource();c.buffer=a,c.connect(e.destination),c.onended=()=>s(),c.start(0)})}_removeUnlockHandlers(){this._unlockHandlers.forEach(e=>e()),this._unlockHandlers=[],this._autoUnlockRegistered=!1}isMobile(){return this._platform==="ios"||this._platform==="android"}isIOS(){return this._platform==="ios"}isSafari(){return this._platform==="safari"||this._platform==="ios"}async ensureSpeakerRouting(){if(this._speakerStream||this._platform!=="ios")return!0;try{const e=await navigator.mediaDevices.getUserMedia({audio:!0});return e.getAudioTracks().forEach(s=>{s.enabled=!1}),this._speakerStream=e,!0}catch{return!1}}releaseSpeakerRouting(){var e;(e=this._speakerStream)==null||e.getTracks().forEach(s=>s.stop()),this._speakerStream=null}}AudioContextManager.SILENT_WAV_44100="data:audio/wav;base64,UklGRiQAAABXQVZFZm10IBAAAAABAAEARKwAAIhYAQACABAAZGF0YQAAAAA=";let instance=null;function getAudioContextManager(){return instance||(instance=new AudioContextManager({sampleRate:44100,audioSessionType:"playback",autoUnlock:!0})),instance}const getSharedAudioContext=()=>getAudioContextManager().getContext(),ensureAudioUnlocked=()=>getAudioContextManager().ensureUnlocked(),ensureiOSSpeaker=()=>{const o=getAudioContextManager();if(typeof o.ensureSpeakerRouting=="function")return o.ensureSpeakerRouting()};function upgradeToPlayAndRecord(){if("audioSession"in navigator)try{navigator.audioSession.type="play-and-record"}catch{}}class STTModuleOptions{constructor(){or(this,"deviceId");or(this,"endpointing",{minEndOfTurnSilence:500,maxTurnSilence:3e3,silenceTimeout:2e3});or(this,"callbacks",{});or(this,"apiBaseUrl","");or(this,"language","en");or(this,"persistentMode",!1);or(this,"inactivityTimeout",6e4);or(this,"keyterms")}}class STTModule{constructor(e={}){or(this,"provider",null);this.options=e,this.options={...new STTModuleOptions,...e}}async init(){if(this.provider)return;const e={deviceId:this.options.deviceId,endpointing:this.options.endpointing,callbacks:this.options.callbacks,apiBaseUrl:this.options.apiBaseUrl,persistentMode:this.options.persistentMode,inactivityTimeout:this.options.inactivityTimeout,language:this.options.language,keyterms:this.options.keyterms},{SonioxProvider:s}=await __vitePreload(async()=>{const{SonioxProvider:a}=await import("./soniox-Ddqf0iXU.js");return{SonioxProvider:a}},[]);this.provider=new s(e)}async start(){this.provider||await this.init(),await this.provider.start()}async stop(){var e;await((e=this.provider)==null?void 0:e.stop())}isListening(){var e;return((e=this.provider)==null?void 0:e.isListening())||!1}mute(){var e,s;(s=(e=this.provider)==null?void 0:e.mute)==null||s.call(e)}unmute(){var e,s;(s=(e=this.provider)==null?void 0:e.unmute)==null||s.call(e)}finalize(){var e,s;(s=(e=this.provider)==null?void 0:e.finalize)==null||s.call(e)}updateCallbacks(e){var s,a;this.options.callbacks=e,(a=(s=this.provider)==null?void 0:s.updateCallbacks)==null||a.call(s,e)}getAudioStream(){var e,s;return((s=(e=this.provider)==null?void 0:e.getAudioStream)==null?void 0:s.call(e))||null}destroy(){this.provider&&(this.provider.destroy(),this.provider=null)}}function playTone(o,e,s){const a=getSharedAudioContext(),c=a.createOscillator(),d=a.createGain();c.type="sine",c.frequency.value=o,d.gain.setValueAtTime(0,a.currentTime),d.gain.linearRampToValueAtTime(s,a.currentTime+.02),d.gain.exponentialRampToValueAtTime(.01,a.currentTime+e/1e3),c.connect(d),d.connect(a.destination),c.start(a.currentTime),c.stop(a.currentTime+e/1e3)}function playListeningChime(){playTone(523,300,.5)}function playWordTick(){playTone(1047,60,.08)}function playProcessingChime(){playTone(392,200,.3)}function playBargeInChime(){playTone(659,80,.3),setTimeout(()=>playTone(784,80,.25),90)}function playWelcomeChime(){playTone(523,150,.3),setTimeout(()=>playTone(659,150,.25),160),setTimeout(()=>playTone(784,200,.2),320)}const INCOMPLETE_ENDINGS=new Set(["and","but","or","so","because","although","though","while","since","unless","if","when","where","to","for","with","about","of","at","in","on","from","by","into","through","the","a","an","this","that","these","those","my","your","his","her","our","their","i","you","we","they","he","she","it","um","uh","like","well"]),CONTINUATION_MARKERS=["you know","i mean","the thing is","let me think","first of all","on one hand","for example"],COMPLETE_ENDINGS=new Set(["yeah","yes","no","nah","okay","ok","sure","right","thanks","bye","absolutely","definitely","exactly","correct","true","false"]);function isTranscriptComplete(o){const e=o.trim();if(!e)return!1;if(/[.?!]$/.test(e))return!0;const s=e.toLowerCase().split(/\s+/);if(s.length===0)return!1;const a=s[s.length-1];if(COMPLETE_ENDINGS.has(a))return!0;if(INCOMPLETE_ENDINGS.has(a))return!1;const c=e.toLowerCase();for(const d of CONTINUATION_MARKERS)if(c.endsWith(d))return!1;return!(s.length<=2)}function computeSilenceThreshold(o){let e=700;o.lastAiMessage&&/\?\s*$/.test(o.lastAiMessage.trim())&&(e-=300),o.lastAiMessage&&o.lastAiMessage.split(/\s+/).length>60&&(e+=400),isTranscriptComplete(o.transcript)||(e+=600);const s=o.transcript.trim().toLowerCase().split(/\s+/),a=s[s.length-1];return(a==="um"||a==="uh"||a==="hmm")&&(e+=500),o.utteranceWordCount<=3&&isTranscriptComplete(o.transcript)&&(e-=200),Math.max(200,Math.min(2e3,e))}const log$1=logger.forComponent("useVoice");function useVoice(o){const{roomId:e,participantId:s,isHotSeat:a,roomStatus:c,inputDeviceId:d,outputDeviceId:h,aiStreamContent:b,lastAiChatMessage:j}=o,$=reactExports.useRef(o.onInterrupt);$.current=o.onInterrupt;const[_e,it]=reactExports.useState(!1),[at,lt]=reactExports.useState(!1),[dt,mt]=reactExports.useState("off"),[vt,tt]=reactExports.useState(!0),[nt,ot]=reactExports.useState(!1),[ht,xt]=reactExports.useState(0),[Et,_t]=reactExports.useState(""),[Rt,Bt]=reactExports.useState(!1),[Mt,Ht]=reactExports.useState(!1),er=reactExports.useRef(!1),Yt=reactExports.useRef(null),rr=reactExports.useRef(null),Jt=reactExports.useRef(null),Dt=reactExports.useRef(!1),gr=reactExports.useRef(!0),Lt=reactExports.useRef(a);Lt.current=a;const Vt=reactExports.useRef(s);Vt.current=s;const nr=reactExports.useRef("");nt&&b&&b.length>nr.current.length&&(nr.current=b);const Zt=reactExports.useRef(!1),sr=reactExports.useRef(()=>{}),Mr=reactExports.useRef(0),ir=reactExports.useRef(0),Cr=reactExports.useRef(0),It=reactExports.useRef(!1),tr=reactExports.useRef(0),fr=reactExports.useRef(!1),Ft=reactExports.useRef(null),lr=reactExports.useRef(0),Or=reactExports.useRef(0),Sr=reactExports.useRef(0),Nr=reactExports.useRef(null),Tr=reactExports.useRef(null),Kr=reactExports.useRef(0),qt=reactExports.useRef([]),ar=reactExports.useRef(null),yr=reactExports.useRef(!1),xr=reactExports.useRef(null),Rr=reactExports.useRef("");j&&(Rr.current=j),reactExports.useEffect(()=>{c==="live"&&!_e&&(ensureAudioUnlocked().catch(()=>{}),it(!0),mt("connecting"))},[c]),reactExports.useEffect(()=>{if(!_e)return;const st=async()=>{var gt;await ensureAudioUnlocked(),(gt=Yt.current)==null||gt.resumePlayback()},ft=["click","touchstart","keydown"];return ft.forEach(gt=>document.addEventListener(gt,st,{passive:!0})),()=>{ft.forEach(gt=>document.removeEventListener(gt,st))}},[_e]),reactExports.useEffect(()=>{if(!_e||c!=="live"||!s)return;const st=getSharedAudioContext(),ft=new WordSyncPlayer(()=>{var wt;return((wt=Yt.current)==null?void 0:wt.getCurrentTime())??0});return ft.onChange=wt=>xt(wt),rr.current=ft,(async()=>{const wt=new AudioReceiver({transport:"both",audioContext:st,peerId:Vt.current??void 0,role:Lt.current?"speaker":"listener"});Yt.current=wt,wt.on({onTTSStart:(ut,bt)=>{var Ct;if(!ut){log$1.debug("ignoring empty TTS start");return}const Pt=(bt??0)>0;if(log$1.info("TTS start",{textLen:ut.length,...Pt&&{spokenWords:bt}}),lr.current++,ot(!0),Dt.current=!0,_t(""),er.current=!1,Bt(!1),Zt.current=!1,fr.current=!1,yr.current=!1,Ft.current&&(clearTimeout(Ft.current),Ft.current=null),Sr.current=0,Tr.current=null,wt.resumePlayback(),nr.current=ut,ft.reset(),Pt&&ft.revealAll(bt),xt(Pt?bt:0),ir.current=wt.getCurrentTime(),Cr.current=0,It.current=!1,tr.current=0,Or.current=0,Lt.current&&Jt.current&&!gr.current&&(Mr.current=Date.now(),Jt.current.mute(),Kr.current++,Jt.current.getAudioStream())){const $t=Nr.current??new EnergyMonitor;Nr.current=$t;const Ot=()=>{var zt;return((zt=Jt.current)==null?void 0:zt.getAudioStream())??null};$t.onVoiceDetected=()=>{var zt,Xt,cr;!Dt.current||fr.current||gr.current||(log$1.info("energy: voice detected → muting TTS locally + sending tts-pause to server"),fr.current=!0,(zt=Yt.current)==null||zt.pausePlayback(),(Xt=Yt.current)==null||Xt.sendTTSPause(),playBargeInChime(),(cr=Jt.current)==null||cr.unmute(),Mr.current=0,Ft.current&&clearTimeout(Ft.current),Ft.current=setTimeout(()=>{var _r,$r;fr.current&&(log$1.info("barge-in: no STT after energy, resuming TTS"),fr.current=!1,Ht(!1),Ft.current=null,(_r=Yt.current)==null||_r.sendTTSResume(),Dt.current&&(($r=Jt.current)==null||$r.mute(),$t.unsuppress()))},2500))};const Gt=Kr.current===1?5e3:0;$t.start(Ot,st),$t.active&&Gt>0&&($t.suppress(),log$1.info("energy: suppressed for first TTS",{suppressMs:Gt}),setTimeout(()=>{Dt.current&&$t.unsuppress()},Gt)),$t.active||(log$1.warn("energy monitor failed to start (no stream), leaving STT unmuted"),(Ct=Jt.current)==null||Ct.unmute())}},onTimestamps:(ut,bt,Pt)=>{var zt;if(Zt.current)return;const Ct=Sr.current>0,kt=ut.map((Xt,cr)=>({w:Xt,s:bt[cr],e:Pt[cr]})).filter(({w:Xt})=>!/<|>|^\/>$|^value=/.test(Xt)),$t=kt.map(({w:Xt})=>Xt),Ot=kt.map(({s:Xt})=>Xt),Gt=kt.map(({e:Xt})=>Xt);if($t.length!==0)if(Or.current+=$t.length,wt.rtcConnected)It.current||(Cr.current=wt.getCurrentTime()-(Ot[0]??0)+.25,It.current=!0,log$1.debug("RTC word sync calibrated",{ttsStart:Cr.current.toFixed(3),firstWordAt:(zt=Ot[0])==null?void 0:zt.toFixed(3)})),ft.onTimestampsAbsolute($t,Ot,Cr.current,Ct),Gt.length>0&&(tr.current=Math.max(tr.current,Gt[Gt.length-1]));else{const Xt=Math.max(ir.current,wt.getCurrentTime());Ct||ft.onTimestamps($t,Ot,Gt,Xt)}},onTTSEnd:ut=>{var bt,Pt;if(!Dt.current){log$1.debug("ignoring TTS end (no active TTS)");return}if(Zt.current||ut)log$1.info("TTS end (interrupted)",{local:Zt.current,server:ut}),(bt=Nr.current)==null||bt.stop(),Sr.current=0,Lt.current&&!gr.current&&((Pt=Jt.current)==null||Pt.unmute()),wt.resumePlayback(),ft.reset(),ot(!1),Dt.current=!1,Lt.current&&!gr.current&&playListeningChime();else{const Ct=wt.rtcConnected?tr.current-(wt.getCurrentTime()-Cr.current):ir.current-wt.getCurrentTime(),kt=Math.min(Math.max(0,(Ct||0)*1e3)+150,6e4),$t=lr.current;log$1.info("TTS end, waiting for playback",{remainingMs:Math.round(kt)});const Ot=()=>{var Gt,zt;if(lr.current===$t){if(Sr.current>0){Tr.current=Ot;return}Tr.current=null,Or.current>0&&ft.revealAll(Or.current),ot(!1),Ht(!1),Dt.current=!1,(Gt=Nr.current)==null||Gt.stop(),Lt.current&&!gr.current&&((zt=Jt.current)==null||zt.unmute(),playListeningChime())}};setTimeout(Ot,kt)}},onTTSPause:()=>{if(Sr.current>0){log$1.warn("TTS pause IGNORED (already paused)");return}if(!Dt.current){log$1.warn("TTS pause IGNORED (not speaking)");return}Ht(!0);const ut=wt.getDebugState();log$1.info("TTS paused",{spokenWords:ft.spokenCount,totalWords:ft.totalWords,bargePaused:fr.current,rtc:ut==null?void 0:ut.rtc}),ft.pause(),Sr.current=wt.getCurrentTime()},onTTSResume:()=>{if(Sr.current===0){log$1.warn("TTS resume IGNORED (not paused)");return}Ht(!1);const ut=wt.getCurrentTime()-Sr.current,bt=Math.min(ut,10),Pt=ft.totalWords-ft.spokenCount;if(It.current&&(Cr.current+=bt),log$1.info("TTS resumed",{pauseSec:bt.toFixed(2),remaining:Pt,bargePaused:fr.current}),Sr.current=0,wt.resumePlayback(),Pt>0&&ft.rescheduleFrom(Cr.current),Tr.current){const Ct=Tr.current;Tr.current=null;const kt=Pt>0?Math.max(0,(tr.current-(wt.getCurrentTime()-Cr.current))*1e3)+150:150;setTimeout(Ct,kt)}},onPCMChunk:()=>{ir.current=wt.getScheduledUntil()},onWebRTCConnected:()=>{log$1.info("WebRTC transport connected"),playWelcomeChime(),mt("listening")},onWebRTCDisconnected:()=>{log$1.warn("WebRTC disconnected, falling back to WS")}}),wt.subscribe(e)})(),()=>{var wt,ut;(wt=Yt.current)==null||wt.unsubscribe(),Yt.current=null,ft.reset(),rr.current=null,ot(!1),Dt.current=!1,xt(0),fr.current=!1,Ft.current&&(clearTimeout(Ft.current),Ft.current=null),ar.current&&(clearTimeout(ar.current),ar.current=null),qt.current=[],Sr.current=0,Tr.current=null,(ut=Nr.current)==null||ut.stop()}},[_e,c,e,s]);const Er=reactExports.useCallback(()=>{var st;Mr.current=Date.now(),(st=Jt.current)==null||st.unmute(),playListeningChime()},[]),wr=reactExports.useCallback(async()=>{if(Jt.current||!a||c!=="live")return;log$1.info("starting STT for hot seat"),upgradeToPlayAndRecord(),await ensureiOSSpeaker(),mt("connecting");const st=new STTModule({callbacks:{onStart:()=>{var gt;log$1.info("STT started"),mt("listening"),playListeningChime();const ft=(gt=Jt.current)==null?void 0:gt.getAudioStream();if(ft&&Yt.current){const wt=new MediaStream(ft.getAudioTracks().map(ut=>ut.clone()));Yt.current.addMicTrack(wt)}},onTranscript:ft=>{var gt,wt;if(Date.now()-Mr.current<600){log$1.debug("transcript ignored (warmup)",ft.text.slice(0,30));return}if(!er.current){if(log$1.debug("transcript",ft.text.slice(0,50)),Dt.current&&!fr.current&&(log$1.info("barge-in: pausing TTS (transcript fallback)",ft.text.slice(0,40)),fr.current=!0,(gt=Yt.current)==null||gt.pausePlayback(),(wt=Yt.current)==null||wt.sendTTSPause(),playBargeInChime()),fr.current){if(ft.text.trim().split(/\s+/).length>=3){log$1.info("barge-in confirmed (interim)",ft.text.slice(0,80)),fr.current=!1,Ft.current&&(clearTimeout(Ft.current),Ft.current=null),sr.current(),_t(ft.text);return}Ft.current&&clearTimeout(Ft.current),Ft.current=setTimeout(()=>{var bt;fr.current&&(log$1.info("barge-in: false alarm, resuming TTS"),fr.current=!1,Ht(!1),Ft.current=null,(bt=Yt.current)==null||bt.sendTTSResume())},1500),_t(ft.text);return}if(_t(ft.text),yr.current&&ar.current&&(clearTimeout(ar.current),ar.current=null),playWordTick(),!Dt.current&&!fr.current&&!yr.current){xr.current&&clearTimeout(xr.current);const ut=ft.text.trim().split(/\s+/),bt=computeSilenceThreshold({transcript:ft.text,lastAiMessage:Rr.current,utteranceWordCount:ut.length});xr.current=setTimeout(()=>{var Pt;xr.current=null,isTranscriptComplete(ft.text)&&(log$1.info("soft endpoint: finalizing",{threshold:bt,text:ft.text.slice(0,50)}),(Pt=Jt.current)==null||Pt.finalize())},bt)}}},onEnd:ft=>{var gt;if(xr.current&&(clearTimeout(xr.current),xr.current=null),fr.current&&(log$1.info("barge-in confirmed",ft.slice(0,80)),fr.current=!1,Ft.current&&(clearTimeout(Ft.current),Ft.current=null),sr.current()),log$1.info("speech final",ft.slice(0,80)),yr.current){qt.current.push(ft),_t(qt.current.join(" ").trim()),ar.current&&clearTimeout(ar.current),ar.current=setTimeout(()=>{var ut;ar.current=null,yr.current=!1;const wt=qt.current.join(" ").trim();qt.current=[],wt?(log$1.info("dispatching utterance via micro",wt.slice(0,100)),_t(wt),er.current=!0,Bt(!0),playProcessingChime(),(ut=Yt.current)==null||ut.sendMicroEvent("turn_end",wt,Vt.current||void 0)):_t("")},1e3);return}_t(ft),er.current=!0,Bt(!0),playProcessingChime(),(gt=Yt.current)==null||gt.sendMicroEvent("turn_end",ft,Vt.current||void 0)},onError:ft=>{if(ft.message==="mic-permission-denied"){log$1.warn("Mic permission denied — hot-seat requires mic access"),mt("error");return}log$1.error("STT error",ft),mt("error")}},persistentMode:!0,deviceId:d||void 0,endpointing:{minEndOfTurnSilence:2e3}});Jt.current=st,st.start().catch(ft=>{log$1.error("STT start failed",ft),mt("error")})},[a,c,d]);reactExports.useEffect(()=>{if(!_e||!a||c!=="live"){Jt.current&&(log$1.info("stopping STT (no longer hot seat or inactive)"),Jt.current.destroy(),Jt.current=null,mt(_e?"listening":"off")),tt(!0),gr.current=!0;return}if(!gr.current)return wr(),()=>{Jt.current&&(Jt.current.destroy(),Jt.current=null)}},[_e,a,c,e,d,wr]),reactExports.useEffect(()=>{var ft;const st=Yt.current;if(!(!st||!_e||c!=="live"))if(a&&!vt){const gt=(ft=Jt.current)==null?void 0:ft.getAudioStream();if(gt){const wt=new MediaStream(gt.getAudioTracks().map(ut=>ut.clone()));st.addMicTrack(wt)}}else st.removeMicTrack()},[a,_e,c,vt]);const vr=reactExports.useCallback(async()=>{if(!_e){await ensureAudioUnlocked(),it(!0),mt("connecting");return}const st=Yt.current;st&&(st.muted?(st.unmute(),lt(!1)):(st.mute(),lt(!0)))},[_e]),zr=reactExports.useCallback(()=>{var st;vt?(tt(!1),gr.current=!1,Jt.current?Er():(Mr.current=Date.now(),wr())):((st=Jt.current)==null||st.mute(),tt(!0),gr.current=!0)},[vt,wr,Er]),Dr=reactExports.useCallback(()=>{var gt,wt,ut,bt,Pt,Ct;if(log$1.info("interruptAi called",{aiSpeaking:Dt.current,participantId:Vt.current}),!Dt.current||!Vt.current)return;Zt.current=!0,yr.current=!0;const st=((gt=rr.current)==null?void 0:gt.spokenCount)??0,ft=st>0&&nr.current?nr.current.split(/\s+/).filter(Boolean).slice(0,st).join(" "):void 0;(wt=Yt.current)==null||wt.stopPlayback(),(ut=Yt.current)==null||ut.pausePlayback(),(bt=rr.current)==null||bt.reset(),(Pt=Nr.current)==null||Pt.stop(),ot(!1),Ht(!1),Dt.current=!1,ft&&st>0&&((Ct=$.current)==null||Ct.call($,ft,st)),log$1.info("interrupting AI — sending postInterrupt",{wordsSpoken:st}),api.actions.postInterrupt({roomId:e,participantId:Vt.current,spokenText:ft,spokenWords:st}).catch(kt=>{log$1.error("interrupt failed",kt)})},[e]);sr.current=Dr,reactExports.useEffect(()=>{var st;h!==void 0&&((st=Yt.current)==null||st.setOutputDevice(h))},[h]),reactExports.useEffect(()=>()=>{var st,ft;(st=Jt.current)==null||st.destroy(),(ft=Yt.current)==null||ft.unsubscribe()},[]);const Fr=reactExports.useCallback(()=>{er.current=!1,_t(""),Bt(!1)},[]),pt=reactExports.useCallback(()=>{var st;log$1.info("DEBUG BUTTON: pause"),(st=Yt.current)==null||st.sendTTSPause()},[]),g=reactExports.useCallback(()=>{var st;log$1.info("DEBUG BUTTON: resume"),(st=Yt.current)==null||st.sendTTSResume()},[]),et=reactExports.useCallback(()=>{var st,ft;return{interrupted:Zt.current,aiSpeaking:Dt.current,postInterrupt:yr.current,ttsGen:lr.current,ttsWordCount:Or.current,wordSync:((st=rr.current)==null?void 0:st.getDebugState())??null,receiver:((ft=Yt.current)==null?void 0:ft.getDebugState())??null}},[]);return{voiceEnabled:_e,voiceState:dt,aiSpeaking:nt,spokenWordCount:ht,interimTranscript:Et,microPending:Rt,clearInterim:Fr,aiSpeakingText:nt?nr.current:"",speakerMuted:at,toggleVoice:vr,toggleMute:zr,isMuted:vt,bargeActive:Mt,interruptAi:Dr,debugPauseRTC:pt,debugResumeRTC:g,getDebugState:et}}const STORAGE_KEY$1="audio-settings";function loadSettings$1(){try{const o=localStorage.getItem(STORAGE_KEY$1);if(o)return JSON.parse(o)}catch{}return{inputDeviceId:"",outputDeviceId:""}}function saveSettings(o){localStorage.setItem(STORAGE_KEY$1,JSON.stringify(o))}function useAudioSettings(){const[o,e]=reactExports.useState(loadSettings$1),[s,a]=reactExports.useState([]),[c,d]=reactExports.useState([]),h=reactExports.useCallback(async()=>{try{const{inputs:$,outputs:_e}=await DeviceManager.enumerateDevices();a($),d(_e),e(it=>{const at=!it.inputDeviceId||$.some(mt=>mt.deviceId===it.inputDeviceId),lt=!it.outputDeviceId||_e.some(mt=>mt.deviceId===it.outputDeviceId),dt={inputDeviceId:at?it.inputDeviceId:"",outputDeviceId:lt?it.outputDeviceId:""};return(dt.inputDeviceId!==it.inputDeviceId||dt.outputDeviceId!==it.outputDeviceId)&&saveSettings(dt),dt})}catch{}},[]);reactExports.useEffect(()=>(h(),DeviceManager.onDeviceChange(()=>h())),[h]);const b=reactExports.useCallback($=>{e(_e=>{const it={..._e,inputDeviceId:$};return saveSettings(it),it})},[]),j=reactExports.useCallback($=>{e(_e=>{const it={..._e,outputDeviceId:$};return saveSettings(it),it})},[]);return{inputDeviceId:o.inputDeviceId,outputDeviceId:o.outputDeviceId,setInputDevice:b,setOutputDevice:j,inputDevices:s,outputDevices:c,supportsOutput:DeviceManager.supportsOutputSelection()}}function AudioSettingsModal({open:o,onClose:e}){const{inputDeviceId:s,outputDeviceId:a,setInputDevice:c,setOutputDevice:d,inputDevices:h,outputDevices:b,supportsOutput:j}=useAudioSettings();return o?jsxRuntimeExports.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",onClick:e,children:jsxRuntimeExports.jsxs("div",{className:"bg-surface rounded-xl border border-border/60 p-5 w-80 shadow-lg",onClick:$=>$.stopPropagation(),children:[jsxRuntimeExports.jsx("h3",{className:"text-sm font-semibold mb-4",children:"Audio Settings"}),jsxRuntimeExports.jsx("label",{className:"block text-xs text-muted mb-1",children:"Microphone"}),jsxRuntimeExports.jsxs("select",{value:s,onChange:$=>c($.target.value),className:"w-full mb-4 px-2 py-1.5 text-xs rounded-md bg-surface-2 border border-border/60 text-text",children:[jsxRuntimeExports.jsx("option",{value:"",children:"System Default"}),h.map($=>jsxRuntimeExports.jsx("option",{value:$.deviceId,children:$.label},$.deviceId))]}),j&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("label",{className:"block text-xs text-muted mb-1",children:"Speaker"}),jsxRuntimeExports.jsxs("select",{value:a,onChange:$=>d($.target.value),className:"w-full mb-4 px-2 py-1.5 text-xs rounded-md bg-surface-2 border border-border/60 text-text",children:[jsxRuntimeExports.jsx("option",{value:"",children:"System Default"}),b.map($=>jsxRuntimeExports.jsx("option",{value:$.deviceId,children:$.label},$.deviceId))]})]}),jsxRuntimeExports.jsx("button",{onClick:e,className:"w-full py-1.5 text-xs rounded-md bg-surface-2 border border-border/60 text-muted hover:text-text transition-all",children:"Close"})]})}):null}function NotifyForm({roomId:o,roomTitle:e}){const[s,a]=reactExports.useState(""),[c,d]=reactExports.useState("idle"),h=async b=>{if(b.preventDefault(),!(!s.trim()||c==="submitting")){d("submitting");try{if(!(await fetch("https://bodify.bod.ee/api/leads/para-li/collect",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:s.trim(),source:"scheduled-room",meta:{roomId:o,roomTitle:e}})})).ok)throw new Error;d("success")}catch{d("error"),setTimeout(()=>d("idle"),3e3)}}};return c==="success"?jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-center gap-2 mb-8 px-4 py-3 rounded-xl bg-surface border border-border/60",children:[jsxRuntimeExports.jsx("svg",{className:"w-4 h-4 text-green-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:jsxRuntimeExports.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}),jsxRuntimeExports.jsx("span",{className:"text-sm text-muted",children:"We'll notify you when the session starts!"})]}):jsxRuntimeExports.jsxs("form",{onSubmit:h,className:"flex items-center justify-center gap-2 mb-8 max-w-sm mx-auto",children:[jsxRuntimeExports.jsx("input",{type:"email",value:s,onChange:b=>a(b.target.value),placeholder:"your@email.com",required:!0,className:"flex-1 h-10 px-3 rounded-lg bg-surface border border-border/60 text-sm text-text placeholder:text-muted/50 outline-none focus:border-violet-400/60 transition-colors"}),jsxRuntimeExports.jsx("button",{type:"submit",disabled:c==="submitting",className:"h-10 px-4 rounded-lg bg-violet-500 text-white text-sm font-medium hover:bg-violet-400 disabled:opacity-50 transition-colors shrink-0",children:c==="submitting"?"...":c==="error"?"Retry":"Notify Me"})]})}/**
* @license lucide-react v0.577.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const mergeClasses=(...o)=>o.filter((e,s,a)=>!!e&&e.trim()!==""&&a.indexOf(e)===s).join(" ").trim();/**
* @license lucide-react v0.577.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const toKebabCase=o=>o.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
* @license lucide-react v0.577.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const toCamelCase=o=>o.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,s,a)=>a?a.toUpperCase():s.toLowerCase());/**
* @license lucide-react v0.577.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const toPascalCase=o=>{const e=toCamelCase(o);return e.charAt(0).toUpperCase()+e.slice(1)};/**
* @license lucide-react v0.577.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/var defaultAttributes={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"};/**
* @license lucide-react v0.577.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const hasA11yProp=o=>{for(const e in o)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1};/**
* @license lucide-react v0.577.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Icon=reactExports.forwardRef(({color:o="currentColor",size:e=24,strokeWidth:s=2,absoluteStrokeWidth:a,className:c="",children:d,iconNode:h,...b},j)=>reactExports.createElement("svg",{ref:j,...defaultAttributes,width:e,height:e,stroke:o,strokeWidth:a?Number(s)*24/Number(e):s,className:mergeClasses("lucide",c),...!d&&!hasA11yProp(b)&&{"aria-hidden":"true"},...b},[...h.map(([$,_e])=>reactExports.createElement($,_e)),...Array.isArray(d)?d:[d]]));/**
* @license lucide-react v0.577.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const createLucideIcon=(o,e)=>{const s=reactExports.forwardRef(({className:a,...c},d)=>reactExports.createElement(Icon,{ref:d,iconNode:e,className:mergeClasses(`lucide-${toKebabCase(toPascalCase(o))}`,`lucide-${o}`,a),...c}));return s.displayName=toPascalCase(o),s};/**
* @license lucide-react v0.577.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const __iconNode$c=[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]],Bug=createLucideIcon("bug",__iconNode$c);/**
* @license lucide-react v0.577.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const __iconNode$b=[["path",{d:"M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2",key:"1fvzgz"}],["path",{d:"M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2",key:"1kc0my"}],["path",{d:"M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8",key:"10h0bg"}],["path",{d:"M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15",key:"1s1gnw"}]],Hand=createLucideIcon("hand",__iconNode$b);/**
* @license lucide-react v0.577.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const __iconNode$a=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],MessageSquare=createLucideIcon("message-square",__iconNode$a);/**
* @license lucide-react v0.577.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const __iconNode$9=[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M15 9.34V5a3 3 0 0 0-5.68-1.33",key:"1gzdoj"}],["path",{d:"M16.95 16.95A7 7 0 0 1 5 12v-2",key:"cqa7eg"}],["path",{d:"M18.89 13.23A7 7 0 0 0 19 12v-2",key:"16hl24"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M9 9v3a3 3 0 0 0 5.12 2.12",key:"r2i35w"}]],MicOff=createLucideIcon("mic-off",__iconNode$9);/**
* @license lucide-react v0.577.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const __iconNode$8=[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]],Mic=createLucideIcon("mic",__iconNode$8);/**
* @license lucide-react v0.577.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const __iconNode$7=[["path",{d:"M10.1 13.9a14 14 0 0 0 3.732 2.668 1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2 18 18 0 0 1-12.728-5.272",key:"1wngk7"}],["path",{d:"M22 2 2 22",key:"y4kqgn"}],["path",{d:"M4.76 13.582A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 .244.473",key:"10hv5p"}]],PhoneOff=createLucideIcon("phone-off",__iconNode$7);/**
* @license lucide-react v0.577.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const __iconNode$6=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Settings=createLucideIcon("settings",__iconNode$6);/**
* @license lucide-react v0.577.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const __iconNode$5=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Trash2=createLucideIcon("trash-2",__iconNode$5);/**
* @license lucide-react v0.577.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const __iconNode$4=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],Users=createLucideIcon("users",__iconNode$4);/**
* @license lucide-react v0.577.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const __iconNode$3=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]],Volume2=createLucideIcon("volume-2",__iconNode$3);/**
* @license lucide-react v0.577.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const __iconNode$2=[["path",{d:"M16 9a5 5 0 0 1 .95 2.293",key:"1fgyg8"}],["path",{d:"M19.364 5.636a9 9 0 0 1 1.889 9.96",key:"l3zxae"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"m7 7-.587.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298V11",key:"1gbwow"}],["path",{d:"M9.828 4.172A.686.686 0 0 1 11 4.657v.686",key:"s2je0y"}]],VolumeOff=createLucideIcon("volume-off",__iconNode$2);/**
* @license lucide-react v0.577.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const __iconNode$1=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]],VolumeX=createLucideIcon("volume-x",__iconNode$1);/**
* @license lucide-react v0.577.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const __iconNode=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],X=createLucideIcon("x",__iconNode),log=logger.forComponent("RoomPage");function fmtElapsed(o){const e=Math.max(0,Math.floor(o/1e3)),s=Math.floor(e/3600),a=Math.floor(e%3600/60),c=e%60,d=String(a).padStart(2,"0"),h=String(c).padStart(2,"0");return s>0?`${s}:${d}:${h}`:`${d}:${h}`}function RoomPage(){var an,hn;const{roomId:o}=useParams(),e=useDebug(),{identity:s,setName:a}=useIdentity(),[c,d]=reactExports.useState(null),[h,b]=reactExports.useState("waiting"),[j,$]=reactExports.useState(null),[_e,it]=reactExports.useState(null),[at,lt]=reactExports.useState(""),[dt,mt]=reactExports.useState([]),[vt,tt]=reactExports.useState([]),[nt,ot]=reactExports.useState(()=>o?sessionStorage.getItem(`room:${o}`):null),[ht,xt]=reactExports.useState(!1),[Et,_t]=reactExports.useState((s==null?void 0:s.displayName)??""),[Rt,Bt]=reactExports.useState([]),[Mt,Ht]=reactExports.useState(""),[er,Yt]=reactExports.useState(()=>window.innerWidth>=768),[rr,Jt]=reactExports.useState(()=>window.innerWidth>=768),[Dt,gr]=reactExports.useState(!1),[Lt,Vt]=reactExports.useState(e),[nr,Zt]=reactExports.useState(!0),[sr,Mr]=reactExports.useState(""),[ir,Cr]=reactExports.useState(null),It=reactExports.useRef(null),tr=reactExports.useRef(null),fr=reactExports.useRef(!1),Ft=(s==null?void 0:s.id)===at,lr=nt===_e,[Or,Sr]=reactExports.useState(Date.now());reactExports.useEffect(()=>{if(h!=="live")return;const Ut=setInterval(()=>Sr(Date.now()),1e3);return()=>clearInterval(Ut)},[h]);const Nr=useNavigate(),{inputDeviceId:Tr,outputDeviceId:Kr}=useAudioSettings(),qt=reactExports.useMemo(()=>{var Ut;return(Ut=Rt.filter(ur=>ur.senderId==="_ai").at(-1))==null?void 0:Ut.content},[Rt]),{voiceEnabled:ar,voiceState:yr,aiSpeaking:xr,spokenWordCount:Rr,aiSpeakingText:Er,interimTranscript:wr,microPending:vr,clearInterim:zr,speakerMuted:Dr,toggleVoice:Fr,toggleMute:pt,isMuted:g,bargeActive:et,getDebugState:st}=useVoice({roomId:o||"",participantId:nt,isHotSeat:lr,roomStatus:h,inputDeviceId:Tr,outputDeviceId:Kr,aiStreamContent:(ir==null?void 0:ir.content)||"",lastAiChatMessage:qt,onInterrupt:(Ut,ur)=>{const hr=`_interrupt_${Date.now()}`;Bt(mr=>[...mr,{id:hr,senderId:"_ai",displayName:"AI Host",content:Ut,type:"message",ts:Date.now(),interrupted:!0,spokenWords:ur}])}});reactExports.useEffect(()=>{o&&(log.debug("loading room",o),api.rooms.get(o).then(Ut=>{var mr,Br;log.info("room loaded",{roomId:o,status:Ut.status,participants:(mr=Ut.participants)==null?void 0:mr.length}),d(Ut.config),b(Ut.status),$(Ut.startedAt),it(Ut.hotSeat||null),lt(Ut.hostId),mt(Ut.participants??[]),(Br=Ut.chat)!=null&&Br.length&&Bt(Ut.chat);const ur=sessionStorage.getItem(`room:${o}`);ur&&(Ut.participants??[]).some(Wr=>Wr.id===ur)||(sessionStorage.removeItem(`room:${o}`),ot(null))}).catch(()=>{log.warn("room not found",o),Mr("Room not found")}).finally(()=>Zt(!1)))},[o]),reactExports.useEffect(()=>{!nr&&nt&&!ht&&(log.info("auto-joining room",{roomId:o,participantId:nt}),xt(!0))},[nr,nt,ht]),reactExports.useEffect(()=>{if(!o||!ht)return;let Ut=!1;const ur=[];return log.debug("subscribing to room",o),ensureConnected().then(()=>{Ut||(log.debug("subscriptions active",o),ur.push(db.on(`rooms/${o}/status`,hr=>{const mr=hr.val();typeof mr=="string"&&(log.info("status →",mr),b(mr))})),ur.push(db.on(`rooms/${o}/startedAt`,hr=>{const mr=hr.val();$(mr)})),ur.push(db.on(`rooms/${o}/hotSeat`,hr=>{const mr=hr.val();log.debug("hotSeat →",mr),it(mr||null)})),ur.push(db.onChild(`rooms/${o}/chat`,hr=>{if(hr.type==="added"){const mr=hr.val();log.debug("chat msg",{sender:mr.senderId,type:mr.type}),mr.senderId===ut.current&&mr.type==="message"&&zr(),Bt(Br=>Br.some(En=>En.id===hr.key)?Br:[...mr.senderId==="_ai"&&mr.interrupted?Br.filter(En=>!En.id.startsWith("_interrupt_")):Br,{...mr,id:hr.key}])}else if(hr.type==="changed"){const mr=hr.val();Bt(Br=>Br.filter(Wr=>!Wr.id.startsWith("_interrupt_")).map(Wr=>Wr.id===hr.key?{...mr,id:hr.key}:Wr))}})),ur.push(db.onChild(`rooms/${o}/participants`,hr=>{const mr=hr.val();log.debug("participant",hr.type,hr.key,mr==null?void 0:mr.displayName),hr.type==="added"?mt(Br=>Br.some(Wr=>Wr.id===hr.key)?Br:[...Br,{...mr,id:hr.key}]):hr.type==="changed"?mt(Br=>Br.map(Wr=>Wr.id===hr.key?{...mr,id:hr.key}:Wr)):hr.type==="removed"&&mt(Br=>Br.filter(Wr=>Wr.id!==hr.key))})),ur.push(db.onChild(`rooms/${o}/kicked`,hr=>{hr.type==="added"&&hr.key===ut.current&&(log.info("kicked from room"),sessionStorage.removeItem(`room:${o}`),Nr("/?kicked=1",{replace:!0}))})),ur.push(db.on(`rooms/${o}/ai/stream`,hr=>{const mr=hr.val();Cr(mr)})),ur.push(db.onChild(`rooms/${o}/queue`,hr=>{const mr=hr.val();hr.type==="added"?tt(Br=>Br.some(Wr=>Wr.id===hr.key)?Br:[...Br,{...mr,id:hr.key}]):hr.type==="removed"&&tt(Br=>Br.filter(Wr=>Wr.id!==hr.key))})))}),()=>{log.debug("unsubscribing",o),Ut=!0,ur.forEach(hr=>hr())}},[o,ht]);const ft=reactExports.useCallback(()=>{const Ut=tr.current;return Ut?Ut.scrollHeight-Ut.scrollTop-Ut.clientHeight<80:!0},[]);reactExports.useEffect(()=>{const Ut=tr.current;if(!Ut)return;const ur=()=>{fr.current=!ft()};return Ut.addEventListener("scroll",ur,{passive:!0}),()=>Ut.removeEventListener("scroll",ur)},[ft]);const gt=reactExports.useCallback((Ut="smooth")=>{var ur;fr.current||(ur=It.current)==null||ur.scrollIntoView({behavior:Ut})},[]);reactExports.useEffect(()=>{gt()},[Rt,wr,gt]);const wt=reactExports.useRef(0);reactExports.useEffect(()=>{if(!(bn||xr))return;const ur=Date.now();ur-wt.current<200||(wt.current=ur,gt())},[ir,xr,gt]);const ut=reactExports.useRef(nt);ut.current=nt;const bt=reactExports.useRef(o);bt.current=o,reactExports.useEffect(()=>{if(!o||!nt)return;const Ut=()=>{const ur=JSON.stringify({roomId:bt.current,participantId:ut.current});navigator.sendBeacon("/api/actions/leave",new Blob([ur],{type:"application/json"}))};return window.addEventListener("beforeunload",Ut),()=>window.removeEventListener("beforeunload",Ut)},[o,nt]),reactExports.useEffect(()=>()=>{const Ut=ut.current,ur=bt.current;ur&&Ut&&(api.actions.postLeave({roomId:ur,participantId:Ut}).catch(()=>{}),sessionStorage.removeItem(`room:${ur}`))},[]);const Pt=async Ut=>{if(Ut.preventDefault(),!(!o||!Et.trim())){if(Mr(""),ensureAudioUnlocked(),nt){log.info("re-entering room",{roomId:o,participantId:nt}),a(Et.trim()),xt(!0),api.rooms.get(o).then(ur=>{var hr,mr;(hr=ur.participants)!=null&&hr.length&&mt(ur.participants),(mr=ur.chat)!=null&&mr.length&&Bt(ur.chat),$(ur.startedAt)}).catch(()=>{});return}try{const ur=a(Et.trim());log.info("joining room",{roomId:o,displayName:Et.trim()});const hr=await api.actions.postJoin({roomId:o,displayName:Et.trim(),userId:ur.id});log.info("joined",{roomId:o,participantId:hr.participantId}),sessionStorage.setItem(`room:${o}`,hr.participantId),ot(hr.participantId),xt(!0),api.rooms.get(o).then(mr=>{var Br,Wr;(Br=mr.participants)!=null&&Br.length&&mt(mr.participants),(Wr=mr.chat)!=null&&Wr.length&&Bt(mr.chat),$(mr.startedAt)}).catch(()=>{})}catch(ur){log.warn("join failed",ur),Mr(ur instanceof Error?ur.message:"Failed to join")}}},Ct=async Ut=>{if(Ut.preventDefault(),!o||!nt||!Mt.trim())return;const ur=Mt.trim();Ht("");try{await api.actions.postChat({roomId:o,participantId:nt,content:ur})}catch{}},kt=async()=>{if(!(!o||!nt))try{ensureAudioUnlocked(),log.info("starting session",{roomId:o}),await api.actions.postStart({roomId:o,hostParticipantId:nt})}catch(Ut){log.error("start failed",Ut)}},$t=async()=>{if(!(!o||!nt))try{log.info("ending session",{roomId:o}),await api.actions.postEnd({roomId:o,hostParticipantId:nt})}catch(Ut){log.error("end failed",Ut)}},Ot=async Ut=>{if(!(!o||!nt))try{log.info("assigning seat",{roomId:o,targetId:Ut}),await api.actions.postSeat({roomId:o,participantId:Ut,hostParticipantId:nt})}catch(ur){log.error("seat failed",ur)}},Gt=async()=>{if(!(!o||!nt))try{await api.actions.postHand({roomId:o,participantId:nt})}catch(Ut){log.error("hand raise failed",Ut)}},zt=async Ut=>{if(!(!o||!nt))try{await api.actions.postAccepthand({roomId:o,queueEntryId:Ut,hostParticipantId:nt})}catch(ur){log.error("accept hand failed",ur)}},Xt=async Ut=>{if(!(!o||!nt))try{await api.actions.postDismisshand({roomId:o,queueEntryId:Ut,hostParticipantId:nt})}catch(ur){log.error("dismiss hand failed",ur)}},cr=async()=>{if(!(!o||!nt))try{await api.actions.postUnseat({roomId:o,hostParticipantId:nt})}catch(Ut){log.error("unseat failed",Ut)}},_r=async Ut=>{if(!(!o||!nt))try{await api.actions.postKick({roomId:o,participantId:Ut,hostParticipantId:nt})}catch(ur){log.error("kick failed",ur)}},$r=(ir==null?void 0:ir.status)!=null&&ir.status!=="idle"&&ir.status!=="error"||xr,bn=(ir==null?void 0:ir.status)==="streaming"||(ir==null?void 0:ir.status)==="tool_call",sn=$r,en=reactExports.useCallback(()=>b("waiting"),[]);if(nr)return jsxRuntimeExports.jsx("div",{className:"min-h-dvh flex items-center justify-center text-muted text-sm",children:"Loading..."});if(sr&&!c)return jsxRuntimeExports.jsxs("div",{className:"min-h-dvh flex flex-col items-center justify-center gap-3 text-center",children:[jsxRuntimeExports.jsx("p",{className:"text-muted",children:sr}),jsxRuntimeExports.jsx(Link,{to:"/",className:"text-sm text-accent hover:text-accent-hover",children:"Back to lobby"})]});if(h==="scheduled"&&(c!=null&&c.scheduledFor))return jsxRuntimeExports.jsx(ScheduledLanding,{config:c,hostId:at,roomId:o,onReady:en});if(!ht)return jsxRuntimeExports.jsxs("div",{className:"min-h-dvh flex flex-col",children:[jsxRuntimeExports.jsx("header",{className:"border-b border-border/60 backdrop-blur-xl bg-bg/80 sticky top-0 z-50",children:jsxRuntimeExports.jsx("div",{className:"max-w-5xl mx-auto flex items-center px-6 h-14",children:jsxRuntimeExports.jsx(Link,{to:"/",className:"text-[15px] font-semibold tracking-tight text-muted hover:text-text transition-colors",children:"Para"})})}),jsxRuntimeExports.jsx("main",{className:"flex-1 flex items-center justify-center px-6",children:jsxRuntimeExports.jsxs("div",{className:"w-full max-w-sm text-center",children:[jsxRuntimeExports.jsx("div",{className:"w-14 h-14 rounded-2xl bg-surface border border-border/60 flex items-center justify-center mx-auto mb-6",children:jsxRuntimeExports.jsx("svg",{className:"w-6 h-6 text-accent",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:jsxRuntimeExports.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 18.75a6 6 0 006-6v-1.5m-6 7.5a6 6 0 01-6-6v-1.5m6 7.5v3.75m-3.75 0h7.5M12 15.75a3 3 0 01-3-3V4.5a3 3 0 116 0v8.25a3 3 0 01-3 3z"})})}),jsxRuntimeExports.jsx("h1",{className:"text-xl font-bold tracking-tight mb-1",children:c==null?void 0:c.title}),jsxRuntimeExports.jsx("p",{className:"text-muted text-sm mb-8",children:nt?"Tap to re-enter the room":"Enter your name to join"}),jsxRuntimeExports.jsxs("form",{onSubmit:Pt,className:"space-y-4",children:[jsxRuntimeExports.jsx("input",{type:"text",value:Et,onChange:Ut=>_t(Ut.target.value),placeholder:"Your name",required:!0,autoFocus:!0,className:"input text-center"}),sr&&jsxRuntimeExports.jsx("p",{className:"text-danger text-sm",children:sr}),jsxRuntimeExports.jsx("button",{type:"submit",className:"w-full h-10 rounded-lg bg-text text-bg text-sm font-semibold hover:opacity-90 transition-colors",children:nt?"Enter":"Join Room"})]})]})})]});const Ln=dt.find(Ut=>Ut.id===_e),un=vt.some(Ut=>Ut.participantId===nt);return jsxRuntimeExports.jsxs("div",{className:"h-dvh flex flex-col overflow-hidden bg-bg select-none",children:[jsxRuntimeExports.jsxs("header",{className:"flex items-center justify-between px-4 h-12 border-b border-border/60 flex-shrink-0",children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[jsxRuntimeExports.jsx(Link,{to:"/",className:"text-xs font-semibold text-muted hover:text-text transition-colors flex-shrink-0",children:"Para"}),jsxRuntimeExports.jsx("div",{className:"w-px h-4 bg-border/60"}),jsxRuntimeExports.jsx("h2",{className:"text-[13px] font-semibold truncate",children:c==null?void 0:c.title}),jsxRuntimeExports.jsx(StatusBadge,{status:h,size:"xs"})]}),jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0",children:[h==="live"&&j&&jsxRuntimeExports.jsx("span",{className:"text-xs text-muted tabular-nums",children:fmtElapsed(Or-j)}),jsxRuntimeExports.jsxs("span",{className:"text-xs text-muted",children:[dt.length," joined"]}),(sn||xr||vr)&&jsxRuntimeExports.jsx("span",{className:`text-[10px] animate-pulse ${et?"text-purple-400":"text-accent"}`,children:et?"Interrupting...":xr?"AI speaking...":vr?"AI thinking...":"AI streaming..."}),jsxRuntimeExports.jsx(ThemeToggle,{}),s&&jsxRuntimeExports.jsx("button",{onClick:()=>Nr("/profile"),className:"px-2.5 h-7 rounded-md bg-surface border border-border/60 text-xs text-muted hover:text-text hover:border-border-hover transition-colors",children:s.displayName})]})]}),jsxRuntimeExports.jsxs("div",{className:"flex-1 flex relative min-h-0",children:[jsxRuntimeExports.jsxs("div",{className:"flex-1 flex items-center justify-center p-8",children:[h==="waiting"&&jsxRuntimeExports.jsxs("div",{className:"text-center",children:[jsxRuntimeExports.jsx("div",{className:"w-24 h-24 rounded-full bg-surface border border-border/60 flex items-center justify-center mx-auto mb-5",children:jsxRuntimeExports.jsx("div",{className:"w-4 h-4 rounded-full bg-amber-400/60 animate-pulse"})}),jsxRuntimeExports.jsx("h2",{className:"text-xl font-semibold mb-1",children:c==null?void 0:c.title}),jsxRuntimeExports.jsx("p",{className:"text-muted text-sm mb-4",children:"Waiting to start"}),Ft&&jsxRuntimeExports.jsx("button",{onClick:kt,className:"px-6 py-2.5 rounded-full bg-accent text-black text-sm font-semibold hover:bg-accent-hover transition-colors",children:"Go Live"})]}),h==="live"&&jsxRuntimeExports.jsxs("div",{className:"flex flex-col items-center gap-4",children:[jsxRuntimeExports.jsxs("div",{className:`relative rounded-full transition-all duration-300 ${sn||xr||vr?"ring-4 ring-accent ring-opacity-75":""}`,children:[jsxRuntimeExports.jsx("div",{className:"w-32 h-32 rounded-full bg-gradient-to-br from-accent/20 to-accent/5 border border-accent/20 flex items-center justify-center",children:jsxRuntimeExports.jsx("div",{className:`w-4 h-4 rounded-full bg-accent ${sn?"animate-ping":"animate-pulse"}`})}),(sn||xr)&&jsxRuntimeExports.jsx("div",{className:"absolute inset-0 rounded-full animate-ping ring-2 ring-accent opacity-20"})]}),jsxRuntimeExports.jsxs("div",{className:"text-center",children:[jsxRuntimeExports.jsx("h2",{className:"text-xl font-semibold",children:"AI Host"}),jsxRuntimeExports.jsx("p",{className:"text-muted text-sm mt-1",children:c==null?void 0:c.title})]}),(ir==null?void 0:ir.status)==="tool_call"&&jsxRuntimeExports.jsxs("p",{className:"text-xs text-muted italic animate-pulse",children:["Using ",((hn=(an=ir.toolCalls)==null?void 0:an.findLast(Ut=>Ut.status==="running"))==null?void 0:hn.tool)??"tool","..."]}),Ln&&jsxRuntimeExports.jsxs("div",{className:"px-4 py-1.5 rounded-full border border-accent/20 bg-accent/5 text-accent text-xs font-medium",children:[Ln.displayName," is on the hot seat"]})]}),h==="ended"&&jsxRuntimeExports.jsxs("div",{className:"text-center space-y-4",children:[jsxRuntimeExports.jsx("h2",{className:"text-xl font-semibold",children:"Session ended"}),jsxRuntimeExports.jsx("p",{className:"text-muted text-sm",children:"Thanks for joining!"}),jsxRuntimeExports.jsx(Link,{to:"/",className:"inline-block px-6 py-2.5 rounded-full bg-surface border border-border/60 text-sm text-muted hover:text-text transition-colors",children:"Back to lobby"})]})]}),rr&&jsxRuntimeExports.jsxs("div",{className:"absolute top-10 left-3 w-72 bg-surface/95 backdrop-blur border border-border/40 rounded-xl p-3 z-50 shadow-lg",children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between mb-2",children:[jsxRuntimeExports.jsx("span",{className:"text-[11px] font-semibold text-muted uppercase tracking-wider",children:"Participants"}),jsxRuntimeExports.jsx("button",{onClick:()=>Jt(!1),className:"text-muted hover:text-text",children:jsxRuntimeExports.jsx(X,{className:"w-4 h-4"})})]}),jsxRuntimeExports.jsx("div",{className:"space-y-1 max-h-48 overflow-y-auto",children:dt.map(Ut=>jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between text-xs py-1",children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntimeExports.jsx("span",{className:"text-text-secondary",children:Ut.displayName}),Ut.role==="host"&&jsxRuntimeExports.jsx("span",{className:"text-[10px] text-muted",children:"host"}),Ut.role==="hot-seat"&&jsxRuntimeExports.jsx("span",{className:"text-[10px] text-accent",children:"hot seat"}),h==="live"&&Ut.joinedAt&&jsxRuntimeExports.jsx("span",{className:"text-[10px] text-muted tabular-nums",children:fmtElapsed(Or-Ut.joinedAt)})]}),jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[Ft&&Ut.role!=="hot-seat"&&h==="live"&&jsxRuntimeExports.jsx("button",{onClick:()=>Ot(Ut.id),className:"text-[10px] text-accent/60 hover:text-accent",children:Ut.role==="host"?"Take seat":"Give seat"}),Ft&&Ut.role==="hot-seat"&&Ut.id!==nt&&jsxRuntimeExports.jsx("button",{onClick:cr,className:"text-[10px] text-amber-400/60 hover:text-amber-400",children:"Mute"}),Ft&&Ut.id!==nt&&jsxRuntimeExports.jsx("button",{onClick:()=>_r(Ut.id),className:"text-[10px] text-danger/50 hover:text-danger",children:"Kick"})]})]},Ut.id))}),Ft&&vt.length>0&&jsxRuntimeExports.jsxs("div",{className:"mt-2 pt-2 border-t border-border/30",children:[jsxRuntimeExports.jsx("div",{className:"text-[10px] font-semibold text-amber-400/70 uppercase tracking-wider mb-1",children:"Raised hands"}),jsxRuntimeExports.jsx("div",{className:"space-y-1",children:vt.map(Ut=>jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between text-xs py-1",children:[jsxRuntimeExports.jsx("span",{className:"text-text-secondary",children:Ut.displayName}),jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntimeExports.jsx("button",{onClick:()=>zt(Ut.id),className:"text-[10px] text-accent/60 hover:text-accent",children:"Accept"}),jsxRuntimeExports.jsx("button",{onClick:()=>Xt(Ut.id),className:"text-[10px] text-muted hover:text-danger",children:"Dismiss"})]})]},Ut.id))})]})]}),er&&jsxRuntimeExports.jsxs("div",{className:"absolute top-0 right-0 bottom-0 w-80 max-sm:w-full bg-surface/95 backdrop-blur border-l border-border/40 flex flex-col z-20",children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between px-4 h-10 border-b border-border/40 flex-shrink-0",children:[jsxRuntimeExports.jsx("span",{className:"text-xs font-semibold text-muted uppercase tracking-wider",children:"Chat"}),jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[Ft&&jsxRuntimeExports.jsx("button",{onClick:()=>{nt&&(Bt([]),api.actions.postResetchat({roomId:o,hostParticipantId:nt}))},title:"Reset conversation history",className:"text-muted hover:text-red-400 transition-colors",children:jsxRuntimeExports.jsx(Trash2,{className:"w-3.5 h-3.5"})}),jsxRuntimeExports.jsx("button",{onClick:()=>Yt(!1),className:"text-muted hover:text-text",children:jsxRuntimeExports.jsx(X,{className:"w-4 h-4"})})]})]}),jsxRuntimeExports.jsxs("div",{ref:tr,className:"flex-1 overflow-y-auto px-4 py-3 space-y-2 min-h-0 select-text",children:[Rt.length===0&&!$r&&jsxRuntimeExports.jsx("p",{className:"text-muted text-xs text-center py-8",children:"No messages yet"}),(()=>{var Bn;const Ut=Pr=>Pr.replace(/<[^>]+\/?\s*>/g,"").replace(/\s{2,}/g," ").trim(),ur=(ir==null?void 0:ir.content)||"",hr=Ut(ur.length>=((Er==null?void 0:Er.length)||0)?ur:Er),mr=(xr||(ir==null?void 0:ir.status)==="speaking")&&Rr>=0,Br=Rt.length>0&&((Bn=Rt[Rt.length-1])==null?void 0:Bn.senderId)==="_ai"?Rt[Rt.length-1]:null,Wr=$r&&Br?Rt.length-1:-1,En=(Pr,Jr)=>jsxRuntimeExports.jsxs("details",{className:"mb-1.5",open:Jr,children:[jsxRuntimeExports.jsxs("summary",{className:"text-[10px] text-muted cursor-pointer hover:text-text transition-colors",children:[Pr.length," tool call",Pr.length>1?"s":""]}),jsxRuntimeExports.jsx("div",{className:"space-y-1 mt-1",children:Pr.map(Gr=>jsxRuntimeExports.jsxs("details",{className:"rounded-md border border-border/40 bg-surface/50 text-[11px]",children:[jsxRuntimeExports.jsxs("summary",{className:"flex items-center gap-2 px-2.5 py-1.5 cursor-pointer list-none",children:[jsxRuntimeExports.jsx("span",{className:`w-1.5 h-1.5 rounded-full flex-shrink-0 ${Jr&&Gr.status==="running"?"bg-blue-400 animate-pulse":Gr.status==="completed"?"bg-green-400":Gr.status==="error"?"bg-red-400":"bg-zinc-400"}`}),jsxRuntimeExports.jsx("span",{className:"font-mono font-medium text-text-secondary",children:Gr.tool}),jsxRuntimeExports.jsx("span",{className:`ml-auto text-[10px] px-1.5 py-0.5 rounded font-medium ${Jr&&Gr.status==="running"?"bg-blue-500/15 text-blue-400":Gr.status==="completed"?"bg-green-500/15 text-green-400":Gr.status==="error"?"bg-red-500/15 text-red-400":"text-muted"}`,children:Gr.status})]}),(Gr.args||Gr.result)&&jsxRuntimeExports.jsxs("div",{className:"px-2.5 pb-1.5 space-y-1 border-t border-border/20 mt-0.5 pt-1 text-[10px]",children:[Gr.args&&jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("span",{className:"text-muted/60 uppercase tracking-wide text-[9px]",children:"Args"}),jsxRuntimeExports.jsx("pre",{className:"font-mono text-muted/80 whitespace-pre-wrap break-all mt-0.5",children:JSON.stringify(Gr.args,null,2)})]}),Gr.result&&jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("span",{className:"text-muted/60 uppercase tracking-wide text-[9px]",children:"Result"}),jsxRuntimeExports.jsx("pre",{className:"font-mono text-muted/80 whitespace-pre-wrap break-all mt-0.5 max-h-32 overflow-y-auto",children:Gr.result})]})]})]},Gr.id))})]}),Fn=(Pr,Jr)=>{const Gr=Jr&&(ir==null?void 0:ir.toolCalls)||(Pr==null?void 0:Pr.toolCalls);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[Gr!=null&&Gr.length?En(Gr,Jr):null,jsxRuntimeExports.jsxs("span",{className:"font-semibold text-accent",children:[Jr&&jsxRuntimeExports.jsx("span",{className:`inline-block w-1.5 h-1.5 rounded-full bg-accent ${mr?"animate-pulse":"animate-ping"} mr-1.5 align-middle`}),"AI Host"]}),jsxRuntimeExports.jsx("span",{className:"text-muted mx-1.5",children:"·"}),Jr&&mr?(()=>{const dn=hr.split(/\s+/).filter(Boolean),Zn=dn.slice(0,Rr).join(" "),Un=dn.slice(Rr).join(" ");return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[Zn&&jsxRuntimeExports.jsx("span",{className:"text-text-secondary",children:Zn}),jsxRuntimeExports.jsx("span",{className:"inline-block w-[2px] h-[14px] bg-accent animate-pulse align-middle mx-0.5"}),e&&Un&&jsxRuntimeExports.jsx("span",{className:"text-text-secondary/30",children:Un})]})})():Jr&&!hr?jsxRuntimeExports.jsx("span",{className:"text-muted italic",children:"thinking..."}):jsxRuntimeExports.jsx("span",{className:"text-text-secondary",children:(()=>{const dn=Jr?hr:Ut((Pr==null?void 0:Pr.content)||"");return!Jr&&(Pr!=null&&Pr.interrupted)&&(Pr!=null&&Pr.spokenWords)?dn.split(/\s+/).slice(0,Pr.spokenWords).join(" ")+"…":dn})()})]})};return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[Rt.map((Pr,Jr)=>{const Gr=Pr.type==="backchannel"||Pr.type==="filler"||Pr.type==="bridge",dn=$r&&Pr.senderId==="_ai"&&Jr===Wr;return jsxRuntimeExports.jsx("div",{className:`text-[13px] leading-relaxed ${Gr?"opacity-50":""}`,children:Pr.type==="system"?jsxRuntimeExports.jsx("span",{className:"text-muted/60 text-xs italic",children:Pr.content}):Gr?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("span",{className:"font-semibold text-accent/60 text-[12px]",children:"AI Host"}),jsxRuntimeExports.jsx("span",{className:"text-muted mx-1",children:"·"}),jsxRuntimeExports.jsx("span",{className:"text-text-secondary/70 italic text-[12px]",children:Pr.content})]}):Pr.senderId==="_ai"?Fn(Pr,dn):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("span",{className:"font-semibold text-text-secondary",children:Pr.displayName}),jsxRuntimeExports.jsx("span",{className:"text-muted mx-1.5",children:"·"}),jsxRuntimeExports.jsx("span",{className:"text-muted",children:Pr.content})]})},Pr.id??Jr)}),$r&&Wr===-1&&jsxRuntimeExports.jsx("div",{className:"text-[13px] leading-relaxed",children:Fn(null,!0)})]})})(),wr&&jsxRuntimeExports.jsxs("div",{className:"text-[13px] leading-relaxed opacity-50",children:[jsxRuntimeExports.jsx("span",{className:"font-semibold text-text-secondary",children:(s==null?void 0:s.displayName)||"You"}),jsxRuntimeExports.jsx("span",{className:"text-muted mx-1.5",children:"·"}),jsxRuntimeExports.jsx("span",{className:"text-muted",children:wr})]}),vr&&!wr&&jsxRuntimeExports.jsxs("div",{className:"text-[13px] leading-relaxed opacity-50",children:[jsxRuntimeExports.jsx("span",{className:"font-semibold text-accent",children:"AI Host"}),jsxRuntimeExports.jsx("span",{className:"text-muted mx-1.5",children:"·"}),jsxRuntimeExports.jsx("span",{className:"text-muted italic animate-pulse",children:"thinking..."})]}),jsxRuntimeExports.jsx("div",{ref:It})]}),h!=="ended"&&jsxRuntimeExports.jsxs("form",{onSubmit:Ct,className:"flex gap-2 px-3 py-2.5 border-t border-border/40",children:[jsxRuntimeExports.jsx("input",{type:"text",value:Mt,onChange:Ut=>Ht(Ut.target.value),placeholder:"Say something...",autoComplete:"off",className:"flex-1 h-8 px-3 rounded-md bg-surface border border-border/60 text-[13px] text-text placeholder:text-muted/50 outline-none focus:border-border-hover transition-colors"}),jsxRuntimeExports.jsx("button",{type:"submit",disabled:!Mt.trim(),className:"h-8 px-3 rounded-md bg-surface-2 border border-border/60 text-xs font-medium text-muted hover:text-text hover:border-border-hover disabled:opacity-30 disabled:cursor-not-allowed transition-all",children:"Send"})]})]})]}),jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-center gap-4 pb-6 pt-2 flex-shrink-0",children:[h==="live"&&jsxRuntimeExports.jsx("button",{onClick:Fr,className:`w-12 h-12 rounded-full flex items-center justify-center transition-all text-base ${ar&&!Dr?"bg-text text-bg":Dr?"bg-red-500/20 text-red-400":"bg-surface-2 text-text hover:bg-surface-2/80"}`,title:ar?Dr?"Unmute speaker":"Mute speaker":"Enable voice",children:yr==="connecting"?"...":ar?Dr?jsxRuntimeExports.jsx(VolumeOff,{className:"w-5 h-5"}):jsxRuntimeExports.jsx(Volume2,{className:"w-5 h-5"}):jsxRuntimeExports.jsx(VolumeX,{className:"w-5 h-5"})}),ar&&lr&&jsxRuntimeExports.jsxs("div",{className:"relative",children:[et&&!g&&jsxRuntimeExports.jsxs("svg",{className:"absolute inset-[-4px] w-[56px] h-[56px] -rotate-90 pointer-events-none",viewBox:"0 0 56 56",children:[jsxRuntimeExports.jsx("circle",{cx:"28",cy:"28",r:"25",fill:"none",stroke:"currentColor",strokeOpacity:.15,strokeWidth:"3",className:"text-purple-400"}),jsxRuntimeExports.jsx("circle",{cx:"28",cy:"28",r:"25",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeDasharray:"157.08",strokeDashoffset:"0",className:"text-purple-400",style:{animation:"barge-countdown 2.5s linear forwards"}})]}),jsxRuntimeExports.jsx("button",{onClick:pt,className:`w-12 h-12 rounded-full flex items-center justify-center transition-all ${et&&!g?"bg-purple-700 text-white":!g&&yr==="listening"?"bg-text text-bg":!g&&yr==="connecting"?"bg-text/40 text-bg animate-pulse":"bg-surface-2 text-text hover:bg-surface-2/80"}`,title:g?"Unmute mic":"Mute mic",children:g?jsxRuntimeExports.jsx(MicOff,{className:"w-5 h-5"}):jsxRuntimeExports.jsxs("span",{className:"relative w-5 h-5 flex items-center justify-center",children:[jsxRuntimeExports.jsx(Mic,{className:`w-5 h-5 absolute inset-0 transition-opacity duration-300 ${et?"opacity-0":"opacity-100"} ${yr==="listening"?"text-red-500":""}`}),jsxRuntimeExports.jsx("span",{className:`absolute inset-0 flex items-center justify-center text-xl font-bold text-purple-200 transition-opacity duration-300 ${et?"opacity-100":"opacity-0"}`,style:et?{animation:"barge-pulse 1s ease-in-out infinite"}:void 0,children:"?"})]})})]}),jsxRuntimeExports.jsxs("button",{onClick:()=>Jt(!rr),className:`relative w-12 h-12 rounded-full flex items-center justify-center transition-all ${rr?"bg-text text-bg":"bg-surface-2 text-text hover:bg-surface-2/80"}`,title:"Participants",children:[jsxRuntimeExports.jsx(Users,{className:"w-5 h-5"}),vt.length>0&&jsxRuntimeExports.jsx("span",{className:"absolute -top-1 -right-1 text-[9px] bg-amber-500 text-white rounded-full w-4 h-4 flex items-center justify-center",children:vt.length})]}),jsxRuntimeExports.jsx("button",{onClick:()=>Yt(!er),className:`w-12 h-12 rounded-full flex items-center justify-center transition-all ${er?"bg-text text-bg":"bg-surface-2 text-text hover:bg-surface-2/80"}`,title:"Chat",children:jsxRuntimeExports.jsx(MessageSquare,{className:"w-5 h-5"})}),h==="live"&&!lr&&(!Ft||(c==null?void 0:c.mode)==="roundtable")&&jsxRuntimeExports.jsx("button",{onClick:Gt,disabled:un,className:`w-12 h-12 rounded-full flex items-center justify-center transition-all disabled:cursor-not-allowed ${un?"bg-amber-500/20 text-amber-400":"bg-surface-2 text-text hover:bg-surface-2/80"}`,title:un?"Hand raised":"Raise hand",children:jsxRuntimeExports.jsx(Hand,{className:"w-5 h-5"})}),e&&h==="live"&&jsxRuntimeExports.jsx("button",{onClick:()=>Vt(!Lt),className:`w-12 h-12 rounded-full flex items-center justify-center transition-all ${Lt?"bg-amber-500 text-black":"bg-surface-2 text-text hover:bg-surface-2/80"}`,title:"Debug panel",children:jsxRuntimeExports.jsx(Bug,{className:"w-5 h-5"})}),h==="live"&&jsxRuntimeExports.jsx("button",{onClick:()=>gr(!0),className:"w-12 h-12 rounded-full bg-surface-2 text-text hover:bg-surface-2/80 flex items-center justify-center transition-all",title:"Audio settings",children:jsxRuntimeExports.jsx(Settings,{className:"w-5 h-5"})}),Ft&&h==="live"&&jsxRuntimeExports.jsx("button",{onClick:$t,className:"w-12 h-12 rounded-full bg-red-600 text-white flex items-center justify-center hover:bg-red-700 transition-all",title:"End session",children:jsxRuntimeExports.jsx(PhoneOff,{className:"w-5 h-5 rotate-[135deg]"})})]}),jsxRuntimeExports.jsx(AudioSettingsModal,{open:Dt,onClose:()=>gr(!1)}),Lt&&o&&jsxRuntimeExports.jsx(DebugSidePanel,{roomId:o,voiceEnabled:ar,getVoiceState:st,status:h,onClose:()=>Vt(!1)})]})}const MODE_LABELS={"hot-seat":"Hot Seat",roundtable:"Roundtable","co-learning":"Co-Learning",panel:"Panel",game:"Game Show"};function ScheduledLanding({config:o,hostId:e,roomId:s,onReady:a}){const{identity:c}=useIdentity(),d=(c==null?void 0:c.id)===e,[h,b]=reactExports.useState(Date.now()),[j,$]=reactExports.useState(!1);reactExports.useEffect(()=>{const xt=setInterval(()=>{const Et=Date.now();b(Et),o.scheduledFor&&Et>=o.scheduledFor&&(clearInterval(xt),a())},1e3);return()=>clearInterval(xt)},[o.scheduledFor,a]);const _e=Math.max(0,(o.scheduledFor??0)-h),it=Math.floor(_e/864e5),at=Math.floor(_e%864e5/36e5),lt=Math.floor(_e%36e5/6e4),dt=Math.floor(_e%6e4/1e3),mt=new Intl.DateTimeFormat(void 0,{weekday:"long",month:"long",day:"numeric",hour:"numeric",minute:"2-digit"}).format(o.scheduledFor),vt=new Date(o.scheduledFor).toUTCString().replace("GMT","UTC"),tt=window.location.href,nt=()=>{navigator.clipboard.writeText(tt),$(!0),setTimeout(()=>$(!1),2e3)},ot=encodeURIComponent(`Join me for "${o.title}" — a live AI-hosted ${MODE_LABELS[o.mode]??o.mode} session
${vt}`),ht=encodeURIComponent(tt);return jsxRuntimeExports.jsxs("div",{className:"min-h-dvh flex flex-col bg-bg",children:[jsxRuntimeExports.jsx("header",{className:"border-b border-border/60 backdrop-blur-xl bg-bg/80 sticky top-0 z-50",children:jsxRuntimeExports.jsxs("div",{className:"max-w-5xl mx-auto flex items-center justify-between px-6 h-14",children:[jsxRuntimeExports.jsx(Link,{to:"/",className:"text-[15px] font-semibold tracking-tight text-muted hover:text-text transition-colors",children:"Para"}),jsxRuntimeExports.jsx(ThemeToggle,{})]})}),jsxRuntimeExports.jsx("main",{className:"flex-1 flex items-center justify-center px-6 py-12",children:jsxRuntimeExports.jsxs("div",{className:"max-w-lg w-full text-center",children:[jsxRuntimeExports.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-1.5 rounded-full bg-violet-500/10 mb-8",children:[jsxRuntimeExports.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-violet-400 animate-pulse"}),jsxRuntimeExports.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-violet-400",children:"Upcoming Session"})]}),jsxRuntimeExports.jsx("h1",{className:"text-4xl sm:text-5xl font-bold tracking-tight leading-tight mb-4",children:o.title}),jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-center gap-3 mb-8",children:[jsxRuntimeExports.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider px-2 py-0.5 rounded-full bg-surface-2 text-muted",children:MODE_LABELS[o.mode]??o.mode}),jsxRuntimeExports.jsxs("span",{className:"text-muted text-sm",children:["Hosted by ",jsxRuntimeExports.jsx("span",{className:"text-text font-medium",children:o.hostName??"Host"})]})]}),jsxRuntimeExports.jsxs("div",{className:"mb-10",children:[jsxRuntimeExports.jsx("p",{className:"text-xl sm:text-2xl font-semibold text-text",children:mt}),jsxRuntimeExports.jsx("p",{className:"text-xs text-muted mt-1",children:vt})]}),jsxRuntimeExports.jsx("div",{className:"flex items-center justify-center gap-3 sm:gap-4 mb-10",children:[{value:it,label:"days"},{value:at,label:"hours"},{value:lt,label:"min"},{value:dt,label:"sec"}].map(({value:xt,label:Et})=>jsxRuntimeExports.jsxs("div",{className:"flex flex-col items-center",children:[jsxRuntimeExports.jsx("div",{className:"w-16 sm:w-20 h-16 sm:h-20 rounded-xl bg-surface border border-border/60 flex items-center justify-center",children:jsxRuntimeExports.jsx("span",{className:"text-2xl sm:text-3xl font-bold tabular-nums",children:String(xt).padStart(2,"0")})}),jsxRuntimeExports.jsx("span",{className:"text-[10px] uppercase tracking-wider text-muted mt-2 font-medium",children:Et})]},Et))}),d&&jsxRuntimeExports.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-1.5 rounded-full bg-accent/10 text-accent text-xs font-medium mb-6",children:[jsxRuntimeExports.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-accent"}),"You're the host"]}),jsxRuntimeExports.jsx(NotifyForm,{roomId:s,roomTitle:o.title}),jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-center gap-3",children:[jsxRuntimeExports.jsx("button",{onClick:nt,className:"inline-flex items-center gap-2 px-5 h-10 rounded-lg bg-surface border border-border/60 text-sm font-medium text-text hover:bg-surface-2 hover:border-border-hover transition-colors",children:j?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("svg",{className:"w-4 h-4 text-accent",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:jsxRuntimeExports.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}),"Copied!"]}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:jsxRuntimeExports.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 17.25v3.375c0 .621-.504 1.125-1.125 1.125h-9.75a1.125 1.125 0 01-1.125-1.125V7.875c0-.621.504-1.125 1.125-1.125H6.75a9.06 9.06 0 011.5.124m7.5 10.376h3.375c.621 0 1.125-.504 1.125-1.125V11.25c0-4.46-3.243-8.161-7.5-8.876a9.06 9.06 0 00-1.5-.124H9.375c-.621 0-1.125.504-1.125 1.125v3.5m7.5 10.375H9.375a1.125 1.125 0 01-1.125-1.125v-9.25m12 6.625v-1.875a3.375 3.375 0 00-3.375-3.375h-1.5a1.125 1.125 0 01-1.125-1.125v-1.5a3.375 3.375 0 00-3.375-3.375H9.75"})}),"Copy Link"]})}),jsxRuntimeExports.jsxs("a",{href:`https://x.com/intent/tweet?text=${ot}&url=${ht}`,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 px-5 h-10 rounded-lg bg-white text-black text-sm font-semibold hover:bg-zinc-200 transition-colors",children:[jsxRuntimeExports.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:jsxRuntimeExports.jsx("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})}),"Share on X"]})]})]})})]})}function DebugSidePanel({roomId:o,voiceEnabled:e,getVoiceState:s,status:a,onClose:c}){var it,at,lt;const[d,h]=reactExports.useState(null),[b,j]=reactExports.useState({});reactExports.useEffect(()=>{if(!e)return;const dt=setInterval(()=>j(s()),200);return()=>clearInterval(dt)},[s,e]),reactExports.useEffect(()=>{if(a!=="live")return;let dt=!1;const mt=async()=>{try{const tt=await api.rooms.getDebug(o);dt||h(tt)}catch{}};mt();const vt=setInterval(mt,2e3);return()=>{dt=!0,clearInterval(vt)}},[o,a]);const $=d==null?void 0:d.brain,_e=d==null?void 0:d.world;return jsxRuntimeExports.jsxs("div",{className:"absolute top-0 left-0 bottom-0 w-80 max-sm:w-full bg-black/95 backdrop-blur border-r border-border/40 flex flex-col z-30 font-mono text-[10px]",children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between px-3 h-10 border-b border-border/40 flex-shrink-0",children:[jsxRuntimeExports.jsx("span",{className:"text-[11px] font-semibold text-amber-400 uppercase tracking-wider",children:"Debug"}),jsxRuntimeExports.jsx("button",{onClick:c,className:"text-zinc-500 hover:text-text",children:jsxRuntimeExports.jsx(X,{className:"w-4 h-4"})})]}),jsxRuntimeExports.jsx("div",{className:"flex-[7] overflow-y-auto p-3 space-y-2 min-h-0 border-b border-border/40 select-text",children:$?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[$.profile&&jsxRuntimeExports.jsx(Section,{title:"Profile",color:"text-cyan-400",children:Object.entries($.profile).map(([dt,mt])=>jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsxs("span",{className:"text-zinc-500",children:[dt,":"]})," ",String(mt)]},dt))}),jsxRuntimeExports.jsxs(Section,{title:"State",color:"text-green-400",children:[jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("span",{className:"text-zinc-500",children:"mode:"})," ",String($.roomMode)]}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("span",{className:"text-zinc-500",children:"relaying:"})," ",jsxRuntimeExports.jsx("span",{className:$.isRelaying?"text-red-400":"text-green-400",children:String($.isRelaying)})]}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("span",{className:"text-zinc-500",children:"silence:"})," ",$.silenceMs!=null?`${Math.round(Number($.silenceMs)/1e3)}s`:"—"," ",jsxRuntimeExports.jsxs("span",{className:"text-zinc-500",children:["(handled: ",String($.silenceHandled),")"]})]}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("span",{className:"text-zinc-500",children:"coalesced:"})," ",String($.coalescedPending)," pending"]})]}),_e&&jsxRuntimeExports.jsxs(Section,{title:"World",color:"text-violet-400",children:[jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("span",{className:"text-zinc-500",children:"participants:"})," ",String(_e.participantCount)]}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("span",{className:"text-zinc-500",children:"messages:"})," ",String(_e.messageCount)]}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("span",{className:"text-zinc-500",children:"duration:"})," ",String(_e.sessionDurationMin),"min"]}),((it=_e.handRaiseQueue)==null?void 0:it.length)>0&&jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("span",{className:"text-zinc-500",children:"hands:"})," ",_e.handRaiseQueue.join(", ")]}),_e.participationMap&&Object.keys(_e.participationMap).length>0&&jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("span",{className:"text-zinc-500",children:"participation:"}),Object.entries(_e.participationMap).map(([dt,mt])=>jsxRuntimeExports.jsxs("span",{className:"ml-1",children:[dt,":",mt]},dt))]})]}),((at=$.coalescedMessages)==null?void 0:at.length)>0&&jsxRuntimeExports.jsx(Section,{title:"Coalesced",color:"text-yellow-400",children:$.coalescedMessages.map((dt,mt)=>jsxRuntimeExports.jsxs("div",{className:"text-zinc-300",children:[dt.name,": ",dt.content]},mt))}),((lt=$.events)==null?void 0:lt.length)>0&&jsxRuntimeExports.jsx(Section,{title:"Events (last 20)",color:"text-amber-400",children:$.events.map((dt,mt)=>jsxRuntimeExports.jsxs("div",{className:"flex gap-1",children:[jsxRuntimeExports.jsx("span",{className:"text-zinc-500 shrink-0",children:dt.age}),jsxRuntimeExports.jsx("span",{className:dt.type==="chat"||dt.type==="voice_answer"?"text-green-300":dt.type==="silence"?"text-red-300":"text-amber-300",children:dt.type}),dt.who&&jsxRuntimeExports.jsx("span",{className:"text-zinc-400",children:dt.who}),dt.content&&jsxRuntimeExports.jsx("span",{className:"text-zinc-500 truncate",children:dt.content})]},mt))})]}):jsxRuntimeExports.jsx("div",{className:"text-zinc-500 py-4 text-center",children:a==="live"?"Loading brain…":"Brain inactive"})}),jsxRuntimeExports.jsx("div",{className:"flex-[3] overflow-y-auto p-3 min-h-0 select-text",children:jsxRuntimeExports.jsx(Section,{title:"Voice",color:"text-green-400",children:jsxRuntimeExports.jsx("pre",{className:"text-zinc-300 whitespace-pre-wrap break-all",children:JSON.stringify(b,null,1)})})})]})}function Section({title:o,color:e,children:s}){return jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("div",{className:`${e} font-semibold mb-0.5`,children:o}),jsxRuntimeExports.jsx("div",{className:"text-zinc-300 pl-1",children:s})]})}function ProfilePage(){const{identity:o,setName:e}=useIdentity(),s=useNavigate(),[a,c]=reactExports.useState((o==null?void 0:o.displayName)??""),[d,h]=reactExports.useState(!1),b=j=>{j.preventDefault(),a.trim()&&(e(a.trim()),h(!0),setTimeout(()=>h(!1),1500))};return jsxRuntimeExports.jsxs("div",{className:"min-h-dvh flex flex-col",children:[jsxRuntimeExports.jsx("header",{className:"border-b border-border/60 backdrop-blur-xl bg-bg/80 sticky top-0 z-50",children:jsxRuntimeExports.jsxs("div",{className:"max-w-5xl mx-auto flex items-center justify-between px-6 h-14",children:[jsxRuntimeExports.jsx(Link,{to:"/",className:"text-[15px] font-semibold tracking-tight text-muted hover:text-text transition-colors",children:"Para"}),jsxRuntimeExports.jsx(ThemeToggle,{})]})}),jsxRuntimeExports.jsx("main",{className:"flex-1 flex items-start justify-center px-6 py-16",children:jsxRuntimeExports.jsxs("div",{className:"w-full max-w-sm",children:[jsxRuntimeExports.jsx("h1",{className:"text-xl font-bold tracking-tight mb-1",children:"Profile"}),jsxRuntimeExports.jsx("p",{className:"text-muted text-sm mb-8",children:"How others see you in rooms."}),jsxRuntimeExports.jsxs("form",{onSubmit:b,className:"space-y-4",children:[jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("label",{className:"block text-xs font-medium text-muted mb-1.5",children:"Display name"}),jsxRuntimeExports.jsx("input",{type:"text",value:a,onChange:j=>c(j.target.value),placeholder:"Your name",required:!0,autoFocus:!0,className:"input w-full"})]}),(o==null?void 0:o.id)&&jsxRuntimeExports.jsxs("p",{className:"text-xs text-muted/50 font-mono",children:["ID: ",o.id]}),jsxRuntimeExports.jsxs("div",{className:"flex gap-3 pt-1",children:[jsxRuntimeExports.jsx("button",{type:"submit",className:"flex-1 h-9 rounded-lg bg-white text-black text-sm font-semibold hover:bg-zinc-200 transition-colors",children:d?"Saved!":"Save"}),jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>s(-1),className:"h-9 px-4 rounded-lg border border-border/60 text-sm text-muted hover:text-text hover:border-border-hover transition-colors",children:"Back"})]})]})]})})]})}const SILENCE_STRATEGIES=[{value:"prompt",label:"Prompt — ask a follow-up question"},{value:"advance_topic",label:"Advance — move to a new topic"},{value:"wait",label:"Wait — stay silent, let users lead"}],EMPTY_FORM={key:"",name:"",personaEssence:"",silenceThresholdMs:8e3,silenceStrategy:"prompt",coalesceWindowMs:2e3,greetingPrompt:""},BUILT_IN_KEYS=["default","mentor","moderator","provocateur"],STRATEGY_LABELS={prompt:"Prompt",advance_topic:"Advance",wait:"Wait"};function HostsPage(){const[o,e]=reactExports.useState([]),[s,a]=reactExports.useState(null),[c,d]=reactExports.useState(!0),[h,b]=reactExports.useState(!1),[j,$]=reactExports.useState(""),_e=reactExports.useCallback(async()=>{try{const dt=await api.hosts.getList();e(dt)}catch(dt){$(dt instanceof Error?dt.message:"Failed to load")}finally{d(!1)}},[]);reactExports.useEffect(()=>{_e()},[_e]);const it=async dt=>{if(dt.preventDefault(),!!s){b(!0),$("");try{await api.hosts.post(s),a(null),await _e()}catch(mt){$(mt instanceof Error?mt.message:"Failed to save")}finally{b(!1)}}},at=async dt=>{if(confirm(`Delete host "${dt}"?`))try{await api.hosts.delete(dt),await _e()}catch(mt){$(mt instanceof Error?mt.message:"Failed to delete")}},lt=s?!o.some(dt=>dt.key===s.key):!1;return jsxRuntimeExports.jsxs("div",{className:"min-h-dvh flex flex-col bg-bg",children:[jsxRuntimeExports.jsx("header",{className:"border-b border-border/60 backdrop-blur-xl bg-bg/80 sticky top-0 z-50",children:jsxRuntimeExports.jsxs("div",{className:"max-w-5xl mx-auto flex items-center justify-between px-6 h-14",children:[jsxRuntimeExports.jsx(Link,{to:"/",className:"text-[15px] font-semibold tracking-tight text-muted hover:text-text transition-colors",children:"Para"}),jsxRuntimeExports.jsx(ThemeToggle,{})]})}),jsxRuntimeExports.jsxs("main",{className:"flex-1 max-w-2xl mx-auto w-full px-6 py-12",children:[jsxRuntimeExports.jsxs("div",{className:"flex items-end justify-between mb-8",children:[jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("h1",{className:"text-[22px] font-bold tracking-tight",children:"AI Hosts"}),jsxRuntimeExports.jsx("p",{className:"text-[13px] text-muted mt-0.5",children:"Configure AI host personalities and voice behavior."})]}),jsxRuntimeExports.jsx("button",{onClick:()=>a({...EMPTY_FORM}),className:"h-8 px-3.5 rounded-md bg-accent text-white text-[13px] font-medium hover:bg-accent/90 active:scale-[0.98] transition-all",children:"+ New Host"})]}),j&&jsxRuntimeExports.jsx("div",{className:"mb-5 px-3.5 py-2.5 rounded-lg bg-danger/10 border border-danger/20 text-[13px] text-danger",children:j}),s&&jsxRuntimeExports.jsxs("div",{className:"mb-6 rounded-xl border border-border bg-surface shadow-sm",children:[jsxRuntimeExports.jsx("div",{className:"px-5 py-4 border-b border-border/60",children:jsxRuntimeExports.jsx("h2",{className:"text-[14px] font-semibold tracking-tight",children:lt?"New Host":`Editing · ${s.name||s.key}`})}),jsxRuntimeExports.jsxs("form",{onSubmit:it,className:"px-5 py-5 space-y-5",children:[jsxRuntimeExports.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[jsxRuntimeExports.jsx(Field,{label:"Key (ID)",children:jsxRuntimeExports.jsx("input",{type:"text",value:s.key,onChange:dt=>a({...s,key:dt.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"")}),placeholder:"e.g. coach",required:!0,disabled:BUILT_IN_KEYS.includes(s.key),className:"input disabled:opacity-50 disabled:cursor-not-allowed font-mono text-[13px]"})}),jsxRuntimeExports.jsx(Field,{label:"Display Name",children:jsxRuntimeExports.jsx("input",{type:"text",value:s.name,onChange:dt=>a({...s,name:dt.target.value}),placeholder:"e.g. Coach Kim",required:!0,className:"input"})})]}),jsxRuntimeExports.jsx(Field,{label:"Persona Essence",children:jsxRuntimeExports.jsx("textarea",{value:s.personaEssence,onChange:dt=>a({...s,personaEssence:dt.target.value}),placeholder:"You are… describe personality, tone, and style",required:!0,rows:4,className:"input leading-relaxed resize-y min-h-[80px]"})}),jsxRuntimeExports.jsx(Field,{label:"Greeting Prompt",children:jsxRuntimeExports.jsx("textarea",{value:s.greetingPrompt,onChange:dt=>a({...s,greetingPrompt:dt.target.value}),placeholder:"[System: The session just started. Greet the room…]",rows:3,className:"input leading-relaxed resize-y min-h-[60px]"})}),jsxRuntimeExports.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[jsxRuntimeExports.jsx(Field,{label:"Silence threshold",children:jsxRuntimeExports.jsxs("div",{className:"relative",children:[jsxRuntimeExports.jsx("input",{type:"number",value:s.silenceThresholdMs/1e3,onChange:dt=>a({...s,silenceThresholdMs:Number(dt.target.value)*1e3}),min:2,max:30,step:1,className:"input pr-10 tabular-nums"}),jsxRuntimeExports.jsx("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-[11px] text-muted pointer-events-none",children:"sec"})]})}),jsxRuntimeExports.jsx(Field,{label:"On silence",children:jsxRuntimeExports.jsx("select",{value:s.silenceStrategy,onChange:dt=>a({...s,silenceStrategy:dt.target.value}),className:"input",children:SILENCE_STRATEGIES.map(dt=>jsxRuntimeExports.jsx("option",{value:dt.value,children:dt.label},dt.value))})}),jsxRuntimeExports.jsx(Field,{label:"Coalesce window",children:jsxRuntimeExports.jsxs("div",{className:"relative",children:[jsxRuntimeExports.jsx("input",{type:"number",value:s.coalesceWindowMs/1e3,onChange:dt=>a({...s,coalesceWindowMs:Number(dt.target.value)*1e3}),min:.5,max:5,step:.5,className:"input pr-10 tabular-nums"}),jsxRuntimeExports.jsx("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-[11px] text-muted pointer-events-none",children:"sec"})]})})]}),jsxRuntimeExports.jsx(Field,{label:"Cartesia Voice ID",children:jsxRuntimeExports.jsx("input",{type:"text",value:s.voiceId??"",onChange:dt=>a({...s,voiceId:dt.target.value||void 0}),placeholder:"Leave blank to use CARTESIA_VOICE_ID default",className:"input font-mono text-[13px]"})}),jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[jsxRuntimeExports.jsx("button",{type:"submit",disabled:h||!s.key||!s.name||!s.personaEssence,className:"h-8 px-4 rounded-md bg-text text-bg text-[13px] font-semibold hover:opacity-90 active:scale-[0.98] disabled:opacity-30 disabled:cursor-not-allowed transition-all",children:h?"Saving…":"Save host"}),jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>a(null),className:"h-8 px-4 rounded-md text-[13px] text-muted hover:text-text hover:bg-surface-2 transition-all",children:"Cancel"})]})]})]}),c?jsxRuntimeExports.jsx("div",{className:"py-12 text-center text-[13px] text-muted",children:"Loading…"}):jsxRuntimeExports.jsx("div",{className:"divide-y divide-border/50 rounded-xl border border-border overflow-hidden",children:o.map(dt=>jsxRuntimeExports.jsxs("div",{className:"flex items-start gap-4 px-5 py-4 bg-surface hover:bg-surface-2/50 transition-colors",children:[jsxRuntimeExports.jsx("div",{className:"w-8 h-8 rounded-full bg-accent/10 text-accent flex items-center justify-center text-[13px] font-bold shrink-0 mt-0.5",children:dt.name.charAt(0)}),jsxRuntimeExports.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[jsxRuntimeExports.jsx("span",{className:"text-[14px] font-semibold leading-tight",children:dt.name}),jsxRuntimeExports.jsx("code",{className:"text-[11px] text-muted bg-surface-2 px-1.5 py-0.5 rounded font-mono",children:dt.key}),BUILT_IN_KEYS.includes(dt.key)&&jsxRuntimeExports.jsx("span",{className:"text-[10px] font-medium text-muted/50 uppercase tracking-widest",children:"built-in"})]}),jsxRuntimeExports.jsx("p",{className:"text-[13px] text-muted leading-snug line-clamp-2 mb-2",children:dt.personaEssence}),jsxRuntimeExports.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-[11px] text-muted/70",children:[jsxRuntimeExports.jsxs("span",{children:["Silence ",jsxRuntimeExports.jsxs("strong",{className:"text-muted font-medium",children:[dt.silenceThresholdMs/1e3,"s"]})," → ",STRATEGY_LABELS[dt.silenceStrategy]]}),jsxRuntimeExports.jsxs("span",{children:["Coalesce ",jsxRuntimeExports.jsxs("strong",{className:"text-muted font-medium",children:[dt.coalesceWindowMs/1e3,"s"]})]}),dt.voiceId&&jsxRuntimeExports.jsxs("span",{className:"font-mono",children:["voice ",jsxRuntimeExports.jsxs("strong",{className:"text-muted font-medium",children:[dt.voiceId.slice(0,8),"…"]})]})]})]}),jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-3 shrink-0 mt-0.5",children:[jsxRuntimeExports.jsx("button",{onClick:()=>a({...dt}),className:"text-[12px] font-medium text-muted hover:text-text transition-colors",children:"Edit"}),!BUILT_IN_KEYS.includes(dt.key)&&jsxRuntimeExports.jsx("button",{onClick:()=>at(dt.key),className:"text-[12px] font-medium text-danger/60 hover:text-danger transition-colors",children:"Delete"})]})]},dt.key))})]})]})}function Field({label:o,children:e}){return jsxRuntimeExports.jsxs("div",{className:"space-y-1.5",children:[jsxRuntimeExports.jsx("label",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted/70",children:o}),e]})}function getDeviceId(){var e;try{const s=localStorage.getItem("para-li-identity");if(s){const a=(e=JSON.parse(s))==null?void 0:e.id;if(a)return a}}catch{}const o=randomId(8);return localStorage.setItem("para-li-identity",JSON.stringify({id:o,displayName:""})),o}function generateSineWave(o,e,s=44100){const a=new Float32Array(Math.floor(s*e));for(let c=0;c<a.length;c++)a[c]=Math.sin(2*Math.PI*o*(c/s))*.5;return a}function generateChirp(o,e,s,a=44100){const c=new Float32Array(Math.floor(a*s));for(let d=0;d<c.length;d++){const h=d/a,b=o+(e-o)*(h/s);c[d]=Math.sin(2*Math.PI*b*h)*.4}return c}function generateWhiteNoise(o,e=.2,s=44100){const a=new Float32Array(Math.floor(s*o));for(let c=0;c<a.length;c++)a[c]=(Math.random()*2-1)*e;return a}const PRESENCE_PATH=o=>`presence/${o}`;function newMetrics(o){return{transport:o,latencyMs:[],packetsReceived:0,bytesReceived:0,startTime:Date.now(),errors:[]}}function avgLatency(o){return o.latencyMs.length?(o.latencyMs.reduce((e,s)=>e+s,0)/o.latencyMs.length).toFixed(1)+"ms":"—"}function AudioLevelMeter({analyser:o,label:e}){const s=reactExports.useRef(null),a=reactExports.useRef(0);return reactExports.useEffect(()=>{if(!o||!s.current)return;const c=s.current,d=c.getContext("2d"),h=new Uint8Array(o.fftSize),b=()=>{o.getByteTimeDomainData(h);let j=0;for(let lt=0;lt<h.length;lt++){const dt=(h[lt]-128)/128;j+=dt*dt}const $=Math.sqrt(j/h.length),_e=Math.min(1,$*3);d.clearRect(0,0,c.width,c.height);const it=_e*c.width,at=120-_e*120;d.fillStyle=`hsl(${at}, 70%, 50%)`,d.fillRect(0,0,it,c.height),d.fillStyle="#888",d.font="11px monospace",d.fillText(`${($*100).toFixed(0)}%`,4,12),a.current=requestAnimationFrame(b)};return b(),()=>cancelAnimationFrame(a.current)},[o]),jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntimeExports.jsx("span",{className:"text-xs text-muted w-16 shrink-0",children:e}),jsxRuntimeExports.jsx("canvas",{ref:s,width:200,height:16,className:"rounded bg-surface border border-border/40"})]})}function LogPanel({logs:o}){const e=reactExports.useRef(null);return reactExports.useEffect(()=>{const s=e.current;s&&(s.scrollTop=s.scrollHeight)},[o.length]),jsxRuntimeExports.jsx("div",{ref:e,className:"bg-black/80 text-green-400 font-mono text-[11px] leading-relaxed p-3 rounded-lg h-48 overflow-y-auto",children:o.map((s,a)=>jsxRuntimeExports.jsx("div",{children:s},a))})}function ParticipantPanel({id:o,channel:e,transport:s,onLog:a,onMetrics:c,onPeers:d,autoConnect:h,inputDeviceId:b}){var Nr,Tr,Kr;const[j,$]=reactExports.useState(!1),[_e,it]=reactExports.useState(!1),[at,lt]=reactExports.useState(!1),[dt,mt]=reactExports.useState(!1),[vt,tt]=reactExports.useState(!1),[nt]=reactExports.useState("listener"),[ot,ht]=reactExports.useState(null),[xt,Et]=reactExports.useState(null),[_t,Rt]=reactExports.useState(0),[Bt,Mt]=reactExports.useState(0),[Ht,er]=reactExports.useState([]),[Yt,rr]=reactExports.useState(null),Jt=reactExports.useRef(null),Dt=reactExports.useRef(null),gr=reactExports.useRef(null),Lt=reactExports.useRef(newMetrics(s)),Vt=reactExports.useRef(!1),nr=reactExports.useRef(!1),Zt=reactExports.useRef(null),sr=reactExports.useRef(null),Mr=reactExports.useRef(null),ir=reactExports.useRef(null),Cr=reactExports.useCallback(()=>{ir.current&&clearInterval(ir.current),ir.current=setInterval(async()=>{var Rr;const qt=(Rr=Jt.current)==null?void 0:Rr.webrtcPeer,ar=await(qt==null?void 0:qt.getTrackStats());if(!ar){er([]);return}const yr=[];ar.receivers.forEach((Er,wr)=>{let vr=null;Er.stats.forEach(zr=>{zr.type==="inbound-rtp"&&zr.kind==="audio"&&(vr=zr)}),yr.push({id:Er.track.id.slice(0,8),direction:"inbound",kind:"audio",label:wr===0?"TTS":wr===1?"Speaker Fwd":`Track ${wr}`,packetsReceived:(vr==null?void 0:vr.packetsReceived)??0,bytesReceived:(vr==null?void 0:vr.bytesReceived)??0,jitter:(vr==null?void 0:vr.jitter)??0,packetsLost:(vr==null?void 0:vr.packetsLost)??0,readyState:Er.track.readyState})}),ar.senders.forEach(Er=>{if(!Er.track)return;let wr=null;Er.stats.forEach(vr=>{vr.type==="outbound-rtp"&&vr.kind==="audio"&&(wr=vr)}),yr.push({id:Er.track.id.slice(0,8),direction:"outbound",kind:"audio",label:"Mic",packetsSent:(wr==null?void 0:wr.packetsSent)??0,bytesSent:(wr==null?void 0:wr.bytesSent)??0,readyState:Er.track.readyState})}),er(yr);const xr=await(qt==null?void 0:qt.getDebugInfo());if(xr){rr(xr);const Er=xr.audio,wr=!Er&&xr.pcState==="connected";lt(wr||Er&&Er.inDOM&&Er.srcObject)}},1e3)},[]),It=reactExports.useCallback(async qt=>{var wr,vr;Zt.current&&(clearTimeout(Zt.current),Zt.current=null),Vt.current=!0,(wr=Jt.current)==null||wr.unsubscribe(),Vt.current=!1,ir.current&&(clearInterval(ir.current),ir.current=null),(vr=sr.current)==null||vr.close().catch(()=>{});const ar=new AudioContext({sampleRate:44100});sr.current=ar,ensureAudioUnlocked().catch(()=>{});const xr=!await ensureiOSSpeaker();xr&&a(`[${o}] mic denied — using Web Audio fallback for speaker`);const Rr=ar.createAnalyser();Rr.fftSize=256,Mr.current=Rr,ht(Rr),Lt.current=newMetrics(s),Rt(0),Mt(0),er([]);const Er=new AudioReceiver({transport:s,audioContext:ar,peerId:o,role:qt,webAudioPlayback:xr});Jt.current=Er,Er.on({onConnect:()=>{$(!0),mt(!1),nr.current=!0,a(`[${o}] WS connected (${qt})`)},onDisconnect:()=>{$(!1),a(`[${o}] WS disconnected`)},onTTSStart:zr=>{a(`[${o}] start: "${zr.slice(0,40)}..."`),Lt.current.startTime=Date.now()},onTTSEnd:()=>{a(`[${o}] end`)},onPCMChunk:zr=>{var st,ft,gt;const Dr=Mr.current,Fr=sr.current,pt=(ft=(st=Jt.current)==null?void 0:st.options)==null?void 0:ft.transport;if((pt==="ws"||pt==="both"&&!((gt=Jt.current)!=null&>.rtcConnected))&&Fr&&Fr.state==="running"){const wt=new Float32Array(zr),ut=Fr.createBuffer(1,wt.length,44100);ut.getChannelData(0).set(wt);const bt=Fr.createBufferSource();bt.buffer=ut,bt.connect(Fr.destination),Dr&&bt.connect(Dr),bt.start(),bt.onended=()=>bt.disconnect()}const et=Lt.current;et.packetsReceived++,et.bytesReceived+=zr.byteLength,Rt(et.packetsReceived),Mt(et.bytesReceived),c({...et})},onWebRTCConnected:()=>{a(`[${o}] WebRTC connected`),it(!0),mt(!1),Cr();const zr=()=>{var g,et;const Dr=(et=(g=Jt.current)==null?void 0:g.webrtcPeer)==null?void 0:et.remoteStream,Fr=sr.current,pt=Mr.current;if(Dr&&Dr.getTracks().length>0&&Fr&&pt){try{Fr.createMediaStreamSource(Dr).connect(pt),a(`[${o}] RX analyser wired (${Dr.getTracks().length} tracks)`)}catch(st){a(`[${o}] RX analyser error: ${st.message}`)}return!0}return!1};if(!zr()){let Dr=0;const Fr=setInterval(()=>{(zr()||++Dr>50)&&clearInterval(Fr)},200)}},onWebRTCDisconnected:()=>{a(`[${o}] WebRTC disconnected`),it(!1),lt(!1),er([])},onPeers:zr=>d==null?void 0:d(zr),onError:zr=>{mt(!0),a(`[${o}] error: ${zr}`)}}),Er.subscribe(e)},[o,e,s,a,c,d,Cr]),tr=reactExports.useCallback(()=>It(nt),[It,nt]),fr=reactExports.useCallback(()=>{var qt,ar,yr,xr;Vt.current=!0,Zt.current&&(clearTimeout(Zt.current),Zt.current=null),(qt=Jt.current)==null||qt.unsubscribe(),Jt.current=null,(ar=Dt.current)==null||ar.getTracks().forEach(Rr=>Rr.stop()),ir.current&&(clearInterval(ir.current),ir.current=null),(yr=sr.current)==null||yr.close().catch(()=>{}),sr.current=null,(xr=gr.current)==null||xr.close().catch(()=>{}),gr.current=null,Mr.current=null,$(!1),it(!1),lt(!1),mt(!1),tt(!1),ht(null),Et(null),er([])},[o]),Ft=reactExports.useCallback(qt=>{var Rr;(Rr=gr.current)==null||Rr.close().catch(()=>{});const ar=new AudioContext;gr.current=ar;const yr=ar.createMediaStreamSource(qt),xr=ar.createAnalyser();xr.fftSize=256,yr.connect(xr),Et(xr)},[]),lr=reactExports.useCallback(()=>{var qt;(qt=gr.current)==null||qt.close().catch(()=>{}),gr.current=null,Et(null)},[]),Or=reactExports.useCallback(async()=>{var qt,ar,yr,xr;if(vt){(qt=Dt.current)==null||qt.getTracks().forEach(Rr=>Rr.stop()),(ar=Jt.current)==null||ar.removeMicTrack(),lr(),tt(!1),a(`[${o}] mic off`);return}try{const Rr=await navigator.mediaDevices.getUserMedia({audio:b?{deviceId:{ideal:b}}:!0});Dt.current=Rr,(yr=Rr.getAudioTracks()[0])==null||yr.addEventListener("ended",()=>{a(`[${o}] mic track ended (system)`),lr(),tt(!1)}),(xr=Jt.current)==null||xr.addMicTrack(Rr),Ft(Rr),tt(!0),a(`[${o}] mic on`)}catch(Rr){a(`[${o}] mic error: ${Rr.message}`)}},[vt,o,a,Ft,lr,b]);reactExports.useEffect(()=>{h&&tr();let qt=0;const ar=()=>{var xr,Rr,Er;if(document.visibilityState==="hidden"){qt=Date.now();return}const yr=qt?Date.now()-qt:0;qt=0,(xr=sr.current)==null||xr.resume().catch(()=>{}),(Rr=Jt.current)==null||Rr.resumePlayback(),yr>3e4&&((Er=Jt.current)!=null&&Er.connected)&&(a(`[${o}] bg ${Math.round(yr/1e3)}s — reconnecting`),It(nt))};return document.addEventListener("visibilitychange",ar),()=>{document.removeEventListener("visibilitychange",ar),Vt.current=!0,fr(),ir.current&&clearInterval(ir.current),Zt.current&&clearTimeout(Zt.current)}},[]),reactExports.useEffect(()=>{const qt=`${PRESENCE_PATH(e)}/${o}`,ar={peerId:o,role:nt,wsConnected:j,rtcConnected:_e,audioHealthy:at,hasError:dt,micActive:vt};ensureConnected().then(()=>db.set(qt,ar,{flatten:!1})).catch(()=>{})},[o,e,nt,j,_e,at,dt,vt]),reactExports.useEffect(()=>{const qt=`${PRESENCE_PATH(e)}/${o}`;return()=>{ensureConnected().then(()=>db.delete(qt)).catch(()=>{})}},[o,e]);const Sr=reactExports.useCallback(()=>{var qt,ar;(qt=Jt.current)==null||qt.resumePlayback(),((ar=sr.current)==null?void 0:ar.state)==="suspended"&&sr.current.resume().catch(()=>{})},[]);return jsxRuntimeExports.jsxs("div",{className:"border border-border/50 rounded-lg p-4 bg-surface/50",onClick:Sr,"data-testid":`participant-${o}`,children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between mb-3",children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntimeExports.jsx("div",{className:`w-2 h-2 rounded-full ${dt?"bg-red-500":j?_e?at?"bg-green-500":"bg-orange-400":"bg-yellow-500 animate-pulse":"bg-gray-400"}`,title:dt?"Error":j?_e?at?"Connected (audio OK)":"Connected (audio not ready)":"Connecting WebRTC...":"Disconnected"}),jsxRuntimeExports.jsx("span",{className:"text-sm font-medium",children:o}),jsxRuntimeExports.jsx("span",{className:"text-xs text-muted",children:s}),jsxRuntimeExports.jsx("span",{className:`text-[10px] px-1.5 py-0.5 rounded ${nt==="speaker"?"bg-yellow-500/20 text-yellow-400":"bg-surface text-muted"}`,children:nt})]}),jsxRuntimeExports.jsxs("div",{className:"flex gap-2",children:[j&&jsxRuntimeExports.jsx("button",{onClick:Or,className:`px-2 py-1 text-xs rounded ${vt?"bg-red-500/20 text-red-400":"bg-surface"} border border-border/40`,children:vt?"Mic Off":"Mic On"}),jsxRuntimeExports.jsx("button",{onClick:j?fr:tr,className:`px-3 py-1 text-xs rounded ${j?"bg-red-500/20 text-red-400":"bg-primary/20 text-primary"} border border-border/40`,"data-testid":`${o}-connect`,children:j?"Disconnect":"Connect"})]})]}),jsxRuntimeExports.jsx(AudioLevelMeter,{analyser:ot,label:"RX Level"}),xt&&jsxRuntimeExports.jsx(AudioLevelMeter,{analyser:xt,label:"Mic Level"}),jsxRuntimeExports.jsxs("div",{className:"mt-2 text-[10px] text-muted font-mono",children:["pkts: ",_t," | bytes: ",(Bt/1024).toFixed(0),"KB"]}),Ht.length>0&&jsxRuntimeExports.jsxs("div",{className:"mt-3 space-y-1",children:[jsxRuntimeExports.jsx("div",{className:"text-[10px] text-muted uppercase tracking-wide",children:"Tracks"}),Ht.map(qt=>jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2 text-[10px] font-mono bg-surface/80 rounded px-2 py-1",children:[jsxRuntimeExports.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${qt.readyState==="live"?"bg-green-500":"bg-gray-500"}`}),jsxRuntimeExports.jsx("span",{className:qt.direction==="outbound"?"text-blue-400":"text-green-400",children:qt.direction==="outbound"?"↑":"↓"}),jsxRuntimeExports.jsx("span",{className:"text-muted w-20",children:qt.label}),jsxRuntimeExports.jsx("span",{className:"text-muted",children:qt.direction==="inbound"?`${qt.packetsReceived} pkts | ${((qt.bytesReceived??0)/1024).toFixed(0)}KB | j:${(qt.jitter??0).toFixed(3)} | lost:${qt.packetsLost??0}`:`${qt.packetsSent} pkts | ${((qt.bytesSent??0)/1024).toFixed(0)}KB`})]},qt.id+qt.direction))]}),Yt&&jsxRuntimeExports.jsxs("div",{className:"mt-3",children:[jsxRuntimeExports.jsx("div",{className:"text-[10px] text-muted uppercase tracking-wide mb-1",children:"Pipeline Debug"}),jsxRuntimeExports.jsxs("div",{className:"text-[10px] font-mono bg-black/60 rounded p-2 space-y-1",children:[jsxRuntimeExports.jsxs("div",{children:["PC: ",jsxRuntimeExports.jsx("span",{className:"text-yellow-400",children:Yt.pcState})," | ICE: ",jsxRuntimeExports.jsx("span",{className:"text-yellow-400",children:Yt.iceState})," | Sig: ",jsxRuntimeExports.jsx("span",{className:"text-yellow-400",children:Yt.signalingState})]}),Yt.audio?(()=>{const qt=Yt.audio;return jsxRuntimeExports.jsxs("div",{children:["Audio: paused=",jsxRuntimeExports.jsx("span",{className:qt.paused?"text-red-400":"text-green-400",children:String(qt.paused)})," vol=",String(qt.volume)," time=",String(qt.currentTime)," ready=",String(qt.readyState)," inDOM=",jsxRuntimeExports.jsx("span",{className:qt.inDOM?"text-green-400":"text-red-400",children:String(qt.inDOM)})]})})():null,(Nr=Yt.streamTracks)==null?void 0:Nr.map((qt,ar)=>jsxRuntimeExports.jsxs("div",{className:"pl-2",children:["Track[",ar,"]: ",qt.id," enabled=",jsxRuntimeExports.jsx("span",{className:qt.enabled?"text-green-400":"text-red-400",children:String(qt.enabled)})," muted=",jsxRuntimeExports.jsx("span",{className:qt.muted?"text-yellow-400":"text-green-400",children:String(qt.muted)})," state=",qt.readyState]},ar)),(Tr=Yt.transceivers)==null?void 0:Tr.map((qt,ar)=>jsxRuntimeExports.jsxs("div",{className:"pl-2",children:["Transceiver[",ar,"]: mid=",qt.mid," dir=",qt.direction," cur=",jsxRuntimeExports.jsx("span",{className:"text-cyan-400",children:qt.currentDirection??"null"}),qt.stopped?" STOPPED":""]},ar)),(Kr=Yt.rtp)==null?void 0:Kr.map((qt,ar)=>{var yr;return jsxRuntimeExports.jsxs("div",{className:`pl-2 ${qt.dir==="in"?"text-green-400":"text-blue-400"}`,children:["RTP ",qt.dir,": ssrc=",qt.ssrc," pkts=",qt.pkts," bytes=",qt.bytes,qt.lost!==void 0?` lost=${qt.lost}`:"",qt.jitter!==void 0?` j=${(yr=qt.jitter)==null?void 0:yr.toFixed(3)}`:""]},ar)})]})]})]})}const STORAGE_KEY="audio-test:settings";function loadSettings(){try{return JSON.parse(localStorage.getItem(STORAGE_KEY)??"{}")}catch{return{}}}const VALID_TRANSPORTS=["ws","webrtc","both"],VALID_MODES=["standalone","connected"];function AudioTestPage(){const o="audio-test",[e,s]=reactExports.useState(()=>{const It=loadSettings();return VALID_TRANSPORTS.includes(It.transport)?It.transport:"webrtc"}),[a,c]=reactExports.useState(()=>{const It=loadSettings();return VALID_MODES.includes(It.testMode)?It.testMode:"standalone"}),[d,h]=reactExports.useState(()=>loadSettings().channel??o),[b,j]=reactExports.useState([]),[$,_e]=reactExports.useState(newMetrics("webrtc")),[it,at]=reactExports.useState([]),[lt,dt]=reactExports.useState(new Map),[mt]=reactExports.useState(getDeviceId),[vt,tt]=reactExports.useState(()=>{const It=Math.max(1,loadSettings().participantCount??1),tr=getDeviceId();return Array.from({length:It},(fr,Ft)=>It===1?tr:`${tr}-${Ft+1}`)}),[nt,ot]=reactExports.useState(()=>loadSettings().autoConnect??!1),[ht,xt]=reactExports.useState("Hello, this is a test of the audio pipeline. Can you hear me clearly?"),[Et,_t]=reactExports.useState(!1),{inputDeviceId:Rt}=useAudioSettings(),[Bt,Mt]=reactExports.useState(!1),[Ht,er]=reactExports.useState(!1),Yt=reactExports.useRef(null),rr=reactExports.useRef(null),Jt=reactExports.useRef(b);Jt.current=b;const Dt=reactExports.useRef($);Dt.current=$,reactExports.useEffect(()=>{localStorage.setItem(STORAGE_KEY,JSON.stringify({transport:e,testMode:a,channel:d,participantCount:vt.length,autoConnect:nt}))},[e,a,d,vt.length,nt]);const gr=reactExports.useRef(new Map),Lt=reactExports.useRef(!1);reactExports.useEffect(()=>{if(a!=="connected")return;let It=!1;const tr=[],fr=PRESENCE_PATH(d);ensureConnected().then(()=>{It||tr.push(db.onChild(fr,lr=>{lr.type==="added"||lr.type==="changed"?gr.current.set(lr.key,lr.val()):lr.type==="removed"&&gr.current.delete(lr.key),Lt.current=!0}))});const Ft=setInterval(()=>{Lt.current&&(Lt.current=!1,dt(new Map(gr.current)))},2e3);return()=>{It=!0,tr.forEach(lr=>lr()),clearInterval(Ft),gr.current.clear(),dt(new Map)}},[d,a]);const Vt=reactExports.useCallback(It=>{const tr=new Date().toISOString().slice(11,23);j(fr=>[...fr.slice(-200),`${tr} ${It}`])},[]);reactExports.useEffect(()=>(window.__audioTest={setTransport:s,setTestMode:c,addParticipant:()=>tt(It=>[...It,`${mt}-${It.length+1}`]),removeParticipant:()=>tt(It=>It.slice(0,-1)),triggerTTS:()=>{var It;return(It=document.querySelector('[data-testid="tts-trigger"]'))==null?void 0:It.click()},playSine:()=>{var It;return(It=document.querySelector('[data-testid="play-sine"]'))==null?void 0:It.click()},getLogs:()=>Jt.current,getMetrics:()=>Dt.current,channel:d,setChannel:h},()=>{delete window.__audioTest}),[d]),reactExports.useEffect(()=>()=>{var It,tr;(It=rr.current)==null||It.call(rr),(tr=Yt.current)==null||tr.stop()},[]);const nr=reactExports.useCallback(async()=>{Ht||(await ensureAudioUnlocked(),er(!0))},[Ht]),Zt=reactExports.useCallback(()=>{var tr;const It=getSharedAudioContext();return(tr=Yt.current)==null||tr.stop(),Yt.current=new AudioStreamPlayer(It),Yt.current},[]),sr=reactExports.useCallback(async It=>{var Sr;await nr(),(Sr=rr.current)==null||Sr.call(rr);const tr=Zt(),fr=4096;let Ft=0,lr=!1;Vt(`Playing ${It.length} samples (${(It.length/44100).toFixed(1)}s)`),rr.current=()=>{lr=!0,tr.stop()};const Or=()=>{if(lr||Ft>=It.length){lr||Vt("Playback complete");return}const Nr=Math.min(Ft+fr,It.length),Tr=It.slice(Ft,Nr);tr.feedPCM(Tr.buffer.slice(Tr.byteOffset,Tr.byteOffset+Tr.byteLength)),Ft=Nr,setTimeout(Or,fr/44100*1e3*.8)};await tr.ensureResumed(),Or()},[Vt,Zt,nr]),Mr=reactExports.useCallback(async()=>{var Nr;await nr(),(Nr=rr.current)==null||Nr.call(rr);const It=Zt(),tr=generateSineWave(440,3),fr=512;let Ft=0,lr=0,Or=!1;Vt("Stress test: 512-sample chunks"),await It.ensureResumed();const Sr=setInterval(()=>{if(Or||Ft>=tr.length){clearInterval(Sr),Or||Vt(`Stress test done: ${lr} chunks`);return}const Tr=Math.min(Ft+fr,tr.length),Kr=tr.slice(Ft,Tr);It.feedPCM(Kr.buffer.slice(Kr.byteOffset,Kr.byteOffset+Kr.byteLength)),Ft=Tr,lr++},5);rr.current=()=>{Or=!0,clearInterval(Sr),It.stop()}},[Vt,Zt,nr]),ir=reactExports.useCallback(async(It,tr)=>{Vt(`Broadcasting "${It}" to channel ${d}...`);const fr=4096,Ft=[];for(let lr=0;lr<tr.length;lr+=fr){const Or=Math.min(lr+fr,tr.length),Sr=tr.slice(lr,Or),Nr=new Uint8Array(Sr.buffer,Sr.byteOffset,Sr.byteLength);let Tr="";for(let Kr=0;Kr<Nr.length;Kr++)Tr+=String.fromCharCode(Nr[Kr]);Ft.push(btoa(Tr))}try{const lr=await fetch("/api/test/pcm",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({channel:d,chunks:Ft})});if(!lr.ok)throw new Error(`${lr.status} ${lr.statusText}`);Vt(`Broadcast OK: ${Ft.length} chunks, ${(tr.length/44100).toFixed(1)}s`)}catch(lr){Vt(`Broadcast error: ${lr.message}`)}},[d,Vt]),Cr=reactExports.useCallback(async()=>{if(ht.trim()){_t(!0),Vt(`Triggering TTS: "${ht.slice(0,50)}..."`);try{const It=await fetch("/api/test/tts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({roomId:d,text:ht})});if(!It.ok)throw new Error(`${It.status} ${It.statusText}`);Vt("TTS triggered OK")}catch(It){Vt(`TTS error: ${It.message}`)}finally{_t(!1)}}},[ht,d,Vt]);return jsxRuntimeExports.jsxs("div",{className:"min-h-dvh bg-bg text-text",children:[jsxRuntimeExports.jsx("header",{className:"border-b border-border/60 backdrop-blur-xl bg-bg/80 sticky top-0 z-50",children:jsxRuntimeExports.jsxs("div",{className:"max-w-6xl mx-auto flex items-center justify-between px-4 sm:px-6 h-12 sm:h-14 gap-2",children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[jsxRuntimeExports.jsx("a",{href:"/",className:"text-[14px] sm:text-[15px] font-semibold tracking-tight",children:"Para"}),jsxRuntimeExports.jsx("span",{className:"text-muted",children:"/"}),jsxRuntimeExports.jsx("span",{className:"text-xs sm:text-sm",children:"Audio Test"})]}),jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2 text-xs min-w-0",children:[jsxRuntimeExports.jsx("span",{className:"text-[10px] font-mono text-muted/60 hidden sm:inline",children:mt}),jsxRuntimeExports.jsx("input",{value:d,onChange:It=>h(It.target.value),className:"bg-surface px-2 py-0.5 rounded text-[11px] font-mono border border-border/40 w-24 sm:w-36 min-w-0","data-testid":"channel-id",placeholder:"channel"}),jsxRuntimeExports.jsx("button",{onClick:()=>h(o),className:"text-[10px] text-muted hover:text-text shrink-0",title:"Reset to default",children:"reset"}),jsxRuntimeExports.jsx("button",{onClick:()=>Mt(!0),className:"text-[10px] text-muted hover:text-text border border-border/40 rounded px-1.5 py-0.5 shrink-0",title:"Audio device settings",children:"devices"})]})]})}),jsxRuntimeExports.jsxs("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 py-4 sm:py-6 space-y-4 sm:space-y-6",children:[jsxRuntimeExports.jsxs("div",{className:"flex flex-wrap gap-4 items-center","data-testid":"controls",children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntimeExports.jsx("span",{className:"text-xs text-muted",children:"Mode:"}),jsxRuntimeExports.jsx("div",{className:"flex rounded-lg border border-border/50 overflow-hidden",children:["standalone","connected"].map(It=>jsxRuntimeExports.jsx("button",{onClick:()=>c(It),className:`px-3 py-1.5 text-xs ${a===It?"bg-primary/20 text-primary":"bg-surface/50 text-muted"}`,children:It},It))})]}),jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntimeExports.jsx("span",{className:"text-xs text-muted",children:"Transport:"}),jsxRuntimeExports.jsx("div",{className:"flex rounded-lg border border-border/50 overflow-hidden",children:["ws","webrtc","both"].map(It=>jsxRuntimeExports.jsx("button",{onClick:()=>s(It),className:`px-3 py-1.5 text-xs uppercase ${e===It?"bg-primary/20 text-primary":"bg-surface/50 text-muted"}`,"data-testid":`transport-${It}`,children:It==="both"?"both (rtc+ws)":It},It))})]}),a==="connected"&&jsxRuntimeExports.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer",children:[jsxRuntimeExports.jsx("input",{type:"checkbox",checked:nt,onChange:It=>ot(It.target.checked),className:"w-3 h-3"}),jsxRuntimeExports.jsx("span",{className:"text-xs text-muted",children:"Auto-connect"})]}),a==="connected"&&jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntimeExports.jsx("span",{className:"text-xs text-muted",children:"Participants:"}),jsxRuntimeExports.jsx("button",{onClick:()=>tt(It=>It.length>1?It.slice(0,-1):It),className:"w-6 h-6 rounded border border-border/50 text-xs bg-surface/50",children:"-"}),jsxRuntimeExports.jsx("span",{className:"text-sm font-mono w-4 text-center",children:vt.length}),jsxRuntimeExports.jsx("button",{onClick:()=>tt(It=>[...It,`${mt}-${It.length+1}`]),className:"w-6 h-6 rounded border border-border/50 text-xs bg-surface/50","data-testid":"add-participant",children:"+"})]})]}),jsxRuntimeExports.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[jsxRuntimeExports.jsxs("div",{className:"space-y-4",children:[a==="standalone"&&jsxRuntimeExports.jsxs("section",{className:"border border-border/50 rounded-lg p-4 bg-surface/30",children:[jsxRuntimeExports.jsx("h2",{className:"text-sm font-semibold mb-3",children:"Standalone Audio Samples"}),jsxRuntimeExports.jsx("p",{className:"text-xs text-muted mb-3",children:"Tests AudioStreamPlayer directly — no server needed."}),jsxRuntimeExports.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[jsxRuntimeExports.jsx("button",{onClick:()=>sr(generateSineWave(440,2)),className:"px-3 py-2 text-xs rounded-lg bg-surface border border-border/40 hover:border-primary/40 transition","data-testid":"play-sine",children:"440Hz Sine (2s)"}),jsxRuntimeExports.jsx("button",{onClick:()=>sr(generateSineWave(880,1)),className:"px-3 py-2 text-xs rounded-lg bg-surface border border-border/40 hover:border-primary/40 transition",children:"880Hz Sine (1s)"}),jsxRuntimeExports.jsx("button",{onClick:()=>sr(generateChirp(200,2e3,3)),className:"px-3 py-2 text-xs rounded-lg bg-surface border border-border/40 hover:border-primary/40 transition","data-testid":"play-chirp",children:"Chirp 200-2kHz (3s)"}),jsxRuntimeExports.jsx("button",{onClick:()=>sr(generateWhiteNoise(1)),className:"px-3 py-2 text-xs rounded-lg bg-surface border border-border/40 hover:border-primary/40 transition",children:"White Noise (1s)"}),jsxRuntimeExports.jsx("button",{onClick:Mr,className:"col-span-2 px-3 py-2 text-xs rounded-lg bg-amber-500/10 border border-amber-500/30 text-amber-400 hover:border-amber-400/50 transition","data-testid":"stress-test",children:"Stress Test (tiny chunks, 3s)"})]})]}),a==="connected"&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("section",{className:"border border-border/50 rounded-lg p-4 bg-surface/30",children:[jsxRuntimeExports.jsx("h2",{className:"text-sm font-semibold mb-3",children:"TTS (Server - Clients)"}),jsxRuntimeExports.jsx("textarea",{value:ht,onChange:It=>xt(It.target.value),className:"w-full bg-black/30 border border-border/40 rounded-lg p-3 text-sm font-mono resize-none h-20",placeholder:"Text to speak...","data-testid":"tts-text"}),jsxRuntimeExports.jsx("button",{onClick:Cr,disabled:Et,className:"mt-2 px-4 py-2 text-xs rounded-lg bg-primary/20 text-primary border border-primary/30 hover:border-primary/50 transition disabled:opacity-50","data-testid":"tts-trigger",children:Et?"Sending...":"Trigger TTS"})]}),jsxRuntimeExports.jsxs("section",{className:"border border-border/50 rounded-lg p-4 bg-surface/30",children:[jsxRuntimeExports.jsx("h2",{className:"text-sm font-semibold mb-3",children:"Broadcast Samples (Server - All Clients)"}),jsxRuntimeExports.jsx("p",{className:"text-xs text-muted mb-3",children:"Sends generated audio through the server — all connected participants hear it."}),jsxRuntimeExports.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[jsxRuntimeExports.jsx("button",{onClick:()=>ir("440Hz Sine",generateSineWave(440,2)),className:"px-3 py-2 text-xs rounded-lg bg-surface border border-border/40 hover:border-primary/40 transition","data-testid":"broadcast-sine",children:"440Hz Sine (2s)"}),jsxRuntimeExports.jsx("button",{onClick:()=>ir("880Hz Sine",generateSineWave(880,1)),className:"px-3 py-2 text-xs rounded-lg bg-surface border border-border/40 hover:border-primary/40 transition",children:"880Hz Sine (1s)"}),jsxRuntimeExports.jsx("button",{onClick:()=>ir("Chirp",generateChirp(200,2e3,3)),className:"px-3 py-2 text-xs rounded-lg bg-surface border border-border/40 hover:border-primary/40 transition","data-testid":"broadcast-chirp",children:"Chirp 200-2kHz (3s)"}),jsxRuntimeExports.jsx("button",{onClick:()=>ir("White Noise",generateWhiteNoise(1)),className:"px-3 py-2 text-xs rounded-lg bg-surface border border-border/40 hover:border-primary/40 transition",children:"White Noise (1s)"})]})]}),jsxRuntimeExports.jsxs("section",{className:"space-y-3",children:[jsxRuntimeExports.jsx("h2",{className:"text-sm font-semibold",children:"Participants"}),vt.map(It=>jsxRuntimeExports.jsx(ParticipantPanel,{id:It,channel:d,transport:e,onLog:Vt,onMetrics:_e,onPeers:at,autoConnect:nt,inputDeviceId:Rt},It))]})]})]}),jsxRuntimeExports.jsxs("div",{className:"space-y-4",children:[jsxRuntimeExports.jsxs("section",{className:"border border-border/50 rounded-lg p-4 bg-surface/30",children:[jsxRuntimeExports.jsx("h2",{className:"text-sm font-semibold mb-3",children:"Metrics"}),jsxRuntimeExports.jsxs("div",{className:"grid grid-cols-2 gap-3 text-xs font-mono",children:[jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("span",{className:"text-muted",children:"Transport"}),jsxRuntimeExports.jsx("div",{className:"text-sm",children:$.transport})]}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("span",{className:"text-muted",children:"Avg Latency"}),jsxRuntimeExports.jsx("div",{className:"text-sm",children:avgLatency($)})]}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("span",{className:"text-muted",children:"Packets"}),jsxRuntimeExports.jsx("div",{className:"text-sm",children:$.packetsReceived})]}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("span",{className:"text-muted",children:"Data"}),jsxRuntimeExports.jsxs("div",{className:"text-sm",children:[($.bytesReceived/1024).toFixed(1)," KB"]})]})]})]}),a==="connected"&&(it.length>0||lt.size>0)&&(()=>{const It=new Map;for(const tr of it)It.set(tr.peerId,{...tr,presence:lt.get(tr.peerId)});for(const[tr,fr]of lt)It.has(tr)||It.set(tr,{peerId:tr,role:fr.role,presence:fr});return jsxRuntimeExports.jsxs("section",{className:"border border-border/50 rounded-lg p-4 bg-surface/30",children:[jsxRuntimeExports.jsxs("h2",{className:"text-sm font-semibold mb-3",children:["Connected Peers (",It.size,")"]}),jsxRuntimeExports.jsx("div",{className:"space-y-1",children:Array.from(It.values()).map(({peerId:tr,role:fr,presence:Ft})=>{const lr=tr===mt||tr.startsWith(mt+"-"),Or=Ft?Ft.hasError?"bg-red-500":Ft.wsConnected?Ft.rtcConnected?Ft.audioHealthy?"bg-green-500":"bg-orange-400":"bg-yellow-500 animate-pulse":"bg-gray-400":"bg-gray-400";return jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2 text-[11px] font-mono bg-surface/80 rounded px-2 py-1",children:[jsxRuntimeExports.jsx("div",{className:`w-1.5 h-1.5 rounded-full ${Or}`}),jsxRuntimeExports.jsx("span",{className:"text-text",children:tr}),jsxRuntimeExports.jsx("span",{className:`text-[10px] px-1.5 py-0.5 rounded ${fr==="speaker"?"bg-yellow-500/20 text-yellow-400":"bg-surface text-muted"}`,children:fr}),(Ft==null?void 0:Ft.micActive)&&jsxRuntimeExports.jsx("span",{className:"text-[9px] text-green-400",children:"mic"}),lr&&jsxRuntimeExports.jsx("span",{className:"text-[9px] text-muted",children:"(you)"})]},tr)})})]})})(),jsxRuntimeExports.jsxs("section",{children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between mb-2",children:[jsxRuntimeExports.jsx("h2",{className:"text-sm font-semibold",children:"Log"}),jsxRuntimeExports.jsx("button",{onClick:()=>j([]),className:"text-[10px] text-muted hover:text-text",children:"Clear"})]}),jsxRuntimeExports.jsx(LogPanel,{logs:b})]})]})]})]}),jsxRuntimeExports.jsx(AudioSettingsModal,{open:Bt,onClose:()=>Mt(!1)})]})}function App(){return useTheme(),jsxRuntimeExports.jsxs(Routes,{children:[jsxRuntimeExports.jsx(Route,{path:"/",element:jsxRuntimeExports.jsx(LobbyPage,{})}),jsxRuntimeExports.jsx(Route,{path:"/create",element:jsxRuntimeExports.jsx(CreatePage,{})}),jsxRuntimeExports.jsx(Route,{path:"/room/:roomId",element:jsxRuntimeExports.jsx(RoomPage,{})}),jsxRuntimeExports.jsx(Route,{path:"/profile",element:jsxRuntimeExports.jsx(ProfilePage,{})}),jsxRuntimeExports.jsx(Route,{path:"/hosts",element:jsxRuntimeExports.jsx(HostsPage,{})}),jsxRuntimeExports.jsx(Route,{path:"/test/audio",element:jsxRuntimeExports.jsx(AudioTestPage,{})}),jsxRuntimeExports.jsx(Route,{path:"*",element:jsxRuntimeExports.jsx(Navigate,{to:"/",replace:!0})})]})}createRoot(document.getElementById("root")).render(jsxRuntimeExports.jsx(BrowserRouter,{children:jsxRuntimeExports.jsx(App,{})}));export{logger as l};