vzcode 1.27.0 → 1.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/index-DQm1t_Hp.js +183 -0
- package/dist/index.html +1 -1
- package/package.json +31 -34
- package/dist/assets/index-CQtf1JEg.js +0 -192
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
var Iq=Object.defineProperty;var jq=(n,e,t)=>e in n?Iq(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var Ni=(n,e,t)=>jq(n,typeof e!="symbol"?e+"":e,t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function t(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=t(i);fetch(i.href,s)}})();var Rr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Us(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function $i(n){if(Object.prototype.hasOwnProperty.call(n,"__esModule"))return n;var e=n.default;if(typeof e=="function"){var t=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(r){var i=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:function(){return n[r]}})}),t}var Ly={exports:{}},Ff={},qy={exports:{}},dn={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var wT;function Nq(){if(wT)return dn;wT=1;var n=Symbol.for("react.element"),e=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),o=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),c=Symbol.for("react.memo"),u=Symbol.for("react.lazy"),d=Symbol.iterator;function h(H){return H===null||typeof H!="object"?null:(H=d&&H[d]||H["@@iterator"],typeof H=="function"?H:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,O={};function y(H,se,J){this.props=H,this.context=se,this.refs=O,this.updater=J||m}y.prototype.isReactComponent={},y.prototype.setState=function(H,se){if(typeof H!="object"&&typeof H!="function"&&H!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,H,se,"setState")},y.prototype.forceUpdate=function(H){this.updater.enqueueForceUpdate(this,H,"forceUpdate")};function b(){}b.prototype=y.prototype;function S(H,se,J){this.props=H,this.context=se,this.refs=O,this.updater=J||m}var P=S.prototype=new b;P.constructor=S,g(P,y.prototype),P.isPureReactComponent=!0;var k=Array.isArray,x=Object.prototype.hasOwnProperty,A={current:null},M={key:!0,ref:!0,__self:!0,__source:!0};function Q(H,se,J){var oe,pe={},Ee=null,j=null;if(se!=null)for(oe in se.ref!==void 0&&(j=se.ref),se.key!==void 0&&(Ee=""+se.key),se)x.call(se,oe)&&!M.hasOwnProperty(oe)&&(pe[oe]=se[oe]);var V=arguments.length-2;if(V===1)pe.children=J;else if(1<V){for(var Y=Array(V),de=0;de<V;de++)Y[de]=arguments[de+2];pe.children=Y}if(H&&H.defaultProps)for(oe in V=H.defaultProps,V)pe[oe]===void 0&&(pe[oe]=V[oe]);return{$$typeof:n,type:H,key:Ee,ref:j,props:pe,_owner:A.current}}function _(H,se){return{$$typeof:n,type:H.type,key:se,ref:H.ref,props:H.props,_owner:H._owner}}function R(H){return typeof H=="object"&&H!==null&&H.$$typeof===n}function $(H){var se={"=":"=0",":":"=2"};return"$"+H.replace(/[=:]/g,function(J){return se[J]})}var D=/\/+/g;function F(H,se){return typeof H=="object"&&H!==null&&H.key!=null?$(""+H.key):se.toString(36)}function G(H,se,J,oe,pe){var Ee=typeof H;(Ee==="undefined"||Ee==="boolean")&&(H=null);var j=!1;if(H===null)j=!0;else switch(Ee){case"string":case"number":j=!0;break;case"object":switch(H.$$typeof){case n:case e:j=!0}}if(j)return j=H,pe=pe(j),H=oe===""?"."+F(j,0):oe,k(pe)?(J="",H!=null&&(J=H.replace(D,"$&/")+"/"),G(pe,se,J,"",function(de){return de})):pe!=null&&(R(pe)&&(pe=_(pe,J+(!pe.key||j&&j.key===pe.key?"":(""+pe.key).replace(D,"$&/")+"/")+H)),se.push(pe)),1;if(j=0,oe=oe===""?".":oe+":",k(H))for(var V=0;V<H.length;V++){Ee=H[V];var Y=oe+F(Ee,V);j+=G(Ee,se,J,Y,pe)}else if(Y=h(H),typeof Y=="function")for(H=Y.call(H),V=0;!(Ee=H.next()).done;)Ee=Ee.value,Y=oe+F(Ee,V++),j+=G(Ee,se,J,Y,pe);else if(Ee==="object")throw se=String(H),Error("Objects are not valid as a React child (found: "+(se==="[object Object]"?"object with keys {"+Object.keys(H).join(", ")+"}":se)+"). If you meant to render a collection of children, use an array instead.");return j}function ue(H,se,J){if(H==null)return H;var oe=[],pe=0;return G(H,oe,"","",function(Ee){return se.call(J,Ee,pe++)}),oe}function B(H){if(H._status===-1){var se=H._result;se=se(),se.then(function(J){(H._status===0||H._status===-1)&&(H._status=1,H._result=J)},function(J){(H._status===0||H._status===-1)&&(H._status=2,H._result=J)}),H._status===-1&&(H._status=0,H._result=se)}if(H._status===1)return H._result.default;throw H._result}var X={current:null},W={transition:null},ee={ReactCurrentDispatcher:X,ReactCurrentBatchConfig:W,ReactCurrentOwner:A};function re(){throw Error("act(...) is not supported in production builds of React.")}return dn.Children={map:ue,forEach:function(H,se,J){ue(H,function(){se.apply(this,arguments)},J)},count:function(H){var se=0;return ue(H,function(){se++}),se},toArray:function(H){return ue(H,function(se){return se})||[]},only:function(H){if(!R(H))throw Error("React.Children.only expected to receive a single React element child.");return H}},dn.Component=y,dn.Fragment=t,dn.Profiler=i,dn.PureComponent=S,dn.StrictMode=r,dn.Suspense=l,dn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ee,dn.act=re,dn.cloneElement=function(H,se,J){if(H==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+H+".");var oe=g({},H.props),pe=H.key,Ee=H.ref,j=H._owner;if(se!=null){if(se.ref!==void 0&&(Ee=se.ref,j=A.current),se.key!==void 0&&(pe=""+se.key),H.type&&H.type.defaultProps)var V=H.type.defaultProps;for(Y in se)x.call(se,Y)&&!M.hasOwnProperty(Y)&&(oe[Y]=se[Y]===void 0&&V!==void 0?V[Y]:se[Y])}var Y=arguments.length-2;if(Y===1)oe.children=J;else if(1<Y){V=Array(Y);for(var de=0;de<Y;de++)V[de]=arguments[de+2];oe.children=V}return{$$typeof:n,type:H.type,key:pe,ref:Ee,props:oe,_owner:j}},dn.createContext=function(H){return H={$$typeof:o,_currentValue:H,_currentValue2:H,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},H.Provider={$$typeof:s,_context:H},H.Consumer=H},dn.createElement=Q,dn.createFactory=function(H){var se=Q.bind(null,H);return se.type=H,se},dn.createRef=function(){return{current:null}},dn.forwardRef=function(H){return{$$typeof:a,render:H}},dn.isValidElement=R,dn.lazy=function(H){return{$$typeof:u,_payload:{_status:-1,_result:H},_init:B}},dn.memo=function(H,se){return{$$typeof:c,type:H,compare:se===void 0?null:se}},dn.startTransition=function(H){var se=W.transition;W.transition={};try{H()}finally{W.transition=se}},dn.unstable_act=re,dn.useCallback=function(H,se){return X.current.useCallback(H,se)},dn.useContext=function(H){return X.current.useContext(H)},dn.useDebugValue=function(){},dn.useDeferredValue=function(H){return X.current.useDeferredValue(H)},dn.useEffect=function(H,se){return X.current.useEffect(H,se)},dn.useId=function(){return X.current.useId()},dn.useImperativeHandle=function(H,se,J){return X.current.useImperativeHandle(H,se,J)},dn.useInsertionEffect=function(H,se){return X.current.useInsertionEffect(H,se)},dn.useLayoutEffect=function(H,se){return X.current.useLayoutEffect(H,se)},dn.useMemo=function(H,se){return X.current.useMemo(H,se)},dn.useReducer=function(H,se,J){return X.current.useReducer(H,se,J)},dn.useRef=function(H){return X.current.useRef(H)},dn.useState=function(H){return X.current.useState(H)},dn.useSyncExternalStore=function(H,se,J){return X.current.useSyncExternalStore(H,se,J)},dn.useTransition=function(){return X.current.useTransition()},dn.version="18.3.1",dn}var kT;function ut(){return kT||(kT=1,qy.exports=Nq()),qy.exports}/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var PT;function Lq(){if(PT)return Ff;PT=1;var n=ut(),e=Symbol.for("react.element"),t=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function o(a,l,c){var u,d={},h=null,m=null;c!==void 0&&(h=""+c),l.key!==void 0&&(h=""+l.key),l.ref!==void 0&&(m=l.ref);for(u in l)r.call(l,u)&&!s.hasOwnProperty(u)&&(d[u]=l[u]);if(a&&a.defaultProps)for(u in l=a.defaultProps,l)d[u]===void 0&&(d[u]=l[u]);return{$$typeof:e,type:a,key:h,ref:m,props:d,_owner:i.current}}return Ff.Fragment=t,Ff.jsx=o,Ff.jsxs=o,Ff}var xT;function fn(){return xT||(xT=1,Ly.exports=Lq()),Ly.exports}var q=fn(),L=ut();const Lo=Us(L);var kp={},Uy={exports:{}},Gi={},By={exports:{}},Fy={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.min.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/var TT;function qq(){return TT||(TT=1,function(n){function e(W,ee){var re=W.length;W.push(ee);e:for(;0<re;){var H=re-1>>>1,se=W[H];if(0<i(se,ee))W[H]=ee,W[re]=se,re=H;else break e}}function t(W){return W.length===0?null:W[0]}function r(W){if(W.length===0)return null;var ee=W[0],re=W.pop();if(re!==ee){W[0]=re;e:for(var H=0,se=W.length,J=se>>>1;H<J;){var oe=2*(H+1)-1,pe=W[oe],Ee=oe+1,j=W[Ee];if(0>i(pe,re))Ee<se&&0>i(j,pe)?(W[H]=j,W[Ee]=re,H=Ee):(W[H]=pe,W[oe]=re,H=oe);else if(Ee<se&&0>i(j,re))W[H]=j,W[Ee]=re,H=Ee;else break e}}return ee}function i(W,ee){var re=W.sortIndex-ee.sortIndex;return re!==0?re:W.id-ee.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();n.unstable_now=function(){return o.now()-a}}var l=[],c=[],u=1,d=null,h=3,m=!1,g=!1,O=!1,y=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function P(W){for(var ee=t(c);ee!==null;){if(ee.callback===null)r(c);else if(ee.startTime<=W)r(c),ee.sortIndex=ee.expirationTime,e(l,ee);else break;ee=t(c)}}function k(W){if(O=!1,P(W),!g)if(t(l)!==null)g=!0,B(x);else{var ee=t(c);ee!==null&&X(k,ee.startTime-W)}}function x(W,ee){g=!1,O&&(O=!1,b(Q),Q=-1),m=!0;var re=h;try{for(P(ee),d=t(l);d!==null&&(!(d.expirationTime>ee)||W&&!$());){var H=d.callback;if(typeof H=="function"){d.callback=null,h=d.priorityLevel;var se=H(d.expirationTime<=ee);ee=n.unstable_now(),typeof se=="function"?d.callback=se:d===t(l)&&r(l),P(ee)}else r(l);d=t(l)}if(d!==null)var J=!0;else{var oe=t(c);oe!==null&&X(k,oe.startTime-ee),J=!1}return J}finally{d=null,h=re,m=!1}}var A=!1,M=null,Q=-1,_=5,R=-1;function $(){return!(n.unstable_now()-R<_)}function D(){if(M!==null){var W=n.unstable_now();R=W;var ee=!0;try{ee=M(!0,W)}finally{ee?F():(A=!1,M=null)}}else A=!1}var F;if(typeof S=="function")F=function(){S(D)};else if(typeof MessageChannel<"u"){var G=new MessageChannel,ue=G.port2;G.port1.onmessage=D,F=function(){ue.postMessage(null)}}else F=function(){y(D,0)};function B(W){M=W,A||(A=!0,F())}function X(W,ee){Q=y(function(){W(n.unstable_now())},ee)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(W){W.callback=null},n.unstable_continueExecution=function(){g||m||(g=!0,B(x))},n.unstable_forceFrameRate=function(W){0>W||125<W?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):_=0<W?Math.floor(1e3/W):5},n.unstable_getCurrentPriorityLevel=function(){return h},n.unstable_getFirstCallbackNode=function(){return t(l)},n.unstable_next=function(W){switch(h){case 1:case 2:case 3:var ee=3;break;default:ee=h}var re=h;h=ee;try{return W()}finally{h=re}},n.unstable_pauseExecution=function(){},n.unstable_requestPaint=function(){},n.unstable_runWithPriority=function(W,ee){switch(W){case 1:case 2:case 3:case 4:case 5:break;default:W=3}var re=h;h=W;try{return ee()}finally{h=re}},n.unstable_scheduleCallback=function(W,ee,re){var H=n.unstable_now();switch(typeof re=="object"&&re!==null?(re=re.delay,re=typeof re=="number"&&0<re?H+re:H):re=H,W){case 1:var se=-1;break;case 2:se=250;break;case 5:se=1073741823;break;case 4:se=1e4;break;default:se=5e3}return se=re+se,W={id:u++,callback:ee,priorityLevel:W,startTime:re,expirationTime:se,sortIndex:-1},re>H?(W.sortIndex=re,e(c,W),t(l)===null&&W===t(c)&&(O?(b(Q),Q=-1):O=!0,X(k,re-H))):(W.sortIndex=se,e(l,W),g||m||(g=!0,B(x))),W},n.unstable_shouldYield=$,n.unstable_wrapCallback=function(W){var ee=h;return function(){var re=h;h=ee;try{return W.apply(this,arguments)}finally{h=re}}}}(Fy)),Fy}var CT;function Uq(){return CT||(CT=1,By.exports=qq()),By.exports}/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.min.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var _T;function Bq(){if(_T)return Gi;_T=1;var n=ut(),e=Uq();function t(f){for(var p="https://reactjs.org/docs/error-decoder.html?invariant="+f,v=1;v<arguments.length;v++)p+="&args[]="+encodeURIComponent(arguments[v]);return"Minified React error #"+f+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,i={};function s(f,p){o(f,p),o(f+"Capture",p)}function o(f,p){for(i[f]=p,f=0;f<p.length;f++)r.add(p[f])}var a=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),l=Object.prototype.hasOwnProperty,c=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,u={},d={};function h(f){return l.call(d,f)?!0:l.call(u,f)?!1:c.test(f)?d[f]=!0:(u[f]=!0,!1)}function m(f,p,v,w){if(v!==null&&v.type===0)return!1;switch(typeof p){case"function":case"symbol":return!0;case"boolean":return w?!1:v!==null?!v.acceptsBooleans:(f=f.toLowerCase().slice(0,5),f!=="data-"&&f!=="aria-");default:return!1}}function g(f,p,v,w){if(p===null||typeof p>"u"||m(f,p,v,w))return!0;if(w)return!1;if(v!==null)switch(v.type){case 3:return!p;case 4:return p===!1;case 5:return isNaN(p);case 6:return isNaN(p)||1>p}return!1}function O(f,p,v,w,C,E,N){this.acceptsBooleans=p===2||p===3||p===4,this.attributeName=w,this.attributeNamespace=C,this.mustUseProperty=v,this.propertyName=f,this.type=p,this.sanitizeURL=E,this.removeEmptyString=N}var y={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(f){y[f]=new O(f,0,!1,f,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(f){var p=f[0];y[p]=new O(p,1,!1,f[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(f){y[f]=new O(f,2,!1,f.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(f){y[f]=new O(f,2,!1,f,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(f){y[f]=new O(f,3,!1,f.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(f){y[f]=new O(f,3,!0,f,null,!1,!1)}),["capture","download"].forEach(function(f){y[f]=new O(f,4,!1,f,null,!1,!1)}),["cols","rows","size","span"].forEach(function(f){y[f]=new O(f,6,!1,f,null,!1,!1)}),["rowSpan","start"].forEach(function(f){y[f]=new O(f,5,!1,f.toLowerCase(),null,!1,!1)});var b=/[\-:]([a-z])/g;function S(f){return f[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(f){var p=f.replace(b,S);y[p]=new O(p,1,!1,f,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(f){var p=f.replace(b,S);y[p]=new O(p,1,!1,f,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(f){var p=f.replace(b,S);y[p]=new O(p,1,!1,f,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(f){y[f]=new O(f,1,!1,f.toLowerCase(),null,!1,!1)}),y.xlinkHref=new O("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(f){y[f]=new O(f,1,!1,f.toLowerCase(),null,!0,!0)});function P(f,p,v,w){var C=y.hasOwnProperty(p)?y[p]:null;(C!==null?C.type!==0:w||!(2<p.length)||p[0]!=="o"&&p[0]!=="O"||p[1]!=="n"&&p[1]!=="N")&&(g(p,v,C,w)&&(v=null),w||C===null?h(p)&&(v===null?f.removeAttribute(p):f.setAttribute(p,""+v)):C.mustUseProperty?f[C.propertyName]=v===null?C.type===3?!1:"":v:(p=C.attributeName,w=C.attributeNamespace,v===null?f.removeAttribute(p):(C=C.type,v=C===3||C===4&&v===!0?"":""+v,w?f.setAttributeNS(w,p,v):f.setAttribute(p,v))))}var k=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,x=Symbol.for("react.element"),A=Symbol.for("react.portal"),M=Symbol.for("react.fragment"),Q=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),R=Symbol.for("react.provider"),$=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),F=Symbol.for("react.suspense"),G=Symbol.for("react.suspense_list"),ue=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),X=Symbol.for("react.offscreen"),W=Symbol.iterator;function ee(f){return f===null||typeof f!="object"?null:(f=W&&f[W]||f["@@iterator"],typeof f=="function"?f:null)}var re=Object.assign,H;function se(f){if(H===void 0)try{throw Error()}catch(v){var p=v.stack.trim().match(/\n( *(at )?)/);H=p&&p[1]||""}return`
|
|
34
|
+
`+H+f}var J=!1;function oe(f,p){if(!f||J)return"";J=!0;var v=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(p)if(p=function(){throw Error()},Object.defineProperty(p.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(p,[])}catch(be){var w=be}Reflect.construct(f,[],p)}else{try{p.call()}catch(be){w=be}f.call(p.prototype)}else{try{throw Error()}catch(be){w=be}f()}}catch(be){if(be&&w&&typeof be.stack=="string"){for(var C=be.stack.split(`
|
|
35
|
+
`),E=w.stack.split(`
|
|
36
|
+
`),N=C.length-1,ne=E.length-1;1<=N&&0<=ne&&C[N]!==E[ne];)ne--;for(;1<=N&&0<=ne;N--,ne--)if(C[N]!==E[ne]){if(N!==1||ne!==1)do if(N--,ne--,0>ne||C[N]!==E[ne]){var le=`
|
|
37
|
+
`+C[N].replace(" at new "," at ");return f.displayName&&le.includes("<anonymous>")&&(le=le.replace("<anonymous>",f.displayName)),le}while(1<=N&&0<=ne);break}}}finally{J=!1,Error.prepareStackTrace=v}return(f=f?f.displayName||f.name:"")?se(f):""}function pe(f){switch(f.tag){case 5:return se(f.type);case 16:return se("Lazy");case 13:return se("Suspense");case 19:return se("SuspenseList");case 0:case 2:case 15:return f=oe(f.type,!1),f;case 11:return f=oe(f.type.render,!1),f;case 1:return f=oe(f.type,!0),f;default:return""}}function Ee(f){if(f==null)return null;if(typeof f=="function")return f.displayName||f.name||null;if(typeof f=="string")return f;switch(f){case M:return"Fragment";case A:return"Portal";case _:return"Profiler";case Q:return"StrictMode";case F:return"Suspense";case G:return"SuspenseList"}if(typeof f=="object")switch(f.$$typeof){case $:return(f.displayName||"Context")+".Consumer";case R:return(f._context.displayName||"Context")+".Provider";case D:var p=f.render;return f=f.displayName,f||(f=p.displayName||p.name||"",f=f!==""?"ForwardRef("+f+")":"ForwardRef"),f;case ue:return p=f.displayName||null,p!==null?p:Ee(f.type)||"Memo";case B:p=f._payload,f=f._init;try{return Ee(f(p))}catch{}}return null}function j(f){var p=f.type;switch(f.tag){case 24:return"Cache";case 9:return(p.displayName||"Context")+".Consumer";case 10:return(p._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return f=p.render,f=f.displayName||f.name||"",p.displayName||(f!==""?"ForwardRef("+f+")":"ForwardRef");case 7:return"Fragment";case 5:return p;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ee(p);case 8:return p===Q?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof p=="function")return p.displayName||p.name||null;if(typeof p=="string")return p}return null}function V(f){switch(typeof f){case"boolean":case"number":case"string":case"undefined":return f;case"object":return f;default:return""}}function Y(f){var p=f.type;return(f=f.nodeName)&&f.toLowerCase()==="input"&&(p==="checkbox"||p==="radio")}function de(f){var p=Y(f)?"checked":"value",v=Object.getOwnPropertyDescriptor(f.constructor.prototype,p),w=""+f[p];if(!f.hasOwnProperty(p)&&typeof v<"u"&&typeof v.get=="function"&&typeof v.set=="function"){var C=v.get,E=v.set;return Object.defineProperty(f,p,{configurable:!0,get:function(){return C.call(this)},set:function(N){w=""+N,E.call(this,N)}}),Object.defineProperty(f,p,{enumerable:v.enumerable}),{getValue:function(){return w},setValue:function(N){w=""+N},stopTracking:function(){f._valueTracker=null,delete f[p]}}}}function ke(f){f._valueTracker||(f._valueTracker=de(f))}function Te(f){if(!f)return!1;var p=f._valueTracker;if(!p)return!0;var v=p.getValue(),w="";return f&&(w=Y(f)?f.checked?"true":"false":f.value),f=w,f!==v?(p.setValue(f),!0):!1}function Pe(f){if(f=f||(typeof document<"u"?document:void 0),typeof f>"u")return null;try{return f.activeElement||f.body}catch{return f.body}}function Re(f,p){var v=p.checked;return re({},p,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:v??f._wrapperState.initialChecked})}function Ge(f,p){var v=p.defaultValue==null?"":p.defaultValue,w=p.checked!=null?p.checked:p.defaultChecked;v=V(p.value!=null?p.value:v),f._wrapperState={initialChecked:w,initialValue:v,controlled:p.type==="checkbox"||p.type==="radio"?p.checked!=null:p.value!=null}}function gt(f,p){p=p.checked,p!=null&&P(f,"checked",p,!1)}function tn(f,p){gt(f,p);var v=V(p.value),w=p.type;if(v!=null)w==="number"?(v===0&&f.value===""||f.value!=v)&&(f.value=""+v):f.value!==""+v&&(f.value=""+v);else if(w==="submit"||w==="reset"){f.removeAttribute("value");return}p.hasOwnProperty("value")?an(f,p.type,v):p.hasOwnProperty("defaultValue")&&an(f,p.type,V(p.defaultValue)),p.checked==null&&p.defaultChecked!=null&&(f.defaultChecked=!!p.defaultChecked)}function Ln(f,p,v){if(p.hasOwnProperty("value")||p.hasOwnProperty("defaultValue")){var w=p.type;if(!(w!=="submit"&&w!=="reset"||p.value!==void 0&&p.value!==null))return;p=""+f._wrapperState.initialValue,v||p===f.value||(f.value=p),f.defaultValue=p}v=f.name,v!==""&&(f.name=""),f.defaultChecked=!!f._wrapperState.initialChecked,v!==""&&(f.name=v)}function an(f,p,v){(p!=="number"||Pe(f.ownerDocument)!==f)&&(v==null?f.defaultValue=""+f._wrapperState.initialValue:f.defaultValue!==""+v&&(f.defaultValue=""+v))}var ln=Array.isArray;function Qn(f,p,v,w){if(f=f.options,p){p={};for(var C=0;C<v.length;C++)p["$"+v[C]]=!0;for(v=0;v<f.length;v++)C=p.hasOwnProperty("$"+f[v].value),f[v].selected!==C&&(f[v].selected=C),C&&w&&(f[v].defaultSelected=!0)}else{for(v=""+V(v),p=null,C=0;C<f.length;C++){if(f[C].value===v){f[C].selected=!0,w&&(f[C].defaultSelected=!0);return}p!==null||f[C].disabled||(p=f[C])}p!==null&&(p.selected=!0)}}function Dn(f,p){if(p.dangerouslySetInnerHTML!=null)throw Error(t(91));return re({},p,{value:void 0,defaultValue:void 0,children:""+f._wrapperState.initialValue})}function I(f,p){var v=p.value;if(v==null){if(v=p.children,p=p.defaultValue,v!=null){if(p!=null)throw Error(t(92));if(ln(v)){if(1<v.length)throw Error(t(93));v=v[0]}p=v}p==null&&(p=""),v=p}f._wrapperState={initialValue:V(v)}}function ge(f,p){var v=V(p.value),w=V(p.defaultValue);v!=null&&(v=""+v,v!==f.value&&(f.value=v),p.defaultValue==null&&f.defaultValue!==v&&(f.defaultValue=v)),w!=null&&(f.defaultValue=""+w)}function je(f){var p=f.textContent;p===f._wrapperState.initialValue&&p!==""&&p!==null&&(f.value=p)}function ze(f){switch(f){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Ze(f,p){return f==null||f==="http://www.w3.org/1999/xhtml"?ze(p):f==="http://www.w3.org/2000/svg"&&p==="foreignObject"?"http://www.w3.org/1999/xhtml":f}var Ke,_t=function(f){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(p,v,w,C){MSApp.execUnsafeLocalFunction(function(){return f(p,v,w,C)})}:f}(function(f,p){if(f.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in f)f.innerHTML=p;else{for(Ke=Ke||document.createElement("div"),Ke.innerHTML="<svg>"+p.valueOf().toString()+"</svg>",p=Ke.firstChild;f.firstChild;)f.removeChild(f.firstChild);for(;p.firstChild;)f.appendChild(p.firstChild)}});function kt(f,p){if(p){var v=f.firstChild;if(v&&v===f.lastChild&&v.nodeType===3){v.nodeValue=p;return}}f.textContent=p}var $e={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},tt=["Webkit","ms","Moz","O"];Object.keys($e).forEach(function(f){tt.forEach(function(p){p=p+f.charAt(0).toUpperCase()+f.substring(1),$e[p]=$e[f]})});function We(f,p,v){return p==null||typeof p=="boolean"||p===""?"":v||typeof p!="number"||p===0||$e.hasOwnProperty(f)&&$e[f]?(""+p).trim():p+"px"}function Xe(f,p){f=f.style;for(var v in p)if(p.hasOwnProperty(v)){var w=v.indexOf("--")===0,C=We(v,p[v],w);v==="float"&&(v="cssFloat"),w?f.setProperty(v,C):f[v]=C}}var at=re({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function dt(f,p){if(p){if(at[f]&&(p.children!=null||p.dangerouslySetInnerHTML!=null))throw Error(t(137,f));if(p.dangerouslySetInnerHTML!=null){if(p.children!=null)throw Error(t(60));if(typeof p.dangerouslySetInnerHTML!="object"||!("__html"in p.dangerouslySetInnerHTML))throw Error(t(61))}if(p.style!=null&&typeof p.style!="object")throw Error(t(62))}}function Dt(f,p){if(f.indexOf("-")===-1)return typeof p.is=="string";switch(f){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 Le=null;function ct(f){return f=f.target||f.srcElement||window,f.correspondingUseElement&&(f=f.correspondingUseElement),f.nodeType===3?f.parentNode:f}var Ft=null,ht=null,It=null;function cn(f){if(f=_f(f)){if(typeof Ft!="function")throw Error(t(280));var p=f.stateNode;p&&(p=Nh(p),Ft(f.stateNode,f.type,p))}}function Pn(f){ht?It?It.push(f):It=[f]:ht=f}function On(){if(ht){var f=ht,p=It;if(It=ht=null,cn(f),p)for(f=0;f<p.length;f++)cn(p[f])}}function wn(f,p){return f(p)}function tr(){}var Bn=!1;function Qr(f,p,v){if(Bn)return f(p,v);Bn=!0;try{return wn(f,p,v)}finally{Bn=!1,(ht!==null||It!==null)&&(tr(),On())}}function nr(f,p){var v=f.stateNode;if(v===null)return null;var w=Nh(v);if(w===null)return null;v=w[p];e:switch(p){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(w=!w.disabled)||(f=f.type,w=!(f==="button"||f==="input"||f==="select"||f==="textarea")),f=!w;break e;default:f=!1}if(f)return null;if(v&&typeof v!="function")throw Error(t(231,p,typeof v));return v}var Sr=!1;if(a)try{var ar={};Object.defineProperty(ar,"passive",{get:function(){Sr=!0}}),window.addEventListener("test",ar,ar),window.removeEventListener("test",ar,ar)}catch{Sr=!1}function sn(f,p,v,w,C,E,N,ne,le){var be=Array.prototype.slice.call(arguments,3);try{p.apply(v,be)}catch(Be){this.onError(Be)}}var pt=!1,bt=null,Pt=!1,it=null,Fe={onError:function(f){pt=!0,bt=f}};function Vt(f,p,v,w,C,E,N,ne,le){pt=!1,bt=null,sn.apply(Fe,arguments)}function Zt(f,p,v,w,C,E,N,ne,le){if(Vt.apply(this,arguments),pt){if(pt){var be=bt;pt=!1,bt=null}else throw Error(t(198));Pt||(Pt=!0,it=be)}}function Gt(f){var p=f,v=f;if(f.alternate)for(;p.return;)p=p.return;else{f=p;do p=f,(p.flags&4098)!==0&&(v=p.return),f=p.return;while(f)}return p.tag===3?v:null}function In(f){if(f.tag===13){var p=f.memoizedState;if(p===null&&(f=f.alternate,f!==null&&(p=f.memoizedState)),p!==null)return p.dehydrated}return null}function Fn(f){if(Gt(f)!==f)throw Error(t(188))}function jn(f){var p=f.alternate;if(!p){if(p=Gt(f),p===null)throw Error(t(188));return p!==f?null:f}for(var v=f,w=p;;){var C=v.return;if(C===null)break;var E=C.alternate;if(E===null){if(w=C.return,w!==null){v=w;continue}break}if(C.child===E.child){for(E=C.child;E;){if(E===v)return Fn(C),f;if(E===w)return Fn(C),p;E=E.sibling}throw Error(t(188))}if(v.return!==w.return)v=C,w=E;else{for(var N=!1,ne=C.child;ne;){if(ne===v){N=!0,v=C,w=E;break}if(ne===w){N=!0,w=C,v=E;break}ne=ne.sibling}if(!N){for(ne=E.child;ne;){if(ne===v){N=!0,v=E,w=C;break}if(ne===w){N=!0,w=E,v=C;break}ne=ne.sibling}if(!N)throw Error(t(189))}}if(v.alternate!==w)throw Error(t(190))}if(v.tag!==3)throw Error(t(188));return v.stateNode.current===v?f:p}function Yn(f){return f=jn(f),f!==null?Xt(f):null}function Xt(f){if(f.tag===5||f.tag===6)return f;for(f=f.child;f!==null;){var p=Xt(f);if(p!==null)return p;f=f.sibling}return null}var Bt=e.unstable_scheduleCallback,St=e.unstable_cancelCallback,un=e.unstable_shouldYield,wr=e.unstable_requestPaint,vn=e.unstable_now,ui=e.unstable_getCurrentPriorityLevel,Wr=e.unstable_ImmediatePriority,K=e.unstable_UserBlockingPriority,te=e.unstable_NormalPriority,ce=e.unstable_LowPriority,Ae=e.unstable_IdlePriority,he=null,Qe=null;function rt(f){if(Qe&&typeof Qe.onCommitFiberRoot=="function")try{Qe.onCommitFiberRoot(he,f,void 0,(f.current.flags&128)===128)}catch{}}var De=Math.clz32?Math.clz32:ot,Ye=Math.log,$t=Math.LN2;function ot(f){return f>>>=0,f===0?32:31-(Ye(f)/$t|0)|0}var on=64,yn=4194304;function Mt(f){switch(f&-f){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return f&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return f&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return f}}function Jt(f,p){var v=f.pendingLanes;if(v===0)return 0;var w=0,C=f.suspendedLanes,E=f.pingedLanes,N=v&268435455;if(N!==0){var ne=N&~C;ne!==0?w=Mt(ne):(E&=N,E!==0&&(w=Mt(E)))}else N=v&~C,N!==0?w=Mt(N):E!==0&&(w=Mt(E));if(w===0)return 0;if(p!==0&&p!==w&&(p&C)===0&&(C=w&-w,E=p&-p,C>=E||C===16&&(E&4194240)!==0))return p;if((w&4)!==0&&(w|=v&16),p=f.entangledLanes,p!==0)for(f=f.entanglements,p&=w;0<p;)v=31-De(p),C=1<<v,w|=f[v],p&=~C;return w}function nn(f,p){switch(f){case 1:case 2:case 4:return p+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return p+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ht(f,p){for(var v=f.suspendedLanes,w=f.pingedLanes,C=f.expirationTimes,E=f.pendingLanes;0<E;){var N=31-De(E),ne=1<<N,le=C[N];le===-1?((ne&v)===0||(ne&w)!==0)&&(C[N]=nn(ne,p)):le<=p&&(f.expiredLanes|=ne),E&=~ne}}function rn(f){return f=f.pendingLanes&-1073741825,f!==0?f:f&1073741824?1073741824:0}function Gn(){var f=on;return on<<=1,(on&4194240)===0&&(on=64),f}function Vn(f){for(var p=[],v=0;31>v;v++)p.push(f);return p}function Kt(f,p,v){f.pendingLanes|=p,p!==536870912&&(f.suspendedLanes=0,f.pingedLanes=0),f=f.eventTimes,p=31-De(p),f[p]=v}function Rn(f,p){var v=f.pendingLanes&~p;f.pendingLanes=p,f.suspendedLanes=0,f.pingedLanes=0,f.expiredLanes&=p,f.mutableReadLanes&=p,f.entangledLanes&=p,p=f.entanglements;var w=f.eventTimes;for(f=f.expirationTimes;0<v;){var C=31-De(v),E=1<<C;p[C]=0,w[C]=-1,f[C]=-1,v&=~E}}function bn(f,p){var v=f.entangledLanes|=p;for(f=f.entanglements;v;){var w=31-De(v),C=1<<w;C&p|f[w]&p&&(f[w]|=p),v&=~C}}var jt=0;function Cr(f){return f&=-f,1<f?4<f?(f&268435455)!==0?16:536870912:4:1}var mr,Hn,_r,bi,Dr,Si=!1,fi=[],lr=null,gr=null,Mi=null,wi=new Map,ws=new Map,Qi=[],Jo="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Oo(f,p){switch(f){case"focusin":case"focusout":lr=null;break;case"dragenter":case"dragleave":gr=null;break;case"mouseover":case"mouseout":Mi=null;break;case"pointerover":case"pointerout":wi.delete(p.pointerId);break;case"gotpointercapture":case"lostpointercapture":ws.delete(p.pointerId)}}function Di(f,p,v,w,C,E){return f===null||f.nativeEvent!==E?(f={blockedOn:p,domEventName:v,eventSystemFlags:w,nativeEvent:E,targetContainers:[C]},p!==null&&(p=_f(p),p!==null&&Hn(p)),f):(f.eventSystemFlags|=w,p=f.targetContainers,C!==null&&p.indexOf(C)===-1&&p.push(C),f)}function Ui(f,p,v,w,C){switch(p){case"focusin":return lr=Di(lr,f,p,v,w,C),!0;case"dragenter":return gr=Di(gr,f,p,v,w,C),!0;case"mouseover":return Mi=Di(Mi,f,p,v,w,C),!0;case"pointerover":var E=C.pointerId;return wi.set(E,Di(wi.get(E)||null,f,p,v,w,C)),!0;case"gotpointercapture":return E=C.pointerId,ws.set(E,Di(ws.get(E)||null,f,p,v,w,C)),!0}return!1}function Vs(f){var p=Zl(f.target);if(p!==null){var v=Gt(p);if(v!==null){if(p=v.tag,p===13){if(p=In(v),p!==null){f.blockedOn=p,Dr(f.priority,function(){_r(v)});return}}else if(p===3&&v.stateNode.current.memoizedState.isDehydrated){f.blockedOn=v.tag===3?v.stateNode.containerInfo:null;return}}}f.blockedOn=null}function Bi(f){if(f.blockedOn!==null)return!1;for(var p=f.targetContainers;0<p.length;){var v=Ma(f.domEventName,f.eventSystemFlags,p[0],f.nativeEvent);if(v===null){v=f.nativeEvent;var w=new v.constructor(v.type,v);Le=w,v.target.dispatchEvent(w),Le=null}else return p=_f(v),p!==null&&Hn(p),f.blockedOn=v,!1;p.shift()}return!0}function ks(f,p,v){Bi(f)&&v.delete(p)}function Aa(){Si=!1,lr!==null&&Bi(lr)&&(lr=null),gr!==null&&Bi(gr)&&(gr=null),Mi!==null&&Bi(Mi)&&(Mi=null),wi.forEach(ks),ws.forEach(ks)}function vo(f,p){f.blockedOn===p&&(f.blockedOn=null,Si||(Si=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Aa)))}function Zs(f){function p(C){return vo(C,f)}if(0<fi.length){vo(fi[0],f);for(var v=1;v<fi.length;v++){var w=fi[v];w.blockedOn===f&&(w.blockedOn=null)}}for(lr!==null&&vo(lr,f),gr!==null&&vo(gr,f),Mi!==null&&vo(Mi,f),wi.forEach(p),ws.forEach(p),v=0;v<Qi.length;v++)w=Qi[v],w.blockedOn===f&&(w.blockedOn=null);for(;0<Qi.length&&(v=Qi[0],v.blockedOn===null);)Vs(v),v.blockedOn===null&&Qi.shift()}var as=k.ReactCurrentBatchConfig,ea=!0;function $a(f,p,v,w){var C=jt,E=as.transition;as.transition=null;try{jt=1,Ws(f,p,v,w)}finally{jt=C,as.transition=E}}function Of(f,p,v,w){var C=jt,E=as.transition;as.transition=null;try{jt=4,Ws(f,p,v,w)}finally{jt=C,as.transition=E}}function Ws(f,p,v,w){if(ea){var C=Ma(f,p,v,w);if(C===null)Ev(f,p,w,ta,v),Oo(f,w);else if(Ui(C,f,p,v,w))w.stopPropagation();else if(Oo(f,w),p&4&&-1<Jo.indexOf(f)){for(;C!==null;){var E=_f(C);if(E!==null&&mr(E),E=Ma(f,p,v,w),E===null&&Ev(f,p,w,ta,v),E===C)break;C=E}C!==null&&w.stopPropagation()}else Ev(f,p,w,null,v)}}var ta=null;function Ma(f,p,v,w){if(ta=null,f=ct(w),f=Zl(f),f!==null)if(p=Gt(f),p===null)f=null;else if(v=p.tag,v===13){if(f=In(p),f!==null)return f;f=null}else if(v===3){if(p.stateNode.current.memoizedState.isDehydrated)return p.tag===3?p.stateNode.containerInfo:null;f=null}else p!==f&&(f=null);return ta=f,null}function Bl(f){switch(f){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(ui()){case Wr:return 1;case K:return 4;case te:case ce:return 16;case Ae:return 536870912;default:return 16}default:return 16}}var ri=null,ls=null,yo=null;function Qa(){if(yo)return yo;var f,p=ls,v=p.length,w,C="value"in ri?ri.value:ri.textContent,E=C.length;for(f=0;f<v&&p[f]===C[f];f++);var N=v-f;for(w=1;w<=N&&p[v-w]===C[E-w];w++);return yo=C.slice(f,1<w?1-w:void 0)}function Xs(f){var p=f.keyCode;return"charCode"in f?(f=f.charCode,f===0&&p===13&&(f=13)):f=p,f===10&&(f=13),32<=f||f===13?f:0}function na(){return!0}function Da(){return!1}function Xr(f){function p(v,w,C,E,N){this._reactName=v,this._targetInst=C,this.type=w,this.nativeEvent=E,this.target=N,this.currentTarget=null;for(var ne in f)f.hasOwnProperty(ne)&&(v=f[ne],this[ne]=v?v(E):E[ne]);return this.isDefaultPrevented=(E.defaultPrevented!=null?E.defaultPrevented:E.returnValue===!1)?na:Da,this.isPropagationStopped=Da,this}return re(p.prototype,{preventDefault:function(){this.defaultPrevented=!0;var v=this.nativeEvent;v&&(v.preventDefault?v.preventDefault():typeof v.returnValue!="unknown"&&(v.returnValue=!1),this.isDefaultPrevented=na)},stopPropagation:function(){var v=this.nativeEvent;v&&(v.stopPropagation?v.stopPropagation():typeof v.cancelBubble!="unknown"&&(v.cancelBubble=!0),this.isPropagationStopped=na)},persist:function(){},isPersistent:na}),p}var zs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(f){return f.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ra=Xr(zs),Ia=re({},zs,{view:0,detail:0}),vv=Xr(Ia),Ic,vf,Z,U=re({},Ia,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Sn,button:0,buttons:0,relatedTarget:function(f){return f.relatedTarget===void 0?f.fromElement===f.srcElement?f.toElement:f.fromElement:f.relatedTarget},movementX:function(f){return"movementX"in f?f.movementX:(f!==Z&&(Z&&f.type==="mousemove"?(Ic=f.screenX-Z.screenX,vf=f.screenY-Z.screenY):vf=Ic=0,Z=f),Ic)},movementY:function(f){return"movementY"in f?f.movementY:vf}}),z=Xr(U),ae=re({},U,{dataTransfer:0}),ve=Xr(ae),ye=re({},Ia,{relatedTarget:0}),we=Xr(ye),xe=re({},zs,{animationName:0,elapsedTime:0,pseudoElement:0}),qe=Xr(xe),Et=re({},zs,{clipboardData:function(f){return"clipboardData"in f?f.clipboardData:window.clipboardData}}),hn=Xr(Et),xn=re({},zs,{data:0}),pn=Xr(xn),Fi={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ja={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},ia={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Fl(f){var p=this.nativeEvent;return p.getModifierState?p.getModifierState(f):(f=ia[f])?!!p[f]:!1}function Sn(){return Fl}var Nt=re({},Ia,{key:function(f){if(f.key){var p=Fi[f.key]||f.key;if(p!=="Unidentified")return p}return f.type==="keypress"?(f=Xs(f),f===13?"Enter":String.fromCharCode(f)):f.type==="keydown"||f.type==="keyup"?ja[f.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Sn,charCode:function(f){return f.type==="keypress"?Xs(f):0},keyCode:function(f){return f.type==="keydown"||f.type==="keyup"?f.keyCode:0},which:function(f){return f.type==="keypress"?Xs(f):f.type==="keydown"||f.type==="keyup"?f.keyCode:0}}),Ct=Xr(Nt),Lt=re({},U,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),mn=Xr(Lt),rr=re({},Ia,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Sn}),Lr=Xr(rr),Vi=re({},zs,{propertyName:0,elapsedTime:0,pseudoElement:0}),Na=Xr(Vi),sa=re({},U,{deltaX:function(f){return"deltaX"in f?f.deltaX:"wheelDeltaX"in f?-f.wheelDeltaX:0},deltaY:function(f){return"deltaY"in f?f.deltaY:"wheelDeltaY"in f?-f.wheelDeltaY:"wheelDelta"in f?-f.wheelDelta:0},deltaZ:0,deltaMode:0}),Vl=Xr(sa),A3=[9,13,27,32],yv=a&&"CompositionEvent"in window,yf=null;a&&"documentMode"in document&&(yf=document.documentMode);var $3=a&&"TextEvent"in window&&!yf,pP=a&&(!yv||yf&&8<yf&&11>=yf),mP=" ",gP=!1;function OP(f,p){switch(f){case"keyup":return A3.indexOf(p.keyCode)!==-1;case"keydown":return p.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function vP(f){return f=f.detail,typeof f=="object"&&"data"in f?f.data:null}var jc=!1;function M3(f,p){switch(f){case"compositionend":return vP(p);case"keypress":return p.which!==32?null:(gP=!0,mP);case"textInput":return f=p.data,f===mP&&gP?null:f;default:return null}}function Q3(f,p){if(jc)return f==="compositionend"||!yv&&OP(f,p)?(f=Qa(),yo=ls=ri=null,jc=!1,f):null;switch(f){case"paste":return null;case"keypress":if(!(p.ctrlKey||p.altKey||p.metaKey)||p.ctrlKey&&p.altKey){if(p.char&&1<p.char.length)return p.char;if(p.which)return String.fromCharCode(p.which)}return null;case"compositionend":return pP&&p.locale!=="ko"?null:p.data;default:return null}}var D3={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 yP(f){var p=f&&f.nodeName&&f.nodeName.toLowerCase();return p==="input"?!!D3[f.type]:p==="textarea"}function bP(f,p,v,w){Pn(w),p=Dh(p,"onChange"),0<p.length&&(v=new ra("onChange","change",null,v,w),f.push({event:v,listeners:p}))}var bf=null,Sf=null;function I3(f){NP(f,0)}function Ah(f){var p=Bc(f);if(Te(p))return f}function j3(f,p){if(f==="change")return p}var SP=!1;if(a){var bv;if(a){var Sv="oninput"in document;if(!Sv){var wP=document.createElement("div");wP.setAttribute("oninput","return;"),Sv=typeof wP.oninput=="function"}bv=Sv}else bv=!1;SP=bv&&(!document.documentMode||9<document.documentMode)}function kP(){bf&&(bf.detachEvent("onpropertychange",PP),Sf=bf=null)}function PP(f){if(f.propertyName==="value"&&Ah(Sf)){var p=[];bP(p,Sf,f,ct(f)),Qr(I3,p)}}function N3(f,p,v){f==="focusin"?(kP(),bf=p,Sf=v,bf.attachEvent("onpropertychange",PP)):f==="focusout"&&kP()}function L3(f){if(f==="selectionchange"||f==="keyup"||f==="keydown")return Ah(Sf)}function q3(f,p){if(f==="click")return Ah(p)}function U3(f,p){if(f==="input"||f==="change")return Ah(p)}function B3(f,p){return f===p&&(f!==0||1/f===1/p)||f!==f&&p!==p}var Ys=typeof Object.is=="function"?Object.is:B3;function wf(f,p){if(Ys(f,p))return!0;if(typeof f!="object"||f===null||typeof p!="object"||p===null)return!1;var v=Object.keys(f),w=Object.keys(p);if(v.length!==w.length)return!1;for(w=0;w<v.length;w++){var C=v[w];if(!l.call(p,C)||!Ys(f[C],p[C]))return!1}return!0}function xP(f){for(;f&&f.firstChild;)f=f.firstChild;return f}function TP(f,p){var v=xP(f);f=0;for(var w;v;){if(v.nodeType===3){if(w=f+v.textContent.length,f<=p&&w>=p)return{node:v,offset:p-f};f=w}e:{for(;v;){if(v.nextSibling){v=v.nextSibling;break e}v=v.parentNode}v=void 0}v=xP(v)}}function CP(f,p){return f&&p?f===p?!0:f&&f.nodeType===3?!1:p&&p.nodeType===3?CP(f,p.parentNode):"contains"in f?f.contains(p):f.compareDocumentPosition?!!(f.compareDocumentPosition(p)&16):!1:!1}function _P(){for(var f=window,p=Pe();p instanceof f.HTMLIFrameElement;){try{var v=typeof p.contentWindow.location.href=="string"}catch{v=!1}if(v)f=p.contentWindow;else break;p=Pe(f.document)}return p}function wv(f){var p=f&&f.nodeName&&f.nodeName.toLowerCase();return p&&(p==="input"&&(f.type==="text"||f.type==="search"||f.type==="tel"||f.type==="url"||f.type==="password")||p==="textarea"||f.contentEditable==="true")}function F3(f){var p=_P(),v=f.focusedElem,w=f.selectionRange;if(p!==v&&v&&v.ownerDocument&&CP(v.ownerDocument.documentElement,v)){if(w!==null&&wv(v)){if(p=w.start,f=w.end,f===void 0&&(f=p),"selectionStart"in v)v.selectionStart=p,v.selectionEnd=Math.min(f,v.value.length);else if(f=(p=v.ownerDocument||document)&&p.defaultView||window,f.getSelection){f=f.getSelection();var C=v.textContent.length,E=Math.min(w.start,C);w=w.end===void 0?E:Math.min(w.end,C),!f.extend&&E>w&&(C=w,w=E,E=C),C=TP(v,E);var N=TP(v,w);C&&N&&(f.rangeCount!==1||f.anchorNode!==C.node||f.anchorOffset!==C.offset||f.focusNode!==N.node||f.focusOffset!==N.offset)&&(p=p.createRange(),p.setStart(C.node,C.offset),f.removeAllRanges(),E>w?(f.addRange(p),f.extend(N.node,N.offset)):(p.setEnd(N.node,N.offset),f.addRange(p)))}}for(p=[],f=v;f=f.parentNode;)f.nodeType===1&&p.push({element:f,left:f.scrollLeft,top:f.scrollTop});for(typeof v.focus=="function"&&v.focus(),v=0;v<p.length;v++)f=p[v],f.element.scrollLeft=f.left,f.element.scrollTop=f.top}}var V3=a&&"documentMode"in document&&11>=document.documentMode,Nc=null,kv=null,kf=null,Pv=!1;function EP(f,p,v){var w=v.window===v?v.document:v.nodeType===9?v:v.ownerDocument;Pv||Nc==null||Nc!==Pe(w)||(w=Nc,"selectionStart"in w&&wv(w)?w={start:w.selectionStart,end:w.selectionEnd}:(w=(w.ownerDocument&&w.ownerDocument.defaultView||window).getSelection(),w={anchorNode:w.anchorNode,anchorOffset:w.anchorOffset,focusNode:w.focusNode,focusOffset:w.focusOffset}),kf&&wf(kf,w)||(kf=w,w=Dh(kv,"onSelect"),0<w.length&&(p=new ra("onSelect","select",null,p,v),f.push({event:p,listeners:w}),p.target=Nc)))}function $h(f,p){var v={};return v[f.toLowerCase()]=p.toLowerCase(),v["Webkit"+f]="webkit"+p,v["Moz"+f]="moz"+p,v}var Lc={animationend:$h("Animation","AnimationEnd"),animationiteration:$h("Animation","AnimationIteration"),animationstart:$h("Animation","AnimationStart"),transitionend:$h("Transition","TransitionEnd")},xv={},RP={};a&&(RP=document.createElement("div").style,"AnimationEvent"in window||(delete Lc.animationend.animation,delete Lc.animationiteration.animation,delete Lc.animationstart.animation),"TransitionEvent"in window||delete Lc.transitionend.transition);function Mh(f){if(xv[f])return xv[f];if(!Lc[f])return f;var p=Lc[f],v;for(v in p)if(p.hasOwnProperty(v)&&v in RP)return xv[f]=p[v];return f}var AP=Mh("animationend"),$P=Mh("animationiteration"),MP=Mh("animationstart"),QP=Mh("transitionend"),DP=new Map,IP="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function La(f,p){DP.set(f,p),s(p,[f])}for(var Tv=0;Tv<IP.length;Tv++){var Cv=IP[Tv],Z3=Cv.toLowerCase(),W3=Cv[0].toUpperCase()+Cv.slice(1);La(Z3,"on"+W3)}La(AP,"onAnimationEnd"),La($P,"onAnimationIteration"),La(MP,"onAnimationStart"),La("dblclick","onDoubleClick"),La("focusin","onFocus"),La("focusout","onBlur"),La(QP,"onTransitionEnd"),o("onMouseEnter",["mouseout","mouseover"]),o("onMouseLeave",["mouseout","mouseover"]),o("onPointerEnter",["pointerout","pointerover"]),o("onPointerLeave",["pointerout","pointerover"]),s("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),s("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),s("onBeforeInput",["compositionend","keypress","textInput","paste"]),s("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),s("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),s("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Pf="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),X3=new Set("cancel close invalid load scroll toggle".split(" ").concat(Pf));function jP(f,p,v){var w=f.type||"unknown-event";f.currentTarget=v,Zt(w,p,void 0,f),f.currentTarget=null}function NP(f,p){p=(p&4)!==0;for(var v=0;v<f.length;v++){var w=f[v],C=w.event;w=w.listeners;e:{var E=void 0;if(p)for(var N=w.length-1;0<=N;N--){var ne=w[N],le=ne.instance,be=ne.currentTarget;if(ne=ne.listener,le!==E&&C.isPropagationStopped())break e;jP(C,ne,be),E=le}else for(N=0;N<w.length;N++){if(ne=w[N],le=ne.instance,be=ne.currentTarget,ne=ne.listener,le!==E&&C.isPropagationStopped())break e;jP(C,ne,be),E=le}}}if(Pt)throw f=it,Pt=!1,it=null,f}function cr(f,p){var v=p[Dv];v===void 0&&(v=p[Dv]=new Set);var w=f+"__bubble";v.has(w)||(LP(p,f,2,!1),v.add(w))}function _v(f,p,v){var w=0;p&&(w|=4),LP(v,f,w,p)}var Qh="_reactListening"+Math.random().toString(36).slice(2);function xf(f){if(!f[Qh]){f[Qh]=!0,r.forEach(function(v){v!=="selectionchange"&&(X3.has(v)||_v(v,!1,f),_v(v,!0,f))});var p=f.nodeType===9?f:f.ownerDocument;p===null||p[Qh]||(p[Qh]=!0,_v("selectionchange",!1,p))}}function LP(f,p,v,w){switch(Bl(p)){case 1:var C=$a;break;case 4:C=Of;break;default:C=Ws}v=C.bind(null,p,v,f),C=void 0,!Sr||p!=="touchstart"&&p!=="touchmove"&&p!=="wheel"||(C=!0),w?C!==void 0?f.addEventListener(p,v,{capture:!0,passive:C}):f.addEventListener(p,v,!0):C!==void 0?f.addEventListener(p,v,{passive:C}):f.addEventListener(p,v,!1)}function Ev(f,p,v,w,C){var E=w;if((p&1)===0&&(p&2)===0&&w!==null)e:for(;;){if(w===null)return;var N=w.tag;if(N===3||N===4){var ne=w.stateNode.containerInfo;if(ne===C||ne.nodeType===8&&ne.parentNode===C)break;if(N===4)for(N=w.return;N!==null;){var le=N.tag;if((le===3||le===4)&&(le=N.stateNode.containerInfo,le===C||le.nodeType===8&&le.parentNode===C))return;N=N.return}for(;ne!==null;){if(N=Zl(ne),N===null)return;if(le=N.tag,le===5||le===6){w=E=N;continue e}ne=ne.parentNode}}w=w.return}Qr(function(){var be=E,Be=ct(v),Ve=[];e:{var Ue=DP.get(f);if(Ue!==void 0){var Ot=ra,xt=f;switch(f){case"keypress":if(Xs(v)===0)break e;case"keydown":case"keyup":Ot=Ct;break;case"focusin":xt="focus",Ot=we;break;case"focusout":xt="blur",Ot=we;break;case"beforeblur":case"afterblur":Ot=we;break;case"click":if(v.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Ot=z;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Ot=ve;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Ot=Lr;break;case AP:case $P:case MP:Ot=qe;break;case QP:Ot=Na;break;case"scroll":Ot=vv;break;case"wheel":Ot=Vl;break;case"copy":case"cut":case"paste":Ot=hn;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Ot=mn}var Rt=(p&4)!==0,Ir=!Rt&&f==="scroll",me=Rt?Ue!==null?Ue+"Capture":null:Ue;Rt=[];for(var fe=be,Oe;fe!==null;){Oe=fe;var He=Oe.stateNode;if(Oe.tag===5&&He!==null&&(Oe=He,me!==null&&(He=nr(fe,me),He!=null&&Rt.push(Tf(fe,He,Oe)))),Ir)break;fe=fe.return}0<Rt.length&&(Ue=new Ot(Ue,xt,null,v,Be),Ve.push({event:Ue,listeners:Rt}))}}if((p&7)===0){e:{if(Ue=f==="mouseover"||f==="pointerover",Ot=f==="mouseout"||f==="pointerout",Ue&&v!==Le&&(xt=v.relatedTarget||v.fromElement)&&(Zl(xt)||xt[oa]))break e;if((Ot||Ue)&&(Ue=Be.window===Be?Be:(Ue=Be.ownerDocument)?Ue.defaultView||Ue.parentWindow:window,Ot?(xt=v.relatedTarget||v.toElement,Ot=be,xt=xt?Zl(xt):null,xt!==null&&(Ir=Gt(xt),xt!==Ir||xt.tag!==5&&xt.tag!==6)&&(xt=null)):(Ot=null,xt=be),Ot!==xt)){if(Rt=z,He="onMouseLeave",me="onMouseEnter",fe="mouse",(f==="pointerout"||f==="pointerover")&&(Rt=mn,He="onPointerLeave",me="onPointerEnter",fe="pointer"),Ir=Ot==null?Ue:Bc(Ot),Oe=xt==null?Ue:Bc(xt),Ue=new Rt(He,fe+"leave",Ot,v,Be),Ue.target=Ir,Ue.relatedTarget=Oe,He=null,Zl(Be)===be&&(Rt=new Rt(me,fe+"enter",xt,v,Be),Rt.target=Oe,Rt.relatedTarget=Ir,He=Rt),Ir=He,Ot&&xt)t:{for(Rt=Ot,me=xt,fe=0,Oe=Rt;Oe;Oe=qc(Oe))fe++;for(Oe=0,He=me;He;He=qc(He))Oe++;for(;0<fe-Oe;)Rt=qc(Rt),fe--;for(;0<Oe-fe;)me=qc(me),Oe--;for(;fe--;){if(Rt===me||me!==null&&Rt===me.alternate)break t;Rt=qc(Rt),me=qc(me)}Rt=null}else Rt=null;Ot!==null&&qP(Ve,Ue,Ot,Rt,!1),xt!==null&&Ir!==null&&qP(Ve,Ir,xt,Rt,!0)}}e:{if(Ue=be?Bc(be):window,Ot=Ue.nodeName&&Ue.nodeName.toLowerCase(),Ot==="select"||Ot==="input"&&Ue.type==="file")var At=j3;else if(yP(Ue))if(SP)At=U3;else{At=L3;var qt=N3}else(Ot=Ue.nodeName)&&Ot.toLowerCase()==="input"&&(Ue.type==="checkbox"||Ue.type==="radio")&&(At=q3);if(At&&(At=At(f,be))){bP(Ve,At,v,Be);break e}qt&&qt(f,Ue,be),f==="focusout"&&(qt=Ue._wrapperState)&&qt.controlled&&Ue.type==="number"&&an(Ue,"number",Ue.value)}switch(qt=be?Bc(be):window,f){case"focusin":(yP(qt)||qt.contentEditable==="true")&&(Nc=qt,kv=be,kf=null);break;case"focusout":kf=kv=Nc=null;break;case"mousedown":Pv=!0;break;case"contextmenu":case"mouseup":case"dragend":Pv=!1,EP(Ve,v,Be);break;case"selectionchange":if(V3)break;case"keydown":case"keyup":EP(Ve,v,Be)}var Ut;if(yv)e:{switch(f){case"compositionstart":var Wt="onCompositionStart";break e;case"compositionend":Wt="onCompositionEnd";break e;case"compositionupdate":Wt="onCompositionUpdate";break e}Wt=void 0}else jc?OP(f,v)&&(Wt="onCompositionEnd"):f==="keydown"&&v.keyCode===229&&(Wt="onCompositionStart");Wt&&(pP&&v.locale!=="ko"&&(jc||Wt!=="onCompositionStart"?Wt==="onCompositionEnd"&&jc&&(Ut=Qa()):(ri=Be,ls="value"in ri?ri.value:ri.textContent,jc=!0)),qt=Dh(be,Wt),0<qt.length&&(Wt=new pn(Wt,f,null,v,Be),Ve.push({event:Wt,listeners:qt}),Ut?Wt.data=Ut:(Ut=vP(v),Ut!==null&&(Wt.data=Ut)))),(Ut=$3?M3(f,v):Q3(f,v))&&(be=Dh(be,"onBeforeInput"),0<be.length&&(Be=new pn("onBeforeInput","beforeinput",null,v,Be),Ve.push({event:Be,listeners:be}),Be.data=Ut))}NP(Ve,p)})}function Tf(f,p,v){return{instance:f,listener:p,currentTarget:v}}function Dh(f,p){for(var v=p+"Capture",w=[];f!==null;){var C=f,E=C.stateNode;C.tag===5&&E!==null&&(C=E,E=nr(f,v),E!=null&&w.unshift(Tf(f,E,C)),E=nr(f,p),E!=null&&w.push(Tf(f,E,C))),f=f.return}return w}function qc(f){if(f===null)return null;do f=f.return;while(f&&f.tag!==5);return f||null}function qP(f,p,v,w,C){for(var E=p._reactName,N=[];v!==null&&v!==w;){var ne=v,le=ne.alternate,be=ne.stateNode;if(le!==null&&le===w)break;ne.tag===5&&be!==null&&(ne=be,C?(le=nr(v,E),le!=null&&N.unshift(Tf(v,le,ne))):C||(le=nr(v,E),le!=null&&N.push(Tf(v,le,ne)))),v=v.return}N.length!==0&&f.push({event:p,listeners:N})}var z3=/\r\n?/g,Y3=/\u0000|\uFFFD/g;function UP(f){return(typeof f=="string"?f:""+f).replace(z3,`
|
|
38
|
+
`).replace(Y3,"")}function Ih(f,p,v){if(p=UP(p),UP(f)!==p&&v)throw Error(t(425))}function jh(){}var Rv=null,Av=null;function $v(f,p){return f==="textarea"||f==="noscript"||typeof p.children=="string"||typeof p.children=="number"||typeof p.dangerouslySetInnerHTML=="object"&&p.dangerouslySetInnerHTML!==null&&p.dangerouslySetInnerHTML.__html!=null}var Mv=typeof setTimeout=="function"?setTimeout:void 0,G3=typeof clearTimeout=="function"?clearTimeout:void 0,BP=typeof Promise=="function"?Promise:void 0,H3=typeof queueMicrotask=="function"?queueMicrotask:typeof BP<"u"?function(f){return BP.resolve(null).then(f).catch(K3)}:Mv;function K3(f){setTimeout(function(){throw f})}function Qv(f,p){var v=p,w=0;do{var C=v.nextSibling;if(f.removeChild(v),C&&C.nodeType===8)if(v=C.data,v==="/$"){if(w===0){f.removeChild(C),Zs(p);return}w--}else v!=="$"&&v!=="$?"&&v!=="$!"||w++;v=C}while(v);Zs(p)}function qa(f){for(;f!=null;f=f.nextSibling){var p=f.nodeType;if(p===1||p===3)break;if(p===8){if(p=f.data,p==="$"||p==="$!"||p==="$?")break;if(p==="/$")return null}}return f}function FP(f){f=f.previousSibling;for(var p=0;f;){if(f.nodeType===8){var v=f.data;if(v==="$"||v==="$!"||v==="$?"){if(p===0)return f;p--}else v==="/$"&&p++}f=f.previousSibling}return null}var Uc=Math.random().toString(36).slice(2),bo="__reactFiber$"+Uc,Cf="__reactProps$"+Uc,oa="__reactContainer$"+Uc,Dv="__reactEvents$"+Uc,J3="__reactListeners$"+Uc,eq="__reactHandles$"+Uc;function Zl(f){var p=f[bo];if(p)return p;for(var v=f.parentNode;v;){if(p=v[oa]||v[bo]){if(v=p.alternate,p.child!==null||v!==null&&v.child!==null)for(f=FP(f);f!==null;){if(v=f[bo])return v;f=FP(f)}return p}f=v,v=f.parentNode}return null}function _f(f){return f=f[bo]||f[oa],!f||f.tag!==5&&f.tag!==6&&f.tag!==13&&f.tag!==3?null:f}function Bc(f){if(f.tag===5||f.tag===6)return f.stateNode;throw Error(t(33))}function Nh(f){return f[Cf]||null}var Iv=[],Fc=-1;function Ua(f){return{current:f}}function ur(f){0>Fc||(f.current=Iv[Fc],Iv[Fc]=null,Fc--)}function ir(f,p){Fc++,Iv[Fc]=f.current,f.current=p}var Ba={},ki=Ua(Ba),Zi=Ua(!1),Wl=Ba;function Vc(f,p){var v=f.type.contextTypes;if(!v)return Ba;var w=f.stateNode;if(w&&w.__reactInternalMemoizedUnmaskedChildContext===p)return w.__reactInternalMemoizedMaskedChildContext;var C={},E;for(E in v)C[E]=p[E];return w&&(f=f.stateNode,f.__reactInternalMemoizedUnmaskedChildContext=p,f.__reactInternalMemoizedMaskedChildContext=C),C}function Wi(f){return f=f.childContextTypes,f!=null}function Lh(){ur(Zi),ur(ki)}function VP(f,p,v){if(ki.current!==Ba)throw Error(t(168));ir(ki,p),ir(Zi,v)}function ZP(f,p,v){var w=f.stateNode;if(p=p.childContextTypes,typeof w.getChildContext!="function")return v;w=w.getChildContext();for(var C in w)if(!(C in p))throw Error(t(108,j(f)||"Unknown",C));return re({},v,w)}function qh(f){return f=(f=f.stateNode)&&f.__reactInternalMemoizedMergedChildContext||Ba,Wl=ki.current,ir(ki,f),ir(Zi,Zi.current),!0}function WP(f,p,v){var w=f.stateNode;if(!w)throw Error(t(169));v?(f=ZP(f,p,Wl),w.__reactInternalMemoizedMergedChildContext=f,ur(Zi),ur(ki),ir(ki,f)):ur(Zi),ir(Zi,v)}var aa=null,Uh=!1,jv=!1;function XP(f){aa===null?aa=[f]:aa.push(f)}function tq(f){Uh=!0,XP(f)}function Fa(){if(!jv&&aa!==null){jv=!0;var f=0,p=jt;try{var v=aa;for(jt=1;f<v.length;f++){var w=v[f];do w=w(!0);while(w!==null)}aa=null,Uh=!1}catch(C){throw aa!==null&&(aa=aa.slice(f+1)),Bt(Wr,Fa),C}finally{jt=p,jv=!1}}return null}var Zc=[],Wc=0,Bh=null,Fh=0,Ps=[],xs=0,Xl=null,la=1,ca="";function zl(f,p){Zc[Wc++]=Fh,Zc[Wc++]=Bh,Bh=f,Fh=p}function zP(f,p,v){Ps[xs++]=la,Ps[xs++]=ca,Ps[xs++]=Xl,Xl=f;var w=la;f=ca;var C=32-De(w)-1;w&=~(1<<C),v+=1;var E=32-De(p)+C;if(30<E){var N=C-C%5;E=(w&(1<<N)-1).toString(32),w>>=N,C-=N,la=1<<32-De(p)+C|v<<C|w,ca=E+f}else la=1<<E|v<<C|w,ca=f}function Nv(f){f.return!==null&&(zl(f,1),zP(f,1,0))}function Lv(f){for(;f===Bh;)Bh=Zc[--Wc],Zc[Wc]=null,Fh=Zc[--Wc],Zc[Wc]=null;for(;f===Xl;)Xl=Ps[--xs],Ps[xs]=null,ca=Ps[--xs],Ps[xs]=null,la=Ps[--xs],Ps[xs]=null}var cs=null,us=null,Or=!1,Gs=null;function YP(f,p){var v=Es(5,null,null,0);v.elementType="DELETED",v.stateNode=p,v.return=f,p=f.deletions,p===null?(f.deletions=[v],f.flags|=16):p.push(v)}function GP(f,p){switch(f.tag){case 5:var v=f.type;return p=p.nodeType!==1||v.toLowerCase()!==p.nodeName.toLowerCase()?null:p,p!==null?(f.stateNode=p,cs=f,us=qa(p.firstChild),!0):!1;case 6:return p=f.pendingProps===""||p.nodeType!==3?null:p,p!==null?(f.stateNode=p,cs=f,us=null,!0):!1;case 13:return p=p.nodeType!==8?null:p,p!==null?(v=Xl!==null?{id:la,overflow:ca}:null,f.memoizedState={dehydrated:p,treeContext:v,retryLane:1073741824},v=Es(18,null,null,0),v.stateNode=p,v.return=f,f.child=v,cs=f,us=null,!0):!1;default:return!1}}function qv(f){return(f.mode&1)!==0&&(f.flags&128)===0}function Uv(f){if(Or){var p=us;if(p){var v=p;if(!GP(f,p)){if(qv(f))throw Error(t(418));p=qa(v.nextSibling);var w=cs;p&&GP(f,p)?YP(w,v):(f.flags=f.flags&-4097|2,Or=!1,cs=f)}}else{if(qv(f))throw Error(t(418));f.flags=f.flags&-4097|2,Or=!1,cs=f}}}function HP(f){for(f=f.return;f!==null&&f.tag!==5&&f.tag!==3&&f.tag!==13;)f=f.return;cs=f}function Vh(f){if(f!==cs)return!1;if(!Or)return HP(f),Or=!0,!1;var p;if((p=f.tag!==3)&&!(p=f.tag!==5)&&(p=f.type,p=p!=="head"&&p!=="body"&&!$v(f.type,f.memoizedProps)),p&&(p=us)){if(qv(f))throw KP(),Error(t(418));for(;p;)YP(f,p),p=qa(p.nextSibling)}if(HP(f),f.tag===13){if(f=f.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(t(317));e:{for(f=f.nextSibling,p=0;f;){if(f.nodeType===8){var v=f.data;if(v==="/$"){if(p===0){us=qa(f.nextSibling);break e}p--}else v!=="$"&&v!=="$!"&&v!=="$?"||p++}f=f.nextSibling}us=null}}else us=cs?qa(f.stateNode.nextSibling):null;return!0}function KP(){for(var f=us;f;)f=qa(f.nextSibling)}function Xc(){us=cs=null,Or=!1}function Bv(f){Gs===null?Gs=[f]:Gs.push(f)}var nq=k.ReactCurrentBatchConfig;function Ef(f,p,v){if(f=v.ref,f!==null&&typeof f!="function"&&typeof f!="object"){if(v._owner){if(v=v._owner,v){if(v.tag!==1)throw Error(t(309));var w=v.stateNode}if(!w)throw Error(t(147,f));var C=w,E=""+f;return p!==null&&p.ref!==null&&typeof p.ref=="function"&&p.ref._stringRef===E?p.ref:(p=function(N){var ne=C.refs;N===null?delete ne[E]:ne[E]=N},p._stringRef=E,p)}if(typeof f!="string")throw Error(t(284));if(!v._owner)throw Error(t(290,f))}return f}function Zh(f,p){throw f=Object.prototype.toString.call(p),Error(t(31,f==="[object Object]"?"object with keys {"+Object.keys(p).join(", ")+"}":f))}function JP(f){var p=f._init;return p(f._payload)}function ex(f){function p(me,fe){if(f){var Oe=me.deletions;Oe===null?(me.deletions=[fe],me.flags|=16):Oe.push(fe)}}function v(me,fe){if(!f)return null;for(;fe!==null;)p(me,fe),fe=fe.sibling;return null}function w(me,fe){for(me=new Map;fe!==null;)fe.key!==null?me.set(fe.key,fe):me.set(fe.index,fe),fe=fe.sibling;return me}function C(me,fe){return me=Ha(me,fe),me.index=0,me.sibling=null,me}function E(me,fe,Oe){return me.index=Oe,f?(Oe=me.alternate,Oe!==null?(Oe=Oe.index,Oe<fe?(me.flags|=2,fe):Oe):(me.flags|=2,fe)):(me.flags|=1048576,fe)}function N(me){return f&&me.alternate===null&&(me.flags|=2),me}function ne(me,fe,Oe,He){return fe===null||fe.tag!==6?(fe=My(Oe,me.mode,He),fe.return=me,fe):(fe=C(fe,Oe),fe.return=me,fe)}function le(me,fe,Oe,He){var At=Oe.type;return At===M?Be(me,fe,Oe.props.children,He,Oe.key):fe!==null&&(fe.elementType===At||typeof At=="object"&&At!==null&&At.$$typeof===B&&JP(At)===fe.type)?(He=C(fe,Oe.props),He.ref=Ef(me,fe,Oe),He.return=me,He):(He=mp(Oe.type,Oe.key,Oe.props,null,me.mode,He),He.ref=Ef(me,fe,Oe),He.return=me,He)}function be(me,fe,Oe,He){return fe===null||fe.tag!==4||fe.stateNode.containerInfo!==Oe.containerInfo||fe.stateNode.implementation!==Oe.implementation?(fe=Qy(Oe,me.mode,He),fe.return=me,fe):(fe=C(fe,Oe.children||[]),fe.return=me,fe)}function Be(me,fe,Oe,He,At){return fe===null||fe.tag!==7?(fe=nc(Oe,me.mode,He,At),fe.return=me,fe):(fe=C(fe,Oe),fe.return=me,fe)}function Ve(me,fe,Oe){if(typeof fe=="string"&&fe!==""||typeof fe=="number")return fe=My(""+fe,me.mode,Oe),fe.return=me,fe;if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case x:return Oe=mp(fe.type,fe.key,fe.props,null,me.mode,Oe),Oe.ref=Ef(me,null,fe),Oe.return=me,Oe;case A:return fe=Qy(fe,me.mode,Oe),fe.return=me,fe;case B:var He=fe._init;return Ve(me,He(fe._payload),Oe)}if(ln(fe)||ee(fe))return fe=nc(fe,me.mode,Oe,null),fe.return=me,fe;Zh(me,fe)}return null}function Ue(me,fe,Oe,He){var At=fe!==null?fe.key:null;if(typeof Oe=="string"&&Oe!==""||typeof Oe=="number")return At!==null?null:ne(me,fe,""+Oe,He);if(typeof Oe=="object"&&Oe!==null){switch(Oe.$$typeof){case x:return Oe.key===At?le(me,fe,Oe,He):null;case A:return Oe.key===At?be(me,fe,Oe,He):null;case B:return At=Oe._init,Ue(me,fe,At(Oe._payload),He)}if(ln(Oe)||ee(Oe))return At!==null?null:Be(me,fe,Oe,He,null);Zh(me,Oe)}return null}function Ot(me,fe,Oe,He,At){if(typeof He=="string"&&He!==""||typeof He=="number")return me=me.get(Oe)||null,ne(fe,me,""+He,At);if(typeof He=="object"&&He!==null){switch(He.$$typeof){case x:return me=me.get(He.key===null?Oe:He.key)||null,le(fe,me,He,At);case A:return me=me.get(He.key===null?Oe:He.key)||null,be(fe,me,He,At);case B:var qt=He._init;return Ot(me,fe,Oe,qt(He._payload),At)}if(ln(He)||ee(He))return me=me.get(Oe)||null,Be(fe,me,He,At,null);Zh(fe,He)}return null}function xt(me,fe,Oe,He){for(var At=null,qt=null,Ut=fe,Wt=fe=0,oi=null;Ut!==null&&Wt<Oe.length;Wt++){Ut.index>Wt?(oi=Ut,Ut=null):oi=Ut.sibling;var Nn=Ue(me,Ut,Oe[Wt],He);if(Nn===null){Ut===null&&(Ut=oi);break}f&&Ut&&Nn.alternate===null&&p(me,Ut),fe=E(Nn,fe,Wt),qt===null?At=Nn:qt.sibling=Nn,qt=Nn,Ut=oi}if(Wt===Oe.length)return v(me,Ut),Or&&zl(me,Wt),At;if(Ut===null){for(;Wt<Oe.length;Wt++)Ut=Ve(me,Oe[Wt],He),Ut!==null&&(fe=E(Ut,fe,Wt),qt===null?At=Ut:qt.sibling=Ut,qt=Ut);return Or&&zl(me,Wt),At}for(Ut=w(me,Ut);Wt<Oe.length;Wt++)oi=Ot(Ut,me,Wt,Oe[Wt],He),oi!==null&&(f&&oi.alternate!==null&&Ut.delete(oi.key===null?Wt:oi.key),fe=E(oi,fe,Wt),qt===null?At=oi:qt.sibling=oi,qt=oi);return f&&Ut.forEach(function(Ka){return p(me,Ka)}),Or&&zl(me,Wt),At}function Rt(me,fe,Oe,He){var At=ee(Oe);if(typeof At!="function")throw Error(t(150));if(Oe=At.call(Oe),Oe==null)throw Error(t(151));for(var qt=At=null,Ut=fe,Wt=fe=0,oi=null,Nn=Oe.next();Ut!==null&&!Nn.done;Wt++,Nn=Oe.next()){Ut.index>Wt?(oi=Ut,Ut=null):oi=Ut.sibling;var Ka=Ue(me,Ut,Nn.value,He);if(Ka===null){Ut===null&&(Ut=oi);break}f&&Ut&&Ka.alternate===null&&p(me,Ut),fe=E(Ka,fe,Wt),qt===null?At=Ka:qt.sibling=Ka,qt=Ka,Ut=oi}if(Nn.done)return v(me,Ut),Or&&zl(me,Wt),At;if(Ut===null){for(;!Nn.done;Wt++,Nn=Oe.next())Nn=Ve(me,Nn.value,He),Nn!==null&&(fe=E(Nn,fe,Wt),qt===null?At=Nn:qt.sibling=Nn,qt=Nn);return Or&&zl(me,Wt),At}for(Ut=w(me,Ut);!Nn.done;Wt++,Nn=Oe.next())Nn=Ot(Ut,me,Wt,Nn.value,He),Nn!==null&&(f&&Nn.alternate!==null&&Ut.delete(Nn.key===null?Wt:Nn.key),fe=E(Nn,fe,Wt),qt===null?At=Nn:qt.sibling=Nn,qt=Nn);return f&&Ut.forEach(function(Dq){return p(me,Dq)}),Or&&zl(me,Wt),At}function Ir(me,fe,Oe,He){if(typeof Oe=="object"&&Oe!==null&&Oe.type===M&&Oe.key===null&&(Oe=Oe.props.children),typeof Oe=="object"&&Oe!==null){switch(Oe.$$typeof){case x:e:{for(var At=Oe.key,qt=fe;qt!==null;){if(qt.key===At){if(At=Oe.type,At===M){if(qt.tag===7){v(me,qt.sibling),fe=C(qt,Oe.props.children),fe.return=me,me=fe;break e}}else if(qt.elementType===At||typeof At=="object"&&At!==null&&At.$$typeof===B&&JP(At)===qt.type){v(me,qt.sibling),fe=C(qt,Oe.props),fe.ref=Ef(me,qt,Oe),fe.return=me,me=fe;break e}v(me,qt);break}else p(me,qt);qt=qt.sibling}Oe.type===M?(fe=nc(Oe.props.children,me.mode,He,Oe.key),fe.return=me,me=fe):(He=mp(Oe.type,Oe.key,Oe.props,null,me.mode,He),He.ref=Ef(me,fe,Oe),He.return=me,me=He)}return N(me);case A:e:{for(qt=Oe.key;fe!==null;){if(fe.key===qt)if(fe.tag===4&&fe.stateNode.containerInfo===Oe.containerInfo&&fe.stateNode.implementation===Oe.implementation){v(me,fe.sibling),fe=C(fe,Oe.children||[]),fe.return=me,me=fe;break e}else{v(me,fe);break}else p(me,fe);fe=fe.sibling}fe=Qy(Oe,me.mode,He),fe.return=me,me=fe}return N(me);case B:return qt=Oe._init,Ir(me,fe,qt(Oe._payload),He)}if(ln(Oe))return xt(me,fe,Oe,He);if(ee(Oe))return Rt(me,fe,Oe,He);Zh(me,Oe)}return typeof Oe=="string"&&Oe!==""||typeof Oe=="number"?(Oe=""+Oe,fe!==null&&fe.tag===6?(v(me,fe.sibling),fe=C(fe,Oe),fe.return=me,me=fe):(v(me,fe),fe=My(Oe,me.mode,He),fe.return=me,me=fe),N(me)):v(me,fe)}return Ir}var zc=ex(!0),tx=ex(!1),Wh=Ua(null),Xh=null,Yc=null,Fv=null;function Vv(){Fv=Yc=Xh=null}function Zv(f){var p=Wh.current;ur(Wh),f._currentValue=p}function Wv(f,p,v){for(;f!==null;){var w=f.alternate;if((f.childLanes&p)!==p?(f.childLanes|=p,w!==null&&(w.childLanes|=p)):w!==null&&(w.childLanes&p)!==p&&(w.childLanes|=p),f===v)break;f=f.return}}function Gc(f,p){Xh=f,Fv=Yc=null,f=f.dependencies,f!==null&&f.firstContext!==null&&((f.lanes&p)!==0&&(Xi=!0),f.firstContext=null)}function Ts(f){var p=f._currentValue;if(Fv!==f)if(f={context:f,memoizedValue:p,next:null},Yc===null){if(Xh===null)throw Error(t(308));Yc=f,Xh.dependencies={lanes:0,firstContext:f}}else Yc=Yc.next=f;return p}var Yl=null;function Xv(f){Yl===null?Yl=[f]:Yl.push(f)}function nx(f,p,v,w){var C=p.interleaved;return C===null?(v.next=v,Xv(p)):(v.next=C.next,C.next=v),p.interleaved=v,ua(f,w)}function ua(f,p){f.lanes|=p;var v=f.alternate;for(v!==null&&(v.lanes|=p),v=f,f=f.return;f!==null;)f.childLanes|=p,v=f.alternate,v!==null&&(v.childLanes|=p),v=f,f=f.return;return v.tag===3?v.stateNode:null}var Va=!1;function zv(f){f.updateQueue={baseState:f.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function rx(f,p){f=f.updateQueue,p.updateQueue===f&&(p.updateQueue={baseState:f.baseState,firstBaseUpdate:f.firstBaseUpdate,lastBaseUpdate:f.lastBaseUpdate,shared:f.shared,effects:f.effects})}function fa(f,p){return{eventTime:f,lane:p,tag:0,payload:null,callback:null,next:null}}function Za(f,p,v){var w=f.updateQueue;if(w===null)return null;if(w=w.shared,(An&2)!==0){var C=w.pending;return C===null?p.next=p:(p.next=C.next,C.next=p),w.pending=p,ua(f,v)}return C=w.interleaved,C===null?(p.next=p,Xv(w)):(p.next=C.next,C.next=p),w.interleaved=p,ua(f,v)}function zh(f,p,v){if(p=p.updateQueue,p!==null&&(p=p.shared,(v&4194240)!==0)){var w=p.lanes;w&=f.pendingLanes,v|=w,p.lanes=v,bn(f,v)}}function ix(f,p){var v=f.updateQueue,w=f.alternate;if(w!==null&&(w=w.updateQueue,v===w)){var C=null,E=null;if(v=v.firstBaseUpdate,v!==null){do{var N={eventTime:v.eventTime,lane:v.lane,tag:v.tag,payload:v.payload,callback:v.callback,next:null};E===null?C=E=N:E=E.next=N,v=v.next}while(v!==null);E===null?C=E=p:E=E.next=p}else C=E=p;v={baseState:w.baseState,firstBaseUpdate:C,lastBaseUpdate:E,shared:w.shared,effects:w.effects},f.updateQueue=v;return}f=v.lastBaseUpdate,f===null?v.firstBaseUpdate=p:f.next=p,v.lastBaseUpdate=p}function Yh(f,p,v,w){var C=f.updateQueue;Va=!1;var E=C.firstBaseUpdate,N=C.lastBaseUpdate,ne=C.shared.pending;if(ne!==null){C.shared.pending=null;var le=ne,be=le.next;le.next=null,N===null?E=be:N.next=be,N=le;var Be=f.alternate;Be!==null&&(Be=Be.updateQueue,ne=Be.lastBaseUpdate,ne!==N&&(ne===null?Be.firstBaseUpdate=be:ne.next=be,Be.lastBaseUpdate=le))}if(E!==null){var Ve=C.baseState;N=0,Be=be=le=null,ne=E;do{var Ue=ne.lane,Ot=ne.eventTime;if((w&Ue)===Ue){Be!==null&&(Be=Be.next={eventTime:Ot,lane:0,tag:ne.tag,payload:ne.payload,callback:ne.callback,next:null});e:{var xt=f,Rt=ne;switch(Ue=p,Ot=v,Rt.tag){case 1:if(xt=Rt.payload,typeof xt=="function"){Ve=xt.call(Ot,Ve,Ue);break e}Ve=xt;break e;case 3:xt.flags=xt.flags&-65537|128;case 0:if(xt=Rt.payload,Ue=typeof xt=="function"?xt.call(Ot,Ve,Ue):xt,Ue==null)break e;Ve=re({},Ve,Ue);break e;case 2:Va=!0}}ne.callback!==null&&ne.lane!==0&&(f.flags|=64,Ue=C.effects,Ue===null?C.effects=[ne]:Ue.push(ne))}else Ot={eventTime:Ot,lane:Ue,tag:ne.tag,payload:ne.payload,callback:ne.callback,next:null},Be===null?(be=Be=Ot,le=Ve):Be=Be.next=Ot,N|=Ue;if(ne=ne.next,ne===null){if(ne=C.shared.pending,ne===null)break;Ue=ne,ne=Ue.next,Ue.next=null,C.lastBaseUpdate=Ue,C.shared.pending=null}}while(!0);if(Be===null&&(le=Ve),C.baseState=le,C.firstBaseUpdate=be,C.lastBaseUpdate=Be,p=C.shared.interleaved,p!==null){C=p;do N|=C.lane,C=C.next;while(C!==p)}else E===null&&(C.shared.lanes=0);Kl|=N,f.lanes=N,f.memoizedState=Ve}}function sx(f,p,v){if(f=p.effects,p.effects=null,f!==null)for(p=0;p<f.length;p++){var w=f[p],C=w.callback;if(C!==null){if(w.callback=null,w=v,typeof C!="function")throw Error(t(191,C));C.call(w)}}}var Rf={},So=Ua(Rf),Af=Ua(Rf),$f=Ua(Rf);function Gl(f){if(f===Rf)throw Error(t(174));return f}function Yv(f,p){switch(ir($f,p),ir(Af,f),ir(So,Rf),f=p.nodeType,f){case 9:case 11:p=(p=p.documentElement)?p.namespaceURI:Ze(null,"");break;default:f=f===8?p.parentNode:p,p=f.namespaceURI||null,f=f.tagName,p=Ze(p,f)}ur(So),ir(So,p)}function Hc(){ur(So),ur(Af),ur($f)}function ox(f){Gl($f.current);var p=Gl(So.current),v=Ze(p,f.type);p!==v&&(ir(Af,f),ir(So,v))}function Gv(f){Af.current===f&&(ur(So),ur(Af))}var kr=Ua(0);function Gh(f){for(var p=f;p!==null;){if(p.tag===13){var v=p.memoizedState;if(v!==null&&(v=v.dehydrated,v===null||v.data==="$?"||v.data==="$!"))return p}else if(p.tag===19&&p.memoizedProps.revealOrder!==void 0){if((p.flags&128)!==0)return p}else if(p.child!==null){p.child.return=p,p=p.child;continue}if(p===f)break;for(;p.sibling===null;){if(p.return===null||p.return===f)return null;p=p.return}p.sibling.return=p.return,p=p.sibling}return null}var Hv=[];function Kv(){for(var f=0;f<Hv.length;f++)Hv[f]._workInProgressVersionPrimary=null;Hv.length=0}var Hh=k.ReactCurrentDispatcher,Jv=k.ReactCurrentBatchConfig,Hl=0,Pr=null,zr=null,ii=null,Kh=!1,Mf=!1,Qf=0,rq=0;function Pi(){throw Error(t(321))}function ey(f,p){if(p===null)return!1;for(var v=0;v<p.length&&v<f.length;v++)if(!Ys(f[v],p[v]))return!1;return!0}function ty(f,p,v,w,C,E){if(Hl=E,Pr=p,p.memoizedState=null,p.updateQueue=null,p.lanes=0,Hh.current=f===null||f.memoizedState===null?aq:lq,f=v(w,C),Mf){E=0;do{if(Mf=!1,Qf=0,25<=E)throw Error(t(301));E+=1,ii=zr=null,p.updateQueue=null,Hh.current=cq,f=v(w,C)}while(Mf)}if(Hh.current=tp,p=zr!==null&&zr.next!==null,Hl=0,ii=zr=Pr=null,Kh=!1,p)throw Error(t(300));return f}function ny(){var f=Qf!==0;return Qf=0,f}function wo(){var f={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ii===null?Pr.memoizedState=ii=f:ii=ii.next=f,ii}function Cs(){if(zr===null){var f=Pr.alternate;f=f!==null?f.memoizedState:null}else f=zr.next;var p=ii===null?Pr.memoizedState:ii.next;if(p!==null)ii=p,zr=f;else{if(f===null)throw Error(t(310));zr=f,f={memoizedState:zr.memoizedState,baseState:zr.baseState,baseQueue:zr.baseQueue,queue:zr.queue,next:null},ii===null?Pr.memoizedState=ii=f:ii=ii.next=f}return ii}function Df(f,p){return typeof p=="function"?p(f):p}function ry(f){var p=Cs(),v=p.queue;if(v===null)throw Error(t(311));v.lastRenderedReducer=f;var w=zr,C=w.baseQueue,E=v.pending;if(E!==null){if(C!==null){var N=C.next;C.next=E.next,E.next=N}w.baseQueue=C=E,v.pending=null}if(C!==null){E=C.next,w=w.baseState;var ne=N=null,le=null,be=E;do{var Be=be.lane;if((Hl&Be)===Be)le!==null&&(le=le.next={lane:0,action:be.action,hasEagerState:be.hasEagerState,eagerState:be.eagerState,next:null}),w=be.hasEagerState?be.eagerState:f(w,be.action);else{var Ve={lane:Be,action:be.action,hasEagerState:be.hasEagerState,eagerState:be.eagerState,next:null};le===null?(ne=le=Ve,N=w):le=le.next=Ve,Pr.lanes|=Be,Kl|=Be}be=be.next}while(be!==null&&be!==E);le===null?N=w:le.next=ne,Ys(w,p.memoizedState)||(Xi=!0),p.memoizedState=w,p.baseState=N,p.baseQueue=le,v.lastRenderedState=w}if(f=v.interleaved,f!==null){C=f;do E=C.lane,Pr.lanes|=E,Kl|=E,C=C.next;while(C!==f)}else C===null&&(v.lanes=0);return[p.memoizedState,v.dispatch]}function iy(f){var p=Cs(),v=p.queue;if(v===null)throw Error(t(311));v.lastRenderedReducer=f;var w=v.dispatch,C=v.pending,E=p.memoizedState;if(C!==null){v.pending=null;var N=C=C.next;do E=f(E,N.action),N=N.next;while(N!==C);Ys(E,p.memoizedState)||(Xi=!0),p.memoizedState=E,p.baseQueue===null&&(p.baseState=E),v.lastRenderedState=E}return[E,w]}function ax(){}function lx(f,p){var v=Pr,w=Cs(),C=p(),E=!Ys(w.memoizedState,C);if(E&&(w.memoizedState=C,Xi=!0),w=w.queue,sy(fx.bind(null,v,w,f),[f]),w.getSnapshot!==p||E||ii!==null&&ii.memoizedState.tag&1){if(v.flags|=2048,If(9,ux.bind(null,v,w,C,p),void 0,null),si===null)throw Error(t(349));(Hl&30)!==0||cx(v,p,C)}return C}function cx(f,p,v){f.flags|=16384,f={getSnapshot:p,value:v},p=Pr.updateQueue,p===null?(p={lastEffect:null,stores:null},Pr.updateQueue=p,p.stores=[f]):(v=p.stores,v===null?p.stores=[f]:v.push(f))}function ux(f,p,v,w){p.value=v,p.getSnapshot=w,dx(p)&&hx(f)}function fx(f,p,v){return v(function(){dx(p)&&hx(f)})}function dx(f){var p=f.getSnapshot;f=f.value;try{var v=p();return!Ys(f,v)}catch{return!0}}function hx(f){var p=ua(f,1);p!==null&&eo(p,f,1,-1)}function px(f){var p=wo();return typeof f=="function"&&(f=f()),p.memoizedState=p.baseState=f,f={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Df,lastRenderedState:f},p.queue=f,f=f.dispatch=oq.bind(null,Pr,f),[p.memoizedState,f]}function If(f,p,v,w){return f={tag:f,create:p,destroy:v,deps:w,next:null},p=Pr.updateQueue,p===null?(p={lastEffect:null,stores:null},Pr.updateQueue=p,p.lastEffect=f.next=f):(v=p.lastEffect,v===null?p.lastEffect=f.next=f:(w=v.next,v.next=f,f.next=w,p.lastEffect=f)),f}function mx(){return Cs().memoizedState}function Jh(f,p,v,w){var C=wo();Pr.flags|=f,C.memoizedState=If(1|p,v,void 0,w===void 0?null:w)}function ep(f,p,v,w){var C=Cs();w=w===void 0?null:w;var E=void 0;if(zr!==null){var N=zr.memoizedState;if(E=N.destroy,w!==null&&ey(w,N.deps)){C.memoizedState=If(p,v,E,w);return}}Pr.flags|=f,C.memoizedState=If(1|p,v,E,w)}function gx(f,p){return Jh(8390656,8,f,p)}function sy(f,p){return ep(2048,8,f,p)}function Ox(f,p){return ep(4,2,f,p)}function vx(f,p){return ep(4,4,f,p)}function yx(f,p){if(typeof p=="function")return f=f(),p(f),function(){p(null)};if(p!=null)return f=f(),p.current=f,function(){p.current=null}}function bx(f,p,v){return v=v!=null?v.concat([f]):null,ep(4,4,yx.bind(null,p,f),v)}function oy(){}function Sx(f,p){var v=Cs();p=p===void 0?null:p;var w=v.memoizedState;return w!==null&&p!==null&&ey(p,w[1])?w[0]:(v.memoizedState=[f,p],f)}function wx(f,p){var v=Cs();p=p===void 0?null:p;var w=v.memoizedState;return w!==null&&p!==null&&ey(p,w[1])?w[0]:(f=f(),v.memoizedState=[f,p],f)}function kx(f,p,v){return(Hl&21)===0?(f.baseState&&(f.baseState=!1,Xi=!0),f.memoizedState=v):(Ys(v,p)||(v=Gn(),Pr.lanes|=v,Kl|=v,f.baseState=!0),p)}function iq(f,p){var v=jt;jt=v!==0&&4>v?v:4,f(!0);var w=Jv.transition;Jv.transition={};try{f(!1),p()}finally{jt=v,Jv.transition=w}}function Px(){return Cs().memoizedState}function sq(f,p,v){var w=Ya(f);if(v={lane:w,action:v,hasEagerState:!1,eagerState:null,next:null},xx(f))Tx(p,v);else if(v=nx(f,p,v,w),v!==null){var C=ji();eo(v,f,w,C),Cx(v,p,w)}}function oq(f,p,v){var w=Ya(f),C={lane:w,action:v,hasEagerState:!1,eagerState:null,next:null};if(xx(f))Tx(p,C);else{var E=f.alternate;if(f.lanes===0&&(E===null||E.lanes===0)&&(E=p.lastRenderedReducer,E!==null))try{var N=p.lastRenderedState,ne=E(N,v);if(C.hasEagerState=!0,C.eagerState=ne,Ys(ne,N)){var le=p.interleaved;le===null?(C.next=C,Xv(p)):(C.next=le.next,le.next=C),p.interleaved=C;return}}catch{}finally{}v=nx(f,p,C,w),v!==null&&(C=ji(),eo(v,f,w,C),Cx(v,p,w))}}function xx(f){var p=f.alternate;return f===Pr||p!==null&&p===Pr}function Tx(f,p){Mf=Kh=!0;var v=f.pending;v===null?p.next=p:(p.next=v.next,v.next=p),f.pending=p}function Cx(f,p,v){if((v&4194240)!==0){var w=p.lanes;w&=f.pendingLanes,v|=w,p.lanes=v,bn(f,v)}}var tp={readContext:Ts,useCallback:Pi,useContext:Pi,useEffect:Pi,useImperativeHandle:Pi,useInsertionEffect:Pi,useLayoutEffect:Pi,useMemo:Pi,useReducer:Pi,useRef:Pi,useState:Pi,useDebugValue:Pi,useDeferredValue:Pi,useTransition:Pi,useMutableSource:Pi,useSyncExternalStore:Pi,useId:Pi,unstable_isNewReconciler:!1},aq={readContext:Ts,useCallback:function(f,p){return wo().memoizedState=[f,p===void 0?null:p],f},useContext:Ts,useEffect:gx,useImperativeHandle:function(f,p,v){return v=v!=null?v.concat([f]):null,Jh(4194308,4,yx.bind(null,p,f),v)},useLayoutEffect:function(f,p){return Jh(4194308,4,f,p)},useInsertionEffect:function(f,p){return Jh(4,2,f,p)},useMemo:function(f,p){var v=wo();return p=p===void 0?null:p,f=f(),v.memoizedState=[f,p],f},useReducer:function(f,p,v){var w=wo();return p=v!==void 0?v(p):p,w.memoizedState=w.baseState=p,f={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:f,lastRenderedState:p},w.queue=f,f=f.dispatch=sq.bind(null,Pr,f),[w.memoizedState,f]},useRef:function(f){var p=wo();return f={current:f},p.memoizedState=f},useState:px,useDebugValue:oy,useDeferredValue:function(f){return wo().memoizedState=f},useTransition:function(){var f=px(!1),p=f[0];return f=iq.bind(null,f[1]),wo().memoizedState=f,[p,f]},useMutableSource:function(){},useSyncExternalStore:function(f,p,v){var w=Pr,C=wo();if(Or){if(v===void 0)throw Error(t(407));v=v()}else{if(v=p(),si===null)throw Error(t(349));(Hl&30)!==0||cx(w,p,v)}C.memoizedState=v;var E={value:v,getSnapshot:p};return C.queue=E,gx(fx.bind(null,w,E,f),[f]),w.flags|=2048,If(9,ux.bind(null,w,E,v,p),void 0,null),v},useId:function(){var f=wo(),p=si.identifierPrefix;if(Or){var v=ca,w=la;v=(w&~(1<<32-De(w)-1)).toString(32)+v,p=":"+p+"R"+v,v=Qf++,0<v&&(p+="H"+v.toString(32)),p+=":"}else v=rq++,p=":"+p+"r"+v.toString(32)+":";return f.memoizedState=p},unstable_isNewReconciler:!1},lq={readContext:Ts,useCallback:Sx,useContext:Ts,useEffect:sy,useImperativeHandle:bx,useInsertionEffect:Ox,useLayoutEffect:vx,useMemo:wx,useReducer:ry,useRef:mx,useState:function(){return ry(Df)},useDebugValue:oy,useDeferredValue:function(f){var p=Cs();return kx(p,zr.memoizedState,f)},useTransition:function(){var f=ry(Df)[0],p=Cs().memoizedState;return[f,p]},useMutableSource:ax,useSyncExternalStore:lx,useId:Px,unstable_isNewReconciler:!1},cq={readContext:Ts,useCallback:Sx,useContext:Ts,useEffect:sy,useImperativeHandle:bx,useInsertionEffect:Ox,useLayoutEffect:vx,useMemo:wx,useReducer:iy,useRef:mx,useState:function(){return iy(Df)},useDebugValue:oy,useDeferredValue:function(f){var p=Cs();return zr===null?p.memoizedState=f:kx(p,zr.memoizedState,f)},useTransition:function(){var f=iy(Df)[0],p=Cs().memoizedState;return[f,p]},useMutableSource:ax,useSyncExternalStore:lx,useId:Px,unstable_isNewReconciler:!1};function Hs(f,p){if(f&&f.defaultProps){p=re({},p),f=f.defaultProps;for(var v in f)p[v]===void 0&&(p[v]=f[v]);return p}return p}function ay(f,p,v,w){p=f.memoizedState,v=v(w,p),v=v==null?p:re({},p,v),f.memoizedState=v,f.lanes===0&&(f.updateQueue.baseState=v)}var np={isMounted:function(f){return(f=f._reactInternals)?Gt(f)===f:!1},enqueueSetState:function(f,p,v){f=f._reactInternals;var w=ji(),C=Ya(f),E=fa(w,C);E.payload=p,v!=null&&(E.callback=v),p=Za(f,E,C),p!==null&&(eo(p,f,C,w),zh(p,f,C))},enqueueReplaceState:function(f,p,v){f=f._reactInternals;var w=ji(),C=Ya(f),E=fa(w,C);E.tag=1,E.payload=p,v!=null&&(E.callback=v),p=Za(f,E,C),p!==null&&(eo(p,f,C,w),zh(p,f,C))},enqueueForceUpdate:function(f,p){f=f._reactInternals;var v=ji(),w=Ya(f),C=fa(v,w);C.tag=2,p!=null&&(C.callback=p),p=Za(f,C,w),p!==null&&(eo(p,f,w,v),zh(p,f,w))}};function _x(f,p,v,w,C,E,N){return f=f.stateNode,typeof f.shouldComponentUpdate=="function"?f.shouldComponentUpdate(w,E,N):p.prototype&&p.prototype.isPureReactComponent?!wf(v,w)||!wf(C,E):!0}function Ex(f,p,v){var w=!1,C=Ba,E=p.contextType;return typeof E=="object"&&E!==null?E=Ts(E):(C=Wi(p)?Wl:ki.current,w=p.contextTypes,E=(w=w!=null)?Vc(f,C):Ba),p=new p(v,E),f.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,p.updater=np,f.stateNode=p,p._reactInternals=f,w&&(f=f.stateNode,f.__reactInternalMemoizedUnmaskedChildContext=C,f.__reactInternalMemoizedMaskedChildContext=E),p}function Rx(f,p,v,w){f=p.state,typeof p.componentWillReceiveProps=="function"&&p.componentWillReceiveProps(v,w),typeof p.UNSAFE_componentWillReceiveProps=="function"&&p.UNSAFE_componentWillReceiveProps(v,w),p.state!==f&&np.enqueueReplaceState(p,p.state,null)}function ly(f,p,v,w){var C=f.stateNode;C.props=v,C.state=f.memoizedState,C.refs={},zv(f);var E=p.contextType;typeof E=="object"&&E!==null?C.context=Ts(E):(E=Wi(p)?Wl:ki.current,C.context=Vc(f,E)),C.state=f.memoizedState,E=p.getDerivedStateFromProps,typeof E=="function"&&(ay(f,p,E,v),C.state=f.memoizedState),typeof p.getDerivedStateFromProps=="function"||typeof C.getSnapshotBeforeUpdate=="function"||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(p=C.state,typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount(),p!==C.state&&np.enqueueReplaceState(C,C.state,null),Yh(f,v,C,w),C.state=f.memoizedState),typeof C.componentDidMount=="function"&&(f.flags|=4194308)}function Kc(f,p){try{var v="",w=p;do v+=pe(w),w=w.return;while(w);var C=v}catch(E){C=`
|
|
39
|
+
Error generating stack: `+E.message+`
|
|
40
|
+
`+E.stack}return{value:f,source:p,stack:C,digest:null}}function cy(f,p,v){return{value:f,source:null,stack:v??null,digest:p??null}}function uy(f,p){try{console.error(p.value)}catch(v){setTimeout(function(){throw v})}}var uq=typeof WeakMap=="function"?WeakMap:Map;function Ax(f,p,v){v=fa(-1,v),v.tag=3,v.payload={element:null};var w=p.value;return v.callback=function(){cp||(cp=!0,xy=w),uy(f,p)},v}function $x(f,p,v){v=fa(-1,v),v.tag=3;var w=f.type.getDerivedStateFromError;if(typeof w=="function"){var C=p.value;v.payload=function(){return w(C)},v.callback=function(){uy(f,p)}}var E=f.stateNode;return E!==null&&typeof E.componentDidCatch=="function"&&(v.callback=function(){uy(f,p),typeof w!="function"&&(Xa===null?Xa=new Set([this]):Xa.add(this));var N=p.stack;this.componentDidCatch(p.value,{componentStack:N!==null?N:""})}),v}function Mx(f,p,v){var w=f.pingCache;if(w===null){w=f.pingCache=new uq;var C=new Set;w.set(p,C)}else C=w.get(p),C===void 0&&(C=new Set,w.set(p,C));C.has(v)||(C.add(v),f=Pq.bind(null,f,p,v),p.then(f,f))}function Qx(f){do{var p;if((p=f.tag===13)&&(p=f.memoizedState,p=p!==null?p.dehydrated!==null:!0),p)return f;f=f.return}while(f!==null);return null}function Dx(f,p,v,w,C){return(f.mode&1)===0?(f===p?f.flags|=65536:(f.flags|=128,v.flags|=131072,v.flags&=-52805,v.tag===1&&(v.alternate===null?v.tag=17:(p=fa(-1,1),p.tag=2,Za(v,p,1))),v.lanes|=1),f):(f.flags|=65536,f.lanes=C,f)}var fq=k.ReactCurrentOwner,Xi=!1;function Ii(f,p,v,w){p.child=f===null?tx(p,null,v,w):zc(p,f.child,v,w)}function Ix(f,p,v,w,C){v=v.render;var E=p.ref;return Gc(p,C),w=ty(f,p,v,w,E,C),v=ny(),f!==null&&!Xi?(p.updateQueue=f.updateQueue,p.flags&=-2053,f.lanes&=~C,da(f,p,C)):(Or&&v&&Nv(p),p.flags|=1,Ii(f,p,w,C),p.child)}function jx(f,p,v,w,C){if(f===null){var E=v.type;return typeof E=="function"&&!$y(E)&&E.defaultProps===void 0&&v.compare===null&&v.defaultProps===void 0?(p.tag=15,p.type=E,Nx(f,p,E,w,C)):(f=mp(v.type,null,w,p,p.mode,C),f.ref=p.ref,f.return=p,p.child=f)}if(E=f.child,(f.lanes&C)===0){var N=E.memoizedProps;if(v=v.compare,v=v!==null?v:wf,v(N,w)&&f.ref===p.ref)return da(f,p,C)}return p.flags|=1,f=Ha(E,w),f.ref=p.ref,f.return=p,p.child=f}function Nx(f,p,v,w,C){if(f!==null){var E=f.memoizedProps;if(wf(E,w)&&f.ref===p.ref)if(Xi=!1,p.pendingProps=w=E,(f.lanes&C)!==0)(f.flags&131072)!==0&&(Xi=!0);else return p.lanes=f.lanes,da(f,p,C)}return fy(f,p,v,w,C)}function Lx(f,p,v){var w=p.pendingProps,C=w.children,E=f!==null?f.memoizedState:null;if(w.mode==="hidden")if((p.mode&1)===0)p.memoizedState={baseLanes:0,cachePool:null,transitions:null},ir(eu,fs),fs|=v;else{if((v&1073741824)===0)return f=E!==null?E.baseLanes|v:v,p.lanes=p.childLanes=1073741824,p.memoizedState={baseLanes:f,cachePool:null,transitions:null},p.updateQueue=null,ir(eu,fs),fs|=f,null;p.memoizedState={baseLanes:0,cachePool:null,transitions:null},w=E!==null?E.baseLanes:v,ir(eu,fs),fs|=w}else E!==null?(w=E.baseLanes|v,p.memoizedState=null):w=v,ir(eu,fs),fs|=w;return Ii(f,p,C,v),p.child}function qx(f,p){var v=p.ref;(f===null&&v!==null||f!==null&&f.ref!==v)&&(p.flags|=512,p.flags|=2097152)}function fy(f,p,v,w,C){var E=Wi(v)?Wl:ki.current;return E=Vc(p,E),Gc(p,C),v=ty(f,p,v,w,E,C),w=ny(),f!==null&&!Xi?(p.updateQueue=f.updateQueue,p.flags&=-2053,f.lanes&=~C,da(f,p,C)):(Or&&w&&Nv(p),p.flags|=1,Ii(f,p,v,C),p.child)}function Ux(f,p,v,w,C){if(Wi(v)){var E=!0;qh(p)}else E=!1;if(Gc(p,C),p.stateNode===null)ip(f,p),Ex(p,v,w),ly(p,v,w,C),w=!0;else if(f===null){var N=p.stateNode,ne=p.memoizedProps;N.props=ne;var le=N.context,be=v.contextType;typeof be=="object"&&be!==null?be=Ts(be):(be=Wi(v)?Wl:ki.current,be=Vc(p,be));var Be=v.getDerivedStateFromProps,Ve=typeof Be=="function"||typeof N.getSnapshotBeforeUpdate=="function";Ve||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(ne!==w||le!==be)&&Rx(p,N,w,be),Va=!1;var Ue=p.memoizedState;N.state=Ue,Yh(p,w,N,C),le=p.memoizedState,ne!==w||Ue!==le||Zi.current||Va?(typeof Be=="function"&&(ay(p,v,Be,w),le=p.memoizedState),(ne=Va||_x(p,v,ne,w,Ue,le,be))?(Ve||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount()),typeof N.componentDidMount=="function"&&(p.flags|=4194308)):(typeof N.componentDidMount=="function"&&(p.flags|=4194308),p.memoizedProps=w,p.memoizedState=le),N.props=w,N.state=le,N.context=be,w=ne):(typeof N.componentDidMount=="function"&&(p.flags|=4194308),w=!1)}else{N=p.stateNode,rx(f,p),ne=p.memoizedProps,be=p.type===p.elementType?ne:Hs(p.type,ne),N.props=be,Ve=p.pendingProps,Ue=N.context,le=v.contextType,typeof le=="object"&&le!==null?le=Ts(le):(le=Wi(v)?Wl:ki.current,le=Vc(p,le));var Ot=v.getDerivedStateFromProps;(Be=typeof Ot=="function"||typeof N.getSnapshotBeforeUpdate=="function")||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(ne!==Ve||Ue!==le)&&Rx(p,N,w,le),Va=!1,Ue=p.memoizedState,N.state=Ue,Yh(p,w,N,C);var xt=p.memoizedState;ne!==Ve||Ue!==xt||Zi.current||Va?(typeof Ot=="function"&&(ay(p,v,Ot,w),xt=p.memoizedState),(be=Va||_x(p,v,be,w,Ue,xt,le)||!1)?(Be||typeof N.UNSAFE_componentWillUpdate!="function"&&typeof N.componentWillUpdate!="function"||(typeof N.componentWillUpdate=="function"&&N.componentWillUpdate(w,xt,le),typeof N.UNSAFE_componentWillUpdate=="function"&&N.UNSAFE_componentWillUpdate(w,xt,le)),typeof N.componentDidUpdate=="function"&&(p.flags|=4),typeof N.getSnapshotBeforeUpdate=="function"&&(p.flags|=1024)):(typeof N.componentDidUpdate!="function"||ne===f.memoizedProps&&Ue===f.memoizedState||(p.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||ne===f.memoizedProps&&Ue===f.memoizedState||(p.flags|=1024),p.memoizedProps=w,p.memoizedState=xt),N.props=w,N.state=xt,N.context=le,w=be):(typeof N.componentDidUpdate!="function"||ne===f.memoizedProps&&Ue===f.memoizedState||(p.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||ne===f.memoizedProps&&Ue===f.memoizedState||(p.flags|=1024),w=!1)}return dy(f,p,v,w,E,C)}function dy(f,p,v,w,C,E){qx(f,p);var N=(p.flags&128)!==0;if(!w&&!N)return C&&WP(p,v,!1),da(f,p,E);w=p.stateNode,fq.current=p;var ne=N&&typeof v.getDerivedStateFromError!="function"?null:w.render();return p.flags|=1,f!==null&&N?(p.child=zc(p,f.child,null,E),p.child=zc(p,null,ne,E)):Ii(f,p,ne,E),p.memoizedState=w.state,C&&WP(p,v,!0),p.child}function Bx(f){var p=f.stateNode;p.pendingContext?VP(f,p.pendingContext,p.pendingContext!==p.context):p.context&&VP(f,p.context,!1),Yv(f,p.containerInfo)}function Fx(f,p,v,w,C){return Xc(),Bv(C),p.flags|=256,Ii(f,p,v,w),p.child}var hy={dehydrated:null,treeContext:null,retryLane:0};function py(f){return{baseLanes:f,cachePool:null,transitions:null}}function Vx(f,p,v){var w=p.pendingProps,C=kr.current,E=!1,N=(p.flags&128)!==0,ne;if((ne=N)||(ne=f!==null&&f.memoizedState===null?!1:(C&2)!==0),ne?(E=!0,p.flags&=-129):(f===null||f.memoizedState!==null)&&(C|=1),ir(kr,C&1),f===null)return Uv(p),f=p.memoizedState,f!==null&&(f=f.dehydrated,f!==null)?((p.mode&1)===0?p.lanes=1:f.data==="$!"?p.lanes=8:p.lanes=1073741824,null):(N=w.children,f=w.fallback,E?(w=p.mode,E=p.child,N={mode:"hidden",children:N},(w&1)===0&&E!==null?(E.childLanes=0,E.pendingProps=N):E=gp(N,w,0,null),f=nc(f,w,v,null),E.return=p,f.return=p,E.sibling=f,p.child=E,p.child.memoizedState=py(v),p.memoizedState=hy,f):my(p,N));if(C=f.memoizedState,C!==null&&(ne=C.dehydrated,ne!==null))return dq(f,p,N,w,ne,C,v);if(E){E=w.fallback,N=p.mode,C=f.child,ne=C.sibling;var le={mode:"hidden",children:w.children};return(N&1)===0&&p.child!==C?(w=p.child,w.childLanes=0,w.pendingProps=le,p.deletions=null):(w=Ha(C,le),w.subtreeFlags=C.subtreeFlags&14680064),ne!==null?E=Ha(ne,E):(E=nc(E,N,v,null),E.flags|=2),E.return=p,w.return=p,w.sibling=E,p.child=w,w=E,E=p.child,N=f.child.memoizedState,N=N===null?py(v):{baseLanes:N.baseLanes|v,cachePool:null,transitions:N.transitions},E.memoizedState=N,E.childLanes=f.childLanes&~v,p.memoizedState=hy,w}return E=f.child,f=E.sibling,w=Ha(E,{mode:"visible",children:w.children}),(p.mode&1)===0&&(w.lanes=v),w.return=p,w.sibling=null,f!==null&&(v=p.deletions,v===null?(p.deletions=[f],p.flags|=16):v.push(f)),p.child=w,p.memoizedState=null,w}function my(f,p){return p=gp({mode:"visible",children:p},f.mode,0,null),p.return=f,f.child=p}function rp(f,p,v,w){return w!==null&&Bv(w),zc(p,f.child,null,v),f=my(p,p.pendingProps.children),f.flags|=2,p.memoizedState=null,f}function dq(f,p,v,w,C,E,N){if(v)return p.flags&256?(p.flags&=-257,w=cy(Error(t(422))),rp(f,p,N,w)):p.memoizedState!==null?(p.child=f.child,p.flags|=128,null):(E=w.fallback,C=p.mode,w=gp({mode:"visible",children:w.children},C,0,null),E=nc(E,C,N,null),E.flags|=2,w.return=p,E.return=p,w.sibling=E,p.child=w,(p.mode&1)!==0&&zc(p,f.child,null,N),p.child.memoizedState=py(N),p.memoizedState=hy,E);if((p.mode&1)===0)return rp(f,p,N,null);if(C.data==="$!"){if(w=C.nextSibling&&C.nextSibling.dataset,w)var ne=w.dgst;return w=ne,E=Error(t(419)),w=cy(E,w,void 0),rp(f,p,N,w)}if(ne=(N&f.childLanes)!==0,Xi||ne){if(w=si,w!==null){switch(N&-N){case 4:C=2;break;case 16:C=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:C=32;break;case 536870912:C=268435456;break;default:C=0}C=(C&(w.suspendedLanes|N))!==0?0:C,C!==0&&C!==E.retryLane&&(E.retryLane=C,ua(f,C),eo(w,f,C,-1))}return Ay(),w=cy(Error(t(421))),rp(f,p,N,w)}return C.data==="$?"?(p.flags|=128,p.child=f.child,p=xq.bind(null,f),C._reactRetry=p,null):(f=E.treeContext,us=qa(C.nextSibling),cs=p,Or=!0,Gs=null,f!==null&&(Ps[xs++]=la,Ps[xs++]=ca,Ps[xs++]=Xl,la=f.id,ca=f.overflow,Xl=p),p=my(p,w.children),p.flags|=4096,p)}function Zx(f,p,v){f.lanes|=p;var w=f.alternate;w!==null&&(w.lanes|=p),Wv(f.return,p,v)}function gy(f,p,v,w,C){var E=f.memoizedState;E===null?f.memoizedState={isBackwards:p,rendering:null,renderingStartTime:0,last:w,tail:v,tailMode:C}:(E.isBackwards=p,E.rendering=null,E.renderingStartTime=0,E.last=w,E.tail=v,E.tailMode=C)}function Wx(f,p,v){var w=p.pendingProps,C=w.revealOrder,E=w.tail;if(Ii(f,p,w.children,v),w=kr.current,(w&2)!==0)w=w&1|2,p.flags|=128;else{if(f!==null&&(f.flags&128)!==0)e:for(f=p.child;f!==null;){if(f.tag===13)f.memoizedState!==null&&Zx(f,v,p);else if(f.tag===19)Zx(f,v,p);else if(f.child!==null){f.child.return=f,f=f.child;continue}if(f===p)break e;for(;f.sibling===null;){if(f.return===null||f.return===p)break e;f=f.return}f.sibling.return=f.return,f=f.sibling}w&=1}if(ir(kr,w),(p.mode&1)===0)p.memoizedState=null;else switch(C){case"forwards":for(v=p.child,C=null;v!==null;)f=v.alternate,f!==null&&Gh(f)===null&&(C=v),v=v.sibling;v=C,v===null?(C=p.child,p.child=null):(C=v.sibling,v.sibling=null),gy(p,!1,C,v,E);break;case"backwards":for(v=null,C=p.child,p.child=null;C!==null;){if(f=C.alternate,f!==null&&Gh(f)===null){p.child=C;break}f=C.sibling,C.sibling=v,v=C,C=f}gy(p,!0,v,null,E);break;case"together":gy(p,!1,null,null,void 0);break;default:p.memoizedState=null}return p.child}function ip(f,p){(p.mode&1)===0&&f!==null&&(f.alternate=null,p.alternate=null,p.flags|=2)}function da(f,p,v){if(f!==null&&(p.dependencies=f.dependencies),Kl|=p.lanes,(v&p.childLanes)===0)return null;if(f!==null&&p.child!==f.child)throw Error(t(153));if(p.child!==null){for(f=p.child,v=Ha(f,f.pendingProps),p.child=v,v.return=p;f.sibling!==null;)f=f.sibling,v=v.sibling=Ha(f,f.pendingProps),v.return=p;v.sibling=null}return p.child}function hq(f,p,v){switch(p.tag){case 3:Bx(p),Xc();break;case 5:ox(p);break;case 1:Wi(p.type)&&qh(p);break;case 4:Yv(p,p.stateNode.containerInfo);break;case 10:var w=p.type._context,C=p.memoizedProps.value;ir(Wh,w._currentValue),w._currentValue=C;break;case 13:if(w=p.memoizedState,w!==null)return w.dehydrated!==null?(ir(kr,kr.current&1),p.flags|=128,null):(v&p.child.childLanes)!==0?Vx(f,p,v):(ir(kr,kr.current&1),f=da(f,p,v),f!==null?f.sibling:null);ir(kr,kr.current&1);break;case 19:if(w=(v&p.childLanes)!==0,(f.flags&128)!==0){if(w)return Wx(f,p,v);p.flags|=128}if(C=p.memoizedState,C!==null&&(C.rendering=null,C.tail=null,C.lastEffect=null),ir(kr,kr.current),w)break;return null;case 22:case 23:return p.lanes=0,Lx(f,p,v)}return da(f,p,v)}var Xx,Oy,zx,Yx;Xx=function(f,p){for(var v=p.child;v!==null;){if(v.tag===5||v.tag===6)f.appendChild(v.stateNode);else if(v.tag!==4&&v.child!==null){v.child.return=v,v=v.child;continue}if(v===p)break;for(;v.sibling===null;){if(v.return===null||v.return===p)return;v=v.return}v.sibling.return=v.return,v=v.sibling}},Oy=function(){},zx=function(f,p,v,w){var C=f.memoizedProps;if(C!==w){f=p.stateNode,Gl(So.current);var E=null;switch(v){case"input":C=Re(f,C),w=Re(f,w),E=[];break;case"select":C=re({},C,{value:void 0}),w=re({},w,{value:void 0}),E=[];break;case"textarea":C=Dn(f,C),w=Dn(f,w),E=[];break;default:typeof C.onClick!="function"&&typeof w.onClick=="function"&&(f.onclick=jh)}dt(v,w);var N;v=null;for(be in C)if(!w.hasOwnProperty(be)&&C.hasOwnProperty(be)&&C[be]!=null)if(be==="style"){var ne=C[be];for(N in ne)ne.hasOwnProperty(N)&&(v||(v={}),v[N]="")}else be!=="dangerouslySetInnerHTML"&&be!=="children"&&be!=="suppressContentEditableWarning"&&be!=="suppressHydrationWarning"&&be!=="autoFocus"&&(i.hasOwnProperty(be)?E||(E=[]):(E=E||[]).push(be,null));for(be in w){var le=w[be];if(ne=C!=null?C[be]:void 0,w.hasOwnProperty(be)&&le!==ne&&(le!=null||ne!=null))if(be==="style")if(ne){for(N in ne)!ne.hasOwnProperty(N)||le&&le.hasOwnProperty(N)||(v||(v={}),v[N]="");for(N in le)le.hasOwnProperty(N)&&ne[N]!==le[N]&&(v||(v={}),v[N]=le[N])}else v||(E||(E=[]),E.push(be,v)),v=le;else be==="dangerouslySetInnerHTML"?(le=le?le.__html:void 0,ne=ne?ne.__html:void 0,le!=null&&ne!==le&&(E=E||[]).push(be,le)):be==="children"?typeof le!="string"&&typeof le!="number"||(E=E||[]).push(be,""+le):be!=="suppressContentEditableWarning"&&be!=="suppressHydrationWarning"&&(i.hasOwnProperty(be)?(le!=null&&be==="onScroll"&&cr("scroll",f),E||ne===le||(E=[])):(E=E||[]).push(be,le))}v&&(E=E||[]).push("style",v);var be=E;(p.updateQueue=be)&&(p.flags|=4)}},Yx=function(f,p,v,w){v!==w&&(p.flags|=4)};function jf(f,p){if(!Or)switch(f.tailMode){case"hidden":p=f.tail;for(var v=null;p!==null;)p.alternate!==null&&(v=p),p=p.sibling;v===null?f.tail=null:v.sibling=null;break;case"collapsed":v=f.tail;for(var w=null;v!==null;)v.alternate!==null&&(w=v),v=v.sibling;w===null?p||f.tail===null?f.tail=null:f.tail.sibling=null:w.sibling=null}}function xi(f){var p=f.alternate!==null&&f.alternate.child===f.child,v=0,w=0;if(p)for(var C=f.child;C!==null;)v|=C.lanes|C.childLanes,w|=C.subtreeFlags&14680064,w|=C.flags&14680064,C.return=f,C=C.sibling;else for(C=f.child;C!==null;)v|=C.lanes|C.childLanes,w|=C.subtreeFlags,w|=C.flags,C.return=f,C=C.sibling;return f.subtreeFlags|=w,f.childLanes=v,p}function pq(f,p,v){var w=p.pendingProps;switch(Lv(p),p.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return xi(p),null;case 1:return Wi(p.type)&&Lh(),xi(p),null;case 3:return w=p.stateNode,Hc(),ur(Zi),ur(ki),Kv(),w.pendingContext&&(w.context=w.pendingContext,w.pendingContext=null),(f===null||f.child===null)&&(Vh(p)?p.flags|=4:f===null||f.memoizedState.isDehydrated&&(p.flags&256)===0||(p.flags|=1024,Gs!==null&&(_y(Gs),Gs=null))),Oy(f,p),xi(p),null;case 5:Gv(p);var C=Gl($f.current);if(v=p.type,f!==null&&p.stateNode!=null)zx(f,p,v,w,C),f.ref!==p.ref&&(p.flags|=512,p.flags|=2097152);else{if(!w){if(p.stateNode===null)throw Error(t(166));return xi(p),null}if(f=Gl(So.current),Vh(p)){w=p.stateNode,v=p.type;var E=p.memoizedProps;switch(w[bo]=p,w[Cf]=E,f=(p.mode&1)!==0,v){case"dialog":cr("cancel",w),cr("close",w);break;case"iframe":case"object":case"embed":cr("load",w);break;case"video":case"audio":for(C=0;C<Pf.length;C++)cr(Pf[C],w);break;case"source":cr("error",w);break;case"img":case"image":case"link":cr("error",w),cr("load",w);break;case"details":cr("toggle",w);break;case"input":Ge(w,E),cr("invalid",w);break;case"select":w._wrapperState={wasMultiple:!!E.multiple},cr("invalid",w);break;case"textarea":I(w,E),cr("invalid",w)}dt(v,E),C=null;for(var N in E)if(E.hasOwnProperty(N)){var ne=E[N];N==="children"?typeof ne=="string"?w.textContent!==ne&&(E.suppressHydrationWarning!==!0&&Ih(w.textContent,ne,f),C=["children",ne]):typeof ne=="number"&&w.textContent!==""+ne&&(E.suppressHydrationWarning!==!0&&Ih(w.textContent,ne,f),C=["children",""+ne]):i.hasOwnProperty(N)&&ne!=null&&N==="onScroll"&&cr("scroll",w)}switch(v){case"input":ke(w),Ln(w,E,!0);break;case"textarea":ke(w),je(w);break;case"select":case"option":break;default:typeof E.onClick=="function"&&(w.onclick=jh)}w=C,p.updateQueue=w,w!==null&&(p.flags|=4)}else{N=C.nodeType===9?C:C.ownerDocument,f==="http://www.w3.org/1999/xhtml"&&(f=ze(v)),f==="http://www.w3.org/1999/xhtml"?v==="script"?(f=N.createElement("div"),f.innerHTML="<script><\/script>",f=f.removeChild(f.firstChild)):typeof w.is=="string"?f=N.createElement(v,{is:w.is}):(f=N.createElement(v),v==="select"&&(N=f,w.multiple?N.multiple=!0:w.size&&(N.size=w.size))):f=N.createElementNS(f,v),f[bo]=p,f[Cf]=w,Xx(f,p,!1,!1),p.stateNode=f;e:{switch(N=Dt(v,w),v){case"dialog":cr("cancel",f),cr("close",f),C=w;break;case"iframe":case"object":case"embed":cr("load",f),C=w;break;case"video":case"audio":for(C=0;C<Pf.length;C++)cr(Pf[C],f);C=w;break;case"source":cr("error",f),C=w;break;case"img":case"image":case"link":cr("error",f),cr("load",f),C=w;break;case"details":cr("toggle",f),C=w;break;case"input":Ge(f,w),C=Re(f,w),cr("invalid",f);break;case"option":C=w;break;case"select":f._wrapperState={wasMultiple:!!w.multiple},C=re({},w,{value:void 0}),cr("invalid",f);break;case"textarea":I(f,w),C=Dn(f,w),cr("invalid",f);break;default:C=w}dt(v,C),ne=C;for(E in ne)if(ne.hasOwnProperty(E)){var le=ne[E];E==="style"?Xe(f,le):E==="dangerouslySetInnerHTML"?(le=le?le.__html:void 0,le!=null&&_t(f,le)):E==="children"?typeof le=="string"?(v!=="textarea"||le!=="")&&kt(f,le):typeof le=="number"&&kt(f,""+le):E!=="suppressContentEditableWarning"&&E!=="suppressHydrationWarning"&&E!=="autoFocus"&&(i.hasOwnProperty(E)?le!=null&&E==="onScroll"&&cr("scroll",f):le!=null&&P(f,E,le,N))}switch(v){case"input":ke(f),Ln(f,w,!1);break;case"textarea":ke(f),je(f);break;case"option":w.value!=null&&f.setAttribute("value",""+V(w.value));break;case"select":f.multiple=!!w.multiple,E=w.value,E!=null?Qn(f,!!w.multiple,E,!1):w.defaultValue!=null&&Qn(f,!!w.multiple,w.defaultValue,!0);break;default:typeof C.onClick=="function"&&(f.onclick=jh)}switch(v){case"button":case"input":case"select":case"textarea":w=!!w.autoFocus;break e;case"img":w=!0;break e;default:w=!1}}w&&(p.flags|=4)}p.ref!==null&&(p.flags|=512,p.flags|=2097152)}return xi(p),null;case 6:if(f&&p.stateNode!=null)Yx(f,p,f.memoizedProps,w);else{if(typeof w!="string"&&p.stateNode===null)throw Error(t(166));if(v=Gl($f.current),Gl(So.current),Vh(p)){if(w=p.stateNode,v=p.memoizedProps,w[bo]=p,(E=w.nodeValue!==v)&&(f=cs,f!==null))switch(f.tag){case 3:Ih(w.nodeValue,v,(f.mode&1)!==0);break;case 5:f.memoizedProps.suppressHydrationWarning!==!0&&Ih(w.nodeValue,v,(f.mode&1)!==0)}E&&(p.flags|=4)}else w=(v.nodeType===9?v:v.ownerDocument).createTextNode(w),w[bo]=p,p.stateNode=w}return xi(p),null;case 13:if(ur(kr),w=p.memoizedState,f===null||f.memoizedState!==null&&f.memoizedState.dehydrated!==null){if(Or&&us!==null&&(p.mode&1)!==0&&(p.flags&128)===0)KP(),Xc(),p.flags|=98560,E=!1;else if(E=Vh(p),w!==null&&w.dehydrated!==null){if(f===null){if(!E)throw Error(t(318));if(E=p.memoizedState,E=E!==null?E.dehydrated:null,!E)throw Error(t(317));E[bo]=p}else Xc(),(p.flags&128)===0&&(p.memoizedState=null),p.flags|=4;xi(p),E=!1}else Gs!==null&&(_y(Gs),Gs=null),E=!0;if(!E)return p.flags&65536?p:null}return(p.flags&128)!==0?(p.lanes=v,p):(w=w!==null,w!==(f!==null&&f.memoizedState!==null)&&w&&(p.child.flags|=8192,(p.mode&1)!==0&&(f===null||(kr.current&1)!==0?Yr===0&&(Yr=3):Ay())),p.updateQueue!==null&&(p.flags|=4),xi(p),null);case 4:return Hc(),Oy(f,p),f===null&&xf(p.stateNode.containerInfo),xi(p),null;case 10:return Zv(p.type._context),xi(p),null;case 17:return Wi(p.type)&&Lh(),xi(p),null;case 19:if(ur(kr),E=p.memoizedState,E===null)return xi(p),null;if(w=(p.flags&128)!==0,N=E.rendering,N===null)if(w)jf(E,!1);else{if(Yr!==0||f!==null&&(f.flags&128)!==0)for(f=p.child;f!==null;){if(N=Gh(f),N!==null){for(p.flags|=128,jf(E,!1),w=N.updateQueue,w!==null&&(p.updateQueue=w,p.flags|=4),p.subtreeFlags=0,w=v,v=p.child;v!==null;)E=v,f=w,E.flags&=14680066,N=E.alternate,N===null?(E.childLanes=0,E.lanes=f,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,f=N.dependencies,E.dependencies=f===null?null:{lanes:f.lanes,firstContext:f.firstContext}),v=v.sibling;return ir(kr,kr.current&1|2),p.child}f=f.sibling}E.tail!==null&&vn()>tu&&(p.flags|=128,w=!0,jf(E,!1),p.lanes=4194304)}else{if(!w)if(f=Gh(N),f!==null){if(p.flags|=128,w=!0,v=f.updateQueue,v!==null&&(p.updateQueue=v,p.flags|=4),jf(E,!0),E.tail===null&&E.tailMode==="hidden"&&!N.alternate&&!Or)return xi(p),null}else 2*vn()-E.renderingStartTime>tu&&v!==1073741824&&(p.flags|=128,w=!0,jf(E,!1),p.lanes=4194304);E.isBackwards?(N.sibling=p.child,p.child=N):(v=E.last,v!==null?v.sibling=N:p.child=N,E.last=N)}return E.tail!==null?(p=E.tail,E.rendering=p,E.tail=p.sibling,E.renderingStartTime=vn(),p.sibling=null,v=kr.current,ir(kr,w?v&1|2:v&1),p):(xi(p),null);case 22:case 23:return Ry(),w=p.memoizedState!==null,f!==null&&f.memoizedState!==null!==w&&(p.flags|=8192),w&&(p.mode&1)!==0?(fs&1073741824)!==0&&(xi(p),p.subtreeFlags&6&&(p.flags|=8192)):xi(p),null;case 24:return null;case 25:return null}throw Error(t(156,p.tag))}function mq(f,p){switch(Lv(p),p.tag){case 1:return Wi(p.type)&&Lh(),f=p.flags,f&65536?(p.flags=f&-65537|128,p):null;case 3:return Hc(),ur(Zi),ur(ki),Kv(),f=p.flags,(f&65536)!==0&&(f&128)===0?(p.flags=f&-65537|128,p):null;case 5:return Gv(p),null;case 13:if(ur(kr),f=p.memoizedState,f!==null&&f.dehydrated!==null){if(p.alternate===null)throw Error(t(340));Xc()}return f=p.flags,f&65536?(p.flags=f&-65537|128,p):null;case 19:return ur(kr),null;case 4:return Hc(),null;case 10:return Zv(p.type._context),null;case 22:case 23:return Ry(),null;case 24:return null;default:return null}}var sp=!1,Ti=!1,gq=typeof WeakSet=="function"?WeakSet:Set,wt=null;function Jc(f,p){var v=f.ref;if(v!==null)if(typeof v=="function")try{v(null)}catch(w){Er(f,p,w)}else v.current=null}function vy(f,p,v){try{v()}catch(w){Er(f,p,w)}}var Gx=!1;function Oq(f,p){if(Rv=ea,f=_P(),wv(f)){if("selectionStart"in f)var v={start:f.selectionStart,end:f.selectionEnd};else e:{v=(v=f.ownerDocument)&&v.defaultView||window;var w=v.getSelection&&v.getSelection();if(w&&w.rangeCount!==0){v=w.anchorNode;var C=w.anchorOffset,E=w.focusNode;w=w.focusOffset;try{v.nodeType,E.nodeType}catch{v=null;break e}var N=0,ne=-1,le=-1,be=0,Be=0,Ve=f,Ue=null;t:for(;;){for(var Ot;Ve!==v||C!==0&&Ve.nodeType!==3||(ne=N+C),Ve!==E||w!==0&&Ve.nodeType!==3||(le=N+w),Ve.nodeType===3&&(N+=Ve.nodeValue.length),(Ot=Ve.firstChild)!==null;)Ue=Ve,Ve=Ot;for(;;){if(Ve===f)break t;if(Ue===v&&++be===C&&(ne=N),Ue===E&&++Be===w&&(le=N),(Ot=Ve.nextSibling)!==null)break;Ve=Ue,Ue=Ve.parentNode}Ve=Ot}v=ne===-1||le===-1?null:{start:ne,end:le}}else v=null}v=v||{start:0,end:0}}else v=null;for(Av={focusedElem:f,selectionRange:v},ea=!1,wt=p;wt!==null;)if(p=wt,f=p.child,(p.subtreeFlags&1028)!==0&&f!==null)f.return=p,wt=f;else for(;wt!==null;){p=wt;try{var xt=p.alternate;if((p.flags&1024)!==0)switch(p.tag){case 0:case 11:case 15:break;case 1:if(xt!==null){var Rt=xt.memoizedProps,Ir=xt.memoizedState,me=p.stateNode,fe=me.getSnapshotBeforeUpdate(p.elementType===p.type?Rt:Hs(p.type,Rt),Ir);me.__reactInternalSnapshotBeforeUpdate=fe}break;case 3:var Oe=p.stateNode.containerInfo;Oe.nodeType===1?Oe.textContent="":Oe.nodeType===9&&Oe.documentElement&&Oe.removeChild(Oe.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(t(163))}}catch(He){Er(p,p.return,He)}if(f=p.sibling,f!==null){f.return=p.return,wt=f;break}wt=p.return}return xt=Gx,Gx=!1,xt}function Nf(f,p,v){var w=p.updateQueue;if(w=w!==null?w.lastEffect:null,w!==null){var C=w=w.next;do{if((C.tag&f)===f){var E=C.destroy;C.destroy=void 0,E!==void 0&&vy(p,v,E)}C=C.next}while(C!==w)}}function op(f,p){if(p=p.updateQueue,p=p!==null?p.lastEffect:null,p!==null){var v=p=p.next;do{if((v.tag&f)===f){var w=v.create;v.destroy=w()}v=v.next}while(v!==p)}}function yy(f){var p=f.ref;if(p!==null){var v=f.stateNode;switch(f.tag){case 5:f=v;break;default:f=v}typeof p=="function"?p(f):p.current=f}}function Hx(f){var p=f.alternate;p!==null&&(f.alternate=null,Hx(p)),f.child=null,f.deletions=null,f.sibling=null,f.tag===5&&(p=f.stateNode,p!==null&&(delete p[bo],delete p[Cf],delete p[Dv],delete p[J3],delete p[eq])),f.stateNode=null,f.return=null,f.dependencies=null,f.memoizedProps=null,f.memoizedState=null,f.pendingProps=null,f.stateNode=null,f.updateQueue=null}function Kx(f){return f.tag===5||f.tag===3||f.tag===4}function Jx(f){e:for(;;){for(;f.sibling===null;){if(f.return===null||Kx(f.return))return null;f=f.return}for(f.sibling.return=f.return,f=f.sibling;f.tag!==5&&f.tag!==6&&f.tag!==18;){if(f.flags&2||f.child===null||f.tag===4)continue e;f.child.return=f,f=f.child}if(!(f.flags&2))return f.stateNode}}function by(f,p,v){var w=f.tag;if(w===5||w===6)f=f.stateNode,p?v.nodeType===8?v.parentNode.insertBefore(f,p):v.insertBefore(f,p):(v.nodeType===8?(p=v.parentNode,p.insertBefore(f,v)):(p=v,p.appendChild(f)),v=v._reactRootContainer,v!=null||p.onclick!==null||(p.onclick=jh));else if(w!==4&&(f=f.child,f!==null))for(by(f,p,v),f=f.sibling;f!==null;)by(f,p,v),f=f.sibling}function Sy(f,p,v){var w=f.tag;if(w===5||w===6)f=f.stateNode,p?v.insertBefore(f,p):v.appendChild(f);else if(w!==4&&(f=f.child,f!==null))for(Sy(f,p,v),f=f.sibling;f!==null;)Sy(f,p,v),f=f.sibling}var di=null,Ks=!1;function Wa(f,p,v){for(v=v.child;v!==null;)eT(f,p,v),v=v.sibling}function eT(f,p,v){if(Qe&&typeof Qe.onCommitFiberUnmount=="function")try{Qe.onCommitFiberUnmount(he,v)}catch{}switch(v.tag){case 5:Ti||Jc(v,p);case 6:var w=di,C=Ks;di=null,Wa(f,p,v),di=w,Ks=C,di!==null&&(Ks?(f=di,v=v.stateNode,f.nodeType===8?f.parentNode.removeChild(v):f.removeChild(v)):di.removeChild(v.stateNode));break;case 18:di!==null&&(Ks?(f=di,v=v.stateNode,f.nodeType===8?Qv(f.parentNode,v):f.nodeType===1&&Qv(f,v),Zs(f)):Qv(di,v.stateNode));break;case 4:w=di,C=Ks,di=v.stateNode.containerInfo,Ks=!0,Wa(f,p,v),di=w,Ks=C;break;case 0:case 11:case 14:case 15:if(!Ti&&(w=v.updateQueue,w!==null&&(w=w.lastEffect,w!==null))){C=w=w.next;do{var E=C,N=E.destroy;E=E.tag,N!==void 0&&((E&2)!==0||(E&4)!==0)&&vy(v,p,N),C=C.next}while(C!==w)}Wa(f,p,v);break;case 1:if(!Ti&&(Jc(v,p),w=v.stateNode,typeof w.componentWillUnmount=="function"))try{w.props=v.memoizedProps,w.state=v.memoizedState,w.componentWillUnmount()}catch(ne){Er(v,p,ne)}Wa(f,p,v);break;case 21:Wa(f,p,v);break;case 22:v.mode&1?(Ti=(w=Ti)||v.memoizedState!==null,Wa(f,p,v),Ti=w):Wa(f,p,v);break;default:Wa(f,p,v)}}function tT(f){var p=f.updateQueue;if(p!==null){f.updateQueue=null;var v=f.stateNode;v===null&&(v=f.stateNode=new gq),p.forEach(function(w){var C=Tq.bind(null,f,w);v.has(w)||(v.add(w),w.then(C,C))})}}function Js(f,p){var v=p.deletions;if(v!==null)for(var w=0;w<v.length;w++){var C=v[w];try{var E=f,N=p,ne=N;e:for(;ne!==null;){switch(ne.tag){case 5:di=ne.stateNode,Ks=!1;break e;case 3:di=ne.stateNode.containerInfo,Ks=!0;break e;case 4:di=ne.stateNode.containerInfo,Ks=!0;break e}ne=ne.return}if(di===null)throw Error(t(160));eT(E,N,C),di=null,Ks=!1;var le=C.alternate;le!==null&&(le.return=null),C.return=null}catch(be){Er(C,p,be)}}if(p.subtreeFlags&12854)for(p=p.child;p!==null;)nT(p,f),p=p.sibling}function nT(f,p){var v=f.alternate,w=f.flags;switch(f.tag){case 0:case 11:case 14:case 15:if(Js(p,f),ko(f),w&4){try{Nf(3,f,f.return),op(3,f)}catch(Rt){Er(f,f.return,Rt)}try{Nf(5,f,f.return)}catch(Rt){Er(f,f.return,Rt)}}break;case 1:Js(p,f),ko(f),w&512&&v!==null&&Jc(v,v.return);break;case 5:if(Js(p,f),ko(f),w&512&&v!==null&&Jc(v,v.return),f.flags&32){var C=f.stateNode;try{kt(C,"")}catch(Rt){Er(f,f.return,Rt)}}if(w&4&&(C=f.stateNode,C!=null)){var E=f.memoizedProps,N=v!==null?v.memoizedProps:E,ne=f.type,le=f.updateQueue;if(f.updateQueue=null,le!==null)try{ne==="input"&&E.type==="radio"&&E.name!=null&>(C,E),Dt(ne,N);var be=Dt(ne,E);for(N=0;N<le.length;N+=2){var Be=le[N],Ve=le[N+1];Be==="style"?Xe(C,Ve):Be==="dangerouslySetInnerHTML"?_t(C,Ve):Be==="children"?kt(C,Ve):P(C,Be,Ve,be)}switch(ne){case"input":tn(C,E);break;case"textarea":ge(C,E);break;case"select":var Ue=C._wrapperState.wasMultiple;C._wrapperState.wasMultiple=!!E.multiple;var Ot=E.value;Ot!=null?Qn(C,!!E.multiple,Ot,!1):Ue!==!!E.multiple&&(E.defaultValue!=null?Qn(C,!!E.multiple,E.defaultValue,!0):Qn(C,!!E.multiple,E.multiple?[]:"",!1))}C[Cf]=E}catch(Rt){Er(f,f.return,Rt)}}break;case 6:if(Js(p,f),ko(f),w&4){if(f.stateNode===null)throw Error(t(162));C=f.stateNode,E=f.memoizedProps;try{C.nodeValue=E}catch(Rt){Er(f,f.return,Rt)}}break;case 3:if(Js(p,f),ko(f),w&4&&v!==null&&v.memoizedState.isDehydrated)try{Zs(p.containerInfo)}catch(Rt){Er(f,f.return,Rt)}break;case 4:Js(p,f),ko(f);break;case 13:Js(p,f),ko(f),C=f.child,C.flags&8192&&(E=C.memoizedState!==null,C.stateNode.isHidden=E,!E||C.alternate!==null&&C.alternate.memoizedState!==null||(Py=vn())),w&4&&tT(f);break;case 22:if(Be=v!==null&&v.memoizedState!==null,f.mode&1?(Ti=(be=Ti)||Be,Js(p,f),Ti=be):Js(p,f),ko(f),w&8192){if(be=f.memoizedState!==null,(f.stateNode.isHidden=be)&&!Be&&(f.mode&1)!==0)for(wt=f,Be=f.child;Be!==null;){for(Ve=wt=Be;wt!==null;){switch(Ue=wt,Ot=Ue.child,Ue.tag){case 0:case 11:case 14:case 15:Nf(4,Ue,Ue.return);break;case 1:Jc(Ue,Ue.return);var xt=Ue.stateNode;if(typeof xt.componentWillUnmount=="function"){w=Ue,v=Ue.return;try{p=w,xt.props=p.memoizedProps,xt.state=p.memoizedState,xt.componentWillUnmount()}catch(Rt){Er(w,v,Rt)}}break;case 5:Jc(Ue,Ue.return);break;case 22:if(Ue.memoizedState!==null){sT(Ve);continue}}Ot!==null?(Ot.return=Ue,wt=Ot):sT(Ve)}Be=Be.sibling}e:for(Be=null,Ve=f;;){if(Ve.tag===5){if(Be===null){Be=Ve;try{C=Ve.stateNode,be?(E=C.style,typeof E.setProperty=="function"?E.setProperty("display","none","important"):E.display="none"):(ne=Ve.stateNode,le=Ve.memoizedProps.style,N=le!=null&&le.hasOwnProperty("display")?le.display:null,ne.style.display=We("display",N))}catch(Rt){Er(f,f.return,Rt)}}}else if(Ve.tag===6){if(Be===null)try{Ve.stateNode.nodeValue=be?"":Ve.memoizedProps}catch(Rt){Er(f,f.return,Rt)}}else if((Ve.tag!==22&&Ve.tag!==23||Ve.memoizedState===null||Ve===f)&&Ve.child!==null){Ve.child.return=Ve,Ve=Ve.child;continue}if(Ve===f)break e;for(;Ve.sibling===null;){if(Ve.return===null||Ve.return===f)break e;Be===Ve&&(Be=null),Ve=Ve.return}Be===Ve&&(Be=null),Ve.sibling.return=Ve.return,Ve=Ve.sibling}}break;case 19:Js(p,f),ko(f),w&4&&tT(f);break;case 21:break;default:Js(p,f),ko(f)}}function ko(f){var p=f.flags;if(p&2){try{e:{for(var v=f.return;v!==null;){if(Kx(v)){var w=v;break e}v=v.return}throw Error(t(160))}switch(w.tag){case 5:var C=w.stateNode;w.flags&32&&(kt(C,""),w.flags&=-33);var E=Jx(f);Sy(f,E,C);break;case 3:case 4:var N=w.stateNode.containerInfo,ne=Jx(f);by(f,ne,N);break;default:throw Error(t(161))}}catch(le){Er(f,f.return,le)}f.flags&=-3}p&4096&&(f.flags&=-4097)}function vq(f,p,v){wt=f,rT(f)}function rT(f,p,v){for(var w=(f.mode&1)!==0;wt!==null;){var C=wt,E=C.child;if(C.tag===22&&w){var N=C.memoizedState!==null||sp;if(!N){var ne=C.alternate,le=ne!==null&&ne.memoizedState!==null||Ti;ne=sp;var be=Ti;if(sp=N,(Ti=le)&&!be)for(wt=C;wt!==null;)N=wt,le=N.child,N.tag===22&&N.memoizedState!==null?oT(C):le!==null?(le.return=N,wt=le):oT(C);for(;E!==null;)wt=E,rT(E),E=E.sibling;wt=C,sp=ne,Ti=be}iT(f)}else(C.subtreeFlags&8772)!==0&&E!==null?(E.return=C,wt=E):iT(f)}}function iT(f){for(;wt!==null;){var p=wt;if((p.flags&8772)!==0){var v=p.alternate;try{if((p.flags&8772)!==0)switch(p.tag){case 0:case 11:case 15:Ti||op(5,p);break;case 1:var w=p.stateNode;if(p.flags&4&&!Ti)if(v===null)w.componentDidMount();else{var C=p.elementType===p.type?v.memoizedProps:Hs(p.type,v.memoizedProps);w.componentDidUpdate(C,v.memoizedState,w.__reactInternalSnapshotBeforeUpdate)}var E=p.updateQueue;E!==null&&sx(p,E,w);break;case 3:var N=p.updateQueue;if(N!==null){if(v=null,p.child!==null)switch(p.child.tag){case 5:v=p.child.stateNode;break;case 1:v=p.child.stateNode}sx(p,N,v)}break;case 5:var ne=p.stateNode;if(v===null&&p.flags&4){v=ne;var le=p.memoizedProps;switch(p.type){case"button":case"input":case"select":case"textarea":le.autoFocus&&v.focus();break;case"img":le.src&&(v.src=le.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(p.memoizedState===null){var be=p.alternate;if(be!==null){var Be=be.memoizedState;if(Be!==null){var Ve=Be.dehydrated;Ve!==null&&Zs(Ve)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(t(163))}Ti||p.flags&512&&yy(p)}catch(Ue){Er(p,p.return,Ue)}}if(p===f){wt=null;break}if(v=p.sibling,v!==null){v.return=p.return,wt=v;break}wt=p.return}}function sT(f){for(;wt!==null;){var p=wt;if(p===f){wt=null;break}var v=p.sibling;if(v!==null){v.return=p.return,wt=v;break}wt=p.return}}function oT(f){for(;wt!==null;){var p=wt;try{switch(p.tag){case 0:case 11:case 15:var v=p.return;try{op(4,p)}catch(le){Er(p,v,le)}break;case 1:var w=p.stateNode;if(typeof w.componentDidMount=="function"){var C=p.return;try{w.componentDidMount()}catch(le){Er(p,C,le)}}var E=p.return;try{yy(p)}catch(le){Er(p,E,le)}break;case 5:var N=p.return;try{yy(p)}catch(le){Er(p,N,le)}}}catch(le){Er(p,p.return,le)}if(p===f){wt=null;break}var ne=p.sibling;if(ne!==null){ne.return=p.return,wt=ne;break}wt=p.return}}var yq=Math.ceil,ap=k.ReactCurrentDispatcher,wy=k.ReactCurrentOwner,_s=k.ReactCurrentBatchConfig,An=0,si=null,qr=null,hi=0,fs=0,eu=Ua(0),Yr=0,Lf=null,Kl=0,lp=0,ky=0,qf=null,zi=null,Py=0,tu=1/0,ha=null,cp=!1,xy=null,Xa=null,up=!1,za=null,fp=0,Uf=0,Ty=null,dp=-1,hp=0;function ji(){return(An&6)!==0?vn():dp!==-1?dp:dp=vn()}function Ya(f){return(f.mode&1)===0?1:(An&2)!==0&&hi!==0?hi&-hi:nq.transition!==null?(hp===0&&(hp=Gn()),hp):(f=jt,f!==0||(f=window.event,f=f===void 0?16:Bl(f.type)),f)}function eo(f,p,v,w){if(50<Uf)throw Uf=0,Ty=null,Error(t(185));Kt(f,v,w),((An&2)===0||f!==si)&&(f===si&&((An&2)===0&&(lp|=v),Yr===4&&Ga(f,hi)),Yi(f,w),v===1&&An===0&&(p.mode&1)===0&&(tu=vn()+500,Uh&&Fa()))}function Yi(f,p){var v=f.callbackNode;Ht(f,p);var w=Jt(f,f===si?hi:0);if(w===0)v!==null&&St(v),f.callbackNode=null,f.callbackPriority=0;else if(p=w&-w,f.callbackPriority!==p){if(v!=null&&St(v),p===1)f.tag===0?tq(lT.bind(null,f)):XP(lT.bind(null,f)),H3(function(){(An&6)===0&&Fa()}),v=null;else{switch(Cr(w)){case 1:v=Wr;break;case 4:v=K;break;case 16:v=te;break;case 536870912:v=Ae;break;default:v=te}v=gT(v,aT.bind(null,f))}f.callbackPriority=p,f.callbackNode=v}}function aT(f,p){if(dp=-1,hp=0,(An&6)!==0)throw Error(t(327));var v=f.callbackNode;if(nu()&&f.callbackNode!==v)return null;var w=Jt(f,f===si?hi:0);if(w===0)return null;if((w&30)!==0||(w&f.expiredLanes)!==0||p)p=pp(f,w);else{p=w;var C=An;An|=2;var E=uT();(si!==f||hi!==p)&&(ha=null,tu=vn()+500,ec(f,p));do try{wq();break}catch(ne){cT(f,ne)}while(!0);Vv(),ap.current=E,An=C,qr!==null?p=0:(si=null,hi=0,p=Yr)}if(p!==0){if(p===2&&(C=rn(f),C!==0&&(w=C,p=Cy(f,C))),p===1)throw v=Lf,ec(f,0),Ga(f,w),Yi(f,vn()),v;if(p===6)Ga(f,w);else{if(C=f.current.alternate,(w&30)===0&&!bq(C)&&(p=pp(f,w),p===2&&(E=rn(f),E!==0&&(w=E,p=Cy(f,E))),p===1))throw v=Lf,ec(f,0),Ga(f,w),Yi(f,vn()),v;switch(f.finishedWork=C,f.finishedLanes=w,p){case 0:case 1:throw Error(t(345));case 2:tc(f,zi,ha);break;case 3:if(Ga(f,w),(w&130023424)===w&&(p=Py+500-vn(),10<p)){if(Jt(f,0)!==0)break;if(C=f.suspendedLanes,(C&w)!==w){ji(),f.pingedLanes|=f.suspendedLanes&C;break}f.timeoutHandle=Mv(tc.bind(null,f,zi,ha),p);break}tc(f,zi,ha);break;case 4:if(Ga(f,w),(w&4194240)===w)break;for(p=f.eventTimes,C=-1;0<w;){var N=31-De(w);E=1<<N,N=p[N],N>C&&(C=N),w&=~E}if(w=C,w=vn()-w,w=(120>w?120:480>w?480:1080>w?1080:1920>w?1920:3e3>w?3e3:4320>w?4320:1960*yq(w/1960))-w,10<w){f.timeoutHandle=Mv(tc.bind(null,f,zi,ha),w);break}tc(f,zi,ha);break;case 5:tc(f,zi,ha);break;default:throw Error(t(329))}}}return Yi(f,vn()),f.callbackNode===v?aT.bind(null,f):null}function Cy(f,p){var v=qf;return f.current.memoizedState.isDehydrated&&(ec(f,p).flags|=256),f=pp(f,p),f!==2&&(p=zi,zi=v,p!==null&&_y(p)),f}function _y(f){zi===null?zi=f:zi.push.apply(zi,f)}function bq(f){for(var p=f;;){if(p.flags&16384){var v=p.updateQueue;if(v!==null&&(v=v.stores,v!==null))for(var w=0;w<v.length;w++){var C=v[w],E=C.getSnapshot;C=C.value;try{if(!Ys(E(),C))return!1}catch{return!1}}}if(v=p.child,p.subtreeFlags&16384&&v!==null)v.return=p,p=v;else{if(p===f)break;for(;p.sibling===null;){if(p.return===null||p.return===f)return!0;p=p.return}p.sibling.return=p.return,p=p.sibling}}return!0}function Ga(f,p){for(p&=~ky,p&=~lp,f.suspendedLanes|=p,f.pingedLanes&=~p,f=f.expirationTimes;0<p;){var v=31-De(p),w=1<<v;f[v]=-1,p&=~w}}function lT(f){if((An&6)!==0)throw Error(t(327));nu();var p=Jt(f,0);if((p&1)===0)return Yi(f,vn()),null;var v=pp(f,p);if(f.tag!==0&&v===2){var w=rn(f);w!==0&&(p=w,v=Cy(f,w))}if(v===1)throw v=Lf,ec(f,0),Ga(f,p),Yi(f,vn()),v;if(v===6)throw Error(t(345));return f.finishedWork=f.current.alternate,f.finishedLanes=p,tc(f,zi,ha),Yi(f,vn()),null}function Ey(f,p){var v=An;An|=1;try{return f(p)}finally{An=v,An===0&&(tu=vn()+500,Uh&&Fa())}}function Jl(f){za!==null&&za.tag===0&&(An&6)===0&&nu();var p=An;An|=1;var v=_s.transition,w=jt;try{if(_s.transition=null,jt=1,f)return f()}finally{jt=w,_s.transition=v,An=p,(An&6)===0&&Fa()}}function Ry(){fs=eu.current,ur(eu)}function ec(f,p){f.finishedWork=null,f.finishedLanes=0;var v=f.timeoutHandle;if(v!==-1&&(f.timeoutHandle=-1,G3(v)),qr!==null)for(v=qr.return;v!==null;){var w=v;switch(Lv(w),w.tag){case 1:w=w.type.childContextTypes,w!=null&&Lh();break;case 3:Hc(),ur(Zi),ur(ki),Kv();break;case 5:Gv(w);break;case 4:Hc();break;case 13:ur(kr);break;case 19:ur(kr);break;case 10:Zv(w.type._context);break;case 22:case 23:Ry()}v=v.return}if(si=f,qr=f=Ha(f.current,null),hi=fs=p,Yr=0,Lf=null,ky=lp=Kl=0,zi=qf=null,Yl!==null){for(p=0;p<Yl.length;p++)if(v=Yl[p],w=v.interleaved,w!==null){v.interleaved=null;var C=w.next,E=v.pending;if(E!==null){var N=E.next;E.next=C,w.next=N}v.pending=w}Yl=null}return f}function cT(f,p){do{var v=qr;try{if(Vv(),Hh.current=tp,Kh){for(var w=Pr.memoizedState;w!==null;){var C=w.queue;C!==null&&(C.pending=null),w=w.next}Kh=!1}if(Hl=0,ii=zr=Pr=null,Mf=!1,Qf=0,wy.current=null,v===null||v.return===null){Yr=1,Lf=p,qr=null;break}e:{var E=f,N=v.return,ne=v,le=p;if(p=hi,ne.flags|=32768,le!==null&&typeof le=="object"&&typeof le.then=="function"){var be=le,Be=ne,Ve=Be.tag;if((Be.mode&1)===0&&(Ve===0||Ve===11||Ve===15)){var Ue=Be.alternate;Ue?(Be.updateQueue=Ue.updateQueue,Be.memoizedState=Ue.memoizedState,Be.lanes=Ue.lanes):(Be.updateQueue=null,Be.memoizedState=null)}var Ot=Qx(N);if(Ot!==null){Ot.flags&=-257,Dx(Ot,N,ne,E,p),Ot.mode&1&&Mx(E,be,p),p=Ot,le=be;var xt=p.updateQueue;if(xt===null){var Rt=new Set;Rt.add(le),p.updateQueue=Rt}else xt.add(le);break e}else{if((p&1)===0){Mx(E,be,p),Ay();break e}le=Error(t(426))}}else if(Or&&ne.mode&1){var Ir=Qx(N);if(Ir!==null){(Ir.flags&65536)===0&&(Ir.flags|=256),Dx(Ir,N,ne,E,p),Bv(Kc(le,ne));break e}}E=le=Kc(le,ne),Yr!==4&&(Yr=2),qf===null?qf=[E]:qf.push(E),E=N;do{switch(E.tag){case 3:E.flags|=65536,p&=-p,E.lanes|=p;var me=Ax(E,le,p);ix(E,me);break e;case 1:ne=le;var fe=E.type,Oe=E.stateNode;if((E.flags&128)===0&&(typeof fe.getDerivedStateFromError=="function"||Oe!==null&&typeof Oe.componentDidCatch=="function"&&(Xa===null||!Xa.has(Oe)))){E.flags|=65536,p&=-p,E.lanes|=p;var He=$x(E,ne,p);ix(E,He);break e}}E=E.return}while(E!==null)}dT(v)}catch(At){p=At,qr===v&&v!==null&&(qr=v=v.return);continue}break}while(!0)}function uT(){var f=ap.current;return ap.current=tp,f===null?tp:f}function Ay(){(Yr===0||Yr===3||Yr===2)&&(Yr=4),si===null||(Kl&268435455)===0&&(lp&268435455)===0||Ga(si,hi)}function pp(f,p){var v=An;An|=2;var w=uT();(si!==f||hi!==p)&&(ha=null,ec(f,p));do try{Sq();break}catch(C){cT(f,C)}while(!0);if(Vv(),An=v,ap.current=w,qr!==null)throw Error(t(261));return si=null,hi=0,Yr}function Sq(){for(;qr!==null;)fT(qr)}function wq(){for(;qr!==null&&!un();)fT(qr)}function fT(f){var p=mT(f.alternate,f,fs);f.memoizedProps=f.pendingProps,p===null?dT(f):qr=p,wy.current=null}function dT(f){var p=f;do{var v=p.alternate;if(f=p.return,(p.flags&32768)===0){if(v=pq(v,p,fs),v!==null){qr=v;return}}else{if(v=mq(v,p),v!==null){v.flags&=32767,qr=v;return}if(f!==null)f.flags|=32768,f.subtreeFlags=0,f.deletions=null;else{Yr=6,qr=null;return}}if(p=p.sibling,p!==null){qr=p;return}qr=p=f}while(p!==null);Yr===0&&(Yr=5)}function tc(f,p,v){var w=jt,C=_s.transition;try{_s.transition=null,jt=1,kq(f,p,v,w)}finally{_s.transition=C,jt=w}return null}function kq(f,p,v,w){do nu();while(za!==null);if((An&6)!==0)throw Error(t(327));v=f.finishedWork;var C=f.finishedLanes;if(v===null)return null;if(f.finishedWork=null,f.finishedLanes=0,v===f.current)throw Error(t(177));f.callbackNode=null,f.callbackPriority=0;var E=v.lanes|v.childLanes;if(Rn(f,E),f===si&&(qr=si=null,hi=0),(v.subtreeFlags&2064)===0&&(v.flags&2064)===0||up||(up=!0,gT(te,function(){return nu(),null})),E=(v.flags&15990)!==0,(v.subtreeFlags&15990)!==0||E){E=_s.transition,_s.transition=null;var N=jt;jt=1;var ne=An;An|=4,wy.current=null,Oq(f,v),nT(v,f),F3(Av),ea=!!Rv,Av=Rv=null,f.current=v,vq(v),wr(),An=ne,jt=N,_s.transition=E}else f.current=v;if(up&&(up=!1,za=f,fp=C),E=f.pendingLanes,E===0&&(Xa=null),rt(v.stateNode),Yi(f,vn()),p!==null)for(w=f.onRecoverableError,v=0;v<p.length;v++)C=p[v],w(C.value,{componentStack:C.stack,digest:C.digest});if(cp)throw cp=!1,f=xy,xy=null,f;return(fp&1)!==0&&f.tag!==0&&nu(),E=f.pendingLanes,(E&1)!==0?f===Ty?Uf++:(Uf=0,Ty=f):Uf=0,Fa(),null}function nu(){if(za!==null){var f=Cr(fp),p=_s.transition,v=jt;try{if(_s.transition=null,jt=16>f?16:f,za===null)var w=!1;else{if(f=za,za=null,fp=0,(An&6)!==0)throw Error(t(331));var C=An;for(An|=4,wt=f.current;wt!==null;){var E=wt,N=E.child;if((wt.flags&16)!==0){var ne=E.deletions;if(ne!==null){for(var le=0;le<ne.length;le++){var be=ne[le];for(wt=be;wt!==null;){var Be=wt;switch(Be.tag){case 0:case 11:case 15:Nf(8,Be,E)}var Ve=Be.child;if(Ve!==null)Ve.return=Be,wt=Ve;else for(;wt!==null;){Be=wt;var Ue=Be.sibling,Ot=Be.return;if(Hx(Be),Be===be){wt=null;break}if(Ue!==null){Ue.return=Ot,wt=Ue;break}wt=Ot}}}var xt=E.alternate;if(xt!==null){var Rt=xt.child;if(Rt!==null){xt.child=null;do{var Ir=Rt.sibling;Rt.sibling=null,Rt=Ir}while(Rt!==null)}}wt=E}}if((E.subtreeFlags&2064)!==0&&N!==null)N.return=E,wt=N;else e:for(;wt!==null;){if(E=wt,(E.flags&2048)!==0)switch(E.tag){case 0:case 11:case 15:Nf(9,E,E.return)}var me=E.sibling;if(me!==null){me.return=E.return,wt=me;break e}wt=E.return}}var fe=f.current;for(wt=fe;wt!==null;){N=wt;var Oe=N.child;if((N.subtreeFlags&2064)!==0&&Oe!==null)Oe.return=N,wt=Oe;else e:for(N=fe;wt!==null;){if(ne=wt,(ne.flags&2048)!==0)try{switch(ne.tag){case 0:case 11:case 15:op(9,ne)}}catch(At){Er(ne,ne.return,At)}if(ne===N){wt=null;break e}var He=ne.sibling;if(He!==null){He.return=ne.return,wt=He;break e}wt=ne.return}}if(An=C,Fa(),Qe&&typeof Qe.onPostCommitFiberRoot=="function")try{Qe.onPostCommitFiberRoot(he,f)}catch{}w=!0}return w}finally{jt=v,_s.transition=p}}return!1}function hT(f,p,v){p=Kc(v,p),p=Ax(f,p,1),f=Za(f,p,1),p=ji(),f!==null&&(Kt(f,1,p),Yi(f,p))}function Er(f,p,v){if(f.tag===3)hT(f,f,v);else for(;p!==null;){if(p.tag===3){hT(p,f,v);break}else if(p.tag===1){var w=p.stateNode;if(typeof p.type.getDerivedStateFromError=="function"||typeof w.componentDidCatch=="function"&&(Xa===null||!Xa.has(w))){f=Kc(v,f),f=$x(p,f,1),p=Za(p,f,1),f=ji(),p!==null&&(Kt(p,1,f),Yi(p,f));break}}p=p.return}}function Pq(f,p,v){var w=f.pingCache;w!==null&&w.delete(p),p=ji(),f.pingedLanes|=f.suspendedLanes&v,si===f&&(hi&v)===v&&(Yr===4||Yr===3&&(hi&130023424)===hi&&500>vn()-Py?ec(f,0):ky|=v),Yi(f,p)}function pT(f,p){p===0&&((f.mode&1)===0?p=1:(p=yn,yn<<=1,(yn&130023424)===0&&(yn=4194304)));var v=ji();f=ua(f,p),f!==null&&(Kt(f,p,v),Yi(f,v))}function xq(f){var p=f.memoizedState,v=0;p!==null&&(v=p.retryLane),pT(f,v)}function Tq(f,p){var v=0;switch(f.tag){case 13:var w=f.stateNode,C=f.memoizedState;C!==null&&(v=C.retryLane);break;case 19:w=f.stateNode;break;default:throw Error(t(314))}w!==null&&w.delete(p),pT(f,v)}var mT;mT=function(f,p,v){if(f!==null)if(f.memoizedProps!==p.pendingProps||Zi.current)Xi=!0;else{if((f.lanes&v)===0&&(p.flags&128)===0)return Xi=!1,hq(f,p,v);Xi=(f.flags&131072)!==0}else Xi=!1,Or&&(p.flags&1048576)!==0&&zP(p,Fh,p.index);switch(p.lanes=0,p.tag){case 2:var w=p.type;ip(f,p),f=p.pendingProps;var C=Vc(p,ki.current);Gc(p,v),C=ty(null,p,w,f,C,v);var E=ny();return p.flags|=1,typeof C=="object"&&C!==null&&typeof C.render=="function"&&C.$$typeof===void 0?(p.tag=1,p.memoizedState=null,p.updateQueue=null,Wi(w)?(E=!0,qh(p)):E=!1,p.memoizedState=C.state!==null&&C.state!==void 0?C.state:null,zv(p),C.updater=np,p.stateNode=C,C._reactInternals=p,ly(p,w,f,v),p=dy(null,p,w,!0,E,v)):(p.tag=0,Or&&E&&Nv(p),Ii(null,p,C,v),p=p.child),p;case 16:w=p.elementType;e:{switch(ip(f,p),f=p.pendingProps,C=w._init,w=C(w._payload),p.type=w,C=p.tag=_q(w),f=Hs(w,f),C){case 0:p=fy(null,p,w,f,v);break e;case 1:p=Ux(null,p,w,f,v);break e;case 11:p=Ix(null,p,w,f,v);break e;case 14:p=jx(null,p,w,Hs(w.type,f),v);break e}throw Error(t(306,w,""))}return p;case 0:return w=p.type,C=p.pendingProps,C=p.elementType===w?C:Hs(w,C),fy(f,p,w,C,v);case 1:return w=p.type,C=p.pendingProps,C=p.elementType===w?C:Hs(w,C),Ux(f,p,w,C,v);case 3:e:{if(Bx(p),f===null)throw Error(t(387));w=p.pendingProps,E=p.memoizedState,C=E.element,rx(f,p),Yh(p,w,null,v);var N=p.memoizedState;if(w=N.element,E.isDehydrated)if(E={element:w,isDehydrated:!1,cache:N.cache,pendingSuspenseBoundaries:N.pendingSuspenseBoundaries,transitions:N.transitions},p.updateQueue.baseState=E,p.memoizedState=E,p.flags&256){C=Kc(Error(t(423)),p),p=Fx(f,p,w,v,C);break e}else if(w!==C){C=Kc(Error(t(424)),p),p=Fx(f,p,w,v,C);break e}else for(us=qa(p.stateNode.containerInfo.firstChild),cs=p,Or=!0,Gs=null,v=tx(p,null,w,v),p.child=v;v;)v.flags=v.flags&-3|4096,v=v.sibling;else{if(Xc(),w===C){p=da(f,p,v);break e}Ii(f,p,w,v)}p=p.child}return p;case 5:return ox(p),f===null&&Uv(p),w=p.type,C=p.pendingProps,E=f!==null?f.memoizedProps:null,N=C.children,$v(w,C)?N=null:E!==null&&$v(w,E)&&(p.flags|=32),qx(f,p),Ii(f,p,N,v),p.child;case 6:return f===null&&Uv(p),null;case 13:return Vx(f,p,v);case 4:return Yv(p,p.stateNode.containerInfo),w=p.pendingProps,f===null?p.child=zc(p,null,w,v):Ii(f,p,w,v),p.child;case 11:return w=p.type,C=p.pendingProps,C=p.elementType===w?C:Hs(w,C),Ix(f,p,w,C,v);case 7:return Ii(f,p,p.pendingProps,v),p.child;case 8:return Ii(f,p,p.pendingProps.children,v),p.child;case 12:return Ii(f,p,p.pendingProps.children,v),p.child;case 10:e:{if(w=p.type._context,C=p.pendingProps,E=p.memoizedProps,N=C.value,ir(Wh,w._currentValue),w._currentValue=N,E!==null)if(Ys(E.value,N)){if(E.children===C.children&&!Zi.current){p=da(f,p,v);break e}}else for(E=p.child,E!==null&&(E.return=p);E!==null;){var ne=E.dependencies;if(ne!==null){N=E.child;for(var le=ne.firstContext;le!==null;){if(le.context===w){if(E.tag===1){le=fa(-1,v&-v),le.tag=2;var be=E.updateQueue;if(be!==null){be=be.shared;var Be=be.pending;Be===null?le.next=le:(le.next=Be.next,Be.next=le),be.pending=le}}E.lanes|=v,le=E.alternate,le!==null&&(le.lanes|=v),Wv(E.return,v,p),ne.lanes|=v;break}le=le.next}}else if(E.tag===10)N=E.type===p.type?null:E.child;else if(E.tag===18){if(N=E.return,N===null)throw Error(t(341));N.lanes|=v,ne=N.alternate,ne!==null&&(ne.lanes|=v),Wv(N,v,p),N=E.sibling}else N=E.child;if(N!==null)N.return=E;else for(N=E;N!==null;){if(N===p){N=null;break}if(E=N.sibling,E!==null){E.return=N.return,N=E;break}N=N.return}E=N}Ii(f,p,C.children,v),p=p.child}return p;case 9:return C=p.type,w=p.pendingProps.children,Gc(p,v),C=Ts(C),w=w(C),p.flags|=1,Ii(f,p,w,v),p.child;case 14:return w=p.type,C=Hs(w,p.pendingProps),C=Hs(w.type,C),jx(f,p,w,C,v);case 15:return Nx(f,p,p.type,p.pendingProps,v);case 17:return w=p.type,C=p.pendingProps,C=p.elementType===w?C:Hs(w,C),ip(f,p),p.tag=1,Wi(w)?(f=!0,qh(p)):f=!1,Gc(p,v),Ex(p,w,C),ly(p,w,C,v),dy(null,p,w,!0,f,v);case 19:return Wx(f,p,v);case 22:return Lx(f,p,v)}throw Error(t(156,p.tag))};function gT(f,p){return Bt(f,p)}function Cq(f,p,v,w){this.tag=f,this.key=v,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=p,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=w,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Es(f,p,v,w){return new Cq(f,p,v,w)}function $y(f){return f=f.prototype,!(!f||!f.isReactComponent)}function _q(f){if(typeof f=="function")return $y(f)?1:0;if(f!=null){if(f=f.$$typeof,f===D)return 11;if(f===ue)return 14}return 2}function Ha(f,p){var v=f.alternate;return v===null?(v=Es(f.tag,p,f.key,f.mode),v.elementType=f.elementType,v.type=f.type,v.stateNode=f.stateNode,v.alternate=f,f.alternate=v):(v.pendingProps=p,v.type=f.type,v.flags=0,v.subtreeFlags=0,v.deletions=null),v.flags=f.flags&14680064,v.childLanes=f.childLanes,v.lanes=f.lanes,v.child=f.child,v.memoizedProps=f.memoizedProps,v.memoizedState=f.memoizedState,v.updateQueue=f.updateQueue,p=f.dependencies,v.dependencies=p===null?null:{lanes:p.lanes,firstContext:p.firstContext},v.sibling=f.sibling,v.index=f.index,v.ref=f.ref,v}function mp(f,p,v,w,C,E){var N=2;if(w=f,typeof f=="function")$y(f)&&(N=1);else if(typeof f=="string")N=5;else e:switch(f){case M:return nc(v.children,C,E,p);case Q:N=8,C|=8;break;case _:return f=Es(12,v,p,C|2),f.elementType=_,f.lanes=E,f;case F:return f=Es(13,v,p,C),f.elementType=F,f.lanes=E,f;case G:return f=Es(19,v,p,C),f.elementType=G,f.lanes=E,f;case X:return gp(v,C,E,p);default:if(typeof f=="object"&&f!==null)switch(f.$$typeof){case R:N=10;break e;case $:N=9;break e;case D:N=11;break e;case ue:N=14;break e;case B:N=16,w=null;break e}throw Error(t(130,f==null?f:typeof f,""))}return p=Es(N,v,p,C),p.elementType=f,p.type=w,p.lanes=E,p}function nc(f,p,v,w){return f=Es(7,f,w,p),f.lanes=v,f}function gp(f,p,v,w){return f=Es(22,f,w,p),f.elementType=X,f.lanes=v,f.stateNode={isHidden:!1},f}function My(f,p,v){return f=Es(6,f,null,p),f.lanes=v,f}function Qy(f,p,v){return p=Es(4,f.children!==null?f.children:[],f.key,p),p.lanes=v,p.stateNode={containerInfo:f.containerInfo,pendingChildren:null,implementation:f.implementation},p}function Eq(f,p,v,w,C){this.tag=p,this.containerInfo=f,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Vn(0),this.expirationTimes=Vn(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Vn(0),this.identifierPrefix=w,this.onRecoverableError=C,this.mutableSourceEagerHydrationData=null}function Dy(f,p,v,w,C,E,N,ne,le){return f=new Eq(f,p,v,ne,le),p===1?(p=1,E===!0&&(p|=8)):p=0,E=Es(3,null,null,p),f.current=E,E.stateNode=f,E.memoizedState={element:w,isDehydrated:v,cache:null,transitions:null,pendingSuspenseBoundaries:null},zv(E),f}function Rq(f,p,v){var w=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:A,key:w==null?null:""+w,children:f,containerInfo:p,implementation:v}}function OT(f){if(!f)return Ba;f=f._reactInternals;e:{if(Gt(f)!==f||f.tag!==1)throw Error(t(170));var p=f;do{switch(p.tag){case 3:p=p.stateNode.context;break e;case 1:if(Wi(p.type)){p=p.stateNode.__reactInternalMemoizedMergedChildContext;break e}}p=p.return}while(p!==null);throw Error(t(171))}if(f.tag===1){var v=f.type;if(Wi(v))return ZP(f,v,p)}return p}function vT(f,p,v,w,C,E,N,ne,le){return f=Dy(v,w,!0,f,C,E,N,ne,le),f.context=OT(null),v=f.current,w=ji(),C=Ya(v),E=fa(w,C),E.callback=p??null,Za(v,E,C),f.current.lanes=C,Kt(f,C,w),Yi(f,w),f}function Op(f,p,v,w){var C=p.current,E=ji(),N=Ya(C);return v=OT(v),p.context===null?p.context=v:p.pendingContext=v,p=fa(E,N),p.payload={element:f},w=w===void 0?null:w,w!==null&&(p.callback=w),f=Za(C,p,N),f!==null&&(eo(f,C,N,E),zh(f,C,N)),N}function vp(f){if(f=f.current,!f.child)return null;switch(f.child.tag){case 5:return f.child.stateNode;default:return f.child.stateNode}}function yT(f,p){if(f=f.memoizedState,f!==null&&f.dehydrated!==null){var v=f.retryLane;f.retryLane=v!==0&&v<p?v:p}}function Iy(f,p){yT(f,p),(f=f.alternate)&&yT(f,p)}function Aq(){return null}var bT=typeof reportError=="function"?reportError:function(f){console.error(f)};function jy(f){this._internalRoot=f}yp.prototype.render=jy.prototype.render=function(f){var p=this._internalRoot;if(p===null)throw Error(t(409));Op(f,p,null,null)},yp.prototype.unmount=jy.prototype.unmount=function(){var f=this._internalRoot;if(f!==null){this._internalRoot=null;var p=f.containerInfo;Jl(function(){Op(null,f,null,null)}),p[oa]=null}};function yp(f){this._internalRoot=f}yp.prototype.unstable_scheduleHydration=function(f){if(f){var p=bi();f={blockedOn:null,target:f,priority:p};for(var v=0;v<Qi.length&&p!==0&&p<Qi[v].priority;v++);Qi.splice(v,0,f),v===0&&Vs(f)}};function Ny(f){return!(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)}function bp(f){return!(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11&&(f.nodeType!==8||f.nodeValue!==" react-mount-point-unstable "))}function ST(){}function $q(f,p,v,w,C){if(C){if(typeof w=="function"){var E=w;w=function(){var be=vp(N);E.call(be)}}var N=vT(p,w,f,0,null,!1,!1,"",ST);return f._reactRootContainer=N,f[oa]=N.current,xf(f.nodeType===8?f.parentNode:f),Jl(),N}for(;C=f.lastChild;)f.removeChild(C);if(typeof w=="function"){var ne=w;w=function(){var be=vp(le);ne.call(be)}}var le=Dy(f,0,!1,null,null,!1,!1,"",ST);return f._reactRootContainer=le,f[oa]=le.current,xf(f.nodeType===8?f.parentNode:f),Jl(function(){Op(p,le,v,w)}),le}function Sp(f,p,v,w,C){var E=v._reactRootContainer;if(E){var N=E;if(typeof C=="function"){var ne=C;C=function(){var le=vp(N);ne.call(le)}}Op(p,N,f,C)}else N=$q(v,p,f,C,w);return vp(N)}mr=function(f){switch(f.tag){case 3:var p=f.stateNode;if(p.current.memoizedState.isDehydrated){var v=Mt(p.pendingLanes);v!==0&&(bn(p,v|1),Yi(p,vn()),(An&6)===0&&(tu=vn()+500,Fa()))}break;case 13:Jl(function(){var w=ua(f,1);if(w!==null){var C=ji();eo(w,f,1,C)}}),Iy(f,1)}},Hn=function(f){if(f.tag===13){var p=ua(f,134217728);if(p!==null){var v=ji();eo(p,f,134217728,v)}Iy(f,134217728)}},_r=function(f){if(f.tag===13){var p=Ya(f),v=ua(f,p);if(v!==null){var w=ji();eo(v,f,p,w)}Iy(f,p)}},bi=function(){return jt},Dr=function(f,p){var v=jt;try{return jt=f,p()}finally{jt=v}},Ft=function(f,p,v){switch(p){case"input":if(tn(f,v),p=v.name,v.type==="radio"&&p!=null){for(v=f;v.parentNode;)v=v.parentNode;for(v=v.querySelectorAll("input[name="+JSON.stringify(""+p)+'][type="radio"]'),p=0;p<v.length;p++){var w=v[p];if(w!==f&&w.form===f.form){var C=Nh(w);if(!C)throw Error(t(90));Te(w),tn(w,C)}}}break;case"textarea":ge(f,v);break;case"select":p=v.value,p!=null&&Qn(f,!!v.multiple,p,!1)}},wn=Ey,tr=Jl;var Mq={usingClientEntryPoint:!1,Events:[_f,Bc,Nh,Pn,On,Ey]},Bf={findFiberByHostInstance:Zl,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Qq={bundleType:Bf.bundleType,version:Bf.version,rendererPackageName:Bf.rendererPackageName,rendererConfig:Bf.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:k.ReactCurrentDispatcher,findHostInstanceByFiber:function(f){return f=Yn(f),f===null?null:f.stateNode},findFiberByHostInstance:Bf.findFiberByHostInstance||Aq,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var wp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!wp.isDisabled&&wp.supportsFiber)try{he=wp.inject(Qq),Qe=wp}catch{}}return Gi.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Mq,Gi.createPortal=function(f,p){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ny(p))throw Error(t(200));return Rq(f,p,null,v)},Gi.createRoot=function(f,p){if(!Ny(f))throw Error(t(299));var v=!1,w="",C=bT;return p!=null&&(p.unstable_strictMode===!0&&(v=!0),p.identifierPrefix!==void 0&&(w=p.identifierPrefix),p.onRecoverableError!==void 0&&(C=p.onRecoverableError)),p=Dy(f,1,!1,null,null,v,!1,w,C),f[oa]=p.current,xf(f.nodeType===8?f.parentNode:f),new jy(p)},Gi.findDOMNode=function(f){if(f==null)return null;if(f.nodeType===1)return f;var p=f._reactInternals;if(p===void 0)throw typeof f.render=="function"?Error(t(188)):(f=Object.keys(f).join(","),Error(t(268,f)));return f=Yn(p),f=f===null?null:f.stateNode,f},Gi.flushSync=function(f){return Jl(f)},Gi.hydrate=function(f,p,v){if(!bp(p))throw Error(t(200));return Sp(null,f,p,!0,v)},Gi.hydrateRoot=function(f,p,v){if(!Ny(f))throw Error(t(405));var w=v!=null&&v.hydratedSources||null,C=!1,E="",N=bT;if(v!=null&&(v.unstable_strictMode===!0&&(C=!0),v.identifierPrefix!==void 0&&(E=v.identifierPrefix),v.onRecoverableError!==void 0&&(N=v.onRecoverableError)),p=vT(p,null,f,1,v??null,C,!1,E,N),f[oa]=p.current,xf(f),w)for(f=0;f<w.length;f++)v=w[f],C=v._getVersion,C=C(v._source),p.mutableSourceEagerHydrationData==null?p.mutableSourceEagerHydrationData=[v,C]:p.mutableSourceEagerHydrationData.push(v,C);return new yp(p)},Gi.render=function(f,p,v){if(!bp(p))throw Error(t(200));return Sp(null,f,p,!1,v)},Gi.unmountComponentAtNode=function(f){if(!bp(f))throw Error(t(40));return f._reactRootContainer?(Jl(function(){Sp(null,null,f,!1,function(){f._reactRootContainer=null,f[oa]=null})}),!0):!1},Gi.unstable_batchedUpdates=Ey,Gi.unstable_renderSubtreeIntoContainer=function(f,p,v,w){if(!bp(v))throw Error(t(200));if(f==null||f._reactInternals===void 0)throw Error(t(38));return Sp(f,p,v,!1,w)},Gi.version="18.3.1-next-f1338f8080-20240426",Gi}var ET;function fh(){if(ET)return Uy.exports;ET=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}return n(),Uy.exports=Bq(),Uy.exports}var RT;function Fq(){if(RT)return kp;RT=1;var n=fh();return kp.createRoot=n.createRoot,kp.hydrateRoot=n.hydrateRoot,kp}var Vq=Fq();function hl(n){throw new Error('Could not dynamically require "'+n+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Vy={exports:{}},AT;function Zq(){return AT||(AT=1,function(n,e){(function(t){n.exports=t()})(function(){return function(){function t(r,i,s){function o(c,u){if(!i[c]){if(!r[c]){var d=typeof hl=="function"&&hl;if(!u&&d)return d(c,!0);if(a)return a(c,!0);var h=new Error("Cannot find module '"+c+"'");throw h.code="MODULE_NOT_FOUND",h}var m=i[c]={exports:{}};r[c][0].call(m.exports,function(g){var O=r[c][1][g];return o(O||g)},m,m.exports,t,r,i,s)}return i[c].exports}for(var a=typeof hl=="function"&&hl,l=0;l<s.length;l++)o(s[l]);return o}return t}()({1:[function(t,r,i){(function(s,o){(function(){(function(a,l){l(typeof i=="object"&&typeof r<"u"?i:a.async={})})(this,function(a){function l(Z,...U){return(...z)=>Z(...U,...z)}function c(Z){return function(...U){var z=U.pop();return Z.call(this,U,z)}}var u=typeof queueMicrotask=="function"&&queueMicrotask,d=typeof o=="function"&&o,h=typeof s=="object"&&typeof s.nextTick=="function";function m(Z){setTimeout(Z,0)}function g(Z){return(U,...z)=>Z(()=>U(...z))}var O;u?O=queueMicrotask:d?O=o:h?O=s.nextTick:O=m;var y=g(O);function b(Z){return k(Z)?function(...U){const z=U.pop(),ae=Z.apply(this,U);return S(ae,z)}:c(function(U,z){var ae;try{ae=Z.apply(this,U)}catch(ve){return z(ve)}if(ae&&typeof ae.then=="function")return S(ae,z);z(null,ae)})}function S(Z,U){return Z.then(z=>{P(U,null,z)},z=>{P(U,z&&z.message?z:new Error(z))})}function P(Z,U,z){try{Z(U,z)}catch(ae){y(ve=>{throw ve},ae)}}function k(Z){return Z[Symbol.toStringTag]==="AsyncFunction"}function x(Z){return Z[Symbol.toStringTag]==="AsyncGenerator"}function A(Z){return typeof Z[Symbol.asyncIterator]=="function"}function M(Z){if(typeof Z!="function")throw new Error("expected a function");return k(Z)?b(Z):Z}function Q(Z,U=Z.length){if(!U)throw new Error("arity is undefined");function z(...ae){return typeof ae[U-1]=="function"?Z.apply(this,ae):new Promise((ve,ye)=>{ae[U-1]=(we,...xe)=>{if(we)return ye(we);ve(xe.length>1?xe:xe[0])},Z.apply(this,ae)})}return z}function _(Z){return function(z,...ae){return Q(function(ye){var we=this;return Z(z,(xe,qe)=>{M(xe).apply(we,ae.concat(qe))},ye)})}}function R(Z,U,z,ae){U=U||[];var ve=[],ye=0,we=M(z);return Z(U,(xe,qe,Et)=>{var hn=ye++;we(xe,(xn,pn)=>{ve[hn]=pn,Et(xn)})},xe=>{ae(xe,ve)})}function $(Z){return Z&&typeof Z.length=="number"&&Z.length>=0&&Z.length%1===0}const D={};function F(Z){function U(...z){if(Z!==null){var ae=Z;Z=null,ae.apply(this,z)}}return Object.assign(U,Z),U}function G(Z){return Z[Symbol.iterator]&&Z[Symbol.iterator]()}function ue(Z){var U=-1,z=Z.length;return function(){return++U<z?{value:Z[U],key:U}:null}}function B(Z){var U=-1;return function(){var ae=Z.next();return ae.done?null:(U++,{value:ae.value,key:U})}}function X(Z){var U=Z?Object.keys(Z):[],z=-1,ae=U.length;return function ve(){var ye=U[++z];return ye==="__proto__"?ve():z<ae?{value:Z[ye],key:ye}:null}}function W(Z){if($(Z))return ue(Z);var U=G(Z);return U?B(U):X(Z)}function ee(Z){return function(...U){if(Z===null)throw new Error("Callback was already called.");var z=Z;Z=null,z.apply(this,U)}}function re(Z,U,z,ae){let ve=!1,ye=!1,we=!1,xe=0,qe=0;function Et(){xe>=U||we||ve||(we=!0,Z.next().then(({value:pn,done:Fi})=>{if(!(ye||ve)){if(we=!1,Fi){ve=!0,xe<=0&&ae(null);return}xe++,z(pn,qe,hn),qe++,Et()}}).catch(xn))}function hn(pn,Fi){if(xe-=1,!ye){if(pn)return xn(pn);if(pn===!1){ve=!0,ye=!0;return}if(Fi===D||ve&&xe<=0)return ve=!0,ae(null);Et()}}function xn(pn){ye||(we=!1,ve=!0,ae(pn))}Et()}var H=Z=>(U,z,ae)=>{if(ae=F(ae),Z<=0)throw new RangeError("concurrency limit cannot be less than 1");if(!U)return ae(null);if(x(U))return re(U,Z,z,ae);if(A(U))return re(U[Symbol.asyncIterator](),Z,z,ae);var ve=W(U),ye=!1,we=!1,xe=0,qe=!1;function Et(xn,pn){if(!we)if(xe-=1,xn)ye=!0,ae(xn);else if(xn===!1)ye=!0,we=!0;else{if(pn===D||ye&&xe<=0)return ye=!0,ae(null);qe||hn()}}function hn(){for(qe=!0;xe<Z&&!ye;){var xn=ve();if(xn===null){ye=!0,xe<=0&&ae(null);return}xe+=1,z(xn.value,xn.key,ee(Et))}qe=!1}hn()};function se(Z,U,z,ae){return H(U)(Z,M(z),ae)}var J=Q(se,4);function oe(Z,U,z){z=F(z);var ae=0,ve=0,{length:ye}=Z,we=!1;ye===0&&z(null);function xe(qe,Et){qe===!1&&(we=!0),we!==!0&&(qe?z(qe):(++ve===ye||Et===D)&&z(null))}for(;ae<ye;ae++)U(Z[ae],ae,ee(xe))}function pe(Z,U,z){return J(Z,1/0,U,z)}function Ee(Z,U,z){var ae=$(Z)?oe:pe;return ae(Z,M(U),z)}var j=Q(Ee,3);function V(Z,U,z){return R(j,Z,U,z)}var Y=Q(V,3),de=_(Y);function ke(Z,U,z){return J(Z,1,U,z)}var Te=Q(ke,3);function Pe(Z,U,z){return R(Te,Z,U,z)}var Re=Q(Pe,3),Ge=_(Re);const gt=Symbol("promiseCallback");function tn(){let Z,U;function z(ae,...ve){if(ae)return U(ae);Z(ve.length>1?ve:ve[0])}return z[gt]=new Promise((ae,ve)=>{Z=ae,U=ve}),z}function Ln(Z,U,z){typeof U!="number"&&(z=U,U=null),z=F(z||tn());var ae=Object.keys(Z).length;if(!ae)return z(null);U||(U=ae);var ve={},ye=0,we=!1,xe=!1,qe=Object.create(null),Et=[],hn=[],xn={};Object.keys(Z).forEach(Ct=>{var Lt=Z[Ct];if(!Array.isArray(Lt)){pn(Ct,[Lt]),hn.push(Ct);return}var mn=Lt.slice(0,Lt.length-1),rr=mn.length;if(rr===0){pn(Ct,Lt),hn.push(Ct);return}xn[Ct]=rr,mn.forEach(Lr=>{if(!Z[Lr])throw new Error("async.auto task `"+Ct+"` has a non-existent dependency `"+Lr+"` in "+mn.join(", "));ja(Lr,()=>{rr--,rr===0&&pn(Ct,Lt)})})}),Sn(),Fi();function pn(Ct,Lt){Et.push(()=>Fl(Ct,Lt))}function Fi(){if(!we){if(Et.length===0&&ye===0)return z(null,ve);for(;Et.length&&ye<U;){var Ct=Et.shift();Ct()}}}function ja(Ct,Lt){var mn=qe[Ct];mn||(mn=qe[Ct]=[]),mn.push(Lt)}function ia(Ct){var Lt=qe[Ct]||[];Lt.forEach(mn=>mn()),Fi()}function Fl(Ct,Lt){if(!xe){var mn=ee((Lr,...Vi)=>{if(ye--,Lr===!1){we=!0;return}if(Vi.length<2&&([Vi]=Vi),Lr){var Na={};if(Object.keys(ve).forEach(sa=>{Na[sa]=ve[sa]}),Na[Ct]=Vi,xe=!0,qe=Object.create(null),we)return;z(Lr,Na)}else ve[Ct]=Vi,ia(Ct)});ye++;var rr=M(Lt[Lt.length-1]);Lt.length>1?rr(ve,mn):rr(mn)}}function Sn(){for(var Ct,Lt=0;hn.length;)Ct=hn.pop(),Lt++,Nt(Ct).forEach(mn=>{--xn[mn]===0&&hn.push(mn)});if(Lt!==ae)throw new Error("async.auto cannot execute tasks due to a recursive dependency")}function Nt(Ct){var Lt=[];return Object.keys(Z).forEach(mn=>{const rr=Z[mn];Array.isArray(rr)&&rr.indexOf(Ct)>=0&&Lt.push(mn)}),Lt}return z[gt]}var an=/^(?:async\s+)?(?:function)?\s*\w*\s*\(\s*([^)]+)\s*\)(?:\s*{)/,ln=/^(?:async\s+)?\(?\s*([^)=]+)\s*\)?(?:\s*=>)/,Qn=/,/,Dn=/(=.+)?(\s*)$/;function I(Z){let U="",z=0,ae=Z.indexOf("*/");for(;z<Z.length;)if(Z[z]==="/"&&Z[z+1]==="/"){let ve=Z.indexOf(`
|
|
41
|
+
`,z);z=ve===-1?Z.length:ve}else if(ae!==-1&&Z[z]==="/"&&Z[z+1]==="*"){let ve=Z.indexOf("*/",z);ve!==-1?(z=ve+2,ae=Z.indexOf("*/",z)):(U+=Z[z],z++)}else U+=Z[z],z++;return U}function ge(Z){const U=I(Z.toString());let z=U.match(an);if(z||(z=U.match(ln)),!z)throw new Error(`could not parse args in autoInject
|
|
42
|
+
Source:
|
|
43
|
+
`+U);let[,ae]=z;return ae.replace(/\s/g,"").split(Qn).map(ve=>ve.replace(Dn,"").trim())}function je(Z,U){var z={};return Object.keys(Z).forEach(ae=>{var ve=Z[ae],ye,we=k(ve),xe=!we&&ve.length===1||we&&ve.length===0;if(Array.isArray(ve))ye=[...ve],ve=ye.pop(),z[ae]=ye.concat(ye.length>0?qe:ve);else if(xe)z[ae]=ve;else{if(ye=ge(ve),ve.length===0&&!we&&ye.length===0)throw new Error("autoInject task functions require explicit parameters.");we||ye.pop(),z[ae]=ye.concat(qe)}function qe(Et,hn){var xn=ye.map(pn=>Et[pn]);xn.push(hn),M(ve)(...xn)}}),Ln(z,U)}class ze{constructor(){this.head=this.tail=null,this.length=0}removeLink(U){return U.prev?U.prev.next=U.next:this.head=U.next,U.next?U.next.prev=U.prev:this.tail=U.prev,U.prev=U.next=null,this.length-=1,U}empty(){for(;this.head;)this.shift();return this}insertAfter(U,z){z.prev=U,z.next=U.next,U.next?U.next.prev=z:this.tail=z,U.next=z,this.length+=1}insertBefore(U,z){z.prev=U.prev,z.next=U,U.prev?U.prev.next=z:this.head=z,U.prev=z,this.length+=1}unshift(U){this.head?this.insertBefore(this.head,U):Ze(this,U)}push(U){this.tail?this.insertAfter(this.tail,U):Ze(this,U)}shift(){return this.head&&this.removeLink(this.head)}pop(){return this.tail&&this.removeLink(this.tail)}toArray(){return[...this]}*[Symbol.iterator](){for(var U=this.head;U;)yield U.data,U=U.next}remove(U){for(var z=this.head;z;){var{next:ae}=z;U(z)&&this.removeLink(z),z=ae}return this}}function Ze(Z,U){Z.length=1,Z.head=Z.tail=U}function Ke(Z,U,z){if(U==null)U=1;else if(U===0)throw new RangeError("Concurrency must not be zero");var ae=M(Z),ve=0,ye=[];const we={error:[],drain:[],saturated:[],unsaturated:[],empty:[]};function xe(Nt,Ct){we[Nt].push(Ct)}function qe(Nt,Ct){const Lt=(...mn)=>{Et(Nt,Lt),Ct(...mn)};we[Nt].push(Lt)}function Et(Nt,Ct){if(!Nt)return Object.keys(we).forEach(Lt=>we[Lt]=[]);if(!Ct)return we[Nt]=[];we[Nt]=we[Nt].filter(Lt=>Lt!==Ct)}function hn(Nt,...Ct){we[Nt].forEach(Lt=>Lt(...Ct))}var xn=!1;function pn(Nt,Ct,Lt,mn){if(mn!=null&&typeof mn!="function")throw new Error("task callback must be a function");Sn.started=!0;var rr,Lr;function Vi(sa,...Vl){if(sa)return Lt?Lr(sa):rr();if(Vl.length<=1)return rr(Vl[0]);rr(Vl)}var Na=Sn._createTaskItem(Nt,Lt?Vi:mn||Vi);if(Ct?Sn._tasks.unshift(Na):Sn._tasks.push(Na),xn||(xn=!0,y(()=>{xn=!1,Sn.process()})),Lt||!mn)return new Promise((sa,Vl)=>{rr=sa,Lr=Vl})}function Fi(Nt){return function(Ct,...Lt){ve-=1;for(var mn=0,rr=Nt.length;mn<rr;mn++){var Lr=Nt[mn],Vi=ye.indexOf(Lr);Vi===0?ye.shift():Vi>0&&ye.splice(Vi,1),Lr.callback(Ct,...Lt),Ct!=null&&hn("error",Ct,Lr.data)}ve<=Sn.concurrency-Sn.buffer&&hn("unsaturated"),Sn.idle()&&hn("drain"),Sn.process()}}function ja(Nt){return Nt.length===0&&Sn.idle()?(y(()=>hn("drain")),!0):!1}const ia=Nt=>Ct=>{if(!Ct)return new Promise((Lt,mn)=>{qe(Nt,(rr,Lr)=>{if(rr)return mn(rr);Lt(Lr)})});Et(Nt),xe(Nt,Ct)};var Fl=!1,Sn={_tasks:new ze,_createTaskItem(Nt,Ct){return{data:Nt,callback:Ct}},*[Symbol.iterator](){yield*Sn._tasks[Symbol.iterator]()},concurrency:U,payload:z,buffer:U/4,started:!1,paused:!1,push(Nt,Ct){return Array.isArray(Nt)?ja(Nt)?void 0:Nt.map(Lt=>pn(Lt,!1,!1,Ct)):pn(Nt,!1,!1,Ct)},pushAsync(Nt,Ct){return Array.isArray(Nt)?ja(Nt)?void 0:Nt.map(Lt=>pn(Lt,!1,!0,Ct)):pn(Nt,!1,!0,Ct)},kill(){Et(),Sn._tasks.empty()},unshift(Nt,Ct){return Array.isArray(Nt)?ja(Nt)?void 0:Nt.map(Lt=>pn(Lt,!0,!1,Ct)):pn(Nt,!0,!1,Ct)},unshiftAsync(Nt,Ct){return Array.isArray(Nt)?ja(Nt)?void 0:Nt.map(Lt=>pn(Lt,!0,!0,Ct)):pn(Nt,!0,!0,Ct)},remove(Nt){Sn._tasks.remove(Nt)},process(){if(!Fl){for(Fl=!0;!Sn.paused&&ve<Sn.concurrency&&Sn._tasks.length;){var Nt=[],Ct=[],Lt=Sn._tasks.length;Sn.payload&&(Lt=Math.min(Lt,Sn.payload));for(var mn=0;mn<Lt;mn++){var rr=Sn._tasks.shift();Nt.push(rr),ye.push(rr),Ct.push(rr.data)}ve+=1,Sn._tasks.length===0&&hn("empty"),ve===Sn.concurrency&&hn("saturated");var Lr=ee(Fi(Nt));ae(Ct,Lr)}Fl=!1}},length(){return Sn._tasks.length},running(){return ve},workersList(){return ye},idle(){return Sn._tasks.length+ve===0},pause(){Sn.paused=!0},resume(){Sn.paused!==!1&&(Sn.paused=!1,y(Sn.process))}};return Object.defineProperties(Sn,{saturated:{writable:!1,value:ia("saturated")},unsaturated:{writable:!1,value:ia("unsaturated")},empty:{writable:!1,value:ia("empty")},drain:{writable:!1,value:ia("drain")},error:{writable:!1,value:ia("error")}}),Sn}function _t(Z,U){return Ke(Z,1,U)}function kt(Z,U,z){return Ke(Z,U,z)}function $e(Z,U,z,ae){ae=F(ae);var ve=M(z);return Te(Z,(ye,we,xe)=>{ve(U,ye,(qe,Et)=>{U=Et,xe(qe)})},ye=>ae(ye,U))}var tt=Q($e,4);function We(...Z){var U=Z.map(M);return function(...z){var ae=this,ve=z[z.length-1];return typeof ve=="function"?z.pop():ve=tn(),tt(U,z,(ye,we,xe)=>{we.apply(ae,ye.concat((qe,...Et)=>{xe(qe,Et)}))},(ye,we)=>ve(ye,...we)),ve[gt]}}function Xe(...Z){return We(...Z.reverse())}function at(Z,U,z,ae){return R(H(U),Z,z,ae)}var dt=Q(at,4);function Dt(Z,U,z,ae){var ve=M(z);return dt(Z,U,(ye,we)=>{ve(ye,(xe,...qe)=>xe?we(xe):we(xe,qe))},(ye,we)=>{for(var xe=[],qe=0;qe<we.length;qe++)we[qe]&&(xe=xe.concat(...we[qe]));return ae(ye,xe)})}var Le=Q(Dt,4);function ct(Z,U,z){return Le(Z,1/0,U,z)}var Ft=Q(ct,3);function ht(Z,U,z){return Le(Z,1,U,z)}var It=Q(ht,3);function cn(...Z){return function(...U){var z=U.pop();return z(null,...Z)}}function Pn(Z,U){return(z,ae,ve,ye)=>{var we=!1,xe;const qe=M(ve);z(ae,(Et,hn,xn)=>{qe(Et,(pn,Fi)=>{if(pn||pn===!1)return xn(pn);if(Z(Fi)&&!xe)return we=!0,xe=U(!0,Et),xn(null,D);xn()})},Et=>{if(Et)return ye(Et);ye(null,we?xe:U(!1))})}}function On(Z,U,z){return Pn(ae=>ae,(ae,ve)=>ve)(j,Z,U,z)}var wn=Q(On,3);function tr(Z,U,z,ae){return Pn(ve=>ve,(ve,ye)=>ye)(H(U),Z,z,ae)}var Bn=Q(tr,4);function Qr(Z,U,z){return Pn(ae=>ae,(ae,ve)=>ve)(H(1),Z,U,z)}var nr=Q(Qr,3);function Sr(Z){return(U,...z)=>M(U)(...z,(ae,...ve)=>{typeof console=="object"&&(ae?console.error&&console.error(ae):console[Z]&&ve.forEach(ye=>console[Z](ye)))})}var ar=Sr("dir");function sn(Z,U,z){z=ee(z);var ae=M(Z),ve=M(U),ye;function we(qe,...Et){if(qe)return z(qe);qe!==!1&&(ye=Et,ve(...Et,xe))}function xe(qe,Et){if(qe)return z(qe);if(qe!==!1){if(!Et)return z(null,...ye);ae(we)}}return xe(null,!0)}var pt=Q(sn,3);function bt(Z,U,z){const ae=M(U);return pt(Z,(...ve)=>{const ye=ve.pop();ae(...ve,(we,xe)=>ye(we,!xe))},z)}function Pt(Z){return(U,z,ae)=>Z(U,ae)}function it(Z,U,z){return j(Z,Pt(M(U)),z)}var Fe=Q(it,3);function Vt(Z,U,z,ae){return H(U)(Z,Pt(M(z)),ae)}var Zt=Q(Vt,4);function Gt(Z,U,z){return Zt(Z,1,U,z)}var In=Q(Gt,3);function Fn(Z){return k(Z)?Z:function(...U){var z=U.pop(),ae=!0;U.push((...ve)=>{ae?y(()=>z(...ve)):z(...ve)}),Z.apply(this,U),ae=!1}}function jn(Z,U,z){return Pn(ae=>!ae,ae=>!ae)(j,Z,U,z)}var Yn=Q(jn,3);function Xt(Z,U,z,ae){return Pn(ve=>!ve,ve=>!ve)(H(U),Z,z,ae)}var Bt=Q(Xt,4);function St(Z,U,z){return Pn(ae=>!ae,ae=>!ae)(Te,Z,U,z)}var un=Q(St,3);function wr(Z,U,z,ae){var ve=new Array(U.length);Z(U,(ye,we,xe)=>{z(ye,(qe,Et)=>{ve[we]=!!Et,xe(qe)})},ye=>{if(ye)return ae(ye);for(var we=[],xe=0;xe<U.length;xe++)ve[xe]&&we.push(U[xe]);ae(null,we)})}function vn(Z,U,z,ae){var ve=[];Z(U,(ye,we,xe)=>{z(ye,(qe,Et)=>{if(qe)return xe(qe);Et&&ve.push({index:we,value:ye}),xe(qe)})},ye=>{if(ye)return ae(ye);ae(null,ve.sort((we,xe)=>we.index-xe.index).map(we=>we.value))})}function ui(Z,U,z,ae){var ve=$(U)?wr:vn;return ve(Z,U,M(z),ae)}function Wr(Z,U,z){return ui(j,Z,U,z)}var K=Q(Wr,3);function te(Z,U,z,ae){return ui(H(U),Z,z,ae)}var ce=Q(te,4);function Ae(Z,U,z){return ui(Te,Z,U,z)}var he=Q(Ae,3);function Qe(Z,U){var z=ee(U),ae=M(Fn(Z));function ve(ye){if(ye)return z(ye);ye!==!1&&ae(ve)}return ve()}var rt=Q(Qe,2);function De(Z,U,z,ae){var ve=M(z);return dt(Z,U,(ye,we)=>{ve(ye,(xe,qe)=>xe?we(xe):we(xe,{key:qe,val:ye}))},(ye,we)=>{for(var xe={},{hasOwnProperty:qe}=Object.prototype,Et=0;Et<we.length;Et++)if(we[Et]){var{key:hn}=we[Et],{val:xn}=we[Et];qe.call(xe,hn)?xe[hn].push(xn):xe[hn]=[xn]}return ae(ye,xe)})}var Ye=Q(De,4);function $t(Z,U,z){return Ye(Z,1/0,U,z)}function ot(Z,U,z){return Ye(Z,1,U,z)}var on=Sr("log");function yn(Z,U,z,ae){ae=F(ae);var ve={},ye=M(z);return H(U)(Z,(we,xe,qe)=>{ye(we,xe,(Et,hn)=>{if(Et)return qe(Et);ve[xe]=hn,qe(Et)})},we=>ae(we,ve))}var Mt=Q(yn,4);function Jt(Z,U,z){return Mt(Z,1/0,U,z)}function nn(Z,U,z){return Mt(Z,1,U,z)}function Ht(Z,U=z=>z){var z=Object.create(null),ae=Object.create(null),ve=M(Z),ye=c((we,xe)=>{var qe=U(...we);qe in z?y(()=>xe(null,...z[qe])):qe in ae?ae[qe].push(xe):(ae[qe]=[xe],ve(...we,(Et,...hn)=>{Et||(z[qe]=hn);var xn=ae[qe];delete ae[qe];for(var pn=0,Fi=xn.length;pn<Fi;pn++)xn[pn](Et,...hn)}))});return ye.memo=z,ye.unmemoized=Z,ye}var rn;h?rn=s.nextTick:d?rn=o:rn=m;var Gn=g(rn),Vn=Q((Z,U,z)=>{var ae=$(U)?[]:{};Z(U,(ve,ye,we)=>{M(ve)((xe,...qe)=>{qe.length<2&&([qe]=qe),ae[ye]=qe,we(xe)})},ve=>z(ve,ae))},3);function Kt(Z,U){return Vn(j,Z,U)}function Rn(Z,U,z){return Vn(H(U),Z,z)}function bn(Z,U){var z=M(Z);return Ke((ae,ve)=>{z(ae[0],ve)},U,1)}class jt{constructor(){this.heap=[],this.pushCount=Number.MIN_SAFE_INTEGER}get length(){return this.heap.length}empty(){return this.heap=[],this}percUp(U){let z;for(;U>0&&Hn(this.heap[U],this.heap[z=mr(U)]);){let ae=this.heap[U];this.heap[U]=this.heap[z],this.heap[z]=ae,U=z}}percDown(U){let z;for(;(z=Cr(U))<this.heap.length&&(z+1<this.heap.length&&Hn(this.heap[z+1],this.heap[z])&&(z=z+1),!Hn(this.heap[U],this.heap[z]));){let ae=this.heap[U];this.heap[U]=this.heap[z],this.heap[z]=ae,U=z}}push(U){U.pushCount=++this.pushCount,this.heap.push(U),this.percUp(this.heap.length-1)}unshift(U){return this.heap.push(U)}shift(){let[U]=this.heap;return this.heap[0]=this.heap[this.heap.length-1],this.heap.pop(),this.percDown(0),U}toArray(){return[...this]}*[Symbol.iterator](){for(let U=0;U<this.heap.length;U++)yield this.heap[U].data}remove(U){let z=0;for(let ae=0;ae<this.heap.length;ae++)U(this.heap[ae])||(this.heap[z]=this.heap[ae],z++);this.heap.splice(z);for(let ae=mr(this.heap.length-1);ae>=0;ae--)this.percDown(ae);return this}}function Cr(Z){return(Z<<1)+1}function mr(Z){return(Z+1>>1)-1}function Hn(Z,U){return Z.priority!==U.priority?Z.priority<U.priority:Z.pushCount<U.pushCount}function _r(Z,U){var z=bn(Z,U),{push:ae,pushAsync:ve}=z;z._tasks=new jt,z._createTaskItem=({data:we,priority:xe},qe)=>({data:we,priority:xe,callback:qe});function ye(we,xe){return Array.isArray(we)?we.map(qe=>({data:qe,priority:xe})):{data:we,priority:xe}}return z.push=function(we,xe=0,qe){return ae(ye(we,xe),qe)},z.pushAsync=function(we,xe=0,qe){return ve(ye(we,xe),qe)},delete z.unshift,delete z.unshiftAsync,z}function bi(Z,U){if(U=F(U),!Array.isArray(Z))return U(new TypeError("First argument to race must be an array of functions"));if(!Z.length)return U();for(var z=0,ae=Z.length;z<ae;z++)M(Z[z])(U)}var Dr=Q(bi,2);function Si(Z,U,z,ae){var ve=[...Z].reverse();return tt(ve,U,z,ae)}function fi(Z){var U=M(Z);return c(function(ae,ve){return ae.push((ye,...we)=>{let xe={};if(ye&&(xe.error=ye),we.length>0){var qe=we;we.length<=1&&([qe]=we),xe.value=qe}ve(null,xe)}),U.apply(this,ae)})}function lr(Z){var U;return Array.isArray(Z)?U=Z.map(fi):(U={},Object.keys(Z).forEach(z=>{U[z]=fi.call(this,Z[z])})),U}function gr(Z,U,z,ae){const ve=M(z);return ui(Z,U,(ye,we)=>{ve(ye,(xe,qe)=>{we(xe,!qe)})},ae)}function Mi(Z,U,z){return gr(j,Z,U,z)}var wi=Q(Mi,3);function ws(Z,U,z,ae){return gr(H(U),Z,z,ae)}var Qi=Q(ws,4);function Jo(Z,U,z){return gr(Te,Z,U,z)}var Oo=Q(Jo,3);function Di(Z){return function(){return Z}}const Ui=5,Vs=0;function Bi(Z,U,z){var ae={times:Ui,intervalFunc:Di(Vs)};if(arguments.length<3&&typeof Z=="function"?(z=U||tn(),U=Z):(ks(ae,Z),z=z||tn()),typeof U!="function")throw new Error("Invalid arguments for async.retry");var ve=M(U),ye=1;function we(){ve((xe,...qe)=>{xe!==!1&&(xe&&ye++<ae.times&&(typeof ae.errorFilter!="function"||ae.errorFilter(xe))?setTimeout(we,ae.intervalFunc(ye-1)):z(xe,...qe))})}return we(),z[gt]}function ks(Z,U){if(typeof U=="object")Z.times=+U.times||Ui,Z.intervalFunc=typeof U.interval=="function"?U.interval:Di(+U.interval||Vs),Z.errorFilter=U.errorFilter;else if(typeof U=="number"||typeof U=="string")Z.times=+U||Ui;else throw new Error("Invalid arguments for async.retry")}function Aa(Z,U){U||(U=Z,Z=null);let z=Z&&Z.arity||U.length;k(U)&&(z+=1);var ae=M(U);return c((ve,ye)=>{(ve.length<z-1||ye==null)&&(ve.push(ye),ye=tn());function we(xe){ae(...ve,xe)}return Z?Bi(Z,we,ye):Bi(we,ye),ye[gt]})}function vo(Z,U){return Vn(Te,Z,U)}function Zs(Z,U,z){return Pn(Boolean,ae=>ae)(j,Z,U,z)}var as=Q(Zs,3);function ea(Z,U,z,ae){return Pn(Boolean,ve=>ve)(H(U),Z,z,ae)}var $a=Q(ea,4);function Of(Z,U,z){return Pn(Boolean,ae=>ae)(Te,Z,U,z)}var Ws=Q(Of,3);function ta(Z,U,z){var ae=M(U);return Y(Z,(ye,we)=>{ae(ye,(xe,qe)=>{if(xe)return we(xe);we(xe,{value:ye,criteria:qe})})},(ye,we)=>{if(ye)return z(ye);z(null,we.sort(ve).map(xe=>xe.value))});function ve(ye,we){var xe=ye.criteria,qe=we.criteria;return xe<qe?-1:xe>qe?1:0}}var Ma=Q(ta,3);function Bl(Z,U,z){var ae=M(Z);return c((ve,ye)=>{var we=!1,xe;function qe(){var Et=Z.name||"anonymous",hn=new Error('Callback function "'+Et+'" timed out.');hn.code="ETIMEDOUT",z&&(hn.info=z),we=!0,ye(hn)}ve.push((...Et)=>{we||(ye(...Et),clearTimeout(xe))}),xe=setTimeout(qe,U),ae(...ve)})}function ri(Z){for(var U=Array(Z);Z--;)U[Z]=Z;return U}function ls(Z,U,z,ae){var ve=M(z);return dt(ri(Z),U,ve,ae)}function yo(Z,U,z){return ls(Z,1/0,U,z)}function Qa(Z,U,z){return ls(Z,1,U,z)}function Xs(Z,U,z,ae){arguments.length<=3&&typeof U=="function"&&(ae=z,z=U,U=Array.isArray(Z)?[]:{}),ae=F(ae||tn());var ve=M(z);return j(Z,(ye,we,xe)=>{ve(U,ye,we,xe)},ye=>ae(ye,U)),ae[gt]}function na(Z,U){var z=null,ae;return In(Z,(ve,ye)=>{M(ve)((we,...xe)=>{if(we===!1)return ye(we);xe.length<2?[ae]=xe:ae=xe,z=we,ye(we?null:{})})},()=>U(z,ae))}var Da=Q(na);function Xr(Z){return(...U)=>(Z.unmemoized||Z)(...U)}function zs(Z,U,z){z=ee(z);var ae=M(U),ve=M(Z),ye=[];function we(qe,...Et){if(qe)return z(qe);ye=Et,qe!==!1&&ve(xe)}function xe(qe,Et){if(qe)return z(qe);if(qe!==!1){if(!Et)return z(null,...ye);ae(we)}}return ve(xe)}var ra=Q(zs,3);function Ia(Z,U,z){const ae=M(Z);return ra(ve=>ae((ye,we)=>ve(ye,!we)),U,z)}function vv(Z,U){if(U=F(U),!Array.isArray(Z))return U(new Error("First argument to waterfall must be an array of functions"));if(!Z.length)return U();var z=0;function ae(ye){var we=M(Z[z++]);we(...ye,ee(ve))}function ve(ye,...we){if(ye!==!1){if(ye||z===Z.length)return U(ye,...we);ae(we)}}ae([])}var Ic=Q(vv),vf={apply:l,applyEach:de,applyEachSeries:Ge,asyncify:b,auto:Ln,autoInject:je,cargo:_t,cargoQueue:kt,compose:Xe,concat:Ft,concatLimit:Le,concatSeries:It,constant:cn,detect:wn,detectLimit:Bn,detectSeries:nr,dir:ar,doUntil:bt,doWhilst:pt,each:Fe,eachLimit:Zt,eachOf:j,eachOfLimit:J,eachOfSeries:Te,eachSeries:In,ensureAsync:Fn,every:Yn,everyLimit:Bt,everySeries:un,filter:K,filterLimit:ce,filterSeries:he,forever:rt,groupBy:$t,groupByLimit:Ye,groupBySeries:ot,log:on,map:Y,mapLimit:dt,mapSeries:Re,mapValues:Jt,mapValuesLimit:Mt,mapValuesSeries:nn,memoize:Ht,nextTick:Gn,parallel:Kt,parallelLimit:Rn,priorityQueue:_r,queue:bn,race:Dr,reduce:tt,reduceRight:Si,reflect:fi,reflectAll:lr,reject:wi,rejectLimit:Qi,rejectSeries:Oo,retry:Bi,retryable:Aa,seq:We,series:vo,setImmediate:y,some:as,someLimit:$a,someSeries:Ws,sortBy:Ma,timeout:Bl,times:yo,timesLimit:ls,timesSeries:Qa,transform:Xs,tryEach:Da,unmemoize:Xr,until:Ia,waterfall:Ic,whilst:ra,all:Yn,allLimit:Bt,allSeries:un,any:as,anyLimit:$a,anySeries:Ws,find:wn,findLimit:Bn,findSeries:nr,flatMap:Ft,flatMapLimit:Le,flatMapSeries:It,forEach:Fe,forEachSeries:In,forEachLimit:Zt,forEachOf:j,forEachOfSeries:Te,forEachOfLimit:J,inject:tt,foldl:tt,foldr:Si,select:K,selectLimit:ce,selectSeries:he,wrapSync:b,during:ra,doDuring:pt};a.default=vf,a.apply=l,a.applyEach=de,a.applyEachSeries=Ge,a.asyncify=b,a.auto=Ln,a.autoInject=je,a.cargo=_t,a.cargoQueue=kt,a.compose=Xe,a.concat=Ft,a.concatLimit=Le,a.concatSeries=It,a.constant=cn,a.detect=wn,a.detectLimit=Bn,a.detectSeries=nr,a.dir=ar,a.doUntil=bt,a.doWhilst=pt,a.each=Fe,a.eachLimit=Zt,a.eachOf=j,a.eachOfLimit=J,a.eachOfSeries=Te,a.eachSeries=In,a.ensureAsync=Fn,a.every=Yn,a.everyLimit=Bt,a.everySeries=un,a.filter=K,a.filterLimit=ce,a.filterSeries=he,a.forever=rt,a.groupBy=$t,a.groupByLimit=Ye,a.groupBySeries=ot,a.log=on,a.map=Y,a.mapLimit=dt,a.mapSeries=Re,a.mapValues=Jt,a.mapValuesLimit=Mt,a.mapValuesSeries=nn,a.memoize=Ht,a.nextTick=Gn,a.parallel=Kt,a.parallelLimit=Rn,a.priorityQueue=_r,a.queue=bn,a.race=Dr,a.reduce=tt,a.reduceRight=Si,a.reflect=fi,a.reflectAll=lr,a.reject=wi,a.rejectLimit=Qi,a.rejectSeries=Oo,a.retry=Bi,a.retryable=Aa,a.seq=We,a.series=vo,a.setImmediate=y,a.some=as,a.someLimit=$a,a.someSeries=Ws,a.sortBy=Ma,a.timeout=Bl,a.times=yo,a.timesLimit=ls,a.timesSeries=Qa,a.transform=Xs,a.tryEach=Da,a.unmemoize=Xr,a.until=Ia,a.waterfall=Ic,a.whilst=ra,a.all=Yn,a.allLimit=Bt,a.allSeries=un,a.any=as,a.anyLimit=$a,a.anySeries=Ws,a.find=wn,a.findLimit=Bn,a.findSeries=nr,a.flatMap=Ft,a.flatMapLimit=Le,a.flatMapSeries=It,a.forEach=Fe,a.forEachSeries=In,a.forEachLimit=Zt,a.forEachOf=j,a.forEachOfSeries=Te,a.forEachOfLimit=J,a.inject=tt,a.foldl=tt,a.foldr=Si,a.select=K,a.selectLimit=ce,a.selectSeries=he,a.wrapSync=b,a.during=ra,a.doDuring=pt,Object.defineProperty(a,"__esModule",{value:!0})})}).call(this)}).call(this,t("_process"),t("timers").setImmediate)},{_process:26,timers:52}],2:[function(t,r,i){(function(s){(function(){var o=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],a=typeof globalThis>"u"?s:globalThis;r.exports=function(){for(var c=[],u=0;u<o.length;u++)typeof a[o[u]]=="function"&&(c[c.length]=o[u]);return c}}).call(this)}).call(this,typeof Rr<"u"?Rr:typeof self<"u"?self:typeof window<"u"?window:{})},{}],3:[function(t,r,i){var s=t("get-intrinsic"),o=t("./"),a=o(s("String.prototype.indexOf"));r.exports=function(c,u){var d=s(c,!!u);return typeof d=="function"&&a(c,".prototype.")>-1?o(d):d}},{"./":4,"get-intrinsic":10}],4:[function(t,r,i){var s=t("function-bind"),o=t("get-intrinsic"),a=o("%Function.prototype.apply%"),l=o("%Function.prototype.call%"),c=o("%Reflect.apply%",!0)||s.call(l,a),u=o("%Object.getOwnPropertyDescriptor%",!0),d=o("%Object.defineProperty%",!0),h=o("%Math.max%");if(d)try{d({},"a",{value:1})}catch{d=null}r.exports=function(O){var y=c(s,l,arguments);if(u&&d){var b=u(y,"length");b.configurable&&d(y,"length",{value:1+h(0,O.length-(arguments.length-1))})}return y};var m=function(){return c(s,a,arguments)};d?d(r.exports,"apply",{value:m}):r.exports.apply=m},{"function-bind":9,"get-intrinsic":10}],5:[function(t,r,i){var s=typeof Reflect=="object"?Reflect:null,o=s&&typeof s.apply=="function"?s.apply:function(R,$,D){return Function.prototype.apply.call(R,$,D)},a;s&&typeof s.ownKeys=="function"?a=s.ownKeys:Object.getOwnPropertySymbols?a=function(R){return Object.getOwnPropertyNames(R).concat(Object.getOwnPropertySymbols(R))}:a=function(R){return Object.getOwnPropertyNames(R)};function l(_){console&&console.warn&&console.warn(_)}var c=Number.isNaN||function(R){return R!==R};function u(){u.init.call(this)}r.exports=u,r.exports.once=A,u.EventEmitter=u,u.prototype._events=void 0,u.prototype._eventsCount=0,u.prototype._maxListeners=void 0;var d=10;function h(_){if(typeof _!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof _)}Object.defineProperty(u,"defaultMaxListeners",{enumerable:!0,get:function(){return d},set:function(_){if(typeof _!="number"||_<0||c(_))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+_+".");d=_}}),u.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},u.prototype.setMaxListeners=function(R){if(typeof R!="number"||R<0||c(R))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+R+".");return this._maxListeners=R,this};function m(_){return _._maxListeners===void 0?u.defaultMaxListeners:_._maxListeners}u.prototype.getMaxListeners=function(){return m(this)},u.prototype.emit=function(R){for(var $=[],D=1;D<arguments.length;D++)$.push(arguments[D]);var F=R==="error",G=this._events;if(G!==void 0)F=F&&G.error===void 0;else if(!F)return!1;if(F){var ue;if($.length>0&&(ue=$[0]),ue instanceof Error)throw ue;var B=new Error("Unhandled error."+(ue?" ("+ue.message+")":""));throw B.context=ue,B}var X=G[R];if(X===void 0)return!1;if(typeof X=="function")o(X,this,$);else for(var W=X.length,ee=P(X,W),D=0;D<W;++D)o(ee[D],this,$);return!0};function g(_,R,$,D){var F,G,ue;if(h($),G=_._events,G===void 0?(G=_._events=Object.create(null),_._eventsCount=0):(G.newListener!==void 0&&(_.emit("newListener",R,$.listener?$.listener:$),G=_._events),ue=G[R]),ue===void 0)ue=G[R]=$,++_._eventsCount;else if(typeof ue=="function"?ue=G[R]=D?[$,ue]:[ue,$]:D?ue.unshift($):ue.push($),F=m(_),F>0&&ue.length>F&&!ue.warned){ue.warned=!0;var B=new Error("Possible EventEmitter memory leak detected. "+ue.length+" "+String(R)+" listeners added. Use emitter.setMaxListeners() to increase limit");B.name="MaxListenersExceededWarning",B.emitter=_,B.type=R,B.count=ue.length,l(B)}return _}u.prototype.addListener=function(R,$){return g(this,R,$,!1)},u.prototype.on=u.prototype.addListener,u.prototype.prependListener=function(R,$){return g(this,R,$,!0)};function O(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function y(_,R,$){var D={fired:!1,wrapFn:void 0,target:_,type:R,listener:$},F=O.bind(D);return F.listener=$,D.wrapFn=F,F}u.prototype.once=function(R,$){return h($),this.on(R,y(this,R,$)),this},u.prototype.prependOnceListener=function(R,$){return h($),this.prependListener(R,y(this,R,$)),this},u.prototype.removeListener=function(R,$){var D,F,G,ue,B;if(h($),F=this._events,F===void 0)return this;if(D=F[R],D===void 0)return this;if(D===$||D.listener===$)--this._eventsCount===0?this._events=Object.create(null):(delete F[R],F.removeListener&&this.emit("removeListener",R,D.listener||$));else if(typeof D!="function"){for(G=-1,ue=D.length-1;ue>=0;ue--)if(D[ue]===$||D[ue].listener===$){B=D[ue].listener,G=ue;break}if(G<0)return this;G===0?D.shift():k(D,G),D.length===1&&(F[R]=D[0]),F.removeListener!==void 0&&this.emit("removeListener",R,B||$)}return this},u.prototype.off=u.prototype.removeListener,u.prototype.removeAllListeners=function(R){var $,D,F;if(D=this._events,D===void 0)return this;if(D.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):D[R]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete D[R]),this;if(arguments.length===0){var G=Object.keys(D),ue;for(F=0;F<G.length;++F)ue=G[F],ue!=="removeListener"&&this.removeAllListeners(ue);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if($=D[R],typeof $=="function")this.removeListener(R,$);else if($!==void 0)for(F=$.length-1;F>=0;F--)this.removeListener(R,$[F]);return this};function b(_,R,$){var D=_._events;if(D===void 0)return[];var F=D[R];return F===void 0?[]:typeof F=="function"?$?[F.listener||F]:[F]:$?x(F):P(F,F.length)}u.prototype.listeners=function(R){return b(this,R,!0)},u.prototype.rawListeners=function(R){return b(this,R,!1)},u.listenerCount=function(_,R){return typeof _.listenerCount=="function"?_.listenerCount(R):S.call(_,R)},u.prototype.listenerCount=S;function S(_){var R=this._events;if(R!==void 0){var $=R[_];if(typeof $=="function")return 1;if($!==void 0)return $.length}return 0}u.prototype.eventNames=function(){return this._eventsCount>0?a(this._events):[]};function P(_,R){for(var $=new Array(R),D=0;D<R;++D)$[D]=_[D];return $}function k(_,R){for(;R+1<_.length;R++)_[R]=_[R+1];_.pop()}function x(_){for(var R=new Array(_.length),$=0;$<R.length;++$)R[$]=_[$].listener||_[$];return R}function A(_,R){return new Promise(function($,D){function F(ue){_.removeListener(R,G),D(ue)}function G(){typeof _.removeListener=="function"&&_.removeListener("error",F),$([].slice.call(arguments))}Q(_,R,G,{once:!0}),R!=="error"&&M(_,F,{once:!0})})}function M(_,R,$){typeof _.on=="function"&&Q(_,"error",R,$)}function Q(_,R,$,D){if(typeof _.on=="function")D.once?_.once(R,$):_.on(R,$);else if(typeof _.addEventListener=="function")_.addEventListener(R,function F(G){D.once&&_.removeEventListener(R,F),$(G)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof _)}},{}],6:[function(t,r,i){r.exports=function s(o,a){if(o===a)return!0;if(o&&a&&typeof o=="object"&&typeof a=="object"){if(o.constructor!==a.constructor)return!1;var l,c,u;if(Array.isArray(o)){if(l=o.length,l!=a.length)return!1;for(c=l;c--!==0;)if(!s(o[c],a[c]))return!1;return!0}if(o.constructor===RegExp)return o.source===a.source&&o.flags===a.flags;if(o.valueOf!==Object.prototype.valueOf)return o.valueOf()===a.valueOf();if(o.toString!==Object.prototype.toString)return o.toString()===a.toString();if(u=Object.keys(o),l=u.length,l!==Object.keys(a).length)return!1;for(c=l;c--!==0;)if(!Object.prototype.hasOwnProperty.call(a,u[c]))return!1;for(c=l;c--!==0;){var d=u[c];if(!s(o[d],a[d]))return!1}return!0}return o!==o&&a!==a}},{}],7:[function(t,r,i){var s=t("is-callable"),o=Object.prototype.toString,a=Object.prototype.hasOwnProperty,l=function(m,g,O){for(var y=0,b=m.length;y<b;y++)a.call(m,y)&&(O==null?g(m[y],y,m):g.call(O,m[y],y,m))},c=function(m,g,O){for(var y=0,b=m.length;y<b;y++)O==null?g(m.charAt(y),y,m):g.call(O,m.charAt(y),y,m)},u=function(m,g,O){for(var y in m)a.call(m,y)&&(O==null?g(m[y],y,m):g.call(O,m[y],y,m))},d=function(m,g,O){if(!s(g))throw new TypeError("iterator must be a function");var y;arguments.length>=3&&(y=O),o.call(m)==="[object Array]"?l(m,g,y):typeof m=="string"?c(m,g,y):u(m,g,y)};r.exports=d},{"is-callable":19}],8:[function(t,r,i){var s="Function.prototype.bind called on incompatible ",o=Object.prototype.toString,a=Math.max,l="[object Function]",c=function(m,g){for(var O=[],y=0;y<m.length;y+=1)O[y]=m[y];for(var b=0;b<g.length;b+=1)O[b+m.length]=g[b];return O},u=function(m,g){for(var O=[],y=g,b=0;y<m.length;y+=1,b+=1)O[b]=m[y];return O},d=function(h,m){for(var g="",O=0;O<h.length;O+=1)g+=h[O],O+1<h.length&&(g+=m);return g};r.exports=function(m){var g=this;if(typeof g!="function"||o.apply(g)!==l)throw new TypeError(s+g);for(var O=u(arguments,1),y,b=function(){if(this instanceof y){var A=g.apply(this,c(O,arguments));return Object(A)===A?A:this}return g.apply(m,c(O,arguments))},S=a(0,g.length-O.length),P=[],k=0;k<S;k++)P[k]="$"+k;if(y=Function("binder","return function ("+d(P,",")+"){ return binder.apply(this,arguments); }")(b),g.prototype){var x=function(){};x.prototype=g.prototype,y.prototype=new x,x.prototype=null}return y}},{}],9:[function(t,r,i){var s=t("./implementation");r.exports=Function.prototype.bind||s},{"./implementation":8}],10:[function(t,r,i){var s,o=SyntaxError,a=Function,l=TypeError,c=function(B){try{return a('"use strict"; return ('+B+").constructor;")()}catch{}},u=Object.getOwnPropertyDescriptor;if(u)try{u({},"")}catch{u=null}var d=function(){throw new l},h=u?function(){try{return arguments.callee,d}catch{try{return u(arguments,"callee").get}catch{return d}}}():d,m=t("has-symbols")(),g=Object.getPrototypeOf||function(B){return B.__proto__},O={},y=typeof Uint8Array>"u"?s:g(Uint8Array),b={"%AggregateError%":typeof AggregateError>"u"?s:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?s:ArrayBuffer,"%ArrayIteratorPrototype%":m?g([][Symbol.iterator]()):s,"%AsyncFromSyncIteratorPrototype%":s,"%AsyncFunction%":O,"%AsyncGenerator%":O,"%AsyncGeneratorFunction%":O,"%AsyncIteratorPrototype%":O,"%Atomics%":typeof Atomics>"u"?s:Atomics,"%BigInt%":typeof BigInt>"u"?s:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?s:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?s:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?s:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?s:Float32Array,"%Float64Array%":typeof Float64Array>"u"?s:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?s:FinalizationRegistry,"%Function%":a,"%GeneratorFunction%":O,"%Int8Array%":typeof Int8Array>"u"?s:Int8Array,"%Int16Array%":typeof Int16Array>"u"?s:Int16Array,"%Int32Array%":typeof Int32Array>"u"?s:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":m?g(g([][Symbol.iterator]())):s,"%JSON%":typeof JSON=="object"?JSON:s,"%Map%":typeof Map>"u"?s:Map,"%MapIteratorPrototype%":typeof Map>"u"||!m?s:g(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?s:Promise,"%Proxy%":typeof Proxy>"u"?s:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?s:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?s:Set,"%SetIteratorPrototype%":typeof Set>"u"||!m?s:g(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?s:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":m?g(""[Symbol.iterator]()):s,"%Symbol%":m?Symbol:s,"%SyntaxError%":o,"%ThrowTypeError%":h,"%TypedArray%":y,"%TypeError%":l,"%Uint8Array%":typeof Uint8Array>"u"?s:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?s:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?s:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?s:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?s:WeakMap,"%WeakRef%":typeof WeakRef>"u"?s:WeakRef,"%WeakSet%":typeof WeakSet>"u"?s:WeakSet};try{null.error}catch(B){var S=g(g(B));b["%Error.prototype%"]=S}var P=function B(X){var W;if(X==="%AsyncFunction%")W=c("async function () {}");else if(X==="%GeneratorFunction%")W=c("function* () {}");else if(X==="%AsyncGeneratorFunction%")W=c("async function* () {}");else if(X==="%AsyncGenerator%"){var ee=B("%AsyncGeneratorFunction%");ee&&(W=ee.prototype)}else if(X==="%AsyncIteratorPrototype%"){var re=B("%AsyncGenerator%");re&&(W=g(re.prototype))}return b[X]=W,W},k={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},x=t("function-bind"),A=t("has"),M=x.call(Function.call,Array.prototype.concat),Q=x.call(Function.apply,Array.prototype.splice),_=x.call(Function.call,String.prototype.replace),R=x.call(Function.call,String.prototype.slice),$=x.call(Function.call,RegExp.prototype.exec),D=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,F=/\\(\\)?/g,G=function(X){var W=R(X,0,1),ee=R(X,-1);if(W==="%"&&ee!=="%")throw new o("invalid intrinsic syntax, expected closing `%`");if(ee==="%"&&W!=="%")throw new o("invalid intrinsic syntax, expected opening `%`");var re=[];return _(X,D,function(H,se,J,oe){re[re.length]=J?_(oe,F,"$1"):se||H}),re},ue=function(X,W){var ee=X,re;if(A(k,ee)&&(re=k[ee],ee="%"+re[0]+"%"),A(b,ee)){var H=b[ee];if(H===O&&(H=P(ee)),typeof H>"u"&&!W)throw new l("intrinsic "+X+" exists, but is not available. Please file an issue!");return{alias:re,name:ee,value:H}}throw new o("intrinsic "+X+" does not exist!")};r.exports=function(X,W){if(typeof X!="string"||X.length===0)throw new l("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof W!="boolean")throw new l('"allowMissing" argument must be a boolean');if($(/^%?[^%]*%?$/,X)===null)throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var ee=G(X),re=ee.length>0?ee[0]:"",H=ue("%"+re+"%",W),se=H.name,J=H.value,oe=!1,pe=H.alias;pe&&(re=pe[0],Q(ee,M([0,1],pe)));for(var Ee=1,j=!0;Ee<ee.length;Ee+=1){var V=ee[Ee],Y=R(V,0,1),de=R(V,-1);if((Y==='"'||Y==="'"||Y==="`"||de==='"'||de==="'"||de==="`")&&Y!==de)throw new o("property names with quotes must have matching quotes");if((V==="constructor"||!j)&&(oe=!0),re+="."+V,se="%"+re+"%",A(b,se))J=b[se];else if(J!=null){if(!(V in J)){if(!W)throw new l("base intrinsic for "+X+" exists, but the property is not available.");return}if(u&&Ee+1>=ee.length){var ke=u(J,V);j=!!ke,j&&"get"in ke&&!("originalValue"in ke.get)?J=ke.get:J=J[V]}else j=A(J,V),J=J[V];j&&!oe&&(b[se]=J)}}return J}},{"function-bind":9,has:15,"has-symbols":12}],11:[function(t,r,i){var s=t("get-intrinsic"),o=s("%Object.getOwnPropertyDescriptor%",!0);if(o)try{o([],"length")}catch{o=null}r.exports=o},{"get-intrinsic":10}],12:[function(t,r,i){var s=typeof Symbol<"u"&&Symbol,o=t("./shams");r.exports=function(){return typeof s!="function"||typeof Symbol!="function"||typeof s("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:o()}},{"./shams":13}],13:[function(t,r,i){r.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var o={},a=Symbol("test"),l=Object(a);if(typeof a=="string"||Object.prototype.toString.call(a)!=="[object Symbol]"||Object.prototype.toString.call(l)!=="[object Symbol]")return!1;var c=42;o[a]=c;for(a in o)return!1;if(typeof Object.keys=="function"&&Object.keys(o).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(o).length!==0)return!1;var u=Object.getOwnPropertySymbols(o);if(u.length!==1||u[0]!==a||!Object.prototype.propertyIsEnumerable.call(o,a))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var d=Object.getOwnPropertyDescriptor(o,a);if(d.value!==c||d.enumerable!==!0)return!1}return!0}},{}],14:[function(t,r,i){var s=t("has-symbols/shams");r.exports=function(){return s()&&!!Symbol.toStringTag}},{"has-symbols/shams":13}],15:[function(t,r,i){var s=t("function-bind");r.exports=s.call(Function.call,Object.prototype.hasOwnProperty)},{"function-bind":9}],16:[function(t,r,i){var s=r.exports=function(o,a){if(a||(a=16),o===void 0&&(o=128),o<=0)return"0";for(var l=Math.log(Math.pow(2,o))/Math.log(a),c=2;l===1/0;c*=2)l=Math.log(Math.pow(2,o/c))/Math.log(a)*c;for(var u=l-Math.floor(l),d="",c=0;c<Math.floor(l);c++){var h=Math.floor(Math.random()*a).toString(a);d=h+d}if(u){var m=Math.pow(a,u),h=Math.floor(Math.random()*m).toString(a);d=h+d}var g=parseInt(d,a);return g!==1/0&&g>=Math.pow(2,o)?s(o,a):d};s.rack=function(o,a,l){var c=function(d){var h=0;do{if(h++>10)if(l)o+=l;else throw new Error("too many ID collisions, use more bits");var m=s(o,a)}while(Object.hasOwnProperty.call(u,m));return u[m]=d,m},u=c.hats={};return c.get=function(d){return c.hats[d]},c.set=function(d,h){return c.hats[d]=h,c},c.bits=o||128,c.base=a||16,c}},{}],17:[function(t,r,i){typeof Object.create=="function"?r.exports=function(o,a){a&&(o.super_=a,o.prototype=Object.create(a.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}))}:r.exports=function(o,a){if(a){o.super_=a;var l=function(){};l.prototype=a.prototype,o.prototype=new l,o.prototype.constructor=o}}},{}],18:[function(t,r,i){var s=t("has-tostringtag/shams")(),o=t("call-bind/callBound"),a=o("Object.prototype.toString"),l=function(h){return s&&h&&typeof h=="object"&&Symbol.toStringTag in h?!1:a(h)==="[object Arguments]"},c=function(h){return l(h)?!0:h!==null&&typeof h=="object"&&typeof h.length=="number"&&h.length>=0&&a(h)!=="[object Array]"&&a(h.callee)==="[object Function]"},u=function(){return l(arguments)}();l.isLegacyArguments=c,r.exports=u?l:c},{"call-bind/callBound":3,"has-tostringtag/shams":14}],19:[function(t,r,i){var s=Function.prototype.toString,o=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,a,l;if(typeof o=="function"&&typeof Object.defineProperty=="function")try{a=Object.defineProperty({},"length",{get:function(){throw l}}),l={},o(function(){throw 42},null,a)}catch(M){M!==l&&(o=null)}else o=null;var c=/^\s*class\b/,u=function(Q){try{var _=s.call(Q);return c.test(_)}catch{return!1}},d=function(Q){try{return u(Q)?!1:(s.call(Q),!0)}catch{return!1}},h=Object.prototype.toString,m="[object Object]",g="[object Function]",O="[object GeneratorFunction]",y="[object HTMLAllCollection]",b="[object HTML document.all class]",S="[object HTMLCollection]",P=typeof Symbol=="function"&&!!Symbol.toStringTag,k=!(0 in[,]),x=function(){return!1};if(typeof document=="object"){var A=document.all;h.call(A)===h.call(document.all)&&(x=function(Q){if((k||!Q)&&(typeof Q>"u"||typeof Q=="object"))try{var _=h.call(Q);return(_===y||_===b||_===S||_===m)&&Q("")==null}catch{}return!1})}r.exports=o?function(Q){if(x(Q))return!0;if(!Q||typeof Q!="function"&&typeof Q!="object")return!1;try{o(Q,null,a)}catch(_){if(_!==l)return!1}return!u(Q)&&d(Q)}:function(Q){if(x(Q))return!0;if(!Q||typeof Q!="function"&&typeof Q!="object")return!1;if(P)return d(Q);if(u(Q))return!1;var _=h.call(Q);return _!==g&&_!==O&&!/^\[object HTML/.test(_)?!1:d(Q)}},{}],20:[function(t,r,i){var s=Object.prototype.toString,o=Function.prototype.toString,a=/^\s*(?:function)?\*/,l=t("has-tostringtag/shams")(),c=Object.getPrototypeOf,u=function(){if(!l)return!1;try{return Function("return function*() {}")()}catch{}},d;r.exports=function(m){if(typeof m!="function")return!1;if(a.test(o.call(m)))return!0;if(!l){var g=s.call(m);return g==="[object GeneratorFunction]"}if(!c)return!1;if(typeof d>"u"){var O=u();d=O?c(O):!1}return c(m)===d}},{"has-tostringtag/shams":14}],21:[function(t,r,i){(function(s){(function(){var o=t("for-each"),a=t("available-typed-arrays"),l=t("call-bind/callBound"),c=l("Object.prototype.toString"),u=t("has-tostringtag/shams")(),d=t("gopd"),h=typeof globalThis>"u"?s:globalThis,m=a(),g=l("Array.prototype.indexOf",!0)||function(k,x){for(var A=0;A<k.length;A+=1)if(k[A]===x)return A;return-1},O=l("String.prototype.slice"),y={},b=Object.getPrototypeOf;u&&d&&b&&o(m,function(P){var k=new h[P];if(Symbol.toStringTag in k){var x=b(k),A=d(x,Symbol.toStringTag);if(!A){var M=b(x);A=d(M,Symbol.toStringTag)}y[P]=A.get}});var S=function(k){var x=!1;return o(y,function(A,M){if(!x)try{x=A.call(k)===M}catch{}}),x};r.exports=function(k){if(!k||typeof k!="object")return!1;if(!u||!(Symbol.toStringTag in k)){var x=O(c(k),8,-1);return g(m,x)>-1}return d?S(k):!1}}).call(this)}).call(this,typeof Rr<"u"?Rr:typeof self<"u"?self:typeof window<"u"?window:{})},{"available-typed-arrays":2,"call-bind/callBound":3,"for-each":7,gopd:11,"has-tostringtag/shams":14}],22:[function(t,r,i){r.exports=s;function s(o,a,l,c){var u=function(h,m,g,O){a(g,h,m,"left"),a(O,m,h,"right")},d=o.transformX=function(h,m){l(h),l(m);for(var g=[],O=0;O<m.length;O++){for(var y=m[O],b=[],S=0;S<h.length;){var P=[];if(u(h[S],y,b,P),S++,P.length===1)y=P[0];else if(P.length===0){for(var k=S;k<h.length;k++)c(b,h[k]);y=null;break}else{for(var x=d(h.slice(S),P),A=0;A<x[0].length;A++)c(b,x[0][A]);for(var M=0;M<x[1].length;M++)c(g,x[1][M]);y=null;break}}y!=null&&c(g,y),h=b}return[h,g]};o.transform=function(h,m,g){if(!(g==="left"||g==="right"))throw new Error("type must be 'left' or 'right'");return m.length===0?h:h.length===1&&m.length===1?a([],h[0],m[0],g):g==="left"?d(h,m)[0]:d(m,h)[1]}}},{}],23:[function(t,r,i){r.exports={type:t("./json0")}},{"./json0":24}],24:[function(t,r,i){var s=function(g){return Object.prototype.toString.call(g)=="[object Array]"},o=function(g){return!!g&&g.constructor===Object},a=function(g){return JSON.parse(JSON.stringify(g))},l={name:"json0",uri:"http://sharejs.org/types/JSONv0"},c={};l.registerSubtype=function(g){c[g.name]=g},l.create=function(g){return g===void 0?null:a(g)},l.invertComponent=function(g){var O={p:g.p};return g.t&&c[g.t]&&(O.t=g.t,O.o=c[g.t].invert(g.o)),g.si!==void 0&&(O.sd=g.si),g.sd!==void 0&&(O.si=g.sd),g.oi!==void 0&&(O.od=g.oi),g.od!==void 0&&(O.oi=g.od),g.li!==void 0&&(O.ld=g.li),g.ld!==void 0&&(O.li=g.ld),g.na!==void 0&&(O.na=-g.na),g.lm!==void 0&&(O.lm=g.p[g.p.length-1],O.p=g.p.slice(0,g.p.length-1).concat([g.lm])),O},l.invert=function(g){for(var O=g.slice().reverse(),y=[],b=0;b<O.length;b++)y.push(l.invertComponent(O[b]));return y},l.checkValidOp=function(g){for(var O=0;O<g.length;O++)if(!s(g[O].p))throw new Error("Missing path")},l.checkList=function(g){if(!s(g))throw new Error("Referenced element not a list")},l.checkObj=function(g){if(!o(g))throw new Error("Referenced element not an object (it was "+JSON.stringify(g)+")")};function u(g){g.t="text0";var O={p:g.p.pop()};g.si!=null&&(O.i=g.si),g.sd!=null&&(O.d=g.sd),g.o=[O]}function d(g){g.p.push(g.o[0].p),g.o[0].i!=null&&(g.si=g.o[0].i),g.o[0].d!=null&&(g.sd=g.o[0].d),delete g.t,delete g.o}l.apply=function(g,O){l.checkValidOp(O),O=a(O);for(var y={data:g},b=0;b<O.length;b++){var S=O[b];(S.si!=null||S.sd!=null)&&u(S);for(var P=null,k=y,x="data",A=0;A<S.p.length;A++){var M=S.p[A];if(P=k,k=k[x],x=M,P==null)throw new Error("Path invalid")}if(S.t&&S.o!==void 0&&c[S.t])k[x]=c[S.t].apply(k[x],S.o);else if(S.na!==void 0){if(typeof k[x]!="number")throw new Error("Referenced element not a number");k[x]+=S.na}else if(S.li!==void 0&&S.ld!==void 0)l.checkList(k),k[x]=S.li;else if(S.li!==void 0)l.checkList(k),k.splice(x,0,S.li);else if(S.ld!==void 0)l.checkList(k),k.splice(x,1);else if(S.lm!==void 0){if(l.checkList(k),S.lm!=x){var Q=k[x];k.splice(x,1),k.splice(S.lm,0,Q)}}else if(S.oi!==void 0)l.checkObj(k),k[x]=S.oi;else if(S.od!==void 0)l.checkObj(k),delete k[x];else throw new Error("invalid / missing instruction in op")}return y.data},l.shatter=function(g){for(var O=[],y=0;y<g.length;y++)O.push([g[y]]);return O},l.incrementalApply=function(g,O,y){for(var b=0;b<O.length;b++){var S=[O[b]];g=l.apply(g,S),y(S,g)}return g};var h=l.pathMatches=function(g,O,y){if(g.length!=O.length)return!1;for(var b=0;b<g.length;b++)if(g[b]!==O[b]&&(!y||b!==g.length-1))return!1;return!0};l.append=function(g,O){if(O=a(O),g.length===0){g.push(O);return}var y=g[g.length-1];if((O.si!=null||O.sd!=null)&&(y.si!=null||y.sd!=null)&&(u(O),u(y)),h(O.p,y.p))if(O.t&&y.t&&O.t===y.t&&c[O.t]){if(y.o=c[O.t].compose(y.o,O.o),O.si!=null||O.sd!=null){for(var b=O.p,S=0;S<y.o.length-1;S++)O.o=[y.o.pop()],O.p=b.slice(),d(O),g.push(O);d(y)}}else y.na!=null&&O.na!=null?g[g.length-1]={p:y.p,na:y.na+O.na}:y.li!==void 0&&O.li===void 0&&O.ld===y.li?y.ld!==void 0?delete y.li:g.pop():y.od!==void 0&&y.oi===void 0&&O.oi!==void 0&&O.od===void 0?y.oi=O.oi:y.oi!==void 0&&O.od!==void 0?O.oi!==void 0?y.oi=O.oi:y.od!==void 0?delete y.oi:g.pop():O.lm!==void 0&&O.p[O.p.length-1]===O.lm||g.push(O);else(O.si!=null||O.sd!=null)&&(y.si!=null||y.sd!=null)&&(d(O),d(y)),g.push(O)},l.compose=function(g,O){l.checkValidOp(g),l.checkValidOp(O);for(var y=a(g),b=0;b<O.length;b++)l.append(y,O[b]);return y},l.normalize=function(g){var O=[];g=s(g)?g:[g];for(var y=0;y<g.length;y++){var b=g[y];b.p==null&&(b.p=[]),l.append(O,b)}return O},l.commonLengthForOps=function(g,O){var y=g.p.length,b=O.p.length;if((g.na!=null||g.t)&&y++,(O.na!=null||O.t)&&b++,y===0)return-1;if(b===0)return null;y--,b--;for(var S=0;S<y;S++){var P=g.p[S];if(S>=b||P!==O.p[S])return null}return y},l.canOpAffectPath=function(g,O){return l.commonLengthForOps({p:O},g)!=null},l.transformComponent=function(g,O,y,b){O=a(O);var S=l.commonLengthForOps(y,O),P=l.commonLengthForOps(O,y),k=O.p.length,x=y.p.length;if((O.na!=null||O.t)&&k++,(y.na!=null||y.t)&&x++,P!=null&&x>k&&O.p[P]==y.p[P]){if(O.ld!==void 0){var A=a(y);A.p=A.p.slice(k),O.ld=l.apply(a(O.ld),[A])}else if(O.od!==void 0){var A=a(y);A.p=A.p.slice(k),O.od=l.apply(a(O.od),[A])}}if(S!=null){var M=k==x,A=y;if((O.si!=null||O.sd!=null)&&(y.si!=null||y.sd!=null)&&(u(O),A=a(y),u(A)),A.t&&c[A.t]){if(O.t&&O.t===A.t){var Q=c[O.t].transform(O.o,A.o,b);if(O.si!=null||O.sd!=null)for(var _=O.p,R=0;R<Q.length;R++)O.o=[Q[R]],O.p=_.slice(),d(O),l.append(g,O);else(!s(Q)||Q.length>0)&&(O.o=Q,l.append(g,O));return g}}else if(y.na===void 0){if(y.li!==void 0&&y.ld!==void 0){if(y.p[S]===O.p[S])if(M){if(O.ld!==void 0)if(O.li!==void 0&&b==="left")O.ld=a(y.li);else return g}else return g}else if(y.li!==void 0)O.li!==void 0&&O.ld===void 0&&M&&O.p[S]===y.p[S]?b==="right"&&O.p[S]++:y.p[S]<=O.p[S]&&O.p[S]++,O.lm!==void 0&&M&&y.p[S]<=O.lm&&O.lm++;else if(y.ld!==void 0){if(O.lm!==void 0&&M){if(y.p[S]===O.p[S])return g;var _=y.p[S],$=O.p[S],D=O.lm;(_<D||_===D&&$<D)&&O.lm--}if(y.p[S]<O.p[S])O.p[S]--;else if(y.p[S]===O.p[S]){if(x<k)return g;if(O.ld!==void 0)if(O.li!==void 0)delete O.ld;else return g}}else if(y.lm!==void 0)if(O.lm!==void 0&&k===x){var $=O.p[S],D=O.lm,F=y.p[S],G=y.lm;if(F!==G)if($===F)if(b==="left")O.p[S]=G,$===D&&(O.lm=G);else return g;else $>F&&O.p[S]--,$>G?O.p[S]++:$===G&&F>G&&(O.p[S]++,$===D&&O.lm++),(D>F||D===F&&D>$)&&O.lm--,D>G?O.lm++:D===G&&(G>F&&D>$||G<F&&D<$?b==="right"&&O.lm++:D>$?O.lm++:D===F&&O.lm--)}else if(O.li!==void 0&&O.ld===void 0&&M){var $=y.p[S],D=y.lm;_=O.p[S],_>$&&O.p[S]--,_>D&&O.p[S]++}else{var $=y.p[S],D=y.lm;_=O.p[S],_===$?O.p[S]=D:(_>$&&O.p[S]--,(_>D||_===D&&$>D)&&O.p[S]++)}else if(y.oi!==void 0&&y.od!==void 0){if(O.p[S]===y.p[S])if(O.oi!==void 0&&M){if(b==="right")return g;O.od=y.oi}else return g}else if(y.oi!==void 0){if(O.oi!==void 0&&O.p[S]===y.p[S])if(b==="left")l.append(g,{p:O.p,od:y.oi});else return g}else if(y.od!==void 0&&O.p[S]==y.p[S]){if(!M)return g;if(O.oi!==void 0)delete O.od;else return g}}}return l.append(g,O),g},t("./bootstrapTransform")(l,l.transformComponent,l.checkValidOp,l.append);var m=t("./text0");l.registerSubtype(m),r.exports=l},{"./bootstrapTransform":22,"./text0":25}],25:[function(t,r,i){var s=r.exports={name:"text0",uri:"http://sharejs.org/types/textv0",create:function(m){if(m!=null&&typeof m!="string")throw new Error("Initial data must be a string");return m||""}},o=function(m,g,O){return m.slice(0,g)+O+m.slice(g)},a=function(m){if(typeof m.p!="number")throw new Error("component missing position field");if(typeof m.i=="string"==(typeof m.d=="string"))throw new Error("component needs an i or d field");if(m.p<0)throw new Error("position cannot be negative")},l=function(m){for(var g=0;g<m.length;g++)a(m[g])};s.apply=function(m,g){var O;l(g);for(var y=0;y<g.length;y++){var b=g[y];if(b.i!=null)m=o(m,b.p,b.i);else{if(O=m.slice(b.p,b.p+b.d.length),b.d!==O)throw new Error("Delete component '"+b.d+"' does not match deleted text '"+O+"'");m=m.slice(0,b.p)+m.slice(b.p+b.d.length)}}return m};var c=s._append=function(m,g){if(!(g.i===""||g.d===""))if(m.length===0)m.push(g);else{var O=m[m.length-1];O.i!=null&&g.i!=null&&O.p<=g.p&&g.p<=O.p+O.i.length?m[m.length-1]={i:o(O.i,g.p-O.p,g.i),p:O.p}:O.d!=null&&g.d!=null&&g.p<=O.p&&O.p<=g.p+g.d.length?m[m.length-1]={d:o(g.d,O.p-g.p,O.d),p:g.p}:m.push(g)}};s.compose=function(m,g){l(m),l(g);for(var O=m.slice(),y=0;y<g.length;y++)c(O,g[y]);return O},s.normalize=function(m){var g=[];(m.i!=null||m.p!=null)&&(m=[m]);for(var O=0;O<m.length;O++){var y=m[O];y.p==null&&(y.p=0),c(g,y)}return g};var u=function(m,g,O){return g.i!=null?g.p<m||g.p===m&&O?m+g.i.length:m:m<=g.p?m:m<=g.p+g.d.length?g.p:m-g.d.length};s.transformCursor=function(m,g,O){for(var y=O==="right",b=0;b<g.length;b++)m=u(m,g[b],y);return m};var d=s._tc=function(m,g,O,y){if(a(g),a(O),g.i!=null)c(m,{i:g.i,p:u(g.p,O,y==="right")});else if(O.i!=null){var b=g.d;g.p<O.p&&(c(m,{d:b.slice(0,O.p-g.p),p:g.p}),b=b.slice(O.p-g.p)),b!==""&&c(m,{d:b,p:g.p+O.i.length})}else if(g.p>=O.p+O.d.length)c(m,{d:g.d,p:g.p-O.d.length});else if(g.p+g.d.length<=O.p)c(m,g);else{var S={d:"",p:g.p};g.p<O.p&&(S.d=g.d.slice(0,O.p-g.p)),g.p+g.d.length>O.p+O.d.length&&(S.d+=g.d.slice(O.p+O.d.length-g.p));var P=Math.max(g.p,O.p),k=Math.min(g.p+g.d.length,O.p+O.d.length),x=g.d.slice(P-g.p,k-g.p),A=O.d.slice(P-O.p,k-O.p);if(x!==A)throw new Error("Delete ops delete different text in the same region of the document");S.d!==""&&(S.p=u(S.p,O),c(m,S))}return m},h=function(m){return m.i!=null?{d:m.i,p:m.p}:{i:m.d,p:m.p}};s.invert=function(m){m=m.slice().reverse();for(var g=0;g<m.length;g++)m[g]=h(m[g]);return m},t("./bootstrapTransform")(s,d,l,c)},{"./bootstrapTransform":22}],26:[function(t,r,i){var s=r.exports={},o,a;function l(){throw new Error("setTimeout has not been defined")}function c(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?o=setTimeout:o=l}catch{o=l}try{typeof clearTimeout=="function"?a=clearTimeout:a=c}catch{a=c}})();function u(k){if(o===setTimeout)return setTimeout(k,0);if((o===l||!o)&&setTimeout)return o=setTimeout,setTimeout(k,0);try{return o(k,0)}catch{try{return o.call(null,k,0)}catch{return o.call(this,k,0)}}}function d(k){if(a===clearTimeout)return clearTimeout(k);if((a===c||!a)&&clearTimeout)return a=clearTimeout,clearTimeout(k);try{return a(k)}catch{try{return a.call(null,k)}catch{return a.call(this,k)}}}var h=[],m=!1,g,O=-1;function y(){!m||!g||(m=!1,g.length?h=g.concat(h):O=-1,h.length&&b())}function b(){if(!m){var k=u(y);m=!0;for(var x=h.length;x;){for(g=h,h=[];++O<x;)g&&g[O].run();O=-1,x=h.length}g=null,m=!1,d(k)}}s.nextTick=function(k){var x=new Array(arguments.length-1);if(arguments.length>1)for(var A=1;A<arguments.length;A++)x[A-1]=arguments[A];h.push(new S(k,x)),h.length===1&&!m&&u(b)};function S(k,x){this.fun=k,this.array=x}S.prototype.run=function(){this.fun.apply(null,this.array)},s.title="browser",s.browser=!0,s.env={},s.argv=[],s.version="",s.versions={};function P(){}s.on=P,s.addListener=P,s.once=P,s.off=P,s.removeListener=P,s.removeAllListeners=P,s.emit=P,s.prependListener=P,s.prependOnceListener=P,s.listeners=function(k){return[]},s.binding=function(k){throw new Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(k){throw new Error("process.chdir is not supported")},s.umask=function(){return 0}},{}],27:[function(t,r,i){var s=t("./doc"),o=t("./query"),a=t("./presence/presence"),l=t("./presence/doc-presence"),c=t("./snapshot-request/snapshot-version-request"),u=t("./snapshot-request/snapshot-timestamp-request"),d=t("../emitter"),h=t("../error"),m=t("../message-actions").ACTIONS,g=t("../types"),O=t("../util"),y=t("../logger"),b=t("./presence/doc-presence-emitter"),S=t("../protocol"),P=h.CODES;function k(_){return _.readyState===0||_.readyState===1?"connecting":"disconnected"}r.exports=x;function x(_){d.EventEmitter.call(this),this.collections=Object.create(null),this.nextQueryId=1,this.nextSnapshotRequestId=1,this.queries=Object.create(null),this._presences=Object.create(null),this._docPresenceEmitter=new b,this._snapshotRequests=Object.create(null),this.seq=1,this._presenceSeq=1,this.id=null,this.agent=null,this.debug=!1,this.state=k(_),this.bindToSocket(_)}d.mixin(x),x.prototype.bindToSocket=function(_){this.socket&&(this.socket.close(),this.socket.onmessage=null,this.socket.onopen=null,this.socket.onerror=null,this.socket.onclose=null),this.socket=_;var R=k(_);this._setState(R),this.canSend=!1;var $=this;_.onmessage=function(D){try{var F=typeof D.data=="string"?JSON.parse(D.data):D.data}catch{y.warn("Failed to parse message",D);return}$.debug&&y.info("RECV",JSON.stringify(F));var G={data:F};if($.emit("receive",G),!!G.data)try{$.handleMessage(G.data)}catch(ue){O.nextTick(function(){$.emit("error",ue)})}},_.readyState===1&&$._initializeHandshake(),_.onopen=function(){$._setState("connecting"),$._initializeHandshake()},_.onerror=function(D){$.emit("connection error",D)},_.onclose=function(D){D==="closed"||D==="Closed"?$._setState("closed",D):D==="stopped"||D==="Stopped by server"?$._setState("stopped",D):$._setState("disconnected",D)}},x.prototype.handleMessage=function(_){var R=null;switch(_.error&&(R=A(_.error,_),delete _.error),_.a){case m.initLegacy:return this._handleLegacyInit(_);case m.handshake:return this._handleHandshake(R,_);case m.queryFetch:var $=this.queries[_.id];$&&$._handleFetch(R,_.data,_.extra);return;case m.querySubscribe:var $=this.queries[_.id];$&&$._handleSubscribe(R,_.data,_.extra);return;case m.queryUnsubscribe:return;case m.queryUpdate:var $=this.queries[_.id];if(!$)return;if(R)return $._handleError(R);_.diff&&$._handleDiff(_.diff),O.hasOwn(_,"extra")&&$._handleExtra(_.extra);return;case m.bulkFetch:return this._handleBulkMessage(R,_,"_handleFetch");case m.bulkSubscribe:case m.bulkUnsubscribe:return this._handleBulkMessage(R,_,"_handleSubscribe");case m.snapshotFetch:case m.snapshotFetchByTimestamp:return this._handleSnapshotFetch(R,_);case m.fetch:var D=this.getExisting(_.c,_.d);D&&D._handleFetch(R,_.data);return;case m.subscribe:case m.unsubscribe:var D=this.getExisting(_.c,_.d);D&&D._handleSubscribe(R,_.data);return;case m.op:var D=this.getExisting(_.c,_.d);D&&D._handleOp(R,_);return;case m.presence:return this._handlePresence(R,_);case m.presenceSubscribe:return this._handlePresenceSubscribe(R,_);case m.presenceUnsubscribe:return this._handlePresenceUnsubscribe(R,_);case m.presenceRequest:return this._handlePresenceRequest(R,_);case m.pingPong:return this._handlePingPong(R);default:y.warn("Ignoring unrecognized message",_)}};function A(_,R){var $=new Error(_.message);return $.code=_.code,R&&($.data=R),$}x.prototype._handleBulkMessage=function(_,R,$){if(R.data)for(var D in R.data){var F=R.data[D],G=this.getExisting(R.c,D);G&&(_?G[$](_):F.error?G[$](A(F.error)):G[$](null,F))}else if(Array.isArray(R.b))for(var ue=0;ue<R.b.length;ue++){var D=R.b[ue],G=this.getExisting(R.c,D);G&&G[$](_)}else if(R.b)for(var D in R.b){var G=this.getExisting(R.c,D);G&&G[$](_)}else y.error("Invalid bulk message",R)},x.prototype._reset=function(){this.agent=null},x.prototype._setState=function(_,R){if(this.state!==_){if(_==="connecting"&&this.state!=="disconnected"&&this.state!=="stopped"&&this.state!=="closed"||_==="connected"&&this.state!=="connecting"){var $=new h(P.ERR_CONNECTION_STATE_TRANSITION_INVALID,"Cannot transition directly from "+this.state+" to "+_);return this.emit("error",$)}this.state=_,this.canSend=_==="connected",(_==="disconnected"||_==="stopped"||_==="closed")&&this._reset(),this.startBulk();for(var D in this.queries){var F=this.queries[D];F._onConnectionStateChanged()}for(var G in this.collections){var ue=this.collections[G];for(var D in ue)ue[D]._onConnectionStateChanged()}for(var B in this._presences)this._presences[B]._onConnectionStateChanged();for(var D in this._snapshotRequests){var X=this._snapshotRequests[D];X._onConnectionStateChanged()}this.endBulk(),this.emit(_,R),this.emit("state",_,R)}},x.prototype.startBulk=function(){this.bulk||(this.bulk=Object.create(null))},x.prototype.endBulk=function(){if(this.bulk)for(var _ in this.bulk){var R=this.bulk[_];this._sendBulk("f",_,R.f),this._sendBulk("s",_,R.s),this._sendBulk("u",_,R.u)}this.bulk=null},x.prototype._sendBulk=function(_,R,$){if($){var D=[],F=Object.create(null),G=0,ue;for(var B in $){var X=$[B];X==null?D.push(B):(F[B]=X,ue=B,G++)}if(D.length===1){var B=D[0];this.send({a:_,c:R,d:B})}else D.length&&this.send({a:"b"+_,c:R,b:D});if(G===1){var W=F[ue];this.send({a:_,c:R,d:ue,v:W})}else G&&this.send({a:"b"+_,c:R,b:F})}},x.prototype._sendActions=function(_,R,$){if(this._addDoc(R),this.bulk){var D=this.bulk[R.collection]||(this.bulk[R.collection]=Object.create(null)),F=D[_]||(D[_]=Object.create(null)),G=O.hasOwn(F,R.id);return F[R.id]=$,G}else{var ue={a:_,c:R.collection,d:R.id,v:$};this.send(ue)}},x.prototype.sendFetch=function(_){return this._sendActions(m.fetch,_,_.version)},x.prototype.sendSubscribe=function(_){return this._sendActions(m.subscribe,_,_.version)},x.prototype.sendUnsubscribe=function(_){return this._sendActions(m.unsubscribe,_)},x.prototype.sendOp=function(_,R){this._addDoc(_);var $={a:m.op,c:_.collection,d:_.id,v:_.version,src:R.src,seq:R.seq,x:{}};"op"in R&&($.op=R.op),R.create&&($.create=R.create),R.del&&($.del=R.del),_.submitSource&&($.x.source=R.source),this.send($)},x.prototype.send=function(_){this.debug&&y.info("SEND",JSON.stringify(_)),this.emit("send",_),this.socket.send(JSON.stringify(_))},x.prototype.ping=function(){if(!this.canSend)throw new h(P.ERR_CANNOT_PING_OFFLINE,"Socket must be CONNECTED to ping");var _={a:m.pingPong};this.send(_)},x.prototype.close=function(){this.socket.close()},x.prototype.getExisting=function(_,R){if(this.collections[_])return this.collections[_][R]},x.prototype.get=function(_,R){var $=this.collections[_]||(this.collections[_]=Object.create(null)),D=$[R];return D||(D=$[R]=new s(this,_,R),this.emit("doc",D)),D._wantsDestroy=!1,D},x.prototype._destroyDoc=function(_){_._wantsDestroy&&(O.digAndRemove(this.collections,_.collection,_.id),_.emit("destroy"))},x.prototype._addDoc=function(_){var R=this.collections[_.collection];R||(R=this.collections[_.collection]=Object.create(null)),R[_.id]!==_&&(R[_.id]=_)},x.prototype._createQuery=function(_,R,$,D,F){var G=this.nextQueryId++,ue=new o(_,this,G,R,$,D,F);return this.queries[G]=ue,ue.send(),ue},x.prototype._destroyQuery=function(_){delete this.queries[_.id]},x.prototype.createFetchQuery=function(_,R,$,D){return this._createQuery(m.queryFetch,_,R,$,D)},x.prototype.createSubscribeQuery=function(_,R,$,D){return this._createQuery(m.querySubscribe,_,R,$,D)},x.prototype.hasPending=function(){return!!(this._firstDoc(M)||this._firstQuery(M)||this._firstSnapshotRequest())};function M(_){return _.hasPending()}x.prototype.hasWritePending=function(){return!!this._firstDoc(Q)};function Q(_){return _.hasWritePending()}x.prototype.whenNothingPending=function(_){var R=this._firstDoc(M);if(R){R.once("nothing pending",this._nothingPendingRetry(_));return}var $=this._firstQuery(M);if($){$.once("ready",this._nothingPendingRetry(_));return}var D=this._firstSnapshotRequest();if(D){D.once("ready",this._nothingPendingRetry(_));return}O.nextTick(_)},x.prototype._nothingPendingRetry=function(_){var R=this;return function(){O.nextTick(function(){R.whenNothingPending(_)})}},x.prototype._firstDoc=function(_){for(var R in this.collections){var $=this.collections[R];for(var D in $){var F=$[D];if(_(F))return F}}},x.prototype._firstQuery=function(_){for(var R in this.queries){var $=this.queries[R];if(_($))return $}},x.prototype._firstSnapshotRequest=function(){for(var _ in this._snapshotRequests)return this._snapshotRequests[_]},x.prototype.fetchSnapshot=function(_,R,$,D){typeof $=="function"&&(D=$,$=null);var F=this.nextSnapshotRequestId++,G=new c(this,F,_,R,$,D);this._snapshotRequests[G.requestId]=G,G.send()},x.prototype.fetchSnapshotByTimestamp=function(_,R,$,D){typeof $=="function"&&(D=$,$=null);var F=this.nextSnapshotRequestId++,G=new u(this,F,_,R,$,D);this._snapshotRequests[G.requestId]=G,G.send()},x.prototype._handleSnapshotFetch=function(_,R){var $=this._snapshotRequests[R.id];$&&(delete this._snapshotRequests[R.id],$._handleResponse(_,R))},x.prototype._handleLegacyInit=function(_){if(S.checkAtLeast(_,"1.1"))return this._initializeHandshake();this._initialize(_)},x.prototype._initializeHandshake=function(){this.send({a:m.handshake,id:this.id,protocol:S.major,protocolMinor:S.minor})},x.prototype._handleHandshake=function(_,R){if(_)return this.emit("error",_);this._initialize(R)},x.prototype._handlePingPong=function(_){if(_)return this.emit("error",_);this.emit("pong")},x.prototype._initialize=function(_){if(this.state==="connecting"){if(_.protocol!==S.major)return this.emit("error",new h(P.ERR_PROTOCOL_VERSION_NOT_SUPPORTED,"Unsupported protocol version: "+_.protocol));if(g.map[_.type]!==g.defaultType)return this.emit("error",new h(P.ERR_DEFAULT_TYPE_MISMATCH,_.type+" does not match the server default type"));if(typeof _.id!="string")return this.emit("error",new h(P.ERR_CLIENT_ID_BADLY_FORMED,"Client id must be a string"));this.id=_.id,this._setState("connected")}},x.prototype.getPresence=function(_){var R=this,$=O.digOrCreate(this._presences,_,function(){return new a(R,_)});return $._wantsDestroy=!1,$},x.prototype.getDocPresence=function(_,R){var $=l.channel(_,R),D=this,F=O.digOrCreate(this._presences,$,function(){return new l(D,_,R)});return F._wantsDestroy=!1,F},x.prototype._sendPresenceAction=function(_,R,$){this._addPresence($);var D={a:_,ch:$.channel,seq:R};return this.send(D),D.seq},x.prototype._addPresence=function(_){O.digOrCreate(this._presences,_.channel,function(){return _})},x.prototype._requestRemotePresence=function(_){this.send({a:m.presenceRequest,ch:_})},x.prototype._handlePresenceSubscribe=function(_,R){var $=O.dig(this._presences,R.ch);$&&$._handleSubscribe(_,R.seq)},x.prototype._handlePresenceUnsubscribe=function(_,R){var $=O.dig(this._presences,R.ch);$&&$._handleUnsubscribe(_,R.seq)},x.prototype._handlePresence=function(_,R){var $=O.dig(this._presences,R.ch);$&&$._receiveUpdate(_,R)},x.prototype._handlePresenceRequest=function(_,R){var $=O.dig(this._presences,R.ch);$&&$._broadcastAllLocalPresence(_,R)}},{"../emitter":41,"../error":42,"../logger":43,"../message-actions":45,"../protocol":48,"../types":50,"../util":51,"./doc":28,"./presence/doc-presence":31,"./presence/doc-presence-emitter":30,"./presence/presence":34,"./query":37,"./snapshot-request/snapshot-timestamp-request":39,"./snapshot-request/snapshot-version-request":40}],28:[function(t,r,i){var s=t("../emitter"),o=t("../logger"),a=t("../error"),l=t("../types"),c=t("../util"),u=c.clone,d=t("fast-deep-equal"),h=t("../message-actions").ACTIONS,m=a.CODES;r.exports=g;function g(S,P,k){s.EventEmitter.call(this),this.connection=S,this.collection=P,this.id=k,this.version=null,this.type=null,this.data=void 0,this.inflightFetch=[],this.inflightSubscribe=null,this.pendingFetch=[],this.pendingSubscribe=[],this.subscribed=!1,this.wantSubscribe=!1,this._wantsDestroy=!1,this.inflightOp=null,this.pendingOps=[],this.type=null,this.applyStack=null,this.preventCompose=!1,this.submitSource=!1,this.paused=!1,this._dataStateVersion=0}s.mixin(g),g.prototype.destroy=function(S){this._wantsDestroy=!0;var P=this;P.whenNothingPending(function(){P.wantSubscribe?P.unsubscribe(function(k){if(k)return S?S(k):P.emit("error",k);P.connection._destroyDoc(P),S&&S()}):(P.connection._destroyDoc(P),S&&S())})},g.prototype._setType=function(S){if(typeof S=="string"&&(S=l.map[S]),S)this.type=S;else if(S===null)this.type=S,this._setData(void 0);else{var P=new a(m.ERR_DOC_TYPE_NOT_RECOGNIZED,"Missing type "+S);return this.emit("error",P)}},g.prototype._setData=function(S){this.data=S,this._dataStateVersion++},g.prototype.ingestSnapshot=function(S,P){if(!S)return P&&P();if(typeof S.v!="number"){var k=new a(m.ERR_INGESTED_SNAPSHOT_HAS_NO_VERSION,"Missing version in ingested snapshot. "+this.collection+"."+this.id);return P?P(k):this.emit("error",k)}if(this.type||this.hasWritePending()){if(this.version==null){if(this.hasWritePending())return P&&this.once("no write pending",P);var k=new a(m.ERR_DOC_MISSING_VERSION,"Cannot ingest snapshot in doc with null version. "+this.collection+"."+this.id);return P?P(k):this.emit("error",k)}return S.v>this.version?this.fetch(P):P&&P()}if(this.version>S.v)return P&&P();this.version=S.v;var x=S.type===void 0?l.defaultType:S.type;this._setType(x),this._setData(this.type&&this.type.deserialize?this.type.deserialize(S.data):S.data),this.emit("load"),P&&P()},g.prototype.whenNothingPending=function(S){var P=this;c.nextTick(function(){if(P.hasPending()){P.once("nothing pending",S);return}S()})},g.prototype.hasPending=function(){return!!(this.inflightOp||this.pendingOps.length||this.inflightFetch.length||this.inflightSubscribe||this.pendingFetch.length||this.pendingSubscribe.length)},g.prototype.hasWritePending=function(){return!!(this.inflightOp||this.pendingOps.length)},g.prototype._emitNothingPending=function(){this.hasWritePending()||(this.emit("no write pending"),!this.hasPending()&&this.emit("nothing pending"))},g.prototype._emitResponseError=function(S,P){if(S&&S.code===m.ERR_SNAPSHOT_READ_SILENT_REJECTION){this.wantSubscribe=!1,P&&P(),this._emitNothingPending();return}if(P){P(S),this._emitNothingPending();return}this._emitNothingPending(),this.emit("error",S)},g.prototype._handleFetch=function(S,P){var k=this.pendingFetch;this.pendingFetch=[];var x=this.inflightFetch.shift();if(x&&k.unshift(x),k.length&&(x=function(A){c.callEach(k,A)}),S)return this._emitResponseError(S,x);this.ingestSnapshot(P,x),this._emitNothingPending()},g.prototype._handleSubscribe=function(S,P){var k=this.inflightSubscribe;this.inflightSubscribe=null;var x=this.pendingFetch;this.pendingFetch=[],k.callback&&x.push(k.callback);var A;if(x.length&&(A=function(M){c.callEach(x,M)}),S)return this._emitResponseError(S,A);this.subscribed=k.wantSubscribe,this.subscribed?this.ingestSnapshot(P,A):A&&A(),this._emitNothingPending(),this._flushSubscribe()},g.prototype._handleOp=function(S,P){if(S)return S.code===m.ERR_NO_OP&&P.seq===this.inflightOp.seq?this.fetch(this._clearInflightOp.bind(this)):this.inflightOp?this._rollback(S):this.emit("error",S);if(this.inflightOp&&P.src===this.inflightOp.src&&P.seq===this.inflightOp.seq){this._opAcknowledged(P);return}if(this.version==null||P.v>this.version){this.fetch();return}if(!(P.v<this.version)){if(this.inflightOp){var k=b(this.inflightOp,P);if(k)return this._hardRollback(k)}for(var x=0;x<this.pendingOps.length;x++){var k=b(this.pendingOps[x],P);if(k)return this._hardRollback(k)}this.version++;try{this._otApply(P,!1)}catch(A){return this._hardRollback(A)}}},g.prototype._onConnectionStateChanged=function(){this.connection.canSend?(this.flush(),this._resubscribe()):(this.inflightOp&&(this.pendingOps.unshift(this.inflightOp),this.inflightOp=null),this.subscribed=!1,this.inflightSubscribe&&(this.inflightSubscribe.wantSubscribe?(this.pendingSubscribe.unshift(this.inflightSubscribe),this.inflightSubscribe=null):this._handleSubscribe()),this.inflightFetch.length&&(this.pendingFetch=this.pendingFetch.concat(this.inflightFetch),this.inflightFetch.length=0))},g.prototype._resubscribe=function(){if(!this.pendingSubscribe.length&&this.wantSubscribe)return this.subscribe();var S=this.pendingSubscribe.some(function(P){return P.wantSubscribe});!S&&this.pendingFetch.length&&this.fetch(),this._flushSubscribe()},g.prototype.fetch=function(S){this._fetch({},S)},g.prototype._fetch=function(S,P){this.pendingFetch.push(P);var k=this.connection.canSend&&(S.force||!this.inflightFetch.length);k&&(this.inflightFetch.push(this.pendingFetch.shift()),this.connection.sendFetch(this))},g.prototype.subscribe=function(S){var P=!0;this._queueSubscribe(P,S)},g.prototype.unsubscribe=function(S){var P=!1;this._queueSubscribe(P,S)},g.prototype._queueSubscribe=function(S,P){var k=this.pendingSubscribe[this.pendingSubscribe.length-1]||this.inflightSubscribe,x=k&&k.wantSubscribe===S;if(x){k.callback=O([k.callback,P]);return}this.pendingSubscribe.push({wantSubscribe:!!S,callback:P}),this._flushSubscribe()},g.prototype._flushSubscribe=function(){if(!(this.inflightSubscribe||!this.pendingSubscribe.length)){if(this.connection.canSend){this.inflightSubscribe=this.pendingSubscribe.shift(),this.wantSubscribe=this.inflightSubscribe.wantSubscribe,this.wantSubscribe?this.connection.sendSubscribe(this):(this.subscribed=!1,this.connection.sendUnsubscribe(this));return}if(!this.pendingSubscribe[0].wantSubscribe){this.inflightSubscribe=this.pendingSubscribe.shift();var S=this;c.nextTick(function(){S._handleSubscribe()})}}};function O(S){return S=S.filter(c.truthy),S.length?function(P){c.callEach(S,P)}:null}g.prototype.flush=function(){!this.connection.canSend||this.inflightOp||!this.paused&&this.pendingOps.length&&this._sendOp()};function y(S){delete S.op,delete S.create,delete S.del}function b(S,P){if(S.del)return y(P);if(P.del)return new a(m.ERR_DOC_WAS_DELETED,"Document was deleted");if(P.create)return new a(m.ERR_DOC_ALREADY_CREATED,"Document already created");if("op"in P){if(S.create)return new a(m.ERR_DOC_ALREADY_CREATED,"Document already created");if(S.type.transformX){var k=S.type.transformX(S.op,P.op);S.op=k[0],P.op=k[1]}else{var x=S.type.transform(S.op,P.op,"left"),A=S.type.transform(P.op,S.op,"right");S.op=x,P.op=A}}}g.prototype._otApply=function(S,P){if("op"in S){if(!this.type)throw new a(m.ERR_DOC_DOES_NOT_EXIST,"Cannot apply op to uncreated document. "+this.collection+"."+this.id);if(this.emit("before op batch",S.op,P),!P&&this.type===l.defaultType&&S.op.length>1){this.applyStack||(this.applyStack=[]);for(var k=this.applyStack.length,x=0;x<S.op.length;x++){var A=S.op[x],M={op:[A]};this.emit("before op",M.op,P,S.src);for(var Q=k;Q<this.applyStack.length;Q++){var _=b(this.applyStack[Q],M);if(_)return this._hardRollback(_)}this._setData(this.type.apply(this.data,M.op)),this.emit("op",M.op,P,S.src)}this.emit("op batch",S.op,P),this._popApplyStack(k);return}this.emit("before op",S.op,P,S.src),this._setData(this.type.apply(this.data,S.op)),this.emit("op",S.op,P,S.src),this.emit("op batch",S.op,P);return}if(S.create){this._setType(S.create.type),this.type.deserialize?this.type.createDeserialized?this._setData(this.type.createDeserialized(S.create.data)):this._setData(this.type.deserialize(this.type.create(S.create.data))):this._setData(this.type.create(S.create.data)),this.emit("create",P);return}if(S.del){var R=this.data;this._setType(null),this.emit("del",R,P);return}},g.prototype._sendOp=function(){if(this.connection.canSend){var S=this.connection.id;this.inflightOp||(this.inflightOp=this.pendingOps.shift());var P=this.inflightOp;if(!P){var k=new a(m.ERR_INFLIGHT_OP_MISSING,"No op to send on call to _sendOp");return this.emit("error",k)}if(P.sentAt=Date.now(),P.retries=P.retries==null?0:P.retries+1,P.seq==null){if(this.connection.seq>=c.MAX_SAFE_INTEGER)return this.emit("error",new a(m.ERR_CONNECTION_SEQ_INTEGER_OVERFLOW,"Connection seq has exceeded the max safe integer, maybe from being open for too long"));P.seq=this.connection.seq++}this.connection.sendOp(this,P),P.src==null&&(P.src=S)}},g.prototype._submit=function(S,P,k){if(P||(P=!0),"op"in S){if(!this.type){var x=new a(m.ERR_DOC_DOES_NOT_EXIST,"Cannot submit op. Document has not been created. "+this.collection+"."+this.id);return k?k(x):this.emit("error",x)}this.type.normalize&&(S.op=this.type.normalize(S.op))}try{this._pushOp(S,P,k),this._otApply(S,P)}catch(M){return this._hardRollback(M)}var A=this;c.nextTick(function(){A.flush()})},g.prototype._pushOp=function(S,P,k){if(S.source=P,this.applyStack)this.applyStack.push(S);else{var x=this._tryCompose(S);if(x){x.callbacks.push(k);return}}S.type=this.type,S.callbacks=[k],this.pendingOps.push(S)},g.prototype._popApplyStack=function(S){if(S>0){this.applyStack.length=S;return}var P=this.applyStack[0];if(this.applyStack=null,!!P){var k=this.pendingOps.indexOf(P);if(k!==-1)for(var x=this.pendingOps.splice(k),k=0;k<x.length;k++){var P=x[k],A=this._tryCompose(P);A?A.callbacks=A.callbacks.concat(P.callbacks):this.pendingOps.push(P)}}},g.prototype._tryCompose=function(S){if(!this.preventCompose){var P=this.pendingOps[this.pendingOps.length-1];if(!(!P||P.sentAt)&&!(this.submitSource&&!d(S.source,P.source))){if(P.create&&"op"in S)return P.create.data=this.type.apply(P.create.data,S.op),P;if("op"in P&&"op"in S&&this.type.compose)return P.op=this.type.compose(P.op,S.op),P}}},g.prototype.submitOp=function(S,P,k){typeof P=="function"&&(k=P,P=null);var x={op:S},A=P&&P.source;this._submit(x,A,k)},g.prototype.create=function(S,P,k,x){if(typeof P=="function"?(x=P,k=null,P=null):typeof k=="function"&&(x=k,k=null),P||(P=l.defaultType.uri),this.type){var A=new a(m.ERR_DOC_ALREADY_CREATED,"Document already exists");return x?x(A):this.emit("error",A)}var M={create:{type:P,data:S}},Q=k&&k.source;this._submit(M,Q,x)},g.prototype.del=function(S,P){if(typeof S=="function"&&(P=S,S=null),!this.type){var k=new a(m.ERR_DOC_DOES_NOT_EXIST,"Document does not exist");return P?P(k):this.emit("error",k)}var x={del:!0},A=S&&S.source;this._submit(x,A,P)},g.prototype.pause=function(){this.paused=!0},g.prototype.resume=function(){this.paused=!1,this.flush()},g.prototype.toSnapshot=function(){return{v:this.version,data:u(this.data),type:this.type.uri}},g.prototype._opAcknowledged=function(S){if(this.inflightOp.create)this.version=S.v;else if(S.v!==this.version)return o.warn("Invalid version from server. Expected: "+this.version+" Received: "+S.v,S),this.fetch();if(S[h.fixup])for(var P=0;P<S[h.fixup].length;P++){for(var k=S[h.fixup][P],x=0;x<this.pendingOps.length;x++){var A=b(this.pendingOps[P],k);if(A)return this._hardRollback(A)}try{this._otApply(k,!1)}catch(M){return this._hardRollback(M)}}this.version++,this._clearInflightOp()},g.prototype._rollback=function(S){var P=this.inflightOp;if(!("op"in P&&P.type.invert))return this._hardRollback(S);try{P.op=P.type.invert(P.op)}catch{return this._hardRollback(S)}for(var k=0;k<this.pendingOps.length;k++){var x=b(this.pendingOps[k],P);if(x)return this._hardRollback(x)}try{this._otApply(P,!1)}catch(A){return this._hardRollback(A)}if(S.code===m.ERR_OP_SUBMIT_REJECTED)return this._clearInflightOp(null);this._clearInflightOp(S)},g.prototype._hardRollback=function(S){var P=this.pendingOps,k=this.inflightOp;this._setType(null),this.version=null,this.inflightOp=null,this.pendingOps=[];var x=this;this._fetch({force:!0},function(A){if(A&&(o.error("Hard rollback doc fetch failed.",A,k),x.emit("error",new a(m.ERR_HARD_ROLLBACK_FETCH_FAILED,"Hard rollback fetch failed: "+A.message))),S.code===m.ERR_OP_SUBMIT_REJECTED){if(k&&(c.callEach(k.callbacks),k=null),!P.length)return;S=new a(m.ERR_PENDING_OP_REMOVED_BY_OP_SUBMIT_REJECTED,"Discarding pending op because of hard rollback during ERR_OP_SUBMIT_REJECTED")}k&&P.unshift(k);for(var M=!!P.length,Q=0;Q<P.length;Q++)M=c.callEach(P[Q].callbacks,S)&&M;S&&!M&&x.emit("error",S)})},g.prototype._clearInflightOp=function(S){var P=this.inflightOp;this.inflightOp=null;var k=c.callEach(P.callbacks,S);if(this.flush(),this._emitNothingPending(),S&&!k)return this.emit("error",S)}},{"../emitter":41,"../error":42,"../logger":43,"../message-actions":45,"../types":50,"../util":51,"fast-deep-equal":6}],29:[function(t,r,i){i.Connection=t("./connection"),i.Doc=t("./doc"),i.Error=t("../error"),i.Query=t("./query"),i.types=t("../types"),i.logger=t("../logger")},{"../error":42,"../logger":43,"../types":50,"./connection":27,"./doc":28,"./query":37}],30:[function(t,r,i){var s=t("../../util"),o=t("events").EventEmitter,a=["create","del","destroy","load","op"];r.exports=l;function l(){this._docs=Object.create(null),this._forwarders=Object.create(null),this._emitters=Object.create(null)}l.prototype.addEventListener=function(c,u,d){this._registerDoc(c);var h=s.dig(this._emitters,c.collection,c.id);h.on(u,d)},l.prototype.removeEventListener=function(c,u,d){var h=s.dig(this._emitters,c.collection,c.id);h&&(h.off(u,d),h._eventsCount===1&&this._unregisterDoc(c))},l.prototype._registerDoc=function(c){var u=!0;if(s.digOrCreate(this._docs,c.collection,c.id,function(){return u=!1,c}),!u){var d=s.digOrCreate(this._emitters,c.collection,c.id,function(){var m=new o;return m.setMaxListeners(1e3),m}),h=this;a.forEach(function(m){var g=s.digOrCreate(h._forwarders,c.collection,c.id,m,function(){return d.emit.bind(d,m)});c.on(m,g)}),this.addEventListener(c,"destroy",this._unregisterDoc.bind(this,c))}},l.prototype._unregisterDoc=function(c){var u=s.dig(this._forwarders,c.collection,c.id);for(var d in u)c.off(d,u[d]);var h=s.dig(this._emitters,c.collection,c.id);h.removeAllListeners(),s.digAndRemove(this._forwarders,c.collection,c.id),s.digAndRemove(this._emitters,c.collection,c.id),s.digAndRemove(this._docs,c.collection,c.id)}},{"../../util":51,events:5}],31:[function(t,r,i){var s=t("./presence"),o=t("./local-doc-presence"),a=t("./remote-doc-presence");function l(c,u,d){var h=l.channel(u,d);s.call(this,c,h),this.collection=u,this.id=d}r.exports=l,l.prototype=Object.create(s.prototype),l.channel=function(c,u){return c+"."+u},l.prototype._createLocalPresence=function(c){return new o(this,c)},l.prototype._createRemotePresence=function(c){return new a(this,c)}},{"./local-doc-presence":32,"./presence":34,"./remote-doc-presence":35}],32:[function(t,r,i){var s=t("./local-presence"),o=t("../../error"),a=t("../../util"),l=o.CODES;r.exports=c;function c(u,d){s.call(this,u,d),this.collection=this.presence.collection,this.id=this.presence.id,this._doc=this.connection.get(this.collection,this.id),this._emitter=this.connection._docPresenceEmitter,this._isSending=!1,this._docDataVersionByPresenceVersion=Object.create(null),this._opHandler=this._transformAgainstOp.bind(this),this._createOrDelHandler=this._handleCreateOrDel.bind(this),this._loadHandler=this._handleLoad.bind(this),this._destroyHandler=this.destroy.bind(this),this._registerWithDoc()}c.prototype=Object.create(s.prototype),c.prototype.submit=function(u,d){if(!this._doc.type){if(u===null)return this._callbackOrEmit(null,d);var h={code:l.ERR_DOC_DOES_NOT_EXIST,message:"Cannot submit presence. Document has not been created"};return this._callbackOrEmit(h,d)}this._docDataVersionByPresenceVersion[this.presenceVersion]=this._doc._dataStateVersion,s.prototype.submit.call(this,u,d)},c.prototype.destroy=function(u){this._emitter.removeEventListener(this._doc,"op",this._opHandler),this._emitter.removeEventListener(this._doc,"create",this._createOrDelHandler),this._emitter.removeEventListener(this._doc,"del",this._createOrDelHandler),this._emitter.removeEventListener(this._doc,"load",this._loadHandler),this._emitter.removeEventListener(this._doc,"destroy",this._destroyHandler),s.prototype.destroy.call(this,u)},c.prototype._sendPending=function(){if(!this._isSending){this._isSending=!0;var u=this;this._doc.whenNothingPending(function(){u._isSending=!1,u.connection.canSend&&(u._pendingMessages.forEach(function(d){d.t=u._doc.type.uri,d.v=u._doc.version,u.connection.send(d)}),u._pendingMessages=[],u._docDataVersionByPresenceVersion=Object.create(null))})}},c.prototype._registerWithDoc=function(){this._emitter.addEventListener(this._doc,"op",this._opHandler),this._emitter.addEventListener(this._doc,"create",this._createOrDelHandler),this._emitter.addEventListener(this._doc,"del",this._createOrDelHandler),this._emitter.addEventListener(this._doc,"load",this._loadHandler),this._emitter.addEventListener(this._doc,"destroy",this._destroyHandler)},c.prototype._transformAgainstOp=function(u,d){var h=this,m=this._doc._dataStateVersion;this._pendingMessages.forEach(function(g){var O=h._docDataVersionByPresenceVersion[g.pv];if(!(O>=m))try{g.p=h._transformPresence(g.p,u,d),h._docDataVersionByPresenceVersion[g.pv]=m}catch(b){var y=h._getCallback(g.pv);h._callbackOrEmit(b,y)}});try{this.value=this._transformPresence(this.value,u,d)}catch(g){this.emit("error",g)}},c.prototype._handleCreateOrDel=function(){this._pendingMessages.forEach(function(u){u.p=null}),this.value=null},c.prototype._handleLoad=function(){this.value=null,this._pendingMessages=[],this._docDataVersionByPresenceVersion=Object.create(null)},c.prototype._message=function(){var u=s.prototype._message.call(this);return u.c=this.collection,u.d=this.id,u.v=null,u.t=null,u},c.prototype._transformPresence=function(u,d,h){var m=this._doc.type;if(!a.supportsPresence(m))throw new o(l.ERR_TYPE_DOES_NOT_SUPPORT_PRESENCE,"Type does not support presence: "+m.name);return m.transformPresence(u,d,h)}},{"../../error":42,"../../util":51,"./local-presence":33}],33:[function(t,r,i){var s=t("../../emitter"),o=t("../../message-actions").ACTIONS,a=t("../../util");r.exports=l;function l(c,u){if(s.EventEmitter.call(this),!u||typeof u!="string")throw new Error("LocalPresence presenceId must be a string");this.presence=c,this.presenceId=u,this.connection=c.connection,this.presenceVersion=0,this.value=null,this._pendingMessages=[],this._callbacksByPresenceVersion=Object.create(null)}s.mixin(l),l.prototype.submit=function(c,u){this.value=c,this.send(u)},l.prototype.send=function(c){var u=this._message();this._pendingMessages.push(u),this._callbacksByPresenceVersion[u.pv]=c,this._sendPending()},l.prototype.destroy=function(c){var u=this;this.submit(null,function(d){if(d)return u._callbackOrEmit(d,c);delete u.presence.localPresences[u.presenceId],c&&c()})},l.prototype._sendPending=function(){if(this.connection.canSend){var c=this;this._pendingMessages.forEach(function(u){c.connection.send(u)}),this._pendingMessages=[]}},l.prototype._ack=function(c,u){var d=this._getCallback(u);this._callbackOrEmit(c,d)},l.prototype._message=function(){return{a:o.presence,ch:this.presence.channel,id:this.presenceId,p:this.value,pv:this.presenceVersion++}},l.prototype._getCallback=function(c){var u=this._callbacksByPresenceVersion[c];return delete this._callbacksByPresenceVersion[c],u},l.prototype._callbackOrEmit=function(c,u){if(u)return a.nextTick(u,c);c&&this.emit("error",c)}},{"../../emitter":41,"../../message-actions":45,"../../util":51}],34:[function(t,r,i){var s=t("../../emitter"),o=t("./local-presence"),a=t("./remote-presence"),l=t("../../util"),c=t("async"),u=t("hat"),d=t("../../message-actions").ACTIONS;r.exports=h;function h(m,g){if(s.EventEmitter.call(this),!g||typeof g!="string")throw new Error("Presence channel must be provided");this.connection=m,this.channel=g,this.wantSubscribe=!1,this.subscribed=!1,this.remotePresences=Object.create(null),this.localPresences=Object.create(null),this._remotePresenceInstances=Object.create(null),this._subscriptionCallbacksBySeq=Object.create(null),this._wantsDestroy=!1}s.mixin(h),h.prototype.subscribe=function(m){this._sendSubscriptionAction(!0,m)},h.prototype.unsubscribe=function(m){this._sendSubscriptionAction(!1,m)},h.prototype.create=function(m){if(this._wantsDestroy)throw new Error("Presence is being destroyed");m=m||u();var g=this._createLocalPresence(m);return this.localPresences[m]=g,g},h.prototype.destroy=function(m){this._wantsDestroy=!0;var g=this,O=Object.keys(g.localPresences);this.unsubscribe(function(y){if(y)return g._callbackOrEmit(y,m);var b=Object.keys(g._remotePresenceInstances);c.parallel([function(S){c.each(O,function(P,k){var x=g.localPresences[P];if(!x)return k();x.destroy(k)},S)},function(S){if(!g._wantsDestroy)return S();c.each(b,function(P,k){g._remotePresenceInstances[P].destroy(k)},S)}],function(S){g._wantsDestroy&&delete g.connection._presences[g.channel],g._callbackOrEmit(S,m)})})},h.prototype._sendSubscriptionAction=function(m,g){if(m=!!m,m===this.wantSubscribe){if(!g)return;if(m===this.subscribed)return l.nextTick(g);if(Object.keys(this._subscriptionCallbacksBySeq).length)return this._combineSubscribeCallbackWithLastAdded(g)}this.wantSubscribe=m;var O=this.wantSubscribe?d.presenceSubscribe:d.presenceUnsubscribe,y=this.connection._presenceSeq++;this._subscriptionCallbacksBySeq[y]=g,this.connection.canSend&&this.connection._sendPresenceAction(O,y,this)},h.prototype._requestRemotePresence=function(){this.connection._requestRemotePresence(this.channel)},h.prototype._handleSubscribe=function(m,g){this.wantSubscribe&&(this.subscribed=!0);var O=this._subscriptionCallback(g);this._callbackOrEmit(m,O)},h.prototype._handleUnsubscribe=function(m,g){this.subscribed=!1;var O=this._subscriptionCallback(g);this._callbackOrEmit(m,O)},h.prototype._receiveUpdate=function(m,g){var O=l.dig(this.localPresences,g.id);if(O)return O._ack(m,g.pv);if(m)return this.emit("error",m);var y=this,b=l.digOrCreate(this._remotePresenceInstances,g.id,function(){return y._createRemotePresence(g.id)});b.receiveUpdate(g)},h.prototype._updateRemotePresence=function(m){this.remotePresences[m.presenceId]=m.value,m.value===null&&this._removeRemotePresence(m.presenceId),this.emit("receive",m.presenceId,m.value)},h.prototype._broadcastAllLocalPresence=function(m){if(m)return this.emit("error",m);for(var g in this.localPresences){var O=this.localPresences[g];O.value!==null&&O.send()}},h.prototype._removeRemotePresence=function(m){this._remotePresenceInstances[m].destroy(),delete this._remotePresenceInstances[m],delete this.remotePresences[m]},h.prototype._onConnectionStateChanged=function(){if(!this.connection.canSend){this.subscribed=!1;return}this._resubscribe();for(var m in this.localPresences)this.localPresences[m]._sendPending()},h.prototype._resubscribe=function(){var m=[];for(var g in this._subscriptionCallbacksBySeq){var O=this._subscriptionCallback(g);m.push(O)}if(!this.wantSubscribe)return this._callEachOrEmit(m);var y=this;this.subscribe(function(b){y._callEachOrEmit(m,b)})},h.prototype._subscriptionCallback=function(m){var g=this._subscriptionCallbacksBySeq[m];return delete this._subscriptionCallbacksBySeq[m],g},h.prototype._callbackOrEmit=function(m,g){if(g)return l.nextTick(g,m);m&&this.emit("error",m)},h.prototype._createLocalPresence=function(m){return new o(this,m)},h.prototype._createRemotePresence=function(m){return new a(this,m)},h.prototype._callEachOrEmit=function(m,g){var O=l.callEach(m,g);!O&&g&&this.emit("error",g)},h.prototype._combineSubscribeCallbackWithLastAdded=function(m){var g=Object.keys(this._subscriptionCallbacksBySeq),O=g[g.length-1],y=this._subscriptionCallbacksBySeq[O];if(!y)return this._subscriptionCallbacksBySeq[O]=m;this._subscriptionCallbacksBySeq[O]=function(b){y(b),m(b)}}},{"../../emitter":41,"../../message-actions":45,"../../util":51,"./local-presence":33,"./remote-presence":36,async:1,hat:16}],35:[function(t,r,i){var s=t("./remote-presence"),o=t("../../ot");r.exports=a;function a(l,c){s.call(this,l,c),this.collection=this.presence.collection,this.id=this.presence.id,this.src=null,this.presenceVersion=null,this._doc=this.connection.get(this.collection,this.id),this._emitter=this.connection._docPresenceEmitter,this._pending=null,this._opCache=null,this._pendingSetPending=!1,this._opHandler=this._handleOp.bind(this),this._createDelHandler=this._handleCreateDel.bind(this),this._loadHandler=this._handleLoad.bind(this),this._registerWithDoc()}a.prototype=Object.create(s.prototype),a.prototype.receiveUpdate=function(l){this._pending&&l.pv<this._pending.pv||(this.src=l.src,this._pending=l,this._setPendingPresence())},a.prototype.destroy=function(l){this._emitter.removeEventListener(this._doc,"op",this._opHandler),this._emitter.removeEventListener(this._doc,"create",this._createDelHandler),this._emitter.removeEventListener(this._doc,"del",this._createDelHandler),this._emitter.removeEventListener(this._doc,"load",this._loadHandler),s.prototype.destroy.call(this,l)},a.prototype._registerWithDoc=function(){this._emitter.addEventListener(this._doc,"op",this._opHandler),this._emitter.addEventListener(this._doc,"create",this._createDelHandler),this._emitter.addEventListener(this._doc,"del",this._createDelHandler),this._emitter.addEventListener(this._doc,"load",this._loadHandler)},a.prototype._setPendingPresence=function(){if(!this._pendingSetPending){this._pendingSetPending=!0;var l=this;this._doc.whenNothingPending(function(){if(l._pendingSetPending=!1,!!l._pending){if(l._pending.pv<l.presenceVersion)return l._pending=null;if(l._pending.v>l._doc.version)return l._doc.fetch();l._catchUpStalePresence()&&(l.value=l._pending.p,l.presenceVersion=l._pending.pv,l._pending=null,l.presence._updateRemotePresence(l))}})}},a.prototype._handleOp=function(l,c,u){var d=u===this.src;this._transformAgainstOp(l,d),this._cacheOp(l,d),this._setPendingPresence()},s.prototype._handleCreateDel=function(){this._cacheOp(null),this._setPendingPresence()},s.prototype._handleLoad=function(){this.value=null,this._pending=null,this._opCache=null,this.presence._updateRemotePresence(this)},a.prototype._transformAgainstOp=function(l,c){if(this.value){try{this.value=this._doc.type.transformPresence(this.value,l,c)}catch(u){return this.presence.emit("error",u)}this.presence._updateRemotePresence(this)}},a.prototype._catchUpStalePresence=function(){if(this._pending.v>=this._doc.version)return!0;if(!this._opCache)return this._startCachingOps(),this._doc.fetch(),this.presence._requestRemotePresence(),!1;for(;this._opCache[this._pending.v];){var l=this._opCache[this._pending.v],c=l.op,u=l.isOwnOp;c===null?(this._pending.p=null,this._pending.v++):o.transformPresence(this._pending,c,u)}var d=this._pending.v>=this._doc.version;return d&&this._stopCachingOps(),d},a.prototype._startCachingOps=function(){this._opCache=[]},a.prototype._stopCachingOps=function(){this._opCache=null},a.prototype._cacheOp=function(l,c){this._opCache&&(l=l?{op:l}:null,this._opCache[this._doc.version-1]={op:l,isOwnOp:c})}},{"../../ot":47,"./remote-presence":36}],36:[function(t,r,i){var s=t("../../util");r.exports=o;function o(a,l){this.presence=a,this.presenceId=l,this.connection=this.presence.connection,this.value=null,this.presenceVersion=0}o.prototype.receiveUpdate=function(a){a.pv<this.presenceVersion||(this.value=a.p,this.presenceVersion=a.pv,this.presence._updateRemotePresence(this))},o.prototype.destroy=function(a){delete this.presence._remotePresenceInstances[this.presenceId],delete this.presence.remotePresences[this.presenceId],a&&s.nextTick(a)}},{"../../util":51}],37:[function(t,r,i){var s=t("../emitter"),o=t("../message-actions").ACTIONS,a=t("../util");r.exports=l;function l(c,u,d,h,m,g,O){s.EventEmitter.call(this),this.action=c,this.connection=u,this.id=d,this.collection=h,this.query=m,this.results=null,g&&g.results&&(this.results=g.results,delete g.results),this.extra=void 0,this.options=g,this.callback=O,this.ready=!1,this.sent=!1}s.mixin(l),l.prototype.hasPending=function(){return!this.ready},l.prototype.send=function(){if(this.connection.canSend){var c={a:this.action,id:this.id,c:this.collection,q:this.query};if(this.options&&(c.o=this.options),this.results){for(var u=[],d=0;d<this.results.length;d++){var h=this.results[d];u.push([h.id,h.version])}c.r=u}this.connection.send(c),this.sent=!0}},l.prototype.destroy=function(c){this.connection.canSend&&this.action===o.querySubscribe&&this.connection.send({a:o.queryUnsubscribe,id:this.id}),this.connection._destroyQuery(this),c&&a.nextTick(c)},l.prototype._onConnectionStateChanged=function(){this.connection.canSend&&!this.sent?this.send():this.sent=!1},l.prototype._handleFetch=function(c,u,d){this.connection._destroyQuery(this),this._handleResponse(c,u,d)},l.prototype._handleSubscribe=function(c,u,d){this._handleResponse(c,u,d)},l.prototype._handleResponse=function(c,u,d){var h=this.callback;if(this.callback=null,c)return this._finishResponse(c,h);if(!u)return this._finishResponse(null,h);var m=this,g=1,O=function(P){if(P)return m._finishResponse(P,h);--g||m._finishResponse(null,h)};if(Array.isArray(u))g+=u.length,this.results=this._ingestSnapshots(u,O),this.extra=d;else for(var y in u){g++;var b=u[y],S=this.connection.get(b.c||this.collection,y);S.ingestSnapshot(b,O)}O()},l.prototype._ingestSnapshots=function(c,u){for(var d=[],h=0;h<c.length;h++){var m=c[h],g=this.connection.get(m.c||this.collection,m.d);g.ingestSnapshot(m,u),d.push(g)}return d},l.prototype._finishResponse=function(c,u){if(this.emit("ready"),this.ready=!0,c)return this.connection._destroyQuery(this),u?u(c):this.emit("error",c);u&&u(null,this.results,this.extra)},l.prototype._handleError=function(c){this.emit("error",c)},l.prototype._handleDiff=function(c){for(var u=0;u<c.length;u++){var d=c[u];d.type==="insert"&&(d.values=this._ingestSnapshots(d.values))}for(var u=0;u<c.length;u++){var d=c[u];switch(d.type){case"insert":var h=d.values;Array.prototype.splice.apply(this.results,[d.index,0].concat(h)),this.emit("insert",h,d.index);break;case"remove":var g=d.howMany||1,m=this.results.splice(d.index,g);this.emit("remove",m,d.index);break;case"move":var g=d.howMany||1,O=this.results.splice(d.from,g);Array.prototype.splice.apply(this.results,[d.to,0].concat(O)),this.emit("move",O,d.from,d.to);break}}this.emit("changed",this.results)},l.prototype._handleExtra=function(c){this.extra=c,this.emit("extra",c)}},{"../emitter":41,"../message-actions":45,"../util":51}],38:[function(t,r,i){var s=t("../../snapshot"),o=t("../../emitter");r.exports=a;function a(l,c,u,d,h){if(o.EventEmitter.call(this),typeof h!="function")throw new Error("Callback is required for SnapshotRequest");this.requestId=c,this.connection=l,this.id=d,this.collection=u,this.callback=h,this.sent=!1}o.mixin(a),a.prototype.send=function(){this.connection.canSend&&(this.connection.send(this._message()),this.sent=!0)},a.prototype._onConnectionStateChanged=function(){this.connection.canSend?this.sent||this.send():this.sent=!1},a.prototype._handleResponse=function(l,c){if(this.emit("ready"),l)return this.callback(l);var u=c.meta?c.meta:null,d=new s(this.id,c.v,c.type,c.data,u);this.callback(null,d)}},{"../../emitter":41,"../../snapshot":49}],39:[function(t,r,i){var s=t("./snapshot-request"),o=t("../../util"),a=t("../../message-actions").ACTIONS;r.exports=l;function l(c,u,d,h,m,g){if(s.call(this,c,u,d,h,g),!o.isValidTimestamp(m))throw new Error("Snapshot timestamp must be a positive integer or null");this.timestamp=m}l.prototype=Object.create(s.prototype),l.prototype._message=function(){return{a:a.snapshotFetchByTimestamp,id:this.requestId,c:this.collection,d:this.id,ts:this.timestamp}}},{"../../message-actions":45,"../../util":51,"./snapshot-request":38}],40:[function(t,r,i){var s=t("./snapshot-request"),o=t("../../util"),a=t("../../message-actions").ACTIONS;r.exports=l;function l(c,u,d,h,m,g){if(s.call(this,c,u,d,h,g),!o.isValidVersion(m))throw new Error("Snapshot version must be a positive integer or null");this.version=m}l.prototype=Object.create(s.prototype),l.prototype._message=function(){return{a:a.snapshotFetch,id:this.requestId,c:this.collection,d:this.id,v:this.version}}},{"../../message-actions":45,"../../util":51,"./snapshot-request":38}],41:[function(t,r,i){var s=t("events").EventEmitter;i.EventEmitter=s,i.mixin=o;function o(a){for(var l in s.prototype)a.prototype[l]=s.prototype[l]}},{events:5}],42:[function(t,r,i){function s(o,a){this.code=o,this.message=a||"",Error.captureStackTrace?Error.captureStackTrace(this,s):this.stack=new Error().stack}s.prototype=Object.create(Error.prototype),s.prototype.constructor=s,s.prototype.name="ShareDBError",s.CODES={ERR_APPLY_OP_VERSION_DOES_NOT_MATCH_SNAPSHOT:"ERR_APPLY_OP_VERSION_DOES_NOT_MATCH_SNAPSHOT",ERR_APPLY_SNAPSHOT_NOT_PROVIDED:"ERR_APPLY_SNAPSHOT_NOT_PROVIDED",ERR_FIXUP_IS_ONLY_VALID_ON_APPLY:"ERR_FIXUP_IS_ONLY_VALID_ON_APPLY",ERR_CANNOT_FIXUP_DELETION:"ERR_CANNOT_FIXUP_DELETION",ERR_CLIENT_ID_BADLY_FORMED:"ERR_CLIENT_ID_BADLY_FORMED",ERR_CANNOT_PING_OFFLINE:"ERR_CANNOT_PING_OFFLINE",ERR_CONNECTION_SEQ_INTEGER_OVERFLOW:"ERR_CONNECTION_SEQ_INTEGER_OVERFLOW",ERR_CONNECTION_STATE_TRANSITION_INVALID:"ERR_CONNECTION_STATE_TRANSITION_INVALID",ERR_DATABASE_ADAPTER_NOT_FOUND:"ERR_DATABASE_ADAPTER_NOT_FOUND",ERR_DATABASE_DOES_NOT_SUPPORT_SUBSCRIBE:"ERR_DATABASE_DOES_NOT_SUPPORT_SUBSCRIBE",ERR_DATABASE_METHOD_NOT_IMPLEMENTED:"ERR_DATABASE_METHOD_NOT_IMPLEMENTED",ERR_DEFAULT_TYPE_MISMATCH:"ERR_DEFAULT_TYPE_MISMATCH",ERR_DOC_MISSING_VERSION:"ERR_DOC_MISSING_VERSION",ERR_DOC_ALREADY_CREATED:"ERR_DOC_ALREADY_CREATED",ERR_DOC_DOES_NOT_EXIST:"ERR_DOC_DOES_NOT_EXIST",ERR_DOC_TYPE_NOT_RECOGNIZED:"ERR_DOC_TYPE_NOT_RECOGNIZED",ERR_DOC_WAS_DELETED:"ERR_DOC_WAS_DELETED",ERR_INFLIGHT_OP_MISSING:"ERR_INFLIGHT_OP_MISSING",ERR_INGESTED_SNAPSHOT_HAS_NO_VERSION:"ERR_INGESTED_SNAPSHOT_HAS_NO_VERSION",ERR_MAX_SUBMIT_RETRIES_EXCEEDED:"ERR_MAX_SUBMIT_RETRIES_EXCEEDED",ERR_MESSAGE_BADLY_FORMED:"ERR_MESSAGE_BADLY_FORMED",ERR_MILESTONE_ARGUMENT_INVALID:"ERR_MILESTONE_ARGUMENT_INVALID",ERR_NO_OP:"ERR_NO_OP",ERR_OP_ALREADY_SUBMITTED:"ERR_OP_ALREADY_SUBMITTED",ERR_OP_NOT_ALLOWED_IN_PROJECTION:"ERR_OP_NOT_ALLOWED_IN_PROJECTION",ERR_OP_SUBMIT_REJECTED:"ERR_OP_SUBMIT_REJECTED",ERR_PENDING_OP_REMOVED_BY_OP_SUBMIT_REJECTED:"ERR_PENDING_OP_REMOVED_BY_OP_SUBMIT_REJECTED",ERR_HARD_ROLLBACK_FETCH_FAILED:"ERR_HARD_ROLLBACK_FETCH_FAILED",ERR_OP_VERSION_MISMATCH_AFTER_TRANSFORM:"ERR_OP_VERSION_MISMATCH_AFTER_TRANSFORM",ERR_OP_VERSION_MISMATCH_DURING_TRANSFORM:"ERR_OP_VERSION_MISMATCH_DURING_TRANSFORM",ERR_OP_VERSION_NEWER_THAN_CURRENT_SNAPSHOT:"ERR_OP_VERSION_NEWER_THAN_CURRENT_SNAPSHOT",ERR_OT_LEGACY_JSON0_OP_CANNOT_BE_NORMALIZED:"ERR_OT_LEGACY_JSON0_OP_CANNOT_BE_NORMALIZED",ERR_OT_OP_BADLY_FORMED:"ERR_OT_OP_BADLY_FORMED",ERR_OT_OP_NOT_APPLIED:"ERR_OT_OP_NOT_APPLIED",ERR_OT_OP_NOT_PROVIDED:"ERR_OT_OP_NOT_PROVIDED",ERR_PRESENCE_TRANSFORM_FAILED:"ERR_PRESENCE_TRANSFORM_FAILED",ERR_PROTOCOL_VERSION_NOT_SUPPORTED:"ERR_PROTOCOL_VERSION_NOT_SUPPORTED",ERR_QUERY_CHANNEL_MISSING:"ERR_QUERY_CHANNEL_MISSING",ERR_QUERY_EMITTER_LISTENER_NOT_ASSIGNED:"ERR_QUERY_EMITTER_LISTENER_NOT_ASSIGNED",ERR_SNAPSHOT_READ_SILENT_REJECTION:"ERR_SNAPSHOT_READ_SILENT_REJECTION",ERR_SNAPSHOT_READS_REJECTED:"ERR_SNAPSHOT_READS_REJECTED",ERR_SUBMIT_TRANSFORM_OPS_NOT_FOUND:"ERR_SUBMIT_TRANSFORM_OPS_NOT_FOUND",ERR_TYPE_CANNOT_BE_PROJECTED:"ERR_TYPE_CANNOT_BE_PROJECTED",ERR_TYPE_DOES_NOT_SUPPORT_COMPOSE:"ERR_TYPE_DOES_NOT_SUPPORT_COMPOSE",ERR_TYPE_DOES_NOT_SUPPORT_PRESENCE:"ERR_TYPE_DOES_NOT_SUPPORT_PRESENCE",ERR_UNKNOWN_ERROR:"ERR_UNKNOWN_ERROR"},r.exports=s},{}],43:[function(t,r,i){var s=t("./logger"),o=new s;r.exports=o},{"./logger":44}],44:[function(t,r,i){var s=["info","warn","error"];function o(){var a=Object.create(null);s.forEach(function(l){a[l]=console[l].bind(console)}),this.setMethods(a)}r.exports=o,o.prototype.setMethods=function(a){a=a||{};var l=this;s.forEach(function(c){typeof a[c]=="function"&&(l[c]=a[c])})}},{}],45:[function(t,r,i){i.ACTIONS={initLegacy:"init",handshake:"hs",queryFetch:"qf",querySubscribe:"qs",queryUnsubscribe:"qu",queryUpdate:"q",bulkFetch:"bf",bulkSubscribe:"bs",bulkUnsubscribe:"bu",fetch:"f",fixup:"fixup",subscribe:"s",unsubscribe:"u",op:"op",snapshotFetch:"nf",snapshotFetchByTimestamp:"nt",pingPong:"pp",presence:"p",presenceSubscribe:"ps",presenceUnsubscribe:"pu",presenceRequest:"pr"}},{}],46:[function(t,r,i){i.messageChannel=function(){var o=s(arguments),a=new MessageChannel;a.port1.onmessage=function(){o(),a.port1.close()},a.port2.postMessage("")},i.setTimeout=function(){var o=s(arguments);setTimeout(o)};function s(o){for(var a=o[0],l=[],c=1;c<o.length;c++)l[c-1]=o[c];return function(){a.apply(null,l)}}},{}],47:[function(t,r,i){var s=t("./types"),o=t("./error"),a=t("./util"),l=o.CODES;i.checkOp=function(d){if(d==null||typeof d!="object")return new o(l.ERR_OT_OP_BADLY_FORMED,"Op must be an object");if(d.create!=null){if(typeof d.create!="object")return new o(l.ERR_OT_OP_BADLY_FORMED,"Create data must be an object");var h=d.create.type;if(typeof h!="string")return new o(l.ERR_OT_OP_BADLY_FORMED,"Missing create type");var m=s.map[h];if(m==null||typeof m!="object")return new o(l.ERR_DOC_TYPE_NOT_RECOGNIZED,"Unknown type")}else if(d.del!=null){if(d.del!==!0)return new o(l.ERR_OT_OP_BADLY_FORMED,"del value must be true")}else if(!("op"in d))return new o(l.ERR_OT_OP_BADLY_FORMED,"Missing op, create, or del");if(d.src!=null&&typeof d.src!="string")return new o(l.ERR_OT_OP_BADLY_FORMED,"src must be a string");if(d.seq!=null&&typeof d.seq!="number")return new o(l.ERR_OT_OP_BADLY_FORMED,"seq must be a number");if(d.src==null&&d.seq!=null||d.src!=null&&d.seq==null)return new o(l.ERR_OT_OP_BADLY_FORMED,"Both src and seq must be set together");if(d.m!=null&&typeof d.m!="object")return new o(l.ERR_OT_OP_BADLY_FORMED,"op.m must be an object or null")},i.normalizeType=function(d){return s.map[d]&&s.map[d].uri},i.apply=function(d,h){if(typeof d!="object")return new o(l.ERR_APPLY_SNAPSHOT_NOT_PROVIDED,"Missing snapshot");if(d.v!=null&&h.v!=null&&d.v!==h.v)return new o(l.ERR_APPLY_OP_VERSION_DOES_NOT_MATCH_SNAPSHOT,"Version mismatch");if(h.create){if(d.type)return new o(l.ERR_DOC_ALREADY_CREATED,"Document already exists");var m=h.create,g=s.map[m.type];if(!g)return new o(l.ERR_DOC_TYPE_NOT_RECOGNIZED,"Unknown type");try{d.data=g.create(m.data),d.type=g.uri,d.v++}catch(y){return y}}else if(h.del)d.data=void 0,d.type=null,d.v++;else if("op"in h){var O=c(d,h.op);if(O)return O;d.v++}else d.v++};function c(d,h){if(!d.type)return new o(l.ERR_DOC_DOES_NOT_EXIST,"Document does not exist");if(h===void 0)return new o(l.ERR_OT_OP_NOT_PROVIDED,"Missing op");var m=s.map[d.type];if(!m)return new o(l.ERR_DOC_TYPE_NOT_RECOGNIZED,"Unknown type");if(m.name==="json0"&&Array.isArray(h))for(var g=0;g<h.length;g++){var O=h[g];if(Array.isArray(O.p))for(var y=0;y<O.p.length;y++){var b=O.p[y];if(a.isDangerousProperty(b))return new o(l.ERR_OT_OP_NOT_APPLIED,"Invalid path segment")}}try{d.data=m.apply(d.data,h)}catch(S){return new o(l.ERR_OT_OP_NOT_APPLIED,S.message)}}i.transform=function(d,h,m){if(h.v!=null&&h.v!==m.v)return new o(l.ERR_OP_VERSION_MISMATCH_DURING_TRANSFORM,"Version mismatch");if(m.del){if(h.create||"op"in h)return new o(l.ERR_DOC_WAS_DELETED,"Document was deleted")}else{if(m.create&&("op"in h||h.create||h.del)||"op"in m&&h.create)return new o(l.ERR_DOC_ALREADY_CREATED,"Document was created remotely");if("op"in m&&"op"in h){if(!d)return new o(l.ERR_DOC_DOES_NOT_EXIST,"Document does not exist");if(typeof d=="string"&&(d=s.map[d],!d))return new o(l.ERR_DOC_TYPE_NOT_RECOGNIZED,"Unknown type");try{h.op=d.transform(h.op,m.op,"left")}catch(g){return g}}}h.v!=null&&h.v++},i.applyOps=function(d,h,m){m=m||{};for(var g=0;g<h.length;g++){var O=h[g];if(m._normalizeLegacyJson0Ops)try{u(d,O)}catch{return new o(l.ERR_OT_LEGACY_JSON0_OP_CANNOT_BE_NORMALIZED,"Cannot normalize legacy json0 op")}d.v=O.v;var y=i.apply(d,O);if(y)return y}},i.transformPresence=function(d,h,m){var g=this.checkOp(h);if(g)return g;var O=d.t;if(typeof O=="string"&&(O=s.map[O]),!O)return{code:l.ERR_DOC_TYPE_NOT_RECOGNIZED,message:"Unknown type"};if(!a.supportsPresence(O))return{code:l.ERR_TYPE_DOES_NOT_SUPPORT_PRESENCE,message:"Type does not support presence"};if(h.create||h.del){d.p=null,d.v++;return}try{d.p=d.p===null?null:O.transformPresence(d.p,h.op,m)}catch(y){return{code:l.ERR_PRESENCE_TRANSFORM_FAILED,message:y.message||y}}d.v++};function u(d,h){if(d.type===s.defaultType.uri){var m=h.op;if(m){var g=d.data;m.length>1&&(g=a.clone(g));for(var O=0;O<m.length;O++){var y=m[O];typeof y.lm=="string"&&(y.lm=+y.lm);for(var b=y.p,S=g,P=0;P<b.length;P++){var k=b[P];Object.prototype.toString.call(S)=="[object Array]"?b[P]=+k:S.constructor===Object&&(b[P]=k.toString()),S=S[k]}O<m.length-1&&(g=s.defaultType.apply(g,[y]))}}}}},{"./error":42,"./types":50,"./util":51}],48:[function(t,r,i){r.exports={major:1,minor:2,checkAtLeast:s};function s(a,l){return a=o(a),l=o(l),a.major>l.major?!0:a.major===l.major&&a.minor>=l.minor}function o(a){if(typeof a=="string"){var l=a.split(".");a={major:l[0],minor:l[1]}}return{major:+(a.protocol||a.major||0),minor:+(a.protocolMinor||a.minor||0)}}},{}],49:[function(t,r,i){r.exports=s;function s(o,a,l,c,u){this.id=o,this.v=a,this.type=l,this.data=c,this.m=u}},{}],50:[function(t,r,i){i.defaultType=t("ot-json0").type,i.map=Object.create(null),i.register=function(s){s.name&&(i.map[s.name]=s),s.uri&&(i.map[s.uri]=s)},i.register(i.defaultType)},{"ot-json0":23}],51:[function(t,r,i){(function(s){(function(){var o=t("./next-tick");i.doNothing=a;function a(){}i.hasKeys=function(d){for(var h in d)return!0;return!1};var l;i.hasOwn=l=Object.hasOwn||Object.prototype.hasOwnProperty.call,i.isInteger=Number.isInteger||function(d){return typeof d=="number"&&isFinite(d)&&Math.floor(d)===d},i.isValidVersion=function(d){return d===null?!0:i.isInteger(d)&&d>=0},i.isValidTimestamp=function(d){return i.isValidVersion(d)},i.MAX_SAFE_INTEGER=9007199254740991,i.dig=function(){for(var d=arguments[0],h=1;h<arguments.length;h++){var m=arguments[h];d=l(d,m)?d[m]:h===arguments.length-1?void 0:Object.create(null)}return d},i.digOrCreate=function(){for(var d=arguments[0],h=arguments[arguments.length-1],m=1;m<arguments.length-1;m++){var g=arguments[m];d=l(d,g)?d[g]:d[g]=m===arguments.length-2?h():Object.create(null)}return d},i.digAndRemove=function(){for(var d=arguments[0],h=[d],m=1;m<arguments.length-1;m++){var g=arguments[m];if(!l(d,g))break;d=d[g],h.push(d)}for(var m=h.length-1;m>=0;m--){var O=h[m],g=arguments[m+1],y=O[g];(m===h.length-1||!i.hasKeys(y))&&delete O[g]}},i.supportsPresence=function(d){return d&&typeof d.transformPresence=="function"},i.callEach=function(d,h){var m=!1;return d.forEach(function(g){g&&(g(h),m=!0)}),m},i.truthy=function(d){return!!d},typeof s<"u"&&typeof s.nextTick=="function"?i.nextTick=s.nextTick:typeof MessageChannel<"u"?i.nextTick=o.messageChannel:i.nextTick=o.setTimeout,i.clone=function(d){return d===void 0?void 0:JSON.parse(JSON.stringify(d))};var c=Object.create(null);Object.getOwnPropertyNames(Object.prototype).forEach(function(d){d!=="__proto__"&&(c[d]=!0)}),i.isDangerousProperty=function(d){return d==="__proto__"||c[d]};try{var u=t("util");if(typeof u.inherits!="function")throw new Error("Could not find util.inherits()");i.inherits=u.inherits}catch{try{i.inherits=t("inherits")}catch{throw new Error('If running sharedb in a browser, please install the "inherits" or "util" package')}}}).call(this)}).call(this,t("_process"))},{"./next-tick":46,_process:26,inherits:17,util:55}],52:[function(t,r,i){(function(s,o){(function(){var a=t("process/browser.js").nextTick,l=Function.prototype.apply,c=Array.prototype.slice,u={},d=0;i.setTimeout=function(){return new h(l.call(setTimeout,window,arguments),clearTimeout)},i.setInterval=function(){return new h(l.call(setInterval,window,arguments),clearInterval)},i.clearTimeout=i.clearInterval=function(m){m.close()};function h(m,g){this._id=m,this._clearFn=g}h.prototype.unref=h.prototype.ref=function(){},h.prototype.close=function(){this._clearFn.call(window,this._id)},i.enroll=function(m,g){clearTimeout(m._idleTimeoutId),m._idleTimeout=g},i.unenroll=function(m){clearTimeout(m._idleTimeoutId),m._idleTimeout=-1},i._unrefActive=i.active=function(m){clearTimeout(m._idleTimeoutId);var g=m._idleTimeout;g>=0&&(m._idleTimeoutId=setTimeout(function(){m._onTimeout&&m._onTimeout()},g))},i.setImmediate=typeof s=="function"?s:function(m){var g=d++,O=arguments.length<2?!1:c.call(arguments,1);return u[g]=!0,a(function(){u[g]&&(O?m.apply(null,O):m.call(null),i.clearImmediate(g))}),g},i.clearImmediate=typeof o=="function"?o:function(m){delete u[m]}}).call(this)}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":26,timers:52}],53:[function(t,r,i){r.exports=function(o){return o&&typeof o=="object"&&typeof o.copy=="function"&&typeof o.fill=="function"&&typeof o.readUInt8=="function"}},{}],54:[function(t,r,i){var s=t("is-arguments"),o=t("is-generator-function"),a=t("which-typed-array"),l=t("is-typed-array");function c(I){return I.call.bind(I)}var u=typeof BigInt<"u",d=typeof Symbol<"u",h=c(Object.prototype.toString),m=c(Number.prototype.valueOf),g=c(String.prototype.valueOf),O=c(Boolean.prototype.valueOf);if(u)var y=c(BigInt.prototype.valueOf);if(d)var b=c(Symbol.prototype.valueOf);function S(I,ge){if(typeof I!="object")return!1;try{return ge(I),!0}catch{return!1}}i.isArgumentsObject=s,i.isGeneratorFunction=o,i.isTypedArray=l;function P(I){return typeof Promise<"u"&&I instanceof Promise||I!==null&&typeof I=="object"&&typeof I.then=="function"&&typeof I.catch=="function"}i.isPromise=P;function k(I){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(I):l(I)||j(I)}i.isArrayBufferView=k;function x(I){return a(I)==="Uint8Array"}i.isUint8Array=x;function A(I){return a(I)==="Uint8ClampedArray"}i.isUint8ClampedArray=A;function M(I){return a(I)==="Uint16Array"}i.isUint16Array=M;function Q(I){return a(I)==="Uint32Array"}i.isUint32Array=Q;function _(I){return a(I)==="Int8Array"}i.isInt8Array=_;function R(I){return a(I)==="Int16Array"}i.isInt16Array=R;function $(I){return a(I)==="Int32Array"}i.isInt32Array=$;function D(I){return a(I)==="Float32Array"}i.isFloat32Array=D;function F(I){return a(I)==="Float64Array"}i.isFloat64Array=F;function G(I){return a(I)==="BigInt64Array"}i.isBigInt64Array=G;function ue(I){return a(I)==="BigUint64Array"}i.isBigUint64Array=ue;function B(I){return h(I)==="[object Map]"}B.working=typeof Map<"u"&&B(new Map);function X(I){return typeof Map>"u"?!1:B.working?B(I):I instanceof Map}i.isMap=X;function W(I){return h(I)==="[object Set]"}W.working=typeof Set<"u"&&W(new Set);function ee(I){return typeof Set>"u"?!1:W.working?W(I):I instanceof Set}i.isSet=ee;function re(I){return h(I)==="[object WeakMap]"}re.working=typeof WeakMap<"u"&&re(new WeakMap);function H(I){return typeof WeakMap>"u"?!1:re.working?re(I):I instanceof WeakMap}i.isWeakMap=H;function se(I){return h(I)==="[object WeakSet]"}se.working=typeof WeakSet<"u"&&se(new WeakSet);function J(I){return se(I)}i.isWeakSet=J;function oe(I){return h(I)==="[object ArrayBuffer]"}oe.working=typeof ArrayBuffer<"u"&&oe(new ArrayBuffer);function pe(I){return typeof ArrayBuffer>"u"?!1:oe.working?oe(I):I instanceof ArrayBuffer}i.isArrayBuffer=pe;function Ee(I){return h(I)==="[object DataView]"}Ee.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&Ee(new DataView(new ArrayBuffer(1),0,1));function j(I){return typeof DataView>"u"?!1:Ee.working?Ee(I):I instanceof DataView}i.isDataView=j;var V=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function Y(I){return h(I)==="[object SharedArrayBuffer]"}function de(I){return typeof V>"u"?!1:(typeof Y.working>"u"&&(Y.working=Y(new V)),Y.working?Y(I):I instanceof V)}i.isSharedArrayBuffer=de;function ke(I){return h(I)==="[object AsyncFunction]"}i.isAsyncFunction=ke;function Te(I){return h(I)==="[object Map Iterator]"}i.isMapIterator=Te;function Pe(I){return h(I)==="[object Set Iterator]"}i.isSetIterator=Pe;function Re(I){return h(I)==="[object Generator]"}i.isGeneratorObject=Re;function Ge(I){return h(I)==="[object WebAssembly.Module]"}i.isWebAssemblyCompiledModule=Ge;function gt(I){return S(I,m)}i.isNumberObject=gt;function tn(I){return S(I,g)}i.isStringObject=tn;function Ln(I){return S(I,O)}i.isBooleanObject=Ln;function an(I){return u&&S(I,y)}i.isBigIntObject=an;function ln(I){return d&&S(I,b)}i.isSymbolObject=ln;function Qn(I){return gt(I)||tn(I)||Ln(I)||an(I)||ln(I)}i.isBoxedPrimitive=Qn;function Dn(I){return typeof Uint8Array<"u"&&(pe(I)||de(I))}i.isAnyArrayBuffer=Dn,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(I){Object.defineProperty(i,I,{enumerable:!1,value:function(){throw new Error(I+" is not supported in userland")}})})},{"is-arguments":18,"is-generator-function":20,"is-typed-array":21,"which-typed-array":56}],55:[function(t,r,i){(function(s){(function(){var o=Object.getOwnPropertyDescriptors||function(V){for(var Y=Object.keys(V),de={},ke=0;ke<Y.length;ke++)de[Y[ke]]=Object.getOwnPropertyDescriptor(V,Y[ke]);return de},a=/%[sdj%]/g;i.format=function(j){if(!R(j)){for(var V=[],Y=0;Y<arguments.length;Y++)V.push(d(arguments[Y]));return V.join(" ")}for(var Y=1,de=arguments,ke=de.length,Te=String(j).replace(a,function(Re){if(Re==="%%")return"%";if(Y>=ke)return Re;switch(Re){case"%s":return String(de[Y++]);case"%d":return Number(de[Y++]);case"%j":try{return JSON.stringify(de[Y++])}catch{return"[Circular]"}default:return Re}}),Pe=de[Y];Y<ke;Pe=de[++Y])M(Pe)||!G(Pe)?Te+=" "+Pe:Te+=" "+d(Pe);return Te},i.deprecate=function(j,V){if(typeof s<"u"&&s.noDeprecation===!0)return j;if(typeof s>"u")return function(){return i.deprecate(j,V).apply(this,arguments)};var Y=!1;function de(){if(!Y){if(s.throwDeprecation)throw new Error(V);s.traceDeprecation?console.trace(V):console.error(V),Y=!0}return j.apply(this,arguments)}return de};var l={},c=/^$/;if(s.env.NODE_DEBUG){var u=s.env.NODE_DEBUG;u=u.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),c=new RegExp("^"+u+"$","i")}i.debuglog=function(j){if(j=j.toUpperCase(),!l[j])if(c.test(j)){var V=s.pid;l[j]=function(){var Y=i.format.apply(i,arguments);console.error("%s %d: %s",j,V,Y)}}else l[j]=function(){};return l[j]};function d(j,V){var Y={seen:[],stylize:m};return arguments.length>=3&&(Y.depth=arguments[2]),arguments.length>=4&&(Y.colors=arguments[3]),A(V)?Y.showHidden=V:V&&i._extend(Y,V),D(Y.showHidden)&&(Y.showHidden=!1),D(Y.depth)&&(Y.depth=2),D(Y.colors)&&(Y.colors=!1),D(Y.customInspect)&&(Y.customInspect=!0),Y.colors&&(Y.stylize=h),O(Y,j,Y.depth)}i.inspect=d,d.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},d.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function h(j,V){var Y=d.styles[V];return Y?"\x1B["+d.colors[Y][0]+"m"+j+"\x1B["+d.colors[Y][1]+"m":j}function m(j,V){return j}function g(j){var V={};return j.forEach(function(Y,de){V[Y]=!0}),V}function O(j,V,Y){if(j.customInspect&&V&&X(V.inspect)&&V.inspect!==i.inspect&&!(V.constructor&&V.constructor.prototype===V)){var de=V.inspect(Y,j);return R(de)||(de=O(j,de,Y)),de}var ke=y(j,V);if(ke)return ke;var Te=Object.keys(V),Pe=g(Te);if(j.showHidden&&(Te=Object.getOwnPropertyNames(V)),B(V)&&(Te.indexOf("message")>=0||Te.indexOf("description")>=0))return b(V);if(Te.length===0){if(X(V)){var Re=V.name?": "+V.name:"";return j.stylize("[Function"+Re+"]","special")}if(F(V))return j.stylize(RegExp.prototype.toString.call(V),"regexp");if(ue(V))return j.stylize(Date.prototype.toString.call(V),"date");if(B(V))return b(V)}var Ge="",gt=!1,tn=["{","}"];if(x(V)&&(gt=!0,tn=["[","]"]),X(V)){var Ln=V.name?": "+V.name:"";Ge=" [Function"+Ln+"]"}if(F(V)&&(Ge=" "+RegExp.prototype.toString.call(V)),ue(V)&&(Ge=" "+Date.prototype.toUTCString.call(V)),B(V)&&(Ge=" "+b(V)),Te.length===0&&(!gt||V.length==0))return tn[0]+Ge+tn[1];if(Y<0)return F(V)?j.stylize(RegExp.prototype.toString.call(V),"regexp"):j.stylize("[Object]","special");j.seen.push(V);var an;return gt?an=S(j,V,Y,Pe,Te):an=Te.map(function(ln){return P(j,V,Y,Pe,ln,gt)}),j.seen.pop(),k(an,Ge,tn)}function y(j,V){if(D(V))return j.stylize("undefined","undefined");if(R(V)){var Y="'"+JSON.stringify(V).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return j.stylize(Y,"string")}if(_(V))return j.stylize(""+V,"number");if(A(V))return j.stylize(""+V,"boolean");if(M(V))return j.stylize("null","null")}function b(j){return"["+Error.prototype.toString.call(j)+"]"}function S(j,V,Y,de,ke){for(var Te=[],Pe=0,Re=V.length;Pe<Re;++Pe)J(V,String(Pe))?Te.push(P(j,V,Y,de,String(Pe),!0)):Te.push("");return ke.forEach(function(Ge){Ge.match(/^\d+$/)||Te.push(P(j,V,Y,de,Ge,!0))}),Te}function P(j,V,Y,de,ke,Te){var Pe,Re,Ge;if(Ge=Object.getOwnPropertyDescriptor(V,ke)||{value:V[ke]},Ge.get?Ge.set?Re=j.stylize("[Getter/Setter]","special"):Re=j.stylize("[Getter]","special"):Ge.set&&(Re=j.stylize("[Setter]","special")),J(de,ke)||(Pe="["+ke+"]"),Re||(j.seen.indexOf(Ge.value)<0?(M(Y)?Re=O(j,Ge.value,null):Re=O(j,Ge.value,Y-1),Re.indexOf(`
|
|
44
|
+
`)>-1&&(Te?Re=Re.split(`
|
|
45
|
+
`).map(function(gt){return" "+gt}).join(`
|
|
46
|
+
`).slice(2):Re=`
|
|
47
|
+
`+Re.split(`
|
|
48
|
+
`).map(function(gt){return" "+gt}).join(`
|
|
49
|
+
`))):Re=j.stylize("[Circular]","special")),D(Pe)){if(Te&&ke.match(/^\d+$/))return Re;Pe=JSON.stringify(""+ke),Pe.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(Pe=Pe.slice(1,-1),Pe=j.stylize(Pe,"name")):(Pe=Pe.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),Pe=j.stylize(Pe,"string"))}return Pe+": "+Re}function k(j,V,Y){var de=j.reduce(function(ke,Te){return Te.indexOf(`
|
|
50
|
+
`)>=0,ke+Te.replace(/\u001b\[\d\d?m/g,"").length+1},0);return de>60?Y[0]+(V===""?"":V+`
|
|
51
|
+
`)+" "+j.join(`,
|
|
52
|
+
`)+" "+Y[1]:Y[0]+V+" "+j.join(", ")+" "+Y[1]}i.types=t("./support/types");function x(j){return Array.isArray(j)}i.isArray=x;function A(j){return typeof j=="boolean"}i.isBoolean=A;function M(j){return j===null}i.isNull=M;function Q(j){return j==null}i.isNullOrUndefined=Q;function _(j){return typeof j=="number"}i.isNumber=_;function R(j){return typeof j=="string"}i.isString=R;function $(j){return typeof j=="symbol"}i.isSymbol=$;function D(j){return j===void 0}i.isUndefined=D;function F(j){return G(j)&&ee(j)==="[object RegExp]"}i.isRegExp=F,i.types.isRegExp=F;function G(j){return typeof j=="object"&&j!==null}i.isObject=G;function ue(j){return G(j)&&ee(j)==="[object Date]"}i.isDate=ue,i.types.isDate=ue;function B(j){return G(j)&&(ee(j)==="[object Error]"||j instanceof Error)}i.isError=B,i.types.isNativeError=B;function X(j){return typeof j=="function"}i.isFunction=X;function W(j){return j===null||typeof j=="boolean"||typeof j=="number"||typeof j=="string"||typeof j=="symbol"||typeof j>"u"}i.isPrimitive=W,i.isBuffer=t("./support/isBuffer");function ee(j){return Object.prototype.toString.call(j)}function re(j){return j<10?"0"+j.toString(10):j.toString(10)}var H=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function se(){var j=new Date,V=[re(j.getHours()),re(j.getMinutes()),re(j.getSeconds())].join(":");return[j.getDate(),H[j.getMonth()],V].join(" ")}i.log=function(){console.log("%s - %s",se(),i.format.apply(i,arguments))},i.inherits=t("inherits"),i._extend=function(j,V){if(!V||!G(V))return j;for(var Y=Object.keys(V),de=Y.length;de--;)j[Y[de]]=V[Y[de]];return j};function J(j,V){return Object.prototype.hasOwnProperty.call(j,V)}var oe=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;i.promisify=function(V){if(typeof V!="function")throw new TypeError('The "original" argument must be of type Function');if(oe&&V[oe]){var Y=V[oe];if(typeof Y!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(Y,oe,{value:Y,enumerable:!1,writable:!1,configurable:!0}),Y}function Y(){for(var de,ke,Te=new Promise(function(Ge,gt){de=Ge,ke=gt}),Pe=[],Re=0;Re<arguments.length;Re++)Pe.push(arguments[Re]);Pe.push(function(Ge,gt){Ge?ke(Ge):de(gt)});try{V.apply(this,Pe)}catch(Ge){ke(Ge)}return Te}return Object.setPrototypeOf(Y,Object.getPrototypeOf(V)),oe&&Object.defineProperty(Y,oe,{value:Y,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(Y,o(V))},i.promisify.custom=oe;function pe(j,V){if(!j){var Y=new Error("Promise was rejected with a falsy value");Y.reason=j,j=Y}return V(j)}function Ee(j){if(typeof j!="function")throw new TypeError('The "original" argument must be of type Function');function V(){for(var Y=[],de=0;de<arguments.length;de++)Y.push(arguments[de]);var ke=Y.pop();if(typeof ke!="function")throw new TypeError("The last argument must be of type Function");var Te=this,Pe=function(){return ke.apply(Te,arguments)};j.apply(this,Y).then(function(Re){s.nextTick(Pe.bind(null,null,Re))},function(Re){s.nextTick(pe.bind(null,Re,Pe))})}return Object.setPrototypeOf(V,Object.getPrototypeOf(j)),Object.defineProperties(V,o(j)),V}i.callbackify=Ee}).call(this)}).call(this,t("_process"))},{"./support/isBuffer":53,"./support/types":54,_process:26,inherits:17}],56:[function(t,r,i){(function(s){(function(){var o=t("for-each"),a=t("available-typed-arrays"),l=t("call-bind/callBound"),c=t("gopd"),u=l("Object.prototype.toString"),d=t("has-tostringtag/shams")(),h=typeof globalThis>"u"?s:globalThis,m=a(),g=l("String.prototype.slice"),O={},y=Object.getPrototypeOf;d&&c&&y&&o(m,function(P){if(typeof h[P]=="function"){var k=new h[P];if(Symbol.toStringTag in k){var x=y(k),A=c(x,Symbol.toStringTag);if(!A){var M=y(x);A=c(M,Symbol.toStringTag)}O[P]=A.get}}});var b=function(k){var x=!1;return o(O,function(A,M){if(!x)try{var Q=A.call(k);Q===M&&(x=Q)}catch{}}),x},S=t("is-typed-array");r.exports=function(k){return S(k)?!d||!(Symbol.toStringTag in k)?g(u(k),8,-1):b(k):!1}}).call(this)}).call(this,typeof Rr<"u"?Rr:typeof self<"u"?self:typeof window<"u"?window:{})},{"available-typed-arrays":2,"call-bind/callBound":3,"for-each":7,gopd:11,"has-tostringtag/shams":14,"is-typed-array":21}],57:[function(t,r,i){r.exports=t("sharedb/lib/client")},{"sharedb/lib/client":29}]},{},[57])(57)})}(Vy)),Vy.exports}var Wq=Zq();const w2=Us(Wq);var Zy={exports:{}},$T;function Xq(){return $T||($T=1,function(n,e){(function(t){n.exports=t()})(function(){return function(){function t(r,i,s){function o(c,u){if(!i[c]){if(!r[c]){var d=typeof hl=="function"&&hl;if(!u&&d)return d(c,!0);if(a)return a(c,!0);var h=new Error("Cannot find module '"+c+"'");throw h.code="MODULE_NOT_FOUND",h}var m=i[c]={exports:{}};r[c][0].call(m.exports,function(g){var O=r[c][1][g];return o(O||g)},m,m.exports,t,r,i,s)}return i[c].exports}for(var a=typeof hl=="function"&&hl,l=0;l<s.length;l++)o(s[l]);return o}return t}()({1:[function(t,r,i){(function(s){(function(){var o=t("object-assign");/*!
|
|
53
|
+
* The buffer module from node.js, for the browser.
|
|
54
|
+
*
|
|
55
|
+
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
56
|
+
* @license MIT
|
|
57
|
+
*/function a(B,X){if(B===X)return 0;for(var W=B.length,ee=X.length,re=0,H=Math.min(W,ee);re<H;++re)if(B[re]!==X[re]){W=B[re],ee=X[re];break}return W<ee?-1:ee<W?1:0}function l(B){return s.Buffer&&typeof s.Buffer.isBuffer=="function"?s.Buffer.isBuffer(B):!!(B!=null&&B._isBuffer)}var c=t("util/"),u=Object.prototype.hasOwnProperty,d=Array.prototype.slice,h=function(){return(function(){}).name==="foo"}();function m(B){return Object.prototype.toString.call(B)}function g(B){return l(B)||typeof s.ArrayBuffer!="function"?!1:typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(B):B?!!(B instanceof DataView||B.buffer&&B.buffer instanceof ArrayBuffer):!1}var O=r.exports=A,y=/\s*function\s+([^\(\s]*)\s*/;function b(B){if(c.isFunction(B)){if(h)return B.name;var X=B.toString(),W=X.match(y);return W&&W[1]}}O.AssertionError=function(X){this.name="AssertionError",this.actual=X.actual,this.expected=X.expected,this.operator=X.operator,X.message?(this.message=X.message,this.generatedMessage=!1):(this.message=k(this),this.generatedMessage=!0);var W=X.stackStartFunction||x;if(Error.captureStackTrace)Error.captureStackTrace(this,W);else{var ee=new Error;if(ee.stack){var re=ee.stack,H=b(W),se=re.indexOf(`
|
|
58
|
+
`+H);if(se>=0){var J=re.indexOf(`
|
|
59
|
+
`,se+1);re=re.substring(J+1)}this.stack=re}}},c.inherits(O.AssertionError,Error);function S(B,X){return typeof B=="string"?B.length<X?B:B.slice(0,X):B}function P(B){if(h||!c.isFunction(B))return c.inspect(B);var X=b(B),W=X?": "+X:"";return"[Function"+W+"]"}function k(B){return S(P(B.actual),128)+" "+B.operator+" "+S(P(B.expected),128)}function x(B,X,W,ee,re){throw new O.AssertionError({message:W,actual:B,expected:X,operator:ee,stackStartFunction:re})}O.fail=x;function A(B,X){B||x(B,!0,X,"==",O.ok)}O.ok=A,O.equal=function(X,W,ee){X!=W&&x(X,W,ee,"==",O.equal)},O.notEqual=function(X,W,ee){X==W&&x(X,W,ee,"!=",O.notEqual)},O.deepEqual=function(X,W,ee){M(X,W,!1)||x(X,W,ee,"deepEqual",O.deepEqual)},O.deepStrictEqual=function(X,W,ee){M(X,W,!0)||x(X,W,ee,"deepStrictEqual",O.deepStrictEqual)};function M(B,X,W,ee){if(B===X)return!0;if(l(B)&&l(X))return a(B,X)===0;if(c.isDate(B)&&c.isDate(X))return B.getTime()===X.getTime();if(c.isRegExp(B)&&c.isRegExp(X))return B.source===X.source&&B.global===X.global&&B.multiline===X.multiline&&B.lastIndex===X.lastIndex&&B.ignoreCase===X.ignoreCase;if((B===null||typeof B!="object")&&(X===null||typeof X!="object"))return W?B===X:B==X;if(g(B)&&g(X)&&m(B)===m(X)&&!(B instanceof Float32Array||B instanceof Float64Array))return a(new Uint8Array(B.buffer),new Uint8Array(X.buffer))===0;if(l(B)!==l(X))return!1;ee=ee||{actual:[],expected:[]};var re=ee.actual.indexOf(B);return re!==-1&&re===ee.expected.indexOf(X)?!0:(ee.actual.push(B),ee.expected.push(X),_(B,X,W,ee))}function Q(B){return Object.prototype.toString.call(B)=="[object Arguments]"}function _(B,X,W,ee){if(B==null||X===null||X===void 0)return!1;if(c.isPrimitive(B)||c.isPrimitive(X))return B===X;if(W&&Object.getPrototypeOf(B)!==Object.getPrototypeOf(X))return!1;var re=Q(B),H=Q(X);if(re&&!H||!re&&H)return!1;if(re)return B=d.call(B),X=d.call(X),M(B,X,W);var se=ue(B),J=ue(X),oe,pe;if(se.length!==J.length)return!1;for(se.sort(),J.sort(),pe=se.length-1;pe>=0;pe--)if(se[pe]!==J[pe])return!1;for(pe=se.length-1;pe>=0;pe--)if(oe=se[pe],!M(B[oe],X[oe],W,ee))return!1;return!0}O.notDeepEqual=function(X,W,ee){M(X,W,!1)&&x(X,W,ee,"notDeepEqual",O.notDeepEqual)},O.notDeepStrictEqual=R;function R(B,X,W){M(B,X,!0)&&x(B,X,W,"notDeepStrictEqual",R)}O.strictEqual=function(X,W,ee){X!==W&&x(X,W,ee,"===",O.strictEqual)},O.notStrictEqual=function(X,W,ee){X===W&&x(X,W,ee,"!==",O.notStrictEqual)};function $(B,X){if(!B||!X)return!1;if(Object.prototype.toString.call(X)=="[object RegExp]")return X.test(B);try{if(B instanceof X)return!0}catch{}return Error.isPrototypeOf(X)?!1:X.call({},B)===!0}function D(B){var X;try{B()}catch(W){X=W}return X}function F(B,X,W,ee){var re;if(typeof X!="function")throw new TypeError('"block" argument must be a function');typeof W=="string"&&(ee=W,W=null),re=D(X),ee=(W&&W.name?" ("+W.name+").":".")+(ee?" "+ee:"."),B&&!re&&x(re,W,"Missing expected exception"+ee);var H=typeof ee=="string",se=!B&&c.isError(re),J=!B&&re&&!W;if((se&&H&&$(re,W)||J)&&x(re,W,"Got unwanted exception"+ee),B&&re&&W&&!$(re,W)||!B&&re)throw re}O.throws=function(B,X,W){F(!0,B,X,W)},O.doesNotThrow=function(B,X,W){F(!1,B,X,W)},O.ifError=function(B){if(B)throw B};function G(B,X){B||x(B,!0,X,"==",G)}O.strict=o(G,O,{equal:O.strictEqual,deepEqual:O.deepStrictEqual,notEqual:O.notStrictEqual,notDeepEqual:O.notDeepStrictEqual}),O.strict.strict=O.strict;var ue=Object.keys||function(B){var X=[];for(var W in B)u.call(B,W)&&X.push(W);return X}}).call(this)}).call(this,typeof Rr<"u"?Rr:typeof self<"u"?self:typeof window<"u"?window:{})},{"object-assign":22,"util/":4}],2:[function(t,r,i){typeof Object.create=="function"?r.exports=function(o,a){o.super_=a,o.prototype=Object.create(a.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}})}:r.exports=function(o,a){o.super_=a;var l=function(){};l.prototype=a.prototype,o.prototype=new l,o.prototype.constructor=o}},{}],3:[function(t,r,i){r.exports=function(o){return o&&typeof o=="object"&&typeof o.copy=="function"&&typeof o.fill=="function"&&typeof o.readUInt8=="function"}},{}],4:[function(t,r,i){(function(s,o){(function(){var a=/%[sdj%]/g;i.format=function(J){if(!_(J)){for(var oe=[],pe=0;pe<arguments.length;pe++)oe.push(u(arguments[pe]));return oe.join(" ")}for(var pe=1,Ee=arguments,j=Ee.length,V=String(J).replace(a,function(de){if(de==="%%")return"%";if(pe>=j)return de;switch(de){case"%s":return String(Ee[pe++]);case"%d":return Number(Ee[pe++]);case"%j":try{return JSON.stringify(Ee[pe++])}catch{return"[Circular]"}default:return de}}),Y=Ee[pe];pe<j;Y=Ee[++pe])A(Y)||!F(Y)?V+=" "+Y:V+=" "+u(Y);return V},i.deprecate=function(J,oe){if($(o.process))return function(){return i.deprecate(J,oe).apply(this,arguments)};if(s.noDeprecation===!0)return J;var pe=!1;function Ee(){if(!pe){if(s.throwDeprecation)throw new Error(oe);s.traceDeprecation?console.trace(oe):console.error(oe),pe=!0}return J.apply(this,arguments)}return Ee};var l={},c;i.debuglog=function(J){if($(c)&&(c=s.env.NODE_DEBUG||""),J=J.toUpperCase(),!l[J])if(new RegExp("\\b"+J+"\\b","i").test(c)){var oe=s.pid;l[J]=function(){var pe=i.format.apply(i,arguments);console.error("%s %d: %s",J,oe,pe)}}else l[J]=function(){};return l[J]};function u(J,oe){var pe={seen:[],stylize:h};return arguments.length>=3&&(pe.depth=arguments[2]),arguments.length>=4&&(pe.colors=arguments[3]),x(oe)?pe.showHidden=oe:oe&&i._extend(pe,oe),$(pe.showHidden)&&(pe.showHidden=!1),$(pe.depth)&&(pe.depth=2),$(pe.colors)&&(pe.colors=!1),$(pe.customInspect)&&(pe.customInspect=!0),pe.colors&&(pe.stylize=d),g(pe,J,pe.depth)}i.inspect=u,u.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},u.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function d(J,oe){var pe=u.styles[oe];return pe?"\x1B["+u.colors[pe][0]+"m"+J+"\x1B["+u.colors[pe][1]+"m":J}function h(J,oe){return J}function m(J){var oe={};return J.forEach(function(pe,Ee){oe[pe]=!0}),oe}function g(J,oe,pe){if(J.customInspect&&oe&&B(oe.inspect)&&oe.inspect!==i.inspect&&!(oe.constructor&&oe.constructor.prototype===oe)){var Ee=oe.inspect(pe,J);return _(Ee)||(Ee=g(J,Ee,pe)),Ee}var j=O(J,oe);if(j)return j;var V=Object.keys(oe),Y=m(V);if(J.showHidden&&(V=Object.getOwnPropertyNames(oe)),ue(oe)&&(V.indexOf("message")>=0||V.indexOf("description")>=0))return y(oe);if(V.length===0){if(B(oe)){var de=oe.name?": "+oe.name:"";return J.stylize("[Function"+de+"]","special")}if(D(oe))return J.stylize(RegExp.prototype.toString.call(oe),"regexp");if(G(oe))return J.stylize(Date.prototype.toString.call(oe),"date");if(ue(oe))return y(oe)}var ke="",Te=!1,Pe=["{","}"];if(k(oe)&&(Te=!0,Pe=["[","]"]),B(oe)){var Re=oe.name?": "+oe.name:"";ke=" [Function"+Re+"]"}if(D(oe)&&(ke=" "+RegExp.prototype.toString.call(oe)),G(oe)&&(ke=" "+Date.prototype.toUTCString.call(oe)),ue(oe)&&(ke=" "+y(oe)),V.length===0&&(!Te||oe.length==0))return Pe[0]+ke+Pe[1];if(pe<0)return D(oe)?J.stylize(RegExp.prototype.toString.call(oe),"regexp"):J.stylize("[Object]","special");J.seen.push(oe);var Ge;return Te?Ge=b(J,oe,pe,Y,V):Ge=V.map(function(gt){return S(J,oe,pe,Y,gt,Te)}),J.seen.pop(),P(Ge,ke,Pe)}function O(J,oe){if($(oe))return J.stylize("undefined","undefined");if(_(oe)){var pe="'"+JSON.stringify(oe).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return J.stylize(pe,"string")}if(Q(oe))return J.stylize(""+oe,"number");if(x(oe))return J.stylize(""+oe,"boolean");if(A(oe))return J.stylize("null","null")}function y(J){return"["+Error.prototype.toString.call(J)+"]"}function b(J,oe,pe,Ee,j){for(var V=[],Y=0,de=oe.length;Y<de;++Y)se(oe,String(Y))?V.push(S(J,oe,pe,Ee,String(Y),!0)):V.push("");return j.forEach(function(ke){ke.match(/^\d+$/)||V.push(S(J,oe,pe,Ee,ke,!0))}),V}function S(J,oe,pe,Ee,j,V){var Y,de,ke;if(ke=Object.getOwnPropertyDescriptor(oe,j)||{value:oe[j]},ke.get?ke.set?de=J.stylize("[Getter/Setter]","special"):de=J.stylize("[Getter]","special"):ke.set&&(de=J.stylize("[Setter]","special")),se(Ee,j)||(Y="["+j+"]"),de||(J.seen.indexOf(ke.value)<0?(A(pe)?de=g(J,ke.value,null):de=g(J,ke.value,pe-1),de.indexOf(`
|
|
60
|
+
`)>-1&&(V?de=de.split(`
|
|
61
|
+
`).map(function(Te){return" "+Te}).join(`
|
|
62
|
+
`).substr(2):de=`
|
|
63
|
+
`+de.split(`
|
|
64
|
+
`).map(function(Te){return" "+Te}).join(`
|
|
65
|
+
`))):de=J.stylize("[Circular]","special")),$(Y)){if(V&&j.match(/^\d+$/))return de;Y=JSON.stringify(""+j),Y.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(Y=Y.substr(1,Y.length-2),Y=J.stylize(Y,"name")):(Y=Y.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),Y=J.stylize(Y,"string"))}return Y+": "+de}function P(J,oe,pe){var Ee=J.reduce(function(j,V){return V.indexOf(`
|
|
66
|
+
`)>=0,j+V.replace(/\u001b\[\d\d?m/g,"").length+1},0);return Ee>60?pe[0]+(oe===""?"":oe+`
|
|
67
|
+
`)+" "+J.join(`,
|
|
68
|
+
`)+" "+pe[1]:pe[0]+oe+" "+J.join(", ")+" "+pe[1]}function k(J){return Array.isArray(J)}i.isArray=k;function x(J){return typeof J=="boolean"}i.isBoolean=x;function A(J){return J===null}i.isNull=A;function M(J){return J==null}i.isNullOrUndefined=M;function Q(J){return typeof J=="number"}i.isNumber=Q;function _(J){return typeof J=="string"}i.isString=_;function R(J){return typeof J=="symbol"}i.isSymbol=R;function $(J){return J===void 0}i.isUndefined=$;function D(J){return F(J)&&W(J)==="[object RegExp]"}i.isRegExp=D;function F(J){return typeof J=="object"&&J!==null}i.isObject=F;function G(J){return F(J)&&W(J)==="[object Date]"}i.isDate=G;function ue(J){return F(J)&&(W(J)==="[object Error]"||J instanceof Error)}i.isError=ue;function B(J){return typeof J=="function"}i.isFunction=B;function X(J){return J===null||typeof J=="boolean"||typeof J=="number"||typeof J=="string"||typeof J=="symbol"||typeof J>"u"}i.isPrimitive=X,i.isBuffer=t("./support/isBuffer");function W(J){return Object.prototype.toString.call(J)}function ee(J){return J<10?"0"+J.toString(10):J.toString(10)}var re=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function H(){var J=new Date,oe=[ee(J.getHours()),ee(J.getMinutes()),ee(J.getSeconds())].join(":");return[J.getDate(),re[J.getMonth()],oe].join(" ")}i.log=function(){console.log("%s - %s",H(),i.format.apply(i,arguments))},i.inherits=t("inherits"),i._extend=function(J,oe){if(!oe||!F(oe))return J;for(var pe=Object.keys(oe),Ee=pe.length;Ee--;)J[pe[Ee]]=oe[pe[Ee]];return J};function se(J,oe){return Object.prototype.hasOwnProperty.call(J,oe)}}).call(this)}).call(this,t("_process"),typeof Rr<"u"?Rr:typeof self<"u"?self:typeof window<"u"?window:{})},{"./support/isBuffer":3,_process:33,inherits:2}],5:[function(t,r,i){(function(s){(function(){var o=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],a=typeof globalThis>"u"?s:globalThis;r.exports=function(){for(var c=[],u=0;u<o.length;u++)typeof a[o[u]]=="function"&&(c[c.length]=o[u]);return c}}).call(this)}).call(this,typeof Rr<"u"?Rr:typeof self<"u"?self:typeof window<"u"?window:{})},{}],6:[function(t,r,i){var s=t("get-intrinsic"),o=t("./"),a=o(s("String.prototype.indexOf"));r.exports=function(c,u){var d=s(c,!!u);return typeof d=="function"&&a(c,".prototype.")>-1?o(d):d}},{"./":7,"get-intrinsic":11}],7:[function(t,r,i){var s=t("function-bind"),o=t("get-intrinsic"),a=o("%Function.prototype.apply%"),l=o("%Function.prototype.call%"),c=o("%Reflect.apply%",!0)||s.call(l,a),u=o("%Object.getOwnPropertyDescriptor%",!0),d=o("%Object.defineProperty%",!0),h=o("%Math.max%");if(d)try{d({},"a",{value:1})}catch{d=null}r.exports=function(O){var y=c(s,l,arguments);if(u&&d){var b=u(y,"length");b.configurable&&d(y,"length",{value:1+h(0,O.length-(arguments.length-1))})}return y};var m=function(){return c(s,a,arguments)};d?d(r.exports,"apply",{value:m}):r.exports.apply=m},{"function-bind":10,"get-intrinsic":11}],8:[function(t,r,i){var s=t("is-callable"),o=Object.prototype.toString,a=Object.prototype.hasOwnProperty,l=function(m,g,O){for(var y=0,b=m.length;y<b;y++)a.call(m,y)&&(O==null?g(m[y],y,m):g.call(O,m[y],y,m))},c=function(m,g,O){for(var y=0,b=m.length;y<b;y++)O==null?g(m.charAt(y),y,m):g.call(O,m.charAt(y),y,m)},u=function(m,g,O){for(var y in m)a.call(m,y)&&(O==null?g(m[y],y,m):g.call(O,m[y],y,m))},d=function(m,g,O){if(!s(g))throw new TypeError("iterator must be a function");var y;arguments.length>=3&&(y=O),o.call(m)==="[object Array]"?l(m,g,y):typeof m=="string"?c(m,g,y):u(m,g,y)};r.exports=d},{"is-callable":19}],9:[function(t,r,i){var s="Function.prototype.bind called on incompatible ",o=Object.prototype.toString,a=Math.max,l="[object Function]",c=function(m,g){for(var O=[],y=0;y<m.length;y+=1)O[y]=m[y];for(var b=0;b<g.length;b+=1)O[b+m.length]=g[b];return O},u=function(m,g){for(var O=[],y=g,b=0;y<m.length;y+=1,b+=1)O[b]=m[y];return O},d=function(h,m){for(var g="",O=0;O<h.length;O+=1)g+=h[O],O+1<h.length&&(g+=m);return g};r.exports=function(m){var g=this;if(typeof g!="function"||o.apply(g)!==l)throw new TypeError(s+g);for(var O=u(arguments,1),y,b=function(){if(this instanceof y){var A=g.apply(this,c(O,arguments));return Object(A)===A?A:this}return g.apply(m,c(O,arguments))},S=a(0,g.length-O.length),P=[],k=0;k<S;k++)P[k]="$"+k;if(y=Function("binder","return function ("+d(P,",")+"){ return binder.apply(this,arguments); }")(b),g.prototype){var x=function(){};x.prototype=g.prototype,y.prototype=new x,x.prototype=null}return y}},{}],10:[function(t,r,i){var s=t("./implementation");r.exports=Function.prototype.bind||s},{"./implementation":9}],11:[function(t,r,i){var s,o=SyntaxError,a=Function,l=TypeError,c=function(B){try{return a('"use strict"; return ('+B+").constructor;")()}catch{}},u=Object.getOwnPropertyDescriptor;if(u)try{u({},"")}catch{u=null}var d=function(){throw new l},h=u?function(){try{return arguments.callee,d}catch{try{return u(arguments,"callee").get}catch{return d}}}():d,m=t("has-symbols")(),g=Object.getPrototypeOf||function(B){return B.__proto__},O={},y=typeof Uint8Array>"u"?s:g(Uint8Array),b={"%AggregateError%":typeof AggregateError>"u"?s:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?s:ArrayBuffer,"%ArrayIteratorPrototype%":m?g([][Symbol.iterator]()):s,"%AsyncFromSyncIteratorPrototype%":s,"%AsyncFunction%":O,"%AsyncGenerator%":O,"%AsyncGeneratorFunction%":O,"%AsyncIteratorPrototype%":O,"%Atomics%":typeof Atomics>"u"?s:Atomics,"%BigInt%":typeof BigInt>"u"?s:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?s:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?s:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?s:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?s:Float32Array,"%Float64Array%":typeof Float64Array>"u"?s:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?s:FinalizationRegistry,"%Function%":a,"%GeneratorFunction%":O,"%Int8Array%":typeof Int8Array>"u"?s:Int8Array,"%Int16Array%":typeof Int16Array>"u"?s:Int16Array,"%Int32Array%":typeof Int32Array>"u"?s:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":m?g(g([][Symbol.iterator]())):s,"%JSON%":typeof JSON=="object"?JSON:s,"%Map%":typeof Map>"u"?s:Map,"%MapIteratorPrototype%":typeof Map>"u"||!m?s:g(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?s:Promise,"%Proxy%":typeof Proxy>"u"?s:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?s:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?s:Set,"%SetIteratorPrototype%":typeof Set>"u"||!m?s:g(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?s:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":m?g(""[Symbol.iterator]()):s,"%Symbol%":m?Symbol:s,"%SyntaxError%":o,"%ThrowTypeError%":h,"%TypedArray%":y,"%TypeError%":l,"%Uint8Array%":typeof Uint8Array>"u"?s:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?s:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?s:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?s:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?s:WeakMap,"%WeakRef%":typeof WeakRef>"u"?s:WeakRef,"%WeakSet%":typeof WeakSet>"u"?s:WeakSet};try{null.error}catch(B){var S=g(g(B));b["%Error.prototype%"]=S}var P=function B(X){var W;if(X==="%AsyncFunction%")W=c("async function () {}");else if(X==="%GeneratorFunction%")W=c("function* () {}");else if(X==="%AsyncGeneratorFunction%")W=c("async function* () {}");else if(X==="%AsyncGenerator%"){var ee=B("%AsyncGeneratorFunction%");ee&&(W=ee.prototype)}else if(X==="%AsyncIteratorPrototype%"){var re=B("%AsyncGenerator%");re&&(W=g(re.prototype))}return b[X]=W,W},k={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},x=t("function-bind"),A=t("has"),M=x.call(Function.call,Array.prototype.concat),Q=x.call(Function.apply,Array.prototype.splice),_=x.call(Function.call,String.prototype.replace),R=x.call(Function.call,String.prototype.slice),$=x.call(Function.call,RegExp.prototype.exec),D=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,F=/\\(\\)?/g,G=function(X){var W=R(X,0,1),ee=R(X,-1);if(W==="%"&&ee!=="%")throw new o("invalid intrinsic syntax, expected closing `%`");if(ee==="%"&&W!=="%")throw new o("invalid intrinsic syntax, expected opening `%`");var re=[];return _(X,D,function(H,se,J,oe){re[re.length]=J?_(oe,F,"$1"):se||H}),re},ue=function(X,W){var ee=X,re;if(A(k,ee)&&(re=k[ee],ee="%"+re[0]+"%"),A(b,ee)){var H=b[ee];if(H===O&&(H=P(ee)),typeof H>"u"&&!W)throw new l("intrinsic "+X+" exists, but is not available. Please file an issue!");return{alias:re,name:ee,value:H}}throw new o("intrinsic "+X+" does not exist!")};r.exports=function(X,W){if(typeof X!="string"||X.length===0)throw new l("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof W!="boolean")throw new l('"allowMissing" argument must be a boolean');if($(/^%?[^%]*%?$/,X)===null)throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var ee=G(X),re=ee.length>0?ee[0]:"",H=ue("%"+re+"%",W),se=H.name,J=H.value,oe=!1,pe=H.alias;pe&&(re=pe[0],Q(ee,M([0,1],pe)));for(var Ee=1,j=!0;Ee<ee.length;Ee+=1){var V=ee[Ee],Y=R(V,0,1),de=R(V,-1);if((Y==='"'||Y==="'"||Y==="`"||de==='"'||de==="'"||de==="`")&&Y!==de)throw new o("property names with quotes must have matching quotes");if((V==="constructor"||!j)&&(oe=!0),re+="."+V,se="%"+re+"%",A(b,se))J=b[se];else if(J!=null){if(!(V in J)){if(!W)throw new l("base intrinsic for "+X+" exists, but the property is not available.");return}if(u&&Ee+1>=ee.length){var ke=u(J,V);j=!!ke,j&&"get"in ke&&!("originalValue"in ke.get)?J=ke.get:J=J[V]}else j=A(J,V),J=J[V];j&&!oe&&(b[se]=J)}}return J}},{"function-bind":10,has:16,"has-symbols":13}],12:[function(t,r,i){var s=t("get-intrinsic"),o=s("%Object.getOwnPropertyDescriptor%",!0);if(o)try{o([],"length")}catch{o=null}r.exports=o},{"get-intrinsic":11}],13:[function(t,r,i){var s=typeof Symbol<"u"&&Symbol,o=t("./shams");r.exports=function(){return typeof s!="function"||typeof Symbol!="function"||typeof s("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:o()}},{"./shams":14}],14:[function(t,r,i){r.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var o={},a=Symbol("test"),l=Object(a);if(typeof a=="string"||Object.prototype.toString.call(a)!=="[object Symbol]"||Object.prototype.toString.call(l)!=="[object Symbol]")return!1;var c=42;o[a]=c;for(a in o)return!1;if(typeof Object.keys=="function"&&Object.keys(o).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(o).length!==0)return!1;var u=Object.getOwnPropertySymbols(o);if(u.length!==1||u[0]!==a||!Object.prototype.propertyIsEnumerable.call(o,a))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var d=Object.getOwnPropertyDescriptor(o,a);if(d.value!==c||d.enumerable!==!0)return!1}return!0}},{}],15:[function(t,r,i){var s=t("has-symbols/shams");r.exports=function(){return s()&&!!Symbol.toStringTag}},{"has-symbols/shams":14}],16:[function(t,r,i){var s=t("function-bind");r.exports=s.call(Function.call,Object.prototype.hasOwnProperty)},{"function-bind":10}],17:[function(t,r,i){typeof Object.create=="function"?r.exports=function(o,a){a&&(o.super_=a,o.prototype=Object.create(a.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}))}:r.exports=function(o,a){if(a){o.super_=a;var l=function(){};l.prototype=a.prototype,o.prototype=new l,o.prototype.constructor=o}}},{}],18:[function(t,r,i){var s=t("has-tostringtag/shams")(),o=t("call-bind/callBound"),a=o("Object.prototype.toString"),l=function(h){return s&&h&&typeof h=="object"&&Symbol.toStringTag in h?!1:a(h)==="[object Arguments]"},c=function(h){return l(h)?!0:h!==null&&typeof h=="object"&&typeof h.length=="number"&&h.length>=0&&a(h)!=="[object Array]"&&a(h.callee)==="[object Function]"},u=function(){return l(arguments)}();l.isLegacyArguments=c,r.exports=u?l:c},{"call-bind/callBound":6,"has-tostringtag/shams":15}],19:[function(t,r,i){var s=Function.prototype.toString,o=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,a,l;if(typeof o=="function"&&typeof Object.defineProperty=="function")try{a=Object.defineProperty({},"length",{get:function(){throw l}}),l={},o(function(){throw 42},null,a)}catch(M){M!==l&&(o=null)}else o=null;var c=/^\s*class\b/,u=function(Q){try{var _=s.call(Q);return c.test(_)}catch{return!1}},d=function(Q){try{return u(Q)?!1:(s.call(Q),!0)}catch{return!1}},h=Object.prototype.toString,m="[object Object]",g="[object Function]",O="[object GeneratorFunction]",y="[object HTMLAllCollection]",b="[object HTML document.all class]",S="[object HTMLCollection]",P=typeof Symbol=="function"&&!!Symbol.toStringTag,k=!(0 in[,]),x=function(){return!1};if(typeof document=="object"){var A=document.all;h.call(A)===h.call(document.all)&&(x=function(Q){if((k||!Q)&&(typeof Q>"u"||typeof Q=="object"))try{var _=h.call(Q);return(_===y||_===b||_===S||_===m)&&Q("")==null}catch{}return!1})}r.exports=o?function(Q){if(x(Q))return!0;if(!Q||typeof Q!="function"&&typeof Q!="object")return!1;try{o(Q,null,a)}catch(_){if(_!==l)return!1}return!u(Q)&&d(Q)}:function(Q){if(x(Q))return!0;if(!Q||typeof Q!="function"&&typeof Q!="object")return!1;if(P)return d(Q);if(u(Q))return!1;var _=h.call(Q);return _!==g&&_!==O&&!/^\[object HTML/.test(_)?!1:d(Q)}},{}],20:[function(t,r,i){var s=Object.prototype.toString,o=Function.prototype.toString,a=/^\s*(?:function)?\*/,l=t("has-tostringtag/shams")(),c=Object.getPrototypeOf,u=function(){if(!l)return!1;try{return Function("return function*() {}")()}catch{}},d;r.exports=function(m){if(typeof m!="function")return!1;if(a.test(o.call(m)))return!0;if(!l){var g=s.call(m);return g==="[object GeneratorFunction]"}if(!c)return!1;if(typeof d>"u"){var O=u();d=O?c(O):!1}return c(m)===d}},{"has-tostringtag/shams":15}],21:[function(t,r,i){(function(s){(function(){var o=t("for-each"),a=t("available-typed-arrays"),l=t("call-bind/callBound"),c=l("Object.prototype.toString"),u=t("has-tostringtag/shams")(),d=t("gopd"),h=typeof globalThis>"u"?s:globalThis,m=a(),g=l("Array.prototype.indexOf",!0)||function(k,x){for(var A=0;A<k.length;A+=1)if(k[A]===x)return A;return-1},O=l("String.prototype.slice"),y={},b=Object.getPrototypeOf;u&&d&&b&&o(m,function(P){var k=new h[P];if(Symbol.toStringTag in k){var x=b(k),A=d(x,Symbol.toStringTag);if(!A){var M=b(x);A=d(M,Symbol.toStringTag)}y[P]=A.get}});var S=function(k){var x=!1;return o(y,function(A,M){if(!x)try{x=A.call(k)===M}catch{}}),x};r.exports=function(k){if(!k||typeof k!="object")return!1;if(!u||!(Symbol.toStringTag in k)){var x=O(c(k),8,-1);return g(m,x)>-1}return d?S(k):!1}}).call(this)}).call(this,typeof Rr<"u"?Rr:typeof self<"u"?self:typeof window<"u"?window:{})},{"available-typed-arrays":5,"call-bind/callBound":6,"for-each":8,gopd:12,"has-tostringtag/shams":15}],22:[function(t,r,i){var s=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;function l(u){if(u==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(u)}function c(){try{if(!Object.assign)return!1;var u=new String("abc");if(u[5]="de",Object.getOwnPropertyNames(u)[0]==="5")return!1;for(var d={},h=0;h<10;h++)d["_"+String.fromCharCode(h)]=h;var m=Object.getOwnPropertyNames(d).map(function(O){return d[O]});if(m.join("")!=="0123456789")return!1;var g={};return"abcdefghijklmnopqrst".split("").forEach(function(O){g[O]=O}),Object.keys(Object.assign({},g)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}r.exports=c()?Object.assign:function(u,d){for(var h,m=l(u),g,O=1;O<arguments.length;O++){h=Object(arguments[O]);for(var y in h)o.call(h,y)&&(m[y]=h[y]);if(s){g=s(h);for(var b=0;b<g.length;b++)a.call(h,g[b])&&(m[g[b]]=h[g[b]])}}return m}},{}],23:[function(t,r,i){Object.defineProperty(i,"__esModule",{value:!0}),i.eachChildOf=i.advancer=i.readCursor=i.writeCursor=i.WriteCursor=i.ReadCursor=i.isValidPathItem=void 0;function s(b,S){if(!b)throw new Error(S)}const o=b=>b!=null&&typeof b=="object"&&!Array.isArray(b),a=(b,S)=>typeof b==typeof S?b>S:typeof b=="string"&&typeof S=="number";function l(b,S){for(let P in b){const k=P;S.write(k,b[k])}}const c=b=>typeof b=="number"||typeof b=="string"&&b!=="__proto__";i.isValidPathItem=c;class u{constructor(S=null){this.parents=[],this.indexes=[],this.lcIdx=-1,this.idx=-1,this.container=S}ascend(){s(this.parents.length===this.indexes.length/2),this.idx===0?this.parents.length?(this.lcIdx=this.indexes.pop(),this.container=this.parents.pop(),this.idx=this.indexes.pop()):(this.lcIdx=0,this.idx=-1):(s(this.idx>0),this.idx--,o(this.container[this.idx])&&this.idx--)}getPath(){const S=[];let P=this.container,k=this.parents.length-1,x=this.idx;for(;x>=0;)S.unshift(P[x]),x===0?(x=this.indexes[k*2],P=this.parents[k--]):x-=o(P[x-1])?2:1;return S}}class d extends u{get(){return this.container?this.container.slice(this.idx+1):null}getKey(){return s(this.container!=null,"Invalid call to getKey before cursor descended"),this.container[this.idx]}getComponent(){let S;return this.container&&this.container.length>this.idx+1&&o(S=this.container[this.idx+1])?S:null}descendFirst(){let S=this.idx+1;if(!this.container||S>=this.container.length||o(this.container[S])&&S+1>=this.container.length)return!1;o(this.container[S])&&S++;const P=this.container[S];return Array.isArray(P)?(this.indexes.push(this.idx),this.parents.push(this.container),this.indexes.push(S),this.idx=0,this.container=P):this.idx=S,!0}nextSibling(){if(s(this.parents.length===this.indexes.length/2),this.idx>0||this.parents.length===0)return!1;const S=this.indexes[this.indexes.length-1]+1,P=this.parents[this.parents.length-1];return S>=P.length?!1:(s(!isNaN(S)),this.indexes[this.indexes.length-1]=S,this.container=P[S],!0)}_init(S,P,k,x){this.container=S,this.idx=P,this.parents=k.slice(),this.indexes=x.slice()}clone(){const S=new d;return S._init(this.container,this.idx,this.parents,this.indexes),S}*[Symbol.iterator](){if(this.descendFirst()){do yield this.getKey();while(this.nextSibling());this.ascend()}}traverse(S,P){const k=this.getComponent();k&&P(k,S);for(const x of this)S&&S.descend(x),this.traverse(S,P),S&&S.ascend()}eachPick(S,P){this.traverse(S,(k,x)=>{k.p!=null&&P(k.p,x)})}eachDrop(S,P){this.traverse(S,(k,x)=>{k.d!=null&&P(k.d,x)})}}i.ReadCursor=d;class h extends u{constructor(S=null){super(S),this.pendingDescent=[],this._op=S}flushDescent(){s(this.parents.length===this.indexes.length/2),this.container===null&&(this._op=this.container=[]);for(let S=0;S<this.pendingDescent.length;S++){const P=this.pendingDescent[S];let k=this.idx+1;if(k<this.container.length&&o(this.container[k])&&k++,s(k===this.container.length||!o(this.container[k])),k===this.container.length)this.container.push(P),this.idx=k;else if(this.container[k]===P)this.idx=k;else{if(!Array.isArray(this.container[k])){const x=this.container.splice(k,this.container.length-k);this.container.push(x),this.lcIdx>-1&&(this.lcIdx=k)}for(this.indexes.push(this.idx),this.parents.push(this.container),this.lcIdx!==-1&&(s(a(P,this.container[this.lcIdx][0])),k=this.lcIdx+1,this.lcIdx=-1);k<this.container.length&&a(P,this.container[k][0]);)k++;if(this.indexes.push(k),this.idx=0,k<this.container.length&&this.container[k][0]===P)this.container=this.container[k];else{const x=[P];this.container.splice(k,0,x),this.container=x}}}this.pendingDescent.length=0}reset(){this.lcIdx=-1}getComponent(){this.flushDescent();const S=this.idx+1;if(S<this.container.length&&o(this.container[S]))return this.container[S];{const P={};return this.container.splice(S,0,P),P}}write(S,P){const k=this.getComponent();s(k[S]==null||k[S]===P,"Internal consistency error: Overwritten component. File a bug"),k[S]=P}get(){return this._op}descend(S){if(!(0,i.isValidPathItem)(S))throw Error("Invalid JSON key");this.pendingDescent.push(S)}descendPath(S){return this.pendingDescent.push(...S),this}ascend(){this.pendingDescent.length?this.pendingDescent.pop():super.ascend()}mergeTree(S,P=l){if(S===null)return;if(s(Array.isArray(S)),S===this._op)throw Error("Cannot merge into my own tree");const k=this.lcIdx,x=this.parents.length;let A=0;for(let M=0;M<S.length;M++){const Q=S[M];typeof Q=="string"||typeof Q=="number"?(A++,this.descend(Q)):Array.isArray(Q)?this.mergeTree(Q,P):typeof Q=="object"&&P(Q,this)}for(;A--;)this.ascend();this.lcIdx=this.parents.length===x?k:-1}at(S,P){this.descendPath(S),P(this);for(let k=0;k<S.length;k++)this.ascend();return this}writeAtPath(S,P,k){return this.at(S,()=>this.write(P,k)),this.reset(),this}writeMove(S,P,k=0){return this.writeAtPath(S,"p",k).writeAtPath(P,"d",k)}getPath(){const S=super.getPath();return S.push(...this.pendingDescent),S}}i.WriteCursor=h;const m=()=>new h;i.writeCursor=m;const g=b=>new d(b);i.readCursor=g;function O(b,S,P){let k,x;x=k=b?b.descendFirst():!1;function A(M){let Q;for(;x;){const _=Q=b.getKey();if(M!=null){let R=!1;if(S&&typeof _=="number"&&(Q=S(_,b.getComponent()),Q<0&&(Q=~Q,R=!0)),a(Q,M))return null;if(Q===M&&!R)return b}P&&typeof Q=="number"&&P(Q,b.getComponent()),x=b.nextSibling()}return null}return A.end=()=>{k&&b.ascend()},A}i.advancer=O;function y(b,S,P){let k,x,A,M;for(k=x=b&&b.descendFirst(),A=M=S&&S.descendFirst();k||A;){let Q=k?b.getKey():null,_=A?S.getKey():null;Q!==null&&_!==null&&(a(_,Q)?_=null:Q!==_&&(Q=null)),P(Q??_,Q!=null?b:null,_!=null?S:null),Q!=null&&k&&(k=b.nextSibling()),_!=null&&A&&(A=S.nextSibling())}x&&b.ascend(),M&&S.ascend()}i.eachChildOf=y},{}],24:[function(t,r,i){Object.defineProperty(i,"__esModule",{value:!0});function s(o){if(o===null)return null;if(Array.isArray(o))return o.map(s);if(typeof o=="object"){const a={};for(let l in o)a[l]=s(o[l]);return a}else return o}i.default=s},{}],25:[function(t,r,i){Object.defineProperty(i,"__esModule",{value:!0});function s(l,c){if(Array.isArray(c))return!1;for(let u in l)if(!a(l[u],c[u]))return!1;for(let u in c)if(l[u]===void 0)return!1;return!0}function o(l,c){if(!Array.isArray(c)||l.length!==c.length)return!1;for(let u=0;u<l.length;u++)if(!a(l[u],c[u]))return!1;return!0}function a(l,c){return l===c?!0:l===null||c===null||typeof l!="object"||typeof c!="object"?!1:Array.isArray(l)?o(l,c):s(l,c)}i.default=a},{}],26:[function(t,r,i){var s=this&&this.__createBinding||(Object.create?function(c,u,d,h){h===void 0&&(h=d);var m=Object.getOwnPropertyDescriptor(u,d);(!m||("get"in m?!u.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return u[d]}}),Object.defineProperty(c,h,m)}:function(c,u,d,h){h===void 0&&(h=d),c[h]=u[d]}),o=this&&this.__exportStar||function(c,u){for(var d in c)d!=="default"&&!Object.prototype.hasOwnProperty.call(u,d)&&s(u,c,d)};Object.defineProperty(i,"__esModule",{value:!0}),i.ConflictType=i.WriteCursor=i.ReadCursor=void 0,o(t("./json1.release.js"),i);var a=t("./cursor.js");Object.defineProperty(i,"ReadCursor",{enumerable:!0,get:function(){return a.ReadCursor}}),Object.defineProperty(i,"WriteCursor",{enumerable:!0,get:function(){return a.WriteCursor}});var l=t("./types");Object.defineProperty(i,"ConflictType",{enumerable:!0,get:function(){return l.ConflictType}})},{"./cursor.js":23,"./json1.release.js":27,"./types":29}],27:[function(t,r,i){var s=this&&this.__importDefault||function(I){return I&&I.__esModule?I:{default:I}};Object.defineProperty(i,"__esModule",{value:!0}),i.editOp=i.replaceOp=i.insertOp=i.moveOp=i.removeOp=i.type=void 0;const o=s(t("./deepEqual.js")),a=s(t("./deepClone.js")),l=t("./cursor.js"),c=t("./types.js"),u=!0,d=()=>{};function h(I,ge){if(!I)throw new Error(ge)}let m=!1;i.type={name:"p",uri:"p",readCursor:l.readCursor,writeCursor:l.writeCursor,create:I=>I,isNoop:I=>I==null,setDebug(I){m=I,d.quiet=!I},registerSubtype:G,checkValidOp:se,normalize:J,apply:oe,transformPosition:Ee,transformPresence:j,compose:Y,tryTransform:tn,transform:an,makeInvertible:Te,invert:de,invertWithDoc:Pe,RM_UNEXPECTED_CONTENT:c.ConflictType.RM_UNEXPECTED_CONTENT,DROP_COLLISION:c.ConflictType.DROP_COLLISION,BLACKHOLE:c.ConflictType.BLACKHOLE,transformNoConflict:(I,ge,je)=>Dn(()=>!0,I,ge,je),typeAllowingConflictsPred:I=>Object.assign(Object.assign({},i.type),{transform:(ge,je,ze)=>Dn(I,ge,je,ze)})};const g=I=>I?I.getComponent():null;function O(I){return I&&typeof I=="object"&&!Array.isArray(I)}const y=I=>Array.isArray(I)?I.slice():I!==null&&typeof I=="object"?Object.assign({},I):I,b=I=>I&&(I.p!=null||I.r!==void 0),S=I=>I&&(I.d!=null||I.i!==void 0),P=(I,ge=!0)=>(0,l.writeCursor)().writeAtPath(I,"r",ge).get();i.removeOp=P;const k=(I,ge)=>(0,l.writeCursor)().writeMove(I,ge).get();i.moveOp=k;const x=(I,ge)=>(0,l.writeCursor)().writeAtPath(I,"i",ge).get();i.insertOp=x;const A=(I,ge,je)=>(0,l.writeCursor)().at(I,ze=>{ze.write("r",ge),ze.write("i",je)}).get();i.replaceOp=A;const M=(I,ge,je,ze=!1)=>(0,l.writeCursor)().at(I,Ze=>ee(Ze,ge,je,ze)).get();function Q(I,ge){return h(I!=null),typeof ge=="number"?(h(Array.isArray(I),"Invalid key - child is not an array"),(I=I.slice()).splice(ge,1)):(h(O(I),"Invalid key - child is not an object"),delete(I=Object.assign({},I))[ge]),I}function _(I,ge,je){return typeof ge=="number"?(h(I!=null,"Container is missing for key"),h(Array.isArray(I),"Cannot use numerical key for object container"),h(I.length>=ge,"Cannot insert into out of bounds index"),I.splice(ge,0,je)):(h(O(I),"Cannot insert into missing item"),h(I[ge]===void 0,"Trying to overwrite value at key. Your op needs to remove it first"),I[ge]=je),je}i.editOp=M;const R=(I,ge,je)=>((I=y(I))[ge]=je,I),$=(I,ge)=>I!=null&&(typeof ge=="number"?Array.isArray(I):typeof I=="object"),D=(I,ge)=>$(I,ge)?I[ge]:void 0,F={};function G(I){let ge=I.type?I.type:I;ge.name&&(F[ge.name]=ge),ge.uri&&(F[ge.uri]=ge)}const ue=I=>{const ge=F[I];if(ge)return ge;throw Error("Missing type: "+I)};G(t("ot-text-unicode"));const B=(I,ge)=>I+ge;G({name:"number",apply:B,compose:B,invert:I=>-I,transform:I=>I});const X=I=>I==null?null:I.et?ue(I.et):I.es?F["text-unicode"]:I.ena!=null?F.number:null,W=I=>I.es?I.es:I.ena!=null?I.ena:I.e,ee=(I,ge,je,ze=!1)=>{const[Ze,Ke]=typeof ge=="string"?[ue(ge),ge]:[ge,ge.name];!ze&&Ze.isNoop&&Ze.isNoop(je)||(Ke==="number"?I.write("ena",je):Ke==="text-unicode"?I.write("es",je):(I.write("et",Ke),I.write("e",je)))};function re(I){h(typeof I=="number"),h(I>=0),h(I===(0|I))}function H(I){typeof I=="number"?re(I):h(typeof I=="string")}function se(I){if(I===null)return;const ge=new Set,je=new Set,ze=Ke=>{let _t=!0,kt=!1;for(let $e in Ke){const tt=Ke[$e];if(_t=!1,h($e==="p"||$e==="r"||$e==="d"||$e==="i"||$e==="e"||$e==="es"||$e==="ena"||$e==="et","Invalid component item '"+$e+"'"),$e==="p")re(tt),h(!ge.has(tt)),ge.add(tt),h(Ke.r===void 0);else if($e==="d")re(tt),h(!je.has(tt)),je.add(tt),h(Ke.i===void 0);else if($e==="e"||$e==="es"||$e==="ena"){h(!kt),kt=!0;const We=X(Ke);h(We,"Missing type in edit"),We.checkValidOp&&We.checkValidOp(W(Ke))}}h(!_t)},Ze=(Ke,_t,kt)=>{if(!Array.isArray(Ke))throw Error("Op must be null or a list");if(Ke.length===0)throw Error("Empty descent");_t||H(Ke[0]);let $e=1,tt=0,We=0;for(let Xe=0;Xe<Ke.length;Xe++){const at=Ke[Xe];if(h(at!=null),Array.isArray(at)){const dt=Ze(at,!1);if(tt){const Dt=typeof We,Le=typeof dt;Dt===Le?h(We<dt,"descent keys are not in order"):h(Dt==="number"&&Le==="string")}We=dt,tt++,$e=3}else typeof at=="object"?(h($e===1,`Prev not scalar - instead ${$e}`),ze(at),$e=2):(h($e!==3),H(at),h((0,l.isValidPathItem)(at),"Invalid path key"),$e=1)}return h(tt!==1,"Operation makes multiple descents. Remove some []"),h($e===2||$e===3),Ke[0]};Ze(I,!0),h(ge.size===je.size,"Mismatched picks and drops in op");for(let Ke=0;Ke<ge.size;Ke++)h(ge.has(Ke)),h(je.has(Ke))}function J(I){let ge=0,je=[];const ze=(0,l.writeCursor)();return ze.mergeTree(I,(Ze,Ke)=>{const _t=X(Ze);if(_t){const $e=W(Ze);ee(Ke,_t,_t.normalize?_t.normalize($e):$e)}for(const $e of["r","p","i","d"])if(Ze[$e]!==void 0){const tt=$e==="p"||$e==="d"?(kt=Ze[$e],je[kt]==null&&(je[kt]=ge++),je[kt]):Ze[$e];Ke.write($e,tt)}var kt}),ze.get()}function oe(I,ge){if(d.quiet=!m,se(ge),ge===null)return I;const je=[];return I=function ze(Ze,Ke){let _t=Ze,kt=0,$e={root:Ze},tt=0,We=$e,Xe="root";function at(){for(;tt<kt;tt++){let dt=Ke[tt];typeof dt!="object"&&(h($(We,Xe)),We=We[Xe]=y(We[Xe]),Xe=dt)}}for(;kt<Ke.length;kt++){const dt=Ke[kt];if(Array.isArray(dt)){const Dt=ze(_t,dt);Dt!==_t&&Dt!==void 0&&(at(),_t=We[Xe]=Dt)}else if(typeof dt=="object"){dt.d!=null?(at(),_t=_(We,Xe,je[dt.d])):dt.i!==void 0&&(at(),_t=_(We,Xe,dt.i));const Dt=X(dt);if(Dt)at(),_t=We[Xe]=Dt.apply(_t,W(dt));else if(dt.e!==void 0)throw Error("Subtype "+dt.et+" undefined")}else _t=D(_t,dt)}return $e.root}(I=function ze(Ze,Ke){const _t=[];let kt=0;for(;kt<Ke.length;kt++){const $e=Ke[kt];if(Array.isArray($e))break;typeof $e!="object"&&(_t.push(Ze),Ze=D(Ze,$e))}for(let $e=Ke.length-1;$e>=kt;$e--)Ze=ze(Ze,Ke[$e]);for(--kt;kt>=0;kt--){const $e=Ke[kt];if(typeof $e!="object"){const tt=_t.pop();Ze=Ze===D(tt,$e)?tt:Ze===void 0?Q(tt,$e):R(tt,$e,Ze)}else b($e)&&(h(Ze!==void 0,"Cannot pick up or remove undefined"),$e.p!=null&&(je[$e.p]=Ze),Ze=void 0)}return Ze}(I,ge),ge)}const pe=()=>{};function Ee(I,ge){I=I.slice(),se(ge);const je=(0,l.readCursor)(ge);let ze,Ze,Ke=!1;const _t=[];for(let $e=0;;$e++){const tt=I[$e],We=je.getComponent();if(We&&(We.r!==void 0?Ke=!0:We.p!=null&&(Ke=!1,ze=We.p,Ze=$e)),$e>=I.length)break;let Xe=0;const at=(0,l.advancer)(je,void 0,(Dt,Le)=>{b(Le)&&Xe++});_t.unshift(at);const dt=at(tt);if(typeof tt=="number"&&(I[$e]-=Xe),!dt)break}if(_t.forEach($e=>$e.end()),Ke)return null;const kt=()=>{let $e=0;if(ze!=null){const tt=je.getPath();$e=tt.length,I=tt.concat(I.slice(Ze))}for(u;$e<I.length;$e++){const tt=I[$e],We=g(je),Xe=X(We);if(Xe){const Le=W(We);Xe.transformPosition?I[$e]=Xe.transformPosition(I[$e],Le):Xe.transformCursor&&(I[$e]=Xe.transformCursor(I[$e],Le));break}let at=0;const dt=(0,l.advancer)(je,(Le,ct)=>S(ct)?~(Le-at):Le-at,(Le,ct)=>{S(ct)&&at++}),Dt=dt(tt);if(typeof tt=="number"&&(I[$e]+=at),!Dt)break}};return ze!=null?je.eachDrop(null,$e=>{$e===ze&&kt()}):kt(),I}function j(I,ge){if(!I||!I.start||!I.end)return null;const je=Ee(I.start,ge),ze=Ee(I.end,ge);return je&&ze?Object.assign(Object.assign({},I),{start:je,end:ze}):je?Object.assign(Object.assign({},I),{start:je,end:je}):ze?Object.assign(Object.assign({},I),{start:ze,end:ze}):null}const V=(I,ge,je)=>{typeof ge=="number"?(h(Array.isArray(I)),h(ge<I.length)):(h(!Array.isArray(I)),h(I[ge]!==void 0)),je===void 0?typeof ge=="number"?I.splice(ge,1):delete I[ge]:I[ge]=je};function Y(I,ge){if(se(I),se(ge),I==null)return ge;if(ge==null)return I;let je=0;const ze=(0,l.readCursor)(I),Ze=(0,l.readCursor)(ge),Ke=(0,l.writeCursor)(),_t=[],kt=[],$e=[],tt=[],We=[],Xe=[],at=new Set;ze.traverse(null,Le=>{Le.p!=null&&($e[Le.p]=ze.clone())}),Ze.traverse(null,Le=>{Le.d!=null&&(tt[Le.d]=Ze.clone())});const dt=(0,l.writeCursor)();return function Le(ct,Ft,ht,It,cn,Pn,On,wn){h(Ft||ht);const tr=g(Ft),Bn=g(ht),Qr=!!Bn&&Bn.r!==void 0,nr=!!tr&&tr.i!==void 0,Sr=tr?tr.d:null,ar=Bn?Bn.p:null,sn=(Pn||Qr)&&ar==null;if(ar!=null)It=tt[ar],On=kt[ar]=new l.WriteCursor;else if(Bn&&Bn.r!==void 0)It=null;else{const St=g(It);St&&St.d!=null&&(It=null)}const pt=g(It);if(Sr!=null)if(ct=$e[Sr],wn=_t[Sr]=new l.WriteCursor,sn)Pn&&!Qr&&wn.write("r",!0);else{const St=We[Sr]=je++;On.write("d",St)}else if(tr&&tr.i!==void 0)ct=null;else{const St=g(ct);St&&St.p!=null&&(ct=null)}let bt;nr?(h(cn===void 0),bt=tr.i):bt=cn;const Pt=(ar==null?!nr||Pn||Qr:bt===void 0)?null:On.getComponent();if(ar!=null){if(!(cn!==void 0||nr)){const St=Sr!=null?We[Sr]:je++;Xe[ar]=St,wn.write("p",St)}}else Qr&&(nr||cn!==void 0||(Bn.r,wn.write("r",Bn.r)));const it=sn?null:X(tr),Fe=X(pt);if((it||Fe)&&(it&&it.name,Fe&&Fe.name),it&&Fe){h(it===Fe);const St=W(tr),un=W(pt),wr=it.compose(St,un);ee(On,it,wr),at.add(pt)}else it?ee(On,it,W(tr)):Fe&&(ee(On,Fe,W(pt)),at.add(pt));const Vt=typeof bt=="object"&&bt!=null;let Zt=!1,Gt=0,In=0,Fn=0,jn=0,Yn=0;const Xt=(0,l.advancer)(It,(St,un)=>S(un)?jn-St-1:St-jn,(St,un)=>{S(un)&&jn++}),Bt=(0,l.advancer)(ct,(St,un)=>b(un)?Gt-St-1:St-Gt,(St,un)=>{b(un)&&Gt++});if((0,l.eachChildOf)(Ft,ht,(St,un,wr)=>{let vn,ui,Wr=St,K=St,te=St;if(typeof St=="number"){let he=St+Fn;ui=Xt(he),K=he+jn;let Qe=St+In;vn=Bt(Qe),S(g(ui))&&(vn=null),Wr=Qe+Gt,te=St+Yn,h(Wr>=0,"p1PickKey is negative"),h(K>=0,"p2DropKey is negative");const rt=S(g(un)),De=b(g(wr));(rt||De&&!sn)&&Yn--,rt&&In--,De&&Fn--}else vn=Bt(St),ui=Xt(St);wn.descend(Wr),On.descend(K);const ce=Vt&&!S(g(un))?bt[te]:void 0,Ae=Le(vn,un,wr,ui,ce,sn,On,wn);Vt&&!sn?ce!==Ae&&(Zt||(bt=Array.isArray(bt)?bt.slice():Object.assign({},bt),Zt=!0),V(bt,te,Ae)):h(Ae===void 0),On.ascend(),wn.ascend()}),Bt.end(),Xt.end(),Pt!=null)Pt.i=bt;else if(!Pn&&!Qr&&ar==null)return bt}(ze,ze.clone(),Ze,Ze.clone(),void 0,!1,Ke,dt),Ke.reset(),Ke.mergeTree(dt.get()),Ke.reset(),Ke.get(),_t.map(Le=>Le.get()),kt.map(Le=>Le.get()),ze.traverse(Ke,(Le,ct)=>{const Ft=Le.p;if(Ft!=null){const ht=We[Ft];ht!=null&&ct.write("p",ht);const It=_t[Ft];It&&It.get(),It&&ct.mergeTree(It.get())}else Le.r!==void 0&&ct.write("r",Le.r)}),Ke.reset(),Ke.get(),Ze.traverse(Ke,(Le,ct)=>{const Ft=Le.d;if(Ft!=null){const It=Xe[Ft];It!=null&&ct.write("d",It);const cn=kt[Ft];cn&&ct.mergeTree(cn.get())}else Le.i!==void 0&&ct.write("i",Le.i);const ht=X(Le);ht&&!at.has(Le)&&ee(ct,ht,W(Le))}),Ke.get()}function de(I){if(I==null)return null;const ge=new l.ReadCursor(I),je=new l.WriteCursor;let ze;const Ze=[],Ke=[];if(function kt($e,tt,We){const Xe=$e.getComponent();let at,dt=!1;if(Xe){Xe.p!=null&&(tt.write("d",Xe.p),Ze[Xe.p]=$e.clone()),Xe.r!==void 0&&tt.write("i",Xe.r),Xe.d!=null&&(tt.write("p",Xe.d),We=void 0),Xe.i!==void 0&&(We=at=Xe.i);const Le=X(Xe);Le&&(We===void 0?(ze||(ze=new Set),ze.add(Xe)):(W(Xe),We=Le.apply(We,W(Xe)),dt=!0))}let Dt=0;for(const Le of $e){tt.descend(Le);const ct=typeof Le=="number"?Le-Dt:Le,Ft=D(We,ct);S($e.getComponent())&&Dt++;const ht=kt($e,tt,Ft);if(We!==void 0&&ht!==void 0){if(dt||(dt=!0,We=y(We)),!$(We,ct))throw Error("Cannot modify child - invalid operation");We[ct]=ht}tt.ascend()}if(at===void 0)return dt?We:void 0;tt.write("r",We)}(ge,je,void 0),ze){let kt=function($e,tt,We){const Xe=tt.getComponent();if(Xe){const Le=Xe.d;if(Le!=null&&($e=Ze[Le],We=Ke[Le]=(0,l.writeCursor)()),ze.has(Xe)){const ct=X(Xe);if(!ct.invert)throw Error(`Cannot invert subtype ${ct.name}`);ee(We,ct,ct.invert(W(Xe)))}}let at=0,dt=0;const Dt=(0,l.advancer)($e,(Le,ct)=>b(ct)?at-Le-1:Le-at,(Le,ct)=>{b(ct)&&at++});for(const Le of tt)if(typeof Le=="number"){const ct=Le-dt,Ft=Dt(ct),ht=ct+at;We.descend(ht),kt(Ft,tt,We),S(tt.getComponent())&&dt++,We.ascend()}else We.descend(Le),kt(Dt(Le),tt,We),We.ascend();Dt.end()};je.reset(),kt(ge.clone(),ge,je),Ke.length&&(je.reset(),ge.traverse(je,($e,tt)=>{const We=$e.p;if(We!=null){const Xe=Ke[We];Xe&&Xe.get(),Xe&&tt.mergeTree(Xe.get())}}))}return je.get()}const ke=(I,ge)=>I.some(je=>typeof je=="object"&&(Array.isArray(je)?ke(je,ge):ge(je)));function Te(I,ge){if(I==null||!ke(I,tt=>{var We;return tt.r!==void 0||((We=X(tt))===null||We===void 0?void 0:We.makeInvertible)!=null}))return I;const je=new l.ReadCursor(I),ze=new l.WriteCursor;let Ze=!1;const Ke=[],_t=[],kt=(tt,We,Xe)=>{const at=tt.getComponent();let dt=!1;if(at){at.d!=null&&We.write("d",at.d),at.i!==void 0&&We.write("i",at.i);const Le=at.p;if(Le!=null&&(Ke[Le]=tt.clone(),h(Xe!==void 0,"Operation picks up at an invalid key"),_t[Le]=Xe,We.write("p",at.p)),at.r!==void 0&&Xe===void 0)throw Error("Invalid doc / op in makeInvertible: removed item missing from doc");const ct=X(at);ct&&(ct.makeInvertible?Ze=!0:ee(We,ct,W(at),!0))}let Dt=0;for(const Le of tt){We.descend(Le);const ct=typeof Le=="number"?Le-Dt:Le,Ft=D(Xe,ct),ht=kt(tt,We,Ft);Ft!==ht&&(dt||(dt=!0,Xe=y(Xe)),ht===void 0?(Xe=Q(Xe,ct),typeof Le=="number"&&Dt++):Xe[ct]=ht),We.ascend()}return at&&(at.r!==void 0?(We.write("r",(0,a.default)(Xe)),Xe=void 0):at.p!=null&&(Xe=void 0)),Xe};if(kt(je,ze,ge),ze.get(),Ze){let tt=function(We,Xe,at,dt,Dt){const Le=Xe.getComponent();if(Le){Le.i!==void 0?(dt=Le.i,Dt=!0):Le.d!=null&&(dt=_t[Le.d],We=Ke[Le.d],Dt=!1,Le.d);let It=X(Le);if(It&&It.makeInvertible){const cn=W(Le);ee(at,It,It.makeInvertible(cn,dt),!0)}}let ct=0,Ft=0;const ht=(0,l.advancer)(We,(It,cn)=>b(cn)?ct-It-1:It-ct,(It,cn)=>{b(cn)&&ct++});for(const It of Xe)if(typeof It=="number"){const cn=It-Ft,Pn=ht(cn),On=D(dt,Dt?cn:cn+ct);at.descend(It),tt(Pn,Xe,at,On,Dt),S(Xe.getComponent())&&Ft++,at.ascend()}else{const cn=D(dt,It);at.descend(It),tt(ht(It),Xe,at,cn,Dt),at.ascend()}ht.end()};ze.reset(),tt(je.clone(),je,ze,ge,!1)}return ze.get()}function Pe(I,ge){return de(Te(I,ge))}const Re=0,Ge=1,gt=I=>{if(I==null)return null;const ge=I.slice();for(let je=0;je<I.length;je++){const ze=ge[je];Array.isArray(ze)&&(ge[je]=gt(ze))}return ge};function tn(I,ge,je){h(je==="left"||je==="right","Direction must be left or right");const ze=je==="left"?Re:Ge;if(d.quiet=!m,d.prefix=0,ge==null)return{ok:!0,result:I};se(I),se(ge);let Ze=null;const Ke=[],_t=[],kt=[],$e=[],tt=[],We=[],Xe=[],at=[],dt=[],Dt=[],Le=[],ct=[],Ft=[],ht=[],It=[];let cn=0;const Pn=(0,l.readCursor)(I),On=(0,l.readCursor)(ge),wn=(0,l.writeCursor)();if(function sn(pt,bt=null,Pt){const it=g(bt);it&&(it.r!==void 0?Pt=bt.clone():it.p!=null&&(Pt=null,We[it.p]=pt.clone()));const Fe=pt.getComponent();let Vt;Fe&&(Vt=Fe.p)!=null&&(tt[Vt]=bt?bt.clone():null,kt[Vt]=pt.clone(),Pt&&(Dt[Vt]=!0,dt[Vt]=Pt),it&&it.p!=null&&(ht[Vt]=it.p));const Zt=(0,l.advancer)(bt);for(const Gt of pt)sn(pt,Zt(Gt),Pt);Zt.end()}(On,Pn,null),function sn(pt,bt,Pt,it,Fe){const Vt=Pt.getComponent();let Zt,Gt=!1;Vt&&((Zt=Vt.d)!=null?($e[Zt]=Pt.clone(),it!=null&&(It[it]==null&&(It[it]=[]),It[it].push(Zt)),Dt[Zt],pt=tt[Zt]||null,bt=kt[Zt]||null,Dt[Zt]?(Fe&&(Le[Zt]=!0),Fe=dt[Zt]||null):!Fe||ze!==Ge&&ht[Zt]!=null||Ze==null&&(Ze={type:c.ConflictType.RM_UNEXPECTED_CONTENT,op1:(0,i.removeOp)(Fe.getPath()),op2:(0,i.moveOp)(bt.getPath(),Pt.getPath())}),Gt=!0):Vt.i!==void 0&&(pt=bt=null,Gt=!0,Fe&&Ze==null&&(Ze={type:c.ConflictType.RM_UNEXPECTED_CONTENT,op1:(0,i.removeOp)(Fe.getPath()),op2:(0,i.insertOp)(Pt.getPath(),Vt.i)})));const In=g(pt);In&&(In.r!==void 0?Fe=pt.clone():In.p!=null&&(In.p,it=In.p,Fe=null));const Fn=X(Vt);Fn&&Fe&&Ze==null&&(Ze={type:c.ConflictType.RM_UNEXPECTED_CONTENT,op1:(0,i.removeOp)(Fe.getPath()),op2:(0,i.editOp)(Pt.getPath(),Fn,W(Vt),!0)});let jn=0,Yn=0;const Xt=(0,l.advancer)(bt,(St,un)=>b(un)?jn-St-1:St-jn,(St,un)=>{b(un)&&jn++}),Bt=(0,l.advancer)(pt);for(const St of Pt)if(typeof St=="number"){const un=St-Yn,wr=Xt(un);Yn+=+sn(Bt(un+jn),wr,Pt,it,Fe)}else{const un=Xt(St);sn(Bt(St),un,Pt,it,Fe)}return Xt.end(),Bt.end(),Gt}(Pn,On,On.clone(),null,null),$e.map(sn=>sn&&sn.get()),Ze)return{ok:!1,conflict:Ze};Le.map(sn=>!!sn);const tr=[];let Bn=null;(function sn(pt,bt,Pt,it,Fe){let Vt=!1;const Zt=g(bt);if(b(Zt)){const Xt=Zt.p;Xt!=null?(Pt=$e[Xt],it=ct[Xt]=(0,l.writeCursor)(),Vt=!0,Fe=null):(Pt=null,Fe=bt.clone())}else S(g(Pt))&&(Pt=null);const Gt=pt.getComponent();if(Gt){const Xt=Gt.p;Xt!=null?(Fe&&(at[Xt]=Fe),tr[Xt]=Fe||ze===Ge&&Vt?null:it.getComponent(),Ke[Xt]=pt.clone(),Pt&&(Xe[Xt]=Pt.clone())):Gt.r!==void 0&&(Fe||it.write("r",!0),(Fe||Vt)&&(Bn==null&&(Bn=new Set),Bn.add(Gt)))}let In=0,Fn=0;const jn=(0,l.advancer)(bt,void 0,(Xt,Bt)=>{b(Bt)&&In++}),Yn=(0,l.advancer)(Pt,(Xt,Bt)=>S(Bt)?~(Xt-Fn):Xt-Fn,(Xt,Bt)=>{S(Bt)&&Fn++});if(pt)for(const Xt of pt)if(typeof Xt=="string"){const Bt=jn(Xt),St=Yn(Xt);it.descend(Xt),sn(pt,Bt,St,it,Fe),it.ascend()}else{const Bt=jn(Xt),St=Xt-In,un=b(g(Bt))?null:Yn(St),wr=St+Fn;h(wr>=0),it.descend(wr),sn(pt,Bt,un,it,Fe),it.ascend()}jn.end(),Yn.end()})(Pn,On,On.clone(),wn,null),wn.reset();let Qr=[];if(function sn(pt,bt,Pt,it,Fe,Vt){h(bt);const Zt=bt.getComponent();let Gt=g(it),In=!1;const Fn=(he,Qe,rt)=>he?(0,i.moveOp)(he.getPath(),Qe.getPath()):(0,i.insertOp)(Qe.getPath(),rt.i);if(S(Zt)){const he=Zt.d;he!=null&&(_t[he]=bt.clone());const Qe=he!=null?tr[he]:null;let rt=!1;if(Zt.i!==void 0||he!=null&&Qe){let De;Gt&&(Gt.i!==void 0||(De=Gt.d)!=null&&!Dt[De])&&(rt=De!=null?he!=null&&he===ht[De]:(0,o.default)(Gt.i,Zt.i),rt||De!=null&&ze!==Ge&&ht[De]!=null||Ze==null&&(Ze={type:c.ConflictType.DROP_COLLISION,op1:Fn(he!=null?Ke[he]:null,bt,Zt),op2:Fn(De!=null?kt[De]:null,it,Gt)})),rt||(Vt?Ze==null&&(Ze={type:c.ConflictType.RM_UNEXPECTED_CONTENT,op1:Fn(he!=null?Ke[he]:null,bt,Zt),op2:(0,i.removeOp)(Vt.getPath())}):(he!=null?(Qr[cn]=he,Fe.write("d",Qe.p=cn++)):Fe.write("i",(0,a.default)(Zt.i)),In=!0))}else if(he!=null&&!Qe){const De=at[he];De&&(Vt=De.clone())}he!=null?(pt=Ke[he],Pt=We[he],it=Xe[he]):Zt.i!==void 0&&(pt=Pt=null,rt||(it=null))}else b(g(pt))&&(pt=Pt=it=null);const jn=g(pt),Yn=g(Pt);if(b(Yn)){const he=Yn.p;Yn.r!==void 0&&(!jn||jn.r===void 0)||Dt[he]?(it=null,Vt=Pt.clone()):he!=null&&(it=$e[he],ze!==Ge&&ht[he]!=null||((Fe=Ft[he])||(Fe=Ft[he]=(0,l.writeCursor)()),Fe.reset(),Vt=null))}else!S(Zt)&&S(Gt)&&(it=null);Gt=it!=null?it.getComponent():null;const Xt=X(Zt);if(Xt){const he=W(Zt);if(Vt)Ze==null&&(Ze={type:c.ConflictType.RM_UNEXPECTED_CONTENT,op1:(0,i.editOp)(bt.getPath(),Xt,he,!0),op2:(0,i.removeOp)(Vt.getPath())});else{const Qe=X(Gt);let rt;if(Qe){if(Xt!==Qe)throw Error("Transforming incompatible types");const De=W(Gt);rt=Xt.transform(he,De,je)}else rt=(0,a.default)(he);ee(Fe,Xt,rt)}}let Bt=0,St=0,un=0,wr=0,vn=0,ui=0,Wr=pt!=null&&pt.descendFirst(),K=Wr;const te=(0,l.advancer)(Pt,void 0,(he,Qe)=>{b(Qe)&&un++});let ce=it!=null&&it.descendFirst(),Ae=ce;for(const he of bt)if(typeof he=="number"){let Qe;const rt=S(bt.getComponent()),De=he-St;{let Mt;for(pe();Wr&&typeof(Mt=pt.getKey())=="number";){Mt+=Bt;const Jt=pt.getComponent(),nn=b(Jt);if(Mt>De||Mt===De&&(!nn||ze===Re&&rt))break;if(nn){Bt--;const Ht=Jt.p;ht.includes(Ht),Jt.d,g(Ft[Jt.d]),b(g(Ft[Jt.d])),(Jt.r===void 0||Bn&&Bn.has(Jt))&&(Ht==null||!tr[Ht]||ze!==Ge&&ht.includes(Ht))||vn--}Wr=pt.nextSibling()}Qe=Wr&&Mt===De?pt:null}const Ye=De-Bt;let $t=te(Ye);const ot=Ye-un;let on=null;{let Mt,Jt;for(pe();ce&&typeof(Mt=it.getKey())=="number";){Jt=Mt-wr;const nn=it.getComponent(),Ht=S(nn);if(Jt>ot)break;if(Jt===ot){if(!Ht){on=it;break}{if(ze===Re&&rt){on=it;break}const rn=$t&&b($t.getComponent());if(ze===Re&&rn)break}}if(Ht){const rn=nn.d;Dt[rn],ht[rn],nn.i===void 0&&(Dt[rn]||ht[rn]!=null&&ze!==Ge)?(Dt[rn]||ht[rn]!=null&&ze===Re)&&(wr++,ui--):wr++}ce=it.nextSibling()}}const yn=ot+wr+vn+ui;h(yn>=0,"trying to descend to a negative index"),Fe.descend(yn),rt&&(Qe=$t=on=null,St++),sn(Qe,bt,$t,on,Fe,Vt)&&ui++,Fe.ascend()}else{let Qe;for(;Wr&&(Qe=pt.getKey(),typeof Qe!="string"||!(Qe>he||Qe===he));)Wr=pt.nextSibling();const rt=Wr&&Qe===he?pt:null,De=te(he);let Ye;for(;ce&&(Ye=it.getKey(),typeof Ye!="string"||!(Ye>he||Ye===he));)ce=it.nextSibling();const $t=ce&&Ye===he?it:null;Fe.descend(he),sn(rt,bt,De,$t,Fe,Vt),Fe.ascend()}return te.end(),K&&pt.ascend(),Ae&&it.ascend(),In}(Pn,Pn.clone(),On,On.clone(),wn,null),Ze)return{ok:!1,conflict:Ze};wn.reset();const nr=(sn,pt,bt)=>sn.traverse(pt,(Pt,it)=>{Pt.d!=null&&bt(Pt.d,sn,it)});(Dt.length||ct.length)&&(nr(On,wn,(sn,pt,bt)=>{Dt[sn]&&!Le[sn]&&bt.write("r",!0),ct[sn]&&bt.mergeTree(ct[sn].get())}),wn.reset());const Sr=[],ar=[];if((Ft.length||Dt.length)&&!Ze){const sn=(0,l.readCursor)(gt(wn.get()));if(nr(sn,null,(pt,bt)=>{Sr[pt]=bt.clone()}),Ft.forEach(pt=>{pt&&nr((0,l.readCursor)(pt.get()),null,(bt,Pt)=>{Sr[bt]=Pt.clone()})}),function pt(bt,Pt,it,Fe,Vt,Zt){d.prefix++;const Gt=g(Pt);if(Gt&&b(Gt))if(Gt.p!=null){const Bt=Gt.p;Sr[Bt].getPath(),it=Sr[Bt],Fe=ar[Bt]=(0,l.writeCursor)()}else Gt.r!==void 0&&(it=null);else S(g(it))&&(it=null);const In=bt.getComponent();if(In){let Bt;if((Bt=In.d)!=null){const St=Ft[Bt];St&&(St.get(),Fe.mergeTree(St.get()),it=(0,l.readCursor)(St.get()))}}let Fn=0,jn=0;const Yn=(0,l.advancer)(Pt,void 0,(Bt,St)=>{b(St)&&Fn--}),Xt=(0,l.advancer)(it,(Bt,St)=>S(St)?-(Bt-jn)-1:Bt-jn,(Bt,St)=>{S(St)&&jn++});for(const Bt of bt)if(typeof Bt=="number"){const St=Yn(Bt),un=Bt+Fn,wr=Xt(un),vn=un+jn;Fe.descend(vn),pt(bt,St,wr,Fe),Fe.ascend()}else Fe.descend(Bt),pt(bt,Yn(Bt),Xt(Bt),Fe),Fe.ascend();Yn.end(),Xt.end()}(On,sn,sn.clone(),wn),wn.reset(),Ze)return{ok:!1,conflict:Ze};if(wn.get(),ar.length){const pt=ar.map(Pt=>Pt?Pt.get():null),bt=(0,l.readCursor)(gt(wn.get()));if(nr(bt,wn,(Pt,it,Fe)=>{const Vt=pt[Pt];Vt&&(Fe.mergeTree(Vt),pt[Pt]=null)}),pt.find(Pt=>Pt)){const Pt=(0,l.writeCursor)(),it=(0,l.writeCursor)();let Fe=0,Vt=0;pt.forEach(Zt=>{Zt!=null&&nr((0,l.readCursor)(Zt),null,Gt=>{const In=Qr[Gt];Pt.writeMove(Ke[In].getPath(),_t[In].getPath(),Fe++);const Fn=It[In];Fn&&Fn.forEach(jn=>{Dt[jn]||ze!==Ge&&ht[jn]!=null||it.writeMove(kt[jn].getPath(),$e[jn].getPath(),Vt++)})})}),Ze={type:c.ConflictType.BLACKHOLE,op1:Pt.get(),op2:it.get()}}}}return Ze?{ok:!1,conflict:Ze}:{ok:!0,result:wn.get()}}const Ln=I=>{const ge=new Error("Transform detected write conflict");throw ge.conflict=I,ge.type=ge.name="writeConflict",ge};function an(I,ge,je){const ze=tn(I,ge,je);if(ze.ok)return ze.result;Ln(ze.conflict)}const ln=I=>{const ge=(0,l.writeCursor)();return(0,l.readCursor)(I).traverse(ge,(je,ze)=>{(S(je)||X(je))&&ze.write("r",!0)}),ge.get()},Qn=(I,ge)=>{const{type:je,op1:ze,op2:Ze}=I;switch(je){case c.ConflictType.DROP_COLLISION:return ge==="left"?[null,ln(Ze)]:[ln(ze),null];case c.ConflictType.RM_UNEXPECTED_CONTENT:let Ke=!1;return(0,l.readCursor)(ze).traverse(null,_t=>{_t.r!==void 0&&(Ke=!0)}),Ke?[null,ln(Ze)]:[ln(ze),null];case c.ConflictType.BLACKHOLE:return[ln(ze),ln(Ze)];default:throw Error("Unrecognised conflict: "+je)}};function Dn(I,ge,je,ze){let Ze=null;for(;;){const Ke=tn(ge,je,ze);if(Ke.ok)return Y(Ze,Ke.result);{const{conflict:_t}=Ke;I(_t)||Ln(_t);const[kt,$e]=Qn(_t,ze);ge=Y(J(ge),kt),je=Y(J(je),$e),Ze=Y(Ze,$e)}}}},{"./cursor.js":23,"./deepClone.js":24,"./deepEqual.js":25,"./log":28,"./types.js":29,assert:1,"ot-text-unicode":31}],28:[function(t,r,i){Object.defineProperty(i,"__esModule",{value:!0});function s(...o){if(s.quiet)return;const{inspect:a}=t("util"),l=u=>typeof u=="string"?u:a(u,{depth:10,colors:!0}),c=Array(s.prefix).fill(" ").join("");console.log(c+o.map(l).join(" "))}i.default=s,s.quiet=!0,s.prefix=0},{util:37}],29:[function(t,r,i){Object.defineProperty(i,"__esModule",{value:!0}),i.ConflictType=void 0;var s;(function(o){o[o.RM_UNEXPECTED_CONTENT=1]="RM_UNEXPECTED_CONTENT",o[o.DROP_COLLISION=2]="DROP_COLLISION",o[o.BLACKHOLE=3]="BLACKHOLE"})(s||(i.ConflictType=s={}))},{}],30:[function(t,r,i){Object.defineProperty(i,"__esModule",{value:!0});const s=t("./type"),o=t("unicount");function a(l,c){return{get:l,getLength(){return l().length},insert(u,d,h){const m=o.strPosToUni(l(),u);return c([m,d],h)},remove(u,d,h){const m=o.strPosToUni(l(),u);return c([m,{d}],h)},_onOp(u){s.eachOp(u,(d,h,m)=>{switch(typeof d){case"string":this.onInsert&&this.onInsert(m,d);break;case"object":const g=s.dlen(d.d);this.onRemove&&this.onRemove(m,g)}})},onInsert:null,onRemove:null}}i.default=a,a.provides={text:!0}},{"./type":32,unicount:34}],31:[function(t,r,i){var s=this&&this.__createBinding||(Object.create?function(y,b,S,P){P===void 0&&(P=S),Object.defineProperty(y,P,{enumerable:!0,get:function(){return b[S]}})}:function(y,b,S,P){P===void 0&&(P=S),y[P]=b[S]}),o=this&&this.__setModuleDefault||(Object.create?function(y,b){Object.defineProperty(y,"default",{enumerable:!0,value:b})}:function(y,b){y.default=b}),a=this&&this.__importStar||function(y){if(y&&y.__esModule)return y;var b={};if(y!=null)for(var S in y)Object.hasOwnProperty.call(y,S)&&s(b,y,S);return o(b,y),b},l=this&&this.__importDefault||function(y){return y&&y.__esModule?y:{default:y}};Object.defineProperty(i,"__esModule",{value:!0}),i.type=i.remove=i.insert=void 0;const c=t("unicount"),u=a(t("./type")),d=l(t("./api")),h={create(y){return y},toString(y){return y},builder(y){if(typeof y!="string")throw Error("Invalid document snapshot: "+y);const b=[];return{skip(S){let P=c.uniToStrPos(y,S);if(P>y.length)throw Error("The op is too long for this document");b.push(y.slice(0,P)),y=y.slice(P)},append(S){b.push(S)},del(S){y=y.slice(c.uniToStrPos(y,S))},build(){return b.join("")+y}}},slice:u.uniSlice},m=u.default(h),g=Object.assign(Object.assign({},m),{api:d.default});i.type=g,i.insert=(y,b)=>b.length===0?[]:y===0?[b]:[y,b],i.remove=(y,b)=>u.dlen(b)===0?[]:y===0?[{d:b}]:[y,{d:b}];var O=t("./type");Object.defineProperty(i,"makeType",{enumerable:!0,get:function(){return O.default}})},{"./api":30,"./type":32,unicount:34}],32:[function(t,r,i){Object.defineProperty(i,"__esModule",{value:!0}),i.uniSlice=i.dlen=i.eachOp=void 0;const s=t("unicount"),o=_=>{if(!Array.isArray(_))throw Error("Op must be an array of components");let R=null;for(let $=0;$<_.length;$++){const D=_[$];switch(typeof D){case"object":if(typeof D.d!="number"&&typeof D.d!="string")throw Error("Delete must be number or string");if(i.dlen(D.d)<=0)throw Error("Deletes must not be empty");break;case"string":if(!(D.length>0))throw Error("Inserts cannot be empty");break;case"number":if(!(D>0))throw Error("Skip components must be >0");if(typeof R=="number")throw Error("Adjacent skip components should be combined");break}R=D}if(typeof R=="number")throw Error("Op has a trailing skip")};function a(_,R){let $=0,D=0;for(let F=0;F<_.length;F++){const G=_[F];switch(R(G,$,D),typeof G){case"object":$+=i.dlen(G.d);break;case"string":D+=s.strPosToUni(G);break;case"number":$+=G,D+=G;break}}}i.eachOp=a;function l(_,R){const $=[],D=d($);return a(_,(F,G,ue)=>{D(R(F,G,ue))}),O($)}const c=_=>_,u=_=>l(_,c);i.dlen=_=>typeof _=="number"?_:s.strPosToUni(_);const d=_=>R=>{if(!(!R||R.d===0||R.d===""))if(_.length===0)_.push(R);else if(typeof R==typeof _[_.length-1])if(typeof R=="object"){const $=_[_.length-1];$.d=typeof $.d=="string"&&typeof R.d=="string"?$.d+R.d:i.dlen($.d)+i.dlen(R.d)}else _[_.length-1]+=R;else _.push(R)},h=_=>typeof _=="number"?_:typeof _=="string"?s.strPosToUni(_):typeof _.d=="number"?_.d:s.strPosToUni(_.d);i.uniSlice=(_,R,$)=>{const D=s.uniToStrPos(_,R),F=$==null?1/0:s.uniToStrPos(_,$);return _.slice(D,F)};const m=(_,R,$)=>typeof _=="number"?$==null?_-R:Math.min(_,$)-R:i.uniSlice(_,R,$),g=_=>{let R=0,$=0;return{take:(G,ue)=>{if(R===_.length)return G===-1?null:G;const B=_[R];let X;if(typeof B=="number")return G===-1||B-$<=G?(X=B-$,++R,$=0,X):($+=G,G);if(typeof B=="string"){if(G===-1||ue==="i"||s.strPosToUni(B.slice($))<=G)return X=B.slice($),++R,$=0,X;{const W=$+s.uniToStrPos(B.slice($),G);return X=B.slice($,W),$=W,X}}else{if(G===-1||ue==="d"||i.dlen(B.d)-$<=G)return X={d:m(B.d,$)},++R,$=0,X;{let W=m(B.d,$,$+G);return $+=G,{d:W}}}},peek:()=>_[R]}},O=_=>(_.length>0&&typeof _[_.length-1]=="number"&&_.pop(),_);function y(_,R,$){if($!=="left"&&$!=="right")throw Error("side ("+$+") must be 'left' or 'right'");o(_),o(R);const D=[],F=d(D),{take:G,peek:ue}=g(_);for(let X=0;X<R.length;X++){const W=R[X];let ee,re;switch(typeof W){case"number":for(ee=W;ee>0;)re=G(ee,"i"),F(re),typeof re!="string"&&(ee-=h(re));break;case"string":$==="left"&&typeof ue()=="string"&&F(G(-1)),F(s.strPosToUni(W));break;case"object":for(ee=i.dlen(W.d);ee>0;)switch(re=G(ee,"i"),typeof re){case"number":ee-=re;break;case"string":F(re);break;case"object":ee-=i.dlen(re.d)}break}}let B;for(;B=G(-1);)F(B);return O(D)}function b(_,R){o(_),o(R);const $=[],D=d($),{take:F}=g(_);for(let ue=0;ue<R.length;ue++){const B=R[ue];let X,W;switch(typeof B){case"number":for(X=B;X>0;)W=F(X,"d"),D(W),typeof W!="object"&&(X-=h(W));break;case"string":D(B);break;case"object":X=i.dlen(B.d);let ee=0;for(;ee<X;)switch(W=F(X-ee,"d"),typeof W){case"number":D({d:m(B.d,ee,ee+W)}),ee+=W;break;case"string":ee+=s.strPosToUni(W);break;case"object":D(W)}break}}let G;for(;G=F(-1);)D(G);return O($)}const S=(_,R)=>{let $=0;for(let D=0;D<R.length&&_>$;D++){const F=R[D];switch(typeof F){case"number":{$+=F;break}case"string":const G=s.strPosToUni(F);$+=G,_+=G;break;case"object":_-=Math.min(i.dlen(F.d),_-$);break}}return _},P=(_,R)=>typeof _=="number"?S(_,R):_.map($=>S($,R));function k(_,R,$){return l(_,(D,F)=>typeof D=="object"&&typeof D.d=="number"?{d:$.slice(R,F,F+D.d)}:D)}function x(_){return l(_,R=>{switch(typeof R){case"object":if(typeof R.d=="number")throw Error("Cannot invert text op: Deleted characters missing from operation. makeInvertible must be called first.");return R.d;case"string":return{d:R};case"number":return R}})}function A(_){return l(_,R=>typeof R=="object"&&typeof R.d=="string"?{d:s.strPosToUni(R.d)}:R)}function M(_){let R=!0;return a(_,$=>{typeof $=="object"&&typeof $.d=="number"&&(R=!1)}),R}function Q(_){return{name:"text-unicode",uri:"http://sharejs.org/types/text-unicode",trim:O,normalize:u,checkOp:o,create(R=""){if(typeof R!="string")throw Error("Initial data must be a string");return _.create(R)},apply(R,$){o($);const D=_.builder(R);for(let F=0;F<$.length;F++){const G=$[F];switch(typeof G){case"number":D.skip(G);break;case"string":D.append(G);break;case"object":D.del(i.dlen(G.d));break}}return D.build()},transform:y,compose:b,transformPosition:S,transformSelection:P,isInvertible:M,makeInvertible(R,$){return k(R,$,_)},stripInvertible:A,invert:x,invertWithDoc(R,$){return x(k(R,$,_))},isNoop:R=>R.length===0}}i.default=Q},{unicount:34}],33:[function(t,r,i){var s=r.exports={},o,a;function l(){throw new Error("setTimeout has not been defined")}function c(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?o=setTimeout:o=l}catch{o=l}try{typeof clearTimeout=="function"?a=clearTimeout:a=c}catch{a=c}})();function u(k){if(o===setTimeout)return setTimeout(k,0);if((o===l||!o)&&setTimeout)return o=setTimeout,setTimeout(k,0);try{return o(k,0)}catch{try{return o.call(null,k,0)}catch{return o.call(this,k,0)}}}function d(k){if(a===clearTimeout)return clearTimeout(k);if((a===c||!a)&&clearTimeout)return a=clearTimeout,clearTimeout(k);try{return a(k)}catch{try{return a.call(null,k)}catch{return a.call(this,k)}}}var h=[],m=!1,g,O=-1;function y(){!m||!g||(m=!1,g.length?h=g.concat(h):O=-1,h.length&&b())}function b(){if(!m){var k=u(y);m=!0;for(var x=h.length;x;){for(g=h,h=[];++O<x;)g&&g[O].run();O=-1,x=h.length}g=null,m=!1,d(k)}}s.nextTick=function(k){var x=new Array(arguments.length-1);if(arguments.length>1)for(var A=1;A<arguments.length;A++)x[A-1]=arguments[A];h.push(new S(k,x)),h.length===1&&!m&&u(b)};function S(k,x){this.fun=k,this.array=x}S.prototype.run=function(){this.fun.apply(null,this.array)},s.title="browser",s.browser=!0,s.env={},s.argv=[],s.version="",s.versions={};function P(){}s.on=P,s.addListener=P,s.once=P,s.off=P,s.removeListener=P,s.removeAllListeners=P,s.emit=P,s.prependListener=P,s.prependOnceListener=P,s.listeners=function(k){return[]},s.binding=function(k){throw new Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(k){throw new Error("process.chdir is not supported")},s.umask=function(){return 0}},{}],34:[function(t,r,i){Object.defineProperty(i,"__esModule",{value:!0}),i.uniToStrPos=i.strPosToUni=void 0,i.strPosToUni=(s,o=s.length)=>{let a=0,l=0;for(;l<o;l++){const c=s.charCodeAt(l);c>=55296&&c<=57343&&(a++,l++)}if(l!==o)throw Error("Invalid offset - splits unicode bytes");return l-a},i.uniToStrPos=(s,o)=>{let a=0;for(;o>0;o--){const l=s.charCodeAt(a);a+=l>=55296&&l<=57343?2:1}return a}},{}],35:[function(t,r,i){arguments[4][3][0].apply(i,arguments)},{dup:3}],36:[function(t,r,i){var s=t("is-arguments"),o=t("is-generator-function"),a=t("which-typed-array"),l=t("is-typed-array");function c(I){return I.call.bind(I)}var u=typeof BigInt<"u",d=typeof Symbol<"u",h=c(Object.prototype.toString),m=c(Number.prototype.valueOf),g=c(String.prototype.valueOf),O=c(Boolean.prototype.valueOf);if(u)var y=c(BigInt.prototype.valueOf);if(d)var b=c(Symbol.prototype.valueOf);function S(I,ge){if(typeof I!="object")return!1;try{return ge(I),!0}catch{return!1}}i.isArgumentsObject=s,i.isGeneratorFunction=o,i.isTypedArray=l;function P(I){return typeof Promise<"u"&&I instanceof Promise||I!==null&&typeof I=="object"&&typeof I.then=="function"&&typeof I.catch=="function"}i.isPromise=P;function k(I){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(I):l(I)||j(I)}i.isArrayBufferView=k;function x(I){return a(I)==="Uint8Array"}i.isUint8Array=x;function A(I){return a(I)==="Uint8ClampedArray"}i.isUint8ClampedArray=A;function M(I){return a(I)==="Uint16Array"}i.isUint16Array=M;function Q(I){return a(I)==="Uint32Array"}i.isUint32Array=Q;function _(I){return a(I)==="Int8Array"}i.isInt8Array=_;function R(I){return a(I)==="Int16Array"}i.isInt16Array=R;function $(I){return a(I)==="Int32Array"}i.isInt32Array=$;function D(I){return a(I)==="Float32Array"}i.isFloat32Array=D;function F(I){return a(I)==="Float64Array"}i.isFloat64Array=F;function G(I){return a(I)==="BigInt64Array"}i.isBigInt64Array=G;function ue(I){return a(I)==="BigUint64Array"}i.isBigUint64Array=ue;function B(I){return h(I)==="[object Map]"}B.working=typeof Map<"u"&&B(new Map);function X(I){return typeof Map>"u"?!1:B.working?B(I):I instanceof Map}i.isMap=X;function W(I){return h(I)==="[object Set]"}W.working=typeof Set<"u"&&W(new Set);function ee(I){return typeof Set>"u"?!1:W.working?W(I):I instanceof Set}i.isSet=ee;function re(I){return h(I)==="[object WeakMap]"}re.working=typeof WeakMap<"u"&&re(new WeakMap);function H(I){return typeof WeakMap>"u"?!1:re.working?re(I):I instanceof WeakMap}i.isWeakMap=H;function se(I){return h(I)==="[object WeakSet]"}se.working=typeof WeakSet<"u"&&se(new WeakSet);function J(I){return se(I)}i.isWeakSet=J;function oe(I){return h(I)==="[object ArrayBuffer]"}oe.working=typeof ArrayBuffer<"u"&&oe(new ArrayBuffer);function pe(I){return typeof ArrayBuffer>"u"?!1:oe.working?oe(I):I instanceof ArrayBuffer}i.isArrayBuffer=pe;function Ee(I){return h(I)==="[object DataView]"}Ee.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&Ee(new DataView(new ArrayBuffer(1),0,1));function j(I){return typeof DataView>"u"?!1:Ee.working?Ee(I):I instanceof DataView}i.isDataView=j;var V=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function Y(I){return h(I)==="[object SharedArrayBuffer]"}function de(I){return typeof V>"u"?!1:(typeof Y.working>"u"&&(Y.working=Y(new V)),Y.working?Y(I):I instanceof V)}i.isSharedArrayBuffer=de;function ke(I){return h(I)==="[object AsyncFunction]"}i.isAsyncFunction=ke;function Te(I){return h(I)==="[object Map Iterator]"}i.isMapIterator=Te;function Pe(I){return h(I)==="[object Set Iterator]"}i.isSetIterator=Pe;function Re(I){return h(I)==="[object Generator]"}i.isGeneratorObject=Re;function Ge(I){return h(I)==="[object WebAssembly.Module]"}i.isWebAssemblyCompiledModule=Ge;function gt(I){return S(I,m)}i.isNumberObject=gt;function tn(I){return S(I,g)}i.isStringObject=tn;function Ln(I){return S(I,O)}i.isBooleanObject=Ln;function an(I){return u&&S(I,y)}i.isBigIntObject=an;function ln(I){return d&&S(I,b)}i.isSymbolObject=ln;function Qn(I){return gt(I)||tn(I)||Ln(I)||an(I)||ln(I)}i.isBoxedPrimitive=Qn;function Dn(I){return typeof Uint8Array<"u"&&(pe(I)||de(I))}i.isAnyArrayBuffer=Dn,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(I){Object.defineProperty(i,I,{enumerable:!1,value:function(){throw new Error(I+" is not supported in userland")}})})},{"is-arguments":18,"is-generator-function":20,"is-typed-array":21,"which-typed-array":38}],37:[function(t,r,i){(function(s){(function(){var o=Object.getOwnPropertyDescriptors||function(V){for(var Y=Object.keys(V),de={},ke=0;ke<Y.length;ke++)de[Y[ke]]=Object.getOwnPropertyDescriptor(V,Y[ke]);return de},a=/%[sdj%]/g;i.format=function(j){if(!R(j)){for(var V=[],Y=0;Y<arguments.length;Y++)V.push(d(arguments[Y]));return V.join(" ")}for(var Y=1,de=arguments,ke=de.length,Te=String(j).replace(a,function(Re){if(Re==="%%")return"%";if(Y>=ke)return Re;switch(Re){case"%s":return String(de[Y++]);case"%d":return Number(de[Y++]);case"%j":try{return JSON.stringify(de[Y++])}catch{return"[Circular]"}default:return Re}}),Pe=de[Y];Y<ke;Pe=de[++Y])M(Pe)||!G(Pe)?Te+=" "+Pe:Te+=" "+d(Pe);return Te},i.deprecate=function(j,V){if(typeof s<"u"&&s.noDeprecation===!0)return j;if(typeof s>"u")return function(){return i.deprecate(j,V).apply(this,arguments)};var Y=!1;function de(){if(!Y){if(s.throwDeprecation)throw new Error(V);s.traceDeprecation?console.trace(V):console.error(V),Y=!0}return j.apply(this,arguments)}return de};var l={},c=/^$/;if(s.env.NODE_DEBUG){var u=s.env.NODE_DEBUG;u=u.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),c=new RegExp("^"+u+"$","i")}i.debuglog=function(j){if(j=j.toUpperCase(),!l[j])if(c.test(j)){var V=s.pid;l[j]=function(){var Y=i.format.apply(i,arguments);console.error("%s %d: %s",j,V,Y)}}else l[j]=function(){};return l[j]};function d(j,V){var Y={seen:[],stylize:m};return arguments.length>=3&&(Y.depth=arguments[2]),arguments.length>=4&&(Y.colors=arguments[3]),A(V)?Y.showHidden=V:V&&i._extend(Y,V),D(Y.showHidden)&&(Y.showHidden=!1),D(Y.depth)&&(Y.depth=2),D(Y.colors)&&(Y.colors=!1),D(Y.customInspect)&&(Y.customInspect=!0),Y.colors&&(Y.stylize=h),O(Y,j,Y.depth)}i.inspect=d,d.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},d.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function h(j,V){var Y=d.styles[V];return Y?"\x1B["+d.colors[Y][0]+"m"+j+"\x1B["+d.colors[Y][1]+"m":j}function m(j,V){return j}function g(j){var V={};return j.forEach(function(Y,de){V[Y]=!0}),V}function O(j,V,Y){if(j.customInspect&&V&&X(V.inspect)&&V.inspect!==i.inspect&&!(V.constructor&&V.constructor.prototype===V)){var de=V.inspect(Y,j);return R(de)||(de=O(j,de,Y)),de}var ke=y(j,V);if(ke)return ke;var Te=Object.keys(V),Pe=g(Te);if(j.showHidden&&(Te=Object.getOwnPropertyNames(V)),B(V)&&(Te.indexOf("message")>=0||Te.indexOf("description")>=0))return b(V);if(Te.length===0){if(X(V)){var Re=V.name?": "+V.name:"";return j.stylize("[Function"+Re+"]","special")}if(F(V))return j.stylize(RegExp.prototype.toString.call(V),"regexp");if(ue(V))return j.stylize(Date.prototype.toString.call(V),"date");if(B(V))return b(V)}var Ge="",gt=!1,tn=["{","}"];if(x(V)&&(gt=!0,tn=["[","]"]),X(V)){var Ln=V.name?": "+V.name:"";Ge=" [Function"+Ln+"]"}if(F(V)&&(Ge=" "+RegExp.prototype.toString.call(V)),ue(V)&&(Ge=" "+Date.prototype.toUTCString.call(V)),B(V)&&(Ge=" "+b(V)),Te.length===0&&(!gt||V.length==0))return tn[0]+Ge+tn[1];if(Y<0)return F(V)?j.stylize(RegExp.prototype.toString.call(V),"regexp"):j.stylize("[Object]","special");j.seen.push(V);var an;return gt?an=S(j,V,Y,Pe,Te):an=Te.map(function(ln){return P(j,V,Y,Pe,ln,gt)}),j.seen.pop(),k(an,Ge,tn)}function y(j,V){if(D(V))return j.stylize("undefined","undefined");if(R(V)){var Y="'"+JSON.stringify(V).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return j.stylize(Y,"string")}if(_(V))return j.stylize(""+V,"number");if(A(V))return j.stylize(""+V,"boolean");if(M(V))return j.stylize("null","null")}function b(j){return"["+Error.prototype.toString.call(j)+"]"}function S(j,V,Y,de,ke){for(var Te=[],Pe=0,Re=V.length;Pe<Re;++Pe)J(V,String(Pe))?Te.push(P(j,V,Y,de,String(Pe),!0)):Te.push("");return ke.forEach(function(Ge){Ge.match(/^\d+$/)||Te.push(P(j,V,Y,de,Ge,!0))}),Te}function P(j,V,Y,de,ke,Te){var Pe,Re,Ge;if(Ge=Object.getOwnPropertyDescriptor(V,ke)||{value:V[ke]},Ge.get?Ge.set?Re=j.stylize("[Getter/Setter]","special"):Re=j.stylize("[Getter]","special"):Ge.set&&(Re=j.stylize("[Setter]","special")),J(de,ke)||(Pe="["+ke+"]"),Re||(j.seen.indexOf(Ge.value)<0?(M(Y)?Re=O(j,Ge.value,null):Re=O(j,Ge.value,Y-1),Re.indexOf(`
|
|
69
|
+
`)>-1&&(Te?Re=Re.split(`
|
|
70
|
+
`).map(function(gt){return" "+gt}).join(`
|
|
71
|
+
`).slice(2):Re=`
|
|
72
|
+
`+Re.split(`
|
|
73
|
+
`).map(function(gt){return" "+gt}).join(`
|
|
74
|
+
`))):Re=j.stylize("[Circular]","special")),D(Pe)){if(Te&&ke.match(/^\d+$/))return Re;Pe=JSON.stringify(""+ke),Pe.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(Pe=Pe.slice(1,-1),Pe=j.stylize(Pe,"name")):(Pe=Pe.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),Pe=j.stylize(Pe,"string"))}return Pe+": "+Re}function k(j,V,Y){var de=j.reduce(function(ke,Te){return Te.indexOf(`
|
|
75
|
+
`)>=0,ke+Te.replace(/\u001b\[\d\d?m/g,"").length+1},0);return de>60?Y[0]+(V===""?"":V+`
|
|
76
|
+
`)+" "+j.join(`,
|
|
77
|
+
`)+" "+Y[1]:Y[0]+V+" "+j.join(", ")+" "+Y[1]}i.types=t("./support/types");function x(j){return Array.isArray(j)}i.isArray=x;function A(j){return typeof j=="boolean"}i.isBoolean=A;function M(j){return j===null}i.isNull=M;function Q(j){return j==null}i.isNullOrUndefined=Q;function _(j){return typeof j=="number"}i.isNumber=_;function R(j){return typeof j=="string"}i.isString=R;function $(j){return typeof j=="symbol"}i.isSymbol=$;function D(j){return j===void 0}i.isUndefined=D;function F(j){return G(j)&&ee(j)==="[object RegExp]"}i.isRegExp=F,i.types.isRegExp=F;function G(j){return typeof j=="object"&&j!==null}i.isObject=G;function ue(j){return G(j)&&ee(j)==="[object Date]"}i.isDate=ue,i.types.isDate=ue;function B(j){return G(j)&&(ee(j)==="[object Error]"||j instanceof Error)}i.isError=B,i.types.isNativeError=B;function X(j){return typeof j=="function"}i.isFunction=X;function W(j){return j===null||typeof j=="boolean"||typeof j=="number"||typeof j=="string"||typeof j=="symbol"||typeof j>"u"}i.isPrimitive=W,i.isBuffer=t("./support/isBuffer");function ee(j){return Object.prototype.toString.call(j)}function re(j){return j<10?"0"+j.toString(10):j.toString(10)}var H=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function se(){var j=new Date,V=[re(j.getHours()),re(j.getMinutes()),re(j.getSeconds())].join(":");return[j.getDate(),H[j.getMonth()],V].join(" ")}i.log=function(){console.log("%s - %s",se(),i.format.apply(i,arguments))},i.inherits=t("inherits"),i._extend=function(j,V){if(!V||!G(V))return j;for(var Y=Object.keys(V),de=Y.length;de--;)j[Y[de]]=V[Y[de]];return j};function J(j,V){return Object.prototype.hasOwnProperty.call(j,V)}var oe=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;i.promisify=function(V){if(typeof V!="function")throw new TypeError('The "original" argument must be of type Function');if(oe&&V[oe]){var Y=V[oe];if(typeof Y!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(Y,oe,{value:Y,enumerable:!1,writable:!1,configurable:!0}),Y}function Y(){for(var de,ke,Te=new Promise(function(Ge,gt){de=Ge,ke=gt}),Pe=[],Re=0;Re<arguments.length;Re++)Pe.push(arguments[Re]);Pe.push(function(Ge,gt){Ge?ke(Ge):de(gt)});try{V.apply(this,Pe)}catch(Ge){ke(Ge)}return Te}return Object.setPrototypeOf(Y,Object.getPrototypeOf(V)),oe&&Object.defineProperty(Y,oe,{value:Y,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(Y,o(V))},i.promisify.custom=oe;function pe(j,V){if(!j){var Y=new Error("Promise was rejected with a falsy value");Y.reason=j,j=Y}return V(j)}function Ee(j){if(typeof j!="function")throw new TypeError('The "original" argument must be of type Function');function V(){for(var Y=[],de=0;de<arguments.length;de++)Y.push(arguments[de]);var ke=Y.pop();if(typeof ke!="function")throw new TypeError("The last argument must be of type Function");var Te=this,Pe=function(){return ke.apply(Te,arguments)};j.apply(this,Y).then(function(Re){s.nextTick(Pe.bind(null,null,Re))},function(Re){s.nextTick(pe.bind(null,Re,Pe))})}return Object.setPrototypeOf(V,Object.getPrototypeOf(j)),Object.defineProperties(V,o(j)),V}i.callbackify=Ee}).call(this)}).call(this,t("_process"))},{"./support/isBuffer":35,"./support/types":36,_process:33,inherits:17}],38:[function(t,r,i){(function(s){(function(){var o=t("for-each"),a=t("available-typed-arrays"),l=t("call-bind/callBound"),c=t("gopd"),u=l("Object.prototype.toString"),d=t("has-tostringtag/shams")(),h=typeof globalThis>"u"?s:globalThis,m=a(),g=l("String.prototype.slice"),O={},y=Object.getPrototypeOf;d&&c&&y&&o(m,function(P){if(typeof h[P]=="function"){var k=new h[P];if(Symbol.toStringTag in k){var x=y(k),A=c(x,Symbol.toStringTag);if(!A){var M=y(x);A=c(M,Symbol.toStringTag)}O[P]=A.get}}});var b=function(k){var x=!1;return o(O,function(A,M){if(!x)try{var Q=A.call(k);Q===M&&(x=Q)}catch{}}),x},S=t("is-typed-array");r.exports=function(k){return S(k)?!d||!(Symbol.toStringTag in k)?g(u(k),8,-1):b(k):!1}}).call(this)}).call(this,typeof Rr<"u"?Rr:typeof self<"u"?self:typeof window<"u"?window:{})},{"available-typed-arrays":5,"call-bind/callBound":6,"for-each":8,gopd:12,"has-tostringtag/shams":15,"is-typed-array":21}],39:[function(t,r,i){const s=t("ot-json1-presence"),o=t("ot-text-unicode");r.exports={json1Presence:s,textUnicode:o}},{"ot-json1-presence":26,"ot-text-unicode":31}]},{},[39])(39)})}(Zy)),Zy.exports}var zq=Xq();const Yq=Us(zq),{json1Presence:bw,textUnicode:k2}=Yq;function Gq(n){return new Worker("/assets/worker-CaP6zYz7.js",{name:n==null?void 0:n.name})}var MT={};function Hq(n,e){return e.forEach(function(t){t&&typeof t!="string"&&!Array.isArray(t)&&Object.keys(t).forEach(function(r){if(r!=="default"&&!(r in n)){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}})}),Object.freeze(n)}var Kq=Object.defineProperty,Jq=(n,e,t)=>e in n?Kq(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,QT=(n,e,t)=>Jq(n,typeof e!="symbol"?e+"":e,t);let vs=class{constructor(){QT(this,"_locking"),QT(this,"_locks"),this._locking=Promise.resolve(),this._locks=0}isLocked(){return this._locks>0}lock(){this._locks+=1;let e;const t=new Promise(i=>e=()=>{this._locks-=1,i()}),r=this._locking.then(()=>e);return this._locking=this._locking.then(()=>t),r}};function $r(n,e){if(!n)throw new Error(e)}const e4=34028234663852886e22,t4=-34028234663852886e22,n4=4294967295,r4=2147483647,i4=-2147483648;function lg(n){if(typeof n!="number")throw new Error("invalid int 32: "+typeof n);if(!Number.isInteger(n)||n>r4||n<i4)throw new Error("invalid int 32: "+n)}function wS(n){if(typeof n!="number")throw new Error("invalid uint 32: "+typeof n);if(!Number.isInteger(n)||n>n4||n<0)throw new Error("invalid uint 32: "+n)}function P2(n){if(typeof n!="number")throw new Error("invalid float 32: "+typeof n);if(Number.isFinite(n)&&(n>e4||n<t4))throw new Error("invalid float 32: "+n)}const x2=Symbol("@bufbuild/protobuf/enum-type");function s4(n){const e=n[x2];return $r(e,"missing enum type on enum object"),e}function T2(n,e,t,r){n[x2]=C2(e,t.map(i=>({no:i.no,name:i.name,localName:n[i.no]})))}function C2(n,e,t){const r=Object.create(null),i=Object.create(null),s=[];for(const o of e){const a=_2(o);s.push(a),r[o.name]=a,i[o.no]=a}return{typeName:n,values:s,findName(o){return r[o]},findNumber(o){return i[o]}}}function o4(n,e,t){const r={};for(const i of e){const s=_2(i);r[s.localName]=s.no,r[s.no]=s.localName}return T2(r,n,e),r}function _2(n){return"localName"in n?n:Object.assign(Object.assign({},n),{localName:n.name})}class Sw{equals(e){return this.getType().runtime.util.equals(this.getType(),this,e)}clone(){return this.getType().runtime.util.clone(this)}fromBinary(e,t){const r=this.getType(),i=r.runtime.bin,s=i.makeReadOptions(t);return i.readMessage(this,s.readerFactory(e),e.byteLength,s),this}fromJson(e,t){const r=this.getType(),i=r.runtime.json,s=i.makeReadOptions(t);return i.readMessage(r,e,s,this),this}fromJsonString(e,t){let r;try{r=JSON.parse(e)}catch(i){throw new Error("cannot decode ".concat(this.getType().typeName," from JSON: ").concat(i instanceof Error?i.message:String(i)))}return this.fromJson(r,t)}toBinary(e){const t=this.getType(),r=t.runtime.bin,i=r.makeWriteOptions(e),s=i.writerFactory();return r.writeMessage(this,s,i),s.finish()}toJson(e){const t=this.getType(),r=t.runtime.json,i=r.makeWriteOptions(e);return r.writeMessage(this,i)}toJsonString(e){var t;const r=this.toJson(e);return JSON.stringify(r,null,(t=e==null?void 0:e.prettySpaces)!==null&&t!==void 0?t:0)}toJSON(){return this.toJson({emitDefaultValues:!0})}getType(){return Object.getPrototypeOf(this).constructor}}function a4(n,e,t,r){var i;const s=(i=r==null?void 0:r.localName)!==null&&i!==void 0?i:e.substring(e.lastIndexOf(".")+1),o={[s]:function(a){n.util.initFields(this),n.util.initPartial(a,this)}}[s];return Object.setPrototypeOf(o.prototype,new Sw),Object.assign(o,{runtime:n,typeName:e,fields:n.util.newFieldList(t),fromBinary(a,l){return new o().fromBinary(a,l)},fromJson(a,l){return new o().fromJson(a,l)},fromJsonString(a,l){return new o().fromJsonString(a,l)},equals(a,l){return n.util.equals(o,a,l)}}),o}function l4(){let n=0,e=0;for(let r=0;r<28;r+=7){let i=this.buf[this.pos++];if(n|=(i&127)<<r,(i&128)==0)return this.assertBounds(),[n,e]}let t=this.buf[this.pos++];if(n|=(t&15)<<28,e=(t&112)>>4,(t&128)==0)return this.assertBounds(),[n,e];for(let r=3;r<=31;r+=7){let i=this.buf[this.pos++];if(e|=(i&127)<<r,(i&128)==0)return this.assertBounds(),[n,e]}throw new Error("invalid varint")}function Wy(n,e,t){for(let s=0;s<28;s=s+7){const o=n>>>s,a=!(!(o>>>7)&&e==0),l=(a?o|128:o)&255;if(t.push(l),!a)return}const r=n>>>28&15|(e&7)<<4,i=e>>3!=0;if(t.push((i?r|128:r)&255),!!i){for(let s=3;s<31;s=s+7){const o=e>>>s,a=!!(o>>>7),l=(a?o|128:o)&255;if(t.push(l),!a)return}t.push(e>>>31&1)}}const cg=4294967296;function DT(n){const e=n[0]==="-";e&&(n=n.slice(1));const t=1e6;let r=0,i=0;function s(o,a){const l=Number(n.slice(o,a));i*=t,r=r*t+l,r>=cg&&(i=i+(r/cg|0),r=r%cg)}return s(-24,-18),s(-18,-12),s(-12,-6),s(-6),e?R2(r,i):ww(r,i)}function c4(n,e){let t=ww(n,e);const r=t.hi&2147483648;r&&(t=R2(t.lo,t.hi));const i=E2(t.lo,t.hi);return r?"-"+i:i}function E2(n,e){if({lo:n,hi:e}=u4(n,e),e<=2097151)return String(cg*e+n);const t=n&16777215,r=(n>>>24|e<<8)&16777215,i=e>>16&65535;let s=t+r*6777216+i*6710656,o=r+i*8147497,a=i*2;const l=1e7;return s>=l&&(o+=Math.floor(s/l),s%=l),o>=l&&(a+=Math.floor(o/l),o%=l),a.toString()+IT(o)+IT(s)}function u4(n,e){return{lo:n>>>0,hi:e>>>0}}function ww(n,e){return{lo:n|0,hi:e|0}}function R2(n,e){return e=~e,n?n=~n+1:e+=1,ww(n,e)}const IT=n=>{const e=String(n);return"0000000".slice(e.length)+e};function jT(n,e){if(n>=0){for(;n>127;)e.push(n&127|128),n=n>>>7;e.push(n)}else{for(let t=0;t<9;t++)e.push(n&127|128),n=n>>7;e.push(1)}}function f4(){let n=this.buf[this.pos++],e=n&127;if((n&128)==0)return this.assertBounds(),e;if(n=this.buf[this.pos++],e|=(n&127)<<7,(n&128)==0)return this.assertBounds(),e;if(n=this.buf[this.pos++],e|=(n&127)<<14,(n&128)==0)return this.assertBounds(),e;if(n=this.buf[this.pos++],e|=(n&127)<<21,(n&128)==0)return this.assertBounds(),e;n=this.buf[this.pos++],e|=(n&15)<<28;for(let t=5;(n&128)!==0&&t<10;t++)n=this.buf[this.pos++];if((n&128)!=0)throw new Error("invalid varint");return this.assertBounds(),e>>>0}function d4(){const n=new DataView(new ArrayBuffer(8));if(typeof BigInt=="function"&&typeof n.getBigInt64=="function"&&typeof n.getBigUint64=="function"&&typeof n.setBigInt64=="function"&&typeof n.setBigUint64=="function"&&(typeof process!="object"||typeof MT!="object"||MT.BUF_BIGINT_DISABLE!=="1")){const i=BigInt("-9223372036854775808"),s=BigInt("9223372036854775807"),o=BigInt("0"),a=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(l){const c=typeof l=="bigint"?l:BigInt(l);if(c>s||c<i)throw new Error("int64 invalid: ".concat(l));return c},uParse(l){const c=typeof l=="bigint"?l:BigInt(l);if(c>a||c<o)throw new Error("uint64 invalid: ".concat(l));return c},enc(l){return n.setBigInt64(0,this.parse(l),!0),{lo:n.getInt32(0,!0),hi:n.getInt32(4,!0)}},uEnc(l){return n.setBigInt64(0,this.uParse(l),!0),{lo:n.getInt32(0,!0),hi:n.getInt32(4,!0)}},dec(l,c){return n.setInt32(0,l,!0),n.setInt32(4,c,!0),n.getBigInt64(0,!0)},uDec(l,c){return n.setInt32(0,l,!0),n.setInt32(4,c,!0),n.getBigUint64(0,!0)}}}const t=i=>$r(/^-?[0-9]+$/.test(i),"int64 invalid: ".concat(i)),r=i=>$r(/^[0-9]+$/.test(i),"uint64 invalid: ".concat(i));return{zero:"0",supported:!1,parse(i){return typeof i!="string"&&(i=i.toString()),t(i),i},uParse(i){return typeof i!="string"&&(i=i.toString()),r(i),i},enc(i){return typeof i!="string"&&(i=i.toString()),t(i),DT(i)},uEnc(i){return typeof i!="string"&&(i=i.toString()),r(i),DT(i)},dec(i,s){return c4(i,s)},uDec(i,s){return E2(i,s)}}}const yr=d4();var Ie;(function(n){n[n.DOUBLE=1]="DOUBLE",n[n.FLOAT=2]="FLOAT",n[n.INT64=3]="INT64",n[n.UINT64=4]="UINT64",n[n.INT32=5]="INT32",n[n.FIXED64=6]="FIXED64",n[n.FIXED32=7]="FIXED32",n[n.BOOL=8]="BOOL",n[n.STRING=9]="STRING",n[n.BYTES=12]="BYTES",n[n.UINT32=13]="UINT32",n[n.SFIXED32=15]="SFIXED32",n[n.SFIXED64=16]="SFIXED64",n[n.SINT32=17]="SINT32",n[n.SINT64=18]="SINT64"})(Ie||(Ie={}));var kl;(function(n){n[n.BIGINT=0]="BIGINT",n[n.STRING=1]="STRING"})(kl||(kl={}));function Ja(n,e,t){if(e===t)return!0;if(n==Ie.BYTES){if(!(e instanceof Uint8Array)||!(t instanceof Uint8Array)||e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}switch(n){case Ie.UINT64:case Ie.FIXED64:case Ie.INT64:case Ie.SFIXED64:case Ie.SINT64:return e==t}return!1}function Fu(n,e){switch(n){case Ie.BOOL:return!1;case Ie.UINT64:case Ie.FIXED64:case Ie.INT64:case Ie.SFIXED64:case Ie.SINT64:return e==0?yr.zero:"0";case Ie.DOUBLE:case Ie.FLOAT:return 0;case Ie.BYTES:return new Uint8Array(0);case Ie.STRING:return"";default:return 0}}function A2(n,e){switch(n){case Ie.BOOL:return e===!1;case Ie.STRING:return e==="";case Ie.BYTES:return e instanceof Uint8Array&&!e.byteLength;default:return e==0}}var Nr;(function(n){n[n.Varint=0]="Varint",n[n.Bit64=1]="Bit64",n[n.LengthDelimited=2]="LengthDelimited",n[n.StartGroup=3]="StartGroup",n[n.EndGroup=4]="EndGroup",n[n.Bit32=5]="Bit32"})(Nr||(Nr={}));class h4{constructor(e){this.stack=[],this.textEncoder=e??new TextEncoder,this.chunks=[],this.buf=[]}finish(){this.chunks.push(new Uint8Array(this.buf));let e=0;for(let i=0;i<this.chunks.length;i++)e+=this.chunks[i].length;let t=new Uint8Array(e),r=0;for(let i=0;i<this.chunks.length;i++)t.set(this.chunks[i],r),r+=this.chunks[i].length;return this.chunks=[],t}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let e=this.finish(),t=this.stack.pop();if(!t)throw new Error("invalid state, fork stack empty");return this.chunks=t.chunks,this.buf=t.buf,this.uint32(e.byteLength),this.raw(e)}tag(e,t){return this.uint32((e<<3|t)>>>0)}raw(e){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(e),this}uint32(e){for(wS(e);e>127;)this.buf.push(e&127|128),e=e>>>7;return this.buf.push(e),this}int32(e){return lg(e),jT(e,this.buf),this}bool(e){return this.buf.push(e?1:0),this}bytes(e){return this.uint32(e.byteLength),this.raw(e)}string(e){let t=this.textEncoder.encode(e);return this.uint32(t.byteLength),this.raw(t)}float(e){P2(e);let t=new Uint8Array(4);return new DataView(t.buffer).setFloat32(0,e,!0),this.raw(t)}double(e){let t=new Uint8Array(8);return new DataView(t.buffer).setFloat64(0,e,!0),this.raw(t)}fixed32(e){wS(e);let t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e,!0),this.raw(t)}sfixed32(e){lg(e);let t=new Uint8Array(4);return new DataView(t.buffer).setInt32(0,e,!0),this.raw(t)}sint32(e){return lg(e),e=(e<<1^e>>31)>>>0,jT(e,this.buf),this}sfixed64(e){let t=new Uint8Array(8),r=new DataView(t.buffer),i=yr.enc(e);return r.setInt32(0,i.lo,!0),r.setInt32(4,i.hi,!0),this.raw(t)}fixed64(e){let t=new Uint8Array(8),r=new DataView(t.buffer),i=yr.uEnc(e);return r.setInt32(0,i.lo,!0),r.setInt32(4,i.hi,!0),this.raw(t)}int64(e){let t=yr.enc(e);return Wy(t.lo,t.hi,this.buf),this}sint64(e){let t=yr.enc(e),r=t.hi>>31,i=t.lo<<1^r,s=(t.hi<<1|t.lo>>>31)^r;return Wy(i,s,this.buf),this}uint64(e){let t=yr.uEnc(e);return Wy(t.lo,t.hi,this.buf),this}}class p4{constructor(e,t){this.varint64=l4,this.uint32=f4,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength),this.textDecoder=t??new TextDecoder}tag(){let e=this.uint32(),t=e>>>3,r=e&7;if(t<=0||r<0||r>5)throw new Error("illegal tag: field no "+t+" wire type "+r);return[t,r]}skip(e,t){let r=this.pos;switch(e){case Nr.Varint:for(;this.buf[this.pos++]&128;);break;case Nr.Bit64:this.pos+=4;case Nr.Bit32:this.pos+=4;break;case Nr.LengthDelimited:let i=this.uint32();this.pos+=i;break;case Nr.StartGroup:for(;;){const[s,o]=this.tag();if(o===Nr.EndGroup){if(t!==void 0&&s!==t)throw new Error("invalid end group tag");break}this.skip(o,s)}break;default:throw new Error("cant skip wire type "+e)}return this.assertBounds(),this.buf.subarray(r,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)}int64(){return yr.dec(...this.varint64())}uint64(){return yr.uDec(...this.varint64())}sint64(){let[e,t]=this.varint64(),r=-(e&1);return e=(e>>>1|(t&1)<<31)^r,t=t>>>1^r,yr.dec(e,t)}bool(){let[e,t]=this.varint64();return e!==0||t!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return yr.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return yr.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let e=this.uint32(),t=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(t,t+e)}string(){return this.textDecoder.decode(this.bytes())}}function m4(n,e,t,r){let i;return{typeName:e,extendee:t,get field(){if(!i){const s=typeof r=="function"?r():r;s.name=e.split(".").pop(),s.jsonName="[".concat(e,"]"),i=n.util.newFieldList([s]).list()[0]}return i},runtime:n}}function $2(n){const e=n.field.localName,t=Object.create(null);return t[e]=g4(n),[t,()=>t[e]]}function g4(n){const e=n.field;if(e.repeated)return[];if(e.default!==void 0)return e.default;switch(e.kind){case"enum":return e.T.values[0].no;case"scalar":return Fu(e.T,e.L);case"message":const t=e.T,r=new t;return t.fieldWrapper?t.fieldWrapper.unwrapField(r):r;case"map":throw"map fields are not allowed to be extensions"}}function O4(n,e){if(!e.repeated&&(e.kind=="enum"||e.kind=="scalar")){for(let t=n.length-1;t>=0;--t)if(n[t].no==e.no)return[n[t]];return[]}return n.filter(t=>t.no===e.no)}let Oa="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),jO=[];for(let n=0;n<Oa.length;n++)jO[Oa[n].charCodeAt(0)]=n;jO[45]=Oa.indexOf("+");jO[95]=Oa.indexOf("/");const M2={dec(n){let e=n.length*3/4;n[n.length-2]=="="?e-=2:n[n.length-1]=="="&&(e-=1);let t=new Uint8Array(e),r=0,i=0,s,o=0;for(let a=0;a<n.length;a++){if(s=jO[n.charCodeAt(a)],s===void 0)switch(n[a]){case"=":i=0;case`
|
|
78
|
+
`:case"\r":case" ":case" ":continue;default:throw Error("invalid base64 string.")}switch(i){case 0:o=s,i=1;break;case 1:t[r++]=o<<2|(s&48)>>4,o=s,i=2;break;case 2:t[r++]=(o&15)<<4|(s&60)>>2,o=s,i=3;break;case 3:t[r++]=(o&3)<<6|s,i=0;break}}if(i==1)throw Error("invalid base64 string.");return t.subarray(0,r)},enc(n){let e="",t=0,r,i=0;for(let s=0;s<n.length;s++)switch(r=n[s],t){case 0:e+=Oa[r>>2],i=(r&3)<<4,t=1;break;case 1:e+=Oa[i|r>>4],i=(r&15)<<2,t=2;break;case 2:e+=Oa[i|r>>6],e+=Oa[r&63],t=0;break}return t&&(e+=Oa[i],e+="=",t==1&&(e+="=")),e}};function v4(n,e,t){D2(e,n);const r=e.runtime.bin.makeReadOptions(t),i=O4(n.getType().runtime.bin.listUnknownFields(n),e.field),[s,o]=$2(e);for(const a of i)e.runtime.bin.readField(s,r.readerFactory(a.data),e.field,a.wireType,r);return o()}function y4(n,e,t,r){D2(e,n);const i=e.runtime.bin.makeReadOptions(r),s=e.runtime.bin.makeWriteOptions(r);if(Q2(n,e)){const c=n.getType().runtime.bin.listUnknownFields(n).filter(u=>u.no!=e.field.no);n.getType().runtime.bin.discardUnknownFields(n);for(const u of c)n.getType().runtime.bin.onUnknownField(n,u.no,u.wireType,u.data)}const o=s.writerFactory();let a=e.field;!a.opt&&!a.repeated&&(a.kind=="enum"||a.kind=="scalar")&&(a=Object.assign(Object.assign({},e.field),{opt:!0})),e.runtime.bin.writeField(a,t,o,s);const l=i.readerFactory(o.finish());for(;l.pos<l.len;){const[c,u]=l.tag(),d=l.skip(u,c);n.getType().runtime.bin.onUnknownField(n,c,u,d)}}function Q2(n,e){const t=n.getType();return e.extendee.typeName===t.typeName&&!!t.runtime.bin.listUnknownFields(n).find(r=>r.no==e.field.no)}function D2(n,e){$r(n.extendee.typeName==e.getType().typeName,"extension ".concat(n.typeName," can only be applied to message ").concat(n.extendee.typeName))}function I2(n,e){const t=n.localName;if(n.repeated)return e[t].length>0;if(n.oneof)return e[n.oneof.localName].case===t;switch(n.kind){case"enum":case"scalar":return n.opt||n.req?e[t]!==void 0:n.kind=="enum"?e[t]!==n.T.values[0].no:!A2(n.T,e[t]);case"message":return e[t]!==void 0;case"map":return Object.keys(e[t]).length>0}}function NT(n,e){const t=n.localName,r=!n.opt&&!n.req;if(n.repeated)e[t]=[];else if(n.oneof)e[n.oneof.localName]={case:void 0};else switch(n.kind){case"map":e[t]={};break;case"enum":e[t]=r?n.T.values[0].no:void 0;break;case"scalar":e[t]=r?Fu(n.T,n.L):void 0;break;case"message":e[t]=void 0;break}}function yc(n,e){if(n===null||typeof n!="object"||!Object.getOwnPropertyNames(Sw.prototype).every(r=>r in n&&typeof n[r]=="function"))return!1;const t=n.getType();return t===null||typeof t!="function"||!("typeName"in t)||typeof t.typeName!="string"?!1:e===void 0?!0:t.typeName==e.typeName}function j2(n,e){return yc(e)||!n.fieldWrapper?e:n.fieldWrapper.wrapField(e)}Ie.DOUBLE,Ie.FLOAT,Ie.INT64,Ie.UINT64,Ie.INT32,Ie.UINT32,Ie.BOOL,Ie.STRING,Ie.BYTES;const LT={ignoreUnknownFields:!1},qT={emitDefaultValues:!1,enumAsInteger:!1,useProtoFieldName:!1,prettySpaces:0};function b4(n){return n?Object.assign(Object.assign({},LT),n):LT}function S4(n){return n?Object.assign(Object.assign({},qT),n):qT}const Fg=Symbol(),ug=Symbol();function w4(){return{makeReadOptions:b4,makeWriteOptions:S4,readMessage(n,e,t,r){if(e==null||Array.isArray(e)||typeof e!="object")throw new Error("cannot decode message ".concat(n.typeName," from JSON: ").concat(jo(e)));r=r??new n;const i=new Map,s=t.typeRegistry;for(const[o,a]of Object.entries(e)){const l=n.fields.findJsonName(o);if(l){if(l.oneof){if(a===null&&l.kind=="scalar")continue;const c=i.get(l.oneof);if(c!==void 0)throw new Error("cannot decode message ".concat(n.typeName,' from JSON: multiple keys for oneof "').concat(l.oneof.name,'" present: "').concat(c,'", "').concat(o,'"'));i.set(l.oneof,o)}UT(r,a,l,t,n)}else{let c=!1;if(s!=null&&s.findExtension&&o.startsWith("[")&&o.endsWith("]")){const u=s.findExtension(o.substring(1,o.length-1));if(u&&u.extendee.typeName==n.typeName){c=!0;const[d,h]=$2(u);UT(d,a,u.field,t,u),y4(r,u,h(),t)}}if(!c&&!t.ignoreUnknownFields)throw new Error("cannot decode message ".concat(n.typeName,' from JSON: key "').concat(o,'" is unknown'))}}return r},writeMessage(n,e){const t=n.getType(),r={};let i;try{for(i of t.fields.byNumber()){if(!I2(i,n)){if(i.req)throw"required field not set";if(!e.emitDefaultValues||!P4(i))continue}const o=i.oneof?n[i.oneof.localName].value:n[i.localName],a=BT(i,o,e);a!==void 0&&(r[e.useProtoFieldName?i.name:i.jsonName]=a)}const s=e.typeRegistry;if(s!=null&&s.findExtensionFor)for(const o of t.runtime.bin.listUnknownFields(n)){const a=s.findExtensionFor(t.typeName,o.no);if(a&&Q2(n,a)){const l=v4(n,a,e),c=BT(a.field,l,e);c!==void 0&&(r[a.field.jsonName]=c)}}}catch(s){const o=i?"cannot encode field ".concat(t.typeName,".").concat(i.name," to JSON"):"cannot encode message ".concat(t.typeName," to JSON"),a=s instanceof Error?s.message:String(s);throw new Error(o+(a.length>0?": ".concat(a):""))}return r},readScalar(n,e,t){return Cd(n,e,t??kl.BIGINT,!0)},writeScalar(n,e,t){if(e!==void 0&&(t||A2(n,e)))return fg(n,e)},debug:jo}}function jo(n){if(n===null)return"null";switch(typeof n){case"object":return Array.isArray(n)?"array":"object";case"string":return n.length>100?"string":'"'.concat(n.split('"').join('\\"'),'"');default:return String(n)}}function UT(n,e,t,r,i){let s=t.localName;if(t.repeated){if($r(t.kind!="map"),e===null)return;if(!Array.isArray(e))throw new Error("cannot decode field ".concat(i.typeName,".").concat(t.name," from JSON: ").concat(jo(e)));const o=n[s];for(const a of e){if(a===null)throw new Error("cannot decode field ".concat(i.typeName,".").concat(t.name," from JSON: ").concat(jo(a)));switch(t.kind){case"message":o.push(t.T.fromJson(a,r));break;case"enum":const l=Xy(t.T,a,r.ignoreUnknownFields,!0);l!==ug&&o.push(l);break;case"scalar":try{o.push(Cd(t.T,a,t.L,!0))}catch(c){let u="cannot decode field ".concat(i.typeName,".").concat(t.name," from JSON: ").concat(jo(a));throw c instanceof Error&&c.message.length>0&&(u+=": ".concat(c.message)),new Error(u)}break}}}else if(t.kind=="map"){if(e===null)return;if(typeof e!="object"||Array.isArray(e))throw new Error("cannot decode field ".concat(i.typeName,".").concat(t.name," from JSON: ").concat(jo(e)));const o=n[s];for(const[a,l]of Object.entries(e)){if(l===null)throw new Error("cannot decode field ".concat(i.typeName,".").concat(t.name," from JSON: map value null"));let c;try{c=k4(t.K,a)}catch(u){let d="cannot decode map key for field ".concat(i.typeName,".").concat(t.name," from JSON: ").concat(jo(e));throw u instanceof Error&&u.message.length>0&&(d+=": ".concat(u.message)),new Error(d)}switch(t.V.kind){case"message":o[c]=t.V.T.fromJson(l,r);break;case"enum":const u=Xy(t.V.T,l,r.ignoreUnknownFields,!0);u!==ug&&(o[c]=u);break;case"scalar":try{o[c]=Cd(t.V.T,l,kl.BIGINT,!0)}catch(d){let h="cannot decode map value for field ".concat(i.typeName,".").concat(t.name," from JSON: ").concat(jo(e));throw d instanceof Error&&d.message.length>0&&(h+=": ".concat(d.message)),new Error(h)}break}}}else switch(t.oneof&&(n=n[t.oneof.localName]={case:s},s="value"),t.kind){case"message":const o=t.T;if(e===null&&o.typeName!="google.protobuf.Value")return;let a=n[s];yc(a)?a.fromJson(e,r):(n[s]=a=o.fromJson(e,r),o.fieldWrapper&&!t.oneof&&(n[s]=o.fieldWrapper.unwrapField(a)));break;case"enum":const l=Xy(t.T,e,r.ignoreUnknownFields,!1);switch(l){case Fg:NT(t,n);break;case ug:break;default:n[s]=l;break}break;case"scalar":try{const c=Cd(t.T,e,t.L,!1);switch(c){case Fg:NT(t,n);break;default:n[s]=c;break}}catch(c){let u="cannot decode field ".concat(i.typeName,".").concat(t.name," from JSON: ").concat(jo(e));throw c instanceof Error&&c.message.length>0&&(u+=": ".concat(c.message)),new Error(u)}break}}function k4(n,e){if(n===Ie.BOOL)switch(e){case"true":e=!0;break;case"false":e=!1;break}return Cd(n,e,kl.BIGINT,!0).toString()}function Cd(n,e,t,r){if(e===null)return r?Fu(n,t):Fg;switch(n){case Ie.DOUBLE:case Ie.FLOAT:if(e==="NaN")return Number.NaN;if(e==="Infinity")return Number.POSITIVE_INFINITY;if(e==="-Infinity")return Number.NEGATIVE_INFINITY;if(e===""||typeof e=="string"&&e.trim().length!==e.length||typeof e!="string"&&typeof e!="number")break;const i=Number(e);if(Number.isNaN(i)||!Number.isFinite(i))break;return n==Ie.FLOAT&&P2(i),i;case Ie.INT32:case Ie.FIXED32:case Ie.SFIXED32:case Ie.SINT32:case Ie.UINT32:let s;if(typeof e=="number"?s=e:typeof e=="string"&&e.length>0&&e.trim().length===e.length&&(s=Number(e)),s===void 0)break;return n==Ie.UINT32||n==Ie.FIXED32?wS(s):lg(s),s;case Ie.INT64:case Ie.SFIXED64:case Ie.SINT64:if(typeof e!="number"&&typeof e!="string")break;const o=yr.parse(e);return t?o.toString():o;case Ie.FIXED64:case Ie.UINT64:if(typeof e!="number"&&typeof e!="string")break;const a=yr.uParse(e);return t?a.toString():a;case Ie.BOOL:if(typeof e!="boolean")break;return e;case Ie.STRING:if(typeof e!="string")break;try{encodeURIComponent(e)}catch{throw new Error("invalid UTF8")}return e;case Ie.BYTES:if(e==="")return new Uint8Array(0);if(typeof e!="string")break;return M2.dec(e)}throw new Error}function Xy(n,e,t,r){if(e===null)return n.typeName=="google.protobuf.NullValue"?0:r?n.values[0].no:Fg;switch(typeof e){case"number":if(Number.isInteger(e))return e;break;case"string":const i=n.findName(e);if(i!==void 0)return i.no;if(t)return ug;break}throw new Error("cannot decode enum ".concat(n.typeName," from JSON: ").concat(jo(e)))}function P4(n){return n.repeated||n.kind=="map"?!0:!(n.oneof||n.kind=="message"||n.opt||n.req)}function BT(n,e,t){if(n.kind=="map"){$r(typeof e=="object"&&e!=null);const r={},i=Object.entries(e);switch(n.V.kind){case"scalar":for(const[o,a]of i)r[o.toString()]=fg(n.V.T,a);break;case"message":for(const[o,a]of i)r[o.toString()]=a.toJson(t);break;case"enum":const s=n.V.T;for(const[o,a]of i)r[o.toString()]=zy(s,a,t.enumAsInteger);break}return t.emitDefaultValues||i.length>0?r:void 0}if(n.repeated){$r(Array.isArray(e));const r=[];switch(n.kind){case"scalar":for(let i=0;i<e.length;i++)r.push(fg(n.T,e[i]));break;case"enum":for(let i=0;i<e.length;i++)r.push(zy(n.T,e[i],t.enumAsInteger));break;case"message":for(let i=0;i<e.length;i++)r.push(e[i].toJson(t));break}return t.emitDefaultValues||r.length>0?r:void 0}switch(n.kind){case"scalar":return fg(n.T,e);case"enum":return zy(n.T,e,t.enumAsInteger);case"message":return j2(n.T,e).toJson(t)}}function zy(n,e,t){var r;if($r(typeof e=="number"),n.typeName=="google.protobuf.NullValue")return null;if(t)return e;const i=n.findNumber(e);return(r=i==null?void 0:i.name)!==null&&r!==void 0?r:e}function fg(n,e){switch(n){case Ie.INT32:case Ie.SFIXED32:case Ie.SINT32:case Ie.FIXED32:case Ie.UINT32:return $r(typeof e=="number"),e;case Ie.FLOAT:case Ie.DOUBLE:return $r(typeof e=="number"),Number.isNaN(e)?"NaN":e===Number.POSITIVE_INFINITY?"Infinity":e===Number.NEGATIVE_INFINITY?"-Infinity":e;case Ie.STRING:return $r(typeof e=="string"),e;case Ie.BOOL:return $r(typeof e=="boolean"),e;case Ie.UINT64:case Ie.FIXED64:case Ie.INT64:case Ie.SFIXED64:case Ie.SINT64:return $r(typeof e=="bigint"||typeof e=="string"||typeof e=="number"),e.toString();case Ie.BYTES:return $r(e instanceof Uint8Array),M2.enc(e)}}const ru=Symbol("@bufbuild/protobuf/unknown-fields"),FT={readUnknownFields:!0,readerFactory:n=>new p4(n)},VT={writeUnknownFields:!0,writerFactory:()=>new h4};function x4(n){return n?Object.assign(Object.assign({},FT),n):FT}function T4(n){return n?Object.assign(Object.assign({},VT),n):VT}function C4(){return{makeReadOptions:x4,makeWriteOptions:T4,listUnknownFields(n){var e;return(e=n[ru])!==null&&e!==void 0?e:[]},discardUnknownFields(n){delete n[ru]},writeUnknownFields(n,e){const r=n[ru];if(r)for(const i of r)e.tag(i.no,i.wireType).raw(i.data)},onUnknownField(n,e,t,r){const i=n;Array.isArray(i[ru])||(i[ru]=[]),i[ru].push({no:e,wireType:t,data:r})},readMessage(n,e,t,r,i){const s=n.getType(),o=i?e.len:e.pos+t;let a,l;for(;e.pos<o&&([a,l]=e.tag(),!(i===!0&&l==Nr.EndGroup));){const c=s.fields.find(a);if(!c){const u=e.skip(l,a);r.readUnknownFields&&this.onUnknownField(n,a,l,u);continue}ZT(n,e,c,l,r)}if(i&&(l!=Nr.EndGroup||a!==t))throw new Error("invalid end group tag")},readField:ZT,writeMessage(n,e,t){const r=n.getType();for(const i of r.fields.byNumber()){if(!I2(i,n)){if(i.req)throw new Error("cannot encode field ".concat(r.typeName,".").concat(i.name," to binary: required field not set"));continue}const s=i.oneof?n[i.oneof.localName].value:n[i.localName];WT(i,s,e,t)}return t.writeUnknownFields&&this.writeUnknownFields(n,e),e},writeField(n,e,t,r){e!==void 0&&WT(n,e,t,r)}}}function ZT(n,e,t,r,i){let{repeated:s,localName:o}=t;switch(t.oneof&&(n=n[t.oneof.localName],n.case!=o&&delete n.value,n.case=o,o="value"),t.kind){case"scalar":case"enum":const a=t.kind=="enum"?Ie.INT32:t.T;let l=Vg;if(t.kind=="scalar"&&t.L>0&&(l=E4),s){let h=n[o];if(r==Nr.LengthDelimited&&a!=Ie.STRING&&a!=Ie.BYTES){let g=e.uint32()+e.pos;for(;e.pos<g;)h.push(l(e,a))}else h.push(l(e,a))}else n[o]=l(e,a);break;case"message":const c=t.T;s?n[o].push(dg(e,new c,i,t)):yc(n[o])?dg(e,n[o],i,t):(n[o]=dg(e,new c,i,t),c.fieldWrapper&&!t.oneof&&!t.repeated&&(n[o]=c.fieldWrapper.unwrapField(n[o])));break;case"map":let[u,d]=_4(t,e,i);n[o][u]=d;break}}function dg(n,e,t,r){const i=e.getType().runtime.bin,s=r==null?void 0:r.delimited;return i.readMessage(e,n,s?r.no:n.uint32(),t,s),e}function _4(n,e,t){const r=e.uint32(),i=e.pos+r;let s,o;for(;e.pos<i;){const[a]=e.tag();switch(a){case 1:s=Vg(e,n.K);break;case 2:switch(n.V.kind){case"scalar":o=Vg(e,n.V.T);break;case"enum":o=e.int32();break;case"message":o=dg(e,new n.V.T,t,void 0);break}break}}if(s===void 0&&(s=Fu(n.K,kl.BIGINT)),typeof s!="string"&&typeof s!="number"&&(s=s.toString()),o===void 0)switch(n.V.kind){case"scalar":o=Fu(n.V.T,kl.BIGINT);break;case"enum":o=n.V.T.values[0].no;break;case"message":o=new n.V.T;break}return[s,o]}function E4(n,e){const t=Vg(n,e);return typeof t=="bigint"?t.toString():t}function Vg(n,e){switch(e){case Ie.STRING:return n.string();case Ie.BOOL:return n.bool();case Ie.DOUBLE:return n.double();case Ie.FLOAT:return n.float();case Ie.INT32:return n.int32();case Ie.INT64:return n.int64();case Ie.UINT64:return n.uint64();case Ie.FIXED64:return n.fixed64();case Ie.BYTES:return n.bytes();case Ie.FIXED32:return n.fixed32();case Ie.SFIXED32:return n.sfixed32();case Ie.SFIXED64:return n.sfixed64();case Ie.SINT64:return n.sint64();case Ie.UINT32:return n.uint32();case Ie.SINT32:return n.sint32()}}function WT(n,e,t,r){$r(e!==void 0);const i=n.repeated;switch(n.kind){case"scalar":case"enum":let s=n.kind=="enum"?Ie.INT32:n.T;if(i)if($r(Array.isArray(e)),n.packed)A4(t,s,n.no,e);else for(const o of e)_d(t,s,n.no,o);else _d(t,s,n.no,e);break;case"message":if(i){$r(Array.isArray(e));for(const o of e)XT(t,r,n,o)}else XT(t,r,n,e);break;case"map":$r(typeof e=="object"&&e!=null);for(const[o,a]of Object.entries(e))R4(t,r,n,o,a);break}}function R4(n,e,t,r,i){n.tag(t.no,Nr.LengthDelimited),n.fork();let s=r;switch(t.K){case Ie.INT32:case Ie.FIXED32:case Ie.UINT32:case Ie.SFIXED32:case Ie.SINT32:s=Number.parseInt(r);break;case Ie.BOOL:$r(r=="true"||r=="false"),s=r=="true";break}switch(_d(n,t.K,1,s),t.V.kind){case"scalar":_d(n,t.V.T,2,i);break;case"enum":_d(n,Ie.INT32,2,i);break;case"message":$r(i!==void 0),n.tag(2,Nr.LengthDelimited).bytes(i.toBinary(e));break}n.join()}function XT(n,e,t,r){const i=j2(t.T,r);t.delimited?n.tag(t.no,Nr.StartGroup).raw(i.toBinary(e)).tag(t.no,Nr.EndGroup):n.tag(t.no,Nr.LengthDelimited).bytes(i.toBinary(e))}function _d(n,e,t,r){$r(r!==void 0);let[i,s]=N2(e);n.tag(t,i)[s](r)}function A4(n,e,t,r){if(!r.length)return;n.tag(t,Nr.LengthDelimited).fork();let[,i]=N2(e);for(let s=0;s<r.length;s++)n[i](r[s]);n.join()}function N2(n){let e=Nr.Varint;switch(n){case Ie.BYTES:case Ie.STRING:e=Nr.LengthDelimited;break;case Ie.DOUBLE:case Ie.FIXED64:case Ie.SFIXED64:e=Nr.Bit64;break;case Ie.FIXED32:case Ie.SFIXED32:case Ie.FLOAT:e=Nr.Bit32;break}const t=Ie[n].toLowerCase();return[e,t]}function $4(){return{setEnumType:T2,initPartial(n,e){if(n===void 0)return;const t=e.getType();for(const r of t.fields.byMember()){const i=r.localName,s=e,o=n;if(o[i]!=null)switch(r.kind){case"oneof":const a=o[i].case;if(a===void 0)continue;const l=r.findField(a);let c=o[i].value;l&&l.kind=="message"&&!yc(c,l.T)?c=new l.T(c):l&&l.kind==="scalar"&&l.T===Ie.BYTES&&(c=Vf(c)),s[i]={case:a,value:c};break;case"scalar":case"enum":let u=o[i];r.T===Ie.BYTES&&(u=r.repeated?u.map(Vf):Vf(u)),s[i]=u;break;case"map":switch(r.V.kind){case"scalar":case"enum":if(r.V.T===Ie.BYTES)for(const[m,g]of Object.entries(o[i]))s[i][m]=Vf(g);else Object.assign(s[i],o[i]);break;case"message":const h=r.V.T;for(const m of Object.keys(o[i])){let g=o[i][m];h.fieldWrapper||(g=new h(g)),s[i][m]=g}break}break;case"message":const d=r.T;if(r.repeated)s[i]=o[i].map(h=>yc(h,d)?h:new d(h));else{const h=o[i];d.fieldWrapper?d.typeName==="google.protobuf.BytesValue"?s[i]=Vf(h):s[i]=h:s[i]=yc(h,d)?h:new d(h)}break}}},equals(n,e,t){return e===t?!0:!e||!t?!1:n.fields.byMember().every(r=>{const i=e[r.localName],s=t[r.localName];if(r.repeated){if(i.length!==s.length)return!1;switch(r.kind){case"message":return i.every((o,a)=>r.T.equals(o,s[a]));case"scalar":return i.every((o,a)=>Ja(r.T,o,s[a]));case"enum":return i.every((o,a)=>Ja(Ie.INT32,o,s[a]))}throw new Error("repeated cannot contain ".concat(r.kind))}switch(r.kind){case"message":return r.T.equals(i,s);case"enum":return Ja(Ie.INT32,i,s);case"scalar":return Ja(r.T,i,s);case"oneof":if(i.case!==s.case)return!1;const o=r.findField(i.case);if(o===void 0)return!0;switch(o.kind){case"message":return o.T.equals(i.value,s.value);case"enum":return Ja(Ie.INT32,i.value,s.value);case"scalar":return Ja(o.T,i.value,s.value)}throw new Error("oneof cannot contain ".concat(o.kind));case"map":const a=Object.keys(i).concat(Object.keys(s));switch(r.V.kind){case"message":const l=r.V.T;return a.every(u=>l.equals(i[u],s[u]));case"enum":return a.every(u=>Ja(Ie.INT32,i[u],s[u]));case"scalar":const c=r.V.T;return a.every(u=>Ja(c,i[u],s[u]))}break}})},clone(n){const e=n.getType(),t=new e,r=t;for(const i of e.fields.byMember()){const s=n[i.localName];let o;if(i.repeated)o=s.map(Pp);else if(i.kind=="map"){o=r[i.localName];for(const[a,l]of Object.entries(s))o[a]=Pp(l)}else i.kind=="oneof"?o=i.findField(s.case)?{case:s.case,value:Pp(s.value)}:{case:void 0}:o=Pp(s);r[i.localName]=o}for(const i of e.runtime.bin.listUnknownFields(n))e.runtime.bin.onUnknownField(r,i.no,i.wireType,i.data);return t}}}function Pp(n){if(n===void 0)return n;if(yc(n))return n.clone();if(n instanceof Uint8Array){const e=new Uint8Array(n.byteLength);return e.set(n),e}return n}function Vf(n){return n instanceof Uint8Array?n:new Uint8Array(n)}function M4(n,e,t){return{syntax:n,json:w4(),bin:C4(),util:Object.assign(Object.assign({},$4()),{newFieldList:e,initFields:t}),makeMessageType(r,i,s){return a4(this,r,i,s)},makeEnum:o4,makeEnumType:C2,getEnumType:s4,makeExtension(r,i,s){return m4(this,r,i,s)}}}class Q4{constructor(e,t){this._fields=e,this._normalizer=t}findJsonName(e){if(!this.jsonNames){const t={};for(const r of this.list())t[r.jsonName]=t[r.name]=r;this.jsonNames=t}return this.jsonNames[e]}find(e){if(!this.numbers){const t={};for(const r of this.list())t[r.no]=r;this.numbers=t}return this.numbers[e]}list(){return this.all||(this.all=this._normalizer(this._fields)),this.all}byNumber(){return this.numbersAsc||(this.numbersAsc=this.list().concat().sort((e,t)=>e.no-t.no)),this.numbersAsc}byMember(){if(!this.members){this.members=[];const e=this.members;let t;for(const r of this.list())r.oneof?r.oneof!==t&&(t=r.oneof,e.push(t)):e.push(r)}return this.members}}function L2(n,e){const t=q2(n);return e?t:q4(L4(t))}function D4(n){return L2(n,!1)}const I4=q2;function q2(n){let e=!1;const t=[];for(let r=0;r<n.length;r++){let i=n.charAt(r);switch(i){case"_":e=!0;break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":t.push(i),e=!1;break;default:e&&(e=!1,i=i.toUpperCase()),t.push(i);break}}return t.join("")}const j4=new Set(["constructor","toString","toJSON","valueOf"]),N4=new Set(["getType","clone","equals","fromBinary","fromJson","fromJsonString","toBinary","toJson","toJsonString","toObject"]),U2=n=>"".concat(n,"$"),L4=n=>N4.has(n)?U2(n):n,q4=n=>j4.has(n)?U2(n):n;class U4{constructor(e){this.kind="oneof",this.repeated=!1,this.packed=!1,this.opt=!1,this.req=!1,this.default=void 0,this.fields=[],this.name=e,this.localName=D4(e)}addField(e){$r(e.oneof===this,"field ".concat(e.name," not one of ").concat(this.name)),this.fields.push(e)}findField(e){if(!this._lookup){this._lookup=Object.create(null);for(let t=0;t<this.fields.length;t++)this._lookup[this.fields[t].localName]=this.fields[t]}return this._lookup[e]}}function B4(n,e){var t,r,i,s,o,a;const l=[];let c;for(const u of typeof n=="function"?n():n){const d=u;if(d.localName=L2(u.name,u.oneof!==void 0),d.jsonName=(t=u.jsonName)!==null&&t!==void 0?t:I4(u.name),d.repeated=(r=u.repeated)!==null&&r!==void 0?r:!1,u.kind=="scalar"&&(d.L=(i=u.L)!==null&&i!==void 0?i:kl.BIGINT),d.delimited=(s=u.delimited)!==null&&s!==void 0?s:!1,d.req=(o=u.req)!==null&&o!==void 0?o:!1,d.opt=(a=u.opt)!==null&&a!==void 0?a:!1,u.packed===void 0&&(d.packed=u.kind=="enum"||u.kind=="scalar"&&u.T!=Ie.BYTES&&u.T!=Ie.STRING),u.oneof!==void 0){const h=typeof u.oneof=="string"?u.oneof:u.oneof.name;(!c||c.name!=h)&&(c=new U4(h)),d.oneof=c,c.addField(d)}l.push(d)}return l}const Se=M4("proto3",n=>new Q4(n,e=>B4(e)),n=>{for(const e of n.getType().fields.byMember()){if(e.opt)continue;const t=e.localName,r=n;if(e.repeated){r[t]=[];continue}switch(e.kind){case"oneof":r[t]={case:void 0};break;case"enum":r[t]=0;break;case"map":r[t]={};break;case"scalar":r[t]=Fu(e.T,e.L);break}}});class Ji extends Sw{constructor(e){super(),this.seconds=yr.zero,this.nanos=0,Se.util.initPartial(e,this)}fromJson(e,t){if(typeof e!="string")throw new Error("cannot decode google.protobuf.Timestamp from JSON: ".concat(Se.json.debug(e)));const r=e.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:Z|\.([0-9]{3,9})Z|([+-][0-9][0-9]:[0-9][0-9]))$/);if(!r)throw new Error("cannot decode google.protobuf.Timestamp from JSON: invalid RFC 3339 string");const i=Date.parse(r[1]+"-"+r[2]+"-"+r[3]+"T"+r[4]+":"+r[5]+":"+r[6]+(r[8]?r[8]:"Z"));if(Number.isNaN(i))throw new Error("cannot decode google.protobuf.Timestamp from JSON: invalid RFC 3339 string");if(i<Date.parse("0001-01-01T00:00:00Z")||i>Date.parse("9999-12-31T23:59:59Z"))throw new Error("cannot decode message google.protobuf.Timestamp from JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive");return this.seconds=yr.parse(i/1e3),this.nanos=0,r[7]&&(this.nanos=parseInt("1"+r[7]+"0".repeat(9-r[7].length))-1e9),this}toJson(e){const t=Number(this.seconds)*1e3;if(t<Date.parse("0001-01-01T00:00:00Z")||t>Date.parse("9999-12-31T23:59:59Z"))throw new Error("cannot encode google.protobuf.Timestamp to JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive");if(this.nanos<0)throw new Error("cannot encode google.protobuf.Timestamp to JSON: nanos must not be negative");let r="Z";if(this.nanos>0){const i=(this.nanos+1e9).toString().substring(1);i.substring(3)==="000000"?r="."+i.substring(0,3)+"Z":i.substring(6)==="000"?r="."+i.substring(0,6)+"Z":r="."+i+"Z"}return new Date(t).toISOString().replace(".000Z",r)}toDate(){return new Date(Number(this.seconds)*1e3+Math.ceil(this.nanos/1e6))}static now(){return Ji.fromDate(new Date)}static fromDate(e){const t=e.getTime();return new Ji({seconds:yr.parse(Math.floor(t/1e3)),nanos:t%1e3*1e6})}static fromBinary(e,t){return new Ji().fromBinary(e,t)}static fromJson(e,t){return new Ji().fromJson(e,t)}static fromJsonString(e,t){return new Ji().fromJsonString(e,t)}static equals(e,t){return Se.util.equals(Ji,e,t)}}Ji.runtime=Se;Ji.typeName="google.protobuf.Timestamp";Ji.fields=Se.util.newFieldList(()=>[{no:1,name:"seconds",kind:"scalar",T:3},{no:2,name:"nanos",kind:"scalar",T:5}]);const F4=Se.makeMessageType("livekit.MetricsBatch",()=>[{no:1,name:"timestamp_ms",kind:"scalar",T:3},{no:2,name:"normalized_timestamp",kind:"message",T:Ji},{no:3,name:"str_data",kind:"scalar",T:9,repeated:!0},{no:4,name:"time_series",kind:"message",T:V4,repeated:!0},{no:5,name:"events",kind:"message",T:W4,repeated:!0}]),V4=Se.makeMessageType("livekit.TimeSeriesMetric",()=>[{no:1,name:"label",kind:"scalar",T:13},{no:2,name:"participant_identity",kind:"scalar",T:13},{no:3,name:"track_sid",kind:"scalar",T:13},{no:4,name:"samples",kind:"message",T:Z4,repeated:!0},{no:5,name:"rid",kind:"scalar",T:13}]),Z4=Se.makeMessageType("livekit.MetricSample",()=>[{no:1,name:"timestamp_ms",kind:"scalar",T:3},{no:2,name:"normalized_timestamp",kind:"message",T:Ji},{no:3,name:"value",kind:"scalar",T:2}]),W4=Se.makeMessageType("livekit.EventMetric",()=>[{no:1,name:"label",kind:"scalar",T:13},{no:2,name:"participant_identity",kind:"scalar",T:13},{no:3,name:"track_sid",kind:"scalar",T:13},{no:4,name:"start_timestamp_ms",kind:"scalar",T:3},{no:5,name:"end_timestamp_ms",kind:"scalar",T:3,opt:!0},{no:6,name:"normalized_start_timestamp",kind:"message",T:Ji},{no:7,name:"normalized_end_timestamp",kind:"message",T:Ji,opt:!0},{no:8,name:"metadata",kind:"scalar",T:9},{no:9,name:"rid",kind:"scalar",T:13}]),B2=Se.makeEnum("livekit.BackupCodecPolicy",[{no:0,name:"REGRESSION"},{no:1,name:"SIMULCAST"}]),ao=Se.makeEnum("livekit.TrackType",[{no:0,name:"AUDIO"},{no:1,name:"VIDEO"},{no:2,name:"DATA"}]),Br=Se.makeEnum("livekit.TrackSource",[{no:0,name:"UNKNOWN"},{no:1,name:"CAMERA"},{no:2,name:"MICROPHONE"},{no:3,name:"SCREEN_SHARE"},{no:4,name:"SCREEN_SHARE_AUDIO"}]),kw=Se.makeEnum("livekit.VideoQuality",[{no:0,name:"LOW"},{no:1,name:"MEDIUM"},{no:2,name:"HIGH"},{no:3,name:"OFF"}]),vd=Se.makeEnum("livekit.ConnectionQuality",[{no:0,name:"POOR"},{no:1,name:"GOOD"},{no:2,name:"EXCELLENT"},{no:3,name:"LOST"}]),jd=Se.makeEnum("livekit.ClientConfigSetting",[{no:0,name:"UNSET"},{no:1,name:"DISABLED"},{no:2,name:"ENABLED"}]),co=Se.makeEnum("livekit.DisconnectReason",[{no:0,name:"UNKNOWN_REASON"},{no:1,name:"CLIENT_INITIATED"},{no:2,name:"DUPLICATE_IDENTITY"},{no:3,name:"SERVER_SHUTDOWN"},{no:4,name:"PARTICIPANT_REMOVED"},{no:5,name:"ROOM_DELETED"},{no:6,name:"STATE_MISMATCH"},{no:7,name:"JOIN_FAILURE"},{no:8,name:"MIGRATION"},{no:9,name:"SIGNAL_CLOSE"},{no:10,name:"ROOM_CLOSED"},{no:11,name:"USER_UNAVAILABLE"},{no:12,name:"USER_REJECTED"},{no:13,name:"SIP_TRUNK_FAILURE"}]),iu=Se.makeEnum("livekit.ReconnectReason",[{no:0,name:"RR_UNKNOWN"},{no:1,name:"RR_SIGNAL_DISCONNECTED"},{no:2,name:"RR_PUBLISHER_FAILED"},{no:3,name:"RR_SUBSCRIBER_FAILED"},{no:4,name:"RR_SWITCH_CANDIDATE"}]),X4=Se.makeEnum("livekit.SubscriptionError",[{no:0,name:"SE_UNKNOWN"},{no:1,name:"SE_CODEC_UNSUPPORTED"},{no:2,name:"SE_TRACK_NOTFOUND"}]),No=Se.makeEnum("livekit.AudioTrackFeature",[{no:0,name:"TF_STEREO"},{no:1,name:"TF_NO_DTX"},{no:2,name:"TF_AUTO_GAIN_CONTROL"},{no:3,name:"TF_ECHO_CANCELLATION"},{no:4,name:"TF_NOISE_SUPPRESSION"},{no:5,name:"TF_ENHANCED_NOISE_CANCELLATION"}]),Pw=Se.makeMessageType("livekit.Room",()=>[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"empty_timeout",kind:"scalar",T:13},{no:14,name:"departure_timeout",kind:"scalar",T:13},{no:4,name:"max_participants",kind:"scalar",T:13},{no:5,name:"creation_time",kind:"scalar",T:3},{no:15,name:"creation_time_ms",kind:"scalar",T:3},{no:6,name:"turn_password",kind:"scalar",T:9},{no:7,name:"enabled_codecs",kind:"message",T:Zg,repeated:!0},{no:8,name:"metadata",kind:"scalar",T:9},{no:9,name:"num_participants",kind:"scalar",T:13},{no:11,name:"num_publishers",kind:"scalar",T:13},{no:10,name:"active_recording",kind:"scalar",T:8},{no:13,name:"version",kind:"message",T:eQ}]),Zg=Se.makeMessageType("livekit.Codec",()=>[{no:1,name:"mime",kind:"scalar",T:9},{no:2,name:"fmtp_line",kind:"scalar",T:9}]),z4=Se.makeMessageType("livekit.ParticipantPermission",()=>[{no:1,name:"can_subscribe",kind:"scalar",T:8},{no:2,name:"can_publish",kind:"scalar",T:8},{no:3,name:"can_publish_data",kind:"scalar",T:8},{no:9,name:"can_publish_sources",kind:"enum",T:Se.getEnumType(Br),repeated:!0},{no:7,name:"hidden",kind:"scalar",T:8},{no:8,name:"recorder",kind:"scalar",T:8},{no:10,name:"can_update_metadata",kind:"scalar",T:8},{no:11,name:"agent",kind:"scalar",T:8},{no:12,name:"can_subscribe_metrics",kind:"scalar",T:8}]),Nd=Se.makeMessageType("livekit.ParticipantInfo",()=>[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"identity",kind:"scalar",T:9},{no:3,name:"state",kind:"enum",T:Se.getEnumType(kS)},{no:4,name:"tracks",kind:"message",T:Pu,repeated:!0},{no:5,name:"metadata",kind:"scalar",T:9},{no:6,name:"joined_at",kind:"scalar",T:3},{no:17,name:"joined_at_ms",kind:"scalar",T:3},{no:9,name:"name",kind:"scalar",T:9},{no:10,name:"version",kind:"scalar",T:13},{no:11,name:"permission",kind:"message",T:z4},{no:12,name:"region",kind:"scalar",T:9},{no:13,name:"is_publisher",kind:"scalar",T:8},{no:14,name:"kind",kind:"enum",T:Se.getEnumType(Wg)},{no:15,name:"attributes",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:16,name:"disconnect_reason",kind:"enum",T:Se.getEnumType(co)}]),kS=Se.makeEnum("livekit.ParticipantInfo.State",[{no:0,name:"JOINING"},{no:1,name:"JOINED"},{no:2,name:"ACTIVE"},{no:3,name:"DISCONNECTED"}]),Wg=Se.makeEnum("livekit.ParticipantInfo.Kind",[{no:0,name:"STANDARD"},{no:1,name:"INGRESS"},{no:2,name:"EGRESS"},{no:3,name:"SIP"},{no:4,name:"AGENT"}]),gs=Se.makeEnum("livekit.Encryption.Type",[{no:0,name:"NONE"},{no:1,name:"GCM"},{no:2,name:"CUSTOM"}]),Y4=Se.makeMessageType("livekit.SimulcastCodecInfo",()=>[{no:1,name:"mime_type",kind:"scalar",T:9},{no:2,name:"mid",kind:"scalar",T:9},{no:3,name:"cid",kind:"scalar",T:9},{no:4,name:"layers",kind:"message",T:bc,repeated:!0}]),Pu=Se.makeMessageType("livekit.TrackInfo",()=>[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"type",kind:"enum",T:Se.getEnumType(ao)},{no:3,name:"name",kind:"scalar",T:9},{no:4,name:"muted",kind:"scalar",T:8},{no:5,name:"width",kind:"scalar",T:13},{no:6,name:"height",kind:"scalar",T:13},{no:7,name:"simulcast",kind:"scalar",T:8},{no:8,name:"disable_dtx",kind:"scalar",T:8},{no:9,name:"source",kind:"enum",T:Se.getEnumType(Br)},{no:10,name:"layers",kind:"message",T:bc,repeated:!0},{no:11,name:"mime_type",kind:"scalar",T:9},{no:12,name:"mid",kind:"scalar",T:9},{no:13,name:"codecs",kind:"message",T:Y4,repeated:!0},{no:14,name:"stereo",kind:"scalar",T:8},{no:15,name:"disable_red",kind:"scalar",T:8},{no:16,name:"encryption",kind:"enum",T:Se.getEnumType(gs)},{no:17,name:"stream",kind:"scalar",T:9},{no:18,name:"version",kind:"message",T:eQ},{no:19,name:"audio_features",kind:"enum",T:Se.getEnumType(No),repeated:!0},{no:20,name:"backup_codec_policy",kind:"enum",T:Se.getEnumType(B2)}]),bc=Se.makeMessageType("livekit.VideoLayer",()=>[{no:1,name:"quality",kind:"enum",T:Se.getEnumType(kw)},{no:2,name:"width",kind:"scalar",T:13},{no:3,name:"height",kind:"scalar",T:13},{no:4,name:"bitrate",kind:"scalar",T:13},{no:5,name:"ssrc",kind:"scalar",T:13}]),Hi=Se.makeMessageType("livekit.DataPacket",()=>[{no:1,name:"kind",kind:"enum",T:Se.getEnumType($n)},{no:4,name:"participant_identity",kind:"scalar",T:9},{no:5,name:"destination_identities",kind:"scalar",T:9,repeated:!0},{no:2,name:"user",kind:"message",T:V2,oneof:"value"},{no:3,name:"speaker",kind:"message",T:G4,oneof:"value"},{no:6,name:"sip_dtmf",kind:"message",T:Z2,oneof:"value"},{no:7,name:"transcription",kind:"message",T:H4,oneof:"value"},{no:8,name:"metrics",kind:"message",T:F4,oneof:"value"},{no:9,name:"chat_message",kind:"message",T:PS,oneof:"value"},{no:10,name:"rpc_request",kind:"message",T:W2,oneof:"value"},{no:11,name:"rpc_ack",kind:"message",T:X2,oneof:"value"},{no:12,name:"rpc_response",kind:"message",T:z2,oneof:"value"},{no:13,name:"stream_header",kind:"message",T:TS,oneof:"value"},{no:14,name:"stream_chunk",kind:"message",T:CS,oneof:"value"},{no:15,name:"stream_trailer",kind:"message",T:_S,oneof:"value"}]),$n=Se.makeEnum("livekit.DataPacket.Kind",[{no:0,name:"RELIABLE"},{no:1,name:"LOSSY"}]),G4=Se.makeMessageType("livekit.ActiveSpeakerUpdate",()=>[{no:1,name:"speakers",kind:"message",T:F2,repeated:!0}]),F2=Se.makeMessageType("livekit.SpeakerInfo",()=>[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"level",kind:"scalar",T:2},{no:3,name:"active",kind:"scalar",T:8}]),V2=Se.makeMessageType("livekit.UserPacket",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:5,name:"participant_identity",kind:"scalar",T:9},{no:2,name:"payload",kind:"scalar",T:12},{no:3,name:"destination_sids",kind:"scalar",T:9,repeated:!0},{no:6,name:"destination_identities",kind:"scalar",T:9,repeated:!0},{no:4,name:"topic",kind:"scalar",T:9,opt:!0},{no:8,name:"id",kind:"scalar",T:9,opt:!0},{no:9,name:"start_time",kind:"scalar",T:4,opt:!0},{no:10,name:"end_time",kind:"scalar",T:4,opt:!0},{no:11,name:"nonce",kind:"scalar",T:12}]),Z2=Se.makeMessageType("livekit.SipDTMF",()=>[{no:3,name:"code",kind:"scalar",T:13},{no:4,name:"digit",kind:"scalar",T:9}]),H4=Se.makeMessageType("livekit.Transcription",()=>[{no:2,name:"transcribed_participant_identity",kind:"scalar",T:9},{no:3,name:"track_id",kind:"scalar",T:9},{no:4,name:"segments",kind:"message",T:K4,repeated:!0}]),K4=Se.makeMessageType("livekit.TranscriptionSegment",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"text",kind:"scalar",T:9},{no:3,name:"start_time",kind:"scalar",T:4},{no:4,name:"end_time",kind:"scalar",T:4},{no:5,name:"final",kind:"scalar",T:8},{no:6,name:"language",kind:"scalar",T:9}]),PS=Se.makeMessageType("livekit.ChatMessage",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"timestamp",kind:"scalar",T:3},{no:3,name:"edit_timestamp",kind:"scalar",T:3,opt:!0},{no:4,name:"message",kind:"scalar",T:9},{no:5,name:"deleted",kind:"scalar",T:8},{no:6,name:"generated",kind:"scalar",T:8}]),W2=Se.makeMessageType("livekit.RpcRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"method",kind:"scalar",T:9},{no:3,name:"payload",kind:"scalar",T:9},{no:4,name:"response_timeout_ms",kind:"scalar",T:13},{no:5,name:"version",kind:"scalar",T:13}]),X2=Se.makeMessageType("livekit.RpcAck",()=>[{no:1,name:"request_id",kind:"scalar",T:9}]),z2=Se.makeMessageType("livekit.RpcResponse",()=>[{no:1,name:"request_id",kind:"scalar",T:9},{no:2,name:"payload",kind:"scalar",T:9,oneof:"value"},{no:3,name:"error",kind:"message",T:Y2,oneof:"value"}]),Y2=Se.makeMessageType("livekit.RpcError",()=>[{no:1,name:"code",kind:"scalar",T:13},{no:2,name:"message",kind:"scalar",T:9},{no:3,name:"data",kind:"scalar",T:9}]),G2=Se.makeMessageType("livekit.ParticipantTracks",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"track_sids",kind:"scalar",T:9,repeated:!0}]),J4=Se.makeMessageType("livekit.ServerInfo",()=>[{no:1,name:"edition",kind:"enum",T:Se.getEnumType(H2)},{no:2,name:"version",kind:"scalar",T:9},{no:3,name:"protocol",kind:"scalar",T:5},{no:4,name:"region",kind:"scalar",T:9},{no:5,name:"node_id",kind:"scalar",T:9},{no:6,name:"debug_info",kind:"scalar",T:9},{no:7,name:"agent_protocol",kind:"scalar",T:5}]),H2=Se.makeEnum("livekit.ServerInfo.Edition",[{no:0,name:"Standard"},{no:1,name:"Cloud"}]),eU=Se.makeMessageType("livekit.ClientInfo",()=>[{no:1,name:"sdk",kind:"enum",T:Se.getEnumType(K2)},{no:2,name:"version",kind:"scalar",T:9},{no:3,name:"protocol",kind:"scalar",T:5},{no:4,name:"os",kind:"scalar",T:9},{no:5,name:"os_version",kind:"scalar",T:9},{no:6,name:"device_model",kind:"scalar",T:9},{no:7,name:"browser",kind:"scalar",T:9},{no:8,name:"browser_version",kind:"scalar",T:9},{no:9,name:"address",kind:"scalar",T:9},{no:10,name:"network",kind:"scalar",T:9},{no:11,name:"other_sdks",kind:"scalar",T:9}]),K2=Se.makeEnum("livekit.ClientInfo.SDK",[{no:0,name:"UNKNOWN"},{no:1,name:"JS"},{no:2,name:"SWIFT"},{no:3,name:"ANDROID"},{no:4,name:"FLUTTER"},{no:5,name:"GO"},{no:6,name:"UNITY"},{no:7,name:"REACT_NATIVE"},{no:8,name:"RUST"},{no:9,name:"PYTHON"},{no:10,name:"CPP"},{no:11,name:"UNITY_WEB"},{no:12,name:"NODE"}]),J2=Se.makeMessageType("livekit.ClientConfiguration",()=>[{no:1,name:"video",kind:"message",T:zT},{no:2,name:"screen",kind:"message",T:zT},{no:3,name:"resume_connection",kind:"enum",T:Se.getEnumType(jd)},{no:4,name:"disabled_codecs",kind:"message",T:tU},{no:5,name:"force_relay",kind:"enum",T:Se.getEnumType(jd)}]),zT=Se.makeMessageType("livekit.VideoConfiguration",()=>[{no:1,name:"hardware_encoder",kind:"enum",T:Se.getEnumType(jd)}]),tU=Se.makeMessageType("livekit.DisabledCodecs",()=>[{no:1,name:"codecs",kind:"message",T:Zg,repeated:!0},{no:2,name:"publish",kind:"message",T:Zg,repeated:!0}]),eQ=Se.makeMessageType("livekit.TimedVersion",()=>[{no:1,name:"unix_micro",kind:"scalar",T:3},{no:2,name:"ticks",kind:"scalar",T:5}]),xS=Se.makeEnum("livekit.DataStream.OperationType",[{no:0,name:"CREATE"},{no:1,name:"UPDATE"},{no:2,name:"DELETE"},{no:3,name:"REACTION"}]),tQ=Se.makeMessageType("livekit.DataStream.TextHeader",()=>[{no:1,name:"operation_type",kind:"enum",T:Se.getEnumType(xS)},{no:2,name:"version",kind:"scalar",T:5},{no:3,name:"reply_to_stream_id",kind:"scalar",T:9},{no:4,name:"attached_stream_ids",kind:"scalar",T:9,repeated:!0},{no:5,name:"generated",kind:"scalar",T:8}],{localName:"DataStream_TextHeader"}),nQ=Se.makeMessageType("livekit.DataStream.ByteHeader",()=>[{no:1,name:"name",kind:"scalar",T:9}],{localName:"DataStream_ByteHeader"}),TS=Se.makeMessageType("livekit.DataStream.Header",()=>[{no:1,name:"stream_id",kind:"scalar",T:9},{no:2,name:"timestamp",kind:"scalar",T:3},{no:3,name:"topic",kind:"scalar",T:9},{no:4,name:"mime_type",kind:"scalar",T:9},{no:5,name:"total_length",kind:"scalar",T:4,opt:!0},{no:7,name:"encryption_type",kind:"enum",T:Se.getEnumType(gs)},{no:8,name:"attributes",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:9,name:"text_header",kind:"message",T:tQ,oneof:"content_header"},{no:10,name:"byte_header",kind:"message",T:nQ,oneof:"content_header"}],{localName:"DataStream_Header"}),CS=Se.makeMessageType("livekit.DataStream.Chunk",()=>[{no:1,name:"stream_id",kind:"scalar",T:9},{no:2,name:"chunk_index",kind:"scalar",T:4},{no:3,name:"content",kind:"scalar",T:12},{no:4,name:"version",kind:"scalar",T:5},{no:5,name:"iv",kind:"scalar",T:12,opt:!0}],{localName:"DataStream_Chunk"}),_S=Se.makeMessageType("livekit.DataStream.Trailer",()=>[{no:1,name:"stream_id",kind:"scalar",T:9},{no:2,name:"reason",kind:"scalar",T:9},{no:3,name:"attributes",kind:"map",K:9,V:{kind:"scalar",T:9}}],{localName:"DataStream_Trailer"}),lo=Se.makeEnum("livekit.SignalTarget",[{no:0,name:"PUBLISHER"},{no:1,name:"SUBSCRIBER"}]),ES=Se.makeEnum("livekit.StreamState",[{no:0,name:"ACTIVE"},{no:1,name:"PAUSED"}]),nU=Se.makeEnum("livekit.CandidateProtocol",[{no:0,name:"UDP"},{no:1,name:"TCP"},{no:2,name:"TLS"}]),rU=Se.makeMessageType("livekit.SignalRequest",()=>[{no:1,name:"offer",kind:"message",T:Pc,oneof:"message"},{no:2,name:"answer",kind:"message",T:Pc,oneof:"message"},{no:3,name:"trickle",kind:"message",T:xw,oneof:"message"},{no:4,name:"add_track",kind:"message",T:AS,oneof:"message"},{no:5,name:"mute",kind:"message",T:Tw,oneof:"message"},{no:6,name:"subscription",kind:"message",T:NO,oneof:"message"},{no:7,name:"track_setting",kind:"message",T:rQ,oneof:"message"},{no:8,name:"leave",kind:"message",T:LO,oneof:"message"},{no:10,name:"update_layers",kind:"message",T:sQ,oneof:"message"},{no:11,name:"subscription_permission",kind:"message",T:cQ,oneof:"message"},{no:12,name:"sync_state",kind:"message",T:uQ,oneof:"message"},{no:13,name:"simulate",kind:"message",T:Co,oneof:"message"},{no:14,name:"ping",kind:"scalar",T:3,oneof:"message"},{no:15,name:"update_metadata",kind:"message",T:oQ,oneof:"message"},{no:16,name:"ping_req",kind:"message",T:dQ,oneof:"message"},{no:17,name:"update_audio_track",kind:"message",T:iQ,oneof:"message"},{no:18,name:"update_video_track",kind:"message",T:lU,oneof:"message"}]),YT=Se.makeMessageType("livekit.SignalResponse",()=>[{no:1,name:"join",kind:"message",T:iU,oneof:"message"},{no:2,name:"answer",kind:"message",T:Pc,oneof:"message"},{no:3,name:"offer",kind:"message",T:Pc,oneof:"message"},{no:4,name:"trickle",kind:"message",T:xw,oneof:"message"},{no:5,name:"update",kind:"message",T:aU,oneof:"message"},{no:6,name:"track_published",kind:"message",T:Cw,oneof:"message"},{no:8,name:"leave",kind:"message",T:LO,oneof:"message"},{no:9,name:"mute",kind:"message",T:Tw,oneof:"message"},{no:10,name:"speakers_changed",kind:"message",T:cU,oneof:"message"},{no:11,name:"room_update",kind:"message",T:uU,oneof:"message"},{no:12,name:"connection_quality",kind:"message",T:dU,oneof:"message"},{no:13,name:"stream_state_update",kind:"message",T:pU,oneof:"message"},{no:14,name:"subscribed_quality_update",kind:"message",T:gU,oneof:"message"},{no:15,name:"subscription_permission_update",kind:"message",T:OU,oneof:"message"},{no:16,name:"refresh_token",kind:"scalar",T:9,oneof:"message"},{no:17,name:"track_unpublished",kind:"message",T:oU,oneof:"message"},{no:18,name:"pong",kind:"scalar",T:3,oneof:"message"},{no:19,name:"reconnect",kind:"message",T:sU,oneof:"message"},{no:20,name:"pong_resp",kind:"message",T:vU,oneof:"message"},{no:21,name:"subscription_response",kind:"message",T:SU,oneof:"message"},{no:22,name:"request_response",kind:"message",T:wU,oneof:"message"},{no:23,name:"track_subscribed",kind:"message",T:kU,oneof:"message"}]),RS=Se.makeMessageType("livekit.SimulcastCodec",()=>[{no:1,name:"codec",kind:"scalar",T:9},{no:2,name:"cid",kind:"scalar",T:9}]),AS=Se.makeMessageType("livekit.AddTrackRequest",()=>[{no:1,name:"cid",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"type",kind:"enum",T:Se.getEnumType(ao)},{no:4,name:"width",kind:"scalar",T:13},{no:5,name:"height",kind:"scalar",T:13},{no:6,name:"muted",kind:"scalar",T:8},{no:7,name:"disable_dtx",kind:"scalar",T:8},{no:8,name:"source",kind:"enum",T:Se.getEnumType(Br)},{no:9,name:"layers",kind:"message",T:bc,repeated:!0},{no:10,name:"simulcast_codecs",kind:"message",T:RS,repeated:!0},{no:11,name:"sid",kind:"scalar",T:9},{no:12,name:"stereo",kind:"scalar",T:8},{no:13,name:"disable_red",kind:"scalar",T:8},{no:14,name:"encryption",kind:"enum",T:Se.getEnumType(gs)},{no:15,name:"stream",kind:"scalar",T:9},{no:16,name:"backup_codec_policy",kind:"enum",T:Se.getEnumType(B2)}]),xw=Se.makeMessageType("livekit.TrickleRequest",()=>[{no:1,name:"candidateInit",kind:"scalar",T:9},{no:2,name:"target",kind:"enum",T:Se.getEnumType(lo)},{no:3,name:"final",kind:"scalar",T:8}]),Tw=Se.makeMessageType("livekit.MuteTrackRequest",()=>[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"muted",kind:"scalar",T:8}]),iU=Se.makeMessageType("livekit.JoinResponse",()=>[{no:1,name:"room",kind:"message",T:Pw},{no:2,name:"participant",kind:"message",T:Nd},{no:3,name:"other_participants",kind:"message",T:Nd,repeated:!0},{no:4,name:"server_version",kind:"scalar",T:9},{no:5,name:"ice_servers",kind:"message",T:aQ,repeated:!0},{no:6,name:"subscriber_primary",kind:"scalar",T:8},{no:7,name:"alternative_url",kind:"scalar",T:9},{no:8,name:"client_configuration",kind:"message",T:J2},{no:9,name:"server_region",kind:"scalar",T:9},{no:10,name:"ping_timeout",kind:"scalar",T:5},{no:11,name:"ping_interval",kind:"scalar",T:5},{no:12,name:"server_info",kind:"message",T:J4},{no:13,name:"sif_trailer",kind:"scalar",T:12},{no:14,name:"enabled_publish_codecs",kind:"message",T:Zg,repeated:!0},{no:15,name:"fast_publish",kind:"scalar",T:8}]),sU=Se.makeMessageType("livekit.ReconnectResponse",()=>[{no:1,name:"ice_servers",kind:"message",T:aQ,repeated:!0},{no:2,name:"client_configuration",kind:"message",T:J2}]),Cw=Se.makeMessageType("livekit.TrackPublishedResponse",()=>[{no:1,name:"cid",kind:"scalar",T:9},{no:2,name:"track",kind:"message",T:Pu}]),oU=Se.makeMessageType("livekit.TrackUnpublishedResponse",()=>[{no:1,name:"track_sid",kind:"scalar",T:9}]),Pc=Se.makeMessageType("livekit.SessionDescription",()=>[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"sdp",kind:"scalar",T:9}]),aU=Se.makeMessageType("livekit.ParticipantUpdate",()=>[{no:1,name:"participants",kind:"message",T:Nd,repeated:!0}]),NO=Se.makeMessageType("livekit.UpdateSubscription",()=>[{no:1,name:"track_sids",kind:"scalar",T:9,repeated:!0},{no:2,name:"subscribe",kind:"scalar",T:8},{no:3,name:"participant_tracks",kind:"message",T:G2,repeated:!0}]),rQ=Se.makeMessageType("livekit.UpdateTrackSettings",()=>[{no:1,name:"track_sids",kind:"scalar",T:9,repeated:!0},{no:3,name:"disabled",kind:"scalar",T:8},{no:4,name:"quality",kind:"enum",T:Se.getEnumType(kw)},{no:5,name:"width",kind:"scalar",T:13},{no:6,name:"height",kind:"scalar",T:13},{no:7,name:"fps",kind:"scalar",T:13},{no:8,name:"priority",kind:"scalar",T:13}]),iQ=Se.makeMessageType("livekit.UpdateLocalAudioTrack",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"features",kind:"enum",T:Se.getEnumType(No),repeated:!0}]),lU=Se.makeMessageType("livekit.UpdateLocalVideoTrack",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"width",kind:"scalar",T:13},{no:3,name:"height",kind:"scalar",T:13}]),LO=Se.makeMessageType("livekit.LeaveRequest",()=>[{no:1,name:"can_reconnect",kind:"scalar",T:8},{no:2,name:"reason",kind:"enum",T:Se.getEnumType(co)},{no:3,name:"action",kind:"enum",T:Se.getEnumType(Eu)},{no:4,name:"regions",kind:"message",T:yU}]),Eu=Se.makeEnum("livekit.LeaveRequest.Action",[{no:0,name:"DISCONNECT"},{no:1,name:"RESUME"},{no:2,name:"RECONNECT"}]),sQ=Se.makeMessageType("livekit.UpdateVideoLayers",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"layers",kind:"message",T:bc,repeated:!0}]),oQ=Se.makeMessageType("livekit.UpdateParticipantMetadata",()=>[{no:1,name:"metadata",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"attributes",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:4,name:"request_id",kind:"scalar",T:13}]),aQ=Se.makeMessageType("livekit.ICEServer",()=>[{no:1,name:"urls",kind:"scalar",T:9,repeated:!0},{no:2,name:"username",kind:"scalar",T:9},{no:3,name:"credential",kind:"scalar",T:9}]),cU=Se.makeMessageType("livekit.SpeakersChanged",()=>[{no:1,name:"speakers",kind:"message",T:F2,repeated:!0}]),uU=Se.makeMessageType("livekit.RoomUpdate",()=>[{no:1,name:"room",kind:"message",T:Pw}]),fU=Se.makeMessageType("livekit.ConnectionQualityInfo",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"quality",kind:"enum",T:Se.getEnumType(vd)},{no:3,name:"score",kind:"scalar",T:2}]),dU=Se.makeMessageType("livekit.ConnectionQualityUpdate",()=>[{no:1,name:"updates",kind:"message",T:fU,repeated:!0}]),hU=Se.makeMessageType("livekit.StreamStateInfo",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"track_sid",kind:"scalar",T:9},{no:3,name:"state",kind:"enum",T:Se.getEnumType(ES)}]),pU=Se.makeMessageType("livekit.StreamStateUpdate",()=>[{no:1,name:"stream_states",kind:"message",T:hU,repeated:!0}]),_w=Se.makeMessageType("livekit.SubscribedQuality",()=>[{no:1,name:"quality",kind:"enum",T:Se.getEnumType(kw)},{no:2,name:"enabled",kind:"scalar",T:8}]),mU=Se.makeMessageType("livekit.SubscribedCodec",()=>[{no:1,name:"codec",kind:"scalar",T:9},{no:2,name:"qualities",kind:"message",T:_w,repeated:!0}]),gU=Se.makeMessageType("livekit.SubscribedQualityUpdate",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"subscribed_qualities",kind:"message",T:_w,repeated:!0},{no:3,name:"subscribed_codecs",kind:"message",T:mU,repeated:!0}]),lQ=Se.makeMessageType("livekit.TrackPermission",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"all_tracks",kind:"scalar",T:8},{no:3,name:"track_sids",kind:"scalar",T:9,repeated:!0},{no:4,name:"participant_identity",kind:"scalar",T:9}]),cQ=Se.makeMessageType("livekit.SubscriptionPermission",()=>[{no:1,name:"all_participants",kind:"scalar",T:8},{no:2,name:"track_permissions",kind:"message",T:lQ,repeated:!0}]),OU=Se.makeMessageType("livekit.SubscriptionPermissionUpdate",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"track_sid",kind:"scalar",T:9},{no:3,name:"allowed",kind:"scalar",T:8}]),uQ=Se.makeMessageType("livekit.SyncState",()=>[{no:1,name:"answer",kind:"message",T:Pc},{no:2,name:"subscription",kind:"message",T:NO},{no:3,name:"publish_tracks",kind:"message",T:Cw,repeated:!0},{no:4,name:"data_channels",kind:"message",T:fQ,repeated:!0},{no:5,name:"offer",kind:"message",T:Pc},{no:6,name:"track_sids_disabled",kind:"scalar",T:9,repeated:!0}]),fQ=Se.makeMessageType("livekit.DataChannelInfo",()=>[{no:1,name:"label",kind:"scalar",T:9},{no:2,name:"id",kind:"scalar",T:13},{no:3,name:"target",kind:"enum",T:Se.getEnumType(lo)}]),Co=Se.makeMessageType("livekit.SimulateScenario",()=>[{no:1,name:"speaker_update",kind:"scalar",T:5,oneof:"scenario"},{no:2,name:"node_failure",kind:"scalar",T:8,oneof:"scenario"},{no:3,name:"migration",kind:"scalar",T:8,oneof:"scenario"},{no:4,name:"server_leave",kind:"scalar",T:8,oneof:"scenario"},{no:5,name:"switch_candidate_protocol",kind:"enum",T:Se.getEnumType(nU),oneof:"scenario"},{no:6,name:"subscriber_bandwidth",kind:"scalar",T:3,oneof:"scenario"},{no:7,name:"disconnect_signal_on_resume",kind:"scalar",T:8,oneof:"scenario"},{no:8,name:"disconnect_signal_on_resume_no_messages",kind:"scalar",T:8,oneof:"scenario"},{no:9,name:"leave_request_full_reconnect",kind:"scalar",T:8,oneof:"scenario"}]),dQ=Se.makeMessageType("livekit.Ping",()=>[{no:1,name:"timestamp",kind:"scalar",T:3},{no:2,name:"rtt",kind:"scalar",T:3}]),vU=Se.makeMessageType("livekit.Pong",()=>[{no:1,name:"last_ping_timestamp",kind:"scalar",T:3},{no:2,name:"timestamp",kind:"scalar",T:3}]),yU=Se.makeMessageType("livekit.RegionSettings",()=>[{no:1,name:"regions",kind:"message",T:bU,repeated:!0}]),bU=Se.makeMessageType("livekit.RegionInfo",()=>[{no:1,name:"region",kind:"scalar",T:9},{no:2,name:"url",kind:"scalar",T:9},{no:3,name:"distance",kind:"scalar",T:3}]),SU=Se.makeMessageType("livekit.SubscriptionResponse",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"err",kind:"enum",T:Se.getEnumType(X4)}]),wU=Se.makeMessageType("livekit.RequestResponse",()=>[{no:1,name:"request_id",kind:"scalar",T:13},{no:2,name:"reason",kind:"enum",T:Se.getEnumType(Ew)},{no:3,name:"message",kind:"scalar",T:9}]),Ew=Se.makeEnum("livekit.RequestResponse.Reason",[{no:0,name:"OK"},{no:1,name:"NOT_FOUND"},{no:2,name:"NOT_ALLOWED"},{no:3,name:"LIMIT_EXCEEDED"}]),kU=Se.makeMessageType("livekit.TrackSubscribed",()=>[{no:1,name:"track_sid",kind:"scalar",T:9}]);function PU(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var hg={exports:{}},xU=hg.exports,GT;function TU(){return GT||(GT=1,function(n){(function(e,t){n.exports?n.exports=t():e.log=t()})(xU,function(){var e=function(){},t="undefined",r=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),i=["trace","debug","info","warn","error"],s={},o=null;function a(O,y){var b=O[y];if(typeof b.bind=="function")return b.bind(O);try{return Function.prototype.bind.call(b,O)}catch{return function(){return Function.prototype.apply.apply(b,[O,arguments])}}}function l(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function c(O){return O==="debug"&&(O="log"),typeof console===t?!1:O==="trace"&&r?l:console[O]!==void 0?a(console,O):console.log!==void 0?a(console,"log"):e}function u(){for(var O=this.getLevel(),y=0;y<i.length;y++){var b=i[y];this[b]=y<O?e:this.methodFactory(b,O,this.name)}if(this.log=this.debug,typeof console===t&&O<this.levels.SILENT)return"No console available for logging"}function d(O){return function(){typeof console!==t&&(u.call(this),this[O].apply(this,arguments))}}function h(O,y,b){return c(O)||d.apply(this,arguments)}function m(O,y){var b=this,S,P,k,x="loglevel";typeof O=="string"?x+=":"+O:typeof O=="symbol"&&(x=void 0);function A($){var D=(i[$]||"silent").toUpperCase();if(!(typeof window===t||!x)){try{window.localStorage[x]=D;return}catch{}try{window.document.cookie=encodeURIComponent(x)+"="+D+";"}catch{}}}function M(){var $;if(!(typeof window===t||!x)){try{$=window.localStorage[x]}catch{}if(typeof $===t)try{var D=window.document.cookie,F=encodeURIComponent(x),G=D.indexOf(F+"=");G!==-1&&($=/^([^;]+)/.exec(D.slice(G+F.length+1))[1])}catch{}return b.levels[$]===void 0&&($=void 0),$}}function Q(){if(!(typeof window===t||!x)){try{window.localStorage.removeItem(x)}catch{}try{window.document.cookie=encodeURIComponent(x)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function _($){var D=$;if(typeof D=="string"&&b.levels[D.toUpperCase()]!==void 0&&(D=b.levels[D.toUpperCase()]),typeof D=="number"&&D>=0&&D<=b.levels.SILENT)return D;throw new TypeError("log.setLevel() called with invalid level: "+$)}b.name=O,b.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},b.methodFactory=y||h,b.getLevel=function(){return k??P??S},b.setLevel=function($,D){return k=_($),D!==!1&&A(k),u.call(b)},b.setDefaultLevel=function($){P=_($),M()||b.setLevel($,!1)},b.resetLevel=function(){k=null,Q(),u.call(b)},b.enableAll=function($){b.setLevel(b.levels.TRACE,$)},b.disableAll=function($){b.setLevel(b.levels.SILENT,$)},b.rebuild=function(){if(o!==b&&(S=_(o.getLevel())),u.call(b),o===b)for(var $ in s)s[$].rebuild()},S=_(o?o.getLevel():"WARN");var R=M();R!=null&&(k=_(R)),u.call(b)}o=new m,o.getLogger=function(y){if(typeof y!="symbol"&&typeof y!="string"||y==="")throw new TypeError("You must supply a name when creating a logger.");var b=s[y];return b||(b=s[y]=new m(y,o.methodFactory)),b};var g=typeof window!==t?window.log:void 0;return o.noConflict=function(){return typeof window!==t&&window.log===o&&(window.log=g),o},o.getLoggers=function(){return s},o.default=o,o})}(hg)),hg.exports}var qO=TU(),$S;(function(n){n[n.trace=0]="trace",n[n.debug=1]="debug",n[n.info=2]="info",n[n.warn=3]="warn",n[n.error=4]="error",n[n.silent=5]="silent"})($S||($S={}));var uo;(function(n){n.Default="livekit",n.Room="livekit-room",n.Participant="livekit-participant",n.Track="livekit-track",n.Publication="livekit-track-publication",n.Engine="livekit-engine",n.Signal="livekit-signal",n.PCManager="livekit-pc-manager",n.PCTransport="livekit-pc-transport",n.E2EE="lk-e2ee"})(uo||(uo={}));let kn=qO.getLogger("livekit");Object.values(uo).map(n=>qO.getLogger(n));kn.setDefaultLevel($S.info);function ka(n){const e=qO.getLogger(n);return e.setDefaultLevel(kn.getLevel()),e}const CU=qO.getLogger("lk-e2ee"),Zf=7e3,_U=[0,300,2*2*300,3*3*300,4*4*300,Zf,Zf,Zf,Zf,Zf];class EU{constructor(e){this._retryDelays=e!==void 0?[...e]:_U}nextRetryDelayInMs(e){if(e.retryCount>=this._retryDelays.length)return null;const t=this._retryDelays[e.retryCount];return e.retryCount<=1?t:t+Math.random()*1e3}}function RU(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t}function ie(n,e,t,r){function i(s){return s instanceof t?s:new t(function(o){o(s)})}return new(t||(t=Promise))(function(s,o){function a(u){try{c(r.next(u))}catch(d){o(d)}}function l(u){try{c(r.throw(u))}catch(d){o(d)}}function c(u){u.done?s(u.value):i(u.value).then(a,l)}c((r=r.apply(n,e||[])).next())})}function HT(n){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&n[e],r=0;if(t)return t.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&r>=n.length&&(n=void 0),{value:n&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function ul(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=n[Symbol.asyncIterator],t;return e?e.call(n):(n=typeof HT=="function"?HT(n):n[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(s){t[s]=n[s]&&function(o){return new Promise(function(a,l){o=n[s](o),i(a,l,o.done,o.value)})}}function i(s,o,a,l){Promise.resolve(l).then(function(c){s({value:c,done:a})},o)}}var xp={exports:{}},KT;function AU(){if(KT)return xp.exports;KT=1;var n=typeof Reflect=="object"?Reflect:null,e=n&&typeof n.apply=="function"?n.apply:function(x,A,M){return Function.prototype.apply.call(x,A,M)},t;n&&typeof n.ownKeys=="function"?t=n.ownKeys:Object.getOwnPropertySymbols?t=function(x){return Object.getOwnPropertyNames(x).concat(Object.getOwnPropertySymbols(x))}:t=function(x){return Object.getOwnPropertyNames(x)};function r(k){console&&console.warn&&console.warn(k)}var i=Number.isNaN||function(x){return x!==x};function s(){s.init.call(this)}xp.exports=s,xp.exports.once=b,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var o=10;function a(k){if(typeof k!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof k)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(k){if(typeof k!="number"||k<0||i(k))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+k+".");o=k}}),s.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(x){if(typeof x!="number"||x<0||i(x))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+x+".");return this._maxListeners=x,this};function l(k){return k._maxListeners===void 0?s.defaultMaxListeners:k._maxListeners}s.prototype.getMaxListeners=function(){return l(this)},s.prototype.emit=function(x){for(var A=[],M=1;M<arguments.length;M++)A.push(arguments[M]);var Q=x==="error",_=this._events;if(_!==void 0)Q=Q&&_.error===void 0;else if(!Q)return!1;if(Q){var R;if(A.length>0&&(R=A[0]),R instanceof Error)throw R;var $=new Error("Unhandled error."+(R?" ("+R.message+")":""));throw $.context=R,$}var D=_[x];if(D===void 0)return!1;if(typeof D=="function")e(D,this,A);else for(var F=D.length,G=g(D,F),M=0;M<F;++M)e(G[M],this,A);return!0};function c(k,x,A,M){var Q,_,R;if(a(A),_=k._events,_===void 0?(_=k._events=Object.create(null),k._eventsCount=0):(_.newListener!==void 0&&(k.emit("newListener",x,A.listener?A.listener:A),_=k._events),R=_[x]),R===void 0)R=_[x]=A,++k._eventsCount;else if(typeof R=="function"?R=_[x]=M?[A,R]:[R,A]:M?R.unshift(A):R.push(A),Q=l(k),Q>0&&R.length>Q&&!R.warned){R.warned=!0;var $=new Error("Possible EventEmitter memory leak detected. "+R.length+" "+String(x)+" listeners added. Use emitter.setMaxListeners() to increase limit");$.name="MaxListenersExceededWarning",$.emitter=k,$.type=x,$.count=R.length,r($)}return k}s.prototype.addListener=function(x,A){return c(this,x,A,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(x,A){return c(this,x,A,!0)};function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(k,x,A){var M={fired:!1,wrapFn:void 0,target:k,type:x,listener:A},Q=u.bind(M);return Q.listener=A,M.wrapFn=Q,Q}s.prototype.once=function(x,A){return a(A),this.on(x,d(this,x,A)),this},s.prototype.prependOnceListener=function(x,A){return a(A),this.prependListener(x,d(this,x,A)),this},s.prototype.removeListener=function(x,A){var M,Q,_,R,$;if(a(A),Q=this._events,Q===void 0)return this;if(M=Q[x],M===void 0)return this;if(M===A||M.listener===A)--this._eventsCount===0?this._events=Object.create(null):(delete Q[x],Q.removeListener&&this.emit("removeListener",x,M.listener||A));else if(typeof M!="function"){for(_=-1,R=M.length-1;R>=0;R--)if(M[R]===A||M[R].listener===A){$=M[R].listener,_=R;break}if(_<0)return this;_===0?M.shift():O(M,_),M.length===1&&(Q[x]=M[0]),Q.removeListener!==void 0&&this.emit("removeListener",x,$||A)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(x){var A,M,Q;if(M=this._events,M===void 0)return this;if(M.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):M[x]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete M[x]),this;if(arguments.length===0){var _=Object.keys(M),R;for(Q=0;Q<_.length;++Q)R=_[Q],R!=="removeListener"&&this.removeAllListeners(R);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(A=M[x],typeof A=="function")this.removeListener(x,A);else if(A!==void 0)for(Q=A.length-1;Q>=0;Q--)this.removeListener(x,A[Q]);return this};function h(k,x,A){var M=k._events;if(M===void 0)return[];var Q=M[x];return Q===void 0?[]:typeof Q=="function"?A?[Q.listener||Q]:[Q]:A?y(Q):g(Q,Q.length)}s.prototype.listeners=function(x){return h(this,x,!0)},s.prototype.rawListeners=function(x){return h(this,x,!1)},s.listenerCount=function(k,x){return typeof k.listenerCount=="function"?k.listenerCount(x):m.call(k,x)},s.prototype.listenerCount=m;function m(k){var x=this._events;if(x!==void 0){var A=x[k];if(typeof A=="function")return 1;if(A!==void 0)return A.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]};function g(k,x){for(var A=new Array(x),M=0;M<x;++M)A[M]=k[M];return A}function O(k,x){for(;x+1<k.length;x++)k[x]=k[x+1];k.pop()}function y(k){for(var x=new Array(k.length),A=0;A<x.length;++A)x[A]=k[A].listener||k[A];return x}function b(k,x){return new Promise(function(A,M){function Q(R){k.removeListener(x,_),M(R)}function _(){typeof k.removeListener=="function"&&k.removeListener("error",Q),A([].slice.call(arguments))}P(k,x,_,{once:!0}),x!=="error"&&S(k,Q,{once:!0})})}function S(k,x,A){typeof k.on=="function"&&P(k,"error",x,A)}function P(k,x,A,M){if(typeof k.on=="function")M.once?k.once(x,A):k.on(x,A);else if(typeof k.addEventListener=="function")k.addEventListener(x,function Q(_){M.once&&k.removeEventListener(x,Q),A(_)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof k)}return xp.exports}var Yo=AU();let hQ=!0,pQ=!0;function pg(n,e,t){const r=n.match(e);return r&&r.length>=t&&parseInt(r[t],10)}function Ac(n,e,t){if(!n.RTCPeerConnection)return;const r=n.RTCPeerConnection.prototype,i=r.addEventListener;r.addEventListener=function(o,a){if(o!==e)return i.apply(this,arguments);const l=c=>{const u=t(c);u&&(a.handleEvent?a.handleEvent(u):a(u))};return this._eventMap=this._eventMap||{},this._eventMap[e]||(this._eventMap[e]=new Map),this._eventMap[e].set(a,l),i.apply(this,[o,l])};const s=r.removeEventListener;r.removeEventListener=function(o,a){if(o!==e||!this._eventMap||!this._eventMap[e])return s.apply(this,arguments);if(!this._eventMap[e].has(a))return s.apply(this,arguments);const l=this._eventMap[e].get(a);return this._eventMap[e].delete(a),this._eventMap[e].size===0&&delete this._eventMap[e],Object.keys(this._eventMap).length===0&&delete this._eventMap,s.apply(this,[o,l])},Object.defineProperty(r,"on"+e,{get(){return this["_on"+e]},set(o){this["_on"+e]&&(this.removeEventListener(e,this["_on"+e]),delete this["_on"+e]),o&&this.addEventListener(e,this["_on"+e]=o)},enumerable:!0,configurable:!0})}function $U(n){return typeof n!="boolean"?new Error("Argument type: "+typeof n+". Please use a boolean."):(hQ=n,n?"adapter.js logging disabled":"adapter.js logging enabled")}function MU(n){return typeof n!="boolean"?new Error("Argument type: "+typeof n+". Please use a boolean."):(pQ=!n,"adapter.js deprecation warnings "+(n?"disabled":"enabled"))}function mQ(){if(typeof window=="object"){if(hQ)return;typeof console<"u"&&typeof console.log=="function"&&console.log.apply(console,arguments)}}function Rw(n,e){pQ&&console.warn(n+" is deprecated, please use "+e+" instead.")}function QU(n){const e={browser:null,version:null};if(typeof n>"u"||!n.navigator||!n.navigator.userAgent)return e.browser="Not a browser.",e;const{navigator:t}=n;if(t.userAgentData&&t.userAgentData.brands){const r=t.userAgentData.brands.find(i=>i.brand==="Chromium");if(r)return{browser:"chrome",version:parseInt(r.version,10)}}if(t.mozGetUserMedia)e.browser="firefox",e.version=pg(t.userAgent,/Firefox\/(\d+)\./,1);else if(t.webkitGetUserMedia||n.isSecureContext===!1&&n.webkitRTCPeerConnection)e.browser="chrome",e.version=pg(t.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(n.RTCPeerConnection&&t.userAgent.match(/AppleWebKit\/(\d+)\./))e.browser="safari",e.version=pg(t.userAgent,/AppleWebKit\/(\d+)\./,1),e.supportsUnifiedPlan=n.RTCRtpTransceiver&&"currentDirection"in n.RTCRtpTransceiver.prototype;else return e.browser="Not a supported browser.",e;return e}function JT(n){return Object.prototype.toString.call(n)==="[object Object]"}function gQ(n){return JT(n)?Object.keys(n).reduce(function(e,t){const r=JT(n[t]),i=r?gQ(n[t]):n[t],s=r&&!Object.keys(i).length;return i===void 0||s?e:Object.assign(e,{[t]:i})},{}):n}function MS(n,e,t){!e||t.has(e.id)||(t.set(e.id,e),Object.keys(e).forEach(r=>{r.endsWith("Id")?MS(n,n.get(e[r]),t):r.endsWith("Ids")&&e[r].forEach(i=>{MS(n,n.get(i),t)})}))}function eC(n,e,t){const r=t?"outbound-rtp":"inbound-rtp",i=new Map;if(e===null)return i;const s=[];return n.forEach(o=>{o.type==="track"&&o.trackIdentifier===e.id&&s.push(o)}),s.forEach(o=>{n.forEach(a=>{a.type===r&&a.trackId===o.id&&MS(n,a,i)})}),i}const tC=mQ;function OQ(n,e){const t=n&&n.navigator;if(!t.mediaDevices)return;const r=function(a){if(typeof a!="object"||a.mandatory||a.optional)return a;const l={};return Object.keys(a).forEach(c=>{if(c==="require"||c==="advanced"||c==="mediaSource")return;const u=typeof a[c]=="object"?a[c]:{ideal:a[c]};u.exact!==void 0&&typeof u.exact=="number"&&(u.min=u.max=u.exact);const d=function(h,m){return h?h+m.charAt(0).toUpperCase()+m.slice(1):m==="deviceId"?"sourceId":m};if(u.ideal!==void 0){l.optional=l.optional||[];let h={};typeof u.ideal=="number"?(h[d("min",c)]=u.ideal,l.optional.push(h),h={},h[d("max",c)]=u.ideal,l.optional.push(h)):(h[d("",c)]=u.ideal,l.optional.push(h))}u.exact!==void 0&&typeof u.exact!="number"?(l.mandatory=l.mandatory||{},l.mandatory[d("",c)]=u.exact):["min","max"].forEach(h=>{u[h]!==void 0&&(l.mandatory=l.mandatory||{},l.mandatory[d(h,c)]=u[h])})}),a.advanced&&(l.optional=(l.optional||[]).concat(a.advanced)),l},i=function(a,l){if(e.version>=61)return l(a);if(a=JSON.parse(JSON.stringify(a)),a&&typeof a.audio=="object"){const c=function(u,d,h){d in u&&!(h in u)&&(u[h]=u[d],delete u[d])};a=JSON.parse(JSON.stringify(a)),c(a.audio,"autoGainControl","googAutoGainControl"),c(a.audio,"noiseSuppression","googNoiseSuppression"),a.audio=r(a.audio)}if(a&&typeof a.video=="object"){let c=a.video.facingMode;c=c&&(typeof c=="object"?c:{ideal:c});const u=e.version<66;if(c&&(c.exact==="user"||c.exact==="environment"||c.ideal==="user"||c.ideal==="environment")&&!(t.mediaDevices.getSupportedConstraints&&t.mediaDevices.getSupportedConstraints().facingMode&&!u)){delete a.video.facingMode;let d;if(c.exact==="environment"||c.ideal==="environment"?d=["back","rear"]:(c.exact==="user"||c.ideal==="user")&&(d=["front"]),d)return t.mediaDevices.enumerateDevices().then(h=>{h=h.filter(g=>g.kind==="videoinput");let m=h.find(g=>d.some(O=>g.label.toLowerCase().includes(O)));return!m&&h.length&&d.includes("back")&&(m=h[h.length-1]),m&&(a.video.deviceId=c.exact?{exact:m.deviceId}:{ideal:m.deviceId}),a.video=r(a.video),tC("chrome: "+JSON.stringify(a)),l(a)})}a.video=r(a.video)}return tC("chrome: "+JSON.stringify(a)),l(a)},s=function(a){return e.version>=64?a:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[a.name]||a.name,message:a.message,constraint:a.constraint||a.constraintName,toString(){return this.name+(this.message&&": ")+this.message}}},o=function(a,l,c){i(a,u=>{t.webkitGetUserMedia(u,l,d=>{c&&c(s(d))})})};if(t.getUserMedia=o.bind(t),t.mediaDevices.getUserMedia){const a=t.mediaDevices.getUserMedia.bind(t.mediaDevices);t.mediaDevices.getUserMedia=function(l){return i(l,c=>a(c).then(u=>{if(c.audio&&!u.getAudioTracks().length||c.video&&!u.getVideoTracks().length)throw u.getTracks().forEach(d=>{d.stop()}),new DOMException("","NotFoundError");return u},u=>Promise.reject(s(u))))}}}function vQ(n){n.MediaStream=n.MediaStream||n.webkitMediaStream}function yQ(n){if(typeof n=="object"&&n.RTCPeerConnection&&!("ontrack"in n.RTCPeerConnection.prototype)){Object.defineProperty(n.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(t){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=t)},enumerable:!0,configurable:!0});const e=n.RTCPeerConnection.prototype.setRemoteDescription;n.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=r=>{r.stream.addEventListener("addtrack",i=>{let s;n.RTCPeerConnection.prototype.getReceivers?s=this.getReceivers().find(a=>a.track&&a.track.id===i.track.id):s={track:i.track};const o=new Event("track");o.track=i.track,o.receiver=s,o.transceiver={receiver:s},o.streams=[r.stream],this.dispatchEvent(o)}),r.stream.getTracks().forEach(i=>{let s;n.RTCPeerConnection.prototype.getReceivers?s=this.getReceivers().find(a=>a.track&&a.track.id===i.id):s={track:i};const o=new Event("track");o.track=i,o.receiver=s,o.transceiver={receiver:s},o.streams=[r.stream],this.dispatchEvent(o)})},this.addEventListener("addstream",this._ontrackpoly)),e.apply(this,arguments)}}else Ac(n,"track",e=>(e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e))}function bQ(n){if(typeof n=="object"&&n.RTCPeerConnection&&!("getSenders"in n.RTCPeerConnection.prototype)&&"createDTMFSender"in n.RTCPeerConnection.prototype){const e=function(i,s){return{track:s,get dtmf(){return this._dtmf===void 0&&(s.kind==="audio"?this._dtmf=i.createDTMFSender(s):this._dtmf=null),this._dtmf},_pc:i}};if(!n.RTCPeerConnection.prototype.getSenders){n.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};const i=n.RTCPeerConnection.prototype.addTrack;n.RTCPeerConnection.prototype.addTrack=function(a,l){let c=i.apply(this,arguments);return c||(c=e(this,a),this._senders.push(c)),c};const s=n.RTCPeerConnection.prototype.removeTrack;n.RTCPeerConnection.prototype.removeTrack=function(a){s.apply(this,arguments);const l=this._senders.indexOf(a);l!==-1&&this._senders.splice(l,1)}}const t=n.RTCPeerConnection.prototype.addStream;n.RTCPeerConnection.prototype.addStream=function(s){this._senders=this._senders||[],t.apply(this,[s]),s.getTracks().forEach(o=>{this._senders.push(e(this,o))})};const r=n.RTCPeerConnection.prototype.removeStream;n.RTCPeerConnection.prototype.removeStream=function(s){this._senders=this._senders||[],r.apply(this,[s]),s.getTracks().forEach(o=>{const a=this._senders.find(l=>l.track===o);a&&this._senders.splice(this._senders.indexOf(a),1)})}}else if(typeof n=="object"&&n.RTCPeerConnection&&"getSenders"in n.RTCPeerConnection.prototype&&"createDTMFSender"in n.RTCPeerConnection.prototype&&n.RTCRtpSender&&!("dtmf"in n.RTCRtpSender.prototype)){const e=n.RTCPeerConnection.prototype.getSenders;n.RTCPeerConnection.prototype.getSenders=function(){const r=e.apply(this,[]);return r.forEach(i=>i._pc=this),r},Object.defineProperty(n.RTCRtpSender.prototype,"dtmf",{get(){return this._dtmf===void 0&&(this.track.kind==="audio"?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function SQ(n){if(!(typeof n=="object"&&n.RTCPeerConnection&&n.RTCRtpSender&&n.RTCRtpReceiver))return;if(!("getStats"in n.RTCRtpSender.prototype)){const t=n.RTCPeerConnection.prototype.getSenders;t&&(n.RTCPeerConnection.prototype.getSenders=function(){const s=t.apply(this,[]);return s.forEach(o=>o._pc=this),s});const r=n.RTCPeerConnection.prototype.addTrack;r&&(n.RTCPeerConnection.prototype.addTrack=function(){const s=r.apply(this,arguments);return s._pc=this,s}),n.RTCRtpSender.prototype.getStats=function(){const s=this;return this._pc.getStats().then(o=>eC(o,s.track,!0))}}if(!("getStats"in n.RTCRtpReceiver.prototype)){const t=n.RTCPeerConnection.prototype.getReceivers;t&&(n.RTCPeerConnection.prototype.getReceivers=function(){const i=t.apply(this,[]);return i.forEach(s=>s._pc=this),i}),Ac(n,"track",r=>(r.receiver._pc=r.srcElement,r)),n.RTCRtpReceiver.prototype.getStats=function(){const i=this;return this._pc.getStats().then(s=>eC(s,i.track,!1))}}if(!("getStats"in n.RTCRtpSender.prototype&&"getStats"in n.RTCRtpReceiver.prototype))return;const e=n.RTCPeerConnection.prototype.getStats;n.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof n.MediaStreamTrack){const r=arguments[0];let i,s,o;return this.getSenders().forEach(a=>{a.track===r&&(i?o=!0:i=a)}),this.getReceivers().forEach(a=>(a.track===r&&(s?o=!0:s=a),a.track===r)),o||i&&s?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):i?i.getStats():s?s.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return e.apply(this,arguments)}}function wQ(n){n.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map(o=>this._shimmedLocalStreams[o][0])};const e=n.RTCPeerConnection.prototype.addTrack;n.RTCPeerConnection.prototype.addTrack=function(o,a){if(!a)return e.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};const l=e.apply(this,arguments);return this._shimmedLocalStreams[a.id]?this._shimmedLocalStreams[a.id].indexOf(l)===-1&&this._shimmedLocalStreams[a.id].push(l):this._shimmedLocalStreams[a.id]=[a,l],l};const t=n.RTCPeerConnection.prototype.addStream;n.RTCPeerConnection.prototype.addStream=function(o){this._shimmedLocalStreams=this._shimmedLocalStreams||{},o.getTracks().forEach(c=>{if(this.getSenders().find(d=>d.track===c))throw new DOMException("Track already exists.","InvalidAccessError")});const a=this.getSenders();t.apply(this,arguments);const l=this.getSenders().filter(c=>a.indexOf(c)===-1);this._shimmedLocalStreams[o.id]=[o].concat(l)};const r=n.RTCPeerConnection.prototype.removeStream;n.RTCPeerConnection.prototype.removeStream=function(o){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[o.id],r.apply(this,arguments)};const i=n.RTCPeerConnection.prototype.removeTrack;n.RTCPeerConnection.prototype.removeTrack=function(o){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},o&&Object.keys(this._shimmedLocalStreams).forEach(a=>{const l=this._shimmedLocalStreams[a].indexOf(o);l!==-1&&this._shimmedLocalStreams[a].splice(l,1),this._shimmedLocalStreams[a].length===1&&delete this._shimmedLocalStreams[a]}),i.apply(this,arguments)}}function kQ(n,e){if(!n.RTCPeerConnection)return;if(n.RTCPeerConnection.prototype.addTrack&&e.version>=65)return wQ(n);const t=n.RTCPeerConnection.prototype.getLocalStreams;n.RTCPeerConnection.prototype.getLocalStreams=function(){const u=t.apply(this);return this._reverseStreams=this._reverseStreams||{},u.map(d=>this._reverseStreams[d.id])};const r=n.RTCPeerConnection.prototype.addStream;n.RTCPeerConnection.prototype.addStream=function(u){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},u.getTracks().forEach(d=>{if(this.getSenders().find(m=>m.track===d))throw new DOMException("Track already exists.","InvalidAccessError")}),!this._reverseStreams[u.id]){const d=new n.MediaStream(u.getTracks());this._streams[u.id]=d,this._reverseStreams[d.id]=u,u=d}r.apply(this,[u])};const i=n.RTCPeerConnection.prototype.removeStream;n.RTCPeerConnection.prototype.removeStream=function(u){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},i.apply(this,[this._streams[u.id]||u]),delete this._reverseStreams[this._streams[u.id]?this._streams[u.id].id:u.id],delete this._streams[u.id]},n.RTCPeerConnection.prototype.addTrack=function(u,d){if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");const h=[].slice.call(arguments,1);if(h.length!==1||!h[0].getTracks().find(O=>O===u))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");if(this.getSenders().find(O=>O.track===u))throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const g=this._streams[d.id];if(g)g.addTrack(u),Promise.resolve().then(()=>{this.dispatchEvent(new Event("negotiationneeded"))});else{const O=new n.MediaStream([u]);this._streams[d.id]=O,this._reverseStreams[O.id]=d,this.addStream(O)}return this.getSenders().find(O=>O.track===u)};function s(c,u){let d=u.sdp;return Object.keys(c._reverseStreams||[]).forEach(h=>{const m=c._reverseStreams[h],g=c._streams[m.id];d=d.replace(new RegExp(g.id,"g"),m.id)}),new RTCSessionDescription({type:u.type,sdp:d})}function o(c,u){let d=u.sdp;return Object.keys(c._reverseStreams||[]).forEach(h=>{const m=c._reverseStreams[h],g=c._streams[m.id];d=d.replace(new RegExp(m.id,"g"),g.id)}),new RTCSessionDescription({type:u.type,sdp:d})}["createOffer","createAnswer"].forEach(function(c){const u=n.RTCPeerConnection.prototype[c],d={[c](){const h=arguments;return arguments.length&&typeof arguments[0]=="function"?u.apply(this,[g=>{const O=s(this,g);h[0].apply(null,[O])},g=>{h[1]&&h[1].apply(null,g)},arguments[2]]):u.apply(this,arguments).then(g=>s(this,g))}};n.RTCPeerConnection.prototype[c]=d[c]});const a=n.RTCPeerConnection.prototype.setLocalDescription;n.RTCPeerConnection.prototype.setLocalDescription=function(){return!arguments.length||!arguments[0].type?a.apply(this,arguments):(arguments[0]=o(this,arguments[0]),a.apply(this,arguments))};const l=Object.getOwnPropertyDescriptor(n.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(n.RTCPeerConnection.prototype,"localDescription",{get(){const c=l.get.apply(this);return c.type===""?c:s(this,c)}}),n.RTCPeerConnection.prototype.removeTrack=function(u){if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!u._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(!(u._pc===this))throw new DOMException("Sender was not created by this connection.","InvalidAccessError");this._streams=this._streams||{};let h;Object.keys(this._streams).forEach(m=>{this._streams[m].getTracks().find(O=>u.track===O)&&(h=this._streams[m])}),h&&(h.getTracks().length===1?this.removeStream(this._reverseStreams[h.id]):h.removeTrack(u.track),this.dispatchEvent(new Event("negotiationneeded")))}}function QS(n,e){!n.RTCPeerConnection&&n.webkitRTCPeerConnection&&(n.RTCPeerConnection=n.webkitRTCPeerConnection),n.RTCPeerConnection&&e.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(t){const r=n.RTCPeerConnection.prototype[t],i={[t](){return arguments[0]=new(t==="addIceCandidate"?n.RTCIceCandidate:n.RTCSessionDescription)(arguments[0]),r.apply(this,arguments)}};n.RTCPeerConnection.prototype[t]=i[t]})}function PQ(n,e){Ac(n,"negotiationneeded",t=>{const r=t.target;if(!((e.version<72||r.getConfiguration&&r.getConfiguration().sdpSemantics==="plan-b")&&r.signalingState!=="stable"))return t})}var nC=Object.freeze({__proto__:null,fixNegotiationNeeded:PQ,shimAddTrackRemoveTrack:kQ,shimAddTrackRemoveTrackWithNative:wQ,shimGetSendersWithDtmf:bQ,shimGetUserMedia:OQ,shimMediaStream:vQ,shimOnTrack:yQ,shimPeerConnection:QS,shimSenderReceiverGetStats:SQ});function xQ(n,e){const t=n&&n.navigator,r=n&&n.MediaStreamTrack;if(t.getUserMedia=function(i,s,o){Rw("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),t.mediaDevices.getUserMedia(i).then(s,o)},!(e.version>55&&"autoGainControl"in t.mediaDevices.getSupportedConstraints())){const i=function(o,a,l){a in o&&!(l in o)&&(o[l]=o[a],delete o[a])},s=t.mediaDevices.getUserMedia.bind(t.mediaDevices);if(t.mediaDevices.getUserMedia=function(o){return typeof o=="object"&&typeof o.audio=="object"&&(o=JSON.parse(JSON.stringify(o)),i(o.audio,"autoGainControl","mozAutoGainControl"),i(o.audio,"noiseSuppression","mozNoiseSuppression")),s(o)},r&&r.prototype.getSettings){const o=r.prototype.getSettings;r.prototype.getSettings=function(){const a=o.apply(this,arguments);return i(a,"mozAutoGainControl","autoGainControl"),i(a,"mozNoiseSuppression","noiseSuppression"),a}}if(r&&r.prototype.applyConstraints){const o=r.prototype.applyConstraints;r.prototype.applyConstraints=function(a){return this.kind==="audio"&&typeof a=="object"&&(a=JSON.parse(JSON.stringify(a)),i(a,"autoGainControl","mozAutoGainControl"),i(a,"noiseSuppression","mozNoiseSuppression")),o.apply(this,[a])}}}}function DU(n,e){n.navigator.mediaDevices&&"getDisplayMedia"in n.navigator.mediaDevices||n.navigator.mediaDevices&&(n.navigator.mediaDevices.getDisplayMedia=function(r){if(!(r&&r.video)){const i=new DOMException("getDisplayMedia without video constraints is undefined");return i.name="NotFoundError",i.code=8,Promise.reject(i)}return r.video===!0?r.video={mediaSource:e}:r.video.mediaSource=e,n.navigator.mediaDevices.getUserMedia(r)})}function TQ(n){typeof n=="object"&&n.RTCTrackEvent&&"receiver"in n.RTCTrackEvent.prototype&&!("transceiver"in n.RTCTrackEvent.prototype)&&Object.defineProperty(n.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function DS(n,e){if(typeof n!="object"||!(n.RTCPeerConnection||n.mozRTCPeerConnection))return;!n.RTCPeerConnection&&n.mozRTCPeerConnection&&(n.RTCPeerConnection=n.mozRTCPeerConnection),e.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(i){const s=n.RTCPeerConnection.prototype[i],o={[i](){return arguments[0]=new(i==="addIceCandidate"?n.RTCIceCandidate:n.RTCSessionDescription)(arguments[0]),s.apply(this,arguments)}};n.RTCPeerConnection.prototype[i]=o[i]});const t={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},r=n.RTCPeerConnection.prototype.getStats;n.RTCPeerConnection.prototype.getStats=function(){const[s,o,a]=arguments;return r.apply(this,[s||null]).then(l=>{if(e.version<53&&!o)try{l.forEach(c=>{c.type=t[c.type]||c.type})}catch(c){if(c.name!=="TypeError")throw c;l.forEach((u,d)=>{l.set(d,Object.assign({},u,{type:t[u.type]||u.type}))})}return l}).then(o,a)}}function CQ(n){if(!(typeof n=="object"&&n.RTCPeerConnection&&n.RTCRtpSender)||n.RTCRtpSender&&"getStats"in n.RTCRtpSender.prototype)return;const e=n.RTCPeerConnection.prototype.getSenders;e&&(n.RTCPeerConnection.prototype.getSenders=function(){const i=e.apply(this,[]);return i.forEach(s=>s._pc=this),i});const t=n.RTCPeerConnection.prototype.addTrack;t&&(n.RTCPeerConnection.prototype.addTrack=function(){const i=t.apply(this,arguments);return i._pc=this,i}),n.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}function _Q(n){if(!(typeof n=="object"&&n.RTCPeerConnection&&n.RTCRtpSender)||n.RTCRtpSender&&"getStats"in n.RTCRtpReceiver.prototype)return;const e=n.RTCPeerConnection.prototype.getReceivers;e&&(n.RTCPeerConnection.prototype.getReceivers=function(){const r=e.apply(this,[]);return r.forEach(i=>i._pc=this),r}),Ac(n,"track",t=>(t.receiver._pc=t.srcElement,t)),n.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function EQ(n){!n.RTCPeerConnection||"removeStream"in n.RTCPeerConnection.prototype||(n.RTCPeerConnection.prototype.removeStream=function(t){Rw("removeStream","removeTrack"),this.getSenders().forEach(r=>{r.track&&t.getTracks().includes(r.track)&&this.removeTrack(r)})})}function RQ(n){n.DataChannel&&!n.RTCDataChannel&&(n.RTCDataChannel=n.DataChannel)}function AQ(n){if(!(typeof n=="object"&&n.RTCPeerConnection))return;const e=n.RTCPeerConnection.prototype.addTransceiver;e&&(n.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];let r=arguments[1]&&arguments[1].sendEncodings;r===void 0&&(r=[]),r=[...r];const i=r.length>0;i&&r.forEach(o=>{if("rid"in o&&!/^[a-z0-9]{0,16}$/i.test(o.rid))throw new TypeError("Invalid RID value provided.");if("scaleResolutionDownBy"in o&&!(parseFloat(o.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in o&&!(parseFloat(o.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")});const s=e.apply(this,arguments);if(i){const{sender:o}=s,a=o.getParameters();(!("encodings"in a)||a.encodings.length===1&&Object.keys(a.encodings[0]).length===0)&&(a.encodings=r,o.sendEncodings=r,this.setParametersPromises.push(o.setParameters(a).then(()=>{delete o.sendEncodings}).catch(()=>{delete o.sendEncodings})))}return s})}function $Q(n){if(!(typeof n=="object"&&n.RTCRtpSender))return;const e=n.RTCRtpSender.prototype.getParameters;e&&(n.RTCRtpSender.prototype.getParameters=function(){const r=e.apply(this,arguments);return"encodings"in r||(r.encodings=[].concat(this.sendEncodings||[{}])),r})}function MQ(n){if(!(typeof n=="object"&&n.RTCPeerConnection))return;const e=n.RTCPeerConnection.prototype.createOffer;n.RTCPeerConnection.prototype.createOffer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>e.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):e.apply(this,arguments)}}function QQ(n){if(!(typeof n=="object"&&n.RTCPeerConnection))return;const e=n.RTCPeerConnection.prototype.createAnswer;n.RTCPeerConnection.prototype.createAnswer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>e.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):e.apply(this,arguments)}}var rC=Object.freeze({__proto__:null,shimAddTransceiver:AQ,shimCreateAnswer:QQ,shimCreateOffer:MQ,shimGetDisplayMedia:DU,shimGetParameters:$Q,shimGetUserMedia:xQ,shimOnTrack:TQ,shimPeerConnection:DS,shimRTCDataChannel:RQ,shimReceiverGetStats:_Q,shimRemoveStream:EQ,shimSenderGetStats:CQ});function DQ(n){if(!(typeof n!="object"||!n.RTCPeerConnection)){if("getLocalStreams"in n.RTCPeerConnection.prototype||(n.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in n.RTCPeerConnection.prototype)){const e=n.RTCPeerConnection.prototype.addTrack;n.RTCPeerConnection.prototype.addStream=function(r){this._localStreams||(this._localStreams=[]),this._localStreams.includes(r)||this._localStreams.push(r),r.getAudioTracks().forEach(i=>e.call(this,i,r)),r.getVideoTracks().forEach(i=>e.call(this,i,r))},n.RTCPeerConnection.prototype.addTrack=function(r){for(var i=arguments.length,s=new Array(i>1?i-1:0),o=1;o<i;o++)s[o-1]=arguments[o];return s&&s.forEach(a=>{this._localStreams?this._localStreams.includes(a)||this._localStreams.push(a):this._localStreams=[a]}),e.apply(this,arguments)}}"removeStream"in n.RTCPeerConnection.prototype||(n.RTCPeerConnection.prototype.removeStream=function(t){this._localStreams||(this._localStreams=[]);const r=this._localStreams.indexOf(t);if(r===-1)return;this._localStreams.splice(r,1);const i=t.getTracks();this.getSenders().forEach(s=>{i.includes(s.track)&&this.removeTrack(s)})})}}function IQ(n){if(!(typeof n!="object"||!n.RTCPeerConnection)&&("getRemoteStreams"in n.RTCPeerConnection.prototype||(n.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in n.RTCPeerConnection.prototype))){Object.defineProperty(n.RTCPeerConnection.prototype,"onaddstream",{get(){return this._onaddstream},set(t){this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=t),this.addEventListener("track",this._onaddstreampoly=r=>{r.streams.forEach(i=>{if(this._remoteStreams||(this._remoteStreams=[]),this._remoteStreams.includes(i))return;this._remoteStreams.push(i);const s=new Event("addstream");s.stream=i,this.dispatchEvent(s)})})}});const e=n.RTCPeerConnection.prototype.setRemoteDescription;n.RTCPeerConnection.prototype.setRemoteDescription=function(){const r=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(i){i.streams.forEach(s=>{if(r._remoteStreams||(r._remoteStreams=[]),r._remoteStreams.indexOf(s)>=0)return;r._remoteStreams.push(s);const o=new Event("addstream");o.stream=s,r.dispatchEvent(o)})}),e.apply(r,arguments)}}}function jQ(n){if(typeof n!="object"||!n.RTCPeerConnection)return;const e=n.RTCPeerConnection.prototype,t=e.createOffer,r=e.createAnswer,i=e.setLocalDescription,s=e.setRemoteDescription,o=e.addIceCandidate;e.createOffer=function(c,u){const d=arguments.length>=2?arguments[2]:arguments[0],h=t.apply(this,[d]);return u?(h.then(c,u),Promise.resolve()):h},e.createAnswer=function(c,u){const d=arguments.length>=2?arguments[2]:arguments[0],h=r.apply(this,[d]);return u?(h.then(c,u),Promise.resolve()):h};let a=function(l,c,u){const d=i.apply(this,[l]);return u?(d.then(c,u),Promise.resolve()):d};e.setLocalDescription=a,a=function(l,c,u){const d=s.apply(this,[l]);return u?(d.then(c,u),Promise.resolve()):d},e.setRemoteDescription=a,a=function(l,c,u){const d=o.apply(this,[l]);return u?(d.then(c,u),Promise.resolve()):d},e.addIceCandidate=a}function NQ(n){const e=n&&n.navigator;if(e.mediaDevices&&e.mediaDevices.getUserMedia){const t=e.mediaDevices,r=t.getUserMedia.bind(t);e.mediaDevices.getUserMedia=i=>r(LQ(i))}!e.getUserMedia&&e.mediaDevices&&e.mediaDevices.getUserMedia&&(e.getUserMedia=(function(r,i,s){e.mediaDevices.getUserMedia(r).then(i,s)}).bind(e))}function LQ(n){return n&&n.video!==void 0?Object.assign({},n,{video:gQ(n.video)}):n}function qQ(n){if(!n.RTCPeerConnection)return;const e=n.RTCPeerConnection;n.RTCPeerConnection=function(r,i){if(r&&r.iceServers){const s=[];for(let o=0;o<r.iceServers.length;o++){let a=r.iceServers[o];a.urls===void 0&&a.url?(Rw("RTCIceServer.url","RTCIceServer.urls"),a=JSON.parse(JSON.stringify(a)),a.urls=a.url,delete a.url,s.push(a)):s.push(r.iceServers[o])}r.iceServers=s}return new e(r,i)},n.RTCPeerConnection.prototype=e.prototype,"generateCertificate"in e&&Object.defineProperty(n.RTCPeerConnection,"generateCertificate",{get(){return e.generateCertificate}})}function UQ(n){typeof n=="object"&&n.RTCTrackEvent&&"receiver"in n.RTCTrackEvent.prototype&&!("transceiver"in n.RTCTrackEvent.prototype)&&Object.defineProperty(n.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function BQ(n){const e=n.RTCPeerConnection.prototype.createOffer;n.RTCPeerConnection.prototype.createOffer=function(r){if(r){typeof r.offerToReceiveAudio<"u"&&(r.offerToReceiveAudio=!!r.offerToReceiveAudio);const i=this.getTransceivers().find(o=>o.receiver.track.kind==="audio");r.offerToReceiveAudio===!1&&i?i.direction==="sendrecv"?i.setDirection?i.setDirection("sendonly"):i.direction="sendonly":i.direction==="recvonly"&&(i.setDirection?i.setDirection("inactive"):i.direction="inactive"):r.offerToReceiveAudio===!0&&!i&&this.addTransceiver("audio",{direction:"recvonly"}),typeof r.offerToReceiveVideo<"u"&&(r.offerToReceiveVideo=!!r.offerToReceiveVideo);const s=this.getTransceivers().find(o=>o.receiver.track.kind==="video");r.offerToReceiveVideo===!1&&s?s.direction==="sendrecv"?s.setDirection?s.setDirection("sendonly"):s.direction="sendonly":s.direction==="recvonly"&&(s.setDirection?s.setDirection("inactive"):s.direction="inactive"):r.offerToReceiveVideo===!0&&!s&&this.addTransceiver("video",{direction:"recvonly"})}return e.apply(this,arguments)}}function FQ(n){typeof n!="object"||n.AudioContext||(n.AudioContext=n.webkitAudioContext)}var iC=Object.freeze({__proto__:null,shimAudioContext:FQ,shimCallbacksAPI:jQ,shimConstraints:LQ,shimCreateOfferLegacy:BQ,shimGetUserMedia:NQ,shimLocalStreamsAPI:DQ,shimRTCIceServerUrls:qQ,shimRemoteStreamsAPI:IQ,shimTrackEventTransceiver:UQ}),Yy={exports:{}},sC;function IU(){return sC||(sC=1,function(n){const e={};e.generateIdentifier=function(){return Math.random().toString(36).substring(2,12)},e.localCName=e.generateIdentifier(),e.splitLines=function(t){return t.trim().split(`
|
|
79
|
+
`).map(r=>r.trim())},e.splitSections=function(t){return t.split(`
|
|
80
|
+
m=`).map((i,s)=>(s>0?"m="+i:i).trim()+`\r
|
|
81
|
+
`)},e.getDescription=function(t){const r=e.splitSections(t);return r&&r[0]},e.getMediaSections=function(t){const r=e.splitSections(t);return r.shift(),r},e.matchPrefix=function(t,r){return e.splitLines(t).filter(i=>i.indexOf(r)===0)},e.parseCandidate=function(t){let r;t.indexOf("a=candidate:")===0?r=t.substring(12).split(" "):r=t.substring(10).split(" ");const i={foundation:r[0],component:{1:"rtp",2:"rtcp"}[r[1]]||r[1],protocol:r[2].toLowerCase(),priority:parseInt(r[3],10),ip:r[4],address:r[4],port:parseInt(r[5],10),type:r[7]};for(let s=8;s<r.length;s+=2)switch(r[s]){case"raddr":i.relatedAddress=r[s+1];break;case"rport":i.relatedPort=parseInt(r[s+1],10);break;case"tcptype":i.tcpType=r[s+1];break;case"ufrag":i.ufrag=r[s+1],i.usernameFragment=r[s+1];break;default:i[r[s]]===void 0&&(i[r[s]]=r[s+1]);break}return i},e.writeCandidate=function(t){const r=[];r.push(t.foundation);const i=t.component;i==="rtp"?r.push(1):i==="rtcp"?r.push(2):r.push(i),r.push(t.protocol.toUpperCase()),r.push(t.priority),r.push(t.address||t.ip),r.push(t.port);const s=t.type;return r.push("typ"),r.push(s),s!=="host"&&t.relatedAddress&&t.relatedPort&&(r.push("raddr"),r.push(t.relatedAddress),r.push("rport"),r.push(t.relatedPort)),t.tcpType&&t.protocol.toLowerCase()==="tcp"&&(r.push("tcptype"),r.push(t.tcpType)),(t.usernameFragment||t.ufrag)&&(r.push("ufrag"),r.push(t.usernameFragment||t.ufrag)),"candidate:"+r.join(" ")},e.parseIceOptions=function(t){return t.substring(14).split(" ")},e.parseRtpMap=function(t){let r=t.substring(9).split(" ");const i={payloadType:parseInt(r.shift(),10)};return r=r[0].split("/"),i.name=r[0],i.clockRate=parseInt(r[1],10),i.channels=r.length===3?parseInt(r[2],10):1,i.numChannels=i.channels,i},e.writeRtpMap=function(t){let r=t.payloadType;t.preferredPayloadType!==void 0&&(r=t.preferredPayloadType);const i=t.channels||t.numChannels||1;return"a=rtpmap:"+r+" "+t.name+"/"+t.clockRate+(i!==1?"/"+i:"")+`\r
|
|
82
|
+
`},e.parseExtmap=function(t){const r=t.substring(9).split(" ");return{id:parseInt(r[0],10),direction:r[0].indexOf("/")>0?r[0].split("/")[1]:"sendrecv",uri:r[1],attributes:r.slice(2).join(" ")}},e.writeExtmap=function(t){return"a=extmap:"+(t.id||t.preferredId)+(t.direction&&t.direction!=="sendrecv"?"/"+t.direction:"")+" "+t.uri+(t.attributes?" "+t.attributes:"")+`\r
|
|
83
|
+
`},e.parseFmtp=function(t){const r={};let i;const s=t.substring(t.indexOf(" ")+1).split(";");for(let o=0;o<s.length;o++)i=s[o].trim().split("="),r[i[0].trim()]=i[1];return r},e.writeFmtp=function(t){let r="",i=t.payloadType;if(t.preferredPayloadType!==void 0&&(i=t.preferredPayloadType),t.parameters&&Object.keys(t.parameters).length){const s=[];Object.keys(t.parameters).forEach(o=>{t.parameters[o]!==void 0?s.push(o+"="+t.parameters[o]):s.push(o)}),r+="a=fmtp:"+i+" "+s.join(";")+`\r
|
|
84
|
+
`}return r},e.parseRtcpFb=function(t){const r=t.substring(t.indexOf(" ")+1).split(" ");return{type:r.shift(),parameter:r.join(" ")}},e.writeRtcpFb=function(t){let r="",i=t.payloadType;return t.preferredPayloadType!==void 0&&(i=t.preferredPayloadType),t.rtcpFeedback&&t.rtcpFeedback.length&&t.rtcpFeedback.forEach(s=>{r+="a=rtcp-fb:"+i+" "+s.type+(s.parameter&&s.parameter.length?" "+s.parameter:"")+`\r
|
|
85
|
+
`}),r},e.parseSsrcMedia=function(t){const r=t.indexOf(" "),i={ssrc:parseInt(t.substring(7,r),10)},s=t.indexOf(":",r);return s>-1?(i.attribute=t.substring(r+1,s),i.value=t.substring(s+1)):i.attribute=t.substring(r+1),i},e.parseSsrcGroup=function(t){const r=t.substring(13).split(" ");return{semantics:r.shift(),ssrcs:r.map(i=>parseInt(i,10))}},e.getMid=function(t){const r=e.matchPrefix(t,"a=mid:")[0];if(r)return r.substring(6)},e.parseFingerprint=function(t){const r=t.substring(14).split(" ");return{algorithm:r[0].toLowerCase(),value:r[1].toUpperCase()}},e.getDtlsParameters=function(t,r){return{role:"auto",fingerprints:e.matchPrefix(t+r,"a=fingerprint:").map(e.parseFingerprint)}},e.writeDtlsParameters=function(t,r){let i="a=setup:"+r+`\r
|
|
86
|
+
`;return t.fingerprints.forEach(s=>{i+="a=fingerprint:"+s.algorithm+" "+s.value+`\r
|
|
87
|
+
`}),i},e.parseCryptoLine=function(t){const r=t.substring(9).split(" ");return{tag:parseInt(r[0],10),cryptoSuite:r[1],keyParams:r[2],sessionParams:r.slice(3)}},e.writeCryptoLine=function(t){return"a=crypto:"+t.tag+" "+t.cryptoSuite+" "+(typeof t.keyParams=="object"?e.writeCryptoKeyParams(t.keyParams):t.keyParams)+(t.sessionParams?" "+t.sessionParams.join(" "):"")+`\r
|
|
88
|
+
`},e.parseCryptoKeyParams=function(t){if(t.indexOf("inline:")!==0)return null;const r=t.substring(7).split("|");return{keyMethod:"inline",keySalt:r[0],lifeTime:r[1],mkiValue:r[2]?r[2].split(":")[0]:void 0,mkiLength:r[2]?r[2].split(":")[1]:void 0}},e.writeCryptoKeyParams=function(t){return t.keyMethod+":"+t.keySalt+(t.lifeTime?"|"+t.lifeTime:"")+(t.mkiValue&&t.mkiLength?"|"+t.mkiValue+":"+t.mkiLength:"")},e.getCryptoParameters=function(t,r){return e.matchPrefix(t+r,"a=crypto:").map(e.parseCryptoLine)},e.getIceParameters=function(t,r){const i=e.matchPrefix(t+r,"a=ice-ufrag:")[0],s=e.matchPrefix(t+r,"a=ice-pwd:")[0];return i&&s?{usernameFragment:i.substring(12),password:s.substring(10)}:null},e.writeIceParameters=function(t){let r="a=ice-ufrag:"+t.usernameFragment+`\r
|
|
89
|
+
a=ice-pwd:`+t.password+`\r
|
|
90
|
+
`;return t.iceLite&&(r+=`a=ice-lite\r
|
|
91
|
+
`),r},e.parseRtpParameters=function(t){const r={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},s=e.splitLines(t)[0].split(" ");r.profile=s[2];for(let a=3;a<s.length;a++){const l=s[a],c=e.matchPrefix(t,"a=rtpmap:"+l+" ")[0];if(c){const u=e.parseRtpMap(c),d=e.matchPrefix(t,"a=fmtp:"+l+" ");switch(u.parameters=d.length?e.parseFmtp(d[0]):{},u.rtcpFeedback=e.matchPrefix(t,"a=rtcp-fb:"+l+" ").map(e.parseRtcpFb),r.codecs.push(u),u.name.toUpperCase()){case"RED":case"ULPFEC":r.fecMechanisms.push(u.name.toUpperCase());break}}}e.matchPrefix(t,"a=extmap:").forEach(a=>{r.headerExtensions.push(e.parseExtmap(a))});const o=e.matchPrefix(t,"a=rtcp-fb:* ").map(e.parseRtcpFb);return r.codecs.forEach(a=>{o.forEach(l=>{a.rtcpFeedback.find(u=>u.type===l.type&&u.parameter===l.parameter)||a.rtcpFeedback.push(l)})}),r},e.writeRtpDescription=function(t,r){let i="";i+="m="+t+" ",i+=r.codecs.length>0?"9":"0",i+=" "+(r.profile||"UDP/TLS/RTP/SAVPF")+" ",i+=r.codecs.map(o=>o.preferredPayloadType!==void 0?o.preferredPayloadType:o.payloadType).join(" ")+`\r
|
|
92
|
+
`,i+=`c=IN IP4 0.0.0.0\r
|
|
93
|
+
`,i+=`a=rtcp:9 IN IP4 0.0.0.0\r
|
|
94
|
+
`,r.codecs.forEach(o=>{i+=e.writeRtpMap(o),i+=e.writeFmtp(o),i+=e.writeRtcpFb(o)});let s=0;return r.codecs.forEach(o=>{o.maxptime>s&&(s=o.maxptime)}),s>0&&(i+="a=maxptime:"+s+`\r
|
|
95
|
+
`),r.headerExtensions&&r.headerExtensions.forEach(o=>{i+=e.writeExtmap(o)}),i},e.parseRtpEncodingParameters=function(t){const r=[],i=e.parseRtpParameters(t),s=i.fecMechanisms.indexOf("RED")!==-1,o=i.fecMechanisms.indexOf("ULPFEC")!==-1,a=e.matchPrefix(t,"a=ssrc:").map(h=>e.parseSsrcMedia(h)).filter(h=>h.attribute==="cname"),l=a.length>0&&a[0].ssrc;let c;const u=e.matchPrefix(t,"a=ssrc-group:FID").map(h=>h.substring(17).split(" ").map(g=>parseInt(g,10)));u.length>0&&u[0].length>1&&u[0][0]===l&&(c=u[0][1]),i.codecs.forEach(h=>{if(h.name.toUpperCase()==="RTX"&&h.parameters.apt){let m={ssrc:l,codecPayloadType:parseInt(h.parameters.apt,10)};l&&c&&(m.rtx={ssrc:c}),r.push(m),s&&(m=JSON.parse(JSON.stringify(m)),m.fec={ssrc:l,mechanism:o?"red+ulpfec":"red"},r.push(m))}}),r.length===0&&l&&r.push({ssrc:l});let d=e.matchPrefix(t,"b=");return d.length&&(d[0].indexOf("b=TIAS:")===0?d=parseInt(d[0].substring(7),10):d[0].indexOf("b=AS:")===0?d=parseInt(d[0].substring(5),10)*1e3*.95-50*40*8:d=void 0,r.forEach(h=>{h.maxBitrate=d})),r},e.parseRtcpParameters=function(t){const r={},i=e.matchPrefix(t,"a=ssrc:").map(a=>e.parseSsrcMedia(a)).filter(a=>a.attribute==="cname")[0];i&&(r.cname=i.value,r.ssrc=i.ssrc);const s=e.matchPrefix(t,"a=rtcp-rsize");r.reducedSize=s.length>0,r.compound=s.length===0;const o=e.matchPrefix(t,"a=rtcp-mux");return r.mux=o.length>0,r},e.writeRtcpParameters=function(t){let r="";return t.reducedSize&&(r+=`a=rtcp-rsize\r
|
|
96
|
+
`),t.mux&&(r+=`a=rtcp-mux\r
|
|
97
|
+
`),t.ssrc!==void 0&&t.cname&&(r+="a=ssrc:"+t.ssrc+" cname:"+t.cname+`\r
|
|
98
|
+
`),r},e.parseMsid=function(t){let r;const i=e.matchPrefix(t,"a=msid:");if(i.length===1)return r=i[0].substring(7).split(" "),{stream:r[0],track:r[1]};const s=e.matchPrefix(t,"a=ssrc:").map(o=>e.parseSsrcMedia(o)).filter(o=>o.attribute==="msid");if(s.length>0)return r=s[0].value.split(" "),{stream:r[0],track:r[1]}},e.parseSctpDescription=function(t){const r=e.parseMLine(t),i=e.matchPrefix(t,"a=max-message-size:");let s;i.length>0&&(s=parseInt(i[0].substring(19),10)),isNaN(s)&&(s=65536);const o=e.matchPrefix(t,"a=sctp-port:");if(o.length>0)return{port:parseInt(o[0].substring(12),10),protocol:r.fmt,maxMessageSize:s};const a=e.matchPrefix(t,"a=sctpmap:");if(a.length>0){const l=a[0].substring(10).split(" ");return{port:parseInt(l[0],10),protocol:l[1],maxMessageSize:s}}},e.writeSctpDescription=function(t,r){let i=[];return t.protocol!=="DTLS/SCTP"?i=["m="+t.kind+" 9 "+t.protocol+" "+r.protocol+`\r
|
|
99
|
+
`,`c=IN IP4 0.0.0.0\r
|
|
100
|
+
`,"a=sctp-port:"+r.port+`\r
|
|
101
|
+
`]:i=["m="+t.kind+" 9 "+t.protocol+" "+r.port+`\r
|
|
102
|
+
`,`c=IN IP4 0.0.0.0\r
|
|
103
|
+
`,"a=sctpmap:"+r.port+" "+r.protocol+` 65535\r
|
|
104
|
+
`],r.maxMessageSize!==void 0&&i.push("a=max-message-size:"+r.maxMessageSize+`\r
|
|
105
|
+
`),i.join("")},e.generateSessionId=function(){return Math.random().toString().substr(2,22)},e.writeSessionBoilerplate=function(t,r,i){let s;const o=r!==void 0?r:2;return t?s=t:s=e.generateSessionId(),`v=0\r
|
|
106
|
+
o=`+(i||"thisisadapterortc")+" "+s+" "+o+` IN IP4 127.0.0.1\r
|
|
107
|
+
s=-\r
|
|
108
|
+
t=0 0\r
|
|
109
|
+
`},e.getDirection=function(t,r){const i=e.splitLines(t);for(let s=0;s<i.length;s++)switch(i[s]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return i[s].substring(2)}return r?e.getDirection(r):"sendrecv"},e.getKind=function(t){return e.splitLines(t)[0].split(" ")[0].substring(2)},e.isRejected=function(t){return t.split(" ",2)[1]==="0"},e.parseMLine=function(t){const i=e.splitLines(t)[0].substring(2).split(" ");return{kind:i[0],port:parseInt(i[1],10),protocol:i[2],fmt:i.slice(3).join(" ")}},e.parseOLine=function(t){const i=e.matchPrefix(t,"o=")[0].substring(2).split(" ");return{username:i[0],sessionId:i[1],sessionVersion:parseInt(i[2],10),netType:i[3],addressType:i[4],address:i[5]}},e.isValidSDP=function(t){if(typeof t!="string"||t.length===0)return!1;const r=e.splitLines(t);for(let i=0;i<r.length;i++)if(r[i].length<2||r[i].charAt(1)!=="=")return!1;return!0},n.exports=e}(Yy)),Yy.exports}var VQ=IU(),Ru=PU(VQ),jU=Hq({__proto__:null,default:Ru},[VQ]);function mg(n){if(!n.RTCIceCandidate||n.RTCIceCandidate&&"foundation"in n.RTCIceCandidate.prototype)return;const e=n.RTCIceCandidate;n.RTCIceCandidate=function(r){if(typeof r=="object"&&r.candidate&&r.candidate.indexOf("a=")===0&&(r=JSON.parse(JSON.stringify(r)),r.candidate=r.candidate.substring(2)),r.candidate&&r.candidate.length){const i=new e(r),s=Ru.parseCandidate(r.candidate);for(const o in s)o in i||Object.defineProperty(i,o,{value:s[o]});return i.toJSON=function(){return{candidate:i.candidate,sdpMid:i.sdpMid,sdpMLineIndex:i.sdpMLineIndex,usernameFragment:i.usernameFragment}},i}return new e(r)},n.RTCIceCandidate.prototype=e.prototype,Ac(n,"icecandidate",t=>(t.candidate&&Object.defineProperty(t,"candidate",{value:new n.RTCIceCandidate(t.candidate),writable:"false"}),t))}function IS(n){!n.RTCIceCandidate||n.RTCIceCandidate&&"relayProtocol"in n.RTCIceCandidate.prototype||Ac(n,"icecandidate",e=>{if(e.candidate){const t=Ru.parseCandidate(e.candidate.candidate);t.type==="relay"&&(e.candidate.relayProtocol={0:"tls",1:"tcp",2:"udp"}[t.priority>>24])}return e})}function gg(n,e){if(!n.RTCPeerConnection)return;"sctp"in n.RTCPeerConnection.prototype||Object.defineProperty(n.RTCPeerConnection.prototype,"sctp",{get(){return typeof this._sctp>"u"?null:this._sctp}});const t=function(a){if(!a||!a.sdp)return!1;const l=Ru.splitSections(a.sdp);return l.shift(),l.some(c=>{const u=Ru.parseMLine(c);return u&&u.kind==="application"&&u.protocol.indexOf("SCTP")!==-1})},r=function(a){const l=a.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(l===null||l.length<2)return-1;const c=parseInt(l[1],10);return c!==c?-1:c},i=function(a){let l=65536;return e.browser==="firefox"&&(e.version<57?a===-1?l=16384:l=2147483637:e.version<60?l=e.version===57?65535:65536:l=2147483637),l},s=function(a,l){let c=65536;e.browser==="firefox"&&e.version===57&&(c=65535);const u=Ru.matchPrefix(a.sdp,"a=max-message-size:");return u.length>0?c=parseInt(u[0].substring(19),10):e.browser==="firefox"&&l!==-1&&(c=2147483637),c},o=n.RTCPeerConnection.prototype.setRemoteDescription;n.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,e.browser==="chrome"&&e.version>=76){const{sdpSemantics:l}=this.getConfiguration();l==="plan-b"&&Object.defineProperty(this,"sctp",{get(){return typeof this._sctp>"u"?null:this._sctp},enumerable:!0,configurable:!0})}if(t(arguments[0])){const l=r(arguments[0]),c=i(l),u=s(arguments[0],l);let d;c===0&&u===0?d=Number.POSITIVE_INFINITY:c===0||u===0?d=Math.max(c,u):d=Math.min(c,u);const h={};Object.defineProperty(h,"maxMessageSize",{get(){return d}}),this._sctp=h}return o.apply(this,arguments)}}function Og(n){if(!(n.RTCPeerConnection&&"createDataChannel"in n.RTCPeerConnection.prototype))return;function e(r,i){const s=r.send;r.send=function(){const a=arguments[0],l=a.length||a.size||a.byteLength;if(r.readyState==="open"&&i.sctp&&l>i.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+i.sctp.maxMessageSize+" bytes)");return s.apply(r,arguments)}}const t=n.RTCPeerConnection.prototype.createDataChannel;n.RTCPeerConnection.prototype.createDataChannel=function(){const i=t.apply(this,arguments);return e(i,this),i},Ac(n,"datachannel",r=>(e(r.channel,r.target),r))}function jS(n){if(!n.RTCPeerConnection||"connectionState"in n.RTCPeerConnection.prototype)return;const e=n.RTCPeerConnection.prototype;Object.defineProperty(e,"connectionState",{get(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(e,"onconnectionstatechange",{get(){return this._onconnectionstatechange||null},set(t){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),t&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=t)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach(t=>{const r=e[t];e[t]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=i=>{const s=i.target;if(s._lastConnectionState!==s.connectionState){s._lastConnectionState=s.connectionState;const o=new Event("connectionstatechange",i);s.dispatchEvent(o)}return i},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),r.apply(this,arguments)}})}function NS(n,e){if(!n.RTCPeerConnection||e.browser==="chrome"&&e.version>=71||e.browser==="safari"&&e.version>=605)return;const t=n.RTCPeerConnection.prototype.setRemoteDescription;n.RTCPeerConnection.prototype.setRemoteDescription=function(i){if(i&&i.sdp&&i.sdp.indexOf(`
|
|
110
|
+
a=extmap-allow-mixed`)!==-1){const s=i.sdp.split(`
|
|
111
|
+
`).filter(o=>o.trim()!=="a=extmap-allow-mixed").join(`
|
|
112
|
+
`);n.RTCSessionDescription&&i instanceof n.RTCSessionDescription?arguments[0]=new n.RTCSessionDescription({type:i.type,sdp:s}):i.sdp=s}return t.apply(this,arguments)}}function vg(n,e){if(!(n.RTCPeerConnection&&n.RTCPeerConnection.prototype))return;const t=n.RTCPeerConnection.prototype.addIceCandidate;!t||t.length===0||(n.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?(e.browser==="chrome"&&e.version<78||e.browser==="firefox"&&e.version<68||e.browser==="safari")&&arguments[0]&&arguments[0].candidate===""?Promise.resolve():t.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())})}function yg(n,e){if(!(n.RTCPeerConnection&&n.RTCPeerConnection.prototype))return;const t=n.RTCPeerConnection.prototype.setLocalDescription;!t||t.length===0||(n.RTCPeerConnection.prototype.setLocalDescription=function(){let i=arguments[0]||{};if(typeof i!="object"||i.type&&i.sdp)return t.apply(this,arguments);if(i={type:i.type,sdp:i.sdp},!i.type)switch(this.signalingState){case"stable":case"have-local-offer":case"have-remote-pranswer":i.type="offer";break;default:i.type="answer";break}return i.sdp||i.type!=="offer"&&i.type!=="answer"?t.apply(this,[i]):(i.type==="offer"?this.createOffer:this.createAnswer).apply(this).then(o=>t.apply(this,[o]))})}var NU=Object.freeze({__proto__:null,removeExtmapAllowMixed:NS,shimAddIceCandidateNullOrEmpty:vg,shimConnectionState:jS,shimMaxMessageSize:gg,shimParameterlessSetLocalDescription:yg,shimRTCIceCandidate:mg,shimRTCIceCandidateRelayProtocol:IS,shimSendThrowTypeError:Og});function LU(){let{window:n}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{shimChrome:!0,shimFirefox:!0,shimSafari:!0};const t=mQ,r=QU(n),i={browserDetails:r,commonShim:NU,extractVersion:pg,disableLog:$U,disableWarnings:MU,sdp:jU};switch(r.browser){case"chrome":if(!nC||!QS||!e.shimChrome)return t("Chrome shim is not included in this adapter release."),i;if(r.version===null)return t("Chrome shim can not determine version, not shimming."),i;t("adapter.js shimming chrome."),i.browserShim=nC,vg(n,r),yg(n),OQ(n,r),vQ(n),QS(n,r),yQ(n),kQ(n,r),bQ(n),SQ(n),PQ(n,r),mg(n),IS(n),jS(n),gg(n,r),Og(n),NS(n,r);break;case"firefox":if(!rC||!DS||!e.shimFirefox)return t("Firefox shim is not included in this adapter release."),i;t("adapter.js shimming firefox."),i.browserShim=rC,vg(n,r),yg(n),xQ(n,r),DS(n,r),TQ(n),EQ(n),CQ(n),_Q(n),RQ(n),AQ(n),$Q(n),MQ(n),QQ(n),mg(n),jS(n),gg(n,r),Og(n);break;case"safari":if(!iC||!e.shimSafari)return t("Safari shim is not included in this adapter release."),i;t("adapter.js shimming safari."),i.browserShim=iC,vg(n,r),yg(n),qQ(n),BQ(n),jQ(n),DQ(n),IQ(n),UQ(n),NQ(n),FQ(n),mg(n),IS(n),gg(n,r),Og(n),NS(n,r);break;default:t("Unsupported browser!");break}return i}LU({window:typeof window>"u"?void 0:window});const qU=10,Tp="lk_e2ee",UU="LKFrameEncryptionKey",BU={sharedKey:!1,ratchetSalt:UU,ratchetWindowSize:8,failureTolerance:qU,keyringSize:16};var bl;(function(n){n.SetKey="setKey",n.RatchetRequest="ratchetRequest",n.KeyRatcheted="keyRatcheted"})(bl||(bl={}));var oC;(function(n){n.KeyRatcheted="keyRatcheted"})(oC||(oC={}));var pl;(function(n){n.ParticipantEncryptionStatusChanged="participantEncryptionStatusChanged",n.EncryptionError="encryptionError"})(pl||(pl={}));var aC;(function(n){n.Error="cryptorError"})(aC||(aC={}));function FU(){return VU()||LS()}function LS(){return typeof window.RTCRtpScriptTransform<"u"}function VU(){return typeof window.RTCRtpSender<"u"&&typeof window.RTCRtpSender.prototype.createEncodedStreams<"u"}class Eoe extends Yo.EventEmitter{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};super(),this.onKeyRatcheted=(t,r)=>{kn.debug("key ratcheted event received",{material:t,keyIndex:r})},this.keyInfoMap=new Map,this.options=Object.assign(Object.assign({},BU),e),this.on(bl.KeyRatcheted,this.onKeyRatcheted)}onSetEncryptionKey(e,t,r){const i={key:e,participantIdentity:t,keyIndex:r};if(!this.options.sharedKey&&!t)throw new Error("participant identity needs to be passed for encryption key if sharedKey option is false");this.keyInfoMap.set("".concat(t??"shared","-").concat(r??0),i),this.emit(bl.SetKey,i)}getKeys(){return Array.from(this.keyInfoMap.values())}getOptions(){return this.options}ratchetKey(e,t){this.emit(bl.RatchetRequest,e,t)}}class Ml extends Error{constructor(e,t){super(t||"an error has occured"),this.name="LiveKitError",this.code=e}}var _n;(function(n){n[n.NotAllowed=0]="NotAllowed",n[n.ServerUnreachable=1]="ServerUnreachable",n[n.InternalError=2]="InternalError",n[n.Cancelled=3]="Cancelled",n[n.LeaveRequest=4]="LeaveRequest"})(_n||(_n={}));class Jn extends Ml{constructor(e,t,r,i){super(1,e),this.name="ConnectionError",this.status=r,this.reason=t,this.context=i,this.reasonName=_n[t]}}class Aw extends Ml{constructor(e){super(21,e??"device is unsupported"),this.name="DeviceUnsupportedError"}}class va extends Ml{constructor(e){super(20,e??"track is invalid"),this.name="TrackInvalidError"}}class ZU extends Ml{constructor(e){super(10,e??"unsupported server"),this.name="UnsupportedServer"}}class Gr extends Ml{constructor(e){super(12,e??"unexpected connection state"),this.name="UnexpectedConnectionState"}}class qS extends Ml{constructor(e){super(13,e??"unable to negotiate"),this.name="NegotiationError"}}class WU extends Ml{constructor(e,t){super(15,e),this.name="PublishTrackError",this.status=t}}class lC extends Ml{constructor(e,t){super(15,e),this.reason=t,this.reasonName=typeof t=="string"?t:Ew[t]}}var Ld;(function(n){n.PermissionDenied="PermissionDenied",n.NotFound="NotFound",n.DeviceInUse="DeviceInUse",n.Other="Other"})(Ld||(Ld={}));(function(n){function e(t){if(t&&"name"in t)return t.name==="NotFoundError"||t.name==="DevicesNotFoundError"?n.NotFound:t.name==="NotAllowedError"||t.name==="PermissionDeniedError"?n.PermissionDenied:t.name==="NotReadableError"||t.name==="TrackStartError"?n.DeviceInUse:n.Other}n.getFailure=e})(Ld||(Ld={}));var cC;(function(n){n[n.InvalidKey=0]="InvalidKey",n[n.MissingKey=1]="MissingKey",n[n.InternalError=2]="InternalError"})(cC||(cC={}));var Ce;(function(n){n.Connected="connected",n.Reconnecting="reconnecting",n.SignalReconnecting="signalReconnecting",n.Reconnected="reconnected",n.Disconnected="disconnected",n.ConnectionStateChanged="connectionStateChanged",n.MediaDevicesChanged="mediaDevicesChanged",n.ParticipantConnected="participantConnected",n.ParticipantDisconnected="participantDisconnected",n.TrackPublished="trackPublished",n.TrackSubscribed="trackSubscribed",n.TrackSubscriptionFailed="trackSubscriptionFailed",n.TrackUnpublished="trackUnpublished",n.TrackUnsubscribed="trackUnsubscribed",n.TrackMuted="trackMuted",n.TrackUnmuted="trackUnmuted",n.LocalTrackPublished="localTrackPublished",n.LocalTrackUnpublished="localTrackUnpublished",n.LocalAudioSilenceDetected="localAudioSilenceDetected",n.ActiveSpeakersChanged="activeSpeakersChanged",n.ParticipantMetadataChanged="participantMetadataChanged",n.ParticipantNameChanged="participantNameChanged",n.ParticipantAttributesChanged="participantAttributesChanged",n.RoomMetadataChanged="roomMetadataChanged",n.DataReceived="dataReceived",n.SipDTMFReceived="sipDTMFReceived",n.TranscriptionReceived="transcriptionReceived",n.ConnectionQualityChanged="connectionQualityChanged",n.TrackStreamStateChanged="trackStreamStateChanged",n.TrackSubscriptionPermissionChanged="trackSubscriptionPermissionChanged",n.TrackSubscriptionStatusChanged="trackSubscriptionStatusChanged",n.AudioPlaybackStatusChanged="audioPlaybackChanged",n.VideoPlaybackStatusChanged="videoPlaybackChanged",n.MediaDevicesError="mediaDevicesError",n.ParticipantPermissionsChanged="participantPermissionsChanged",n.SignalConnected="signalConnected",n.RecordingStatusChanged="recordingStatusChanged",n.ParticipantEncryptionStatusChanged="participantEncryptionStatusChanged",n.EncryptionError="encryptionError",n.DCBufferStatusChanged="dcBufferStatusChanged",n.ActiveDeviceChanged="activeDeviceChanged",n.ChatMessage="chatMessage",n.LocalTrackSubscribed="localTrackSubscribed",n.MetricsReceived="metricsReceived"})(Ce||(Ce={}));var Ne;(function(n){n.TrackPublished="trackPublished",n.TrackSubscribed="trackSubscribed",n.TrackSubscriptionFailed="trackSubscriptionFailed",n.TrackUnpublished="trackUnpublished",n.TrackUnsubscribed="trackUnsubscribed",n.TrackMuted="trackMuted",n.TrackUnmuted="trackUnmuted",n.LocalTrackPublished="localTrackPublished",n.LocalTrackUnpublished="localTrackUnpublished",n.ParticipantMetadataChanged="participantMetadataChanged",n.ParticipantNameChanged="participantNameChanged",n.DataReceived="dataReceived",n.SipDTMFReceived="sipDTMFReceived",n.TranscriptionReceived="transcriptionReceived",n.IsSpeakingChanged="isSpeakingChanged",n.ConnectionQualityChanged="connectionQualityChanged",n.TrackStreamStateChanged="trackStreamStateChanged",n.TrackSubscriptionPermissionChanged="trackSubscriptionPermissionChanged",n.TrackSubscriptionStatusChanged="trackSubscriptionStatusChanged",n.MediaDevicesError="mediaDevicesError",n.AudioStreamAcquired="audioStreamAcquired",n.ParticipantPermissionsChanged="participantPermissionsChanged",n.PCTrackAdded="pcTrackAdded",n.AttributesChanged="attributesChanged",n.LocalTrackSubscribed="localTrackSubscribed",n.ChatMessage="chatMessage"})(Ne||(Ne={}));var lt;(function(n){n.TransportsCreated="transportsCreated",n.Connected="connected",n.Disconnected="disconnected",n.Resuming="resuming",n.Resumed="resumed",n.Restarting="restarting",n.Restarted="restarted",n.SignalResumed="signalResumed",n.SignalRestarted="signalRestarted",n.Closing="closing",n.MediaTrackAdded="mediaTrackAdded",n.ActiveSpeakersUpdate="activeSpeakersUpdate",n.DataPacketReceived="dataPacketReceived",n.RTPVideoMapUpdate="rtpVideoMapUpdate",n.DCBufferStatusChanged="dcBufferStatusChanged",n.ParticipantUpdate="participantUpdate",n.RoomUpdate="roomUpdate",n.SpeakersChanged="speakersChanged",n.StreamStateChanged="streamStateChanged",n.ConnectionQualityUpdate="connectionQualityUpdate",n.SubscriptionError="subscriptionError",n.SubscriptionPermissionUpdate="subscriptionPermissionUpdate",n.RemoteMute="remoteMute",n.SubscribedQualityUpdate="subscribedQualityUpdate",n.LocalTrackUnpublished="localTrackUnpublished",n.LocalTrackSubscribed="localTrackSubscribed",n.Offline="offline",n.SignalRequestResponse="signalRequestResponse"})(lt||(lt={}));var nt;(function(n){n.Message="message",n.Muted="muted",n.Unmuted="unmuted",n.Restarted="restarted",n.Ended="ended",n.Subscribed="subscribed",n.Unsubscribed="unsubscribed",n.UpdateSettings="updateSettings",n.UpdateSubscription="updateSubscription",n.AudioPlaybackStarted="audioPlaybackStarted",n.AudioPlaybackFailed="audioPlaybackFailed",n.AudioSilenceDetected="audioSilenceDetected",n.VisibilityChanged="visibilityChanged",n.VideoDimensionsChanged="videoDimensionsChanged",n.VideoPlaybackStarted="videoPlaybackStarted",n.VideoPlaybackFailed="videoPlaybackFailed",n.ElementAttached="elementAttached",n.ElementDetached="elementDetached",n.UpstreamPaused="upstreamPaused",n.UpstreamResumed="upstreamResumed",n.SubscriptionPermissionChanged="subscriptionPermissionChanged",n.SubscriptionStatusChanged="subscriptionStatusChanged",n.SubscriptionFailed="subscriptionFailed",n.TrackProcessorUpdate="trackProcessorUpdate",n.AudioTrackFeatureUpdate="audioTrackFeatureUpdate",n.TranscriptionReceived="transcriptionReceived",n.TimeSyncUpdate="timeSyncUpdate"})(nt||(nt={}));function XU(n){if(!(typeof n>"u"))return typeof structuredClone=="function"?structuredClone(n):JSON.parse(JSON.stringify(n))}const zU=/version\/(\d+(\.?_?\d+)+)/i;let Gy;function Wo(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(typeof navigator>"u")return;const t=navigator.userAgent.toLowerCase();if(Gy===void 0||e){const r=YU.find(i=>{let{test:s}=i;return s.test(t)});Gy=r==null?void 0:r.describe(t)}return Gy}const YU=[{test:/firefox|iceweasel|fxios/i,describe(n){return{name:"Firefox",version:bg(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,n),os:n.toLowerCase().includes("fxios")?"iOS":void 0,osVersion:Hy(n)}}},{test:/chrom|crios|crmo/i,describe(n){return{name:"Chrome",version:bg(/(?:chrome|chromium|crios|crmo)\/(\d+(\.?_?\d+)+)/i,n),os:n.toLowerCase().includes("crios")?"iOS":void 0,osVersion:Hy(n)}}},{test:/safari|applewebkit/i,describe(n){return{name:"Safari",version:bg(zU,n),os:n.includes("mobile/")?"iOS":"macOS",osVersion:Hy(n)}}}];function bg(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;const r=e.match(n);return r&&r.length>=t&&r[t]||""}function Hy(n){return n.includes("mac os")?bg(/\(.+?(\d+_\d+(:?_\d+)?)/,n,1).replace(/_/g,"."):void 0}var GU="2.9.9";const HU=GU,KU=15;class Oi{}Oi.setTimeout=function(){return setTimeout(...arguments)};Oi.setInterval=function(){return setInterval(...arguments)};Oi.clearTimeout=function(){return clearTimeout(...arguments)};Oi.clearInterval=function(){return clearInterval(...arguments)};const JU=5e3,Wf=[];var Ms;(function(n){n[n.LOW=0]="LOW",n[n.MEDIUM=1]="MEDIUM",n[n.HIGH=2]="HIGH"})(Ms||(Ms={}));class Me extends Yo.EventEmitter{constructor(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var i;super(),this.attachedElements=[],this.isMuted=!1,this.streamState=Me.StreamState.Active,this.isInBackground=!1,this._currentBitrate=0,this.log=kn,this.appVisibilityChangedListener=()=>{this.backgroundTimeout&&clearTimeout(this.backgroundTimeout),document.visibilityState==="hidden"?this.backgroundTimeout=setTimeout(()=>this.handleAppVisibilityChanged(),JU):this.handleAppVisibilityChanged()},this.log=ka((i=r.loggerName)!==null&&i!==void 0?i:uo.Track),this.loggerContextCb=r.loggerContextCb,this.setMaxListeners(100),this.kind=t,this._mediaStreamTrack=e,this._mediaStreamID=e.id,this.source=Me.Source.Unknown}get logContext(){var e;return Object.assign(Object.assign({},(e=this.loggerContextCb)===null||e===void 0?void 0:e.call(this)),Zn(this))}get currentBitrate(){return this._currentBitrate}get mediaStreamTrack(){return this._mediaStreamTrack}get mediaStreamID(){return this._mediaStreamID}attach(e){let t="audio";this.kind===Me.Kind.Video&&(t="video"),this.attachedElements.length===0&&this.kind===Me.Kind.Video&&this.addAppVisibilityListener(),e||(t==="audio"&&(Wf.forEach(s=>{s.parentElement===null&&!e&&(e=s)}),e&&Wf.splice(Wf.indexOf(e),1)),e||(e=document.createElement(t))),this.attachedElements.includes(e)||this.attachedElements.push(e),xu(this.mediaStreamTrack,e);const r=e.srcObject.getTracks(),i=r.some(s=>s.kind==="audio");return e.play().then(()=>{this.emit(i?nt.AudioPlaybackStarted:nt.VideoPlaybackStarted)}).catch(s=>{s.name==="NotAllowedError"?this.emit(i?nt.AudioPlaybackFailed:nt.VideoPlaybackFailed,s):s.name==="AbortError"?kn.debug("".concat(i?"audio":"video"," playback aborted, likely due to new play request")):kn.warn("could not playback ".concat(i?"audio":"video"),s),i&&e&&r.some(o=>o.kind==="video")&&s.name==="NotAllowedError"&&(e.muted=!0,e.play().catch(()=>{}))}),this.emit(nt.ElementAttached,e),e}detach(e){try{if(e){Au(this.mediaStreamTrack,e);const r=this.attachedElements.indexOf(e);return r>=0&&(this.attachedElements.splice(r,1),this.recycleElement(e),this.emit(nt.ElementDetached,e)),e}const t=[];return this.attachedElements.forEach(r=>{Au(this.mediaStreamTrack,r),t.push(r),this.recycleElement(r),this.emit(nt.ElementDetached,r)}),this.attachedElements=[],t}finally{this.attachedElements.length===0&&this.removeAppVisibilityListener()}}stop(){this.stopMonitor(),this._mediaStreamTrack.stop()}enable(){this._mediaStreamTrack.enabled=!0}disable(){this._mediaStreamTrack.enabled=!1}stopMonitor(){this.monitorInterval&&clearInterval(this.monitorInterval),this.timeSyncHandle&&cancelAnimationFrame(this.timeSyncHandle)}updateLoggerOptions(e){e.loggerName&&(this.log=ka(e.loggerName)),e.loggerContextCb&&(this.loggerContextCb=e.loggerContextCb)}recycleElement(e){if(e instanceof HTMLAudioElement){let t=!0;e.pause(),Wf.forEach(r=>{r.parentElement||(t=!1)}),t&&Wf.push(e)}}handleAppVisibilityChanged(){return ie(this,void 0,void 0,function*(){this.isInBackground=document.visibilityState==="hidden",!this.isInBackground&&this.kind===Me.Kind.Video&&setTimeout(()=>this.attachedElements.forEach(e=>e.play().catch(()=>{})),0)})}addAppVisibilityListener(){rs()?(this.isInBackground=document.visibilityState==="hidden",document.addEventListener("visibilitychange",this.appVisibilityChangedListener)):this.isInBackground=!1}removeAppVisibilityListener(){rs()&&document.removeEventListener("visibilitychange",this.appVisibilityChangedListener)}}function xu(n,e){let t;e.srcObject instanceof MediaStream?t=e.srcObject:t=new MediaStream;let r;n.kind==="audio"?r=t.getAudioTracks():r=t.getVideoTracks(),r.includes(n)||(r.forEach(i=>{t.removeTrack(i)}),t.addTrack(n)),(!Pl()||!(e instanceof HTMLVideoElement))&&(e.autoplay=!0),e.muted=t.getAudioTracks().length===0,e instanceof HTMLVideoElement&&(e.playsInline=!0),e.srcObject!==t&&(e.srcObject=t,(Pl()||Vu())&&e instanceof HTMLVideoElement&&setTimeout(()=>{e.srcObject=t,e.play().catch(()=>{})},0))}function Au(n,e){if(e.srcObject instanceof MediaStream){const t=e.srcObject;t.removeTrack(n),t.getTracks().length>0?e.srcObject=t:e.srcObject=null}}(function(n){let e;(function(c){c.Audio="audio",c.Video="video",c.Unknown="unknown"})(e=n.Kind||(n.Kind={}));let t;(function(c){c.Camera="camera",c.Microphone="microphone",c.ScreenShare="screen_share",c.ScreenShareAudio="screen_share_audio",c.Unknown="unknown"})(t=n.Source||(n.Source={}));let r;(function(c){c.Active="active",c.Paused="paused",c.Unknown="unknown"})(r=n.StreamState||(n.StreamState={}));function i(c){switch(c){case e.Audio:return ao.AUDIO;case e.Video:return ao.VIDEO;default:return ao.DATA}}n.kindToProto=i;function s(c){switch(c){case ao.AUDIO:return e.Audio;case ao.VIDEO:return e.Video;default:return e.Unknown}}n.kindFromProto=s;function o(c){switch(c){case t.Camera:return Br.CAMERA;case t.Microphone:return Br.MICROPHONE;case t.ScreenShare:return Br.SCREEN_SHARE;case t.ScreenShareAudio:return Br.SCREEN_SHARE_AUDIO;default:return Br.UNKNOWN}}n.sourceToProto=o;function a(c){switch(c){case Br.CAMERA:return t.Camera;case Br.MICROPHONE:return t.Microphone;case Br.SCREEN_SHARE:return t.ScreenShare;case Br.SCREEN_SHARE_AUDIO:return t.ScreenShareAudio;default:return t.Unknown}}n.sourceFromProto=a;function l(c){switch(c){case ES.ACTIVE:return r.Active;case ES.PAUSED:return r.Paused;default:return r.Unknown}}n.streamStateFromProto=l})(Me);class Wn{constructor(e,t,r,i,s){if(typeof e=="object")this.width=e.width,this.height=e.height,this.aspectRatio=e.aspectRatio,this.encoding={maxBitrate:e.maxBitrate,maxFramerate:e.maxFramerate,priority:e.priority};else if(t!==void 0&&r!==void 0)this.width=e,this.height=t,this.aspectRatio=e/t,this.encoding={maxBitrate:r,maxFramerate:i,priority:s};else throw new TypeError("Unsupported options: provide at least width, height and maxBitrate")}get resolution(){return{width:this.width,height:this.height,frameRate:this.encoding.maxFramerate,aspectRatio:this.aspectRatio}}}const eB=["vp8","h264"],tB=["vp8","h264","vp9","av1"];function nB(n){return!!eB.find(e=>e===n)}var uC;(function(n){n[n.REGRESSION=0]="REGRESSION",n[n.SIMULCAST=1]="SIMULCAST"})(uC||(uC={}));var US;(function(n){n.telephone={maxBitrate:12e3},n.speech={maxBitrate:24e3},n.music={maxBitrate:48e3},n.musicStereo={maxBitrate:64e3},n.musicHighQuality={maxBitrate:96e3},n.musicHighQualityStereo={maxBitrate:128e3}})(US||(US={}));const qd={h90:new Wn(160,90,9e4,20),h180:new Wn(320,180,16e4,20),h216:new Wn(384,216,18e4,20),h360:new Wn(640,360,45e4,20),h540:new Wn(960,540,8e5,25),h720:new Wn(1280,720,17e5,30),h1080:new Wn(1920,1080,3e6,30),h1440:new Wn(2560,1440,5e6,30),h2160:new Wn(3840,2160,8e6,30)},BS={h120:new Wn(160,120,7e4,20),h180:new Wn(240,180,125e3,20),h240:new Wn(320,240,14e4,20),h360:new Wn(480,360,33e4,20),h480:new Wn(640,480,5e5,20),h540:new Wn(720,540,6e5,25),h720:new Wn(960,720,13e5,30),h1080:new Wn(1440,1080,23e5,30),h1440:new Wn(1920,1440,38e5,30)},$w={h360fps3:new Wn(640,360,2e5,3,"medium"),h360fps15:new Wn(640,360,4e5,15,"medium"),h720fps5:new Wn(1280,720,8e5,5,"medium"),h720fps15:new Wn(1280,720,15e5,15,"medium"),h720fps30:new Wn(1280,720,2e6,30,"medium"),h1080fps15:new Wn(1920,1080,25e5,15,"medium"),h1080fps30:new Wn(1920,1080,5e6,30,"medium"),original:new Wn(0,0,7e6,30,"medium")},rB="|",fC="https://aomediacodec.github.io/av1-rtp-spec/#dependency-descriptor-rtp-header-extension";function iB(n){const e=n.split(rB);return e.length>1?[e[0],n.substr(e[0].length+1)]:[n,""]}function os(n){return ie(this,void 0,void 0,function*(){return new Promise(e=>Oi.setTimeout(e,n))})}function FS(){return"addTransceiver"in RTCPeerConnection.prototype}function VS(){return"addTrack"in RTCPeerConnection.prototype}function sB(){if(!("getCapabilities"in RTCRtpSender)||Pl())return!1;const n=RTCRtpSender.getCapabilities("video");let e=!1;if(n){for(const t of n.codecs)if(t.mimeType==="video/AV1"){e=!0;break}}return e}function oB(){if(!("getCapabilities"in RTCRtpSender)||Vu())return!1;if(Pl()){const t=Wo();if(t!=null&&t.version&&Zu(t.version,"16")<0)return!1}const n=RTCRtpSender.getCapabilities("video");let e=!1;if(n){for(const t of n.codecs)if(t.mimeType==="video/VP9"){e=!0;break}}return e}function Ed(n){return n==="av1"||n==="vp9"}function ZS(n){return document?(n||(n=document.createElement("audio")),"setSinkId"in n):!1}function aB(){return typeof RTCPeerConnection>"u"?!1:FS()||VS()}function Vu(){var n;return((n=Wo())===null||n===void 0?void 0:n.name)==="Firefox"}function Pl(){var n;return((n=Wo())===null||n===void 0?void 0:n.name)==="Safari"}function lB(){const n=Wo();return(n==null?void 0:n.name)==="Safari"&&n.version.startsWith("17.")}function ZQ(){var n,e;return rs()?(e=(n=navigator.userAgentData)===null||n===void 0?void 0:n.mobile)!==null&&e!==void 0?e:/Tablet|iPad|Mobile|Android|BlackBerry/.test(navigator.userAgent):!1}function cB(){const n=Wo(),e="17.2";if(n)return n.name!=="Safari"&&n.os!=="iOS"||n.os==="iOS"&&n.osVersion&&Zu(e,n.osVersion)>=0?!0:n.name==="Safari"&&Zu(e,n.version)>=0}function rs(){return typeof document<"u"}function Xo(){return navigator.product=="ReactNative"}function WS(n){return n.hostname.endsWith(".livekit.cloud")||n.hostname.endsWith(".livekit.run")}function WQ(){if(global&&global.LiveKitReactNativeGlobal)return global.LiveKitReactNativeGlobal}function XQ(){if(!Xo())return;let n=WQ();if(n)return n.platform}function dC(){if(rs())return window.devicePixelRatio;if(Xo()){let n=WQ();if(n)return n.devicePixelRatio}return 1}function Zu(n,e){const t=n.split("."),r=e.split("."),i=Math.min(t.length,r.length);for(let s=0;s<i;++s){const o=parseInt(t[s],10),a=parseInt(r[s],10);if(o>a)return 1;if(o<a)return-1;if(s===i-1&&o===a)return 0}return n===""&&e!==""?-1:e===""?1:t.length==r.length?0:t.length<r.length?-1:1}function uB(n){for(const e of n)e.target.handleResize(e)}function fB(n){for(const e of n)e.target.handleVisibilityChanged(e)}let Ky=null;const hC=()=>(Ky||(Ky=new ResizeObserver(uB)),Ky);let Jy=null;const pC=()=>(Jy||(Jy=new IntersectionObserver(fB,{root:null,rootMargin:"0px"})),Jy);function dB(){var n;const e=new eU({sdk:K2.JS,protocol:KU,version:HU});return Xo()&&(e.os=(n=XQ())!==null&&n!==void 0?n:""),e}function mC(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:16,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:16,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;const i=document.createElement("canvas");i.width=n,i.height=e;const s=i.getContext("2d");s==null||s.fillRect(0,0,i.width,i.height),r&&s&&(s.beginPath(),s.arc(n/2,e/2,50,0,Math.PI*2,!0),s.closePath(),s.fillStyle="grey",s.fill());const o=i.captureStream(),[a]=o.getTracks();if(!a)throw Error("Could not get empty media stream video track");return a.enabled=t,a}let Xf;function e0(){if(!Xf){const n=new AudioContext,e=n.createOscillator(),t=n.createGain();t.gain.setValueAtTime(0,0);const r=n.createMediaStreamDestination();if(e.connect(t),t.connect(r),e.start(),[Xf]=r.stream.getAudioTracks(),!Xf)throw Error("Could not get empty media stream audio track");Xf.enabled=!1}return Xf.clone()}class zQ{constructor(e,t){this.onFinally=t,this.promise=new Promise((r,i)=>ie(this,void 0,void 0,function*(){this.resolve=r,this.reject=i,e&&(yield e(r,i))})).finally(()=>{var r;return(r=this.onFinally)===null||r===void 0?void 0:r.call(this)})}}function hB(n){return tB.includes(n)}function Sl(n){if(typeof n=="string"||typeof n=="number")return n;if(Array.isArray(n))return n[0];if(n.exact)return Array.isArray(n.exact)?n.exact[0]:n.exact;if(n.ideal)return Array.isArray(n.ideal)?n.ideal[0]:n.ideal;throw Error("could not unwrap constraint")}function pB(n){return n.startsWith("http")?n.replace(/^(http)/,"ws"):n}function gC(n){return n.startsWith("ws")?n.replace(/^(ws)/,"http"):n}function mB(n,e){return n.segments.map(t=>{let{id:r,text:i,language:s,startTime:o,endTime:a,final:l}=t;var c;const u=(c=e.get(r))!==null&&c!==void 0?c:Date.now(),d=Date.now();return l?e.delete(r):e.set(r,u),{id:r,text:i,startTime:Number.parseInt(o.toString()),endTime:Number.parseInt(a.toString()),final:l,language:s,firstReceivedTime:u,lastReceivedTime:d}})}function gB(n){const{id:e,timestamp:t,message:r,editTimestamp:i}=n;return{id:e,timestamp:Number.parseInt(t.toString()),editTimestamp:i?Number.parseInt(i.toString()):void 0,message:r}}function OC(n){switch(n.reason){case _n.LeaveRequest:return n.context;case _n.Cancelled:return co.CLIENT_INITIATED;case _n.NotAllowed:return co.USER_REJECTED;case _n.ServerUnreachable:return co.JOIN_FAILURE;default:return co.UNKNOWN_REASON}}function Sg(n){return n!==void 0?Number(n):void 0}function lc(n){return n!==void 0?BigInt(n):void 0}function $u(n){return!!n&&!(n instanceof MediaStreamTrack)&&n.isLocal}function Pa(n){return!!n&&n.kind==Me.Kind.Audio}function lf(n){return!!n&&n.kind==Me.Kind.Video}function el(n){return $u(n)&&lf(n)}function cc(n){return $u(n)&&Pa(n)}function XS(n){return!!n&&!n.isLocal}function OB(n){return!!n&&!n.isLocal}function t0(n){return XS(n)&&lf(n)}function vB(n){return n.isLocal}function yB(n,e){const t=[];let r=new TextEncoder().encode(n);for(;r.length>e;){let i=e;for(;i>0;){const s=r[i];if(s!==void 0&&(s&192)!==128)break;i--}t.push(r.slice(0,i)),r=r.slice(i)}return r.length>0&&t.push(r),t}function YQ(n,e,t){var r,i,s,o,a;const{optionsWithoutProcessor:l,audioProcessor:c,videoProcessor:u}=Mw(n??{}),d=e==null?void 0:e.processor,h=t==null?void 0:t.processor,m=(r=XU(l))!==null&&r!==void 0?r:{};return m.audio===!0&&(m.audio={}),m.video===!0&&(m.video={}),m.audio&&(zS(m.audio,e),(i=(o=m.audio).deviceId)!==null&&i!==void 0||(o.deviceId="default"),(c||d)&&(m.audio.processor=c??d)),m.video&&(zS(m.video,t),(s=(a=m.video).deviceId)!==null&&s!==void 0||(a.deviceId="default"),(u||h)&&(m.video.processor=u??h)),m}function zS(n,e){return Object.keys(e).forEach(t=>{n[t]===void 0&&(n[t]=e[t])}),n}function UO(n){var e,t,r,i;const s={};if(n.video)if(typeof n.video=="object"){const o={},a=o,l=n.video;Object.keys(l).forEach(c=>{switch(c){case"resolution":zS(a,l.resolution);break;default:a[c]=l[c]}}),s.video=o,(e=(r=s.video).deviceId)!==null&&e!==void 0||(r.deviceId="default")}else s.video=n.video?{deviceId:"default"}:!1;else s.video=!1;return n.audio?typeof n.audio=="object"?(s.audio=n.audio,(t=(i=s.audio).deviceId)!==null&&t!==void 0||(i.deviceId="default")):s.audio={deviceId:"default"}:s.audio=!1,s}function GQ(n){return ie(this,arguments,void 0,function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:200;return function*(){const r=HQ();if(r){const i=r.createAnalyser();i.fftSize=2048;const s=i.frequencyBinCount,o=new Uint8Array(s);r.createMediaStreamSource(new MediaStream([e.mediaStreamTrack])).connect(i),yield os(t),i.getByteTimeDomainData(o);const l=o.some(c=>c!==128&&c!==0);return r.close(),!l}return!1}()})}function HQ(){var n;const e=typeof window<"u"&&(window.AudioContext||window.webkitAudioContext);if(e){const t=new e({latencyHint:"interactive"});if(t.state==="suspended"&&typeof window<"u"&&(!((n=window.document)===null||n===void 0)&&n.body)){const r=()=>ie(this,void 0,void 0,function*(){var i;try{t.state==="suspended"&&(yield t.resume())}catch(s){console.warn("Error trying to auto-resume audio context",s)}(i=window.document.body)===null||i===void 0||i.removeEventListener("click",r)});window.document.body.addEventListener("click",r)}return t}}function vC(n){return n===Me.Source.Microphone?"audioinput":n===Me.Source.Camera?"videoinput":void 0}function bB(n){var e,t;let r=(e=n.video)!==null&&e!==void 0?e:!0;return n.resolution&&n.resolution.width>0&&n.resolution.height>0&&(r=typeof r=="boolean"?{}:r,Pl()?r=Object.assign(Object.assign({},r),{width:{max:n.resolution.width},height:{max:n.resolution.height},frameRate:n.resolution.frameRate}):r=Object.assign(Object.assign({},r),{width:{ideal:n.resolution.width},height:{ideal:n.resolution.height},frameRate:n.resolution.frameRate})),{audio:(t=n.audio)!==null&&t!==void 0?t:!1,video:r,controller:n.controller,selfBrowserSurface:n.selfBrowserSurface,surfaceSwitching:n.surfaceSwitching,systemAudio:n.systemAudio,preferCurrentTab:n.preferCurrentTab}}function wg(n){return n.split("/")[1].toLowerCase()}function SB(n){const e=[];return n.forEach(t=>{t.track!==void 0&&e.push(new Cw({cid:t.track.mediaStreamID,track:t.trackInfo}))}),e}function Zn(n){return"mediaStreamTrack"in n?{trackID:n.sid,source:n.source,muted:n.isMuted,enabled:n.mediaStreamTrack.enabled,kind:n.kind,streamID:n.mediaStreamID,streamTrackID:n.mediaStreamTrack.id}:{trackID:n.trackSid,enabled:n.isEnabled,muted:n.isMuted,trackInfo:Object.assign({mimeType:n.mimeType,name:n.trackName,encrypted:n.isEncrypted,kind:n.kind,source:n.source},n.track?Zn(n.track):{})}}function wB(){return typeof RTCRtpReceiver<"u"&&"getSynchronizationSources"in RTCRtpReceiver}function kB(n,e){var t;n===void 0&&(n={}),e===void 0&&(e={});const r=[...Object.keys(e),...Object.keys(n)],i={};for(const s of r)n[s]!==e[s]&&(i[s]=(t=e[s])!==null&&t!==void 0?t:"");return i}function Mw(n){const e=Object.assign({},n);let t,r;return typeof e.audio=="object"&&e.audio.processor&&(t=e.audio.processor,e.audio=Object.assign(Object.assign({},e.audio),{processor:void 0})),typeof e.video=="object"&&e.video.processor&&(r=e.video.processor,e.video=Object.assign(Object.assign({},e.video),{processor:void 0})),{audioProcessor:t,videoProcessor:r,optionsWithoutProcessor:e}}function PB(n){switch(n){case Br.CAMERA:return Me.Source.Camera;case Br.MICROPHONE:return Me.Source.Microphone;case Br.SCREEN_SHARE:return Me.Source.ScreenShare;case Br.SCREEN_SHARE_AUDIO:return Me.Source.ScreenShareAudio;default:return Me.Source.Unknown}}class xB extends Yo.EventEmitter{constructor(e){super(),this.onWorkerMessage=t=>{var r,i;const{kind:s,data:o}=t.data;switch(s){case"error":kn.error(o.error.message),this.emit(pl.EncryptionError,o.error);break;case"initAck":o.enabled&&this.keyProvider.getKeys().forEach(a=>{this.postKey(a)});break;case"enable":if(o.enabled&&this.keyProvider.getKeys().forEach(a=>{this.postKey(a)}),this.encryptionEnabled!==o.enabled&&o.participantIdentity===((r=this.room)===null||r===void 0?void 0:r.localParticipant.identity))this.emit(pl.ParticipantEncryptionStatusChanged,o.enabled,this.room.localParticipant),this.encryptionEnabled=o.enabled;else if(o.participantIdentity){const a=(i=this.room)===null||i===void 0?void 0:i.getParticipantByIdentity(o.participantIdentity);if(!a)throw TypeError("couldn't set encryption status, participant not found".concat(o.participantIdentity));this.emit(pl.ParticipantEncryptionStatusChanged,o.enabled,a)}break;case"ratchetKey":this.keyProvider.emit(bl.KeyRatcheted,o.material,o.keyIndex);break}},this.onWorkerError=t=>{kn.error("e2ee worker encountered an error:",{error:t.error}),this.emit(pl.EncryptionError,t.error)},this.keyProvider=e.keyProvider,this.worker=e.worker,this.encryptionEnabled=!1}setup(e){if(!FU())throw new Aw("tried to setup end-to-end encryption on an unsupported browser");if(kn.info("setting up e2ee"),e!==this.room){this.room=e,this.setupEventListeners(e,this.keyProvider);const t={kind:"init",data:{keyProviderOptions:this.keyProvider.getOptions(),loglevel:CU.getLevel()}};this.worker&&(kn.info("initializing worker",{worker:this.worker}),this.worker.onmessage=this.onWorkerMessage,this.worker.onerror=this.onWorkerError,this.worker.postMessage(t))}}setParticipantCryptorEnabled(e,t){kn.debug("set e2ee to ".concat(e," for participant ").concat(t)),this.postEnable(e,t)}setSifTrailer(e){!e||e.length===0?kn.warn("ignoring server sent trailer as it's empty"):this.postSifTrailer(e)}setupEngine(e){e.on(lt.RTPVideoMapUpdate,t=>{this.postRTPMap(t)})}setupEventListeners(e,t){e.on(Ce.TrackPublished,(r,i)=>this.setParticipantCryptorEnabled(r.trackInfo.encryption!==gs.NONE,i.identity)),e.on(Ce.ConnectionStateChanged,r=>{r===qn.Connected&&e.remoteParticipants.forEach(i=>{i.trackPublications.forEach(s=>{this.setParticipantCryptorEnabled(s.trackInfo.encryption!==gs.NONE,i.identity)})})}).on(Ce.TrackUnsubscribed,(r,i,s)=>{var o;const a={kind:"removeTransform",data:{participantIdentity:s.identity,trackId:r.mediaStreamID}};(o=this.worker)===null||o===void 0||o.postMessage(a)}).on(Ce.TrackSubscribed,(r,i,s)=>{this.setupE2EEReceiver(r,s.identity,i.trackInfo)}).on(Ce.SignalConnected,()=>{if(!this.room)throw new TypeError("expected room to be present on signal connect");t.getKeys().forEach(r=>{this.postKey(r)}),this.setParticipantCryptorEnabled(this.room.localParticipant.isE2EEEnabled,this.room.localParticipant.identity)}),e.localParticipant.on(Ne.LocalTrackPublished,r=>ie(this,void 0,void 0,function*(){this.setupE2EESender(r.track,r.track.sender)})),t.on(bl.SetKey,r=>this.postKey(r)).on(bl.RatchetRequest,(r,i)=>this.postRatchetRequest(r,i))}postRatchetRequest(e,t){if(!this.worker)throw Error("could not ratchet key, worker is missing");const r={kind:"ratchetRequest",data:{participantIdentity:e,keyIndex:t}};this.worker.postMessage(r)}postKey(e){let{key:t,participantIdentity:r,keyIndex:i}=e;var s;if(!this.worker)throw Error("could not set key, worker is missing");const o={kind:"setKey",data:{participantIdentity:r,isPublisher:r===((s=this.room)===null||s===void 0?void 0:s.localParticipant.identity),key:t,keyIndex:i}};this.worker.postMessage(o)}postEnable(e,t){if(this.worker){const r={kind:"enable",data:{enabled:e,participantIdentity:t}};this.worker.postMessage(r)}else throw new ReferenceError("failed to enable e2ee, worker is not ready")}postRTPMap(e){var t;if(!this.worker)throw TypeError("could not post rtp map, worker is missing");if(!(!((t=this.room)===null||t===void 0)&&t.localParticipant.identity))throw TypeError("could not post rtp map, local participant identity is missing");const r={kind:"setRTPMap",data:{map:e,participantIdentity:this.room.localParticipant.identity}};this.worker.postMessage(r)}postSifTrailer(e){if(!this.worker)throw Error("could not post SIF trailer, worker is missing");const t={kind:"setSifTrailer",data:{trailer:e}};this.worker.postMessage(t)}setupE2EEReceiver(e,t,r){if(e.receiver){if(!(r!=null&&r.mimeType)||r.mimeType==="")throw new TypeError("MimeType missing from trackInfo, cannot set up E2EE cryptor");this.handleReceiver(e.receiver,e.mediaStreamID,t,e.kind==="video"?wg(r.mimeType):void 0)}}setupE2EESender(e,t){if(!$u(e)||!t){t||kn.warn("early return because sender is not ready");return}this.handleSender(t,e.mediaStreamID,void 0)}handleReceiver(e,t,r,i){return ie(this,void 0,void 0,function*(){if(this.worker){if(LS()){const s={kind:"decode",participantIdentity:r,trackId:t,codec:i};e.transform=new RTCRtpScriptTransform(this.worker,s)}else{if(Tp in e&&i){const l={kind:"updateCodec",data:{trackId:t,codec:i,participantIdentity:r}};this.worker.postMessage(l);return}let s=e.writableStream,o=e.readableStream;if(!s||!o){const l=e.createEncodedStreams();e.writableStream=l.writable,s=l.writable,e.readableStream=l.readable,o=l.readable}const a={kind:"decode",data:{readableStream:o,writableStream:s,trackId:t,codec:i,participantIdentity:r}};this.worker.postMessage(a,[o,s])}e[Tp]=!0}})}handleSender(e,t,r){var i;if(!(Tp in e||!this.worker)){if(!(!((i=this.room)===null||i===void 0)&&i.localParticipant.identity)||this.room.localParticipant.identity==="")throw TypeError("local identity needs to be known in order to set up encrypted sender");if(LS()){kn.info("initialize script transform");const s={kind:"encode",participantIdentity:this.room.localParticipant.identity,trackId:t,codec:r};e.transform=new RTCRtpScriptTransform(this.worker,s)}else{kn.info("initialize encoded streams");const s=e.createEncodedStreams(),o={kind:"encode",data:{readableStream:s.readable,writableStream:s.writable,codec:r,trackId:t,participantIdentity:this.room.localParticipant.identity}};this.worker.postMessage(o,[s.readable,s.writable])}e[Tp]=!0}}}const n0="default";class li{constructor(){this._previousDevices=[]}static getInstance(){return this.instance===void 0&&(this.instance=new li),this.instance}get previousDevices(){return this._previousDevices}getDevices(e){return ie(this,arguments,void 0,function(t){var r=this;let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return function*(){var s;if(((s=li.userMediaPromiseMap)===null||s===void 0?void 0:s.size)>0){kn.debug("awaiting getUserMedia promise");try{t?yield li.userMediaPromiseMap.get(t):yield Promise.all(li.userMediaPromiseMap.values())}catch{kn.warn("error waiting for media permissons")}}let o=yield navigator.mediaDevices.enumerateDevices();if(i&&!(Pl()&&r.hasDeviceInUse(t))&&(o.filter(l=>l.kind===t).length===0||o.some(l=>{const c=l.label==="",u=t?l.kind===t:!0;return c&&u}))){const l={video:t!=="audioinput"&&t!=="audiooutput",audio:t!=="videoinput"&&{deviceId:"default"}},c=yield navigator.mediaDevices.getUserMedia(l);o=yield navigator.mediaDevices.enumerateDevices(),c.getTracks().forEach(u=>{u.stop()})}return r._previousDevices=o,t&&(o=o.filter(a=>a.kind===t)),o}()})}normalizeDeviceId(e,t,r){return ie(this,void 0,void 0,function*(){if(t!==n0)return t;const i=yield this.getDevices(e),s=i.find(a=>a.deviceId===n0);if(!s){kn.warn("could not reliably determine default device");return}const o=i.find(a=>a.deviceId!==n0&&a.groupId===(r??s.groupId));if(!o){kn.warn("could not reliably determine default device");return}return o==null?void 0:o.deviceId})}hasDeviceInUse(e){return e?li.userMediaPromiseMap.has(e):li.userMediaPromiseMap.size>0}}li.mediaDeviceKinds=["audioinput","audiooutput","videoinput"];li.userMediaPromiseMap=new Map;var Rd;(function(n){n[n.WAITING=0]="WAITING",n[n.RUNNING=1]="RUNNING",n[n.COMPLETED=2]="COMPLETED"})(Rd||(Rd={}));class TB{constructor(){this.pendingTasks=new Map,this.taskMutex=new vs,this.nextTaskIndex=0}run(e){return ie(this,void 0,void 0,function*(){const t={id:this.nextTaskIndex++,enqueuedAt:Date.now(),status:Rd.WAITING};this.pendingTasks.set(t.id,t);const r=yield this.taskMutex.lock();try{return t.executedAt=Date.now(),t.status=Rd.RUNNING,yield e()}finally{t.status=Rd.COMPLETED,this.pendingTasks.delete(t.id),r()}})}flush(){return ie(this,void 0,void 0,function*(){return this.run(()=>ie(this,void 0,void 0,function*(){}))})}snapshot(){return Array.from(this.pendingTasks.values())}}const CB=["syncState","trickle","offer","answer","simulate","leave"];function _B(n){const e=CB.indexOf(n.case)>=0;return kn.trace("request allowed to bypass queue:",{canPass:e,req:n}),e}var vr;(function(n){n[n.CONNECTING=0]="CONNECTING",n[n.CONNECTED=1]="CONNECTED",n[n.RECONNECTING=2]="RECONNECTING",n[n.DISCONNECTING=3]="DISCONNECTING",n[n.DISCONNECTED=4]="DISCONNECTED"})(vr||(vr={}));class Qw{get currentState(){return this.state}get isDisconnected(){return this.state===vr.DISCONNECTING||this.state===vr.DISCONNECTED}get isEstablishingConnection(){return this.state===vr.CONNECTING||this.state===vr.RECONNECTING}getNextRequestId(){return this._requestId+=1,this._requestId}constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var r;this.rtt=0,this.state=vr.DISCONNECTED,this.log=kn,this._requestId=0,this.resetCallbacks=()=>{this.onAnswer=void 0,this.onLeave=void 0,this.onLocalTrackPublished=void 0,this.onLocalTrackUnpublished=void 0,this.onNegotiateRequested=void 0,this.onOffer=void 0,this.onRemoteMuteChanged=void 0,this.onSubscribedQualityUpdate=void 0,this.onTokenRefresh=void 0,this.onTrickle=void 0,this.onClose=void 0},this.log=ka((r=t.loggerName)!==null&&r!==void 0?r:uo.Signal),this.loggerContextCb=t.loggerContextCb,this.useJSON=e,this.requestQueue=new TB,this.queuedRequests=[],this.closingLock=new vs,this.connectionLock=new vs,this.state=vr.DISCONNECTED}get logContext(){var e,t;return(t=(e=this.loggerContextCb)===null||e===void 0?void 0:e.call(this))!==null&&t!==void 0?t:{}}join(e,t,r,i){return ie(this,void 0,void 0,function*(){return this.state=vr.CONNECTING,this.options=r,yield this.connect(e,t,r,i)})}reconnect(e,t,r,i){return ie(this,void 0,void 0,function*(){if(!this.options){this.log.warn("attempted to reconnect without signal options being set, ignoring",this.logContext);return}return this.state=vr.RECONNECTING,this.clearPingInterval(),yield this.connect(e,t,Object.assign(Object.assign({},this.options),{reconnect:!0,sid:r,reconnectReason:i}))})}connect(e,t,r,i){this.connectOptions=r;const s=new URL(pB(e)),o=s.pathname.endsWith("/");s.pathname+=o?"rtc":"/rtc";const a=dB(),l=EB(t,a,r);for(const[c,u]of l)s.searchParams.set(c,u);return new Promise((c,u)=>ie(this,void 0,void 0,function*(){const d=yield this.connectionLock.lock();try{const h=()=>ie(this,void 0,void 0,function*(){this.close(),clearTimeout(m),u(new Jn("room connection has been cancelled (signal)",_n.Cancelled))}),m=setTimeout(()=>{this.close(),u(new Jn("room connection has timed out (signal)",_n.ServerUnreachable))},r.websocketTimeout);i!=null&&i.aborted&&h(),i==null||i.addEventListener("abort",h);const g=new URL(s.toString());g.searchParams.has("access_token")&&g.searchParams.set("access_token","<redacted>"),this.log.debug("connecting to ".concat(g),Object.assign({reconnect:r.reconnect,reconnectReason:r.reconnectReason},this.logContext)),this.ws&&(yield this.close(!1)),this.ws=new WebSocket(s.toString()),this.ws.binaryType="arraybuffer",this.ws.onopen=()=>{clearTimeout(m)},this.ws.onerror=O=>ie(this,void 0,void 0,function*(){if(this.state!==vr.CONNECTED){this.state=vr.DISCONNECTED,clearTimeout(m);try{const y=new URL(s.toString());y.protocol="http".concat(y.protocol.substring(2)),y.pathname+="/validate";const b=yield fetch(y);if(b.status.toFixed(0).startsWith("4")){const S=yield b.text();u(new Jn(S,_n.NotAllowed,b.status))}else u(new Jn("Internal error",_n.InternalError,b.status))}catch(y){u(new Jn(y instanceof Error?y.message:"server was not reachable",_n.ServerUnreachable))}return}this.handleWSError(O)}),this.ws.onmessage=O=>ie(this,void 0,void 0,function*(){var y,b,S;let P;if(typeof O.data=="string"){const k=JSON.parse(O.data);P=YT.fromJson(k,{ignoreUnknownFields:!0})}else if(O.data instanceof ArrayBuffer)P=YT.fromBinary(new Uint8Array(O.data));else{this.log.error("could not decode websocket message: ".concat(typeof O.data),this.logContext);return}if(this.state!==vr.CONNECTED){let k=!1;if(((y=P.message)===null||y===void 0?void 0:y.case)==="join"?(this.state=vr.CONNECTED,i==null||i.removeEventListener("abort",h),this.pingTimeoutDuration=P.message.value.pingTimeout,this.pingIntervalDuration=P.message.value.pingInterval,this.pingTimeoutDuration&&this.pingTimeoutDuration>0&&(this.log.debug("ping config",Object.assign(Object.assign({},this.logContext),{timeout:this.pingTimeoutDuration,interval:this.pingIntervalDuration})),this.startPingInterval()),c(P.message.value)):this.state===vr.RECONNECTING&&P.message.case!=="leave"?(this.state=vr.CONNECTED,i==null||i.removeEventListener("abort",h),this.startPingInterval(),((b=P.message)===null||b===void 0?void 0:b.case)==="reconnect"?c(P.message.value):(this.log.debug("declaring signal reconnected without reconnect response received",this.logContext),c(void 0),k=!0)):this.isEstablishingConnection&&P.message.case==="leave"?u(new Jn("Received leave request while trying to (re)connect",_n.LeaveRequest,void 0,P.message.value.reason)):r.reconnect||u(new Jn("did not receive join response, got ".concat((S=P.message)===null||S===void 0?void 0:S.case," instead"),_n.InternalError)),!k)return}this.signalLatency&&(yield os(this.signalLatency)),this.handleSignalResponse(P)}),this.ws.onclose=O=>{this.isEstablishingConnection&&u(new Jn("Websocket got closed during a (re)connection attempt",_n.InternalError)),this.log.warn("websocket closed",Object.assign(Object.assign({},this.logContext),{reason:O.reason,code:O.code,wasClean:O.wasClean,state:this.state})),this.handleOnClose(O.reason)}}finally{d()}}))}close(){return ie(this,arguments,void 0,function(){var e=this;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return function*(){const r=yield e.closingLock.lock();try{if(e.clearPingInterval(),t&&(e.state=vr.DISCONNECTING),e.ws){e.ws.onmessage=null,e.ws.onopen=null,e.ws.onclose=null;const i=new Promise(s=>{e.ws?e.ws.onclose=()=>{s()}:s()});e.ws.readyState<e.ws.CLOSING&&(e.ws.close(),yield Promise.race([i,os(250)])),e.ws=void 0}}finally{t&&(e.state=vr.DISCONNECTED),r()}}()})}sendOffer(e){this.log.debug("sending offer",Object.assign(Object.assign({},this.logContext),{offerSdp:e.sdp})),this.sendRequest({case:"offer",value:Xg(e)})}sendAnswer(e){return this.log.debug("sending answer",Object.assign(Object.assign({},this.logContext),{answerSdp:e.sdp})),this.sendRequest({case:"answer",value:Xg(e)})}sendIceCandidate(e,t){return this.log.debug("sending ice candidate",Object.assign(Object.assign({},this.logContext),{candidate:e})),this.sendRequest({case:"trickle",value:new xw({candidateInit:JSON.stringify(e),target:t})})}sendMuteTrack(e,t){return this.sendRequest({case:"mute",value:new Tw({sid:e,muted:t})})}sendAddTrack(e){return this.sendRequest({case:"addTrack",value:e})}sendUpdateLocalMetadata(e,t){return ie(this,arguments,void 0,function(r,i){var s=this;let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return function*(){const a=s.getNextRequestId();return yield s.sendRequest({case:"updateMetadata",value:new oQ({requestId:a,metadata:r,name:i,attributes:o})}),a}()})}sendUpdateTrackSettings(e){this.sendRequest({case:"trackSetting",value:e})}sendUpdateSubscription(e){return this.sendRequest({case:"subscription",value:e})}sendSyncState(e){return this.sendRequest({case:"syncState",value:e})}sendUpdateVideoLayers(e,t){return this.sendRequest({case:"updateLayers",value:new sQ({trackSid:e,layers:t})})}sendUpdateSubscriptionPermissions(e,t){return this.sendRequest({case:"subscriptionPermission",value:new cQ({allParticipants:e,trackPermissions:t})})}sendSimulateScenario(e){return this.sendRequest({case:"simulate",value:e})}sendPing(){return Promise.all([this.sendRequest({case:"ping",value:yr.parse(Date.now())}),this.sendRequest({case:"pingReq",value:new dQ({timestamp:yr.parse(Date.now()),rtt:yr.parse(this.rtt)})})])}sendUpdateLocalAudioTrack(e,t){return this.sendRequest({case:"updateAudioTrack",value:new iQ({trackSid:e,features:t})})}sendLeave(){return this.sendRequest({case:"leave",value:new LO({reason:co.CLIENT_INITIATED,action:Eu.DISCONNECT})})}sendRequest(e){return ie(this,arguments,void 0,function(t){var r=this;let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return function*(){if(!i&&!_B(t)&&r.state===vr.RECONNECTING){r.queuedRequests.push(()=>ie(r,void 0,void 0,function*(){yield this.sendRequest(t,!0)}));return}if(i||(yield r.requestQueue.flush()),r.signalLatency&&(yield os(r.signalLatency)),!r.ws||r.ws.readyState!==r.ws.OPEN){r.log.error("cannot send signal request before connected, type: ".concat(t==null?void 0:t.case),r.logContext);return}const o=new rU({message:t});try{r.useJSON?r.ws.send(o.toJsonString()):r.ws.send(o.toBinary())}catch(a){r.log.error("error sending signal message",Object.assign(Object.assign({},r.logContext),{error:a}))}}()})}handleSignalResponse(e){var t,r;const i=e.message;if(i==null){this.log.debug("received unsupported message",this.logContext);return}let s=!1;if(i.case==="answer"){const o=yC(i.value);this.onAnswer&&this.onAnswer(o)}else if(i.case==="offer"){const o=yC(i.value);this.onOffer&&this.onOffer(o)}else if(i.case==="trickle"){const o=JSON.parse(i.value.candidateInit);this.onTrickle&&this.onTrickle(o,i.value.target)}else i.case==="update"?this.onParticipantUpdate&&this.onParticipantUpdate((t=i.value.participants)!==null&&t!==void 0?t:[]):i.case==="trackPublished"?this.onLocalTrackPublished&&this.onLocalTrackPublished(i.value):i.case==="speakersChanged"?this.onSpeakersChanged&&this.onSpeakersChanged((r=i.value.speakers)!==null&&r!==void 0?r:[]):i.case==="leave"?this.onLeave&&this.onLeave(i.value):i.case==="mute"?this.onRemoteMuteChanged&&this.onRemoteMuteChanged(i.value.sid,i.value.muted):i.case==="roomUpdate"?this.onRoomUpdate&&i.value.room&&this.onRoomUpdate(i.value.room):i.case==="connectionQuality"?this.onConnectionQuality&&this.onConnectionQuality(i.value):i.case==="streamStateUpdate"?this.onStreamStateUpdate&&this.onStreamStateUpdate(i.value):i.case==="subscribedQualityUpdate"?this.onSubscribedQualityUpdate&&this.onSubscribedQualityUpdate(i.value):i.case==="subscriptionPermissionUpdate"?this.onSubscriptionPermissionUpdate&&this.onSubscriptionPermissionUpdate(i.value):i.case==="refreshToken"?this.onTokenRefresh&&this.onTokenRefresh(i.value):i.case==="trackUnpublished"?this.onLocalTrackUnpublished&&this.onLocalTrackUnpublished(i.value):i.case==="subscriptionResponse"?this.onSubscriptionError&&this.onSubscriptionError(i.value):i.case==="pong"||(i.case==="pongResp"?(this.rtt=Date.now()-Number.parseInt(i.value.lastPingTimestamp.toString()),this.resetPingTimeout(),s=!0):i.case==="requestResponse"?this.onRequestResponse&&this.onRequestResponse(i.value):i.case==="trackSubscribed"?this.onLocalTrackSubscribed&&this.onLocalTrackSubscribed(i.value.trackSid):this.log.debug("unsupported message",Object.assign(Object.assign({},this.logContext),{msgCase:i.case})));s||this.resetPingTimeout()}setReconnected(){for(;this.queuedRequests.length>0;){const e=this.queuedRequests.shift();e&&this.requestQueue.run(e)}}handleOnClose(e){return ie(this,void 0,void 0,function*(){if(this.state===vr.DISCONNECTED)return;const t=this.onClose;yield this.close(),this.log.debug("websocket connection closed: ".concat(e),Object.assign(Object.assign({},this.logContext),{reason:e})),t&&t(e)})}handleWSError(e){this.log.error("websocket error",Object.assign(Object.assign({},this.logContext),{error:e}))}resetPingTimeout(){if(this.clearPingTimeout(),!this.pingTimeoutDuration){this.log.warn("ping timeout duration not set",this.logContext);return}this.pingTimeout=Oi.setTimeout(()=>{this.log.warn("ping timeout triggered. last pong received at: ".concat(new Date(Date.now()-this.pingTimeoutDuration*1e3).toUTCString()),this.logContext),this.handleOnClose("ping timeout")},this.pingTimeoutDuration*1e3)}clearPingTimeout(){this.pingTimeout&&Oi.clearTimeout(this.pingTimeout)}startPingInterval(){if(this.clearPingInterval(),this.resetPingTimeout(),!this.pingIntervalDuration){this.log.warn("ping interval duration not set",this.logContext);return}this.log.debug("start ping interval",this.logContext),this.pingInterval=Oi.setInterval(()=>{this.sendPing()},this.pingIntervalDuration*1e3)}clearPingInterval(){this.log.debug("clearing ping interval",this.logContext),this.clearPingTimeout(),this.pingInterval&&Oi.clearInterval(this.pingInterval)}}function yC(n){const e={type:"offer",sdp:n.sdp};switch(n.type){case"answer":case"offer":case"pranswer":case"rollback":e.type=n.type;break}return e}function Xg(n){return new Pc({sdp:n.sdp,type:n.type})}function EB(n,e,t){var r;const i=new URLSearchParams;return i.set("access_token",n),t.reconnect&&(i.set("reconnect","1"),t.sid&&i.set("sid",t.sid)),i.set("auto_subscribe",t.autoSubscribe?"1":"0"),i.set("sdk",Xo()?"reactnative":"js"),i.set("version",e.version),i.set("protocol",e.protocol.toString()),e.deviceModel&&i.set("device_model",e.deviceModel),e.os&&i.set("os",e.os),e.osVersion&&i.set("os_version",e.osVersion),e.browser&&i.set("browser",e.browser),e.browserVersion&&i.set("browser_version",e.browserVersion),t.adaptiveStream&&i.set("adaptive_stream","1"),t.reconnectReason&&i.set("reconnect_reason",t.reconnectReason.toString()),!((r=navigator.connection)===null||r===void 0)&&r.type&&i.set("network",navigator.connection.type),i}var to={},r0={},i0={exports:{}},bC;function Dw(){if(bC)return i0.exports;bC=1;var n=i0.exports={v:[{name:"version",reg:/^(\d*)$/}],o:[{name:"origin",reg:/^(\S*) (\d*) (\d*) (\S*) IP(\d) (\S*)/,names:["username","sessionId","sessionVersion","netType","ipVer","address"],format:"%s %s %d %s IP%d %s"}],s:[{name:"name"}],i:[{name:"description"}],u:[{name:"uri"}],e:[{name:"email"}],p:[{name:"phone"}],z:[{name:"timezones"}],r:[{name:"repeats"}],t:[{name:"timing",reg:/^(\d*) (\d*)/,names:["start","stop"],format:"%d %d"}],c:[{name:"connection",reg:/^IN IP(\d) (\S*)/,names:["version","ip"],format:"IN IP%d %s"}],b:[{push:"bandwidth",reg:/^(TIAS|AS|CT|RR|RS):(\d*)/,names:["type","limit"],format:"%s:%s"}],m:[{reg:/^(\w*) (\d*) ([\w/]*)(?: (.*))?/,names:["type","port","protocol","payloads"],format:"%s %d %s %s"}],a:[{push:"rtp",reg:/^rtpmap:(\d*) ([\w\-.]*)(?:\s*\/(\d*)(?:\s*\/(\S*))?)?/,names:["payload","codec","rate","encoding"],format:function(e){return e.encoding?"rtpmap:%d %s/%s/%s":e.rate?"rtpmap:%d %s/%s":"rtpmap:%d %s"}},{push:"fmtp",reg:/^fmtp:(\d*) ([\S| ]*)/,names:["payload","config"],format:"fmtp:%d %s"},{name:"control",reg:/^control:(.*)/,format:"control:%s"},{name:"rtcp",reg:/^rtcp:(\d*)(?: (\S*) IP(\d) (\S*))?/,names:["port","netType","ipVer","address"],format:function(e){return e.address!=null?"rtcp:%d %s IP%d %s":"rtcp:%d"}},{push:"rtcpFbTrrInt",reg:/^rtcp-fb:(\*|\d*) trr-int (\d*)/,names:["payload","value"],format:"rtcp-fb:%s trr-int %d"},{push:"rtcpFb",reg:/^rtcp-fb:(\*|\d*) ([\w-_]*)(?: ([\w-_]*))?/,names:["payload","type","subtype"],format:function(e){return e.subtype!=null?"rtcp-fb:%s %s %s":"rtcp-fb:%s %s"}},{push:"ext",reg:/^extmap:(\d+)(?:\/(\w+))?(?: (urn:ietf:params:rtp-hdrext:encrypt))? (\S*)(?: (\S*))?/,names:["value","direction","encrypt-uri","uri","config"],format:function(e){return"extmap:%d"+(e.direction?"/%s":"%v")+(e["encrypt-uri"]?" %s":"%v")+" %s"+(e.config?" %s":"")}},{name:"extmapAllowMixed",reg:/^(extmap-allow-mixed)/},{push:"crypto",reg:/^crypto:(\d*) ([\w_]*) (\S*)(?: (\S*))?/,names:["id","suite","config","sessionConfig"],format:function(e){return e.sessionConfig!=null?"crypto:%d %s %s %s":"crypto:%d %s %s"}},{name:"setup",reg:/^setup:(\w*)/,format:"setup:%s"},{name:"connectionType",reg:/^connection:(new|existing)/,format:"connection:%s"},{name:"mid",reg:/^mid:([^\s]*)/,format:"mid:%s"},{name:"msid",reg:/^msid:(.*)/,format:"msid:%s"},{name:"ptime",reg:/^ptime:(\d*(?:\.\d*)*)/,format:"ptime:%d"},{name:"maxptime",reg:/^maxptime:(\d*(?:\.\d*)*)/,format:"maxptime:%d"},{name:"direction",reg:/^(sendrecv|recvonly|sendonly|inactive)/},{name:"icelite",reg:/^(ice-lite)/},{name:"iceUfrag",reg:/^ice-ufrag:(\S*)/,format:"ice-ufrag:%s"},{name:"icePwd",reg:/^ice-pwd:(\S*)/,format:"ice-pwd:%s"},{name:"fingerprint",reg:/^fingerprint:(\S*) (\S*)/,names:["type","hash"],format:"fingerprint:%s %s"},{push:"candidates",reg:/^candidate:(\S*) (\d*) (\S*) (\d*) (\S*) (\d*) typ (\S*)(?: raddr (\S*) rport (\d*))?(?: tcptype (\S*))?(?: generation (\d*))?(?: network-id (\d*))?(?: network-cost (\d*))?/,names:["foundation","component","transport","priority","ip","port","type","raddr","rport","tcptype","generation","network-id","network-cost"],format:function(e){var t="candidate:%s %d %s %d %s %d typ %s";return t+=e.raddr!=null?" raddr %s rport %d":"%v%v",t+=e.tcptype!=null?" tcptype %s":"%v",e.generation!=null&&(t+=" generation %d"),t+=e["network-id"]!=null?" network-id %d":"%v",t+=e["network-cost"]!=null?" network-cost %d":"%v",t}},{name:"endOfCandidates",reg:/^(end-of-candidates)/},{name:"remoteCandidates",reg:/^remote-candidates:(.*)/,format:"remote-candidates:%s"},{name:"iceOptions",reg:/^ice-options:(\S*)/,format:"ice-options:%s"},{push:"ssrcs",reg:/^ssrc:(\d*) ([\w_-]*)(?::(.*))?/,names:["id","attribute","value"],format:function(e){var t="ssrc:%d";return e.attribute!=null&&(t+=" %s",e.value!=null&&(t+=":%s")),t}},{push:"ssrcGroups",reg:/^ssrc-group:([\x21\x23\x24\x25\x26\x27\x2A\x2B\x2D\x2E\w]*) (.*)/,names:["semantics","ssrcs"],format:"ssrc-group:%s %s"},{name:"msidSemantic",reg:/^msid-semantic:\s?(\w*) (\S*)/,names:["semantic","token"],format:"msid-semantic: %s %s"},{push:"groups",reg:/^group:(\w*) (.*)/,names:["type","mids"],format:"group:%s %s"},{name:"rtcpMux",reg:/^(rtcp-mux)/},{name:"rtcpRsize",reg:/^(rtcp-rsize)/},{name:"sctpmap",reg:/^sctpmap:([\w_/]*) (\S*)(?: (\S*))?/,names:["sctpmapNumber","app","maxMessageSize"],format:function(e){return e.maxMessageSize!=null?"sctpmap:%s %s %s":"sctpmap:%s %s"}},{name:"xGoogleFlag",reg:/^x-google-flag:([^\s]*)/,format:"x-google-flag:%s"},{push:"rids",reg:/^rid:([\d\w]+) (\w+)(?: ([\S| ]*))?/,names:["id","direction","params"],format:function(e){return e.params?"rid:%s %s %s":"rid:%s %s"}},{push:"imageattrs",reg:new RegExp("^imageattr:(\\d+|\\*)[\\s\\t]+(send|recv)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*)(?:[\\s\\t]+(recv|send)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*))?"),names:["pt","dir1","attrs1","dir2","attrs2"],format:function(e){return"imageattr:%s %s %s"+(e.dir2?" %s %s":"")}},{name:"simulcast",reg:new RegExp("^simulcast:(send|recv) ([a-zA-Z0-9\\-_~;,]+)(?:\\s?(send|recv) ([a-zA-Z0-9\\-_~;,]+))?$"),names:["dir1","list1","dir2","list2"],format:function(e){return"simulcast:%s %s"+(e.dir2?" %s %s":"")}},{name:"simulcast_03",reg:/^simulcast:[\s\t]+([\S+\s\t]+)$/,names:["value"],format:"simulcast: %s"},{name:"framerate",reg:/^framerate:(\d+(?:$|\.\d+))/,format:"framerate:%s"},{name:"sourceFilter",reg:/^source-filter: *(excl|incl) (\S*) (IP4|IP6|\*) (\S*) (.*)/,names:["filterMode","netType","addressTypes","destAddress","srcList"],format:"source-filter: %s %s %s %s %s"},{name:"bundleOnly",reg:/^(bundle-only)/},{name:"label",reg:/^label:(.+)/,format:"label:%s"},{name:"sctpPort",reg:/^sctp-port:(\d+)$/,format:"sctp-port:%s"},{name:"maxMessageSize",reg:/^max-message-size:(\d+)$/,format:"max-message-size:%s"},{push:"tsRefClocks",reg:/^ts-refclk:([^\s=]*)(?:=(\S*))?/,names:["clksrc","clksrcExt"],format:function(e){return"ts-refclk:%s"+(e.clksrcExt!=null?"=%s":"")}},{name:"mediaClk",reg:/^mediaclk:(?:id=(\S*))? *([^\s=]*)(?:=(\S*))?(?: *rate=(\d+)\/(\d+))?/,names:["id","mediaClockName","mediaClockValue","rateNumerator","rateDenominator"],format:function(e){var t="mediaclk:";return t+=e.id!=null?"id=%s %s":"%v%s",t+=e.mediaClockValue!=null?"=%s":"",t+=e.rateNumerator!=null?" rate=%s":"",t+=e.rateDenominator!=null?"/%s":"",t}},{name:"keywords",reg:/^keywds:(.+)$/,format:"keywds:%s"},{name:"content",reg:/^content:(.+)/,format:"content:%s"},{name:"bfcpFloorCtrl",reg:/^floorctrl:(c-only|s-only|c-s)/,format:"floorctrl:%s"},{name:"bfcpConfId",reg:/^confid:(\d+)/,format:"confid:%s"},{name:"bfcpUserId",reg:/^userid:(\d+)/,format:"userid:%s"},{name:"bfcpFloorId",reg:/^floorid:(.+) (?:m-stream|mstrm):(.+)/,names:["id","mStream"],format:"floorid:%s mstrm:%s"},{push:"invalid",names:["value"]}]};return Object.keys(n).forEach(function(e){var t=n[e];t.forEach(function(r){r.reg||(r.reg=/(.*)/),r.format||(r.format="%s")})}),i0.exports}var SC;function RB(){return SC||(SC=1,function(n){var e=function(a){return String(Number(a))===a?Number(a):a},t=function(a,l,c,u){if(u&&!c)l[u]=e(a[1]);else for(var d=0;d<c.length;d+=1)a[d+1]!=null&&(l[c[d]]=e(a[d+1]))},r=function(a,l,c){var u=a.name&&a.names;a.push&&!l[a.push]?l[a.push]=[]:u&&!l[a.name]&&(l[a.name]={});var d=a.push?{}:u?l[a.name]:l;t(c.match(a.reg),d,a.names,a.name),a.push&&l[a.push].push(d)},i=Dw(),s=RegExp.prototype.test.bind(/^([a-z])=(.*)/);n.parse=function(a){var l={},c=[],u=l;return a.split(/(\r\n|\r|\n)/).filter(s).forEach(function(d){var h=d[0],m=d.slice(2);h==="m"&&(c.push({rtp:[],fmtp:[]}),u=c[c.length-1]);for(var g=0;g<(i[h]||[]).length;g+=1){var O=i[h][g];if(O.reg.test(m))return r(O,u,m)}}),l.media=c,l};var o=function(a,l){var c=l.split(/=(.+)/,2);return c.length===2?a[c[0]]=e(c[1]):c.length===1&&l.length>1&&(a[c[0]]=void 0),a};n.parseParams=function(a){return a.split(/;\s?/).reduce(o,{})},n.parseFmtpConfig=n.parseParams,n.parsePayloads=function(a){return a.toString().split(" ").map(Number)},n.parseRemoteCandidates=function(a){for(var l=[],c=a.split(" ").map(e),u=0;u<c.length;u+=3)l.push({component:c[u],ip:c[u+1],port:c[u+2]});return l},n.parseImageAttributes=function(a){return a.split(" ").map(function(l){return l.substring(1,l.length-1).split(",").reduce(o,{})})},n.parseSimulcastStreamList=function(a){return a.split(";").map(function(l){return l.split(",").map(function(c){var u,d=!1;return c[0]!=="~"?u=e(c):(u=e(c.substring(1,c.length)),d=!0),{scid:u,paused:d}})})}}(r0)),r0}var s0,wC;function AB(){if(wC)return s0;wC=1;var n=Dw(),e=/%[sdv%]/g,t=function(o){var a=1,l=arguments,c=l.length;return o.replace(e,function(u){if(a>=c)return u;var d=l[a];switch(a+=1,u){case"%%":return"%";case"%s":return String(d);case"%d":return Number(d);case"%v":return""}})},r=function(o,a,l){var c=a.format instanceof Function?a.format(a.push?l:l[a.name]):a.format,u=[o+"="+c];if(a.names)for(var d=0;d<a.names.length;d+=1){var h=a.names[d];a.name?u.push(l[a.name][h]):u.push(l[a.names[d]])}else u.push(l[a.name]);return t.apply(null,u)},i=["v","o","s","i","u","e","p","c","b","t","r","z","a"],s=["i","c","b","a"];return s0=function(o,a){a=a||{},o.version==null&&(o.version=0),o.name==null&&(o.name=" "),o.media.forEach(function(d){d.payloads==null&&(d.payloads="")});var l=a.outerOrder||i,c=a.innerOrder||s,u=[];return l.forEach(function(d){n[d].forEach(function(h){h.name in o&&o[h.name]!=null?u.push(r(d,h,o)):h.push in o&&o[h.push]!=null&&o[h.push].forEach(function(m){u.push(r(d,h,m))})})}),o.media.forEach(function(d){u.push(r("m",n.m[0],d)),c.forEach(function(h){n[h].forEach(function(m){m.name in d&&d[m.name]!=null?u.push(r(h,m,d)):m.push in d&&d[m.push]!=null&&d[m.push].forEach(function(g){u.push(r(h,m,g))})})})}),u.join(`\r
|
|
113
|
+
`)+`\r
|
|
114
|
+
`},s0}var kC;function $B(){if(kC)return to;kC=1;var n=RB(),e=AB(),t=Dw();return to.grammar=t,to.write=e,to.parse=n.parse,to.parseParams=n.parseParams,to.parseFmtpConfig=n.parseFmtpConfig,to.parsePayloads=n.parsePayloads,to.parseRemoteCandidates=n.parseRemoteCandidates,to.parseImageAttributes=n.parseImageAttributes,to.parseSimulcastStreamList=n.parseSimulcastStreamList,to}var tl=$B();function Iw(n,e,t){var r,i,s;e===void 0&&(e=50),t===void 0&&(t={});var o=(r=t.isImmediate)!=null&&r,a=(i=t.callback)!=null&&i,l=t.maxWait,c=Date.now(),u=[];function d(){if(l!==void 0){var m=Date.now()-c;if(m+e>=l)return l-m}return e}var h=function(){var m=[].slice.call(arguments),g=this;return new Promise(function(O,y){var b=o&&s===void 0;if(s!==void 0&&clearTimeout(s),s=setTimeout(function(){if(s=void 0,c=Date.now(),!o){var P=n.apply(g,m);a&&a(P),u.forEach(function(k){return(0,k.resolve)(P)}),u=[]}},d()),b){var S=n.apply(g,m);return a&&a(S),O(S)}u.push({resolve:O,reject:y})})};return h.cancel=function(m){s!==void 0&&clearTimeout(s),u.forEach(function(g){return(0,g.reject)(m)}),u=[]},h}const MB=.7,QB=20,Mu={NegotiationStarted:"negotiationStarted",NegotiationComplete:"negotiationComplete",RTPVideoPayloadTypes:"rtpVideoPayloadTypes"};class PC extends Yo.EventEmitter{get pc(){return this._pc||(this._pc=this.createPC()),this._pc}constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var r;super(),this.log=kn,this.ddExtID=0,this.pendingCandidates=[],this.restartingIce=!1,this.renegotiate=!1,this.trackBitrates=[],this.remoteStereoMids=[],this.remoteNackMids=[],this.negotiate=Iw(i=>ie(this,void 0,void 0,function*(){this.emit(Mu.NegotiationStarted);try{yield this.createAndSendOffer()}catch(s){if(i)i(s);else throw s}}),QB),this.close=()=>{this._pc&&(this._pc.close(),this._pc.onconnectionstatechange=null,this._pc.oniceconnectionstatechange=null,this._pc.onicegatheringstatechange=null,this._pc.ondatachannel=null,this._pc.onnegotiationneeded=null,this._pc.onsignalingstatechange=null,this._pc.onicecandidate=null,this._pc.ondatachannel=null,this._pc.ontrack=null,this._pc.onconnectionstatechange=null,this._pc.oniceconnectionstatechange=null,this._pc=null)},this.log=ka((r=t.loggerName)!==null&&r!==void 0?r:uo.PCTransport),this.loggerOptions=t,this.config=e,this._pc=this.createPC()}createPC(){const e=new RTCPeerConnection(this.config);return e.onicecandidate=t=>{var r;t.candidate&&((r=this.onIceCandidate)===null||r===void 0||r.call(this,t.candidate))},e.onicecandidateerror=t=>{var r;(r=this.onIceCandidateError)===null||r===void 0||r.call(this,t)},e.oniceconnectionstatechange=()=>{var t;(t=this.onIceConnectionStateChange)===null||t===void 0||t.call(this,e.iceConnectionState)},e.onsignalingstatechange=()=>{var t;(t=this.onSignalingStatechange)===null||t===void 0||t.call(this,e.signalingState)},e.onconnectionstatechange=()=>{var t;(t=this.onConnectionStateChange)===null||t===void 0||t.call(this,e.connectionState)},e.ondatachannel=t=>{var r;(r=this.onDataChannel)===null||r===void 0||r.call(this,t)},e.ontrack=t=>{var r;(r=this.onTrack)===null||r===void 0||r.call(this,t)},e}get logContext(){var e,t;return Object.assign({},(t=(e=this.loggerOptions).loggerContextCb)===null||t===void 0?void 0:t.call(e))}get isICEConnected(){return this._pc!==null&&(this.pc.iceConnectionState==="connected"||this.pc.iceConnectionState==="completed")}addIceCandidate(e){return ie(this,void 0,void 0,function*(){if(this.pc.remoteDescription&&!this.restartingIce)return this.pc.addIceCandidate(e);this.pendingCandidates.push(e)})}setRemoteDescription(e){return ie(this,void 0,void 0,function*(){var t;let r;if(e.type==="offer"){let{stereoMids:i,nackMids:s}=DB(e);this.remoteStereoMids=i,this.remoteNackMids=s}else if(e.type==="answer"){const i=tl.parse((t=e.sdp)!==null&&t!==void 0?t:"");i.media.forEach(s=>{s.type==="audio"&&this.trackBitrates.some(o=>{if(!o.transceiver||s.mid!=o.transceiver.mid)return!1;let a=0;if(s.rtp.some(c=>c.codec.toUpperCase()===o.codec.toUpperCase()?(a=c.payload,!0):!1),a===0)return!0;let l=!1;for(const c of s.fmtp)if(c.payload===a){c.config=c.config.split(";").filter(u=>!u.includes("maxaveragebitrate")).join(";"),o.maxbr>0&&(c.config+=";maxaveragebitrate=".concat(o.maxbr*1e3)),l=!0;break}return l||o.maxbr>0&&s.fmtp.push({payload:a,config:"maxaveragebitrate=".concat(o.maxbr*1e3)}),!0})}),r=tl.write(i)}yield this.setMungedSDP(e,r,!0),this.pendingCandidates.forEach(i=>{this.pc.addIceCandidate(i)}),this.pendingCandidates=[],this.restartingIce=!1,this.renegotiate?(this.renegotiate=!1,yield this.createAndSendOffer()):e.type==="answer"&&(this.emit(Mu.NegotiationComplete),e.sdp&&tl.parse(e.sdp).media.forEach(s=>{s.type==="video"&&this.emit(Mu.RTPVideoPayloadTypes,s.rtp)}))})}createAndSendOffer(e){return ie(this,void 0,void 0,function*(){var t;if(this.onOffer===void 0)return;if(e!=null&&e.iceRestart&&(this.log.debug("restarting ICE",this.logContext),this.restartingIce=!0),this._pc&&this._pc.signalingState==="have-local-offer"){const s=this._pc.remoteDescription;if(e!=null&&e.iceRestart&&s)yield this._pc.setRemoteDescription(s);else{this.renegotiate=!0;return}}else if(!this._pc||this._pc.signalingState==="closed"){this.log.warn("could not createOffer with closed peer connection",this.logContext);return}this.log.debug("starting to negotiate",this.logContext);const r=yield this.pc.createOffer(e);this.log.debug("original offer",Object.assign({sdp:r.sdp},this.logContext));const i=tl.parse((t=r.sdp)!==null&&t!==void 0?t:"");i.media.forEach(s=>{TC(s),s.type==="audio"?xC(s,[],[]):s.type==="video"&&this.trackBitrates.some(o=>{if(!s.msid||!o.cid||!s.msid.includes(o.cid))return!1;let a=0;if(s.rtp.some(c=>c.codec.toUpperCase()===o.codec.toUpperCase()?(a=c.payload,!0):!1),a===0||(Ed(o.codec)&&this.ensureVideoDDExtensionForSVC(s,i),o.codec!=="av1"))return!0;const l=Math.round(o.maxbr*MB);for(const c of s.fmtp)if(c.payload===a){c.config.includes("x-google-start-bitrate")||(c.config+=";x-google-start-bitrate=".concat(l));break}return!0})}),yield this.setMungedSDP(r,tl.write(i)),this.onOffer(r)})}createAndSetAnswer(){return ie(this,void 0,void 0,function*(){var e;const t=yield this.pc.createAnswer(),r=tl.parse((e=t.sdp)!==null&&e!==void 0?e:"");return r.media.forEach(i=>{TC(i),i.type==="audio"&&xC(i,this.remoteStereoMids,this.remoteNackMids)}),yield this.setMungedSDP(t,tl.write(r)),t})}createDataChannel(e,t){return this.pc.createDataChannel(e,t)}addTransceiver(e,t){return this.pc.addTransceiver(e,t)}addTrack(e){if(!this._pc)throw new Gr("PC closed, cannot add track");return this._pc.addTrack(e)}setTrackCodecBitrate(e){this.trackBitrates.push(e)}setConfiguration(e){var t;if(!this._pc)throw new Gr("PC closed, cannot configure");return(t=this._pc)===null||t===void 0?void 0:t.setConfiguration(e)}canRemoveTrack(){var e;return!!(!((e=this._pc)===null||e===void 0)&&e.removeTrack)}removeTrack(e){var t;return(t=this._pc)===null||t===void 0?void 0:t.removeTrack(e)}getConnectionState(){var e,t;return(t=(e=this._pc)===null||e===void 0?void 0:e.connectionState)!==null&&t!==void 0?t:"closed"}getICEConnectionState(){var e,t;return(t=(e=this._pc)===null||e===void 0?void 0:e.iceConnectionState)!==null&&t!==void 0?t:"closed"}getSignallingState(){var e,t;return(t=(e=this._pc)===null||e===void 0?void 0:e.signalingState)!==null&&t!==void 0?t:"closed"}getTransceivers(){var e,t;return(t=(e=this._pc)===null||e===void 0?void 0:e.getTransceivers())!==null&&t!==void 0?t:[]}getSenders(){var e,t;return(t=(e=this._pc)===null||e===void 0?void 0:e.getSenders())!==null&&t!==void 0?t:[]}getLocalDescription(){var e;return(e=this._pc)===null||e===void 0?void 0:e.localDescription}getRemoteDescription(){var e;return(e=this.pc)===null||e===void 0?void 0:e.remoteDescription}getStats(){return this.pc.getStats()}getConnectedAddress(){return ie(this,void 0,void 0,function*(){var e;if(!this._pc)return;let t="";const r=new Map,i=new Map;if((yield this._pc.getStats()).forEach(a=>{switch(a.type){case"transport":t=a.selectedCandidatePairId;break;case"candidate-pair":t===""&&a.selected&&(t=a.id),r.set(a.id,a);break;case"remote-candidate":i.set(a.id,"".concat(a.address,":").concat(a.port));break}}),t==="")return;const o=(e=r.get(t))===null||e===void 0?void 0:e.remoteCandidateId;if(o!==void 0)return i.get(o)})}setMungedSDP(e,t,r){return ie(this,void 0,void 0,function*(){if(t){const i=e.sdp;e.sdp=t;try{this.log.debug("setting munged ".concat(r?"remote":"local"," description"),this.logContext),r?yield this.pc.setRemoteDescription(e):yield this.pc.setLocalDescription(e);return}catch(s){this.log.warn("not able to set ".concat(e.type,", falling back to unmodified sdp"),Object.assign(Object.assign({},this.logContext),{error:s,sdp:t})),e.sdp=i}}try{r?yield this.pc.setRemoteDescription(e):yield this.pc.setLocalDescription(e)}catch(i){let s="unknown error";i instanceof Error?s=i.message:typeof i=="string"&&(s=i);const o={error:s,sdp:e.sdp};throw!r&&this.pc.remoteDescription&&(o.remoteSdp=this.pc.remoteDescription),this.log.error("unable to set ".concat(e.type),Object.assign(Object.assign({},this.logContext),{fields:o})),new qS(s)}})}ensureVideoDDExtensionForSVC(e,t){var r,i;if(!((r=e.ext)===null||r===void 0?void 0:r.some(o=>o.uri===fC))){if(this.ddExtID===0){let o=0;t.media.forEach(a=>{var l;a.type==="video"&&((l=a.ext)===null||l===void 0||l.forEach(c=>{c.value>o&&(o=c.value)}))}),this.ddExtID=o+1}(i=e.ext)===null||i===void 0||i.push({value:this.ddExtID,uri:fC})}}}function xC(n,e,t){let r=0;n.rtp.some(i=>i.codec==="opus"?(r=i.payload,!0):!1),r>0&&(n.rtcpFb||(n.rtcpFb=[]),t.includes(n.mid)&&!n.rtcpFb.some(i=>i.payload===r&&i.type==="nack")&&n.rtcpFb.push({payload:r,type:"nack"}),e.includes(n.mid)&&n.fmtp.some(i=>i.payload===r?(i.config.includes("stereo=1")||(i.config+=";stereo=1"),!0):!1))}function DB(n){var e;const t=[],r=[],i=tl.parse((e=n.sdp)!==null&&e!==void 0?e:"");let s=0;return i.media.forEach(o=>{var a;o.type==="audio"&&(o.rtp.some(l=>l.codec==="opus"?(s=l.payload,!0):!1),!((a=o.rtcpFb)===null||a===void 0)&&a.some(l=>l.payload===s&&l.type==="nack")&&r.push(o.mid),o.fmtp.some(l=>l.payload===s?(l.config.includes("sprop-stereo=1")&&t.push(o.mid),!0):!1))}),{stereoMids:t,nackMids:r}}function TC(n){if(n.connection){const e=n.connection.ip.indexOf(":")>=0;(n.connection.version===4&&e||n.connection.version===6&&!e)&&(n.connection.ip="0.0.0.0",n.connection.version=4)}}const YS="vp8",IB={audioPreset:US.music,dtx:!0,red:!0,forceStereo:!1,simulcast:!0,screenShareEncoding:$w.h1080fps15.encoding,stopMicTrackOnMute:!1,videoCodec:YS,backupCodec:!0},KQ={deviceId:"default",autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0,voiceIsolation:!0},JQ={deviceId:"default",resolution:qd.h720.resolution},jB={adaptiveStream:!1,dynacast:!1,stopLocalTrackOnUnpublish:!0,reconnectPolicy:new EU,disconnectOnPageLeave:!0,webAudioMix:!1},jw={autoSubscribe:!0,maxRetries:1,peerConnectionTimeout:15e3,websocketTimeout:15e3};var Ar;(function(n){n[n.NEW=0]="NEW",n[n.CONNECTING=1]="CONNECTING",n[n.CONNECTED=2]="CONNECTED",n[n.FAILED=3]="FAILED",n[n.CLOSING=4]="CLOSING",n[n.CLOSED=5]="CLOSED"})(Ar||(Ar={}));class NB{get needsPublisher(){return this.isPublisherConnectionRequired}get needsSubscriber(){return this.isSubscriberConnectionRequired}get currentState(){return this.state}constructor(e,t,r){var i;this.peerConnectionTimeout=jw.peerConnectionTimeout,this.log=kn,this.updateState=()=>{var s;const o=this.state,a=this.requiredTransports.map(l=>l.getConnectionState());a.every(l=>l==="connected")?this.state=Ar.CONNECTED:a.some(l=>l==="failed")?this.state=Ar.FAILED:a.some(l=>l==="connecting")?this.state=Ar.CONNECTING:a.every(l=>l==="closed")?this.state=Ar.CLOSED:a.some(l=>l==="closed")?this.state=Ar.CLOSING:a.every(l=>l==="new")&&(this.state=Ar.NEW),o!==this.state&&(this.log.debug("pc state change: from ".concat(Ar[o]," to ").concat(Ar[this.state]),this.logContext),(s=this.onStateChange)===null||s===void 0||s.call(this,this.state,this.publisher.getConnectionState(),this.subscriber.getConnectionState()))},this.log=ka((i=r.loggerName)!==null&&i!==void 0?i:uo.PCManager),this.loggerOptions=r,this.isPublisherConnectionRequired=!t,this.isSubscriberConnectionRequired=t,this.publisher=new PC(e,r),this.subscriber=new PC(e,r),this.publisher.onConnectionStateChange=this.updateState,this.subscriber.onConnectionStateChange=this.updateState,this.publisher.onIceConnectionStateChange=this.updateState,this.subscriber.onIceConnectionStateChange=this.updateState,this.publisher.onSignalingStatechange=this.updateState,this.subscriber.onSignalingStatechange=this.updateState,this.publisher.onIceCandidate=s=>{var o;(o=this.onIceCandidate)===null||o===void 0||o.call(this,s,lo.PUBLISHER)},this.subscriber.onIceCandidate=s=>{var o;(o=this.onIceCandidate)===null||o===void 0||o.call(this,s,lo.SUBSCRIBER)},this.subscriber.onDataChannel=s=>{var o;(o=this.onDataChannel)===null||o===void 0||o.call(this,s)},this.subscriber.onTrack=s=>{var o;(o=this.onTrack)===null||o===void 0||o.call(this,s)},this.publisher.onOffer=s=>{var o;(o=this.onPublisherOffer)===null||o===void 0||o.call(this,s)},this.state=Ar.NEW,this.connectionLock=new vs,this.remoteOfferLock=new vs}get logContext(){var e,t;return Object.assign({},(t=(e=this.loggerOptions).loggerContextCb)===null||t===void 0?void 0:t.call(e))}requirePublisher(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.isPublisherConnectionRequired=e,this.updateState()}requireSubscriber(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.isSubscriberConnectionRequired=e,this.updateState()}createAndSendPublisherOffer(e){return this.publisher.createAndSendOffer(e)}setPublisherAnswer(e){return this.publisher.setRemoteDescription(e)}removeTrack(e){return this.publisher.removeTrack(e)}close(){return ie(this,void 0,void 0,function*(){if(this.publisher&&this.publisher.getSignallingState()!=="closed"){const e=this.publisher;for(const t of e.getSenders())try{e.canRemoveTrack()&&e.removeTrack(t)}catch(r){this.log.warn("could not removeTrack",Object.assign(Object.assign({},this.logContext),{error:r}))}}yield Promise.all([this.publisher.close(),this.subscriber.close()]),this.updateState()})}triggerIceRestart(){return ie(this,void 0,void 0,function*(){this.subscriber.restartingIce=!0,this.needsPublisher&&(yield this.createAndSendPublisherOffer({iceRestart:!0}))})}addIceCandidate(e,t){return ie(this,void 0,void 0,function*(){t===lo.PUBLISHER?yield this.publisher.addIceCandidate(e):yield this.subscriber.addIceCandidate(e)})}createSubscriberAnswerFromOffer(e){return ie(this,void 0,void 0,function*(){this.log.debug("received server offer",Object.assign(Object.assign({},this.logContext),{RTCSdpType:e.type,sdp:e.sdp,signalingState:this.subscriber.getSignallingState().toString()}));const t=yield this.remoteOfferLock.lock();try{return yield this.subscriber.setRemoteDescription(e),yield this.subscriber.createAndSetAnswer()}finally{t()}})}updateConfiguration(e,t){this.publisher.setConfiguration(e),this.subscriber.setConfiguration(e),t&&this.triggerIceRestart()}ensurePCTransportConnection(e,t){return ie(this,void 0,void 0,function*(){var r;const i=yield this.connectionLock.lock();try{this.isPublisherConnectionRequired&&this.publisher.getConnectionState()!=="connected"&&this.publisher.getConnectionState()!=="connecting"&&(this.log.debug("negotiation required, start negotiating",this.logContext),this.publisher.negotiate()),yield Promise.all((r=this.requiredTransports)===null||r===void 0?void 0:r.map(s=>this.ensureTransportConnected(s,e,t)))}finally{i()}})}negotiate(e){return ie(this,void 0,void 0,function*(){return new Promise((t,r)=>ie(this,void 0,void 0,function*(){const i=setTimeout(()=>{r("negotiation timed out")},this.peerConnectionTimeout),s=()=>{clearTimeout(i),r("negotiation aborted")};e.signal.addEventListener("abort",s),this.publisher.once(Mu.NegotiationStarted,()=>{e.signal.aborted||this.publisher.once(Mu.NegotiationComplete,()=>{clearTimeout(i),t()})}),yield this.publisher.negotiate(o=>{clearTimeout(i),r(o)})}))})}addPublisherTransceiver(e,t){return this.publisher.addTransceiver(e,t)}addPublisherTrack(e){return this.publisher.addTrack(e)}createPublisherDataChannel(e,t){return this.publisher.createDataChannel(e,t)}getConnectedAddress(e){return e===lo.PUBLISHER?this.publisher.getConnectedAddress():e===lo.SUBSCRIBER?this.publisher.getConnectedAddress():this.requiredTransports[0].getConnectedAddress()}get requiredTransports(){const e=[];return this.isPublisherConnectionRequired&&e.push(this.publisher),this.isSubscriberConnectionRequired&&e.push(this.subscriber),e}ensureTransportConnected(e,t){return ie(this,arguments,void 0,function(r,i){var s=this;let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.peerConnectionTimeout;return function*(){if(r.getConnectionState()!=="connected")return new Promise((l,c)=>ie(s,void 0,void 0,function*(){const u=()=>{this.log.warn("abort transport connection",this.logContext),Oi.clearTimeout(d),c(new Jn("room connection has been cancelled",_n.Cancelled))};i!=null&&i.signal.aborted&&u(),i==null||i.signal.addEventListener("abort",u);const d=Oi.setTimeout(()=>{i==null||i.signal.removeEventListener("abort",u),c(new Jn("could not establish pc connection",_n.InternalError))},o);for(;this.state!==Ar.CONNECTED;)if(yield os(50),i!=null&&i.signal.aborted){c(new Jn("room connection has been cancelled",_n.Cancelled));return}Oi.clearTimeout(d),i==null||i.signal.removeEventListener("abort",u),l()}))}()})}}class Mr extends Error{constructor(e,t,r){super(t),this.code=e,this.message=CC(t,Mr.MAX_MESSAGE_BYTES),this.data=r?CC(r,Mr.MAX_DATA_BYTES):void 0}static fromProto(e){return new Mr(e.code,e.message,e.data)}toProto(){return new Y2({code:this.code,message:this.message,data:this.data})}static builtIn(e,t){return new Mr(Mr.ErrorCode[e],Mr.ErrorMessage[e],t)}}Mr.MAX_MESSAGE_BYTES=256;Mr.MAX_DATA_BYTES=15360;Mr.ErrorCode={APPLICATION_ERROR:1500,CONNECTION_TIMEOUT:1501,RESPONSE_TIMEOUT:1502,RECIPIENT_DISCONNECTED:1503,RESPONSE_PAYLOAD_TOO_LARGE:1504,SEND_FAILED:1505,UNSUPPORTED_METHOD:1400,RECIPIENT_NOT_FOUND:1401,REQUEST_PAYLOAD_TOO_LARGE:1402,UNSUPPORTED_SERVER:1403,UNSUPPORTED_VERSION:1404};Mr.ErrorMessage={APPLICATION_ERROR:"Application error in method handler",CONNECTION_TIMEOUT:"Connection timeout",RESPONSE_TIMEOUT:"Response timeout",RECIPIENT_DISCONNECTED:"Recipient disconnected",RESPONSE_PAYLOAD_TOO_LARGE:"Response payload too large",SEND_FAILED:"Failed to send",UNSUPPORTED_METHOD:"Method not supported at destination",RECIPIENT_NOT_FOUND:"Recipient not found",REQUEST_PAYLOAD_TOO_LARGE:"Request payload too large",UNSUPPORTED_SERVER:"RPC not supported by server",UNSUPPORTED_VERSION:"Unsupported RPC version"};const eD=15360;function Nw(n){return new TextEncoder().encode(n).length}function CC(n,e){if(Nw(n)<=e)return n;let t=0,r=n.length;const i=new TextEncoder;for(;t<r;){const s=Math.floor((t+r+1)/2);i.encode(n.slice(0,s)).length<=e?t=s:r=s-1}return n.slice(0,t)}const Lw=2e3;function BO(n,e){if(!e)return 0;let t,r;return"bytesReceived"in n?(t=n.bytesReceived,r=e.bytesReceived):"bytesSent"in n&&(t=n.bytesSent,r=e.bytesSent),t===void 0||r===void 0||n.timestamp===void 0||e.timestamp===void 0?0:(t-r)*8*1e3/(n.timestamp-e.timestamp)}const LB=1e3;class tD extends Me{get sender(){return this._sender}set sender(e){this._sender=e}get constraints(){return this._constraints}constructor(e,t,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,s=arguments.length>4?arguments[4]:void 0;super(e,t,s),this.manuallyStopped=!1,this._isUpstreamPaused=!1,this.handleTrackMuteEvent=()=>this.debouncedTrackMuteHandler().catch(()=>this.log.debug("track mute bounce got cancelled by an unmute event",this.logContext)),this.debouncedTrackMuteHandler=Iw(()=>ie(this,void 0,void 0,function*(){yield this.pauseUpstream()}),5e3),this.handleTrackUnmuteEvent=()=>ie(this,void 0,void 0,function*(){this.debouncedTrackMuteHandler.cancel("unmute"),yield this.resumeUpstream()}),this.handleEnded=()=>{this.isInBackground&&(this.reacquireTrack=!0),this._mediaStreamTrack.removeEventListener("mute",this.handleTrackMuteEvent),this._mediaStreamTrack.removeEventListener("unmute",this.handleTrackUnmuteEvent),this.emit(nt.Ended,this)},this.reacquireTrack=!1,this.providedByUser=i,this.muteLock=new vs,this.pauseUpstreamLock=new vs,this.processorLock=new vs,this.restartLock=new vs,this.setMediaStreamTrack(e,!0),this._constraints=e.getConstraints(),r&&(this._constraints=r)}get id(){return this._mediaStreamTrack.id}get dimensions(){if(this.kind!==Me.Kind.Video)return;const{width:e,height:t}=this._mediaStreamTrack.getSettings();if(e&&t)return{width:e,height:t}}get isUpstreamPaused(){return this._isUpstreamPaused}get isUserProvided(){return this.providedByUser}get mediaStreamTrack(){var e,t;return(t=(e=this.processor)===null||e===void 0?void 0:e.processedTrack)!==null&&t!==void 0?t:this._mediaStreamTrack}get isLocal(){return!0}getSourceTrackSettings(){return this._mediaStreamTrack.getSettings()}setMediaStreamTrack(e,t){return ie(this,void 0,void 0,function*(){var r;if(e===this._mediaStreamTrack&&!t)return;this._mediaStreamTrack&&(this.attachedElements.forEach(s=>{Au(this._mediaStreamTrack,s)}),this.debouncedTrackMuteHandler.cancel("new-track"),this._mediaStreamTrack.removeEventListener("ended",this.handleEnded),this._mediaStreamTrack.removeEventListener("mute",this.handleTrackMuteEvent),this._mediaStreamTrack.removeEventListener("unmute",this.handleTrackUnmuteEvent)),this.mediaStream=new MediaStream([e]),e&&(e.addEventListener("ended",this.handleEnded),e.addEventListener("mute",this.handleTrackMuteEvent),e.addEventListener("unmute",this.handleTrackUnmuteEvent),this._constraints=e.getConstraints());let i;if(this.processor&&e){const s=yield this.processorLock.lock();try{if(this.log.debug("restarting processor",this.logContext),this.kind==="unknown")throw TypeError("cannot set processor on track of unknown kind");this.processorElement&&(xu(e,this.processorElement),this.processorElement.muted=!0),yield this.processor.restart({track:e,kind:this.kind,element:this.processorElement}),i=this.processor.processedTrack}finally{s()}}this.sender&&((r=this.sender.transport)===null||r===void 0?void 0:r.state)!=="closed"&&(yield this.sender.replaceTrack(i??e)),!this.providedByUser&&this._mediaStreamTrack!==e&&this._mediaStreamTrack.stop(),this._mediaStreamTrack=e,e&&(this._mediaStreamTrack.enabled=!this.isMuted,yield this.resumeUpstream(),this.attachedElements.forEach(s=>{xu(i??e,s)}))})}waitForDimensions(){return ie(this,arguments,void 0,function(){var e=this;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:LB;return function*(){var r;if(e.kind===Me.Kind.Audio)throw new Error("cannot get dimensions for audio tracks");((r=Wo())===null||r===void 0?void 0:r.os)==="iOS"&&(yield os(10));const i=Date.now();for(;Date.now()-i<t;){const s=e.dimensions;if(s)return s;yield os(50)}throw new va("unable to get track dimensions after timeout")}()})}setDeviceId(e){return ie(this,void 0,void 0,function*(){return this._constraints.deviceId===e&&this._mediaStreamTrack.getSettings().deviceId===Sl(e)||(this._constraints.deviceId=e,this.isMuted)?!0:(yield this.restartTrack(),Sl(e)===this._mediaStreamTrack.getSettings().deviceId)})}getDeviceId(){return ie(this,arguments,void 0,function(){var e=this;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return function*(){if(e.source===Me.Source.ScreenShare)return;const{deviceId:r,groupId:i}=e._mediaStreamTrack.getSettings(),s=e.kind===Me.Kind.Audio?"audioinput":"videoinput";return t?li.getInstance().normalizeDeviceId(s,r,i):r}()})}mute(){return ie(this,void 0,void 0,function*(){return this.setTrackMuted(!0),this})}unmute(){return ie(this,void 0,void 0,function*(){return this.setTrackMuted(!1),this})}replaceTrack(e,t){return ie(this,void 0,void 0,function*(){if(!this.sender)throw new va("unable to replace an unpublished track");let r,i;return typeof t=="boolean"?r=t:t!==void 0&&(r=t.userProvidedTrack,i=t.stopProcessor),this.providedByUser=r??!0,this.log.debug("replace MediaStreamTrack",this.logContext),yield this.setMediaStreamTrack(e),i&&this.processor&&(yield this.stopProcessor()),this})}restart(e){return ie(this,void 0,void 0,function*(){this.manuallyStopped=!1;const t=yield this.restartLock.lock();try{e||(e=this._constraints);const{deviceId:r}=e,i=RU(e,["deviceId"]);this.log.debug("restarting track with constraints",Object.assign(Object.assign({},this.logContext),{constraints:e}));const s={audio:!1,video:!1};this.kind===Me.Kind.Video?s.video=r?{deviceId:r}:!0:s.audio=r?{deviceId:r}:!0,this.attachedElements.forEach(l=>{Au(this.mediaStreamTrack,l)}),this._mediaStreamTrack.removeEventListener("ended",this.handleEnded),this._mediaStreamTrack.stop();const a=(yield navigator.mediaDevices.getUserMedia(s)).getTracks()[0];return yield a.applyConstraints(i),a.addEventListener("ended",this.handleEnded),this.log.debug("re-acquired MediaStreamTrack",this.logContext),yield this.setMediaStreamTrack(a),this._constraints=e,this.emit(nt.Restarted,this),this.manuallyStopped&&(this.log.warn("track was stopped during a restart, stopping restarted track",this.logContext),this.stop()),this}finally{t()}})}setTrackMuted(e){this.log.debug("setting ".concat(this.kind," track ").concat(e?"muted":"unmuted"),this.logContext),!(this.isMuted===e&&this._mediaStreamTrack.enabled!==e)&&(this.isMuted=e,this._mediaStreamTrack.enabled=!e,this.emit(e?nt.Muted:nt.Unmuted,this))}get needsReAcquisition(){return this._mediaStreamTrack.readyState!=="live"||this._mediaStreamTrack.muted||!this._mediaStreamTrack.enabled||this.reacquireTrack}handleAppVisibilityChanged(){const e=Object.create(null,{handleAppVisibilityChanged:{get:()=>super.handleAppVisibilityChanged}});return ie(this,void 0,void 0,function*(){yield e.handleAppVisibilityChanged.call(this),ZQ()&&(this.log.debug("visibility changed, is in Background: ".concat(this.isInBackground),this.logContext),!this.isInBackground&&this.needsReAcquisition&&!this.isUserProvided&&!this.isMuted&&(this.log.debug("track needs to be reacquired, restarting ".concat(this.source),this.logContext),yield this.restart(),this.reacquireTrack=!1))})}stop(){var e;this.manuallyStopped=!0,super.stop(),this._mediaStreamTrack.removeEventListener("ended",this.handleEnded),this._mediaStreamTrack.removeEventListener("mute",this.handleTrackMuteEvent),this._mediaStreamTrack.removeEventListener("unmute",this.handleTrackUnmuteEvent),(e=this.processor)===null||e===void 0||e.destroy(),this.processor=void 0}pauseUpstream(){return ie(this,void 0,void 0,function*(){var e;const t=yield this.pauseUpstreamLock.lock();try{if(this._isUpstreamPaused===!0)return;if(!this.sender){this.log.warn("unable to pause upstream for an unpublished track",this.logContext);return}this._isUpstreamPaused=!0,this.emit(nt.UpstreamPaused,this);const r=Wo();if((r==null?void 0:r.name)==="Safari"&&Zu(r.version,"12.0")<0)throw new Aw("pauseUpstream is not supported on Safari < 12.");((e=this.sender.transport)===null||e===void 0?void 0:e.state)!=="closed"&&(yield this.sender.replaceTrack(null))}finally{t()}})}resumeUpstream(){return ie(this,void 0,void 0,function*(){var e;const t=yield this.pauseUpstreamLock.lock();try{if(this._isUpstreamPaused===!1)return;if(!this.sender){this.log.warn("unable to resume upstream for an unpublished track",this.logContext);return}this._isUpstreamPaused=!1,this.emit(nt.UpstreamResumed,this),((e=this.sender.transport)===null||e===void 0?void 0:e.state)!=="closed"&&(yield this.sender.replaceTrack(this.mediaStreamTrack))}finally{t()}})}getRTCStatsReport(){return ie(this,void 0,void 0,function*(){var e;return!((e=this.sender)===null||e===void 0)&&e.getStats?yield this.sender.getStats():void 0})}setProcessor(e){return ie(this,arguments,void 0,function(t){var r=this;let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return function*(){var s;const o=yield r.processorLock.lock();try{r.log.debug("setting up processor",r.logContext);const a=document.createElement(r.kind),l={kind:r.kind,track:r._mediaStreamTrack,element:a,audioContext:r.audioContext};if(yield t.init(l),r.log.debug("processor initialized",r.logContext),r.processor&&(yield r.stopProcessor()),r.kind==="unknown")throw TypeError("cannot set processor on track of unknown kind");if(xu(r._mediaStreamTrack,a),a.muted=!0,a.play().catch(c=>r.log.error("failed to play processor element",Object.assign(Object.assign({},r.logContext),{error:c}))),r.processor=t,r.processorElement=a,r.processor.processedTrack){for(const c of r.attachedElements)c!==r.processorElement&&i&&(Au(r._mediaStreamTrack,c),xu(r.processor.processedTrack,c));yield(s=r.sender)===null||s===void 0?void 0:s.replaceTrack(r.processor.processedTrack)}r.emit(nt.TrackProcessorUpdate,r.processor)}finally{o()}}()})}getProcessor(){return this.processor}stopProcessor(){return ie(this,arguments,void 0,function(){var e=this;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return function*(){var r,i;e.processor&&(e.log.debug("stopping processor",e.logContext),(r=e.processor.processedTrack)===null||r===void 0||r.stop(),yield e.processor.destroy(),e.processor=void 0,t||((i=e.processorElement)===null||i===void 0||i.remove(),e.processorElement=void 0),yield e._mediaStreamTrack.applyConstraints(e._constraints),yield e.setMediaStreamTrack(e._mediaStreamTrack,!0),e.emit(nt.TrackProcessorUpdate))}()})}}class zg extends tD{get enhancedNoiseCancellation(){return this.isKrispNoiseFilterEnabled}constructor(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=arguments.length>3?arguments[3]:void 0,s=arguments.length>4?arguments[4]:void 0;super(e,Me.Kind.Audio,t,r,s),this.stopOnMute=!1,this.isKrispNoiseFilterEnabled=!1,this.monitorSender=()=>ie(this,void 0,void 0,function*(){if(!this.sender){this._currentBitrate=0;return}let o;try{o=yield this.getSenderStats()}catch(a){this.log.error("could not get audio sender stats",Object.assign(Object.assign({},this.logContext),{error:a}));return}o&&this.prevStats&&(this._currentBitrate=BO(o,this.prevStats)),this.prevStats=o}),this.handleKrispNoiseFilterEnable=()=>{this.isKrispNoiseFilterEnabled=!0,this.log.debug("Krisp noise filter enabled",this.logContext),this.emit(nt.AudioTrackFeatureUpdate,this,No.TF_ENHANCED_NOISE_CANCELLATION,!0)},this.handleKrispNoiseFilterDisable=()=>{this.isKrispNoiseFilterEnabled=!1,this.log.debug("Krisp noise filter disabled",this.logContext),this.emit(nt.AudioTrackFeatureUpdate,this,No.TF_ENHANCED_NOISE_CANCELLATION,!1)},this.audioContext=i,this.checkForSilence()}mute(){const e=Object.create(null,{mute:{get:()=>super.mute}});return ie(this,void 0,void 0,function*(){const t=yield this.muteLock.lock();try{return this.isMuted?(this.log.debug("Track already muted",this.logContext),this):(this.source===Me.Source.Microphone&&this.stopOnMute&&!this.isUserProvided&&(this.log.debug("stopping mic track",this.logContext),this._mediaStreamTrack.stop()),yield e.mute.call(this),this)}finally{t()}})}unmute(){const e=Object.create(null,{unmute:{get:()=>super.unmute}});return ie(this,void 0,void 0,function*(){const t=yield this.muteLock.lock();try{if(!this.isMuted)return this.log.debug("Track already unmuted",this.logContext),this;const r=this._constraints.deviceId&&this._mediaStreamTrack.getSettings().deviceId!==Sl(this._constraints.deviceId);return this.source===Me.Source.Microphone&&(this.stopOnMute||this._mediaStreamTrack.readyState==="ended"||r)&&!this.isUserProvided&&(this.log.debug("reacquiring mic track",this.logContext),yield this.restartTrack()),yield e.unmute.call(this),this}finally{t()}})}restartTrack(e){return ie(this,void 0,void 0,function*(){let t;if(e){const r=UO({audio:e});typeof r.audio!="boolean"&&(t=r.audio)}yield this.restart(t)})}restart(e){const t=Object.create(null,{restart:{get:()=>super.restart}});return ie(this,void 0,void 0,function*(){const r=yield t.restart.call(this,e);return this.checkForSilence(),r})}startMonitor(){rs()&&(this.monitorInterval||(this.monitorInterval=setInterval(()=>{this.monitorSender()},Lw)))}setProcessor(e){return ie(this,void 0,void 0,function*(){var t;const r=yield this.processorLock.lock();try{if(!Xo()&&!this.audioContext)throw Error("Audio context needs to be set on LocalAudioTrack in order to enable processors");this.processor&&(yield this.stopProcessor());const i={kind:this.kind,track:this._mediaStreamTrack,audioContext:this.audioContext};this.log.debug("setting up audio processor ".concat(e.name),this.logContext),yield e.init(i),this.processor=e,this.processor.processedTrack&&(yield(t=this.sender)===null||t===void 0?void 0:t.replaceTrack(this.processor.processedTrack),this.processor.processedTrack.addEventListener("enable-lk-krisp-noise-filter",this.handleKrispNoiseFilterEnable),this.processor.processedTrack.addEventListener("disable-lk-krisp-noise-filter",this.handleKrispNoiseFilterDisable)),this.emit(nt.TrackProcessorUpdate,this.processor)}finally{r()}})}setAudioContext(e){this.audioContext=e}getSenderStats(){return ie(this,void 0,void 0,function*(){var e;if(!(!((e=this.sender)===null||e===void 0)&&e.getStats))return;const t=yield this.sender.getStats();let r;return t.forEach(i=>{i.type==="outbound-rtp"&&(r={type:"audio",streamId:i.id,packetsSent:i.packetsSent,packetsLost:i.packetsLost,bytesSent:i.bytesSent,timestamp:i.timestamp,roundTripTime:i.roundTripTime,jitter:i.jitter})}),r})}checkForSilence(){return ie(this,void 0,void 0,function*(){const e=yield GQ(this);return e&&(this.isMuted||this.log.warn("silence detected on local audio track",this.logContext),this.emit(nt.AudioSilenceDetected)),e})}}function nD(n,e,t){switch(n.kind){case"audio":return new zg(n,e,!1,void 0,t);case"video":return new Yg(n,e,!1,t);default:throw new va("unsupported track type: ".concat(n.kind))}}const qB=Object.values(qd),UB=Object.values(BS),BB=Object.values($w),FB=[qd.h180,qd.h360],VB=[BS.h180,BS.h360],ZB=n=>[{scaleResolutionDownBy:2,fps:n.encoding.maxFramerate}].map(t=>{var r,i;return new Wn(Math.floor(n.width/t.scaleResolutionDownBy),Math.floor(n.height/t.scaleResolutionDownBy),Math.max(15e4,Math.floor(n.encoding.maxBitrate/(Math.pow(t.scaleResolutionDownBy,2)*(((r=n.encoding.maxFramerate)!==null&&r!==void 0?r:30)/((i=t.fps)!==null&&i!==void 0?i:30))))),t.fps,n.encoding.priority)}),GS=["q","h","f"];function HS(n,e,t,r){var i,s;let o=r==null?void 0:r.videoEncoding;n&&(o=r==null?void 0:r.screenShareEncoding);const a=r==null?void 0:r.simulcast,l=r==null?void 0:r.scalabilityMode,c=r==null?void 0:r.videoCodec;if(!o&&!a&&!l||!e||!t)return[{}];o||(o=XB(n,e,t,c),kn.debug("using video encoding",o));const u=o.maxFramerate,d=new Wn(e,t,o.maxBitrate,o.maxFramerate,o.priority);if(l&&Ed(c)){const g=new rD(l),O=[];if(g.spatial>3)throw new Error("unsupported scalabilityMode: ".concat(l));const y=Wo();if(Pl()||Xo()||(y==null?void 0:y.name)==="Chrome"&&Zu(y==null?void 0:y.version,"113")<0){const b=g.suffix=="h"?2:3;for(let S=0;S<g.spatial;S+=1)O.push({rid:GS[2-S],maxBitrate:o.maxBitrate/Math.pow(b,S),maxFramerate:d.encoding.maxFramerate});O[0].scalabilityMode=l}else O.push({maxBitrate:o.maxBitrate,maxFramerate:d.encoding.maxFramerate,scalabilityMode:l});return d.encoding.priority&&(O[0].priority=d.encoding.priority,O[0].networkPriority=d.encoding.priority),kn.debug("using svc encoding",{encodings:O}),O}if(!a)return[o];let h=[];n?h=(i=EC(r==null?void 0:r.screenShareSimulcastLayers))!==null&&i!==void 0?i:_C(n,d):h=(s=EC(r==null?void 0:r.videoSimulcastLayers))!==null&&s!==void 0?s:_C(n,d);let m;if(h.length>0){const g=h[0];h.length>1&&([,m]=h);const O=Math.max(e,t);if(O>=960&&m)return o0(e,t,[g,m,d],u);if(O>=480)return o0(e,t,[g,d],u)}return o0(e,t,[d])}function WB(n,e,t){var r,i,s,o;if(!t.backupCodec||t.backupCodec===!0||t.backupCodec.codec===t.videoCodec)return;e!==t.backupCodec.codec&&kn.warn("requested a different codec than specified as backup",{serverRequested:e,backup:t.backupCodec.codec}),t.videoCodec=e,t.videoEncoding=t.backupCodec.encoding;const a=n.mediaStreamTrack.getSettings(),l=(r=a.width)!==null&&r!==void 0?r:(i=n.dimensions)===null||i===void 0?void 0:i.width,c=(s=a.height)!==null&&s!==void 0?s:(o=n.dimensions)===null||o===void 0?void 0:o.height;return n.source===Me.Source.ScreenShare&&t.simulcast&&(t.simulcast=!1),HS(n.source===Me.Source.ScreenShare,l,c,t)}function XB(n,e,t,r){const i=zB(n,e,t);let{encoding:s}=i[0];const o=Math.max(e,t);for(let a=0;a<i.length;a+=1){const l=i[a];if(s=l.encoding,l.width>=o)break}if(r)switch(r){case"av1":s=Object.assign({},s),s.maxBitrate=s.maxBitrate*.7;break;case"vp9":s=Object.assign({},s),s.maxBitrate=s.maxBitrate*.85;break}return s}function zB(n,e,t){if(n)return BB;const r=e>t?e/t:t/e;return Math.abs(r-16/9)<Math.abs(r-4/3)?qB:UB}function _C(n,e){if(n)return ZB(e);const{width:t,height:r}=e,i=t>r?t/r:r/t;return Math.abs(i-16/9)<Math.abs(i-4/3)?FB:VB}function o0(n,e,t,r){const i=[];if(t.forEach((s,o)=>{if(o>=GS.length)return;const a=Math.min(n,e),c={rid:GS[o],scaleResolutionDownBy:Math.max(1,a/Math.min(s.width,s.height)),maxBitrate:s.encoding.maxBitrate},u=r&&s.encoding.maxFramerate?Math.min(r,s.encoding.maxFramerate):s.encoding.maxFramerate;u&&(c.maxFramerate=u);const d=Vu()||o===0;s.encoding.priority&&d&&(c.priority=s.encoding.priority,c.networkPriority=s.encoding.priority),i.push(c)}),Xo()&&XQ()==="ios"){let s;i.forEach(a=>{s?a.maxFramerate&&a.maxFramerate>s&&(s=a.maxFramerate):s=a.maxFramerate});let o=!0;i.forEach(a=>{var l;a.maxFramerate!=s&&(o&&(o=!1,kn.info("Simulcast on iOS React-Native requires all encodings to share the same framerate.")),kn.info('Setting framerate of encoding "'.concat((l=a.rid)!==null&&l!==void 0?l:"",'" to ').concat(s)),a.maxFramerate=s)})}return i}function EC(n){if(n)return n.sort((e,t)=>{const{encoding:r}=e,{encoding:i}=t;return r.maxBitrate>i.maxBitrate?1:r.maxBitrate<i.maxBitrate?-1:r.maxBitrate===i.maxBitrate&&r.maxFramerate&&i.maxFramerate?r.maxFramerate>i.maxFramerate?1:-1:0})}class rD{constructor(e){const t=e.match(/^L(\d)T(\d)(h|_KEY|_KEY_SHIFT){0,1}$/);if(!t)throw new Error("invalid scalability mode");if(this.spatial=parseInt(t[1]),this.temporal=parseInt(t[2]),t.length>3)switch(t[3]){case"h":case"_KEY":case"_KEY_SHIFT":this.suffix=t[3]}}toString(){var e;return"L".concat(this.spatial,"T").concat(this.temporal).concat((e=this.suffix)!==null&&e!==void 0?e:"")}}function YB(n){return n.source===Me.Source.ScreenShare||n.constraints.height&&Sl(n.constraints.height)>=1080?"maintain-resolution":"balanced"}const GB=5e3;class Yg extends tD{get sender(){return this._sender}set sender(e){this._sender=e,this.degradationPreference&&this.setDegradationPreference(this.degradationPreference)}constructor(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=arguments.length>3?arguments[3]:void 0;super(e,Me.Kind.Video,t,r,i),this.simulcastCodecs=new Map,this.degradationPreference="balanced",this.monitorSender=()=>ie(this,void 0,void 0,function*(){if(!this.sender){this._currentBitrate=0;return}let s;try{s=yield this.getSenderStats()}catch(a){this.log.error("could not get audio sender stats",Object.assign(Object.assign({},this.logContext),{error:a}));return}const o=new Map(s.map(a=>[a.rid,a]));if(this.prevStats){let a=0;o.forEach((l,c)=>{var u;const d=(u=this.prevStats)===null||u===void 0?void 0:u.get(c);a+=BO(l,d)}),this._currentBitrate=a}this.prevStats=o}),this.senderLock=new vs}get isSimulcast(){return!!(this.sender&&this.sender.getParameters().encodings.length>1)}startMonitor(e){var t;if(this.signalClient=e,!rs())return;const r=(t=this.sender)===null||t===void 0?void 0:t.getParameters();r&&(this.encodings=r.encodings),!this.monitorInterval&&(this.monitorInterval=setInterval(()=>{this.monitorSender()},Lw))}stop(){this._mediaStreamTrack.getConstraints(),this.simulcastCodecs.forEach(e=>{e.mediaStreamTrack.stop()}),super.stop()}pauseUpstream(){const e=Object.create(null,{pauseUpstream:{get:()=>super.pauseUpstream}});return ie(this,void 0,void 0,function*(){var t,r,i,s,o;yield e.pauseUpstream.call(this);try{for(var a=!0,l=ul(this.simulcastCodecs.values()),c;c=yield l.next(),t=c.done,!t;a=!0)s=c.value,a=!1,yield(o=s.sender)===null||o===void 0?void 0:o.replaceTrack(null)}catch(u){r={error:u}}finally{try{!a&&!t&&(i=l.return)&&(yield i.call(l))}finally{if(r)throw r.error}}})}resumeUpstream(){const e=Object.create(null,{resumeUpstream:{get:()=>super.resumeUpstream}});return ie(this,void 0,void 0,function*(){var t,r,i,s,o;yield e.resumeUpstream.call(this);try{for(var a=!0,l=ul(this.simulcastCodecs.values()),c;c=yield l.next(),t=c.done,!t;a=!0){s=c.value,a=!1;const u=s;yield(o=u.sender)===null||o===void 0?void 0:o.replaceTrack(u.mediaStreamTrack)}}catch(u){r={error:u}}finally{try{!a&&!t&&(i=l.return)&&(yield i.call(l))}finally{if(r)throw r.error}}})}mute(){const e=Object.create(null,{mute:{get:()=>super.mute}});return ie(this,void 0,void 0,function*(){const t=yield this.muteLock.lock();try{return this.isMuted?(this.log.debug("Track already muted",this.logContext),this):(this.source===Me.Source.Camera&&!this.isUserProvided&&(this.log.debug("stopping camera track",this.logContext),this._mediaStreamTrack.stop()),yield e.mute.call(this),this)}finally{t()}})}unmute(){const e=Object.create(null,{unmute:{get:()=>super.unmute}});return ie(this,void 0,void 0,function*(){const t=yield this.muteLock.lock();try{return this.isMuted?(this.source===Me.Source.Camera&&!this.isUserProvided&&(this.log.debug("reacquiring camera track",this.logContext),yield this.restartTrack()),yield e.unmute.call(this),this):(this.log.debug("Track already unmuted",this.logContext),this)}finally{t()}})}setTrackMuted(e){super.setTrackMuted(e);for(const t of this.simulcastCodecs.values())t.mediaStreamTrack.enabled=!e}getSenderStats(){return ie(this,void 0,void 0,function*(){var e;if(!(!((e=this.sender)===null||e===void 0)&&e.getStats))return[];const t=[],r=yield this.sender.getStats();return r.forEach(i=>{var s;if(i.type==="outbound-rtp"){const o={type:"video",streamId:i.id,frameHeight:i.frameHeight,frameWidth:i.frameWidth,framesPerSecond:i.framesPerSecond,framesSent:i.framesSent,firCount:i.firCount,pliCount:i.pliCount,nackCount:i.nackCount,packetsSent:i.packetsSent,bytesSent:i.bytesSent,qualityLimitationReason:i.qualityLimitationReason,qualityLimitationDurations:i.qualityLimitationDurations,qualityLimitationResolutionChanges:i.qualityLimitationResolutionChanges,rid:(s=i.rid)!==null&&s!==void 0?s:i.id,retransmittedPacketsSent:i.retransmittedPacketsSent,targetBitrate:i.targetBitrate,timestamp:i.timestamp},a=r.get(i.remoteId);a&&(o.jitter=a.jitter,o.packetsLost=a.packetsLost,o.roundTripTime=a.roundTripTime),t.push(o)}}),t.sort((i,s)=>{var o,a;return((o=s.frameWidth)!==null&&o!==void 0?o:0)-((a=i.frameWidth)!==null&&a!==void 0?a:0)}),t})}setPublishingQuality(e){const t=[];for(let r=Ms.LOW;r<=Ms.HIGH;r+=1)t.push(new _w({quality:r,enabled:r<=e}));this.log.debug("setting publishing quality. max quality ".concat(e),this.logContext),this.setPublishingLayers(t)}restartTrack(e){return ie(this,void 0,void 0,function*(){var t,r,i,s,o;let a;if(e){const d=UO({video:e});typeof d.video!="boolean"&&(a=d.video)}yield this.restart(a);try{for(var l=!0,c=ul(this.simulcastCodecs.values()),u;u=yield c.next(),t=u.done,!t;l=!0){s=u.value,l=!1;const d=s;d.sender&&((o=d.sender.transport)===null||o===void 0?void 0:o.state)!=="closed"&&(d.mediaStreamTrack=this.mediaStreamTrack.clone(),yield d.sender.replaceTrack(d.mediaStreamTrack))}}catch(d){r={error:d}}finally{try{!l&&!t&&(i=c.return)&&(yield i.call(c))}finally{if(r)throw r.error}}})}setProcessor(e){const t=Object.create(null,{setProcessor:{get:()=>super.setProcessor}});return ie(this,arguments,void 0,function(r){var i=this;let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return function*(){var o,a,l,c,u,d;if(yield t.setProcessor.call(i,r,s),!((u=i.processor)===null||u===void 0)&&u.processedTrack)try{for(var h=!0,m=ul(i.simulcastCodecs.values()),g;g=yield m.next(),o=g.done,!o;h=!0)c=g.value,h=!1,yield(d=c.sender)===null||d===void 0?void 0:d.replaceTrack(i.processor.processedTrack)}catch(O){a={error:O}}finally{try{!h&&!o&&(l=m.return)&&(yield l.call(m))}finally{if(a)throw a.error}}}()})}setDegradationPreference(e){return ie(this,void 0,void 0,function*(){if(this.degradationPreference=e,this.sender)try{this.log.debug("setting degradationPreference to ".concat(e),this.logContext);const t=this.sender.getParameters();t.degradationPreference=e,this.sender.setParameters(t)}catch(t){this.log.warn("failed to set degradationPreference",Object.assign({error:t},this.logContext))}})}addSimulcastTrack(e,t){if(this.simulcastCodecs.has(e)){this.log.error("".concat(e," already added, skipping adding simulcast codec"),this.logContext);return}const r={codec:e,mediaStreamTrack:this.mediaStreamTrack.clone(),sender:void 0,encodings:t};return this.simulcastCodecs.set(e,r),r}setSimulcastTrackSender(e,t){const r=this.simulcastCodecs.get(e);r&&(r.sender=t,setTimeout(()=>{this.subscribedCodecs&&this.setPublishingCodecs(this.subscribedCodecs)},GB))}setPublishingCodecs(e){return ie(this,void 0,void 0,function*(){var t,r,i,s,o,a,l;if(this.log.debug("setting publishing codecs",Object.assign(Object.assign({},this.logContext),{codecs:e,currentCodec:this.codec})),!this.codec&&e.length>0)return yield this.setPublishingLayers(e[0].qualities),[];this.subscribedCodecs=e;const c=[];try{for(t=!0,r=ul(e);i=yield r.next(),s=i.done,!s;t=!0){l=i.value,t=!1;const u=l;if(!this.codec||this.codec===u.codec)yield this.setPublishingLayers(u.qualities);else{const d=this.simulcastCodecs.get(u.codec);if(this.log.debug("try setPublishingCodec for ".concat(u.codec),Object.assign(Object.assign({},this.logContext),{simulcastCodecInfo:d})),!d||!d.sender){for(const h of u.qualities)if(h.enabled){c.push(u.codec);break}}else d.encodings&&(this.log.debug("try setPublishingLayersForSender ".concat(u.codec),this.logContext),yield RC(d.sender,d.encodings,u.qualities,this.senderLock,this.log,this.logContext))}}}catch(u){o={error:u}}finally{try{!t&&!s&&(a=r.return)&&(yield a.call(r))}finally{if(o)throw o.error}}return c})}setPublishingLayers(e){return ie(this,void 0,void 0,function*(){this.log.debug("setting publishing layers",Object.assign(Object.assign({},this.logContext),{qualities:e})),!(!this.sender||!this.encodings)&&(yield RC(this.sender,this.encodings,e,this.senderLock,this.log,this.logContext))})}handleAppVisibilityChanged(){const e=Object.create(null,{handleAppVisibilityChanged:{get:()=>super.handleAppVisibilityChanged}});return ie(this,void 0,void 0,function*(){yield e.handleAppVisibilityChanged.call(this),ZQ()&&this.isInBackground&&this.source===Me.Source.Camera&&(this._mediaStreamTrack.enabled=!1)})}}function RC(n,e,t,r,i,s){return ie(this,void 0,void 0,function*(){const o=yield r.lock();i.debug("setPublishingLayersForSender",Object.assign(Object.assign({},s),{sender:n,qualities:t,senderEncodings:e}));try{const a=n.getParameters(),{encodings:l}=a;if(!l)return;if(l.length!==e.length){i.warn("cannot set publishing layers, encodings mismatch",Object.assign(Object.assign({},s),{encodings:l,senderEncodings:e}));return}let c=!1;!1&&l[0].scalabilityMode||l.forEach((d,h)=>{var m;let g=(m=d.rid)!==null&&m!==void 0?m:"";g===""&&(g="q");const O=iD(g),y=t.find(b=>b.quality===O);y&&d.active!==y.enabled&&(c=!0,d.active=y.enabled,i.debug("setting layer ".concat(y.quality," to ").concat(d.active?"enabled":"disabled"),s),Vu()&&(y.enabled?(d.scaleResolutionDownBy=e[h].scaleResolutionDownBy,d.maxBitrate=e[h].maxBitrate,d.maxFrameRate=e[h].maxFrameRate):(d.scaleResolutionDownBy=4,d.maxBitrate=10,d.maxFrameRate=2)))}),c&&(a.encodings=l,i.debug("setting encodings",Object.assign(Object.assign({},s),{encodings:a.encodings})),yield n.setParameters(a))}finally{o()}})}function iD(n){switch(n){case"f":return Ms.HIGH;case"h":return Ms.MEDIUM;case"q":return Ms.LOW;default:return Ms.HIGH}}function AC(n,e,t,r){if(!t)return[new bc({quality:Ms.HIGH,width:n,height:e,bitrate:0,ssrc:0})];if(r){const i=t[0].scalabilityMode,s=new rD(i),o=[],a=s.suffix=="h"?1.5:2,l=s.suffix=="h"?2:3;for(let c=0;c<s.spatial;c+=1)o.push(new bc({quality:Math.min(Ms.HIGH,s.spatial-1)-c,width:Math.ceil(n/Math.pow(a,c)),height:Math.ceil(e/Math.pow(a,c)),bitrate:t[0].maxBitrate?Math.ceil(t[0].maxBitrate/Math.pow(l,c)):0,ssrc:0}));return o}return t.map(i=>{var s,o,a;const l=(s=i.scaleResolutionDownBy)!==null&&s!==void 0?s:1;let c=iD((o=i.rid)!==null&&o!==void 0?o:"");return new bc({quality:c,width:Math.ceil(n/l),height:Math.ceil(e/l),bitrate:(a=i.maxBitrate)!==null&&a!==void 0?a:0,ssrc:0})})}const $C="_lossy",MC="_reliable",HB=2*1e3,a0="leave-reconnect";var so;(function(n){n[n.New=0]="New",n[n.Connected=1]="Connected",n[n.Disconnected=2]="Disconnected",n[n.Reconnecting=3]="Reconnecting",n[n.Closed=4]="Closed"})(so||(so={}));class KB extends Yo.EventEmitter{get isClosed(){return this._isClosed}get pendingReconnect(){return!!this.reconnectTimeout}constructor(e){var t;super(),this.options=e,this.rtcConfig={},this.peerConnectionTimeout=jw.peerConnectionTimeout,this.fullReconnectOnNext=!1,this.subscriberPrimary=!1,this.pcState=so.New,this._isClosed=!0,this.pendingTrackResolvers={},this.reconnectAttempts=0,this.reconnectStart=0,this.attemptingReconnect=!1,this.joinAttempts=0,this.maxJoinAttempts=1,this.shouldFailNext=!1,this.log=kn,this.handleDataChannel=r=>ie(this,[r],void 0,function(i){var s=this;let{channel:o}=i;return function*(){if(o){if(o.label===MC)s.reliableDCSub=o;else if(o.label===$C)s.lossyDCSub=o;else return;s.log.debug("on data channel ".concat(o.id,", ").concat(o.label),s.logContext),o.onmessage=s.handleDataMessage}}()}),this.handleDataMessage=r=>ie(this,void 0,void 0,function*(){var i,s;const o=yield this.dataProcessLock.lock();try{let a;if(r.data instanceof ArrayBuffer)a=r.data;else if(r.data instanceof Blob)a=yield r.data.arrayBuffer();else{this.log.error("unsupported data type",Object.assign(Object.assign({},this.logContext),{data:r.data}));return}const l=Hi.fromBinary(new Uint8Array(a));((i=l.value)===null||i===void 0?void 0:i.case)==="speaker"?this.emit(lt.ActiveSpeakersUpdate,l.value.value.speakers):(((s=l.value)===null||s===void 0?void 0:s.case)==="user"&&eF(l,l.value.value),this.emit(lt.DataPacketReceived,l))}finally{o()}}),this.handleDataError=r=>{const s=r.currentTarget.maxRetransmits===0?"lossy":"reliable";if(r instanceof ErrorEvent&&r.error){const{error:o}=r.error;this.log.error("DataChannel error on ".concat(s,": ").concat(r.message),Object.assign(Object.assign({},this.logContext),{error:o}))}else this.log.error("Unknown DataChannel error on ".concat(s),Object.assign(Object.assign({},this.logContext),{event:r}))},this.handleBufferedAmountLow=r=>{const s=r.currentTarget.maxRetransmits===0?$n.LOSSY:$n.RELIABLE;this.updateAndEmitDCBufferStatus(s)},this.handleDisconnect=(r,i)=>{if(this._isClosed)return;this.log.warn("".concat(r," disconnected"),this.logContext),this.reconnectAttempts===0&&(this.reconnectStart=Date.now());const s=l=>{this.log.warn("could not recover connection after ".concat(this.reconnectAttempts," attempts, ").concat(l,"ms. giving up"),this.logContext),this.emit(lt.Disconnected),this.close()},o=Date.now()-this.reconnectStart;let a=this.getNextRetryDelay({elapsedMs:o,retryCount:this.reconnectAttempts});if(a===null){s(o);return}r===a0&&(a=0),this.log.debug("reconnecting in ".concat(a,"ms"),this.logContext),this.clearReconnectTimeout(),this.token&&this.regionUrlProvider&&this.regionUrlProvider.updateToken(this.token),this.reconnectTimeout=Oi.setTimeout(()=>this.attemptReconnect(i).finally(()=>this.reconnectTimeout=void 0),a)},this.waitForRestarted=()=>new Promise((r,i)=>{this.pcState===so.Connected&&r();const s=()=>{this.off(lt.Disconnected,o),r()},o=()=>{this.off(lt.Restarted,s),i()};this.once(lt.Restarted,s),this.once(lt.Disconnected,o)}),this.updateAndEmitDCBufferStatus=r=>{const i=this.isBufferStatusLow(r);typeof i<"u"&&i!==this.dcBufferStatus.get(r)&&(this.dcBufferStatus.set(r,i),this.emit(lt.DCBufferStatusChanged,i,r))},this.isBufferStatusLow=r=>{const i=this.dataChannelForKind(r);if(i)return i.bufferedAmount<=i.bufferedAmountLowThreshold},this.handleBrowserOnLine=()=>{this.client.currentState===vr.RECONNECTING&&(this.clearReconnectTimeout(),this.attemptReconnect(iu.RR_SIGNAL_DISCONNECTED))},this.log=ka((t=e.loggerName)!==null&&t!==void 0?t:uo.Engine),this.loggerOptions={loggerName:e.loggerName,loggerContextCb:()=>this.logContext},this.client=new Qw(void 0,this.loggerOptions),this.client.signalLatency=this.options.expSignalLatency,this.reconnectPolicy=this.options.reconnectPolicy,this.registerOnLineListener(),this.closingLock=new vs,this.dataProcessLock=new vs,this.dcBufferStatus=new Map([[$n.LOSSY,!0],[$n.RELIABLE,!0]]),this.client.onParticipantUpdate=r=>this.emit(lt.ParticipantUpdate,r),this.client.onConnectionQuality=r=>this.emit(lt.ConnectionQualityUpdate,r),this.client.onRoomUpdate=r=>this.emit(lt.RoomUpdate,r),this.client.onSubscriptionError=r=>this.emit(lt.SubscriptionError,r),this.client.onSubscriptionPermissionUpdate=r=>this.emit(lt.SubscriptionPermissionUpdate,r),this.client.onSpeakersChanged=r=>this.emit(lt.SpeakersChanged,r),this.client.onStreamStateUpdate=r=>this.emit(lt.StreamStateChanged,r),this.client.onRequestResponse=r=>this.emit(lt.SignalRequestResponse,r)}get logContext(){var e,t,r,i,s,o,a,l;return{room:(t=(e=this.latestJoinResponse)===null||e===void 0?void 0:e.room)===null||t===void 0?void 0:t.name,roomID:(i=(r=this.latestJoinResponse)===null||r===void 0?void 0:r.room)===null||i===void 0?void 0:i.sid,participant:(o=(s=this.latestJoinResponse)===null||s===void 0?void 0:s.participant)===null||o===void 0?void 0:o.identity,pID:(l=(a=this.latestJoinResponse)===null||a===void 0?void 0:a.participant)===null||l===void 0?void 0:l.sid}}join(e,t,r,i){return ie(this,void 0,void 0,function*(){this.url=e,this.token=t,this.signalOpts=r,this.maxJoinAttempts=r.maxRetries;try{this.joinAttempts+=1,this.setupSignalClientCallbacks();const s=yield this.client.join(e,t,r,i);return this._isClosed=!1,this.latestJoinResponse=s,this.subscriberPrimary=s.subscriberPrimary,this.pcManager||(yield this.configure(s)),(!this.subscriberPrimary||s.fastPublish)&&this.negotiate(),this.clientConfiguration=s.clientConfiguration,s}catch(s){if(s instanceof Jn&&s.reason===_n.ServerUnreachable&&(this.log.warn("Couldn't connect to server, attempt ".concat(this.joinAttempts," of ").concat(this.maxJoinAttempts),this.logContext),this.joinAttempts<this.maxJoinAttempts))return this.join(e,t,r,i);throw s}})}close(){return ie(this,void 0,void 0,function*(){const e=yield this.closingLock.lock();if(this.isClosed){e();return}try{this._isClosed=!0,this.joinAttempts=0,this.emit(lt.Closing),this.removeAllListeners(),this.deregisterOnLineListener(),this.clearPendingReconnect(),yield this.cleanupPeerConnections(),yield this.cleanupClient()}finally{e()}})}cleanupPeerConnections(){return ie(this,void 0,void 0,function*(){var e;yield(e=this.pcManager)===null||e===void 0?void 0:e.close(),this.pcManager=void 0;const t=r=>{r&&(r.close(),r.onbufferedamountlow=null,r.onclose=null,r.onclosing=null,r.onerror=null,r.onmessage=null,r.onopen=null)};t(this.lossyDC),t(this.lossyDCSub),t(this.reliableDC),t(this.reliableDCSub),this.lossyDC=void 0,this.lossyDCSub=void 0,this.reliableDC=void 0,this.reliableDCSub=void 0})}cleanupClient(){return ie(this,void 0,void 0,function*(){yield this.client.close(),this.client.resetCallbacks()})}addTrack(e){if(this.pendingTrackResolvers[e.cid])throw new va("a track with the same ID has already been published");return new Promise((t,r)=>{const i=setTimeout(()=>{delete this.pendingTrackResolvers[e.cid],r(new Jn("publication of local track timed out, no response from server",_n.InternalError))},1e4);this.pendingTrackResolvers[e.cid]={resolve:s=>{clearTimeout(i),t(s)},reject:()=>{clearTimeout(i),r(new Error("Cancelled publication by calling unpublish"))}},this.client.sendAddTrack(e)})}removeTrack(e){if(e.track&&this.pendingTrackResolvers[e.track.id]){const{reject:t}=this.pendingTrackResolvers[e.track.id];t&&t(),delete this.pendingTrackResolvers[e.track.id]}try{return this.pcManager.removeTrack(e),!0}catch(t){this.log.warn("failed to remove track",Object.assign(Object.assign({},this.logContext),{error:t}))}return!1}updateMuteStatus(e,t){this.client.sendMuteTrack(e,t)}get dataSubscriberReadyState(){var e;return(e=this.reliableDCSub)===null||e===void 0?void 0:e.readyState}getConnectedServerAddress(){return ie(this,void 0,void 0,function*(){var e;return(e=this.pcManager)===null||e===void 0?void 0:e.getConnectedAddress()})}setRegionUrlProvider(e){this.regionUrlProvider=e}configure(e){return ie(this,void 0,void 0,function*(){var t,r;if(this.pcManager&&this.pcManager.currentState!==Ar.NEW)return;this.participantSid=(t=e.participant)===null||t===void 0?void 0:t.sid;const i=this.makeRTCConfiguration(e);this.pcManager=new NB(i,e.subscriberPrimary,this.loggerOptions),this.emit(lt.TransportsCreated,this.pcManager.publisher,this.pcManager.subscriber),this.pcManager.onIceCandidate=(s,o)=>{this.client.sendIceCandidate(s,o)},this.pcManager.onPublisherOffer=s=>{this.client.sendOffer(s)},this.pcManager.onDataChannel=this.handleDataChannel,this.pcManager.onStateChange=(s,o,a)=>ie(this,void 0,void 0,function*(){if(this.log.debug("primary PC state changed ".concat(s),this.logContext),["closed","disconnected","failed"].includes(o)&&(this.publisherConnectionPromise=void 0),s===Ar.CONNECTED){const u=this.pcState===so.New;this.pcState=so.Connected,u&&this.emit(lt.Connected,e)}else s===Ar.FAILED&&this.pcState===so.Connected&&(this.pcState=so.Disconnected,this.handleDisconnect("peerconnection failed",a==="failed"?iu.RR_SUBSCRIBER_FAILED:iu.RR_PUBLISHER_FAILED));const l=this.client.isDisconnected||this.client.currentState===vr.RECONNECTING,c=[Ar.FAILED,Ar.CLOSING,Ar.CLOSED].includes(s);l&&c&&!this._isClosed&&this.emit(lt.Offline)}),this.pcManager.onTrack=s=>{this.emit(lt.MediaTrackAdded,s.track,s.streams[0],s.receiver)},JB((r=e.serverInfo)===null||r===void 0?void 0:r.protocol)||this.createDataChannels()})}setupSignalClientCallbacks(){this.client.onAnswer=e=>ie(this,void 0,void 0,function*(){this.pcManager&&(this.log.debug("received server answer",Object.assign(Object.assign({},this.logContext),{RTCSdpType:e.type})),yield this.pcManager.setPublisherAnswer(e))}),this.client.onTrickle=(e,t)=>{this.pcManager&&(this.log.debug("got ICE candidate from peer",Object.assign(Object.assign({},this.logContext),{candidate:e,target:t})),this.pcManager.addIceCandidate(e,t))},this.client.onOffer=e=>ie(this,void 0,void 0,function*(){if(!this.pcManager)return;const t=yield this.pcManager.createSubscriberAnswerFromOffer(e);this.client.sendAnswer(t)}),this.client.onLocalTrackPublished=e=>{var t;if(this.log.debug("received trackPublishedResponse",Object.assign(Object.assign({},this.logContext),{cid:e.cid,track:(t=e.track)===null||t===void 0?void 0:t.sid})),!this.pendingTrackResolvers[e.cid]){this.log.error("missing track resolver for ".concat(e.cid),Object.assign(Object.assign({},this.logContext),{cid:e.cid}));return}const{resolve:r}=this.pendingTrackResolvers[e.cid];delete this.pendingTrackResolvers[e.cid],r(e.track)},this.client.onLocalTrackUnpublished=e=>{this.emit(lt.LocalTrackUnpublished,e)},this.client.onLocalTrackSubscribed=e=>{this.emit(lt.LocalTrackSubscribed,e)},this.client.onTokenRefresh=e=>{this.token=e},this.client.onRemoteMuteChanged=(e,t)=>{this.emit(lt.RemoteMute,e,t)},this.client.onSubscribedQualityUpdate=e=>{this.emit(lt.SubscribedQualityUpdate,e)},this.client.onClose=()=>{this.handleDisconnect("signal",iu.RR_SIGNAL_DISCONNECTED)},this.client.onLeave=e=>{switch(this.log.debug("client leave request",Object.assign(Object.assign({},this.logContext),{reason:e==null?void 0:e.reason})),e.regions&&this.regionUrlProvider&&(this.log.debug("updating regions",this.logContext),this.regionUrlProvider.setServerReportedRegions(e.regions)),e.action){case Eu.DISCONNECT:this.emit(lt.Disconnected,e==null?void 0:e.reason),this.close();break;case Eu.RECONNECT:this.fullReconnectOnNext=!0,this.handleDisconnect(a0);break;case Eu.RESUME:this.handleDisconnect(a0)}}}makeRTCConfiguration(e){var t;const r=Object.assign({},this.rtcConfig);if(!((t=this.signalOpts)===null||t===void 0)&&t.e2eeEnabled&&(this.log.debug("E2EE - setting up transports with insertable streams",this.logContext),r.encodedInsertableStreams=!0),e.iceServers&&!r.iceServers){const i=[];e.iceServers.forEach(s=>{const o={urls:s.urls};s.username&&(o.username=s.username),s.credential&&(o.credential=s.credential),i.push(o)}),r.iceServers=i}return e.clientConfiguration&&e.clientConfiguration.forceRelay===jd.ENABLED&&(r.iceTransportPolicy="relay"),r.sdpSemantics="unified-plan",r.continualGatheringPolicy="gather_continually",r}createDataChannels(){this.pcManager&&(this.lossyDC&&(this.lossyDC.onmessage=null,this.lossyDC.onerror=null),this.reliableDC&&(this.reliableDC.onmessage=null,this.reliableDC.onerror=null),this.lossyDC=this.pcManager.createPublisherDataChannel($C,{ordered:!0,maxRetransmits:0}),this.reliableDC=this.pcManager.createPublisherDataChannel(MC,{ordered:!0}),this.lossyDC.onmessage=this.handleDataMessage,this.reliableDC.onmessage=this.handleDataMessage,this.lossyDC.onerror=this.handleDataError,this.reliableDC.onerror=this.handleDataError,this.lossyDC.bufferedAmountLowThreshold=65535,this.reliableDC.bufferedAmountLowThreshold=65535,this.lossyDC.onbufferedamountlow=this.handleBufferedAmountLow,this.reliableDC.onbufferedamountlow=this.handleBufferedAmountLow)}createSender(e,t,r){return ie(this,void 0,void 0,function*(){if(FS())return yield this.createTransceiverRTCRtpSender(e,t,r);if(VS())return this.log.warn("using add-track fallback",this.logContext),yield this.createRTCRtpSender(e.mediaStreamTrack);throw new Gr("Required webRTC APIs not supported on this device")})}createSimulcastSender(e,t,r,i){return ie(this,void 0,void 0,function*(){if(FS())return this.createSimulcastTransceiverSender(e,t,r,i);if(VS())return this.log.debug("using add-track fallback",this.logContext),this.createRTCRtpSender(e.mediaStreamTrack);throw new Gr("Cannot stream on this device")})}createTransceiverRTCRtpSender(e,t,r){return ie(this,void 0,void 0,function*(){if(!this.pcManager)throw new Gr("publisher is closed");const i=[];e.mediaStream&&i.push(e.mediaStream),lf(e)&&(e.codec=t.videoCodec);const s={direction:"sendonly",streams:i};return r&&(s.sendEncodings=r),(yield this.pcManager.addPublisherTransceiver(e.mediaStreamTrack,s)).sender})}createSimulcastTransceiverSender(e,t,r,i){return ie(this,void 0,void 0,function*(){if(!this.pcManager)throw new Gr("publisher is closed");const s={direction:"sendonly"};i&&(s.sendEncodings=i);const o=yield this.pcManager.addPublisherTransceiver(t.mediaStreamTrack,s);if(r.videoCodec)return e.setSimulcastTrackSender(r.videoCodec,o.sender),o.sender})}createRTCRtpSender(e){return ie(this,void 0,void 0,function*(){if(!this.pcManager)throw new Gr("publisher is closed");return this.pcManager.addPublisherTrack(e)})}attemptReconnect(e){return ie(this,void 0,void 0,function*(){var t,r,i;if(!this._isClosed){if(this.attemptingReconnect){kn.warn("already attempting reconnect, returning early",this.logContext);return}(((t=this.clientConfiguration)===null||t===void 0?void 0:t.resumeConnection)===jd.DISABLED||((i=(r=this.pcManager)===null||r===void 0?void 0:r.currentState)!==null&&i!==void 0?i:Ar.NEW)===Ar.NEW)&&(this.fullReconnectOnNext=!0);try{this.attemptingReconnect=!0,this.fullReconnectOnNext?yield this.restartConnection():yield this.resumeConnection(e),this.clearPendingReconnect(),this.fullReconnectOnNext=!1}catch(s){this.reconnectAttempts+=1;let o=!0;s instanceof Gr?(this.log.debug("received unrecoverable error",Object.assign(Object.assign({},this.logContext),{error:s})),o=!1):s instanceof su||(this.fullReconnectOnNext=!0),o?this.handleDisconnect("reconnect",iu.RR_UNKNOWN):(this.log.info("could not recover connection after ".concat(this.reconnectAttempts," attempts, ").concat(Date.now()-this.reconnectStart,"ms. giving up"),this.logContext),this.emit(lt.Disconnected),yield this.close())}finally{this.attemptingReconnect=!1}}})}getNextRetryDelay(e){try{return this.reconnectPolicy.nextRetryDelayInMs(e)}catch(t){this.log.warn("encountered error in reconnect policy",Object.assign(Object.assign({},this.logContext),{error:t}))}return null}restartConnection(e){return ie(this,void 0,void 0,function*(){var t,r,i;try{if(!this.url||!this.token)throw new Gr("could not reconnect, url or token not saved");this.log.info("reconnecting, attempt: ".concat(this.reconnectAttempts),this.logContext),this.emit(lt.Restarting),this.client.isDisconnected||(yield this.client.sendLeave()),yield this.cleanupPeerConnections(),yield this.cleanupClient();let s;try{if(!this.signalOpts)throw this.log.warn("attempted connection restart, without signal options present",this.logContext),new su;s=yield this.join(e??this.url,this.token,this.signalOpts)}catch(o){throw o instanceof Jn&&o.reason===_n.NotAllowed?new Gr("could not reconnect, token might be expired"):new su}if(this.shouldFailNext)throw this.shouldFailNext=!1,new Error("simulated failure");if(this.client.setReconnected(),this.emit(lt.SignalRestarted,s),yield this.waitForPCReconnected(),this.client.currentState!==vr.CONNECTED)throw new su("Signal connection got severed during reconnect");(t=this.regionUrlProvider)===null||t===void 0||t.resetAttempts(),this.emit(lt.Restarted)}catch(s){const o=yield(r=this.regionUrlProvider)===null||r===void 0?void 0:r.getNextBestRegionUrl();if(o){yield this.restartConnection(o);return}else throw(i=this.regionUrlProvider)===null||i===void 0||i.resetAttempts(),s}})}resumeConnection(e){return ie(this,void 0,void 0,function*(){var t;if(!this.url||!this.token)throw new Gr("could not reconnect, url or token not saved");if(!this.pcManager)throw new Gr("publisher and subscriber connections unset");this.log.info("resuming signal connection, attempt ".concat(this.reconnectAttempts),this.logContext),this.emit(lt.Resuming);let r;try{this.setupSignalClientCallbacks(),r=yield this.client.reconnect(this.url,this.token,this.participantSid,e)}catch(i){let s="";throw i instanceof Error&&(s=i.message,this.log.error(i.message,Object.assign(Object.assign({},this.logContext),{error:i}))),i instanceof Jn&&i.reason===_n.NotAllowed?new Gr("could not reconnect, token might be expired"):i instanceof Jn&&i.reason===_n.LeaveRequest?i:new su(s)}if(this.emit(lt.SignalResumed),r){const i=this.makeRTCConfiguration(r);this.pcManager.updateConfiguration(i)}else this.log.warn("Did not receive reconnect response",this.logContext);if(this.shouldFailNext)throw this.shouldFailNext=!1,new Error("simulated failure");if(yield this.pcManager.triggerIceRestart(),yield this.waitForPCReconnected(),this.client.currentState!==vr.CONNECTED)throw new su("Signal connection got severed during reconnect");this.client.setReconnected(),((t=this.reliableDC)===null||t===void 0?void 0:t.readyState)==="open"&&this.reliableDC.id===null&&this.createDataChannels(),this.emit(lt.Resumed)})}waitForPCInitialConnection(e,t){return ie(this,void 0,void 0,function*(){if(!this.pcManager)throw new Gr("PC manager is closed");yield this.pcManager.ensurePCTransportConnection(t,e)})}waitForPCReconnected(){return ie(this,void 0,void 0,function*(){this.pcState=so.Reconnecting,this.log.debug("waiting for peer connection to reconnect",this.logContext);try{if(yield os(HB),!this.pcManager)throw new Gr("PC manager is closed");yield this.pcManager.ensurePCTransportConnection(void 0,this.peerConnectionTimeout),this.pcState=so.Connected}catch(e){throw this.pcState=so.Disconnected,new Jn("could not establish PC connection, ".concat(e.message),_n.InternalError)}})}publishRpcResponse(e,t,r,i){return ie(this,void 0,void 0,function*(){const s=new Hi({destinationIdentities:[e],kind:$n.RELIABLE,value:{case:"rpcResponse",value:new z2({requestId:t,value:i?{case:"error",value:i.toProto()}:{case:"payload",value:r??""}})}});yield this.sendDataPacket(s,$n.RELIABLE)})}publishRpcAck(e,t){return ie(this,void 0,void 0,function*(){const r=new Hi({destinationIdentities:[e],kind:$n.RELIABLE,value:{case:"rpcAck",value:new X2({requestId:t})}});yield this.sendDataPacket(r,$n.RELIABLE)})}sendDataPacket(e,t){return ie(this,void 0,void 0,function*(){const r=e.toBinary();yield this.ensurePublisherConnected(t);const i=this.dataChannelForKind(t);i&&i.send(r),this.updateAndEmitDCBufferStatus(t)})}waitForBufferStatusLow(e){return new Promise((t,r)=>ie(this,void 0,void 0,function*(){if(this.isBufferStatusLow(e))t();else{const i=()=>r("Engine closed");for(this.once(lt.Closing,i);!this.dcBufferStatus.get(e);)yield os(10);this.off(lt.Closing,i),t()}}))}ensureDataTransportConnected(e){return ie(this,arguments,void 0,function(t){var r=this;let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.subscriberPrimary;return function*(){var s;if(!r.pcManager)throw new Gr("PC manager is closed");const o=i?r.pcManager.subscriber:r.pcManager.publisher,a=i?"Subscriber":"Publisher";if(!o)throw new Jn("".concat(a," connection not set"),_n.InternalError);let l=!1;!i&&!r.dataChannelForKind(t,i)&&(r.createDataChannels(),l=!0),!l&&!i&&!r.pcManager.publisher.isICEConnected&&r.pcManager.publisher.getICEConnectionState()!=="checking"&&(l=!0),l&&r.negotiate();const c=r.dataChannelForKind(t,i);if((c==null?void 0:c.readyState)==="open")return;const u=new Date().getTime()+r.peerConnectionTimeout;for(;new Date().getTime()<u;){if(o.isICEConnected&&((s=r.dataChannelForKind(t,i))===null||s===void 0?void 0:s.readyState)==="open")return;yield os(50)}throw new Jn("could not establish ".concat(a," connection, state: ").concat(o.getICEConnectionState()),_n.InternalError)}()})}ensurePublisherConnected(e){return ie(this,void 0,void 0,function*(){this.publisherConnectionPromise||(this.publisherConnectionPromise=this.ensureDataTransportConnected(e,!1)),yield this.publisherConnectionPromise})}verifyTransport(){return!(!this.pcManager||this.pcManager.currentState!==Ar.CONNECTED||!this.client.ws||this.client.ws.readyState===WebSocket.CLOSED)}negotiate(){return ie(this,void 0,void 0,function*(){return new Promise((e,t)=>ie(this,void 0,void 0,function*(){if(!this.pcManager){t(new qS("PC manager is closed"));return}this.pcManager.requirePublisher(),this.pcManager.publisher.getTransceivers().length==0&&!this.lossyDC&&!this.reliableDC&&this.createDataChannels();const r=new AbortController,i=()=>{r.abort(),this.log.debug("engine disconnected while negotiation was ongoing",this.logContext),e()};this.isClosed&&t("cannot negotiate on closed engine"),this.on(lt.Closing,i),this.pcManager.publisher.once(Mu.RTPVideoPayloadTypes,s=>{const o=new Map;s.forEach(a=>{const l=a.codec.toLowerCase();hB(l)&&o.set(a.payload,l)}),this.emit(lt.RTPVideoMapUpdate,o)});try{yield this.pcManager.negotiate(r),e()}catch(s){s instanceof qS&&(this.fullReconnectOnNext=!0),this.handleDisconnect("negotiation",iu.RR_UNKNOWN),t(s)}finally{this.off(lt.Closing,i)}}))})}dataChannelForKind(e,t){if(t){if(e===$n.LOSSY)return this.lossyDCSub;if(e===$n.RELIABLE)return this.reliableDCSub}else{if(e===$n.LOSSY)return this.lossyDC;if(e===$n.RELIABLE)return this.reliableDC}}sendSyncState(e,t){var r,i;if(!this.pcManager){this.log.warn("sync state cannot be sent without peer connection setup",this.logContext);return}const s=this.pcManager.subscriber.getLocalDescription(),o=this.pcManager.subscriber.getRemoteDescription(),a=(i=(r=this.signalOpts)===null||r===void 0?void 0:r.autoSubscribe)!==null&&i!==void 0?i:!0,l=new Array,c=new Array;e.forEach(u=>{u.isDesired!==a&&l.push(u.trackSid),u.isEnabled||c.push(u.trackSid)}),this.client.sendSyncState(new uQ({answer:s?Xg({sdp:s.sdp,type:s.type}):void 0,offer:o?Xg({sdp:o.sdp,type:o.type}):void 0,subscription:new NO({trackSids:l,subscribe:!a,participantTracks:[]}),publishTracks:SB(t),dataChannels:this.dataChannelsInfo(),trackSidsDisabled:c}))}failNext(){this.shouldFailNext=!0}dataChannelsInfo(){const e=[],t=(r,i)=>{(r==null?void 0:r.id)!==void 0&&r.id!==null&&e.push(new fQ({label:r.label,id:r.id,target:i}))};return t(this.dataChannelForKind($n.LOSSY),lo.PUBLISHER),t(this.dataChannelForKind($n.RELIABLE),lo.PUBLISHER),t(this.dataChannelForKind($n.LOSSY,!0),lo.SUBSCRIBER),t(this.dataChannelForKind($n.RELIABLE,!0),lo.SUBSCRIBER),e}clearReconnectTimeout(){this.reconnectTimeout&&Oi.clearTimeout(this.reconnectTimeout)}clearPendingReconnect(){this.clearReconnectTimeout(),this.reconnectAttempts=0}registerOnLineListener(){rs()&&window.addEventListener("online",this.handleBrowserOnLine)}deregisterOnLineListener(){rs()&&window.removeEventListener("online",this.handleBrowserOnLine)}}class su extends Error{}function JB(n){return n!==void 0&&n>13}function eF(n,e){const t=n.participantIdentity?n.participantIdentity:e.participantIdentity;n.participantIdentity=t,e.participantIdentity=t;const r=n.destinationIdentities.length!==0?n.destinationIdentities:e.destinationIdentities;n.destinationIdentities=r,e.destinationIdentities=r}class KS{constructor(e,t){this.lastUpdateAt=0,this.settingsCacheTime=3e3,this.attemptedRegions=[],this.serverUrl=new URL(e),this.token=t}updateToken(e){this.token=e}isCloud(){return WS(this.serverUrl)}getServerUrl(){return this.serverUrl}getNextBestRegionUrl(e){return ie(this,void 0,void 0,function*(){if(!this.isCloud())throw Error("region availability is only supported for LiveKit Cloud domains");(!this.regionSettings||Date.now()-this.lastUpdateAt>this.settingsCacheTime)&&(this.regionSettings=yield this.fetchRegionSettings(e));const t=this.regionSettings.regions.filter(r=>!this.attemptedRegions.find(i=>i.url===r.url));if(t.length>0){const r=t[0];return this.attemptedRegions.push(r),kn.debug("next region: ".concat(r.region)),r.url}else return null})}resetAttempts(){this.attemptedRegions=[]}fetchRegionSettings(e){return ie(this,void 0,void 0,function*(){const t=yield fetch("".concat(tF(this.serverUrl),"/regions"),{headers:{authorization:"Bearer ".concat(this.token)},signal:e});if(t.ok){const r=yield t.json();return this.lastUpdateAt=Date.now(),r}else throw new Jn("Could not fetch region settings: ".concat(t.statusText),t.status===401?_n.NotAllowed:_n.InternalError,t.status)})}setServerReportedRegions(e){this.regionSettings=e,this.lastUpdateAt=Date.now()}}function tF(n){return"".concat(n.protocol.replace("ws","http"),"//").concat(n.host,"/settings")}class sD{get info(){return this._info}constructor(e,t,r){this.reader=t,this.totalByteSize=r,this._info=e,this.bytesReceived=0}}class nF extends sD{handleChunkReceived(e){var t;this.bytesReceived+=e.content.byteLength;const r=this.totalByteSize?this.bytesReceived/this.totalByteSize:void 0;(t=this.onProgress)===null||t===void 0||t.call(this,r)}[Symbol.asyncIterator](){const e=this.reader.getReader();return{next:()=>ie(this,void 0,void 0,function*(){try{const{done:t,value:r}=yield e.read();return t?{done:!0,value:void 0}:(this.handleChunkReceived(r),{done:!1,value:r.content})}catch{return{done:!0,value:void 0}}}),return(){return ie(this,void 0,void 0,function*(){return e.releaseLock(),{done:!0,value:void 0}})}}}readAll(){return ie(this,void 0,void 0,function*(){var e,t,r,i;let s=new Set;try{for(var o=!0,a=ul(this),l;l=yield a.next(),e=l.done,!e;o=!0){i=l.value,o=!1;const c=i;s.add(c)}}catch(c){t={error:c}}finally{try{!o&&!e&&(r=a.return)&&(yield r.call(a))}finally{if(t)throw t.error}}return Array.from(s)})}}class rF extends sD{constructor(e,t,r){super(e,t,r),this.receivedChunks=new Map}handleChunkReceived(e){var t;const r=Sg(e.chunkIndex),i=this.receivedChunks.get(r);if(i&&i.version>e.version)return;this.receivedChunks.set(r,e),this.bytesReceived+=e.content.byteLength;const s=this.totalByteSize?this.bytesReceived/this.totalByteSize:void 0;(t=this.onProgress)===null||t===void 0||t.call(this,s)}[Symbol.asyncIterator](){const e=this.reader.getReader(),t=new TextDecoder;return{next:()=>ie(this,void 0,void 0,function*(){try{const{done:r,value:i}=yield e.read();return r?{done:!0,value:void 0}:(this.handleChunkReceived(i),{done:!1,value:t.decode(i.content)})}catch{return{done:!0,value:void 0}}}),return(){return ie(this,void 0,void 0,function*(){return e.releaseLock(),{done:!0,value:void 0}})}}}readAll(){return ie(this,void 0,void 0,function*(){var e,t,r,i;let s="";try{for(var o=!0,a=ul(this),l;l=yield a.next(),e=l.done,!e;o=!0)i=l.value,o=!1,s+=i}catch(c){t={error:c}}finally{try{!o&&!e&&(r=a.return)&&(yield r.call(a))}finally{if(t)throw t.error}}return s})}}class iF{constructor(e,t,r){this.writableStream=e,this.defaultWriter=e.getWriter(),this.onClose=r,this.info=t}write(e){return this.defaultWriter.write(e)}close(){return ie(this,void 0,void 0,function*(){var e;yield this.defaultWriter.close(),this.defaultWriter.releaseLock(),(e=this.onClose)===null||e===void 0||e.call(this)})}}class sF extends iF{}class oD extends Me{constructor(e,t,r,i,s){super(e,r,s),this.sid=t,this.receiver=i}get isLocal(){return!1}setMuted(e){this.isMuted!==e&&(this.isMuted=e,this._mediaStreamTrack.enabled=!e,this.emit(e?nt.Muted:nt.Unmuted,this))}setMediaStream(e){this.mediaStream=e;const t=r=>{r.track===this._mediaStreamTrack&&(e.removeEventListener("removetrack",t),this.receiver&&"playoutDelayHint"in this.receiver&&(this.receiver.playoutDelayHint=void 0),this.receiver=void 0,this._currentBitrate=0,this.emit(nt.Ended,this))};e.addEventListener("removetrack",t)}start(){this.startMonitor(),super.enable()}stop(){this.stopMonitor(),super.disable()}getRTCStatsReport(){return ie(this,void 0,void 0,function*(){var e;return!((e=this.receiver)===null||e===void 0)&&e.getStats?yield this.receiver.getStats():void 0})}setPlayoutDelay(e){this.receiver?"playoutDelayHint"in this.receiver?this.receiver.playoutDelayHint=e:this.log.warn("Playout delay not supported in this browser"):this.log.warn("Cannot set playout delay, track already ended")}getPlayoutDelay(){if(this.receiver){if("playoutDelayHint"in this.receiver)return this.receiver.playoutDelayHint;this.log.warn("Playout delay not supported in this browser")}else this.log.warn("Cannot get playout delay, track already ended");return 0}startMonitor(){this.monitorInterval||(this.monitorInterval=setInterval(()=>this.monitorReceiver(),Lw)),wB()&&this.registerTimeSyncUpdate()}registerTimeSyncUpdate(){const e=()=>{var t;this.timeSyncHandle=requestAnimationFrame(()=>e());const r=(t=this.receiver)===null||t===void 0?void 0:t.getSynchronizationSources()[0];if(r){const{timestamp:i,rtpTimestamp:s}=r;s&&this.rtpTimestamp!==s&&(this.emit(nt.TimeSyncUpdate,{timestamp:i,rtpTimestamp:s}),this.rtpTimestamp=s)}};e()}}class aD extends oD{constructor(e,t,r,i,s,o){super(e,t,Me.Kind.Audio,r,o),this.monitorReceiver=()=>ie(this,void 0,void 0,function*(){if(!this.receiver){this._currentBitrate=0;return}const a=yield this.getReceiverStats();a&&this.prevStats&&this.receiver&&(this._currentBitrate=BO(a,this.prevStats)),this.prevStats=a}),this.audioContext=i,this.webAudioPluginNodes=[],s&&(this.sinkId=s.deviceId)}setVolume(e){var t;for(const r of this.attachedElements)this.audioContext?(t=this.gainNode)===null||t===void 0||t.gain.setTargetAtTime(e,0,.1):r.volume=e;Xo()&&this._mediaStreamTrack._setVolume(e),this.elementVolume=e}getVolume(){if(this.elementVolume)return this.elementVolume;if(Xo())return 1;let e=0;return this.attachedElements.forEach(t=>{t.volume>e&&(e=t.volume)}),e}setSinkId(e){return ie(this,void 0,void 0,function*(){this.sinkId=e,yield Promise.all(this.attachedElements.map(t=>{if(ZS(t))return t.setSinkId(e)}))})}attach(e){const t=this.attachedElements.length===0;return e?super.attach(e):e=super.attach(),this.sinkId&&ZS(e)&&e.setSinkId(this.sinkId),this.audioContext&&t&&(this.log.debug("using audio context mapping",this.logContext),this.connectWebAudio(this.audioContext,e),e.volume=0,e.muted=!0),this.elementVolume&&this.setVolume(this.elementVolume),e}detach(e){let t;return e?(t=super.detach(e),this.audioContext&&(this.attachedElements.length>0?this.connectWebAudio(this.audioContext,this.attachedElements[0]):this.disconnectWebAudio())):(t=super.detach(),this.disconnectWebAudio()),t}setAudioContext(e){this.audioContext=e,e&&this.attachedElements.length>0?this.connectWebAudio(e,this.attachedElements[0]):e||this.disconnectWebAudio()}setWebAudioPlugins(e){this.webAudioPluginNodes=e,this.attachedElements.length>0&&this.audioContext&&this.connectWebAudio(this.audioContext,this.attachedElements[0])}connectWebAudio(e,t){this.disconnectWebAudio(),this.sourceNode=e.createMediaStreamSource(t.srcObject);let r=this.sourceNode;this.webAudioPluginNodes.forEach(i=>{r.connect(i),r=i}),this.gainNode=e.createGain(),r.connect(this.gainNode),this.gainNode.connect(e.destination),this.elementVolume&&this.gainNode.gain.setTargetAtTime(this.elementVolume,0,.1),e.state!=="running"&&e.resume().then(()=>{e.state!=="running"&&this.emit(nt.AudioPlaybackFailed,new Error("Audio Context couldn't be started automatically"))}).catch(i=>{this.emit(nt.AudioPlaybackFailed,i)})}disconnectWebAudio(){var e,t;(e=this.gainNode)===null||e===void 0||e.disconnect(),(t=this.sourceNode)===null||t===void 0||t.disconnect(),this.gainNode=void 0,this.sourceNode=void 0}getReceiverStats(){return ie(this,void 0,void 0,function*(){if(!this.receiver||!this.receiver.getStats)return;const e=yield this.receiver.getStats();let t;return e.forEach(r=>{r.type==="inbound-rtp"&&(t={type:"audio",streamId:r.id,timestamp:r.timestamp,jitter:r.jitter,bytesReceived:r.bytesReceived,concealedSamples:r.concealedSamples,concealmentEvents:r.concealmentEvents,silentConcealedSamples:r.silentConcealedSamples,silentConcealmentEvents:r.silentConcealmentEvents,totalAudioEnergy:r.totalAudioEnergy,totalSamplesDuration:r.totalSamplesDuration})}),t})}}const l0=100;class oF extends oD{constructor(e,t,r,i,s){super(e,t,Me.Kind.Video,r,s),this.elementInfos=[],this.monitorReceiver=()=>ie(this,void 0,void 0,function*(){if(!this.receiver){this._currentBitrate=0;return}const o=yield this.getReceiverStats();o&&this.prevStats&&this.receiver&&(this._currentBitrate=BO(o,this.prevStats)),this.prevStats=o}),this.debouncedHandleResize=Iw(()=>{this.updateDimensions()},l0),this.adaptiveStreamSettings=i}get isAdaptiveStream(){return this.adaptiveStreamSettings!==void 0}get mediaStreamTrack(){return this._mediaStreamTrack}setMuted(e){super.setMuted(e),this.attachedElements.forEach(t=>{e?Au(this._mediaStreamTrack,t):xu(this._mediaStreamTrack,t)})}attach(e){if(e?super.attach(e):e=super.attach(),this.adaptiveStreamSettings&&this.elementInfos.find(t=>t.element===e)===void 0){const t=new aF(e);this.observeElementInfo(t)}return e}observeElementInfo(e){this.adaptiveStreamSettings&&this.elementInfos.find(t=>t===e)===void 0?(e.handleResize=()=>{this.debouncedHandleResize()},e.handleVisibilityChanged=()=>{this.updateVisibility()},this.elementInfos.push(e),e.observe(),this.debouncedHandleResize(),this.updateVisibility()):this.log.warn("visibility resize observer not triggered",this.logContext)}stopObservingElementInfo(e){if(!this.isAdaptiveStream){this.log.warn("stopObservingElementInfo ignored",this.logContext);return}const t=this.elementInfos.filter(r=>r===e);for(const r of t)r.stopObserving();this.elementInfos=this.elementInfos.filter(r=>r!==e),this.updateVisibility(),this.debouncedHandleResize()}detach(e){let t=[];if(e)return this.stopObservingElement(e),super.detach(e);t=super.detach();for(const r of t)this.stopObservingElement(r);return t}getDecoderImplementation(){var e;return(e=this.prevStats)===null||e===void 0?void 0:e.decoderImplementation}getReceiverStats(){return ie(this,void 0,void 0,function*(){if(!this.receiver||!this.receiver.getStats)return;const e=yield this.receiver.getStats();let t,r="",i=new Map;return e.forEach(s=>{s.type==="inbound-rtp"?(r=s.codecId,t={type:"video",streamId:s.id,framesDecoded:s.framesDecoded,framesDropped:s.framesDropped,framesReceived:s.framesReceived,packetsReceived:s.packetsReceived,packetsLost:s.packetsLost,frameWidth:s.frameWidth,frameHeight:s.frameHeight,pliCount:s.pliCount,firCount:s.firCount,nackCount:s.nackCount,jitter:s.jitter,timestamp:s.timestamp,bytesReceived:s.bytesReceived,decoderImplementation:s.decoderImplementation}):s.type==="codec"&&i.set(s.id,s)}),t&&r!==""&&i.get(r)&&(t.mimeType=i.get(r).mimeType),t})}stopObservingElement(e){const t=this.elementInfos.filter(r=>r.element===e);for(const r of t)this.stopObservingElementInfo(r)}handleAppVisibilityChanged(){const e=Object.create(null,{handleAppVisibilityChanged:{get:()=>super.handleAppVisibilityChanged}});return ie(this,void 0,void 0,function*(){yield e.handleAppVisibilityChanged.call(this),this.isAdaptiveStream&&this.updateVisibility()})}updateVisibility(){var e,t;const r=this.elementInfos.reduce((a,l)=>Math.max(a,l.visibilityChangedAt||0),0),i=!((t=(e=this.adaptiveStreamSettings)===null||e===void 0?void 0:e.pauseVideoInBackground)!==null&&t!==void 0)||t?this.isInBackground:!1,s=this.elementInfos.some(a=>a.pictureInPicture),o=this.elementInfos.some(a=>a.visible)&&!i||s;if(this.lastVisible!==o){if(!o&&Date.now()-r<l0){Oi.setTimeout(()=>{this.updateVisibility()},l0);return}this.lastVisible=o,this.emit(nt.VisibilityChanged,o,this)}}updateDimensions(){var e,t;let r=0,i=0;const s=this.getPixelDensity();for(const o of this.elementInfos){const a=o.width()*s,l=o.height()*s;a+l>r+i&&(r=a,i=l)}((e=this.lastDimensions)===null||e===void 0?void 0:e.width)===r&&((t=this.lastDimensions)===null||t===void 0?void 0:t.height)===i||(this.lastDimensions={width:r,height:i},this.emit(nt.VideoDimensionsChanged,this.lastDimensions,this))}getPixelDensity(){var e;const t=(e=this.adaptiveStreamSettings)===null||e===void 0?void 0:e.pixelDensity;return t==="screen"?dC():t||(dC()>2?2:1)}}class aF{get visible(){return this.isPiP||this.isIntersecting}get pictureInPicture(){return this.isPiP}constructor(e,t){this.onVisibilityChanged=r=>{var i;const{target:s,isIntersecting:o}=r;s===this.element&&(this.isIntersecting=o,this.isPiP=zf(this.element),this.visibilityChangedAt=Date.now(),(i=this.handleVisibilityChanged)===null||i===void 0||i.call(this))},this.onEnterPiP=()=>{var r,i,s;(i=(r=window.documentPictureInPicture)===null||r===void 0?void 0:r.window)===null||i===void 0||i.addEventListener("pagehide",this.onLeavePiP),this.isPiP=zf(this.element),(s=this.handleVisibilityChanged)===null||s===void 0||s.call(this)},this.onLeavePiP=()=>{var r;this.isPiP=zf(this.element),(r=this.handleVisibilityChanged)===null||r===void 0||r.call(this)},this.element=e,this.isIntersecting=t??JS(e),this.isPiP=rs()&&zf(e),this.visibilityChangedAt=0}width(){return this.element.clientWidth}height(){return this.element.clientHeight}observe(){var e,t,r;this.isIntersecting=JS(this.element),this.isPiP=zf(this.element),this.element.handleResize=()=>{var i;(i=this.handleResize)===null||i===void 0||i.call(this)},this.element.handleVisibilityChanged=this.onVisibilityChanged,pC().observe(this.element),hC().observe(this.element),this.element.addEventListener("enterpictureinpicture",this.onEnterPiP),this.element.addEventListener("leavepictureinpicture",this.onLeavePiP),(e=window.documentPictureInPicture)===null||e===void 0||e.addEventListener("enter",this.onEnterPiP),(r=(t=window.documentPictureInPicture)===null||t===void 0?void 0:t.window)===null||r===void 0||r.addEventListener("pagehide",this.onLeavePiP)}stopObserving(){var e,t,r,i,s;(e=pC())===null||e===void 0||e.unobserve(this.element),(t=hC())===null||t===void 0||t.unobserve(this.element),this.element.removeEventListener("enterpictureinpicture",this.onEnterPiP),this.element.removeEventListener("leavepictureinpicture",this.onLeavePiP),(r=window.documentPictureInPicture)===null||r===void 0||r.removeEventListener("enter",this.onEnterPiP),(s=(i=window.documentPictureInPicture)===null||i===void 0?void 0:i.window)===null||s===void 0||s.removeEventListener("pagehide",this.onLeavePiP)}}function zf(n){var e,t;return document.pictureInPictureElement===n?!0:!((e=window.documentPictureInPicture)===null||e===void 0)&&e.window?JS(n,(t=window.documentPictureInPicture)===null||t===void 0?void 0:t.window):!1}function JS(n,e){const t=e||window;let r=n.offsetTop,i=n.offsetLeft;const s=n.offsetWidth,o=n.offsetHeight,{hidden:a}=n,{display:l}=getComputedStyle(n);for(;n.offsetParent;)n=n.offsetParent,r+=n.offsetTop,i+=n.offsetLeft;return r<t.pageYOffset+t.innerHeight&&i<t.pageXOffset+t.innerWidth&&r+o>t.pageYOffset&&i+s>t.pageXOffset&&!a&&l!=="none"}class sl extends Yo.EventEmitter{constructor(e,t,r,i){var s;super(),this.metadataMuted=!1,this.encryption=gs.NONE,this.log=kn,this.handleMuted=()=>{this.emit(nt.Muted)},this.handleUnmuted=()=>{this.emit(nt.Unmuted)},this.log=ka((s=i==null?void 0:i.loggerName)!==null&&s!==void 0?s:uo.Publication),this.loggerContextCb=this.loggerContextCb,this.setMaxListeners(100),this.kind=e,this.trackSid=t,this.trackName=r,this.source=Me.Source.Unknown}setTrack(e){this.track&&(this.track.off(nt.Muted,this.handleMuted),this.track.off(nt.Unmuted,this.handleUnmuted)),this.track=e,e&&(e.on(nt.Muted,this.handleMuted),e.on(nt.Unmuted,this.handleUnmuted))}get logContext(){var e;return Object.assign(Object.assign({},(e=this.loggerContextCb)===null||e===void 0?void 0:e.call(this)),Zn(this))}get isMuted(){return this.metadataMuted}get isEnabled(){return!0}get isSubscribed(){return this.track!==void 0}get isEncrypted(){return this.encryption!==gs.NONE}get audioTrack(){if(Pa(this.track))return this.track}get videoTrack(){if(lf(this.track))return this.track}updateInfo(e){this.trackSid=e.sid,this.trackName=e.name,this.source=Me.sourceFromProto(e.source),this.mimeType=e.mimeType,this.kind===Me.Kind.Video&&e.width>0&&(this.dimensions={width:e.width,height:e.height},this.simulcasted=e.simulcast),this.encryption=e.encryption,this.trackInfo=e,this.log.debug("update publication info",Object.assign(Object.assign({},this.logContext),{info:e}))}}(function(n){(function(e){e.Desired="desired",e.Subscribed="subscribed",e.Unsubscribed="unsubscribed"})(n.SubscriptionStatus||(n.SubscriptionStatus={})),function(e){e.Allowed="allowed",e.NotAllowed="not_allowed"}(n.PermissionStatus||(n.PermissionStatus={}))})(sl);class e1 extends sl{get isUpstreamPaused(){var e;return(e=this.track)===null||e===void 0?void 0:e.isUpstreamPaused}constructor(e,t,r,i){super(e,t.sid,t.name,i),this.track=void 0,this.handleTrackEnded=()=>{this.emit(nt.Ended)},this.updateInfo(t),this.setTrack(r)}setTrack(e){this.track&&this.track.off(nt.Ended,this.handleTrackEnded),super.setTrack(e),e&&e.on(nt.Ended,this.handleTrackEnded)}get isMuted(){return this.track?this.track.isMuted:super.isMuted}get audioTrack(){return super.audioTrack}get videoTrack(){return super.videoTrack}get isLocal(){return!0}mute(){return ie(this,void 0,void 0,function*(){var e;return(e=this.track)===null||e===void 0?void 0:e.mute()})}unmute(){return ie(this,void 0,void 0,function*(){var e;return(e=this.track)===null||e===void 0?void 0:e.unmute()})}pauseUpstream(){return ie(this,void 0,void 0,function*(){var e;yield(e=this.track)===null||e===void 0?void 0:e.pauseUpstream()})}resumeUpstream(){return ie(this,void 0,void 0,function*(){var e;yield(e=this.track)===null||e===void 0?void 0:e.resumeUpstream()})}getTrackFeatures(){var e;if(Pa(this.track)){const t=this.track.getSourceTrackSettings(),r=new Set;return t.autoGainControl&&r.add(No.TF_AUTO_GAIN_CONTROL),t.echoCancellation&&r.add(No.TF_ECHO_CANCELLATION),t.noiseSuppression&&r.add(No.TF_NOISE_SUPPRESSION),t.channelCount&&t.channelCount>1&&r.add(No.TF_STEREO),!((e=this.options)===null||e===void 0)&&e.dtx||r.add(No.TF_NO_DTX),this.track.enhancedNoiseCancellation&&r.add(No.TF_ENHANCED_NOISE_CANCELLATION),Array.from(r.values())}else return[]}}var fl;(function(n){n.Excellent="excellent",n.Good="good",n.Poor="poor",n.Lost="lost",n.Unknown="unknown"})(fl||(fl={}));function lF(n){switch(n){case vd.EXCELLENT:return fl.Excellent;case vd.GOOD:return fl.Good;case vd.POOR:return fl.Poor;case vd.LOST:return fl.Lost;default:return fl.Unknown}}class lD extends Yo.EventEmitter{get logContext(){var e,t;return Object.assign({},(t=(e=this.loggerOptions)===null||e===void 0?void 0:e.loggerContextCb)===null||t===void 0?void 0:t.call(e))}get isEncrypted(){return this.trackPublications.size>0&&Array.from(this.trackPublications.values()).every(e=>e.isEncrypted)}get isAgent(){var e;return((e=this.permissions)===null||e===void 0?void 0:e.agent)||this.kind===Wg.AGENT}get kind(){return this._kind}get attributes(){return Object.freeze(Object.assign({},this._attributes))}constructor(e,t,r,i,s,o){let a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:Wg.STANDARD;var l;super(),this.audioLevel=0,this.isSpeaking=!1,this._connectionQuality=fl.Unknown,this.log=kn,this.log=ka((l=o==null?void 0:o.loggerName)!==null&&l!==void 0?l:uo.Participant),this.loggerOptions=o,this.setMaxListeners(100),this.sid=e,this.identity=t,this.name=r,this.metadata=i,this.audioTrackPublications=new Map,this.videoTrackPublications=new Map,this.trackPublications=new Map,this._kind=a,this._attributes=s??{}}getTrackPublications(){return Array.from(this.trackPublications.values())}getTrackPublication(e){for(const[,t]of this.trackPublications)if(t.source===e)return t}getTrackPublicationByName(e){for(const[,t]of this.trackPublications)if(t.trackName===e)return t}get connectionQuality(){return this._connectionQuality}get isCameraEnabled(){var e;const t=this.getTrackPublication(Me.Source.Camera);return!(!((e=t==null?void 0:t.isMuted)!==null&&e!==void 0)||e)}get isMicrophoneEnabled(){var e;const t=this.getTrackPublication(Me.Source.Microphone);return!(!((e=t==null?void 0:t.isMuted)!==null&&e!==void 0)||e)}get isScreenShareEnabled(){return!!this.getTrackPublication(Me.Source.ScreenShare)}get isLocal(){return!1}get joinedAt(){return this.participantInfo?new Date(Number.parseInt(this.participantInfo.joinedAt.toString())*1e3):new Date}updateInfo(e){return this.participantInfo&&this.participantInfo.sid===e.sid&&this.participantInfo.version>e.version?!1:(this.identity=e.identity,this.sid=e.sid,this._setName(e.name),this._setMetadata(e.metadata),this._setAttributes(e.attributes),e.permission&&this.setPermissions(e.permission),this.participantInfo=e,this.log.trace("update participant info",Object.assign(Object.assign({},this.logContext),{info:e})),!0)}_setMetadata(e){const t=this.metadata!==e,r=this.metadata;this.metadata=e,t&&this.emit(Ne.ParticipantMetadataChanged,r)}_setName(e){const t=this.name!==e;this.name=e,t&&this.emit(Ne.ParticipantNameChanged,e)}_setAttributes(e){const t=kB(this.attributes,e);this._attributes=e,Object.keys(t).length>0&&this.emit(Ne.AttributesChanged,t)}setPermissions(e){var t,r,i,s,o,a;const l=this.permissions,c=e.canPublish!==((t=this.permissions)===null||t===void 0?void 0:t.canPublish)||e.canSubscribe!==((r=this.permissions)===null||r===void 0?void 0:r.canSubscribe)||e.canPublishData!==((i=this.permissions)===null||i===void 0?void 0:i.canPublishData)||e.hidden!==((s=this.permissions)===null||s===void 0?void 0:s.hidden)||e.recorder!==((o=this.permissions)===null||o===void 0?void 0:o.recorder)||e.canPublishSources.length!==this.permissions.canPublishSources.length||e.canPublishSources.some((u,d)=>{var h;return u!==((h=this.permissions)===null||h===void 0?void 0:h.canPublishSources[d])})||e.canSubscribeMetrics!==((a=this.permissions)===null||a===void 0?void 0:a.canSubscribeMetrics);return this.permissions=e,c&&this.emit(Ne.ParticipantPermissionsChanged,l),c}setIsSpeaking(e){e!==this.isSpeaking&&(this.isSpeaking=e,e&&(this.lastSpokeAt=new Date),this.emit(Ne.IsSpeakingChanged,e))}setConnectionQuality(e){const t=this._connectionQuality;this._connectionQuality=lF(e),t!==this._connectionQuality&&this.emit(Ne.ConnectionQualityChanged,this._connectionQuality)}setAudioContext(e){this.audioContext=e,this.audioTrackPublications.forEach(t=>Pa(t.track)&&t.track.setAudioContext(e))}addTrackPublication(e){e.on(nt.Muted,()=>{this.emit(Ne.TrackMuted,e)}),e.on(nt.Unmuted,()=>{this.emit(Ne.TrackUnmuted,e)});const t=e;switch(t.track&&(t.track.sid=e.trackSid),this.trackPublications.set(e.trackSid,e),e.kind){case Me.Kind.Audio:this.audioTrackPublications.set(e.trackSid,e);break;case Me.Kind.Video:this.videoTrackPublications.set(e.trackSid,e);break}}}function cF(n){var e,t,r;if(!n.participantSid&&!n.participantIdentity)throw new Error("Invalid track permission, must provide at least one of participantIdentity and participantSid");return new lQ({participantIdentity:(e=n.participantIdentity)!==null&&e!==void 0?e:"",participantSid:(t=n.participantSid)!==null&&t!==void 0?t:"",allTracks:(r=n.allowAll)!==null&&r!==void 0?r:!1,trackSids:n.allowedTrackSids||[]})}const Cp=15e3;class uF extends lD{constructor(e,t,r,i,s){super(e,t,void 0,void 0,void 0,{loggerName:i.loggerName,loggerContextCb:()=>this.engine.logContext}),this.pendingPublishing=new Set,this.pendingPublishPromises=new Map,this.participantTrackPermissions=[],this.allParticipantsAllowedToSubscribe=!0,this.encryptionType=gs.NONE,this.enabledPublishVideoCodecs=[],this.pendingAcks=new Map,this.pendingResponses=new Map,this.handleReconnecting=()=>{this.reconnectFuture||(this.reconnectFuture=new zQ)},this.handleReconnected=()=>{var o,a;(a=(o=this.reconnectFuture)===null||o===void 0?void 0:o.resolve)===null||a===void 0||a.call(o),this.reconnectFuture=void 0,this.updateTrackSubscriptionPermissions()},this.handleDisconnected=()=>{var o,a;this.reconnectFuture&&(this.reconnectFuture.promise.catch(l=>this.log.warn(l.message,this.logContext)),(a=(o=this.reconnectFuture)===null||o===void 0?void 0:o.reject)===null||a===void 0||a.call(o,"Got disconnected during reconnection attempt"),this.reconnectFuture=void 0)},this.handleSignalRequestResponse=o=>{const{requestId:a,reason:l,message:c}=o,u=this.pendingSignalRequests.get(a);u&&(l!==Ew.OK&&u.reject(new lC(c,l)),this.pendingSignalRequests.delete(a))},this.handleDataPacket=o=>{switch(o.value.case){case"rpcResponse":let a=o.value.value,l=null,c=null;a.value.case==="payload"?l=a.value.value:a.value.case==="error"&&(c=Mr.fromProto(a.value.value)),this.handleIncomingRpcResponse(a.requestId,l,c);break;case"rpcAck":let u=o.value.value;this.handleIncomingRpcAck(u.requestId);break}},this.updateTrackSubscriptionPermissions=()=>{this.log.debug("updating track subscription permissions",Object.assign(Object.assign({},this.logContext),{allParticipantsAllowed:this.allParticipantsAllowedToSubscribe,participantTrackPermissions:this.participantTrackPermissions})),this.engine.client.sendUpdateSubscriptionPermissions(this.allParticipantsAllowedToSubscribe,this.participantTrackPermissions.map(o=>cF(o)))},this.onTrackUnmuted=o=>{this.onTrackMuted(o,o.isUpstreamPaused)},this.onTrackMuted=(o,a)=>{if(a===void 0&&(a=!0),!o.sid){this.log.error("could not update mute status for unpublished track",Object.assign(Object.assign({},this.logContext),Zn(o)));return}this.engine.updateMuteStatus(o.sid,a)},this.onTrackUpstreamPaused=o=>{this.log.debug("upstream paused",Object.assign(Object.assign({},this.logContext),Zn(o))),this.onTrackMuted(o,!0)},this.onTrackUpstreamResumed=o=>{this.log.debug("upstream resumed",Object.assign(Object.assign({},this.logContext),Zn(o))),this.onTrackMuted(o,o.isMuted)},this.onTrackFeatureUpdate=o=>{const a=this.audioTrackPublications.get(o.sid);if(!a){this.log.warn("Could not update local audio track settings, missing publication for track ".concat(o.sid),this.logContext);return}this.engine.client.sendUpdateLocalAudioTrack(a.trackSid,a.getTrackFeatures())},this.handleSubscribedQualityUpdate=o=>ie(this,void 0,void 0,function*(){var a,l,c,u,d,h;if(!(!((d=this.roomOptions)===null||d===void 0)&&d.dynacast))return;const m=this.videoTrackPublications.get(o.trackSid);if(!m){this.log.warn("received subscribed quality update for unknown track",Object.assign(Object.assign({},this.logContext),{trackSid:o.trackSid}));return}if(o.subscribedCodecs.length>0){if(!m.videoTrack)return;const b=yield m.videoTrack.setPublishingCodecs(o.subscribedCodecs);try{for(var g=!0,O=ul(b),y;y=yield O.next(),a=y.done,!a;g=!0){u=y.value,g=!1;const S=u;nB(S)&&(this.log.debug("publish ".concat(S," for ").concat(m.videoTrack.sid),Object.assign(Object.assign({},this.logContext),Zn(m))),yield this.publishAdditionalCodecForTrack(m.videoTrack,S,m.options))}}catch(S){l={error:S}}finally{try{!g&&!a&&(c=O.return)&&(yield c.call(O))}finally{if(l)throw l.error}}}else o.subscribedQualities.length>0&&(yield(h=m.videoTrack)===null||h===void 0?void 0:h.setPublishingLayers(o.subscribedQualities))}),this.handleLocalTrackUnpublished=o=>{const a=this.trackPublications.get(o.trackSid);if(!a){this.log.warn("received unpublished event for unknown track",Object.assign(Object.assign({},this.logContext),{trackSid:o.trackSid}));return}this.unpublishTrack(a.track)},this.handleTrackEnded=o=>ie(this,void 0,void 0,function*(){if(o.source===Me.Source.ScreenShare||o.source===Me.Source.ScreenShareAudio)this.log.debug("unpublishing local track due to TrackEnded",Object.assign(Object.assign({},this.logContext),Zn(o))),this.unpublishTrack(o);else if(o.isUserProvided)yield o.mute();else if(cc(o)||el(o))try{if(rs())try{const a=yield navigator==null?void 0:navigator.permissions.query({name:o.source===Me.Source.Camera?"camera":"microphone"});if(a&&a.state==="denied")throw this.log.warn("user has revoked access to ".concat(o.source),Object.assign(Object.assign({},this.logContext),Zn(o))),a.onchange=()=>{a.state!=="denied"&&(o.isMuted||o.restartTrack(),a.onchange=null)},new Error("GetUserMedia Permission denied")}catch{}o.isMuted||(this.log.debug("track ended, attempting to use a different device",Object.assign(Object.assign({},this.logContext),Zn(o))),cc(o)?yield o.restartTrack({deviceId:"default"}):yield o.restartTrack())}catch{this.log.warn("could not restart track, muting instead",Object.assign(Object.assign({},this.logContext),Zn(o))),yield o.mute()}}),this.audioTrackPublications=new Map,this.videoTrackPublications=new Map,this.trackPublications=new Map,this.engine=r,this.roomOptions=i,this.setupEngine(r),this.activeDeviceMap=new Map([["audioinput","default"],["videoinput","default"],["audiooutput","default"]]),this.pendingSignalRequests=new Map,this.rpcHandlers=s}get lastCameraError(){return this.cameraError}get lastMicrophoneError(){return this.microphoneError}get isE2EEEnabled(){return this.encryptionType!==gs.NONE}getTrackPublication(e){const t=super.getTrackPublication(e);if(t)return t}getTrackPublicationByName(e){const t=super.getTrackPublicationByName(e);if(t)return t}setupEngine(e){this.engine=e,this.engine.on(lt.RemoteMute,(t,r)=>{const i=this.trackPublications.get(t);!i||!i.track||(r?i.mute():i.unmute())}),this.engine.on(lt.Connected,this.handleReconnected).on(lt.SignalRestarted,this.handleReconnected).on(lt.SignalResumed,this.handleReconnected).on(lt.Restarting,this.handleReconnecting).on(lt.Resuming,this.handleReconnecting).on(lt.LocalTrackUnpublished,this.handleLocalTrackUnpublished).on(lt.SubscribedQualityUpdate,this.handleSubscribedQualityUpdate).on(lt.Disconnected,this.handleDisconnected).on(lt.SignalRequestResponse,this.handleSignalRequestResponse).on(lt.DataPacketReceived,this.handleDataPacket)}setMetadata(e){return ie(this,void 0,void 0,function*(){yield this.requestMetadataUpdate({metadata:e})})}setName(e){return ie(this,void 0,void 0,function*(){yield this.requestMetadataUpdate({name:e})})}setAttributes(e){return ie(this,void 0,void 0,function*(){yield this.requestMetadataUpdate({attributes:e})})}requestMetadataUpdate(e){return ie(this,arguments,void 0,function(t){var r=this;let{metadata:i,name:s,attributes:o}=t;return function*(){return new Promise((a,l)=>ie(r,void 0,void 0,function*(){var c,u;try{let d=!1;const h=yield this.engine.client.sendUpdateLocalMetadata((c=i??this.metadata)!==null&&c!==void 0?c:"",(u=s??this.name)!==null&&u!==void 0?u:"",o),m=performance.now();for(this.pendingSignalRequests.set(h,{resolve:a,reject:g=>{l(g),d=!0},values:{name:s,metadata:i,attributes:o}});performance.now()-m<5e3&&!d;){if((!s||this.name===s)&&(!i||this.metadata===i)&&(!o||Object.entries(o).every(g=>{let[O,y]=g;return this.attributes[O]===y||y===""&&!this.attributes[O]}))){this.pendingSignalRequests.delete(h),a();return}yield os(50)}l(new lC("Request to update local metadata timed out","TimeoutError"))}catch(d){d instanceof Error&&l(d)}}))}()})}setCameraEnabled(e,t,r){return this.setTrackEnabled(Me.Source.Camera,e,t,r)}setMicrophoneEnabled(e,t,r){return this.setTrackEnabled(Me.Source.Microphone,e,t,r)}setScreenShareEnabled(e,t,r){return this.setTrackEnabled(Me.Source.ScreenShare,e,t,r)}setPermissions(e){const t=this.permissions,r=super.setPermissions(e);return r&&t&&this.emit(Ne.ParticipantPermissionsChanged,t),r}setE2EEEnabled(e){return ie(this,void 0,void 0,function*(){this.encryptionType=e?gs.GCM:gs.NONE,yield this.republishAllTracks(void 0,!1)})}setTrackEnabled(e,t,r,i){return ie(this,void 0,void 0,function*(){var s,o;this.log.debug("setTrackEnabled",Object.assign(Object.assign({},this.logContext),{source:e,enabled:t})),this.republishPromise&&(yield this.republishPromise);let a=this.getTrackPublication(e);if(t)if(a)yield a.unmute();else{let l;if(this.pendingPublishing.has(e)){const c=yield this.waitForPendingPublicationOfSource(e);return c||this.log.info("waiting for pending publication promise timed out",Object.assign(Object.assign({},this.logContext),{source:e})),yield c==null?void 0:c.unmute(),c}this.pendingPublishing.add(e);try{switch(e){case Me.Source.Camera:l=yield this.createTracks({video:(s=r)!==null&&s!==void 0?s:!0});break;case Me.Source.Microphone:l=yield this.createTracks({audio:(o=r)!==null&&o!==void 0?o:!0});break;case Me.Source.ScreenShare:l=yield this.createScreenTracks(Object.assign({},r));break;default:throw new va(e)}}catch(c){throw l==null||l.forEach(u=>{u.stop()}),c instanceof Error&&this.emit(Ne.MediaDevicesError,c),this.pendingPublishing.delete(e),c}try{const c=[];for(const d of l)this.log.info("publishing track",Object.assign(Object.assign({},this.logContext),Zn(d))),c.push(this.publishTrack(d,i));[a]=yield Promise.all(c)}catch(c){throw l==null||l.forEach(u=>{u.stop()}),c}finally{this.pendingPublishing.delete(e)}}else if(!(a!=null&&a.track)&&this.pendingPublishing.has(e)&&(a=yield this.waitForPendingPublicationOfSource(e),a||this.log.info("waiting for pending publication promise timed out",Object.assign(Object.assign({},this.logContext),{source:e}))),a&&a.track)if(e===Me.Source.ScreenShare){a=yield this.unpublishTrack(a.track);const l=this.getTrackPublication(Me.Source.ScreenShareAudio);l&&l.track&&this.unpublishTrack(l.track)}else yield a.mute();return a})}enableCameraAndMicrophone(){return ie(this,void 0,void 0,function*(){if(!(this.pendingPublishing.has(Me.Source.Camera)||this.pendingPublishing.has(Me.Source.Microphone))){this.pendingPublishing.add(Me.Source.Camera),this.pendingPublishing.add(Me.Source.Microphone);try{const e=yield this.createTracks({audio:!0,video:!0});yield Promise.all(e.map(t=>this.publishTrack(t)))}finally{this.pendingPublishing.delete(Me.Source.Camera),this.pendingPublishing.delete(Me.Source.Microphone)}}})}createTracks(e){return ie(this,void 0,void 0,function*(){var t,r;e??(e={});const i=YQ(e,(t=this.roomOptions)===null||t===void 0?void 0:t.audioCaptureDefaults,(r=this.roomOptions)===null||r===void 0?void 0:r.videoCaptureDefaults),{audioProcessor:s,videoProcessor:o,optionsWithoutProcessor:a}=Mw(i),l=UO(a);let c;try{c=yield navigator.mediaDevices.getUserMedia(l)}catch(u){throw u instanceof Error&&(l.audio&&(this.microphoneError=u),l.video&&(this.cameraError=u)),u}return l.audio&&(this.microphoneError=void 0,this.emit(Ne.AudioStreamAcquired)),l.video&&(this.cameraError=void 0),Promise.all(c.getTracks().map(u=>ie(this,void 0,void 0,function*(){const d=u.kind==="audio";let h;const m=d?l.audio:l.video;typeof m!="boolean"&&(h=m);const g=nD(u,h,{loggerName:this.roomOptions.loggerName,loggerContextCb:()=>this.logContext});return g.kind===Me.Kind.Video?g.source=Me.Source.Camera:g.kind===Me.Kind.Audio&&(g.source=Me.Source.Microphone,g.setAudioContext(this.audioContext)),g.mediaStream=c,Pa(g)&&s?yield g.setProcessor(s):lf(g)&&o&&(yield g.setProcessor(o)),g})))})}createScreenTracks(e){return ie(this,void 0,void 0,function*(){if(e===void 0&&(e={}),navigator.mediaDevices.getDisplayMedia===void 0)throw new Aw("getDisplayMedia not supported");e.resolution===void 0&&!lB()&&(e.resolution=$w.h1080fps30.resolution);const t=bB(e),r=yield navigator.mediaDevices.getDisplayMedia(t),i=r.getVideoTracks();if(i.length===0)throw new va("no video track found");const s=new Yg(i[0],void 0,!1,{loggerName:this.roomOptions.loggerName,loggerContextCb:()=>this.logContext});s.source=Me.Source.ScreenShare,e.contentHint&&(s.mediaStreamTrack.contentHint=e.contentHint);const o=[s];if(r.getAudioTracks().length>0){this.emit(Ne.AudioStreamAcquired);const a=new zg(r.getAudioTracks()[0],void 0,!1,this.audioContext,{loggerName:this.roomOptions.loggerName,loggerContextCb:()=>this.logContext});a.source=Me.Source.ScreenShareAudio,o.push(a)}return o})}publishTrack(e,t){return ie(this,void 0,void 0,function*(){return this.publishOrRepublishTrack(e,t)})}publishOrRepublishTrack(e,t){return ie(this,arguments,void 0,function(r,i){var s=this;let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return function*(){var a,l,c,u;cc(r)&&r.setAudioContext(s.audioContext),yield(a=s.reconnectFuture)===null||a===void 0?void 0:a.promise,s.republishPromise&&!o&&(yield s.republishPromise),$u(r)&&s.pendingPublishPromises.has(r)&&(yield s.pendingPublishPromises.get(r));let d;if(r instanceof MediaStreamTrack)d=r.getConstraints();else{d=r.constraints;let b;switch(r.source){case Me.Source.Microphone:b="audioinput";break;case Me.Source.Camera:b="videoinput"}b&&s.activeDeviceMap.has(b)&&(d=Object.assign(Object.assign({},d),{deviceId:s.activeDeviceMap.get(b)}))}if(r instanceof MediaStreamTrack)switch(r.kind){case"audio":r=new zg(r,d,!0,s.audioContext,{loggerName:s.roomOptions.loggerName,loggerContextCb:()=>s.logContext});break;case"video":r=new Yg(r,d,!0,{loggerName:s.roomOptions.loggerName,loggerContextCb:()=>s.logContext});break;default:throw new va("unsupported MediaStreamTrack kind ".concat(r.kind))}else r.updateLoggerOptions({loggerName:s.roomOptions.loggerName,loggerContextCb:()=>s.logContext});let h;if(s.trackPublications.forEach(b=>{b.track&&b.track===r&&(h=b)}),h)return s.log.warn("track has already been published, skipping",Object.assign(Object.assign({},s.logContext),Zn(h))),h;const m="channelCount"in r.mediaStreamTrack.getSettings()&&r.mediaStreamTrack.getSettings().channelCount===2||r.mediaStreamTrack.getConstraints().channelCount===2,g=(l=i==null?void 0:i.forceStereo)!==null&&l!==void 0?l:m;g&&(i||(i={}),i.dtx===void 0&&s.log.info("Opus DTX will be disabled for stereo tracks by default. Enable them explicitly to make it work.",Object.assign(Object.assign({},s.logContext),Zn(r))),i.red===void 0&&s.log.info("Opus RED will be disabled for stereo tracks by default. Enable them explicitly to make it work."),(c=i.dtx)!==null&&c!==void 0||(i.dtx=!1),(u=i.red)!==null&&u!==void 0||(i.red=!1));const O=Object.assign(Object.assign({},s.roomOptions.publishDefaults),i);!cB()&&s.roomOptions.e2ee&&(s.log.info("End-to-end encryption is set up, simulcast publishing will be disabled on Safari versions and iOS browsers running iOS < v17.2",Object.assign({},s.logContext)),O.simulcast=!1),O.source&&(r.source=O.source);const y=s.publish(r,O,g);s.pendingPublishPromises.set(r,y);try{return yield y}catch(b){throw b}finally{s.pendingPublishPromises.delete(r)}}()})}hasPermissionsToPublish(e){if(!this.permissions)return this.log.warn("no permissions present for publishing track",Object.assign(Object.assign({},this.logContext),Zn(e))),!1;const{canPublish:t,canPublishSources:r}=this.permissions;return t&&(r.length===0||r.map(i=>PB(i)).includes(e.source))?!0:(this.log.warn("insufficient permissions to publish",Object.assign(Object.assign({},this.logContext),Zn(e))),!1)}publish(e,t,r){return ie(this,void 0,void 0,function*(){var i,s,o,a,l,c,u,d,h,m;if(!this.hasPermissionsToPublish(e))throw new WU("failed to publish track, insufficient permissions",403);Array.from(this.trackPublications.values()).find(x=>$u(e)&&x.source===e.source)&&e.source!==Me.Source.Unknown&&this.log.info("publishing a second track with the same source: ".concat(e.source),Object.assign(Object.assign({},this.logContext),Zn(e))),t.stopMicTrackOnMute&&Pa(e)&&(e.stopOnMute=!0),e.source===Me.Source.ScreenShare&&Vu()&&(t.simulcast=!1),t.videoCodec==="av1"&&!sB()&&(t.videoCodec=void 0),t.videoCodec==="vp9"&&!oB()&&(t.videoCodec=void 0),t.videoCodec===void 0&&(t.videoCodec=YS),this.enabledPublishVideoCodecs.length>0&&(this.enabledPublishVideoCodecs.some(x=>t.videoCodec===wg(x.mime))||(t.videoCodec=wg(this.enabledPublishVideoCodecs[0].mime)));const O=t.videoCodec;e.on(nt.Muted,this.onTrackMuted),e.on(nt.Unmuted,this.onTrackUnmuted),e.on(nt.Ended,this.handleTrackEnded),e.on(nt.UpstreamPaused,this.onTrackUpstreamPaused),e.on(nt.UpstreamResumed,this.onTrackUpstreamResumed),e.on(nt.AudioTrackFeatureUpdate,this.onTrackFeatureUpdate);const y=new AS({cid:e.mediaStreamTrack.id,name:t.name,type:Me.kindToProto(e.kind),muted:e.isMuted,source:Me.sourceToProto(e.source),disableDtx:!(!((i=t.dtx)!==null&&i!==void 0)||i),encryption:this.encryptionType,stereo:r,disableRed:this.isE2EEEnabled||!(!((s=t.red)!==null&&s!==void 0)||s),stream:t==null?void 0:t.stream,backupCodecPolicy:t==null?void 0:t.backupCodecPolicy});let b;if(e.kind===Me.Kind.Video){let x={width:0,height:0};try{x=yield e.waitForDimensions()}catch{const M=(a=(o=this.roomOptions.videoCaptureDefaults)===null||o===void 0?void 0:o.resolution)!==null&&a!==void 0?a:qd.h720.resolution;x={width:M.width,height:M.height},this.log.error("could not determine track dimensions, using defaults",Object.assign(Object.assign(Object.assign({},this.logContext),Zn(e)),{dims:x}))}y.width=x.width,y.height=x.height,el(e)&&(Ed(O)&&(e.source===Me.Source.ScreenShare&&(t.scalabilityMode="L1T3","contentHint"in e.mediaStreamTrack&&(e.mediaStreamTrack.contentHint="motion",this.log.info("forcing contentHint to motion for screenshare with SVC codecs",Object.assign(Object.assign({},this.logContext),Zn(e))))),t.scalabilityMode=(l=t.scalabilityMode)!==null&&l!==void 0?l:"L3T3_KEY"),y.simulcastCodecs=[new RS({codec:O,cid:e.mediaStreamTrack.id})],t.backupCodec===!0&&(t.backupCodec={codec:YS}),t.backupCodec&&O!==t.backupCodec.codec&&y.encryption===gs.NONE&&(this.roomOptions.dynacast||(this.roomOptions.dynacast=!0),y.simulcastCodecs.push(new RS({codec:t.backupCodec.codec,cid:""})))),b=HS(e.source===Me.Source.ScreenShare,y.width,y.height,t),y.layers=AC(y.width,y.height,b,Ed(t.videoCodec))}else e.kind===Me.Kind.Audio&&(b=[{maxBitrate:(c=t.audioPreset)===null||c===void 0?void 0:c.maxBitrate,priority:(d=(u=t.audioPreset)===null||u===void 0?void 0:u.priority)!==null&&d!==void 0?d:"high",networkPriority:(m=(h=t.audioPreset)===null||h===void 0?void 0:h.priority)!==null&&m!==void 0?m:"high"}]);if(!this.engine||this.engine.isClosed)throw new Gr("cannot publish track when not connected");const S=()=>ie(this,void 0,void 0,function*(){var x,A,M;if(!this.engine.pcManager)throw new Gr("pcManager is not ready");if(e.sender=yield this.engine.createSender(e,t,b),el(e)&&((x=t.degradationPreference)!==null&&x!==void 0||(t.degradationPreference=YB(e)),e.setDegradationPreference(t.degradationPreference)),b)if(Vu()&&e.kind===Me.Kind.Audio){let Q;for(const _ of this.engine.pcManager.publisher.getTransceivers())if(_.sender===e.sender){Q=_;break}Q&&this.engine.pcManager.publisher.setTrackCodecBitrate({transceiver:Q,codec:"opus",maxbr:!((A=b[0])===null||A===void 0)&&A.maxBitrate?b[0].maxBitrate/1e3:0})}else e.codec&&Ed(e.codec)&&(!((M=b[0])===null||M===void 0)&&M.maxBitrate)&&this.engine.pcManager.publisher.setTrackCodecBitrate({cid:y.cid,codec:e.codec,maxbr:b[0].maxBitrate/1e3});yield this.engine.negotiate()});let P;if(this.enabledPublishVideoCodecs.length>0)P=(yield Promise.all([this.engine.addTrack(y),S()]))[0];else{P=yield this.engine.addTrack(y);let x;if(P.codecs.forEach(A=>{x===void 0&&(x=A.mimeType)}),x&&e.kind===Me.Kind.Video){const A=wg(x);A!==O&&(this.log.debug("falling back to server selected codec",Object.assign(Object.assign(Object.assign({},this.logContext),Zn(e)),{codec:A})),t.videoCodec=A,b=HS(e.source===Me.Source.ScreenShare,y.width,y.height,t))}yield S()}const k=new e1(e.kind,P,e,{loggerName:this.roomOptions.loggerName,loggerContextCb:()=>this.logContext});return k.options=t,e.sid=P.sid,this.log.debug("publishing ".concat(e.kind," with encodings"),Object.assign(Object.assign({},this.logContext),{encodings:b,trackInfo:P})),el(e)?e.startMonitor(this.engine.client):cc(e)&&e.startMonitor(),this.addTrackPublication(k),this.emit(Ne.LocalTrackPublished,k),k})}get isLocal(){return!0}publishAdditionalCodecForTrack(e,t,r){return ie(this,void 0,void 0,function*(){var i;if(this.encryptionType!==gs.NONE)return;let s;if(this.trackPublications.forEach(m=>{m.track&&m.track===e&&(s=m)}),!s)throw new va("track is not published");if(!el(e))throw new va("track is not a video track");const o=Object.assign(Object.assign({},(i=this.roomOptions)===null||i===void 0?void 0:i.publishDefaults),r),a=WB(e,t,o);if(!a){this.log.info("backup codec has been disabled, ignoring request to add additional codec for track",Object.assign(Object.assign({},this.logContext),Zn(e)));return}const l=e.addSimulcastTrack(t,a);if(!l)return;const c=new AS({cid:l.mediaStreamTrack.id,type:Me.kindToProto(e.kind),muted:e.isMuted,source:Me.sourceToProto(e.source),sid:e.sid,simulcastCodecs:[{codec:o.videoCodec,cid:l.mediaStreamTrack.id}]});if(c.layers=AC(c.width,c.height,a),!this.engine||this.engine.isClosed)throw new Gr("cannot publish track when not connected");const u=()=>ie(this,void 0,void 0,function*(){yield this.engine.createSimulcastSender(e,l,o,a),yield this.engine.negotiate()}),h=(yield Promise.all([this.engine.addTrack(c),u()]))[0];this.log.debug("published ".concat(t," for track ").concat(e.sid),Object.assign(Object.assign({},this.logContext),{encodings:a,trackInfo:h}))})}unpublishTrack(e,t){return ie(this,void 0,void 0,function*(){var r,i;if($u(e)){const c=this.pendingPublishPromises.get(e);c&&(this.log.info("awaiting publish promise before attempting to unpublish",Object.assign(Object.assign({},this.logContext),Zn(e))),yield c)}const s=this.getPublicationForTrack(e),o=s?Zn(s):void 0;if(this.log.debug("unpublishing track",Object.assign(Object.assign({},this.logContext),o)),!s||!s.track){this.log.warn("track was not unpublished because no publication was found",Object.assign(Object.assign({},this.logContext),o));return}e=s.track,e.off(nt.Muted,this.onTrackMuted),e.off(nt.Unmuted,this.onTrackUnmuted),e.off(nt.Ended,this.handleTrackEnded),e.off(nt.UpstreamPaused,this.onTrackUpstreamPaused),e.off(nt.UpstreamResumed,this.onTrackUpstreamResumed),e.off(nt.AudioTrackFeatureUpdate,this.onTrackFeatureUpdate),t===void 0&&(t=(i=(r=this.roomOptions)===null||r===void 0?void 0:r.stopLocalTrackOnUnpublish)!==null&&i!==void 0?i:!0),t?e.stop():e.stopMonitor();let a=!1;const l=e.sender;if(e.sender=void 0,this.engine.pcManager&&this.engine.pcManager.currentState<Ar.FAILED&&l)try{for(const c of this.engine.pcManager.publisher.getTransceivers())c.sender===l&&(c.direction="inactive",a=!0);if(this.engine.removeTrack(l)&&(a=!0),el(e)){for(const[,c]of e.simulcastCodecs)c.sender&&(this.engine.removeTrack(c.sender)&&(a=!0),c.sender=void 0);e.simulcastCodecs.clear()}}catch(c){this.log.warn("failed to unpublish track",Object.assign(Object.assign(Object.assign({},this.logContext),o),{error:c}))}switch(this.trackPublications.delete(s.trackSid),s.kind){case Me.Kind.Audio:this.audioTrackPublications.delete(s.trackSid);break;case Me.Kind.Video:this.videoTrackPublications.delete(s.trackSid);break}return this.emit(Ne.LocalTrackUnpublished,s),s.setTrack(void 0),a&&(yield this.engine.negotiate()),s})}unpublishTracks(e){return ie(this,void 0,void 0,function*(){return(yield Promise.all(e.map(r=>this.unpublishTrack(r)))).filter(r=>!!r)})}republishAllTracks(e){return ie(this,arguments,void 0,function(t){var r=this;let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return function*(){r.republishPromise&&(yield r.republishPromise),r.republishPromise=new Promise((s,o)=>ie(r,void 0,void 0,function*(){try{const a=[];this.trackPublications.forEach(l=>{l.track&&(t&&(l.options=Object.assign(Object.assign({},l.options),t)),a.push(l))}),yield Promise.all(a.map(l=>ie(this,void 0,void 0,function*(){const c=l.track;yield this.unpublishTrack(c,!1),i&&!c.isMuted&&c.source!==Me.Source.ScreenShare&&c.source!==Me.Source.ScreenShareAudio&&(cc(c)||el(c))&&!c.isUserProvided&&(this.log.debug("restarting existing track",Object.assign(Object.assign({},this.logContext),{track:l.trackSid})),yield c.restartTrack()),yield this.publishOrRepublishTrack(c,l.options,!0)}))),s()}catch(a){o(a)}finally{this.republishPromise=void 0}})),yield r.republishPromise}()})}publishData(e){return ie(this,arguments,void 0,function(t){var r=this;let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function*(){const s=i.reliable?$n.RELIABLE:$n.LOSSY,o=i.destinationIdentities,a=i.topic,l=new Hi({kind:s,value:{case:"user",value:new V2({participantIdentity:r.identity,payload:t,destinationIdentities:o,topic:a})}});yield r.engine.sendDataPacket(l,s)}()})}publishDtmf(e,t){return ie(this,void 0,void 0,function*(){const r=new Hi({kind:$n.RELIABLE,value:{case:"sipDtmf",value:new Z2({code:e,digit:t})}});yield this.engine.sendDataPacket(r,$n.RELIABLE)})}sendChatMessage(e,t){return ie(this,void 0,void 0,function*(){const r={id:crypto.randomUUID(),message:e,timestamp:Date.now(),attachedFiles:t==null?void 0:t.attachments},i=new Hi({value:{case:"chatMessage",value:new PS(Object.assign(Object.assign({},r),{timestamp:yr.parse(r.timestamp)}))}});return yield this.engine.sendDataPacket(i,$n.RELIABLE),this.emit(Ne.ChatMessage,r),r})}editChatMessage(e,t){return ie(this,void 0,void 0,function*(){const r=Object.assign(Object.assign({},t),{message:e,editTimestamp:Date.now()}),i=new Hi({value:{case:"chatMessage",value:new PS(Object.assign(Object.assign({},r),{timestamp:yr.parse(r.timestamp),editTimestamp:yr.parse(r.editTimestamp)}))}});return yield this.engine.sendDataPacket(i,$n.RELIABLE),this.emit(Ne.ChatMessage,r),r})}sendText(e,t){return ie(this,void 0,void 0,function*(){var r;const i=crypto.randomUUID(),o=new TextEncoder().encode(e).byteLength,a=(r=t==null?void 0:t.attachments)===null||r===void 0?void 0:r.map(()=>crypto.randomUUID()),l=new Array(a?a.length+1:1).fill(0),c=(d,h)=>{var m;l[h]=d;const g=l.reduce((O,y)=>O+y,0);(m=t==null?void 0:t.onProgress)===null||m===void 0||m.call(t,g)},u=yield this.streamText({streamId:i,totalSize:o,destinationIdentities:t==null?void 0:t.destinationIdentities,topic:t==null?void 0:t.topic,attachedStreamIds:a,attributes:t==null?void 0:t.attributes});return yield u.write(e),c(1,0),yield u.close(),t!=null&&t.attachments&&a&&(yield Promise.all(t.attachments.map((d,h)=>ie(this,void 0,void 0,function*(){return this._sendFile(a[h],d,{topic:t.topic,mimeType:d.type,onProgress:m=>{c(m,h+1)}})})))),u.info})}streamText(e){return ie(this,void 0,void 0,function*(){var t,r;const i=(t=e==null?void 0:e.streamId)!==null&&t!==void 0?t:crypto.randomUUID(),s={id:i,mimeType:"text/plain",timestamp:Date.now(),topic:(r=e==null?void 0:e.topic)!==null&&r!==void 0?r:"",size:e==null?void 0:e.totalSize,attributes:e==null?void 0:e.attributes},o=new TS({streamId:i,mimeType:s.mimeType,topic:s.topic,timestamp:lc(s.timestamp),totalLength:lc(e==null?void 0:e.totalSize),attributes:s.attributes,contentHeader:{case:"textHeader",value:new tQ({version:e==null?void 0:e.version,attachedStreamIds:e==null?void 0:e.attachedStreamIds,replyToStreamId:e==null?void 0:e.replyToStreamId,operationType:(e==null?void 0:e.type)==="update"?xS.UPDATE:xS.CREATE})}}),a=e==null?void 0:e.destinationIdentities,l=new Hi({destinationIdentities:a,value:{case:"streamHeader",value:o}});yield this.engine.sendDataPacket(l,$n.RELIABLE);let c=0;const u=this,d=new WritableStream({write(g){return ie(this,void 0,void 0,function*(){for(const O of yB(g,Cp)){yield u.engine.waitForBufferStatusLow($n.RELIABLE);const y=new CS({content:O,streamId:i,chunkIndex:lc(c)}),b=new Hi({destinationIdentities:a,value:{case:"streamChunk",value:y}});yield u.engine.sendDataPacket(b,$n.RELIABLE),c+=1}})},close(){return ie(this,void 0,void 0,function*(){const g=new _S({streamId:i}),O=new Hi({destinationIdentities:a,value:{case:"streamTrailer",value:g}});yield u.engine.sendDataPacket(O,$n.RELIABLE)})},abort(g){console.log("Sink error:",g)}});let h=()=>ie(this,void 0,void 0,function*(){yield m.close()});u.engine.once(lt.Closing,h);const m=new sF(d,s,()=>this.engine.off(lt.Closing,h));return m})}sendFile(e,t){return ie(this,void 0,void 0,function*(){const r=crypto.randomUUID();return yield this._sendFile(r,e,t),{id:r}})}_sendFile(e,t,r){return ie(this,void 0,void 0,function*(){var i,s;const o=t.size,a=new TS({totalLength:lc(o),mimeType:(i=r==null?void 0:r.mimeType)!==null&&i!==void 0?i:t.type,streamId:e,topic:r==null?void 0:r.topic,encryptionType:r==null?void 0:r.encryptionType,timestamp:lc(Date.now()),contentHeader:{case:"byteHeader",value:new nQ({name:t.name})}}),l=r==null?void 0:r.destinationIdentities,c=new Hi({destinationIdentities:l,value:{case:"streamHeader",value:a}});yield this.engine.sendDataPacket(c,$n.RELIABLE);function u(g){return new Promise(O=>{const y=new FileReader;y.onload=()=>{O(new Uint8Array(y.result))},y.readAsArrayBuffer(g)})}const d=Math.ceil(o/Cp);for(let g=0;g<d;g++){const O=yield u(t.slice(g*Cp,Math.min((g+1)*Cp,o)));yield this.engine.waitForBufferStatusLow($n.RELIABLE);const y=new CS({content:O,streamId:e,chunkIndex:lc(g)}),b=new Hi({destinationIdentities:l,value:{case:"streamChunk",value:y}});yield this.engine.sendDataPacket(b,$n.RELIABLE),(s=r==null?void 0:r.onProgress)===null||s===void 0||s.call(r,(g+1)/d)}const h=new _S({streamId:e}),m=new Hi({destinationIdentities:l,value:{case:"streamTrailer",value:h}});yield this.engine.sendDataPacket(m,$n.RELIABLE)})}performRpc(e){return ie(this,arguments,void 0,function(t){var r=this;let{destinationIdentity:i,method:s,payload:o,responseTimeout:a=1e4}=t;return function*(){return new Promise((c,u)=>ie(r,void 0,void 0,function*(){var d,h,m,g;if(Nw(o)>eD){u(Mr.builtIn("REQUEST_PAYLOAD_TOO_LARGE"));return}if(!((h=(d=this.engine.latestJoinResponse)===null||d===void 0?void 0:d.serverInfo)===null||h===void 0)&&h.version&&Zu((g=(m=this.engine.latestJoinResponse)===null||m===void 0?void 0:m.serverInfo)===null||g===void 0?void 0:g.version,"1.8.0")<0){u(Mr.builtIn("UNSUPPORTED_SERVER"));return}const O=crypto.randomUUID();yield this.publishRpcRequest(i,O,s,o,a-2e3);const y=setTimeout(()=>{this.pendingAcks.delete(O),u(Mr.builtIn("CONNECTION_TIMEOUT")),this.pendingResponses.delete(O),clearTimeout(b)},2e3);this.pendingAcks.set(O,{resolve:()=>{clearTimeout(y)},participantIdentity:i});const b=setTimeout(()=>{this.pendingResponses.delete(O),u(Mr.builtIn("RESPONSE_TIMEOUT"))},a);this.pendingResponses.set(O,{resolve:(S,P)=>{clearTimeout(b),this.pendingAcks.has(O)&&(console.warn("RPC response received before ack",O),this.pendingAcks.delete(O),clearTimeout(y)),P?u(P):c(S??"")},participantIdentity:i})}))}()})}registerRpcMethod(e,t){this.rpcHandlers.has(e)&&this.log.warn("you're overriding the RPC handler for method ".concat(e,", in the future this will throw an error")),this.rpcHandlers.set(e,t)}unregisterRpcMethod(e){this.rpcHandlers.delete(e)}setTrackSubscriptionPermissions(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];this.participantTrackPermissions=t,this.allParticipantsAllowedToSubscribe=e,this.engine.client.isDisconnected||this.updateTrackSubscriptionPermissions()}handleIncomingRpcAck(e){const t=this.pendingAcks.get(e);t?(t.resolve(),this.pendingAcks.delete(e)):console.error("Ack received for unexpected RPC request",e)}handleIncomingRpcResponse(e,t,r){const i=this.pendingResponses.get(e);i?(i.resolve(t,r),this.pendingResponses.delete(e)):console.error("Response received for unexpected RPC request",e)}publishRpcRequest(e,t,r,i,s){return ie(this,void 0,void 0,function*(){const o=new Hi({destinationIdentities:[e],kind:$n.RELIABLE,value:{case:"rpcRequest",value:new W2({id:t,method:r,payload:i,responseTimeoutMs:s,version:1})}});yield this.engine.sendDataPacket(o,$n.RELIABLE)})}handleParticipantDisconnected(e){for(const[t,{participantIdentity:r}]of this.pendingAcks)r===e&&this.pendingAcks.delete(t);for(const[t,{participantIdentity:r,resolve:i}]of this.pendingResponses)r===e&&(i(null,Mr.builtIn("RECIPIENT_DISCONNECTED")),this.pendingResponses.delete(t))}setEnabledPublishCodecs(e){this.enabledPublishVideoCodecs=e.filter(t=>t.mime.split("/")[0].toLowerCase()==="video")}updateInfo(e){return e.sid!==this.sid||!super.updateInfo(e)?!1:(e.tracks.forEach(t=>{var r,i;const s=this.trackPublications.get(t.sid);if(s){const o=s.isMuted||((i=(r=s.track)===null||r===void 0?void 0:r.isUpstreamPaused)!==null&&i!==void 0?i:!1);o!==t.muted&&(this.log.debug("updating server mute state after reconcile",Object.assign(Object.assign(Object.assign({},this.logContext),Zn(s)),{mutedOnServer:o})),this.engine.client.sendMuteTrack(t.sid,o))}}),!0)}getPublicationForTrack(e){let t;return this.trackPublications.forEach(r=>{const i=r.track;i&&(e instanceof MediaStreamTrack?(cc(i)||el(i))&&i.mediaStreamTrack===e&&(t=r):e===i&&(t=r))}),t}waitForPendingPublicationOfSource(e){return ie(this,void 0,void 0,function*(){const r=Date.now();for(;Date.now()<r+1e4;){const i=Array.from(this.pendingPublishPromises.entries()).find(s=>{let[o]=s;return o.source===e});if(i)return i[1];yield os(20)}})}}class cD extends sl{constructor(e,t,r,i){super(e,t.sid,t.name,i),this.track=void 0,this.allowed=!0,this.disabled=!1,this.currentVideoQuality=Ms.HIGH,this.handleEnded=s=>{this.setTrack(void 0),this.emit(nt.Ended,s)},this.handleVisibilityChange=s=>{this.log.debug("adaptivestream video visibility ".concat(this.trackSid,", visible=").concat(s),this.logContext),this.disabled=!s,this.emitTrackUpdate()},this.handleVideoDimensionsChange=s=>{this.log.debug("adaptivestream video dimensions ".concat(s.width,"x").concat(s.height),this.logContext),this.videoDimensions=s,this.emitTrackUpdate()},this.subscribed=r,this.updateInfo(t)}setSubscribed(e){const t=this.subscriptionStatus,r=this.permissionStatus;this.subscribed=e,e&&(this.allowed=!0);const i=new NO({trackSids:[this.trackSid],subscribe:this.subscribed,participantTracks:[new G2({participantSid:"",trackSids:[this.trackSid]})]});this.emit(nt.UpdateSubscription,i),this.emitSubscriptionUpdateIfChanged(t),this.emitPermissionUpdateIfChanged(r)}get subscriptionStatus(){return this.subscribed===!1?sl.SubscriptionStatus.Unsubscribed:super.isSubscribed?sl.SubscriptionStatus.Subscribed:sl.SubscriptionStatus.Desired}get permissionStatus(){return this.allowed?sl.PermissionStatus.Allowed:sl.PermissionStatus.NotAllowed}get isSubscribed(){return this.subscribed===!1?!1:super.isSubscribed}get isDesired(){return this.subscribed!==!1}get isEnabled(){return!this.disabled}get isLocal(){return!1}setEnabled(e){!this.isManualOperationAllowed()||this.disabled===!e||(this.disabled=!e,this.emitTrackUpdate())}setVideoQuality(e){!this.isManualOperationAllowed()||this.currentVideoQuality===e||(this.currentVideoQuality=e,this.videoDimensions=void 0,this.emitTrackUpdate())}setVideoDimensions(e){var t,r;this.isManualOperationAllowed()&&(((t=this.videoDimensions)===null||t===void 0?void 0:t.width)===e.width&&((r=this.videoDimensions)===null||r===void 0?void 0:r.height)===e.height||(t0(this.track)&&(this.videoDimensions=e),this.currentVideoQuality=void 0,this.emitTrackUpdate()))}setVideoFPS(e){this.isManualOperationAllowed()&&t0(this.track)&&this.fps!==e&&(this.fps=e,this.emitTrackUpdate())}get videoQuality(){return this.currentVideoQuality}setTrack(e){const t=this.subscriptionStatus,r=this.permissionStatus,i=this.track;i!==e&&(i&&(i.off(nt.VideoDimensionsChanged,this.handleVideoDimensionsChange),i.off(nt.VisibilityChanged,this.handleVisibilityChange),i.off(nt.Ended,this.handleEnded),i.detach(),i.stopMonitor(),this.emit(nt.Unsubscribed,i)),super.setTrack(e),e&&(e.sid=this.trackSid,e.on(nt.VideoDimensionsChanged,this.handleVideoDimensionsChange),e.on(nt.VisibilityChanged,this.handleVisibilityChange),e.on(nt.Ended,this.handleEnded),this.emit(nt.Subscribed,e)),this.emitPermissionUpdateIfChanged(r),this.emitSubscriptionUpdateIfChanged(t))}setAllowed(e){const t=this.subscriptionStatus,r=this.permissionStatus;this.allowed=e,this.emitPermissionUpdateIfChanged(r),this.emitSubscriptionUpdateIfChanged(t)}setSubscriptionError(e){this.emit(nt.SubscriptionFailed,e)}updateInfo(e){super.updateInfo(e);const t=this.metadataMuted;this.metadataMuted=e.muted,this.track?this.track.setMuted(e.muted):t!==e.muted&&this.emit(e.muted?nt.Muted:nt.Unmuted)}emitSubscriptionUpdateIfChanged(e){const t=this.subscriptionStatus;e!==t&&this.emit(nt.SubscriptionStatusChanged,t,e)}emitPermissionUpdateIfChanged(e){this.permissionStatus!==e&&this.emit(nt.SubscriptionPermissionChanged,this.permissionStatus,e)}isManualOperationAllowed(){return this.kind===Me.Kind.Video&&this.isAdaptiveStream?(this.log.warn("adaptive stream is enabled, cannot change video track settings",this.logContext),!1):this.isDesired?!0:(this.log.warn("cannot update track settings when not subscribed",this.logContext),!1)}get isAdaptiveStream(){return t0(this.track)&&this.track.isAdaptiveStream}emitTrackUpdate(){const e=new rQ({trackSids:[this.trackSid],disabled:this.disabled,fps:this.fps});this.videoDimensions?(e.width=Math.ceil(this.videoDimensions.width),e.height=Math.ceil(this.videoDimensions.height)):this.currentVideoQuality!==void 0?e.quality=this.currentVideoQuality:e.quality=Ms.HIGH,this.emit(nt.UpdateSettings,e)}}class Gg extends lD{static fromParticipantInfo(e,t,r){return new Gg(e,t.sid,t.identity,t.name,t.metadata,t.attributes,r,t.kind)}get logContext(){return Object.assign(Object.assign({},super.logContext),{rpID:this.sid,remoteParticipant:this.identity})}constructor(e,t,r,i,s,o,a){let l=arguments.length>7&&arguments[7]!==void 0?arguments[7]:Wg.STANDARD;super(t,r||"",i,s,o,a,l),this.signalClient=e,this.trackPublications=new Map,this.audioTrackPublications=new Map,this.videoTrackPublications=new Map,this.volumeMap=new Map}addTrackPublication(e){super.addTrackPublication(e),e.on(nt.UpdateSettings,t=>{this.log.debug("send update settings",Object.assign(Object.assign({},this.logContext),Zn(e))),this.signalClient.sendUpdateTrackSettings(t)}),e.on(nt.UpdateSubscription,t=>{t.participantTracks.forEach(r=>{r.participantSid=this.sid}),this.signalClient.sendUpdateSubscription(t)}),e.on(nt.SubscriptionPermissionChanged,t=>{this.emit(Ne.TrackSubscriptionPermissionChanged,e,t)}),e.on(nt.SubscriptionStatusChanged,t=>{this.emit(Ne.TrackSubscriptionStatusChanged,e,t)}),e.on(nt.Subscribed,t=>{this.emit(Ne.TrackSubscribed,t,e)}),e.on(nt.Unsubscribed,t=>{this.emit(Ne.TrackUnsubscribed,t,e)}),e.on(nt.SubscriptionFailed,t=>{this.emit(Ne.TrackSubscriptionFailed,e.trackSid,t)})}getTrackPublication(e){const t=super.getTrackPublication(e);if(t)return t}getTrackPublicationByName(e){const t=super.getTrackPublicationByName(e);if(t)return t}setVolume(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Me.Source.Microphone;this.volumeMap.set(t,e);const r=this.getTrackPublication(t);r&&r.track&&r.track.setVolume(e)}getVolume(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Me.Source.Microphone;const t=this.getTrackPublication(e);return t&&t.track?t.track.getVolume():this.volumeMap.get(e)}addSubscribedMediaTrack(e,t,r,i,s,o){let a=this.getTrackPublicationBySid(t);if(a||t.startsWith("TR")||this.trackPublications.forEach(u=>{!a&&e.kind===u.kind.toString()&&(a=u)}),!a){if(o===0){this.log.error("could not find published track",Object.assign(Object.assign({},this.logContext),{trackSid:t})),this.emit(Ne.TrackSubscriptionFailed,t);return}o===void 0&&(o=20),setTimeout(()=>{this.addSubscribedMediaTrack(e,t,r,i,s,o-1)},150);return}if(e.readyState==="ended"){this.log.error("unable to subscribe because MediaStreamTrack is ended. Do not call MediaStreamTrack.stop()",Object.assign(Object.assign({},this.logContext),Zn(a))),this.emit(Ne.TrackSubscriptionFailed,t);return}const l=e.kind==="video";let c;return l?c=new oF(e,t,i,s):c=new aD(e,t,i,this.audioContext,this.audioOutput),c.source=a.source,c.isMuted=a.isMuted,c.setMediaStream(r),c.start(),a.setTrack(c),this.volumeMap.has(a.source)&&XS(c)&&Pa(c)&&c.setVolume(this.volumeMap.get(a.source)),a}get hasMetadata(){return!!this.participantInfo}getTrackPublicationBySid(e){return this.trackPublications.get(e)}updateInfo(e){if(!super.updateInfo(e))return!1;const t=new Map,r=new Map;return e.tracks.forEach(i=>{var s,o;let a=this.getTrackPublicationBySid(i.sid);if(a)a.updateInfo(i);else{const l=Me.kindFromProto(i.type);if(!l)return;a=new cD(l,i,(s=this.signalClient.connectOptions)===null||s===void 0?void 0:s.autoSubscribe,{loggerContextCb:()=>this.logContext,loggerName:(o=this.loggerOptions)===null||o===void 0?void 0:o.loggerName}),a.updateInfo(i),r.set(i.sid,a);const c=Array.from(this.trackPublications.values()).find(u=>u.source===(a==null?void 0:a.source));c&&a.source!==Me.Source.Unknown&&this.log.debug("received a second track publication for ".concat(this.identity," with the same source: ").concat(a.source),Object.assign(Object.assign({},this.logContext),{oldTrack:Zn(c),newTrack:Zn(a)})),this.addTrackPublication(a)}t.set(i.sid,a)}),this.trackPublications.forEach(i=>{t.has(i.trackSid)||(this.log.trace("detected removed track on remote participant, unpublishing",Object.assign(Object.assign({},this.logContext),Zn(i))),this.unpublishTrack(i.trackSid,!0))}),r.forEach(i=>{this.emit(Ne.TrackPublished,i)}),!0}unpublishTrack(e,t){const r=this.trackPublications.get(e);if(!r)return;const{track:i}=r;switch(i&&(i.stop(),r.setTrack(void 0)),this.trackPublications.delete(e),r.kind){case Me.Kind.Audio:this.audioTrackPublications.delete(e);break;case Me.Kind.Video:this.videoTrackPublications.delete(e);break}t&&this.emit(Ne.TrackUnpublished,r)}setAudioOutput(e){return ie(this,void 0,void 0,function*(){this.audioOutput=e;const t=[];this.audioTrackPublications.forEach(r=>{var i;Pa(r.track)&&XS(r.track)&&t.push(r.track.setSinkId((i=e.deviceId)!==null&&i!==void 0?i:"default"))}),yield Promise.all(t)})}emit(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return this.log.trace("participant event",Object.assign(Object.assign({},this.logContext),{event:e,args:r})),super.emit(e,...r)}}var qn;(function(n){n.Disconnected="disconnected",n.Connecting="connecting",n.Connected="connected",n.Reconnecting="reconnecting",n.SignalReconnecting="signalReconnecting"})(qn||(qn={}));const fF=4*1e3;class Wu extends Yo.EventEmitter{constructor(e){var t,r,i,s;if(super(),t=this,this.state=qn.Disconnected,this.activeSpeakers=[],this.isE2EEEnabled=!1,this.audioEnabled=!0,this.isVideoPlaybackBlocked=!1,this.log=kn,this.bufferedEvents=[],this.isResuming=!1,this.byteStreamControllers=new Map,this.textStreamControllers=new Map,this.byteStreamHandlers=new Map,this.textStreamHandlers=new Map,this.rpcHandlers=new Map,this.connect=(o,a,l)=>ie(this,void 0,void 0,function*(){var c;if(!aB())throw Xo()?Error("WebRTC isn't detected, have you called registerGlobals?"):Error("LiveKit doesn't seem to be supported on this browser. Try to update your browser and make sure no browser extensions are disabling webRTC.");const u=yield this.disconnectLock.lock();if(this.state===qn.Connected)return this.log.info("already connected to room ".concat(this.name),this.logContext),u(),Promise.resolve();if(this.connectFuture)return u(),this.connectFuture.promise;this.setAndEmitConnectionState(qn.Connecting),((c=this.regionUrlProvider)===null||c===void 0?void 0:c.getServerUrl().toString())!==o&&(this.regionUrl=void 0,this.regionUrlProvider=void 0),WS(new URL(o))&&(this.regionUrlProvider===void 0?this.regionUrlProvider=new KS(o,a):this.regionUrlProvider.updateToken(a),this.regionUrlProvider.fetchRegionSettings().then(m=>{var g;(g=this.regionUrlProvider)===null||g===void 0||g.setServerReportedRegions(m)}).catch(m=>{this.log.warn("could not fetch region settings",Object.assign(Object.assign({},this.logContext),{error:m}))}));const d=(m,g,O)=>ie(this,void 0,void 0,function*(){var y,b;this.abortController&&this.abortController.abort();const S=new AbortController;this.abortController=S,u==null||u();try{yield this.attemptConnection(O??o,a,l,S),this.abortController=void 0,m()}catch(P){if(this.regionUrlProvider&&P instanceof Jn&&P.reason!==_n.Cancelled&&P.reason!==_n.NotAllowed){let k=null;try{k=yield this.regionUrlProvider.getNextBestRegionUrl((y=this.abortController)===null||y===void 0?void 0:y.signal)}catch(x){if(x instanceof Jn&&(x.status===401||x.reason===_n.Cancelled)){this.handleDisconnect(this.options.stopLocalTrackOnUnpublish),g(x);return}}k&&!(!((b=this.abortController)===null||b===void 0)&&b.signal.aborted)?(this.log.info("Initial connection failed with ConnectionError: ".concat(P.message,". Retrying with another region: ").concat(k),this.logContext),this.recreateEngine(),yield d(m,g,k)):(this.handleDisconnect(this.options.stopLocalTrackOnUnpublish,OC(P)),g(P))}else{let k=co.UNKNOWN_REASON;P instanceof Jn&&(k=OC(P)),this.handleDisconnect(this.options.stopLocalTrackOnUnpublish,k),g(P)}}}),h=this.regionUrl;return this.regionUrl=void 0,this.connectFuture=new zQ((m,g)=>{d(m,g,h)},()=>{this.clearConnectionFutures()}),this.connectFuture.promise}),this.connectSignal=(o,a,l,c,u,d)=>ie(this,void 0,void 0,function*(){var h,m,g;const O=yield l.join(o,a,{autoSubscribe:c.autoSubscribe,adaptiveStream:typeof u.adaptiveStream=="object"?!0:u.adaptiveStream,maxRetries:c.maxRetries,e2eeEnabled:!!this.e2eeManager,websocketTimeout:c.websocketTimeout},d.signal);let y=O.serverInfo;if(y||(y={version:O.serverVersion,region:O.serverRegion}),this.serverInfo=y,this.log.debug("connected to Livekit Server ".concat(Object.entries(y).map(b=>{let[S,P]=b;return"".concat(S,": ").concat(P)}).join(", ")),{room:(h=O.room)===null||h===void 0?void 0:h.name,roomSid:(m=O.room)===null||m===void 0?void 0:m.sid,identity:(g=O.participant)===null||g===void 0?void 0:g.identity}),!y.version)throw new ZU("unknown server version");return y.version==="0.15.1"&&this.options.dynacast&&(this.log.debug("disabling dynacast due to server version",this.logContext),u.dynacast=!1),O}),this.applyJoinResponse=o=>{const a=o.participant;if(this.localParticipant.sid=a.sid,this.localParticipant.identity=a.identity,this.localParticipant.setEnabledPublishCodecs(o.enabledPublishCodecs),this.options.e2ee&&this.e2eeManager)try{this.e2eeManager.setSifTrailer(o.sifTrailer)}catch(l){this.log.error(l instanceof Error?l.message:"Could not set SifTrailer",Object.assign(Object.assign({},this.logContext),{error:l}))}this.handleParticipantUpdates([a,...o.otherParticipants]),o.room&&this.handleRoomUpdate(o.room)},this.attemptConnection=(o,a,l,c)=>ie(this,void 0,void 0,function*(){var u,d;this.state===qn.Reconnecting||this.isResuming||!((u=this.engine)===null||u===void 0)&&u.pendingReconnect?(this.log.info("Reconnection attempt replaced by new connection attempt",this.logContext),this.recreateEngine()):this.maybeCreateEngine(),!((d=this.regionUrlProvider)===null||d===void 0)&&d.isCloud()&&this.engine.setRegionUrlProvider(this.regionUrlProvider),this.acquireAudioContext(),this.connOptions=Object.assign(Object.assign({},jw),l),this.connOptions.rtcConfig&&(this.engine.rtcConfig=this.connOptions.rtcConfig),this.connOptions.peerConnectionTimeout&&(this.engine.peerConnectionTimeout=this.connOptions.peerConnectionTimeout);try{const h=yield this.connectSignal(o,a,this.engine,this.connOptions,this.options,c);this.applyJoinResponse(h),this.setupLocalParticipantEvents(),this.emit(Ce.SignalConnected)}catch(h){yield this.engine.close(),this.recreateEngine();const m=new Jn("could not establish signal connection",_n.ServerUnreachable);throw h instanceof Error&&(m.message="".concat(m.message,": ").concat(h.message)),h instanceof Jn&&(m.reason=h.reason,m.status=h.status),this.log.debug("error trying to establish signal connection",Object.assign(Object.assign({},this.logContext),{error:h})),m}if(c.signal.aborted)throw yield this.engine.close(),this.recreateEngine(),new Jn("Connection attempt aborted",_n.Cancelled);try{yield this.engine.waitForPCInitialConnection(this.connOptions.peerConnectionTimeout,c)}catch(h){throw yield this.engine.close(),this.recreateEngine(),h}rs()&&this.options.disconnectOnPageLeave&&(window.addEventListener("pagehide",this.onPageLeave),window.addEventListener("beforeunload",this.onPageLeave)),rs()&&document.addEventListener("freeze",this.onPageLeave),this.setAndEmitConnectionState(qn.Connected),this.emit(Ce.Connected),this.registerConnectionReconcile()}),this.disconnect=function(){for(var o=arguments.length,a=new Array(o),l=0;l<o;l++)a[l]=arguments[l];return ie(t,[...a],void 0,function(){var c=this;let u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return function*(){var d,h,m,g;const O=yield c.disconnectLock.lock();try{if(c.state===qn.Disconnected){c.log.debug("already disconnected",c.logContext);return}c.log.info("disconnect from room",Object.assign({},c.logContext)),(c.state===qn.Connecting||c.state===qn.Reconnecting||c.isResuming)&&(c.log.warn("abort connection attempt",c.logContext),(d=c.abortController)===null||d===void 0||d.abort(),(m=(h=c.connectFuture)===null||h===void 0?void 0:h.reject)===null||m===void 0||m.call(h,new Jn("Client initiated disconnect",_n.Cancelled)),c.connectFuture=void 0),!((g=c.engine)===null||g===void 0)&&g.client.isDisconnected||(yield c.engine.client.sendLeave()),c.engine&&(yield c.engine.close()),c.handleDisconnect(u,co.CLIENT_INITIATED),c.engine=void 0}finally{O()}}()})},this.onPageLeave=()=>ie(this,void 0,void 0,function*(){this.log.info("Page leave detected, disconnecting",this.logContext),yield this.disconnect()}),this.startAudio=()=>ie(this,void 0,void 0,function*(){const o=[],a=Wo();if(a&&a.os==="iOS"){const l="livekit-dummy-audio-el";let c=document.getElementById(l);if(!c){c=document.createElement("audio"),c.id=l,c.autoplay=!0,c.hidden=!0;const u=e0();u.enabled=!0;const d=new MediaStream([u]);c.srcObject=d,document.addEventListener("visibilitychange",()=>{c&&(c.srcObject=document.hidden?null:d,document.hidden||(this.log.debug("page visible again, triggering startAudio to resume playback and update playback status",this.logContext),this.startAudio()))}),document.body.append(c),this.once(Ce.Disconnected,()=>{c==null||c.remove(),c=null})}o.push(c)}this.remoteParticipants.forEach(l=>{l.audioTrackPublications.forEach(c=>{c.track&&c.track.attachedElements.forEach(u=>{o.push(u)})})});try{yield Promise.all([this.acquireAudioContext(),...o.map(l=>(l.muted=!1,l.play()))]),this.handleAudioPlaybackStarted()}catch(l){throw this.handleAudioPlaybackFailed(l),l}}),this.startVideo=()=>ie(this,void 0,void 0,function*(){const o=[];for(const a of this.remoteParticipants.values())a.videoTrackPublications.forEach(l=>{var c;(c=l.track)===null||c===void 0||c.attachedElements.forEach(u=>{o.includes(u)||o.push(u)})});yield Promise.all(o.map(a=>a.play())).then(()=>{this.handleVideoPlaybackStarted()}).catch(a=>{a.name==="NotAllowedError"?this.handleVideoPlaybackFailed():this.log.warn("Resuming video playback failed, make sure you call `startVideo` directly in a user gesture handler",this.logContext)})}),this.handleRestarting=()=>{this.clearConnectionReconcile(),this.isResuming=!1;for(const o of this.remoteParticipants.values())this.handleParticipantDisconnected(o.identity,o);this.setAndEmitConnectionState(qn.Reconnecting)&&this.emit(Ce.Reconnecting)},this.handleSignalRestarted=o=>ie(this,void 0,void 0,function*(){this.log.debug("signal reconnected to server, region ".concat(o.serverRegion),Object.assign(Object.assign({},this.logContext),{region:o.serverRegion})),this.bufferedEvents=[],this.applyJoinResponse(o);try{yield this.localParticipant.republishAllTracks(void 0,!0)}catch(a){this.log.error("error trying to re-publish tracks after reconnection",Object.assign(Object.assign({},this.logContext),{error:a}))}try{yield this.engine.waitForRestarted(),this.log.debug("fully reconnected to server",Object.assign(Object.assign({},this.logContext),{region:o.serverRegion}))}catch{return}this.setAndEmitConnectionState(qn.Connected),this.emit(Ce.Reconnected),this.registerConnectionReconcile(),this.emitBufferedEvents()}),this.handleParticipantUpdates=o=>{o.forEach(a=>{var l;if(a.identity===this.localParticipant.identity){this.localParticipant.updateInfo(a);return}a.identity===""&&(a.identity=(l=this.sidToIdentity.get(a.sid))!==null&&l!==void 0?l:"");let c=this.remoteParticipants.get(a.identity);a.state===kS.DISCONNECTED?this.handleParticipantDisconnected(a.identity,c):c=this.getOrCreateParticipant(a.identity,a)})},this.handleActiveSpeakersUpdate=o=>{const a=[],l={};o.forEach(c=>{if(l[c.sid]=!0,c.sid===this.localParticipant.sid)this.localParticipant.audioLevel=c.level,this.localParticipant.setIsSpeaking(!0),a.push(this.localParticipant);else{const u=this.getRemoteParticipantBySid(c.sid);u&&(u.audioLevel=c.level,u.setIsSpeaking(!0),a.push(u))}}),l[this.localParticipant.sid]||(this.localParticipant.audioLevel=0,this.localParticipant.setIsSpeaking(!1)),this.remoteParticipants.forEach(c=>{l[c.sid]||(c.audioLevel=0,c.setIsSpeaking(!1))}),this.activeSpeakers=a,this.emitWhenConnected(Ce.ActiveSpeakersChanged,a)},this.handleSpeakersChanged=o=>{const a=new Map;this.activeSpeakers.forEach(c=>{const u=this.remoteParticipants.get(c.identity);u&&u.sid!==c.sid||a.set(c.sid,c)}),o.forEach(c=>{let u=this.getRemoteParticipantBySid(c.sid);c.sid===this.localParticipant.sid&&(u=this.localParticipant),u&&(u.audioLevel=c.level,u.setIsSpeaking(c.active),c.active?a.set(c.sid,u):a.delete(c.sid))});const l=Array.from(a.values());l.sort((c,u)=>u.audioLevel-c.audioLevel),this.activeSpeakers=l,this.emitWhenConnected(Ce.ActiveSpeakersChanged,l)},this.handleStreamStateUpdate=o=>{o.streamStates.forEach(a=>{const l=this.getRemoteParticipantBySid(a.participantSid);if(!l)return;const c=l.getTrackPublicationBySid(a.trackSid);if(!c||!c.track)return;const u=Me.streamStateFromProto(a.state);u!==c.track.streamState&&(c.track.streamState=u,l.emit(Ne.TrackStreamStateChanged,c,c.track.streamState),this.emitWhenConnected(Ce.TrackStreamStateChanged,c,c.track.streamState,l))})},this.handleSubscriptionPermissionUpdate=o=>{const a=this.getRemoteParticipantBySid(o.participantSid);if(!a)return;const l=a.getTrackPublicationBySid(o.trackSid);l&&l.setAllowed(o.allowed)},this.handleSubscriptionError=o=>{const a=Array.from(this.remoteParticipants.values()).find(c=>c.trackPublications.has(o.trackSid));if(!a)return;const l=a.getTrackPublicationBySid(o.trackSid);l&&l.setSubscriptionError(o.err)},this.handleDataPacket=o=>{const a=this.remoteParticipants.get(o.participantIdentity);if(o.value.case==="user")this.handleUserPacket(a,o.value.value,o.kind);else if(o.value.case==="transcription")this.handleTranscription(a,o.value.value);else if(o.value.case==="sipDtmf")this.handleSipDtmf(a,o.value.value);else if(o.value.case==="chatMessage")this.handleChatMessage(a,o.value.value);else if(o.value.case==="metrics")this.handleMetrics(o.value.value,a);else if(o.value.case==="streamHeader")this.handleStreamHeader(o.value.value,o.participantIdentity);else if(o.value.case==="streamChunk")this.handleStreamChunk(o.value.value);else if(o.value.case==="streamTrailer")this.handleStreamTrailer(o.value.value);else if(o.value.case==="rpcRequest"){const l=o.value.value;this.handleIncomingRpcRequest(o.participantIdentity,l.id,l.method,l.payload,l.responseTimeoutMs,l.version)}},this.handleUserPacket=(o,a,l)=>{this.emit(Ce.DataReceived,a.payload,o,l,a.topic),o==null||o.emit(Ne.DataReceived,a.payload,l)},this.handleSipDtmf=(o,a)=>{this.emit(Ce.SipDTMFReceived,a,o),o==null||o.emit(Ne.SipDTMFReceived,a)},this.bufferedSegments=new Map,this.handleTranscription=(o,a)=>{const l=a.transcribedParticipantIdentity===this.localParticipant.identity?this.localParticipant:this.getParticipantByIdentity(a.transcribedParticipantIdentity),c=l==null?void 0:l.trackPublications.get(a.trackId),u=mB(a,this.transcriptionReceivedTimes);c==null||c.emit(nt.TranscriptionReceived,u),l==null||l.emit(Ne.TranscriptionReceived,u,c),this.emit(Ce.TranscriptionReceived,u,l,c)},this.handleChatMessage=(o,a)=>{const l=gB(a);this.emit(Ce.ChatMessage,l,o)},this.handleMetrics=(o,a)=>{this.emit(Ce.MetricsReceived,o,a)},this.handleAudioPlaybackStarted=()=>{this.canPlaybackAudio||(this.audioEnabled=!0,this.emit(Ce.AudioPlaybackStatusChanged,!0))},this.handleAudioPlaybackFailed=o=>{this.log.warn("could not playback audio",Object.assign(Object.assign({},this.logContext),{error:o})),this.canPlaybackAudio&&(this.audioEnabled=!1,this.emit(Ce.AudioPlaybackStatusChanged,!1))},this.handleVideoPlaybackStarted=()=>{this.isVideoPlaybackBlocked&&(this.isVideoPlaybackBlocked=!1,this.emit(Ce.VideoPlaybackStatusChanged,!0))},this.handleVideoPlaybackFailed=()=>{this.isVideoPlaybackBlocked||(this.isVideoPlaybackBlocked=!0,this.emit(Ce.VideoPlaybackStatusChanged,!1))},this.handleDeviceChange=()=>ie(this,void 0,void 0,function*(){var o,a;const l=li.getInstance().previousDevices,c=yield li.getInstance().getDevices(void 0,!1),u=Wo();if((u==null?void 0:u.name)==="Chrome"&&u.os!=="iOS")for(let h of c){const m=l.find(g=>g.deviceId===h.deviceId);m&&m.label!==""&&m.kind===h.kind&&m.label!==h.label&&this.getActiveDevice(h.kind)==="default"&&this.emit(Ce.ActiveDeviceChanged,h.kind,h.deviceId)}const d=["audiooutput","audioinput","videoinput"];for(let h of d){const m=c.filter(O=>O.kind===h),g=this.getActiveDevice(h);if(g===((o=l.filter(O=>O.kind===h)[0])===null||o===void 0?void 0:o.deviceId)&&m.length>0&&((a=m[0])===null||a===void 0?void 0:a.deviceId)!==g){yield this.switchActiveDevice(h,m[0].deviceId);continue}h==="audioinput"&&!Pl()||h==="videoinput"||m.length>0&&!m.find(O=>O.deviceId===this.getActiveDevice(h))&&(yield this.switchActiveDevice(h,m[0].deviceId))}this.emit(Ce.MediaDevicesChanged)}),this.handleRoomUpdate=o=>{const a=this.roomInfo;this.roomInfo=o,a&&a.metadata!==o.metadata&&this.emitWhenConnected(Ce.RoomMetadataChanged,o.metadata),(a==null?void 0:a.activeRecording)!==o.activeRecording&&this.emitWhenConnected(Ce.RecordingStatusChanged,o.activeRecording)},this.handleConnectionQualityUpdate=o=>{o.updates.forEach(a=>{if(a.participantSid===this.localParticipant.sid){this.localParticipant.setConnectionQuality(a.quality);return}const l=this.getRemoteParticipantBySid(a.participantSid);l&&l.setConnectionQuality(a.quality)})},this.onLocalParticipantMetadataChanged=o=>{this.emit(Ce.ParticipantMetadataChanged,o,this.localParticipant)},this.onLocalParticipantNameChanged=o=>{this.emit(Ce.ParticipantNameChanged,o,this.localParticipant)},this.onLocalAttributesChanged=o=>{this.emit(Ce.ParticipantAttributesChanged,o,this.localParticipant)},this.onLocalTrackMuted=o=>{this.emit(Ce.TrackMuted,o,this.localParticipant)},this.onLocalTrackUnmuted=o=>{this.emit(Ce.TrackUnmuted,o,this.localParticipant)},this.onTrackProcessorUpdate=o=>{var a;(a=o==null?void 0:o.onPublish)===null||a===void 0||a.call(o,this)},this.onLocalTrackPublished=o=>ie(this,void 0,void 0,function*(){var a,l,c,u,d,h;(a=o.track)===null||a===void 0||a.on(nt.TrackProcessorUpdate,this.onTrackProcessorUpdate),(l=o.track)===null||l===void 0||l.on(nt.Restarted,this.onLocalTrackRestarted),(d=(u=(c=o.track)===null||c===void 0?void 0:c.getProcessor())===null||u===void 0?void 0:u.onPublish)===null||d===void 0||d.call(u,this),this.emit(Ce.LocalTrackPublished,o,this.localParticipant),cc(o.track)&&(yield o.track.checkForSilence())&&this.emit(Ce.LocalAudioSilenceDetected,o);const m=yield(h=o.track)===null||h===void 0?void 0:h.getDeviceId(!1),g=vC(o.source);g&&m&&m!==this.localParticipant.activeDeviceMap.get(g)&&(this.localParticipant.activeDeviceMap.set(g,m),this.emit(Ce.ActiveDeviceChanged,g,m))}),this.onLocalTrackUnpublished=o=>{var a,l;(a=o.track)===null||a===void 0||a.off(nt.TrackProcessorUpdate,this.onTrackProcessorUpdate),(l=o.track)===null||l===void 0||l.off(nt.Restarted,this.onLocalTrackRestarted),this.emit(Ce.LocalTrackUnpublished,o,this.localParticipant)},this.onLocalTrackRestarted=o=>ie(this,void 0,void 0,function*(){const a=yield o.getDeviceId(!1),l=vC(o.source);l&&a&&a!==this.localParticipant.activeDeviceMap.get(l)&&(this.log.debug("local track restarted, setting ".concat(l," ").concat(a," active"),this.logContext),this.localParticipant.activeDeviceMap.set(l,a),this.emit(Ce.ActiveDeviceChanged,l,a))}),this.onLocalConnectionQualityChanged=o=>{this.emit(Ce.ConnectionQualityChanged,o,this.localParticipant)},this.onMediaDevicesError=o=>{this.emit(Ce.MediaDevicesError,o)},this.onLocalParticipantPermissionsChanged=o=>{this.emit(Ce.ParticipantPermissionsChanged,o,this.localParticipant)},this.onLocalChatMessageSent=o=>{this.emit(Ce.ChatMessage,o,this.localParticipant)},this.setMaxListeners(100),this.remoteParticipants=new Map,this.sidToIdentity=new Map,this.options=Object.assign(Object.assign({},jB),e),this.log=ka((r=this.options.loggerName)!==null&&r!==void 0?r:uo.Room),this.transcriptionReceivedTimes=new Map,this.options.audioCaptureDefaults=Object.assign(Object.assign({},KQ),e==null?void 0:e.audioCaptureDefaults),this.options.videoCaptureDefaults=Object.assign(Object.assign({},JQ),e==null?void 0:e.videoCaptureDefaults),this.options.publishDefaults=Object.assign(Object.assign({},IB),e==null?void 0:e.publishDefaults),this.maybeCreateEngine(),this.disconnectLock=new vs,this.localParticipant=new uF("","",this.engine,this.options,this.rpcHandlers),this.options.videoCaptureDefaults.deviceId&&this.localParticipant.activeDeviceMap.set("videoinput",Sl(this.options.videoCaptureDefaults.deviceId)),this.options.audioCaptureDefaults.deviceId&&this.localParticipant.activeDeviceMap.set("audioinput",Sl(this.options.audioCaptureDefaults.deviceId)),!((i=this.options.audioOutput)===null||i===void 0)&&i.deviceId&&this.switchActiveDevice("audiooutput",Sl(this.options.audioOutput.deviceId)).catch(o=>this.log.warn("Could not set audio output: ".concat(o.message),this.logContext)),this.options.e2ee&&this.setupE2EE(),rs()){const o=new AbortController;(s=navigator.mediaDevices)===null||s===void 0||s.addEventListener("devicechange",this.handleDeviceChange,{signal:o.signal}),Wu.cleanupRegistry&&Wu.cleanupRegistry.register(this,()=>{o.abort()})}}registerTextStreamHandler(e,t){if(this.textStreamHandlers.has(e))throw new TypeError('A text stream handler for topic "'.concat(e,'" has already been set.'));this.textStreamHandlers.set(e,t)}unregisterTextStreamHandler(e){this.textStreamHandlers.delete(e)}registerByteStreamHandler(e,t){if(this.byteStreamHandlers.has(e))throw new TypeError('A byte stream handler for topic "'.concat(e,'" has already been set.'));this.byteStreamHandlers.set(e,t)}unregisterByteStreamHandler(e){this.byteStreamHandlers.delete(e)}registerRpcMethod(e,t){if(this.rpcHandlers.has(e))throw Error("RPC handler already registered for method ".concat(e,", unregisterRpcMethod before trying to register again"));this.rpcHandlers.set(e,t)}unregisterRpcMethod(e){this.rpcHandlers.delete(e)}handleIncomingRpcRequest(e,t,r,i,s,o){return ie(this,void 0,void 0,function*(){if(yield this.engine.publishRpcAck(e,t),o!==1){yield this.engine.publishRpcResponse(e,t,null,Mr.builtIn("UNSUPPORTED_VERSION"));return}const a=this.rpcHandlers.get(r);if(!a){yield this.engine.publishRpcResponse(e,t,null,Mr.builtIn("UNSUPPORTED_METHOD"));return}let l=null,c=null;try{const u=yield a({requestId:t,callerIdentity:e,payload:i,responseTimeout:s});Nw(u)>eD?(l=Mr.builtIn("RESPONSE_PAYLOAD_TOO_LARGE"),console.warn("RPC Response payload too large for ".concat(r))):c=u}catch(u){u instanceof Mr?l=u:(console.warn("Uncaught error returned by RPC handler for ".concat(r,". Returning APPLICATION_ERROR instead."),u),l=Mr.builtIn("APPLICATION_ERROR"))}yield this.engine.publishRpcResponse(e,t,c,l)})}setE2EEEnabled(e){return ie(this,void 0,void 0,function*(){if(this.e2eeManager)yield Promise.all([this.localParticipant.setE2EEEnabled(e)]),this.localParticipant.identity!==""&&this.e2eeManager.setParticipantCryptorEnabled(e,this.localParticipant.identity);else throw Error("e2ee not configured, please set e2ee settings within the room options")})}setupE2EE(){var e;this.options.e2ee&&("e2eeManager"in this.options.e2ee?this.e2eeManager=this.options.e2ee.e2eeManager:this.e2eeManager=new xB(this.options.e2ee),this.e2eeManager.on(pl.ParticipantEncryptionStatusChanged,(t,r)=>{vB(r)&&(this.isE2EEEnabled=t),this.emit(Ce.ParticipantEncryptionStatusChanged,t,r)}),this.e2eeManager.on(pl.EncryptionError,t=>this.emit(Ce.EncryptionError,t)),(e=this.e2eeManager)===null||e===void 0||e.setup(this))}get logContext(){var e;return{room:this.name,roomID:(e=this.roomInfo)===null||e===void 0?void 0:e.sid,participant:this.localParticipant.identity,pID:this.localParticipant.sid}}get isRecording(){var e,t;return(t=(e=this.roomInfo)===null||e===void 0?void 0:e.activeRecording)!==null&&t!==void 0?t:!1}getSid(){return ie(this,void 0,void 0,function*(){return this.state===qn.Disconnected?"":this.roomInfo&&this.roomInfo.sid!==""?this.roomInfo.sid:new Promise((e,t)=>{const r=i=>{i.sid!==""&&(this.engine.off(lt.RoomUpdate,r),e(i.sid))};this.engine.on(lt.RoomUpdate,r),this.once(Ce.Disconnected,()=>{this.engine.off(lt.RoomUpdate,r),t("Room disconnected before room server id was available")})})})}get name(){var e,t;return(t=(e=this.roomInfo)===null||e===void 0?void 0:e.name)!==null&&t!==void 0?t:""}get metadata(){var e;return(e=this.roomInfo)===null||e===void 0?void 0:e.metadata}get numParticipants(){var e,t;return(t=(e=this.roomInfo)===null||e===void 0?void 0:e.numParticipants)!==null&&t!==void 0?t:0}get numPublishers(){var e,t;return(t=(e=this.roomInfo)===null||e===void 0?void 0:e.numPublishers)!==null&&t!==void 0?t:0}maybeCreateEngine(){this.engine&&!this.engine.isClosed||(this.engine=new KB(this.options),this.engine.on(lt.ParticipantUpdate,this.handleParticipantUpdates).on(lt.RoomUpdate,this.handleRoomUpdate).on(lt.SpeakersChanged,this.handleSpeakersChanged).on(lt.StreamStateChanged,this.handleStreamStateUpdate).on(lt.ConnectionQualityUpdate,this.handleConnectionQualityUpdate).on(lt.SubscriptionError,this.handleSubscriptionError).on(lt.SubscriptionPermissionUpdate,this.handleSubscriptionPermissionUpdate).on(lt.MediaTrackAdded,(e,t,r)=>{this.onTrackAdded(e,t,r)}).on(lt.Disconnected,e=>{this.handleDisconnect(this.options.stopLocalTrackOnUnpublish,e)}).on(lt.ActiveSpeakersUpdate,this.handleActiveSpeakersUpdate).on(lt.DataPacketReceived,this.handleDataPacket).on(lt.Resuming,()=>{this.clearConnectionReconcile(),this.isResuming=!0,this.log.info("Resuming signal connection",this.logContext),this.setAndEmitConnectionState(qn.SignalReconnecting)&&this.emit(Ce.SignalReconnecting)}).on(lt.Resumed,()=>{this.registerConnectionReconcile(),this.isResuming=!1,this.log.info("Resumed signal connection",this.logContext),this.updateSubscriptions(),this.emitBufferedEvents(),this.setAndEmitConnectionState(qn.Connected)&&this.emit(Ce.Reconnected)}).on(lt.SignalResumed,()=>{this.bufferedEvents=[],(this.state===qn.Reconnecting||this.isResuming)&&this.sendSyncState()}).on(lt.Restarting,this.handleRestarting).on(lt.SignalRestarted,this.handleSignalRestarted).on(lt.Offline,()=>{this.setAndEmitConnectionState(qn.Reconnecting)&&this.emit(Ce.Reconnecting)}).on(lt.DCBufferStatusChanged,(e,t)=>{this.emit(Ce.DCBufferStatusChanged,e,t)}).on(lt.LocalTrackSubscribed,e=>{const t=this.localParticipant.getTrackPublications().find(r=>{let{trackSid:i}=r;return i===e});if(!t){this.log.warn("could not find local track subscription for subscribed event",this.logContext);return}this.localParticipant.emit(Ne.LocalTrackSubscribed,t),this.emitWhenConnected(Ce.LocalTrackSubscribed,t,this.localParticipant)}),this.localParticipant&&this.localParticipant.setupEngine(this.engine),this.e2eeManager&&this.e2eeManager.setupEngine(this.engine))}static getLocalDevices(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return li.getInstance().getDevices(e,t)}prepareConnection(e,t){return ie(this,void 0,void 0,function*(){if(this.state===qn.Disconnected){this.log.debug("prepareConnection to ".concat(e),this.logContext);try{if(WS(new URL(e))&&t){this.regionUrlProvider=new KS(e,t);const r=yield this.regionUrlProvider.getNextBestRegionUrl();r&&this.state===qn.Disconnected&&(this.regionUrl=r,yield fetch(gC(r),{method:"HEAD"}),this.log.debug("prepared connection to ".concat(r),this.logContext))}else yield fetch(gC(e),{method:"HEAD"})}catch(r){this.log.warn("could not prepare connection",Object.assign(Object.assign({},this.logContext),{error:r}))}}})}getParticipantByIdentity(e){return this.localParticipant.identity===e?this.localParticipant:this.remoteParticipants.get(e)}clearConnectionFutures(){this.connectFuture=void 0}simulateScenario(e,t){return ie(this,void 0,void 0,function*(){let r=()=>{},i;switch(e){case"signal-reconnect":yield this.engine.client.handleOnClose("simulate disconnect");break;case"speaker":i=new Co({scenario:{case:"speakerUpdate",value:3}});break;case"node-failure":i=new Co({scenario:{case:"nodeFailure",value:!0}});break;case"server-leave":i=new Co({scenario:{case:"serverLeave",value:!0}});break;case"migration":i=new Co({scenario:{case:"migration",value:!0}});break;case"resume-reconnect":this.engine.failNext(),yield this.engine.client.handleOnClose("simulate resume-disconnect");break;case"disconnect-signal-on-resume":r=()=>ie(this,void 0,void 0,function*(){yield this.engine.client.handleOnClose("simulate resume-disconnect")}),i=new Co({scenario:{case:"disconnectSignalOnResume",value:!0}});break;case"disconnect-signal-on-resume-no-messages":r=()=>ie(this,void 0,void 0,function*(){yield this.engine.client.handleOnClose("simulate resume-disconnect")}),i=new Co({scenario:{case:"disconnectSignalOnResumeNoMessages",value:!0}});break;case"full-reconnect":this.engine.fullReconnectOnNext=!0,yield this.engine.client.handleOnClose("simulate full-reconnect");break;case"force-tcp":case"force-tls":i=new Co({scenario:{case:"switchCandidateProtocol",value:e==="force-tls"?2:1}}),r=()=>ie(this,void 0,void 0,function*(){const s=this.engine.client.onLeave;s&&s(new LO({reason:co.CLIENT_INITIATED,action:Eu.RECONNECT}))});break;case"subscriber-bandwidth":if(t===void 0||typeof t!="number")throw new Error("subscriber-bandwidth requires a number as argument");i=new Co({scenario:{case:"subscriberBandwidth",value:lc(t)}});break;case"leave-full-reconnect":i=new Co({scenario:{case:"leaveRequestFullReconnect",value:!0}})}i&&(yield this.engine.client.sendSimulateScenario(i),yield r())})}get canPlaybackAudio(){return this.audioEnabled}get canPlaybackVideo(){return!this.isVideoPlaybackBlocked}getActiveDevice(e){return this.localParticipant.activeDeviceMap.get(e)}switchActiveDevice(e,t){return ie(this,arguments,void 0,function(r,i){var s=this;let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return function*(){var a,l,c,u,d,h,m,g;let O=!0,y=!1;const b=o?{exact:i}:i;if(r==="audioinput"){y=s.localParticipant.audioTrackPublications.size===0;const S=(a=s.getActiveDevice(r))!==null&&a!==void 0?a:s.options.audioCaptureDefaults.deviceId;s.options.audioCaptureDefaults.deviceId=b;const P=Array.from(s.localParticipant.audioTrackPublications.values()).filter(k=>k.source===Me.Source.Microphone);try{O=(yield Promise.all(P.map(k=>{var x;return(x=k.audioTrack)===null||x===void 0?void 0:x.setDeviceId(b)}))).every(k=>k===!0)}catch(k){throw s.options.audioCaptureDefaults.deviceId=S,k}}else if(r==="videoinput"){y=s.localParticipant.videoTrackPublications.size===0;const S=(l=s.getActiveDevice(r))!==null&&l!==void 0?l:s.options.videoCaptureDefaults.deviceId;s.options.videoCaptureDefaults.deviceId=b;const P=Array.from(s.localParticipant.videoTrackPublications.values()).filter(k=>k.source===Me.Source.Camera);try{O=(yield Promise.all(P.map(k=>{var x;return(x=k.videoTrack)===null||x===void 0?void 0:x.setDeviceId(b)}))).every(k=>k===!0)}catch(k){throw s.options.videoCaptureDefaults.deviceId=S,k}}else if(r==="audiooutput"){if(!ZS()&&!s.options.webAudioMix||s.options.webAudioMix&&s.audioContext&&!("setSinkId"in s.audioContext))throw new Error("cannot switch audio output, setSinkId not supported");s.options.webAudioMix&&(i=(c=yield li.getInstance().normalizeDeviceId("audiooutput",i))!==null&&c!==void 0?c:""),(u=(g=s.options).audioOutput)!==null&&u!==void 0||(g.audioOutput={});const S=(d=s.getActiveDevice(r))!==null&&d!==void 0?d:s.options.audioOutput.deviceId;s.options.audioOutput.deviceId=i;try{s.options.webAudioMix&&((h=s.audioContext)===null||h===void 0||h.setSinkId(i)),yield Promise.all(Array.from(s.remoteParticipants.values()).map(P=>P.setAudioOutput({deviceId:i})))}catch(P){throw s.options.audioOutput.deviceId=S,P}}return(y||r==="audiooutput")&&(s.localParticipant.activeDeviceMap.set(r,r==="audiooutput"&&((m=s.options.audioOutput)===null||m===void 0?void 0:m.deviceId)||i),s.emit(Ce.ActiveDeviceChanged,r,i)),O}()})}setupLocalParticipantEvents(){this.localParticipant.on(Ne.ParticipantMetadataChanged,this.onLocalParticipantMetadataChanged).on(Ne.ParticipantNameChanged,this.onLocalParticipantNameChanged).on(Ne.AttributesChanged,this.onLocalAttributesChanged).on(Ne.TrackMuted,this.onLocalTrackMuted).on(Ne.TrackUnmuted,this.onLocalTrackUnmuted).on(Ne.LocalTrackPublished,this.onLocalTrackPublished).on(Ne.LocalTrackUnpublished,this.onLocalTrackUnpublished).on(Ne.ConnectionQualityChanged,this.onLocalConnectionQualityChanged).on(Ne.MediaDevicesError,this.onMediaDevicesError).on(Ne.AudioStreamAcquired,this.startAudio).on(Ne.ChatMessage,this.onLocalChatMessageSent).on(Ne.ParticipantPermissionsChanged,this.onLocalParticipantPermissionsChanged)}recreateEngine(){var e;(e=this.engine)===null||e===void 0||e.close(),this.engine=void 0,this.isResuming=!1,this.remoteParticipants.clear(),this.sidToIdentity.clear(),this.bufferedEvents=[],this.maybeCreateEngine()}onTrackAdded(e,t,r){if(this.state===qn.Connecting||this.state===qn.Reconnecting){const u=()=>{this.onTrackAdded(e,t,r),d()},d=()=>{this.off(Ce.Reconnected,u),this.off(Ce.Connected,u),this.off(Ce.Disconnected,d)};this.once(Ce.Reconnected,u),this.once(Ce.Connected,u),this.once(Ce.Disconnected,d);return}if(this.state===qn.Disconnected){this.log.warn("skipping incoming track after Room disconnected",this.logContext);return}if(e.readyState==="ended"){this.log.info("skipping incoming track as it already ended",this.logContext);return}const i=iB(t.id),s=i[0];let o=i[1],a=e.id;if(o&&o.startsWith("TR")&&(a=o),s===this.localParticipant.sid){this.log.warn("tried to create RemoteParticipant for local participant",this.logContext);return}const l=Array.from(this.remoteParticipants.values()).find(u=>u.sid===s);if(!l){this.log.error("Tried to add a track for a participant, that's not present. Sid: ".concat(s),this.logContext);return}let c;this.options.adaptiveStream&&(typeof this.options.adaptiveStream=="object"?c=this.options.adaptiveStream:c={}),l.addSubscribedMediaTrack(e,a,t,r,c)}handleDisconnect(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,t=arguments.length>1?arguments[1]:void 0;var r;if(this.clearConnectionReconcile(),this.isResuming=!1,this.bufferedEvents=[],this.transcriptionReceivedTimes.clear(),this.state!==qn.Disconnected){this.regionUrl=void 0;try{this.remoteParticipants.forEach(i=>{i.trackPublications.forEach(s=>{i.unpublishTrack(s.trackSid)})}),this.localParticipant.trackPublications.forEach(i=>{var s,o,a;i.track&&this.localParticipant.unpublishTrack(i.track,e),e?((s=i.track)===null||s===void 0||s.detach(),(o=i.track)===null||o===void 0||o.stop()):(a=i.track)===null||a===void 0||a.stopMonitor()}),this.localParticipant.off(Ne.ParticipantMetadataChanged,this.onLocalParticipantMetadataChanged).off(Ne.ParticipantNameChanged,this.onLocalParticipantNameChanged).off(Ne.AttributesChanged,this.onLocalAttributesChanged).off(Ne.TrackMuted,this.onLocalTrackMuted).off(Ne.TrackUnmuted,this.onLocalTrackUnmuted).off(Ne.LocalTrackPublished,this.onLocalTrackPublished).off(Ne.LocalTrackUnpublished,this.onLocalTrackUnpublished).off(Ne.ConnectionQualityChanged,this.onLocalConnectionQualityChanged).off(Ne.MediaDevicesError,this.onMediaDevicesError).off(Ne.AudioStreamAcquired,this.startAudio).off(Ne.ChatMessage,this.onLocalChatMessageSent).off(Ne.ParticipantPermissionsChanged,this.onLocalParticipantPermissionsChanged),this.localParticipant.trackPublications.clear(),this.localParticipant.videoTrackPublications.clear(),this.localParticipant.audioTrackPublications.clear(),this.remoteParticipants.clear(),this.sidToIdentity.clear(),this.activeSpeakers=[],this.audioContext&&typeof this.options.webAudioMix=="boolean"&&(this.audioContext.close(),this.audioContext=void 0),rs()&&(window.removeEventListener("beforeunload",this.onPageLeave),window.removeEventListener("pagehide",this.onPageLeave),window.removeEventListener("freeze",this.onPageLeave),(r=navigator.mediaDevices)===null||r===void 0||r.removeEventListener("devicechange",this.handleDeviceChange))}finally{this.setAndEmitConnectionState(qn.Disconnected),this.emit(Ce.Disconnected,t)}}}handleParticipantDisconnected(e,t){var r;this.remoteParticipants.delete(e),t&&(t.trackPublications.forEach(i=>{t.unpublishTrack(i.trackSid,!0)}),this.emit(Ce.ParticipantDisconnected,t),(r=this.localParticipant)===null||r===void 0||r.handleParticipantDisconnected(t.identity))}handleStreamHeader(e,t){return ie(this,void 0,void 0,function*(){var r;if(e.contentHeader.case==="byteHeader"){const i=this.byteStreamHandlers.get(e.topic);if(!i){this.log.debug("ignoring incoming byte stream due to no handler for topic",e.topic);return}let s;const o={id:e.streamId,name:(r=e.contentHeader.value.name)!==null&&r!==void 0?r:"unknown",mimeType:e.mimeType,size:e.totalLength?Number(e.totalLength):void 0,topic:e.topic,timestamp:Sg(e.timestamp),attributes:e.attributes},a=new ReadableStream({start:l=>{s=l,this.byteStreamControllers.set(e.streamId,{info:o,controller:s,startTime:Date.now()})}});i(new nF(o,a,Sg(e.totalLength)),{identity:t})}else if(e.contentHeader.case==="textHeader"){const i=this.textStreamHandlers.get(e.topic);if(!i){this.log.debug("ignoring incoming text stream due to no handler for topic",e.topic);return}let s;const o={id:e.streamId,mimeType:e.mimeType,size:e.totalLength?Number(e.totalLength):void 0,topic:e.topic,timestamp:Number(e.timestamp),attributes:e.attributes},a=new ReadableStream({start:l=>{s=l,this.textStreamControllers.set(e.streamId,{info:o,controller:s,startTime:Date.now()})}});i(new rF(o,a,Sg(e.totalLength)),{identity:t})}})}handleStreamChunk(e){const t=this.byteStreamControllers.get(e.streamId);t&&e.content.length>0&&t.controller.enqueue(e);const r=this.textStreamControllers.get(e.streamId);r&&e.content.length>0&&r.controller.enqueue(e)}handleStreamTrailer(e){const t=this.textStreamControllers.get(e.streamId);t&&(t.info.attributes=Object.assign(Object.assign({},t.info.attributes),e.attributes),t.controller.close(),this.textStreamControllers.delete(e.streamId));const r=this.byteStreamControllers.get(e.streamId);r&&(r.info.attributes=Object.assign(Object.assign({},r.info.attributes),e.attributes),r.controller.close(),this.byteStreamControllers.delete(e.streamId))}acquireAudioContext(){return ie(this,void 0,void 0,function*(){var e,t;if(typeof this.options.webAudioMix!="boolean"&&this.options.webAudioMix.audioContext?this.audioContext=this.options.webAudioMix.audioContext:(!this.audioContext||this.audioContext.state==="closed")&&(this.audioContext=(e=HQ())!==null&&e!==void 0?e:void 0),this.options.webAudioMix&&this.remoteParticipants.forEach(i=>i.setAudioContext(this.audioContext)),this.localParticipant.setAudioContext(this.audioContext),this.audioContext&&this.audioContext.state==="suspended")try{yield Promise.race([this.audioContext.resume(),os(200)])}catch(i){this.log.warn("Could not resume audio context",Object.assign(Object.assign({},this.logContext),{error:i}))}const r=((t=this.audioContext)===null||t===void 0?void 0:t.state)==="running";r!==this.canPlaybackAudio&&(this.audioEnabled=r,this.emit(Ce.AudioPlaybackStatusChanged,r))})}createParticipant(e,t){var r;let i;return t?i=Gg.fromParticipantInfo(this.engine.client,t,{loggerContextCb:()=>this.logContext,loggerName:this.options.loggerName}):i=new Gg(this.engine.client,"",e,void 0,void 0,void 0,{loggerContextCb:()=>this.logContext,loggerName:this.options.loggerName}),this.options.webAudioMix&&i.setAudioContext(this.audioContext),!((r=this.options.audioOutput)===null||r===void 0)&&r.deviceId&&i.setAudioOutput(this.options.audioOutput).catch(s=>this.log.warn("Could not set audio output: ".concat(s.message),this.logContext)),i}getOrCreateParticipant(e,t){if(this.remoteParticipants.has(e)){const i=this.remoteParticipants.get(e);return t&&i.updateInfo(t)&&this.sidToIdentity.set(t.sid,t.identity),i}const r=this.createParticipant(e,t);return this.remoteParticipants.set(e,r),this.sidToIdentity.set(t.sid,t.identity),this.emitWhenConnected(Ce.ParticipantConnected,r),r.on(Ne.TrackPublished,i=>{this.emitWhenConnected(Ce.TrackPublished,i,r)}).on(Ne.TrackSubscribed,(i,s)=>{i.kind===Me.Kind.Audio?(i.on(nt.AudioPlaybackStarted,this.handleAudioPlaybackStarted),i.on(nt.AudioPlaybackFailed,this.handleAudioPlaybackFailed)):i.kind===Me.Kind.Video&&(i.on(nt.VideoPlaybackFailed,this.handleVideoPlaybackFailed),i.on(nt.VideoPlaybackStarted,this.handleVideoPlaybackStarted)),this.emit(Ce.TrackSubscribed,i,s,r)}).on(Ne.TrackUnpublished,i=>{this.emit(Ce.TrackUnpublished,i,r)}).on(Ne.TrackUnsubscribed,(i,s)=>{this.emit(Ce.TrackUnsubscribed,i,s,r)}).on(Ne.TrackMuted,i=>{this.emitWhenConnected(Ce.TrackMuted,i,r)}).on(Ne.TrackUnmuted,i=>{this.emitWhenConnected(Ce.TrackUnmuted,i,r)}).on(Ne.ParticipantMetadataChanged,i=>{this.emitWhenConnected(Ce.ParticipantMetadataChanged,i,r)}).on(Ne.ParticipantNameChanged,i=>{this.emitWhenConnected(Ce.ParticipantNameChanged,i,r)}).on(Ne.AttributesChanged,i=>{this.emitWhenConnected(Ce.ParticipantAttributesChanged,i,r)}).on(Ne.ConnectionQualityChanged,i=>{this.emitWhenConnected(Ce.ConnectionQualityChanged,i,r)}).on(Ne.ParticipantPermissionsChanged,i=>{this.emitWhenConnected(Ce.ParticipantPermissionsChanged,i,r)}).on(Ne.TrackSubscriptionStatusChanged,(i,s)=>{this.emitWhenConnected(Ce.TrackSubscriptionStatusChanged,i,s,r)}).on(Ne.TrackSubscriptionFailed,(i,s)=>{this.emit(Ce.TrackSubscriptionFailed,i,r,s)}).on(Ne.TrackSubscriptionPermissionChanged,(i,s)=>{this.emitWhenConnected(Ce.TrackSubscriptionPermissionChanged,i,s,r)}),t&&r.updateInfo(t),r}sendSyncState(){const e=Array.from(this.remoteParticipants.values()).reduce((r,i)=>(r.push(...i.getTrackPublications()),r),[]),t=this.localParticipant.getTrackPublications();this.engine.sendSyncState(e,t)}updateSubscriptions(){for(const e of this.remoteParticipants.values())for(const t of e.videoTrackPublications.values())t.isSubscribed&&OB(t)&&t.emitTrackUpdate()}getRemoteParticipantBySid(e){const t=this.sidToIdentity.get(e);if(t)return this.remoteParticipants.get(t)}registerConnectionReconcile(){this.clearConnectionReconcile();let e=0;this.connectionReconcileInterval=Oi.setInterval(()=>{!this.engine||this.engine.isClosed||!this.engine.verifyTransport()?(e++,this.log.warn("detected connection state mismatch",Object.assign(Object.assign({},this.logContext),{numFailures:e,engine:this.engine?{closed:this.engine.isClosed,transportsConnected:this.engine.verifyTransport()}:void 0})),e>=3&&(this.recreateEngine(),this.handleDisconnect(this.options.stopLocalTrackOnUnpublish,co.STATE_MISMATCH))):e=0},fF)}clearConnectionReconcile(){this.connectionReconcileInterval&&Oi.clearInterval(this.connectionReconcileInterval)}setAndEmitConnectionState(e){return e===this.state?!1:(this.state=e,this.emit(Ce.ConnectionStateChanged,this.state),!0)}emitBufferedEvents(){this.bufferedEvents.forEach(e=>{let[t,r]=e;this.emit(t,...r)}),this.bufferedEvents=[]}emitWhenConnected(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];if(this.state===qn.Reconnecting||this.isResuming||!this.engine||this.engine.pendingReconnect)this.bufferedEvents.push([e,r]);else if(this.state===qn.Connected)return this.emit(e,...r);return!1}simulateParticipants(e){return ie(this,void 0,void 0,function*(){var t,r;const i=Object.assign({audio:!0,video:!0,useRealTracks:!1},e.publish),s=Object.assign({count:9,audio:!1,video:!0,aspectRatios:[1.66,1.7,1.3]},e.participants);if(this.handleDisconnect(),this.roomInfo=new Pw({sid:"RM_SIMULATED",name:"simulated-room",emptyTimeout:0,maxParticipants:0,creationTime:yr.parse(new Date().getTime()),metadata:"",numParticipants:1,numPublishers:1,turnPassword:"",enabledCodecs:[],activeRecording:!1}),this.localParticipant.updateInfo(new Nd({identity:"simulated-local",name:"local-name"})),this.setupLocalParticipantEvents(),this.emit(Ce.SignalConnected),this.emit(Ce.Connected),this.setAndEmitConnectionState(qn.Connected),i.video){const o=new e1(Me.Kind.Video,new Pu({source:Br.CAMERA,sid:Math.floor(Math.random()*1e4).toString(),type:ao.AUDIO,name:"video-dummy"}),new Yg(i.useRealTracks?(yield window.navigator.mediaDevices.getUserMedia({video:!0})).getVideoTracks()[0]:mC(160*((t=s.aspectRatios[0])!==null&&t!==void 0?t:1),160,!0,!0),void 0,!1,{loggerName:this.options.loggerName,loggerContextCb:()=>this.logContext}),{loggerName:this.options.loggerName,loggerContextCb:()=>this.logContext});this.localParticipant.addTrackPublication(o),this.localParticipant.emit(Ne.LocalTrackPublished,o)}if(i.audio){const o=new e1(Me.Kind.Audio,new Pu({source:Br.MICROPHONE,sid:Math.floor(Math.random()*1e4).toString(),type:ao.AUDIO}),new zg(i.useRealTracks?(yield navigator.mediaDevices.getUserMedia({audio:!0})).getAudioTracks()[0]:e0(),void 0,!1,this.audioContext,{loggerName:this.options.loggerName,loggerContextCb:()=>this.logContext}),{loggerName:this.options.loggerName,loggerContextCb:()=>this.logContext});this.localParticipant.addTrackPublication(o),this.localParticipant.emit(Ne.LocalTrackPublished,o)}for(let o=0;o<s.count-1;o+=1){let a=new Nd({sid:Math.floor(Math.random()*1e4).toString(),identity:"simulated-".concat(o),state:kS.ACTIVE,tracks:[],joinedAt:yr.parse(Date.now())});const l=this.getOrCreateParticipant(a.identity,a);if(s.video){const c=mC(160*((r=s.aspectRatios[o%s.aspectRatios.length])!==null&&r!==void 0?r:1),160,!1,!0),u=new Pu({source:Br.CAMERA,sid:Math.floor(Math.random()*1e4).toString(),type:ao.AUDIO});l.addSubscribedMediaTrack(c,u.sid,new MediaStream([c]),new RTCRtpReceiver),a.tracks=[...a.tracks,u]}if(s.audio){const c=e0(),u=new Pu({source:Br.MICROPHONE,sid:Math.floor(Math.random()*1e4).toString(),type:ao.AUDIO});l.addSubscribedMediaTrack(c,u.sid,new MediaStream([c]),new RTCRtpReceiver),a.tracks=[...a.tracks,u]}l.updateInfo(a)}})}emit(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];if(e!==Ce.ActiveSpeakersChanged&&e!==Ce.TranscriptionReceived){const s=uD(r).filter(o=>o!==void 0);this.log.debug("room event ".concat(e),Object.assign(Object.assign({},this.logContext),{event:e,args:s}))}return super.emit(e,...r)}}Wu.cleanupRegistry=typeof FinalizationRegistry<"u"&&new FinalizationRegistry(n=>{n()});function uD(n){return n.map(e=>{if(e)return Array.isArray(e)?uD(e):typeof e=="object"?"logContext"in e?e.logContext:void 0:e})}var oo;(function(n){n[n.IDLE=0]="IDLE",n[n.RUNNING=1]="RUNNING",n[n.SKIPPED=2]="SKIPPED",n[n.SUCCESS=3]="SUCCESS",n[n.FAILED=4]="FAILED"})(oo||(oo={}));class Ql extends Yo.EventEmitter{constructor(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};super(),this.status=oo.IDLE,this.logs=[],this.options={},this.url=e,this.token=t,this.name=this.constructor.name,this.room=new Wu(r.roomOptions),this.connectOptions=r.connectOptions,this.options=r}run(e){return ie(this,void 0,void 0,function*(){if(this.status!==oo.IDLE)throw Error("check is running already");this.setStatus(oo.RUNNING);try{yield this.perform()}catch(t){t instanceof Error&&(this.options.errorsAsWarnings?this.appendWarning(t.message):this.appendError(t.message))}return yield this.disconnect(),yield new Promise(t=>setTimeout(t,500)),this.status!==oo.SKIPPED&&this.setStatus(this.isSuccess()?oo.SUCCESS:oo.FAILED),e&&e(),this.getInfo()})}isSuccess(){return!this.logs.some(e=>e.level==="error")}connect(e){return ie(this,void 0,void 0,function*(){return this.room.state===qn.Connected?this.room:(e||(e=this.url),yield this.room.connect(e,this.token,this.connectOptions),this.room)})}disconnect(){return ie(this,void 0,void 0,function*(){this.room&&this.room.state!==qn.Disconnected&&(yield this.room.disconnect(),yield new Promise(e=>setTimeout(e,500)))})}skip(){this.setStatus(oo.SKIPPED)}switchProtocol(e){return ie(this,void 0,void 0,function*(){let t=!1,r=!1;if(this.room.on(Ce.Reconnecting,()=>{t=!0}),this.room.once(Ce.Reconnected,()=>{r=!0}),this.room.simulateScenario("force-".concat(e)),yield new Promise(s=>setTimeout(s,1e3)),!t)return;const i=Date.now()+1e4;for(;Date.now()<i;){if(r)return;yield os(100)}throw new Error("Could not reconnect using ".concat(e," protocol after 10 seconds"))})}appendMessage(e){this.logs.push({level:"info",message:e}),this.emit("update",this.getInfo())}appendWarning(e){this.logs.push({level:"warning",message:e}),this.emit("update",this.getInfo())}appendError(e){this.logs.push({level:"error",message:e}),this.emit("update",this.getInfo())}setStatus(e){this.status=e,this.emit("update",this.getInfo())}get engine(){var e;return(e=this.room)===null||e===void 0?void 0:e.engine}getInfo(){return{logs:this.logs,name:this.name,status:this.status,description:this.description}}}class dF extends Ql{get description(){return"Cloud regions"}perform(){return ie(this,void 0,void 0,function*(){const e=new KS(this.url,this.token);if(!e.isCloud()){this.skip();return}const t=[],r=new Set;for(let s=0;s<3;s++){const o=yield e.getNextBestRegionUrl();if(!o)break;if(r.has(o))continue;r.add(o);const a=yield this.checkCloudRegion(o);this.appendMessage("".concat(a.region," RTT: ").concat(a.rtt,"ms, duration: ").concat(a.duration,"ms")),t.push(a)}t.sort((s,o)=>(s.duration-o.duration)*.5+(s.rtt-o.rtt)*.5);const i=t[0];this.bestStats=i,this.appendMessage("best Cloud region: ".concat(i.region))})}getInfo(){const e=super.getInfo();return e.data=this.bestStats,e}checkCloudRegion(e){return ie(this,void 0,void 0,function*(){var t,r;yield this.connect(e),this.options.protocol==="tcp"&&(yield this.switchProtocol("tcp"));const i=(t=this.room.serverInfo)===null||t===void 0?void 0:t.region;if(!i)throw new Error("Region not found");const s=yield this.room.localParticipant.streamText({topic:"test"}),o=1e3,l=1e6/o,c="A".repeat(o),u=Date.now();for(let g=0;g<l;g++)yield s.write(c);yield s.close();const d=Date.now(),h=yield(r=this.room.engine.pcManager)===null||r===void 0?void 0:r.publisher.getStats(),m={region:i,rtt:1e4,duration:d-u};return h==null||h.forEach(g=>{g.type==="candidate-pair"&&g.nominated&&(m.rtt=g.currentRoundTripTime*1e3)}),yield this.disconnect(),m})}}const c0=1e4;class hF extends Ql{get description(){return"Connection via UDP vs TCP"}perform(){return ie(this,void 0,void 0,function*(){const e=yield this.checkConnectionProtocol("udp"),t=yield this.checkConnectionProtocol("tcp");this.bestStats=e,e.qualityLimitationDurations.bandwidth-t.qualityLimitationDurations.bandwidth>.5||(e.packetsLost-t.packetsLost)/e.packetsSent>.01?(this.appendMessage("best connection quality via tcp"),this.bestStats=t):this.appendMessage("best connection quality via udp");const r=this.bestStats;this.appendMessage("upstream bitrate: ".concat((r.bitrateTotal/r.count/1e3/1e3).toFixed(2)," mbps")),this.appendMessage("RTT: ".concat((r.rttTotal/r.count*1e3).toFixed(2)," ms")),this.appendMessage("jitter: ".concat((r.jitterTotal/r.count*1e3).toFixed(2)," ms")),r.packetsLost>0&&this.appendWarning("packets lost: ".concat((r.packetsLost/r.packetsSent*100).toFixed(2),"%")),r.qualityLimitationDurations.bandwidth>1&&this.appendWarning("bandwidth limited ".concat((r.qualityLimitationDurations.bandwidth/(c0/1e3)*100).toFixed(2),"%")),r.qualityLimitationDurations.cpu>0&&this.appendWarning("cpu limited ".concat((r.qualityLimitationDurations.cpu/(c0/1e3)*100).toFixed(2),"%"))})}getInfo(){const e=super.getInfo();return e.data=this.bestStats,e}checkConnectionProtocol(e){return ie(this,void 0,void 0,function*(){yield this.connect(),e==="tcp"?yield this.switchProtocol("tcp"):yield this.switchProtocol("udp");const t=document.createElement("canvas");t.width=1280,t.height=720;const r=t.getContext("2d");if(!r)throw new Error("Could not get canvas context");let i=0;const s=()=>{i=(i+1)%360,r.fillStyle="hsl(".concat(i,", 100%, 50%)"),r.fillRect(0,0,t.width,t.height),requestAnimationFrame(s)};s();const a=t.captureStream(30).getVideoTracks()[0],c=(yield this.room.localParticipant.publishTrack(a,{simulcast:!1,degradationPreference:"maintain-resolution",videoEncoding:{maxBitrate:2e6}})).track,u={protocol:e,packetsLost:0,packetsSent:0,qualityLimitationDurations:{},rttTotal:0,jitterTotal:0,bitrateTotal:0,count:0},d=setInterval(()=>ie(this,void 0,void 0,function*(){const h=yield c.getRTCStatsReport();h==null||h.forEach(m=>{m.type==="outbound-rtp"?(u.packetsSent=m.packetsSent,u.qualityLimitationDurations=m.qualityLimitationDurations,u.bitrateTotal+=m.targetBitrate,u.count++):m.type==="remote-inbound-rtp"&&(u.packetsLost=m.packetsLost,u.rttTotal+=m.roundTripTime,u.jitterTotal+=m.jitter)})}),1e3);return yield new Promise(h=>setTimeout(h,c0)),clearInterval(d),a.stop(),t.remove(),yield this.disconnect(),u})}}function fD(n){return ie(this,void 0,void 0,function*(){var e,t;n??(n={}),(e=n.audio)!==null&&e!==void 0||(n.audio={deviceId:"default"}),(t=n.video)!==null&&t!==void 0||(n.video={deviceId:"default"});const{audioProcessor:r,videoProcessor:i}=Mw(n),s=YQ(n,KQ,JQ),o=UO(s),a=navigator.mediaDevices.getUserMedia(o);n.audio&&(li.userMediaPromiseMap.set("audioinput",a),a.catch(()=>li.userMediaPromiseMap.delete("audioinput"))),n.video&&(li.userMediaPromiseMap.set("videoinput",a),a.catch(()=>li.userMediaPromiseMap.delete("videoinput")));const l=yield a;return Promise.all(l.getTracks().map(c=>ie(this,void 0,void 0,function*(){const u=c.kind==="audio";u?s.audio:s.video;let d;const h=u?o.audio:o.video;typeof h!="boolean"&&(d=h);const m=c.getSettings().deviceId;d!=null&&d.deviceId&&Sl(d.deviceId)!==m?d.deviceId=m:d||(d={deviceId:m});const g=nD(c,d);return g.kind===Me.Kind.Video?g.source=Me.Source.Camera:g.kind===Me.Kind.Audio&&(g.source=Me.Source.Microphone),g.mediaStream=l,Pa(g)&&r?yield g.setProcessor(r):lf(g)&&i&&(yield g.setProcessor(i)),g})))})}function pF(n){return ie(this,void 0,void 0,function*(){return(yield fD({audio:!1,video:n}))[0]})}function mF(n){return ie(this,void 0,void 0,function*(){return(yield fD({audio:n,video:!1}))[0]})}class gF extends Ql{get description(){return"Can publish audio"}perform(){return ie(this,void 0,void 0,function*(){var e;const t=yield this.connect(),r=yield mF();if(yield GQ(r,1e3))throw new Error("unable to detect audio from microphone");this.appendMessage("detected audio from microphone"),t.localParticipant.publishTrack(r),yield new Promise(a=>setTimeout(a,3e3));const s=yield(e=r.sender)===null||e===void 0?void 0:e.getStats();if(!s)throw new Error("Could not get RTCStats");let o=0;if(s.forEach(a=>{a.type==="outbound-rtp"&&(a.kind==="audio"||!a.kind&&a.mediaType==="audio")&&(o=a.packetsSent)}),o===0)throw new Error("Could not determine packets are sent");this.appendMessage("published ".concat(o," audio packets"))})}}class OF extends Ql{get description(){return"Can publish video"}perform(){return ie(this,void 0,void 0,function*(){var e;const t=yield this.connect(),r=yield pF();yield this.checkForVideo(r.mediaStreamTrack),t.localParticipant.publishTrack(r),yield new Promise(o=>setTimeout(o,5e3));const i=yield(e=r.sender)===null||e===void 0?void 0:e.getStats();if(!i)throw new Error("Could not get RTCStats");let s=0;if(i.forEach(o=>{o.type==="outbound-rtp"&&(o.kind==="video"||!o.kind&&o.mediaType==="video")&&(s+=o.packetsSent)}),s===0)throw new Error("Could not determine packets are sent");this.appendMessage("published ".concat(s," video packets"))})}checkForVideo(e){return ie(this,void 0,void 0,function*(){const t=new MediaStream;t.addTrack(e.clone());const r=document.createElement("video");r.srcObject=t,r.muted=!0,yield new Promise(i=>{r.onplay=()=>{setTimeout(()=>{var s,o,a,l;const c=document.createElement("canvas"),u=e.getSettings(),d=(o=(s=u.width)!==null&&s!==void 0?s:r.videoWidth)!==null&&o!==void 0?o:1280,h=(l=(a=u.height)!==null&&a!==void 0?a:r.videoHeight)!==null&&l!==void 0?l:720;c.width=d,c.height=h;const m=c.getContext("2d");m.drawImage(r,0,0);const O=m.getImageData(0,0,c.width,c.height).data;let y=!0;for(let b=0;b<O.length;b+=4)if(O[b]!==0||O[b+1]!==0||O[b+2]!==0){y=!1;break}y?this.appendError("camera appears to be producing only black frames"):this.appendMessage("received video frames"),i()},1e3)},r.play()}),r.remove()})}}class vF extends Ql{get description(){return"Resuming connection after interruption"}perform(){return ie(this,void 0,void 0,function*(){var e;const t=yield this.connect();let r=!1,i=!1,s;const o=new Promise(c=>{setTimeout(c,5e3),s=c}),a=()=>{r=!0};t.on(Ce.SignalReconnecting,a).on(Ce.Reconnecting,a).on(Ce.Reconnected,()=>{i=!0,s(!0)}),(e=t.engine.client.ws)===null||e===void 0||e.close();const l=t.engine.client.onClose;if(l&&l(""),yield o,r){if(!i||t.state!==qn.Connected)throw this.appendWarning("reconnection is only possible in Redis-based configurations"),new Error("Not able to reconnect")}else throw new Error("Did not attempt to reconnect")})}}class yF extends Ql{get description(){return"Can connect via TURN"}perform(){return ie(this,void 0,void 0,function*(){var e,t;const r=new Qw,i=yield r.join(this.url,this.token,{autoSubscribe:!0,maxRetries:0,e2eeEnabled:!1,websocketTimeout:15e3});let s=!1,o=!1,a=!1;for(let l of i.iceServers)for(let c of l.urls)c.startsWith("turn:")?(o=!0,a=!0):c.startsWith("turns:")&&(o=!0,a=!0,s=!0),c.startsWith("stun:")&&(a=!0);a?o&&!s&&this.appendWarning("TURN is configured server side, but TURN/TLS is unavailable."):this.appendWarning("No STUN servers configured on server side."),yield r.close(),!((t=(e=this.connectOptions)===null||e===void 0?void 0:e.rtcConfig)===null||t===void 0)&&t.iceServers||o?yield this.room.connect(this.url,this.token,{rtcConfig:{iceTransportPolicy:"relay"}}):(this.appendWarning("No TURN servers configured."),this.skip(),yield new Promise(l=>setTimeout(l,0)))})}}class bF extends Ql{get description(){return"Establishing WebRTC connection"}perform(){return ie(this,void 0,void 0,function*(){let e=!1,t=!1;this.room.on(Ce.SignalConnected,()=>{const r=this.room.engine.client.onTrickle;this.room.engine.client.onTrickle=(i,s)=>{if(i.candidate){const o=new RTCIceCandidate(i);let a="".concat(o.protocol," ").concat(o.address,":").concat(o.port," ").concat(o.type);o.address&&(SF(o.address)?a+=" (private)":o.protocol==="tcp"&&o.tcpType==="passive"?(e=!0,a+=" (passive)"):o.protocol==="udp"&&(t=!0)),this.appendMessage(a)}r&&r(i,s)},this.room.engine.pcManager&&(this.room.engine.pcManager.subscriber.onIceCandidateError=i=>{i instanceof RTCPeerConnectionIceErrorEvent&&this.appendWarning("error with ICE candidate: ".concat(i.errorCode," ").concat(i.errorText," ").concat(i.url))})});try{yield this.connect(),kn.info("now the room is connected")}catch(r){throw this.appendWarning("ports need to be open on firewall in order to connect."),r}e||this.appendWarning("Server is not configured for ICE/TCP"),t||this.appendWarning("No public IPv4 UDP candidates were found. Your server is likely not configured correctly")})}}function SF(n){const e=n.split(".");if(e.length===4){if(e[0]==="10")return!0;if(e[0]==="192"&&e[1]==="168")return!0;if(e[0]==="172"){const t=parseInt(e[1],10);if(t>=16&&t<=31)return!0}}return!1}class wF extends Ql{get description(){return"Connecting to signal connection via WebSocket"}perform(){return ie(this,void 0,void 0,function*(){var e,t,r;(this.url.startsWith("ws:")||this.url.startsWith("http:"))&&this.appendWarning("Server is insecure, clients may block connections to it");let i=new Qw;const s=yield i.join(this.url,this.token,{autoSubscribe:!0,maxRetries:0,e2eeEnabled:!1,websocketTimeout:15e3});this.appendMessage("Connected to server, version ".concat(s.serverVersion,".")),((e=s.serverInfo)===null||e===void 0?void 0:e.edition)===H2.Cloud&&(!((t=s.serverInfo)===null||t===void 0)&&t.region)&&this.appendMessage("LiveKit Cloud: ".concat((r=s.serverInfo)===null||r===void 0?void 0:r.region)),yield i.close()})}}class Roe extends Yo.EventEmitter{constructor(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};super(),this.options={},this.checkResults=new Map,this.url=e,this.token=t,this.options=r}getNextCheckId(){const e=this.checkResults.size;return this.checkResults.set(e,{logs:[],status:oo.IDLE,name:"",description:""}),e}updateCheck(e,t){this.checkResults.set(e,t),this.emit("checkUpdate",e,t)}isSuccess(){return Array.from(this.checkResults.values()).every(e=>e.status!==oo.FAILED)}getResults(){return Array.from(this.checkResults.values())}createAndRunCheck(e){return ie(this,void 0,void 0,function*(){const t=this.getNextCheckId(),r=new e(this.url,this.token,this.options),i=o=>{this.updateCheck(t,o)};r.on("update",i);const s=yield r.run();return r.off("update",i),s})}checkWebsocket(){return ie(this,void 0,void 0,function*(){return this.createAndRunCheck(wF)})}checkWebRTC(){return ie(this,void 0,void 0,function*(){return this.createAndRunCheck(bF)})}checkTURN(){return ie(this,void 0,void 0,function*(){return this.createAndRunCheck(yF)})}checkReconnect(){return ie(this,void 0,void 0,function*(){return this.createAndRunCheck(vF)})}checkPublishAudio(){return ie(this,void 0,void 0,function*(){return this.createAndRunCheck(gF)})}checkPublishVideo(){return ie(this,void 0,void 0,function*(){return this.createAndRunCheck(OF)})}checkConnectionProtocol(){return ie(this,void 0,void 0,function*(){const e=yield this.createAndRunCheck(hF);if(e.data&&"protocol"in e.data){const t=e.data;this.options.protocol=t.protocol}return e})}checkCloudRegion(){return ie(this,void 0,void 0,function*(){return this.createAndRunCheck(dF)})}}var _p=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function kF(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var t1={exports:{}},PF=t1.exports,QC;function xF(){return QC||(QC=1,function(n){(function(e,t){n.exports?n.exports=t():e.log=t()})(PF,function(){var e=function(){},t="undefined",r=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),i=["trace","debug","info","warn","error"],s={},o=null;function a(O,y){var b=O[y];if(typeof b.bind=="function")return b.bind(O);try{return Function.prototype.bind.call(b,O)}catch{return function(){return Function.prototype.apply.apply(b,[O,arguments])}}}function l(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function c(O){return O==="debug"&&(O="log"),typeof console===t?!1:O==="trace"&&r?l:console[O]!==void 0?a(console,O):console.log!==void 0?a(console,"log"):e}function u(){for(var O=this.getLevel(),y=0;y<i.length;y++){var b=i[y];this[b]=y<O?e:this.methodFactory(b,O,this.name)}if(this.log=this.debug,typeof console===t&&O<this.levels.SILENT)return"No console available for logging"}function d(O){return function(){typeof console!==t&&(u.call(this),this[O].apply(this,arguments))}}function h(O,y,b){return c(O)||d.apply(this,arguments)}function m(O,y){var b=this,S,P,k,x="loglevel";typeof O=="string"?x+=":"+O:typeof O=="symbol"&&(x=void 0);function A($){var D=(i[$]||"silent").toUpperCase();if(!(typeof window===t||!x)){try{window.localStorage[x]=D;return}catch{}try{window.document.cookie=encodeURIComponent(x)+"="+D+";"}catch{}}}function M(){var $;if(!(typeof window===t||!x)){try{$=window.localStorage[x]}catch{}if(typeof $===t)try{var D=window.document.cookie,F=encodeURIComponent(x),G=D.indexOf(F+"=");G!==-1&&($=/^([^;]+)/.exec(D.slice(G+F.length+1))[1])}catch{}return b.levels[$]===void 0&&($=void 0),$}}function Q(){if(!(typeof window===t||!x)){try{window.localStorage.removeItem(x)}catch{}try{window.document.cookie=encodeURIComponent(x)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function _($){var D=$;if(typeof D=="string"&&b.levels[D.toUpperCase()]!==void 0&&(D=b.levels[D.toUpperCase()]),typeof D=="number"&&D>=0&&D<=b.levels.SILENT)return D;throw new TypeError("log.setLevel() called with invalid level: "+$)}b.name=O,b.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},b.methodFactory=y||h,b.getLevel=function(){return k??P??S},b.setLevel=function($,D){return k=_($),D!==!1&&A(k),u.call(b)},b.setDefaultLevel=function($){P=_($),M()||b.setLevel($,!1)},b.resetLevel=function(){k=null,Q(),u.call(b)},b.enableAll=function($){b.setLevel(b.levels.TRACE,$)},b.disableAll=function($){b.setLevel(b.levels.SILENT,$)},b.rebuild=function(){if(o!==b&&(S=_(o.getLevel())),u.call(b),o===b)for(var $ in s)s[$].rebuild()},S=_(o?o.getLevel():"WARN");var R=M();R!=null&&(k=_(R)),u.call(b)}o=new m,o.getLogger=function(O){if(typeof O!="symbol"&&typeof O!="string"||O==="")throw new TypeError("You must supply a name when creating a logger.");var y=s[O];return y||(y=s[O]=new m(O,o.methodFactory)),y};var g=typeof window!==t?window.log:void 0;return o.noConflict=function(){return typeof window!==t&&window.log===o&&(window.log=g),o},o.getLoggers=function(){return s},o.default=o,o})}(t1)),t1.exports}var TF=xF();const CF=kF(TF);var n1=function(n,e){return n1=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])},n1(n,e)};function _a(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");n1(n,e);function t(){this.constructor=n}n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function _F(n,e,t,r){function i(s){return s instanceof t?s:new t(function(o){o(s)})}return new(t||(t=Promise))(function(s,o){function a(u){try{c(r.next(u))}catch(d){o(d)}}function l(u){try{c(r.throw(u))}catch(d){o(d)}}function c(u){u.done?s(u.value):i(u.value).then(a,l)}c((r=r.apply(n,[])).next())})}function dD(n,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(c){return function(u){return l([c,u])}}function l(c){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(t=0)),t;)try{if(r=1,i&&(s=c[0]&2?i.return:c[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,c[1])).done)return s;switch(i=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,i=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){t.label=c[1];break}if(c[0]===6&&t.label<s[1]){t.label=s[1],s=c;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(c);break}s[2]&&t.ops.pop(),t.trys.pop();continue}c=e.call(n,t)}catch(u){c=[6,u],i=0}finally{r=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function Xu(n){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&n[e],r=0;if(t)return t.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&r>=n.length&&(n=void 0),{value:n&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Hg(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(o)throw o.error}}return s}function Kg(n,e,t){if(arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return n.concat(s||Array.prototype.slice.call(e))}function Qu(n){return this instanceof Qu?(this.v=n,this):new Qu(n)}function EF(n,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=t.apply(n,e||[]),i,s=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),i[Symbol.asyncIterator]=function(){return this},i;function o(m){return function(g){return Promise.resolve(g).then(m,d)}}function a(m,g){r[m]&&(i[m]=function(O){return new Promise(function(y,b){s.push([m,O,y,b])>1||l(m,O)})},g&&(i[m]=g(i[m])))}function l(m,g){try{c(r[m](g))}catch(O){h(s[0][3],O)}}function c(m){m.value instanceof Qu?Promise.resolve(m.value.v).then(u,d):h(s[0][2],m)}function u(m){l("next",m)}function d(m){l("throw",m)}function h(m,g){m(g),s.shift(),s.length&&l(s[0][0],s[0][1])}}function RF(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=n[Symbol.asyncIterator],t;return e?e.call(n):(n=typeof Xu=="function"?Xu(n):n[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(s){t[s]=n[s]&&function(o){return new Promise(function(a,l){o=n[s](o),i(a,l,o.done,o.value)})}}function i(s,o,a,l){Promise.resolve(l).then(function(c){s({value:c,done:a})},o)}}function Jr(n){return typeof n=="function"}function qw(n){var e=function(r){Error.call(r),r.stack=new Error().stack},t=n(e);return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var u0=qw(function(n){return function(e){n(this),this.message=e?e.length+` errors occurred during unsubscription:
|
|
115
|
+
`+e.map(function(t,r){return r+1+") "+t.toString()}).join(`
|
|
116
|
+
`):"",this.name="UnsubscriptionError",this.errors=e}});function Jg(n,e){if(n){var t=n.indexOf(e);0<=t&&n.splice(t,1)}}var dh=function(){function n(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return n.prototype.unsubscribe=function(){var e,t,r,i,s;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var a=Xu(o),l=a.next();!l.done;l=a.next()){var c=l.value;c.remove(this)}}catch(O){e={error:O}}finally{try{l&&!l.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}else o.remove(this);var u=this.initialTeardown;if(Jr(u))try{u()}catch(O){s=O instanceof u0?O.errors:[O]}var d=this._finalizers;if(d){this._finalizers=null;try{for(var h=Xu(d),m=h.next();!m.done;m=h.next()){var g=m.value;try{DC(g)}catch(O){s=s??[],O instanceof u0?s=Kg(Kg([],Hg(s)),Hg(O.errors)):s.push(O)}}}catch(O){r={error:O}}finally{try{m&&!m.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}}if(s)throw new u0(s)}},n.prototype.add=function(e){var t;if(e&&e!==this)if(this.closed)DC(e);else{if(e instanceof n){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(t=this._finalizers)!==null&&t!==void 0?t:[]).push(e)}},n.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},n.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},n.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&Jg(t,e)},n.prototype.remove=function(e){var t=this._finalizers;t&&Jg(t,e),e instanceof n&&e._removeParent(this)},n.EMPTY=function(){var e=new n;return e.closed=!0,e}(),n}(),hD=dh.EMPTY;function pD(n){return n instanceof dh||n&&"closed"in n&&Jr(n.remove)&&Jr(n.add)&&Jr(n.unsubscribe)}function DC(n){Jr(n)?n():n.unsubscribe()}var AF={Promise:void 0},$F={setTimeout:function(n,e){for(var t=[],r=2;r<arguments.length;r++)t[r-2]=arguments[r];return setTimeout.apply(void 0,Kg([n,e],Hg(t)))},clearTimeout:function(n){return clearTimeout(n)},delegate:void 0};function mD(n){$F.setTimeout(function(){throw n})}function IC(){}function kg(n){n()}var Uw=function(n){_a(e,n);function e(t){var r=n.call(this)||this;return r.isStopped=!1,t?(r.destination=t,pD(t)&&t.add(r)):r.destination=DF,r}return e.create=function(t,r,i){return new r1(t,r,i)},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,n.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(dh),MF=function(){function n(e){this.partialObserver=e}return n.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(r){Ep(r)}},n.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(r){Ep(r)}else Ep(e)},n.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(t){Ep(t)}},n}(),r1=function(n){_a(e,n);function e(t,r,i){var s=n.call(this)||this,o;return Jr(t)||!t?o={next:t??void 0,error:r??void 0,complete:i??void 0}:o=t,s.destination=new MF(o),s}return e}(Uw);function Ep(n){mD(n)}function QF(n){throw n}var DF={closed:!0,next:IC,error:QF,complete:IC},Bw=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function gD(n){return n}function IF(n){return n.length===0?gD:n.length===1?n[0]:function(e){return n.reduce(function(t,r){return r(t)},e)}}var bs=function(){function n(e){e&&(this._subscribe=e)}return n.prototype.lift=function(e){var t=new n;return t.source=this,t.operator=e,t},n.prototype.subscribe=function(e,t,r){var i=this,s=NF(e)?e:new r1(e,t,r);return kg(function(){var o=i,a=o.operator,l=o.source;s.add(a?a.call(s,l):l?i._subscribe(s):i._trySubscribe(s))}),s},n.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},n.prototype.forEach=function(e,t){var r=this;return t=jC(t),new t(function(i,s){var o=new r1({next:function(a){try{e(a)}catch(l){s(l),o.unsubscribe()}},error:s,complete:i});r.subscribe(o)})},n.prototype._subscribe=function(e){var t;return(t=this.source)===null||t===void 0?void 0:t.subscribe(e)},n.prototype[Bw]=function(){return this},n.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return IF(e)(this)},n.prototype.toPromise=function(e){var t=this;return e=jC(e),new e(function(r,i){var s;t.subscribe(function(o){return s=o},function(o){return i(o)},function(){return r(s)})})},n.create=function(e){return new n(e)},n}();function jC(n){var e;return(e=n??AF.Promise)!==null&&e!==void 0?e:Promise}function jF(n){return n&&Jr(n.next)&&Jr(n.error)&&Jr(n.complete)}function NF(n){return n&&n instanceof Uw||jF(n)&&pD(n)}function LF(n){return Jr(n==null?void 0:n.lift)}function hh(n){return function(e){if(LF(e))return e.lift(function(t){try{return n(t,this)}catch(r){this.error(r)}});throw new TypeError("Unable to lift unknown Observable type")}}function eO(n,e,t,r,i){return new qF(n,e,t,r,i)}var qF=function(n){_a(e,n);function e(t,r,i,s,o,a){var l=n.call(this,t)||this;return l.onFinalize=o,l.shouldUnsubscribe=a,l._next=r?function(c){try{r(c)}catch(u){t.error(u)}}:n.prototype._next,l._error=s?function(c){try{s(c)}catch(u){t.error(u)}finally{this.unsubscribe()}}:n.prototype._error,l._complete=i?function(){try{i()}catch(c){t.error(c)}finally{this.unsubscribe()}}:n.prototype._complete,l}return e.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;n.prototype.unsubscribe.call(this),!r&&((t=this.onFinalize)===null||t===void 0||t.call(this))}},e}(Uw),UF=qw(function(n){return function(){n(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),OD=function(n){_a(e,n);function e(){var t=n.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return e.prototype.lift=function(t){var r=new NC(this,this);return r.operator=t,r},e.prototype._throwIfClosed=function(){if(this.closed)throw new UF},e.prototype.next=function(t){var r=this;kg(function(){var i,s;if(r._throwIfClosed(),!r.isStopped){r.currentObservers||(r.currentObservers=Array.from(r.observers));try{for(var o=Xu(r.currentObservers),a=o.next();!a.done;a=o.next()){var l=a.value;l.next(t)}}catch(c){i={error:c}}finally{try{a&&!a.done&&(s=o.return)&&s.call(o)}finally{if(i)throw i.error}}}})},e.prototype.error=function(t){var r=this;kg(function(){if(r._throwIfClosed(),!r.isStopped){r.hasError=r.isStopped=!0,r.thrownError=t;for(var i=r.observers;i.length;)i.shift().error(t)}})},e.prototype.complete=function(){var t=this;kg(function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var r=t.observers;r.length;)r.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return((t=this.observers)===null||t===void 0?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(t){return this._throwIfClosed(),n.prototype._trySubscribe.call(this,t)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var r=this,i=this,s=i.hasError,o=i.isStopped,a=i.observers;return s||o?hD:(this.currentObservers=null,a.push(t),new dh(function(){r.currentObservers=null,Jg(a,t)}))},e.prototype._checkFinalizedStatuses=function(t){var r=this,i=r.hasError,s=r.thrownError,o=r.isStopped;i?t.error(s):o&&t.complete()},e.prototype.asObservable=function(){var t=new bs;return t.source=this,t},e.create=function(t,r){return new NC(t,r)},e}(bs),NC=function(n){_a(e,n);function e(t,r){var i=n.call(this)||this;return i.destination=t,i.source=r,i}return e.prototype.next=function(t){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.next)===null||i===void 0||i.call(r,t)},e.prototype.error=function(t){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.error)===null||i===void 0||i.call(r,t)},e.prototype.complete=function(){var t,r;(r=(t=this.destination)===null||t===void 0?void 0:t.complete)===null||r===void 0||r.call(t)},e.prototype._subscribe=function(t){var r,i;return(i=(r=this.source)===null||r===void 0?void 0:r.subscribe(t))!==null&&i!==void 0?i:hD},e}(OD);(function(n){_a(e,n);function e(t){var r=n.call(this)||this;return r._value=t,r}return Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(t){var r=n.prototype._subscribe.call(this,t);return!r.closed&&t.next(this._value),r},e.prototype.getValue=function(){var t=this,r=t.hasError,i=t.thrownError,s=t._value;if(r)throw i;return this._throwIfClosed(),s},e.prototype.next=function(t){n.prototype.next.call(this,this._value=t)},e})(OD);var BF={now:function(){return Date.now()}},FF=function(n){_a(e,n);function e(t,r){return n.call(this)||this}return e.prototype.schedule=function(t,r){return this},e}(dh),LC={setInterval:function(n,e){for(var t=[],r=2;r<arguments.length;r++)t[r-2]=arguments[r];return setInterval.apply(void 0,Kg([n,e],Hg(t)))},clearInterval:function(n){return clearInterval(n)},delegate:void 0},VF=function(n){_a(e,n);function e(t,r){var i=n.call(this,t,r)||this;return i.scheduler=t,i.work=r,i.pending=!1,i}return e.prototype.schedule=function(t,r){var i;if(r===void 0&&(r=0),this.closed)return this;this.state=t;var s=this.id,o=this.scheduler;return s!=null&&(this.id=this.recycleAsyncId(o,s,r)),this.pending=!0,this.delay=r,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(o,this.id,r),this},e.prototype.requestAsyncId=function(t,r,i){return i===void 0&&(i=0),LC.setInterval(t.flush.bind(t,this),i)},e.prototype.recycleAsyncId=function(t,r,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return r;r!=null&&LC.clearInterval(r)},e.prototype.execute=function(t,r){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(t,r);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,r){var i=!1,s;try{this.work(t)}catch(o){i=!0,s=o||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),s},e.prototype.unsubscribe=function(){if(!this.closed){var t=this,r=t.id,i=t.scheduler,s=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,Jg(s,this),r!=null&&(this.id=this.recycleAsyncId(i,r,null)),this.delay=null,n.prototype.unsubscribe.call(this)}},e}(FF),qC=function(){function n(e,t){t===void 0&&(t=n.now),this.schedulerActionCtor=e,this.now=t}return n.prototype.schedule=function(e,t,r){return t===void 0&&(t=0),new this.schedulerActionCtor(this,e).schedule(r,t)},n.now=BF.now,n}(),ZF=function(n){_a(e,n);function e(t,r){r===void 0&&(r=qC.now);var i=n.call(this,t,r)||this;return i.actions=[],i._active=!1,i}return e.prototype.flush=function(t){var r=this.actions;if(this._active){r.push(t);return}var i;this._active=!0;do if(i=t.execute(t.state,t.delay))break;while(t=r.shift());if(this._active=!1,i){for(;t=r.shift();)t.unsubscribe();throw i}},e}(qC);new ZF(VF);function WF(n){return n&&Jr(n.schedule)}function XF(n){return n[n.length-1]}function vD(n){return WF(XF(n))?n.pop():void 0}var yD=function(n){return n&&typeof n.length=="number"&&typeof n!="function"};function bD(n){return Jr(n==null?void 0:n.then)}function SD(n){return Jr(n[Bw])}function wD(n){return Symbol.asyncIterator&&Jr(n==null?void 0:n[Symbol.asyncIterator])}function kD(n){return new TypeError("You provided "+(n!==null&&typeof n=="object"?"an invalid object":"'"+n+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function zF(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var PD=zF();function xD(n){return Jr(n==null?void 0:n[PD])}function TD(n){return EF(this,arguments,function(){var e,t,r,i;return dD(this,function(s){switch(s.label){case 0:e=n.getReader(),s.label=1;case 1:s.trys.push([1,,9,10]),s.label=2;case 2:return[4,Qu(e.read())];case 3:return t=s.sent(),r=t.value,i=t.done,i?[4,Qu(void 0)]:[3,5];case 4:return[2,s.sent()];case 5:return[4,Qu(r)];case 6:return[4,s.sent()];case 7:return s.sent(),[3,2];case 8:return[3,10];case 9:return e.releaseLock(),[7];case 10:return[2]}})})}function CD(n){return Jr(n==null?void 0:n.getReader)}function ph(n){if(n instanceof bs)return n;if(n!=null){if(SD(n))return YF(n);if(yD(n))return GF(n);if(bD(n))return HF(n);if(wD(n))return _D(n);if(xD(n))return KF(n);if(CD(n))return JF(n)}throw kD(n)}function YF(n){return new bs(function(e){var t=n[Bw]();if(Jr(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function GF(n){return new bs(function(e){for(var t=0;t<n.length&&!e.closed;t++)e.next(n[t]);e.complete()})}function HF(n){return new bs(function(e){n.then(function(t){e.closed||(e.next(t),e.complete())},function(t){return e.error(t)}).then(null,mD)})}function KF(n){return new bs(function(e){var t,r;try{for(var i=Xu(n),s=i.next();!s.done;s=i.next()){var o=s.value;if(e.next(o),e.closed)return}}catch(a){t={error:a}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}e.complete()})}function _D(n){return new bs(function(e){e7(n,e).catch(function(t){return e.error(t)})})}function JF(n){return _D(TD(n))}function e7(n,e){var t,r,i,s;return _F(this,void 0,void 0,function(){var o,a;return dD(this,function(l){switch(l.label){case 0:l.trys.push([0,5,6,11]),t=RF(n),l.label=1;case 1:return[4,t.next()];case 2:if(r=l.sent(),!!r.done)return[3,4];if(o=r.value,e.next(o),e.closed)return[2];l.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return a=l.sent(),i={error:a},[3,11];case 6:return l.trys.push([6,,9,10]),r&&!r.done&&(s=t.return)?[4,s.call(t)]:[3,8];case 7:l.sent(),l.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}})})}function Sc(n,e,t,r,i){r===void 0&&(r=0),i===void 0&&(i=!1);var s=e.schedule(function(){t(),i?n.add(this.schedule(null,r)):this.unsubscribe()},r);if(n.add(s),!i)return s}function ED(n,e){return e===void 0&&(e=0),hh(function(t,r){t.subscribe(eO(r,function(i){return Sc(r,n,function(){return r.next(i)},e)},function(){return Sc(r,n,function(){return r.complete()},e)},function(i){return Sc(r,n,function(){return r.error(i)},e)}))})}function RD(n,e){return e===void 0&&(e=0),hh(function(t,r){r.add(n.schedule(function(){return t.subscribe(r)},e))})}function t7(n,e){return ph(n).pipe(RD(e),ED(e))}function n7(n,e){return ph(n).pipe(RD(e),ED(e))}function r7(n,e){return new bs(function(t){var r=0;return e.schedule(function(){r===n.length?t.complete():(t.next(n[r++]),t.closed||this.schedule())})})}function i7(n,e){return new bs(function(t){var r;return Sc(t,e,function(){r=n[PD](),Sc(t,e,function(){var i,s,o;try{i=r.next(),s=i.value,o=i.done}catch(a){t.error(a);return}o?t.complete():t.next(s)},0,!0)}),function(){return Jr(r==null?void 0:r.return)&&r.return()}})}function AD(n,e){if(!n)throw new Error("Iterable cannot be null");return new bs(function(t){Sc(t,e,function(){var r=n[Symbol.asyncIterator]();Sc(t,e,function(){r.next().then(function(i){i.done?t.complete():t.next(i.value)})},0,!0)})})}function s7(n,e){return AD(TD(n),e)}function o7(n,e){if(n!=null){if(SD(n))return t7(n,e);if(yD(n))return r7(n,e);if(bD(n))return n7(n,e);if(wD(n))return AD(n,e);if(xD(n))return i7(n,e);if(CD(n))return s7(n,e)}throw kD(n)}function a7(n,e){return e?o7(n,e):ph(n)}qw(function(n){return function(e){e===void 0&&(e=null),n(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=e}});function FO(n,e){return hh(function(t,r){var i=0;t.subscribe(eO(r,function(s){r.next(n.call(e,s,i++))}))})}function l7(n,e,t,r,i,s,o,a){var l=[],c=0,u=0,d=!1,h=function(){d&&!l.length&&!c&&e.complete()},m=function(O){return c<r?g(O):l.push(O)},g=function(O){c++;var y=!1;ph(t(O,u++)).subscribe(eO(e,function(b){e.next(b)},function(){y=!0},void 0,function(){if(y)try{c--;for(var b=function(){var S=l.shift();o||g(S)};l.length&&c<r;)b();h()}catch(S){e.error(S)}}))};return n.subscribe(eO(e,m,function(){d=!0,h()})),function(){}}function $D(n,e,t){return t===void 0&&(t=1/0),Jr(e)?$D(function(r,i){return FO(function(s,o){return e(r,s,i,o)})(ph(n(r,i)))},t):(typeof e=="number"&&(t=e),hh(function(r,i){return l7(r,i,n,t)}))}function c7(n){return $D(gD,n)}function u7(){return c7(1)}function UC(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return u7()(a7(n,vD(n)))}function VO(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=vD(n);return hh(function(r,i){(t?UC(n,r,t):UC(n,r)).subscribe(i)})}var f7="lk";function Fw(n){return typeof n>"u"?!1:d7(n)||h7(n)}function d7(n){var e;return n?n.hasOwnProperty("participant")&&n.hasOwnProperty("source")&&n.hasOwnProperty("track")&&typeof((e=n.publication)==null?void 0:e.track)<"u":!1}function h7(n){return n?n.hasOwnProperty("participant")&&n.hasOwnProperty("source")&&n.hasOwnProperty("publication")&&typeof n.publication<"u":!1}function p7(n){return n?n.hasOwnProperty("participant")&&n.hasOwnProperty("source")&&typeof n.publication>"u":!1}function m7(n){if(typeof n=="string"||typeof n=="number")return`${n}`;if(p7(n))return`${n.participant.identity}_${n.source}_placeholder`;if(Fw(n))return`${n.participant.identity}_${n.publication.source}_${n.publication.trackSid}`;throw new Error(`Can't generate a id for the given track reference: ${n}`)}var g7=[Ce.ConnectionStateChanged,Ce.RoomMetadataChanged,Ce.ActiveSpeakersChanged,Ce.ConnectionQualityChanged,Ce.ParticipantConnected,Ce.ParticipantDisconnected,Ce.ParticipantPermissionsChanged,Ce.ParticipantMetadataChanged,Ce.ParticipantNameChanged,Ce.ParticipantAttributesChanged,Ce.TrackMuted,Ce.TrackUnmuted,Ce.TrackPublished,Ce.TrackUnpublished,Ce.TrackStreamStateChanged,Ce.TrackSubscriptionFailed,Ce.TrackSubscriptionPermissionChanged,Ce.TrackSubscriptionStatusChanged],O7=[...g7,Ce.LocalTrackPublished,Ce.LocalTrackUnpublished];Ne.TrackPublished,Ne.TrackUnpublished,Ne.TrackMuted,Ne.TrackUnmuted,Ne.TrackStreamStateChanged,Ne.TrackSubscribed,Ne.TrackUnsubscribed,Ne.TrackSubscriptionPermissionChanged,Ne.TrackSubscriptionFailed,Ne.LocalTrackPublished,Ne.LocalTrackUnpublished;var v7=[Ne.ConnectionQualityChanged,Ne.IsSpeakingChanged,Ne.ParticipantMetadataChanged,Ne.ParticipantPermissionsChanged,Ne.TrackMuted,Ne.TrackUnmuted,Ne.TrackPublished,Ne.TrackUnpublished,Ne.TrackStreamStateChanged,Ne.TrackSubscriptionFailed,Ne.TrackSubscriptionPermissionChanged,Ne.TrackSubscriptionStatusChanged];[...v7,Ne.LocalTrackPublished,Ne.LocalTrackUnpublished];var _i=CF.getLogger("lk-components-js");_i.setDefaultLevel("WARN");function MD(n){return typeof n=="object"}function QD(n){return Array.isArray(n)&&n.filter(MD).length>0}function y7(n){return`${f7}-${n}`}function b7(n){const e=i1(n),t=k7(n.participant).pipe(FO(()=>i1(n)),VO(e));return{className:y7(n.source===Me.Source.Camera||n.source===Me.Source.ScreenShare?"participant-media-video":"participant-media-audio"),trackObserver:t}}function i1(n){if(Fw(n))return n.publication;{const{source:e,name:t,participant:r}=n;if(e&&t)return r.getTrackPublications().find(i=>i.source===e&&i.trackName===t);if(t)return r.getTrackPublicationByName(t);if(e)return r.getTrackPublication(e);throw new Error("At least one of source and name needs to be defined")}}function S7(n,...e){return new bs(t=>{const r=()=>{t.next(n)};return e.forEach(i=>{n.on(i,r)}),()=>{e.forEach(i=>{n.off(i,r)})}}).pipe(VO(n))}function w7(n,...e){return new bs(t=>{const r=()=>{t.next(n)};return e.forEach(i=>{n.on(i,r)}),()=>{e.forEach(i=>{n.off(i,r)})}}).pipe(VO(n))}function k7(n){return w7(n,Ne.TrackMuted,Ne.TrackUnmuted,Ne.ParticipantPermissionsChanged,Ne.TrackPublished,Ne.TrackUnpublished,Ne.LocalTrackPublished,Ne.LocalTrackUnpublished,Ne.MediaDevicesError,Ne.TrackSubscriptionStatusChanged).pipe(FO(e=>{const{isMicrophoneEnabled:t,isCameraEnabled:r,isScreenShareEnabled:i}=e,s=e.getTrackPublication(Me.Source.Microphone),o=e.getTrackPublication(Me.Source.Camera);return{isCameraEnabled:r,isMicrophoneEnabled:t,isScreenShareEnabled:i,cameraTrack:o,microphoneTrack:s,participant:e}}))}function P7(){return{className:"lk-room-container"}}function BC(n,e,t=!0){const r=[n.localParticipant,...Array.from(n.remoteParticipants.values())],i=[];return r.forEach(s=>{e.forEach(o=>{const a=Array.from(s.trackPublications.values()).filter(l=>l.source===o&&(!t||l.track)).map(l=>({participant:s,publication:l,source:l.source}));i.push(...a)})}),{trackReferences:i,participants:r}}function x7(n,e,t){var r,i;const s=(r=t.additionalRoomEvents)!=null?r:O7,o=(i=t.onlySubscribed)!=null?i:!0,a=Array.from(new Set([Ce.ParticipantConnected,Ce.ParticipantDisconnected,Ce.ConnectionStateChanged,Ce.LocalTrackPublished,Ce.LocalTrackUnpublished,Ce.TrackPublished,Ce.TrackUnpublished,Ce.TrackSubscriptionStatusChanged,...s]).values());return S7(n,...a).pipe(FO(l=>{const c=BC(l,e,o);return _i.debug(`TrackReference[] was updated. (length ${c.trackReferences.length})`,c),c}),VO(BC(n,e,o)))}L.createContext(void 0);const T7=L.createContext(void 0);function C7(){return L.useContext(T7)}function _7(n){const e=C7(),t=n??e;if(!t)throw new Error("No TrackRef, make sure you are inside a TrackRefContext or pass the TrackRef explicitly");return t}L.createContext(void 0);const DD=L.createContext(void 0);function E7(){return L.useContext(DD)}function R7(n){const e=E7(),t=n??e;if(!t)throw new Error("No room provided, make sure you are inside a Room context or pass the room explicitly");return t}const A7=L.createContext(void 0);function ID(n){var e,t,r="";if(typeof n=="string"||typeof n=="number")r+=n;else if(typeof n=="object")if(Array.isArray(n)){var i=n.length;for(e=0;e<i;e++)n[e]&&(t=ID(n[e]))&&(r&&(r+=" "),r+=t)}else for(t in n)n[t]&&(r&&(r+=" "),r+=t);return r}function $7(){for(var n,e,t=0,r="",i=arguments.length;t<i;t++)(n=arguments[t])&&(e=ID(n))&&(r&&(r+=" "),r+=e);return r}function M7(...n){return(...e)=>{for(const t of n)if(typeof t=="function")try{t(...e)}catch(r){console.error(r)}}}function jD(...n){const e={...n[0]};for(let t=1;t<n.length;t++){const r=n[t];for(const i in r){const s=e[i],o=r[i];typeof s=="function"&&typeof o=="function"&&i[0]==="o"&&i[1]==="n"&&i.charCodeAt(2)>=65&&i.charCodeAt(2)<=90?e[i]=M7(s,o):(i==="className"||i==="UNSAFE_className")&&typeof s=="string"&&typeof o=="string"?e[i]=$7(s,o):e[i]=o!==void 0?o:s}}return e}function Q7(n){return n!==void 0}function D7(...n){return jD(...n.filter(Q7))}function I7(n,e){return n==="processor"&&e&&typeof e=="object"&&"name"in e?e.name:n==="e2ee"&&e?"e2ee-enabled":e}const j7={connect:!0,audio:!1,video:!1};function N7(n){const{token:e,serverUrl:t,options:r,room:i,connectOptions:s,connect:o,audio:a,video:l,screen:c,onConnected:u,onDisconnected:d,onError:h,onMediaDeviceFailure:m,onEncryptionError:g,simulateParticipants:O,...y}={...j7,...n};r&&i&&_i.warn("when using a manually created room, the options object will be ignored. set the desired options directly when creating the room instead.");const[b,S]=L.useState(),P=L.useRef(o);L.useEffect(()=>{S(i??new Wu(r))},[i,JSON.stringify(r,I7)]);const k=L.useMemo(()=>{const{className:x}=P7();return jD(y,{className:x})},[y]);return L.useEffect(()=>{if(!b)return;const x=()=>{const R=b.localParticipant;_i.debug("trying to publish local tracks"),Promise.all([R.setMicrophoneEnabled(!!a,typeof a!="boolean"?a:void 0),R.setCameraEnabled(!!l,typeof l!="boolean"?l:void 0),R.setScreenShareEnabled(!!c,typeof c!="boolean"?c:void 0)]).catch($=>{_i.warn($),h==null||h($)})},A=R=>{const $=Ld.getFailure(R);m==null||m($)},M=R=>{g==null||g(R)},Q=R=>{d==null||d(R)},_=()=>{u==null||u()};return b.on(Ce.SignalConnected,x).on(Ce.MediaDevicesError,A).on(Ce.EncryptionError,M).on(Ce.Disconnected,Q).on(Ce.Connected,_),()=>{b.off(Ce.SignalConnected,x).off(Ce.MediaDevicesError,A).off(Ce.EncryptionError,M).off(Ce.Disconnected,Q).off(Ce.Connected,_)}},[b,a,l,c,h,g,m,u,d]),L.useEffect(()=>{if(b){if(O){b.simulateParticipants({participants:{count:O},publish:{audio:!0,useRealTracks:!0}});return}if(o){if(P.current=!0,_i.debug("connecting"),!e){_i.debug("no token yet");return}if(!t){_i.warn("no livekit url provided"),h==null||h(Error("no livekit url provided"));return}b.connect(t,e,s).catch(x=>{_i.warn(x),P.current===!0&&(h==null||h(x))})}else _i.debug("disconnecting because connect is false"),P.current=!1,b.disconnect()}},[o,e,JSON.stringify(s),b,h,t,O]),L.useEffect(()=>{if(b)return()=>{_i.info("disconnecting on onmount"),b.disconnect()}},[b]),{room:b,htmlProps:k}}const L7=L.forwardRef(function(n,e){const{room:t,htmlProps:r}=N7(n);return L.createElement("div",{ref:e,...r},t&&L.createElement(DD.Provider,{value:t},L.createElement(A7.Provider,{value:n.featureFlags},n.children)))});function q7(n=[Me.Source.Camera,Me.Source.Microphone,Me.Source.ScreenShare,Me.Source.ScreenShareAudio,Me.Source.Unknown],e={}){const t=R7(e.room),[r,i]=L.useState([]),[s,o]=L.useState([]),a=L.useMemo(()=>n.map(l=>MD(l)?l.source:l),[JSON.stringify(n)]);return L.useEffect(()=>{const l=x7(t,a,{additionalRoomEvents:e.updateOnlyOn,onlySubscribed:e.onlySubscribed}).subscribe(({trackReferences:c,participants:u})=>{_i.debug("setting track bundles",c,u),i(c),o(u)});return()=>l.unsubscribe()},[t,JSON.stringify(e.onlySubscribed),JSON.stringify(e.updateOnlyOn),JSON.stringify(n)]),L.useMemo(()=>{if(QD(n)){const l=B7(n,s),c=Array.from(r);return s.forEach(u=>{l.has(u.identity)&&(l.get(u.identity)??[]).forEach(d=>{if(r.find(({participant:m,publication:g})=>u.identity===m.identity&&g.source===d))return;_i.debug(`Add ${d} placeholder for participant ${u.identity}.`);const h={participant:u,source:d};c.push(h)})}),c}else return r},[r,s,n])}function U7(n,e){const t=new Set(n);for(const r of e)t.delete(r);return t}function B7(n,e){const t=new Map;if(QD(n)){const r=n.filter(i=>i.withPlaceholder).map(i=>i.source);e.forEach(i=>{const s=i.getTrackPublications().map(a=>{var l;return(l=a.track)==null?void 0:l.source}).filter(a=>a!==void 0),o=Array.from(U7(new Set(r),new Set(s)));o.length>0&&t.set(i.identity,o)})}return t}function F7(n,e={}){const[t,r]=L.useState(i1(n)),[i,s]=L.useState(t==null?void 0:t.isMuted),[o,a]=L.useState(t==null?void 0:t.isSubscribed),[l,c]=L.useState(t==null?void 0:t.track),[u,d]=L.useState("landscape"),h=L.useRef(),{className:m,trackObserver:g}=L.useMemo(()=>b7(n),[n.participant.sid??n.participant.identity,n.source,Fw(n)&&n.publication.trackSid]);return L.useEffect(()=>{const O=g.subscribe(y=>{_i.debug("update track",y),r(y),s(y==null?void 0:y.isMuted),a(y==null?void 0:y.isSubscribed),c(y==null?void 0:y.track)});return()=>O==null?void 0:O.unsubscribe()},[g]),L.useEffect(()=>{var O,y;return l&&(h.current&&l.detach(h.current),(O=e.element)!=null&&O.current&&!(n.participant.isLocal&&(l==null?void 0:l.kind)==="audio")&&l.attach(e.element.current)),h.current=(y=e.element)==null?void 0:y.current,()=>{h.current&&(l==null||l.detach(h.current))}},[l,e.element]),L.useEffect(()=>{var O,y;if(typeof((O=t==null?void 0:t.dimensions)==null?void 0:O.width)=="number"&&typeof((y=t==null?void 0:t.dimensions)==null?void 0:y.height)=="number"){const b=t.dimensions.width>t.dimensions.height?"landscape":"portrait";d(b)}},[t]),{publication:t,isMuted:i,isSubscribed:o,track:l,elementProps:D7(e.props,{className:m,"data-lk-local-participant":n.participant.isLocal,"data-lk-source":t==null?void 0:t.source,...(t==null?void 0:t.kind)==="video"&&{"data-lk-orientation":u}})}}var f0,FC;function V7(){if(FC)return f0;FC=1;var n="Expected a function",e=NaN,t="[object Symbol]",r=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,o=/^0o[0-7]+$/i,a=parseInt,l=typeof _p=="object"&&_p&&_p.Object===Object&&_p,c=typeof self=="object"&&self&&self.Object===Object&&self,u=l||c||Function("return this")(),d=Object.prototype,h=d.toString,m=Math.max,g=Math.min,O=function(){return u.Date.now()};function y(x,A,M){var Q,_,R,$,D,F,G=0,ue=!1,B=!1,X=!0;if(typeof x!="function")throw new TypeError(n);A=k(A)||0,b(M)&&(ue=!!M.leading,B="maxWait"in M,R=B?m(k(M.maxWait)||0,A):R,X="trailing"in M?!!M.trailing:X);function W(j){var V=Q,Y=_;return Q=_=void 0,G=j,$=x.apply(Y,V),$}function ee(j){return G=j,D=setTimeout(se,A),ue?W(j):$}function re(j){var V=j-F,Y=j-G,de=A-V;return B?g(de,R-Y):de}function H(j){var V=j-F,Y=j-G;return F===void 0||V>=A||V<0||B&&Y>=R}function se(){var j=O();if(H(j))return J(j);D=setTimeout(se,re(j))}function J(j){return D=void 0,X&&Q?W(j):(Q=_=void 0,$)}function oe(){D!==void 0&&clearTimeout(D),G=0,Q=F=_=D=void 0}function pe(){return D===void 0?$:J(O())}function Ee(){var j=O(),V=H(j);if(Q=arguments,_=this,F=j,V){if(D===void 0)return ee(F);if(B)return D=setTimeout(se,A),W(F)}return D===void 0&&(D=setTimeout(se,A)),$}return Ee.cancel=oe,Ee.flush=pe,Ee}function b(x){var A=typeof x;return!!x&&(A=="object"||A=="function")}function S(x){return!!x&&typeof x=="object"}function P(x){return typeof x=="symbol"||S(x)&&h.call(x)==t}function k(x){if(typeof x=="number")return x;if(P(x))return e;if(b(x)){var A=typeof x.valueOf=="function"?x.valueOf():x;x=b(A)?A+"":A}if(typeof x!="string")return x===0?x:+x;x=x.replace(r,"");var M=s.test(x);return M||o.test(x)?a(x.slice(2),M?2:8):i.test(x)?e:+x}return f0=y,f0}V7();const Z7=L.forwardRef(function({trackRef:n,onSubscriptionStatusChanged:e,volume:t,...r},i){const s=_7(n),o=L.useRef(null);L.useImperativeHandle(i,()=>o.current);const{elementProps:a,isSubscribed:l,track:c,publication:u}=F7(s,{element:o,props:r});return L.useEffect(()=>{e==null||e(!!l)},[l,e]),L.useEffect(()=>{c===void 0||t===void 0||(c instanceof aD?c.setVolume(t):_i.warn("Volume can only be set on remote audio tracks."))},[t,c]),L.useEffect(()=>{u===void 0||r.muted===void 0||(u instanceof cD?u.setEnabled(!r.muted):_i.warn("Can only call setEnabled on remote track publications."))},[r.muted,u,c]),L.createElement("audio",{ref:o,...a})});function W7({volume:n,muted:e}){const t=q7([Me.Source.Microphone,Me.Source.ScreenShareAudio,Me.Source.Unknown],{updateOnlyOn:[],onlySubscribed:!0}).filter(r=>!r.participant.isLocal&&r.publication.kind===Me.Kind.Audio);return L.createElement("div",{style:{display:"none"}},t.map(r=>L.createElement(Z7,{key:m7(r),trackRef:r,volume:n,muted:e})))}const pi=[];for(let n=0;n<256;++n)pi.push((n+256).toString(16).slice(1));function X7(n,e=0){return(pi[n[e+0]]+pi[n[e+1]]+pi[n[e+2]]+pi[n[e+3]]+"-"+pi[n[e+4]]+pi[n[e+5]]+"-"+pi[n[e+6]]+pi[n[e+7]]+"-"+pi[n[e+8]]+pi[n[e+9]]+"-"+pi[n[e+10]]+pi[n[e+11]]+pi[n[e+12]]+pi[n[e+13]]+pi[n[e+14]]+pi[n[e+15]]).toLowerCase()}let d0;const z7=new Uint8Array(16);function Y7(){if(!d0){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");d0=crypto.getRandomValues.bind(crypto)}return d0(z7)}const G7=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),VC={randomUUID:G7};function H7(n,e,t){var i;if(VC.randomUUID&&!n)return VC.randomUUID();n=n||{};const r=n.random??((i=n.rng)==null?void 0:i.call(n))??Y7();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=r[6]&15|64,r[8]=r[8]&63|128,X7(r)}const K7=!0,ZC=800,ND="vzCodeSidebarWidth",LD="vzCodeCodeEditorWidth",qD=250;let ZO=qD;const UD=800;let WO=UD,s1=!1;if(typeof window<"u"&&K7){const n=window.localStorage.getItem(ND),e=window.localStorage.getItem(LD);n!==null&&(ZO=+n,s1=!0),e!==null&&(WO=+e,s1=!0)}const J7={codeEditorWidth:WO,sidebarWidth:ZO,moveSplitPane:()=>{},isDraggingRight:!1,isDraggingLeft:!1,setIsDragging:()=>{}},XO=L.createContext(J7),eV={sidebarWidth:qD,codeEditorWidth:UD,isDraggingLeft:!1,isDraggingRight:!1,isInitialized:!1},tV=(n,e)=>{switch(e.type){case"initialize":return{...n,sidebarWidth:ZO,codeEditorWidth:WO,isInitialized:!0};case"move":return e.side==="left"?{...n,sidebarWidth:n.sidebarWidth+e.movementX}:{...n,codeEditorWidth:n.codeEditorWidth+e.movementX};case"setIsDragging":return e.side==="left"?{...n,isDraggingLeft:e.isDragging}:{...n,isDraggingRight:e.isDragging};default:return n}},nV=({children:n})=>{const[e,t]=L.useReducer(tV,eV),r=L.useCallback((d,h)=>{t({type:"setIsDragging",isDragging:d,side:h})},[t]),i=L.useCallback((d,h)=>{t({type:"move",movementX:d,side:h})},[t]),{sidebarWidth:s,codeEditorWidth:o,isDraggingLeft:a,isDraggingRight:l,isInitialized:c}=e;typeof window<"u"&&L.useLayoutEffect(()=>{s1&&!c&&t({type:"initialize"})},[c]),L.useEffect(()=>{s!==ZO&&setTimeout(()=>{window.localStorage.setItem(ND,""+s)},ZC),o!==WO&&setTimeout(()=>{window.localStorage.setItem(LD,""+o)},ZC)},[o,s]);const u={codeEditorWidth:o,sidebarWidth:s,moveSplitPane:i,isDraggingLeft:a,isDraggingRight:l,setIsDragging:r};return q.jsx(XO.Provider,{value:u,children:n})};let o1=[],BD=[];(()=>{let n="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e<n.length;e++)(e%2?BD:o1).push(t=t+n[e])})();function rV(n){if(n<768)return!1;for(let e=0,t=o1.length;;){let r=e+t>>1;if(n<o1[r])t=r;else if(n>=BD[r])e=r+1;else return!0;if(e==t)return!1}}function WC(n){return n>=127462&&n<=127487}const XC=8205;function iV(n,e,t=!0,r=!0){return(t?FD:sV)(n,e,r)}function FD(n,e,t){if(e==n.length)return e;e&&VD(n.charCodeAt(e))&&ZD(n.charCodeAt(e-1))&&e--;let r=h0(n,e);for(e+=zC(r);e<n.length;){let i=h0(n,e);if(r==XC||i==XC||t&&rV(i))e+=zC(i),r=i;else if(WC(i)){let s=0,o=e-2;for(;o>=0&&WC(h0(n,o));)s++,o-=2;if(s%2==0)break;e+=2}else break}return e}function sV(n,e,t){for(;e>0;){let r=FD(n,e-2,t);if(r<e)return r;e--}return 0}function h0(n,e){let t=n.charCodeAt(e);if(!ZD(t)||e+1==n.length)return t;let r=n.charCodeAt(e+1);return VD(r)?(t-55296<<10)+(r-56320)+65536:t}function VD(n){return n>=56320&&n<57344}function ZD(n){return n>=55296&&n<56320}function zC(n){return n<65536?1:2}class En{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,r){[e,t]=zu(this,e,t);let i=[];return this.decompose(0,e,i,2),r.length&&r.decompose(0,r.length,i,3),this.decompose(t,this.length,i,1),qo.from(i,this.length-(t-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=zu(this,e,t);let r=[];return this.decompose(e,t,r,0),qo.from(r,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),r=this.length-this.scanIdentical(e,-1),i=new Ad(this),s=new Ad(e);for(let o=t,a=t;;){if(i.next(o),s.next(o),o=0,i.lineBreak!=s.lineBreak||i.done!=s.done||i.value!=s.value)return!1;if(a+=i.value.length,i.done||a>=r)return!0}}iter(e=1){return new Ad(this,e)}iterRange(e,t=this.length){return new WD(this,e,t)}iterLines(e,t){let r;if(e==null)r=this.iter();else{t==null&&(t=this.lines+1);let i=this.line(e).from;r=this.iterRange(i,Math.max(i,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new XD(r)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?En.empty:e.length<=32?new jr(e):qo.from(jr.split(e,[]))}}class jr extends En{constructor(e,t=oV(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,r,i){for(let s=0;;s++){let o=this.text[s],a=i+o.length;if((t?r:a)>=e)return new aV(i,a,r,o);i=a+1,r++}}decompose(e,t,r,i){let s=e<=0&&t>=this.length?this:new jr(YC(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(i&1){let o=r.pop(),a=Pg(s.text,o.text.slice(),0,s.length);if(a.length<=32)r.push(new jr(a,o.length+s.length));else{let l=a.length>>1;r.push(new jr(a.slice(0,l)),new jr(a.slice(l)))}}else r.push(s)}replace(e,t,r){if(!(r instanceof jr))return super.replace(e,t,r);[e,t]=zu(this,e,t);let i=Pg(this.text,Pg(r.text,YC(this.text,0,e)),t),s=this.length+r.length-(t-e);return i.length<=32?new jr(i,s):qo.from(jr.split(i,[]),s)}sliceString(e,t=this.length,r=`
|
|
117
|
+
`){[e,t]=zu(this,e,t);let i="";for(let s=0,o=0;s<=t&&o<this.text.length;o++){let a=this.text[o],l=s+a.length;s>e&&o&&(i+=r),e<l&&t>s&&(i+=a.slice(Math.max(0,e-s),t-s)),s=l+1}return i}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let r=[],i=-1;for(let s of e)r.push(s),i+=s.length+1,r.length==32&&(t.push(new jr(r,i)),r=[],i=-1);return i>-1&&t.push(new jr(r,i)),t}}class qo extends En{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let r of e)this.lines+=r.lines}lineInner(e,t,r,i){for(let s=0;;s++){let o=this.children[s],a=i+o.length,l=r+o.lines-1;if((t?l:a)>=e)return o.lineInner(e,t,r,i);i=a+1,r=l+1}}decompose(e,t,r,i){for(let s=0,o=0;o<=t&&s<this.children.length;s++){let a=this.children[s],l=o+a.length;if(e<=l&&t>=o){let c=i&((o<=e?1:0)|(l>=t?2:0));o>=e&&l<=t&&!c?r.push(a):a.decompose(e-o,t-o,r,c)}o=l+1}}replace(e,t,r){if([e,t]=zu(this,e,t),r.lines<this.lines)for(let i=0,s=0;i<this.children.length;i++){let o=this.children[i],a=s+o.length;if(e>=s&&t<=a){let l=o.replace(e-s,t-s,r),c=this.lines-o.lines+l.lines;if(l.lines<c>>4&&l.lines>c>>6){let u=this.children.slice();return u[i]=l,new qo(u,this.length-(t-e)+r.length)}return super.replace(s,a,l)}s=a+1}return super.replace(e,t,r)}sliceString(e,t=this.length,r=`
|
|
118
|
+
`){[e,t]=zu(this,e,t);let i="";for(let s=0,o=0;s<this.children.length&&o<=t;s++){let a=this.children[s],l=o+a.length;o>e&&s&&(i+=r),e<l&&t>o&&(i+=a.sliceString(e-o,t-o,r)),o=l+1}return i}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof qo))return 0;let r=0,[i,s,o,a]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=t,s+=t){if(i==o||s==a)return r;let l=this.children[i],c=e.children[s];if(l!=c)return r+l.scanIdentical(c,t);r+=l.length+1}}static from(e,t=e.reduce((r,i)=>r+i.length+1,-1)){let r=0;for(let m of e)r+=m.lines;if(r<32){let m=[];for(let g of e)g.flatten(m);return new jr(m,t)}let i=Math.max(32,r>>5),s=i<<1,o=i>>1,a=[],l=0,c=-1,u=[];function d(m){let g;if(m.lines>s&&m instanceof qo)for(let O of m.children)d(O);else m.lines>o&&(l>o||!l)?(h(),a.push(m)):m instanceof jr&&l&&(g=u[u.length-1])instanceof jr&&m.lines+g.lines<=32?(l+=m.lines,c+=m.length+1,u[u.length-1]=new jr(g.text.concat(m.text),g.length+1+m.length)):(l+m.lines>i&&h(),l+=m.lines,c+=m.length+1,u.push(m))}function h(){l!=0&&(a.push(u.length==1?u[0]:qo.from(u,c)),c=-1,l=u.length=0)}for(let m of e)d(m);return h(),a.length==1?a[0]:new qo(a,t)}}En.empty=new jr([""],0);function oV(n){let e=-1;for(let t of n)e+=t.length+1;return e}function Pg(n,e,t=0,r=1e9){for(let i=0,s=0,o=!0;s<n.length&&i<=r;s++){let a=n[s],l=i+a.length;l>=t&&(l>r&&(a=a.slice(0,r-i)),i<t&&(a=a.slice(t-i)),o?(e[e.length-1]+=a,o=!1):e.push(a)),i=l+1}return e}function YC(n,e,t){return Pg(n,[""],e,t)}class Ad{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof jr?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,i=this.nodes[r],s=this.offsets[r],o=s>>1,a=i instanceof jr?i.text.length:i.children.length;if(o==(t>0?a:0)){if(r==0)return this.done=!0,this.value="",this;t>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(t>0?0:1)){if(this.offsets[r]+=t,e==0)return this.lineBreak=!0,this.value=`
|
|
119
|
+
`,this;e--}else if(i instanceof jr){let l=i.text[o+(t<0?-1:0)];if(this.offsets[r]+=t,l.length>Math.max(0,e))return this.value=e==0?l:t>0?l.slice(e):l.slice(0,l.length-e),this;e-=l.length}else{let l=i.children[o+(t<0?-1:0)];e>l.length?(e-=l.length,this.offsets[r]+=t):(t<0&&this.offsets[r]--,this.nodes.push(l),this.offsets.push(t>0?1:(l instanceof jr?l.text.length:l.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class WD{constructor(e,t,r){this.value="",this.done=!1,this.cursor=new Ad(e,t>r?-1:1),this.pos=t>r?e.length:0,this.from=Math.min(t,r),this.to=Math.max(t,r)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let r=t<0?this.pos-this.from:this.to-this.pos;e>r&&(e=r),r-=e;let{value:i}=this.cursor.next(e);return this.pos+=(i.length+e)*t,this.value=i.length<=r?i:t<0?i.slice(i.length-r):i.slice(0,r),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class XD{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:r,value:i}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(En.prototype[Symbol.iterator]=function(){return this.iter()},Ad.prototype[Symbol.iterator]=WD.prototype[Symbol.iterator]=XD.prototype[Symbol.iterator]=function(){return this});let aV=class{constructor(e,t,r,i){this.from=e,this.to=t,this.number=r,this.text=i}get length(){return this.to-this.from}};function zu(n,e,t){return e=Math.max(0,Math.min(n.length,e)),[e,Math.max(e,Math.min(n.length,t))]}function vi(n,e,t=!0,r=!0){return iV(n,e,t,r)}function lV(n){return n>=56320&&n<57344}function cV(n){return n>=55296&&n<56320}function es(n,e){let t=n.charCodeAt(e);if(!cV(t)||e+1==n.length)return t;let r=n.charCodeAt(e+1);return lV(r)?(t-55296<<10)+(r-56320)+65536:t}function Vw(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function Uo(n){return n<65536?1:2}const a1=/\r\n?|\n/;var Kr=function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n}(Kr||(Kr={}));class Zo{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let r=this.sections[t+1];e+=r<0?this.sections[t]:r}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,r=0,i=0;t<this.sections.length;){let s=this.sections[t++],o=this.sections[t++];o<0?(e(r,i,s),i+=s):i+=o,r+=s}}iterChangedRanges(e,t=!1){l1(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let r=this.sections[t++],i=this.sections[t++];i<0?e.push(r,i):e.push(i,r)}return new Zo(e)}composeDesc(e){return this.empty?e:e.empty?this:zD(this,e)}mapDesc(e,t=!1){return e.empty?this:c1(this,e,t)}mapPos(e,t=-1,r=Kr.Simple){let i=0,s=0;for(let o=0;o<this.sections.length;){let a=this.sections[o++],l=this.sections[o++],c=i+a;if(l<0){if(c>e)return s+(e-i);s+=a}else{if(r!=Kr.Simple&&c>=e&&(r==Kr.TrackDel&&i<e&&c>e||r==Kr.TrackBefore&&i<e||r==Kr.TrackAfter&&c>e))return null;if(c>e||c==e&&t<0&&!a)return e==i||t<0?s:s+l;s+=l}i=c}if(e>i)throw new RangeError(`Position ${e} is out of range for changeset of length ${i}`);return s}touchesRange(e,t=e){for(let r=0,i=0;r<this.sections.length&&i<=t;){let s=this.sections[r++],o=this.sections[r++],a=i+s;if(o>=0&&i<=t&&a>=e)return i<e&&a>t?"cover":!0;i=a}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let r=this.sections[t++],i=this.sections[t++];e+=(e?" ":"")+r+(i>=0?":"+i:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Zo(e)}static create(e){return new Zo(e)}}class Hr extends Zo{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return l1(this,(t,r,i,s,o)=>e=e.replace(i,i+(r-t),o),!1),e}mapDesc(e,t=!1){return c1(this,e,t,!0)}invert(e){let t=this.sections.slice(),r=[];for(let i=0,s=0;i<t.length;i+=2){let o=t[i],a=t[i+1];if(a>=0){t[i]=a,t[i+1]=o;let l=i>>1;for(;r.length<l;)r.push(En.empty);r.push(o?e.slice(s,s+o):En.empty)}s+=o}return new Hr(t,r)}compose(e){return this.empty?e:e.empty?this:zD(this,e,!0)}map(e,t=!1){return e.empty?this:c1(this,e,t,!0)}iterChanges(e,t=!1){l1(this,e,t)}get desc(){return Zo.create(this.sections)}filter(e){let t=[],r=[],i=[],s=new Ud(this);e:for(let o=0,a=0;;){let l=o==e.length?1e9:e[o++];for(;a<l||a==l&&s.len==0;){if(s.done)break e;let u=Math.min(s.len,l-a);Ei(i,u,-1);let d=s.ins==-1?-1:s.off==0?s.ins:0;Ei(t,u,d),d>0&&ml(r,t,s.text),s.forward(u),a+=u}let c=e[o++];for(;a<c;){if(s.done)break e;let u=Math.min(s.len,c-a);Ei(t,u,-1),Ei(i,u,s.ins==-1?-1:s.off==0?s.ins:0),s.forward(u),a+=u}}return{changes:new Hr(t,r),filtered:Zo.create(i)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let r=this.sections[t],i=this.sections[t+1];i<0?e.push(r):i==0?e.push([r]):e.push([r].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,r){let i=[],s=[],o=0,a=null;function l(u=!1){if(!u&&!i.length)return;o<t&&Ei(i,t-o,-1);let d=new Hr(i,s);a=a?a.compose(d.map(a)):d,i=[],s=[],o=0}function c(u){if(Array.isArray(u))for(let d of u)c(d);else if(u instanceof Hr){if(u.length!=t)throw new RangeError(`Mismatched change set length (got ${u.length}, expected ${t})`);l(),a=a?a.compose(u.map(a)):u}else{let{from:d,to:h=d,insert:m}=u;if(d>h||d<0||h>t)throw new RangeError(`Invalid change range ${d} to ${h} (in doc of length ${t})`);let g=m?typeof m=="string"?En.of(m.split(r||a1)):m:En.empty,O=g.length;if(d==h&&O==0)return;d<o&&l(),d>o&&Ei(i,d-o,-1),Ei(i,h-d,O),ml(s,i,g),o=h}}return c(e),l(!a),a}static empty(e){return new Hr(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],r=[];for(let i=0;i<e.length;i++){let s=e[i];if(typeof s=="number")t.push(s,-1);else{if(!Array.isArray(s)||typeof s[0]!="number"||s.some((o,a)=>a&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)t.push(s[0],0);else{for(;r.length<i;)r.push(En.empty);r[i]=En.of(s.slice(1)),t.push(s[0],r[i].length)}}}return new Hr(t,r)}static createSet(e,t){return new Hr(e,t)}}function Ei(n,e,t,r=!1){if(e==0&&t<=0)return;let i=n.length-2;i>=0&&t<=0&&t==n[i+1]?n[i]+=e:i>=0&&e==0&&n[i]==0?n[i+1]+=t:r?(n[i]+=e,n[i+1]+=t):n.push(e,t)}function ml(n,e,t){if(t.length==0)return;let r=e.length-2>>1;if(r<n.length)n[n.length-1]=n[n.length-1].append(t);else{for(;n.length<r;)n.push(En.empty);n.push(t)}}function l1(n,e,t){let r=n.inserted;for(let i=0,s=0,o=0;o<n.sections.length;){let a=n.sections[o++],l=n.sections[o++];if(l<0)i+=a,s+=a;else{let c=i,u=s,d=En.empty;for(;c+=a,u+=l,l&&r&&(d=d.append(r[o-2>>1])),!(t||o==n.sections.length||n.sections[o+1]<0);)a=n.sections[o++],l=n.sections[o++];e(i,c,s,u,d),i=c,s=u}}}function c1(n,e,t,r=!1){let i=[],s=r?[]:null,o=new Ud(n),a=new Ud(e);for(let l=-1;;){if(o.done&&a.len||a.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&a.ins==-1){let c=Math.min(o.len,a.len);Ei(i,c,-1),o.forward(c),a.forward(c)}else if(a.ins>=0&&(o.ins<0||l==o.i||o.off==0&&(a.len<o.len||a.len==o.len&&!t))){let c=a.len;for(Ei(i,a.ins,-1);c;){let u=Math.min(o.len,c);o.ins>=0&&l<o.i&&o.len<=u&&(Ei(i,0,o.ins),s&&ml(s,i,o.text),l=o.i),o.forward(u),c-=u}a.next()}else if(o.ins>=0){let c=0,u=o.len;for(;u;)if(a.ins==-1){let d=Math.min(u,a.len);c+=d,u-=d,a.forward(d)}else if(a.ins==0&&a.len<u)u-=a.len,a.next();else break;Ei(i,c,l<o.i?o.ins:0),s&&l<o.i&&ml(s,i,o.text),l=o.i,o.forward(o.len-u)}else{if(o.done&&a.done)return s?Hr.createSet(i,s):Zo.create(i);throw new Error("Mismatched change set lengths")}}}function zD(n,e,t=!1){let r=[],i=t?[]:null,s=new Ud(n),o=new Ud(e);for(let a=!1;;){if(s.done&&o.done)return i?Hr.createSet(r,i):Zo.create(r);if(s.ins==0)Ei(r,s.len,0,a),s.next();else if(o.len==0&&!o.done)Ei(r,0,o.ins,a),i&&ml(i,r,o.text),o.next();else{if(s.done||o.done)throw new Error("Mismatched change set lengths");{let l=Math.min(s.len2,o.len),c=r.length;if(s.ins==-1){let u=o.ins==-1?-1:o.off?0:o.ins;Ei(r,l,u,a),i&&u&&ml(i,r,o.text)}else o.ins==-1?(Ei(r,s.off?0:s.len,l,a),i&&ml(i,r,s.textBit(l))):(Ei(r,s.off?0:s.len,o.off?0:o.ins,a),i&&!o.off&&ml(i,r,o.text));a=(s.ins>l||o.ins>=0&&o.len>l)&&(a||r.length>c),s.forward2(l),o.forward(l)}}}}class Ud{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?En.empty:e[t]}textBit(e){let{inserted:t}=this.set,r=this.i-2>>1;return r>=t.length&&!e?En.empty:t[r].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class gc{constructor(e,t,r){this.from=e,this.to=t,this.flags=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,t=-1){let r,i;return this.empty?r=i=e.mapPos(this.from,t):(r=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new gc(r,i,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return _e.range(e,t);let r=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return _e.range(this.anchor,r)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return _e.range(e.anchor,e.head)}static create(e,t,r){return new gc(e,t,r)}}class _e{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:_e.create(this.ranges.map(r=>r.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let r=0;r<this.ranges.length;r++)if(!this.ranges[r].eq(e.ranges[r],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new _e([this.main],0)}addRange(e,t=!0){return _e.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let r=this.ranges.slice();return r[t]=e,_e.create(r,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new _e(e.ranges.map(t=>gc.fromJSON(t)),e.main)}static single(e,t=e){return new _e([_e.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let r=0,i=0;i<e.length;i++){let s=e[i];if(s.empty?s.from<=r:s.from<r)return _e.normalized(e.slice(),t);r=s.to}return new _e(e,t)}static cursor(e,t=0,r,i){return gc.create(e,e,(t==0?0:t<0?8:16)|(r==null?7:Math.min(6,r))|(i??16777215)<<6)}static range(e,t,r,i){let s=(r??16777215)<<6|(i==null?7:Math.min(6,i));return t<e?gc.create(t,e,48|s):gc.create(e,t,(t>e?8:0)|s)}static normalized(e,t=0){let r=e[t];e.sort((i,s)=>i.from-s.from),t=e.indexOf(r);for(let i=1;i<e.length;i++){let s=e[i],o=e[i-1];if(s.empty?s.from<=o.to:s.from<o.to){let a=o.from,l=Math.max(s.to,o.to);i<=t&&t--,e.splice(--i,2,s.anchor>s.head?_e.range(l,a):_e.range(a,l))}}return new _e(e,t)}}function YD(n,e){for(let t of n.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let Zw=0;class ft{constructor(e,t,r,i,s){this.combine=e,this.compareInput=t,this.compare=r,this.isStatic=i,this.id=Zw++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new ft(e.combine||(t=>t),e.compareInput||((t,r)=>t===r),e.compare||(e.combine?(t,r)=>t===r:Ww),!!e.static,e.enables)}of(e){return new xg([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new xg(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new xg(e,this,2,t)}from(e,t){return t||(t=r=>r),this.compute([e],r=>t(r.field(e)))}}function Ww(n,e){return n==e||n.length==e.length&&n.every((t,r)=>t===e[r])}class xg{constructor(e,t,r,i){this.dependencies=e,this.facet=t,this.type=r,this.value=i,this.id=Zw++}dynamicSlot(e){var t;let r=this.value,i=this.facet.compareInput,s=this.id,o=e[s]>>1,a=this.type==2,l=!1,c=!1,u=[];for(let d of this.dependencies)d=="doc"?l=!0:d=="selection"?c=!0:(((t=e[d.id])!==null&&t!==void 0?t:1)&1)==0&&u.push(e[d.id]);return{create(d){return d.values[o]=r(d),1},update(d,h){if(l&&h.docChanged||c&&(h.docChanged||h.selection)||u1(d,u)){let m=r(d);if(a?!GC(m,d.values[o],i):!i(m,d.values[o]))return d.values[o]=m,1}return 0},reconfigure:(d,h)=>{let m,g=h.config.address[s];if(g!=null){let O=nO(h,g);if(this.dependencies.every(y=>y instanceof ft?h.facet(y)===d.facet(y):y instanceof Zr?h.field(y,!1)==d.field(y,!1):!0)||(a?GC(m=r(d),O,i):i(m=r(d),O)))return d.values[o]=O,0}else m=r(d);return d.values[o]=m,1}}}}function GC(n,e,t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!t(n[r],e[r]))return!1;return!0}function u1(n,e){let t=!1;for(let r of e)$d(n,r)&1&&(t=!0);return t}function uV(n,e,t){let r=t.map(l=>n[l.id]),i=t.map(l=>l.type),s=r.filter(l=>!(l&1)),o=n[e.id]>>1;function a(l){let c=[];for(let u=0;u<r.length;u++){let d=nO(l,r[u]);if(i[u]==2)for(let h of d)c.push(h);else c.push(d)}return e.combine(c)}return{create(l){for(let c of r)$d(l,c);return l.values[o]=a(l),1},update(l,c){if(!u1(l,s))return 0;let u=a(l);return e.compare(u,l.values[o])?0:(l.values[o]=u,1)},reconfigure(l,c){let u=u1(l,r),d=c.config.facets[e.id],h=c.facet(e);if(d&&!u&&Ww(t,d))return l.values[o]=h,0;let m=a(l);return e.compare(m,h)?(l.values[o]=h,0):(l.values[o]=m,1)}}}const Rp=ft.define({static:!0});class Zr{constructor(e,t,r,i,s){this.id=e,this.createF=t,this.updateF=r,this.compareF=i,this.spec=s,this.provides=void 0}static define(e){let t=new Zr(Zw++,e.create,e.update,e.compare||((r,i)=>r===i),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(Rp).find(r=>r.field==this);return((t==null?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:r=>(r.values[t]=this.create(r),1),update:(r,i)=>{let s=r.values[t],o=this.updateF(s,i);return this.compareF(s,o)?0:(r.values[t]=o,1)},reconfigure:(r,i)=>{let s=r.facet(Rp),o=i.facet(Rp),a;return(a=s.find(l=>l.field==this))&&a!=o.find(l=>l.field==this)?(r.values[t]=a.create(r),1):i.config.address[this.id]!=null?(r.values[t]=i.field(this),0):(r.values[t]=this.create(r),1)}}}init(e){return[this,Rp.of({field:this,create:e})]}get extension(){return this}}const dc={lowest:4,low:3,default:2,high:1,highest:0};function Yf(n){return e=>new GD(e,n)}const Go={highest:Yf(dc.highest),high:Yf(dc.high),default:Yf(dc.default),low:Yf(dc.low),lowest:Yf(dc.lowest)};class GD{constructor(e,t){this.inner=e,this.prec=t}}class wc{of(e){return new f1(this,e)}reconfigure(e){return wc.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class f1{constructor(e,t){this.compartment=e,this.inner=t}}class tO{constructor(e,t,r,i,s,o){for(this.base=e,this.compartments=t,this.dynamicSlots=r,this.address=i,this.staticValues=s,this.facets=o,this.statusTemplate=[];this.statusTemplate.length<r.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return t==null?e.default:this.staticValues[t>>1]}static resolve(e,t,r){let i=[],s=Object.create(null),o=new Map;for(let h of fV(e,t,o))h instanceof Zr?i.push(h):(s[h.facet.id]||(s[h.facet.id]=[])).push(h);let a=Object.create(null),l=[],c=[];for(let h of i)a[h.id]=c.length<<1,c.push(m=>h.slot(m));let u=r==null?void 0:r.config.facets;for(let h in s){let m=s[h],g=m[0].facet,O=u&&u[h]||[];if(m.every(y=>y.type==0))if(a[g.id]=l.length<<1|1,Ww(O,m))l.push(r.facet(g));else{let y=g.combine(m.map(b=>b.value));l.push(r&&g.compare(y,r.facet(g))?r.facet(g):y)}else{for(let y of m)y.type==0?(a[y.id]=l.length<<1|1,l.push(y.value)):(a[y.id]=c.length<<1,c.push(b=>y.dynamicSlot(b)));a[g.id]=c.length<<1,c.push(y=>uV(y,g,m))}}let d=c.map(h=>h(a));return new tO(e,o,d,a,l,s)}}function fV(n,e,t){let r=[[],[],[],[],[]],i=new Map;function s(o,a){let l=i.get(o);if(l!=null){if(l<=a)return;let c=r[l].indexOf(o);c>-1&&r[l].splice(c,1),o instanceof f1&&t.delete(o.compartment)}if(i.set(o,a),Array.isArray(o))for(let c of o)s(c,a);else if(o instanceof f1){if(t.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let c=e.get(o.compartment)||o.inner;t.set(o.compartment,c),s(c,a)}else if(o instanceof GD)s(o.inner,o.prec);else if(o instanceof Zr)r[a].push(o),o.provides&&s(o.provides,a);else if(o instanceof xg)r[a].push(o),o.facet.extensions&&s(o.facet.extensions,dc.default);else{let c=o.extension;if(!c)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(c,a)}}return s(n,dc.default),r.reduce((o,a)=>o.concat(a))}function $d(n,e){if(e&1)return 2;let t=e>>1,r=n.status[t];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;n.status[t]=4;let i=n.computeSlot(n,n.config.dynamicSlots[t]);return n.status[t]=2|i}function nO(n,e){return e&1?n.config.staticValues[e>>1]:n.values[e>>1]}const HD=ft.define(),d1=ft.define({combine:n=>n.some(e=>e),static:!0}),KD=ft.define({combine:n=>n.length?n[0]:void 0,static:!0}),JD=ft.define(),eI=ft.define(),tI=ft.define(),nI=ft.define({combine:n=>n.length?n[0]:!1});class Ho{constructor(e,t){this.type=e,this.value=t}static define(){return new dV}}class dV{of(e){return new Ho(this,e)}}class hV{constructor(e){this.map=e}of(e){return new Yt(this,e)}}class Yt{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new Yt(this.type,t)}is(e){return this.type==e}static define(e={}){return new hV(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let r=[];for(let i of e){let s=i.map(t);s&&r.push(s)}return r}}Yt.reconfigure=Yt.define();Yt.appendConfig=Yt.define();class Vr{constructor(e,t,r,i,s,o){this.startState=e,this.changes=t,this.selection=r,this.effects=i,this.annotations=s,this.scrollIntoView=o,this._doc=null,this._state=null,r&&YD(r,t.newLength),s.some(a=>a.type==Vr.time)||(this.annotations=s.concat(Vr.time.of(Date.now())))}static create(e,t,r,i,s,o){return new Vr(e,t,r,i,s,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(Vr.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}Vr.time=Ho.define();Vr.userEvent=Ho.define();Vr.addToHistory=Ho.define();Vr.remote=Ho.define();function pV(n,e){let t=[];for(let r=0,i=0;;){let s,o;if(r<n.length&&(i==e.length||e[i]>=n[r]))s=n[r++],o=n[r++];else if(i<e.length)s=e[i++],o=e[i++];else return t;!t.length||t[t.length-1]<s?t.push(s,o):t[t.length-1]<o&&(t[t.length-1]=o)}}function rI(n,e,t){var r;let i,s,o;return t?(i=e.changes,s=Hr.empty(e.changes.length),o=n.changes.compose(e.changes)):(i=e.changes.map(n.changes),s=n.changes.mapDesc(e.changes,!0),o=n.changes.compose(i)),{changes:o,selection:e.selection?e.selection.map(s):(r=n.selection)===null||r===void 0?void 0:r.map(i),effects:Yt.mapEffects(n.effects,i).concat(Yt.mapEffects(e.effects,s)),annotations:n.annotations.length?n.annotations.concat(e.annotations):e.annotations,scrollIntoView:n.scrollIntoView||e.scrollIntoView}}function h1(n,e,t){let r=e.selection,i=Du(e.annotations);return e.userEvent&&(i=i.concat(Vr.userEvent.of(e.userEvent))),{changes:e.changes instanceof Hr?e.changes:Hr.of(e.changes||[],t,n.facet(KD)),selection:r&&(r instanceof _e?r:_e.single(r.anchor,r.head)),effects:Du(e.effects),annotations:i,scrollIntoView:!!e.scrollIntoView}}function iI(n,e,t){let r=h1(n,e.length?e[0]:{},n.doc.length);e.length&&e[0].filter===!1&&(t=!1);for(let s=1;s<e.length;s++){e[s].filter===!1&&(t=!1);let o=!!e[s].sequential;r=rI(r,h1(n,e[s],o?r.changes.newLength:n.doc.length),o)}let i=Vr.create(n,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return gV(t?mV(i):i)}function mV(n){let e=n.startState,t=!0;for(let i of e.facet(JD)){let s=i(n);if(s===!1){t=!1;break}Array.isArray(s)&&(t=t===!0?s:pV(t,s))}if(t!==!0){let i,s;if(t===!1)s=n.changes.invertedDesc,i=Hr.empty(e.doc.length);else{let o=n.changes.filter(t);i=o.changes,s=o.filtered.mapDesc(o.changes).invertedDesc}n=Vr.create(e,i,n.selection&&n.selection.map(s),Yt.mapEffects(n.effects,s),n.annotations,n.scrollIntoView)}let r=e.facet(eI);for(let i=r.length-1;i>=0;i--){let s=r[i](n);s instanceof Vr?n=s:Array.isArray(s)&&s.length==1&&s[0]instanceof Vr?n=s[0]:n=iI(e,Du(s),!1)}return n}function gV(n){let e=n.startState,t=e.facet(tI),r=n;for(let i=t.length-1;i>=0;i--){let s=t[i](n);s&&Object.keys(s).length&&(r=rI(r,h1(e,s,n.changes.newLength),!0))}return r==n?n:Vr.create(e,n.changes,n.selection,r.effects,r.annotations,r.scrollIntoView)}const OV=[];function Du(n){return n==null?OV:Array.isArray(n)?n:[n]}var br=function(n){return n[n.Word=0]="Word",n[n.Space=1]="Space",n[n.Other=2]="Other",n}(br||(br={}));const vV=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let p1;try{p1=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function yV(n){if(p1)return p1.test(n);for(let e=0;e<n.length;e++){let t=n[e];if(/\w/.test(t)||t>""&&(t.toUpperCase()!=t.toLowerCase()||vV.test(t)))return!0}return!1}function bV(n){return e=>{if(!/\S/.test(e))return br.Space;if(yV(e))return br.Word;for(let t=0;t<n.length;t++)if(e.indexOf(n[t])>-1)return br.Word;return br.Other}}class Cn{constructor(e,t,r,i,s,o){this.config=e,this.doc=t,this.selection=r,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=s,o&&(o._state=this);for(let a=0;a<this.config.dynamicSlots.length;a++)$d(this,a<<1);this.computeSlot=null}field(e,t=!0){let r=this.config.address[e.id];if(r==null){if(t)throw new RangeError("Field is not present in this state");return}return $d(this,r),nO(this,r)}update(...e){return iI(this,e,!0)}applyTransaction(e){let t=this.config,{base:r,compartments:i}=t;for(let a of e.effects)a.is(wc.reconfigure)?(t&&(i=new Map,t.compartments.forEach((l,c)=>i.set(c,l)),t=null),i.set(a.value.compartment,a.value.extension)):a.is(Yt.reconfigure)?(t=null,r=a.value):a.is(Yt.appendConfig)&&(t=null,r=Du(r).concat(a.value));let s;t?s=e.startState.values.slice():(t=tO.resolve(r,i,this),s=new Cn(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(l,c)=>c.reconfigure(l,this),null).values);let o=e.startState.facet(d1)?e.newSelection:e.newSelection.asSingle();new Cn(t,e.newDoc,o,s,(a,l)=>l.update(a,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:_e.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,r=e(t.ranges[0]),i=this.changes(r.changes),s=[r.range],o=Du(r.effects);for(let a=1;a<t.ranges.length;a++){let l=e(t.ranges[a]),c=this.changes(l.changes),u=c.map(i);for(let h=0;h<a;h++)s[h]=s[h].map(u);let d=i.mapDesc(c,!0);s.push(l.range.map(d)),i=i.compose(u),o=Yt.mapEffects(o,u).concat(Yt.mapEffects(Du(l.effects),d))}return{changes:i,selection:_e.create(s,t.mainIndex),effects:o}}changes(e=[]){return e instanceof Hr?e:Hr.of(e,this.doc.length,this.facet(Cn.lineSeparator))}toText(e){return En.of(e.split(this.facet(Cn.lineSeparator)||a1))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return t==null?e.default:($d(this,t),nO(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let r in e){let i=e[r];i instanceof Zr&&this.config.address[i.id]!=null&&(t[r]=i.spec.toJSON(this.field(e[r]),this))}return t}static fromJSON(e,t={},r){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let i=[];if(r){for(let s in r)if(Object.prototype.hasOwnProperty.call(e,s)){let o=r[s],a=e[s];i.push(o.init(l=>o.spec.fromJSON(a,l)))}}return Cn.create({doc:e.doc,selection:_e.fromJSON(e.selection),extensions:t.extensions?i.concat([t.extensions]):i})}static create(e={}){let t=tO.resolve(e.extensions||[],new Map),r=e.doc instanceof En?e.doc:En.of((e.doc||"").split(t.staticFacet(Cn.lineSeparator)||a1)),i=e.selection?e.selection instanceof _e?e.selection:_e.single(e.selection.anchor,e.selection.head):_e.single(0);return YD(i,r.length),t.staticFacet(d1)||(i=i.asSingle()),new Cn(t,r,i,t.dynamicSlots.map(()=>null),(s,o)=>o.create(s),null)}get tabSize(){return this.facet(Cn.tabSize)}get lineBreak(){return this.facet(Cn.lineSeparator)||`
|
|
120
|
+
`}get readOnly(){return this.facet(nI)}phrase(e,...t){for(let r of this.facet(Cn.phrases))if(Object.prototype.hasOwnProperty.call(r,e)){e=r[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(r,i)=>{if(i=="$")return"$";let s=+(i||1);return!s||s>t.length?r:t[s-1]})),e}languageDataAt(e,t,r=-1){let i=[];for(let s of this.facet(HD))for(let o of s(this,t,r))Object.prototype.hasOwnProperty.call(o,e)&&i.push(o[e]);return i}charCategorizer(e){return bV(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:r,length:i}=this.doc.lineAt(e),s=this.charCategorizer(e),o=e-r,a=e-r;for(;o>0;){let l=vi(t,o,!1);if(s(t.slice(l,o))!=br.Word)break;o=l}for(;a<i;){let l=vi(t,a);if(s(t.slice(a,l))!=br.Word)break;a=l}return o==a?null:_e.range(o+r,a+r)}}Cn.allowMultipleSelections=d1;Cn.tabSize=ft.define({combine:n=>n.length?n[0]:4});Cn.lineSeparator=KD;Cn.readOnly=nI;Cn.phrases=ft.define({compare(n,e){let t=Object.keys(n),r=Object.keys(e);return t.length==r.length&&t.every(i=>n[i]==e[i])}});Cn.languageData=HD;Cn.changeFilter=JD;Cn.transactionFilter=eI;Cn.transactionExtender=tI;wc.reconfigure=Yt.define();function go(n,e,t={}){let r={};for(let i of n)for(let s of Object.keys(i)){let o=i[s],a=r[s];if(a===void 0)r[s]=o;else if(!(a===o||o===void 0))if(Object.hasOwnProperty.call(t,s))r[s]=t[s](a,o);else throw new Error("Config merge conflict for field "+s)}for(let i in e)r[i]===void 0&&(r[i]=e[i]);return r}class xc{eq(e){return this==e}range(e,t=e){return m1.create(e,t,this)}}xc.prototype.startSide=xc.prototype.endSide=0;xc.prototype.point=!1;xc.prototype.mapMode=Kr.TrackDel;let m1=class sI{constructor(e,t,r){this.from=e,this.to=t,this.value=r}static create(e,t,r){return new sI(e,t,r)}};function g1(n,e){return n.from-e.from||n.value.startSide-e.value.startSide}class Xw{constructor(e,t,r,i){this.from=e,this.to=t,this.value=r,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(e,t,r,i=0){let s=r?this.to:this.from;for(let o=i,a=s.length;;){if(o==a)return o;let l=o+a>>1,c=s[l]-e||(r?this.value[l].endSide:this.value[l].startSide)-t;if(l==o)return c>=0?o:a;c>=0?a=l:o=l+1}}between(e,t,r,i){for(let s=this.findIndex(t,-1e9,!0),o=this.findIndex(r,1e9,!1,s);s<o;s++)if(i(this.from[s]+e,this.to[s]+e,this.value[s])===!1)return!1}map(e,t){let r=[],i=[],s=[],o=-1,a=-1;for(let l=0;l<this.value.length;l++){let c=this.value[l],u=this.from[l]+e,d=this.to[l]+e,h,m;if(u==d){let g=t.mapPos(u,c.startSide,c.mapMode);if(g==null||(h=m=g,c.startSide!=c.endSide&&(m=t.mapPos(u,c.endSide),m<h)))continue}else if(h=t.mapPos(u,c.startSide),m=t.mapPos(d,c.endSide),h>m||h==m&&c.startSide>0&&c.endSide<=0)continue;(m-h||c.endSide-c.startSide)<0||(o<0&&(o=h),c.point&&(a=Math.max(a,m-h)),r.push(c),i.push(h-o),s.push(m-o))}return{mapped:r.length?new Xw(i,s,r,a):null,pos:o}}}class Mn{constructor(e,t,r,i){this.chunkPos=e,this.chunk=t,this.nextLayer=r,this.maxPoint=i}static create(e,t,r,i){return new Mn(e,t,r,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:r=!1,filterFrom:i=0,filterTo:s=this.length}=e,o=e.filter;if(t.length==0&&!o)return this;if(r&&(t=t.slice().sort(g1)),this.isEmpty)return t.length?Mn.of(t):this;let a=new oI(this,null,-1).goto(0),l=0,c=[],u=new xa;for(;a.value||l<t.length;)if(l<t.length&&(a.from-t[l].from||a.startSide-t[l].value.startSide)>=0){let d=t[l++];u.addInner(d.from,d.to,d.value)||c.push(d)}else a.rangeIndex==1&&a.chunkIndex<this.chunk.length&&(l==t.length||this.chunkEnd(a.chunkIndex)<t[l].from)&&(!o||i>this.chunkEnd(a.chunkIndex)||s<this.chunkPos[a.chunkIndex])&&u.addChunk(this.chunkPos[a.chunkIndex],this.chunk[a.chunkIndex])?a.nextChunk():((!o||i>a.to||s<a.from||o(a.from,a.to,a.value))&&(u.addInner(a.from,a.to,a.value)||c.push(m1.create(a.from,a.to,a.value))),a.next());return u.finishInner(this.nextLayer.isEmpty&&!c.length?Mn.empty:this.nextLayer.update({add:c,filter:o,filterFrom:i,filterTo:s}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],r=[],i=-1;for(let o=0;o<this.chunk.length;o++){let a=this.chunkPos[o],l=this.chunk[o],c=e.touchesRange(a,a+l.length);if(c===!1)i=Math.max(i,l.maxPoint),t.push(l),r.push(e.mapPos(a));else if(c===!0){let{mapped:u,pos:d}=l.map(a,e);u&&(i=Math.max(i,u.maxPoint),t.push(u),r.push(d))}}let s=this.nextLayer.map(e);return t.length==0?s:new Mn(r,t,s||Mn.empty,i)}between(e,t,r){if(!this.isEmpty){for(let i=0;i<this.chunk.length;i++){let s=this.chunkPos[i],o=this.chunk[i];if(t>=s&&e<=s+o.length&&o.between(s,e-s,t-s,r)===!1)return}this.nextLayer.between(e,t,r)}}iter(e=0){return Bd.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return Bd.from(e).goto(t)}static compare(e,t,r,i,s=-1){let o=e.filter(d=>d.maxPoint>0||!d.isEmpty&&d.maxPoint>=s),a=t.filter(d=>d.maxPoint>0||!d.isEmpty&&d.maxPoint>=s),l=HC(o,a,r),c=new Gf(o,l,s),u=new Gf(a,l,s);r.iterGaps((d,h,m)=>KC(c,d,u,h,m,i)),r.empty&&r.length==0&&KC(c,0,u,0,0,i)}static eq(e,t,r=0,i){i==null&&(i=999999999);let s=e.filter(u=>!u.isEmpty&&t.indexOf(u)<0),o=t.filter(u=>!u.isEmpty&&e.indexOf(u)<0);if(s.length!=o.length)return!1;if(!s.length)return!0;let a=HC(s,o),l=new Gf(s,a,0).goto(r),c=new Gf(o,a,0).goto(r);for(;;){if(l.to!=c.to||!O1(l.active,c.active)||l.point&&(!c.point||!l.point.eq(c.point)))return!1;if(l.to>i)return!0;l.next(),c.next()}}static spans(e,t,r,i,s=-1){let o=new Gf(e,null,s).goto(t),a=t,l=o.openStart;for(;;){let c=Math.min(o.to,r);if(o.point){let u=o.activeForPoint(o.to),d=o.pointFrom<t?u.length+1:o.point.startSide<0?u.length:Math.min(u.length,l);i.point(a,c,o.point,u,d,o.pointRank),l=Math.min(o.openEnd(c),u.length)}else c>a&&(i.span(a,c,o.active,l),l=o.openEnd(c));if(o.to>r)return l+(o.point&&o.to>r?1:0);a=o.to,o.next()}}static of(e,t=!1){let r=new xa;for(let i of e instanceof m1?[e]:t?SV(e):e)r.add(i.from,i.to,i.value);return r.finish()}static join(e){if(!e.length)return Mn.empty;let t=e[e.length-1];for(let r=e.length-2;r>=0;r--)for(let i=e[r];i!=Mn.empty;i=i.nextLayer)t=new Mn(i.chunkPos,i.chunk,t,Math.max(i.maxPoint,t.maxPoint));return t}}Mn.empty=new Mn([],[],null,-1);function SV(n){if(n.length>1)for(let e=n[0],t=1;t<n.length;t++){let r=n[t];if(g1(e,r)>0)return n.slice().sort(g1);e=r}return n}Mn.empty.nextLayer=Mn.empty;class xa{finishChunk(e){this.chunks.push(new Xw(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,r){this.addInner(e,t,r)||(this.nextLayer||(this.nextLayer=new xa)).add(e,t,r)}addInner(e,t,r){let i=e-this.lastTo||r.startSide-this.last.endSide;if(i<=0&&(e-this.lastFrom||r.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return i<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=r,this.lastFrom=e,this.lastTo=t,this.value.push(r),r.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let r=t.value.length-1;return this.last=t.value[r],this.lastFrom=t.from[r]+e,this.lastTo=t.to[r]+e,!0}finish(){return this.finishInner(Mn.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=Mn.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function HC(n,e,t){let r=new Map;for(let s of n)for(let o=0;o<s.chunk.length;o++)s.chunk[o].maxPoint<=0&&r.set(s.chunk[o],s.chunkPos[o]);let i=new Set;for(let s of e)for(let o=0;o<s.chunk.length;o++){let a=r.get(s.chunk[o]);a!=null&&(t?t.mapPos(a):a)==s.chunkPos[o]&&!(t!=null&&t.touchesRange(a,a+s.chunk[o].length))&&i.add(s.chunk[o])}return i}class oI{constructor(e,t,r,i=0){this.layer=e,this.skip=t,this.minPoint=r,this.rank=i}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,r){for(;this.chunkIndex<this.layer.chunk.length;){let i=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(i)||this.layer.chunkEnd(this.chunkIndex)<e||i.maxPoint<this.minPoint))break;this.chunkIndex++,r=!1}if(this.chunkIndex<this.layer.chunk.length){let i=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!r||this.rangeIndex<i)&&this.setRangeIndex(i)}this.next()}forward(e,t){(this.to-e||this.endSide-t)<0&&this.gotoInner(e,t,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex],r=e+t.from[this.rangeIndex];if(this.from=r,this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class Bd{constructor(e){this.heap=e}static from(e,t=null,r=-1){let i=[];for(let s=0;s<e.length;s++)for(let o=e[s];!o.isEmpty;o=o.nextLayer)o.maxPoint>=r&&i.push(new oI(o,t,r,s));return i.length==1?i[0]:new Bd(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let r of this.heap)r.goto(e,t);for(let r=this.heap.length>>1;r>=0;r--)p0(this.heap,r);return this.next(),this}forward(e,t){for(let r of this.heap)r.forward(e,t);for(let r=this.heap.length>>1;r>=0;r--)p0(this.heap,r);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),p0(this.heap,0)}}}function p0(n,e){for(let t=n[e];;){let r=(e<<1)+1;if(r>=n.length)break;let i=n[r];if(r+1<n.length&&i.compare(n[r+1])>=0&&(i=n[r+1],r++),t.compare(i)<0)break;n[r]=t,n[e]=i,e=r}}class Gf{constructor(e,t,r){this.minPoint=r,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Bd.from(e,t,r)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){Ap(this.active,e),Ap(this.activeTo,e),Ap(this.activeRank,e),this.minActive=JC(this.active,this.activeTo)}addActive(e){let t=0,{value:r,to:i,rank:s}=this.cursor;for(;t<this.activeRank.length&&(s-this.activeRank[t]||i-this.activeTo[t])>0;)t++;$p(this.active,t,r),$p(this.activeTo,t,i),$p(this.activeRank,t,s),e&&$p(e,t,this.cursor.from),this.minActive=JC(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let r=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>e){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),r&&Ap(r,i)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(r),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=s,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=s.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(r){this.openStart=0;for(let i=r.length-1;i>=0&&r[i]<e;i--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let r=this.active.length-1;r>=0&&!(this.activeRank[r]<this.pointRank);r--)(this.activeTo[r]>e||this.activeTo[r]==e&&this.active[r].endSide>=this.point.endSide)&&t.push(this.active[r]);return t.reverse()}openEnd(e){let t=0;for(let r=this.activeTo.length-1;r>=0&&this.activeTo[r]>e;r--)t++;return t}}function KC(n,e,t,r,i,s){n.goto(e),t.goto(r);let o=r+i,a=r,l=r-e;for(;;){let c=n.to+l-t.to,u=c||n.endSide-t.endSide,d=u<0?n.to+l:t.to,h=Math.min(d,o);if(n.point||t.point?n.point&&t.point&&(n.point==t.point||n.point.eq(t.point))&&O1(n.activeForPoint(n.to),t.activeForPoint(t.to))||s.comparePoint(a,h,n.point,t.point):h>a&&!O1(n.active,t.active)&&s.compareRange(a,h,n.active,t.active),d>o)break;(c||n.openEnd!=t.openEnd)&&s.boundChange&&s.boundChange(d),a=d,u<=0&&n.next(),u>=0&&t.next()}}function O1(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!=e[t]&&!n[t].eq(e[t]))return!1;return!0}function Ap(n,e){for(let t=e,r=n.length-1;t<r;t++)n[t]=n[t+1];n.pop()}function $p(n,e,t){for(let r=n.length-1;r>=e;r--)n[r+1]=n[r];n[e]=t}function JC(n,e){let t=-1,r=1e9;for(let i=0;i<e.length;i++)(e[i]-r||n[i].endSide-n[t].endSide)<0&&(t=i,r=e[i]);return t}function fo(n,e,t=n.length){let r=0;for(let i=0;i<t&&i<n.length;)n.charCodeAt(i)==9?(r+=e-r%e,i++):(r++,i=vi(n,i));return r}function v1(n,e,t,r){for(let i=0,s=0;;){if(s>=e)return i;if(i==n.length)break;s+=n.charCodeAt(i)==9?t-s%t:1,i=vi(n,i)}return r===!0?-1:n.length}const y1="ͼ",e_=typeof Symbol>"u"?"__"+y1:Symbol.for(y1),b1=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),t_=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class xl{constructor(e,t){this.rules=[];let{finish:r}=t||{};function i(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function s(o,a,l,c){let u=[],d=/^@(\w+)\b/.exec(o[0]),h=d&&d[1]=="keyframes";if(d&&a==null)return l.push(o[0]+";");for(let m in a){let g=a[m];if(/&/.test(m))s(m.split(/,\s*/).map(O=>o.map(y=>O.replace(/&/,y))).reduce((O,y)=>O.concat(y)),g,l);else if(g&&typeof g=="object"){if(!d)throw new RangeError("The value of a property ("+m+") should be a primitive value.");s(i(m),g,u,h)}else g!=null&&u.push(m.replace(/_.*/,"").replace(/[A-Z]/g,O=>"-"+O.toLowerCase())+": "+g+";")}(u.length||h)&&l.push((r&&!d&&!c?o.map(r):o).join(", ")+" {"+u.join(" ")+"}")}for(let o in e)s(i(o),e[o],this.rules)}getRules(){return this.rules.join(`
|
|
121
|
+
`)}static newName(){let e=t_[e_]||1;return t_[e_]=e+1,y1+e.toString(36)}static mount(e,t,r){let i=e[b1],s=r&&r.nonce;i?s&&i.setNonce(s):i=new wV(e,s),i.mount(Array.isArray(t)?t:[t],e)}}let n_=new Map;class wV{constructor(e,t){let r=e.ownerDocument||e,i=r.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let s=n_.get(r);if(s)return e[b1]=s;this.sheet=new i.CSSStyleSheet,n_.set(r,this)}else this.styleTag=r.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[b1]=this}mount(e,t){let r=this.sheet,i=0,s=0;for(let o=0;o<e.length;o++){let a=e[o],l=this.modules.indexOf(a);if(l<s&&l>-1&&(this.modules.splice(l,1),s--,l=-1),l==-1){if(this.modules.splice(s++,0,a),r)for(let c=0;c<a.rules.length;c++)r.insertRule(a.rules[c],i++)}else{for(;s<l;)i+=this.modules[s++].rules.length;i+=a.rules.length,s++}}if(r)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let o="";for(let l=0;l<this.modules.length;l++)o+=this.modules[l].getRules()+`
|
|
122
|
+
`;this.styleTag.textContent=o;let a=t.head||t;this.styleTag.parentNode!=a&&a.insertBefore(this.styleTag,a.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var Tl={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Fd={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},kV=typeof navigator<"u"&&/Mac/.test(navigator.platform),PV=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var gi=0;gi<10;gi++)Tl[48+gi]=Tl[96+gi]=String(gi);for(var gi=1;gi<=24;gi++)Tl[gi+111]="F"+gi;for(var gi=65;gi<=90;gi++)Tl[gi]=String.fromCharCode(gi+32),Fd[gi]=String.fromCharCode(gi);for(var m0 in Tl)Fd.hasOwnProperty(m0)||(Fd[m0]=Tl[m0]);function xV(n){var e=kV&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||PV&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?Fd:Tl)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}function Vd(n){let e;return n.nodeType==11?e=n.getSelection?n:n.ownerDocument:e=n,e.getSelection()}function S1(n,e){return e?n==e||n.contains(e.nodeType!=1?e.parentNode:e):!1}function Tg(n,e){if(!e.anchorNode)return!1;try{return S1(n,e.anchorNode)}catch{return!1}}function Zd(n){return n.nodeType==3?Cc(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function Md(n,e,t,r){return t?r_(n,e,t,r,-1)||r_(n,e,t,r,1):!1}function Tc(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e}function rO(n){return n.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(n.nodeName)}function r_(n,e,t,r,i){for(;;){if(n==t&&e==r)return!0;if(e==(i<0?0:zo(n))){if(n.nodeName=="DIV")return!1;let s=n.parentNode;if(!s||s.nodeType!=1)return!1;e=Tc(n)+(i<0?0:1),n=s}else if(n.nodeType==1){if(n=n.childNodes[e+(i<0?-1:0)],n.nodeType==1&&n.contentEditable=="false")return!1;e=i<0?zo(n):0}else return!1}}function zo(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function zO(n,e){let t=e?n.left:n.right;return{left:t,right:t,top:n.top,bottom:n.bottom}}function TV(n){let e=n.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:n.innerWidth,top:0,bottom:n.innerHeight}}function aI(n,e){let t=e.width/n.offsetWidth,r=e.height/n.offsetHeight;return(t>.995&&t<1.005||!isFinite(t)||Math.abs(e.width-n.offsetWidth)<1)&&(t=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(e.height-n.offsetHeight)<1)&&(r=1),{scaleX:t,scaleY:r}}function CV(n,e,t,r,i,s,o,a){let l=n.ownerDocument,c=l.defaultView||window;for(let u=n,d=!1;u&&!d;)if(u.nodeType==1){let h,m=u==l.body,g=1,O=1;if(m)h=TV(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(u).position)&&(d=!0),u.scrollHeight<=u.clientHeight&&u.scrollWidth<=u.clientWidth){u=u.assignedSlot||u.parentNode;continue}let S=u.getBoundingClientRect();({scaleX:g,scaleY:O}=aI(u,S)),h={left:S.left,right:S.left+u.clientWidth*g,top:S.top,bottom:S.top+u.clientHeight*O}}let y=0,b=0;if(i=="nearest")e.top<h.top?(b=e.top-(h.top+o),t>0&&e.bottom>h.bottom+b&&(b=e.bottom-h.bottom+o)):e.bottom>h.bottom&&(b=e.bottom-h.bottom+o,t<0&&e.top-b<h.top&&(b=e.top-(h.top+o)));else{let S=e.bottom-e.top,P=h.bottom-h.top;b=(i=="center"&&S<=P?e.top+S/2-P/2:i=="start"||i=="center"&&t<0?e.top-o:e.bottom-P+o)-h.top}if(r=="nearest"?e.left<h.left?(y=e.left-(h.left+s),t>0&&e.right>h.right+y&&(y=e.right-h.right+s)):e.right>h.right&&(y=e.right-h.right+s,t<0&&e.left<h.left+y&&(y=e.left-(h.left+s))):y=(r=="center"?e.left+(e.right-e.left)/2-(h.right-h.left)/2:r=="start"==a?e.left-s:e.right-(h.right-h.left)+s)-h.left,y||b)if(m)c.scrollBy(y,b);else{let S=0,P=0;if(b){let k=u.scrollTop;u.scrollTop+=b/O,P=(u.scrollTop-k)*O}if(y){let k=u.scrollLeft;u.scrollLeft+=y/g,S=(u.scrollLeft-k)*g}e={left:e.left-S,top:e.top-P,right:e.right-S,bottom:e.bottom-P},S&&Math.abs(S-y)<1&&(r="nearest"),P&&Math.abs(P-b)<1&&(i="nearest")}if(m)break;(e.top<h.top||e.bottom>h.bottom||e.left<h.left||e.right>h.right)&&(e={left:Math.max(e.left,h.left),right:Math.min(e.right,h.right),top:Math.max(e.top,h.top),bottom:Math.min(e.bottom,h.bottom)}),u=u.assignedSlot||u.parentNode}else if(u.nodeType==11)u=u.host;else break}function _V(n){let e=n.ownerDocument,t,r;for(let i=n.parentNode;i&&!(i==e.body||t&&r);)if(i.nodeType==1)!r&&i.scrollHeight>i.clientHeight&&(r=i),!t&&i.scrollWidth>i.clientWidth&&(t=i),i=i.assignedSlot||i.parentNode;else if(i.nodeType==11)i=i.host;else break;return{x:t,y:r}}class EV{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:r}=e;this.set(t,Math.min(e.anchorOffset,t?zo(t):0),r,Math.min(e.focusOffset,r?zo(r):0))}set(e,t,r,i){this.anchorNode=e,this.anchorOffset=t,this.focusNode=r,this.focusOffset=i}}let ou=null;function lI(n){if(n.setActive)return n.setActive();if(ou)return n.focus(ou);let e=[];for(let t=n;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(n.focus(ou==null?{get preventScroll(){return ou={preventScroll:!0},!0}}:void 0),!ou){ou=!1;for(let t=0;t<e.length;){let r=e[t++],i=e[t++],s=e[t++];r.scrollTop!=i&&(r.scrollTop=i),r.scrollLeft!=s&&(r.scrollLeft=s)}}}let i_;function Cc(n,e,t=e){let r=i_||(i_=document.createRange());return r.setEnd(n,t),r.setStart(n,e),r}function Iu(n,e,t,r){let i={key:e,code:e,keyCode:t,which:t,cancelable:!0};r&&({altKey:i.altKey,ctrlKey:i.ctrlKey,shiftKey:i.shiftKey,metaKey:i.metaKey}=r);let s=new KeyboardEvent("keydown",i);s.synthetic=!0,n.dispatchEvent(s);let o=new KeyboardEvent("keyup",i);return o.synthetic=!0,n.dispatchEvent(o),s.defaultPrevented||o.defaultPrevented}function RV(n){for(;n;){if(n&&(n.nodeType==9||n.nodeType==11&&n.host))return n;n=n.assignedSlot||n.parentNode}return null}function cI(n){for(;n.attributes.length;)n.removeAttributeNode(n.attributes[0])}function AV(n,e){let t=e.focusNode,r=e.focusOffset;if(!t||e.anchorNode!=t||e.anchorOffset!=r)return!1;for(r=Math.min(r,zo(t));;)if(r){if(t.nodeType!=1)return!1;let i=t.childNodes[r-1];i.contentEditable=="false"?r--:(t=i,r=zo(t))}else{if(t==n)return!0;r=Tc(t),t=t.parentNode}}function uI(n){return n.scrollTop>Math.max(1,n.scrollHeight-n.clientHeight-4)}function fI(n,e){for(let t=n,r=e;;){if(t.nodeType==3&&r>0)return{node:t,offset:r};if(t.nodeType==1&&r>0){if(t.contentEditable=="false")return null;t=t.childNodes[r-1],r=zo(t)}else if(t.parentNode&&!rO(t))r=Tc(t),t=t.parentNode;else return null}}function dI(n,e){for(let t=n,r=e;;){if(t.nodeType==3&&r<t.nodeValue.length)return{node:t,offset:r};if(t.nodeType==1&&r<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[r],r=0}else if(t.parentNode&&!rO(t))r=Tc(t)+1,t=t.parentNode;else return null}}class Ri{constructor(e,t,r=!0){this.node=e,this.offset=t,this.precise=r}static before(e,t){return new Ri(e.parentNode,Tc(e),t)}static after(e,t){return new Ri(e.parentNode,Tc(e)+1,t)}}const zw=[];class er{constructor(){this.parent=null,this.dom=null,this.flags=2}get overrideDOMText(){return null}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e){let t=this.posAtStart;for(let r of this.children){if(r==e)return t;t+=r.length+r.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}sync(e,t){if(this.flags&2){let r=this.dom,i=null,s;for(let o of this.children){if(o.flags&7){if(!o.dom&&(s=i?i.nextSibling:r.firstChild)){let a=er.get(s);(!a||!a.parent&&a.canReuseDOM(o))&&o.reuseDOM(s)}o.sync(e,t),o.flags&=-8}if(s=i?i.nextSibling:r.firstChild,t&&!t.written&&t.node==r&&s!=o.dom&&(t.written=!0),o.dom.parentNode==r)for(;s&&s!=o.dom;)s=s_(s);else r.insertBefore(o.dom,s);i=o.dom}for(s=i?i.nextSibling:r.firstChild,s&&t&&t.node==r&&(t.written=!0);s;)s=s_(s)}else if(this.flags&1)for(let r of this.children)r.flags&7&&(r.sync(e,t),r.flags&=-8)}reuseDOM(e){}localPosFromDOM(e,t){let r;if(e==this.dom)r=this.dom.childNodes[t];else{let i=zo(e)==0?0:t==0?-1:1;for(;;){let s=e.parentNode;if(s==this.dom)break;i==0&&s.firstChild!=s.lastChild&&(e==s.firstChild?i=-1:i=1),e=s}i<0?r=e:r=e.nextSibling}if(r==this.dom.firstChild)return 0;for(;r&&!er.get(r);)r=r.nextSibling;if(!r)return this.length;for(let i=0,s=0;;i++){let o=this.children[i];if(o.dom==r)return s;s+=o.length+o.breakAfter}}domBoundsAround(e,t,r=0){let i=-1,s=-1,o=-1,a=-1;for(let l=0,c=r,u=r;l<this.children.length;l++){let d=this.children[l],h=c+d.length;if(c<e&&h>t)return d.domBoundsAround(e,t,c);if(h>=e&&i==-1&&(i=l,s=c),c>t&&d.dom.parentNode==this.dom){o=l,a=u;break}u=h,c=h+d.breakAfter}return{from:s,to:a<0?r+this.length:a,startDOM:(i?this.children[i-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o<this.children.length&&o>=0?this.children[o].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let t=this.parent;t;t=t.parent){if(e&&(t.flags|=2),t.flags&1)return;t.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.flags&7&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let t=e.parent;if(!t)return e;e=t}}replaceChildren(e,t,r=zw){this.markDirty();for(let i=e;i<t;i++){let s=this.children[i];s.parent==this&&r.indexOf(s)<0&&s.destroy()}r.length<250?this.children.splice(e,t-e,...r):this.children=[].concat(this.children.slice(0,e),r,this.children.slice(t));for(let i=0;i<r.length;i++)r[i].setParent(this)}ignoreMutation(e){return!1}ignoreEvent(e){return!1}childCursor(e=this.length){return new hI(this.children,e,this.children.length)}childPos(e,t=1){return this.childCursor().findPos(e,t)}toString(){let e=this.constructor.name.replace("View","");return e+(this.children.length?"("+this.children.join()+")":this.length?"["+(e=="Text"?this.text:this.length)+"]":"")+(this.breakAfter?"#":"")}static get(e){return e.cmView}get isEditable(){return!0}get isWidget(){return!1}get isHidden(){return!1}merge(e,t,r,i,s,o){return!1}become(e){return!1}canReuseDOM(e){return e.constructor==this.constructor&&!((this.flags|e.flags)&8)}getSide(){return 0}destroy(){for(let e of this.children)e.parent==this&&e.destroy();this.parent=null}}er.prototype.breakAfter=0;function s_(n){let e=n.nextSibling;return n.parentNode.removeChild(n),e}class hI{constructor(e,t,r){this.children=e,this.pos=t,this.i=r,this.off=0}findPos(e,t=1){for(;;){if(e>this.pos||e==this.pos&&(t>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let r=this.children[--this.i];this.pos-=r.length+r.breakAfter}}}function pI(n,e,t,r,i,s,o,a,l){let{children:c}=n,u=c.length?c[e]:null,d=s.length?s[s.length-1]:null,h=d?d.breakAfter:o;if(!(e==r&&u&&!o&&!h&&s.length<2&&u.merge(t,i,s.length?d:null,t==0,a,l))){if(r<c.length){let m=c[r];m&&(i<m.length||m.breakAfter&&(d!=null&&d.breakAfter))?(e==r&&(m=m.split(i),i=0),!h&&d&&m.merge(0,i,d,!0,0,l)?s[s.length-1]=m:((i||m.children.length&&!m.children[0].length)&&m.merge(0,i,null,!1,0,l),s.push(m))):m!=null&&m.breakAfter&&(d?d.breakAfter=1:o=1),r++}for(u&&(u.breakAfter=o,t>0&&(!o&&s.length&&u.merge(t,u.length,s[0],!1,a,0)?u.breakAfter=s.shift().breakAfter:(t<u.length||u.children.length&&u.children[u.children.length-1].length==0)&&u.merge(t,u.length,null,!1,a,0),e++));e<r&&s.length;)if(c[r-1].become(s[s.length-1]))r--,s.pop(),l=s.length?0:a;else if(c[e].become(s[0]))e++,s.shift(),a=s.length?0:l;else break;!s.length&&e&&r<c.length&&!c[e-1].breakAfter&&c[r].merge(0,0,c[e-1],!1,a,l)&&e--,(e<r||s.length)&&n.replaceChildren(e,r,s)}}function mI(n,e,t,r,i,s){let o=n.childCursor(),{i:a,off:l}=o.findPos(t,1),{i:c,off:u}=o.findPos(e,-1),d=e-t;for(let h of r)d+=h.length;n.length+=d,pI(n,c,u,a,l,r,0,i,s)}let ts=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},w1=typeof document<"u"?document:{documentElement:{style:{}}};const k1=/Edge\/(\d+)/.exec(ts.userAgent),gI=/MSIE \d/.test(ts.userAgent),P1=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ts.userAgent),YO=!!(gI||P1||k1),o_=!YO&&/gecko\/(\d+)/i.test(ts.userAgent),g0=!YO&&/Chrome\/(\d+)/.exec(ts.userAgent),$V="webkitFontSmoothing"in w1.documentElement.style,OI=!YO&&/Apple Computer/.test(ts.vendor),a_=OI&&(/Mobile\/\w+/.test(ts.userAgent)||ts.maxTouchPoints>2);var yt={mac:a_||/Mac/.test(ts.platform),windows:/Win/.test(ts.platform),linux:/Linux|X11/.test(ts.platform),ie:YO,ie_version:gI?w1.documentMode||6:P1?+P1[1]:k1?+k1[1]:0,gecko:o_,gecko_version:o_?+(/Firefox\/(\d+)/.exec(ts.userAgent)||[0,0])[1]:0,chrome:!!g0,chrome_version:g0?+g0[1]:0,ios:a_,android:/Android\b/.test(ts.userAgent),safari:OI,webkit_version:$V?+(/\bAppleWebKit\/(\d+)/.exec(ts.userAgent)||[0,0])[1]:0,tabSize:w1.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const MV=256;class ho extends er{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,t){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){e.nodeType==3&&this.createDOM(e)}merge(e,t,r){return this.flags&8||r&&(!(r instanceof ho)||this.length-(t-e)+r.length>MV||r.flags&8)?!1:(this.text=this.text.slice(0,e)+(r?r.text:"")+this.text.slice(t),this.markDirty(),!0)}split(e){let t=new ho(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t.flags|=this.flags&8,t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new Ri(this.dom,e)}domBoundsAround(e,t,r){return{from:r,to:r+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return QV(this.dom,e,t)}}class Ta extends er{constructor(e,t=[],r=0){super(),this.mark=e,this.children=t,this.length=r;for(let i of t)i.setParent(this)}setAttrs(e){if(cI(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!((this.flags|e.flags)&8)}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,t){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,t)}merge(e,t,r,i,s,o){return r&&(!(r instanceof Ta&&r.mark.eq(this.mark))||e&&s<=0||t<this.length&&o<=0)?!1:(mI(this,e,t,r?r.children.slice():[],s-1,o-1),this.markDirty(),!0)}split(e){let t=[],r=0,i=-1,s=0;for(let a of this.children){let l=r+a.length;l>e&&t.push(r<e?a.split(e-r):a),i<0&&r>=e&&(i=s),r=l,s++}let o=this.length-e;return this.length=e,i>-1&&(this.children.length=i,this.markDirty()),new Ta(this.mark,t,o)}domAtPos(e){return vI(this,e)}coordsAt(e,t){return bI(this,e,t)}}function QV(n,e,t){let r=n.nodeValue.length;e>r&&(e=r);let i=e,s=e,o=0;e==0&&t<0||e==r&&t>=0?yt.chrome||yt.gecko||(e?(i--,o=1):s<r&&(s++,o=-1)):t<0?i--:s<r&&s++;let a=Cc(n,i,s).getClientRects();if(!a.length)return null;let l=a[(o?o<0:t>=0)?0:a.length-1];return yt.safari&&!o&&l.width==0&&(l=Array.prototype.find.call(a,c=>c.width)||l),o?zO(l,o<0):l||null}class gl extends er{static create(e,t,r){return new gl(e,t,r)}constructor(e,t,r){super(),this.widget=e,this.length=t,this.side=r,this.prevWidget=null}split(e){let t=gl.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(e,t,r,i,s,o){return r&&(!(r instanceof gl)||!this.widget.compare(r.widget)||e>0&&s<=0||t<this.length&&o<=0)?!1:(this.length=e+(r?r.length:0)+(this.length-t),!0)}become(e){return e instanceof gl&&e.side==this.side&&this.widget.constructor==e.widget.constructor?(this.widget.compare(e.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=e.widget,this.length=e.length,!0):!1}ignoreMutation(){return!0}ignoreEvent(e){return this.widget.ignoreEvent(e)}get overrideDOMText(){if(this.length==0)return En.empty;let e=this;for(;e.parent;)e=e.parent;let{view:t}=e,r=t&&t.state.doc,i=this.posAtStart;return r?r.slice(i,i+this.length):En.empty}domAtPos(e){return(this.length?e==0:this.side>0)?Ri.before(this.dom):Ri.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,t){let r=this.widget.coordsAt(this.dom,e,t);if(r)return r;let i=this.dom.getClientRects(),s=null;if(!i.length)return null;let o=this.side?this.side<0:e>0;for(let a=o?i.length-1:0;s=i[a],!(e>0?a==0:a==i.length-1||s.top<s.bottom);a+=o?-1:1);return zO(s,!o)}get isEditable(){return!1}get isWidget(){return!0}get isHidden(){return this.widget.isHidden}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}}class Yu extends er{constructor(e){super(),this.side=e}get length(){return 0}merge(){return!1}become(e){return e instanceof Yu&&e.side==this.side}split(){return new Yu(this.side)}sync(){if(!this.dom){let e=document.createElement("img");e.className="cm-widgetBuffer",e.setAttribute("aria-hidden","true"),this.setDOM(e)}}getSide(){return this.side}domAtPos(e){return this.side>0?Ri.before(this.dom):Ri.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return En.empty}get isHidden(){return!0}}ho.prototype.children=gl.prototype.children=Yu.prototype.children=zw;function vI(n,e){let t=n.dom,{children:r}=n,i=0;for(let s=0;i<r.length;i++){let o=r[i],a=s+o.length;if(!(a==s&&o.getSide()<=0)){if(e>s&&e<a&&o.dom.parentNode==t)return o.domAtPos(e-s);if(e<=s)break;s=a}}for(let s=i;s>0;s--){let o=r[s-1];if(o.dom.parentNode==t)return o.domAtPos(o.length)}for(let s=i;s<r.length;s++){let o=r[s];if(o.dom.parentNode==t)return o.domAtPos(0)}return new Ri(t,0)}function yI(n,e,t){let r,{children:i}=n;t>0&&e instanceof Ta&&i.length&&(r=i[i.length-1])instanceof Ta&&r.mark.eq(e.mark)?yI(r,e.children[0],t-1):(i.push(e),e.setParent(n)),n.length+=e.length}function bI(n,e,t){let r=null,i=-1,s=null,o=-1;function a(c,u){for(let d=0,h=0;d<c.children.length&&h<=u;d++){let m=c.children[d],g=h+m.length;g>=u&&(m.children.length?a(m,u-h):(!s||s.isHidden&&(t>0||IV(s,m)))&&(g>u||h==g&&m.getSide()>0)?(s=m,o=u-h):(h<u||h==g&&m.getSide()<0&&!m.isHidden)&&(r=m,i=u-h)),h=g}}a(n,e);let l=(t<0?r:s)||r||s;return l?l.coordsAt(Math.max(0,l==r?i:o),t):DV(n)}function DV(n){let e=n.dom.lastChild;if(!e)return n.dom.getBoundingClientRect();let t=Zd(e);return t[t.length-1]||null}function IV(n,e){let t=n.coordsAt(0,1),r=e.coordsAt(0,1);return t&&r&&r.top<t.bottom}function x1(n,e){for(let t in n)t=="class"&&e.class?e.class+=" "+n.class:t=="style"&&e.style?e.style+=";"+n.style:e[t]=n[t];return e}const l_=Object.create(null);function iO(n,e,t){if(n==e)return!0;n||(n=l_),e||(e=l_);let r=Object.keys(n),i=Object.keys(e);if(r.length-(t&&r.indexOf(t)>-1?1:0)!=i.length-(t&&i.indexOf(t)>-1?1:0))return!1;for(let s of r)if(s!=t&&(i.indexOf(s)==-1||n[s]!==e[s]))return!1;return!0}function T1(n,e,t){let r=!1;if(e)for(let i in e)t&&i in t||(r=!0,i=="style"?n.style.cssText="":n.removeAttribute(i));if(t)for(let i in t)e&&e[i]==t[i]||(r=!0,i=="style"?n.style.cssText=t[i]:n.setAttribute(i,t[i]));return r}function jV(n){let e=Object.create(null);for(let t=0;t<n.attributes.length;t++){let r=n.attributes[t];e[r.name]=r.value}return e}class Ss{eq(e){return!1}updateDOM(e,t){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,r){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var Li=function(n){return n[n.Text=0]="Text",n[n.WidgetBefore=1]="WidgetBefore",n[n.WidgetAfter=2]="WidgetAfter",n[n.WidgetRange=3]="WidgetRange",n}(Li||(Li={}));class mt extends xc{constructor(e,t,r,i){super(),this.startSide=e,this.endSide=t,this.widget=r,this.spec=i}get heightRelevant(){return!1}static mark(e){return new mh(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),r=!!e.block;return t+=r&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new Cl(e,t,t,r,e.widget||null,!1)}static replace(e){let t=!!e.block,r,i;if(e.isBlockGap)r=-5e8,i=4e8;else{let{start:s,end:o}=SI(e,t);r=(s?t?-3e8:-1:5e8)-1,i=(o?t?2e8:1:-6e8)+1}return new Cl(e,r,i,t,e.widget||null,!0)}static line(e){return new gh(e)}static set(e,t=!1){return Mn.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}mt.none=Mn.empty;class mh extends mt{constructor(e){let{start:t,end:r}=SI(e);super(t?-1:5e8,r?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var t,r;return this==e||e instanceof mh&&this.tagName==e.tagName&&(this.class||((t=this.attrs)===null||t===void 0?void 0:t.class))==(e.class||((r=e.attrs)===null||r===void 0?void 0:r.class))&&iO(this.attrs,e.attrs,"class")}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}mh.prototype.point=!1;class gh extends mt{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof gh&&this.spec.class==e.spec.class&&iO(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}gh.prototype.mapMode=Kr.TrackBefore;gh.prototype.point=!0;class Cl extends mt{constructor(e,t,r,i,s,o){super(t,r,s,e),this.block=i,this.isReplace=o,this.mapMode=i?t<=0?Kr.TrackBefore:Kr.TrackAfter:Kr.TrackDel}get type(){return this.startSide!=this.endSide?Li.WidgetRange:this.startSide<=0?Li.WidgetBefore:Li.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof Cl&&NV(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}Cl.prototype.point=!0;function SI(n,e=!1){let{inclusiveStart:t,inclusiveEnd:r}=n;return t==null&&(t=n.inclusive),r==null&&(r=n.inclusive),{start:t??e,end:r??e}}function NV(n,e){return n==e||!!(n&&e&&n.compare(e))}function Cg(n,e,t,r=0){let i=t.length-1;i>=0&&t[i]+r>=n?t[i]=Math.max(t[i],e):t.push(n,e)}class Ur extends er{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,t,r,i,s,o){if(r){if(!(r instanceof Ur))return!1;this.dom||r.transferDOM(this)}return i&&this.setDeco(r?r.attrs:null),mI(this,e,t,r?r.children.slice():[],s,o),!0}split(e){let t=new Ur;if(t.breakAfter=this.breakAfter,this.length==0)return t;let{i:r,off:i}=this.childPos(e);i&&(t.append(this.children[r].split(i),0),this.children[r].merge(i,this.children[r].length,null,!1,0,0),r++);for(let s=r;s<this.children.length;s++)t.append(this.children[s],0);for(;r>0&&this.children[r-1].length==0;)this.children[--r].destroy();return this.children.length=r,this.markDirty(),this.length=e,t}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){iO(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){yI(this,e,t)}addLineDeco(e){let t=e.spec.attributes,r=e.spec.class;t&&(this.attrs=x1(t,this.attrs||{})),r&&(this.attrs=x1({class:r},this.attrs||{}))}domAtPos(e){return vI(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,t){var r;this.dom?this.flags&4&&(cI(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(T1(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,t);let i=this.dom.lastChild;for(;i&&er.get(i)instanceof Ta;)i=i.lastChild;if(!i||!this.length||i.nodeName!="BR"&&((r=er.get(i))===null||r===void 0?void 0:r.isEditable)==!1&&(!yt.ios||!this.children.some(s=>s instanceof ho))){let s=document.createElement("BR");s.cmIgnore=!0,this.dom.appendChild(s)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,t;for(let r of this.children){if(!(r instanceof ho)||/[^ -~]/.test(r.text))return null;let i=Zd(r.dom);if(i.length!=1)return null;e+=i[0].width,t=i[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:t}:null}coordsAt(e,t){let r=bI(this,e,t);if(!this.children.length&&r&&this.parent){let{heightOracle:i}=this.parent.view.viewState,s=r.bottom-r.top;if(Math.abs(s-i.lineHeight)<2&&i.textHeight<s){let o=(s-i.textHeight)/2;return{top:r.top+o,bottom:r.bottom-o,left:r.left,right:r.left}}}return r}become(e){return e instanceof Ur&&this.children.length==0&&e.children.length==0&&iO(this.attrs,e.attrs)&&this.breakAfter==e.breakAfter}covers(){return!0}static find(e,t){for(let r=0,i=0;r<e.children.length;r++){let s=e.children[r],o=i+s.length;if(o>=t){if(s instanceof Ur)return s;if(o>t)break}i=o+s.breakAfter}return null}}class ba extends er{constructor(e,t,r){super(),this.widget=e,this.length=t,this.deco=r,this.breakAfter=0,this.prevWidget=null}merge(e,t,r,i,s,o){return r&&(!(r instanceof ba)||!this.widget.compare(r.widget)||e>0&&s<=0||t<this.length&&o<=0)?!1:(this.length=e+(r?r.length:0)+(this.length-t),!0)}domAtPos(e){return e==0?Ri.before(this.dom):Ri.after(this.dom,e==this.length)}split(e){let t=this.length-e;this.length=e;let r=new ba(this.widget,t,this.deco);return r.breakAfter=this.breakAfter,r}get children(){return zw}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}get overrideDOMText(){return this.parent?this.parent.view.state.doc.slice(this.posAtStart,this.posAtEnd):En.empty}domBoundsAround(){return null}become(e){return e instanceof ba&&e.widget.constructor==this.widget.constructor?(e.widget.compare(this.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=e.widget,this.length=e.length,this.deco=e.deco,this.breakAfter=e.breakAfter,!0):!1}ignoreMutation(){return!0}ignoreEvent(e){return this.widget.ignoreEvent(e)}get isEditable(){return!1}get isWidget(){return!0}coordsAt(e,t){let r=this.widget.coordsAt(this.dom,e,t);return r||(this.widget instanceof C1?null:zO(this.dom.getBoundingClientRect(),this.length?e==0:t<=0))}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}covers(e){let{startSide:t,endSide:r}=this.deco;return t==r?!1:e<0?t<0:r>0}}class C1 extends Ss{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}class Qd{constructor(e,t,r,i){this.doc=e,this.pos=t,this.end=r,this.disallowBlockEffectsFor=i,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=t}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof ba&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new Ur),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(Mp(new Yu(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(e&&this.content.length&&this.content[this.content.length-1]instanceof ba)&&this.getLine()}buildText(e,t,r){for(;e>0;){if(this.textOff==this.text.length){let{value:s,lineBreak:o,done:a}=this.cursor.next(this.skip);if(this.skip=0,a)throw new Error("Ran out of text content when drawing inline views");if(o){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}else this.text=s,this.textOff=0}let i=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-r)),this.getLine().append(Mp(new ho(this.text.slice(this.textOff,this.textOff+i)),t),r),this.atCursorPos=!0,this.textOff+=i,e-=i,r=0}}span(e,t,r,i){this.buildText(t-e,r,i),this.pos=t,this.openStart<0&&(this.openStart=i)}point(e,t,r,i,s,o){if(this.disallowBlockEffectsFor[o]&&r instanceof Cl){if(r.block)throw new RangeError("Block decorations may not be specified via plugins");if(t>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let a=t-e;if(r instanceof Cl)if(r.block)r.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new ba(r.widget||Gu.block,a,r));else{let l=gl.create(r.widget||Gu.inline,a,a?0:r.startSide),c=this.atCursorPos&&!l.isEditable&&s<=i.length&&(e<t||r.startSide>0),u=!l.isEditable&&(e<t||s>i.length||r.startSide<=0),d=this.getLine();this.pendingBuffer==2&&!c&&!l.isEditable&&(this.pendingBuffer=0),this.flushBuffer(i),c&&(d.append(Mp(new Yu(1),i),s),s=i.length+Math.max(0,s-i.length)),d.append(Mp(l,i),s),this.atCursorPos=u,this.pendingBuffer=u?e<t||s>i.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=i.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(r);a&&(this.textOff+a<=this.text.length?this.textOff+=a:(this.skip+=a-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=s)}static build(e,t,r,i,s){let o=new Qd(e,t,r,s);return o.openEnd=Mn.spans(i,t,r,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(o.openEnd),o}}function Mp(n,e){for(let t of e)n=new Ta(t,[n],n.length);return n}class Gu extends Ss{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}Gu.inline=new Gu("span");Gu.block=new Gu("div");var hr=function(n){return n[n.LTR=0]="LTR",n[n.RTL=1]="RTL",n}(hr||(hr={}));const _c=hr.LTR,Yw=hr.RTL;function wI(n){let e=[];for(let t=0;t<n.length;t++)e.push(1<<+n[t]);return e}const LV=wI("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),qV=wI("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),_1=Object.create(null),Po=[];for(let n of["()","[]","{}"]){let e=n.charCodeAt(0),t=n.charCodeAt(1);_1[e]=t,_1[t]=-e}function kI(n){return n<=247?LV[n]:1424<=n&&n<=1524?2:1536<=n&&n<=1785?qV[n-1536]:1774<=n&&n<=2220?4:8192<=n&&n<=8204?256:64336<=n&&n<=65023?4:1}const UV=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class Ol{get dir(){return this.level%2?Yw:_c}constructor(e,t,r){this.from=e,this.to=t,this.level=r}side(e,t){return this.dir==t==e?this.to:this.from}forward(e,t){return e==(this.dir==t)}static find(e,t,r,i){let s=-1;for(let o=0;o<e.length;o++){let a=e[o];if(a.from<=t&&a.to>=t){if(a.level==r)return o;(s<0||(i!=0?i<0?a.from<t:a.to>t:e[s].level>a.level))&&(s=o)}}if(s<0)throw new RangeError("Index out of range");return s}}function PI(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++){let r=n[t],i=e[t];if(r.from!=i.from||r.to!=i.to||r.direction!=i.direction||!PI(r.inner,i.inner))return!1}return!0}const Kn=[];function BV(n,e,t,r,i){for(let s=0;s<=r.length;s++){let o=s?r[s-1].to:e,a=s<r.length?r[s].from:t,l=s?256:i;for(let c=o,u=l,d=l;c<a;c++){let h=kI(n.charCodeAt(c));h==512?h=u:h==8&&d==4&&(h=16),Kn[c]=h==4?2:h,h&7&&(d=h),u=h}for(let c=o,u=l,d=l;c<a;c++){let h=Kn[c];if(h==128)c<a-1&&u==Kn[c+1]&&u&24?h=Kn[c]=u:Kn[c]=256;else if(h==64){let m=c+1;for(;m<a&&Kn[m]==64;)m++;let g=c&&u==8||m<t&&Kn[m]==8?d==1?1:8:256;for(let O=c;O<m;O++)Kn[O]=g;c=m-1}else h==8&&d==1&&(Kn[c]=1);u=h,h&7&&(d=h)}}}function FV(n,e,t,r,i){let s=i==1?2:1;for(let o=0,a=0,l=0;o<=r.length;o++){let c=o?r[o-1].to:e,u=o<r.length?r[o].from:t;for(let d=c,h,m,g;d<u;d++)if(m=_1[h=n.charCodeAt(d)])if(m<0){for(let O=a-3;O>=0;O-=3)if(Po[O+1]==-m){let y=Po[O+2],b=y&2?i:y&4?y&1?s:i:0;b&&(Kn[d]=Kn[Po[O]]=b),a=O;break}}else{if(Po.length==189)break;Po[a++]=d,Po[a++]=h,Po[a++]=l}else if((g=Kn[d])==2||g==1){let O=g==i;l=O?0:1;for(let y=a-3;y>=0;y-=3){let b=Po[y+2];if(b&2)break;if(O)Po[y+2]|=2;else{if(b&4)break;Po[y+2]|=4}}}}}function VV(n,e,t,r){for(let i=0,s=r;i<=t.length;i++){let o=i?t[i-1].to:n,a=i<t.length?t[i].from:e;for(let l=o;l<a;){let c=Kn[l];if(c==256){let u=l+1;for(;;)if(u==a){if(i==t.length)break;u=t[i++].to,a=i<t.length?t[i].from:e}else if(Kn[u]==256)u++;else break;let d=s==1,h=(u<e?Kn[u]:r)==1,m=d==h?d?1:2:r;for(let g=u,O=i,y=O?t[O-1].to:n;g>l;)g==y&&(g=t[--O].from,y=O?t[O-1].to:n),Kn[--g]=m;l=u}else s=c,l++}}}function E1(n,e,t,r,i,s,o){let a=r%2?2:1;if(r%2==i%2)for(let l=e,c=0;l<t;){let u=!0,d=!1;if(c==s.length||l<s[c].from){let O=Kn[l];O!=a&&(u=!1,d=O==16)}let h=!u&&a==1?[]:null,m=u?r:r+1,g=l;e:for(;;)if(c<s.length&&g==s[c].from){if(d)break e;let O=s[c];if(!u)for(let y=O.to,b=c+1;;){if(y==t)break e;if(b<s.length&&s[b].from==y)y=s[b++].to;else{if(Kn[y]==a)break e;break}}if(c++,h)h.push(O);else{O.from>l&&o.push(new Ol(l,O.from,m));let y=O.direction==_c!=!(m%2);R1(n,y?r+1:r,i,O.inner,O.from,O.to,o),l=O.to}g=O.to}else{if(g==t||(u?Kn[g]!=a:Kn[g]==a))break;g++}h?E1(n,l,g,r+1,i,h,o):l<g&&o.push(new Ol(l,g,m)),l=g}else for(let l=t,c=s.length;l>e;){let u=!0,d=!1;if(!c||l>s[c-1].to){let O=Kn[l-1];O!=a&&(u=!1,d=O==16)}let h=!u&&a==1?[]:null,m=u?r:r+1,g=l;e:for(;;)if(c&&g==s[c-1].to){if(d)break e;let O=s[--c];if(!u)for(let y=O.from,b=c;;){if(y==e)break e;if(b&&s[b-1].to==y)y=s[--b].from;else{if(Kn[y-1]==a)break e;break}}if(h)h.push(O);else{O.to<l&&o.push(new Ol(O.to,l,m));let y=O.direction==_c!=!(m%2);R1(n,y?r+1:r,i,O.inner,O.from,O.to,o),l=O.from}g=O.from}else{if(g==e||(u?Kn[g-1]!=a:Kn[g-1]==a))break;g--}h?E1(n,g,l,r+1,i,h,o):g<l&&o.push(new Ol(g,l,m)),l=g}}function R1(n,e,t,r,i,s,o){let a=e%2?2:1;BV(n,i,s,r,a),FV(n,i,s,r,a),VV(i,s,r,a),E1(n,i,s,e,t,r,o)}function ZV(n,e,t){if(!n)return[new Ol(0,0,e==Yw?1:0)];if(e==_c&&!t.length&&!UV.test(n))return xI(n.length);if(t.length)for(;n.length>Kn.length;)Kn[Kn.length]=256;let r=[],i=e==_c?0:1;return R1(n,i,i,t,0,n.length,r),r}function xI(n){return[new Ol(0,n,0)]}let TI="";function WV(n,e,t,r,i){var s;let o=r.head-n.from,a=Ol.find(e,o,(s=r.bidiLevel)!==null&&s!==void 0?s:-1,r.assoc),l=e[a],c=l.side(i,t);if(o==c){let h=a+=i?1:-1;if(h<0||h>=e.length)return null;l=e[a=h],o=l.side(!i,t),c=l.side(i,t)}let u=vi(n.text,o,l.forward(i,t));(u<l.from||u>l.to)&&(u=c),TI=n.text.slice(Math.min(o,u),Math.max(o,u));let d=a==(i?e.length-1:0)?null:e[a+(i?1:-1)];return d&&u==c&&d.level+(i?0:1)<l.level?_e.cursor(d.side(!i,t)+n.from,d.forward(i,t)?1:-1,d.level):_e.cursor(u+n.from,l.forward(i,t)?-1:1,l.level)}function XV(n,e,t){for(let r=e;r<t;r++){let i=kI(n.charCodeAt(r));if(i==1)return _c;if(i==2||i==4)return Yw}return _c}const CI=ft.define(),_I=ft.define(),EI=ft.define(),RI=ft.define(),A1=ft.define(),AI=ft.define(),$I=ft.define(),Gw=ft.define(),Hw=ft.define(),MI=ft.define({combine:n=>n.some(e=>e)}),QI=ft.define({combine:n=>n.some(e=>e)}),DI=ft.define();class ju{constructor(e,t="nearest",r="nearest",i=5,s=5,o=!1){this.range=e,this.y=t,this.x=r,this.yMargin=i,this.xMargin=s,this.isSnapshot=o}map(e){return e.empty?this:new ju(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new ju(_e.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const Qp=Yt.define({map:(n,e)=>n.map(e)}),II=Yt.define();function is(n,e,t){let r=n.facet(RI);r.length?r[0](e):window.onerror?window.onerror(String(e),t,void 0,void 0,e):t?console.error(t+":",e):console.error(e)}const ya=ft.define({combine:n=>n.length?n[0]:!0});let zV=0;const yd=ft.define();class Xn{constructor(e,t,r,i,s){this.id=e,this.create=t,this.domEventHandlers=r,this.domEventObservers=i,this.extension=s(this)}static define(e,t){const{eventHandlers:r,eventObservers:i,provide:s,decorations:o}=t||{};return new Xn(zV++,e,r,i,a=>{let l=[yd.of(a)];return o&&l.push(Wd.of(c=>{let u=c.plugin(a);return u?o(u):mt.none})),s&&l.push(s(a)),l})}static fromClass(e,t){return Xn.define(r=>new e(r),t)}}class O0{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}update(e){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(r){if(is(t.state,r,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(t){is(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(!((t=this.value)===null||t===void 0)&&t.destroy)try{this.value.destroy()}catch(r){is(e.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const jI=ft.define(),Kw=ft.define(),Wd=ft.define(),NI=ft.define(),Jw=ft.define(),LI=ft.define();function c_(n,e){let t=n.state.facet(LI);if(!t.length)return t;let r=t.map(s=>s instanceof Function?s(n):s),i=[];return Mn.spans(r,e.from,e.to,{point(){},span(s,o,a,l){let c=s-e.from,u=o-e.from,d=i;for(let h=a.length-1;h>=0;h--,l--){let m=a[h].spec.bidiIsolate,g;if(m==null&&(m=XV(e.text,c,u)),l>0&&d.length&&(g=d[d.length-1]).to==c&&g.direction==m)g.to=u,d=g.inner;else{let O={from:c,to:u,direction:m,inner:[]};d.push(O),d=O.inner}}}}),i}const qI=ft.define();function ek(n){let e=0,t=0,r=0,i=0;for(let s of n.state.facet(qI)){let o=s(n);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(t=Math.max(t,o.right)),o.top!=null&&(r=Math.max(r,o.top)),o.bottom!=null&&(i=Math.max(i,o.bottom)))}return{left:e,right:t,top:r,bottom:i}}const bd=ft.define();class Ns{constructor(e,t,r,i){this.fromA=e,this.toA=t,this.fromB=r,this.toB=i}join(e){return new Ns(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,r=this;for(;t>0;t--){let i=e[t-1];if(!(i.fromA>r.toA)){if(i.toA<r.fromA)break;r=r.join(i),e.splice(t-1,1)}}return e.splice(t,0,r),e}static extendWithRanges(e,t){if(t.length==0)return e;let r=[];for(let i=0,s=0,o=0,a=0;;i++){let l=i==e.length?null:e[i],c=o-a,u=l?l.fromB:1e9;for(;s<t.length&&t[s]<u;){let d=t[s],h=t[s+1],m=Math.max(a,d),g=Math.min(u,h);if(m<=g&&new Ns(m+c,g+c,m,g).addToSet(r),h>u)break;s+=2}if(!l)return r;new Ns(l.fromA,l.toA,l.fromB,l.toB).addToSet(r),o=l.toA,a=l.toB}}}class sO{constructor(e,t,r){this.view=e,this.state=t,this.transactions=r,this.flags=0,this.startState=e.state,this.changes=Hr.empty(this.startState.doc.length);for(let s of r)this.changes=this.changes.compose(s.changes);let i=[];this.changes.iterChangedRanges((s,o,a,l)=>i.push(new Ns(s,o,a,l))),this.changedRanges=i}static create(e,t,r){return new sO(e,t,r)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}class u_ extends er{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=mt.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new Ur],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new Ns(0,0,0,e.state.doc.length)],0,null)}update(e){var t;let r=e.changedRanges;this.minWidth>0&&r.length&&(r.every(({fromA:c,toA:u})=>u<this.minWidthFrom||c>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let i=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((t=this.domChanged)===null||t===void 0)&&t.newSel?i=this.domChanged.newSel.head:!t6(e.changes,this.hasComposition)&&!e.selectionSet&&(i=e.state.selection.main.head));let s=i>-1?GV(this.view,e.changes,i):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:c,to:u}=this.hasComposition;r=new Ns(c,u,e.changes.mapPos(c,-1),e.changes.mapPos(u,1)).addToSet(r.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(yt.ie||yt.chrome)&&!s&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,a=this.updateDeco(),l=JV(o,a,e.changes);return r=Ns.extendWithRanges(r,l),!(this.flags&7)&&r.length==0?!1:(this.updateInner(r,e.startState.doc.length,s),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t,r){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,t,r);let{observer:i}=this.view;i.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let o=yt.chrome||yt.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,o),this.flags&=-8,o&&(o.written||i.selectionRange.focusNode!=o.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(o=>o.flags&=-9);let s=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let o of this.children)o instanceof ba&&o.widget instanceof C1&&s.push(o.dom);i.updateGaps(s)}updateChildren(e,t,r){let i=r?r.range.addToSet(e.slice()):e,s=this.childCursor(t);for(let o=i.length-1;;o--){let a=o>=0?i[o]:null;if(!a)break;let{fromA:l,toA:c,fromB:u,toB:d}=a,h,m,g,O;if(r&&r.range.fromB<d&&r.range.toB>u){let k=Qd.build(this.view.state.doc,u,r.range.fromB,this.decorations,this.dynamicDecorationMap),x=Qd.build(this.view.state.doc,r.range.toB,d,this.decorations,this.dynamicDecorationMap);m=k.breakAtStart,g=k.openStart,O=x.openEnd;let A=this.compositionView(r);x.breakAtStart?A.breakAfter=1:x.content.length&&A.merge(A.length,A.length,x.content[0],!1,x.openStart,0)&&(A.breakAfter=x.content[0].breakAfter,x.content.shift()),k.content.length&&A.merge(0,0,k.content[k.content.length-1],!0,0,k.openEnd)&&k.content.pop(),h=k.content.concat(A).concat(x.content)}else({content:h,breakAtStart:m,openStart:g,openEnd:O}=Qd.build(this.view.state.doc,u,d,this.decorations,this.dynamicDecorationMap));let{i:y,off:b}=s.findPos(c,1),{i:S,off:P}=s.findPos(l,-1);pI(this,S,P,y,b,h,m,g,O)}r&&this.fixCompositionDOM(r)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let r of t.effects)r.is(II)&&(this.editContextFormatting=r.value)}compositionView(e){let t=new ho(e.text.nodeValue);t.flags|=8;for(let{deco:i}of e.marks)t=new Ta(i,[t],t.length);let r=new Ur;return r.append(t,0),r}fixCompositionDOM(e){let t=(s,o)=>{o.flags|=8|(o.children.some(l=>l.flags&7)?1:0),this.markedForComposition.add(o);let a=er.get(s);a&&a!=o&&(a.dom=null),o.setDOM(s)},r=this.childPos(e.range.fromB,1),i=this.children[r.i];t(e.line,i);for(let s=e.marks.length-1;s>=-1;s--)r=i.childPos(r.off,1),i=i.children[r.i],t(s>=0?e.marks[s].node:e.text,i)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let r=this.view.root.activeElement,i=r==this.dom,s=!i&&!(this.view.state.facet(ya)||this.dom.tabIndex>-1)&&Tg(this.dom,this.view.observer.selectionRange)&&!(r&&this.dom.contains(r));if(!(i||t||s))return;let o=this.forceSelection;this.forceSelection=!1;let a=this.view.state.selection.main,l=this.moveToLine(this.domAtPos(a.anchor)),c=a.empty?l:this.moveToLine(this.domAtPos(a.head));if(yt.gecko&&a.empty&&!this.hasComposition&&YV(l)){let d=document.createTextNode("");this.view.observer.ignore(()=>l.node.insertBefore(d,l.node.childNodes[l.offset]||null)),l=c=new Ri(d,0),o=!0}let u=this.view.observer.selectionRange;(o||!u.focusNode||(!Md(l.node,l.offset,u.anchorNode,u.anchorOffset)||!Md(c.node,c.offset,u.focusNode,u.focusOffset))&&!this.suppressWidgetCursorChange(u,a))&&(this.view.observer.ignore(()=>{yt.android&&yt.chrome&&this.dom.contains(u.focusNode)&&e6(u.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let d=Vd(this.view.root);if(d)if(a.empty){if(yt.gecko){let h=HV(l.node,l.offset);if(h&&h!=3){let m=(h==1?fI:dI)(l.node,l.offset);m&&(l=new Ri(m.node,m.offset))}}d.collapse(l.node,l.offset),a.bidiLevel!=null&&d.caretBidiLevel!==void 0&&(d.caretBidiLevel=a.bidiLevel)}else if(d.extend){d.collapse(l.node,l.offset);try{d.extend(c.node,c.offset)}catch{}}else{let h=document.createRange();a.anchor>a.head&&([l,c]=[c,l]),h.setEnd(c.node,c.offset),h.setStart(l.node,l.offset),d.removeAllRanges(),d.addRange(h)}s&&this.view.root.activeElement==this.dom&&(this.dom.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(l,c)),this.impreciseAnchor=l.precise?null:new Ri(u.anchorNode,u.anchorOffset),this.impreciseHead=c.precise?null:new Ri(u.focusNode,u.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&Md(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,r=Vd(e.root),{anchorNode:i,anchorOffset:s}=e.observer.selectionRange;if(!r||!t.empty||!t.assoc||!r.modify)return;let o=Ur.find(this,t.head);if(!o)return;let a=o.posAtStart;if(t.head==a||t.head==a+o.length)return;let l=this.coordsAt(t.head,-1),c=this.coordsAt(t.head,1);if(!l||!c||l.bottom>c.top)return;let u=this.domAtPos(t.head+t.assoc);r.collapse(u.node,u.offset),r.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let d=e.observer.selectionRange;e.docView.posFromDOM(d.anchorNode,d.anchorOffset)!=t.from&&r.collapse(i,s)}moveToLine(e){let t=this.dom,r;if(e.node!=t)return e;for(let i=e.offset;!r&&i<t.childNodes.length;i++){let s=er.get(t.childNodes[i]);s instanceof Ur&&(r=s.domAtPos(0))}for(let i=e.offset-1;!r&&i>=0;i--){let s=er.get(t.childNodes[i]);s instanceof Ur&&(r=s.domAtPos(s.length))}return r?new Ri(r.node,r.offset,!0):e}nearest(e){for(let t=e;t;){let r=er.get(t);if(r&&r.rootView==this)return r;t=t.parentNode}return null}posFromDOM(e,t){let r=this.nearest(e);if(!r)throw new RangeError("Trying to find position for a DOM position outside of the document");return r.localPosFromDOM(e,t)+r.posAtStart}domAtPos(e){let{i:t,off:r}=this.childCursor().findPos(e,-1);for(;t<this.children.length-1;){let i=this.children[t];if(r<i.length||i instanceof Ur)break;t++,r=0}return this.children[t].domAtPos(r)}coordsAt(e,t){let r=null,i=0;for(let s=this.length,o=this.children.length-1;o>=0;o--){let a=this.children[o],l=s-a.breakAfter,c=l-a.length;if(l<e)break;if(c<=e&&(c<e||a.covers(-1))&&(l>e||a.covers(1))&&(!r||a instanceof Ur&&!(r instanceof Ur&&t>=0)))r=a,i=c;else if(r&&c==e&&l==e&&a instanceof ba&&Math.abs(t)<2){if(a.deco.startSide<0)break;o&&(r=null)}s=c}return r?r.coordsAt(e-i,t):null}coordsForChar(e){let{i:t,off:r}=this.childPos(e,1),i=this.children[t];if(!(i instanceof Ur))return null;for(;i.children.length;){let{i:a,off:l}=i.childPos(r,1);for(;;a++){if(a==i.children.length)return null;if((i=i.children[a]).length)break}r=l}if(!(i instanceof ho))return null;let s=vi(i.text,r);if(s==r)return null;let o=Cc(i.dom,r,s).getClientRects();for(let a=0;a<o.length;a++){let l=o[a];if(a==o.length-1||l.top<l.bottom&&l.left<l.right)return l}return null}measureVisibleLineHeights(e){let t=[],{from:r,to:i}=e,s=this.view.contentDOM.clientWidth,o=s>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,a=-1,l=this.view.textDirection==hr.LTR;for(let c=0,u=0;u<this.children.length;u++){let d=this.children[u],h=c+d.length;if(h>i)break;if(c>=r){let m=d.dom.getBoundingClientRect();if(t.push(m.height),o){let g=d.dom.lastChild,O=g?Zd(g):[];if(O.length){let y=O[O.length-1],b=l?y.right-m.left:m.right-y.left;b>a&&(a=b,this.minWidth=s,this.minWidthFrom=c,this.minWidthTo=h)}}}c=h+d.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return getComputedStyle(this.children[t].dom).direction=="rtl"?hr.RTL:hr.LTR}measureTextSize(){for(let s of this.children)if(s instanceof Ur){let o=s.measureTextSize();if(o)return o}let e=document.createElement("div"),t,r,i;return e.className="cm-line",e.style.width="99999px",e.style.position="absolute",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let s=Zd(e.firstChild)[0];t=e.getBoundingClientRect().height,r=s?s.width/27:7,i=s?s.height:t,e.remove()}),{lineHeight:t,charWidth:r,textHeight:i}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new hI(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let r=0,i=0;;i++){let s=i==t.viewports.length?null:t.viewports[i],o=s?s.from-1:this.length;if(o>r){let a=(t.lineBlockAt(o).bottom-t.lineBlockAt(r).top)/this.view.scaleY;e.push(mt.replace({widget:new C1(a),block:!0,inclusive:!0,isBlockGap:!0}).range(r,o))}if(!s)break;r=s.to+1}return mt.set(e)}updateDeco(){let e=1,t=this.view.state.facet(Wd).map(s=>(this.dynamicDecorationMap[e++]=typeof s=="function")?s(this.view):s),r=!1,i=this.view.state.facet(NI).map((s,o)=>{let a=typeof s=="function";return a&&(r=!0),a?s(this.view):s});for(i.length&&(this.dynamicDecorationMap[e++]=r,t.push(Mn.join(i))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;return this.decorations}scrollIntoView(e){if(e.isSnapshot){let c=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=c.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let c of this.view.state.facet(DI))try{if(c(this.view,e.range,e))return!0}catch(u){is(this.view.state,u,"scroll handler")}let{range:t}=e,r=this.coordsAt(t.head,t.empty?t.assoc:t.head>t.anchor?-1:1),i;if(!r)return;!t.empty&&(i=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(r={left:Math.min(r.left,i.left),top:Math.min(r.top,i.top),right:Math.max(r.right,i.right),bottom:Math.max(r.bottom,i.bottom)});let s=ek(this.view),o={left:r.left-s.left,top:r.top-s.top,right:r.right+s.right,bottom:r.bottom+s.bottom},{offsetWidth:a,offsetHeight:l}=this.view.scrollDOM;CV(this.view.scrollDOM,o,t.head<t.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,a),-a),Math.max(Math.min(e.yMargin,l),-l),this.view.textDirection==hr.LTR)}}function YV(n){return n.node.nodeType==1&&n.node.firstChild&&(n.offset==0||n.node.childNodes[n.offset-1].contentEditable=="false")&&(n.offset==n.node.childNodes.length||n.node.childNodes[n.offset].contentEditable=="false")}function UI(n,e){let t=n.observer.selectionRange;if(!t.focusNode)return null;let r=fI(t.focusNode,t.focusOffset),i=dI(t.focusNode,t.focusOffset),s=r||i;if(i&&r&&i.node!=r.node){let a=er.get(i.node);if(!a||a instanceof ho&&a.text!=i.node.nodeValue)s=i;else if(n.docView.lastCompositionAfterCursor){let l=er.get(r.node);!l||l instanceof ho&&l.text!=r.node.nodeValue||(s=i)}}if(n.docView.lastCompositionAfterCursor=s!=r,!s)return null;let o=e-s.offset;return{from:o,to:o+s.node.nodeValue.length,node:s.node}}function GV(n,e,t){let r=UI(n,t);if(!r)return null;let{node:i,from:s,to:o}=r,a=i.nodeValue;if(/[\n\r]/.test(a)||n.state.doc.sliceString(r.from,r.to)!=a)return null;let l=e.invertedDesc,c=new Ns(l.mapPos(s),l.mapPos(o),s,o),u=[];for(let d=i.parentNode;;d=d.parentNode){let h=er.get(d);if(h instanceof Ta)u.push({node:d,deco:h.mark});else{if(h instanceof Ur||d.nodeName=="DIV"&&d.parentNode==n.contentDOM)return{range:c,text:i,marks:u,line:d};if(d!=n.contentDOM)u.push({node:d,deco:new mh({inclusive:!0,attributes:jV(d),tagName:d.tagName.toLowerCase()})});else return null}}}function HV(n,e){return n.nodeType!=1?0:(e&&n.childNodes[e-1].contentEditable=="false"?1:0)|(e<n.childNodes.length&&n.childNodes[e].contentEditable=="false"?2:0)}let KV=class{constructor(){this.changes=[]}compareRange(e,t){Cg(e,t,this.changes)}comparePoint(e,t){Cg(e,t,this.changes)}boundChange(e){Cg(e,e,this.changes)}};function JV(n,e,t){let r=new KV;return Mn.compare(n,e,t,r),r.changes}function e6(n,e){for(let t=n;t&&t!=e;t=t.assignedSlot||t.parentNode)if(t.nodeType==1&&t.contentEditable=="false")return!0;return!1}function t6(n,e){let t=!1;return e&&n.iterChangedRanges((r,i)=>{r<e.to&&i>e.from&&(t=!0)}),t}function n6(n,e,t=1){let r=n.charCategorizer(e),i=n.doc.lineAt(e),s=e-i.from;if(i.length==0)return _e.cursor(e);s==0?t=1:s==i.length&&(t=-1);let o=s,a=s;t<0?o=vi(i.text,s,!1):a=vi(i.text,s);let l=r(i.text.slice(o,a));for(;o>0;){let c=vi(i.text,o,!1);if(r(i.text.slice(c,o))!=l)break;o=c}for(;a<i.length;){let c=vi(i.text,a);if(r(i.text.slice(a,c))!=l)break;a=c}return _e.range(o+i.from,a+i.from)}function r6(n,e){return e.left>n?e.left-n:Math.max(0,n-e.right)}function i6(n,e){return e.top>n?e.top-n:Math.max(0,n-e.bottom)}function v0(n,e){return n.top<e.bottom-1&&n.bottom>e.top+1}function f_(n,e){return e<n.top?{top:e,left:n.left,right:n.right,bottom:n.bottom}:n}function d_(n,e){return e>n.bottom?{top:n.top,left:n.left,right:n.right,bottom:e}:n}function $1(n,e,t){let r,i,s,o,a=!1,l,c,u,d;for(let g=n.firstChild;g;g=g.nextSibling){let O=Zd(g);for(let y=0;y<O.length;y++){let b=O[y];i&&v0(i,b)&&(b=f_(d_(b,i.bottom),i.top));let S=r6(e,b),P=i6(t,b);if(S==0&&P==0)return g.nodeType==3?h_(g,e,t):$1(g,e,t);if(!r||o>P||o==P&&s>S){r=g,i=b,s=S,o=P;let k=P?t<b.top?-1:1:S?e<b.left?-1:1:0;a=!k||(k>0?y<O.length-1:y>0)}S==0?t>b.bottom&&(!u||u.bottom<b.bottom)?(l=g,u=b):t<b.top&&(!d||d.top>b.top)&&(c=g,d=b):u&&v0(u,b)?u=d_(u,b.bottom):d&&v0(d,b)&&(d=f_(d,b.top))}}if(u&&u.bottom>=t?(r=l,i=u):d&&d.top<=t&&(r=c,i=d),!r)return{node:n,offset:0};let h=Math.max(i.left,Math.min(i.right,e));if(r.nodeType==3)return h_(r,h,t);if(a&&r.contentEditable!="false")return $1(r,h,t);let m=Array.prototype.indexOf.call(n.childNodes,r)+(e>=(i.left+i.right)/2?1:0);return{node:n,offset:m}}function h_(n,e,t){let r=n.nodeValue.length,i=-1,s=1e9,o=0;for(let a=0;a<r;a++){let l=Cc(n,a,a+1).getClientRects();for(let c=0;c<l.length;c++){let u=l[c];if(u.top==u.bottom)continue;o||(o=e-u.left);let d=(u.top>t?u.top-t:t-u.bottom)-1;if(u.left-1<=e&&u.right+1>=e&&d<s){let h=e>=(u.left+u.right)/2,m=h;if((yt.chrome||yt.gecko)&&Cc(n,a).getBoundingClientRect().left==u.right&&(m=!h),d<=0)return{node:n,offset:a+(m?1:0)};i=a+(m?1:0),s=d}}}return{node:n,offset:i>-1?i:o>0?n.nodeValue.length:0}}function BI(n,e,t,r=-1){var i,s;let o=n.contentDOM.getBoundingClientRect(),a=o.top+n.viewState.paddingTop,l,{docHeight:c}=n.viewState,{x:u,y:d}=e,h=d-a;if(h<0)return 0;if(h>c)return n.state.doc.length;for(let k=n.viewState.heightOracle.textHeight/2,x=!1;l=n.elementAtHeight(h),l.type!=Li.Text;)for(;h=r>0?l.bottom+k:l.top-k,!(h>=0&&h<=c);){if(x)return t?null:0;x=!0,r=-r}d=a+h;let m=l.from;if(m<n.viewport.from)return n.viewport.from==0?0:t?null:p_(n,o,l,u,d);if(m>n.viewport.to)return n.viewport.to==n.state.doc.length?n.state.doc.length:t?null:p_(n,o,l,u,d);let g=n.dom.ownerDocument,O=n.root.elementFromPoint?n.root:g,y=O.elementFromPoint(u,d);y&&!n.contentDOM.contains(y)&&(y=null),y||(u=Math.max(o.left+1,Math.min(o.right-1,u)),y=O.elementFromPoint(u,d),y&&!n.contentDOM.contains(y)&&(y=null));let b,S=-1;if(y&&((i=n.docView.nearest(y))===null||i===void 0?void 0:i.isEditable)!=!1){if(g.caretPositionFromPoint){let k=g.caretPositionFromPoint(u,d);k&&({offsetNode:b,offset:S}=k)}else if(g.caretRangeFromPoint){let k=g.caretRangeFromPoint(u,d);k&&({startContainer:b,startOffset:S}=k,(!n.contentDOM.contains(b)||yt.safari&&s6(b,S,u)||yt.chrome&&o6(b,S,u))&&(b=void 0))}b&&(S=Math.min(zo(b),S))}if(!b||!n.docView.dom.contains(b)){let k=Ur.find(n.docView,m);if(!k)return h>l.top+l.height/2?l.to:l.from;({node:b,offset:S}=$1(k.dom,u,d))}let P=n.docView.nearest(b);if(!P)return null;if(P.isWidget&&((s=P.dom)===null||s===void 0?void 0:s.nodeType)==1){let k=P.dom.getBoundingClientRect();return e.y<k.top||e.y<=k.bottom&&e.x<=(k.left+k.right)/2?P.posAtStart:P.posAtEnd}else return P.localPosFromDOM(b,S)+P.posAtStart}function p_(n,e,t,r,i){let s=Math.round((r-e.left)*n.defaultCharacterWidth);if(n.lineWrapping&&t.height>n.defaultLineHeight*1.5){let a=n.viewState.heightOracle.textHeight,l=Math.floor((i-t.top-(n.defaultLineHeight-a)*.5)/a);s+=l*n.viewState.heightOracle.lineLength}let o=n.state.sliceDoc(t.from,t.to);return t.from+v1(o,s,n.state.tabSize)}function s6(n,e,t){let r;if(n.nodeType!=3||e!=(r=n.nodeValue.length))return!1;for(let i=n.nextSibling;i;i=i.nextSibling)if(i.nodeType!=1||i.nodeName!="BR")return!1;return Cc(n,r-1,r).getBoundingClientRect().left>t}function o6(n,e,t){if(e!=0)return!1;for(let i=n;;){let s=i.parentNode;if(!s||s.nodeType!=1||s.firstChild!=i)return!1;if(s.classList.contains("cm-line"))break;i=s}let r=n.nodeType==1?n.getBoundingClientRect():Cc(n,0,Math.max(n.nodeValue.length,1)).getBoundingClientRect();return t-r.left>5}function M1(n,e){let t=n.lineBlockAt(e);if(Array.isArray(t.type)){for(let r of t.type)if(r.to>e||r.to==e&&(r.to==t.to||r.type==Li.Text))return r}return t}function a6(n,e,t,r){let i=M1(n,e.head),s=!r||i.type!=Li.Text||!(n.lineWrapping||i.widgetLineBreaks)?null:n.coordsAtPos(e.assoc<0&&e.head>i.from?e.head-1:e.head);if(s){let o=n.dom.getBoundingClientRect(),a=n.textDirectionAt(i.from),l=n.posAtCoords({x:t==(a==hr.LTR)?o.right-1:o.left+1,y:(s.top+s.bottom)/2});if(l!=null)return _e.cursor(l,t?-1:1)}return _e.cursor(t?i.to:i.from,t?-1:1)}function m_(n,e,t,r){let i=n.state.doc.lineAt(e.head),s=n.bidiSpans(i),o=n.textDirectionAt(i.from);for(let a=e,l=null;;){let c=WV(i,s,o,a,t),u=TI;if(!c){if(i.number==(t?n.state.doc.lines:1))return a;u=`
|
|
123
|
+
`,i=n.state.doc.line(i.number+(t?1:-1)),s=n.bidiSpans(i),c=n.visualLineSide(i,!t)}if(l){if(!l(u))return a}else{if(!r)return c;l=r(u)}a=c}}function l6(n,e,t){let r=n.state.charCategorizer(e),i=r(t);return s=>{let o=r(s);return i==br.Space&&(i=o),i==o}}function c6(n,e,t,r){let i=e.head,s=t?1:-1;if(i==(t?n.state.doc.length:0))return _e.cursor(i,e.assoc);let o=e.goalColumn,a,l=n.contentDOM.getBoundingClientRect(),c=n.coordsAtPos(i,e.assoc||-1),u=n.documentTop;if(c)o==null&&(o=c.left-l.left),a=s<0?c.top:c.bottom;else{let m=n.viewState.lineBlockAt(i);o==null&&(o=Math.min(l.right-l.left,n.defaultCharacterWidth*(i-m.from))),a=(s<0?m.top:m.bottom)+u}let d=l.left+o,h=r??n.viewState.heightOracle.textHeight>>1;for(let m=0;;m+=10){let g=a+(h+m)*s,O=BI(n,{x:d,y:g},!1,s);if(g<l.top||g>l.bottom||(s<0?O<i:O>i)){let y=n.docView.coordsForChar(O),b=!y||g<y.top?-1:1;return _e.cursor(O,b,void 0,o)}}}function _g(n,e,t){for(;;){let r=0;for(let i of n)i.between(e-1,e+1,(s,o,a)=>{if(e>s&&e<o){let l=r||t||(e-s<o-e?-1:1);e=l<0?s:o,r=l}});if(!r)return e}}function y0(n,e,t){let r=_g(n.state.facet(Jw).map(i=>i(n)),t.from,e.head>t.from?-1:1);return r==t.from?t:_e.cursor(r,r<t.from?1:-1)}const Sd="";class u6{constructor(e,t){this.points=e,this.text="",this.lineSeparator=t.facet(Cn.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=Sd}readRange(e,t){if(!e)return this;let r=e.parentNode;for(let i=e;;){this.findPointBefore(r,i);let s=this.text.length;this.readNode(i);let o=i.nextSibling;if(o==t)break;let a=er.get(i),l=er.get(o);(a&&l?a.breakAfter:(a?a.breakAfter:rO(i))||rO(o)&&(i.nodeName!="BR"||i.cmIgnore)&&this.text.length>s)&&this.lineBreak(),i=o}return this.findPointBefore(r,t),this}readTextNode(e){let t=e.nodeValue;for(let r of this.points)r.node==e&&(r.pos=this.text.length+Math.min(r.offset,t.length));for(let r=0,i=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,o=1,a;if(this.lineSeparator?(s=t.indexOf(this.lineSeparator,r),o=this.lineSeparator.length):(a=i.exec(t))&&(s=a.index,o=a[0].length),this.append(t.slice(r,s<0?t.length:s)),s<0)break;if(this.lineBreak(),o>1)for(let l of this.points)l.node==e&&l.pos>this.text.length&&(l.pos-=o-1);r=s+o}}readNode(e){if(e.cmIgnore)return;let t=er.get(e),r=t&&t.overrideDOMText;if(r!=null){this.findPointInside(e,r.length);for(let i=r.iter();!i.next().done;)i.lineBreak?this.lineBreak():this.append(i.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let r of this.points)r.node==e&&e.childNodes[r.offset]==t&&(r.pos=this.text.length)}findPointInside(e,t){for(let r of this.points)(e.nodeType==3?r.node==e:e.contains(r.node))&&(r.pos=this.text.length+(f6(e,r.node,r.offset)?t:0))}}function f6(n,e,t){for(;;){if(!e||t<zo(e))return!1;if(e==n)return!0;t=Tc(e)+1,e=e.parentNode}}class g_{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class d6{constructor(e,t,r,i){this.typeOver=i,this.bounds=null,this.text="",this.domChanged=t>-1;let{impreciseHead:s,impreciseAnchor:o}=e.docView;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,r,0))){let a=s||o?[]:m6(e),l=new u6(a,e.state);l.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=l.text,this.newSel=g6(a,this.bounds.from)}else{let a=e.observer.selectionRange,l=s&&s.node==a.focusNode&&s.offset==a.focusOffset||!S1(e.contentDOM,a.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(a.focusNode,a.focusOffset),c=o&&o.node==a.anchorNode&&o.offset==a.anchorOffset||!S1(e.contentDOM,a.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(a.anchorNode,a.anchorOffset),u=e.viewport;if((yt.ios||yt.chrome)&&e.state.selection.main.empty&&l!=c&&(u.from>0||u.to<e.state.doc.length)){let d=Math.min(l,c),h=Math.max(l,c),m=u.from-d,g=u.to-h;(m==0||m==1||d==0)&&(g==0||g==-1||h==e.state.doc.length)&&(l=0,c=e.state.doc.length)}this.newSel=_e.single(c,l)}}}function FI(n,e){let t,{newSel:r}=e,i=n.state.selection.main,s=n.inputState.lastKeyTime>Date.now()-100?n.inputState.lastKeyCode:-1;if(e.bounds){let{from:o,to:a}=e.bounds,l=i.from,c=null;(s===8||yt.android&&e.text.length<a-o)&&(l=i.to,c="end");let u=p6(n.state.doc.sliceString(o,a,Sd),e.text,l-o,c);u&&(yt.chrome&&s==13&&u.toB==u.from+2&&e.text.slice(u.from,u.toB)==Sd+Sd&&u.toB--,t={from:o+u.from,to:o+u.toA,insert:En.of(e.text.slice(u.from,u.toB).split(Sd))})}else r&&(!n.hasFocus&&n.state.facet(ya)||r.main.eq(i))&&(r=null);if(!t&&!r)return!1;if(!t&&e.typeOver&&!i.empty&&r&&r.main.empty?t={from:i.from,to:i.to,insert:n.state.doc.slice(i.from,i.to)}:(yt.mac||yt.android)&&t&&t.from==t.to&&t.from==i.head-1&&/^\. ?$/.test(t.insert.toString())&&n.contentDOM.getAttribute("autocorrect")=="off"?(r&&t.insert.length==2&&(r=_e.single(r.main.anchor-1,r.main.head-1)),t={from:t.from,to:t.to,insert:En.of([t.insert.toString().replace("."," ")])}):t&&t.from>=i.from&&t.to<=i.to&&(t.from!=i.from||t.to!=i.to)&&i.to-i.from-(t.to-t.from)<=4?t={from:i.from,to:i.to,insert:n.state.doc.slice(i.from,t.from).append(t.insert).append(n.state.doc.slice(t.to,i.to))}:yt.chrome&&t&&t.from==t.to&&t.from==i.head&&t.insert.toString()==`
|
|
124
|
+
`&&n.lineWrapping&&(r&&(r=_e.single(r.main.anchor-1,r.main.head-1)),t={from:i.from,to:i.to,insert:En.of([" "])}),t)return tk(n,t,r,s);if(r&&!r.main.eq(i)){let o=!1,a="select";return n.inputState.lastSelectionTime>Date.now()-50&&(n.inputState.lastSelectionOrigin=="select"&&(o=!0),a=n.inputState.lastSelectionOrigin),n.dispatch({selection:r,scrollIntoView:o,userEvent:a}),!0}else return!1}function tk(n,e,t,r=-1){if(yt.ios&&n.inputState.flushIOSKey(e))return!0;let i=n.state.selection.main;if(yt.android&&(e.to==i.to&&(e.from==i.from||e.from==i.from-1&&n.state.sliceDoc(e.from,i.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&Iu(n.contentDOM,"Enter",13)||(e.from==i.from-1&&e.to==i.to&&e.insert.length==0||r==8&&e.insert.length<e.to-e.from&&e.to>i.head)&&Iu(n.contentDOM,"Backspace",8)||e.from==i.from&&e.to==i.to+1&&e.insert.length==0&&Iu(n.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();n.inputState.composing>=0&&n.inputState.composing++;let o,a=()=>o||(o=h6(n,e,t));return n.state.facet(AI).some(l=>l(n,e.from,e.to,s,a))||n.dispatch(a()),!0}function h6(n,e,t){let r,i=n.state,s=i.selection.main;if(e.from>=s.from&&e.to<=s.to&&e.to-e.from>=(s.to-s.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&n.inputState.composing<0){let a=s.from<e.from?i.sliceDoc(s.from,e.from):"",l=s.to>e.to?i.sliceDoc(e.to,s.to):"";r=i.replaceSelection(n.state.toText(a+e.insert.sliceString(0,void 0,n.state.lineBreak)+l))}else{let a=i.changes(e),l=t&&t.main.to<=a.newLength?t.main:void 0;if(i.selection.ranges.length>1&&n.inputState.composing>=0&&e.to<=s.to&&e.to>=s.to-10){let c=n.state.sliceDoc(e.from,e.to),u,d=t&&UI(n,t.main.head);if(d){let g=e.insert.length-(e.to-e.from);u={from:d.from,to:d.to-g}}else u=n.state.doc.lineAt(s.head);let h=s.to-e.to,m=s.to-s.from;r=i.changeByRange(g=>{if(g.from==s.from&&g.to==s.to)return{changes:a,range:l||g.map(a)};let O=g.to-h,y=O-c.length;if(g.to-g.from!=m||n.state.sliceDoc(y,O)!=c||g.to>=u.from&&g.from<=u.to)return{range:g};let b=i.changes({from:y,to:O,insert:e.insert}),S=g.to-s.to;return{changes:b,range:l?_e.range(Math.max(0,l.anchor+S),Math.max(0,l.head+S)):g.map(b)}})}else r={changes:a,selection:l&&i.selection.replaceRange(l)}}let o="input.type";return(n.composing||n.inputState.compositionPendingChange&&n.inputState.compositionEndedAt>Date.now()-50)&&(n.inputState.compositionPendingChange=!1,o+=".compose",n.inputState.compositionFirstChange&&(o+=".start",n.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:o,scrollIntoView:!0})}function p6(n,e,t,r){let i=Math.min(n.length,e.length),s=0;for(;s<i&&n.charCodeAt(s)==e.charCodeAt(s);)s++;if(s==i&&n.length==e.length)return null;let o=n.length,a=e.length;for(;o>0&&a>0&&n.charCodeAt(o-1)==e.charCodeAt(a-1);)o--,a--;if(r=="end"){let l=Math.max(0,s-Math.min(o,a));t-=o+l-s}if(o<s&&n.length<e.length){let l=t<=s&&t>=o?s-t:0;s-=l,a=s+(a-o),o=s}else if(a<s){let l=t<=s&&t>=a?s-t:0;s-=l,o=s+(o-a),a=s}return{from:s,toA:o,toB:a}}function m6(n){let e=[];if(n.root.activeElement!=n.contentDOM)return e;let{anchorNode:t,anchorOffset:r,focusNode:i,focusOffset:s}=n.observer.selectionRange;return t&&(e.push(new g_(t,r)),(i!=t||s!=r)&&e.push(new g_(i,s))),e}function g6(n,e){if(n.length==0)return null;let t=n[0].pos,r=n.length==2?n[1].pos:t;return t>-1&&r>-1?_e.single(t+e,r+e):null}class O6{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,yt.safari&&e.contentDOM.addEventListener("input",()=>null),yt.gecko&&M6(e.contentDOM.ownerDocument)}handleEvent(e){!x6(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,t){let r=this.handlers[e];if(r){for(let i of r.observers)i(this.view,t);for(let i of r.handlers){if(t.defaultPrevented)break;if(i(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=v6(e),r=this.handlers,i=this.view.contentDOM;for(let s in t)if(s!="scroll"){let o=!t[s].handlers.length,a=r[s];a&&o!=!a.handlers.length&&(i.removeEventListener(s,this.handleEvent),a=null),a||i.addEventListener(s,this.handleEvent,{passive:o})}for(let s in r)s!="scroll"&&!t[s]&&i.removeEventListener(s,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&ZI.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),yt.android&&yt.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return yt.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((t=VI.find(r=>r.keyCode==e.keyCode))&&!e.ctrlKey||y6.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let t=this.pendingIOSKey;return!t||t.key=="Enter"&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,Iu(this.view.contentDOM,t.key,t.keyCode,t instanceof KeyboardEvent?t:void 0))}ignoreDuringComposition(e){return/^key/.test(e.type)?this.composing>0?!0:yt.safari&&!yt.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function O_(n,e){return(t,r)=>{try{return e.call(n,r,t)}catch(i){is(t.state,i)}}}function v6(n){let e=Object.create(null);function t(r){return e[r]||(e[r]={observers:[],handlers:[]})}for(let r of n){let i=r.spec;if(i&&i.domEventHandlers)for(let s in i.domEventHandlers){let o=i.domEventHandlers[s];o&&t(s).handlers.push(O_(r.value,o))}if(i&&i.domEventObservers)for(let s in i.domEventObservers){let o=i.domEventObservers[s];o&&t(s).observers.push(O_(r.value,o))}}for(let r in po)t(r).handlers.push(po[r]);for(let r in qs)t(r).observers.push(qs[r]);return e}const VI=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],y6="dthko",ZI=[16,17,18,20,91,92,224,225],Dp=6;function Ip(n){return Math.max(0,n)*.7+8}function b6(n,e){return Math.max(Math.abs(n.clientX-e.clientX),Math.abs(n.clientY-e.clientY))}class S6{constructor(e,t,r,i){this.view=e,this.startEvent=t,this.style=r,this.mustSelect=i,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=_V(e.contentDOM),this.atoms=e.state.facet(Jw).map(o=>o(e));let s=e.contentDOM.ownerDocument;s.addEventListener("mousemove",this.move=this.move.bind(this)),s.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(Cn.allowMultipleSelections)&&w6(e,t),this.dragging=P6(e,t)&&zI(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&b6(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,r=0,i=0,s=0,o=this.view.win.innerWidth,a=this.view.win.innerHeight;this.scrollParents.x&&({left:i,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:a}=this.scrollParents.y.getBoundingClientRect());let l=ek(this.view);e.clientX-l.left<=i+Dp?t=-Ip(i-e.clientX):e.clientX+l.right>=o-Dp&&(t=Ip(e.clientX-o)),e.clientY-l.top<=s+Dp?r=-Ip(s-e.clientY):e.clientY+l.bottom>=a-Dp&&(r=Ip(e.clientY-a)),this.setScrollSpeed(t,r)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(e){let t=null;for(let r=0;r<e.ranges.length;r++){let i=e.ranges[r],s=null;if(i.empty){let o=_g(this.atoms,i.from,0);o!=i.from&&(s=_e.cursor(o,-1))}else{let o=_g(this.atoms,i.from,-1),a=_g(this.atoms,i.to,1);(o!=i.from||a!=i.to)&&(s=_e.range(i.from==i.anchor?o:a,i.from==i.head?o:a))}s&&(t||(t=e.ranges.slice()),t[r]=s)}return t?_e.create(t,e.mainIndex):e}select(e){let{view:t}=this,r=this.skipAtoms(this.style.get(e,this.extend,this.multiple));(this.mustSelect||!r.eq(t.state.selection,this.dragging===!1))&&this.view.dispatch({selection:r,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(t=>t.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function w6(n,e){let t=n.state.facet(CI);return t.length?t[0](e):yt.mac?e.metaKey:e.ctrlKey}function k6(n,e){let t=n.state.facet(_I);return t.length?t[0](e):yt.mac?!e.altKey:!e.ctrlKey}function P6(n,e){let{main:t}=n.state.selection;if(t.empty)return!1;let r=Vd(n.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let s=0;s<i.length;s++){let o=i[s];if(o.left<=e.clientX&&o.right>=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function x6(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,r;t!=n.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(r=er.get(t))&&r.ignoreEvent(e))return!1;return!0}const po=Object.create(null),qs=Object.create(null),WI=yt.ie&&yt.ie_version<15||yt.ios&&yt.webkit_version<604;function T6(n){let e=n.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{n.focus(),t.remove(),XI(n,t.value)},50)}function GO(n,e,t){for(let r of n.facet(e))t=r(t,n);return t}function XI(n,e){e=GO(n.state,Gw,e);let{state:t}=n,r,i=1,s=t.toText(e),o=s.lines==t.selection.ranges.length;if(Q1!=null&&t.selection.ranges.every(l=>l.empty)&&Q1==s.toString()){let l=-1;r=t.changeByRange(c=>{let u=t.doc.lineAt(c.from);if(u.from==l)return{range:c};l=u.from;let d=t.toText((o?s.line(i++).text:e)+t.lineBreak);return{changes:{from:u.from,insert:d},range:_e.cursor(c.from+d.length)}})}else o?r=t.changeByRange(l=>{let c=s.line(i++);return{changes:{from:l.from,to:l.to,insert:c.text},range:_e.cursor(l.from+c.length)}}):r=t.replaceSelection(s);n.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}qs.scroll=n=>{n.inputState.lastScrollTop=n.scrollDOM.scrollTop,n.inputState.lastScrollLeft=n.scrollDOM.scrollLeft};po.keydown=(n,e)=>(n.inputState.setSelectionOrigin("select"),e.keyCode==27&&n.inputState.tabFocusMode!=0&&(n.inputState.tabFocusMode=Date.now()+2e3),!1);qs.touchstart=(n,e)=>{n.inputState.lastTouchTime=Date.now(),n.inputState.setSelectionOrigin("select.pointer")};qs.touchmove=n=>{n.inputState.setSelectionOrigin("select.pointer")};po.mousedown=(n,e)=>{if(n.observer.flush(),n.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let r of n.state.facet(EI))if(t=r(n,e),t)break;if(!t&&e.button==0&&(t=E6(n,e)),t){let r=!n.hasFocus;n.inputState.startMouseSelection(new S6(n,e,t,r)),r&&n.observer.ignore(()=>{lI(n.contentDOM);let s=n.root.activeElement;s&&!s.contains(n.contentDOM)&&s.blur()});let i=n.inputState.mouseSelection;if(i)return i.start(e),i.dragging===!1}return!1};function v_(n,e,t,r){if(r==1)return _e.cursor(e,t);if(r==2)return n6(n.state,e,t);{let i=Ur.find(n.docView,e),s=n.state.doc.lineAt(i?i.posAtEnd:e),o=i?i.posAtStart:s.from,a=i?i.posAtEnd:s.to;return a<n.state.doc.length&&a==s.to&&a++,_e.range(o,a)}}let y_=(n,e,t)=>e>=t.top&&e<=t.bottom&&n>=t.left&&n<=t.right;function C6(n,e,t,r){let i=Ur.find(n.docView,e);if(!i)return 1;let s=e-i.posAtStart;if(s==0)return 1;if(s==i.length)return-1;let o=i.coordsAt(s,-1);if(o&&y_(t,r,o))return-1;let a=i.coordsAt(s,1);return a&&y_(t,r,a)?1:o&&o.bottom>=r?-1:1}function b_(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:t,bias:C6(n,t,e.clientX,e.clientY)}}const _6=yt.ie&&yt.ie_version<=11;let S_=null,w_=0,k_=0;function zI(n){if(!_6)return n.detail;let e=S_,t=k_;return S_=n,k_=Date.now(),w_=!e||t>Date.now()-400&&Math.abs(e.clientX-n.clientX)<2&&Math.abs(e.clientY-n.clientY)<2?(w_+1)%3:1}function E6(n,e){let t=b_(n,e),r=zI(e),i=n.state.selection;return{update(s){s.docChanged&&(t.pos=s.changes.mapPos(t.pos),i=i.map(s.changes))},get(s,o,a){let l=b_(n,s),c,u=v_(n,l.pos,l.bias,r);if(t.pos!=l.pos&&!o){let d=v_(n,t.pos,t.bias,r),h=Math.min(d.from,u.from),m=Math.max(d.to,u.to);u=h<u.from?_e.range(h,m):_e.range(m,h)}return o?i.replaceRange(i.main.extend(u.from,u.to)):a&&r==1&&i.ranges.length>1&&(c=R6(i,l.pos))?c:a?i.addRange(u):_e.create([u])}}}function R6(n,e){for(let t=0;t<n.ranges.length;t++){let{from:r,to:i}=n.ranges[t];if(r<=e&&i>=e)return _e.create(n.ranges.slice(0,t).concat(n.ranges.slice(t+1)),n.mainIndex==t?0:n.mainIndex-(n.mainIndex>t?1:0))}return null}po.dragstart=(n,e)=>{let{selection:{main:t}}=n.state;if(e.target.draggable){let i=n.docView.nearest(e.target);if(i&&i.isWidget){let s=i.posAtStart,o=s+i.length;(s>=t.to||o<=t.from)&&(t=_e.range(s,o))}}let{inputState:r}=n;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=t,e.dataTransfer&&(e.dataTransfer.setData("Text",GO(n.state,Hw,n.state.sliceDoc(t.from,t.to))),e.dataTransfer.effectAllowed="copyMove"),!1};po.dragend=n=>(n.inputState.draggedContent=null,!1);function P_(n,e,t,r){if(t=GO(n.state,Gw,t),!t)return;let i=n.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:s}=n.inputState,o=r&&s&&k6(n,e)?{from:s.from,to:s.to}:null,a={from:i,insert:t},l=n.state.changes(o?[o,a]:a);n.focus(),n.dispatch({changes:l,selection:{anchor:l.mapPos(i,-1),head:l.mapPos(i,1)},userEvent:o?"move.drop":"input.drop"}),n.inputState.draggedContent=null}po.drop=(n,e)=>{if(!e.dataTransfer)return!1;if(n.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let r=Array(t.length),i=0,s=()=>{++i==t.length&&P_(n,e,r.filter(o=>o!=null).join(n.state.lineBreak),!1)};for(let o=0;o<t.length;o++){let a=new FileReader;a.onerror=s,a.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(a.result)||(r[o]=a.result),s()},a.readAsText(t[o])}return!0}else{let r=e.dataTransfer.getData("Text");if(r)return P_(n,e,r,!0),!0}return!1};po.paste=(n,e)=>{if(n.state.readOnly)return!0;n.observer.flush();let t=WI?null:e.clipboardData;return t?(XI(n,t.getData("text/plain")||t.getData("text/uri-list")),!0):(T6(n),!1)};function A6(n,e){let t=n.dom.parentNode;if(!t)return;let r=t.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=e,r.focus(),r.selectionEnd=e.length,r.selectionStart=0,setTimeout(()=>{r.remove(),n.focus()},50)}function $6(n){let e=[],t=[],r=!1;for(let i of n.selection.ranges)i.empty||(e.push(n.sliceDoc(i.from,i.to)),t.push(i));if(!e.length){let i=-1;for(let{from:s}of n.selection.ranges){let o=n.doc.lineAt(s);o.number>i&&(e.push(o.text),t.push({from:o.from,to:Math.min(n.doc.length,o.to+1)})),i=o.number}r=!0}return{text:GO(n,Hw,e.join(n.lineBreak)),ranges:t,linewise:r}}let Q1=null;po.copy=po.cut=(n,e)=>{let{text:t,ranges:r,linewise:i}=$6(n.state);if(!t&&!i)return!1;Q1=i?t:null,e.type=="cut"&&!n.state.readOnly&&n.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let s=WI?null:e.clipboardData;return s?(s.clearData(),s.setData("text/plain",t),!0):(A6(n,t),!1)};const YI=Ho.define();function GI(n,e){let t=[];for(let r of n.facet($I)){let i=r(n,e);i&&t.push(i)}return t?n.update({effects:t,annotations:YI.of(!0)}):null}function HI(n){setTimeout(()=>{let e=n.hasFocus;if(e!=n.inputState.notifiedFocused){let t=GI(n.state,e);t?n.dispatch(t):n.update([])}},10)}qs.focus=n=>{n.inputState.lastFocusTime=Date.now(),!n.scrollDOM.scrollTop&&(n.inputState.lastScrollTop||n.inputState.lastScrollLeft)&&(n.scrollDOM.scrollTop=n.inputState.lastScrollTop,n.scrollDOM.scrollLeft=n.inputState.lastScrollLeft),HI(n)};qs.blur=n=>{n.observer.clearSelectionRange(),HI(n)};qs.compositionstart=qs.compositionupdate=n=>{n.observer.editContext||(n.inputState.compositionFirstChange==null&&(n.inputState.compositionFirstChange=!0),n.inputState.composing<0&&(n.inputState.composing=0))};qs.compositionend=n=>{n.observer.editContext||(n.inputState.composing=-1,n.inputState.compositionEndedAt=Date.now(),n.inputState.compositionPendingKey=!0,n.inputState.compositionPendingChange=n.observer.pendingRecords().length>0,n.inputState.compositionFirstChange=null,yt.chrome&&yt.android?n.observer.flushSoon():n.inputState.compositionPendingChange?Promise.resolve().then(()=>n.observer.flush()):setTimeout(()=>{n.inputState.composing<0&&n.docView.hasComposition&&n.update([])},50))};qs.contextmenu=n=>{n.inputState.lastContextMenu=Date.now()};po.beforeinput=(n,e)=>{var t,r;if(e.inputType=="insertReplacementText"&&n.observer.editContext){let s=(t=e.dataTransfer)===null||t===void 0?void 0:t.getData("text/plain"),o=e.getTargetRanges();if(s&&o.length){let a=o[0],l=n.posAtDOM(a.startContainer,a.startOffset),c=n.posAtDOM(a.endContainer,a.endOffset);return tk(n,{from:l,to:c,insert:n.state.toText(s)},null),!0}}let i;if(yt.chrome&&yt.android&&(i=VI.find(s=>s.inputType==e.inputType))&&(n.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let s=((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>s+10&&n.hasFocus&&(n.contentDOM.blur(),n.focus())},100)}return yt.ios&&e.inputType=="deleteContentForward"&&n.observer.flushSoon(),yt.safari&&e.inputType=="insertText"&&n.inputState.composing>=0&&setTimeout(()=>qs.compositionend(n,e),20),!1};const x_=new Set;function M6(n){x_.has(n)||(x_.add(n),n.addEventListener("copy",()=>{}),n.addEventListener("cut",()=>{}))}const T_=["pre-wrap","normal","pre-line","break-spaces"];let Hu=!1;function C_(){Hu=!1}class Q6{constructor(e){this.lineWrapping=e,this.doc=En.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let r=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(r+=Math.max(0,Math.ceil((t-e-r*this.lineLength*.5)/this.lineLength))),this.lineHeight*r}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return T_.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let r=0;r<e.length;r++){let i=e[r];i<0?r++:this.heightSamples[Math.floor(i*10)]||(t=!0,this.heightSamples[Math.floor(i*10)]=!0)}return t}refresh(e,t,r,i,s,o){let a=T_.indexOf(e)>-1,l=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=a;if(this.lineWrapping=a,this.lineHeight=t,this.charWidth=r,this.textHeight=i,this.lineLength=s,l){this.heightSamples={};for(let c=0;c<o.length;c++){let u=o[c];u<0?c++:this.heightSamples[Math.floor(u*10)]=!0}}return l}}class D6{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}}class Bo{constructor(e,t,r,i,s){this.from=e,this.length=t,this.top=r,this.height=i,this._content=s}get type(){return typeof this._content=="number"?Li.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof Cl?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(e){let t=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new Bo(this.from,this.length+e.length,this.top,this.height+e.height,t)}}var fr=function(n){return n[n.ByPos=0]="ByPos",n[n.ByHeight=1]="ByHeight",n[n.ByPosNoHeight=2]="ByPosNoHeight",n}(fr||(fr={}));const Eg=.001;class qi{constructor(e,t,r=2){this.length=e,this.height=t,this.flags=r}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>Eg&&(Hu=!0),this.height=e)}replace(e,t,r){return qi.of(r)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,r,i){let s=this,o=r.doc;for(let a=i.length-1;a>=0;a--){let{fromA:l,toA:c,fromB:u,toB:d}=i[a],h=s.lineAt(l,fr.ByPosNoHeight,r.setDoc(t),0,0),m=h.to>=c?h:s.lineAt(c,fr.ByPosNoHeight,r,0,0);for(d+=m.to-c,c=m.to;a>0&&h.from<=i[a-1].toA;)l=i[a-1].fromA,u=i[a-1].fromB,a--,l<h.from&&(h=s.lineAt(l,fr.ByPosNoHeight,r,0,0));u+=h.from-l,l=h.from;let g=nk.build(r.setDoc(o),e,u,d);s=oO(s,s.replace(l,c,g))}return s.updateHeight(r,0)}static empty(){return new ms(0,0)}static of(e){if(e.length==1)return e[0];let t=0,r=e.length,i=0,s=0;for(;;)if(t==r)if(i>s*2){let a=e[t-1];a.break?e.splice(--t,1,a.left,null,a.right):e.splice(--t,1,a.left,a.right),r+=1+a.break,i-=a.size}else if(s>i*2){let a=e[r];a.break?e.splice(r,1,a.left,null,a.right):e.splice(r,1,a.left,a.right),r+=2+a.break,s-=a.size}else break;else if(i<s){let a=e[t++];a&&(i+=a.size)}else{let a=e[--r];a&&(s+=a.size)}let o=0;return e[t-1]==null?(o=1,t--):e[t]==null&&(o=1,r++),new I6(qi.of(e.slice(0,t)),o,qi.of(e.slice(r)))}}function oO(n,e){return n==e?n:(n.constructor!=e.constructor&&(Hu=!0),e)}qi.prototype.size=1;class KI extends qi{constructor(e,t,r){super(e,t),this.deco=r}blockAt(e,t,r,i){return new Bo(i,this.length,r,this.height,this.deco||0)}lineAt(e,t,r,i,s){return this.blockAt(0,r,i,s)}forEachLine(e,t,r,i,s,o){e<=s+this.length&&t>=s&&o(this.blockAt(0,r,i,s))}updateHeight(e,t=0,r=!1,i){return i&&i.from<=t&&i.more&&this.setHeight(i.heights[i.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class ms extends KI{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,r,i){return new Bo(i,this.length,r,this.height,this.breaks)}replace(e,t,r){let i=r[0];return r.length==1&&(i instanceof ms||i instanceof mi&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof mi?i=new ms(i.length,this.height):i.height=this.height,this.outdated||(i.outdated=!1),i):qi.of(r)}updateHeight(e,t=0,r=!1,i){return i&&i.from<=t&&i.more?this.setHeight(i.heights[i.index++]):(r||this.outdated)&&this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class mi extends qi{constructor(e){super(e,0)}heightMetrics(e,t){let r=e.doc.lineAt(t).number,i=e.doc.lineAt(t+this.length).number,s=i-r+1,o,a=0;if(e.lineWrapping){let l=Math.min(this.height,e.lineHeight*s);o=l/s,this.length>s+1&&(a=(this.height-l)/(this.length-s-1))}else o=this.height/s;return{firstLine:r,lastLine:i,perLine:o,perChar:a}}blockAt(e,t,r,i){let{firstLine:s,lastLine:o,perLine:a,perChar:l}=this.heightMetrics(t,i);if(t.lineWrapping){let c=i+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-r)/this.height))*this.length)),u=t.doc.lineAt(c),d=a+u.length*l,h=Math.max(r,e-d/2);return new Bo(u.from,u.length,h,d,0)}else{let c=Math.max(0,Math.min(o-s,Math.floor((e-r)/a))),{from:u,length:d}=t.doc.line(s+c);return new Bo(u,d,r+a*c,a,0)}}lineAt(e,t,r,i,s){if(t==fr.ByHeight)return this.blockAt(e,r,i,s);if(t==fr.ByPosNoHeight){let{from:m,to:g}=r.doc.lineAt(e);return new Bo(m,g-m,0,0,0)}let{firstLine:o,perLine:a,perChar:l}=this.heightMetrics(r,s),c=r.doc.lineAt(e),u=a+c.length*l,d=c.number-o,h=i+a*d+l*(c.from-s-d);return new Bo(c.from,c.length,Math.max(i,Math.min(h,i+this.height-u)),u,0)}forEachLine(e,t,r,i,s,o){e=Math.max(e,s),t=Math.min(t,s+this.length);let{firstLine:a,perLine:l,perChar:c}=this.heightMetrics(r,s);for(let u=e,d=i;u<=t;){let h=r.doc.lineAt(u);if(u==e){let g=h.number-a;d+=l*g+c*(e-s-g)}let m=l+c*h.length;o(new Bo(h.from,h.length,d,m,0)),d+=m,u=h.to+1}}replace(e,t,r){let i=this.length-t;if(i>0){let s=r[r.length-1];s instanceof mi?r[r.length-1]=new mi(s.length+i):r.push(null,new mi(i-1))}if(e>0){let s=r[0];s instanceof mi?r[0]=new mi(e+s.length):r.unshift(new mi(e-1),null)}return qi.of(r)}decomposeLeft(e,t){t.push(new mi(e-1),null)}decomposeRight(e,t){t.push(null,new mi(this.length-e-1))}updateHeight(e,t=0,r=!1,i){let s=t+this.length;if(i&&i.from<=t+this.length&&i.more){let o=[],a=Math.max(t,i.from),l=-1;for(i.from>t&&o.push(new mi(i.from-t-1).updateHeight(e,t));a<=s&&i.more;){let u=e.doc.lineAt(a).length;o.length&&o.push(null);let d=i.heights[i.index++];l==-1?l=d:Math.abs(d-l)>=Eg&&(l=-2);let h=new ms(u,d);h.outdated=!1,o.push(h),a+=u+1}a<=s&&o.push(null,new mi(s-a).updateHeight(e,a));let c=qi.of(o);return(l<0||Math.abs(c.height-this.height)>=Eg||Math.abs(l-this.heightMetrics(e,t).perLine)>=Eg)&&(Hu=!0),oO(this,c)}else(r||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class I6 extends qi{constructor(e,t,r){super(e.length+t+r.length,e.height+r.height,t|(e.outdated||r.outdated?2:0)),this.left=e,this.right=r,this.size=e.size+r.size}get break(){return this.flags&1}blockAt(e,t,r,i){let s=r+this.left.height;return e<s?this.left.blockAt(e,t,r,i):this.right.blockAt(e,t,s,i+this.left.length+this.break)}lineAt(e,t,r,i,s){let o=i+this.left.height,a=s+this.left.length+this.break,l=t==fr.ByHeight?e<o:e<a,c=l?this.left.lineAt(e,t,r,i,s):this.right.lineAt(e,t,r,o,a);if(this.break||(l?c.to<a:c.from>a))return c;let u=t==fr.ByPosNoHeight?fr.ByPosNoHeight:fr.ByPos;return l?c.join(this.right.lineAt(a,u,r,o,a)):this.left.lineAt(a,u,r,i,s).join(c)}forEachLine(e,t,r,i,s,o){let a=i+this.left.height,l=s+this.left.length+this.break;if(this.break)e<l&&this.left.forEachLine(e,t,r,i,s,o),t>=l&&this.right.forEachLine(e,t,r,a,l,o);else{let c=this.lineAt(l,fr.ByPos,r,i,s);e<c.from&&this.left.forEachLine(e,c.from-1,r,i,s,o),c.to>=e&&c.from<=t&&o(c),t>c.to&&this.right.forEachLine(c.to+1,t,r,a,l,o)}}replace(e,t,r){let i=this.left.length+this.break;if(t<i)return this.balanced(this.left.replace(e,t,r),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-i,t-i,r));let s=[];e>0&&this.decomposeLeft(e,s);let o=s.length;for(let a of r)s.push(a);if(e>0&&__(s,o-1),t<this.length){let a=s.length;this.decomposeRight(t,s),__(s,a)}return qi.of(s)}decomposeLeft(e,t){let r=this.left.length;if(e<=r)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&(r++,e>=r&&t.push(null)),e>r&&this.right.decomposeLeft(e-r,t)}decomposeRight(e,t){let r=this.left.length,i=r+this.break;if(e>=i)return this.right.decomposeRight(e-i,t);e<r&&this.left.decomposeRight(e,t),this.break&&e<i&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?qi.of(this.break?[e,null,t]:[e,t]):(this.left=oO(this.left,e),this.right=oO(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,r=!1,i){let{left:s,right:o}=this,a=t+s.length+this.break,l=null;return i&&i.from<=t+s.length&&i.more?l=s=s.updateHeight(e,t,r,i):s.updateHeight(e,t,r),i&&i.from<=a+o.length&&i.more?l=o=o.updateHeight(e,a,r,i):o.updateHeight(e,a,r),l?this.balanced(s,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function __(n,e){let t,r;n[e]==null&&(t=n[e-1])instanceof mi&&(r=n[e+1])instanceof mi&&n.splice(e-1,3,new mi(t.length+1+r.length))}const j6=5;class nk{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let r=Math.min(t,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof ms?i.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new ms(r-this.pos,-1)),this.writtenTo=r,t>r&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,r){if(e<t||r.heightRelevant){let i=r.widget?r.widget.estimatedHeight:0,s=r.widget?r.widget.lineBreaks:0;i<0&&(i=this.oracle.lineHeight);let o=t-e;r.block?this.addBlock(new KI(o,i,r)):(o||s||i>=j6)&&this.addLineDeco(i,s,o)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new ms(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let r=new mi(t-e);return this.oracle.doc.lineAt(e).to==t&&(r.flags|=4),r}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof ms)return e;let t=new ms(0,-1);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,r){let i=this.ensureLine();i.length+=r,i.collapsed+=r,i.widgetHeight=Math.max(i.widgetHeight,e),i.breaks+=t,this.writtenTo=this.pos=this.pos+r}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof ms)&&!this.isCovered?this.nodes.push(new ms(0,-1)):(this.writtenTo<this.pos||t==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let r=e;for(let i of this.nodes)i instanceof ms&&i.updateHeight(this.oracle,r),r+=i?i.length:1;return this.nodes}static build(e,t,r,i){let s=new nk(r,e);return Mn.spans(t,r,i,s,0),s.finish(r)}}function N6(n,e,t){let r=new L6;return Mn.compare(n,e,t,r,0),r.changes}class L6{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,r,i){(e<t||r&&r.heightRelevant||i&&i.heightRelevant)&&Cg(e,t,this.changes,5)}}function q6(n,e){let t=n.getBoundingClientRect(),r=n.ownerDocument,i=r.defaultView||window,s=Math.max(0,t.left),o=Math.min(i.innerWidth,t.right),a=Math.max(0,t.top),l=Math.min(i.innerHeight,t.bottom);for(let c=n.parentNode;c&&c!=r.body;)if(c.nodeType==1){let u=c,d=window.getComputedStyle(u);if((u.scrollHeight>u.clientHeight||u.scrollWidth>u.clientWidth)&&d.overflow!="visible"){let h=u.getBoundingClientRect();s=Math.max(s,h.left),o=Math.min(o,h.right),a=Math.max(a,h.top),l=Math.min(c==n.parentNode?i.innerHeight:l,h.bottom)}c=d.position=="absolute"||d.position=="fixed"?u.offsetParent:u.parentNode}else if(c.nodeType==11)c=c.host;else break;return{left:s-t.left,right:Math.max(s,o)-t.left,top:a-(t.top+e),bottom:Math.max(a,l)-(t.top+e)}}function U6(n){let e=n.getBoundingClientRect(),t=n.ownerDocument.defaultView||window;return e.left<t.innerWidth&&e.right>0&&e.top<t.innerHeight&&e.bottom>0}function B6(n,e){let t=n.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class b0{constructor(e,t,r,i){this.from=e,this.to=t,this.size=r,this.displaySize=i}static same(e,t){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++){let i=e[r],s=t[r];if(i.from!=s.from||i.to!=s.to||i.size!=s.size)return!1}return!0}draw(e,t){return mt.replace({widget:new F6(this.displaySize*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}}class F6 extends Ss{constructor(e,t){super(),this.size=e,this.vertical=t}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class E_{constructor(e){this.state=e,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scrollTop=0,this.scrolledToBottom=!1,this.scaleX=1,this.scaleY=1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=R_,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=hr.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let t=e.facet(Kw).some(r=>typeof r!="function"&&r.class=="cm-lineWrapping");this.heightOracle=new Q6(t),this.stateDeco=e.facet(Wd).filter(r=>typeof r!="function"),this.heightMap=qi.empty().applyChanges(this.stateDeco,En.empty,this.heightOracle.setDoc(e.doc),[new Ns(0,0,0,e.doc.length)]);for(let r=0;r<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());r++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=mt.set(this.lineGaps.map(r=>r.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let r=0;r<=1;r++){let i=r?t.head:t.anchor;if(!e.some(({from:s,to:o})=>i>=s&&i<=o)){let{from:s,to:o}=this.lineBlockAt(i);e.push(new jp(s,o))}}return this.viewports=e.sort((r,i)=>r.from-i.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?R_:new rk(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(wd(e,this.scaler))})}update(e,t=null){this.state=e.state;let r=this.stateDeco;this.stateDeco=this.state.facet(Wd).filter(u=>typeof u!="function");let i=e.changedRanges,s=Ns.extendWithRanges(i,N6(r,this.stateDeco,e?e.changes:Hr.empty(this.state.doc.length))),o=this.heightMap.height,a=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);C_(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=o||Hu)&&(e.flags|=2),a?(this.scrollAnchorPos=e.changes.mapPos(a.from,-1),this.scrollAnchorHeight=a.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let l=s.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<l.from||t.range.head>l.to)||!this.viewportIsAppropriate(l))&&(l=this.getViewport(0,t));let c=l.from!=this.viewport.from||l.to!=this.viewport.to;this.viewport=l,e.flags|=this.updateForViewport(),(c||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(QI)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,r=window.getComputedStyle(t),i=this.heightOracle,s=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?hr.RTL:hr.LTR;let o=this.heightOracle.mustRefreshForWrapping(s),a=t.getBoundingClientRect(),l=o||this.mustMeasureContent||this.contentDOMHeight!=a.height;this.contentDOMHeight=a.height,this.mustMeasureContent=!1;let c=0,u=0;if(a.width&&a.height){let{scaleX:k,scaleY:x}=aI(t,a);(k>.005&&Math.abs(this.scaleX-k)>.005||x>.005&&Math.abs(this.scaleY-x)>.005)&&(this.scaleX=k,this.scaleY=x,c|=16,o=l=!0)}let d=(parseInt(r.paddingTop)||0)*this.scaleY,h=(parseInt(r.paddingBottom)||0)*this.scaleY;(this.paddingTop!=d||this.paddingBottom!=h)&&(this.paddingTop=d,this.paddingBottom=h,c|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(i.lineWrapping&&(l=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=16);let m=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=m&&(this.scrollAnchorHeight=-1,this.scrollTop=m),this.scrolledToBottom=uI(e.scrollDOM);let g=(this.printing?B6:q6)(t,this.paddingTop),O=g.top-this.pixelViewport.top,y=g.bottom-this.pixelViewport.bottom;this.pixelViewport=g;let b=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(b!=this.inView&&(this.inView=b,b&&(l=!0)),!this.inView&&!this.scrollTarget&&!U6(e.dom))return 0;let S=a.width;if((this.contentDOMWidth!=S||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=a.width,this.editorHeight=e.scrollDOM.clientHeight,c|=16),l){let k=e.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(k)&&(o=!0),o||i.lineWrapping&&Math.abs(S-this.contentDOMWidth)>i.charWidth){let{lineHeight:x,charWidth:A,textHeight:M}=e.docView.measureTextSize();o=x>0&&i.refresh(s,x,A,M,S/A,k),o&&(e.docView.minWidth=0,c|=16)}O>0&&y>0?u=Math.max(O,y):O<0&&y<0&&(u=Math.min(O,y)),C_();for(let x of this.viewports){let A=x.from==this.viewport.from?k:e.docView.measureVisibleLineHeights(x);this.heightMap=(o?qi.empty().applyChanges(this.stateDeco,En.empty,this.heightOracle,[new Ns(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(i,0,o,new D6(x.from,A))}Hu&&(c|=2)}let P=!this.viewportIsAppropriate(this.viewport,u)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return P&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(u,this.scrollTarget),c|=this.updateForViewport()),(c&2||P)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),c}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let r=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),i=this.heightMap,s=this.heightOracle,{visibleTop:o,visibleBottom:a}=this,l=new jp(i.lineAt(o-r*1e3,fr.ByHeight,s,0,0).from,i.lineAt(a+(1-r)*1e3,fr.ByHeight,s,0,0).to);if(t){let{head:c}=t.range;if(c<l.from||c>l.to){let u=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),d=i.lineAt(c,fr.ByPos,s,0,0),h;t.y=="center"?h=(d.top+d.bottom)/2-u/2:t.y=="start"||t.y=="nearest"&&c<l.from?h=d.top:h=d.bottom-u,l=new jp(i.lineAt(h-1e3/2,fr.ByHeight,s,0,0).from,i.lineAt(h+u+1e3/2,fr.ByHeight,s,0,0).to)}}return l}mapViewport(e,t){let r=t.mapPos(e.from,-1),i=t.mapPos(e.to,1);return new jp(this.heightMap.lineAt(r,fr.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(i,fr.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},r=0){if(!this.inView)return!0;let{top:i}=this.heightMap.lineAt(e,fr.ByPos,this.heightOracle,0,0),{bottom:s}=this.heightMap.lineAt(t,fr.ByPos,this.heightOracle,0,0),{visibleTop:o,visibleBottom:a}=this;return(e==0||i<=o-Math.max(10,Math.min(-r,250)))&&(t==this.state.doc.length||s>=a+Math.max(10,Math.min(r,250)))&&i>o-2*1e3&&s<a+2*1e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let r=[];for(let i of e)t.touchesRange(i.from,i.to)||r.push(new b0(t.mapPos(i.from),t.mapPos(i.to),i.size,i.displaySize));return r}ensureLineGaps(e,t){let r=this.heightOracle.lineWrapping,i=r?1e4:2e3,s=i>>1,o=i<<1;if(this.defaultTextDirection!=hr.LTR&&!r)return[];let a=[],l=(u,d,h,m)=>{if(d-u<s)return;let g=this.state.selection.main,O=[g.from];g.empty||O.push(g.to);for(let b of O)if(b>u&&b<d){l(u,b-10,h,m),l(b+10,d,h,m);return}let y=Z6(e,b=>b.from>=h.from&&b.to<=h.to&&Math.abs(b.from-u)<s&&Math.abs(b.to-d)<s&&!O.some(S=>b.from<S&&b.to>S));if(!y){if(d<h.to&&t&&r&&t.visibleRanges.some(P=>P.from<=d&&P.to>=d)){let P=t.moveToLineBoundary(_e.cursor(d),!1,!0).head;P>u&&(d=P)}let b=this.gapSize(h,u,d,m),S=r||b<2e6?b:2e6;y=new b0(u,d,b,S)}a.push(y)},c=u=>{if(u.length<o||u.type!=Li.Text)return;let d=V6(u.from,u.to,this.stateDeco);if(d.total<o)return;let h=this.scrollTarget?this.scrollTarget.range.head:null,m,g;if(r){let O=i/this.heightOracle.lineLength*this.heightOracle.lineHeight,y,b;if(h!=null){let S=Lp(d,h),P=((this.visibleBottom-this.visibleTop)/2+O)/u.height;y=S-P,b=S+P}else y=(this.visibleTop-u.top-O)/u.height,b=(this.visibleBottom-u.top+O)/u.height;m=Np(d,y),g=Np(d,b)}else{let O=d.total*this.heightOracle.charWidth,y=i*this.heightOracle.charWidth,b=0;if(O>2e6)for(let A of e)A.from>=u.from&&A.from<u.to&&A.size!=A.displaySize&&A.from*this.heightOracle.charWidth+b<this.pixelViewport.left&&(b=A.size-A.displaySize);let S=this.pixelViewport.left+b,P=this.pixelViewport.right+b,k,x;if(h!=null){let A=Lp(d,h),M=((P-S)/2+y)/O;k=A-M,x=A+M}else k=(S-y)/O,x=(P+y)/O;m=Np(d,k),g=Np(d,x)}m>u.from&&l(u.from,m,u,d),g<u.to&&l(g,u.to,u,d)};for(let u of this.viewportLines)Array.isArray(u.type)?u.type.forEach(c):c(u);return a}gapSize(e,t,r,i){let s=Lp(i,r)-Lp(i,t);return this.heightOracle.lineWrapping?e.height*s:i.total*this.heightOracle.charWidth*s}updateLineGaps(e){b0.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=mt.set(e.map(t=>t.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let r=[];Mn.spans(t,this.viewport.from,this.viewport.to,{span(s,o){r.push({from:s,to:o})},point(){}},20);let i=0;if(r.length!=this.visibleRanges.length)i=12;else for(let s=0;s<r.length&&!(i&8);s++){let o=this.visibleRanges[s],a=r[s];(o.from!=a.from||o.to!=a.to)&&(i|=4,e&&e.mapPos(o.from,-1)==a.from&&e.mapPos(o.to,1)==a.to||(i|=8))}return this.visibleRanges=r,i}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||wd(this.heightMap.lineAt(e,fr.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||wd(this.heightMap.lineAt(this.scaler.fromDOM(e),fr.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return wd(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class jp{constructor(e,t){this.from=e,this.to=t}}function V6(n,e,t){let r=[],i=n,s=0;return Mn.spans(t,n,e,{span(){},point(o,a){o>i&&(r.push({from:i,to:o}),s+=o-i),i=a}},20),i<e&&(r.push({from:i,to:e}),s+=e-i),{total:s,ranges:r}}function Np({total:n,ranges:e},t){if(t<=0)return e[0].from;if(t>=1)return e[e.length-1].to;let r=Math.floor(n*t);for(let i=0;;i++){let{from:s,to:o}=e[i],a=o-s;if(r<=a)return s+r;r-=a}}function Lp(n,e){let t=0;for(let{from:r,to:i}of n.ranges){if(e<=i){t+=e-r;break}t+=i-r}return t/n.total}function Z6(n,e){for(let t of n)if(e(t))return t}const R_={toDOM(n){return n},fromDOM(n){return n},scale:1,eq(n){return n==this}};class rk{constructor(e,t,r){let i=0,s=0,o=0;this.viewports=r.map(({from:a,to:l})=>{let c=t.lineAt(a,fr.ByPos,e,0,0).top,u=t.lineAt(l,fr.ByPos,e,0,0).bottom;return i+=u-c,{from:a,to:l,top:c,bottom:u,domTop:0,domBottom:0}}),this.scale=(7e6-i)/(t.height-i);for(let a of this.viewports)a.domTop=o+(a.top-s)*this.scale,o=a.domBottom=a.domTop+(a.bottom-a.top),s=a.bottom}toDOM(e){for(let t=0,r=0,i=0;;t++){let s=t<this.viewports.length?this.viewports[t]:null;if(!s||e<s.top)return i+(e-r)*this.scale;if(e<=s.bottom)return s.domTop+(e-s.top);r=s.bottom,i=s.domBottom}}fromDOM(e){for(let t=0,r=0,i=0;;t++){let s=t<this.viewports.length?this.viewports[t]:null;if(!s||e<s.domTop)return r+(e-i)/this.scale;if(e<=s.domBottom)return s.top+(e-s.domTop);r=s.bottom,i=s.domBottom}}eq(e){return e instanceof rk?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((t,r)=>t.from==e.viewports[r].from&&t.to==e.viewports[r].to):!1}}function wd(n,e){if(e.scale==1)return n;let t=e.toDOM(n.top),r=e.toDOM(n.bottom);return new Bo(n.from,n.length,t,r-t,Array.isArray(n._content)?n._content.map(i=>wd(i,e)):n._content)}const qp=ft.define({combine:n=>n.join(" ")}),D1=ft.define({combine:n=>n.indexOf(!0)>-1}),I1=xl.newName(),JI=xl.newName(),e5=xl.newName(),t5={"&light":"."+JI,"&dark":"."+e5};function j1(n,e,t){return new xl(e,{finish(r){return/&/.test(r)?r.replace(/&\w*/,i=>{if(i=="&")return n;if(!t||!t[i])throw new RangeError(`Unsupported selector: ${i}`);return t[i]}):n+" "+r}})}const W6=j1("."+I1,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},t5),X6={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},S0=yt.ie&&yt.ie_version<=11;class z6{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new EV,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let r of t)this.queue.push(r);(yt.ie&&yt.ie_version<=11||yt.ios&&e.composing)&&t.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&e.constructor.EDIT_CONTEXT!==!1&&!(yt.chrome&&yt.chrome_version<126)&&(this.editContext=new G6(e),e.state.facet(ya)&&(e.contentDOM.editContext=this.editContext.editContext)),S0&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(t=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,r)=>t!=e[r]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:r}=this,i=this.selectionRange;if(r.state.facet(ya)?r.root.activeElement!=this.dom:!Tg(this.dom,i))return;let s=i.anchorNode&&r.docView.nearest(i.anchorNode);if(s&&s.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(yt.ie&&yt.ie_version<=11||yt.android&&yt.chrome)&&!r.state.selection.main.empty&&i.focusNode&&Md(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=Vd(e.root);if(!t)return!1;let r=yt.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&Y6(this.view,t)||t;if(!r||this.selectionRange.eq(r))return!1;let i=Tg(this.dom,r);return i&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&AV(this.dom,r)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(r),i&&(this.selectionChanged=!0),!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let r=this.dom;r;)if(r.nodeType==1)!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==r?e++:t||(t=this.scrollTargets.slice(0,e)),t&&t.push(r),r=r.assignedSlot||r.parentNode;else if(r.nodeType==11)r=r.host;else break;if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);for(let r of this.scrollTargets=t)r.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,X6),S0&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),S0&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){var r;if(!this.delayedAndroidKey){let i=()=>{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&Iu(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(i)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!!(!((r=this.delayedAndroidKey)===null||r===void 0)&&r.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,r=-1,i=!1;for(let s of e){let o=this.readMutation(s);o&&(o.typeOver&&(i=!0),t==-1?{from:t,to:r}=o:(t=Math.min(o.from,t),r=Math.max(o.to,r)))}return{from:t,to:r,typeOver:i}}readChange(){let{from:e,to:t,typeOver:r}=this.processRecords(),i=this.selectionChanged&&Tg(this.dom,this.selectionRange);if(e<0&&!i)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new d6(this.view,e,t,r);return this.view.docView.domChanged={newSel:s.newSel?s.newSel.main:null},s}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let r=this.view.state,i=FI(this.view,t);return this.view.state==r&&(t.domChanged||t.newSel&&!t.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),i}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty(e.type=="attributes"),e.type=="attributes"&&(t.flags|=4),e.type=="childList"){let r=A_(t,e.previousSibling||e.target.previousSibling,-1),i=A_(t,e.nextSibling||e.target.nextSibling,1);return{from:r?t.posAfter(r):t.posAtStart,to:i?t.posBefore(i):t.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(ya)!=e.state.facet(ya)&&(e.view.contentDOM.editContext=e.state.facet(ya)?this.editContext.editContext:null))}destroy(){var e,t,r;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(r=this.resizeScroll)===null||r===void 0||r.disconnect();for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function A_(n,e,t){for(;e;){let r=er.get(e);if(r&&r.parent==n)return r;let i=e.parentNode;e=i!=n.dom?i:t>0?e.nextSibling:e.previousSibling}return null}function $_(n,e){let t=e.startContainer,r=e.startOffset,i=e.endContainer,s=e.endOffset,o=n.docView.domAtPos(n.state.selection.main.anchor);return Md(o.node,o.offset,i,s)&&([t,r,i,s]=[i,s,t,r]),{anchorNode:t,anchorOffset:r,focusNode:i,focusOffset:s}}function Y6(n,e){if(e.getComposedRanges){let i=e.getComposedRanges(n.root)[0];if(i)return $_(n,i)}let t=null;function r(i){i.preventDefault(),i.stopImmediatePropagation(),t=i.getTargetRanges()[0]}return n.contentDOM.addEventListener("beforeinput",r,!0),n.dom.ownerDocument.execCommand("indent"),n.contentDOM.removeEventListener("beforeinput",r,!0),t?$_(n,t):null}class G6{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=r=>{let i=e.state.selection.main,{anchor:s,head:o}=i,a=this.toEditorPos(r.updateRangeStart),l=this.toEditorPos(r.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:r.updateRangeStart,editorBase:a,drifted:!1});let c={from:a,to:l,insert:En.of(r.text.split(`
|
|
125
|
+
`))};if(c.from==this.from&&s<this.from?c.from=s:c.to==this.to&&s>this.to&&(c.to=s),c.from==c.to&&!c.insert.length){let u=_e.single(this.toEditorPos(r.selectionStart),this.toEditorPos(r.selectionEnd));u.main.eq(i)||e.dispatch({selection:u,userEvent:"select"});return}if((yt.mac||yt.android)&&c.from==o-1&&/^\. ?$/.test(r.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(c={from:a,to:l,insert:En.of([r.text.replace("."," ")])}),this.pendingContextChange=c,!e.state.readOnly){let u=this.to-this.from+(c.to-c.from+c.insert.length);tk(e,c,_e.single(this.toEditorPos(r.selectionStart,u),this.toEditorPos(r.selectionEnd,u)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state))},this.handlers.characterboundsupdate=r=>{let i=[],s=null;for(let o=this.toEditorPos(r.rangeStart),a=this.toEditorPos(r.rangeEnd);o<a;o++){let l=e.coordsForChar(o);s=l&&new DOMRect(l.left,l.top,l.right-l.left,l.bottom-l.top)||s||new DOMRect,i.push(s)}t.updateCharacterBounds(r.rangeStart,i)},this.handlers.textformatupdate=r=>{let i=[];for(let s of r.getTextFormats()){let o=s.underlineStyle,a=s.underlineThickness;if(o!="None"&&a!="None"){let l=this.toEditorPos(s.rangeStart),c=this.toEditorPos(s.rangeEnd);if(l<c){let u=`text-decoration: underline ${o=="Dashed"?"dashed ":o=="Squiggle"?"wavy ":""}${a=="Thin"?1:2}px`;i.push(mt.mark({attributes:{style:u}}).range(l,c))}}}e.dispatch({effects:II.of(mt.set(i))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:r}=this.composing;this.composing=null,r&&this.reset(e.state)}};for(let r in this.handlers)t.addEventListener(r,this.handlers[r]);this.measureReq={read:r=>{this.editContext.updateControlBounds(r.contentDOM.getBoundingClientRect());let i=Vd(r.root);i&&i.rangeCount&&this.editContext.updateSelectionBounds(i.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,r=!1,i=this.pendingContextChange;return e.changes.iterChanges((s,o,a,l,c)=>{if(r)return;let u=c.length-(o-s);if(i&&o>=i.to)if(i.from==s&&i.to==o&&i.insert.eq(c)){i=this.pendingContextChange=null,t+=u,this.to+=u;return}else i=null,this.revertPending(e.state);if(s+=t,o+=t,o<=this.from)this.from+=u,this.to+=u;else if(s<this.to){if(s<this.from||o>this.to||this.to-this.from+c.length>3e4){r=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(o),c.toString()),this.to+=u}t+=u}),i&&!r&&this.revertPending(e.state),!r}update(e){let t=this.pendingContextChange,r=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(r.from,r.to)&&e.transactions.some(i=>!i.isUserEvent("input.type")&&i.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,r=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),i=this.toContextPos(t.head);(this.editContext.selectionStart!=r||this.editContext.selectionEnd!=i)&&this.editContext.updateSelection(r,i)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>1e4*3)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let r=this.composing;return r&&r.drifted?r.editorBase+(e-r.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class et{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var t;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:r}=e;this.dispatchTransactions=e.dispatchTransactions||r&&(i=>i.forEach(s=>r(s,this)))||(i=>this.update(i)),this.dispatch=this.dispatch.bind(this),this._root=e.root||RV(e.parent)||document,this.viewState=new E_(e.state||Cn.create(e)),e.scrollTo&&e.scrollTo.is(Qp)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(yd).map(i=>new O0(i));for(let i of this.plugins)i.update(this);this.observer=new z6(this),this.inputState=new O6(this),this.inputState.ensureHandlers(this.plugins),this.docView=new u_(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((t=document.fonts)===null||t===void 0)&&t.ready&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...e){let t=e.length==1&&e[0]instanceof Vr?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,r=!1,i,s=this.state;for(let h of e){if(h.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=h.state}if(this.destroyed){this.viewState.state=s;return}let o=this.hasFocus,a=0,l=null;e.some(h=>h.annotation(YI))?(this.inputState.notifiedFocused=o,a=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,l=GI(s,o),l||(a=1));let c=this.observer.delayedAndroidKey,u=null;if(c?(this.observer.clearDelayedAndroidKey(),u=this.observer.readChange(),(u&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(u=null)):this.observer.clear(),s.facet(Cn.phrases)!=this.state.facet(Cn.phrases))return this.setState(s);i=sO.create(this,s,e),i.flags|=a;let d=this.viewState.scrollTarget;try{this.updateState=2;for(let h of e){if(d&&(d=d.map(h.changes)),h.scrollIntoView){let{main:m}=h.state.selection;d=new ju(m.empty?m:_e.cursor(m.head,m.head>m.anchor?-1:1))}for(let m of h.effects)m.is(Qp)&&(d=m.value.clip(this.state))}this.viewState.update(i,d),this.bidiCache=aO.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),t=this.docView.update(i),this.state.facet(bd)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(h=>h.isUserEvent("select.pointer")))}finally{this.updateState=0}if(i.startState.facet(qp)!=i.state.facet(qp)&&(this.viewState.mustMeasureContent=!0),(t||r||d||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!i.empty)for(let h of this.state.facet(A1))try{h(i)}catch(m){is(this.state,m,"update listener")}(l||u)&&Promise.resolve().then(()=>{l&&this.state==l.startState&&this.dispatch(l),u&&!FI(this,u)&&c.force&&Iu(this.contentDOM,c.key,c.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let r of this.plugins)r.destroy(this);this.viewState=new E_(e),this.plugins=e.facet(yd).map(r=>new O0(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new u_(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(yd),r=e.state.facet(yd);if(t!=r){let i=[];for(let s of r){let o=t.indexOf(s);if(o<0)i.push(new O0(s));else{let a=this.plugins[o];a.mustUpdate=e,i.push(a)}}for(let s of this.plugins)s.mustUpdate!=e&&s.destroy(this);this.plugins=i,this.pluginMap.clear()}else for(let i of this.plugins)i.mustUpdate=e;for(let i=0;i<this.plugins.length;i++)this.plugins[i].update(this);t!=r&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let t=e.value;if(t&&t.docViewUpdate)try{t.docViewUpdate(this)}catch(r){is(this.state,r,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,r=this.scrollDOM,i=r.scrollTop*this.scaleY,{scrollAnchorPos:s,scrollAnchorHeight:o}=this.viewState;Math.abs(i-this.viewState.scrollTop)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let a=0;;a++){if(o<0)if(uI(r))s=-1,o=this.viewState.heightMap.height;else{let m=this.viewState.scrollAnchorAt(i);s=m.from,o=m.top}this.updateState=1;let l=this.viewState.measure(this);if(!l&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(a>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let c=[];l&4||([this.measureRequests,c]=[c,this.measureRequests]);let u=c.map(m=>{try{return m.read(this)}catch(g){return is(this.state,g),M_}}),d=sO.create(this,this.state,[]),h=!1;d.flags|=l,t?t.flags|=l:t=d,this.updateState=2,d.empty||(this.updatePlugins(d),this.inputState.update(d),this.updateAttrs(),h=this.docView.update(d),h&&this.docViewUpdate());for(let m=0;m<c.length;m++)if(u[m]!=M_)try{let g=c[m];g.write&&g.write(u[m],this)}catch(g){is(this.state,g)}if(h&&this.docView.updateSelection(!0),!d.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,o=-1;continue}else{let g=(s<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(s).top)-o;if(g>1||g<-1){i=i+g,r.scrollTop=i/this.scaleY,o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let a of this.state.facet(A1))a(t)}get themeClasses(){return I1+" "+(this.state.facet(D1)?e5:JI)+" "+this.state.facet(qp)}updateAttrs(){let e=Q_(this,jI,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(ya)?"true":"false",class:"cm-content",style:`${yt.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),Q_(this,Kw,t);let r=this.observer.ignore(()=>{let i=T1(this.contentDOM,this.contentAttrs,t),s=T1(this.dom,this.editorAttrs,e);return i||s});return this.editorAttrs=e,this.contentAttrs=t,r}showAnnouncements(e){let t=!0;for(let r of e)for(let i of r.effects)if(i.is(et.announce)){t&&(this.announceDOM.textContent=""),t=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=i.value}}mountStyles(){this.styleModules=this.state.facet(bd);let e=this.state.facet(et.cspNonce);xl.mount(this.root,this.styleModules.concat(W6).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key){this.measureRequests[t]=e;return}}this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(t===void 0||t&&t.spec!=e)&&this.pluginMap.set(e,t=this.plugins.find(r=>r.spec==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,r){return y0(this,e,m_(this,e,t,r))}moveByGroup(e,t){return y0(this,e,m_(this,e,t,r=>l6(this,e.head,r)))}visualLineSide(e,t){let r=this.bidiSpans(e),i=this.textDirectionAt(e.from),s=r[t?r.length-1:0];return _e.cursor(s.side(t,i)+e.from,s.forward(!t,i)?1:-1)}moveToLineBoundary(e,t,r=!0){return a6(this,e,t,r)}moveVertically(e,t,r){return y0(this,e,c6(this,e,t,r))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){return this.readMeasured(),BI(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let r=this.docView.coordsAt(e,t);if(!r||r.left==r.right)return r;let i=this.state.doc.lineAt(e),s=this.bidiSpans(i),o=s[Ol.find(s,e-i.from,-1,t)];return zO(r,o.dir==hr.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(MI)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>H6)return xI(e.length);let t=this.textDirectionAt(e.from),r;for(let s of this.bidiCache)if(s.from==e.from&&s.dir==t&&(s.fresh||PI(s.isolates,r=c_(this,e))))return s.order;r||(r=c_(this,e));let i=ZV(e.text,t,r);return this.bidiCache.push(new aO(e.from,e.to,t,r,!0,i)),i}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||yt.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{lI(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return Qp.of(new ju(typeof e=="number"?_e.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,r=this.viewState.scrollAnchorAt(e);return Qp.of(new ju(_e.cursor(r.from),"start","start",r.top-e,t,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return Xn.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return Xn.define(()=>({}),{eventObservers:e})}static theme(e,t){let r=xl.newName(),i=[qp.of(r),bd.of(j1(`.${r}`,e))];return t&&t.dark&&i.push(D1.of(!0)),i}static baseTheme(e){return Go.lowest(bd.of(j1("."+I1,e,t5)))}static findFromDOM(e){var t;let r=e.querySelector(".cm-content"),i=r&&er.get(r)||er.get(e);return((t=i==null?void 0:i.rootView)===null||t===void 0?void 0:t.view)||null}}et.styleModule=bd;et.inputHandler=AI;et.clipboardInputFilter=Gw;et.clipboardOutputFilter=Hw;et.scrollHandler=DI;et.focusChangeEffect=$I;et.perLineTextDirection=MI;et.exceptionSink=RI;et.updateListener=A1;et.editable=ya;et.mouseSelectionStyle=EI;et.dragMovesSelection=_I;et.clickAddsSelectionRange=CI;et.decorations=Wd;et.outerDecorations=NI;et.atomicRanges=Jw;et.bidiIsolatedRanges=LI;et.scrollMargins=qI;et.darkTheme=D1;et.cspNonce=ft.define({combine:n=>n.length?n[0]:""});et.contentAttributes=Kw;et.editorAttributes=jI;et.lineWrapping=et.contentAttributes.of({class:"cm-lineWrapping"});et.announce=Yt.define();const H6=4096,M_={};class aO{constructor(e,t,r,i,s,o){this.from=e,this.to=t,this.dir=r,this.isolates=i,this.fresh=s,this.order=o}static update(e,t){if(t.empty&&!e.some(s=>s.fresh))return e;let r=[],i=e.length?e[e.length-1].dir:hr.LTR;for(let s=Math.max(0,e.length-10);s<e.length;s++){let o=e[s];o.dir==i&&!t.touchesRange(o.from,o.to)&&r.push(new aO(t.mapPos(o.from,1),t.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return r}}function Q_(n,e,t){for(let r=n.state.facet(e),i=r.length-1;i>=0;i--){let s=r[i],o=typeof s=="function"?s(n):s;o&&x1(o,t)}return t}const K6=yt.mac?"mac":yt.windows?"win":yt.linux?"linux":"key";function J6(n,e){const t=n.split(/-(?!$)/);let r=t[t.length-1];r=="Space"&&(r=" ");let i,s,o,a;for(let l=0;l<t.length-1;++l){const c=t[l];if(/^(cmd|meta|m)$/i.test(c))a=!0;else if(/^a(lt)?$/i.test(c))i=!0;else if(/^(c|ctrl|control)$/i.test(c))s=!0;else if(/^s(hift)?$/i.test(c))o=!0;else if(/^mod$/i.test(c))e=="mac"?a=!0:s=!0;else throw new Error("Unrecognized modifier name: "+c)}return i&&(r="Alt-"+r),s&&(r="Ctrl-"+r),a&&(r="Meta-"+r),o&&(r="Shift-"+r),r}function Up(n,e,t){return e.altKey&&(n="Alt-"+n),e.ctrlKey&&(n="Ctrl-"+n),e.metaKey&&(n="Meta-"+n),t!==!1&&e.shiftKey&&(n="Shift-"+n),n}const eZ=Go.default(et.domEventHandlers({keydown(n,e){return r5(n5(e.state),n,e,"editor")}})),cf=ft.define({enables:eZ}),D_=new WeakMap;function n5(n){let e=n.facet(cf),t=D_.get(e);return t||D_.set(e,t=rZ(e.reduce((r,i)=>r.concat(i),[]))),t}function tZ(n,e,t){return r5(n5(n.state),e,n,t)}let dl=null;const nZ=4e3;function rZ(n,e=K6){let t=Object.create(null),r=Object.create(null),i=(o,a)=>{let l=r[o];if(l==null)r[o]=a;else if(l!=a)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},s=(o,a,l,c,u)=>{var d,h;let m=t[o]||(t[o]=Object.create(null)),g=a.split(/ (?!$)/).map(b=>J6(b,e));for(let b=1;b<g.length;b++){let S=g.slice(0,b).join(" ");i(S,!0),m[S]||(m[S]={preventDefault:!0,stopPropagation:!1,run:[P=>{let k=dl={view:P,prefix:S,scope:o};return setTimeout(()=>{dl==k&&(dl=null)},nZ),!0}]})}let O=g.join(" ");i(O,!1);let y=m[O]||(m[O]={preventDefault:!1,stopPropagation:!1,run:((h=(d=m._any)===null||d===void 0?void 0:d.run)===null||h===void 0?void 0:h.slice())||[]});l&&y.run.push(l),c&&(y.preventDefault=!0),u&&(y.stopPropagation=!0)};for(let o of n){let a=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let c of a){let u=t[c]||(t[c]=Object.create(null));u._any||(u._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:d}=o;for(let h in u)u[h].run.push(m=>d(m,N1))}let l=o[e]||o.key;if(l)for(let c of a)s(c,l,o.run,o.preventDefault,o.stopPropagation),o.shift&&s(c,"Shift-"+l,o.shift,o.preventDefault,o.stopPropagation)}return t}let N1=null;function r5(n,e,t,r){N1=e;let i=xV(e),s=es(i,0),o=Uo(s)==i.length&&i!=" ",a="",l=!1,c=!1,u=!1;dl&&dl.view==t&&dl.scope==r&&(a=dl.prefix+" ",ZI.indexOf(e.keyCode)<0&&(c=!0,dl=null));let d=new Set,h=y=>{if(y){for(let b of y.run)if(!d.has(b)&&(d.add(b),b(t)))return y.stopPropagation&&(u=!0),!0;y.preventDefault&&(y.stopPropagation&&(u=!0),c=!0)}return!1},m=n[r],g,O;return m&&(h(m[a+Up(i,e,!o)])?l=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(yt.windows&&e.ctrlKey&&e.altKey)&&(g=Tl[e.keyCode])&&g!=i?(h(m[a+Up(g,e,!0)])||e.shiftKey&&(O=Fd[e.keyCode])!=i&&O!=g&&h(m[a+Up(O,e,!1)]))&&(l=!0):o&&e.shiftKey&&h(m[a+Up(i,e,!0)])&&(l=!0),!l&&h(m._any)&&(l=!0)),c&&(l=!0),l&&u&&e.stopPropagation(),N1=null,l}class Oh{constructor(e,t,r,i,s){this.className=e,this.left=t,this.top=r,this.width=i,this.height=s}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,r){if(r.empty){let i=e.coordsAtPos(r.head,r.assoc||1);if(!i)return[];let s=i5(e);return[new Oh(t,i.left-s.left,i.top-s.top,null,i.bottom-i.top)]}else return iZ(e,t,r)}}function i5(n){let e=n.scrollDOM.getBoundingClientRect();return{left:(n.textDirection==hr.LTR?e.left:e.right-n.scrollDOM.clientWidth*n.scaleX)-n.scrollDOM.scrollLeft*n.scaleX,top:e.top-n.scrollDOM.scrollTop*n.scaleY}}function I_(n,e,t,r){let i=n.coordsAtPos(e,t*2);if(!i)return r;let s=n.dom.getBoundingClientRect(),o=(i.top+i.bottom)/2,a=n.posAtCoords({x:s.left+1,y:o}),l=n.posAtCoords({x:s.right-1,y:o});return a==null||l==null?r:{from:Math.max(r.from,Math.min(a,l)),to:Math.min(r.to,Math.max(a,l))}}function iZ(n,e,t){if(t.to<=n.viewport.from||t.from>=n.viewport.to)return[];let r=Math.max(t.from,n.viewport.from),i=Math.min(t.to,n.viewport.to),s=n.textDirection==hr.LTR,o=n.contentDOM,a=o.getBoundingClientRect(),l=i5(n),c=o.querySelector(".cm-line"),u=c&&window.getComputedStyle(c),d=a.left+(u?parseInt(u.paddingLeft)+Math.min(0,parseInt(u.textIndent)):0),h=a.right-(u?parseInt(u.paddingRight):0),m=M1(n,r),g=M1(n,i),O=m.type==Li.Text?m:null,y=g.type==Li.Text?g:null;if(O&&(n.lineWrapping||m.widgetLineBreaks)&&(O=I_(n,r,1,O)),y&&(n.lineWrapping||g.widgetLineBreaks)&&(y=I_(n,i,-1,y)),O&&y&&O.from==y.from&&O.to==y.to)return S(P(t.from,t.to,O));{let x=O?P(t.from,null,O):k(m,!1),A=y?P(null,t.to,y):k(g,!0),M=[];return(O||m).to<(y||g).from-(O&&y?1:0)||m.widgetLineBreaks>1&&x.bottom+n.defaultLineHeight/2<A.top?M.push(b(d,x.bottom,h,A.top)):x.bottom<A.top&&n.elementAtHeight((x.bottom+A.top)/2).type==Li.Text&&(x.bottom=A.top=(x.bottom+A.top)/2),S(x).concat(M).concat(S(A))}function b(x,A,M,Q){return new Oh(e,x-l.left,A-l.top,M-x,Q-A)}function S({top:x,bottom:A,horizontal:M}){let Q=[];for(let _=0;_<M.length;_+=2)Q.push(b(M[_],x,M[_+1],A));return Q}function P(x,A,M){let Q=1e9,_=-1e9,R=[];function $(G,ue,B,X,W){let ee=n.coordsAtPos(G,G==M.to?-2:2),re=n.coordsAtPos(B,B==M.from?2:-2);!ee||!re||(Q=Math.min(ee.top,re.top,Q),_=Math.max(ee.bottom,re.bottom,_),W==hr.LTR?R.push(s&&ue?d:ee.left,s&&X?h:re.right):R.push(!s&&X?d:re.left,!s&&ue?h:ee.right))}let D=x??M.from,F=A??M.to;for(let G of n.visibleRanges)if(G.to>D&&G.from<F)for(let ue=Math.max(G.from,D),B=Math.min(G.to,F);;){let X=n.state.doc.lineAt(ue);for(let W of n.bidiSpans(X)){let ee=W.from+X.from,re=W.to+X.from;if(ee>=B)break;re>ue&&$(Math.max(ee,ue),x==null&&ee<=D,Math.min(re,B),A==null&&re>=F,W.dir)}if(ue=X.to+1,ue>=B)break}return R.length==0&&$(D,x==null,F,A==null,n.textDirection),{top:Q,bottom:_,horizontal:R}}function k(x,A){let M=a.top+(A?x.top:x.bottom);return{top:M,bottom:M,horizontal:[]}}}function sZ(n,e){return n.constructor==e.constructor&&n.eq(e)}class oZ{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(Rg)!=e.state.facet(Rg)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let t=0,r=e.facet(Rg);for(;t<r.length&&r[t]!=this.layer;)t++;this.dom.style.zIndex=String((this.layer.above?150:-1)-t)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:t}=this.view;(e!=this.scaleX||t!=this.scaleY)&&(this.scaleX=e,this.scaleY=t,this.dom.style.transform=`scale(${1/e}, ${1/t})`)}draw(e){if(e.length!=this.drawn.length||e.some((t,r)=>!sZ(t,this.drawn[r]))){let t=this.dom.firstChild,r=0;for(let i of e)i.update&&t&&i.constructor&&this.drawn[r].constructor&&i.update(t,this.drawn[r])?(t=t.nextSibling,r++):this.dom.insertBefore(i.draw(),t);for(;t;){let i=t.nextSibling;t.remove(),t=i}this.drawn=e}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const Rg=ft.define();function s5(n){return[Xn.define(e=>new oZ(e,n)),Rg.of(n)]}const Xd=ft.define({combine(n){return go(n,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function aZ(n={}){return[Xd.of(n),lZ,cZ,uZ,QI.of(!0)]}function o5(n){return n.startState.facet(Xd)!=n.state.facet(Xd)}const lZ=s5({above:!0,markers(n){let{state:e}=n,t=e.facet(Xd),r=[];for(let i of e.selection.ranges){let s=i==e.selection.main;if(i.empty||t.drawRangeCursor){let o=s?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",a=i.empty?i:_e.cursor(i.head,i.head>i.anchor?-1:1);for(let l of Oh.forRange(n,o,a))r.push(l)}}return r},update(n,e){n.transactions.some(r=>r.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let t=o5(n);return t&&j_(n.state,e),n.docChanged||n.selectionSet||t},mount(n,e){j_(e.state,n)},class:"cm-cursorLayer"});function j_(n,e){e.style.animationDuration=n.facet(Xd).cursorBlinkRate+"ms"}const cZ=s5({above:!1,markers(n){return n.state.selection.ranges.map(e=>e.empty?[]:Oh.forRange(n,"cm-selectionBackground",e)).reduce((e,t)=>e.concat(t))},update(n,e){return n.docChanged||n.selectionSet||n.viewportChanged||o5(n)},class:"cm-selectionLayer"}),uZ=Go.highest(et.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),a5=Yt.define({map(n,e){return n==null?null:e.mapPos(n)}}),kd=Zr.define({create(){return null},update(n,e){return n!=null&&(n=e.changes.mapPos(n)),e.effects.reduce((t,r)=>r.is(a5)?r.value:t,n)}}),fZ=Xn.fromClass(class{constructor(n){this.view=n,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(n){var e;let t=n.state.field(kd);t==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(n.startState.field(kd)!=t||n.docChanged||n.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:n}=this,e=n.state.field(kd),t=e!=null&&n.coordsAtPos(e);if(!t)return null;let r=n.scrollDOM.getBoundingClientRect();return{left:t.left-r.left+n.scrollDOM.scrollLeft*n.scaleX,top:t.top-r.top+n.scrollDOM.scrollTop*n.scaleY,height:t.bottom-t.top}}drawCursor(n){if(this.cursor){let{scaleX:e,scaleY:t}=this.view;n?(this.cursor.style.left=n.left/e+"px",this.cursor.style.top=n.top/t+"px",this.cursor.style.height=n.height/t+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(n){this.view.state.field(kd)!=n&&this.view.dispatch({effects:a5.of(n)})}},{eventObservers:{dragover(n){this.setDropPos(this.view.posAtCoords({x:n.clientX,y:n.clientY}))},dragleave(n){(n.target==this.view.contentDOM||!this.view.contentDOM.contains(n.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function dZ(){return[kd,fZ]}function N_(n,e,t,r,i){e.lastIndex=0;for(let s=n.iterRange(t,r),o=t,a;!s.next().done;o+=s.value.length)if(!s.lineBreak)for(;a=e.exec(s.value);)i(o+a.index,a)}function hZ(n,e){let t=n.visibleRanges;if(t.length==1&&t[0].from==n.viewport.from&&t[0].to==n.viewport.to)return t;let r=[];for(let{from:i,to:s}of t)i=Math.max(n.state.doc.lineAt(i).from,i-e),s=Math.min(n.state.doc.lineAt(s).to,s+e),r.length&&r[r.length-1].to>=i?r[r.length-1].to=s:r.push({from:i,to:s});return r}class pZ{constructor(e){const{regexp:t,decoration:r,decorate:i,boundary:s,maxLength:o=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,i)this.addMatch=(a,l,c,u)=>i(u,c,c+a[0].length,a,l);else if(typeof r=="function")this.addMatch=(a,l,c,u)=>{let d=r(a,l,c);d&&u(c,c+a[0].length,d)};else if(r)this.addMatch=(a,l,c,u)=>u(c,c+a[0].length,r);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=s,this.maxLength=o}createDeco(e){let t=new xa,r=t.add.bind(t);for(let{from:i,to:s}of hZ(e,this.maxLength))N_(e.state.doc,this.regexp,i,s,(o,a)=>this.addMatch(a,e,o,r));return t.finish()}updateDeco(e,t){let r=1e9,i=-1;return e.docChanged&&e.changes.iterChanges((s,o,a,l)=>{l>=e.view.viewport.from&&a<=e.view.viewport.to&&(r=Math.min(a,r),i=Math.max(l,i))}),e.viewportMoved||i-r>1e3?this.createDeco(e.view):i>-1?this.updateRange(e.view,t.map(e.changes),r,i):t}updateRange(e,t,r,i){for(let s of e.visibleRanges){let o=Math.max(s.from,r),a=Math.min(s.to,i);if(a>o){let l=e.state.doc.lineAt(o),c=l.to<a?e.state.doc.lineAt(a):l,u=Math.max(s.from,l.from),d=Math.min(s.to,c.to);if(this.boundary){for(;o>l.from;o--)if(this.boundary.test(l.text[o-1-l.from])){u=o;break}for(;a<c.to;a++)if(this.boundary.test(c.text[a-c.from])){d=a;break}}let h=[],m,g=(O,y,b)=>h.push(b.range(O,y));if(l==c)for(this.regexp.lastIndex=u-l.from;(m=this.regexp.exec(l.text))&&m.index<d-l.from;)this.addMatch(m,e,m.index+l.from,g);else N_(e.state.doc,this.regexp,u,d,(O,y)=>this.addMatch(y,e,O,g));t=t.update({filterFrom:u,filterTo:d,filter:(O,y)=>O<u||y>d,add:h})}}return t}}const L1=/x/.unicode!=null?"gu":"g",mZ=new RegExp(`[\0-\b
|
|
126
|
+
--\u2028\u2029\uFEFF-]`,L1),gZ={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let w0=null;function OZ(){var n;if(w0==null&&typeof document<"u"&&document.body){let e=document.body.style;w0=((n=e.tabSize)!==null&&n!==void 0?n:e.MozTabSize)!=null}return w0||!1}const Ag=ft.define({combine(n){let e=go(n,{render:null,specialChars:mZ,addSpecialChars:null});return(e.replaceTabs=!OZ())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,L1)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,L1)),e}});function vZ(n={}){return[Ag.of(n),yZ()]}let L_=null;function yZ(){return L_||(L_=Xn.fromClass(class{constructor(n){this.view=n,this.decorations=mt.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(n.state.facet(Ag)),this.decorations=this.decorator.createDeco(n)}makeDecorator(n){return new pZ({regexp:n.specialChars,decoration:(e,t,r)=>{let{doc:i}=t.state,s=es(e[0],0);if(s==9){let o=i.lineAt(r),a=t.state.tabSize,l=fo(o.text,a,r-o.from);return mt.replace({widget:new kZ((a-l%a)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[s]||(this.decorationCache[s]=mt.replace({widget:new wZ(n,s)}))},boundary:n.replaceTabs?void 0:/[^]/})}update(n){let e=n.state.facet(Ag);n.startState.facet(Ag)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(n.view)):this.decorations=this.decorator.updateDeco(n,this.decorations)}},{decorations:n=>n.decorations}))}const bZ="•";function SZ(n){return n>=32?bZ:n==10?"":String.fromCharCode(9216+n)}class wZ extends Ss{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=SZ(this.code),r=e.state.phrase("Control character")+" "+(gZ[this.code]||"0x"+this.code.toString(16)),i=this.options.render&&this.options.render(this.code,r,t);if(i)return i;let s=document.createElement("span");return s.textContent=t,s.title=r,s.setAttribute("aria-label",r),s.className="cm-specialChar",s}ignoreEvent(){return!1}}class kZ extends Ss{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function PZ(){return TZ}const xZ=mt.line({class:"cm-activeLine"}),TZ=Xn.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.docChanged||n.selectionSet)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=-1,t=[];for(let r of n.state.selection.ranges){let i=n.lineBlockAt(r.head);i.from>e&&(t.push(xZ.range(i.from)),e=i.from)}return mt.set(t)}},{decorations:n=>n.decorations}),q1=2e3;function CZ(n,e,t){let r=Math.min(e.line,t.line),i=Math.max(e.line,t.line),s=[];if(e.off>q1||t.off>q1||e.col<0||t.col<0){let o=Math.min(e.off,t.off),a=Math.max(e.off,t.off);for(let l=r;l<=i;l++){let c=n.doc.line(l);c.length<=a&&s.push(_e.range(c.from+o,c.to+a))}}else{let o=Math.min(e.col,t.col),a=Math.max(e.col,t.col);for(let l=r;l<=i;l++){let c=n.doc.line(l),u=v1(c.text,o,n.tabSize,!0);if(u<0)s.push(_e.cursor(c.to));else{let d=v1(c.text,a,n.tabSize);s.push(_e.range(c.from+u,c.from+d))}}}return s}function _Z(n,e){let t=n.coordsAtPos(n.viewport.from);return t?Math.round(Math.abs((t.left-e)/n.defaultCharacterWidth)):-1}function q_(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1),r=n.state.doc.lineAt(t),i=t-r.from,s=i>q1?-1:i==r.length?_Z(n,e.clientX):fo(r.text,n.state.tabSize,t-r.from);return{line:r.number,col:s,off:i}}function EZ(n,e){let t=q_(n,e),r=n.state.selection;return t?{update(i){if(i.docChanged){let s=i.changes.mapPos(i.startState.doc.line(t.line).from),o=i.state.doc.lineAt(s);t={line:o.number,col:t.col,off:Math.min(t.off,o.length)},r=r.map(i.changes)}},get(i,s,o){let a=q_(n,i);if(!a)return r;let l=CZ(n.state,t,a);return l.length?o?_e.create(l.concat(r.ranges)):_e.create(l):r}}:null}function RZ(n){let e=t=>t.altKey&&t.button==0;return et.mouseSelectionStyle.of((t,r)=>e(r)?EZ(t,r):null)}const AZ={Alt:[18,n=>!!n.altKey],Control:[17,n=>!!n.ctrlKey],Shift:[16,n=>!!n.shiftKey],Meta:[91,n=>!!n.metaKey]},$Z={style:"cursor: crosshair"};function MZ(n={}){let[e,t]=AZ[n.key||"Alt"],r=Xn.fromClass(class{constructor(i){this.view=i,this.isDown=!1}set(i){this.isDown!=i&&(this.isDown=i,this.view.update([]))}},{eventObservers:{keydown(i){this.set(i.keyCode==e||t(i))},keyup(i){(i.keyCode==e||!t(i))&&this.set(!1)},mousemove(i){this.set(t(i))}}});return[r,et.contentAttributes.of(i=>{var s;return!((s=i.plugin(r))===null||s===void 0)&&s.isDown?$Z:null})]}const Hf="-10000px";class l5{constructor(e,t,r,i){this.facet=t,this.createTooltipView=r,this.removeTooltipView=i,this.input=e.state.facet(t),this.tooltips=this.input.filter(o=>o);let s=null;this.tooltipViews=this.tooltips.map(o=>s=r(o,s))}update(e,t){var r;let i=e.state.facet(this.facet),s=i.filter(l=>l);if(i===this.input){for(let l of this.tooltipViews)l.update&&l.update(e);return!1}let o=[],a=t?[]:null;for(let l=0;l<s.length;l++){let c=s[l],u=-1;if(c){for(let d=0;d<this.tooltips.length;d++){let h=this.tooltips[d];h&&h.create==c.create&&(u=d)}if(u<0)o[l]=this.createTooltipView(c,l?o[l-1]:null),a&&(a[l]=!!c.above);else{let d=o[l]=this.tooltipViews[u];a&&(a[l]=t[u]),d.update&&d.update(e)}}}for(let l of this.tooltipViews)o.indexOf(l)<0&&(this.removeTooltipView(l),(r=l.destroy)===null||r===void 0||r.call(l));return t&&(a.forEach((l,c)=>t[c]=l),t.length=a.length),this.input=i,this.tooltips=s,this.tooltipViews=o,!0}}function QZ(n){let e=n.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}const k0=ft.define({combine:n=>{var e,t,r;return{position:yt.ios?"absolute":((e=n.find(i=>i.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((t=n.find(i=>i.parent))===null||t===void 0?void 0:t.parent)||null,tooltipSpace:((r=n.find(i=>i.tooltipSpace))===null||r===void 0?void 0:r.tooltipSpace)||QZ}}}),U_=new WeakMap,ik=Xn.fromClass(class{constructor(n){this.view=n,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=n.state.facet(k0);this.position=e.position,this.parent=e.parent,this.classes=n.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new l5(n,sk,(t,r)=>this.createTooltip(t,r),t=>{this.resizeObserver&&this.resizeObserver.unobserve(t.dom),t.dom.remove()}),this.above=this.manager.tooltips.map(t=>!!t.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),n.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let n of this.manager.tooltipViews)this.intersectionObserver.observe(n.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(n){n.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(n,this.above);e&&this.observeIntersection();let t=e||n.geometryChanged,r=n.state.facet(k0);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;for(let i of this.manager.tooltipViews)i.dom.style.position=this.position;t=!0}if(r.parent!=this.parent){this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer();for(let i of this.manager.tooltipViews)this.container.appendChild(i.dom);t=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);t&&this.maybeMeasure()}createTooltip(n,e){let t=n.create(this.view),r=e?e.dom:null;if(t.dom.classList.add("cm-tooltip"),n.arrow&&!t.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let i=document.createElement("div");i.className="cm-tooltip-arrow",t.dom.appendChild(i)}return t.dom.style.position=this.position,t.dom.style.top=Hf,t.dom.style.left="0px",this.container.insertBefore(t.dom,r),t.mount&&t.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(t.dom),t}destroy(){var n,e,t;this.view.win.removeEventListener("resize",this.measureSoon);for(let r of this.manager.tooltipViews)r.dom.remove(),(n=r.destroy)===null||n===void 0||n.call(r);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(t=this.intersectionObserver)===null||t===void 0||t.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let n=1,e=1,t=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:s}=this.manager.tooltipViews[0];if(yt.gecko)t=s.offsetParent!=this.container.ownerDocument.body;else if(s.style.top==Hf&&s.style.left=="0px"){let o=s.getBoundingClientRect();t=Math.abs(o.top+1e4)>1||Math.abs(o.left)>1}}if(t||this.position=="absolute")if(this.parent){let s=this.parent.getBoundingClientRect();s.width&&s.height&&(n=s.width/this.parent.offsetWidth,e=s.height/this.parent.offsetHeight)}else({scaleX:n,scaleY:e}=this.view.viewState);let r=this.view.scrollDOM.getBoundingClientRect(),i=ek(this.view);return{visible:{left:r.left+i.left,top:r.top+i.top,right:r.right-i.right,bottom:r.bottom-i.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((s,o)=>{let a=this.manager.tooltipViews[o];return a.getCoords?a.getCoords(s.pos):this.view.coordsAtPos(s.pos)}),size:this.manager.tooltipViews.map(({dom:s})=>s.getBoundingClientRect()),space:this.view.state.facet(k0).tooltipSpace(this.view),scaleX:n,scaleY:e,makeAbsolute:t}}writeMeasure(n){var e;if(n.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let a of this.manager.tooltipViews)a.dom.style.position="absolute"}let{visible:t,space:r,scaleX:i,scaleY:s}=n,o=[];for(let a=0;a<this.manager.tooltips.length;a++){let l=this.manager.tooltips[a],c=this.manager.tooltipViews[a],{dom:u}=c,d=n.pos[a],h=n.size[a];if(!d||l.clip!==!1&&(d.bottom<=Math.max(t.top,r.top)||d.top>=Math.min(t.bottom,r.bottom)||d.right<Math.max(t.left,r.left)-.1||d.left>Math.min(t.right,r.right)+.1)){u.style.top=Hf;continue}let m=l.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,g=m?7:0,O=h.right-h.left,y=(e=U_.get(c))!==null&&e!==void 0?e:h.bottom-h.top,b=c.offset||IZ,S=this.view.textDirection==hr.LTR,P=h.width>r.right-r.left?S?r.left:r.right-h.width:S?Math.max(r.left,Math.min(d.left-(m?14:0)+b.x,r.right-O)):Math.min(Math.max(r.left,d.left-O+(m?14:0)-b.x),r.right-O),k=this.above[a];!l.strictSide&&(k?d.top-y-g-b.y<r.top:d.bottom+y+g+b.y>r.bottom)&&k==r.bottom-d.bottom>d.top-r.top&&(k=this.above[a]=!k);let x=(k?d.top-r.top:r.bottom-d.bottom)-g;if(x<y&&c.resize!==!1){if(x<this.view.defaultLineHeight){u.style.top=Hf;continue}U_.set(c,y),u.style.height=(y=x)/s+"px"}else u.style.height&&(u.style.height="");let A=k?d.top-y-g-b.y:d.bottom+g+b.y,M=P+O;if(c.overlap!==!0)for(let Q of o)Q.left<M&&Q.right>P&&Q.top<A+y&&Q.bottom>A&&(A=k?Q.top-y-2-g:Q.bottom+g+2);if(this.position=="absolute"?(u.style.top=(A-n.parent.top)/s+"px",B_(u,(P-n.parent.left)/i)):(u.style.top=A/s+"px",B_(u,P/i)),m){let Q=d.left+(S?b.x:-b.x)-(P+14-7);m.style.left=Q/i+"px"}c.overlap!==!0&&o.push({left:P,top:A,right:M,bottom:A+y}),u.classList.toggle("cm-tooltip-above",k),u.classList.toggle("cm-tooltip-below",!k),c.positioned&&c.positioned(n.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let n of this.manager.tooltipViews)n.dom.style.top=Hf}},{eventObservers:{scroll(){this.maybeMeasure()}}});function B_(n,e){let t=parseInt(n.style.left,10);(isNaN(t)||Math.abs(e-t)>1)&&(n.style.left=e+"px")}const DZ=et.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),IZ={x:0,y:0},sk=ft.define({enables:[ik,DZ]}),lO=ft.define({combine:n=>n.reduce((e,t)=>e.concat(t),[])});class HO{static create(e){return new HO(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new l5(e,lO,(t,r)=>this.createHostedView(t,r),t=>t.dom.remove())}createHostedView(e,t){let r=e.create(this.view);return r.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(r.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&r.mount&&r.mount(this.view),r}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)(e=t.destroy)===null||e===void 0||e.call(t)}passProp(e){let t;for(let r of this.manager.tooltipViews){let i=r[e];if(i!==void 0){if(t===void 0)t=i;else if(t!==i)return}}return t}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const jZ=sk.compute([lO],n=>{let e=n.facet(lO);return e.length===0?null:{pos:Math.min(...e.map(t=>t.pos)),end:Math.max(...e.map(t=>{var r;return(r=t.end)!==null&&r!==void 0?r:t.pos})),create:HO.create,above:e[0].above,arrow:e.some(t=>t.arrow)}});class NZ{constructor(e,t,r,i,s){this.view=e,this.source=t,this.field=r,this.setHover=i,this.hoverTime=s,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:t}=this,r=e.docView.nearest(t.target);if(!r)return;let i,s=1;if(r instanceof gl)i=r.posAtStart;else{if(i=e.posAtCoords(t),i==null)return;let a=e.coordsAtPos(i);if(!a||t.y<a.top||t.y>a.bottom||t.x<a.left-e.defaultCharacterWidth||t.x>a.right+e.defaultCharacterWidth)return;let l=e.bidiSpans(e.state.doc.lineAt(i)).find(u=>u.from<=i&&u.to>=i),c=l&&l.dir==hr.RTL?-1:1;s=t.x<a.left?-c:c}let o=this.source(e,i,s);if(o!=null&&o.then){let a=this.pending={pos:i};o.then(l=>{this.pending==a&&(this.pending=null,l&&!(Array.isArray(l)&&!l.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(l)?l:[l])}))},l=>is(e.state,l,"hover tooltip"))}else o&&!(Array.isArray(o)&&!o.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(o)?o:[o])})}get tooltip(){let e=this.view.plugin(ik),t=e?e.manager.tooltips.findIndex(r=>r.create==HO.create):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){var t,r;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:i,tooltip:s}=this;if(i.length&&s&&!LZ(s.dom,e)||this.pending){let{pos:o}=i[0]||this.pending,a=(r=(t=i[0])===null||t===void 0?void 0:t.end)!==null&&r!==void 0?r:o;(o==a?this.view.posAtCoords(this.lastMove)!=o:!qZ(this.view,o,a,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t.length){let{tooltip:r}=this;r&&r.dom.contains(e.relatedTarget)?this.watchTooltipLeave(r.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=r=>{e.removeEventListener("mouseleave",t),this.active.length&&!this.view.dom.contains(r.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",t)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const Bp=4;function LZ(n,e){let{left:t,right:r,top:i,bottom:s}=n.getBoundingClientRect(),o;if(o=n.querySelector(".cm-tooltip-arrow")){let a=o.getBoundingClientRect();i=Math.min(a.top,i),s=Math.max(a.bottom,s)}return e.clientX>=t-Bp&&e.clientX<=r+Bp&&e.clientY>=i-Bp&&e.clientY<=s+Bp}function qZ(n,e,t,r,i,s){let o=n.scrollDOM.getBoundingClientRect(),a=n.documentTop+n.documentPadding.top+n.contentHeight;if(o.left>r||o.right<r||o.top>i||Math.min(o.bottom,a)<i)return!1;let l=n.posAtCoords({x:r,y:i},!1);return l>=e&&l<=t}function UZ(n,e={}){let t=Yt.define(),r=Zr.define({create(){return[]},update(i,s){if(i.length&&(e.hideOnChange&&(s.docChanged||s.selection)?i=[]:e.hideOn&&(i=i.filter(o=>!e.hideOn(s,o))),s.docChanged)){let o=[];for(let a of i){let l=s.changes.mapPos(a.pos,-1,Kr.TrackDel);if(l!=null){let c=Object.assign(Object.create(null),a);c.pos=l,c.end!=null&&(c.end=s.changes.mapPos(c.end)),o.push(c)}}i=o}for(let o of s.effects)o.is(t)&&(i=o.value),o.is(BZ)&&(i=[]);return i},provide:i=>lO.from(i)});return{active:r,extension:[r,Xn.define(i=>new NZ(i,n,r,t,e.hoverTime||300)),jZ]}}function c5(n,e){let t=n.plugin(ik);if(!t)return null;let r=t.manager.tooltips.indexOf(e);return r<0?null:t.manager.tooltipViews[r]}const BZ=Yt.define(),F_=ft.define({combine(n){let e,t;for(let r of n)e=e||r.topContainer,t=t||r.bottomContainer;return{topContainer:e,bottomContainer:t}}});function zd(n,e){let t=n.plugin(u5),r=t?t.specs.indexOf(e):-1;return r>-1?t.panels[r]:null}const u5=Xn.fromClass(class{constructor(n){this.input=n.state.facet(Yd),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(n));let e=n.state.facet(F_);this.top=new Fp(n,!0,e.topContainer),this.bottom=new Fp(n,!1,e.bottomContainer),this.top.sync(this.panels.filter(t=>t.top)),this.bottom.sync(this.panels.filter(t=>!t.top));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(n){let e=n.state.facet(F_);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new Fp(n.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new Fp(n.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=n.state.facet(Yd);if(t!=this.input){let r=t.filter(l=>l),i=[],s=[],o=[],a=[];for(let l of r){let c=this.specs.indexOf(l),u;c<0?(u=l(n.view),a.push(u)):(u=this.panels[c],u.update&&u.update(n)),i.push(u),(u.top?s:o).push(u)}this.specs=r,this.panels=i,this.top.sync(s),this.bottom.sync(o);for(let l of a)l.dom.classList.add("cm-panel"),l.mount&&l.mount()}else for(let r of this.panels)r.update&&r.update(n)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:n=>et.scrollMargins.of(e=>{let t=e.plugin(n);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})});class Fp{constructor(e,t,r){this.view=e,this.top=t,this.container=r,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=V_(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=V_(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function V_(n){let e=n.nextSibling;return n.remove(),e}const Yd=ft.define({enables:u5});class _l extends xc{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}_l.prototype.elementClass="";_l.prototype.toDOM=void 0;_l.prototype.mapMode=Kr.TrackBefore;_l.prototype.startSide=_l.prototype.endSide=-1;_l.prototype.point=!0;const $g=ft.define(),FZ=ft.define(),Mg=ft.define(),Z_=ft.define({combine:n=>n.some(e=>e)});function VZ(n){return[ZZ]}const ZZ=Xn.fromClass(class{constructor(n){this.view=n,this.prevViewport=n.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=n.state.facet(Mg).map(e=>new X_(n,e));for(let e of this.gutters)this.dom.appendChild(e.dom);this.fixed=!n.state.facet(Z_),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),n.scrollDOM.insertBefore(this.dom,n.contentDOM)}update(n){if(this.updateGutters(n)){let e=this.prevViewport,t=n.view.viewport,r=Math.min(e.to,t.to)-Math.max(e.from,t.from);this.syncGutters(r<(t.to-t.from)*.8)}n.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px"),this.view.state.facet(Z_)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=n.view.viewport}syncGutters(n){let e=this.dom.nextSibling;n&&this.dom.remove();let t=Mn.iter(this.view.state.facet($g),this.view.viewport.from),r=[],i=this.gutters.map(s=>new WZ(s,this.view.viewport,-this.view.documentPadding.top));for(let s of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(s.type)){let o=!0;for(let a of s.type)if(a.type==Li.Text&&o){U1(t,r,a.from);for(let l of i)l.line(this.view,a,r);o=!1}else if(a.widget)for(let l of i)l.widget(this.view,a)}else if(s.type==Li.Text){U1(t,r,s.from);for(let o of i)o.line(this.view,s,r)}else if(s.widget)for(let o of i)o.widget(this.view,s);for(let s of i)s.finish();n&&this.view.scrollDOM.insertBefore(this.dom,e)}updateGutters(n){let e=n.startState.facet(Mg),t=n.state.facet(Mg),r=n.docChanged||n.heightChanged||n.viewportChanged||!Mn.eq(n.startState.facet($g),n.state.facet($g),n.view.viewport.from,n.view.viewport.to);if(e==t)for(let i of this.gutters)i.update(n)&&(r=!0);else{r=!0;let i=[];for(let s of t){let o=e.indexOf(s);o<0?i.push(new X_(this.view,s)):(this.gutters[o].update(n),i.push(this.gutters[o]))}for(let s of this.gutters)s.dom.remove(),i.indexOf(s)<0&&s.destroy();for(let s of i)this.dom.appendChild(s.dom);this.gutters=i}return r}destroy(){for(let n of this.gutters)n.destroy();this.dom.remove()}},{provide:n=>et.scrollMargins.of(e=>{let t=e.plugin(n);return!t||t.gutters.length==0||!t.fixed?null:e.textDirection==hr.LTR?{left:t.dom.offsetWidth*e.scaleX}:{right:t.dom.offsetWidth*e.scaleX}})});function W_(n){return Array.isArray(n)?n:[n]}function U1(n,e,t){for(;n.value&&n.from<=t;)n.from==t&&e.push(n.value),n.next()}class WZ{constructor(e,t,r){this.gutter=e,this.height=r,this.i=0,this.cursor=Mn.iter(e.markers,t.from)}addElement(e,t,r){let{gutter:i}=this,s=(t.top-this.height)/e.scaleY,o=t.height/e.scaleY;if(this.i==i.elements.length){let a=new f5(e,o,s,r);i.elements.push(a),i.dom.appendChild(a.dom)}else i.elements[this.i].update(e,o,s,r);this.height=t.bottom,this.i++}line(e,t,r){let i=[];U1(this.cursor,i,t.from),r.length&&(i=i.concat(r));let s=this.gutter.config.lineMarker(e,t,i);s&&i.unshift(s);let o=this.gutter;i.length==0&&!o.config.renderEmptyElements||this.addElement(e,t,i)}widget(e,t){let r=this.gutter.config.widgetMarker(e,t.widget,t),i=r?[r]:null;for(let s of e.state.facet(FZ)){let o=s(e,t.widget,t);o&&(i||(i=[])).push(o)}i&&this.addElement(e,t,i)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class X_{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let r in t.domEventHandlers)this.dom.addEventListener(r,i=>{let s=i.target,o;if(s!=this.dom&&this.dom.contains(s)){for(;s.parentNode!=this.dom;)s=s.parentNode;let l=s.getBoundingClientRect();o=(l.top+l.bottom)/2}else o=i.clientY;let a=e.lineBlockAtHeight(o-e.documentTop);t.domEventHandlers[r](e,a,i)&&i.preventDefault()});this.markers=W_(t.markers(e)),t.initialSpacer&&(this.spacer=new f5(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=W_(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let i=this.config.updateSpacer(this.spacer.markers[0],e);i!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[i])}let r=e.view.viewport;return!Mn.eq(this.markers,t,r.from,r.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class f5{constructor(e,t,r,i){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,r,i)}update(e,t,r,i){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=r&&(this.dom.style.marginTop=(this.above=r)?r+"px":""),XZ(this.markers,i)||this.setMarkers(e,i)}setMarkers(e,t){let r="cm-gutterElement",i=this.dom.firstChild;for(let s=0,o=0;;){let a=o,l=s<t.length?t[s++]:null,c=!1;if(l){let u=l.elementClass;u&&(r+=" "+u);for(let d=o;d<this.markers.length;d++)if(this.markers[d].compare(l)){a=d,c=!0;break}}else a=this.markers.length;for(;o<a;){let u=this.markers[o++];if(u.toDOM){u.destroy(i);let d=i.nextSibling;i.remove(),i=d}}if(!l)break;l.toDOM&&(c?i=i.nextSibling:this.dom.insertBefore(l.toDOM(e),i)),c&&o++}this.dom.className=r,this.markers=t}destroy(){this.setMarkers(null,[])}}function XZ(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++)if(!n[t].compare(e[t]))return!1;return!0}const zZ=ft.define(),YZ=ft.define(),Tu=ft.define({combine(n){return go(n,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let r=Object.assign({},e);for(let i in t){let s=r[i],o=t[i];r[i]=s?(a,l,c)=>s(a,l,c)||o(a,l,c):o}return r}})}});class P0 extends _l{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function x0(n,e){return n.state.facet(Tu).formatNumber(e,n.state)}const GZ=Mg.compute([Tu],n=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(zZ)},lineMarker(e,t,r){return r.some(i=>i.toDOM)?null:new P0(x0(e,e.state.doc.lineAt(t.from).number))},widgetMarker:(e,t,r)=>{for(let i of e.state.facet(YZ)){let s=i(e,t,r);if(s)return s}return null},lineMarkerChange:e=>e.startState.facet(Tu)!=e.state.facet(Tu),initialSpacer(e){return new P0(x0(e,z_(e.state.doc.lines)))},updateSpacer(e,t){let r=x0(t.view,z_(t.view.state.doc.lines));return r==e.number?e:new P0(r)},domEventHandlers:n.facet(Tu).domEventHandlers}));function HZ(n={}){return[Tu.of(n),VZ(),GZ]}function z_(n){let e=9;for(;e<n;)e=e*10+9;return e}const KZ=new class extends _l{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},JZ=$g.compute(["selection"],n=>{let e=[],t=-1;for(let r of n.selection.ranges){let i=n.doc.lineAt(r.head).from;i>t&&(t=i,e.push(KZ.range(i)))}return Mn.of(e)});function e8(){return JZ}const d5=1024;let t8=0;class Qs{constructor(e,t){this.from=e,this.to=t}}class en{constructor(e={}){this.id=t8++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=ti.match(e)),t=>{let r=e(t);return r===void 0?null:[this,r]}}}en.closedBy=new en({deserialize:n=>n.split(" ")});en.openedBy=new en({deserialize:n=>n.split(" ")});en.group=new en({deserialize:n=>n.split(" ")});en.isolate=new en({deserialize:n=>{if(n&&n!="rtl"&&n!="ltr"&&n!="auto")throw new RangeError("Invalid value for isolate: "+n);return n||"auto"}});en.contextHash=new en({perNode:!0});en.lookAhead=new en({perNode:!0});en.mounted=new en({perNode:!0});class Gd{constructor(e,t,r){this.tree=e,this.overlay=t,this.parser=r}static get(e){return e&&e.props&&e.props[en.mounted.id]}}const n8=Object.create(null);class ti{constructor(e,t,r,i=0){this.name=e,this.props=t,this.id=r,this.flags=i}static define(e){let t=e.props&&e.props.length?Object.create(null):n8,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new ti(e.name||"",t,e.id,r);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(i)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[s[0].id]=s[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(en.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let r in e)for(let i of r.split(" "))t[i]=e[r];return r=>{for(let i=r.prop(en.group),s=-1;s<(i?i.length:0);s++){let o=t[s<0?r.name:i[s]];if(o)return o}}}}ti.none=new ti("",Object.create(null),0,8);class vh{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let t=[];for(let r of this.types){let i=null;for(let s of e){let o=s(r);o&&(i||(i=Object.assign({},r.props)),i[o[0].id]=o[1])}t.push(i?new ti(r.name,i,r.id,r.flags):r)}return new vh(t)}}const Vp=new WeakMap,Y_=new WeakMap;var or;(function(n){n[n.ExcludeBuffers=1]="ExcludeBuffers",n[n.IncludeAnonymous=2]="IncludeAnonymous",n[n.IgnoreMounts=4]="IgnoreMounts",n[n.IgnoreOverlays=8]="IgnoreOverlays"})(or||(or={}));class Un{constructor(e,t,r,i,s){if(this.type=e,this.children=t,this.positions=r,this.length=i,this.props=null,s&&s.length){this.props=Object.create(null);for(let[o,a]of s)this.props[typeof o=="number"?o:o.id]=a}}toString(){let e=Gd.get(this);if(e&&!e.overlay)return e.tree.toString();let t="";for(let r of this.children){let i=r.toString();i&&(t&&(t+=","),t+=i)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?"("+t+")":""):t}cursor(e=0){return new cO(this.topNode,e)}cursorAt(e,t=0,r=0){let i=Vp.get(this)||this.topNode,s=new cO(i);return s.moveTo(e,t),Vp.set(this,s._tree),s}get topNode(){return new Ai(this,0,0,null)}resolve(e,t=0){let r=Hd(Vp.get(this)||this.topNode,e,t,!1);return Vp.set(this,r),r}resolveInner(e,t=0){let r=Hd(Y_.get(this)||this.topNode,e,t,!0);return Y_.set(this,r),r}resolveStack(e,t=0){return s8(this,e,t)}iterate(e){let{enter:t,leave:r,from:i=0,to:s=this.length}=e,o=e.mode||0,a=(o&or.IncludeAnonymous)>0;for(let l=this.cursor(o|or.IncludeAnonymous);;){let c=!1;if(l.from<=s&&l.to>=i&&(!a&&l.type.isAnonymous||t(l)!==!1)){if(l.firstChild())continue;c=!0}for(;c&&r&&(a||!l.type.isAnonymous)&&r(l),!l.nextSibling();){if(!l.parent())return;c=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:lk(ti.none,this.children,this.positions,0,this.children.length,0,this.length,(t,r,i)=>new Un(this.type,t,r,i,this.propValues),e.makeTree||((t,r,i)=>new Un(ti.none,t,r,i)))}static build(e){return o8(e)}}Un.empty=new Un(ti.none,[],[],0);class ok{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new ok(this.buffer,this.index)}}class El{constructor(e,t,r){this.buffer=e,this.length=t,this.set=r}get type(){return ti.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(",")}childString(e){let t=this.buffer[e],r=this.buffer[e+3],i=this.set.types[t],s=i.name;if(/\W/.test(s)&&!i.isError&&(s=JSON.stringify(s)),e+=4,r==e)return s;let o=[];for(;e<r;)o.push(this.childString(e)),e=this.buffer[e+3];return s+"("+o.join(",")+")"}findChild(e,t,r,i,s){let{buffer:o}=this,a=-1;for(let l=e;l!=t&&!(h5(s,i,o[l+1],o[l+2])&&(a=l,r>0));l=o[l+3]);return a}slice(e,t,r){let i=this.buffer,s=new Uint16Array(t-e),o=0;for(let a=e,l=0;a<t;){s[l++]=i[a++],s[l++]=i[a++]-r;let c=s[l++]=i[a++]-r;s[l++]=i[a++]-e,o=Math.max(o,c)}return new El(s,o,this.set)}}function h5(n,e,t,r){switch(n){case-2:return t<e;case-1:return r>=e&&t<e;case 0:return t<e&&r>e;case 1:return t<=e&&r>e;case 2:return r>e;case 4:return!0}}function Hd(n,e,t,r){for(var i;n.from==n.to||(t<1?n.from>=e:n.from>e)||(t>-1?n.to<=e:n.to<e);){let o=!r&&n instanceof Ai&&n.index<0?null:n.parent;if(!o)return n;n=o}let s=r?0:or.IgnoreOverlays;if(r)for(let o=n,a=o.parent;a;o=a,a=o.parent)o instanceof Ai&&o.index<0&&((i=a.enter(e,t,s))===null||i===void 0?void 0:i.from)!=o.from&&(n=a);for(;;){let o=n.enter(e,t,s);if(!o)return n;n=o}}class p5{cursor(e=0){return new cO(this,e)}getChild(e,t=null,r=null){let i=G_(this,e,t,r);return i.length?i[0]:null}getChildren(e,t=null,r=null){return G_(this,e,t,r)}resolve(e,t=0){return Hd(this,e,t,!1)}resolveInner(e,t=0){return Hd(this,e,t,!0)}matchContext(e){return B1(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),r=this;for(;t;){let i=t.lastChild;if(!i||i.to!=t.to)break;i.type.isError&&i.from==i.to?(r=t,t=i.prevSibling):t=i}return r}get node(){return this}get next(){return this.parent}}class Ai extends p5{constructor(e,t,r,i){super(),this._tree=e,this.from=t,this.index=r,this._parent=i}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,t,r,i,s=0){for(let o=this;;){for(let{children:a,positions:l}=o._tree,c=t>0?a.length:-1;e!=c;e+=t){let u=a[e],d=l[e]+o.from;if(h5(i,r,d,d+u.length)){if(u instanceof El){if(s&or.ExcludeBuffers)continue;let h=u.findChild(0,u.buffer.length,t,r-d,i);if(h>-1)return new Fo(new r8(o,u,e,d),null,h)}else if(s&or.IncludeAnonymous||!u.type.isAnonymous||ak(u)){let h;if(!(s&or.IgnoreMounts)&&(h=Gd.get(u))&&!h.overlay)return new Ai(h.tree,d,e,o);let m=new Ai(u,d,e,o);return s&or.IncludeAnonymous||!m.type.isAnonymous?m:m.nextChild(t<0?u.children.length-1:0,t,r,i)}}}if(s&or.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+t:e=t<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,t,r=0){let i;if(!(r&or.IgnoreOverlays)&&(i=Gd.get(this._tree))&&i.overlay){let s=e-this.from;for(let{from:o,to:a}of i.overlay)if((t>0?o<=s:o<s)&&(t<0?a>=s:a>s))return new Ai(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function G_(n,e,t,r){let i=n.cursor(),s=[];if(!i.firstChild())return s;if(t!=null){for(let o=!1;!o;)if(o=i.type.is(t),!i.nextSibling())return s}for(;;){if(r!=null&&i.type.is(r))return s;if(i.type.is(e)&&s.push(i.node),!i.nextSibling())return r==null?s:[]}}function B1(n,e,t=e.length-1){for(let r=n;t>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(e[t]&&e[t]!=r.name)return!1;t--}}return!0}class r8{constructor(e,t,r,i){this.parent=e,this.buffer=t,this.index=r,this.start=i}}class Fo extends p5{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,r){super(),this.context=e,this._parent=t,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}child(e,t,r){let{buffer:i}=this.context,s=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.context.start,r);return s<0?null:new Fo(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,t,r=0){if(r&or.ExcludeBuffers)return null;let{buffer:i}=this.context,s=i.findChild(this.index+4,i.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return s<0?null:new Fo(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new Fo(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new Fo(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:r}=this.context,i=this.index+4,s=r.buffer[this.index+3];if(s>i){let o=r.buffer[this.index+1];e.push(r.slice(i,s,o)),t.push(0)}return new Un(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function m5(n){if(!n.length)return null;let e=0,t=n[0];for(let s=1;s<n.length;s++){let o=n[s];(o.from>t.from||o.to<t.to)&&(t=o,e=s)}let r=t instanceof Ai&&t.index<0?null:t.parent,i=n.slice();return r?i[e]=r:i.splice(e,1),new i8(i,t)}class i8{constructor(e,t){this.heads=e,this.node=t}get next(){return m5(this.heads)}}function s8(n,e,t){let r=n.resolveInner(e,t),i=null;for(let s=r instanceof Ai?r:r.context.parent;s;s=s.parent)if(s.index<0){let o=s.parent;(i||(i=[r])).push(o.resolve(e,t)),s=o}else{let o=Gd.get(s.tree);if(o&&o.overlay&&o.overlay[0].from<=e&&o.overlay[o.overlay.length-1].to>=e){let a=new Ai(o.tree,o.overlay[0].from+s.from,-1,s);(i||(i=[r])).push(Hd(a,e,t,!1))}}return i?m5(i):r}class cO{get name(){return this.type.name}constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof Ai)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let r=e._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:r,buffer:i}=this.buffer;return this.type=t||i.set.types[i.buffer[e]],this.from=r+i.buffer[e+1],this.to=r+i.buffer[e+2],!0}yield(e){return e?e instanceof Ai?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,r){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,r,this.mode));let{buffer:i}=this.buffer,s=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.buffer.start,r);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,r=this.mode){return this.buffer?r&or.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&or.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&or.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,r=this.stack.length-1;if(e<0){let i=r<0?0:this.stack[r]+4;if(this.index!=i)return this.yieldBuf(t.findChild(i,this.index,-1,0,4))}else{let i=t.buffer[this.index+3];if(i<(r<0?t.buffer.length:t.buffer[this.stack[r]+3]))return this.yieldBuf(i)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,r,{buffer:i}=this;if(i){if(e>0){if(this.index<i.buffer.buffer.length)return!1}else for(let s=0;s<this.index;s++)if(i.buffer.buffer[s+3]<this.index)return!1;({index:t,parent:r}=i)}else({index:t,_parent:r}=this._tree);for(;r;{index:t,_parent:r}=r)if(t>-1)for(let s=t+e,o=e<0?-1:r._tree.children.length;s!=o;s+=e){let a=r._tree.children[s];if(this.mode&or.IncludeAnonymous||a instanceof El||!a.type.isAnonymous||ak(a))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,r=0;if(e&&e.context==this.buffer)e:for(let i=this.index,s=this.stack.length;s>=0;){for(let o=e;o;o=o._parent)if(o.index==i){if(i==this.index)return o;t=o,r=s+1;break e}i=this.stack[--s]}for(let i=r;i<this.stack.length;i++)t=new Fo(this.buffer,t,this.stack[i]);return this.bufferNode=new Fo(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let r=0;;){let i=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){r++;continue}this.type.isAnonymous||(i=!0)}for(;;){if(i&&t&&t(this),i=this.type.isAnonymous,!r)return;if(this.nextSibling())break;this.parent(),r--,i=!0}}}matchContext(e){if(!this.buffer)return B1(this.node.parent,e);let{buffer:t}=this.buffer,{types:r}=t.set;for(let i=e.length-1,s=this.stack.length-1;i>=0;s--){if(s<0)return B1(this._tree,e,i);let o=r[t.buffer[this.stack[s]]];if(!o.isAnonymous){if(e[i]&&e[i]!=o.name)return!1;i--}}return!0}}function ak(n){return n.children.some(e=>e instanceof El||!e.type.isAnonymous||ak(e))}function o8(n){var e;let{buffer:t,nodeSet:r,maxBufferLength:i=d5,reused:s=[],minRepeatType:o=r.types.length}=n,a=Array.isArray(t)?new ok(t,t.length):t,l=r.types,c=0,u=0;function d(x,A,M,Q,_,R){let{id:$,start:D,end:F,size:G}=a,ue=u,B=c;for(;G<0;)if(a.next(),G==-1){let H=s[$];M.push(H),Q.push(D-x);return}else if(G==-3){c=$;return}else if(G==-4){u=$;return}else throw new RangeError(`Unrecognized record size: ${G}`);let X=l[$],W,ee,re=D-x;if(F-D<=i&&(ee=y(a.pos-A,_))){let H=new Uint16Array(ee.size-ee.skip),se=a.pos-ee.size,J=H.length;for(;a.pos>se;)J=b(ee.start,H,J);W=new El(H,F-ee.start,r),re=ee.start-x}else{let H=a.pos-G;a.next();let se=[],J=[],oe=$>=o?$:-1,pe=0,Ee=F;for(;a.pos>H;)oe>=0&&a.id==oe&&a.size>=0?(a.end<=Ee-i&&(g(se,J,D,pe,a.end,Ee,oe,ue,B),pe=se.length,Ee=a.end),a.next()):R>2500?h(D,H,se,J):d(D,H,se,J,oe,R+1);if(oe>=0&&pe>0&&pe<se.length&&g(se,J,D,pe,D,Ee,oe,ue,B),se.reverse(),J.reverse(),oe>-1&&pe>0){let j=m(X,B);W=lk(X,se,J,0,se.length,0,F-D,j,j)}else W=O(X,se,J,F-D,ue-F,B)}M.push(W),Q.push(re)}function h(x,A,M,Q){let _=[],R=0,$=-1;for(;a.pos>A;){let{id:D,start:F,end:G,size:ue}=a;if(ue>4)a.next();else{if($>-1&&F<$)break;$<0&&($=G-i),_.push(D,F,G),R++,a.next()}}if(R){let D=new Uint16Array(R*4),F=_[_.length-2];for(let G=_.length-3,ue=0;G>=0;G-=3)D[ue++]=_[G],D[ue++]=_[G+1]-F,D[ue++]=_[G+2]-F,D[ue++]=ue;M.push(new El(D,_[2]-F,r)),Q.push(F-x)}}function m(x,A){return(M,Q,_)=>{let R=0,$=M.length-1,D,F;if($>=0&&(D=M[$])instanceof Un){if(!$&&D.type==x&&D.length==_)return D;(F=D.prop(en.lookAhead))&&(R=Q[$]+D.length+F)}return O(x,M,Q,_,R,A)}}function g(x,A,M,Q,_,R,$,D,F){let G=[],ue=[];for(;x.length>Q;)G.push(x.pop()),ue.push(A.pop()+M-_);x.push(O(r.types[$],G,ue,R-_,D-R,F)),A.push(_-M)}function O(x,A,M,Q,_,R,$){if(R){let D=[en.contextHash,R];$=$?[D].concat($):[D]}if(_>25){let D=[en.lookAhead,_];$=$?[D].concat($):[D]}return new Un(x,A,M,Q,$)}function y(x,A){let M=a.fork(),Q=0,_=0,R=0,$=M.end-i,D={size:0,start:0,skip:0};e:for(let F=M.pos-x;M.pos>F;){let G=M.size;if(M.id==A&&G>=0){D.size=Q,D.start=_,D.skip=R,R+=4,Q+=4,M.next();continue}let ue=M.pos-G;if(G<0||ue<F||M.start<$)break;let B=M.id>=o?4:0,X=M.start;for(M.next();M.pos>ue;){if(M.size<0)if(M.size==-3)B+=4;else break e;else M.id>=o&&(B+=4);M.next()}_=X,Q+=G,R+=B}return(A<0||Q==x)&&(D.size=Q,D.start=_,D.skip=R),D.size>4?D:void 0}function b(x,A,M){let{id:Q,start:_,end:R,size:$}=a;if(a.next(),$>=0&&Q<o){let D=M;if($>4){let F=a.pos-($-4);for(;a.pos>F;)M=b(x,A,M)}A[--M]=D,A[--M]=R-x,A[--M]=_-x,A[--M]=Q}else $==-3?c=Q:$==-4&&(u=Q);return M}let S=[],P=[];for(;a.pos>0;)d(n.start||0,n.bufferStart||0,S,P,-1,0);let k=(e=n.length)!==null&&e!==void 0?e:S.length?P[0]+S[0].length:0;return new Un(l[n.topID],S.reverse(),P.reverse(),k)}const H_=new WeakMap;function Qg(n,e){if(!n.isAnonymous||e instanceof El||e.type!=n)return 1;let t=H_.get(e);if(t==null){t=1;for(let r of e.children){if(r.type!=n||!(r instanceof Un)){t=1;break}t+=Qg(n,r)}H_.set(e,t)}return t}function lk(n,e,t,r,i,s,o,a,l){let c=0;for(let g=r;g<i;g++)c+=Qg(n,e[g]);let u=Math.ceil(c*1.5/8),d=[],h=[];function m(g,O,y,b,S){for(let P=y;P<b;){let k=P,x=O[P],A=Qg(n,g[P]);for(P++;P<b;P++){let M=Qg(n,g[P]);if(A+M>=u)break;A+=M}if(P==k+1){if(A>u){let M=g[k];m(M.children,M.positions,0,M.children.length,O[k]+S);continue}d.push(g[k])}else{let M=O[P-1]+g[P-1].length-x;d.push(lk(n,g,O,k,P,x,M,null,l))}h.push(x+S-s)}}return m(e,t,r,i,0),(a||l)(d,h,o)}class g5{constructor(){this.map=new WeakMap}setBuffer(e,t,r){let i=this.map.get(e);i||this.map.set(e,i=new Map),i.set(t,r)}getBuffer(e,t){let r=this.map.get(e);return r&&r.get(t)}set(e,t){e instanceof Fo?this.setBuffer(e.context.buffer,e.index,t):e instanceof Ai&&this.map.set(e.tree,t)}get(e){return e instanceof Fo?this.getBuffer(e.context.buffer,e.index):e instanceof Ai?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class Sa{constructor(e,t,r,i,s=!1,o=!1){this.from=e,this.to=t,this.tree=r,this.offset=i,this.open=(s?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],r=!1){let i=[new Sa(0,e.length,e,0,!1,r)];for(let s of t)s.to>e.length&&i.push(s);return i}static applyChanges(e,t,r=128){if(!t.length)return e;let i=[],s=1,o=e.length?e[0]:null;for(let a=0,l=0,c=0;;a++){let u=a<t.length?t[a]:null,d=u?u.fromA:1e9;if(d-l>=r)for(;o&&o.from<d;){let h=o;if(l>=h.from||d<=h.to||c){let m=Math.max(h.from,l)-c,g=Math.min(h.to,d)-c;h=m>=g?null:new Sa(m,g,h.tree,h.offset+c,a>0,!!u)}if(h&&i.push(h),o.to>d)break;o=s<e.length?e[s++]:null}if(!u)break;l=u.toA,c=u.toA-u.toB}return i}}class ck{startParse(e,t,r){return typeof e=="string"&&(e=new a8(e)),r=r?r.length?r.map(i=>new Qs(i.from,i.to)):[new Qs(0,0)]:[new Qs(0,e.length)],this.createParse(e,t||[],r)}parse(e,t,r){let i=this.startParse(e,t,r);for(;;){let s=i.advance();if(s)return s}}}class a8{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}function uk(n){return(e,t,r,i)=>new c8(e,n,t,r,i)}class K_{constructor(e,t,r,i,s){this.parser=e,this.parse=t,this.overlay=r,this.target=i,this.from=s}}function J_(n){if(!n.length||n.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(n))}class l8{constructor(e,t,r,i,s,o,a){this.parser=e,this.predicate=t,this.mounts=r,this.index=i,this.start=s,this.target=o,this.prev=a,this.depth=0,this.ranges=[]}}const F1=new en({perNode:!0});class c8{constructor(e,t,r,i,s){this.nest=t,this.input=r,this.fragments=i,this.ranges=s,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let r=this.baseParse.advance();if(!r)return null;if(this.baseParse=null,this.baseTree=r,this.startInner(),this.stoppedAt!=null)for(let i of this.inner)i.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let r=this.baseTree;return this.stoppedAt!=null&&(r=new Un(r.type,r.children,r.positions,r.length,r.propValues.concat([[F1,this.stoppedAt]]))),r}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let r=Object.assign(Object.create(null),e.target.props);r[en.mounted.id]=new Gd(t,e.overlay,e.parser),e.target.props=r}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;t<this.inner.length;t++)this.inner[t].from<e&&(e=Math.min(e,this.inner[t].parse.parsedPos));return e}stopAt(e){if(this.stoppedAt=e,this.baseParse)this.baseParse.stopAt(e);else for(let t=this.innerDone;t<this.inner.length;t++)this.inner[t].parse.stopAt(e)}startInner(){let e=new d8(this.fragments),t=null,r=null,i=new cO(new Ai(this.baseTree,this.ranges[0].from,0,null),or.IncludeAnonymous|or.IgnoreMounts);e:for(let s,o;;){let a=!0,l;if(this.stoppedAt!=null&&i.from>=this.stoppedAt)a=!1;else if(e.hasNode(i)){if(t){let c=t.mounts.find(u=>u.frag.from<=i.from&&u.frag.to>=i.to&&u.mount.overlay);if(c)for(let u of c.mount.overlay){let d=u.from+c.pos,h=u.to+c.pos;d>=i.from&&h<=i.to&&!t.ranges.some(m=>m.from<h&&m.to>d)&&t.ranges.push({from:d,to:h})}}a=!1}else if(r&&(o=u8(r.ranges,i.from,i.to)))a=o!=2;else if(!i.type.isAnonymous&&(s=this.nest(i,this.input))&&(i.from<i.to||!s.overlay)){i.tree||f8(i);let c=e.findMounts(i.from,s.parser);if(typeof s.overlay=="function")t=new l8(s.parser,s.overlay,c,this.inner.length,i.from,i.tree,t);else{let u=nE(this.ranges,s.overlay||(i.from<i.to?[new Qs(i.from,i.to)]:[]));u.length&&J_(u),(u.length||!s.overlay)&&this.inner.push(new K_(s.parser,u.length?s.parser.startParse(this.input,rE(c,u),u):s.parser.startParse(""),s.overlay?s.overlay.map(d=>new Qs(d.from-i.from,d.to-i.from)):null,i.tree,u.length?u[0].from:i.from)),s.overlay?u.length&&(r={ranges:u,depth:0,prev:r}):a=!1}}else if(t&&(l=t.predicate(i))&&(l===!0&&(l=new Qs(i.from,i.to)),l.from<l.to)){let c=t.ranges.length-1;c>=0&&t.ranges[c].to==l.from?t.ranges[c]={from:t.ranges[c].from,to:l.to}:t.ranges.push(l)}if(a&&i.firstChild())t&&t.depth++,r&&r.depth++;else for(;!i.nextSibling();){if(!i.parent())break e;if(t&&!--t.depth){let c=nE(this.ranges,t.ranges);c.length&&(J_(c),this.inner.splice(t.index,0,new K_(t.parser,t.parser.startParse(this.input,rE(t.mounts,c),c),t.ranges.map(u=>new Qs(u.from-t.start,u.to-t.start)),t.target,c[0].from))),t=t.prev}r&&!--r.depth&&(r=r.prev)}}}}function u8(n,e,t){for(let r of n){if(r.from>=t)break;if(r.to>e)return r.from<=e&&r.to>=t?2:1}return 0}function eE(n,e,t,r,i,s){if(e<t){let o=n.buffer[e+1];r.push(n.slice(e,t,o)),i.push(o-s)}}function f8(n){let{node:e}=n,t=[],r=e.context.buffer;do t.push(n.index),n.parent();while(!n.tree);let i=n.tree,s=i.children.indexOf(r),o=i.children[s],a=o.buffer,l=[s];function c(u,d,h,m,g,O){let y=t[O],b=[],S=[];eE(o,u,y,b,S,m);let P=a[y+1],k=a[y+2];l.push(b.length);let x=O?c(y+4,a[y+3],o.set.types[a[y]],P,k-P,O-1):e.toTree();return b.push(x),S.push(P-m),eE(o,a[y+3],d,b,S,m),new Un(h,b,S,g)}i.children[s]=c(0,a.length,ti.none,0,o.length,t.length-1);for(let u of l){let d=n.tree.children[u],h=n.tree.positions[u];n.yield(new Ai(d,h+n.from,u,n._tree))}}class tE{constructor(e,t){this.offset=t,this.done=!1,this.cursor=e.cursor(or.IncludeAnonymous|or.IgnoreMounts)}moveTo(e){let{cursor:t}=this,r=e-this.offset;for(;!this.done&&t.from<r;)t.to>=e&&t.enter(r,1,or.IgnoreOverlays|or.ExcludeBuffers)||t.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(t.children.length&&t.positions[0]==0&&t.children[0]instanceof Un)t=t.children[0];else break}return!1}}let d8=class{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let r=this.curFrag=e[0];this.curTo=(t=r.tree.prop(F1))!==null&&t!==void 0?t:r.to,this.inner=new tE(r.tree,-r.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let t=this.curFrag=this.fragments[this.fragI];this.curTo=(e=t.tree.prop(F1))!==null&&e!==void 0?e:t.to,this.inner=new tE(t.tree,-t.offset)}}findMounts(e,t){var r;let i=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let s=this.inner.cursor.node;s;s=s.parent){let o=(r=s.tree)===null||r===void 0?void 0:r.prop(en.mounted);if(o&&o.parser==t)for(let a=this.fragI;a<this.fragments.length;a++){let l=this.fragments[a];if(l.from>=s.to)break;l.tree==this.curFrag.tree&&i.push({frag:l,pos:s.from-l.offset,mount:o})}}}return i}};function nE(n,e){let t=null,r=e;for(let i=1,s=0;i<n.length;i++){let o=n[i-1].to,a=n[i].from;for(;s<r.length;s++){let l=r[s];if(l.from>=a)break;l.to<=o||(t||(r=t=e.slice()),l.from<o?(t[s]=new Qs(l.from,o),l.to>a&&t.splice(s+1,0,new Qs(a,l.to))):l.to>a?t[s--]=new Qs(a,l.to):t.splice(s--,1))}}return r}function h8(n,e,t,r){let i=0,s=0,o=!1,a=!1,l=-1e9,c=[];for(;;){let u=i==n.length?1e9:o?n[i].to:n[i].from,d=s==e.length?1e9:a?e[s].to:e[s].from;if(o!=a){let h=Math.max(l,t),m=Math.min(u,d,r);h<m&&c.push(new Qs(h,m))}if(l=Math.min(u,d),l==1e9)break;u==l&&(o?(o=!1,i++):o=!0),d==l&&(a?(a=!1,s++):a=!0)}return c}function rE(n,e){let t=[];for(let{pos:r,mount:i,frag:s}of n){let o=r+(i.overlay?i.overlay[0].from:0),a=o+i.tree.length,l=Math.max(s.from,o),c=Math.min(s.to,a);if(i.overlay){let u=i.overlay.map(h=>new Qs(h.from+r,h.to+r)),d=h8(e,u,l,c);for(let h=0,m=l;;h++){let g=h==d.length,O=g?c:d[h].from;if(O>m&&t.push(new Sa(m,O,i.tree,-o,s.from>=m||s.openStart,s.to<=O||s.openEnd)),g)break;m=d[h].to}}else t.push(new Sa(l,c,i.tree,-o,s.from>=o||s.openStart,s.to<=a||s.openEnd))}return t}let p8=0;class Os{constructor(e,t,r,i){this.name=e,this.set=t,this.base=r,this.modified=i,this.id=p8++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){let r=typeof e=="string"?e:"?";if(e instanceof Os&&(t=e),t!=null&&t.base)throw new Error("Can not derive from a modified tag");let i=new Os(r,[],null,[]);if(i.set.push(i),t)for(let s of t.set)i.set.push(s);return i}static defineModifier(e){let t=new uO(e);return r=>r.modified.indexOf(t)>-1?r:uO.get(r.base||r,r.modified.concat(t).sort((i,s)=>i.id-s.id))}}let m8=0;class uO{constructor(e){this.name=e,this.instances=[],this.id=m8++}static get(e,t){if(!t.length)return e;let r=t[0].instances.find(a=>a.base==e&&g8(t,a.modified));if(r)return r;let i=[],s=new Os(e.name,i,e,t);for(let a of t)a.instances.push(s);let o=O8(t);for(let a of e.set)if(!a.modified.length)for(let l of o)i.push(uO.get(a,l));return s}}function g8(n,e){return n.length==e.length&&n.every((t,r)=>t==e[r])}function O8(n){let e=[[]];for(let t=0;t<n.length;t++)for(let r=0,i=e.length;r<i;r++)e.push(e[r].concat(n[t]));return e.sort((t,r)=>r.length-t.length)}function Dl(n){let e=Object.create(null);for(let t in n){let r=n[t];Array.isArray(r)||(r=[r]);for(let i of t.split(" "))if(i){let s=[],o=2,a=i;for(let d=0;;){if(a=="..."&&d>0&&d+3==i.length){o=1;break}let h=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!h)throw new RangeError("Invalid path: "+i);if(s.push(h[0]=="*"?"":h[0][0]=='"'?JSON.parse(h[0]):h[0]),d+=h[0].length,d==i.length)break;let m=i[d++];if(d==i.length&&m=="!"){o=0;break}if(m!="/")throw new RangeError("Invalid path: "+i);a=i.slice(d)}let l=s.length-1,c=s[l];if(!c)throw new RangeError("Invalid path: "+i);let u=new fO(r,o,l>0?s.slice(0,l):null);e[c]=u.sort(e[c])}}return O5.add(e)}const O5=new en;class fO{constructor(e,t,r,i){this.tags=e,this.mode=t,this.context=r,this.next=i}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}fO.empty=new fO([],2,null);function v5(n,e){let t=Object.create(null);for(let s of n)if(!Array.isArray(s.tag))t[s.tag.id]=s.class;else for(let o of s.tag)t[o.id]=s.class;let{scope:r,all:i=null}=e||{};return{style:s=>{let o=i;for(let a of s)for(let l of a.set){let c=t[l.id];if(c){o=o?o+" "+c:c;break}}return o},scope:r}}function v8(n,e){let t=null;for(let r of n){let i=r.style(e);i&&(t=t?t+" "+i:i)}return t}function y8(n,e,t,r=0,i=n.length){let s=new b8(r,Array.isArray(e)?e:[e],t);s.highlightRange(n.cursor(),r,i,"",s.highlighters),s.flush(i)}class b8{constructor(e,t,r){this.at=e,this.highlighters=t,this.span=r,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,r,i,s){let{type:o,from:a,to:l}=e;if(a>=r||l<=t)return;o.isTop&&(s=this.highlighters.filter(m=>!m.scope||m.scope(o)));let c=i,u=S8(e)||fO.empty,d=v8(s,u.tags);if(d&&(c&&(c+=" "),c+=d,u.mode==1&&(i+=(i?" ":"")+d)),this.startSpan(Math.max(t,a),c),u.opaque)return;let h=e.tree&&e.tree.prop(en.mounted);if(h&&h.overlay){let m=e.node.enter(h.overlay[0].from+a,1),g=this.highlighters.filter(y=>!y.scope||y.scope(h.tree.type)),O=e.firstChild();for(let y=0,b=a;;y++){let S=y<h.overlay.length?h.overlay[y]:null,P=S?S.from+a:l,k=Math.max(t,b),x=Math.min(r,P);if(k<x&&O)for(;e.from<x&&(this.highlightRange(e,k,x,i,s),this.startSpan(Math.min(x,e.to),c),!(e.to>=P||!e.nextSibling())););if(!S||P>r)break;b=S.to+a,b>t&&(this.highlightRange(m.cursor(),Math.max(t,S.from+a),Math.min(r,b),"",g),this.startSpan(Math.min(r,b),c))}O&&e.parent()}else if(e.firstChild()){h&&(i="");do if(!(e.to<=t)){if(e.from>=r)break;this.highlightRange(e,t,r,i,s),this.startSpan(Math.min(r,e.to),c)}while(e.nextSibling());e.parent()}}}function S8(n){let e=n.type.prop(O5);for(;e&&e.context&&!n.matchContext(e.context);)e=e.next;return e||null}const st=Os.define,Zp=st(),ol=st(),iE=st(ol),sE=st(ol),al=st(),Wp=st(al),T0=st(al),_o=st(),rc=st(_o),xo=st(),To=st(),V1=st(),Kf=st(V1),Xp=st(),T={comment:Zp,lineComment:st(Zp),blockComment:st(Zp),docComment:st(Zp),name:ol,variableName:st(ol),typeName:iE,tagName:st(iE),propertyName:sE,attributeName:st(sE),className:st(ol),labelName:st(ol),namespace:st(ol),macroName:st(ol),literal:al,string:Wp,docString:st(Wp),character:st(Wp),attributeValue:st(Wp),number:T0,integer:st(T0),float:st(T0),bool:st(al),regexp:st(al),escape:st(al),color:st(al),url:st(al),keyword:xo,self:st(xo),null:st(xo),atom:st(xo),unit:st(xo),modifier:st(xo),operatorKeyword:st(xo),controlKeyword:st(xo),definitionKeyword:st(xo),moduleKeyword:st(xo),operator:To,derefOperator:st(To),arithmeticOperator:st(To),logicOperator:st(To),bitwiseOperator:st(To),compareOperator:st(To),updateOperator:st(To),definitionOperator:st(To),typeOperator:st(To),controlOperator:st(To),punctuation:V1,separator:st(V1),bracket:Kf,angleBracket:st(Kf),squareBracket:st(Kf),paren:st(Kf),brace:st(Kf),content:_o,heading:rc,heading1:st(rc),heading2:st(rc),heading3:st(rc),heading4:st(rc),heading5:st(rc),heading6:st(rc),contentSeparator:st(_o),list:st(_o),quote:st(_o),emphasis:st(_o),strong:st(_o),link:st(_o),monospace:st(_o),strikethrough:st(_o),inserted:st(),deleted:st(),changed:st(),invalid:st(),meta:Xp,documentMeta:st(Xp),annotation:st(Xp),processingInstruction:st(Xp),definition:Os.defineModifier("definition"),constant:Os.defineModifier("constant"),function:Os.defineModifier("function"),standard:Os.defineModifier("standard"),local:Os.defineModifier("local"),special:Os.defineModifier("special")};for(let n in T){let e=T[n];e instanceof Os&&(e.name=n)}v5([{tag:T.link,class:"tok-link"},{tag:T.heading,class:"tok-heading"},{tag:T.emphasis,class:"tok-emphasis"},{tag:T.strong,class:"tok-strong"},{tag:T.keyword,class:"tok-keyword"},{tag:T.atom,class:"tok-atom"},{tag:T.bool,class:"tok-bool"},{tag:T.url,class:"tok-url"},{tag:T.labelName,class:"tok-labelName"},{tag:T.inserted,class:"tok-inserted"},{tag:T.deleted,class:"tok-deleted"},{tag:T.literal,class:"tok-literal"},{tag:T.string,class:"tok-string"},{tag:T.number,class:"tok-number"},{tag:[T.regexp,T.escape,T.special(T.string)],class:"tok-string2"},{tag:T.variableName,class:"tok-variableName"},{tag:T.local(T.variableName),class:"tok-variableName tok-local"},{tag:T.definition(T.variableName),class:"tok-variableName tok-definition"},{tag:T.special(T.variableName),class:"tok-variableName2"},{tag:T.definition(T.propertyName),class:"tok-propertyName tok-definition"},{tag:T.typeName,class:"tok-typeName"},{tag:T.namespace,class:"tok-namespace"},{tag:T.className,class:"tok-className"},{tag:T.macroName,class:"tok-macroName"},{tag:T.propertyName,class:"tok-propertyName"},{tag:T.operator,class:"tok-operator"},{tag:T.comment,class:"tok-comment"},{tag:T.meta,class:"tok-meta"},{tag:T.invalid,class:"tok-invalid"},{tag:T.punctuation,class:"tok-punctuation"}]);var C0;const Oc=new en;function fk(n){return ft.define({combine:n?e=>e.concat(n):void 0})}const dk=new en;class Ds{constructor(e,t,r=[],i=""){this.data=e,this.name=i,Cn.prototype.hasOwnProperty("tree")||Object.defineProperty(Cn.prototype,"tree",{get(){return pr(this)}}),this.parser=t,this.extension=[Ju.of(this),Cn.languageData.of((s,o,a)=>{let l=oE(s,o,a),c=l.type.prop(Oc);if(!c)return[];let u=s.facet(c),d=l.type.prop(dk);if(d){let h=l.resolve(o-l.from,a);for(let m of d)if(m.test(h,s)){let g=s.facet(m.facet);return m.type=="replace"?g:g.concat(u)}}return u})].concat(r)}isActiveAt(e,t,r=-1){return oE(e,t,r).type.prop(Oc)==this.data}findRegions(e){let t=e.facet(Ju);if((t==null?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let r=[],i=(s,o)=>{if(s.prop(Oc)==this.data){r.push({from:o,to:o+s.length});return}let a=s.prop(en.mounted);if(a){if(a.tree.prop(Oc)==this.data){if(a.overlay)for(let l of a.overlay)r.push({from:l.from+o,to:l.to+o});else r.push({from:o,to:o+s.length});return}else if(a.overlay){let l=r.length;if(i(a.tree,a.overlay[0].from+o),r.length>l)return}}for(let l=0;l<s.children.length;l++){let c=s.children[l];c instanceof Un&&i(c,s.positions[l]+o)}};return i(pr(e),0),r}get allowsNesting(){return!0}}Ds.setState=Yt.define();function oE(n,e,t){let r=n.facet(Ju),i=pr(n).topNode;if(!r||r.allowsNesting)for(let s=i;s;s=s.enter(e,t,or.ExcludeBuffers))s.type.isTop&&(i=s);return i}class Rl extends Ds{constructor(e,t,r){super(e,t,[],r),this.parser=t}static define(e){let t=fk(e.languageData);return new Rl(t,e.parser.configure({props:[Oc.add(r=>r.isTop?t:void 0)]}),e.name)}configure(e,t){return new Rl(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function pr(n){let e=n.field(Ds.state,!1);return e?e.tree:Un.empty}class w8{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let r=this.cursorPos-this.string.length;return e<r||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-r,t-r)}}let Jf=null;class Kd{constructor(e,t,r=[],i,s,o,a,l){this.parser=e,this.state=t,this.fragments=r,this.tree=i,this.treeLen=s,this.viewport=o,this.skipped=a,this.scheduleOn=l,this.parse=null,this.tempSkipped=[]}static create(e,t,r){return new Kd(e,t,[],Un.empty,0,r,[],null)}startParse(){return this.parser.startParse(new w8(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=Un.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof e=="number"){let i=Date.now()+e;e=()=>Date.now()>i}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let i=this.parse.advance();if(i)if(this.fragments=this.withoutTempSkipped(Sa.addTree(i,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(r=this.parse.stoppedAt)!==null&&r!==void 0?r:this.state.doc.length,this.tree=i,this.parse=null,this.treeLen<(t??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(Sa.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=Jf;Jf=this;try{return e()}finally{Jf=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=aE(e,t.from,t.to);return e}changes(e,t){let{fragments:r,tree:i,treeLen:s,viewport:o,skipped:a}=this;if(this.takeTree(),!e.empty){let l=[];if(e.iterChangedRanges((c,u,d,h)=>l.push({fromA:c,toA:u,fromB:d,toB:h})),r=Sa.applyChanges(r,l),i=Un.empty,s=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){a=[];for(let c of this.skipped){let u=e.mapPos(c.from,1),d=e.mapPos(c.to,-1);u<d&&a.push({from:u,to:d})}}}return new Kd(this.parser,t,r,i,s,o,a,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let r=0;r<this.skipped.length;r++){let{from:i,to:s}=this.skipped[r];i<e.to&&s>e.from&&(this.fragments=aE(this.fragments,i,s),this.skipped.splice(r--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends ck{createParse(t,r,i){let s=i[0].from,o=i[i.length-1].to;return{parsedPos:s,advance(){let l=Jf;if(l){for(let c of i)l.tempSkipped.push(c);e&&(l.scheduleOn=l.scheduleOn?Promise.all([l.scheduleOn,e]):e)}return this.parsedPos=o,new Un(ti.none,[],[],o-s)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return Jf}}function aE(n,e,t){return Sa.applyChanges(n,[{fromA:e,toA:t,fromB:e,toB:t}])}class Ku{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),r=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,r)||t.takeTree(),new Ku(t)}static init(e){let t=Math.min(3e3,e.doc.length),r=Kd.create(e.facet(Ju).parser,e,{from:0,to:t});return r.work(20,t)||r.takeTree(),new Ku(r)}}Ds.state=Zr.define({create:Ku.init,update(n,e){for(let t of e.effects)if(t.is(Ds.setState))return t.value;return e.startState.facet(Ju)!=e.state.facet(Ju)?Ku.init(e.state):n.apply(e)}});let y5=n=>{let e=setTimeout(()=>n(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(y5=n=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(n,{timeout:400})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const _0=typeof navigator<"u"&&(!((C0=navigator.scheduling)===null||C0===void 0)&&C0.isInputPending)?()=>navigator.scheduling.isInputPending():null,k8=Xn.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(Ds.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(Ds.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=y5(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:r,viewport:{to:i}}=this.view,s=r.field(Ds.state);if(s.tree==s.context.tree&&s.context.isDone(i+1e5))return;let o=Date.now()+Math.min(this.chunkBudget,100,e&&!_0?Math.max(25,e.timeRemaining()-5):1e9),a=s.context.treeLen<i&&r.doc.length>i+1e3,l=s.context.work(()=>_0&&_0()||Date.now()>o,i+(a?0:1e5));this.chunkBudget-=Date.now()-t,(l||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:Ds.setState.of(new Ku(s.context))})),this.chunkBudget>0&&!(l&&!a)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>is(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Ju=ft.define({combine(n){return n.length?n[0]:null},enables:n=>[Ds.state,k8,et.contentAttributes.compute([n],e=>{let t=e.facet(n);return t&&t.name?{"data-language":t.name}:{}})]});class Ec{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}class dO{constructor(e,t,r,i,s,o=void 0){this.name=e,this.alias=t,this.extensions=r,this.filename=i,this.loadFunc=s,this.support=o,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(e=>this.support=e,e=>{throw this.loading=null,e}))}static of(e){let{load:t,support:r}=e;if(!t){if(!r)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");t=()=>Promise.resolve(r)}return new dO(e.name,(e.alias||[]).concat(e.name).map(i=>i.toLowerCase()),e.extensions||[],e.filename,t,r)}static matchFilename(e,t){for(let i of e)if(i.filename&&i.filename.test(t))return i;let r=/\.([^.]+)$/.exec(t);if(r){for(let i of e)if(i.extensions.indexOf(r[1])>-1)return i}return null}static matchLanguageName(e,t,r=!0){t=t.toLowerCase();for(let i of e)if(i.alias.some(s=>s==t))return i;if(r)for(let i of e)for(let s of i.alias){let o=t.indexOf(s);if(o>-1&&(s.length>2||!/\w/.test(t[o-1])&&!/\w/.test(t[o+s.length])))return i}return null}}const P8=ft.define(),yh=ft.define({combine:n=>{if(!n.length)return" ";let e=n[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(n[0]));return e}});function ef(n){let e=n.facet(yh);return e.charCodeAt(0)==9?n.tabSize*e.length:e.length}function hO(n,e){let t="",r=n.tabSize,i=n.facet(yh)[0];if(i==" "){for(;e>=r;)t+=" ",e-=r;i=" "}for(let s=0;s<e;s++)t+=i;return t}function b5(n,e){n instanceof Cn&&(n=new hk(n));for(let r of n.state.facet(P8)){let i=r(n,e);if(i!==void 0)return i}let t=pr(n.state);return t.length>=e?x8(n,t,e):null}class hk{constructor(e,t={}){this.state=e,this.options=t,this.unit=ef(e)}lineAt(e,t=1){let r=this.state.doc.lineAt(e),{simulateBreak:i,simulateDoubleBreak:s}=this.options;return i!=null&&i>=r.from&&i<=r.to?s&&i==e?{text:"",from:e}:(t<0?i<e:i<=e)?{text:r.text.slice(i-r.from),from:i}:{text:r.text.slice(0,i-r.from),from:r.from}:r}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:r,from:i}=this.lineAt(e,t);return r.slice(e-i,Math.min(r.length,e+100-i))}column(e,t=1){let{text:r,from:i}=this.lineAt(e,t),s=this.countColumn(r,e-i),o=this.options.overrideIndentation?this.options.overrideIndentation(i):-1;return o>-1&&(s+=o-this.countColumn(r,r.search(/\S|$/))),s}countColumn(e,t=e.length){return fo(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:r,from:i}=this.lineAt(e,t),s=this.options.overrideIndentation;if(s){let o=s(i);if(o>-1)return o}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const $c=new en;function x8(n,e,t){let r=e.resolveStack(t),i=e.resolveInner(t,-1).resolve(t,0).enterUnfinishedNodesBefore(t);if(i!=r.node){let s=[];for(let o=i;o&&!(o.from==r.node.from&&o.type==r.node.type);o=o.parent)s.push(o);for(let o=s.length-1;o>=0;o--)r={node:s[o],next:r}}return S5(r,n,t)}function S5(n,e,t){for(let r=n;r;r=r.next){let i=C8(r.node);if(i)return i(pk.create(e,t,r))}return 0}function T8(n){return n.pos==n.options.simulateBreak&&n.options.simulateDoubleBreak}function C8(n){let e=n.type.prop($c);if(e)return e;let t=n.firstChild,r;if(t&&(r=t.type.prop(en.closedBy))){let i=n.lastChild,s=i&&r.indexOf(i.name)>-1;return o=>w5(o,!0,1,void 0,s&&!T8(o)?i.from:void 0)}return n.parent==null?_8:null}function _8(){return 0}class pk extends hk{constructor(e,t,r){super(e.state,e.options),this.base=e,this.pos=t,this.context=r}get node(){return this.context.node}static create(e,t,r){return new pk(e,t,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let r=e.resolve(t.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(E8(r,e))break;t=this.state.doc.lineAt(r.from)}return this.lineIndent(t.from)}continue(){return S5(this.context.next,this.base,this.pos)}}function E8(n,e){for(let t=e;t;t=t.parent)if(n==t)return!0;return!1}function R8(n){let e=n.node,t=e.childAfter(e.from),r=e.lastChild;if(!t)return null;let i=n.options.simulateBreak,s=n.state.doc.lineAt(t.from),o=i==null||i<=s.from?s.to:Math.min(s.to,i);for(let a=t.to;;){let l=e.childAfter(a);if(!l||l==r)return null;if(!l.type.isSkipped){if(l.from>=o)return null;let c=/^ */.exec(s.text.slice(t.to-s.from))[0].length;return{from:t.from,to:t.to+c}}a=l.to}}function A8({closing:n,align:e=!0,units:t=1}){return r=>w5(r,e,t,n)}function w5(n,e,t,r,i){let s=n.textAfter,o=s.match(/^\s*/)[0].length,a=r&&s.slice(o,o+r.length)==r||i==n.pos+o,l=e?R8(n):null;return l?a?n.column(l.from):n.column(l.to):n.baseIndent+(a?0:n.unit*t)}const $8=n=>n.baseIndent;function Nu({except:n,units:e=1}={}){return t=>{let r=n&&n.test(t.textAfter);return t.baseIndent+(r?0:e*t.unit)}}const M8=200;function Q8(){return Cn.transactionFilter.of(n=>{if(!n.docChanged||!n.isUserEvent("input.type")&&!n.isUserEvent("input.complete"))return n;let e=n.startState.languageDataAt("indentOnInput",n.startState.selection.main.head);if(!e.length)return n;let t=n.newDoc,{head:r}=n.newSelection.main,i=t.lineAt(r);if(r>i.from+M8)return n;let s=t.sliceString(i.from,r);if(!e.some(c=>c.test(s)))return n;let{state:o}=n,a=-1,l=[];for(let{head:c}of o.selection.ranges){let u=o.doc.lineAt(c);if(u.from==a)continue;a=u.from;let d=b5(o,u.from);if(d==null)continue;let h=/^\s*/.exec(u.text)[0],m=hO(o,d);h!=m&&l.push({from:u.from,to:u.from+h.length,insert:m})}return l.length?[n,{changes:l,sequential:!0}]:n})}const k5=ft.define(),Il=new en;function mk(n){let e=n.firstChild,t=n.lastChild;return e&&e.to<t.from?{from:e.to,to:t.type.isError?n.to:t.from}:null}function D8(n,e,t){let r=pr(n);if(r.length<t)return null;let i=r.resolveStack(t,1),s=null;for(let o=i;o;o=o.next){let a=o.node;if(a.to<=t||a.from>t)continue;if(s&&a.from<e)break;let l=a.type.prop(Il);if(l&&(a.to<r.length-50||r.length==n.doc.length||!I8(a))){let c=l(a,n);c&&c.from<=t&&c.from>=e&&c.to>t&&(s=c)}}return s}function I8(n){let e=n.lastChild;return e&&e.to==n.to&&e.type.isError}function P5(n,e,t){for(let r of n.facet(k5)){let i=r(n,e,t);if(i)return i}return D8(n,e,t)}function x5(n,e){let t=e.mapPos(n.from,1),r=e.mapPos(n.to,-1);return t>=r?void 0:{from:t,to:r}}const gk=Yt.define({map:x5}),KO=Yt.define({map:x5});function T5(n){let e=[];for(let{head:t}of n.state.selection.ranges)e.some(r=>r.from<=t&&r.to>=t)||e.push(n.lineBlockAt(t));return e}const bh=Zr.define({create(){return mt.none},update(n,e){n=n.map(e.changes);for(let t of e.effects)if(t.is(gk)&&!j8(n,t.value.from,t.value.to)){let{preparePlaceholder:r}=e.state.facet(R5),i=r?mt.replace({widget:new V8(r(e.state,t.value))}):lE;n=n.update({add:[i.range(t.value.from,t.value.to)]})}else t.is(KO)&&(n=n.update({filter:(r,i)=>t.value.from!=r||t.value.to!=i,filterFrom:t.value.from,filterTo:t.value.to}));if(e.selection){let t=!1,{head:r}=e.selection.main;n.between(r,r,(i,s)=>{i<r&&s>r&&(t=!0)}),t&&(n=n.update({filterFrom:r,filterTo:r,filter:(i,s)=>s<=r||i>=r}))}return n},provide:n=>et.decorations.from(n),toJSON(n,e){let t=[];return n.between(0,e.doc.length,(r,i)=>{t.push(r,i)}),t},fromJSON(n){if(!Array.isArray(n)||n.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let t=0;t<n.length;){let r=n[t++],i=n[t++];if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid JSON for fold state");e.push(lE.range(r,i))}return mt.set(e,!0)}});function C5(n,e,t){var r;let i=null;return(r=n.field(bh,!1))===null||r===void 0||r.between(e,t,(s,o)=>{(!i||i.from>s)&&(i={from:s,to:o})}),i}function j8(n,e,t){let r=!1;return n.between(e,e,(i,s)=>{i==e&&s==t&&(r=!0)}),r}function _5(n,e){return n.field(bh,!1)?e:e.concat(Yt.appendConfig.of(F8()))}const N8=n=>{for(let e of T5(n)){let t=P5(n.state,e.from,e.to);if(t)return n.dispatch({effects:_5(n.state,[gk.of(t),E5(n,t)])}),!0}return!1},L8=n=>{if(!n.state.field(bh,!1))return!1;let e=[];for(let t of T5(n)){let r=C5(n.state,t.from,t.to);r&&e.push(KO.of(r),E5(n,r,!1))}return e.length&&n.dispatch({effects:e}),e.length>0};function E5(n,e,t=!0){let r=n.state.doc.lineAt(e.from).number,i=n.state.doc.lineAt(e.to).number;return et.announce.of(`${n.state.phrase(t?"Folded lines":"Unfolded lines")} ${r} ${n.state.phrase("to")} ${i}.`)}const q8=n=>{let{state:e}=n,t=[];for(let r=0;r<e.doc.length;){let i=n.lineBlockAt(r),s=P5(e,i.from,i.to);s&&t.push(gk.of(s)),r=(s?n.lineBlockAt(s.to):i).to+1}return t.length&&n.dispatch({effects:_5(n.state,t)}),!!t.length},U8=n=>{let e=n.state.field(bh,!1);if(!e||!e.size)return!1;let t=[];return e.between(0,n.state.doc.length,(r,i)=>{t.push(KO.of({from:r,to:i}))}),n.dispatch({effects:t}),!0},B8={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},R5=ft.define({combine(n){return go(n,B8)}});function F8(n){return[bh,Z8]}function A5(n,e){let{state:t}=n,r=t.facet(R5),i=o=>{let a=n.lineBlockAt(n.posAtDOM(o.target)),l=C5(n.state,a.from,a.to);l&&n.dispatch({effects:KO.of(l)}),o.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(n,i,e);let s=document.createElement("span");return s.textContent=r.placeholderText,s.setAttribute("aria-label",t.phrase("folded code")),s.title=t.phrase("unfold"),s.className="cm-foldPlaceholder",s.onclick=i,s}const lE=mt.replace({widget:new class extends Ss{toDOM(n){return A5(n,null)}}});class V8 extends Ss{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return A5(e,this.value)}}const Z8=et.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class uf{constructor(e,t){this.specs=e;let r;function i(a){let l=xl.newName();return(r||(r=Object.create(null)))["."+l]=a,l}const s=typeof t.all=="string"?t.all:t.all?i(t.all):void 0,o=t.scope;this.scope=o instanceof Ds?a=>a.prop(Oc)==o.data:o?a=>a==o:void 0,this.style=v5(e.map(a=>({tag:a.tag,class:a.class||i(Object.assign({},a,{tag:null}))})),{all:s}).style,this.module=r?new xl(r):null,this.themeType=t.themeType}static define(e,t){return new uf(e,t||{})}}const Z1=ft.define(),$5=ft.define({combine(n){return n.length?[n[0]]:null}});function E0(n){let e=n.facet(Z1);return e.length?e:n.facet($5)}function Ok(n,e){let t=[X8],r;return n instanceof uf&&(n.module&&t.push(et.styleModule.of(n.module)),r=n.themeType),e!=null&&e.fallback?t.push($5.of(n)):r?t.push(Z1.computeN([et.darkTheme],i=>i.facet(et.darkTheme)==(r=="dark")?[n]:[])):t.push(Z1.of(n)),t}class W8{constructor(e){this.markCache=Object.create(null),this.tree=pr(e.state),this.decorations=this.buildDeco(e,E0(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=pr(e.state),r=E0(e.state),i=r!=E0(e.startState),{viewport:s}=e.view,o=e.changes.mapPos(this.decoratedTo,1);t.length<s.to&&!i&&t.type==this.tree.type&&o>=s.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(t!=this.tree||e.viewportChanged||i)&&(this.tree=t,this.decorations=this.buildDeco(e.view,r),this.decoratedTo=s.to)}buildDeco(e,t){if(!t||!this.tree.length)return mt.none;let r=new xa;for(let{from:i,to:s}of e.visibleRanges)y8(this.tree,t,(o,a,l)=>{r.add(o,a,this.markCache[l]||(this.markCache[l]=mt.mark({class:l})))},i,s);return r.finish()}}const X8=Go.high(Xn.fromClass(W8,{decorations:n=>n.decorations})),z8=uf.define([{tag:T.meta,color:"#404740"},{tag:T.link,textDecoration:"underline"},{tag:T.heading,textDecoration:"underline",fontWeight:"bold"},{tag:T.emphasis,fontStyle:"italic"},{tag:T.strong,fontWeight:"bold"},{tag:T.strikethrough,textDecoration:"line-through"},{tag:T.keyword,color:"#708"},{tag:[T.atom,T.bool,T.url,T.contentSeparator,T.labelName],color:"#219"},{tag:[T.literal,T.inserted],color:"#164"},{tag:[T.string,T.deleted],color:"#a11"},{tag:[T.regexp,T.escape,T.special(T.string)],color:"#e40"},{tag:T.definition(T.variableName),color:"#00f"},{tag:T.local(T.variableName),color:"#30a"},{tag:[T.typeName,T.namespace],color:"#085"},{tag:T.className,color:"#167"},{tag:[T.special(T.variableName),T.macroName],color:"#256"},{tag:T.definition(T.propertyName),color:"#00c"},{tag:T.comment,color:"#940"},{tag:T.invalid,color:"#f00"}]),Y8=et.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),M5=1e4,Q5="()[]{}",D5=ft.define({combine(n){return go(n,{afterCursor:!0,brackets:Q5,maxScanDistance:M5,renderMatch:K8})}}),G8=mt.mark({class:"cm-matchingBracket"}),H8=mt.mark({class:"cm-nonmatchingBracket"});function K8(n){let e=[],t=n.matched?G8:H8;return e.push(t.range(n.start.from,n.start.to)),n.end&&e.push(t.range(n.end.from,n.end.to)),e}const J8=Zr.define({create(){return mt.none},update(n,e){if(!e.docChanged&&!e.selection)return n;let t=[],r=e.state.facet(D5);for(let i of e.state.selection.ranges){if(!i.empty)continue;let s=vl(e.state,i.head,-1,r)||i.head>0&&vl(e.state,i.head-1,1,r)||r.afterCursor&&(vl(e.state,i.head,1,r)||i.head<e.state.doc.length&&vl(e.state,i.head+1,-1,r));s&&(t=t.concat(r.renderMatch(s,e.state)))}return mt.set(t,!0)},provide:n=>et.decorations.from(n)}),eW=[J8,Y8];function tW(n={}){return[D5.of(n),eW]}const I5=new en;function W1(n,e,t){let r=n.prop(e<0?en.openedBy:en.closedBy);if(r)return r;if(n.name.length==1){let i=t.indexOf(n.name);if(i>-1&&i%2==(e<0?1:0))return[t[i+e]]}return null}function X1(n){let e=n.type.prop(I5);return e?e(n.node):n}function vl(n,e,t,r={}){let i=r.maxScanDistance||M5,s=r.brackets||Q5,o=pr(n),a=o.resolveInner(e,t);for(let l=a;l;l=l.parent){let c=W1(l.type,t,s);if(c&&l.from<l.to){let u=X1(l);if(u&&(t>0?e>=u.from&&e<u.to:e>u.from&&e<=u.to))return nW(n,e,t,l,u,c,s)}}return rW(n,e,t,o,a.type,i,s)}function nW(n,e,t,r,i,s,o){let a=r.parent,l={from:i.from,to:i.to},c=0,u=a==null?void 0:a.cursor();if(u&&(t<0?u.childBefore(r.from):u.childAfter(r.to)))do if(t<0?u.to<=r.from:u.from>=r.to){if(c==0&&s.indexOf(u.type.name)>-1&&u.from<u.to){let d=X1(u);return{start:l,end:d?{from:d.from,to:d.to}:void 0,matched:!0}}else if(W1(u.type,t,o))c++;else if(W1(u.type,-t,o)){if(c==0){let d=X1(u);return{start:l,end:d&&d.from<d.to?{from:d.from,to:d.to}:void 0,matched:!1}}c--}}while(t<0?u.prevSibling():u.nextSibling());return{start:l,matched:!1}}function rW(n,e,t,r,i,s,o){let a=t<0?n.sliceDoc(e-1,e):n.sliceDoc(e,e+1),l=o.indexOf(a);if(l<0||l%2==0!=t>0)return null;let c={from:t<0?e-1:e,to:t>0?e+1:e},u=n.doc.iterRange(e,t>0?n.doc.length:0),d=0;for(let h=0;!u.next().done&&h<=s;){let m=u.value;t<0&&(h+=m.length);let g=e+h*t;for(let O=t>0?0:m.length-1,y=t>0?m.length:-1;O!=y;O+=t){let b=o.indexOf(m[O]);if(!(b<0||r.resolveInner(g+O,1).type!=i))if(b%2==0==t>0)d++;else{if(d==1)return{start:c,end:{from:g+O,to:g+O+1},matched:b>>1==l>>1};d--}}t>0&&(h+=m.length)}return u.done?{start:c,matched:!1}:null}const iW=Object.create(null),cE=[ti.none],uE=[],fE=Object.create(null),sW=Object.create(null);for(let[n,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])sW[n]=oW(iW,e);function R0(n,e){uE.indexOf(n)>-1||(uE.push(n),console.warn(e))}function oW(n,e){let t=[];for(let a of e.split(" ")){let l=[];for(let c of a.split(".")){let u=n[c]||T[c];u?typeof u=="function"?l.length?l=l.map(u):R0(c,`Modifier ${c} used at start of tag`):l.length?R0(c,`Tag ${c} used as modifier`):l=Array.isArray(u)?u:[u]:R0(c,`Unknown highlighting tag ${c}`)}for(let c of l)t.push(c)}if(!t.length)return 0;let r=e.replace(/ /g,"_"),i=r+" "+t.map(a=>a.id),s=fE[i];if(s)return s.id;let o=fE[i]=ti.define({id:cE.length,name:r,props:[Dl({[r]:t})]});return cE.push(o),o.id}hr.RTL,hr.LTR;const aW="#e5c07b",dE="#e06c75",lW="#56b6c2",cW="#ffffff",Dg="#abb2bf",z1="#7d8799",uW="#61afef",fW="#98c379",hE="#d19a66",dW="#c678dd",hW="#21252b",pE="#2c313a",mE="#282c34",A0="#353a42",pW="#3E4451",gE="#528bff",mW=et.theme({"&":{color:Dg,backgroundColor:mE},".cm-content":{caretColor:gE},".cm-cursor, .cm-dropCursor":{borderLeftColor:gE},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:pW},".cm-panels":{backgroundColor:hW,color:Dg},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:mE,color:z1,border:"none"},".cm-activeLineGutter":{backgroundColor:pE},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:A0},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:A0,borderBottomColor:A0},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:pE,color:Dg}}},{dark:!0}),gW=uf.define([{tag:T.keyword,color:dW},{tag:[T.name,T.deleted,T.character,T.propertyName,T.macroName],color:dE},{tag:[T.function(T.variableName),T.labelName],color:uW},{tag:[T.color,T.constant(T.name),T.standard(T.name)],color:hE},{tag:[T.definition(T.name),T.separator],color:Dg},{tag:[T.typeName,T.className,T.number,T.changed,T.annotation,T.modifier,T.self,T.namespace],color:aW},{tag:[T.operator,T.operatorKeyword,T.url,T.escape,T.regexp,T.link,T.special(T.string)],color:lW},{tag:[T.meta,T.comment],color:z1},{tag:T.strong,fontWeight:"bold"},{tag:T.emphasis,fontStyle:"italic"},{tag:T.strikethrough,textDecoration:"line-through"},{tag:T.link,color:z1,textDecoration:"underline"},{tag:T.heading,fontWeight:"bold",color:dE},{tag:[T.atom,T.bool,T.special(T.variableName)],color:hE},{tag:[T.processingInstruction,T.string,T.inserted],color:fW},{tag:T.invalid,color:cW}]),OW=[mW,Ok(gW)];function Fr(){return Fr=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},Fr.apply(null,arguments)}var Bs=n=>{var{theme:e,settings:t={},styles:r=[]}=n,i={".cm-gutters":{}},s={};t.background&&(s.backgroundColor=t.background),t.backgroundImage&&(s.backgroundImage=t.backgroundImage),t.foreground&&(s.color=t.foreground),t.fontSize&&(s.fontSize=t.fontSize),(t.background||t.foreground)&&(i["&"]=s),t.fontFamily&&(i["&.cm-editor .cm-scroller"]={fontFamily:t.fontFamily}),t.gutterBackground&&(i[".cm-gutters"].backgroundColor=t.gutterBackground),t.gutterForeground&&(i[".cm-gutters"].color=t.gutterForeground),t.gutterBorder&&(i[".cm-gutters"].borderRightColor=t.gutterBorder),t.caret&&(i[".cm-content"]={caretColor:t.caret},i[".cm-cursor, .cm-dropCursor"]={borderLeftColor:t.caret});var o={};t.gutterActiveForeground&&(o.color=t.gutterActiveForeground),t.lineHighlight&&(i[".cm-activeLine"]={backgroundColor:t.lineHighlight},o.backgroundColor=t.lineHighlight),i[".cm-activeLineGutter"]=o,t.selection&&(i["&.cm-focused .cm-selectionBackground, & .cm-line::selection, & .cm-selectionLayer .cm-selectionBackground, .cm-content ::selection"]={background:t.selection+" !important"}),t.selectionMatch&&(i["& .cm-selectionMatch"]={backgroundColor:t.selectionMatch});var a=et.theme(i,{dark:e==="dark"}),l=uf.define(r),c=[a,Ok(l)];return c},vW={background:"#272822",foreground:"#FFFFFF",caret:"#FFFFFF",selection:"#49483E",selectionMatch:"#49483E",gutterBackground:"#272822",gutterForeground:"#FFFFFF70",lineHighlight:"#0000003b"},yW=[{tag:[T.comment,T.documentMeta],color:"#8292a2"},{tag:[T.number,T.bool,T.null,T.atom],color:"#ae81ff"},{tag:[T.attributeValue,T.className,T.name],color:"#e6db74"},{tag:[T.propertyName,T.attributeName],color:"#a6e22e"},{tag:[T.variableName],color:"#9effff"},{tag:[T.squareBracket],color:"#bababa"},{tag:[T.string,T.special(T.brace)],color:"#e6db74"},{tag:[T.regexp,T.className,T.typeName,T.definition(T.typeName)],color:"#66d9ef"},{tag:[T.definition(T.variableName),T.definition(T.propertyName),T.function(T.variableName)],color:"#fd971f"},{tag:[T.keyword,T.definitionKeyword,T.modifier,T.tagName,T.angleBracket],color:"#f92672"}],bW=n=>{var{theme:e="dark",settings:t={},styles:r=[]}={};return Bs({theme:e,settings:Fr({},vW,t),styles:[...yW,...r]})},SW=bW(),wW={background:"#0f0f0f",foreground:"#defdef",caret:"#00FF00",selection:"#515151",selectionMatch:"#515151",gutterBackground:"#555",gutterForeground:"#FFFFFF",lineHighlight:"#0a6bcb3d"},kW=[{tag:T.keyword,color:"darkgoldenrod",fontWeight:"bold"},{tag:T.atom,color:"#77F"},{tag:T.comment,color:"#7a7b7c",fontStyle:"italic"},{tag:T.number,color:"violet"},{tag:T.definition(T.variableName),color:"#fffabc"},{tag:T.variableName,color:"#abcdef"},{tag:T.function(T.variableName),color:"#fffabc"},{tag:T.typeName,color:"#FFDD44"},{tag:T.tagName,color:"#def"},{tag:T.string,color:"#2b4"},{tag:T.meta,color:"#C9F"},{tag:T.bracket,color:"#8a8a8a"},{tag:T.attributeName,color:"#DDFF00"},{tag:T.heading,color:"aquamarine",fontWeight:"bold"},{tag:T.link,color:"blueviolet",fontWeight:"bold"}],PW=n=>{var{theme:e="dark",settings:t={},styles:r=[]}={};return Bs({theme:e,settings:Fr({},wW,t),styles:[...kW,...r]})},xW=PW(),TW={background:"#282a36",foreground:"#f8f8f2",caret:"#f8f8f0",selection:"rgba(255, 255, 255, 0.1)",selectionMatch:"rgba(255, 255, 255, 0.2)",gutterBackground:"#282a36",gutterForeground:"#6D8A88",gutterBorder:"transparent",lineHighlight:"rgba(255, 255, 255, 0.1)"},CW=[{tag:T.comment,color:"#6272a4"},{tag:T.string,color:"#f1fa8c"},{tag:T.atom,color:"#bd93f9"},{tag:T.meta,color:"#f8f8f2"},{tag:[T.keyword,T.operator,T.tagName],color:"#ff79c6"},{tag:[T.function(T.propertyName),T.propertyName],color:"#66d9ef"},{tag:[T.definition(T.variableName),T.function(T.variableName),T.className,T.attributeName],color:"#50fa7b"},{tag:T.atom,color:"#bd93f9"}],_W=n=>{var{theme:e="dark",settings:t={},styles:r=[]}={};return Bs({theme:e,settings:Fr({},TW,t),styles:[...CW,...r]})},EW=_W(),RW={background:"#fff",foreground:"#000",caret:"#FFFFFF",selection:"#d7d4f0",selectionMatch:"#d7d4f0",gutterBackground:"#f7f7f7",gutterForeground:"#999",lineHighlight:"#006fff1c",gutterBorder:"transparent"},AW=[{tag:[T.comment],color:"#3F7F5F"},{tag:[T.documentMeta],color:"#FF1717"},{tag:T.keyword,color:"#7F0055",fontWeight:"bold"},{tag:T.atom,color:"#00f"},{tag:T.number,color:"#164"},{tag:T.propertyName,color:"#164"},{tag:[T.variableName,T.definition(T.variableName)],color:"#0000C0"},{tag:T.function(T.variableName),color:"#0000C0"},{tag:T.string,color:"#2A00FF"},{tag:T.operator,color:"black"},{tag:T.tagName,color:"#170"},{tag:T.attributeName,color:"#00c"},{tag:T.link,color:"#219"}],$W=n=>{var{theme:e="light",settings:t={},styles:r=[]}={};return Bs({theme:e,settings:Fr({},RW,t),styles:[...AW,...r]})},MW=$W(),QW={background:"#fff",foreground:"#24292e",selection:"#BBDFFF",selectionMatch:"#BBDFFF",gutterBackground:"#fff",gutterForeground:"#6e7781"},DW=[{tag:[T.standard(T.tagName),T.tagName],color:"#116329"},{tag:[T.comment,T.bracket],color:"#6a737d"},{tag:[T.className,T.propertyName],color:"#6f42c1"},{tag:[T.variableName,T.attributeName,T.number,T.operator],color:"#005cc5"},{tag:[T.keyword,T.typeName,T.typeOperator,T.typeName],color:"#d73a49"},{tag:[T.string,T.meta,T.regexp],color:"#032f62"},{tag:[T.name,T.quote],color:"#22863a"},{tag:[T.heading,T.strong],color:"#24292e",fontWeight:"bold"},{tag:[T.emphasis],color:"#24292e",fontStyle:"italic"},{tag:[T.deleted],color:"#b31d28",backgroundColor:"ffeef0"},{tag:[T.atom,T.bool,T.special(T.variableName)],color:"#e36209"},{tag:[T.url,T.escape,T.regexp,T.link],color:"#032f62"},{tag:T.link,textDecoration:"underline"},{tag:T.strikethrough,textDecoration:"line-through"},{tag:T.invalid,color:"#cb2431"}],IW=n=>{var{theme:e="light",settings:t={},styles:r=[]}={};return Bs({theme:e,settings:Fr({},QW,t),styles:[...DW,...r]})};IW();var jW={background:"#0d1117",foreground:"#c9d1d9",caret:"#c9d1d9",selection:"#003d73",selectionMatch:"#003d73",lineHighlight:"#36334280"},NW=[{tag:[T.standard(T.tagName),T.tagName],color:"#7ee787"},{tag:[T.comment,T.bracket],color:"#8b949e"},{tag:[T.className,T.propertyName],color:"#d2a8ff"},{tag:[T.variableName,T.attributeName,T.number,T.operator],color:"#79c0ff"},{tag:[T.keyword,T.typeName,T.typeOperator,T.typeName],color:"#ff7b72"},{tag:[T.string,T.meta,T.regexp],color:"#a5d6ff"},{tag:[T.name,T.quote],color:"#7ee787"},{tag:[T.heading,T.strong],color:"#d2a8ff",fontWeight:"bold"},{tag:[T.emphasis],color:"#d2a8ff",fontStyle:"italic"},{tag:[T.deleted],color:"#ffdcd7",backgroundColor:"ffeef0"},{tag:[T.atom,T.bool,T.special(T.variableName)],color:"#ffab70"},{tag:T.link,textDecoration:"underline"},{tag:T.strikethrough,textDecoration:"line-through"},{tag:T.invalid,color:"#f97583"}],LW=n=>{var{theme:e="dark",settings:t={},styles:r=[]}={};return Bs({theme:e,settings:Fr({},jW,t),styles:[...NW,...r]})},qW=LW(),UW={background:"#2e3235",foreground:"#bdbdbd",caret:"#a0a4ae",selection:"#d7d4f063",selectionMatch:"#d7d4f063",gutterBackground:"#2e3235",gutterForeground:"#999",gutterActiveForeground:"#4f5b66",lineHighlight:"#545b6130"},BW=[{tag:T.keyword,color:"#cf6edf"},{tag:[T.name,T.deleted,T.character,T.macroName],color:"#56c8d8"},{tag:[T.propertyName],color:"#facf4e"},{tag:[T.variableName],color:"#bdbdbd"},{tag:[T.function(T.variableName)],color:"#56c8d8"},{tag:[T.labelName],color:"#cf6edf"},{tag:[T.color,T.constant(T.name),T.standard(T.name)],color:"#facf4e"},{tag:[T.definition(T.name),T.separator],color:"#fa5788"},{tag:[T.brace],color:"#cf6edf"},{tag:[T.annotation],color:"#ff5f52"},{tag:[T.number,T.changed,T.annotation,T.modifier,T.self,T.namespace],color:"#ffad42"},{tag:[T.typeName,T.className],color:"#ffad42"},{tag:[T.operator,T.operatorKeyword],color:"#7186f0"},{tag:[T.tagName],color:"#99d066"},{tag:[T.squareBracket],color:"#ff5f52"},{tag:[T.angleBracket],color:"#606f7a"},{tag:[T.attributeName],color:"#bdbdbd"},{tag:[T.regexp],color:"#ff5f52"},{tag:[T.quote],color:"#6abf69"},{tag:[T.string],color:"#99d066"},{tag:T.link,color:"#56c8d8",textDecoration:"underline",textUnderlinePosition:"under"},{tag:[T.url,T.escape,T.special(T.string)],color:"#facf4e"},{tag:[T.meta],color:"#707d8b"},{tag:[T.comment],color:"#707d8b",fontStyle:"italic"},{tag:T.monospace,color:"#bdbdbd"},{tag:T.strong,fontWeight:"bold",color:"#ff5f52"},{tag:T.emphasis,fontStyle:"italic",color:"#99d066"},{tag:T.strikethrough,textDecoration:"line-through"},{tag:T.heading,fontWeight:"bold",color:"#facf4e"},{tag:T.heading1,fontWeight:"bold",color:"#facf4e"},{tag:[T.heading2,T.heading3,T.heading4],fontWeight:"bold",color:"#facf4e"},{tag:[T.heading5,T.heading6],color:"#facf4e"},{tag:[T.atom,T.bool,T.special(T.variableName)],color:"#56c8d8"},{tag:[T.processingInstruction,T.inserted],color:"#ff5f52"},{tag:[T.contentSeparator],color:"#56c8d8"},{tag:T.invalid,color:"#606f7a",borderBottom:"1px dotted #ff5f52"}],j5=n=>{var{theme:e="dark",settings:t={},styles:r=[]}=n||{};return Bs({theme:e,settings:Fr({},UW,t),styles:[...BW,...r]})};j5();var FW=j5(),VW={background:"#FAFAFA",foreground:"#90A4AE",caret:"#272727",selection:"#80CBC440",selectionMatch:"#80CBC440",gutterBackground:"#FAFAFA",gutterForeground:"#90A4AE",gutterBorder:"transparent",lineHighlight:"#CCD7DA50"},ZW=[{tag:T.keyword,color:"#39ADB5"},{tag:[T.name,T.deleted,T.character,T.macroName],color:"#90A4AE"},{tag:[T.propertyName],color:"#6182B8"},{tag:[T.processingInstruction,T.string,T.inserted,T.special(T.string)],color:"#91B859"},{tag:[T.function(T.variableName),T.labelName],color:"#6182B8"},{tag:[T.color,T.constant(T.name),T.standard(T.name)],color:"#39ADB5"},{tag:[T.definition(T.name),T.separator],color:"#90A4AE"},{tag:[T.className],color:"#E2931D"},{tag:[T.number,T.changed,T.annotation,T.modifier,T.self,T.namespace],color:"#F76D47"},{tag:[T.typeName],color:"#E2931D",fontStyle:"#E2931D"},{tag:[T.operator,T.operatorKeyword],color:"#39ADB5"},{tag:[T.url,T.escape,T.regexp,T.link],color:"#91B859"},{tag:[T.meta,T.comment],color:"#90A4AE"},{tag:T.strong,fontWeight:"bold"},{tag:T.emphasis,fontStyle:"italic"},{tag:T.link,textDecoration:"underline"},{tag:T.heading,fontWeight:"bold",color:"#39ADB5"},{tag:[T.atom,T.bool,T.special(T.variableName)],color:"#90A4AE"},{tag:T.invalid,color:"#E5393570"},{tag:T.strikethrough,textDecoration:"line-through"}],WW=n=>{var{theme:e="light",settings:t={},styles:r=[]}={};return Bs({theme:e,settings:Fr({},VW,t),styles:[...ZW,...r]})};WW();var XW={background:"#2e3440",foreground:"#FFFFFF",caret:"#FFFFFF",selection:"#00000073",selectionMatch:"#00000073",gutterBackground:"#2e3440",gutterForeground:"#4c566a",gutterActiveForeground:"#d8dee9",lineHighlight:"#4c566a29"},zW=[{tag:T.keyword,color:"#5e81ac"},{tag:[T.name,T.deleted,T.character,T.propertyName,T.macroName],color:"#88c0d0"},{tag:[T.variableName],color:"#8fbcbb"},{tag:[T.function(T.variableName)],color:"#8fbcbb"},{tag:[T.labelName],color:"#81a1c1"},{tag:[T.color,T.constant(T.name),T.standard(T.name)],color:"#5e81ac"},{tag:[T.definition(T.name),T.separator],color:"#a3be8c"},{tag:[T.brace],color:"#8fbcbb"},{tag:[T.annotation],color:"#d30102"},{tag:[T.number,T.changed,T.annotation,T.modifier,T.self,T.namespace],color:"#b48ead"},{tag:[T.typeName,T.className],color:"#ebcb8b"},{tag:[T.operator,T.operatorKeyword],color:"#a3be8c"},{tag:[T.tagName],color:"#b48ead"},{tag:[T.squareBracket],color:"#bf616a"},{tag:[T.angleBracket],color:"#d08770"},{tag:[T.attributeName],color:"#ebcb8b"},{tag:[T.regexp],color:"#5e81ac"},{tag:[T.quote],color:"#b48ead"},{tag:[T.string],color:"#a3be8c"},{tag:T.link,color:"#a3be8c",textDecoration:"underline",textUnderlinePosition:"under"},{tag:[T.url,T.escape,T.special(T.string)],color:"#8fbcbb"},{tag:[T.meta],color:"#88c0d0"},{tag:[T.monospace],color:"#d8dee9",fontStyle:"italic"},{tag:[T.comment],color:"#4c566a",fontStyle:"italic"},{tag:T.strong,fontWeight:"bold",color:"#5e81ac"},{tag:T.emphasis,fontStyle:"italic",color:"#5e81ac"},{tag:T.strikethrough,textDecoration:"line-through"},{tag:T.heading,fontWeight:"bold",color:"#5e81ac"},{tag:T.special(T.heading1),fontWeight:"bold",color:"#5e81ac"},{tag:T.heading1,fontWeight:"bold",color:"#5e81ac"},{tag:[T.heading2,T.heading3,T.heading4],fontWeight:"bold",color:"#5e81ac"},{tag:[T.heading5,T.heading6],color:"#5e81ac"},{tag:[T.atom,T.bool,T.special(T.variableName)],color:"#d08770"},{tag:[T.processingInstruction,T.inserted],color:"#8fbcbb"},{tag:[T.contentSeparator],color:"#ebcb8b"},{tag:T.invalid,color:"#434c5e",borderBottom:"1px dotted #d30102"}],YW=n=>{var{theme:e="dark",settings:t={},styles:r=[]}={};return Bs({theme:e,settings:Fr({},XW,t),styles:[...zW,...r]})},GW=YW(),HW={background:"#fff",foreground:"#3D3D3D",selection:"#BBDFFF",selectionMatch:"#BBDFFF",gutterBackground:"#fff",gutterForeground:"#AFAFAF",lineHighlight:"#d5e6ff69"},KW=[{tag:[T.comment,T.quote],color:"#707F8D"},{tag:[T.typeName,T.typeOperator],color:"#aa0d91"},{tag:[T.keyword],color:"#aa0d91",fontWeight:"bold"},{tag:[T.string,T.meta],color:"#D23423"},{tag:[T.name],color:"#032f62"},{tag:[T.typeName],color:"#522BB2"},{tag:[T.variableName],color:"#23575C"},{tag:[T.definition(T.variableName)],color:"#327A9E"},{tag:[T.regexp,T.link],color:"#0e0eff"}];function JW(n){var{theme:e="light",settings:t={},styles:r=[]}={};return Bs({theme:e,settings:Fr({},HW,t),styles:[...KW,...r]})}var e9=JW(),t9={background:"#292A30",foreground:"#CECFD0",caret:"#fff",selection:"#727377",selectionMatch:"#727377",lineHighlight:"#ffffff0f"},n9=[{tag:[T.comment,T.quote],color:"#7F8C98"},{tag:[T.keyword],color:"#FF7AB2",fontWeight:"bold"},{tag:[T.string,T.meta],color:"#FF8170"},{tag:[T.typeName],color:"#DABAFF"},{tag:[T.definition(T.variableName)],color:"#6BDFFF"},{tag:[T.name],color:"#6BAA9F"},{tag:[T.variableName],color:"#ACF2E4"},{tag:[T.regexp,T.link],color:"#FF8170"}],r9=n=>{var{theme:e="dark",settings:t={},styles:r=[]}={};return Bs({theme:e,settings:Fr({},t9,t),styles:[...n9,...r]})};r9();const OE="#202e46",N5="#e2e2e2",i9="#b9c7e6",s9="rgba(255,255,255,0.2)",o9="rgba(255,255,255,0.5)",a9="#000",l9="rgba(0,0,0,0.4)",c9="rgba(0,0,0,0.1)",u9="white",ff=["#77fd8c","#00ffff","#66ecff","#ffb9ff","#ffabb3","#ffdb56"],vE=ff[0],ed=ff[1],f9=ff[2],yE=ff[3],d9=ff[4],bE=ff[5],h9="#ff2222",p9=n=>{let{state:e}=n,t=e.doc.lineAt(e.selection.main.from),r=vk(n.state,t.from);return r.line?m9(n):r.block?y9(n):!1};function Sh(n,e){return({state:t,dispatch:r})=>{if(t.readOnly)return!1;let i=n(e,t);return i?(r(t.update(i)),!0):!1}}const m9=Sh(yk,0),g9=Sh(yk,1),O9=Sh(yk,2),v9=Sh(L5,0),y9=Sh((n,e)=>L5(n,e,S9(e)),0);function vk(n,e){let t=n.languageDataAt("commentTokens",e);return t.length?t[0]:{}}const td=50;function b9(n,{open:e,close:t},r,i){let s=n.sliceDoc(r-td,r),o=n.sliceDoc(i,i+td),a=/\s*$/.exec(s)[0].length,l=/^\s*/.exec(o)[0].length,c=s.length-a;if(s.slice(c-e.length,c)==e&&o.slice(l,l+t.length)==t)return{open:{pos:r-a,margin:a&&1},close:{pos:i+l,margin:l&&1}};let u,d;i-r<=2*td?u=d=n.sliceDoc(r,i):(u=n.sliceDoc(r,r+td),d=n.sliceDoc(i-td,i));let h=/^\s*/.exec(u)[0].length,m=/\s*$/.exec(d)[0].length,g=d.length-m-t.length;return u.slice(h,h+e.length)==e&&d.slice(g,g+t.length)==t?{open:{pos:r+h+e.length,margin:/\s/.test(u.charAt(h+e.length))?1:0},close:{pos:i-m-t.length,margin:/\s/.test(d.charAt(g-1))?1:0}}:null}function S9(n){let e=[];for(let t of n.selection.ranges){let r=n.doc.lineAt(t.from),i=t.to<=r.to?r:n.doc.lineAt(t.to);i.from>r.from&&i.from==t.to&&(i=t.to==r.to+1?r:n.doc.lineAt(t.to-1));let s=e.length-1;s>=0&&e[s].to>r.from?e[s].to=i.to:e.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return e}function L5(n,e,t=e.selection.ranges){let r=t.map(s=>vk(e,s.from).block);if(!r.every(s=>s))return null;let i=t.map((s,o)=>b9(e,r[o],s.from,s.to));if(n!=2&&!i.every(s=>s))return{changes:e.changes(t.map((s,o)=>i[o]?[]:[{from:s.from,insert:r[o].open+" "},{from:s.to,insert:" "+r[o].close}]))};if(n!=1&&i.some(s=>s)){let s=[];for(let o=0,a;o<i.length;o++)if(a=i[o]){let l=r[o],{open:c,close:u}=a;s.push({from:c.pos-l.open.length,to:c.pos+c.margin},{from:u.pos-u.margin,to:u.pos+l.close.length})}return{changes:s}}return null}function yk(n,e,t=e.selection.ranges){let r=[],i=-1;for(let{from:s,to:o}of t){let a=r.length,l=1e9,c=vk(e,s).line;if(c){for(let u=s;u<=o;){let d=e.doc.lineAt(u);if(d.from>i&&(s==o||o>d.from)){i=d.from;let h=/^\s*/.exec(d.text)[0].length,m=h==d.length,g=d.text.slice(h,h+c.length)==c?h:-1;h<d.text.length&&h<l&&(l=h),r.push({line:d,comment:g,token:c,indent:h,empty:m,single:!1})}u=d.to+1}if(l<1e9)for(let u=a;u<r.length;u++)r[u].indent<r[u].line.text.length&&(r[u].indent=l);r.length==a+1&&(r[a].single=!0)}}if(n!=2&&r.some(s=>s.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:a,token:l,indent:c,empty:u,single:d}of r)(d||!u)&&s.push({from:a.from+c,insert:l+" "});let o=e.changes(s);return{changes:o,selection:e.selection.map(o,1)}}else if(n!=1&&r.some(s=>s.comment>=0)){let s=[];for(let{line:o,comment:a,token:l}of r)if(a>=0){let c=o.from+a,u=c+l.length;o.text[u-o.from]==" "&&u++,s.push({from:c,to:u})}return{changes:s}}return null}const Y1=Ho.define(),w9=Ho.define(),k9=ft.define(),q5=ft.define({combine(n){return go(n,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(r,i)=>e(r,i)||t(r,i)})}}),U5=Zr.define({create(){return Vo.empty},update(n,e){let t=e.state.facet(q5),r=e.annotation(Y1);if(r){let l=ss.fromTransaction(e,r.selection),c=r.side,u=c==0?n.undone:n.done;return l?u=pO(u,u.length,t.minDepth,l):u=V5(u,e.startState.selection),new Vo(c==0?r.rest:u,c==0?u:r.rest)}let i=e.annotation(w9);if((i=="full"||i=="before")&&(n=n.isolate()),e.annotation(Vr.addToHistory)===!1)return e.changes.empty?n:n.addMapping(e.changes.desc);let s=ss.fromTransaction(e),o=e.annotation(Vr.time),a=e.annotation(Vr.userEvent);return s?n=n.addChanges(s,o,a,t,e):e.selection&&(n=n.addSelection(e.startState.selection,o,a,t.newGroupDelay)),(i=="full"||i=="after")&&(n=n.isolate()),n},toJSON(n){return{done:n.done.map(e=>e.toJSON()),undone:n.undone.map(e=>e.toJSON())}},fromJSON(n){return new Vo(n.done.map(ss.fromJSON),n.undone.map(ss.fromJSON))}});function P9(n={}){return[U5,q5.of(n),et.domEventHandlers({beforeinput(e,t){let r=e.inputType=="historyUndo"?B5:e.inputType=="historyRedo"?G1:null;return r?(e.preventDefault(),r(t)):!1}})]}function bk(n,e){return function({state:t,dispatch:r}){if(!e&&t.readOnly)return!1;let i=t.field(U5,!1);if(!i)return!1;let s=i.pop(n,t,e);return s?(r(s),!0):!1}}const B5=bk(0,!1),G1=bk(1,!1),x9=bk(0,!0);class ss{constructor(e,t,r,i,s){this.changes=e,this.effects=t,this.mapped=r,this.startSelection=i,this.selectionsAfter=s}setSelAfter(e){return new ss(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,r;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(i=>i.toJSON())}}static fromJSON(e){return new ss(e.changes&&Hr.fromJSON(e.changes),[],e.mapped&&Zo.fromJSON(e.mapped),e.startSelection&&_e.fromJSON(e.startSelection),e.selectionsAfter.map(_e.fromJSON))}static fromTransaction(e,t){let r=Is;for(let i of e.startState.facet(k9)){let s=i(e);s.length&&(r=r.concat(s))}return!r.length&&e.changes.empty?null:new ss(e.changes.invert(e.startState.doc),r,void 0,t||e.startState.selection,Is)}static selection(e){return new ss(void 0,Is,void 0,void 0,e)}}function pO(n,e,t,r){let i=e+1>t+20?e-t-1:0,s=n.slice(i,e);return s.push(r),s}function T9(n,e){let t=[],r=!1;return n.iterChangedRanges((i,s)=>t.push(i,s)),e.iterChangedRanges((i,s,o,a)=>{for(let l=0;l<t.length;){let c=t[l++],u=t[l++];a>=c&&o<=u&&(r=!0)}}),r}function C9(n,e){return n.ranges.length==e.ranges.length&&n.ranges.filter((t,r)=>t.empty!=e.ranges[r].empty).length===0}function F5(n,e){return n.length?e.length?n.concat(e):n:e}const Is=[],_9=200;function V5(n,e){if(n.length){let t=n[n.length-1],r=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-_9));return r.length&&r[r.length-1].eq(e)?n:(r.push(e),pO(n,n.length-1,1e9,t.setSelAfter(r)))}else return[ss.selection([e])]}function E9(n){let e=n[n.length-1],t=n.slice();return t[n.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function $0(n,e){if(!n.length)return n;let t=n.length,r=Is;for(;t;){let i=R9(n[t-1],e,r);if(i.changes&&!i.changes.empty||i.effects.length){let s=n.slice(0,t);return s[t-1]=i,s}else e=i.mapped,t--,r=i.selectionsAfter}return r.length?[ss.selection(r)]:Is}function R9(n,e,t){let r=F5(n.selectionsAfter.length?n.selectionsAfter.map(a=>a.map(e)):Is,t);if(!n.changes)return ss.selection(r);let i=n.changes.map(e),s=e.mapDesc(n.changes,!0),o=n.mapped?n.mapped.composeDesc(s):s;return new ss(i,Yt.mapEffects(n.effects,e),o,n.startSelection.map(s),r)}const A9=/^(input\.type|delete)($|\.)/;class Vo{constructor(e,t,r=0,i=void 0){this.done=e,this.undone=t,this.prevTime=r,this.prevUserEvent=i}isolate(){return this.prevTime?new Vo(this.done,this.undone):this}addChanges(e,t,r,i,s){let o=this.done,a=o[o.length-1];return a&&a.changes&&!a.changes.empty&&e.changes&&(!r||A9.test(r))&&(!a.selectionsAfter.length&&t-this.prevTime<i.newGroupDelay&&i.joinToEvent(s,T9(a.changes,e.changes))||r=="input.type.compose")?o=pO(o,o.length-1,i.minDepth,new ss(e.changes.compose(a.changes),F5(Yt.mapEffects(e.effects,a.changes),a.effects),a.mapped,a.startSelection,Is)):o=pO(o,o.length,i.minDepth,e),new Vo(o,Is,t,r)}addSelection(e,t,r,i){let s=this.done.length?this.done[this.done.length-1].selectionsAfter:Is;return s.length>0&&t-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&C9(s[s.length-1],e)?this:new Vo(V5(this.done,e),this.undone,t,r)}addMapping(e){return new Vo($0(this.done,e),$0(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,r){let i=e==0?this.done:this.undone;if(i.length==0)return null;let s=i[i.length-1],o=s.selectionsAfter[0]||t.selection;if(r&&s.selectionsAfter.length)return t.update({selection:s.selectionsAfter[s.selectionsAfter.length-1],annotations:Y1.of({side:e,rest:E9(i),selection:o}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(s.changes){let a=i.length==1?Is:i.slice(0,i.length-1);return s.mapped&&(a=$0(a,s.mapped)),t.update({changes:s.changes,selection:s.startSelection,effects:s.effects,annotations:Y1.of({side:e,rest:a,selection:o}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}Vo.empty=new Vo(Is,Is);function wh(n,e){return _e.create(n.ranges.map(e),n.mainIndex)}function jl(n,e){return n.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function Mc({state:n,dispatch:e},t){let r=wh(n.selection,t);return r.eq(n.selection,!0)?!1:(e(jl(n,r)),!0)}function JO(n,e){return _e.cursor(e?n.to:n.from)}function Z5(n,e){return Mc(n,t=>t.empty?n.moveByChar(t,e):JO(t,e))}function Nl(n){return n.textDirectionAt(n.state.selection.main.head)==hr.LTR}const SE=n=>Z5(n,!Nl(n)),wE=n=>Z5(n,Nl(n));function W5(n,e){return Mc(n,t=>t.empty?n.moveByGroup(t,e):JO(t,e))}const $9=n=>W5(n,!Nl(n)),M9=n=>W5(n,Nl(n));function X5(n,e){return Mc(n,t=>{if(!t.empty)return JO(t,e);let r=n.moveVertically(t,e);return r.head!=t.head?r:n.moveToLineBoundary(t,e)})}const kE=n=>X5(n,!1),PE=n=>X5(n,!0);function z5(n){let e=n.scrollDOM.clientHeight<n.scrollDOM.scrollHeight-2,t=0,r=0,i;if(e){for(let s of n.state.facet(et.scrollMargins)){let o=s(n);o!=null&&o.top&&(t=Math.max(o==null?void 0:o.top,t)),o!=null&&o.bottom&&(r=Math.max(o==null?void 0:o.bottom,r))}i=n.scrollDOM.clientHeight-t-r}else i=(n.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:t,marginBottom:r,selfScroll:e,height:Math.max(n.defaultLineHeight,i-5)}}function Y5(n,e){let t=z5(n),{state:r}=n,i=wh(r.selection,o=>o.empty?n.moveVertically(o,e,t.height):JO(o,e));if(i.eq(r.selection))return!1;let s;if(t.selfScroll){let o=n.coordsAtPos(r.selection.main.head),a=n.scrollDOM.getBoundingClientRect(),l=a.top+t.marginTop,c=a.bottom-t.marginBottom;o&&o.top>l&&o.bottom<c&&(s=et.scrollIntoView(i.main.head,{y:"start",yMargin:o.top-l}))}return n.dispatch(jl(r,i),{effects:s}),!0}const M0=n=>Y5(n,!1),Q0=n=>Y5(n,!0);function ev(n,e,t){let r=n.lineBlockAt(e.head),i=n.moveToLineBoundary(e,t);if(i.head==e.head&&i.head!=(t?r.to:r.from)&&(i=n.moveToLineBoundary(e,t,!1)),!t&&i.head==r.from&&r.length){let s=/^\s*/.exec(n.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;s&&e.head!=r.from+s&&(i=_e.cursor(r.from+s))}return i}const xE=n=>Mc(n,e=>ev(n,e,!0)),TE=n=>Mc(n,e=>ev(n,e,!1)),Q9=n=>Mc(n,e=>_e.cursor(n.lineBlockAt(e.head).from,1)),D9=n=>Mc(n,e=>_e.cursor(n.lineBlockAt(e.head).to,-1));function I9(n,e,t){let r=!1,i=wh(n.selection,s=>{let o=vl(n,s.head,-1)||vl(n,s.head,1)||s.head>0&&vl(n,s.head-1,1)||s.head<n.doc.length&&vl(n,s.head+1,-1);if(!o||!o.end)return s;r=!0;let a=o.start.from==s.head?o.end.to:o.end.from;return _e.cursor(a)});return r?(e(jl(n,i)),!0):!1}const j9=({state:n,dispatch:e})=>I9(n,e);function Ll(n,e){let t=wh(n.state.selection,r=>{let i=e(r);return _e.range(r.anchor,i.head,i.goalColumn,i.bidiLevel||void 0)});return t.eq(n.state.selection)?!1:(n.dispatch(jl(n.state,t)),!0)}function G5(n,e){return Ll(n,t=>n.moveByChar(t,e))}const CE=n=>G5(n,!Nl(n)),_E=n=>G5(n,Nl(n));function H5(n,e){return Ll(n,t=>n.moveByGroup(t,e))}const N9=n=>H5(n,!Nl(n)),L9=n=>H5(n,Nl(n));function K5(n,e){return Ll(n,t=>n.moveVertically(t,e))}const EE=n=>K5(n,!1),RE=n=>K5(n,!0);function J5(n,e){return Ll(n,t=>n.moveVertically(t,e,z5(n).height))}const AE=n=>J5(n,!1),$E=n=>J5(n,!0),ME=n=>Ll(n,e=>ev(n,e,!0)),QE=n=>Ll(n,e=>ev(n,e,!1)),q9=n=>Ll(n,e=>_e.cursor(n.lineBlockAt(e.head).from)),U9=n=>Ll(n,e=>_e.cursor(n.lineBlockAt(e.head).to)),DE=({state:n,dispatch:e})=>(e(jl(n,{anchor:0})),!0),IE=({state:n,dispatch:e})=>(e(jl(n,{anchor:n.doc.length})),!0),jE=({state:n,dispatch:e})=>(e(jl(n,{anchor:n.selection.main.anchor,head:0})),!0),NE=({state:n,dispatch:e})=>(e(jl(n,{anchor:n.selection.main.anchor,head:n.doc.length})),!0),B9=({state:n,dispatch:e})=>(e(n.update({selection:{anchor:0,head:n.doc.length},userEvent:"select"})),!0),F9=({state:n,dispatch:e})=>{let t=nv(n).map(({from:r,to:i})=>_e.range(r,Math.min(i+1,n.doc.length)));return e(n.update({selection:_e.create(t),userEvent:"select"})),!0};function tv(n,e){if(n.state.readOnly)return!1;let t="delete.selection",{state:r}=n,i=r.changeByRange(s=>{let{from:o,to:a}=s;if(o==a){let l=e(s);l<o?(t="delete.backward",l=zp(n,l,!1)):l>o&&(t="delete.forward",l=zp(n,l,!0)),o=Math.min(o,l),a=Math.max(a,l)}else o=zp(n,o,!1),a=zp(n,a,!0);return o==a?{range:s}:{changes:{from:o,to:a},range:_e.cursor(o,o<s.head?-1:1)}});return i.changes.empty?!1:(n.dispatch(r.update(i,{scrollIntoView:!0,userEvent:t,effects:t=="delete.selection"?et.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function zp(n,e,t){if(n instanceof et)for(let r of n.state.facet(et.atomicRanges).map(i=>i(n)))r.between(e,e,(i,s)=>{i<e&&s>e&&(e=t?s:i)});return e}const ej=(n,e,t)=>tv(n,r=>{let i=r.from,{state:s}=n,o=s.doc.lineAt(i),a,l;if(t&&!e&&i>o.from&&i<o.from+200&&!/[^ \t]/.test(a=o.text.slice(0,i-o.from))){if(a[a.length-1]==" ")return i-1;let c=fo(a,s.tabSize),u=c%ef(s)||ef(s);for(let d=0;d<u&&a[a.length-1-d]==" ";d++)i--;l=i}else l=vi(o.text,i-o.from,e,e)+o.from,l==i&&o.number!=(e?s.doc.lines:1)?l+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(o.text.slice(l-o.from,i-o.from))&&(l=vi(o.text,l-o.from,!1,!1)+o.from);return l}),D0=n=>ej(n,!1,!0),LE=n=>ej(n,!0,!1),tj=(n,e)=>tv(n,t=>{let r=t.head,{state:i}=n,s=i.doc.lineAt(r),o=i.charCategorizer(r);for(let a=null;;){if(r==(e?s.to:s.from)){r==t.head&&s.number!=(e?i.doc.lines:1)&&(r+=e?1:-1);break}let l=vi(s.text,r-s.from,e)+s.from,c=s.text.slice(Math.min(r,l)-s.from,Math.max(r,l)-s.from),u=o(c);if(a!=null&&u!=a)break;(c!=" "||r!=t.head)&&(a=u),r=l}return r}),qE=n=>tj(n,!1),V9=n=>tj(n,!0),UE=n=>tv(n,e=>{let t=n.lineBlockAt(e.head).to;return e.head<t?t:Math.min(n.state.doc.length,e.head+1)}),Z9=n=>tv(n,e=>{let t=n.lineBlockAt(e.head).from;return e.head>t?t:Math.max(0,e.head-1)}),W9=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:En.of(["",""])},range:_e.cursor(r.from)}));return e(n.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},X9=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(r=>{if(!r.empty||r.from==0||r.from==n.doc.length)return{range:r};let i=r.from,s=n.doc.lineAt(i),o=i==s.from?i-1:vi(s.text,i-s.from,!1)+s.from,a=i==s.to?i+1:vi(s.text,i-s.from,!0)+s.from;return{changes:{from:o,to:a,insert:n.doc.slice(i,a).append(n.doc.slice(o,i))},range:_e.cursor(a)}});return t.changes.empty?!1:(e(n.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function nv(n){let e=[],t=-1;for(let r of n.selection.ranges){let i=n.doc.lineAt(r.from),s=n.doc.lineAt(r.to);if(!r.empty&&r.to==s.from&&(s=n.doc.lineAt(r.to-1)),t>=i.number){let o=e[e.length-1];o.to=s.to,o.ranges.push(r)}else e.push({from:i.from,to:s.to,ranges:[r]});t=s.number+1}return e}function nj(n,e,t){if(n.readOnly)return!1;let r=[],i=[];for(let s of nv(n)){if(t?s.to==n.doc.length:s.from==0)continue;let o=n.doc.lineAt(t?s.to+1:s.from-1),a=o.length+1;if(t){r.push({from:s.to,to:o.to},{from:s.from,insert:o.text+n.lineBreak});for(let l of s.ranges)i.push(_e.range(Math.min(n.doc.length,l.anchor+a),Math.min(n.doc.length,l.head+a)))}else{r.push({from:o.from,to:s.from},{from:s.to,insert:n.lineBreak+o.text});for(let l of s.ranges)i.push(_e.range(l.anchor-a,l.head-a))}}return r.length?(e(n.update({changes:r,scrollIntoView:!0,selection:_e.create(i,n.selection.mainIndex),userEvent:"move.line"})),!0):!1}const z9=({state:n,dispatch:e})=>nj(n,e,!1),Y9=({state:n,dispatch:e})=>nj(n,e,!0);function rj(n,e,t){if(n.readOnly)return!1;let r=[];for(let i of nv(n))t?r.push({from:i.from,insert:n.doc.slice(i.from,i.to)+n.lineBreak}):r.push({from:i.to,insert:n.lineBreak+n.doc.slice(i.from,i.to)});return e(n.update({changes:r,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const G9=({state:n,dispatch:e})=>rj(n,e,!1),H9=({state:n,dispatch:e})=>rj(n,e,!0),K9=n=>{if(n.state.readOnly)return!1;let{state:e}=n,t=e.changes(nv(e).map(({from:i,to:s})=>(i>0?i--:s<e.doc.length&&s++,{from:i,to:s}))),r=wh(e.selection,i=>{let s;if(n.lineWrapping){let o=n.lineBlockAt(i.head),a=n.coordsAtPos(i.head,i.assoc||1);a&&(s=o.bottom+n.documentTop-a.bottom+n.defaultLineHeight/2)}return n.moveVertically(i,!0,s)}).map(t);return n.dispatch({changes:t,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function J9(n,e){if(/\(\)|\[\]|\{\}/.test(n.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=pr(n).resolveInner(e),r=t.childBefore(e),i=t.childAfter(e),s;return r&&i&&r.to<=e&&i.from>=e&&(s=r.type.prop(en.closedBy))&&s.indexOf(i.name)>-1&&n.doc.lineAt(r.to).from==n.doc.lineAt(i.from).from&&!/\S/.test(n.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}const BE=eX(!1);function eX(n){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=e.changeByRange(i=>{let{from:s,to:o}=i,a=e.doc.lineAt(s),l=!n&&s==o&&J9(e,s);n&&(s=o=(o<=a.to?a:e.doc.lineAt(o)).to);let c=new hk(e,{simulateBreak:s,simulateDoubleBreak:!!l}),u=b5(c,s);for(u==null&&(u=fo(/^\s*/.exec(e.doc.lineAt(s).text)[0],e.tabSize));o<a.to&&/\s/.test(a.text[o-a.from]);)o++;l?{from:s,to:o}=l:s>a.from&&s<a.from+100&&!/\S/.test(a.text.slice(0,s))&&(s=a.from);let d=["",hO(e,u)];return l&&d.push(hO(e,c.lineIndent(a.from,-1))),{changes:{from:s,to:o,insert:En.of(d)},range:_e.cursor(s+1+d[1].length)}});return t(e.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function ij(n,e){let t=-1;return n.changeByRange(r=>{let i=[];for(let o=r.from;o<=r.to;){let a=n.doc.lineAt(o);a.number>t&&(r.empty||r.to>a.from)&&(e(a,i,r),t=a.number),o=a.to+1}let s=n.changes(i);return{changes:i,range:_e.range(s.mapPos(r.anchor,1),s.mapPos(r.head,1))}})}const FE=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(ij(n,(t,r)=>{r.push({from:t.from,insert:n.facet(yh)})}),{userEvent:"input.indent"})),!0),VE=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(ij(n,(t,r)=>{let i=/^\s*/.exec(t.text)[0];if(!i)return;let s=fo(i,n.tabSize),o=0,a=hO(n,Math.max(0,s-ef(n)));for(;o<i.length&&o<a.length&&i.charCodeAt(o)==a.charCodeAt(o);)o++;r.push({from:t.from+o,to:t.from+i.length,insert:a.slice(o)})}),{userEvent:"delete.dedent"})),!0);function sr(){var n=arguments[0];typeof n=="string"&&(n=document.createElement(n));var e=1,t=arguments[1];if(t&&typeof t=="object"&&t.nodeType==null&&!Array.isArray(t)){for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){var i=t[r];typeof i=="string"?n.setAttribute(r,i):i!=null&&(n[r]=i)}e++}for(;e<arguments.length;e++)sj(n,arguments[e]);return n}function sj(n,e){if(typeof e=="string")n.appendChild(document.createTextNode(e));else if(e!=null)if(e.nodeType!=null)n.appendChild(e);else if(Array.isArray(e))for(var t=0;t<e.length;t++)sj(n,e[t]);else throw new RangeError("Unsupported child node: "+e)}const ZE=typeof String.prototype.normalize=="function"?n=>n.normalize("NFKD"):n=>n;class tf{constructor(e,t,r=0,i=e.length,s,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(r,i),this.bufferStart=r,this.normalize=s?a=>s(ZE(a)):ZE,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return es(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=Vw(e),r=this.bufferStart+this.bufferPos;this.bufferPos+=Uo(e);let i=this.normalize(t);if(i.length)for(let s=0,o=r;;s++){let a=i.charCodeAt(s),l=this.match(a,o,this.bufferPos+this.bufferStart);if(s==i.length-1){if(l)return this.value=l,this;break}o==r&&s<t.length&&t.charCodeAt(s)==a&&o++}}}match(e,t,r){let i=null;for(let s=0;s<this.matches.length;s+=2){let o=this.matches[s],a=!1;this.query.charCodeAt(o)==e&&(o==this.query.length-1?i={from:this.matches[s+1],to:r}:(this.matches[s]++,a=!0)),a||(this.matches.splice(s,2),s-=2)}return this.query.charCodeAt(0)==e&&(this.query.length==1?i={from:t,to:r}:this.matches.push(1,t)),i&&this.test&&!this.test(i.from,i.to,this.buffer,this.bufferStart)&&(i=null),i}}typeof Symbol<"u"&&(tf.prototype[Symbol.iterator]=function(){return this});const oj={from:-1,to:-1,match:/.*/.exec("")},Sk="gm"+(/x/.unicode==null?"":"u");class aj{constructor(e,t,r,i=0,s=e.length){if(this.text=e,this.to=s,this.curLine="",this.done=!1,this.value=oj,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new lj(e,t,r,i,s);this.re=new RegExp(t,Sk+(r!=null&&r.ignoreCase?"i":"")),this.test=r==null?void 0:r.test,this.iter=e.iter();let o=e.lineAt(i);this.curLineStart=o.from,this.matchPos=mO(e,i),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let r=this.curLineStart+t.index,i=r+t[0].length;if(this.matchPos=mO(this.text,i+(r==i?1:0)),r==this.curLineStart+this.curLine.length&&this.nextLine(),(r<i||r>this.value.to)&&(!this.test||this.test(r,i,t)))return this.value={from:r,to:i,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}}const I0=new WeakMap;class Lu{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(e,t,r){let i=I0.get(e);if(!i||i.from>=r||i.to<=t){let a=new Lu(t,e.sliceString(t,r));return I0.set(e,a),a}if(i.from==t&&i.to==r)return i;let{text:s,from:o}=i;return o>t&&(s=e.sliceString(t,o)+s,o=t),i.to<r&&(s+=e.sliceString(i.to,r)),I0.set(e,new Lu(o,s)),new Lu(t,s.slice(t-o,r-o))}}class lj{constructor(e,t,r,i,s){this.text=e,this.to=s,this.done=!1,this.value=oj,this.matchPos=mO(e,i),this.re=new RegExp(t,Sk+(r!=null&&r.ignoreCase?"i":"")),this.test=r==null?void 0:r.test,this.flat=Lu.get(e,i,this.chunkEnd(i+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let r=this.flat.from+t.index,i=r+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(r,i,t)))return this.value={from:r,to:i,match:t},this.matchPos=mO(this.text,i+(r==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Lu.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(aj.prototype[Symbol.iterator]=lj.prototype[Symbol.iterator]=function(){return this});function tX(n){try{return new RegExp(n,Sk),!0}catch{return!1}}function mO(n,e){if(e>=n.length)return e;let t=n.lineAt(e),r;for(;e<t.to&&(r=t.text.charCodeAt(e-t.from))>=56320&&r<57344;)e++;return e}function H1(n){let e=String(n.state.doc.lineAt(n.state.selection.main.head).number),t=sr("input",{class:"cm-textfield",name:"line",value:e}),r=sr("form",{class:"cm-gotoLine",onkeydown:s=>{s.keyCode==27?(s.preventDefault(),n.dispatch({effects:gO.of(!1)}),n.focus()):s.keyCode==13&&(s.preventDefault(),i())},onsubmit:s=>{s.preventDefault(),i()}},sr("label",n.state.phrase("Go to line"),": ",t)," ",sr("button",{class:"cm-button",type:"submit"},n.state.phrase("go")));function i(){let s=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(!s)return;let{state:o}=n,a=o.doc.lineAt(o.selection.main.head),[,l,c,u,d]=s,h=u?+u.slice(1):0,m=c?+c:a.number;if(c&&d){let y=m/100;l&&(y=y*(l=="-"?-1:1)+a.number/o.doc.lines),m=Math.round(o.doc.lines*y)}else c&&l&&(m=m*(l=="-"?-1:1)+a.number);let g=o.doc.line(Math.max(1,Math.min(o.doc.lines,m))),O=_e.cursor(g.from+Math.max(0,Math.min(h,g.length)));n.dispatch({effects:[gO.of(!1),et.scrollIntoView(O.from,{y:"center"})],selection:O}),n.focus()}return{dom:r}}const gO=Yt.define(),WE=Zr.define({create(){return!0},update(n,e){for(let t of e.effects)t.is(gO)&&(n=t.value);return n},provide:n=>Yd.from(n,e=>e?H1:null)}),nX=n=>{let e=zd(n,H1);if(!e){let t=[gO.of(!0)];n.state.field(WE,!1)==null&&t.push(Yt.appendConfig.of([WE,rX])),n.dispatch({effects:t}),e=zd(n,H1)}return e&&e.dom.querySelector("input").select(),!0},rX=et.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),iX={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},sX=ft.define({combine(n){return go(n,iX,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function oX(n){return[fX,uX]}const aX=mt.mark({class:"cm-selectionMatch"}),lX=mt.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function XE(n,e,t,r){return(t==0||n(e.sliceDoc(t-1,t))!=br.Word)&&(r==e.doc.length||n(e.sliceDoc(r,r+1))!=br.Word)}function cX(n,e,t,r){return n(e.sliceDoc(t,t+1))==br.Word&&n(e.sliceDoc(r-1,r))==br.Word}const uX=Xn.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.selectionSet||n.docChanged||n.viewportChanged)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=n.state.facet(sX),{state:t}=n,r=t.selection;if(r.ranges.length>1)return mt.none;let i=r.main,s,o=null;if(i.empty){if(!e.highlightWordAroundCursor)return mt.none;let l=t.wordAt(i.head);if(!l)return mt.none;o=t.charCategorizer(i.head),s=t.sliceDoc(l.from,l.to)}else{let l=i.to-i.from;if(l<e.minSelectionLength||l>200)return mt.none;if(e.wholeWords){if(s=t.sliceDoc(i.from,i.to),o=t.charCategorizer(i.head),!(XE(o,t,i.from,i.to)&&cX(o,t,i.from,i.to)))return mt.none}else if(s=t.sliceDoc(i.from,i.to),!s)return mt.none}let a=[];for(let l of n.visibleRanges){let c=new tf(t.doc,s,l.from,l.to);for(;!c.next().done;){let{from:u,to:d}=c.value;if((!o||XE(o,t,u,d))&&(i.empty&&u<=i.from&&d>=i.to?a.push(lX.range(u,d)):(u>=i.to||d<=i.from)&&a.push(aX.range(u,d)),a.length>e.maxMatches))return mt.none}}return mt.set(a)}},{decorations:n=>n.decorations}),fX=et.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),dX=({state:n,dispatch:e})=>{let{selection:t}=n,r=_e.create(t.ranges.map(i=>n.wordAt(i.head)||_e.cursor(i.head)),t.mainIndex);return r.eq(t)?!1:(e(n.update({selection:r})),!0)};function hX(n,e){let{main:t,ranges:r}=n.selection,i=n.wordAt(t.head),s=i&&i.from==t.from&&i.to==t.to;for(let o=!1,a=new tf(n.doc,e,r[r.length-1].to);;)if(a.next(),a.done){if(o)return null;a=new tf(n.doc,e,0,Math.max(0,r[r.length-1].from-1)),o=!0}else{if(o&&r.some(l=>l.from==a.value.from))continue;if(s){let l=n.wordAt(a.value.from);if(!l||l.from!=a.value.from||l.to!=a.value.to)continue}return a.value}}const pX=({state:n,dispatch:e})=>{let{ranges:t}=n.selection;if(t.some(s=>s.from===s.to))return dX({state:n,dispatch:e});let r=n.sliceDoc(t[0].from,t[0].to);if(n.selection.ranges.some(s=>n.sliceDoc(s.from,s.to)!=r))return!1;let i=hX(n,r);return i?(e(n.update({selection:n.selection.addRange(_e.range(i.from,i.to),!1),effects:et.scrollIntoView(i.to)})),!0):!1},df=ft.define({combine(n){return go(n,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new kX(e),scrollToMatch:e=>et.scrollIntoView(e)})}});class cj{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||tX(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(t,r)=>r=="n"?`
|
|
127
|
+
`:r=="r"?"\r":r=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new vX(this):new gX(this)}getCursor(e,t=0,r){let i=e.doc?e:Cn.create({doc:e});return r==null&&(r=i.doc.length),this.regexp?bu(this,i,t,r):yu(this,i,t,r)}}class uj{constructor(e){this.spec=e}}function yu(n,e,t,r){return new tf(e.doc,n.unquoted,t,r,n.caseSensitive?void 0:i=>i.toLowerCase(),n.wholeWord?mX(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function mX(n,e){return(t,r,i,s)=>((s>t||s+i.length<r)&&(s=Math.max(0,t-2),i=n.sliceString(s,Math.min(n.length,r+2))),(e(OO(i,t-s))!=br.Word||e(vO(i,t-s))!=br.Word)&&(e(vO(i,r-s))!=br.Word||e(OO(i,r-s))!=br.Word))}class gX extends uj{constructor(e){super(e)}nextMatch(e,t,r){let i=yu(this.spec,e,r,e.doc.length).nextOverlapping();if(i.done){let s=Math.min(e.doc.length,t+this.spec.unquoted.length);i=yu(this.spec,e,0,s).nextOverlapping()}return i.done||i.value.from==t&&i.value.to==r?null:i.value}prevMatchInRange(e,t,r){for(let i=r;;){let s=Math.max(t,i-1e4-this.spec.unquoted.length),o=yu(this.spec,e,s,i),a=null;for(;!o.nextOverlapping().done;)a=o.value;if(a)return a;if(s==t)return null;i-=1e4}}prevMatch(e,t,r){let i=this.prevMatchInRange(e,0,t);return i||(i=this.prevMatchInRange(e,Math.max(0,r-this.spec.unquoted.length),e.doc.length)),i&&(i.from!=t||i.to!=r)?i:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let r=yu(this.spec,e,0,e.doc.length),i=[];for(;!r.next().done;){if(i.length>=t)return null;i.push(r.value)}return i}highlight(e,t,r,i){let s=yu(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(r+this.spec.unquoted.length,e.doc.length));for(;!s.next().done;)i(s.value.from,s.value.to)}}function bu(n,e,t,r){return new aj(e.doc,n.search,{ignoreCase:!n.caseSensitive,test:n.wholeWord?OX(e.charCategorizer(e.selection.main.head)):void 0},t,r)}function OO(n,e){return n.slice(vi(n,e,!1),e)}function vO(n,e){return n.slice(e,vi(n,e))}function OX(n){return(e,t,r)=>!r[0].length||(n(OO(r.input,r.index))!=br.Word||n(vO(r.input,r.index))!=br.Word)&&(n(vO(r.input,r.index+r[0].length))!=br.Word||n(OO(r.input,r.index+r[0].length))!=br.Word)}class vX extends uj{nextMatch(e,t,r){let i=bu(this.spec,e,r,e.doc.length).next();return i.done&&(i=bu(this.spec,e,0,t).next()),i.done?null:i.value}prevMatchInRange(e,t,r){for(let i=1;;i++){let s=Math.max(t,r-i*1e4),o=bu(this.spec,e,s,r),a=null;for(;!o.next().done;)a=o.value;if(a&&(s==t||a.from>s+10))return a;if(s==t)return null}}prevMatch(e,t,r){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,r,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,r)=>{if(r=="&")return e.match[0];if(r=="$")return"$";for(let i=r.length;i>0;i--){let s=+r.slice(0,i);if(s>0&&s<e.match.length)return e.match[s]+r.slice(i)}return t})}matchAll(e,t){let r=bu(this.spec,e,0,e.doc.length),i=[];for(;!r.next().done;){if(i.length>=t)return null;i.push(r.value)}return i}highlight(e,t,r,i){let s=bu(this.spec,e,Math.max(0,t-250),Math.min(r+250,e.doc.length));for(;!s.next().done;)i(s.value.from,s.value.to)}}const Jd=Yt.define(),wk=Yt.define(),wl=Zr.define({create(n){return new j0(K1(n).create(),null)},update(n,e){for(let t of e.effects)t.is(Jd)?n=new j0(t.value.create(),n.panel):t.is(wk)&&(n=new j0(n.query,t.value?kk:null));return n},provide:n=>Yd.from(n,e=>e.panel)});class j0{constructor(e,t){this.query=e,this.panel=t}}const yX=mt.mark({class:"cm-searchMatch"}),bX=mt.mark({class:"cm-searchMatch cm-searchMatch-selected"}),SX=Xn.fromClass(class{constructor(n){this.view=n,this.decorations=this.highlight(n.state.field(wl))}update(n){let e=n.state.field(wl);(e!=n.startState.field(wl)||n.docChanged||n.selectionSet||n.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:n,panel:e}){if(!e||!n.spec.valid)return mt.none;let{view:t}=this,r=new xa;for(let i=0,s=t.visibleRanges,o=s.length;i<o;i++){let{from:a,to:l}=s[i];for(;i<o-1&&l>s[i+1].from-2*250;)l=s[++i].to;n.highlight(t.state,a,l,(c,u)=>{let d=t.state.selection.ranges.some(h=>h.from==c&&h.to==u);r.add(c,u,d?bX:yX)})}return r.finish()}},{decorations:n=>n.decorations});function kh(n){return e=>{let t=e.state.field(wl,!1);return t&&t.query.spec.valid?n(e,t):mj(e)}}const zE=kh((n,{query:e})=>{let{to:t}=n.state.selection.main,r=e.nextMatch(n.state,t,t);if(!r)return!1;let i=_e.single(r.from,r.to),s=n.state.facet(df);return n.dispatch({selection:i,effects:[Pk(n,r),s.scrollToMatch(i.main,n)],userEvent:"select.search"}),pj(n),!0}),YE=kh((n,{query:e})=>{let{state:t}=n,{from:r}=t.selection.main,i=e.prevMatch(t,r,r);if(!i)return!1;let s=_e.single(i.from,i.to),o=n.state.facet(df);return n.dispatch({selection:s,effects:[Pk(n,i),o.scrollToMatch(s.main,n)],userEvent:"select.search"}),pj(n),!0}),fj=kh((n,{query:e})=>{let t=e.matchAll(n.state,1e3);return!t||!t.length?!1:(n.dispatch({selection:_e.create(t.map(r=>_e.range(r.from,r.to))),userEvent:"select.search.matches"}),!0)}),wX=({state:n,dispatch:e})=>{let t=n.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:r,to:i}=t.main,s=[],o=0;for(let a=new tf(n.doc,n.sliceDoc(r,i));!a.next().done;){if(s.length>1e3)return!1;a.value.from==r&&(o=s.length),s.push(_e.range(a.value.from,a.value.to))}return e(n.update({selection:_e.create(s,o),userEvent:"select.search.matches"})),!0},GE=kh((n,{query:e})=>{let{state:t}=n,{from:r,to:i}=t.selection.main;if(t.readOnly)return!1;let s=e.nextMatch(t,r,r);if(!s)return!1;let o=s,a=[],l,c,u=[];if(o.from==r&&o.to==i&&(c=t.toText(e.getReplacement(o)),a.push({from:o.from,to:o.to,insert:c}),o=e.nextMatch(t,o.from,o.to),u.push(et.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(r).number)+"."))),o){let d=a.length==0||a[0].from>=s.to?0:s.to-s.from-c.length;l=_e.single(o.from-d,o.to-d),u.push(Pk(n,o)),u.push(t.facet(df).scrollToMatch(l.main,n))}return n.dispatch({changes:a,selection:l,effects:u,userEvent:"input.replace"}),!0}),dj=kh((n,{query:e})=>{if(n.state.readOnly)return!1;let t=e.matchAll(n.state,1e9).map(i=>{let{from:s,to:o}=i;return{from:s,to:o,insert:e.getReplacement(i)}});if(!t.length)return!1;let r=n.state.phrase("replaced $ matches",t.length)+".";return n.dispatch({changes:t,effects:et.announce.of(r),userEvent:"input.replace.all"}),!0});function kk(n){return n.state.facet(df).createPanel(n)}function K1(n,e){var t,r,i,s,o;let a=n.selection.main,l=a.empty||a.to>a.from+100?"":n.sliceDoc(a.from,a.to);if(e&&!l)return e;let c=n.facet(df);return new cj({search:((t=e==null?void 0:e.literal)!==null&&t!==void 0?t:c.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:(r=e==null?void 0:e.caseSensitive)!==null&&r!==void 0?r:c.caseSensitive,literal:(i=e==null?void 0:e.literal)!==null&&i!==void 0?i:c.literal,regexp:(s=e==null?void 0:e.regexp)!==null&&s!==void 0?s:c.regexp,wholeWord:(o=e==null?void 0:e.wholeWord)!==null&&o!==void 0?o:c.wholeWord})}function hj(n){let e=zd(n,kk);return e&&e.dom.querySelector("[main-field]")}function pj(n){let e=hj(n);e&&e==n.root.activeElement&&e.select()}const mj=n=>{let e=n.state.field(wl,!1);if(e&&e.panel){let t=hj(n);if(t&&t!=n.root.activeElement){let r=K1(n.state,e.query.spec);r.valid&&n.dispatch({effects:Jd.of(r)}),t.focus(),t.select()}}else n.dispatch({effects:[wk.of(!0),e?Jd.of(K1(n.state,e.query.spec)):Yt.appendConfig.of(xX)]});return!0},gj=n=>{let e=n.state.field(wl,!1);if(!e||!e.panel)return!1;let t=zd(n,kk);return t&&t.dom.contains(n.root.activeElement)&&n.focus(),n.dispatch({effects:wk.of(!1)}),!0};class kX{constructor(e){this.view=e;let t=this.query=e.state.field(wl).query.spec;this.commit=this.commit.bind(this),this.searchField=sr("input",{value:t.search,placeholder:ds(e,"Find"),"aria-label":ds(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=sr("input",{value:t.replace,placeholder:ds(e,"Replace"),"aria-label":ds(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=sr("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=sr("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=sr("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function r(i,s,o){return sr("button",{class:"cm-button",name:i,onclick:s,type:"button"},o)}this.dom=sr("div",{onkeydown:i=>this.keydown(i),class:"cm-search"},[this.searchField,r("next",()=>zE(e),[ds(e,"next")]),r("prev",()=>YE(e),[ds(e,"previous")]),r("select",()=>fj(e),[ds(e,"all")]),sr("label",null,[this.caseField,ds(e,"match case")]),sr("label",null,[this.reField,ds(e,"regexp")]),sr("label",null,[this.wordField,ds(e,"by word")]),...e.state.readOnly?[]:[sr("br"),this.replaceField,r("replace",()=>GE(e),[ds(e,"replace")]),r("replaceAll",()=>dj(e),[ds(e,"replace all")])],sr("button",{name:"close",onclick:()=>gj(e),"aria-label":ds(e,"close"),type:"button"},["×"])])}commit(){let e=new cj({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:Jd.of(e)}))}keydown(e){tZ(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?YE:zE)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),GE(this.view))}update(e){for(let t of e.transactions)for(let r of t.effects)r.is(Jd)&&!r.value.eq(this.query)&&this.setQuery(r.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(df).top}}function ds(n,e){return n.state.phrase(e)}const Yp=30,Gp=/[\s\.,:;?!]/;function Pk(n,{from:e,to:t}){let r=n.state.doc.lineAt(e),i=n.state.doc.lineAt(t).to,s=Math.max(r.from,e-Yp),o=Math.min(i,t+Yp),a=n.state.sliceDoc(s,o);if(s!=r.from){for(let l=0;l<Yp;l++)if(!Gp.test(a[l+1])&&Gp.test(a[l])){a=a.slice(l);break}}if(o!=i){for(let l=a.length-1;l>a.length-Yp;l--)if(!Gp.test(a[l-1])&&Gp.test(a[l])){a=a.slice(0,l);break}}return et.announce.of(`${n.state.phrase("current match")}. ${a} ${n.state.phrase("on line")} ${r.number}.`)}const PX=et.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),xX=[wl,Go.low(SX),PX];class xk{constructor(e,t,r,i){this.state=e,this.pos=t,this.explicit=r,this.view=i,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=pr(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),r=Math.max(t.from,this.pos-250),i=t.text.slice(r-t.from,this.pos-t.from),s=i.search(vj(e,!1));return s<0?null:{from:r+s,to:this.pos,text:i.slice(s)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,r){e=="abort"&&this.abortListeners&&(this.abortListeners.push(t),r&&r.onDocChange&&(this.abortOnDocChange=!0))}}function HE(n){let e=Object.keys(n).join(""),t=/\w/.test(e);return t&&(e=e.replace(/\w/g,"")),`[${t?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function TX(n){let e=Object.create(null),t=Object.create(null);for(let{label:i}of n){e[i[0]]=!0;for(let s=1;s<i.length;s++)t[i[s]]=!0}let r=HE(e)+HE(t)+"*$";return[new RegExp("^"+r),new RegExp(r)]}function Oj(n){let e=n.map(i=>typeof i=="string"?{label:i}:i),[t,r]=e.every(i=>/^\w+$/.test(i.label))?[/\w*$/,/\w+$/]:TX(e);return i=>{let s=i.matchBefore(r);return s||i.explicit?{from:s?s.from:i.pos,options:e,validFor:t}:null}}function CX(n,e){return t=>{for(let r=pr(t.state).resolveInner(t.pos,-1);r;r=r.parent){if(n.indexOf(r.name)>-1)return null;if(r.type.isTop)break}return e(t)}}class KE{constructor(e,t,r,i){this.completion=e,this.source=t,this.match=r,this.score=i}}function kc(n){return n.selection.main.from}function vj(n,e){var t;let{source:r}=n,i=e&&r[0]!="^",s=r[r.length-1]!="$";return!i&&!s?n:new RegExp(`${i?"^":""}(?:${r})${s?"$":""}`,(t=n.flags)!==null&&t!==void 0?t:n.ignoreCase?"i":"")}const Tk=Ho.define();function _X(n,e,t,r){let{main:i}=n.selection,s=t-i.from,o=r-i.from;return Object.assign(Object.assign({},n.changeByRange(a=>{if(a!=i&&t!=r&&n.sliceDoc(a.from+s,a.from+o)!=n.sliceDoc(t,r))return{range:a};let l=n.toText(e);return{changes:{from:a.from+s,to:r==i.from?a.to:a.from+o,insert:l},range:_e.cursor(a.from+s+l.length)}})),{scrollIntoView:!0,userEvent:"input.complete"})}const JE=new WeakMap;function EX(n){if(!Array.isArray(n))return n;let e=JE.get(n);return e||JE.set(n,e=Oj(n)),e}const yO=Yt.define(),eh=Yt.define();class RX{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let r=es(e,t),i=Uo(r);this.chars.push(r);let s=e.slice(t,t+i),o=s.toUpperCase();this.folded.push(es(o==s?s.toLowerCase():o,0)),t+=i}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:r,any:i,precise:s,byWord:o}=this;if(t.length==1){let S=es(e,0),P=Uo(S),k=P==e.length?0:-100;if(S!=t[0])if(S==r[0])k+=-200;else return null;return this.ret(k,[0,P])}let a=e.indexOf(this.pattern);if(a==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let l=t.length,c=0;if(a<0){for(let S=0,P=Math.min(e.length,200);S<P&&c<l;){let k=es(e,S);(k==t[c]||k==r[c])&&(i[c++]=S),S+=Uo(k)}if(c<l)return null}let u=0,d=0,h=!1,m=0,g=-1,O=-1,y=/[a-z]/.test(e),b=!0;for(let S=0,P=Math.min(e.length,200),k=0;S<P&&d<l;){let x=es(e,S);a<0&&(u<l&&x==t[u]&&(s[u++]=S),m<l&&(x==t[m]||x==r[m]?(m==0&&(g=S),O=S+1,m++):m=0));let A,M=x<255?x>=48&&x<=57||x>=97&&x<=122?2:x>=65&&x<=90?1:0:(A=Vw(x))!=A.toLowerCase()?1:A!=A.toUpperCase()?2:0;(!S||M==1&&y||k==0&&M!=0)&&(t[d]==x||r[d]==x&&(h=!0)?o[d++]=S:o.length&&(b=!1)),k=M,S+=Uo(x)}return d==l&&o[0]==0&&b?this.result(-100+(h?-200:0),o,e):m==l&&g==0?this.ret(-200-e.length+(O==e.length?0:-100),[0,O]):a>-1?this.ret(-700-e.length,[a,a+this.pattern.length]):m==l?this.ret(-900-e.length,[g,O]):d==l?this.result(-100+(h?-200:0)+-700+(b?0:-1100),o,e):t.length==2?null:this.result((i[0]?-700:0)+-200+-1100,i,e)}result(e,t,r){let i=[],s=0;for(let o of t){let a=o+(this.astral?Uo(es(r,o)):1);s&&i[s-1]==o?i[s-1]=a:(i[s++]=o,i[s++]=a)}return this.ret(e-r.length,i)}}class AX{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let t=e.slice(0,this.pattern.length),r=t==this.pattern?0:t.toLowerCase()==this.folded?-200:null;return r==null?null:(this.matched=[0,t.length],this.score=r+(e.length==this.pattern.length?0:-100),this)}}const ci=ft.define({combine(n){return go(n,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:$X,filterStrict:!1,compareCompletions:(e,t)=>e.label.localeCompare(t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>r=>eR(e(r),t(r)),optionClass:(e,t)=>r=>eR(e(r),t(r)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})}});function eR(n,e){return n?e?n+" "+e:n:e}function $X(n,e,t,r,i,s){let o=n.textDirection==hr.RTL,a=o,l=!1,c="top",u,d,h=e.left-i.left,m=i.right-e.right,g=r.right-r.left,O=r.bottom-r.top;if(a&&h<Math.min(g,m)?a=!1:!a&&m<Math.min(g,h)&&(a=!0),g<=(a?h:m))u=Math.max(i.top,Math.min(t.top,i.bottom-O))-e.top,d=Math.min(400,a?h:m);else{l=!0,d=Math.min(400,(o?e.right:i.right-e.left)-30);let S=i.bottom-e.bottom;S>=O||S>e.top?u=t.bottom-e.top:(c="bottom",u=e.bottom-t.top)}let y=(e.bottom-e.top)/s.offsetHeight,b=(e.right-e.left)/s.offsetWidth;return{style:`${c}: ${u/y}px; max-width: ${d/b}px`,class:"cm-completionInfo-"+(l?o?"left-narrow":"right-narrow":a?"left":"right")}}function MX(n){let e=n.addToOptions.slice();return n.icons&&e.push({render(t){let r=document.createElement("div");return r.classList.add("cm-completionIcon"),t.type&&r.classList.add(...t.type.split(/\s+/g).map(i=>"cm-completionIcon-"+i)),r.setAttribute("aria-hidden","true"),r},position:20}),e.push({render(t,r,i,s){let o=document.createElement("span");o.className="cm-completionLabel";let a=t.displayLabel||t.label,l=0;for(let c=0;c<s.length;){let u=s[c++],d=s[c++];u>l&&o.appendChild(document.createTextNode(a.slice(l,u)));let h=o.appendChild(document.createElement("span"));h.appendChild(document.createTextNode(a.slice(u,d))),h.className="cm-completionMatchedText",l=d}return l<a.length&&o.appendChild(document.createTextNode(a.slice(l))),o},position:50},{render(t){if(!t.detail)return null;let r=document.createElement("span");return r.className="cm-completionDetail",r.textContent=t.detail,r},position:80}),e.sort((t,r)=>t.position-r.position).map(t=>t.render)}function N0(n,e,t){if(n<=t)return{from:0,to:n};if(e<0&&(e=0),e<=n>>1){let i=Math.floor(e/t);return{from:i*t,to:(i+1)*t}}let r=Math.floor((n-e)/t);return{from:n-(r+1)*t,to:n-r*t}}class QX{constructor(e,t,r){this.view=e,this.stateField=t,this.applyCompletion=r,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:l=>this.placeInfo(l),key:this},this.space=null,this.currentClass="";let i=e.state.field(t),{options:s,selected:o}=i.open,a=e.state.facet(ci);this.optionContent=MX(a),this.optionClass=a.optionClass,this.tooltipClass=a.tooltipClass,this.range=N0(s.length,o,a.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",l=>{let{options:c}=e.state.field(t).open;for(let u=l.target,d;u&&u!=this.dom;u=u.parentNode)if(u.nodeName=="LI"&&(d=/-(\d+)$/.exec(u.id))&&+d[1]<c.length){this.applyCompletion(e,c[+d[1]]),l.preventDefault();return}}),this.dom.addEventListener("focusout",l=>{let c=e.state.field(this.stateField,!1);c&&c.tooltip&&e.state.facet(ci).closeOnBlur&&l.relatedTarget!=e.contentDOM&&e.dispatch({effects:eh.of(null)})}),this.showOptions(s,i.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var t;let r=e.state.field(this.stateField),i=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),r!=i){let{options:s,selected:o,disabled:a}=r.open;(!i.open||i.open.options!=s)&&(this.range=N0(s.length,o,e.state.facet(ci).maxRenderedOptions),this.showOptions(s,r.id)),this.updateSel(),a!=((t=i.open)===null||t===void 0?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!a)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let r of this.currentClass.split(" "))r&&this.dom.classList.remove(r);for(let r of t.split(" "))r&&this.dom.classList.add(r);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;if((t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=N0(t.options.length,t.selected,this.view.state.facet(ci).maxRenderedOptions),this.showOptions(t.options,e.id)),this.updateSelectedOption(t.selected)){this.destroyInfo();let{completion:r}=t.options[t.selected],{info:i}=r;if(!i)return;let s=typeof i=="string"?document.createTextNode(i):i(r);if(!s)return;"then"in s?s.then(o=>{o&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(o,r)}).catch(o=>is(this.view.state,o,"completion info")):this.addInfoPane(s,r)}}addInfoPane(e,t){this.destroyInfo();let r=this.info=document.createElement("div");if(r.className="cm-tooltip cm-completionInfo",e.nodeType!=null)r.appendChild(e),this.infoDestroy=null;else{let{dom:i,destroy:s}=e;r.appendChild(i),this.infoDestroy=s||null}this.dom.appendChild(r),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let r=this.list.firstChild,i=this.range.from;r;r=r.nextSibling,i++)r.nodeName!="LI"||!r.id?i--:i==e?r.hasAttribute("aria-selected")||(r.setAttribute("aria-selected","true"),t=r):r.hasAttribute("aria-selected")&&r.removeAttribute("aria-selected");return t&&IX(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),r=this.info.getBoundingClientRect(),i=e.getBoundingClientRect(),s=this.space;if(!s){let o=this.dom.ownerDocument.documentElement;s={left:0,top:0,right:o.clientWidth,bottom:o.clientHeight}}return i.top>Math.min(s.bottom,t.bottom)-10||i.bottom<Math.max(s.top,t.top)+10?null:this.view.state.facet(ci).positionInfo(this.view,t,i,r,s,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className="cm-tooltip cm-completionInfo "+(e.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(e,t,r){const i=document.createElement("ul");i.id=t,i.setAttribute("role","listbox"),i.setAttribute("aria-expanded","true"),i.setAttribute("aria-label",this.view.state.phrase("Completions")),i.addEventListener("mousedown",o=>{o.target==i&&o.preventDefault()});let s=null;for(let o=r.from;o<r.to;o++){let{completion:a,match:l}=e[o],{section:c}=a;if(c){let h=typeof c=="string"?c:c.name;if(h!=s&&(o>r.from||r.from==0))if(s=h,typeof c!="string"&&c.header)i.appendChild(c.header(c));else{let m=i.appendChild(document.createElement("completion-section"));m.textContent=h}}const u=i.appendChild(document.createElement("li"));u.id=t+"-"+o,u.setAttribute("role","option");let d=this.optionClass(a);d&&(u.className=d);for(let h of this.optionContent){let m=h(a,this.view.state,this.view,l);m&&u.appendChild(m)}}return r.from&&i.classList.add("cm-completionListIncompleteTop"),r.to<e.length&&i.classList.add("cm-completionListIncompleteBottom"),i}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function DX(n,e){return t=>new QX(t,n,e)}function IX(n,e){let t=n.getBoundingClientRect(),r=e.getBoundingClientRect(),i=t.height/n.offsetHeight;r.top<t.top?n.scrollTop-=(t.top-r.top)/i:r.bottom>t.bottom&&(n.scrollTop+=(r.bottom-t.bottom)/i)}function tR(n){return(n.boost||0)*100+(n.apply?10:0)+(n.info?5:0)+(n.type?1:0)}function jX(n,e){let t=[],r=null,i=c=>{t.push(c);let{section:u}=c.completion;if(u){r||(r=[]);let d=typeof u=="string"?u:u.name;r.some(h=>h.name==d)||r.push(typeof u=="string"?{name:d}:u)}},s=e.facet(ci);for(let c of n)if(c.hasResult()){let u=c.result.getMatch;if(c.result.filter===!1)for(let d of c.result.options)i(new KE(d,c.source,u?u(d):[],1e9-t.length));else{let d=e.sliceDoc(c.from,c.to),h,m=s.filterStrict?new AX(d):new RX(d);for(let g of c.result.options)if(h=m.match(g.label)){let O=g.displayLabel?u?u(g,h.matched):[]:h.matched;i(new KE(g,c.source,O,h.score+(g.boost||0)))}}}if(r){let c=Object.create(null),u=0,d=(h,m)=>{var g,O;return((g=h.rank)!==null&&g!==void 0?g:1e9)-((O=m.rank)!==null&&O!==void 0?O:1e9)||(h.name<m.name?-1:1)};for(let h of r.sort(d))u-=1e5,c[h.name]=u;for(let h of t){let{section:m}=h.completion;m&&(h.score+=c[typeof m=="string"?m:m.name])}}let o=[],a=null,l=s.compareCompletions;for(let c of t.sort((u,d)=>d.score-u.score||l(u.completion,d.completion))){let u=c.completion;!a||a.label!=u.label||a.detail!=u.detail||a.type!=null&&u.type!=null&&a.type!=u.type||a.apply!=u.apply||a.boost!=u.boost?o.push(c):tR(c.completion)>tR(a)&&(o[o.length-1]=c),a=c.completion}return o}class Cu{constructor(e,t,r,i,s,o){this.options=e,this.attrs=t,this.tooltip=r,this.timestamp=i,this.selected=s,this.disabled=o}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new Cu(this.options,nR(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,r,i,s,o){if(i&&!o&&e.some(c=>c.isPending))return i.setDisabled();let a=jX(e,t);if(!a.length)return i&&e.some(c=>c.isPending)?i.setDisabled():null;let l=t.facet(ci).selectOnOpen?0:-1;if(i&&i.selected!=l&&i.selected!=-1){let c=i.options[i.selected].completion;for(let u=0;u<a.length;u++)if(a[u].completion==c){l=u;break}}return new Cu(a,nR(r,l),{pos:e.reduce((c,u)=>u.hasResult()?Math.min(c,u.from):c,1e8),create:FX,above:s.aboveCursor},i?i.timestamp:Date.now(),l,!1)}map(e){return new Cu(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}setDisabled(){return new Cu(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class bO{constructor(e,t,r){this.active=e,this.id=t,this.open=r}static start(){return new bO(UX,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:t}=e,r=t.facet(ci),s=(r.override||t.languageDataAt("autocomplete",kc(t)).map(EX)).map(l=>(this.active.find(u=>u.source==l)||new js(l,this.active.some(u=>u.state!=0)?1:0)).update(e,r));s.length==this.active.length&&s.every((l,c)=>l==this.active[c])&&(s=this.active);let o=this.open,a=e.effects.some(l=>l.is(Ck));o&&e.docChanged&&(o=o.map(e.changes)),e.selection||s.some(l=>l.hasResult()&&e.changes.touchesRange(l.from,l.to))||!NX(s,this.active)||a?o=Cu.build(s,t,this.id,o,r,a):o&&o.disabled&&!s.some(l=>l.isPending)&&(o=null),!o&&s.every(l=>!l.isPending)&&s.some(l=>l.hasResult())&&(s=s.map(l=>l.hasResult()?new js(l.source,0):l));for(let l of e.effects)l.is(bj)&&(o=o&&o.setSelected(l.value,this.id));return s==this.active&&o==this.open?this:new bO(s,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?LX:qX}}function NX(n,e){if(n==e)return!0;for(let t=0,r=0;;){for(;t<n.length&&!n[t].hasResult();)t++;for(;r<e.length&&!e[r].hasResult();)r++;let i=t==n.length,s=r==e.length;if(i||s)return i==s;if(n[t++].result!=e[r++].result)return!1}}const LX={"aria-autocomplete":"list"},qX={};function nR(n,e){let t={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":n};return e>-1&&(t["aria-activedescendant"]=n+"-"+e),t}const UX=[];function yj(n,e){if(n.isUserEvent("input.complete")){let r=n.annotation(Tk);if(r&&e.activateOnCompletion(r))return 12}let t=n.isUserEvent("input.type");return t&&e.activateOnTyping?5:t?1:n.isUserEvent("delete.backward")?2:n.selection?8:n.docChanged?16:0}class js{constructor(e,t,r=!1){this.source=e,this.state=t,this.explicit=r}hasResult(){return!1}get isPending(){return this.state==1}update(e,t){let r=yj(e,t),i=this;(r&8||r&16&&this.touches(e))&&(i=new js(i.source,0)),r&4&&i.state==0&&(i=new js(this.source,1)),i=i.updateFor(e,r);for(let s of e.effects)if(s.is(yO))i=new js(i.source,1,s.value);else if(s.is(eh))i=new js(i.source,0);else if(s.is(Ck))for(let o of s.value)o.source==i.source&&(i=o);return i}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(kc(e.state))}}class qu extends js{constructor(e,t,r,i,s,o){super(e,3,t),this.limit=r,this.result=i,this.from=s,this.to=o}hasResult(){return!0}updateFor(e,t){var r;if(!(t&3))return this.map(e.changes);let i=this.result;i.map&&!e.changes.empty&&(i=i.map(i,e.changes));let s=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),a=kc(e.state);if(a>o||!i||t&2&&(kc(e.startState)==this.from||a<this.limit))return new js(this.source,t&4?1:0);let l=e.changes.mapPos(this.limit);return BX(i.validFor,e.state,s,o)?new qu(this.source,this.explicit,l,i,s,o):i.update&&(i=i.update(i,s,o,new xk(e.state,a,!1)))?new qu(this.source,this.explicit,l,i,i.from,(r=i.to)!==null&&r!==void 0?r:kc(e.state)):new js(this.source,1,this.explicit)}map(e){return e.empty?this:(this.result.map?this.result.map(this.result,e):this.result)?new qu(this.source,this.explicit,e.mapPos(this.limit),this.result,e.mapPos(this.from),e.mapPos(this.to,1)):new js(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}function BX(n,e,t,r){if(!n)return!1;let i=e.sliceDoc(t,r);return typeof n=="function"?n(i,t,r,e):vj(n,!0).test(i)}const Ck=Yt.define({map(n,e){return n.map(t=>t.map(e))}}),bj=Yt.define(),ns=Zr.define({create(){return bO.start()},update(n,e){return n.update(e)},provide:n=>[sk.from(n,e=>e.tooltip),et.contentAttributes.from(n,e=>e.attrs)]});function _k(n,e){const t=e.completion.apply||e.completion.label;let r=n.state.field(ns).active.find(i=>i.source==e.source);return r instanceof qu?(typeof t=="string"?n.dispatch(Object.assign(Object.assign({},_X(n.state,t,r.from,r.to)),{annotations:Tk.of(e.completion)})):t(n,e.completion,r.from,r.to),!0):!1}const FX=DX(ns,_k);function yl(n,e="option"){return t=>{let r=t.state.field(ns,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp<t.state.facet(ci).interactionDelay)return!1;let i=1,s;e=="page"&&(s=c5(t,r.open.tooltip))&&(i=Math.max(2,Math.floor(s.dom.offsetHeight/s.dom.querySelector("li").offsetHeight)-1));let{length:o}=r.open.options,a=r.open.selected>-1?r.open.selected+i*(n?1:-1):n?0:o-1;return a<0?a=e=="page"?0:o-1:a>=o&&(a=e=="page"?o-1:0),t.dispatch({effects:bj.of(a)}),!0}}const J1=n=>{let e=n.state.field(ns,!1);return n.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestamp<n.state.facet(ci).interactionDelay?!1:_k(n,e.open.options[e.open.selected])},ew=n=>n.state.field(ns,!1)?(n.dispatch({effects:yO.of(!0)}),!0):!1,Sj=n=>{let e=n.state.field(ns,!1);return!e||!e.active.some(t=>t.state!=0)?!1:(n.dispatch({effects:eh.of(null)}),!0)};class VX{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const ZX=50,WX=1e3,XX=Xn.fromClass(class{constructor(n){this.view=n,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of n.state.field(ns).active)e.isPending&&this.startQuery(e)}update(n){let e=n.state.field(ns),t=n.state.facet(ci);if(!n.selectionSet&&!n.docChanged&&n.startState.field(ns)==e)return;let r=n.transactions.some(s=>{let o=yj(s,t);return o&8||(s.selection||s.docChanged)&&!(o&3)});for(let s=0;s<this.running.length;s++){let o=this.running[s];if(r||o.context.abortOnDocChange&&n.docChanged||o.updates.length+n.transactions.length>ZX&&Date.now()-o.time>WX){for(let a of o.context.abortListeners)try{a()}catch(l){is(this.view.state,l)}o.context.abortListeners=null,this.running.splice(s--,1)}else o.updates.push(...n.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),n.transactions.some(s=>s.effects.some(o=>o.is(yO)))&&(this.pendingStart=!0);let i=this.pendingStart?50:t.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(s=>s.isPending&&!this.running.some(o=>o.active.source==s.source))?setTimeout(()=>this.startUpdate(),i):-1,this.composing!=0)for(let s of n.transactions)s.isUserEvent("input.type")?this.composing=2:this.composing==2&&s.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:n}=this.view,e=n.field(ns);for(let t of e.active)t.isPending&&!this.running.some(r=>r.active.source==t.source)&&this.startQuery(t);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(ci).updateSyncTime))}startQuery(n){let{state:e}=this.view,t=kc(e),r=new xk(e,t,n.explicit,this.view),i=new VX(n,r);this.running.push(i),Promise.resolve(n.source(r)).then(s=>{i.context.aborted||(i.done=s||null,this.scheduleAccept())},s=>{this.view.dispatch({effects:eh.of(null)}),is(this.view.state,s)})}scheduleAccept(){this.running.every(n=>n.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(ci).updateSyncTime))}accept(){var n;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(ci),r=this.view.state.field(ns);for(let i=0;i<this.running.length;i++){let s=this.running[i];if(s.done===void 0)continue;if(this.running.splice(i--,1),s.done){let a=kc(s.updates.length?s.updates[0].startState:this.view.state),l=Math.min(a,s.done.from+(s.active.explicit?0:1)),c=new qu(s.active.source,s.active.explicit,l,s.done,s.done.from,(n=s.done.to)!==null&&n!==void 0?n:a);for(let u of s.updates)c=c.update(u,t);if(c.hasResult()){e.push(c);continue}}let o=r.active.find(a=>a.source==s.active.source);if(o&&o.isPending)if(s.done==null){let a=new js(s.active.source,0);for(let l of s.updates)a=a.update(l,t);a.isPending||e.push(a)}else this.startQuery(o)}(e.length||r.open&&r.open.disabled)&&this.view.dispatch({effects:Ck.of(e)})}},{eventHandlers:{blur(n){let e=this.view.state.field(ns,!1);if(e&&e.tooltip&&this.view.state.facet(ci).closeOnBlur){let t=e.open&&c5(this.view,e.open.tooltip);(!t||!t.dom.contains(n.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:eh.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:yO.of(!1)}),20),this.composing=0}}}),zX=typeof navigator=="object"&&/Win/.test(navigator.platform),YX=Go.highest(et.domEventHandlers({keydown(n,e){let t=e.state.field(ns,!1);if(!t||!t.open||t.open.disabled||t.open.selected<0||n.key.length>1||n.ctrlKey&&!(zX&&n.altKey)||n.metaKey)return!1;let r=t.open.options[t.open.selected],i=t.active.find(o=>o.source==r.source),s=r.completion.commitCharacters||i.result.commitCharacters;return s&&s.indexOf(n.key)>-1&&_k(e,r),!1}})),wj=et.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class GX{constructor(e,t,r,i){this.field=e,this.line=t,this.from=r,this.to=i}}class Ek{constructor(e,t,r){this.field=e,this.from=t,this.to=r}map(e){let t=e.mapPos(this.from,-1,Kr.TrackDel),r=e.mapPos(this.to,1,Kr.TrackDel);return t==null||r==null?null:new Ek(this.field,t,r)}}class Rk{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let r=[],i=[t],s=e.doc.lineAt(t),o=/^\s*/.exec(s.text)[0];for(let l of this.lines){if(r.length){let c=o,u=/^\t*/.exec(l)[0].length;for(let d=0;d<u;d++)c+=e.facet(yh);i.push(t+c.length-u),l=c+l.slice(u)}r.push(l),t+=l.length+1}let a=this.fieldPositions.map(l=>new Ek(l.field,i[l.line]+l.from,i[l.line]+l.to));return{text:r,ranges:a}}static parse(e){let t=[],r=[],i=[],s;for(let o of e.split(/\r\n?|\n/)){for(;s=/[#$]\{(?:(\d+)(?::([^}]*))?|((?:\\[{}]|[^}])*))\}/.exec(o);){let a=s[1]?+s[1]:null,l=s[2]||s[3]||"",c=-1,u=l.replace(/\\[{}]/g,d=>d[1]);for(let d=0;d<t.length;d++)(a!=null?t[d].seq==a:u&&t[d].name==u)&&(c=d);if(c<0){let d=0;for(;d<t.length&&(a==null||t[d].seq!=null&&t[d].seq<a);)d++;t.splice(d,0,{seq:a,name:u}),c=d;for(let h of i)h.field>=c&&h.field++}i.push(new GX(c,r.length,s.index,s.index+u.length)),o=o.slice(0,s.index)+l+o.slice(s.index+s[0].length)}o=o.replace(/\\([{}])/g,(a,l,c)=>{for(let u of i)u.line==r.length&&u.from>c&&(u.from--,u.to--);return l}),r.push(o)}return new Rk(r,i)}}let HX=mt.widget({widget:new class extends Ss{toDOM(){let n=document.createElement("span");return n.className="cm-snippetFieldPosition",n}ignoreEvent(){return!1}}}),KX=mt.mark({class:"cm-snippetField"});class hf{constructor(e,t){this.ranges=e,this.active=t,this.deco=mt.set(e.map(r=>(r.from==r.to?HX:KX).range(r.from,r.to)))}map(e){let t=[];for(let r of this.ranges){let i=r.map(e);if(!i)return null;t.push(i)}return new hf(t,this.active)}selectionInsideField(e){return e.ranges.every(t=>this.ranges.some(r=>r.field==this.active&&r.from<=t.from&&r.to>=t.to))}}const Ph=Yt.define({map(n,e){return n&&n.map(e)}}),JX=Yt.define(),th=Zr.define({create(){return null},update(n,e){for(let t of e.effects){if(t.is(Ph))return t.value;if(t.is(JX)&&n)return new hf(n.ranges,t.value)}return n&&e.docChanged&&(n=n.map(e.changes)),n&&e.selection&&!n.selectionInsideField(e.selection)&&(n=null),n},provide:n=>et.decorations.from(n,e=>e?e.deco:mt.none)});function Ak(n,e){return _e.create(n.filter(t=>t.field==e).map(t=>_e.range(t.from,t.to)))}function ez(n){let e=Rk.parse(n);return(t,r,i,s)=>{let{text:o,ranges:a}=e.instantiate(t.state,i),{main:l}=t.state.selection,c={changes:{from:i,to:s==l.from?l.to:s,insert:En.of(o)},scrollIntoView:!0,annotations:r?[Tk.of(r),Vr.userEvent.of("input.complete")]:void 0};if(a.length&&(c.selection=Ak(a,0)),a.some(u=>u.field>0)){let u=new hf(a,0),d=c.effects=[Ph.of(u)];t.state.field(th,!1)===void 0&&d.push(Yt.appendConfig.of([th,sz,oz,wj]))}t.dispatch(t.state.update(c))}}function kj(n){return({state:e,dispatch:t})=>{let r=e.field(th,!1);if(!r||n<0&&r.active==0)return!1;let i=r.active+n,s=n>0&&!r.ranges.some(o=>o.field==i+n);return t(e.update({selection:Ak(r.ranges,i),effects:Ph.of(s?null:new hf(r.ranges,i)),scrollIntoView:!0})),!0}}const tz=({state:n,dispatch:e})=>n.field(th,!1)?(e(n.update({effects:Ph.of(null)})),!0):!1,nz=kj(1),rz=kj(-1),iz=[{key:"Tab",run:nz,shift:rz},{key:"Escape",run:tz}],rR=ft.define({combine(n){return n.length?n[0]:iz}}),sz=Go.highest(cf.compute([rR],n=>n.facet(rR)));function Ki(n,e){return Object.assign(Object.assign({},e),{apply:ez(n)})}const oz=et.domEventHandlers({mousedown(n,e){let t=e.state.field(th,!1),r;if(!t||(r=e.posAtCoords({x:n.clientX,y:n.clientY}))==null)return!1;let i=t.ranges.find(s=>s.from<=r&&s.to>=r);return!i||i.field==t.active?!1:(e.dispatch({selection:Ak(t.ranges,i.field),effects:Ph.of(t.ranges.some(s=>s.field>i.field)?new hf(t.ranges,i.field):null),scrollIntoView:!0}),!0)}}),nh={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},vc=Yt.define({map(n,e){let t=e.mapPos(n,-1,Kr.TrackAfter);return t??void 0}}),$k=new class extends xc{};$k.startSide=1;$k.endSide=-1;const Pj=Zr.define({create(){return Mn.empty},update(n,e){if(n=n.map(e.changes),e.selection){let t=e.state.doc.lineAt(e.selection.main.head);n=n.update({filter:r=>r>=t.from&&r<=t.to})}for(let t of e.effects)t.is(vc)&&(n=n.update({add:[$k.range(t.value,t.value+1)]}));return n}});function az(){return[cz,Pj]}const L0="()[]{}<>«»»«[]{}";function xj(n){for(let e=0;e<L0.length;e+=2)if(L0.charCodeAt(e)==n)return L0.charAt(e+1);return Vw(n<128?n:n+1)}function Tj(n,e){return n.languageDataAt("closeBrackets",e)[0]||nh}const lz=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),cz=et.inputHandler.of((n,e,t,r)=>{if((lz?n.composing:n.compositionStarted)||n.state.readOnly)return!1;let i=n.state.selection.main;if(r.length>2||r.length==2&&Uo(es(r,0))==1||e!=i.from||t!=i.to)return!1;let s=fz(n.state,r);return s?(n.dispatch(s),!0):!1}),uz=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let r=Tj(n,n.selection.main.head).brackets||nh.brackets,i=null,s=n.changeByRange(o=>{if(o.empty){let a=dz(n.doc,o.head);for(let l of r)if(l==a&&rv(n.doc,o.head)==xj(es(l,0)))return{changes:{from:o.head-l.length,to:o.head+l.length},range:_e.cursor(o.head-l.length)}}return{range:i=o}});return i||e(n.update(s,{scrollIntoView:!0,userEvent:"delete.backward"})),!i};function fz(n,e){let t=Tj(n,n.selection.main.head),r=t.brackets||nh.brackets;for(let i of r){let s=xj(es(i,0));if(e==i)return s==i?mz(n,i,r.indexOf(i+i+i)>-1,t):hz(n,i,s,t.before||nh.before);if(e==s&&Cj(n,n.selection.main.from))return pz(n,i,s)}return null}function Cj(n,e){let t=!1;return n.field(Pj).between(0,n.doc.length,r=>{r==e&&(t=!0)}),t}function rv(n,e){let t=n.sliceString(e,e+2);return t.slice(0,Uo(es(t,0)))}function dz(n,e){let t=n.sliceString(e-2,e);return Uo(es(t,0))==t.length?t:t.slice(1)}function hz(n,e,t,r){let i=null,s=n.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:t,from:o.to}],effects:vc.of(o.to+e.length),range:_e.range(o.anchor+e.length,o.head+e.length)};let a=rv(n.doc,o.head);return!a||/\s/.test(a)||r.indexOf(a)>-1?{changes:{insert:e+t,from:o.head},effects:vc.of(o.head+e.length),range:_e.cursor(o.head+e.length)}:{range:i=o}});return i?null:n.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function pz(n,e,t){let r=null,i=n.changeByRange(s=>s.empty&&rv(n.doc,s.head)==t?{changes:{from:s.head,to:s.head+t.length,insert:t},range:_e.cursor(s.head+t.length)}:r={range:s});return r?null:n.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function mz(n,e,t,r){let i=r.stringPrefixes||nh.stringPrefixes,s=null,o=n.changeByRange(a=>{if(!a.empty)return{changes:[{insert:e,from:a.from},{insert:e,from:a.to}],effects:vc.of(a.to+e.length),range:_e.range(a.anchor+e.length,a.head+e.length)};let l=a.head,c=rv(n.doc,l),u;if(c==e){if(iR(n,l))return{changes:{insert:e+e,from:l},effects:vc.of(l+e.length),range:_e.cursor(l+e.length)};if(Cj(n,l)){let h=t&&n.sliceDoc(l,l+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:l,to:l+h.length,insert:h},range:_e.cursor(l+h.length)}}}else{if(t&&n.sliceDoc(l-2*e.length,l)==e+e&&(u=sR(n,l-2*e.length,i))>-1&&iR(n,u))return{changes:{insert:e+e+e+e,from:l},effects:vc.of(l+e.length),range:_e.cursor(l+e.length)};if(n.charCategorizer(l)(c)!=br.Word&&sR(n,l,i)>-1&&!gz(n,l,e,i))return{changes:{insert:e+e,from:l},effects:vc.of(l+e.length),range:_e.cursor(l+e.length)}}return{range:s=a}});return s?null:n.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function iR(n,e){let t=pr(n).resolveInner(e+1);return t.parent&&t.from==e}function gz(n,e,t,r){let i=pr(n).resolveInner(e,-1),s=r.reduce((o,a)=>Math.max(o,a.length),0);for(let o=0;o<5;o++){let a=n.sliceDoc(i.from,Math.min(i.to,i.from+t.length+s)),l=a.indexOf(t);if(!l||l>-1&&r.indexOf(a.slice(0,l))>-1){let u=i.firstChild;for(;u&&u.from==i.from&&u.to-u.from>t.length+l;){if(n.sliceDoc(u.to-t.length,u.to)==t)return!1;u=u.firstChild}return!0}let c=i.to==e&&i.parent;if(!c)break;i=c}return!1}function sR(n,e,t){let r=n.charCategorizer(e);if(r(n.sliceDoc(e-1,e))!=br.Word)return e;for(let i of t){let s=e-i.length;if(n.sliceDoc(s,e)==i&&r(n.sliceDoc(s-1,s))!=br.Word)return s}return-1}function _j(n={}){return[YX,ns,ci.of(n),XX,vz,wj]}const Oz=[{key:"Ctrl-Space",run:ew},{mac:"Alt-`",run:ew},{key:"Escape",run:Sj},{key:"ArrowDown",run:yl(!0)},{key:"ArrowUp",run:yl(!1)},{key:"PageDown",run:yl(!0,"page")},{key:"PageUp",run:yl(!1,"page")},{key:"Enter",run:J1}],vz=Go.highest(cf.computeN([ci],n=>n.facet(ci).defaultKeymap?[Oz]:[]));class oR{constructor(e,t,r){this.from=e,this.to=t,this.diagnostic=r}}class hc{constructor(e,t,r){this.diagnostics=e,this.panel=t,this.selected=r}static init(e,t,r){let i=e,s=r.facet(rh).markerFilter;s&&(i=s(i,r));let o=e.slice().sort((d,h)=>d.from-h.from||d.to-h.to),a=new xa,l=[],c=0;for(let d=0;;){let h=d==o.length?null:o[d];if(!h&&!l.length)break;let m,g;for(l.length?(m=c,g=l.reduce((y,b)=>Math.min(y,b.to),h&&h.from>m?h.from:1e8)):(m=h.from,g=h.to,l.push(h),d++);d<o.length;){let y=o[d];if(y.from==m&&(y.to>y.from||y.to==m))l.push(y),d++,g=Math.min(y.to,g);else{g=Math.min(y.from,g);break}}let O=Rz(l);if(l.some(y=>y.from==y.to||y.from==y.to-1&&r.doc.lineAt(y.from).to==y.from))a.add(m,m,mt.widget({widget:new Tz(O),diagnostics:l.slice()}));else{let y=l.reduce((b,S)=>S.markClass?b+" "+S.markClass:b,"");a.add(m,g,mt.mark({class:"cm-lintRange cm-lintRange-"+O+y,diagnostics:l.slice(),inclusiveEnd:l.some(b=>b.to>g)}))}c=g;for(let y=0;y<l.length;y++)l[y].to<=c&&l.splice(y--,1)}let u=a.finish();return new hc(u,t,nf(u))}}function nf(n,e=null,t=0){let r=null;return n.between(t,1e9,(i,s,{spec:o})=>{if(!(e&&o.diagnostics.indexOf(e)<0))if(!r)r=new oR(i,s,e||o.diagnostics[0]);else{if(o.diagnostics.indexOf(r.diagnostic)<0)return!1;r=new oR(r.from,s,r.diagnostic)}}),r}function yz(n,e){let t=e.pos,r=e.end||t,i=n.state.facet(rh).hideOn(n,t,r);if(i!=null)return i;let s=n.startState.doc.lineAt(e.pos);return!!(n.effects.some(o=>o.is(Ej))||n.changes.touchesRange(s.from,Math.max(s.to,r)))}function bz(n,e){return n.field(ys,!1)?e:e.concat(Yt.appendConfig.of(Az))}const Ej=Yt.define(),Mk=Yt.define(),Rj=Yt.define(),ys=Zr.define({create(){return new hc(mt.none,null,null)},update(n,e){if(e.docChanged&&n.diagnostics.size){let t=n.diagnostics.map(e.changes),r=null,i=n.panel;if(n.selected){let s=e.changes.mapPos(n.selected.from,1);r=nf(t,n.selected.diagnostic,s)||nf(t,null,s)}!t.size&&i&&e.state.facet(rh).autoPanel&&(i=null),n=new hc(t,i,r)}for(let t of e.effects)if(t.is(Ej)){let r=e.state.facet(rh).autoPanel?t.value.length?ih.open:null:n.panel;n=hc.init(t.value,r,e.state)}else t.is(Mk)?n=new hc(n.diagnostics,t.value?ih.open:null,n.selected):t.is(Rj)&&(n=new hc(n.diagnostics,n.panel,t.value));return n},provide:n=>[Yd.from(n,e=>e.panel),et.decorations.from(n,e=>e.diagnostics)]}),Sz=mt.mark({class:"cm-lintRange cm-lintRange-active"});function wz(n,e,t){let{diagnostics:r}=n.state.field(ys),i,s=-1,o=-1;r.between(e-(t<0?1:0),e+(t>0?1:0),(l,c,{spec:u})=>{if(e>=l&&e<=c&&(l==c||(e>l||t>0)&&(e<c||t<0)))return i=u.diagnostics,s=l,o=c,!1});let a=n.state.facet(rh).tooltipFilter;return i&&a&&(i=a(i,n.state)),i?{pos:s,end:o,above:n.state.doc.lineAt(s).to<o,create(){return{dom:kz(n,i)}}}:null}function kz(n,e){return sr("ul",{class:"cm-tooltip-lint"},e.map(t=>$j(n,t,!1)))}const Pz=n=>{let e=n.state.field(ys,!1);(!e||!e.panel)&&n.dispatch({effects:bz(n.state,[Mk.of(!0)])});let t=zd(n,ih.open);return t&&t.dom.querySelector(".cm-panel-lint ul").focus(),!0},aR=n=>{let e=n.state.field(ys,!1);return!e||!e.panel?!1:(n.dispatch({effects:Mk.of(!1)}),!0)},xz=n=>{let e=n.state.field(ys,!1);if(!e)return!1;let t=n.state.selection.main,r=e.diagnostics.iter(t.to+1);return!r.value&&(r=e.diagnostics.iter(0),!r.value||r.from==t.from&&r.to==t.to)?!1:(n.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!0)},rh=ft.define({combine(n){return Object.assign({sources:n.map(e=>e.source).filter(e=>e!=null)},go(n.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{needsRefresh:(e,t)=>e?t?r=>e(r)||t(r):e:t}))}});function Aj(n){let e=[];if(n)e:for(let{name:t}of n){for(let r=0;r<t.length;r++){let i=t[r];if(/[a-zA-Z]/.test(i)&&!e.some(s=>s.toLowerCase()==i.toLowerCase())){e.push(i);continue e}}e.push("")}return e}function $j(n,e,t){var r;let i=t?Aj(e.actions):[];return sr("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},sr("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(n):e.message),(r=e.actions)===null||r===void 0?void 0:r.map((s,o)=>{let a=!1,l=h=>{if(h.preventDefault(),a)return;a=!0;let m=nf(n.state.field(ys).diagnostics,e);m&&s.apply(n,m.from,m.to)},{name:c}=s,u=i[o]?c.indexOf(i[o]):-1,d=u<0?c:[c.slice(0,u),sr("u",c.slice(u,u+1)),c.slice(u+1)];return sr("button",{type:"button",class:"cm-diagnosticAction",onclick:l,onmousedown:l,"aria-label":` Action: ${c}${u<0?"":` (access key "${i[o]})"`}.`},d)}),e.source&&sr("div",{class:"cm-diagnosticSource"},e.source))}class Tz extends Ss{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return sr("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class lR{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=$j(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class ih{constructor(e){this.view=e,this.items=[];let t=i=>{if(i.keyCode==27)aR(this.view),this.view.focus();else if(i.keyCode==38||i.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(i.keyCode==40||i.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(i.keyCode==36)this.moveSelection(0);else if(i.keyCode==35)this.moveSelection(this.items.length-1);else if(i.keyCode==13)this.view.focus();else if(i.keyCode>=65&&i.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:s}=this.items[this.selectedIndex],o=Aj(s.actions);for(let a=0;a<o.length;a++)if(o[a].toUpperCase().charCodeAt(0)==i.keyCode){let l=nf(this.view.state.field(ys).diagnostics,s);l&&s.actions[a].apply(e,l.from,l.to)}}else return;i.preventDefault()},r=i=>{for(let s=0;s<this.items.length;s++)this.items[s].dom.contains(i.target)&&this.moveSelection(s)};this.list=sr("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:t,onclick:r}),this.dom=sr("div",{class:"cm-panel-lint"},this.list,sr("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>aR(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(ys).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field(ys),r=0,i=!1,s=null,o=new Set;for(e.between(0,this.view.state.doc.length,(a,l,{spec:c})=>{for(let u of c.diagnostics){if(o.has(u))continue;o.add(u);let d=-1,h;for(let m=r;m<this.items.length;m++)if(this.items[m].diagnostic==u){d=m;break}d<0?(h=new lR(this.view,u),this.items.splice(r,0,h),i=!0):(h=this.items[d],d>r&&(this.items.splice(r,d-r),i=!0)),t&&h.diagnostic==t.diagnostic?h.dom.hasAttribute("aria-selected")||(h.dom.setAttribute("aria-selected","true"),s=h):h.dom.hasAttribute("aria-selected")&&h.dom.removeAttribute("aria-selected"),r++}});r<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)i=!0,this.items.pop();this.items.length==0&&(this.items.push(new lR(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),i=!0),s?(this.list.setAttribute("aria-activedescendant",s.id),this.view.requestMeasure({key:this,read:()=>({sel:s.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:a,panel:l})=>{let c=l.height/this.list.offsetHeight;a.top<l.top?this.list.scrollTop-=(l.top-a.top)/c:a.bottom>l.bottom&&(this.list.scrollTop+=(a.bottom-l.bottom)/c)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),i&&this.sync()}sync(){let e=this.list.firstChild;function t(){let r=e;e=r.nextSibling,r.remove()}for(let r of this.items)if(r.dom.parentNode==this.list){for(;e!=r.dom;)t();e=r.dom.nextSibling}else this.list.insertBefore(r.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=this.view.state.field(ys),r=nf(t.diagnostics,this.items[e].diagnostic);r&&this.view.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:Rj.of(r)})}static open(e){return new ih(e)}}function Cz(n,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${e}>${encodeURIComponent(n)}</svg>')`}function Hp(n){return Cz(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${n}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const _z=et.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:Hp("#d11")},".cm-lintRange-warning":{backgroundImage:Hp("orange")},".cm-lintRange-info":{backgroundImage:Hp("#999")},".cm-lintRange-hint":{backgroundImage:Hp("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function Ez(n){return n=="error"?4:n=="warning"?3:n=="info"?2:1}function Rz(n){let e="hint",t=1;for(let r of n){let i=Ez(r.severity);i>t&&(t=i,e=r.severity)}return e}const Az=[ys,et.decorations.compute([ys],n=>{let{selected:e,panel:t}=n.field(ys);return!e||!t||e.from==e.to?mt.none:mt.set([Sz.range(e.from,e.to)])}),UZ(wz,{hideOn:yz}),_z],cR="500",$z={background:OE,foreground:N5,caret:u9,selection:a9,selectionMatch:l9,lineHighlight:c9,gutterBackground:OE,gutterForeground:s9,gutterActiveForeground:o9};function Mz(n){const{theme:e="dark",settings:t={},styles:r=[]}={};return[Bs({theme:e,settings:{...$z,...t},styles:[{tag:[T.keyword,T.operatorKeyword,T.modifier,T.color,T.constant(T.name),T.standard(T.name),T.standard(T.tagName),T.special(T.brace),T.atom,T.bool,T.special(T.variableName)],color:vE},{tag:[T.controlKeyword,T.moduleKeyword],color:vE},{tag:[T.name,T.deleted,T.character,T.macroName,T.variableName,T.labelName,T.definition(T.name)],color:ed},{tag:[T.propertyName],color:bE},{tag:T.heading,fontWeight:cR,color:f9},{tag:[T.typeName,T.className,T.tagName,T.number,T.changed,T.annotation,T.self,T.namespace],color:ed},{tag:[T.function(T.variableName),T.function(T.propertyName)],color:ed},{tag:[T.number],color:d9},{tag:[T.operator,T.punctuation,T.separator,T.url,T.escape,T.regexp],color:N5},{tag:[T.regexp],color:yE},{tag:[T.special(T.string),T.string,T.inserted],color:yE},{tag:[T.processingInstruction],color:ed},{tag:[T.angleBracket],color:ed},{tag:T.strong,fontWeight:cR},{tag:T.emphasis,fontStyle:"italic"},{tag:T.strikethrough,textDecoration:"line-through"},{tag:[T.meta,T.comment],color:i9},{tag:T.link,color:bE,textDecoration:"underline"},{tag:T.invalid,color:h9},...r]}),et.theme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"transparent",outline:"1px solid #888888"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"transparent",outline:"1px solid #ff2222"}},{dark:!0})]}const Qz=Mz(),tw=[{value:xW,label:"abcdef"},{value:EW,label:"dracula"},{value:MW,label:"eclipse"},{value:FW,label:"material"},{value:GW,label:"nord"},{value:OW,label:"oneDark"},{value:SW,label:"okaidia"},{value:qW,label:"github"},{value:e9,label:"xcode"},{value:Qz,label:"vizhub"}],Mj=tw.reduce((n,e)=>(n[e.label]=e,n),{}),Dz="vizhub",Iz=(n,e)=>{const t=L.useRef(!0);L.useEffect(()=>{if(t.current)t.current=!1;else for(const r of Array.from(n.values())){const{editor:i,themeCompartment:s}=r;i.dispatch({effects:s.reconfigure([Mj[e].value])})}},[e,n])},jz=n=>{const e=L.useCallback(M=>{n({type:"set_active_file_id",activeFileId:M})},[n]),t=L.useCallback(()=>{n({type:"set_active_file_left"})},[n]),r=L.useCallback(()=>{n({type:"set_active_file_right"})},[n]),i=L.useCallback(M=>{n({type:"open_tab",fileId:M.fileId,isTransient:M.isTransient})},[n]),s=L.useCallback(M=>{n({type:"close_tabs",fileIdsToClose:M})},[n]),o=L.useCallback(M=>{n({type:"set_theme",themeLabel:M})},[n]),a=L.useCallback(M=>{n({type:"set_is_search_open",value:M})},[n]),l=L.useCallback(M=>{n({type:"set_search",value:M})},[n]),c=L.useCallback(M=>{n({type:"set_search_results",files:M})},[n]),u=L.useCallback((M,Q,_)=>{n({type:"set_search_file_visibility",files:M,id:Q,visibility:_})},[n]),d=L.useCallback((M,Q,_)=>{n({type:"hide_search_results_line",files:M,id:Q,line:_})},[n]),h=L.useCallback((M,Q)=>{n({type:"set_active_search_index",focusedIndex:M,childIndex:Q})},[n]),m=L.useCallback(()=>{n({type:"toggle_search_focused"})},[n]),g=L.useCallback(M=>{n({type:"set_is_settings_open",value:M})},[n]),O=L.useCallback(M=>{n({type:"set_is_doc_open",value:M})},[n]),y=L.useCallback(()=>{g(!1)},[g]),b=L.useCallback(()=>{O(!1)},[O]),S=L.useCallback(()=>{n({type:"editor_no_longer_wants_focus"})},[n]),P=L.useCallback(M=>{n({type:"set_username",username:M})},[n]),k=L.useCallback(()=>{n({type:"toggle_auto_follow"})},[n]),x=L.useCallback(M=>{n({type:"update_presence_indicator",presenceIndicator:M})},[n]),A=L.useCallback(()=>{n({type:"split_current_pane"})},[n]);return{setActiveFileId:e,setActiveFileLeft:t,setActiveFileRight:r,openTab:i,closeTabs:s,setTheme:o,setIsSearchOpen:a,setSearch:l,setSearchResults:c,setSearchFileVisibility:u,setSearchLineVisibility:d,setSearchFocusedIndex:h,toggleSearchFocused:m,setIsSettingsOpen:g,setIsDocOpen:O,closeSettings:y,closeDoc:b,editorNoLongerWantsFocus:S,setUsername:P,toggleAutoFollow:k,updatePresenceIndicator:x,splitCurrentPane:A}},sh=(n,e)=>n+"|"+e,Nz=()=>L.useRef(new Map).current,Lz=8,nw=()=>{let n="";for(let e=0;e<Lz;e++)n+=Math.floor(Math.random()*10);return n},qz=({submitOperation:n,closeTabs:e,openTab:t})=>{const r=L.useCallback((c,u="")=>{if(c){const d=nw();n(h=>({...h,files:{...h.files,[d]:{name:c,text:u}}})),t({fileId:d,isTransient:!1})}},[n]),i=L.useCallback((c,u=null)=>{if(c){c+="/";const d=nw();n(h=>({...h,files:{...h.files,[d]:{name:c,text:u}}}))}},[n]),s=L.useCallback((c,u)=>{n(d=>({...d,files:{...d.files,[c]:{...d.files[c],name:d.files[c].name.substring(0,d.files[c].name.lastIndexOf("/")+1)+u}}}))},[n]),o=L.useCallback((c,u,d)=>{console.log(c),console.log(u),n(h=>{const m=Object.keys(h.files).reduce((g,O)=>{const y=h.files[O],b=y.name;if(b.includes(c+"/")){const P=b.substring(0,b.indexOf(c)+c.length).lastIndexOf(u),k=b.substring(0,P)+d+b.substring(P+u.length);g[O]={...y,name:k}}else g[O]=y;return g},{});return{...h,files:m}})},[n]),a=L.useCallback(c=>{e([c]),n(u=>{const d={...u.files};return delete d[c],{...u,files:d}})},[n,e]),l=L.useCallback(c=>{const u=[];n(d=>{const h={...d.files};for(const m in h)h[m].name.includes(c+"/")&&(u.push(m),delete h[m]);return{...d,files:h}}),e(u)},[n,e]);return{createFile:r,renameFile:s,deleteFile:a,createDirectory:i,renameDirectory:o,deleteDirectory:l}},Uz=n=>{const t=/Mac|iMac|MacBook/i.test(navigator.userAgent)?n.metaKey:n.ctrlKey;return t&&n.key==="s"?!0:!!(n.key==="F5"||t&&n.key==="Enter"||n.shiftKey&&n.key==="Enter"||n.altKey&&n.key==="Enter"||t&&n.shiftKey&&(n.key==="B"||n.key==="b")||t&&n.shiftKey&&n.key==="F10"||n.key==="F8"||n.key==="F9")};let no=null,Kp=null;const Qj=new Set(["FunctionDeclaration","ClassDeclaration","MethodDeclaration","Block","IfStatement","ForStatement","WhileStatement","SwitchStatement","TryStatement","CatchClause","WithStatement","ArrowFunction","ImportGroup"]),Bz=new Set(["VariableDeclaration","FunctionDeclaration","ClassDeclaration","MethodDeclaration","PropertyDeclaration","ImportDeclaration","ExportDeclaration","CallExpression","ArrayPattern","ObjectPattern","PatternProperty","ArgList","TypeArgList","ParamList","ForOfSpec"]);function uR(n){let e=n,t=0;for(;e&&e.type;){const r=e.type.name;Qj.has(r)&&t++,e=e.parent}return t}function Fz(n,e){const t=n.state,r=[],i=e,s=t.doc.sliceString(i.from,i.to),o=uR(i);if(i){if(pr(t).iterate({enter(a){if(Bz.has(a.name)||Qj.has(a.name)){const l=a.node;[...l.getChildren("VariableDefinition"),...l.getChildren("PropertyDefinition"),...l.getChildren("PropertyName"),...l.getChildren("Identifier")].forEach(u=>{t.doc.sliceString(u.from,u.to)===s&&u.type.id!==i.type.id&&r.push({identifier:u,context:uR(u)})})}}}),r.length>0){r.sort((l,c)=>l.context-c.context);let a=r[0].identifier;for(let l=r.length-1;l>=0;l--)if(r[l].context<=o){a=r[l].identifier;break}return a}return null}}const fR={E:"files-icon",F:"search-icon",K:"shortcut-icon",B:"bug-icon",S:"settings-icon",N:"new-file-icon",D:"new-directory-icon",A:"auto-focus-icon"},Vz=({closeTabs:n,activeFileId:e,activePaneId:t,handleOpenCreateFileModal:r,setActiveFileLeft:i,setActiveFileRight:s,toggleSearchFocused:o,runPrettierRef:a,runCodeRef:l,sidebarRef:c,editorCache:u,codeEditorRef:d})=>{L.useEffect(()=>{const h=sh(e,t),m=S=>{var P,k;if(Uz(S)){S.preventDefault();const x=a.current;x!==null&&x();const A=l.current;A!==null&&A();return}if(S.ctrlKey&&S.shiftKey?((P=document.getElementById(fR[S.key]))==null||P.click(),S.key==="F"&&o()):S.ctrlKey&&S.key===","&&((k=document.getElementById(fR.S))==null||k.click()),S.ctrlKey===!0&&document.addEventListener("mouseover",b),S.altKey===!0){if(S.key==="w"){e&&n([e]);return}if(S.key==="n"){r();return}if(S.key==="PageUp"){i();return}if(S.key==="PageDown"){s();return}S.key==="1"&&c.current&&c.current.focus(),S.key==="2"&&d.current&&d.current.focus()}},g=()=>{no&&(no.style.cursor="initial",no.style.textDecoration="none",no=Kp=null),document.removeEventListener("mouseover",b),document.removeEventListener("mousedown",O)},O=S=>{if(!Kp||S.target!==no||!e)return;const P=u.get(h).editor,k=Kp;P.dispatch({selection:{anchor:k.from,head:k.to},scrollIntoView:!0,effects:et.scrollIntoView(k.from,{y:"center"})}),g()},y=S=>{S.ctrlKey||g()},b=S=>{if(!e)return;const P=u.get(h).editor,k=pr(P.state),x=S.target;if(x==null||!P.dom.contains(x))return;const A=P.posAtDOM(x),M=k.resolveInner(A,1);if(M&&x instanceof HTMLSpanElement){const Q=Fz(P,M);Q&&M.type.id!==Q.type.id&&(no&&(no.style.cursor="initial",no.style.textDecoration="none"),no=x,Kp=Q,no.style.cursor="pointer",no.style.textDecoration="underline",document.addEventListener("mousedown",O,{once:!0}))}};return document.addEventListener("keydown",m),document.addEventListener("keyup",y),()=>{document.removeEventListener("keydown",m),document.removeEventListener("keyup",y)}},[r,n,e,i,s])},Zz=()=>{const[n,e]=L.useState(new Set),t=L.useCallback(i=>n.has(i),[n]),r=L.useCallback(i=>{const s=new Set(n);t(i)?s.delete(i):s.add(i),e(s)},[n,t]);return{isDirectoryOpen:t,toggleDirectory:r}},Wz=1200,Xz=n=>{const e=n.match(/\.([^.]+)$/);return e?e[1]:""},zz=({shareDBDoc:n,submitOperation:e,prettierWorker:t})=>{const r=L.useRef(new Set),[i,s]=L.useState(null),o=L.useRef(!1),a=L.useRef(null);return L.useEffect(()=>{if(!n)return;const l=d=>{const{fileId:h,error:m,fileTextPrettified:g}=d.data;if(m){s(m);return}else s(null);o.current=!0,e(O=>({...O,files:{...O.files,[h]:{...O.files[h],text:g}}})),o.current=!1};t.addEventListener("message",l);const c=async()=>{const h=n.data.files,m=r.current,g=Array.from(m);m.clear();for(const O of g){const y=h[O],b={fileText:y.text,fileExtension:Xz(y.name),fileId:O};t.postMessage(b)}};a.current=c;const u=d=>{if(!o.current&&d&&d.length===4&&d[0]==="files"&&typeof d[1]=="string"&&d[2]==="text"){const h=d[1];r.current.add(h)}};return n.on("op batch",u),()=>{t.removeEventListener("message",l),n.removeListener("op batch",u)}},[n]),{prettierError:i,runPrettierRef:a}},Yz=n=>{const e=L.useRef(null);return L.useEffect(()=>{const t=()=>{n(r=>({...r,isInteracting:!0})),setTimeout(()=>{n(({isInteracting:r,...i})=>i)},0)};e.current=t},[n]),e},Gz=500,Hz=Wz+Gz,Kz=({content:n,typeScriptWorker:e})=>{const t=L.useRef(null),r=L.useCallback(i=>{i!==null&&(clearTimeout(t.current),t.current=window.setTimeout(()=>{e.postMessage({event:"update-content",details:i})},Hz))},[e]);L.useEffect(()=>{r(n)},[n])};var nd={},dR;function Jz(){if(dR)return nd;dR=1,Object.defineProperty(nd,"__esModule",{value:!0}),nd.parse=o,nd.serialize=c;const n=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,e=/^[\u0021-\u003A\u003C-\u007E]*$/,t=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,r=/^[\u0020-\u003A\u003D-\u007E]*$/,i=Object.prototype.toString,s=(()=>{const h=function(){};return h.prototype=Object.create(null),h})();function o(h,m){const g=new s,O=h.length;if(O<2)return g;const y=(m==null?void 0:m.decode)||u;let b=0;do{const S=h.indexOf("=",b);if(S===-1)break;const P=h.indexOf(";",b),k=P===-1?O:P;if(S>k){b=h.lastIndexOf(";",S-1)+1;continue}const x=a(h,b,S),A=l(h,S,x),M=h.slice(x,A);if(g[M]===void 0){let Q=a(h,S+1,k),_=l(h,k,Q);const R=y(h.slice(Q,_));g[M]=R}b=k+1}while(b<O);return g}function a(h,m,g){do{const O=h.charCodeAt(m);if(O!==32&&O!==9)return m}while(++m<g);return g}function l(h,m,g){for(;m>g;){const O=h.charCodeAt(--m);if(O!==32&&O!==9)return m+1}return g}function c(h,m,g){const O=(g==null?void 0:g.encode)||encodeURIComponent;if(!n.test(h))throw new TypeError(`argument name is invalid: ${h}`);const y=O(m);if(!e.test(y))throw new TypeError(`argument val is invalid: ${m}`);let b=h+"="+y;if(!g)return b;if(g.maxAge!==void 0){if(!Number.isInteger(g.maxAge))throw new TypeError(`option maxAge is invalid: ${g.maxAge}`);b+="; Max-Age="+g.maxAge}if(g.domain){if(!t.test(g.domain))throw new TypeError(`option domain is invalid: ${g.domain}`);b+="; Domain="+g.domain}if(g.path){if(!r.test(g.path))throw new TypeError(`option path is invalid: ${g.path}`);b+="; Path="+g.path}if(g.expires){if(!d(g.expires)||!Number.isFinite(g.expires.valueOf()))throw new TypeError(`option expires is invalid: ${g.expires}`);b+="; Expires="+g.expires.toUTCString()}if(g.httpOnly&&(b+="; HttpOnly"),g.secure&&(b+="; Secure"),g.partitioned&&(b+="; Partitioned"),g.priority)switch(typeof g.priority=="string"?g.priority.toLowerCase():void 0){case"low":b+="; Priority=Low";break;case"medium":b+="; Priority=Medium";break;case"high":b+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${g.priority}`)}if(g.sameSite)switch(typeof g.sameSite=="string"?g.sameSite.toLowerCase():g.sameSite){case!0:case"strict":b+="; SameSite=Strict";break;case"lax":b+="; SameSite=Lax";break;case"none":b+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${g.sameSite}`)}return b}function u(h){if(h.indexOf("%")===-1)return h;try{return decodeURIComponent(h)}catch{return h}}function d(h){return i.call(h)==="[object Date]"}return nd}Jz();/**
|
|
128
|
+
* react-router v7.4.1
|
|
129
|
+
*
|
|
130
|
+
* Copyright (c) Remix Software Inc.
|
|
131
|
+
*
|
|
132
|
+
* This source code is licensed under the MIT license found in the
|
|
133
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
134
|
+
*
|
|
135
|
+
* @license MIT
|
|
136
|
+
*/var hR="popstate";function eY(n={}){function e(r,i){let{pathname:s,search:o,hash:a}=r.location;return rw("",{pathname:s,search:o,hash:a},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function t(r,i){return typeof i=="string"?i:oh(i)}return nY(e,t,null,n)}function ei(n,e){if(n===!1||n===null||typeof n>"u")throw new Error(e)}function mo(n,e){if(!n){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function tY(){return Math.random().toString(36).substring(2,10)}function pR(n,e){return{usr:n.state,key:n.key,idx:e}}function rw(n,e,t=null,r){return{pathname:typeof n=="string"?n:n.pathname,search:"",hash:"",...typeof e=="string"?xh(e):e,state:t,key:e&&e.key||r||tY()}}function oh({pathname:n="/",search:e="",hash:t=""}){return e&&e!=="?"&&(n+=e.charAt(0)==="?"?e:"?"+e),t&&t!=="#"&&(n+=t.charAt(0)==="#"?t:"#"+t),n}function xh(n){let e={};if(n){let t=n.indexOf("#");t>=0&&(e.hash=n.substring(t),n=n.substring(0,t));let r=n.indexOf("?");r>=0&&(e.search=n.substring(r),n=n.substring(0,r)),n&&(e.pathname=n)}return e}function nY(n,e,t,r={}){let{window:i=document.defaultView,v5Compat:s=!1}=r,o=i.history,a="POP",l=null,c=u();c==null&&(c=0,o.replaceState({...o.state,idx:c},""));function u(){return(o.state||{idx:null}).idx}function d(){a="POP";let y=u(),b=y==null?null:y-c;c=y,l&&l({action:a,location:O.location,delta:b})}function h(y,b){a="PUSH";let S=rw(O.location,y,b);c=u()+1;let P=pR(S,c),k=O.createHref(S);try{o.pushState(P,"",k)}catch(x){if(x instanceof DOMException&&x.name==="DataCloneError")throw x;i.location.assign(k)}s&&l&&l({action:a,location:O.location,delta:1})}function m(y,b){a="REPLACE";let S=rw(O.location,y,b);c=u();let P=pR(S,c),k=O.createHref(S);o.replaceState(P,"",k),s&&l&&l({action:a,location:O.location,delta:0})}function g(y){let b=i.location.origin!=="null"?i.location.origin:i.location.href,S=typeof y=="string"?y:oh(y);return S=S.replace(/ $/,"%20"),ei(b,`No window.location.(origin|href) available to create URL for href: ${S}`),new URL(S,b)}let O={get action(){return a},get location(){return n(i,o)},listen(y){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(hR,d),l=y,()=>{i.removeEventListener(hR,d),l=null}},createHref(y){return e(i,y)},createURL:g,encodeLocation(y){let b=g(y);return{pathname:b.pathname,search:b.search,hash:b.hash}},push:h,replace:m,go(y){return o.go(y)}};return O}function Dj(n,e,t="/"){return rY(n,e,t,!1)}function rY(n,e,t,r){let i=typeof e=="string"?xh(e):e,s=Ca(i.pathname||"/",t);if(s==null)return null;let o=Ij(n);iY(o);let a=null;for(let l=0;a==null&&l<o.length;++l){let c=mY(s);a=hY(o[l],c,r)}return a}function Ij(n,e=[],t=[],r=""){let i=(s,o,a)=>{let l={relativePath:a===void 0?s.path||"":a,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};l.relativePath.startsWith("/")&&(ei(l.relativePath.startsWith(r),`Absolute route path "${l.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),l.relativePath=l.relativePath.slice(r.length));let c=wa([r,l.relativePath]),u=t.concat(l);s.children&&s.children.length>0&&(ei(s.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${c}".`),Ij(s.children,e,u,c)),!(s.path==null&&!s.index)&&e.push({path:c,score:fY(c,s.index),routesMeta:u})};return n.forEach((s,o)=>{var a;if(s.path===""||!((a=s.path)!=null&&a.includes("?")))i(s,o);else for(let l of jj(s.path))i(s,o,l)}),e}function jj(n){let e=n.split("/");if(e.length===0)return[];let[t,...r]=e,i=t.endsWith("?"),s=t.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let o=jj(r.join("/")),a=[];return a.push(...o.map(l=>l===""?s:[s,l].join("/"))),i&&a.push(...o),a.map(l=>n.startsWith("/")&&l===""?"/":l)}function iY(n){n.sort((e,t)=>e.score!==t.score?t.score-e.score:dY(e.routesMeta.map(r=>r.childrenIndex),t.routesMeta.map(r=>r.childrenIndex)))}var sY=/^:[\w-]+$/,oY=3,aY=2,lY=1,cY=10,uY=-2,mR=n=>n==="*";function fY(n,e){let t=n.split("/"),r=t.length;return t.some(mR)&&(r+=uY),e&&(r+=aY),t.filter(i=>!mR(i)).reduce((i,s)=>i+(sY.test(s)?oY:s===""?lY:cY),r)}function dY(n,e){return n.length===e.length&&n.slice(0,-1).every((r,i)=>r===e[i])?n[n.length-1]-e[e.length-1]:0}function hY(n,e,t=!1){let{routesMeta:r}=n,i={},s="/",o=[];for(let a=0;a<r.length;++a){let l=r[a],c=a===r.length-1,u=s==="/"?e:e.slice(s.length)||"/",d=SO({path:l.relativePath,caseSensitive:l.caseSensitive,end:c},u),h=l.route;if(!d&&c&&t&&!r[r.length-1].route.index&&(d=SO({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},u)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:wa([s,d.pathname]),pathnameBase:yY(wa([s,d.pathnameBase])),route:h}),d.pathnameBase!=="/"&&(s=wa([s,d.pathnameBase]))}return o}function SO(n,e){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[t,r]=pY(n.path,n.caseSensitive,n.end),i=e.match(t);if(!i)return null;let s=i[0],o=s.replace(/(.)\/+$/,"$1"),a=i.slice(1);return{params:r.reduce((c,{paramName:u,isOptional:d},h)=>{if(u==="*"){let g=a[h]||"";o=s.slice(0,s.length-g.length).replace(/(.)\/+$/,"$1")}const m=a[h];return d&&!m?c[u]=void 0:c[u]=(m||"").replace(/%2F/g,"/"),c},{}),pathname:s,pathnameBase:o,pattern:n}}function pY(n,e=!1,t=!0){mo(n==="*"||!n.endsWith("*")||n.endsWith("/*"),`Route path "${n}" will be treated as if it were "${n.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${n.replace(/\*$/,"/*")}".`);let r=[],i="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,l)=>(r.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return n.endsWith("*")?(r.push({paramName:"*"}),i+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):t?i+="\\/*$":n!==""&&n!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),r]}function mY(n){try{return n.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return mo(!1,`The URL path "${n}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${e}).`),n}}function Ca(n,e){if(e==="/")return n;if(!n.toLowerCase().startsWith(e.toLowerCase()))return null;let t=e.endsWith("/")?e.length-1:e.length,r=n.charAt(t);return r&&r!=="/"?null:n.slice(t)||"/"}function gY(n,e="/"){let{pathname:t,search:r="",hash:i=""}=typeof n=="string"?xh(n):n;return{pathname:t?t.startsWith("/")?t:OY(t,e):e,search:bY(r),hash:SY(i)}}function OY(n,e){let t=e.replace(/\/+$/,"").split("/");return n.split("/").forEach(i=>{i===".."?t.length>1&&t.pop():i!=="."&&t.push(i)}),t.length>1?t.join("/"):"/"}function q0(n,e,t,r){return`Cannot include a '${n}' character in a manually specified \`to.${e}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${t}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function vY(n){return n.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Nj(n){let e=vY(n);return e.map((t,r)=>r===e.length-1?t.pathname:t.pathnameBase)}function Lj(n,e,t,r=!1){let i;typeof n=="string"?i=xh(n):(i={...n},ei(!i.pathname||!i.pathname.includes("?"),q0("?","pathname","search",i)),ei(!i.pathname||!i.pathname.includes("#"),q0("#","pathname","hash",i)),ei(!i.search||!i.search.includes("#"),q0("#","search","hash",i)));let s=n===""||i.pathname==="",o=s?"/":i.pathname,a;if(o==null)a=t;else{let d=e.length-1;if(!r&&o.startsWith("..")){let h=o.split("/");for(;h[0]==="..";)h.shift(),d-=1;i.pathname=h.join("/")}a=d>=0?e[d]:"/"}let l=gY(i,a),c=o&&o!=="/"&&o.endsWith("/"),u=(s||o===".")&&t.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}var wa=n=>n.join("/").replace(/\/\/+/g,"/"),yY=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),bY=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,SY=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n;function wY(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}var qj=["POST","PUT","PATCH","DELETE"];new Set(qj);var kY=["GET",...qj];new Set(kY);var pf=L.createContext(null);pf.displayName="DataRouter";var iv=L.createContext(null);iv.displayName="DataRouterState";var Uj=L.createContext({isTransitioning:!1});Uj.displayName="ViewTransition";var PY=L.createContext(new Map);PY.displayName="Fetchers";var xY=L.createContext(null);xY.displayName="Await";var Ko=L.createContext(null);Ko.displayName="Navigation";var sv=L.createContext(null);sv.displayName="Location";var Ea=L.createContext({outlet:null,matches:[],isDataRoute:!1});Ea.displayName="Route";var Qk=L.createContext(null);Qk.displayName="RouteError";function TY(n,{relative:e}={}){ei(Th(),"useHref() may be used only in the context of a <Router> component.");let{basename:t,navigator:r}=L.useContext(Ko),{hash:i,pathname:s,search:o}=Ch(n,{relative:e}),a=s;return t!=="/"&&(a=s==="/"?t:wa([t,s])),r.createHref({pathname:a,search:o,hash:i})}function Th(){return L.useContext(sv)!=null}function ql(){return ei(Th(),"useLocation() may be used only in the context of a <Router> component."),L.useContext(sv).location}var Bj="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Fj(n){L.useContext(Ko).static||L.useLayoutEffect(n)}function Vj(){let{isDataRoute:n}=L.useContext(Ea);return n?LY():CY()}function CY(){ei(Th(),"useNavigate() may be used only in the context of a <Router> component.");let n=L.useContext(pf),{basename:e,navigator:t}=L.useContext(Ko),{matches:r}=L.useContext(Ea),{pathname:i}=ql(),s=JSON.stringify(Nj(r)),o=L.useRef(!1);return Fj(()=>{o.current=!0}),L.useCallback((l,c={})=>{if(mo(o.current,Bj),!o.current)return;if(typeof l=="number"){t.go(l);return}let u=Lj(l,JSON.parse(s),i,c.relative==="path");n==null&&e!=="/"&&(u.pathname=u.pathname==="/"?e:wa([e,u.pathname])),(c.replace?t.replace:t.push)(u,c.state,c)},[e,t,s,i,n])}L.createContext(null);function Ch(n,{relative:e}={}){let{matches:t}=L.useContext(Ea),{pathname:r}=ql(),i=JSON.stringify(Nj(t));return L.useMemo(()=>Lj(n,JSON.parse(i),r,e==="path"),[n,i,r,e])}function _Y(n,e,t,r){ei(Th(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i,static:s}=L.useContext(Ko),{matches:o}=L.useContext(Ea),a=o[o.length-1],l=a?a.params:{},c=a?a.pathname:"/",u=a?a.pathnameBase:"/",d=a&&a.route;{let S=d&&d.path||"";Zj(c,!d||S.endsWith("*")||S.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${S}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
137
|
+
|
|
138
|
+
Please change the parent <Route path="${S}"> to <Route path="${S==="/"?"*":`${S}/*`}">.`)}let h=ql(),m;m=h;let g=m.pathname||"/",O=g;if(u!=="/"){let S=u.replace(/^\//,"").split("/");O="/"+g.replace(/^\//,"").split("/").slice(S.length).join("/")}let y=!s&&t&&t.matches&&t.matches.length>0?t.matches:Dj(n,{pathname:O});return mo(d||y!=null,`No routes matched location "${m.pathname}${m.search}${m.hash}" `),mo(y==null||y[y.length-1].route.element!==void 0||y[y.length-1].route.Component!==void 0||y[y.length-1].route.lazy!==void 0,`Matched leaf route at location "${m.pathname}${m.search}${m.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),MY(y&&y.map(S=>Object.assign({},S,{params:Object.assign({},l,S.params),pathname:wa([u,i.encodeLocation?i.encodeLocation(S.pathname).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?u:wa([u,i.encodeLocation?i.encodeLocation(S.pathnameBase).pathname:S.pathnameBase])})),o,t,r)}function EY(){let n=NY(),e=wY(n)?`${n.status} ${n.statusText}`:n instanceof Error?n.message:JSON.stringify(n),t=n instanceof Error?n.stack:null,r="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:r},s={padding:"2px 4px",backgroundColor:r},o=null;return console.error("Error handled by React Router default ErrorBoundary:",n),o=L.createElement(L.Fragment,null,L.createElement("p",null,"💿 Hey developer 👋"),L.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",L.createElement("code",{style:s},"ErrorBoundary")," or"," ",L.createElement("code",{style:s},"errorElement")," prop on your route.")),L.createElement(L.Fragment,null,L.createElement("h2",null,"Unexpected Application Error!"),L.createElement("h3",{style:{fontStyle:"italic"}},e),t?L.createElement("pre",{style:i},t):null,o)}var RY=L.createElement(EY,null),AY=class extends L.Component{constructor(n){super(n),this.state={location:n.location,revalidation:n.revalidation,error:n.error}}static getDerivedStateFromError(n){return{error:n}}static getDerivedStateFromProps(n,e){return e.location!==n.location||e.revalidation!=="idle"&&n.revalidation==="idle"?{error:n.error,location:n.location,revalidation:n.revalidation}:{error:n.error!==void 0?n.error:e.error,location:e.location,revalidation:n.revalidation||e.revalidation}}componentDidCatch(n,e){console.error("React Router caught the following error during render",n,e)}render(){return this.state.error!==void 0?L.createElement(Ea.Provider,{value:this.props.routeContext},L.createElement(Qk.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function $Y({routeContext:n,match:e,children:t}){let r=L.useContext(pf);return r&&r.static&&r.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=e.route.id),L.createElement(Ea.Provider,{value:n},t)}function MY(n,e=[],t=null,r=null){if(n==null){if(!t)return null;if(t.errors)n=t.matches;else if(e.length===0&&!t.initialized&&t.matches.length>0)n=t.matches;else return null}let i=n,s=t==null?void 0:t.errors;if(s!=null){let l=i.findIndex(c=>c.route.id&&(s==null?void 0:s[c.route.id])!==void 0);ei(l>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(s).join(",")}`),i=i.slice(0,Math.min(i.length,l+1))}let o=!1,a=-1;if(t)for(let l=0;l<i.length;l++){let c=i[l];if((c.route.HydrateFallback||c.route.hydrateFallbackElement)&&(a=l),c.route.id){let{loaderData:u,errors:d}=t,h=c.route.loader&&!u.hasOwnProperty(c.route.id)&&(!d||d[c.route.id]===void 0);if(c.route.lazy||h){o=!0,a>=0?i=i.slice(0,a+1):i=[i[0]];break}}}return i.reduceRight((l,c,u)=>{let d,h=!1,m=null,g=null;t&&(d=s&&c.route.id?s[c.route.id]:void 0,m=c.route.errorElement||RY,o&&(a<0&&u===0?(Zj("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),h=!0,g=null):a===u&&(h=!0,g=c.route.hydrateFallbackElement||null)));let O=e.concat(i.slice(0,u+1)),y=()=>{let b;return d?b=m:h?b=g:c.route.Component?b=L.createElement(c.route.Component,null):c.route.element?b=c.route.element:b=l,L.createElement($Y,{match:c,routeContext:{outlet:l,matches:O,isDataRoute:t!=null},children:b})};return t&&(c.route.ErrorBoundary||c.route.errorElement||u===0)?L.createElement(AY,{location:t.location,revalidation:t.revalidation,component:m,error:d,children:y(),routeContext:{outlet:null,matches:O,isDataRoute:!0}}):y()},null)}function Dk(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function QY(n){let e=L.useContext(pf);return ei(e,Dk(n)),e}function DY(n){let e=L.useContext(iv);return ei(e,Dk(n)),e}function IY(n){let e=L.useContext(Ea);return ei(e,Dk(n)),e}function Ik(n){let e=IY(n),t=e.matches[e.matches.length-1];return ei(t.route.id,`${n} can only be used on routes that contain a unique "id"`),t.route.id}function jY(){return Ik("useRouteId")}function NY(){var r;let n=L.useContext(Qk),e=DY("useRouteError"),t=Ik("useRouteError");return n!==void 0?n:(r=e.errors)==null?void 0:r[t]}function LY(){let{router:n}=QY("useNavigate"),e=Ik("useNavigate"),t=L.useRef(!1);return Fj(()=>{t.current=!0}),L.useCallback(async(i,s={})=>{mo(t.current,Bj),t.current&&(typeof i=="number"?n.navigate(i):await n.navigate(i,{fromRouteId:e,...s}))},[n,e])}var gR={};function Zj(n,e,t){!e&&!gR[n]&&(gR[n]=!0,mo(!1,t))}L.memo(qY);function qY({routes:n,future:e,state:t}){return _Y(n,void 0,t,e)}function UY({basename:n="/",children:e=null,location:t,navigationType:r="POP",navigator:i,static:s=!1}){ei(!Th(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let o=n.replace(/^\/*/,"/"),a=L.useMemo(()=>({basename:o,navigator:i,static:s,future:{}}),[o,i,s]);typeof t=="string"&&(t=xh(t));let{pathname:l="/",search:c="",hash:u="",state:d=null,key:h="default"}=t,m=L.useMemo(()=>{let g=Ca(l,o);return g==null?null:{location:{pathname:g,search:c,hash:u,state:d,key:h},navigationType:r}},[o,l,c,u,d,h,r]);return mo(m!=null,`<Router basename="${o}"> is not able to match the URL "${l}${c}${u}" because it does not start with the basename, so the <Router> won't render anything.`),m==null?null:L.createElement(Ko.Provider,{value:a},L.createElement(sv.Provider,{children:e,value:m}))}var Ig="get",jg="application/x-www-form-urlencoded";function ov(n){return n!=null&&typeof n.tagName=="string"}function BY(n){return ov(n)&&n.tagName.toLowerCase()==="button"}function FY(n){return ov(n)&&n.tagName.toLowerCase()==="form"}function VY(n){return ov(n)&&n.tagName.toLowerCase()==="input"}function ZY(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function WY(n,e){return n.button===0&&(!e||e==="_self")&&!ZY(n)}function iw(n=""){return new URLSearchParams(typeof n=="string"||Array.isArray(n)||n instanceof URLSearchParams?n:Object.keys(n).reduce((e,t)=>{let r=n[t];return e.concat(Array.isArray(r)?r.map(i=>[t,i]):[[t,r]])},[]))}function XY(n,e){let t=iw(n);return e&&e.forEach((r,i)=>{t.has(i)||e.getAll(i).forEach(s=>{t.append(i,s)})}),t}var Jp=null;function zY(){if(Jp===null)try{new FormData(document.createElement("form"),0),Jp=!1}catch{Jp=!0}return Jp}var YY=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function U0(n){return n!=null&&!YY.has(n)?(mo(!1,`"${n}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${jg}"`),null):n}function GY(n,e){let t,r,i,s,o;if(FY(n)){let a=n.getAttribute("action");r=a?Ca(a,e):null,t=n.getAttribute("method")||Ig,i=U0(n.getAttribute("enctype"))||jg,s=new FormData(n)}else if(BY(n)||VY(n)&&(n.type==="submit"||n.type==="image")){let a=n.form;if(a==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=n.getAttribute("formaction")||a.getAttribute("action");if(r=l?Ca(l,e):null,t=n.getAttribute("formmethod")||a.getAttribute("method")||Ig,i=U0(n.getAttribute("formenctype"))||U0(a.getAttribute("enctype"))||jg,s=new FormData(a,n),!zY()){let{name:c,type:u,value:d}=n;if(u==="image"){let h=c?`${c}.`:"";s.append(`${h}x`,"0"),s.append(`${h}y`,"0")}else c&&s.append(c,d)}}else{if(ov(n))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');t=Ig,r=null,i=jg,o=n}return s&&i==="text/plain"&&(o=s,s=void 0),{action:r,method:t.toLowerCase(),encType:i,formData:s,body:o}}function jk(n,e){if(n===!1||n===null||typeof n>"u")throw new Error(e)}async function HY(n,e){if(n.id in e)return e[n.id];try{let t=await import(n.module);return e[n.id]=t,t}catch(t){return console.error(`Error loading route module \`${n.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function KY(n){return n==null?!1:n.href==null?n.rel==="preload"&&typeof n.imageSrcSet=="string"&&typeof n.imageSizes=="string":typeof n.rel=="string"&&typeof n.href=="string"}async function JY(n,e,t){let r=await Promise.all(n.map(async i=>{let s=e.routes[i.route.id];if(s){let o=await HY(s,t);return o.links?o.links():[]}return[]}));return rG(r.flat(1).filter(KY).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function OR(n,e,t,r,i,s){let o=(l,c)=>t[c]?l.route.id!==t[c].route.id:!0,a=(l,c)=>{var u;return t[c].pathname!==l.pathname||((u=t[c].route.path)==null?void 0:u.endsWith("*"))&&t[c].params["*"]!==l.params["*"]};return s==="assets"?e.filter((l,c)=>o(l,c)||a(l,c)):s==="data"?e.filter((l,c)=>{var d;let u=r.routes[l.route.id];if(!u||!u.hasLoader)return!1;if(o(l,c)||a(l,c))return!0;if(l.route.shouldRevalidate){let h=l.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:((d=t[0])==null?void 0:d.params)||{},nextUrl:new URL(n,window.origin),nextParams:l.params,defaultShouldRevalidate:!0});if(typeof h=="boolean")return h}return!0}):[]}function eG(n,e,{includeHydrateFallback:t}={}){return tG(n.map(r=>{let i=e.routes[r.route.id];if(!i)return[];let s=[i.module];return i.clientActionModule&&(s=s.concat(i.clientActionModule)),i.clientLoaderModule&&(s=s.concat(i.clientLoaderModule)),t&&i.hydrateFallbackModule&&(s=s.concat(i.hydrateFallbackModule)),i.imports&&(s=s.concat(i.imports)),s}).flat(1))}function tG(n){return[...new Set(n)]}function nG(n){let e={},t=Object.keys(n).sort();for(let r of t)e[r]=n[r];return e}function rG(n,e){let t=new Set;return new Set(e),n.reduce((r,i)=>{let s=JSON.stringify(nG(i));return t.has(s)||(t.add(s),r.push({key:s,link:i})),r},[])}function iG(n,e){let t=typeof n=="string"?new URL(n,typeof window>"u"?"server://singlefetch/":window.location.origin):n;return t.pathname==="/"?t.pathname="_root.data":e&&Ca(t.pathname,e)==="/"?t.pathname=`${e.replace(/\/$/,"")}/_root.data`:t.pathname=`${t.pathname.replace(/\/$/,"")}.data`,t}function Wj(){let n=L.useContext(pf);return jk(n,"You must render this element inside a <DataRouterContext.Provider> element"),n}function sG(){let n=L.useContext(iv);return jk(n,"You must render this element inside a <DataRouterStateContext.Provider> element"),n}var Nk=L.createContext(void 0);Nk.displayName="FrameworkContext";function Xj(){let n=L.useContext(Nk);return jk(n,"You must render this element inside a <HydratedRouter> element"),n}function oG(n,e){let t=L.useContext(Nk),[r,i]=L.useState(!1),[s,o]=L.useState(!1),{onFocus:a,onBlur:l,onMouseEnter:c,onMouseLeave:u,onTouchStart:d}=e,h=L.useRef(null);L.useEffect(()=>{if(n==="render"&&o(!0),n==="viewport"){let O=b=>{b.forEach(S=>{o(S.isIntersecting)})},y=new IntersectionObserver(O,{threshold:.5});return h.current&&y.observe(h.current),()=>{y.disconnect()}}},[n]),L.useEffect(()=>{if(r){let O=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(O)}}},[r]);let m=()=>{i(!0)},g=()=>{i(!1),o(!1)};return t?n!=="intent"?[s,h,{}]:[s,h,{onFocus:rd(a,m),onBlur:rd(l,g),onMouseEnter:rd(c,m),onMouseLeave:rd(u,g),onTouchStart:rd(d,m)}]:[!1,h,{}]}function rd(n,e){return t=>{n&&n(t),t.defaultPrevented||e(t)}}function aG({page:n,...e}){let{router:t}=Wj(),r=L.useMemo(()=>Dj(t.routes,n,t.basename),[t.routes,n,t.basename]);return r?L.createElement(cG,{page:n,matches:r,...e}):null}function lG(n){let{manifest:e,routeModules:t}=Xj(),[r,i]=L.useState([]);return L.useEffect(()=>{let s=!1;return JY(n,e,t).then(o=>{s||i(o)}),()=>{s=!0}},[n,e,t]),r}function cG({page:n,matches:e,...t}){let r=ql(),{manifest:i,routeModules:s}=Xj(),{basename:o}=Wj(),{loaderData:a,matches:l}=sG(),c=L.useMemo(()=>OR(n,e,l,i,r,"data"),[n,e,l,i,r]),u=L.useMemo(()=>OR(n,e,l,i,r,"assets"),[n,e,l,i,r]),d=L.useMemo(()=>{if(n===r.pathname+r.search+r.hash)return[];let g=new Set,O=!1;if(e.forEach(b=>{var P;let S=i.routes[b.route.id];!S||!S.hasLoader||(!c.some(k=>k.route.id===b.route.id)&&b.route.id in a&&((P=s[b.route.id])!=null&&P.shouldRevalidate)||S.hasClientLoader?O=!0:g.add(b.route.id))}),g.size===0)return[];let y=iG(n,o);return O&&g.size>0&&y.searchParams.set("_routes",e.filter(b=>g.has(b.route.id)).map(b=>b.route.id).join(",")),[y.pathname+y.search]},[o,a,r,i,c,e,n,s]),h=L.useMemo(()=>eG(u,i),[u,i]),m=lG(u);return L.createElement(L.Fragment,null,d.map(g=>L.createElement("link",{key:g,rel:"prefetch",as:"fetch",href:g,...t})),h.map(g=>L.createElement("link",{key:g,rel:"modulepreload",href:g,...t})),m.map(({key:g,link:O})=>L.createElement("link",{key:g,...O})))}function uG(...n){return e=>{n.forEach(t=>{typeof t=="function"?t(e):t!=null&&(t.current=e)})}}var zj=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{zj&&(window.__reactRouterVersion="7.4.1")}catch{}function fG({basename:n,children:e,window:t}){let r=L.useRef();r.current==null&&(r.current=eY({window:t,v5Compat:!0}));let i=r.current,[s,o]=L.useState({action:i.action,location:i.location}),a=L.useCallback(l=>{L.startTransition(()=>o(l))},[o]);return L.useLayoutEffect(()=>i.listen(a),[i,a]),L.createElement(UY,{basename:n,children:e,location:s.location,navigationType:s.action,navigator:i})}var Yj=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Gj=L.forwardRef(function({onClick:e,discover:t="render",prefetch:r="none",relative:i,reloadDocument:s,replace:o,state:a,target:l,to:c,preventScrollReset:u,viewTransition:d,...h},m){let{basename:g}=L.useContext(Ko),O=typeof c=="string"&&Yj.test(c),y,b=!1;if(typeof c=="string"&&O&&(y=c,zj))try{let _=new URL(window.location.href),R=c.startsWith("//")?new URL(_.protocol+c):new URL(c),$=Ca(R.pathname,g);R.origin===_.origin&&$!=null?c=$+R.search+R.hash:b=!0}catch{mo(!1,`<Link to="${c}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let S=TY(c,{relative:i}),[P,k,x]=oG(r,h),A=mG(c,{replace:o,state:a,target:l,preventScrollReset:u,relative:i,viewTransition:d});function M(_){e&&e(_),_.defaultPrevented||A(_)}let Q=L.createElement("a",{...h,...x,href:y||S,onClick:b||s?e:M,ref:uG(m,k),target:l,"data-discover":!O&&t==="render"?"true":void 0});return P&&!O?L.createElement(L.Fragment,null,Q,L.createElement(aG,{page:S})):Q});Gj.displayName="Link";var dG=L.forwardRef(function({"aria-current":e="page",caseSensitive:t=!1,className:r="",end:i=!1,style:s,to:o,viewTransition:a,children:l,...c},u){let d=Ch(o,{relative:c.relative}),h=ql(),m=L.useContext(iv),{navigator:g,basename:O}=L.useContext(Ko),y=m!=null&&SG(d)&&a===!0,b=g.encodeLocation?g.encodeLocation(d).pathname:d.pathname,S=h.pathname,P=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;t||(S=S.toLowerCase(),P=P?P.toLowerCase():null,b=b.toLowerCase()),P&&O&&(P=Ca(P,O)||P);const k=b!=="/"&&b.endsWith("/")?b.length-1:b.length;let x=S===b||!i&&S.startsWith(b)&&S.charAt(k)==="/",A=P!=null&&(P===b||!i&&P.startsWith(b)&&P.charAt(b.length)==="/"),M={isActive:x,isPending:A,isTransitioning:y},Q=x?e:void 0,_;typeof r=="function"?_=r(M):_=[r,x?"active":null,A?"pending":null,y?"transitioning":null].filter(Boolean).join(" ");let R=typeof s=="function"?s(M):s;return L.createElement(Gj,{...c,"aria-current":Q,className:_,ref:u,style:R,to:o,viewTransition:a},typeof l=="function"?l(M):l)});dG.displayName="NavLink";var hG=L.forwardRef(({discover:n="render",fetcherKey:e,navigate:t,reloadDocument:r,replace:i,state:s,method:o=Ig,action:a,onSubmit:l,relative:c,preventScrollReset:u,viewTransition:d,...h},m)=>{let g=yG(),O=bG(a,{relative:c}),y=o.toLowerCase()==="get"?"get":"post",b=typeof a=="string"&&Yj.test(a),S=P=>{if(l&&l(P),P.defaultPrevented)return;P.preventDefault();let k=P.nativeEvent.submitter,x=(k==null?void 0:k.getAttribute("formmethod"))||o;g(k||P.currentTarget,{fetcherKey:e,method:x,navigate:t,replace:i,state:s,relative:c,preventScrollReset:u,viewTransition:d})};return L.createElement("form",{ref:m,method:y,action:O,onSubmit:r?l:S,...h,"data-discover":!b&&n==="render"?"true":void 0})});hG.displayName="Form";function pG(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Hj(n){let e=L.useContext(pf);return ei(e,pG(n)),e}function mG(n,{target:e,replace:t,state:r,preventScrollReset:i,relative:s,viewTransition:o}={}){let a=Vj(),l=ql(),c=Ch(n,{relative:s});return L.useCallback(u=>{if(WY(u,e)){u.preventDefault();let d=t!==void 0?t:oh(l)===oh(c);a(n,{replace:d,state:r,preventScrollReset:i,relative:s,viewTransition:o})}},[l,a,c,t,r,e,n,i,s,o])}function gG(n){mo(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let e=L.useRef(iw(n)),t=L.useRef(!1),r=ql(),i=L.useMemo(()=>XY(r.search,t.current?null:e.current),[r.search]),s=Vj(),o=L.useCallback((a,l)=>{const c=iw(typeof a=="function"?a(i):a);t.current=!0,s("?"+c,l)},[s,i]);return[i,o]}var OG=0,vG=()=>`__${String(++OG)}__`;function yG(){let{router:n}=Hj("useSubmit"),{basename:e}=L.useContext(Ko),t=jY();return L.useCallback(async(r,i={})=>{let{action:s,method:o,encType:a,formData:l,body:c}=GY(r,e);if(i.navigate===!1){let u=i.fetcherKey||vG();await n.fetch(u,t,i.action||s,{preventScrollReset:i.preventScrollReset,formData:l,body:c,formMethod:i.method||o,formEncType:i.encType||a,flushSync:i.flushSync})}else await n.navigate(i.action||s,{preventScrollReset:i.preventScrollReset,formData:l,body:c,formMethod:i.method||o,formEncType:i.encType||a,replace:i.replace,state:i.state,fromRouteId:t,flushSync:i.flushSync,viewTransition:i.viewTransition})},[n,e,t])}function bG(n,{relative:e}={}){let{basename:t}=L.useContext(Ko),r=L.useContext(Ea);ei(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),s={...Ch(n||".",{relative:e})},o=ql();if(n==null){s.search=o.search;let a=new URLSearchParams(s.search),l=a.getAll("index");if(l.some(u=>u==="")){a.delete("index"),l.filter(d=>d).forEach(d=>a.append("index",d));let u=a.toString();s.search=u?`?${u}`:""}}return(!n||n===".")&&i.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),t!=="/"&&(s.pathname=s.pathname==="/"?t:wa([t,s.pathname])),oh(s)}function SG(n,e={}){let t=L.useContext(Uj);ei(t!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Hj("useViewTransitionState"),i=Ch(n,{relative:e.relative});if(!t.isTransitioning)return!1;let s=Ca(t.currentLocation.pathname,r)||t.currentLocation.pathname,o=Ca(t.nextLocation.pathname,r)||t.nextLocation.pathname;return SO(i.pathname,o)!=null||SO(i.pathname,s)!=null}new TextEncoder;var wG=fh();const em=Us(wG),Kj="~",vR=(n,e)=>{if(n&&n.files){for(const t of Object.keys(n.files))if(n.files[t].name===e)return t}return null},yR=(n,e)=>{if(n&&n.files){const t=n.files[e];if(t)return t.name}return null},kG=({tabStateParams:n,content:e})=>{const{file:t,tabs:r}=n,i=[],s=vR(e,t);return r?r.split(Kj).forEach(o=>{const a=vR(e,o);a&&i.push({fileId:a})}):s&&i.push({fileId:s}),{tabList:i,activeFileId:s}},PG=({tabList:n,activeFileId:e,content:t})=>{const r=yR(t,e),i={};if(r&&(i.file=r,n.length>1)){const s=n.map(o=>yR(t,o.fileId)).join(Kj);i.tabs=s}return i},xG=({content:n,openTab:e,setActiveFileId:t,tabList:r,activeFileId:i})=>{const[s,o]=gG(),a=L.useMemo(()=>({file:s.get("file"),tabs:s.get("tabs")}),[s]),l=L.useRef(!1);L.useEffect(()=>{if(l.current||!n)return;const{tabList:d,activeFileId:h}=kG({tabStateParams:a,content:n});l.current=!0,d.forEach(e),t(h)},[n,s,t,e,l]);const c=L.useRef(n);L.useEffect(()=>{c.current=n},[n]);const u=L.useRef(o);L.useEffect(()=>{u.current=o},[o]),L.useEffect(()=>{if(!c.current)return;const d=PG({tabList:r,activeFileId:i,content:c.current});u.current(h=>{const m=new URLSearchParams(h);return d.file?m.set("file",d.file):m.delete("file"),d.tabs?m.set("tabs",d.tabs):m.delete("tabs"),m})},[r,i])},Qc=(n,e)=>{if(n.id===e)return n;if(n.type==="splitPane")for(const t of n.children){const r=Qc(t,e);if(r)return r}},Al=({pane:n,activePaneId:e,newTabList:t,newActiveFileId:r})=>n.type==="splitPane"?{...n,children:n.children.map(i=>Al({pane:i,activePaneId:e,newTabList:t,newActiveFileId:r}))}:n.id===e?{...n,tabList:t!==void 0?t:n.tabList,activeFileId:r!==void 0?r:n.activeFileId}:n,TG=(n,e)=>{if(e.type!=="close_tabs")return n;const{pane:t,activePaneId:r}=n,i=Qc(t,r);if(i.type!=="leafPane")throw new Error("closeTabsReducer: activePane is not a leafPane");const s=i.tabList.filter(l=>!e.fileIdsToClose.includes(l.fileId));if(!e.fileIdsToClose.includes(i.activeFileId))return{...n,pane:Al({pane:t,activePaneId:r,newTabList:s})};let o=null;const a=i.tabList.findIndex(l=>l.fileId===i.activeFileId);for(let l=a-1;l>=0;l--)if(!e.fileIdsToClose.includes(i.tabList[l].fileId)){o=i.tabList[l].fileId;break}if(!o){for(let l=a+1;l<i.tabList.length;l++)if(!e.fileIdsToClose.includes(i.tabList[l].fileId)){o=i.tabList[l].fileId;break}}return{...n,pane:Al({pane:t,activePaneId:r,newTabList:s,newActiveFileId:o})}},CG=(n,e)=>{if(e.type!=="open_tab")return n;const{pane:t,activePaneId:r}=n,i=Qc(t,r);if(i.type!=="leafPane")throw new Error("closeTabsReducer: activePane is not a leafPane");const s=i.tabList.findIndex(h=>h.fileId===e.fileId),o=s!==-1,a=o&&i.tabList[s].isTransient,l=i.tabList.findIndex(h=>h.isTransient&&h.fileId!==e.fileId),c={fileId:e.fileId,isTransient:e.isTransient};let u;o?a?u=i.tabList.map(h=>h.fileId===e.fileId?c:h):u=[...i.tabList]:l!==-1?(u=[...i.tabList],u[l]=c):u=[...i.tabList,c];const d=!e.isTransient;return{...n,pane:Al({pane:t,activePaneId:r,newTabList:u,newActiveFileId:e.fileId}),editorWantsFocus:d}},_G=(n,e)=>{if(e.type!=="set_active_file_id")return n;const{pane:t,activePaneId:r}=n;if(Qc(t,r).type!=="leafPane")throw new Error("closeTabsReducer: activePane is not a leafPane");return{...n,pane:Al({pane:t,activePaneId:r,newActiveFileId:e.activeFileId})}},EG=(n,e)=>{if(e.type!=="set_active_file_left")return n;const{pane:t,activePaneId:r}=n,i=Qc(t,r);if(i.type!=="leafPane")throw new Error("closeTabsReducer: activePane is not a leafPane");let s=i.tabList.findIndex(o=>o.fileId===i.activeFileId);return s-=1,s<0&&(s=i.tabList.length-1),{...n,pane:Al({pane:t,activePaneId:r,newActiveFileId:i.tabList[s].fileId})}},RG=(n,e)=>{if(e.type!=="set_active_file_right")return n;const{pane:t,activePaneId:r}=n,i=Qc(t,r);if(i.type!=="leafPane")throw new Error("closeTabsReducer: activePane is not a leafPane");let s=i.tabList.findIndex(o=>o.fileId===i.activeFileId);return s+=1,s>i.tabList.length-1&&(s=0),{...n,pane:Al({pane:t,activePaneId:r,newActiveFileId:i.tabList[s].fileId})}},AG=(n,e)=>e.type==="set_is_settings_open"?{...n,isSettingsOpen:e.value}:n,$G=(n,e)=>e.type==="set_is_doc_open"?{...n,isDocOpen:e.value}:n,MG=(n,e)=>e.type==="set_theme"?{...n,theme:e.themeLabel}:n,QG=(n,e)=>e.type==="editor_no_longer_wants_focus"?{...n,editorWantsFocus:!1}:n,DG=(n,e)=>e.type==="set_username"?{...n,username:e.username}:n;function IG(n,e){const t=n.data.files,r=Object.keys(n.data.files);let i={};for(let s=0;s<r.length;s++){const o=t[r[s]];if(t[r[s]].text){const a=o.name,l=o.text.split(`
|
|
139
|
+
`),c=[];for(let u=0;u<l.length;u++){const d=l[u].indexOf(e);d!==-1&&c.push({line:u+1,index:d,text:l[u],isClosed:!1})}c.length>0&&(i[r[s]]={name:a,matches:c,visibility:"open"})}}return i}function jG(n,e,t){return{...n,[e]:{...n[e],visibility:t}}}const NG=(n,e)=>e.type==="set_is_search_open"?{...n,isSearchOpen:e.value}:n,LG=(n,e)=>e.type==="set_search"?{...n,search:{...n.search,pattern:e.value,results:{},focusedIndex:0,focusedChildIndex:null,focused:!0}}:n,qG=(n,e)=>e.type==="set_search_results"?{...n,search:{...n.search,pattern:n.search.pattern,results:IG(e.files,n.search.pattern),focused:n.search.focused}}:n,UG=(n,e)=>e.type==="set_search_file_visibility"?{...n,search:{...n.search,pattern:n.search.pattern,results:jG(n.search.results,e.id,e.visibility)}}:n,BG=(n,e)=>e.type==="hide_search_results_line"?{...n,search:{...n.search,results:{...n.search.results,[e.id]:{...n.search.results[e.id],matches:n.search.results[e.id].matches.filter((t,r)=>t.line!==e.line)}}}}:n,FG=(n,e)=>e.type==="set_active_search_index"?{...n,search:{...n.search,focusedIndex:e.focusedIndex,focusedChildIndex:e.childIndex}}:n,VG=(n,e)=>e.type==="toggle_search_focused"?{...n,search:{...n.search,focused:!n.search.focused}}:n,ZG=(n,e)=>e.type==="toggle_auto_follow"?{...n,enableAutoFollow:!n.enableAutoFollow}:n,WG=(n,e)=>{if(e.type==="update_presence_indicator"){const t=n.sidebarPresenceIndicators.find(r=>r.username===e.presenceIndicator.username);return{...n,sidebarPresenceIndicators:t?n.sidebarPresenceIndicators.map(r=>r.username===e.presenceIndicator.username?e.presenceIndicator:r):[...n.sidebarPresenceIndicators,e.presenceIndicator]}}return n},XG=(n,e)=>{if(e.type!=="split_current_pane")return n;const t=n.activePaneId,r={id:`${t}-1`,type:"leafPane",tabList:[],activeFileId:null},i={id:`${t}-2`,type:"leafPane",tabList:[],activeFileId:null},s={id:t,type:"splitPane",orientation:"horizontal",children:[r,i]},o=Al({pane:n.pane,activePaneId:t,newTabList:void 0,newActiveFileId:void 0}),a=(c,u)=>c.id===u?s:c.type==="splitPane"?{...c,children:c.children.map(d=>a(d,u))}:c,l=a(o,t);return{...n,pane:l,activePaneId:r.id}},zG=({defaultTheme:n,initialUsername:e="Anonymous"})=>({pane:{id:"root",type:"leafPane",tabList:[],activeFileId:null},activePaneId:"root",theme:n,search:{pattern:"",results:{},focused:!1,focusedIndex:null,focusedChildIndex:null},isSearchOpen:!1,isSettingsOpen:!1,isDocOpen:!1,editorWantsFocus:!1,username:e,enableAutoFollow:!1,sidebarPresenceIndicators:[]}),YG=[_G,EG,RG,CG,TG,MG,LG,qG,UG,BG,FG,VG,NG,AG,$G,QG,DG,ZG,WG,XG],GG=(n,e)=>YG.reduce((t,r)=>r(t,e),n),ni=L.createContext(null),HG=({content:n,shareDBDoc:e,submitOperation:t,localPresence:r,docPresence:i,prettierWorker:s,typeScriptWorker:o,initialUsername:a,children:l,codeError:c=null,connected:u,pending:d,liveKitToken:h,setLiveKitToken:m,liveKitRoomName:g,setLiveKitRoom:O,liveKitConnection:y,setLiveKitConnection:b})=>{const{prettierError:S,runPrettierRef:P}=zz({shareDBDoc:e,submitOperation:t,prettierWorker:s}),k=Yz(t),x=L.useRef(null),A=L.useRef(null),M=S||c;Kz({content:n,typeScriptWorker:o});const[Q,_]=L.useReducer(GG,{defaultTheme:Dz,initialUsername:a},zG),{pane:R,activePaneId:$,theme:D,search:F,isSearchOpen:G,isSettingsOpen:ue,isDocOpen:B,editorWantsFocus:X,username:W,enableAutoFollow:ee,sidebarPresenceIndicators:re}=Q,H=Qc(R,$);if(H.type!=="leafPane")throw new Error("Expected leafPane");const{setActiveFileId:se,setActiveFileLeft:J,setActiveFileRight:oe,openTab:pe,closeTabs:Ee,setTheme:j,setIsSearchOpen:V,setSearch:Y,setSearchResults:de,setSearchFileVisibility:ke,setSearchLineVisibility:Te,setSearchFocusedIndex:Pe,toggleSearchFocused:Re,setIsSettingsOpen:Ge,setIsDocOpen:gt,closeSettings:tn,closeDoc:Ln,editorNoLongerWantsFocus:an,setUsername:ln,toggleAutoFollow:Qn,updatePresenceIndicator:Dn,splitCurrentPane:I}=jz(_);xG({content:n,openTab:pe,setActiveFileId:se,tabList:H.tabList,activeFileId:H.activeFileId});const{isDirectoryOpen:ge,toggleDirectory:je}=Zz(),ze=Nz();Iz(ze,D);const{createFile:Ze,renameFile:Ke,deleteFile:_t,createDirectory:kt,renameDirectory:$e,deleteDirectory:tt}=qz({submitOperation:t,closeTabs:Ee,openTab:pe}),[We,Xe]=L.useState(!1),at=L.useCallback(()=>{Xe(!0)},[]),dt=L.useCallback(()=>{Xe(!1)},[]),Dt=L.useCallback(Qr=>{Ze(Qr),Xe(!1)},[Ze,Xe]),[Le,ct]=L.useState(!1),Ft=L.useCallback(()=>{ct(!0)},[]),ht=L.useCallback(()=>{ct(!1)},[]),It=L.useCallback(Qr=>{kt(Qr),ct(!1)},[kt,ct]),cn=n?n.files:null;Vz({closeTabs:Ee,activeFileId:H.activeFileId,activePaneId:$,handleOpenCreateFileModal:at,setActiveFileLeft:J,setActiveFileRight:oe,toggleSearchFocused:Re,runPrettierRef:P,runCodeRef:k,sidebarRef:x,editorCache:ze,codeEditorRef:A});const[Pn,On]=L.useState(null),[wn,tr]=L.useState(!1),Bn={content:n,shareDBDoc:e,submitOperation:t,localPresence:r,docPresence:i,files:cn,createFile:Ze,renameFile:Ke,deleteFile:_t,createDirectory:kt,renameDirectory:$e,deleteDirectory:tt,setActiveFileId:se,setActiveFileLeft:J,setActiveFileRight:oe,activePaneId:$,pane:R,activePane:H,openTab:pe,closeTabs:Ee,search:F,isSearchOpen:G,setIsSearchOpen:V,setSearch:Y,setSearchResults:de,setSearchFileVisibility:ke,setSearchLineVisibility:Te,setSearchFocusedIndex:Pe,toggleSearchFocused:Re,isSettingsOpen:ue,setIsSettingsOpen:Ge,closeSettings:tn,isDocOpen:B,setIsDocOpen:gt,closeDoc:Ln,theme:D,setTheme:j,username:W,setUsername:ln,isDirectoryOpen:ge,toggleDirectory:je,editorCache:ze,editorWantsFocus:X,editorNoLongerWantsFocus:an,errorMessage:M,typeScriptWorker:o,isCreateFileModalOpen:We,handleOpenCreateFileModal:at,handleCloseCreateFileModal:dt,handleCreateFileClick:Dt,isCreateDirModalOpen:Le,handleOpenCreateDirModal:Ft,handleCloseCreateDirModal:ht,handleCreateDirClick:It,runPrettierRef:P,runCodeRef:k,sidebarRef:x,codeEditorRef:A,connected:u,pending:d,hoveredItemId:Pn,setHoveredItemId:On,enableAutoFollow:ee,toggleAutoFollow:Qn,updatePresenceIndicator:Dn,sidebarPresenceIndicators:re,splitCurrentPane:I,liveKitRoomName:g,setLiveKitRoom:O,liveKitToken:h,setLiveKitToken:m,liveKitConnection:y,setLiveKitConnection:b,voiceChatModalOpen:wn,setVoiceChatModalOpen:tr};return q.jsx(ni.Provider,{value:Bn,children:l})},Jj=!1;var tm={exports:{}},B0={exports:{}},bR;function gn(){return bR||(bR=1,function(n){function e(t){return t&&t.__esModule?t:{default:t}}n.exports=e,n.exports.__esModule=!0,n.exports.default=n.exports}(B0)),B0.exports}var F0={exports:{}};/*!
|
|
140
|
+
Copyright (c) 2018 Jed Watson.
|
|
141
|
+
Licensed under the MIT License (MIT), see
|
|
142
|
+
http://jedwatson.github.io/classnames
|
|
143
|
+
*/var SR;function zn(){return SR||(SR=1,function(n){(function(){var e={}.hasOwnProperty;function t(){for(var s="",o=0;o<arguments.length;o++){var a=arguments[o];a&&(s=i(s,r(a)))}return s}function r(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return t.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var o="";for(var a in s)e.call(s,a)&&s[a]&&(o=i(o,a));return o}function i(s,o){return o?s?s+" "+o:s+o:s}n.exports?(t.default=t,n.exports=t):window.classNames=t})()}(F0)),F0.exports}var V0={exports:{}},Z0,wR;function KG(){if(wR)return Z0;wR=1;var n="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Z0=n,Z0}var W0,kR;function JG(){if(kR)return W0;kR=1;var n=KG();function e(){}function t(){}return t.resetWarningCache=e,W0=function(){function r(o,a,l,c,u,d){if(d!==n){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}r.isRequired=r;function i(){return r}var s={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:t,resetWarningCache:e};return s.PropTypes=s,s},W0}var PR;function av(){return PR||(PR=1,V0.exports=JG()()),V0.exports}var nm={exports:{}},rm={exports:{}},xR;function eN(){return xR||(xR=1,function(n,e){var t=gn();e.__esModule=!0,e.default=void 0;var r=t(zn()),i=l(ut()),s=t(av()),o=fn();function a(d){if(typeof WeakMap!="function")return null;var h=new WeakMap,m=new WeakMap;return(a=function(g){return g?m:h})(d)}function l(d,h){if(d&&d.__esModule)return d;if(d===null||typeof d!="object"&&typeof d!="function")return{default:d};var m=a(h);if(m&&m.has(d))return m.get(d);var g={__proto__:null},O=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var y in d)if(y!=="default"&&Object.prototype.hasOwnProperty.call(d,y)){var b=O?Object.getOwnPropertyDescriptor(d,y):null;b&&(b.get||b.set)?Object.defineProperty(g,y,b):g[y]=d[y]}return g.default=d,m&&m.set(d,g),g}const c={type:s.default.string,tooltip:s.default.bool,as:s.default.elementType},u=i.forwardRef(({as:d="div",className:h,type:m="valid",tooltip:g=!1,...O},y)=>(0,o.jsx)(d,{...O,ref:y,className:(0,r.default)(h,`${m}-${g?"tooltip":"feedback"}`)}));u.displayName="Feedback",u.propTypes=c,e.default=u,n.exports=e.default}(rm,rm.exports)),rm.exports}var im={exports:{}},sm={exports:{}},TR;function Ul(){return TR||(TR=1,function(n,e){"use client";e.__esModule=!0,e.default=void 0;var t=i(ut());function r(o){if(typeof WeakMap!="function")return null;var a=new WeakMap,l=new WeakMap;return(r=function(c){return c?l:a})(o)}function i(o,a){if(o&&o.__esModule)return o;if(o===null||typeof o!="object"&&typeof o!="function")return{default:o};var l=r(a);if(l&&l.has(o))return l.get(o);var c={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var d in o)if(d!=="default"&&Object.prototype.hasOwnProperty.call(o,d)){var h=u?Object.getOwnPropertyDescriptor(o,d):null;h&&(h.get||h.set)?Object.defineProperty(c,d,h):c[d]=o[d]}return c.default=o,l&&l.set(o,c),c}const s=t.createContext({});e.default=s,n.exports=e.default}(sm,sm.exports)),sm.exports}var Ci={},CR;function Tr(){if(CR)return Ci;CR=1,Ci.__esModule=!0,Ci.ThemeConsumer=Ci.DEFAULT_MIN_BREAKPOINT=Ci.DEFAULT_BREAKPOINTS=void 0,Ci.createBootstrapComponent=O,Ci.default=void 0,Ci.useBootstrapBreakpoints=h,Ci.useBootstrapMinBreakpoint=m,Ci.useBootstrapPrefix=d,Ci.useIsRTL=g;var n=i(ut()),e=n,t=fn();function r(y){if(typeof WeakMap!="function")return null;var b=new WeakMap,S=new WeakMap;return(r=function(P){return P?S:b})(y)}function i(y,b){if(y&&y.__esModule)return y;if(y===null||typeof y!="object"&&typeof y!="function")return{default:y};var S=r(b);if(S&&S.has(y))return S.get(y);var P={__proto__:null},k=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var x in y)if(x!=="default"&&Object.prototype.hasOwnProperty.call(y,x)){var A=k?Object.getOwnPropertyDescriptor(y,x):null;A&&(A.get||A.set)?Object.defineProperty(P,x,A):P[x]=y[x]}return P.default=y,S&&S.set(y,P),P}const s=Ci.DEFAULT_BREAKPOINTS=["xxl","xl","lg","md","sm","xs"],o=Ci.DEFAULT_MIN_BREAKPOINT="xs",a=e.createContext({prefixes:{},breakpoints:s,minBreakpoint:o}),{Consumer:l,Provider:c}=a;Ci.ThemeConsumer=l;function u({prefixes:y={},breakpoints:b=s,minBreakpoint:S=o,dir:P,children:k}){const x=(0,n.useMemo)(()=>({prefixes:{...y},breakpoints:b,minBreakpoint:S,dir:P}),[y,b,S,P]);return(0,t.jsx)(c,{value:x,children:k})}function d(y,b){const{prefixes:S}=(0,n.useContext)(a);return y||S[b]||b}function h(){const{breakpoints:y}=(0,n.useContext)(a);return y}function m(){const{minBreakpoint:y}=(0,n.useContext)(a);return y}function g(){const{dir:y}=(0,n.useContext)(a);return y==="rtl"}function O(y,b){typeof b=="string"&&(b={prefix:b});const S=y.prototype&&y.prototype.isReactComponent,{prefix:P,forwardRefAs:k=S?"ref":"innerRef"}=b,x=e.forwardRef(({...A},M)=>{A[k]=M;const Q=d(A.bsPrefix,P);return(0,t.jsx)(y,{...A,bsPrefix:Q})});return x.displayName=`Bootstrap(${y.displayName||y.name})`,x}return Ci.default=u,Ci}var _R;function eH(){return _R||(_R=1,function(n,e){"use client";var t=gn();e.__esModule=!0,e.default=void 0;var r=t(zn()),i=u(ut()),s=i,o=t(Ul()),a=Tr(),l=fn();function c(h){if(typeof WeakMap!="function")return null;var m=new WeakMap,g=new WeakMap;return(c=function(O){return O?g:m})(h)}function u(h,m){if(h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var g=c(m);if(g&&g.has(h))return g.get(h);var O={__proto__:null},y=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var b in h)if(b!=="default"&&Object.prototype.hasOwnProperty.call(h,b)){var S=y?Object.getOwnPropertyDescriptor(h,b):null;S&&(S.get||S.set)?Object.defineProperty(O,b,S):O[b]=h[b]}return O.default=h,g&&g.set(h,O),O}const d=s.forwardRef(({id:h,bsPrefix:m,className:g,type:O="checkbox",isValid:y=!1,isInvalid:b=!1,as:S="input",...P},k)=>{const{controlId:x}=(0,i.useContext)(o.default);return m=(0,a.useBootstrapPrefix)(m,"form-check-input"),(0,l.jsx)(S,{...P,ref:k,type:O,id:h||x,className:(0,r.default)(g,m,y&&"is-valid",b&&"is-invalid")})});d.displayName="FormCheckInput",e.default=d,n.exports=e.default}(im,im.exports)),im.exports}var om={exports:{}},ER;function tH(){return ER||(ER=1,function(n,e){"use client";var t=gn();e.__esModule=!0,e.default=void 0;var r=t(zn()),i=u(ut()),s=i,o=t(Ul()),a=Tr(),l=fn();function c(h){if(typeof WeakMap!="function")return null;var m=new WeakMap,g=new WeakMap;return(c=function(O){return O?g:m})(h)}function u(h,m){if(h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var g=c(m);if(g&&g.has(h))return g.get(h);var O={__proto__:null},y=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var b in h)if(b!=="default"&&Object.prototype.hasOwnProperty.call(h,b)){var S=y?Object.getOwnPropertyDescriptor(h,b):null;S&&(S.get||S.set)?Object.defineProperty(O,b,S):O[b]=h[b]}return O.default=h,g&&g.set(h,O),O}const d=s.forwardRef(({bsPrefix:h,className:m,htmlFor:g,...O},y)=>{const{controlId:b}=(0,i.useContext)(o.default);return h=(0,a.useBootstrapPrefix)(h,"form-check-label"),(0,l.jsx)("label",{...O,ref:y,htmlFor:g||b,className:(0,r.default)(m,h)})});d.displayName="FormCheckLabel",e.default=d,n.exports=e.default}(om,om.exports)),om.exports}var au={},RR;function nH(){if(RR)return au;RR=1,au.__esModule=!0,au.forEach=i,au.hasChildOfType=s,au.map=r;var n=t(ut());function e(o){if(typeof WeakMap!="function")return null;var a=new WeakMap,l=new WeakMap;return(e=function(c){return c?l:a})(o)}function t(o,a){if(o&&o.__esModule)return o;if(o===null||typeof o!="object"&&typeof o!="function")return{default:o};var l=e(a);if(l&&l.has(o))return l.get(o);var c={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var d in o)if(d!=="default"&&Object.prototype.hasOwnProperty.call(o,d)){var h=u?Object.getOwnPropertyDescriptor(o,d):null;h&&(h.get||h.set)?Object.defineProperty(c,d,h):c[d]=o[d]}return c.default=o,l&&l.set(o,c),c}function r(o,a){let l=0;return n.Children.map(o,c=>n.isValidElement(c)?a(c,l++):c)}function i(o,a){let l=0;n.Children.forEach(o,c=>{n.isValidElement(c)&&a(c,l++)})}function s(o,a){return n.Children.toArray(o).some(l=>n.isValidElement(l)&&l.type===a)}return au}var AR;function tN(){return AR||(AR=1,function(n,e){"use client";var t=gn();e.__esModule=!0,e.default=void 0;var r=t(zn()),i=g(ut()),s=i,o=t(eN()),a=t(eH()),l=t(tH()),c=t(Ul()),u=Tr(),d=nH(),h=fn();function m(y){if(typeof WeakMap!="function")return null;var b=new WeakMap,S=new WeakMap;return(m=function(P){return P?S:b})(y)}function g(y,b){if(y&&y.__esModule)return y;if(y===null||typeof y!="object"&&typeof y!="function")return{default:y};var S=m(b);if(S&&S.has(y))return S.get(y);var P={__proto__:null},k=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var x in y)if(x!=="default"&&Object.prototype.hasOwnProperty.call(y,x)){var A=k?Object.getOwnPropertyDescriptor(y,x):null;A&&(A.get||A.set)?Object.defineProperty(P,x,A):P[x]=y[x]}return P.default=y,S&&S.set(y,P),P}const O=s.forwardRef(({id:y,bsPrefix:b,bsSwitchPrefix:S,inline:P=!1,reverse:k=!1,disabled:x=!1,isValid:A=!1,isInvalid:M=!1,feedbackTooltip:Q=!1,feedback:_,feedbackType:R,className:$,style:D,title:F="",type:G="checkbox",label:ue,children:B,as:X="input",...W},ee)=>{b=(0,u.useBootstrapPrefix)(b,"form-check"),S=(0,u.useBootstrapPrefix)(S,"form-switch");const{controlId:re}=(0,i.useContext)(c.default),H=(0,i.useMemo)(()=>({controlId:y||re}),[re,y]),se=!B&&ue!=null&&ue!==!1||(0,d.hasChildOfType)(B,l.default),J=(0,h.jsx)(a.default,{...W,type:G==="switch"?"checkbox":G,ref:ee,isValid:A,isInvalid:M,disabled:x,as:X});return(0,h.jsx)(c.default.Provider,{value:H,children:(0,h.jsx)("div",{style:D,className:(0,r.default)($,se&&b,P&&`${b}-inline`,k&&`${b}-reverse`,G==="switch"&&S),children:B||(0,h.jsxs)(h.Fragment,{children:[J,se&&(0,h.jsx)(l.default,{title:F,children:ue}),_&&(0,h.jsx)(o.default,{type:R,tooltip:Q,children:_})]})})})});O.displayName="FormCheck",e.default=Object.assign(O,{Input:a.default,Label:l.default}),n.exports=e.default}(nm,nm.exports)),nm.exports}var am={exports:{}},X0,$R;function lv(){if($R)return X0;$R=1;var n=function(){};return X0=n,X0}var MR;function rH(){return MR||(MR=1,function(n,e){"use client";var t=gn();e.__esModule=!0,e.default=void 0;var r=t(zn()),i=d(ut()),s=i;t(lv());var o=t(eN()),a=t(Ul()),l=Tr(),c=fn();function u(m){if(typeof WeakMap!="function")return null;var g=new WeakMap,O=new WeakMap;return(u=function(y){return y?O:g})(m)}function d(m,g){if(m&&m.__esModule)return m;if(m===null||typeof m!="object"&&typeof m!="function")return{default:m};var O=u(g);if(O&&O.has(m))return O.get(m);var y={__proto__:null},b=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var S in m)if(S!=="default"&&Object.prototype.hasOwnProperty.call(m,S)){var P=b?Object.getOwnPropertyDescriptor(m,S):null;P&&(P.get||P.set)?Object.defineProperty(y,S,P):y[S]=m[S]}return y.default=m,O&&O.set(m,y),y}const h=s.forwardRef(({bsPrefix:m,type:g,size:O,htmlSize:y,id:b,className:S,isValid:P=!1,isInvalid:k=!1,plaintext:x,readOnly:A,as:M="input",...Q},_)=>{const{controlId:R}=(0,i.useContext)(a.default);return m=(0,l.useBootstrapPrefix)(m,"form-control"),(0,c.jsx)(M,{...Q,type:g,size:y,ref:_,readOnly:A,id:b||R,className:(0,r.default)(S,x?`${m}-plaintext`:m,O&&`${m}-${O}`,g==="color"&&`${m}-color`,P&&"is-valid",k&&"is-invalid")})});h.displayName="FormControl",e.default=Object.assign(h,{Feedback:o.default}),n.exports=e.default}(am,am.exports)),am.exports}var lm={exports:{}},QR;function iH(){return QR||(QR=1,function(n,e){"use client";var t=gn();e.__esModule=!0,e.default=void 0;var r=l(ut()),i=t(zn()),s=Tr(),o=fn();function a(u){if(typeof WeakMap!="function")return null;var d=new WeakMap,h=new WeakMap;return(a=function(m){return m?h:d})(u)}function l(u,d){if(u&&u.__esModule)return u;if(u===null||typeof u!="object"&&typeof u!="function")return{default:u};var h=a(d);if(h&&h.has(u))return h.get(u);var m={__proto__:null},g=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var O in u)if(O!=="default"&&Object.prototype.hasOwnProperty.call(u,O)){var y=g?Object.getOwnPropertyDescriptor(u,O):null;y&&(y.get||y.set)?Object.defineProperty(m,O,y):m[O]=u[O]}return m.default=u,h&&h.set(u,m),m}const c=r.forwardRef(({className:u,bsPrefix:d,as:h="div",...m},g)=>(d=(0,s.useBootstrapPrefix)(d,"form-floating"),(0,o.jsx)(h,{ref:g,className:(0,i.default)(u,d),...m})));c.displayName="FormFloating",e.default=c,n.exports=e.default}(lm,lm.exports)),lm.exports}var cm={exports:{}},DR;function nN(){return DR||(DR=1,function(n,e){var t=gn();e.__esModule=!0,e.default=void 0;var r=l(ut()),i=r,s=t(Ul()),o=fn();function a(u){if(typeof WeakMap!="function")return null;var d=new WeakMap,h=new WeakMap;return(a=function(m){return m?h:d})(u)}function l(u,d){if(u&&u.__esModule)return u;if(u===null||typeof u!="object"&&typeof u!="function")return{default:u};var h=a(d);if(h&&h.has(u))return h.get(u);var m={__proto__:null},g=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var O in u)if(O!=="default"&&Object.prototype.hasOwnProperty.call(u,O)){var y=g?Object.getOwnPropertyDescriptor(u,O):null;y&&(y.get||y.set)?Object.defineProperty(m,O,y):m[O]=u[O]}return m.default=u,h&&h.set(u,m),m}const c=i.forwardRef(({controlId:u,as:d="div",...h},m)=>{const g=(0,r.useMemo)(()=>({controlId:u}),[u]);return(0,o.jsx)(s.default.Provider,{value:g,children:(0,o.jsx)(d,{...h,ref:m})})});c.displayName="FormGroup",e.default=c,n.exports=e.default}(cm,cm.exports)),cm.exports}var um={exports:{}},lu={},IR;function sH(){if(IR)return lu;IR=1;var n=gn();lu.__esModule=!0,lu.default=void 0,lu.useCol=a;var e=n(zn()),t=o(ut()),r=Tr(),i=fn();function s(c){if(typeof WeakMap!="function")return null;var u=new WeakMap,d=new WeakMap;return(s=function(h){return h?d:u})(c)}function o(c,u){if(c&&c.__esModule)return c;if(c===null||typeof c!="object"&&typeof c!="function")return{default:c};var d=s(u);if(d&&d.has(c))return d.get(c);var h={__proto__:null},m=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in c)if(g!=="default"&&Object.prototype.hasOwnProperty.call(c,g)){var O=m?Object.getOwnPropertyDescriptor(c,g):null;O&&(O.get||O.set)?Object.defineProperty(h,g,O):h[g]=c[g]}return h.default=c,d&&d.set(c,h),h}function a({as:c,bsPrefix:u,className:d,...h}){u=(0,r.useBootstrapPrefix)(u,"col");const m=(0,r.useBootstrapBreakpoints)(),g=(0,r.useBootstrapMinBreakpoint)(),O=[],y=[];return m.forEach(b=>{const S=h[b];delete h[b];let P,k,x;typeof S=="object"&&S!=null?{span:P,offset:k,order:x}=S:P=S;const A=b!==g?`-${b}`:"";P&&O.push(P===!0?`${u}${A}`:`${u}${A}-${P}`),x!=null&&y.push(`order${A}-${x}`),k!=null&&y.push(`offset${A}-${k}`)}),[{...h,className:(0,e.default)(d,...O,...y)},{as:c,bsPrefix:u,spans:O}]}const l=t.forwardRef((c,u)=>{const[{className:d,...h},{as:m="div",bsPrefix:g,spans:O}]=a(c);return(0,i.jsx)(m,{...h,ref:u,className:(0,e.default)(d,!O.length&&g)})});return l.displayName="Col",lu.default=l,lu}var jR;function oH(){return jR||(jR=1,function(n,e){"use client";var t=gn();e.__esModule=!0,e.default=void 0;var r=t(zn()),i=d(ut()),s=i;t(lv());var o=t(sH()),a=t(Ul()),l=Tr(),c=fn();function u(m){if(typeof WeakMap!="function")return null;var g=new WeakMap,O=new WeakMap;return(u=function(y){return y?O:g})(m)}function d(m,g){if(m&&m.__esModule)return m;if(m===null||typeof m!="object"&&typeof m!="function")return{default:m};var O=u(g);if(O&&O.has(m))return O.get(m);var y={__proto__:null},b=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var S in m)if(S!=="default"&&Object.prototype.hasOwnProperty.call(m,S)){var P=b?Object.getOwnPropertyDescriptor(m,S):null;P&&(P.get||P.set)?Object.defineProperty(y,S,P):y[S]=m[S]}return y.default=m,O&&O.set(m,y),y}const h=s.forwardRef(({as:m="label",bsPrefix:g,column:O=!1,visuallyHidden:y=!1,className:b,htmlFor:S,...P},k)=>{const{controlId:x}=(0,i.useContext)(a.default);g=(0,l.useBootstrapPrefix)(g,"form-label");let A="col-form-label";typeof O=="string"&&(A=`${A} ${A}-${O}`);const M=(0,r.default)(b,g,y&&"visually-hidden",O&&A);return S=S||x,O?(0,c.jsx)(o.default,{ref:k,as:"label",className:M,htmlFor:S,...P}):(0,c.jsx)(m,{ref:k,className:M,htmlFor:S,...P})});h.displayName="FormLabel",e.default=h,n.exports=e.default}(um,um.exports)),um.exports}var fm={exports:{}},NR;function aH(){return NR||(NR=1,function(n,e){"use client";var t=gn();e.__esModule=!0,e.default=void 0;var r=t(zn()),i=u(ut()),s=i,o=Tr(),a=t(Ul()),l=fn();function c(h){if(typeof WeakMap!="function")return null;var m=new WeakMap,g=new WeakMap;return(c=function(O){return O?g:m})(h)}function u(h,m){if(h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var g=c(m);if(g&&g.has(h))return g.get(h);var O={__proto__:null},y=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var b in h)if(b!=="default"&&Object.prototype.hasOwnProperty.call(h,b)){var S=y?Object.getOwnPropertyDescriptor(h,b):null;S&&(S.get||S.set)?Object.defineProperty(O,b,S):O[b]=h[b]}return O.default=h,g&&g.set(h,O),O}const d=s.forwardRef(({bsPrefix:h,className:m,id:g,...O},y)=>{const{controlId:b}=(0,i.useContext)(a.default);return h=(0,o.useBootstrapPrefix)(h,"form-range"),(0,l.jsx)("input",{...O,type:"range",ref:y,className:(0,r.default)(m,h),id:g||b})});d.displayName="FormRange",e.default=d,n.exports=e.default}(fm,fm.exports)),fm.exports}var dm={exports:{}},LR;function lH(){return LR||(LR=1,function(n,e){"use client";var t=gn();e.__esModule=!0,e.default=void 0;var r=t(zn()),i=u(ut()),s=i,o=Tr(),a=t(Ul()),l=fn();function c(h){if(typeof WeakMap!="function")return null;var m=new WeakMap,g=new WeakMap;return(c=function(O){return O?g:m})(h)}function u(h,m){if(h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var g=c(m);if(g&&g.has(h))return g.get(h);var O={__proto__:null},y=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var b in h)if(b!=="default"&&Object.prototype.hasOwnProperty.call(h,b)){var S=y?Object.getOwnPropertyDescriptor(h,b):null;S&&(S.get||S.set)?Object.defineProperty(O,b,S):O[b]=h[b]}return O.default=h,g&&g.set(h,O),O}const d=s.forwardRef(({bsPrefix:h,size:m,htmlSize:g,className:O,isValid:y=!1,isInvalid:b=!1,id:S,...P},k)=>{const{controlId:x}=(0,i.useContext)(a.default);return h=(0,o.useBootstrapPrefix)(h,"form-select"),(0,l.jsx)("select",{...P,size:g,ref:k,className:(0,r.default)(O,h,m&&`${h}-${m}`,y&&"is-valid",b&&"is-invalid"),id:S||x})});d.displayName="FormSelect",e.default=d,n.exports=e.default}(dm,dm.exports)),dm.exports}var hm={exports:{}},qR;function cH(){return qR||(qR=1,function(n,e){"use client";var t=gn();e.__esModule=!0,e.default=void 0;var r=t(zn()),i=l(ut()),s=Tr(),o=fn();function a(u){if(typeof WeakMap!="function")return null;var d=new WeakMap,h=new WeakMap;return(a=function(m){return m?h:d})(u)}function l(u,d){if(u&&u.__esModule)return u;if(u===null||typeof u!="object"&&typeof u!="function")return{default:u};var h=a(d);if(h&&h.has(u))return h.get(u);var m={__proto__:null},g=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var O in u)if(O!=="default"&&Object.prototype.hasOwnProperty.call(u,O)){var y=g?Object.getOwnPropertyDescriptor(u,O):null;y&&(y.get||y.set)?Object.defineProperty(m,O,y):m[O]=u[O]}return m.default=u,h&&h.set(u,m),m}const c=i.forwardRef(({bsPrefix:u,className:d,as:h="small",muted:m,...g},O)=>(u=(0,s.useBootstrapPrefix)(u,"form-text"),(0,o.jsx)(h,{...g,ref:O,className:(0,r.default)(d,u,m&&"text-muted")})));c.displayName="FormText",e.default=c,n.exports=e.default}(hm,hm.exports)),hm.exports}var pm={exports:{}},UR;function uH(){return UR||(UR=1,function(n,e){var t=gn();e.__esModule=!0,e.default=void 0;var r=a(ut()),i=t(tN()),s=fn();function o(c){if(typeof WeakMap!="function")return null;var u=new WeakMap,d=new WeakMap;return(o=function(h){return h?d:u})(c)}function a(c,u){if(c&&c.__esModule)return c;if(c===null||typeof c!="object"&&typeof c!="function")return{default:c};var d=o(u);if(d&&d.has(c))return d.get(c);var h={__proto__:null},m=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in c)if(g!=="default"&&Object.prototype.hasOwnProperty.call(c,g)){var O=m?Object.getOwnPropertyDescriptor(c,g):null;O&&(O.get||O.set)?Object.defineProperty(h,g,O):h[g]=c[g]}return h.default=c,d&&d.set(c,h),h}const l=r.forwardRef((c,u)=>(0,s.jsx)(i.default,{...c,ref:u,type:"switch"}));l.displayName="Switch",e.default=Object.assign(l,{Input:i.default.Input,Label:i.default.Label}),n.exports=e.default}(pm,pm.exports)),pm.exports}var mm={exports:{}},BR;function fH(){return BR||(BR=1,function(n,e){"use client";var t=gn();e.__esModule=!0,e.default=void 0;var r=t(zn()),i=c(ut()),s=t(nN()),o=Tr(),a=fn();function l(d){if(typeof WeakMap!="function")return null;var h=new WeakMap,m=new WeakMap;return(l=function(g){return g?m:h})(d)}function c(d,h){if(d&&d.__esModule)return d;if(d===null||typeof d!="object"&&typeof d!="function")return{default:d};var m=l(h);if(m&&m.has(d))return m.get(d);var g={__proto__:null},O=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var y in d)if(y!=="default"&&Object.prototype.hasOwnProperty.call(d,y)){var b=O?Object.getOwnPropertyDescriptor(d,y):null;b&&(b.get||b.set)?Object.defineProperty(g,y,b):g[y]=d[y]}return g.default=d,m&&m.set(d,g),g}const u=i.forwardRef(({bsPrefix:d,className:h,children:m,controlId:g,label:O,...y},b)=>(d=(0,o.useBootstrapPrefix)(d,"form-floating"),(0,a.jsxs)(s.default,{ref:b,className:(0,r.default)(h,d),controlId:g,...y,children:[m,(0,a.jsx)("label",{htmlFor:g,children:O})]})));u.displayName="FloatingLabel",e.default=u,n.exports=e.default}(mm,mm.exports)),mm.exports}var FR;function dH(){return FR||(FR=1,function(n,e){var t=gn();e.__esModule=!0,e.default=void 0;var r=t(zn()),i=t(av()),s=S(ut()),o=t(tN()),a=t(rH()),l=t(iH()),c=t(nN()),u=t(oH()),d=t(aH()),h=t(lH()),m=t(cH()),g=t(uH()),O=t(fH()),y=fn();function b(x){if(typeof WeakMap!="function")return null;var A=new WeakMap,M=new WeakMap;return(b=function(Q){return Q?M:A})(x)}function S(x,A){if(x&&x.__esModule)return x;if(x===null||typeof x!="object"&&typeof x!="function")return{default:x};var M=b(A);if(M&&M.has(x))return M.get(x);var Q={__proto__:null},_=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var R in x)if(R!=="default"&&Object.prototype.hasOwnProperty.call(x,R)){var $=_?Object.getOwnPropertyDescriptor(x,R):null;$&&($.get||$.set)?Object.defineProperty(Q,R,$):Q[R]=x[R]}return Q.default=x,M&&M.set(x,Q),Q}const P={_ref:i.default.any,validated:i.default.bool,as:i.default.elementType},k=s.forwardRef(({className:x,validated:A,as:M="form",...Q},_)=>(0,y.jsx)(M,{...Q,ref:_,className:(0,r.default)(x,A&&"was-validated")}));k.displayName="Form",k.propTypes=P,e.default=Object.assign(k,{Group:c.default,Control:a.default,Floating:l.default,Check:o.default,Switch:g.default,Label:u.default,Text:m.default,Range:d.default,Select:h.default,FloatingLabel:O.default}),n.exports=e.default}(tm,tm.exports)),tm.exports}var hH=dH();const xr=Us(hH);var gm={exports:{}},ic={},VR;function pH(){if(VR)return ic;VR=1,ic.__esModule=!0,ic.default=void 0,ic.isTrivialHref=o,ic.useButtonProps=a;var n=i(ut()),e=fn();const t=["as","disabled"];function r(c){if(typeof WeakMap!="function")return null;var u=new WeakMap,d=new WeakMap;return(r=function(h){return h?d:u})(c)}function i(c,u){if(c&&c.__esModule)return c;if(c===null||typeof c!="object"&&typeof c!="function")return{default:c};var d=r(u);if(d&&d.has(c))return d.get(c);var h={__proto__:null},m=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in c)if(g!=="default"&&{}.hasOwnProperty.call(c,g)){var O=m?Object.getOwnPropertyDescriptor(c,g):null;O&&(O.get||O.set)?Object.defineProperty(h,g,O):h[g]=c[g]}return h.default=c,d&&d.set(c,h),h}function s(c,u){if(c==null)return{};var d={};for(var h in c)if({}.hasOwnProperty.call(c,h)){if(u.indexOf(h)>=0)continue;d[h]=c[h]}return d}function o(c){return!c||c.trim()==="#"}function a({tagName:c,disabled:u,href:d,target:h,rel:m,role:g,onClick:O,tabIndex:y=0,type:b}){c||(d!=null||h!=null||m!=null?c="a":c="button");const S={tagName:c};if(c==="button")return[{type:b||"button",disabled:u},S];const P=x=>{if((u||c==="a"&&o(d))&&x.preventDefault(),u){x.stopPropagation();return}O==null||O(x)},k=x=>{x.key===" "&&(x.preventDefault(),P(x))};return c==="a"&&(d||(d="#"),u&&(d=void 0)),[{role:g??"button",disabled:void 0,tabIndex:u?void 0:y,href:d,target:c==="a"?h:void 0,"aria-disabled":u||void 0,rel:c==="a"?m:void 0,onClick:P,onKeyDown:k},S]}const l=n.forwardRef((c,u)=>{let{as:d,disabled:h}=c,m=s(c,t);const[g,{tagName:O}]=a(Object.assign({tagName:d,disabled:h},m));return(0,e.jsx)(O,Object.assign({},m,g,{ref:u}))});return l.displayName="Button",ic.default=l,ic}var ZR;function mH(){return ZR||(ZR=1,function(n,e){"use client";var t=gn();e.__esModule=!0,e.default=void 0;var r=t(zn()),i=c(ut()),s=pH(),o=Tr(),a=fn();function l(d){if(typeof WeakMap!="function")return null;var h=new WeakMap,m=new WeakMap;return(l=function(g){return g?m:h})(d)}function c(d,h){if(d&&d.__esModule)return d;if(d===null||typeof d!="object"&&typeof d!="function")return{default:d};var m=l(h);if(m&&m.has(d))return m.get(d);var g={__proto__:null},O=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var y in d)if(y!=="default"&&Object.prototype.hasOwnProperty.call(d,y)){var b=O?Object.getOwnPropertyDescriptor(d,y):null;b&&(b.get||b.set)?Object.defineProperty(g,y,b):g[y]=d[y]}return g.default=d,m&&m.set(d,g),g}const u=i.forwardRef(({as:d,bsPrefix:h,variant:m="primary",size:g,active:O=!1,disabled:y=!1,className:b,...S},P)=>{const k=(0,o.useBootstrapPrefix)(h,"btn"),[x,{tagName:A}]=(0,s.useButtonProps)({tagName:d,disabled:y,...S}),M=A;return(0,a.jsx)(M,{...x,...S,ref:P,disabled:y,className:(0,r.default)(b,k,O&&"active",m&&`${k}-${m}`,g&&`${k}-${g}`,S.href&&y&&"disabled")})});u.displayName="Button",e.default=u,n.exports=e.default}(gm,gm.exports)),gm.exports}var gH=mH();const Rc=Us(gH);var Om={exports:{}};const Lk=!!(typeof window<"u"&&window.document&&window.document.createElement),OH=Object.freeze(Object.defineProperty({__proto__:null,default:Lk},Symbol.toStringTag,{value:"Module"}));var wO=!1,kO=!1;try{var z0={get passive(){return wO=!0},get once(){return kO=wO=!0}};Lk&&(window.addEventListener("test",z0,z0),window.removeEventListener("test",z0,!0))}catch{}function rN(n,e,t,r){if(r&&typeof r!="boolean"&&!kO){var i=r.once,s=r.capture,o=t;!kO&&i&&(o=t.__once||function a(l){this.removeEventListener(e,a,s),t.call(this,l)},t.__once=o),n.addEventListener(e,o,wO?r:s)}n.addEventListener(e,t,r)}const vH=Object.freeze(Object.defineProperty({__proto__:null,default:rN,get onceSupported(){return kO},get optionsSupported(){return wO}},Symbol.toStringTag,{value:"Module"})),yH=$i(vH),cv=$i(OH);function qk(n){return n&&n.ownerDocument||document}const bH=Object.freeze(Object.defineProperty({__proto__:null,default:qk},Symbol.toStringTag,{value:"Module"})),uv=$i(bH);function iN(n,e,t,r){var i=r&&typeof r!="boolean"?r.capture:r;n.removeEventListener(e,t,i),t.__once&&n.removeEventListener(e,t.__once,i)}const SH=Object.freeze(Object.defineProperty({__proto__:null,default:iN},Symbol.toStringTag,{value:"Module"})),wH=$i(SH);var vm;function kH(n){if((!vm&&vm!==0||n)&&Lk){var e=document.createElement("div");e.style.position="absolute",e.style.top="-9999px",e.style.width="50px",e.style.height="50px",e.style.overflow="scroll",document.body.appendChild(e),vm=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return vm}const PH=Object.freeze(Object.defineProperty({__proto__:null,default:kH},Symbol.toStringTag,{value:"Module"})),xH=$i(PH);var ym={},WR;function TH(){if(WR)return ym;WR=1,ym.__esModule=!0,ym.default=e;var n=ut();function e(){return(0,n.useState)(null)}return ym}var bm={},id={},XR;function CH(){if(XR)return id;XR=1,id.__esModule=!0,id.default=void 0;var n=ut();function e(r){const i=(0,n.useRef)(r);return(0,n.useEffect)(()=>{i.current=r},[r]),i}var t=e;return id.default=t,id}var zR;function Uk(){if(zR)return bm;zR=1,bm.__esModule=!0,bm.default=r;var n=ut(),e=t(CH());function t(i){return i&&i.__esModule?i:{default:i}}function r(i){const s=(0,e.default)(i);return(0,n.useCallback)(function(...o){return s.current&&s.current(...o)},[s])}return bm}var cu={},YR;function fv(){if(YR)return cu;YR=1,cu.__esModule=!0,cu.default=void 0,cu.mergeRefs=t;var n=ut();const e=s=>!s||typeof s=="function"?s:o=>{s.current=o};function t(s,o){const a=e(s),l=e(o);return c=>{a&&a(c),l&&l(c)}}function r(s,o){return(0,n.useMemo)(()=>t(s,o),[s,o])}var i=r;return cu.default=i,cu}var Sm={},wm={},GR;function _H(){if(GR)return wm;GR=1,wm.__esModule=!0,wm.default=e;var n=ut();function e(t){const r=(0,n.useRef)(t);return r.current=t,r}return wm}var HR;function sN(){if(HR)return Sm;HR=1,Sm.__esModule=!0,Sm.default=r;var n=t(_H()),e=ut();function t(i){return i&&i.__esModule?i:{default:i}}function r(i){const s=(0,n.default)(i);(0,e.useEffect)(()=>()=>s.current(),[])}return Sm}function EH(n){var e=qk(n);return e&&e.defaultView||window}function RH(n,e){return EH(n).getComputedStyle(n,e)}var AH=/([A-Z])/g;function $H(n){return n.replace(AH,"-$1").toLowerCase()}var MH=/^ms-/;function km(n){return $H(n).replace(MH,"-ms-")}var QH=/^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i;function DH(n){return!!(n&&QH.test(n))}function oN(n,e){var t="",r="";if(typeof e=="string")return n.style.getPropertyValue(km(e))||RH(n).getPropertyValue(km(e));Object.keys(e).forEach(function(i){var s=e[i];!s&&s!==0?n.style.removeProperty(km(i)):DH(i)?r+=i+"("+s+") ":t+=km(i)+": "+s+";"}),r&&(t+="transform: "+r+";"),n.style.cssText+=";"+t}const IH=Object.freeze(Object.defineProperty({__proto__:null,default:oN},Symbol.toStringTag,{value:"Module"}));function Bk(n,e,t,r){return rN(n,e,t,r),function(){iN(n,e,t,r)}}const jH=Object.freeze(Object.defineProperty({__proto__:null,default:Bk},Symbol.toStringTag,{value:"Module"}));function NH(n,e,t,r){if(r===void 0&&(r=!0),n){var i=document.createEvent("HTMLEvents");i.initEvent(e,t,r),n.dispatchEvent(i)}}function LH(n){var e=oN(n,"transitionDuration")||"",t=e.indexOf("ms")===-1?1e3:1;return parseFloat(e)*t}function qH(n,e,t){t===void 0&&(t=5);var r=!1,i=setTimeout(function(){r||NH(n,"transitionend",!0)},e+t),s=Bk(n,"transitionend",function(){r=!0},{once:!0});return function(){clearTimeout(i),s()}}function UH(n,e,t,r){t==null&&(t=LH(n)||0);var i=qH(n,t,r),s=Bk(n,"transitionend",e);return function(){i(),s()}}const BH=Object.freeze(Object.defineProperty({__proto__:null,default:UH},Symbol.toStringTag,{value:"Module"})),aN=$i(BH);var sd={};function FH(n){n===void 0&&(n=qk());try{var e=n.activeElement;return!e||!e.nodeName?null:e}catch{return n.body}}const VH=Object.freeze(Object.defineProperty({__proto__:null,default:FH},Symbol.toStringTag,{value:"Module"})),ZH=$i(VH);function WH(n,e){if(n.contains)return n.contains(e);if(n.compareDocumentPosition)return n===e||!!(n.compareDocumentPosition(e)&16)}const XH=Object.freeze(Object.defineProperty({__proto__:null,default:WH},Symbol.toStringTag,{value:"Module"})),Fk=$i(XH),Vk=$i(jH);var Pm={},KR;function lN(){if(KR)return Pm;KR=1,Pm.__esModule=!0,Pm.default=e;var n=ut();function e(){const t=(0,n.useRef)(!0),r=(0,n.useRef)(()=>t.current);return(0,n.useEffect)(()=>(t.current=!0,()=>{t.current=!1}),[]),r.current}return Pm}var xm={},Tm={},JR;function zH(){if(JR)return Tm;JR=1,Tm.__esModule=!0,Tm.default=e;var n=ut();function e(t){const r=(0,n.useRef)(t);return r.current=t,r}return Tm}var eA;function YH(){if(eA)return xm;eA=1,xm.__esModule=!0,xm.default=r;var n=t(zH()),e=ut();function t(i){return i&&i.__esModule?i:{default:i}}function r(i){const s=(0,n.default)(i);(0,e.useEffect)(()=>()=>s.current(),[])}return xm}var Cm={},tA;function GH(){if(tA)return Cm;tA=1,Cm.__esModule=!0,Cm.default=e;var n=ut();function e(t){const r=(0,n.useRef)(null);return(0,n.useEffect)(()=>{r.current=t}),r.current}return Cm}var _m={},od={},nA;function HH(){if(nA)return od;nA=1,od.__esModule=!0,od.default=void 0;var n=ut();function e(r){const i=(0,n.useRef)(r);return(0,n.useEffect)(()=>{i.current=r},[r]),i}var t=e;return od.default=t,od}var rA;function _h(){if(rA)return _m;rA=1,_m.__esModule=!0,_m.default=r;var n=ut(),e=t(HH());function t(i){return i&&i.__esModule?i:{default:i}}function r(i){const s=(0,e.default)(i);return(0,n.useCallback)(function(...o){return s.current&&s.current(...o)},[s])}return _m}var sc={};const Zk=$i(IH);var pa={},iA;function KH(){if(iA)return pa;iA=1,pa.__esModule=!0,pa.PROPERTY_PREFIX=pa.ATTRIBUTE_PREFIX=void 0,pa.dataAttr=t,pa.dataProp=r;const n=pa.ATTRIBUTE_PREFIX="data-rr-ui-",e=pa.PROPERTY_PREFIX="rrUi";function t(i){return`${n}${i}`}function r(i){return`${e}${i}`}return pa}var Em={},sA;function JH(){if(sA)return Em;sA=1,Em.__esModule=!0,Em.default=n;function n(e=document){const t=e.defaultView;return Math.abs(t.innerWidth-e.documentElement.clientWidth)}return Em}var oA;function cN(){if(oA)return sc;oA=1,sc.__esModule=!0,sc.default=sc.OPEN_DATA_ATTRIBUTE=void 0;var n=r(Zk),e=KH(),t=r(JH());function r(o){return o&&o.__esModule?o:{default:o}}const i=sc.OPEN_DATA_ATTRIBUTE=(0,e.dataAttr)("modal-open");let s=class{constructor({ownerDocument:a,handleContainerOverflow:l=!0,isRTL:c=!1}={}){this.handleContainerOverflow=l,this.isRTL=c,this.modals=[],this.ownerDocument=a}getScrollbarWidth(){return(0,t.default)(this.ownerDocument)}getElement(){return(this.ownerDocument||document).body}setModalAttributes(a){}removeModalAttributes(a){}setContainerStyle(a){const l={overflow:"hidden"},c=this.isRTL?"paddingLeft":"paddingRight",u=this.getElement();a.style={overflow:u.style.overflow,[c]:u.style[c]},a.scrollBarWidth&&(l[c]=`${parseInt((0,n.default)(u,c)||"0",10)+a.scrollBarWidth}px`),u.setAttribute(i,""),(0,n.default)(u,l)}reset(){[...this.modals].forEach(a=>this.remove(a))}removeContainerStyle(a){const l=this.getElement();l.removeAttribute(i),Object.assign(l.style,a.style)}add(a){let l=this.modals.indexOf(a);return l!==-1||(l=this.modals.length,this.modals.push(a),this.setModalAttributes(a),l!==0)||(this.state={scrollBarWidth:this.getScrollbarWidth(),style:{}},this.handleContainerOverflow&&this.setContainerStyle(this.state)),l}remove(a){const l=this.modals.indexOf(a);l!==-1&&(this.modals.splice(l,1),!this.modals.length&&this.handleContainerOverflow&&this.removeContainerStyle(this.state),this.removeModalAttributes(a))}isTopModal(a){return!!this.modals.length&&this.modals[this.modals.length-1]===a}};return sc.default=s,sc}var uu={},fu={},aA;function uN(){if(aA)return fu;aA=1,fu.__esModule=!0,fu.WindowProvider=void 0,fu.default=i;var n=ut(),e=t(cv);function t(s){return s&&s.__esModule?s:{default:s}}const r=(0,n.createContext)(e.default?window:void 0);fu.WindowProvider=r.Provider;function i(){return(0,n.useContext)(r)}return fu}var lA;function fN(){if(lA)return uu;lA=1,uu.__esModule=!0,uu.default=o,uu.resolveContainerRef=void 0;var n=i(uv),e=i(cv),t=ut(),r=i(uN());function i(a){return a&&a.__esModule?a:{default:a}}const s=(a,l)=>e.default?a==null?(l||(0,n.default)()).body:(typeof a=="function"&&(a=a()),a&&"current"in a&&(a=a.current),a&&("nodeType"in a||a.getBoundingClientRect)?a:null):null;uu.resolveContainerRef=s;function o(a,l){const c=(0,r.default)(),[u,d]=(0,t.useState)(()=>s(a,c==null?void 0:c.document));if(!u){const h=s(a);h&&d(h)}return(0,t.useEffect)(()=>{l&&u&&l(u)},[l,u]),(0,t.useEffect)(()=>{const h=s(a);h!==u&&d(h)},[a,u]),u}return uu}var du={},hu={},cA;function dv(){if(cA)return hu;cA=1,hu.__esModule=!0,hu.default=void 0,hu.mergeRefs=t;var n=ut();const e=s=>!s||typeof s=="function"?s:o=>{s.current=o};function t(s,o){const a=e(s),l=e(o);return c=>{a&&a(c),l&&l(c)}}function r(s,o){return(0,n.useMemo)(()=>t(s,o),[s,o])}var i=r;return hu.default=i,hu}var ad={},uA;function eK(){if(uA)return ad;uA=1,ad.__esModule=!0,ad.default=void 0;var n=ut();const e=typeof Rr<"u"&&Rr.navigator&&Rr.navigator.product==="ReactNative";var r=typeof document<"u"||e?n.useLayoutEffect:n.useEffect;return ad.default=r,ad}var ld={},pu={},fA;function Dc(){if(fA)return pu;fA=1,pu.__esModule=!0,pu.getChildRef=s,pu.getReactVersion=i,pu.isEscKey=r;var n=t(ut());function e(o){if(typeof WeakMap!="function")return null;var a=new WeakMap,l=new WeakMap;return(e=function(c){return c?l:a})(o)}function t(o,a){if(o&&o.__esModule)return o;if(o===null||typeof o!="object"&&typeof o!="function")return{default:o};var l=e(a);if(l&&l.has(o))return l.get(o);var c={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var d in o)if(d!=="default"&&{}.hasOwnProperty.call(o,d)){var h=u?Object.getOwnPropertyDescriptor(o,d):null;h&&(h.get||h.set)?Object.defineProperty(c,d,h):c[d]=o[d]}return c.default=o,l&&l.set(o,c),c}function r(o){return o.code==="Escape"||o.keyCode===27}function i(){const o=n.version.split(".");return{major:+o[0],minor:+o[1],patch:+o[2]}}function s(o){if(!o||typeof o=="function")return null;const{major:a}=i();return a>=19?o.props.ref:o.ref}return pu}var dA;function tK(){if(dA)return ld;dA=1,ld.__esModule=!0,ld.default=void 0;var n=i(_h()),e=i(dv()),t=ut(),r=Dc();function i(o){return o&&o.__esModule?o:{default:o}}function s({children:o,in:a,onExited:l,mountOnEnter:c,unmountOnExit:u}){const d=(0,t.useRef)(null),h=(0,t.useRef)(a),m=(0,n.default)(l);(0,t.useEffect)(()=>{a?h.current=!0:m(d.current)},[a,m]);const g=(0,e.default)(d,(0,r.getChildRef)(o)),O=(0,t.cloneElement)(o,{ref:g});return a?O:u||!h.current&&c?null:O}return ld.default=s,ld}var cd={},Rm={},hA;function nK(){if(hA)return Rm;hA=1,Rm.__esModule=!0,Rm.default=o;var n=ut(),e=i(dv()),t=Dc();const r=["onEnter","onEntering","onEntered","onExit","onExiting","onExited","addEndListener","children"];function i(a){return a&&a.__esModule?a:{default:a}}function s(a,l){if(a==null)return{};var c={};for(var u in a)if({}.hasOwnProperty.call(a,u)){if(l.indexOf(u)>=0)continue;c[u]=a[u]}return c}function o(a){let{onEnter:l,onEntering:c,onEntered:u,onExit:d,onExiting:h,onExited:m,addEndListener:g,children:O}=a,y=s(a,r);const b=(0,n.useRef)(null),S=(0,e.default)(b,(0,t.getChildRef)(O)),P=$=>D=>{$&&b.current&&$(b.current,D)},k=(0,n.useCallback)(P(l),[l]),x=(0,n.useCallback)(P(c),[c]),A=(0,n.useCallback)(P(u),[u]),M=(0,n.useCallback)(P(d),[d]),Q=(0,n.useCallback)(P(h),[h]),_=(0,n.useCallback)(P(m),[m]),R=(0,n.useCallback)(P(g),[g]);return Object.assign({},y,{nodeRef:b},l&&{onEnter:k},c&&{onEntering:x},u&&{onEntered:A},d&&{onExit:M},h&&{onExiting:Q},m&&{onExited:_},g&&{addEndListener:R},{children:typeof O=="function"?($,D)=>O($,Object.assign({},D,{ref:S})):(0,n.cloneElement)(O,{ref:S})})}return Rm}var pA;function rK(){if(pA)return cd;pA=1,cd.__esModule=!0,cd.default=void 0;var n=o(ut()),e=i(nK()),t=fn();const r=["component"];function i(c){return c&&c.__esModule?c:{default:c}}function s(c){if(typeof WeakMap!="function")return null;var u=new WeakMap,d=new WeakMap;return(s=function(h){return h?d:u})(c)}function o(c,u){if(c&&c.__esModule)return c;if(c===null||typeof c!="object"&&typeof c!="function")return{default:c};var d=s(u);if(d&&d.has(c))return d.get(c);var h={__proto__:null},m=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in c)if(g!=="default"&&{}.hasOwnProperty.call(c,g)){var O=m?Object.getOwnPropertyDescriptor(c,g):null;O&&(O.get||O.set)?Object.defineProperty(h,g,O):h[g]=c[g]}return h.default=c,d&&d.set(c,h),h}function a(c,u){if(c==null)return{};var d={};for(var h in c)if({}.hasOwnProperty.call(c,h)){if(u.indexOf(h)>=0)continue;d[h]=c[h]}return d}const l=n.forwardRef((c,u)=>{let{component:d}=c,h=a(c,r);const m=(0,e.default)(h);return(0,t.jsx)(d,Object.assign({ref:u},m))});return cd.default=l,cd}var mA;function dN(){if(mA)return du;mA=1,du.__esModule=!0,du.default=h,du.renderTransition=m,du.useTransition=d;var n=u(dv()),e=u(_h()),t=u(eK()),r=c(ut()),i=u(tK()),s=u(rK()),o=Dc(),a=fn();function l(g){if(typeof WeakMap!="function")return null;var O=new WeakMap,y=new WeakMap;return(l=function(b){return b?y:O})(g)}function c(g,O){if(g&&g.__esModule)return g;if(g===null||typeof g!="object"&&typeof g!="function")return{default:g};var y=l(O);if(y&&y.has(g))return y.get(g);var b={__proto__:null},S=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var P in g)if(P!=="default"&&{}.hasOwnProperty.call(g,P)){var k=S?Object.getOwnPropertyDescriptor(g,P):null;k&&(k.get||k.set)?Object.defineProperty(b,P,k):b[P]=g[P]}return b.default=g,y&&y.set(g,b),b}function u(g){return g&&g.__esModule?g:{default:g}}function d({in:g,onTransition:O}){const y=(0,r.useRef)(null),b=(0,r.useRef)(!0),S=(0,e.default)(O);return(0,t.default)(()=>{if(!y.current)return;let P=!1;return S({in:g,element:y.current,initial:b.current,isStale:()=>P}),()=>{P=!0}},[g,S]),(0,t.default)(()=>(b.current=!1,()=>{b.current=!0}),[]),y}function h({children:g,in:O,onExited:y,onEntered:b,transition:S}){const[P,k]=(0,r.useState)(!O);O&&P&&k(!1);const x=d({in:!!O,onTransition:M=>{const Q=()=>{M.isStale()||(M.in?b==null||b(M.element,M.initial):(k(!0),y==null||y(M.element)))};Promise.resolve(S(M)).then(Q,_=>{throw M.in||k(!0),_})}}),A=(0,n.default)(x,(0,o.getChildRef)(g));return P&&!O?null:(0,r.cloneElement)(g,{ref:A})}function m(g,O,y){return g?(0,a.jsx)(s.default,Object.assign({},y,{component:g})):O?(0,a.jsx)(h,Object.assign({},y,{transition:O})):(0,a.jsx)(i.default,Object.assign({},y))}return du}var gA;function iK(){if(gA)return sd;gA=1,sd.__esModule=!0,sd.default=void 0;var n=k(ZH),e=k(Fk),t=k(cv),r=k(Vk),i=P(ut()),s=i,o=k(fh()),a=k(lN()),l=k(YH()),c=k(GH()),u=k(_h()),d=k(cN()),h=k(fN()),m=k(uN()),g=dN(),O=Dc(),y=fn();const b=["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"];function S(R){if(typeof WeakMap!="function")return null;var $=new WeakMap,D=new WeakMap;return(S=function(F){return F?D:$})(R)}function P(R,$){if(R&&R.__esModule)return R;if(R===null||typeof R!="object"&&typeof R!="function")return{default:R};var D=S($);if(D&&D.has(R))return D.get(R);var F={__proto__:null},G=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var ue in R)if(ue!=="default"&&{}.hasOwnProperty.call(R,ue)){var B=G?Object.getOwnPropertyDescriptor(R,ue):null;B&&(B.get||B.set)?Object.defineProperty(F,ue,B):F[ue]=R[ue]}return F.default=R,D&&D.set(R,F),F}function k(R){return R&&R.__esModule?R:{default:R}}function x(R,$){if(R==null)return{};var D={};for(var F in R)if({}.hasOwnProperty.call(R,F)){if($.indexOf(F)>=0)continue;D[F]=R[F]}return D}let A;function M(R){return A||(A=new d.default({ownerDocument:R==null?void 0:R.document})),A}function Q(R){const $=(0,m.default)(),D=R||M($),F=(0,i.useRef)({dialog:null,backdrop:null});return Object.assign(F.current,{add:()=>D.add(F.current),remove:()=>D.remove(F.current),isTopModal:()=>D.isTopModal(F.current),setDialogRef:(0,i.useCallback)(G=>{F.current.dialog=G},[]),setBackdropRef:(0,i.useCallback)(G=>{F.current.backdrop=G},[])})}const _=(0,i.forwardRef)((R,$)=>{let{show:D=!1,role:F="dialog",className:G,style:ue,children:B,backdrop:X=!0,keyboard:W=!0,onBackdropClick:ee,onEscapeKeyDown:re,transition:H,runTransition:se,backdropTransition:J,runBackdropTransition:oe,autoFocus:pe=!0,enforceFocus:Ee=!0,restoreFocus:j=!0,restoreFocusOptions:V,renderDialog:Y,renderBackdrop:de=ht=>(0,y.jsx)("div",Object.assign({},ht)),manager:ke,container:Te,onShow:Pe,onHide:Re=()=>{},onExit:Ge,onExited:gt,onExiting:tn,onEnter:Ln,onEntering:an,onEntered:ln}=R,Qn=x(R,b);const Dn=(0,m.default)(),I=(0,h.default)(Te),ge=Q(ke),je=(0,a.default)(),ze=(0,c.default)(D),[Ze,Ke]=(0,i.useState)(!D),_t=(0,i.useRef)(null);(0,i.useImperativeHandle)($,()=>ge,[ge]),t.default&&!ze&&D&&(_t.current=(0,n.default)(Dn==null?void 0:Dn.document)),D&&Ze&&Ke(!1);const kt=(0,u.default)(()=>{if(ge.add(),dt.current=(0,r.default)(document,"keydown",Xe),at.current=(0,r.default)(document,"focus",()=>setTimeout(tt),!0),Pe&&Pe(),pe){var ht,It;const cn=(0,n.default)((ht=(It=ge.dialog)==null?void 0:It.ownerDocument)!=null?ht:Dn==null?void 0:Dn.document);ge.dialog&&cn&&!(0,e.default)(ge.dialog,cn)&&(_t.current=cn,ge.dialog.focus())}}),$e=(0,u.default)(()=>{if(ge.remove(),dt.current==null||dt.current(),at.current==null||at.current(),j){var ht;(ht=_t.current)==null||ht.focus==null||ht.focus(V),_t.current=null}});(0,i.useEffect)(()=>{!D||!I||kt()},[D,I,kt]),(0,i.useEffect)(()=>{Ze&&$e()},[Ze,$e]),(0,l.default)(()=>{$e()});const tt=(0,u.default)(()=>{if(!Ee||!je()||!ge.isTopModal())return;const ht=(0,n.default)(Dn==null?void 0:Dn.document);ge.dialog&&ht&&!(0,e.default)(ge.dialog,ht)&&ge.dialog.focus()}),We=(0,u.default)(ht=>{ht.target===ht.currentTarget&&(ee==null||ee(ht),X===!0&&Re())}),Xe=(0,u.default)(ht=>{W&&(0,O.isEscKey)(ht)&&ge.isTopModal()&&(re==null||re(ht),ht.defaultPrevented||Re())}),at=(0,i.useRef)(),dt=(0,i.useRef)(),Dt=(...ht)=>{Ke(!0),gt==null||gt(...ht)};if(!I)return null;const Le=Object.assign({role:F,ref:ge.setDialogRef,"aria-modal":F==="dialog"?!0:void 0},Qn,{style:ue,className:G,tabIndex:-1});let ct=Y?Y(Le):(0,y.jsx)("div",Object.assign({},Le,{children:s.cloneElement(B,{role:"document"})}));ct=(0,g.renderTransition)(H,se,{unmountOnExit:!0,mountOnEnter:!0,appear:!0,in:!!D,onExit:Ge,onExiting:tn,onExited:Dt,onEnter:Ln,onEntering:an,onEntered:ln,children:ct});let Ft=null;return X&&(Ft=de({ref:ge.setBackdropRef,onClick:We}),Ft=(0,g.renderTransition)(J,oe,{in:!!D,appear:!0,mountOnEnter:!0,unmountOnExit:!0,children:Ft})),(0,y.jsx)(y.Fragment,{children:o.default.createPortal((0,y.jsxs)(y.Fragment,{children:[Ft,ct]}),I)})});return _.displayName="Modal",sd.default=Object.assign(_,{Manager:d.default}),sd}var mu={};function hN(n,e){return n.classList?!!e&&n.classList.contains(e):(" "+(n.className.baseVal||n.className)+" ").indexOf(" "+e+" ")!==-1}const sK=Object.freeze(Object.defineProperty({__proto__:null,default:hN},Symbol.toStringTag,{value:"Module"}));function oK(n,e){n.classList?n.classList.add(e):hN(n,e)||(typeof n.className=="string"?n.className=n.className+" "+e:n.setAttribute("class",(n.className&&n.className.baseVal||"")+" "+e))}const aK=Object.freeze(Object.defineProperty({__proto__:null,default:oK},Symbol.toStringTag,{value:"Module"})),lK=$i(aK);var cK=Function.prototype.bind.call(Function.prototype.call,[].slice);function uK(n,e){return cK(n.querySelectorAll(e))}const fK=Object.freeze(Object.defineProperty({__proto__:null,default:uK},Symbol.toStringTag,{value:"Module"})),dK=$i(fK);function OA(n,e){return n.replace(new RegExp("(^|\\s)"+e+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function hK(n,e){n.classList?n.classList.remove(e):typeof n.className=="string"?n.className=OA(n.className,e):n.setAttribute("class",OA(n.className&&n.className.baseVal||"",e))}const pK=Object.freeze(Object.defineProperty({__proto__:null,default:hK},Symbol.toStringTag,{value:"Module"})),mK=$i(pK);var vA;function gK(){if(vA)return mu;vA=1;var n=gn();mu.__esModule=!0,mu.default=void 0,mu.getSharedManager=c;var e=n(lK),t=n(Zk),r=n(dK),i=n(mK),s=n(cN());const o={FIXED_CONTENT:".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",STICKY_CONTENT:".sticky-top",NAVBAR_TOGGLER:".navbar-toggler"};let a=class extends s.default{adjustAndStore(d,h,m){const g=h.style[d];h.dataset[d]=g,(0,t.default)(h,{[d]:`${parseFloat((0,t.default)(h,d))+m}px`})}restore(d,h){const m=h.dataset[d];m!==void 0&&(delete h.dataset[d],(0,t.default)(h,{[d]:m}))}setContainerStyle(d){super.setContainerStyle(d);const h=this.getElement();if((0,e.default)(h,"modal-open"),!d.scrollBarWidth)return;const m=this.isRTL?"paddingLeft":"paddingRight",g=this.isRTL?"marginLeft":"marginRight";(0,r.default)(h,o.FIXED_CONTENT).forEach(O=>this.adjustAndStore(m,O,d.scrollBarWidth)),(0,r.default)(h,o.STICKY_CONTENT).forEach(O=>this.adjustAndStore(g,O,-d.scrollBarWidth)),(0,r.default)(h,o.NAVBAR_TOGGLER).forEach(O=>this.adjustAndStore(g,O,d.scrollBarWidth))}removeContainerStyle(d){super.removeContainerStyle(d);const h=this.getElement();(0,i.default)(h,"modal-open");const m=this.isRTL?"paddingLeft":"paddingRight",g=this.isRTL?"marginLeft":"marginRight";(0,r.default)(h,o.FIXED_CONTENT).forEach(O=>this.restore(m,O)),(0,r.default)(h,o.STICKY_CONTENT).forEach(O=>this.restore(g,O)),(0,r.default)(h,o.NAVBAR_TOGGLER).forEach(O=>this.restore(g,O))}},l;function c(u){return l||(l=new a(u)),l}return mu.default=a,mu}var Am={exports:{}};function Wk(n,e){if(n==null)return{};var t={};for(var r in n)if({}.hasOwnProperty.call(n,r)){if(e.indexOf(r)!==-1)continue;t[r]=n[r]}return t}function sw(n,e){return sw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t},sw(n,e)}function pN(n,e){n.prototype=Object.create(e.prototype),n.prototype.constructor=n,sw(n,e)}const yA={disabled:!1},mN=Lo.createContext(null);var OK=function(e){return e.scrollTop},_u="unmounted",ll="exited",cl="entering",pc="entered",PO="exiting",Ra=function(n){pN(e,n);function e(r,i){var s;s=n.call(this,r,i)||this;var o=i,a=o&&!o.isMounting?r.enter:r.appear,l;return s.appearStatus=null,r.in?a?(l=ll,s.appearStatus=cl):l=pc:r.unmountOnExit||r.mountOnEnter?l=_u:l=ll,s.state={status:l},s.nextCallback=null,s}e.getDerivedStateFromProps=function(i,s){var o=i.in;return o&&s.status===_u?{status:ll}:null};var t=e.prototype;return t.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},t.componentDidUpdate=function(i){var s=null;if(i!==this.props){var o=this.state.status;this.props.in?o!==cl&&o!==pc&&(s=cl):(o===cl||o===pc)&&(s=PO)}this.updateStatus(!1,s)},t.componentWillUnmount=function(){this.cancelNextCallback()},t.getTimeouts=function(){var i=this.props.timeout,s,o,a;return s=o=a=i,i!=null&&typeof i!="number"&&(s=i.exit,o=i.enter,a=i.appear!==void 0?i.appear:o),{exit:s,enter:o,appear:a}},t.updateStatus=function(i,s){if(i===void 0&&(i=!1),s!==null)if(this.cancelNextCallback(),s===cl){if(this.props.unmountOnExit||this.props.mountOnEnter){var o=this.props.nodeRef?this.props.nodeRef.current:em.findDOMNode(this);o&&OK(o)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status===ll&&this.setState({status:_u})},t.performEnter=function(i){var s=this,o=this.props.enter,a=this.context?this.context.isMounting:i,l=this.props.nodeRef?[a]:[em.findDOMNode(this),a],c=l[0],u=l[1],d=this.getTimeouts(),h=a?d.appear:d.enter;if(!i&&!o||yA.disabled){this.safeSetState({status:pc},function(){s.props.onEntered(c)});return}this.props.onEnter(c,u),this.safeSetState({status:cl},function(){s.props.onEntering(c,u),s.onTransitionEnd(h,function(){s.safeSetState({status:pc},function(){s.props.onEntered(c,u)})})})},t.performExit=function(){var i=this,s=this.props.exit,o=this.getTimeouts(),a=this.props.nodeRef?void 0:em.findDOMNode(this);if(!s||yA.disabled){this.safeSetState({status:ll},function(){i.props.onExited(a)});return}this.props.onExit(a),this.safeSetState({status:PO},function(){i.props.onExiting(a),i.onTransitionEnd(o.exit,function(){i.safeSetState({status:ll},function(){i.props.onExited(a)})})})},t.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},t.safeSetState=function(i,s){s=this.setNextCallback(s),this.setState(i,s)},t.setNextCallback=function(i){var s=this,o=!0;return this.nextCallback=function(a){o&&(o=!1,s.nextCallback=null,i(a))},this.nextCallback.cancel=function(){o=!1},this.nextCallback},t.onTransitionEnd=function(i,s){this.setNextCallback(s);var o=this.props.nodeRef?this.props.nodeRef.current:em.findDOMNode(this),a=i==null&&!this.props.addEndListener;if(!o||a){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[o,this.nextCallback],c=l[0],u=l[1];this.props.addEndListener(c,u)}i!=null&&setTimeout(this.nextCallback,i)},t.render=function(){var i=this.state.status;if(i===_u)return null;var s=this.props,o=s.children;s.in,s.mountOnEnter,s.unmountOnExit,s.appear,s.enter,s.exit,s.timeout,s.addEndListener,s.onEnter,s.onEntering,s.onEntered,s.onExit,s.onExiting,s.onExited,s.nodeRef;var a=Wk(s,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return Lo.createElement(mN.Provider,{value:null},typeof o=="function"?o(i,a):Lo.cloneElement(Lo.Children.only(o),a))},e}(Lo.Component);Ra.contextType=mN;Ra.propTypes={};function gu(){}Ra.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:gu,onEntering:gu,onEntered:gu,onExit:gu,onExiting:gu,onExited:gu};Ra.UNMOUNTED=_u;Ra.EXITED=ll;Ra.ENTERING=cl;Ra.ENTERED=pc;Ra.EXITING=PO;const vK=Object.freeze(Object.defineProperty({__proto__:null,ENTERED:pc,ENTERING:cl,EXITED:ll,EXITING:PO,UNMOUNTED:_u,default:Ra},Symbol.toStringTag,{value:"Module"})),gN=$i(vK);var $m={exports:{}},bA;function yK(){return bA||(bA=1,function(n,e){var t=gn();e.__esModule=!0,e.default=o;var r=t(Zk),i=t(aN);function s(a,l){const c=(0,r.default)(a,l)||"",u=c.indexOf("ms")===-1?1e3:1;return parseFloat(c)*u}function o(a,l){const c=s(a,"transitionDuration"),u=s(a,"transitionDelay"),d=(0,i.default)(a,h=>{h.target===a&&(d(),l(h))},c+u)}n.exports=e.default}($m,$m.exports)),$m.exports}var Mm={exports:{}},SA;function bK(){return SA||(SA=1,function(n,e){e.__esModule=!0,e.default=t;function t(r){r.offsetHeight}n.exports=e.default}(Mm,Mm.exports)),Mm.exports}var Qm={exports:{}},Dm={exports:{}},wA;function Xk(){return wA||(wA=1,function(n,e){var t=gn();e.__esModule=!0,e.default=i;var r=t(fh());function i(s){return s&&"setState"in s?r.default.findDOMNode(s):s??null}n.exports=e.default}(Dm,Dm.exports)),Dm.exports}var kA;function SK(){return kA||(kA=1,function(n,e){"use client";var t=gn();e.__esModule=!0,e.default=void 0;var r=c(ut()),i=t(gN),s=t(fv()),o=t(Xk()),a=fn();function l(d){if(typeof WeakMap!="function")return null;var h=new WeakMap,m=new WeakMap;return(l=function(g){return g?m:h})(d)}function c(d,h){if(d&&d.__esModule)return d;if(d===null||typeof d!="object"&&typeof d!="function")return{default:d};var m=l(h);if(m&&m.has(d))return m.get(d);var g={__proto__:null},O=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var y in d)if(y!=="default"&&Object.prototype.hasOwnProperty.call(d,y)){var b=O?Object.getOwnPropertyDescriptor(d,y):null;b&&(b.get||b.set)?Object.defineProperty(g,y,b):g[y]=d[y]}return g.default=d,m&&m.set(d,g),g}const u=r.default.forwardRef(({onEnter:d,onEntering:h,onEntered:m,onExit:g,onExiting:O,onExited:y,addEndListener:b,children:S,childRef:P,...k},x)=>{const A=(0,r.useRef)(null),M=(0,s.default)(A,P),Q=X=>{M((0,o.default)(X))},_=X=>W=>{X&&A.current&&X(A.current,W)},R=(0,r.useCallback)(_(d),[d]),$=(0,r.useCallback)(_(h),[h]),D=(0,r.useCallback)(_(m),[m]),F=(0,r.useCallback)(_(g),[g]),G=(0,r.useCallback)(_(O),[O]),ue=(0,r.useCallback)(_(y),[y]),B=(0,r.useCallback)(_(b),[b]);return(0,a.jsx)(i.default,{ref:x,...k,onEnter:R,onEntered:D,onEntering:$,onExit:F,onExited:ue,onExiting:G,addEndListener:B,nodeRef:A,children:typeof S=="function"?(X,W)=>S(X,{...W,ref:Q}):r.default.cloneElement(S,{ref:Q})})});e.default=u,n.exports=e.default}(Qm,Qm.exports)),Qm.exports}var PA;function ON(){return PA||(PA=1,function(n,e){var t=gn();e.__esModule=!0,e.default=void 0;var r=t(zn()),i=m(ut()),s=i,o=gN,a=Dc(),l=t(yK()),c=t(bK()),u=t(SK()),d=fn();function h(y){if(typeof WeakMap!="function")return null;var b=new WeakMap,S=new WeakMap;return(h=function(P){return P?S:b})(y)}function m(y,b){if(y&&y.__esModule)return y;if(y===null||typeof y!="object"&&typeof y!="function")return{default:y};var S=h(b);if(S&&S.has(y))return S.get(y);var P={__proto__:null},k=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var x in y)if(x!=="default"&&Object.prototype.hasOwnProperty.call(y,x)){var A=k?Object.getOwnPropertyDescriptor(y,x):null;A&&(A.get||A.set)?Object.defineProperty(P,x,A):P[x]=y[x]}return P.default=y,S&&S.set(y,P),P}const g={[o.ENTERING]:"show",[o.ENTERED]:"show"},O=s.forwardRef(({className:y,children:b,transitionClasses:S={},onEnter:P,...k},x)=>{const A={in:!1,timeout:300,mountOnEnter:!1,unmountOnExit:!1,appear:!1,...k},M=(0,i.useCallback)((Q,_)=>{(0,c.default)(Q),P==null||P(Q,_)},[P]);return(0,d.jsx)(u.default,{ref:x,addEndListener:l.default,...A,onEnter:M,childRef:(0,a.getChildRef)(b),children:(Q,_)=>s.cloneElement(b,{..._,className:(0,r.default)("fade",y,b.props.className,g[Q],S[Q])})})});O.displayName="Fade",e.default=O,n.exports=e.default}(Am,Am.exports)),Am.exports}var Im={exports:{}},xA;function wK(){return xA||(xA=1,function(n,e){"use client";var t=gn();e.__esModule=!0,e.default=void 0;var r=l(ut()),i=t(zn()),s=Tr(),o=fn();function a(u){if(typeof WeakMap!="function")return null;var d=new WeakMap,h=new WeakMap;return(a=function(m){return m?h:d})(u)}function l(u,d){if(u&&u.__esModule)return u;if(u===null||typeof u!="object"&&typeof u!="function")return{default:u};var h=a(d);if(h&&h.has(u))return h.get(u);var m={__proto__:null},g=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var O in u)if(O!=="default"&&Object.prototype.hasOwnProperty.call(u,O)){var y=g?Object.getOwnPropertyDescriptor(u,O):null;y&&(y.get||y.set)?Object.defineProperty(m,O,y):m[O]=u[O]}return m.default=u,h&&h.set(u,m),m}const c=r.forwardRef(({className:u,bsPrefix:d,as:h="div",...m},g)=>(d=(0,s.useBootstrapPrefix)(d,"modal-body"),(0,o.jsx)(h,{ref:g,className:(0,i.default)(u,d),...m})));c.displayName="ModalBody",e.default=c,n.exports=e.default}(Im,Im.exports)),Im.exports}var jm={exports:{}},TA;function vN(){return TA||(TA=1,function(n,e){"use client";e.__esModule=!0,e.default=void 0;var t=i(ut());function r(o){if(typeof WeakMap!="function")return null;var a=new WeakMap,l=new WeakMap;return(r=function(c){return c?l:a})(o)}function i(o,a){if(o&&o.__esModule)return o;if(o===null||typeof o!="object"&&typeof o!="function")return{default:o};var l=r(a);if(l&&l.has(o))return l.get(o);var c={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var d in o)if(d!=="default"&&Object.prototype.hasOwnProperty.call(o,d)){var h=u?Object.getOwnPropertyDescriptor(o,d):null;h&&(h.get||h.set)?Object.defineProperty(c,d,h):c[d]=o[d]}return c.default=o,l&&l.set(o,c),c}const s=t.createContext({onHide(){}});e.default=s,n.exports=e.default}(jm,jm.exports)),jm.exports}var Nm={exports:{}},CA;function kK(){return CA||(CA=1,function(n,e){"use client";var t=gn();e.__esModule=!0,e.default=void 0;var r=t(zn()),i=l(ut()),s=Tr(),o=fn();function a(u){if(typeof WeakMap!="function")return null;var d=new WeakMap,h=new WeakMap;return(a=function(m){return m?h:d})(u)}function l(u,d){if(u&&u.__esModule)return u;if(u===null||typeof u!="object"&&typeof u!="function")return{default:u};var h=a(d);if(h&&h.has(u))return h.get(u);var m={__proto__:null},g=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var O in u)if(O!=="default"&&Object.prototype.hasOwnProperty.call(u,O)){var y=g?Object.getOwnPropertyDescriptor(u,O):null;y&&(y.get||y.set)?Object.defineProperty(m,O,y):m[O]=u[O]}return m.default=u,h&&h.set(u,m),m}const c=i.forwardRef(({bsPrefix:u,className:d,contentClassName:h,centered:m,size:g,fullscreen:O,children:y,scrollable:b,...S},P)=>{u=(0,s.useBootstrapPrefix)(u,"modal");const k=`${u}-dialog`,x=typeof O=="string"?`${u}-fullscreen-${O}`:`${u}-fullscreen`;return(0,o.jsx)("div",{...S,ref:P,className:(0,r.default)(k,d,g&&`${u}-${g}`,m&&`${k}-centered`,b&&`${k}-scrollable`,O&&x),children:(0,o.jsx)("div",{className:(0,r.default)(`${u}-content`,h),children:y})})});c.displayName="ModalDialog",e.default=c,n.exports=e.default}(Nm,Nm.exports)),Nm.exports}var Lm={exports:{}},_A;function PK(){return _A||(_A=1,function(n,e){"use client";var t=gn();e.__esModule=!0,e.default=void 0;var r=l(ut()),i=t(zn()),s=Tr(),o=fn();function a(u){if(typeof WeakMap!="function")return null;var d=new WeakMap,h=new WeakMap;return(a=function(m){return m?h:d})(u)}function l(u,d){if(u&&u.__esModule)return u;if(u===null||typeof u!="object"&&typeof u!="function")return{default:u};var h=a(d);if(h&&h.has(u))return h.get(u);var m={__proto__:null},g=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var O in u)if(O!=="default"&&Object.prototype.hasOwnProperty.call(u,O)){var y=g?Object.getOwnPropertyDescriptor(u,O):null;y&&(y.get||y.set)?Object.defineProperty(m,O,y):m[O]=u[O]}return m.default=u,h&&h.set(u,m),m}const c=r.forwardRef(({className:u,bsPrefix:d,as:h="div",...m},g)=>(d=(0,s.useBootstrapPrefix)(d,"modal-footer"),(0,o.jsx)(h,{ref:g,className:(0,i.default)(u,d),...m})));c.displayName="ModalFooter",e.default=c,n.exports=e.default}(Lm,Lm.exports)),Lm.exports}var qm={exports:{}},Um={exports:{}},Bm={exports:{}},EA;function xK(){return EA||(EA=1,function(n,e){var t=gn();e.__esModule=!0,e.default=void 0;var r=t(av()),i=l(ut()),s=t(zn()),o=fn();function a(d){if(typeof WeakMap!="function")return null;var h=new WeakMap,m=new WeakMap;return(a=function(g){return g?m:h})(d)}function l(d,h){if(d&&d.__esModule)return d;if(d===null||typeof d!="object"&&typeof d!="function")return{default:d};var m=a(h);if(m&&m.has(d))return m.get(d);var g={__proto__:null},O=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var y in d)if(y!=="default"&&Object.prototype.hasOwnProperty.call(d,y)){var b=O?Object.getOwnPropertyDescriptor(d,y):null;b&&(b.get||b.set)?Object.defineProperty(g,y,b):g[y]=d[y]}return g.default=d,m&&m.set(d,g),g}const c={"aria-label":r.default.string,onClick:r.default.func,variant:r.default.oneOf(["white"])},u=i.forwardRef(({className:d,variant:h,"aria-label":m="Close",...g},O)=>(0,o.jsx)("button",{ref:O,type:"button",className:(0,s.default)("btn-close",h&&`btn-close-${h}`,d),"aria-label":m,...g}));u.displayName="CloseButton",u.propTypes=c,e.default=u,n.exports=e.default}(Bm,Bm.exports)),Bm.exports}var RA;function TK(){return RA||(RA=1,function(n,e){"use client";var t=gn();e.__esModule=!0,e.default=void 0;var r=u(ut()),i=r,s=t(Uk()),o=t(xK()),a=t(vN()),l=fn();function c(h){if(typeof WeakMap!="function")return null;var m=new WeakMap,g=new WeakMap;return(c=function(O){return O?g:m})(h)}function u(h,m){if(h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var g=c(m);if(g&&g.has(h))return g.get(h);var O={__proto__:null},y=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var b in h)if(b!=="default"&&Object.prototype.hasOwnProperty.call(h,b)){var S=y?Object.getOwnPropertyDescriptor(h,b):null;S&&(S.get||S.set)?Object.defineProperty(O,b,S):O[b]=h[b]}return O.default=h,g&&g.set(h,O),O}const d=i.forwardRef(({closeLabel:h="Close",closeVariant:m,closeButton:g=!1,onHide:O,children:y,...b},S)=>{const P=(0,r.useContext)(a.default),k=(0,s.default)(()=>{P==null||P.onHide(),O==null||O()});return(0,l.jsxs)("div",{ref:S,...b,children:[y,g&&(0,l.jsx)(o.default,{"aria-label":h,variant:m,onClick:k})]})});e.default=d,n.exports=e.default}(Um,Um.exports)),Um.exports}var AA;function CK(){return AA||(AA=1,function(n,e){"use client";var t=gn();e.__esModule=!0,e.default=void 0;var r=t(zn()),i=c(ut()),s=Tr(),o=t(TK()),a=fn();function l(d){if(typeof WeakMap!="function")return null;var h=new WeakMap,m=new WeakMap;return(l=function(g){return g?m:h})(d)}function c(d,h){if(d&&d.__esModule)return d;if(d===null||typeof d!="object"&&typeof d!="function")return{default:d};var m=l(h);if(m&&m.has(d))return m.get(d);var g={__proto__:null},O=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var y in d)if(y!=="default"&&Object.prototype.hasOwnProperty.call(d,y)){var b=O?Object.getOwnPropertyDescriptor(d,y):null;b&&(b.get||b.set)?Object.defineProperty(g,y,b):g[y]=d[y]}return g.default=d,m&&m.set(d,g),g}const u=i.forwardRef(({bsPrefix:d,className:h,closeLabel:m="Close",closeButton:g=!1,...O},y)=>(d=(0,s.useBootstrapPrefix)(d,"modal-header"),(0,a.jsx)(o.default,{ref:y,...O,className:(0,r.default)(h,d),closeLabel:m,closeButton:g})));u.displayName="ModalHeader",e.default=u,n.exports=e.default}(qm,qm.exports)),qm.exports}var Fm={exports:{}},Vm={exports:{}},$A;function _K(){return $A||($A=1,function(n,e){var t=gn();e.__esModule=!0,e.default=void 0;var r=a(ut()),i=t(zn()),s=fn();function o(c){if(typeof WeakMap!="function")return null;var u=new WeakMap,d=new WeakMap;return(o=function(h){return h?d:u})(c)}function a(c,u){if(c&&c.__esModule)return c;if(c===null||typeof c!="object"&&typeof c!="function")return{default:c};var d=o(u);if(d&&d.has(c))return d.get(c);var h={__proto__:null},m=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in c)if(g!=="default"&&Object.prototype.hasOwnProperty.call(c,g)){var O=m?Object.getOwnPropertyDescriptor(c,g):null;O&&(O.get||O.set)?Object.defineProperty(h,g,O):h[g]=c[g]}return h.default=c,d&&d.set(c,h),h}var l=c=>r.forwardRef((u,d)=>(0,s.jsx)("div",{...u,ref:d,className:(0,i.default)(u.className,c)}));e.default=l,n.exports=e.default}(Vm,Vm.exports)),Vm.exports}var MA;function EK(){return MA||(MA=1,function(n,e){"use client";var t=gn();e.__esModule=!0,e.default=void 0;var r=c(ut()),i=t(zn()),s=t(_K()),o=Tr(),a=fn();function l(h){if(typeof WeakMap!="function")return null;var m=new WeakMap,g=new WeakMap;return(l=function(O){return O?g:m})(h)}function c(h,m){if(h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var g=l(m);if(g&&g.has(h))return g.get(h);var O={__proto__:null},y=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var b in h)if(b!=="default"&&Object.prototype.hasOwnProperty.call(h,b)){var S=y?Object.getOwnPropertyDescriptor(h,b):null;S&&(S.get||S.set)?Object.defineProperty(O,b,S):O[b]=h[b]}return O.default=h,g&&g.set(h,O),O}const u=(0,s.default)("h4"),d=r.forwardRef(({className:h,bsPrefix:m,as:g=u,...O},y)=>(m=(0,o.useBootstrapPrefix)(m,"modal-title"),(0,a.jsx)(g,{ref:y,className:(0,i.default)(h,m),...O})));d.displayName="ModalTitle",e.default=d,n.exports=e.default}(Fm,Fm.exports)),Fm.exports}var QA;function RK(){return QA||(QA=1,function(n,e){"use client";var t=gn();e.__esModule=!0,e.default=void 0;var r=t(zn()),i=t(yH),s=t(cv),o=t(uv),a=t(wH),l=t(xH),c=t(TH()),u=t(Uk()),d=t(fv()),h=t(sN()),m=t(aN),g=D(ut()),O=g,y=t(iK()),b=gK(),S=t(ON()),P=t(wK()),k=t(vN()),x=t(kK()),A=t(PK()),M=t(CK()),Q=t(EK()),_=Tr(),R=fn();function $(B){if(typeof WeakMap!="function")return null;var X=new WeakMap,W=new WeakMap;return($=function(ee){return ee?W:X})(B)}function D(B,X){if(B&&B.__esModule)return B;if(B===null||typeof B!="object"&&typeof B!="function")return{default:B};var W=$(X);if(W&&W.has(B))return W.get(B);var ee={__proto__:null},re=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var H in B)if(H!=="default"&&Object.prototype.hasOwnProperty.call(B,H)){var se=re?Object.getOwnPropertyDescriptor(B,H):null;se&&(se.get||se.set)?Object.defineProperty(ee,H,se):ee[H]=B[H]}return ee.default=B,W&&W.set(B,ee),ee}function F(B){return(0,R.jsx)(S.default,{...B,timeout:null})}function G(B){return(0,R.jsx)(S.default,{...B,timeout:null})}const ue=O.forwardRef(({bsPrefix:B,className:X,style:W,dialogClassName:ee,contentClassName:re,children:H,dialogAs:se=x.default,"data-bs-theme":J,"aria-labelledby":oe,"aria-describedby":pe,"aria-label":Ee,show:j=!1,animation:V=!0,backdrop:Y=!0,keyboard:de=!0,onEscapeKeyDown:ke,onShow:Te,onHide:Pe,container:Re,autoFocus:Ge=!0,enforceFocus:gt=!0,restoreFocus:tn=!0,restoreFocusOptions:Ln,onEntered:an,onExit:ln,onExiting:Qn,onEnter:Dn,onEntering:I,onExited:ge,backdropClassName:je,manager:ze,...Ze},Ke)=>{const[_t,kt]=(0,g.useState)({}),[$e,tt]=(0,g.useState)(!1),We=(0,g.useRef)(!1),Xe=(0,g.useRef)(!1),at=(0,g.useRef)(null),[dt,Dt]=(0,c.default)(),Le=(0,d.default)(Ke,Dt),ct=(0,u.default)(Pe),Ft=(0,_.useIsRTL)();B=(0,_.useBootstrapPrefix)(B,"modal");const ht=(0,g.useMemo)(()=>({onHide:ct}),[ct]);function It(){return ze||(0,b.getSharedManager)({isRTL:Ft})}function cn(Fe){if(!s.default)return;const Vt=It().getScrollbarWidth()>0,Zt=Fe.scrollHeight>(0,o.default)(Fe).documentElement.clientHeight;kt({paddingRight:Vt&&!Zt?(0,l.default)():void 0,paddingLeft:!Vt&&Zt?(0,l.default)():void 0})}const Pn=(0,u.default)(()=>{dt&&cn(dt.dialog)});(0,h.default)(()=>{(0,a.default)(window,"resize",Pn),at.current==null||at.current()});const On=()=>{We.current=!0},wn=Fe=>{We.current&&dt&&Fe.target===dt.dialog&&(Xe.current=!0),We.current=!1},tr=()=>{tt(!0),at.current=(0,m.default)(dt.dialog,()=>{tt(!1)})},Bn=Fe=>{Fe.target===Fe.currentTarget&&tr()},Qr=Fe=>{if(Y==="static"){Bn(Fe);return}if(Xe.current||Fe.target!==Fe.currentTarget){Xe.current=!1;return}Pe==null||Pe()},nr=Fe=>{de?ke==null||ke(Fe):(Fe.preventDefault(),Y==="static"&&tr())},Sr=(Fe,Vt)=>{Fe&&cn(Fe),Dn==null||Dn(Fe,Vt)},ar=Fe=>{at.current==null||at.current(),ln==null||ln(Fe)},sn=(Fe,Vt)=>{I==null||I(Fe,Vt),(0,i.default)(window,"resize",Pn)},pt=Fe=>{Fe&&(Fe.style.display=""),ge==null||ge(Fe),(0,a.default)(window,"resize",Pn)},bt=(0,g.useCallback)(Fe=>(0,R.jsx)("div",{...Fe,className:(0,r.default)(`${B}-backdrop`,je,!V&&"show")}),[V,je,B]),Pt={...W,..._t};Pt.display="block";const it=Fe=>(0,R.jsx)("div",{role:"dialog",...Fe,style:Pt,className:(0,r.default)(X,B,$e&&`${B}-static`,!V&&"show"),onClick:Y?Qr:void 0,onMouseUp:wn,"data-bs-theme":J,"aria-label":Ee,"aria-labelledby":oe,"aria-describedby":pe,children:(0,R.jsx)(se,{...Ze,onMouseDown:On,className:ee,contentClassName:re,children:H})});return(0,R.jsx)(k.default.Provider,{value:ht,children:(0,R.jsx)(y.default,{show:j,ref:Le,backdrop:Y,container:Re,keyboard:!0,autoFocus:Ge,enforceFocus:gt,restoreFocus:tn,restoreFocusOptions:Ln,onEscapeKeyDown:nr,onShow:Te,onHide:Pe,onEnter:Sr,onEntering:sn,onEntered:an,onExit:ar,onExiting:Qn,onExited:pt,manager:It(),transition:V?F:void 0,backdropTransition:V?G:void 0,renderBackdrop:bt,renderDialog:it})})});ue.displayName="Modal",e.default=Object.assign(ue,{Body:P.default,Header:M.default,Title:Q.default,Footer:A.default,Dialog:x.default,TRANSITION_DURATION:300,BACKDROP_TRANSITION_DURATION:150}),n.exports=e.default}(Om,Om.exports)),Om.exports}var AK=RK();const dr=Us(AK);var Zm={exports:{}},Wm={},Xm={},DA;function $K(){if(DA)return Xm;DA=1,Xm.__esModule=!0,Xm.default=e;var n=ut();function e(){const t=(0,n.useRef)(!0),r=(0,n.useRef)(()=>t.current);return(0,n.useEffect)(()=>(t.current=!0,()=>{t.current=!1}),[]),r.current}return Xm}var IA;function MK(){if(IA)return Wm;IA=1,Wm.__esModule=!0,Wm.default=o;var n=ut(),e=r($K()),t=r(sN());function r(a){return a&&a.__esModule?a:{default:a}}const i=2**31-1;function s(a,l,c){const u=c-Date.now();a.current=u<=i?setTimeout(l,u):setTimeout(()=>s(a,l,c),i)}function o(){const a=(0,e.default)(),l=(0,n.useRef)();return(0,t.default)(()=>clearTimeout(l.current)),(0,n.useMemo)(()=>{const c=()=>clearTimeout(l.current);function u(d,h=0){a()&&(c(),h<=i?l.current=setTimeout(d,h):s(l,d,Date.now()+h))}return{set:u,clear:c,handleRef:l}},[])}return Wm}var Y0,jA;function QK(){if(jA)return Y0;jA=1;var n=function(e,t,r,i,s,o,a,l){if(!e){var c;if(t===void 0)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[r,i,s,o,a,l],d=0;c=new Error(t.replace(/%s/g,function(){return u[d++]})),c.name="Invariant Violation"}throw c.framesToPop=1,c}};return Y0=n,Y0}var DK=QK();const IK=Us(DK);var jK=function(){};function NK(n,e){var t={};return Object.keys(n).forEach(function(r){t[Uu(r)]=jK}),t}function NA(n,e){return n[e]!==void 0}function Uu(n){return"default"+n.charAt(0).toUpperCase()+n.substr(1)}function LK(n){return!!n&&(typeof n!="function"||n.prototype&&n.prototype.isReactComponent)}function qK(n){var e=UK(n,"string");return typeof e=="symbol"?e:String(e)}function UK(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(n)}function yN(n,e,t){var r=L.useRef(n!==void 0),i=L.useState(e),s=i[0],o=i[1],a=n!==void 0,l=r.current;return r.current=a,!a&&l&&s!==e&&o(e),[a?n:s,L.useCallback(function(c){for(var u=arguments.length,d=new Array(u>1?u-1:0),h=1;h<u;h++)d[h-1]=arguments[h];t&&t.apply(void 0,[c].concat(d)),o(c)},[t])]}function BK(n,e){return Object.keys(e).reduce(function(t,r){var i,s=t,o=s[Uu(r)],a=s[r],l=Wk(s,[Uu(r),r].map(qK)),c=e[r],u=yN(a,o,n[c]),d=u[0],h=u[1];return Fr({},l,(i={},i[r]=d,i[c]=h,i))},n)}function bN(){var n=this.constructor.getDerivedStateFromProps(this.props,this.state);n!=null&&this.setState(n)}function SN(n){function e(t){var r=this.constructor.getDerivedStateFromProps(n,t);return r??null}this.setState(e.bind(this))}function wN(n,e){try{var t=this.props,r=this.state;this.props=n,this.state=e,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(t,r)}finally{this.props=t,this.state=r}}bN.__suppressDeprecationWarning=!0;SN.__suppressDeprecationWarning=!0;wN.__suppressDeprecationWarning=!0;function FK(n){var e=n.prototype;if(!e||!e.isReactComponent)throw new Error("Can only polyfill class components");if(typeof n.getDerivedStateFromProps!="function"&&typeof e.getSnapshotBeforeUpdate!="function")return n;var t=null,r=null,i=null;if(typeof e.componentWillMount=="function"?t="componentWillMount":typeof e.UNSAFE_componentWillMount=="function"&&(t="UNSAFE_componentWillMount"),typeof e.componentWillReceiveProps=="function"?r="componentWillReceiveProps":typeof e.UNSAFE_componentWillReceiveProps=="function"&&(r="UNSAFE_componentWillReceiveProps"),typeof e.componentWillUpdate=="function"?i="componentWillUpdate":typeof e.UNSAFE_componentWillUpdate=="function"&&(i="UNSAFE_componentWillUpdate"),t!==null||r!==null||i!==null){var s=n.displayName||n.name,o=typeof n.getDerivedStateFromProps=="function"?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error(`Unsafe legacy lifecycles will not be called for components using new component APIs.
|
|
144
|
+
|
|
145
|
+
`+s+" uses "+o+" but also contains the following legacy lifecycles:"+(t!==null?`
|
|
146
|
+
`+t:"")+(r!==null?`
|
|
147
|
+
`+r:"")+(i!==null?`
|
|
148
|
+
`+i:"")+`
|
|
149
|
+
|
|
150
|
+
The above lifecycles should be removed. Learn more about this warning here:
|
|
151
|
+
https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof n.getDerivedStateFromProps=="function"&&(e.componentWillMount=bN,e.componentWillReceiveProps=SN),typeof e.getSnapshotBeforeUpdate=="function"){if(typeof e.componentDidUpdate!="function")throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");e.componentWillUpdate=wN;var a=e.componentDidUpdate;e.componentDidUpdate=function(c,u,d){var h=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:d;a.call(this,c,u,h)}}return n}var VK="/Users/jquense/src/uncontrollable/src/uncontrollable.js";function kN(n,e,t){t===void 0&&(t=[]);var r=n.displayName||n.name||"Component",i=LK(n),s=Object.keys(e),o=s.map(Uu);i||!t.length||IK(!1);var a=function(c){pN(u,c);function u(){for(var h,m=arguments.length,g=new Array(m),O=0;O<m;O++)g[O]=arguments[O];h=c.call.apply(c,[this].concat(g))||this,h.handlers=Object.create(null),s.forEach(function(b){var S=e[b],P=function(x){if(h.props[S]){var A;h._notifying=!0;for(var M=arguments.length,Q=new Array(M>1?M-1:0),_=1;_<M;_++)Q[_-1]=arguments[_];(A=h.props)[S].apply(A,[x].concat(Q)),h._notifying=!1}h.unmounted||h.setState(function(R){var $,D=R.values;return{values:Fr(Object.create(null),D,($={},$[b]=x,$))}})};h.handlers[S]=P}),t.length&&(h.attachRef=function(b){h.inner=b});var y=Object.create(null);return s.forEach(function(b){y[b]=h.props[Uu(b)]}),h.state={values:y,prevProps:{}},h}var d=u.prototype;return d.shouldComponentUpdate=function(){return!this._notifying},u.getDerivedStateFromProps=function(m,g){var O=g.values,y=g.prevProps,b={values:Fr(Object.create(null),O),prevProps:{}};return s.forEach(function(S){b.prevProps[S]=m[S],!NA(m,S)&&NA(y,S)&&(b.values[S]=m[Uu(S)])}),b},d.componentWillUnmount=function(){this.unmounted=!0},d.render=function(){var m=this,g=this.props,O=g.innerRef,y=Wk(g,["innerRef"]);o.forEach(function(S){delete y[S]});var b={};return s.forEach(function(S){var P=m.props[S];b[S]=P!==void 0?P:m.state.values[S]}),Lo.createElement(n,Fr({},y,b,this.handlers,{ref:O||this.attachRef}))},u}(Lo.Component);FK(a),a.displayName="Uncontrolled("+r+")",a.propTypes=Fr({innerRef:function(){}},NK(e)),t.forEach(function(c){a.prototype[c]=function(){var d;return(d=this.inner)[c].apply(d,arguments)}});var l=a;return Lo.forwardRef&&(l=Lo.forwardRef(function(c,u){return Lo.createElement(a,Fr({},c,{innerRef:u,__source:{fileName:VK,lineNumber:128},__self:this}))}),l.propTypes=a.propTypes),l.ControlledComponent=n,l.deferControlTo=function(c,u,d){return u===void 0&&(u={}),kN(c,Fr({},e,u),d)},l}const ZK=Object.freeze(Object.defineProperty({__proto__:null,uncontrollable:kN,useUncontrolled:BK,useUncontrolledProp:yN},Symbol.toStringTag,{value:"Module"})),WK=$i(ZK);var zm={exports:{}},ud={},Ym={},LA;function XK(){if(LA)return Ym;LA=1,Ym.__esModule=!0,Ym.default=e;var n=ut();function e(){return(0,n.useState)(null)}return Ym}var fd={},G0={},qA;function zK(){if(qA)return G0;qA=1;var n=Object.prototype.hasOwnProperty;function e(r,i,s){for(s of r.keys())if(t(s,i))return s}function t(r,i){var s,o,a;if(r===i)return!0;if(r&&i&&(s=r.constructor)===i.constructor){if(s===Date)return r.getTime()===i.getTime();if(s===RegExp)return r.toString()===i.toString();if(s===Array){if((o=r.length)===i.length)for(;o--&&t(r[o],i[o]););return o===-1}if(s===Set){if(r.size!==i.size)return!1;for(o of r)if(a=o,a&&typeof a=="object"&&(a=e(i,a),!a)||!i.has(a))return!1;return!0}if(s===Map){if(r.size!==i.size)return!1;for(o of r)if(a=o[0],a&&typeof a=="object"&&(a=e(i,a),!a)||!t(o[1],i.get(a)))return!1;return!0}if(s===ArrayBuffer)r=new Uint8Array(r),i=new Uint8Array(i);else if(s===DataView){if((o=r.byteLength)===i.byteLength)for(;o--&&r.getInt8(o)===i.getInt8(o););return o===-1}if(ArrayBuffer.isView(r)){if((o=r.byteLength)===i.byteLength)for(;o--&&r[o]===i[o];);return o===-1}if(!s||typeof r=="object"){o=0;for(s in r)if(n.call(r,s)&&++o&&!n.call(i,s)||!(s in i)||!t(r[s],i[s]))return!1;return Object.keys(i).length===o}}return r!==r&&i!==i}return G0.dequal=t,G0}var dd={},UA;function YK(){if(UA)return dd;UA=1,dd.__esModule=!0,dd.default=void 0;var n=ut(),e=t(lN());function t(s){return s&&s.__esModule?s:{default:s}}function r(s){const o=(0,e.default)();return[s[0],(0,n.useCallback)(a=>{if(o())return s[1](a)},[o,s[1]])]}var i=r;return dd.default=i,dd}var Gm={},BA;function GK(){if(BA)return Gm;BA=1;var n="top",e="bottom",t="right",r="left",i="auto",s=[n,e,t,r],o="start",a="end",l="clippingParents",c="viewport",u="popper",d="reference",h=s.reduce(function(K,te){return K.concat([te+"-"+o,te+"-"+a])},[]),m=[].concat(s,[i]).reduce(function(K,te){return K.concat([te,te+"-"+o,te+"-"+a])},[]),g="beforeRead",O="read",y="afterRead",b="beforeMain",S="main",P="afterMain",k="beforeWrite",x="write",A="afterWrite",M=[g,O,y,b,S,P,k,x,A];function Q(K){return K.split("-")[0]}function _(K){if(K==null)return window;if(K.toString()!=="[object Window]"){var te=K.ownerDocument;return te&&te.defaultView||window}return K}function R(K){var te=_(K).Element;return K instanceof te||K instanceof Element}function $(K){var te=_(K).HTMLElement;return K instanceof te||K instanceof HTMLElement}function D(K){if(typeof ShadowRoot>"u")return!1;var te=_(K).ShadowRoot;return K instanceof te||K instanceof ShadowRoot}var F=Math.max,G=Math.min,ue=Math.round;function B(){var K=navigator.userAgentData;return K!=null&&K.brands&&Array.isArray(K.brands)?K.brands.map(function(te){return te.brand+"/"+te.version}).join(" "):navigator.userAgent}function X(){return!/^((?!chrome|android).)*safari/i.test(B())}function W(K,te,ce){te===void 0&&(te=!1),ce===void 0&&(ce=!1);var Ae=K.getBoundingClientRect(),he=1,Qe=1;te&&$(K)&&(he=K.offsetWidth>0&&ue(Ae.width)/K.offsetWidth||1,Qe=K.offsetHeight>0&&ue(Ae.height)/K.offsetHeight||1);var rt=R(K)?_(K):window,De=rt.visualViewport,Ye=!X()&&ce,$t=(Ae.left+(Ye&&De?De.offsetLeft:0))/he,ot=(Ae.top+(Ye&&De?De.offsetTop:0))/Qe,on=Ae.width/he,yn=Ae.height/Qe;return{width:on,height:yn,top:ot,right:$t+on,bottom:ot+yn,left:$t,x:$t,y:ot}}function ee(K){var te=W(K),ce=K.offsetWidth,Ae=K.offsetHeight;return Math.abs(te.width-ce)<=1&&(ce=te.width),Math.abs(te.height-Ae)<=1&&(Ae=te.height),{x:K.offsetLeft,y:K.offsetTop,width:ce,height:Ae}}function re(K,te){var ce=te.getRootNode&&te.getRootNode();if(K.contains(te))return!0;if(ce&&D(ce)){var Ae=te;do{if(Ae&&K.isSameNode(Ae))return!0;Ae=Ae.parentNode||Ae.host}while(Ae)}return!1}function H(K){return K?(K.nodeName||"").toLowerCase():null}function se(K){return _(K).getComputedStyle(K)}function J(K){return["table","td","th"].indexOf(H(K))>=0}function oe(K){return((R(K)?K.ownerDocument:K.document)||window.document).documentElement}function pe(K){return H(K)==="html"?K:K.assignedSlot||K.parentNode||(D(K)?K.host:null)||oe(K)}function Ee(K){return!$(K)||se(K).position==="fixed"?null:K.offsetParent}function j(K){var te=/firefox/i.test(B()),ce=/Trident/i.test(B());if(ce&&$(K)){var Ae=se(K);if(Ae.position==="fixed")return null}var he=pe(K);for(D(he)&&(he=he.host);$(he)&&["html","body"].indexOf(H(he))<0;){var Qe=se(he);if(Qe.transform!=="none"||Qe.perspective!=="none"||Qe.contain==="paint"||["transform","perspective"].indexOf(Qe.willChange)!==-1||te&&Qe.willChange==="filter"||te&&Qe.filter&&Qe.filter!=="none")return he;he=he.parentNode}return null}function V(K){for(var te=_(K),ce=Ee(K);ce&&J(ce)&&se(ce).position==="static";)ce=Ee(ce);return ce&&(H(ce)==="html"||H(ce)==="body"&&se(ce).position==="static")?te:ce||j(K)||te}function Y(K){return["top","bottom"].indexOf(K)>=0?"x":"y"}function de(K,te,ce){return F(K,G(te,ce))}function ke(K,te,ce){var Ae=de(K,te,ce);return Ae>ce?ce:Ae}function Te(){return{top:0,right:0,bottom:0,left:0}}function Pe(K){return Object.assign({},Te(),K)}function Re(K,te){return te.reduce(function(ce,Ae){return ce[Ae]=K,ce},{})}var Ge=function(te,ce){return te=typeof te=="function"?te(Object.assign({},ce.rects,{placement:ce.placement})):te,Pe(typeof te!="number"?te:Re(te,s))};function gt(K){var te,ce=K.state,Ae=K.name,he=K.options,Qe=ce.elements.arrow,rt=ce.modifiersData.popperOffsets,De=Q(ce.placement),Ye=Y(De),$t=[r,t].indexOf(De)>=0,ot=$t?"height":"width";if(!(!Qe||!rt)){var on=Ge(he.padding,ce),yn=ee(Qe),Mt=Ye==="y"?n:r,Jt=Ye==="y"?e:t,nn=ce.rects.reference[ot]+ce.rects.reference[Ye]-rt[Ye]-ce.rects.popper[ot],Ht=rt[Ye]-ce.rects.reference[Ye],rn=V(Qe),Gn=rn?Ye==="y"?rn.clientHeight||0:rn.clientWidth||0:0,Vn=nn/2-Ht/2,Kt=on[Mt],Rn=Gn-yn[ot]-on[Jt],bn=Gn/2-yn[ot]/2+Vn,jt=de(Kt,bn,Rn),Cr=Ye;ce.modifiersData[Ae]=(te={},te[Cr]=jt,te.centerOffset=jt-bn,te)}}function tn(K){var te=K.state,ce=K.options,Ae=ce.element,he=Ae===void 0?"[data-popper-arrow]":Ae;he!=null&&(typeof he=="string"&&(he=te.elements.popper.querySelector(he),!he)||re(te.elements.popper,he)&&(te.elements.arrow=he))}var Ln={name:"arrow",enabled:!0,phase:"main",fn:gt,effect:tn,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function an(K){return K.split("-")[1]}var ln={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Qn(K,te){var ce=K.x,Ae=K.y,he=te.devicePixelRatio||1;return{x:ue(ce*he)/he||0,y:ue(Ae*he)/he||0}}function Dn(K){var te,ce=K.popper,Ae=K.popperRect,he=K.placement,Qe=K.variation,rt=K.offsets,De=K.position,Ye=K.gpuAcceleration,$t=K.adaptive,ot=K.roundOffsets,on=K.isFixed,yn=rt.x,Mt=yn===void 0?0:yn,Jt=rt.y,nn=Jt===void 0?0:Jt,Ht=typeof ot=="function"?ot({x:Mt,y:nn}):{x:Mt,y:nn};Mt=Ht.x,nn=Ht.y;var rn=rt.hasOwnProperty("x"),Gn=rt.hasOwnProperty("y"),Vn=r,Kt=n,Rn=window;if($t){var bn=V(ce),jt="clientHeight",Cr="clientWidth";if(bn===_(ce)&&(bn=oe(ce),se(bn).position!=="static"&&De==="absolute"&&(jt="scrollHeight",Cr="scrollWidth")),bn=bn,he===n||(he===r||he===t)&&Qe===a){Kt=e;var mr=on&&bn===Rn&&Rn.visualViewport?Rn.visualViewport.height:bn[jt];nn-=mr-Ae.height,nn*=Ye?1:-1}if(he===r||(he===n||he===e)&&Qe===a){Vn=t;var Hn=on&&bn===Rn&&Rn.visualViewport?Rn.visualViewport.width:bn[Cr];Mt-=Hn-Ae.width,Mt*=Ye?1:-1}}var _r=Object.assign({position:De},$t&&ln),bi=ot===!0?Qn({x:Mt,y:nn},_(ce)):{x:Mt,y:nn};if(Mt=bi.x,nn=bi.y,Ye){var Dr;return Object.assign({},_r,(Dr={},Dr[Kt]=Gn?"0":"",Dr[Vn]=rn?"0":"",Dr.transform=(Rn.devicePixelRatio||1)<=1?"translate("+Mt+"px, "+nn+"px)":"translate3d("+Mt+"px, "+nn+"px, 0)",Dr))}return Object.assign({},_r,(te={},te[Kt]=Gn?nn+"px":"",te[Vn]=rn?Mt+"px":"",te.transform="",te))}function I(K){var te=K.state,ce=K.options,Ae=ce.gpuAcceleration,he=Ae===void 0?!0:Ae,Qe=ce.adaptive,rt=Qe===void 0?!0:Qe,De=ce.roundOffsets,Ye=De===void 0?!0:De,$t={placement:Q(te.placement),variation:an(te.placement),popper:te.elements.popper,popperRect:te.rects.popper,gpuAcceleration:he,isFixed:te.options.strategy==="fixed"};te.modifiersData.popperOffsets!=null&&(te.styles.popper=Object.assign({},te.styles.popper,Dn(Object.assign({},$t,{offsets:te.modifiersData.popperOffsets,position:te.options.strategy,adaptive:rt,roundOffsets:Ye})))),te.modifiersData.arrow!=null&&(te.styles.arrow=Object.assign({},te.styles.arrow,Dn(Object.assign({},$t,{offsets:te.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:Ye})))),te.attributes.popper=Object.assign({},te.attributes.popper,{"data-popper-placement":te.placement})}var ge={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:I,data:{}},je={passive:!0};function ze(K){var te=K.state,ce=K.instance,Ae=K.options,he=Ae.scroll,Qe=he===void 0?!0:he,rt=Ae.resize,De=rt===void 0?!0:rt,Ye=_(te.elements.popper),$t=[].concat(te.scrollParents.reference,te.scrollParents.popper);return Qe&&$t.forEach(function(ot){ot.addEventListener("scroll",ce.update,je)}),De&&Ye.addEventListener("resize",ce.update,je),function(){Qe&&$t.forEach(function(ot){ot.removeEventListener("scroll",ce.update,je)}),De&&Ye.removeEventListener("resize",ce.update,je)}}var Ze={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:ze,data:{}},Ke={left:"right",right:"left",bottom:"top",top:"bottom"};function _t(K){return K.replace(/left|right|bottom|top/g,function(te){return Ke[te]})}var kt={start:"end",end:"start"};function $e(K){return K.replace(/start|end/g,function(te){return kt[te]})}function tt(K){var te=_(K),ce=te.pageXOffset,Ae=te.pageYOffset;return{scrollLeft:ce,scrollTop:Ae}}function We(K){return W(oe(K)).left+tt(K).scrollLeft}function Xe(K,te){var ce=_(K),Ae=oe(K),he=ce.visualViewport,Qe=Ae.clientWidth,rt=Ae.clientHeight,De=0,Ye=0;if(he){Qe=he.width,rt=he.height;var $t=X();($t||!$t&&te==="fixed")&&(De=he.offsetLeft,Ye=he.offsetTop)}return{width:Qe,height:rt,x:De+We(K),y:Ye}}function at(K){var te,ce=oe(K),Ae=tt(K),he=(te=K.ownerDocument)==null?void 0:te.body,Qe=F(ce.scrollWidth,ce.clientWidth,he?he.scrollWidth:0,he?he.clientWidth:0),rt=F(ce.scrollHeight,ce.clientHeight,he?he.scrollHeight:0,he?he.clientHeight:0),De=-Ae.scrollLeft+We(K),Ye=-Ae.scrollTop;return se(he||ce).direction==="rtl"&&(De+=F(ce.clientWidth,he?he.clientWidth:0)-Qe),{width:Qe,height:rt,x:De,y:Ye}}function dt(K){var te=se(K),ce=te.overflow,Ae=te.overflowX,he=te.overflowY;return/auto|scroll|overlay|hidden/.test(ce+he+Ae)}function Dt(K){return["html","body","#document"].indexOf(H(K))>=0?K.ownerDocument.body:$(K)&&dt(K)?K:Dt(pe(K))}function Le(K,te){var ce;te===void 0&&(te=[]);var Ae=Dt(K),he=Ae===((ce=K.ownerDocument)==null?void 0:ce.body),Qe=_(Ae),rt=he?[Qe].concat(Qe.visualViewport||[],dt(Ae)?Ae:[]):Ae,De=te.concat(rt);return he?De:De.concat(Le(pe(rt)))}function ct(K){return Object.assign({},K,{left:K.x,top:K.y,right:K.x+K.width,bottom:K.y+K.height})}function Ft(K,te){var ce=W(K,!1,te==="fixed");return ce.top=ce.top+K.clientTop,ce.left=ce.left+K.clientLeft,ce.bottom=ce.top+K.clientHeight,ce.right=ce.left+K.clientWidth,ce.width=K.clientWidth,ce.height=K.clientHeight,ce.x=ce.left,ce.y=ce.top,ce}function ht(K,te,ce){return te===c?ct(Xe(K,ce)):R(te)?Ft(te,ce):ct(at(oe(K)))}function It(K){var te=Le(pe(K)),ce=["absolute","fixed"].indexOf(se(K).position)>=0,Ae=ce&&$(K)?V(K):K;return R(Ae)?te.filter(function(he){return R(he)&&re(he,Ae)&&H(he)!=="body"}):[]}function cn(K,te,ce,Ae){var he=te==="clippingParents"?It(K):[].concat(te),Qe=[].concat(he,[ce]),rt=Qe[0],De=Qe.reduce(function(Ye,$t){var ot=ht(K,$t,Ae);return Ye.top=F(ot.top,Ye.top),Ye.right=G(ot.right,Ye.right),Ye.bottom=G(ot.bottom,Ye.bottom),Ye.left=F(ot.left,Ye.left),Ye},ht(K,rt,Ae));return De.width=De.right-De.left,De.height=De.bottom-De.top,De.x=De.left,De.y=De.top,De}function Pn(K){var te=K.reference,ce=K.element,Ae=K.placement,he=Ae?Q(Ae):null,Qe=Ae?an(Ae):null,rt=te.x+te.width/2-ce.width/2,De=te.y+te.height/2-ce.height/2,Ye;switch(he){case n:Ye={x:rt,y:te.y-ce.height};break;case e:Ye={x:rt,y:te.y+te.height};break;case t:Ye={x:te.x+te.width,y:De};break;case r:Ye={x:te.x-ce.width,y:De};break;default:Ye={x:te.x,y:te.y}}var $t=he?Y(he):null;if($t!=null){var ot=$t==="y"?"height":"width";switch(Qe){case o:Ye[$t]=Ye[$t]-(te[ot]/2-ce[ot]/2);break;case a:Ye[$t]=Ye[$t]+(te[ot]/2-ce[ot]/2);break}}return Ye}function On(K,te){te===void 0&&(te={});var ce=te,Ae=ce.placement,he=Ae===void 0?K.placement:Ae,Qe=ce.strategy,rt=Qe===void 0?K.strategy:Qe,De=ce.boundary,Ye=De===void 0?l:De,$t=ce.rootBoundary,ot=$t===void 0?c:$t,on=ce.elementContext,yn=on===void 0?u:on,Mt=ce.altBoundary,Jt=Mt===void 0?!1:Mt,nn=ce.padding,Ht=nn===void 0?0:nn,rn=Pe(typeof Ht!="number"?Ht:Re(Ht,s)),Gn=yn===u?d:u,Vn=K.rects.popper,Kt=K.elements[Jt?Gn:yn],Rn=cn(R(Kt)?Kt:Kt.contextElement||oe(K.elements.popper),Ye,ot,rt),bn=W(K.elements.reference),jt=Pn({reference:bn,element:Vn,placement:he}),Cr=ct(Object.assign({},Vn,jt)),mr=yn===u?Cr:bn,Hn={top:Rn.top-mr.top+rn.top,bottom:mr.bottom-Rn.bottom+rn.bottom,left:Rn.left-mr.left+rn.left,right:mr.right-Rn.right+rn.right},_r=K.modifiersData.offset;if(yn===u&&_r){var bi=_r[he];Object.keys(Hn).forEach(function(Dr){var Si=[t,e].indexOf(Dr)>=0?1:-1,fi=[n,e].indexOf(Dr)>=0?"y":"x";Hn[Dr]+=bi[fi]*Si})}return Hn}function wn(K,te){te===void 0&&(te={});var ce=te,Ae=ce.placement,he=ce.boundary,Qe=ce.rootBoundary,rt=ce.padding,De=ce.flipVariations,Ye=ce.allowedAutoPlacements,$t=Ye===void 0?m:Ye,ot=an(Ae),on=ot?De?h:h.filter(function(Jt){return an(Jt)===ot}):s,yn=on.filter(function(Jt){return $t.indexOf(Jt)>=0});yn.length===0&&(yn=on);var Mt=yn.reduce(function(Jt,nn){return Jt[nn]=On(K,{placement:nn,boundary:he,rootBoundary:Qe,padding:rt})[Q(nn)],Jt},{});return Object.keys(Mt).sort(function(Jt,nn){return Mt[Jt]-Mt[nn]})}function tr(K){if(Q(K)===i)return[];var te=_t(K);return[$e(K),te,$e(te)]}function Bn(K){var te=K.state,ce=K.options,Ae=K.name;if(!te.modifiersData[Ae]._skip){for(var he=ce.mainAxis,Qe=he===void 0?!0:he,rt=ce.altAxis,De=rt===void 0?!0:rt,Ye=ce.fallbackPlacements,$t=ce.padding,ot=ce.boundary,on=ce.rootBoundary,yn=ce.altBoundary,Mt=ce.flipVariations,Jt=Mt===void 0?!0:Mt,nn=ce.allowedAutoPlacements,Ht=te.options.placement,rn=Q(Ht),Gn=rn===Ht,Vn=Ye||(Gn||!Jt?[_t(Ht)]:tr(Ht)),Kt=[Ht].concat(Vn).reduce(function(Di,Ui){return Di.concat(Q(Ui)===i?wn(te,{placement:Ui,boundary:ot,rootBoundary:on,padding:$t,flipVariations:Jt,allowedAutoPlacements:nn}):Ui)},[]),Rn=te.rects.reference,bn=te.rects.popper,jt=new Map,Cr=!0,mr=Kt[0],Hn=0;Hn<Kt.length;Hn++){var _r=Kt[Hn],bi=Q(_r),Dr=an(_r)===o,Si=[n,e].indexOf(bi)>=0,fi=Si?"width":"height",lr=On(te,{placement:_r,boundary:ot,rootBoundary:on,altBoundary:yn,padding:$t}),gr=Si?Dr?t:r:Dr?e:n;Rn[fi]>bn[fi]&&(gr=_t(gr));var Mi=_t(gr),wi=[];if(Qe&&wi.push(lr[bi]<=0),De&&wi.push(lr[gr]<=0,lr[Mi]<=0),wi.every(function(Di){return Di})){mr=_r,Cr=!1;break}jt.set(_r,wi)}if(Cr)for(var ws=Jt?3:1,Qi=function(Ui){var Vs=Kt.find(function(Bi){var ks=jt.get(Bi);if(ks)return ks.slice(0,Ui).every(function(Aa){return Aa})});if(Vs)return mr=Vs,"break"},Jo=ws;Jo>0;Jo--){var Oo=Qi(Jo);if(Oo==="break")break}te.placement!==mr&&(te.modifiersData[Ae]._skip=!0,te.placement=mr,te.reset=!0)}}var Qr={name:"flip",enabled:!0,phase:"main",fn:Bn,requiresIfExists:["offset"],data:{_skip:!1}};function nr(K,te,ce){return ce===void 0&&(ce={x:0,y:0}),{top:K.top-te.height-ce.y,right:K.right-te.width+ce.x,bottom:K.bottom-te.height+ce.y,left:K.left-te.width-ce.x}}function Sr(K){return[n,t,e,r].some(function(te){return K[te]>=0})}function ar(K){var te=K.state,ce=K.name,Ae=te.rects.reference,he=te.rects.popper,Qe=te.modifiersData.preventOverflow,rt=On(te,{elementContext:"reference"}),De=On(te,{altBoundary:!0}),Ye=nr(rt,Ae),$t=nr(De,he,Qe),ot=Sr(Ye),on=Sr($t);te.modifiersData[ce]={referenceClippingOffsets:Ye,popperEscapeOffsets:$t,isReferenceHidden:ot,hasPopperEscaped:on},te.attributes.popper=Object.assign({},te.attributes.popper,{"data-popper-reference-hidden":ot,"data-popper-escaped":on})}var sn={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:ar};function pt(K,te,ce){var Ae=Q(K),he=[r,n].indexOf(Ae)>=0?-1:1,Qe=typeof ce=="function"?ce(Object.assign({},te,{placement:K})):ce,rt=Qe[0],De=Qe[1];return rt=rt||0,De=(De||0)*he,[r,t].indexOf(Ae)>=0?{x:De,y:rt}:{x:rt,y:De}}function bt(K){var te=K.state,ce=K.options,Ae=K.name,he=ce.offset,Qe=he===void 0?[0,0]:he,rt=m.reduce(function(ot,on){return ot[on]=pt(on,te.rects,Qe),ot},{}),De=rt[te.placement],Ye=De.x,$t=De.y;te.modifiersData.popperOffsets!=null&&(te.modifiersData.popperOffsets.x+=Ye,te.modifiersData.popperOffsets.y+=$t),te.modifiersData[Ae]=rt}var Pt={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:bt};function it(K){var te=K.state,ce=K.name;te.modifiersData[ce]=Pn({reference:te.rects.reference,element:te.rects.popper,placement:te.placement})}var Fe={name:"popperOffsets",enabled:!0,phase:"read",fn:it,data:{}};function Vt(K){return K==="x"?"y":"x"}function Zt(K){var te=K.state,ce=K.options,Ae=K.name,he=ce.mainAxis,Qe=he===void 0?!0:he,rt=ce.altAxis,De=rt===void 0?!1:rt,Ye=ce.boundary,$t=ce.rootBoundary,ot=ce.altBoundary,on=ce.padding,yn=ce.tether,Mt=yn===void 0?!0:yn,Jt=ce.tetherOffset,nn=Jt===void 0?0:Jt,Ht=On(te,{boundary:Ye,rootBoundary:$t,padding:on,altBoundary:ot}),rn=Q(te.placement),Gn=an(te.placement),Vn=!Gn,Kt=Y(rn),Rn=Vt(Kt),bn=te.modifiersData.popperOffsets,jt=te.rects.reference,Cr=te.rects.popper,mr=typeof nn=="function"?nn(Object.assign({},te.rects,{placement:te.placement})):nn,Hn=typeof mr=="number"?{mainAxis:mr,altAxis:mr}:Object.assign({mainAxis:0,altAxis:0},mr),_r=te.modifiersData.offset?te.modifiersData.offset[te.placement]:null,bi={x:0,y:0};if(bn){if(Qe){var Dr,Si=Kt==="y"?n:r,fi=Kt==="y"?e:t,lr=Kt==="y"?"height":"width",gr=bn[Kt],Mi=gr+Ht[Si],wi=gr-Ht[fi],ws=Mt?-Cr[lr]/2:0,Qi=Gn===o?jt[lr]:Cr[lr],Jo=Gn===o?-Cr[lr]:-jt[lr],Oo=te.elements.arrow,Di=Mt&&Oo?ee(Oo):{width:0,height:0},Ui=te.modifiersData["arrow#persistent"]?te.modifiersData["arrow#persistent"].padding:Te(),Vs=Ui[Si],Bi=Ui[fi],ks=de(0,jt[lr],Di[lr]),Aa=Vn?jt[lr]/2-ws-ks-Vs-Hn.mainAxis:Qi-ks-Vs-Hn.mainAxis,vo=Vn?-jt[lr]/2+ws+ks+Bi+Hn.mainAxis:Jo+ks+Bi+Hn.mainAxis,Zs=te.elements.arrow&&V(te.elements.arrow),as=Zs?Kt==="y"?Zs.clientTop||0:Zs.clientLeft||0:0,ea=(Dr=_r==null?void 0:_r[Kt])!=null?Dr:0,$a=gr+Aa-ea-as,Of=gr+vo-ea,Ws=de(Mt?G(Mi,$a):Mi,gr,Mt?F(wi,Of):wi);bn[Kt]=Ws,bi[Kt]=Ws-gr}if(De){var ta,Ma=Kt==="x"?n:r,Bl=Kt==="x"?e:t,ri=bn[Rn],ls=Rn==="y"?"height":"width",yo=ri+Ht[Ma],Qa=ri-Ht[Bl],Xs=[n,r].indexOf(rn)!==-1,na=(ta=_r==null?void 0:_r[Rn])!=null?ta:0,Da=Xs?yo:ri-jt[ls]-Cr[ls]-na+Hn.altAxis,Xr=Xs?ri+jt[ls]+Cr[ls]-na-Hn.altAxis:Qa,zs=Mt&&Xs?ke(Da,ri,Xr):de(Mt?Da:yo,ri,Mt?Xr:Qa);bn[Rn]=zs,bi[Rn]=zs-ri}te.modifiersData[Ae]=bi}}var Gt={name:"preventOverflow",enabled:!0,phase:"main",fn:Zt,requiresIfExists:["offset"]};function In(K){return{scrollLeft:K.scrollLeft,scrollTop:K.scrollTop}}function Fn(K){return K===_(K)||!$(K)?tt(K):In(K)}function jn(K){var te=K.getBoundingClientRect(),ce=ue(te.width)/K.offsetWidth||1,Ae=ue(te.height)/K.offsetHeight||1;return ce!==1||Ae!==1}function Yn(K,te,ce){ce===void 0&&(ce=!1);var Ae=$(te),he=$(te)&&jn(te),Qe=oe(te),rt=W(K,he,ce),De={scrollLeft:0,scrollTop:0},Ye={x:0,y:0};return(Ae||!Ae&&!ce)&&((H(te)!=="body"||dt(Qe))&&(De=Fn(te)),$(te)?(Ye=W(te,!0),Ye.x+=te.clientLeft,Ye.y+=te.clientTop):Qe&&(Ye.x=We(Qe))),{x:rt.left+De.scrollLeft-Ye.x,y:rt.top+De.scrollTop-Ye.y,width:rt.width,height:rt.height}}function Xt(K){var te=new Map,ce=new Set,Ae=[];K.forEach(function(Qe){te.set(Qe.name,Qe)});function he(Qe){ce.add(Qe.name);var rt=[].concat(Qe.requires||[],Qe.requiresIfExists||[]);rt.forEach(function(De){if(!ce.has(De)){var Ye=te.get(De);Ye&&he(Ye)}}),Ae.push(Qe)}return K.forEach(function(Qe){ce.has(Qe.name)||he(Qe)}),Ae}function Bt(K){var te=Xt(K);return M.reduce(function(ce,Ae){return ce.concat(te.filter(function(he){return he.phase===Ae}))},[])}function St(K){var te;return function(){return te||(te=new Promise(function(ce){Promise.resolve().then(function(){te=void 0,ce(K())})})),te}}function un(K){var te=K.reduce(function(ce,Ae){var he=ce[Ae.name];return ce[Ae.name]=he?Object.assign({},he,Ae,{options:Object.assign({},he.options,Ae.options),data:Object.assign({},he.data,Ae.data)}):Ae,ce},{});return Object.keys(te).map(function(ce){return te[ce]})}var wr={placement:"bottom",modifiers:[],strategy:"absolute"};function vn(){for(var K=arguments.length,te=new Array(K),ce=0;ce<K;ce++)te[ce]=arguments[ce];return!te.some(function(Ae){return!(Ae&&typeof Ae.getBoundingClientRect=="function")})}function ui(K){K===void 0&&(K={});var te=K,ce=te.defaultModifiers,Ae=ce===void 0?[]:ce,he=te.defaultOptions,Qe=he===void 0?wr:he;return function(De,Ye,$t){$t===void 0&&($t=Qe);var ot={placement:"bottom",orderedModifiers:[],options:Object.assign({},wr,Qe),modifiersData:{},elements:{reference:De,popper:Ye},attributes:{},styles:{}},on=[],yn=!1,Mt={state:ot,setOptions:function(rn){var Gn=typeof rn=="function"?rn(ot.options):rn;nn(),ot.options=Object.assign({},Qe,ot.options,Gn),ot.scrollParents={reference:R(De)?Le(De):De.contextElement?Le(De.contextElement):[],popper:Le(Ye)};var Vn=Bt(un([].concat(Ae,ot.options.modifiers)));return ot.orderedModifiers=Vn.filter(function(Kt){return Kt.enabled}),Jt(),Mt.update()},forceUpdate:function(){if(!yn){var rn=ot.elements,Gn=rn.reference,Vn=rn.popper;if(vn(Gn,Vn)){ot.rects={reference:Yn(Gn,V(Vn),ot.options.strategy==="fixed"),popper:ee(Vn)},ot.reset=!1,ot.placement=ot.options.placement,ot.orderedModifiers.forEach(function(Hn){return ot.modifiersData[Hn.name]=Object.assign({},Hn.data)});for(var Kt=0;Kt<ot.orderedModifiers.length;Kt++){if(ot.reset===!0){ot.reset=!1,Kt=-1;continue}var Rn=ot.orderedModifiers[Kt],bn=Rn.fn,jt=Rn.options,Cr=jt===void 0?{}:jt,mr=Rn.name;typeof bn=="function"&&(ot=bn({state:ot,options:Cr,name:mr,instance:Mt})||ot)}}}},update:St(function(){return new Promise(function(Ht){Mt.forceUpdate(),Ht(ot)})}),destroy:function(){nn(),yn=!0}};if(!vn(De,Ye))return Mt;Mt.setOptions($t).then(function(Ht){!yn&&$t.onFirstUpdate&&$t.onFirstUpdate(Ht)});function Jt(){ot.orderedModifiers.forEach(function(Ht){var rn=Ht.name,Gn=Ht.options,Vn=Gn===void 0?{}:Gn,Kt=Ht.effect;if(typeof Kt=="function"){var Rn=Kt({state:ot,name:rn,instance:Mt,options:Vn}),bn=function(){};on.push(Rn||bn)}})}function nn(){on.forEach(function(Ht){return Ht()}),on=[]}return Mt}}const Wr=ui({defaultModifiers:[sn,Fe,ge,Ze,Pt,Qr,Gt,Ln]});return Gm.createPopper=Wr,Gm.placements=m,Gm}var FA;function HK(){if(FA)return fd;FA=1,fd.__esModule=!0,fd.default=void 0;var n=ut(),e=zK(),t=s(YK()),r=GK();const i=["enabled","placement","strategy","modifiers"];function s(d){return d&&d.__esModule?d:{default:d}}function o(d,h){if(d==null)return{};var m={};for(var g in d)if({}.hasOwnProperty.call(d,g)){if(h.indexOf(g)>=0)continue;m[g]=d[g]}return m}const a={name:"applyStyles",enabled:!1,phase:"afterWrite",fn:()=>{}},l={name:"ariaDescribedBy",enabled:!0,phase:"afterWrite",effect:({state:d})=>()=>{const{reference:h,popper:m}=d.elements;if("removeAttribute"in h){const g=(h.getAttribute("aria-describedby")||"").split(",").filter(O=>O.trim()!==m.id);g.length?h.setAttribute("aria-describedby",g.join(",")):h.removeAttribute("aria-describedby")}},fn:({state:d})=>{var h;const{popper:m,reference:g}=d.elements,O=(h=m.getAttribute("role"))==null?void 0:h.toLowerCase();if(m.id&&O==="tooltip"&&"setAttribute"in g){const y=g.getAttribute("aria-describedby");if(y&&y.split(",").indexOf(m.id)!==-1)return;g.setAttribute("aria-describedby",y?`${y},${m.id}`:m.id)}}},c=[];function u(d,h,m={}){let{enabled:g=!0,placement:O="bottom",strategy:y="absolute",modifiers:b=c}=m,S=o(m,i);const P=(0,n.useRef)(b),k=(0,n.useRef)(),x=(0,n.useCallback)(()=>{var $;($=k.current)==null||$.update()},[]),A=(0,n.useCallback)(()=>{var $;($=k.current)==null||$.forceUpdate()},[]),[M,Q]=(0,t.default)((0,n.useState)({placement:O,update:x,forceUpdate:A,attributes:{},styles:{popper:{},arrow:{}}})),_=(0,n.useMemo)(()=>({name:"updateStateModifier",enabled:!0,phase:"write",requires:["computeStyles"],fn:({state:$})=>{const D={},F={};Object.keys($.elements).forEach(G=>{D[G]=$.styles[G],F[G]=$.attributes[G]}),Q({state:$,styles:D,attributes:F,update:x,forceUpdate:A,placement:$.placement})}}),[x,A,Q]),R=(0,n.useMemo)(()=>((0,e.dequal)(P.current,b)||(P.current=b),P.current),[b]);return(0,n.useEffect)(()=>{!k.current||!g||k.current.setOptions({placement:O,strategy:y,modifiers:[...R,_,a]})},[y,O,_,g,R]),(0,n.useEffect)(()=>{if(!(!g||d==null||h==null))return k.current=(0,r.createPopper)(d,h,Object.assign({},S,{placement:O,strategy:y,modifiers:[...R,l,_]})),()=>{k.current!=null&&(k.current.destroy(),k.current=void 0,Q($=>Object.assign({},$,{attributes:{},styles:{popper:{}}})))}},[g,d,h]),M}return fd.default=u,fd}var hd={},oc={},VA;function KK(){if(VA)return oc;VA=1,oc.__esModule=!0,oc.getRefTarget=oc.default=void 0;var n=o(Fk),e=o(Vk),t=o(uv),r=ut(),i=o(_h()),s=o(lv());function o(m){return m&&m.__esModule?m:{default:m}}const a=()=>{};function l(m){return m.button===0}function c(m){return!!(m.metaKey||m.altKey||m.ctrlKey||m.shiftKey)}const u=m=>m&&("current"in m?m.current:m);oc.getRefTarget=u;const d={click:"mousedown",mouseup:"mousedown",pointerup:"pointerdown"};function h(m,g=a,{disabled:O,clickTrigger:y="click"}={}){const b=(0,r.useRef)(!1),S=(0,r.useRef)(!1),P=(0,r.useCallback)(A=>{const M=u(m);(0,s.default)(!!M,"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"),b.current=!M||c(A)||!l(A)||!!(0,n.default)(M,A.target)||S.current,S.current=!1},[m]),k=(0,i.default)(A=>{const M=u(m);M&&(0,n.default)(M,A.target)?S.current=!0:S.current=!1}),x=(0,i.default)(A=>{b.current||g(A)});(0,r.useEffect)(()=>{var A,M;if(O||m==null)return;const Q=(0,t.default)(u(m)),_=Q.defaultView||window;let R=(A=_.event)!=null?A:(M=_.parent)==null?void 0:M.event,$=null;d[y]&&($=(0,e.default)(Q,d[y],k,!0));const D=(0,e.default)(Q,y,P,!0),F=(0,e.default)(Q,y,ue=>{if(ue===R){R=void 0;return}x(ue)});let G=[];return"ontouchstart"in Q.documentElement&&(G=[].slice.call(Q.body.children).map(ue=>(0,e.default)(ue,"mousemove",a))),()=>{$==null||$(),D(),F(),G.forEach(ue=>ue())}},[m,O,y,P,k,x])}return oc.default=h,oc}var ZA;function JK(){if(ZA)return hd;ZA=1,hd.__esModule=!0,hd.default=void 0;var n=l(Vk),e=l(uv),t=ut(),r=l(_h()),i=a(KK()),s=Dc();function o(d){if(typeof WeakMap!="function")return null;var h=new WeakMap,m=new WeakMap;return(o=function(g){return g?m:h})(d)}function a(d,h){if(d&&d.__esModule)return d;if(d===null||typeof d!="object"&&typeof d!="function")return{default:d};var m=o(h);if(m&&m.has(d))return m.get(d);var g={__proto__:null},O=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var y in d)if(y!=="default"&&{}.hasOwnProperty.call(d,y)){var b=O?Object.getOwnPropertyDescriptor(d,y):null;b&&(b.get||b.set)?Object.defineProperty(g,y,b):g[y]=d[y]}return g.default=d,m&&m.set(d,g),g}function l(d){return d&&d.__esModule?d:{default:d}}const c=()=>{};function u(d,h,{disabled:m,clickTrigger:g}={}){const O=h||c;(0,i.default)(d,O,{disabled:m,clickTrigger:g});const y=(0,r.default)(b=>{(0,s.isEscKey)(b)&&O(b)});(0,t.useEffect)(()=>{if(m||d==null)return;const b=(0,e.default)((0,i.getRefTarget)(d));let S=(b.defaultView||window).event;const P=(0,n.default)(b,"keyup",k=>{if(k===S){S=void 0;return}y(k)});return()=>{P()}},[d,m,y])}return hd.default=u,hd}var Ou={},WA;function eJ(){if(WA)return Ou;WA=1,Ou.__esModule=!0,Ou.default=t,Ou.toModifierArray=e,Ou.toModifierMap=n;function n(r){const i={};return Array.isArray(r)?(r==null||r.forEach(s=>{i[s.name]=s}),i):r||i}function e(r={}){return Array.isArray(r)?r:Object.keys(r).map(i=>(r[i].name=i,r[i]))}function t({enabled:r,enableEvents:i,placement:s,flip:o,offset:a,fixed:l,containerPadding:c,arrowElement:u,popperConfig:d={}}){var h,m,g,O,y;const b=n(d.modifiers);return Object.assign({},d,{placement:s,enabled:r,strategy:l?"fixed":d.strategy,modifiers:e(Object.assign({},b,{eventListeners:{enabled:i,options:(h=b.eventListeners)==null?void 0:h.options},preventOverflow:Object.assign({},b.preventOverflow,{options:c?Object.assign({padding:c},(m=b.preventOverflow)==null?void 0:m.options):(g=b.preventOverflow)==null?void 0:g.options}),offset:{options:Object.assign({offset:a},(O=b.offset)==null?void 0:O.options)},arrow:Object.assign({},b.arrow,{enabled:!!u,options:Object.assign({},(y=b.arrow)==null?void 0:y.options,{element:u})}),flip:Object.assign({enabled:!!o},b.flip)}))})}return Ou}var XA;function tJ(){if(XA)return ud;XA=1,ud.__esModule=!0,ud.default=void 0;var n=h(ut()),e=n,t=u(fh()),r=u(XK()),i=u(dv()),s=u(HK()),o=u(JK()),a=u(fN()),l=u(eJ()),c=dN();function u(g){return g&&g.__esModule?g:{default:g}}function d(g){if(typeof WeakMap!="function")return null;var O=new WeakMap,y=new WeakMap;return(d=function(b){return b?y:O})(g)}function h(g,O){if(g&&g.__esModule)return g;if(g===null||typeof g!="object"&&typeof g!="function")return{default:g};var y=d(O);if(y&&y.has(g))return y.get(g);var b={__proto__:null},S=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var P in g)if(P!=="default"&&{}.hasOwnProperty.call(g,P)){var k=S?Object.getOwnPropertyDescriptor(g,P):null;k&&(k.get||k.set)?Object.defineProperty(b,P,k):b[P]=g[P]}return b.default=g,y&&y.set(g,b),b}const m=e.forwardRef((g,O)=>{const{flip:y,offset:b,placement:S,containerPadding:P,popperConfig:k={},transition:x,runTransition:A}=g,[M,Q]=(0,r.default)(),[_,R]=(0,r.default)(),$=(0,i.default)(Q,O),D=(0,a.default)(g.container),F=(0,a.default)(g.target),[G,ue]=(0,n.useState)(!g.show),B=(0,s.default)(F,M,(0,l.default)({placement:S,enableEvents:!!g.show,containerPadding:P||5,flip:y,offset:b,arrowElement:_,popperConfig:k}));g.show&&G&&ue(!1);const X=(...pe)=>{ue(!0),g.onExited&&g.onExited(...pe)},W=g.show||!G;if((0,o.default)(M,g.onHide,{disabled:!g.rootClose||g.rootCloseDisabled,clickTrigger:g.rootCloseEvent}),!W)return null;const{onExit:ee,onExiting:re,onEnter:H,onEntering:se,onEntered:J}=g;let oe=g.children(Object.assign({},B.attributes.popper,{style:B.styles.popper,ref:$}),{popper:B,placement:S,show:!!g.show,arrowProps:Object.assign({},B.attributes.arrow,{style:B.styles.arrow,ref:R})});return oe=(0,c.renderTransition)(x,A,{in:!!g.show,appear:!0,mountOnEnter:!0,unmountOnExit:!0,children:oe,onExit:ee,onExiting:re,onExited:X,onEnter:H,onEntering:se,onEntered:J}),D?t.default.createPortal(oe,D):null});return m.displayName="Overlay",ud.default=m,ud}var pd={},zA;function nJ(){if(zA)return pd;zA=1,pd.__esModule=!0,pd.default=void 0;var n=ut();const e=typeof Rr<"u"&&Rr.navigator&&Rr.navigator.product==="ReactNative";var r=typeof document<"u"||e?n.useLayoutEffect:n.useEffect;return pd.default=r,pd}var Hm={exports:{}};const rJ=$i(sK);var Km={exports:{}},Jm={exports:{}},YA;function iJ(){return YA||(YA=1,function(n,e){"use client";var t=gn();e.__esModule=!0,e.default=void 0;var r=l(ut()),i=t(zn()),s=Tr(),o=fn();function a(u){if(typeof WeakMap!="function")return null;var d=new WeakMap,h=new WeakMap;return(a=function(m){return m?h:d})(u)}function l(u,d){if(u&&u.__esModule)return u;if(u===null||typeof u!="object"&&typeof u!="function")return{default:u};var h=a(d);if(h&&h.has(u))return h.get(u);var m={__proto__:null},g=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var O in u)if(O!=="default"&&Object.prototype.hasOwnProperty.call(u,O)){var y=g?Object.getOwnPropertyDescriptor(u,O):null;y&&(y.get||y.set)?Object.defineProperty(m,O,y):m[O]=u[O]}return m.default=u,h&&h.set(u,m),m}const c=r.forwardRef(({className:u,bsPrefix:d,as:h="div",...m},g)=>(d=(0,s.useBootstrapPrefix)(d,"popover-header"),(0,o.jsx)(h,{ref:g,className:(0,i.default)(u,d),...m})));c.displayName="PopoverHeader",e.default=c,n.exports=e.default}(Jm,Jm.exports)),Jm.exports}var eg={exports:{}},GA;function sJ(){return GA||(GA=1,function(n,e){"use client";var t=gn();e.__esModule=!0,e.default=void 0;var r=l(ut()),i=t(zn()),s=Tr(),o=fn();function a(u){if(typeof WeakMap!="function")return null;var d=new WeakMap,h=new WeakMap;return(a=function(m){return m?h:d})(u)}function l(u,d){if(u&&u.__esModule)return u;if(u===null||typeof u!="object"&&typeof u!="function")return{default:u};var h=a(d);if(h&&h.has(u))return h.get(u);var m={__proto__:null},g=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var O in u)if(O!=="default"&&Object.prototype.hasOwnProperty.call(u,O)){var y=g?Object.getOwnPropertyDescriptor(u,O):null;y&&(y.get||y.set)?Object.defineProperty(m,O,y):m[O]=u[O]}return m.default=u,h&&h.set(u,m),m}const c=r.forwardRef(({className:u,bsPrefix:d,as:h="div",...m},g)=>(d=(0,s.useBootstrapPrefix)(d,"popover-body"),(0,o.jsx)(h,{ref:g,className:(0,i.default)(u,d),...m})));c.displayName="PopoverBody",e.default=c,n.exports=e.default}(eg,eg.exports)),eg.exports}var vu={},HA;function PN(){if(HA)return vu;HA=1,vu.__esModule=!0,vu.BsPrefixComponent=void 0,vu.getOverlayDirection=i;var n=t(ut());function e(s){if(typeof WeakMap!="function")return null;var o=new WeakMap,a=new WeakMap;return(e=function(l){return l?a:o})(s)}function t(s,o){if(s&&s.__esModule)return s;if(s===null||typeof s!="object"&&typeof s!="function")return{default:s};var a=e(o);if(a&&a.has(s))return a.get(s);var l={__proto__:null},c=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in s)if(u!=="default"&&Object.prototype.hasOwnProperty.call(s,u)){var d=c?Object.getOwnPropertyDescriptor(s,u):null;d&&(d.get||d.set)?Object.defineProperty(l,u,d):l[u]=s[u]}return l.default=s,a&&a.set(s,l),l}class r extends n.Component{}vu.BsPrefixComponent=r;function i(s,o){let a=s;return s==="left"?a=o?"end":"start":s==="right"&&(a=o?"start":"end"),a}return vu}var tg={exports:{}},KA;function xN(){return KA||(KA=1,function(n,e){e.__esModule=!0,e.default=t;function t(r="absolute"){return{position:r,top:"0",left:"0",opacity:"0",pointerEvents:"none"}}n.exports=e.default}(tg,tg.exports)),tg.exports}var JA;function oJ(){return JA||(JA=1,function(n,e){"use client";var t=gn();e.__esModule=!0,e.default=void 0;var r=t(zn()),i=h(ut()),s=Tr(),o=t(iJ()),a=t(sJ()),l=PN(),c=t(xN()),u=fn();function d(g){if(typeof WeakMap!="function")return null;var O=new WeakMap,y=new WeakMap;return(d=function(b){return b?y:O})(g)}function h(g,O){if(g&&g.__esModule)return g;if(g===null||typeof g!="object"&&typeof g!="function")return{default:g};var y=d(O);if(y&&y.has(g))return y.get(g);var b={__proto__:null},S=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var P in g)if(P!=="default"&&Object.prototype.hasOwnProperty.call(g,P)){var k=S?Object.getOwnPropertyDescriptor(g,P):null;k&&(k.get||k.set)?Object.defineProperty(b,P,k):b[P]=g[P]}return b.default=g,y&&y.set(g,b),b}const m=i.forwardRef(({bsPrefix:g,placement:O="right",className:y,style:b,children:S,body:P,arrowProps:k,hasDoneInitialMeasure:x,popper:A,show:M,...Q},_)=>{const R=(0,s.useBootstrapPrefix)(g,"popover"),$=(0,s.useIsRTL)(),[D]=(O==null?void 0:O.split("-"))||[],F=(0,l.getOverlayDirection)(D,$);let G=b;return M&&!x&&(G={...b,...(0,c.default)(A==null?void 0:A.strategy)}),(0,u.jsxs)("div",{ref:_,role:"tooltip",style:G,"x-placement":D,className:(0,r.default)(y,R,D&&`bs-popover-${F}`),...Q,children:[(0,u.jsx)("div",{className:"popover-arrow",...k}),P?(0,u.jsx)(a.default,{children:S}):S]})});e.default=Object.assign(m,{Header:o.default,Body:a.default,POPPER_OFFSET:[0,8]}),n.exports=e.default}(Km,Km.exports)),Km.exports}var ng={exports:{}},e$;function TN(){return e$||(e$=1,function(n,e){"use client";var t=gn();e.__esModule=!0,e.default=void 0;var r=t(zn()),i=u(ut()),s=Tr(),o=PN(),a=t(xN()),l=fn();function c(h){if(typeof WeakMap!="function")return null;var m=new WeakMap,g=new WeakMap;return(c=function(O){return O?g:m})(h)}function u(h,m){if(h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var g=c(m);if(g&&g.has(h))return g.get(h);var O={__proto__:null},y=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var b in h)if(b!=="default"&&Object.prototype.hasOwnProperty.call(h,b)){var S=y?Object.getOwnPropertyDescriptor(h,b):null;S&&(S.get||S.set)?Object.defineProperty(O,b,S):O[b]=h[b]}return O.default=h,g&&g.set(h,O),O}const d=i.forwardRef(({bsPrefix:h,placement:m="right",className:g,style:O,children:y,arrowProps:b,hasDoneInitialMeasure:S,popper:P,show:k,...x},A)=>{h=(0,s.useBootstrapPrefix)(h,"tooltip");const M=(0,s.useIsRTL)(),[Q]=(m==null?void 0:m.split("-"))||[],_=(0,o.getOverlayDirection)(Q,M);let R=O;return k&&!S&&(R={...O,...(0,a.default)(P==null?void 0:P.strategy)}),(0,l.jsxs)("div",{ref:A,style:R,role:"tooltip","x-placement":Q,className:(0,r.default)(g,h,`bs-tooltip-${_}`),...x,children:[(0,l.jsx)("div",{className:"tooltip-arrow",...b}),(0,l.jsx)("div",{className:`${h}-inner`,children:y})]})});d.displayName="Tooltip",e.default=Object.assign(d,{TOOLTIP_OFFSET:[0,6]}),n.exports=e.default}(ng,ng.exports)),ng.exports}var t$;function aJ(){return t$||(t$=1,function(n,e){"use client";var t=gn();e.__esModule=!0,e.default=l;var r=ut(),i=t(rJ),s=Tr(),o=t(oJ()),a=t(TN());function l(c){const u=(0,r.useRef)(null),d=(0,s.useBootstrapPrefix)(void 0,"popover"),h=(0,s.useBootstrapPrefix)(void 0,"tooltip"),m=(0,r.useMemo)(()=>({name:"offset",options:{offset:()=>{if(c)return c;if(u.current){if((0,i.default)(u.current,d))return o.default.POPPER_OFFSET;if((0,i.default)(u.current,h))return a.default.TOOLTIP_OFFSET}return[0,0]}}}),[c,d,h]);return[u,[m]]}n.exports=e.default}(Hm,Hm.exports)),Hm.exports}var n$;function lJ(){return n$||(n$=1,function(n,e){"use client";var t=gn();e.__esModule=!0,e.default=void 0;var r=O(ut()),i=r,s=t(zn()),o=t(tJ()),a=t(Uk()),l=t(nJ()),c=t(fv()),u=t(aJ()),d=t(ON()),h=t(Xk()),m=fn();function g(S){if(typeof WeakMap!="function")return null;var P=new WeakMap,k=new WeakMap;return(g=function(x){return x?k:P})(S)}function O(S,P){if(S&&S.__esModule)return S;if(S===null||typeof S!="object"&&typeof S!="function")return{default:S};var k=g(P);if(k&&k.has(S))return k.get(S);var x={__proto__:null},A=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var M in S)if(M!=="default"&&Object.prototype.hasOwnProperty.call(S,M)){var Q=A?Object.getOwnPropertyDescriptor(S,M):null;Q&&(Q.get||Q.set)?Object.defineProperty(x,M,Q):x[M]=S[M]}return x.default=S,k&&k.set(S,x),x}function y(S,P){const{ref:k}=S,{ref:x}=P;S.ref=k.__wrapped||(k.__wrapped=A=>k((0,h.default)(A))),P.ref=x.__wrapped||(x.__wrapped=A=>x((0,h.default)(A)))}const b=i.forwardRef(({children:S,transition:P=d.default,popperConfig:k={},rootClose:x=!1,placement:A="top",show:M=!1,...Q},_)=>{const R=(0,r.useRef)({}),[$,D]=(0,r.useState)(null),[F,G]=(0,u.default)(Q.offset),ue=(0,c.default)(_,F),B=P===!0?d.default:P||void 0,X=(0,a.default)(W=>{D(W),k==null||k.onFirstUpdate==null||k.onFirstUpdate(W)});return(0,l.default)(()=>{$&&Q.target&&(R.current.scheduleUpdate==null||R.current.scheduleUpdate())},[$,Q.target]),(0,r.useEffect)(()=>{M||D(null)},[M]),(0,m.jsx)(o.default,{...Q,ref:ue,popperConfig:{...k,modifiers:G.concat(k.modifiers||[]),onFirstUpdate:X},transition:B,rootClose:x,placement:A,show:M,children:(W,{arrowProps:ee,popper:re,show:H})=>{var se;y(W,ee);const J=re==null?void 0:re.placement,oe=Object.assign(R.current,{state:re==null?void 0:re.state,scheduleUpdate:re==null?void 0:re.update,placement:J,outOfBoundaries:(re==null||(se=re.state)==null||(se=se.modifiersData.hide)==null?void 0:se.isReferenceHidden)||!1,strategy:k.strategy}),pe=!!$;return typeof S=="function"?S({...W,placement:J,show:H,...!P&&H&&{className:"show"},popper:oe,arrowProps:ee,hasDoneInitialMeasure:pe}):i.cloneElement(S,{...W,placement:J,arrowProps:ee,popper:oe,hasDoneInitialMeasure:pe,className:(0,s.default)(S.props.className,!P&&H&&"show"),style:{...S.props.style,...W.style}})}})});b.displayName="Overlay",e.default=b,n.exports=e.default}(zm,zm.exports)),zm.exports}var r$;function cJ(){return r$||(r$=1,function(n,e){"use client";var t=gn();e.__esModule=!0,e.default=void 0;var r=t(Fk),i=t(av()),s=O(ut()),o=s,a=t(MK());t(lv());var l=WK,c=t(fv()),u=Dc(),d=t(lJ()),h=t(Xk()),m=fn();function g(P){if(typeof WeakMap!="function")return null;var k=new WeakMap,x=new WeakMap;return(g=function(A){return A?x:k})(P)}function O(P,k){if(P&&P.__esModule)return P;if(P===null||typeof P!="object"&&typeof P!="function")return{default:P};var x=g(k);if(x&&x.has(P))return x.get(P);var A={__proto__:null},M=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Q in P)if(Q!=="default"&&Object.prototype.hasOwnProperty.call(P,Q)){var _=M?Object.getOwnPropertyDescriptor(P,Q):null;_&&(_.get||_.set)?Object.defineProperty(A,Q,_):A[Q]=P[Q]}return A.default=P,x&&x.set(P,A),A}function y(P){return P&&typeof P=="object"?P:{show:P,hide:P}}function b(P,k,x){const[A]=k,M=A.currentTarget,Q=A.relatedTarget||A.nativeEvent[x];(!Q||Q!==M)&&!(0,r.default)(M,Q)&&P(...k)}i.default.oneOf(["click","hover","focus"]);const S=({trigger:P=["hover","focus"],overlay:k,children:x,popperConfig:A={},show:M,defaultShow:Q=!1,onToggle:_,delay:R,placement:$,flip:D=$&&$.indexOf("auto")!==-1,...F})=>{const G=(0,s.useRef)(null),ue=(0,c.default)(G,(0,u.getChildRef)(x)),B=(0,a.default)(),X=(0,s.useRef)(""),[W,ee]=(0,l.useUncontrolledProp)(M,Q,_),re=y(R),{onFocus:H,onBlur:se,onClick:J}=typeof x!="function"?o.Children.only(x).props:{},oe=Re=>{ue((0,h.default)(Re))},pe=(0,s.useCallback)(()=>{if(B.clear(),X.current="show",!re.show){ee(!0);return}B.set(()=>{X.current==="show"&&ee(!0)},re.show)},[re.show,ee,B]),Ee=(0,s.useCallback)(()=>{if(B.clear(),X.current="hide",!re.hide){ee(!1);return}B.set(()=>{X.current==="hide"&&ee(!1)},re.hide)},[re.hide,ee,B]),j=(0,s.useCallback)((...Re)=>{pe(),H==null||H(...Re)},[pe,H]),V=(0,s.useCallback)((...Re)=>{Ee(),se==null||se(...Re)},[Ee,se]),Y=(0,s.useCallback)((...Re)=>{ee(!W),J==null||J(...Re)},[J,ee,W]),de=(0,s.useCallback)((...Re)=>{b(pe,Re,"fromElement")},[pe]),ke=(0,s.useCallback)((...Re)=>{b(Ee,Re,"toElement")},[Ee]),Te=P==null?[]:[].concat(P),Pe={ref:oe};return Te.indexOf("click")!==-1&&(Pe.onClick=Y),Te.indexOf("focus")!==-1&&(Pe.onFocus=j,Pe.onBlur=V),Te.indexOf("hover")!==-1&&(Pe.onMouseOver=de,Pe.onMouseOut=ke),(0,m.jsxs)(m.Fragment,{children:[typeof x=="function"?x(Pe):(0,s.cloneElement)(x,Pe),(0,m.jsx)(d.default,{...F,show:W,onHide:Ee,flip:D,placement:$,popperConfig:A,target:G.current,children:k})]})};e.default=S,n.exports=e.default}(Zm,Zm.exports)),Zm.exports}var uJ=cJ();const Rs=Us(uJ);var fJ=TN();const As=Us(fJ),dJ=({enableUsernameField:n=!0})=>{const{isDocOpen:e,closeDoc:t,setTheme:r,setUsername:i}=L.useContext(ni);return L.useCallback(s=>{r(s.target.value)},[]),e?q.jsxs(dr,{className:"vz-settings",show:e,onHide:t,animation:!1,children:[q.jsx(dr.Header,{closeButton:!0,children:q.jsx(dr.Title,{children:"Keyboard Shortcuts"})}),q.jsxs(dr.Body,{className:"pt-1",children:[q.jsx(xr.Group,{className:"mb-3",children:q.jsx(xr.Text,{className:"text-muted",children:"Keyboard shortcuts and interactive widgets for quick actions"})}),q.jsx(xr.Group,{children:q.jsxs("ul",{children:[q.jsxs("li",{children:[q.jsxs("strong",{children:[q.jsx("kbd",{children:"Ctrl"})," + ",q.jsx("kbd",{children:"S"})]})," ","or"," ",q.jsxs("strong",{children:[q.jsx("kbd",{children:"Shift↑"})," + ",q.jsx("kbd",{children:"Enter←"})]})," ",q.jsx("br",{}),q.jsx("span",{children:"Run and format code"})]}),q.jsxs("li",{children:[q.jsxs("strong",{children:[q.jsx("kbd",{children:"Alt"})," + Drag on a number"]}),q.jsx("br",{}),q.jsx("span",{children:"Modify the number by dragging left or right"})]}),q.jsxs("li",{children:[q.jsxs("strong",{children:[q.jsx("kbd",{children:"Alt"})," + Click on a hex color"]}),q.jsx("br",{}),q.jsx("span",{children:"Open a color picker to modify the color"})]}),q.jsxs("li",{children:[q.jsxs("strong",{children:[q.jsx("kbd",{children:"Alt"})," + ",q.jsx("kbd",{children:"W"})]})," ",q.jsx("br",{}),q.jsx("span",{children:"Close the current tab"})]}),q.jsxs("li",{children:[q.jsxs("strong",{children:[q.jsx("kbd",{children:"Alt"})," + ",q.jsx("kbd",{children:"N"})]})," ","or"," ",q.jsxs("strong",{children:[q.jsx("kbd",{children:"Ctrl"})," + ",q.jsx("kbd",{children:"Shift↑"})," +"," ",q.jsx("kbd",{children:"N"})]})," ",q.jsx("br",{}),q.jsx("span",{children:"Open the create file modal"})]}),q.jsxs("li",{children:[q.jsxs("strong",{children:[q.jsx("kbd",{children:"Alt"})," + ",q.jsx("kbd",{children:"PgUp↑"})]})," ",q.jsx("br",{}),q.jsx("span",{children:"Change the active tab to the previous one"})]}),q.jsxs("li",{children:[q.jsxs("strong",{children:[q.jsx("kbd",{children:"Alt"})," + ",q.jsx("kbd",{children:"PgDn↓"})]})," ",q.jsx("br",{}),q.jsx("span",{children:"Change the active tab to the next one"})]}),q.jsxs("li",{children:[q.jsx("strong",{children:"Most VSCode Shortcuts"})," ",q.jsx("br",{}),"See VSCode docs:"," ",q.jsx("a",{href:"https://code.visualstudio.com/shortcuts/keyboard-shortcuts-windows.pdf",target:"_blank",children:"Windows"}),","," ",q.jsx("a",{href:"https://code.visualstudio.com/shortcuts/keyboard-shortcuts-macos.pdf",target:"_blank",children:"MacOS"}),","," ",q.jsx("a",{href:"https://code.visualstudio.com/shortcuts/keyboard-shortcuts-linux.pdf",target:"_blank",children:"Linux"})]})]})})]}),q.jsx(dr.Footer,{children:q.jsx(Rc,{variant:"primary",onClick:t,children:"Done"})})]}):null},hJ=["10px","12px","14px","16px","18px","20px","24px"],pJ=["-apple-system","BlinkMacSystemFont","Segoe UI","Roboto","Helvetica Neue","Arial","sans-serif","Courier New","Georgia","Tahoma","Verdana","Times New Roman","Trebuchet MS","Comic Sans MS"],mJ=n=>{const e="abcdefghijklmnopqrstuvwxyz0123456789",t="72px",r=document.createElement("span");r.style.fontSize=t,r.style.visibility="hidden",r.style.position="absolute",r.innerHTML=e,document.body.appendChild(r);const i="monospace";r.style.fontFamily=i;const s=r.offsetWidth;r.style.fontFamily=`${n}, ${i}`;const o=r.offsetWidth;return document.body.removeChild(r),o!==s},gJ=({enableUsernameField:n=!0})=>{const{isSettingsOpen:e,closeSettings:t,theme:r,setTheme:i,username:s,setUsername:o}=L.useContext(ni),[a,l]=L.useState("Roboto Mono"),[c,u]=L.useState("16px"),[d,h]=L.useState([]);L.useEffect(()=>{if(typeof window<"u"){const y=window.localStorage.getItem("vzcodeSelectedFont"),b=window.localStorage.getItem("vzcodeSelectedFontSize");y!==null&&l(y),b!==null&&u(b)}},[]),L.useEffect(()=>{(()=>{const b=[];for(const S of pJ)mJ(S)&&b.push(S);h(b)})()},[]);const m=L.useCallback(()=>{l("Roboto Mono"),u("16px"),i(tw[0].label),n&&o(""),localStorage.removeItem("vzcodeSelectedFont"),localStorage.removeItem("vzcodeSelectedFontSize")},[n,i,o]);L.useEffect(()=>{document.body.style.setProperty("--vzcode-font-family",a)},[a]),L.useEffect(()=>{document.body.style.setProperty("--vzcode-font-size",c)},[c]);const g=L.useRef(null),O=L.useCallback(()=>{var y;o(((y=g.current)==null?void 0:y.value)||"")},[o]);return L.useEffect(()=>{if(e){const y=b=>{b.key==="Enter"&&t()};return window.addEventListener("keydown",y),()=>{window.removeEventListener("keydown",y)}}},[e,t]),e?q.jsxs(dr,{className:"vz-settings",show:e,onHide:t,animation:!1,children:[q.jsx(dr.Header,{closeButton:!0,children:q.jsx(dr.Title,{children:"Editor Settings"})}),q.jsxs(dr.Body,{children:[n?q.jsxs(xr.Group,{className:"mb-3",controlId:"formFork",children:[q.jsx(xr.Label,{children:"Username"}),q.jsx(xr.Control,{type:"text",ref:g,onChange:O,placeholder:"Enter username",value:s}),q.jsx(xr.Text,{className:"text-muted",children:"Enter a username to be displayed on your cursor"})]}):null,q.jsxs(xr.Group,{className:"mb-3",controlId:"formFork",children:[q.jsx(xr.Label,{children:"Theme"}),q.jsx("select",{className:"form-select",value:r,onChange:y=>i(y.target.value),children:tw.map(({label:y})=>q.jsx("option",{value:y,children:y},y))})]}),q.jsxs(xr.Group,{className:"mb-3",controlId:"formFork",children:[q.jsx(xr.Label,{children:"Font"}),q.jsx("select",{className:"form-select",onChange:y=>l(y.target.value),value:a,children:d.map(y=>q.jsx("option",{value:y,children:y},y))})]}),q.jsxs(xr.Group,{className:"mb-3",controlId:"formFork",children:[q.jsx(xr.Label,{children:"Font Size"}),q.jsx("select",{className:"form-select",onChange:y=>u(y.target.value),value:c,children:hJ.map(y=>q.jsx("option",{value:y,children:y},y))})]})]}),q.jsxs(dr.Footer,{children:[q.jsx(Rc,{variant:"secondary",onClick:m,children:"Reset to Default"}),q.jsx(Rc,{variant:"primary",onClick:t,children:"Done"})]})]}):null},OJ=n=>{const e={name:"files"};for(const t of Object.keys(n)){const r=n[t],i=r.name.split("/"),s=i.length;let o=e;for(let a=0;a<s-1;a++){let l;const c=i[a];if(o.children)for(let u=0;u<o.children.length;u++){const d=o.children[u];if(d.name===c){l=d;break}}l||(l={name:i[a],path:i.slice(0,a+1).join("/")},(o.children||(o.children=[])).push(l)),o=l}r.text!==null&&(o.children||(o.children=[])).push({name:i[s-1],file:r,fileId:t})}return e},vJ=()=>q.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24",fill:"currentColor",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[q.jsx("path",{d:"M9.8132 15.9038L9 18.75L8.1868 15.9038C7.75968 14.4089 6.59112 13.2403 5.09619 12.8132L2.25 12L5.09619 11.1868C6.59113 10.7597 7.75968 9.59112 8.1868 8.09619L9 5.25L9.8132 8.09619C10.2403 9.59113 11.4089 10.7597 12.9038 11.1868L15.75 12L12.9038 12.8132C11.4089 13.2403 10.2403 14.4089 9.8132 15.9038Z"}),q.jsx("path",{d:"M18.2589 8.71454L18 9.75L17.7411 8.71454C17.4388 7.50533 16.4947 6.56117 15.2855 6.25887L14.25 6L15.2855 5.74113C16.4947 5.43883 17.4388 4.49467 17.7411 3.28546L18 2.25L18.2589 3.28546C18.5612 4.49467 19.5053 5.43883 20.7145 5.74113L21.75 6L20.7145 6.25887C19.5053 6.56117 18.5612 7.50533 18.2589 8.71454Z"}),q.jsx("path",{d:"M16.8942 20.5673L16.5 21.75L16.1058 20.5673C15.8818 19.8954 15.3546 19.3682 14.6827 19.1442L13.5 18.75L14.6827 18.3558C15.3546 18.1318 15.8818 17.6046 16.1058 16.9327L16.5 15.75L16.8942 16.9327C17.1182 17.6046 17.6454 18.1318 18.3173 18.3558L19.5 18.75L18.3173 19.1442C17.6454 19.3682 17.1182 19.8954 16.8942 20.5673Z"})]}),yJ=()=>q.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:q.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L10.582 16.07a4.5 4.5 0 0 1-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 0 1 1.13-1.897l8.932-8.931Zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0 1 15.75 21H5.25A2.25 2.25 0 0 1 3 18.75V8.25A2.25 2.25 0 0 1 5.25 6H10"})}),bJ=()=>q.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:q.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m3.75 9v6m3-3H9m1.5-12H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"})}),SJ=()=>q.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",children:[q.jsx("path",{d:"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.324.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 0 1 1.37.49l1.296 2.247a1.125 1.125 0 0 1-.26 1.431l-1.003.827c-.293.24-.438.613-.431.992a6.759 6.759 0 0 1 0 .255c-.007.378.138.75.43.99l1.005.828c.424.35.534.954.26 1.43l-1.298 2.247a1.125 1.125 0 0 1-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.57 6.57 0 0 1-.22.128c-.331.183-.581.495-.644.869l-.213 1.28c-.09.543-.56.941-1.11.941h-2.594c-.55 0-1.02-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 0 1-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 0 1-1.369-.49l-1.297-2.247a1.125 1.125 0 0 1 .26-1.431l1.004-.827c.292-.24.437-.613.43-.992a6.932 6.932 0 0 1 0-.255c.007-.378-.138-.75-.43-.99l-1.004-.828a1.125 1.125 0 0 1-.26-1.43l1.297-2.247a1.125 1.125 0 0 1 1.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.087.22-.128.332-.183.582-.495.644-.869l.214-1.281Z"}),q.jsx("path",{d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"})]}),xO=()=>q.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:q.jsx("path",{d:"M6 18L18 6M6 6L18 18",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),wJ=()=>q.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:q.jsx("path",{fill:"none",stroke:"currentColor",d:"M14.7404 9L14.3942 18M9.60577 18L9.25962 9M19.2276 5.79057C19.5696 5.84221 19.9104 5.89747 20.25 5.95629M19.2276 5.79057L18.1598 19.6726C18.0696 20.8448 17.0921 21.75 15.9164 21.75H8.08357C6.90786 21.75 5.93037 20.8448 5.8402 19.6726L4.77235 5.79057M19.2276 5.79057C18.0812 5.61744 16.9215 5.48485 15.75 5.39432M3.75 5.95629C4.08957 5.89747 4.43037 5.84221 4.77235 5.79057M4.77235 5.79057C5.91878 5.61744 7.07849 5.48485 8.25 5.39432M15.75 5.39432V4.47819C15.75 3.29882 14.8393 2.31423 13.6606 2.27652C13.1092 2.25889 12.5556 2.25 12 2.25C11.4444 2.25 10.8908 2.25889 10.3394 2.27652C9.16065 2.31423 8.25 3.29882 8.25 4.47819V5.39432M15.75 5.39432C14.5126 5.2987 13.262 5.25 12 5.25C10.738 5.25 9.48744 5.2987 8.25 5.39432",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),kJ=()=>q.jsx("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",children:q.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 12.75c1.148 0 2.278.08 3.383.237 1.037.146 1.866.966 1.866 2.013 0 3.728-2.35 6.75-5.25 6.75S6.75 18.728 6.75 15c0-1.046.83-1.867 1.866-2.013A24.204 24.204 0 0 1 12 12.75Zm0 0c2.883 0 5.647.508 8.207 1.44a23.91 23.91 0 0 1-1.152 6.06M12 12.75c-2.883 0-5.647.508-8.208 1.44.125 2.104.52 4.136 1.153 6.06M12 12.75a2.25 2.25 0 0 0 2.248-2.354M12 12.75a2.25 2.25 0 0 1-2.248-2.354M12 8.25c.995 0 1.971-.08 2.922-.236.403-.066.74-.358.795-.762a3.778 3.778 0 0 0-.399-2.25M12 8.25c-.995 0-1.97-.08-2.922-.236-.402-.066-.74-.358-.795-.762a3.734 3.734 0 0 1 .4-2.253M12 8.25a2.25 2.25 0 0 0-2.248 2.146M12 8.25a2.25 2.25 0 0 1 2.248 2.146M8.683 5a6.032 6.032 0 0 1-1.155-1.002c.07-.63.27-1.222.574-1.747m.581 2.749A3.75 3.75 0 0 1 15.318 5m0 0c.427-.283.815-.62 1.155-.999a4.471 4.471 0 0 0-.575-1.752M4.921 6a24.048 24.048 0 0 0-.392 3.314c1.668.546 3.416.914 5.223 1.082M19.08 6c.205 1.08.337 2.187.392 3.314a23.882 23.882 0 0 1-5.223 1.082"})}),CN=()=>q.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24",children:q.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"})}),_N=({height:n=16,fill:e="currentcolor"})=>q.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:n,viewBox:"4 4 16 16",children:q.jsx("path",{stroke:e,fill:"none",d:"M8 17l9-5-9-5v10z",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"})}),PJ=()=>q.jsx("svg",{width:"24",height:"24",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:q.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5.25 5.653c0-.856.917-1.398 1.667-.986l11.54 6.347a1.125 1.125 0 0 1 0 1.972l-11.54 6.347a1.125 1.125 0 0 1-1.667-.986V5.653Z"})}),xJ=()=>q.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",children:q.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 5.25h.008v.008H12v-.008Z"})}),TJ=()=>q.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24",children:q.jsx("path",{fill:"currentColor",d:"m16.114 1.553 6.333 6.333a1.75 1.75 0 0 1-.603 2.869l-1.63.633a5.67 5.67 0 0 0-3.395 3.725l-1.131 3.959a1.75 1.75 0 0 1-2.92.757L9 16.061l-5.595 5.594a.749.749 0 1 1-1.06-1.06L7.939 15l-3.768-3.768a1.75 1.75 0 0 1 .757-2.92l3.959-1.131a5.666 5.666 0 0 0 3.725-3.395l.633-1.63a1.75 1.75 0 0 1 2.869-.603ZM5.232 10.171l8.597 8.597a.25.25 0 0 0 .417-.108l1.131-3.959A7.17 7.17 0 0 1 19.67 9.99l1.63-.634a.25.25 0 0 0 .086-.409l-6.333-6.333a.25.25 0 0 0-.409.086l-.634 1.63a7.17 7.17 0 0 1-4.711 4.293L5.34 9.754a.25.25 0 0 0-.108.417Z"})}),CJ=()=>q.jsx("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",children:q.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 12.75V12A2.25 2.25 0 0 1 4.5 9.75h15A2.25 2.25 0 0 1 21.75 12v.75m-8.69-6.44-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44Z"})}),_J=()=>q.jsx("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",children:q.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"})}),EJ=()=>q.jsx("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"none",children:q.jsx("path",{d:"M3 3h18v18H3V3zm16.525 13.707c-.131-.821-.666-1.511-2.252-2.155-.552-.259-1.165-.438-1.349-.854-.068-.248-.078-.382-.034-.529.113-.484.687-.629 1.137-.495.293.09.563.315.732.676.775-.507.775-.507 1.316-.844-.203-.314-.304-.451-.439-.586-.473-.528-1.103-.798-2.126-.775l-.528.067c-.507.124-.991.395-1.283.754-.855.968-.608 2.655.427 3.354 1.023.765 2.521.933 2.712 1.653.18.878-.652 1.159-1.475 1.058-.607-.136-.945-.439-1.316-1.002l-1.372.788c.157.359.337.517.607.832 1.305 1.316 4.568 1.249 5.153-.754.021-.067.18-.528.056-1.237l.034.049zm-6.737-5.434h-1.686c0 1.453-.007 2.898-.007 4.354 0 .924.047 1.772-.104 2.033-.247.517-.886.451-1.175.359-.297-.146-.448-.349-.623-.641-.047-.078-.082-.146-.095-.146l-1.368.844c.229.473.563.879.994 1.137.641.383 1.502.507 2.404.305.588-.17 1.095-.519 1.358-1.059.384-.697.302-1.553.299-2.509.008-1.541 0-3.083 0-4.635l.003-.042z"})}),RJ=()=>q.jsx("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"none",children:q.jsx("path",{d:"M3 3h18v18H3V3m10.71 14.86c.5.98 1.51 1.73 3.09 1.73 1.6 0 2.8-.83 2.8-2.36 0-1.41-.81-2.04-2.25-2.66l-.42-.18c-.73-.31-1.04-.52-1.04-1.02 0-.41.31-.73.81-.73.48 0 .8.21 1.09.73l1.31-.87c-.55-.96-1.33-1.33-2.4-1.33-1.51 0-2.48.96-2.48 2.23 0 1.38.81 2.03 2.03 2.55l.42.18c.78.34 1.24.55 1.24 1.13 0 .48-.45.83-1.15.83-.83 0-1.31-.43-1.67-1.03l-1.38.8M13 11.25H8v1.5h1.5V20h1.75v-7.25H13v-1.5z"})}),AJ=()=>q.jsx("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"none",children:q.jsx("path",{d:"M14.23 12.004a2.236 2.236 0 01-2.235 2.236 2.236 2.236 0 01-2.236-2.236 2.236 2.236 0 012.235-2.236 2.236 2.236 0 012.236 2.236zm2.648-10.69c-1.346 0-3.107.96-4.888 2.622-1.78-1.653-3.542-2.602-4.887-2.602-.41 0-.783.093-1.106.278-1.375.793-1.683 3.264-.973 6.365C1.98 8.917 0 10.42 0 12.004c0 1.59 1.99 3.097 5.043 4.03-.704 3.113-.39 5.588.988 6.38.32.187.69.275 1.102.275 1.345 0 3.107-.96 4.888-2.624 1.78 1.654 3.542 2.603 4.887 2.603.41 0 .783-.09 1.106-.275 1.374-.792 1.683-3.263.973-6.365C22.02 15.096 24 13.59 24 12.004c0-1.59-1.99-3.097-5.043-4.032.704-3.11.39-5.587-.988-6.38a2.167 2.167 0 00-1.092-.278zm-.005 1.09v.006c.225 0 .406.044.558.127.666.382.955 1.835.73 3.704-.054.46-.142.945-.25 1.44a23.476 23.476 0 00-3.107-.534A23.892 23.892 0 0012.769 4.7c1.592-1.48 3.087-2.292 4.105-2.295zm-9.77.02c1.012 0 2.514.808 4.11 2.28-.686.72-1.37 1.537-2.02 2.442a22.73 22.73 0 00-3.113.538 15.02 15.02 0 01-.254-1.42c-.23-1.868.054-3.32.714-3.707.19-.09.4-.127.563-.132zm4.882 3.05c.455.468.91.992 1.36 1.564-.44-.02-.89-.034-1.345-.034-.46 0-.915.01-1.36.034.44-.572.895-1.096 1.345-1.565zM12 8.1c.74 0 1.477.034 2.202.093.406.582.802 1.203 1.183 1.86.372.64.71 1.29 1.018 1.946-.308.655-.646 1.31-1.013 1.95-.38.66-.773 1.288-1.18 1.87a25.64 25.64 0 01-4.412.005 26.64 26.64 0 01-1.183-1.86c-.372-.64-.71-1.29-1.018-1.946a25.17 25.17 0 011.013-1.954c.38-.66.773-1.286 1.18-1.868A25.245 25.245 0 0112 8.098zm-3.635.254c-.24.377-.48.763-.704 1.16-.225.39-.435.782-.635 1.174-.265-.656-.49-1.31-.676-1.947.64-.15 1.315-.283 2.015-.386zm7.26 0c.695.103 1.365.23 2.006.387-.18.632-.405 1.282-.66 1.933a25.952 25.952 0 00-1.345-2.32zm3.063.675c.484.15.944.317 1.375.498 1.732.74 2.852 1.708 2.852 2.476-.005.768-1.125 1.74-2.857 2.475-.42.18-.88.342-1.355.493a23.966 23.966 0 00-1.1-2.98c.45-1.017.81-2.01 1.085-2.964zm-13.395.004c.278.96.645 1.957 1.1 2.98a23.142 23.142 0 00-1.086 2.964c-.484-.15-.944-.318-1.37-.5-1.732-.737-2.852-1.706-2.852-2.474 0-.768 1.12-1.742 2.852-2.476.42-.18.88-.342 1.356-.494zm11.678 4.28c.265.657.49 1.312.676 1.948-.64.157-1.316.29-2.016.39a25.819 25.819 0 001.341-2.338zm-9.945.02c.2.392.41.783.64 1.175.23.39.465.772.705 1.143a22.005 22.005 0 01-2.006-.386c.18-.63.406-1.282.66-1.933zM17.92 16.32c.112.493.2.968.254 1.423.23 1.868-.054 3.32-.714 3.708-.147.09-.338.128-.563.128-1.012 0-2.514-.807-4.11-2.28.686-.72 1.37-1.536 2.02-2.44 1.107-.118 2.154-.3 3.113-.54zm-11.83.01c.96.234 2.006.415 3.107.532.66.905 1.345 1.727 2.035 2.446-1.595 1.483-3.092 2.295-4.11 2.295a1.185 1.185 0 01-.553-.132c-.666-.38-.955-1.834-.73-3.703.054-.46.142-.944.25-1.438zm4.56.64c.44.02.89.034 1.345.034.46 0 .915-.01 1.36-.034-.44.572-.895 1.095-1.345 1.565-.455-.47-.91-.993-1.36-1.565z"})}),$J=()=>q.jsx("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"none",children:q.jsx("path",{d:"M10.354 21.125a4.44 4.44 0 01-4.765-1.767 4.109 4.109 0 01-.703-3.107 3.898 3.898 0 01.134-.522l.105-.321.287.21a7.21 7.21 0 002.186 1.092l.208.063-.02.208a1.253 1.253 0 00.226.83 1.337 1.337 0 001.435.533 1.231 1.231 0 00.343-.15l5.59-3.562a1.164 1.164 0 00.524-.778 1.242 1.242 0 00-.211-.937 1.338 1.338 0 00-1.435-.533 1.23 1.23 0 00-.343.15l-2.133 1.36a4.078 4.078 0 01-1.135.499 4.44 4.44 0 01-4.765-1.766 4.108 4.108 0 01-.702-3.108 3.855 3.855 0 011.742-2.582l5.589-3.563a4.072 4.072 0 011.135-.499 4.44 4.44 0 014.765 1.767 4.109 4.109 0 01.703 3.107 3.943 3.943 0 01-.134.522l-.105.321-.286-.21a7.204 7.204 0 00-2.187-1.093l-.208-.063.02-.207a1.255 1.255 0 00-.226-.831 1.337 1.337 0 00-1.435-.532 1.231 1.231 0 00-.343.15L8.62 9.368a1.162 1.162 0 00-.524.778 1.24 1.24 0 00.211.937 1.338 1.338 0 001.435.533 1.235 1.235 0 00.344-.151l2.132-1.36a4.067 4.067 0 011.135-.498 4.44 4.44 0 014.765 1.766 4.108 4.108 0 01.702 3.108 3.857 3.857 0 01-1.742 2.583l-5.589 3.562a4.072 4.072 0 01-1.135.499m10.358-17.95C18.484-.015 14.082-.96 10.9 1.068L5.31 4.63a6.412 6.412 0 00-2.896 4.295 6.753 6.753 0 00.666 4.336 6.43 6.43 0 00-.96 2.396 6.833 6.833 0 001.168 5.167c2.229 3.19 6.63 4.135 9.812 2.108l5.59-3.562a6.41 6.41 0 002.896-4.295 6.756 6.756 0 00-.665-4.336 6.429 6.429 0 00.958-2.396 6.831 6.831 0 00-1.167-5.168z"})}),MJ=()=>q.jsx("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"none",children:q.jsx("path",{d:"M4.136 3.012h15.729l-1.431 16.15-6.451 1.826-6.414-1.826-1.433-16.15zm5.266 7.302l-.173-2.035 7.533.002.173-1.963-9.87-.002.522 5.998h6.835l-.243 2.566-2.179.602-2.214-.605-.141-1.58H7.691l.247 3.123L12 17.506l4.028-1.08.558-6.111H9.402v-.001z"})}),QJ=()=>q.jsx("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"none",children:q.jsx("path",{d:"M4.192 3.143h15.615l-1.42 16.034-6.404 1.812-6.369-1.813L4.192 3.143zM16.9 6.424l-9.8-.002.158 1.949 7.529.002-.189 2.02H9.66l.179 1.913h4.597l-.272 2.62-2.164.598-2.197-.603-.141-1.569h-1.94l.216 2.867L12 17.484l3.995-1.137.905-9.923z"})}),DJ=()=>q.jsx("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"none",children:q.jsx("path",{d:"M5 3h2v2H5v5a2 2 0 01-2 2 2 2 0 012 2v5h2v2H5c-1.07-.27-2-.9-2-2v-4a2 2 0 00-2-2H0v-2h1a2 2 0 002-2V5a2 2 0 012-2m14 0a2 2 0 012 2v4a2 2 0 002 2h1v2h-1a2 2 0 00-2 2v4a2 2 0 01-2 2h-2v-2h2v-5a2 2 0 012-2 2 2 0 01-2-2V5h-2V3h2m-7 12a1 1 0 011 1 1 1 0 01-1 1 1 1 0 01-1-1 1 1 0 011-1m-4 0a1 1 0 011 1 1 1 0 01-1 1 1 1 0 01-1-1 1 1 0 011-1m8 0a1 1 0 011 1 1 1 0 01-1 1 1 1 0 01-1-1 1 1 0 011-1z"})}),IJ=()=>q.jsx("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"none",children:q.jsx("path",{d:"M20.56 18H3.44C2.65 18 2 17.37 2 16.59V7.41C2 6.63 2.65 6 3.44 6h17.12c.79 0 1.44.63 1.44 1.41v9.18c0 .78-.65 1.41-1.44 1.41M6.81 15.19v-3.66l1.92 2.35 1.92-2.35v3.66h1.93V8.81h-1.93l-1.92 2.35-1.92-2.35H4.89v6.38h1.92M19.69 12h-1.92V8.81h-1.92V12h-1.93l2.89 3.28L19.69 12z"})}),EN=n=>(n.children&&(n.children.sort((e,t)=>{const r=e.file?1:0,i=t.file?1:0;return r-i||e.name.localeCompare(t.name)}),n.children.forEach(EN)),n);function jJ(n){const e=n.split(".");switch(e[e.length-1]){case"jsx":case"tsx":return q.jsx(AJ,{});case"js":return q.jsx(EJ,{});case"ts":return q.jsx(RJ,{});case"json":return q.jsx(DJ,{});case"md":return q.jsx(IJ,{});case"html":return q.jsx(MJ,{});case"css":return q.jsx(QJ,{});case"svelte":return q.jsx($J,{});default:return q.jsx(CN,{})}}const zk=({name:n})=>q.jsx("i",{className:"file-icon",children:L.useMemo(()=>jJ(n),[n])}),NJ=({show:n,onClose:e,onConfirm:t,isDirectory:r,name:i})=>{const s=L.useCallback(o=>{o.key==="Enter"&&t()},[t]);return L.useEffect(()=>(n?window.addEventListener("keydown",s):window.removeEventListener("keydown",s),()=>{window.removeEventListener("keydown",s)}),[n,s]),q.jsxs(dr,{show:n,onHide:e,centered:!0,children:[q.jsx(dr.Header,{closeButton:!0,onClick:e,children:q.jsxs(dr.Title,{children:["Delete ",r?"Directory":"File"]})}),q.jsx(dr.Body,{children:q.jsxs("p",{children:["This will delete the"," ",r?"directory":"file"," ",q.jsx("strong",{children:i}),"."]})}),q.jsxs(dr.Footer,{children:[q.jsx(Rc,{variant:"secondary",type:"button",onClick:e,children:"Cancel"}),q.jsx(Rc,{variant:"primary",onClick:t,children:"Delete"})]})]})},LJ=!0,RN=({id:n,name:e,children:t,handleClick:r,handleDoubleClick:i,handleRenameClick:s,handleDeleteClick:o,isDirectory:a=!1,isActive:l=!1,renameFileTooltipText:c=a?"Rename Directory":"Rename File",deleteFileTooltipText:u=a?"Delete Directory":"Delete File"})=>{const{hoveredItemId:d,setHoveredItemId:h}=L.useContext(ni),m=d===n,g=L.useCallback(ue=>{h(ue?n:null)},[n,h]),[O,y]=L.useState(!1),[b,S]=L.useState(""),[P,k]=L.useState(!1),x=L.useRef(null),A=L.useCallback(ue=>{ue.key==="Escape"?y(!1):ue.key==="Enter"&&x.current.blur()},[]),M=L.useCallback(()=>{y(!1),x.current.value.trim()===""?k(!0):s(x.current.value)},[s]),Q=L.useCallback(ue=>{ue.stopPropagation(),y(!O),S(e)},[e,O]);L.useEffect(()=>{O&&x.current.focus()},[O]);const _=L.useCallback(ue=>{ue.stopPropagation(),k(!0)},[]),R=L.useCallback(()=>{k(!1)},[]),$=L.useCallback(ue=>{ue==null||ue.stopPropagation(),k(!1),o()},[o]),D=L.useCallback(()=>{g(!0)},[]),F=L.useCallback(()=>{g(!1)},[]),G=L.useCallback(()=>{S(x.current.value)},[]);return q.jsxs("div",{className:`file-or-directory user-select-none ${l?"active-file":""}`,onClick:O?null:r,onDoubleClick:O||!i?null:i,onMouseEnter:D,onMouseLeave:F,children:[q.jsx("div",{className:"name",children:O?q.jsxs(q.Fragment,{children:[q.jsx(zk,{name:b}),q.jsx("input",{className:"rename-input",ref:x,type:"text","aria-label":"Field name",value:b,onKeyDown:A,onBlur:M,onChange:G})]}):t}),m&&!O?q.jsxs("div",{className:"utils",style:{position:"relative"},children:[!a||LJ?q.jsx(Rs,{placement:"top",overlay:q.jsx(As,{id:"rename-file-tooltip",children:c}),children:q.jsx("i",{onClick:Q,className:"icon-button icon-button-dark",children:q.jsx(yJ,{})})}):null,q.jsx(Rs,{placement:"top",overlay:q.jsx(As,{id:"delete-file-tooltip",children:u}),children:q.jsx("i",{onClick:_,className:"icon-button icon-button-dark",children:q.jsx(wJ,{})})})]}):null,P&&q.jsx(NJ,{show:P,onClose:R,onConfirm:$,isDirectory:a,name:e})]})},qJ=({name:n,path:e,children:t,handleFileClick:r,handleFileDoubleClick:i})=>{const{renameDirectory:s,deleteDirectory:o,isDirectoryOpen:a,toggleDirectory:l,sidebarPresenceIndicators:c}=L.useContext(ni),u=L.useCallback(()=>{l(e)},[l,e]),d=L.useCallback(()=>{o(e)},[o,e]),h=L.useCallback(g=>{s(e,n,g)},[s,e,n]),m=L.useMemo(()=>a(e),[a,e]);return q.jsxs(q.Fragment,{children:[q.jsxs(RN,{id:e,name:n,handleClick:u,handleDeleteClick:d,handleRenameClick:h,isDirectory:!0,children:[q.jsx("div",{className:"arrow-wrapper",style:{transform:`rotate(${m?90:0}deg)`},children:q.jsx(_N,{})}),q.jsx("div",{className:"name",children:n})]}),t&&m?q.jsx("div",{className:"indentation",children:t.map(g=>{const{fileId:O}=g,{path:y}=g;return q.jsx($N,{entity:g,handleFileClick:r,handleFileDoubleClick:i},O||y)})}):null]})};var zt=function(n,e,t){if(!e.has(n))throw new TypeError("attempted to set private field on non-instance");return e.set(n,t),t},vt=function(n,e){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return e.get(n)},nl,uc,io,Su,Pd,Eo,Ro,Ao,$o,Mo,Qo,Do,Io,fc,wu,rl,Ng,il;const UJ=function(n){var e=131,t=137,r=0;n+="x";var i=Math.floor(9007199254740991/t);for(let s=0;s<n.length;s++)r>i&&(r=Math.floor(r/t)),r=r*e+n.charCodeAt(s);return r},Tt="0123456789abcdef".split(""),BJ=[-2147483648,8388608,32768,128],ro=[24,16,8,0],rg=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],ai=[];class FJ{constructor(e=!1,t=!1){nl.set(this,void 0),uc.set(this,void 0),io.set(this,void 0),Su.set(this,void 0),Pd.set(this,void 0),Eo.set(this,void 0),Ro.set(this,void 0),Ao.set(this,void 0),$o.set(this,void 0),Mo.set(this,void 0),Qo.set(this,void 0),Do.set(this,void 0),Io.set(this,void 0),fc.set(this,void 0),wu.set(this,void 0),rl.set(this,void 0),Ng.set(this,0),il.set(this,void 0),this.init(e,t)}init(e,t){t?(ai[0]=ai[16]=ai[1]=ai[2]=ai[3]=ai[4]=ai[5]=ai[6]=ai[7]=ai[8]=ai[9]=ai[10]=ai[11]=ai[12]=ai[13]=ai[14]=ai[15]=0,zt(this,uc,ai)):zt(this,uc,[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),e?(zt(this,Eo,3238371032),zt(this,Ro,914150663),zt(this,Ao,812702999),zt(this,$o,4144912697),zt(this,Mo,4290775857),zt(this,Qo,1750603025),zt(this,Do,1694076839),zt(this,Io,3204075428)):(zt(this,Eo,1779033703),zt(this,Ro,3144134277),zt(this,Ao,1013904242),zt(this,$o,2773480762),zt(this,Mo,1359893119),zt(this,Qo,2600822924),zt(this,Do,528734635),zt(this,Io,1541459225)),zt(this,nl,zt(this,il,zt(this,io,zt(this,wu,0)))),zt(this,Su,zt(this,fc,!1)),zt(this,Pd,!0),zt(this,rl,e)}update(e){if(vt(this,Su))return this;let t;e instanceof ArrayBuffer?t=new Uint8Array(e):t=e;let r=0;const i=t.length,s=vt(this,uc);for(;r<i;){let o;if(vt(this,fc)&&(zt(this,fc,!1),s[0]=vt(this,nl),s[16]=s[1]=s[2]=s[3]=s[4]=s[5]=s[6]=s[7]=s[8]=s[9]=s[10]=s[11]=s[12]=s[13]=s[14]=s[15]=0),typeof t!="string")for(o=vt(this,il);r<i&&o<64;++r)s[o>>2]|=t[r]<<ro[o++&3];else for(o=vt(this,il);r<i&&o<64;++r){let a=t.charCodeAt(r);a<128?s[o>>2]|=a<<ro[o++&3]:a<2048?(s[o>>2]|=(192|a>>6)<<ro[o++&3],s[o>>2]|=(128|a&63)<<ro[o++&3]):a<55296||a>=57344?(s[o>>2]|=(224|a>>12)<<ro[o++&3],s[o>>2]|=(128|a>>6&63)<<ro[o++&3],s[o>>2]|=(128|a&63)<<ro[o++&3]):(a=65536+((a&1023)<<10|t.charCodeAt(++r)&1023),s[o>>2]|=(240|a>>18)<<ro[o++&3],s[o>>2]|=(128|a>>12&63)<<ro[o++&3],s[o>>2]|=(128|a>>6&63)<<ro[o++&3],s[o>>2]|=(128|a&63)<<ro[o++&3])}zt(this,Ng,o),zt(this,io,vt(this,io)+(o-vt(this,il))),o>=64?(zt(this,nl,s[16]),zt(this,il,o-64),this.hash(),zt(this,fc,!0)):zt(this,il,o)}return vt(this,io)>4294967295&&(zt(this,wu,vt(this,wu)+(vt(this,io)/4294967296<<0)),zt(this,io,vt(this,io)%4294967296)),this}finalize(){if(vt(this,Su))return;zt(this,Su,!0);const e=vt(this,uc),t=vt(this,Ng);e[16]=vt(this,nl),e[t>>2]|=BJ[t&3],zt(this,nl,e[16]),t>=56&&(vt(this,fc)||this.hash(),e[0]=vt(this,nl),e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=vt(this,wu)<<3|vt(this,io)>>>29,e[15]=vt(this,io)<<3,this.hash()}hash(){let e=vt(this,Eo),t=vt(this,Ro),r=vt(this,Ao),i=vt(this,$o),s=vt(this,Mo),o=vt(this,Qo),a=vt(this,Do),l=vt(this,Io);const c=vt(this,uc);let u,d,h,m,g,O,y,b,S,P;for(let k=16;k<64;++k)m=c[k-15],u=(m>>>7|m<<25)^(m>>>18|m<<14)^m>>>3,m=c[k-2],d=(m>>>17|m<<15)^(m>>>19|m<<13)^m>>>10,c[k]=c[k-16]+u+c[k-7]+d<<0;P=t&r;for(let k=0;k<64;k+=4)vt(this,Pd)?(vt(this,rl)?(y=300032,m=c[0]-1413257819,l=m-150054599<<0,i=m+24177077<<0):(y=704751109,m=c[0]-210244248,l=m-1521486534<<0,i=m+143694565<<0),zt(this,Pd,!1)):(u=(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10),d=(s>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7),y=e&t,h=y^e&r^P,O=s&o^~s&a,m=l+d+O+rg[k]+c[k],g=u+h,l=i+m<<0,i=m+g<<0),u=(i>>>2|i<<30)^(i>>>13|i<<19)^(i>>>22|i<<10),d=(l>>>6|l<<26)^(l>>>11|l<<21)^(l>>>25|l<<7),b=i&e,h=b^i&t^y,O=l&s^~l&o,m=a+d+O+rg[k+1]+c[k+1],g=u+h,a=r+m<<0,r=m+g<<0,u=(r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10),d=(a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7),S=r&i,h=S^r&e^b,O=a&l^~a&s,m=o+d+O+rg[k+2]+c[k+2],g=u+h,o=t+m<<0,t=m+g<<0,u=(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10),d=(o>>>6|o<<26)^(o>>>11|o<<21)^(o>>>25|o<<7),P=t&r,h=P^t&i^S,O=o&a^~o&l,m=s+d+O+rg[k+3]+c[k+3],g=u+h,s=e+m<<0,e=m+g<<0;zt(this,Eo,vt(this,Eo)+e<<0),zt(this,Ro,vt(this,Ro)+t<<0),zt(this,Ao,vt(this,Ao)+r<<0),zt(this,$o,vt(this,$o)+i<<0),zt(this,Mo,vt(this,Mo)+s<<0),zt(this,Qo,vt(this,Qo)+o<<0),zt(this,Do,vt(this,Do)+a<<0),zt(this,Io,vt(this,Io)+l<<0)}hex(){this.finalize();const e=vt(this,Eo),t=vt(this,Ro),r=vt(this,Ao),i=vt(this,$o),s=vt(this,Mo),o=vt(this,Qo),a=vt(this,Do),l=vt(this,Io);let c=Tt[e>>28&15]+Tt[e>>24&15]+Tt[e>>20&15]+Tt[e>>16&15]+Tt[e>>12&15]+Tt[e>>8&15]+Tt[e>>4&15]+Tt[e&15]+Tt[t>>28&15]+Tt[t>>24&15]+Tt[t>>20&15]+Tt[t>>16&15]+Tt[t>>12&15]+Tt[t>>8&15]+Tt[t>>4&15]+Tt[t&15]+Tt[r>>28&15]+Tt[r>>24&15]+Tt[r>>20&15]+Tt[r>>16&15]+Tt[r>>12&15]+Tt[r>>8&15]+Tt[r>>4&15]+Tt[r&15]+Tt[i>>28&15]+Tt[i>>24&15]+Tt[i>>20&15]+Tt[i>>16&15]+Tt[i>>12&15]+Tt[i>>8&15]+Tt[i>>4&15]+Tt[i&15]+Tt[s>>28&15]+Tt[s>>24&15]+Tt[s>>20&15]+Tt[s>>16&15]+Tt[s>>12&15]+Tt[s>>8&15]+Tt[s>>4&15]+Tt[s&15]+Tt[o>>28&15]+Tt[o>>24&15]+Tt[o>>20&15]+Tt[o>>16&15]+Tt[o>>12&15]+Tt[o>>8&15]+Tt[o>>4&15]+Tt[o&15]+Tt[a>>28&15]+Tt[a>>24&15]+Tt[a>>20&15]+Tt[a>>16&15]+Tt[a>>12&15]+Tt[a>>8&15]+Tt[a>>4&15]+Tt[a&15];return vt(this,rl)||(c+=Tt[l>>28&15]+Tt[l>>24&15]+Tt[l>>20&15]+Tt[l>>16&15]+Tt[l>>12&15]+Tt[l>>8&15]+Tt[l>>4&15]+Tt[l&15]),c}toString(){return this.hex()}digest(){this.finalize();const e=vt(this,Eo),t=vt(this,Ro),r=vt(this,Ao),i=vt(this,$o),s=vt(this,Mo),o=vt(this,Qo),a=vt(this,Do),l=vt(this,Io),c=[e>>24&255,e>>16&255,e>>8&255,e&255,t>>24&255,t>>16&255,t>>8&255,t&255,r>>24&255,r>>16&255,r>>8&255,r&255,i>>24&255,i>>16&255,i>>8&255,i&255,s>>24&255,s>>16&255,s>>8&255,s&255,o>>24&255,o>>16&255,o>>8&255,o&255,a>>24&255,a>>16&255,a>>8&255,a&255];return vt(this,rl)||c.push(l>>24&255,l>>16&255,l>>8&255,l&255),c}array(){return this.digest()}arrayBuffer(){this.finalize();const e=new ArrayBuffer(vt(this,rl)?28:32),t=new DataView(e);return t.setUint32(0,vt(this,Eo)),t.setUint32(4,vt(this,Ro)),t.setUint32(8,vt(this,Ao)),t.setUint32(12,vt(this,$o)),t.setUint32(16,vt(this,Mo)),t.setUint32(20,vt(this,Qo)),t.setUint32(24,vt(this,Do)),vt(this,rl)||t.setUint32(28,vt(this,Io)),e}}nl=new WeakMap,uc=new WeakMap,io=new WeakMap,Su=new WeakMap,Pd=new WeakMap,Eo=new WeakMap,Ro=new WeakMap,Ao=new WeakMap,$o=new WeakMap,Mo=new WeakMap,Qo=new WeakMap,Do=new WeakMap,Io=new WeakMap,fc=new WeakMap,wu=new WeakMap,rl=new WeakMap,Ng=new WeakMap,il=new WeakMap;function VJ(n){const e=new FJ;return e.update(n),parseInt(e.hex().substring(0,8),16)}const ZJ=function(n){var e="#";return n.forEach(function(t){t<16&&(e+=0),e+=t.toString(16)}),e},WJ=function(n,e,t){n/=360;var r=t<.5?t*(1+e):t+e-t*e,i=2*t-r;return[n+1/3,n,n-1/3].map(function(s){return s<0&&s++,s>1&&s--,s<1/6?s=i+(r-i)*6*s:s<.5?s=r:s<2/3?s=i+(r-i)*6*(2/3-s):s=i,Math.round(s*255)})};class XJ{constructor(e={}){const[t,r]=[e.lightness,e.saturation].map(function(i){return i=i!==void 0?i:[.35,.5,.65],Array.isArray(i)?i.concat():[i]});this.L=t,this.S=r,typeof e.hue=="number"&&(e.hue={min:e.hue,max:e.hue}),typeof e.hue=="object"&&!Array.isArray(e.hue)&&(e.hue=[e.hue]),typeof e.hue>"u"&&(e.hue=[]),this.hueRanges=e.hue.map(function(i){return{min:typeof i.min>"u"?0:i.min,max:typeof i.max>"u"?360:i.max}}),this.hash=VJ,typeof e.hash=="function"&&(this.hash=e.hash),e.hash==="bkdr"&&(this.hash=UJ)}hsl(e){var t,r,i,s=this.hash(e),o=727;if(this.hueRanges.length){const a=this.hueRanges[s%this.hueRanges.length];t=s/this.hueRanges.length%o*(a.max-a.min)/o+a.min}else t=s%359;return s=Math.ceil(s/360),r=this.S[s%this.S.length],s=Math.ceil(s/this.S.length),i=this.L[s%this.L.length],[t,r,i]}rgb(e){var t=this.hsl(e);return WJ.apply(this,t)}hex(e){var t=this.rgb(e);return ZJ(t)}}const AN=n=>new XJ({lightness:.75}).rgb(n).join(","),zJ=({presence:n})=>q.jsx("div",{className:"presence-indicators",children:n.map((e,t)=>{const i=`rgb(${AN(e.username)})`;return q.jsx("div",{className:"presence-indicator",style:{backgroundColor:i},children:e.username[0]},t)})}),YJ=({name:n,fileId:e,handleFileClick:t,handleFileDoubleClick:r,isActive:i,presence:s})=>{const{renameFile:o,deleteFile:a}=L.useContext(ni),l=L.useCallback(()=>{t(e)},[e,t]),c=L.useCallback(()=>{r(e)},[e,r]),u=L.useCallback(()=>{a(e)},[e,a]),d=L.useCallback(h=>{o(e,h)},[e,o]);return q.jsxs(RN,{id:e,name:n,handleClick:l,handleDoubleClick:c,handleDeleteClick:u,handleRenameClick:d,isActive:i,children:[q.jsx(zJ,{presence:s}),q.jsx(zk,{name:n}),n]})},$N=({entity:n,handleFileClick:e,handleFileDoubleClick:t})=>{const{activePane:r,sidebarPresenceIndicators:i}=L.useContext(ni),{name:s,file:o,fileId:a}=n,{path:l,children:c}=n,u=(i==null?void 0:i.filter(d=>d.fileId===a))||[];return o?q.jsx(YJ,{fileId:a,name:s,handleFileClick:e,handleFileDoubleClick:t,isActive:a===r.activeFileId,presence:u}):q.jsx(qJ,{name:s,path:l,children:c,handleFileClick:e,handleFileDoubleClick:t})};function i$(n,e,t,r){const i=n.state.doc.line(t).from+r;n.dispatch({selection:{anchor:i,head:i+e.length},scrollIntoView:!0,effects:et.scrollIntoView(i,{y:"center"})})}function s$(n,e){const t=n.scrollTop,r=t+n.clientHeight,i=e.offsetTop-n.offsetTop,s=i+e.clientHeight;return i>=t+100&&s<=r-100}const GJ=()=>{const[n,e]=L.useState(!1),[t,r]=L.useState(!1),{search:i,setSearch:s,activePaneId:o,setActiveFileId:a,setSearchResults:l,setSearchFileVisibility:c,setSearchLineVisibility:u,setSearchFocusedIndex:d,shareDBDoc:h,editorCache:m}=L.useContext(ni),{pattern:g,results:O,focusedIndex:y,focusedChildIndex:b,focused:S}=i,P=L.useRef(null),k=Object.entries(O).filter(([_,R])=>R.visibility!=="closed");L.useEffect(()=>{if(n){r(g.trim().length>=1);const _=setTimeout(()=>{g.trim().length>=1&&P.current&&(l(h),r(!1))},2e3);return()=>clearTimeout(_)}else e(!0)},[g]);const x=L.useCallback((_,R)=>{c(h,_,R.visibility==="open"&&b===null?"flattened":"open")},[y,b]),A=L.useCallback(_=>{c(h,_,"closed")},[]),M=L.useCallback((_,R)=>{a(_),d(R,null)},[]),Q=_=>{if(_.preventDefault(),k.length===0)return;const R=k[y][1].matches.length;switch(_.key){case"Tab":d(y,null);break;case"ArrowUp":if(y==0&&b==null)break;if(b===null||R==0){const G=k[y-1][1].matches.length;d(y-1,G>0?G-1:null)}else b===0?d(y,null):d(y,b-1);break;case"ArrowDown":if(y==k.length-1&&b==R-1)break;b===null&&R>0?d(y,0):b==R-1||R==0?d(y+1,null):d(y,b+1);break;case"ArrowLeft":b!==null?d(y,null):x(k[y][0],k[y][1]);break;case"ArrowRight":k[y][1].visibility!=="open"?x(k[y][0],k[y][1]):b===null&&R!==0&&d(y,0);break;case"Enter":case" ":const F=k[y][0];if(a(F),b!==null){const G=k[y][1].matches[b].line,ue=k[y][1].matches[b].index,B=sh(F,o);m.has(B)&&i$(m.get(B).editor,g,G,ue)}break}const $=k[y][0],D=document.getElementById("sidebar-view-container");if(D)if(b===null){const F=document.getElementById($);s$(D,F)||F.scrollIntoView({block:"center"})}else{const F=k[y][1].matches[b].line,G=document.getElementById($+"-"+F);s$(D,G)||G.scrollIntoView({block:"center"})}};return L.useEffect(()=>{P.current&&P.current.focus()},[S]),q.jsxs("div",{children:[q.jsx(xr.Group,{className:"sidebar-search-form mb-3",controlId:"searchName",children:q.jsx(xr.Control,{type:"text",value:g,onChange:_=>s(_.target.value),ref:P,spellCheck:"false"})}),Object.keys(O).length>=1&&g.trim().length>=1?q.jsx("div",{onKeyDown:Q,tabIndex:0,className:"search-results",children:k.map(([_,R],$)=>{const D=R.matches;return q.jsxs("div",{className:"search-result",children:[q.jsxs("div",{onClick:()=>M(_,$),id:_,className:`search-file-heading
|
|
152
|
+
${y==$&&b==null?"active":""}`,children:[q.jsxs("div",{className:"search-file-title",children:[q.jsx("div",{className:"arrow-wrapper",onClick:()=>x(_,R),style:{transform:`rotate(${R.visibility==="open"?90:0}deg)`},children:q.jsx(_N,{})}),q.jsxs("div",{className:"search-file-name",children:[q.jsx(zk,{name:R.name}),q.jsx("h5",{children:R.name})]})]}),q.jsx("div",{className:"search-file-info",children:$==y&&b==null?q.jsx("span",{className:"search-file-close",onClick:F=>{F.stopPropagation(),A(_),d(Math.max(0,$-1),null)},children:q.jsx(xO,{})}):q.jsx("h6",{className:"search-file-count",children:D.length})})]}),q.jsx("div",{className:"search-file-lines",children:(R.visibility==="open"||R.visibility==="flattened"&&$==y&&b!==null)&&R.matches.map((F,G)=>{const ue=F.text.substring(0,F.index),B=F.text.substring(F.index,F.index+g.length),X=F.text.substring(F.index+g.length),W=R.name+"-"+F.line;return q.jsxs("div",{tabIndex:$==y?0:-1,id:_+"-"+F.line,className:`search-line
|
|
153
|
+
${y==$&&b==G?"active":""}`,children:[q.jsxs("p",{onClick:()=>{d($,G);const ee=sh(_,o);m.has(ee)&&i$(m.get(ee).editor,g,F.line,F.index)},children:[ue,q.jsx("span",{className:"search-pattern",children:B}),X]},R.name+" - "+F.line+" - "+F.index),y==$&&b===G&&q.jsx("span",{className:"search-file-close",onClick:ee=>{ee.stopPropagation(),u(h,_,F.line),G==0&&d($,null)},children:q.jsx(xO,{})})]},W)})})]},R.name)})}):q.jsx("div",{className:"search-state",children:q.jsx("h6",{children:t?"Searching...":"No Results"})})]})},HJ=()=>{const[n,e]=L.useState(!1),{createFile:t}=L.useContext(ni),r=L.useCallback(a=>{a.preventDefault(),a.stopPropagation(),e(!0)},[]),i=L.useCallback(a=>{a.preventDefault(),a.stopPropagation(),n||e(!0)},[n]),s=L.useCallback(a=>{a.preventDefault(),a.stopPropagation(),e(!1)},[]),o=L.useCallback(a=>{a.preventDefault(),a.stopPropagation(),e(!1);const l=a.dataTransfer.items,c=(d,h)=>{d.isFile?d.file(m=>{const g=new FileReader;g.onload=O=>{const y=O.target.result;t(`${h}${m.name}`,y)},g.readAsText(m)}):d.isDirectory&&d.createReader().readEntries(g=>{const O=`${h}${d.name}/`;for(const y of g)c(y,O)})};Array.from(l).forEach(d=>{const h=d.webkitGetAsEntry();h&&c(h,"")})},[t]);return{isDragOver:n,handleDragEnter:r,handleDragOver:i,handleDragLeave:s,handleDrop:o}},KJ=({createFileTooltipText:n=q.jsxs(q.Fragment,{children:[q.jsx("strong",{children:"New file"}),q.jsx("div",{children:"(Alt + N or Ctrl + Shift + N)"})]}),createDirTooltipText:e=q.jsxs("div",{children:[q.jsx("strong",{children:"New Directory"}),q.jsx("div",{children:"(Ctrl + Shift + D)"})]}),openSettingsTooltipText:t=q.jsxs("div",{children:[q.jsx("strong",{children:"Open Settings"}),q.jsx("div",{children:"(Ctrl + Shift + S or Ctrl + ,)"})]}),openKeyboardShortcuts:r=q.jsxs("div",{children:[q.jsx("strong",{children:"Keyboard Shortcuts"}),q.jsx("div",{children:"(Ctrl + Shift + K)"})]}),reportBugTooltipText:i=q.jsx("div",{children:q.jsx("strong",{children:"Report Bug"})}),searchToolTipText:s=q.jsxs("div",{children:[q.jsx("strong",{children:"Search"}),q.jsx("div",{children:"(Ctrl + Shift + F)"})]}),filesToolTipText:o=q.jsxs("div",{children:[q.jsx("strong",{children:"Files"}),q.jsx("div",{children:"(Ctrl + Shift + E)"})]}),enableAutoFollowTooltipText:a=q.jsxs("div",{children:[q.jsx("strong",{children:"Enable Auto Follow"}),q.jsx("div",{children:"(Ctrl + Shift + A)"})]}),disableAutoFollowTooltipText:l=q.jsxs("div",{children:[q.jsx("strong",{children:"Disable Auto Follow"}),q.jsx("div",{children:"(Ctrl + Shift + A)"})]}),voiceChatToolTipText:c=q.jsx("div",{children:q.jsx("strong",{children:"Open Voice Chat Menu"})})})=>{const{files:u,openTab:d,setIsSettingsOpen:h,setIsDocOpen:m,isSearchOpen:g,setIsSearchOpen:O,handleOpenCreateFileModal:y,handleOpenCreateDirModal:b,connected:S,pending:P,sidebarRef:k,enableAutoFollow:x,toggleAutoFollow:A,docPresence:M,updatePresenceIndicator:Q,sidebarPresenceIndicators:_,liveKitConnection:R,setLiveKitConnection:$,setVoiceChatModalOpen:D}=L.useContext(ni),F=L.useMemo(()=>u?EN(OJ(u)):null,[u]),G=L.useCallback(()=>{m(!0)},[]),ue=L.useCallback(()=>{h(!0)},[]),{sidebarWidth:B}=L.useContext(XO),X=L.useCallback(de=>{d({fileId:de,isTransient:!0})},[d]),W=L.useCallback(de=>{d({fileId:de,isTransient:!1})},[d]),ee=F&&F.children&&F.children.length>0,{isDragOver:re,handleDragEnter:H,handleDragOver:se,handleDragLeave:J,handleDrop:oe}=HJ();L.useEffect(()=>{},[]),L.useEffect(()=>{if(M){const de=(ke,Te)=>{const Pe={username:Te.username,fileId:Te.start[1]};Q(Pe)};return M.on("receive",de),()=>{M.off("receive",de)}}},[M]);const[pe,Ee]=L.useState(!1),[j,V]=L.useState(!0),Y=L.useRef(P);return L.useEffect(()=>{j&&S&&V(!1)},[S,j]),L.useEffect(()=>{if(Y.current&&!P&&S&&!j){Ee(!0);const de=setTimeout(()=>{Ee(!1)},1500);return()=>clearTimeout(de)}Y.current=P},[P,S,j]),q.jsxs("div",{className:"vz-sidebar",style:{width:B+"px"},onDragEnter:H,onDragOver:se,onDragLeave:J,onDrop:oe,children:[q.jsxs("div",{className:"full-box",ref:k,tabIndex:-1,children:[q.jsxs("div",{className:"sidebar-section-buttons",children:[q.jsx(Rs,{placement:"right",overlay:q.jsx(As,{id:"files-tooltip",children:o}),children:q.jsx("i",{id:"files-icon",className:"icon-button icon-button-dark",onClick:()=>O(!1),children:q.jsx(CJ,{})})}),q.jsx(Rs,{placement:"right",overlay:q.jsx(As,{id:"search-tooltip",children:s}),children:q.jsx("i",{id:"search-icon",className:"icon-button icon-button-dark",onClick:()=>O(!0),children:q.jsx(_J,{})})}),q.jsx(Rs,{placement:"right",overlay:q.jsx(As,{id:"open-keyboard-shortcuts",children:r}),children:q.jsx("i",{id:"shortcut-icon",className:"icon-button icon-button-dark",onClick:G,children:q.jsx(xJ,{})})}),q.jsx(Rs,{placement:"right",overlay:q.jsx(As,{id:"report-bug-tooltip",children:i}),children:q.jsx("a",{href:"https://github.com/vizhub-core/vzcode/issues/new",target:"_blank",rel:"noopener noreferrer",children:q.jsx("i",{id:"bug-icon",className:"icon-button icon-button-dark",children:q.jsx(kJ,{})})})}),q.jsx(Rs,{placement:"right",overlay:q.jsx(As,{id:"open-settings-tooltip",children:t}),children:q.jsx("i",{id:"settings-icon",className:"icon-button icon-button-dark",onClick:ue,children:q.jsx(SJ,{})})}),q.jsx(Rs,{placement:"right",overlay:q.jsx(As,{id:"create-file-tooltip",children:n}),children:q.jsx("i",{id:"new-file-icon",className:"icon-button icon-button-dark",onClick:y,children:q.jsx(bJ,{})})}),q.jsx(Rs,{placement:"right",overlay:q.jsx(As,{id:"create-dir-tooltip",children:e}),children:q.jsx("i",{id:"new-directory-icon",className:"icon-button icon-button-dark",onClick:b,children:q.jsx(CN,{})})}),q.jsx(Rs,{placement:"right",overlay:q.jsx(As,{id:"toggle-auto-follow",children:x?l:a}),children:q.jsxs("i",{id:"auto-focus-icon",className:`icon-button icon-button-dark${x?" vh-color-success-01":""}`,onClick:A,children:[q.jsx("i",{}),q.jsx(TJ,{})]})}),Jj]}),q.jsx("div",{className:"files",id:"sidebar-view-container",children:g?q.jsx("div",{className:"sidebar-search",children:q.jsx(GJ,{})}):q.jsx("div",{className:"sidebar-files",children:re?q.jsx("div",{className:"empty",children:q.jsx("div",{className:"empty-text",children:"Drop files here!"})}):ee?F.children.map(de=>{const{fileId:ke}=de,{path:Te}=de,Pe=ke||Te;return q.jsx($N,{entity:de,handleFileClick:X,handleFileDoubleClick:W},Pe)}):q.jsx("div",{className:"empty",children:q.jsx("div",{className:"empty-text",children:`It looks like you don't have any files yet! Click the "Create file" button above to create your first file.`})})})})]}),q.jsxs("div",{className:"connection-status",children:[j?"Connecting...":S?P?"Saving...":pe?"Saved.":"Connected":"Connection Lost",q.jsx("div",{className:"connection",children:q.jsx("div",{className:`connection-status-indicator ${j?"pending":S?P?"pending":"connected":"disconnected"}`})})]})]})},JJ=({initialFileName:n=""})=>{const[e,t]=L.useState(n),r=L.useRef(null),{files:i,isCreateDirModalOpen:s,handleCloseCreateDirModal:o,handleCreateDirClick:a}=L.useContext(ni);L.useEffect(()=>{s&&r.current&&r.current.focus()},[s]);const l=L.useCallback(h=>{t(h.target.value)},[]),c=L.useCallback(()=>{a(e),t("")},[e,a]),u=L.useCallback(h=>{let m;m=/^[a-zA-Z0-9](?:[a-zA-Z0-9 ./+=_-]*[a-zA-Z0-9])?$/.test(h);for(const O in i)h+"/"===i[O].name&&(m=!1);return m},[i]),d=L.useCallback(h=>{h.key==="Enter"&&u(e)&&(h.ctrlKey||h.shiftKey||!h.altKey&&!h.metaKey)&&c()},[c,u,e]);return s?q.jsxs(dr,{show:s,onHide:o,animation:!1,onKeyDown:d,children:[q.jsx(dr.Header,{closeButton:!0,children:q.jsx(dr.Title,{children:"Create Directory"})}),q.jsx(dr.Body,{children:q.jsxs(xr.Group,{className:"mb-3",controlId:"fileName",children:[q.jsx(xr.Label,{children:"Directory Name"}),q.jsx(xr.Control,{type:"text",value:e,onChange:l,ref:r,spellCheck:"false"}),q.jsx(xr.Text,{className:"text-muted",children:"Enter the name for your file"})]})}),q.jsx(dr.Footer,{children:q.jsx(Rc,{variant:"primary",onClick:c,disabled:!u(e),children:"Create Directory"})})]}):null},eee=({initialFileName:n=""})=>{const[e,t]=L.useState(n),r=L.useRef(null),{files:i,isCreateFileModalOpen:s,handleCloseCreateFileModal:o,handleCreateFileClick:a}=L.useContext(ni);L.useEffect(()=>{s&&r.current&&r.current.focus()},[s]);const l=L.useCallback(h=>{t(h.target.value)},[]),c=L.useCallback(()=>{a(e),t("")},[e,a]),u=L.useCallback(h=>{let m;m=/^[a-zA-Z0-9](?:[a-zA-Z0-9 ./+=_-]*[a-zA-Z0-9])?$/.test(h);for(const O in i)h===i[O].name&&(m=!1);return m},[i]),d=L.useCallback(h=>{h.key==="Enter"&&u(e)&&(h.ctrlKey||h.shiftKey||!h.altKey&&!h.metaKey)&&c()},[c,u,e]);return s?q.jsxs(dr,{show:s,onHide:o,animation:!1,onKeyDown:d,children:[q.jsx(dr.Header,{closeButton:!0,children:q.jsx(dr.Title,{children:"Create File"})}),q.jsx(dr.Body,{children:q.jsxs(xr.Group,{className:"mb-3",controlId:"fileName",children:[q.jsx(xr.Label,{children:"File Name"}),q.jsx(xr.Control,{type:"text",value:e,onChange:l,ref:r,spellCheck:"false"}),q.jsx(xr.Text,{className:"text-muted",children:"Enter the name for your file"})]})}),q.jsx(dr.Footer,{children:q.jsx(Rc,{variant:"primary",onClick:c,disabled:!u(e),children:"Create File"})})]}):null},tee=({enableUsernameField:n=!0})=>q.jsxs("div",{className:"left",children:[q.jsx(KJ,{}),q.jsx(gJ,{enableUsernameField:n}),q.jsx(dJ,{enableUsernameField:n}),q.jsx(eee,{}),q.jsx(JJ,{}),Jj]}),nee=n=>{const e=n.split("/");return e.length===1?e[e.length-1]:e[e.length-2]+"/"+e[e.length-1]},ree=({fileId:n,isTransient:e,isActive:t,setActiveFileId:r,openTab:i,closeTabs:s,fileName:o})=>{const a=L.useCallback(d=>{d.stopPropagation(),s([n])},[s,n]),l=L.useMemo(()=>nee(o),[o]),c=L.useCallback(()=>{r(n)},[n,r]),u=L.useCallback(()=>{i({fileId:n})},[n,i]);return q.jsxs("div",{className:`tab user-select-none ${t?"active":""} ${e?"transient":""}`,onClick:c,onDoubleClick:u,children:[l,q.jsx("i",{className:"icon-button icon-button-dark",onClick:a,children:q.jsx(xO,{})})]})},iee=({activeFileId:n,tabList:e})=>{const{files:t,setActiveFileId:r,openTab:i,closeTabs:s}=L.useContext(ni);return q.jsx("div",{className:"vz-tab-list",children:t&&e.filter(o=>o.fileId in t).map(o=>q.jsx(ree,{fileId:o.fileId,isTransient:o.isTransient,isActive:o.fileId===n,setActiveFileId:r,openTab:i,closeTabs:s,fileName:t[o.fileId].name},o.fileId))})};var o$={};class TO{constructor(e,t,r,i,s,o,a,l,c,u=0,d){this.p=e,this.stack=t,this.state=r,this.reducePos=i,this.pos=s,this.score=o,this.buffer=a,this.bufferBase=l,this.curContext=c,this.lookAhead=u,this.parent=d}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,r=0){let i=e.parser.context;return new TO(e,[],t,r,r,0,[],0,i?new a$(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let r=e>>19,i=e&65535,{parser:s}=this.p,o=this.reducePos<this.pos-25;o&&this.setLookAhead(this.pos);let a=s.dynamicPrecedence(i);if(a&&(this.score+=a),r==0){this.pushState(s.getGoto(this.state,i,!0),this.reducePos),i<s.minRepeatTerm&&this.storeNode(i,this.reducePos,this.reducePos,o?8:4,!0),this.reduceContext(i,this.reducePos);return}let l=this.stack.length-(r-1)*3-(e&262144?6:0),c=l?this.stack[l-2]:this.p.ranges[0].from,u=this.reducePos-c;u>=2e3&&!(!((t=this.p.parser.nodeSet.types[i])===null||t===void 0)&&t.isAnonymous)&&(c==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=u):this.p.lastBigReductionSize<u&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=c,this.p.lastBigReductionSize=u));let d=l?this.stack[l-1]:0,h=this.bufferBase+this.buffer.length-d;if(i<s.minRepeatTerm||e&131072){let m=s.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(i,c,m,h+4,!0)}if(e&262144)this.state=this.stack[l];else{let m=this.stack[l-3];this.state=s.getGoto(m,i,!0)}for(;this.stack.length>l;)this.stack.pop();this.reduceContext(i,c)}storeNode(e,t,r,i=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let o=this,a=this.buffer.length;if(a==0&&o.parent&&(a=o.bufferBase-o.parent.bufferBase,o=o.parent),a>0&&o.buffer[a-4]==0&&o.buffer[a-1]>-1){if(t==r)return;if(o.buffer[a-2]>=t){o.buffer[a-2]=r;return}}}if(!s||this.pos==r)this.buffer.push(e,t,r,i);else{let o=this.buffer.length;if(o>0&&this.buffer[o-4]!=0){let a=!1;for(let l=o;l>0&&this.buffer[l-2]>r;l-=4)if(this.buffer[l-1]>=0){a=!0;break}if(a)for(;o>0&&this.buffer[o-2]>r;)this.buffer[o]=this.buffer[o-4],this.buffer[o+1]=this.buffer[o-3],this.buffer[o+2]=this.buffer[o-2],this.buffer[o+3]=this.buffer[o-1],o-=4,i>4&&(i-=4)}this.buffer[o]=e,this.buffer[o+1]=t,this.buffer[o+2]=r,this.buffer[o+3]=i}}shift(e,t,r,i){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let s=e,{parser:o}=this.p;(i>this.pos||t<=o.maxNode)&&(this.pos=i,o.stateFlag(s,1)||(this.reducePos=i)),this.pushState(s,r),this.shiftContext(t,r),t<=o.maxNode&&this.buffer.push(t,r,i,4)}else this.pos=i,this.shiftContext(t,r),t<=this.p.parser.maxNode&&this.buffer.push(t,r,i,4)}apply(e,t,r,i){e&65536?this.reduce(e):this.shift(e,t,r,i)}useNode(e,t){let r=this.p.reused.length-1;(r<0||this.p.reused[r]!=e)&&(this.p.reused.push(e),r++);let i=this.pos;this.reducePos=this.pos=i+e.length,this.pushState(t,i),this.buffer.push(r,i,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(;t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let r=e.buffer.slice(t),i=e.bufferBase+t;for(;e&&i==e.bufferBase;)e=e.parent;return new TO(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let r=e<=this.p.parser.maxNode;r&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,r?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new see(this);;){let r=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(r==0)return!1;if((r&65536)==0)return!0;t.reduce(r)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let i=[];for(let s=0,o;s<t.length;s+=2)(o=t[s+1])!=this.state&&this.p.parser.hasAction(o,e)&&i.push(t[s],o);if(this.stack.length<120)for(let s=0;i.length<8&&s<t.length;s+=2){let o=t[s+1];i.some((a,l)=>l&1&&a==o)||i.push(t[s],o)}t=i}let r=[];for(let i=0;i<t.length&&r.length<4;i+=2){let s=t[i+1];if(s==this.state)continue;let o=this.split();o.pushState(s,this.pos),o.storeNode(0,o.pos,o.pos,4,!0),o.shiftContext(t[i],this.pos),o.reducePos=this.pos,o.score-=200,r.push(o)}return r}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if((t&65536)==0)return!1;if(!e.validAction(this.state,t)){let r=t>>19,i=t&65535,s=this.stack.length-r*3;if(s<0||e.getGoto(this.stack[s],i,!1)<0){let o=this.findForcedReduction();if(o==null)return!1;t=o}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],r=(i,s)=>{if(!t.includes(i))return t.push(i),e.allActions(i,o=>{if(!(o&393216))if(o&65536){let a=(o>>19)-s;if(a>1){let l=o&65535,c=this.stack.length-a*3;if(c>=0&&e.getGoto(this.stack[c],l,!1)>=0)return a<<19|65536|l}}else{let a=r(o,s+1);if(a!=null)return a}})};return r(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}reduceContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let t=new a$(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){e>this.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class a${constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class see{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,r=e>>19;r==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(r-1)*3;let i=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=i}}class CO{constructor(e,t,r){this.stack=e,this.pos=t,this.index=r,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new CO(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new CO(this.stack,this.pos,this.index)}}function xd(n,e=Uint16Array){if(typeof n!="string")return n;let t=null;for(let r=0,i=0;r<n.length;){let s=0;for(;;){let o=n.charCodeAt(r++),a=!1;if(o==126){s=65535;break}o>=92&&o--,o>=34&&o--;let l=o-32;if(l>=46&&(l-=46,a=!0),s+=l,a)break;s*=46}t?t[i++]=s:t=new e(s)}return t}class Lg{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const l$=new Lg;class oee{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=l$,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let r=this.range,i=this.rangeIndex,s=this.pos+e;for(;s<r.from;){if(!i)return null;let o=this.ranges[--i];s-=r.from-o.to,r=o}for(;t<0?s>r.to:s>=r.to;){if(i==this.ranges.length-1)return null;let o=this.ranges[++i];s+=o.from-r.to,r=o}return s}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let t of this.ranges)if(t.to>e)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,r,i;if(t>=0&&t<this.chunk.length)r=this.pos+e,i=this.chunk.charCodeAt(t);else{let s=this.resolveOffset(e,1);if(s==null)return-1;if(r=s,r>=this.chunk2Pos&&r<this.chunk2Pos+this.chunk2.length)i=this.chunk2.charCodeAt(r-this.chunk2Pos);else{let o=this.rangeIndex,a=this.range;for(;a.to<=r;)a=this.ranges[++o];this.chunk2=this.input.chunk(this.chunk2Pos=r),r+this.chunk2.length>a.to&&(this.chunk2=this.chunk2.slice(0,a.to-r)),i=this.chunk2.charCodeAt(0)}}return r>=this.token.lookAhead&&(this.token.lookAhead=r+1),i}acceptToken(e,t=0){let r=t?this.resolveOffset(t,-1):this.pos;if(r==null||r<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=r}acceptTokenTo(e,t){this.token.value=e,this.token.end=t}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),t=this.pos+e.length;this.chunk=t>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=l$,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,t){if(e>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let r="";for(let i of this.ranges){if(i.from>=t)break;i.to>e&&(r+=this.input.read(Math.max(i.from,e),Math.min(i.to,t)))}return r}}class Bu{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:r}=t.p;MN(this.data,e,t,this.id,r.data,r.tokenPrecTable)}}Bu.prototype.contextual=Bu.prototype.fallback=Bu.prototype.extend=!1;class _O{constructor(e,t,r){this.precTable=t,this.elseToken=r,this.data=typeof e=="string"?xd(e):e}token(e,t){let r=e.pos,i=0;for(;;){let s=e.next<0,o=e.resolveOffset(1,1);if(MN(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(s||i++,o==null)break;e.reset(o,e.token)}i&&(e.reset(r,e.token),e.acceptToken(this.elseToken,i))}}_O.prototype.contextual=Bu.prototype.fallback=Bu.prototype.extend=!1;class yi{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function MN(n,e,t,r,i,s){let o=0,a=1<<r,{dialect:l}=t.p.parser;e:for(;(a&n[o])!=0;){let c=n[o+1];for(let m=o+3;m<c;m+=2)if((n[m+1]&a)>0){let g=n[m];if(l.allows(g)&&(e.token.value==-1||e.token.value==g||aee(g,e.token.value,i,s))){e.acceptToken(g);break}}let u=e.next,d=0,h=n[o+2];if(e.next<0&&h>d&&n[c+h*3-3]==65535){o=n[c+h*3-1];continue e}for(;d<h;){let m=d+h>>1,g=c+m+(m<<1),O=n[g],y=n[g+1]||65536;if(u<O)h=m;else if(u>=y)d=m+1;else{o=n[g+2],e.advance();continue e}}break}}function c$(n,e,t){for(let r=e,i;(i=n[r])!=65535;r++)if(i==t)return r-e;return-1}function aee(n,e,t,r){let i=c$(t,r,e);return i<0||c$(t,r,n)<i}const hs=typeof process<"u"&&o$&&/\bparse\b/.test(o$.LOG);let H0=null;function u$(n,e,t){let r=n.cursor(or.IncludeAnonymous);for(r.moveTo(e);;)if(!(t<0?r.childBefore(e):r.childAfter(e)))for(;;){if((t<0?r.to<e:r.from>e)&&!r.type.isError)return t<0?Math.max(0,Math.min(r.to-1,e-25)):Math.min(n.length,Math.max(r.from+1,e+25));if(t<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return t<0?0:n.length}}let lee=class{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?u$(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?u$(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let t=this.trees.length-1;if(t<0)return this.nextFragment(),null;let r=this.trees[t],i=this.index[t];if(i==r.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let s=r.children[i],o=this.start[t]+r.positions[i];if(o>e)return this.nextStart=o,null;if(s instanceof Un){if(o==e){if(o<this.safeFrom)return null;let a=o+s.length;if(a<=this.safeTo){let l=s.prop(en.lookAhead);if(!l||a+l<this.fragment.to)return s}}this.index[t]++,o+s.length>=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(o),this.index.push(0))}else this.index[t]++,this.nextStart=o+s.length}}};class cee{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(r=>new Lg)}getActions(e){let t=0,r=null,{parser:i}=e.p,{tokenizers:s}=i,o=i.stateSlot(e.state,3),a=e.curContext?e.curContext.hash:0,l=0;for(let c=0;c<s.length;c++){if((1<<c&o)==0)continue;let u=s[c],d=this.tokens[c];if(!(r&&!u.fallback)&&((u.contextual||d.start!=e.pos||d.mask!=o||d.context!=a)&&(this.updateCachedToken(d,u,e),d.mask=o,d.context=a),d.lookAhead>d.end+25&&(l=Math.max(d.lookAhead,l)),d.value!=0)){let h=t;if(d.extended>-1&&(t=this.addActions(e,d.extended,d.end,t)),t=this.addActions(e,d.value,d.end,t),!u.extend&&(r=d,t>h))break}}for(;this.actions.length>t;)this.actions.pop();return l&&e.setLookAhead(l),!r&&e.pos==this.stream.end&&(r=new Lg,r.value=e.p.parser.eofTerm,r.start=r.end=e.pos,t=this.addActions(e,r.value,r.end,t)),this.mainToken=r,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new Lg,{pos:r,p:i}=e;return t.start=r,t.end=Math.min(r+1,i.stream.end),t.value=r==i.stream.end?i.parser.eofTerm:0,t}updateCachedToken(e,t,r){let i=this.stream.clipPos(r.pos);if(t.token(this.stream.reset(i,e),r),e.value>-1){let{parser:s}=r.p;for(let o=0;o<s.specialized.length;o++)if(s.specialized[o]==e.value){let a=s.specializers[o](this.stream.read(e.start,e.end),r);if(a>=0&&r.p.parser.dialect.allows(a>>1)){(a&1)==0?e.value=a>>1:e.extended=a>>1;break}}}else e.value=0,e.end=this.stream.clipPos(i+1)}putAction(e,t,r,i){for(let s=0;s<i;s+=3)if(this.actions[s]==e)return i;return this.actions[i++]=e,this.actions[i++]=t,this.actions[i++]=r,i}addActions(e,t,r,i){let{state:s}=e,{parser:o}=e.p,{data:a}=o;for(let l=0;l<2;l++)for(let c=o.stateSlot(s,l?2:1);;c+=3){if(a[c]==65535)if(a[c+1]==1)c=ga(a,c+2);else{i==0&&a[c+1]==2&&(i=this.putAction(ga(a,c+2),t,r,i));break}a[c]==t&&(i=this.putAction(ga(a,c+1),t,r,i))}return i}}class uee{constructor(e,t,r,i){this.parser=e,this.input=t,this.ranges=i,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new oee(t,i),this.tokens=new cee(e,this.stream),this.topTerm=e.top[1];let{from:s}=i[0];this.stacks=[TO.start(this,e.top[0],s)],this.fragments=r.length&&this.stream.end-s>e.bufferLength*4?new lee(r,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,r=this.stacks=[],i,s;if(this.bigReductionCount>300&&e.length==1){let[o]=e;for(;o.forceReduce()&&o.stack.length&&o.stack[o.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;o<e.length;o++){let a=e[o];for(;;){if(this.tokens.mainToken=null,a.pos>t)r.push(a);else{if(this.advanceStack(a,r,e))continue;{i||(i=[],s=[]),i.push(a);let l=this.tokens.getMainToken(a);s.push(l.value,l.end)}}break}}if(!r.length){let o=i&&dee(i);if(o)return hs&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw hs&&i&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+t);this.recovering||(this.recovering=5)}if(this.recovering&&i){let o=this.stoppedAt!=null&&i[0].pos>this.stoppedAt?i[0]:this.runRecovery(i,s,r);if(o)return hs&&console.log("Force-finish "+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(r.length>o)for(r.sort((a,l)=>l.score-a.score);r.length>o;)r.pop();r.some(a=>a.reducePos>t)&&this.recovering--}else if(r.length>1){e:for(let o=0;o<r.length-1;o++){let a=r[o];for(let l=o+1;l<r.length;l++){let c=r[l];if(a.sameState(c)||a.buffer.length>500&&c.buffer.length>500)if((a.score-c.score||a.buffer.length-c.buffer.length)>0)r.splice(l--,1);else{r.splice(o--,1);continue e}}}r.length>12&&r.splice(12,r.length-12)}this.minStackPos=r[0].pos;for(let o=1;o<r.length;o++)r[o].pos<this.minStackPos&&(this.minStackPos=r[o].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,t,r){let i=e.pos,{parser:s}=this,o=hs?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&i>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let c=e.curContext&&e.curContext.tracker.strict,u=c?e.curContext.hash:0;for(let d=this.fragments.nodeAt(i);d;){let h=this.parser.nodeSet.types[d.type.id]==d.type?s.getGoto(e.state,d.type.id):-1;if(h>-1&&d.length&&(!c||(d.prop(en.contextHash)||0)==u))return e.useNode(d,h),hs&&console.log(o+this.stackID(e)+` (via reuse of ${s.getName(d.type.id)})`),!0;if(!(d instanceof Un)||d.children.length==0||d.positions[0]>0)break;let m=d.children[0];if(m instanceof Un&&d.positions[0]==0)d=m;else break}}let a=s.stateSlot(e.state,4);if(a>0)return e.reduce(a),hs&&console.log(o+this.stackID(e)+` (via always-reduce ${s.getName(a&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let l=this.tokens.getActions(e);for(let c=0;c<l.length;){let u=l[c++],d=l[c++],h=l[c++],m=c==l.length||!r,g=m?e:e.split(),O=this.tokens.mainToken;if(g.apply(u,d,O?O.start:g.pos,h),hs&&console.log(o+this.stackID(g)+` (via ${(u&65536)==0?"shift":`reduce of ${s.getName(u&65535)}`} for ${s.getName(d)} @ ${i}${g==e?"":", split"})`),m)return!0;g.pos>i?t.push(g):r.push(g)}return!1}advanceFully(e,t){let r=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>r)return f$(e,t),!0}}runRecovery(e,t,r){let i=null,s=!1;for(let o=0;o<e.length;o++){let a=e[o],l=t[o<<1],c=t[(o<<1)+1],u=hs?this.stackID(a)+" -> ":"";if(a.deadEnd&&(s||(s=!0,a.restart(),hs&&console.log(u+this.stackID(a)+" (restarted)"),this.advanceFully(a,r))))continue;let d=a.split(),h=u;for(let m=0;d.forceReduce()&&m<10&&(hs&&console.log(h+this.stackID(d)+" (via force-reduce)"),!this.advanceFully(d,r));m++)hs&&(h=this.stackID(d)+" -> ");for(let m of a.recoverByInsert(l))hs&&console.log(u+this.stackID(m)+" (via recover-insert)"),this.advanceFully(m,r);this.stream.end>a.pos?(c==a.pos&&(c++,l=0),a.recoverByDelete(l,c),hs&&console.log(u+this.stackID(a)+` (via recover-delete ${this.parser.getName(l)})`),f$(a,r)):(!i||i.score<a.score)&&(i=a)}return i}stackToTree(e){return e.close(),Un.build({buffer:CO.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let t=(H0||(H0=new WeakMap)).get(e);return t||H0.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}}function f$(n,e){for(let t=0;t<e.length;t++){let r=e[t];if(r.pos==n.pos&&r.sameState(n)){e[t].score<n.score&&(e[t]=n);return}}e.push(n)}class fee{constructor(e,t,r){this.source=e,this.flags=t,this.disabled=r}allows(e){return!this.disabled||this.disabled[e]==0}}const K0=n=>n;class Yk{constructor(e){this.start=e.start,this.shift=e.shift||K0,this.reduce=e.reduce||K0,this.reuse=e.reuse||K0,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class $l extends ck{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let a=0;a<e.repeatNodeCount;a++)t.push("");let r=Object.keys(e.topRules).map(a=>e.topRules[a][1]),i=[];for(let a=0;a<t.length;a++)i.push([]);function s(a,l,c){i[a].push([l,l.deserialize(String(c))])}if(e.nodeProps)for(let a of e.nodeProps){let l=a[0];typeof l=="string"&&(l=en[l]);for(let c=1;c<a.length;){let u=a[c++];if(u>=0)s(u,l,a[c++]);else{let d=a[c+-u];for(let h=-u;h>0;h--)s(a[c++],l,d);c++}}}this.nodeSet=new vh(t.map((a,l)=>ti.define({name:l>=this.minRepeatTerm?void 0:a,id:l,props:i[l],top:r.indexOf(l)>-1,error:l==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(l)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=d5;let o=xd(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let a=0;a<this.specializerSpecs.length;a++)this.specialized[a]=this.specializerSpecs[a].term;this.specializers=this.specializerSpecs.map(d$),this.states=xd(e.states,Uint32Array),this.data=xd(e.stateData),this.goto=xd(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(a=>typeof a=="number"?new Bu(o,a):a),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,r){let i=new uee(this,e,t,r);for(let s of this.wrappers)i=s(i,e,t,r);return i}getGoto(e,t,r=!1){let i=this.goto;if(t>=i[0])return-1;for(let s=i[t+1];;){let o=i[s++],a=o&1,l=i[s++];if(a&&r)return l;for(let c=s+(o>>1);s<c;s++)if(i[s]==e)return l;if(a)return-1}}hasAction(e,t){let r=this.data;for(let i=0;i<2;i++)for(let s=this.stateSlot(e,i?2:1),o;;s+=3){if((o=r[s])==65535)if(r[s+1]==1)o=r[s=ga(r,s+2)];else{if(r[s+1]==2)return ga(r,s+2);break}if(o==t||o==0)return ga(r,s+1)}return 0}stateSlot(e,t){return this.states[e*6+t]}stateFlag(e,t){return(this.stateSlot(e,0)&t)>0}validAction(e,t){return!!this.allActions(e,r=>r==t?!0:null)}allActions(e,t){let r=this.stateSlot(e,4),i=r?t(r):void 0;for(let s=this.stateSlot(e,1);i==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=ga(this.data,s+2);else break;i=t(ga(this.data,s+1))}return i}nextStates(e){let t=[];for(let r=this.stateSlot(e,1);;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=ga(this.data,r+2);else break;if((this.data[r+2]&1)==0){let i=this.data[r+1];t.some((s,o)=>o&1&&s==i)||t.push(this.data[r],i)}}return t}configure(e){let t=Object.assign(Object.create($l.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let r=this.topRules[e.top];if(!r)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=r}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(r=>{let i=e.tokenizers.find(s=>s.from==r);return i?i.to:r})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((r,i)=>{let s=e.specializers.find(a=>a.from==r.external);if(!s)return r;let o=Object.assign(Object.assign({},r),{external:s.to});return t.specializers[i]=d$(o),o})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),e.bufferLength!=null&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),r=t.map(()=>!1);if(e)for(let s of e.split(" ")){let o=t.indexOf(s);o>=0&&(r[o]=!0)}let i=null;for(let s=0;s<t.length;s++)if(!r[s])for(let o=this.dialects[t[s]],a;(a=this.data[o++])!=65535;)(i||(i=new Uint8Array(this.maxTerm+1)))[a]=1;return new fee(e,r,i)}static deserialize(e){return new $l(e)}}function ga(n,e){return n[e]|n[e+1]<<16}function dee(n){let e=null;for(let t of n){let r=t.p.stoppedAt;(t.pos==t.p.stream.end||r!=null&&t.pos>r)&&t.p.parser.stateFlag(t.state,2)&&(!e||e.score<t.score)&&(e=t)}return e}function d$(n){if(n.external){let e=n.extend?1:0;return(t,r)=>n.external(t,r)<<1|e}return n.get}const hee=314,pee=315,h$=1,mee=2,gee=3,Oee=4,vee=316,yee=318,bee=319,See=5,wee=6,kee=0,ow=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],QN=125,Pee=59,aw=47,xee=42,Tee=43,Cee=45,_ee=60,Eee=44,Ree=63,Aee=46,$ee=91,Mee=new Yk({start:!1,shift(n,e){return e==See||e==wee||e==yee?n:e==bee},strict:!1}),Qee=new yi((n,e)=>{let{next:t}=n;(t==QN||t==-1||e.context)&&n.acceptToken(vee)},{contextual:!0,fallback:!0}),Dee=new yi((n,e)=>{let{next:t}=n,r;ow.indexOf(t)>-1||t==aw&&((r=n.peek(1))==aw||r==xee)||t!=QN&&t!=Pee&&t!=-1&&!e.context&&n.acceptToken(hee)},{contextual:!0}),Iee=new yi((n,e)=>{n.next==$ee&&!e.context&&n.acceptToken(pee)},{contextual:!0}),jee=new yi((n,e)=>{let{next:t}=n;if(t==Tee||t==Cee){if(n.advance(),t==n.next){n.advance();let r=!e.context&&e.canShift(h$);n.acceptToken(r?h$:mee)}}else t==Ree&&n.peek(1)==Aee&&(n.advance(),n.advance(),(n.next<48||n.next>57)&&n.acceptToken(gee))},{contextual:!0});function J0(n,e){return n>=65&&n<=90||n>=97&&n<=122||n==95||n>=192||!e&&n>=48&&n<=57}const Nee=new yi((n,e)=>{if(n.next!=_ee||!e.dialectEnabled(kee)||(n.advance(),n.next==aw))return;let t=0;for(;ow.indexOf(n.next)>-1;)n.advance(),t++;if(J0(n.next,!0)){for(n.advance(),t++;J0(n.next,!1);)n.advance(),t++;for(;ow.indexOf(n.next)>-1;)n.advance(),t++;if(n.next==Eee)return;for(let r=0;;r++){if(r==7){if(!J0(n.next,!0))return;break}if(n.next!="extends".charCodeAt(r))break;n.advance(),t++}}n.acceptToken(Oee,-t)}),Lee=Dl({"get set async static":T.modifier,"for while do if else switch try catch finally return throw break continue default case":T.controlKeyword,"in of await yield void typeof delete instanceof":T.operatorKeyword,"let var const using function class extends":T.definitionKeyword,"import export from":T.moduleKeyword,"with debugger as new":T.keyword,TemplateString:T.special(T.string),super:T.atom,BooleanLiteral:T.bool,this:T.self,null:T.null,Star:T.modifier,VariableName:T.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":T.function(T.variableName),VariableDefinition:T.definition(T.variableName),Label:T.labelName,PropertyName:T.propertyName,PrivatePropertyName:T.special(T.propertyName),"CallExpression/MemberExpression/PropertyName":T.function(T.propertyName),"FunctionDeclaration/VariableDefinition":T.function(T.definition(T.variableName)),"ClassDeclaration/VariableDefinition":T.definition(T.className),"NewExpression/VariableName":T.className,PropertyDefinition:T.definition(T.propertyName),PrivatePropertyDefinition:T.definition(T.special(T.propertyName)),UpdateOp:T.updateOperator,"LineComment Hashbang":T.lineComment,BlockComment:T.blockComment,Number:T.number,String:T.string,Escape:T.escape,ArithOp:T.arithmeticOperator,LogicOp:T.logicOperator,BitOp:T.bitwiseOperator,CompareOp:T.compareOperator,RegExp:T.regexp,Equals:T.definitionOperator,Arrow:T.function(T.punctuation),": Spread":T.punctuation,"( )":T.paren,"[ ]":T.squareBracket,"{ }":T.brace,"InterpolationStart InterpolationEnd":T.special(T.brace),".":T.derefOperator,", ;":T.separator,"@":T.meta,TypeName:T.typeName,TypeDefinition:T.definition(T.typeName),"type enum interface implements namespace module declare":T.definitionKeyword,"abstract global Privacy readonly override":T.modifier,"is keyof unique infer asserts":T.operatorKeyword,JSXAttributeValue:T.attributeValue,JSXText:T.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":T.angleBracket,"JSXIdentifier JSXNameSpacedName":T.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":T.attributeName,"JSXBuiltin/JSXIdentifier":T.standard(T.tagName)}),qee={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,const:52,extends:56,this:60,true:68,false:68,null:80,void:84,typeof:88,super:104,new:138,delete:150,yield:159,await:163,class:168,public:231,private:231,protected:231,readonly:233,instanceof:252,satisfies:255,in:256,import:290,keyof:347,unique:351,infer:357,asserts:393,is:395,abstract:415,implements:417,type:419,let:422,var:424,using:427,interface:433,enum:437,namespace:443,module:445,declare:449,global:453,for:472,of:481,while:484,with:488,do:492,if:496,else:498,switch:502,case:508,try:514,catch:518,finally:522,return:526,throw:530,break:534,continue:538,debugger:542},Uee={__proto__:null,async:125,get:127,set:129,declare:191,public:193,private:193,protected:193,static:195,abstract:197,override:199,readonly:205,accessor:207,new:399},Bee={__proto__:null,"<":189},DN=$l.deserialize({version:14,states:"$EOQ%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#D_O.QQlO'#DeO.bQlO'#DpO%[QlO'#DxO0fQlO'#EQOOQ!0Lf'#EY'#EYO1PQ`O'#EVOOQO'#En'#EnOOQO'#Ij'#IjO1XQ`O'#GrO1dQ`O'#EmO1iQ`O'#EmO3hQ!0MxO'#JpO6[Q!0MxO'#JqO6uQ`O'#F[O6zQ,UO'#FsOOQ!0Lf'#Fe'#FeO7VO7dO'#FeO7eQMhO'#F{O9UQ`O'#FzOOQ!0Lf'#Jq'#JqOOQ!0Lb'#Jp'#JpO9ZQ`O'#GvOOQ['#K]'#K]O9fQ`O'#IWO9kQ!0LrO'#IXOOQ['#J^'#J^OOQ['#I]'#I]Q`QlOOQ`QlOOO9sQ!L^O'#DtO9zQlO'#D|O:RQlO'#EOO9aQ`O'#GrO:YQMhO'#CoO:hQ`O'#ElO:sQ`O'#EwO:xQMhO'#FdO;gQ`O'#GrOOQO'#K^'#K^O;lQ`O'#K^O;zQ`O'#G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3OQ7V3dQ7W<qQ7a<sQ7b<{Q8`5mQ8|6iQ9Q6rQ9[<|Q9b=VQ9c=WQ:c9SQ:y9}Q;R:aQ;x#SR=g=sR#[WR'X!el!tQ!r!v!y!z'^'j'k'l-`-p1g5q5sS'T!e-WU*g$|*X*lS-T'U']S0O*h*nQ0W*oQ2m-^Q4m0UR4r0XR(y#xQ!fQT-_'^-`]!qQ!r'^-`1g5qQ#p]R'g;wR)d$dY!uQ'^-`1g5qQ'i!rS's!v!yS'u!z5sS-o'j'kQ-q'lR2{-pT#kZ%dS#jZ%dS%jm,jU(e#h#i#lS.T(f(gQ.X(hQ0n+ZQ3Q.UU3R.V.W.YS6x3S3TR9T6yd#^W#W#Z%g(R([*W+W.O/hr#gZm#h#i#l%d(f(g(h+Z.U.V.W.Y3S3T6yS*Z$x*_Q/o*[Q1|,jQ2d-QQ4W/kQ6g2[Q7i4XQ8{6hT=_'V+XV#aW%g*WU#`W%g*WS(S#W([U(X#Z+W/hS-V'V+XT-y(R.OV'[!e%h*XQ$lfR)v$qT)k$l)lR3}/PT*]$x*_T*e${*WQ0q+cQ1_,QQ3V.aQ5j1aQ5u1iQ6}3ZQ8g5xQ9W6|Q:Q8fQ:d9VQ:|:SQ;U:fQ;`:}R;c;VnqOXst!Z#d%l&p&r&s&u,n,s2S2VQ&j!VR,c>mOXst!U!V!Z#d%l&g&p&r&s&u,n,s2S2VR,j&mT%km,jR1c,SR,b&eQ&T|R+z&UR+p&OT&n!W&qT&o!W&qT2U,s2V",nodeNames:"⚠ ArithOp ArithOp ?. JSXStartTag LineComment BlockComment Script Hashbang ExportDeclaration export Star as VariableName String Escape from ; default FunctionDeclaration async function VariableDefinition > < TypeParamList const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies in CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:378,context:Mee,nodeProps:[["isolate",-8,5,6,14,35,37,49,51,53,""],["group",-26,9,17,19,66,206,210,214,215,217,220,223,233,235,241,243,245,247,250,256,262,264,266,268,270,272,273,"Statement",-34,13,14,30,33,34,40,49,52,53,55,60,68,70,74,78,80,82,83,108,109,118,119,135,138,140,141,142,143,144,146,147,166,168,170,"Expression",-23,29,31,35,39,41,43,172,174,176,177,179,180,181,183,184,185,187,188,189,200,202,204,205,"Type",-3,86,101,107,"ClassItem"],["openedBy",23,"<",36,"InterpolationStart",54,"[",58,"{",71,"(",159,"JSXStartCloseTag"],["closedBy",-2,24,167,">",38,"InterpolationEnd",48,"]",59,"}",72,")",164,"JSXEndTag"]],propSources:[Lee],skippedNodes:[0,5,6,276],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$<r#p#q$=h#q#r$>x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$h&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`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P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!S~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(a~~",141,338),new _O("j~RQYZXz{^~^O(O~~aP!P!Qd~iO(P~~",25,321)],topRules:{Script:[0,7],SingleExpression:[1,274],SingleClassItem:[2,275]},dialects:{jsx:0,ts:15091},dynamicPrecedences:{78:1,80:1,92:1,168:1,198:1},specialized:[{term:325,get:n=>qee[n]||-1},{term:341,get:n=>Uee[n]||-1},{term:93,get:n=>Bee[n]||-1}],tokenPrec:15116}),IN=[Ki("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),Ki("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),Ki("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),Ki("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),Ki("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),Ki(`try {
|
|
154
|
+
\${}
|
|
155
|
+
} catch (\${error}) {
|
|
156
|
+
\${}
|
|
157
|
+
}`,{label:"try",detail:"/ catch block",type:"keyword"}),Ki("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),Ki(`if (\${}) {
|
|
158
|
+
\${}
|
|
159
|
+
} else {
|
|
160
|
+
\${}
|
|
161
|
+
}`,{label:"if",detail:"/ else block",type:"keyword"}),Ki(`class \${name} {
|
|
162
|
+
constructor(\${params}) {
|
|
163
|
+
\${}
|
|
164
|
+
}
|
|
165
|
+
}`,{label:"class",detail:"definition",type:"keyword"}),Ki('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),Ki('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],Fee=IN.concat([Ki("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),Ki("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),Ki("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),p$=new g5,jN=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function md(n){return(e,t)=>{let r=e.node.getChild("VariableDefinition");return r&&t(r,n),!0}}const Vee=["FunctionDeclaration"],Zee={FunctionDeclaration:md("function"),ClassDeclaration:md("class"),ClassExpression:()=>!0,EnumDeclaration:md("constant"),TypeAliasDeclaration:md("type"),NamespaceDeclaration:md("namespace"),VariableDefinition(n,e){n.matchContext(Vee)||e(n,"variable")},TypeDefinition(n,e){e(n,"type")},__proto__:null};function NN(n,e){let t=p$.get(e);if(t)return t;let r=[],i=!0;function s(o,a){let l=n.sliceString(o.from,o.to);r.push({label:l,type:a})}return e.cursor(or.IncludeAnonymous).iterate(o=>{if(i)i=!1;else if(o.name){let a=Zee[o.name];if(a&&a(o,s)||jN.has(o.name))return!1}else if(o.to-o.from>8192){for(let a of NN(n,o.node))r.push(a);return!1}}),p$.set(e,r),r}const m$=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,LN=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function Wee(n){let e=pr(n.state).resolveInner(n.pos,-1);if(LN.indexOf(e.name)>-1)return null;let t=e.name=="VariableName"||e.to-e.from<20&&m$.test(n.state.sliceDoc(e.from,e.to));if(!t&&!n.explicit)return null;let r=[];for(let i=e;i;i=i.parent)jN.has(i.name)&&(r=r.concat(NN(n.state.doc,i)));return{options:r,from:t?e.from:n.pos,validFor:m$}}const Ls=Rl.define({name:"javascript",parser:DN.configure({props:[$c.add({IfStatement:Nu({except:/^\s*({|else\b)/}),TryStatement:Nu({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:$8,SwitchBody:n=>{let e=n.textAfter,t=/^\s*\}/.test(e),r=/^\s*(case|default)\b/.test(e);return n.baseIndent+(t?0:r?1:2)*n.unit},Block:A8({closing:"}"}),ArrowFunction:n=>n.baseIndent+n.unit,"TemplateString BlockComment":()=>null,"Statement Property":Nu({except:/^{/}),JSXElement(n){let e=/^\s*<\//.test(n.textAfter);return n.lineIndent(n.node.from)+(e?0:n.unit)},JSXEscape(n){let e=/\s*\}/.test(n.textAfter);return n.lineIndent(n.node.from)+(e?0:n.unit)},"JSXOpenTag JSXSelfClosingTag"(n){return n.column(n.node.from)+n.unit}}),Il.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":mk,BlockComment(n){return{from:n.from+2,to:n.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),qN={test:n=>/^JSX/.test(n.name),facet:fk({commentTokens:{block:{open:"{/*",close:"*/}"}}})},Gk=Ls.configure({dialect:"ts"},"typescript"),UN=Ls.configure({dialect:"jsx",props:[dk.add(n=>n.isTop?[qN]:void 0)]}),BN=Ls.configure({dialect:"jsx ts",props:[dk.add(n=>n.isTop?[qN]:void 0)]},"typescript");let FN=n=>({label:n,type:"keyword"});const VN="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(FN),Xee=VN.concat(["declare","implements","private","protected","public"].map(FN));function hv(n={}){let e=n.jsx?n.typescript?BN:UN:n.typescript?Gk:Ls,t=n.typescript?Fee.concat(Xee):IN.concat(VN);return new Ec(e,[Ls.data.of({autocomplete:CX(LN,Oj(t))}),Ls.data.of({autocomplete:Wee}),n.jsx?Gee:[]])}function zee(n){for(;;){if(n.name=="JSXOpenTag"||n.name=="JSXSelfClosingTag"||n.name=="JSXFragmentTag")return n;if(n.name=="JSXEscape"||!n.parent)return null;n=n.parent}}function g$(n,e,t=n.length){for(let r=e==null?void 0:e.firstChild;r;r=r.nextSibling)if(r.name=="JSXIdentifier"||r.name=="JSXBuiltin"||r.name=="JSXNamespacedName"||r.name=="JSXMemberExpression")return n.sliceString(r.from,Math.min(r.to,t));return""}const Yee=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),Gee=et.inputHandler.of((n,e,t,r,i)=>{if((Yee?n.composing:n.compositionStarted)||n.state.readOnly||e!=t||r!=">"&&r!="/"||!Ls.isActiveAt(n.state,e,-1))return!1;let s=i(),{state:o}=s,a=o.changeByRange(l=>{var c;let{head:u}=l,d=pr(o).resolveInner(u-1,-1),h;if(d.name=="JSXStartTag"&&(d=d.parent),!(o.doc.sliceString(u-1,u)!=r||d.name=="JSXAttributeValue"&&d.to>u)){if(r==">"&&d.name=="JSXFragmentTag")return{range:l,changes:{from:u,insert:"</>"}};if(r=="/"&&d.name=="JSXStartCloseTag"){let m=d.parent,g=m.parent;if(g&&m.from==u-2&&((h=g$(o.doc,g.firstChild,u))||((c=g.firstChild)===null||c===void 0?void 0:c.name)=="JSXFragmentTag")){let O=`${h}>`;return{range:_e.cursor(u+O.length,-1),changes:{from:u,insert:O}}}}else if(r==">"){let m=zee(d);if(m&&m.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(o.doc.sliceString(u,u+2))&&(h=g$(o.doc,m,u)))return{range:l,changes:{from:u,insert:`</${h}>`}}}}return{range:l}});return a.changes.empty?!1:(n.dispatch([s,o.update(a,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),Hee=100,O$=1,Kee=101,Jee=102,v$=2,ZN=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],ete=58,tte=40,WN=95,nte=91,qg=45,rte=46,ite=35,ste=37,ote=38,ate=92,lte=10;function ah(n){return n>=65&&n<=90||n>=97&&n<=122||n>=161}function XN(n){return n>=48&&n<=57}const cte=new yi((n,e)=>{for(let t=!1,r=0,i=0;;i++){let{next:s}=n;if(ah(s)||s==qg||s==WN||t&&XN(s))!t&&(s!=qg||i>0)&&(t=!0),r===i&&s==qg&&r++,n.advance();else if(s==ate&&n.peek(1)!=lte)n.advance(),n.next>-1&&n.advance(),t=!0;else{t&&n.acceptToken(s==tte?Kee:r==2&&e.canShift(v$)?v$:Jee);break}}}),ute=new yi(n=>{if(ZN.includes(n.peek(-1))){let{next:e}=n;(ah(e)||e==WN||e==ite||e==rte||e==nte||e==ete&&ah(n.peek(1))||e==qg||e==ote)&&n.acceptToken(Hee)}}),fte=new yi(n=>{if(!ZN.includes(n.peek(-1))){let{next:e}=n;if(e==ste&&(n.advance(),n.acceptToken(O$)),ah(e)){do n.advance();while(ah(n.next)||XN(n.next));n.acceptToken(O$)}}}),dte=Dl({"AtKeyword import charset namespace keyframes media supports":T.definitionKeyword,"from to selector":T.keyword,NamespaceName:T.namespace,KeyframeName:T.labelName,KeyframeRangeName:T.operatorKeyword,TagName:T.tagName,ClassName:T.className,PseudoClassName:T.constant(T.className),IdName:T.labelName,"FeatureName PropertyName":T.propertyName,AttributeName:T.attributeName,NumberLiteral:T.number,KeywordQuery:T.keyword,UnaryQueryOp:T.operatorKeyword,"CallTag ValueName":T.atom,VariableName:T.variableName,Callee:T.operatorKeyword,Unit:T.unit,"UniversalSelector NestingSelector":T.definitionOperator,MatchOp:T.compareOperator,"ChildOp SiblingOp, LogicOp":T.logicOperator,BinOp:T.arithmeticOperator,Important:T.modifier,Comment:T.blockComment,ColorLiteral:T.color,"ParenthesizedContent StringLiteral":T.string,":":T.punctuation,"PseudoOp #":T.derefOperator,"; ,":T.separator,"( )":T.paren,"[ ]":T.squareBracket,"{ }":T.brace}),hte={__proto__:null,lang:34,"nth-child":34,"nth-last-child":34,"nth-of-type":34,"nth-last-of-type":34,dir:34,"host-context":34,url:62,"url-prefix":62,domain:62,regexp:62,selector:140},pte={__proto__:null,"@import":120,"@media":144,"@charset":148,"@namespace":152,"@keyframes":158,"@supports":170},mte={__proto__:null,not:134,only:134},gte=$l.deserialize({version:14,states:":jQYQ[OOO#_Q[OOP#fOWOOOOQP'#Cd'#CdOOQP'#Cc'#CcO#kQ[O'#CfO$_QXO'#CaO$fQ[O'#CiO$qQ[O'#DUO$vQ[O'#DXOOQP'#En'#EnO${QdO'#DhO%jQ[O'#DuO${QdO'#DwO%{Q[O'#DyO&WQ[O'#D|O&`Q[O'#ESO&nQ[O'#EUOOQS'#Em'#EmOOQS'#EX'#EXQYQ[OOO&uQXO'#CdO'jQWO'#DdO'oQWO'#EsO'zQ[O'#EsQOQWOOP(UO#tO'#C_POOO)C@])C@]OOQP'#Ch'#ChOOQP,59Q,59QO#kQ[O,59QO(aQ[O'#E]O({QWO,58{O)TQ[O,59TO$qQ[O,59pO$vQ[O,59sO(aQ[O,59vO(aQ[O,59xO(aQ[O,59yO)`Q[O'#DcOOQS,58{,58{OOQP'#Cl'#ClOOQO'#DS'#DSOOQP,59T,59TO)gQWO,59TO)lQWO,59TOOQP'#DW'#DWOOQP,59p,59pOOQO'#DY'#DYO)qQ`O,59sOOQS'#Cq'#CqO${QdO'#CrO)yQvO'#CtO+ZQtO,5:SOOQO'#Cy'#CyO)lQWO'#CxO+oQWO'#CzO+tQ[O'#DPOOQS'#Ep'#EpOOQO'#Dk'#DkO+|Q[O'#DrO,[QWO'#EtO&`Q[O'#DpO,jQWO'#DsOOQO'#Eu'#EuO)OQWO,5:aO,oQpO,5:cOOQS'#D{'#D{O,wQWO,5:eO,|Q[O,5:eOOQO'#EO'#EOO-UQWO,5:hO-ZQWO,5:nO-cQWO,5:pOOQS-E8V-E8VO-kQdO,5:OO-{Q[O'#E_O.YQWO,5;_O.YQWO,5;_POOO'#EW'#EWP.eO#tO,58yPOOO,58y,58yOOQP1G.l1G.lO/[QXO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umberLiteral StringLiteral BinaryExpression BinOp CallExpression Callee CallLiteral CallTag ParenthesizedContent ] [ LineNames LineName , PseudoClassName ArgList IdSelector # IdName AttributeSelector AttributeName MatchOp ChildSelector ChildOp DescendantSelector SiblingSelector SiblingOp } { Block Declaration PropertyName Important ; ImportStatement AtKeyword import KeywordQuery FeatureQuery FeatureName BinaryQuery LogicOp UnaryQuery UnaryQueryOp ParenthesizedQuery SelectorQuery selector MediaStatement media CharsetStatement charset NamespaceStatement namespace NamespaceName KeyframesStatement keyframes KeyframeName KeyframeList KeyframeSelector KeyframeRangeName SupportsStatement supports AtRule Styles",maxTerm:117,nodeProps:[["isolate",-2,3,25,""],["openedBy",18,"(",33,"[",51,"{"],["closedBy",19,")",34,"]",52,"}"]],propSources:[dte],skippedNodes:[0,3,88],repeatNodeCount:11,tokenData:"J^~R!^OX$}X^%u^p$}pq%uqr)Xrs.Rst/utu6duv$}vw7^wx7oxy9^yz9oz{9t{|:_|}?Q}!O?c!O!P@Q!P!Q@i!Q![Ab![!]B]!]!^CX!^!_$}!_!`Cj!`!aC{!a!b$}!b!cDw!c!}$}!}#OFa#O#P$}#P#QFr#Q#R6d#R#T$}#T#UGT#U#c$}#c#dHf#d#o$}#o#pH{#p#q6d#q#rI^#r#sIo#s#y$}#y#z%u#z$f$}$f$g%u$g#BY$}#BY#BZ%u#BZ$IS$}$IS$I_%u$I_$I|$}$I|$JO%u$JO$JT$}$JT$JU%u$JU$KV$}$KV$KW%u$KW&FU$}&FU&FV%u&FV;'S$};'S;=`JW<%lO$}`%QSOy%^z;'S%^;'S;=`%o<%lO%^`%cSp`Oy%^z;'S%^;'S;=`%o<%lO%^`%rP;=`<%l%^~%zh#[~OX%^X^'f^p%^pq'fqy%^z#y%^#y#z'f#z$f%^$f$g'f$g#BY%^#BY#BZ'f#BZ$IS%^$IS$I_'f$I_$I|%^$I|$JO'f$JO$JT%^$JT$JU'f$JU$KV%^$KV$KW'f$KW&FU%^&FU&FV'f&FV;'S%^;'S;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~~g~aO#_~~dP!P!Qg~lO#`~~",28,106)],topRules:{StyleSheet:[0,4],Styles:[1,87]},specialized:[{term:101,get:n=>hte[n]||-1},{term:59,get:n=>pte[n]||-1},{term:102,get:n=>mte[n]||-1}],tokenPrec:1219});let eb=null;function tb(){if(!eb&&typeof document=="object"&&document.body){let{style:n}=document.body,e=[],t=new Set;for(let r in n)r!="cssText"&&r!="cssFloat"&&typeof n[r]=="string"&&(/[A-Z]/.test(r)&&(r=r.replace(/[A-Z]/g,i=>"-"+i.toLowerCase())),t.has(r)||(e.push(r),t.add(r)));eb=e.sort().map(r=>({type:"property",label:r,apply:r+": "}))}return eb||[]}const y$=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(n=>({type:"class",label:n})),b$=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(n=>({type:"keyword",label:n})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(n=>({type:"constant",label:n}))),Ote=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(n=>({type:"type",label:n})),vte=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(n=>({type:"keyword",label:n})),ma=/^(\w[\w-]*|-\w[\w-]*|)$/,yte=/^-(-[\w-]*)?$/;function bte(n,e){var t;if((n.name=="("||n.type.isError)&&(n=n.parent||n),n.name!="ArgList")return!1;let r=(t=n.parent)===null||t===void 0?void 0:t.firstChild;return(r==null?void 0:r.name)!="Callee"?!1:e.sliceString(r.from,r.to)=="var"}const S$=new g5,Ste=["Declaration"];function wte(n){for(let e=n;;){if(e.type.isTop)return e;if(!(e=e.parent))return n}}function zN(n,e,t){if(e.to-e.from>4096){let r=S$.get(e);if(r)return r;let i=[],s=new Set,o=e.cursor(or.IncludeAnonymous);if(o.firstChild())do for(let a of zN(n,o.node,t))s.has(a.label)||(s.add(a.label),i.push(a));while(o.nextSibling());return S$.set(e,i),i}else{let r=[],i=new Set;return e.cursor().iterate(s=>{var o;if(t(s)&&s.matchContext(Ste)&&((o=s.node.nextSibling)===null||o===void 0?void 0:o.name)==":"){let a=n.sliceString(s.from,s.to);i.has(a)||(i.add(a),r.push({label:a,type:"variable"}))}}),r}}const kte=n=>e=>{let{state:t,pos:r}=e,i=pr(t).resolveInner(r,-1),s=i.type.isError&&i.from==i.to-1&&t.doc.sliceString(i.from,i.to)=="-";if(i.name=="PropertyName"||(s||i.name=="TagName")&&/^(Block|Styles)$/.test(i.resolve(i.to).name))return{from:i.from,options:tb(),validFor:ma};if(i.name=="ValueName")return{from:i.from,options:b$,validFor:ma};if(i.name=="PseudoClassName")return{from:i.from,options:y$,validFor:ma};if(n(i)||(e.explicit||s)&&bte(i,t.doc))return{from:n(i)||s?i.from:r,options:zN(t.doc,wte(i),n),validFor:yte};if(i.name=="TagName"){for(let{parent:l}=i;l;l=l.parent)if(l.name=="Block")return{from:i.from,options:tb(),validFor:ma};return{from:i.from,options:Ote,validFor:ma}}if(i.name=="AtKeyword")return{from:i.from,options:vte,validFor:ma};if(!e.explicit)return null;let o=i.resolve(r),a=o.childBefore(r);return a&&a.name==":"&&o.name=="PseudoClassSelector"?{from:r,options:y$,validFor:ma}:a&&a.name==":"&&o.name=="Declaration"||o.name=="ArgList"?{from:r,options:b$,validFor:ma}:o.name=="Block"||o.name=="Styles"?{from:r,options:tb(),validFor:ma}:null},Pte=kte(n=>n.name=="VariableName"),rf=Rl.define({name:"css",parser:gte.configure({props:[$c.add({Declaration:Nu()}),Il.add({"Block KeyframeList":mk})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function pv(){return new Ec(rf,rf.data.of({autocomplete:Pte}))}const xte=54,Tte=1,Cte=55,_te=2,Ete=56,Rte=3,w$=4,Ate=5,EO=6,YN=7,GN=8,HN=9,KN=10,$te=11,Mte=12,Qte=13,nb=57,Dte=14,k$=58,JN=20,Ite=22,eL=23,jte=24,lw=26,tL=27,Nte=28,Lte=31,qte=34,Ute=36,Bte=37,Fte=0,Vte=1,Zte={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},Wte={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},P$={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function Xte(n){return n==45||n==46||n==58||n>=65&&n<=90||n==95||n>=97&&n<=122||n>=161}function nL(n){return n==9||n==10||n==13||n==32}let x$=null,T$=null,C$=0;function cw(n,e){let t=n.pos+e;if(C$==t&&T$==n)return x$;let r=n.peek(e);for(;nL(r);)r=n.peek(++e);let i="";for(;Xte(r);)i+=String.fromCharCode(r),r=n.peek(++e);return T$=n,C$=t,x$=i?i.toLowerCase():r==zte||r==Yte?void 0:null}const rL=60,RO=62,Hk=47,zte=63,Yte=33,Gte=45;function _$(n,e){this.name=n,this.parent=e}const Hte=[EO,KN,YN,GN,HN],Kte=new Yk({start:null,shift(n,e,t,r){return Hte.indexOf(e)>-1?new _$(cw(r,1)||"",n):n},reduce(n,e){return e==JN&&n?n.parent:n},reuse(n,e,t,r){let i=e.type.id;return i==EO||i==Ute?new _$(cw(r,1)||"",n):n},strict:!1}),Jte=new yi((n,e)=>{if(n.next!=rL){n.next<0&&e.context&&n.acceptToken(nb);return}n.advance();let t=n.next==Hk;t&&n.advance();let r=cw(n,0);if(r===void 0)return;if(!r)return n.acceptToken(t?Dte:EO);let i=e.context?e.context.name:null;if(t){if(r==i)return n.acceptToken($te);if(i&&Wte[i])return n.acceptToken(nb,-2);if(e.dialectEnabled(Fte))return n.acceptToken(Mte);for(let s=e.context;s;s=s.parent)if(s.name==r)return;n.acceptToken(Qte)}else{if(r=="script")return n.acceptToken(YN);if(r=="style")return n.acceptToken(GN);if(r=="textarea")return n.acceptToken(HN);if(Zte.hasOwnProperty(r))return n.acceptToken(KN);i&&P$[i]&&P$[i][r]?n.acceptToken(nb,-1):n.acceptToken(EO)}},{contextual:!0}),ene=new yi(n=>{for(let e=0,t=0;;t++){if(n.next<0){t&&n.acceptToken(k$);break}if(n.next==Gte)e++;else if(n.next==RO&&e>=2){t>=3&&n.acceptToken(k$,-2);break}else e=0;n.advance()}});function tne(n){for(;n;n=n.parent)if(n.name=="svg"||n.name=="math")return!0;return!1}const nne=new yi((n,e)=>{if(n.next==Hk&&n.peek(1)==RO){let t=e.dialectEnabled(Vte)||tne(e.context);n.acceptToken(t?Ate:w$,2)}else n.next==RO&&n.acceptToken(w$,1)});function Kk(n,e,t){let r=2+n.length;return new yi(i=>{for(let s=0,o=0,a=0;;a++){if(i.next<0){a&&i.acceptToken(e);break}if(s==0&&i.next==rL||s==1&&i.next==Hk||s>=2&&s<r&&i.next==n.charCodeAt(s-2))s++,o++;else if((s==2||s==r)&&nL(i.next))o++;else if(s==r&&i.next==RO){a>o?i.acceptToken(e,-o):i.acceptToken(t,-(o-2));break}else if((i.next==10||i.next==13)&&a){i.acceptToken(e,1);break}else s=o=0;i.advance()}})}const rne=Kk("script",xte,Tte),ine=Kk("style",Cte,_te),sne=Kk("textarea",Ete,Rte),one=Dl({"Text RawText":T.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":T.angleBracket,TagName:T.tagName,"MismatchedCloseTag/TagName":[T.tagName,T.invalid],AttributeName:T.attributeName,"AttributeValue UnquotedAttributeValue":T.attributeValue,Is:T.definitionOperator,"EntityReference CharacterReference":T.character,Comment:T.blockComment,ProcessingInst:T.processingInstruction,DoctypeDecl:T.documentMeta}),ane=$l.deserialize({version:14,states:",xOVO!rOOO!WQ#tO'#CqO!]Q#tO'#CzO!bQ#tO'#C}O!gQ#tO'#DQO!lQ#tO'#DSO!qOaO'#CpO!|ObO'#CpO#XOdO'#CpO$eO!rO'#CpOOO`'#Cp'#CpO$lO$fO'#DTO$tQ#tO'#DVO$yQ#tO'#DWOOO`'#Dk'#DkOOO`'#DY'#DYQVO!rOOO%OQ&rO,59]O%ZQ&rO,59fO%fQ&rO,59iO%qQ&rO,59lO%|Q&rO,59nOOOa'#D^'#D^O&XOaO'#CxO&dOaO,59[OOOb'#D_'#D_O&lObO'#C{O&wObO,59[OOOd'#D`'#D`O'POdO'#DOO'[OdO,59[OOO`'#Da'#DaO'dO!rO,59[O'kQ#tO'#DROOO`,59[,59[OOOp'#Db'#DbO'pO$fO,59oOOO`,59o,59oO'xQ#|O,59qO'}Q#|O,59rOOO`-E7W-E7WO(SQ&rO'#CsOOQW'#DZ'#DZO(bQ&rO1G.wOOOa1G.w1G.wOOO`1G/Y1G/YO(mQ&rO1G/QOOOb1G/Q1G/QO(xQ&rO1G/TOOOd1G/T1G/TO)TQ&rO1G/WOOO`1G/W1G/WO)`Q&rO1G/YOOOa-E7[-E7[O)kQ#tO'#CyOOO`1G.v1G.vOOOb-E7]-E7]O)pQ#tO'#C|OOOd-E7^-E7^O)uQ#tO'#DPOOO`-E7_-E7_O)zQ#|O,59mOOOp-E7`-E7`OOO`1G/Z1G/ZOOO`1G/]1G/]OOO`1G/^1G/^O*PQ,UO,59_OOQW-E7X-E7XOOOa7+$c7+$cOOO`7+$t7+$tOOOb7+$l7+$lOOOd7+$o7+$oOOO`7+$r7+$rO*[Q#|O,59eO*aQ#|O,59hO*fQ#|O,59kOOO`1G/X1G/XO*kO7[O'#CvO*|OMhO'#CvO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gUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:67,context:Kte,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,21,30,33,36,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,29,32,35,37,"OpenTag"],["group",-9,14,17,18,19,20,39,40,41,42,"Entity",16,"Entity TextContent",-3,28,31,34,"TextContent Entity"],["isolate",-11,21,29,30,32,33,35,36,37,38,41,42,"ltr",-3,26,27,39,""]],propSources:[one],skippedNodes:[0],repeatNodeCount:9,tokenData:"!<p!aR!YOX$qXY,QYZ,QZ[$q[]&X]^,Q^p$qpq,Qqr-_rs3_sv-_vw3}wxHYx}-_}!OH{!O!P-_!P!Q$q!Q![-_![!]Mz!]!^-_!^!_!$S!_!`!;x!`!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4U-_4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!Z$|c`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr$qrs&}sv$qvw+Pwx(tx!^$q!^!_*V!_!a&X!a#S$q#S#T&X#T;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(eL)){let i=r.getChild(jte),s=r.getChild(lw)||r.getChild(tL);i&&(t[e.read(i.from,i.to)]=s?s.type.id==lw?e.read(s.from+1,s.to-1):e.read(s.from,s.to):"")}return t}function E$(n,e){let t=n.getChild(Ite);return t?e.read(t.from,t.to):" "}function rb(n,e,t){let r;for(let i of t)if(!i.attrs||i.attrs(r||(r=iL(n.node.parent.firstChild,e))))return{parser:i.parser};return null}function sL(n=[],e=[]){let t=[],r=[],i=[],s=[];for(let a of n)(a.tag=="script"?t:a.tag=="style"?r:a.tag=="textarea"?i:s).push(a);let o=e.length?Object.create(null):null;for(let a of e)(o[a.name]||(o[a.name]=[])).push(a);return uk((a,l)=>{let c=a.type.id;if(c==Nte)return rb(a,l,t);if(c==Lte)return rb(a,l,r);if(c==qte)return rb(a,l,i);if(c==JN&&s.length){let u=a.node,d=u.firstChild,h=d&&E$(d,l),m;if(h){for(let g of s)if(g.tag==h&&(!g.attrs||g.attrs(m||(m=iL(d,l))))){let O=u.lastChild,y=O.type.id==Bte?O.from:u.to;if(y>d.to)return{parser:g.parser,overlay:[{from:d.to,to:y}]}}}}if(o&&c==eL){let u=a.node,d;if(d=u.firstChild){let h=o[l.read(d.from,d.to)];if(h)for(let m of h){if(m.tagName&&m.tagName!=E$(u.parent,l))continue;let g=u.lastChild;if(g.type.id==lw){let O=g.from+1,y=g.lastChild,b=g.to-(y&&y.isError?0:1);if(b>O)return{parser:m.parser,overlay:[{from:O,to:b}]}}else if(g.type.id==tL)return{parser:m.parser,overlay:[{from:g.from,to:g.to}]}}}}return null})}const gd=["_blank","_self","_top","_parent"],ib=["ascii","utf-8","utf-16","latin1","latin1"],sb=["get","post","put","delete"],ob=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],ps=["true","false"],Qt={},lne={a:{attrs:{href:null,ping:null,type:null,media:null,target:gd,hreflang:null}},abbr:Qt,address:Qt,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:Qt,aside:Qt,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:Qt,base:{attrs:{href:null,target:gd}},bdi:Qt,bdo:Qt,blockquote:{attrs:{cite:null}},body:Qt,br:Qt,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:ob,formmethod:sb,formnovalidate:["novalidate"],formtarget:gd,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:Qt,center:Qt,cite:Qt,code:Qt,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:Qt,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:Qt,div:Qt,dl:Qt,dt:Qt,em:Qt,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:Qt,figure:Qt,footer:Qt,form:{attrs:{action:null,name:null,"accept-charset":ib,autocomplete:["on","off"],enctype:ob,method:sb,novalidate:["novalidate"],target:gd}},h1:Qt,h2:Qt,h3:Qt,h4:Qt,h5:Qt,h6:Qt,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:Qt,hgroup:Qt,hr:Qt,html:{attrs:{manifest:null}},i:Qt,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:ob,formmethod:sb,formnovalidate:["novalidate"],formtarget:gd,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:Qt,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:Qt,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:Qt,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:ib,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:Qt,noscript:Qt,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:Qt,param:{attrs:{name:null,value:null}},pre:Qt,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:Qt,rt:Qt,ruby:Qt,samp:Qt,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:ib}},section:Qt,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:Qt,source:{attrs:{src:null,type:null,media:null}},span:Qt,strong:Qt,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:Qt,summary:Qt,sup:Qt,table:Qt,tbody:Qt,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:Qt,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:Qt,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:Qt,time:{attrs:{datetime:null}},title:Qt,tr:Qt,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:Qt,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:Qt},oL={accesskey:null,class:null,contenteditable:ps,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:ps,autocorrect:ps,autocapitalize:ps,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":ps,"aria-autocomplete":["inline","list","both","none"],"aria-busy":ps,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":ps,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":ps,"aria-hidden":ps,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":ps,"aria-multiselectable":ps,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":ps,"aria-relevant":null,"aria-required":ps,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},aL="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(n=>"on"+n);for(let n of aL)oL[n]=null;class lh{constructor(e,t){this.tags=Object.assign(Object.assign({},lne),e),this.globalAttrs=Object.assign(Object.assign({},oL),t),this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}lh.default=new lh;function sf(n,e,t=n.length){if(!e)return"";let r=e.firstChild,i=r&&r.getChild("TagName");return i?n.sliceString(i.from,Math.min(i.to,t)):""}function of(n,e=!1){for(;n;n=n.parent)if(n.name=="Element")if(e)e=!1;else return n;return null}function lL(n,e,t){let r=t.tags[sf(n,of(e))];return(r==null?void 0:r.children)||t.allTags}function Jk(n,e){let t=[];for(let r=of(e);r&&!r.type.isTop;r=of(r.parent)){let i=sf(n,r);if(i&&r.lastChild.name=="CloseTag")break;i&&t.indexOf(i)<0&&(e.name=="EndTag"||e.from>=r.firstChild.to)&&t.push(i)}return t}const cL=/^[:\-\.\w\u00b7-\uffff]*$/;function R$(n,e,t,r,i){let s=/\s*>/.test(n.sliceDoc(i,i+5))?"":">",o=of(t,!0);return{from:r,to:i,options:lL(n.doc,o,e).map(a=>({label:a,type:"type"})).concat(Jk(n.doc,t).map((a,l)=>({label:"/"+a,apply:"/"+a+s,type:"type",boost:99-l}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function A$(n,e,t,r){let i=/\s*>/.test(n.sliceDoc(r,r+5))?"":">";return{from:t,to:r,options:Jk(n.doc,e).map((s,o)=>({label:s,apply:s+i,type:"type",boost:99-o})),validFor:cL}}function cne(n,e,t,r){let i=[],s=0;for(let o of lL(n.doc,t,e))i.push({label:"<"+o,type:"type"});for(let o of Jk(n.doc,t))i.push({label:"</"+o+">",type:"type",boost:99-s++});return{from:r,to:r,options:i,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function une(n,e,t,r,i){let s=of(t),o=s?e.tags[sf(n.doc,s)]:null,a=o&&o.attrs?Object.keys(o.attrs):[],l=o&&o.globalAttrs===!1?a:a.length?a.concat(e.globalAttrNames):e.globalAttrNames;return{from:r,to:i,options:l.map(c=>({label:c,type:"property"})),validFor:cL}}function fne(n,e,t,r,i){var s;let o=(s=t.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),a=[],l;if(o){let c=n.sliceDoc(o.from,o.to),u=e.globalAttrs[c];if(!u){let d=of(t),h=d?e.tags[sf(n.doc,d)]:null;u=(h==null?void 0:h.attrs)&&h.attrs[c]}if(u){let d=n.sliceDoc(r,i).toLowerCase(),h='"',m='"';/^['"]/.test(d)?(l=d[0]=='"'?/^[^"]*$/:/^[^']*$/,h="",m=n.sliceDoc(i,i+1)==d[0]?"":d[0],d=d.slice(1),r++):l=/^[^\s<>='"]*$/;for(let g of u)a.push({label:g,apply:h+g+m,type:"constant"})}}return{from:r,to:i,options:a,validFor:l}}function uL(n,e){let{state:t,pos:r}=e,i=pr(t).resolveInner(r,-1),s=i.resolve(r);for(let o=r,a;s==i&&(a=i.childBefore(o));){let l=a.lastChild;if(!l||!l.type.isError||l.from<l.to)break;s=i=a,o=l.from}return i.name=="TagName"?i.parent&&/CloseTag$/.test(i.parent.name)?A$(t,i,i.from,r):R$(t,n,i,i.from,r):i.name=="StartTag"?R$(t,n,i,r,r):i.name=="StartCloseTag"||i.name=="IncompleteCloseTag"?A$(t,i,r,r):i.name=="OpenTag"||i.name=="SelfClosingTag"||i.name=="AttributeName"?une(t,n,i,i.name=="AttributeName"?i.from:r,r):i.name=="Is"||i.name=="AttributeValue"||i.name=="UnquotedAttributeValue"?fne(t,n,i,i.name=="Is"?r:i.from,r):e.explicit&&(s.name=="Element"||s.name=="Text"||s.name=="Document")?cne(t,n,i,r):null}function fL(n){return uL(lh.default,n)}function dne(n){let{extraTags:e,extraGlobalAttributes:t}=n,r=t||e?new lh(e,t):lh.default;return i=>uL(r,i)}const hne=Ls.parser.configure({top:"SingleExpression"}),dL=[{tag:"script",attrs:n=>n.type=="text/typescript"||n.lang=="ts",parser:Gk.parser},{tag:"script",attrs:n=>n.type=="text/babel"||n.type=="text/jsx",parser:UN.parser},{tag:"script",attrs:n=>n.type=="text/typescript-jsx",parser:BN.parser},{tag:"script",attrs(n){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(n.type)},parser:hne},{tag:"script",attrs(n){return!n.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(n.type)},parser:Ls.parser},{tag:"style",attrs(n){return(!n.lang||n.lang=="css")&&(!n.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(n.type))},parser:rf.parser}],hL=[{name:"style",parser:rf.parser.configure({top:"Styles"})}].concat(aL.map(n=>({name:n,parser:Ls.parser}))),pL=Rl.define({name:"html",parser:ane.configure({props:[$c.add({Element(n){let e=/^(\s*)(<\/)?/.exec(n.textAfter);return n.node.to<=n.pos+e[0].length?n.continue():n.lineIndent(n.node.from)+(e[2]?0:n.unit)},"OpenTag CloseTag SelfClosingTag"(n){return n.column(n.node.from)+n.unit},Document(n){if(n.pos+/\s*/.exec(n.textAfter)[0].length<n.node.to)return n.continue();let e=null,t;for(let r=n.node;;){let i=r.lastChild;if(!i||i.name!="Element"||i.to!=r.to)break;e=r=i}return e&&!((t=e.lastChild)&&(t.name=="CloseTag"||t.name=="SelfClosingTag"))?n.lineIndent(e.from)+n.unit:null}}),Il.add({Element(n){let e=n.firstChild,t=n.lastChild;return!e||e.name!="OpenTag"?null:{from:e.to,to:t.name=="CloseTag"?t.from:n.to}}}),I5.add({"OpenTag CloseTag":n=>n.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-._"}}),Ug=pL.configure({wrap:sL(dL,hL)});function mL(n={}){let e="",t;n.matchClosingTags===!1&&(e="noMatch"),n.selfClosingTags===!0&&(e=(e?e+" ":"")+"selfClosing"),(n.nestedLanguages&&n.nestedLanguages.length||n.nestedAttributes&&n.nestedAttributes.length)&&(t=sL((n.nestedLanguages||[]).concat(dL),(n.nestedAttributes||[]).concat(hL)));let r=t?pL.configure({wrap:t,dialect:e}):e?Ug.configure({dialect:e}):Ug;return new Ec(r,[Ug.data.of({autocomplete:dne(n)}),n.autoCloseTags!==!1?pne:[],hv().support,pv().support])}const $$=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),pne=et.inputHandler.of((n,e,t,r,i)=>{if(n.composing||n.state.readOnly||e!=t||r!=">"&&r!="/"||!Ug.isActiveAt(n.state,e,-1))return!1;let s=i(),{state:o}=s,a=o.changeByRange(l=>{var c,u,d;let h=o.doc.sliceString(l.from-1,l.to)==r,{head:m}=l,g=pr(o).resolveInner(m,-1),O;if(h&&r==">"&&g.name=="EndTag"){let y=g.parent;if(((u=(c=y.parent)===null||c===void 0?void 0:c.lastChild)===null||u===void 0?void 0:u.name)!="CloseTag"&&(O=sf(o.doc,y.parent,m))&&!$$.has(O)){let b=m+(o.doc.sliceString(m,m+1)===">"?1:0),S=`</${O}>`;return{range:l,changes:{from:m,to:b,insert:S}}}}else if(h&&r=="/"&&g.name=="IncompleteCloseTag"){let y=g.parent;if(g.from==m-2&&((d=y.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(O=sf(o.doc,y,m))&&!$$.has(O)){let b=m+(o.doc.sliceString(m,m+1)===">"?1:0),S=`${O}>`;return{range:_e.cursor(m+S.length,-1),changes:{from:m,to:b,insert:S}}}}return{range:l}});return a.changes.empty?!1:(n.dispatch([s,o.update(a,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),mne=145,gne=1,One=146,vne=2,yne=147,bne=3,AO=4,gL=5,OL=6,vL=7,yL=8,Sne=9,wne=11,ab=148,kne=12,M$=149,uw=13,Bg=14,Pne=67,xne=110,Tne=113,Cne=116,_ne=118,Ene={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},Rne={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},Q$={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function Ane(n){return n==45||n==46||n==58||n>=65&&n<=90||n==95||n>=97&&n<=122||n>=161}function bL(n){return n==9||n==10||n==13||n==32}let D$=null,I$=null,j$=0;function fw(n,e){let t=n.pos+e;if(j$==t&&I$==n)return D$;let r=n.peek(e);for(;bL(r);)r=n.peek(++e);let i="";for(;Ane(r);)i+=String.fromCharCode(r),r=n.peek(++e);return I$=n,j$=t,D$=i?i.toLowerCase():r==Mne||r==Qne?void 0:null}const SL=60,$ne=62,wL=47,Mne=63,Qne=33;function N$(n,e){this.name=n,this.parent=e,this.hash=e?e.hash:0;for(let t=0;t<n.length;t++)this.hash+=(this.hash<<4)+n.charCodeAt(t)+(n.charCodeAt(t)<<8)}const Dne=[AO,yL,gL,OL,vL],Ine=new Yk({start:null,shift(n,e,t,r){return Dne.indexOf(e)>-1?new N$(fw(r,1)||"",n):n},reduce(n,e){return e==Pne&&n?n.parent:n},reuse(n,e,t,r){let i=e.type.id;return i==AO||i==_ne?new N$(fw(r,1)||"",n):n},hash(n){return n?n.hash:0},strict:!1}),jne=new yi((n,e)=>{if(n.next!=SL){n.next<0&&e.context&&n.acceptToken(ab);return}n.advance();let t=n.next==wL;t&&n.advance();let r=fw(n,0);if(r===void 0)return;if(!r)return n.acceptToken(t?kne:AO);let i=e.context?e.context.name:null;if(t){if(r==i)return n.acceptToken(Sne);if(i&&Rne[i])return n.acceptToken(ab,-2);for(let s=e.context;s;s=s.parent)if(s.name==r)return;n.acceptToken(wne)}else{if(r=="script")return n.acceptToken(gL);if(r=="style")return n.acceptToken(OL);if(r=="textarea")return n.acceptToken(vL);if(Ene.hasOwnProperty(r))return n.acceptToken(yL);i&&Q$[i]&&Q$[i][r]?n.acceptToken(ab,-1):n.acceptToken(AO)}},{contextual:!0});function eP(n,e,t){let r=2+n.length;return new yi(i=>{for(let s=0,o=0,a=0;;a++){if(i.next<0){a&&i.acceptToken(e);break}if(s==0&&i.next==SL||s==1&&i.next==wL||s>=2&&s<r&&i.next==n.charCodeAt(s-2))s++,o++;else if((s==2||s==r)&&bL(i.next))o++;else if(s==r&&i.next==$ne){a>o?i.acceptToken(e,-o):i.acceptToken(t,-(o-2));break}else if((i.next==10||i.next==13)&&a){i.acceptToken(e,1);break}else s=o=0;i.advance()}})}const Nne=eP("script",mne,gne),Lne=eP("style",One,vne),qne=eP("textarea",yne,bne),Une=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],kL=40,$O=41,PL=91,MO=93,xL=123,QO=125,Bne=44,Fne=58,Vne=35,Zne=64,Td=47,Wne=62,Xne=45,L$=34,q$=39,zne=92,Yne=10,U$=42,B$=96,TL=[Fne,Vne,Zne,Td],Gne=new yi(n=>{for(let e=0,t=0;;t++){if(n.next<0){t&&n.acceptToken(M$);break}if(n.next==Xne)e++;else if(n.next==Wne&&e>=2){t>3&&n.acceptToken(M$,-2);break}else e=0;n.advance()}});function CL(n){let e=!1,t=null,r=!1;return()=>e?r?(r=!1,!0):n.next===zne?(r=!0,!0):((t==="double"&&n.next===L$||t==="single"&&n.next===q$||t==="template"&&n.next===B$)&&(e=!1,t=null),!0):n.next===L$?(e=!0,t="double",!0):n.next===q$?(e=!0,t="single",!0):n.next===B$?(e=!0,t="template",!0):!1}function _L(n){let e=!1,t=!1;return()=>e?(n.next===Yne&&(e=!1),!0):t?(n.next===U$&&n.peek(1)===Td&&(t=!1),!0):n.next===Td&&n.peek(1)===Td?(e=!0,!0):n.next===Td&&n.peek(1)===U$?(t=!0,!0):!1}const Hne=new yi(n=>{if(TL.includes(n.next))return;const e=_L(n),t=CL(n);let r=[];const i=s=>{const o=r.lastIndexOf(s);if(o!==-1)for(;r.length>o;)r.pop()};for(let s=0;;s++){if(n.next<0){s>0&&n.acceptToken(uw);break}if(e()||t()){n.advance();continue}if(r.length===0&&(n.next===QO||n.next===$O||n.next===MO)){n.acceptToken(uw);break}switch(n.next){case kL:r.push("(");break;case $O:i("(");break;case PL:r.push("[");break;case MO:i("[");break;case xL:r.push("{");break;case QO:i("{");break}n.advance()}}),Kne=new yi(n=>{if(TL.includes(n.peek(0)))return;const e=_L(n),t=CL(n);let r=[];const i=s=>{const o=r.lastIndexOf(s);if(o!==-1)for(;r.length>o;)r.pop()};for(let s=0;;s++){if(n.next<0){s>0&&n.acceptToken(Bg);break}if(e()||t()){n.advance();continue}if(r.length===0&&(n.next===QO||n.next===$O||n.next===MO||n.next===Bne)){n.acceptToken(Bg);break}switch(n.next){case kL:r.push("(");break;case $O:i("(");break;case PL:r.push("[");break;case MO:i("[");break;case xL:r.push("{");break;case QO:i("{");break}if(s!==0&&r.length===0&&Une.includes(n.next)){n.acceptToken(Bg);break}n.advance()}}),Jne=Dl({"Text RawText":T.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":T.angleBracket,TagName:T.tagName,"MismatchedCloseTag/TagName":[T.tagName,T.invalid],AttributeName:T.attributeName,UnquotedAttributeValue:T.attributeValue,"DoubleQuote SingleQuote AttributeValueContent":T.attributeValue,Is:T.definitionOperator,"EntityReference CharacterReference":T.character,Comment:T.blockComment,ProcessingInst:T.processingInstruction,DoctypeDecl:T.documentMeta,"{ }":T.bracket,"[ ]":T.squareBracket,"( )":T.paren,"| , :":T.punctuation,"...":T.derefOperator,ComponentName:T.className,SvelteElementNamespace:T.namespace,SvelteElementType:T.tagName,StyleAttributeName:T.propertyName,BlockType:T.controlKeyword,BlockPrefix:T.typeOperator,"UnknownBlock/BlockType":T.invalid,UnknownBlockContent:T.invalid,"if then catch":T.controlKeyword,as:T.definitionOperator,Variable:T.variableName,Modifier:T.modifier,DirectlyInterpolatedAttributeValue:T.attributeValue,"DirectiveOn/DirectiveName":T.controlKeyword,"DirectiveOn/DirectiveTarget":T.typeName,"DirectiveUse/DirectiveName":T.controlKeyword,"DirectiveUse/DirectiveTarget":T.function(T.variableName),"DirectiveBind/DirectiveName":T.controlKeyword,"DirectiveBind/DirectiveTarget":T.variableName,"DirectiveLet/DirectiveName":T.definitionKeyword,"DirectiveLet/DirectiveTarget":T.definition(T.variableName),"DirectiveTransition/DirectiveName":T.operatorKeyword,"DirectiveTransition/DirectiveTarget":T.function(T.variableName),"DirectiveIn/DirectiveName":T.operatorKeyword,"DirectiveIn/DirectiveTarget":T.function(T.variableName),"DirectiveOut/DirectiveName":T.operatorKeyword,"DirectiveOut/DirectiveTarget":T.function(T.variableName),"DirectiveAnimate/DirectiveName":T.operatorKeyword,"DirectiveAnimate/DirectiveTarget":T.function(T.variableName),"DirectiveClass/DirectiveName":T.attributeName,"DirectiveClass/DirectiveTarget":T.variableName,"DirectiveStyle/DirectiveName":T.attributeName,"DirectiveStyle/DirectiveTarget":T.propertyName}),ere={__proto__:null,"#":41,":":51,"/":59,"@":109},tre={__proto__:null,if:44,else:52,each:64,await:82,then:90,catch:94,key:102,html:110,debug:114,const:118},nre={__proto__:null,if:54,as:66,then:84,catch:86},rre={__proto__:null,on:313,bind:317,let:319,class:321,style:323,use:325,transition:327,in:329,out:331,animate:333},ire={__proto__:null,svelte:243},sre=$l.deserialize({version:14,states:"DxQVO#|OOO!ZO#|O'#ClO#[O#|O'#CzO$]O#|O'#DTO%^O#|O'#D_O&_Q'[O'#DjO&mQ&jO'#DrO&rQ&jO'#EpO&wQ&jO'#EsO&|Q&jO'#EvO'XQ&jO'#E|O'^OXO'#DqO'iOYO'#DqO'tO[O'#DqO)TO#|O'#DqOOOW'#Dq'#DqO)[O&zO'#FOO&|Q&jO'#FQO&|Q&jO'#FROOOW'#Fj'#FjOOOW'#FT'#FTQVO#|OOOOOW'#FU'#FUO!ZO#|O,59WOOOW,59W,59WO)uQ'[O'#DjO#[O#|O,59fOOOW,59f,59fO)|Q'[O'#DjOOOW'#FV'#FVO$]O#|O,59oOOOW,59o,59oO*fQ'[O'#DjOOOW'#FW'#FWO%^O#|O,59yOOOW,59y,59yO*mQ'[O'#DjO+OQ&jO,5:UO+TQ,UO,5:VO+YQ,UO,59XO+hQ,UO,59}O,nQ7[O,5:^O,uQ7[O,5;[O,|Q7[O,5;_O-TO,UO'#ExOOQO'#F|'#F|O-YQ7[O,5;bO-dQ7[O,5;hOOOX'#F^'#F^O-kOXO'#EnO-vOXO,5:]OOOY'#F_'#F_O.OOYO'#EqO.ZOYO,5:]OOO['#F`'#F`O.cO[O'#EtO.nO[O,5:]O.vO#|O,5:]O&|Q&jO'#E{OOOW,5:],5:]OOO`'#Fa'#FaO.}O&zO,5;jOOOW,5;j,5;jO/VQ,UO,5;lO/[Q,UO,5;mOOOW-E9R-E9ROOOW-E9S-E9SOOOW1G.r1G.rO/aQ,UO,59`O/fQ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R$d!ze#hyz{!O!P#f#i#k#n#qe!|yz{!O!P#f#i#k#n#qe#Oyz{!O!P#f#i#k#n#qe#Qyz{!O!P#f#i#k#n#qe#Syz{!O!P#f#i#k#n#qe#Uyz{!O!P#f#i#k#n#qe#Wyz{!O!P#f#i#k#n#qe#Yyz{!O!P#f#i#k#n#qe#[yz{!O!P#f#i#k#n#qe#^yz{!O!P#f#i#k#n#qe#`yz{!O!P#f#i#k#n#qQ%{$rQ%|$sQ&O$uQ&]%vR&f%}R&b%yR&e%zR!SZR#t!Si[OPQRS^egjnr!ZR!V[R#t!Vi]OPQRS^egjnr!ZR!Y]R#t!Yi^OPQRS^egjnr!ZX}Xab![Q!]^R#t!Zi_OPQRS^egjnr!ZQeOR!ceQgPQjQT!dgjQnRR!jnQrSQ!Z^T!nr!ZQ%e$`R&Y%eQ#fyQ#izQ#k{Q#n!OQ#q!PZ$v#f#i#k#n#qQ$q#aQ$t#cT%u$q$tQ&`%yR&l&`Q&d%zR&n&dQ!RZR#r!RQ!U[R#u!UQ!X]R#w!XQ!_`R#z!_SdOeWfPQgjSmRnXqS^r!Ze#eyz{!O!P#f#i#k#n#qe#ayz{!O!P#f#i#k#n#qS&_%y&`T&c%z&dQ!OXQ!aaQ!bbR#y![",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteCloseTag LongExpression ShortExpression Document IfBlock IfBlockOpen { BlockPrefix BlockPrefix BlockType BlockType } ElseBlock BlockPrefix BlockType if IfBlockClose BlockPrefix EachBlock EachBlockOpen BlockType as ( ) , Variable EachBlockClose AwaitBlock AwaitBlockOpen BlockType then catch ThenBlock BlockType CatchBlock BlockType AwaitBlockClose KeyBlock KeyBlockOpen BlockType KeyBlockClose RawHTMLBlock BlockPrefix BlockType DebugBlock BlockType ConstBlock BlockType Interpolation UnknownBlock UnknownBlockContent Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName DirectlyInterpolatedAttribute DirectlyInterpolatedAttributeValue SpreadInterpolatedAttribute ... Directive DirectiveOn DirectiveName AttributeName DirectiveTarget DirectiveBind DirectiveName DirectiveLet DirectiveName DirectiveClass DirectiveName DirectiveStyle DirectiveName DirectiveUse DirectiveName DirectiveTransition DirectiveName DirectiveIn DirectiveName DirectiveOut DirectiveName DirectiveAnimate DirectiveName | Modifier Is AttributeValue DoubleQuote AttributeValueContent SingleQuote AttributeValueContent UnquotedAttributeValue StyleAttribute StyleAttributeName Attribute EndTag ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag ComponentName SvelteElementName SvelteElementNamespace SvelteElementType CloseTag SelfClosingTag SelfClosingEndTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:172,context:Ine,nodeProps:[["closedBy",-10,1,2,3,5,6,7,8,9,10,11,"EndTag",4,"EndTag SelfClosingEndTag",17,"IfBlockClose",18,"}",31,"EachBlockClose",34,"(",40,"AwaitBlockClose",48,"AwaitBlockOpen",50,"KeyBlockClose",-4,68,112,115,118,"CloseTag",101,'"',103,"'"],["group",-10,12,60,64,65,66,67,126,127,128,129,"Entity",-4,16,30,39,49,"Block Entity",-4,17,31,40,50,"BlockOpen",-3,24,44,46,"BlockInline",-4,28,38,48,52,"BlockClose",-4,53,56,58,61,"BlockInline Entity",63,"Entity TextContent",-3,110,113,116,"TextContent Entity"],["openedBy",23,"{",28,"IfBlockOpen",35,")",38,"EachBlockOpen",52,"KeyBlockOpen",101,'"',103,"'",109,"StartTag StartCloseTag",-4,111,114,117,123,"OpenTag",125,"StartTag"]],propSources:[Jne],skippedNodes:[0],repeatNodeCount:13,tokenData:"&8h$IRR!dOX%aXY/TYZ/TZ[%a[]1{]^/T^p%apq/Tqr2yrsEastF_tuHxuv2yvw!)[wx#,nxy#-lyz#0Vz|2y|}#2p}!O#5Z!O!P#Kk!P!Q$%S!Q![2y![!]$'{!]!^2y!^!_$)u!_!`%'{!`!a%({!a!b2y!b!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X&3oog#f!p&j#U,U!aP#]7[$mMh$o!LQ!oWOX-bXZ*YZ[-b[^*Y^p-bpq*YqrBurs*YsvBuvw<ywx*Yx!PBu!P!Q-b!Q![Bu![!]-b!]!^Bu!^!_;q!_!a*Y!a#SBu#S#T@u#T#oBu#o#p,a#p#q-b#q#sBu#s$f-b$f;'SBu;'S;=`ET<%l?AhBu?Ah?BY-b?BY?MnBu?MnO-b$F]&5sP;=`<%l%AU$FZ&5yP;=`<%lHx$5a&6aqeS!aP#]7[up$mMh$o!LQ$_!b!``OX'VXZ(wZ['V[^(w^p'Vpq(wqr'Vrs(wst'Vtu!&nuv'Vvw*}wx(wx!O'V!O!P!$O!P!Q'V!Q![!&n![!^'V!^!_)q!_!a(w!a!c'V!c!}!&n!}#R'V#R#S!&n#S#T(w#T#o!&n#o#p*}#p#q'V#q#r-b#r$g'V$g;'S!&n;'S;=`!)U<%lO!&n",tokenizers:[Nne,Lne,qne,jne,Gne,Hne,Kne,0,1,2,3,4,5,6,7,8,9,10,11,12],topRules:{Document:[0,15]},specialized:[{term:19,get:n=>ere[n]||-1},{term:21,get:n=>tre[n]||-1},{term:153,get:n=>nre[n]||-1},{term:77,get:n=>rre[n]||-1},{term:69,get:n=>ire[n]||-1}],tokenPrec:1571});function ore(n,e){let t=Object.create(null);for(let r of n.firstChild.getChildren("Attribute")){let i=r.getChild("AttributeName"),s=r.getChild("AttributeValue")||r.getChild("UnquotedAttributeValue");i&&(t[e.read(i.from,i.to)]=s?s.name=="AttributeValue"?e.read(s.from+1,s.to-1):e.read(s.from,s.to):"")}return t}function lb(n,e,t){let r;for(let i of t)if(!i.attrs||i.attrs(r||(r=ore(n.node.parent,e))))return{parser:i.parser};return null}const F$=DN.configure({top:"SingleExpression"});function are(n){let e=[],t=[],r=[];for(let i of n){let s=i.tag=="script"?e:i.tag=="style"?t:i.tag=="textarea"?r:null;if(!s)throw new RangeError("Only script, style, and textarea tags can host nested parsers");s.push(i)}return uk((i,s)=>{let o=i.type.id;return o===uw?{parser:F$}:o===Bg?{parser:F$}:o===xne?lb(i,s,e):o===Tne?lb(i,s,t):o===Cne?lb(i,s,r):null})}const lre=[{tag:"script",attrs:n=>n.type==="text/typescript"||n.lang==="ts",parser:Gk.parser},{tag:"script",attrs(n){return!n.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(n.type)},parser:Ls.parser},{tag:"style",attrs(n){return(!n.lang||n.lang==="css"||n.lang==="scss")&&(!n.type||/^(text\/)?(x-)?(stylesheet|css|scss)$/i.test(n.type))},parser:rf.parser}],EL=Rl.define({parser:sre.configure({wrap:are(lre),props:[$c.add({Element:n=>{let e=/^(\s*)(<\/)?/.exec(n.textAfter);return n.node.to<=n.pos+e[0].length?n.continue():n.lineIndent(n.node.from)+(e[2]?0:n.unit)},Block:n=>{const e=n.node,t=n.textAfter.trim();if(t.startsWith("{/")){const i=e.name;return i==="IfBlock"&&t.startsWith("{/if")||i==="EachBlock"&&t.startsWith("{/each")||i==="AwaitBlock"&&t.startsWith("{/await")||i==="KeyBlock"&&t.startsWith("{/key")?n.lineIndent(n.node.from):null}if(e.name==="IfBlock"||e.name==="EachBlock"){if(t.startsWith("{:else"))return n.lineIndent(e.from)}else if(e.name==="AwaitBlock"&&(t.startsWith("{:then")||t.startsWith("{:catch")))return n.lineIndent(e.from);let r=/^(\s*)(<\/)?/.exec(n.textAfter);return n.node.to<=n.pos+r[0].length?n.continue():n.lineIndent(n.node.from)+(r[2]?0:n.unit)},"BlockOpen BlockClose BlockInline":n=>n.column(n.node.from)+n.unit,"OpenTag CloseTag SelfClosingTag":n=>n.column(n.node.from)+n.unit,Document:n=>{if(n.pos+/\s*/.exec(n.textAfter)[0].length<n.node.to)return n.continue();let e=null,t;for(let r=n.node;;){let i=r.lastChild;if(!i||i.name!="Element"||i.to!=r.to)break;e=r=i}return e&&!((t=e.lastChild)&&(t.name==="CloseTag"||t.name==="SelfClosingTag"))?n.lineIndent(e.from)+n.unit:null}}),Il.add({Block:n=>{const e=`${n.name}Open`,t=`${n.name}Close`,r=n.firstChild,i=n.lastChild;return!r||r.name!==e?null:{from:r.to,to:(i==null?void 0:i.name)===t?i.from:n.to}},Element:n=>{let e=n.firstChild,t=n.lastChild;return!e||e.name!="OpenTag"?null:{from:e.to,to:t.name==="CloseTag"?t.from:n.to}}})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*((<\/\w+\W)|(\{:(else|then|catch))|(\{\/(if|each|await|key)))$/,wordChars:"-._",autocomplete:fL}});function cre(){return new Ec(EL,[hv().support,pv().support,ure])}function V$(n,e,t=n.length){if(!e)return"";let r=e.firstChild,i=r&&(r.getChild("TagName")||r.getChild("ComponentName")||r.getChild("SvelteElementName"));return i?n.sliceString(i.from,Math.min(i.to,t)):""}const ure=et.inputHandler.of((n,e,t,r)=>{if(n.composing||n.state.readOnly||e!=t||r!=">"&&r!="/"||!EL.isActiveAt(n.state,e,-1))return!1;let{state:i}=n,s=i.changeByRange(o=>{var a,l,c;let{head:u}=o,d=pr(i).resolveInner(u,-1),h;if((d.name==="TagName"||d.name==="ComponentName"||d.name==="SvelteElementName"||d.name==="StartTag")&&(d=d.parent),r===">"&&d.name==="OpenTag"){if(((l=(a=d.parent)===null||a===void 0?void 0:a.lastChild)===null||l===void 0?void 0:l.name)!="CloseTag"&&(h=V$(i.doc,d.parent,u))){let m=n.state.doc.sliceString(u,u+1)===">",g=`${m?"":">"}</${h}>`;return{range:_e.cursor(u+1),changes:{from:u+(m?1:0),insert:g}}}}else if(r==="/"&&d.name==="OpenTag"){let m=d.parent,g=m==null?void 0:m.parent;if(m.from==u-1&&((c=g.lastChild)===null||c===void 0?void 0:c.name)!="CloseTag"&&(h=V$(i.doc,g,u))){let O=n.state.doc.sliceString(u,u+1)===">",y=`/${h}${O?"":">"}`,b=u+y.length+(O?1:0);return{range:_e.cursor(b),changes:{from:u,insert:y}}}}return{range:o}});return s.changes.empty?!1:(n.dispatch(s,{userEvent:"input.type",scrollIntoView:!0}),!0)}),fre=Dl({String:T.string,Number:T.number,"True False":T.bool,PropertyName:T.propertyName,Null:T.null,", :":T.separator,"[ ]":T.squareBracket,"{ }":T.brace}),dre=$l.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:"#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O",goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",14,"["],["closedBy",8,"}",15,"]"]],propSources:[fre],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),hre=Rl.define({name:"json",parser:dre.configure({props:[$c.add({Object:Nu({except:/^\s*\}/}),Array:Nu({except:/^\s*\]/})}),Il.add({"Object Array":mk})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function pre(){return new Ec(hre)}class DO{static create(e,t,r,i,s){let o=i+(i<<8)+e+(t<<4)|0;return new DO(e,t,r,o,s,[],[])}constructor(e,t,r,i,s,o,a){this.type=e,this.value=t,this.from=r,this.hash=i,this.end=s,this.children=o,this.positions=a,this.hashProp=[[en.contextHash,i]]}addChild(e,t){e.prop(en.contextHash)!=this.hash&&(e=new Un(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(t)}toTree(e,t=this.end){let r=this.children.length-1;return r>=0&&(t=Math.max(t,this.positions[r]+this.children[r].length+this.from)),new Un(e.types[this.type],this.children,this.positions,t-this.from).balance({makeTree:(i,s,o)=>new Un(ti.none,i,s,o,this.hashProp)})}}var Je;(function(n){n[n.Document=1]="Document",n[n.CodeBlock=2]="CodeBlock",n[n.FencedCode=3]="FencedCode",n[n.Blockquote=4]="Blockquote",n[n.HorizontalRule=5]="HorizontalRule",n[n.BulletList=6]="BulletList",n[n.OrderedList=7]="OrderedList",n[n.ListItem=8]="ListItem",n[n.ATXHeading1=9]="ATXHeading1",n[n.ATXHeading2=10]="ATXHeading2",n[n.ATXHeading3=11]="ATXHeading3",n[n.ATXHeading4=12]="ATXHeading4",n[n.ATXHeading5=13]="ATXHeading5",n[n.ATXHeading6=14]="ATXHeading6",n[n.SetextHeading1=15]="SetextHeading1",n[n.SetextHeading2=16]="SetextHeading2",n[n.HTMLBlock=17]="HTMLBlock",n[n.LinkReference=18]="LinkReference",n[n.Paragraph=19]="Paragraph",n[n.CommentBlock=20]="CommentBlock",n[n.ProcessingInstructionBlock=21]="ProcessingInstructionBlock",n[n.Escape=22]="Escape",n[n.Entity=23]="Entity",n[n.HardBreak=24]="HardBreak",n[n.Emphasis=25]="Emphasis",n[n.StrongEmphasis=26]="StrongEmphasis",n[n.Link=27]="Link",n[n.Image=28]="Image",n[n.InlineCode=29]="InlineCode",n[n.HTMLTag=30]="HTMLTag",n[n.Comment=31]="Comment",n[n.ProcessingInstruction=32]="ProcessingInstruction",n[n.Autolink=33]="Autolink",n[n.HeaderMark=34]="HeaderMark",n[n.QuoteMark=35]="QuoteMark",n[n.ListMark=36]="ListMark",n[n.LinkMark=37]="LinkMark",n[n.EmphasisMark=38]="EmphasisMark",n[n.CodeMark=39]="CodeMark",n[n.CodeText=40]="CodeText",n[n.CodeInfo=41]="CodeInfo",n[n.LinkTitle=42]="LinkTitle",n[n.LinkLabel=43]="LinkLabel",n[n.URL=44]="URL"})(Je||(Je={}));class mre{constructor(e,t){this.start=e,this.content=t,this.marks=[],this.parsers=[]}}class gre{constructor(){this.text="",this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return Dd(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,t=0,r=0){for(let i=t;i<e;i++)r+=this.text.charCodeAt(i)==9?4-r%4:1;return r}findColumn(e){let t=0;for(let r=0;t<this.text.length&&r<e;t++)r+=this.text.charCodeAt(t)==9?4-r%4:1;return t}scrub(){if(!this.baseIndent)return this.text;let e="";for(let t=0;t<this.basePos;t++)e+=" ";return e+this.text.slice(this.basePos)}}function Z$(n,e,t){if(t.pos==t.text.length||n!=e.block&&t.indent>=e.stack[t.depth+1].value+t.baseIndent)return!0;if(t.indent>=t.baseIndent+4)return!1;let r=(n.type==Je.OrderedList?rP:nP)(t,e,!1);return r>0&&(n.type!=Je.BulletList||tP(t,e,!1)<0)&&t.text.charCodeAt(t.pos+r-1)==n.value}const RL={[Je.Blockquote](n,e,t){return t.next!=62?!1:(t.markers.push(Tn(Je.QuoteMark,e.lineStart+t.pos,e.lineStart+t.pos+1)),t.moveBase(t.pos+(Fs(t.text.charCodeAt(t.pos+1))?2:1)),n.end=e.lineStart+t.text.length,!0)},[Je.ListItem](n,e,t){return t.indent<t.baseIndent+n.value&&t.next>-1?!1:(t.moveBaseColumn(t.baseIndent+n.value),!0)},[Je.OrderedList]:Z$,[Je.BulletList]:Z$,[Je.Document](){return!0}};function Fs(n){return n==32||n==9||n==10||n==13}function Dd(n,e=0){for(;e<n.length&&Fs(n.charCodeAt(e));)e++;return e}function W$(n,e,t){for(;e>t&&Fs(n.charCodeAt(e-1));)e--;return e}function AL(n){if(n.next!=96&&n.next!=126)return-1;let e=n.pos+1;for(;e<n.text.length&&n.text.charCodeAt(e)==n.next;)e++;if(e<n.pos+3)return-1;if(n.next==96){for(let t=e;t<n.text.length;t++)if(n.text.charCodeAt(t)==96)return-1}return e}function $L(n){return n.next!=62?-1:n.text.charCodeAt(n.pos+1)==32?2:1}function tP(n,e,t){if(n.next!=42&&n.next!=45&&n.next!=95)return-1;let r=1;for(let i=n.pos+1;i<n.text.length;i++){let s=n.text.charCodeAt(i);if(s==n.next)r++;else if(!Fs(s))return-1}return t&&n.next==45&&DL(n)>-1&&n.depth==e.stack.length&&e.parser.leafBlockParsers.indexOf(LL.SetextHeading)>-1||r<3?-1:1}function ML(n,e){for(let t=n.stack.length-1;t>=0;t--)if(n.stack[t].type==e)return!0;return!1}function nP(n,e,t){return(n.next==45||n.next==43||n.next==42)&&(n.pos==n.text.length-1||Fs(n.text.charCodeAt(n.pos+1)))&&(!t||ML(e,Je.BulletList)||n.skipSpace(n.pos+2)<n.text.length)?1:-1}function rP(n,e,t){let r=n.pos,i=n.next;for(;i>=48&&i<=57;){r++;if(r==n.text.length)return-1;i=n.text.charCodeAt(r)}return r==n.pos||r>n.pos+9||i!=46&&i!=41||r<n.text.length-1&&!Fs(n.text.charCodeAt(r+1))||t&&!ML(e,Je.OrderedList)&&(n.skipSpace(r+1)==n.text.length||r>n.pos+1||n.next!=49)?-1:r+1-n.pos}function QL(n){if(n.next!=35)return-1;let e=n.pos+1;for(;e<n.text.length&&n.text.charCodeAt(e)==35;)e++;if(e<n.text.length&&n.text.charCodeAt(e)!=32)return-1;let t=e-n.pos;return t>6?-1:t}function DL(n){if(n.next!=45&&n.next!=61||n.indent>=n.baseIndent+4)return-1;let e=n.pos+1;for(;e<n.text.length&&n.text.charCodeAt(e)==n.next;)e++;let t=e;for(;e<n.text.length&&Fs(n.text.charCodeAt(e));)e++;return e==n.text.length?t:-1}const dw=/^[ \t]*$/,IL=/-->/,jL=/\?>/,hw=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,IL],[/^\s*<\?/,jL],[/^\s*<![A-Z]/,/>/],[/^\s*<!\[CDATA\[/,/\]\]>/],[/^\s*<\/?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/i,dw],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,dw]];function NL(n,e,t){if(n.next!=60)return-1;let r=n.text.slice(n.pos);for(let i=0,s=hw.length-(t?1:0);i<s;i++)if(hw[i][0].test(r))return i;return-1}function X$(n,e){let t=n.countIndent(e,n.pos,n.indent),r=n.countIndent(n.skipSpace(e),e,t);return r>=t+5?t+1:r}function ac(n,e,t){let r=n.length-1;r>=0&&n[r].to==e&&n[r].type==Je.CodeText?n[r].to=t:n.push(Tn(Je.CodeText,e,t))}const ig={LinkReference:void 0,IndentedCode(n,e){let t=e.baseIndent+4;if(e.indent<t)return!1;let r=e.findColumn(t),i=n.lineStart+r,s=n.lineStart+e.text.length,o=[],a=[];for(ac(o,i,s);n.nextLine()&&e.depth>=n.stack.length;)if(e.pos==e.text.length){ac(a,n.lineStart-1,n.lineStart);for(let l of e.markers)a.push(l)}else{if(e.indent<t)break;{if(a.length){for(let c of a)c.type==Je.CodeText?ac(o,c.from,c.to):o.push(c);a=[]}ac(o,n.lineStart-1,n.lineStart);for(let c of e.markers)o.push(c);s=n.lineStart+e.text.length;let l=n.lineStart+e.findColumn(e.baseIndent+4);l<s&&ac(o,l,s)}}return a.length&&(a=a.filter(l=>l.type!=Je.CodeText),a.length&&(e.markers=a.concat(e.markers))),n.addNode(n.buffer.writeElements(o,-i).finish(Je.CodeBlock,s-i),i),!0},FencedCode(n,e){let t=AL(e);if(t<0)return!1;let r=n.lineStart+e.pos,i=e.next,s=t-e.pos,o=e.skipSpace(t),a=W$(e.text,e.text.length,o),l=[Tn(Je.CodeMark,r,r+s)];o<a&&l.push(Tn(Je.CodeInfo,n.lineStart+o,n.lineStart+a));for(let c=!0;n.nextLine()&&e.depth>=n.stack.length;c=!1){let u=e.pos;if(e.indent-e.baseIndent<4)for(;u<e.text.length&&e.text.charCodeAt(u)==i;)u++;if(u-e.pos>=s&&e.skipSpace(u)==e.text.length){for(let d of e.markers)l.push(d);l.push(Tn(Je.CodeMark,n.lineStart+e.pos,n.lineStart+u)),n.nextLine();break}else{c||ac(l,n.lineStart-1,n.lineStart);for(let m of e.markers)l.push(m);let d=n.lineStart+e.basePos,h=n.lineStart+e.text.length;d<h&&ac(l,d,h)}}return n.addNode(n.buffer.writeElements(l,-r).finish(Je.FencedCode,n.prevLineEnd()-r),r),!0},Blockquote(n,e){let t=$L(e);return t<0?!1:(n.startContext(Je.Blockquote,e.pos),n.addNode(Je.QuoteMark,n.lineStart+e.pos,n.lineStart+e.pos+1),e.moveBase(e.pos+t),null)},HorizontalRule(n,e){if(tP(e,n,!1)<0)return!1;let t=n.lineStart+e.pos;return n.nextLine(),n.addNode(Je.HorizontalRule,t),!0},BulletList(n,e){let t=nP(e,n,!1);if(t<0)return!1;n.block.type!=Je.BulletList&&n.startContext(Je.BulletList,e.basePos,e.next);let r=X$(e,e.pos+1);return n.startContext(Je.ListItem,e.basePos,r-e.baseIndent),n.addNode(Je.ListMark,n.lineStart+e.pos,n.lineStart+e.pos+t),e.moveBaseColumn(r),null},OrderedList(n,e){let t=rP(e,n,!1);if(t<0)return!1;n.block.type!=Je.OrderedList&&n.startContext(Je.OrderedList,e.basePos,e.text.charCodeAt(e.pos+t-1));let r=X$(e,e.pos+t);return n.startContext(Je.ListItem,e.basePos,r-e.baseIndent),n.addNode(Je.ListMark,n.lineStart+e.pos,n.lineStart+e.pos+t),e.moveBaseColumn(r),null},ATXHeading(n,e){let t=QL(e);if(t<0)return!1;let r=e.pos,i=n.lineStart+r,s=W$(e.text,e.text.length,r),o=s;for(;o>r&&e.text.charCodeAt(o-1)==e.next;)o--;(o==s||o==r||!Fs(e.text.charCodeAt(o-1)))&&(o=e.text.length);let a=n.buffer.write(Je.HeaderMark,0,t).writeElements(n.parser.parseInline(e.text.slice(r+t+1,o),i+t+1),-i);o<e.text.length&&a.write(Je.HeaderMark,o-r,s-r);let l=a.finish(Je.ATXHeading1-1+t,e.text.length-r);return n.nextLine(),n.addNode(l,i),!0},HTMLBlock(n,e){let t=NL(e,n,!1);if(t<0)return!1;let r=n.lineStart+e.pos,i=hw[t][1],s=[],o=i!=dw;for(;!i.test(e.text)&&n.nextLine();){if(e.depth<n.stack.length){o=!1;break}for(let c of e.markers)s.push(c)}o&&n.nextLine();let a=i==IL?Je.CommentBlock:i==jL?Je.ProcessingInstructionBlock:Je.HTMLBlock,l=n.prevLineEnd();return n.addNode(n.buffer.writeElements(s,-r).finish(a,l-r),r),!0},SetextHeading:void 0};class Ore{constructor(e){this.stage=0,this.elts=[],this.pos=0,this.start=e.start,this.advance(e.content)}nextLine(e,t,r){if(this.stage==-1)return!1;let i=r.content+`
|
|
166
|
+
`+t.scrub(),s=this.advance(i);return s>-1&&s<i.length?this.complete(e,r,s):!1}finish(e,t){return(this.stage==2||this.stage==3)&&Dd(t.content,this.pos)==t.content.length?this.complete(e,t,t.content.length):!1}complete(e,t,r){return e.addLeafElement(t,Tn(Je.LinkReference,this.start,this.start+r,this.elts)),!0}nextStage(e){return e?(this.pos=e.to-this.start,this.elts.push(e),this.stage++,!0):(e===!1&&(this.stage=-1),!1)}advance(e){for(;;){if(this.stage==-1)return-1;if(this.stage==0){if(!this.nextStage(zL(e,this.pos,this.start,!0)))return-1;if(e.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(Tn(Je.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(WL(e,Dd(e,this.pos),this.start)))return-1}else if(this.stage==2){let t=Dd(e,this.pos),r=0;if(t>this.pos){let i=XL(e,t,this.start);if(i){let s=cb(e,i.to-this.start);s>0&&(this.nextStage(i),r=s)}}return r||(r=cb(e,this.pos)),r>0&&r<e.length?r:-1}else return cb(e,this.pos)}}}function cb(n,e){for(;e<n.length;e++){let t=n.charCodeAt(e);if(t==10)break;if(!Fs(t))return-1}return e}class vre{nextLine(e,t,r){let i=t.depth<e.stack.length?-1:DL(t),s=t.next;if(i<0)return!1;let o=Tn(Je.HeaderMark,e.lineStart+t.pos,e.lineStart+i);return e.nextLine(),e.addLeafElement(r,Tn(s==61?Je.SetextHeading1:Je.SetextHeading2,r.start,e.prevLineEnd(),[...e.parser.parseInline(r.content,r.start),o])),!0}finish(){return!1}}const LL={LinkReference(n,e){return e.content.charCodeAt(0)==91?new Ore(e):null},SetextHeading(){return new vre}},yre=[(n,e)=>QL(e)>=0,(n,e)=>AL(e)>=0,(n,e)=>$L(e)>=0,(n,e)=>nP(e,n,!0)>=0,(n,e)=>rP(e,n,!0)>=0,(n,e)=>tP(e,n,!0)>=0,(n,e)=>NL(e,n,!0)>=0],bre={text:"",end:0};class Sre{constructor(e,t,r,i){this.parser=e,this.input=t,this.ranges=i,this.line=new gre,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=i[i.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=i[0].from,this.block=DO.create(Je.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=r.length?new xre(r,t):null,this.readLine()}get parsedPos(){return this.absoluteLineStart}advance(){if(this.stoppedAt!=null&&this.absoluteLineStart>this.stoppedAt)return this.finish();let{line:e}=this;for(;;){for(let r=0;;){let i=e.depth<this.stack.length?this.stack[this.stack.length-1]:null;for(;r<e.markers.length&&(!i||e.markers[r].from<i.end);){let s=e.markers[r++];this.addNode(s.type,s.from,s.to)}if(!i)break;this.finishContext()}if(e.pos<e.text.length)break;if(!this.nextLine())return this.finish()}if(this.fragments&&this.reuseFragment(e.basePos))return null;e:for(;;){for(let r of this.parser.blockParsers)if(r){let i=r(this,e);if(i!=!1){if(i==!0)return null;e.forward();continue e}}break}let t=new mre(this.lineStart+e.pos,e.text.slice(e.pos));for(let r of this.parser.leafBlockParsers)if(r){let i=r(this,t);i&&t.parsers.push(i)}e:for(;this.nextLine()&&e.pos!=e.text.length;){if(e.indent<e.baseIndent+4){for(let r of this.parser.endLeafBlock)if(r(this,e,t))break e}for(let r of t.parsers)if(r.nextLine(this,e,t))return null;t.content+=`
|
|
167
|
+
`+e.scrub();for(let r of e.markers)t.marks.push(r)}return this.finishLeaf(t),null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}reuseFragment(e){if(!this.fragments.moveTo(this.absoluteLineStart+e,this.absoluteLineStart)||!this.fragments.matches(this.block.hash))return!1;let t=this.fragments.takeNodes(this);return t?(this.absoluteLineStart+=t,this.lineStart=YL(this.absoluteLineStart,this.ranges),this.moveRangeI(),this.absoluteLineStart<this.to?(this.lineStart++,this.absoluteLineStart++,this.readLine()):(this.atEnd=!0,this.readLine()),!0):!1}get depth(){return this.stack.length}parentType(e=this.depth-1){return this.parser.nodeSet.types[this.stack[e].type]}nextLine(){return this.lineStart+=this.line.text.length,this.absoluteLineEnd>=this.to?(this.absoluteLineStart=this.absoluteLineEnd,this.atEnd=!0,this.readLine(),!1):(this.lineStart++,this.absoluteLineStart=this.absoluteLineEnd+1,this.moveRangeI(),this.readLine(),!0)}peekLine(){return this.scanLine(this.absoluteLineEnd+1).text}moveRangeI(){for(;this.rangeI<this.ranges.length-1&&this.absoluteLineStart>=this.ranges[this.rangeI].to;)this.rangeI++,this.absoluteLineStart=Math.max(this.absoluteLineStart,this.ranges[this.rangeI].from)}scanLine(e){let t=bre;if(t.end=e,e>=this.to)t.text="";else if(t.text=this.lineChunkAt(e),t.end+=t.text.length,this.ranges.length>1){let r=this.absoluteLineStart,i=this.rangeI;for(;this.ranges[i].to<t.end;){i++;let s=this.ranges[i].from,o=this.lineChunkAt(s);t.end=s+o.length,t.text=t.text.slice(0,this.ranges[i-1].to-r)+o,r=t.end-t.text.length}}return t}readLine(){let{line:e}=this,{text:t,end:r}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=r,e.reset(t);e.depth<this.stack.length;e.depth++){let i=this.stack[e.depth],s=this.parser.skipContextMarkup[i.type];if(!s)throw new Error("Unhandled block context "+Je[i.type]);if(!s(i,this,e))break;e.forward()}}lineChunkAt(e){let t=this.input.chunk(e),r;if(this.input.lineChunks)r=t==`
|
|
168
|
+
`?"":t;else{let i=t.indexOf(`
|
|
169
|
+
`);r=i<0?t:t.slice(0,i)}return e+r.length>this.to?r.slice(0,this.to-e):r}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(e,t,r=0){this.block=DO.create(e,r,this.lineStart+t,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(e,t,r=0){this.startContext(this.parser.getNodeType(e),t,r)}addNode(e,t,r){typeof e=="number"&&(e=new Un(this.parser.nodeSet.types[e],af,af,(r??this.prevLineEnd())-t)),this.block.addChild(e,t-this.block.from)}addElement(e){this.block.addChild(e.toTree(this.parser.nodeSet),e.from-this.block.from)}addLeafElement(e,t){this.addNode(this.buffer.writeElements(gw(t.children,e.marks),-t.from).finish(t.type,t.to-t.from),t.from)}finishContext(){let e=this.stack.pop(),t=this.stack[this.stack.length-1];t.addChild(e.toTree(this.parser.nodeSet),e.from-t.from),this.block=t}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(e){return this.ranges.length>1?qL(this.ranges,0,e.topNode,this.ranges[0].from,this.reusePlaceholders):e}finishLeaf(e){for(let r of e.parsers)if(r.finish(this,e))return;let t=gw(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(t,-e.start).finish(Je.Paragraph,e.content.length),e.start)}elt(e,t,r,i){return typeof e=="string"?Tn(this.parser.getNodeType(e),t,r,i):new FL(e,t)}get buffer(){return new BL(this.parser.nodeSet)}}function qL(n,e,t,r,i){let s=n[e].to,o=[],a=[],l=t.from+r;function c(u,d){for(;d?u>=s:u>s;){let h=n[e+1].from-s;r+=h,u+=h,e++,s=n[e].to}}for(let u=t.firstChild;u;u=u.nextSibling){c(u.from+r,!0);let d=u.from+r,h,m=i.get(u.tree);m?h=m:u.to+r>s?(h=qL(n,e,u,r,i),c(u.to+r,!1)):h=u.toTree(),o.push(h),a.push(d-l)}return c(t.to+r,!1),new Un(t.type,o,a,t.to+r-l,t.tree?t.tree.propValues:void 0)}class mv extends ck{constructor(e,t,r,i,s,o,a,l,c){super(),this.nodeSet=e,this.blockParsers=t,this.leafBlockParsers=r,this.blockNames=i,this.endLeafBlock=s,this.skipContextMarkup=o,this.inlineParsers=a,this.inlineNames=l,this.wrappers=c,this.nodeTypes=Object.create(null);for(let u of e.types)this.nodeTypes[u.name]=u.id}createParse(e,t,r){let i=new Sre(this,e,t,r);for(let s of this.wrappers)i=s(i,e,t,r);return i}configure(e){let t=pw(e);if(!t)return this;let{nodeSet:r,skipContextMarkup:i}=this,s=this.blockParsers.slice(),o=this.leafBlockParsers.slice(),a=this.blockNames.slice(),l=this.inlineParsers.slice(),c=this.inlineNames.slice(),u=this.endLeafBlock.slice(),d=this.wrappers;if(Od(t.defineNodes)){i=Object.assign({},i);let h=r.types.slice(),m;for(let g of t.defineNodes){let{name:O,block:y,composite:b,style:S}=typeof g=="string"?{name:g}:g;if(h.some(x=>x.name==O))continue;b&&(i[h.length]=(x,A,M)=>b(A,M,x.value));let P=h.length,k=b?["Block","BlockContext"]:y?P>=Je.ATXHeading1&&P<=Je.SetextHeading2?["Block","LeafBlock","Heading"]:["Block","LeafBlock"]:void 0;h.push(ti.define({id:P,name:O,props:k&&[[en.group,k]]})),S&&(m||(m={}),Array.isArray(S)||S instanceof Os?m[O]=S:Object.assign(m,S))}r=new vh(h),m&&(r=r.extend(Dl(m)))}if(Od(t.props)&&(r=r.extend(...t.props)),Od(t.remove))for(let h of t.remove){let m=this.blockNames.indexOf(h),g=this.inlineNames.indexOf(h);m>-1&&(s[m]=o[m]=void 0),g>-1&&(l[g]=void 0)}if(Od(t.parseBlock))for(let h of t.parseBlock){let m=a.indexOf(h.name);if(m>-1)s[m]=h.parse,o[m]=h.leaf;else{let g=h.before?sg(a,h.before):h.after?sg(a,h.after)+1:a.length-1;s.splice(g,0,h.parse),o.splice(g,0,h.leaf),a.splice(g,0,h.name)}h.endLeaf&&u.push(h.endLeaf)}if(Od(t.parseInline))for(let h of t.parseInline){let m=c.indexOf(h.name);if(m>-1)l[m]=h.parse;else{let g=h.before?sg(c,h.before):h.after?sg(c,h.after)+1:c.length-1;l.splice(g,0,h.parse),c.splice(g,0,h.name)}}return t.wrap&&(d=d.concat(t.wrap)),new mv(r,s,o,a,u,i,l,c,d)}getNodeType(e){let t=this.nodeTypes[e];if(t==null)throw new RangeError(`Unknown node type '${e}'`);return t}parseInline(e,t){let r=new kre(this,e,t);e:for(let i=t;i<r.end;){let s=r.char(i);for(let o of this.inlineParsers)if(o){let a=o(r,s,i);if(a>=0){i=a;continue e}}i++}return r.resolveMarkers(0)}}function Od(n){return n!=null&&n.length>0}function pw(n){if(!Array.isArray(n))return n;if(n.length==0)return null;let e=pw(n[0]);if(n.length==1)return e;let t=pw(n.slice(1));if(!t||!e)return e||t;let r=(o,a)=>(o||af).concat(a||af),i=e.wrap,s=t.wrap;return{props:r(e.props,t.props),defineNodes:r(e.defineNodes,t.defineNodes),parseBlock:r(e.parseBlock,t.parseBlock),parseInline:r(e.parseInline,t.parseInline),remove:r(e.remove,t.remove),wrap:i?s?(o,a,l,c)=>i(s(o,a,l,c),a,l,c):i:s}}function sg(n,e){let t=n.indexOf(e);if(t<0)throw new RangeError(`Position specified relative to unknown parser ${e}`);return t}let UL=[ti.none];for(let n=1,e;e=Je[n];n++)UL[n]=ti.define({id:n,name:e,props:n>=Je.Escape?[]:[[en.group,n in RL?["Block","BlockContext"]:["Block","LeafBlock"]]],top:e=="Document"});const af=[];class BL{constructor(e){this.nodeSet=e,this.content=[],this.nodes=[]}write(e,t,r,i=0){return this.content.push(e,t,r,4+i*4),this}writeElements(e,t=0){for(let r of e)r.writeTo(this,t);return this}finish(e,t){return Un.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:e,length:t})}}let ch=class{constructor(e,t,r,i=af){this.type=e,this.from=t,this.to=r,this.children=i}writeTo(e,t){let r=e.content.length;e.writeElements(this.children,t),e.content.push(this.type,this.from+t,this.to+t,e.content.length+4-r)}toTree(e){return new BL(e).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}};class FL{constructor(e,t){this.tree=e,this.from=t}get to(){return this.from+this.tree.length}get type(){return this.tree.type.id}get children(){return af}writeTo(e,t){e.nodes.push(this.tree),e.content.push(e.nodes.length-1,this.from+t,this.to+t,-1)}toTree(){return this.tree}}function Tn(n,e,t,r){return new ch(n,e,t,r)}const VL={resolve:"Emphasis",mark:"EmphasisMark"},ZL={resolve:"Emphasis",mark:"EmphasisMark"},ku={},mw={};class $s{constructor(e,t,r,i){this.type=e,this.from=t,this.to=r,this.side=i}}const z$="!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~";let uh=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{uh=new RegExp("[\\p{S}|\\p{P}]","u")}catch{}const ub={Escape(n,e,t){if(e!=92||t==n.end-1)return-1;let r=n.char(t+1);for(let i=0;i<z$.length;i++)if(z$.charCodeAt(i)==r)return n.append(Tn(Je.Escape,t,t+2));return-1},Entity(n,e,t){if(e!=38)return-1;let r=/^(?:#\d+|#x[a-f\d]+|\w+);/i.exec(n.slice(t+1,t+31));return r?n.append(Tn(Je.Entity,t,t+1+r[0].length)):-1},InlineCode(n,e,t){if(e!=96||t&&n.char(t-1)==96)return-1;let r=t+1;for(;r<n.end&&n.char(r)==96;)r++;let i=r-t,s=0;for(;r<n.end;r++)if(n.char(r)==96){if(s++,s==i&&n.char(r+1)!=96)return n.append(Tn(Je.InlineCode,t,r+1,[Tn(Je.CodeMark,t,t+i),Tn(Je.CodeMark,r+1-i,r+1)]))}else s=0;return-1},HTMLTag(n,e,t){if(e!=60||t==n.end-1)return-1;let r=n.slice(t+1,n.end),i=/^(?:[a-z][-\w+.]+:[^\s>]+|[a-z\d.!#$%&'*+/=?^_`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*)>/i.exec(r);if(i)return n.append(Tn(Je.Autolink,t,t+1+i[0].length,[Tn(Je.LinkMark,t,t+1),Tn(Je.URL,t+1,t+i[0].length),Tn(Je.LinkMark,t+i[0].length,t+1+i[0].length)]));let s=/^!--[^>](?:-[^-]|[^-])*?-->/i.exec(r);if(s)return n.append(Tn(Je.Comment,t,t+1+s[0].length));let o=/^\?[^]*?\?>/.exec(r);if(o)return n.append(Tn(Je.ProcessingInstruction,t,t+1+o[0].length));let a=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(r);return a?n.append(Tn(Je.HTMLTag,t,t+1+a[0].length)):-1},Emphasis(n,e,t){if(e!=95&&e!=42)return-1;let r=t+1;for(;n.char(r)==e;)r++;let i=n.slice(t-1,t),s=n.slice(r,r+1),o=uh.test(i),a=uh.test(s),l=/\s|^$/.test(i),c=/\s|^$/.test(s),u=!c&&(!a||l||o),d=!l&&(!o||c||a),h=u&&(e==42||!d||o),m=d&&(e==42||!u||a);return n.append(new $s(e==95?VL:ZL,t,r,(h?1:0)|(m?2:0)))},HardBreak(n,e,t){if(e==92&&n.char(t+1)==10)return n.append(Tn(Je.HardBreak,t,t+2));if(e==32){let r=t+1;for(;n.char(r)==32;)r++;if(n.char(r)==10&&r>=t+2)return n.append(Tn(Je.HardBreak,t,r+1))}return-1},Link(n,e,t){return e==91?n.append(new $s(ku,t,t+1,1)):-1},Image(n,e,t){return e==33&&n.char(t+1)==91?n.append(new $s(mw,t,t+2,1)):-1},LinkEnd(n,e,t){if(e!=93)return-1;for(let r=n.parts.length-1;r>=0;r--){let i=n.parts[r];if(i instanceof $s&&(i.type==ku||i.type==mw)){if(!i.side||n.skipSpace(i.to)==t&&!/[(\[]/.test(n.slice(t+1,t+2)))return n.parts[r]=null,-1;let s=n.takeContent(r),o=n.parts[r]=wre(n,s,i.type==ku?Je.Link:Je.Image,i.from,t+1);if(i.type==ku)for(let a=0;a<r;a++){let l=n.parts[a];l instanceof $s&&l.type==ku&&(l.side=0)}return o.to}}return-1}};function wre(n,e,t,r,i){let{text:s}=n,o=n.char(i),a=i;if(e.unshift(Tn(Je.LinkMark,r,r+(t==Je.Image?2:1))),e.push(Tn(Je.LinkMark,i-1,i)),o==40){let l=n.skipSpace(i+1),c=WL(s,l-n.offset,n.offset),u;c&&(l=n.skipSpace(c.to),l!=c.to&&(u=XL(s,l-n.offset,n.offset),u&&(l=n.skipSpace(u.to)))),n.char(l)==41&&(e.push(Tn(Je.LinkMark,i,i+1)),a=l+1,c&&e.push(c),u&&e.push(u),e.push(Tn(Je.LinkMark,l,a)))}else if(o==91){let l=zL(s,i-n.offset,n.offset,!1);l&&(e.push(l),a=l.to)}return Tn(t,r,a,e)}function WL(n,e,t){if(n.charCodeAt(e)==60){for(let i=e+1;i<n.length;i++){let s=n.charCodeAt(i);if(s==62)return Tn(Je.URL,e+t,i+1+t);if(s==60||s==10)return!1}return null}else{let i=0,s=e;for(let o=!1;s<n.length;s++){let a=n.charCodeAt(s);if(Fs(a))break;if(o)o=!1;else if(a==40)i++;else if(a==41){if(!i)break;i--}else a==92&&(o=!0)}return s>e?Tn(Je.URL,e+t,s+t):s==n.length?null:!1}}function XL(n,e,t){let r=n.charCodeAt(e);if(r!=39&&r!=34&&r!=40)return!1;let i=r==40?41:r;for(let s=e+1,o=!1;s<n.length;s++){let a=n.charCodeAt(s);if(o)o=!1;else{if(a==i)return Tn(Je.LinkTitle,e+t,s+1+t);a==92&&(o=!0)}}return null}function zL(n,e,t,r){for(let i=!1,s=e+1,o=Math.min(n.length,s+999);s<o;s++){let a=n.charCodeAt(s);if(i)i=!1;else{if(a==93)return r?!1:Tn(Je.LinkLabel,e+t,s+1+t);if(r&&!Fs(a)&&(r=!1),a==91)return!1;a==92&&(i=!0)}}return null}class kre{constructor(e,t,r){this.parser=e,this.text=t,this.offset=r,this.parts=[]}char(e){return e>=this.end?-1:this.text.charCodeAt(e-this.offset)}get end(){return this.offset+this.text.length}slice(e,t){return this.text.slice(e-this.offset,t-this.offset)}append(e){return this.parts.push(e),e.to}addDelimiter(e,t,r,i,s){return this.append(new $s(e,t,r,(i?1:0)|(s?2:0)))}get hasOpenLink(){for(let e=this.parts.length-1;e>=0;e--){let t=this.parts[e];if(t instanceof $s&&(t.type==ku||t.type==mw))return!0}return!1}addElement(e){return this.append(e)}resolveMarkers(e){for(let r=e;r<this.parts.length;r++){let i=this.parts[r];if(!(i instanceof $s&&i.type.resolve&&i.side&2))continue;let s=i.type==VL||i.type==ZL,o=i.to-i.from,a,l=r-1;for(;l>=e;l--){let O=this.parts[l];if(O instanceof $s&&O.side&1&&O.type==i.type&&!(s&&(i.side&1||O.side&2)&&(O.to-O.from+o)%3==0&&((O.to-O.from)%3||o%3))){a=O;break}}if(!a)continue;let c=i.type.resolve,u=[],d=a.from,h=i.to;if(s){let O=Math.min(2,a.to-a.from,o);d=a.to-O,h=i.from+O,c=O==1?"Emphasis":"StrongEmphasis"}a.type.mark&&u.push(this.elt(a.type.mark,d,a.to));for(let O=l+1;O<r;O++)this.parts[O]instanceof ch&&u.push(this.parts[O]),this.parts[O]=null;i.type.mark&&u.push(this.elt(i.type.mark,i.from,h));let m=this.elt(c,d,h,u);this.parts[l]=s&&a.from!=d?new $s(a.type,a.from,d,a.side):null,(this.parts[r]=s&&i.to!=h?new $s(i.type,h,i.to,i.side):null)?this.parts.splice(r,0,m):this.parts[r]=m}let t=[];for(let r=e;r<this.parts.length;r++){let i=this.parts[r];i instanceof ch&&t.push(i)}return t}findOpeningDelimiter(e){for(let t=this.parts.length-1;t>=0;t--){let r=this.parts[t];if(r instanceof $s&&r.type==e)return t}return null}takeContent(e){let t=this.resolveMarkers(e);return this.parts.length=e,t}skipSpace(e){return Dd(this.text,e-this.offset)+this.offset}elt(e,t,r,i){return typeof e=="string"?Tn(this.parser.getNodeType(e),t,r,i):new FL(e,t)}}function gw(n,e){if(!e.length)return n;if(!n.length)return e;let t=n.slice(),r=0;for(let i of e){for(;r<t.length&&t[r].to<i.to;)r++;if(r<t.length&&t[r].from<i.from){let s=t[r];s instanceof ch&&(t[r]=new ch(s.type,s.from,s.to,gw(s.children,[i])))}else t.splice(r++,0,i)}return t}const Pre=[Je.CodeBlock,Je.ListItem,Je.OrderedList,Je.BulletList];class xre{constructor(e,t){this.fragments=e,this.input=t,this.i=0,this.fragment=null,this.fragmentEnd=-1,this.cursor=null,e.length&&(this.fragment=e[this.i++])}nextFragment(){this.fragment=this.i<this.fragments.length?this.fragments[this.i++]:null,this.cursor=null,this.fragmentEnd=-1}moveTo(e,t){for(;this.fragment&&this.fragment.to<=e;)this.nextFragment();if(!this.fragment||this.fragment.from>(e?e-1:0))return!1;if(this.fragmentEnd<0){let s=this.fragment.to;for(;s>0&&this.input.read(s-1,s)!=`
|
|
170
|
+
`;)s--;this.fragmentEnd=s?s-1:0}let r=this.cursor;r||(r=this.cursor=this.fragment.tree.cursor(),r.firstChild());let i=e+this.fragment.offset;for(;r.to<=i;)if(!r.parent())return!1;for(;;){if(r.from>=i)return this.fragment.from<=t;if(!r.childAfter(i))return!1}}matches(e){let t=this.cursor.tree;return t&&t.prop(en.contextHash)==e}takeNodes(e){let t=this.cursor,r=this.fragment.offset,i=this.fragmentEnd-(this.fragment.openEnd?1:0),s=e.absoluteLineStart,o=s,a=e.block.children.length,l=o,c=a;for(;;){if(t.to-r>i){if(t.type.isAnonymous&&t.firstChild())continue;break}let u=YL(t.from-r,e.ranges);if(t.to-r<=e.ranges[e.rangeI].to)e.addNode(t.tree,u);else{let d=new Un(e.parser.nodeSet.types[Je.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(d,t.tree),e.addNode(d,u)}if(t.type.is("Block")&&(Pre.indexOf(t.type.id)<0?(o=t.to-r,a=e.block.children.length):(o=l,a=c,l=t.to-r,c=e.block.children.length)),!t.nextSibling())break}for(;e.block.children.length>a;)e.block.children.pop(),e.block.positions.pop();return o-s}}function YL(n,e){let t=n;for(let r=1;r<e.length;r++){let i=e[r-1].to,s=e[r].from;i<n&&(t-=s-i)}return t}const Tre=Dl({"Blockquote/...":T.quote,HorizontalRule:T.contentSeparator,"ATXHeading1/... SetextHeading1/...":T.heading1,"ATXHeading2/... SetextHeading2/...":T.heading2,"ATXHeading3/...":T.heading3,"ATXHeading4/...":T.heading4,"ATXHeading5/...":T.heading5,"ATXHeading6/...":T.heading6,"Comment CommentBlock":T.comment,Escape:T.escape,Entity:T.character,"Emphasis/...":T.emphasis,"StrongEmphasis/...":T.strong,"Link/... Image/...":T.link,"OrderedList/... BulletList/...":T.list,"BlockQuote/...":T.quote,"InlineCode CodeText":T.monospace,"URL Autolink":T.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":T.processingInstruction,"CodeInfo LinkLabel":T.labelName,LinkTitle:T.string,Paragraph:T.content}),Cre=new mv(new vh(UL).extend(Tre),Object.keys(ig).map(n=>ig[n]),Object.keys(ig).map(n=>LL[n]),Object.keys(ig),yre,RL,Object.keys(ub).map(n=>ub[n]),Object.keys(ub),[]);function _re(n,e,t){let r=[];for(let i=n.firstChild,s=e;;i=i.nextSibling){let o=i?i.from:t;if(o>s&&r.push({from:s,to:o}),!i)break;s=i.to}return r}function Ere(n){let{codeParser:e,htmlParser:t}=n;return{wrap:uk((i,s)=>{let o=i.type.id;if(e&&(o==Je.CodeBlock||o==Je.FencedCode)){let a="";if(o==Je.FencedCode){let c=i.node.getChild(Je.CodeInfo);c&&(a=s.read(c.from,c.to))}let l=e(a);if(l)return{parser:l,overlay:c=>c.type.id==Je.CodeText}}else if(t&&(o==Je.HTMLBlock||o==Je.HTMLTag))return{parser:t,overlay:_re(i.node,i.from,i.to)};return null})}}const Rre={resolve:"Strikethrough",mark:"StrikethroughMark"},Are={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":T.strikethrough}},{name:"StrikethroughMark",style:T.processingInstruction}],parseInline:[{name:"Strikethrough",parse(n,e,t){if(e!=126||n.char(t+1)!=126||n.char(t+2)==126)return-1;let r=n.slice(t-1,t),i=n.slice(t+2,t+3),s=/\s|^$/.test(r),o=/\s|^$/.test(i),a=uh.test(r),l=uh.test(i);return n.addDelimiter(Rre,t,t+2,!o&&(!l||s||a),!s&&(!a||o||l))},after:"Emphasis"}]};function Id(n,e,t=0,r,i=0){let s=0,o=!0,a=-1,l=-1,c=!1,u=()=>{r.push(n.elt("TableCell",i+a,i+l,n.parser.parseInline(e.slice(a,l),i+a)))};for(let d=t;d<e.length;d++){let h=e.charCodeAt(d);h==124&&!c?((!o||a>-1)&&s++,o=!1,r&&(a>-1&&u(),r.push(n.elt("TableDelimiter",d+i,d+i+1))),a=l=-1):(c||h!=32&&h!=9)&&(a<0&&(a=d),l=d+1),c=!c&&h==92}return a>-1&&(s++,r&&u()),s}function Y$(n,e){for(let t=e;t<n.length;t++){let r=n.charCodeAt(t);if(r==124)return!0;r==92&&t++}return!1}const GL=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class G${constructor(){this.rows=null}nextLine(e,t,r){if(this.rows==null){this.rows=!1;let i;if((t.next==45||t.next==58||t.next==124)&&GL.test(i=t.text.slice(t.pos))){let s=[];Id(e,r.content,0,s,r.start)==Id(e,i,t.pos)&&(this.rows=[e.elt("TableHeader",r.start,r.start+r.content.length,s),e.elt("TableDelimiter",e.lineStart+t.pos,e.lineStart+t.text.length)])}}else if(this.rows){let i=[];Id(e,t.text,t.pos,i,e.lineStart),this.rows.push(e.elt("TableRow",e.lineStart+t.pos,e.lineStart+t.text.length,i))}return!1}finish(e,t){return this.rows?(e.addLeafElement(t,e.elt("Table",t.start,t.start+t.content.length,this.rows)),!0):!1}}const $re={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":T.heading}},"TableRow",{name:"TableCell",style:T.content},{name:"TableDelimiter",style:T.processingInstruction}],parseBlock:[{name:"Table",leaf(n,e){return Y$(e.content,0)?new G$:null},endLeaf(n,e,t){if(t.parsers.some(i=>i instanceof G$)||!Y$(e.text,e.basePos))return!1;let r=n.peekLine();return GL.test(r)&&Id(n,e.text,e.basePos)==Id(n,r,e.basePos)},before:"SetextHeading"}]};class Mre{nextLine(){return!1}finish(e,t){return e.addLeafElement(t,e.elt("Task",t.start,t.start+t.content.length,[e.elt("TaskMarker",t.start,t.start+3),...e.parser.parseInline(t.content.slice(3),t.start+3)])),!0}}const Qre={defineNodes:[{name:"Task",block:!0,style:T.list},{name:"TaskMarker",style:T.atom}],parseBlock:[{name:"TaskList",leaf(n,e){return/^\[[ xX]\][ \t]/.test(e.content)&&n.parentType().name=="ListItem"?new Mre:null},after:"SetextHeading"}]},H$=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,K$=/[\w-]+(\.[\w-]+)+(\/[^\s<]*)?/gy,Dre=/[\w-]+\.[\w-]+($|\/)/,J$=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,eM=/\/[a-zA-Z\d@.]+/gy;function tM(n,e,t,r){let i=0;for(let s=e;s<t;s++)n[s]==r&&i++;return i}function Ire(n,e){K$.lastIndex=e;let t=K$.exec(n);if(!t||Dre.exec(t[0])[0].indexOf("_")>-1)return-1;let r=e+t[0].length;for(;;){let i=n[r-1],s;if(/[?!.,:*_~]/.test(i)||i==")"&&tM(n,e,r,")")>tM(n,e,r,"("))r--;else if(i==";"&&(s=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(n.slice(e,r))))r=e+s.index;else break}return r}function nM(n,e){J$.lastIndex=e;let t=J$.exec(n);if(!t)return-1;let r=t[0][t[0].length-1];return r=="_"||r=="-"?-1:e+t[0].length-(r=="."?1:0)}const jre={parseInline:[{name:"Autolink",parse(n,e,t){let r=t-n.offset;if(r&&/\w/.test(n.text[r-1]))return-1;H$.lastIndex=r;let i=H$.exec(n.text),s=-1;if(!i)return-1;if(i[1]||i[2]){if(s=Ire(n.text,r+i[0].length),s>-1&&n.hasOpenLink){let o=/([^\[\]]|\[[^\]]*\])*/.exec(n.text.slice(r,s));s=r+o[0].length}}else i[3]?s=nM(n.text,r):(s=nM(n.text,r+i[0].length),s>-1&&i[0]=="xmpp:"&&(eM.lastIndex=s,i=eM.exec(n.text),i&&(s=i.index+i[0].length)));return s<0?-1:(n.addElement(n.elt("URL",t,s+n.offset)),s+n.offset)}}]},Nre=[$re,Qre,Are,jre];function HL(n,e,t){return(r,i,s)=>{if(i!=n||r.char(s+1)==n)return-1;let o=[r.elt(t,s,s+1)];for(let a=s+1;a<r.end;a++){let l=r.char(a);if(l==n)return r.addElement(r.elt(e,s,a+1,o.concat(r.elt(t,a,a+1))));if(l==92&&o.push(r.elt("Escape",a,a+++2)),Fs(l))break}return-1}}const Lre={defineNodes:[{name:"Superscript",style:T.special(T.content)},{name:"SuperscriptMark",style:T.processingInstruction}],parseInline:[{name:"Superscript",parse:HL(94,"Superscript","SuperscriptMark")}]},qre={defineNodes:[{name:"Subscript",style:T.special(T.content)},{name:"SubscriptMark",style:T.processingInstruction}],parseInline:[{name:"Subscript",parse:HL(126,"Subscript","SubscriptMark")}]},Ure={defineNodes:[{name:"Emoji",style:T.character}],parseInline:[{name:"Emoji",parse(n,e,t){let r;return e!=58||!(r=/^[a-zA-Z_0-9]+:/.exec(n.slice(t+1,n.end)))?-1:n.addElement(n.elt("Emoji",t,t+1+r[0].length))}}]},KL=fk({commentTokens:{block:{open:"<!--",close:"-->"}}}),JL=new en,e3=Cre.configure({props:[Il.add(n=>!n.is("Block")||n.is("Document")||Ow(n)!=null||Bre(n)?void 0:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})),JL.add(Ow),$c.add({Document:()=>null}),Oc.add({Document:KL})]});function Ow(n){let e=/^(?:ATX|Setext)Heading(\d)$/.exec(n.name);return e?+e[1]:void 0}function Bre(n){return n.name=="OrderedList"||n.name=="BulletList"}function Fre(n,e){let t=n;for(;;){let r=t.nextSibling,i;if(!r||(i=Ow(r.type))!=null&&i<=e)break;t=r}return t.to}const Vre=k5.of((n,e,t)=>{for(let r=pr(n).resolveInner(t,-1);r&&!(r.from<e);r=r.parent){let i=r.type.prop(JL);if(i==null)continue;let s=Fre(r,i);if(s>t)return{from:t,to:s}}return null});function iP(n){return new Ds(KL,n,[Vre],"markdown")}const Zre=iP(e3),Wre=e3.configure([Nre,qre,Lre,Ure,{props:[Il.add({Table:(n,e)=>({from:e.doc.lineAt(n.from).to,to:n.to})})]}]),t3=iP(Wre);function Xre(n,e){return t=>{if(t&&n){let r=null;if(t=/\S*/.exec(t)[0],typeof n=="function"?r=n(t):r=dO.matchLanguageName(n,t,!0),r instanceof dO)return r.support?r.support.language.parser:Kd.getSkippingParser(r.load());if(r)return r.parser}return e?e.parser:null}}class fb{constructor(e,t,r,i,s,o,a){this.node=e,this.from=t,this.to=r,this.spaceBefore=i,this.spaceAfter=s,this.type=o,this.item=a}blank(e,t=!0){let r=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(e!=null){for(;r.length<e;)r+=" ";return r}else{for(let i=this.to-this.from-r.length-this.spaceAfter.length;i>0;i--)r+=" ";return r+(t?this.spaceAfter:"")}}marker(e,t){let r=this.node.name=="OrderedList"?String(+r3(this.item,e)[2]+t):"";return this.spaceBefore+r+this.type+this.spaceAfter}}function n3(n,e){let t=[],r=[];for(let i=n;i;i=i.parent){if(i.name=="FencedCode")return r;(i.name=="ListItem"||i.name=="Blockquote")&&t.push(i)}for(let i=t.length-1;i>=0;i--){let s=t[i],o,a=e.lineAt(s.from),l=s.from-a.from;if(s.name=="Blockquote"&&(o=/^ *>( ?)/.exec(a.text.slice(l))))r.push(new fb(s,l,l+o[0].length,"",o[1],">",null));else if(s.name=="ListItem"&&s.parent.name=="OrderedList"&&(o=/^( *)\d+([.)])( *)/.exec(a.text.slice(l)))){let c=o[3],u=o[0].length;c.length>=4&&(c=c.slice(0,c.length-4),u-=4),r.push(new fb(s.parent,l,l+u,o[1],c,o[2],s))}else if(s.name=="ListItem"&&s.parent.name=="BulletList"&&(o=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(a.text.slice(l)))){let c=o[4],u=o[0].length;c.length>4&&(c=c.slice(0,c.length-4),u-=4);let d=o[2];o[3]&&(d+=o[3].replace(/[xX]/," ")),r.push(new fb(s.parent,l,l+u,o[1],c,d,s))}}return r}function r3(n,e){return/^(\s*)(\d+)(?=[.)])/.exec(e.sliceString(n.from,n.from+10))}function db(n,e,t,r=0){for(let i=-1,s=n;;){if(s.name=="ListItem"){let a=r3(s,e),l=+a[2];if(i>=0){if(l!=i+1)return;t.push({from:s.from+a[1].length,to:s.from+a[0].length,insert:String(i+2+r)})}i=l}let o=s.nextSibling;if(!o)break;s=o}}function sP(n,e){let t=/^[ \t]*/.exec(n)[0].length;if(!t||e.facet(yh)!=" ")return n;let r=fo(n,4,t),i="";for(let s=r;s>0;)s>=4?(i+=" ",s-=4):(i+=" ",s--);return i+n.slice(t)}const zre=({state:n,dispatch:e})=>{let t=pr(n),{doc:r}=n,i=null,s=n.changeByRange(o=>{if(!o.empty||!t3.isActiveAt(n,o.from,0))return i={range:o};let a=o.from,l=r.lineAt(a),c=n3(t.resolveInner(a,-1),r);for(;c.length&&c[c.length-1].from>a-l.from;)c.pop();if(!c.length)return i={range:o};let u=c[c.length-1];if(u.to-u.spaceAfter.length>a-l.from)return i={range:o};let d=a>=u.to-u.spaceAfter.length&&!/\S/.test(l.text.slice(u.to));if(u.item&&d){let y=u.node.firstChild,b=u.node.getChild("ListItem","ListItem");if(y.to>=a||b&&b.to<a||l.from>0&&!/[^\s>]/.test(r.lineAt(l.from-1).text)){let S=c.length>1?c[c.length-2]:null,P,k="";S&&S.item?(P=l.from+S.from,k=S.marker(r,1)):P=l.from+(S?S.to:0);let x=[{from:P,to:a,insert:k}];return u.node.name=="OrderedList"&&db(u.item,r,x,-2),S&&S.node.name=="OrderedList"&&db(S.item,r,x),{range:_e.cursor(P+k.length),changes:x}}else{let S=iM(c,n,l);return{range:_e.cursor(a+S.length+1),changes:{from:l.from,insert:S+n.lineBreak}}}}if(u.node.name=="Blockquote"&&d&&l.from){let y=r.lineAt(l.from-1),b=/>\s*$/.exec(y.text);if(b&&b.index==u.from){let S=n.changes([{from:y.from+b.index,to:y.to},{from:l.from+u.from,to:l.to}]);return{range:o.map(S),changes:S}}}let h=[];u.node.name=="OrderedList"&&db(u.item,r,h);let m=u.item&&u.item.from<l.from,g="";if(!m||/^[\s\d.)\-+*>]*/.exec(l.text)[0].length>=u.to)for(let y=0,b=c.length-1;y<=b;y++)g+=y==b&&!m?c[y].marker(r,1):c[y].blank(y<b?fo(l.text,4,c[y+1].from)-g.length:null);let O=a;for(;O>l.from&&/\s/.test(l.text.charAt(O-l.from-1));)O--;return g=sP(g,n),Yre(u.node,n.doc)&&(g=iM(c,n,l)+n.lineBreak+g),h.push({from:O,to:a,insert:n.lineBreak+g}),{range:_e.cursor(O+g.length+1),changes:h}});return i?!1:(e(n.update(s,{scrollIntoView:!0,userEvent:"input"})),!0)};function rM(n){return n.name=="QuoteMark"||n.name=="ListMark"}function Yre(n,e){if(n.name!="OrderedList"&&n.name!="BulletList")return!1;let t=n.firstChild,r=n.getChild("ListItem","ListItem");if(!r)return!1;let i=e.lineAt(t.to),s=e.lineAt(r.from),o=/^[\s>]*$/.test(i.text);return i.number+(o?0:1)<s.number}function iM(n,e,t){let r="";for(let i=0,s=n.length-2;i<=s;i++)r+=n[i].blank(i<s?fo(t.text,4,Math.min(t.text.length,n[i+1].from))-r.length:null,i<s);return sP(r,e)}function Gre(n,e){let t=n.resolveInner(e,-1),r=e;rM(t)&&(r=t.from,t=t.parent);for(let i;i=t.childBefore(r);)if(rM(i))r=i.from;else if(i.name=="OrderedList"||i.name=="BulletList")t=i.lastChild,r=t.to;else break;return t}const Hre=({state:n,dispatch:e})=>{let t=pr(n),r=null,i=n.changeByRange(s=>{let o=s.from,{doc:a}=n;if(s.empty&&t3.isActiveAt(n,s.from)){let l=a.lineAt(o),c=n3(Gre(t,o),a);if(c.length){let u=c[c.length-1],d=u.to-u.spaceAfter.length+(u.spaceAfter?1:0);if(o-l.from>d&&!/\S/.test(l.text.slice(d,o-l.from)))return{range:_e.cursor(l.from+d),changes:{from:l.from+d,to:o}};if(o-l.from==d&&(!u.item||l.from<=u.item.from||!/\S/.test(l.text.slice(0,u.to)))){let h=l.from+u.from;if(u.item&&u.node.from<u.item.from&&/\S/.test(l.text.slice(u.from,u.to))){let m=u.blank(fo(l.text,4,u.to)-fo(l.text,4,u.from));return h==l.from&&(m=sP(m,n)),{range:_e.cursor(h+m.length),changes:{from:h,to:l.from+u.to,insert:m}}}if(h<o)return{range:_e.cursor(h),changes:{from:h,to:o}}}}}return r={range:s}});return r?!1:(e(n.update(i,{scrollIntoView:!0,userEvent:"delete"})),!0)},Kre=[{key:"Enter",run:zre},{key:"Backspace",run:Hre}],i3=mL({matchClosingTags:!1});function Jre(n={}){let{codeLanguages:e,defaultCodeLanguage:t,addKeymap:r=!0,base:{parser:i}=Zre,completeHTMLTags:s=!0,htmlTagLanguage:o=i3}=n;if(!(i instanceof mv))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let a=n.extensions?[n.extensions]:[],l=[o.support],c;t instanceof Ec?(l.push(t.support),c=t.language):t&&(c=t);let u=e||c?Xre(e,c):void 0;a.push(Ere({codeParser:u,htmlParser:o.language.parser})),r&&l.push(Go.high(cf.of(Kre)));let d=iP(i.configure(a));return s&&l.push(d.data.of({autocomplete:eie})),new Ec(d,l)}function eie(n){let{state:e,pos:t}=n,r=/<[:\-\.\w\u00b7-\uffff]*$/.exec(e.sliceDoc(t-25,t));if(!r)return null;let i=pr(e).resolveInner(t,-1);for(;i&&!i.type.isTop;){if(i.name=="CodeBlock"||i.name=="FencedCode"||i.name=="ProcessingInstructionBlock"||i.name=="CommentBlock"||i.name=="Link"||i.name=="Image")return null;i=i.parent}return{from:t-r[0].length,to:t,options:tie(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let hb=null;function tie(){if(hb)return hb;let n=fL(new xk(Cn.create({extensions:i3}),0,!0));return hb=n?n.options:[]}const sM=(n,e,t,r,i)=>{let s=[],o=0;return e.iterChanges((a,l,c,u,d)=>{const h=t.sliceString(a,l,`
|
|
171
|
+
`),m=d.sliceString(0,d.length,`
|
|
172
|
+
`);h&&s.push(i.remove(a+o,h)),m&&s.push(i.insert(a+o,m)),o+=m.length,o-=h.length}),s=s.reduce(i.type.compose),r.editOp(n,"text-unicode",s)},oM=n=>{const e=[];for(const t of n){const{es:r}=t;if(r!==void 0){let i=0;for(let s=0;s<r.length;s++){const o=r[s];if(typeof o=="number")i+=o;else if(typeof o=="string")if(r[s+1]&&typeof r[s+1]=="object"&&r[s+1].d!==void 0){let a=typeof r[s+1].d=="number"?r[s+1].d:r[s+1].d.length;e.push({from:i,to:i+a,insert:o}),i+=a,s++}else e.push({from:i,to:i,insert:o});else o&&o.d!==void 0&&(typeof o.d=="number"?(e.push({from:i,to:i+o.d}),i+=o.d):typeof o.d=="string"&&(e.push({from:i,to:i+o.d.length}),i+=o.d.length))}}}return e},nie=(n,e)=>{if(!n||!e)return!1;for(let t=0;t<e.length;t++)if(e[t]!==n[t])return!1;return!0},rie=({shareDBDoc:n,path:e=[],json1:t,textUnicode:r,debug:i=!1})=>Xn.fromClass(class{constructor(s){this.view=s,this.handleOp=o=>{if(this.lock||!Array.isArray(o))return;this.lock=!0;const a=Array.isArray(o[0])?o:[o];for(const l of a)nie(l,e)&&(i&&(console.log("Received op from ShareDB"),console.log(" op: "+JSON.stringify(l)),console.log(" generated changes: "+JSON.stringify(oM(l)))),s.dispatch({changes:oM(l)}));this.lock=!1},n.on("op",this.handleOp)}update(s){!this.lock&&s.docChanged&&(this.lock=!0,i&&(console.log("Received change from CodeMirror"),console.log(" changes:"+JSON.stringify(s.changes.toJSON())),console.log(" iterChanges:"),s.changes.iterChanges((o,a,l,c,u)=>{console.log(" "+JSON.stringify({fromA:o,toA:a,fromB:l,toB:c,inserted:u.sliceString(0,u.length,`
|
|
173
|
+
`)}))}),console.log(" generated json1 op: "+JSON.stringify(sM(e,s.changes,s.startState.doc,t,r)))),n.submitOp(sM(e,s.changes,s.startState.doc,t,r)),this.lock=!1)}destroy(){n.off("op",this.handleOp)}});function iie(n,e=n.state){const t=new Set;for(const{from:r,to:i}of n.visibleRanges){let s=r;for(;s<=i;){const o=e.doc.lineAt(s);t.has(o)||t.add(o),s=o.to+1}}return t}function vw(n){const e=n.selection.main.head;return n.doc.lineAt(e)}function aM(n,e){let t=0;e:for(let r=0;r<n.length;r++)switch(n[r]){case" ":case" ":{t+=1;continue e}case" ":{t+=e-t%e;continue e}case"\r":continue e;default:break e}return t}const IO=ft.define({combine(n){return go(n,{highlightActiveBlock:!0,hideFirstIndent:!1,markerType:"fullScope",thickness:1})}});class sie{constructor(e,t,r,i){this.lines=e,this.state=t,this.map=new Map,this.unitWidth=r,this.markerType=i;for(const s of this.lines)this.add(s);this.state.facet(IO).highlightActiveBlock&&this.findAndSetActiveLines()}has(e){return this.map.has(typeof e=="number"?e:e.number)}get(e){const t=this.map.get(typeof e=="number"?e:e.number);if(!t)throw new Error("Line not found in indentation map");return t}set(e,t,r){const i=!e.text.trim().length,s={line:e,col:t,level:r,empty:i};return this.map.set(s.line.number,s),s}add(e){if(this.has(e))return this.get(e);if(!e.length||!e.text.trim().length){if(e.number===1)return this.set(e,0,0);if(e.number===this.state.doc.lines){const o=this.closestNonEmpty(e,-1);return this.set(e,0,o.level)}const i=this.closestNonEmpty(e,-1),s=this.closestNonEmpty(e,1);return i.level>=s.level&&this.markerType!=="codeOnly"?this.set(e,0,i.level):i.empty&&i.level===0&&s.level!==0?this.set(e,0,0):s.level>i.level?this.set(e,0,i.level+1):this.set(e,0,s.level)}const t=aM(e.text,this.state.tabSize),r=Math.floor(t/this.unitWidth);return this.set(e,t,r)}closestNonEmpty(e,t){let r=e.number+t;for(;t===-1?r>=1:r<=this.state.doc.lines;){if(this.has(r)){const o=this.get(r);if(!o.empty)return o}const s=this.state.doc.line(r);if(s.text.trim().length){const o=aM(s.text,this.state.tabSize),a=Math.floor(o/this.unitWidth);return this.set(s,o,a)}r+=t}const i=this.state.doc.line(t===-1?1:this.state.doc.lines);return this.set(i,0,0)}findAndSetActiveLines(){const e=vw(this.state);if(!this.has(e))return;let t=this.get(e);if(this.has(t.line.number+1)){const s=this.get(t.line.number+1);s.level>t.level&&(t=s)}if(this.has(t.line.number-1)){const s=this.get(t.line.number-1);s.level>t.level&&(t=s)}if(t.level===0)return;t.active=t.level;let r,i;for(r=t.line.number;r>1;r--){if(!this.has(r-1))continue;const s=this.get(r-1);if(s.level<t.level)break;s.active=t.level}for(i=t.line.number;i<this.state.doc.lines;i++){if(!this.has(i+1))continue;const s=this.get(i+1);if(s.level<t.level)break;s.active=t.level}}}function oie(n){const e={light:"#F0F1F2",dark:"#2B3245",activeLight:"#E4E5E6",activeDark:"#3C445C"};let t=e;return n&&(t=Object.assign(Object.assign({},e),n)),et.baseTheme({"&light":{"--indent-marker-bg-color":t.light,"--indent-marker-active-bg-color":t.activeLight},"&dark":{"--indent-marker-bg-color":t.dark,"--indent-marker-active-bg-color":t.activeDark},".cm-line":{position:"relative"},".cm-indent-markers::before":{content:'""',position:"absolute",top:0,left:"2px",right:0,bottom:0,background:"var(--indent-markers)",pointerEvents:"none",zIndex:"-1"}})}function og(n,e,t,r,i){return`${`repeating-linear-gradient(to right, var(${n}) 0 ${e}px, transparent ${e}px ${t}ch)`} ${r*t}.5ch/calc(${t*i}ch - 1px) no-repeat`}function aie(n,e,t,r,i){const{level:s,active:o}=n;if(i=i??r,t&&s===0)return[];const a=t?1:0,l=[];if(o!==void 0){const c=o-a-1;c>0&&l.push(og("--indent-marker-bg-color",r,e,a,c)),l.push(og("--indent-marker-active-bg-color",i,e,o-1,1)),o!==s&&l.push(og("--indent-marker-bg-color",r,e,o,s-o))}else l.push(og("--indent-marker-bg-color",r,e,a,s-a));return l.join(",")}class lie{constructor(e){this.view=e,this.unitWidth=ef(e.state),this.currentLineNumber=vw(e.state).number,this.generate(e.state)}update(e){const t=ef(e.state),r=t!==this.unitWidth;r&&(this.unitWidth=t);const i=vw(e.state).number,s=i!==this.currentLineNumber;this.currentLineNumber=i;const o=e.state.facet(IO).highlightActiveBlock&&s;(e.docChanged||e.viewportChanged||r||o)&&this.generate(e.state)}generate(e){const t=new xa,r=iie(this.view,e),{hideFirstIndent:i,markerType:s,thickness:o,activeThickness:a}=e.facet(IO),l=new sie(r,e,this.unitWidth,s);for(const c of r){const u=l.get(c.number);if(!(u!=null&&u.level))continue;const d=aie(u,this.unitWidth,i,o,a);t.add(c.from,c.from,mt.line({class:"cm-indent-markers",attributes:{style:`--indent-markers: ${d}`}}))}this.decorations=t.finish()}}function cie(n={}){return[IO.of(n),oie(n.colors),Xn.fromClass(lie,{decorations:e=>e.decorations})]}const s3=n=>e=>{const t=n==="down";let r=e.state.selection;for(const i of r.ranges)r=r.addRange(e.moveVertically(i,t));return e.dispatch({selection:r}),!0},uie=s3("up"),fie=s3("down"),die=n=>{let e=null;for(const t of n.state.selection.ranges)if(!t.empty)for(let r=t.from;r<=t.to;){const i=n.state.doc.lineAt(r),s=Math.min(i.to,t.to);e?e=e.addRange(_e.range(s,s)):e=_e.single(s),r=i.to+1}return e?(n.dispatch({selection:e}),!0):!1},hie=[{key:"Ctrl-Space",run:ew},{key:"Escape",run:Sj},{key:"ArrowDown",run:yl(!0)},{key:"ArrowUp",run:yl(!1)},{key:"PageDown",run:yl(!0,"page")},{key:"PageUp",run:yl(!1,"page")},{key:"Enter",run:J1},{key:"Tab",run:J1},{key:"Mod-f",run:mj,scope:"editor search-panel"},{key:"Escape",run:gj,scope:"editor search-panel"},{key:"Alt-Enter",run:fj,scope:"editor search-panel"},{key:"Mod-Alt-Enter",run:dj,scope:"editor search-panel"},{key:"Ctrl-g",run:nX},{key:"Mod-d",run:pX,preventDefault:!0},{key:"Shift-Mod-l",run:wX},{key:"Enter",run:BE,shift:BE},{key:"ArrowLeft",run:SE,shift:CE,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:$9,shift:N9},{key:"ArrowRight",run:wE,shift:_E,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:M9,shift:L9},{key:"ArrowUp",run:kE,shift:EE,preventDefault:!0},{key:"ArrowDown",run:PE,shift:RE,preventDefault:!0},{key:"Home",run:TE,shift:QE},{mac:"Cmd-ArrowLeft",run:TE,shift:QE},{key:"Mod-Home",run:DE,shift:jE},{mac:"Cmd-ArrowUp",run:DE,shift:jE},{key:"PageUp",run:M0,shift:AE},{mac:"Ctrl-ArrowUp",run:M0,shift:AE},{key:"PageDown",run:Q0,shift:$E},{mac:"Ctrl-ArrowDown",run:Q0,shift:$E},{key:"End",run:xE,shift:ME},{mac:"Cmd-ArrowRight",run:xE,shift:ME},{key:"Mod-Alt-ArrowUp",linux:"Shift-Alt-ArrowUp",run:uie,preventDefault:!0},{key:"Mod-Alt-ArrowDown",linux:"Shift-Alt-ArrowDown",run:fie,preventDefault:!0},{key:"Shift-Alt-i",run:die},{key:"Mod-End",run:IE,shift:NE},{mac:"Cmd-ArrowDown",run:IE,shift:NE},{key:"Mod-a",run:B9},{key:"Backspace",run:uz},{key:"Backspace",run:D0,shift:D0},{key:"Delete",run:LE},{key:"Mod-Backspace",mac:"Alt-Backspace",run:qE},{key:"Mod-Delete",mac:"Alt-Delete",run:V9},{mac:"Mod-Backspace",run:Z9},{mac:"Mod-Delete",run:UE},{mac:"Ctrl-b",run:SE,shift:CE,preventDefault:!0},{mac:"Ctrl-f",run:wE,shift:_E},{mac:"Ctrl-p",run:kE,shift:EE},{mac:"Ctrl-n",run:PE,shift:RE},{mac:"Ctrl-a",run:Q9,shift:q9},{mac:"Ctrl-e",run:D9,shift:U9},{mac:"Ctrl-d",run:LE},{mac:"Ctrl-h",run:D0},{mac:"Ctrl-k",run:UE},{mac:"Ctrl-Alt-h",run:qE},{mac:"Ctrl-o",run:W9},{mac:"Ctrl-t",run:X9},{mac:"Ctrl-v",run:Q0},{mac:"Alt-v",run:M0},{key:"Shift-Mod-k",run:K9},{key:"Alt-ArrowDown",run:Y9},{key:"Alt-ArrowUp",run:z9},{win:"Shift-Alt-ArrowDown",mac:"Shift-Alt-ArrowDown",run:H9},{win:"Shift-Alt-ArrowUp",mac:"Shift-Alt-ArrowUp",run:G9},{key:"Mod-l",run:F9,preventDefault:!0},{key:"Shift-Mod-\\",run:j9},{key:"Tab",run:FE,shift:VE,preventDefault:!0},{key:"Mod-[",run:VE},{key:"Mod-]",run:FE},{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:N8},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:L8},{key:"Mod-k Mod-0",run:q8},{key:"Mod-k Mod-j",run:U8},{key:"Mod-k Mod-c",run:g9},{key:"Mod-k Mod-u",run:O9},{key:"Mod-/",run:p9},{key:"Shift-Alt-a",run:v9},{key:"Mod-z",run:B5,preventDefault:!0},{key:"Mod-y",run:G1,preventDefault:!0},{key:"Mod-Shift-z",run:G1,preventDefault:!0},{key:"Mod-u",run:x9,preventDefault:!0},{key:"Mod-Shift-m",run:Pz},{key:"F8",run:xz}],pie=({path:n,localPresence:e,usernameRef:t})=>et.updateListener.of(r=>{if(r.selectionSet){const i=r.state.selection.ranges[0],{from:s,to:o}=i,a={start:[...n,s],end:[...n,o],username:t.current};e.submit(a,l=>{if(l)throw l})}}),mie=({path:n,docPresence:e,enableAutoFollowRef:t,openTab:r})=>[Xn.fromClass(class{constructor(i){Ni(this,"decorations");Ni(this,"cursorPosition",{});this.decorations=Mn.of([]);const s={};e.on("receive",(o,a)=>{if(!a){delete s[o];return}Oie(n,a)?s[o]=a:a&&(delete s[o],t.current&&r({fileId:a.start[1],isTransient:!0}));const c=[];for(const u of Object.keys(s)){const d=s[u],{start:h,end:m}=d,g=+h[h.length-1],O=+m[m.length-1],y=AN(d.username),{username:b}=d;c.push({from:g,to:g,value:mt.widget({side:-1,block:!1,widget:new vie(""+Math.random(),y,b)})}),g!==O&&c.push({from:g,to:O,value:mt.mark({class:"cm-json1-presence",attributes:{style:`
|
|
174
|
+
background-color: rgba(${y}, 0.75);
|
|
175
|
+
mix-blend-mode: luminosity;
|
|
176
|
+
`}})}),i.state.doc.length>=g&&(this.cursorPosition[u]=g)}this.decorations=mt.set(c,!0),setTimeout(()=>{i.dispatch({annotations:[gie.of(!0)]})},0),t.current&&this.scrollToCursor(i)})}scrollToCursor(i){for(const s in this.cursorPosition){const o=this.cursorPosition[s];i.dispatch({effects:et.scrollIntoView(o)})}}},{decorations:i=>i.decorations}),yie],gie=Ho.define(),Oie=(n,e)=>{for(let t=0;t<n.length;t++)if(n[t]!==e.start[t])return!1;return!0};class vie extends Ss{constructor(t,r,i){super();Ni(this,"id");Ni(this,"color");Ni(this,"username");Ni(this,"timeout");this.id=t,this.color=r,this.username=i}eq(t){return t.id===this.id}toDOM(){const t=document.createElement("span");t.setAttribute("aria-hidden","true"),t.className="cm-json1-presence";const r=document.createElement("div");t.appendChild(r),r.style.borderLeft=`1px solid rgba(${this.color})`;const i=document.createElement("div");return i.className="remote-cursor-username",i.style.top="-20px",i.style.height="20px",i.style.width=`${this.username.length*12}px`,i.style.backgroundColor=`rgba(${this.color})`,i.style.color="black",i.appendChild(document.createTextNode(this.username)),t.appendChild(i),this.timeout=window.setTimeout(()=>{i.style.opacity="0.3"},2e3),t}ignoreEvent(){return!1}}const yie=et.baseTheme({".cm-json1-presence":{position:"relative"},".cm-json1-presence > div":{position:"absolute",top:"0",bottom:"0",left:"0",right:"0"}}),o3=Zr.define({create:()=>null,update:(n,e)=>{for(const t of e.effects)if(t.is(yw))return t.value;if(!n)return null;if(!e.changes.empty){const t=e.changes.mapPos(n.pos,-1,Kr.TrackDel),r=e.changes.mapPos(n.pos+n.text.length,-1,Kr.TrackDel);return t===null||r===null||e.newDoc.sliceString(t,r)!==n.text?null:Object.assign(Object.assign({},n),{pos:t})}return n},provide:n=>[et.decorations.from(n,e=>{if(!e)return mt.none;const t=e.pos,r=e.pos+e.text.length,i=e.rule.className;return mt.set(bie({className:i}).range(t,r))}),et.contentAttributes.from(n,e=>!e||!e.rule.cursor?{style:""}:{style:`cursor: ${e.rule.cursor}`})]}),yw=Yt.define(),bie=n=>{var e;return mt.mark({class:`cm-interact ${(e=n==null?void 0:n.className)!==null&&e!==void 0?e:""}`})},Sie=et.theme({".cm-interact":{background:"rgba(128, 128, 255, 0.2)",borderRadius:"4px"}}),a3=ft.define(),l3=ft.define({combine:n=>n[n.length-1]}),wie=Xn.define(n=>({target:null,dragging:!1,mouseX:0,mouseY:0,getMatch(){const e=n.state.facet(a3),t=n.posAtCoords({x:this.mouseX,y:this.mouseY});if(!t)return null;const r=n.state.doc.lineAt(t),i=t-r.from;let s=null;for(const o of e)for(const a of r.text.matchAll(o.regexp)){if(a.index===void 0)continue;const l=a[0];if(!l)continue;const c=a.index,u=a.index+l.length;i<c||i>u||(!s||l.length<s.text.length)&&(s={rule:o,pos:r.from+c,text:l})}return s},updateText(e){return t=>{n.dispatch({effects:yw.of(Object.assign(Object.assign({},e),{text:t})),changes:{from:e.pos,to:e.pos+e.text.length,insert:t}})}},setTarget(e){this.target=e,n.dispatch({effects:yw.of(e)})},isModKeyDown(e){const t=n.state.facet(l3),r=!!window.navigator&&window.navigator.userAgent.includes("Macintosh");switch(t){case"alt":return e.altKey;case"shift":return e.shiftKey;case"ctrl":return e.ctrlKey;case"meta":return e.metaKey;case"mod":return r?e.metaKey:e.ctrlKey}throw new Error(`Invalid mod key: ${t}`)},update(e){const t=e.state.field(o3,!1);t!==void 0&&this.target!==t&&(this.target=t,t===null&&this.endDrag())},startDrag(e){this.dragging||this.target&&(this.dragging=!0,this.target.rule.onDragStart&&this.target.rule.onDragStart(this.target.text,this.updateText(this.target),e))},endDrag(){var e;this.dragging&&(this.dragging=!1,!((e=this.target)===null||e===void 0)&&e.rule.onDragEnd&&this.target.rule.onDragEnd(this.target.text,this.updateText(this.target)))}}),{eventHandlers:{mousedown(n,e){this.isModKeyDown(n)&&this.target&&(n.preventDefault(),this.target.rule.onClick&&this.target.rule.onClick(this.target.text,t=>{this.target&&this.updateText(this.target)(t)},n),this.target.rule.onDrag&&this.startDrag(n))},mousemove(n,e){if(this.mouseX=n.clientX,this.mouseY=n.clientY,!this.isModKeyDown(n)){this.target&&this.setTarget(null);return}this.target&&this.dragging?this.target.rule.onDrag&&this.target.rule.onDrag(this.target.text,this.updateText(this.target),n):this.setTarget(this.getMatch())},mouseup(n,e){this.endDrag(),this.target&&!this.isModKeyDown(n)&&this.setTarget(null),this.isModKeyDown(n)&&this.setTarget(this.getMatch())},mouseleave(n,e){this.endDrag(),this.target&&this.setTarget(null)},keydown(n,e){!this.target&&this.isModKeyDown(n)&&this.setTarget(this.getMatch())},keyup(n,e){this.target&&!this.isModKeyDown(n)&&(this.endDrag(),this.setTarget(null))}}}),kie=(n={})=>{var e,t;return[o3,Sie,wie,l3.of((e=n.key)!==null&&e!==void 0?e:"alt"),((t=n.rules)!==null&&t!==void 0?t:[]).map(r=>a3.of(r))]},Pie=/https?:\/\/[^\s'")]*([^\s'",;.]|\([^\s'")]*\)|\b)/g,xie={regexp:Pie,cursor:"pointer",onClick:n=>{window.open(n)}},c3=/#[0-9A-Fa-f]{6}/g,Tie=n=>({regexp:c3,cursor:"pointer",onClick(e,t,r){const i=e,s=document.createElement("input");s.type="color",s.value=i.toLowerCase();const o=i.toUpperCase()===i,a=l=>{const c=l.target;c.value&&t(o?c.value.toUpperCase():c.value),n&&n()};s.addEventListener("input",a),s.style.position="absolute",s.style.left=`${r.clientX}px`,s.style.top=`${r.clientY}px`,s.style.opacity="0",s.style.height="0",s.style.width="0",s.style.border="none",s.style.padding="0",s.style.margin="0",document.body.appendChild(s),setTimeout(()=>{s.click()},10),s.addEventListener("blur",()=>{document.body.removeChild(s)})}}),Cie=new RegExp("(?<!\\#)-?\\b\\d+\\.?\\d*\\b","g"),_ie=n=>({regexp:Cie,cursor:"ew-resize",onDrag:(e,t,r)=>{const i=Number(e)+r.movementX;isNaN(i)||(t(i.toString()),n&&n())}}),Eie=/true|false/g,Rie=n=>({regexp:Eie,cursor:"pointer",onClick:(e,t)=>{t(e==="true"?"false":"true"),n&&n()}}),Aie=n=>({regexp:/vec2\(-?\b\d+\.?\d*\b\s*(,\s*-?\b\d+\.?\d*\b)?\)/g,cursor:"move",onDrag:(e,t,r)=>{var a,l;const i=/vec2\((?<x>-?\b\d+\.?\d*\b)\s*(,\s*(?<y>-?\b\d+\.?\d*\b))?\)/.exec(e),s=Number((a=i==null?void 0:i.groups)==null?void 0:a.x);let o=Number((l=i==null?void 0:i.groups)==null?void 0:l.y);isNaN(s)||(isNaN(o)&&(o=s),t(`vec2(${s+r.movementX}, ${o-r.movementY})`),n&&n())}});let mc=null;const $ie=n=>({regexp:/rotate\(-?\d*\.?\d*\)/g,cursor:"move",onDragStart(e,t,r){mc={x:r.clientX,y:r.clientY}},onDrag(e,t,r){if(mc==null)return;const i=Math.round(Math.atan2(mc.y-r.clientY,r.clientX-mc.x)*180/Math.PI);t(`rotate(${i})`);const s=new CustomEvent("updateRotateDrag",{detail:i});document.dispatchEvent(s),n&&n()},onDragEnd(){mc=null}}),Mie=Xn.fromClass(class{constructor(n){Ni(this,"view");Ni(this,"textPosition");Ni(this,"rotation");this.view=n,this.textPosition=null,this.rotation=0,document.addEventListener("updateRotateDrag",e=>{this.textPosition=this.view.posAtCoords(mc,!1),this.rotation=e.detail})}},{decorations:n=>mc===null?mt.none:mt.set([{from:n.textPosition,to:n.textPosition,value:mt.widget({side:-1,widget:new Qie(n.rotation)})}])});class Qie extends Ss{constructor(t){super();Ni(this,"angle");this.angle=t}toDOM(t){const r=document.createElement("div");r.setAttribute("style","width:20px;height:20px"),r.className="color-circle-parent";const i=document.createElementNS("http://www.w3.org/2000/svg","svg"),s=document.createElementNS("http://www.w3.org/2000/svg","circle");s.setAttributeNS(null,"fill","#808080"),s.setAttributeNS(null,"r","5"),s.setAttributeNS(null,"cx","5"),s.setAttributeNS(null,"cy","5");const o=document.createElementNS("http://www.w3.org/2000/svg","line");return o.setAttributeNS(null,"x1","10"),o.setAttributeNS(null,"x2","5"),o.setAttributeNS(null,"y1","5"),o.setAttributeNS(null,"y2","5"),o.setAttributeNS(null,"stroke","black"),o.setAttributeNS(null,"transform",`rotate(${360-this.angle},5,5)`),i.setAttributeNS(null,"viewBox","0 0 10 10"),i.setAttributeNS(null,"width","20"),i.setAttributeNS(null,"height","20"),i.appendChild(s),i.appendChild(o),r.appendChild(i),r}ignoreEvent(){return!1}}const Die=n=>({regexp:/\[[ x]\]/g,cursor:"pointer",onClick:(e,t)=>{t(e==="[ ]"?"[x]":"[ ]"),n&&n()}}),Iie=et.baseTheme({".color-circle-parent":{display:"inline-block",cursor:"inherit"}});class jie extends Ss{constructor(t){super();Ni(this,"color");this.color=t}eq(t){return t.color===this.color}toDOM(){const t=document.createElement("div"),r=20,i=14;t.setAttribute("style",`width:${r}px;height:${r}px;position:relative;`),t.className="color-circle-parent";const s=document.createElementNS("http://www.w3.org/2000/svg","svg"),o=document.createElementNS("http://www.w3.org/2000/svg","circle");o.setAttributeNS(null,"fill",this.color.replace(/["']/g,"")),o.setAttributeNS(null,"stroke","white"),o.setAttributeNS(null,"stroke-width","0.75"),o.setAttributeNS(null,"r",""+i/2),o.setAttributeNS(null,"cx",""+r/2),o.setAttributeNS(null,"cy",""+(r/2-1)),s.setAttributeNS(null,"width",""+r),s.setAttributeNS(null,"height",""+r),s.appendChild(o),t.appendChild(s);const a=document.createElement("div");a.className="tooltip_hover_circle",a.innerHTML=`<strong>Alt + Click on a hex color</strong><br />
|
|
177
|
+
<div>Open a color picker to modify the color</div>`,t.appendChild(a);let l;return t.addEventListener("mouseenter",c=>{l=window.setTimeout(()=>{a.style.top=`${c.clientY-60}px`,a.style.left=`${c.clientX}px`,a.style.opacity="1"},700)}),t.addEventListener("mouseleave",()=>{clearTimeout(l),a.style.opacity="0"}),t}ignoreEvent(){return!1}}const Nie=[Xn.fromClass(class{constructor(n){Ni(this,"decorations");Ni(this,"view");this.decorations=Mn.of([]),this.view=n}},{decorations:n=>{const e=[],t=n.view.state.doc.iter();let r=t.next(),i=0;for(;!r.done;){if(r.value===`
|
|
178
|
+
`){i++,r=t.next();continue}const s=r.value.matchAll(c3);let o=s.next();for(;!o.done;){const a=o.value;a.index+=i,e.push(a),o=s.next()}i+=r.value.length,r=t.next()}return mt.set(e.map(s=>({from:s.index+7,to:s.index+7,value:mt.widget({side:-1,widget:new jie(s[0])})})))}}),Iie],Lie=({onInteract:n,customInteractRules:e})=>{const t=[Tie(n),_ie(n),Die(n),Rie(n),Aie(n),$ie(n),xie];return e&&t.push(...e),kie({rules:t})},u3=()=>(Math.random()+"").slice(2),qie=({typeScriptWorker:n,fileName:e})=>async r=>{const i=u3(),s=r.state.doc.toString(),o={event:"autocomplete-request",fileName:e,fileContent:s,position:r.pos,requestId:i},a=s[r.pos-1];if(['"',"'",";","(",")","{",","," ","=","<",">"].includes(a))return{from:r.pos,options:[]};n.postMessage(o);const l=await new Promise(d=>{n.onmessage=h=>{const m=h.data,{event:g,requestId:O,completions:y}=m;g==="post-completions"&&O===O&&d(y)}});if(!l)return{from:r.pos,options:[]};const c=r.matchBefore(/\w*/).from,u=r.matchBefore(/\w*/).text;return u&&(l.entries=l.entries.filter(d=>d.name.startsWith(u))),{from:r.pos,options:l.entries.map(d=>({label:d.name,apply:h=>{const m=r.pos+d.name.length-u.length;h.dispatch({changes:{from:c,to:r.pos,insert:d.name},selection:{anchor:m,head:m}})}}))}},Uie=[HZ(),e8(),vZ(),P9(),aZ(),dZ(),Cn.allowMultipleSelections.of(!0),Q8(),Ok(z8,{fallback:!0}),tW(),az(),_j({defaultKeymap:!1}),RZ(),MZ(),PZ(),oX()];function Bie(){return["red","orange","yellow","green"]}const Fie=Xn.fromClass(class{constructor(n){Ni(this,"decorations");this.decorations=this.getBracketDecorations(n)}update(n){(n.docChanged||n.selectionSet||n.viewportChanged)&&(this.decorations=this.getBracketDecorations(n.view))}getBracketDecorations(n){const{doc:e}=n.state,t=[],r=[],i=Bie();for(let s=0;s<e.length;s+=1){const o=e.sliceString(s,s+1);if(o==="("||o==="["||o==="{")r.push({type:o,from:s});else if(o===")"||o==="]"||o==="}"){const a=r.pop();if(a&&a.type===this.getMatchingBracket(o)){const c=`rainbow-bracket-${i[r.length%i.length]}`;t.push(mt.mark({class:c}).range(a.from,a.from+1),mt.mark({class:c}).range(s,s+1))}}}return t.sort((s,o)=>s.from-o.from||s.startSide-o.startSide),mt.set(t)}getMatchingBracket(n){switch(n){case")":return"(";case"]":return"[";case"}":return"{";default:return null}}},{decorations:n=>n.decorations});function lM(){return[Fie,et.baseTheme({".rainbow-bracket-red":{color:"white"},".rainbow-bracket-red > span":{color:"white"},".rainbow-bracket-orange":{color:"#FFFFB2"},".rainbow-bracket-orange > span":{color:"#FFFFB2"},".rainbow-bracket-yellow":{color:"#FFB2DA"},".rainbow-bracket-yellow > span":{color:"#FFB2DA"},".rainbow-bracket-green":{color:"#B2FFB2"},".rainbow-bracket-green > span":{color:"#B2FFB2"},".default-bracket":{color:"currentColor"},".default-bracket > span":{color:"currentColor"}})]}function Vie(n,e,t=void 0){let r=()=>{};return(...i)=>(r(),new Promise((s,o)=>{const a=setTimeout(()=>s(n(...i)),e);r=()=>{clearTimeout(a),t!==void 0&&o(t)}}))}var Zie=Object.defineProperty,Wie=(n,e,t)=>e in n?Zie(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,f3=(n,e,t)=>(Wie(n,typeof e!="symbol"?e+"":e,t),t);const gv=Zr.define({create(){return{suggestion:null}},update(n,e){const t=e.effects.find(r=>r.is(d3));if(e.state.doc){if(t&&e.state.doc==t.value.doc)return{suggestion:t.value.text};if(!e.docChanged&&!e.selection)return n}return{suggestion:null}}}),d3=Yt.define();function Xie(n,e){const t=n.state.selection.main.head,r=[],i=mt.widget({widget:new zie(e),side:1});return r.push(i.range(t)),mt.set(r)}const oP=ft.define({combine(n){var e,t;return{acceptOnClick:!!((e=n.at(-1))!=null&&e.acceptOnClick),fetchFn:(t=n.at(-1))==null?void 0:t.fetchFn}}});class zie extends Ss{constructor(e){super(),f3(this,"suggestion"),this.suggestion=e}toDOM(e){const t=document.createElement("span");return t.style.opacity="0.4",t.className="cm-inline-suggestion",t.textContent=this.suggestion,t.onclick=r=>this.accept(r,e),t}accept(e,t){var r;if(!t.state.facet(oP).acceptOnClick)return;e.stopPropagation(),e.preventDefault();const i=(r=t.state.field(gv))==null?void 0:r.suggestion;return i?(t.dispatch({...h3(t.state,i,t.state.selection.main.head,t.state.selection.main.head)}),!0):!1}}const Yie=Xn.fromClass(class{async update(n){const e=n.state.doc;if(!n.docChanged||n.transactions.some(i=>i.isUserEvent("input.complete")))return;const t=n.view.state.facet(oP);if(!t.fetchFn){console.error("Unexpected issue in codemirror-copilot: fetchFn was not configured");return}const r=await t.fetchFn(n.state);n.view.dispatch({effects:d3.of({text:r,doc:e})})}}),Gie=Xn.fromClass(class{constructor(){f3(this,"decorations"),this.decorations=mt.none}update(n){var e;const t=(e=n.state.field(gv))==null?void 0:e.suggestion;if(!t){this.decorations=mt.none;return}this.decorations=Xie(n.view,t)}},{decorations:n=>n.decorations}),Hie=Go.highest(cf.of([{key:"Tab",run:n=>{var e;const t=(e=n.state.field(gv))==null?void 0:e.suggestion;return t?(n.dispatch({...h3(n.state,t,n.state.selection.main.head,n.state.selection.main.head)}),!0):!1}}]));function h3(n,e,t,r){return{...n.changeByRange(i=>{if(i==n.selection.main)return{changes:{from:t,to:r,insert:e},range:_e.cursor(t+e.length)};const s=r-t;return!i.empty||s&&n.sliceDoc(i.from-s,i.from)!=n.sliceDoc(t,r)?{range:i}:{changes:{from:i.from-s,to:i.from,insert:e},range:_e.cursor(i.from-s+e.length)}}),userEvent:"input.complete"}}function Kie(n){const{delay:e=500,acceptOnClick:t=!0}=n,r=Vie(n.fetchFn,e);return[oP.of({acceptOnClick:t,fetchFn:r}),gv,Yie,Gie,Hie]}const cM={};function Jie(n){return async function(e){const{from:t,to:r}=e.selection.ranges[0],i=e.doc.toString(),s=i.slice(0,r),o=i.slice(t),a=`${s}<:|:>${o}`,l=cM[a];if(l)return l;const c=await n(s,o);return cM[a]=c,c}}const ese=(n,e=1e3,t=!0)=>Kie({fetchFn:Jie(n),delay:e,acceptOnClick:t}),tse="/ai-copilot";let pb=!1;const nse=({aiCopilotEndpoint:n=tse})=>ese(async(e,t)=>{if(pb)return"";const r=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prefix:e,suffix:t})});if(!r.ok)return pb=!0,"";const i=await r.json();return i.error?(pb=!0,""):i.text}),ag=()=>hv({jsx:!0,typescript:!0}),rse={matchClosingTags:!0,selfClosingTags:!1,autoCloseTags:!0,extraTags:{},extraGlobalAttributes:{},nestedLanguages:[{tag:"script",language:hv,parser:Ls.parser},{tag:"style",language:pv,parser:rf.parser}],nestedAttributes:[]},ise={json:pre,tsx:ag,js:ag,jsx:ag,ts:ag,html:()=>mL(rse),css:pv,md:Jre,svelte:cre},uM=(n,e)=>{let t=n;for(const r of e){if(!t)return;t=t[r]}return t},sse=({paneId:n="root",fileId:e,shareDBDoc:t,content:r,filesPath:i,localPresence:s,docPresence:o,theme:a,onInteract:l,editorCache:c,usernameRef:u,typeScriptWorker:d,customInteractRules:h,allowGlobals:m,enableAutoFollowRef:g,openTab:O,aiCopilotEndpoint:y,rainbowBracketsEnabled:b=!0})=>{const S=sh(e,n);if(c.has(S))return c.get(S);const P=[...i,e,"text"],k=[...i,e,"name"],x=uM(r,P),A=uM(r,k),M=A.split(".").pop();let Q=new wc,_=new wc;const R=[];t?(R.push(rie({shareDBDoc:t,path:P,json1:bw,textUnicode:k2})),s&&R.push(pie({path:P,localPresence:s,usernameRef:u})),o&&R.push(mie({path:P,docPresence:o,enableAutoFollowRef:g,openTab:O}))):R.push(et.editable.of(!1)),R.push(Nie),R.push(Uie),R.push(Q.of(Mj[a].value)),R.push(_.of(b?lM():[]));const $=new wc,F=(X=>{const W=ise[X];return W?W():void 0})(M);F?R.push($.of(F)):R.push($.of([])),R.push(Lie({onInteract:l,customInteractRules:h})),R.push(Mie);const G=M==="js"||M==="jsx"||M==="ts"||M==="tsx";R.push(_j(G?{override:[qie({typeScriptWorker:d,fileName:A})]}:void 0)),R.push(cie({colors:{light:"#4d586b",dark:"#4d586b",activeLight:"#8e949f",activeDark:"#8e949f"}})),R.push(cf.of(hie.map(X=>(X.key==="Enter"&&delete X.shift,X)))),y&&R.push(nse({aiCopilotEndpoint:y}));const ue=new et({state:Cn.create({doc:x,extensions:R})}),B={editor:ue,themeCompartment:Q,rainbowBracketsCompartment:_,updateRainbowBrackets:X=>{ue.dispatch({effects:_.reconfigure(X?lM():[])})}};return c.set(S,B),B.updateRainbowBrackets(b),B},fM=["files"],ose=({customInteractRules:n,allowGlobals:e,aiCopilotEndpoint:t})=>{const{activePane:r,shareDBDoc:i,content:s,submitOperation:o,localPresence:a,docPresence:l,username:c,editorCache:u,editorWantsFocus:d,editorNoLongerWantsFocus:h,typeScriptWorker:m,theme:g,codeEditorRef:O,enableAutoFollow:y,openTab:b}=L.useContext(ni),S=L.useRef(null),P=L.useCallback(()=>{S.current?clearTimeout(S.current):o(M=>({...M,isInteracting:!0})),S.current=setTimeout(()=>{S.current=null,o(({isInteracting:M,...Q})=>Q)},800)},[o]),k=L.useRef(c);k.current=c;const x=L.useRef(y);L.useEffect(()=>{x.current=y},[y]);const A=L.useMemo(()=>sse({fileId:r.activeFileId,shareDBDoc:i,content:s,filesPath:fM,localPresence:a,docPresence:l,theme:g,onInteract:P,editorCache:u,usernameRef:k,typeScriptWorker:m,customInteractRules:n,allowGlobals:e,enableAutoFollowRef:x,openTab:b,aiCopilotEndpoint:t}),[r,i,fM,a,l,g,P,u,k,m,t]);return L.useLayoutEffect(()=>{if(O.current&&s)return O.current.appendChild(A.editor.dom),A.editor.scrollDOM.scrollTo({top:A.scrollPosition??0}),()=>{A.scrollPosition=A.editor.scrollDOM.scrollTop,O.current.removeChild(A.editor.dom)}},[i,A]),L.useEffect(()=>{d&&(A.editor.focus(),h())},[d,A,h]),q.jsx("div",{className:"vz-code-editor",ref:O,tabIndex:-1})},ase=({errorMessage:n,content:e})=>{const[t,r]=L.useState(!0);L.useEffect(()=>{n!==null&&r(!0)},[n]);const i=L.useCallback(()=>{r(!1)},[]);return L.useEffect(()=>{const s=o=>{o.key==="Escape"&&i()};return document.addEventListener("keydown",s,!0),()=>{document.removeEventListener("keydown",s,!0)}},[i]),t&&n!==null?q.jsxs("div",{className:"vz-code-error-overlay",children:[q.jsx("pre",{children:n}),q.jsx("i",{className:"icon-button icon-button-dark error-dismiss-button",onClick:i,children:q.jsx(xO,{})})]}):null},dM=n=>{const[e]=n.split("-");return parseInt(e,36)},lse=(n,e)=>{const t=dM(n),r=dM(e);return t>r},cse=(n,e,t,r)=>{t.current.has(n)?t.current.set(n,e):(t.current.set(n,e),r(i=>[...i,{user:e,join:!0,presenceId:n}]))},use=(n,e,t)=>{const r=e.current.get(n);r&&(e.current.delete(n),t(i=>[...i,{user:r,join:!1,presenceId:n}]))},fse=({docPresence:n,localPresence:e})=>{const[t,r]=L.useState([]),i=L.useRef(new Map);return L.useEffect(()=>{if(n){const s=(o,a)=>{var c;const l=a!==null;if(lse(o,e.presenceId)){if(l){const d=(c=n.remotePresences[o])==null?void 0:c.username;cse(o,d,i,r)}else use(o,i,r);const u=setTimeout(()=>{r(d=>d.slice(1))},5e3);return()=>{clearTimeout(u)}}};return n.on("receive",s),()=>{n.off("receive",s)}}},[n,e]),t.length>0?q.jsx("div",{className:"vz-notification",children:t.map(({user:s,join:o,presenceId:a})=>q.jsx("div",{className:"vz-notification-item",children:o?`${s} has joined the session.`:`${s} has left the session.`},a))}):null},dse=100,hse=2e3,pse=(n,e=!0)=>{var i,s;const t=(i=n.name)==null?void 0:i.substring(0,dse).trim(),r=(e?(s=n.text)==null?void 0:s.substring(0,hse):n.text).trim();return["`"+t+"`:","```",r,"```"].join(`
|
|
179
|
+
`)},mse="/ai-assist",gse=async({view:n,shareDBDoc:e,fileId:t,tabList:r,aiAssistEndpoint:i=mse,aiAssistOptions:s={},aiStreamId:o})=>{const a=e.data.files[t].name,l=n.state.sliceDoc(0,n.state.selection.main.from),c=n.state.sliceDoc(n.state.selection.main.to),u=l+"<FILL_ME>"+c,d={name:a,text:u},h=n.state.selection.main.to;let m=pse(d,!1);const O=await(await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...s,inputText:m,fileId:t,insertionCursor:h,aiStreamId:o})})).json();O.error&&console.error("[startAIAssist] error from server:",O.error)},Ose=[{x:40,y:0,r:4},{x:28.28,y:28.28,r:4.85},{x:0,y:40,r:5.71},{x:-28.29,y:28.28,r:6.57},{x:-40,y:0,r:7.42},{x:-28.29,y:-28.29,r:8.28},{x:-.01,y:-40,r:9.14},{x:28.28,y:-28.29,r:10}],vse=({height:n=40,fill:e="currentcolor",fadeIn:t=!0})=>{const[r,i]=L.useState(!1);return L.useEffect(()=>{i(!0)},[]),r&&q.jsx("div",{className:`vh-spinner${t?" fade-in":""}`,children:q.jsx("svg",{height:n,viewBox:"0 0 100 100",style:{opacity:1},children:q.jsx("g",{transform:"translate(50, 50)",fill:e,children:q.jsx("g",{className:"vh-spinner-dots",children:Ose.map(({x:s,y:o,r:a},l)=>q.jsx("circle",{cx:s,cy:o,r:a},l))})})})})},yse=({aiAssistEndpoint:n,aiAssistOptions:e,aiAssistTooltipText:t="Start AI Assist",aiAssistClickOverride:r,activeFileId:i,tabList:s,paneId:o})=>{const{shareDBDoc:a,editorCache:l,runPrettierRef:c,runCodeRef:u}=L.useContext(ni),[d,h]=L.useState(null),m=L.useCallback(async()=>{if(!(d!==null)){const y=u3();h(y),await gse({view:l.get(sh(i,o)).editor,shareDBDoc:a,fileId:i,tabList:s,aiStreamId:y,aiAssistEndpoint:n,aiAssistOptions:e}),await new Promise(P=>setTimeout(P,1e3));const b=c.current;b!==null&&b();const S=u.current;S!==null&&S(),h(P=>P===y?null:P)}},[i,o,d]),g=d===null;return q.jsx("div",{className:"vz-code-ai-assist-widget",children:d?q.jsx(vse,{}):g&&q.jsx(Rs,{placement:"left",overlay:q.jsx(As,{id:"ai-assist-widget-tooltip",children:t}),children:q.jsx("i",{className:"icon-button icon-button-dark",onClick:r||m,children:q.jsx(vJ,{})})})})},bse=!1,Sse=({runCodeWidgetTooltipText:n=q.jsxs(q.Fragment,{children:[q.jsx("strong",{children:"Run Code"}),q.jsx("div",{children:"(Shift + Enter or Ctrl + s)"})]})})=>{const{runCodeRef:e,runPrettierRef:t,splitCurrentPane:r}=L.useContext(ni),[i,s]=L.useState(!1),o=L.useCallback(()=>{s(!0);const a=t.current;a!==null&&a();const l=e.current;l!==null&&l(),setTimeout(()=>s(!1),1e3)},[e,t]);return L.useCallback(()=>{console.log("Split Editor"),console.log(r),r()},[r]),L.useEffect(()=>{const a=l=>{(l.ctrlKey&&l.key==="s"||l.shiftKey&&l.key==="Enter")&&(l.preventDefault(),o())};return window.addEventListener("keydown",a),()=>{window.removeEventListener("keydown",a)}},[o]),q.jsxs("div",{children:[q.jsx("div",{className:"vz-code-split-view-widget",children:bse}),q.jsx("div",{className:"vz-code-run-code-widget",children:q.jsx(Rs,{placement:"bottom",overlay:q.jsx(As,{id:"run-code-widget-tooltip",children:n}),children:q.jsx("i",{className:`icon-button icon-button-dark ${i?"rotate-icon":""}`,onClick:o,children:q.jsx(PJ,{})})})})]})},wse=({pane:n,content:e,customInteractRules:t,allowGlobals:r,enableAIAssist:i,aiAssistEndpoint:s,aiAssistOptions:o,aiAssistTooltipText:a,aiAssistClickOverride:l,aiCopilotEndpoint:c})=>{const[u,d]=L.useState(!1);return L.useEffect(()=>{d(!0)},[]),q.jsxs(q.Fragment,{children:[q.jsx(iee,{activeFileId:n.activeFileId,tabList:n.tabList}),u&&e&&n.activeFileId&&q.jsx(ose,{customInteractRules:t,allowGlobals:r,aiCopilotEndpoint:c}),u&&i&&e&&n.activeFileId?q.jsx(yse,{aiAssistEndpoint:s,aiAssistOptions:o,aiAssistTooltipText:a,aiAssistClickOverride:l,paneId:n.id,activeFileId:n.activeFileId,tabList:n.tabList}):null,q.jsx(Sse,{})]})},kse=({enableAIAssist:n=!1,aiAssistEndpoint:e,aiAssistOptions:t,aiAssistTooltipText:r,aiAssistClickOverride:i,aiCopilotEndpoint:s,customInteractRules:o,allowGlobals:a=!1})=>{const{codeEditorWidth:l}=L.useContext(XO),{content:c,localPresence:u,docPresence:d,pane:h,activePane:m,errorMessage:g}=L.useContext(ni);if(m.type!=="leafPane")throw new Error("Expected leafPane");return m.activeFileId!==null?q.jsxs("div",{className:"middle",style:{width:l+"px"},children:[q.jsx(wse,{pane:h,content:c,customInteractRules:o,allowGlobals:a,enableAIAssist:n,aiAssistEndpoint:e,aiAssistOptions:t,aiAssistTooltipText:r,aiAssistClickOverride:i,aiCopilotEndpoint:s}),q.jsx(ase,{errorMessage:g,content:c}),q.jsx(fse,{docPresence:d,localPresence:u})]}):null},Pse=20,xse=200,hM=4,pM=({side:n,isSidebarVisible:e=!0})=>{const{sidebarWidth:t,codeEditorWidth:r,moveSplitPane:i,isDraggingRight:s,isDraggingLeft:o,setIsDragging:a}=L.useContext(XO),{activePane:l}=L.useContext(ni),c=n==="left"||l.activeFileId,u=L.useRef(0),d=L.useCallback(b=>{b.preventDefault(),u.current=b.clientX,a(!0,n),document.body.style.cursor="col-resize"},[a,n]),h=L.useCallback(b=>{b.preventDefault();const S=b.clientX-u.current;u.current=b.clientX,i(S,n)},[i,n]),m=L.useCallback(()=>{a(!1,n),document.body.style.cursor="default"},[a,n]),g=n==="left"&&o||n==="right"&&s;L.useEffect(()=>{if(g)return document.addEventListener("mousemove",h),document.addEventListener("mouseup",m),()=>{document.removeEventListener("mousemove",h),document.removeEventListener("mouseup",m)}},[g,h,m]);const O=g?xse:Pse,y=(n==="left"?t:e?t+r:r)-O/2;return c?q.jsx("div",{className:"vz-resizer",onMouseDown:d,style:{left:y+O/2-1.5,width:O},children:q.jsx("div",{className:"vz-resizer-thumb",style:{left:hM/2-1.5,width:hM}})}):null},Tse=()=>q.jsx("div",{className:"right",children:null});function Cse(n){return new Worker("/assets/index-Dd8gk_1S.js",{name:n==null?void 0:n.name})}const _se="vzCodeUsername",Ese="Anonymous",Rse=()=>{let n=Ese;if(typeof window<"u"){const e=window.localStorage.getItem(_se);e!==null&&(n=e)}return n},Ase=n=>{const e=L.useRef(n);L.useEffect(()=>{e.current!==n&&(e.current=n,window.localStorage.setItem("vzCodeUsername",n))},[n])};var mb,mM;function p3(){if(mM)return mb;mM=1;var n=Object.prototype.toString;return mb=function(t){var r=n.call(t),i=r==="[object Arguments]";return i||(i=r!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&n.call(t.callee)==="[object Function]"),i},mb}var gb,gM;function $se(){if(gM)return gb;gM=1;var n;if(!Object.keys){var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,r=p3(),i=Object.prototype.propertyIsEnumerable,s=!i.call({toString:null},"toString"),o=i.call(function(){},"prototype"),a=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],l=function(h){var m=h.constructor;return m&&m.prototype===h},c={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},u=function(){if(typeof window>"u")return!1;for(var h in window)try{if(!c["$"+h]&&e.call(window,h)&&window[h]!==null&&typeof window[h]=="object")try{l(window[h])}catch{return!0}}catch{return!0}return!1}(),d=function(h){if(typeof window>"u"||!u)return l(h);try{return l(h)}catch{return!1}};n=function(m){var g=m!==null&&typeof m=="object",O=t.call(m)==="[object Function]",y=r(m),b=g&&t.call(m)==="[object String]",S=[];if(!g&&!O&&!y)throw new TypeError("Object.keys called on a non-object");var P=o&&O;if(b&&m.length>0&&!e.call(m,0))for(var k=0;k<m.length;++k)S.push(String(k));if(y&&m.length>0)for(var x=0;x<m.length;++x)S.push(String(x));else for(var A in m)!(P&&A==="prototype")&&e.call(m,A)&&S.push(String(A));if(s)for(var M=d(m),Q=0;Q<a.length;++Q)!(M&&a[Q]==="constructor")&&e.call(m,a[Q])&&S.push(a[Q]);return S}}return gb=n,gb}var Ob,OM;function m3(){if(OM)return Ob;OM=1;var n=Array.prototype.slice,e=p3(),t=Object.keys,r=t?function(o){return t(o)}:$se(),i=Object.keys;return r.shim=function(){if(Object.keys){var o=function(){var a=Object.keys(arguments);return a&&a.length===arguments.length}(1,2);o||(Object.keys=function(l){return e(l)?i(n.call(l)):i(l)})}else Object.keys=r;return Object.keys||r},Ob=r,Ob}var vb,vM;function g3(){return vM||(vM=1,vb=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},t=Symbol("test"),r=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;var i=42;e[t]=i;for(var s in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var o=Object.getOwnPropertySymbols(e);if(o.length!==1||o[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(e,t);if(a.value!==i||a.enumerable!==!0)return!1}return!0}),vb}var yb,yM;function aP(){if(yM)return yb;yM=1;var n=g3();return yb=function(){return n()&&!!Symbol.toStringTag},yb}var bb,bM;function O3(){return bM||(bM=1,bb=Object),bb}var Sb,SM;function v3(){return SM||(SM=1,Sb=Error),Sb}var wb,wM;function Mse(){return wM||(wM=1,wb=EvalError),wb}var kb,kM;function Qse(){return kM||(kM=1,kb=RangeError),kb}var Pb,PM;function Dse(){return PM||(PM=1,Pb=ReferenceError),Pb}var xb,xM;function y3(){return xM||(xM=1,xb=SyntaxError),xb}var Tb,TM;function mf(){return TM||(TM=1,Tb=TypeError),Tb}var Cb,CM;function Ise(){return CM||(CM=1,Cb=URIError),Cb}var _b,_M;function jse(){return _M||(_M=1,_b=Math.abs),_b}var Eb,EM;function Nse(){return EM||(EM=1,Eb=Math.floor),Eb}var Rb,RM;function Lse(){return RM||(RM=1,Rb=Math.max),Rb}var Ab,AM;function qse(){return AM||(AM=1,Ab=Math.min),Ab}var $b,$M;function Use(){return $M||($M=1,$b=Math.pow),$b}var Mb,MM;function Bse(){return MM||(MM=1,Mb=Math.round),Mb}var Qb,QM;function Fse(){return QM||(QM=1,Qb=Number.isNaN||function(e){return e!==e}),Qb}var Db,DM;function Vse(){if(DM)return Db;DM=1;var n=Fse();return Db=function(t){return n(t)||t===0?t:t<0?-1:1},Db}var Ib,IM;function Zse(){return IM||(IM=1,Ib=Object.getOwnPropertyDescriptor),Ib}var jb,jM;function gf(){if(jM)return jb;jM=1;var n=Zse();if(n)try{n([],"length")}catch{n=null}return jb=n,jb}var Nb,NM;function Ov(){if(NM)return Nb;NM=1;var n=Object.defineProperty||!1;if(n)try{n({},"a",{value:1})}catch{n=!1}return Nb=n,Nb}var Lb,LM;function Wse(){if(LM)return Lb;LM=1;var n=typeof Symbol<"u"&&Symbol,e=g3();return Lb=function(){return typeof n!="function"||typeof Symbol!="function"||typeof n("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},Lb}var qb,qM;function b3(){return qM||(qM=1,qb=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),qb}var Ub,UM;function S3(){if(UM)return Ub;UM=1;var n=O3();return Ub=n.getPrototypeOf||null,Ub}var Bb,BM;function Xse(){if(BM)return Bb;BM=1;var n="Function.prototype.bind called on incompatible ",e=Object.prototype.toString,t=Math.max,r="[object Function]",i=function(l,c){for(var u=[],d=0;d<l.length;d+=1)u[d]=l[d];for(var h=0;h<c.length;h+=1)u[h+l.length]=c[h];return u},s=function(l,c){for(var u=[],d=c,h=0;d<l.length;d+=1,h+=1)u[h]=l[d];return u},o=function(a,l){for(var c="",u=0;u<a.length;u+=1)c+=a[u],u+1<a.length&&(c+=l);return c};return Bb=function(l){var c=this;if(typeof c!="function"||e.apply(c)!==r)throw new TypeError(n+c);for(var u=s(arguments,1),d,h=function(){if(this instanceof d){var b=c.apply(this,i(u,arguments));return Object(b)===b?b:this}return c.apply(l,i(u,arguments))},m=t(0,c.length-u.length),g=[],O=0;O<m;O++)g[O]="$"+O;if(d=Function("binder","return function ("+o(g,",")+"){ return binder.apply(this,arguments); }")(h),c.prototype){var y=function(){};y.prototype=c.prototype,d.prototype=new y,y.prototype=null}return d},Bb}var Fb,FM;function Eh(){if(FM)return Fb;FM=1;var n=Xse();return Fb=Function.prototype.bind||n,Fb}var Vb,VM;function lP(){return VM||(VM=1,Vb=Function.prototype.call),Vb}var Zb,ZM;function cP(){return ZM||(ZM=1,Zb=Function.prototype.apply),Zb}var Wb,WM;function zse(){return WM||(WM=1,Wb=typeof Reflect<"u"&&Reflect&&Reflect.apply),Wb}var Xb,XM;function w3(){if(XM)return Xb;XM=1;var n=Eh(),e=cP(),t=lP(),r=zse();return Xb=r||n.call(t,e),Xb}var zb,zM;function uP(){if(zM)return zb;zM=1;var n=Eh(),e=mf(),t=lP(),r=w3();return zb=function(s){if(s.length<1||typeof s[0]!="function")throw new e("a function is required");return r(n,t,s)},zb}var Yb,YM;function Yse(){if(YM)return Yb;YM=1;var n=uP(),e=gf(),t;try{t=[].__proto__===Array.prototype}catch(o){if(!o||typeof o!="object"||!("code"in o)||o.code!=="ERR_PROTO_ACCESS")throw o}var r=!!t&&e&&e(Object.prototype,"__proto__"),i=Object,s=i.getPrototypeOf;return Yb=r&&typeof r.get=="function"?n([r.get]):typeof s=="function"?function(a){return s(a==null?a:i(a))}:!1,Yb}var Gb,GM;function k3(){if(GM)return Gb;GM=1;var n=b3(),e=S3(),t=Yse();return Gb=n?function(i){return n(i)}:e?function(i){if(!i||typeof i!="object"&&typeof i!="function")throw new TypeError("getProto: not an object");return e(i)}:t?function(i){return t(i)}:null,Gb}var Hb,HM;function P3(){if(HM)return Hb;HM=1;var n=Function.prototype.call,e=Object.prototype.hasOwnProperty,t=Eh();return Hb=t.call(n,e),Hb}var Kb,KM;function x3(){if(KM)return Kb;KM=1;var n,e=O3(),t=v3(),r=Mse(),i=Qse(),s=Dse(),o=y3(),a=mf(),l=Ise(),c=jse(),u=Nse(),d=Lse(),h=qse(),m=Use(),g=Bse(),O=Vse(),y=Function,b=function(Y){try{return y('"use strict"; return ('+Y+").constructor;")()}catch{}},S=gf(),P=Ov(),k=function(){throw new a},x=S?function(){try{return arguments.callee,k}catch{try{return S(arguments,"callee").get}catch{return k}}}():k,A=Wse()(),M=k3(),Q=S3(),_=b3(),R=cP(),$=lP(),D={},F=typeof Uint8Array>"u"||!M?n:M(Uint8Array),G={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?n:ArrayBuffer,"%ArrayIteratorPrototype%":A&&M?M([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":D,"%AsyncGenerator%":D,"%AsyncGeneratorFunction%":D,"%AsyncIteratorPrototype%":D,"%Atomics%":typeof Atomics>"u"?n:Atomics,"%BigInt%":typeof BigInt>"u"?n:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?n:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":t,"%eval%":eval,"%EvalError%":r,"%Float32Array%":typeof Float32Array>"u"?n:Float32Array,"%Float64Array%":typeof Float64Array>"u"?n:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?n:FinalizationRegistry,"%Function%":y,"%GeneratorFunction%":D,"%Int8Array%":typeof Int8Array>"u"?n:Int8Array,"%Int16Array%":typeof Int16Array>"u"?n:Int16Array,"%Int32Array%":typeof Int32Array>"u"?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":A&&M?M(M([][Symbol.iterator]())):n,"%JSON%":typeof JSON=="object"?JSON:n,"%Map%":typeof Map>"u"?n:Map,"%MapIteratorPrototype%":typeof Map>"u"||!A||!M?n:M(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":e,"%Object.getOwnPropertyDescriptor%":S,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?n:Promise,"%Proxy%":typeof Proxy>"u"?n:Proxy,"%RangeError%":i,"%ReferenceError%":s,"%Reflect%":typeof Reflect>"u"?n:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?n:Set,"%SetIteratorPrototype%":typeof Set>"u"||!A||!M?n:M(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":A&&M?M(""[Symbol.iterator]()):n,"%Symbol%":A?Symbol:n,"%SyntaxError%":o,"%ThrowTypeError%":x,"%TypedArray%":F,"%TypeError%":a,"%Uint8Array%":typeof Uint8Array>"u"?n:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?n:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?n:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?n:Uint32Array,"%URIError%":l,"%WeakMap%":typeof WeakMap>"u"?n:WeakMap,"%WeakRef%":typeof WeakRef>"u"?n:WeakRef,"%WeakSet%":typeof WeakSet>"u"?n:WeakSet,"%Function.prototype.call%":$,"%Function.prototype.apply%":R,"%Object.defineProperty%":P,"%Object.getPrototypeOf%":Q,"%Math.abs%":c,"%Math.floor%":u,"%Math.max%":d,"%Math.min%":h,"%Math.pow%":m,"%Math.round%":g,"%Math.sign%":O,"%Reflect.getPrototypeOf%":_};if(M)try{null.error}catch(Y){var ue=M(M(Y));G["%Error.prototype%"]=ue}var B=function Y(de){var ke;if(de==="%AsyncFunction%")ke=b("async function () {}");else if(de==="%GeneratorFunction%")ke=b("function* () {}");else if(de==="%AsyncGeneratorFunction%")ke=b("async function* () {}");else if(de==="%AsyncGenerator%"){var Te=Y("%AsyncGeneratorFunction%");Te&&(ke=Te.prototype)}else if(de==="%AsyncIteratorPrototype%"){var Pe=Y("%AsyncGenerator%");Pe&&M&&(ke=M(Pe.prototype))}return G[de]=ke,ke},X={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},W=Eh(),ee=P3(),re=W.call($,Array.prototype.concat),H=W.call(R,Array.prototype.splice),se=W.call($,String.prototype.replace),J=W.call($,String.prototype.slice),oe=W.call($,RegExp.prototype.exec),pe=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Ee=/\\(\\)?/g,j=function(de){var ke=J(de,0,1),Te=J(de,-1);if(ke==="%"&&Te!=="%")throw new o("invalid intrinsic syntax, expected closing `%`");if(Te==="%"&&ke!=="%")throw new o("invalid intrinsic syntax, expected opening `%`");var Pe=[];return se(de,pe,function(Re,Ge,gt,tn){Pe[Pe.length]=gt?se(tn,Ee,"$1"):Ge||Re}),Pe},V=function(de,ke){var Te=de,Pe;if(ee(X,Te)&&(Pe=X[Te],Te="%"+Pe[0]+"%"),ee(G,Te)){var Re=G[Te];if(Re===D&&(Re=B(Te)),typeof Re>"u"&&!ke)throw new a("intrinsic "+de+" exists, but is not available. Please file an issue!");return{alias:Pe,name:Te,value:Re}}throw new o("intrinsic "+de+" does not exist!")};return Kb=function(de,ke){if(typeof de!="string"||de.length===0)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof ke!="boolean")throw new a('"allowMissing" argument must be a boolean');if(oe(/^%?[^%]*%?$/,de)===null)throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var Te=j(de),Pe=Te.length>0?Te[0]:"",Re=V("%"+Pe+"%",ke),Ge=Re.name,gt=Re.value,tn=!1,Ln=Re.alias;Ln&&(Pe=Ln[0],H(Te,re([0,1],Ln)));for(var an=1,ln=!0;an<Te.length;an+=1){var Qn=Te[an],Dn=J(Qn,0,1),I=J(Qn,-1);if((Dn==='"'||Dn==="'"||Dn==="`"||I==='"'||I==="'"||I==="`")&&Dn!==I)throw new o("property names with quotes must have matching quotes");if((Qn==="constructor"||!ln)&&(tn=!0),Pe+="."+Qn,Ge="%"+Pe+"%",ee(G,Ge))gt=G[Ge];else if(gt!=null){if(!(Qn in gt)){if(!ke)throw new a("base intrinsic for "+de+" exists, but the property is not available.");return}if(S&&an+1>=Te.length){var ge=S(gt,Qn);ln=!!ge,ln&&"get"in ge&&!("originalValue"in ge.get)?gt=ge.get:gt=gt[Qn]}else ln=ee(gt,Qn),gt=gt[Qn];ln&&!tn&&(G[Ge]=gt)}}return gt},Kb}var Jb,JM;function fP(){if(JM)return Jb;JM=1;var n=x3(),e=uP(),t=e([n("%String.prototype.indexOf%")]);return Jb=function(i,s){var o=n(i,!!s);return typeof o=="function"&&t(i,".prototype.")>-1?e([o]):o},Jb}var eS,e2;function Gse(){if(e2)return eS;e2=1;var n=aP()(),e=fP(),t=e("Object.prototype.toString"),r=function(a){return n&&a&&typeof a=="object"&&Symbol.toStringTag in a?!1:t(a)==="[object Arguments]"},i=function(a){return r(a)?!0:a!==null&&typeof a=="object"&&"length"in a&&typeof a.length=="number"&&a.length>=0&&t(a)!=="[object Array]"&&"callee"in a&&t(a.callee)==="[object Function]"},s=function(){return r(arguments)}();return r.isLegacyArguments=i,eS=s?r:i,eS}var tS,t2;function dP(){if(t2)return tS;t2=1;var n=Ov(),e=y3(),t=mf(),r=gf();return tS=function(s,o,a){if(!s||typeof s!="object"&&typeof s!="function")throw new t("`obj` must be an object or a function`");if(typeof o!="string"&&typeof o!="symbol")throw new t("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new t("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new t("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new t("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new t("`loose`, if provided, must be a boolean");var l=arguments.length>3?arguments[3]:null,c=arguments.length>4?arguments[4]:null,u=arguments.length>5?arguments[5]:null,d=arguments.length>6?arguments[6]:!1,h=!!r&&r(s,o);if(n)n(s,o,{configurable:u===null&&h?h.configurable:!u,enumerable:l===null&&h?h.enumerable:!l,value:a,writable:c===null&&h?h.writable:!c});else if(d||!l&&!c&&!u)s[o]=a;else throw new e("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},tS}var nS,n2;function hP(){if(n2)return nS;n2=1;var n=Ov(),e=function(){return!!n};return e.hasArrayLengthDefineBug=function(){if(!n)return null;try{return n([],"length",{value:1}).length!==1}catch{return!0}},nS=e,nS}var rS,r2;function Rh(){if(r2)return rS;r2=1;var n=m3(),e=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",t=Object.prototype.toString,r=Array.prototype.concat,i=dP(),s=function(c){return typeof c=="function"&&t.call(c)==="[object Function]"},o=hP()(),a=function(c,u,d,h){if(u in c){if(h===!0){if(c[u]===d)return}else if(!s(h)||!h())return}o?i(c,u,d,!0):i(c,u,d)},l=function(c,u){var d=arguments.length>2?arguments[2]:{},h=n(u);e&&(h=r.call(h,Object.getOwnPropertySymbols(u)));for(var m=0;m<h.length;m+=1)a(c,h[m],u[h[m]],d[h[m]])};return l.supportsDescriptors=!!o,rS=l,rS}var iS={exports:{}},sS,i2;function Hse(){if(i2)return sS;i2=1;var n=x3(),e=dP(),t=hP()(),r=gf(),i=mf(),s=n("%Math.floor%");return sS=function(a,l){if(typeof a!="function")throw new i("`fn` is not a function");if(typeof l!="number"||l<0||l>4294967295||s(l)!==l)throw new i("`length` must be a positive 32-bit integer");var c=arguments.length>2&&!!arguments[2],u=!0,d=!0;if("length"in a&&r){var h=r(a,"length");h&&!h.configurable&&(u=!1),h&&!h.writable&&(d=!1)}return(u||d||!c)&&(t?e(a,"length",l,!0,!0):e(a,"length",l)),a},sS}var oS,s2;function Kse(){if(s2)return oS;s2=1;var n=Eh(),e=cP(),t=w3();return oS=function(){return t(n,e,arguments)},oS}var o2;function T3(){return o2||(o2=1,function(n){var e=Hse(),t=Ov(),r=uP(),i=Kse();n.exports=function(o){var a=r(arguments),l=o.length-(arguments.length-1);return e(a,1+(l>0?l:0),!0)},t?t(n.exports,"apply",{value:i}):n.exports.apply=i}(iS)),iS.exports}var aS,a2;function C3(){if(a2)return aS;a2=1;var n=function(e){return e!==e};return aS=function(t,r){return t===0&&r===0?1/t===1/r:!!(t===r||n(t)&&n(r))},aS}var lS,l2;function _3(){if(l2)return lS;l2=1;var n=C3();return lS=function(){return typeof Object.is=="function"?Object.is:n},lS}var cS,c2;function Jse(){if(c2)return cS;c2=1;var n=_3(),e=Rh();return cS=function(){var r=n();return e(Object,{is:r},{is:function(){return Object.is!==r}}),r},cS}var uS,u2;function eoe(){if(u2)return uS;u2=1;var n=Rh(),e=T3(),t=C3(),r=_3(),i=Jse(),s=e(r(),Object);return n(s,{getPolyfill:r,implementation:t,shim:i}),uS=s,uS}var fS,f2;function toe(){if(f2)return fS;f2=1;var n=fP(),e=aP()(),t=P3(),r=gf(),i;if(e){var s=n("RegExp.prototype.exec"),o={},a=function(){throw o},l={toString:a,valueOf:a};typeof Symbol.toPrimitive=="symbol"&&(l[Symbol.toPrimitive]=a),i=function(h){if(!h||typeof h!="object")return!1;var m=r(h,"lastIndex"),g=m&&t(m,"value");if(!g)return!1;try{s(h,l)}catch(O){return O===o}}}else{var c=n("Object.prototype.toString"),u="[object RegExp]";i=function(h){return!h||typeof h!="object"&&typeof h!="function"?!1:c(h)===u}}return fS=i,fS}var dS,d2;function noe(){if(d2)return dS;d2=1;var n=function(){return typeof(function(){}).name=="string"},e=Object.getOwnPropertyDescriptor;if(e)try{e([],"length")}catch{e=null}n.functionsHaveConfigurableNames=function(){if(!n()||!e)return!1;var i=e(function(){},"name");return!!i&&!!i.configurable};var t=Function.prototype.bind;return n.boundFunctionsHaveNames=function(){return n()&&typeof t=="function"&&(function(){}).bind().name!==""},dS=n,dS}var hS,h2;function roe(){if(h2)return hS;h2=1;var n=dP(),e=hP()(),t=noe().functionsHaveConfigurableNames(),r=mf();return hS=function(s,o){if(typeof s!="function")throw new r("`fn` is not a function");var a=arguments.length>2&&!!arguments[2];return(!a||t)&&(e?n(s,"name",o,!0,!0):n(s,"name",o)),s},hS}var pS,p2;function E3(){if(p2)return pS;p2=1;var n=roe(),e=mf(),t=Object;return pS=n(function(){if(this==null||this!==t(this))throw new e("RegExp.prototype.flags getter called on non-object");var i="";return this.hasIndices&&(i+="d"),this.global&&(i+="g"),this.ignoreCase&&(i+="i"),this.multiline&&(i+="m"),this.dotAll&&(i+="s"),this.unicode&&(i+="u"),this.unicodeSets&&(i+="v"),this.sticky&&(i+="y"),i},"get flags",!0),pS}var mS,m2;function R3(){if(m2)return mS;m2=1;var n=E3(),e=Rh().supportsDescriptors,t=Object.getOwnPropertyDescriptor;return mS=function(){if(e&&/a/mig.flags==="gim"){var i=t(RegExp.prototype,"flags");if(i&&typeof i.get=="function"&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var s="",o={};if(Object.defineProperty(o,"hasIndices",{get:function(){s+="d"}}),Object.defineProperty(o,"sticky",{get:function(){s+="y"}}),i.get.call(o),s==="dy")return i.get}}return n},mS}var gS,g2;function ioe(){if(g2)return gS;g2=1;var n=Rh().supportsDescriptors,e=R3(),t=gf(),r=Object.defineProperty,i=v3(),s=k3(),o=/a/;return gS=function(){if(!n||!s)throw new i("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var l=e(),c=s(o),u=t(c,"flags");return(!u||u.get!==l)&&r(c,"flags",{configurable:!0,enumerable:!1,get:l}),l},gS}var OS,O2;function soe(){if(O2)return OS;O2=1;var n=Rh(),e=T3(),t=E3(),r=R3(),i=ioe(),s=e(r());return n(s,{getPolyfill:r,implementation:t,shim:i}),OS=s,OS}var vS,v2;function ooe(){if(v2)return vS;v2=1;var n=fP(),e=n("Date.prototype.getDay"),t=function(a){try{return e(a),!0}catch{return!1}},r=n("Object.prototype.toString"),i="[object Date]",s=aP()();return vS=function(a){return typeof a!="object"||a===null?!1:s?t(a):r(a)===i},vS}var yS,y2;function aoe(){if(y2)return yS;y2=1;var n=m3(),e=Gse(),t=eoe(),r=toe(),i=soe(),s=ooe(),o=Date.prototype.getTime;function a(d,h,m){var g=m||{};return(g.strict?t(d,h):d===h)?!0:!d||!h||typeof d!="object"&&typeof h!="object"?g.strict?t(d,h):d==h:u(d,h,g)}function l(d){return d==null}function c(d){return!(!d||typeof d!="object"||typeof d.length!="number"||typeof d.copy!="function"||typeof d.slice!="function"||d.length>0&&typeof d[0]!="number")}function u(d,h,m){var g,O;if(typeof d!=typeof h||l(d)||l(h)||d.prototype!==h.prototype||e(d)!==e(h))return!1;var y=r(d),b=r(h);if(y!==b)return!1;if(y||b)return d.source===h.source&&i(d)===i(h);if(s(d)&&s(h))return o.call(d)===o.call(h);var S=c(d),P=c(h);if(S!==P)return!1;if(S||P){if(d.length!==h.length)return!1;for(g=0;g<d.length;g++)if(d[g]!==h[g])return!1;return!0}if(typeof d!=typeof h)return!1;try{var k=n(d),x=n(h)}catch{return!1}if(k.length!==x.length)return!1;for(k.sort(),x.sort(),g=k.length-1;g>=0;g--)if(k[g]!=x[g])return!1;for(g=k.length-1;g>=0;g--)if(O=k[g],!a(d[O],h[O],m))return!1;return!0}return yS=a,yS}var bS,b2;function loe(){if(b2)return bS;b2=1;var n=aoe(),e;function t(a,l,c,u,d){var h;return d?h=d.replaceOp(a,c,u):(h={p:a},h[l?"od":"ld"]=c,h[l?"oi":"li"]=u),[h]}function r(a,l,c,u,d,h){const m=[];var g=e.patch_make(l,c);return Object.keys(g).forEach(function(O){var y=g[O],b=y.start1;y.diffs.forEach(function([S,P]){switch(S){case u.DIFF_DELETE:if(h){var k=h.remove(b,P);m.push(d.editOp(a,h.type,k))}else m.push({sd:P,p:[...a,b]});break;case u.DIFF_INSERT:if(h){var k=h.insert(b,P);m.push(d.editOp(a,h.type,k))}else m.push({si:P,p:[...a,b]});case u.DIFF_EQUAL:b+=P.length;break;default:throw Error(`Unsupported operation type: ${S}`)}})}),m}var i=function(a,l){if(l&&l.json1){var c=l.json1.type.compose;return a.reduce(c,null)}for(var u=0,d=a.length-1;u<d;++u){var h=a[u],m=a[u+1];n(h.p.slice(0,-1),m.p.slice(0,-1))&&h.p[h.p.length-1]+1===m.p[m.p.length-1]&&(!h.li||!m.ld||n(h.li,m.ld)&&(delete h.li,delete m.ld))}return a=a.filter(function(g){return Object.keys(g).length>1}),a},s=function(a,l,c=[],u){var d=u&&u.diffMatchPatch,h=u&&u.json1,m=u&&u.textUnicode,g=typeof c[c.length-1]=="string"||c.length===0;if(n(a,l)&&Array.isArray(a)===Array.isArray(l))return[];if(typeof l>"u"){var O;return h?O=h.removeOp(c,a):(O={p:c},O[g?"od":"ld"]=a),[O]}if(typeof a>"u"){var O;return h?O=h.insertOp(c,l):(O={p:c},O[g?"oi":"li"]=l),[O]}if(a===null||l===null){var Q=[];if(h)Q.push(h.removeOp(c,a)),Q.push(h.insertOp(c,l));else{var y={p:c};y[g?"od":"ld"]=a;var b={p:c};b[g?"oi":"li"]=l,Q=[y,b]}return Q}if(d&&typeof a=="string"&&typeof l=="string")return e||(e=new d),r(c,a,l,d,h,m);var S=["string","number","boolean"];if(S.includes(typeof l)||S.includes(typeof a))return t(c,g,a,l,h);if(Array.isArray(l)&&Array.isArray(a)){for(var Q=[],P=a.length,k=l.length,x=Math.min(P,k),Q=[],A=0;A<x;++A){var M=s(a[A],l[A],[...c,A],u);M.forEach(function($){Q.push($)})}if(k>P)for(var A=x;A<k;A++){var M=s(void 0,l[A],[...c,A],u);M.forEach(function(F){Q.push(F)})}else if(k<P)for(var A=x;A<P;A++){var M=s(a[A],void 0,[...c,x],u);M.forEach(function(F){Q.push(F)})}return Q}else if(Array.isArray(l)||Array.isArray(a))return t(c,g,a,l,h);var Q=[],_=new Set([...Object.keys(a),...Object.keys(l)]);return _.forEach(function(R){var $=s(a[R],l[R],[...c,R],u);Q=Q.concat($)}),Q},o=function(a,l,c,u,d){var h={diffMatchPatch:c,json1:u,textUnicode:d};return i(s(a,l,[],h),h)};return bS=o,bS}var coe=loe();const uoe=Us(coe);var SS={exports:{}},S2;function foe(){return S2||(S2=1,function(n){var e=function(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32},t=-1,r=1,i=0;e.Diff=function(s,o){return[s,o]},e.prototype.diff_main=function(s,o,a,l){typeof l>"u"&&(this.Diff_Timeout<=0?l=Number.MAX_VALUE:l=new Date().getTime()+this.Diff_Timeout*1e3);var c=l;if(s==null||o==null)throw new Error("Null input. (diff_main)");if(s==o)return s?[new e.Diff(i,s)]:[];typeof a>"u"&&(a=!0);var u=a,d=this.diff_commonPrefix(s,o),h=s.substring(0,d);s=s.substring(d),o=o.substring(d),d=this.diff_commonSuffix(s,o);var m=s.substring(s.length-d);s=s.substring(0,s.length-d),o=o.substring(0,o.length-d);var g=this.diff_compute_(s,o,u,c);return h&&g.unshift(new e.Diff(i,h)),m&&g.push(new e.Diff(i,m)),this.diff_cleanupMerge(g),g},e.prototype.diff_compute_=function(s,o,a,l){var c;if(!s)return[new e.Diff(r,o)];if(!o)return[new e.Diff(t,s)];var u=s.length>o.length?s:o,d=s.length>o.length?o:s,h=u.indexOf(d);if(h!=-1)return c=[new e.Diff(r,u.substring(0,h)),new e.Diff(i,d),new e.Diff(r,u.substring(h+d.length))],s.length>o.length&&(c[0][0]=c[2][0]=t),c;if(d.length==1)return[new e.Diff(t,s),new e.Diff(r,o)];var m=this.diff_halfMatch_(s,o);if(m){var g=m[0],O=m[1],y=m[2],b=m[3],S=m[4],P=this.diff_main(g,y,a,l),k=this.diff_main(O,b,a,l);return P.concat([new e.Diff(i,S)],k)}return a&&s.length>100&&o.length>100?this.diff_lineMode_(s,o,l):this.diff_bisect_(s,o,l)},e.prototype.diff_lineMode_=function(s,o,a){var l=this.diff_linesToChars_(s,o);s=l.chars1,o=l.chars2;var c=l.lineArray,u=this.diff_main(s,o,!1,a);this.diff_charsToLines_(u,c),this.diff_cleanupSemantic(u),u.push(new e.Diff(i,""));for(var d=0,h=0,m=0,g="",O="";d<u.length;){switch(u[d][0]){case r:m++,O+=u[d][1];break;case t:h++,g+=u[d][1];break;case i:if(h>=1&&m>=1){u.splice(d-h-m,h+m),d=d-h-m;for(var y=this.diff_main(g,O,!1,a),b=y.length-1;b>=0;b--)u.splice(d,0,y[b]);d=d+y.length}m=0,h=0,g="",O="";break}d++}return u.pop(),u},e.prototype.diff_bisect_=function(s,o,a){for(var l=s.length,c=o.length,u=Math.ceil((l+c)/2),d=u,h=2*u,m=new Array(h),g=new Array(h),O=0;O<h;O++)m[O]=-1,g[O]=-1;m[d+1]=0,g[d+1]=0;for(var y=l-c,b=y%2!=0,S=0,P=0,k=0,x=0,A=0;A<u&&!(new Date().getTime()>a);A++){for(var M=-A+S;M<=A-P;M+=2){var Q=d+M,_;M==-A||M!=A&&m[Q-1]<m[Q+1]?_=m[Q+1]:_=m[Q-1]+1;for(var R=_-M;_<l&&R<c&&s.charAt(_)==o.charAt(R);)_++,R++;if(m[Q]=_,_>l)P+=2;else if(R>c)S+=2;else if(b){var $=d+y-M;if($>=0&&$<h&&g[$]!=-1){var D=l-g[$];if(_>=D)return this.diff_bisectSplit_(s,o,_,R,a)}}}for(var F=-A+k;F<=A-x;F+=2){var $=d+F,D;F==-A||F!=A&&g[$-1]<g[$+1]?D=g[$+1]:D=g[$-1]+1;for(var G=D-F;D<l&&G<c&&s.charAt(l-D-1)==o.charAt(c-G-1);)D++,G++;if(g[$]=D,D>l)x+=2;else if(G>c)k+=2;else if(!b){var Q=d+y-F;if(Q>=0&&Q<h&&m[Q]!=-1){var _=m[Q],R=d+_-Q;if(D=l-D,_>=D)return this.diff_bisectSplit_(s,o,_,R,a)}}}}return[new e.Diff(t,s),new e.Diff(r,o)]},e.prototype.diff_bisectSplit_=function(s,o,a,l,c){var u=s.substring(0,a),d=o.substring(0,l),h=s.substring(a),m=o.substring(l),g=this.diff_main(u,d,!1,c),O=this.diff_main(h,m,!1,c);return g.concat(O)},e.prototype.diff_linesToChars_=function(s,o){var a=[],l={};a[0]="";function c(m){for(var g="",O=0,y=-1,b=a.length;y<m.length-1;){y=m.indexOf(`
|
|
180
|
+
`,O),y==-1&&(y=m.length-1);var S=m.substring(O,y+1);(l.hasOwnProperty?l.hasOwnProperty(S):l[S]!==void 0)?g+=String.fromCharCode(l[S]):(b==u&&(S=m.substring(O),y=m.length),g+=String.fromCharCode(b),l[S]=b,a[b++]=S),O=y+1}return g}var u=4e4,d=c(s);u=65535;var h=c(o);return{chars1:d,chars2:h,lineArray:a}},e.prototype.diff_charsToLines_=function(s,o){for(var a=0;a<s.length;a++){for(var l=s[a][1],c=[],u=0;u<l.length;u++)c[u]=o[l.charCodeAt(u)];s[a][1]=c.join("")}},e.prototype.diff_commonPrefix=function(s,o){if(!s||!o||s.charAt(0)!=o.charAt(0))return 0;for(var a=0,l=Math.min(s.length,o.length),c=l,u=0;a<c;)s.substring(u,c)==o.substring(u,c)?(a=c,u=a):l=c,c=Math.floor((l-a)/2+a);return c},e.prototype.diff_commonSuffix=function(s,o){if(!s||!o||s.charAt(s.length-1)!=o.charAt(o.length-1))return 0;for(var a=0,l=Math.min(s.length,o.length),c=l,u=0;a<c;)s.substring(s.length-c,s.length-u)==o.substring(o.length-c,o.length-u)?(a=c,u=a):l=c,c=Math.floor((l-a)/2+a);return c},e.prototype.diff_commonOverlap_=function(s,o){var a=s.length,l=o.length;if(a==0||l==0)return 0;a>l?s=s.substring(a-l):a<l&&(o=o.substring(0,a));var c=Math.min(a,l);if(s==o)return c;for(var u=0,d=1;;){var h=s.substring(c-d),m=o.indexOf(h);if(m==-1)return u;d+=m,(m==0||s.substring(c-d)==o.substring(0,d))&&(u=d,d++)}},e.prototype.diff_halfMatch_=function(s,o){if(this.Diff_Timeout<=0)return null;var a=s.length>o.length?s:o,l=s.length>o.length?o:s;if(a.length<4||l.length*2<a.length)return null;var c=this;function u(P,k,x){for(var A=P.substring(x,x+Math.floor(P.length/4)),M=-1,Q="",_,R,$,D;(M=k.indexOf(A,M+1))!=-1;){var F=c.diff_commonPrefix(P.substring(x),k.substring(M)),G=c.diff_commonSuffix(P.substring(0,x),k.substring(0,M));Q.length<G+F&&(Q=k.substring(M-G,M)+k.substring(M,M+F),_=P.substring(0,x-G),R=P.substring(x+F),$=k.substring(0,M-G),D=k.substring(M+F))}return Q.length*2>=P.length?[_,R,$,D,Q]:null}var d=u(a,l,Math.ceil(a.length/4)),h=u(a,l,Math.ceil(a.length/2)),m;if(!d&&!h)return null;h?d?m=d[4].length>h[4].length?d:h:m=h:m=d;var g,O,y,b;s.length>o.length?(g=m[0],O=m[1],y=m[2],b=m[3]):(y=m[0],b=m[1],g=m[2],O=m[3]);var S=m[4];return[g,O,y,b,S]},e.prototype.diff_cleanupSemantic=function(s){for(var o=!1,a=[],l=0,c=null,u=0,d=0,h=0,m=0,g=0;u<s.length;)s[u][0]==i?(a[l++]=u,d=m,h=g,m=0,g=0,c=s[u][1]):(s[u][0]==r?m+=s[u][1].length:g+=s[u][1].length,c&&c.length<=Math.max(d,h)&&c.length<=Math.max(m,g)&&(s.splice(a[l-1],0,new e.Diff(t,c)),s[a[l-1]+1][0]=r,l--,l--,u=l>0?a[l-1]:-1,d=0,h=0,m=0,g=0,c=null,o=!0)),u++;for(o&&this.diff_cleanupMerge(s),this.diff_cleanupSemanticLossless(s),u=1;u<s.length;){if(s[u-1][0]==t&&s[u][0]==r){var O=s[u-1][1],y=s[u][1],b=this.diff_commonOverlap_(O,y),S=this.diff_commonOverlap_(y,O);b>=S?(b>=O.length/2||b>=y.length/2)&&(s.splice(u,0,new e.Diff(i,y.substring(0,b))),s[u-1][1]=O.substring(0,O.length-b),s[u+1][1]=y.substring(b),u++):(S>=O.length/2||S>=y.length/2)&&(s.splice(u,0,new e.Diff(i,O.substring(0,S))),s[u-1][0]=r,s[u-1][1]=y.substring(0,y.length-S),s[u+1][0]=t,s[u+1][1]=O.substring(S),u++),u++}u++}},e.prototype.diff_cleanupSemanticLossless=function(s){function o(S,P){if(!S||!P)return 6;var k=S.charAt(S.length-1),x=P.charAt(0),A=k.match(e.nonAlphaNumericRegex_),M=x.match(e.nonAlphaNumericRegex_),Q=A&&k.match(e.whitespaceRegex_),_=M&&x.match(e.whitespaceRegex_),R=Q&&k.match(e.linebreakRegex_),$=_&&x.match(e.linebreakRegex_),D=R&&S.match(e.blanklineEndRegex_),F=$&&P.match(e.blanklineStartRegex_);return D||F?5:R||$?4:A&&!Q&&_?3:Q||_?2:A||M?1:0}for(var a=1;a<s.length-1;){if(s[a-1][0]==i&&s[a+1][0]==i){var l=s[a-1][1],c=s[a][1],u=s[a+1][1],d=this.diff_commonSuffix(l,c);if(d){var h=c.substring(c.length-d);l=l.substring(0,l.length-d),c=h+c.substring(0,c.length-d),u=h+u}for(var m=l,g=c,O=u,y=o(l,c)+o(c,u);c.charAt(0)===u.charAt(0);){l+=c.charAt(0),c=c.substring(1)+u.charAt(0),u=u.substring(1);var b=o(l,c)+o(c,u);b>=y&&(y=b,m=l,g=c,O=u)}s[a-1][1]!=m&&(m?s[a-1][1]=m:(s.splice(a-1,1),a--),s[a][1]=g,O?s[a+1][1]=O:(s.splice(a+1,1),a--))}a++}},e.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,e.whitespaceRegex_=/\s/,e.linebreakRegex_=/[\r\n]/,e.blanklineEndRegex_=/\n\r?\n$/,e.blanklineStartRegex_=/^\r?\n\r?\n/,e.prototype.diff_cleanupEfficiency=function(s){for(var o=!1,a=[],l=0,c=null,u=0,d=!1,h=!1,m=!1,g=!1;u<s.length;)s[u][0]==i?(s[u][1].length<this.Diff_EditCost&&(m||g)?(a[l++]=u,d=m,h=g,c=s[u][1]):(l=0,c=null),m=g=!1):(s[u][0]==t?g=!0:m=!0,c&&(d&&h&&m&&g||c.length<this.Diff_EditCost/2&&d+h+m+g==3)&&(s.splice(a[l-1],0,new e.Diff(t,c)),s[a[l-1]+1][0]=r,l--,c=null,d&&h?(m=g=!0,l=0):(l--,u=l>0?a[l-1]:-1,m=g=!1),o=!0)),u++;o&&this.diff_cleanupMerge(s)},e.prototype.diff_cleanupMerge=function(s){s.push(new e.Diff(i,""));for(var o=0,a=0,l=0,c="",u="",d;o<s.length;)switch(s[o][0]){case r:l++,u+=s[o][1],o++;break;case t:a++,c+=s[o][1],o++;break;case i:a+l>1?(a!==0&&l!==0&&(d=this.diff_commonPrefix(u,c),d!==0&&(o-a-l>0&&s[o-a-l-1][0]==i?s[o-a-l-1][1]+=u.substring(0,d):(s.splice(0,0,new e.Diff(i,u.substring(0,d))),o++),u=u.substring(d),c=c.substring(d)),d=this.diff_commonSuffix(u,c),d!==0&&(s[o][1]=u.substring(u.length-d)+s[o][1],u=u.substring(0,u.length-d),c=c.substring(0,c.length-d))),o-=a+l,s.splice(o,a+l),c.length&&(s.splice(o,0,new e.Diff(t,c)),o++),u.length&&(s.splice(o,0,new e.Diff(r,u)),o++),o++):o!==0&&s[o-1][0]==i?(s[o-1][1]+=s[o][1],s.splice(o,1)):o++,l=0,a=0,c="",u="";break}s[s.length-1][1]===""&&s.pop();var h=!1;for(o=1;o<s.length-1;)s[o-1][0]==i&&s[o+1][0]==i&&(s[o][1].substring(s[o][1].length-s[o-1][1].length)==s[o-1][1]?(s[o][1]=s[o-1][1]+s[o][1].substring(0,s[o][1].length-s[o-1][1].length),s[o+1][1]=s[o-1][1]+s[o+1][1],s.splice(o-1,1),h=!0):s[o][1].substring(0,s[o+1][1].length)==s[o+1][1]&&(s[o-1][1]+=s[o+1][1],s[o][1]=s[o][1].substring(s[o+1][1].length)+s[o+1][1],s.splice(o+1,1),h=!0)),o++;h&&this.diff_cleanupMerge(s)},e.prototype.diff_xIndex=function(s,o){var a=0,l=0,c=0,u=0,d;for(d=0;d<s.length&&(s[d][0]!==r&&(a+=s[d][1].length),s[d][0]!==t&&(l+=s[d][1].length),!(a>o));d++)c=a,u=l;return s.length!=d&&s[d][0]===t?u:u+(o-c)},e.prototype.diff_prettyHtml=function(s){for(var o=[],a=/&/g,l=/</g,c=/>/g,u=/\n/g,d=0;d<s.length;d++){var h=s[d][0],m=s[d][1],g=m.replace(a,"&").replace(l,"<").replace(c,">").replace(u,"¶<br>");switch(h){case r:o[d]='<ins style="background:#e6ffe6;">'+g+"</ins>";break;case t:o[d]='<del style="background:#ffe6e6;">'+g+"</del>";break;case i:o[d]="<span>"+g+"</span>";break}}return o.join("")},e.prototype.diff_text1=function(s){for(var o=[],a=0;a<s.length;a++)s[a][0]!==r&&(o[a]=s[a][1]);return o.join("")},e.prototype.diff_text2=function(s){for(var o=[],a=0;a<s.length;a++)s[a][0]!==t&&(o[a]=s[a][1]);return o.join("")},e.prototype.diff_levenshtein=function(s){for(var o=0,a=0,l=0,c=0;c<s.length;c++){var u=s[c][0],d=s[c][1];switch(u){case r:a+=d.length;break;case t:l+=d.length;break;case i:o+=Math.max(a,l),a=0,l=0;break}}return o+=Math.max(a,l),o},e.prototype.diff_toDelta=function(s){for(var o=[],a=0;a<s.length;a++)switch(s[a][0]){case r:o[a]="+"+encodeURI(s[a][1]);break;case t:o[a]="-"+s[a][1].length;break;case i:o[a]="="+s[a][1].length;break}return o.join(" ").replace(/%20/g," ")},e.prototype.diff_fromDelta=function(s,o){for(var a=[],l=0,c=0,u=o.split(/\t/g),d=0;d<u.length;d++){var h=u[d].substring(1);switch(u[d].charAt(0)){case"+":try{a[l++]=new e.Diff(r,decodeURI(h))}catch{throw new Error("Illegal escape in diff_fromDelta: "+h)}break;case"-":case"=":var m=parseInt(h,10);if(isNaN(m)||m<0)throw new Error("Invalid number in diff_fromDelta: "+h);var g=s.substring(c,c+=m);u[d].charAt(0)=="="?a[l++]=new e.Diff(i,g):a[l++]=new e.Diff(t,g);break;default:if(u[d])throw new Error("Invalid diff operation in diff_fromDelta: "+u[d])}}if(c!=s.length)throw new Error("Delta length ("+c+") does not equal source text length ("+s.length+").");return a},e.prototype.match_main=function(s,o,a){if(s==null||o==null||a==null)throw new Error("Null input. (match_main)");return a=Math.max(0,Math.min(a,s.length)),s==o?0:s.length?s.substring(a,a+o.length)==o?a:this.match_bitap_(s,o,a):-1},e.prototype.match_bitap_=function(s,o,a){if(o.length>this.Match_MaxBits)throw new Error("Pattern too long for this browser.");var l=this.match_alphabet_(o),c=this;function u(_,R){var $=_/o.length,D=Math.abs(a-R);return c.Match_Distance?$+D/c.Match_Distance:D?1:$}var d=this.Match_Threshold,h=s.indexOf(o,a);h!=-1&&(d=Math.min(u(0,h),d),h=s.lastIndexOf(o,a+o.length),h!=-1&&(d=Math.min(u(0,h),d)));var m=1<<o.length-1;h=-1;for(var g,O,y=o.length+s.length,b,S=0;S<o.length;S++){for(g=0,O=y;g<O;)u(S,a+O)<=d?g=O:y=O,O=Math.floor((y-g)/2+g);y=O;var P=Math.max(1,a-O+1),k=Math.min(a+O,s.length)+o.length,x=Array(k+2);x[k+1]=(1<<S)-1;for(var A=k;A>=P;A--){var M=l[s.charAt(A-1)];if(S===0?x[A]=(x[A+1]<<1|1)&M:x[A]=(x[A+1]<<1|1)&M|((b[A+1]|b[A])<<1|1)|b[A+1],x[A]&m){var Q=u(S,A-1);if(Q<=d)if(d=Q,h=A-1,h>a)P=Math.max(1,2*a-h);else break}}if(u(S+1,a)>d)break;b=x}return h},e.prototype.match_alphabet_=function(s){for(var o={},a=0;a<s.length;a++)o[s.charAt(a)]=0;for(var a=0;a<s.length;a++)o[s.charAt(a)]|=1<<s.length-a-1;return o},e.prototype.patch_addContext_=function(s,o){if(o.length!=0){if(s.start2===null)throw Error("patch not initialized");for(var a=o.substring(s.start2,s.start2+s.length1),l=0;o.indexOf(a)!=o.lastIndexOf(a)&&a.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin;)l+=this.Patch_Margin,a=o.substring(s.start2-l,s.start2+s.length1+l);l+=this.Patch_Margin;var c=o.substring(s.start2-l,s.start2);c&&s.diffs.unshift(new e.Diff(i,c));var u=o.substring(s.start2+s.length1,s.start2+s.length1+l);u&&s.diffs.push(new e.Diff(i,u)),s.start1-=c.length,s.start2-=c.length,s.length1+=c.length+u.length,s.length2+=c.length+u.length}},e.prototype.patch_make=function(s,o,a){var l,c;if(typeof s=="string"&&typeof o=="string"&&typeof a>"u")l=s,c=this.diff_main(l,o,!0),c.length>2&&(this.diff_cleanupSemantic(c),this.diff_cleanupEfficiency(c));else if(s&&typeof s=="object"&&typeof o>"u"&&typeof a>"u")c=s,l=this.diff_text1(c);else if(typeof s=="string"&&o&&typeof o=="object"&&typeof a>"u")l=s,c=o;else if(typeof s=="string"&&typeof o=="string"&&a&&typeof a=="object")l=s,c=a;else throw new Error("Unknown call format to patch_make.");if(c.length===0)return[];for(var u=[],d=new e.patch_obj,h=0,m=0,g=0,O=l,y=l,b=0;b<c.length;b++){var S=c[b][0],P=c[b][1];switch(!h&&S!==i&&(d.start1=m,d.start2=g),S){case r:d.diffs[h++]=c[b],d.length2+=P.length,y=y.substring(0,g)+P+y.substring(g);break;case t:d.length1+=P.length,d.diffs[h++]=c[b],y=y.substring(0,g)+y.substring(g+P.length);break;case i:P.length<=2*this.Patch_Margin&&h&&c.length!=b+1?(d.diffs[h++]=c[b],d.length1+=P.length,d.length2+=P.length):P.length>=2*this.Patch_Margin&&h&&(this.patch_addContext_(d,O),u.push(d),d=new e.patch_obj,h=0,O=y,m=g);break}S!==r&&(m+=P.length),S!==t&&(g+=P.length)}return h&&(this.patch_addContext_(d,O),u.push(d)),u},e.prototype.patch_deepCopy=function(s){for(var o=[],a=0;a<s.length;a++){var l=s[a],c=new e.patch_obj;c.diffs=[];for(var u=0;u<l.diffs.length;u++)c.diffs[u]=new e.Diff(l.diffs[u][0],l.diffs[u][1]);c.start1=l.start1,c.start2=l.start2,c.length1=l.length1,c.length2=l.length2,o[a]=c}return o},e.prototype.patch_apply=function(s,o){if(s.length==0)return[o,[]];s=this.patch_deepCopy(s);var a=this.patch_addPadding(s);o=a+o+a,this.patch_splitMax(s);for(var l=0,c=[],u=0;u<s.length;u++){var d=s[u].start2+l,h=this.diff_text1(s[u].diffs),m,g=-1;if(h.length>this.Match_MaxBits?(m=this.match_main(o,h.substring(0,this.Match_MaxBits),d),m!=-1&&(g=this.match_main(o,h.substring(h.length-this.Match_MaxBits),d+h.length-this.Match_MaxBits),(g==-1||m>=g)&&(m=-1))):m=this.match_main(o,h,d),m==-1)c[u]=!1,l-=s[u].length2-s[u].length1;else{c[u]=!0,l=m-d;var O;if(g==-1?O=o.substring(m,m+h.length):O=o.substring(m,g+this.Match_MaxBits),h==O)o=o.substring(0,m)+this.diff_text2(s[u].diffs)+o.substring(m+h.length);else{var y=this.diff_main(h,O,!1);if(h.length>this.Match_MaxBits&&this.diff_levenshtein(y)/h.length>this.Patch_DeleteThreshold)c[u]=!1;else{this.diff_cleanupSemanticLossless(y);for(var b=0,S,P=0;P<s[u].diffs.length;P++){var k=s[u].diffs[P];k[0]!==i&&(S=this.diff_xIndex(y,b)),k[0]===r?o=o.substring(0,m+S)+k[1]+o.substring(m+S):k[0]===t&&(o=o.substring(0,m+S)+o.substring(m+this.diff_xIndex(y,b+k[1].length))),k[0]!==t&&(b+=k[1].length)}}}}}return o=o.substring(a.length,o.length-a.length),[o,c]},e.prototype.patch_addPadding=function(s){for(var o=this.Patch_Margin,a="",l=1;l<=o;l++)a+=String.fromCharCode(l);for(var l=0;l<s.length;l++)s[l].start1+=o,s[l].start2+=o;var c=s[0],u=c.diffs;if(u.length==0||u[0][0]!=i)u.unshift(new e.Diff(i,a)),c.start1-=o,c.start2-=o,c.length1+=o,c.length2+=o;else if(o>u[0][1].length){var d=o-u[0][1].length;u[0][1]=a.substring(u[0][1].length)+u[0][1],c.start1-=d,c.start2-=d,c.length1+=d,c.length2+=d}if(c=s[s.length-1],u=c.diffs,u.length==0||u[u.length-1][0]!=i)u.push(new e.Diff(i,a)),c.length1+=o,c.length2+=o;else if(o>u[u.length-1][1].length){var d=o-u[u.length-1][1].length;u[u.length-1][1]+=a.substring(0,d),c.length1+=d,c.length2+=d}return a},e.prototype.patch_splitMax=function(s){for(var o=this.Match_MaxBits,a=0;a<s.length;a++)if(!(s[a].length1<=o)){var l=s[a];s.splice(a--,1);for(var c=l.start1,u=l.start2,d="";l.diffs.length!==0;){var h=new e.patch_obj,m=!0;for(h.start1=c-d.length,h.start2=u-d.length,d!==""&&(h.length1=h.length2=d.length,h.diffs.push(new e.Diff(i,d)));l.diffs.length!==0&&h.length1<o-this.Patch_Margin;){var g=l.diffs[0][0],O=l.diffs[0][1];g===r?(h.length2+=O.length,u+=O.length,h.diffs.push(l.diffs.shift()),m=!1):g===t&&h.diffs.length==1&&h.diffs[0][0]==i&&O.length>2*o?(h.length1+=O.length,c+=O.length,m=!1,h.diffs.push(new e.Diff(g,O)),l.diffs.shift()):(O=O.substring(0,o-h.length1-this.Patch_Margin),h.length1+=O.length,c+=O.length,g===i?(h.length2+=O.length,u+=O.length):m=!1,h.diffs.push(new e.Diff(g,O)),O==l.diffs[0][1]?l.diffs.shift():l.diffs[0][1]=l.diffs[0][1].substring(O.length))}d=this.diff_text2(h.diffs),d=d.substring(d.length-this.Patch_Margin);var y=this.diff_text1(l.diffs).substring(0,this.Patch_Margin);y!==""&&(h.length1+=y.length,h.length2+=y.length,h.diffs.length!==0&&h.diffs[h.diffs.length-1][0]===i?h.diffs[h.diffs.length-1][1]+=y:h.diffs.push(new e.Diff(i,y))),m||s.splice(++a,0,h)}}},e.prototype.patch_toText=function(s){for(var o=[],a=0;a<s.length;a++)o[a]=s[a];return o.join("")},e.prototype.patch_fromText=function(s){var o=[];if(!s)return o;for(var a=s.split(`
|
|
181
|
+
`),l=0,c=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;l<a.length;){var u=a[l].match(c);if(!u)throw new Error("Invalid patch string: "+a[l]);var d=new e.patch_obj;for(o.push(d),d.start1=parseInt(u[1],10),u[2]===""?(d.start1--,d.length1=1):u[2]=="0"?d.length1=0:(d.start1--,d.length1=parseInt(u[2],10)),d.start2=parseInt(u[3],10),u[4]===""?(d.start2--,d.length2=1):u[4]=="0"?d.length2=0:(d.start2--,d.length2=parseInt(u[4],10)),l++;l<a.length;){var h=a[l].charAt(0);try{var m=decodeURI(a[l].substring(1))}catch{throw new Error("Illegal escape in patch_fromText: "+m)}if(h=="-")d.diffs.push(new e.Diff(t,m));else if(h=="+")d.diffs.push(new e.Diff(r,m));else if(h==" ")d.diffs.push(new e.Diff(i,m));else{if(h=="@")break;if(h!=="")throw new Error('Invalid patch mode "'+h+'" in: '+m)}l++}}return o},e.patch_obj=function(){this.diffs=[],this.start1=null,this.start2=null,this.length1=0,this.length2=0},e.patch_obj.prototype.toString=function(){var s,o;this.length1===0?s=this.start1+",0":this.length1==1?s=this.start1+1:s=this.start1+1+","+this.length1,this.length2===0?o=this.start2+",0":this.length2==1?o=this.start2+1:o=this.start2+1+","+this.length2;for(var a=["@@ -"+s+" +"+o+` @@
|
|
182
|
+
`],l,c=0;c<this.diffs.length;c++){switch(this.diffs[c][0]){case r:l="+";break;case t:l="-";break;case i:l=" ";break}a[c+1]=l+encodeURI(this.diffs[c][1])+`
|
|
183
|
+
`}return a.join("").replace(/%20/g," ")},n.exports=e,n.exports.diff_match_patch=e,n.exports.DIFF_DELETE=t,n.exports.DIFF_INSERT=r,n.exports.DIFF_EQUAL=i}(SS)),SS.exports}var doe=foe();const hoe=Us(doe),poe=(n,e)=>uoe(n,e,hoe,bw,k2),moe=n=>L.useCallback(t=>{const r=n.data,i=poe(r,t(r));i&&n&&n.submitOp(i)},[n]),goe=1e3,Ooe=n=>{const e=L.useRef(),[t,r]=L.useState(!1),i=L.useCallback(()=>{n&&n.whenNothingPending(()=>{r(!1)})},[n,r]);return L.useEffect(()=>{n&&n.on("before op",()=>{r(!0),clearTimeout(e.current),e.current=setTimeout(()=>{i()},goe)})},[n,i]),t},voe=({connection:n})=>{const[e,t]=L.useState(null),[r,i]=L.useState(null),[s,o]=L.useState(null),[a,l]=L.useState(null),[c,u]=L.useState(!1);L.useEffect(()=>{n.on("connected",()=>{u(!0)}),n.on("disconnected",()=>{u(!1)});const m="documents",g="1",O=n.get(m,g);return O.subscribe(()=>{t(O),l(O.data),O.on("op",()=>{l(O.data)});const y=n.getDocPresence(m,g);y.subscribe(function(S){if(S)throw S});const b=()=>{const S=Date.now().toString(36),P=nw();return`${S}-${P}`};i(y.create(b())),o(y)}),()=>{}},[]);const d=Ooe(e),h=moe(e);return{shareDBDoc:e,content:a,localPresence:r,docPresence:s,submitOperation:h,connected:c,pending:d}},yoe=new Gq,boe=new Cse;w2.types.register(bw.type);const{Connection:Soe}=w2,woe=window.location.protocol==="https:"?"wss://":"ws://",koe=new WebSocket(woe+window.location.host+"/ws"),Poe=new Soe(koe),xoe=()=>{const{username:n}=L.useContext(ni);return Ase(n),null};function Toe(){const{shareDBDoc:n,content:e,localPresence:t,docPresence:r,submitOperation:i,connected:s,pending:o}=voe({connection:Poe}),[a,l]=L.useState(void 0),[c,u]=L.useState(H7()),[d,h]=L.useState(!1),m=Rse();return q.jsx(nV,{children:q.jsx(HG,{content:e,shareDBDoc:n,submitOperation:i,localPresence:t,docPresence:r,prettierWorker:yoe,typeScriptWorker:boe,initialUsername:m,connected:s,pending:o,liveKitRoomName:c,setLiveKitRoom:u,liveKitToken:a,setLiveKitToken:l,liveKitConnection:d,setLiveKitConnection:h,children:q.jsxs(L7,{audio:!0,token:a,serverUrl:void 0,connect:d,style:{height:"100%"},children:[q.jsxs("div",{className:"app",children:[q.jsx(tee,{}),q.jsx(kse,{allowGlobals:!0,aiCopilotEndpoint:"/ai-copilot"}),q.jsx(Tse,{}),q.jsx(pM,{side:"left"}),q.jsx(pM,{side:"right"})]}),q.jsx(xoe,{}),q.jsx(W7,{})]})})})}Vq.createRoot(document.getElementById("root")).render(q.jsx(fG,{children:q.jsx(Toe,{})}));
|