From bfd0ba61d12ac8fd4cc1d1652cc043306b676a7e Mon Sep 17 00:00:00 2001 From: voluntas Date: Mon, 11 Mar 2024 11:22:41 +0900 Subject: [PATCH 1/3] biome format / biome check --apply --- biome.json | 5 +- dist/404.html | 2 +- .../chunks/37e5948f-8d930f9406b243ab.js | 1 - .../static/chunks/458-e4c45bddd6d9b508.js | 5 - .../static/chunks/531-22a1e9c8c7afcca6.js | 1 - .../chunks/cc70a55e-ff0aca4bf267daed.js | 8 - .../chunks/framework-2d4c0e1302aa80c0.js | 33 --- .../chunks/main-app-7d562a095e4fb7ca.js | 1 - .../static/chunks/main-ca7105c38f85d8e9.js | 1 - .../chunks/pages/_app-6b43595fa6af8499.js | 83 ------- .../chunks/pages/_error-6150b857d13bda4e.js | 1 - .../chunks/pages/devtools-f6a01e1b5e21b78d.js | 1 - .../chunks/pages/index-7c71d17fd9118467.js | 1 - .../static/chunks/webpack-600237bb0c9b9fff.js | 1 - dist/_next/static/css/be394e4c690ae224.css | 5 - .../static/sora_devtools/_buildManifest.js | 2 +- dist/devtools.html | 2 +- dist/index.html | 2 +- dist/service-worker.js | 32 --- package.json | 2 +- pnpm-lock.yaml | 205 ++++++++++-------- src/api.ts | 2 +- src/app/actions.ts | 2 +- src/app/hooks.ts | 6 +- src/app/slice.ts | 6 +- src/app/store.ts | 2 +- src/components/AlertMessages.tsx | 3 +- src/components/ClipboardIcon.tsx | 2 +- src/components/DebugPane/CopyLogButton.tsx | 2 +- src/components/DebugPane/Filter.tsx | 2 +- src/components/DebugPane/Message.tsx | 3 +- .../SendDataChannelMessagingMessage.tsx | 3 +- src/components/DebugPane/index.tsx | 2 +- .../DevtoolsPane/AspectRatioForm.tsx | 2 +- .../DevtoolsPane/AudioBitRateForm.tsx | 2 +- .../DevtoolsPane/AudioCodecTypeForm.tsx | 2 +- .../DevtoolsPane/AudioContentHintForm.tsx | 2 +- src/components/DevtoolsPane/AudioForm.tsx | 2 +- .../DevtoolsPane/AudioInputForm.tsx | 2 +- .../DevtoolsPane/AudioOutputForm.tsx | 2 +- .../AudioStreamingLanguageCodeForm.tsx | 2 +- .../DevtoolsPane/AudioTrackForm.tsx | 2 +- .../DevtoolsPane/AutoGainControlForm.tsx | 2 +- .../DevtoolsPane/BlurRadiusForm.tsx | 2 +- src/components/DevtoolsPane/BundleIdForm.tsx | 2 +- .../DevtoolsPane/CameraDeviceForm.tsx | 2 +- src/components/DevtoolsPane/ChannelIdForm.tsx | 2 +- src/components/DevtoolsPane/ClientIdForm.tsx | 2 +- src/components/DevtoolsPane/ConnectButton.tsx | 2 +- .../DevtoolsPane/DataChannelForm.tsx | 2 +- .../DevtoolsPane/DataChannelsForm.tsx | 2 +- .../DevtoolsPane/DisconnectButton.tsx | 2 +- .../DevtoolsPane/DisplayResolutionForm.tsx | 2 +- .../DevtoolsPane/DisposeMediaButton.tsx | 2 +- src/components/DevtoolsPane/E2EEForm.tsx | 3 +- .../DevtoolsPane/EchoCancellationForm.tsx | 2 +- .../DevtoolsPane/EchoCancellationTypeForm.tsx | 2 +- .../DevtoolsPane/FacingModeForm.tsx | 2 +- .../DevtoolsPane/FakeVolumeForm.tsx | 2 +- .../DevtoolsPane/ForwardingFilterForm.tsx | 2 +- src/components/DevtoolsPane/FrameRateForm.tsx | 2 +- .../DevtoolsPane/LightAdjustmentForm.tsx | 2 +- .../MediaProcessorsNoiseSuppressionForm.tsx | 2 +- src/components/DevtoolsPane/MediaTypeForm.tsx | 3 +- src/components/DevtoolsPane/MetadataForm.tsx | 2 +- src/components/DevtoolsPane/MicDeviceForm.tsx | 2 +- .../DevtoolsPane/MultistreamForm.tsx | 2 +- .../DevtoolsPane/NoiseSuppressionForm.tsx | 2 +- src/components/DevtoolsPane/ReconnectForm.tsx | 2 +- .../DevtoolsPane/ReloadDevicesButton.tsx | 2 +- .../DevtoolsPane/RequestMediaButton.tsx | 2 +- .../DevtoolsPane/ResizeModeForm.tsx | 2 +- .../DevtoolsPane/ResolutionForm.tsx | 2 +- src/components/DevtoolsPane/RoleForm.tsx | 2 +- .../SignalingNotifyMetadataForm.tsx | 2 +- .../SignalingUrlCandidatesForm.tsx | 2 +- src/components/DevtoolsPane/SimulcastForm.tsx | 2 +- .../DevtoolsPane/SimulcastRidForm.tsx | 2 +- .../DevtoolsPane/SpotlightFocusRidForm.tsx | 2 +- src/components/DevtoolsPane/SpotlightForm.tsx | 2 +- .../DevtoolsPane/SpotlightNumberForm.tsx | 2 +- .../DevtoolsPane/SpotlightUnfocusRidForm.tsx | 2 +- .../DevtoolsPane/StartRecordingButton.tsx | 2 +- .../DevtoolsPane/StopRecordingButton.tsx | 2 +- .../DevtoolsPane/TooltipFormCheck.tsx | 2 +- .../DevtoolsPane/TooltipFormLabel.tsx | 2 +- .../DevtoolsPane/UpdateMediaStreamButton.tsx | 2 +- .../DevtoolsPane/VideoAV1ParamsForm.tsx | 2 +- .../DevtoolsPane/VideoBitRateForm.tsx | 2 +- .../DevtoolsPane/VideoCodecTypeForm.tsx | 2 +- .../DevtoolsPane/VideoContentHintForm.tsx | 2 +- src/components/DevtoolsPane/VideoForm.tsx | 2 +- .../DevtoolsPane/VideoH264ParamsForm.tsx | 2 +- .../DevtoolsPane/VideoH265ParamsForm.tsx | 2 +- .../DevtoolsPane/VideoInputForm.tsx | 2 +- .../DevtoolsPane/VideoTrackForm.tsx | 2 +- .../DevtoolsPane/VideoVP9ParamsForm.tsx | 2 +- src/components/DevtoolsPane/index.tsx | 3 +- src/components/Footer/DebugButton.tsx | 2 +- src/components/Footer/index.tsx | 2 +- src/components/Head.tsx | 2 +- src/components/Header/CopyUrlButton.tsx | 2 +- src/components/Header/DebugButton.tsx | 2 +- .../Header/DownloadReportButton.tsx | 5 +- src/components/Header/index.tsx | 2 +- src/components/MediacaptureRegionTarget.tsx | 3 +- src/components/Video/ConnectionStatusBar.tsx | 2 +- src/components/Video/JitterBuffer.tsx | 2 +- src/components/Video/LocalVideo.tsx | 3 +- src/components/Video/RemoteVideos.tsx | 3 +- .../Video/RequestRtpStreamButton.tsx | 4 +- ...questRtpStreamBySendConnectionIdButton.tsx | 4 +- .../Video/RequestSpotlightRidButton.tsx | 3 +- ...stSpotlightRidBySendConnectionIdButton.tsx | 3 +- src/components/Video/ResetRtpStreamButton.tsx | 2 +- ...ResetRtpStreamBySendConnectionIdButton.tsx | 2 +- .../Video/ResetSpotlightRidButton.tsx | 2 +- ...etSpotlightRidBySendConnectionIdButton.tsx | 2 +- src/components/Video/SessionStatusBar.tsx | 2 +- src/components/Video/Video.tsx | 2 +- src/pages/_app.tsx | 4 +- src/pages/devtools.tsx | 3 +- src/pages/index.tsx | 2 +- src/types.ts | 4 +- src/utils.ts | 21 +- 125 files changed, 252 insertions(+), 400 deletions(-) delete mode 100644 dist/_next/static/chunks/37e5948f-8d930f9406b243ab.js delete mode 100644 dist/_next/static/chunks/458-e4c45bddd6d9b508.js delete mode 100644 dist/_next/static/chunks/531-22a1e9c8c7afcca6.js delete mode 100644 dist/_next/static/chunks/cc70a55e-ff0aca4bf267daed.js delete mode 100644 dist/_next/static/chunks/framework-2d4c0e1302aa80c0.js delete mode 100644 dist/_next/static/chunks/main-app-7d562a095e4fb7ca.js delete mode 100644 dist/_next/static/chunks/main-ca7105c38f85d8e9.js delete mode 100644 dist/_next/static/chunks/pages/_app-6b43595fa6af8499.js delete mode 100644 dist/_next/static/chunks/pages/_error-6150b857d13bda4e.js delete mode 100644 dist/_next/static/chunks/pages/devtools-f6a01e1b5e21b78d.js delete mode 100644 dist/_next/static/chunks/pages/index-7c71d17fd9118467.js delete mode 100644 dist/_next/static/chunks/webpack-600237bb0c9b9fff.js delete mode 100644 dist/_next/static/css/be394e4c690ae224.css delete mode 100644 dist/service-worker.js diff --git a/biome.json b/biome.json index c3993d38..1889b025 100644 --- a/biome.json +++ b/biome.json @@ -1,5 +1,5 @@ { - "$schema": "https://biomejs.dev/schemas/1.5.3/schema.json", + "$schema": "https://biomejs.dev/schemas/1.6.0/schema.json", "organizeImports": { "enabled": true }, @@ -13,9 +13,6 @@ "style": { "useNamingConvention": "off" }, - "nursery": { - "noUselessLoneBlockStatements": "off" - }, "complexity": { "useSimplifiedLogicExpression": "off" } diff --git a/dist/404.html b/dist/404.html index f6c39194..9f316b57 100644 --- a/dist/404.html +++ b/dist/404.html @@ -1 +1 @@ -404: This page could not be found

404

This page could not be found.

\ No newline at end of file +404: This page could not be found

404

This page could not be found.

\ No newline at end of file diff --git a/dist/_next/static/chunks/37e5948f-8d930f9406b243ab.js b/dist/_next/static/chunks/37e5948f-8d930f9406b243ab.js deleted file mode 100644 index 70d5a98f..00000000 --- a/dist/_next/static/chunks/37e5948f-8d930f9406b243ab.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[353],{6379:function(e,t,n){var r,l=n(9745),a=n(682),o={usingClientEntryPoint:!1,Events:null,Dispatcher:{current:null}};function i(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;np||(e.current=d[p],d[p]=null,p--)}function g(e,t){d[++p]=e.current,e.current=t}var y=Symbol.for("react.element"),v=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),S=Symbol.for("react.provider"),C=Symbol.for("react.context"),E=Symbol.for("react.server_context"),x=Symbol.for("react.forward_ref"),z=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),N=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),L=Symbol.for("react.scope");Symbol.for("react.debug_trace_mode");var T=Symbol.for("react.offscreen"),F=Symbol.for("react.legacy_hidden"),M=Symbol.for("react.cache");Symbol.for("react.tracing_marker");var O=Symbol.iterator;function R(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=O&&e[O]||e["@@iterator"])?e:null}var D=m(null),A=m(null),I=m(null),U=m(null),$={$$typeof:C,_currentValue:null,_currentValue2:null,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null};function B(e,t){switch(g(I,t),g(A,e),g(D,null),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)&&(t=t.namespaceURI)?sW(t):0;break;default:if(t=(e=8===e?t.parentNode:t).tagName,e=e.namespaceURI)t=sH(e=sW(e),t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}h(D),g(D,t)}function V(){h(D),h(A),h(I)}function j(e){null!==e.memoizedState&&g(U,e);var t=D.current,n=sH(t,e.type);t!==n&&(g(A,e),g(D,n))}function Q(e){A.current===e&&(h(D),h(A)),U.current===e&&(h(U),$._currentValue=null)}var W=a.unstable_scheduleCallback,H=a.unstable_cancelCallback,q=a.unstable_shouldYield,K=a.unstable_requestPaint,Y=a.unstable_now,X=a.unstable_getCurrentPriorityLevel,G=a.unstable_ImmediatePriority,Z=a.unstable_UserBlockingPriority,J=a.unstable_NormalPriority,ee=a.unstable_LowPriority,et=a.unstable_IdlePriority,en=null,er=null,el=Math.clz32?Math.clz32:function(e){return 0==(e>>>=0)?32:31-(ea(e)/eo|0)|0},ea=Math.log,eo=Math.LN2,ei=128,eu=4194304;function es(e){var t=42&e;if(0!==t)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 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 4194176&e;case 4194304:case 8388608:case 16777216:case 33554432:return 62914560&e;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ec(e,t){var n=e.pendingLanes;if(0===n)return 0;var r=0,l=e.suspendedLanes;e=e.pingedLanes;var a=134217727&n;return 0!==a?0!=(n=a&~l)?r=es(n):0!=(e&=a)&&(r=es(e)):0!=(n&=~l)?r=es(n):0!==e&&(r=es(e)),0===r?0:0!==t&&t!==r&&0==(t&l)&&((l=r&-r)>=(e=t&-t)||32===l&&0!=(4194176&e))?t:r}function ef(e,t){return e.errorRecoveryDisabledLanes&t?0:0!=(e=-536870913&e.pendingLanes)?e:536870912&e?536870912:0}function ed(){var e=eu;return 0==(62914560&(eu<<=1))&&(eu=4194304),e}function ep(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function em(e,t){e.pendingLanes|=t,268435456!==t&&(e.suspendedLanes=0,e.pingedLanes=0)}function eh(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-el(t);e.entangledLanes|=t,e.entanglements[r]=1073741824|e.entanglements[r]|4194218&n}function eg(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-el(n),l=1<l||u[r]!==s[l]){var c="\n"+u[r].replace(" at new "," at ");return e.displayName&&c.includes("")&&(c=c.replace("",e.displayName)),c}while(1<=r&&0<=l);break}}}finally{eK=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?eq(n):""}var eX=Symbol.for("react.client.reference");function eG(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function eZ(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function eJ(e){e._valueTracker||(e._valueTracker=function(e){var t=eZ(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==n&&"function"==typeof n.get&&"function"==typeof n.set){var l=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(e){r=""+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function e0(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=eZ(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function e1(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}var e2=/[\n"\\]/g;function e3(e){return e.replace(e2,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function e4(e,t,n,r,l,a,o,i){e.name="",null!=o&&"function"!=typeof o&&"symbol"!=typeof o&&"boolean"!=typeof o?e.type=o:e.removeAttribute("type"),null!=t?"number"===o?(0===t&&""===e.value||e.value!=t)&&(e.value=""+eG(t)):e.value!==""+eG(t)&&(e.value=""+eG(t)):"submit"!==o&&"reset"!==o||e.removeAttribute("value"),null!=t?e8(e,o,eG(t)):null!=n?e8(e,o,eG(n)):null!=r&&e.removeAttribute("value"),null==l&&null!=a&&(e.defaultChecked=!!a),null!=l&&(e.checked=l&&"function"!=typeof l&&"symbol"!=typeof l),null!=i&&"function"!=typeof i&&"symbol"!=typeof i&&"boolean"!=typeof i?e.name=""+eG(i):e.removeAttribute("name")}function e6(e,t,n,r,l,a,o,i){if(null!=a&&"function"!=typeof a&&"symbol"!=typeof a&&"boolean"!=typeof a&&(e.type=a),null!=t||null!=n){if(!("submit"!==a&&"reset"!==a||null!=t))return;n=null!=n?""+eG(n):"",t=null!=t?""+eG(t):n,i||t===e.value||(e.value=t),e.defaultValue=t}r="function"!=typeof(r=null!=r?r:l)&&"symbol"!=typeof r&&!!r,e.checked=i?e.checked:!!r,e.defaultChecked=!!r,null!=o&&"function"!=typeof o&&"symbol"!=typeof o&&"boolean"!=typeof o&&(e.name=o)}function e8(e,t,n){"number"===t&&e1(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}var e5=Array.isArray;function e7(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=iU.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}}var tn=tt;"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction&&(tn=function(e,t){return MSApp.execUnsafeLocalFunction(function(){return tt(e,t)})});var tr=tn;function tl(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType){n.nodeValue=t;return}}e.textContent=t}var ta=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function to(e,t,n){var r=0===t.indexOf("--");null==n||"boolean"==typeof n||""===n?r?e.setProperty(t,""):"float"===t?e.cssFloat="":e[t]="":r?e.setProperty(t,n):"number"!=typeof n||0===n||ta.has(t)?"float"===t?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function ti(e,t,n){if(null!=t&&"object"!=typeof t)throw Error(i(62));if(e=e.style,null!=n){for(var r in n)!n.hasOwnProperty(r)||null!=t&&t.hasOwnProperty(r)||(0===r.indexOf("--")?e.setProperty(r,""):"float"===r?e.cssFloat="":e[r]="");for(var l in t)r=t[l],t.hasOwnProperty(l)&&n[l]!==r&&to(e,l,r)}else for(var a in t)t.hasOwnProperty(a)&&to(e,a,t[a])}function tu(e){if(-1===e.indexOf("-"))return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ts=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),tc=null;function tf(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var td=null,tp=null;function tm(e){var t=eT(e);if(t&&(e=t.stateNode)){var n=eM(e);switch(e=t.stateNode,t.type){case"input":if(e4(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+e3(""+t)+'"][type="radio"]'),t=0;t>=o,l-=o,t$=1<<32-el(t)+l|n<h?(g=f,f=null):g=f.sibling;var y=p(l,f,i[h],u);if(null===y){null===f&&(f=g);break}e&&f&&null===y.alternate&&t(l,f),o=a(y,o,h),null===c?s=y:c.sibling=y,c=y,f=g}if(h===i.length)return n(l,f),tK&&tV(l,h),s;if(null===f){for(;hg?(y=h,h=null):y=h.sibling;var b=p(l,h,v.value,s);if(null===b){null===h&&(h=y);break}e&&h&&null===b.alternate&&t(l,h),o=a(b,o,g),null===f?c=b:f.sibling=b,f=b,h=y}if(v.done)return n(l,h),tK&&tV(l,g),c;if(null===h){for(;!v.done;g++,v=u.next())null!==(v=d(l,v.value,s))&&(o=a(v,o,g),null===f?c=v:f.sibling=v,f=v);return tK&&tV(l,g),c}for(h=r(l,h);!v.done;g++,v=u.next())null!==(v=m(h,l,g,v.value,s))&&(e&&null!==v.alternate&&h.delete(null===v.key?g:v.key),o=a(v,o,g),null===f?c=v:f.sibling=v,f=v);return e&&h.forEach(function(e){return t(l,e)}),tK&&tV(l,g),c}(c,f,h,g);if("function"==typeof h.then)return s(c,f,n_(h),g);if(h.$$typeof===C||h.$$typeof===E)return s(c,f,an(c,h,g),g);nT(c,h)}return"string"==typeof h&&""!==h||"number"==typeof h?(h=""+h,null!==f&&6===f.tag?(n(c,f.sibling),(f=l(f,h)).return=c):(n(c,f),(f=iv(h,c.mode,g)).return=c),o(c=f)):n(c,f)}(s,c,f,h),nP=null,s}}var nO=nM(!0),nR=nM(!1),nD=m(null),nA=m(0);function nI(e,t){g(nA,e=ob),g(nD,t),ob=e|t.baseLanes}function nU(){g(nA,ob),g(nD,nD.current)}function n$(){ob=nA.current,h(nD),h(nA)}var nB=m(null),nV=null;function nj(e){var t=e.alternate;g(nq,1&nq.current),g(nB,e),null===nV&&(null===t||null!==nD.current?nV=e:null!==t.memoizedState&&(nV=e))}function nQ(e){if(22===e.tag){if(g(nq,nq.current),g(nB,e),null===nV){var t=e.alternate;null!==t&&null!==t.memoizedState&&(nV=e)}}else nW(e)}function nW(){g(nq,nq.current),g(nB,nB.current)}function nH(e){h(nB),nV===e&&(nV=null),h(nq)}var nq=m(0);function nK(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(128&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var nY=null,nX=null,nG=!1,nZ=!1,nJ=!1,n0=0;function n1(e){e!==nX&&null===e.next&&(null===nX?nY=nX=e:nX=nX.next=e),nZ=!0,nG||(nG=!0,n8(n4))}function n2(e){if(!nJ&&nZ){var t=null;nJ=!0;do for(var n=!1,r=nY;null!==r;){if(!e||0===r.tag){var l=oh,a=ec(r,r===op?l:0);if(0!=(3&a))try{if(n=!0,l=r,0!=(6&od))throw Error(i(327));if(!ie()){var o=o3(l,a);if(0!==l.tag&&2===o){var u=a,s=ef(l,u);0!==s&&(a=s,o=oQ(l,u,s))}if(1===o)throw u=ow,oG(l,0),oq(l,a,0),n1(l),u;6===o?oq(l,a,ox):(l.finishedWork=l.current.alternate,l.finishedLanes=a,o7(l,oP,oL,ox))}n1(l)}catch(e){null===t?t=[e]:t.push(e)}}r=r.next}while(n);if(nJ=!1,null!==t){if(1a?a:8;var o=ro.transition;ro.transition={},li(e,!1,t,n);try{var i=l();if(null!==i&&"object"==typeof i&&"function"==typeof i.then){var u=rt(i,r);lo(e,t,u)}else{var s=rn(i,r);lo(e,t,s)}}catch(n){lo(e,t,{then:function(){},status:"rejected",reason:n})}finally{ey=a,ro.transition=o}}function le(e,t,n,r){if(5!==e.tag)throw Error(i(476));if(null===e.memoizedState){var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:rT,lastRenderedState:f},a=l;l={memoizedState:f,baseState:f,baseQueue:null,queue:l,next:null},e.memoizedState=l;var o=e.alternate;null!==o&&(o.memoizedState=l)}else a=e.memoizedState.queue;r9(e,a,t,f,function(){return n(r)})}function lt(){var e=at($);return null!==e?e:f}function ln(){return rN().memoizedState}function lr(){return rN().memoizedState}function ll(e){for(var t=e.return;null!==t;){switch(t.tag){case 24:case 3:var n=oB(t),r=nd(t,e=nf(n),n);null!==r&&(oV(r,t,n),np(r,t,n)),t={cache:au()},e.payload=t;return}t=t.return}}function la(e,t,n){var r=oB(e);n={lane:r,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null},lu(e)?ls(t,n):null!==(n=nl(e,t,n,r))&&(oV(n,e,r),lc(n,t,r))}function lo(e,t,n){var r=oB(e),l={lane:r,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null};if(lu(e))ls(t,l);else{var a=e.alternate;if(0===e.lanes&&(null===a||0===a.lanes)&&null!==(a=t.lastRenderedReducer))try{var o=t.lastRenderedState,i=a(o,n);if(l.hasEagerState=!0,l.eagerState=i,tF(i,o)){nr(e,t,l,0),null===op&&nn();return}}catch(e){}finally{}null!==(n=nl(e,t,l,r))&&(oV(n,e,r),lc(n,t,r))}}function li(e,t,n,r){if(r={lane:2,revertLane:n5(),action:r,hasEagerState:!1,eagerState:null,next:null},lu(e)){if(t)throw Error(i(479))}else null!==(t=nl(e,n,r,2))&&oV(t,e,2)}function lu(e){var t=e.alternate;return e===ru||null!==t&&t===ru}function ls(e,t){rd=rf=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function lc(e,t,n){if(0!=(4194176&n)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,eg(e,n)}}i$=function(){return{lastEffect:null,events:null,stores:null}};var lf={readContext:at,use:rL,useCallback:rv,useContext:rv,useEffect:rv,useImperativeHandle:rv,useInsertionEffect:rv,useLayoutEffect:rv,useMemo:rv,useReducer:rv,useRef:rv,useState:rv,useDebugValue:rv,useDeferredValue:rv,useTransition:rv,useSyncExternalStore:rv,useId:rv};lf.useCacheRefresh=rv,lf.useHostTransitionStatus=rv,lf.useFormState=rv,lf.useOptimistic=rv;var ld={readContext:at,use:rL,useCallback:function(e,t){return rP().memoizedState=[e,void 0===t?null:t],e},useContext:at,useEffect:rJ,useImperativeHandle:function(e,t,n){n=null!=n?n.concat([e]):null,rG(4194308,4,r3.bind(null,t,e),n)},useLayoutEffect:function(e,t){return rG(4194308,4,e,t)},useInsertionEffect:function(e,t){rG(4,2,e,t)},useMemo:function(e,t){var n=rP();return t=void 0===t?null:t,rp&&e(),e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=rP();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=la.bind(null,ru,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},rP().memoizedState=e},useState:function(e){var t=(e=rB(e)).queue,n=lo.bind(null,ru,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:r6,useDeferredValue:function(e){return rP().memoizedState=e,e},useTransition:function(){var e=rB(!1);return e=r9.bind(null,ru,e.queue,!0,!1),rP().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=ru,l=rP();if(tK){if(void 0===n)throw Error(i(407));n=n()}else{if(n=t(),null===op)throw Error(i(349));0!=(60&oh)||rD(r,t,n)}l.memoizedState=n;var a={value:n,getSnapshot:t};return l.queue=a,rJ(rI.bind(null,r,a,e),[e]),r.flags|=2048,rY(9,rA.bind(null,r,a,n,t),{destroy:void 0},null),n},useId:function(){var e=rP(),t=op.identifierPrefix;if(tK){var n=tB,r=t$;t=":"+t+"R"+(n=(r&~(1<<32-el(r)-1)).toString(32)+n),0<(n=rm++)&&(t+="H"+n.toString(32)),t+=":"}else t=":"+t+"r"+(n=ry++).toString(32)+":";return e.memoizedState=t},useCacheRefresh:function(){return rP().memoizedState=ll.bind(null,ru)}};ld.useHostTransitionStatus=lt,ld.useFormState=function(e,t){if(tK){var n=op.formState;if(null!==n){e:{if(tK){if(tq){t:{for(var r=tq,l=tX;8!==r.nodeType;)if(!l||null===(r=s4(r))){r=null;break t}r="F!"===(l=r.data)||"F"===l?r:null}if(r){tq=s4(r),r="F!"===r.data;break e}}t3()}r=!1}r&&(t=n[0])}}return(n=rP()).memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:rH,lastRenderedState:t},n.queue=r,n=lo.bind(null,ru,r),r.dispatch=n,r=rP(),l={state:t,dispatch:null,action:e,pending:null},r.queue=l,n=rj.bind(null,ru,l,n),l.dispatch=n,r.memoizedState=e,[t,n]},ld.useOptimistic=function(e){var t=rP();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=li.bind(null,ru,!0,n),n.dispatch=t,[e,t]};var lp={readContext:at,use:rL,useCallback:r8,useContext:at,useEffect:r0,useImperativeHandle:r4,useInsertionEffect:r1,useLayoutEffect:r2,useMemo:r5,useReducer:rF,useRef:rX,useState:function(){return rF(rT)},useDebugValue:r6,useDeferredValue:function(e){return r7(rN(),rs.memoizedState,e)},useTransition:function(){var e=rF(rT)[0],t=rN().memoizedState;return["boolean"==typeof e?e:r_(e),t]},useSyncExternalStore:rR,useId:ln};lp.useCacheRefresh=lr,lp.useHostTransitionStatus=lt,lp.useFormState=function(e){return rq(rN(),rs,e)},lp.useOptimistic=function(e,t){return rV(rN(),rs,e,t)};var lm={readContext:at,use:rL,useCallback:r8,useContext:at,useEffect:r0,useImperativeHandle:r4,useInsertionEffect:r1,useLayoutEffect:r2,useMemo:r5,useReducer:rO,useRef:rX,useState:function(){return rO(rT)},useDebugValue:r6,useDeferredValue:function(e){var t=rN();return null===rs?(t.memoizedState=e,e):r7(t,rs.memoizedState,e)},useTransition:function(){var e=rO(rT)[0],t=rN().memoizedState;return["boolean"==typeof e?e:r_(e),t]},useSyncExternalStore:rR,useId:ln};function lh(e,t){if(e&&e.defaultProps)for(var n in t=u({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}function lg(e,t,n,r){n=null==(n=n(r,t=e.memoizedState))?t:u({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}lm.useCacheRefresh=lr,lm.useHostTransitionStatus=lt,lm.useFormState=function(e){var t=rN(),n=rs;if(null!==n)return rq(t,n,e);t=t.memoizedState;var r=(n=rN()).queue.dispatch;return n.memoizedState=e,[t,r]},lm.useOptimistic=function(e,t){var n=rN();return null!==rs?rV(n,rs,e,t):(n.baseState=e,[e,n.queue.dispatch])};var ly={isMounted:function(e){return!!(e=e._reactInternals)&&ty(e)===e},enqueueSetState:function(e,t,n){var r=oB(e=e._reactInternals),l=nf(r);l.payload=t,null!=n&&(l.callback=n),null!==(t=nd(e,l,r))&&(oV(t,e,r),np(t,e,r))},enqueueReplaceState:function(e,t,n){var r=oB(e=e._reactInternals),l=nf(r);l.tag=1,l.payload=t,null!=n&&(l.callback=n),null!==(t=nd(e,l,r))&&(oV(t,e,r),np(t,e,r))},enqueueForceUpdate:function(e,t){var n=oB(e=e._reactInternals),r=nf(n);r.tag=2,null!=t&&(r.callback=t),null!==(t=nd(e,r,n))&&(oV(t,e,n),np(t,e,n))}};function lv(e,t,n,r,l,a,o){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,a,o):!t.prototype||!t.prototype.isPureReactComponent||!nv(n,r)||!nv(l,a)}function lb(e,t,n){var r=!1,l=tw,a=t.contextType;return"object"==typeof a&&null!==a?a=at(a):(l=tz(t)?tE:tS.current,a=(r=null!=(r=t.contextTypes))?tx(e,l):tw),t=new t(n,a),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=ly,e.stateNode=t,t._reactInternals=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=l,e.__reactInternalMemoizedMaskedChildContext=a),t}function lk(e,t,n,r){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&ly.enqueueReplaceState(t,t.state,null)}function lw(e,t,n,r){var l=e.stateNode;l.props=n,l.state=e.memoizedState,l.refs={},ns(e);var a=t.contextType;"object"==typeof a&&null!==a?l.context=at(a):(a=tz(t)?tE:tS.current,l.context=tx(e,a)),l.state=e.memoizedState,"function"==typeof(a=t.getDerivedStateFromProps)&&(lg(e,t,a,n),l.state=e.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof l.getSnapshotBeforeUpdate||"function"!=typeof l.UNSAFE_componentWillMount&&"function"!=typeof l.componentWillMount||(t=l.state,"function"==typeof l.componentWillMount&&l.componentWillMount(),"function"==typeof l.UNSAFE_componentWillMount&&l.UNSAFE_componentWillMount(),t!==l.state&&ly.enqueueReplaceState(l,l.state,null),nh(e,n,l,r),l.state=e.memoizedState),"function"==typeof l.componentDidMount&&(e.flags|=4194308)}function lS(e,t){try{var n="",r=t;do n+=function(e){switch(e.tag){case 26:case 27:case 5:return eq(e.type);case 16:return eq("Lazy");case 13:return eq("Suspense");case 19:return eq("SuspenseList");case 0:case 2:case 15:return e=eY(e.type,!1);case 11:return e=eY(e.type.render,!1);case 1:return e=eY(e.type,!0);default:return""}}(r),r=r.return;while(r);var l=n}catch(e){l="\nError generating stack: "+e.message+"\n"+e.stack}return{value:e,source:t,stack:l,digest:null}}function lC(e,t,n){return{value:e,source:null,stack:null!=n?n:null,digest:null!=t?t:null}}function lE(e,t){try{console.error(t.value)}catch(e){setTimeout(function(){throw e})}}function lx(e,t,n){(n=nf(n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){oT||(oT=!0,oF=r),lE(e,t)},n}function lz(e,t,n){(n=nf(n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"==typeof r){var l=t.value;n.payload=function(){return r(l)},n.callback=function(){lE(e,t)}}var a=e.stateNode;return null!==a&&"function"==typeof a.componentDidCatch&&(n.callback=function(){lE(e,t),"function"!=typeof r&&(null===oM?oM=new Set([this]):oM.add(this));var n=t.stack;this.componentDidCatch(t.value,{componentStack:null!==n?n:""})}),n}function lP(e,t,n,r,l){return 0==(1&e.mode)?e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,1===n.tag&&(null===n.alternate?n.tag=17:((t=nf(2)).tag=2,nd(n,t,2))),n.lanes|=2):(e.flags|=65536,e.lanes=l),e}var lN=s.ReactCurrentOwner,l_=Error(i(461)),lL=!1;function lT(e,t,n,r){t.child=null===e?nR(t,null,n,r):nO(t,e.child,n,r)}function lF(e,t,n,r,l){n=n.render;var a=t.ref;return(ae(t,l),r=rk(e,t,n,r,a,l),n=rE(),null===e||lL)?(tK&&n&&tQ(t),t.flags|=1,lT(e,t,r,l),t.child):(rx(e,t,l),l0(e,t,l))}function lM(e,t,n,r,l){if(null===e){var a=n.type;return"function"!=typeof a||id(a)||void 0!==a.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=ih(n.type,null,r,null,t,t.mode,l)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=a,lO(e,t,a,r,l))}if(a=e.child,0==(e.lanes&l)){var o=a.memoizedProps;if((n=null!==(n=n.compare)?n:nv)(o,r)&&e.ref===t.ref)return l0(e,t,l)}return t.flags|=1,(e=ip(a,r)).ref=t.ref,e.return=t,t.child=e}function lO(e,t,n,r,l){if(null!==e){var a=e.memoizedProps;if(nv(a,r)&&e.ref===t.ref){if(lL=!1,t.pendingProps=r=a,0==(e.lanes&l))return t.lanes=e.lanes,l0(e,t,l);0!=(131072&e.flags)&&(lL=!0)}}return lI(e,t,n,r,l)}function lR(e,t,n){var r=t.pendingProps,l=r.children,a=0!=(2&t.stateNode._pendingVisibility),o=null!==e?e.memoizedState:null;if(lA(e,t),"hidden"===r.mode||a){if(0!=(128&t.flags)){if(n=null!==o?o.baseLanes|n:n,null!==e){for(l=0,r=t.child=e.child;null!==r;)l=l|r.lanes|r.childLanes,r=r.sibling;t.childLanes=l&~n}else t.childLanes=0,t.child=null;return lD(e,t,n)}if(0==(1&t.mode))t.memoizedState={baseLanes:0,cachePool:null},null!==e&&ap(t,null),nU(),nQ(t);else{if(0==(536870912&n))return t.lanes=t.childLanes=536870912,lD(e,t,null!==o?o.baseLanes|n:n);t.memoizedState={baseLanes:0,cachePool:null},null!==e&&ap(t,null!==o?o.cachePool:null),null!==o?nI(t,o):nU(),nQ(t)}}else null!==o?(ap(t,o.cachePool),nI(t,o),nW(t),t.memoizedState=null):(null!==e&&ap(t,null),nU(),nW(t));return lT(e,t,l,n),t.child}function lD(e,t,n){var r=ad();return r=null===r?null:{parent:ai._currentValue,pool:r},t.memoizedState={baseLanes:n,cachePool:r},null!==e&&ap(t,null),nU(),nQ(t),null}function lA(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function lI(e,t,n,r,l){var a=tz(n)?tE:tS.current;return(a=tx(t,a),ae(t,l),n=rk(e,t,n,r,a,l),r=rE(),null===e||lL)?(tK&&r&&tQ(t),t.flags|=1,lT(e,t,n,l),t.child):(rx(e,t,l),l0(e,t,l))}function lU(e,t,n,r,l,a){return(ae(t,a),n=rS(t,r,n,l),rw(),r=rE(),null===e||lL)?(tK&&r&&tQ(t),t.flags|=1,lT(e,t,n,a),t.child):(rx(e,t,a),l0(e,t,a))}function l$(e,t,n,r,l){if(tz(n)){var a=!0;tL(t)}else a=!1;if(ae(t,l),null===t.stateNode)lJ(e,t),lb(t,n,r),lw(t,n,r,l),r=!0;else if(null===e){var o=t.stateNode,i=t.memoizedProps;o.props=i;var u=o.context,s=n.contextType;s="object"==typeof s&&null!==s?at(s):tx(t,s=tz(n)?tE:tS.current);var c=n.getDerivedStateFromProps,f="function"==typeof c||"function"==typeof o.getSnapshotBeforeUpdate;f||"function"!=typeof o.UNSAFE_componentWillReceiveProps&&"function"!=typeof o.componentWillReceiveProps||(i!==r||u!==s)&&lk(t,o,r,s),nu=!1;var d=t.memoizedState;o.state=d,nh(t,r,o,l),u=t.memoizedState,i!==r||d!==u||tC.current||nu?("function"==typeof c&&(lg(t,n,c,r),u=t.memoizedState),(i=nu||lv(t,n,i,r,d,u,s))?(f||"function"!=typeof o.UNSAFE_componentWillMount&&"function"!=typeof o.componentWillMount||("function"==typeof o.componentWillMount&&o.componentWillMount(),"function"==typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount()),"function"==typeof o.componentDidMount&&(t.flags|=4194308)):("function"==typeof o.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=u),o.props=r,o.state=u,o.context=s,r=i):("function"==typeof o.componentDidMount&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,nc(e,t),i=t.memoizedProps,s=t.type===t.elementType?i:lh(t.type,i),o.props=s,f=t.pendingProps,d=o.context,u="object"==typeof(u=n.contextType)&&null!==u?at(u):tx(t,u=tz(n)?tE:tS.current);var p=n.getDerivedStateFromProps;(c="function"==typeof p||"function"==typeof o.getSnapshotBeforeUpdate)||"function"!=typeof o.UNSAFE_componentWillReceiveProps&&"function"!=typeof o.componentWillReceiveProps||(i!==f||d!==u)&&lk(t,o,r,u),nu=!1,d=t.memoizedState,o.state=d,nh(t,r,o,l);var m=t.memoizedState;i!==f||d!==m||tC.current||nu?("function"==typeof p&&(lg(t,n,p,r),m=t.memoizedState),(s=nu||lv(t,n,s,r,d,m,u)||!1)?(c||"function"!=typeof o.UNSAFE_componentWillUpdate&&"function"!=typeof o.componentWillUpdate||("function"==typeof o.componentWillUpdate&&o.componentWillUpdate(r,m,u),"function"==typeof o.UNSAFE_componentWillUpdate&&o.UNSAFE_componentWillUpdate(r,m,u)),"function"==typeof o.componentDidUpdate&&(t.flags|=4),"function"==typeof o.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!=typeof o.componentDidUpdate||i===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),"function"!=typeof o.getSnapshotBeforeUpdate||i===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),o.props=r,o.state=m,o.context=u,r=s):("function"!=typeof o.componentDidUpdate||i===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),"function"!=typeof o.getSnapshotBeforeUpdate||i===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),r=!1)}return lB(e,t,n,r,a,l)}function lB(e,t,n,r,l,a){lA(e,t);var o=0!=(128&t.flags);if(!r&&!o)return l&&tT(t,n,!1),l0(e,t,a);r=t.stateNode,lN.current=t;var i=o&&"function"!=typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&o?(t.child=nO(t,e.child,null,a),t.child=nO(t,null,i,a)):lT(e,t,i,a),t.memoizedState=r.state,l&&tT(t,n,!0),t.child}function lV(e){var t=e.stateNode;t.pendingContext?tN(e,t.pendingContext,t.pendingContext!==t.context):t.context&&tN(e,t.context,!1),B(e,t.containerInfo)}function lj(e,t,n,r,l){return t5(),t7(l),t.flags|=256,lT(e,t,n,r),t.child}var lQ={dehydrated:null,treeContext:null,retryLane:0};function lW(e){return{baseLanes:e,cachePool:am()}}function lH(e,t,n){return e=null!==e?e.childLanes&~n:0,t&&(e|=ox),e}function lq(e,t,n){var r,l=t.pendingProps,a=!1,o=0!=(128&t.flags);if((r=o)||(r=(null===e||null!==e.memoizedState)&&0!=(2&nq.current)),r&&(a=!0,t.flags&=-129),r=0!=(32&t.flags),t.flags&=-33,null===e){if(tK){if(a?nj(t):nW(t),tK){var u=o=tq;if(u){if(!t1(t,u)){t2(t)&&t3(),tq=s4(u);var s=tH;tq&&t1(t,tq)?tG(s,u):(tZ(tH,t),tK=!1,tH=t,tq=o)}}else t2(t)&&t3(),tZ(tH,t),tK=!1,tH=t,tq=o}if(null!==(o=t.memoizedState)&&null!==(o=o.dehydrated))return 0==(1&t.mode)?t.lanes=2:"$!"===o.data?t.lanes=16:t.lanes=536870912,null;nH(t)}return(o=l.children,l=l.fallback,a)?(nW(t),a=t.mode,u=t.child,o={mode:"hidden",children:o},0==(1&a)&&null!==u?(u.childLanes=0,u.pendingProps=o):u=iy(o,a,0,null),l=ig(l,a,n,null),u.return=t,l.return=t,u.sibling=l,t.child=u,(a=t.child).memoizedState=lW(n),a.childLanes=lH(e,r,n),t.memoizedState=lQ,l):(nj(t),lK(t,o))}if(null!==(u=e.memoizedState)&&null!==(s=u.dehydrated))return function(e,t,n,r,l,a,o,u){if(n)return 256&t.flags?(nj(t),t.flags&=-257,lY(e,t,u,a=lC(Error(i(422))))):null!==t.memoizedState?(nW(t),t.child=e.child,t.flags|=128,null):(nW(t),a=l.fallback,o=t.mode,l=iy({mode:"visible",children:l.children},o,0,null),a=ig(a,o,u,null),a.flags|=2,l.return=t,a.return=t,l.sibling=a,t.child=l,0!=(1&t.mode)&&nO(t,e.child,null,u),(o=t.child).memoizedState=lW(u),o.childLanes=lH(e,r,u),t.memoizedState=lQ,a);if(nj(t),0==(1&t.mode))return lY(e,t,u,null);if("$!"===a.data){if(a=a.nextSibling&&a.nextSibling.dataset)var s=a.dgst;return a=s,(r=Error(i(419))).digest=a,lY(e,t,u,a=lC(r,a,void 0))}if(r=0!=(u&e.childLanes),lL||r){if(null!==(r=op)){if(0!=(42&(l=u&-u)))l=1;else switch(l){case 2:l=1;break;case 8:l=4;break;case 32:l=16;break;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:l=64;break;case 268435456:l=134217728;break;default:l=0}if(0!==(l=0!=(l&(r.suspendedLanes|u))?0:l)&&l!==o.retryLane)throw o.retryLane=l,na(e,l),oV(r,e,l),l_}return"$?"!==a.data&&o2(),lY(e,t,u,null)}return"$?"===a.data?(t.flags|=128,t.child=e.child,t=ii.bind(null,e),a._reactRetry=t,null):(e=o.treeContext,tq=s3(a.nextSibling),tH=t,tK=!0,tY=null,tX=!1,null!==e&&(tA[tI++]=t$,tA[tI++]=tB,tA[tI++]=tU,t$=e.id,tB=e.overflow,tU=t),t=lK(t,l.children),t.flags|=4096,t)}(e,t,o,r,l,s,u,n);if(a){nW(t),a=l.fallback,o=t.mode,s=(u=e.child).sibling;var c={mode:"hidden",children:l.children};return 0==(1&o)&&t.child!==u?((l=t.child).childLanes=0,l.pendingProps=c,t.deletions=null):(l=ip(u,c)).subtreeFlags=31457280&u.subtreeFlags,null!==s?a=ip(s,a):(a=ig(a,o,n,null),a.flags|=2),a.return=t,l.return=t,l.sibling=a,t.child=l,l=a,a=t.child,null===(o=e.child.memoizedState)?o=lW(n):(null!==(u=o.cachePool)?(s=ai._currentValue,u=u.parent!==s?{parent:s,pool:s}:u):u=am(),o={baseLanes:o.baseLanes|n,cachePool:u}),a.memoizedState=o,a.childLanes=lH(e,r,n),t.memoizedState=lQ,l}return nj(t),e=(r=e.child).sibling,r=ip(r,{mode:"visible",children:l.children}),0==(1&t.mode)&&(r.lanes=n),r.return=t,r.sibling=null,null!==e&&(null===(n=t.deletions)?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function lK(e,t){return(t=iy({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function lY(e,t,n,r){return null!==r&&t7(r),nO(t,e.child,null,n),e=lK(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function lX(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),l7(e.return,t,n)}function lG(e,t,n,r,l){var a=e.memoizedState;null===a?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:l}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=l)}function lZ(e,t,n){var r=t.pendingProps,l=r.revealOrder,a=r.tail;if(lT(e,t,r.children,n),0!=(2&(r=nq.current)))r=1&r|2,t.flags|=128;else{if(null!==e&&0!=(128&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&lX(e,n,t);else if(19===e.tag)lX(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(g(nq,r),0==(1&t.mode))t.memoizedState=null;else switch(l){case"forwards":for(l=null,n=t.child;null!==n;)null!==(e=n.alternate)&&null===nK(e)&&(l=n),n=n.sibling;null===(n=l)?(l=t.child,t.child=null):(l=n.sibling,n.sibling=null),lG(t,!1,l,n,a);break;case"backwards":for(n=null,l=t.child,t.child=null;null!==l;){if(null!==(e=l.alternate)&&null===nK(e)){t.child=l;break}e=l.sibling,l.sibling=n,n=l,l=e}lG(t,!0,n,null,a);break;case"together":lG(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function lJ(e,t){0==(1&t.mode)&&null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function l0(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),oS|=t.lanes,0==(n&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(i(153));if(null!==t.child){for(n=ip(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=ip(e,e.pendingProps)).return=t;n.sibling=null}return t.child}var l1=m(null),l2=null,l3=null,l4=null;function l6(){l4=l3=l2=null}function l8(e,t,n){g(l1,t._currentValue),t._currentValue=n}function l5(e){e._currentValue=l1.current,h(l1)}function l7(e,t,n){for(;null!==e;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==r&&(r.childLanes|=t)):null!==r&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function l9(e,t,n){var r=e.child;for(null!==r&&(r.return=e);null!==r;){var l=r.dependencies;if(null!==l)for(var a=r.child,o=l.firstContext;null!==o;){if(o.context===t){if(1===r.tag){(o=nf(n&-n)).tag=2;var u=r.updateQueue;if(null!==u){var s=(u=u.shared).pending;null===s?o.next=o:(o.next=s.next,s.next=o),u.pending=o}}r.lanes|=n,null!==(o=r.alternate)&&(o.lanes|=n),l7(r.return,n,e),l.lanes|=n;break}o=o.next}else if(10===r.tag)a=r.type===e.type?null:r.child;else if(18===r.tag){if(null===(a=r.return))throw Error(i(341));a.lanes|=n,null!==(l=a.alternate)&&(l.lanes|=n),l7(a,n,e),a=r.sibling}else a=r.child;if(null!==a)a.return=r;else for(a=r;null!==a;){if(a===e){a=null;break}if(null!==(r=a.sibling)){r.return=a.return,a=r;break}a=a.return}r=a}}function ae(e,t){l2=e,l4=l3=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!=(e.lanes&t)&&(lL=!0),e.firstContext=null)}function at(e){return ar(l2,e)}function an(e,t,n){return null===l2&&ae(e,n),ar(e,t)}function ar(e,t){var n=t._currentValue;if(l4!==t){if(t={context:t,memoizedValue:n,next:null},null===l3){if(null===e)throw Error(i(308));l3=t,e.dependencies={lanes:0,firstContext:t}}else l3=l3.next=t}return n}var al="undefined"!=typeof AbortController?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},aa=a.unstable_scheduleCallback,ao=a.unstable_NormalPriority,ai={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0,_defaultValue:null,_globalName:null};function au(){return{controller:new al,data:new Map,refCount:0}}function as(e){e.refCount--,0===e.refCount&&aa(ao,function(){e.controller.abort()})}var ac=s.ReactCurrentBatchConfig,af=m(null);function ad(){var e=af.current;return null!==e?e:op.pooledCache}function ap(e,t){null===t?g(af,af.current):g(af,t.pool)}function am(){var e=ad();return null===e?null:{parent:ai._currentValue,pool:e}}function ah(e){e.flags|=4}function ag(e){e.flags|=2097664}function ay(e,t){if("stylesheet"!==t.type||0!=(4&t.state.loading))e.flags&=-16777217;else if(e.flags|=16777216,0==(42&oh)&&!(t="stylesheet"!==t.type||0!=(3&t.state.loading))){if(oJ())e.flags|=8192;else throw nx=nw,nk}}function av(e,t){null!==t?e.flags|=4:16384&e.flags&&(t=22!==e.tag?ed():536870912,e.lanes|=t)}function ab(e,t){if(!tK)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function ak(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var l=e.child;null!==l;)n|=l.lanes|l.childLanes,r|=31457280&l.subtreeFlags,r|=31457280&l.flags,l.return=e,l=l.sibling;else for(l=e.child;null!==l;)n|=l.lanes|l.childLanes,r|=l.subtreeFlags,r|=l.flags,l.return=e,l=l.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function aw(e,t){switch(tW(t),t.tag){case 1:null!=(e=t.type.childContextTypes)&&tP();break;case 3:l5(ai),V(),h(tC),h(tS);break;case 26:case 27:case 5:Q(t);break;case 4:V();break;case 13:nH(t);break;case 19:h(nq);break;case 10:l5(t.type._context);break;case 22:case 23:nH(t),n$(),null!==e&&h(af);break;case 24:l5(ai)}}function aS(e,t,n){var r=Array.prototype.slice.call(arguments,3);try{t.apply(n,r)}catch(e){this.onError(e)}}var aC=!1,aE=null,ax=!1,az=null,aP={onError:function(e){aC=!0,aE=e}};function aN(e,t,n,r,l,a,o,i,u){aC=!1,aE=null,aS.apply(aP,arguments)}var a_=!1,aL=!1,aT="function"==typeof WeakSet?WeakSet:Set,aF=null;function aM(e,t){try{var n=e.ref;if(null!==n){var r=e.stateNode;switch(e.tag){case 26:case 27:case 5:var l=r;break;default:l=r}"function"==typeof n?e.refCleanup=n(l):n.current=l}}catch(n){ir(e,t,n)}}function aO(e,t){var n=e.ref,r=e.refCleanup;if(null!==n){if("function"==typeof r)try{r()}catch(n){ir(e,t,n)}finally{e.refCleanup=null,null!=(e=e.alternate)&&(e.refCleanup=null)}else if("function"==typeof n)try{n(null)}catch(n){ir(e,t,n)}else n.current=null}}function aR(e,t,n){try{n()}catch(n){ir(e,t,n)}}var aD=!1;function aA(e,t,n){var r=t.updateQueue;if(null!==(r=null!==r?r.lastEffect:null)){var l=r=r.next;do{if((l.tag&e)===e){var a=l.inst,o=a.destroy;void 0!==o&&(a.destroy=void 0,aR(t,n,o))}l=l.next}while(l!==r)}}function aI(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create,l=n.inst;r=r(),l.destroy=r}n=n.next}while(n!==t)}}function aU(e,t){try{aI(t,e)}catch(t){ir(e,e.return,t)}}function a$(e){var t=e.updateQueue;if(null!==t){var n=e.stateNode;try{ny(t,n)}catch(t){ir(e,e.return,t)}}}function aB(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&r.focus();break;case"img":n.src&&(r.src=n.src)}}catch(t){ir(e,e.return,t)}}function aV(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:a2(e,n),4&r&&aU(n,5);break;case 1:if(a2(e,n),4&r){if(e=n.stateNode,null===t)try{e.componentDidMount()}catch(e){ir(n,n.return,e)}else{var l=n.elementType===n.type?t.memoizedProps:lh(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(l,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){ir(n,n.return,e)}}}64&r&&a$(n),512&r&&aM(n,n.return);break;case 3:if(a2(e,n),64&r&&null!==(r=n.updateQueue)){if(e=null,null!==n.child)switch(n.child.tag){case 27:case 5:case 1:e=n.child.stateNode}try{ny(r,e)}catch(e){ir(n,n.return,e)}}break;case 26:a2(e,n),512&r&&aM(n,n.return);break;case 27:case 5:a2(e,n),null===t&&4&r&&aB(n),512&r&&aM(n,n.return);break;case 12:default:a2(e,n);break;case 13:a2(e,n),4&r&&aX(e,n);break;case 22:if(0!=(1&n.mode)){if(!(l=null!==n.memoizedState||a_)){t=null!==t&&null!==t.memoizedState||aL;var a=a_,o=aL;a_=l,(aL=t)&&!o?function e(t,n,r){for(r=r&&0!=(8772&n.subtreeFlags),n=n.child;null!==n;){var l=n.alternate,a=t,o=n,i=o.flags;switch(o.tag){case 0:case 11:case 15:e(a,o,r),aU(o,4);break;case 1:if(e(a,o,r),"function"==typeof(a=o.stateNode).componentDidMount)try{a.componentDidMount()}catch(e){ir(o,o.return,e)}if(null!==(l=o.updateQueue)){var u=l.shared.hiddenCallbacks;if(null!==u)for(l.shared.hiddenCallbacks=null,l=0;l title"))),s$(l,n,r),l[ew]=e,eR(l),n=l;break e;case"link":var a=cp("link","href",t).get(n+(r.href||""));if(a){for(var o=0;o",e=e.removeChild(e.firstChild);break;case"select":e="string"==typeof r.is?l.createElement("select",{is:r.is}):l.createElement("select"),r.multiple?e.multiple=!0:r.size&&(e.size=r.size);break;default:e="string"==typeof r.is?l.createElement(n,{is:r.is}):l.createElement(n)}}e[ew]=t,e[eS]=r;e:for(l=t.child;null!==l;){if(5===l.tag||6===l.tag)e.appendChild(l.stateNode);else if(4!==l.tag&&27!==l.tag&&null!==l.child){l.child.return=l,l=l.child;continue}if(l===t)break;for(;null===l.sibling;){if(null===l.return||l.return===t)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}switch(t.stateNode=e,s$(e,n,r),n){case"button":case"input":case"select":case"textarea":e=!!r.autoFocus;break;case"img":e=!0;break;default:e=!1}e&&ah(t)}null!==t.ref&&ag(t)}return ak(t),t.flags&=-16777217,null;case 6:if(e&&null!=t.stateNode)e.memoizedProps!==r&&ah(t);else{if("string"!=typeof r&&null===t.stateNode)throw Error(i(166));if(e=I.current,t6(t)){e:{if(e=t.stateNode,n=t.memoizedProps,e[ew]=t,(r=e.nodeValue!==n)&&null!==(l=tH))switch(l.tag){case 3:if(l=0!=(1&l.mode),sD(e.nodeValue,n,l),l){e=!1;break e}break;case 27:case 5:var a=0!=(1&l.mode);if(!0!==l.memoizedProps.suppressHydrationWarning&&sD(e.nodeValue,n,a),a){e=!1;break e}}e=r}e&&ah(t)}else(e=sQ(e).createTextNode(r))[ew]=t,t.stateNode=e}return ak(t),null;case 13:if(nH(t),r=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(tK&&null!==tq&&0!=(1&t.mode)&&0==(128&t.flags))t8(),t5(),t.flags|=384,l=!1;else if(l=t6(t),null!==r&&null!==r.dehydrated){if(null===e){if(!l)throw Error(i(318));if(!(l=null!==(l=t.memoizedState)?l.dehydrated:null))throw Error(i(317));l[ew]=t}else t5(),0==(128&t.flags)&&(t.memoizedState=null),t.flags|=4;ak(t),l=!1}else null!==tY&&(oW(tY),tY=null),l=!0;if(!l)return 256&t.flags?t:null}if(0!=(128&t.flags))return t.lanes=n,t;return n=null!==r,e=null!==e&&null!==e.memoizedState,n&&(r=t.child,l=null,null!==r.alternate&&null!==r.alternate.memoizedState&&null!==r.alternate.memoizedState.cachePool&&(l=r.alternate.memoizedState.cachePool.pool),a=null,null!==r.memoizedState&&null!==r.memoizedState.cachePool&&(a=r.memoizedState.cachePool.pool),a!==l&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),av(t,t.updateQueue),ak(t),null;case 4:return V(),null===e&&sz(t.stateNode.containerInfo),ak(t),null;case 10:return l5(t.type._context),ak(t),null;case 19:if(h(nq),null===(l=t.memoizedState))return ak(t),null;if(r=0!=(128&t.flags),null===(a=l.rendering)){if(r)ab(l,!1);else{if(0!==ok||null!==e&&0!=(128&e.flags))for(e=t.child;null!==e;){if(null!==(a=nK(e))){for(t.flags|=128,ab(l,!1),e=a.updateQueue,t.updateQueue=e,av(t,e),t.subtreeFlags=0,e=n,n=t.child;null!==n;)im(n,e),n=n.sibling;return g(nq,1&nq.current|2),t.child}e=e.sibling}null!==l.tail&&Y()>o_&&(t.flags|=128,r=!0,ab(l,!1),t.lanes=4194304)}}else{if(!r){if(null!==(e=nK(a))){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,av(t,e),ab(l,!0),null===l.tail&&"hidden"===l.tailMode&&!a.alternate&&!tK)return ak(t),null}else 2*Y()-l.renderingStartTime>o_&&536870912!==n&&(t.flags|=128,r=!0,ab(l,!1),t.lanes=4194304)}l.isBackwards?(a.sibling=t.child,t.child=a):(null!==(e=l.last)?e.sibling=a:t.child=a,l.last=a)}if(null!==l.tail)return t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=Y(),t.sibling=null,e=nq.current,g(nq,r?1&e|2:1&e),t;return ak(t),null;case 22:case 23:return nH(t),n$(),r=null!==t.memoizedState,null!==e?null!==e.memoizedState!==r&&(t.flags|=8192):r&&(t.flags|=8192),r&&0!=(1&t.mode)?0!=(536870912&n)&&0==(128&t.flags)&&(ak(t),6&t.subtreeFlags&&(t.flags|=8192)):ak(t),null!==(n=t.updateQueue)&&av(t,n.retryQueue),n=null,null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(n=e.memoizedState.cachePool.pool),r=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),null!==e&&h(af),null;case 24:return n=null,null!==e&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),l5(ai),ak(t),null;case 25:return null}throw Error(i(156,t.tag))}(t.alternate,t,ob);if(null!==n){om=n;return}if(null!==(t=t.sibling)){om=t;return}om=t=e}while(null!==t);0===ok&&(ok=5)}function o7(e,t,n,r){var l=ey,a=of.transition;try{of.transition=null,ey=2,function(e,t,n,r,l){do ie();while(null!==oR);if(0!=(6&od))throw Error(i(327));var a=e.finishedWork,o=e.finishedLanes;if(null!==a){if(e.finishedWork=null,e.finishedLanes=0,a===e.current)throw Error(i(177));e.callbackNode=null,e.callbackPriority=0,e.cancelPendingCommit=null;var u=a.lanes|a.childLanes;if(function(e,t,n){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.entangledLanes&=t,e.errorRecoveryDisabledLanes&=t,e.shellSuspendCounter=0,t=e.entanglements;for(var l=e.expirationTimes,a=e.hiddenUpdates;0r&&(l=r,r=a,a=l),l=u8(n,a);var o=u8(n,r);l&&o&&(1!==e.rangeCount||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&((t=t.createRange()).setStart(l.node,l.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"==typeof n.focus&&n.focus(),n=0;nn?32:n;n=of.transition;var l=ey;try{if(of.transition=null,ey=r,null===oR)var a=!1;else{r=oI,oI=null;var o=oR,u=oD;if(oR=null,oD=0,0!=(6&od))throw Error(i(331));var s=od;if(od|=4,ol(o.current),a5(o,o.current,u,r),od=s,n2(!1),er&&"function"==typeof er.onPostCommitFiberRoot)try{er.onPostCommitFiberRoot(en,o)}catch(e){}a=!0}return a}finally{ey=l,of.transition=n,o9(e,t)}}return!1}function it(e,t,n){t=lx(e,t=lS(n,t),2),null!==(e=nd(e,t,2))&&(em(e,2),n1(e))}function ir(e,t,n){if(3===e.tag)it(e,e,n);else for(;null!==t;){if(3===t.tag){it(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===oM||!oM.has(r))){e=lz(t,e=lS(n,e),2),null!==(t=nd(t,e,2))&&(em(t,2),n1(t));break}}t=t.return}}function il(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new oi;var l=new Set;r.set(t,l)}else void 0===(l=r.get(t))&&(l=new Set,r.set(t,l));l.has(n)||(ov=!0,l.add(n),e=ia.bind(null,e,t,n),t.then(e,e))}function ia(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,op===e&&(oh&n)===n&&(4===ok||3===ok&&(62914560&oh)===oh&&300>Y()-oN?0==(2&od)&&oG(e,0):oE|=n),n1(e)}function io(e,t){0===t&&(t=0==(1&e.mode)?2:ed()),null!==(e=na(e,t))&&(em(e,t),n1(e))}function ii(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),io(e,n)}function iu(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;null!==l&&(n=l.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}null!==r&&r.delete(t),io(e,n)}function is(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ic(e,t,n,r){return new is(e,t,n,r)}function id(e){return!(!(e=e.prototype)||!e.isReactComponent)}function ip(e,t){var n=e.alternate;return null===n?((n=ic(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=31457280&e.flags,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function im(e,t){e.flags&=31457282;var n=e.alternate;return null===n?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ih(e,t,n,r,l,a,o){if(l=2,r=e,"function"==typeof e)id(e)&&(l=1);else if("string"==typeof e)l=!function(e,t,n){if(1===n||null!=t.itemProp)return!1;switch(e){case"meta":case"title":return!0;case"style":if("string"!=typeof t.precedence||"string"!=typeof t.href||""===t.href)break;return!0;case"link":if("string"!=typeof t.rel||"string"!=typeof t.href||""===t.href||t.onLoad||t.onError)break;if("stylesheet"===t.rel)return e=t.disabled,"string"==typeof t.precedence&&null==e;return!0;case"script":if(!0===t.async&&!t.onLoad&&!t.onError&&"string"==typeof t.src&&t.src)return!0}return!1}(e,n,D.current)?"html"===e||"head"===e||"body"===e?27:5:26;else e:switch(e){case b:return ig(n.children,a,o,t);case k:l=8,0!=(1&(a|=8))&&(a|=16);break;case w:return(e=ic(12,n,t,2|a)).elementType=w,e.lanes=o,e;case z:return(e=ic(13,n,t,a)).elementType=z,e.lanes=o,e;case P:return(e=ic(19,n,t,a)).elementType=P,e.lanes=o,e;case T:return iy(n,a,o,t);case F:case L:case M:return(e=ic(24,n,t,a)).elementType=M,e.lanes=o,e;default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case S:l=10;break e;case C:l=9;break e;case x:l=11;break e;case N:l=14;break e;case _:l=16,r=null;break e}throw Error(i(130,null==e?e:typeof e,""))}return(t=ic(l,n,t,a)).elementType=e,t.type=r,t.lanes=o,t}function ig(e,t,n,r){return(e=ic(7,e,r,t)).lanes=n,e}function iy(e,t,n,r){(e=ic(22,e,r,t)).elementType=T,e.lanes=n;var l={_visibility:1,_pendingVisibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null,_current:null,detach:function(){var e=l._current;if(null===e)throw Error(i(456));if(0==(2&l._pendingVisibility)){var t=na(e,2);null!==t&&(l._pendingVisibility|=2,oV(t,e,2))}},attach:function(){var e=l._current;if(null===e)throw Error(i(456));if(0!=(2&l._pendingVisibility)){var t=na(e,2);null!==t&&(l._pendingVisibility&=-3,oV(t,e,2))}}};return e.stateNode=l,e}function iv(e,t,n){return(e=ic(6,e,null,t)).lanes=n,e}function ib(e,t,n){return(t=ic(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function ik(e,t,n,r,l,a){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ep(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.finishedLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ep(0),this.hiddenUpdates=ep(null),this.identifierPrefix=r,this.onRecoverableError=l,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=a,this.incompleteTransitions=new Map}function iw(e,t,n,r,l,a,o,i,u,s,c){return e=new ik(e,t,n,i,u,c),1===t?(t=1,!0===a&&(t|=24)):t=0,a=ic(3,null,null,t),e.current=a,a.stateNode=e,t=au(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},ns(a),e}function iS(e){if(!e)return tw;e=e._reactInternals;e:{if(ty(e)!==e||1!==e.tag)throw Error(i(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(tz(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(null!==t);throw Error(i(171))}if(1===e.tag){var n=e.type;if(tz(n))return t_(e,n,t)}return t}function iC(e,t,n,r,l,a,o,i,u,s,c){return(e=iw(n,r,!0,e,l,a,o,i,u,s,c)).context=iS(null),(l=nf(r=oB(n=e.current))).callback=null!=t?t:null,nd(n,l,r),e.current.lanes=r,em(e,r),n1(e),e}function iE(e,t,n,r){var l=t.current,a=oB(l);return n=iS(n),null===t.context?t.context=n:t.pendingContext=n,(t=nf(a)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),null!==(e=nd(l,t,a))&&(oV(e,l,a),np(e,l,a)),a}function ix(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function iz(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n=uR),uI=!1;function uU(e,t){switch(e){case"keyup":return -1!==uM.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function u$(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var uB=!1,uV={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 uj(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!uV[e.type]:"textarea"===t}function uQ(e,t,n,r){th(r),0<(t=sL(t,"onChange")).length&&(n=new iH("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var uW=null,uH=null;function uq(e){sS(e,0)}function uK(e){if(e0(eF(e)))return e}function uY(e,t){if("change"===e)return t}var uX=!1;if(e$){if(e$){var uG="oninput"in document;if(!uG){var uZ=document.createElement("div");uZ.setAttribute("oninput","return;"),uG="function"==typeof uZ.oninput}r=uG}else r=!1;uX=r&&(!document.documentMode||9=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=u6(r)}}function u5(){for(var e=window,t=e1();t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(e){n=!1}if(n)e=t.contentWindow;else break;t=e1(e.document)}return t}function u7(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var u9=e$&&"documentMode"in document&&11>=document.documentMode,se=null,st=null,sn=null,sr=!1;function sl(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;sr||null==se||se!==e1(r)||(r="selectionStart"in(r=se)&&u7(r)?{start:r.selectionStart,end:r.selectionEnd}:{anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},sn&&nv(sn,r)||(sn=r,0<(r=sL(st,"onSelect")).length&&(t=new iH("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=se)))}function sa(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var so={animationend:sa("Animation","AnimationEnd"),animationiteration:sa("Animation","AnimationIteration"),animationstart:sa("Animation","AnimationStart"),transitionend:sa("Transition","TransitionEnd")},si={},su={};function ss(e){if(si[e])return si[e];if(!so[e])return e;var t,n=so[e];for(t in n)if(n.hasOwnProperty(t)&&t in su)return si[e]=n[t];return e}e$&&(su=document.createElement("div").style,"AnimationEvent"in window||(delete so.animationend.animation,delete so.animationiteration.animation,delete so.animationstart.animation),"TransitionEvent"in window||delete so.transitionend.transition);var sc=ss("animationend"),sf=ss("animationiteration"),sd=ss("animationstart"),sp=ss("transitionend"),sm=new Map,sh="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 scrollEnd toggle touchMove waiting wheel".split(" ");function sg(e,t){sm.set(e,t),eI(t,[e])}for(var sy=0;sy title"):null)}var ch=null;function cg(){}function cy(){if(this.count--,0===this.count){if(this.stylesheets)cb(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var cv=null;function cb(e,t){e.stylesheets=null,null!==e.unsuspend&&(e.count++,cv=new Map,t.forEach(ck,e),cv=null,cy.call(e))}function ck(e,t){if(!(4&t.state.loading)){var n=cv.get(e);if(n)var r=n.get("last");else{n=new Map,cv.set(e,n);for(var l=e.querySelectorAll("link[data-precedence],style[data-precedence]"),a=0;a{t.current=e},[e]),t}},6575:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(959),o=n(8926);function i(e){let t=(0,o.Z)(e);return(0,r.useCallback)(function(...e){return t.current&&t.current(...e)},[t])}},6160:function(e,t,n){"use strict";var r=n(959);let o=void 0!==n.g&&n.g.navigator&&"ReactNative"===n.g.navigator.product,i="undefined"!=typeof document;t.Z=i||o?r.useLayoutEffect:r.useEffect},5466:function(e,t,n){"use strict";var r=n(959);let o=e=>e&&"function"!=typeof e?t=>{e.current=t}:e;t.Z=function(e,t){return(0,r.useMemo)(()=>(function(e,t){let n=o(e),r=o(t);return e=>{n&&n(e),r&&r(e)}})(e,t),[e,t])}},9189:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(959);function o(){let e=(0,r.useRef)(!0),t=(0,r.useRef)(()=>e.current);return(0,r.useEffect)(()=>(e.current=!0,()=>{e.current=!1}),[]),t.current}},2674:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(959);function o(e){let t=(0,r.useRef)(null);return(0,r.useEffect)(()=>{t.current=e}),t.current}},9548:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(959);function o(e){let t=function(e){let t=(0,r.useRef)(e);return t.current=e,t}(e);(0,r.useEffect)(()=>()=>t.current(),[])}},5872:function(e,t,n){"use strict";function r(e){return`data-rr-ui-${e}`}function o(e){return`rrUi${e}`}n.d(t,{$F:function(){return o},PB:function(){return r}})},3774:function(e,t,n){"use strict";n.d(t,{sD:function(){return c}});var r=n(5466),o=n(6575),i=n(6160),a=n(959),s=n(3233),u=n(1527);function l({children:e,in:t,onExited:n,onEntered:s,transition:u}){let[l,c]=(0,a.useState)(!t);t&&l&&c(!1);let f=function({in:e,onTransition:t}){let n=(0,a.useRef)(null),r=(0,a.useRef)(!0),s=(0,o.Z)(t);return(0,i.Z)(()=>{if(!n.current)return;let t=!1;return s({in:e,element:n.current,initial:r.current,isStale:()=>t}),()=>{t=!0}},[e,s]),(0,i.Z)(()=>(r.current=!1,()=>{r.current=!0}),[]),n}({in:!!t,onTransition:e=>{Promise.resolve(u(e)).then(()=>{e.isStale()||(e.in?null==s||s(e.element,e.initial):(c(!0),null==n||n(e.element)))},t=>{throw e.in||c(!0),t})}}),d=(0,r.Z)(f,e.ref);return l&&!t?null:(0,a.cloneElement)(e,{ref:d})}function c(e,t,n){return e?(0,u.jsx)(e,Object.assign({},n)):t?(0,u.jsx)(l,Object.assign({},n,{transition:t})):(0,u.jsx)(s.Z,Object.assign({},n))}},3233:function(e,t,n){"use strict";var r=n(6575),o=n(5466),i=n(959);t.Z=function({children:e,in:t,onExited:n,mountOnEnter:a,unmountOnExit:s}){let u=(0,i.useRef)(null),l=(0,i.useRef)(t),c=(0,r.Z)(n);(0,i.useEffect)(()=>{t?l.current=!0:c(u.current)},[t,c]);let f=(0,o.Z)(u,e.ref),d=(0,i.cloneElement)(e,{ref:f});return t?d:s||!l.current&&a?null:d}},3439:function(e,t,n){"use strict";n.d(t,{h:function(){return o}});let r=n(959).createContext(null),o=(e,t=null)=>null!=e?String(e):t||null;t.Z=r},8821:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(8342),o=n(2762),i=n(959),a=n(348);let s=(e,t)=>o.Z?null==e?(t||(0,r.Z)()).body:("function"==typeof e&&(e=e()),e&&"current"in e&&(e=e.current),e&&("nodeType"in e||e.getBoundingClientRect))?e:null:null;function u(e,t){let n=(0,a.Z)(),[r,o]=(0,i.useState)(()=>s(e,null==n?void 0:n.document));if(!r){let t=s(e);t&&o(t)}return(0,i.useEffect)(()=>{t&&r&&t(r)},[t,r]),(0,i.useEffect)(()=>{let t=s(e);t!==r&&o(t)},[e,r]),r}},348:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(959),o=n(2762);let i=(0,r.createContext)(o.Z?window:void 0);function a(){return(0,r.useContext)(i)}i.Provider},663:function(e,t,n){"use strict";function r(e){return"Escape"===e.code||27===e.keyCode}n.d(t,{k:function(){return r}})},2762:function(e,t){"use strict";t.Z=!!("undefined"!=typeof window&&window.document&&window.document.createElement)},6712:function(e,t,n){"use strict";function r(e,t){return e.contains?e.contains(t):e.compareDocumentPosition?e===t||!!(16&e.compareDocumentPosition(t)):void 0}n.d(t,{Z:function(){return r}})},968:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(8342),o=/([A-Z])/g,i=/^ms-/;function a(e){return e.replace(o,"-$1").toLowerCase().replace(i,"-ms-")}var s=/^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i,u=function(e,t){var n,o="",i="";if("string"==typeof t)return e.style.getPropertyValue(a(t))||((n=(0,r.Z)(e))&&n.defaultView||window).getComputedStyle(e,void 0).getPropertyValue(a(t));Object.keys(t).forEach(function(n){var r=t[n];r||0===r?n&&s.test(n)?i+=n+"("+r+") ":o+=a(n)+": "+r+";":e.style.removeProperty(a(n))}),i&&(o+="transform: "+i+";"),e.style.cssText+=";"+o}},9523:function(e,t,n){"use strict";function r(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}n.d(t,{Z:function(){return r}})},7937:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(2762),o=!1,i=!1;try{var a={get passive(){return o=!0},get once(){return i=o=!0}};r.Z&&(window.addEventListener("test",a,a),window.removeEventListener("test",a,!0))}catch(e){}var s=function(e,t,n,r){if(r&&"boolean"!=typeof r&&!i){var a=r.once,s=r.capture,u=n;!i&&a&&(u=n.__once||function e(r){this.removeEventListener(t,e,s),n.call(this,r)},n.__once=u),e.addEventListener(t,u,o?r:s)}e.addEventListener(t,n,r)},u=function(e,t,n,r){var o=r&&"boolean"!=typeof r?r.capture:r;e.removeEventListener(t,n,o),n.__once&&e.removeEventListener(t,n.__once,o)},l=function(e,t,n,r){return s(e,t,n,r),function(){u(e,t,n,r)}}},8342:function(e,t,n){"use strict";function r(e){return e&&e.ownerDocument||document}n.d(t,{Z:function(){return r}})},3465:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=Function.prototype.bind.call(Function.prototype.call,[].slice);function o(e,t){return r(e.querySelectorAll(t))}},3670:function(e){"use strict";e.exports=function(e,t,n,r,o,i,a,s){if(!e){var u;if(void 0===t)u=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,r,o,i,a,s],c=0;(u=Error(t.replace(/%s/g,function(){return l[c++]}))).name="Invariant Violation"}throw u.framesToPop=1,u}}},6520:function(e,t,n){e.exports=n(574)},4049:function(e,t,n){"use strict";var r=n(6257);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,a){if(a!==r){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},507:function(e,t,n){e.exports=n(4049)()},6257:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},5619:function(e,t,n){"use strict";var r=n(507),o=n.n(r),i=n(959),a=n(2187),s=n.n(a),u=n(1527);let l={"aria-label":o().string,onClick:o().func,variant:o().oneOf(["white"])},c=i.forwardRef(({className:e,variant:t,"aria-label":n="Close",...r},o)=>(0,u.jsx)("button",{ref:o,type:"button",className:s()("btn-close",t&&`btn-close-${t}`,e),"aria-label":n,...r}));c.displayName="CloseButton",c.propTypes=l,t.Z=c},4922:function(e,t,n){"use strict";n.d(t,{Z:function(){return v}});var r=n(2187),o=n.n(r),i=n(968),a=n(959),s=n(3418),u=n(6875),l=function(...e){return e.filter(e=>null!=e).reduce((e,t)=>{if("function"!=typeof t)throw Error("Invalid Argument Type, must only provide functions, undefined, or null.");return null===e?t:function(...n){e.apply(this,n),t.apply(this,n)}},null)},c=n(9860),f=n(6911),d=n(1527);let p={height:["marginTop","marginBottom"],width:["marginLeft","marginRight"]};function m(e,t){let n=t[`offset${e[0].toUpperCase()}${e.slice(1)}`],r=p[e];return n+parseInt((0,i.Z)(t,r[0]),10)+parseInt((0,i.Z)(t,r[1]),10)}let h={[s.Wj]:"collapse",[s.Ix]:"collapsing",[s.d0]:"collapsing",[s.cn]:"collapse show"};var v=a.forwardRef(({onEnter:e,onEntering:t,onEntered:n,onExit:r,onExiting:i,className:s,children:p,dimension:v="height",in:g=!1,timeout:y=300,mountOnEnter:E=!1,unmountOnExit:x=!1,appear:b=!1,getDimensionValue:C=m,...O},N)=>{let Z="function"==typeof v?v():v,j=(0,a.useMemo)(()=>l(e=>{e.style[Z]="0"},e),[Z,e]),k=(0,a.useMemo)(()=>l(e=>{let t=`scroll${Z[0].toUpperCase()}${Z.slice(1)}`;e.style[Z]=`${e[t]}px`},t),[Z,t]),w=(0,a.useMemo)(()=>l(e=>{e.style[Z]=null},n),[Z,n]),R=(0,a.useMemo)(()=>l(e=>{e.style[Z]=`${C(Z,e)}px`,(0,c.Z)(e)},r),[r,C,Z]),S=(0,a.useMemo)(()=>l(e=>{e.style[Z]=null},i),[Z,i]);return(0,d.jsx)(f.Z,{ref:N,addEndListener:u.Z,...O,"aria-expanded":O.role?g:null,onEnter:j,onEntering:k,onEntered:w,onExit:R,onExiting:S,childRef:p.ref,in:g,timeout:y,mountOnEnter:E,unmountOnExit:x,appear:b,children:(e,t)=>a.cloneElement(p,{...t,className:o()(s,p.props.className,h[e],"width"===Z&&"collapse-horizontal")})})})},8423:function(e,t,n){"use strict";var r=n(2187),o=n.n(r),i=n(959),a=n(1835),s=n(1527);let u=i.forwardRef(({bsPrefix:e,fluid:t=!1,as:n="div",className:r,...i},u)=>{let l=(0,a.vE)(e,"container"),c="string"==typeof t?`-${t}`:"-fluid";return(0,s.jsx)(n,{ref:u,...i,className:o()(r,t?`${l}${c}`:l)})});u.displayName="Container",t.Z=u},5216:function(e,t,n){"use strict";var r=n(2187),o=n.n(r),i=n(959),a=n(3418),s=n(6875),u=n(9860),l=n(6911),c=n(1527);let f={[a.d0]:"show",[a.cn]:"show"},d=i.forwardRef(({className:e,children:t,transitionClasses:n={},onEnter:r,...a},d)=>{let p={in:!1,timeout:300,mountOnEnter:!1,unmountOnExit:!1,appear:!1,...a},m=(0,i.useCallback)((e,t)=>{(0,u.Z)(e),null==r||r(e,t)},[r]);return(0,c.jsx)(l.Z,{ref:d,addEndListener:s.Z,...p,onEnter:m,childRef:t.ref,children:(r,a)=>i.cloneElement(t,{...a,className:o()("fade",e,t.props.className,f[r],n[r])})})});d.displayName="Fade",t.Z=d},8568:function(e,t,n){"use strict";let r,o;n.d(t,{Z:function(){return ep}});var i=n(2187),a=n.n(i),s=n(959),u=n(3439),l=n(7980),c=n(1835),f=n(1527);let d=s.forwardRef(({bsPrefix:e,className:t,as:n,...r},o)=>{e=(0,c.vE)(e,"navbar-brand");let i=n||(r.href?"a":"span");return(0,f.jsx)(i,{...r,ref:o,className:a()(t,e)})});d.displayName="NavbarBrand";var p=n(4922),m=n(8936);let h=s.forwardRef(({children:e,bsPrefix:t,...n},r)=>{t=(0,c.vE)(t,"navbar-collapse");let o=(0,s.useContext)(m.Z);return(0,f.jsx)(p.Z,{in:!!(o&&o.expanded),...n,children:(0,f.jsx)("div",{ref:r,className:t,children:e})})});h.displayName="NavbarCollapse";var v=n(6575);let g=s.forwardRef(({bsPrefix:e,className:t,children:n,label:r="Toggle navigation",as:o="button",onClick:i,...u},l)=>{e=(0,c.vE)(e,"navbar-toggler");let{onToggle:d,expanded:p}=(0,s.useContext)(m.Z)||{},h=(0,v.Z)(e=>{i&&i(e),d&&d()});return"button"===o&&(u.type="button"),(0,f.jsx)(o,{...u,ref:l,onClick:h,"aria-label":r,className:a()(t,e,!p&&"collapsed"),children:n||(0,f.jsx)("span",{className:`${e}-icon`})})});g.displayName="NavbarToggle";var y=n(6160);let E=new WeakMap,x=(e,t)=>{if(!e||!t)return;let n=E.get(t)||new Map;E.set(t,n);let r=n.get(e);return r||((r=t.matchMedia(e)).refCount=0,n.set(r.media,r)),r},b=function(e){let t=Object.keys(e);function n(e,t){return e===t?t:e?`${e} and ${t}`:t}return function(r,o,i){let a;return"object"==typeof r?(a=r,i=o,o=!0):a={[r]:o=o||!0},function(e,t="undefined"==typeof window?void 0:window){let n=x(e,t),[r,o]=(0,s.useState)(()=>!!n&&n.matches);return(0,y.Z)(()=>{let n=x(e,t);if(!n)return o(!1);let r=E.get(t),i=()=>{o(n.matches)};return n.refCount++,n.addListener(i),i(),()=>{n.removeListener(i),n.refCount--,n.refCount<=0&&(null==r||r.delete(n.media)),n=void 0}},[e]),r}((0,s.useMemo)(()=>Object.entries(a).reduce((r,[o,i])=>{if("up"===i||!0===i){let t;r=n(r,("number"==typeof(t=e[o])&&(t=`${t}px`),`(min-width: ${t})`))}if("down"===i||!0===i){let i;r=n(r,(i="number"==typeof(i=e[t[Math.min(t.indexOf(o)+1,t.length-1)]])?`${i-.2}px`:`calc(${i} - 0.2px)`,`(max-width: ${i})`))}return r},""),[JSON.stringify(a)]),i)}}({xs:0,sm:576,md:768,lg:992,xl:1200,xxl:1400});var C=n(8342);function O(e){void 0===e&&(e=(0,C.Z)());try{var t=e.activeElement;if(!t||!t.nodeName)return null;return t}catch(t){return e.body}}var N=n(6712),Z=n(2762),j=n(7937),k=n(422),w=n(9189),R=n(9548),S=n(2674),T=n(968);let $=(0,n(5872).PB)("modal-open");class F{constructor({ownerDocument:e,handleContainerOverflow:t=!0,isRTL:n=!1}={}){this.handleContainerOverflow=t,this.isRTL=n,this.modals=[],this.ownerDocument=e}getScrollbarWidth(){return function(e=document){return Math.abs(e.defaultView.innerWidth-e.documentElement.clientWidth)}(this.ownerDocument)}getElement(){return(this.ownerDocument||document).body}setModalAttributes(e){}removeModalAttributes(e){}setContainerStyle(e){let t={overflow:"hidden"},n=this.isRTL?"paddingLeft":"paddingRight",r=this.getElement();e.style={overflow:r.style.overflow,[n]:r.style[n]},e.scrollBarWidth&&(t[n]=`${parseInt((0,T.Z)(r,n)||"0",10)+e.scrollBarWidth}px`),r.setAttribute($,""),(0,T.Z)(r,t)}reset(){[...this.modals].forEach(e=>this.remove(e))}removeContainerStyle(e){let t=this.getElement();t.removeAttribute($),Object.assign(t.style,e.style)}add(e){let t=this.modals.indexOf(e);return -1!==t||(t=this.modals.length,this.modals.push(e),this.setModalAttributes(e),0!==t||(this.state={scrollBarWidth:this.getScrollbarWidth(),style:{}},this.handleContainerOverflow&&this.setContainerStyle(this.state))),t}remove(e){let t=this.modals.indexOf(e);-1!==t&&(this.modals.splice(t,1),!this.modals.length&&this.handleContainerOverflow&&this.removeContainerStyle(this.state),this.removeModalAttributes(e))}isTopModal(e){return!!this.modals.length&&this.modals[this.modals.length-1]===e}}var L=F,A=n(8821),D=n(348),I=n(3774),P=n(663);let M=["show","role","className","style","children","backdrop","keyboard","onBackdropClick","onEscapeKeyDown","transition","runTransition","backdropTransition","runBackdropTransition","autoFocus","enforceFocus","restoreFocus","restoreFocusOptions","renderDialog","renderBackdrop","manager","container","onShow","onHide","onExit","onExited","onExiting","onEnter","onEntering","onEntered"],_=(0,s.forwardRef)((e,t)=>{let{show:n=!1,role:o="dialog",className:i,style:a,children:u,backdrop:l=!0,keyboard:c=!0,onBackdropClick:d,onEscapeKeyDown:p,transition:m,runTransition:h,backdropTransition:g,runBackdropTransition:y,autoFocus:E=!0,enforceFocus:x=!0,restoreFocus:b=!0,restoreFocusOptions:C,renderDialog:T,renderBackdrop:$=e=>(0,f.jsx)("div",Object.assign({},e)),manager:F,container:_,onShow:B,onHide:U=()=>{},onExit:W,onExited:V,onExiting:H,onEnter:G,onEntering:X,onEntered:K}=e,Y=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(e,M),q=(0,D.Z)(),z=(0,A.Z)(_),J=function(e){let t=(0,D.Z)(),n=e||(r||(r=new L({ownerDocument:null==t?void 0:t.document})),r),o=(0,s.useRef)({dialog:null,backdrop:null});return Object.assign(o.current,{add:()=>n.add(o.current),remove:()=>n.remove(o.current),isTopModal:()=>n.isTopModal(o.current),setDialogRef:(0,s.useCallback)(e=>{o.current.dialog=e},[]),setBackdropRef:(0,s.useCallback)(e=>{o.current.backdrop=e},[])})}(F),Q=(0,w.Z)(),ee=(0,S.Z)(n),[et,en]=(0,s.useState)(!n),er=(0,s.useRef)(null);(0,s.useImperativeHandle)(t,()=>J,[J]),Z.Z&&!ee&&n&&(er.current=O(null==q?void 0:q.document)),n&&et&&en(!1);let eo=(0,v.Z)(()=>{if(J.add(),ec.current=(0,j.Z)(document,"keydown",eu),el.current=(0,j.Z)(document,"focus",()=>setTimeout(ea),!0),B&&B(),E){var e,t;let n=O(null!=(e=null==(t=J.dialog)?void 0:t.ownerDocument)?e:null==q?void 0:q.document);J.dialog&&n&&!(0,N.Z)(J.dialog,n)&&(er.current=n,J.dialog.focus())}}),ei=(0,v.Z)(()=>{if(J.remove(),null==ec.current||ec.current(),null==el.current||el.current(),b){var e;null==(e=er.current)||null==e.focus||e.focus(C),er.current=null}});(0,s.useEffect)(()=>{n&&z&&eo()},[n,z,eo]),(0,s.useEffect)(()=>{et&&ei()},[et,ei]),(0,R.Z)(()=>{ei()});let ea=(0,v.Z)(()=>{if(!x||!Q()||!J.isTopModal())return;let e=O(null==q?void 0:q.document);J.dialog&&e&&!(0,N.Z)(J.dialog,e)&&J.dialog.focus()}),es=(0,v.Z)(e=>{e.target===e.currentTarget&&(null==d||d(e),!0===l&&U())}),eu=(0,v.Z)(e=>{c&&(0,P.k)(e)&&J.isTopModal()&&(null==p||p(e),e.defaultPrevented||U())}),el=(0,s.useRef)(),ec=(0,s.useRef)();if(!z)return null;let ef=Object.assign({role:o,ref:J.setDialogRef,"aria-modal":"dialog"===o||void 0},Y,{style:a,className:i,tabIndex:-1}),ed=T?T(ef):(0,f.jsx)("div",Object.assign({},ef,{children:s.cloneElement(u,{role:"document"})}));ed=(0,I.sD)(m,h,{unmountOnExit:!0,mountOnEnter:!0,appear:!0,in:!!n,onExit:W,onExiting:H,onExited:(...e)=>{en(!0),null==V||V(...e)},onEnter:G,onEntering:X,onEntered:K,children:ed});let ep=null;return l&&(ep=$({ref:J.setBackdropRef,onClick:es}),ep=(0,I.sD)(g,y,{in:!!n,appear:!0,mountOnEnter:!0,unmountOnExit:!0,children:ep})),(0,f.jsx)(f.Fragment,{children:k.createPortal((0,f.jsxs)(f.Fragment,{children:[ep,ed]}),z)})});_.displayName="Modal";var B=Object.assign(_,{Manager:L}),U=n(5216);let W=s.forwardRef(({className:e,bsPrefix:t,as:n="div",...r},o)=>(t=(0,c.vE)(t,"offcanvas-body"),(0,f.jsx)(n,{ref:o,className:a()(e,t),...r})));W.displayName="OffcanvasBody";var V=n(3418),H=n(6875),G=n(6911);let X={[V.d0]:"show",[V.cn]:"show"},K=s.forwardRef(({bsPrefix:e,className:t,children:n,in:r=!1,mountOnEnter:o=!1,unmountOnExit:i=!1,appear:u=!1,...l},d)=>(e=(0,c.vE)(e,"offcanvas"),(0,f.jsx)(G.Z,{ref:d,addEndListener:H.Z,in:r,mountOnEnter:o,unmountOnExit:i,appear:u,...l,childRef:n.ref,children:(r,o)=>s.cloneElement(n,{...o,className:a()(t,n.props.className,(r===V.d0||r===V.Ix)&&`${e}-toggling`,X[r])})})));K.displayName="OffcanvasToggling";let Y=s.createContext({onHide(){}});var q=n(5619);let z=s.forwardRef(({closeLabel:e="Close",closeVariant:t,closeButton:n=!1,onHide:r,children:o,...i},a)=>{let u=(0,s.useContext)(Y),l=(0,v.Z)(()=>{null==u||u.onHide(),null==r||r()});return(0,f.jsxs)("div",{ref:a,...i,children:[o,n&&(0,f.jsx)(q.Z,{"aria-label":e,variant:t,onClick:l})]})}),J=s.forwardRef(({bsPrefix:e,className:t,closeLabel:n="Close",closeButton:r=!1,...o},i)=>(e=(0,c.vE)(e,"offcanvas-header"),(0,f.jsx)(z,{ref:i,...o,className:a()(t,e),closeLabel:n,closeButton:r})));J.displayName="OffcanvasHeader";let Q=s.forwardRef((e,t)=>(0,f.jsx)("div",{...e,ref:t,className:a()(e.className,"h5")})),ee=s.forwardRef(({className:e,bsPrefix:t,as:n=Q,...r},o)=>(t=(0,c.vE)(t,"offcanvas-title"),(0,f.jsx)(n,{ref:o,className:a()(e,t),...r})));ee.displayName="OffcanvasTitle";var et=n(9523),en=n(3465);function er(e,t){return e.replace(RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}let eo={FIXED_CONTENT:".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",STICKY_CONTENT:".sticky-top",NAVBAR_TOGGLER:".navbar-toggler"};class ei extends L{adjustAndStore(e,t,n){let r=t.style[e];t.dataset[e]=r,(0,T.Z)(t,{[e]:`${parseFloat((0,T.Z)(t,e))+n}px`})}restore(e,t){let n=t.dataset[e];void 0!==n&&(delete t.dataset[e],(0,T.Z)(t,{[e]:n}))}setContainerStyle(e){var t;super.setContainerStyle(e);let n=this.getElement();if(t="modal-open",n.classList?n.classList.add(t):(0,et.Z)(n,t)||("string"==typeof n.className?n.className=n.className+" "+t:n.setAttribute("class",(n.className&&n.className.baseVal||"")+" "+t)),!e.scrollBarWidth)return;let r=this.isRTL?"paddingLeft":"paddingRight",o=this.isRTL?"marginLeft":"marginRight";(0,en.Z)(n,eo.FIXED_CONTENT).forEach(t=>this.adjustAndStore(r,t,e.scrollBarWidth)),(0,en.Z)(n,eo.STICKY_CONTENT).forEach(t=>this.adjustAndStore(o,t,-e.scrollBarWidth)),(0,en.Z)(n,eo.NAVBAR_TOGGLER).forEach(t=>this.adjustAndStore(o,t,e.scrollBarWidth))}removeContainerStyle(e){var t;super.removeContainerStyle(e);let n=this.getElement();t="modal-open",n.classList?n.classList.remove(t):"string"==typeof n.className?n.className=er(n.className,t):n.setAttribute("class",er(n.className&&n.className.baseVal||"",t));let r=this.isRTL?"paddingLeft":"paddingRight",o=this.isRTL?"marginLeft":"marginRight";(0,en.Z)(n,eo.FIXED_CONTENT).forEach(e=>this.restore(r,e)),(0,en.Z)(n,eo.STICKY_CONTENT).forEach(e=>this.restore(o,e)),(0,en.Z)(n,eo.NAVBAR_TOGGLER).forEach(e=>this.restore(o,e))}}function ea(e){return(0,f.jsx)(K,{...e})}function es(e){return(0,f.jsx)(U.Z,{...e})}let eu=s.forwardRef(({bsPrefix:e,className:t,children:n,"aria-labelledby":r,placement:i="start",responsive:u,show:l=!1,backdrop:d=!0,keyboard:p=!0,scroll:h=!1,onEscapeKeyDown:g,onShow:y,onHide:E,container:x,autoFocus:C=!0,enforceFocus:O=!0,restoreFocus:N=!0,restoreFocusOptions:Z,onEntered:j,onExit:k,onExiting:w,onEnter:R,onEntering:S,onExited:T,backdropClassName:$,manager:F,renderStaticNode:L=!1,...A},D)=>{let I=(0,s.useRef)();e=(0,c.vE)(e,"offcanvas");let{onToggle:P}=(0,s.useContext)(m.Z)||{},[M,_]=(0,s.useState)(!1),U=b(u||"xs","up");(0,s.useEffect)(()=>{_(u?l&&!U:l)},[l,u,U]);let W=(0,v.Z)(()=>{null==P||P(),null==E||E()}),V=(0,s.useMemo)(()=>({onHide:W}),[W]),H=(0,s.useCallback)(t=>(0,f.jsx)("div",{...t,className:a()(`${e}-backdrop`,$)}),[$,e]),G=o=>(0,f.jsx)("div",{...o,...A,className:a()(t,u?`${e}-${u}`:e,`${e}-${i}`),"aria-labelledby":r,children:n});return(0,f.jsxs)(f.Fragment,{children:[!M&&(u||L)&&G({}),(0,f.jsx)(Y.Provider,{value:V,children:(0,f.jsx)(B,{show:M,ref:D,backdrop:d,container:x,keyboard:p,autoFocus:C,enforceFocus:O&&!h,restoreFocus:N,restoreFocusOptions:Z,onEscapeKeyDown:g,onShow:y,onHide:W,onEnter:(e,...t)=>{e&&(e.style.visibility="visible"),null==R||R(e,...t)},onEntering:S,onEntered:j,onExit:k,onExiting:w,onExited:(e,...t)=>{e&&(e.style.visibility=""),null==T||T(...t)},manager:F||(h?(I.current||(I.current=new ei({handleContainerOverflow:!1})),I.current):(o||(o=new ei(void 0)),o)),transition:ea,backdropTransition:es,renderBackdrop:H,renderDialog:G})})]})});eu.displayName="Offcanvas";var el=Object.assign(eu,{Body:W,Header:J,Title:ee});let ec=s.forwardRef((e,t)=>{let n=(0,s.useContext)(m.Z);return(0,f.jsx)(el,{ref:t,show:!!(null!=n&&n.expanded),...e,renderStaticNode:!0})});ec.displayName="NavbarOffcanvas";let ef=s.forwardRef(({className:e,bsPrefix:t,as:n="span",...r},o)=>(t=(0,c.vE)(t,"navbar-text"),(0,f.jsx)(n,{ref:o,className:a()(e,t),...r})));ef.displayName="NavbarText";let ed=s.forwardRef((e,t)=>{let{bsPrefix:n,expand:r=!0,variant:o="light",bg:i,fixed:d,sticky:p,className:h,as:v="nav",expanded:g,onToggle:y,onSelect:E,collapseOnSelect:x=!1,...b}=(0,l.Ch)(e,{expanded:"onToggle"}),C=(0,c.vE)(n,"navbar"),O=(0,s.useCallback)((...e)=>{null==E||E(...e),x&&g&&(null==y||y(!1))},[E,x,g,y]);void 0===b.role&&"nav"!==v&&(b.role="navigation");let N=`${C}-expand`;"string"==typeof r&&(N=`${N}-${r}`);let Z=(0,s.useMemo)(()=>({onToggle:()=>null==y?void 0:y(!g),bsPrefix:C,expanded:!!g,expand:r}),[C,g,r,y]);return(0,f.jsx)(m.Z.Provider,{value:Z,children:(0,f.jsx)(u.Z.Provider,{value:O,children:(0,f.jsx)(v,{ref:t,...b,className:a()(h,C,r&&N,o&&`${C}-${o}`,i&&`bg-${i}`,p&&`sticky-${p}`,d&&`fixed-${d}`)})})})});ed.displayName="Navbar";var ep=Object.assign(ed,{Brand:d,Collapse:h,Offcanvas:ec,Text:ef,Toggle:g})},8936:function(e,t,n){"use strict";let r=n(959).createContext(null);r.displayName="NavbarContext",t.Z=r},1835:function(e,t,n){"use strict";n.d(t,{SC:function(){return c},pi:function(){return u},vE:function(){return s},zG:function(){return l}});var r=n(959);n(1527);let o=r.createContext({prefixes:{},breakpoints:["xxl","xl","lg","md","sm","xs"],minBreakpoint:"xs"}),{Consumer:i,Provider:a}=o;function s(e,t){let{prefixes:n}=(0,r.useContext)(o);return e||n[t]||t}function u(){let{breakpoints:e}=(0,r.useContext)(o);return e}function l(){let{minBreakpoint:e}=(0,r.useContext)(o);return e}function c(){let{dir:e}=(0,r.useContext)(o);return"rtl"===e}},6911:function(e,t,n){"use strict";var r=n(959),o=n(3418),i=n(5466),a=n(7385),s=n(1527);let u=r.forwardRef(({onEnter:e,onEntering:t,onEntered:n,onExit:u,onExiting:l,onExited:c,addEndListener:f,children:d,childRef:p,...m},h)=>{let v=(0,r.useRef)(null),g=(0,i.Z)(v,p),y=e=>{g((0,a.Z)(e))},E=e=>t=>{e&&v.current&&e(v.current,t)},x=(0,r.useCallback)(E(e),[e]),b=(0,r.useCallback)(E(t),[t]),C=(0,r.useCallback)(E(n),[n]),O=(0,r.useCallback)(E(u),[u]),N=(0,r.useCallback)(E(l),[l]),Z=(0,r.useCallback)(E(c),[c]),j=(0,r.useCallback)(E(f),[f]);return(0,s.jsx)(o.ZP,{ref:h,...m,onEnter:x,onEntered:C,onEntering:b,onExit:O,onExited:Z,onExiting:N,addEndListener:j,nodeRef:v,children:"function"==typeof d?(e,t)=>d(e,{...t,ref:y}):r.cloneElement(d,{ref:y})})});t.Z=u},7385:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(422);function o(e){return e&&"setState"in e?r.findDOMNode(e):null!=e?e:null}},6875:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(968),o=n(7937);function i(e,t){let n=(0,r.Z)(e,t)||"",o=-1===n.indexOf("ms")?1e3:1;return parseFloat(n)*o}function a(e,t){var n,a,s,u,l,c,f,d,p,m,h,v;let g=i(e,"transitionDuration"),y=i(e,"transitionDelay"),E=(n=e,a=n=>{n.target===e&&(E(),t(n))},null==(s=g+y)&&(c=-1===(l=(0,r.Z)(n,"transitionDuration")||"").indexOf("ms")?1e3:1,s=parseFloat(l)*c||0),h=(d=!1,p=setTimeout(function(){d||function(e,t,n,r){if(void 0===n&&(n=!1),void 0===r&&(r=!0),e){var o=document.createEvent("HTMLEvents");o.initEvent(t,n,r),e.dispatchEvent(o)}}(n,"transitionend",!0)},s+5),m=(0,o.Z)(n,"transitionend",function(){d=!0},{once:!0}),function(){clearTimeout(p),m()}),v=(0,o.Z)(n,"transitionend",a),function(){h(),v()})}},9860:function(e,t,n){"use strict";function r(e){e.offsetHeight}n.d(t,{Z:function(){return r}})},3418:function(e,t,n){"use strict";n.d(t,{cn:function(){return d},d0:function(){return f},Wj:function(){return c},Ix:function(){return p},ZP:function(){return v}});var r=n(6981);function o(e,t){return(o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var i=n(959),a=n(422),s={disabled:!1},u=i.createContext(null),l="unmounted",c="exited",f="entering",d="entered",p="exiting",m=function(e){function t(t,n){r=e.call(this,t,n)||this;var r,o,i=n&&!n.isMounting?t.enter:t.appear;return r.appearStatus=null,t.in?i?(o=c,r.appearStatus=f):o=d:o=t.unmountOnExit||t.mountOnEnter?l:c,r.state={status:o},r.nextCallback=null,r}t.prototype=Object.create(e.prototype),t.prototype.constructor=t,o(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===l?{status:c}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==f&&n!==d&&(t=f):(n===f||n===d)&&(t=p)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,n,r=this.props.timeout;return e=t=n=r,null!=r&&"number"!=typeof r&&(e=r.exit,t=r.enter,n=void 0!==r.appear?r.appear:t),{exit:e,enter:t,appear:n}},n.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t){if(this.cancelNextCallback(),t===f){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:a.findDOMNode(this);n&&n.scrollTop}this.performEnter(e)}else this.performExit()}else this.props.unmountOnExit&&this.state.status===c&&this.setState({status:l})},n.performEnter=function(e){var t=this,n=this.props.enter,r=this.context?this.context.isMounting:e,o=this.props.nodeRef?[r]:[a.findDOMNode(this),r],i=o[0],u=o[1],l=this.getTimeouts(),c=r?l.appear:l.enter;if(!e&&!n||s.disabled){this.safeSetState({status:d},function(){t.props.onEntered(i)});return}this.props.onEnter(i,u),this.safeSetState({status:f},function(){t.props.onEntering(i,u),t.onTransitionEnd(c,function(){t.safeSetState({status:d},function(){t.props.onEntered(i,u)})})})},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),r=this.props.nodeRef?void 0:a.findDOMNode(this);if(!t||s.disabled){this.safeSetState({status:c},function(){e.props.onExited(r)});return}this.props.onExit(r),this.safeSetState({status:p},function(){e.props.onExiting(r),e.onTransitionEnd(n.exit,function(){e.safeSetState({status:c},function(){e.props.onExited(r)})})})},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:a.findDOMNode(this),r=null==e&&!this.props.addEndListener;if(!n||r){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var o=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],i=o[0],s=o[1];this.props.addEndListener(i,s)}null!=e&&setTimeout(this.nextCallback,e)},n.render=function(){var e=this.state.status;if(e===l)return null;var t=this.props,n=t.children,o=(t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef,(0,r.Z)(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return i.createElement(u.Provider,{value:null},"function"==typeof n?n(e,o):i.cloneElement(i.Children.only(n),o))},t}(i.Component);function h(){}m.contextType=u,m.propTypes={},m.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:h,onEntering:h,onEntered:h,onExit:h,onExiting:h,onExited:h},m.UNMOUNTED=l,m.EXITED=c,m.ENTERING=f,m.ENTERED=d,m.EXITING=p;var v=m},7980:function(e,t,n){"use strict";function r(){return(r=Object.assign?Object.assign.bind():function(e){for(var t=1;t1?t-1:0),o=1;o=0||(o[n]=e[n]);return o}n.d(t,{Z:function(){return r}})},1876:function(e,t,n){"use strict";n.d(t,{Z:function(){return O}});var r={};n.r(r),n.d(r,{exclude:function(){return C},extract:function(){return v},parse:function(){return g},parseUrl:function(){return E},pick:function(){return b},stringify:function(){return y},stringifyUrl:function(){return x}});let o="%[a-f0-9]{2}",i=RegExp("("+o+")|([^%]+?)","gi"),a=RegExp("("+o+")+","gi");function s(e,t){if(!("string"==typeof e&&"string"==typeof t))throw TypeError("Expected the arguments to be of type `string`");if(""===e||""===t)return[];let n=e.indexOf(t);return -1===n?[]:[e.slice(0,n),e.slice(n+t.length)]}let u=e=>null==e,l=e=>encodeURIComponent(e).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),c=Symbol("encodeFragmentIdentifier");function f(e){if("string"!=typeof e||1!==e.length)throw TypeError("arrayFormatSeparator must be single character string")}function d(e,t){return t.encode?t.strict?l(e):encodeURIComponent(e):e}function p(e,t){return t.decode?function(e){if("string"!=typeof e)throw TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return decodeURIComponent(e)}catch{return function(e){let t={"%FE%FF":"��","%FF%FE":"��"},n=a.exec(e);for(;n;){try{t[n[0]]=decodeURIComponent(n[0])}catch{let e=function(e){try{return decodeURIComponent(e)}catch{let t=e.match(i)||[];for(let n=1;n{if(t=/\[(\d*)]$/.exec(e),e=e.replace(/\[\d*]$/,""),!t){r[e]=n;return}void 0===r[e]&&(r[e]={}),r[e][t[1]]=n};case"bracket":return(e,n,r)=>{if(t=/(\[])$/.exec(e),e=e.replace(/\[]$/,""),!t){r[e]=n;return}if(void 0===r[e]){r[e]=[n];return}r[e]=[...r[e],n]};case"colon-list-separator":return(e,n,r)=>{if(t=/(:list)$/.exec(e),e=e.replace(/:list$/,""),!t){r[e]=n;return}if(void 0===r[e]){r[e]=[n];return}r[e]=[...r[e],n]};case"comma":case"separator":return(t,n,r)=>{let o="string"==typeof n&&n.includes(e.arrayFormatSeparator),i="string"==typeof n&&!o&&p(n,e).includes(e.arrayFormatSeparator);n=i?p(n,e):n;let a=o||i?n.split(e.arrayFormatSeparator).map(t=>p(t,e)):null===n?n:p(n,e);r[t]=a};case"bracket-separator":return(t,n,r)=>{let o=/(\[])$/.test(t);if(t=t.replace(/\[]$/,""),!o){r[t]=n?p(n,e):n;return}let i=null===n?[]:n.split(e.arrayFormatSeparator).map(t=>p(t,e));if(void 0===r[t]){r[t]=i;return}r[t]=[...r[t],...i]};default:return(e,t,n)=>{if(void 0===n[e]){n[e]=t;return}n[e]=[...[n[e]].flat(),t]}}}(t),r=Object.create(null);if("string"!=typeof e||!(e=e.trim().replace(/^[?#&]/,"")))return r;for(let o of e.split("&")){if(""===o)continue;let e=t.decode?o.replace(/\+/g," "):o,[i,a]=s(e,"=");void 0===i&&(i=e),a=void 0===a?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?a:p(a,t),n(p(i,t),a,r)}for(let[e,n]of Object.entries(r))if("object"==typeof n&&null!==n)for(let[e,r]of Object.entries(n))n[e]=h(r,t);else r[e]=h(n,t);return!1===t.sort?r:(!0===t.sort?Object.keys(r).sort():Object.keys(r).sort(t.sort)).reduce((e,t)=>{let n=r[t];return n&&"object"==typeof n&&!Array.isArray(n)?e[t]=function e(t){return Array.isArray(t)?t.sort():"object"==typeof t?e(Object.keys(t)).sort((e,t)=>Number(e)-Number(t)).map(e=>t[e]):t}(n):e[t]=n,e},Object.create(null))}function y(e,t){if(!e)return"";f((t={encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:",",...t}).arrayFormatSeparator);let n=n=>t.skipNull&&u(e[n])||t.skipEmptyString&&""===e[n],r=function(e){switch(e.arrayFormat){case"index":return t=>(n,r)=>{let o=n.length;return void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[d(t,e),"[",o,"]"].join("")]:[...n,[d(t,e),"[",d(o,e),"]=",d(r,e)].join("")]};case"bracket":return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[d(t,e),"[]"].join("")]:[...n,[d(t,e),"[]=",d(r,e)].join("")];case"colon-list-separator":return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[d(t,e),":list="].join("")]:[...n,[d(t,e),":list=",d(r,e)].join("")];case"comma":case"separator":case"bracket-separator":{let t="bracket-separator"===e.arrayFormat?"[]=":"=";return n=>(r,o)=>void 0===o||e.skipNull&&null===o||e.skipEmptyString&&""===o?r:(o=null===o?"":o,0===r.length)?[[d(n,e),t,d(o,e)].join("")]:[[r,d(o,e)].join(e.arrayFormatSeparator)]}default:return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,d(t,e)]:[...n,[d(t,e),"=",d(r,e)].join("")]}}(t),o={};for(let[t,r]of Object.entries(e))n(t)||(o[t]=r);let i=Object.keys(o);return!1!==t.sort&&i.sort(t.sort),i.map(n=>{let o=e[n];return void 0===o?"":null===o?d(n,t):Array.isArray(o)?0===o.length&&"bracket-separator"===t.arrayFormat?d(n,t)+"[]":o.reduce(r(n),[]).join("&"):d(n,t)+"="+d(o,t)}).filter(e=>e.length>0).join("&")}function E(e,t){t={decode:!0,...t};let[n,r]=s(e,"#");return void 0===n&&(n=e),{url:n?.split("?")?.[0]??"",query:g(v(e),t),...t&&t.parseFragmentIdentifier&&r?{fragmentIdentifier:p(r,t)}:{}}}function x(e,t){t={encode:!0,strict:!0,[c]:!0,...t};let n=m(e.url).split("?")[0]||"",r=y({...g(v(e.url),{sort:!1}),...e.query},t);r&&(r=`?${r}`);let o=function(e){let t="",n=e.indexOf("#");return -1!==n&&(t=e.slice(n)),t}(e.url);if(e.fragmentIdentifier){let r=new URL(n);r.hash=e.fragmentIdentifier,o=t[c]?r.hash:`#${e.fragmentIdentifier}`}return`${n}${r}${o}`}function b(e,t,n){let{url:r,query:o,fragmentIdentifier:i}=E(e,n={parseFragmentIdentifier:!0,[c]:!1,...n});return x({url:r,query:function(e,t){let n={};if(Array.isArray(t))for(let r of t){let t=Object.getOwnPropertyDescriptor(e,r);t?.enumerable&&Object.defineProperty(n,r,t)}else for(let r of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,r);if(o.enumerable){let i=e[r];t(r,i,e)&&Object.defineProperty(n,r,o)}}return n}(o,t),fragmentIdentifier:i},n)}function C(e,t,n){return b(e,Array.isArray(t)?e=>!t.includes(e):(e,n)=>!t(e,n),n)}var O=r}}]); \ No newline at end of file diff --git a/dist/_next/static/chunks/531-22a1e9c8c7afcca6.js b/dist/_next/static/chunks/531-22a1e9c8c7afcca6.js deleted file mode 100644 index aa234132..00000000 --- a/dist/_next/static/chunks/531-22a1e9c8c7afcca6.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[531],{3011:function(e,t,n){n.d(t,{Z:function(){return o}});var r=n(959);function o(){return(0,r.useState)(null)}},2447:function(e,t,n){n.d(t,{Z:function(){return s}});var r=n(959),o=n(9189),a=n(9548);let i=2147483648-1;function s(){let e=(0,o.Z)(),t=(0,r.useRef)();return(0,a.Z)(()=>clearTimeout(t.current)),(0,r.useMemo)(()=>{let n=()=>clearTimeout(t.current);return{set:function(r,o=0){e()&&(n(),o<=i?t.current=setTimeout(r,o):function e(t,n,r){let o=r-Date.now();t.current=o<=i?setTimeout(n,o):setTimeout(()=>e(t,n,r),i)}(t,r,Date.now()+o))},clear:n,handleRef:t}},[])}},3162:function(e,t,n){n.d(t,{FT:function(){return i}});var r=n(959),o=n(1527);let a=["as","disabled"];function i({tagName:e,disabled:t,href:n,target:r,rel:o,role:a,onClick:i,tabIndex:s=0,type:l}){e||(e=null!=n||null!=r||null!=o?"a":"button");let u={tagName:e};if("button"===e)return[{type:l||"button",disabled:t},u];let f=r=>{var o;if(!t&&("a"!==e||(o=n)&&"#"!==o.trim())||r.preventDefault(),t){r.stopPropagation();return}null==i||i(r)};return"a"===e&&(n||(n="#"),t&&(n=void 0)),[{role:null!=a?a:"button",disabled:void 0,tabIndex:t?void 0:s,href:n,target:"a"===e?r:void 0,"aria-disabled":t||void 0,rel:"a"===e?o:void 0,onClick:f,onKeyDown:e=>{" "===e.key&&(e.preventDefault(),f(e))}},u]}let s=r.forwardRef((e,t)=>{let{as:n,disabled:r}=e,s=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(e,a),[l,{tagName:u}]=i(Object.assign({tagName:n,disabled:r},s));return(0,o.jsx)(u,Object.assign({},s,l,{ref:t}))});s.displayName="Button",t.ZP=s},3970:function(e,t,n){let r=n(959).createContext(null);r.displayName="NavContext",t.Z=r},6465:function(e,t,n){n.d(t,{v:function(){return d}});var r=n(959),o=n(6575),a=n(3970),i=n(3439),s=n(3162),l=n(5872),u=n(3503),f=n(1527);let c=["as","active","eventKey"];function d({key:e,onClick:t,active:n,id:s,role:f,disabled:c}){let d=(0,r.useContext)(i.Z),p=(0,r.useContext)(a.Z),h=(0,r.useContext)(u.Z),m=n,v={role:f};if(p){f||"tablist"!==p.role||(v.role="tab");let t=p.getControllerId(null!=e?e:null),r=p.getControlledId(null!=e?e:null);v[(0,l.PB)("event-key")]=e,v.id=t||s,((m=null==n&&null!=e?p.activeKey===e:n)||!(null!=h&&h.unmountOnExit)&&!(null!=h&&h.mountOnEnter))&&(v["aria-controls"]=r)}return"tab"===v.role&&(v["aria-selected"]=m,m||(v.tabIndex=-1),c&&(v.tabIndex=-1,v["aria-disabled"]=!0)),v.onClick=(0,o.Z)(n=>{c||(null==t||t(n),null!=e&&d&&!n.isPropagationStopped()&&d(e,n))}),[v,{isActive:m}]}let p=r.forwardRef((e,t)=>{let{as:n=s.ZP,active:r,eventKey:o}=e,a=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(e,c),[u,p]=d(Object.assign({key:(0,i.h)(o,a.href),active:r},a));return u[(0,l.PB)("active")]=p.isActive,(0,f.jsx)(n,Object.assign({},a,u,{ref:t}))});p.displayName="NavItem",t.Z=p},3503:function(e,t,n){let r=n(959).createContext(null);t.Z=r},7468:function(e,t,n){n.d(t,{W:function(){return d}});var r=n(959),o=n(3503),a=n(3439),i=n(3233),s=n(1527);let l=["active","eventKey","mountOnEnter","transition","unmountOnExit","role","onEnter","onEntering","onEntered","onExit","onExiting","onExited"],u=["activeKey","getControlledId","getControllerId"],f=["as"];function c(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}function d(e){let{active:t,eventKey:n,mountOnEnter:i,transition:s,unmountOnExit:f,role:d="tabpanel",onEnter:p,onEntering:h,onEntered:m,onExit:v,onExiting:g,onExited:y}=e,b=c(e,l),x=(0,r.useContext)(o.Z);if(!x)return[Object.assign({},b,{role:d}),{eventKey:n,isActive:t,mountOnEnter:i,transition:s,unmountOnExit:f,onEnter:p,onEntering:h,onEntered:m,onExit:v,onExiting:g,onExited:y}];let{activeKey:w,getControlledId:O,getControllerId:E}=x,j=c(x,u),D=(0,a.h)(n);return[Object.assign({},b,{role:d,id:O(n),"aria-labelledby":E(n)}),{eventKey:n,isActive:null==t&&null!=D?(0,a.h)(w)===D:t,transition:s||j.transition,mountOnEnter:null!=i?i:j.mountOnEnter,unmountOnExit:null!=f?f:j.unmountOnExit,onEnter:p,onEntering:h,onEntered:m,onExit:v,onExiting:g,onExited:y}]}let p=r.forwardRef((e,t)=>{let{as:n="div"}=e,[r,{isActive:l,onEnter:u,onEntering:p,onEntered:h,onExit:m,onExiting:v,onExited:g,mountOnEnter:y,unmountOnExit:b,transition:x=i.Z}]=d(c(e,f));return(0,s.jsx)(o.Z.Provider,{value:null,children:(0,s.jsx)(a.Z.Provider,{value:null,children:(0,s.jsx)(x,{in:l,onEnter:u,onEntering:p,onEntered:h,onExit:m,onExiting:v,onExited:g,mountOnEnter:y,unmountOnExit:b,children:(0,s.jsx)(n,Object.assign({},r,{ref:t,hidden:!l,"aria-hidden":!l}))})})})});p.displayName="TabPanel",t.Z=p},5616:function(e,t,n){n.d(t,{Z:function(){return y}});var r=n(959);let o={prefix:String(Math.round(1e10*Math.random())),current:0},a=r.createContext(o),i=r.createContext(!1),s=!!("undefined"!=typeof window&&window.document&&window.document.createElement),l=new WeakMap,u="function"==typeof r.useId?function(e){let t=r.useId(),[n]=(0,r.useState)("function"==typeof r.useSyncExternalStore?r.useSyncExternalStore(d,f,c):(0,r.useContext)(i)),a=n?"react-aria":`react-aria${o.prefix}`;return e||`${a}-${t}`}:function(e){let t=(0,r.useContext)(a);t!==o||s||console.warn("When server rendering, you must wrap your application in an to ensure consistent ids are generated between the client and server.");let n=function(e=!1){let t=(0,r.useContext)(a),n=(0,r.useRef)(null);if(null===n.current&&!e){var o,i;let e=null===(i=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)||void 0===i?void 0:null===(o=i.ReactCurrentOwner)||void 0===o?void 0:o.current;if(e){let n=l.get(e);null==n?l.set(e,{id:t.current,state:e.memoizedState}):e.memoizedState!==n.state&&(t.current=n.id,l.delete(e))}n.current=++t.current}return n.current}(!!e),i=`react-aria${t.prefix}`;return e||`${i}-${n}`};function f(){return!1}function c(){return!0}function d(e){return()=>{}}var p=n(3503),h=n(3439),m=n(7468),v=n(1527);let g=e=>{let{id:t,generateChildId:n,onSelect:o,activeKey:a,defaultActiveKey:i,transition:s,mountOnEnter:l,unmountOnExit:f,children:c}=e,[d,m]=function(e,t,n){let o=(0,r.useRef)(void 0!==e),[a,i]=(0,r.useState)(t),s=void 0!==e,l=o.current;return o.current=s,!s&&l&&a!==t&&i(t),[s?e:a,(0,r.useCallback)((...e)=>{let[t,...r]=e,o=null==n?void 0:n(t,...r);return i(t),o},[n])]}(a,i,o),g=u(t),y=(0,r.useMemo)(()=>n||((e,t)=>g?`${g}-${t}-${e}`:null),[g,n]),b=(0,r.useMemo)(()=>({onSelect:m,activeKey:d,transition:s,mountOnEnter:l||!1,unmountOnExit:f||!1,getControlledId:e=>y(e,"tabpane"),getControllerId:e=>y(e,"tab")}),[m,d,s,l,f,y]);return(0,v.jsx)(p.Z.Provider,{value:b,children:(0,v.jsx)(h.Z.Provider,{value:m||null,children:c})})};g.Panel=m.Z;var y=g},5924:function(e,t,n){function r(){for(var e,t,n=0,r="";n>",l=i||r;if(null==n[r])return t?Error("Required "+a+" `"+l+"` was not specified in `"+s+"`."):null;for(var u=arguments.length,f=Array(u>6?u-6:0),c=6;c{let p=(0,s.vE)(t,"btn"),[h,{tagName:m}]=(0,i.FT)({tagName:e,disabled:u,...c});return(0,l.jsx)(m,{...h,...c,ref:d,disabled:u,className:o()(f,p,a&&"active",n&&`${p}-${n}`,r&&`${p}-${r}`,c.href&&u&&"disabled")})});u.displayName="Button",t.Z=u},882:function(e,t,n){var r=n(2187),o=n.n(r),a=n(959),i=n(1835),s=n(1527);let l=a.forwardRef((e,t)=>{let[{className:n,...r},{as:a="div",bsPrefix:l,spans:u}]=function({as:e,bsPrefix:t,className:n,...r}){t=(0,i.vE)(t,"col");let a=(0,i.pi)(),s=(0,i.zG)(),l=[],u=[];return a.forEach(e=>{let n,o,a;let i=r[e];delete r[e],"object"==typeof i&&null!=i?{span:n,offset:o,order:a}=i:n=i;let f=e!==s?`-${e}`:"";n&&l.push(!0===n?`${t}${f}`:`${t}${f}-${n}`),null!=a&&u.push(`order${f}-${a}`),null!=o&&u.push(`offset${f}-${o}`)}),[{...r,className:o()(n,...l,...u)},{as:e,bsPrefix:t,spans:l}]}(e);return(0,s.jsx)(a,{...r,ref:t,className:o()(n,!u.length&&l)})});l.displayName="Col",t.Z=l},222:function(e,t,n){n.d(t,{Ed:function(){return a},UI:function(){return o},XW:function(){return i}});var r=n(959);function o(e,t){let n=0;return r.Children.map(e,e=>r.isValidElement(e)?t(e,n++):e)}function a(e,t){let n=0;r.Children.forEach(e,e=>{r.isValidElement(e)&&t(e,n++)})}function i(e,t){return r.Children.toArray(e).some(e=>r.isValidElement(e)&&e.type===t)}},185:function(e,t,n){var r=n(2187),o=n.n(r),a=n(959),i=n(507),s=n.n(i),l=n(1527);let u={type:s().string,tooltip:s().bool,as:s().elementType},f=a.forwardRef(({as:e="div",className:t,type:n="valid",tooltip:r=!1,...a},i)=>(0,l.jsx)(e,{...a,ref:i,className:o()(t,`${n}-${r?"tooltip":"feedback"}`)}));f.displayName="Feedback",f.propTypes=u,t.Z=f},3760:function(e,t,n){n.d(t,{Z:function(){return j}});var r=n(2187),o=n.n(r),a=n(507),i=n.n(a),s=n(959),l=n(380),u=n(2864),f=n(1835),c=n(1527);let d=s.forwardRef(({className:e,bsPrefix:t,as:n="div",...r},a)=>(t=(0,f.vE)(t,"form-floating"),(0,c.jsx)(n,{ref:a,className:o()(e,t),...r})));d.displayName="FormFloating";var p=n(5053),h=n(8945),m=n(846);let v=s.forwardRef(({bsPrefix:e,className:t,id:n,...r},a)=>{let{controlId:i}=(0,s.useContext)(m.Z);return e=(0,f.vE)(e,"form-range"),(0,c.jsx)("input",{...r,type:"range",ref:a,className:o()(t,e),id:n||i})});v.displayName="FormRange";var g=n(4182);let y=s.forwardRef(({bsPrefix:e,className:t,as:n="small",muted:r,...a},i)=>(e=(0,f.vE)(e,"form-text"),(0,c.jsx)(n,{...a,ref:i,className:o()(t,e,r&&"text-muted")})));y.displayName="FormText";let b=s.forwardRef((e,t)=>(0,c.jsx)(l.Z,{...e,ref:t,type:"switch"}));b.displayName="Switch";var x=Object.assign(b,{Input:l.Z.Input,Label:l.Z.Label});let w=s.forwardRef(({bsPrefix:e,className:t,children:n,controlId:r,label:a,...i},s)=>(e=(0,f.vE)(e,"form-floating"),(0,c.jsxs)(p.Z,{ref:s,className:o()(t,e),controlId:r,...i,children:[n,(0,c.jsx)("label",{htmlFor:r,children:a})]})));w.displayName="FloatingLabel";let O={_ref:i().any,validated:i().bool,as:i().elementType},E=s.forwardRef(({className:e,validated:t,as:n="form",...r},a)=>(0,c.jsx)(n,{...r,ref:a,className:o()(e,t&&"was-validated")}));E.displayName="Form",E.propTypes=O;var j=Object.assign(E,{Group:p.Z,Control:u.Z,Floating:d,Check:l.Z,Switch:x,Label:h.Z,Text:y,Range:v,Select:g.Z,FloatingLabel:w})},380:function(e,t,n){n.d(t,{Z:function(){return h}});var r=n(2187),o=n.n(r),a=n(959),i=n(185),s=n(846),l=n(1835),u=n(1527);let f=a.forwardRef(({id:e,bsPrefix:t,className:n,type:r="checkbox",isValid:i=!1,isInvalid:f=!1,as:c="input",...d},p)=>{let{controlId:h}=(0,a.useContext)(s.Z);return t=(0,l.vE)(t,"form-check-input"),(0,u.jsx)(c,{...d,ref:p,type:r,id:e||h,className:o()(n,t,i&&"is-valid",f&&"is-invalid")})});f.displayName="FormCheckInput";let c=a.forwardRef(({bsPrefix:e,className:t,htmlFor:n,...r},i)=>{let{controlId:f}=(0,a.useContext)(s.Z);return e=(0,l.vE)(e,"form-check-label"),(0,u.jsx)("label",{...r,ref:i,htmlFor:n||f,className:o()(t,e)})});c.displayName="FormCheckLabel";var d=n(222);let p=a.forwardRef(({id:e,bsPrefix:t,bsSwitchPrefix:n,inline:r=!1,reverse:p=!1,disabled:h=!1,isValid:m=!1,isInvalid:v=!1,feedbackTooltip:g=!1,feedback:y,feedbackType:b,className:x,style:w,title:O="",type:E="checkbox",label:j,children:D,as:S="input",...C},N)=>{t=(0,l.vE)(t,"form-check"),n=(0,l.vE)(n,"form-switch");let{controlId:Z}=(0,a.useContext)(s.Z),P=(0,a.useMemo)(()=>({controlId:e||Z}),[Z,e]),T=!D&&null!=j&&!1!==j||(0,d.XW)(D,c),k=(0,u.jsx)(f,{...C,type:"switch"===E?"checkbox":E,ref:N,isValid:m,isInvalid:v,disabled:h,as:S});return(0,u.jsx)(s.Z.Provider,{value:P,children:(0,u.jsx)("div",{style:w,className:o()(x,T&&t,r&&`${t}-inline`,p&&`${t}-reverse`,"switch"===E&&n),children:D||(0,u.jsxs)(u.Fragment,{children:[k,T&&(0,u.jsx)(c,{title:O,children:j}),y&&(0,u.jsx)(i.Z,{type:b,tooltip:g,children:y})]})})})});p.displayName="FormCheck";var h=Object.assign(p,{Input:f,Label:c})},846:function(e,t,n){let r=n(959).createContext({});t.Z=r},2864:function(e,t,n){var r=n(2187),o=n.n(r),a=n(959);n(1190);var i=n(185),s=n(846),l=n(1835),u=n(1527);let f=a.forwardRef(({bsPrefix:e,type:t,size:n,htmlSize:r,id:i,className:f,isValid:c=!1,isInvalid:d=!1,plaintext:p,readOnly:h,as:m="input",...v},g)=>{let{controlId:y}=(0,a.useContext)(s.Z);return e=(0,l.vE)(e,"form-control"),(0,u.jsx)(m,{...v,type:t,size:r,ref:g,readOnly:h,id:i||y,className:o()(f,p?`${e}-plaintext`:e,n&&`${e}-${n}`,"color"===t&&`${e}-color`,c&&"is-valid",d&&"is-invalid")})});f.displayName="FormControl",t.Z=Object.assign(f,{Feedback:i.Z})},5053:function(e,t,n){var r=n(959),o=n(846),a=n(1527);let i=r.forwardRef(({controlId:e,as:t="div",...n},i)=>{let s=(0,r.useMemo)(()=>({controlId:e}),[e]);return(0,a.jsx)(o.Z.Provider,{value:s,children:(0,a.jsx)(t,{...n,ref:i})})});i.displayName="FormGroup",t.Z=i},8945:function(e,t,n){var r=n(2187),o=n.n(r),a=n(959);n(1190);var i=n(882),s=n(846),l=n(1835),u=n(1527);let f=a.forwardRef(({as:e="label",bsPrefix:t,column:n=!1,visuallyHidden:r=!1,className:f,htmlFor:c,...d},p)=>{let{controlId:h}=(0,a.useContext)(s.Z);t=(0,l.vE)(t,"form-label");let m="col-form-label";"string"==typeof n&&(m=`${m} ${m}-${n}`);let v=o()(f,t,r&&"visually-hidden",n&&m);return(c=c||h,n)?(0,u.jsx)(i.Z,{ref:p,as:"label",className:v,htmlFor:c,...d}):(0,u.jsx)(e,{ref:p,className:v,htmlFor:c,...d})});f.displayName="FormLabel",t.Z=f},4182:function(e,t,n){var r=n(2187),o=n.n(r),a=n(959),i=n(1835),s=n(846),l=n(1527);let u=a.forwardRef(({bsPrefix:e,size:t,htmlSize:n,className:r,isValid:u=!1,isInvalid:f=!1,id:c,...d},p)=>{let{controlId:h}=(0,a.useContext)(s.Z);return e=(0,i.vE)(e,"form-select"),(0,l.jsx)("select",{...d,size:n,ref:p,className:o()(r,e,t&&`${e}-${t}`,u&&"is-valid",f&&"is-invalid"),id:c||h})});u.displayName="FormSelect",t.Z=u},1513:function(e,t,n){n.d(t,{Z:function(){return S}});var r=n(2187),o=n.n(r);n(293);var a=n(959),i=n(7980),s=n(3465),l=n(5466),u=n(3970),f=n(3439),c=n(3503),d=n(5872),p=n(6465),h=n(1527);let m=["as","onSelect","activeKey","role","onKeyDown"],v=()=>{},g=(0,d.PB)("event-key"),y=a.forwardRef((e,t)=>{let n,r,{as:o="div",onSelect:i,activeKey:p,role:y,onKeyDown:b}=e,x=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(e,m),w=function(){let[,e]=(0,a.useReducer)(e=>!e,!1);return e}(),O=(0,a.useRef)(!1),E=(0,a.useContext)(f.Z),j=(0,a.useContext)(c.Z);j&&(y=y||"tablist",p=j.activeKey,n=j.getControlledId,r=j.getControllerId);let D=(0,a.useRef)(null),S=e=>{let t=D.current;if(!t)return null;let n=(0,s.Z)(t,`[${g}]:not([aria-disabled=true])`),r=t.querySelector("[aria-selected=true]");if(!r||r!==document.activeElement)return null;let o=n.indexOf(r);if(-1===o)return null;let a=o+e;return a>=n.length&&(a=0),a<0&&(a=n.length-1),n[a]},C=(e,t)=>{null!=e&&(null==i||i(e,t),null==E||E(e,t))};(0,a.useEffect)(()=>{if(D.current&&O.current){let e=D.current.querySelector(`[${g}][aria-selected=true]`);null==e||e.focus()}O.current=!1});let N=(0,l.Z)(t,D);return(0,h.jsx)(f.Z.Provider,{value:C,children:(0,h.jsx)(u.Z.Provider,{value:{role:y,activeKey:(0,f.h)(p),getControlledId:n||v,getControllerId:r||v},children:(0,h.jsx)(o,Object.assign({},x,{onKeyDown:e=>{let t;if(null==b||b(e),j){switch(e.key){case"ArrowLeft":case"ArrowUp":t=S(-1);break;case"ArrowRight":case"ArrowDown":t=S(1);break;default:return}t&&(e.preventDefault(),C(t.dataset[(0,d.$F)("EventKey")]||null,e),O.current=!0,w())}},ref:N,role:y}))})})});y.displayName="Nav";var b=Object.assign(y,{Item:p.Z}),x=n(1835),w=n(8936);let O=a.createContext(null);O.displayName="CardHeaderContext";var E=n(378),j=n(9898);let D=a.forwardRef((e,t)=>{let n,r;let{as:s="div",bsPrefix:l,variant:u,fill:f=!1,justify:c=!1,navbar:d,navbarScroll:p,className:m,activeKey:v,...g}=(0,i.Ch)(e,{activeKey:"onSelect"}),y=(0,x.vE)(l,"nav"),E=!1,j=(0,a.useContext)(w.Z),D=(0,a.useContext)(O);return j?(n=j.bsPrefix,E=null==d||d):D&&({cardHeaderBsPrefix:r}=D),(0,h.jsx)(b,{as:s,ref:t,activeKey:v,className:o()(m,{[y]:!E,[`${n}-nav`]:E,[`${n}-nav-scroll`]:E&&p,[`${r}-${u}`]:!!r,[`${y}-${u}`]:!!u,[`${y}-fill`]:f,[`${y}-justified`]:c}),...g})});D.displayName="Nav";var S=Object.assign(D,{Item:E.Z,Link:j.Z})},378:function(e,t,n){var r=n(959),o=n(2187),a=n.n(o),i=n(1835),s=n(1527);let l=r.forwardRef(({className:e,bsPrefix:t,as:n="div",...r},o)=>(t=(0,i.vE)(t,"nav-item"),(0,s.jsx)(n,{ref:o,className:a()(e,t),...r})));l.displayName="NavItem",t.Z=l},9898:function(e,t,n){n.d(t,{Z:function(){return v}});var r=n(2187),o=n.n(r),a=n(959);n(3011),n(8926);var i=n(6575);n(9189),n(2674),n(6160),new WeakMap;var s=n(3162),l=n(1527);let u=["onKeyDown"],f=a.forwardRef((e,t)=>{var n;let{onKeyDown:r}=e,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(e,u),[a]=(0,s.FT)(Object.assign({tagName:"a"},o)),f=(0,i.Z)(e=>{a.onKeyDown(e),null==r||r(e)});return(n=o.href)&&"#"!==n.trim()&&"button"!==o.role?(0,l.jsx)("a",Object.assign({ref:t},o,{onKeyDown:r})):(0,l.jsx)("a",Object.assign({ref:t},o,a,{onKeyDown:f}))});f.displayName="Anchor";var c=f,d=n(6465),p=n(3439),h=n(1835);let m=a.forwardRef(({bsPrefix:e,className:t,as:n=c,active:r,eventKey:a,disabled:i=!1,...s},u)=>{e=(0,h.vE)(e,"nav-link");let[f,m]=(0,d.v)({key:(0,p.h)(a,s.href),active:r,disabled:i,...s});return(0,l.jsx)(n,{...s,...f,ref:u,disabled:i,className:o()(t,e,i&&"disabled",m.isActive&&"active")})});m.displayName="NavLink";var v=m},7406:function(e,t,n){n.d(t,{Z:function(){return e3}});var r,o,a,i,s,l=n(6712),u=n(507),f=n.n(u),c=n(959),d=n(2447),p=n(1190),h=n.n(p),m=n(7980),v=n(5466),g=n(2187),y=n.n(g),b=n(422),x=n(3011),w=Object.prototype.hasOwnProperty;function O(e,t,n){for(n of e.keys())if(E(n,t))return n}function E(e,t){var n,r,o;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&E(e[r],t[r]););return -1===r}if(n===Set){if(e.size!==t.size)return!1;for(r of e)if((o=r)&&"object"==typeof o&&!(o=O(t,o))||!t.has(o))return!1;return!0}if(n===Map){if(e.size!==t.size)return!1;for(r of e)if((o=r[0])&&"object"==typeof o&&!(o=O(t,o))||!E(r[1],t.get(o)))return!1;return!0}if(n===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(n===DataView){if((r=e.byteLength)===t.byteLength)for(;r--&&e.getInt8(r)===t.getInt8(r););return -1===r}if(ArrayBuffer.isView(e)){if((r=e.byteLength)===t.byteLength)for(;r--&&e[r]===t[r];);return -1===r}if(!n||"object"==typeof e){for(n in r=0,e)if(w.call(e,n)&&++r&&!w.call(t,n)||!(n in t)||!E(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!=e&&t!=t}var j=n(9189),D=function(e){let t=(0,j.Z)();return[e[0],(0,c.useCallback)(n=>{if(t())return e[1](n)},[t,e[1]])]};function S(e){return e.split("-")[0]}function C(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function N(e){var t=C(e).Element;return e instanceof t||e instanceof Element}function Z(e){var t=C(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function P(e){if("undefined"==typeof ShadowRoot)return!1;var t=C(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}var T=Math.max,k=Math.min,M=Math.round;function R(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function A(){return!/^((?!chrome|android).)*safari/i.test(R())}function $(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=e.getBoundingClientRect(),o=1,a=1;t&&Z(e)&&(o=e.offsetWidth>0&&M(r.width)/e.offsetWidth||1,a=e.offsetHeight>0&&M(r.height)/e.offsetHeight||1);var i=(N(e)?C(e):window).visualViewport,s=!A()&&n,l=(r.left+(s&&i?i.offsetLeft:0))/o,u=(r.top+(s&&i?i.offsetTop:0))/a,f=r.width/o,c=r.height/a;return{width:f,height:c,top:u,right:l+f,bottom:u+c,left:l,x:l,y:u}}function L(e){var t=$(e),n=e.offsetWidth,r=e.offsetHeight;return 1>=Math.abs(t.width-n)&&(n=t.width),1>=Math.abs(t.height-r)&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function _(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&P(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function I(e){return e?(e.nodeName||"").toLowerCase():null}function F(e){return C(e).getComputedStyle(e)}function W(e){return((N(e)?e.ownerDocument:e.document)||window.document).documentElement}function B(e){return"html"===I(e)?e:e.assignedSlot||e.parentNode||(P(e)?e.host:null)||W(e)}function H(e){return Z(e)&&"fixed"!==F(e).position?e.offsetParent:null}function U(e){for(var t=C(e),n=H(e);n&&["table","td","th"].indexOf(I(n))>=0&&"static"===F(n).position;)n=H(n);return n&&("html"===I(n)||"body"===I(n)&&"static"===F(n).position)?t:n||function(e){var t=/firefox/i.test(R());if(/Trident/i.test(R())&&Z(e)&&"fixed"===F(e).position)return null;var n=B(e);for(P(n)&&(n=n.host);Z(n)&&0>["html","body"].indexOf(I(n));){var r=F(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}function X(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function V(e,t,n){return T(e,k(t,n))}function Y(){return{top:0,right:0,bottom:0,left:0}}function K(e){return Object.assign({},Y(),e)}function z(e,t){return t.reduce(function(t,n){return t[n]=e,t},{})}var q="bottom",G="right",J="left",Q="auto",ee=["top",q,G,J],et="start",en="viewport",er="popper",eo=ee.reduce(function(e,t){return e.concat([t+"-"+et,t+"-end"])},[]),ea=[].concat(ee,[Q]).reduce(function(e,t){return e.concat([t,t+"-"+et,t+"-end"])},[]),ei=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function es(e){return e.split("-")[1]}var el={top:"auto",right:"auto",bottom:"auto",left:"auto"};function eu(e){var t,n,r,o,a,i,s,l=e.popper,u=e.popperRect,f=e.placement,c=e.variation,d=e.offsets,p=e.position,h=e.gpuAcceleration,m=e.adaptive,v=e.roundOffsets,g=e.isFixed,y=d.x,b=void 0===y?0:y,x=d.y,w=void 0===x?0:x,O="function"==typeof v?v({x:b,y:w}):{x:b,y:w};b=O.x,w=O.y;var E=d.hasOwnProperty("x"),j=d.hasOwnProperty("y"),D=J,S="top",N=window;if(m){var Z=U(l),P="clientHeight",T="clientWidth";Z===C(l)&&"static"!==F(Z=W(l)).position&&"absolute"===p&&(P="scrollHeight",T="scrollWidth"),("top"===f||(f===J||f===G)&&"end"===c)&&(S=q,w-=(g&&Z===N&&N.visualViewport?N.visualViewport.height:Z[P])-u.height,w*=h?1:-1),(f===J||("top"===f||f===q)&&"end"===c)&&(D=G,b-=(g&&Z===N&&N.visualViewport?N.visualViewport.width:Z[T])-u.width,b*=h?1:-1)}var k=Object.assign({position:p},m&&el),R=!0===v?(t={x:b,y:w},n=C(l),r=t.x,o=t.y,{x:M(r*(a=n.devicePixelRatio||1))/a||0,y:M(o*a)/a||0}):{x:b,y:w};return(b=R.x,w=R.y,h)?Object.assign({},k,((s={})[S]=j?"0":"",s[D]=E?"0":"",s.transform=1>=(N.devicePixelRatio||1)?"translate("+b+"px, "+w+"px)":"translate3d("+b+"px, "+w+"px, 0)",s)):Object.assign({},k,((i={})[S]=j?w+"px":"",i[D]=E?b+"px":"",i.transform="",i))}var ef={passive:!0},ec={left:"right",right:"left",bottom:"top",top:"bottom"};function ed(e){return e.replace(/left|right|bottom|top/g,function(e){return ec[e]})}var ep={start:"end",end:"start"};function eh(e){return e.replace(/start|end/g,function(e){return ep[e]})}function em(e){var t=C(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function ev(e){return $(W(e)).left+em(e).scrollLeft}function eg(e){var t=F(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function ey(e,t){void 0===t&&(t=[]);var n,r=function e(t){return["html","body","#document"].indexOf(I(t))>=0?t.ownerDocument.body:Z(t)&&eg(t)?t:e(B(t))}(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),a=C(r),i=o?[a].concat(a.visualViewport||[],eg(r)?r:[]):r,s=t.concat(i);return o?s:s.concat(ey(B(i)))}function eb(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function ex(e,t,n){var r,o,a,i,s,l,u,f,c,d;return t===en?eb(function(e,t){var n=C(e),r=W(e),o=n.visualViewport,a=r.clientWidth,i=r.clientHeight,s=0,l=0;if(o){a=o.width,i=o.height;var u=A();(u||!u&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:a,height:i,x:s+ev(e),y:l}}(e,n)):N(t)?((r=$(t,!1,"fixed"===n)).top=r.top+t.clientTop,r.left=r.left+t.clientLeft,r.bottom=r.top+t.clientHeight,r.right=r.left+t.clientWidth,r.width=t.clientWidth,r.height=t.clientHeight,r.x=r.left,r.y=r.top,r):eb((o=W(e),i=W(o),s=em(o),l=null==(a=o.ownerDocument)?void 0:a.body,u=T(i.scrollWidth,i.clientWidth,l?l.scrollWidth:0,l?l.clientWidth:0),f=T(i.scrollHeight,i.clientHeight,l?l.scrollHeight:0,l?l.clientHeight:0),c=-s.scrollLeft+ev(o),d=-s.scrollTop,"rtl"===F(l||i).direction&&(c+=T(i.clientWidth,l?l.clientWidth:0)-u),{width:u,height:f,x:c,y:d}))}function ew(e){var t,n=e.reference,r=e.element,o=e.placement,a=o?S(o):null,i=o?es(o):null,s=n.x+n.width/2-r.width/2,l=n.y+n.height/2-r.height/2;switch(a){case"top":t={x:s,y:n.y-r.height};break;case q:t={x:s,y:n.y+n.height};break;case G:t={x:n.x+n.width,y:l};break;case J:t={x:n.x-r.width,y:l};break;default:t={x:n.x,y:n.y}}var u=a?X(a):null;if(null!=u){var f="y"===u?"height":"width";switch(i){case et:t[u]=t[u]-(n[f]/2-r[f]/2);break;case"end":t[u]=t[u]+(n[f]/2-r[f]/2)}}return t}function eO(e,t){void 0===t&&(t={});var n,r,o,a,i,s,l,u=t,f=u.placement,c=void 0===f?e.placement:f,d=u.strategy,p=void 0===d?e.strategy:d,h=u.boundary,m=u.rootBoundary,v=u.elementContext,g=void 0===v?er:v,y=u.altBoundary,b=u.padding,x=void 0===b?0:b,w=K("number"!=typeof x?x:z(x,ee)),O=e.rects.popper,E=e.elements[void 0!==y&&y?g===er?"reference":er:g],j=(n=N(E)?E:E.contextElement||W(e.elements.popper),s=(i=[].concat("clippingParents"===(r=void 0===h?"clippingParents":h)?(o=ey(B(n)),N(a=["absolute","fixed"].indexOf(F(n).position)>=0&&Z(n)?U(n):n)?o.filter(function(e){return N(e)&&_(e,a)&&"body"!==I(e)}):[]):[].concat(r),[void 0===m?en:m]))[0],(l=i.reduce(function(e,t){var r=ex(n,t,p);return e.top=T(r.top,e.top),e.right=k(r.right,e.right),e.bottom=k(r.bottom,e.bottom),e.left=T(r.left,e.left),e},ex(n,s,p))).width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l),D=$(e.elements.reference),S=ew({reference:D,element:O,strategy:"absolute",placement:c}),C=eb(Object.assign({},O,S)),P=g===er?C:D,M={top:j.top-P.top+w.top,bottom:P.bottom-j.bottom+w.bottom,left:j.left-P.left+w.left,right:P.right-j.right+w.right},R=e.modifiersData.offset;if(g===er&&R){var A=R[c];Object.keys(M).forEach(function(e){var t=[G,q].indexOf(e)>=0?1:-1,n=["top",q].indexOf(e)>=0?"y":"x";M[e]+=A[n]*t})}return M}function eE(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function ej(e){return["top",G,q,J].some(function(t){return e[t]>=0})}var eD={placement:"bottom",modifiers:[],strategy:"absolute"};function eS(){for(var e=arguments.length,t=Array(e),n=0;n=0?-1:1,l=(s="function"==typeof a?a(Object.assign({},r,{placement:n})):a)[0],u=s[1],l=l||0,u=(u||0)*i,[J,G].indexOf(o)>=0?{x:u,y:l}:{x:l,y:u}),e},{}),s=i[t.placement],l=s.x,u=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=i}},{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,a=void 0===o||o,i=n.altAxis,s=void 0===i||i,l=n.fallbackPlacements,u=n.padding,f=n.boundary,c=n.rootBoundary,d=n.altBoundary,p=n.flipVariations,h=void 0===p||p,m=n.allowedAutoPlacements,v=t.options.placement,g=S(v)===v,y=l||(g||!h?[ed(v)]:function(e){if(S(e)===Q)return[];var t=ed(e);return[eh(e),t,eh(t)]}(v)),b=[v].concat(y).reduce(function(e,n){var r,o,a,i,s,l,d,p,v,g,y,b;return e.concat(S(n)===Q?(o=(r={placement:n,boundary:f,rootBoundary:c,padding:u,flipVariations:h,allowedAutoPlacements:m}).placement,a=r.boundary,i=r.rootBoundary,s=r.padding,l=r.flipVariations,p=void 0===(d=r.allowedAutoPlacements)?ea:d,0===(y=(g=(v=es(o))?l?eo:eo.filter(function(e){return es(e)===v}):ee).filter(function(e){return p.indexOf(e)>=0})).length&&(y=g),Object.keys(b=y.reduce(function(e,n){return e[n]=eO(t,{placement:n,boundary:a,rootBoundary:i,padding:s})[S(n)],e},{})).sort(function(e,t){return b[e]-b[t]})):n)},[]),x=t.rects.reference,w=t.rects.popper,O=new Map,E=!0,j=b[0],D=0;D=0,T=P?"width":"height",k=eO(t,{placement:C,boundary:f,rootBoundary:c,altBoundary:d,padding:u}),M=P?Z?G:J:Z?q:"top";x[T]>w[T]&&(M=ed(M));var R=ed(M),A=[];if(a&&A.push(k[N]<=0),s&&A.push(k[M]<=0,k[R]<=0),A.every(function(e){return e})){j=C,E=!1;break}O.set(C,A)}if(E)for(var $=h?3:1,L=function(e){var t=b.find(function(t){var n=O.get(t);if(n)return n.slice(0,e).every(function(e){return e})});if(t)return j=t,"break"},_=$;_>0&&"break"!==L(_);_--);t.placement!==j&&(t.modifiersData[r]._skip=!0,t.placement=j,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,a=n.altAxis,i=n.boundary,s=n.rootBoundary,l=n.altBoundary,u=n.padding,f=n.tether,c=void 0===f||f,d=n.tetherOffset,p=void 0===d?0:d,h=eO(t,{boundary:i,rootBoundary:s,padding:u,altBoundary:l}),m=S(t.placement),v=es(t.placement),g=!v,y=X(m),b="x"===y?"y":"x",x=t.modifiersData.popperOffsets,w=t.rects.reference,O=t.rects.popper,E="function"==typeof p?p(Object.assign({},t.rects,{placement:t.placement})):p,j="number"==typeof E?{mainAxis:E,altAxis:E}:Object.assign({mainAxis:0,altAxis:0},E),D=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,C={x:0,y:0};if(x){if(void 0===o||o){var N,Z="y"===y?"top":J,P="y"===y?q:G,M="y"===y?"height":"width",R=x[y],A=R+h[Z],$=R-h[P],_=c?-O[M]/2:0,I=v===et?w[M]:O[M],F=v===et?-O[M]:-w[M],W=t.elements.arrow,B=c&&W?L(W):{width:0,height:0},H=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Y(),K=H[Z],z=H[P],Q=V(0,w[M],B[M]),ee=g?w[M]/2-_-Q-K-j.mainAxis:I-Q-K-j.mainAxis,en=g?-w[M]/2+_+Q+z+j.mainAxis:F+Q+z+j.mainAxis,er=t.elements.arrow&&U(t.elements.arrow),eo=er?"y"===y?er.clientTop||0:er.clientLeft||0:0,ea=null!=(N=null==D?void 0:D[y])?N:0,ei=V(c?k(A,R+ee-ea-eo):A,R,c?T($,R+en-ea):$);x[y]=ei,C[y]=ei-R}if(void 0!==a&&a){var el,eu,ef="x"===y?"top":J,ec="x"===y?q:G,ed=x[b],ep="y"===b?"height":"width",eh=ed+h[ef],em=ed-h[ec],ev=-1!==["top",J].indexOf(m),eg=null!=(eu=null==D?void 0:D[b])?eu:0,ey=ev?eh:ed-w[ep]-O[ep]-eg+j.altAxis,eb=ev?ed+w[ep]+O[ep]-eg-j.altAxis:em,ex=c&&ev?(el=V(ey,ed,eb))>eb?eb:el:V(c?ey:eh,ed,c?eb:em);x[b]=ex,C[b]=ex-ed}t.modifiersData[r]=C}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n,r=e.state,o=e.name,a=e.options,i=r.elements.arrow,s=r.modifiersData.popperOffsets,l=S(r.placement),u=X(l),f=[J,G].indexOf(l)>=0?"height":"width";if(i&&s){var c=K("number"!=typeof(t="function"==typeof(t=a.padding)?t(Object.assign({},r.rects,{placement:r.placement})):t)?t:z(t,ee)),d=L(i),p="y"===u?"top":J,h="y"===u?q:G,m=r.rects.reference[f]+r.rects.reference[u]-s[u]-r.rects.popper[f],v=s[u]-r.rects.reference[u],g=U(i),y=g?"y"===u?g.clientHeight||0:g.clientWidth||0:0,b=c[p],x=y-d[f]-c[h],w=y/2-d[f]/2+(m/2-v/2),O=V(b,w,x);r.modifiersData[o]=((n={})[u]=O,n.centerOffset=O-w,n)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&_(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]}]}).defaultModifiers)?[]:o,s=void 0===(i=r.defaultOptions)?eD:i,function(e,t,n){void 0===n&&(n=s);var r,o={placement:"bottom",orderedModifiers:[],options:Object.assign({},eD,s),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},i=[],l=!1,u={state:o,setOptions:function(n){var r,l,c,d,p,h="function"==typeof n?n(o.options):n;f(),o.options=Object.assign({},s,o.options,h),o.scrollParents={reference:N(e)?ey(e):e.contextElement?ey(e.contextElement):[],popper:ey(t)};var m=(l=Object.keys(r=[].concat(a,o.options.modifiers).reduce(function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e},{})).map(function(e){return r[e]}),c=new Map,d=new Set,p=[],l.forEach(function(e){c.set(e.name,e)}),l.forEach(function(e){d.has(e.name)||function e(t){d.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach(function(t){if(!d.has(t)){var n=c.get(t);n&&e(n)}}),p.push(t)}(e)}),ei.reduce(function(e,t){return e.concat(p.filter(function(e){return e.phase===t}))},[]));return o.orderedModifiers=m.filter(function(e){return e.enabled}),o.orderedModifiers.forEach(function(e){var t=e.name,n=e.options,r=e.effect;if("function"==typeof r){var a=r({state:o,name:t,instance:u,options:void 0===n?{}:n});i.push(a||function(){})}}),u.update()},forceUpdate:function(){if(!l){var e,t,n,r,a,i,s,f,c,d,p,h,m=o.elements,v=m.reference,g=m.popper;if(eS(v,g)){o.rects={reference:(t=U(g),n="fixed"===o.options.strategy,r=Z(t),f=Z(t)&&(i=M((a=t.getBoundingClientRect()).width)/t.offsetWidth||1,s=M(a.height)/t.offsetHeight||1,1!==i||1!==s),c=W(t),d=$(v,f,n),p={scrollLeft:0,scrollTop:0},h={x:0,y:0},(r||!r&&!n)&&(("body"!==I(t)||eg(c))&&(p=(e=t)!==C(e)&&Z(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:em(e)),Z(t)?(h=$(t,!0),h.x+=t.clientLeft,h.y+=t.clientTop):c&&(h.x=ev(c))),{x:d.left+p.scrollLeft-h.x,y:d.top+p.scrollTop-h.y,width:d.width,height:d.height}),popper:L(g)},o.reset=!1,o.placement=o.options.placement,o.orderedModifiers.forEach(function(e){return o.modifiersData[e.name]=Object.assign({},e.data)});for(var y=0;yvoid 0},eP={name:"ariaDescribedBy",enabled:!0,phase:"afterWrite",effect:({state:e})=>()=>{let{reference:t,popper:n}=e.elements;if("removeAttribute"in t){let e=(t.getAttribute("aria-describedby")||"").split(",").filter(e=>e.trim()!==n.id);e.length?t.setAttribute("aria-describedby",e.join(",")):t.removeAttribute("aria-describedby")}},fn:({state:e})=>{var t;let{popper:n,reference:r}=e.elements,o=null==(t=n.getAttribute("role"))?void 0:t.toLowerCase();if(n.id&&"tooltip"===o&&"setAttribute"in r){let e=r.getAttribute("aria-describedby");if(e&&-1!==e.split(",").indexOf(n.id))return;r.setAttribute("aria-describedby",e?`${e},${n.id}`:n.id)}}},eT=[];var ek=function(e,t,n={}){let{enabled:r=!0,placement:o="bottom",strategy:a="absolute",modifiers:i=eT}=n,s=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(n,eN),l=(0,c.useRef)(i),u=(0,c.useRef)(),f=(0,c.useCallback)(()=>{var e;null==(e=u.current)||e.update()},[]),d=(0,c.useCallback)(()=>{var e;null==(e=u.current)||e.forceUpdate()},[]),[p,h]=D((0,c.useState)({placement:o,update:f,forceUpdate:d,attributes:{},styles:{popper:{},arrow:{}}})),m=(0,c.useMemo)(()=>({name:"updateStateModifier",enabled:!0,phase:"write",requires:["computeStyles"],fn:({state:e})=>{let t={},n={};Object.keys(e.elements).forEach(r=>{t[r]=e.styles[r],n[r]=e.attributes[r]}),h({state:e,styles:t,attributes:n,update:f,forceUpdate:d,placement:e.placement})}}),[f,d,h]),v=(0,c.useMemo)(()=>(E(l.current,i)||(l.current=i),l.current),[i]);return(0,c.useEffect)(()=>{u.current&&r&&u.current.setOptions({placement:o,strategy:a,modifiers:[...v,m,eZ]})},[a,o,m,r,v]),(0,c.useEffect)(()=>{if(r&&null!=e&&null!=t)return u.current=eC(e,t,Object.assign({},s,{placement:o,strategy:a,modifiers:[...v,eP,m]})),()=>{null!=u.current&&(u.current.destroy(),u.current=void 0,h(e=>Object.assign({},e,{attributes:{},styles:{popper:{}}})))}},[r,e,t]),p},eM=n(7937),eR=n(8342),eA=n(6575);let e$=()=>{},eL=e=>e&&("current"in e?e.current:e),e_={click:"mousedown",mouseup:"mousedown",pointerup:"pointerdown"};var eI=function(e,t=e$,{disabled:n,clickTrigger:r="click"}={}){let o=(0,c.useRef)(!1),a=(0,c.useRef)(!1),i=(0,c.useCallback)(t=>{let n=eL(e);h()(!!n,"ClickOutside captured a close event but does not have a ref to compare it to. useClickOutside(), should be passed a ref that resolves to a DOM node"),o.current=!n||!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)||0!==t.button||!!(0,l.Z)(n,t.target)||a.current,a.current=!1},[e]),s=(0,eA.Z)(t=>{let n=eL(e);n&&(0,l.Z)(n,t.target)&&(a.current=!0)}),u=(0,eA.Z)(e=>{o.current||t(e)});(0,c.useEffect)(()=>{var t,o;if(n||null==e)return;let a=(0,eR.Z)(eL(e)),l=a.defaultView||window,f=null!=(t=l.event)?t:null==(o=l.parent)?void 0:o.event,c=null;e_[r]&&(c=(0,eM.Z)(a,e_[r],s,!0));let d=(0,eM.Z)(a,r,i,!0),p=(0,eM.Z)(a,r,e=>{if(e===f){f=void 0;return}u(e)}),h=[];return"ontouchstart"in a.documentElement&&(h=[].slice.call(a.body.children).map(e=>(0,eM.Z)(e,"mousemove",e$))),()=>{null==c||c(),d(),p(),h.forEach(e=>e())}},[e,n,r,i,s,u])},eF=n(663);let eW=()=>{};var eB=function(e,t,{disabled:n,clickTrigger:r}={}){let o=t||eW;eI(e,o,{disabled:n,clickTrigger:r});let a=(0,eA.Z)(e=>{(0,eF.k)(e)&&o(e)});(0,c.useEffect)(()=>{if(n||null==e)return;let t=(0,eR.Z)(eL(e)),r=(t.defaultView||window).event,o=(0,eM.Z)(t,"keyup",e=>{if(e===r){r=void 0;return}a(e)});return()=>{o()}},[e,n,a])},eH=n(8821),eU=n(3774);let eX=c.forwardRef((e,t)=>{let{flip:n,offset:r,placement:o,containerPadding:a,popperConfig:i={},transition:s,runTransition:l}=e,[u,f]=(0,x.Z)(),[d,p]=(0,x.Z)(),h=(0,v.Z)(f,t),m=(0,eH.Z)(e.container),g=(0,eH.Z)(e.target),[y,w]=(0,c.useState)(!e.show),O=ek(g,u,function({enabled:e,enableEvents:t,placement:n,flip:r,offset:o,fixed:a,containerPadding:i,arrowElement:s,popperConfig:l={}}){var u,f,c,d,p;let h=function(e){let t={};return Array.isArray(e)?(null==e||e.forEach(e=>{t[e.name]=e}),t):e||t}(l.modifiers);return Object.assign({},l,{placement:n,enabled:e,strategy:a?"fixed":l.strategy,modifiers:function(e={}){return Array.isArray(e)?e:Object.keys(e).map(t=>(e[t].name=t,e[t]))}(Object.assign({},h,{eventListeners:{enabled:t,options:null==(u=h.eventListeners)?void 0:u.options},preventOverflow:Object.assign({},h.preventOverflow,{options:i?Object.assign({padding:i},null==(f=h.preventOverflow)?void 0:f.options):null==(c=h.preventOverflow)?void 0:c.options}),offset:{options:Object.assign({offset:o},null==(d=h.offset)?void 0:d.options)},arrow:Object.assign({},h.arrow,{enabled:!!s,options:Object.assign({},null==(p=h.arrow)?void 0:p.options,{element:s})}),flip:Object.assign({enabled:!!r},h.flip)}))})}({placement:o,enableEvents:!!e.show,containerPadding:a||5,flip:n,offset:r,arrowElement:d,popperConfig:i}));e.show&&y&&w(!1);let E=e.show||!y;if(eB(u,e.onHide,{disabled:!e.rootClose||e.rootCloseDisabled,clickTrigger:e.rootCloseEvent}),!E)return null;let{onExit:j,onExiting:D,onEnter:S,onEntering:C,onEntered:N}=e,Z=e.children(Object.assign({},O.attributes.popper,{style:O.styles.popper,ref:h}),{popper:O,placement:o,show:!!e.show,arrowProps:Object.assign({},O.attributes.arrow,{style:O.styles.arrow,ref:p})});return Z=(0,eU.sD)(s,l,{in:!!e.show,appear:!0,mountOnEnter:!0,unmountOnExit:!0,children:Z,onExit:j,onExiting:D,onExited:(...t)=>{w(!0),e.onExited&&e.onExited(...t)},onEnter:S,onEntering:C,onEntered:N}),m?b.createPortal(Z,m):null});eX.displayName="Overlay";var eV=n(6160),eY=n(9523),eK=n(1835),ez=n(239),eq=n(3163),eG=n(1231),eJ=n(1527);let eQ=c.forwardRef(({bsPrefix:e,placement:t="right",className:n,style:r,children:o,arrowProps:a,hasDoneInitialMeasure:i,popper:s,show:l,...u},f)=>{e=(0,eK.vE)(e,"tooltip");let c=(0,eK.SC)(),[d]=(null==t?void 0:t.split("-"))||[],p=(0,eq.z)(d,c),h=r;return l&&!i&&(h={...r,...(0,eG.Z)(null==s?void 0:s.strategy)}),(0,eJ.jsxs)("div",{ref:f,style:h,role:"tooltip","x-placement":d,className:y()(n,e,`bs-tooltip-${p}`),...u,children:[(0,eJ.jsx)("div",{className:"tooltip-arrow",...a}),(0,eJ.jsx)("div",{className:`${e}-inner`,children:o})]})});eQ.displayName="Tooltip";var e0=Object.assign(eQ,{TOOLTIP_OFFSET:[0,6]}),e1=n(5216),e5=n(7385);let e2=c.forwardRef(({children:e,transition:t=e1.Z,popperConfig:n={},rootClose:r=!1,placement:o="top",show:a=!1,...i},s)=>{let l=(0,c.useRef)({}),[u,f]=(0,c.useState)(null),[d,p]=function(e){let t=(0,c.useRef)(null),n=(0,eK.vE)(void 0,"popover"),r=(0,eK.vE)(void 0,"tooltip"),o=(0,c.useMemo)(()=>({name:"offset",options:{offset:()=>{if(e)return e;if(t.current){if((0,eY.Z)(t.current,n))return ez.Z.POPPER_OFFSET;if((0,eY.Z)(t.current,r))return e0.TOOLTIP_OFFSET}return[0,0]}}}),[e,n,r]);return[t,[o]]}(i.offset),h=(0,v.Z)(s,d),m=!0===t?e1.Z:t||void 0,g=(0,eA.Z)(e=>{f(e),null==n||null==n.onFirstUpdate||n.onFirstUpdate(e)});return(0,eV.Z)(()=>{u&&i.target&&(null==l.current.scheduleUpdate||l.current.scheduleUpdate())},[u,i.target]),(0,c.useEffect)(()=>{a||f(null)},[a]),(0,eJ.jsx)(eX,{...i,ref:h,popperConfig:{...n,modifiers:p.concat(n.modifiers||[]),onFirstUpdate:g},transition:m,rootClose:r,placement:o,show:a,children:(r,{arrowProps:o,popper:a,show:i})=>{var s,f;!function(e,t){let{ref:n}=e,{ref:r}=t;e.ref=n.__wrapped||(n.__wrapped=e=>n((0,e5.Z)(e))),t.ref=r.__wrapped||(r.__wrapped=e=>r((0,e5.Z)(e)))}(r,o);let d=null==a?void 0:a.placement,p=Object.assign(l.current,{state:null==a?void 0:a.state,scheduleUpdate:null==a?void 0:a.update,placement:d,outOfBoundaries:(null==a?void 0:null==(s=a.state)?void 0:null==(f=s.modifiersData.hide)?void 0:f.isReferenceHidden)||!1,strategy:n.strategy}),h=!!u;return"function"==typeof e?e({...r,placement:d,show:i,...!t&&i&&{className:"show"},popper:p,arrowProps:o,hasDoneInitialMeasure:h}):c.cloneElement(e,{...r,placement:d,arrowProps:o,popper:p,hasDoneInitialMeasure:h,className:y()(e.props.className,!t&&i&&"show"),style:{...e.props.style,...r.style}})}})});function e9(e,t,n){let[r]=t,o=r.currentTarget,a=r.relatedTarget||r.nativeEvent[n];a&&a===o||(0,l.Z)(o,a)||e(...t)}e2.displayName="Overlay",f().oneOf(["click","hover","focus"]);var e3=({trigger:e=["hover","focus"],overlay:t,children:n,popperConfig:r={},show:o,defaultShow:a=!1,onToggle:i,delay:s,placement:l,flip:u=l&&-1!==l.indexOf("auto"),...f})=>{let p=(0,c.useRef)(null),h=(0,v.Z)(p,n.ref),g=(0,d.Z)(),y=(0,c.useRef)(""),[b,x]=(0,m.$c)(o,a,i),w=s&&"object"==typeof s?s:{show:s,hide:s},{onFocus:O,onBlur:E,onClick:j}="function"!=typeof n?c.Children.only(n).props:{},D=(0,c.useCallback)(()=>{if(g.clear(),y.current="show",!w.show){x(!0);return}g.set(()=>{"show"===y.current&&x(!0)},w.show)},[w.show,x,g]),S=(0,c.useCallback)(()=>{if(g.clear(),y.current="hide",!w.hide){x(!1);return}g.set(()=>{"hide"===y.current&&x(!1)},w.hide)},[w.hide,x,g]),C=(0,c.useCallback)((...e)=>{D(),null==O||O(...e)},[D,O]),N=(0,c.useCallback)((...e)=>{S(),null==E||E(...e)},[S,E]),Z=(0,c.useCallback)((...e)=>{x(!b),null==j||j(...e)},[j,x,b]),P=(0,c.useCallback)((...e)=>{e9(D,e,"fromElement")},[D]),T=(0,c.useCallback)((...e)=>{e9(S,e,"toElement")},[S]),k=null==e?[]:[].concat(e),M={ref:e=>{h((0,e5.Z)(e))}};return -1!==k.indexOf("click")&&(M.onClick=Z),-1!==k.indexOf("focus")&&(M.onFocus=C,M.onBlur=N),-1!==k.indexOf("hover")&&(M.onMouseOver=P,M.onMouseOut=T),(0,eJ.jsxs)(eJ.Fragment,{children:["function"==typeof n?n(M):(0,c.cloneElement)(n,M),(0,eJ.jsx)(e2,{...f,show:b,onHide:S,flip:u,placement:l,popperConfig:r,target:p.current,children:t})]})}},239:function(e,t,n){n.d(t,{Z:function(){return d}});var r=n(2187),o=n.n(r),a=n(959),i=n(1835),s=n(1527);let l=a.forwardRef(({className:e,bsPrefix:t,as:n="div",...r},a)=>(t=(0,i.vE)(t,"popover-header"),(0,s.jsx)(n,{ref:a,className:o()(e,t),...r})));l.displayName="PopoverHeader";let u=a.forwardRef(({className:e,bsPrefix:t,as:n="div",...r},a)=>(t=(0,i.vE)(t,"popover-body"),(0,s.jsx)(n,{ref:a,className:o()(e,t),...r})));u.displayName="PopoverBody";var f=n(3163),c=n(1231),d=Object.assign(a.forwardRef(({bsPrefix:e,placement:t="right",className:n,style:r,children:a,body:l,arrowProps:d,hasDoneInitialMeasure:p,popper:h,show:m,...v},g)=>{let y=(0,i.vE)(e,"popover"),b=(0,i.SC)(),[x]=(null==t?void 0:t.split("-"))||[],w=(0,f.z)(x,b),O=r;return m&&!p&&(O={...r,...(0,c.Z)(null==h?void 0:h.strategy)}),(0,s.jsxs)("div",{ref:g,role:"tooltip",style:O,"x-placement":x,className:o()(n,y,x&&`bs-popover-${w}`),...v,children:[(0,s.jsx)("div",{className:"popover-arrow",...d}),l?(0,s.jsx)(u,{children:a}):a]})}),{Header:l,Body:u,POPPER_OFFSET:[0,8]})},2251:function(e,t,n){var r=n(2187),o=n.n(r),a=n(959),i=n(1835),s=n(1527);let l=a.forwardRef(({bsPrefix:e,className:t,as:n="div",...r},a)=>{let l=(0,i.vE)(e,"row"),u=(0,i.pi)(),f=(0,i.zG)(),c=`${l}-cols`,d=[];return u.forEach(e=>{let t;let n=r[e];delete r[e],null!=n&&"object"==typeof n?{cols:t}=n:t=n;let o=e!==f?`-${e}`:"";null!=t&&d.push(`${c}${o}-${t}`)}),(0,s.jsx)(n,{ref:a,...r,className:o()(t,l,...d)})});l.displayName="Row",t.Z=l},9599:function(e,t,n){var r=n(2187),o=n.n(r),a=n(959),i=n(1835),s=n(1527);let l=a.forwardRef(({bsPrefix:e,variant:t,animation:n="border",size:r,as:a="div",className:l,...u},f)=>{e=(0,i.vE)(e,"spinner");let c=`${e}-${n}`;return(0,s.jsx)(a,{ref:f,...u,className:o()(l,c,r&&`${c}-${r}`,t&&`text-${t}`)})});l.displayName="Spinner",t.Z=l},9205:function(e,t,n){n.d(t,{Z:function(){return p}});var r=n(507),o=n.n(r);n(959);var a=n(5616),i=n(7995),s=n(1527);let l=({transition:e,...t})=>(0,s.jsx)(a.Z,{...t,transition:(0,i.Z)(e)});l.displayName="TabContainer";var u=n(3622),f=n(2516);let c={eventKey:o().oneOfType([o().string,o().number]),title:o().node.isRequired,disabled:o().bool,tabClassName:o().string,tabAttrs:o().object},d=()=>{throw Error("ReactBootstrap: The `Tab` component is not meant to be rendered! It's an abstract component that is only valid as a direct Child of the `Tabs` Component. For custom tabs components use TabPane and TabsContainer directly")};d.propTypes=c;var p=Object.assign(d,{Container:l,Content:u.Z,Pane:f.Z})},3622:function(e,t,n){var r=n(959),o=n(2187),a=n.n(o),i=n(1835),s=n(1527);let l=r.forwardRef(({className:e,bsPrefix:t,as:n="div",...r},o)=>(t=(0,i.vE)(t,"tab-content"),(0,s.jsx)(n,{ref:o,className:a()(e,t),...r})));l.displayName="TabContent",t.Z=l},2516:function(e,t,n){var r=n(2187),o=n.n(r),a=n(959),i=n(3439),s=n(3503),l=n(7468),u=n(1835),f=n(5216),c=n(7995),d=n(1527);let p=a.forwardRef(({bsPrefix:e,transition:t,...n},r)=>{let[{className:a,as:p="div",...h},{isActive:m,onEnter:v,onEntering:g,onEntered:y,onExit:b,onExiting:x,onExited:w,mountOnEnter:O,unmountOnExit:E,transition:j=f.Z}]=(0,l.W)({...n,transition:(0,c.Z)(t)}),D=(0,u.vE)(e,"tab-pane");return(0,d.jsx)(s.Z.Provider,{value:null,children:(0,d.jsx)(i.Z.Provider,{value:null,children:(0,d.jsx)(j,{in:m,onEnter:v,onEntering:g,onEntered:y,onExit:b,onExiting:x,onExited:w,mountOnEnter:O,unmountOnExit:E,children:(0,d.jsx)(p,{...h,ref:r,className:o()(a,D,m&&"active")})})})})});p.displayName="TabPane",t.Z=p},2983:function(e,t,n){n(959);var r=n(7980),o=n(5616),a=n(1513),i=n(9898),s=n(378),l=n(3622),u=n(2516),f=n(222),c=n(7995),d=n(1527);function p(e){let{title:t,eventKey:n,disabled:r,tabClassName:o,tabAttrs:a,id:l}=e.props;return null==t?null:(0,d.jsx)(s.Z,{as:"li",role:"presentation",children:(0,d.jsx)(i.Z,{as:"button",type:"button",eventKey:n,disabled:r,id:l,className:o,...a,children:t})})}let h=e=>{let t;let{id:n,onSelect:i,transition:s,mountOnEnter:h=!1,unmountOnExit:m=!1,variant:v="tabs",children:g,activeKey:y=((0,f.Ed)(g,e=>{null==t&&(t=e.props.eventKey)}),t),...b}=(0,r.Ch)(e,{activeKey:"onSelect"});return(0,d.jsxs)(o.Z,{id:n,activeKey:y,onSelect:i,transition:(0,c.Z)(s),mountOnEnter:h,unmountOnExit:m,children:[(0,d.jsx)(a.Z,{...b,role:"tablist",as:"ul",variant:v,children:(0,f.UI)(g,p)}),(0,d.jsx)(l.Z,{children:(0,f.UI)(g,e=>{let t={...e.props};return delete t.title,delete t.disabled,delete t.tabClassName,delete t.tabAttrs,(0,d.jsx)(u.Z,{...t})})})]})};h.displayName="Tabs",t.Z=h},6904:function(e,t,n){n.d(t,{Z:function(){return x}});var r=n(959),o=n(2187),a=n.n(o),i=n(2447),s=n(3418),l=n(5216),u=n(1527);let f={[s.d0]:"showing",[s.Ix]:"showing show"},c=r.forwardRef((e,t)=>(0,u.jsx)(l.Z,{...e,ref:t,transitionClasses:f}));c.displayName="ToastFade";var d=c,p=n(6575),h=n(1835),m=n(5619);let v=r.createContext({onClose(){}}),g=r.forwardRef(({bsPrefix:e,closeLabel:t="Close",closeVariant:n,closeButton:o=!0,className:i,children:s,...l},f)=>{e=(0,h.vE)(e,"toast-header");let c=(0,r.useContext)(v),d=(0,p.Z)(e=>{null==c||null==c.onClose||c.onClose(e)});return(0,u.jsxs)("div",{ref:f,...l,className:a()(e,i),children:[s,o&&(0,u.jsx)(m.Z,{"aria-label":t,variant:n,onClick:d,"data-dismiss":"toast"})]})});g.displayName="ToastHeader";let y=r.forwardRef(({className:e,bsPrefix:t,as:n="div",...r},o)=>(t=(0,h.vE)(t,"toast-body"),(0,u.jsx)(n,{ref:o,className:a()(e,t),...r})));y.displayName="ToastBody";let b=r.forwardRef(({bsPrefix:e,className:t,transition:n=d,show:o=!0,animation:s=!0,delay:l=5e3,autohide:f=!1,onClose:c,onEntered:p,onExit:m,onExiting:g,onEnter:y,onEntering:b,onExited:x,bg:w,...O},E)=>{e=(0,h.vE)(e,"toast");let j=(0,r.useRef)(l),D=(0,r.useRef)(c);(0,r.useEffect)(()=>{j.current=l,D.current=c},[l,c]);let S=(0,i.Z)(),C=!!(f&&o),N=(0,r.useCallback)(()=>{C&&(null==D.current||D.current())},[C]);(0,r.useEffect)(()=>{S.set(N,j.current)},[S,N]);let Z=(0,r.useMemo)(()=>({onClose:c}),[c]),P=!!(n&&s),T=(0,u.jsx)("div",{...O,ref:E,className:a()(e,t,w&&`bg-${w}`,!P&&(o?"show":"hide")),role:"alert","aria-live":"assertive","aria-atomic":"true"});return(0,u.jsx)(v.Provider,{value:Z,children:P&&n?(0,u.jsx)(n,{in:o,onEnter:y,onEntering:b,onEntered:p,onExit:m,onExiting:g,onExited:x,unmountOnExit:!0,children:T}):T})});b.displayName="Toast";var x=Object.assign(b,{Body:y,Header:g})},1231:function(e,t,n){n.d(t,{Z:function(){return r}});function r(e="absolute"){return{position:e,top:"0",left:"0",opacity:"0",pointerEvents:"none"}}},7995:function(e,t,n){n.d(t,{Z:function(){return a}});var r=n(3233),o=n(5216);function a(e){return"boolean"==typeof e?e?o.Z:r.Z:e}},3163:function(e,t,n){function r(e,t){let n=e;return"left"===e?n=t?"end":"start":"right"===e&&(n=t?"start":"end"),n}n.d(t,{z:function(){return r}}),n(959)},2537:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"DraggableCore",{enumerable:!0,get:function(){return f.default}}),t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=p(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(959)),o=d(n(507)),a=d(n(422)),i=d(n(5924)),s=n(6843),l=n(8260),u=n(1794),f=d(n(6921)),c=d(n(556));function d(e){return e&&e.__esModule?e:{default:e}}function p(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(p=function(e){return e?n:t})(e)}function h(){return(h=Object.assign?Object.assign.bind():function(e){for(var t=1;t{if((0,c.default)("Draggable: onDragStart: %j",t),!1===this.props.onStart(e,(0,l.createDraggableData)(this,t)))return!1;this.setState({dragging:!0,dragged:!0})}),m(this,"onDrag",(e,t)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",t);let n=(0,l.createDraggableData)(this,t),r={x:n.x,y:n.y,slackX:0,slackY:0};if(this.props.bounds){let{x:e,y:t}=r;r.x+=this.state.slackX,r.y+=this.state.slackY;let[o,a]=(0,l.getBoundPosition)(this,r.x,r.y);r.x=o,r.y=a,r.slackX=this.state.slackX+(e-r.x),r.slackY=this.state.slackY+(t-r.y),n.x=r.x,n.y=r.y,n.deltaX=r.x-this.state.x,n.deltaY=r.y-this.state.y}if(!1===this.props.onDrag(e,n))return!1;this.setState(r)}),m(this,"onDragStop",(e,t)=>{if(!this.state.dragging||!1===this.props.onStop(e,(0,l.createDraggableData)(this,t)))return!1;(0,c.default)("Draggable: onDragStop: %j",t);let n={dragging:!1,slackX:0,slackY:0};if(this.props.position){let{x:e,y:t}=this.props.position;n.x=e,n.y=t}this.setState(n)}),this.state={dragging:!1,dragged:!1,x:e.position?e.position.x:e.defaultPosition.x,y:e.position?e.position.y:e.defaultPosition.y,prevPropsPosition:{...e.position},slackX:0,slackY:0,isElementSVG:!1},e.position&&!(e.onDrag||e.onStop)&&console.warn("A `position` was applied to this , without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){void 0!==window.SVGElement&&this.findDOMNode() instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var e,t;return null!==(e=null===(t=this.props)||void 0===t||null===(t=t.nodeRef)||void 0===t?void 0:t.current)&&void 0!==e?e:a.default.findDOMNode(this)}render(){let{axis:e,bounds:t,children:n,defaultPosition:o,defaultClassName:a,defaultClassNameDragging:u,defaultClassNameDragged:c,position:d,positionOffset:p,scale:m,...v}=this.props,g={},y=null,b=!d||this.state.dragging,x=d||o,w={x:(0,l.canDragX)(this)&&b?this.state.x:x.x,y:(0,l.canDragY)(this)&&b?this.state.y:x.y};this.state.isElementSVG?y=(0,s.createSVGTransform)(w,p):g=(0,s.createCSSTransform)(w,p);let O=(0,i.default)(n.props.className||"",a,{[u]:this.state.dragging,[c]:this.state.dragged});return r.createElement(f.default,h({},v,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),r.cloneElement(r.Children.only(n),{className:O,style:{...n.props.style,...g},transform:y}))}}t.default=v,m(v,"displayName","Draggable"),m(v,"propTypes",{...f.default.propTypes,axis:o.default.oneOf(["both","x","y","none"]),bounds:o.default.oneOfType([o.default.shape({left:o.default.number,right:o.default.number,top:o.default.number,bottom:o.default.number}),o.default.string,o.default.oneOf([!1])]),defaultClassName:o.default.string,defaultClassNameDragging:o.default.string,defaultClassNameDragged:o.default.string,defaultPosition:o.default.shape({x:o.default.number,y:o.default.number}),positionOffset:o.default.shape({x:o.default.oneOfType([o.default.number,o.default.string]),y:o.default.oneOfType([o.default.number,o.default.string])}),position:o.default.shape({x:o.default.number,y:o.default.number}),className:u.dontSetMe,style:u.dontSetMe,transform:u.dontSetMe}),m(v,"defaultProps",{...f.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})},6921:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=c(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(959)),o=f(n(507)),a=f(n(422)),i=n(6843),s=n(8260),l=n(1794),u=f(n(556));function f(e){return e&&e.__esModule?e:{default:e}}function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(c=function(e){return e?n:t})(e)}function d(e,t,n){var r;return(t="symbol"==typeof(r=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?r:String(r))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let p={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}},h=p.mouse;class m extends r.Component{constructor(){super(...arguments),d(this,"dragging",!1),d(this,"lastX",NaN),d(this,"lastY",NaN),d(this,"touchIdentifier",null),d(this,"mounted",!1),d(this,"handleDragStart",e=>{if(this.props.onMouseDown(e),!this.props.allowAnyClick&&"number"==typeof e.button&&0!==e.button)return!1;let t=this.findDOMNode();if(!t||!t.ownerDocument||!t.ownerDocument.body)throw Error(" not mounted on DragStart!");let{ownerDocument:n}=t;if(this.props.disabled||!(e.target instanceof n.defaultView.Node)||this.props.handle&&!(0,i.matchesSelectorAndParentsTo)(e.target,this.props.handle,t)||this.props.cancel&&(0,i.matchesSelectorAndParentsTo)(e.target,this.props.cancel,t))return;"touchstart"===e.type&&e.preventDefault();let r=(0,i.getTouchIdentifier)(e);this.touchIdentifier=r;let o=(0,s.getControlPosition)(e,r,this);if(null==o)return;let{x:a,y:l}=o,f=(0,s.createCoreData)(this,a,l);(0,u.default)("DraggableCore: handleDragStart: %j",f),(0,u.default)("calling",this.props.onStart),!1!==this.props.onStart(e,f)&&!1!==this.mounted&&(this.props.enableUserSelectHack&&(0,i.addUserSelectStyles)(n),this.dragging=!0,this.lastX=a,this.lastY=l,(0,i.addEvent)(n,h.move,this.handleDrag),(0,i.addEvent)(n,h.stop,this.handleDragStop))}),d(this,"handleDrag",e=>{let t=(0,s.getControlPosition)(e,this.touchIdentifier,this);if(null==t)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX,t=r-this.lastY;if([e,t]=(0,s.snapToGrid)(this.props.grid,e,t),!e&&!t)return;n=this.lastX+e,r=this.lastY+t}let o=(0,s.createCoreData)(this,n,r);if((0,u.default)("DraggableCore: handleDrag: %j",o),!1===this.props.onDrag(e,o)||!1===this.mounted){try{this.handleDragStop(new MouseEvent("mouseup"))}catch(t){let e=document.createEvent("MouseEvents");e.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(e)}return}this.lastX=n,this.lastY=r}),d(this,"handleDragStop",e=>{if(!this.dragging)return;let t=(0,s.getControlPosition)(e,this.touchIdentifier,this);if(null==t)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX||0,t=r-this.lastY||0;[e,t]=(0,s.snapToGrid)(this.props.grid,e,t),n=this.lastX+e,r=this.lastY+t}let o=(0,s.createCoreData)(this,n,r);if(!1===this.props.onStop(e,o)||!1===this.mounted)return!1;let a=this.findDOMNode();a&&this.props.enableUserSelectHack&&(0,i.removeUserSelectStyles)(a.ownerDocument),(0,u.default)("DraggableCore: handleDragStop: %j",o),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&((0,u.default)("DraggableCore: Removing handlers"),(0,i.removeEvent)(a.ownerDocument,h.move,this.handleDrag),(0,i.removeEvent)(a.ownerDocument,h.stop,this.handleDragStop))}),d(this,"onMouseDown",e=>(h=p.mouse,this.handleDragStart(e))),d(this,"onMouseUp",e=>(h=p.mouse,this.handleDragStop(e))),d(this,"onTouchStart",e=>(h=p.touch,this.handleDragStart(e))),d(this,"onTouchEnd",e=>(h=p.touch,this.handleDragStop(e)))}componentDidMount(){this.mounted=!0;let e=this.findDOMNode();e&&(0,i.addEvent)(e,p.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;let e=this.findDOMNode();if(e){let{ownerDocument:t}=e;(0,i.removeEvent)(t,p.mouse.move,this.handleDrag),(0,i.removeEvent)(t,p.touch.move,this.handleDrag),(0,i.removeEvent)(t,p.mouse.stop,this.handleDragStop),(0,i.removeEvent)(t,p.touch.stop,this.handleDragStop),(0,i.removeEvent)(e,p.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,i.removeUserSelectStyles)(t)}}findDOMNode(){var e,t;return null!==(e=this.props)&&void 0!==e&&e.nodeRef?null===(t=this.props)||void 0===t||null===(t=t.nodeRef)||void 0===t?void 0:t.current:a.default.findDOMNode(this)}render(){return r.cloneElement(r.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}}t.default=m,d(m,"displayName","DraggableCore"),d(m,"propTypes",{allowAnyClick:o.default.bool,children:o.default.node.isRequired,disabled:o.default.bool,enableUserSelectHack:o.default.bool,offsetParent:function(e,t){if(e[t]&&1!==e[t].nodeType)throw Error("Draggable's offsetParent must be a DOM Node.")},grid:o.default.arrayOf(o.default.number),handle:o.default.string,cancel:o.default.string,nodeRef:o.default.object,onStart:o.default.func,onDrag:o.default.func,onStop:o.default.func,onMouseDown:o.default.func,scale:o.default.number,className:l.dontSetMe,style:l.dontSetMe,transform:l.dontSetMe}),d(m,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1})},6871:function(e,t,n){let{default:r,DraggableCore:o}=n(2537);e.exports=r,e.exports.default=r,e.exports.DraggableCore=o},6843:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.addClassName=u,t.addEvent=function(e,t,n,r){if(!e)return;let o={capture:!0,...r};e.addEventListener?e.addEventListener(t,n,o):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n},t.addUserSelectStyles=function(e){if(!e)return;let t=e.getElementById("react-draggable-style-el");t||((t=e.createElement("style")).type="text/css",t.id="react-draggable-style-el",t.innerHTML=".react-draggable-transparent-selection *::-moz-selection {all: inherit;}\n",t.innerHTML+=".react-draggable-transparent-selection *::selection {all: inherit;}\n",e.getElementsByTagName("head")[0].appendChild(t)),e.body&&u(e.body,"react-draggable-transparent-selection")},t.createCSSTransform=function(e,t){let n=l(e,t,"px");return{[(0,o.browserPrefixToKey)("transform",o.default)]:n}},t.createSVGTransform=function(e,t){return l(e,t,"")},t.getTouch=function(e,t){return e.targetTouches&&(0,r.findInArray)(e.targetTouches,e=>t===e.identifier)||e.changedTouches&&(0,r.findInArray)(e.changedTouches,e=>t===e.identifier)},t.getTouchIdentifier=function(e){return e.targetTouches&&e.targetTouches[0]?e.targetTouches[0].identifier:e.changedTouches&&e.changedTouches[0]?e.changedTouches[0].identifier:void 0},t.getTranslation=l,t.innerHeight=function(e){let t=e.clientHeight,n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,r.int)(n.paddingTop),t-=(0,r.int)(n.paddingBottom)},t.innerWidth=function(e){let t=e.clientWidth,n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,r.int)(n.paddingLeft),t-=(0,r.int)(n.paddingRight)},t.matchesSelector=s,t.matchesSelectorAndParentsTo=function(e,t,n){let r=e;do{if(s(r,t))return!0;if(r===n)break;r=r.parentNode}while(r);return!1},t.offsetXYFromParent=function(e,t,n){let r=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect();return{x:(e.clientX+t.scrollLeft-r.left)/n,y:(e.clientY+t.scrollTop-r.top)/n}},t.outerHeight=function(e){let t=e.clientHeight,n=e.ownerDocument.defaultView.getComputedStyle(e);return t+((0,r.int)(n.borderTopWidth)+(0,r.int)(n.borderBottomWidth))},t.outerWidth=function(e){let t=e.clientWidth,n=e.ownerDocument.defaultView.getComputedStyle(e);return t+((0,r.int)(n.borderLeftWidth)+(0,r.int)(n.borderRightWidth))},t.removeClassName=f,t.removeEvent=function(e,t,n,r){if(!e)return;let o={capture:!0,...r};e.removeEventListener?e.removeEventListener(t,n,o):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null},t.removeUserSelectStyles=function(e){if(e)try{if(e.body&&f(e.body,"react-draggable-transparent-selection"),e.selection)e.selection.empty();else{let t=(e.defaultView||window).getSelection();t&&"Caret"!==t.type&&t.removeAllRanges()}}catch(e){}};var r=n(1794),o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=a(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}(n(3266));function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(a=function(e){return e?n:t})(e)}let i="";function s(e,t){return i||(i=(0,r.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(t){return(0,r.isFunction)(e[t])})),!!(0,r.isFunction)(e[i])&&e[i](t)}function l(e,t,n){let{x:r,y:o}=e,a="translate(".concat(r).concat(n,",").concat(o).concat(n,")");if(t){let e="".concat("string"==typeof t.x?t.x:t.x+n),r="".concat("string"==typeof t.y?t.y:t.y+n);a="translate(".concat(e,", ").concat(r,")")+a}return a}function u(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function f(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}},3266:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.browserPrefixToKey=o,t.browserPrefixToStyle=function(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e},t.default=void 0,t.getPrefix=r;let n=["Moz","Webkit","O","ms"];function r(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"transform";if("undefined"==typeof window)return"";let r=null===(e=window.document)||void 0===e||null===(e=e.documentElement)||void 0===e?void 0:e.style;if(!r||t in r)return"";for(let e=0;e: Unmounted during event!");return t}},1794:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.dontSetMe=function(e,t,n){if(e[t])return Error("Invalid prop ".concat(t," passed to ").concat(n," - do not set this, set it on the child."))},t.findInArray=function(e,t){for(let n=0,r=e.length;n{let{operation:Z}=l.data;"disconnect"===Z&&"function"==typeof this.onWorkerDisconnect&&this.onWorkerDisconnect()}}clearWorker(){this.worker&&this.worker.postMessage({type:"clear"})}terminateWorker(){this.worker&&this.worker.terminate()}async init(){let{preKeyBundle:l}=await window.e2ee.init();return l}setupSenderTransform(l,Z){if(!this.worker)throw Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"encrypt",readableStream:l,writableStream:Z},[l,Z])}setupReceiverTransform(l,Z){if(!this.worker)throw Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"decrypt",readableStream:l,writableStream:Z},[l,Z])}postRemoteSecretKeyMaterials(l){if(!this.worker)throw Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"remoteSecretKeyMaterials",remoteSecretKeyMaterials:l.remoteSecretKeyMaterials})}postRemoveRemoteDeriveKey(l){if(!this.worker)throw Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"removeRemoteDeriveKey",connectionId:l})}postSelfSecretKeyMaterial(l,Z,c,b=0){if(!this.worker)throw Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"selfSecretKeyMaterial",selfConnectionId:l,selfKeyId:Z,selfSecretKeyMaterial:c,waitingTime:b})}startSession(l,Z){let[c,b]=window.e2ee.startSession(l,Z.identityKey,Z.signedPreKey,Z.preKeySignature);if(b)throw b;return c}stopSession(l){let[Z,c]=window.e2ee.stopSession(l);if(c)throw c;return Z}receiveMessage(l){let[Z,c]=window.e2ee.receiveMessage(l);if(c)throw c;return Z}start(l){let[Z,c]=window.e2ee.start(l);if(c)throw c;return Z}addPreKeyBundle(l,Z){let c=window.e2ee.addPreKeyBundle(l,Z.identityKey,Z.signedPreKey,Z.preKeySignature);if(c)throw c}selfFingerprint(){return window.e2ee.selfFingerprint()}remoteFingerprints(){return window.e2ee.remoteFingerprints()}static async loadWasm(l){if(window.e2ee,(()=>{if("undefined"!=typeof global);else if("undefined"!=typeof window)window.global=window;else if("undefined"!=typeof self)self.global=self;else throw Error("cannot export Go (neither global, window nor self is defined)");if(global.require||"undefined"==typeof require||(global.require=require),!global.fs&&global.require){let l=require("fs");0!==Object.keys(l)&&(global.fs=l)}let l=()=>{let l=Error("not implemented");return l.code="ENOSYS",l};if(!global.fs){let Z="";global.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(l,b){let d=(Z+=c.decode(b)).lastIndexOf("\n");return -1!=d&&(console.log(Z.substr(0,d)),Z=Z.substr(d+1)),b.length},write(Z,c,b,d,m,I){if(0!==b||d!==c.length||null!==m){I(l());return}I(null,this.writeSync(Z,c))},chmod(Z,c,b){b(l())},chown(Z,c,b,d){d(l())},close(Z,c){c(l())},fchmod(Z,c,b){b(l())},fchown(Z,c,b,d){d(l())},fstat(Z,c){c(l())},fsync(l,Z){Z(null)},ftruncate(Z,c,b){b(l())},lchown(Z,c,b,d){d(l())},link(Z,c,b){b(l())},lstat(Z,c){c(l())},mkdir(Z,c,b){b(l())},open(Z,c,b,d){d(l())},read(Z,c,b,d,m,I){I(l())},readdir(Z,c){c(l())},readlink(Z,c){c(l())},rename(Z,c,b){b(l())},rmdir(Z,c){c(l())},stat(Z,c){c(l())},symlink(Z,c,b){b(l())},truncate(Z,c,b){b(l())},unlink(Z,c){c(l())},utimes(Z,c,b,d){d(l())}}}if(global.process||(global.process={getuid:()=>-1,getgid:()=>-1,geteuid:()=>-1,getegid:()=>-1,getgroups(){throw l()},pid:-1,ppid:-1,umask(){throw l()},cwd(){throw l()},chdir(){throw l()}}),!global.crypto){let l=require("crypto");global.crypto={getRandomValues(Z){l.randomFillSync(Z)}}}global.performance||(global.performance={now(){let[l,Z]=m.hrtime();return 1e3*l+Z/1e6}}),global.TextEncoder||(global.TextEncoder=require("util").TextEncoder),global.TextDecoder||(global.TextDecoder=require("util").TextDecoder);let Z=new TextEncoder("utf-8"),c=new TextDecoder("utf-8");if(global.Go=class{constructor(){this.argv=["js"],this.env={},this.exit=l=>{0!==l&&console.warn("exit code:",l)},this._exitPromise=new Promise(l=>{this._resolveExitPromise=l}),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;let l=(l,Z)=>{this.mem.setUint32(l+0,Z,!0),this.mem.setUint32(l+4,Math.floor(Z/4294967296),!0)},b=l=>this.mem.getUint32(l+0,!0)+4294967296*this.mem.getInt32(l+4,!0),d=l=>{let Z=this.mem.getFloat64(l,!0);if(0===Z)return;if(!isNaN(Z))return Z;let c=this.mem.getUint32(l,!0);return this._values[c]},m=(l,Z)=>{if("number"==typeof Z&&0!==Z){if(isNaN(Z)){this.mem.setUint32(l+4,2146959360,!0),this.mem.setUint32(l,0,!0);return}this.mem.setFloat64(l,Z,!0);return}if(void 0===Z){this.mem.setFloat64(l,0,!0);return}let c=this._ids.get(Z);void 0===c&&(void 0===(c=this._idPool.pop())&&(c=this._values.length),this._values[c]=Z,this._goRefCounts[c]=0,this._ids.set(Z,c)),this._goRefCounts[c]++;let b=0;switch(typeof Z){case"object":null!==Z&&(b=1);break;case"string":b=2;break;case"symbol":b=3;break;case"function":b=4}this.mem.setUint32(l+4,2146959360|b,!0),this.mem.setUint32(l,c,!0)},I=l=>{let Z=b(l+0),c=b(l+8);return new Uint8Array(this._inst.exports.mem.buffer,Z,c)},W=l=>{let Z=b(l+0),c=b(l+8),m=Array(c);for(let l=0;l{let Z=b(l+0),d=b(l+8);return c.decode(new DataView(this._inst.exports.mem.buffer,Z,d))},i=Date.now()-performance.now();this.importObject={go:{"runtime.wasmExit":l=>{let Z=this.mem.getInt32(l+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(Z)},"runtime.wasmWrite":l=>{let Z=b(l+8),c=b(l+16),d=this.mem.getInt32(l+24,!0);fs.writeSync(Z,new Uint8Array(this._inst.exports.mem.buffer,c,d))},"runtime.resetMemoryDataView":l=>{this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":Z=>{l(Z+8,(i+performance.now())*1e6)},"runtime.walltime1":Z=>{let c=(new Date).getTime();l(Z+8,c/1e3),this.mem.setInt32(Z+16,c%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":l=>{let Z=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(Z,setTimeout(()=>{for(this._resume();this._scheduledTimeouts.has(Z);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()},b(l+8)+1)),this.mem.setInt32(l+16,Z,!0)},"runtime.clearTimeoutEvent":l=>{let Z=this.mem.getInt32(l+8,!0);clearTimeout(this._scheduledTimeouts.get(Z)),this._scheduledTimeouts.delete(Z)},"runtime.getRandomData":l=>{crypto.getRandomValues(I(l+8))},"syscall/js.finalizeRef":l=>{let Z=this.mem.getUint32(l+8,!0);if(this._goRefCounts[Z]--,0===this._goRefCounts[Z]){let l=this._values[Z];this._values[Z]=null,this._ids.delete(l),this._idPool.push(Z)}},"syscall/js.stringVal":l=>{m(l+24,V(l+8))},"syscall/js.valueGet":l=>{let Z=Reflect.get(d(l+8),V(l+16));m((l=this._inst.exports.getsp())+32,Z)},"syscall/js.valueSet":l=>{Reflect.set(d(l+8),V(l+16),d(l+32))},"syscall/js.valueDelete":l=>{Reflect.deleteProperty(d(l+8),V(l+16))},"syscall/js.valueIndex":l=>{m(l+24,Reflect.get(d(l+8),b(l+16)))},"syscall/js.valueSetIndex":l=>{Reflect.set(d(l+8),b(l+16),d(l+24))},"syscall/js.valueCall":l=>{try{let Z=d(l+8),c=Reflect.get(Z,V(l+16)),b=W(l+32),I=Reflect.apply(c,Z,b);l=this._inst.exports.getsp(),m(l+56,I),this.mem.setUint8(l+64,1)}catch(Z){m(l+56,Z),this.mem.setUint8(l+64,0)}},"syscall/js.valueInvoke":l=>{try{let Z=d(l+8),c=W(l+16),b=Reflect.apply(Z,void 0,c);l=this._inst.exports.getsp(),m(l+40,b),this.mem.setUint8(l+48,1)}catch(Z){m(l+40,Z),this.mem.setUint8(l+48,0)}},"syscall/js.valueNew":l=>{try{let Z=d(l+8),c=W(l+16),b=Reflect.construct(Z,c);l=this._inst.exports.getsp(),m(l+40,b),this.mem.setUint8(l+48,1)}catch(Z){m(l+40,Z),this.mem.setUint8(l+48,0)}},"syscall/js.valueLength":Z=>{l(Z+16,parseInt(d(Z+8).length))},"syscall/js.valuePrepareString":c=>{let b=Z.encode(String(d(c+8)));m(c+16,b),l(c+24,b.length)},"syscall/js.valueLoadString":l=>{let Z=d(l+8);I(l+16).set(Z)},"syscall/js.valueInstanceOf":l=>{this.mem.setUint8(l+24,d(l+8) instanceof d(l+16)?1:0)},"syscall/js.copyBytesToGo":Z=>{let c=I(Z+8),b=d(Z+32);if(!(b instanceof Uint8Array||b instanceof Uint8ClampedArray)){this.mem.setUint8(Z+48,0);return}let m=b.subarray(0,c.length);c.set(m),l(Z+40,m.length),this.mem.setUint8(Z+48,1)},"syscall/js.copyBytesToJS":Z=>{let c=d(Z+8),b=I(Z+16);if(!(c instanceof Uint8Array||c instanceof Uint8ClampedArray)){this.mem.setUint8(Z+48,0);return}let m=b.subarray(0,c.length);c.set(m),l(Z+40,m.length),this.mem.setUint8(Z+48,1)},debug:l=>{console.log(l)}}}}async run(l){this._inst=l,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,global,this],this._goRefCounts=Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[global,5],[this,6]]),this._idPool=[],this.exited=!1;let c=4096,b=l=>{let b=c,d=Z.encode(l+"\x00");return new Uint8Array(this.mem.buffer,c,d.length).set(d),(c+=d.length)%8!=0&&(c+=8-c%8),b},d=this.argv.length,m=[];this.argv.forEach(l=>{m.push(b(l))}),m.push(0),Object.keys(this.env).sort().forEach(l=>{m.push(b(`${l}=${this.env[l]}`))}),m.push(0);let I=c;m.forEach(l=>{this.mem.setUint32(c,l,!0),this.mem.setUint32(c+4,0,!0),c+=8}),this._inst.exports.run(d,I),this.exited&&this._resolveExitPromise(),await this._exitPromise}_resume(){if(this.exited)throw Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(l){let Z=this;return function(){let c={id:l,this:this,args:arguments};return Z._pendingEvent=c,Z._resume(),c.result}}},global.require&&global.require.main===module&&global.process&&global.process.versions&&!global.process.versions.electron){m.argv.length<3&&(console.error("usage: go_js_wasm_exec [wasm binary] [arguments]"),m.exit(1));let l=new Go;l.argv=m.argv.slice(2),l.env=Object.assign({TMPDIR:require("os").tmpdir()},m.env),l.exit=m.exit,WebAssembly.instantiate(fs.readFileSync(m.argv[2]),l.importObject).then(Z=>(m.on("exit",Z=>{0!==Z||l.exited||(l._pendingEvent={id:0},l._resume())}),l.run(Z.instance))).catch(l=>{console.error(l),m.exit(1)})}})(),!window.Go)throw Error(`Failed to load module Go. window.Go is ${window.Go}.`);let Z=new Go,{instance:c}=await WebAssembly.instantiateStreaming(fetch(l),Z.importObject);if(Z.run(c),!window.e2ee)throw Error(`Failed to load module e2ee. window.e2ee is ${window.e2ee}.`)}static version(){return"2021.1.0"}static wasmVersion(){return window.e2ee.version()}}async function W(l,Z){if(Z.audio&&"boolean"!=typeof Z.audio)for(let c of l.getAudioTracks())await c.applyConstraints(Z.audio);if(Z.video&&"boolean"!=typeof Z.video)for(let c of l.getVideoTracks())await c.applyConstraints(Z.video)}/** - * @shiguredo/lyra-wasm - * Lyra V2 WebAssembly build - * @version: 2022.2.0 - * @author: Shiguredo Inc. - * @license: Apache-2.0 - **/let V="1.3.0";class i{worker;constructor(l){this.worker=l}static load(l,Z){let c=URL.createObjectURL(new Blob([atob("KGZ1bmN0aW9uIChmYW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dXJuIHRyaW1MYXN0U2xhc2god2FzbVBhdGgpICsgIi8iICsgcGF0aDsKICAgICAgICAgICAgICB9LAogICAgICAgICAgfSk7CiAgICAgICAgICBjb25zdCBtb2RlbEZpbGVOYW1lcyA9IFsibHlyYV9jb25maWcuYmluYXJ5cGIiLCAic291bmRzdHJlYW1fZW5jb2Rlci50ZmxpdGUiLCAicXVhbnRpemVyLnRmbGl0ZSIsICJseXJhZ2FuLnRmbGl0ZSJdOwogICAgICAgICAgYXdhaXQgUHJvbWlzZS5hbGwobW9kZWxGaWxlTmFtZXMubWFwKChuYW1lKSA9PiB7CiAgICAgICAgICAgICAgY29uc3QgdXJsID0gdHJpbUxhc3RTbGFzaChtb2RlbFBhdGgpICsgIi8iICsgbmFtZTsKICAgICAgICAgICAgICByZXR1cm4gZmV0Y2godXJsKS50aGVuKGFzeW5jIChyZXMpID0+IHsKICAgICAgICAgICAgICAgICAgaWYgKCFyZXMub2spIHsKICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihgZmFpbGVkIHRvIGZldGNoICR7dXJsfTogJHtyZXMuc3RhdHVzfSAke3Jlcy5zdGF0dXNUZXh0fWApOwogICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgIHdhc21Nb2R1bGUuRlNfY3JlYXRlRGF0YUZpbGUoTUVNRlNfTU9ERUxfUEFUSCwgbmFtZSwgbmV3IFVpbnQ4QXJyYXkoYXdhaXQgcmVzLmFycmF5QnVmZmVyKCkpLCB0cnVlLCBmYWxzZSwgZmFsc2UpOwogICAgICAgICAgICAgIH0pOwogICAgICAgICAgfSkpOwogICAgICAgICAgcmV0dXJuIG5ldyBMeXJhU3luY01vZHVsZSh3YXNtTW9kdWxlKTsKICAgICAgfQogICAgICBjcmVhdGVFbmNvZGVyKG9wdGlvbnMgPSB7fSkgewogICAgICAgICAgY2hlY2tTYW1wbGVSYXRlKG9wdGlvbnMuc2FtcGxlUmF0ZSk7CiAgICAgICAgICBjaGVja051bW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ICAgICAgICAgY29uc3QgZW5jb2RlZEF1ZGlvRGF0YSA9IG5ldyBVaW50OEFycmF5KHJlc3VsdC5zaXplKCkpOwogICAgICAgICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGVuY29kZWRBdWRpb0RhdGEubGVuZ3RoOyBpKyspIHsKICAgICAgICAgICAgICAgICAgICAgIGVuY29kZWRBdWRpb0RhdGFbaV0gPSByZXN1bHQuZ2V0KGkpOwogICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgIGlmIChlbmNvZGVkQXVkaW9EYXRhLmxlbmd0aCA9PT0gMCkgewogICAgICAgICAgICAgICAgICAgICAgLy8gRFRYIOOBjOacieWKueOAgeOBi+OBpOOAgSBhdWRpb0RhdGEg44GM54Sh6Z+z44Gq44GE44GX44OO44Kk44K644Gg44GR44KS5ZCr44KT44Gn44GE44KL5aC05ZCI44Gr44Gv44GT44GT44Gr5p2l44KLCiAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdW5kZWZpbmVkOwogICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgIHJldHVybiBlbmNvZGVkQXVkaW9EYXRhOwogICAgICAgICAgICAgIH0KICAgICAgICAgICAgICBmaW5hbGx5IHsKICAgICAgICAgICAgICAgICAgcmVzdWx0LmRlbGV0ZSgpOwogICAgICAgICAgICAgIH0KICAgICAgICAgIH0KICAgICAgfQogICAgICBzZXRCaXRyYXRlKGJpdHJhdGUpIHsKICAgICAgICAgIGNoZWNrQml0cmF0ZShiaXRyYXRlKTsKICAgICAgICAgIGlmICghdGhpcy5lbmNvZGVyLnNldEJpdHJhdGUoYml0cmF0ZSkpIHsKICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoYGZhaWxlZCB0byB1cGRhdGUgYml0cmF0ZSBmcm9tICR7dGhpcy5iaXRyYXRlfSB0byAke2JpdHJhdGV9YCk7CiAgICAgICAgICB9CiAgICAgIH0KICAgICAgZGVzdHJveSgpIHsKICAgICAg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AgICAgICAgZm9yIChjb25zdCB2IG9mIGVuY29kZWRBdWRpb0RhdGEpIHsKICAgICAgICAgICAgICAgICAgdGhpcy5idWZmZXIucHVzaF9iYWNrKHYpOwogICAgICAgICAgICAgIH0KICAgICAgICAgICAgICBpZiAoIXRoaXMuZGVjb2Rlci5zZXRFbmNvZGVkUGFja2V0KHRoaXMuYnVmZmVyKSkgewogICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoImZhaWxlZCB0byBzZXQgZW5jb2RlZCBwYWNrZXQiKTsKICAgICAgICAgICAgICB9CiAgICAgICAgICB9CiAgICAgICAgICBjb25zdCByZXN1bHQgPSB0aGlzLmRlY29kZXIuZGVjb2RlU2FtcGxlcyh0aGlzLmZyYW1lU2l6ZSk7CiAgICAgICAgICBpZiAocmVzdWx0ID09PSB1bmRlZmluZWQpIHsKICAgICAgICAgICAgICB0aHJvdyBFcnJvcigiZmFpbGVkIHRvIGRlY29kZSBzYW1wbGVzIik7CiAgICAgICAgICB9CiAgICAgICAgICB0cnkgewogICAgICAgICAgICAgIGNvbnN0IGF1ZGlvRGF0YSA9IG5ldyBJbnQxNkFycmF5KHRoaXMuZnJhbWVTaXplKTsKICAgICAgICAgICAgICB0aGlzLndhc21Nb2R1bGUuY29weUF1ZGlvRGF0YVRvSW50MTZBcnJheShhdWRpb0RhdGEsIHJlc3VsdCk7CiAgICAgICAgICAgICAgcmV0dXJuIGF1ZGlvRGF0YTsKICAgICAgICAgIH0KICAgICAgICAgIGZpbmFsbHkgewogICAgICAgICAgICAgIHJlc3VsdC5kZWxldGUoKTsKICAgICAgICAgIH0KICAgICAgfQogICAgICBkZXN0cm95KCkgewogICAgICAgICAgdGhpcy5kZWNvZGVyLmRlbGV0ZSgpOwogICAgICAgICAgdGhpcy5idWZmZXIuZGVsZXRlKCk7CiAgICAgIH0KICB9CgogIC8vIOOCqOODs+OCs+ODvOODgOOBqOODh+OCs+ODvOODgOOBruOCpOODs+OCueOCv+ODs+OCueOBruWQ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FbmNvZGVyKHBvcnQsIG9wdGlvbnMpIHsKICAgICAgICAgIGNvbnN0IGVuY29kZXIgPSB0aGlzLmVuY29kZXJzLmdldChwb3J0KTsKICAgICAgICAgIGlmIChlbmNvZGVyICE9PSB1bmRlZmluZWQpIHsKICAgICAgICAgICAgICBlbmNvZGVyLmxhc3RBY2Nlc3NlZFRpbWUgPSBwZXJmb3JtYW5jZS5ub3coKTsKICAgICAgICAgICAgICByZXR1cm4gZW5jb2Rlci5pdGVtOwogICAgICAgICAgfQogICAgICAgICAgZWxzZSB7CiAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuY3JlYXRlRW5jb2Rlcihwb3J0LCBvcHRpb25zKTsKICAgICAgICAgIH0KICAgICAgfQogICAgICBnZXREZWNvZGVyKHBvcnQsIG9wdGlvbnMpIHsKICAgICAgICAgIGNvbnN0IGRlY29kZXIgPSB0aGlzLmRlY29kZXJzLmdldChwb3J0KTsKICAgICAgICAgIGlmIChkZWNvZGVyICE9PSB1bmRlZmluZWQpIHsKICAgICAgICAgICAgICBkZWNvZGVyLmxhc3RBY2Nlc3NlZFRpbWUgPSBwZXJmb3JtYW5jZS5ub3coKTsKICAgICAgICAgICAgICByZXR1cm4gZGVjb2Rlci5pdGVtOwogICAgICAgICAgfQogICAgICAgICAgZWxzZSB7CiAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuY3JlYXRlRGVjb2Rlcihwb3J0LCBvcHRpb25zKTsKICAgICAgICAgIH0KICAgICAgfQogICAgICByZW1vdmUocG9ydCkgewogICAgICAgICAgewogICAgICAgICAgICAgIGNvbnN0IHJlc291cmNlID0gdGhpcy5lbmNvZGVycy5nZXQocG9ydCk7CiAgICAgICAgICAgICAgaWYgKHJlc291cmNlICE9PSB1bmRlZmluZWQpIHsKICAgICAgICAgICAgICAgICAgcmVzb3VyY2UuaXRlbS5kZXN0cm95KCk7CiAgICAgICAgICAgICAgICAgIHRoaXMuZW5jb2RlcnMuZGVsZXRlKHBvcnQpOwogICAgICAgICAgICAgIH0KICAgICAgICAgIH0KICAgICAgICAgIHsKICAgICAgICAgICAgICBjb25zdCByZXNvdXJjZSA9IHRoaXMuZGVjb2RlcnMuZ2V0KHBvcnQpOwogICAgICAgICAgICAgIGlmIChyZXNvdXJjZSAhPT0gdW5kZWZpbmVkKSB7CiAgICAgICAgICAgICAgICAgIHJlc291cmNlLml0ZW0uZGVzdHJveSgpOwogICAgICAgICAgICAgICAgICB0aGlzLmRlY29kZXJzLmRlbGV0ZShwb3J0KTsKICAgICAgICAgICAgICB9CiAgICAgICAgICB9CiAgICAgIH0KICAgICAgZXZpY3RJZk5lZWQoKSB7CiAgICAgICAgICBpZiAodGhpcy5lbmNvZGVycy5zaXplICsgdGhpcy5kZWNvZGVycy5zaXplIDwgTUFYX1JFU09VUkNFUykgewogICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgIH0KICAgICAgICAgIC8vIOOCpOODs+OCueOCv+ODs+OCueaVsOOBruS4iumZkOOBq+mBlOOBl+OBpuOBhOOCi+WgtOWQiOOBq+OBr+OAgeS9v+eUqOOBleOCjOOBn+aZguWIu+OBjOS4gOeVquWPpOOBhOOCguOBruOCkuWJiumZpOOBmeOCiwogICAgICAgICAgbGV0IG9sZGVzdFBvcnQ7CiAgICAgICAgICBsZXQgb2xkZXN0VGltZTsKICAgICAgICAgIGZvciAoY29uc3QgW3BvcnQsIHJlc291cmNlXSBvZiB0aGlzLmVuY29kZXJzLmVudHJpZXMoKSkgewogICAgICAgICAgICAgIGlmIChvbGRlc3RUaW1lID09PSB1bmRlZmluZWQgfHwgcmVzb3VyY2UubGFzdEFjY2Vzc2VkVGltZSA8IG9sZGVzdFRpbWUpIHsKICAgICAgICAgICAgICAgICAgb2xkZXN0UG9ydCA9IHBvcnQ7CiAgICAgICAgICAgICAgICAgIG9sZGVzdFRpbWUgPSByZXNvdXJjZS5sYXN0QWNjZXNzZWRUaW1lOwogICAgICAgICAgICAgIH0KICAgICAgICAgIH0KICAgICAgICAgIGZvciAo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gICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICAgIGF3YWl0IGluaXRSZXNvdXJjZU1hbmFnZXIobXNnLmRhdGEud2FzbVBhdGgsIG1zZy5kYXRhLm1vZGVsUGF0aCk7CiAgICAgICAgICAgICAgICAgIHNlbGYucG9zdE1lc3NhZ2UoeyB0eXBlOiBgJHttc2cuZGF0YS50eXBlfS5yZXN1bHRgLCByZXN1bHQ6IHt9IH0pOwogICAgICAgICAgICAgIH0KICAgICAgICAgICAgICBjYXRjaCAoZXJyb3IpIHsKICAgICAgICAgICAgICAgICAgc2VsZi5wb3N0TWVzc2FnZSh7IHR5cGU6IGAke21zZy5kYXRhLnR5cGV9LnJlc3VsdGAsIHJlc3VsdDogeyBlcnJvciB9IH0pOwogICAgICAgICAgICAgIH0KICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgIGNhc2UgIkx5cmFNb2R1bGUuY3JlYXRlRW5jb2RlciI6CiAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAgICBjb25zdCBwb3J0ID0gbXNnLmRhdGEucG9ydDsKICAgICAgICAgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IG1hbmFnZXIgPSBSRVNPVVJDRV9NQU5BR0VSOwogICAgICAgICAgICAgICAgICAgICAgaWYgKG1hbmFnZXIgPT09IHVuZGVmaW5lZCkgewogICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcigiUkVTT1VSQ0VfTUFOQUdFUiBpcyB1bmRlZmluZWQiKTsKICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IG9wdGlvbnMgPSBtc2cuZGF0YS5vcHRpb25zOwogICAgICAgICAgICAgICAgICAgICAgY29uc3QgZW5jb2RlciA9IG1hbmFnZXIuY3JlYXRlRW5jb2Rlcihwb3J0LCBvcHRpb25zKTsKICAgICAgICAgICAgICAgICAgICAgIHBvcnQub25tZXNzYWdlID0gKG1zZykgPT4gewogICAgICAgICAgICAgICAgICAgICAgICAgIGhhbmRsZUVuY29kZXJNZXNzYWdlKG1hbmFnZXIsIHBvcnQsIG9wdGlvbnMsIG1zZyk7CiAgICAgICAgICAgICAgICAgICAgICB9OwogICAgICAgICAgICAgICAgICAgICAgcG9ydC5wb3N0TWVzc2FnZSh7IHR5cGU6IGAke21zZy5kYXRhLnR5cGV9LnJlc3VsdGAsIHJlc3VsdDogeyBmcmFtZVNpemU6IGVuY29kZXIuZnJhbWVTaXplIH0gfSk7CiAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgY2F0Y2ggKGVycm9yKSB7CiAgICAgICAgICAgICAgICAgICAgICBwb3J0LnBvc3RNZXNzYWdlKHsgdHlwZTogYCR7bXNnLmRhdGEudHlwZX0ucmVzdWx0YCwgcmVzdWx0OiB7IGVycm9yIH0gfSk7CiAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICBjYXNlICJMeXJhTW9kdWxlLmNyZWF0ZURlY29kZXIiOgogICAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICAgY29uc3QgcG9ydCA9IG1zZy5kYXRhLnBvcnQ7CiAgICAgICAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICAgICAgICBjb25zdCBtYW5hZ2VyID0gUkVTT1VSQ0VfTUFOQUdFUjsKICAgICAgICAgICAgICAgICAgICAgIGlmIChtYW5hZ2VyID09PSB1bmRlZmluZWQpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoIlJFU09VUkNFX01BTkFHRVIgaXMgdW5kZWZpbmVkIik7CiAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICBjb25zdCBvcHRpb25zID0gbXNnLmRhdGEub3B0aW9uczsKICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGRlY29kZXIgPSBtYW5hZ2VyLmNyZWF0ZURlY29kZXIocG9ydCwgb3B0aW9ucyk7CiAgICAgICAgICAgICAgICAgICAgICBwb3J0Lm9ubWVzc2FnZSA9IChtc2cpID0+IHsKICAgICAgICAgICAgICAgICAgICAgICAgICBoYW5kbGVEZWNvZGVyTWVzc2FnZShtYW5hZ2VyLCBwb3J0LCBvcHRpb25zLCBtc2cpOwogICAgICAgICAgICAgICAgICAgICAgfTsKICAgICAgICAgICAgICAgICAgICAgIHBvcnQucG9zdE1lc3NhZ2UoeyB0eXBlOiBgJHttc2cuZGF0YS50eXBlfS5yZXN1bHRgLCByZXN1bHQ6IHsgZnJhbWVTaXplOiBkZWNvZGVyLmZyYW1lU2l6ZSB9IH0pOwogICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgIGNhdGNoIChlcnJvcikgewogICAgICAgICAgICAgICAgICAgICAgcG9ydC5wb3N0TWVzc2FnZSh7IHR5cGU6IGAke21zZy5kYXRhLnR5cGV9LnJlc3VsdGAsIHJlc3VsdDogeyBlcnJvciB9IH0pOwogICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgfQogICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgZGVmYXVsdDoKICAgICAgICAgICAgICBjb25zb2xlLndhcm4oInJlY2VpdmVkIHVua25vd24gbWVzc2FnZSIpOwogICAgICAgICAgICAgIGNvbnNvbGUud2Fybihtc2cpOwogICAgICB9CiAgfTsKICBmdW5jdGlvbiBoYW5kbGVFbmNvZGVyTWVzc2FnZShtYW5hZ2VyLCBwb3J0LCBvcHRpb25zLCBtc2cpIHsKICAgICAgc3dpdGNoIChtc2cuZGF0YS50eXBlKSB7CiAgICAgICAgICBjYXNlICJMeXJhRW5jb2Rlci5lbmNvZGUiOgogICAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICAgIGNvbnN0IGVuY29kZXIgPSBtYW5hZ2VyLmdldEVuY29kZXIocG9ydCwgb3B0aW9ucyk7CiAgICAgICAgICAgICAgICAgIGNvbnN0IGVuY29kZWRBdWRpb0RhdGEgPSBlbmNvZGVyLmVuY29kZShtc2cuZGF0YS5hdWRpb0RhdGEpOwogICAgICAgICAgICAgICAgICBjb25zdCByZXNwb25zZSA9IHsgdHlwZTogYCR7bXNnLmRhdGEudHlwZX0ucmVzdWx0YCwgcmVzdWx0OiB7IGVuY29kZWRBdWRpb0RhdGEgfSB9OwogICAgICAgICAgICAgICAgICBpZiAoZW5jb2RlZEF1ZGlvRGF0YSA9PT0gdW5kZWZpbmVkKSB7CiAgICAgICAgICAgICAgICAgICAgICBwb3J0LnBvc3RNZXNzYWdlKHJlc3BvbnNlKTsKICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgIHBvcnQucG9zdE1lc3NhZ2UocmVzcG9uc2UsIFtlbmNvZGVkQXVkaW9EYXRhLmJ1ZmZlcl0pOwogICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgfQogICAgICAgICAgICAgIGNhdGNoIChlcnJvcikgewogICAgICAgICAgICAgICAgICBwb3J0LnBvc3RNZXNzYWdlKHsgdHlwZTogYCR7bXNnLmRhdGEudHlwZX0ucmVzdWx0YCwgcmVzdWx0OiB7IGVycm9yIH0gfSk7CiAgICAgICAgICAgICAgfQogICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgY2FzZSAiTHlyYUVuY29kZXIuZGVzdHJveSI6CiAgICAgICAgICAgICAgbWFuYWdlci5yZW1vdmUocG9ydCk7CiAgICAgICAgICAgICAgcG9ydC5vbm1lc3NhZ2UgPSBudWxsOwogICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgZGVmYXVsdDoKICAgICAgICAgICAgICBjb25zb2xlLndhcm4oInJlY2VpdmVkIHVua25vd24gbWVzc2FnZSIpOwogICAgICAgICAgICAgIGNvbnNvbGUud2Fybihtc2cpOwogICAgICB9CiAgfQogIGZ1bmN0aW9uIGhhbmRsZURlY29kZXJNZXNzYWdlKG1hbmFnZXIsIHBvcnQsIG9wdGlvbnMsIG1zZykgewogICAgICBzd2l0Y2ggKG1zZy5kYXRhLnR5cGUpIHsKICAgICAgICAgIGNhc2UgIkx5cmFEZWNvZGVyLmRlY29kZSI6CiAgICAgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgICAgICAgY29uc3QgZGVjb2RlciA9IG1hbmFnZXIuZ2V0RGVjb2Rlcihwb3J0LCBvcHRpb25zKTsKICAgICAgICAgICAgICAgICAgY29uc3QgYXVkaW9EYXRhID0gZGVjb2Rlci5kZWNvZGUobXNnLmRhdGEuZW5jb2RlZEF1ZGlvRGF0YSk7CiAgICAgICAgICAgICAgICAgIHBvcnQucG9zdE1lc3NhZ2UoeyB0eXBlOiBgJHttc2cuZGF0YS50eXBlfS5yZXN1bHRgLCByZXN1bHQ6IHsgYXVkaW9EYXRhIH0gfSwgW2F1ZGlvRGF0YS5idWZmZXJdKTsKICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgY2F0Y2ggKGVycm9yKSB7CiAgICAgICAgICAgICAgICAgIHBvcnQucG9zdE1lc3NhZ2UoeyB0eXBlOiBgJHttc2cuZGF0YS50eXBlfS5yZXN1bHRgLCByZXN1bHQ6IHsgZXJyb3IgfSB9KTsKICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICBjYXNlICJMeXJhRGVjb2Rlci5kZXN0cm95IjoKICAgICAgICAgICAgICBtYW5hZ2VyLnJlbW92ZShwb3J0KTsKICAgICAgICAgICAgICBwb3J0Lm9ubWVzc2FnZSA9IG51bGw7CiAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICBkZWZhdWx0OgogICAgICAgICAgICAgIGNvbnNvbGUud2FybigicmVjZWl2ZWQgdW5rbm93biBtZXNzYWdlIik7CiAgICAgICAgICAgICAgY29uc29sZS53YXJuKG1zZyk7CiAgICAgIH0KICB9Cgp9KSk7Cg==")],{type:"application/javascript"})),b=new Worker(c,{name:"lyra_sync_worker"});l=new URL(l,document.location.href).toString(),Z=new URL(Z,document.location.href).toString();let d=new Promise((l,Z)=>{b.addEventListener("message",c=>{let d=c.data.result.error;void 0===d?l(new i(b)):Z(d)},{once:!0})});return b.postMessage({type:"LyraModule.load",modelPath:Z,wasmPath:l}),d}createEncoder(l={}){let Z=new MessageChannel,c=new Promise((c,b)=>{Z.port1.addEventListener("message",d=>{let m=d.data.result;"error"in m?b(m.error):c(new t(Z.port1,m.frameSize,l))},{once:!0}),Z.port1.start()});return this.worker.postMessage({type:"LyraModule.createEncoder",port:Z.port2,options:l},[Z.port2]),c}createDecoder(l={}){let Z=new MessageChannel,c=new Promise((c,b)=>{Z.port1.addEventListener("message",d=>{let m=d.data.result;"error"in m?b(m.error):c(new X(Z.port1,m.frameSize,l))},{once:!0}),Z.port1.start()});return this.worker.postMessage({type:"LyraModule.createDecoder",port:Z.port2,options:l},[Z.port2]),c}}class t{port;sampleRate;numberOfChannels;bitrate;enableDtx;frameSize;constructor(l,Z,c){this.port=l,this.frameSize=Z,this.sampleRate=c.sampleRate||16e3,this.numberOfChannels=c.numberOfChannels||1,this.bitrate=c.bitrate||9200,this.enableDtx=c.enableDtx||!1}encode(l){let Z=new Promise((l,Z)=>{this.port.addEventListener("message",c=>{let b=c.data.result;"error"in b?Z(b.error):l(b.encodedAudioData)},{once:!0})});return this.port.postMessage({type:"LyraEncoder.encode",audioData:l},[l.buffer]),Z}destroy(){this.port.postMessage({type:"LyraEncoder.destroy"}),this.port.close()}static fromState(l){return l.port.start(),new t(l.port,l.frameSize,l)}}class X{port;sampleRate;numberOfChannels;frameSize;constructor(l,Z,c){this.port=l,this.frameSize=Z,this.sampleRate=c.sampleRate||16e3,this.numberOfChannels=c.numberOfChannels||1}decode(l){let Z=new Promise((l,Z)=>{this.port.addEventListener("message",c=>{let b=c.data.result;"error"in b?Z(b.error):l(b.audioData)},{once:!0})});return void 0===l?this.port.postMessage({type:"LyraDecoder.decode",encodedAudioData:l}):this.port.postMessage({type:"LyraDecoder.decode",encodedAudioData:l},[l.buffer]),Z}destroy(){this.port.postMessage({type:"LyraDecoder.destroy"}),this.port.close()}static fromState(l){return l.port.start(),new X(l.port,l.frameSize,l)}}async function g(l={}){return(await e()).createEncoder(l)}async function G(l={}){return(await e()).createDecoder(l)}async function e(){if(void 0===b)throw Error("Lyra has not been initialized. Please call `Sora.initLyra()` beforehand.");return void 0===d&&(d=await i.load(b.wasmPath,b.modelPath)),d}function n(){let l=atob("KGZ1bmN0aW9uIChmYWN0b3J5KSB7CiAgICB0eXBlb2YgZGVmaW5lID09PSAnZnVuY3Rpb24nICYmIGRlZmluZS5hbWQgPyBkZWZpbmUoZmFjdG9yeSkgOgogICAgZmFjdG9yeSgpOwp9KSgoZnVuY3Rpb24gKCkgeyAndXNlIHN0cmljdCc7CgogICAgLyoqCiAgICAgKiBAc2hpZ3VyZWRvL2x5cmEtd2FzbQogICAgICogTHlyYSBWMiBXZWJBc3NlbWJseSBidWlsZAogICAgICogQHZlcnNpb246IDIwMjIuMi4wCiAgICAgKiBAYXV0aG9yOiBTaGlndXJlZG8gSW5jLgogICAgICogQGxpY2Vuc2U6IEFwYWNoZS0yLjAKICAgICAqKi8KCiAgICBjb25zdCBERUZBVUxUX1NBTVBMRV9SQVRFID0gMTYwMDA7CiAgICBjb25zdCBERUZBVUxUX0JJVFJBVEUgPSA5MjAwOwogICAgY29uc3QgREVGQVVMVF9FTkFCTEVfRFRYID0gZmFsc2U7CiAgICBjb25zdCBERUZBVUxUX0NIQU5ORUxTID0gMTsKICAgIC8qKgogICAgICogTHlyYSDjga7jgqjjg7PjgrPjg7zjg4AKICAgICAqLwogICAgY2xhc3MgTHlyYUVuY29kZXIgewogICAgICAgIC8qKgogICAgICAgICAqIHdhc20g44Gn44Gu44Ko44Oz44Kz44O844OJ5Yem55CG44KS5a6f6KGM44GZ44KLIHdlYiB3b3JrZXIg44Go6YCa5L+h44GZ44KL44Gf44KB44Gu44Od44O844OICiAgICAgICAgICovCiAgICAgICAgcG9ydDsKICAgICAgICAvKioKICAgICAgICAgKiDnj77lnKjjga7jgrXjg7Pjg5fjg5fjg6rjg7PjgrDjg6zjg7zjg4gKICAgICAgICAgKi8KICAgICAgICBzYW1wbGVSYXRlOwogICAgICAgIC8qKgogICAgICAgICAqIOePvuWcqOOBruODgeODo+ODjeODq+aVsAogICAgICAgICAqLwogICAgICAgIG51bWJlck9mQ2hhbm5lbHM7CiAgICAgICAgLyoqCiAgICAgICAgICog54++5Zyo44Gu44Ko44Oz44Kz44O844OJ44OT44OD44OI44Os44O844OICiAgICAgICAgICovCiAgICAgICAgYml0cmF0ZTsKICAgICAgICAvKioKICAgICAgICAgKiBEVFgg44GM5pyJ5Yq544Gr44Gq44Gj44Gm44GE44KL44GL44Gp44GG44GLCiAgICAgICAgICovCiAgICAgICAgZW5hYmxlRHR4OwogICAgICAgIC8qKgogICAgICAgICAqIOS4gOOBpOOBruODleODrOODvOODoO+8iHtAbGluayBMeXJhRW5jb2Rlci5lbmNvZGV9IOODoeOCveODg+ODieOBq+a4oeOBmemfs+WjsOODh+ODvOOCv++8ieOBq+WQq+OCgeOCi+OCteODs+ODl+ODq+aVsAogICAgICAgICAqLwogICAgICAgIGZyYW1lU2l6ZTsKICAgICAgICAvKioKICAgICAgICAgKiBAaW50ZXJuYWwKICAgICAgICAgKi8KICAgICAgICBjb25zdHJ1Y3Rvcihwb3J0LCBmcmFtZVNpemUsIG9wdGlvbnMpIHsKICAgICAgICAgICAgdGhpcy5wb3J0ID0gcG9ydDsKICAgICAgICAgICAgdGhpcy5mcmFtZVNpemUgPSBmcmFtZVNpemU7CiAgICAgICAgICAgIHRoaXMuc2FtcGxlUmF0ZSA9IG9wdGlvbnMuc2FtcGxlUmF0ZSB8fCBERUZBVUxUX1NBTVBMRV9SQVRFOwogICAgICAgICAgICB0aGlzLm51bWJlck9mQ2hhbm5lbHMgPSBvcHRpb25zLm51bWJlck9mQ2hhbm5lbHMgfHwgREVGQVVMVF9DSEFOTkVMUzsKICAgICAgICAgICAgdGhpcy5iaXRyYXRlID0gb3B0aW9ucy5iaXRyYXRlIHx8IERFRkFVTFRfQklUUkFURTsKICAgICAgICAgICAgdGhpcy5lbmFibGVEdHggPSBvcHRpb25zLmVuYWJsZUR0eCB8fCBERUZBVUxUX0VOQUJMRV9EVFg7CiAgICAgICAgfQogICAgICAgIC8qKgogICAgICAgICAqIDIwbXMg5YiG44Gu6Z+z5aOw44OH44O844K/44KS44Ko44Oz44Kz44O844OJ44GZ44KLCiAgICAgICAgICoKICAgICAgICAgKiDjgarjgYogYXVkaW9EYXRhIOOBruaJgOacieaoqeOBryB3ZWIgd29ya2VyIOOBq+enu+i7ouOBleOCjOOCi+OBruOBp+OAgQogICAgICAgICAqIOOBk+OBruODoeOCveODg+ODieWRvOOBs+WHuuOBl+W+jOOBq+OBr+WRvOOBs+WHuuOBl+OCguOBqOOCueODrOODg+ODieOBi+OCieOBr+ODh+ODvOOCv+OBq+WPgueFp+OBp+OBjeOBquOBj+OBquOCiuOBvuOBmQogICAgICAgICAqIO+8iOOBpOOBvuOCiuWQjOOBmCBhdWRpb0RhdGEg44Kk44Oz44K544K/44Oz44K544Gu5L2/44GE5Zue44GX44Gv44Gn44GN44Gq44GE77yJCiAgICAgICAgICoKICAgICAgICAgKiBAcGFyYW1zIGF1ZGlvRGF0YSDjgqjjg7PjgrPjg7zjg4nlr77osaHjga7pn7Plo7Djg4fjg7zjgr8KICAgICAgICAgKiBAcmV0dXJucyDjgqjjg7PjgrPjg7zjg4nlvozjga7jg5DjgqTjg4jliJfjgILjgoLjgZcgRFRYIOOBjOacieWKueOBp+mfs+WjsOODh+ODvOOCv+OBjOeEoemfs+OBquWgtOWQiOOBq+OBryB1bmRlZmluZWQg44GM5Luj44KP44KK44Gr6L+U44GV44KM44KL44CCCiAgICAgICAgICoKICAgICAgICAgKiBAdGhyb3dzCiAgICAgICAgICoKICAgICAgICAgKiDku6XkuIvjga7jgYTjgZrjgozjgYvjgavoqbLlvZPjgZnjgovloLTlkIjjgavjga/kvovlpJbjgYzpgIHlh7rjgZXjgozjgos6CiAgICAgICAgICogLSDlhaXlipvpn7Plo7Djg4fjg7zjgr/jgYwgMjBtcyDljZjkvY3vvIjjgrXjg7Pjg5fjg6vmlbDjgajjgZfjgabjga8ge0BsaW5rIEx5cmFFbmNvZGVyLmZyYW1lU2l6ZX3vvInjgafjga/jgarjgYQKICAgICAgICAgKiAtIOOBneOBruS7luOAgeS9leOCieOBi+OBrueQhueUseOBp+OCqOODs+OCs+ODvOODieOBq+WkseaVl+OBl+OBn+WgtOWQiAogICAgICAgICAqLwogICAgICAgIGVuY29kZShhdWRpb0RhdGEpIHsKICAgICAgICAgICAgY29uc3QgcHJvbWlzZSA9IG5ldyBQcm9taXNlKChyZXNvbHZlLCByZWplY3QpID0+IHsKICAgICAgICAgICAgICAgIHRoaXMucG9ydC5hZGRFdmVudExpc3RlbmVyKCJtZXNzYWdlIiwgKHJlcykgPT4gewogICAgICAgICAgICAgICAgICAgIGNvbnN0IHJlc3VsdCA9IHJlcy5kYXRhLnJlc3VsdDsKICAgICAgICAgICAgICAgICAgICBpZiAoImVycm9yIiBpbiByZXN1bHQpIHsKICAgICAgICAgICAgICAgICAgICAgICAgcmVqZWN0KHJlc3VsdC5lcnJvcik7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgICAgICAgICAgICByZXNvbHZlKHJlc3VsdC5lbmNvZGVkQXVkaW9EYXRhKTsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9LCB7IG9uY2U6IHRydWUgfSk7CiAgICAgICAgICAgIH0pOwogICAgICAgICAgICB0aGlzLnBvcnQucG9zdE1lc3NhZ2UoeyB0eXBlOiAiTHlyYUVuY29kZXIuZW5jb2RlIiwgYXVkaW9EYXRhIH0sIFthdWRpb0RhdGEuYnVmZmVyXSk7CiAgICAgICAgICAgIHJldHVybiBwcm9taXNlOwogICAgICAgIH0KICAgICAgICAvKioKICAgICAgICAgKiDjgqjjg7PjgrPjg7zjg4DnlKjjgavnorrkv53jgZfjgZ/jg6rjgr3jg7zjgrnjgpLop6PmlL7jgZnjgosKICAgICAgICAgKi8KICAgICAgICBkZXN0cm95KCkgewogICAgICAgICAgICB0aGlzLnBvcnQucG9zdE1lc3NhZ2UoeyB0eXBlOiAiTHlyYUVuY29kZXIuZGVzdHJveSIgfSk7CiAgICAgICAgICAgIHRoaXMucG9ydC5jbG9zZSgpOwogICAgICAgIH0KICAgICAgICAvKioKICAgICAgICAgKiB7QGxpbmsgTHlyYUVuY29kZXJTdGF0ZX0g44GL44KJIHtAbGluayBMeXJhRW5jb2Rlcn0g44KS5b6p5YWD44GZ44KLCiAgICAgICAgICoKICAgICAgICAgKiB7QGxpbmsgTHlyYUVuY29kZXJ9IOOBryB7QGxpbmsgTWVzc2FnZVBvcnQucG9zdE1lc3NhZ2UoKX0g44KS5L2/44Gj44Gm44CBCiAgICAgICAgICog5Yil44GuIHdlYiB3b3JrZXIg44Gr6Lui6YCB44GZ44KL44GT44Go44GM5Y+v6IO944CCCiAgICAgICAgICog44Gf44Gg44GX44CB6Lui6YCB5pmC44Gr44Gv44Kv44Op44K544KE44Oh44K944OD44OJ44Gu54q25oWL44Gv6JC944Gh44Gm44GX44G+44GG44Gu44Gn44CBCiAgICAgICAgICog44Gd44KM44KS5b6p5YWD44GX44Gm5YaN44Gz5Yip55So5Y+v6IO944Gr44GZ44KL44Gf44KB44Gu6Zai5pWw44CCCiAgICAgICAgICog44Gq44GK44CB6Lui6YCB44Gu6Zqb44Gr44GvIHtAbGluayBMeXJhRW5jb2Rlci5wb3J0fSDjga7miYDmnInmqKnjgpLnp7vorbLjgZnjgovlv4XopoHjgYzjgYLjgovjgIIKICAgICAgICAgKgogICAgICAgICAqIEBwYXJhbSBzdGF0ZSDjgqjjg7PjgrPjg7zjg4Djga7nirbmhYsKICAgICAgICAgKiBAcmV0dXJuIOW+qeWFg+OBleOCjOOBn+OCqOODs+OCs+ODvOODgAogICAgICAgICAqLwogICAgICAgIHN0YXRpYyBmcm9tU3RhdGUoc3RhdGUpIHsKICAgICAgICAgICAgc3RhdGUucG9ydC5zdGFydCgpOwogICAgICAgICAgICByZXR1cm4gbmV3IEx5cmFFbmNvZGVyKHN0YXRlLnBvcnQsIHN0YXRlLmZyYW1lU2l6ZSwgc3RhdGUpOwogICAgICAgIH0KICAgIH0KICAgIC8qKgogICAgICogTHlyYSDjga7jg4fjgrPjg7zjg4AKICAgICAqLwogICAgY2xhc3MgTHlyYURlY29kZXIgewogICAgICAgIC8qKgogICAgICAgICAqIHdhc20g44Gn44Gu44OH44Kz44O844OJ5Yem55CG44KS5a6f6KGM44GZ44KLIHdlYiB3b3JrZXIg44Go6YCa5L+h44GZ44KL44Gf44KB44Gu44Od44O844OICiAgICAgICAgICovCiAgICAgICAgcG9ydDsKICAgICAgICAvKioKICAgICAgICAgKiDnj77lnKjjga7jgrXjg7Pjg5fjg5fjg6rjg7PjgrDjg6zjg7zjg4gKICAgICAgICAgKi8KICAgICAgICBzYW1wbGVSYXRlOwogICAgICAgIC8qKgogICAgICAgICAqIOePvuWcqOOBruODgeODo+ODjeODq+aVsAogICAgICAgICAqLwogICAgICAgIG51bWJlck9mQ2hhbm5lbHM7CiAgICAgICAgLyoqCiAgICAgICAgICog5LiA44Gk44Gu44OV44Os44O844Og77yIe0BsaW5rIEx5cmFFbmNvZGVyLmRlY29kZX0g44Oh44K944OD44OJ44Gu6L+U44KK5YCk44Gu6Z+z5aOw44OH44O844K/77yJ44Gr5ZCr44G+44KM44KL44K144Oz44OX44Or5pWwCiAgICAgICAgICovCiAgICAgICAgZnJhbWVTaXplOwogICAgICAgIC8qKgogICAgICAgICAqIEBpbnRlcm5hbAogICAgICAgICAqLwogICAgICAgIGNvbnN0cnVjdG9yKHBvcnQsIGZyYW1lU2l6ZSwgb3B0aW9ucykgewogICAgICAgICAgICB0aGlzLnBvcnQgPSBwb3J0OwogICAgICAgICAgICB0aGlzLmZy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ih44GV44KM44Gf5aC05ZCI44Gr44Gv5Luj44KP44KK44Gr44Kz44Oz44OV44Kp44O844OI44OO44Kk44K644GM55Sf5oiQ44GV44KM44KL44CCCiAgICAgICAgICovCiAgICAgICAgZGVjb2RlKGVuY29kZWRBdWRpb0RhdGEpIHsKICAgICAgICAgICAgY29uc3QgcHJvbWlzZSA9IG5ldyBQcm9taXNlKChyZXNvbHZlLCByZWplY3QpID0+IHsKICAgICAgICAgICAgICAgIHRoaXMucG9ydC5hZGRFdmVudExpc3RlbmVyKCJtZXNzYWdlIiwgKHJlcykgPT4gewogICAgICAgICAgICAgICAgICAgIGNvbnN0IHJlc3VsdCA9IHJlcy5kYXRhLnJlc3VsdDsKICAgICAgICAgICAgICAgICAgICBpZiAoImVycm9yIiBpbiByZXN1bHQpIHsKICAgICAgICAgICAgICAgICAgICAgICAgcmVqZWN0KHJlc3VsdC5lcnJvcik7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgICAgICAgICAgICByZXNvbHZlKHJlc3VsdC5hdWRpb0RhdGEpOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0sIHsgb25jZTogdHJ1ZSB9KTsKICAgICAgICAgICAgfSk7CiAgICAgICAgICAgIGlmIChlbmNvZGVkQXVkaW9EYXRhID09PSB1bmRlZmluZWQpIHsKICAgICAgICAgICAgICAgIHRoaXMucG9ydC5wb3N0TWVzc2FnZSh7IHR5cGU6ICJMeXJhRGVjb2Rlci5kZWNvZGUiLCBlbmNvZGVkQXVkaW9EYXRhIH0pOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgICAgdGhpcy5wb3J0LnBvc3RNZXNzYWdlKHsgdHlwZTogIkx5cmFEZWNvZGVyLmRlY29kZSIsIGVuY29kZWRBdWRpb0RhdGEgfSwgW2VuY29kZWRBdWRpb0RhdGEuYnVmZmVyXSk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmV0dXJuIHByb21pc2U7CiAgICAgICAgfQogICAgICAgIC8qKgogICAgICAgICAqIOODh+OCs+ODvOODgOeUqOOBq+eiuuS/neOBl+OBn+ODquOCveODvOOCueOCkuino+aUvuOBmeOCiwogICAgICAgICAqLwogICAgICAgIGRlc3Ryb3koKSB7CiAgICAgICAgICAgIHRoaXMucG9ydC5wb3N0TWVzc2FnZSh7IHR5cGU6ICJMeXJhRGVjb2Rlci5kZXN0cm95IiB9KTsKICAgICAgICAgICAgdGhpcy5wb3J0LmNsb3NlKCk7CiAgICAgICAgfQogICAgICAgIC8qKgogICAgICAgICAqIHtAbGluayBMeXJhRGVjb2RlclN0YXRlfSDjgYvjgokge0BsaW5rIEx5cmFEZWNvZGVyfSDjgpLlvqnlhYPjgZnjgosKICAgICAgICAgKgogICAgICAgICAqIHtAbGluayBMeXJhRGVjb2Rlcn0g44GvIHtAbGluayBNZXNzYWdlUG9ydC5wb3N0TWVzc2FnZSgpfSDjgpLkvb/jgaPjgabjgIEKICAgICAgICAgKiDliKXjga4gd2ViIHdvcmtlciDjgavou6LpgIHjgZnjgovjgZPjgajjgYzlj6/og73jgIIKICAgICAgICAgKiDjgZ/jgaDjgZfjgIHou6LpgIHmmYLjgavjga/jgq/jg6njgrnjgoTjg6Hjgr3jg4Pjg4njga7nirbmhYvjga/okL3jgaHjgabjgZfjgb7jgYbjga7jgafjgIEKICAgICAgICAgKiDjgZ3jgozjgpLlvqnlhYPjgZfjgablho3jgbPliKnnlKjlj6/og73jgavjgZnjgovjgZ/jgoHjga7plqLmlbDjgIIKICAgICAgICAgKiDjgarjgYrjgIHou6LpgIHjga7pmpvjgavjga8ge0BsaW5rIEx5cmFEZWNvZGVyLnBvcnR9IOOBruaJgOacieaoqeOCkuenu+itsuOBmeOCi+W/heimgeOBjOOBguOCi+OAggogICAgICAgICAqCiAgICAgICAgICogQHBhcmFtIHN0YXRlIOODh+OCs+ODvOODgOOBrueKtuaFiwogICAgICAgICAqI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hd0RhdGEpOwogICAgICAgIGlmIChlbmNvZGVkID09PSB1bmRlZmluZWQpIHsKICAgICAgICAgICAgLy8gRFRYIOOBjOacieWKueOAgeOBi+OBpOOAgSBlbmNvZGVkRnJhbWUg44GM54Sh6Z+z77yI44Gq44GE44GX44OO44Kk44K644Gu44G/44KS5ZCr44KT44Gn44GE44KL77yJ5aC05ZCI44Gr44Gv44GT44GT44Gr5p2l44KLCiAgICAgICAgICAgIHJldHVybjsKICAgICAgICB9CiAgICAgICAgZW5jb2RlZEZyYW1lLmRhdGEgPSBlbmNvZGVkLmJ1ZmZlcjsKICAgICAgICBjb250cm9sbGVyLmVucXVldWUoZW5jb2RlZEZyYW1lKTsKICAgIH0KICAgIC8qKgogICAgICogTHlyYSDjgafjgqjjg7PjgrPjg7zjg4njgZXjgozjgZ/pn7Plo7Djg4fjg7zjgr/jgpLjg4fjgrPjg7zjg4njgZfjgaYgUENN77yITDE277yJ44Gr5aSJ5o+b44GZ44KLCiAgICAgKgogICAgICogQHBhcmFtIGRlY29kZXIgTHlyYSDjg4fjgrPjg7zjg4AKICAgICAqIEBwYXJhbSBlbmNvZGVkRnJhbWUgTHlyYSDjgafjgqjjg7PjgrPjg7zjg4njgZXjgozjgZ/pn7Plo7Djg4fjg7zjgr8KICAgICAqIEBwYXJhbSBjb250cm9sbGVyIOmfs+WjsOODh+ODvOOCv+OBruWHuuWKm+OCreODpeODvAogICAgICogQGludGVybmFsCiAgICAgKi8KICAgIGFzeW5jIGZ1bmN0aW9uIHRyYW5zZm9ybUx5cmFUb1BjbShkZWNvZGVyLCBlbmNvZGVkRnJhbWUsIGNvbnRyb2xsZXIpIHsKICAgICAgICBpZiAoZW5jb2RlZEZyYW1lLmRhdGEuYnl0ZUxlbmd0aCA9PT0gMykgewogICAgICAgICAgICAvLyBlMmVlIOOCkuacieWKueOBq+OBl+OBn+WgtOWQiOOBq+OBr+OAgWUyZWUg44Oi44K444Ol44O844Or44GM5LiN5piO44Gq44OR44Kx44OD44OI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Y20oZGVjb2RlciwgZW5jb2RlZEZyYW1lLCBjb250cm9sbGVyKTsKICAgICAgICAgICAgfSwKICAgICAgICAgICAgZmx1c2goKSB7CiAgICAgICAgICAgICAgICBkZWNvZGVyLmRlc3Ryb3koKTsKICAgICAgICAgICAgfSwKICAgICAgICB9KTsKICAgIH0KICAgIG9ucnRjdHJhbnNmb3JtID0gKG1zZykgPT4gewogICAgICAgIGlmIChtc2cudHJhbnNmb3JtZXIub3B0aW9ucy5uYW1lID09PSAnc2VuZGVyVHJhbnNmb3JtJykgewogICAgICAgICAgICBjb25zdCB0cmFuc2Zvcm0gPSBjcmVhdGVTZW5kZXJUcmFuc2Zvcm0obXNnLnRyYW5zZm9ybWVyLm9wdGlvbnMubHlyYUVuY29kZXIpOwogICAgICAgICAgICBtc2cudHJhbnNmb3JtZXIucmVhZGFibGUKICAgICAgICAgICAgICAgIC5waXBlVGhyb3VnaCh0cmFuc2Zvcm0pCiAgICAgICAgICAgICAgICAucGlwZVRvKG1zZy50cmFuc2Zvcm1lci53cml0YWJsZSkKICAgICAgICAgICAgICAgIC5jYXRjaCgoZSkgPT4gY29uc29sZS53YXJuKGUpKTsKICAgICAgICB9CiAgICAgICAgZWxzZSBpZiAobXNnLnRyYW5zZm9ybWVyLm9wdGlvbnMubmFtZSA9PT0gJ3JlY2VpdmVyVHJhbnNmb3JtJykgewogICAgICAgICAgICBjb25zdCB0cmFuc2Zvcm0gPSBjcmVhdGVSZWNlaXZlclRyYW5zZm9ybShtc2cudHJhbnNmb3JtZXIub3B0aW9ucy5seXJhRGVjb2Rlcik7CiAgICAgICAgICAgIG1zZy50cmFuc2Zvcm1lci5yZWFkYWJsZQogICAgICAgICAgICAgICAgLnBpcGVUaHJvdWdoKHRyYW5zZm9ybSkKICAgICAgICAgICAgICAgIC5waXBlVG8obXNnLnRyYW5zZm9ybWVyLndyaXRhYmxlKQogICAgICAgICAgICAgICAgLmNhdGNoKChlKSA9PiBjb25zb2xlLndhcm4oZSkpOwogICAgICAgIH0KICAgICAgICBlbHNlIHsKICAgICAgICAgICAgY29uc29sZS53YXJuKCd1bmtub3duIG1lc3NhZ2UnKTsKICAgICAgICAgICAgY29uc29sZS53YXJuKG1zZyk7CiAgICAgICAgfQogICAgfTsKCn0pKTsK");return new Worker(URL.createObjectURL(new Blob([l],{type:"application/javascript"})))}async function a(l,Z,c){let b=new DataView(Z.data),d=new Int16Array(Z.data.byteLength/2);for(let l=0;l>1|(21845&B)<<1;K=(61680&(K=(52428&K)>>2|(13107&K)<<2))>>4|(3855&K)<<4,U[B]=((65280&K)>>8|(255&K)<<8)>>1}for(var T=function(l,Z,c){for(var b,d=l.length,m=0,I=new C(Z);m>V]=i}else for(m=0,b=new C(d);m>15-l[m]);return b},S=new y(288),B=0;B<144;++B)S[B]=8;for(var B=144;B<256;++B)S[B]=9;for(var B=256;B<280;++B)S[B]=7;for(var B=280;B<288;++B)S[B]=8;for(var v=new y(32),B=0;B<32;++B)v[B]=5;var z=T(S,9,0),w=T(S,9,1),O=T(v,5,0),j=T(v,5,1),x=function(l){for(var Z=l[0],c=1;cZ&&(Z=l[c]);return Z},f=function(l,Z,c){var b=Z/8|0;return(l[b]|l[b+1]<<8)>>(7&Z)&c},L=function(l,Z){var c=Z/8|0;return(l[c]|l[c+1]<<8|l[c+2]<<16)>>(7&Z)},M=function(l){return(l+7)/8|0},Q=function(l,Z,c){return(null==Z||Z<0)&&(Z=0),(null==c||c>l.length)&&(c=l.length),new y(l.subarray(Z,c))},E=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],P=function(l,Z,c){var b=Error(Z||E[l]);if(b.code=l,Error.captureStackTrace&&Error.captureStackTrace(b,P),!c)throw b;return b},D=function(l,Z,c,b){var d=l.length,m=b?b.length:0;if(!d||Z.f&&!Z.l)return c||new y(0);var I=!c,W=I||2!=Z.i,V=Z.i;I&&(c=new y(3*d));var i=function(l){var Z=c.length;if(l>Z){var b=new y(Math.max(2*Z,l));b.set(c),c=b}},t=Z.f||0,X=Z.p||0,g=Z.b||0,G=Z.l,e=Z.d,n=Z.m,a=Z.n,R=8*d;do{if(!G){t=f(l,X,1);var h=f(l,X+1,3);if(X+=3,h){if(1==h)G=w,e=j,n=9,a=5;else if(2==h){var s=f(l,X,31)+257,C=f(l,X+10,15)+4,o=s+f(l,X+5,31)+1;X+=14;for(var J=new y(o),F=new y(19),A=0;A>4;if(K<16)J[A++]=K;else{var S=0,v=0;for(16==K?(v=3+f(l,X,3),X+=2,S=J[A-1]):17==K?(v=3+f(l,X,7),X+=3):18==K&&(v=11+f(l,X,127),X+=7);v--;)J[A++]=S}}var z=J.subarray(0,s),O=J.subarray(s);n=x(z),a=x(O),G=T(z,n,1),e=T(O,a,1)}else P(1)}else{var K=M(X)+4,E=l[K-4]|l[K-3]<<8,D=K+E;if(D>d){V&&P(0);break}W&&i(g+E),c.set(l.subarray(K,D),g),Z.b=g+=E,Z.p=X=8*D,Z.f=t;continue}if(X>R){V&&P(0);break}}W&&i(g+131072);for(var q=(1<>4;if((X+=15&S)>R){V&&P(0);break}if(S||P(2),ll<256)c[g++]=ll;else if(256==ll){$=X,G=null;break}else{var lZ=ll-254;if(ll>264){var A=ll-257,lc=Y[A];lZ=f(l,X,(1<>4;lb||P(3),X+=15&lb;var O=H[ld];if(ld>3){var lc=u[ld];O+=L(l,X)&(1<R){V&&P(0);break}W&&i(g+131072);var lm=g+lZ;if(g>8},_=function(l,Z,c){c<<=7&Z;var b=Z/8|0;l[b]|=c,l[b+1]|=c>>8,l[b+2]|=c>>16},$=function(l,Z){for(var c=[],b=0;bg&&(g=m[b].s);var G=new C(g+1),e=ll(c[t-1],G,0);if(e>Z){var b=0,n=0,a=e-Z,R=1<Z)n+=R-(1<>=a;n>0;){var s=m[b].s;G[s]=0&&n;--b){var o=m[b].s;G[o]==Z&&(--G[o],++n)}e=Z}return{t:new y(G),l:e}},ll=function(l,Z,c){return -1==l.s?Math.max(ll(l.l,Z,c+1),ll(l.r,Z,c+1)):Z[l.s]=c},lZ=function(l){for(var Z=l.length;Z&&!l[--Z];);for(var c=new C(++Z),b=0,d=l[0],m=1,I=function(l){c[b++]=l},W=1;W<=Z;++W)if(l[W]==d&&W!=Z)++m;else{if(!d&&m>2){for(;m>138;m-=138)I(32754);m>2&&(I(m>10?m-11<<5|28690:m-3<<5|12305),m=0)}else if(m>3){for(I(d),--m;m>6;m-=6)I(8304);m>2&&(I(m-3<<5|8208),m=0)}for(;m--;)I(d);m=1,d=l[W]}return{c:c.subarray(0,b),n:Z}},lc=function(l,Z){for(var c=0,b=0;b>8,l[d+2]=255^l[d],l[d+3]=255^l[d+1];for(var m=0;m4&&!B[p[w-1]];--w);var j=i+5<<3,x=lc(d,S)+lc(m,v)+I,f=lc(d,a)+lc(m,s)+I+14+3*w+lc(H,B)+2*H[16]+3*H[17]+7*H[18];if(V>=0&&j<=x&&j<=f)return lb(Z,t,l.subarray(V,V+i));if(q(Z,t,1+(f15&&(q(Z,t,E[r]>>5&127),t+=E[r]>>12)}}else X=z,g=S,G=O,e=v;for(var r=0;r255){var P=D>>18&31;_(Z,t,X[P+257]),t+=g[P+257],P>7&&(q(Z,t,D>>23&31),t+=Y[P]);var ll=31&D;_(Z,t,G[ll]),t+=e[ll],ll>3&&(_(Z,t,D>>5&8191),t+=u[ll])}else _(Z,t,X[D]),t+=g[D]}return _(Z,t,X[256]),t+g[256]},lm=new o([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),lI=new y(0),lW=function(l,Z,c,b,d,m){var I=m.z||l.length,W=new y(b+I+5*(1+Math.ceil(I/7e3))+d),V=W.subarray(b,W.length-d),i=m.l,t=7&(m.r||0);if(Z){t&&(V[0]=m.r>>3);for(var X=lm[Z-1],g=X>>13,G=8191&X,e=(1<7e3||U>24576)&&(z>423||!i)){t=ld(l,V,0,p,J,F,k,U,K,H-K,t),U=N=k=0,K=H;for(var w=0;w<286;++w)J[w]=0;for(var w=0;w<30;++w)F[w]=0}var O=2,j=0,x=G,f=S-v&32767;if(z>2&&T==s(H-f))for(var L=Math.min(g,z)-1,E=Math.min(32767,H),P=Math.min(258,z);f<=E&&--x&&S!=v;){if(l[H+O]==l[H+O-f]){for(var D=0;DO){if(O=D,j=f,D>L)break;for(var q=Math.min(f,D-2),_=0,w=0;w_&&(_=lZ,v=$)}}}v=n[S=v],f+=S-v&32767}if(j){p[U++]=268435456|A[O]<<18|r[j];var lc=31&A[O],lI=31&r[j];k+=Y[lc]+u[lI],++J[257+lc],++F[lI],B=H+O,++N}else p[U++]=l[H],++J[l[H]]}}for(H=Math.max(H,B);H=I&&(V[t/8|0]=i,lW=I),t=lb(V,t+1,l.subarray(H,lW))}m.i=I}return Q(W,0,b+M(t)+d)},lV=function(){var l=1,Z=0;return{p:function(c){for(var b=l,d=Z,m=0|c.length,I=0;I!=m;){for(var W=Math.min(I+2655,m);I>16),d=(65535&d)+15*(d>>16)}l=b,Z=d},d:function(){return l%=65521,Z%=65521,(255&l)<<24|(65280&l)<<8|(255&Z)<<8|Z>>8}}},li=function(l,Z,c,b,d){if(!d&&(d={l:1},Z.dictionary)){var m=Z.dictionary.subarray(-32768),I=new y(m.length+l.length);I.set(m),I.set(l,m.length),l=I,d.w=m.length}return lW(l,null==Z.level?6:Z.level,null==Z.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(l.length)))):12+Z.mem,c,b,d)},lt=function(l,Z,c){for(;c;++Z)l[Z]=c,c>>>=8},lX=function(l,Z){var c=Z.level;if(l[0]=120,l[1]=(0==c?0:c<6?1:9==c?3:2)<<6|(Z.dictionary&&32),l[1]|=31-(l[0]<<8|l[1])%31,Z.dictionary){var b=lV();b.p(Z.dictionary),lt(l,2,b.d())}};function lg(l,Z){Z||(Z={});var c=lV();c.p(l);var b=li(l,Z,Z.dictionary?6:2,4);return lX(b,Z),lt(b,b.length-4,c.d()),b}function lG(l,Z){var c;return D(l.subarray((c=Z&&Z.dictionary,((15&l[0])!=8||l[0]>>4>7||(l[0]<<8|l[1])%31)&&P(6,"invalid zlib data"),(l[1]>>5&1)==+!c&&P(6,"invalid zlib data: "+(32&l[1]?"need":"unexpected")+" dictionary"),(l[1]>>3&4)+2),-4),{i:2},Z&&Z.out,Z&&Z.dictionary)}var le="undefined"!=typeof TextDecoder&&new TextDecoder;try{le.decode(lI,{stream:!0})}catch(l){}function ln(){let l=window.navigator.userAgent.toLocaleLowerCase();return -1!==l.indexOf("edge")?"edge":-1!==l.indexOf("chrome")&&-1===l.indexOf("edge")?"chrome":-1!==l.indexOf("safari")&&-1===l.indexOf("chrome")?"safari":-1!==l.indexOf("opera")?"opera":-1!==l.indexOf("firefox")?"firefox":null}function la(l){return void 0!==l.authn_metadata?l.authn_metadata:void 0!==l.metadata?l.metadata:null}function lR(l){return"object"==typeof l&&null!==l&&"pre_key_bundle"in l?l.pre_key_bundle:null}class lh extends Error{}function ls(l,Z,c){let b=new Event(l);try{b.data=JSON.parse(JSON.stringify(Z))}catch(l){b.data=Z}return b.transportType=c,b}function ly(l,Z,c,b,d){let m=new Event(l);try{m.data=JSON.parse(JSON.stringify(Z))}catch(l){m.data=Z}return m.logType=c,m.dataChannelId=b,m.dataChannelLabel=d,m}function lC(l,Z){if(Z){let Z=lG(new Uint8Array(l));return new TextDecoder().decode(Z)}return l}class lo{constructor(l,Z,c,d,m,I){this.midToAudioCodecType=new Map,this.senderStreamInitialized=new WeakSet,this.role=Z,this.channelId=c,this.metadata=d,this.signalingUrlCandidates=l,this.options=m,this.connectionTimeout=6e4,"number"==typeof this.options.timeout&&(console.warn("@deprecated timeout option will be removed in a future version. Use connectionTimeout."),this.connectionTimeout=this.options.timeout),"number"==typeof this.options.connectionTimeout&&(this.connectionTimeout=this.options.connectionTimeout),this.disconnectWaitTimeout=3e3,"number"==typeof this.options.disconnectWaitTimeout&&(this.disconnectWaitTimeout=this.options.disconnectWaitTimeout),this.signalingCandidateTimeout=3e3,"number"==typeof this.options.signalingCandidateTimeout&&(this.signalingCandidateTimeout=this.options.signalingCandidateTimeout),this.constraints=null,this.debug=I,this.clientId=null,this.connectionId=null,this.sessionId=null,this.remoteConnectionIds=[],this.stream=null,this.ws=null,this.pc=null,this.encodings=[],this.callbacks={disconnect:()=>{},push:()=>{},addstream:()=>{},track:()=>{},removestream:()=>{},removetrack:()=>{},notify:()=>{},log:()=>{},timeout:()=>{},timeline:()=>{},signaling:()=>{},message:()=>{},datachannel:()=>{}},this.authMetadata=null,this.e2ee=null,this.connectionTimeoutTimerId=0,this.monitorSignalingWebSocketEventTimerId=0,this.monitorIceConnectionStateChangeTimerId=0,this.soraDataChannels={},this.mids={audio:"",video:""},this.signalingSwitched=!1,this.signalingOfferMessageDataChannels={},this.connectedSignalingUrl="",this.contactSignalingUrl="",void 0!==b&&(this.lyra=new s)}on(l,Z){"addstream"===l?console.warn("@deprecated addstream callback will be removed in a future version. Use track callback."):"removestream"===l&&console.warn("@deprecated removestream callback will be removed in a future version. Use removetrack callback."),l in this.callbacks&&(this.callbacks[l]=Z)}stopAudioTrack(l){for(let Z of l.getAudioTracks())Z.enabled=!1;return new Promise((Z,c)=>{setTimeout(()=>{Promise.all(l.getAudioTracks().map(async Z=>{if(Z.stop(),l.removeTrack(Z),null!==this.pc){let l=this.pc.getSenders().find(l=>l.track&&l.track.id===Z.id);if(l)return l.replaceTrack(null)}})).then(()=>Z()).catch(c)},100)})}stopVideoTrack(l){for(let Z of l.getVideoTracks())Z.enabled=!1;return new Promise((Z,c)=>{setTimeout(()=>{Promise.all(l.getVideoTracks().map(async Z=>{if(Z.stop(),l.removeTrack(Z),null!==this.pc){let l=this.pc.getSenders().find(l=>l.track&&l.track.id===Z.id);if(l)return l.replaceTrack(null)}})).then(()=>Z()).catch(c)},100)})}async replaceAudioTrack(l,Z){await this.stopAudioTrack(l);let c=this.getAudioTransceiver();if(null===c)throw Error("Unable to set an audio track. Audio track sender is undefined");l.addTrack(Z),await c.sender.replaceTrack(Z),await this.setupSenderTransform(c.sender)}async replaceVideoTrack(l,Z){await this.stopVideoTrack(l);let c=this.getVideoTransceiver();if(null===c)throw Error("Unable to set video track. Video track sender is undefined");l.addTrack(Z),await c.sender.replaceTrack(Z),await this.setupSenderTransform(c.sender)}signalingTerminate(){for(let l of Object.keys(this.soraDataChannels)){let Z=this.soraDataChannels[l];Z&&Z.close(),delete this.soraDataChannels[l]}this.ws&&(this.ws.close(),this.ws=null),this.pc&&this.pc.close(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection()}abendPeerConnectionState(l){for(let l of(this.clearMonitorIceConnectionStateChange(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=l=>{this.writeWebSocketTimelineLog("onclose",{code:l.code,reason:l.reason})},this.ws.onmessage=null,this.ws.onerror=null),Object.keys(this.soraDataChannels))){let Z=this.soraDataChannels[l];Z&&(Z.onclose=l=>{let Z=l.currentTarget;this.writeDataChannelTimelineLog("onclose",Z),this.trace("CLOSE DATA CHANNEL",Z.label)},Z.onmessage=null,Z.onerror=null)}for(let l of Object.keys(this.soraDataChannels)){let Z=this.soraDataChannels[l];Z&&Z.close(),delete this.soraDataChannels[l]}this.ws&&(this.ws.close(),this.ws=null),this.pc&&this.pc.close(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection();let Z=this.soraCloseEvent("abend",l);this.callbacks.disconnect(Z),this.writeSoraTimelineLog("disconnect-abend",Z)}async abend(l,Z){for(let l of(this.clearMonitorIceConnectionStateChange(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=l=>{this.writeWebSocketTimelineLog("onclose",{code:l.code,reason:l.reason})},this.ws.onmessage=null,this.ws.onerror=null),Object.keys(this.soraDataChannels))){let Z=this.soraDataChannels[l];Z&&(Z.onclose=l=>{let Z=l.currentTarget;this.writeDataChannelTimelineLog("onclose",Z),this.trace("CLOSE DATA CHANNEL",Z.label)},Z.onmessage=null,Z.onerror=null)}if(this.soraDataChannels.signaling){let Z={type:"disconnect",reason:l};if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){let l=lg(new TextEncoder().encode(JSON.stringify(Z)),{});if("open"===this.soraDataChannels.signaling.readyState)try{this.soraDataChannels.signaling.send(l),this.writeDataChannelSignalingLog("send-disconnect",this.soraDataChannels.signaling,Z)}catch(Z){let l=Z.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.soraDataChannels.signaling,l)}}else if("open"===this.soraDataChannels.signaling.readyState)try{this.soraDataChannels.signaling.send(JSON.stringify(Z)),this.writeDataChannelSignalingLog("send-disconnect",this.soraDataChannels.signaling,Z)}catch(Z){let l=Z.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.soraDataChannels.signaling,l)}}for(let l of Object.keys(this.soraDataChannels)){let Z=this.soraDataChannels[l];Z&&(Z.onerror=null,Z.close()),delete this.soraDataChannels[l]}if(await this.disconnectWebSocket(l),await this.disconnectPeerConnection(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection(),"WEBSOCKET-ONCLOSE"===l&&Z&&(1e3===Z.code||1005===Z.code)){let l=this.soraCloseEvent("normal","DISCONNECT",Z);this.writeSoraTimelineLog("disconnect-normal",l),this.callbacks.disconnect(l);return}let c=this.soraCloseEvent("abend",l,Z);this.writeSoraTimelineLog("disconnect-abend",c),this.callbacks.disconnect(this.soraCloseEvent("abend",l,Z))}initializeConnection(){this.clientId=null,this.connectionId=null,this.sessionId=null,this.remoteConnectionIds=[],this.stream=null,this.ws=null,this.pc=null,this.encodings=[],this.authMetadata=null,this.e2ee=null,this.soraDataChannels={},this.mids={audio:"",video:""},this.signalingSwitched=!1,this.signalingOfferMessageDataChannels={},this.contactSignalingUrl="",this.connectedSignalingUrl="",this.clearConnectionTimeout()}disconnectWebSocket(l){let Z=0;return this.signalingSwitched?(this.ws&&(this.ws.close(),this.ws=null),Promise.resolve(null)):new Promise((c,b)=>{if(!this.ws)return c(null);if(this.ws.onclose=l=>(this.ws&&(this.ws.close(),this.ws=null),clearTimeout(Z),this.writeWebSocketTimelineLog("onclose",{code:l.code,reason:l.reason}),c({code:l.code,reason:l.reason})),1!==this.ws.readyState)return this.ws.close(),this.ws=null,c(null);{let b={type:"disconnect",reason:l};this.ws.send(JSON.stringify(b)),this.writeWebSocketSignalingLog("send-disconnect",b),Z=setTimeout(()=>{this.ws&&(this.ws.close(),this.ws=null),c({code:1006,reason:""})},this.disconnectWaitTimeout)}})}disconnectDataChannel(){let l=()=>{for(let l of Object.keys(this.soraDataChannels)){let Z=this.soraDataChannels[l];Z&&(Z.onerror=null,Z.close()),delete this.soraDataChannels[l]}};return new Promise((Z,c)=>{if(!this.soraDataChannels.signaling)return l(),Z({code:4999,reason:""});let b=setTimeout(()=>(l(),c()),this.disconnectWaitTimeout),d=[];for(let c of Object.keys(this.soraDataChannels)){let m=this.soraDataChannels[c];if(m){m.onerror=()=>(clearTimeout(b),l(),Z({code:4999,reason:""}));let c=()=>new Promise((l,Z)=>{let c=0,b=setInterval(()=>{c++,"closed"===m.readyState&&(clearInterval(b),l()),this.disconnectWaitTimeout<100*c&&(l(),clearInterval(b))},100)});d.push(c())}}Promise.all(d).then(()=>{0===Object.keys(this.soraDataChannels).length?Z(null):Z({code:4999,reason:""})}).catch(l=>c(l)).finally(()=>{l(),clearTimeout(b)});let m={type:"disconnect",reason:"NO-ERROR"};if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){let l=lg(new TextEncoder().encode(JSON.stringify(m)),{});if("open"===this.soraDataChannels.signaling.readyState)try{this.soraDataChannels.signaling.send(l),this.writeDataChannelSignalingLog("send-disconnect",this.soraDataChannels.signaling,m)}catch(Z){let l=Z.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.soraDataChannels.signaling,l)}}else if("open"===this.soraDataChannels.signaling.readyState)try{this.soraDataChannels.signaling.send(JSON.stringify(m)),this.writeDataChannelSignalingLog("send-disconnect",this.soraDataChannels.signaling,m)}catch(Z){let l=Z.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.soraDataChannels.signaling,l)}})}disconnectPeerConnection(){return new Promise((l,Z)=>(this.pc&&"closed"!==this.pc.connectionState&&this.pc.close(),l()))}async disconnect(){for(let l of(this.clearMonitorIceConnectionStateChange(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=l=>{this.writeWebSocketTimelineLog("onclose",{code:l.code,reason:l.reason})},this.ws.onmessage=null,this.ws.onerror=null),Object.keys(this.soraDataChannels))){let Z=this.soraDataChannels[l];Z&&(Z.onmessage=null,Z.onclose=l=>{let Z=l.currentTarget;this.writeDataChannelTimelineLog("onclose",Z),this.trace("CLOSE DATA CHANNEL",Z.label)})}let l=null;if(this.signalingSwitched){try{let Z=await this.disconnectDataChannel();null!==Z&&(l=this.soraCloseEvent("normal","DISCONNECT",Z))}catch(Z){l=this.soraCloseEvent("abend","DISCONNECT-TIMEOUT")}await this.disconnectWebSocket("NO-ERROR"),await this.disconnectPeerConnection()}else{let Z=await this.disconnectWebSocket("NO-ERROR");await this.disconnectPeerConnection(),null!==Z&&(l=this.soraCloseEvent("normal","DISCONNECT",Z))}this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection(),l&&("abend"===l.type?this.writeSoraTimelineLog("disconnect-abend",l):"normal"===l.type&&this.writeSoraTimelineLog("disconnect-normal",l),this.callbacks.disconnect(l))}setupE2EE(){!0===this.options.e2ee&&(this.e2ee=new I,this.e2ee.onWorkerDisconnect=async()=>{await this.abend("INTERNAL-ERROR",{reason:"CRASH-E2EE-WORKER"})},this.e2ee.startWorker())}startE2EE(){if(!0===this.options.e2ee&&this.e2ee){if(!this.connectionId){let l=Error();throw l.message="E2EE failed. Self connectionId is null",l}this.e2ee.clearWorker();let l=this.e2ee.start(this.connectionId);this.e2ee.postSelfSecretKeyMaterial(this.connectionId,l.selfKeyId,l.selfSecretKeyMaterial)}}async getSignalingWebSocket(l){if("string"==typeof l)return new Promise((Z,c)=>{let b=new WebSocket(l);b.onclose=l=>{let Z=new lh(`Signaling failed. CloseEventCode:${l.code} CloseEventReason:'${l.reason}'`);Z.code=l.code,Z.reason=l.reason,this.writeWebSocketTimelineLog("onclose",Z),c(Z)},b.onopen=l=>{Z(b)}});if(Array.isArray(l)){let Z=!1,c=l=>new Promise((c,b)=>{let d=new WebSocket(l),m=setTimeout(()=>{this.writeWebSocketSignalingLog("signaling-url-candidate",{type:"timeout",url:d.url}),d&&!Z&&(d.onclose=null,d.onerror=null,d.onopen=null,d.close(),b())},this.signalingCandidateTimeout);d.onclose=l=>{this.writeWebSocketSignalingLog("signaling-url-candidate",{type:"close",url:d.url,message:"WebSocket closed",code:l.code,reason:l.reason}),d&&d.close(),clearInterval(m),b()},d.onerror=l=>{this.writeWebSocketSignalingLog("signaling-url-candidate",{type:"error",url:d.url,message:"Failed to connect WebSocket"}),d&&(d.onclose=null,d.close()),clearInterval(m),b()},d.onopen=l=>{d&&(clearInterval(m),Z?(this.writeWebSocketSignalingLog("signaling-url-candidate",{type:"open",url:d.url,selected:!1}),d.onerror=null,d.onclose=null,d.onopen=null,d.close(),b()):(this.writeWebSocketSignalingLog("signaling-url-candidate",{type:"open",url:d.url,selected:!0}),d.onerror=null,d.onclose=null,d.onopen=null,Z=!0,c(d)))}});try{return await Promise.any(l.map(l=>c(l)))}catch(l){throw new lh("Signaling failed. All signaling URL candidates failed to connect")}}throw new lh("Signaling failed. Invalid format signaling URL candidates")}async signaling(l,Z=!1){let c=await this.createOffer();return this.trace("CREATE OFFER",c),new Promise((b,d)=>{this.writeWebSocketSignalingLog("new-websocket",l.url),l.binaryType="arraybuffer",l.onclose=l=>{let Z=new lh(`Signaling failed. CloseEventCode:${l.code} CloseEventReason:'${l.reason}'`);Z.code=l.code,Z.reason=l.reason,this.writeWebSocketTimelineLog("onclose",Z),this.signalingTerminate(),d(Z)},l.onmessage=async Z=>{if(Z.data instanceof ArrayBuffer){this.writeWebSocketSignalingLog("onmessage-e2ee",Z.data),this.signalingOnMessageE2EE(Z.data);return}if("string"!=typeof Z.data)throw Error("Received invalid signaling data");let c=JSON.parse(Z.data);if("offer"===c.type)this.writeWebSocketSignalingLog("onmessage-offer",c),this.signalingOnMessageTypeOffer(c),this.connectedSignalingUrl=l.url,b(c);else if("update"===c.type)this.writeWebSocketSignalingLog("onmessage-update",c),await this.signalingOnMessageTypeUpdate(c);else if("re-offer"===c.type)this.writeWebSocketSignalingLog("onmessage-re-offer",c),await this.signalingOnMessageTypeReOffer(c);else if("ping"===c.type)await this.signalingOnMessageTypePing(c);else if("push"===c.type)this.callbacks.push(c,"websocket");else if("notify"===c.type)"connection.created"===c.event_type?this.writeWebSocketTimelineLog("notify-connection.created",c):"connection.destroyed"===c.event_type&&this.writeWebSocketTimelineLog("notify-connection.destroyed",c),this.signalingOnMessageTypeNotify(c,"websocket");else if("switched"===c.type)this.writeWebSocketSignalingLog("onmessage-switched",c),this.signalingOnMessageTypeSwitched(c);else if("redirect"===c.type){this.writeWebSocketSignalingLog("onmessage-redirect",c);try{let l=await this.signalingOnMessageTypeRedirect(c);b(l)}catch(l){d(l)}}},(async()=>{let b;try{b=function(l,Z,c,b,d,m){if("sendrecv"!==Z&&"sendonly"!==Z&&"recvonly"!==Z)throw Error("Unknown role type");if(null==c)throw Error("channelId can not be null or undefined");let I={type:"connect",sora_client:"Sora JavaScript SDK 2023.2.0",environment:window.navigator.userAgent,role:Z,channel_id:c,sdp:l,audio:!0,video:!0};if("sendrecv"===Z&&!0!==d.multistream)throw Error("Failed to parse options. Options multistream must be true when connecting using 'sendrecv'");!0===m&&(I.redirect=!0),"boolean"==typeof d.multistream&&(I.multistream=d.multistream),"boolean"==typeof d.simulcast&&(I.simulcast=d.simulcast),void 0!==d.simulcastRid&&0<=["r0","r1","r2"].indexOf(d.simulcastRid)&&(I.simulcast_rid=d.simulcastRid),"boolean"==typeof d.spotlight&&(I.spotlight=d.spotlight),"spotlightNumber"in d&&(I.spotlight_number=d.spotlightNumber);let W=["none","r0","r1","r2"];void 0!==d.spotlightFocusRid&&0<=W.indexOf(d.spotlightFocusRid)&&(I.spotlight_focus_rid=d.spotlightFocusRid),void 0!==d.spotlightUnfocusRid&&0<=W.indexOf(d.spotlightUnfocusRid)&&(I.spotlight_unfocus_rid=d.spotlightUnfocusRid),void 0!==b&&(I.metadata=b),void 0!==d.signalingNotifyMetadata&&(I.signaling_notify_metadata=d.signalingNotifyMetadata),void 0!==d.forwardingFilter&&(I.forwarding_filter=d.forwardingFilter),void 0!==d.clientId&&(I.client_id=d.clientId),void 0!==d.bundleId&&(I.bundle_id=d.bundleId),"boolean"==typeof d.dataChannelSignaling&&(I.data_channel_signaling=d.dataChannelSignaling),"boolean"==typeof d.ignoreDisconnectWebSocket&&(I.ignore_disconnect_websocket=d.ignoreDisconnectWebSocket);let i=["audioCodecType","audioBitRate"],t=["audioOpusParamsChannels","audioOpusParamsMaxplaybackrate","audioOpusParamsStereo","audioOpusParamsSpropStereo","audioOpusParamsMinptime","audioOpusParamsPtime","audioOpusParamsUseinbandfec","audioOpusParamsUsedtx"],X=["audioLyraParamsBitrate","audioLyraParamsUsedtx"],g=["videoCodecType","videoBitRate","videoVP9Params","videoH264Params","videoH265Params","videoAV1Params"],G=Object.assign({},d);Object.keys(G).filter(l=>{"audio"===l&&"boolean"==typeof G[l]||"video"===l&&"boolean"==typeof G[l]||0<=i.indexOf(l)&&null!==G[l]||0<=t.indexOf(l)&&null!==G[l]||0<=X.indexOf(l)&&null!==G[l]||0<=g.indexOf(l)&&null!==G[l]||delete G[l]}),void 0!==G.audio&&(I.audio=G.audio);let e=Object.keys(G).some(l=>0<=i.indexOf(l));I.audio&&e&&(I.audio={},"audioCodecType"in G&&(I.audio.codec_type=G.audioCodecType),"audioBitRate"in G&&(I.audio.bit_rate=G.audioBitRate));let n=Object.keys(G).some(l=>0<=t.indexOf(l));I.audio&&n&&("object"!=typeof I.audio&&(I.audio={}),I.audio.opus_params={},"audioOpusParamsChannels"in G&&(I.audio.opus_params.channels=G.audioOpusParamsChannels),"audioOpusParamsMaxplaybackrate"in G&&(I.audio.opus_params.maxplaybackrate=G.audioOpusParamsMaxplaybackrate),"audioOpusParamsStereo"in G&&(I.audio.opus_params.stereo=G.audioOpusParamsStereo),"audioOpusParamsSpropStereo"in G&&(I.audio.opus_params.sprop_stereo=G.audioOpusParamsSpropStereo),"audioOpusParamsMinptime"in G&&(I.audio.opus_params.minptime=G.audioOpusParamsMinptime),"audioOpusParamsPtime"in G&&(I.audio.opus_params.ptime=G.audioOpusParamsPtime),"audioOpusParamsUseinbandfec"in G&&(I.audio.opus_params.useinbandfec=G.audioOpusParamsUseinbandfec),"audioOpusParamsUsedtx"in G&&(I.audio.opus_params.usedtx=G.audioOpusParamsUsedtx)),I.audio&&"LYRA"===d.audioCodecType&&("object"!=typeof I.audio&&(I.audio={}),I.audio.lyra_params={version:V},"audioLyraParamsBitrate"in G&&(I.audio.lyra_params.bitrate=G.audioLyraParamsBitrate),"audioLyraParamsUsedtx"in G&&(I.audio.lyra_params.usedtx=G.audioLyraParamsUsedtx)),void 0!==G.video&&(I.video=G.video);let a=Object.keys(G).some(l=>0<=g.indexOf(l));if(I.video&&a&&(I.video={},"videoCodecType"in G&&(I.video.codec_type=G.videoCodecType),"videoBitRate"in G&&(I.video.bit_rate=G.videoBitRate),"videoVP9Params"in G&&(I.video.vp9_params=G.videoVP9Params),"videoH264Params"in G&&(I.video.h264_params=G.videoH264Params),"videoH265Params"in G&&(I.video.h265_params=G.videoH265Params),"videoAV1Params"in G&&(I.video.av1_params=G.videoAV1Params)),I.simulcast&&!function(){if(!window.RTCRtpSender||!RTCRtpSender.getCapabilities)return!1;let l=RTCRtpSender.getCapabilities("video");if(!l)return!1;let Z=l.headerExtensions.map(l=>l.uri);return["urn:ietf:params:rtp-hdrext:sdes:mid","urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id","urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id"].every(l=>Z.includes(l))}()&&"recvonly"!==Z)throw Error("Simulcast can not be used with this browser");if("boolean"==typeof d.e2ee&&(I.e2ee=d.e2ee),!0===d.e2ee){if(void 0===I.signaling_notify_metadata&&(I.signaling_notify_metadata={}),null===I.signaling_notify_metadata||"object"!=typeof I.signaling_notify_metadata)throw Error("E2EE failed. Options signalingNotifyMetadata must be type 'object'");!0===I.video&&(I.video={}),I.video&&(I.video.codec_type="VP8")}return Array.isArray(d.dataChannels)&&0{this.pc&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState))},this.pc.onicegatheringstatechange=l=>{this.pc&&this.writePeerConnectionTimelineLog("onicegatheringstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState})},this.pc.onconnectionstatechange=l=>{this.pc&&this.writePeerConnectionTimelineLog("onconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState})},this.pc.ondatachannel=l=>{this.onDataChannel(l)}}async setRemoteDescription(l){if(!this.pc)return;let Z=this.processOfferSdp(l.sdp),c=new RTCSessionDescription({type:"offer",sdp:Z});await this.pc.setRemoteDescription(c),this.writePeerConnectionTimelineLog("set-remote-description",c)}async createAnswer(l){if(!this.pc)return;for(let l of Object.values(this.mids)){let Z=this.pc.getTransceivers().find(Z=>Z.mid===l);Z&&"recvonly"===Z.direction&&(Z.direction="sendrecv")}if(this.options.simulcast&&("sendrecv"===this.role||"sendonly"===this.role)){let Z=this.pc.getTransceivers().find(l=>{if(null!==l.mid&&null!==l.sender.track&&(null===l.currentDirection||"sendonly"===l.currentDirection)&&(""!==this.mids.video&&this.mids.video===l.mid||0<=l.mid.indexOf("video")))return l});if(Z){await this.setSenderParameters(Z,this.encodings),await this.setRemoteDescription(l),this.trace("TRANSCEIVER SENDER GET_PARAMETERS",Z.sender.getParameters()),await this.setSenderParameters(Z,this.encodings);let c=await this.pc.createAnswer();void 0!==c.sdp&&(c.sdp=this.processAnswerSdpForLocal(c.sdp)),await this.pc.setLocalDescription(c),this.trace("TRANSCEIVER SENDER GET_PARAMETERS",Z.sender.getParameters());return}}let Z=await this.pc.createAnswer();void 0!==Z.sdp&&(Z.sdp=this.processAnswerSdpForLocal(Z.sdp)),this.writePeerConnectionTimelineLog("create-answer",Z),await this.pc.setLocalDescription(Z),this.writePeerConnectionTimelineLog("set-local-description",Z)}processOfferSdp(l){let Z=l;if("firefox"===ln()&&(Z=Z.replace(/^m=(audio|video) 0 /gm,(l,Z)=>`m=${Z} 9 `)),this.midToAudioCodecType.clear(),void 0===this.lyra||!Z.includes("109 lyra/"))return Z;for(let l of Z.split(/^m=/m).slice(1)){if(!l.startsWith("audio"))continue;let Z=/a=mid:(.*)/.exec(l);if(Z){let c=l.includes("109 lyra/")?"LYRA":"OPUS";this.midToAudioCodecType.set(Z[1],c)}}return this.lyra.processOfferSdp(Z)}processAnswerSdpForLocal(l){return void 0===this.lyra?l:this.lyra.processAnswerSdpForLocal(l)}processAnswerSdpForSora(l){return void 0===this.lyra?l:this.lyra.processAnswerSdpForSora(l)}async setupSenderTransform(l){if(null===this.e2ee&&void 0===this.lyra||null===l.track||this.senderStreamInitialized.has(l))return;let Z="audio"===l.track.kind&&"LYRA"===this.options.audioCodecType;if("transform"in RTCRtpSender.prototype){if(!Z||void 0===this.lyra)return;let c=n(),b=await this.lyra.createEncoder();l.transform=new RTCRtpScriptTransform(c,{name:"senderTransform",lyraEncoder:b},[b.port])}else{let c=l.createEncodedStreams(),b=c.readable;if(Z&&void 0!==this.lyra){let l=await this.lyra.createEncoder(),Z=new TransformStream({transform:(Z,c)=>a(l,Z,c)});b=c.readable.pipeThrough(Z)}this.e2ee?this.e2ee.setupSenderTransform(b,c.writable):b.pipeTo(c.writable).catch(l=>console.warn(l))}this.senderStreamInitialized.add(l)}async setupReceiverTransform(l,Z){if(null===this.e2ee&&void 0===this.lyra)return;let c=this.midToAudioCodecType.get(l||"");if("transform"in RTCRtpSender.prototype){if("LYRA"!==c||void 0===this.lyra)return;let l=n(),b=await this.lyra.createDecoder();Z.transform=new RTCRtpScriptTransform(l,{name:"receiverTransform",lyraDecoder:b},[b.port])}else{let l=Z.createEncodedStreams(),b=l.writable;if("LYRA"===c&&void 0!==this.lyra){let Z=await this.lyra.createDecoder(),c=new TransformStream({transform:(l,c)=>R(Z,l,c)});c.readable.pipeTo(l.writable).catch(l=>console.warn(l)),b=c.writable}this.e2ee?this.e2ee.setupReceiverTransform(l.readable,b):l.readable.pipeTo(b).catch(l=>console.warn(l))}}sendAnswer(){if(this.pc&&this.ws&&this.pc.localDescription){this.trace("ANSWER SDP",this.pc.localDescription.sdp);let l={type:"answer",sdp:this.processAnswerSdpForSora(this.pc.localDescription.sdp)};this.ws.send(JSON.stringify(l)),this.writeWebSocketSignalingLog("send-answer",l)}}onIceCandidate(){return new Promise((l,Z)=>{this.pc&&(this.pc.oniceconnectionstatechange=Z=>{this.pc&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState),"connected"===this.pc.iceConnectionState&&l())},this.pc.onicecandidate=Z=>{if(this.writePeerConnectionTimelineLog("onicecandidate",Z.candidate),this.pc&&this.trace("ONICECANDIDATE ICEGATHERINGSTATE",this.pc.iceGatheringState),null===Z.candidate)l();else{let l=Object.assign(Z.candidate.toJSON(),{type:"candidate"});this.trace("ONICECANDIDATE CANDIDATE MESSAGE",l),this.sendSignalingMessage(l)}})})}waitChangeConnectionStateConnected(){return new Promise((l,Z)=>{if(this.pc&&void 0===this.pc.connectionState){l();return}let c=setInterval(()=>{if(this.pc)this.pc&&"connected"===this.pc.connectionState&&(clearInterval(c),l());else{let l=Error();l.message="PeerConnection connectionState did not change to 'connected'",clearInterval(c),Z(l)}},10)})}monitorSignalingWebSocketEvent(){return new Promise((l,Z)=>{this.monitorSignalingWebSocketEventTimerId=setInterval(()=>{this.ws&&(this.clearMonitorSignalingWebSocketEvent(),this.ws.onclose=l=>{let c=new lh(`Signaling failed. CloseEventCode:${l.code} CloseEventReason:'${l.reason}'`);c.code=l.code,c.reason=l.reason,this.writeWebSocketTimelineLog("onclose",c),this.signalingTerminate(),Z(c)},this.ws.onerror=l=>{let c=new lh("Signaling failed. WebSocket onerror was called");this.writeWebSocketSignalingLog("onerror",c),this.signalingTerminate(),Z(c)})},100)})}monitorWebSocketEvent(){this.ws&&(this.ws.onclose=async l=>{this.writeWebSocketTimelineLog("onclose",{code:l.code,reason:l.reason}),await this.abend("WEBSOCKET-ONCLOSE",{code:l.code,reason:l.reason})},this.ws.onerror=async l=>{this.writeWebSocketSignalingLog("onerror"),await this.abend("WEBSOCKET-ONERROR")})}monitorPeerConnectionState(){this.pc&&(this.pc.oniceconnectionstatechange=l=>{this.pc&&void 0===this.pc.connectionState&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState),clearTimeout(this.monitorIceConnectionStateChangeTimerId),"failed"===this.pc.iceConnectionState?this.abendPeerConnectionState("ICE-CONNECTION-STATE-FAILED"):"disconnected"===this.pc.iceConnectionState&&(this.monitorIceConnectionStateChangeTimerId=setTimeout(()=>{this.pc&&"disconnected"===this.pc.iceConnectionState&&this.abendPeerConnectionState("ICE-CONNECTION-STATE-DISCONNECTED-TIMEOUT")},1e4)))},this.pc.onconnectionstatechange=l=>{this.pc&&(this.writePeerConnectionTimelineLog("onconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),"failed"===this.pc.connectionState&&this.abendPeerConnectionState("CONNECTION-STATE-FAILED"))})}setConnectionTimeout(){return new Promise((l,Z)=>{0{if(!this.pc||this.pc&&void 0!==this.pc.connectionState&&"connected"!==this.pc.connectionState){let l=Error();l.message="Signaling connection timeout",this.callbacks.timeout(),this.trace("DISCONNECT","Signaling connection timeout"),this.writePeerConnectionTimelineLog("signaling-connection-timeout",{connectionTimeout:this.connectionTimeout}),this.signalingTerminate(),Z(l)}},this.connectionTimeout))})}clearConnectionTimeout(){clearTimeout(this.connectionTimeoutTimerId)}clearMonitorSignalingWebSocketEvent(){clearInterval(this.monitorSignalingWebSocketEventTimerId)}clearMonitorIceConnectionStateChange(){clearInterval(this.monitorIceConnectionStateChangeTimerId)}trace(l,Z){this.callbacks.log(l,Z),this.debug&&function(l,Z,c){let b=l=>{if(l&&"object"==typeof l){let Z=null;try{Z=Object.keys(JSON.parse(JSON.stringify(l)))}catch(l){}Z&&Array.isArray(Z)?Z.filter(Z=>{console.group(Z),b(l[Z]),console.groupEnd()}):console.info(l)}else console.info(l)},d="";window.performance&&(d=`[${(window.performance.now()/1e3).toFixed(3)}]`),l&&(d=`${d}[${l}]`),void 0!==console.info&&void 0!==console.group?(console.group(`${d} ${Z}`),b(c),console.groupEnd()):console.log(`${d} ${Z} -`,c)}(this.clientId,l,Z)}writeWebSocketSignalingLog(l,Z){this.callbacks.signaling(ls(l,Z,"websocket")),this.writeWebSocketTimelineLog(l,Z)}writeDataChannelSignalingLog(l,Z,c){this.callbacks.signaling(ls(l,c,"datachannel")),this.writeDataChannelTimelineLog(l,Z,c)}writeWebSocketTimelineLog(l,Z){let c=ly(l,Z,"websocket");this.callbacks.timeline(c)}writeDataChannelTimelineLog(l,Z,c){let b=ly(l,c,"datachannel",Z.id,Z.label);this.callbacks.timeline(b)}writePeerConnectionTimelineLog(l,Z){let c=ly(l,Z,"peerconnection");this.callbacks.timeline(c)}writeSoraTimelineLog(l,Z){let c=ly(l,Z,"sora");this.callbacks.timeline(c)}async createOffer(){let l=new window.RTCPeerConnection({iceServers:[]});if("safari"===ln()){l.addTransceiver("video",{direction:"recvonly"}),l.addTransceiver("audio",{direction:"recvonly"});let Z=await l.createOffer();return l.close(),this.writePeerConnectionTimelineLog("create-offer",Z),Z}let Z=await l.createOffer({offerToReceiveAudio:!0,offerToReceiveVideo:!0});return l.close(),this.writePeerConnectionTimelineLog("create-offer",Z),Z}signalingOnMessageE2EE(l){if(this.e2ee){let Z=new Uint8Array(l),c=this.e2ee.receiveMessage(Z);this.e2ee.postRemoteSecretKeyMaterials(c),c.messages.filter(l=>{this.sendE2EEMessage(l.buffer)})}}signalingOnMessageTypeOffer(l){if(this.clientId=l.client_id,this.connectionId=l.connection_id,void 0!==l.session_id&&(this.sessionId=l.session_id),void 0!==l.metadata&&(this.authMetadata=l.metadata),Array.isArray(l.encodings)&&(this.encodings=l.encodings),void 0!==l.mid&&void 0!==l.mid.audio&&(this.mids.audio=l.mid.audio),void 0!==l.mid&&void 0!==l.mid.video&&(this.mids.video=l.mid.video),l.data_channels)for(let Z of l.data_channels)this.signalingOfferMessageDataChannels[Z.label]=Z;this.trace("SIGNALING OFFER MESSAGE",l),this.trace("OFFER SDP",l.sdp)}sendUpdateAnswer(){this.pc&&this.ws&&this.pc.localDescription&&(this.trace("ANSWER SDP",this.pc.localDescription.sdp),this.sendSignalingMessage({type:"update",sdp:this.pc.localDescription.sdp}))}sendReAnswer(){this.pc?.localDescription&&(this.trace("RE ANSWER SDP",this.pc.localDescription.sdp),this.sendSignalingMessage({type:"re-answer",sdp:this.pc.localDescription.sdp}))}async signalingOnMessageTypeUpdate(l){this.trace("SIGNALING UPDATE MESSGE",l),this.trace("UPDATE SDP",l.sdp),await this.setRemoteDescription(l),await this.createAnswer(l),this.sendUpdateAnswer()}async signalingOnMessageTypeReOffer(l){this.trace("SIGNALING RE OFFER MESSGE",l),this.trace("RE OFFER SDP",l.sdp),await this.setRemoteDescription(l),await this.createAnswer(l),this.sendReAnswer()}async signalingOnMessageTypePing(l){let Z={type:"pong"};if(l.stats){let l=await this.getStats();Z.stats=l}this.ws&&this.ws.send(JSON.stringify(Z))}signalingOnMessageTypeNotify(l,Z){if("connection.created"===l.event_type){let Z=l.connection_id;if(this.connectionId!==Z){let c=lR(la(l));if(c&&this.e2ee&&Z){let l=this.e2ee.startSession(Z,c);this.e2ee.postRemoteSecretKeyMaterials(l),l.messages.filter(l=>{this.sendE2EEMessage(l.buffer)}),this.e2ee.postSelfSecretKeyMaterial(l.selfConnectionId,l.selfKeyId,l.selfSecretKeyMaterial)}}(l.data&&Array.isArray(l.data)?l.data:l.metadata_list&&Array.isArray(l.metadata_list)?l.metadata_list:[]).filter(l=>{let Z=lR(la(l)),c=l.connection_id;c&&this.e2ee&&Z&&this.e2ee.addPreKeyBundle(c,Z)})}else if("connection.destroyed"===l.event_type){let Z=lR(la(l)),c=l.connection_id;if(Z&&this.e2ee&&c){let l=this.e2ee.stopSession(c);this.e2ee.postSelfSecretKeyMaterial(l.selfConnectionId,l.selfKeyId,l.selfSecretKeyMaterial,5e3),l.messages.filter(l=>{this.sendE2EEMessage(l.buffer)}),this.e2ee.postRemoveRemoteDeriveKey(c)}}this.callbacks.notify(l,Z)}signalingOnMessageTypeSwitched(l){if(this.signalingSwitched=!0,this.ws)for(let Z of(l.ignore_disconnect_websocket&&(this.ws&&(this.ws.onclose=null,this.ws.close(),this.ws=null),this.writeWebSocketSignalingLog("close")),this.datachannels))this.callbacks.datachannel(function(l){let Z=new Event("datachannel");return Z.datachannel=l,Z}(Z))}async signalingOnMessageTypeRedirect(l){this.ws&&(this.ws.onclose=null,this.ws.onerror=null,this.ws.close(),this.ws=null);let Z=await this.getSignalingWebSocket(l.location);return await this.signaling(Z,!0)}async setSenderParameters(l,Z){let c=l.sender.getParameters();c.encodings=Z,await l.sender.setParameters(c),this.trace("TRANSCEIVER SENDER SET_PARAMETERS",c),this.writePeerConnectionTimelineLog("transceiver-sender-set-parameters",c)}async getStats(){let l=[];return this.pc&&(await this.pc.getStats()).forEach(Z=>{l.push(Z)}),l}onDataChannel(l){let Z=l.channel;Z.bufferedAmountLowThreshold=65536,Z.binaryType="arraybuffer",this.soraDataChannels[Z.label]=Z,this.writeDataChannelTimelineLog("ondatachannel",Z,{binaryType:Z.binaryType,bufferedAmount:Z.bufferedAmount,bufferedAmountLowThreshold:Z.bufferedAmountLowThreshold,id:Z.id,label:Z.label,maxPacketLifeTime:Z.maxPacketLifeTime,maxRetransmits:Z.maxRetransmits,negotiated:Z.negotiated,ordered:Z.ordered,protocol:Z.protocol,readyState:Z.readyState,reliable:Z.reliable}),l.channel.onbufferedamountlow=l=>{let Z=l.currentTarget;this.writeDataChannelTimelineLog("onbufferedamountlow",Z)},l.channel.onopen=l=>{let Z=l.currentTarget;this.trace("OPEN DATA CHANNEL",Z.label),"signaling"===Z.label&&this.ws?this.writeDataChannelSignalingLog("onopen",Z):this.writeDataChannelTimelineLog("onopen",Z)},l.channel.onclose=async l=>{let Z=l.currentTarget;this.writeDataChannelTimelineLog("onclose",Z),this.trace("CLOSE DATA CHANNEL",Z.label),await this.disconnect()},l.channel.onerror=async l=>{let Z=l.currentTarget;this.writeDataChannelTimelineLog("onerror",Z),this.trace("ERROR DATA CHANNEL",Z.label),await this.abend("DATA-CHANNEL-ONERROR",{params:{label:Z.label}})},"signaling"===l.channel.label?l.channel.onmessage=async l=>{let Z=l.currentTarget,c=Z.label,b=this.signalingOfferMessageDataChannels[c];if(!b){console.warn(`Received onmessage event for '${c}' DataChannel. But '${c}' DataChannel settings doesn't exist`);return}let d=JSON.parse(lC(l.data,b.compress));this.writeDataChannelSignalingLog(`onmessage-${d.type}`,Z,d),"re-offer"===d.type&&await this.signalingOnMessageTypeReOffer(d)}:"notify"===l.channel.label?l.channel.onmessage=l=>{let Z=l.currentTarget,c=Z.label,b=this.signalingOfferMessageDataChannels[c];if(!b){console.warn(`Received onmessage event for '${c}' DataChannel. But '${c}' DataChannel settings doesn't exist`);return}let d=JSON.parse(lC(l.data,b.compress));"connection.created"===d.event_type?this.writeDataChannelTimelineLog("notify-connection.created",Z,d):"connection.destroyed"===d.event_type&&this.writeDataChannelTimelineLog("notify-connection.destroyed",Z,d),this.signalingOnMessageTypeNotify(d,"datachannel")}:"push"===l.channel.label?l.channel.onmessage=l=>{let Z=l.currentTarget.label,c=this.signalingOfferMessageDataChannels[Z];if(!c){console.warn(`Received onmessage event for '${Z}' DataChannel. But '${Z}' DataChannel settings doesn't exist`);return}let b=JSON.parse(lC(l.data,c.compress));this.callbacks.push(b,"datachannel")}:"e2ee"===l.channel.label?l.channel.onmessage=l=>{let Z=l.currentTarget,c=l.data;this.signalingOnMessageE2EE(c),this.writeDataChannelSignalingLog("onmessage-e2ee",Z,c)}:"stats"===l.channel.label?l.channel.onmessage=async l=>{let Z=l.currentTarget.label,c=this.signalingOfferMessageDataChannels[Z];if(!c){console.warn(`Received onmessage event for '${Z}' DataChannel. But '${Z}' DataChannel settings doesn't exist`);return}if("req-stats"===JSON.parse(lC(l.data,c.compress)).type){let l=await this.getStats();this.sendStatsMessage(l)}}:/^#.*/.exec(l.channel.label)&&(l.channel.onmessage=l=>{let Z;if(null===l.currentTarget)return;let c=l.currentTarget.label,b=this.signalingOfferMessageDataChannels[c];if(!b){console.warn(`Received onmessage event for '${c}' DataChannel. But '${c}' DataChannel settings doesn't exist`);return}let d=l.target;"string"==typeof l.data?Z=new TextEncoder().encode(l.data):l.data instanceof ArrayBuffer?Z=l.data:console.warn("Received onmessage event data is not of type String or ArrayBuffer."),void 0!==Z&&(!0===b.compress&&(Z=lG(new Uint8Array(Z)).buffer),this.callbacks.message(function(l,Z){let c=new Event("message");return c.label=l,c.data=Z,c}(d.label,Z)))})}sendSignalingMessage(l){if(this.soraDataChannels.signaling){if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){let Z=lg(new TextEncoder().encode(JSON.stringify(l)),{});this.soraDataChannels.signaling.send(Z)}else this.soraDataChannels.signaling.send(JSON.stringify(l));this.writeDataChannelSignalingLog(`send-${l.type}`,this.soraDataChannels.signaling,l)}else null!==this.ws&&(this.ws.send(JSON.stringify(l)),this.writeWebSocketSignalingLog(`send-${l.type}`,l))}sendE2EEMessage(l){this.soraDataChannels.e2ee?(this.soraDataChannels.e2ee.send(l),this.writeDataChannelSignalingLog("send-e2ee",this.soraDataChannels.e2ee,l)):null!==this.ws&&(this.ws.send(l),this.writeWebSocketSignalingLog("send-e2ee",l))}sendStatsMessage(l){if(this.soraDataChannels.stats){let Z={type:"stats",reports:l};if(this.signalingOfferMessageDataChannels.stats&&!0===this.signalingOfferMessageDataChannels.stats.compress){let l=lg(new TextEncoder().encode(JSON.stringify(Z)),{});this.soraDataChannels.stats.send(l)}else this.soraDataChannels.stats.send(JSON.stringify(Z))}}getAudioTransceiver(){return this.pc&&this.mids.audio&&this.pc.getTransceivers().find(l=>l.mid===this.mids.audio)||null}getVideoTransceiver(){return this.pc&&this.mids.video&&this.pc.getTransceivers().find(l=>l.mid===this.mids.video)||null}soraCloseEvent(l,Z,c){return new class extends Event{constructor(l,Z,c){super(l),c&&(c.code&&(this.code=c.code),c.reason&&(this.reason=c.reason),c.params&&(this.params=c.params)),this.title=Z}}(l,Z,c)}sendMessage(l,Z){let c=this.soraDataChannels[l];if(null===this.pc)return;if(void 0===c)throw Error("Could not find DataChannel");if("open"!==c.readyState)throw Error("Messaging DataChannel is not open");let b=this.signalingOfferMessageDataChannels[l];if(void 0!==b&&!0===b.compress){let l=lg(Z,{});c.send(l)}else c.send(Z)}get e2eeSelfFingerprint(){if(this.options.e2ee&&this.e2ee)return this.e2ee.selfFingerprint()}get e2eeRemoteFingerprints(){if(this.options.e2ee&&this.e2ee)return this.e2ee.remoteFingerprints()}get audio(){return null!==this.getAudioTransceiver()}get video(){return null!==this.getVideoTransceiver()}get signalingUrl(){return this.signalingUrlCandidates}get datachannels(){if(!this.signalingSwitched)return[];let l=Object.keys(this.signalingOfferMessageDataChannels).filter(l=>/^#.*/.exec(l)),Z=[];for(let c of l){let l=this.soraDataChannels[c];if(!l)continue;let b=this.signalingOfferMessageDataChannels[c];if(!b)continue;let d={label:l.label,ordered:l.ordered,protocol:l.protocol,compress:b.compress,direction:b.direction};"number"==typeof l.maxPacketLifeTime&&(d.maxPacketLifeTime=l.maxPacketLifeTime),"number"==typeof l.maxRetransmits&&(d.maxRetransmits=l.maxRetransmits),Z.push(d)}return Z}}class lY extends lo{async connect(l){return this.options.multistream?await Promise.race([this.multiStream(l).finally(()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()}),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]):await Promise.race([this.singleStream(l).finally(()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()}),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]),this.monitorWebSocketEvent(),this.monitorPeerConnectionState(),l}async singleStream(l){await this.disconnect(),this.setupE2EE();let Z=await this.getSignalingWebSocket(this.signalingUrlCandidates),c=await this.signaling(Z);if(this.startE2EE(),await this.connectPeerConnection(c),await this.setRemoteDescription(c),l.getTracks().filter(Z=>{this.pc&&this.pc.addTrack(Z,l)}),this.pc)for(let l of this.pc.getSenders())await this.setupSenderTransform(l);return this.stream=l,await this.createAnswer(c),this.sendAnswer(),await this.onIceCandidate(),await this.waitChangeConnectionStateConnected(),l}async multiStream(l){await this.disconnect(),this.setupE2EE();let Z=await this.getSignalingWebSocket(this.signalingUrlCandidates),c=await this.signaling(Z);if(this.startE2EE(),await this.connectPeerConnection(c),this.pc&&(this.pc.ontrack=async l=>{await this.setupReceiverTransform(l.transceiver.mid,l.receiver);let Z=l.streams[0];if(!Z)return;let c={"stream.id":Z.id,id:l.track.id,label:l.track.label,enabled:l.track.enabled,kind:l.track.kind,muted:l.track.muted,readyState:l.track.readyState};this.writePeerConnectionTimelineLog("ontrack",c),"default"!==Z.id&&Z.id!==this.connectionId&&(this.callbacks.track(l),Z.onremovetrack=l=>{if(this.callbacks.removetrack(l),l.target){let Z=this.remoteConnectionIds.indexOf(l.target.id);-1{this.pc&&this.pc.addTrack(Z,l)}),this.pc)for(let l of this.pc.getSenders())await this.setupSenderTransform(l);return this.stream=l,await this.createAnswer(c),this.sendAnswer(),await this.onIceCandidate(),await this.waitChangeConnectionStateConnected(),l}}class lu extends lo{async connect(){if(this.options.multistream){await Promise.race([this.multiStream().finally(()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()}),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]),this.monitorWebSocketEvent(),this.monitorPeerConnectionState();return}let l=await Promise.race([this.singleStream().finally(()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()}),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]);return this.monitorWebSocketEvent(),this.monitorPeerConnectionState(),l}async singleStream(){await this.disconnect(),this.setupE2EE();let l=await this.getSignalingWebSocket(this.signalingUrlCandidates),Z=await this.signaling(l);return this.startE2EE(),await this.connectPeerConnection(Z),this.pc&&(this.pc.ontrack=async l=>{await this.setupReceiverTransform(l.transceiver.mid,l.receiver),this.stream=l.streams[0];let Z=this.stream.id;if("default"===Z)return;let c={"stream.id":Z,id:l.track.id,label:l.track.label,enabled:l.track.enabled,kind:l.track.kind,muted:l.track.muted,readyState:l.track.readyState};this.writePeerConnectionTimelineLog("ontrack",c),this.callbacks.track(l),this.stream.onremovetrack=l=>{if(this.callbacks.removetrack(l),l.target){let Z=l.target.id,c=this.remoteConnectionIds.indexOf(Z);-1{await this.setupReceiverTransform(l.transceiver.mid,l.receiver);let Z=l.streams[0];if("default"===Z.id||Z.id===this.connectionId)return;let c={"stream.id":Z.id,id:l.track.id,label:l.track.label,enabled:l.track.enabled,kind:l.track.kind,muted:l.track.muted,readyState:l.track.readyState};this.writePeerConnectionTimelineLog("ontrack",c),this.callbacks.track(l),Z.onremovetrack=l=>{if(this.callbacks.removetrack(l),l.target){let Z=l.target.id,c=this.remoteConnectionIds.indexOf(Z);-1{await I.loadWasm(l)},initLyra:function(l){return"createEncodedStreams"in RTCRtpSender.prototype||"transform"in RTCRtpSender.prototype?"undefined"==typeof SharedArrayBuffer?(console.warn("Lyra requires cross-origin isolation to use SharedArrayBuffer."),!1):(b=l,d=void 0,!0):(console.warn("This browser doesn't support WebRTC Encoded Transform feature that Lyra requires."),!1)},connection:(l,Z=!1)=>new lp(l,Z),version:()=>"2023.2.0",helpers:{applyMediaStreamConstraints:W}}}}]); \ No newline at end of file diff --git a/dist/_next/static/chunks/framework-2d4c0e1302aa80c0.js b/dist/_next/static/chunks/framework-2d4c0e1302aa80c0.js deleted file mode 100644 index b7be919f..00000000 --- a/dist/_next/static/chunks/framework-2d4c0e1302aa80c0.js +++ /dev/null @@ -1,33 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[774],{3746:function(e,n,t){/** - * @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 r,l,a,u,o,i,s=t(959),c=t(2962);function f(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,t=1;t