var pn=Object.defineProperty;var fn=(o,e,s)=>e in o?pn(o,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[e]=s;var Rt=(o,e,s)=>(fn(o,typeof e!="symbol"?e+"":e,s),s);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))a(c);new MutationObserver(c=>{for(const h of c)if(h.type==="childList")for(const d of h.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&a(d)}).observe(document,{childList:!0,subtree:!0});function s(c){const h={};return c.integrity&&(h.integrity=c.integrity),c.referrerpolicy&&(h.referrerPolicy=c.referrerpolicy),c.crossorigin==="use-credentials"?h.credentials="include":c.crossorigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function a(c){if(c.ep)return;c.ep=!0;const h=s(c);fetch(c.href,h)}})();var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}function getAugmentedNamespace(o){var e=o.default;if(typeof e=="function"){var s=function(){return e.apply(this,arguments)};s.prototype=e.prototype}else s={};return Object.defineProperty(s,"__esModule",{value:!0}),Object.keys(o).forEach(function(a){var c=Object.getOwnPropertyDescriptor(o,a);Object.defineProperty(s,a,c.get?c:{enumerable:!0,get:function(){return o[a]}})}),s}var react={exports:{}},react_production_min={};/** * @license React * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var l$1=Symbol.for("react.element"),n$1=Symbol.for("react.portal"),p$3=Symbol.for("react.fragment"),q$1=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),t$2=Symbol.for("react.provider"),u=Symbol.for("react.context"),v$1=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),z$1=Symbol.iterator;function A$1(o){return o===null||typeof o!="object"?null:(o=z$1&&o[z$1]||o["@@iterator"],typeof o=="function"?o:null)}var B$1={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C$2=Object.assign,D$1={};function E$1(o,e,s){this.props=o,this.context=e,this.refs=D$1,this.updater=s||B$1}E$1.prototype.isReactComponent={};E$1.prototype.setState=function(o,e){if(typeof o!="object"&&typeof o!="function"&&o!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,o,e,"setState")};E$1.prototype.forceUpdate=function(o){this.updater.enqueueForceUpdate(this,o,"forceUpdate")};function F$1(){}F$1.prototype=E$1.prototype;function G$1(o,e,s){this.props=o,this.context=e,this.refs=D$1,this.updater=s||B$1}var H$1=G$1.prototype=new F$1;H$1.constructor=G$1;C$2(H$1,E$1.prototype);H$1.isPureReactComponent=!0;var I$2=Array.isArray,J=Object.prototype.hasOwnProperty,K$1={current:null},L$1={key:!0,ref:!0,__self:!0,__source:!0};function M$1(o,e,s){var a,c={},h=null,d=null;if(e!=null)for(a in e.ref!==void 0&&(d=e.ref),e.key!==void 0&&(h=""+e.key),e)J.call(e,a)&&!L$1.hasOwnProperty(a)&&(c[a]=e[a]);var g=arguments.length-2;if(g===1)c.children=s;else if(1>>1,Tt=dt[xt];if(0>>1;xtc(Bt,Ct))Ftc(Lt,Bt)?(dt[xt]=Lt,dt[Ft]=Ct,xt=Ft):(dt[xt]=Bt,dt[_t]=Ct,xt=_t);else if(Ftc(Lt,Ct))dt[xt]=Lt,dt[Ft]=Ct,xt=Ft;else break e}}return Dt}function c(dt,Dt){var Ct=dt.sortIndex-Dt.sortIndex;return Ct!==0?Ct:dt.id-Dt.id}if(typeof performance=="object"&&typeof performance.now=="function"){var h=performance;o.unstable_now=function(){return h.now()}}else{var d=Date,g=d.now();o.unstable_now=function(){return d.now()-g}}var _=[],b=[],$=1,j=null,_e=3,et=!1,tt=!1,nt=!1,st=typeof setTimeout=="function"?setTimeout:null,rt=typeof clearTimeout=="function"?clearTimeout:null,it=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function at(dt){for(var Dt=s(b);Dt!==null;){if(Dt.callback===null)a(b);else if(Dt.startTime<=dt)a(b),Dt.sortIndex=Dt.expirationTime,e(_,Dt);else break;Dt=s(b)}}function ot(dt){if(nt=!1,at(dt),!tt)if(s(_)!==null)tt=!0,St(ut);else{var Dt=s(b);Dt!==null&&At(ot,Dt.startTime-dt)}}function ut(dt,Dt){tt=!1,nt&&(nt=!1,rt(lt),lt=-1),et=!0;var Ct=_e;try{for(at(Dt),j=s(_);j!==null&&(!(j.expirationTime>Dt)||dt&&!gt());){var xt=j.callback;if(typeof xt=="function"){j.callback=null,_e=j.priorityLevel;var Tt=xt(j.expirationTime<=Dt);Dt=o.unstable_now(),typeof Tt=="function"?j.callback=Tt:j===s(_)&&a(_),at(Dt)}else a(_);j=s(_)}if(j!==null)var kt=!0;else{var _t=s(b);_t!==null&&At(ot,_t.startTime-Dt),kt=!1}return kt}finally{j=null,_e=Ct,et=!1}}var ct=!1,ht=null,lt=-1,pt=5,ft=-1;function gt(){return!(o.unstable_now()-ftdt||125xt?(dt.sortIndex=Ct,e(b,dt),s(_)===null&&dt===s(b)&&(nt?(rt(lt),lt=-1):nt=!0,At(ot,Ct-xt))):(dt.sortIndex=Tt,e(_,dt),tt||et||(tt=!0,St(ut))),dt},o.unstable_shouldYield=gt,o.unstable_wrapCallback=function(dt){var Dt=_e;return function(){var Ct=_e;_e=Dt;try{return dt.apply(this,arguments)}finally{_e=Ct}}}})(scheduler_production_min);(function(o){o.exports=scheduler_production_min})(scheduler);/** * @license React * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var aa=react.exports,ca=scheduler.exports;function p$2(o){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+o,s=1;s"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ja=Object.prototype.hasOwnProperty,ka=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,la={},ma={};function oa(o){return ja.call(ma,o)?!0:ja.call(la,o)?!1:ka.test(o)?ma[o]=!0:(la[o]=!0,!1)}function pa(o,e,s,a){if(s!==null&&s.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return a?!1:s!==null?!s.acceptsBooleans:(o=o.toLowerCase().slice(0,5),o!=="data-"&&o!=="aria-");default:return!1}}function qa(o,e,s,a){if(e===null||typeof e>"u"||pa(o,e,s,a))return!0;if(a)return!1;if(s!==null)switch(s.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function v(o,e,s,a,c,h,d){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=a,this.attributeNamespace=c,this.mustUseProperty=s,this.propertyName=o,this.type=e,this.sanitizeURL=h,this.removeEmptyString=d}var z={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(o){z[o]=new v(o,0,!1,o,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(o){var e=o[0];z[e]=new v(e,1,!1,o[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(o){z[o]=new v(o,2,!1,o.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(o){z[o]=new v(o,2,!1,o,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(o){z[o]=new v(o,3,!1,o.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(o){z[o]=new v(o,3,!0,o,null,!1,!1)});["capture","download"].forEach(function(o){z[o]=new v(o,4,!1,o,null,!1,!1)});["cols","rows","size","span"].forEach(function(o){z[o]=new v(o,6,!1,o,null,!1,!1)});["rowSpan","start"].forEach(function(o){z[o]=new v(o,5,!1,o.toLowerCase(),null,!1,!1)});var ra=/[\-:]([a-z])/g;function sa(o){return o[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(o){var e=o.replace(ra,sa);z[e]=new v(e,1,!1,o,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(o){var e=o.replace(ra,sa);z[e]=new v(e,1,!1,o,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(o){var e=o.replace(ra,sa);z[e]=new v(e,1,!1,o,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(o){z[o]=new v(o,1,!1,o.toLowerCase(),null,!1,!1)});z.xlinkHref=new v("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(o){z[o]=new v(o,1,!1,o.toLowerCase(),null,!0,!0)});function ta(o,e,s,a){var c=z.hasOwnProperty(e)?z[e]:null;(c!==null?c.type!==0:a||!(2g||c[d]!==h[g]){var _=` `+c[d].replace(" at new "," at ");return o.displayName&&_.includes("")&&(_=_.replace("",o.displayName)),_}while(1<=d&&0<=g);break}}}finally{Na=!1,Error.prepareStackTrace=s}return(o=o?o.displayName||o.name:"")?Ma(o):""}function Pa(o){switch(o.tag){case 5:return Ma(o.type);case 16:return Ma("Lazy");case 13:return Ma("Suspense");case 19:return Ma("SuspenseList");case 0:case 2:case 15:return o=Oa(o.type,!1),o;case 11:return o=Oa(o.type.render,!1),o;case 1:return o=Oa(o.type,!0),o;default:return""}}function Qa(o){if(o==null)return null;if(typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case ya:return"Fragment";case wa:return"Portal";case Aa:return"Profiler";case za:return"StrictMode";case Ea:return"Suspense";case Fa:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case Ca:return(o.displayName||"Context")+".Consumer";case Ba:return(o._context.displayName||"Context")+".Provider";case Da:var e=o.render;return o=o.displayName,o||(o=e.displayName||e.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case Ga:return e=o.displayName||null,e!==null?e:Qa(o.type)||"Memo";case Ha:e=o._payload,o=o._init;try{return Qa(o(e))}catch{}}return null}function Ra(o){var e=o.type;switch(o.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return o=e.render,o=o.displayName||o.name||"",e.displayName||(o!==""?"ForwardRef("+o+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Qa(e);case 8:return e===za?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Sa(o){switch(typeof o){case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function Ta(o){var e=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function Ua(o){var e=Ta(o)?"checked":"value",s=Object.getOwnPropertyDescriptor(o.constructor.prototype,e),a=""+o[e];if(!o.hasOwnProperty(e)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var c=s.get,h=s.set;return Object.defineProperty(o,e,{configurable:!0,get:function(){return c.call(this)},set:function(d){a=""+d,h.call(this,d)}}),Object.defineProperty(o,e,{enumerable:s.enumerable}),{getValue:function(){return a},setValue:function(d){a=""+d},stopTracking:function(){o._valueTracker=null,delete o[e]}}}}function Va(o){o._valueTracker||(o._valueTracker=Ua(o))}function Wa(o){if(!o)return!1;var e=o._valueTracker;if(!e)return!0;var s=e.getValue(),a="";return o&&(a=Ta(o)?o.checked?"true":"false":o.value),o=a,o!==s?(e.setValue(o),!0):!1}function Xa(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}function Ya(o,e){var s=e.checked;return A({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:s!=null?s:o._wrapperState.initialChecked})}function Za(o,e){var s=e.defaultValue==null?"":e.defaultValue,a=e.checked!=null?e.checked:e.defaultChecked;s=Sa(e.value!=null?e.value:s),o._wrapperState={initialChecked:a,initialValue:s,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function ab(o,e){e=e.checked,e!=null&&ta(o,"checked",e,!1)}function bb(o,e){ab(o,e);var s=Sa(e.value),a=e.type;if(s!=null)a==="number"?(s===0&&o.value===""||o.value!=s)&&(o.value=""+s):o.value!==""+s&&(o.value=""+s);else if(a==="submit"||a==="reset"){o.removeAttribute("value");return}e.hasOwnProperty("value")?cb(o,e.type,s):e.hasOwnProperty("defaultValue")&&cb(o,e.type,Sa(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(o.defaultChecked=!!e.defaultChecked)}function db(o,e,s){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var a=e.type;if(!(a!=="submit"&&a!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+o._wrapperState.initialValue,s||e===o.value||(o.value=e),o.defaultValue=e}s=o.name,s!==""&&(o.name=""),o.defaultChecked=!!o._wrapperState.initialChecked,s!==""&&(o.name=s)}function cb(o,e,s){(e!=="number"||Xa(o.ownerDocument)!==o)&&(s==null?o.defaultValue=""+o._wrapperState.initialValue:o.defaultValue!==""+s&&(o.defaultValue=""+s))}var eb=Array.isArray;function fb(o,e,s,a){if(o=o.options,e){e={};for(var c=0;c"+e.valueOf().toString()+"",e=mb.firstChild;o.firstChild;)o.removeChild(o.firstChild);for(;e.firstChild;)o.appendChild(e.firstChild)}});function ob(o,e){if(e){var s=o.firstChild;if(s&&s===o.lastChild&&s.nodeType===3){s.nodeValue=e;return}}o.textContent=e}var pb={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},qb=["Webkit","ms","Moz","O"];Object.keys(pb).forEach(function(o){qb.forEach(function(e){e=e+o.charAt(0).toUpperCase()+o.substring(1),pb[e]=pb[o]})});function rb(o,e,s){return e==null||typeof e=="boolean"||e===""?"":s||typeof e!="number"||e===0||pb.hasOwnProperty(o)&&pb[o]?(""+e).trim():e+"px"}function sb(o,e){o=o.style;for(var s in e)if(e.hasOwnProperty(s)){var a=s.indexOf("--")===0,c=rb(s,e[s],a);s==="float"&&(s="cssFloat"),a?o.setProperty(s,c):o[s]=c}}var tb=A({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ub(o,e){if(e){if(tb[o]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(p$2(137,o));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(p$2(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(p$2(61))}if(e.style!=null&&typeof e.style!="object")throw Error(p$2(62))}}function vb(o,e){if(o.indexOf("-")===-1)return typeof e.is=="string";switch(o){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var wb=null;function xb(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var yb=null,zb=null,Ab=null;function Bb(o){if(o=Cb(o)){if(typeof yb!="function")throw Error(p$2(280));var e=o.stateNode;e&&(e=Db(e),yb(o.stateNode,o.type,e))}}function Eb(o){zb?Ab?Ab.push(o):Ab=[o]:zb=o}function Fb(){if(zb){var o=zb,e=Ab;if(Ab=zb=null,Bb(o),e)for(o=0;o>>=0,o===0?32:31-(pc(o)/qc|0)|0}var rc=64,sc=4194304;function tc(o){switch(o&-o){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return o&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return o&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return o}}function uc(o,e){var s=o.pendingLanes;if(s===0)return 0;var a=0,c=o.suspendedLanes,h=o.pingedLanes,d=s&268435455;if(d!==0){var g=d&~c;g!==0?a=tc(g):(h&=d,h!==0&&(a=tc(h)))}else d=s&~c,d!==0?a=tc(d):h!==0&&(a=tc(h));if(a===0)return 0;if(e!==0&&e!==a&&(e&c)===0&&(c=a&-a,h=e&-e,c>=h||c===16&&(h&4194240)!==0))return e;if((a&4)!==0&&(a|=s&16),e=o.entangledLanes,e!==0)for(o=o.entanglements,e&=a;0s;s++)e.push(o);return e}function Ac(o,e,s){o.pendingLanes|=e,e!==536870912&&(o.suspendedLanes=0,o.pingedLanes=0),o=o.eventTimes,e=31-oc(e),o[e]=s}function Bc(o,e){var s=o.pendingLanes&~e;o.pendingLanes=e,o.suspendedLanes=0,o.pingedLanes=0,o.expiredLanes&=e,o.mutableReadLanes&=e,o.entangledLanes&=e,e=o.entanglements;var a=o.eventTimes;for(o=o.expirationTimes;0=be),ee=String.fromCharCode(32),fe=!1;function ge(o,e){switch(o){case"keyup":return $d.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function he(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var ie$2=!1;function je(o,e){switch(o){case"compositionend":return he(e);case"keypress":return e.which!==32?null:(fe=!0,ee);case"textInput":return o=e.data,o===ee&&fe?null:o;default:return null}}function ke(o,e){if(ie$2)return o==="compositionend"||!ae&&ge(o,e)?(o=nd(),md=ld=kd=null,ie$2=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:s,offset:e-o};o=a}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Je(s)}}function Le(o,e){return o&&e?o===e?!0:o&&o.nodeType===3?!1:e&&e.nodeType===3?Le(o,e.parentNode):"contains"in o?o.contains(e):o.compareDocumentPosition?!!(o.compareDocumentPosition(e)&16):!1:!1}function Me(){for(var o=window,e=Xa();e instanceof o.HTMLIFrameElement;){try{var s=typeof e.contentWindow.location.href=="string"}catch{s=!1}if(s)o=e.contentWindow;else break;e=Xa(o.document)}return e}function Ne(o){var e=o&&o.nodeName&&o.nodeName.toLowerCase();return e&&(e==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||e==="textarea"||o.contentEditable==="true")}function Oe(o){var e=Me(),s=o.focusedElem,a=o.selectionRange;if(e!==s&&s&&s.ownerDocument&&Le(s.ownerDocument.documentElement,s)){if(a!==null&&Ne(s)){if(e=a.start,o=a.end,o===void 0&&(o=e),"selectionStart"in s)s.selectionStart=e,s.selectionEnd=Math.min(o,s.value.length);else if(o=(e=s.ownerDocument||document)&&e.defaultView||window,o.getSelection){o=o.getSelection();var c=s.textContent.length,h=Math.min(a.start,c);a=a.end===void 0?h:Math.min(a.end,c),!o.extend&&h>a&&(c=a,a=h,h=c),c=Ke(s,h);var d=Ke(s,a);c&&d&&(o.rangeCount!==1||o.anchorNode!==c.node||o.anchorOffset!==c.offset||o.focusNode!==d.node||o.focusOffset!==d.offset)&&(e=e.createRange(),e.setStart(c.node,c.offset),o.removeAllRanges(),h>a?(o.addRange(e),o.extend(d.node,d.offset)):(e.setEnd(d.node,d.offset),o.addRange(e)))}}for(e=[],o=s;o=o.parentNode;)o.nodeType===1&&e.push({element:o,left:o.scrollLeft,top:o.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;s=document.documentMode,Qe=null,Re=null,Se=null,Te=!1;function Ue(o,e,s){var a=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Te||Qe==null||Qe!==Xa(a)||(a=Qe,"selectionStart"in a&&Ne(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),Se&&Ie(Se,a)||(Se=a,a=oe(Re,"onSelect"),0Tf||(o.current=Sf[Tf],Sf[Tf]=null,Tf--)}function G(o,e){Tf++,Sf[Tf]=o.current,o.current=e}var Vf={},H=Uf(Vf),Wf=Uf(!1),Xf=Vf;function Yf(o,e){var s=o.type.contextTypes;if(!s)return Vf;var a=o.stateNode;if(a&&a.__reactInternalMemoizedUnmaskedChildContext===e)return a.__reactInternalMemoizedMaskedChildContext;var c={},h;for(h in s)c[h]=e[h];return a&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=e,o.__reactInternalMemoizedMaskedChildContext=c),c}function Zf(o){return o=o.childContextTypes,o!=null}function $f(){E(Wf),E(H)}function ag(o,e,s){if(H.current!==Vf)throw Error(p$2(168));G(H,e),G(Wf,s)}function bg(o,e,s){var a=o.stateNode;if(e=e.childContextTypes,typeof a.getChildContext!="function")return s;a=a.getChildContext();for(var c in a)if(!(c in e))throw Error(p$2(108,Ra(o)||"Unknown",c));return A({},s,a)}function cg(o){return o=(o=o.stateNode)&&o.__reactInternalMemoizedMergedChildContext||Vf,Xf=H.current,G(H,o),G(Wf,Wf.current),!0}function dg(o,e,s){var a=o.stateNode;if(!a)throw Error(p$2(169));s?(o=bg(o,e,Xf),a.__reactInternalMemoizedMergedChildContext=o,E(Wf),E(H),G(H,o)):E(Wf),G(Wf,s)}var eg=null,fg=!1,gg=!1;function hg(o){eg===null?eg=[o]:eg.push(o)}function ig(o){fg=!0,hg(o)}function jg(){if(!gg&&eg!==null){gg=!0;var o=0,e=C$1;try{var s=eg;for(C$1=1;o>=d,c-=d,rg=1<<32-oc(e)+c|s<lt?(pt=ht,ht=null):pt=ht.sibling;var ft=_e(rt,ht,at[lt],ot);if(ft===null){ht===null&&(ht=pt);break}o&&ht&&ft.alternate===null&&e(rt,ht),it=h(ft,it,lt),ct===null?ut=ft:ct.sibling=ft,ct=ft,ht=pt}if(lt===at.length)return s(rt,ht),I$1&&tg(rt,lt),ut;if(ht===null){for(;ltlt?(pt=ht,ht=null):pt=ht.sibling;var gt=_e(rt,ht,ft.value,ot);if(gt===null){ht===null&&(ht=pt);break}o&&ht&>.alternate===null&&e(rt,ht),it=h(gt,it,lt),ct===null?ut=gt:ct.sibling=gt,ct=gt,ht=pt}if(ft.done)return s(rt,ht),I$1&&tg(rt,lt),ut;if(ht===null){for(;!ft.done;lt++,ft=at.next())ft=j(rt,ft.value,ot),ft!==null&&(it=h(ft,it,lt),ct===null?ut=ft:ct.sibling=ft,ct=ft);return I$1&&tg(rt,lt),ut}for(ht=a(rt,ht);!ft.done;lt++,ft=at.next())ft=et(ht,rt,lt,ft.value,ot),ft!==null&&(o&&ft.alternate!==null&&ht.delete(ft.key===null?lt:ft.key),it=h(ft,it,lt),ct===null?ut=ft:ct.sibling=ft,ct=ft);return o&&ht.forEach(function(yt){return e(rt,yt)}),I$1&&tg(rt,lt),ut}function st(rt,it,at,ot){if(typeof at=="object"&&at!==null&&at.type===ya&&at.key===null&&(at=at.props.children),typeof at=="object"&&at!==null){switch(at.$$typeof){case va:e:{for(var ut=at.key,ct=it;ct!==null;){if(ct.key===ut){if(ut=at.type,ut===ya){if(ct.tag===7){s(rt,ct.sibling),it=c(ct,at.props.children),it.return=rt,rt=it;break e}}else if(ct.elementType===ut||typeof ut=="object"&&ut!==null&&ut.$$typeof===Ha&&uh(ut)===ct.type){s(rt,ct.sibling),it=c(ct,at.props),it.ref=sh(rt,ct,at),it.return=rt,rt=it;break e}s(rt,ct);break}else e(rt,ct);ct=ct.sibling}at.type===ya?(it=Ah(at.props.children,rt.mode,ot,at.key),it.return=rt,rt=it):(ot=yh(at.type,at.key,at.props,null,rt.mode,ot),ot.ref=sh(rt,it,at),ot.return=rt,rt=ot)}return d(rt);case wa:e:{for(ct=at.key;it!==null;){if(it.key===ct)if(it.tag===4&&it.stateNode.containerInfo===at.containerInfo&&it.stateNode.implementation===at.implementation){s(rt,it.sibling),it=c(it,at.children||[]),it.return=rt,rt=it;break e}else{s(rt,it);break}else e(rt,it);it=it.sibling}it=zh(at,rt.mode,ot),it.return=rt,rt=it}return d(rt);case Ha:return ct=at._init,st(rt,it,ct(at._payload),ot)}if(eb(at))return tt(rt,it,at,ot);if(Ka(at))return nt(rt,it,at,ot);th(rt,at)}return typeof at=="string"&&at!==""||typeof at=="number"?(at=""+at,it!==null&&it.tag===6?(s(rt,it.sibling),it=c(it,at),it.return=rt,rt=it):(s(rt,it),it=xh(at,rt.mode,ot),it.return=rt,rt=it),d(rt)):s(rt,it)}return st}var Bh=vh(!0),Ch=vh(!1),Dh={},Eh=Uf(Dh),Fh=Uf(Dh),Gh=Uf(Dh);function Hh(o){if(o===Dh)throw Error(p$2(174));return o}function Ih(o,e){switch(G(Gh,e),G(Fh,o),G(Eh,Dh),o=e.nodeType,o){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:lb(null,"");break;default:o=o===8?e.parentNode:e,e=o.namespaceURI||null,o=o.tagName,e=lb(e,o)}E(Eh),G(Eh,e)}function Jh(){E(Eh),E(Fh),E(Gh)}function Kh(o){Hh(Gh.current);var e=Hh(Eh.current),s=lb(e,o.type);e!==s&&(G(Fh,o),G(Eh,s))}function Lh(o){Fh.current===o&&(E(Eh),E(Fh))}var M=Uf(0);function Mh(o){for(var e=o;e!==null;){if(e.tag===13){var s=e.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||s.data==="$?"||s.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if((e.flags&128)!==0)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===o)break;for(;e.sibling===null;){if(e.return===null||e.return===o)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var Nh=[];function Oh(){for(var o=0;os?s:4,o(!0);var a=Qh.transition;Qh.transition={};try{o(!1),e()}finally{C$1=s,Qh.transition=a}}function Fi(){return di().memoizedState}function Gi(o,e,s){var a=lh(o);if(s={lane:a,action:s,hasEagerState:!1,eagerState:null,next:null},Hi(o))Ii(e,s);else if(s=Yg(o,e,s,a),s!==null){var c=L();mh(s,o,a,c),Ji(s,e,a)}}function ri(o,e,s){var a=lh(o),c={lane:a,action:s,hasEagerState:!1,eagerState:null,next:null};if(Hi(o))Ii(e,c);else{var h=o.alternate;if(o.lanes===0&&(h===null||h.lanes===0)&&(h=e.lastRenderedReducer,h!==null))try{var d=e.lastRenderedState,g=h(d,s);if(c.hasEagerState=!0,c.eagerState=g,He(g,d)){var _=e.interleaved;_===null?(c.next=c,Xg(e)):(c.next=_.next,_.next=c),e.interleaved=c;return}}catch{}finally{}s=Yg(o,e,c,a),s!==null&&(c=L(),mh(s,o,a,c),Ji(s,e,a))}}function Hi(o){var e=o.alternate;return o===N||e!==null&&e===N}function Ii(o,e){Th=Sh=!0;var s=o.pending;s===null?e.next=e:(e.next=s.next,s.next=e),o.pending=e}function Ji(o,e,s){if((s&4194240)!==0){var a=e.lanes;a&=o.pendingLanes,s|=a,e.lanes=s,Cc(o,s)}}var ai={readContext:Vg,useCallback:Q,useContext:Q,useEffect:Q,useImperativeHandle:Q,useInsertionEffect:Q,useLayoutEffect:Q,useMemo:Q,useReducer:Q,useRef:Q,useState:Q,useDebugValue:Q,useDeferredValue:Q,useTransition:Q,useMutableSource:Q,useSyncExternalStore:Q,useId:Q,unstable_isNewReconciler:!1},Yh={readContext:Vg,useCallback:function(o,e){return ci().memoizedState=[o,e===void 0?null:e],o},useContext:Vg,useEffect:vi,useImperativeHandle:function(o,e,s){return s=s!=null?s.concat([o]):null,ti(4194308,4,yi.bind(null,e,o),s)},useLayoutEffect:function(o,e){return ti(4194308,4,o,e)},useInsertionEffect:function(o,e){return ti(4,2,o,e)},useMemo:function(o,e){var s=ci();return e=e===void 0?null:e,o=o(),s.memoizedState=[o,e],o},useReducer:function(o,e,s){var a=ci();return e=s!==void 0?s(e):e,a.memoizedState=a.baseState=e,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:e},a.queue=o,o=o.dispatch=Gi.bind(null,N,o),[a.memoizedState,o]},useRef:function(o){var e=ci();return o={current:o},e.memoizedState=o},useState:qi,useDebugValue:Ai,useDeferredValue:function(o){return ci().memoizedState=o},useTransition:function(){var o=qi(!1),e=o[0];return o=Ei.bind(null,o[1]),ci().memoizedState=o,[e,o]},useMutableSource:function(){},useSyncExternalStore:function(o,e,s){var a=N,c=ci();if(I$1){if(s===void 0)throw Error(p$2(407));s=s()}else{if(s=e(),R===null)throw Error(p$2(349));(Rh&30)!==0||ni(a,e,s)}c.memoizedState=s;var h={value:s,getSnapshot:e};return c.queue=h,vi(ki.bind(null,a,h,o),[o]),a.flags|=2048,li(9,mi.bind(null,a,h,s,e),void 0,null),s},useId:function(){var o=ci(),e=R.identifierPrefix;if(I$1){var s=sg,a=rg;s=(a&~(1<<32-oc(a)-1)).toString(32)+s,e=":"+e+"R"+s,s=Uh++,0<\/script>",o=o.removeChild(o.firstChild)):typeof a.is=="string"?o=d.createElement(s,{is:a.is}):(o=d.createElement(s),s==="select"&&(d=o,a.multiple?d.multiple=!0:a.size&&(d.size=a.size))):o=d.createElementNS(o,s),o[Of]=e,o[Pf]=a,Aj(o,e,!1,!1),e.stateNode=o;e:{switch(d=vb(s,a),s){case"dialog":D("cancel",o),D("close",o),c=a;break;case"iframe":case"object":case"embed":D("load",o),c=a;break;case"video":case"audio":for(c=0;cHj&&(e.flags|=128,a=!0,Ej(h,!1),e.lanes=4194304)}else{if(!a)if(o=Mh(d),o!==null){if(e.flags|=128,a=!0,s=o.updateQueue,s!==null&&(e.updateQueue=s,e.flags|=4),Ej(h,!0),h.tail===null&&h.tailMode==="hidden"&&!d.alternate&&!I$1)return S(e),null}else 2*B()-h.renderingStartTime>Hj&&s!==1073741824&&(e.flags|=128,a=!0,Ej(h,!1),e.lanes=4194304);h.isBackwards?(d.sibling=e.child,e.child=d):(s=h.last,s!==null?s.sibling=d:e.child=d,h.last=d)}return h.tail!==null?(e=h.tail,h.rendering=e,h.tail=e.sibling,h.renderingStartTime=B(),e.sibling=null,s=M.current,G(M,a?s&1|2:s&1),e):(S(e),null);case 22:case 23:return Ij(),a=e.memoizedState!==null,o!==null&&o.memoizedState!==null!==a&&(e.flags|=8192),a&&(e.mode&1)!==0?(gj&1073741824)!==0&&(S(e),e.subtreeFlags&6&&(e.flags|=8192)):S(e),null;case 24:return null;case 25:return null}throw Error(p$2(156,e.tag))}function Jj(o,e){switch(wg(e),e.tag){case 1:return Zf(e.type)&&$f(),o=e.flags,o&65536?(e.flags=o&-65537|128,e):null;case 3:return Jh(),E(Wf),E(H),Oh(),o=e.flags,(o&65536)!==0&&(o&128)===0?(e.flags=o&-65537|128,e):null;case 5:return Lh(e),null;case 13:if(E(M),o=e.memoizedState,o!==null&&o.dehydrated!==null){if(e.alternate===null)throw Error(p$2(340));Ig()}return o=e.flags,o&65536?(e.flags=o&-65537|128,e):null;case 19:return E(M),null;case 4:return Jh(),null;case 10:return Rg(e.type._context),null;case 22:case 23:return Ij(),null;case 24:return null;default:return null}}var Kj=!1,U=!1,Lj=typeof WeakSet=="function"?WeakSet:Set,V=null;function Mj(o,e){var s=o.ref;if(s!==null)if(typeof s=="function")try{s(null)}catch(a){W(o,e,a)}else s.current=null}function Nj(o,e,s){try{s()}catch(a){W(o,e,a)}}var Oj=!1;function Pj(o,e){if(Cf=dd,o=Me(),Ne(o)){if("selectionStart"in o)var s={start:o.selectionStart,end:o.selectionEnd};else e:{s=(s=o.ownerDocument)&&s.defaultView||window;var a=s.getSelection&&s.getSelection();if(a&&a.rangeCount!==0){s=a.anchorNode;var c=a.anchorOffset,h=a.focusNode;a=a.focusOffset;try{s.nodeType,h.nodeType}catch{s=null;break e}var d=0,g=-1,_=-1,b=0,$=0,j=o,_e=null;t:for(;;){for(var et;j!==s||c!==0&&j.nodeType!==3||(g=d+c),j!==h||a!==0&&j.nodeType!==3||(_=d+a),j.nodeType===3&&(d+=j.nodeValue.length),(et=j.firstChild)!==null;)_e=j,j=et;for(;;){if(j===o)break t;if(_e===s&&++b===c&&(g=d),_e===h&&++$===a&&(_=d),(et=j.nextSibling)!==null)break;j=_e,_e=j.parentNode}j=et}s=g===-1||_===-1?null:{start:g,end:_}}else s=null}s=s||{start:0,end:0}}else s=null;for(Df={focusedElem:o,selectionRange:s},dd=!1,V=e;V!==null;)if(e=V,o=e.child,(e.subtreeFlags&1028)!==0&&o!==null)o.return=e,V=o;else for(;V!==null;){e=V;try{var tt=e.alternate;if((e.flags&1024)!==0)switch(e.tag){case 0:case 11:case 15:break;case 1:if(tt!==null){var nt=tt.memoizedProps,st=tt.memoizedState,rt=e.stateNode,it=rt.getSnapshotBeforeUpdate(e.elementType===e.type?nt:Lg(e.type,nt),st);rt.__reactInternalSnapshotBeforeUpdate=it}break;case 3:var at=e.stateNode.containerInfo;at.nodeType===1?at.textContent="":at.nodeType===9&&at.documentElement&&at.removeChild(at.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(p$2(163))}}catch(ot){W(e,e.return,ot)}if(o=e.sibling,o!==null){o.return=e.return,V=o;break}V=e.return}return tt=Oj,Oj=!1,tt}function Qj(o,e,s){var a=e.updateQueue;if(a=a!==null?a.lastEffect:null,a!==null){var c=a=a.next;do{if((c.tag&o)===o){var h=c.destroy;c.destroy=void 0,h!==void 0&&Nj(e,s,h)}c=c.next}while(c!==a)}}function Rj(o,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var s=e=e.next;do{if((s.tag&o)===o){var a=s.create;s.destroy=a()}s=s.next}while(s!==e)}}function Sj(o){var e=o.ref;if(e!==null){var s=o.stateNode;switch(o.tag){case 5:o=s;break;default:o=s}typeof e=="function"?e(o):e.current=o}}function Tj(o){var e=o.alternate;e!==null&&(o.alternate=null,Tj(e)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(e=o.stateNode,e!==null&&(delete e[Of],delete e[Pf],delete e[of],delete e[Qf],delete e[Rf])),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}function Uj(o){return o.tag===5||o.tag===3||o.tag===4}function Vj(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||Uj(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function Wj(o,e,s){var a=o.tag;if(a===5||a===6)o=o.stateNode,e?s.nodeType===8?s.parentNode.insertBefore(o,e):s.insertBefore(o,e):(s.nodeType===8?(e=s.parentNode,e.insertBefore(o,s)):(e=s,e.appendChild(o)),s=s._reactRootContainer,s!=null||e.onclick!==null||(e.onclick=Bf));else if(a!==4&&(o=o.child,o!==null))for(Wj(o,e,s),o=o.sibling;o!==null;)Wj(o,e,s),o=o.sibling}function Xj(o,e,s){var a=o.tag;if(a===5||a===6)o=o.stateNode,e?s.insertBefore(o,e):s.appendChild(o);else if(a!==4&&(o=o.child,o!==null))for(Xj(o,e,s),o=o.sibling;o!==null;)Xj(o,e,s),o=o.sibling}var X=null,Yj=!1;function Zj(o,e,s){for(s=s.child;s!==null;)ak(o,e,s),s=s.sibling}function ak(o,e,s){if(lc&&typeof lc.onCommitFiberUnmount=="function")try{lc.onCommitFiberUnmount(kc,s)}catch{}switch(s.tag){case 5:U||Mj(s,e);case 6:var a=X,c=Yj;X=null,Zj(o,e,s),X=a,Yj=c,X!==null&&(Yj?(o=X,s=s.stateNode,o.nodeType===8?o.parentNode.removeChild(s):o.removeChild(s)):X.removeChild(s.stateNode));break;case 18:X!==null&&(Yj?(o=X,s=s.stateNode,o.nodeType===8?Kf(o.parentNode,s):o.nodeType===1&&Kf(o,s),bd(o)):Kf(X,s.stateNode));break;case 4:a=X,c=Yj,X=s.stateNode.containerInfo,Yj=!0,Zj(o,e,s),X=a,Yj=c;break;case 0:case 11:case 14:case 15:if(!U&&(a=s.updateQueue,a!==null&&(a=a.lastEffect,a!==null))){c=a=a.next;do{var h=c,d=h.destroy;h=h.tag,d!==void 0&&((h&2)!==0||(h&4)!==0)&&Nj(s,e,d),c=c.next}while(c!==a)}Zj(o,e,s);break;case 1:if(!U&&(Mj(s,e),a=s.stateNode,typeof a.componentWillUnmount=="function"))try{a.props=s.memoizedProps,a.state=s.memoizedState,a.componentWillUnmount()}catch(g){W(s,e,g)}Zj(o,e,s);break;case 21:Zj(o,e,s);break;case 22:s.mode&1?(U=(a=U)||s.memoizedState!==null,Zj(o,e,s),U=a):Zj(o,e,s);break;default:Zj(o,e,s)}}function bk(o){var e=o.updateQueue;if(e!==null){o.updateQueue=null;var s=o.stateNode;s===null&&(s=o.stateNode=new Lj),e.forEach(function(a){var c=ck.bind(null,o,a);s.has(a)||(s.add(a),a.then(c,c))})}}function dk(o,e){var s=e.deletions;if(s!==null)for(var a=0;ac&&(c=d),a&=~h}if(a=c,a=B()-a,a=(120>a?120:480>a?480:1080>a?1080:1920>a?1920:3e3>a?3e3:4320>a?4320:1960*mk(a/1960))-a,10o?16:o,xk===null)var a=!1;else{if(o=xk,xk=null,yk=0,(K&6)!==0)throw Error(p$2(331));var c=K;for(K|=4,V=o.current;V!==null;){var h=V,d=h.child;if((V.flags&16)!==0){var g=h.deletions;if(g!==null){for(var _=0;_B()-gk?Lk(o,0):sk|=s),Ek(o,e)}function Zk(o,e){e===0&&((o.mode&1)===0?e=1:(e=sc,sc<<=1,(sc&130023424)===0&&(sc=4194304)));var s=L();o=Zg(o,e),o!==null&&(Ac(o,e,s),Ek(o,s))}function vj(o){var e=o.memoizedState,s=0;e!==null&&(s=e.retryLane),Zk(o,s)}function ck(o,e){var s=0;switch(o.tag){case 13:var a=o.stateNode,c=o.memoizedState;c!==null&&(s=c.retryLane);break;case 19:a=o.stateNode;break;default:throw Error(p$2(314))}a!==null&&a.delete(e),Zk(o,s)}var Wk;Wk=function(o,e,s){if(o!==null)if(o.memoizedProps!==e.pendingProps||Wf.current)Ug=!0;else{if((o.lanes&s)===0&&(e.flags&128)===0)return Ug=!1,zj(o,e,s);Ug=(o.flags&131072)!==0}else Ug=!1,I$1&&(e.flags&1048576)!==0&&ug(e,ng,e.index);switch(e.lanes=0,e.tag){case 2:var a=e.type;jj(o,e),o=e.pendingProps;var c=Yf(e,H.current);Tg(e,s),c=Xh(null,e,a,o,c,s);var h=bi();return e.flags|=1,typeof c=="object"&&c!==null&&typeof c.render=="function"&&c.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Zf(a)?(h=!0,cg(e)):h=!1,e.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,ah(e),c.updater=nh,e.stateNode=c,c._reactInternals=e,rh(e,a,o,s),e=kj(null,e,a,!0,h,s)):(e.tag=0,I$1&&h&&vg(e),Yi(null,e,c,s),e=e.child),e;case 16:a=e.elementType;e:{switch(jj(o,e),o=e.pendingProps,c=a._init,a=c(a._payload),e.type=a,c=e.tag=$k(a),o=Lg(a,o),c){case 0:e=dj(null,e,a,o,s);break e;case 1:e=ij(null,e,a,o,s);break e;case 11:e=Zi(null,e,a,o,s);break e;case 14:e=aj(null,e,a,Lg(a.type,o),s);break e}throw Error(p$2(306,a,""))}return e;case 0:return a=e.type,c=e.pendingProps,c=e.elementType===a?c:Lg(a,c),dj(o,e,a,c,s);case 1:return a=e.type,c=e.pendingProps,c=e.elementType===a?c:Lg(a,c),ij(o,e,a,c,s);case 3:e:{if(lj(e),o===null)throw Error(p$2(387));a=e.pendingProps,h=e.memoizedState,c=h.element,bh(o,e),gh(e,a,null,s);var d=e.memoizedState;if(a=d.element,h.isDehydrated)if(h={element:a,isDehydrated:!1,cache:d.cache,pendingSuspenseBoundaries:d.pendingSuspenseBoundaries,transitions:d.transitions},e.updateQueue.baseState=h,e.memoizedState=h,e.flags&256){c=Ki(Error(p$2(423)),e),e=mj(o,e,a,s,c);break e}else if(a!==c){c=Ki(Error(p$2(424)),e),e=mj(o,e,a,s,c);break e}else for(yg=Lf(e.stateNode.containerInfo.firstChild),xg=e,I$1=!0,zg=null,s=Ch(e,null,a,s),e.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(Ig(),a===c){e=$i(o,e,s);break e}Yi(o,e,a,s)}e=e.child}return e;case 5:return Kh(e),o===null&&Eg(e),a=e.type,c=e.pendingProps,h=o!==null?o.memoizedProps:null,d=c.children,Ef(a,c)?d=null:h!==null&&Ef(a,h)&&(e.flags|=32),hj(o,e),Yi(o,e,d,s),e.child;case 6:return o===null&&Eg(e),null;case 13:return pj(o,e,s);case 4:return Ih(e,e.stateNode.containerInfo),a=e.pendingProps,o===null?e.child=Bh(e,null,a,s):Yi(o,e,a,s),e.child;case 11:return a=e.type,c=e.pendingProps,c=e.elementType===a?c:Lg(a,c),Zi(o,e,a,c,s);case 7:return Yi(o,e,e.pendingProps,s),e.child;case 8:return Yi(o,e,e.pendingProps.children,s),e.child;case 12:return Yi(o,e,e.pendingProps.children,s),e.child;case 10:e:{if(a=e.type._context,c=e.pendingProps,h=e.memoizedProps,d=c.value,G(Mg,a._currentValue),a._currentValue=d,h!==null)if(He(h.value,d)){if(h.children===c.children&&!Wf.current){e=$i(o,e,s);break e}}else for(h=e.child,h!==null&&(h.return=e);h!==null;){var g=h.dependencies;if(g!==null){d=h.child;for(var _=g.firstContext;_!==null;){if(_.context===a){if(h.tag===1){_=ch(-1,s&-s),_.tag=2;var b=h.updateQueue;if(b!==null){b=b.shared;var $=b.pending;$===null?_.next=_:(_.next=$.next,$.next=_),b.pending=_}}h.lanes|=s,_=h.alternate,_!==null&&(_.lanes|=s),Sg(h.return,s,e),g.lanes|=s;break}_=_.next}}else if(h.tag===10)d=h.type===e.type?null:h.child;else if(h.tag===18){if(d=h.return,d===null)throw Error(p$2(341));d.lanes|=s,g=d.alternate,g!==null&&(g.lanes|=s),Sg(d,s,e),d=h.sibling}else d=h.child;if(d!==null)d.return=h;else for(d=h;d!==null;){if(d===e){d=null;break}if(h=d.sibling,h!==null){h.return=d.return,d=h;break}d=d.return}h=d}Yi(o,e,c.children,s),e=e.child}return e;case 9:return c=e.type,a=e.pendingProps.children,Tg(e,s),c=Vg(c),a=a(c),e.flags|=1,Yi(o,e,a,s),e.child;case 14:return a=e.type,c=Lg(a,e.pendingProps),c=Lg(a.type,c),aj(o,e,a,c,s);case 15:return cj(o,e,e.type,e.pendingProps,s);case 17:return a=e.type,c=e.pendingProps,c=e.elementType===a?c:Lg(a,c),jj(o,e),e.tag=1,Zf(a)?(o=!0,cg(e)):o=!1,Tg(e,s),ph(e,a,c),rh(e,a,c,s),kj(null,e,a,!0,o,s);case 19:return yj(o,e,s);case 22:return ej(o,e,s)}throw Error(p$2(156,e.tag))};function Gk(o,e){return ac(o,e)}function al(o,e,s,a){this.tag=o,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Bg(o,e,s,a){return new al(o,e,s,a)}function bj(o){return o=o.prototype,!(!o||!o.isReactComponent)}function $k(o){if(typeof o=="function")return bj(o)?1:0;if(o!=null){if(o=o.$$typeof,o===Da)return 11;if(o===Ga)return 14}return 2}function wh(o,e){var s=o.alternate;return s===null?(s=Bg(o.tag,e,o.key,o.mode),s.elementType=o.elementType,s.type=o.type,s.stateNode=o.stateNode,s.alternate=o,o.alternate=s):(s.pendingProps=e,s.type=o.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=o.flags&14680064,s.childLanes=o.childLanes,s.lanes=o.lanes,s.child=o.child,s.memoizedProps=o.memoizedProps,s.memoizedState=o.memoizedState,s.updateQueue=o.updateQueue,e=o.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},s.sibling=o.sibling,s.index=o.index,s.ref=o.ref,s}function yh(o,e,s,a,c,h){var d=2;if(a=o,typeof o=="function")bj(o)&&(d=1);else if(typeof o=="string")d=5;else e:switch(o){case ya:return Ah(s.children,c,h,e);case za:d=8,c|=8;break;case Aa:return o=Bg(12,s,e,c|2),o.elementType=Aa,o.lanes=h,o;case Ea:return o=Bg(13,s,e,c),o.elementType=Ea,o.lanes=h,o;case Fa:return o=Bg(19,s,e,c),o.elementType=Fa,o.lanes=h,o;case Ia:return qj(s,c,h,e);default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case Ba:d=10;break e;case Ca:d=9;break e;case Da:d=11;break e;case Ga:d=14;break e;case Ha:d=16,a=null;break e}throw Error(p$2(130,o==null?o:typeof o,""))}return e=Bg(d,s,e,c),e.elementType=o,e.type=a,e.lanes=h,e}function Ah(o,e,s,a){return o=Bg(7,o,a,e),o.lanes=s,o}function qj(o,e,s,a){return o=Bg(22,o,a,e),o.elementType=Ia,o.lanes=s,o.stateNode={isHidden:!1},o}function xh(o,e,s){return o=Bg(6,o,null,e),o.lanes=s,o}function zh(o,e,s){return e=Bg(4,o.children!==null?o.children:[],o.key,e),e.lanes=s,e.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},e}function bl(o,e,s,a,c){this.tag=e,this.containerInfo=o,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=zc(0),this.expirationTimes=zc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=zc(0),this.identifierPrefix=a,this.onRecoverableError=c,this.mutableSourceEagerHydrationData=null}function cl(o,e,s,a,c,h,d,g,_){return o=new bl(o,e,s,g,_),e===1?(e=1,h===!0&&(e|=8)):e=0,h=Bg(3,null,null,e),o.current=h,h.stateNode=o,h.memoizedState={element:a,isDehydrated:s,cache:null,transitions:null,pendingSuspenseBoundaries:null},ah(h),o}function dl(o,e,s){var a=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(s){console.error(s)}}e(),o.exports=reactDom_production_min})(reactDom);var m$1=reactDom.exports;client.createRoot=m$1.createRoot,client.hydrateRoot=m$1.hydrateRoot;const scriptRel="modulepreload",assetsURL=function(o){return"/"+o},seen={},__vitePreload=function(e,s,a){return!s||s.length===0?e():Promise.all(s.map(c=>{if(c=assetsURL(c),c in seen)return;seen[c]=!0;const h=c.endsWith(".css"),d=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const g=document.createElement("link");if(g.rel=h?"stylesheet":scriptRel,h||(g.as="script",g.crossOrigin=""),g.href=c,document.head.appendChild(g),h)return new Promise((_,b)=>{g.addEventListener("load",_),g.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${c}`)))})})).then(()=>e())};var fraction$1={exports:{}};/** * @license Fraction.js v4.2.0 05/03/2022 * https://www.xarg.org/2014/03/rational-numbers-in-javascript/ * * Copyright (c) 2021, Robert Eisele (robert@xarg.org) * Dual licensed under the MIT or GPL Version 2 licenses. **/(function(o,e){(function(s){var a=2e3,c={s:1,n:0,d:1};function h(tt,nt){if(isNaN(tt=parseInt(tt,10)))throw et.InvalidParameter;return tt*nt}function d(tt,nt){if(nt===0)throw et.DivisionByZero;var st=Object.create(et.prototype);st.s=tt<0?-1:1,tt=tt<0?-tt:tt;var rt=_e(tt,nt);return st.n=tt/rt,st.d=nt/rt,st}function g(tt){for(var nt={},st=tt,rt=2,it=4;it<=st;){for(;st%rt===0;)st/=rt,nt[rt]=(nt[rt]||0)+1;it+=1+2*rt++}return st!==tt?st>1&&(nt[st]=(nt[st]||0)+1):nt[tt]=(nt[tt]||0)+1,nt}var _=function(tt,nt){var st=0,rt=1,it=1,at=0,ot=0,ut=0,ct=1,ht=1,lt=0,pt=1,ft=1,gt=1,yt=1e7,mt;if(tt!=null)if(nt!==void 0){if(st=tt,rt=nt,it=st*rt,st%1!==0||rt%1!==0)throw et.NonIntegerParameter}else switch(typeof tt){case"object":{if("d"in tt&&"n"in tt)st=tt.n,rt=tt.d,"s"in tt&&(st*=tt.s);else if(0 in tt)st=tt[0],1 in tt&&(rt=tt[1]);else throw et.InvalidParameter;it=st*rt;break}case"number":{if(tt<0&&(it=tt,tt=-tt),tt%1===0)st=tt;else if(tt>0){for(tt>=1&&(ht=Math.pow(10,Math.floor(1+Math.log(tt)/Math.LN10)),tt/=ht);pt<=yt&><=yt;)if(mt=(lt+ft)/(pt+gt),tt===mt){pt+gt<=yt?(st=lt+ft,rt=pt+gt):gt>pt?(st=ft,rt=gt):(st=lt,rt=pt);break}else tt>mt?(lt+=ft,pt+=gt):(ft+=lt,gt+=pt),pt>yt?(st=ft,rt=gt):(st=lt,rt=pt);st*=ht}else(isNaN(tt)||isNaN(nt))&&(rt=st=NaN);break}case"string":{if(pt=tt.match(/\d+|./g),pt===null)throw et.InvalidParameter;if(pt[lt]==="-"?(it=-1,lt++):pt[lt]==="+"&<++,pt.length===lt+1?ot=h(pt[lt++],it):pt[lt+1]==="."||pt[lt]==="."?(pt[lt]!=="."&&(at=h(pt[lt++],it)),lt++,(lt+1===pt.length||pt[lt+1]==="("&&pt[lt+3]===")"||pt[lt+1]==="'"&&pt[lt+3]==="'")&&(ot=h(pt[lt],it),ct=Math.pow(10,pt[lt].length),lt++),(pt[lt]==="("&&pt[lt+2]===")"||pt[lt]==="'"&&pt[lt+2]==="'")&&(ut=h(pt[lt+1],it),ht=Math.pow(10,pt[lt+1].length)-1,lt+=3)):pt[lt+1]==="/"||pt[lt+1]===":"?(ot=h(pt[lt],it),ct=h(pt[lt+2],1),lt+=3):pt[lt+3]==="/"&&pt[lt+1]===" "&&(at=h(pt[lt],it),ot=h(pt[lt+2],it),ct=h(pt[lt+4],1),lt+=5),pt.length<=lt){rt=ct*ht,it=st=ut+rt*at+ht*ot;break}}default:throw et.InvalidParameter}if(rt===0)throw et.DivisionByZero;c.s=it<0?-1:1,c.n=Math.abs(st),c.d=Math.abs(rt)};function b(tt,nt,st){for(var rt=1;nt>0;tt=tt*tt%st,nt>>=1)nt&1&&(rt=rt*tt%st);return rt}function $(tt,nt){for(;nt%2===0;nt/=2);for(;nt%5===0;nt/=5);if(nt===1)return 0;for(var st=10%nt,rt=1;st!==1;rt++)if(st=st*10%nt,rt>a)return 0;return rt}function j(tt,nt,st){for(var rt=1,it=b(10,st,nt),at=0;at<300;at++){if(rt===it)return at;rt=rt*10%nt,it=it*10%nt}return 0}function _e(tt,nt){if(!tt)return nt;if(!nt)return tt;for(;;){if(tt%=nt,!tt)return nt;if(nt%=tt,!nt)return tt}}function et(tt,nt){if(_(tt,nt),this instanceof et)tt=_e(c.d,c.n),this.s=c.s,this.n=c.n/tt,this.d=c.d/tt;else return d(c.s*c.n,c.d)}et.DivisionByZero=new Error("Division by Zero"),et.InvalidParameter=new Error("Invalid argument"),et.NonIntegerParameter=new Error("Parameters must be integer"),et.prototype={s:1,n:0,d:1,abs:function(){return d(this.n,this.d)},neg:function(){return d(-this.s*this.n,this.d)},add:function(tt,nt){return _(tt,nt),d(this.s*this.n*c.d+c.s*this.d*c.n,this.d*c.d)},sub:function(tt,nt){return _(tt,nt),d(this.s*this.n*c.d-c.s*this.d*c.n,this.d*c.d)},mul:function(tt,nt){return _(tt,nt),d(this.s*c.s*this.n*c.n,this.d*c.d)},div:function(tt,nt){return _(tt,nt),d(this.s*c.s*this.n*c.d,this.d*c.n)},clone:function(){return d(this.s*this.n,this.d)},mod:function(tt,nt){if(isNaN(this.n)||isNaN(this.d))return new et(NaN);if(tt===void 0)return d(this.s*this.n%this.d,1);if(_(tt,nt),c.n===0&&this.d===0)throw et.DivisionByZero;return d(this.s*(c.d*this.n)%(c.n*this.d),c.d*this.d)},gcd:function(tt,nt){return _(tt,nt),d(_e(c.n,this.n)*_e(c.d,this.d),c.d*this.d)},lcm:function(tt,nt){return _(tt,nt),c.n===0&&this.n===0?d(0,1):d(c.n*this.n,_e(c.n,this.n)*_e(c.d,this.d))},ceil:function(tt){return tt=Math.pow(10,tt||0),isNaN(this.n)||isNaN(this.d)?new et(NaN):d(Math.ceil(tt*this.s*this.n/this.d),tt)},floor:function(tt){return tt=Math.pow(10,tt||0),isNaN(this.n)||isNaN(this.d)?new et(NaN):d(Math.floor(tt*this.s*this.n/this.d),tt)},round:function(tt){return tt=Math.pow(10,tt||0),isNaN(this.n)||isNaN(this.d)?new et(NaN):d(Math.round(tt*this.s*this.n/this.d),tt)},inverse:function(){return d(this.s*this.d,this.n)},pow:function(tt,nt){if(_(tt,nt),c.d===1)return c.s<0?d(Math.pow(this.s*this.d,c.n),Math.pow(this.n,c.n)):d(Math.pow(this.s*this.n,c.n),Math.pow(this.d,c.n));if(this.s<0)return null;var st=g(this.n),rt=g(this.d),it=1,at=1;for(var ot in st)if(ot!=="1"){if(ot==="0"){it=0;break}if(st[ot]*=c.n,st[ot]%c.d===0)st[ot]/=c.d;else return null;it*=Math.pow(ot,st[ot])}for(var ot in rt)if(ot!=="1"){if(rt[ot]*=c.n,rt[ot]%c.d===0)rt[ot]/=c.d;else return null;at*=Math.pow(ot,rt[ot])}return c.s<0?d(at,it):d(it,at)},equals:function(tt,nt){return _(tt,nt),this.s*this.n*c.d===c.s*c.n*this.d},compare:function(tt,nt){_(tt,nt);var st=this.s*this.n*c.d-c.s*c.n*this.d;return(0=0;at--)it=it.inverse().add(st[at]);if(it.sub(nt).abs().valueOf()0&&(st+=nt,st+=" ",rt%=it),st+=rt,st+="/",st+=it),st},toLatex:function(tt){var nt,st="",rt=this.n,it=this.d;return this.s<0&&(st+="-"),it===1?st+=rt:(tt&&(nt=Math.floor(rt/it))>0&&(st+=nt,rt%=it),st+="\\frac{",st+=rt,st+="}{",st+=it,st+="}"),st},toContinued:function(){var tt,nt=this.n,st=this.d,rt=[];if(isNaN(nt)||isNaN(st))return rt;do rt.push(Math.floor(nt/st)),tt=nt%st,nt=st,st=tt;while(nt!==1);return rt},toString:function(tt){var nt=this.n,st=this.d;if(isNaN(nt)||isNaN(st))return"NaN";tt=tt||15;var rt=$(nt,st),it=j(nt,st,rt),at=this.s<0?"-":"";if(at+=nt/st|0,nt%=st,nt*=10,nt&&(at+="."),rt){for(var ot=it;ot--;)at+=nt/st|0,nt%=st,nt*=10;at+="(";for(var ot=rt;ot--;)at+=nt/st|0,nt%=st,nt*=10;at+=")"}else for(var ot=tt;nt&&ot--;)at+=nt/st|0,nt%=st,nt*=10;return at}},Object.defineProperty(et,"__esModule",{value:!0}),et.default=et,et.Fraction=et,o.exports=et})()})(fraction$1);const Fraction=getDefaultExportFromCjs(fraction$1.exports);Fraction.prototype.sam=function(){return this.floor()};Fraction.prototype.nextSam=function(){return this.sam().add(1)};Fraction.prototype.wholeCycle=function(){return new TimeSpan(this.sam(),this.nextSam())};Fraction.prototype.cyclePos=function(){return this.sub(this.sam())};Fraction.prototype.lt=function(o){return this.compare(o)<0};Fraction.prototype.gt=function(o){return this.compare(o)>0};Fraction.prototype.lte=function(o){return this.compare(o)<=0};Fraction.prototype.gte=function(o){return this.compare(o)>=0};Fraction.prototype.eq=function(o){return this.compare(o)==0};Fraction.prototype.max=function(o){return this.gt(o)?this:o};Fraction.prototype.min=function(o){return this.lt(o)?this:o};Fraction.prototype.show=function(){return this.s*this.n+"/"+this.d};Fraction.prototype.or=function(o){return this.eq(0)?o:this};const fraction=o=>(typeof o=="number"&&(o=String(o)),Fraction(o)),gcd=(...o)=>o.reduce((e,s)=>e.gcd(s),fraction(1));fraction._original=Fraction;class TimeSpan{constructor(e,s){this.begin=fraction(e),this.end=fraction(s)}get spanCycles(){const e=[];var s=this.begin;const a=this.end,c=a.sam();for(;a.gt(s);){if(s.sam().equals(c)){e.push(new TimeSpan(s,this.end));break}const h=s.nextSam();e.push(new TimeSpan(s,h)),s=h}return e}get duration(){return this.end.sub(this.begin)}cycleArc(){const e=this.begin.cyclePos(),s=e.add(this.duration);return new TimeSpan(e,s)}withTime(e){return new TimeSpan(e(this.begin),e(this.end))}withEnd(e){return new TimeSpan(this.begin,e(this.end))}withCycle(e){const s=this.begin.sam(),a=s.add(e(this.begin.sub(s))),c=s.add(e(this.end.sub(s)));return new TimeSpan(a,c)}intersection(e){const s=this.begin.max(e.begin),a=this.end.min(e.end);if(!s.gt(a)&&!(s.equals(a)&&(s.equals(this.end)&&this.begin.lt(this.end)||s.equals(e.end)&&e.begin.lt(e.end))))return new TimeSpan(s,a)}intersection_e(e){const s=this.intersection(e);if(s==null)throw"TimeSpans do not intersect";return s}midpoint(){return this.begin.add(this.duration.div(fraction(2)))}equals(e){return this.begin.equals(e.begin)&&this.end.equals(e.end)}show(){return this.begin.show()+" -> "+this.end.show()}}class Hap{constructor(e,s,a,c={},h=!1){this.whole=e,this.part=s,this.value=a,this.context=c,this.stateful=h,h&&console.assert(typeof this.value=="function","Stateful values must be functions")}get duration(){return this.whole.end.sub(this.whole.begin)}wholeOrPart(){return this.whole?this.whole:this.part}withSpan(e){const s=this.whole?e(this.whole):void 0;return new Hap(s,e(this.part),this.value,this.context)}withValue(e){return new Hap(this.whole,this.part,e(this.value),this.context)}hasOnset(){return this.whole!=null&&this.whole.begin.equals(this.part.begin)}resolveState(e){if(this.stateful&&this.hasOnset()){console.log("stateful");const s=this.value,[a,c]=s(e);return[a,new Hap(this.whole,this.part,c,this.context,!1)]}return[e,this]}spanEquals(e){return this.whole==null&&e.whole==null||this.whole.equals(e.whole)}equals(e){return this.spanEquals(e)&&this.part.equals(e.part)&&this.value===e.value}show(){return"("+(this.whole==null?"~":this.whole.show())+", "+this.part.show()+", "+this.value+")"}showWhole(){return`${this.whole==null?"~":this.whole.show()}: ${typeof this.value=="object"?JSON.stringify(this.value):this.value}`}combineContext(e){const s=this;return{...s.context,...e.context,locations:(s.context.locations||[]).concat(e.context.locations||[])}}setContext(e){return new Hap(this.whole,this.part,this.value,e)}}class State{constructor(e,s={}){this.span=e,this.controls=s}setSpan(e){return new State(e,this.controls)}withSpan(e){return this.setSpan(e(this.span))}setControls(e){return new State(this.span,e)}}const isNote$1=o=>/^[a-gA-G][#b]*[0-9]$/.test(o),tokenizeNote=o=>{var c;if(typeof o!="string")return[];const[e,s="",a]=((c=o.match(/^([a-gA-G])([#bs]*)([0-9])?$/))==null?void 0:c.slice(1))||[];return e?[e,s,a?Number(a):void 0]:[]},toMidi=o=>{const[e,s,a]=tokenizeNote(o);if(!e)throw new Error('not a note: "'+o+'"');const c={c:0,d:2,e:4,f:5,g:7,a:9,b:11}[e.toLowerCase()],h=(s==null?void 0:s.split("").reduce((d,g)=>d+{"#":1,b:-1,s:1}[g],0))||0;return(Number(a)+1)*12+c+h},fromMidi=o=>Math.pow(2,(o-69)/12)*440,getFreq=o=>fromMidi(typeof o=="number"?o:toMidi(o)),midi2note=o=>{const e=Math.floor(o/12)-1;return["C","Db","D","Eb","E","F","Gb","G","Ab","A","Bb","B"][o%12]+e},mod=(o,e)=>(o%e+e)%e,getPlayableNoteValue=o=>{let{value:e,context:s}=o;if(typeof e=="object"&&!Array.isArray(e)&&(e=e.note||e.n||e.value),typeof e=="number"&&s.type!=="frequency")e=fromMidi(o.value);else if(typeof e=="number"&&s.type==="frequency")e=o.value;else if(typeof e!="string"||!isNote$1(e))throw new Error("not a note: "+JSON.stringify(e));return e},getFrequency=o=>{let{value:e,context:s}=o;if(typeof e=="object")return e.freq?e.freq:getFreq(e.note||e.n||e.value);if(typeof e=="number"&&s.type!=="frequency")e=fromMidi(o.value);else if(typeof e=="string"&&isNote$1(e))e=fromMidi(toMidi(o.value));else if(typeof e!="number")throw new Error("not a note or frequency:"+e);return e},rotate=(o,e)=>o.slice(e).concat(o.slice(0,e)),pipe=(...o)=>o.reduce((e,s)=>(...a)=>e(s(...a)),e=>e),compose=(...o)=>pipe(...o.reverse()),removeUndefineds=o=>o.filter(e=>e!=null),flatten$1=o=>[].concat(...o),id$1=o=>o,constant=(o,e)=>o,listRange=(o,e)=>Array.from({length:e-o+1},(s,a)=>a+o);function curry(o,e){const s=function a(...c){if(c.length>=o.length)return o.apply(this,c);{const h=function(...d){return a.apply(this,c.concat(d))};return e&&e(h,c),h}};return e&&e(s,[]),s}function unionWithObj(o,e,s){const a=Object.keys(o).filter(c=>Object.keys(e).includes(c));return Object.assign({},o,e,Object.fromEntries(a.map(c=>[c,s(o[c],e[c])])))}curry((o,e)=>o*e);curry((o,e)=>e.map(o));function drawLine(o,e=60){let s=0,a=fraction(0),c=[""],h="";for(;c[0].length$.hasOnset()).map($=>$.duration),_=gcd(...g),b=_.inverse();c=c.map($=>$+"|"),h+="|";for(let $=0;$nt.whole.begin.lte(j)&&nt.whole.end.gte(_e)),tt=et.length-c.length;tt>0&&(c=c.concat(Array(tt).fill(h))),c=c.map((nt,st)=>{const rt=et[st];if(rt){const at=rt.whole.begin.eq(j)?""+rt.value:"-";return nt+at}return nt+"."}),h+=".",a=a.add(_)}s++}return c.join(` `)}class Pattern$3{constructor(e){Rt(this,"_Pattern",!0);this.query=e}queryArc(e,s){return this.query(new State(new TimeSpan(e,s)))}_splitQueries(){const e=this,s=a=>flatten$1(a.span.spanCycles.map(c=>e.query(a.setSpan(c))));return new Pattern$3(s)}withQuerySpan(e){return new Pattern$3(s=>this.query(s.withSpan(e)))}withQueryTime(e){return new Pattern$3(s=>this.query(s.withSpan(a=>a.withTime(e))))}withHapSpan(e){return new Pattern$3(s=>this.query(s).map(a=>a.withSpan(e)))}withHapTime(e){return this.withHapSpan(s=>s.withTime(e))}_withHaps(e){return new Pattern$3(s=>e(this.query(s)))}_withHap(e){return this._withHaps(s=>s.map(e))}_setContext(e){return this._withHap(s=>s.setContext(e))}_withContext(e){return this._withHap(s=>s.setContext(e(s.context)))}_stripContext(){return this._withHap(e=>e.setContext({}))}withLocation(e,s){const a={start:{line:e[0],column:e[1],offset:e[2]},end:{line:s[0],column:s[1],offset:s[2]}};return this._withContext(c=>{const h=(c.locations||[]).concat([a]);return{...c,locations:h}})}withMiniLocation(e,s){const a={start:{line:e[0],column:e[1],offset:e[2]},end:{line:s[0],column:s[1],offset:s[2]}};return this._withContext(c=>{let h=c.locations||[];return h=h.map(({start:d,end:g})=>{const _=d.line===1?a.start.column:0;return{start:{...d,line:d.line-1+(a.start.line-1)+1,column:d.column-1+_},end:{...g,line:g.line-1+(a.start.line-1)+1,column:g.column-1+_}}}),{...c,locations:h}})}withValue(e){return new Pattern$3(s=>this.query(s).map(a=>a.withValue(e)))}fmap(e){return this.withValue(e)}_filterHaps(e){return new Pattern$3(s=>this.query(s).filter(e))}_filterValues(e){return new Pattern$3(s=>this.query(s).filter(a=>e(a.value)))}_removeUndefineds(){return this._filterValues(e=>e!=null)}onsetsOnly(){return this._filterHaps(e=>e.hasOnset())}discreteOnly(){return this._filterHaps(e=>e.whole)}_appWhole(e,s){const a=this,c=function(h){const d=a.query(h),g=s.query(h),_=function(b,$){const j=b.part.intersection($.part);if(j!=null)return new Hap(e(b.whole,$.whole),j,b.value($.value),$.combineContext(b))};return flatten$1(d.map(b=>removeUndefineds(g.map($=>_(b,$)))))};return new Pattern$3(c)}appBoth(e){const s=function(a,c){if(!(a==null||c==null))return a.intersection_e(c)};return this._appWhole(s,e)}appLeft(e){const s=this,a=function(c){const h=[];for(const d of s.query(c)){const g=e.query(c.setSpan(d.wholeOrPart()));for(const _ of g){const b=d.whole,$=d.part.intersection(_.part);if($){const j=d.value(_.value),_e=_.combineContext(d),et=new Hap(b,$,j,_e);h.push(et)}}}return h};return new Pattern$3(a)}appRight(e){const s=this,a=function(c){const h=[];for(const d of e.query(c)){const g=s.query(c.setSpan(d.wholeOrPart()));for(const _ of g){const b=d.whole,$=_.part.intersection(d.part);if($){const j=_.value(d.value),_e=d.combineContext(_),et=new Hap(b,$,j,_e);h.push(et)}}}return h};return new Pattern$3(a)}firstCycle(e=!1){var s=this;return e||(s=s._stripContext()),s.query(new State(new TimeSpan(fraction(0),fraction(1))))}get _firstCycleValues(){return this.firstCycle().map(e=>e.value)}get _showFirstCycle(){return this.firstCycle().map(e=>`${e.value}: ${e.whole.begin.toFraction()} - ${e.whole.end.toFraction()}`)}_sortHapsByPart(){return this._withHaps(e=>e.sort((s,a)=>s.part.begin.sub(a.part.begin).or(s.part.end.sub(a.part.end)).or(s.whole.begin.sub(a.whole.begin).or(s.whole.end.sub(a.whole.end)))))}_opIn(e,s){return this.fmap(s).appLeft(reify$1(e))}_opOut(e,s){return this.fmap(s).appRight(reify$1(e))}_opMix(e,s){return this.fmap(s).appBoth(reify$1(e))}_opSqueeze(e,s){const a=reify$1(e);return this.fmap(c=>a.fmap(h=>s(c)(h)))._squeezeJoin()}_opSqueezeOut(e,s){const a=this;return reify$1(e).fmap(h=>a.fmap(d=>s(d)(h)))._squeezeJoin()}_opTrig(e,s){return reify$1(e).fmap(c=>this.fmap(h=>s(h)(c)))._trigJoin()}_opTrigzero(e,s){return reify$1(e).fmap(c=>this.fmap(h=>s(h)(c)))._TrigzeroJoin()}_asNumber(e=!1,s=!1){return this._withHap(a=>{const c=Number(a.value);if(!isNaN(c))return a.withValue(()=>c);const h={e:Math.E,pi:Math.PI}[a.value];if(typeof h<"u")return a.withValue(()=>h);if(isNote$1(a.value))return new Hap(a.whole,a.part,toMidi(a.value),{...a.context,type:"midi"});if(!e){if(s)return a;throw new Error('cannot parse as number: "'+a.value+'"')}})}round(){return this._asNumber().fmap(e=>Math.round(e))}floor(){return this._asNumber().fmap(e=>Math.floor(e))}ceil(){return this._asNumber().fmap(e=>Math.ceil(e))}_toBipolar(){return this.fmap(e=>e*2-1)}_fromBipolar(){return this.fmap(e=>(e+1)/2)}range(e,s){return this.mul(s-e).add(e)}rangex(e,s){return this.range(Math.log(e),Math.log(s)).fmap(Math.exp)}range2(e,s){return this._fromBipolar().range(e,s)}_bindWhole(e,s){const a=this,c=function(h){const d=function(_,b){return new Hap(e(_.whole,b.whole),b.part,b.value,Object.assign({},_.context,b.context,{locations:(_.context.locations||[]).concat(b.context.locations||[])}))},g=function(_){return s(_.value).query(h.setSpan(_.part)).map(b=>d(_,b))};return flatten$1(a.query(h).map(_=>g(_)))};return new Pattern$3(c)}bind(e){const s=function(a,c){if(!(a==null||c==null))return a.intersection_e(c)};return this._bindWhole(s,e)}join(){return this.bind(id$1)}outerBind(e){return this._bindWhole((s,a)=>s,e)}outerJoin(){return this.outerBind(id$1)}innerBind(e){return this._bindWhole((s,a)=>a,e)}innerJoin(){return this.innerBind(id$1)}_trigJoin(e=!1){const s=this;return new Pattern$3(a=>s.discreteOnly().query(a).map(c=>c.value.late(e?c.whole.begin:c.whole.begin.cyclePos()).query(a).map(h=>new Hap(h.whole?h.whole.intersection(c.whole):void 0,h.part.intersection(c.part),h.value).setContext(c.combineContext(h))).filter(h=>h.part)).flat())}_TrigzeroJoin(){return this._trigJoin(!0)}_squeezeJoin(){const e=this;function s(a){const c=e.discreteOnly().query(a);function h(g){const b=g.value._compressSpan(g.wholeOrPart().cycleArc()).query(a.setSpan(g.part));function $(j,_e){let et;if(_e.whole&&j.whole&&(et=_e.whole.intersection(j.whole),!et))return;const tt=_e.part.intersection(j.part);if(!tt)return;const nt=_e.combineContext(j);return new Hap(et,tt,_e.value,nt)}return b.map(j=>$(g,j))}return flatten$1(c.map(h)).filter(g=>g)}return new Pattern$3(s)}_squeezeBind(e){return this.fmap(e)._squeezeJoin()}_apply(e){return e(this)}layer(...e){return stack(...e.map(s=>s(this)))}_patternify(e){const s=this;return function(...c){return c=c.map(d=>isPattern$1(d)?d.fmap(g=>g.value||g):d),sequence(...c).fmap(d=>e.call(s,d)).innerJoin()}}_fastGap(e){const s=function(c){const h=c.begin.sam(),d=h.add(c.begin.sub(h).mul(e).min(1)),g=h.add(c.end.sub(h).mul(e).min(1));return new TimeSpan(d,g)},a=function(c){const h=c.begin.sam(),d=h.add(c.begin.sub(h).div(e).min(1)),g=h.add(c.end.sub(h).div(e).min(1));return new TimeSpan(d,g)};return this.withQuerySpan(s).withHapSpan(a)._splitQueries()}_compress(e,s){return e.gt(s)||e.gt(1)||s.gt(1)||e.lt(0)||s.lt(0)?silence:this._fastGap(fraction(1).div(s.sub(e)))._late(e)}_compressSpan(e){return this._compress(e.begin,e.end)}_fast(e){return this.withQueryTime(a=>a.mul(e)).withHapTime(a=>a.div(e))}_slow(e){return this._fast(fraction(1).div(e))}_inside(e,s){return s(this._slow(e))._fast(e)}_outside(e,s){return s(this._fast(e))._slow(e)}_ply(e){return this.fmap(s=>pure(s)._fast(e))._squeezeJoin()}_chop(e){const a=Array.from({length:e},(h,d)=>d).map(h=>({begin:h/e,end:(h+1)/e})),c=function(h){return sequence(a.map(d=>Object.assign({},h,d)))};return this._squeezeBind(c)}_striate(e){const a=Array.from({length:e},(h,d)=>d).map(h=>({begin:h/e,end:(h+1)/e})),c=slowcat(...a);return this.set(c)._fast(e)}_cpm(e){return this._fast(e/60)}_early(e){return e=fraction(e),this.withQueryTime(s=>s.add(e)).withHapTime(s=>s.sub(e))}_late(e){return e=fraction(e),this._early(fraction(0).sub(e))}_zoom(e,s){s=fraction(s),e=fraction(e);const a=s.sub(e);return this.withQuerySpan(c=>c.withCycle(h=>h.mul(a).add(e))).withHapSpan(c=>c.withCycle(h=>h.sub(e).div(a)))._splitQueries()}_zoomArc(e){return this.zoom(e.begin,e.end)}_linger(e){return e==0?silence:e<0?this._zoom(e.add(1),1)._slow(e):this._zoom(0,e)._slow(e)}_color(e){return this._withContext(s=>({...s,color:e}))}log(){return this._withHap(e=>{var s;return e.setContext({...e.context,logs:(((s=e.context)==null?void 0:s.logs)||[]).concat([e.show()])})})}drawLine(){return console.log(drawLine(this)),this}_segment(e){return this.struct(pure(!0)._fast(e))}invert(){return this.fmap(e=>!e)}inv(){return this.invert()}when(e,s){const a=e._filterValues(id$1),c=e._filterValues(g=>!g),h=a.fmap(g=>_=>_).appRight(s(this)),d=c.fmap(g=>_=>_).appRight(this);return stack(h,d)}off(e,s){return stack(this,s(this.late(e)))}every(e,s){const a=this,c=Array(e-1).fill(a);return c.unshift(s(a)),slowcatPrime(...c)}brak(){return this.when(slowcat(!1,!0),e=>fastcat(e,silence)._late(.25))}rev(){const e=this,s=function(a){const c=a.span,h=c.begin.sam(),d=c.begin.nextSam(),g=function(b){const $=b.withTime(_e=>h.add(d.sub(_e))),j=$.begin;return $.begin=$.end,$.end=j,$};return e.query(a.setSpan(g(c))).map(b=>b.withSpan(g))};return new Pattern$3(s)._splitQueries()}palindrome(){return this.every(2,rev)}juxBy(e,s){e/=2;const a=function(d,g,_){return g in d?d[g]:_},c=this.withValue(d=>Object.assign({},d,{pan:a(d,"pan",.5)-e})),h=this.withValue(d=>Object.assign({},d,{pan:a(d,"pan",.5)+e}));return stack(c,s(h))}_jux(e){return this.juxBy(1,e)}stack(...e){return stack(this,...e)}sequence(...e){return sequence(this,...e)}seq(...e){return sequence(this,...e)}cat(...e){return cat(this,...e)}fastcat(...e){return fastcat(this,...e)}slowcat(...e){return slowcat(this,...e)}superimpose(...e){return this.stack(...e.map(s=>s(this)))}stutWith(e,s,a){return stack(...listRange(0,e-1).map(c=>a(this.late(fraction(s).mul(c)),c)))}stut(e,s,a){return this.stutWith(e,a,(c,h)=>c.velocity(Math.pow(s,h)))}_echoWith(e,s,a){return stack(...listRange(0,e-1).map(c=>a(this.late(fraction(s).mul(c)),c)))}_echo(e,s,a){return this._echoWith(e,s,(c,h)=>c.velocity(Math.pow(a,h)))}iter(e,s=!1){return slowcat(...listRange(0,e-1).map(a=>s?this.late(a/e):this.early(a/e)))}iterBack(e){return this.iter(e,!0)}_chunk(e,s,a=!1){const c=Array(e-1).fill(!1);c.unshift(!0);const h=sequence(...c).iter(e,a);return this.when(h,s)}_chunkBack(e,s){return this._chunk(e,s,!0)}_bypass(e){return e=Boolean(parseInt(e)),e?silence:this}hush(){return silence}_duration(e){return this.withHapSpan(s=>new TimeSpan(s.begin,s.begin.add(e)))}_legato(e){return this.withHapSpan(s=>new TimeSpan(s.begin,s.begin.add(s.end.sub(s.begin).mul(e))))}_velocity(e){return this._withContext(s=>({...s,velocity:(s.velocity||1)*e}))}_loopAt(e,s=1){return this.speed(1/e*s).unit("c").slow(e)}onTrigger(e){return this._withHap(s=>s.setContext({...s.context,onTrigger:e}))}log(e=id$1){return this._withHap(s=>s.setContext({...s.context,onTrigger:(...a)=>{s.context.onTrigger&&s.context.onTrigger(...a),console.log(e(...a))}}))}logValues(e=id$1){return this.log((s,a)=>e(a.value))}}function _composeOp(o,e,s){function a(c){return c instanceof Object&&!(c instanceof Function)}return a(o)||a(e)?(a(o)||(o={value:o}),a(e)||(e={value:e}),unionWithObj(o,e,s)):s(o,e)}(function(){const o=a=>a._asNumber(),s={set:[(a,c)=>c],keep:[(a,c)=>a],keepif:[(a,c)=>c?a:void 0],add:[(a,c)=>a+c,a=>a._asNumber(!1,!0)],sub:[(a,c)=>a-c,o],mul:[(a,c)=>a*c,o],div:[(a,c)=>a/c,o],mod:[mod,o],pow:[Math.pow,o],_and:[(a,c)=>a&c,o],_or:[(a,c)=>a|c,o],_xor:[(a,c)=>a^c,o],_lshift:[(a,c)=>a<a>>c,o],lt:[(a,c)=>aa>c],lte:[(a,c)=>a<=c],gte:[(a,c)=>a>=c],eq:[(a,c)=>a==c],eqt:[(a,c)=>a===c],ne:[(a,c)=>a!=c],net:[(a,c)=>a!==c],and:[(a,c)=>a&&c],or:[(a,c)=>a||c],func:[(a,c)=>c(a)]};for(const[a,[c,h]]of Object.entries(s))for(const d of["In","Out","Mix","Squeeze","SqueezeOut","Trig","Trigzero"])Pattern$3.prototype[a+d]=function(...g){var _=this;g=sequence(g),h&&(_=h(_),g=h(g));var b=_["_op"+d](g,$=>j=>_composeOp($,j,c));return a==="keepif"&&(b=b._removeUndefineds()),b},d==="Squeeze"&&(Pattern$3.prototype[a+"SqueezeIn"]=Pattern$3.prototype[a+d]),d==="In"?Pattern$3.prototype[a]=Pattern$3.prototype[a+d]:a==="set"&&(Pattern$3.prototype[d.toLowerCase()]=Pattern$3.prototype[a+d]);Pattern$3.prototype.struct=Pattern$3.prototype.keepifOut,Pattern$3.prototype.structAll=Pattern$3.prototype.keepOut,Pattern$3.prototype.mask=Pattern$3.prototype.keepifIn,Pattern$3.prototype.maskAll=Pattern$3.prototype.keepIn,Pattern$3.prototype.reset=Pattern$3.prototype.keepifTrig,Pattern$3.prototype.resetAll=Pattern$3.prototype.keepTrig,Pattern$3.prototype.restart=Pattern$3.prototype.keepifTrigzero,Pattern$3.prototype.restartAll=Pattern$3.prototype.keepTrigzero})();Pattern$3.prototype.patternified=["apply","chop","color","cpm","duration","early","fast","jux","late","legato","linger","ply","segment","striate","slow","velocity"];Pattern$3.prototype.factories={pure,stack,slowcat,fastcat,cat,timeCat,sequence,seq:seq$2,polymeter,pm,polyrhythm,pr};const silence=new Pattern$3(o=>[]);function pure(o){function e(s){return s.span.spanCycles.map(a=>new Hap(fraction(a.begin).wholeCycle(),a,o))}return new Pattern$3(e)}function isPattern$1(o){const e=o instanceof Pattern$3||(o==null?void 0:o._Pattern);return!o instanceof Pattern$3&&console.warn(`Found Pattern that fails "instanceof Pattern" check. This may happen if you are using multiple versions of @strudel.cycles/core. Please check by running "npm ls @strudel.cycles/core".`),e}function reify$1(o){return isPattern$1(o)?o:pure(o)}function stack(...o){o=o.map(s=>Array.isArray(s)?sequence(...s):reify$1(s));const e=s=>flatten$1(o.map(a=>a.query(s)));return new Pattern$3(e)}function slowcat(...o){o=o.map(s=>Array.isArray(s)?sequence(...s):reify$1(s));const e=function(s){const a=s.span,c=mod(a.begin.sam(),o.length),h=o[c];if(!h)return[];const d=a.begin.floor().sub(a.begin.div(o.length).floor());return h.withHapTime(g=>g.add(d)).query(s.setSpan(a.withTime(g=>g.sub(d))))};return new Pattern$3(e)._splitQueries()}function slowcatPrime(...o){o=o.map(reify$1);const e=function(s){const a=Math.floor(s.span.begin)%o.length,c=o[a];return(c==null?void 0:c.query(s))||[]};return new Pattern$3(e)._splitQueries()}function fastcat(...o){return slowcat(...o)._fast(o.length)}function cat(...o){return slowcat(...o)}function timeCat(...o){const e=o.map(c=>c[0]).reduce((c,h)=>c.add(h),fraction(0));let s=fraction(0);const a=[];for(const[c,h]of o){const d=s.add(c);a.push(reify$1(h)._compress(s.div(e),d.div(e))),s=d}return stack(...a)}function sequence(...o){return fastcat(...o)}function seq$2(...o){return fastcat(...o)}function _sequenceCount(o){return Array.isArray(o)?o.length==0?[silence,0]:o.length==1?_sequenceCount(o[0]):[fastcat(...o.map(e=>_sequenceCount(e)[0])),o.length]:[reify$1(o),1]}function polymeterSteps(o,...e){const s=e.map(c=>_sequenceCount(c));if(s.length==0)return silence;o==0&&(o=s[0][1]);const a=[];for(const c of s)c[1]==0&&next,o==c[1]?a.push(c[0]):a.push(c[0]._fast(fraction(o).div(fraction(c[1]))));return stack(...a)}function polymeter(...o){return polymeterSteps(0,...o)}function pm(...o){polymeter(...o)}function polyrhythm(...o){const e=o.map(s=>sequence(s));return e.length==0?silence:stack(...e)}function pr(o){polyrhythm(o)}const add$1=curry((o,e)=>e.add(o)),chop=curry((o,e)=>e.chop(o)),chunk=curry((o,e)=>e.chunk(o)),chunkBack=curry((o,e)=>e.chunkBack(o)),div=curry((o,e)=>e.div(o)),early=curry((o,e)=>e.early(o)),echo=curry((o,e,s,a)=>a.echo(o,e,s)),every=curry((o,e,s)=>s.every(o,e)),fast=curry((o,e)=>e.fast(o)),inv=o=>o.inv(),invert=o=>o.invert(),iter=curry((o,e)=>e.iter(o)),iterBack=curry((o,e)=>e.iter(o)),jux=curry((o,e)=>e.jux(o)),juxBy=curry((o,e,s)=>s.juxBy(o,e)),late=curry((o,e)=>e.late(o)),linger=curry((o,e)=>e.linger(o)),mask=curry((o,e)=>e.mask(o)),mul=curry((o,e)=>e.mul(o)),off=curry((o,e,s)=>s.off(o,e)),ply=curry((o,e)=>e.ply(o)),range=curry((o,e,s)=>s.range(o,e)),range2=curry((o,e,s)=>s.range2(o,e)),rev=o=>o.rev(),slow=curry((o,e)=>e.slow(o)),struct=curry((o,e)=>e.struct(o)),sub=curry((o,e)=>e.sub(o)),superimpose=curry((o,e)=>e.superimpose(...o)),set=curry((o,e)=>e.set(o)),when=curry((o,e,s)=>s.when(o,e));Pattern$3.prototype.composable={fast,slow,early,late,superimpose};function makeComposable(o){return Object.entries(Pattern$3.prototype.composable).forEach(([e,s])=>{o[e]=(...a)=>{const c=compose(o,s(...a));return makeComposable(c)}}),o}const patternify2=o=>(e,s,a)=>e.fmap(c=>h=>o.call(a,c,h)).appLeft(s).innerJoin(),patternify3=o=>(e,s,a,c)=>e.fmap(h=>d=>g=>o.call(c,h,d,g)).appLeft(s).appLeft(a).innerJoin(),patternify4=o=>(e,s,a,c,h)=>e.fmap(d=>g=>_=>b=>o.call(h,d,g,_,b)).appLeft(s).appLeft(a).appLeft(c).innerJoin();Pattern$3.prototype.echo=function(...o){return o=o.map(reify$1),patternify3(Pattern$3.prototype._echo)(...o,this)};Pattern$3.prototype.echoWith=function(...o){return o=o.map(reify$1),patternify3(Pattern$3.prototype._echoWith)(...o,this)};Pattern$3.prototype.chunk=function(...o){return o=o.map(reify$1),patternify2(Pattern$3.prototype._chunk)(...o,this)};Pattern$3.prototype.chunkBack=function(...o){return o=o.map(reify$1),patternify2(Pattern$3.prototype._chunkBack)(...o,this)};Pattern$3.prototype.loopAt=function(...o){return o=o.map(reify$1),patternify2(Pattern$3.prototype._loopAt)(...o,this)};Pattern$3.prototype.zoom=function(...o){return o=o.map(reify$1),patternify2(Pattern$3.prototype._zoom)(...o,this)};Pattern$3.prototype.compress=function(...o){return o=o.map(reify$1),patternify2(Pattern$3.prototype._compress)(...o,this)};Pattern$3.prototype.outside=function(...o){return o=o.map(reify$1),patternify2(Pattern$3.prototype._outside)(...o,this)};Pattern$3.prototype.inside=function(...o){return o=o.map(reify$1),patternify2(Pattern$3.prototype._inside)(...o,this)};Pattern$3.prototype.bootstrap=function(){const o=Object.fromEntries(Object.entries(Pattern$3.prototype.composable).map(([e,s])=>(Pattern$3.prototype[e]&&(Pattern$3.prototype[e]=makeComposable(Pattern$3.prototype[e])),[e,curry(s,makeComposable)])));return this.patternified.forEach(e=>{Pattern$3.prototype[e]=function(...s){return this._patternify(Pattern$3.prototype["_"+e])(...s)}}),o};Pattern$3.prototype.define=(o,e,s={})=>{s.composable&&(Pattern$3.prototype.composable[o]=e),s.patternified&&(Pattern$3.prototype.patternified=Pattern$3.prototype.patternified.concat([o])),Pattern$3.prototype.bootstrap()};Pattern$3.prototype.define("hush",o=>o.hush(),{patternified:!1,composable:!0});Pattern$3.prototype.define("bypass",o=>o.bypass(on),{patternified:!0,composable:!0});const controls={},generic_params=[["s","s","sound"],["f","n","The note or sample number to choose for a synth or sampleset"],["f","note","The note or pitch to play a sound or synth with"],["f","accelerate","a pattern of numbers that speed up (or slow down) samples while they play."],["f","gain","a pattern of numbers that specify volume. Values less than 1 make the sound quieter. Values greater than 1 make the sound louder. For the linear equivalent, see @amp@."],["f","amp","like @gain@, but linear."],["f","attack","a pattern of numbers to specify the attack time (in seconds) of an envelope applied to each sample."],["f","decay",""],["f","sustain",""],["f","release","a pattern of numbers to specify the release time (in seconds) of an envelope applied to each sample."],["f","hold","a pattern of numbers to specify the hold time (in seconds) of an envelope applied to each sample. Only takes effect if `attack` and `release` are also specified."],["f","bandf","A pattern of numbers from 0 to 1. Sets the center frequency of the band-pass filter."],["f","bandq","a pattern of anumbers from 0 to 1. Sets the q-factor of the band-pass filter."],["f","begin","a pattern of numbers from 0 to 1. Skips the beginning of each sample, e.g. `0.25` to cut off the first quarter from each sample."],["f","end","the same as `begin`, but cuts the end off samples, shortening them; e.g. `0.75` to cut off the last quarter of each sample."],["f","loop","loops the sample (from `begin` to `end`) the specified number of times."],["f","legato","controls the amount of overlap between two adjacent sounds"],["f","crush","bit crushing, a pattern of numbers from 1 (for drastic reduction in bit-depth) to 16 (for barely no reduction)."],["f","coarse","fake-resampling, a pattern of numbers for lowering the sample rate, i.e. 1 for original 2 for half, 3 for a third and so on."],["i","channel","choose the channel the pattern is sent to in superdirt"],["i","cut","In the style of classic drum-machines, `cut` will stop a playing sample as soon as another samples with in same cutgroup is to be played. An example would be an open hi-hat followed by a closed one, essentially muting the open."],["f","cutoff","a pattern of numbers from 0 to 1. Applies the cutoff frequency of the low-pass filter."],["f","hcutoff","a pattern of numbers from 0 to 1. Applies the cutoff frequency of the high-pass filter. Also has alias @hpf@"],["f","hresonance","a pattern of numbers from 0 to 1. Applies the resonance of the high-pass filter. Has alias @hpq@"],["f","resonance","a pattern of numbers from 0 to 1. Specifies the resonance of the low-pass filter."],["f","djf","DJ filter, below 0.5 is low pass filter, above is high pass filter."],["f","delay","a pattern of numbers from 0 to 1. Sets the level of the delay signal."],["f","delayfeedback","a pattern of numbers from 0 to 1. Sets the amount of delay feedback."],["f","delaytime","a pattern of numbers from 0 to 1. Sets the length of the delay."],["f","lock","A pattern of numbers. Specifies whether delaytime is calculated relative to cps. When set to 1, delaytime is a direct multiple of a cycle."],["f","detune",""],["f","dry","when set to `1` will disable all reverb for this pattern. See `room` and `size` for more information about reverb."],["f","fadeTime","Used when using begin/end or chop/striate and friends, to change the fade out time of the 'grain' envelope."],["f","fadeInTime","As with fadeTime, but controls the fade in time of the grain envelope. Not used if the grain begins at position 0 in the sample."],["f","freq",""],["f","gate",""],["f","leslie",""],["f","lrate",""],["f","lsize",""],["f","degree",""],["f","mtranspose",""],["f","ctranspose",""],["f","harmonic",""],["f","stepsPerOctave",""],["f","octaveR",""],["f","nudge","Nudges events into the future by the specified number of seconds. Negative numbers work up to a point as well (due to internal latency)"],["i","octave",""],["f","offset",""],["i","orbit","a pattern of numbers. An `orbit` is a global parameter context for patterns. Patterns with the same orbit will share hardware output bus offset and global effects, e.g. reverb and delay. The maximum number of orbits is specified in the superdirt startup, numbers higher than maximum will wrap around."],["f","overgain",""],["f","overshape",""],["f","pan","a pattern of numbers between 0 and 1, from left to right (assuming stereo), once round a circle (assuming multichannel)"],["f","panspan","a pattern of numbers between -inf and inf, which controls how much multichannel output is fanned out (negative is backwards ordering)"],["f","pansplay","a pattern of numbers between 0.0 and 1.0, which controls the multichannel spread range (multichannel only)"],["f","panwidth","a pattern of numbers between 0.0 and inf, which controls how much each channel is distributed over neighbours (multichannel only)"],["f","panorient","a pattern of numbers between -1.0 and 1.0, which controls the relative position of the centre pan in a pair of adjacent speakers (multichannel only)"],["f","rate","used in SuperDirt softsynths as a control rate or 'speed'"],["f","slide",""],["f","semitone",""],["f","velocity",""],["f","voice",""],["f","room","a pattern of numbers from 0 to 1. Sets the level of reverb."],["f","size","a pattern of numbers from 0 to 1. Sets the perceptual size (reverb time) of the `room` to be used in reverb."],["f","shape","wave shaping distortion, a pattern of numbers from 0 for no distortion up to 1 for loads of distortion."],["f","speed","a pattern of numbers which changes the speed of sample playback, i.e. a cheap way of changing pitch. Negative values will play the sample backwards!"],["s","unit",'used in conjunction with `speed`, accepts values of "r" (rate, default behavior), "c" (cycles), or "s" (seconds). Using `unit "c"` means `speed` will be interpreted in units of cycles, e.g. `speed "1"` means samples will be stretched to fill a cycle. Using `unit "s"` means the playback speed will be adjusted so that the duration is the number of seconds specified by `speed`.'],["f","squiz",""],["f","stutterdepth",""],["f","stuttertime",""],["f","timescale",""],["f","timescalewin",""],["s","vowel","formant filter to make things sound like vowels, a pattern of either `a`, `e`, `i`, `o` or `u`. Use a rest (`~`) for no effect."],["f","waveloss",""],["f","dur",""],["f","expression",""],["f","sustainpedal",""],["f","tremolodepth","Tremolo Audio DSP effect | params are 'tremolorate' and 'tremolodepth'"],["f","tremolorate","Tremolo Audio DSP effect | params are 'tremolorate' and 'tremolodepth'"],["f","phaserdepth","Phaser Audio DSP effect | params are 'phaserrate' and 'phaserdepth'"],["f","phaserrate","Phaser Audio DSP effect | params are 'phaserrate' and 'phaserdepth'"],["f","fshift","frequency shifter"],["f","fshiftnote","frequency shifter"],["f","fshiftphase","frequency shifter"],["f","triode","tube distortion"],["f","krush","shape/bass enhancer"],["f","kcutoff",""],["f","octer","octaver effect"],["f","octersub","octaver effect"],["f","octersubsub","octaver effect"],["f","ring","ring modulation"],["f","ringf","ring modulation"],["f","ringdf","ring modulation"],["f","distort","noisy fuzzy distortion"],["f","freeze","Spectral freeze"],["f","xsdelay",""],["f","tsdelay",""],["f","real","Spectral conform"],["f","imag",""],["f","enhance","Spectral enhance"],["f","partials",""],["f","comb","Spectral comb"],["f","smear","Spectral smear"],["f","scram","Spectral scramble"],["f","binshift","Spectral binshift"],["f","hbrick","High pass sort of spectral filter"],["f","lbrick","Low pass sort of spectral filter"],["f","midichan",""],["f","control",""],["f","ccn",""],["f","ccv",""],["f","polyTouch",""],["f","midibend",""],["f","miditouch",""],["f","ctlNum",""],["f","frameRate",""],["f","frames",""],["f","hours",""],["s","midicmd",""],["f","minutes",""],["f","progNum",""],["f","seconds",""],["f","songPtr",""],["f","uid",""],["f","val",""],["f","cps",""],["f","clip",""]],_name=(o,...e)=>sequence(...e).withValue(s=>({[o]:s})),_setter=(o,e)=>function(...s){return s.length?this.set(o(...s)):this.fmap(a=>({[e]:a}))};generic_params.forEach(([o,e,s])=>{controls[e]=(...a)=>_name(e,...a),Pattern$3.prototype[e]=_setter(controls[e],e)});controls.createParam=o=>{const e=(...s)=>_name(o,...s);return Pattern$3.prototype[o]=_setter(e,o),(...s)=>_name(o,...s)};controls.createParams=(...o)=>o.reduce((e,s)=>Object.assign(e,{[s]:createParam(s)}),{});var dist$7={},tokenizer={},utils$1={},unicode$2={};Object.defineProperty(unicode$2,"__esModule",{value:!0});unicode$2.whitespaceArray=[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];unicode$2.whitespaceBool=[!1,!1,!1,!1,!1,!1,!1,!1,!1,!0,!1,!0,!0,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!0,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1];unicode$2.idStartLargeRegex=/^[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]$/;unicode$2.idStartBool=[!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!0,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!1,!1,!1,!1,!0,!1,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!1,!1,!1,!1,!1];unicode$2.idContinueLargeRegex=/^[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09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10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F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A0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]$/;unicode$2.idContinueBool=[!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!0,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!1,!1,!1,!1,!1,!1,!1,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!1,!1,!1,!1,!0,!1,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!1,!1,!1,!1,!1];Object.defineProperty(utils$1,"__esModule",{value:!0});utils$1.isStrictModeReservedWord=isStrictModeReservedWord;utils$1.isWhiteSpace=isWhiteSpace;utils$1.isLineTerminator=isLineTerminator;utils$1.isIdentifierStart=isIdentifierStart$1;utils$1.isIdentifierPart=isIdentifierPart$1;utils$1.isDecimalDigit=isDecimalDigit;utils$1.getHexValue=getHexValue;var _unicode$2=unicode$2,strictReservedWords=["null","true","false","implements","interface","package","private","protected","public","static","let","if","in","do","var","for","new","try","this","else","case","void","with","enum","while","break","catch","throw","const","yield","class","super","return","typeof","delete","switch","export","import","default","finally","extends","function","continue","debugger","instanceof"];function isStrictModeReservedWord(o){return strictReservedWords.indexOf(o)!==-1}function isWhiteSpace(o){return o<128?_unicode$2.whitespaceBool[o]:o===160||o>5759&&_unicode$2.whitespaceArray.indexOf(o)!==-1}function isLineTerminator(o){return o===10||o===13||o===8232||o===8233}function isIdentifierStart$1(o){return o<128?_unicode$2.idStartBool[o]:_unicode$2.idStartLargeRegex.test(String.fromCodePoint(o))}function isIdentifierPart$1(o){return o<128?_unicode$2.idContinueBool[o]:_unicode$2.idContinueLargeRegex.test(String.fromCodePoint(o))}function isDecimalDigit(o){return o>=48&&o<=57}function getHexValue(o){return o>="0"&&o<="9"?o.charCodeAt(0)-48:o>="a"&&o<="f"?o.charCodeAt(0)-87:o>="A"&&o<="F"?o.charCodeAt(0)-55:-1}var errors={};Object.defineProperty(errors,"__esModule",{value:!0});errors.ErrorMessages={UNEXPECTED_TOKEN:function(e){return"Unexpected token "+JSON.stringify(e)},UNEXPECTED_ILLEGAL_TOKEN:function(e){return"Unexpected "+JSON.stringify(e)},UNEXPECTED_ESCAPED_KEYWORD:"Unexpected escaped keyword",UNEXPECTED_NUMBER:"Unexpected number",UNEXPECTED_STRING:"Unexpected string",UNEXPECTED_IDENTIFIER:"Unexpected identifier",UNEXPECTED_RESERVED_WORD:"Unexpected reserved word",UNEXPECTED_TEMPLATE:"Unexpected template",UNEXPECTED_EOS:"Unexpected end of input",UNEXPECTED_LINE_TERMINATOR:"Unexpected line terminator",UNEXPECTED_COMMA_AFTER_REST:"Unexpected comma after rest",UNEXPECTED_REST_PARAMETERS_INITIALIZATION:"Rest parameter may not have a default initializer",NEWLINE_AFTER_THROW:"Illegal newline after throw",UNTERMINATED_REGEXP:"Invalid regular expression: missing /",INVALID_LAST_REST_PARAMETER:"Rest parameter must be last formal parameter",INVALID_REST_PARAMETERS_INITIALIZATION:"Rest parameter may not have a default initializer",INVALID_REGEXP_FLAGS:"Invalid regular expression flags",INVALID_REGEX:"Invalid regular expression",INVALID_LHS_IN_ASSIGNMENT:"Invalid left-hand side in assignment",INVALID_LHS_IN_BINDING:"Invalid left-hand side in binding",INVALID_LHS_IN_FOR_IN:"Invalid left-hand side in for-in",INVALID_LHS_IN_FOR_OF:"Invalid left-hand side in for-of",INVALID_LHS_IN_FOR_AWAIT:"Invalid left-hand side in for-await",INVALID_UPDATE_OPERAND:"Increment/decrement target must be an identifier or member expression",INVALID_EXPONENTIATION_LHS:"Unary expressions as the left operand of an exponentation expression must be disambiguated with parentheses",MULTIPLE_DEFAULTS_IN_SWITCH:"More than one default clause in switch statement",NO_CATCH_OR_FINALLY:"Missing catch or finally after try",ILLEGAL_RETURN:"Illegal return statement",ILLEGAL_ARROW_FUNCTION_PARAMS:"Illegal arrow function parameter list",INVALID_ASYNC_PARAMS:"Async function parameters must not contain await expressions",INVALID_VAR_INIT_FOR_IN:"Invalid variable declaration in for-in statement",INVALID_VAR_INIT_FOR_OF:"Invalid variable declaration in for-of statement",INVALID_VAR_INIT_FOR_AWAIT:"Invalid variable declaration in for-await statement",UNINITIALIZED_BINDINGPATTERN_IN_FOR_INIT:"Binding pattern appears without initializer in for statement init",ILLEGAL_PROPERTY:"Illegal property initializer",INVALID_ID_BINDING_STRICT_MODE:function(e){return"The identifier "+JSON.stringify(e)+" must not be in binding position in strict mode"},INVALID_ID_IN_LABEL_STRICT_MODE:function(e){return"The identifier "+JSON.stringify(e)+" must not be in label position in strict mode"},INVALID_ID_IN_EXPRESSION_STRICT_MODE:function(e){return"The identifier "+JSON.stringify(e)+" must not be in expression position in strict mode"},INVALID_CALL_TO_SUPER:'Calls to super must be in the "constructor" method of a class expression or class declaration that has a superclass',INVALID_DELETE_STRICT_MODE:"Identifier expressions must not be deleted in strict mode",DUPLICATE_BINDING:function(e){return"Duplicate binding "+JSON.stringify(e)},ILLEGAL_ID_IN_LEXICAL_DECLARATION:function(e){return"Lexical declarations must not have a binding named "+JSON.stringify(e)},UNITIALIZED_CONST:"Constant lexical declarations must have an initialiser",ILLEGAL_LABEL_IN_BODY:function(e){return"The body of a "+e+" statement must not be a labeled function declaration"},ILLEGEAL_LABEL_IN_IF:"The consequent of an if statement must not be a labeled function declaration",ILLEGAL_LABEL_IN_ELSE:"The alternate of an if statement must not be a labeled function declaration",ILLEGAL_CONTINUE_WITHOUT_ITERATION_WITH_ID:function(e){return"Continue statement must be nested within an iteration statement with label "+JSON.stringify(e)},ILLEGAL_CONTINUE_WITHOUT_ITERATION:"Continue statement must be nested within an iteration statement",ILLEGAL_BREAK_WITHOUT_ITERATION_OR_SWITCH:"Break statement must be nested within an iteration statement or a switch statement",ILLEGAL_WITH_STRICT_MODE:"Strict mode code must not include a with statement",ILLEGAL_ACCESS_SUPER_MEMBER:"Member access on super must be in a method",ILLEGAL_SUPER_CALL:'Calls to super must be in the "constructor" method of a class expression or class declaration that has a superclass',DUPLICATE_LABEL_DECLARATION:function(e){return"Label "+JSON.stringify(e)+" has already been declared"},ILLEGAL_BREAK_WITHIN_LABEL:function(e){return"Break statement must be nested within a statement with label "+JSON.stringify(e)},ILLEGAL_YIELD_EXPRESSIONS:function(e){return e+" parameters must not contain yield expressions"},ILLEGAL_YIELD_IDENTIFIER:'"yield" may not be used as an identifier in this context',ILLEGAL_AWAIT_IDENTIFIER:'"await" may not be used as an identifier in this context',DUPLICATE_CONSTRUCTOR:"Duplicate constructor method in class",ILLEGAL_CONSTRUCTORS:"Constructors cannot be async, generators, getters or setters",ILLEGAL_STATIC_CLASS_NAME:'Static class methods cannot be named "prototype"',NEW_TARGET_ERROR:"new.target must be within function (but not arrow expression) code",DUPLICATE_EXPORT:function(e){return"Duplicate export "+JSON.stringify(e)},UNDECLARED_BINDING:function(e){return"Exported binding "+JSON.stringify(e)+" is not declared"},DUPLICATE_PROPTO_PROP:"Duplicate __proto__ property in object literal not allowed",ILLEGAL_LABEL_FUNC_DECLARATION:"Labeled FunctionDeclarations are disallowed in strict mode",ILLEGAL_FUNC_DECL_IF:"FunctionDeclarations in IfStatements are disallowed in strict mode",ILLEGAL_USE_STRICT:'Functions with non-simple parameter lists may not contain a "use strict" directive',ILLEGAL_EXPORTED_NAME:"Names of variables used in an export specifier from the current module must be identifiers",NO_OCTALS_IN_TEMPLATES:"Template literals may not contain octal escape sequences",NO_AWAIT_IN_ASYNC_PARAMS:'Async arrow parameters may not contain "await"'};Object.defineProperty(tokenizer,"__esModule",{value:!0});tokenizer.JsError=tokenizer.TokenType=tokenizer.TokenClass=void 0;var _slicedToArray=function(){function o(e,s){var a=[],c=!0,h=!1,d=void 0;try{for(var g=e[Symbol.iterator](),_;!(c=(_=g.next()).done)&&(a.push(_.value),!(s&&a.length===s));c=!0);}catch(b){h=!0,d=b}finally{try{!c&&g.return&&g.return()}finally{if(h)throw d}}return a}return function(e,s){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return o(e,s);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),_createClass$e=function(){function o(e,s){for(var a=0;a"},Ident:{name:"Identifier",isIdentifierName:!0},Keyword:{name:"Keyword",isIdentifierName:!0},NumericLiteral:{name:"Numeric"},TemplateElement:{name:"Template"},Punctuator:{name:"Punctuator"},StringLiteral:{name:"String"},RegularExpression:{name:"RegularExpression"},Illegal:{name:"Illegal"}},TokenType=tokenizer.TokenType={EOS:{klass:TokenClass.Eof,name:"EOS"},LPAREN:{klass:TokenClass.Punctuator,name:"("},RPAREN:{klass:TokenClass.Punctuator,name:")"},LBRACK:{klass:TokenClass.Punctuator,name:"["},RBRACK:{klass:TokenClass.Punctuator,name:"]"},LBRACE:{klass:TokenClass.Punctuator,name:"{"},RBRACE:{klass:TokenClass.Punctuator,name:"}"},COLON:{klass:TokenClass.Punctuator,name:":"},SEMICOLON:{klass:TokenClass.Punctuator,name:";"},PERIOD:{klass:TokenClass.Punctuator,name:"."},ELLIPSIS:{klass:TokenClass.Punctuator,name:"..."},ARROW:{klass:TokenClass.Punctuator,name:"=>"},CONDITIONAL:{klass:TokenClass.Punctuator,name:"?"},INC:{klass:TokenClass.Punctuator,name:"++"},DEC:{klass:TokenClass.Punctuator,name:"--"},ASSIGN:{klass:TokenClass.Punctuator,name:"="},ASSIGN_BIT_OR:{klass:TokenClass.Punctuator,name:"|="},ASSIGN_BIT_XOR:{klass:TokenClass.Punctuator,name:"^="},ASSIGN_BIT_AND:{klass:TokenClass.Punctuator,name:"&="},ASSIGN_SHL:{klass:TokenClass.Punctuator,name:"<<="},ASSIGN_SHR:{klass:TokenClass.Punctuator,name:">>="},ASSIGN_SHR_UNSIGNED:{klass:TokenClass.Punctuator,name:">>>="},ASSIGN_ADD:{klass:TokenClass.Punctuator,name:"+="},ASSIGN_SUB:{klass:TokenClass.Punctuator,name:"-="},ASSIGN_MUL:{klass:TokenClass.Punctuator,name:"*="},ASSIGN_DIV:{klass:TokenClass.Punctuator,name:"/="},ASSIGN_MOD:{klass:TokenClass.Punctuator,name:"%="},ASSIGN_EXP:{klass:TokenClass.Punctuator,name:"**="},COMMA:{klass:TokenClass.Punctuator,name:","},OR:{klass:TokenClass.Punctuator,name:"||"},AND:{klass:TokenClass.Punctuator,name:"&&"},BIT_OR:{klass:TokenClass.Punctuator,name:"|"},BIT_XOR:{klass:TokenClass.Punctuator,name:"^"},BIT_AND:{klass:TokenClass.Punctuator,name:"&"},SHL:{klass:TokenClass.Punctuator,name:"<<"},SHR:{klass:TokenClass.Punctuator,name:">>"},SHR_UNSIGNED:{klass:TokenClass.Punctuator,name:">>>"},ADD:{klass:TokenClass.Punctuator,name:"+"},SUB:{klass:TokenClass.Punctuator,name:"-"},MUL:{klass:TokenClass.Punctuator,name:"*"},DIV:{klass:TokenClass.Punctuator,name:"/"},MOD:{klass:TokenClass.Punctuator,name:"%"},EXP:{klass:TokenClass.Punctuator,name:"**"},EQ:{klass:TokenClass.Punctuator,name:"=="},NE:{klass:TokenClass.Punctuator,name:"!="},EQ_STRICT:{klass:TokenClass.Punctuator,name:"==="},NE_STRICT:{klass:TokenClass.Punctuator,name:"!=="},LT:{klass:TokenClass.Punctuator,name:"<"},GT:{klass:TokenClass.Punctuator,name:">"},LTE:{klass:TokenClass.Punctuator,name:"<="},GTE:{klass:TokenClass.Punctuator,name:">="},INSTANCEOF:{klass:TokenClass.Keyword,name:"instanceof"},IN:{klass:TokenClass.Keyword,name:"in"},NOT:{klass:TokenClass.Punctuator,name:"!"},BIT_NOT:{klass:TokenClass.Punctuator,name:"~"},ASYNC:{klass:TokenClass.Keyword,name:"async"},AWAIT:{klass:TokenClass.Keyword,name:"await"},ENUM:{klass:TokenClass.Keyword,name:"enum"},DELETE:{klass:TokenClass.Keyword,name:"delete"},TYPEOF:{klass:TokenClass.Keyword,name:"typeof"},VOID:{klass:TokenClass.Keyword,name:"void"},BREAK:{klass:TokenClass.Keyword,name:"break"},CASE:{klass:TokenClass.Keyword,name:"case"},CATCH:{klass:TokenClass.Keyword,name:"catch"},CLASS:{klass:TokenClass.Keyword,name:"class"},CONTINUE:{klass:TokenClass.Keyword,name:"continue"},DEBUGGER:{klass:TokenClass.Keyword,name:"debugger"},DEFAULT:{klass:TokenClass.Keyword,name:"default"},DO:{klass:TokenClass.Keyword,name:"do"},ELSE:{klass:TokenClass.Keyword,name:"else"},EXPORT:{klass:TokenClass.Keyword,name:"export"},EXTENDS:{klass:TokenClass.Keyword,name:"extends"},FINALLY:{klass:TokenClass.Keyword,name:"finally"},FOR:{klass:TokenClass.Keyword,name:"for"},FUNCTION:{klass:TokenClass.Keyword,name:"function"},IF:{klass:TokenClass.Keyword,name:"if"},IMPORT:{klass:TokenClass.Keyword,name:"import"},LET:{klass:TokenClass.Keyword,name:"let"},NEW:{klass:TokenClass.Keyword,name:"new"},RETURN:{klass:TokenClass.Keyword,name:"return"},SUPER:{klass:TokenClass.Keyword,name:"super"},SWITCH:{klass:TokenClass.Keyword,name:"switch"},THIS:{klass:TokenClass.Keyword,name:"this"},THROW:{klass:TokenClass.Keyword,name:"throw"},TRY:{klass:TokenClass.Keyword,name:"try"},VAR:{klass:TokenClass.Keyword,name:"var"},WHILE:{klass:TokenClass.Keyword,name:"while"},WITH:{klass:TokenClass.Keyword,name:"with"},NULL:{klass:TokenClass.Keyword,name:"null"},TRUE:{klass:TokenClass.Keyword,name:"true"},FALSE:{klass:TokenClass.Keyword,name:"false"},YIELD:{klass:TokenClass.Keyword,name:"yield"},NUMBER:{klass:TokenClass.NumericLiteral,name:""},STRING:{klass:TokenClass.StringLiteral,name:""},REGEXP:{klass:TokenClass.RegularExpression,name:""},IDENTIFIER:{klass:TokenClass.Ident,name:""},CONST:{klass:TokenClass.Keyword,name:"const"},TEMPLATE:{klass:TokenClass.TemplateElement,name:""},ESCAPED_KEYWORD:{klass:TokenClass.Keyword,name:""},ILLEGAL:{klass:TokenClass.Illegal,name:""}},TT=TokenType,I=TT.ILLEGAL,F=!1,T=!0,ONE_CHAR_PUNCTUATOR=[I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,TT.NOT,I,I,I,TT.MOD,TT.BIT_AND,I,TT.LPAREN,TT.RPAREN,TT.MUL,TT.ADD,TT.COMMA,TT.SUB,TT.PERIOD,TT.DIV,I,I,I,I,I,I,I,I,I,I,TT.COLON,TT.SEMICOLON,TT.LT,TT.ASSIGN,TT.GT,TT.CONDITIONAL,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,TT.LBRACK,I,TT.RBRACK,TT.BIT_XOR,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,TT.LBRACE,TT.BIT_OR,TT.RBRACE,TT.BIT_NOT],PUNCTUATOR_START=[F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,T,F,F,F,T,T,F,T,T,T,T,T,T,F,T,F,F,F,F,F,F,F,F,F,F,T,T,T,T,T,T,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,T,F,T,T,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,T,T,T,T,F],JsError=tokenizer.JsError=function(o){_inherits$8(e,o);function e(s,a,c,h){_classCallCheck$i(this,e);var d=_possibleConstructorReturn$8(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,h));d.index=s;try{d.line=a,d.column=c}catch{}return d.parseErrorLine=a,d.parseErrorColumn=c,d.description=h,d.message="["+a+":"+c+"]: "+h,d}return e}(Error);function fromCodePoint$1(o){if(o<=65535)return String.fromCharCode(o);var e=String.fromCharCode(Math.floor((o-65536)/1024)+55296),s=String.fromCharCode((o-65536)%1024+56320);return e+s}function decodeUtf16(o,e){return(o-55296)*1024+(e-56320)+65536}var Tokenizer=function(){function o(e){_classCallCheck$i(this,o),this.source=e,this.index=0,this.line=0,this.lineStart=0,this.startIndex=0,this.startLine=0,this.startLineStart=0,this.lastIndex=0,this.lastLine=0,this.lastLineStart=0,this.hasLineTerminatorBeforeNext=!1,this.tokenIndex=0}return _createClass$e(o,[{key:"saveLexerState",value:function(){return{source:this.source,index:this.index,line:this.line,lineStart:this.lineStart,startIndex:this.startIndex,startLine:this.startLine,startLineStart:this.startLineStart,lastIndex:this.lastIndex,lastLine:this.lastLine,lastLineStart:this.lastLineStart,lookahead:this.lookahead,hasLineTerminatorBeforeNext:this.hasLineTerminatorBeforeNext,tokenIndex:this.tokenIndex}}},{key:"restoreLexerState",value:function(s){this.source=s.source,this.index=s.index,this.line=s.line,this.lineStart=s.lineStart,this.startIndex=s.startIndex,this.startLine=s.startLine,this.startLineStart=s.startLineStart,this.lastIndex=s.lastIndex,this.lastLine=s.lastLine,this.lastLineStart=s.lastLineStart,this.lookahead=s.lookahead,this.hasLineTerminatorBeforeNext=s.hasLineTerminatorBeforeNext,this.tokenIndex=s.tokenIndex}},{key:"createILLEGAL",value:function(){return this.startIndex=this.index,this.startLine=this.line,this.startLineStart=this.lineStart,this.index1?c-1:0),d=1;d10)return TokenType.IDENTIFIER;switch(s.length){case 2:switch(s.charAt(0)){case"i":switch(s.charAt(1)){case"f":return TokenType.IF;case"n":return TokenType.IN}break;case"d":if(s.charAt(1)==="o")return TokenType.DO;break}break;case 3:switch(s.charAt(0)){case"v":if(o.cse2(s,"a","r"))return TokenType.VAR;break;case"f":if(o.cse2(s,"o","r"))return TokenType.FOR;break;case"n":if(o.cse2(s,"e","w"))return TokenType.NEW;break;case"t":if(o.cse2(s,"r","y"))return TokenType.TRY;break;case"l":if(o.cse2(s,"e","t"))return TokenType.LET;break}break;case 4:switch(s.charAt(0)){case"t":if(o.cse3(s,"h","i","s"))return TokenType.THIS;if(o.cse3(s,"r","u","e"))return TokenType.TRUE;break;case"n":if(o.cse3(s,"u","l","l"))return TokenType.NULL;break;case"e":if(o.cse3(s,"l","s","e"))return TokenType.ELSE;if(o.cse3(s,"n","u","m"))return TokenType.ENUM;break;case"c":if(o.cse3(s,"a","s","e"))return TokenType.CASE;break;case"v":if(o.cse3(s,"o","i","d"))return TokenType.VOID;break;case"w":if(o.cse3(s,"i","t","h"))return TokenType.WITH;break}break;case 5:switch(s.charAt(0)){case"a":if(o.cse4(s,"s","y","n","c"))return TokenType.ASYNC;if(o.cse4(s,"w","a","i","t"))return TokenType.AWAIT;break;case"w":if(o.cse4(s,"h","i","l","e"))return TokenType.WHILE;break;case"b":if(o.cse4(s,"r","e","a","k"))return TokenType.BREAK;break;case"f":if(o.cse4(s,"a","l","s","e"))return TokenType.FALSE;break;case"c":if(o.cse4(s,"a","t","c","h"))return TokenType.CATCH;if(o.cse4(s,"o","n","s","t"))return TokenType.CONST;if(o.cse4(s,"l","a","s","s"))return TokenType.CLASS;break;case"t":if(o.cse4(s,"h","r","o","w"))return TokenType.THROW;break;case"y":if(o.cse4(s,"i","e","l","d"))return TokenType.YIELD;break;case"s":if(o.cse4(s,"u","p","e","r"))return TokenType.SUPER;break}break;case 6:switch(s.charAt(0)){case"r":if(o.cse5(s,"e","t","u","r","n"))return TokenType.RETURN;break;case"t":if(o.cse5(s,"y","p","e","o","f"))return TokenType.TYPEOF;break;case"d":if(o.cse5(s,"e","l","e","t","e"))return TokenType.DELETE;break;case"s":if(o.cse5(s,"w","i","t","c","h"))return TokenType.SWITCH;break;case"e":if(o.cse5(s,"x","p","o","r","t"))return TokenType.EXPORT;break;case"i":if(o.cse5(s,"m","p","o","r","t"))return TokenType.IMPORT;break}break;case 7:switch(s.charAt(0)){case"d":if(o.cse6(s,"e","f","a","u","l","t"))return TokenType.DEFAULT;break;case"f":if(o.cse6(s,"i","n","a","l","l","y"))return TokenType.FINALLY;break;case"e":if(o.cse6(s,"x","t","e","n","d","s"))return TokenType.EXTENDS;break}break;case 8:switch(s.charAt(0)){case"f":if(o.cse7(s,"u","n","c","t","i","o","n"))return TokenType.FUNCTION;break;case"c":if(o.cse7(s,"o","n","t","i","n","u","e"))return TokenType.CONTINUE;break;case"d":if(o.cse7(s,"e","b","u","g","g","e","r"))return TokenType.DEBUGGER;break}break;case 10:if(s==="instanceof")return TokenType.INSTANCEOF;break}return TokenType.IDENTIFIER}},{key:"skipSingleLineComment",value:function(s){for(this.index+=s;this.index=a)break;if(c=this.source.charCodeAt(this.index+1),c===47)this.skipSingleLineComment(2),s=!0;else if(c===42)s=this.skipMultiLineComment()||s;else break}else if(!this.moduleIsTheGoalSymbol&&s&&c===45){if(this.index+2>=a)break;if(this.source.charAt(this.index+1)==="-"&&this.source.charAt(this.index+2)===">")this.skipSingleLineComment(3);else break}else if(!this.moduleIsTheGoalSymbol&&c===60)if(this.source.slice(this.index+1,this.index+4)==="!--")this.skipSingleLineComment(4),s=!0;else break;else break}}},{key:"scanHexEscape2",value:function(){if(this.index+2>this.source.length)return-1;var s=(0,_utils$1.getHexValue)(this.source.charAt(this.index));if(s===-1)return-1;var a=(0,_utils$1.getHexValue)(this.source.charAt(this.index+1));return a===-1?-1:(this.index+=2,s<<4|a)}},{key:"scanUnicode",value:function(){if(this.source.charAt(this.index)==="{"){for(var s=this.index+1,a=0,c=void 0;s1114111)throw this.createILLEGAL();s++}if(c!=="}")throw this.createILLEGAL();if(s===this.index+1)throw++this.index,this.createILLEGAL();return this.index=s+1,a}if(this.index+4>this.source.length)return-1;var d=(0,_utils$1.getHexValue)(this.source.charAt(this.index));if(d===-1)return-1;var g=(0,_utils$1.getHexValue)(this.source.charAt(this.index+1));if(g===-1)return-1;var _=(0,_utils$1.getHexValue)(this.source.charAt(this.index+2));if(_===-1)return-1;var b=(0,_utils$1.getHexValue)(this.source.charAt(this.index+3));return b===-1?-1:(this.index+=4,d<<12|g<<8|_<<4|b)}},{key:"getEscapedIdentifier",value:function(){for(var s="",a=_utils$1.isIdentifierStart;this.index=this.source.length)throw this.createILLEGAL();if(this.source.charAt(this.index)!=="u")throw this.createILLEGAL();if(++this.index,h=this.scanUnicode(),h<0)throw this.createILLEGAL();c=fromCodePoint$1(h)}else if(h>=55296&&h<=56319){if(this.index>=this.source.length)throw this.createILLEGAL();var g=this.source.charCodeAt(this.index);if(++this.index,!(g>=56320&&g<=57343))throw this.createILLEGAL();h=decodeUtf16(h,g),c=fromCodePoint$1(h)}if(!a(h)){if(s.length<1)throw this.createILLEGAL();return this.index=d,s}a=_utils$1.isIdentifierPart,s+=c}return s}},{key:"getIdentifier",value:function(){for(var s=this.index,a=this.source.length,c=this.index,h=_utils$1.isIdentifierStart;c=55296&&g<=56319)return this.index=s,this.getEscapedIdentifier();if(!h(g))return this.index=c,this.source.slice(s,c);++c,h=_utils$1.isIdentifierPart}return this.index=c,this.source.slice(s,c)}},{key:"scanIdentifier",value:function(){var s=this.getLocation(),a=this.index,c=this.source.charAt(this.index)==="\\"?this.getEscapedIdentifier():this.getIdentifier(),h=this.getSlice(a,s);h.text=c;var d=this.index-a!==c.length,g=this.getKeyword(c);return d&&g!==TokenType.IDENTIFIER&&(g=TokenType.ESCAPED_KEYWORD),{type:g,value:c,slice:h,escaped:d}}},{key:"getLocation",value:function(){return{line:this.startLine+1,column:this.startIndex-this.startLineStart,offset:this.startIndex}}},{key:"getLastTokenEndLocation",value:function(){return{line:this.lastLine+1,column:this.lastIndex-this.lastLineStart,offset:this.lastIndex}}},{key:"getSlice",value:function(s,a){return{text:this.source.slice(s,this.index),start:s,startLocation:a,end:this.index}}},{key:"scanPunctuatorHelper",value:function(){var s=this.source.charAt(this.index);switch(s){case".":{var a=this.source.charAt(this.index+1);if(a!==".")return TokenType.PERIOD;var c=this.source.charAt(this.index+2);return c!=="."?TokenType.PERIOD:TokenType.ELLIPSIS}case"(":return TokenType.LPAREN;case")":case";":case",":return ONE_CHAR_PUNCTUATOR[s.charCodeAt(0)];case"{":return TokenType.LBRACE;case"}":case"[":case"]":case":":case"?":case"~":return ONE_CHAR_PUNCTUATOR[s.charCodeAt(0)];default:if(this.index+1":return TokenType.GTE;case"/":return TokenType.ASSIGN_DIV;case"%":return TokenType.ASSIGN_MOD;case"^":return TokenType.ASSIGN_BIT_XOR;case"&":return TokenType.ASSIGN_BIT_AND}}if(this.index+1"&&d===">")return this.index+3"&&d==="=")return TokenType.ASSIGN_SHR;if(s==="*"&&d==="=")return TokenType.ASSIGN_EXP}switch(s){case"*":return TokenType.EXP;case"+":return TokenType.INC;case"-":return TokenType.DEC;case"<":return TokenType.SHL;case">":return TokenType.SHR;case"&":return TokenType.AND;case"|":return TokenType.OR}}else if(s==="="&&h===">")return TokenType.ARROW}return ONE_CHAR_PUNCTUATOR[s.charCodeAt(0)]}},{key:"scanPunctuator",value:function(){var s=this.getLocation(),a=this.index,c=this.scanPunctuatorHelper();return this.index+=c.name.length,{type:c,value:c.name,slice:this.getSlice(a,s)}}},{key:"scanHexLiteral",value:function(s,a){for(var c=this.index;c="0"&&c<="7")this.index++;else{if((0,_utils$1.isIdentifierPart)(c.charCodeAt(0)))throw this.createILLEGAL();break}}if(this.index-s===2)throw this.createILLEGAL();return{type:TokenType.NUMBER,value:parseInt(this.getSlice(s,a).text.substr(2),8),slice:this.getSlice(s,a),octal:!1,noctal:!1}}},{key:"scanLegacyOctalLiteral",value:function(s,a){for(var c=!0;this.index="0"&&h<="7")this.index++;else if(h==="8"||h==="9")c=!1,this.index++;else{if((0,_utils$1.isIdentifierPart)(h.charCodeAt(0)))throw this.createILLEGAL();break}}var d=this.getSlice(s,a);return c?{type:TokenType.NUMBER,slice:d,value:parseInt(d.text.substr(1),8),octal:!0,noctal:!c}:(this.eatDecimalLiteralSuffix(),{type:TokenType.NUMBER,slice:d,value:+d.text,octal:!0,noctal:!c})}},{key:"scanNumericLiteral",value:function(){var s=this.source.charAt(this.index),a=this.getLocation(),c=this.index;if(s==="0")if(this.index++,this.index="0"&&s<="9")return this.scanLegacyOctalLiteral(c,a)}else{var h=this.getSlice(c,a);return{type:TokenType.NUMBER,value:+h.text,slice:h,octal:!1,noctal:!1}}else if(s!==".")for(s=this.source.charAt(this.index);s>="0"&&s<="9";){if(this.index++,this.index===this.source.length){var d=this.getSlice(c,a);return{type:TokenType.NUMBER,value:+d.text,slice:d,octal:!1,noctal:!1}}s=this.source.charAt(this.index)}if(this.eatDecimalLiteralSuffix(),this.index!==this.source.length&&(0,_utils$1.isIdentifierStart)(this.source.charCodeAt(this.index)))throw this.createILLEGAL();var g=this.getSlice(c,a);return{type:TokenType.NUMBER,value:+g.text,slice:g,octal:!1,noctal:!1}}},{key:"eatDecimalLiteralSuffix",value:function(){var s=this.source.charAt(this.index);if(s==="."){if(this.index++,this.index===this.source.length)return;for(s=this.source.charAt(this.index);s>="0"&&s<="9";){if(this.index++,this.index===this.source.length)return;s=this.source.charAt(this.index)}}if(s==="e"||s==="E"){if(this.index++,this.index===this.source.length)throw this.createILLEGAL();if(s=this.source.charAt(this.index),s==="+"||s==="-"){if(this.index++,this.index===this.source.length)throw this.createILLEGAL();s=this.source.charAt(this.index)}if(s>="0"&&s<="9")for(;s>="0"&&s<="9"&&(this.index++,this.index!==this.source.length);)s=this.source.charAt(this.index);else throw this.createILLEGAL()}}},{key:"scanStringEscape",value:function(s,a){if(this.index++,this.index===this.source.length)throw this.createILLEGAL();var c=this.source.charAt(this.index);if((0,_utils$1.isLineTerminator)(c.charCodeAt(0)))this.index++,c==="\r"&&this.source.charAt(this.index)===` `&&this.index++,this.lineStart=this.index,this.line++;else switch(c){case"n":s+=` `,this.index++;break;case"r":s+="\r",this.index++;break;case"t":s+=" ",this.index++;break;case"u":case"x":{var h=void 0;if(this.index++,this.index>=this.source.length)throw this.createILLEGAL();if(h=c==="u"?this.scanUnicode():this.scanHexEscape2(),h<0)throw this.createILLEGAL();s+=fromCodePoint$1(h);break}case"b":s+="\b",this.index++;break;case"f":s+="\f",this.index++;break;case"v":s+="\v",this.index++;break;default:if(c>="0"&&c<="7"){var d=this.index,g=1;c>="0"&&c<="3"&&(g=0);for(var _=0;g<3&&c>="0"&&c<="7";){if(this.index++,(g>0||c!=="0")&&(a=this.source.slice(d,this.index)),_*=8,_+=c-"0",g++,this.index===this.source.length)throw this.createILLEGAL();c=this.source.charAt(this.index)}_===0&&g===1&&(c==="8"||c==="9")&&(a=this.source.slice(d,this.index+1)),s+=String.fromCharCode(_)}else{if(c==="8"||c==="9")throw this.createILLEGAL();s+=c,this.index++}}return[s,a]}},{key:"scanStringLiteral",value:function(){var s="",a=this.source.charAt(this.index),c=this.getLocation(),h=this.index;this.index++;for(var d=null;this.index=this.source.length)return{type:TokenType.EOS,slice:this.getSlice(this.index,s)};var a=this.source.charCodeAt(this.index);if(a<128){if(PUNCTUATOR_START[a])return this.scanPunctuator();if((0,_utils$1.isIdentifierStart)(a)||a===92)return this.scanIdentifier();if(a===46)return this.index+1=48&&a<=57)return this.scanNumericLiteral();throw this.createILLEGAL()}else{if((0,_utils$1.isIdentifierStart)(a)||a>=55296&&a<=56319)return this.scanIdentifier();throw this.createILLEGAL()}}},{key:"eof",value:function(){return this.lookahead.type===TokenType.EOS}},{key:"lex",value:function(){var s=this.lookahead;return this.lookahead=this.advance(),this.tokenIndex++,s}}],[{key:"cse2",value:function(s,a,c){return s.charAt(1)===a&&s.charAt(2)===c}},{key:"cse3",value:function(s,a,c,h){return s.charAt(1)===a&&s.charAt(2)===c&&s.charAt(3)===h}},{key:"cse4",value:function(s,a,c,h,d){return s.charAt(1)===a&&s.charAt(2)===c&&s.charAt(3)===h&&s.charAt(4)===d}},{key:"cse5",value:function(s,a,c,h,d,g){return s.charAt(1)===a&&s.charAt(2)===c&&s.charAt(3)===h&&s.charAt(4)===d&&s.charAt(5)===g}},{key:"cse6",value:function(s,a,c,h,d,g,_){return s.charAt(1)===a&&s.charAt(2)===c&&s.charAt(3)===h&&s.charAt(4)===d&&s.charAt(5)===g&&s.charAt(6)===_}},{key:"cse7",value:function(s,a,c,h,d,g,_,b){return s.charAt(1)===a&&s.charAt(2)===c&&s.charAt(3)===h&&s.charAt(4)===d&&s.charAt(5)===g&&s.charAt(6)===_&&s.charAt(7)===b}}]),o}();tokenizer.default=Tokenizer;var parser$1={},dist$6={},mappings=new Map([["General_Category",new Map([["C","Other"],["Cc","Control"],["cntrl","Control"],["Cf","Format"],["Cn","Unassigned"],["Co","Private_Use"],["Cs","Surrogate"],["L","Letter"],["LC","Cased_Letter"],["Ll","Lowercase_Letter"],["Lm","Modifier_Letter"],["Lo","Other_Letter"],["Lt","Titlecase_Letter"],["Lu","Uppercase_Letter"],["M","Mark"],["Combining_Mark","Mark"],["Mc","Spacing_Mark"],["Me","Enclosing_Mark"],["Mn","Nonspacing_Mark"],["N","Number"],["Nd","Decimal_Number"],["digit","Decimal_Number"],["Nl","Letter_Number"],["No","Other_Number"],["P","Punctuation"],["punct","Punctuation"],["Pc","Connector_Punctuation"],["Pd","Dash_Punctuation"],["Pe","Close_Punctuation"],["Pf","Final_Punctuation"],["Pi","Initial_Punctuation"],["Po","Other_Punctuation"],["Ps","Open_Punctuation"],["S","Symbol"],["Sc","Currency_Symbol"],["Sk","Modifier_Symbol"],["Sm","Math_Symbol"],["So","Other_Symbol"],["Z","Separator"],["Zl","Line_Separator"],["Zp","Paragraph_Separator"],["Zs","Space_Separator"],["Other","Other"],["Control","Control"],["Format","Format"],["Unassigned","Unassigned"],["Private_Use","Private_Use"],["Surrogate","Surrogate"],["Letter","Letter"],["Cased_Letter","Cased_Letter"],["Lowercase_Letter","Lowercase_Letter"],["Modifier_Letter","Modifier_Letter"],["Other_Letter","Other_Letter"],["Titlecase_Letter","Titlecase_Letter"],["Uppercase_Letter","Uppercase_Letter"],["Mark","Mark"],["Spacing_Mark","Spacing_Mark"],["Enclosing_Mark","Enclosing_Mark"],["Nonspacing_Mark","Nonspacing_Mark"],["Number","Number"],["Decimal_Number","Decimal_Number"],["Letter_Number","Letter_Number"],["Other_Number","Other_Number"],["Punctuation","Punctuation"],["Connector_Punctuation","Connector_Punctuation"],["Dash_Punctuation","Dash_Punctuation"],["Close_Punctuation","Close_Punctuation"],["Final_Punctuation","Final_Punctuation"],["Initial_Punctuation","Initial_Punctuation"],["Other_Punctuation","Other_Punctuation"],["Open_Punctuation","Open_Punctuation"],["Symbol","Symbol"],["Currency_Symbol","Currency_Symbol"],["Modifier_Symbol","Modifier_Symbol"],["Math_Symbol","Math_Symbol"],["Other_Symbol","Other_Symbol"],["Separator","Separator"],["Line_Separator","Line_Separator"],["Paragraph_Separator","Paragraph_Separator"],["Space_Separator","Space_Separator"]])],["Script",new Map([["Adlm","Adlam"],["Aghb","Caucasian_Albanian"],["Ahom","Ahom"],["Arab","Arabic"],["Armi","Imperial_Aramaic"],["Armn","Armenian"],["Avst","Avestan"],["Bali","Balinese"],["Bamu","Bamum"],["Bass","Bassa_Vah"],["Batk","Batak"],["Beng","Bengali"],["Bhks","Bhaiksuki"],["Bopo","Bopomofo"],["Brah","Brahmi"],["Brai","Braille"],["Bugi","Buginese"],["Buhd","Buhid"],["Cakm","Chakma"],["Cans","Canadian_Aboriginal"],["Cari","Carian"],["Cham","Cham"],["Cher","Cherokee"],["Copt","Coptic"],["Qaac","Coptic"],["Cprt","Cypriot"],["Cyrl","Cyrillic"],["Deva","Devanagari"],["Dogr","Dogra"],["Dsrt","Deseret"],["Dupl","Duployan"],["Egyp","Egyptian_Hieroglyphs"],["Elba","Elbasan"],["Ethi","Ethiopic"],["Geor","Georgian"],["Glag","Glagolitic"],["Gong","Gunjala_Gondi"],["Gonm","Masaram_Gondi"],["Goth","Gothic"],["Gran","Grantha"],["Grek","Greek"],["Gujr","Gujarati"],["Guru","Gurmukhi"],["Hang","Hangul"],["Hani","Han"],["Hano","Hanunoo"],["Hatr","Hatran"],["Hebr","Hebrew"],["Hira","Hiragana"],["Hluw","Anatolian_Hieroglyphs"],["Hmng","Pahawh_Hmong"],["Hrkt","Katakana_Or_Hiragana"],["Hung","Old_Hungarian"],["Ital","Old_Italic"],["Java","Javanese"],["Kali","Kayah_Li"],["Kana","Katakana"],["Khar","Kharoshthi"],["Khmr","Khmer"],["Khoj","Khojki"],["Knda","Kannada"],["Kthi","Kaithi"],["Lana","Tai_Tham"],["Laoo","Lao"],["Latn","Latin"],["Lepc","Lepcha"],["Limb","Limbu"],["Lina","Linear_A"],["Linb","Linear_B"],["Lisu","Lisu"],["Lyci","Lycian"],["Lydi","Lydian"],["Mahj","Mahajani"],["Maka","Makasar"],["Mand","Mandaic"],["Mani","Manichaean"],["Marc","Marchen"],["Medf","Medefaidrin"],["Mend","Mende_Kikakui"],["Merc","Meroitic_Cursive"],["Mero","Meroitic_Hieroglyphs"],["Mlym","Malayalam"],["Modi","Modi"],["Mong","Mongolian"],["Mroo","Mro"],["Mtei","Meetei_Mayek"],["Mult","Multani"],["Mymr","Myanmar"],["Narb","Old_North_Arabian"],["Nbat","Nabataean"],["Newa","Newa"],["Nkoo","Nko"],["Nshu","Nushu"],["Ogam","Ogham"],["Olck","Ol_Chiki"],["Orkh","Old_Turkic"],["Orya","Oriya"],["Osge","Osage"],["Osma","Osmanya"],["Palm","Palmyrene"],["Pauc","Pau_Cin_Hau"],["Perm","Old_Permic"],["Phag","Phags_Pa"],["Phli","Inscriptional_Pahlavi"],["Phlp","Psalter_Pahlavi"],["Phnx","Phoenician"],["Plrd","Miao"],["Prti","Inscriptional_Parthian"],["Rjng","Rejang"],["Rohg","Hanifi_Rohingya"],["Runr","Runic"],["Samr","Samaritan"],["Sarb","Old_South_Arabian"],["Saur","Saurashtra"],["Sgnw","SignWriting"],["Shaw","Shavian"],["Shrd","Sharada"],["Sidd","Siddham"],["Sind","Khudawadi"],["Sinh","Sinhala"],["Sogd","Sogdian"],["Sogo","Old_Sogdian"],["Sora","Sora_Sompeng"],["Soyo","Soyombo"],["Sund","Sundanese"],["Sylo","Syloti_Nagri"],["Syrc","Syriac"],["Tagb","Tagbanwa"],["Takr","Takri"],["Tale","Tai_Le"],["Talu","New_Tai_Lue"],["Taml","Tamil"],["Tang","Tangut"],["Tavt","Tai_Viet"],["Telu","Telugu"],["Tfng","Tifinagh"],["Tglg","Tagalog"],["Thaa","Thaana"],["Thai","Thai"],["Tibt","Tibetan"],["Tirh","Tirhuta"],["Ugar","Ugaritic"],["Vaii","Vai"],["Wara","Warang_Citi"],["Xpeo","Old_Persian"],["Xsux","Cuneiform"],["Yiii","Yi"],["Zanb","Zanabazar_Square"],["Zinh","Inherited"],["Qaai","Inherited"],["Zyyy","Common"],["Zzzz","Unknown"],["Adlam","Adlam"],["Caucasian_Albanian","Caucasian_Albanian"],["Arabic","Arabic"],["Imperial_Aramaic","Imperial_Aramaic"],["Armenian","Armenian"],["Avestan","Avestan"],["Balinese","Balinese"],["Bamum","Bamum"],["Bassa_Vah","Bassa_Vah"],["Batak","Batak"],["Bengali","Bengali"],["Bhaiksuki","Bhaiksuki"],["Bopomofo","Bopomofo"],["Brahmi","Brahmi"],["Braille","Braille"],["Buginese","Buginese"],["Buhid","Buhid"],["Chakma","Chakma"],["Canadian_Aboriginal","Canadian_Aboriginal"],["Carian","Carian"],["Cherokee","Cherokee"],["Coptic","Coptic"],["Cypriot","Cypriot"],["Cyrillic","Cyrillic"],["Devanagari","Devanagari"],["Dogra","Dogra"],["Deseret","Deseret"],["Duployan","Duployan"],["Egyptian_Hieroglyphs","Egyptian_Hieroglyphs"],["Elbasan","Elbasan"],["Ethiopic","Ethiopic"],["Georgian","Georgian"],["Glagolitic","Glagolitic"],["Gunjala_Gondi","Gunjala_Gondi"],["Masaram_Gondi","Masaram_Gondi"],["Gothic","Gothic"],["Grantha","Grantha"],["Greek","Greek"],["Gujarati","Gujarati"],["Gurmukhi","Gurmukhi"],["Hangul","Hangul"],["Han","Han"],["Hanunoo","Hanunoo"],["Hatran","Hatran"],["Hebrew","Hebrew"],["Hiragana","Hiragana"],["Anatolian_Hieroglyphs","Anatolian_Hieroglyphs"],["Pahawh_Hmong","Pahawh_Hmong"],["Katakana_Or_Hiragana","Katakana_Or_Hiragana"],["Old_Hungarian","Old_Hungarian"],["Old_Italic","Old_Italic"],["Javanese","Javanese"],["Kayah_Li","Kayah_Li"],["Katakana","Katakana"],["Kharoshthi","Kharoshthi"],["Khmer","Khmer"],["Khojki","Khojki"],["Kannada","Kannada"],["Kaithi","Kaithi"],["Tai_Tham","Tai_Tham"],["Lao","Lao"],["Latin","Latin"],["Lepcha","Lepcha"],["Limbu","Limbu"],["Linear_A","Linear_A"],["Linear_B","Linear_B"],["Lycian","Lycian"],["Lydian","Lydian"],["Mahajani","Mahajani"],["Makasar","Makasar"],["Mandaic","Mandaic"],["Manichaean","Manichaean"],["Marchen","Marchen"],["Medefaidrin","Medefaidrin"],["Mende_Kikakui","Mende_Kikakui"],["Meroitic_Cursive","Meroitic_Cursive"],["Meroitic_Hieroglyphs","Meroitic_Hieroglyphs"],["Malayalam","Malayalam"],["Mongolian","Mongolian"],["Mro","Mro"],["Meetei_Mayek","Meetei_Mayek"],["Multani","Multani"],["Myanmar","Myanmar"],["Old_North_Arabian","Old_North_Arabian"],["Nabataean","Nabataean"],["Nko","Nko"],["Nushu","Nushu"],["Ogham","Ogham"],["Ol_Chiki","Ol_Chiki"],["Old_Turkic","Old_Turkic"],["Oriya","Oriya"],["Osage","Osage"],["Osmanya","Osmanya"],["Palmyrene","Palmyrene"],["Pau_Cin_Hau","Pau_Cin_Hau"],["Old_Permic","Old_Permic"],["Phags_Pa","Phags_Pa"],["Inscriptional_Pahlavi","Inscriptional_Pahlavi"],["Psalter_Pahlavi","Psalter_Pahlavi"],["Phoenician","Phoenician"],["Miao","Miao"],["Inscriptional_Parthian","Inscriptional_Parthian"],["Rejang","Rejang"],["Hanifi_Rohingya","Hanifi_Rohingya"],["Runic","Runic"],["Samaritan","Samaritan"],["Old_South_Arabian","Old_South_Arabian"],["Saurashtra","Saurashtra"],["SignWriting","SignWriting"],["Shavian","Shavian"],["Sharada","Sharada"],["Siddham","Siddham"],["Khudawadi","Khudawadi"],["Sinhala","Sinhala"],["Sogdian","Sogdian"],["Old_Sogdian","Old_Sogdian"],["Sora_Sompeng","Sora_Sompeng"],["Soyombo","Soyombo"],["Sundanese","Sundanese"],["Syloti_Nagri","Syloti_Nagri"],["Syriac","Syriac"],["Tagbanwa","Tagbanwa"],["Takri","Takri"],["Tai_Le","Tai_Le"],["New_Tai_Lue","New_Tai_Lue"],["Tamil","Tamil"],["Tangut","Tangut"],["Tai_Viet","Tai_Viet"],["Telugu","Telugu"],["Tifinagh","Tifinagh"],["Tagalog","Tagalog"],["Thaana","Thaana"],["Tibetan","Tibetan"],["Tirhuta","Tirhuta"],["Ugaritic","Ugaritic"],["Vai","Vai"],["Warang_Citi","Warang_Citi"],["Old_Persian","Old_Persian"],["Cuneiform","Cuneiform"],["Yi","Yi"],["Zanabazar_Square","Zanabazar_Square"],["Inherited","Inherited"],["Common","Common"],["Unknown","Unknown"]])],["Script_Extensions",new Map([["Adlm","Adlam"],["Aghb","Caucasian_Albanian"],["Ahom","Ahom"],["Arab","Arabic"],["Armi","Imperial_Aramaic"],["Armn","Armenian"],["Avst","Avestan"],["Bali","Balinese"],["Bamu","Bamum"],["Bass","Bassa_Vah"],["Batk","Batak"],["Beng","Bengali"],["Bhks","Bhaiksuki"],["Bopo","Bopomofo"],["Brah","Brahmi"],["Brai","Braille"],["Bugi","Buginese"],["Buhd","Buhid"],["Cakm","Chakma"],["Cans","Canadian_Aboriginal"],["Cari","Carian"],["Cham","Cham"],["Cher","Cherokee"],["Copt","Coptic"],["Qaac","Coptic"],["Cprt","Cypriot"],["Cyrl","Cyrillic"],["Deva","Devanagari"],["Dogr","Dogra"],["Dsrt","Deseret"],["Dupl","Duployan"],["Egyp","Egyptian_Hieroglyphs"],["Elba","Elbasan"],["Ethi","Ethiopic"],["Geor","Georgian"],["Glag","Glagolitic"],["Gong","Gunjala_Gondi"],["Gonm","Masaram_Gondi"],["Goth","Gothic"],["Gran","Grantha"],["Grek","Greek"],["Gujr","Gujarati"],["Guru","Gurmukhi"],["Hang","Hangul"],["Hani","Han"],["Hano","Hanunoo"],["Hatr","Hatran"],["Hebr","Hebrew"],["Hira","Hiragana"],["Hluw","Anatolian_Hieroglyphs"],["Hmng","Pahawh_Hmong"],["Hrkt","Katakana_Or_Hiragana"],["Hung","Old_Hungarian"],["Ital","Old_Italic"],["Java","Javanese"],["Kali","Kayah_Li"],["Kana","Katakana"],["Khar","Kharoshthi"],["Khmr","Khmer"],["Khoj","Khojki"],["Knda","Kannada"],["Kthi","Kaithi"],["Lana","Tai_Tham"],["Laoo","Lao"],["Latn","Latin"],["Lepc","Lepcha"],["Limb","Limbu"],["Lina","Linear_A"],["Linb","Linear_B"],["Lisu","Lisu"],["Lyci","Lycian"],["Lydi","Lydian"],["Mahj","Mahajani"],["Maka","Makasar"],["Mand","Mandaic"],["Mani","Manichaean"],["Marc","Marchen"],["Medf","Medefaidrin"],["Mend","Mende_Kikakui"],["Merc","Meroitic_Cursive"],["Mero","Meroitic_Hieroglyphs"],["Mlym","Malayalam"],["Modi","Modi"],["Mong","Mongolian"],["Mroo","Mro"],["Mtei","Meetei_Mayek"],["Mult","Multani"],["Mymr","Myanmar"],["Narb","Old_North_Arabian"],["Nbat","Nabataean"],["Newa","Newa"],["Nkoo","Nko"],["Nshu","Nushu"],["Ogam","Ogham"],["Olck","Ol_Chiki"],["Orkh","Old_Turkic"],["Orya","Oriya"],["Osge","Osage"],["Osma","Osmanya"],["Palm","Palmyrene"],["Pauc","Pau_Cin_Hau"],["Perm","Old_Permic"],["Phag","Phags_Pa"],["Phli","Inscriptional_Pahlavi"],["Phlp","Psalter_Pahlavi"],["Phnx","Phoenician"],["Plrd","Miao"],["Prti","Inscriptional_Parthian"],["Rjng","Rejang"],["Rohg","Hanifi_Rohingya"],["Runr","Runic"],["Samr","Samaritan"],["Sarb","Old_South_Arabian"],["Saur","Saurashtra"],["Sgnw","SignWriting"],["Shaw","Shavian"],["Shrd","Sharada"],["Sidd","Siddham"],["Sind","Khudawadi"],["Sinh","Sinhala"],["Sogd","Sogdian"],["Sogo","Old_Sogdian"],["Sora","Sora_Sompeng"],["Soyo","Soyombo"],["Sund","Sundanese"],["Sylo","Syloti_Nagri"],["Syrc","Syriac"],["Tagb","Tagbanwa"],["Takr","Takri"],["Tale","Tai_Le"],["Talu","New_Tai_Lue"],["Taml","Tamil"],["Tang","Tangut"],["Tavt","Tai_Viet"],["Telu","Telugu"],["Tfng","Tifinagh"],["Tglg","Tagalog"],["Thaa","Thaana"],["Thai","Thai"],["Tibt","Tibetan"],["Tirh","Tirhuta"],["Ugar","Ugaritic"],["Vaii","Vai"],["Wara","Warang_Citi"],["Xpeo","Old_Persian"],["Xsux","Cuneiform"],["Yiii","Yi"],["Zanb","Zanabazar_Square"],["Zinh","Inherited"],["Qaai","Inherited"],["Zyyy","Common"],["Zzzz","Unknown"],["Adlam","Adlam"],["Caucasian_Albanian","Caucasian_Albanian"],["Arabic","Arabic"],["Imperial_Aramaic","Imperial_Aramaic"],["Armenian","Armenian"],["Avestan","Avestan"],["Balinese","Balinese"],["Bamum","Bamum"],["Bassa_Vah","Bassa_Vah"],["Batak","Batak"],["Bengali","Bengali"],["Bhaiksuki","Bhaiksuki"],["Bopomofo","Bopomofo"],["Brahmi","Brahmi"],["Braille","Braille"],["Buginese","Buginese"],["Buhid","Buhid"],["Chakma","Chakma"],["Canadian_Aboriginal","Canadian_Aboriginal"],["Carian","Carian"],["Cherokee","Cherokee"],["Coptic","Coptic"],["Cypriot","Cypriot"],["Cyrillic","Cyrillic"],["Devanagari","Devanagari"],["Dogra","Dogra"],["Deseret","Deseret"],["Duployan","Duployan"],["Egyptian_Hieroglyphs","Egyptian_Hieroglyphs"],["Elbasan","Elbasan"],["Ethiopic","Ethiopic"],["Georgian","Georgian"],["Glagolitic","Glagolitic"],["Gunjala_Gondi","Gunjala_Gondi"],["Masaram_Gondi","Masaram_Gondi"],["Gothic","Gothic"],["Grantha","Grantha"],["Greek","Greek"],["Gujarati","Gujarati"],["Gurmukhi","Gurmukhi"],["Hangul","Hangul"],["Han","Han"],["Hanunoo","Hanunoo"],["Hatran","Hatran"],["Hebrew","Hebrew"],["Hiragana","Hiragana"],["Anatolian_Hieroglyphs","Anatolian_Hieroglyphs"],["Pahawh_Hmong","Pahawh_Hmong"],["Katakana_Or_Hiragana","Katakana_Or_Hiragana"],["Old_Hungarian","Old_Hungarian"],["Old_Italic","Old_Italic"],["Javanese","Javanese"],["Kayah_Li","Kayah_Li"],["Katakana","Katakana"],["Kharoshthi","Kharoshthi"],["Khmer","Khmer"],["Khojki","Khojki"],["Kannada","Kannada"],["Kaithi","Kaithi"],["Tai_Tham","Tai_Tham"],["Lao","Lao"],["Latin","Latin"],["Lepcha","Lepcha"],["Limbu","Limbu"],["Linear_A","Linear_A"],["Linear_B","Linear_B"],["Lycian","Lycian"],["Lydian","Lydian"],["Mahajani","Mahajani"],["Makasar","Makasar"],["Mandaic","Mandaic"],["Manichaean","Manichaean"],["Marchen","Marchen"],["Medefaidrin","Medefaidrin"],["Mende_Kikakui","Mende_Kikakui"],["Meroitic_Cursive","Meroitic_Cursive"],["Meroitic_Hieroglyphs","Meroitic_Hieroglyphs"],["Malayalam","Malayalam"],["Mongolian","Mongolian"],["Mro","Mro"],["Meetei_Mayek","Meetei_Mayek"],["Multani","Multani"],["Myanmar","Myanmar"],["Old_North_Arabian","Old_North_Arabian"],["Nabataean","Nabataean"],["Nko","Nko"],["Nushu","Nushu"],["Ogham","Ogham"],["Ol_Chiki","Ol_Chiki"],["Old_Turkic","Old_Turkic"],["Oriya","Oriya"],["Osage","Osage"],["Osmanya","Osmanya"],["Palmyrene","Palmyrene"],["Pau_Cin_Hau","Pau_Cin_Hau"],["Old_Permic","Old_Permic"],["Phags_Pa","Phags_Pa"],["Inscriptional_Pahlavi","Inscriptional_Pahlavi"],["Psalter_Pahlavi","Psalter_Pahlavi"],["Phoenician","Phoenician"],["Miao","Miao"],["Inscriptional_Parthian","Inscriptional_Parthian"],["Rejang","Rejang"],["Hanifi_Rohingya","Hanifi_Rohingya"],["Runic","Runic"],["Samaritan","Samaritan"],["Old_South_Arabian","Old_South_Arabian"],["Saurashtra","Saurashtra"],["SignWriting","SignWriting"],["Shavian","Shavian"],["Sharada","Sharada"],["Siddham","Siddham"],["Khudawadi","Khudawadi"],["Sinhala","Sinhala"],["Sogdian","Sogdian"],["Old_Sogdian","Old_Sogdian"],["Sora_Sompeng","Sora_Sompeng"],["Soyombo","Soyombo"],["Sundanese","Sundanese"],["Syloti_Nagri","Syloti_Nagri"],["Syriac","Syriac"],["Tagbanwa","Tagbanwa"],["Takri","Takri"],["Tai_Le","Tai_Le"],["New_Tai_Lue","New_Tai_Lue"],["Tamil","Tamil"],["Tangut","Tangut"],["Tai_Viet","Tai_Viet"],["Telugu","Telugu"],["Tifinagh","Tifinagh"],["Tagalog","Tagalog"],["Thaana","Thaana"],["Tibetan","Tibetan"],["Tirhuta","Tirhuta"],["Ugaritic","Ugaritic"],["Vai","Vai"],["Warang_Citi","Warang_Citi"],["Old_Persian","Old_Persian"],["Cuneiform","Cuneiform"],["Yi","Yi"],["Zanabazar_Square","Zanabazar_Square"],["Inherited","Inherited"],["Common","Common"],["Unknown","Unknown"]])]]);const propertyToValueAliases=mappings,matchPropertyValue=function(o,e){const s=propertyToValueAliases.get(o);if(!s)throw new Error(`Unknown property \`${o}\`.`);const a=s.get(e);if(a)return a;throw new Error(`Unknown value \`${e}\` for property \`${o}\`.`)};var unicodeMatchPropertyValueEcmascript=matchPropertyValue,unicodeCanonicalPropertyNamesEcmascript=new Set(["General_Category","Script","Script_Extensions","Alphabetic","Any","ASCII","ASCII_Hex_Digit","Assigned","Bidi_Control","Bidi_Mirrored","Case_Ignorable","Cased","Changes_When_Casefolded","Changes_When_Casemapped","Changes_When_Lowercased","Changes_When_NFKC_Casefolded","Changes_When_Titlecased","Changes_When_Uppercased","Dash","Default_Ignorable_Code_Point","Deprecated","Diacritic","Emoji","Emoji_Component","Emoji_Modifier","Emoji_Modifier_Base","Emoji_Presentation","Extended_Pictographic","Extender","Grapheme_Base","Grapheme_Extend","Hex_Digit","ID_Continue","ID_Start","Ideographic","IDS_Binary_Operator","IDS_Trinary_Operator","Join_Control","Logical_Order_Exception","Lowercase","Math","Noncharacter_Code_Point","Pattern_Syntax","Pattern_White_Space","Quotation_Mark","Radical","Regional_Indicator","Sentence_Terminal","Soft_Dotted","Terminal_Punctuation","Unified_Ideograph","Uppercase","Variation_Selector","White_Space","XID_Continue","XID_Start"]),unicodePropertyAliasesEcmascript=new Map([["scx","Script_Extensions"],["sc","Script"],["gc","General_Category"],["AHex","ASCII_Hex_Digit"],["Alpha","Alphabetic"],["Bidi_C","Bidi_Control"],["Bidi_M","Bidi_Mirrored"],["Cased","Cased"],["CI","Case_Ignorable"],["CWCF","Changes_When_Casefolded"],["CWCM","Changes_When_Casemapped"],["CWKCF","Changes_When_NFKC_Casefolded"],["CWL","Changes_When_Lowercased"],["CWT","Changes_When_Titlecased"],["CWU","Changes_When_Uppercased"],["Dash","Dash"],["Dep","Deprecated"],["DI","Default_Ignorable_Code_Point"],["Dia","Diacritic"],["Ext","Extender"],["Gr_Base","Grapheme_Base"],["Gr_Ext","Grapheme_Extend"],["Hex","Hex_Digit"],["IDC","ID_Continue"],["Ideo","Ideographic"],["IDS","ID_Start"],["IDSB","IDS_Binary_Operator"],["IDST","IDS_Trinary_Operator"],["Join_C","Join_Control"],["LOE","Logical_Order_Exception"],["Lower","Lowercase"],["Math","Math"],["NChar","Noncharacter_Code_Point"],["Pat_Syn","Pattern_Syntax"],["Pat_WS","Pattern_White_Space"],["QMark","Quotation_Mark"],["Radical","Radical"],["RI","Regional_Indicator"],["SD","Soft_Dotted"],["STerm","Sentence_Terminal"],["Term","Terminal_Punctuation"],["UIdeo","Unified_Ideograph"],["Upper","Uppercase"],["VS","Variation_Selector"],["WSpace","White_Space"],["space","White_Space"],["XIDC","XID_Continue"],["XIDS","XID_Start"]]);const canonicalProperties=unicodeCanonicalPropertyNamesEcmascript,propertyAliases=unicodePropertyAliasesEcmascript,matchProperty=function(o){if(canonicalProperties.has(o))return o;if(propertyAliases.has(o))return propertyAliases.get(o);throw new Error(`Unknown property: ${o}`)};var unicodeMatchPropertyEcmascript=matchProperty,unicode$1={};Object.defineProperty(unicode$1,"__esModule",{value:!0});unicode$1.whitespaceArray=[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];unicode$1.whitespaceBool=[!1,!1,!1,!1,!1,!1,!1,!1,!1,!0,!1,!0,!0,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!0,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1];unicode$1.idStartLargeRegex=/^[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA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uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uD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,!0,!1,!1,!1,!1,!1];unicode$1.idContinueLargeRegex=/^[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5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37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-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CBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-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!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!0,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!1,!1,!1,!1,!1,!1,!1,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!1,!1,!1,!1,!0,!1,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!1,!1,!1,!1,!1];Object.defineProperty(dist$6,"__esModule",{value:!0});var _createClass$d=function(){function o(e,s){for(var a=0;a=this.pattern.length}},{key:"backreference",value:function(s){s>this.largestBackreference&&(this.largestBackreference=s)}},{key:"nextCodePoint",value:function(){return this.empty()?null:this.unicode?String.fromCodePoint(this.pattern.codePointAt(this.index)):this.pattern.charAt(this.index)}},{key:"skipCodePoint",value:function(){this.index+=this.nextCodePoint().length}},{key:"eat",value:function(s){return this.index+s.length>this.pattern.length||this.pattern.slice(this.index,this.index+s.length)!==s?!1:(this.index+=s.length,!0)}},{key:"eatIdentifierCodePoint",value:function(){var s=void 0,a=this.index,c=void 0;if(this.match("\\u")){if(this.skipCodePoint(),s=acceptUnicodeEscape(this),!s.matched)return this.index=a,null;s=s.value,c=String.fromCodePoint(s)}else{if(c=this.nextCodePoint(),c==null)return this.index=a,null;this.index+=c.length,s=c.codePointAt(0)}return{character:c,characterValue:s}}},{key:"eatIdentifierStart",value:function(){var s=this.index,a=this.eatIdentifierCodePoint();return a===null?(this.index=s,null):a.character==="_"||a.character==="$"||isIdentifierStart(a.characterValue)?a.character:(this.index=s,null)}},{key:"eatIdentifierPart",value:function(){var s=this.index,a=this.eatIdentifierCodePoint();return a===null?(this.index=s,null):a.character==="\u200C"||a.character==="\u200D"||a.character==="$"||isIdentifierPart(a.characterValue)?a.character:(this.index=s,null)}},{key:"eatAny",value:function(){for(var s=arguments.length,a=Array(s),c=0;c1&&arguments[1]!==void 0?arguments[1]:{},s=e.unicode,a=s===void 0?!1:s,c=new PatternAcceptorState(o,a),h=acceptDisjunction(c);if(h.matched){if(c.unicode&&c.largestBackreference>c.capturingGroups)return!1;if(c.groupingNames.length>0||c.unicode){var d=!0,g=!1,_=void 0;try{for(var b=c.backreferenceNames[Symbol.iterator](),$;!(d=($=b.next()).done);d=!0){var j=$.value;if(c.groupingNames.indexOf(j)===-1)return!1}}catch(_e){g=!0,_=_e}finally{try{!d&&b.return&&b.return()}finally{if(g)throw _}}}}return h.matched};var backtrackOnFailure=function(e){return function(s){var a=s.index,c=s.largestBackreference,h=s.capturingGroups,d=e(s);return d.matched||(s.index=a,s.largestBackreference=c,s.capturingGroups=h),d}},acceptUnicodeEscape=backtrackOnFailure(function(o){if(!o.eat("u"))return{matched:!1};if(o.unicode&&o.eat("{")){for(var e=[];!o.eat("}");){var s=o.eatAny.apply(o,_toConsumableArray$6(hexDigits));if(s===null)return{matched:!1};e.push(s)}var a=parseInt(e.join(""),16);return a>1114111?{matched:!1}:{matched:!0,value:a}}var c=[0,0,0,0].map(function(){return o.eatAny.apply(o,_toConsumableArray$6(hexDigits))});if(c.some(function(g){return g===null}))return{matched:!1};var h=parseInt(c.join(""),16);if(o.unicode&&h>=55296&&h<=56319){var d=backtrackOnFailure(function(g){if(!g.eat("\\u"))return{matched:!1};var _=[0,0,0,0].map(function(){return g.eatAny.apply(g,_toConsumableArray$6(hexDigits))});if(_.some(function($){return $===null}))return{matched:!1};var b=parseInt(_.join(""),16);return b<56320||b>=57344?{matched:!1}:{matched:!0,value:65536+((h&1023)<<10)+(b&1023)}})(o);if(d.matched)return d}return{matched:!0,value:h}}),acceptDisjunction=function(e,s){do{if(s!==void 0&&e.eat(s))return{matched:!0};if(e.match("|"))continue;if(!acceptAlternative(e,s).matched)return{matched:!1}}while(e.eat("|"));return{matched:s===void 0||!!e.eat(s)}},acceptAlternative=function(e,s){for(;!e.match("|")&&!e.empty()&&(s===void 0||!e.match(s));)if(!acceptTerm(e).matched)return{matched:!1};return{matched:!0}},anyOf=function(){for(var e=arguments.length,s=Array(e),a=0;aparseInt(d))return{matched:!1}}return c.eat("}")?(c.eat("?"),{matched:!0}):{matched:!1}})(s);return a.matched?a:{matched:!s.unicode}}else s.eatAny("*","+","?")&&s.eat("?");return{matched:!0}})},acceptCharacterExcept=function(e){return function(s){var a=s.nextCodePoint();return a===null||e.indexOf(a)!==-1?{matched:!1}:(s.skipCodePoint(),{matched:!0})}},acceptPatternCharacter=acceptCharacterExcept(syntaxCharacters),acceptExtendedPatternCharacter=acceptCharacterExcept(extendedSyntaxCharacters),acceptInvalidBracedQuantifier=function(e){return backtrackOnFailure(function(s){return{matched:!!(s.eat("{")&&acceptDecimal(s).matched&&(!s.eat(",")||s.match("}")||acceptDecimal(s).matched)&&s.eat("}"))}})(e)},acceptAtom=function(e){if(e.unicode)return anyOf(acceptPatternCharacter,function(a){return{matched:!!a.eat(".")}},backtrackOnFailure(function(a){return a.eat("\\")?acceptAtomEscape(a):{matched:!1}}),acceptCharacterClass,acceptLabeledGroup(function(a){return a.eat("?:")}),acceptGrouping)(e);var s=anyOf(function(a){return{matched:!!a.eat(".")}},backtrackOnFailure(function(a){return a.eat("\\")?acceptAtomEscape(a):{matched:!1}}),backtrackOnFailure(function(a){return{matched:a.eat("\\")&&a.match("c")}}),acceptCharacterClass,acceptLabeledGroup(function(a){return a.eat("?:")}),acceptGrouping)(e);return!s.matched&&acceptInvalidBracedQuantifier(e).matched?{matched:!1}:s.matched?s:acceptExtendedPatternCharacter(e)},acceptGrouping=backtrackOnFailure(function(o){if(!o.eat("("))return{matched:!1};var e=backtrackOnFailure(function(s){return o.eat("?")?acceptGroupName(s):{matched:!1}})(o);if(!acceptDisjunction(o,")").matched)return{matched:!1};if(e.matched){if(o.groupingNames.indexOf(e.data)!==-1)return{matched:!1};o.groupingNames.push(e.data)}return o.capturingGroups++,{matched:!0}}),acceptDecimalEscape=backtrackOnFailure(function(o){var e=o.eatAny.apply(o,_toConsumableArray$6(decimalDigits));return e===null?{matched:!1}:e==="0"?{matched:!0}:(o.backreference(parseInt(e+(o.eatNaturalNumber()||""))),{matched:!0})}),acceptCharacterClassEscape=function(e){return e.eatAny("d","D","s","S","w","W")?{matched:!0}:e.unicode?backtrackOnFailure(function(s){return!s.eat("p{")&&!s.eat("P{")?{matched:!1}:acceptUnicodePropertyValueExpression(s).matched?{matched:!!s.eat("}")}:{matched:!1}})(e):{matched:!1}},acceptUnicodePropertyName=function(e){for(var s=[],a=void 0;a=e.eatAny.apply(e,_toConsumableArray$6(controlCharacters).concat(["_"]));)s.push(a);return{matched:s.length>0,data:s.join("")}},acceptUnicodePropertyValue=function(e){for(var s=[],a=void 0;a=e.eatAny.apply(e,_toConsumableArray$6(controlCharacters).concat(_toConsumableArray$6(decimalDigits),["_"]));)s.push(a);return{matched:s.length>0,data:s.join("")}},illegalLoneUnicodePropertyNames=["General_Category","Script","Script_Extensions","scx","sc","gc"],generalCategoryValues=_mappings2.default.get("General_Category"),acceptLoneUnicodePropertyNameOrValue=function(e){var s=acceptUnicodePropertyValue(e);return!s.matched||illegalLoneUnicodePropertyNames.includes(s.data)?{matched:!1}:{matched:catchIsFalse(function(){return(0,_unicodeMatchPropertyEcmascript2.default)(s.data)})||generalCategoryValues.get(s.data)!=null}},acceptUnicodePropertyValueExpression=function(e){return anyOf(backtrackOnFailure(function(s){var a=acceptUnicodePropertyName(s);if(!a.matched||!s.eat("="))return{matched:!1};var c=acceptUnicodePropertyValue(s);return c.matched?{matched:catchIsFalse(function(){return(0,_unicodeMatchPropertyValueEcmascript2.default)(_unicodePropertyAliasesEcmascript2.default.get(a.data)||a.data,c.data)})}:{matched:!1}}),backtrackOnFailure(acceptLoneUnicodePropertyNameOrValue))(e)},acceptCharacterEscape=anyOf(function(o){var e=o.eatAny.apply(o,_toConsumableArray$6(controlEscapeCharacters));return e===null?{matched:!1}:{matched:!0,value:controlEscapeCharacterValues[e]}},backtrackOnFailure(function(o){if(!o.eat("c"))return{matched:!1};var e=o.eatAny.apply(o,_toConsumableArray$6(controlCharacters));return e===null?{matched:!1}:{matched:!0,value:e.charCodeAt(0)%32}}),backtrackOnFailure(function(o){return!o.eat("0")||o.eatAny.apply(o,_toConsumableArray$6(decimalDigits))?{matched:!1}:{matched:!0,value:0}}),backtrackOnFailure(function(o){if(!o.eat("x"))return{matched:!1};var e=[0,0].map(function(){return o.eatAny.apply(o,_toConsumableArray$6(hexDigits))});return e.some(function(s){return s===null})?{matched:!1}:{matched:!0,value:parseInt(e.join(""),16)}}),acceptUnicodeEscape,backtrackOnFailure(function(o){if(o.unicode)return{matched:!1};var e=o.eatAny.apply(o,_toConsumableArray$6(octalDigits));if(e===null)return{matched:!1};var s=parseInt(e,8);if(octalDigits.indexOf(o.nextCodePoint())===-1)return{matched:!0,value:s};var a=o.eatAny.apply(o,_toConsumableArray$6(octalDigits)),c=parseInt(a,8);if(s<4){if(octalDigits.indexOf(o.nextCodePoint())===-1)return{matched:!0,value:s<<3|c};var h=o.eatAny.apply(o,_toConsumableArray$6(octalDigits)),d=parseInt(h,8);return{matched:!0,value:s<<6|c<<3|d}}return{matched:!0,value:s<<3|c}}),backtrackOnFailure(function(o){if(!o.unicode)return{matched:!1};var e=o.eatAny.apply(o,_toConsumableArray$6(syntaxCharacters));return e===null?{matched:!1}:{matched:!0,value:e.charCodeAt(0)}}),function(o){return!o.unicode||!o.eat("/")?{matched:!1}:{matched:!0,value:"/".charCodeAt(0)}},backtrackOnFailure(function(o){if(o.unicode)return{matched:!1};var e=o.nextCodePoint();return e!==null&&e!=="c"&&e!=="k"?(o.skipCodePoint(),{matched:!0,value:e.codePointAt(0)}):{matched:!1}})),acceptGroupNameBackreference=backtrackOnFailure(function(o){if(!o.eat("k"))return{matched:!1};var e=acceptGroupName(o);return e.matched?(o.backreferenceNames.push(e.data),{matched:!0}):(o.backreferenceNames.push(INVALID_NAMED_BACKREFERENCE_SENTINEL),{matched:!0})}),acceptGroupName=backtrackOnFailure(function(o){if(!o.eat("<"))return{matched:!1};var e=[],s=o.eatIdentifierStart();if(!s)return{matched:!1};e.push(s);for(var a=void 0;a=o.eatIdentifierPart();)e.push(a);return o.eat(">")?{matched:e.length>0,data:e.join("")}:{matched:!1}}),acceptAtomEscape=anyOf(acceptDecimalEscape,acceptCharacterClassEscape,acceptCharacterEscape,acceptGroupNameBackreference),acceptCharacterClass=backtrackOnFailure(function(o){if(!o.eat("["))return{matched:!1};o.eat("^");var e=anyOf(function(_){return{matched:!!_.eat("b"),value:8}},function(_){return{matched:_.unicode&&!!_.eat("-"),value:"-".charCodeAt(0)}},backtrackOnFailure(function(_){if(_.unicode||!_.eat("c"))return{matched:!1};var b=_.eatAny.apply(_,_toConsumableArray$6(decimalDigits).concat(["_"]));return b===null?{matched:!1}:{matched:!0,value:b.charCodeAt(0)%32}}),acceptCharacterClassEscape,acceptCharacterEscape,function(_){return{matched:!_.unicode&&!!_.eat("k"),value:107}}),s=function(b){var $=b.nextCodePoint();if($==="]"||$==="-"||$===null)return{matched:!1};if($!=="\\")return b.skipCodePoint(),{matched:!0,value:$.codePointAt(0)};b.eat("\\");var j=e(b);return!j.matched&&b.nextCodePoint()==="c"&&!b.unicode?{matched:!0,value:"\\".charCodeAt(0)}:j},a=function(b){return b.eat("-")?{matched:!0,value:"-".charCodeAt(0)}:s(b)},c=function(b,$){var j=function(tt){return tt.value===void 0&&tt.matched};if(b.eat("-")){if(b.match("]"))return{matched:!0};var _e=a(b);return _e.matched?b.unicode&&(j($)||j(_e))?{matched:!1}:!(!b.unicode&&(j($)||j(_e)))&&$.value>_e.value?{matched:!1}:b.match("]")?{matched:!0}:h(b):{matched:!1}}return b.match("]")?{matched:!0}:d(b)},h=function(b){var $=a(b);return $.matched?c(b,$):{matched:!1}},d=function(b){var $=s(b);return $.matched?c(b,$):{matched:!1}};if(o.eat("]"))return{matched:!0};var g=h(o);return g.matched&&o.eat("]"),g}),dist$5={};Object.defineProperty(dist$5,"__esModule",{value:!0});function _classCallCheck$g(o,e){if(!(o instanceof e))throw new TypeError("Cannot call a class as a function")}dist$5.ArrayAssignmentTarget=function o(e){var s=e.elements,a=e.rest;_classCallCheck$g(this,o),this.type="ArrayAssignmentTarget",this.elements=s,this.rest=a};dist$5.ArrayBinding=function o(e){var s=e.elements,a=e.rest;_classCallCheck$g(this,o),this.type="ArrayBinding",this.elements=s,this.rest=a};dist$5.ArrayExpression=function o(e){var s=e.elements;_classCallCheck$g(this,o),this.type="ArrayExpression",this.elements=s};dist$5.ArrowExpression=function o(e){var s=e.isAsync,a=e.params,c=e.body;_classCallCheck$g(this,o),this.type="ArrowExpression",this.isAsync=s,this.params=a,this.body=c};dist$5.AssignmentExpression=function o(e){var s=e.binding,a=e.expression;_classCallCheck$g(this,o),this.type="AssignmentExpression",this.binding=s,this.expression=a};dist$5.AssignmentTargetIdentifier=function o(e){var s=e.name;_classCallCheck$g(this,o),this.type="AssignmentTargetIdentifier",this.name=s};dist$5.AssignmentTargetPropertyIdentifier=function o(e){var s=e.binding,a=e.init;_classCallCheck$g(this,o),this.type="AssignmentTargetPropertyIdentifier",this.binding=s,this.init=a};dist$5.AssignmentTargetPropertyProperty=function o(e){var s=e.name,a=e.binding;_classCallCheck$g(this,o),this.type="AssignmentTargetPropertyProperty",this.name=s,this.binding=a};dist$5.AssignmentTargetWithDefault=function o(e){var s=e.binding,a=e.init;_classCallCheck$g(this,o),this.type="AssignmentTargetWithDefault",this.binding=s,this.init=a};dist$5.AwaitExpression=function o(e){var s=e.expression;_classCallCheck$g(this,o),this.type="AwaitExpression",this.expression=s};dist$5.BinaryExpression=function o(e){var s=e.left,a=e.operator,c=e.right;_classCallCheck$g(this,o),this.type="BinaryExpression",this.left=s,this.operator=a,this.right=c};dist$5.BindingIdentifier=function o(e){var s=e.name;_classCallCheck$g(this,o),this.type="BindingIdentifier",this.name=s};dist$5.BindingPropertyIdentifier=function o(e){var s=e.binding,a=e.init;_classCallCheck$g(this,o),this.type="BindingPropertyIdentifier",this.binding=s,this.init=a};dist$5.BindingPropertyProperty=function o(e){var s=e.name,a=e.binding;_classCallCheck$g(this,o),this.type="BindingPropertyProperty",this.name=s,this.binding=a};dist$5.BindingWithDefault=function o(e){var s=e.binding,a=e.init;_classCallCheck$g(this,o),this.type="BindingWithDefault",this.binding=s,this.init=a};dist$5.Block=function o(e){var s=e.statements;_classCallCheck$g(this,o),this.type="Block",this.statements=s};dist$5.BlockStatement=function o(e){var s=e.block;_classCallCheck$g(this,o),this.type="BlockStatement",this.block=s};dist$5.BreakStatement=function o(e){var s=e.label;_classCallCheck$g(this,o),this.type="BreakStatement",this.label=s};dist$5.CallExpression=function o(e){var s=e.callee,a=e.arguments;_classCallCheck$g(this,o),this.type="CallExpression",this.callee=s,this.arguments=a};dist$5.CatchClause=function o(e){var s=e.binding,a=e.body;_classCallCheck$g(this,o),this.type="CatchClause",this.binding=s,this.body=a};dist$5.ClassDeclaration=function o(e){var s=e.name,a=e.super,c=e.elements;_classCallCheck$g(this,o),this.type="ClassDeclaration",this.name=s,this.super=a,this.elements=c};dist$5.ClassElement=function o(e){var s=e.isStatic,a=e.method;_classCallCheck$g(this,o),this.type="ClassElement",this.isStatic=s,this.method=a};dist$5.ClassExpression=function o(e){var s=e.name,a=e.super,c=e.elements;_classCallCheck$g(this,o),this.type="ClassExpression",this.name=s,this.super=a,this.elements=c};dist$5.CompoundAssignmentExpression=function o(e){var s=e.binding,a=e.operator,c=e.expression;_classCallCheck$g(this,o),this.type="CompoundAssignmentExpression",this.binding=s,this.operator=a,this.expression=c};dist$5.ComputedMemberAssignmentTarget=function o(e){var s=e.object,a=e.expression;_classCallCheck$g(this,o),this.type="ComputedMemberAssignmentTarget",this.object=s,this.expression=a};dist$5.ComputedMemberExpression=function o(e){var s=e.object,a=e.expression;_classCallCheck$g(this,o),this.type="ComputedMemberExpression",this.object=s,this.expression=a};dist$5.ComputedPropertyName=function o(e){var s=e.expression;_classCallCheck$g(this,o),this.type="ComputedPropertyName",this.expression=s};dist$5.ConditionalExpression=function o(e){var s=e.test,a=e.consequent,c=e.alternate;_classCallCheck$g(this,o),this.type="ConditionalExpression",this.test=s,this.consequent=a,this.alternate=c};dist$5.ContinueStatement=function o(e){var s=e.label;_classCallCheck$g(this,o),this.type="ContinueStatement",this.label=s};dist$5.DataProperty=function o(e){var s=e.name,a=e.expression;_classCallCheck$g(this,o),this.type="DataProperty",this.name=s,this.expression=a};dist$5.DebuggerStatement=function o(){_classCallCheck$g(this,o),this.type="DebuggerStatement"};dist$5.Directive=function o(e){var s=e.rawValue;_classCallCheck$g(this,o),this.type="Directive",this.rawValue=s};dist$5.DoWhileStatement=function o(e){var s=e.body,a=e.test;_classCallCheck$g(this,o),this.type="DoWhileStatement",this.body=s,this.test=a};dist$5.EmptyStatement=function o(){_classCallCheck$g(this,o),this.type="EmptyStatement"};dist$5.Export=function o(e){var s=e.declaration;_classCallCheck$g(this,o),this.type="Export",this.declaration=s};dist$5.ExportAllFrom=function o(e){var s=e.moduleSpecifier;_classCallCheck$g(this,o),this.type="ExportAllFrom",this.moduleSpecifier=s};dist$5.ExportDefault=function o(e){var s=e.body;_classCallCheck$g(this,o),this.type="ExportDefault",this.body=s};dist$5.ExportFrom=function o(e){var s=e.namedExports,a=e.moduleSpecifier;_classCallCheck$g(this,o),this.type="ExportFrom",this.namedExports=s,this.moduleSpecifier=a};dist$5.ExportFromSpecifier=function o(e){var s=e.name,a=e.exportedName;_classCallCheck$g(this,o),this.type="ExportFromSpecifier",this.name=s,this.exportedName=a};dist$5.ExportLocalSpecifier=function o(e){var s=e.name,a=e.exportedName;_classCallCheck$g(this,o),this.type="ExportLocalSpecifier",this.name=s,this.exportedName=a};dist$5.ExportLocals=function o(e){var s=e.namedExports;_classCallCheck$g(this,o),this.type="ExportLocals",this.namedExports=s};dist$5.ExpressionStatement=function o(e){var s=e.expression;_classCallCheck$g(this,o),this.type="ExpressionStatement",this.expression=s};dist$5.ForAwaitStatement=function o(e){var s=e.left,a=e.right,c=e.body;_classCallCheck$g(this,o),this.type="ForAwaitStatement",this.left=s,this.right=a,this.body=c};dist$5.ForInStatement=function o(e){var s=e.left,a=e.right,c=e.body;_classCallCheck$g(this,o),this.type="ForInStatement",this.left=s,this.right=a,this.body=c};dist$5.ForOfStatement=function o(e){var s=e.left,a=e.right,c=e.body;_classCallCheck$g(this,o),this.type="ForOfStatement",this.left=s,this.right=a,this.body=c};dist$5.ForStatement=function o(e){var s=e.init,a=e.test,c=e.update,h=e.body;_classCallCheck$g(this,o),this.type="ForStatement",this.init=s,this.test=a,this.update=c,this.body=h};dist$5.FormalParameters=function o(e){var s=e.items,a=e.rest;_classCallCheck$g(this,o),this.type="FormalParameters",this.items=s,this.rest=a};dist$5.FunctionBody=function o(e){var s=e.directives,a=e.statements;_classCallCheck$g(this,o),this.type="FunctionBody",this.directives=s,this.statements=a};dist$5.FunctionDeclaration=function o(e){var s=e.isAsync,a=e.isGenerator,c=e.name,h=e.params,d=e.body;_classCallCheck$g(this,o),this.type="FunctionDeclaration",this.isAsync=s,this.isGenerator=a,this.name=c,this.params=h,this.body=d};dist$5.FunctionExpression=function o(e){var s=e.isAsync,a=e.isGenerator,c=e.name,h=e.params,d=e.body;_classCallCheck$g(this,o),this.type="FunctionExpression",this.isAsync=s,this.isGenerator=a,this.name=c,this.params=h,this.body=d};dist$5.Getter=function o(e){var s=e.name,a=e.body;_classCallCheck$g(this,o),this.type="Getter",this.name=s,this.body=a};dist$5.IdentifierExpression=function o(e){var s=e.name;_classCallCheck$g(this,o),this.type="IdentifierExpression",this.name=s};dist$5.IfStatement=function o(e){var s=e.test,a=e.consequent,c=e.alternate;_classCallCheck$g(this,o),this.type="IfStatement",this.test=s,this.consequent=a,this.alternate=c};dist$5.Import=function o(e){var s=e.defaultBinding,a=e.namedImports,c=e.moduleSpecifier;_classCallCheck$g(this,o),this.type="Import",this.defaultBinding=s,this.namedImports=a,this.moduleSpecifier=c};dist$5.ImportNamespace=function o(e){var s=e.defaultBinding,a=e.namespaceBinding,c=e.moduleSpecifier;_classCallCheck$g(this,o),this.type="ImportNamespace",this.defaultBinding=s,this.namespaceBinding=a,this.moduleSpecifier=c};dist$5.ImportSpecifier=function o(e){var s=e.name,a=e.binding;_classCallCheck$g(this,o),this.type="ImportSpecifier",this.name=s,this.binding=a};dist$5.LabeledStatement=function o(e){var s=e.label,a=e.body;_classCallCheck$g(this,o),this.type="LabeledStatement",this.label=s,this.body=a};dist$5.LiteralBooleanExpression=function o(e){var s=e.value;_classCallCheck$g(this,o),this.type="LiteralBooleanExpression",this.value=s};dist$5.LiteralInfinityExpression=function o(){_classCallCheck$g(this,o),this.type="LiteralInfinityExpression"};dist$5.LiteralNullExpression=function o(){_classCallCheck$g(this,o),this.type="LiteralNullExpression"};dist$5.LiteralNumericExpression=function o(e){var s=e.value;_classCallCheck$g(this,o),this.type="LiteralNumericExpression",this.value=s};dist$5.LiteralRegExpExpression=function o(e){var s=e.pattern,a=e.global,c=e.ignoreCase,h=e.multiLine,d=e.dotAll,g=e.unicode,_=e.sticky;_classCallCheck$g(this,o),this.type="LiteralRegExpExpression",this.pattern=s,this.global=a,this.ignoreCase=c,this.multiLine=h,this.dotAll=d,this.unicode=g,this.sticky=_};dist$5.LiteralStringExpression=function o(e){var s=e.value;_classCallCheck$g(this,o),this.type="LiteralStringExpression",this.value=s};dist$5.Method=function o(e){var s=e.isAsync,a=e.isGenerator,c=e.name,h=e.params,d=e.body;_classCallCheck$g(this,o),this.type="Method",this.isAsync=s,this.isGenerator=a,this.name=c,this.params=h,this.body=d};dist$5.Module=function o(e){var s=e.directives,a=e.items;_classCallCheck$g(this,o),this.type="Module",this.directives=s,this.items=a};dist$5.NewExpression=function o(e){var s=e.callee,a=e.arguments;_classCallCheck$g(this,o),this.type="NewExpression",this.callee=s,this.arguments=a};dist$5.NewTargetExpression=function o(){_classCallCheck$g(this,o),this.type="NewTargetExpression"};dist$5.ObjectAssignmentTarget=function o(e){var s=e.properties,a=e.rest;_classCallCheck$g(this,o),this.type="ObjectAssignmentTarget",this.properties=s,this.rest=a};dist$5.ObjectBinding=function o(e){var s=e.properties,a=e.rest;_classCallCheck$g(this,o),this.type="ObjectBinding",this.properties=s,this.rest=a};dist$5.ObjectExpression=function o(e){var s=e.properties;_classCallCheck$g(this,o),this.type="ObjectExpression",this.properties=s};dist$5.ReturnStatement=function o(e){var s=e.expression;_classCallCheck$g(this,o),this.type="ReturnStatement",this.expression=s};dist$5.Script=function o(e){var s=e.directives,a=e.statements;_classCallCheck$g(this,o),this.type="Script",this.directives=s,this.statements=a};dist$5.Setter=function o(e){var s=e.name,a=e.param,c=e.body;_classCallCheck$g(this,o),this.type="Setter",this.name=s,this.param=a,this.body=c};dist$5.ShorthandProperty=function o(e){var s=e.name;_classCallCheck$g(this,o),this.type="ShorthandProperty",this.name=s};dist$5.SpreadElement=function o(e){var s=e.expression;_classCallCheck$g(this,o),this.type="SpreadElement",this.expression=s};dist$5.SpreadProperty=function o(e){var s=e.expression;_classCallCheck$g(this,o),this.type="SpreadProperty",this.expression=s};dist$5.StaticMemberAssignmentTarget=function o(e){var s=e.object,a=e.property;_classCallCheck$g(this,o),this.type="StaticMemberAssignmentTarget",this.object=s,this.property=a};dist$5.StaticMemberExpression=function o(e){var s=e.object,a=e.property;_classCallCheck$g(this,o),this.type="StaticMemberExpression",this.object=s,this.property=a};dist$5.StaticPropertyName=function o(e){var s=e.value;_classCallCheck$g(this,o),this.type="StaticPropertyName",this.value=s};dist$5.Super=function o(){_classCallCheck$g(this,o),this.type="Super"};dist$5.SwitchCase=function o(e){var s=e.test,a=e.consequent;_classCallCheck$g(this,o),this.type="SwitchCase",this.test=s,this.consequent=a};dist$5.SwitchDefault=function o(e){var s=e.consequent;_classCallCheck$g(this,o),this.type="SwitchDefault",this.consequent=s};dist$5.SwitchStatement=function o(e){var s=e.discriminant,a=e.cases;_classCallCheck$g(this,o),this.type="SwitchStatement",this.discriminant=s,this.cases=a};dist$5.SwitchStatementWithDefault=function o(e){var s=e.discriminant,a=e.preDefaultCases,c=e.defaultCase,h=e.postDefaultCases;_classCallCheck$g(this,o),this.type="SwitchStatementWithDefault",this.discriminant=s,this.preDefaultCases=a,this.defaultCase=c,this.postDefaultCases=h};dist$5.TemplateElement=function o(e){var s=e.rawValue;_classCallCheck$g(this,o),this.type="TemplateElement",this.rawValue=s};dist$5.TemplateExpression=function o(e){var s=e.tag,a=e.elements;_classCallCheck$g(this,o),this.type="TemplateExpression",this.tag=s,this.elements=a};dist$5.ThisExpression=function o(){_classCallCheck$g(this,o),this.type="ThisExpression"};dist$5.ThrowStatement=function o(e){var s=e.expression;_classCallCheck$g(this,o),this.type="ThrowStatement",this.expression=s};dist$5.TryCatchStatement=function o(e){var s=e.body,a=e.catchClause;_classCallCheck$g(this,o),this.type="TryCatchStatement",this.body=s,this.catchClause=a};dist$5.TryFinallyStatement=function o(e){var s=e.body,a=e.catchClause,c=e.finalizer;_classCallCheck$g(this,o),this.type="TryFinallyStatement",this.body=s,this.catchClause=a,this.finalizer=c};dist$5.UnaryExpression=function o(e){var s=e.operator,a=e.operand;_classCallCheck$g(this,o),this.type="UnaryExpression",this.operator=s,this.operand=a};dist$5.UpdateExpression=function o(e){var s=e.isPrefix,a=e.operator,c=e.operand;_classCallCheck$g(this,o),this.type="UpdateExpression",this.isPrefix=s,this.operator=a,this.operand=c};dist$5.VariableDeclaration=function o(e){var s=e.kind,a=e.declarators;_classCallCheck$g(this,o),this.type="VariableDeclaration",this.kind=s,this.declarators=a};dist$5.VariableDeclarationStatement=function o(e){var s=e.declaration;_classCallCheck$g(this,o),this.type="VariableDeclarationStatement",this.declaration=s};dist$5.VariableDeclarator=function o(e){var s=e.binding,a=e.init;_classCallCheck$g(this,o),this.type="VariableDeclarator",this.binding=s,this.init=a};dist$5.WhileStatement=function o(e){var s=e.test,a=e.body;_classCallCheck$g(this,o),this.type="WhileStatement",this.test=s,this.body=a};dist$5.WithStatement=function o(e){var s=e.object,a=e.body;_classCallCheck$g(this,o),this.type="WithStatement",this.object=s,this.body=a};dist$5.YieldExpression=function o(e){var s=e.expression;_classCallCheck$g(this,o),this.type="YieldExpression",this.expression=s};dist$5.YieldGeneratorExpression=function o(e){var s=e.expression;_classCallCheck$g(this,o),this.type="YieldGeneratorExpression",this.expression=s};Object.defineProperty(parser$1,"__esModule",{value:!0});parser$1.GenericParser=void 0;var _createClass$c=function(){function o(e,s){for(var a=0;a":Precedence$1.Relational,"<=":Precedence$1.Relational,">=":Precedence$1.Relational,in:Precedence$1.Relational,instanceof:Precedence$1.Relational,"<<":Precedence$1.BitwiseSHIFT,">>":Precedence$1.BitwiseSHIFT,">>>":Precedence$1.BitwiseSHIFT,"+":Precedence$1.Additive,"-":Precedence$1.Additive,"*":Precedence$1.Multiplicative,"%":Precedence$1.Multiplicative,"/":Precedence$1.Multiplicative};function isValidSimpleAssignmentTarget(o){if(o==null)return!1;switch(o.type){case"IdentifierExpression":case"ComputedMemberExpression":case"StaticMemberExpression":return!0}return!1}function isPrefixOperator(o){switch(o.type){case _tokenizer.TokenType.INC:case _tokenizer.TokenType.DEC:case _tokenizer.TokenType.ADD:case _tokenizer.TokenType.SUB:case _tokenizer.TokenType.BIT_NOT:case _tokenizer.TokenType.NOT:case _tokenizer.TokenType.DELETE:case _tokenizer.TokenType.VOID:case _tokenizer.TokenType.TYPEOF:return!0}return!1}function isUpdateOperator(o){return o.type===_tokenizer.TokenType.INC||o.type===_tokenizer.TokenType.DEC}parser$1.GenericParser=function(o){_inherits$7(e,o);function e(s){_classCallCheck$f(this,e);var a=_possibleConstructorReturn$7(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,s));return a.allowIn=!0,a.inFunctionBody=!1,a.inParameter=!1,a.allowYieldExpression=!1,a.allowAwaitExpression=!1,a.firstAwaitLocation=null,a.module=!1,a.moduleIsTheGoalSymbol=!1,a.strict=!1,a.isBindingElement=!0,a.isAssignmentTarget=!0,a.firstExprError=null,a}return _createClass$c(e,[{key:"match",value:function(a){return this.lookahead.type===a}},{key:"matchIdentifier",value:function(){switch(this.lookahead.type){case _tokenizer.TokenType.IDENTIFIER:case _tokenizer.TokenType.LET:case _tokenizer.TokenType.YIELD:case _tokenizer.TokenType.ASYNC:return!0;case _tokenizer.TokenType.AWAIT:return this.moduleIsTheGoalSymbol?!1:(this.firstAwaitLocation===null&&(this.firstAwaitLocation=this.getLocation()),!0);case _tokenizer.TokenType.ESCAPED_KEYWORD:return this.lookahead.value==="await"&&!this.moduleIsTheGoalSymbol?(this.firstAwaitLocation===null&&(this.firstAwaitLocation=this.getLocation()),!0):this.lookahead.value==="let"||this.lookahead.value==="yield"||this.lookahead.value==="async"}return!1}},{key:"eat",value:function(a){return this.lookahead.type===a?this.lex():null}},{key:"expect",value:function(a){if(this.lookahead.type===a)return this.lex();throw this.createUnexpected(this.lookahead)}},{key:"matchContextualKeyword",value:function(a){return this.lookahead.type===_tokenizer.TokenType.IDENTIFIER&&!this.lookahead.escaped&&this.lookahead.value===a}},{key:"expectContextualKeyword",value:function(a){if(this.lookahead.type===_tokenizer.TokenType.IDENTIFIER&&!this.lookahead.escaped&&this.lookahead.value===a)return this.lex();throw this.createUnexpected(this.lookahead)}},{key:"eatContextualKeyword",value:function(a){return this.lookahead.type===_tokenizer.TokenType.IDENTIFIER&&!this.lookahead.escaped&&this.lookahead.value===a?this.lex():null}},{key:"consumeSemicolon",value:function(){if(!this.eat(_tokenizer.TokenType.SEMICOLON)&&!this.hasLineTerminatorBeforeNext&&!this.eof()&&!this.match(_tokenizer.TokenType.RBRACE))throw this.createUnexpected(this.lookahead)}},{key:"startNode",value:function(a){return a}},{key:"copyNode",value:function(a,c){return c}},{key:"finishNode",value:function(a){return a}},{key:"parseModule",value:function(){this.moduleIsTheGoalSymbol=this.module=this.strict=!0,this.lookahead=this.advance();var a=this.startNode(),c=this.parseBody(),h=c.directives,d=c.statements;if(!this.match(_tokenizer.TokenType.EOS))throw this.createUnexpected(this.lookahead);return this.finishNode(new AST.Module({directives:h,items:d}),a)}},{key:"parseScript",value:function(){this.lookahead=this.advance();var a=this.startNode(),c=this.parseBody(),h=c.directives,d=c.statements;if(!this.match(_tokenizer.TokenType.EOS))throw this.createUnexpected(this.lookahead);return this.finishNode(new AST.Script({directives:h,statements:d}),a)}},{key:"parseFunctionBody",value:function(){var a=this.inFunctionBody,c=this.module,h=this.strict;this.inFunctionBody=!0,this.module=!1;var d=this.startNode();this.expect(_tokenizer.TokenType.LBRACE);var g=new AST.FunctionBody(this.parseBody());return this.expect(_tokenizer.TokenType.RBRACE),g=this.finishNode(g,d),this.inFunctionBody=a,this.module=c,this.strict=h,g}},{key:"parseBody",value:function(){for(var a=[],c=[],h=!0,d=null;!(this.eof()||this.match(_tokenizer.TokenType.RBRACE));){var g=this.lookahead,_=g.slice.text,b=g.type===_tokenizer.TokenType.STRING,$=this.module,j=this.getLocation(),_e=this.startNode(),et=$?this.parseModuleItem():this.parseStatementListItem();if(h)if(b&&et.type==="ExpressionStatement"&&et.expression.type==="LiteralStringExpression"){!d&&g.octal&&(d=this.createErrorWithLocation(j,"Unexpected legacy octal escape sequence: \\"+g.octal));var tt=_.slice(1,-1);tt==="use strict"&&(this.strict=!0),a.push(this.finishNode(new AST.Directive({rawValue:tt}),_e))}else{if(h=!1,d&&this.strict)throw d;c.push(et)}else c.push(et)}if(d&&this.strict)throw d;return{directives:a,statements:c}}},{key:"parseImportSpecifier",value:function(){var a=this.startNode(),c=void 0;if(this.matchIdentifier()){if(c=this.parseIdentifier(),!this.eatContextualKeyword("as"))return this.finishNode(new AST.ImportSpecifier({name:null,binding:this.finishNode(new AST.BindingIdentifier({name:c}),a)}),a)}else this.lookahead.type.klass.isIdentifierName&&(c=this.parseIdentifierName(),this.expectContextualKeyword("as"));return this.finishNode(new AST.ImportSpecifier({name:c,binding:this.parseBindingIdentifier()}),a)}},{key:"parseNameSpaceBinding",value:function(){return this.expect(_tokenizer.TokenType.MUL),this.expectContextualKeyword("as"),this.parseBindingIdentifier()}},{key:"parseNamedImports",value:function(){var a=[];for(this.expect(_tokenizer.TokenType.LBRACE);!this.eat(_tokenizer.TokenType.RBRACE);)if(a.push(this.parseImportSpecifier()),!this.eat(_tokenizer.TokenType.COMMA)){this.expect(_tokenizer.TokenType.RBRACE);break}return a}},{key:"parseFromClause",value:function(){this.expectContextualKeyword("from");var a=this.expect(_tokenizer.TokenType.STRING).str;return a}},{key:"parseImportDeclaration",value:function(){var a=this.startNode(),c=null,h=void 0;if(this.expect(_tokenizer.TokenType.IMPORT),this.match(_tokenizer.TokenType.STRING))return h=this.lex().str,this.consumeSemicolon(),this.finishNode(new AST.Import({defaultBinding:null,namedImports:[],moduleSpecifier:h}),a);if(this.matchIdentifier()&&(c=this.parseBindingIdentifier(),!this.eat(_tokenizer.TokenType.COMMA))){var d=new AST.Import({defaultBinding:c,namedImports:[],moduleSpecifier:this.parseFromClause()});return this.consumeSemicolon(),this.finishNode(d,a)}if(this.match(_tokenizer.TokenType.MUL)){var g=new AST.ImportNamespace({defaultBinding:c,namespaceBinding:this.parseNameSpaceBinding(),moduleSpecifier:this.parseFromClause()});return this.consumeSemicolon(),this.finishNode(g,a)}else if(this.match(_tokenizer.TokenType.LBRACE)){var _=new AST.Import({defaultBinding:c,namedImports:this.parseNamedImports(),moduleSpecifier:this.parseFromClause()});return this.consumeSemicolon(),this.finishNode(_,a)}throw this.createUnexpected(this.lookahead)}},{key:"parseExportSpecifier",value:function(){var a=this.startNode(),c=this.finishNode({type:EXPORT_UNKNOWN_SPECIFIER,isIdentifier:this.matchIdentifier(),value:this.parseIdentifierName()},a);if(this.eatContextualKeyword("as")){var h=this.parseIdentifierName();return this.finishNode({name:c,exportedName:h},a)}return this.finishNode({name:c,exportedName:null},a)}},{key:"parseExportClause",value:function(){this.expect(_tokenizer.TokenType.LBRACE);for(var a=[];!this.eat(_tokenizer.TokenType.RBRACE);)if(a.push(this.parseExportSpecifier()),!this.eat(_tokenizer.TokenType.COMMA)){this.expect(_tokenizer.TokenType.RBRACE);break}return a}},{key:"parseExportDeclaration",value:function(){var a=this,c=this.startNode(),h=void 0;switch(this.expect(_tokenizer.TokenType.EXPORT),this.lookahead.type){case _tokenizer.TokenType.MUL:this.lex(),h=new AST.ExportAllFrom({moduleSpecifier:this.parseFromClause()}),this.consumeSemicolon();break;case _tokenizer.TokenType.LBRACE:{var d=this.parseExportClause(),g=null;this.matchContextualKeyword("from")?(g=this.parseFromClause(),h=new AST.ExportFrom({namedExports:d.map(function(j){return a.copyNode(j,new AST.ExportFromSpecifier({name:j.name.value,exportedName:j.exportedName}))}),moduleSpecifier:g})):(d.forEach(function(j){var _e=j.name;if(!_e.isIdentifier)throw a.createError(_errors$1.ErrorMessages.ILLEGAL_EXPORTED_NAME)}),h=new AST.ExportLocals({namedExports:d.map(function(j){return a.copyNode(j,new AST.ExportLocalSpecifier({name:a.copyNode(j.name,new AST.IdentifierExpression({name:j.name.value})),exportedName:j.exportedName}))})})),this.consumeSemicolon();break}case _tokenizer.TokenType.CLASS:h=new AST.Export({declaration:this.parseClass({isExpr:!1,inDefault:!1})});break;case _tokenizer.TokenType.FUNCTION:h=new AST.Export({declaration:this.parseFunction({isExpr:!1,inDefault:!1,allowGenerator:!0,isAsync:!1})});break;case _tokenizer.TokenType.ASYNC:{var _=this.startNode();this.lex(),h=new AST.Export({declaration:this.parseFunction({isExpr:!1,inDefault:!1,allowGenerator:!0,isAsync:!0,startState:_})});break}case _tokenizer.TokenType.DEFAULT:switch(this.lex(),this.lookahead.type){case _tokenizer.TokenType.FUNCTION:h=new AST.ExportDefault({body:this.parseFunction({isExpr:!1,inDefault:!0,allowGenerator:!0,isAsync:!1})});break;case _tokenizer.TokenType.CLASS:h=new AST.ExportDefault({body:this.parseClass({isExpr:!1,inDefault:!0})});break;case _tokenizer.TokenType.ASYNC:{var b=this.startNode(),$=this.saveLexerState();if(this.lex(),!this.hasLineTerminatorBeforeNext&&this.match(_tokenizer.TokenType.FUNCTION)){h=new AST.ExportDefault({body:this.parseFunction({isExpr:!1,inDefault:!0,allowGenerator:!1,isAsync:!0,startState:b})});break}this.restoreLexerState($)}default:h=new AST.ExportDefault({body:this.parseAssignmentExpression()}),this.consumeSemicolon();break}break;case _tokenizer.TokenType.VAR:case _tokenizer.TokenType.LET:case _tokenizer.TokenType.CONST:h=new AST.Export({declaration:this.parseVariableDeclaration(!0)}),this.consumeSemicolon();break;default:throw this.createUnexpected(this.lookahead)}return this.finishNode(h,c)}},{key:"parseModuleItem",value:function(){switch(this.lookahead.type){case _tokenizer.TokenType.IMPORT:return this.parseImportDeclaration();case _tokenizer.TokenType.EXPORT:return this.parseExportDeclaration();default:return this.parseStatementListItem()}}},{key:"lookaheadLexicalDeclaration",value:function(){if(this.match(_tokenizer.TokenType.LET)||this.match(_tokenizer.TokenType.CONST)){var a=this.saveLexerState();if(this.lex(),this.matchIdentifier()||this.match(_tokenizer.TokenType.LBRACE)||this.match(_tokenizer.TokenType.LBRACK))return this.restoreLexerState(a),!0;this.restoreLexerState(a)}return!1}},{key:"parseStatementListItem",value:function(){if(this.eof())throw this.createUnexpected(this.lookahead);switch(this.lookahead.type){case _tokenizer.TokenType.FUNCTION:return this.parseFunction({isExpr:!1,inDefault:!1,allowGenerator:!0,isAsync:!1});case _tokenizer.TokenType.CLASS:return this.parseClass({isExpr:!1,inDefault:!1});case _tokenizer.TokenType.ASYNC:{var a=this.getLocation(),c=this.saveLexerState();return this.lex(),!this.hasLineTerminatorBeforeNext&&this.match(_tokenizer.TokenType.FUNCTION)?this.parseFunction({isExpr:!1,inDefault:!1,allowGenerator:!0,isAsync:!0,startState:a}):(this.restoreLexerState(c),this.parseStatement())}default:if(this.lookaheadLexicalDeclaration()){var h=this.startNode();return this.finishNode(this.parseVariableDeclarationStatement(),h)}return this.parseStatement()}}},{key:"parseStatement",value:function(){var a=this.startNode(),c=this.isolateCoverGrammar(this.parseStatementHelper);return this.finishNode(c,a)}},{key:"parseStatementHelper",value:function(){if(this.eof())throw this.createUnexpected(this.lookahead);switch(this.lookahead.type){case _tokenizer.TokenType.SEMICOLON:return this.parseEmptyStatement();case _tokenizer.TokenType.LBRACE:return this.parseBlockStatement();case _tokenizer.TokenType.LPAREN:return this.parseExpressionStatement();case _tokenizer.TokenType.BREAK:return this.parseBreakStatement();case _tokenizer.TokenType.CONTINUE:return this.parseContinueStatement();case _tokenizer.TokenType.DEBUGGER:return this.parseDebuggerStatement();case _tokenizer.TokenType.DO:return this.parseDoWhileStatement();case _tokenizer.TokenType.FOR:return this.parseForStatement();case _tokenizer.TokenType.IF:return this.parseIfStatement();case _tokenizer.TokenType.RETURN:return this.parseReturnStatement();case _tokenizer.TokenType.SWITCH:return this.parseSwitchStatement();case _tokenizer.TokenType.THROW:return this.parseThrowStatement();case _tokenizer.TokenType.TRY:return this.parseTryStatement();case _tokenizer.TokenType.VAR:return this.parseVariableDeclarationStatement();case _tokenizer.TokenType.WHILE:return this.parseWhileStatement();case _tokenizer.TokenType.WITH:return this.parseWithStatement();case _tokenizer.TokenType.FUNCTION:case _tokenizer.TokenType.CLASS:throw this.createUnexpected(this.lookahead);default:{var a=this.saveLexerState();if(this.eat(_tokenizer.TokenType.LET)){if(this.match(_tokenizer.TokenType.LBRACK))throw this.restoreLexerState(a),this.createUnexpected(this.lookahead);this.restoreLexerState(a)}else if(this.eat(_tokenizer.TokenType.ASYNC)){if(!this.hasLineTerminatorBeforeNext&&this.match(_tokenizer.TokenType.FUNCTION))throw this.createUnexpected(this.lookahead);this.restoreLexerState(a)}var c=this.parseExpression();if(c.type==="IdentifierExpression"&&this.eat(_tokenizer.TokenType.COLON)){var h=this.match(_tokenizer.TokenType.FUNCTION)?this.parseFunction({isExpr:!1,inDefault:!1,allowGenerator:!1,isAsync:!1}):this.parseStatement();return new AST.LabeledStatement({label:c.name,body:h})}return this.consumeSemicolon(),new AST.ExpressionStatement({expression:c})}}}},{key:"parseEmptyStatement",value:function(){return this.lex(),new AST.EmptyStatement}},{key:"parseBlockStatement",value:function(){return new AST.BlockStatement({block:this.parseBlock()})}},{key:"parseExpressionStatement",value:function(){var a=this.parseExpression();return this.consumeSemicolon(),new AST.ExpressionStatement({expression:a})}},{key:"parseBreakStatement",value:function(){if(this.lex(),this.eat(_tokenizer.TokenType.SEMICOLON)||this.hasLineTerminatorBeforeNext)return new AST.BreakStatement({label:null});var a=null;return this.matchIdentifier()&&(a=this.parseIdentifier()),this.consumeSemicolon(),new AST.BreakStatement({label:a})}},{key:"parseContinueStatement",value:function(){if(this.lex(),this.eat(_tokenizer.TokenType.SEMICOLON)||this.hasLineTerminatorBeforeNext)return new AST.ContinueStatement({label:null});var a=null;return this.matchIdentifier()&&(a=this.parseIdentifier()),this.consumeSemicolon(),new AST.ContinueStatement({label:a})}},{key:"parseDebuggerStatement",value:function(){return this.lex(),this.consumeSemicolon(),new AST.DebuggerStatement}},{key:"parseDoWhileStatement",value:function(){this.lex();var a=this.parseStatement();this.expect(_tokenizer.TokenType.WHILE),this.expect(_tokenizer.TokenType.LPAREN);var c=this.parseExpression();return this.expect(_tokenizer.TokenType.RPAREN),this.eat(_tokenizer.TokenType.SEMICOLON),new AST.DoWhileStatement({body:a,test:c})}},{key:"parseForStatement",value:function(){this.lex();var a=this.allowAwaitExpression&&this.eat(_tokenizer.TokenType.AWAIT);this.expect(_tokenizer.TokenType.LPAREN);var c=null,h=null;if(a&&this.match(_tokenizer.TokenType.SEMICOLON))throw this.createUnexpected(this.lookahead);if(this.eat(_tokenizer.TokenType.SEMICOLON))return this.match(_tokenizer.TokenType.SEMICOLON)||(c=this.parseExpression()),this.expect(_tokenizer.TokenType.SEMICOLON),this.match(_tokenizer.TokenType.RPAREN)||(h=this.parseExpression()),new AST.ForStatement({init:null,test:c,update:h,body:this.getIteratorStatementEpilogue()});var d=this.match(_tokenizer.TokenType.LET),g=this.lookaheadLexicalDeclaration(),_=this.startNode();if(this.match(_tokenizer.TokenType.VAR)||g){var b=this.allowIn;this.allowIn=!1;var $=this.parseVariableDeclaration(!1);if(this.allowIn=b,$.declarators.length===1&&(this.match(_tokenizer.TokenType.IN)||this.matchContextualKeyword("of"))){var j=void 0,_e=$.declarators[0];if(this.match(_tokenizer.TokenType.IN)){if(a)throw this.createUnexpected(this.lookahead);if(_e.init!==null&&(this.strict||$.kind!=="var"||_e.binding.type!=="BindingIdentifier"))throw this.createError(_errors$1.ErrorMessages.INVALID_VAR_INIT_FOR_IN);j=AST.ForInStatement,this.lex(),h=this.parseExpression()}else{if(_e.init!==null)throw this.createError(a?_errors$1.ErrorMessages.INVALID_VAR_INIT_FOR_AWAIT:_errors$1.ErrorMessages.INVALID_VAR_INIT_FOR_OF);a?j=AST.ForAwaitStatement:j=AST.ForOfStatement,this.lex(),h=this.parseAssignmentExpression()}var et=this.getIteratorStatementEpilogue();return new j({left:$,right:h,body:et})}else if(a)throw this.createUnexpected(this.lookahead);if(this.expect(_tokenizer.TokenType.SEMICOLON),$.declarators.some(function(it){return it.binding.type!=="BindingIdentifier"&&it.init===null}))throw this.createError(_errors$1.ErrorMessages.UNINITIALIZED_BINDINGPATTERN_IN_FOR_INIT);return this.match(_tokenizer.TokenType.SEMICOLON)||(c=this.parseExpression()),this.expect(_tokenizer.TokenType.SEMICOLON),this.match(_tokenizer.TokenType.RPAREN)||(h=this.parseExpression()),new AST.ForStatement({init:$,test:c,update:h,body:this.getIteratorStatementEpilogue()})}var tt=this.allowIn;this.allowIn=!1;var nt=this.inheritCoverGrammar(this.parseAssignmentExpressionOrTarget);if(this.allowIn=tt,this.isAssignmentTarget&&nt.type!=="AssignmentExpression"&&(this.match(_tokenizer.TokenType.IN)||this.matchContextualKeyword("of"))){if((nt.type==="ObjectAssignmentTarget"||nt.type==="ArrayAssignmentTarget")&&(this.firstExprError=null),d&&this.matchContextualKeyword("of"))throw this.createError(a?_errors$1.ErrorMessages.INVALID_LHS_IN_FOR_AWAIT:_errors$1.ErrorMessages.INVALID_LHS_IN_FOR_OF);var st=void 0;if(this.match(_tokenizer.TokenType.IN)){if(a)throw this.createUnexpected(this.lookahead);st=AST.ForInStatement,this.lex(),h=this.parseExpression()}else a?st=AST.ForAwaitStatement:st=AST.ForOfStatement,this.lex(),h=this.parseAssignmentExpression();return new st({left:this.transformDestructuring(nt),right:h,body:this.getIteratorStatementEpilogue()})}else if(a)throw this.createError(_errors$1.ErrorMessages.INVALID_LHS_IN_FOR_AWAIT);if(this.firstExprError)throw this.firstExprError;for(;this.eat(_tokenizer.TokenType.COMMA);){var rt=this.parseAssignmentExpression();nt=this.finishNode(new AST.BinaryExpression({left:nt,operator:",",right:rt}),_)}if(this.match(_tokenizer.TokenType.IN))throw this.createError(_errors$1.ErrorMessages.INVALID_LHS_IN_FOR_IN);if(this.matchContextualKeyword("of"))throw this.createError(_errors$1.ErrorMessages.INVALID_LHS_IN_FOR_OF);return this.expect(_tokenizer.TokenType.SEMICOLON),this.match(_tokenizer.TokenType.SEMICOLON)||(c=this.parseExpression()),this.expect(_tokenizer.TokenType.SEMICOLON),this.match(_tokenizer.TokenType.RPAREN)||(h=this.parseExpression()),new AST.ForStatement({init:nt,test:c,update:h,body:this.getIteratorStatementEpilogue()})}},{key:"getIteratorStatementEpilogue",value:function(){this.expect(_tokenizer.TokenType.RPAREN);var a=this.parseStatement();return a}},{key:"parseIfStatementChild",value:function(){return this.match(_tokenizer.TokenType.FUNCTION)?this.parseFunction({isExpr:!1,inDefault:!1,allowGenerator:!1,isAsync:!1}):this.parseStatement()}},{key:"parseIfStatement",value:function(){this.lex(),this.expect(_tokenizer.TokenType.LPAREN);var a=this.parseExpression();this.expect(_tokenizer.TokenType.RPAREN);var c=this.parseIfStatementChild(),h=null;return this.eat(_tokenizer.TokenType.ELSE)&&(h=this.parseIfStatementChild()),new AST.IfStatement({test:a,consequent:c,alternate:h})}},{key:"parseReturnStatement",value:function(){if(!this.inFunctionBody)throw this.createError(_errors$1.ErrorMessages.ILLEGAL_RETURN);if(this.lex(),this.eat(_tokenizer.TokenType.SEMICOLON)||this.hasLineTerminatorBeforeNext)return new AST.ReturnStatement({expression:null});var a=null;return!this.match(_tokenizer.TokenType.RBRACE)&&!this.eof()&&(a=this.parseExpression()),this.consumeSemicolon(),new AST.ReturnStatement({expression:a})}},{key:"parseSwitchStatement",value:function(){this.lex(),this.expect(_tokenizer.TokenType.LPAREN);var a=this.parseExpression();if(this.expect(_tokenizer.TokenType.RPAREN),this.expect(_tokenizer.TokenType.LBRACE),this.eat(_tokenizer.TokenType.RBRACE))return new AST.SwitchStatement({discriminant:a,cases:[]});var c=this.parseSwitchCases();if(this.match(_tokenizer.TokenType.DEFAULT)){var h=this.parseSwitchDefault(),d=this.parseSwitchCases();if(this.match(_tokenizer.TokenType.DEFAULT))throw this.createError(_errors$1.ErrorMessages.MULTIPLE_DEFAULTS_IN_SWITCH);return this.expect(_tokenizer.TokenType.RBRACE),new AST.SwitchStatementWithDefault({discriminant:a,preDefaultCases:c,defaultCase:h,postDefaultCases:d})}return this.expect(_tokenizer.TokenType.RBRACE),new AST.SwitchStatement({discriminant:a,cases:c})}},{key:"parseSwitchCases",value:function(){for(var a=[];!(this.eof()||this.match(_tokenizer.TokenType.RBRACE)||this.match(_tokenizer.TokenType.DEFAULT));)a.push(this.parseSwitchCase());return a}},{key:"parseSwitchCase",value:function(){var a=this.startNode();return this.expect(_tokenizer.TokenType.CASE),this.finishNode(new AST.SwitchCase({test:this.parseExpression(),consequent:this.parseSwitchCaseBody()}),a)}},{key:"parseSwitchDefault",value:function(){var a=this.startNode();return this.expect(_tokenizer.TokenType.DEFAULT),this.finishNode(new AST.SwitchDefault({consequent:this.parseSwitchCaseBody()}),a)}},{key:"parseSwitchCaseBody",value:function(){return this.expect(_tokenizer.TokenType.COLON),this.parseStatementListInSwitchCaseBody()}},{key:"parseStatementListInSwitchCaseBody",value:function(){for(var a=[];!(this.eof()||this.match(_tokenizer.TokenType.RBRACE)||this.match(_tokenizer.TokenType.DEFAULT)||this.match(_tokenizer.TokenType.CASE));)a.push(this.parseStatementListItem());return a}},{key:"parseThrowStatement",value:function(){var a=this.lex();if(this.hasLineTerminatorBeforeNext)throw this.createErrorWithLocation(a,_errors$1.ErrorMessages.NEWLINE_AFTER_THROW);var c=this.parseExpression();return this.consumeSemicolon(),new AST.ThrowStatement({expression:c})}},{key:"parseTryStatement",value:function(){this.lex();var a=this.parseBlock();if(this.match(_tokenizer.TokenType.CATCH)){var c=this.parseCatchClause();if(this.eat(_tokenizer.TokenType.FINALLY)){var h=this.parseBlock();return new AST.TryFinallyStatement({body:a,catchClause:c,finalizer:h})}return new AST.TryCatchStatement({body:a,catchClause:c})}if(this.eat(_tokenizer.TokenType.FINALLY)){var d=this.parseBlock();return new AST.TryFinallyStatement({body:a,catchClause:null,finalizer:d})}throw this.createError(_errors$1.ErrorMessages.NO_CATCH_OR_FINALLY)}},{key:"parseVariableDeclarationStatement",value:function(){var a=this.parseVariableDeclaration(!0);return this.consumeSemicolon(),new AST.VariableDeclarationStatement({declaration:a})}},{key:"parseWhileStatement",value:function(){this.lex(),this.expect(_tokenizer.TokenType.LPAREN);var a=this.parseExpression(),c=this.getIteratorStatementEpilogue();return new AST.WhileStatement({test:a,body:c})}},{key:"parseWithStatement",value:function(){this.lex(),this.expect(_tokenizer.TokenType.LPAREN);var a=this.parseExpression();this.expect(_tokenizer.TokenType.RPAREN);var c=this.parseStatement();return new AST.WithStatement({object:a,body:c})}},{key:"parseCatchClause",value:function(){var a=this.startNode();if(this.lex(),this.expect(_tokenizer.TokenType.LPAREN),this.match(_tokenizer.TokenType.RPAREN)||this.match(_tokenizer.TokenType.LPAREN))throw this.createUnexpected(this.lookahead);var c=this.parseBindingTarget();this.expect(_tokenizer.TokenType.RPAREN);var h=this.parseBlock();return this.finishNode(new AST.CatchClause({binding:c,body:h}),a)}},{key:"parseBlock",value:function(){var a=this.startNode();this.expect(_tokenizer.TokenType.LBRACE);for(var c=[];!this.match(_tokenizer.TokenType.RBRACE);)c.push(this.parseStatementListItem());return this.expect(_tokenizer.TokenType.RBRACE),this.finishNode(new AST.Block({statements:c}),a)}},{key:"parseVariableDeclaration",value:function(a){var c=this.startNode(),h=this.lex(),d=h.type===_tokenizer.TokenType.VAR?"var":h.type===_tokenizer.TokenType.CONST?"const":"let",g=this.parseVariableDeclaratorList(a);return this.finishNode(new AST.VariableDeclaration({kind:d,declarators:g}),c)}},{key:"parseVariableDeclaratorList",value:function(a){var c=[];do c.push(this.parseVariableDeclarator(a));while(this.eat(_tokenizer.TokenType.COMMA));return c}},{key:"parseVariableDeclarator",value:function(a){var c=this.startNode();if(this.match(_tokenizer.TokenType.LPAREN))throw this.createUnexpected(this.lookahead);var h=this.allowIn;this.allowIn=!0;var d=this.parseBindingTarget();this.allowIn=h,a&&d.type!=="BindingIdentifier"&&!this.match(_tokenizer.TokenType.ASSIGN)&&this.expect(_tokenizer.TokenType.ASSIGN);var g=null;return this.eat(_tokenizer.TokenType.ASSIGN)&&(g=this.parseAssignmentExpression()),this.finishNode(new AST.VariableDeclarator({binding:d,init:g}),c)}},{key:"isolateCoverGrammar",value:function(a){var c=this.isBindingElement,h=this.isAssignmentTarget,d=this.firstExprError,g=void 0;if(this.isBindingElement=this.isAssignmentTarget=!0,this.firstExprError=null,g=a.call(this),this.firstExprError!==null)throw this.firstExprError;return this.isBindingElement=c,this.isAssignmentTarget=h,this.firstExprError=d,g}},{key:"inheritCoverGrammar",value:function(a){var c=this.isBindingElement,h=this.isAssignmentTarget,d=this.firstExprError,g=void 0;return this.isBindingElement=this.isAssignmentTarget=!0,this.firstExprError=null,g=a.call(this),this.isBindingElement=this.isBindingElement&&c,this.isAssignmentTarget=this.isAssignmentTarget&&h,this.firstExprError=d||this.firstExprError,g}},{key:"parseExpression",value:function(){var a=this.startNode(),c=this.parseAssignmentExpression();if(this.match(_tokenizer.TokenType.COMMA))for(;!this.eof()&&this.match(_tokenizer.TokenType.COMMA);){this.lex();var h=this.parseAssignmentExpression();c=this.finishNode(new AST.BinaryExpression({left:c,operator:",",right:h}),a)}return c}},{key:"finishArrowParams",value:function(a){var c=a.params,h=c===void 0?null:c,d=a.rest,g=d===void 0?null:d;if(a.type!==ARROW_EXPRESSION_PARAMS)if(a.type==="IdentifierExpression")h=[this.targetToBinding(this.transformDestructuring(a))];else throw this.createUnexpected(this.lookahead);return this.copyNode(a,new AST.FormalParameters({items:h,rest:g}))}},{key:"parseArrowExpressionTail",value:function(a,c,h){this.expect(_tokenizer.TokenType.ARROW);var d=this.allowYieldExpression,g=this.allowAwaitExpression,_=this.firstAwaitLocation;this.allowYieldExpression=!1,this.allowAwaitExpression=c,this.firstAwaitLocation=null;var b=void 0;if(this.match(_tokenizer.TokenType.LBRACE)){var $=this.allowIn;this.allowIn=!0,b=this.parseFunctionBody(),this.allowIn=$}else b=this.parseAssignmentExpression();return this.allowYieldExpression=d,this.allowAwaitExpression=g,this.firstAwaitLocation=_,this.finishNode(new AST.ArrowExpression({isAsync:c,params:a,body:b}),h)}},{key:"parseAssignmentExpression",value:function(){return this.isolateCoverGrammar(this.parseAssignmentExpressionOrTarget)}},{key:"parseAssignmentExpressionOrTarget",value:function(){var a=this.startNode();if(this.allowYieldExpression&&this.match(_tokenizer.TokenType.YIELD))return this.isBindingElement=this.isAssignmentTarget=!1,this.parseYieldExpression();var c=this.parseConditionalExpression();if(!this.hasLineTerminatorBeforeNext&&this.match(_tokenizer.TokenType.ARROW)){this.isBindingElement=this.isAssignmentTarget=!1,this.firstExprError=null;var h=c.type===ARROW_EXPRESSION_PARAMS&&c.isAsync;return this.parseArrowExpressionTail(this.finishArrowParams(c),h,a)}var d=!1,g=this.lookahead;switch(g.type){case _tokenizer.TokenType.ASSIGN_BIT_OR:case _tokenizer.TokenType.ASSIGN_BIT_XOR:case _tokenizer.TokenType.ASSIGN_BIT_AND:case _tokenizer.TokenType.ASSIGN_SHL:case _tokenizer.TokenType.ASSIGN_SHR:case _tokenizer.TokenType.ASSIGN_SHR_UNSIGNED:case _tokenizer.TokenType.ASSIGN_ADD:case _tokenizer.TokenType.ASSIGN_SUB:case _tokenizer.TokenType.ASSIGN_MUL:case _tokenizer.TokenType.ASSIGN_DIV:case _tokenizer.TokenType.ASSIGN_MOD:case _tokenizer.TokenType.ASSIGN_EXP:d=!0;break}if(d){if(!this.isAssignmentTarget||!isValidSimpleAssignmentTarget(c))throw this.createError(_errors$1.ErrorMessages.INVALID_LHS_IN_ASSIGNMENT);c=this.transformDestructuring(c)}else if(g.type===_tokenizer.TokenType.ASSIGN){if(!this.isAssignmentTarget)throw this.createError(_errors$1.ErrorMessages.INVALID_LHS_IN_ASSIGNMENT);c=this.transformDestructuring(c)}else return c;this.lex();var _=this.parseAssignmentExpression();this.firstExprError=null;var b=void 0;return g.type===_tokenizer.TokenType.ASSIGN?b=new AST.AssignmentExpression({binding:c,expression:_}):(b=new AST.CompoundAssignmentExpression({binding:c,operator:g.type.name,expression:_}),this.isBindingElement=this.isAssignmentTarget=!1),this.finishNode(b,a)}},{key:"targetToBinding",value:function(a){var c=this;if(a===null)return null;switch(a.type){case"AssignmentTargetIdentifier":return this.copyNode(a,new AST.BindingIdentifier({name:a.name}));case"ArrayAssignmentTarget":return this.copyNode(a,new AST.ArrayBinding({elements:a.elements.map(function(h){return c.targetToBinding(h)}),rest:this.targetToBinding(a.rest)}));case"ObjectAssignmentTarget":return this.copyNode(a,new AST.ObjectBinding({properties:a.properties.map(function(h){return c.targetToBinding(h)}),rest:this.targetToBinding(a.rest)}));case"AssignmentTargetPropertyIdentifier":return this.copyNode(a,new AST.BindingPropertyIdentifier({binding:this.targetToBinding(a.binding),init:a.init}));case"AssignmentTargetPropertyProperty":return this.copyNode(a,new AST.BindingPropertyProperty({name:a.name,binding:this.targetToBinding(a.binding)}));case"AssignmentTargetWithDefault":return this.copyNode(a,new AST.BindingWithDefault({binding:this.targetToBinding(a.binding),init:a.init}))}throw new Error("Not reached")}},{key:"transformDestructuring",value:function(a){var c=this;switch(a.type){case"DataProperty":return this.copyNode(a,new AST.AssignmentTargetPropertyProperty({name:a.name,binding:this.transformDestructuringWithDefault(a.expression)}));case"ShorthandProperty":return this.copyNode(a,new AST.AssignmentTargetPropertyIdentifier({binding:this.copyNode(a,new AST.AssignmentTargetIdentifier({name:a.name.name})),init:null}));case"ObjectExpression":{var h=a.properties.length>0?a.properties[a.properties.length-1]:void 0;return h!=null&&h.type==="SpreadProperty"?this.copyNode(a,new AST.ObjectAssignmentTarget({properties:a.properties.slice(0,-1).map(function(g){return g&&c.transformDestructuringWithDefault(g)}),rest:this.transformDestructuring(h.expression)})):this.copyNode(a,new AST.ObjectAssignmentTarget({properties:a.properties.map(function(g){return g&&c.transformDestructuringWithDefault(g)}),rest:null}))}case"ArrayExpression":{var d=a.elements[a.elements.length-1];return d!=null&&d.type==="SpreadElement"?this.copyNode(a,new AST.ArrayAssignmentTarget({elements:a.elements.slice(0,-1).map(function(g){return g&&c.transformDestructuringWithDefault(g)}),rest:this.copyNode(d.expression,this.transformDestructuring(d.expression))})):this.copyNode(a,new AST.ArrayAssignmentTarget({elements:a.elements.map(function(g){return g&&c.transformDestructuringWithDefault(g)}),rest:null}))}case"IdentifierExpression":return this.copyNode(a,new AST.AssignmentTargetIdentifier({name:a.name}));case"StaticPropertyName":return this.copyNode(a,new AST.AssignmentTargetIdentifier({name:a.value}));case"ComputedMemberExpression":return this.copyNode(a,new AST.ComputedMemberAssignmentTarget({object:a.object,expression:a.expression}));case"StaticMemberExpression":return this.copyNode(a,new AST.StaticMemberAssignmentTarget({object:a.object,property:a.property}));case"ArrayAssignmentTarget":case"ObjectAssignmentTarget":case"ComputedMemberAssignmentTarget":case"StaticMemberAssignmentTarget":case"AssignmentTargetIdentifier":case"AssignmentTargetPropertyIdentifier":case"AssignmentTargetPropertyProperty":case"AssignmentTargetWithDefault":return a}throw new Error("Not reached")}},{key:"transformDestructuringWithDefault",value:function(a){switch(a.type){case"AssignmentExpression":return this.copyNode(a,new AST.AssignmentTargetWithDefault({binding:this.transformDestructuring(a.binding),init:a.expression}))}return this.transformDestructuring(a)}},{key:"lookaheadAssignmentExpression",value:function(){if(this.matchIdentifier())return!0;switch(this.lookahead.type){case _tokenizer.TokenType.ADD:case _tokenizer.TokenType.ASSIGN_DIV:case _tokenizer.TokenType.BIT_NOT:case _tokenizer.TokenType.CLASS:case _tokenizer.TokenType.DEC:case _tokenizer.TokenType.DELETE:case _tokenizer.TokenType.DIV:case _tokenizer.TokenType.FALSE:case _tokenizer.TokenType.FUNCTION:case _tokenizer.TokenType.INC:case _tokenizer.TokenType.LBRACE:case _tokenizer.TokenType.LBRACK:case _tokenizer.TokenType.LPAREN:case _tokenizer.TokenType.NEW:case _tokenizer.TokenType.NOT:case _tokenizer.TokenType.NULL:case _tokenizer.TokenType.NUMBER:case _tokenizer.TokenType.STRING:case _tokenizer.TokenType.SUB:case _tokenizer.TokenType.SUPER:case _tokenizer.TokenType.THIS:case _tokenizer.TokenType.TRUE:case _tokenizer.TokenType.TYPEOF:case _tokenizer.TokenType.VOID:case _tokenizer.TokenType.TEMPLATE:return!0}return!1}},{key:"parseYieldExpression",value:function(){var a=this.startNode();if(this.lex(),this.hasLineTerminatorBeforeNext)return this.finishNode(new AST.YieldExpression({expression:null}),a);var c=!!this.eat(_tokenizer.TokenType.MUL),h=null;(c||this.lookaheadAssignmentExpression())&&(h=this.parseAssignmentExpression());var d=c?AST.YieldGeneratorExpression:AST.YieldExpression;return this.finishNode(new d({expression:h}),a)}},{key:"parseConditionalExpression",value:function(){var a=this.startNode(),c=this.parseBinaryExpression();if(this.firstExprError)return c;if(this.eat(_tokenizer.TokenType.CONDITIONAL)){this.isBindingElement=this.isAssignmentTarget=!1;var h=this.allowIn;this.allowIn=!0;var d=this.isolateCoverGrammar(this.parseAssignmentExpression);this.allowIn=h,this.expect(_tokenizer.TokenType.COLON);var g=this.isolateCoverGrammar(this.parseAssignmentExpression);return this.finishNode(new AST.ConditionalExpression({test:c,consequent:d,alternate:g}),a)}return c}},{key:"isBinaryOperator",value:function(a){switch(a){case _tokenizer.TokenType.OR:case _tokenizer.TokenType.AND:case _tokenizer.TokenType.BIT_OR:case _tokenizer.TokenType.BIT_XOR:case _tokenizer.TokenType.BIT_AND:case _tokenizer.TokenType.EQ:case _tokenizer.TokenType.NE:case _tokenizer.TokenType.EQ_STRICT:case _tokenizer.TokenType.NE_STRICT:case _tokenizer.TokenType.LT:case _tokenizer.TokenType.GT:case _tokenizer.TokenType.LTE:case _tokenizer.TokenType.GTE:case _tokenizer.TokenType.INSTANCEOF:case _tokenizer.TokenType.SHL:case _tokenizer.TokenType.SHR:case _tokenizer.TokenType.SHR_UNSIGNED:case _tokenizer.TokenType.ADD:case _tokenizer.TokenType.SUB:case _tokenizer.TokenType.MUL:case _tokenizer.TokenType.DIV:case _tokenizer.TokenType.MOD:return!0;case _tokenizer.TokenType.IN:return this.allowIn;default:return!1}}},{key:"parseBinaryExpression",value:function(){var a=this,c=this.startNode(),h=this.parseExponentiationExpression();if(this.firstExprError)return h;var d=this.lookahead.type;if(!this.isBinaryOperator(d))return h;this.isBindingElement=this.isAssignmentTarget=!1,this.lex();var g=[];g.push({startState:c,left:h,operator:d,precedence:BinaryPrecedence$1[d.name]}),c=this.startNode();var _=this.isolateCoverGrammar(this.parseExponentiationExpression);for(d=this.lookahead.type;this.isBinaryOperator(d);){for(var b=BinaryPrecedence$1[d.name];g.length&&b<=g[g.length-1].precedence;){var $=g[g.length-1],j=$.operator;h=$.left,g.pop(),c=$.startState,_=this.finishNode(new AST.BinaryExpression({left:h,operator:j.name,right:_}),c)}this.lex(),g.push({startState:c,left:_,operator:d,precedence:b}),c=this.startNode(),_=this.isolateCoverGrammar(this.parseExponentiationExpression),d=this.lookahead.type}return g.reduceRight(function(_e,et){return a.finishNode(new AST.BinaryExpression({left:et.left,operator:et.operator.name,right:_e}),et.startState)},_)}},{key:"parseExponentiationExpression",value:function(){var a=this.startNode(),c=this.lookahead.type===_tokenizer.TokenType.LPAREN,h=this.parseUnaryExpression();if(this.lookahead.type!==_tokenizer.TokenType.EXP)return h;if(h.type==="UnaryExpression"&&!c)throw this.createError(_errors$1.ErrorMessages.INVALID_EXPONENTIATION_LHS);this.lex(),this.isBindingElement=this.isAssignmentTarget=!1;var d=this.isolateCoverGrammar(this.parseExponentiationExpression);return this.finishNode(new AST.BinaryExpression({left:h,operator:"**",right:d}),a)}},{key:"parseUnaryExpression",value:function(){if(this.lookahead.type.klass!==_tokenizer.TokenClass.Punctuator&&this.lookahead.type.klass!==_tokenizer.TokenClass.Keyword)return this.parseUpdateExpression();var a=this.startNode();if(this.allowAwaitExpression&&this.eat(_tokenizer.TokenType.AWAIT)){this.isBindingElement=this.isAssignmentTarget=!1;var c=this.isolateCoverGrammar(this.parseUnaryExpression);return this.finishNode(new AST.AwaitExpression({expression:c}),a)}var h=this.lookahead;if(!isPrefixOperator(h))return this.parseUpdateExpression();this.lex(),this.isBindingElement=this.isAssignmentTarget=!1;var d=void 0;if(isUpdateOperator(h)){var g=this.getLocation(),_=this.isolateCoverGrammar(this.parseUnaryExpression);if(!isValidSimpleAssignmentTarget(_))throw this.createErrorWithLocation(g,_errors$1.ErrorMessages.INVALID_UPDATE_OPERAND);_=this.transformDestructuring(_),d=new AST.UpdateExpression({isPrefix:!0,operator:h.value,operand:_})}else{var b=this.isolateCoverGrammar(this.parseUnaryExpression);d=new AST.UnaryExpression({operator:h.value,operand:b})}return this.finishNode(d,a)}},{key:"parseUpdateExpression",value:function(){var a=this.getLocation(),c=this.startNode(),h=this.parseLeftHandSideExpression({allowCall:!0});if(this.firstExprError||this.hasLineTerminatorBeforeNext)return h;var d=this.lookahead;if(!isUpdateOperator(d))return h;if(this.lex(),this.isBindingElement=this.isAssignmentTarget=!1,!isValidSimpleAssignmentTarget(h))throw this.createErrorWithLocation(a,_errors$1.ErrorMessages.INVALID_UPDATE_OPERAND);return h=this.transformDestructuring(h),this.finishNode(new AST.UpdateExpression({isPrefix:!1,operator:d.value,operand:h}),c)}},{key:"parseLeftHandSideExpression",value:function(a){var c=this,h=a.allowCall,d=this.startNode(),g=this.allowIn;this.allowIn=!0;var _=void 0,b=this.lookahead;if(this.eat(_tokenizer.TokenType.SUPER))if(this.isBindingElement=!1,this.isAssignmentTarget=!1,_=this.finishNode(new AST.Super,d),this.match(_tokenizer.TokenType.LPAREN))if(h)_=this.finishNode(new AST.CallExpression({callee:_,arguments:this.parseArgumentList().args}),d);else throw this.createUnexpected(b);else if(this.match(_tokenizer.TokenType.LBRACK))_=this.finishNode(new AST.ComputedMemberExpression({object:_,expression:this.parseComputedMember()}),d),this.isAssignmentTarget=!0;else if(this.match(_tokenizer.TokenType.PERIOD))_=this.finishNode(new AST.StaticMemberExpression({object:_,property:this.parseStaticMember()}),d),this.isAssignmentTarget=!0;else throw this.createUnexpected(b);else if(this.match(_tokenizer.TokenType.NEW))this.isBindingElement=this.isAssignmentTarget=!1,_=this.parseNewExpression();else if(this.match(_tokenizer.TokenType.ASYNC)){if(_=this.parsePrimaryExpression(),_.type==="IdentifierExpression"&&h&&!this.hasLineTerminatorBeforeNext){if(this.matchIdentifier()){var $=this.startNode(),j=this.allowAwaitExpression;this.allowAwaitExpression=!0;var _e=this.parseBindingIdentifier();return this.allowAwaitExpression=j,this.ensureArrow(),this.finishNode({type:ARROW_EXPRESSION_PARAMS,params:[_e],rest:null,isAsync:!0},$)}if(this.match(_tokenizer.TokenType.LPAREN)){var et=this.startNode(),tt=this.firstAwaitLocation;this.firstAwaitLocation=null;var nt=this.parseArgumentList(),st=nt.args,rt=nt.locationFollowingFirstSpread;if(this.isBindingElement&&!this.hasLineTerminatorBeforeNext&&this.match(_tokenizer.TokenType.ARROW)){if(rt!==null)throw this.createErrorWithLocation(rt,_errors$1.ErrorMessages.UNEXPECTED_TOKEN(","));if(this.firstAwaitLocation!==null)throw this.createErrorWithLocation(this.firstAwaitLocation,_errors$1.ErrorMessages.NO_AWAIT_IN_ASYNC_PARAMS);var it=null;if(st.length>0&&st[st.length-1].type==="SpreadElement"){if(it=this.targetToBinding(this.transformDestructuringWithDefault(st[st.length-1].expression)),it.init!=null)throw this.createError(_errors$1.ErrorMessages.UNEXPECTED_REST_PARAMETERS_INITIALIZATION);st=st.slice(0,-1)}var at=st.map(function(ot){return c.targetToBinding(c.transformDestructuringWithDefault(ot))});return this.finishNode({type:ARROW_EXPRESSION_PARAMS,params:at,rest:it,isAsync:!0},et)}this.firstAwaitLocation=tt||this.firstAwaitLocation,this.isBindingElement=this.isAssignmentTarget=!1,_=this.finishNode(new AST.CallExpression({callee:_,arguments:st}),d)}}}else if(_=this.parsePrimaryExpression(),this.firstExprError)return _;for(;;)if(h&&this.match(_tokenizer.TokenType.LPAREN))this.isBindingElement=this.isAssignmentTarget=!1,_=this.finishNode(new AST.CallExpression({callee:_,arguments:this.parseArgumentList().args}),d);else if(this.match(_tokenizer.TokenType.LBRACK))this.isBindingElement=!1,this.isAssignmentTarget=!0,_=this.finishNode(new AST.ComputedMemberExpression({object:_,expression:this.parseComputedMember()}),d);else if(this.match(_tokenizer.TokenType.PERIOD))this.isBindingElement=!1,this.isAssignmentTarget=!0,_=this.finishNode(new AST.StaticMemberExpression({object:_,property:this.parseStaticMember()}),d);else if(this.match(_tokenizer.TokenType.TEMPLATE))this.isBindingElement=this.isAssignmentTarget=!1,_=this.finishNode(new AST.TemplateExpression({tag:_,elements:this.parseTemplateElements()}),d);else break;return this.allowIn=g,_}},{key:"parseTemplateElements",value:function(){var a=this.startNode(),c=this.lookahead;if(c.tail)return this.lex(),[this.finishNode(new AST.TemplateElement({rawValue:c.slice.text.slice(1,-1)}),a)];for(var h=[this.finishNode(new AST.TemplateElement({rawValue:this.lex().slice.text.slice(1,-2)}),a)];;){if(h.push(this.parseExpression()),!this.match(_tokenizer.TokenType.RBRACE))throw this.createILLEGAL();if(this.index=this.startIndex,this.line=this.startLine,this.lineStart=this.startLineStart,this.lookahead=this.scanTemplateElement(),a=this.startNode(),c=this.lex(),c.tail)return h.push(this.finishNode(new AST.TemplateElement({rawValue:c.slice.text.slice(1,-1)}),a)),h;h.push(this.finishNode(new AST.TemplateElement({rawValue:c.slice.text.slice(1,-2)}),a))}}},{key:"parseStaticMember",value:function(){if(this.lex(),this.lookahead.type.klass.isIdentifierName)return this.lex().value;throw this.createUnexpected(this.lookahead)}},{key:"parseComputedMember",value:function(){this.lex();var a=this.parseExpression();return this.expect(_tokenizer.TokenType.RBRACK),a}},{key:"parseNewExpression",value:function(){var a=this,c=this.startNode();if(this.lex(),this.eat(_tokenizer.TokenType.PERIOD))return this.expectContextualKeyword("target"),this.finishNode(new AST.NewTargetExpression,c);var h=this.isolateCoverGrammar(function(){return a.parseLeftHandSideExpression({allowCall:!1})});return this.finishNode(new AST.NewExpression({callee:h,arguments:this.match(_tokenizer.TokenType.LPAREN)?this.parseArgumentList().args:[]}),c)}},{key:"parseRegexFlags",value:function(a){for(var c=!1,h=!1,d=!1,g=!1,_=!1,b=!1,$=0;$1?e-1:0),a=1;a1&&c.slice(1).forEach(function(h){a.addError(s(h))})}),this}},{key:"enforceConflictingLexicallyDeclaredNames",value:function(s,a){var c=this;return this.lexicallyDeclaredNames.forEachEntry(function(h,d){s.has(d)&&h.forEach(function(g){c.addError(a(g))})}),this}},{key:"observeFunctionDeclaration",value:function(){return this.observeVarBoundary(),addEach(this.functionDeclarationNames,this.boundNames),this.boundNames=new _multimap2.default,this}},{key:"functionDeclarationNamesAreLexical",value:function(){return addEach(this.lexicallyDeclaredNames,this.functionDeclarationNames),this.functionDeclarationNames=new _multimap2.default,this}},{key:"observeVarDeclaration",value:function(){return addEach(this.varDeclaredNames,this.boundNames),this.boundNames=new _multimap2.default,this}},{key:"recordForOfVars",value:function(){var s=this;return this.varDeclaredNames.forEach(function(a){s.forOfVarDeclaredNames.push(a)}),this}},{key:"observeVarBoundary",value:function(){return this.lexicallyDeclaredNames=new _multimap2.default,this.functionDeclarationNames=new _multimap2.default,this.varDeclaredNames=new _multimap2.default,this.forOfVarDeclaredNames=[],this}},{key:"exportName",value:function(s,a){return this.exportedNames.set(s,a),this}},{key:"exportDeclaredNames",value:function(){return addEach(this.exportedNames,this.lexicallyDeclaredNames,this.varDeclaredNames),addEach(this.exportedBindings,this.lexicallyDeclaredNames,this.varDeclaredNames),this}},{key:"exportBinding",value:function(s,a){return this.exportedBindings.set(s,a),this}},{key:"clearExportedBindings",value:function(){return this.exportedBindings=new _multimap2.default,this}},{key:"observeYieldExpression",value:function(s){return this.yieldExpressions.push(s),this}},{key:"clearYieldExpressions",value:function(){return this.yieldExpressions=[],this}},{key:"observeAwaitExpression",value:function(s){return this.awaitExpressions.push(s),this}},{key:"clearAwaitExpressions",value:function(){return this.awaitExpressions=[],this}},{key:"addError",value:function(s){return this.errors.push(s),this}},{key:"addStrictError",value:function(s){return this.strictErrors.push(s),this}},{key:"enforceStrictErrors",value:function(){return[].push.apply(this.errors,this.strictErrors),this.strictErrors=[],this}},{key:"concat",value:function(s){return this===identity?s:s===identity?this:([].push.apply(this.errors,s.errors),[].push.apply(this.strictErrors,s.strictErrors),[].push.apply(this.usedLabelNames,s.usedLabelNames),[].push.apply(this.freeBreakStatements,s.freeBreakStatements),[].push.apply(this.freeContinueStatements,s.freeContinueStatements),[].push.apply(this.freeLabeledBreakStatements,s.freeLabeledBreakStatements),[].push.apply(this.freeLabeledContinueStatements,s.freeLabeledContinueStatements),[].push.apply(this.newTargetExpressions,s.newTargetExpressions),addEach(this.boundNames,s.boundNames),addEach(this.lexicallyDeclaredNames,s.lexicallyDeclaredNames),addEach(this.functionDeclarationNames,s.functionDeclarationNames),addEach(this.varDeclaredNames,s.varDeclaredNames),[].push.apply(this.forOfVarDeclaredNames,s.forOfVarDeclaredNames),addEach(this.exportedNames,s.exportedNames),addEach(this.exportedBindings,s.exportedBindings),[].push.apply(this.superCallExpressions,s.superCallExpressions),[].push.apply(this.superCallExpressionsInConstructorMethod,s.superCallExpressionsInConstructorMethod),[].push.apply(this.superPropertyExpressions,s.superPropertyExpressions),[].push.apply(this.yieldExpressions,s.yieldExpressions),[].push.apply(this.awaitExpressions,s.awaitExpressions),this)}}],[{key:"empty",value:function(){return identity}}]),o}();identity=new EarlyErrorState;Object.getOwnPropertyNames(EarlyErrorState.prototype).forEach(function(o){o!=="constructor"&&Object.defineProperty(identity,o,{value:function(){return EarlyErrorState.prototype[o].apply(new EarlyErrorState,arguments)},enumerable:!1,writable:!0,configurable:!0})});earlyErrorState.EarlyError=function(o){_inherits$4(e,o);function e(s,a){_classCallCheck$7(this,e);var c=_possibleConstructorReturn$4(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,a));return c.node=s,c.message=a,c}return e}(Error);Object.defineProperty(earlyErrors,"__esModule",{value:!0});earlyErrors.EarlyErrorChecker=void 0;var _createClass$5=function(){function o(e,s){for(var a=0;a1&&s.slice(1).forEach(function(a){e=e.addError(new _earlyErrorState.EarlyError(a,"Duplicate constructor method in class"))}),e}var SUPERCALL_ERROR=function(e){return new _earlyErrorState.EarlyError(e,_errors.ErrorMessages.ILLEGAL_SUPER_CALL)},SUPERPROPERTY_ERROR=function(e){return new _earlyErrorState.EarlyError(e,"Member access on super must be in a method")},DUPLICATE_BINDING=function(e){return new _earlyErrorState.EarlyError(e,"Duplicate binding "+JSON.stringify(e.name))},FREE_CONTINUE=function(e){return new _earlyErrorState.EarlyError(e,"Continue statement must be nested within an iteration statement")},UNBOUND_CONTINUE=function(e){return new _earlyErrorState.EarlyError(e,"Continue statement must be nested within an iteration statement with label "+JSON.stringify(e.label))},FREE_BREAK=function(e){return new _earlyErrorState.EarlyError(e,"Break statement must be nested within an iteration statement or a switch statement")},UNBOUND_BREAK=function(e){return new _earlyErrorState.EarlyError(e,"Break statement must be nested within a statement with label "+JSON.stringify(e.label))};earlyErrors.EarlyErrorChecker=function(o){_inherits$3(e,o);function e(){return _classCallCheck$6(this,e),_possibleConstructorReturn$3(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,_earlyErrorState.EarlyErrorState))}return _createClass$5(e,[{key:"reduceAssignmentExpression",value:function(){return _get$1(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"reduceAssignmentExpression",this).apply(this,arguments).clearBoundNames()}},{key:"reduceAssignmentTargetIdentifier",value:function(a){var c=this.identity;return(a.name==="eval"||a.name==="arguments"||(0,_utils.isStrictModeReservedWord)(a.name))&&(c=c.addStrictError(new _earlyErrorState.EarlyError(a,"The identifier "+JSON.stringify(a.name)+" must not be in binding position in strict mode"))),c}},{key:"reduceArrowExpression",value:function(a,c){var h=c.params,d=c.body,g=a.params.rest==null&&a.params.items.every(function(b){return b.type==="BindingIdentifier"});h=h.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING),a.body.type==="FunctionBody"&&(d=d.enforceConflictingLexicallyDeclaredNames(h.lexicallyDeclaredNames,DUPLICATE_BINDING),isStrictFunctionBody(a.body)&&(h=h.enforceStrictErrors(),d=d.enforceStrictErrors())),h.yieldExpressions.forEach(function(b){h=h.addError(new _earlyErrorState.EarlyError(b,"Arrow parameters must not contain yield expressions"))}),h.awaitExpressions.forEach(function(b){h=h.addError(new _earlyErrorState.EarlyError(b,"Arrow parameters must not contain await expressions"))});var _=_get$1(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"reduceArrowExpression",this).call(this,a,{params:h,body:d});return!g&&a.body.type==="FunctionBody"&&isStrictFunctionBody(a.body)&&(_=_.addError(new _earlyErrorState.EarlyError(a,'Functions with non-simple parameter lists may not contain a "use strict" directive'))),_=_.clearYieldExpressions(),_=_.clearAwaitExpressions(),_=_.observeVarBoundary(),_}},{key:"reduceAwaitExpression",value:function(a,c){var h=c.expression;return h.observeAwaitExpression(a)}},{key:"reduceBindingIdentifier",value:function(a){var c=this.identity;return(a.name==="eval"||a.name==="arguments"||(0,_utils.isStrictModeReservedWord)(a.name))&&(c=c.addStrictError(new _earlyErrorState.EarlyError(a,"The identifier "+JSON.stringify(a.name)+" must not be in binding position in strict mode"))),c=c.bindName(a.name,a),c}},{key:"reduceBlock",value:function(){var a=_get$1(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"reduceBlock",this).apply(this,arguments);return a=a.functionDeclarationNamesAreLexical(),a=a.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING),a=a.enforceConflictingLexicallyDeclaredNames(a.varDeclaredNames,DUPLICATE_BINDING),a=a.observeLexicalBoundary(),a}},{key:"reduceBreakStatement",value:function(a){var c=_get$1(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"reduceBreakStatement",this).apply(this,arguments);return c=a.label==null?c.addFreeBreakStatement(a):c.addFreeLabeledBreakStatement(a),c}},{key:"reduceCallExpression",value:function(a){var c=_get$1(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"reduceCallExpression",this).apply(this,arguments);return a.callee.type==="Super"&&(c=c.observeSuperCallExpression(a)),c}},{key:"reduceCatchClause",value:function(a,c){var h=c.binding,d=c.body;h=h.observeLexicalDeclaration(),h=h.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING),h=h.enforceConflictingLexicallyDeclaredNames(d.previousLexicallyDeclaredNames,DUPLICATE_BINDING),h.lexicallyDeclaredNames.forEachEntry(function(_,b){d.varDeclaredNames.has(b)&&d.varDeclaredNames.get(b).forEach(function($){d.forOfVarDeclaredNames.indexOf($)>=0&&(h=h.addError(DUPLICATE_BINDING($)))})});var g=_get$1(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"reduceCatchClause",this).call(this,a,{binding:h,body:d});return g=g.observeLexicalBoundary(),g}},{key:"reduceClassDeclaration",value:function(a,c){var h=c.name,d=c.super,g=c.elements,_=h.enforceStrictErrors(),b=this.append.apply(this,_toConsumableArray$3(g));return b=b.enforceStrictErrors(),a.super!=null&&(d=d.enforceStrictErrors(),_=this.append(_,d),b=b.clearSuperCallExpressionsInConstructorMethod()),_=this.append(_,b),_=enforceDuplicateConstructorMethods(a,_),_=_.observeLexicalDeclaration(),_}},{key:"reduceClassElement",value:function(a){var c=_get$1(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"reduceClassElement",this).apply(this,arguments);return!a.isStatic&&isSpecialMethod(a.method)&&(c=c.addError(new _earlyErrorState.EarlyError(a,_errors.ErrorMessages.ILLEGAL_CONSTRUCTORS))),a.isStatic&&a.method.name.type==="StaticPropertyName"&&a.method.name.value==="prototype"&&(c=c.addError(new _earlyErrorState.EarlyError(a,'Static class methods cannot be named "prototype"'))),c}},{key:"reduceClassExpression",value:function(a,c){var h=c.name,d=c.super,g=c.elements,_=a.name==null?this.identity:h.enforceStrictErrors(),b=this.append.apply(this,_toConsumableArray$3(g));return b=b.enforceStrictErrors(),a.super!=null&&(d=d.enforceStrictErrors(),_=this.append(_,d),b=b.clearSuperCallExpressionsInConstructorMethod()),_=this.append(_,b),_=enforceDuplicateConstructorMethods(a,_),_=_.clearBoundNames(),_}},{key:"reduceCompoundAssignmentExpression",value:function(){return _get$1(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"reduceCompoundAssignmentExpression",this).apply(this,arguments).clearBoundNames()}},{key:"reduceComputedMemberExpression",value:function(a){var c=_get$1(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"reduceComputedMemberExpression",this).apply(this,arguments);return a.object.type==="Super"&&(c=c.observeSuperPropertyExpression(a)),c}},{key:"reduceContinueStatement",value:function(a){var c=_get$1(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"reduceContinueStatement",this).apply(this,arguments);return c=a.label==null?c.addFreeContinueStatement(a):c.addFreeLabeledContinueStatement(a),c}},{key:"reduceDoWhileStatement",value:function(a){var c=_get$1(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"reduceDoWhileStatement",this).apply(this,arguments);return isLabelledFunction(a.body)&&(c=c.addError(new _earlyErrorState.EarlyError(a.body,"The body of a do-while statement must not be a labeled function declaration"))),c=c.clearFreeContinueStatements(),c=c.clearFreeBreakStatements(),c}},{key:"reduceExport",value:function(){var a=_get$1(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"reduceExport",this).apply(this,arguments);return a=a.functionDeclarationNamesAreLexical(),a=a.exportDeclaredNames(),a}},{key:"reduceExportFrom",value:function(){var a=_get$1(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"reduceExportFrom",this).apply(this,arguments);return a=a.clearExportedBindings(),a}},{key:"reduceExportFromSpecifier",value:function(a){var c=_get$1(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"reduceExportFromSpecifier",this).apply(this,arguments);return c=c.exportName(a.exportedName||a.name,a),c=c.exportBinding(a.name,a),c}},{key:"reduceExportLocalSpecifier",value:function(a){var c=_get$1(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"reduceExportLocalSpecifier",this).apply(this,arguments);return c=c.exportName(a.exportedName||a.name.name,a),c=c.exportBinding(a.name.name,a),c}},{key:"reduceExportDefault",value:function(a){var c=_get$1(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"reduceExportDefault",this).apply(this,arguments);return c=c.functionDeclarationNamesAreLexical(),c=c.exportName("default",a),c}},{key:"reduceFormalParameters",value:function(){var a=_get$1(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"reduceFormalParameters",this).apply(this,arguments);return a=a.observeLexicalDeclaration(),a}},{key:"reduceForStatement",value:function(a,c){var h=c.init,d=c.test,g=c.update,_=c.body;h!=null&&(h=h.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING),h=h.enforceConflictingLexicallyDeclaredNames(_.varDeclaredNames,DUPLICATE_BINDING));var b=_get$1(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"reduceForStatement",this).call(this,a,{init:h,test:d,update:g,body:_});return a.init!=null&&a.init.type==="VariableDeclaration"&&a.init.kind==="const"&&a.init.declarators.forEach(function($){$.init==null&&(b=b.addError(new _earlyErrorState.EarlyError($,"Constant lexical declarations must have an initialiser")))}),isLabelledFunction(a.body)&&(b=b.addError(new _earlyErrorState.EarlyError(a.body,"The body of a for statement must not be a labeled function declaration"))),b=b.clearFreeContinueStatements(),b=b.clearFreeBreakStatements(),b=b.observeLexicalBoundary(),b}},{key:"reduceForInStatement",value:function(a,c){var h=c.left,d=c.right,g=c.body;h=h.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING),h=h.enforceConflictingLexicallyDeclaredNames(g.varDeclaredNames,DUPLICATE_BINDING);var _=_get$1(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"reduceForInStatement",this).call(this,a,{left:h,right:d,body:g});return isLabelledFunction(a.body)&&(_=_.addError(new _earlyErrorState.EarlyError(a.body,"The body of a for-in statement must not be a labeled function declaration"))),_=_.clearFreeContinueStatements(),_=_.clearFreeBreakStatements(),_=_.observeLexicalBoundary(),_}},{key:"reduceForOfStatement",value:function(a,c){var h=c.left,d=c.right,g=c.body;h=h.recordForOfVars(),h=h.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING),h=h.enforceConflictingLexicallyDeclaredNames(g.varDeclaredNames,DUPLICATE_BINDING);var _=_get$1(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"reduceForOfStatement",this).call(this,a,{left:h,right:d,body:g});return isLabelledFunction(a.body)&&(_=_.addError(new _earlyErrorState.EarlyError(a.body,"The body of a for-of statement must not be a labeled function declaration"))),_=_.clearFreeContinueStatements(),_=_.clearFreeBreakStatements(),_=_.observeLexicalBoundary(),_}},{key:"reduceForAwaitStatement",value:function(a,c){var h=c.left,d=c.right,g=c.body;h=h.recordForOfVars(),h=h.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING),h=h.enforceConflictingLexicallyDeclaredNames(g.varDeclaredNames,DUPLICATE_BINDING);var _=_get$1(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"reduceForOfStatement",this).call(this,a,{left:h,right:d,body:g});return isLabelledFunction(a.body)&&(_=_.addError(new _earlyErrorState.EarlyError(a.body,"The body of a for-await statement must not be a labeled function declaration"))),_=_.clearFreeContinueStatements(),_=_.clearFreeBreakStatements(),_=_.observeLexicalBoundary(),_}},{key:"reduceFunctionBody",value:function(a){var c=_get$1(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"reduceFunctionBody",this).apply(this,arguments);return c=c.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING),c=c.enforceConflictingLexicallyDeclaredNames(c.varDeclaredNames,DUPLICATE_BINDING),c=c.enforceFreeContinueStatementErrors(FREE_CONTINUE),c=c.enforceFreeLabeledContinueStatementErrors(UNBOUND_CONTINUE),c=c.enforceFreeBreakStatementErrors(FREE_BREAK),c=c.enforceFreeLabeledBreakStatementErrors(UNBOUND_BREAK),c=c.clearUsedLabelNames(),c=c.clearYieldExpressions(),c=c.clearAwaitExpressions(),isStrictFunctionBody(a)&&(c=c.enforceStrictErrors()),c}},{key:"reduceFunctionDeclaration",value:function(a,c){var h=c.name,d=c.params,g=c.body,_=a.params.rest==null&&a.params.items.every(function(j){return j.type==="BindingIdentifier"}),b=!_||a.isGenerator?"addError":"addStrictError";d.lexicallyDeclaredNames.forEachEntry(function(j){j.length>1&&j.slice(1).forEach(function(_e){d=d[b](DUPLICATE_BINDING(_e))})}),g=g.enforceConflictingLexicallyDeclaredNames(d.lexicallyDeclaredNames,DUPLICATE_BINDING),g=g.enforceSuperCallExpressions(SUPERCALL_ERROR),g=g.enforceSuperPropertyExpressions(SUPERPROPERTY_ERROR),d=d.enforceSuperCallExpressions(SUPERCALL_ERROR),d=d.enforceSuperPropertyExpressions(SUPERPROPERTY_ERROR),a.isGenerator&&d.yieldExpressions.forEach(function(j){d=d.addError(new _earlyErrorState.EarlyError(j,"Generator parameters must not contain yield expressions"))}),a.isAsync&&d.awaitExpressions.forEach(function(j){d=d.addError(new _earlyErrorState.EarlyError(j,"Async function parameters must not contain await expressions"))}),d=d.clearNewTargetExpressions(),g=g.clearNewTargetExpressions(),isStrictFunctionBody(a.body)&&(d=d.enforceStrictErrors(),g=g.enforceStrictErrors());var $=_get$1(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"reduceFunctionDeclaration",this).call(this,a,{name:h,params:d,body:g});return!_&&isStrictFunctionBody(a.body)&&($=$.addError(new _earlyErrorState.EarlyError(a,'Functions with non-simple parameter lists may not contain a "use strict" directive'))),$=$.clearYieldExpressions(),$=$.clearAwaitExpressions(),$=$.observeFunctionDeclaration(),$}},{key:"reduceFunctionExpression",value:function(a,c){var h=c.name,d=c.params,g=c.body,_=a.params.rest==null&&a.params.items.every(function(j){return j.type==="BindingIdentifier"}),b=!_||a.isGenerator?"addError":"addStrictError";d.lexicallyDeclaredNames.forEachEntry(function(j,_e){j.length>1&&j.slice(1).forEach(function(et){d=d[b](new _earlyErrorState.EarlyError(et,"Duplicate binding "+JSON.stringify(_e)))})}),g=g.enforceConflictingLexicallyDeclaredNames(d.lexicallyDeclaredNames,DUPLICATE_BINDING),g=g.enforceSuperCallExpressions(SUPERCALL_ERROR),g=g.enforceSuperPropertyExpressions(SUPERPROPERTY_ERROR),d=d.enforceSuperCallExpressions(SUPERCALL_ERROR),d=d.enforceSuperPropertyExpressions(SUPERPROPERTY_ERROR),a.isGenerator&&d.yieldExpressions.forEach(function(j){d=d.addError(new _earlyErrorState.EarlyError(j,"Generator parameters must not contain yield expressions"))}),a.isAsync&&d.awaitExpressions.forEach(function(j){d=d.addError(new _earlyErrorState.EarlyError(j,"Async function parameters must not contain await expressions"))}),d=d.clearNewTargetExpressions(),g=g.clearNewTargetExpressions(),isStrictFunctionBody(a.body)&&(d=d.enforceStrictErrors(),g=g.enforceStrictErrors());var $=_get$1(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"reduceFunctionExpression",this).call(this,a,{name:h,params:d,body:g});return!_&&isStrictFunctionBody(a.body)&&($=$.addError(new _earlyErrorState.EarlyError(a,'Functions with non-simple parameter lists may not contain a "use strict" directive'))),$=$.clearBoundNames(),$=$.clearYieldExpressions(),$=$.clearAwaitExpressions(),$=$.observeVarBoundary(),$}},{key:"reduceGetter",value:function(a,c){var h=c.name,d=c.body;d=d.enforceSuperCallExpressions(SUPERCALL_ERROR),d=d.clearSuperPropertyExpressions(),d=d.clearNewTargetExpressions(),isStrictFunctionBody(a.body)&&(d=d.enforceStrictErrors());var g=_get$1(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"reduceGetter",this).call(this,a,{name:h,body:d});return g=g.observeVarBoundary(),g}},{key:"reduceIdentifierExpression",value:function(a){var c=this.identity;return(0,_utils.isStrictModeReservedWord)(a.name)&&(c=c.addStrictError(new _earlyErrorState.EarlyError(a,"The identifier "+JSON.stringify(a.name)+" must not be in expression position in strict mode"))),c}},{key:"reduceIfStatement",value:function(a,c){var h=c.test,d=c.consequent,g=c.alternate;return isLabelledFunction(a.consequent)&&(d=d.addError(new _earlyErrorState.EarlyError(a.consequent,"The consequent of an if statement must not be a labeled function declaration"))),a.alternate!=null&&isLabelledFunction(a.alternate)&&(g=g.addError(new _earlyErrorState.EarlyError(a.alternate,"The alternate of an if statement must not be a labeled function declaration"))),a.consequent.type==="FunctionDeclaration"&&(d=d.addStrictError(new _earlyErrorState.EarlyError(a.consequent,"FunctionDeclarations in IfStatements are disallowed in strict mode")),d=d.observeLexicalBoundary()),a.alternate!=null&&a.alternate.type==="FunctionDeclaration"&&(g=g.addStrictError(new _earlyErrorState.EarlyError(a.alternate,"FunctionDeclarations in IfStatements are disallowed in strict mode")),g=g.observeLexicalBoundary()),_get$1(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"reduceIfStatement",this).call(this,a,{test:h,consequent:d,alternate:g})}},{key:"reduceImport",value:function(){var a=_get$1(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"reduceImport",this).apply(this,arguments);return a=a.observeLexicalDeclaration(),a}},{key:"reduceImportNamespace",value:function(){var a=_get$1(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"reduceImportNamespace",this).apply(this,arguments);return a=a.observeLexicalDeclaration(),a}},{key:"reduceLabeledStatement",value:function(a){var c=_get$1(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"reduceLabeledStatement",this).apply(this,arguments);return(a.label==="yield"||(0,_utils.isStrictModeReservedWord)(a.label))&&(c=c.addStrictError(new _earlyErrorState.EarlyError(a,"The identifier "+JSON.stringify(a.label)+" must not be in label position in strict mode"))),c.usedLabelNames.indexOf(a.label)>=0&&(c=c.addError(new _earlyErrorState.EarlyError(a,"Label "+JSON.stringify(a.label)+" has already been declared"))),a.body.type==="FunctionDeclaration"&&(c=c.addStrictError(new _earlyErrorState.EarlyError(a,"Labeled FunctionDeclarations are disallowed in strict mode"))),c=isIterationStatement(a.body)?c.observeIterationLabel(a.label):c.observeNonIterationLabel(a.label),c}},{key:"reduceLiteralRegExpExpression",value:function(){var a=this.identity;return a}},{key:"reduceMethod",value:function(a,c){var h=c.name,d=c.params,g=c.body,_=a.params.rest==null&&a.params.items.every(function($){return $.type==="BindingIdentifier"});d=d.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING),g=g.enforceConflictingLexicallyDeclaredNames(d.lexicallyDeclaredNames,DUPLICATE_BINDING),a.name.type==="StaticPropertyName"&&a.name.value==="constructor"?(g=g.observeConstructorMethod(),d=d.observeConstructorMethod()):(g=g.enforceSuperCallExpressions(SUPERCALL_ERROR),d=d.enforceSuperCallExpressions(SUPERCALL_ERROR)),a.isGenerator&&d.yieldExpressions.forEach(function($){d=d.addError(new _earlyErrorState.EarlyError($,"Generator parameters must not contain yield expressions"))}),a.isAsync&&d.awaitExpressions.forEach(function($){d=d.addError(new _earlyErrorState.EarlyError($,"Async function parameters must not contain await expressions"))}),g=g.clearSuperPropertyExpressions(),d=d.clearSuperPropertyExpressions(),d=d.clearNewTargetExpressions(),g=g.clearNewTargetExpressions(),isStrictFunctionBody(a.body)&&(d=d.enforceStrictErrors(),g=g.enforceStrictErrors());var b=_get$1(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"reduceMethod",this).call(this,a,{name:h,params:d,body:g});return!_&&isStrictFunctionBody(a.body)&&(b=b.addError(new _earlyErrorState.EarlyError(a,'Functions with non-simple parameter lists may not contain a "use strict" directive'))),b=b.clearYieldExpressions(),b=b.clearAwaitExpressions(),b=b.observeVarBoundary(),b}},{key:"reduceModule",value:function(){var a=_get$1(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"reduceModule",this).apply(this,arguments);return a=a.functionDeclarationNamesAreLexical(),a=a.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING),a=a.enforceConflictingLexicallyDeclaredNames(a.varDeclaredNames,DUPLICATE_BINDING),a.exportedNames.forEachEntry(function(c,h){c.length>1&&c.slice(1).forEach(function(d){a=a.addError(new _earlyErrorState.EarlyError(d,"Duplicate export "+JSON.stringify(h)))})}),a.exportedBindings.forEachEntry(function(c,h){!a.lexicallyDeclaredNames.has(h)&&!a.varDeclaredNames.has(h)&&c.forEach(function(d){a=a.addError(new _earlyErrorState.EarlyError(d,"Exported binding "+JSON.stringify(h)+" is not declared"))})}),a.newTargetExpressions.forEach(function(c){a=a.addError(new _earlyErrorState.EarlyError(c,"new.target must be within function (but not arrow expression) code"))}),a=a.enforceFreeContinueStatementErrors(FREE_CONTINUE),a=a.enforceFreeLabeledContinueStatementErrors(UNBOUND_CONTINUE),a=a.enforceFreeBreakStatementErrors(FREE_BREAK),a=a.enforceFreeLabeledBreakStatementErrors(UNBOUND_BREAK),a=a.enforceSuperCallExpressions(SUPERCALL_ERROR),a=a.enforceSuperPropertyExpressions(SUPERPROPERTY_ERROR),a=a.enforceStrictErrors(),a}},{key:"reduceNewTargetExpression",value:function(a){return this.identity.observeNewTargetExpression(a)}},{key:"reduceObjectExpression",value:function(a){var c=_get$1(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"reduceObjectExpression",this).apply(this,arguments);c=c.enforceSuperCallExpressionsInConstructorMethod(SUPERCALL_ERROR);var h=a.properties.filter(function(d){return d.type==="DataProperty"&&d.name.type==="StaticPropertyName"&&d.name.value==="__proto__"});return h.slice(1).forEach(function(d){c=c.addError(new _earlyErrorState.EarlyError(d,"Duplicate __proto__ property in object literal not allowed"))}),c}},{key:"reduceUpdateExpression",value:function(){var a=_get$1(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"reduceUpdateExpression",this).apply(this,arguments);return a=a.clearBoundNames(),a}},{key:"reduceUnaryExpression",value:function(a){var c=_get$1(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"reduceUnaryExpression",this).apply(this,arguments);return a.operator==="delete"&&a.operand.type==="IdentifierExpression"&&(c=c.addStrictError(new _earlyErrorState.EarlyError(a,"Identifier expressions must not be deleted in strict mode"))),c}},{key:"reduceScript",value:function(a){var c=_get$1(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"reduceScript",this).apply(this,arguments);return c=c.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING),c=c.enforceConflictingLexicallyDeclaredNames(c.varDeclaredNames,DUPLICATE_BINDING),c.newTargetExpressions.forEach(function(h){c=c.addError(new _earlyErrorState.EarlyError(h,"new.target must be within function (but not arrow expression) code"))}),c=c.enforceFreeContinueStatementErrors(FREE_CONTINUE),c=c.enforceFreeLabeledContinueStatementErrors(UNBOUND_CONTINUE),c=c.enforceFreeBreakStatementErrors(FREE_BREAK),c=c.enforceFreeLabeledBreakStatementErrors(UNBOUND_BREAK),c=c.enforceSuperCallExpressions(SUPERCALL_ERROR),c=c.enforceSuperPropertyExpressions(SUPERPROPERTY_ERROR),isStrictFunctionBody(a)&&(c=c.enforceStrictErrors()),c}},{key:"reduceSetter",value:function(a,c){var h=c.name,d=c.param,g=c.body,_=a.param.type==="BindingIdentifier";d=d.observeLexicalDeclaration(),d=d.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING),g=g.enforceConflictingLexicallyDeclaredNames(d.lexicallyDeclaredNames,DUPLICATE_BINDING),d=d.enforceSuperCallExpressions(SUPERCALL_ERROR),g=g.enforceSuperCallExpressions(SUPERCALL_ERROR),d=d.clearSuperPropertyExpressions(),g=g.clearSuperPropertyExpressions(),d=d.clearNewTargetExpressions(),g=g.clearNewTargetExpressions(),isStrictFunctionBody(a.body)&&(d=d.enforceStrictErrors(),g=g.enforceStrictErrors());var b=_get$1(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"reduceSetter",this).call(this,a,{name:h,param:d,body:g});return!_&&isStrictFunctionBody(a.body)&&(b=b.addError(new _earlyErrorState.EarlyError(a,'Functions with non-simple parameter lists may not contain a "use strict" directive'))),b=b.observeVarBoundary(),b}},{key:"reduceStaticMemberExpression",value:function(a){var c=_get$1(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"reduceStaticMemberExpression",this).apply(this,arguments);return a.object.type==="Super"&&(c=c.observeSuperPropertyExpression(a)),c}},{key:"reduceSwitchStatement",value:function(a,c){var h=c.discriminant,d=c.cases,g=this.append.apply(this,_toConsumableArray$3(d));g=g.functionDeclarationNamesAreLexical(),g=g.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING),g=g.enforceConflictingLexicallyDeclaredNames(g.varDeclaredNames,DUPLICATE_BINDING),g=g.observeLexicalBoundary();var _=this.append(h,g);return _=_.clearFreeBreakStatements(),_}},{key:"reduceSwitchStatementWithDefault",value:function(a,c){var h=c.discriminant,d=c.preDefaultCases,g=c.defaultCase,_=c.postDefaultCases,b=this.append.apply(this,[g].concat(_toConsumableArray$3(d),_toConsumableArray$3(_)));b=b.functionDeclarationNamesAreLexical(),b=b.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING),b=b.enforceConflictingLexicallyDeclaredNames(b.varDeclaredNames,DUPLICATE_BINDING),b=b.observeLexicalBoundary();var $=this.append(h,b);return $=$.clearFreeBreakStatements(),$}},{key:"reduceVariableDeclaration",value:function(a){var c=_get$1(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"reduceVariableDeclaration",this).apply(this,arguments);switch(a.kind){case"const":case"let":{c=c.observeLexicalDeclaration(),c.lexicallyDeclaredNames.has("let")&&c.lexicallyDeclaredNames.get("let").forEach(function(h){c=c.addError(new _earlyErrorState.EarlyError(h,'Lexical declarations must not have a binding named "let"'))});break}case"var":c=c.observeVarDeclaration();break}return c}},{key:"reduceVariableDeclarationStatement",value:function(a){var c=_get$1(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"reduceVariableDeclarationStatement",this).apply(this,arguments);return a.declaration.kind==="const"&&a.declaration.declarators.forEach(function(h){h.init==null&&(c=c.addError(new _earlyErrorState.EarlyError(h,"Constant lexical declarations must have an initialiser")))}),c}},{key:"reduceWhileStatement",value:function(a){var c=_get$1(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"reduceWhileStatement",this).apply(this,arguments);return isLabelledFunction(a.body)&&(c=c.addError(new _earlyErrorState.EarlyError(a.body,"The body of a while statement must not be a labeled function declaration"))),c=c.clearFreeContinueStatements().clearFreeBreakStatements(),c}},{key:"reduceWithStatement",value:function(a){var c=_get$1(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"reduceWithStatement",this).apply(this,arguments);return isLabelledFunction(a.body)&&(c=c.addError(new _earlyErrorState.EarlyError(a.body,"The body of a with statement must not be a labeled function declaration"))),c=c.addStrictError(new _earlyErrorState.EarlyError(a,"Strict mode code must not include a with statement")),c}},{key:"reduceYieldExpression",value:function(a){var c=_get$1(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"reduceYieldExpression",this).apply(this,arguments);return c=c.observeYieldExpression(a),c}},{key:"reduceYieldGeneratorExpression",value:function(a){var c=_get$1(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"reduceYieldGeneratorExpression",this).apply(this,arguments);return c=c.observeYieldExpression(a),c}}],[{key:"check",value:function(a){return(0,_shiftReducer2.default)(new e,a).errors}}]),e}(_shiftReducer$1.MonoidalReducer);(function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.TokenType=o.TokenClass=o.Tokenizer=o.ParserWithLocation=o.GenericParser=o.EarlyErrorChecker=o.parseScriptWithLocation=o.parseModuleWithLocation=o.parseScript=o.parseModule=void 0;var e=function(){function nt(st,rt){for(var it=0;it1&&arguments[1]!==void 0?arguments[1]:{},at=it.earlyErrors,ot=at===void 0?!0:at,ut=new c.GenericParser(rt),ct=ut[nt]();if(ot){var ht=h.EarlyErrorChecker.check(ct);if(ht.length>0)throw new a.JsError(0,1,0,ht[0].message)}return ct}}function et(nt){return function(rt){var it=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},at=it.earlyErrors,ot=at===void 0?!0:at,ut=new j(rt),ct=ut[nt]();if(ot){var ht=h.EarlyErrorChecker.check(ct);if(ht.length>0){var lt=ht[0],pt=lt.node,ft=lt.message,gt=ut.locations.get(pt).start,yt=gt.offset,mt=gt.line,Et=gt.column;throw new a.JsError(yt,mt,Et,ft)}}return{tree:ct,locations:ut.locations,comments:ut.comments}}}o.parseModule=_e("parseModule");var tt=o.parseScript=_e("parseScript");o.parseModuleWithLocation=et("parseModule"),o.parseScriptWithLocation=et("parseScript"),o.default=tt,o.EarlyErrorChecker=h.EarlyErrorChecker,o.GenericParser=c.GenericParser,o.ParserWithLocation=j})(dist$7);var dist$2={};Object.defineProperty(dist$2,"__esModule",{value:!0});var _default=dist$2.default=function(){var o={},e={typeName:"Boolean"},s={typeName:"Number"},a={typeName:"String"};function c(Ut){return{typeName:"Maybe",argument:Ut}}function h(Ut){return{typeName:"List",argument:Ut}}function d(Ut){return{typeName:"Const",argument:Ut}}function g(){return{typeName:"Union",arguments:[].slice.call(arguments,0)}}var _={typeName:"Enum",values:["ArrayAssignmentTarget","ArrayBinding","ArrayExpression","ArrowExpression","AssignmentExpression","AssignmentTargetIdentifier","AssignmentTargetPropertyIdentifier","AssignmentTargetPropertyProperty","AssignmentTargetWithDefault","AwaitExpression","BinaryExpression","BindingIdentifier","BindingPropertyIdentifier","BindingPropertyProperty","BindingWithDefault","Block","BlockStatement","BreakStatement","CallExpression","CatchClause","ClassDeclaration","ClassElement","ClassExpression","CompoundAssignmentExpression","ComputedMemberAssignmentTarget","ComputedMemberExpression","ComputedPropertyName","ConditionalExpression","ContinueStatement","DataProperty","DebuggerStatement","Directive","DoWhileStatement","EmptyStatement","Export","ExportAllFrom","ExportDefault","ExportFrom","ExportFromSpecifier","ExportLocalSpecifier","ExportLocals","ExpressionStatement","ForAwaitStatement","ForInStatement","ForOfStatement","ForStatement","FormalParameters","FunctionBody","FunctionDeclaration","FunctionExpression","Getter","IdentifierExpression","IfStatement","Import","ImportNamespace","ImportSpecifier","LabeledStatement","LiteralBooleanExpression","LiteralInfinityExpression","LiteralNullExpression","LiteralNumericExpression","LiteralRegExpExpression","LiteralStringExpression","Method","Module","NewExpression","NewTargetExpression","ObjectAssignmentTarget","ObjectBinding","ObjectExpression","ReturnStatement","Script","Setter","ShorthandProperty","SpreadElement","SpreadProperty","StaticMemberAssignmentTarget","StaticMemberExpression","StaticPropertyName","Super","SwitchCase","SwitchDefault","SwitchStatement","SwitchStatementWithDefault","TemplateElement","TemplateExpression","ThisExpression","ThrowStatement","TryCatchStatement","TryFinallyStatement","UnaryExpression","UpdateExpression","VariableDeclaration","VariableDeclarationStatement","VariableDeclarator","WhileStatement","WithStatement","YieldExpression","YieldGeneratorExpression"]},b={typeName:"Enum",values:["==","!=","===","!==","<","<=",">",">=","in","instanceof","<<",">>",">>>","+","-","*","/","%","**",",","||","&&","|","^","&"]},$={typeName:"Enum",values:["+=","-=","*=","/=","%=","**=","<<=",">>=",">>>=","|=","^=","&="]},j={typeName:"Enum",values:["+","-","!","~","typeof","void","delete"]},_e={typeName:"Enum",values:["++","--"]},et={typeName:"Enum",values:["var","let","const"]},tt=o.ArrayAssignmentTarget={},nt=o.ArrayBinding={},st=o.ArrayExpression={},rt=o.ArrowExpression={},it=o.AssignmentExpression={},at=o.AssignmentTargetIdentifier={},ot=o.AssignmentTargetPropertyIdentifier={},ut=o.AssignmentTargetPropertyProperty={},ct=o.AssignmentTargetWithDefault={},ht=o.AwaitExpression={},lt=o.BinaryExpression={},pt=o.BindingIdentifier={},ft=o.BindingPropertyIdentifier={},gt=o.BindingPropertyProperty={},yt=o.BindingWithDefault={},mt=o.Block={},Et=o.BlockStatement={},Ot=o.BreakStatement={},St=o.CallExpression={},At=o.CatchClause={},dt=o.ClassDeclaration={},Dt=o.ClassElement={},Ct=o.ClassExpression={},xt=o.CompoundAssignmentExpression={},Tt=o.ComputedMemberAssignmentTarget={},kt=o.ComputedMemberExpression={},_t=o.ComputedPropertyName={},Bt=o.ConditionalExpression={},Ft=o.ContinueStatement={},Lt=o.DataProperty={},tr=o.DebuggerStatement={},Wt=o.Directive={},rr=o.DoWhileStatement={},nr=o.EmptyStatement={},ir=o.Export={},sr=o.ExportAllFrom={},ar=o.ExportDefault={},or=o.ExportFrom={},Xt=o.ExportFromSpecifier={},Ht=o.ExportLocalSpecifier={},ur=o.ExportLocals={},lr=o.ExpressionStatement={},cr=o.ForAwaitStatement={},hr=o.ForInStatement={},fr=o.ForOfStatement={},dr=o.ForStatement={},Qt=o.FormalParameters={},It=o.FunctionBody={},zt=o.FunctionDeclaration={},Zt=o.FunctionExpression={},mr=o.Getter={},Gt=o.IdentifierExpression={},gr=o.IfStatement={},yr=o.Import={},Er=o.ImportNamespace={},Yt=o.ImportSpecifier={},Dr=o.LabeledStatement={},Or=o.LiteralBooleanExpression={},Cr=o.LiteralInfinityExpression={},Sr=o.LiteralNullExpression={},Ar=o.LiteralNumericExpression={},vr=o.LiteralRegExpExpression={},xr=o.LiteralStringExpression={},Tr=o.Method={},kr=o.Module={},_r=o.NewExpression={},br=o.NewTargetExpression={},Pt=o.ObjectAssignmentTarget={},wt=o.ObjectBinding={},Fr=o.ObjectExpression={},Br=o.ReturnStatement={},wr=o.Script={},Pr=o.Setter={},$r=o.ShorthandProperty={},Vt=o.SpreadElement={},Rr=o.SpreadProperty={},Ir=o.StaticMemberAssignmentTarget={},Nr=o.StaticMemberExpression={},Lr=o.StaticPropertyName={},Mt=o.Super={},qt=o.SwitchCase={},Kt=o.SwitchDefault={},Mr=o.SwitchStatement={},Qr=o.SwitchStatementWithDefault={},Jt=o.TemplateElement={},jr=o.TemplateExpression={},Wr=o.ThisExpression={},zr=o.ThrowStatement={},Gr=o.TryCatchStatement={},Vr=o.TryFinallyStatement={},qr=o.UnaryExpression={},Ur=o.UpdateExpression={},Nt=o.VariableDeclaration={},Xr=o.VariableDeclarationStatement={},er=o.VariableDeclarator={},Hr=o.WhileStatement={},Zr=o.WithStatement={},Yr=o.YieldExpression={},Kr=o.YieldGeneratorExpression={},an=g(kt,Nr),Jr=g(ot,ut);g(dt,Ct);var en=g(ir,sr,ar,or,ur),jt=g(_t,Lr);g(zt,Zt);var tn=g(yr,Er),un=g(rr,cr,hr,fr,dr,Hr),$t=g(Tt,Ir),rn=g(ft,gt),nn=g(mr,Tr,Pr),ln=g(kr,wr),cn=g(at,pt,Gt),hn=g(Lt,nn),vt=g(st,rt,it,ht,lt,St,Ct,xt,Bt,Zt,Gt,Or,Cr,Sr,Ar,vr,xr,an,_r,br,Fr,jr,Wr,qr,Ur,Yr,Kr),bt=g(Et,Ot,dt,Ft,tr,nr,lr,zt,gr,un,Dr,Br,Mr,Qr,zr,Gr,Vr,Xr,Zr),sn=g(hn,$r,Rr);return g(tt,nt,Jr,ct,rn,yt,mt,At,Dt,Wt,en,Xt,Ht,vt,Qt,It,tn,Yt,$t,Pt,wt,sn,ln,jt,Vt,bt,Mt,qt,Kt,Jt,Nt,er,cn),tt.typeName="ArrayAssignmentTarget",tt.fields=[{name:"type",type:d(_),value:"ArrayAssignmentTarget"},{name:"elements",type:h(c(g(ct,g(g(tt,Pt),g(at,$t)))))},{name:"rest",type:c(g(g(tt,Pt),g(at,$t)))}],nt.typeName="ArrayBinding",nt.fields=[{name:"type",type:d(_),value:"ArrayBinding"},{name:"elements",type:h(c(g(yt,g(pt,g(nt,wt)))))},{name:"rest",type:c(g(pt,g(nt,wt)))}],st.typeName="ArrayExpression",st.fields=[{name:"type",type:d(_),value:"ArrayExpression"},{name:"elements",type:h(c(g(vt,Vt)))}],rt.typeName="ArrowExpression",rt.fields=[{name:"type",type:d(_),value:"ArrowExpression"},{name:"isAsync",type:e},{name:"params",type:Qt},{name:"body",type:g(vt,It)}],it.typeName="AssignmentExpression",it.fields=[{name:"type",type:d(_),value:"AssignmentExpression"},{name:"binding",type:g(g(tt,Pt),g(at,$t))},{name:"expression",type:vt}],at.typeName="AssignmentTargetIdentifier",at.fields=[{name:"type",type:d(_),value:"AssignmentTargetIdentifier"},{name:"name",type:a}],ot.typeName="AssignmentTargetPropertyIdentifier",ot.fields=[{name:"type",type:d(_),value:"AssignmentTargetPropertyIdentifier"},{name:"binding",type:at},{name:"init",type:c(vt)}],ut.typeName="AssignmentTargetPropertyProperty",ut.fields=[{name:"type",type:d(_),value:"AssignmentTargetPropertyProperty"},{name:"name",type:jt},{name:"binding",type:g(ct,g(g(tt,Pt),g(at,$t)))}],ct.typeName="AssignmentTargetWithDefault",ct.fields=[{name:"type",type:d(_),value:"AssignmentTargetWithDefault"},{name:"binding",type:g(g(tt,Pt),g(at,$t))},{name:"init",type:vt}],ht.typeName="AwaitExpression",ht.fields=[{name:"type",type:d(_),value:"AwaitExpression"},{name:"expression",type:vt}],lt.typeName="BinaryExpression",lt.fields=[{name:"type",type:d(_),value:"BinaryExpression"},{name:"left",type:vt},{name:"operator",type:b},{name:"right",type:vt}],pt.typeName="BindingIdentifier",pt.fields=[{name:"type",type:d(_),value:"BindingIdentifier"},{name:"name",type:a}],ft.typeName="BindingPropertyIdentifier",ft.fields=[{name:"type",type:d(_),value:"BindingPropertyIdentifier"},{name:"binding",type:pt},{name:"init",type:c(vt)}],gt.typeName="BindingPropertyProperty",gt.fields=[{name:"type",type:d(_),value:"BindingPropertyProperty"},{name:"name",type:jt},{name:"binding",type:g(yt,g(pt,g(nt,wt)))}],yt.typeName="BindingWithDefault",yt.fields=[{name:"type",type:d(_),value:"BindingWithDefault"},{name:"binding",type:g(pt,g(nt,wt))},{name:"init",type:vt}],mt.typeName="Block",mt.fields=[{name:"type",type:d(_),value:"Block"},{name:"statements",type:h(bt)}],Et.typeName="BlockStatement",Et.fields=[{name:"type",type:d(_),value:"BlockStatement"},{name:"block",type:mt}],Ot.typeName="BreakStatement",Ot.fields=[{name:"type",type:d(_),value:"BreakStatement"},{name:"label",type:c(a)}],St.typeName="CallExpression",St.fields=[{name:"type",type:d(_),value:"CallExpression"},{name:"callee",type:g(vt,Mt)},{name:"arguments",type:h(g(vt,Vt))}],At.typeName="CatchClause",At.fields=[{name:"type",type:d(_),value:"CatchClause"},{name:"binding",type:g(pt,g(nt,wt))},{name:"body",type:mt}],dt.typeName="ClassDeclaration",dt.fields=[{name:"type",type:d(_),value:"ClassDeclaration"},{name:"name",type:pt},{name:"super",type:c(vt)},{name:"elements",type:h(Dt)}],Dt.typeName="ClassElement",Dt.fields=[{name:"type",type:d(_),value:"ClassElement"},{name:"isStatic",type:e},{name:"method",type:nn}],Ct.typeName="ClassExpression",Ct.fields=[{name:"type",type:d(_),value:"ClassExpression"},{name:"name",type:c(pt)},{name:"super",type:c(vt)},{name:"elements",type:h(Dt)}],xt.typeName="CompoundAssignmentExpression",xt.fields=[{name:"type",type:d(_),value:"CompoundAssignmentExpression"},{name:"binding",type:g(at,$t)},{name:"operator",type:$},{name:"expression",type:vt}],Tt.typeName="ComputedMemberAssignmentTarget",Tt.fields=[{name:"type",type:d(_),value:"ComputedMemberAssignmentTarget"},{name:"object",type:g(vt,Mt)},{name:"expression",type:vt}],kt.typeName="ComputedMemberExpression",kt.fields=[{name:"type",type:d(_),value:"ComputedMemberExpression"},{name:"object",type:g(vt,Mt)},{name:"expression",type:vt}],_t.typeName="ComputedPropertyName",_t.fields=[{name:"type",type:d(_),value:"ComputedPropertyName"},{name:"expression",type:vt}],Bt.typeName="ConditionalExpression",Bt.fields=[{name:"type",type:d(_),value:"ConditionalExpression"},{name:"test",type:vt},{name:"consequent",type:vt},{name:"alternate",type:vt}],Ft.typeName="ContinueStatement",Ft.fields=[{name:"type",type:d(_),value:"ContinueStatement"},{name:"label",type:c(a)}],Lt.typeName="DataProperty",Lt.fields=[{name:"type",type:d(_),value:"DataProperty"},{name:"name",type:jt},{name:"expression",type:vt}],tr.typeName="DebuggerStatement",tr.fields=[{name:"type",type:d(_),value:"DebuggerStatement"}],Wt.typeName="Directive",Wt.fields=[{name:"type",type:d(_),value:"Directive"},{name:"rawValue",type:a}],rr.typeName="DoWhileStatement",rr.fields=[{name:"type",type:d(_),value:"DoWhileStatement"},{name:"body",type:bt},{name:"test",type:vt}],nr.typeName="EmptyStatement",nr.fields=[{name:"type",type:d(_),value:"EmptyStatement"}],ir.typeName="Export",ir.fields=[{name:"type",type:d(_),value:"Export"},{name:"declaration",type:g(dt,zt,Nt)}],sr.typeName="ExportAllFrom",sr.fields=[{name:"type",type:d(_),value:"ExportAllFrom"},{name:"moduleSpecifier",type:a}],ar.typeName="ExportDefault",ar.fields=[{name:"type",type:d(_),value:"ExportDefault"},{name:"body",type:g(dt,vt,zt)}],or.typeName="ExportFrom",or.fields=[{name:"type",type:d(_),value:"ExportFrom"},{name:"namedExports",type:h(Xt)},{name:"moduleSpecifier",type:a}],Xt.typeName="ExportFromSpecifier",Xt.fields=[{name:"type",type:d(_),value:"ExportFromSpecifier"},{name:"name",type:a},{name:"exportedName",type:c(a)}],Ht.typeName="ExportLocalSpecifier",Ht.fields=[{name:"type",type:d(_),value:"ExportLocalSpecifier"},{name:"name",type:Gt},{name:"exportedName",type:c(a)}],ur.typeName="ExportLocals",ur.fields=[{name:"type",type:d(_),value:"ExportLocals"},{name:"namedExports",type:h(Ht)}],lr.typeName="ExpressionStatement",lr.fields=[{name:"type",type:d(_),value:"ExpressionStatement"},{name:"expression",type:vt}],cr.typeName="ForAwaitStatement",cr.fields=[{name:"type",type:d(_),value:"ForAwaitStatement"},{name:"left",type:g(g(g(tt,Pt),g(at,$t)),Nt)},{name:"right",type:vt},{name:"body",type:bt}],hr.typeName="ForInStatement",hr.fields=[{name:"type",type:d(_),value:"ForInStatement"},{name:"left",type:g(g(g(tt,Pt),g(at,$t)),Nt)},{name:"right",type:vt},{name:"body",type:bt}],fr.typeName="ForOfStatement",fr.fields=[{name:"type",type:d(_),value:"ForOfStatement"},{name:"left",type:g(g(g(tt,Pt),g(at,$t)),Nt)},{name:"right",type:vt},{name:"body",type:bt}],dr.typeName="ForStatement",dr.fields=[{name:"type",type:d(_),value:"ForStatement"},{name:"init",type:c(g(vt,Nt))},{name:"test",type:c(vt)},{name:"update",type:c(vt)},{name:"body",type:bt}],Qt.typeName="FormalParameters",Qt.fields=[{name:"type",type:d(_),value:"FormalParameters"},{name:"items",type:h(g(yt,g(pt,g(nt,wt))))},{name:"rest",type:c(g(pt,g(nt,wt)))}],It.typeName="FunctionBody",It.fields=[{name:"type",type:d(_),value:"FunctionBody"},{name:"directives",type:h(Wt)},{name:"statements",type:h(bt)}],zt.typeName="FunctionDeclaration",zt.fields=[{name:"type",type:d(_),value:"FunctionDeclaration"},{name:"isAsync",type:e},{name:"isGenerator",type:e},{name:"name",type:pt},{name:"params",type:Qt},{name:"body",type:It}],Zt.typeName="FunctionExpression",Zt.fields=[{name:"type",type:d(_),value:"FunctionExpression"},{name:"isAsync",type:e},{name:"isGenerator",type:e},{name:"name",type:c(pt)},{name:"params",type:Qt},{name:"body",type:It}],mr.typeName="Getter",mr.fields=[{name:"type",type:d(_),value:"Getter"},{name:"name",type:jt},{name:"body",type:It}],Gt.typeName="IdentifierExpression",Gt.fields=[{name:"type",type:d(_),value:"IdentifierExpression"},{name:"name",type:a}],gr.typeName="IfStatement",gr.fields=[{name:"type",type:d(_),value:"IfStatement"},{name:"test",type:vt},{name:"consequent",type:bt},{name:"alternate",type:c(bt)}],yr.typeName="Import",yr.fields=[{name:"type",type:d(_),value:"Import"},{name:"defaultBinding",type:c(pt)},{name:"namedImports",type:h(Yt)},{name:"moduleSpecifier",type:a}],Er.typeName="ImportNamespace",Er.fields=[{name:"type",type:d(_),value:"ImportNamespace"},{name:"defaultBinding",type:c(pt)},{name:"namespaceBinding",type:pt},{name:"moduleSpecifier",type:a}],Yt.typeName="ImportSpecifier",Yt.fields=[{name:"type",type:d(_),value:"ImportSpecifier"},{name:"name",type:c(a)},{name:"binding",type:pt}],Dr.typeName="LabeledStatement",Dr.fields=[{name:"type",type:d(_),value:"LabeledStatement"},{name:"label",type:a},{name:"body",type:bt}],Or.typeName="LiteralBooleanExpression",Or.fields=[{name:"type",type:d(_),value:"LiteralBooleanExpression"},{name:"value",type:e}],Cr.typeName="LiteralInfinityExpression",Cr.fields=[{name:"type",type:d(_),value:"LiteralInfinityExpression"}],Sr.typeName="LiteralNullExpression",Sr.fields=[{name:"type",type:d(_),value:"LiteralNullExpression"}],Ar.typeName="LiteralNumericExpression",Ar.fields=[{name:"type",type:d(_),value:"LiteralNumericExpression"},{name:"value",type:s}],vr.typeName="LiteralRegExpExpression",vr.fields=[{name:"type",type:d(_),value:"LiteralRegExpExpression"},{name:"pattern",type:a},{name:"global",type:e},{name:"ignoreCase",type:e},{name:"multiLine",type:e},{name:"dotAll",type:e},{name:"unicode",type:e},{name:"sticky",type:e}],xr.typeName="LiteralStringExpression",xr.fields=[{name:"type",type:d(_),value:"LiteralStringExpression"},{name:"value",type:a}],Tr.typeName="Method",Tr.fields=[{name:"type",type:d(_),value:"Method"},{name:"isAsync",type:e},{name:"isGenerator",type:e},{name:"name",type:jt},{name:"params",type:Qt},{name:"body",type:It}],kr.typeName="Module",kr.fields=[{name:"type",type:d(_),value:"Module"},{name:"directives",type:h(Wt)},{name:"items",type:h(g(en,tn,bt))}],_r.typeName="NewExpression",_r.fields=[{name:"type",type:d(_),value:"NewExpression"},{name:"callee",type:vt},{name:"arguments",type:h(g(vt,Vt))}],br.typeName="NewTargetExpression",br.fields=[{name:"type",type:d(_),value:"NewTargetExpression"}],Pt.typeName="ObjectAssignmentTarget",Pt.fields=[{name:"type",type:d(_),value:"ObjectAssignmentTarget"},{name:"properties",type:h(Jr)},{name:"rest",type:c(g(g(tt,Pt),g(at,$t)))}],wt.typeName="ObjectBinding",wt.fields=[{name:"type",type:d(_),value:"ObjectBinding"},{name:"properties",type:h(rn)},{name:"rest",type:c(g(pt,g(nt,wt)))}],Fr.typeName="ObjectExpression",Fr.fields=[{name:"type",type:d(_),value:"ObjectExpression"},{name:"properties",type:h(sn)}],Br.typeName="ReturnStatement",Br.fields=[{name:"type",type:d(_),value:"ReturnStatement"},{name:"expression",type:c(vt)}],wr.typeName="Script",wr.fields=[{name:"type",type:d(_),value:"Script"},{name:"directives",type:h(Wt)},{name:"statements",type:h(bt)}],Pr.typeName="Setter",Pr.fields=[{name:"type",type:d(_),value:"Setter"},{name:"name",type:jt},{name:"param",type:g(yt,g(pt,g(nt,wt)))},{name:"body",type:It}],$r.typeName="ShorthandProperty",$r.fields=[{name:"type",type:d(_),value:"ShorthandProperty"},{name:"name",type:Gt}],Vt.typeName="SpreadElement",Vt.fields=[{name:"type",type:d(_),value:"SpreadElement"},{name:"expression",type:vt}],Rr.typeName="SpreadProperty",Rr.fields=[{name:"type",type:d(_),value:"SpreadProperty"},{name:"expression",type:vt}],Ir.typeName="StaticMemberAssignmentTarget",Ir.fields=[{name:"type",type:d(_),value:"StaticMemberAssignmentTarget"},{name:"object",type:g(vt,Mt)},{name:"property",type:a}],Nr.typeName="StaticMemberExpression",Nr.fields=[{name:"type",type:d(_),value:"StaticMemberExpression"},{name:"object",type:g(vt,Mt)},{name:"property",type:a}],Lr.typeName="StaticPropertyName",Lr.fields=[{name:"type",type:d(_),value:"StaticPropertyName"},{name:"value",type:a}],Mt.typeName="Super",Mt.fields=[{name:"type",type:d(_),value:"Super"}],qt.typeName="SwitchCase",qt.fields=[{name:"type",type:d(_),value:"SwitchCase"},{name:"test",type:vt},{name:"consequent",type:h(bt)}],Kt.typeName="SwitchDefault",Kt.fields=[{name:"type",type:d(_),value:"SwitchDefault"},{name:"consequent",type:h(bt)}],Mr.typeName="SwitchStatement",Mr.fields=[{name:"type",type:d(_),value:"SwitchStatement"},{name:"discriminant",type:vt},{name:"cases",type:h(qt)}],Qr.typeName="SwitchStatementWithDefault",Qr.fields=[{name:"type",type:d(_),value:"SwitchStatementWithDefault"},{name:"discriminant",type:vt},{name:"preDefaultCases",type:h(qt)},{name:"defaultCase",type:Kt},{name:"postDefaultCases",type:h(qt)}],Jt.typeName="TemplateElement",Jt.fields=[{name:"type",type:d(_),value:"TemplateElement"},{name:"rawValue",type:a}],jr.typeName="TemplateExpression",jr.fields=[{name:"type",type:d(_),value:"TemplateExpression"},{name:"tag",type:c(vt)},{name:"elements",type:h(g(vt,Jt))}],Wr.typeName="ThisExpression",Wr.fields=[{name:"type",type:d(_),value:"ThisExpression"}],zr.typeName="ThrowStatement",zr.fields=[{name:"type",type:d(_),value:"ThrowStatement"},{name:"expression",type:vt}],Gr.typeName="TryCatchStatement",Gr.fields=[{name:"type",type:d(_),value:"TryCatchStatement"},{name:"body",type:mt},{name:"catchClause",type:At}],Vr.typeName="TryFinallyStatement",Vr.fields=[{name:"type",type:d(_),value:"TryFinallyStatement"},{name:"body",type:mt},{name:"catchClause",type:c(At)},{name:"finalizer",type:mt}],qr.typeName="UnaryExpression",qr.fields=[{name:"type",type:d(_),value:"UnaryExpression"},{name:"operator",type:j},{name:"operand",type:vt}],Ur.typeName="UpdateExpression",Ur.fields=[{name:"type",type:d(_),value:"UpdateExpression"},{name:"isPrefix",type:e},{name:"operator",type:_e},{name:"operand",type:g(at,$t)}],Nt.typeName="VariableDeclaration",Nt.fields=[{name:"type",type:d(_),value:"VariableDeclaration"},{name:"kind",type:et},{name:"declarators",type:h(er)}],Xr.typeName="VariableDeclarationStatement",Xr.fields=[{name:"type",type:d(_),value:"VariableDeclarationStatement"},{name:"declaration",type:Nt}],er.typeName="VariableDeclarator",er.fields=[{name:"type",type:d(_),value:"VariableDeclarator"},{name:"binding",type:g(pt,g(nt,wt))},{name:"init",type:c(vt)}],Hr.typeName="WhileStatement",Hr.fields=[{name:"type",type:d(_),value:"WhileStatement"},{name:"test",type:vt},{name:"body",type:bt}],Zr.typeName="WithStatement",Zr.fields=[{name:"type",type:d(_),value:"WithStatement"},{name:"object",type:vt},{name:"body",type:bt}],Yr.typeName="YieldExpression",Yr.fields=[{name:"type",type:d(_),value:"YieldExpression"},{name:"expression",type:c(vt)}],Kr.typeName="YieldGeneratorExpression",Kr.fields=[{name:"type",type:d(_),value:"YieldGeneratorExpression"},{name:"expression",type:vt}],o}(),estraverse$1={};(function(o){(function e(s){var a,c,h,d,g,_;function b(ut){var ct={},ht,lt;for(ht in ut)ut.hasOwnProperty(ht)&&(lt=ut[ht],typeof lt=="object"&<!==null?ct[ht]=b(lt):ct[ht]=lt);return ct}function $(ut,ct){var ht,lt,pt,ft;for(lt=ut.length,pt=0;lt;)ht=lt>>>1,ft=pt+ht,ct(ut[ft])?lt=ht:(pt=ft+1,lt-=ht+1);return pt}a={AssignmentExpression:"AssignmentExpression",AssignmentPattern:"AssignmentPattern",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",AwaitExpression:"AwaitExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ChainExpression:"ChainExpression",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ComprehensionBlock:"ComprehensionBlock",ComprehensionExpression:"ComprehensionExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DebuggerStatement:"DebuggerStatement",DirectiveStatement:"DirectiveStatement",DoWhileStatement:"DoWhileStatement",EmptyStatement:"EmptyStatement",ExportAllDeclaration:"ExportAllDeclaration",ExportDefaultDeclaration:"ExportDefaultDeclaration",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",ForOfStatement:"ForOfStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",GeneratorExpression:"GeneratorExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportExpression:"ImportExpression",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MetaProperty:"MetaProperty",MethodDefinition:"MethodDefinition",ModuleSpecifier:"ModuleSpecifier",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",PrivateIdentifier:"PrivateIdentifier",Program:"Program",Property:"Property",PropertyDefinition:"PropertyDefinition",RestElement:"RestElement",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",Super:"Super",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"},h={AssignmentExpression:["left","right"],AssignmentPattern:["left","right"],ArrayExpression:["elements"],ArrayPattern:["elements"],ArrowFunctionExpression:["params","body"],AwaitExpression:["argument"],BlockStatement:["body"],BinaryExpression:["left","right"],BreakStatement:["label"],CallExpression:["callee","arguments"],CatchClause:["param","body"],ChainExpression:["expression"],ClassBody:["body"],ClassDeclaration:["id","superClass","body"],ClassExpression:["id","superClass","body"],ComprehensionBlock:["left","right"],ComprehensionExpression:["blocks","filter","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DirectiveStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExportAllDeclaration:["source"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source"],ExportSpecifier:["exported","local"],ExpressionStatement:["expression"],ForStatement:["init","test","update","body"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],FunctionDeclaration:["id","params","body"],FunctionExpression:["id","params","body"],GeneratorExpression:["blocks","filter","body"],Identifier:[],IfStatement:["test","consequent","alternate"],ImportExpression:["source"],ImportDeclaration:["specifiers","source"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],Literal:[],LabeledStatement:["label","body"],LogicalExpression:["left","right"],MemberExpression:["object","property"],MetaProperty:["meta","property"],MethodDefinition:["key","value"],ModuleSpecifier:[],NewExpression:["callee","arguments"],ObjectExpression:["properties"],ObjectPattern:["properties"],PrivateIdentifier:[],Program:["body"],Property:["key","value"],PropertyDefinition:["key","value"],RestElement:["argument"],ReturnStatement:["argument"],SequenceExpression:["expressions"],SpreadElement:["argument"],Super:[],SwitchStatement:["discriminant","cases"],SwitchCase:["test","consequent"],TaggedTemplateExpression:["tag","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],YieldExpression:["argument"]},d={},g={},_={},c={Break:d,Skip:g,Remove:_};function j(ut,ct){this.parent=ut,this.key=ct}j.prototype.replace=function(ct){this.parent[this.key]=ct},j.prototype.remove=function(){return Array.isArray(this.parent)?(this.parent.splice(this.key,1),!0):(this.replace(null),!1)};function _e(ut,ct,ht,lt){this.node=ut,this.path=ct,this.wrap=ht,this.ref=lt}function et(){}et.prototype.path=function(){var ct,ht,lt,pt,ft,gt;function yt(mt,Et){if(Array.isArray(Et))for(lt=0,pt=Et.length;lt=0;--ht)if(ut[ht].node===ct)return!0;return!1}et.prototype.traverse=function(ct,ht){var lt,pt,ft,gt,yt,mt,Et,Ot,St,At,dt,Dt;for(this.__initialize(ct,ht),Dt={},lt=this.__worklist,pt=this.__leavelist,lt.push(new _e(ct,null,null,null)),pt.push(new _e(null,null,null,null));lt.length;){if(ft=lt.pop(),ft===Dt){if(ft=pt.pop(),mt=this.__execute(ht.leave,ft),this.__state===d||mt===d)return;continue}if(ft.node){if(mt=this.__execute(ht.enter,ft),this.__state===d||mt===d)return;if(lt.push(Dt),pt.push(ft),this.__state===g||mt===g)continue;if(gt=ft.node,yt=gt.type||ft.wrap,At=this.__keys[yt],!At)if(this.__fallback)At=this.__fallback(gt);else throw new Error("Unknown node type "+yt+".");for(Ot=At.length;(Ot-=1)>=0;)if(Et=At[Ot],dt=gt[Et],!!dt){if(Array.isArray(dt)){for(St=dt.length;(St-=1)>=0;)if(!!dt[St]&&!st(pt,dt[St])){if(nt(yt,At[Ot]))ft=new _e(dt[St],[Et,St],"Property",null);else if(tt(dt[St]))ft=new _e(dt[St],[Et,St],null,null);else continue;lt.push(ft)}}else if(tt(dt)){if(st(pt,dt))continue;lt.push(new _e(dt,Et,null,null))}}}}},et.prototype.replace=function(ct,ht){var lt,pt,ft,gt,yt,mt,Et,Ot,St,At,dt,Dt,Ct;function xt(Tt){var kt,_t,Bt,Ft;if(Tt.ref.remove()){for(_t=Tt.ref.key,Ft=Tt.ref.parent,kt=lt.length;kt--;)if(Bt=lt[kt],Bt.ref&&Bt.ref.parent===Ft){if(Bt.ref.key<_t)break;--Bt.ref.key}}}for(this.__initialize(ct,ht),dt={},lt=this.__worklist,pt=this.__leavelist,Dt={root:ct},mt=new _e(ct,null,null,new j(Dt,"root")),lt.push(mt),pt.push(mt);lt.length;){if(mt=lt.pop(),mt===dt){if(mt=pt.pop(),yt=this.__execute(ht.leave,mt),yt!==void 0&&yt!==d&&yt!==g&&yt!==_&&mt.ref.replace(yt),(this.__state===_||yt===_)&&xt(mt),this.__state===d||yt===d)return Dt.root;continue}if(yt=this.__execute(ht.enter,mt),yt!==void 0&&yt!==d&&yt!==g&&yt!==_&&(mt.ref.replace(yt),mt.node=yt),(this.__state===_||yt===_)&&(xt(mt),mt.node=null),this.__state===d||yt===d)return Dt.root;if(ft=mt.node,!!ft&&(lt.push(dt),pt.push(mt),!(this.__state===g||yt===g))){if(gt=ft.type||mt.wrap,St=this.__keys[gt],!St)if(this.__fallback)St=this.__fallback(ft);else throw new Error("Unknown node type "+gt+".");for(Et=St.length;(Et-=1)>=0;)if(Ct=St[Et],At=ft[Ct],!!At)if(Array.isArray(At)){for(Ot=At.length;(Ot-=1)>=0;)if(!!At[Ot]){if(nt(gt,St[Et]))mt=new _e(At[Ot],[Ct,Ot],"Property",new j(At,Ot));else if(tt(At[Ot]))mt=new _e(At[Ot],[Ct,Ot],null,new j(At,Ot));else continue;lt.push(mt)}}else tt(At)&<.push(new _e(At,Ct,null,new j(ft,Ct)))}}return Dt.root};function rt(ut,ct){var ht=new et;return ht.traverse(ut,ct)}function it(ut,ct){var ht=new et;return ht.replace(ut,ct)}function at(ut,ct){var ht;return ht=$(ct,function(pt){return pt.range[0]>ut.range[0]}),ut.extendedRange=[ut.range[0],ut.range[1]],ht!==ct.length&&(ut.extendedRange[1]=ct[ht].range[0]),ht-=1,ht>=0&&(ut.extendedRange[0]=ct[ht].range[1]),ut}function ot(ut,ct,ht){var lt=[],pt,ft,gt,yt;if(!ut.range)throw new Error("attachComments needs range information");if(!ht.length){if(ct.length){for(gt=0,ft=ct.length;gtmt.range[0]));)Et.extendedRange[1]===mt.range[0]?(mt.leadingComments||(mt.leadingComments=[]),mt.leadingComments.push(Et),lt.splice(yt,1)):yt+=1;if(yt===lt.length)return c.Break;if(lt[yt].extendedRange[0]>mt.range[1])return c.Skip}}),yt=0,rt(ut,{leave:function(mt){for(var Et;ytmt.range[1])return c.Skip}}),ut}return s.Syntax=a,s.traverse=rt,s.replace=it,s.attachComments=ot,s.VisitorKeys=h,s.VisitorOption=c,s.Controller=et,s.cloneEnvironment=function(){return e({})},s})(o)})(estraverse$1);const Spec=_default.default||_default,estraverse=estraverse$1.cloneEnvironment();Object.keys(estraverse.Syntax).filter(o=>o!=="Property").forEach(o=>{delete estraverse.Syntax[o],delete estraverse.VisitorKeys[o]});Object.assign(estraverse.Syntax,Object.keys(Spec).reduce((o,e)=>(o[e]=e,o),{}));Object.assign(estraverse.VisitorKeys,Object.keys(Spec).reduce((o,e)=>(o[e]=Spec[e].fields.map(s=>s.name),o),{}));var dist$1={},StaticMemberExpression_1,ReturnStatement_1,LiteralStringExpression_1,LiteralNumericExpression_1,IdentifierExpression_1,CallExpression_1,ArrayExpression_1;Object.defineProperty(dist$1,"__esModule",{value:!0});function _classCallCheck$5(o,e){if(!(o instanceof e))throw new TypeError("Cannot call a class as a function")}dist$1.ArrayAssignmentTarget=function o(e){var s=e.elements,a=e.rest;_classCallCheck$5(this,o),this.type="ArrayAssignmentTarget",this.elements=s,this.rest=a};dist$1.ArrayBinding=function o(e){var s=e.elements,a=e.rest;_classCallCheck$5(this,o),this.type="ArrayBinding",this.elements=s,this.rest=a};ArrayExpression_1=dist$1.ArrayExpression=function o(e){var s=e.elements;_classCallCheck$5(this,o),this.type="ArrayExpression",this.elements=s};dist$1.ArrowExpression=function o(e){var s=e.isAsync,a=e.params,c=e.body;_classCallCheck$5(this,o),this.type="ArrowExpression",this.isAsync=s,this.params=a,this.body=c};dist$1.AssignmentExpression=function o(e){var s=e.binding,a=e.expression;_classCallCheck$5(this,o),this.type="AssignmentExpression",this.binding=s,this.expression=a};dist$1.AssignmentTargetIdentifier=function o(e){var s=e.name;_classCallCheck$5(this,o),this.type="AssignmentTargetIdentifier",this.name=s};dist$1.AssignmentTargetPropertyIdentifier=function o(e){var s=e.binding,a=e.init;_classCallCheck$5(this,o),this.type="AssignmentTargetPropertyIdentifier",this.binding=s,this.init=a};dist$1.AssignmentTargetPropertyProperty=function o(e){var s=e.name,a=e.binding;_classCallCheck$5(this,o),this.type="AssignmentTargetPropertyProperty",this.name=s,this.binding=a};dist$1.AssignmentTargetWithDefault=function o(e){var s=e.binding,a=e.init;_classCallCheck$5(this,o),this.type="AssignmentTargetWithDefault",this.binding=s,this.init=a};dist$1.AwaitExpression=function o(e){var s=e.expression;_classCallCheck$5(this,o),this.type="AwaitExpression",this.expression=s};dist$1.BinaryExpression=function o(e){var s=e.left,a=e.operator,c=e.right;_classCallCheck$5(this,o),this.type="BinaryExpression",this.left=s,this.operator=a,this.right=c};dist$1.BindingIdentifier=function o(e){var s=e.name;_classCallCheck$5(this,o),this.type="BindingIdentifier",this.name=s};dist$1.BindingPropertyIdentifier=function o(e){var s=e.binding,a=e.init;_classCallCheck$5(this,o),this.type="BindingPropertyIdentifier",this.binding=s,this.init=a};dist$1.BindingPropertyProperty=function o(e){var s=e.name,a=e.binding;_classCallCheck$5(this,o),this.type="BindingPropertyProperty",this.name=s,this.binding=a};dist$1.BindingWithDefault=function o(e){var s=e.binding,a=e.init;_classCallCheck$5(this,o),this.type="BindingWithDefault",this.binding=s,this.init=a};dist$1.Block=function o(e){var s=e.statements;_classCallCheck$5(this,o),this.type="Block",this.statements=s};dist$1.BlockStatement=function o(e){var s=e.block;_classCallCheck$5(this,o),this.type="BlockStatement",this.block=s};dist$1.BreakStatement=function o(e){var s=e.label;_classCallCheck$5(this,o),this.type="BreakStatement",this.label=s};CallExpression_1=dist$1.CallExpression=function o(e){var s=e.callee,a=e.arguments;_classCallCheck$5(this,o),this.type="CallExpression",this.callee=s,this.arguments=a};dist$1.CatchClause=function o(e){var s=e.binding,a=e.body;_classCallCheck$5(this,o),this.type="CatchClause",this.binding=s,this.body=a};dist$1.ClassDeclaration=function o(e){var s=e.name,a=e.super,c=e.elements;_classCallCheck$5(this,o),this.type="ClassDeclaration",this.name=s,this.super=a,this.elements=c};dist$1.ClassElement=function o(e){var s=e.isStatic,a=e.method;_classCallCheck$5(this,o),this.type="ClassElement",this.isStatic=s,this.method=a};dist$1.ClassExpression=function o(e){var s=e.name,a=e.super,c=e.elements;_classCallCheck$5(this,o),this.type="ClassExpression",this.name=s,this.super=a,this.elements=c};dist$1.CompoundAssignmentExpression=function o(e){var s=e.binding,a=e.operator,c=e.expression;_classCallCheck$5(this,o),this.type="CompoundAssignmentExpression",this.binding=s,this.operator=a,this.expression=c};dist$1.ComputedMemberAssignmentTarget=function o(e){var s=e.object,a=e.expression;_classCallCheck$5(this,o),this.type="ComputedMemberAssignmentTarget",this.object=s,this.expression=a};dist$1.ComputedMemberExpression=function o(e){var s=e.object,a=e.expression;_classCallCheck$5(this,o),this.type="ComputedMemberExpression",this.object=s,this.expression=a};dist$1.ComputedPropertyName=function o(e){var s=e.expression;_classCallCheck$5(this,o),this.type="ComputedPropertyName",this.expression=s};dist$1.ConditionalExpression=function o(e){var s=e.test,a=e.consequent,c=e.alternate;_classCallCheck$5(this,o),this.type="ConditionalExpression",this.test=s,this.consequent=a,this.alternate=c};dist$1.ContinueStatement=function o(e){var s=e.label;_classCallCheck$5(this,o),this.type="ContinueStatement",this.label=s};dist$1.DataProperty=function o(e){var s=e.name,a=e.expression;_classCallCheck$5(this,o),this.type="DataProperty",this.name=s,this.expression=a};dist$1.DebuggerStatement=function o(){_classCallCheck$5(this,o),this.type="DebuggerStatement"};dist$1.Directive=function o(e){var s=e.rawValue;_classCallCheck$5(this,o),this.type="Directive",this.rawValue=s};dist$1.DoWhileStatement=function o(e){var s=e.body,a=e.test;_classCallCheck$5(this,o),this.type="DoWhileStatement",this.body=s,this.test=a};dist$1.EmptyStatement=function o(){_classCallCheck$5(this,o),this.type="EmptyStatement"};dist$1.Export=function o(e){var s=e.declaration;_classCallCheck$5(this,o),this.type="Export",this.declaration=s};dist$1.ExportAllFrom=function o(e){var s=e.moduleSpecifier;_classCallCheck$5(this,o),this.type="ExportAllFrom",this.moduleSpecifier=s};dist$1.ExportDefault=function o(e){var s=e.body;_classCallCheck$5(this,o),this.type="ExportDefault",this.body=s};dist$1.ExportFrom=function o(e){var s=e.namedExports,a=e.moduleSpecifier;_classCallCheck$5(this,o),this.type="ExportFrom",this.namedExports=s,this.moduleSpecifier=a};dist$1.ExportFromSpecifier=function o(e){var s=e.name,a=e.exportedName;_classCallCheck$5(this,o),this.type="ExportFromSpecifier",this.name=s,this.exportedName=a};dist$1.ExportLocalSpecifier=function o(e){var s=e.name,a=e.exportedName;_classCallCheck$5(this,o),this.type="ExportLocalSpecifier",this.name=s,this.exportedName=a};dist$1.ExportLocals=function o(e){var s=e.namedExports;_classCallCheck$5(this,o),this.type="ExportLocals",this.namedExports=s};dist$1.ExpressionStatement=function o(e){var s=e.expression;_classCallCheck$5(this,o),this.type="ExpressionStatement",this.expression=s};dist$1.ForAwaitStatement=function o(e){var s=e.left,a=e.right,c=e.body;_classCallCheck$5(this,o),this.type="ForAwaitStatement",this.left=s,this.right=a,this.body=c};dist$1.ForInStatement=function o(e){var s=e.left,a=e.right,c=e.body;_classCallCheck$5(this,o),this.type="ForInStatement",this.left=s,this.right=a,this.body=c};dist$1.ForOfStatement=function o(e){var s=e.left,a=e.right,c=e.body;_classCallCheck$5(this,o),this.type="ForOfStatement",this.left=s,this.right=a,this.body=c};dist$1.ForStatement=function o(e){var s=e.init,a=e.test,c=e.update,h=e.body;_classCallCheck$5(this,o),this.type="ForStatement",this.init=s,this.test=a,this.update=c,this.body=h};dist$1.FormalParameters=function o(e){var s=e.items,a=e.rest;_classCallCheck$5(this,o),this.type="FormalParameters",this.items=s,this.rest=a};dist$1.FunctionBody=function o(e){var s=e.directives,a=e.statements;_classCallCheck$5(this,o),this.type="FunctionBody",this.directives=s,this.statements=a};dist$1.FunctionDeclaration=function o(e){var s=e.isAsync,a=e.isGenerator,c=e.name,h=e.params,d=e.body;_classCallCheck$5(this,o),this.type="FunctionDeclaration",this.isAsync=s,this.isGenerator=a,this.name=c,this.params=h,this.body=d};dist$1.FunctionExpression=function o(e){var s=e.isAsync,a=e.isGenerator,c=e.name,h=e.params,d=e.body;_classCallCheck$5(this,o),this.type="FunctionExpression",this.isAsync=s,this.isGenerator=a,this.name=c,this.params=h,this.body=d};dist$1.Getter=function o(e){var s=e.name,a=e.body;_classCallCheck$5(this,o),this.type="Getter",this.name=s,this.body=a};IdentifierExpression_1=dist$1.IdentifierExpression=function o(e){var s=e.name;_classCallCheck$5(this,o),this.type="IdentifierExpression",this.name=s};dist$1.IfStatement=function o(e){var s=e.test,a=e.consequent,c=e.alternate;_classCallCheck$5(this,o),this.type="IfStatement",this.test=s,this.consequent=a,this.alternate=c};dist$1.Import=function o(e){var s=e.defaultBinding,a=e.namedImports,c=e.moduleSpecifier;_classCallCheck$5(this,o),this.type="Import",this.defaultBinding=s,this.namedImports=a,this.moduleSpecifier=c};dist$1.ImportNamespace=function o(e){var s=e.defaultBinding,a=e.namespaceBinding,c=e.moduleSpecifier;_classCallCheck$5(this,o),this.type="ImportNamespace",this.defaultBinding=s,this.namespaceBinding=a,this.moduleSpecifier=c};dist$1.ImportSpecifier=function o(e){var s=e.name,a=e.binding;_classCallCheck$5(this,o),this.type="ImportSpecifier",this.name=s,this.binding=a};dist$1.LabeledStatement=function o(e){var s=e.label,a=e.body;_classCallCheck$5(this,o),this.type="LabeledStatement",this.label=s,this.body=a};dist$1.LiteralBooleanExpression=function o(e){var s=e.value;_classCallCheck$5(this,o),this.type="LiteralBooleanExpression",this.value=s};dist$1.LiteralInfinityExpression=function o(){_classCallCheck$5(this,o),this.type="LiteralInfinityExpression"};dist$1.LiteralNullExpression=function o(){_classCallCheck$5(this,o),this.type="LiteralNullExpression"};LiteralNumericExpression_1=dist$1.LiteralNumericExpression=function o(e){var s=e.value;_classCallCheck$5(this,o),this.type="LiteralNumericExpression",this.value=s};dist$1.LiteralRegExpExpression=function o(e){var s=e.pattern,a=e.global,c=e.ignoreCase,h=e.multiLine,d=e.dotAll,g=e.unicode,_=e.sticky;_classCallCheck$5(this,o),this.type="LiteralRegExpExpression",this.pattern=s,this.global=a,this.ignoreCase=c,this.multiLine=h,this.dotAll=d,this.unicode=g,this.sticky=_};LiteralStringExpression_1=dist$1.LiteralStringExpression=function o(e){var s=e.value;_classCallCheck$5(this,o),this.type="LiteralStringExpression",this.value=s};dist$1.Method=function o(e){var s=e.isAsync,a=e.isGenerator,c=e.name,h=e.params,d=e.body;_classCallCheck$5(this,o),this.type="Method",this.isAsync=s,this.isGenerator=a,this.name=c,this.params=h,this.body=d};dist$1.Module=function o(e){var s=e.directives,a=e.items;_classCallCheck$5(this,o),this.type="Module",this.directives=s,this.items=a};dist$1.NewExpression=function o(e){var s=e.callee,a=e.arguments;_classCallCheck$5(this,o),this.type="NewExpression",this.callee=s,this.arguments=a};dist$1.NewTargetExpression=function o(){_classCallCheck$5(this,o),this.type="NewTargetExpression"};dist$1.ObjectAssignmentTarget=function o(e){var s=e.properties,a=e.rest;_classCallCheck$5(this,o),this.type="ObjectAssignmentTarget",this.properties=s,this.rest=a};dist$1.ObjectBinding=function o(e){var s=e.properties,a=e.rest;_classCallCheck$5(this,o),this.type="ObjectBinding",this.properties=s,this.rest=a};dist$1.ObjectExpression=function o(e){var s=e.properties;_classCallCheck$5(this,o),this.type="ObjectExpression",this.properties=s};ReturnStatement_1=dist$1.ReturnStatement=function o(e){var s=e.expression;_classCallCheck$5(this,o),this.type="ReturnStatement",this.expression=s};dist$1.Script=function o(e){var s=e.directives,a=e.statements;_classCallCheck$5(this,o),this.type="Script",this.directives=s,this.statements=a};dist$1.Setter=function o(e){var s=e.name,a=e.param,c=e.body;_classCallCheck$5(this,o),this.type="Setter",this.name=s,this.param=a,this.body=c};dist$1.ShorthandProperty=function o(e){var s=e.name;_classCallCheck$5(this,o),this.type="ShorthandProperty",this.name=s};dist$1.SpreadElement=function o(e){var s=e.expression;_classCallCheck$5(this,o),this.type="SpreadElement",this.expression=s};dist$1.SpreadProperty=function o(e){var s=e.expression;_classCallCheck$5(this,o),this.type="SpreadProperty",this.expression=s};dist$1.StaticMemberAssignmentTarget=function o(e){var s=e.object,a=e.property;_classCallCheck$5(this,o),this.type="StaticMemberAssignmentTarget",this.object=s,this.property=a};StaticMemberExpression_1=dist$1.StaticMemberExpression=function o(e){var s=e.object,a=e.property;_classCallCheck$5(this,o),this.type="StaticMemberExpression",this.object=s,this.property=a};dist$1.StaticPropertyName=function o(e){var s=e.value;_classCallCheck$5(this,o),this.type="StaticPropertyName",this.value=s};dist$1.Super=function o(){_classCallCheck$5(this,o),this.type="Super"};dist$1.SwitchCase=function o(e){var s=e.test,a=e.consequent;_classCallCheck$5(this,o),this.type="SwitchCase",this.test=s,this.consequent=a};dist$1.SwitchDefault=function o(e){var s=e.consequent;_classCallCheck$5(this,o),this.type="SwitchDefault",this.consequent=s};dist$1.SwitchStatement=function o(e){var s=e.discriminant,a=e.cases;_classCallCheck$5(this,o),this.type="SwitchStatement",this.discriminant=s,this.cases=a};dist$1.SwitchStatementWithDefault=function o(e){var s=e.discriminant,a=e.preDefaultCases,c=e.defaultCase,h=e.postDefaultCases;_classCallCheck$5(this,o),this.type="SwitchStatementWithDefault",this.discriminant=s,this.preDefaultCases=a,this.defaultCase=c,this.postDefaultCases=h};dist$1.TemplateElement=function o(e){var s=e.rawValue;_classCallCheck$5(this,o),this.type="TemplateElement",this.rawValue=s};dist$1.TemplateExpression=function o(e){var s=e.tag,a=e.elements;_classCallCheck$5(this,o),this.type="TemplateExpression",this.tag=s,this.elements=a};dist$1.ThisExpression=function o(){_classCallCheck$5(this,o),this.type="ThisExpression"};dist$1.ThrowStatement=function o(e){var s=e.expression;_classCallCheck$5(this,o),this.type="ThrowStatement",this.expression=s};dist$1.TryCatchStatement=function o(e){var s=e.body,a=e.catchClause;_classCallCheck$5(this,o),this.type="TryCatchStatement",this.body=s,this.catchClause=a};dist$1.TryFinallyStatement=function o(e){var s=e.body,a=e.catchClause,c=e.finalizer;_classCallCheck$5(this,o),this.type="TryFinallyStatement",this.body=s,this.catchClause=a,this.finalizer=c};dist$1.UnaryExpression=function o(e){var s=e.operator,a=e.operand;_classCallCheck$5(this,o),this.type="UnaryExpression",this.operator=s,this.operand=a};dist$1.UpdateExpression=function o(e){var s=e.isPrefix,a=e.operator,c=e.operand;_classCallCheck$5(this,o),this.type="UpdateExpression",this.isPrefix=s,this.operator=a,this.operand=c};dist$1.VariableDeclaration=function o(e){var s=e.kind,a=e.declarators;_classCallCheck$5(this,o),this.type="VariableDeclaration",this.kind=s,this.declarators=a};dist$1.VariableDeclarationStatement=function o(e){var s=e.declaration;_classCallCheck$5(this,o),this.type="VariableDeclarationStatement",this.declaration=s};dist$1.VariableDeclarator=function o(e){var s=e.binding,a=e.init;_classCallCheck$5(this,o),this.type="VariableDeclarator",this.binding=s,this.init=a};dist$1.WhileStatement=function o(e){var s=e.test,a=e.body;_classCallCheck$5(this,o),this.type="WhileStatement",this.test=s,this.body=a};dist$1.WithStatement=function o(e){var s=e.object,a=e.body;_classCallCheck$5(this,o),this.type="WithStatement",this.object=s,this.body=a};dist$1.YieldExpression=function o(e){var s=e.expression;_classCallCheck$5(this,o),this.type="YieldExpression",this.expression=s};dist$1.YieldGeneratorExpression=function o(e){var s=e.expression;_classCallCheck$5(this,o),this.type="YieldGeneratorExpression",this.expression=s};var dist={},minimalCodegen={};/* object-assign (c) Sindre Sorhus @license MIT */var getOwnPropertySymbols=Object.getOwnPropertySymbols,hasOwnProperty=Object.prototype.hasOwnProperty,propIsEnumerable=Object.prototype.propertyIsEnumerable;function toObject(o){if(o==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(o)}function shouldUseNative(){try{if(!Object.assign)return!1;var o=new String("abc");if(o[5]="de",Object.getOwnPropertyNames(o)[0]==="5")return!1;for(var e={},s=0;s<10;s++)e["_"+String.fromCharCode(s)]=s;var a=Object.getOwnPropertyNames(e).map(function(h){return e[h]});if(a.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(h){c[h]=h}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}var objectAssign=shouldUseNative()?Object.assign:function(o,e){for(var s,a=toObject(o),c,h=1;h=48&&st<=55}s=[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];function b(st){return st===32||st===9||st===11||st===12||st===160||st>=5760&&s.indexOf(st)>=0}function $(st){return st===10||st===13||st===8232||st===8233}function j(st){if(st<=65535)return String.fromCharCode(st);var rt=String.fromCharCode(Math.floor((st-65536)/1024)+55296),it=String.fromCharCode((st-65536)%1024+56320);return rt+it}for(a=new Array(128),h=0;h<128;++h)a[h]=h>=97&&h<=122||h>=65&&h<=90||h===36||h===95;for(c=new Array(128),h=0;h<128;++h)c[h]=h>=97&&h<=122||h>=65&&h<=90||h>=48&&h<=57||h===36||h===95;function _e(st){return st<128?a[st]:e.NonAsciiIdentifierStart.test(j(st))}function et(st){return st<128?c[st]:e.NonAsciiIdentifierPart.test(j(st))}function tt(st){return st<128?a[st]:o.NonAsciiIdentifierStart.test(j(st))}function nt(st){return st<128?c[st]:o.NonAsciiIdentifierPart.test(j(st))}code$1.exports={isDecimalDigit:d,isHexDigit:g,isOctalDigit:_,isWhiteSpace:b,isLineTerminator:$,isIdentifierStartES5:_e,isIdentifierPartES5:et,isIdentifierStartES6:tt,isIdentifierPartES6:nt}})();var keyword$1={exports:{}};(function(){var o=code$1.exports;function e(_e){switch(_e){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"let":return!0;default:return!1}}function s(_e,et){return!et&&_e==="yield"?!1:a(_e,et)}function a(_e,et){if(et&&e(_e))return!0;switch(_e.length){case 2:return _e==="if"||_e==="in"||_e==="do";case 3:return _e==="var"||_e==="for"||_e==="new"||_e==="try";case 4:return _e==="this"||_e==="else"||_e==="case"||_e==="void"||_e==="with"||_e==="enum";case 5:return _e==="while"||_e==="break"||_e==="catch"||_e==="throw"||_e==="const"||_e==="yield"||_e==="class"||_e==="super";case 6:return _e==="return"||_e==="typeof"||_e==="delete"||_e==="switch"||_e==="export"||_e==="import";case 7:return _e==="default"||_e==="finally"||_e==="extends";case 8:return _e==="function"||_e==="continue"||_e==="debugger";case 10:return _e==="instanceof";default:return!1}}function c(_e,et){return _e==="null"||_e==="true"||_e==="false"||s(_e,et)}function h(_e,et){return _e==="null"||_e==="true"||_e==="false"||a(_e,et)}function d(_e){return _e==="eval"||_e==="arguments"}function g(_e){var et,tt,nt;if(_e.length===0||(nt=_e.charCodeAt(0),!o.isIdentifierStartES5(nt)))return!1;for(et=1,tt=_e.length;et=tt||(st=_e.charCodeAt(et),!(56320<=st&&st<=57343)))return!1;nt=_(nt,st)}if(!rt(nt))return!1;rt=o.isIdentifierPartES6}return!0}function $(_e,et){return g(_e)&&!c(_e,et)}function j(_e,et){return b(_e)&&!h(_e,et)}keyword$1.exports={isKeywordES5:s,isKeywordES6:a,isReservedWordES5:c,isReservedWordES6:h,isRestrictedWord:d,isIdentifierNameES5:g,isIdentifierNameES6:b,isIdentifierES5:$,isIdentifierES6:j}})();(function(){utils.ast=ast.exports,utils.code=code$1.exports,utils.keyword=keyword$1.exports})();var coderep={};Object.defineProperty(coderep,"__esModule",{value:!0});var _createClass$4=function(){function o(e,s){for(var a=0;a":Precedence.Relational,"<=":Precedence.Relational,">=":Precedence.Relational,in:Precedence.Relational,instanceof:Precedence.Relational,"<<":Precedence.BitwiseSHIFT,">>":Precedence.BitwiseSHIFT,">>>":Precedence.BitwiseSHIFT,"+":Precedence.Additive,"-":Precedence.Additive,"*":Precedence.Multiplicative,"%":Precedence.Multiplicative,"/":Precedence.Multiplicative,"**":Precedence.Exponential};function getPrecedence(o){switch(o.type){case"ArrayExpression":case"FunctionExpression":case"ClassExpression":case"IdentifierExpression":case"AssignmentTargetIdentifier":case"NewTargetExpression":case"Super":case"LiteralBooleanExpression":case"LiteralNullExpression":case"LiteralNumericExpression":case"LiteralInfinityExpression":case"LiteralRegExpExpression":case"LiteralStringExpression":case"ObjectExpression":case"ThisExpression":case"SpreadElement":case"FunctionBody":return Precedence.Primary;case"ArrowExpression":case"AssignmentExpression":case"CompoundAssignmentExpression":case"YieldExpression":case"YieldGeneratorExpression":return Precedence.Assignment;case"ConditionalExpression":return Precedence.Conditional;case"ComputedMemberExpression":case"StaticMemberExpression":case"ComputedMemberAssignmentTarget":case"StaticMemberAssignmentTarget":switch(o.object.type){case"CallExpression":case"ComputedMemberExpression":case"StaticMemberExpression":case"TemplateExpression":return getPrecedence(o.object);default:return Precedence.Member}case"TemplateExpression":if(o.tag==null)return Precedence.Member;switch(o.tag.type){case"CallExpression":case"ComputedMemberExpression":case"StaticMemberExpression":case"TemplateExpression":return getPrecedence(o.tag);default:return Precedence.Member}case"BinaryExpression":return BinaryPrecedence[o.operator];case"CallExpression":return Precedence.Call;case"NewExpression":return o.arguments.length===0?Precedence.New:Precedence.Member;case"UpdateExpression":return o.isPrefix?Precedence.Prefix:Precedence.Postfix;case"AwaitExpression":case"UnaryExpression":return Precedence.Prefix;default:throw new Error("unreachable: "+o.type)}}function escapeStringLiteral(o){for(var e="",s=0,a=0,c=0,h=o.length;cs?"'":'"';e+=g;for(var _=0;_1&&arguments[1]!==void 0?arguments[1]:!1;_classCallCheck$4(this,e);var c=_possibleConstructorReturn$2(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return c.token=s,c.isRegExp=a,c}return _createClass$4(e,[{key:"emit",value:function(a){a.put(this.token,this.isRegExp)}}]),e}(CodeRep);coderep.RawToken=function(o){_inherits$2(e,o);function e(s){_classCallCheck$4(this,e);var a=_possibleConstructorReturn$2(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return a.token=s,a}return _createClass$4(e,[{key:"emit",value:function(a){a.putRaw(this.token)}}]),e}(CodeRep);coderep.NumberCodeRep=function(o){_inherits$2(e,o);function e(s){_classCallCheck$4(this,e);var a=_possibleConstructorReturn$2(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return a.number=s,a}return _createClass$4(e,[{key:"emit",value:function(a){a.putNumber(this.number)}}]),e}(CodeRep);coderep.Paren=function(o){_inherits$2(e,o);function e(s){_classCallCheck$4(this,e);var a=_possibleConstructorReturn$2(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return a.expr=s,a}return _createClass$4(e,[{key:"emit",value:function(a){a.put("("),this.expr.emit(a,!1),a.put(")")}},{key:"forEach",value:function(a){a(this),this.expr.forEach(a)}}]),e}(CodeRep);coderep.Bracket=function(o){_inherits$2(e,o);function e(s){_classCallCheck$4(this,e);var a=_possibleConstructorReturn$2(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return a.expr=s,a}return _createClass$4(e,[{key:"emit",value:function(a){a.put("["),this.expr.emit(a,!1),a.put("]")}},{key:"forEach",value:function(a){a(this),this.expr.forEach(a)}}]),e}(CodeRep);coderep.Brace=function(o){_inherits$2(e,o);function e(s){_classCallCheck$4(this,e);var a=_possibleConstructorReturn$2(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return a.expr=s,a}return _createClass$4(e,[{key:"emit",value:function(a){a.put("{"),this.expr.emit(a,!1),a.put("}")}},{key:"forEach",value:function(a){a(this),this.expr.forEach(a)}}]),e}(CodeRep);coderep.NoIn=function(o){_inherits$2(e,o);function e(s){_classCallCheck$4(this,e);var a=_possibleConstructorReturn$2(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return a.expr=s,a}return _createClass$4(e,[{key:"emit",value:function(a){this.expr.emit(a,!0)}},{key:"forEach",value:function(a){a(this),this.expr.forEach(a)}}]),e}(CodeRep);coderep.ContainsIn=function(o){_inherits$2(e,o);function e(s){_classCallCheck$4(this,e);var a=_possibleConstructorReturn$2(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return a.expr=s,a}return _createClass$4(e,[{key:"emit",value:function(a,c){c?(a.put("("),this.expr.emit(a,!1),a.put(")")):this.expr.emit(a,!1)}},{key:"forEach",value:function(a){a(this),this.expr.forEach(a)}}]),e}(CodeRep);coderep.Seq=function(o){_inherits$2(e,o);function e(s){_classCallCheck$4(this,e);var a=_possibleConstructorReturn$2(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return a.children=s,a}return _createClass$4(e,[{key:"emit",value:function(a,c){this.children.forEach(function(h){return h.emit(a,c)})}},{key:"forEach",value:function(a){a(this),this.children.forEach(function(c){return c.forEach(a)})}}]),e}(CodeRep);coderep.Semi=function(o){_inherits$2(e,o);function e(){return _classCallCheck$4(this,e),_possibleConstructorReturn$2(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,";"))}return e}(Token);coderep.CommaSep=function(o){_inherits$2(e,o);function e(s){_classCallCheck$4(this,e);var a=_possibleConstructorReturn$2(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return a.children=s,a}return _createClass$4(e,[{key:"emit",value:function(a,c){var h=!0;this.children.forEach(function(d){h?h=!1:a.put(","),d.emit(a,c)})}},{key:"forEach",value:function(a){a(this),this.children.forEach(function(c){return c.forEach(a)})}}]),e}(CodeRep);coderep.SemiOp=function(o){_inherits$2(e,o);function e(){return _classCallCheck$4(this,e),_possibleConstructorReturn$2(this,(e.__proto__||Object.getPrototypeOf(e)).call(this))}return _createClass$4(e,[{key:"emit",value:function(a){a.putOptionalSemi()}}]),e}(CodeRep);Object.defineProperty(minimalCodegen,"__esModule",{value:!0});var _createClass$3=function(){function o(e,s){for(var a=0;a1&&arguments[1]!==void 0?arguments[1]:!1;return new _coderep$1.Token(o,e)}function paren(o){return new _coderep$1.Paren(o)}function brace(o){return new _coderep$1.Brace(o)}function bracket$1(o){return new _coderep$1.Bracket(o)}function noIn$1(o){return new _coderep$1.NoIn(o)}function markContainsIn$1(o){return o.containsIn?new _coderep$1.ContainsIn(o):o}function seq$1(){for(var o=arguments.length,e=Array(o),s=0;s0&&c[c.length-1]==null&&(h=seq$1(h,t$1(","))),bracket$1(h)}},{key:"reduceAwaitExpression",value:function(s,a){var c=a.expression;return seq$1(t$1("await"),p$1(s.expression,(0,_coderep$1.getPrecedence)(s),c))}},{key:"reduceSpreadElement",value:function(s,a){var c=a.expression;return seq$1(t$1("..."),p$1(s.expression,_coderep$1.Precedence.Assignment,c))}},{key:"reduceSpreadProperty",value:function(s,a){var c=a.expression;return seq$1(t$1("..."),getAssignmentExpr(c))}},{key:"reduceAssignmentExpression",value:function(s,a){var c=a.binding,h=a.expression,d=c,g=h,_=h.containsIn,b=c.startsWithCurly,$=c.startsWithLetSquareBracket,j=c.startsWithFunctionOrClass;return(0,_coderep$1.getPrecedence)(s.expression)<(0,_coderep$1.getPrecedence)(s)&&(g=paren(g),_=!1),(0,_objectAssign2$1.default)(seq$1(d,t$1("="),g),{containsIn:_,startsWithCurly:b,startsWithLetSquareBracket:$,startsWithFunctionOrClass:j})}},{key:"reduceAssignmentTargetIdentifier",value:function(s){var a=t$1(s.name);return s.name==="let"&&(a.startsWithLet=!0),a}},{key:"reduceAssignmentTargetWithDefault",value:function(s,a){var c=a.binding,h=a.init;return seq$1(c,t$1("="),p$1(s.init,_coderep$1.Precedence.Assignment,h))}},{key:"reduceCompoundAssignmentExpression",value:function(s,a){var c=a.binding,h=a.expression,d=c,g=h,_=h.containsIn,b=c.startsWithCurly,$=c.startsWithLetSquareBracket,j=c.startsWithFunctionOrClass;return(0,_coderep$1.getPrecedence)(s.expression)<(0,_coderep$1.getPrecedence)(s)&&(g=paren(g),_=!1),(0,_objectAssign2$1.default)(seq$1(d,t$1(s.operator),g),{containsIn:_,startsWithCurly:b,startsWithLetSquareBracket:$,startsWithFunctionOrClass:j})}},{key:"reduceBinaryExpression",value:function(s,a){var c=a.left,h=a.right,d=c,g=c.startsWithCurly,_=c.startsWithLetSquareBracket,b=c.startsWithFunctionOrClass,$=c.containsIn,j=s.operator==="**";((0,_coderep$1.getPrecedence)(s.left)<(0,_coderep$1.getPrecedence)(s)||j&&((0,_coderep$1.getPrecedence)(s.left)===(0,_coderep$1.getPrecedence)(s)||s.left.type==="UnaryExpression"))&&(d=paren(d),g=!1,_=!1,b=!1,$=!1);var _e=h,et=h.containsIn;return((0,_coderep$1.getPrecedence)(s.right)<(0,_coderep$1.getPrecedence)(s)||!j&&(0,_coderep$1.getPrecedence)(s.right)===(0,_coderep$1.getPrecedence)(s))&&(_e=paren(_e),et=!1),(0,_objectAssign2$1.default)(seq$1(d,t$1(s.operator),_e),{containsIn:$||et||s.operator==="in",containsGroup:s.operator===",",startsWithCurly:g,startsWithLetSquareBracket:_,startsWithFunctionOrClass:b})}},{key:"reduceBindingWithDefault",value:function(s,a){var c=a.binding,h=a.init;return seq$1(c,t$1("="),p$1(s.init,_coderep$1.Precedence.Assignment,h))}},{key:"reduceBindingIdentifier",value:function(s){var a=t$1(s.name);return s.name==="let"&&(a.startsWithLet=!0),a}},{key:"reduceArrayAssignmentTarget",value:function(s,a){var c=a.elements,h=a.rest,d=void 0;return c.length===0?d=h==null?empty$2():seq$1(t$1("..."),h):(c=c.concat(h==null?[]:[seq$1(t$1("..."),h)]),d=commaSep(c.map(getAssignmentExpr)),c.length>0&&c[c.length-1]==null&&(d=seq$1(d,t$1(",")))),bracket$1(d)}},{key:"reduceArrayBinding",value:function(s,a){var c=a.elements,h=a.rest,d=void 0;return c.length===0?d=h==null?empty$2():seq$1(t$1("..."),h):(c=c.concat(h==null?[]:[seq$1(t$1("..."),h)]),d=commaSep(c.map(getAssignmentExpr)),c.length>0&&c[c.length-1]==null&&(d=seq$1(d,t$1(",")))),bracket$1(d)}},{key:"reduceObjectAssignmentTarget",value:function(s,a){var c=a.properties,h=a.rest,d=commaSep(c);c.length===0?d=h==null?empty$2():seq$1(t$1("..."),h):d=h==null?d:seq$1(d,t$1(","),t$1("..."),h);var g=brace(d);return g.startsWithCurly=!0,g}},{key:"reduceObjectBinding",value:function(s,a){var c=a.properties,h=a.rest,d=commaSep(c);c.length===0?d=h==null?empty$2():seq$1(t$1("..."),h):d=h==null?d:seq$1(d,t$1(","),t$1("..."),h);var g=brace(d);return g.startsWithCurly=!0,g}},{key:"reduceAssignmentTargetPropertyIdentifier",value:function(s,a){var c=a.binding,h=a.init;return s.init==null?c:seq$1(c,t$1("="),p$1(s.init,_coderep$1.Precedence.Assignment,h))}},{key:"reduceAssignmentTargetPropertyProperty",value:function(s,a){var c=a.name,h=a.binding;return seq$1(c,t$1(":"),h)}},{key:"reduceBindingPropertyIdentifier",value:function(s,a){var c=a.binding,h=a.init;return s.init==null?c:seq$1(c,t$1("="),p$1(s.init,_coderep$1.Precedence.Assignment,h))}},{key:"reduceBindingPropertyProperty",value:function(s,a){var c=a.name,h=a.binding;return seq$1(c,t$1(":"),h)}},{key:"reduceBlock",value:function(s,a){var c=a.statements;return brace(seq$1.apply(void 0,_toConsumableArray$2(c)))}},{key:"reduceBlockStatement",value:function(s,a){var c=a.block;return c}},{key:"reduceBreakStatement",value:function(s){return seq$1(t$1("break"),s.label?t$1(s.label):empty$2(),semiOp())}},{key:"reduceCallExpression",value:function(s,a){var c=a.callee,h=a.arguments,d=h.map(function(g,_){return p$1(s.arguments[_],_coderep$1.Precedence.Assignment,g)});return(0,_objectAssign2$1.default)(seq$1(p$1(s.callee,(0,_coderep$1.getPrecedence)(s),c),paren(commaSep(d))),{startsWithCurly:c.startsWithCurly,startsWithLet:c.startsWithLet,startsWithLetSquareBracket:c.startsWithLetSquareBracket,startsWithFunctionOrClass:c.startsWithFunctionOrClass})}},{key:"reduceCatchClause",value:function(s,a){var c=a.binding,h=a.body;return seq$1(t$1("catch"),paren(c),h)}},{key:"reduceClassDeclaration",value:function(s,a){var c=a.name,h=a.super,d=a.elements,g=seq$1(t$1("class"),s.name.name==="*default*"?empty$2():c);return h!=null&&(g=seq$1(g,t$1("extends"),p$1(s.super,_coderep$1.Precedence.New,h))),g=seq$1.apply(void 0,[g,t$1("{")].concat(_toConsumableArray$2(d),[t$1("}")])),g}},{key:"reduceClassExpression",value:function(s,a){var c=a.name,h=a.super,d=a.elements,g=t$1("class");return c!=null&&(g=seq$1(g,c)),h!=null&&(g=seq$1(g,t$1("extends"),p$1(s.super,_coderep$1.Precedence.New,h))),g=seq$1.apply(void 0,[g,t$1("{")].concat(_toConsumableArray$2(d),[t$1("}")])),g.startsWithFunctionOrClass=!0,g}},{key:"reduceClassElement",value:function(s,a){var c=a.method;return s.isStatic?seq$1(t$1("static"),c):c}},{key:"reduceComputedMemberAssignmentTarget",value:function(s,a){var c=a.object,h=a.expression,d=c.startsWithLetSquareBracket||s.object.type==="IdentifierExpression"&&s.object.name==="let";return(0,_objectAssign2$1.default)(seq$1(p$1(s.object,(0,_coderep$1.getPrecedence)(s),c),bracket$1(h)),{startsWithLet:c.startsWithLet,startsWithLetSquareBracket:d,startsWithCurly:c.startsWithCurly,startsWithFunctionOrClass:c.startsWithFunctionOrClass})}},{key:"reduceComputedMemberExpression",value:function(s,a){var c=a.object,h=a.expression,d=c.startsWithLetSquareBracket||s.object.type==="IdentifierExpression"&&s.object.name==="let";return(0,_objectAssign2$1.default)(seq$1(p$1(s.object,(0,_coderep$1.getPrecedence)(s),c),bracket$1(h)),{startsWithLet:c.startsWithLet,startsWithLetSquareBracket:d,startsWithCurly:c.startsWithCurly,startsWithFunctionOrClass:c.startsWithFunctionOrClass})}},{key:"reduceComputedPropertyName",value:function(s,a){var c=a.expression;return bracket$1(p$1(s.expression,_coderep$1.Precedence.Assignment,c))}},{key:"reduceConditionalExpression",value:function(s,a){var c=a.test,h=a.consequent,d=a.alternate,g=c.containsIn||d.containsIn,_=c.startsWithCurly,b=c.startsWithLetSquareBracket,$=c.startsWithFunctionOrClass;return(0,_objectAssign2$1.default)(seq$1(p$1(s.test,_coderep$1.Precedence.LogicalOR,c),t$1("?"),p$1(s.consequent,_coderep$1.Precedence.Assignment,h),t$1(":"),p$1(s.alternate,_coderep$1.Precedence.Assignment,d)),{containsIn:g,startsWithCurly:_,startsWithLetSquareBracket:b,startsWithFunctionOrClass:$})}},{key:"reduceContinueStatement",value:function(s){return seq$1(t$1("continue"),s.label?t$1(s.label):empty$2(),semiOp())}},{key:"reduceDataProperty",value:function(s,a){var c=a.name,h=a.expression;return seq$1(c,t$1(":"),getAssignmentExpr(h))}},{key:"reduceDebuggerStatement",value:function(){return seq$1(t$1("debugger"),semiOp())}},{key:"reduceDoWhileStatement",value:function(s,a){var c=a.body,h=a.test;return seq$1(t$1("do"),c,t$1("while"),paren(h),semiOp())}},{key:"reduceEmptyStatement",value:function(){return semi()}},{key:"reduceExpressionStatement",value:function(s,a){var c=a.expression,h=c.startsWithCurly||c.startsWithLetSquareBracket||c.startsWithFunctionOrClass;return seq$1(h?paren(c):c,semiOp())}},{key:"reduceForInStatement",value:function(s,a){var c=a.left,h=a.right,d=a.body;return c=s.left.type==="VariableDeclaration"?noIn$1(markContainsIn$1(c)):c,(0,_objectAssign2$1.default)(seq$1(t$1("for"),paren(seq$1(c.startsWithLet?paren(c):c,t$1("in"),h)),d),{endsWithMissingElse:d.endsWithMissingElse})}},{key:"reduceForOfStatement",value:function(s,a){var c=a.left,h=a.right,d=a.body;return c=s.left.type==="VariableDeclaration"?noIn$1(markContainsIn$1(c)):c,(0,_objectAssign2$1.default)(seq$1(t$1("for"),paren(seq$1(c.startsWithLet?paren(c):c,t$1("of"),p$1(s.right,_coderep$1.Precedence.Assignment,h))),d),{endsWithMissingElse:d.endsWithMissingElse})}},{key:"reduceForStatement",value:function(s,a){var c=a.init,h=a.test,d=a.update,g=a.body;return c&&(c.startsWithLetSquareBracket&&(c=paren(c)),c=noIn$1(markContainsIn$1(c))),(0,_objectAssign2$1.default)(seq$1(t$1("for"),paren(seq$1(c||empty$2(),semi(),h||empty$2(),semi(),d||empty$2())),g),{endsWithMissingElse:g.endsWithMissingElse})}},{key:"reduceForAwaitStatement",value:function(s,a){var c=a.left,h=a.right,d=a.body;return c=s.left.type==="VariableDeclaration"?noIn$1(markContainsIn$1(c)):c,(0,_objectAssign2$1.default)(seq$1(t$1("for"),t$1("await"),paren(seq$1(c.startsWithLet?paren(c):c,t$1("of"),p$1(s.right,_coderep$1.Precedence.Assignment,h))),d),{endsWithMissingElse:d.endsWithMissingElse})}},{key:"reduceFunctionBody",value:function(s,a){var c=a.directives,h=a.statements;return h.length&&(h[0]=this.parenToAvoidBeingDirective(s.statements[0],h[0])),brace(seq$1.apply(void 0,_toConsumableArray$2(c).concat(_toConsumableArray$2(h))))}},{key:"reduceFunctionDeclaration",value:function(s,a){var c=a.name,h=a.params,d=a.body;return seq$1(s.isAsync?t$1("async"):empty$2(),t$1("function"),s.isGenerator?t$1("*"):empty$2(),s.name.name==="*default*"?empty$2():c,h,d)}},{key:"reduceFunctionExpression",value:function(s,a){var c=a.name,h=a.params,d=a.body,g=seq$1(s.isAsync?t$1("async"):empty$2(),t$1("function"),s.isGenerator?t$1("*"):empty$2(),c||empty$2(),h,d);return g.startsWithFunctionOrClass=!0,g}},{key:"reduceFormalParameters",value:function(s,a){var c=a.items,h=a.rest;return paren(commaSep(c.concat(h==null?[]:[seq$1(t$1("..."),h)])))}},{key:"reduceArrowExpression",value:function(s,a){var c=a.params,h=a.body;c=this.regenerateArrowParams(s.params,c);var d=!1;return s.body.type!=="FunctionBody"&&(h.startsWithCurly?h=paren(h):h.containsIn&&(d=!0)),(0,_objectAssign2$1.default)(seq$1(s.isAsync?t$1("async"):empty$2(),c,t$1("=>"),p$1(s.body,_coderep$1.Precedence.Assignment,h)),{containsIn:d})}},{key:"reduceGetter",value:function(s,a){var c=a.name,h=a.body;return seq$1(t$1("get"),c,paren(empty$2()),h)}},{key:"reduceIdentifierExpression",value:function(s){var a=t$1(s.name);return s.name==="let"&&(a.startsWithLet=!0),a}},{key:"reduceIfStatement",value:function(s,a){var c=a.test,h=a.consequent,d=a.alternate;return d&&h.endsWithMissingElse&&(h=brace(h)),(0,_objectAssign2$1.default)(seq$1(t$1("if"),paren(c),h,d?seq$1(t$1("else"),d):empty$2()),{endsWithMissingElse:d?d.endsWithMissingElse:!0})}},{key:"reduceImport",value:function(s,a){var c=a.defaultBinding,h=a.namedImports,d=[];return c!=null&&d.push(c),h.length>0&&d.push(brace(commaSep(h))),d.length===0?seq$1(t$1("import"),t$1((0,_coderep$1.escapeStringLiteral)(s.moduleSpecifier)),semiOp()):seq$1(t$1("import"),commaSep(d),t$1("from"),t$1((0,_coderep$1.escapeStringLiteral)(s.moduleSpecifier)),semiOp())}},{key:"reduceImportNamespace",value:function(s,a){var c=a.defaultBinding,h=a.namespaceBinding;return seq$1(t$1("import"),c==null?empty$2():seq$1(c,t$1(",")),t$1("*"),t$1("as"),h,t$1("from"),t$1((0,_coderep$1.escapeStringLiteral)(s.moduleSpecifier)),semiOp())}},{key:"reduceImportSpecifier",value:function(s,a){var c=a.binding;return s.name==null?c:seq$1(t$1(s.name),t$1("as"),c)}},{key:"reduceExportAllFrom",value:function(s){return seq$1(t$1("export"),t$1("*"),t$1("from"),t$1((0,_coderep$1.escapeStringLiteral)(s.moduleSpecifier)),semiOp())}},{key:"reduceExportFrom",value:function(s,a){var c=a.namedExports;return seq$1(t$1("export"),brace(commaSep(c)),t$1("from"),t$1((0,_coderep$1.escapeStringLiteral)(s.moduleSpecifier)),semiOp())}},{key:"reduceExportLocals",value:function(s,a){var c=a.namedExports;return seq$1(t$1("export"),brace(commaSep(c)),semiOp())}},{key:"reduceExport",value:function(s,a){var c=a.declaration;switch(s.declaration.type){case"FunctionDeclaration":case"ClassDeclaration":break;default:c=seq$1(c,semiOp())}return seq$1(t$1("export"),c)}},{key:"reduceExportDefault",value:function(s,a){var c=a.body;switch(c=c.startsWithFunctionOrClass?paren(c):c,s.body.type){case"FunctionDeclaration":case"ClassDeclaration":return seq$1(t$1("export default"),c);default:return seq$1(t$1("export default"),p$1(s.body,_coderep$1.Precedence.Assignment,c),semiOp())}}},{key:"reduceExportFromSpecifier",value:function(s){return s.exportedName==null?t$1(s.name):seq$1(t$1(s.name),t$1("as"),t$1(s.exportedName))}},{key:"reduceExportLocalSpecifier",value:function(s,a){var c=a.name;return s.exportedName==null?c:seq$1(c,t$1("as"),t$1(s.exportedName))}},{key:"reduceLabeledStatement",value:function(s,a){var c=a.body;return(0,_objectAssign2$1.default)(seq$1(t$1(s.label+":"),c),{endsWithMissingElse:c.endsWithMissingElse})}},{key:"reduceLiteralBooleanExpression",value:function(s){return t$1(s.value.toString())}},{key:"reduceLiteralNullExpression",value:function(){return t$1("null")}},{key:"reduceLiteralInfinityExpression",value:function(){return t$1("2e308")}},{key:"reduceLiteralNumericExpression",value:function(s){return new _coderep$1.NumberCodeRep(s.value)}},{key:"reduceLiteralRegExpExpression",value:function(s){return t$1("/"+s.pattern+"/"+(s.global?"g":"")+(s.ignoreCase?"i":"")+(s.multiLine?"m":"")+(s.dotAll?"s":"")+(s.unicode?"u":"")+(s.sticky?"y":""),!0)}},{key:"reduceLiteralStringExpression",value:function(s){return t$1((0,_coderep$1.escapeStringLiteral)(s.value))}},{key:"reduceMethod",value:function(s,a){var c=a.name,h=a.params,d=a.body;return seq$1(s.isAsync?t$1("async"):empty$2(),s.isGenerator?t$1("*"):empty$2(),c,h,d)}},{key:"reduceModule",value:function(s,a){var c=a.directives,h=a.items;return h.length&&(h[0]=this.parenToAvoidBeingDirective(s.items[0],h[0])),seq$1.apply(void 0,_toConsumableArray$2(c).concat(_toConsumableArray$2(h)))}},{key:"reduceNewExpression",value:function(s,a){var c=a.callee,h=a.arguments,d=h.map(function(_,b){return p$1(s.arguments[b],_coderep$1.Precedence.Assignment,_)}),g=(0,_coderep$1.getPrecedence)(s.callee)===_coderep$1.Precedence.Call?paren(c):p$1(s.callee,(0,_coderep$1.getPrecedence)(s),c);return seq$1(t$1("new"),g,h.length===0?empty$2():paren(commaSep(d)))}},{key:"reduceNewTargetExpression",value:function(){return t$1("new.target")}},{key:"reduceObjectExpression",value:function(s,a){var c=a.properties,h=brace(commaSep(c));return h.startsWithCurly=!0,h}},{key:"reduceUpdateExpression",value:function(s,a){var c=a.operand;return s.isPrefix?this.reduceUnaryExpression.apply(this,arguments):(0,_objectAssign2$1.default)(seq$1(p$1(s.operand,_coderep$1.Precedence.New,c),t$1(s.operator)),{startsWithCurly:c.startsWithCurly,startsWithLetSquareBracket:c.startsWithLetSquareBracket,startsWithFunctionOrClass:c.startsWithFunctionOrClass})}},{key:"reduceUnaryExpression",value:function(s,a){var c=a.operand;return seq$1(t$1(s.operator),p$1(s.operand,(0,_coderep$1.getPrecedence)(s),c))}},{key:"reduceReturnStatement",value:function(s,a){var c=a.expression;return seq$1(t$1("return"),c||empty$2(),semiOp())}},{key:"reduceScript",value:function(s,a){var c=a.directives,h=a.statements;return h.length&&(h[0]=this.parenToAvoidBeingDirective(s.statements[0],h[0])),seq$1.apply(void 0,_toConsumableArray$2(c).concat(_toConsumableArray$2(h)))}},{key:"reduceSetter",value:function(s,a){var c=a.name,h=a.param,d=a.body;return seq$1(t$1("set"),c,paren(h),d)}},{key:"reduceShorthandProperty",value:function(s,a){var c=a.name;return c}},{key:"reduceStaticMemberAssignmentTarget",value:function(s,a){var c=a.object,h=seq$1(p$1(s.object,(0,_coderep$1.getPrecedence)(s),c),t$1("."),t$1(s.property));return h.startsWithLet=c.startsWithLet,h.startsWithCurly=c.startsWithCurly,h.startsWithLetSquareBracket=c.startsWithLetSquareBracket,h.startsWithFunctionOrClass=c.startsWithFunctionOrClass,h}},{key:"reduceStaticMemberExpression",value:function(s,a){var c=a.object,h=seq$1(p$1(s.object,(0,_coderep$1.getPrecedence)(s),c),t$1("."),t$1(s.property));return h.startsWithLet=c.startsWithLet,h.startsWithCurly=c.startsWithCurly,h.startsWithLetSquareBracket=c.startsWithLetSquareBracket,h.startsWithFunctionOrClass=c.startsWithFunctionOrClass,h}},{key:"reduceStaticPropertyName",value:function(s){if(_esutils$1.keyword.isIdentifierNameES6(s.value))return t$1(s.value);var a=parseFloat(s.value);return a>=0&&a.toString()===s.value?new _coderep$1.NumberCodeRep(a):t$1((0,_coderep$1.escapeStringLiteral)(s.value))}},{key:"reduceSuper",value:function(){return t$1("super")}},{key:"reduceSwitchCase",value:function(s,a){var c=a.test,h=a.consequent;return seq$1(t$1("case"),c,t$1(":"),seq$1.apply(void 0,_toConsumableArray$2(h)))}},{key:"reduceSwitchDefault",value:function(s,a){var c=a.consequent;return seq$1(t$1("default:"),seq$1.apply(void 0,_toConsumableArray$2(c)))}},{key:"reduceSwitchStatement",value:function(s,a){var c=a.discriminant,h=a.cases;return seq$1(t$1("switch"),paren(c),brace(seq$1.apply(void 0,_toConsumableArray$2(h))))}},{key:"reduceSwitchStatementWithDefault",value:function(s,a){var c=a.discriminant,h=a.preDefaultCases,d=a.defaultCase,g=a.postDefaultCases;return seq$1(t$1("switch"),paren(c),brace(seq$1.apply(void 0,_toConsumableArray$2(h).concat([d],_toConsumableArray$2(g)))))}},{key:"reduceTemplateExpression",value:function(s,a){var c=a.tag,h=a.elements,d=s.tag==null?empty$2():p$1(s.tag,(0,_coderep$1.getPrecedence)(s),c);d=seq$1(d,t$1("`"));for(var g=0,_=s.elements.length;g<_;++g)s.elements[g].type==="TemplateElement"?d=seq$1(d,g>0?t$1("}"):empty$2(),h[g],g<_-1?t$1("${"):empty$2()):d=seq$1(d,h[g]);return d=seq$1(d,t$1("`")),s.tag!=null&&(d.startsWithCurly=c.startsWithCurly,d.startsWithLet=c.startsWithLet,d.startsWithLetSquareBracket=c.startsWithLetSquareBracket,d.startsWithFunctionOrClass=c.startsWithFunctionOrClass),d}},{key:"reduceTemplateElement",value:function(s){return new _coderep$1.RawToken(s.rawValue)}},{key:"reduceThisExpression",value:function(){return t$1("this")}},{key:"reduceThrowStatement",value:function(s,a){var c=a.expression;return seq$1(t$1("throw"),c,semiOp())}},{key:"reduceTryCatchStatement",value:function(s,a){var c=a.body,h=a.catchClause;return seq$1(t$1("try"),c,h)}},{key:"reduceTryFinallyStatement",value:function(s,a){var c=a.body,h=a.catchClause,d=a.finalizer;return seq$1(t$1("try"),c,h||empty$2(),t$1("finally"),d)}},{key:"reduceYieldExpression",value:function(s,a){var c=a.expression;return s.expression==null?t$1("yield"):(0,_objectAssign2$1.default)(seq$1(t$1("yield"),p$1(s.expression,(0,_coderep$1.getPrecedence)(s),c)),{containsIn:c.containsIn})}},{key:"reduceYieldGeneratorExpression",value:function(s,a){var c=a.expression;return(0,_objectAssign2$1.default)(seq$1(t$1("yield"),t$1("*"),p$1(s.expression,(0,_coderep$1.getPrecedence)(s),c)),{containsIn:c.containsIn})}},{key:"reduceDirective",value:function(s){var a=s.rawValue.match(/(^|[^\\])(\\\\)*"/)?"'":'"';return seq$1(t$1(a+s.rawValue+a),semiOp())}},{key:"reduceVariableDeclaration",value:function(s,a){var c=a.declarators;return seq$1(t$1(s.kind),commaSep(c))}},{key:"reduceVariableDeclarationStatement",value:function(s,a){var c=a.declaration;return seq$1(c,semiOp())}},{key:"reduceVariableDeclarator",value:function(s,a){var c=a.binding,h=a.init,d=h&&h.containsIn&&!h.containsGroup;return h&&(h.containsGroup?h=paren(h):h=markContainsIn$1(h)),(0,_objectAssign2$1.default)(h==null?c:seq$1(c,t$1("="),h),{containsIn:d})}},{key:"reduceWhileStatement",value:function(s,a){var c=a.test,h=a.body;return(0,_objectAssign2$1.default)(seq$1(t$1("while"),paren(c),h),{endsWithMissingElse:h.endsWithMissingElse})}},{key:"reduceWithStatement",value:function(s,a){var c=a.object,h=a.body;return(0,_objectAssign2$1.default)(seq$1(t$1("with"),paren(c),h),{endsWithMissingElse:h.endsWithMissingElse})}}]),o}();minimalCodegen.default=MinimalCodeGen;var formattedCodegen={};Object.defineProperty(formattedCodegen,"__esModule",{value:!0});formattedCodegen.FormattedCodeGen=formattedCodegen.ExtensibleCodeGen=formattedCodegen.Sep=void 0;var _createClass$2=function(){function o(e,s){for(var a=0;a1&&arguments[1]!==void 0?arguments[1]:!1;return new _coderep.Token(s,a)}},{key:"p",value:function(s,a,c){return(0,_coderep.getPrecedence)(s)0&&h[h.length-1]==null&&(d=seq(d,this.sep(Sep.ARRAY_BEFORE_COMMA),this.t(","),this.sep(Sep.ARRAY_AFTER_COMMA))),this.bracket(d,Sep.ARRAY_INITIAL,Sep.ARRAY_FINAL)}},{key:"reduceAwaitExpression",value:function(s,a){var c=a.expression;return seq(this.t("await"),this.sep(Sep.AWAIT),this.p(s.expression,(0,_coderep.getPrecedence)(s),c))}},{key:"reduceSpreadElement",value:function(s,a){var c=a.expression;return seq(this.t("..."),this.sep(Sep.SPREAD),this.p(s.expression,_coderep.Precedence.Assignment,c))}},{key:"reduceSpreadProperty",value:function(s,a){var c=a.expression;return seq(this.t("..."),this.sep(Sep.SPREAD),this.getAssignmentExpr(c))}},{key:"reduceAssignmentExpression",value:function(s,a){var c=a.binding,h=a.expression,d=c,g=h,_=h.containsIn,b=c.startsWithCurly,$=c.startsWithLetSquareBracket,j=c.startsWithFunctionOrClass;return(0,_coderep.getPrecedence)(s.expression)<(0,_coderep.getPrecedence)(s)&&(g=this.paren(g,Sep.EXPRESSION_PAREN_BEFORE,Sep.EXPRESSION_PAREN_AFTER),_=!1),(0,_objectAssign2.default)(seq(d,this.sep(Sep.BEFORE_ASSIGN_OP("=")),this.t("="),this.sep(Sep.AFTER_ASSIGN_OP("=")),g),{containsIn:_,startsWithCurly:b,startsWithLetSquareBracket:$,startsWithFunctionOrClass:j})}},{key:"reduceAssignmentTargetIdentifier",value:function(s){var a=this.t(s.name);return s.name==="let"&&(a.startsWithLet=!0),a}},{key:"reduceAssignmentTargetWithDefault",value:function(s,a){var c=a.binding,h=a.init;return seq(c,this.sep(Sep.BEFORE_DEFAULT_EQUALS),this.t("="),this.sep(Sep.AFTER_DEFAULT_EQUALS),this.p(s.init,_coderep.Precedence.Assignment,h))}},{key:"reduceCompoundAssignmentExpression",value:function(s,a){var c=a.binding,h=a.expression,d=c,g=h,_=h.containsIn,b=c.startsWithCurly,$=c.startsWithLetSquareBracket,j=c.startsWithFunctionOrClass;return(0,_coderep.getPrecedence)(s.expression)<(0,_coderep.getPrecedence)(s)&&(g=this.paren(g,Sep.EXPRESSION_PAREN_BEFORE,Sep.EXPRESSION_PAREN_AFTER),_=!1),(0,_objectAssign2.default)(seq(d,this.sep(Sep.BEFORE_ASSIGN_OP(s.operator)),this.t(s.operator),this.sep(Sep.AFTER_ASSIGN_OP(s.operator)),g),{containsIn:_,startsWithCurly:b,startsWithLetSquareBracket:$,startsWithFunctionOrClass:j})}},{key:"reduceBinaryExpression",value:function(s,a){var c=a.left,h=a.right,d=c,g=c.startsWithCurly,_=c.startsWithLetSquareBracket,b=c.startsWithFunctionOrClass,$=c.containsIn,j=s.operator==="**";((0,_coderep.getPrecedence)(s.left)<(0,_coderep.getPrecedence)(s)||j&&((0,_coderep.getPrecedence)(s.left)===(0,_coderep.getPrecedence)(s)||s.left.type==="UnaryExpression"))&&(d=this.paren(d,Sep.EXPRESSION_PAREN_BEFORE,Sep.EXPRESSION_PAREN_AFTER),g=!1,_=!1,b=!1,$=!1);var _e=h,et=h.containsIn;return((0,_coderep.getPrecedence)(s.right)<(0,_coderep.getPrecedence)(s)||!j&&(0,_coderep.getPrecedence)(s.right)===(0,_coderep.getPrecedence)(s))&&(_e=this.paren(_e,Sep.EXPRESSION_PAREN_BEFORE,Sep.EXPRESSION_PAREN_AFTER),et=!1),(0,_objectAssign2.default)(seq(d,this.sep(Sep.BEFORE_BINOP(s.operator)),this.t(s.operator),this.sep(Sep.AFTER_BINOP(s.operator)),_e),{containsIn:$||et||s.operator==="in",containsGroup:s.operator===",",startsWithCurly:g,startsWithLetSquareBracket:_,startsWithFunctionOrClass:b})}},{key:"reduceBindingWithDefault",value:function(s,a){var c=a.binding,h=a.init;return seq(c,this.sep(Sep.BEFORE_DEFAULT_EQUALS),this.t("="),this.sep(Sep.AFTER_DEFAULT_EQUALS),this.p(s.init,_coderep.Precedence.Assignment,h))}},{key:"reduceBindingIdentifier",value:function(s){var a=this.t(s.name);return s.name==="let"&&(a.startsWithLet=!0),a}},{key:"reduceArrayAssignmentTarget",value:function(s,a){var c=this,h=a.elements,d=a.rest,g=void 0;return h.length===0?g=d==null?empty$1():seq(this.t("..."),this.sep(Sep.REST),d):(h=h.concat(d==null?[]:[seq(this.t("..."),this.sep(Sep.REST),d)]),g=this.commaSep(h.map(function(_){return c.getAssignmentExpr(_)}),Sep.ARRAY_BEFORE_COMMA,Sep.ARRAY_AFTER_COMMA),h.length>0&&h[h.length-1]==null&&(g=seq(g,this.sep(Sep.ARRAY_BEFORE_COMMA),this.t(","),this.sep(Sep.ARRAY_AFTER_COMMA)))),this.bracket(g,Sep.ARRAY_INITIAL,Sep.ARRAY_FINAL,Sep.ARRAY_EMPTY)}},{key:"reduceArrayBinding",value:function(s,a){var c=this,h=a.elements,d=a.rest,g=void 0;return h.length===0?g=d==null?empty$1():seq(this.t("..."),this.sep(Sep.REST),d):(h=h.concat(d==null?[]:[seq(this.t("..."),this.sep(Sep.REST),d)]),g=this.commaSep(h.map(function(_){return c.getAssignmentExpr(_)}),Sep.ARRAY_BEFORE_COMMA,Sep.ARRAY_AFTER_COMMA),h.length>0&&h[h.length-1]==null&&(g=seq(g,this.sep(Sep.ARRAY_BEFORE_COMMA),this.t(","),this.sep(Sep.ARRAY_AFTER_COMMA)))),this.bracket(g,Sep.ARRAY_INITIAL,Sep.ARRAY_FINAL,Sep.ARRAY_EMPTY)}},{key:"reduceObjectAssignmentTarget",value:function(s,a){var c=a.properties,h=a.rest,d=void 0;c.length===0?d=h==null?empty$1():seq(this.t("..."),this.sep(Sep.REST),h):(d=this.commaSep(c,Sep.OBJECT_BEFORE_COMMA,Sep.OBJECT_AFTER_COMMA),d=h==null?d:this.commaSep([d,seq(this.t("..."),this.sep(Sep.REST),h)],Sep.OBJECT_BEFORE_COMMA,Sep.OBJECT_AFTER_COMMA));var g=this.brace(d,s,Sep.OBJECT_BRACE_INITIAL,Sep.OBJECT_BRACE_FINAL,Sep.OBJECT_EMPTY);return g.startsWithCurly=!0,g}},{key:"reduceObjectBinding",value:function(s,a){var c=a.properties,h=a.rest,d=void 0;c.length===0?d=h==null?empty$1():seq(this.t("..."),this.sep(Sep.REST),h):(d=this.commaSep(c,Sep.OBJECT_BEFORE_COMMA,Sep.OBJECT_AFTER_COMMA),d=h==null?d:this.commaSep([d,seq(this.t("..."),this.sep(Sep.REST),h)],Sep.OBJECT_BEFORE_COMMA,Sep.OBJECT_AFTER_COMMA));var g=this.brace(d,s,Sep.OBJECT_BRACE_INITIAL,Sep.OBJECT_BRACE_FINAL,Sep.OBJECT_EMPTY);return g.startsWithCurly=!0,g}},{key:"reduceAssignmentTargetPropertyIdentifier",value:function(s,a){var c=a.binding,h=a.init;return s.init==null?c:seq(c,this.sep(Sep.BEFORE_DEFAULT_EQUALS),this.t("="),this.sep(Sep.AFTER_DEFAULT_EQUALS),this.p(s.init,_coderep.Precedence.Assignment,h))}},{key:"reduceAssignmentTargetPropertyProperty",value:function(s,a){var c=a.name,h=a.binding;return seq(c,this.sep(Sep.BEFORE_PROP),this.t(":"),this.sep(Sep.AFTER_PROP),h)}},{key:"reduceBindingPropertyIdentifier",value:function(s,a){var c=a.binding,h=a.init;return s.init==null?c:seq(c,this.sep(Sep.BEFORE_DEFAULT_EQUALS),this.t("="),this.sep(Sep.AFTER_DEFAULT_EQUALS),this.p(s.init,_coderep.Precedence.Assignment,h))}},{key:"reduceBindingPropertyProperty",value:function(s,a){var c=a.name,h=a.binding;return seq(c,this.sep(Sep.BEFORE_PROP),this.t(":"),this.sep(Sep.AFTER_PROP),h)}},{key:"reduceBlock",value:function(s,a){var c=a.statements;return this.brace(seq.apply(void 0,_toConsumableArray$1(c)),s,Sep.BLOCK_BRACE_INITIAL,Sep.BLOCK_BRACE_FINAL,Sep.BLOCK_EMPTY)}},{key:"reduceBlockStatement",value:function(s,a){var c=a.block;return seq(c,this.sep(Sep.AFTER_STATEMENT(s)))}},{key:"reduceBreakStatement",value:function(s){return seq(this.t("break"),s.label?seq(this.sep(Sep.BEFORE_JUMP_LABEL),this.t(s.label)):empty$1(),this.semiOp(),this.sep(Sep.AFTER_STATEMENT(s)))}},{key:"reduceCallExpression",value:function(s,a){var c=this,h=a.callee,d=a.arguments,g=d.map(function(_,b){return c.p(s.arguments[b],_coderep.Precedence.Assignment,_)});return(0,_objectAssign2.default)(seq(this.p(s.callee,(0,_coderep.getPrecedence)(s),h),this.sep(Sep.CALL),this.paren(this.commaSep(g,Sep.ARGS_BEFORE_COMMA,Sep.ARGS_AFTER_COMMA),Sep.CALL_PAREN_BEFORE,Sep.CALL_PAREN_AFTER,Sep.CALL_PAREN_EMPTY)),{startsWithCurly:h.startsWithCurly,startsWithLet:h.startsWithLet,startsWithLetSquareBracket:h.startsWithLetSquareBracket,startsWithFunctionOrClass:h.startsWithFunctionOrClass})}},{key:"reduceCatchClause",value:function(s,a){var c=a.binding,h=a.body;return seq(this.t("catch"),this.sep(Sep.BEFORE_CATCH_BINDING),this.paren(c,Sep.CATCH_PAREN_BEFORE,Sep.CATCH_PAREN_AFTER),this.sep(Sep.AFTER_CATCH_BINDING),h)}},{key:"reduceClassDeclaration",value:function(s,a){var c=a.name,h=a.super,d=a.elements,g=seq(this.t("class"),s.name.name==="*default*"?empty$1():seq(this.sep(Sep.BEFORE_CLASS_NAME),c));return h!=null&&(g=seq(g,this.sep(Sep.BEFORE_EXTENDS),this.t("extends"),this.sep(Sep.AFTER_EXTENDS),this.p(s.super,_coderep.Precedence.New,h))),g=seq(g,this.sep(Sep.BEFORE_CLASS_DECLARATION_ELEMENTS),this.brace(seq.apply(void 0,_toConsumableArray$1(d)),s,Sep.CLASS_BRACE_INITIAL,Sep.CLASS_BRACE_FINAL,Sep.CLASS_EMPTY),this.sep(Sep.AFTER_STATEMENT(s))),g}},{key:"reduceClassExpression",value:function(s,a){var c=a.name,h=a.super,d=a.elements,g=this.t("class");return c!=null&&(g=seq(g,this.sep(Sep.BEFORE_CLASS_NAME),c)),h!=null&&(g=seq(g,this.sep(Sep.BEFORE_EXTENDS),this.t("extends"),this.sep(Sep.AFTER_EXTENDS),this.p(s.super,_coderep.Precedence.New,h))),g=seq(g,this.sep(Sep.BEFORE_CLASS_EXPRESSION_ELEMENTS),this.brace(seq.apply(void 0,_toConsumableArray$1(d)),s,Sep.CLASS_EXPRESSION_BRACE_INITIAL,Sep.CLASS_EXPRESSION_BRACE_FINAL,Sep.CLASS_EXPRESSION_BRACE_EMPTY)),g.startsWithFunctionOrClass=!0,g}},{key:"reduceClassElement",value:function(s,a){var c=a.method;return c=seq(this.sep(Sep.BEFORE_CLASS_ELEMENT),c,this.sep(Sep.AFTER_CLASS_ELEMENT)),s.isStatic?seq(this.t("static"),this.sep(Sep.AFTER_STATIC),c):c}},{key:"reduceComputedMemberAssignmentTarget",value:function(s,a){var c=a.object,h=a.expression,d=c.startsWithLetSquareBracket||s.object.type==="IdentifierExpression"&&s.object.name==="let";return(0,_objectAssign2.default)(seq(this.p(s.object,(0,_coderep.getPrecedence)(s),c),this.sep(Sep.COMPUTED_MEMBER_ASSIGNMENT_TARGET),this.bracket(h,Sep.COMPUTED_MEMBER_ASSIGNMENT_TARGET_BRACKET_INTIAL,Sep.COMPUTED_MEMBER_ASSIGNMENT_TARGET_BRACKET_FINAL)),{startsWithLet:c.startsWithLet,startsWithLetSquareBracket:d,startsWithCurly:c.startsWithCurly,startsWithFunctionOrClass:c.startsWithFunctionOrClass})}},{key:"reduceComputedMemberExpression",value:function(s,a){var c=a.object,h=a.expression,d=c.startsWithLetSquareBracket||s.object.type==="IdentifierExpression"&&s.object.name==="let";return(0,_objectAssign2.default)(seq(this.p(s.object,(0,_coderep.getPrecedence)(s),c),this.sep(Sep.COMPUTED_MEMBER_EXPRESSION),this.bracket(h,Sep.COMPUTED_MEMBER_BRACKET_INTIAL,Sep.COMPUTED_MEMBER_BRACKET_FINAL)),{startsWithLet:c.startsWithLet,startsWithLetSquareBracket:d,startsWithCurly:c.startsWithCurly,startsWithFunctionOrClass:c.startsWithFunctionOrClass})}},{key:"reduceComputedPropertyName",value:function(s,a){var c=a.expression;return this.bracket(this.p(s.expression,_coderep.Precedence.Assignment,c),Sep.COMPUTED_PROPERTY_BRACKET_INTIAL,Sep.COMPUTED_PROPERTY_BRACKET_FINAL)}},{key:"reduceConditionalExpression",value:function(s,a){var c=a.test,h=a.consequent,d=a.alternate,g=c.containsIn||d.containsIn,_=c.startsWithCurly,b=c.startsWithLetSquareBracket,$=c.startsWithFunctionOrClass;return(0,_objectAssign2.default)(seq(this.p(s.test,_coderep.Precedence.LogicalOR,c),this.sep(Sep.BEFORE_TERNARY_QUESTION),this.t("?"),this.sep(Sep.AFTER_TERNARY_QUESTION),this.p(s.consequent,_coderep.Precedence.Assignment,h),this.sep(Sep.BEFORE_TERNARY_COLON),this.t(":"),this.sep(Sep.AFTER_TERNARY_COLON),this.p(s.alternate,_coderep.Precedence.Assignment,d)),{containsIn:g,startsWithCurly:_,startsWithLetSquareBracket:b,startsWithFunctionOrClass:$})}},{key:"reduceContinueStatement",value:function(s){return seq(this.t("continue"),s.label?seq(this.sep(Sep.BEFORE_JUMP_LABEL),this.t(s.label)):empty$1(),this.semiOp(),this.sep(Sep.AFTER_STATEMENT(s)))}},{key:"reduceDataProperty",value:function(s,a){var c=a.name,h=a.expression;return seq(c,this.sep(Sep.BEFORE_PROP),this.t(":"),this.sep(Sep.AFTER_PROP),this.getAssignmentExpr(h))}},{key:"reduceDebuggerStatement",value:function(s){return seq(this.t("debugger"),this.semiOp(),this.sep(Sep.AFTER_STATEMENT(s)))}},{key:"reduceDoWhileStatement",value:function(s,a){var c=a.body,h=a.test;return seq(this.t("do"),this.sep(Sep.AFTER_DO),c,this.sep(Sep.BEFORE_DOWHILE_WHILE),this.t("while"),this.sep(Sep.AFTER_DOWHILE_WHILE),this.paren(h,Sep.DO_WHILE_TEST_PAREN_BEFORE,Sep.DO_WHILE_TEST_PAREN_AFTER),this.semiOp(),this.sep(Sep.AFTER_STATEMENT(s)))}},{key:"reduceEmptyStatement",value:function(s){return seq(this.t(";"),this.sep(Sep.AFTER_STATEMENT(s)))}},{key:"reduceExpressionStatement",value:function(s,a){var c=a.expression,h=c.startsWithCurly||c.startsWithLetSquareBracket||c.startsWithFunctionOrClass;return seq(h?this.paren(c,Sep.EXPRESSION_STATEMENT_PAREN_BEFORE,Sep.EXPRESSION_STATEMENT_PAREN_AFTER):c,this.semiOp(),this.sep(Sep.AFTER_STATEMENT(s)))}},{key:"reduceForInStatement",value:function(s,a){var c=a.left,h=a.right,d=a.body;return c=s.left.type==="VariableDeclaration"?noIn(markContainsIn(c)):c,(0,_objectAssign2.default)(seq(this.t("for"),this.sep(Sep.AFTER_FORIN_FOR),this.paren(seq(c.startsWithLet?this.paren(c,Sep.FOR_IN_LET_PAREN_BEFORE,Sep.FOR_IN_LET_PAREN_AFTER):c,this.sep(Sep.BEFORE_FORIN_IN),this.t("in"),this.sep(Sep.AFTER_FORIN_FOR),h),Sep.FOR_IN_PAREN_BEFORE,Sep.FOR_IN_PAREN_AFTER),this.sep(Sep.BEFORE_FORIN_BODY),d,this.sep(Sep.AFTER_STATEMENT(s))),{endsWithMissingElse:d.endsWithMissingElse})}},{key:"reduceForOfStatement",value:function(s,a){var c=a.left,h=a.right,d=a.body;return c=s.left.type==="VariableDeclaration"?noIn(markContainsIn(c)):c,(0,_objectAssign2.default)(seq(this.t("for"),this.sep(Sep.AFTER_FOROF_FOR),this.paren(seq(c.startsWithLet?this.paren(c,Sep.FOR_OF_LET_PAREN_BEFORE,Sep.FOR_OF_LET_PAREN_AFTER):c,this.sep(Sep.BEFORE_FOROF_OF),this.t("of"),this.sep(Sep.AFTER_FOROF_FOR),this.p(s.right,_coderep.Precedence.Assignment,h)),Sep.FOR_OF_PAREN_BEFORE,Sep.FOR_OF_PAREN_AFTER),this.sep(Sep.BEFORE_FOROF_BODY),d,this.sep(Sep.AFTER_STATEMENT(s))),{endsWithMissingElse:d.endsWithMissingElse})}},{key:"reduceForStatement",value:function(s,a){var c=a.init,h=a.test,d=a.update,g=a.body;return c&&(c.startsWithLetSquareBracket&&(c=this.paren(c,Sep.FOR_LET_PAREN_BEFORE,Sep.FOR_LET_PAREN_AFTER)),c=noIn(markContainsIn(c))),(0,_objectAssign2.default)(seq(this.t("for"),this.sep(Sep.AFTER_FOR_FOR),this.paren(seq(c?seq(this.sep(Sep.BEFORE_FOR_INIT),c,this.sep(Sep.AFTER_FOR_INIT)):this.sep(Sep.EMPTY_FOR_INIT),this.t(";"),h?seq(this.sep(Sep.BEFORE_FOR_TEST),h,this.sep(Sep.AFTER_FOR_TEST)):this.sep(Sep.EMPTY_FOR_TEST),this.t(";"),d?seq(this.sep(Sep.BEFORE_FOR_UPDATE),d,this.sep(Sep.AFTER_FOR_UPDATE)):this.sep(Sep.EMPTY_FOR_UPDATE))),this.sep(Sep.BEFORE_FOR_BODY),g,this.sep(Sep.AFTER_STATEMENT(s))),{endsWithMissingElse:g.endsWithMissingElse})}},{key:"reduceForAwaitStatement",value:function(s,a){var c=a.left,h=a.right,d=a.body;return c=s.left.type==="VariableDeclaration"?noIn(markContainsIn(c)):c,(0,_objectAssign2.default)(seq(this.t("for"),this.sep(Sep.AFTER_FOROF_FOR),this.t("await"),this.sep(Sep.AFTER_FORAWAIT_AWAIT),this.paren(seq(c.startsWithLet?this.paren(c,Sep.FOR_OF_LET_PAREN_BEFORE,Sep.FOR_OF_LET_PAREN_AFTER):c,this.sep(Sep.BEFORE_FOROF_OF),this.t("of"),this.sep(Sep.AFTER_FOROF_FOR),this.p(s.right,_coderep.Precedence.Assignment,h)),Sep.FOR_OF_PAREN_BEFORE,Sep.FOR_OF_PAREN_AFTER),this.sep(Sep.BEFORE_FOROF_BODY),d,this.sep(Sep.AFTER_STATEMENT(s))),{endsWithMissingElse:d.endsWithMissingElse})}},{key:"reduceFunctionBody",value:function(s,a){var c=a.directives,h=a.statements;return h.length&&(h[0]=this.parenToAvoidBeingDirective(s.statements[0],h[0])),seq.apply(void 0,_toConsumableArray$1(c).concat([c.length?this.sep(Sep.AFTER_FUNCTION_DIRECTIVES):empty$1()],_toConsumableArray$1(h)))}},{key:"reduceFunctionDeclaration",value:function(s,a){var c=a.name,h=a.params,d=a.body;return seq(s.isAsync?this.t("async"):empty$1(),this.t("function"),s.isGenerator?seq(this.sep(Sep.BEFORE_GENERATOR_STAR),this.t("*"),this.sep(Sep.AFTER_GENERATOR_STAR)):empty$1(),this.sep(Sep.BEFORE_FUNCTION_NAME(s)),s.name.name==="*default*"?empty$1():c,this.sep(Sep.BEFORE_FUNCTION_PARAMS),this.paren(h,Sep.PARAMETERS_PAREN_BEFORE,Sep.PARAMETERS_PAREN_AFTER,Sep.PARAMETERS_PAREN_EMPTY),this.sep(Sep.BEFORE_FUNCTION_DECLARATION_BODY),this.brace(d,s,Sep.FUNCTION_BRACE_INITIAL,Sep.FUNCTION_BRACE_FINAL,Sep.FUNCTION_EMPTY),this.sep(Sep.AFTER_STATEMENT(s)))}},{key:"reduceFunctionExpression",value:function(s,a){var c=a.name,h=a.params,d=a.body,g=seq(s.isAsync?this.t("async"):empty$1(),this.t("function"),s.isGenerator?seq(this.sep(Sep.BEFORE_GENERATOR_STAR),this.t("*"),this.sep(Sep.AFTER_GENERATOR_STAR)):empty$1(),this.sep(Sep.BEFORE_FUNCTION_NAME(s)),c||empty$1(),this.sep(Sep.BEFORE_FUNCTION_PARAMS),this.paren(h,Sep.PARAMETERS_PAREN_BEFORE,Sep.PARAMETERS_PAREN_AFTER,Sep.PARAMETERS_PAREN_EMPTY),this.sep(Sep.BEFORE_FUNCTION_EXPRESSION_BODY),this.brace(d,s,Sep.FUNCTION_EXPRESSION_BRACE_INITIAL,Sep.FUNCTION_EXPRESSION_BRACE_FINAL,Sep.FUNCTION_EXPRESSION_EMPTY));return g.startsWithFunctionOrClass=!0,g}},{key:"reduceFormalParameters",value:function(s,a){var c=a.items,h=a.rest;return this.commaSep(c.concat(h==null?[]:[seq(this.t("..."),this.sep(Sep.REST),h)]),Sep.PARAMETER_BEFORE_COMMA,Sep.PARAMETER_AFTER_COMMA)}},{key:"reduceArrowExpression",value:function(s,a){var c=a.params,h=a.body;(s.params.rest!=null||s.params.items.length!==1||s.params.items[0].type!=="BindingIdentifier")&&(c=this.paren(c,Sep.ARROW_PARAMETERS_PAREN_BEFORE,Sep.ARROW_PARAMETERS_PAREN_AFTER,Sep.ARROW_PARAMETERS_PAREN_EMPTY));var d=!1;return s.body.type==="FunctionBody"?h=this.brace(h,s,Sep.ARROW_BRACE_INITIAL,Sep.ARROW_BRACE_FINAL,Sep.ARROW_BRACE_EMPTY):h.startsWithCurly?h=this.paren(h,Sep.ARROW_BODY_PAREN_BEFORE,Sep.ARROW_BODY_PAREN_AFTER):h.containsIn&&(d=!0),(0,_objectAssign2.default)(seq(s.isAsync?seq(this.t("async"),this.sep(Sep.BEFORE_ARROW_ASYNC_PARAMS)):empty$1(),c,this.sep(Sep.BEFORE_ARROW),this.t("=>"),this.sep(Sep.AFTER_ARROW),this.p(s.body,_coderep.Precedence.Assignment,h)),{containsIn:d})}},{key:"reduceGetter",value:function(s,a){var c=a.name,h=a.body;return seq(this.t("get"),this.sep(Sep.AFTER_GET),c,this.sep(Sep.BEFORE_GET_PARAMS),this.paren(empty$1(),null,null,Sep.GETTER_PARAMS),this.sep(Sep.BEFORE_GET_BODY),this.brace(h,s,Sep.GET_BRACE_INTIAL,Sep.GET_BRACE_FINAL,Sep.GET_BRACE_EMPTY))}},{key:"reduceIdentifierExpression",value:function(s){var a=this.t(s.name);return s.name==="let"&&(a.startsWithLet=!0),a}},{key:"reduceIfStatement",value:function(s,a){var c=a.test,h=a.consequent,d=a.alternate;return d&&h.endsWithMissingElse&&(h=this.brace(h,s,Sep.MISSING_ELSE_INTIIAL,Sep.MISSING_ELSE_FINAL,Sep.MISSING_ELSE_EMPTY)),(0,_objectAssign2.default)(seq(this.t("if"),this.sep(Sep.AFTER_IF),this.paren(c,Sep.IF_PAREN_BEFORE,Sep.IF_PAREN_AFTER),this.sep(Sep.AFTER_IF_TEST),h,d?seq(this.sep(Sep.BEFORE_ELSE),this.t("else"),this.sep(Sep.AFTER_ELSE),d):empty$1(),this.sep(Sep.AFTER_STATEMENT(s))),{endsWithMissingElse:d?d.endsWithMissingElse:!0})}},{key:"reduceImport",value:function(s,a){var c=a.defaultBinding,h=a.namedImports,d=[];return c!=null&&d.push(c),h.length>0&&d.push(this.brace(this.commaSep(h,Sep.NAMED_IMPORT_BEFORE_COMMA,Sep.NAMED_IMPORT_AFTER_COMMA),s,Sep.IMPORT_BRACE_INTIAL,Sep.IMPORT_BRACE_FINAL,Sep.IMPORT_BRACE_EMPTY)),d.length===0?seq(this.t("import"),this.sep(Sep.BEFORE_IMPORT_MODULE),this.t((0,_coderep.escapeStringLiteral)(s.moduleSpecifier)),this.semiOp(),this.sep(Sep.AFTER_STATEMENT(s))):seq(this.t("import"),this.sep(Sep.BEFORE_IMPORT_BINDINGS),this.commaSep(d,Sep.IMPORT_BEFORE_COMMA,Sep.IMPORT_AFTER_COMMA),this.sep(Sep.AFTER_IMPORT_BINDINGS),this.t("from"),this.sep(Sep.AFTER_FROM),this.t((0,_coderep.escapeStringLiteral)(s.moduleSpecifier)),this.semiOp(),this.sep(Sep.AFTER_STATEMENT(s)))}},{key:"reduceImportNamespace",value:function(s,a){var c=a.defaultBinding,h=a.namespaceBinding;return seq(this.t("import"),this.sep(Sep.BEFORE_IMPORT_NAMESPACE),c==null?empty$1():seq(c,this.sep(Sep.IMPORT_BEFORE_COMMA),this.t(","),this.sep(Sep.IMPORT_AFTER_COMMA)),this.sep(Sep.BEFORE_IMPORT_STAR),this.t("*"),this.sep(Sep.AFTER_IMPORT_STAR),this.t("as"),this.sep(Sep.AFTER_IMPORT_AS),h,this.sep(Sep.AFTER_NAMESPACE_BINDING),this.t("from"),this.sep(Sep.AFTER_FROM),this.t((0,_coderep.escapeStringLiteral)(s.moduleSpecifier)),this.semiOp(),this.sep(Sep.AFTER_STATEMENT(s)))}},{key:"reduceImportSpecifier",value:function(s,a){var c=a.binding;return s.name==null?c:seq(this.t(s.name),this.sep(Sep.BEFORE_IMPORT_AS),this.t("as"),this.sep(Sep.AFTER_IMPORT_AS),c)}},{key:"reduceExportAllFrom",value:function(s){return seq(this.t("export"),this.sep(Sep.BEFORE_EXPORT_STAR),this.t("*"),this.sep(Sep.AFTER_EXPORT_STAR),this.t("from"),this.sep(Sep.AFTER_FROM),this.t((0,_coderep.escapeStringLiteral)(s.moduleSpecifier)),this.semiOp(),this.sep(Sep.AFTER_STATEMENT(s)))}},{key:"reduceExportFrom",value:function(s,a){var c=a.namedExports;return seq(this.t("export"),this.sep(Sep.BEFORE_EXPORT_BINDINGS),this.brace(this.commaSep(c,Sep.EXPORTS_BEFORE_COMMA,Sep.EXPORTS_AFTER_COMMA),s,Sep.EXPORT_BRACE_INITIAL,Sep.EXPORT_BRACE_FINAL,Sep.EXPORT_BRACE_EMPTY),this.sep(Sep.AFTER_EXPORT_FROM_BINDINGS),this.t("from"),this.sep(Sep.AFTER_FROM),this.t((0,_coderep.escapeStringLiteral)(s.moduleSpecifier)),this.semiOp(),this.sep(Sep.AFTER_STATEMENT(s)))}},{key:"reduceExportLocals",value:function(s,a){var c=a.namedExports;return seq(this.t("export"),this.sep(Sep.BEFORE_EXPORT_BINDINGS),this.brace(this.commaSep(c,Sep.EXPORTS_BEFORE_COMMA,Sep.EXPORTS_AFTER_COMMA),s,Sep.EXPORT_BRACE_INITIAL,Sep.EXPORT_BRACE_FINAL,Sep.EXPORT_BRACE_EMPTY),this.sep(Sep.AFTER_EXPORT_LOCAL_BINDINGS),this.semiOp(),this.sep(Sep.AFTER_STATEMENT(s)))}},{key:"reduceExport",value:function(s,a){var c=a.declaration;switch(s.declaration.type){case"FunctionDeclaration":case"ClassDeclaration":break;default:c=seq(c,this.semiOp(),this.sep(Sep.AFTER_STATEMENT(s)))}return seq(this.t("export"),this.sep(Sep.AFTER_EXPORT),c)}},{key:"reduceExportDefault",value:function(s,a){var c=a.body;switch(c=c.startsWithFunctionOrClass?this.paren(c,Sep.EXPORT_PAREN_BEFORE,Sep.EXPORT_PAREN_AFTER):c,s.body.type){case"FunctionDeclaration":case"ClassDeclaration":return seq(this.t("export"),this.sep(Sep.EXPORT_DEFAULT),this.t("default"),this.sep(Sep.AFTER_EXPORT_DEFAULT),c);default:return seq(this.t("export"),this.sep(Sep.EXPORT_DEFAULT),this.t("default"),this.sep(Sep.AFTER_EXPORT_DEFAULT),this.p(s.body,_coderep.Precedence.Assignment,c),this.semiOp(),this.sep(Sep.AFTER_STATEMENT(s)))}}},{key:"reduceExportFromSpecifier",value:function(s){return s.exportedName==null?this.t(s.name):seq(this.t(s.name),this.sep(Sep.BEFORE_EXPORT_AS),this.t("as"),this.sep(Sep.AFTER_EXPORT_AS),this.t(s.exportedName))}},{key:"reduceExportLocalSpecifier",value:function(s,a){var c=a.name;return s.exportedName==null?c:seq(c,this.sep(Sep.BEFORE_EXPORT_AS),this.t("as"),this.sep(Sep.AFTER_EXPORT_AS),this.t(s.exportedName))}},{key:"reduceLabeledStatement",value:function(s,a){var c=a.body;return(0,_objectAssign2.default)(seq(this.t(s.label),this.sep(Sep.BEFORE_LABEL_COLON),this.t(":"),this.sep(Sep.AFTER_LABEL_COLON),c),{endsWithMissingElse:c.endsWithMissingElse})}},{key:"reduceLiteralBooleanExpression",value:function(s){return this.t(s.value.toString())}},{key:"reduceLiteralNullExpression",value:function(){return this.t("null")}},{key:"reduceLiteralInfinityExpression",value:function(){return this.t("2e308")}},{key:"reduceLiteralNumericExpression",value:function(s){return new _coderep.NumberCodeRep(s.value)}},{key:"reduceLiteralRegExpExpression",value:function(s){return this.t("/"+s.pattern+"/"+(s.global?"g":"")+(s.ignoreCase?"i":"")+(s.multiLine?"m":"")+(s.dotAll?"s":"")+(s.unicode?"u":"")+(s.sticky?"y":""),!0)}},{key:"reduceLiteralStringExpression",value:function(s){return this.t((0,_coderep.escapeStringLiteral)(s.value))}},{key:"reduceMethod",value:function(s,a){var c=a.name,h=a.params,d=a.body;return seq(s.isAsync?seq(this.t("async"),this.sep(Sep.AFTER_METHOD_ASYNC)):empty$1(),s.isGenerator?seq(this.t("*"),this.sep(Sep.AFTER_METHOD_GENERATOR_STAR)):empty$1(),c,this.sep(Sep.AFTER_METHOD_NAME),this.paren(h,Sep.PARAMETERS_PAREN_BEFORE,Sep.PARAMETERS_PAREN_AFTER,Sep.PARAMETERS_PAREN_EMPTY),this.sep(Sep.BEFORE_METHOD_BODY),this.brace(d,s,Sep.METHOD_BRACE_INTIAL,Sep.METHOD_BRACE_FINAL,Sep.METHOD_BRACE_EMPTY))}},{key:"reduceModule",value:function(s,a){var c=a.directives,h=a.items;return h.length&&(h[0]=this.parenToAvoidBeingDirective(s.items[0],h[0])),seq.apply(void 0,_toConsumableArray$1(c).concat([c.length?this.sep(Sep.AFTER_MODULE_DIRECTIVES):empty$1()],_toConsumableArray$1(h)))}},{key:"reduceNewExpression",value:function(s,a){var c=this,h=a.callee,d=a.arguments,g=d.map(function(b,$){return c.p(s.arguments[$],_coderep.Precedence.Assignment,b)}),_=(0,_coderep.getPrecedence)(s.callee)===_coderep.Precedence.Call?this.paren(h,Sep.NEW_CALLEE_PAREN_BEFORE,Sep.NEW_CALLEE_PAREN_AFTER):this.p(s.callee,(0,_coderep.getPrecedence)(s),h);return seq(this.t("new"),this.sep(Sep.AFTER_NEW),_,d.length===0?this.sep(Sep.EMPTY_NEW_CALL):seq(this.sep(Sep.BEFORE_NEW_ARGS),this.paren(this.commaSep(g,Sep.ARGS_BEFORE_COMMA,Sep.ARGS_AFTER_COMMA),Sep.NEW_PAREN_BEFORE,Sep.NEW_PAREN_AFTER,Sep.NEW_PAREN_EMPTY)))}},{key:"reduceNewTargetExpression",value:function(){return seq(this.t("new"),this.sep(Sep.NEW_TARGET_BEFORE_DOT),this.t("."),this.sep(Sep.NEW_TARGET_AFTER_DOT),this.t("target"))}},{key:"reduceObjectExpression",value:function(s,a){var c=a.properties,h=this.brace(this.commaSep(c,Sep.OBJECT_BEFORE_COMMA,Sep.OBJECT_AFTER_COMMA),s,Sep.OBJECT_BRACE_INITIAL,Sep.OBJECT_BRACE_FINAL,Sep.OBJECT_EMPTY);return h.startsWithCurly=!0,h}},{key:"reduceUpdateExpression",value:function(s,a){var c=a.operand;return s.isPrefix?this.reduceUnaryExpression.apply(this,arguments):(0,_objectAssign2.default)(seq(this.p(s.operand,_coderep.Precedence.New,c),this.sep(Sep.BEFORE_POSTFIX(s.operator)),this.t(s.operator)),{startsWithCurly:c.startsWithCurly,startsWithLetSquareBracket:c.startsWithLetSquareBracket,startsWithFunctionOrClass:c.startsWithFunctionOrClass})}},{key:"reduceUnaryExpression",value:function(s,a){var c=a.operand;return seq(this.t(s.operator),this.sep(Sep.UNARY(s.operator)),this.p(s.operand,(0,_coderep.getPrecedence)(s),c))}},{key:"reduceReturnStatement",value:function(s,a){var c=a.expression;return seq(this.t("return"),c?seq(this.sep(Sep.RETURN),c):empty$1(),this.semiOp(),this.sep(Sep.AFTER_STATEMENT(s)))}},{key:"reduceScript",value:function(s,a){var c=a.directives,h=a.statements;return h.length&&(h[0]=this.parenToAvoidBeingDirective(s.statements[0],h[0])),seq.apply(void 0,_toConsumableArray$1(c).concat([c.length?this.sep(Sep.AFTER_SCRIPT_DIRECTIVES):empty$1()],_toConsumableArray$1(h)))}},{key:"reduceSetter",value:function(s,a){var c=a.name,h=a.param,d=a.body;return seq(this.t("set"),this.sep(Sep.AFTER_SET),c,this.sep(Sep.BEFORE_SET_PARAMS),this.paren(h,Sep.SETTER_PARAM_BEFORE,Sep.SETTER_PARAM_AFTER),this.sep(Sep.BEFORE_SET_BODY),this.brace(d,s,Sep.SET_BRACE_INTIIAL,Sep.SET_BRACE_FINAL,Sep.SET_BRACE_EMPTY))}},{key:"reduceShorthandProperty",value:function(s,a){var c=a.name;return c}},{key:"reduceStaticMemberAssignmentTarget",value:function(s,a){var c=a.object,h=seq(this.p(s.object,(0,_coderep.getPrecedence)(s),c),this.sep(Sep.BEFORE_STATIC_MEMBER_ASSIGNMENT_TARGET_DOT),this.t("."),this.sep(Sep.AFTER_STATIC_MEMBER_ASSIGNMENT_TARGET_DOT),this.t(s.property));return h.startsWithLet=c.startsWithLet,h.startsWithCurly=c.startsWithCurly,h.startsWithLetSquareBracket=c.startsWithLetSquareBracket,h.startsWithFunctionOrClass=c.startsWithFunctionOrClass,h}},{key:"reduceStaticMemberExpression",value:function(s,a){var c=a.object,h=seq(this.p(s.object,(0,_coderep.getPrecedence)(s),c),this.sep(Sep.BEFORE_STATIC_MEMBER_DOT),this.t("."),this.sep(Sep.AFTER_STATIC_MEMBER_DOT),this.t(s.property));return h.startsWithLet=c.startsWithLet,h.startsWithCurly=c.startsWithCurly,h.startsWithLetSquareBracket=c.startsWithLetSquareBracket,h.startsWithFunctionOrClass=c.startsWithFunctionOrClass,h}},{key:"reduceStaticPropertyName",value:function(s){if(_esutils.keyword.isIdentifierNameES6(s.value))return this.t(s.value);var a=parseFloat(s.value);return a>=0&&a.toString()===s.value?new _coderep.NumberCodeRep(a):this.t((0,_coderep.escapeStringLiteral)(s.value))}},{key:"reduceSuper",value:function(){return this.t("super")}},{key:"reduceSwitchCase",value:function(s,a){var c=a.test,h=a.consequent;return seq(this.t("case"),this.sep(Sep.BEFORE_CASE_TEST),c,this.sep(Sep.AFTER_CASE_TEST),this.t(":"),this.sep(Sep.BEFORE_CASE_BODY),seq.apply(void 0,_toConsumableArray$1(h)),this.sep(Sep.AFTER_CASE_BODY))}},{key:"reduceSwitchDefault",value:function(s,a){var c=a.consequent;return seq(this.t("default"),this.sep(Sep.DEFAULT),this.t(":"),this.sep(Sep.BEFORE_CASE_BODY),seq.apply(void 0,_toConsumableArray$1(c)),this.sep(Sep.AFTER_DEFAULT_BODY))}},{key:"reduceSwitchStatement",value:function(s,a){var c=a.discriminant,h=a.cases;return seq(this.t("switch"),this.sep(Sep.BEFORE_SWITCH_DISCRIM),this.paren(c,Sep.SWITCH_DISCRIM_PAREN_BEFORE,Sep.SWITCH_DISCRIM_PAREN_AFTER),this.sep(Sep.BEFORE_SWITCH_BODY),this.brace(seq.apply(void 0,_toConsumableArray$1(h)),s,Sep.SWITCH_BRACE_INTIAL,Sep.SWITCH_BRACE_FINAL,Sep.SWITCH_BRACE_EMPTY),this.sep(Sep.AFTER_STATEMENT(s)))}},{key:"reduceSwitchStatementWithDefault",value:function(s,a){var c=a.discriminant,h=a.preDefaultCases,d=a.defaultCase,g=a.postDefaultCases;return seq(this.t("switch"),this.sep(Sep.BEFORE_SWITCH_DISCRIM),this.paren(c,Sep.SWITCH_DISCRIM_PAREN_BEFORE,Sep.SWITCH_DISCRIM_PAREN_AFTER),this.sep(Sep.BEFORE_SWITCH_BODY),this.brace(seq.apply(void 0,_toConsumableArray$1(h).concat([d],_toConsumableArray$1(g))),s,Sep.SWITCH_BRACE_INTIAL,Sep.SWITCH_BRACE_FINAL,Sep.SWITCH_BRACE_EMPTY),this.sep(Sep.AFTER_STATEMENT(s)))}},{key:"reduceTemplateExpression",value:function(s,a){var c=a.tag,h=a.elements,d=s.tag==null?empty$1():seq(this.p(s.tag,(0,_coderep.getPrecedence)(s),c),this.sep(Sep.TEMPLATE_TAG));d=seq(d,this.t("`"));for(var g=0,_=s.elements.length;g<_;++g)if(s.elements[g].type==="TemplateElement"){var b="";g>0&&(b+="}"),b+=s.elements[g].rawValue,g<_-1&&(b+="${"),d=seq(d,this.t(b))}else d=seq(d,this.sep(Sep.BEFORE_TEMPLATE_EXPRESSION),h[g],this.sep(Sep.AFTER_TEMPLATE_EXPRESSION));return d=seq(d,this.t("`")),s.tag!=null&&(d.startsWithCurly=c.startsWithCurly,d.startsWithLet=c.startsWithLet,d.startsWithLetSquareBracket=c.startsWithLetSquareBracket,d.startsWithFunctionOrClass=c.startsWithFunctionOrClass),d}},{key:"reduceTemplateElement",value:function(s){return this.t(s.rawValue)}},{key:"reduceThisExpression",value:function(){return this.t("this")}},{key:"reduceThrowStatement",value:function(s,a){var c=a.expression;return seq(this.t("throw"),this.sep(Sep.THROW),c,this.semiOp(),this.sep(Sep.AFTER_STATEMENT(s)))}},{key:"reduceTryCatchStatement",value:function(s,a){var c=a.body,h=a.catchClause;return seq(this.t("try"),this.sep(Sep.AFTER_TRY),c,this.sep(Sep.BEFORE_CATCH),h,this.sep(Sep.AFTER_STATEMENT(s)))}},{key:"reduceTryFinallyStatement",value:function(s,a){var c=a.body,h=a.catchClause,d=a.finalizer;return seq(this.t("try"),this.sep(Sep.AFTER_TRY),c,h?seq(this.sep(Sep.BEFORE_CATCH),h):empty$1(),this.sep(Sep.BEFORE_FINALLY),this.t("finally"),this.sep(Sep.AFTER_FINALLY),d,this.sep(Sep.AFTER_STATEMENT(s)))}},{key:"reduceYieldExpression",value:function(s,a){var c=a.expression;return s.expression==null?this.t("yield"):(0,_objectAssign2.default)(seq(this.t("yield"),this.sep(Sep.YIELD),this.p(s.expression,(0,_coderep.getPrecedence)(s),c)),{containsIn:c.containsIn})}},{key:"reduceYieldGeneratorExpression",value:function(s,a){var c=a.expression;return(0,_objectAssign2.default)(seq(this.t("yield"),this.sep(Sep.BEFORE_YIELD_STAR),this.t("*"),this.sep(Sep.AFTER_YIELD_STAR),this.p(s.expression,(0,_coderep.getPrecedence)(s),c)),{containsIn:c.containsIn})}},{key:"reduceDirective",value:function(s){var a=s.rawValue.match(/(^|[^\\])(\\\\)*"/)?"'":'"';return seq(this.t(a+s.rawValue+a),this.semiOp(),this.sep(Sep.AFTER_STATEMENT(s)))}},{key:"reduceVariableDeclaration",value:function(s,a){var c=a.declarators;return seq(this.t(s.kind),this.sep(Sep.VARIABLE_DECLARATION),this.commaSep(c,Sep.DECLARATORS_BEFORE_COMMA,Sep.DECLARATORS_AFTER_COMMA))}},{key:"reduceVariableDeclarationStatement",value:function(s,a){var c=a.declaration;return seq(c,this.semiOp(),this.sep(Sep.AFTER_STATEMENT(s)))}},{key:"reduceVariableDeclarator",value:function(s,a){var c=a.binding,h=a.init,d=h&&h.containsIn&&!h.containsGroup;return h&&(h.containsGroup?h=this.paren(h,Sep.EXPRESSION_PAREN_BEFORE,Sep.EXPRESSION_PAREN_AFTER):h=markContainsIn(h)),(0,_objectAssign2.default)(h==null?c:seq(c,this.sep(Sep.BEFORE_INIT_EQUALS),this.t("="),this.sep(Sep.AFTER_INIT_EQUALS),h),{containsIn:d})}},{key:"reduceWhileStatement",value:function(s,a){var c=a.test,h=a.body;return(0,_objectAssign2.default)(seq(this.t("while"),this.sep(Sep.AFTER_WHILE),this.paren(c,Sep.WHILE_TEST_PAREN_BEFORE,Sep.WHILE_TEST_PAREN_AFTER),this.sep(Sep.BEFORE_WHILE_BODY),h,this.sep(Sep.AFTER_STATEMENT(s))),{endsWithMissingElse:h.endsWithMissingElse})}},{key:"reduceWithStatement",value:function(s,a){var c=a.object,h=a.body;return(0,_objectAssign2.default)(seq(this.t("with"),this.sep(Sep.AFTER_WITH),this.paren(c,Sep.WITH_PAREN_BEFORE,Sep.WITH_PAREN_AFTER),this.sep(Sep.BEFORE_WITH_BODY),h,this.sep(Sep.AFTER_STATEMENT(s))),{endsWithMissingElse:h.endsWithMissingElse})}}]),o}();function withoutTrailingLinebreak(o){if(o&&o instanceof _coderep.Seq){for(var e=o.children[o.children.length-1];e instanceof _coderep.Empty;)o.children.pop(),e=o.children[o.children.length-1];e instanceof _coderep.Seq?withoutTrailingLinebreak(e):e instanceof Linebreak&&o.children.pop()}return o}function indent(o,e){var s=void 0;function a(c){c instanceof Linebreak&&(s=c,++c.indentation)}return o.forEach(a),e||--s.indentation,o}formattedCodegen.FormattedCodeGen=function(o){_inherits$1(e,o);function e(){return _classCallCheck$2(this,e),_possibleConstructorReturn$1(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return _createClass$2(e,[{key:"parenToAvoidBeingDirective",value:function(a,c){return a&&a.type==="ExpressionStatement"&&a.expression.type==="LiteralStringExpression"?seq(this.paren(c.children[0],Sep.PAREN_AVOIDING_DIRECTIVE_BEFORE,Sep.PAREN_AVOIDING_DIRECTIVE_AFTER),this.semiOp(),this.sep(Sep.AFTER_STATEMENT(a))):c}},{key:"brace",value:function(a,c){if(isEmpty(a))return this.t("{}");switch(c.type){case"ObjectAssignmentTarget":case"ObjectBinding":case"Import":case"ExportFrom":case"ExportLocals":case"ObjectExpression":return new _coderep.Brace(a)}return a=seq(new Linebreak,a),indent(a,!1),new _coderep.Brace(a)}},{key:"reduceDoWhileStatement",value:function(a,c){var h=c.body,d=c.test;return seq(this.t("do"),this.sep(Sep.AFTER_DO),withoutTrailingLinebreak(h),this.sep(Sep.BEFORE_DOWHILE_WHILE),this.t("while"),this.sep(Sep.AFTER_DOWHILE_WHILE),this.paren(d,Sep.DO_WHILE_TEST_PAREN_BEFORE,Sep.DO_WHILE_TEST_PAREN_AFTER),this.semiOp(),this.sep(Sep.AFTER_STATEMENT(a)))}},{key:"reduceIfStatement",value:function(a,c){var h=c.test,d=c.consequent,g=c.alternate;return g&&d.endsWithMissingElse&&(d=this.brace(d,a)),(0,_objectAssign2.default)(seq(this.t("if"),this.sep(Sep.AFTER_IF),this.paren(h,Sep.IF_PAREN_BEFORE,Sep.IF_PAREN_AFTER),this.sep(Sep.AFTER_IF_TEST),withoutTrailingLinebreak(d),g?seq(this.sep(Sep.BEFORE_ELSE),this.t("else"),this.sep(Sep.AFTER_ELSE),withoutTrailingLinebreak(g)):empty$1(),this.sep(Sep.AFTER_STATEMENT(a))),{endsWithMissingElse:g?g.endsWithMissingElse:!0})}},{key:"reduceSwitchCase",value:function(a,c){var h=c.test,d=c.consequent;return d=indent(withoutTrailingLinebreak(seq.apply(void 0,[this.sep(Sep.BEFORE_CASE_BODY)].concat(_toConsumableArray$1(d)))),!0),seq(this.t("case"),this.sep(Sep.BEFORE_CASE_TEST),h,this.sep(Sep.AFTER_CASE_TEST),this.t(":"),d,this.sep(Sep.AFTER_CASE_BODY))}},{key:"reduceSwitchDefault",value:function(a,c){var h=c.consequent;return h=indent(withoutTrailingLinebreak(seq.apply(void 0,[this.sep(Sep.BEFORE_CASE_BODY)].concat(_toConsumableArray$1(h)))),!0),seq(this.t("default"),this.sep(Sep.DEFAULT),this.t(":"),h,this.sep(Sep.AFTER_DEFAULT_BODY))}},{key:"sep",value:function(a){switch(a.type){case"AWAIT":case"AFTER_FORAWAIT_AWAIT":case"ARRAY_AFTER_COMMA":case"OBJECT_AFTER_COMMA":case"ARGS_AFTER_COMMA":case"PARAMETER_AFTER_COMMA":case"DECLARATORS_AFTER_COMMA":case"NAMED_IMPORT_AFTER_COMMA":case"IMPORT_AFTER_COMMA":case"BEFORE_DEFAULT_EQUALS":case"AFTER_DEFAULT_EQUALS":case"AFTER_PROP":case"BEFORE_JUMP_LABEL":case"BEFORE_CATCH_BINDING":case"AFTER_CATCH_BINDING":case"BEFORE_CLASS_NAME":case"BEFORE_EXTENDS":case"AFTER_EXTENDS":case"BEFORE_CLASS_DECLARATION_ELEMENTS":case"BEFORE_CLASS_EXPRESSION_ELEMENTS":case"AFTER_STATIC":case"BEFORE_TERNARY_QUESTION":case"AFTER_TERNARY_QUESTION":case"BEFORE_TERNARY_COLON":case"AFTER_TERNARY_COLON":case"AFTER_DO":case"BEFORE_DOWHILE_WHILE":case"AFTER_DOWHILE_WHILE":case"AFTER_FORIN_FOR":case"BEFORE_FORIN_IN":case"BEFORE_FORIN_BODY":case"BEFORE_FOROF_OF":case"AFTER_FOROF_FOR":case"BEFORE_FOROF_BODY":case"AFTER_FOR_FOR":case"BEFORE_FOR_TEST":case"BEFORE_FOR_UPDATE":case"BEFORE_FOR_BODY":case"BEFORE_FUNCTION_DECLARATION_BODY":case"BEFORE_FUNCTION_EXPRESSION_BODY":case"BEFORE_ARROW":case"AFTER_ARROW":case"BEFORE_ARROW_ASYNC_PARAMS":case"AFTER_GET":case"BEFORE_GET_BODY":case"AFTER_IF":case"AFTER_IF_TEST":case"BEFORE_ELSE":case"AFTER_ELSE":case"BEFORE_IMPORT_BINDINGS":case"BEFORE_IMPORT_MODULE":case"AFTER_IMPORT_BINDINGS":case"AFTER_FROM":case"BEFORE_IMPORT_NAMESPACE":case"BEFORE_IMPORT_STAR":case"AFTER_IMPORT_STAR":case"AFTER_NAMESPACE_BINDING":case"BEFORE_IMPORT_AS":case"AFTER_IMPORT_AS":case"EXPORTS_AFTER_COMMA":case"BEFORE_EXPORT_STAR":case"AFTER_EXPORT_STAR":case"BEFORE_EXPORT_BINDINGS":case"AFTER_EXPORT_FROM_BINDINGS":case"AFTER_EXPORT":case"AFTER_EXPORT_DEFAULT":case"BEFORE_EXPORT_AS":case"AFTER_EXPORT_AS":case"AFTER_LABEL_COLON":case"AFTER_METHOD_ASYNC":case"BEFORE_METHOD_BODY":case"AFTER_NEW":case"RETURN":case"AFTER_SET":case"BEFORE_SET_BODY":case"BEFORE_SET_PARAMS":case"BEFORE_CASE_TEST":case"BEFORE_SWITCH_DISCRIM":case"BEFORE_SWITCH_BODY":case"THROW":case"AFTER_TRY":case"BEFORE_CATCH":case"BEFORE_FINALLY":case"AFTER_FINALLY":case"VARIABLE_DECLARATION":case"YIELD":case"AFTER_YIELD_STAR":case"BEFORE_INIT_EQUALS":case"AFTER_INIT_EQUALS":case"AFTER_WHILE":case"BEFORE_WHILE_BODY":case"AFTER_WITH":case"BEFORE_WITH_BODY":case"BEFORE_FUNCTION_NAME":case"AFTER_BINOP":case"BEFORE_ASSIGN_OP":case"AFTER_ASSIGN_OP":return this.t(" ");case"AFTER_STATEMENT":switch(a.node.type){case"ForInStatement":case"ForOfStatement":case"ForStatement":case"WhileStatement":case"WithStatement":return empty$1();default:return new Linebreak}case"AFTER_CLASS_ELEMENT":case"BEFORE_CASE_BODY":case"AFTER_CASE_BODY":case"AFTER_DEFAULT_BODY":return new Linebreak;case"BEFORE_BINOP":return a.op===","?empty$1():this.t(" ");case"UNARY":return a.op==="delete"||a.op==="void"||a.op==="typeof"?this.t(" "):empty$1();default:return empty$1()}}}]),e}(ExtensibleCodeGen);var withLocation={},tokenStream={},unicode={};Object.defineProperty(unicode,"__esModule",{value:!0});unicode.whitespaceArray=[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];unicode.whitespaceBool=[!1,!1,!1,!1,!1,!1,!1,!1,!1,!0,!1,!0,!0,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!0,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1];unicode.idStartLargeRegex=/^[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]$/;unicode.idStartBool=[!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!0,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!1,!1,!1,!1,!0,!1,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!1,!1,!1,!1,!1];unicode.idContinueLargeRegex=/^[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA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u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE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9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uD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,!0,!0,!0,!0,!1,!1,!1,!1,!0,!1,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!1,!1,!1,!1,!1];Object.defineProperty(tokenStream,"__esModule",{value:!0});tokenStream.TokenStream=void 0;var _createClass$1=function(){function o(e,s){for(var a=0;a=1e3&&o%10===0?(e=o.toString(10),/[eE]/.test(e)?e.replace(/[eE]\+/,"e"):o.toString(10).replace(/0{3,}$/,function(s){return"e"+s.length})):o%1===0?o>1e15&&o<1e20?"0x"+o.toString(16).toUpperCase():o.toString(10).replace(/[eE]\+/,"e"):o.toString(10).replace(/^0\./,".").replace(/[eE]\+/,"e")}tokenStream.TokenStream=function(){function o(){_classCallCheck$1(this,o),this.result="",this.lastNumber=null,this.lastCodePoint=null,this.lastTokenStr="",this.optionalSemi=!1,this.previousWasRegExp=!1,this.partialHtmlComment=!1}return _createClass$1(o,[{key:"putNumber",value:function(s){var a=renderNumber(s);this.put(a),this.lastNumber=a}},{key:"putOptionalSemi",value:function(){this.optionalSemi=!0}},{key:"putRaw",value:function(s){this.result+=s,this.lastTokenStr=s}},{key:"put",value:function(s,a){if(this.optionalSemi&&(this.optionalSemi=!1,s!=="}"&&(this.result+=";",this.lastCodePoint=";",this.previousWasRegExp=!1)),this.lastNumber!==null&&s.length===1&&s==="."){this.result+=needsDoubleDot(this.lastNumber)?"..":".",this.lastNumber=null,this.lastCodePoint=".";return}var c=[].concat(_toConsumableArray(s)).length;if(c>0){this.lastNumber=null;var h=String.fromCodePoint(s.codePointAt(0)),d=this.lastCodePoint;this.lastCodePoint=String.fromCodePoint(s.codePointAt(c-1));var g=this.previousWasRegExp;this.previousWasRegExp=a,d&&((d==="+"||d==="-")&&d===h||isIdentifierPartES6(d)&&isIdentifierPartES6(h)||d==="/"&&h==="/"||g&&h==="i"||this.partialHtmlComment&&s.startsWith("--"))&&(this.result+=" ")}this.partialHtmlComment=this.lastTokenStr.endsWith("<")&&s==="!",this.result+=s,this.lastTokenStr=s}}]),o}();Object.defineProperty(withLocation,"__esModule",{value:!0});var _createClass=function(){function o(e,s){for(var a=0;a1?c-1:0),d=1;d1?c-1:0),d=1;d1?c-1:0),d=1;d1&&arguments[1]!==void 0?arguments[1]:new _minimalCodegen2.default,s=new TokenStreamWithLocation,a=(0,_shiftReducer.reduce)(addLocationToReducer(e),o);return a.emit(s),{source:s.result,locations:s.locations}}(function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.codeGenWithLocation=o.SemiOp=o.CommaSep=o.Semi=o.Seq=o.ContainsIn=o.NoIn=o.Brace=o.Bracket=o.Paren=o.NumberCodeRep=o.Token=o.Empty=o.CodeRep=o.escapeStringLiteral=o.getPrecedence=o.Precedence=o.Sep=o.FormattedCodeGen=o.ExtensibleCodeGen=o.MinimalCodeGen=void 0,o.default=$;var e=minimalCodegen;Object.defineProperty(o,"MinimalCodeGen",{enumerable:!0,get:function(){return b(e).default}});var s=formattedCodegen;Object.defineProperty(o,"ExtensibleCodeGen",{enumerable:!0,get:function(){return s.ExtensibleCodeGen}}),Object.defineProperty(o,"FormattedCodeGen",{enumerable:!0,get:function(){return s.FormattedCodeGen}}),Object.defineProperty(o,"Sep",{enumerable:!0,get:function(){return s.Sep}});var a=coderep;Object.defineProperty(o,"Precedence",{enumerable:!0,get:function(){return a.Precedence}}),Object.defineProperty(o,"getPrecedence",{enumerable:!0,get:function(){return a.getPrecedence}}),Object.defineProperty(o,"escapeStringLiteral",{enumerable:!0,get:function(){return a.escapeStringLiteral}}),Object.defineProperty(o,"CodeRep",{enumerable:!0,get:function(){return a.CodeRep}}),Object.defineProperty(o,"Empty",{enumerable:!0,get:function(){return a.Empty}}),Object.defineProperty(o,"Token",{enumerable:!0,get:function(){return a.Token}}),Object.defineProperty(o,"NumberCodeRep",{enumerable:!0,get:function(){return a.NumberCodeRep}}),Object.defineProperty(o,"Paren",{enumerable:!0,get:function(){return a.Paren}}),Object.defineProperty(o,"Bracket",{enumerable:!0,get:function(){return a.Bracket}}),Object.defineProperty(o,"Brace",{enumerable:!0,get:function(){return a.Brace}}),Object.defineProperty(o,"NoIn",{enumerable:!0,get:function(){return a.NoIn}}),Object.defineProperty(o,"ContainsIn",{enumerable:!0,get:function(){return a.ContainsIn}}),Object.defineProperty(o,"Seq",{enumerable:!0,get:function(){return a.Seq}}),Object.defineProperty(o,"Semi",{enumerable:!0,get:function(){return a.Semi}}),Object.defineProperty(o,"CommaSep",{enumerable:!0,get:function(){return a.CommaSep}}),Object.defineProperty(o,"SemiOp",{enumerable:!0,get:function(){return a.SemiOp}});var c=withLocation;Object.defineProperty(o,"codeGenWithLocation",{enumerable:!0,get:function(){return b(c).default}});var h=dist$4,d=b(h),g=tokenStream,_=b(e);function b(j){return j&&j.__esModule?j:{default:j}}function $(j){var _e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new _.default,et=new g.TokenStream,tt=(0,d.default)(_e,j);return tt.emit(et),et.result}})(dist);const shiftCodegen=getDefaultExportFromCjs(dist);function bjorklund(o,e){for(var s=[],a=[],c=[e],h=o-e,d=0,g=function(_){if(_==-1)s.push(0);else if(_==-2)s.push(1);else{for(var b=0;b1;)a.push(Math.floor(h/c[d])),c.push(h%c[d]),h=c[d],d++;return a.push(h),g(d),s.reverse()}var bjork=function(o,e){return o>e?bjorklund(o,e):bjorklund(e,o)};const euclid=(o,e,s=0)=>{const a=bjork(e,o);return s?rotate(a,-s):a};Pattern$3.prototype.euclid=function(o,e,s=0){return this.struct(euclid(o,e,s))};Pattern$3.prototype.euclidLegato=function(o,e,s=0){const a=euclid(o,e,s),c=a.indexOf(1),h=rotate(a,c).join("").split("1").slice(1).map(d=>[d.length+1,!0]);return this.struct(timeCat(...h)).late(fraction(c).div(e))};function steady(o){return new Pattern$3(e=>[new Hap(void 0,e.span,o)])}const signal=o=>{const e=s=>[new Hap(void 0,s.span,o(s.span.midpoint()))];return new Pattern$3(e)},isaw=signal(o=>1-o%1),isaw2=isaw._toBipolar(),saw=signal(o=>o%1),saw2=saw._toBipolar(),sine2=signal(o=>Math.sin(Math.PI*2*o)),sine=sine2._fromBipolar(),cosine=sine._early(fraction(1).div(4)),cosine2=sine2._early(fraction(1).div(4)),square=signal(o=>Math.floor(o*2%2)),square2=square._toBipolar(),tri=fastcat(isaw,saw),tri2=fastcat(isaw2,saw2),time=signal(id$1),xorwise=o=>{const e=o<<13^o,s=e>>17^e;return s<<5^s},_frac=o=>o-Math.trunc(o),timeToIntSeed=o=>xorwise(Math.trunc(_frac(o/300)*536870912)),intSeedToRand=o=>o%536870912/536870912,timeToRand=o=>Math.abs(intSeedToRand(timeToIntSeed(o))),rand=signal(timeToRand),rand2=rand._toBipolar(),_brandBy=o=>rand.fmap(e=>ereify$1(o).fmap(_brandBy).innerJoin(),brand=_brandBy(.5),_irand=o=>rand.fmap(e=>Math.trunc(e*o)),irand=o=>reify$1(o).fmap(_irand).innerJoin(),__chooseWith=(o,e)=>(e=e.map(reify$1),e.length==0?silence:o.range(0,e.length).fmap(s=>e[Math.floor(s)])),chooseWith=(o,e)=>__chooseWith(o,e).outerJoin(),chooseInWith=(o,e)=>__chooseWith(o,e).innerJoin(),choose=(...o)=>chooseWith(rand,o);Pattern$3.prototype.choose=function(...o){return chooseWith(this,o)};Pattern$3.prototype.choose2=function(...o){return chooseWith(this._fromBipolar(),o)};const chooseCycles=(...o)=>chooseInWith(rand.segment(1),o),randcat=chooseCycles,_wchooseWith=function(o,...e){const s=e.map(g=>reify$1(g[0])),a=[];let c=0;for(const g of e)c+=g[1],a.push(c);const h=c,d=function(g){const _=g*h;return s[a.findIndex(b=>b>_,a)]};return o.fmap(d)},wchooseWith=(...o)=>_wchooseWith(...o).outerJoin(),wchoose=(...o)=>wchooseWith(rand,...o),wchooseCycles=(...o)=>_wchooseWith(rand,...o).innerJoin(),perlinWith=o=>{const e=o.fmap(Math.floor),s=o.fmap(h=>Math.floor(h)+1),a=h=>6*h**5-15*h**4+10*h**3,c=h=>d=>g=>d+a(h)*(g-d);return o.sub(e).fmap(c).appBoth(e.fmap(timeToRand)).appBoth(s.fmap(timeToRand))},perlin=perlinWith(time);Pattern$3.prototype._degradeByWith=function(o,e){return this.fmap(s=>a=>s).appLeft(o._filterValues(s=>s>e))};Pattern$3.prototype._degradeBy=function(o){return this._degradeByWith(rand,o)};Pattern$3.prototype.degrade=function(){return this._degradeBy(.5)};Pattern$3.prototype._undegradeBy=function(o){return this._degradeByWith(rand.fmap(e=>1-e),o)};Pattern$3.prototype.undegrade=function(){return this._undegradeBy(.5)};Pattern$3.prototype._sometimesBy=function(o,e){return stack(this._degradeBy(o),e(this._undegradeBy(1-o)))};Pattern$3.prototype.sometimesBy=function(o,e){const s=this;return reify$1(o).fmap(a=>s._sometimesBy(a,e)).innerJoin()};Pattern$3.prototype._sometimesByPre=function(o,e){return stack(this._degradeBy(o),e(this).undegradeBy(1-o))};Pattern$3.prototype.sometimesByPre=function(o,e){const s=this;return reify$1(o).fmap(a=>s._sometimesByPre(a,e)).innerJoin()};Pattern$3.prototype.sometimes=function(o){return this._sometimesBy(.5,o)};Pattern$3.prototype.sometimesPre=function(o){return this._sometimesByPre(.5,o)};Pattern$3.prototype._someCyclesBy=function(o,e){return stack(this._degradeByWith(rand._segment(1),o),e(this._degradeByWith(rand.fmap(s=>1-s)._segment(1),1-o)))};Pattern$3.prototype.someCyclesBy=function(o,e){const s=this;return reify$1(o).fmap(a=>s._someCyclesBy(a,e)).innerJoin()};Pattern$3.prototype.someCycles=function(o){return this._someCyclesBy(.5,o)};Pattern$3.prototype.often=function(o){return this.sometimesBy(.75,o)};Pattern$3.prototype.rarely=function(o){return this.sometimesBy(.25,o)};Pattern$3.prototype.almostNever=function(o){return this.sometimesBy(.1,o)};Pattern$3.prototype.almostAlways=function(o){return this.sometimesBy(.9,o)};Pattern$3.prototype.never=function(o){return this};Pattern$3.prototype.always=function(o){return o(this)};Pattern$3.prototype.patternified.push("degradeBy","undegradeBy");let synth;try{synth=window==null?void 0:window.speechSynthesis}catch{console.warn("cannot use window: not in browser?")}let allVoices=synth==null?void 0:synth.getVoices();function speak(o,e,s){synth.cancel();const a=new SpeechSynthesisUtterance(o);a.lang=e,allVoices=synth.getVoices();const c=allVoices.filter(h=>h.lang.includes(e));typeof s=="number"?a.voice=c[s%c.length]:typeof s=="string"&&(a.voice=c.find(h=>h.name===h)),speechSynthesis.speak(a)}Pattern$3.prototype._speak=function(o,e){return this._withHap(s=>{const a=(c,h)=>{speak(h.value,o,e)};return s.setContext({...s.context,onTrigger:a})})};Pattern$3.prototype.speak=function(o,e){return patternify2(Pattern$3.prototype._speak)(reify(o),reify(e),this)};const stringifyFunction=o=>"("+o+")();",urlifyFunction=o=>URL.createObjectURL(new Blob([stringifyFunction(o)],{type:"text/javascript"})),createWorker=o=>new Worker(urlifyFunction(o));class ClockWorker{constructor(e,s){Rt(this,"worker");Rt(this,"interval",1/20);Rt(this,"tick",0);this.interval=s||this.interval,this.worker=createWorker(()=>{let a,c=null;const h=()=>{c&&(clearInterval(c),c=null)},d=()=>{if(h(),!a)throw new Error("no interval set! call worker.postMessage({interval}) before starting.");postMessage("tick"),c=setInterval(()=>postMessage("tick"),a*1e3)};self.onmessage=function(g){g.data=="start"?d():g.data.interval?(a=g.data.interval,c&&d()):g.data=="stop"&&h()}}),this.setInterval(this.interval),this.worker.onmessage=a=>{a.data==="tick"&&e(this.tick++,this.interval)}}start(){this.worker.postMessage("start")}stop(){this.worker.postMessage("stop"),this.tick=0}setInterval(e){this.worker.postMessage({interval:e})}}class Scheduler{constructor({interval:e,onTrigger:s,onError:a,latency:c=.2,getTime:h}){Rt(this,"worker");Rt(this,"pattern");Rt(this,"started",!1);Rt(this,"phase",0);Rt(this,"cps",1);Rt(this,"getTime");Rt(this,"lastTime");this.worker=new ClockWorker((d,g)=>{try{const _=h();if(!this.lastTime){this.lastTime=_;return}const b=_-this.lastTime;this.lastTime=_;const $=this.phase,j=this.phase+b*this.cps;this.phase=j,this.pattern.queryArc($,j).forEach(et=>{var it,at;if(typeof((it=et.value)==null?void 0:it.cps)=="number"&&this.setCps((at=et.value)==null?void 0:at.cps),!et.part.begin.equals(et.whole.begin))return;const tt=_+(et.whole.begin-$)/this.cps-b+g+c,nt=et.duration/this.cps,st=h(),rt=tt-st;if(tth.hasOnset());console.log(`${e.toFixed(4)} - ${s.toFixed(4)} ${Array(c.length).fill("I").join("")}`)}}const gist=(route,cache=!0)=>fetch(`https://gist.githubusercontent.com/${route}?cachebust=${cache?"":Date.now()}`).then(o=>o.text()).then(code=>eval(code));console.log("%c // \u{1F300} @strudel.cycles/core loaded \u{1F300}","background-color: black;color:white;padding:4px;border-radius:15px");globalThis._strudelLoaded&&console.warn(`@strudel.cycles/core was loaded more than once... This might happen when you have multiple versions of strudel installed. Please check with "npm ls @strudel.cycles/core".`);globalThis._strudelLoaded=!0;const strudel=Object.freeze(Object.defineProperty({__proto__:null,Fraction:fraction,gist,Hap,Pattern:Pattern$3,silence,pure,isPattern:isPattern$1,reify:reify$1,stack,slowcat,slowcatPrime,fastcat,cat,timeCat,sequence,seq:seq$2,polymeterSteps,polymeter,pm,polyrhythm,pr,add:add$1,chop,chunk,chunkBack,div,early,echo,every,fast,inv,invert,iter,iterBack,jux,juxBy,late,linger,mask,mul,off,ply,range,range2,rev,slow,struct,sub,superimpose,set,when,makeComposable,patternify2,patternify3,patternify4,steady,signal,isaw,isaw2,saw,saw2,sine2,sine,cosine,cosine2,square,square2,tri,tri2,time,rand,rand2,_brandBy,brandBy,brand,_irand,irand,__chooseWith,chooseWith,chooseInWith,choose,chooseCycles,randcat,wchoose,wchooseCycles,perlinWith,perlin,State,TimeSpan,isNote:isNote$1,tokenizeNote,toMidi,fromMidi,getFreq,midi2note,mod,getPlayableNoteValue,getFrequency,rotate,pipe,compose,removeUndefineds,flatten:flatten$1,id:id$1,constant,listRange,curry,ClockWorker,Scheduler},Symbol.toStringTag,{value:"Module"})),{replace}=estraverse,codegen=shiftCodegen.default||shiftCodegen,{Pattern:Pattern$2}=strudel,isNote=o=>/^[a-gC-G][bs]?[0-9]$/.test(o),shapeshifter=o=>{const{code:e,addReturn:s}=wrapAsync(o),a=dist$7.parseScriptWithLocation(disguiseImports(e)),c=[],h=[],d=replace(a.tree,{enter(_,b){var et,tt,nt;if(h.push(b),h.some(st=>c.includes(st)))return _;if(isBackTickString(_))return minifyWithLocation(_,_,a.locations,c);if(((et=_.directives)==null?void 0:et.length)===1&&!((tt=_.statements)!=null&&tt.length)){const st=new LiteralStringExpression_1({value:_.directives[0].rawValue}),rt=minifyWithLocation(st,_.directives[0],a.locations,c);return{..._,directives:[],statements:[rt]}}if(isStringWithDoubleQuotes(_,a.locations,e))return minifyWithLocation(_,_,a.locations,c);const j={"*":"fast","/":"slow","&":"stack","&&":"append"};if(_.type==="BinaryExpression"&&j[_.operator]&&["LiteralNumericExpression","LiteralStringExpression","IdentifierExpression"].includes((nt=_.right)==null?void 0:nt.type)&&canBeOverloaded(_.left)){let st=_.left;return _.left.type==="IdentifierExpression"&&(st=wrapFunction("reify",_.left)),new CallExpression_1({callee:new StaticMemberExpression_1({property:j[_.operator],object:wrapFunction("reify",st)}),arguments:[_.right]})}const _e=isPatternArg(h)||hasModifierCall(b);if(_.type==="CallExpression"&&_.callee.name==="pure"){const st=_.arguments[0];return reifyWithLocation(st,_.arguments[0],a.locations,c)}if(_.type==="IdentifierExpression"){if(isNote(_.name)){const st=_.name[1]==="s"?_.name.replace("s","#"):_.name;return _e?reifyWithLocation(new LiteralStringExpression_1({value:st}),_,a.locations,c):new LiteralStringExpression_1({value:st})}if(_.name==="r")return new IdentifierExpression_1({name:"silence"})}return["LiteralStringExpression"].includes(_.type)&&_e?reifyWithLocation(_,_,a.locations,c):addMiniNotationLocations(_,a.locations,c)},leave(){h.pop()}});return s(d),undisguiseImports(codegen(d))};function disguiseImports(o){return o.replaceAll("import","_mport")}function undisguiseImports(o){return o.replaceAll("_mport","import")}function wrapAsync(o){return o=`(async () => { ${o} })()`,{code:o,addReturn:s=>{const a=s.statements[0].expression.callee.body;a.statements=a.statements.slice(0,-1).concat([new ReturnStatement_1({expression:a.statements.slice(-1)[0]})])}}}function addMiniNotationLocations(o,e,s){const a=["mini","m"];if(o.type==="CallExpression"&&a.includes(o.callee.name)){if(o.arguments.length>1)return console.warn("multi arg mini locations not supported yet..."),o;const c=o.arguments[0];return minifyWithLocation(c,c,e,s)}return o.type==="StaticMemberExpression"&&a.includes(o.property)?minifyWithLocation(o.object,o,e,s):o}function wrapFunction(o,...e){return new CallExpression_1({callee:new IdentifierExpression_1({name:o}),arguments:e})}function isBackTickString(o){return o.type==="TemplateExpression"&&o.elements.length===1}function isStringWithDoubleQuotes(o,e,s){if(o.type!=="LiteralStringExpression")return!1;const a=e.get(o);return s.slice(a.start.offset,a.end.offset)[0]==='"'}function isPatternArg(o){if(!o.length)return!1;const e=o.slice(0,-1),s=o[o.length-1];return isPatternFactory(s)?!0:(s==null?void 0:s.type)==="ArrayExpression"?isPatternArg(e):!1}function hasModifierCall(o){return(o==null?void 0:o.type)==="StaticMemberExpression"&&Object.keys(Pattern$2.prototype.composable).includes(o.property)}const factories=Object.keys(Pattern$2.prototype.factories).concat(["mini"]);function isPatternFactory(o){return(o==null?void 0:o.type)==="CallExpression"&&factories.includes(o.callee.name)}function canBeOverloaded(o){return o.type==="IdentifierExpression"&&isNote(o.name)||isPatternFactory(o)}function reifyWithLocation(o,e,s,a){const c=getLocationArguments(e,s),h=new CallExpression_1({callee:new StaticMemberExpression_1({object:wrapFunction("reify",o),property:"withLocation"}),arguments:c});return a.push(h),h}function minifyWithLocation(o,e,s,a){const c=getLocationArguments(e,s),h=wrapFunction("mini",o),d=new CallExpression_1({callee:new StaticMemberExpression_1({object:h,property:"withMiniLocation"}),arguments:c});return a.push(d),d}function getLocationArguments(o,e){const s=e.get(o),a=-1;return[new ArrayExpression_1({elements:[new LiteralNumericExpression_1({value:s.start.line+a}),new LiteralNumericExpression_1({value:s.start.column}),new LiteralNumericExpression_1({value:s.start.offset})]}),new ArrayExpression_1({elements:[new LiteralNumericExpression_1({value:s.end.line+a}),new LiteralNumericExpression_1({value:s.end.column}),new LiteralNumericExpression_1({value:s.end.offset})]})]}const{isPattern,Pattern:Pattern$1}=strudel;let scoped=!1;const evalScope=async(...o)=>{scoped&&console.warn("@strudel.cycles/eval evalScope was called more than once."),scoped=!0;const e=await Promise.allSettled(o),s=e.filter(a=>a.status==="fulfilled").map(a=>a.value);e.forEach((a,c)=>{a.status==="rejected"&&console.warn(`evalScope: module with index ${c} could not be loaded:`,a.reason)}),Object.assign(globalThis,...s,Pattern$1.prototype.bootstrap())};function safeEval(o){return Function('"use strict";return ('+o+")")()}const evaluate=async o=>{scoped||await evalScope();const e=shapeshifter(o);let s=await safeEval(e);if(!isPattern(s)){console.log("evaluated",s);const a=`got "${typeof s}" instead of pattern`;throw new Error(a+(typeof s=="function"?", did you forget to call a function?":"."))}return{mode:"javascript",pattern:s}},bufferCache={},loadCache={},getCachedBuffer=o=>bufferCache[o],loadBuffer=(o,e)=>(loadCache[o]||(loadCache[o]=fetch(o).then(s=>s.arrayBuffer()).then(async s=>{const a=await e.decodeAudioData(s);return bufferCache[o]=a,a})),loadCache[o]),getLoadedBuffer=o=>bufferCache[o],githubCache={};let sampleCache={current:void 0};const loadGithubSamples=async(o,e)=>{const s="loadGithubSamples "+o,a=localStorage.getItem(s);if(a&&(console.log("[sampler]: loaded sample list from localstorage",o),githubCache[o]=JSON.parse(a)),githubCache[o])return sampleCache.current=githubCache[o],githubCache[o];console.log("[sampler]: fetching sample list from github",o);try{const[c,h,...d]=o.split("/"),g=`https://api.github.com/repos/${c}/${h}/contents`,_=await fetch(`${g}/${d.join("/")}`).then(b=>b.json());githubCache[o]=(await Promise.all(_.map(async({name:b,path:$})=>({name:b,content:await fetch(`${g}/${$}`).then(j=>j.json()).catch(j=>{console.error("could not load path",j)})})))).filter(({content:b})=>!!b).reduce((b,{name:$,content:j})=>({...b,[(e==null?void 0:e($))||$]:j.map(({download_url:_e})=>_e)}),{})}catch(c){console.error("[sampler]: failed to fetch sample list from github",c);return}return sampleCache.current=githubCache[o],localStorage.setItem(s,JSON.stringify(sampleCache.current)),console.log("[sampler]: loaded samples:",sampleCache.current),githubCache[o]},samples=(o,e=o._base||"")=>{sampleCache.current={...sampleCache.current,...Object.fromEntries(Object.entries(o).map(([s,a])=>{if(typeof a=="string"&&(a=[a]),typeof a!="object")throw new Error("wrong sample map format for "+s);e=a._base||e;const c=h=>(e+h).replace("github:","https://raw.githubusercontent.com/");return Array.isArray(a)?[s,a.map(c)]:[s,Object.fromEntries(Object.entries(a).map(([h,d])=>[h,(typeof d=="string"?[d]:d).map(c)]))]}))}},resetLoadedSamples=()=>{sampleCache.current=void 0},getLoadedSamples$1=()=>sampleCache.current,{Pattern}=strudel;let audioContext;const getAudioContext=()=>(audioContext||(audioContext=new AudioContext),audioContext);let destination;const getDestination=()=>{const o=getAudioContext();return destination||(destination=o.createGain(),destination.connect(o.destination)),destination},panic=()=>{getDestination().gain.linearRampToValueAtTime(0,getAudioContext().currentTime+.01),destination=null},getFilter=(o,e,s)=>{const a=getAudioContext().createBiquadFilter();return a.type=o,a.frequency.value=e,a.Q.value=s,a},getADSR=(o,e,s,a,c,h,d)=>{const g=getAudioContext().createGain();return g.gain.setValueAtTime(0,h),g.gain.linearRampToValueAtTime(c,h+o),g.gain.linearRampToValueAtTime(s*c,h+o+e),g.gain.setValueAtTime(s*c,d),g.gain.linearRampToValueAtTime(0,d+a),g},getOscillator=({s:o,freq:e,t:s,duration:a,release:c})=>{const h=getAudioContext().createOscillator();return h.type=o||"triangle",h.frequency.value=Number(e),h.start(s),h.stop(s+a+c),h},getSoundfontKey=o=>{var a,c,h,d;if(!globalThis.soundfontList)return!1;if((c=(a=globalThis.soundfontList)==null?void 0:a.instruments)!=null&&c.includes(o))return o;const e=(d=(h=globalThis.soundfontList)==null?void 0:h.instrumentNames)==null?void 0:d.indexOf(o),s=e<10?`00${e}`:e<100?`0${e}`:e;if(e!==-1)return globalThis.soundfontList.instruments.find(g=>g.startsWith(s))},getSampleBufferSource=async(o,e,s)=>{let a=0;s&&(a=toMidi(s)-36);const c=getAudioContext(),h=getLoadedSamples();if(!h)throw new Error("no samples loaded");const d=h==null?void 0:h[o];if(!d)throw new Error(`sample not found: "${o}", try one of ${Object.keys(h).join(", ")}`);if(typeof d!="object")throw new Error("wrong format for sample bank:",o);let g;if(Array.isArray(d))g=d[e%d.length];else{if(!s)throw new Error("no note(...) set for sound",o);const j=et=>toMidi(et)-toMidi(s),_e=Object.keys(d).filter(et=>!et.startsWith("_")).reduce((et,tt,nt)=>!et||Math.abs(j(tt)){if(!o.includes(":"))return[o,e];let[s,a]=o.split(":");return isNaN(Number(a))?[o,e]:[s,a]},webaudioOutput=async(o,e,s)=>{try{const a=getAudioContext();if(typeof o.value!="object")throw new Error(`hap.value ${o.value} is not supported by webaudio output. Hint: append .note() or .s() to the end`);const c=a.currentTime+e;let{freq:h,s:d,sf:g,clip:_=0,n:b=0,note:$,gain:j=1,cutoff:_e,resonance:et=1,hcutoff:tt,hresonance:nt=1,bandf:st,bandq:rt=1,pan:it,attack:at=.001,decay:ot=.05,sustain:ut=.5,release:ct=.001,speed:ht=1,begin:lt=0,end:pt=1}=o.value;const{velocity:ft=1}=o.context;j*=ft;const gt=[];if(typeof d=="string"&&([d,b]=splitSN(d,b)),typeof $=="string"&&([$,b]=splitSN($,b)),!d||["sine","square","triangle","sawtooth"].includes(d)){b=$||b,typeof b=="string"&&(b=toMidi(b)),!h&&typeof b=="number"&&(h=fromMidi(b));const mt=getOscillator({t:c,s:d,freq:h,duration:s,release:ct});gt.push(mt);const Et=a.createGain();Et.gain.value=.3,gt.push(Et);const Ot=getADSR(at,ot,ut,ct,1,c,c+s);gt.push(Ot)}else{if(ht===0)return;if(!d){console.warn("no sample specified");return}const mt=getSoundfontKey(d);let Et;try{mt?Et=await globalThis.getFontBufferSource(mt,$||b,a):Et=await getSampleBufferSource(d,b,$)}catch(At){console.warn(At);return}if(a.currentTime>c){console.warn("sample still loading:",d,b);return}if(!Et){console.warn("no buffer source");return}Et.playbackRate.value=Math.abs(ht)*Et.playbackRate.value;let Ot=mt||_?s:Et.buffer.duration;const St=lt*Ot;if(Ot=(pt-lt)*Ot/Math.abs(ht),mt||_?Et.start(c,St):Et.start(c,St,Ot),gt.push(Et),mt||_){const At=a.createGain(),dt=.1;At.gain.value=.6,At.gain.setValueAtTime(At.gain.value,c+Ot),At.gain.linearRampToValueAtTime(0,c+Ot+dt),gt.push(At),Et.stop(c+Ot+dt)}else Et.stop(c+Ot)}const yt=a.createGain();if(yt.gain.value=j,gt.push(yt),_e!==void 0&>.push(getFilter("lowpass",_e,et)),tt!==void 0&>.push(getFilter("highpass",tt,nt)),st!==void 0&>.push(getFilter("bandpass",st,rt)),it!==void 0){const mt=a.createStereoPanner();mt.pan.value=2*it-1,gt.push(mt)}gt.push(getDestination()),gt.slice(1).reduce((mt,Et)=>mt.connect(Et),gt[0])}catch(a){console.warn(".out error:",a)}};Pattern.prototype.out=function(){return this.onTrigger((o,e,s,a)=>webaudioOutput(e,o-s,e.duration/a))};function _extends(){return _extends=Object.assign?Object.assign.bind():function(o){for(var e=1;e=0)&&(s[c]=o[c]);return s}class Text{constructor(){}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,s,a){let c=[];return this.decompose(0,e,c,2),a.length&&a.decompose(0,a.length,c,3),this.decompose(s,this.length,c,1),TextNode.from(c,this.length-(s-e)+a.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,s=this.length){let a=[];return this.decompose(e,s,a,0),TextNode.from(a,s-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let s=this.scanIdentical(e,1),a=this.length-this.scanIdentical(e,-1),c=new RawTextCursor(this),h=new RawTextCursor(e);for(let d=s,g=s;;){if(c.next(d),h.next(d),d=0,c.lineBreak!=h.lineBreak||c.done!=h.done||c.value!=h.value)return!1;if(g+=c.value.length,c.done||g>=a)return!0}}iter(e=1){return new RawTextCursor(this,e)}iterRange(e,s=this.length){return new PartialTextCursor(this,e,s)}iterLines(e,s){let a;if(e==null)a=this.iter();else{s==null&&(s=this.lines+1);let c=this.line(e).from;a=this.iterRange(c,Math.max(c,s==this.lines+1?this.length:s<=1?0:this.line(s-1).to))}return new LineCursor(a)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?Text.empty:e.length<=32?new TextLeaf(e):TextNode.from(TextLeaf.split(e,[]))}}class TextLeaf extends Text{constructor(e,s=textLength(e)){super(),this.text=e,this.length=s}get lines(){return this.text.length}get children(){return null}lineInner(e,s,a,c){for(let h=0;;h++){let d=this.text[h],g=c+d.length;if((s?a:g)>=e)return new Line(c,g,a,d);c=g+1,a++}}decompose(e,s,a,c){let h=e<=0&&s>=this.length?this:new TextLeaf(sliceText(this.text,e,s),Math.min(s,this.length)-Math.max(0,e));if(c&1){let d=a.pop(),g=appendText(h.text,d.text.slice(),0,h.length);if(g.length<=32)a.push(new TextLeaf(g,d.length+h.length));else{let _=g.length>>1;a.push(new TextLeaf(g.slice(0,_)),new TextLeaf(g.slice(_)))}}else a.push(h)}replace(e,s,a){if(!(a instanceof TextLeaf))return super.replace(e,s,a);let c=appendText(this.text,appendText(a.text,sliceText(this.text,0,e)),s),h=this.length+a.length-(s-e);return c.length<=32?new TextLeaf(c,h):TextNode.from(TextLeaf.split(c,[]),h)}sliceString(e,s=this.length,a=` `){let c="";for(let h=0,d=0;h<=s&&de&&d&&(c+=a),e<_&&s>h&&(c+=g.slice(Math.max(0,e-h),s-h)),h=_+1}return c}flatten(e){for(let s of this.text)e.push(s)}scanIdentical(){return 0}static split(e,s){let a=[],c=-1;for(let h of e)a.push(h),c+=h.length+1,a.length==32&&(s.push(new TextLeaf(a,c)),a=[],c=-1);return c>-1&&s.push(new TextLeaf(a,c)),s}}class TextNode extends Text{constructor(e,s){super(),this.children=e,this.length=s,this.lines=0;for(let a of e)this.lines+=a.lines}lineInner(e,s,a,c){for(let h=0;;h++){let d=this.children[h],g=c+d.length,_=a+d.lines-1;if((s?_:g)>=e)return d.lineInner(e,s,a,c);c=g+1,a=_+1}}decompose(e,s,a,c){for(let h=0,d=0;d<=s&&h=d){let b=c&((d<=e?1:0)|(_>=s?2:0));d>=e&&_<=s&&!b?a.push(g):g.decompose(e-d,s-d,a,b)}d=_+1}}replace(e,s,a){if(a.lines=h&&s<=g){let _=d.replace(e-h,s-h,a),b=this.lines-d.lines+_.lines;if(_.lines>5-1&&_.lines>b>>5+1){let $=this.children.slice();return $[c]=_,new TextNode($,this.length-(s-e)+a.length)}return super.replace(h,g,_)}h=g+1}return super.replace(e,s,a)}sliceString(e,s=this.length,a=` `){let c="";for(let h=0,d=0;he&&h&&(c+=a),e<_&&s>d&&(c+=g.sliceString(e-d,s-d,a)),d=_+1}return c}flatten(e){for(let s of this.children)s.flatten(e)}scanIdentical(e,s){if(!(e instanceof TextNode))return 0;let a=0,[c,h,d,g]=s>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;c+=s,h+=s){if(c==d||h==g)return a;let _=this.children[c],b=e.children[h];if(_!=b)return a+_.scanIdentical(b,s);a+=_.length+1}}static from(e,s=e.reduce((a,c)=>a+c.length+1,-1)){let a=0;for(let et of e)a+=et.lines;if(a<32){let et=[];for(let tt of e)tt.flatten(et);return new TextLeaf(et,s)}let c=Math.max(32,a>>5),h=c<<1,d=c>>1,g=[],_=0,b=-1,$=[];function j(et){let tt;if(et.lines>h&&et instanceof TextNode)for(let nt of et.children)j(nt);else et.lines>d&&(_>d||!_)?(_e(),g.push(et)):et instanceof TextLeaf&&_&&(tt=$[$.length-1])instanceof TextLeaf&&et.lines+tt.lines<=32?(_+=et.lines,b+=et.length+1,$[$.length-1]=new TextLeaf(tt.text.concat(et.text),tt.length+1+et.length)):(_+et.lines>c&&_e(),_+=et.lines,b+=et.length+1,$.push(et))}function _e(){_!=0&&(g.push($.length==1?$[0]:TextNode.from($,b)),b=-1,_=$.length=0)}for(let et of e)j(et);return _e(),g.length==1?g[0]:new TextNode(g,s)}}Text.empty=new TextLeaf([""],0);function textLength(o){let e=-1;for(let s of o)e+=s.length+1;return e}function appendText(o,e,s=0,a=1e9){for(let c=0,h=0,d=!0;h=s&&(_>a&&(g=g.slice(0,a-c)),c0?1:(e instanceof TextLeaf?e.text.length:e.children.length)<<1]}nextInner(e,s){for(this.done=this.lineBreak=!1;;){let a=this.nodes.length-1,c=this.nodes[a],h=this.offsets[a],d=h>>1,g=c instanceof TextLeaf?c.text.length:c.children.length;if(d==(s>0?g:0)){if(a==0)return this.done=!0,this.value="",this;s>0&&this.offsets[a-1]++,this.nodes.pop(),this.offsets.pop()}else if((h&1)==(s>0?0:1)){if(this.offsets[a]+=s,e==0)return this.lineBreak=!0,this.value=` `,this;e--}else if(c instanceof TextLeaf){let _=c.text[d+(s<0?-1:0)];if(this.offsets[a]+=s,_.length>Math.max(0,e))return this.value=e==0?_:s>0?_.slice(e):_.slice(0,_.length-e),this;e-=_.length}else{let _=c.children[d+(s<0?-1:0)];e>_.length?(e-=_.length,this.offsets[a]+=s):(s<0&&this.offsets[a]--,this.nodes.push(_),this.offsets.push(s>0?1:(_ instanceof TextLeaf?_.text.length:_.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class PartialTextCursor{constructor(e,s,a){this.value="",this.done=!1,this.cursor=new RawTextCursor(e,s>a?-1:1),this.pos=s>a?e.length:0,this.from=Math.min(s,a),this.to=Math.max(s,a)}nextInner(e,s){if(s<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,s<0?this.pos-this.to:this.from-this.pos);let a=s<0?this.pos-this.from:this.to-this.pos;e>a&&(e=a),a-=e;let{value:c}=this.cursor.next(e);return this.pos+=(c.length+e)*s,this.value=c.length<=a?c:s<0?c.slice(c.length-a):c.slice(0,a),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 LineCursor{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:s,lineBreak:a,value:c}=this.inner.next(e);return s?(this.done=!0,this.value=""):a?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=c,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(Text.prototype[Symbol.iterator]=function(){return this.iter()},RawTextCursor.prototype[Symbol.iterator]=PartialTextCursor.prototype[Symbol.iterator]=LineCursor.prototype[Symbol.iterator]=function(){return this});class Line{constructor(e,s,a,c){this.from=e,this.to=s,this.number=a,this.text=c}get length(){return this.to-this.from}}let extend="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(o=>o?parseInt(o,36):1);for(let o=1;oo)return extend[e-1]<=o;return!1}function isRegionalIndicator(o){return o>=127462&&o<=127487}const ZWJ=8205;function findClusterBreak(o,e,s=!0,a=!0){return(s?nextClusterBreak:prevClusterBreak)(o,e,a)}function nextClusterBreak(o,e,s){if(e==o.length)return e;e&&surrogateLow(o.charCodeAt(e))&&surrogateHigh(o.charCodeAt(e-1))&&e--;let a=codePointAt(o,e);for(e+=codePointSize(a);e=0&&isRegionalIndicator(codePointAt(o,d));)h++,d-=2;if(h%2==0)break;e+=2}else break}return e}function prevClusterBreak(o,e,s){for(;e>0;){let a=nextClusterBreak(o,e-2,s);if(a=56320&&o<57344}function surrogateHigh(o){return o>=55296&&o<56320}function codePointAt(o,e){let s=o.charCodeAt(e);if(!surrogateHigh(s)||e+1==o.length)return s;let a=o.charCodeAt(e+1);return surrogateLow(a)?(s-55296<<10)+(a-56320)+65536:s}function fromCodePoint(o){return o<=65535?String.fromCharCode(o):(o-=65536,String.fromCharCode((o>>10)+55296,(o&1023)+56320))}function codePointSize(o){return o<65536?1:2}const DefaultSplit=/\r\n?|\n/;var MapMode=function(o){return o[o.Simple=0]="Simple",o[o.TrackDel=1]="TrackDel",o[o.TrackBefore=2]="TrackBefore",o[o.TrackAfter=3]="TrackAfter",o}(MapMode||(MapMode={}));class ChangeDesc{constructor(e){this.sections=e}get length(){let e=0;for(let s=0;se)return h+(e-c);h+=g}else{if(a!=MapMode.Simple&&b>=e&&(a==MapMode.TrackDel&&ce||a==MapMode.TrackBefore&&ce))return null;if(b>e||b==e&&s<0&&!g)return e==c||s<0?h:h+_;h+=_}c=b}if(e>c)throw new RangeError(`Position ${e} is out of range for changeset of length ${c}`);return h}touchesRange(e,s=e){for(let a=0,c=0;a=0&&c<=s&&g>=e)return cs?"cover":!0;c=g}return!1}toString(){let e="";for(let s=0;s=0?":"+c:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(s=>typeof s!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new ChangeDesc(e)}static create(e){return new ChangeDesc(e)}}class ChangeSet extends ChangeDesc{constructor(e,s){super(e),this.inserted=s}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return iterChanges(this,(s,a,c,h,d)=>e=e.replace(c,c+(a-s),d),!1),e}mapDesc(e,s=!1){return mapSet(this,e,s,!0)}invert(e){let s=this.sections.slice(),a=[];for(let c=0,h=0;c=0){s[c]=g,s[c+1]=d;let _=c>>1;for(;a.length<_;)a.push(Text.empty);a.push(d?e.slice(h,h+d):Text.empty)}h+=d}return new ChangeSet(s,a)}compose(e){return this.empty?e:e.empty?this:composeSets(this,e,!0)}map(e,s=!1){return e.empty?this:mapSet(this,e,s,!0)}iterChanges(e,s=!1){iterChanges(this,e,s)}get desc(){return ChangeDesc.create(this.sections)}filter(e){let s=[],a=[],c=[],h=new SectionIter(this);e:for(let d=0,g=0;;){let _=d==e.length?1e9:e[d++];for(;g<_||g==_&&h.len==0;){if(h.done)break e;let $=Math.min(h.len,_-g);addSection(c,$,-1);let j=h.ins==-1?-1:h.off==0?h.ins:0;addSection(s,$,j),j>0&&addInsert(a,s,h.text),h.forward($),g+=$}let b=e[d++];for(;g>1].toJSON()))}return e}static of(e,s,a){let c=[],h=[],d=0,g=null;function _($=!1){if(!$&&!c.length)return;d_e||j<0||_e>s)throw new RangeError(`Invalid change range ${j} to ${_e} (in doc of length ${s})`);let tt=et?typeof et=="string"?Text.of(et.split(a||DefaultSplit)):et:Text.empty,nt=tt.length;if(j==_e&&nt==0)return;jd&&addSection(c,j-d,-1),addSection(c,_e-j,nt),addInsert(h,c,tt),d=_e}}return b(e),_(!g),g}static empty(e){return new ChangeSet(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let s=[],a=[];for(let c=0;cg&&typeof d!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(h.length==1)s.push(h[0],0);else{for(;a.length=0&&s<=0&&s==o[c+1]?o[c]+=e:e==0&&o[c]==0?o[c+1]+=s:a?(o[c]+=e,o[c+1]+=s):o.push(e,s)}function addInsert(o,e,s){if(s.length==0)return;let a=e.length-2>>1;if(a>1])),!(s||d==o.sections.length||o.sections[d+1]<0);)g=o.sections[d++],_=o.sections[d++];e(c,b,h,$,j),c=b,h=$}}}function mapSet(o,e,s,a=!1){let c=[],h=a?[]:null,d=new SectionIter(o),g=new SectionIter(e);for(let _=-1;;)if(d.ins==-1&&g.ins==-1){let b=Math.min(d.len,g.len);addSection(c,b,-1),d.forward(b),g.forward(b)}else if(g.ins>=0&&(d.ins<0||_==d.i||d.off==0&&(g.len=0&&_=0){let b=0,$=d.len;for(;$;)if(g.ins==-1){let j=Math.min($,g.len);b+=j,$-=j,g.forward(j)}else if(g.ins==0&&g.len<$)$-=g.len,g.next();else break;addSection(c,b,__||d.ins>=0&&d.len>_)&&(g||a.length>b),h.forward2(_),d.forward(_)}}}}class SectionIter{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return s>=e.length?Text.empty:e[s]}textBit(e){let{inserted:s}=this.set,a=this.i-2>>1;return a>=s.length&&!e?Text.empty:s[a].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 SelectionRange{constructor(e,s,a){this.from=e,this.to=s,this.flags=a}get anchor(){return this.flags&16?this.to:this.from}get head(){return this.flags&16?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&4?-1:this.flags&8?1:0}get bidiLevel(){let e=this.flags&3;return e==3?null:e}get goalColumn(){let e=this.flags>>5;return e==33554431?void 0:e}map(e,s=-1){let a,c;return this.empty?a=c=e.mapPos(this.from,s):(a=e.mapPos(this.from,1),c=e.mapPos(this.to,-1)),a==this.from&&c==this.to?this:new SelectionRange(a,c,this.flags)}extend(e,s=e){if(e<=this.anchor&&s>=this.anchor)return EditorSelection.range(e,s);let a=Math.abs(e-this.anchor)>Math.abs(s-this.anchor)?e:s;return EditorSelection.range(this.anchor,a)}eq(e){return this.anchor==e.anchor&&this.head==e.head}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 EditorSelection.range(e.anchor,e.head)}static create(e,s,a){return new SelectionRange(e,s,a)}}class EditorSelection{constructor(e,s){this.ranges=e,this.mainIndex=s}map(e,s=-1){return e.empty?this:EditorSelection.create(this.ranges.map(a=>a.map(e,s)),this.mainIndex)}eq(e){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let s=0;se.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 EditorSelection(e.ranges.map(s=>SelectionRange.fromJSON(s)),e.main)}static single(e,s=e){return new EditorSelection([EditorSelection.range(e,s)],0)}static create(e,s=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let a=0,c=0;ce?4:0))}static normalized(e,s=0){let a=e[s];e.sort((c,h)=>c.from-h.from),s=e.indexOf(a);for(let c=1;ch.head?EditorSelection.range(_,g):EditorSelection.range(g,_))}}return new EditorSelection(e,s)}}function checkSelection(o,e){for(let s of o.ranges)if(s.to>e)throw new RangeError("Selection points outside of document")}let nextID=0;class Facet{constructor(e,s,a,c,h){this.combine=e,this.compareInput=s,this.compare=a,this.isStatic=c,this.id=nextID++,this.default=e([]),this.extensions=typeof h=="function"?h(this):h}static define(e={}){return new Facet(e.combine||(s=>s),e.compareInput||((s,a)=>s===a),e.compare||(e.combine?(s,a)=>s===a:sameArray$1),!!e.static,e.enables)}of(e){return new FacetProvider([],this,0,e)}compute(e,s){if(this.isStatic)throw new Error("Can't compute a static facet");return new FacetProvider(e,this,1,s)}computeN(e,s){if(this.isStatic)throw new Error("Can't compute a static facet");return new FacetProvider(e,this,2,s)}from(e,s){return s||(s=a=>a),this.compute([e],a=>s(a.field(e)))}}function sameArray$1(o,e){return o==e||o.length==e.length&&o.every((s,a)=>s===e[a])}class FacetProvider{constructor(e,s,a,c){this.dependencies=e,this.facet=s,this.type=a,this.value=c,this.id=nextID++}dynamicSlot(e){var s;let a=this.value,c=this.facet.compareInput,h=this.id,d=e[h]>>1,g=this.type==2,_=!1,b=!1,$=[];for(let j of this.dependencies)j=="doc"?_=!0:j=="selection"?b=!0:(((s=e[j.id])!==null&&s!==void 0?s:1)&1)==0&&$.push(e[j.id]);return{create(j){return j.values[d]=a(j),1},update(j,_e){if(_&&_e.docChanged||b&&(_e.docChanged||_e.selection)||ensureAll(j,$)){let et=a(j);if(g?!compareArray(et,j.values[d],c):!c(et,j.values[d]))return j.values[d]=et,1}return 0},reconfigure:(j,_e)=>{let et=a(j),tt=_e.config.address[h];if(tt!=null){let nt=getAddr(_e,tt);if(this.dependencies.every(st=>st instanceof Facet?_e.facet(st)===j.facet(st):st instanceof StateField?_e.field(st,!1)==j.field(st,!1):!0)||(g?compareArray(et,nt,c):c(et,nt)))return j.values[d]=nt,0}return j.values[d]=et,1}}}}function compareArray(o,e,s){if(o.length!=e.length)return!1;for(let a=0;ao[_.id]),c=s.map(_=>_.type),h=a.filter(_=>!(_&1)),d=o[e.id]>>1;function g(_){let b=[];for(let $=0;$a===c),e);return e.provide&&(s.provides=e.provide(s)),s}create(e){let s=e.facet(initField).find(a=>a.field==this);return((s==null?void 0:s.create)||this.createF)(e)}slot(e){let s=e[this.id]>>1;return{create:a=>(a.values[s]=this.create(a),1),update:(a,c)=>{let h=a.values[s],d=this.updateF(h,c);return this.compareF(h,d)?0:(a.values[s]=d,1)},reconfigure:(a,c)=>c.config.address[this.id]!=null?(a.values[s]=c.field(this),0):(a.values[s]=this.create(a),1)}}init(e){return[this,initField.of({field:this,create:e})]}get extension(){return this}}const Prec_={lowest:4,low:3,default:2,high:1,highest:0};function prec(o){return e=>new PrecExtension(e,o)}const Prec={highest:prec(Prec_.highest),high:prec(Prec_.high),default:prec(Prec_.default),low:prec(Prec_.low),lowest:prec(Prec_.lowest)};class PrecExtension{constructor(e,s){this.inner=e,this.prec=s}}class Compartment{of(e){return new CompartmentInstance(this,e)}reconfigure(e){return Compartment.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class CompartmentInstance{constructor(e,s){this.compartment=e,this.inner=s}}class Configuration{constructor(e,s,a,c,h,d){for(this.base=e,this.compartments=s,this.dynamicSlots=a,this.address=c,this.staticValues=h,this.facets=d,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,s,a){let c=[],h=Object.create(null),d=new Map;for(let _e of flatten(e,s,d))_e instanceof StateField?c.push(_e):(h[_e.facet.id]||(h[_e.facet.id]=[])).push(_e);let g=Object.create(null),_=[],b=[];for(let _e of c)g[_e.id]=b.length<<1,b.push(et=>_e.slot(et));let $=a==null?void 0:a.config.facets;for(let _e in h){let et=h[_e],tt=et[0].facet,nt=$&&$[_e]||[];if(et.every(st=>st.type==0))if(g[tt.id]=_.length<<1|1,sameArray$1(nt,et))_.push(a.facet(tt));else{let st=tt.combine(et.map(rt=>rt.value));_.push(a&&tt.compare(st,a.facet(tt))?a.facet(tt):st)}else{for(let st of et)st.type==0?(g[st.id]=_.length<<1|1,_.push(st.value)):(g[st.id]=b.length<<1,b.push(rt=>st.dynamicSlot(rt)));g[tt.id]=b.length<<1,b.push(st=>dynamicFacetSlot(st,tt,et))}}let j=b.map(_e=>_e(g));return new Configuration(e,d,j,g,_,h)}}function flatten(o,e,s){let a=[[],[],[],[],[]],c=new Map;function h(d,g){let _=c.get(d);if(_!=null){if(_<=g)return;let b=a[_].indexOf(d);b>-1&&a[_].splice(b,1),d instanceof CompartmentInstance&&s.delete(d.compartment)}if(c.set(d,g),Array.isArray(d))for(let b of d)h(b,g);else if(d instanceof CompartmentInstance){if(s.has(d.compartment))throw new RangeError("Duplicate use of compartment in extensions");let b=e.get(d.compartment)||d.inner;s.set(d.compartment,b),h(b,g)}else if(d instanceof PrecExtension)h(d.inner,d.prec);else if(d instanceof StateField)a[g].push(d),d.provides&&h(d.provides,g);else if(d instanceof FacetProvider)a[g].push(d),d.facet.extensions&&h(d.facet.extensions,Prec_.default);else{let b=d.extension;if(!b)throw new Error(`Unrecognized extension value in extension set (${d}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);h(b,g)}}return h(o,Prec_.default),a.reduce((d,g)=>d.concat(g))}function ensureAddr(o,e){if(e&1)return 2;let s=e>>1,a=o.status[s];if(a==4)throw new Error("Cyclic dependency between fields and/or facets");if(a&2)return a;o.status[s]=4;let c=o.computeSlot(o,o.config.dynamicSlots[s]);return o.status[s]=2|c}function getAddr(o,e){return e&1?o.config.staticValues[e>>1]:o.values[e>>1]}const languageData=Facet.define(),allowMultipleSelections=Facet.define({combine:o=>o.some(e=>e),static:!0}),lineSeparator=Facet.define({combine:o=>o.length?o[0]:void 0,static:!0}),changeFilter=Facet.define(),transactionFilter=Facet.define(),transactionExtender=Facet.define(),readOnly=Facet.define({combine:o=>o.length?o[0]:!1});class Annotation{constructor(e,s){this.type=e,this.value=s}static define(){return new AnnotationType}}class AnnotationType{of(e){return new Annotation(this,e)}}class StateEffectType{constructor(e){this.map=e}of(e){return new StateEffect(this,e)}}class StateEffect{constructor(e,s){this.type=e,this.value=s}map(e){let s=this.type.map(this.value,e);return s===void 0?void 0:s==this.value?this:new StateEffect(this.type,s)}is(e){return this.type==e}static define(e={}){return new StateEffectType(e.map||(s=>s))}static mapEffects(e,s){if(!e.length)return e;let a=[];for(let c of e){let h=c.map(s);h&&a.push(h)}return a}}StateEffect.reconfigure=StateEffect.define();StateEffect.appendConfig=StateEffect.define();class Transaction{constructor(e,s,a,c,h,d){this.startState=e,this.changes=s,this.selection=a,this.effects=c,this.annotations=h,this.scrollIntoView=d,this._doc=null,this._state=null,a&&checkSelection(a,s.newLength),h.some(g=>g.type==Transaction.time)||(this.annotations=h.concat(Transaction.time.of(Date.now())))}static create(e,s,a,c,h,d){return new Transaction(e,s,a,c,h,d)}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 s of this.annotations)if(s.type==e)return s.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let s=this.annotation(Transaction.userEvent);return!!(s&&(s==e||s.length>e.length&&s.slice(0,e.length)==e&&s[e.length]=="."))}}Transaction.time=Annotation.define();Transaction.userEvent=Annotation.define();Transaction.addToHistory=Annotation.define();Transaction.remote=Annotation.define();function joinRanges(o,e){let s=[];for(let a=0,c=0;;){let h,d;if(a=o[a]))h=o[a++],d=o[a++];else if(c=0;c--){let h=a[c](o);h instanceof Transaction?o=h:Array.isArray(h)&&h.length==1&&h[0]instanceof Transaction?o=h[0]:o=resolveTransaction(e,asArray$1(h),!1)}return o}function extendTransaction(o){let e=o.startState,s=e.facet(transactionExtender),a=o;for(let c=s.length-1;c>=0;c--){let h=s[c](o);h&&Object.keys(h).length&&(a=mergeTransaction(o,resolveTransactionInner(e,h,o.changes.newLength),!0))}return a==o?o:Transaction.create(e,o.changes,o.selection,a.effects,a.annotations,a.scrollIntoView)}const none$2=[];function asArray$1(o){return o==null?none$2:Array.isArray(o)?o:[o]}var CharCategory=function(o){return o[o.Word=0]="Word",o[o.Space=1]="Space",o[o.Other=2]="Other",o}(CharCategory||(CharCategory={}));const nonASCIISingleCaseWordChar=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let wordChar;try{wordChar=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(o){}function hasWordChar(o){if(wordChar)return wordChar.test(o);for(let e=0;e"\x80"&&(s.toUpperCase()!=s.toLowerCase()||nonASCIISingleCaseWordChar.test(s)))return!0}return!1}function makeCategorizer(o){return e=>{if(!/\S/.test(e))return CharCategory.Space;if(hasWordChar(e))return CharCategory.Word;for(let s=0;s-1)return CharCategory.Word;return CharCategory.Other}}class EditorState{constructor(e,s,a,c,h,d){this.config=e,this.doc=s,this.selection=a,this.values=c,this.status=e.statusTemplate.slice(),this.computeSlot=h,d&&(d._state=this);for(let g=0;gc.set(_,g)),s=null),c.set(d.value.compartment,d.value.extension)):d.is(StateEffect.reconfigure)?(s=null,a=d.value):d.is(StateEffect.appendConfig)&&(s=null,a=asArray$1(a).concat(d.value));let h;s?h=e.startState.values.slice():(s=Configuration.resolve(a,c,this),h=new EditorState(s,this.doc,this.selection,s.dynamicSlots.map(()=>null),(g,_)=>_.reconfigure(g,this),null).values),new EditorState(s,e.newDoc,e.newSelection,h,(d,g)=>g.update(d,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(s=>({changes:{from:s.from,to:s.to,insert:e},range:EditorSelection.cursor(s.from+e.length)}))}changeByRange(e){let s=this.selection,a=e(s.ranges[0]),c=this.changes(a.changes),h=[a.range],d=asArray$1(a.effects);for(let g=1;gd.spec.fromJSON(g,_)))}}return EditorState.create({doc:e.doc,selection:EditorSelection.fromJSON(e.selection),extensions:s.extensions?c.concat([s.extensions]):c})}static create(e={}){let s=Configuration.resolve(e.extensions||[],new Map),a=e.doc instanceof Text?e.doc:Text.of((e.doc||"").split(s.staticFacet(EditorState.lineSeparator)||DefaultSplit)),c=e.selection?e.selection instanceof EditorSelection?e.selection:EditorSelection.single(e.selection.anchor,e.selection.head):EditorSelection.single(0);return checkSelection(c,a.length),s.staticFacet(allowMultipleSelections)||(c=c.asSingle()),new EditorState(s,a,c,s.dynamicSlots.map(()=>null),(h,d)=>d.create(h),null)}get tabSize(){return this.facet(EditorState.tabSize)}get lineBreak(){return this.facet(EditorState.lineSeparator)||` `}get readOnly(){return this.facet(readOnly)}phrase(e,...s){for(let a of this.facet(EditorState.phrases))if(Object.prototype.hasOwnProperty.call(a,e)){e=a[e];break}return s.length&&(e=e.replace(/\$(\$|\d*)/g,(a,c)=>{if(c=="$")return"$";let h=+(c||1);return!h||h>s.length?a:s[h-1]})),e}languageDataAt(e,s,a=-1){let c=[];for(let h of this.facet(languageData))for(let d of h(this,s,a))Object.prototype.hasOwnProperty.call(d,e)&&c.push(d[e]);return c}charCategorizer(e){return makeCategorizer(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:s,from:a,length:c}=this.doc.lineAt(e),h=this.charCategorizer(e),d=e-a,g=e-a;for(;d>0;){let _=findClusterBreak(s,d,!1);if(h(s.slice(_,d))!=CharCategory.Word)break;d=_}for(;go.length?o[0]:4});EditorState.lineSeparator=lineSeparator;EditorState.readOnly=readOnly;EditorState.phrases=Facet.define({compare(o,e){let s=Object.keys(o),a=Object.keys(e);return s.length==a.length&&s.every(c=>o[c]==e[c])}});EditorState.languageData=languageData;EditorState.changeFilter=changeFilter;EditorState.transactionFilter=transactionFilter;EditorState.transactionExtender=transactionExtender;Compartment.reconfigure=StateEffect.define();function combineConfig(o,e,s={}){let a={};for(let c of o)for(let h of Object.keys(c)){let d=c[h],g=a[h];if(g===void 0)a[h]=d;else if(!(g===d||d===void 0))if(Object.hasOwnProperty.call(s,h))a[h]=s[h](g,d);else throw new Error("Config merge conflict for field "+h)}for(let c in e)a[c]===void 0&&(a[c]=e[c]);return a}class RangeValue{eq(e){return this==e}range(e,s=e){return Range$1.create(e,s,this)}}RangeValue.prototype.startSide=RangeValue.prototype.endSide=0;RangeValue.prototype.point=!1;RangeValue.prototype.mapMode=MapMode.TrackDel;class Range$1{constructor(e,s,a){this.from=e,this.to=s,this.value=a}static create(e,s,a){return new Range$1(e,s,a)}}function cmpRange(o,e){return o.from-e.from||o.value.startSide-e.value.startSide}class Chunk{constructor(e,s,a,c){this.from=e,this.to=s,this.value=a,this.maxPoint=c}get length(){return this.to[this.to.length-1]}findIndex(e,s,a,c=0){let h=a?this.to:this.from;for(let d=c,g=h.length;;){if(d==g)return d;let _=d+g>>1,b=h[_]-e||(a?this.value[_].endSide:this.value[_].startSide)-s;if(_==d)return b>=0?d:g;b>=0?g=_:d=_+1}}between(e,s,a,c){for(let h=this.findIndex(s,-1e9,!0),d=this.findIndex(a,1e9,!1,h);het||_e==et&&b.startSide>0&&b.endSide<=0)continue;(et-_e||b.endSide-b.startSide)<0||(d<0&&(d=_e),b.point&&(g=Math.max(g,et-_e)),a.push(b),c.push(_e-d),h.push(et-d))}return{mapped:a.length?new Chunk(c,h,a,g):null,pos:d}}}class RangeSet{constructor(e,s,a,c){this.chunkPos=e,this.chunk=s,this.nextLayer=a,this.maxPoint=c}static create(e,s,a,c){return new RangeSet(e,s,a,c)}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 s of this.chunk)e+=s.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:s=[],sort:a=!1,filterFrom:c=0,filterTo:h=this.length}=e,d=e.filter;if(s.length==0&&!d)return this;if(a&&(s=s.slice().sort(cmpRange)),this.isEmpty)return s.length?RangeSet.of(s):this;let g=new LayerCursor(this,null,-1).goto(0),_=0,b=[],$=new RangeSetBuilder;for(;g.value||_=0){let j=s[_++];$.addInner(j.from,j.to,j.value)||b.push(j)}else g.rangeIndex==1&&g.chunkIndexthis.chunkEnd(g.chunkIndex)||hg.to||h=h&&e<=h+d.length&&d.between(h,e-h,s-h,a)===!1)return}this.nextLayer.between(e,s,a)}}iter(e=0){return HeapCursor.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,s=0){return HeapCursor.from(e).goto(s)}static compare(e,s,a,c,h=-1){let d=e.filter(j=>j.maxPoint>0||!j.isEmpty&&j.maxPoint>=h),g=s.filter(j=>j.maxPoint>0||!j.isEmpty&&j.maxPoint>=h),_=findSharedChunks(d,g,a),b=new SpanCursor(d,_,h),$=new SpanCursor(g,_,h);a.iterGaps((j,_e,et)=>compare(b,j,$,_e,et,c)),a.empty&&a.length==0&&compare(b,0,$,0,0,c)}static eq(e,s,a=0,c){c==null&&(c=1e9);let h=e.filter($=>!$.isEmpty&&s.indexOf($)<0),d=s.filter($=>!$.isEmpty&&e.indexOf($)<0);if(h.length!=d.length)return!1;if(!h.length)return!0;let g=findSharedChunks(h,d),_=new SpanCursor(h,g,0).goto(a),b=new SpanCursor(d,g,0).goto(a);for(;;){if(_.to!=b.to||!sameValues(_.active,b.active)||_.point&&(!b.point||!_.point.eq(b.point)))return!1;if(_.to>c)return!0;_.next(),b.next()}}static spans(e,s,a,c,h=-1){let d=new SpanCursor(e,null,h).goto(s),g=s,_=d.openStart;for(;;){let b=Math.min(d.to,a);if(d.point?(c.point(g,b,d.point,d.activeForPoint(d.to),_,d.pointRank),_=d.openEnd(b)+(d.to>b?1:0)):b>g&&(c.span(g,b,d.active,_),_=d.openEnd(b)),d.to>a)break;g=d.to,d.next()}return _}static of(e,s=!1){let a=new RangeSetBuilder;for(let c of e instanceof Range$1?[e]:s?lazySort(e):e)a.add(c.from,c.to,c.value);return a.finish()}}RangeSet.empty=new RangeSet([],[],null,-1);function lazySort(o){if(o.length>1)for(let e=o[0],s=1;s0)return o.slice().sort(cmpRange);e=a}return o}RangeSet.empty.nextLayer=RangeSet.empty;class RangeSetBuilder{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}finishChunk(e){this.chunks.push(new Chunk(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=[])}add(e,s,a){this.addInner(e,s,a)||(this.nextLayer||(this.nextLayer=new RangeSetBuilder)).add(e,s,a)}addInner(e,s,a){let c=e-this.lastTo||a.startSide-this.last.endSide;if(c<=0&&(e-this.lastFrom||a.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return c<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(s-this.chunkStart),this.last=a,this.lastFrom=e,this.lastTo=s,this.value.push(a),a.point&&(this.maxPoint=Math.max(this.maxPoint,s-e)),!0)}addChunk(e,s){if((e-this.lastTo||s.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,s.maxPoint),this.chunks.push(s),this.chunkPos.push(e);let a=s.value.length-1;return this.last=s.value[a],this.lastFrom=s.from[a]+e,this.lastTo=s.to[a]+e,!0}finish(){return this.finishInner(RangeSet.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let s=RangeSet.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,s}}function findSharedChunks(o,e,s){let a=new Map;for(let h of o)for(let d=0;d=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=a&&c.push(new LayerCursor(d,s,a,h));return c.length==1?c[0]:new HeapCursor(c)}get startSide(){return this.value?this.value.startSide:0}goto(e,s=-1e9){for(let a of this.heap)a.goto(e,s);for(let a=this.heap.length>>1;a>=0;a--)heapBubble(this.heap,a);return this.next(),this}forward(e,s){for(let a of this.heap)a.forward(e,s);for(let a=this.heap.length>>1;a>=0;a--)heapBubble(this.heap,a);(this.to-e||this.value.endSide-s)<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(),heapBubble(this.heap,0)}}}function heapBubble(o,e){for(let s=o[e];;){let a=(e<<1)+1;if(a>=o.length)break;let c=o[a];if(a+1=0&&(c=o[a+1],a++),s.compare(c)<0)break;o[a]=s,o[e]=c,e=a}}class SpanCursor{constructor(e,s,a){this.minPoint=a,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=HeapCursor.from(e,s,a)}goto(e,s=-1e9){return this.cursor.goto(e,s),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=s,this.openStart=-1,this.next(),this}forward(e,s){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-s)<0;)this.removeActive(this.minActive);this.cursor.forward(e,s)}removeActive(e){remove(this.active,e),remove(this.activeTo,e),remove(this.activeRank,e),this.minActive=findMinIndex(this.active,this.activeTo)}addActive(e){let s=0,{value:a,to:c,rank:h}=this.cursor;for(;s-1&&(this.activeTo[h]-this.cursor.from||this.active[h].endSide-this.cursor.startSide)<0){if(this.activeTo[h]>e){this.to=this.activeTo[h],this.endSide=this.active[h].endSide;break}this.removeActive(h),a&&remove(a,h)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let d=this.cursor.value;if(!d.point)this.addActive(a),this.cursor.frome&&c++,this.cursor.next();else if(s&&this.cursor.to==this.to&&this.cursor.from=0&&!(this.activeRank[a]e||this.activeTo[a]==e&&this.active[a].endSide>=this.point.endSide)&&s.push(this.active[a]);return s.reverse()}openEnd(e){let s=0;for(let a=this.activeTo.length-1;a>=0&&this.activeTo[a]>e;a--)s++;return s}}function compare(o,e,s,a,c,h){o.goto(e),s.goto(a);let d=a+c,g=a,_=a-e;for(;;){let b=o.to+_-s.to||o.endSide-s.endSide,$=b<0?o.to+_:s.to,j=Math.min($,d);if(o.point||s.point?o.point&&s.point&&(o.point==s.point||o.point.eq(s.point))&&sameValues(o.activeForPoint(o.to+_),s.activeForPoint(s.to))||h.comparePoint(g,j,o.point,s.point):j>g&&!sameValues(o.active,s.active)&&h.compareRange(g,j,o.active,s.active),$>d)break;g=$,b<=0&&o.next(),b>=0&&s.next()}}function sameValues(o,e){if(o.length!=e.length)return!1;for(let s=0;s=e;a--)o[a+1]=o[a];o[e]=s}function findMinIndex(o,e){let s=-1,a=1e9;for(let c=0;c=e)return c;if(c==o.length)break;h+=o.charCodeAt(c)==9?s-h%s:1,c=findClusterBreak(o,c)}return a===!0?-1:o.length}const C="\u037C",COUNT=typeof Symbol>"u"?"__"+C:Symbol.for(C),SET=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),top=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class StyleModule{constructor(e,s){this.rules=[];let{finish:a}=s||{};function c(d){return/^@/.test(d)?[d]:d.split(/,\s*/)}function h(d,g,_,b){let $=[],j=/^@(\w+)\b/.exec(d[0]),_e=j&&j[1]=="keyframes";if(j&&g==null)return _.push(d[0]+";");for(let et in g){let tt=g[et];if(/&/.test(et))h(et.split(/,\s*/).map(nt=>d.map(st=>nt.replace(/&/,st))).reduce((nt,st)=>nt.concat(st)),tt,_);else if(tt&&typeof tt=="object"){if(!j)throw new RangeError("The value of a property ("+et+") should be a primitive value.");h(c(et),tt,$,_e)}else tt!=null&&$.push(et.replace(/_.*/,"").replace(/[A-Z]/g,nt=>"-"+nt.toLowerCase())+": "+tt+";")}($.length||_e)&&_.push((a&&!j&&!b?d.map(a):d).join(", ")+" {"+$.join(" ")+"}")}for(let d in e)h(c(d),e[d],this.rules)}getRules(){return this.rules.join(` `)}static newName(){let e=top[COUNT]||1;return top[COUNT]=e+1,C+e.toString(36)}static mount(e,s){(e[SET]||new StyleSet(e)).mount(Array.isArray(s)?s:[s])}}let adoptedSet=null;class StyleSet{constructor(e){if(!e.head&&e.adoptedStyleSheets&&typeof CSSStyleSheet<"u"){if(adoptedSet)return e.adoptedStyleSheets=[adoptedSet.sheet].concat(e.adoptedStyleSheets),e[SET]=adoptedSet;this.sheet=new CSSStyleSheet,e.adoptedStyleSheets=[this.sheet].concat(e.adoptedStyleSheets),adoptedSet=this}else{this.styleTag=(e.ownerDocument||e).createElement("style");let s=e.head||e;s.insertBefore(this.styleTag,s.firstChild)}this.modules=[],e[SET]=this}mount(e){let s=this.sheet,a=0,c=0;for(let h=0;h-1&&(this.modules.splice(g,1),c--,g=-1),g==-1){if(this.modules.splice(c++,0,d),s)for(let _=0;_",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"',229:"Q"},chrome$1=typeof navigator<"u"&&/Chrome\/(\d+)/.exec(navigator.userAgent),safari$1=typeof navigator<"u"&&/Apple Computer/.test(navigator.vendor),gecko$1=typeof navigator<"u"&&/Gecko\/\d+/.test(navigator.userAgent),mac=typeof navigator<"u"&&/Mac/.test(navigator.platform),ie$1=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),brokenModifierNames=chrome$1&&(mac||+chrome$1[1]<57)||gecko$1&&mac;for(var i=0;i<10;i++)base[48+i]=base[96+i]=String(i);for(var i=1;i<=24;i++)base[i+111]="F"+i;for(var i=65;i<=90;i++)base[i]=String.fromCharCode(i+32),shift[i]=String.fromCharCode(i);for(var code in base)shift.hasOwnProperty(code)||(shift[code]=base[code]);function keyName(o){var e=brokenModifierNames&&(o.ctrlKey||o.altKey||o.metaKey)||(safari$1||ie$1)&&o.shiftKey&&o.key&&o.key.length==1,s=!e&&o.key||(o.shiftKey?shift:base)[o.keyCode]||o.key||"Unidentified";return s=="Esc"&&(s="Escape"),s=="Del"&&(s="Delete"),s=="Left"&&(s="ArrowLeft"),s=="Up"&&(s="ArrowUp"),s=="Right"&&(s="ArrowRight"),s=="Down"&&(s="ArrowDown"),s}function getSelection(o){let e;return o.nodeType==11?e=o.getSelection?o:o.ownerDocument:e=o,e.getSelection()}function contains(o,e){return e?o==e||o.contains(e.nodeType!=1?e.parentNode:e):!1}function deepActiveElement(){let o=document.activeElement;for(;o&&o.shadowRoot;)o=o.shadowRoot.activeElement;return o}function hasSelection(o,e){if(!e.anchorNode)return!1;try{return contains(o,e.anchorNode)}catch{return!1}}function clientRectsFor(o){return o.nodeType==3?textRange(o,0,o.nodeValue.length).getClientRects():o.nodeType==1?o.getClientRects():[]}function isEquivalentPosition(o,e,s,a){return s?scanFor(o,e,s,a,-1)||scanFor(o,e,s,a,1):!1}function domIndex(o){for(var e=0;;e++)if(o=o.previousSibling,!o)return e}function scanFor(o,e,s,a,c){for(;;){if(o==s&&e==a)return!0;if(e==(c<0?0:maxOffset(o))){if(o.nodeName=="DIV")return!1;let h=o.parentNode;if(!h||h.nodeType!=1)return!1;e=domIndex(o)+(c<0?0:1),o=h}else if(o.nodeType==1){if(o=o.childNodes[e+(c<0?-1:0)],o.nodeType==1&&o.contentEditable=="false")return!1;e=c<0?maxOffset(o):0}else return!1}}function maxOffset(o){return o.nodeType==3?o.nodeValue.length:o.childNodes.length}const Rect0={left:0,right:0,top:0,bottom:0};function flattenRect(o,e){let s=e?o.left:o.right;return{left:s,right:s,top:o.top,bottom:o.bottom}}function windowRect(o){return{left:0,right:o.innerWidth,top:0,bottom:o.innerHeight}}function scrollRectIntoView(o,e,s,a,c,h,d,g){let _=o.ownerDocument,b=_.defaultView;for(let $=o;$;)if($.nodeType==1){let j,_e=$==_.body;if(_e)j=windowRect(b);else{if($.scrollHeight<=$.clientHeight&&$.scrollWidth<=$.clientWidth){$=$.parentNode;continue}let nt=$.getBoundingClientRect();j={left:nt.left,right:nt.left+$.clientWidth,top:nt.top,bottom:nt.top+$.clientHeight}}let et=0,tt=0;if(c=="nearest")e.top0&&e.bottom>j.bottom+tt&&(tt=e.bottom-j.bottom+tt+d)):e.bottom>j.bottom&&(tt=e.bottom-j.bottom+d,s<0&&e.top-tt0&&e.right>j.right+et&&(et=e.right-j.right+et+h)):e.right>j.right&&(et=e.right-j.right+h,s<0&&e.lefts)return j.domBoundsAround(e,s,b);if(_e>=e&&c==-1&&(c=_,h=b),b>s&&j.dom.parentNode==this.dom){d=_,g=$;break}$=_e,b=_e+j.breakAfter}return{from:h,to:g<0?a+this.length:g,startDOM:(c?this.children[c-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:d=0?this.children[d].dom:null}}markDirty(e=!1){this.dirty|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let s=this.parent;s;s=s.parent){if(e&&(s.dirty|=2),s.dirty&1)return;s.dirty|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.dirty&&this.markParentsDirty(!0))}setDOM(e){this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this}get rootView(){for(let e=this;;){let s=e.parent;if(!s)return e;e=s}}replaceChildren(e,s,a=noChildren){this.markDirty();for(let c=e;cthis.pos||e==this.pos&&(s>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let a=this.children[--this.i];this.pos-=a.length+a.breakAfter}}}function replaceRange(o,e,s,a,c,h,d,g,_){let{children:b}=o,$=b.length?b[e]:null,j=h.length?h[h.length-1]:null,_e=j?j.breakAfter:d;if(!(e==a&&$&&!d&&!_e&&h.length<2&&$.merge(s,c,h.length?j:null,s==0,g,_))){if(a0&&(!d&&h.length&&$.merge(s,$.length,h[0],!1,g,0)?$.breakAfter=h.shift().breakAfter:(s<$.length||$.children.length&&$.children[$.children.length-1].length==0)&&$.merge(s,$.length,null,!1,g,0),e++));e2);var browser={mac:ios||/Mac/.test(nav.platform),windows:/Win/.test(nav.platform),linux:/Linux|X11/.test(nav.platform),ie,ie_version:ie_upto10?doc.documentMode||6:ie_11up?+ie_11up[1]:ie_edge?+ie_edge[1]:0,gecko,gecko_version:gecko?+(/Firefox\/(\d+)/.exec(nav.userAgent)||[0,0])[1]:0,chrome:!!chrome,chrome_version:chrome?+chrome[1]:0,ios,android:/Android\b/.test(nav.userAgent),webkit,safari,webkit_version:webkit?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:doc.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const MaxJoinLen=256;class TextView extends ContentView{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){e.nodeType==3&&this.createDOM(e)}merge(e,s,a){return a&&(!(a instanceof TextView)||this.length-(s-e)+a.length>MaxJoinLen)?!1:(this.text=this.text.slice(0,e)+(a?a.text:"")+this.text.slice(s),this.markDirty(),!0)}split(e){let s=new TextView(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),s}localPosFromDOM(e,s){return e==this.dom?s:s?this.text.length:0}domAtPos(e){return new DOMPos(this.dom,e)}domBoundsAround(e,s,a){return{from:a,to:a+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,s){return textCoords(this.dom,e,s)}}class MarkView extends ContentView{constructor(e,s=[],a=0){super(),this.mark=e,this.children=s,this.length=a;for(let c of s)c.setParent(this)}setAttrs(e){if(clearAttributes(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let s in this.mark.attrs)e.setAttribute(s,this.mark.attrs[s]);return e}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.dirty|=6)}sync(e){this.dom?this.dirty&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e)}merge(e,s,a,c,h,d){return a&&(!(a instanceof MarkView&&a.mark.eq(this.mark))||e&&h<=0||se&&s.push(a=e&&(c=h),a=_,h++}let d=this.length-e;return this.length=e,c>-1&&(this.children.length=c,this.markDirty()),new MarkView(this.mark,s,d)}domAtPos(e){return inlineDOMAtPos(this.dom,this.children,e)}coordsAt(e,s){return coordsInChildren(this,e,s)}}function textCoords(o,e,s){let a=o.nodeValue.length;e>a&&(e=a);let c=e,h=e,d=0;e==0&&s<0||e==a&&s>=0?browser.chrome||browser.gecko||(e?(c--,d=1):h=0)?0:g.length-1];return browser.safari&&!d&&_.width==0&&(_=Array.prototype.find.call(g,b=>b.width)||_),d?flattenRect(_,d<0):_||null}class WidgetView extends ContentView{constructor(e,s,a){super(),this.widget=e,this.length=s,this.side=a,this.prevWidget=null}static create(e,s,a){return new(e.customView||WidgetView)(e,s,a)}split(e){let s=WidgetView.create(this.widget,this.length-e,this.side);return this.length-=e,s}sync(){(!this.dom||!this.widget.updateDOM(this.dom))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(this.editorView)),this.dom.contentEditable="false")}getSide(){return this.side}merge(e,s,a,c,h,d){return a&&(!(a instanceof WidgetView)||!this.widget.compare(a.widget)||e>0&&h<=0||s0?a.length-1:0;c=a[h],!(e>0?h==0:h==a.length-1||c.top0?-1:1);return e==0&&s>0||e==this.length&&s<=0?c:flattenRect(c,e==0)}get isEditable(){return!1}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}}class CompositionView extends WidgetView{domAtPos(e){let{topView:s,text:a}=this.widget;return s?scanCompositionTree(e,0,s,a,(c,h)=>c.domAtPos(h),c=>new DOMPos(a,Math.min(c,a.nodeValue.length))):new DOMPos(a,Math.min(e,a.nodeValue.length))}sync(){this.setDOM(this.widget.toDOM())}localPosFromDOM(e,s){let{topView:a,text:c}=this.widget;return a?posFromDOMInCompositionTree(e,s,a,c):Math.min(s,this.length)}ignoreMutation(){return!1}get overrideDOMText(){return null}coordsAt(e,s){let{topView:a,text:c}=this.widget;return a?scanCompositionTree(e,s,a,c,(h,d,g)=>h.coordsAt(d,g),(h,d)=>textCoords(c,h,d)):textCoords(c,e,s)}destroy(){var e;super.destroy(),(e=this.widget.topView)===null||e===void 0||e.destroy()}get isEditable(){return!0}}function scanCompositionTree(o,e,s,a,c,h){if(s instanceof MarkView){for(let d of s.children){let g=contains(d.dom,a),_=g?a.nodeValue.length:d.length;if(o<_||o==_&&d.getSide()<=0)return g?scanCompositionTree(o,e,d,a,c,h):c(d,o,e);o-=_}return c(s,s.length,-1)}else return s.dom==a?h(o,e):c(s,o,e)}function posFromDOMInCompositionTree(o,e,s,a){if(s instanceof MarkView)for(let c of s.children){let h=0,d=contains(c.dom,a);if(contains(c.dom,o))return h+(d?posFromDOMInCompositionTree(o,e,c,a):c.localPosFromDOM(o,e));h+=d?a.nodeValue.length:c.length}else if(s.dom==a)return Math.min(e,a.nodeValue.length);return s.localPosFromDOM(o,e)}class WidgetBufferView extends ContentView{constructor(e){super(),this.side=e}get length(){return 0}merge(){return!1}become(e){return e instanceof WidgetBufferView&&e.side==this.side}split(){return new WidgetBufferView(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 DOMPos.before(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){let s=this.dom.getBoundingClientRect(),a=inlineSiblingRect(this,this.side>0?-1:1);return a&&a.tops.top?{left:s.left,right:s.right,top:a.top,bottom:a.bottom}:s}get overrideDOMText(){return Text.empty}}TextView.prototype.children=WidgetView.prototype.children=WidgetBufferView.prototype.children=noChildren;function inlineSiblingRect(o,e){let s=o.parent,a=s?s.children.indexOf(o):-1;for(;s&&a>=0;)if(e<0?a>0:ac&&s0;a--){let c=e[a-1].dom;if(c.parentNode==o)return DOMPos.after(c)}return new DOMPos(o,0)}function joinInlineInto(o,e,s){let a,{children:c}=o;s>0&&e instanceof MarkView&&c.length&&(a=c[c.length-1])instanceof MarkView&&a.mark.eq(e.mark)?joinInlineInto(a,e.children[0],s-1):(c.push(e),e.setParent(o)),o.length+=e.length}function coordsInChildren(o,e,s){for(let h=0,d=0;d0?_>=e:_>e)&&(e<_||d+1==o.children.length||(b=o.children[d+1]).length||b.getSide()>0)){let $=0;if(_==h){if(g.getSide()<=0)continue;$=s=-g.getSide()}let j=g.coordsAt(Math.max(0,e-h),s);return $&&j?flattenRect(j,s<0):j}h=_}let a=o.dom.lastChild;if(!a)return o.dom.getBoundingClientRect();let c=clientRectsFor(a);return c[c.length-1]||null}function combineAttrs(o,e){for(let s in o)s=="class"&&e.class?e.class+=" "+o.class:s=="style"&&e.style?e.style+=";"+o.style:e[s]=o[s];return e}function attrsEq(o,e){if(o==e)return!0;if(!o||!e)return!1;let s=Object.keys(o),a=Object.keys(e);if(s.length!=a.length)return!1;for(let c of s)if(a.indexOf(c)==-1||o[c]!==e[c])return!1;return!0}function updateAttrs(o,e,s){let a=null;if(e)for(let c in e)s&&c in s||o.removeAttribute(a=c);if(s)for(let c in s)e&&e[c]==s[c]||o.setAttribute(a=c,s[c]);return!!a}class WidgetType{eq(e){return!1}updateDOM(e){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}ignoreEvent(e){return!0}get customView(){return null}destroy(e){}}var BlockType=function(o){return o[o.Text=0]="Text",o[o.WidgetBefore=1]="WidgetBefore",o[o.WidgetAfter=2]="WidgetAfter",o[o.WidgetRange=3]="WidgetRange",o}(BlockType||(BlockType={}));class Decoration extends RangeValue{constructor(e,s,a,c){super(),this.startSide=e,this.endSide=s,this.widget=a,this.spec=c}get heightRelevant(){return!1}static mark(e){return new MarkDecoration(e)}static widget(e){let s=e.side||0,a=!!e.block;return s+=a?s>0?3e8:-4e8:s>0?1e8:-1e8,new PointDecoration(e,s,s,a,e.widget||null,!1)}static replace(e){let s=!!e.block,a,c;if(e.isBlockGap)a=-5e8,c=4e8;else{let{start:h,end:d}=getInclusive(e,s);a=(h?s?-3e8:-1:5e8)-1,c=(d?s?2e8:1:-6e8)+1}return new PointDecoration(e,a,c,s,e.widget||null,!0)}static line(e){return new LineDecoration(e)}static set(e,s=!1){return RangeSet.of(e,s)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}Decoration.none=RangeSet.empty;class MarkDecoration extends Decoration{constructor(e){let{start:s,end:a}=getInclusive(e);super(s?-1:5e8,a?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){return this==e||e instanceof MarkDecoration&&this.tagName==e.tagName&&this.class==e.class&&attrsEq(this.attrs,e.attrs)}range(e,s=e){if(e>=s)throw new RangeError("Mark decorations may not be empty");return super.range(e,s)}}MarkDecoration.prototype.point=!1;class LineDecoration extends Decoration{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof LineDecoration&&attrsEq(this.spec.attributes,e.spec.attributes)}range(e,s=e){if(s!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,s)}}LineDecoration.prototype.mapMode=MapMode.TrackBefore;LineDecoration.prototype.point=!0;class PointDecoration extends Decoration{constructor(e,s,a,c,h,d){super(s,a,h,e),this.block=c,this.isReplace=d,this.mapMode=c?s<=0?MapMode.TrackBefore:MapMode.TrackAfter:MapMode.TrackDel}get type(){return this.startSide=5}eq(e){return e instanceof PointDecoration&&widgetsEq(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,s=e){if(this.isReplace&&(e>s||e==s&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&s!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,s)}}PointDecoration.prototype.point=!0;function getInclusive(o,e=!1){let{inclusiveStart:s,inclusiveEnd:a}=o;return s==null&&(s=o.inclusive),a==null&&(a=o.inclusive),{start:s!=null?s:e,end:a!=null?a:e}}function widgetsEq(o,e){return o==e||!!(o&&e&&o.compare(e))}function addRange(o,e,s,a=0){let c=s.length-1;c>=0&&s[c]+a>=o?s[c]=Math.max(s[c],e):s.push(o,e)}class LineView extends ContentView{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,s,a,c,h,d){if(a){if(!(a instanceof LineView))return!1;this.dom||a.transferDOM(this)}return c&&this.setDeco(a?a.attrs:null),mergeChildrenInto(this,e,s,a?a.children:[],h,d),!0}split(e){let s=new LineView;if(s.breakAfter=this.breakAfter,this.length==0)return s;let{i:a,off:c}=this.childPos(e);c&&(s.append(this.children[a].split(c),0),this.children[a].merge(c,this.children[a].length,null,!1,0,0),a++);for(let h=a;h0&&this.children[a-1].length==0;)this.children[--a].destroy();return this.children.length=a,this.markDirty(),this.length=e,s}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){attrsEq(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,s){joinInlineInto(this,e,s)}addLineDeco(e){let s=e.spec.attributes,a=e.spec.class;s&&(this.attrs=combineAttrs(s,this.attrs||{})),a&&(this.attrs=combineAttrs({class:a},this.attrs||{}))}domAtPos(e){return inlineDOMAtPos(this.dom,this.children,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.dirty|=6)}sync(e){var s;this.dom?this.dirty&4&&(clearAttributes(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&&(updateAttrs(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e);let a=this.dom.lastChild;for(;a&&ContentView.get(a)instanceof MarkView;)a=a.lastChild;if(!a||!this.length||a.nodeName!="BR"&&((s=ContentView.get(a))===null||s===void 0?void 0:s.isEditable)==!1&&(!browser.ios||!this.children.some(c=>c instanceof TextView))){let c=document.createElement("BR");c.cmIgnore=!0,this.dom.appendChild(c)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0;for(let s of this.children){if(!(s instanceof TextView)||/[^ -~]/.test(s.text))return null;let a=clientRectsFor(s.dom);if(a.length!=1)return null;e+=a[0].width}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length}:null}coordsAt(e,s){return coordsInChildren(this,e,s)}become(e){return!1}get type(){return BlockType.Text}static find(e,s){for(let a=0,c=0;a=s){if(h instanceof LineView)return h;if(d>s)break}c=d+h.breakAfter}return null}}class BlockWidgetView extends ContentView{constructor(e,s,a){super(),this.widget=e,this.length=s,this.type=a,this.breakAfter=0,this.prevWidget=null}merge(e,s,a,c,h,d){return a&&(!(a instanceof BlockWidgetView)||!this.widget.compare(a.widget)||e>0&&h<=0||s0;){if(this.textOff==this.text.length){let{value:h,lineBreak:d,done:g}=this.cursor.next(this.skip);if(this.skip=0,g)throw new Error("Ran out of text content when drawing inline views");if(d){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer([]),this.curLine=null,e--;continue}else this.text=h,this.textOff=0}let c=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(s.slice(0,a)),this.getLine().append(wrapMarks(new TextView(this.text.slice(this.textOff,this.textOff+c)),s),a),this.atCursorPos=!0,this.textOff+=c,e-=c,a=0}}span(e,s,a,c){this.buildText(s-e,a,c),this.pos=s,this.openStart<0&&(this.openStart=c)}point(e,s,a,c,h,d){if(this.disallowBlockEffectsFor[d]&&a instanceof PointDecoration){if(a.block)throw new RangeError("Block decorations may not be specified via plugins");if(s>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let g=s-e;if(a instanceof PointDecoration)if(a.block){let{type:_}=a;_==BlockType.WidgetAfter&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new BlockWidgetView(a.widget||new NullWidget("div"),g,_))}else{let _=WidgetView.create(a.widget||new NullWidget("span"),g,a.startSide),b=this.atCursorPos&&!_.isEditable&&h<=c.length&&(e0),$=!_.isEditable&&(eo.some(e=>e)});class ScrollTarget{constructor(e,s="nearest",a="nearest",c=5,h=5){this.range=e,this.y=s,this.x=a,this.yMargin=c,this.xMargin=h}map(e){return e.empty?this:new ScrollTarget(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin)}}const scrollIntoView$1=StateEffect.define({map:(o,e)=>o.map(e)});function logException(o,e,s){let a=o.facet(exceptionSink);a.length?a[0](e):window.onerror?window.onerror(String(e),s,void 0,void 0,e):s?console.error(s+":",e):console.error(e)}const editable=Facet.define({combine:o=>o.length?o[0]:!0});let nextPluginID=0;const viewPlugin=Facet.define();class ViewPlugin{constructor(e,s,a,c){this.id=e,this.create=s,this.domEventHandlers=a,this.extension=c(this)}static define(e,s){const{eventHandlers:a,provide:c,decorations:h}=s||{};return new ViewPlugin(nextPluginID++,e,a,d=>{let g=[viewPlugin.of(d)];return h&&g.push(decorations.of(_=>{let b=_.plugin(d);return b?h(b):Decoration.none})),c&&g.push(c(d)),g})}static fromClass(e,s){return ViewPlugin.define(a=>new e(a),s)}}class PluginInstance{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}update(e){if(this.value){if(this.mustUpdate){let s=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(s)}catch(a){if(logException(s.state,a,"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(s){logException(e.state,s,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var s;if(!((s=this.value)===null||s===void 0)&&s.destroy)try{this.value.destroy()}catch(a){logException(e.state,a,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const editorAttributes=Facet.define(),contentAttributes=Facet.define(),decorations=Facet.define(),atomicRanges=Facet.define(),scrollMargins=Facet.define(),styleModule=Facet.define();class ChangedRange{constructor(e,s,a,c){this.fromA=e,this.toA=s,this.fromB=a,this.toB=c}join(e){return new ChangedRange(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 s=e.length,a=this;for(;s>0;s--){let c=e[s-1];if(!(c.fromA>a.toA)){if(c.toA$)break;h+=2}if(!_)return a;new ChangedRange(_.fromA,_.toA,_.fromB,_.toB).addToSet(a),d=_.toA,g=_.toB}}}class ViewUpdate{constructor(e,s,a){this.view=e,this.state=s,this.transactions=a,this.flags=0,this.startState=e.state,this.changes=ChangeSet.empty(this.startState.doc.length);for(let d of a)this.changes=this.changes.compose(d.changes);let c=[];this.changes.iterChangedRanges((d,g,_,b)=>c.push(new ChangedRange(d,g,_,b))),this.changedRanges=c;let h=e.hasFocus;h!=e.inputState.notifiedFocused&&(e.inputState.notifiedFocused=h,this.flags|=1)}static create(e,s,a){return new ViewUpdate(e,s,a)}get viewportChanged(){return(this.flags&4)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&10)>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}}var Direction=function(o){return o[o.LTR=0]="LTR",o[o.RTL=1]="RTL",o}(Direction||(Direction={}));const LTR=Direction.LTR,RTL=Direction.RTL;function dec(o){let e=[];for(let s=0;s=s){if(g.level==a)return d;(h<0||(c!=0?c<0?g.froms:e[h].level>g.level))&&(h=d)}}if(h<0)throw new RangeError("Index out of range");return h}}const types=[];function computeOrder(o,e){let s=o.length,a=e==LTR?1:2,c=e==LTR?2:1;if(!o||a==1&&!BidiRE.test(o))return trivialOrder(s);for(let d=0,g=a,_=a;d=0;_e-=3)if(BracketStack[_e+1]==-$){let et=BracketStack[_e+2],tt=et&2?a:et&4?et&1?c:a:0;tt&&(types[d]=types[BracketStack[_e]]=tt),g=_e;break}}else{if(BracketStack.length==189)break;BracketStack[g++]=d,BracketStack[g++]=b,BracketStack[g++]=_}else if((j=types[d])==2||j==1){let _e=j==a;_=_e?0:1;for(let et=g-3;et>=0;et-=3){let tt=BracketStack[et+2];if(tt&2)break;if(_e)BracketStack[et+2]|=2;else{if(tt&4)break;BracketStack[et+2]|=4}}}for(let d=0;dg;){let $=b,j=types[--b]!=2;for(;b>g&&j==(types[b-1]!=2);)b--;h.push(new BidiSpan(b,$,j?2:1))}else h.push(new BidiSpan(g,d,0))}else for(let d=0;d1)for(let _ of this.points)_.node==e&&_.pos>this.text.length&&(_.pos-=d-1);a=h+d}}readNode(e){if(e.cmIgnore)return;let s=ContentView.get(e),a=s&&s.overrideDOMText;if(a!=null){this.findPointInside(e,a.length);for(let c=a.iter();!c.next().done;)c.lineBreak?this.lineBreak():this.append(c.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,s){for(let a of this.points)a.node==e&&e.childNodes[a.offset]==s&&(a.pos=this.text.length)}findPointInside(e,s){for(let a of this.points)(e.nodeType==3?a.node==e:e.contains(a.node))&&(a.pos=this.text.length+Math.min(s,a.offset))}}function isBlockElement(o){return o.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(o.nodeName)}class DOMPoint{constructor(e,s){this.node=e,this.offset=s,this.pos=-1}}class DocView extends ContentView{constructor(e){super(),this.view=e,this.compositionDeco=Decoration.none,this.decorations=[],this.dynamicDecorationMap=[],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 LineView],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new ChangedRange(0,0,0,e.state.doc.length)],0)}get editorView(){return this.view}get length(){return this.view.state.doc.length}update(e){let s=e.changedRanges;this.minWidth>0&&s.length&&(s.every(({fromA:d,toA:g})=>gthis.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.view.inputState.composing<0?this.compositionDeco=Decoration.none:(e.transactions.length||this.dirty)&&(this.compositionDeco=computeCompositionDeco(this.view,e.changes)),(browser.ie||browser.chrome)&&!this.compositionDeco.size&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let a=this.decorations,c=this.updateDeco(),h=findChangedDeco(a,c,e.changes);return s=ChangedRange.extendWithRanges(s,h),this.dirty==0&&s.length==0?!1:(this.updateInner(s,e.startState.doc.length),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,s){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,s);let{observer:a}=this.view;a.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let h=browser.chrome||browser.ios?{node:a.selectionRange.focusNode,written:!1}:void 0;this.sync(h),this.dirty=0,h&&(h.written||a.selectionRange.focusNode!=h.node)&&(this.forceSelection=!0),this.dom.style.height=""});let c=[];if(this.view.viewport.from||this.view.viewport.to=0?e[c]:null;if(!h)break;let{fromA:d,toA:g,fromB:_,toB:b}=h,{content:$,breakAtStart:j,openStart:_e,openEnd:et}=ContentBuilder.build(this.view.state.doc,_,b,this.decorations,this.dynamicDecorationMap),{i:tt,off:nt}=a.findPos(g,1),{i:st,off:rt}=a.findPos(d,-1);replaceRange(this,st,rt,tt,nt,$,j,_e,et)}}updateSelection(e=!1,s=!1){if((e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange(),!(s||this.mayControlSelection())||browser.ios&&this.view.inputState.rapidCompositionStart)return;let a=this.forceSelection;this.forceSelection=!1;let c=this.view.state.selection.main,h=this.domAtPos(c.anchor),d=c.empty?h:this.domAtPos(c.head);if(browser.gecko&&c.empty&&betweenUneditable(h)){let _=document.createTextNode("");this.view.observer.ignore(()=>h.node.insertBefore(_,h.node.childNodes[h.offset]||null)),h=d=new DOMPos(_,0),a=!0}let g=this.view.observer.selectionRange;(a||!g.focusNode||!isEquivalentPosition(h.node,h.offset,g.anchorNode,g.anchorOffset)||!isEquivalentPosition(d.node,d.offset,g.focusNode,g.focusOffset))&&(this.view.observer.ignore(()=>{browser.android&&browser.chrome&&this.dom.contains(g.focusNode)&&inUneditable(g.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let _=getSelection(this.view.root);if(_)if(c.empty){if(browser.gecko){let b=nextToUneditable(h.node,h.offset);if(b&&b!=3){let $=nearbyTextNode(h.node,h.offset,b==1?1:-1);$&&(h=new DOMPos($,b==1?0:$.nodeValue.length))}}_.collapse(h.node,h.offset),c.bidiLevel!=null&&g.cursorBidiLevel!=null&&(g.cursorBidiLevel=c.bidiLevel)}else if(_.extend)_.collapse(h.node,h.offset),_.extend(d.node,d.offset);else{let b=document.createRange();c.anchor>c.head&&([h,d]=[d,h]),b.setEnd(d.node,d.offset),b.setStart(h.node,h.offset),_.removeAllRanges(),_.addRange(b)}}),this.view.observer.setSelectionRange(h,d)),this.impreciseAnchor=h.precise?null:new DOMPos(g.anchorNode,g.anchorOffset),this.impreciseHead=d.precise?null:new DOMPos(g.focusNode,g.focusOffset)}enforceCursorAssoc(){if(this.compositionDeco.size)return;let e=this.view.state.selection.main,s=getSelection(this.view.root);if(!s||!e.empty||!e.assoc||!s.modify)return;let a=LineView.find(this,e.head);if(!a)return;let c=a.posAtStart;if(e.head==c||e.head==c+a.length)return;let h=this.coordsAt(e.head,-1),d=this.coordsAt(e.head,1);if(!h||!d||h.bottom>d.top)return;let g=this.domAtPos(e.head+e.assoc);s.collapse(g.node,g.offset),s.modify("move",e.assoc<0?"forward":"backward","lineboundary")}mayControlSelection(){let e=this.view.root.activeElement;return e==this.dom||hasSelection(this.dom,this.view.observer.selectionRange)&&!(e&&this.dom.contains(e))}nearest(e){for(let s=e;s;){let a=ContentView.get(s);if(a&&a.rootView==this)return a;s=s.parentNode}return null}posFromDOM(e,s){let a=this.nearest(e);if(!a)throw new RangeError("Trying to find position for a DOM position outside of the document");return a.localPosFromDOM(e,s)+a.posAtStart}domAtPos(e){let{i:s,off:a}=this.childCursor().findPos(e,-1);for(;sd||e==d&&h.type!=BlockType.WidgetBefore&&h.type!=BlockType.WidgetAfter&&(!c||s==2||this.children[c-1].breakAfter||this.children[c-1].type==BlockType.WidgetBefore&&s>-2))return h.coordsAt(e-d,s);a=d}}measureVisibleLineHeights(e){let s=[],{from:a,to:c}=e,h=this.view.contentDOM.clientWidth,d=h>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,g=-1,_=this.view.textDirection==Direction.LTR;for(let b=0,$=0;$c)break;if(b>=a){let et=j.dom.getBoundingClientRect();if(s.push(et.height),d){let tt=j.dom.lastChild,nt=tt?clientRectsFor(tt):[];if(nt.length){let st=nt[nt.length-1],rt=_?st.right-et.left:et.right-st.left;rt>g&&(g=rt,this.minWidth=h,this.minWidthFrom=b,this.minWidthTo=_e)}}}b=_e+j.breakAfter}return s}textDirectionAt(e){let{i:s}=this.childPos(e,1);return getComputedStyle(this.children[s].dom).direction=="rtl"?Direction.RTL:Direction.LTR}measureTextSize(){for(let c of this.children)if(c instanceof LineView){let h=c.measureTextSize();if(h)return h}let e=document.createElement("div"),s,a;return e.className="cm-line",e.style.width="99999px",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let c=clientRectsFor(e.firstChild)[0];s=e.getBoundingClientRect().height,a=c?c.width/27:7,e.remove()}),{lineHeight:s,charWidth:a}}childCursor(e=this.length){let s=this.children.length;return s&&(e-=this.children[--s].length),new ChildCursor(this.children,e,s)}computeBlockGapDeco(){let e=[],s=this.view.viewState;for(let a=0,c=0;;c++){let h=c==s.viewports.length?null:s.viewports[c],d=h?h.from-1:this.length;if(d>a){let g=s.lineBlockAt(d).bottom-s.lineBlockAt(a).top;e.push(Decoration.replace({widget:new BlockGapWidget(g),block:!0,inclusive:!0,isBlockGap:!0}).range(a,d))}if(!h)break;a=h.to+1}return Decoration.set(e)}updateDeco(){let e=this.view.state.facet(decorations).map((s,a)=>(this.dynamicDecorationMap[a]=typeof s=="function")?s(this.view):s);for(let s=e.length;ss.anchor?-1:1),c;if(!a)return;!s.empty&&(c=this.coordsAt(s.anchor,s.anchor>s.head?-1:1))&&(a={left:Math.min(a.left,c.left),top:Math.min(a.top,c.top),right:Math.max(a.right,c.right),bottom:Math.max(a.bottom,c.bottom)});let h=0,d=0,g=0,_=0;for(let $ of this.view.state.facet(scrollMargins).map(j=>j(this.view)))if($){let{left:j,right:_e,top:et,bottom:tt}=$;j!=null&&(h=Math.max(h,j)),_e!=null&&(d=Math.max(d,_e)),et!=null&&(g=Math.max(g,et)),tt!=null&&(_=Math.max(_,tt))}let b={left:a.left-h,top:a.top-g,right:a.right+d,bottom:a.bottom+_};scrollRectIntoView(this.view.scrollDOM,b,s.head0&&s<=0)o=o.childNodes[e-1],e=maxOffset(o);else if(o.nodeType==1&&e=0)o=o.childNodes[e],e=0;else return null}}function nextToUneditable(o,e){return o.nodeType!=1?0:(e&&o.childNodes[e-1].contentEditable=="false"?1:0)|(e0;){let b=findClusterBreak(c.text,d,!1);if(a(c.text.slice(b,d))!=_)break;d=b}for(;go?e.left-o:Math.max(0,o-e.right)}function getdy(o,e){return e.top>o?e.top-o:Math.max(0,o-e.bottom)}function yOverlap(o,e){return o.tope.top+1}function upTop(o,e){return eo.bottom?{top:o.top,left:o.left,right:o.right,bottom:e}:o}function domPosAtCoords(o,e,s){let a,c,h,d,g=!1,_,b,$,j;for(let tt=o.firstChild;tt;tt=tt.nextSibling){let nt=clientRectsFor(tt);for(let st=0;stat||d==at&&h>it)&&(a=tt,c=rt,h=it,d=at,g=!it||(it>0?st0)),it==0?s>rt.bottom&&(!$||$.bottomrt.top)&&(b=tt,j=rt):$&&yOverlap($,rt)?$=upBot($,rt.bottom):j&&yOverlap(j,rt)&&(j=upTop(j,rt.top))}}if($&&$.bottom>=s?(a=_,c=$):j&&j.top<=s&&(a=b,c=j),!a)return{node:o,offset:0};let _e=Math.max(c.left,Math.min(c.right,e));if(a.nodeType==3)return domPosInText(a,_e,s);if(g&&a.contentEditable!="false")return domPosAtCoords(a,_e,s);let et=Array.prototype.indexOf.call(o.childNodes,a)+(e>=(c.left+c.right)/2?1:0);return{node:o,offset:et}}function domPosInText(o,e,s){let a=o.nodeValue.length,c=-1,h=1e9,d=0;for(let g=0;gs?$.top-s:s-$.bottom)-1;if($.left-1<=e&&$.right+1>=e&&j=($.left+$.right)/2,et=_e;if((browser.chrome||browser.gecko)&&textRange(o,g).getBoundingClientRect().left==$.right&&(et=!_e),j<=0)return{node:o,offset:g+(et?1:0)};c=g+(et?1:0),h=j}}}return{node:o,offset:c>-1?c:d>0?o.nodeValue.length:0}}function posAtCoords(o,{x:e,y:s},a,c=-1){var h;let d=o.contentDOM.getBoundingClientRect(),g=d.top+o.viewState.paddingTop,_,{docHeight:b}=o.viewState,$=s-g;if($<0)return 0;if($>b)return o.state.doc.length;for(let rt=o.defaultLineHeight/2,it=!1;_=o.elementAtHeight($),_.type!=BlockType.Text;)for(;$=c>0?_.bottom+rt:_.top-rt,!($>=0&&$<=b);){if(it)return a?null:0;it=!0,c=-c}s=g+$;let j=_.from;if(jo.viewport.to)return o.viewport.to==o.state.doc.length?o.state.doc.length:a?null:posAtCoordsImprecise(o,d,_,e,s);let _e=o.dom.ownerDocument,et=o.root.elementFromPoint?o.root:_e,tt=et.elementFromPoint(e,s);tt&&!o.contentDOM.contains(tt)&&(tt=null),tt||(e=Math.max(d.left+1,Math.min(d.right-1,e)),tt=et.elementFromPoint(e,s),tt&&!o.contentDOM.contains(tt)&&(tt=null));let nt,st=-1;if(tt&&((h=o.docView.nearest(tt))===null||h===void 0?void 0:h.isEditable)!=!1){if(_e.caretPositionFromPoint){let rt=_e.caretPositionFromPoint(e,s);rt&&({offsetNode:nt,offset:st}=rt)}else if(_e.caretRangeFromPoint){let rt=_e.caretRangeFromPoint(e,s);rt&&({startContainer:nt,startOffset:st}=rt,(!o.contentDOM.contains(nt)||browser.safari&&isSuspiciousSafariCaretResult(nt,st,e)||browser.chrome&&isSuspiciousChromeCaretResult(nt,st,e))&&(nt=void 0))}}if(!nt||!o.docView.dom.contains(nt)){let rt=LineView.find(o.docView,j);if(!rt)return $>_.top+_.height/2?_.to:_.from;({node:nt,offset:st}=domPosAtCoords(rt.dom,e,s))}return o.docView.posFromDOM(nt,st)}function posAtCoordsImprecise(o,e,s,a,c){let h=Math.round((a-e.left)*o.defaultCharacterWidth);o.lineWrapping&&s.height>o.defaultLineHeight*1.5&&(h+=Math.floor((c-s.top)/o.defaultLineHeight)*o.viewState.heightOracle.lineLength);let d=o.state.sliceDoc(s.from,s.to);return s.from+findColumn(d,h,o.state.tabSize)}function isSuspiciousSafariCaretResult(o,e,s){let a;if(o.nodeType!=3||e!=(a=o.nodeValue.length))return!1;for(let c=o.nextSibling;c;c=c.nextSibling)if(c.nodeType!=1||c.nodeName!="BR")return!1;return textRange(o,a-1,a).getBoundingClientRect().left>s}function isSuspiciousChromeCaretResult(o,e,s){if(e!=0)return!1;for(let c=o;;){let h=c.parentNode;if(!h||h.nodeType!=1||h.firstChild!=c)return!1;if(h.classList.contains("cm-line"))break;c=h}let a=o.nodeType==1?o.getBoundingClientRect():textRange(o,0,Math.max(o.nodeValue.length,1)).getBoundingClientRect();return s-a.left>5}function moveToLineBoundary(o,e,s,a){let c=o.state.doc.lineAt(e.head),h=!a||!o.lineWrapping?null:o.coordsAtPos(e.assoc<0&&e.head>c.from?e.head-1:e.head);if(h){let _=o.dom.getBoundingClientRect(),b=o.textDirectionAt(c.from),$=o.posAtCoords({x:s==(b==Direction.LTR)?_.right-1:_.left+1,y:(h.top+h.bottom)/2});if($!=null)return EditorSelection.cursor($,s?-1:1)}let d=LineView.find(o.docView,e.head),g=d?s?d.posAtEnd:d.posAtStart:s?c.to:c.from;return EditorSelection.cursor(g,s?-1:1)}function moveByChar(o,e,s,a){let c=o.state.doc.lineAt(e.head),h=o.bidiSpans(c),d=o.textDirectionAt(c.from);for(let g=e,_=null;;){let b=moveVisually(c,h,d,g,s),$=movedOver;if(!b){if(c.number==(s?o.state.doc.lines:1))return g;$=` `,c=o.state.doc.line(c.number+(s?1:-1)),h=o.bidiSpans(c),b=EditorSelection.cursor(s?c.from:c.to)}if(_){if(!_($))return g}else{if(!a)return b;_=a($)}g=b}}function byGroup(o,e,s){let a=o.state.charCategorizer(e),c=a(s);return h=>{let d=a(h);return c==CharCategory.Space&&(c=d),c==d}}function moveVertically(o,e,s,a){let c=e.head,h=s?1:-1;if(c==(s?o.state.doc.length:0))return EditorSelection.cursor(c,e.assoc);let d=e.goalColumn,g,_=o.contentDOM.getBoundingClientRect(),b=o.coordsAtPos(c),$=o.documentTop;if(b)d==null&&(d=b.left-_.left),g=h<0?b.top:b.bottom;else{let et=o.viewState.lineBlockAt(c);d==null&&(d=Math.min(_.right-_.left,o.defaultCharacterWidth*(c-et.from))),g=(h<0?et.top:et.bottom)+$}let j=_.left+d,_e=a!=null?a:o.defaultLineHeight>>1;for(let et=0;;et+=10){let tt=g+(_e+et)*h,nt=posAtCoords(o,{x:j,y:tt},!1,h);if(tt<_.top||tt>_.bottom||(h<0?ntc))return EditorSelection.cursor(nt,e.assoc,void 0,d)}}function skipAtoms(o,e,s){let a=o.state.facet(atomicRanges).map(c=>c(o));for(;;){let c=!1;for(let h of a)h.between(s.from-1,s.from+1,(d,g,_)=>{s.from>d&&s.froms.from?EditorSelection.cursor(d,1):EditorSelection.cursor(g,-1),c=!0)});if(!c)return s}}class InputState{constructor(e){this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.chromeScrollHack=-1,this.pendingIOSKey=void 0,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastEscPress=0,this.lastContextMenu=0,this.scrollHandlers=[],this.registeredEvents=[],this.customHandlers=[],this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.rapidCompositionStart=!1,this.mouseSelection=null;for(let s in handlers){let a=handlers[s];e.contentDOM.addEventListener(s,c=>{!eventBelongsToEditor(e,c)||this.ignoreDuringComposition(c)||s=="keydown"&&this.keydown(e,c)||(this.mustFlushObserver(c)&&e.observer.forceFlush(),this.runCustomHandlers(s,e,c)?c.preventDefault():a(e,c))},handlerOptions[s]),this.registeredEvents.push(s)}browser.chrome&&browser.chrome_version==102&&e.scrollDOM.addEventListener("wheel",()=>{this.chromeScrollHack<0?e.contentDOM.style.pointerEvents="none":window.clearTimeout(this.chromeScrollHack),this.chromeScrollHack=setTimeout(()=>{this.chromeScrollHack=-1,e.contentDOM.style.pointerEvents=""},100)},{passive:!0}),this.notifiedFocused=e.hasFocus,browser.safari&&e.contentDOM.addEventListener("input",()=>null)}setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}ensureHandlers(e,s){var a;let c;this.customHandlers=[];for(let h of s)if(c=(a=h.update(e).spec)===null||a===void 0?void 0:a.domEventHandlers){this.customHandlers.push({plugin:h.value,handlers:c});for(let d in c)this.registeredEvents.indexOf(d)<0&&d!="scroll"&&(this.registeredEvents.push(d),e.contentDOM.addEventListener(d,g=>{!eventBelongsToEditor(e,g)||this.runCustomHandlers(d,e,g)&&g.preventDefault()}))}}runCustomHandlers(e,s,a){for(let c of this.customHandlers){let h=c.handlers[e];if(h)try{if(h.call(c.plugin,a,s)||a.defaultPrevented)return!0}catch(d){logException(s.state,d)}}return!1}runScrollHandlers(e,s){this.lastScrollTop=e.scrollDOM.scrollTop,this.lastScrollLeft=e.scrollDOM.scrollLeft;for(let a of this.customHandlers){let c=a.handlers.scroll;if(c)try{c.call(a.plugin,s,e)}catch(h){logException(e.state,h)}}}keydown(e,s){if(this.lastKeyCode=s.keyCode,this.lastKeyTime=Date.now(),s.keyCode==9&&Date.now()c.keyCode==s.keyCode))&&!(s.ctrlKey||s.altKey||s.metaKey)&&!s.synthetic?(this.pendingIOSKey=a,setTimeout(()=>this.flushIOSKey(e),250),!0):!1}flushIOSKey(e){let s=this.pendingIOSKey;return s?(this.pendingIOSKey=void 0,dispatchKey(e.contentDOM,s.key,s.keyCode)):!1}ignoreDuringComposition(e){return/^key/.test(e.type)?this.composing>0?!0:browser.safari&&!browser.ios&&Date.now()-this.compositionEndedAt<100?(this.compositionEndedAt=0,!0):!1:!1}mustFlushObserver(e){return e.type=="keydown"&&e.keyCode!=229||e.type=="compositionend"&&!browser.ios}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.mouseSelection&&this.mouseSelection.update(e),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}const PendingKeys=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],modifierCodes=[16,17,18,20,91,92,224,225];class MouseSelection{constructor(e,s,a,c){this.view=e,this.style=a,this.mustSelect=c,this.lastEvent=s;let h=e.contentDOM.ownerDocument;h.addEventListener("mousemove",this.move=this.move.bind(this)),h.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=s.shiftKey,this.multiple=e.state.facet(EditorState.allowMultipleSelections)&&addsSelectionRange(e,s),this.dragMove=dragMovesSelection(e,s),this.dragging=isInPrimarySelection(e,s)&&getClickType(s)==1?null:!1,this.dragging===!1&&(s.preventDefault(),this.select(s))}move(e){if(e.buttons==0)return this.destroy();this.dragging===!1&&this.select(this.lastEvent=e)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=null}select(e){let s=this.style.get(e,this.extend,this.multiple);(this.mustSelect||!s.eq(this.view.state.selection)||s.main.assoc!=this.view.state.selection.main.assoc)&&this.view.dispatch({selection:s,userEvent:"select.pointer",scrollIntoView:!0}),this.mustSelect=!1}update(e){e.docChanged&&this.dragging&&(this.dragging=this.dragging.map(e.changes)),this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function addsSelectionRange(o,e){let s=o.state.facet(clickAddsSelectionRange);return s.length?s[0](e):browser.mac?e.metaKey:e.ctrlKey}function dragMovesSelection(o,e){let s=o.state.facet(dragMovesSelection$1);return s.length?s[0](e):browser.mac?!e.altKey:!e.ctrlKey}function isInPrimarySelection(o,e){let{main:s}=o.state.selection;if(s.empty)return!1;let a=getSelection(o.root);if(!a||a.rangeCount==0)return!0;let c=a.getRangeAt(0).getClientRects();for(let h=0;h=e.clientX&&d.top<=e.clientY&&d.bottom>=e.clientY)return!0}return!1}function eventBelongsToEditor(o,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let s=e.target,a;s!=o.contentDOM;s=s.parentNode)if(!s||s.nodeType==11||(a=ContentView.get(s))&&a.ignoreEvent(e))return!1;return!0}const handlers=Object.create(null),handlerOptions=Object.create(null),brokenClipboardAPI=browser.ie&&browser.ie_version<15||browser.ios&&browser.webkit_version<604;function capturePaste(o){let e=o.dom.parentNode;if(!e)return;let s=e.appendChild(document.createElement("textarea"));s.style.cssText="position: fixed; left: -10000px; top: 10px",s.focus(),setTimeout(()=>{o.focus(),s.remove(),doPaste(o,s.value)},50)}function doPaste(o,e){let{state:s}=o,a,c=1,h=s.toText(e),d=h.lines==s.selection.ranges.length;if(lastLinewiseCopy!=null&&s.selection.ranges.every(_=>_.empty)&&lastLinewiseCopy==h.toString()){let _=-1;a=s.changeByRange(b=>{let $=s.doc.lineAt(b.from);if($.from==_)return{range:b};_=$.from;let j=s.toText((d?h.line(c++).text:e)+s.lineBreak);return{changes:{from:$.from,insert:j},range:EditorSelection.cursor(b.from+j.length)}})}else d?a=s.changeByRange(_=>{let b=h.line(c++);return{changes:{from:_.from,to:_.to,insert:b.text},range:EditorSelection.cursor(_.from+b.length)}}):a=s.replaceSelection(h);o.dispatch(a,{userEvent:"input.paste",scrollIntoView:!0})}handlers.keydown=(o,e)=>{o.inputState.setSelectionOrigin("select"),e.keyCode==27?o.inputState.lastEscPress=Date.now():modifierCodes.indexOf(e.keyCode)<0&&(o.inputState.lastEscPress=0)};handlers.touchstart=(o,e)=>{o.inputState.lastTouchTime=Date.now(),o.inputState.setSelectionOrigin("select.pointer")};handlers.touchmove=o=>{o.inputState.setSelectionOrigin("select.pointer")};handlerOptions.touchstart=handlerOptions.touchmove={passive:!0};handlers.mousedown=(o,e)=>{if(o.observer.flush(),o.inputState.lastTouchTime>Date.now()-2e3&&getClickType(e)==1)return;let s=null;for(let a of o.state.facet(mouseSelectionStyle))if(s=a(o,e),s)break;if(!s&&e.button==0&&(s=basicMouseSelection(o,e)),s){let a=o.root.activeElement!=o.contentDOM;a&&o.observer.ignore(()=>focusPreventScroll(o.contentDOM)),o.inputState.startMouseSelection(new MouseSelection(o,e,s,a))}};function rangeForClick(o,e,s,a){if(a==1)return EditorSelection.cursor(e,s);if(a==2)return groupAt(o.state,e,s);{let c=LineView.find(o.docView,e),h=o.state.doc.lineAt(c?c.posAtEnd:e),d=c?c.posAtStart:h.from,g=c?c.posAtEnd:h.to;return go>=e.top&&o<=e.bottom,inside=(o,e,s)=>insideY(e,s)&&o>=s.left&&o<=s.right;function findPositionSide(o,e,s,a){let c=LineView.find(o.docView,e);if(!c)return 1;let h=e-c.posAtStart;if(h==0)return 1;if(h==c.length)return-1;let d=c.coordsAt(h,-1);if(d&&inside(s,a,d))return-1;let g=c.coordsAt(h,1);return g&&inside(s,a,g)?1:d&&insideY(a,d)?-1:1}function queryPos(o,e){let s=o.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:s,bias:findPositionSide(o,s,e.clientX,e.clientY)}}const BadMouseDetail=browser.ie&&browser.ie_version<=11;let lastMouseDown=null,lastMouseDownCount=0,lastMouseDownTime=0;function getClickType(o){if(!BadMouseDetail)return o.detail;let e=lastMouseDown,s=lastMouseDownTime;return lastMouseDown=o,lastMouseDownTime=Date.now(),lastMouseDownCount=!e||s>Date.now()-400&&Math.abs(e.clientX-o.clientX)<2&&Math.abs(e.clientY-o.clientY)<2?(lastMouseDownCount+1)%3:1}function basicMouseSelection(o,e){let s=queryPos(o,e),a=getClickType(e),c=o.state.selection,h=s,d=e;return{update(g){g.docChanged&&(s&&(s.pos=g.changes.mapPos(s.pos)),c=c.map(g.changes),d=null)},get(g,_,b){let $;if(d&&g.clientX==d.clientX&&g.clientY==d.clientY?$=h:($=h=queryPos(o,g),d=g),!$||!s)return c;let j=rangeForClick(o,$.pos,$.bias,a);if(s.pos!=$.pos&&!_){let _e=rangeForClick(o,s.pos,s.bias,a),et=Math.min(_e.from,j.from),tt=Math.max(_e.to,j.to);j=et1&&c.ranges.some(_e=>_e.eq(j))?removeRange(c,j):b?c.addRange(j):EditorSelection.create([j])}}}function removeRange(o,e){for(let s=0;;s++)if(o.ranges[s].eq(e))return EditorSelection.create(o.ranges.slice(0,s).concat(o.ranges.slice(s+1)),o.mainIndex==s?0:o.mainIndex-(o.mainIndex>s?1:0))}handlers.dragstart=(o,e)=>{let{selection:{main:s}}=o.state,{mouseSelection:a}=o.inputState;a&&(a.dragging=s),e.dataTransfer&&(e.dataTransfer.setData("Text",o.state.sliceDoc(s.from,s.to)),e.dataTransfer.effectAllowed="copyMove")};function dropText(o,e,s,a){if(!s)return;let c=o.posAtCoords({x:e.clientX,y:e.clientY},!1);e.preventDefault();let{mouseSelection:h}=o.inputState,d=a&&h&&h.dragging&&h.dragMove?{from:h.dragging.from,to:h.dragging.to}:null,g={from:c,insert:s},_=o.state.changes(d?[d,g]:g);o.focus(),o.dispatch({changes:_,selection:{anchor:_.mapPos(c,-1),head:_.mapPos(c,1)},userEvent:d?"move.drop":"input.drop"})}handlers.drop=(o,e)=>{if(!e.dataTransfer)return;if(o.state.readOnly)return e.preventDefault();let s=e.dataTransfer.files;if(s&&s.length){e.preventDefault();let a=Array(s.length),c=0,h=()=>{++c==s.length&&dropText(o,e,a.filter(d=>d!=null).join(o.state.lineBreak),!1)};for(let d=0;d{/[\x00-\x08\x0e-\x1f]{2}/.test(g.result)||(a[d]=g.result),h()},g.readAsText(s[d])}}else dropText(o,e,e.dataTransfer.getData("Text"),!0)};handlers.paste=(o,e)=>{if(o.state.readOnly)return e.preventDefault();o.observer.flush();let s=brokenClipboardAPI?null:e.clipboardData;s?(doPaste(o,s.getData("text/plain")),e.preventDefault()):capturePaste(o)};function captureCopy(o,e){let s=o.dom.parentNode;if(!s)return;let a=s.appendChild(document.createElement("textarea"));a.style.cssText="position: fixed; left: -10000px; top: 10px",a.value=e,a.focus(),a.selectionEnd=e.length,a.selectionStart=0,setTimeout(()=>{a.remove(),o.focus()},50)}function copiedRange(o){let e=[],s=[],a=!1;for(let c of o.selection.ranges)c.empty||(e.push(o.sliceDoc(c.from,c.to)),s.push(c));if(!e.length){let c=-1;for(let{from:h}of o.selection.ranges){let d=o.doc.lineAt(h);d.number>c&&(e.push(d.text),s.push({from:d.from,to:Math.min(o.doc.length,d.to+1)})),c=d.number}a=!0}return{text:e.join(o.lineBreak),ranges:s,linewise:a}}let lastLinewiseCopy=null;handlers.copy=handlers.cut=(o,e)=>{let{text:s,ranges:a,linewise:c}=copiedRange(o.state);if(!s&&!c)return;lastLinewiseCopy=c?s:null;let h=brokenClipboardAPI?null:e.clipboardData;h?(e.preventDefault(),h.clearData(),h.setData("text/plain",s)):captureCopy(o,s),e.type=="cut"&&!o.state.readOnly&&o.dispatch({changes:a,scrollIntoView:!0,userEvent:"delete.cut"})};function updateForFocusChange(o){setTimeout(()=>{o.hasFocus!=o.inputState.notifiedFocused&&o.update([])},10)}handlers.focus=o=>{o.inputState.lastFocusTime=Date.now(),!o.scrollDOM.scrollTop&&(o.inputState.lastScrollTop||o.inputState.lastScrollLeft)&&(o.scrollDOM.scrollTop=o.inputState.lastScrollTop,o.scrollDOM.scrollLeft=o.inputState.lastScrollLeft),updateForFocusChange(o)};handlers.blur=o=>{o.observer.clearSelectionRange(),updateForFocusChange(o)};function forceClearComposition(o,e){if(o.docView.compositionDeco.size){o.inputState.rapidCompositionStart=e;try{o.update([])}finally{o.inputState.rapidCompositionStart=!1}}}handlers.compositionstart=handlers.compositionupdate=o=>{o.inputState.compositionFirstChange==null&&(o.inputState.compositionFirstChange=!0),o.inputState.composing<0&&(o.inputState.composing=0,o.docView.compositionDeco.size&&(o.observer.flush(),forceClearComposition(o,!0)))};handlers.compositionend=o=>{o.inputState.composing=-1,o.inputState.compositionEndedAt=Date.now(),o.inputState.compositionFirstChange=null,setTimeout(()=>{o.inputState.composing<0&&forceClearComposition(o,!1)},50)};handlers.contextmenu=o=>{o.inputState.lastContextMenu=Date.now()};handlers.beforeinput=(o,e)=>{var s;let a;if(browser.chrome&&browser.android&&(a=PendingKeys.find(c=>c.inputType==e.inputType))&&(o.observer.delayAndroidKey(a.key,a.keyCode),a.key=="Backspace"||a.key=="Delete")){let c=((s=window.visualViewport)===null||s===void 0?void 0:s.height)||0;setTimeout(()=>{var h;(((h=window.visualViewport)===null||h===void 0?void 0:h.height)||0)>c+10&&o.hasFocus&&(o.contentDOM.blur(),o.focus())},100)}};const wrappingWhiteSpace=["pre-wrap","normal","pre-line","break-spaces"];class HeightOracle{constructor(){this.doc=Text.empty,this.lineWrapping=!1,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.lineLength=30,this.heightChanged=!1}heightForGap(e,s){let a=this.doc.lineAt(s).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(a+=Math.ceil((s-e-a*this.lineLength*.5)/this.lineLength)),this.lineHeight*a}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 wrappingWhiteSpace.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let s=!1;for(let a=0;a-1,g=Math.round(s)!=Math.round(this.lineHeight)||this.lineWrapping!=d;if(this.lineWrapping=d,this.lineHeight=s,this.charWidth=a,this.lineLength=c,g){this.heightSamples={};for(let _=0;_0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e,s){this.height!=s&&(Math.abs(this.height-s)>Epsilon&&(e.heightChanged=!0),this.height=s)}replace(e,s,a){return HeightMap.of(a)}decomposeLeft(e,s){s.push(this)}decomposeRight(e,s){s.push(this)}applyChanges(e,s,a,c){let h=this;for(let d=c.length-1;d>=0;d--){let{fromA:g,toA:_,fromB:b,toB:$}=c[d],j=h.lineAt(g,QueryType$1.ByPosNoHeight,s,0,0),_e=j.to>=_?j:h.lineAt(_,QueryType$1.ByPosNoHeight,s,0,0);for($+=_e.to-_,_=_e.to;d>0&&j.from<=c[d-1].toA;)g=c[d-1].fromA,b=c[d-1].fromB,d--,gh*2){let g=e[s-1];g.break?e.splice(--s,1,g.left,null,g.right):e.splice(--s,1,g.left,g.right),a+=1+g.break,c-=g.size}else if(h>c*2){let g=e[a];g.break?e.splice(a,1,g.left,null,g.right):e.splice(a,1,g.left,g.right),a+=2+g.break,h-=g.size}else break;else if(c=h&&d(this.blockAt(0,a,c,h))}updateHeight(e,s=0,a=!1,c){return c&&c.from<=s&&c.more&&this.setHeight(e,c.heights[c.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class HeightMapText extends HeightMapBlock{constructor(e,s){super(e,s,BlockType.Text),this.collapsed=0,this.widgetHeight=0}replace(e,s,a){let c=a[0];return a.length==1&&(c instanceof HeightMapText||c instanceof HeightMapGap&&c.flags&4)&&Math.abs(this.length-c.length)<10?(c instanceof HeightMapGap?c=new HeightMapText(c.length,this.height):c.height=this.height,this.outdated||(c.outdated=!1),c):HeightMap.of(a)}updateHeight(e,s=0,a=!1,c){return c&&c.from<=s&&c.more?this.setHeight(e,c.heights[c.index++]):(a||this.outdated)&&this.setHeight(e,Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class HeightMapGap extends HeightMap{constructor(e){super(e,0)}lines(e,s){let a=e.lineAt(s).number,c=e.lineAt(s+this.length).number;return{firstLine:a,lastLine:c,lineHeight:this.height/(c-a+1)}}blockAt(e,s,a,c){let{firstLine:h,lastLine:d,lineHeight:g}=this.lines(s,c),_=Math.max(0,Math.min(d-h,Math.floor((e-a)/g))),{from:b,length:$}=s.line(h+_);return new BlockInfo(b,$,a+g*_,g,BlockType.Text)}lineAt(e,s,a,c,h){if(s==QueryType$1.ByHeight)return this.blockAt(e,a,c,h);if(s==QueryType$1.ByPosNoHeight){let{from:j,to:_e}=a.lineAt(e);return new BlockInfo(j,_e-j,0,0,BlockType.Text)}let{firstLine:d,lineHeight:g}=this.lines(a,h),{from:_,length:b,number:$}=a.lineAt(e);return new BlockInfo(_,b,c+g*($-d),g,BlockType.Text)}forEachLine(e,s,a,c,h,d){let{firstLine:g,lineHeight:_}=this.lines(a,h);for(let b=Math.max(e,h),$=Math.min(h+this.length,s);b<=$;){let j=a.lineAt(b);b==e&&(c+=_*(j.number-g)),d(new BlockInfo(j.from,j.length,c,_,BlockType.Text)),c+=_,b=j.to+1}}replace(e,s,a){let c=this.length-s;if(c>0){let h=a[a.length-1];h instanceof HeightMapGap?a[a.length-1]=new HeightMapGap(h.length+c):a.push(null,new HeightMapGap(c-1))}if(e>0){let h=a[0];h instanceof HeightMapGap?a[0]=new HeightMapGap(e+h.length):a.unshift(new HeightMapGap(e-1),null)}return HeightMap.of(a)}decomposeLeft(e,s){s.push(new HeightMapGap(e-1),null)}decomposeRight(e,s){s.push(null,new HeightMapGap(this.length-e-1))}updateHeight(e,s=0,a=!1,c){let h=s+this.length;if(c&&c.from<=s+this.length&&c.more){let d=[],g=Math.max(s,c.from),_=-1,b=e.heightChanged;for(c.from>s&&d.push(new HeightMapGap(c.from-s-1).updateHeight(e,s));g<=h&&c.more;){let j=e.doc.lineAt(g).length;d.length&&d.push(null);let _e=c.heights[c.index++];_==-1?_=_e:Math.abs(_e-_)>=Epsilon&&(_=-2);let et=new HeightMapText(j,_e);et.outdated=!1,d.push(et),g+=j+1}g<=h&&d.push(null,new HeightMapGap(h-g).updateHeight(e,g));let $=HeightMap.of(d);return e.heightChanged=b||_<0||Math.abs($.height-this.height)>=Epsilon||Math.abs(_-this.lines(e.doc,s).lineHeight)>=Epsilon,$}else(a||this.outdated)&&(this.setHeight(e,e.heightForGap(s,s+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class HeightMapBranch extends HeightMap{constructor(e,s,a){super(e.length+s+a.length,e.height+a.height,s|(e.outdated||a.outdated?2:0)),this.left=e,this.right=a,this.size=e.size+a.size}get break(){return this.flags&1}blockAt(e,s,a,c){let h=a+this.left.height;return eg))return b;let $=s==QueryType$1.ByPosNoHeight?QueryType$1.ByPosNoHeight:QueryType$1.ByPos;return _?b.join(this.right.lineAt(g,$,a,d,g)):this.left.lineAt(g,$,a,c,h).join(b)}forEachLine(e,s,a,c,h,d){let g=c+this.left.height,_=h+this.left.length+this.break;if(this.break)e<_&&this.left.forEachLine(e,s,a,c,h,d),s>=_&&this.right.forEachLine(e,s,a,g,_,d);else{let b=this.lineAt(_,QueryType$1.ByPos,a,c,h);e=e&&b.from<=s&&d(b),s>b.to&&this.right.forEachLine(b.to+1,s,a,g,_,d)}}replace(e,s,a){let c=this.left.length+this.break;if(sthis.left.length)return this.balanced(this.left,this.right.replace(e-c,s-c,a));let h=[];e>0&&this.decomposeLeft(e,h);let d=h.length;for(let g of a)h.push(g);if(e>0&&mergeGaps(h,d-1),s=a&&s.push(null)),e>a&&this.right.decomposeLeft(e-a,s)}decomposeRight(e,s){let a=this.left.length,c=a+this.break;if(e>=c)return this.right.decomposeRight(e-c,s);e2*s.size||s.size>2*e.size?HeightMap.of(this.break?[e,null,s]:[e,s]):(this.left=e,this.right=s,this.height=e.height+s.height,this.outdated=e.outdated||s.outdated,this.size=e.size+s.size,this.length=e.length+this.break+s.length,this)}updateHeight(e,s=0,a=!1,c){let{left:h,right:d}=this,g=s+h.length+this.break,_=null;return c&&c.from<=s+h.length&&c.more?_=h=h.updateHeight(e,s,a,c):h.updateHeight(e,s,a),c&&c.from<=g+d.length&&c.more?_=d=d.updateHeight(e,g,a,c):d.updateHeight(e,g,a),_?this.balanced(h,d):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function mergeGaps(o,e){let s,a;o[e]==null&&(s=o[e-1])instanceof HeightMapGap&&(a=o[e+1])instanceof HeightMapGap&&o.splice(e-1,3,new HeightMapGap(s.length+1+a.length))}const relevantWidgetHeight=5;class NodeBuilder{constructor(e,s){this.pos=e,this.oracle=s,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,s){if(this.lineStart>-1){let a=Math.min(s,this.lineEnd),c=this.nodes[this.nodes.length-1];c instanceof HeightMapText?c.length+=a-this.pos:(a>this.pos||!this.isCovered)&&this.nodes.push(new HeightMapText(a-this.pos,-1)),this.writtenTo=a,s>a&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=s}point(e,s,a){if(e=relevantWidgetHeight)&&this.addLineDeco(c,h)}else s>e&&this.span(e,s);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:s}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=s,this.writtenToe&&this.nodes.push(new HeightMapText(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,s){let a=new HeightMapGap(s-e);return this.oracle.doc.lineAt(e).to==s&&(a.flags|=4),a}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof HeightMapText)return e;let s=new HeightMapText(0,-1);return this.nodes.push(s),s}addBlock(e){this.enterLine(),e.type==BlockType.WidgetAfter&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,e.type!=BlockType.WidgetBefore&&(this.covering=e)}addLineDeco(e,s){let a=this.ensureLine();a.length+=s,a.collapsed+=s,a.widgetHeight=Math.max(a.widgetHeight,e),this.writtenTo=this.pos=this.pos+s}finish(e){let s=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(s instanceof HeightMapText)&&!this.isCovered?this.nodes.push(new HeightMapText(0,-1)):(this.writtenTob.clientHeight||b.scrollWidth>b.clientWidth)&&$.overflow!="visible"){let j=b.getBoundingClientRect();a=Math.max(a,j.left),c=Math.min(c,j.right),h=Math.max(h,j.top),d=_==o.parentNode?j.bottom:Math.min(d,j.bottom)}_=$.position=="absolute"||$.position=="fixed"?b.offsetParent:b.parentNode}else if(_.nodeType==11)_=_.host;else break;return{left:a-s.left,right:Math.max(a,c)-s.left,top:h-(s.top+e),bottom:Math.max(h,d)-(s.top+e)}}function fullPixelRange(o,e){let s=o.getBoundingClientRect();return{left:0,right:s.right-s.left,top:e,bottom:s.bottom-(s.top+e)}}class LineGap{constructor(e,s,a){this.from=e,this.to=s,this.size=a}static same(e,s){if(e.length!=s.length)return!1;for(let a=0;atypeof s!="function"),this.heightMap=HeightMap.empty().applyChanges(this.stateDeco,Text.empty,this.heightOracle.setDoc(e.doc),[new ChangedRange(0,0,0,e.doc.length)]),this.viewport=this.getViewport(0,null),this.updateViewportLines(),this.updateForViewport(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Decoration.set(this.lineGaps.map(s=>s.draw(!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:s}=this.state.selection;for(let a=0;a<=1;a++){let c=a?s.head:s.anchor;if(!e.some(({from:h,to:d})=>c>=h&&c<=d)){let{from:h,to:d}=this.lineBlockAt(c);e.push(new Viewport(h,d))}}this.viewports=e.sort((a,c)=>a.from-c.from),this.scaler=this.heightMap.height<=7e6?IdScaler:new BigScaler(this.heightOracle.doc,this.heightMap,this.viewports)}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.state.doc,0,0,e=>{this.viewportLines.push(this.scaler.scale==1?e:scaleBlock(e,this.scaler))})}update(e,s=null){this.state=e.state;let a=this.stateDeco;this.stateDeco=this.state.facet(decorations).filter(b=>typeof b!="function");let c=e.changedRanges,h=ChangedRange.extendWithRanges(c,heightRelevantDecoChanges(a,this.stateDeco,e?e.changes:ChangeSet.empty(this.state.doc.length))),d=this.heightMap.height;this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),h),this.heightMap.height!=d&&(e.flags|=2);let g=h.length?this.mapViewport(this.viewport,e.changes):this.viewport;(s&&(s.range.headg.to)||!this.viewportIsAppropriate(g))&&(g=this.getViewport(0,s));let _=!e.changes.empty||e.flags&2||g.from!=this.viewport.from||g.to!=this.viewport.to;this.viewport=g,this.updateForViewport(),_&&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(),s&&(this.scrollTarget=s),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&(this.mustEnforceCursorAssoc=!0)}measure(e){let s=e.contentDOM,a=window.getComputedStyle(s),c=this.heightOracle,h=a.whiteSpace;this.defaultTextDirection=a.direction=="rtl"?Direction.RTL:Direction.LTR;let d=this.heightOracle.mustRefreshForWrapping(h),g=d||this.mustMeasureContent||this.contentDOMHeight!=s.clientHeight;this.contentDOMHeight=s.clientHeight,this.mustMeasureContent=!1;let _=0,b=0,$=parseInt(a.paddingTop)||0,j=parseInt(a.paddingBottom)||0;(this.paddingTop!=$||this.paddingBottom!=j)&&(this.paddingTop=$,this.paddingBottom=j,_|=10),this.editorWidth!=e.scrollDOM.clientWidth&&(c.lineWrapping&&(g=!0),this.editorWidth=e.scrollDOM.clientWidth,_|=8);let _e=(this.printing?fullPixelRange:visiblePixelRange)(s,this.paddingTop),et=_e.top-this.pixelViewport.top,tt=_e.bottom-this.pixelViewport.bottom;this.pixelViewport=_e;let nt=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(nt!=this.inView&&(this.inView=nt,nt&&(g=!0)),!this.inView)return 0;let st=s.clientWidth;if((this.contentDOMWidth!=st||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=st,this.editorHeight=e.scrollDOM.clientHeight,_|=8),g){let it=e.docView.measureVisibleLineHeights(this.viewport);if(c.mustRefreshForHeights(it)&&(d=!0),d||c.lineWrapping&&Math.abs(st-this.contentDOMWidth)>c.charWidth){let{lineHeight:at,charWidth:ot}=e.docView.measureTextSize();d=c.refresh(h,at,ot,st/ot,it),d&&(e.docView.minWidth=0,_|=8)}et>0&&tt>0?b=Math.max(et,tt):et<0&&tt<0&&(b=Math.min(et,tt)),c.heightChanged=!1;for(let at of this.viewports){let ot=at.from==this.viewport.from?it:e.docView.measureVisibleLineHeights(at);this.heightMap=this.heightMap.updateHeight(c,0,d,new MeasuredHeights(at.from,ot))}c.heightChanged&&(_|=2)}let rt=!this.viewportIsAppropriate(this.viewport,b)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return rt&&(this.viewport=this.getViewport(b,this.scrollTarget)),this.updateForViewport(),(_&2||rt)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(d?[]:this.lineGaps)),_|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),_}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,s){let a=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),c=this.heightMap,h=this.state.doc,{visibleTop:d,visibleBottom:g}=this,_=new Viewport(c.lineAt(d-a*1e3,QueryType$1.ByHeight,h,0,0).from,c.lineAt(g+(1-a)*1e3,QueryType$1.ByHeight,h,0,0).to);if(s){let{head:b}=s.range;if(b<_.from||b>_.to){let $=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),j=c.lineAt(b,QueryType$1.ByPos,h,0,0),_e;s.y=="center"?_e=(j.top+j.bottom)/2-$/2:s.y=="start"||s.y=="nearest"&&b<_.from?_e=j.top:_e=j.bottom-$,_=new Viewport(c.lineAt(_e-1e3/2,QueryType$1.ByHeight,h,0,0).from,c.lineAt(_e+$+1e3/2,QueryType$1.ByHeight,h,0,0).to)}}return _}mapViewport(e,s){let a=s.mapPos(e.from,-1),c=s.mapPos(e.to,1);return new Viewport(this.heightMap.lineAt(a,QueryType$1.ByPos,this.state.doc,0,0).from,this.heightMap.lineAt(c,QueryType$1.ByPos,this.state.doc,0,0).to)}viewportIsAppropriate({from:e,to:s},a=0){if(!this.inView)return!0;let{top:c}=this.heightMap.lineAt(e,QueryType$1.ByPos,this.state.doc,0,0),{bottom:h}=this.heightMap.lineAt(s,QueryType$1.ByPos,this.state.doc,0,0),{visibleTop:d,visibleBottom:g}=this;return(e==0||c<=d-Math.max(10,Math.min(-a,250)))&&(s==this.state.doc.length||h>=g+Math.max(10,Math.min(a,250)))&&c>d-2*1e3&&ha.from&&g.push({from:a.from,to:h}),d=a.from&&_.from<=a.to&&cutRange(g,_.from-10,_.from+10),!_.empty&&_.to>=a.from&&_.to<=a.to&&cutRange(g,_.to-10,_.to+10);for(let{from:b,to:$}of g)$-b>1e3&&s.push(find(e,j=>j.from>=a.from&&j.to<=a.to&&Math.abs(j.from-b)<1e3&&Math.abs(j.to-$)<1e3)||new LineGap(b,$,this.gapSize(a,b,$,c)))}return s}gapSize(e,s,a,c){let h=findFraction(c,a)-findFraction(c,s);return this.heightOracle.lineWrapping?e.height*h:c.total*this.heightOracle.charWidth*h}updateLineGaps(e){LineGap.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=Decoration.set(e.map(s=>s.draw(this.heightOracle.lineWrapping))))}computeVisibleRanges(){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let s=[];RangeSet.spans(e,this.viewport.from,this.viewport.to,{span(c,h){s.push({from:c,to:h})},point(){}},20);let a=s.length!=this.visibleRanges.length||this.visibleRanges.some((c,h)=>c.from!=s[h].from||c.to!=s[h].to);return this.visibleRanges=s,a?4:0}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(s=>s.from<=e&&s.to>=e)||scaleBlock(this.heightMap.lineAt(e,QueryType$1.ByPos,this.state.doc,0,0),this.scaler)}lineBlockAtHeight(e){return scaleBlock(this.heightMap.lineAt(this.scaler.fromDOM(e),QueryType$1.ByHeight,this.state.doc,0,0),this.scaler)}elementAtHeight(e){return scaleBlock(this.heightMap.blockAt(this.scaler.fromDOM(e),this.state.doc,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class Viewport{constructor(e,s){this.from=e,this.to=s}}function lineStructure(o,e,s){let a=[],c=o,h=0;return RangeSet.spans(s,o,e,{span(){},point(d,g){d>c&&(a.push({from:c,to:d}),h+=d-c),c=g}},20),c=1)return e[e.length-1].to;let a=Math.floor(o*s);for(let c=0;;c++){let{from:h,to:d}=e[c],g=d-h;if(a<=g)return h+a;a-=g}}function findFraction(o,e){let s=0;for(let{from:a,to:c}of o.ranges){if(e<=c){s+=e-a;break}s+=c-a}return s/o.total}function cutRange(o,e,s){for(let a=0;ae){let h=[];c.froms&&h.push({from:s,to:c.to}),o.splice(a,1,...h),a+=h.length-1}}}function find(o,e){for(let s of o)if(e(s))return s}const IdScaler={toDOM(o){return o},fromDOM(o){return o},scale:1};class BigScaler{constructor(e,s,a){let c=0,h=0,d=0;this.viewports=a.map(({from:g,to:_})=>{let b=s.lineAt(g,QueryType$1.ByPos,e,0,0).top,$=s.lineAt(_,QueryType$1.ByPos,e,0,0).bottom;return c+=$-b,{from:g,to:_,top:b,bottom:$,domTop:0,domBottom:0}}),this.scale=(7e6-c)/(s.height-c);for(let g of this.viewports)g.domTop=d+(g.top-h)*this.scale,d=g.domBottom=g.domTop+(g.bottom-g.top),h=g.bottom}toDOM(e){for(let s=0,a=0,c=0;;s++){let h=sscaleBlock(c,e)):o.type)}const theme=Facet.define({combine:o=>o.join(" ")}),darkTheme=Facet.define({combine:o=>o.indexOf(!0)>-1}),baseThemeID=StyleModule.newName(),baseLightID=StyleModule.newName(),baseDarkID=StyleModule.newName(),lightDarkIDs={"&light":"."+baseLightID,"&dark":"."+baseDarkID};function buildTheme(o,e,s){return new StyleModule(e,{finish(a){return/&/.test(a)?a.replace(/&\w*/,c=>{if(c=="&")return o;if(!s||!s[c])throw new RangeError(`Unsupported selector: ${c}`);return s[c]}):o+" "+a}})}const baseTheme$1$3=buildTheme("."+baseThemeID,{"&.cm-editor":{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},".cm-content":{margin:0,flexGrow:2,flexShrink:0,minHeight:"100%",display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",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 4px"},".cm-selectionLayer":{zIndex:-1,contain:"size style"},".cm-selectionBackground":{position:"absolute"},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{zIndex:100,contain:"size style",pointerEvents:"none"},"&.cm-focused .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":{position:"absolute",borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},"&.cm-focused .cm-cursor":{display:"block"},"&light .cm-activeLine":{backgroundColor:"#f3f9ff"},"&dark .cm-activeLine":{backgroundColor:"#223039"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",left: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},"&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"},".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"}},lightDarkIDs),observeOptions={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},useCharData=browser.ie&&browser.ie_version<=11;class DOMObserver{constructor(e,s,a){this.view=e,this.onChange=s,this.onScrollChanged=a,this.active=!1,this.selectionRange=new DOMSelectionState,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.scrollTargets=[],this.intersection=null,this.resize=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(c=>{for(let h of c)this.queue.push(h);(browser.ie&&browser.ie_version<=11||browser.ios&&e.composing)&&c.some(h=>h.type=="childList"&&h.removedNodes.length||h.type=="characterData"&&h.oldValue.length>h.target.nodeValue.length)?this.flushSoon():this.flush()}),useCharData&&(this.onCharData=c=>{this.queue.push({target:c.target,type:"characterData",oldValue:c.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),typeof ResizeObserver=="function"&&(this.resize=new ResizeObserver(()=>{this.view.docView.lastUpdate{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),c.length>0&&c[c.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(c=>{c.length>0&&c[c.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScroll(e){this.intersecting&&this.flush(!1),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(){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((s,a)=>s!=e[a]))){this.gapIntersection.disconnect();for(let s of e)this.gapIntersection.observe(s);this.gaps=e}}onSelectionChange(e){if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:s}=this,a=this.selectionRange;if(s.state.facet(editable)?s.root.activeElement!=this.dom:!hasSelection(s.dom,a))return;let c=a.anchorNode&&s.docView.nearest(a.anchorNode);c&&c.ignoreEvent(e)||((browser.ie&&browser.ie_version<=11||browser.android&&browser.chrome)&&!s.state.selection.main.empty&&a.focusNode&&isEquivalentPosition(a.focusNode,a.focusOffset,a.anchorNode,a.anchorOffset)?this.flushSoon():this.flush(!1))}readSelectionRange(){let{view:e}=this,s=browser.safari&&e.root.nodeType==11&&deepActiveElement()==this.dom&&safariSelectionRangeHack(this.view)||getSelection(e.root);if(!s||this.selectionRange.eq(s))return!1;let a=hasSelection(this.dom,s);return a&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let a=this.delayedAndroidKey;this.delayedAndroidKey=null,this.delayedFlush=-1,this.flush()||dispatchKey(this.dom,a.key,a.keyCode)}),(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:s})}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=window.setTimeout(()=>{this.delayedFlush=-1,this.flush()},20))}forceFlush(){this.delayedFlush>=0&&(window.clearTimeout(this.delayedFlush),this.delayedFlush=-1),this.flush()}processRecords(){let e=this.queue;for(let h of this.observer.takeRecords())e.push(h);e.length&&(this.queue=[]);let s=-1,a=-1,c=!1;for(let h of e){let d=this.readMutation(h);!d||(d.typeOver&&(c=!0),s==-1?{from:s,to:a}=d:(s=Math.min(d.from,s),a=Math.max(d.to,a)))}return{from:s,to:a,typeOver:c}}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return;e&&this.readSelectionRange();let{from:s,to:a,typeOver:c}=this.processRecords(),h=this.selectionChanged&&hasSelection(this.dom,this.selectionRange);if(s<0&&!h)return;this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let d=this.view.state,g=this.onChange(s,a,c);return this.view.state==d&&this.view.update([]),g}readMutation(e){let s=this.view.docView.nearest(e.target);if(!s||s.ignoreMutation(e))return null;if(s.markDirty(e.type=="attributes"),e.type=="attributes"&&(s.dirty|=4),e.type=="childList"){let a=findChild(s,e.previousSibling||e.target.previousSibling,-1),c=findChild(s,e.nextSibling||e.target.nextSibling,1);return{from:a?s.posAfter(a):s.posAtStart,to:c?s.posBefore(c):s.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:s.posAtStart,to:s.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),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),e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}destroy(){var e,s,a;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(s=this.gapIntersection)===null||s===void 0||s.disconnect(),(a=this.resize)===null||a===void 0||a.disconnect();for(let c of this.scrollTargets)c.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout)}}function findChild(o,e,s){for(;e;){let a=ContentView.get(e);if(a&&a.parent==o)return a;let c=e.parentNode;e=c!=o.dom?c:s>0?e.nextSibling:e.previousSibling}return null}function safariSelectionRangeHack(o){let e=null;function s(_){_.preventDefault(),_.stopImmediatePropagation(),e=_.getTargetRanges()[0]}if(o.contentDOM.addEventListener("beforeinput",s,!0),document.execCommand("indent"),o.contentDOM.removeEventListener("beforeinput",s,!0),!e)return null;let a=e.startContainer,c=e.startOffset,h=e.endContainer,d=e.endOffset,g=o.docView.domAtPos(o.state.selection.main.anchor);return isEquivalentPosition(g.node,g.offset,h,d)&&([a,c,h,d]=[h,d,a,c]),{anchorNode:a,anchorOffset:c,focusNode:h,focusOffset:d}}function applyDOMChange(o,e,s,a){let c,h,d=o.state.selection.main;if(e>-1){let g=o.docView.domBoundsAround(e,s,0);if(!g||o.state.readOnly)return!1;let{from:_,to:b}=g,$=o.docView.impreciseHead||o.docView.impreciseAnchor?[]:selectionPoints(o),j=new DOMReader($,o.state);j.readRange(g.startDOM,g.endDOM);let _e=d.from,et=null;(o.inputState.lastKeyCode===8&&o.inputState.lastKeyTime>Date.now()-100||browser.android&&j.text.length=d.from&&c.to<=d.to&&(c.from!=d.from||c.to!=d.to)&&d.to-d.from-(c.to-c.from)<=4?c={from:d.from,to:d.to,insert:o.state.doc.slice(d.from,c.from).append(c.insert).append(o.state.doc.slice(c.to,d.to))}:(browser.mac||browser.android)&&c&&c.from==c.to&&c.from==d.head-1&&c.insert.toString()=="."&&(c={from:d.from,to:d.to,insert:Text.of([" "])}),c){let g=o.state;if(browser.ios&&o.inputState.flushIOSKey(o)||browser.android&&(c.from==d.from&&c.to==d.to&&c.insert.length==1&&c.insert.lines==2&&dispatchKey(o.contentDOM,"Enter",13)||c.from==d.from-1&&c.to==d.to&&c.insert.length==0&&dispatchKey(o.contentDOM,"Backspace",8)||c.from==d.from&&c.to==d.to+1&&c.insert.length==0&&dispatchKey(o.contentDOM,"Delete",46)))return!0;let _=c.insert.toString();if(o.state.facet(inputHandler$1).some(j=>j(o,c.from,c.to,_)))return!0;o.inputState.composing>=0&&o.inputState.composing++;let b;if(c.from>=d.from&&c.to<=d.to&&c.to-c.from>=(d.to-d.from)/3&&(!h||h.main.empty&&h.main.from==c.from+c.insert.length)&&o.inputState.composing<0){let j=d.fromc.to?g.sliceDoc(c.to,d.to):"";b=g.replaceSelection(o.state.toText(j+c.insert.sliceString(0,void 0,o.state.lineBreak)+_e))}else{let j=g.changes(c),_e=h&&!g.selection.main.eq(h.main)&&h.main.to<=j.newLength?h.main:void 0;if(g.selection.ranges.length>1&&o.inputState.composing>=0&&c.to<=d.to&&c.to>=d.to-10){let et=o.state.sliceDoc(c.from,c.to),tt=compositionSurroundingNode(o)||o.state.doc.lineAt(d.head),nt=d.to-c.to,st=d.to-d.from;b=g.changeByRange(rt=>{if(rt.from==d.from&&rt.to==d.to)return{changes:j,range:_e||rt.map(j)};let it=rt.to-nt,at=it-et.length;if(rt.to-rt.from!=st||o.state.sliceDoc(at,it)!=et||tt&&rt.to>=tt.from&&rt.from<=tt.to)return{range:rt};let ot=g.changes({from:at,to:it,insert:c.insert}),ut=rt.to-d.to;return{changes:ot,range:_e?EditorSelection.range(Math.max(0,_e.anchor+ut),Math.max(0,_e.head+ut)):rt.map(ot)}})}else b={changes:j,selection:_e&&g.selection.replaceRange(_e)}}let $="input.type";return o.composing&&($+=".compose",o.inputState.compositionFirstChange&&($+=".start",o.inputState.compositionFirstChange=!1)),o.dispatch(b,{scrollIntoView:!0,userEvent:$}),!0}else if(h&&!h.main.eq(d)){let g=!1,_="select";return o.inputState.lastSelectionTime>Date.now()-50&&(o.inputState.lastSelectionOrigin=="select"&&(g=!0),_=o.inputState.lastSelectionOrigin),o.dispatch({selection:h,scrollIntoView:g,userEvent:_}),!0}else return!1}function findDiff(o,e,s,a){let c=Math.min(o.length,e.length),h=0;for(;h0&&g>0&&o.charCodeAt(d-1)==e.charCodeAt(g-1);)d--,g--;if(a=="end"){let _=Math.max(0,h-Math.min(d,g));s-=d+_-h}return d=d?h-s:0,g=h+(g-d),d=h):g=g?h-s:0,d=h+(d-g),g=h),{from:h,toA:d,toB:g}}function selectionPoints(o){let e=[];if(o.root.activeElement!=o.contentDOM)return e;let{anchorNode:s,anchorOffset:a,focusNode:c,focusOffset:h}=o.observer.selectionRange;return s&&(e.push(new DOMPoint(s,a)),(c!=s||h!=a)&&e.push(new DOMPoint(c,h))),e}function selectionFromPoints(o,e){if(o.length==0)return null;let s=o[0].pos,a=o.length==2?o[1].pos:s;return s>-1&&a>-1?EditorSelection.single(s+e,a+e):null}class EditorView{constructor(e={}){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.style.cssText="position: absolute; top: -10000px",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),this._dispatch=e.dispatch||(s=>this.update([s])),this.dispatch=this.dispatch.bind(this),this._root=e.root||getRoot(e.parent)||document,this.viewState=new ViewState(e.state||EditorState.create(e)),this.plugins=this.state.facet(viewPlugin).map(s=>new PluginInstance(s));for(let s of this.plugins)s.update(this);this.observer=new DOMObserver(this,(s,a,c)=>applyDOMChange(this,s,a,c),s=>{this.inputState.runScrollHandlers(this,s),this.observer.intersecting&&this.measure()}),this.inputState=new InputState(this),this.inputState.ensureHandlers(this,this.plugins),this.docView=new DocView(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),e.parent&&e.parent.appendChild(this.dom)}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}dispatch(...e){this._dispatch(e.length==1&&e[0]instanceof Transaction?e[0]:this.state.update(...e))}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let s=!1,a=!1,c,h=this.state;for(let g of e){if(g.startState!=h)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");h=g.state}if(this.destroyed){this.viewState.state=h;return}if(this.observer.clear(),h.facet(EditorState.phrases)!=this.state.facet(EditorState.phrases))return this.setState(h);c=ViewUpdate.create(this,h,e);let d=this.viewState.scrollTarget;try{this.updateState=2;for(let g of e){if(d&&(d=d.map(g.changes)),g.scrollIntoView){let{main:_}=g.state.selection;d=new ScrollTarget(_.empty?_:EditorSelection.cursor(_.head,_.head>_.anchor?-1:1))}for(let _ of g.effects)_.is(scrollIntoView$1)&&(d=_.value)}this.viewState.update(c,d),this.bidiCache=CachedOrder.update(this.bidiCache,c.changes),c.empty||(this.updatePlugins(c),this.inputState.update(c)),s=this.docView.update(c),this.state.facet(styleModule)!=this.styleModules&&this.mountStyles(),a=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(s,e.some(g=>g.isUserEvent("select.pointer")))}finally{this.updateState=0}if(c.startState.facet(theme)!=c.state.facet(theme)&&(this.viewState.mustMeasureContent=!0),(s||a||d||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),!c.empty)for(let g of this.state.facet(updateListener))g(c)}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 s=this.hasFocus;try{for(let a of this.plugins)a.destroy(this);this.viewState=new ViewState(e),this.plugins=e.facet(viewPlugin).map(a=>new PluginInstance(a)),this.pluginMap.clear();for(let a of this.plugins)a.update(this);this.docView=new DocView(this),this.inputState.ensureHandlers(this,this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}s&&this.focus(),this.requestMeasure()}updatePlugins(e){let s=e.startState.facet(viewPlugin),a=e.state.facet(viewPlugin);if(s!=a){let c=[];for(let h of a){let d=s.indexOf(h);if(d<0)c.push(new PluginInstance(h));else{let g=this.plugins[d];g.mustUpdate=e,c.push(g)}}for(let h of this.plugins)h.mustUpdate!=e&&h.destroy(this);this.plugins=c,this.pluginMap.clear(),this.inputState.ensureHandlers(this,this.plugins)}else for(let c of this.plugins)c.mustUpdate=e;for(let c=0;c-1&&cancelAnimationFrame(this.measureScheduled),this.measureScheduled=0,e&&this.observer.forceFlush();let s=null,{scrollHeight:a,scrollTop:c,clientHeight:h}=this.scrollDOM,d=c>a-h-4?a:c;try{for(let g=0;;g++){this.updateState=1;let _=this.viewport,b=this.viewState.lineBlockAtHeight(d),$=this.viewState.measure(this);if(!$&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(g>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let j=[];$&4||([this.measureRequests,j]=[j,this.measureRequests]);let _e=j.map(st=>{try{return st.read(this)}catch(rt){return logException(this.state,rt),BadMeasure}}),et=ViewUpdate.create(this,this.state,[]),tt=!1,nt=!1;et.flags|=$,s?s.flags|=$:s=et,this.updateState=2,et.empty||(this.updatePlugins(et),this.inputState.update(et),this.updateAttrs(),tt=this.docView.update(et));for(let st=0;st1||st<-1)&&(this.scrollDOM.scrollTop+=st,nt=!0)}if(tt&&this.docView.updateSelection(!0),this.viewport.from==_.from&&this.viewport.to==_.to&&!nt&&this.measureRequests.length==0)break}}finally{this.updateState=0,this.measureScheduled=-1}if(s&&!s.empty)for(let g of this.state.facet(updateListener))g(s)}get themeClasses(){return baseThemeID+" "+(this.state.facet(darkTheme)?baseDarkID:baseLightID)+" "+this.state.facet(theme)}updateAttrs(){let e=attrsFromFacet(this,editorAttributes,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),s={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(editable)?"true":"false",class:"cm-content",style:`${browser.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(s["aria-readonly"]="true"),attrsFromFacet(this,contentAttributes,s);let a=this.observer.ignore(()=>{let c=updateAttrs(this.contentDOM,this.contentAttrs,s),h=updateAttrs(this.dom,this.editorAttrs,e);return c||h});return this.editorAttrs=e,this.contentAttrs=s,a}showAnnouncements(e){let s=!0;for(let a of e)for(let c of a.effects)if(c.is(EditorView.announce)){s&&(this.announceDOM.textContent=""),s=!1;let h=this.announceDOM.appendChild(document.createElement("div"));h.textContent=c.value}}mountStyles(){this.styleModules=this.state.facet(styleModule),StyleModule.mount(this.root,this.styleModules.concat(baseTheme$1$3).reverse())}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=requestAnimationFrame(()=>this.measure())),e){if(e.key!=null){for(let s=0;sa.spec==e)||null),s&&s.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}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,s,a){return skipAtoms(this,e,moveByChar(this,e,s,a))}moveByGroup(e,s){return skipAtoms(this,e,moveByChar(this,e,s,a=>byGroup(this,e.head,a)))}moveToLineBoundary(e,s,a=!0){return moveToLineBoundary(this,e,s,a)}moveVertically(e,s,a){return skipAtoms(this,e,moveVertically(this,e,s,a))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,s=0){return this.docView.posFromDOM(e,s)}posAtCoords(e,s=!0){return this.readMeasured(),posAtCoords(this,e,s)}coordsAtPos(e,s=1){this.readMeasured();let a=this.docView.coordsAt(e,s);if(!a||a.left==a.right)return a;let c=this.state.doc.lineAt(e),h=this.bidiSpans(c),d=h[BidiSpan.find(h,e-c.from,-1,s)];return flattenRect(a,d.dir==Direction.LTR==s>0)}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(perLineTextDirection)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>MaxBidiLine)return trivialOrder(e.length);let s=this.textDirectionAt(e.from);for(let c of this.bidiCache)if(c.from==e.from&&c.dir==s)return c.order;let a=computeOrder(e.text,s);return this.bidiCache.push(new CachedOrder(e.from,e.to,s,a)),a}get hasFocus(){var e;return(document.hasFocus()||browser.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{focusPreventScroll(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView),this.mountStyles())}destroy(){for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,s={}){return scrollIntoView$1.of(new ScrollTarget(typeof e=="number"?EditorSelection.cursor(e):e,s.y,s.x,s.yMargin,s.xMargin))}static domEventHandlers(e){return ViewPlugin.define(()=>({}),{eventHandlers:e})}static theme(e,s){let a=StyleModule.newName(),c=[theme.of(a),styleModule.of(buildTheme(`.${a}`,e))];return s&&s.dark&&c.push(darkTheme.of(!0)),c}static baseTheme(e){return Prec.lowest(styleModule.of(buildTheme("."+baseThemeID,e,lightDarkIDs)))}static findFromDOM(e){var s;let a=e.querySelector(".cm-content"),c=a&&ContentView.get(a)||ContentView.get(e);return((s=c==null?void 0:c.rootView)===null||s===void 0?void 0:s.view)||null}}EditorView.styleModule=styleModule;EditorView.inputHandler=inputHandler$1;EditorView.perLineTextDirection=perLineTextDirection;EditorView.exceptionSink=exceptionSink;EditorView.updateListener=updateListener;EditorView.editable=editable;EditorView.mouseSelectionStyle=mouseSelectionStyle;EditorView.dragMovesSelection=dragMovesSelection$1;EditorView.clickAddsSelectionRange=clickAddsSelectionRange;EditorView.decorations=decorations;EditorView.atomicRanges=atomicRanges;EditorView.scrollMargins=scrollMargins;EditorView.darkTheme=darkTheme;EditorView.contentAttributes=contentAttributes;EditorView.editorAttributes=editorAttributes;EditorView.lineWrapping=EditorView.contentAttributes.of({class:"cm-lineWrapping"});EditorView.announce=StateEffect.define();const MaxBidiLine=4096,BadMeasure={};class CachedOrder{constructor(e,s,a,c){this.from=e,this.to=s,this.dir=a,this.order=c}static update(e,s){if(s.empty)return e;let a=[],c=e.length?e[e.length-1].dir:Direction.LTR;for(let h=Math.max(0,e.length-10);h=0;c--){let h=a[c],d=typeof h=="function"?h(o):h;d&&combineAttrs(d,s)}return s}const currentPlatform=browser.mac?"mac":browser.windows?"win":browser.linux?"linux":"key";function normalizeKeyName(o,e){const s=o.split(/-(?!$)/);let a=s[s.length-1];a=="Space"&&(a=" ");let c,h,d,g;for(let _=0;_a.concat(c),[]))),s}function runScopeHandlers(o,e,s){return runHandlers(getKeymap(o.state),e,o,s)}let storedPrefix=null;const PrefixTimeout=4e3;function buildKeymap(o,e=currentPlatform){let s=Object.create(null),a=Object.create(null),c=(d,g)=>{let _=a[d];if(_==null)a[d]=g;else if(_!=g)throw new Error("Key binding "+d+" is used both as a regular binding and as a multi-stroke prefix")},h=(d,g,_,b)=>{let $=s[d]||(s[d]=Object.create(null)),j=g.split(/ (?!$)/).map(tt=>normalizeKeyName(tt,e));for(let tt=1;tt{let rt=storedPrefix={view:st,prefix:nt,scope:d};return setTimeout(()=>{storedPrefix==rt&&(storedPrefix=null)},PrefixTimeout),!0}]})}let _e=j.join(" ");c(_e,!1);let et=$[_e]||($[_e]={preventDefault:!1,commands:[]});et.commands.push(_),b&&(et.preventDefault=!0)};for(let d of o){let g=d[e]||d.key;if(!!g)for(let _ of d.scope?d.scope.split(" "):["editor"])h(_,g,d.run,d.preventDefault),d.shift&&h(_,"Shift-"+g,d.shift,d.preventDefault)}return s}function runHandlers(o,e,s,a){let c=keyName(e),h=codePointAt(c,0),d=codePointSize(h)==c.length&&c!=" ",g="",_=!1;storedPrefix&&storedPrefix.view==s&&storedPrefix.scope==a&&(g=storedPrefix.prefix+" ",(_=modifierCodes.indexOf(e.keyCode)<0)&&(storedPrefix=null));let b=_e=>{if(_e){for(let et of _e.commands)if(et(s))return!0;_e.preventDefault&&(_=!0)}return!1},$=o[a],j;if($){if(b($[g+modifiers(c,e,!d)]))return!0;if(d&&(e.shiftKey||e.altKey||e.metaKey||h>127)&&(j=base[e.keyCode])&&j!=c){if(b($[g+modifiers(j,e,!0)]))return!0;if(e.shiftKey&&shift[e.keyCode]!=j&&b($[g+modifiers(shift[e.keyCode],e,!1)]))return!0}else if(d&&e.shiftKey&&b($[g+modifiers(c,e,!0)]))return!0}return _}const CanHidePrimary=!browser.ios,selectionConfig=Facet.define({combine(o){return combineConfig(o,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,s)=>Math.min(e,s),drawRangeCursor:(e,s)=>e||s})}});function drawSelection(o={}){return[selectionConfig.of(o),drawSelectionPlugin,hideNativeSelection]}class Piece{constructor(e,s,a,c,h){this.left=e,this.top=s,this.width=a,this.height=c,this.className=h}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width>=0&&(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}}const drawSelectionPlugin=ViewPlugin.fromClass(class{constructor(o){this.view=o,this.rangePieces=[],this.cursors=[],this.measureReq={read:this.readPos.bind(this),write:this.drawSel.bind(this)},this.selectionLayer=o.scrollDOM.appendChild(document.createElement("div")),this.selectionLayer.className="cm-selectionLayer",this.selectionLayer.setAttribute("aria-hidden","true"),this.cursorLayer=o.scrollDOM.appendChild(document.createElement("div")),this.cursorLayer.className="cm-cursorLayer",this.cursorLayer.setAttribute("aria-hidden","true"),o.requestMeasure(this.measureReq),this.setBlinkRate()}setBlinkRate(){this.cursorLayer.style.animationDuration=this.view.state.facet(selectionConfig).cursorBlinkRate+"ms"}update(o){let e=o.startState.facet(selectionConfig)!=o.state.facet(selectionConfig);(e||o.selectionSet||o.geometryChanged||o.viewportChanged)&&this.view.requestMeasure(this.measureReq),o.transactions.some(s=>s.scrollIntoView)&&(this.cursorLayer.style.animationName=this.cursorLayer.style.animationName=="cm-blink"?"cm-blink2":"cm-blink"),e&&this.setBlinkRate()}readPos(){let{state:o}=this.view,e=o.facet(selectionConfig),s=o.selection.ranges.map(c=>c.empty?[]:measureRange(this.view,c)).reduce((c,h)=>c.concat(h)),a=[];for(let c of o.selection.ranges){let h=c==o.selection.main;if(c.empty?!h||CanHidePrimary:e.drawRangeCursor){let d=measureCursor(this.view,c,h);d&&a.push(d)}}return{rangePieces:s,cursors:a}}drawSel({rangePieces:o,cursors:e}){if(o.length!=this.rangePieces.length||o.some((s,a)=>!s.eq(this.rangePieces[a]))){this.selectionLayer.textContent="";for(let s of o)this.selectionLayer.appendChild(s.draw());this.rangePieces=o}if(e.length!=this.cursors.length||e.some((s,a)=>!s.eq(this.cursors[a]))){let s=this.cursorLayer.children;if(s.length!==e.length){this.cursorLayer.textContent="";for(const a of e)this.cursorLayer.appendChild(a.draw())}else e.forEach((a,c)=>a.adjust(s[c]));this.cursors=e}}destroy(){this.selectionLayer.remove(),this.cursorLayer.remove()}}),themeSpec={".cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"}}};CanHidePrimary&&(themeSpec[".cm-line"].caretColor="transparent !important");const hideNativeSelection=Prec.highest(EditorView.theme(themeSpec));function getBase(o){let e=o.scrollDOM.getBoundingClientRect();return{left:(o.textDirection==Direction.LTR?e.left:e.right-o.scrollDOM.clientWidth)-o.scrollDOM.scrollLeft,top:e.top-o.scrollDOM.scrollTop}}function wrappedLine(o,e,s){let a=EditorSelection.cursor(e);return{from:Math.max(s.from,o.moveToLineBoundary(a,!1,!0).from),to:Math.min(s.to,o.moveToLineBoundary(a,!0,!0).from),type:BlockType.Text}}function blockAt(o,e){let s=o.lineBlockAt(e);if(Array.isArray(s.type)){for(let a of s.type)if(a.to>e||a.to==e&&(a.to==s.to||a.type==BlockType.Text))return a}return s}function measureRange(o,e){if(e.to<=o.viewport.from||e.from>=o.viewport.to)return[];let s=Math.max(e.from,o.viewport.from),a=Math.min(e.to,o.viewport.to),c=o.textDirection==Direction.LTR,h=o.contentDOM,d=h.getBoundingClientRect(),g=getBase(o),_=window.getComputedStyle(h.firstChild),b=d.left+parseInt(_.paddingLeft)+Math.min(0,parseInt(_.textIndent)),$=d.right-parseInt(_.paddingRight),j=blockAt(o,s),_e=blockAt(o,a),et=j.type==BlockType.Text?j:null,tt=_e.type==BlockType.Text?_e:null;if(o.lineWrapping&&(et&&(et=wrappedLine(o,s,et)),tt&&(tt=wrappedLine(o,a,tt))),et&&tt&&et.from==tt.from)return st(rt(e.from,e.to,et));{let at=et?rt(e.from,null,et):it(j,!1),ot=tt?rt(null,e.to,tt):it(_e,!0),ut=[];return(et||j).to<(tt||_e).from-1?ut.push(nt(b,at.bottom,$,ot.top)):at.bottomft&&yt.from=Et)break;dt>mt&&pt(Math.max(At,mt),at==null&&At<=ft,Math.min(dt,Et),ot==null&&dt>=gt,St.dir)}if(mt=Ot.to+1,mt>=Et)break}return lt.length==0&&pt(ft,at==null,gt,ot==null,o.textDirection),{top:ct,bottom:ht,horizontal:lt}}function it(at,ot){let ut=d.top+(ot?at.top:at.bottom);return{top:ut,bottom:ut,horizontal:[]}}}function measureCursor(o,e,s){let a=o.coordsAtPos(e.head,e.assoc||1);if(!a)return null;let c=getBase(o);return new Piece(a.left-c.left,a.top-c.top,-1,a.bottom-a.top,s?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary")}const setDropCursorPos=StateEffect.define({map(o,e){return o==null?null:e.mapPos(o)}}),dropCursorPos=StateField.define({create(){return null},update(o,e){return o!=null&&(o=e.changes.mapPos(o)),e.effects.reduce((s,a)=>a.is(setDropCursorPos)?a.value:s,o)}}),drawDropCursor=ViewPlugin.fromClass(class{constructor(o){this.view=o,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(o){var e;let s=o.state.field(dropCursorPos);s==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"),(o.startState.field(dropCursorPos)!=s||o.docChanged||o.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let o=this.view.state.field(dropCursorPos),e=o!=null&&this.view.coordsAtPos(o);if(!e)return null;let s=this.view.scrollDOM.getBoundingClientRect();return{left:e.left-s.left+this.view.scrollDOM.scrollLeft,top:e.top-s.top+this.view.scrollDOM.scrollTop,height:e.bottom-e.top}}drawCursor(o){this.cursor&&(o?(this.cursor.style.left=o.left+"px",this.cursor.style.top=o.top+"px",this.cursor.style.height=o.height+"px"):this.cursor.style.left="-100000px")}destroy(){this.cursor&&this.cursor.remove()}setDropPos(o){this.view.state.field(dropCursorPos)!=o&&this.view.dispatch({effects:setDropCursorPos.of(o)})}},{eventHandlers:{dragover(o){this.setDropPos(this.view.posAtCoords({x:o.clientX,y:o.clientY}))},dragleave(o){(o.target==this.view.contentDOM||!this.view.contentDOM.contains(o.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function dropCursor(){return[dropCursorPos,drawDropCursor]}function iterMatches(o,e,s,a,c){e.lastIndex=0;for(let h=o.iterRange(s,a),d=s,g;!h.next().done;d+=h.value.length)if(!h.lineBreak)for(;g=e.exec(h.value);)c(d+g.index,g)}function matchRanges(o,e){let s=o.visibleRanges;if(s.length==1&&s[0].from==o.viewport.from&&s[0].to==o.viewport.to)return s;let a=[];for(let{from:c,to:h}of s)c=Math.max(o.state.doc.lineAt(c).from,c-e),h=Math.min(o.state.doc.lineAt(h).to,h+e),a.length&&a[a.length-1].to>=c?a[a.length-1].to=h:a.push({from:c,to:h});return a}class MatchDecorator{constructor(e){const{regexp:s,decoration:a,decorate:c,boundary:h,maxLength:d=1e3}=e;if(!s.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=s,c)this.addMatch=(g,_,b,$)=>c($,b,b+g[0].length,g,_);else if(a){let g=typeof a=="function"?a:()=>a;this.addMatch=(_,b,$,j)=>j($,$+_[0].length,g(_,b,$))}else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=h,this.maxLength=d}createDeco(e){let s=new RangeSetBuilder,a=s.add.bind(s);for(let{from:c,to:h}of matchRanges(e,this.maxLength))iterMatches(e.state.doc,this.regexp,c,h,(d,g)=>this.addMatch(g,e,d,a));return s.finish()}updateDeco(e,s){let a=1e9,c=-1;return e.docChanged&&e.changes.iterChanges((h,d,g,_)=>{_>e.view.viewport.from&&g1e3?this.createDeco(e.view):c>-1?this.updateRange(e.view,s.map(e.changes),a,c):s}updateRange(e,s,a,c){for(let h of e.visibleRanges){let d=Math.max(h.from,a),g=Math.min(h.to,c);if(g>d){let _=e.state.doc.lineAt(d),b=_.to_.from;d--)if(this.boundary.test(_.text[d-1-_.from])){$=d;break}for(;g_e.push(rt.range(nt,st));if(_==b)for(this.regexp.lastIndex=$-_.from;(et=this.regexp.exec(_.text))&&et.indexthis.addMatch(st,e,nt,tt));s=s.update({filterFrom:$,filterTo:j,filter:(nt,st)=>nt<$||st>j,add:_e})}}return s}}const UnicodeRegexpSupport=/x/.unicode!=null?"gu":"g",Specials=new RegExp(`[\0-\b -\x7F-\x9F\xAD\u061C\u200B\u200E\u200F\u2028\u2029\u202D\u202E\u2066\u2067\u2069\uFEFF\uFFF9-\uFFFC]`,UnicodeRegexpSupport),Names={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 _supportsTabSize=null;function supportsTabSize(){var o;if(_supportsTabSize==null&&typeof document<"u"&&document.body){let e=document.body.style;_supportsTabSize=((o=e.tabSize)!==null&&o!==void 0?o:e.MozTabSize)!=null}return _supportsTabSize||!1}const specialCharConfig=Facet.define({combine(o){let e=combineConfig(o,{render:null,specialChars:Specials,addSpecialChars:null});return(e.replaceTabs=!supportsTabSize())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,UnicodeRegexpSupport)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,UnicodeRegexpSupport)),e}});function highlightSpecialChars(o={}){return[specialCharConfig.of(o),specialCharPlugin()]}let _plugin=null;function specialCharPlugin(){return _plugin||(_plugin=ViewPlugin.fromClass(class{constructor(o){this.view=o,this.decorations=Decoration.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(o.state.facet(specialCharConfig)),this.decorations=this.decorator.createDeco(o)}makeDecorator(o){return new MatchDecorator({regexp:o.specialChars,decoration:(e,s,a)=>{let{doc:c}=s.state,h=codePointAt(e[0],0);if(h==9){let d=c.lineAt(a),g=s.state.tabSize,_=countColumn(d.text,g,a-d.from);return Decoration.replace({widget:new TabWidget((g-_%g)*this.view.defaultCharacterWidth)})}return this.decorationCache[h]||(this.decorationCache[h]=Decoration.replace({widget:new SpecialCharWidget(o,h)}))},boundary:o.replaceTabs?void 0:/[^]/})}update(o){let e=o.state.facet(specialCharConfig);o.startState.facet(specialCharConfig)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(o.view)):this.decorations=this.decorator.updateDeco(o,this.decorations)}},{decorations:o=>o.decorations}))}const DefaultPlaceholder="\u2022";function placeholder$1(o){return o>=32?DefaultPlaceholder:o==10?"\u2424":String.fromCharCode(9216+o)}class SpecialCharWidget extends WidgetType{constructor(e,s){super(),this.options=e,this.code=s}eq(e){return e.code==this.code}toDOM(e){let s=placeholder$1(this.code),a=e.state.phrase("Control character")+" "+(Names[this.code]||"0x"+this.code.toString(16)),c=this.options.render&&this.options.render(this.code,a,s);if(c)return c;let h=document.createElement("span");return h.textContent=s,h.title=a,h.setAttribute("aria-label",a),h.className="cm-specialChar",h}ignoreEvent(){return!1}}class TabWidget extends WidgetType{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 highlightActiveLine(){return activeLineHighlighter}const lineDeco=Decoration.line({class:"cm-activeLine"}),activeLineHighlighter=ViewPlugin.fromClass(class{constructor(o){this.decorations=this.getDeco(o)}update(o){(o.docChanged||o.selectionSet)&&(this.decorations=this.getDeco(o.view))}getDeco(o){let e=-1,s=[];for(let a of o.state.selection.ranges){if(!a.empty)return Decoration.none;let c=o.lineBlockAt(a.head);c.from>e&&(s.push(lineDeco.range(c.from)),e=c.from)}return Decoration.set(s)}},{decorations:o=>o.decorations});class Placeholder extends WidgetType{constructor(e){super(),this.content=e}toDOM(){let e=document.createElement("span");return e.className="cm-placeholder",e.style.pointerEvents="none",e.appendChild(typeof this.content=="string"?document.createTextNode(this.content):this.content),typeof this.content=="string"?e.setAttribute("aria-label","placeholder "+this.content):e.setAttribute("aria-hidden","true"),e}ignoreEvent(){return!1}}function placeholder(o){return ViewPlugin.fromClass(class{constructor(e){this.view=e,this.placeholder=Decoration.set([Decoration.widget({widget:new Placeholder(o),side:1}).range(0)])}get decorations(){return this.view.state.doc.length?Decoration.none:this.placeholder}},{decorations:e=>e.decorations})}const MaxOff=2e3;function rectangleFor(o,e,s){let a=Math.min(e.line,s.line),c=Math.max(e.line,s.line),h=[];if(e.off>MaxOff||s.off>MaxOff||e.col<0||s.col<0){let d=Math.min(e.off,s.off),g=Math.max(e.off,s.off);for(let _=a;_<=c;_++){let b=o.doc.line(_);b.length<=g&&h.push(EditorSelection.range(b.from+d,b.to+g))}}else{let d=Math.min(e.col,s.col),g=Math.max(e.col,s.col);for(let _=a;_<=c;_++){let b=o.doc.line(_),$=findColumn(b.text,d,o.tabSize,!0);if($>-1){let j=findColumn(b.text,g,o.tabSize);h.push(EditorSelection.range(b.from+$,b.from+j))}}}return h}function absoluteColumn(o,e){let s=o.coordsAtPos(o.viewport.from);return s?Math.round(Math.abs((s.left-e)/o.defaultCharacterWidth)):-1}function getPos(o,e){let s=o.posAtCoords({x:e.clientX,y:e.clientY},!1),a=o.state.doc.lineAt(s),c=s-a.from,h=c>MaxOff?-1:c==a.length?absoluteColumn(o,e.clientX):countColumn(a.text,o.state.tabSize,s-a.from);return{line:a.number,col:h,off:c}}function rectangleSelectionStyle(o,e){let s=getPos(o,e),a=o.state.selection;return s?{update(c){if(c.docChanged){let h=c.changes.mapPos(c.startState.doc.line(s.line).from),d=c.state.doc.lineAt(h);s={line:d.number,col:s.col,off:Math.min(s.off,d.length)},a=a.map(c.changes)}},get(c,h,d){let g=getPos(o,c);if(!g)return a;let _=rectangleFor(o.state,s,g);return _.length?d?EditorSelection.create(_.concat(a.ranges)):EditorSelection.create(_):a}}:null}function rectangularSelection(o){let e=(o==null?void 0:o.eventFilter)||(s=>s.altKey&&s.button==0);return EditorView.mouseSelectionStyle.of((s,a)=>e(a)?rectangleSelectionStyle(s,a):null)}const keys={Alt:[18,o=>o.altKey],Control:[17,o=>o.ctrlKey],Shift:[16,o=>o.shiftKey],Meta:[91,o=>o.metaKey]},showCrosshair={style:"cursor: crosshair"};function crosshairCursor(o={}){let[e,s]=keys[o.key||"Alt"],a=ViewPlugin.fromClass(class{constructor(c){this.view=c,this.isDown=!1}set(c){this.isDown!=c&&(this.isDown=c,this.view.update([]))}},{eventHandlers:{keydown(c){this.set(c.keyCode==e||s(c))},keyup(c){(c.keyCode==e||!s(c))&&this.set(!1)}}});return[a,EditorView.contentAttributes.of(c=>{var h;return!((h=c.plugin(a))===null||h===void 0)&&h.isDown?showCrosshair:null})]}const Outside="-10000px";class TooltipViewManager{constructor(e,s,a){this.facet=s,this.createTooltipView=a,this.input=e.state.facet(s),this.tooltips=this.input.filter(c=>c),this.tooltipViews=this.tooltips.map(a)}update(e){let s=e.state.facet(this.facet),a=s.filter(h=>h);if(s===this.input){for(let h of this.tooltipViews)h.update&&h.update(e);return!1}let c=[];for(let h=0;h{var e,s,a;return{position:browser.ios?"absolute":((e=o.find(c=>c.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((s=o.find(c=>c.parent))===null||s===void 0?void 0:s.parent)||null,tooltipSpace:((a=o.find(c=>c.tooltipSpace))===null||a===void 0?void 0:a.tooltipSpace)||windowSpace}}}),tooltipPlugin=ViewPlugin.fromClass(class{constructor(o){var e;this.view=o,this.inView=!0,this.lastTransaction=0,this.measureTimeout=-1;let s=o.state.facet(tooltipConfig);this.position=s.position,this.parent=s.parent,this.classes=o.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.manager=new TooltipViewManager(o,showTooltip,a=>this.createTooltip(a)),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(a=>{Date.now()>this.lastTransaction-50&&a.length>0&&a[a.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),(e=o.dom.ownerDocument.defaultView)===null||e===void 0||e.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 o of this.manager.tooltipViews)this.intersectionObserver.observe(o.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(o){o.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(o);e&&this.observeIntersection();let s=e||o.geometryChanged,a=o.state.facet(tooltipConfig);if(a.position!=this.position){this.position=a.position;for(let c of this.manager.tooltipViews)c.dom.style.position=this.position;s=!0}if(a.parent!=this.parent){this.parent&&this.container.remove(),this.parent=a.parent,this.createContainer();for(let c of this.manager.tooltipViews)this.container.appendChild(c.dom);s=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);s&&this.maybeMeasure()}createTooltip(o){let e=o.create(this.view);if(e.dom.classList.add("cm-tooltip"),o.arrow&&!e.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let s=document.createElement("div");s.className="cm-tooltip-arrow",e.dom.appendChild(s)}return e.dom.style.position=this.position,e.dom.style.top=Outside,this.container.appendChild(e.dom),e.mount&&e.mount(this.view),e}destroy(){var o,e;(o=this.view.dom.ownerDocument.defaultView)===null||o===void 0||o.removeEventListener("resize",this.measureSoon);for(let{dom:s}of this.manager.tooltipViews)s.remove();(e=this.intersectionObserver)===null||e===void 0||e.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let o=this.view.dom.getBoundingClientRect();return{editor:o,parent:this.parent?this.container.getBoundingClientRect():o,pos:this.manager.tooltips.map((e,s)=>{let a=this.manager.tooltipViews[s];return a.getCoords?a.getCoords(e.pos):this.view.coordsAtPos(e.pos)}),size:this.manager.tooltipViews.map(({dom:e})=>e.getBoundingClientRect()),space:this.view.state.facet(tooltipConfig).tooltipSpace(this.view)}}writeMeasure(o){let{editor:e,space:s}=o,a=[];for(let c=0;c=Math.min(e.bottom,s.bottom)||_.rightMath.min(e.right,s.right)+.1){g.style.top=Outside;continue}let $=h.arrow?d.dom.querySelector(".cm-tooltip-arrow"):null,j=$?7:0,_e=b.right-b.left,et=b.bottom-b.top,tt=d.offset||noOffset,nt=this.view.textDirection==Direction.LTR,st=b.width>s.right-s.left?nt?s.left:s.right-b.width:nt?Math.min(_.left-($?14:0)+tt.x,s.right-_e):Math.max(s.left,_.left-_e+($?14:0)-tt.x),rt=!!h.above;!h.strictSide&&(rt?_.top-(b.bottom-b.top)-tt.ys.bottom)&&rt==s.bottom-_.bottom>_.top-s.top&&(rt=!rt);let it=rt?_.top-et-j-tt.y:_.bottom+j+tt.y,at=st+_e;if(d.overlap!==!0)for(let ot of a)ot.leftst&&ot.topit&&(it=rt?ot.top-et-2-j:ot.bottom+j+2);this.position=="absolute"?(g.style.top=it-o.parent.top+"px",g.style.left=st-o.parent.left+"px"):(g.style.top=it+"px",g.style.left=st+"px"),$&&($.style.left=`${_.left+(nt?tt.x:-tt.x)-(st+14-7)}px`),d.overlap!==!0&&a.push({left:st,top:it,right:at,bottom:it+et}),g.classList.toggle("cm-tooltip-above",rt),g.classList.toggle("cm-tooltip-below",!rt),d.positioned&&d.positioned()}}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 o of this.manager.tooltipViews)o.dom.style.top=Outside}},{eventHandlers:{scroll(){this.maybeMeasure()}}}),baseTheme$4=EditorView.baseTheme({".cm-tooltip":{zIndex:100},"&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:`${7}px`,width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:`${7}px solid transparent`,borderRight:`${7}px solid transparent`},".cm-tooltip-above &":{bottom:`-${7}px`,"&:before":{borderTop:`${7}px solid #bbb`},"&:after":{borderTop:`${7}px solid #f5f5f5`,bottom:"1px"}},".cm-tooltip-below &":{top:`-${7}px`,"&:before":{borderBottom:`${7}px solid #bbb`},"&:after":{borderBottom:`${7}px solid #f5f5f5`,top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),noOffset={x:0,y:0},showTooltip=Facet.define({enables:[tooltipPlugin,baseTheme$4]}),showHoverTooltip=Facet.define();class HoverTooltipHost{constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new TooltipViewManager(e,showHoverTooltip,s=>this.createHostedView(s))}static create(e){return new HoverTooltipHost(e)}createHostedView(e){let s=e.create(this.view);return s.dom.classList.add("cm-tooltip-section"),this.dom.appendChild(s.dom),this.mounted&&s.mount&&s.mount(this.view),s}mount(e){for(let s of this.manager.tooltipViews)s.mount&&s.mount(e);this.mounted=!0}positioned(){for(let e of this.manager.tooltipViews)e.positioned&&e.positioned()}update(e){this.manager.update(e)}}const showHoverTooltipHost=showTooltip.compute([showHoverTooltip],o=>{let e=o.facet(showHoverTooltip).filter(s=>s);return e.length===0?null:{pos:Math.min(...e.map(s=>s.pos)),end:Math.max(...e.filter(s=>s.end!=null).map(s=>s.end)),create:HoverTooltipHost.create,above:e[0].above,arrow:e.some(s=>s.arrow)}});class HoverPlugin{constructor(e,s,a,c,h){this.view=e,this.source=s,this.field=a,this.setHover=c,this.hoverTime=h,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)return;let e=Date.now()-this.lastMove.time;ea.bottom||e.xa.right+this.view.defaultCharacterWidth)return;let c=this.view.bidiSpans(this.view.state.doc.lineAt(s)).find(g=>g.from<=s&&g.to>=s),h=c&&c.dir==Direction.RTL?-1:1,d=this.source(this.view,s,e.x{this.pending==g&&(this.pending=null,_&&this.view.dispatch({effects:this.setHover.of(_)}))},_=>logException(this.view.state,_,"hover tooltip"))}else d&&this.view.dispatch({effects:this.setHover.of(d)})}mousemove(e){var s;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 a=this.active;if(a&&!isInTooltip(this.lastMove.target)||this.pending){let{pos:c}=a||this.pending,h=(s=a==null?void 0:a.end)!==null&&s!==void 0?s:c;(c==h?this.view.posAtCoords(this.lastMove)!=c:!isOverRange(this.view,c,h,e.clientX,e.clientY,6))&&(this.view.dispatch({effects:this.setHover.of(null)}),this.pending=null)}}mouseleave(){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1,this.active&&this.view.dispatch({effects:this.setHover.of(null)})}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}function isInTooltip(o){for(let e=o;e;e=e.parentNode)if(e.nodeType==1&&e.classList.contains("cm-tooltip"))return!0;return!1}function isOverRange(o,e,s,a,c,h){let d=document.createRange(),g=o.domAtPos(e),_=o.domAtPos(s);d.setEnd(_.node,_.offset),d.setStart(g.node,g.offset);let b=d.getClientRects();d.detach();for(let $=0;$showHoverTooltip.from(c)});return[a,ViewPlugin.define(c=>new HoverPlugin(c,o,a,s,e.hoverTime||300)),showHoverTooltipHost]}function getTooltip(o,e){let s=o.plugin(tooltipPlugin);if(!s)return null;let a=s.manager.tooltips.indexOf(e);return a<0?null:s.manager.tooltipViews[a]}const closeHoverTooltipEffect=StateEffect.define(),panelConfig=Facet.define({combine(o){let e,s;for(let a of o)e=e||a.topContainer,s=s||a.bottomContainer;return{topContainer:e,bottomContainer:s}}});function getPanel(o,e){let s=o.plugin(panelPlugin),a=s?s.specs.indexOf(e):-1;return a>-1?s.panels[a]:null}const panelPlugin=ViewPlugin.fromClass(class{constructor(o){this.input=o.state.facet(showPanel),this.specs=this.input.filter(s=>s),this.panels=this.specs.map(s=>s(o));let e=o.state.facet(panelConfig);this.top=new PanelGroup(o,!0,e.topContainer),this.bottom=new PanelGroup(o,!1,e.bottomContainer),this.top.sync(this.panels.filter(s=>s.top)),this.bottom.sync(this.panels.filter(s=>!s.top));for(let s of this.panels)s.dom.classList.add("cm-panel"),s.mount&&s.mount()}update(o){let e=o.state.facet(panelConfig);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new PanelGroup(o.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new PanelGroup(o.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let s=o.state.facet(showPanel);if(s!=this.input){let a=s.filter(_=>_),c=[],h=[],d=[],g=[];for(let _ of a){let b=this.specs.indexOf(_),$;b<0?($=_(o.view),g.push($)):($=this.panels[b],$.update&&$.update(o)),c.push($),($.top?h:d).push($)}this.specs=a,this.panels=c,this.top.sync(h),this.bottom.sync(d);for(let _ of g)_.dom.classList.add("cm-panel"),_.mount&&_.mount()}else for(let a of this.panels)a.update&&a.update(o)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:o=>EditorView.scrollMargins.of(e=>{let s=e.plugin(o);return s&&{top:s.top.scrollMargin(),bottom:s.bottom.scrollMargin()}})});class PanelGroup{constructor(e,s,a){this.view=e,this.top=s,this.container=a,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let s of this.panels)s.destroy&&e.indexOf(s)<0&&s.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 s=this.container||this.view.dom;s.insertBefore(this.dom,this.top?s.firstChild:null)}let e=this.dom.firstChild;for(let s of this.panels)if(s.dom.parentNode==this.dom){for(;e!=s.dom;)e=rm(e);e=e.nextSibling}else this.dom.insertBefore(s.dom,e);for(;e;)e=rm(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 rm(o){let e=o.nextSibling;return o.remove(),e}const showPanel=Facet.define({enables:panelPlugin});class GutterMarker extends RangeValue{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}GutterMarker.prototype.elementClass="";GutterMarker.prototype.toDOM=void 0;GutterMarker.prototype.mapMode=MapMode.TrackBefore;GutterMarker.prototype.startSide=GutterMarker.prototype.endSide=-1;GutterMarker.prototype.point=!0;const gutterLineClass=Facet.define(),defaults$1={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>RangeSet.empty,lineMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},activeGutters=Facet.define();function gutter(o){return[gutters(),activeGutters.of(Object.assign(Object.assign({},defaults$1),o))]}const unfixGutters=Facet.define({combine:o=>o.some(e=>e)});function gutters(o){let e=[gutterView];return o&&o.fixed===!1&&e.push(unfixGutters.of(!0)),e}const gutterView=ViewPlugin.fromClass(class{constructor(o){this.view=o,this.prevViewport=o.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight+"px",this.gutters=o.state.facet(activeGutters).map(e=>new SingleGutterView(o,e));for(let e of this.gutters)this.dom.appendChild(e.dom);this.fixed=!o.state.facet(unfixGutters),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),o.scrollDOM.insertBefore(this.dom,o.contentDOM)}update(o){if(this.updateGutters(o)){let e=this.prevViewport,s=o.view.viewport,a=Math.min(e.to,s.to)-Math.max(e.from,s.from);this.syncGutters(a<(s.to-s.from)*.8)}o.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight+"px"),this.view.state.facet(unfixGutters)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=o.view.viewport}syncGutters(o){let e=this.dom.nextSibling;o&&this.dom.remove();let s=RangeSet.iter(this.view.state.facet(gutterLineClass),this.view.viewport.from),a=[],c=this.gutters.map(h=>new UpdateContext(h,this.view.viewport,-this.view.documentPadding.top));for(let h of this.view.viewportLineBlocks){let d;if(Array.isArray(h.type)){for(let g of h.type)if(g.type==BlockType.Text){d=g;break}}else d=h.type==BlockType.Text?h:void 0;if(!!d){a.length&&(a=[]),advanceCursor(s,a,h.from);for(let g of c)g.line(this.view,d,a)}}for(let h of c)h.finish();o&&this.view.scrollDOM.insertBefore(this.dom,e)}updateGutters(o){let e=o.startState.facet(activeGutters),s=o.state.facet(activeGutters),a=o.docChanged||o.heightChanged||o.viewportChanged||!RangeSet.eq(o.startState.facet(gutterLineClass),o.state.facet(gutterLineClass),o.view.viewport.from,o.view.viewport.to);if(e==s)for(let c of this.gutters)c.update(o)&&(a=!0);else{a=!0;let c=[];for(let h of s){let d=e.indexOf(h);d<0?c.push(new SingleGutterView(this.view,h)):(this.gutters[d].update(o),c.push(this.gutters[d]))}for(let h of this.gutters)h.dom.remove(),c.indexOf(h)<0&&h.destroy();for(let h of c)this.dom.appendChild(h.dom);this.gutters=c}return a}destroy(){for(let o of this.gutters)o.destroy();this.dom.remove()}},{provide:o=>EditorView.scrollMargins.of(e=>{let s=e.plugin(o);return!s||s.gutters.length==0||!s.fixed?null:e.textDirection==Direction.LTR?{left:s.dom.offsetWidth}:{right:s.dom.offsetWidth}})});function asArray(o){return Array.isArray(o)?o:[o]}function advanceCursor(o,e,s){for(;o.value&&o.from<=s;)o.from==s&&e.push(o.value),o.next()}class UpdateContext{constructor(e,s,a){this.gutter=e,this.height=a,this.localMarkers=[],this.i=0,this.cursor=RangeSet.iter(e.markers,s.from)}line(e,s,a){this.localMarkers.length&&(this.localMarkers=[]),advanceCursor(this.cursor,this.localMarkers,s.from);let c=a.length?this.localMarkers.concat(a):this.localMarkers,h=this.gutter.config.lineMarker(e,s,c);h&&c.unshift(h);let d=this.gutter;if(c.length==0&&!d.config.renderEmptyElements)return;let g=s.top-this.height;if(this.i==d.elements.length){let _=new GutterElement(e,s.height,g,c);d.elements.push(_),d.dom.appendChild(_.dom)}else d.elements[this.i].update(e,s.height,g,c);this.height=s.bottom,this.i++}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let s=e.elements.pop();e.dom.removeChild(s.dom),s.destroy()}}}class SingleGutterView{constructor(e,s){this.view=e,this.config=s,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let a in s.domEventHandlers)this.dom.addEventListener(a,c=>{let h=e.lineBlockAtHeight(c.clientY-e.documentTop);s.domEventHandlers[a](e,h,c)&&c.preventDefault()});this.markers=asArray(s.markers(e)),s.initialSpacer&&(this.spacer=new GutterElement(e,0,0,[s.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let s=this.markers;if(this.markers=asArray(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let c=this.config.updateSpacer(this.spacer.markers[0],e);c!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[c])}let a=e.view.viewport;return!RangeSet.eq(this.markers,s,a.from,a.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class GutterElement{constructor(e,s,a,c){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,s,a,c)}update(e,s,a,c){this.height!=s&&(this.dom.style.height=(this.height=s)+"px"),this.above!=a&&(this.dom.style.marginTop=(this.above=a)?a+"px":""),sameMarkers(this.markers,c)||this.setMarkers(e,c)}setMarkers(e,s){let a="cm-gutterElement",c=this.dom.firstChild;for(let h=0,d=0;;){let g=d,_=hh(g,_,b)||d(g,_,b):d}return a}})}});class NumberMarker extends GutterMarker{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function formatNumber(o,e){return o.state.facet(lineNumberConfig).formatNumber(e,o.state)}const lineNumberGutter=activeGutters.compute([lineNumberConfig],o=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(lineNumberMarkers)},lineMarker(e,s,a){return a.some(c=>c.toDOM)?null:new NumberMarker(formatNumber(e,e.state.doc.lineAt(s.from).number))},lineMarkerChange:e=>e.startState.facet(lineNumberConfig)!=e.state.facet(lineNumberConfig),initialSpacer(e){return new NumberMarker(formatNumber(e,maxLineNumber(e.state.doc.lines)))},updateSpacer(e,s){let a=formatNumber(s.view,maxLineNumber(s.view.state.doc.lines));return a==e.number?e:new NumberMarker(a)},domEventHandlers:o.facet(lineNumberConfig).domEventHandlers}));function lineNumbers(o={}){return[lineNumberConfig.of(o),gutters(),lineNumberGutter]}function maxLineNumber(o){let e=9;for(;e{let e=[],s=-1;for(let a of o.selection.ranges)if(a.empty){let c=o.doc.lineAt(a.head).from;c>s&&(s=c,e.push(activeLineGutterMarker.range(c)))}return RangeSet.of(e)});function highlightActiveLineGutter(){return activeLineGutterHighlighter}const DefaultBufferLength=1024;let nextPropID=0;class Range{constructor(e,s){this.from=e,this.to=s}}class NodeProp{constructor(e={}){this.id=nextPropID++,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=NodeType.match(e)),s=>{let a=e(s);return a===void 0?null:[this,a]}}}NodeProp.closedBy=new NodeProp({deserialize:o=>o.split(" ")});NodeProp.openedBy=new NodeProp({deserialize:o=>o.split(" ")});NodeProp.group=new NodeProp({deserialize:o=>o.split(" ")});NodeProp.contextHash=new NodeProp({perNode:!0});NodeProp.lookAhead=new NodeProp({perNode:!0});NodeProp.mounted=new NodeProp({perNode:!0});const noProps=Object.create(null);class NodeType{constructor(e,s,a,c=0){this.name=e,this.props=s,this.id=a,this.flags=c}static define(e){let s=e.props&&e.props.length?Object.create(null):noProps,a=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),c=new NodeType(e.name||"",s,e.id,a);if(e.props){for(let h of e.props)if(Array.isArray(h)||(h=h(c)),h){if(h[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");s[h[0].id]=h[1]}}return c}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 s=this.prop(NodeProp.group);return s?s.indexOf(e)>-1:!1}return this.id==e}static match(e){let s=Object.create(null);for(let a in e)for(let c of a.split(" "))s[c]=e[a];return a=>{for(let c=a.prop(NodeProp.group),h=-1;h<(c?c.length:0);h++){let d=s[h<0?a.name:c[h]];if(d)return d}}}}NodeType.none=new NodeType("",Object.create(null),0,8);class NodeSet{constructor(e){this.types=e;for(let s=0;s=c&&(d.type.isAnonymous||s(d)!==!1)){if(d.firstChild())continue;g=!0}for(;g&&a&&!d.type.isAnonymous&&a(d),!d.nextSibling();){if(!d.parent())return;g=!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 s in this.props)e.push([+s,this.props[s]]);return e}balance(e={}){return this.children.length<=8?this:balanceRange(NodeType.none,this.children,this.positions,0,this.children.length,0,this.length,(s,a,c)=>new Tree(this.type,s,a,c,this.propValues),e.makeTree||((s,a,c)=>new Tree(NodeType.none,s,a,c)))}static build(e){return buildTree(e)}}Tree.empty=new Tree(NodeType.none,[],[],0);class FlatBufferCursor{constructor(e,s){this.buffer=e,this.index=s}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 FlatBufferCursor(this.buffer,this.index)}}class TreeBuffer{constructor(e,s,a){this.buffer=e,this.length=s,this.set=a}get type(){return NodeType.none}toString(){let e=[];for(let s=0;s0));_=d[_+3]);return g}slice(e,s,a,c){let h=this.buffer,d=new Uint16Array(s-e);for(let g=e,_=0;g=e&&se;case 1:return s<=e&&a>e;case 2:return a>e;case 4:return!0}}function enterUnfinishedNodesBefore(o,e){let s=o.childBefore(e);for(;s;){let a=s.lastChild;if(!a||a.to!=s.to)break;a.type.isError&&a.from==a.to?(o=s,s=a.prevSibling):s=a}return o}function resolveNode(o,e,s,a){for(var c;o.from==o.to||(s<1?o.from>=e:o.from>e)||(s>-1?o.to<=e:o.to0?g.length:-1;e!=b;e+=s){let $=g[e],j=_[e]+d.from;if(!!checkSide(c,a,j,j+$.length)){if($ instanceof TreeBuffer){if(h&IterMode.ExcludeBuffers)continue;let _e=$.findChild(0,$.buffer.length,s,a-j,c);if(_e>-1)return new BufferNode(new BufferContext(d,$,e,j),null,_e)}else if(h&IterMode.IncludeAnonymous||!$.type.isAnonymous||hasChild($)){let _e;if(!(h&IterMode.IgnoreMounts)&&$.props&&(_e=$.prop(NodeProp.mounted))&&!_e.overlay)return new TreeNode(_e.tree,j,e,d);let et=new TreeNode($,j,e,d);return h&IterMode.IncludeAnonymous||!et.type.isAnonymous?et:et.nextChild(s<0?$.children.length-1:0,s,a,c)}}}if(h&IterMode.IncludeAnonymous||!d.type.isAnonymous||(d.index>=0?e=d.index+s:e=s<0?-1:d._parent._tree.children.length,d=d._parent,!d))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,s,a=0){let c;if(!(a&IterMode.IgnoreOverlays)&&(c=this._tree.prop(NodeProp.mounted))&&c.overlay){let h=e-this.from;for(let{from:d,to:g}of c.overlay)if((s>0?d<=h:d=h:g>h))return new TreeNode(c.tree,c.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,s,a)}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}cursor(e=0){return new TreeCursor(this,e)}get tree(){return this._tree}toTree(){return this._tree}resolve(e,s=0){return resolveNode(this,e,s,!1)}resolveInner(e,s=0){return resolveNode(this,e,s,!0)}enterUnfinishedNodesBefore(e){return enterUnfinishedNodesBefore(this,e)}getChild(e,s=null,a=null){let c=getChildren(this,e,s,a);return c.length?c[0]:null}getChildren(e,s=null,a=null){return getChildren(this,e,s,a)}toString(){return this._tree.toString()}get node(){return this}matchContext(e){return matchNodeContext(this,e)}}function getChildren(o,e,s,a){let c=o.cursor(),h=[];if(!c.firstChild())return h;if(s!=null){for(;!c.type.is(s);)if(!c.nextSibling())return h}for(;;){if(a!=null&&c.type.is(a))return h;if(c.type.is(e)&&h.push(c.node),!c.nextSibling())return a==null?h:[]}}function matchNodeContext(o,e,s=e.length-1){for(let a=o.parent;s>=0;a=a.parent){if(!a)return!1;if(!a.type.isAnonymous){if(e[s]&&e[s]!=a.name)return!1;s--}}return!0}class BufferContext{constructor(e,s,a,c){this.parent=e,this.buffer=s,this.index=a,this.start=c}}class BufferNode{constructor(e,s,a){this.context=e,this._parent=s,this.index=a,this.type=e.buffer.set.types[e.buffer.buffer[a]]}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]}child(e,s,a){let{buffer:c}=this.context,h=c.findChild(this.index+4,c.buffer[this.index+3],e,s-this.context.start,a);return h<0?null:new BufferNode(this.context,this,h)}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,s,a=0){if(a&IterMode.ExcludeBuffers)return null;let{buffer:c}=this.context,h=c.findChild(this.index+4,c.buffer[this.index+3],s>0?1:-1,e-this.context.start,s);return h<0?null:new BufferNode(this.context,this,h)}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,s=e.buffer[this.index+3];return s<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new BufferNode(this.context,this._parent,s):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,s=this._parent?this._parent.index+4:0;return this.index==s?this.externalSibling(-1):new BufferNode(this.context,this._parent,e.findChild(s,this.index,-1,0,4))}cursor(e=0){return new TreeCursor(this,e)}get tree(){return null}toTree(){let e=[],s=[],{buffer:a}=this.context,c=this.index+4,h=a.buffer[this.index+3];if(h>c){let d=a.buffer[this.index+1],g=a.buffer[this.index+2];e.push(a.slice(c,h,d,g)),s.push(0)}return new Tree(this.type,e,s,this.to-this.from)}resolve(e,s=0){return resolveNode(this,e,s,!1)}resolveInner(e,s=0){return resolveNode(this,e,s,!0)}enterUnfinishedNodesBefore(e){return enterUnfinishedNodesBefore(this,e)}toString(){return this.context.buffer.childString(this.index)}getChild(e,s=null,a=null){let c=getChildren(this,e,s,a);return c.length?c[0]:null}getChildren(e,s=null,a=null){return getChildren(this,e,s,a)}get node(){return this}matchContext(e){return matchNodeContext(this,e)}}class TreeCursor{constructor(e,s=0){if(this.mode=s,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof TreeNode)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let a=e._parent;a;a=a._parent)this.stack.unshift(a.index);this.bufferNode=e,this.yieldBuf(e.index)}}get name(){return this.type.name}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,s){this.index=e;let{start:a,buffer:c}=this.buffer;return this.type=s||c.set.types[c.buffer[e]],this.from=a+c.buffer[e+1],this.to=a+c.buffer[e+2],!0}yield(e){return e?e instanceof TreeNode?(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,s,a){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,s,a,this.mode));let{buffer:c}=this.buffer,h=c.findChild(this.index+4,c.buffer[this.index+3],e,s-this.buffer.start,a);return h<0?!1:(this.stack.push(this.index),this.yieldBuf(h))}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,s,a=this.mode){return this.buffer?a&IterMode.ExcludeBuffers?!1:this.enterChild(1,e,s):this.yield(this._tree.enter(e,s,a))}parent(){if(!this.buffer)return this.yieldNode(this.mode&IterMode.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&IterMode.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:s}=this.buffer,a=this.stack.length-1;if(e<0){let c=a<0?0:this.stack[a]+4;if(this.index!=c)return this.yieldBuf(s.findChild(c,this.index,-1,0,4))}else{let c=s.buffer[this.index+3];if(c<(a<0?s.buffer.length:s.buffer[this.stack[a]+3]))return this.yieldBuf(c)}return a<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 s,a,{buffer:c}=this;if(c){if(e>0){if(this.index-1)for(let h=s+e,d=e<0?-1:a._tree.children.length;h!=d;h+=e){let g=a._tree.children[h];if(this.mode&IterMode.IncludeAnonymous||g instanceof TreeBuffer||!g.type.isAnonymous||hasChild(g))return!1}return!0}move(e,s){if(s&&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,s=0){for(;(this.from==this.to||(s<1?this.from>=e:this.from>e)||(s>-1?this.to<=e:this.to=0;){for(let d=e;d;d=d._parent)if(d.index==c){if(c==this.index)return d;s=d,a=h+1;break e}c=this.stack[--h]}}for(let c=a;c=0;h--){if(h<0)return matchNodeContext(this.node,e,c);let d=a[s.buffer[this.stack[h]]];if(!d.isAnonymous){if(e[c]&&e[c]!=d.name)return!1;c--}}return!0}}function hasChild(o){return o.children.some(e=>e instanceof TreeBuffer||!e.type.isAnonymous||hasChild(e))}function buildTree(o){var e;let{buffer:s,nodeSet:a,maxBufferLength:c=DefaultBufferLength,reused:h=[],minRepeatType:d=a.types.length}=o,g=Array.isArray(s)?new FlatBufferCursor(s,s.length):s,_=a.types,b=0,$=0;function j(ot,ut,ct,ht,lt){let{id:pt,start:ft,end:gt,size:yt}=g,mt=$;for(;yt<0;)if(g.next(),yt==-1){let dt=h[pt];ct.push(dt),ht.push(ft-ot);return}else if(yt==-3){b=pt;return}else if(yt==-4){$=pt;return}else throw new RangeError(`Unrecognized record size: ${yt}`);let Et=_[pt],Ot,St,At=ft-ot;if(gt-ft<=c&&(St=nt(g.pos-ut,lt))){let dt=new Uint16Array(St.size-St.skip),Dt=g.pos-St.size,Ct=dt.length;for(;g.pos>Dt;)Ct=st(St.start,dt,Ct);Ot=new TreeBuffer(dt,gt-St.start,a),At=St.start-ot}else{let dt=g.pos-yt;g.next();let Dt=[],Ct=[],xt=pt>=d?pt:-1,Tt=0,kt=gt;for(;g.pos>dt;)xt>=0&&g.id==xt&&g.size>=0?(g.end<=kt-c&&(et(Dt,Ct,ft,Tt,g.end,kt,xt,mt),Tt=Dt.length,kt=g.end),g.next()):j(ft,dt,Dt,Ct,xt);if(xt>=0&&Tt>0&&Tt-1&&Tt>0){let _t=_e(Et);Ot=balanceRange(Et,Dt,Ct,0,Dt.length,0,gt-ft,_t,_t)}else Ot=tt(Et,Dt,Ct,gt-ft,mt-gt)}ct.push(Ot),ht.push(At)}function _e(ot){return(ut,ct,ht)=>{let lt=0,pt=ut.length-1,ft,gt;if(pt>=0&&(ft=ut[pt])instanceof Tree){if(!pt&&ft.type==ot&&ft.length==ht)return ft;(gt=ft.prop(NodeProp.lookAhead))&&(lt=ct[pt]+ft.length+gt)}return tt(ot,ut,ct,ht,lt)}}function et(ot,ut,ct,ht,lt,pt,ft,gt){let yt=[],mt=[];for(;ot.length>ht;)yt.push(ot.pop()),mt.push(ut.pop()+ct-lt);ot.push(tt(a.types[ft],yt,mt,pt-lt,gt-pt)),ut.push(lt-ct)}function tt(ot,ut,ct,ht,lt=0,pt){if(b){let ft=[NodeProp.contextHash,b];pt=pt?[ft].concat(pt):[ft]}if(lt>25){let ft=[NodeProp.lookAhead,lt];pt=pt?[ft].concat(pt):[ft]}return new Tree(ot,ut,ct,ht,pt)}function nt(ot,ut){let ct=g.fork(),ht=0,lt=0,pt=0,ft=ct.end-c,gt={size:0,start:0,skip:0};e:for(let yt=ct.pos-ot;ct.pos>yt;){let mt=ct.size;if(ct.id==ut&&mt>=0){gt.size=ht,gt.start=lt,gt.skip=pt,pt+=4,ht+=4,ct.next();continue}let Et=ct.pos-mt;if(mt<0||Et=d?4:0,St=ct.start;for(ct.next();ct.pos>Et;){if(ct.size<0)if(ct.size==-3)Ot+=4;else break e;else ct.id>=d&&(Ot+=4);ct.next()}lt=St,ht+=mt,pt+=Ot}return(ut<0||ht==ot)&&(gt.size=ht,gt.start=lt,gt.skip=pt),gt.size>4?gt:void 0}function st(ot,ut,ct){let{id:ht,start:lt,end:pt,size:ft}=g;if(g.next(),ft>=0&&ht4){let yt=g.pos-(ft-4);for(;g.pos>yt;)ct=st(ot,ut,ct)}ut[--ct]=gt,ut[--ct]=pt-ot,ut[--ct]=lt-ot,ut[--ct]=ht}else ft==-3?b=ht:ft==-4&&($=ht);return ct}let rt=[],it=[];for(;g.pos>0;)j(o.start||0,o.bufferStart||0,rt,it,-1);let at=(e=o.length)!==null&&e!==void 0?e:rt.length?it[0]+rt[0].length:0;return new Tree(_[o.topID],rt.reverse(),it.reverse(),at)}const nodeSizeCache=new WeakMap;function nodeSize(o,e){if(!o.isAnonymous||e instanceof TreeBuffer||e.type!=o)return 1;let s=nodeSizeCache.get(e);if(s==null){s=1;for(let a of e.children){if(a.type!=o||!(a instanceof Tree)){s=1;break}s+=nodeSize(o,a)}nodeSizeCache.set(e,s)}return s}function balanceRange(o,e,s,a,c,h,d,g,_){let b=0;for(let tt=a;tt=$)break;ct+=ht}if(at==ot+1){if(ct>$){let ht=tt[ot];et(ht.children,ht.positions,0,ht.children.length,nt[ot]+it);continue}j.push(tt[ot])}else{let ht=nt[at-1]+tt[at-1].length-ut;j.push(balanceRange(o,tt,nt,ot,at,ut,ht,null,_))}_e.push(ut+it-h)}}return et(e,s,a,c,0),(g||_)(j,_e,d)}class NodeWeakMap{constructor(){this.map=new WeakMap}setBuffer(e,s,a){let c=this.map.get(e);c||this.map.set(e,c=new Map),c.set(s,a)}getBuffer(e,s){let a=this.map.get(e);return a&&a.get(s)}set(e,s){e instanceof BufferNode?this.setBuffer(e.context.buffer,e.index,s):e instanceof TreeNode&&this.map.set(e.tree,s)}get(e){return e instanceof BufferNode?this.getBuffer(e.context.buffer,e.index):e instanceof TreeNode?this.map.get(e.tree):void 0}cursorSet(e,s){e.buffer?this.setBuffer(e.buffer.buffer,e.index,s):this.map.set(e.tree,s)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class TreeFragment{constructor(e,s,a,c,h=!1,d=!1){this.from=e,this.to=s,this.tree=a,this.offset=c,this.open=(h?1:0)|(d?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,s=[],a=!1){let c=[new TreeFragment(0,e.length,e,0,!1,a)];for(let h of s)h.to>e.length&&c.push(h);return c}static applyChanges(e,s,a=128){if(!s.length)return e;let c=[],h=1,d=e.length?e[0]:null;for(let g=0,_=0,b=0;;g++){let $=g=a)for(;d&&d.from=_e.from||j<=_e.to||b){let et=Math.max(_e.from,_)-b,tt=Math.min(_e.to,j)-b;_e=et>=tt?null:new TreeFragment(et,tt,_e.tree,_e.offset+b,g>0,!!$)}if(_e&&c.push(_e),d.to>j)break;d=hnew Range(c.from,c.to)):[new Range(0,0)]:[new Range(0,e.length)],this.createParse(e,s||[],a)}parse(e,s,a){let c=this.startParse(e,s,a);for(;;){let h=c.advance();if(h)return h}}}class StringInput{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,s){return this.string.slice(e,s)}}new NodeProp({perNode:!0});let nextTagID=0;class Tag{constructor(e,s,a){this.set=e,this.base=s,this.modified=a,this.id=nextTagID++}static define(e){if(e!=null&&e.base)throw new Error("Can not derive from a modified tag");let s=new Tag([],null,[]);if(s.set.push(s),e)for(let a of e.set)s.set.push(a);return s}static defineModifier(){let e=new Modifier;return s=>s.modified.indexOf(e)>-1?s:Modifier.get(s.base||s,s.modified.concat(e).sort((a,c)=>a.id-c.id))}}let nextModifierID=0;class Modifier{constructor(){this.instances=[],this.id=nextModifierID++}static get(e,s){if(!s.length)return e;let a=s[0].instances.find(g=>g.base==e&&sameArray(s,g.modified));if(a)return a;let c=[],h=new Tag(c,e,s);for(let g of s)g.instances.push(h);let d=permute(s);for(let g of e.set)for(let _ of d)c.push(Modifier.get(g,_));return h}}function sameArray(o,e){return o.length==e.length&&o.every((s,a)=>s==e[a])}function permute(o){let e=[o];for(let s=0;s0&&j+3==c.length){d=1;break}let _e=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(g);if(!_e)throw new RangeError("Invalid path: "+c);if(h.push(_e[0]=="*"?"":_e[0][0]=='"'?JSON.parse(_e[0]):_e[0]),j+=_e[0].length,j==c.length)break;let et=c[j++];if(j==c.length&&et=="!"){d=0;break}if(et!="/")throw new RangeError("Invalid path: "+c);g=c.slice(j)}let _=h.length-1,b=h[_];if(!b)throw new RangeError("Invalid path: "+c);let $=new Rule(a,d,_>0?h.slice(0,_):null);e[b]=$.sort(e[b])}}return ruleNodeProp.add(e)}const ruleNodeProp=new NodeProp;class Rule{constructor(e,s,a,c){this.tags=e,this.mode=s,this.context=a,this.next=c}sort(e){return!e||e.depth{let d=c;for(let g of h)for(let _ of g.set){let b=s[_.id];if(b){d=d?d+" "+b:b;break}}return d},scope:a}}function highlightTags(o,e){let s=null;for(let a of o){let c=a.style(e);c&&(s=s?s+" "+c:c)}return s}function highlightTree(o,e,s,a=0,c=o.length){let h=new HighlightBuilder(a,Array.isArray(e)?e:[e],s);h.highlightRange(o.cursor(),a,c,"",h.highlighters),h.flush(c)}class HighlightBuilder{constructor(e,s,a){this.at=e,this.highlighters=s,this.span=a,this.class=""}startSpan(e,s){s!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=s)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,s,a,c,h){let{type:d,from:g,to:_}=e;if(g>=a||_<=s)return;d.isTop&&(h=this.highlighters.filter(et=>!et.scope||et.scope(d)));let b=c,$=d.prop(ruleNodeProp),j=!1;for(;$;){if(!$.context||e.matchContext($.context)){let et=highlightTags(h,$.tags);et&&(b&&(b+=" "),b+=et,$.mode==1?c+=(c?" ":"")+et:$.mode==0&&(j=!0));break}$=$.next}if(this.startSpan(e.from,b),j)return;let _e=e.tree&&e.tree.prop(NodeProp.mounted);if(_e&&_e.overlay){let et=e.node.enter(_e.overlay[0].from+g,1),tt=this.highlighters.filter(st=>!st.scope||st.scope(_e.tree.type)),nt=e.firstChild();for(let st=0,rt=g;;st++){let it=st<_e.overlay.length?_e.overlay[st]:null,at=it?it.from+g:_,ot=Math.max(s,rt),ut=Math.min(a,at);if(ot=at||!e.nextSibling())););if(!it||at>a)break;rt=it.to+g,rt>s&&(this.highlightRange(et.cursor(),Math.max(s,it.from+g),Math.min(a,rt),c,tt),this.startSpan(rt,b))}nt&&e.parent()}else if(e.firstChild()){do if(!(e.to<=s)){if(e.from>=a)break;this.highlightRange(e,s,a,c,h),this.startSpan(Math.min(a,e.to),b)}while(e.nextSibling());e.parent()}}}const t=Tag.define,comment=t(),name=t(),typeName=t(name),propertyName=t(name),literal=t(),string=t(literal),number=t(literal),content=t(),heading=t(content),keyword=t(),operator=t(),punctuation=t(),bracket=t(punctuation),meta=t(),tags={comment,lineComment:t(comment),blockComment:t(comment),docComment:t(comment),name,variableName:t(name),typeName,tagName:t(typeName),propertyName,attributeName:t(propertyName),className:t(name),labelName:t(name),namespace:t(name),macroName:t(name),literal,string,docString:t(string),character:t(string),attributeValue:t(string),number,integer:t(number),float:t(number),bool:t(literal),regexp:t(literal),escape:t(literal),color:t(literal),url:t(literal),keyword,self:t(keyword),null:t(keyword),atom:t(keyword),unit:t(keyword),modifier:t(keyword),operatorKeyword:t(keyword),controlKeyword:t(keyword),definitionKeyword:t(keyword),moduleKeyword:t(keyword),operator,derefOperator:t(operator),arithmeticOperator:t(operator),logicOperator:t(operator),bitwiseOperator:t(operator),compareOperator:t(operator),updateOperator:t(operator),definitionOperator:t(operator),typeOperator:t(operator),controlOperator:t(operator),punctuation,separator:t(punctuation),bracket,angleBracket:t(bracket),squareBracket:t(bracket),paren:t(bracket),brace:t(bracket),content,heading,heading1:t(heading),heading2:t(heading),heading3:t(heading),heading4:t(heading),heading5:t(heading),heading6:t(heading),contentSeparator:t(content),list:t(content),quote:t(content),emphasis:t(content),strong:t(content),link:t(content),monospace:t(content),strikethrough:t(content),inserted:t(),deleted:t(),changed:t(),invalid:t(),meta,documentMeta:t(meta),annotation:t(meta),processingInstruction:t(meta),definition:Tag.defineModifier(),constant:Tag.defineModifier(),function:Tag.defineModifier(),standard:Tag.defineModifier(),local:Tag.defineModifier(),special:Tag.defineModifier()};tagHighlighter([{tag:tags.link,class:"tok-link"},{tag:tags.heading,class:"tok-heading"},{tag:tags.emphasis,class:"tok-emphasis"},{tag:tags.strong,class:"tok-strong"},{tag:tags.keyword,class:"tok-keyword"},{tag:tags.atom,class:"tok-atom"},{tag:tags.bool,class:"tok-bool"},{tag:tags.url,class:"tok-url"},{tag:tags.labelName,class:"tok-labelName"},{tag:tags.inserted,class:"tok-inserted"},{tag:tags.deleted,class:"tok-deleted"},{tag:tags.literal,class:"tok-literal"},{tag:tags.string,class:"tok-string"},{tag:tags.number,class:"tok-number"},{tag:[tags.regexp,tags.escape,tags.special(tags.string)],class:"tok-string2"},{tag:tags.variableName,class:"tok-variableName"},{tag:tags.local(tags.variableName),class:"tok-variableName tok-local"},{tag:tags.definition(tags.variableName),class:"tok-variableName tok-definition"},{tag:tags.special(tags.variableName),class:"tok-variableName2"},{tag:tags.definition(tags.propertyName),class:"tok-propertyName tok-definition"},{tag:tags.typeName,class:"tok-typeName"},{tag:tags.namespace,class:"tok-namespace"},{tag:tags.className,class:"tok-className"},{tag:tags.macroName,class:"tok-macroName"},{tag:tags.propertyName,class:"tok-propertyName"},{tag:tags.operator,class:"tok-operator"},{tag:tags.comment,class:"tok-comment"},{tag:tags.meta,class:"tok-meta"},{tag:tags.invalid,class:"tok-invalid"},{tag:tags.punctuation,class:"tok-punctuation"}]);var _a;const languageDataProp=new NodeProp;function defineLanguageFacet(o){return Facet.define({combine:o?e=>e.concat(o):void 0})}class Language{constructor(e,s,a=[]){this.data=e,EditorState.prototype.hasOwnProperty("tree")||Object.defineProperty(EditorState.prototype,"tree",{get(){return syntaxTree(this)}}),this.parser=s,this.extension=[language.of(this),EditorState.languageData.of((c,h,d)=>c.facet(languageDataFacetAt(c,h,d)))].concat(a)}isActiveAt(e,s,a=-1){return languageDataFacetAt(e,s,a)==this.data}findRegions(e){let s=e.facet(language);if((s==null?void 0:s.data)==this.data)return[{from:0,to:e.doc.length}];if(!s||!s.allowsNesting)return[];let a=[],c=(h,d)=>{if(h.prop(languageDataProp)==this.data){a.push({from:d,to:d+h.length});return}let g=h.prop(NodeProp.mounted);if(g){if(g.tree.prop(languageDataProp)==this.data){if(g.overlay)for(let _ of g.overlay)a.push({from:_.from+d,to:_.to+d});else a.push({from:d,to:d+h.length});return}else if(g.overlay){let _=a.length;if(c(g.tree,g.overlay[0].from+d),a.length>_)return}}for(let _=0;_a.isTop?s:void 0)]}))}configure(e){return new LRLanguage(this.data,this.parser.configure(e))}get allowsNesting(){return this.parser.hasWrappers()}}function syntaxTree(o){let e=o.field(Language.state,!1);return e?e.tree:Tree.empty}class DocInput{constructor(e,s=e.length){this.doc=e,this.length=s,this.cursorPos=0,this.string="",this.cursor=e.iter()}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,s){let a=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,s):this.string.slice(e-a,s-a)}}let currentContext=null;class ParseContext{constructor(e,s,a=[],c,h,d,g,_){this.parser=e,this.state=s,this.fragments=a,this.tree=c,this.treeLen=h,this.viewport=d,this.skipped=g,this.scheduleOn=_,this.parse=null,this.tempSkipped=[]}static create(e,s,a){return new ParseContext(e,s,[],Tree.empty,0,a,[],null)}startParse(){return this.parser.startParse(new DocInput(this.state.doc),this.fragments)}work(e,s){return s!=null&&s>=this.state.doc.length&&(s=void 0),this.tree!=Tree.empty&&this.isDone(s!=null?s:this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var a;if(typeof e=="number"){let c=Date.now()+e;e=()=>Date.now()>c}for(this.parse||(this.parse=this.startParse()),s!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>s)&&s=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(s=this.parse.advance()););}),this.treeLen=e,this.tree=s,this.fragments=this.withoutTempSkipped(TreeFragment.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let s=currentContext;currentContext=this;try{return e()}finally{currentContext=s}}withoutTempSkipped(e){for(let s;s=this.tempSkipped.pop();)e=cutFragments(e,s.from,s.to);return e}changes(e,s){let{fragments:a,tree:c,treeLen:h,viewport:d,skipped:g}=this;if(this.takeTree(),!e.empty){let _=[];if(e.iterChangedRanges((b,$,j,_e)=>_.push({fromA:b,toA:$,fromB:j,toB:_e})),a=TreeFragment.applyChanges(a,_),c=Tree.empty,h=0,d={from:e.mapPos(d.from,-1),to:e.mapPos(d.to,1)},this.skipped.length){g=[];for(let b of this.skipped){let $=e.mapPos(b.from,1),j=e.mapPos(b.to,-1);$e.from&&(this.fragments=cutFragments(this.fragments,c,h),this.skipped.splice(a--,1))}return this.skipped.length>=s?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,s){this.skipped.push({from:e,to:s})}static getSkippingParser(e){return new class extends Parser{createParse(s,a,c){let h=c[0].from,d=c[c.length-1].to;return{parsedPos:h,advance(){let _=currentContext;if(_){for(let b of c)_.tempSkipped.push(b);e&&(_.scheduleOn=_.scheduleOn?Promise.all([_.scheduleOn,e]):e)}return this.parsedPos=d,new Tree(NodeType.none,[],[],d-h)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let s=this.fragments;return this.treeLen>=e&&s.length&&s[0].from==0&&s[0].to>=e}static get(){return currentContext}}function cutFragments(o,e,s){return TreeFragment.applyChanges(o,[{fromA:e,toA:s,fromB:e,toB:s}])}class LanguageState{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let s=this.context.changes(e.changes,e.state),a=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),s.viewport.to);return s.work(20,a)||s.takeTree(),new LanguageState(s)}static init(e){let s=Math.min(3e3,e.doc.length),a=ParseContext.create(e.facet(language).parser,e,{from:0,to:s});return a.work(20,s)||a.takeTree(),new LanguageState(a)}}Language.state=StateField.define({create:LanguageState.init,update(o,e){for(let s of e.effects)if(s.is(Language.setState))return s.value;return e.startState.facet(language)!=e.state.facet(language)?LanguageState.init(e.state):o.apply(e)}});let requestIdle=o=>{let e=setTimeout(()=>o(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(requestIdle=o=>{let e=-1,s=setTimeout(()=>{e=requestIdleCallback(o,{timeout:500-100})},100);return()=>e<0?clearTimeout(s):cancelIdleCallback(e)});const isInputPending=typeof navigator<"u"&&((_a=navigator.scheduling)===null||_a===void 0?void 0:_a.isInputPending)?()=>navigator.scheduling.isInputPending():null,parseWorker=ViewPlugin.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 s=this.view.state.field(Language.state).context;(s.updateViewport(e.view.viewport)||this.view.viewport.to>s.treeLen)&&this.scheduleWork(),e.docChanged&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(s)}scheduleWork(){if(this.working)return;let{state:e}=this.view,s=e.field(Language.state);(s.tree!=s.context.tree||!s.context.isDone(e.doc.length))&&(this.working=requestIdle(this.work))}work(e){this.working=null;let s=Date.now();if(this.chunkEndc+1e3,_=h.context.work(()=>isInputPending&&isInputPending()||Date.now()>d,c+(g?0:1e5));this.chunkBudget-=Date.now()-s,(_||this.chunkBudget<=0)&&(h.context.takeTree(),this.view.dispatch({effects:Language.setState.of(new LanguageState(h.context))})),this.chunkBudget>0&&!(_&&!g)&&this.scheduleWork(),this.checkAsyncSchedule(h.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(s=>logException(this.view.state,s)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),language=Facet.define({combine(o){return o.length?o[0]:null},enables:[Language.state,parseWorker]});class LanguageSupport{constructor(e,s=[]){this.language=e,this.support=s,this.extension=[e,s]}}const indentService=Facet.define(),indentUnit=Facet.define({combine:o=>{if(!o.length)return" ";if(!/^(?: +|\t+)$/.test(o[0]))throw new Error("Invalid indent unit: "+JSON.stringify(o[0]));return o[0]}});function getIndentUnit(o){let e=o.facet(indentUnit);return e.charCodeAt(0)==9?o.tabSize*e.length:e.length}function indentString(o,e){let s="",a=o.tabSize;if(o.facet(indentUnit).charCodeAt(0)==9)for(;e>=a;)s+=" ",e-=a;for(let c=0;c=a.from&&c<=a.to?h&&c==e?{text:"",from:e}:(s<0?c-1&&(h+=d-this.countColumn(a,a.search(/\S|$/))),h}countColumn(e,s=e.length){return countColumn(e,this.state.tabSize,s)}lineIndent(e,s=1){let{text:a,from:c}=this.lineAt(e,s),h=this.options.overrideIndentation;if(h){let d=h(c);if(d>-1)return d}return this.countColumn(a,a.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const indentNodeProp=new NodeProp;function syntaxIndentation(o,e,s){return indentFrom(e.resolveInner(s).enterUnfinishedNodesBefore(s),s,o)}function ignoreClosed(o){return o.pos==o.options.simulateBreak&&o.options.simulateDoubleBreak}function indentStrategy(o){let e=o.type.prop(indentNodeProp);if(e)return e;let s=o.firstChild,a;if(s&&(a=s.type.prop(NodeProp.closedBy))){let c=o.lastChild,h=c&&a.indexOf(c.name)>-1;return d=>delimitedStrategy(d,!0,1,void 0,h&&!ignoreClosed(d)?c.from:void 0)}return o.parent==null?topIndent:null}function indentFrom(o,e,s){for(;o;o=o.parent){let a=indentStrategy(o);if(a)return a(TreeIndentContext.create(s,e,o))}return null}function topIndent(){return 0}class TreeIndentContext extends IndentContext{constructor(e,s,a){super(e.state,e.options),this.base=e,this.pos=s,this.node=a}static create(e,s,a){return new TreeIndentContext(e,s,a)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){let e=this.state.doc.lineAt(this.node.from);for(;;){let s=this.node.resolve(e.from);for(;s.parent&&s.parent.from==s.from;)s=s.parent;if(isParent(s,this.node))break;e=this.state.doc.lineAt(s.from)}return this.lineIndent(e.from)}continue(){let e=this.node.parent;return e?indentFrom(e,this.pos,this.base):0}}function isParent(o,e){for(let s=e;s;s=s.parent)if(o==s)return!0;return!1}function bracketedAligned(o){let e=o.node,s=e.childAfter(e.from),a=e.lastChild;if(!s)return null;let c=o.options.simulateBreak,h=o.state.doc.lineAt(s.from),d=c==null||c<=h.from?h.to:Math.min(h.to,c);for(let g=s.to;;){let _=e.childAfter(g);if(!_||_==a)return null;if(!_.type.isSkipped)return _.fromdelimitedStrategy(a,e,s,o)}function delimitedStrategy(o,e,s,a,c){let h=o.textAfter,d=h.match(/^\s*/)[0].length,g=a&&h.slice(d,d+a.length)==a||c==o.pos+d,_=e?bracketedAligned(o):null;return _?g?o.column(_.from):o.column(_.to):o.baseIndent+(g?0:o.unit*s)}const flatIndent=o=>o.baseIndent;function continuedIndent({except:o,units:e=1}={}){return s=>{let a=o&&o.test(s.textAfter);return s.baseIndent+(a?0:e*s.unit)}}const DontIndentBeyond=200;function indentOnInput(){return EditorState.transactionFilter.of(o=>{if(!o.docChanged||!o.isUserEvent("input.type")&&!o.isUserEvent("input.complete"))return o;let e=o.startState.languageDataAt("indentOnInput",o.startState.selection.main.head);if(!e.length)return o;let s=o.newDoc,{head:a}=o.newSelection.main,c=s.lineAt(a);if(a>c.from+DontIndentBeyond)return o;let h=s.sliceString(c.from,a);if(!e.some(b=>b.test(h)))return o;let{state:d}=o,g=-1,_=[];for(let{head:b}of d.selection.ranges){let $=d.doc.lineAt(b);if($.from==g)continue;g=$.from;let j=getIndentation(d,$.from);if(j==null)continue;let _e=/^\s*/.exec($.text)[0],et=indentString(d,j);_e!=et&&_.push({from:$.from,to:$.from+_e.length,insert:et})}return _.length?[o,{changes:_,sequential:!0}]:o})}const foldService=Facet.define(),foldNodeProp=new NodeProp;function foldInside(o){let e=o.firstChild,s=o.lastChild;return e&&e.tos)continue;if(h&&d.from=e&&_.to>s&&(h=_)}}return h}function isUnfinished(o){let e=o.lastChild;return e&&e.to==o.to&&e.type.isError}function foldable(o,e,s){for(let a of o.facet(foldService)){let c=a(o,e,s);if(c)return c}return syntaxFolding(o,e,s)}function mapRange(o,e){let s=e.mapPos(o.from,1),a=e.mapPos(o.to,-1);return s>=a?void 0:{from:s,to:a}}const foldEffect=StateEffect.define({map:mapRange}),unfoldEffect=StateEffect.define({map:mapRange});function selectedLines(o){let e=[];for(let{head:s}of o.state.selection.ranges)e.some(a=>a.from<=s&&a.to>=s)||e.push(o.lineBlockAt(s));return e}const foldState=StateField.define({create(){return Decoration.none},update(o,e){o=o.map(e.changes);for(let s of e.effects)s.is(foldEffect)&&!foldExists(o,s.value.from,s.value.to)?o=o.update({add:[foldWidget.range(s.value.from,s.value.to)]}):s.is(unfoldEffect)&&(o=o.update({filter:(a,c)=>s.value.from!=a||s.value.to!=c,filterFrom:s.value.from,filterTo:s.value.to}));if(e.selection){let s=!1,{head:a}=e.selection.main;o.between(a,a,(c,h)=>{ca&&(s=!0)}),s&&(o=o.update({filterFrom:a,filterTo:a,filter:(c,h)=>h<=a||c>=a}))}return o},provide:o=>EditorView.decorations.from(o),toJSON(o,e){let s=[];return o.between(0,e.doc.length,(a,c)=>{s.push(a,c)}),s},fromJSON(o){if(!Array.isArray(o)||o.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let s=0;s{(!c||c.from>h)&&(c={from:h,to:d})}),c}function foldExists(o,e,s){let a=!1;return o.between(e,e,(c,h)=>{c==e&&h==s&&(a=!0)}),a}function maybeEnable(o,e){return o.field(foldState,!1)?e:e.concat(StateEffect.appendConfig.of(codeFolding()))}const foldCode=o=>{for(let e of selectedLines(o)){let s=foldable(o.state,e.from,e.to);if(s)return o.dispatch({effects:maybeEnable(o.state,[foldEffect.of(s),announceFold(o,s)])}),!0}return!1},unfoldCode=o=>{if(!o.state.field(foldState,!1))return!1;let e=[];for(let s of selectedLines(o)){let a=findFold(o.state,s.from,s.to);a&&e.push(unfoldEffect.of(a),announceFold(o,a,!1))}return e.length&&o.dispatch({effects:e}),e.length>0};function announceFold(o,e,s=!0){let a=o.state.doc.lineAt(e.from).number,c=o.state.doc.lineAt(e.to).number;return EditorView.announce.of(`${o.state.phrase(s?"Folded lines":"Unfolded lines")} ${a} ${o.state.phrase("to")} ${c}.`)}const foldAll=o=>{let{state:e}=o,s=[];for(let a=0;a{let e=o.state.field(foldState,!1);if(!e||!e.size)return!1;let s=[];return e.between(0,o.state.doc.length,(a,c)=>{s.push(unfoldEffect.of({from:a,to:c}))}),o.dispatch({effects:s}),!0},foldKeymap=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:foldCode},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:unfoldCode},{key:"Ctrl-Alt-[",run:foldAll},{key:"Ctrl-Alt-]",run:unfoldAll}],defaultConfig={placeholderDOM:null,placeholderText:"\u2026"},foldConfig=Facet.define({combine(o){return combineConfig(o,defaultConfig)}});function codeFolding(o){let e=[foldState,baseTheme$1$2];return o&&e.push(foldConfig.of(o)),e}const foldWidget=Decoration.replace({widget:new class extends WidgetType{toDOM(o){let{state:e}=o,s=e.facet(foldConfig),a=h=>{let d=o.lineBlockAt(o.posAtDOM(h.target)),g=findFold(o.state,d.from,d.to);g&&o.dispatch({effects:unfoldEffect.of(g)}),h.preventDefault()};if(s.placeholderDOM)return s.placeholderDOM(o,a);let c=document.createElement("span");return c.textContent=s.placeholderText,c.setAttribute("aria-label",e.phrase("folded code")),c.title=e.phrase("unfold"),c.className="cm-foldPlaceholder",c.onclick=a,c}}}),foldGutterDefaults={openText:"\u2304",closedText:"\u203A",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class FoldMarker extends GutterMarker{constructor(e,s){super(),this.config=e,this.open=s}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let s=document.createElement("span");return s.textContent=this.open?this.config.openText:this.config.closedText,s.title=e.state.phrase(this.open?"Fold line":"Unfold line"),s}}function foldGutter(o={}){let e=Object.assign(Object.assign({},foldGutterDefaults),o),s=new FoldMarker(e,!0),a=new FoldMarker(e,!1),c=ViewPlugin.fromClass(class{constructor(d){this.from=d.viewport.from,this.markers=this.buildMarkers(d)}update(d){(d.docChanged||d.viewportChanged||d.startState.facet(language)!=d.state.facet(language)||d.startState.field(foldState,!1)!=d.state.field(foldState,!1)||syntaxTree(d.startState)!=syntaxTree(d.state)||e.foldingChanged(d))&&(this.markers=this.buildMarkers(d.view))}buildMarkers(d){let g=new RangeSetBuilder;for(let _ of d.viewportLineBlocks){let b=findFold(d.state,_.from,_.to)?a:foldable(d.state,_.from,_.to)?s:null;b&&g.add(_.from,_.from,b)}return g.finish()}}),{domEventHandlers:h}=e;return[c,gutter({class:"cm-foldGutter",markers(d){var g;return((g=d.plugin(c))===null||g===void 0?void 0:g.markers)||RangeSet.empty},initialSpacer(){return new FoldMarker(e,!1)},domEventHandlers:Object.assign(Object.assign({},h),{click:(d,g,_)=>{if(h.click&&h.click(d,g,_))return!0;let b=findFold(d.state,g.from,g.to);if(b)return d.dispatch({effects:unfoldEffect.of(b)}),!0;let $=foldable(d.state,g.from,g.to);return $?(d.dispatch({effects:foldEffect.of($)}),!0):!1}})}),codeFolding()]}const baseTheme$1$2=EditorView.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 HighlightStyle{constructor(e,s){let a;function c(g){let _=StyleModule.newName();return(a||(a=Object.create(null)))["."+_]=g,_}const h=typeof s.all=="string"?s.all:s.all?c(s.all):void 0,d=s.scope;this.scope=d instanceof Language?g=>g.prop(languageDataProp)==d.data:d?g=>g==d:void 0,this.style=tagHighlighter(e.map(g=>({tag:g.tag,class:g.class||c(Object.assign({},g,{tag:null}))})),{all:h}).style,this.module=a?new StyleModule(a):null,this.themeType=s.themeType}static define(e,s){return new HighlightStyle(e,s||{})}}const highlighterFacet=Facet.define(),fallbackHighlighter=Facet.define({combine(o){return o.length?[o[0]]:null}});function getHighlighters(o){let e=o.facet(highlighterFacet);return e.length?e:o.facet(fallbackHighlighter)}function syntaxHighlighting(o,e){let s=[treeHighlighter],a;return o instanceof HighlightStyle&&(o.module&&s.push(EditorView.styleModule.of(o.module)),a=o.themeType),e!=null&&e.fallback?s.push(fallbackHighlighter.of(o)):a?s.push(highlighterFacet.computeN([EditorView.darkTheme],c=>c.facet(EditorView.darkTheme)==(a=="dark")?[o]:[])):s.push(highlighterFacet.of(o)),s}class TreeHighlighter{constructor(e){this.markCache=Object.create(null),this.tree=syntaxTree(e.state),this.decorations=this.buildDeco(e,getHighlighters(e.state))}update(e){let s=syntaxTree(e.state),a=getHighlighters(e.state),c=a!=getHighlighters(e.startState);s.length{a.add(d,g,this.markCache[_]||(this.markCache[_]=Decoration.mark({class:_})))},c,h);return a.finish()}}const treeHighlighter=Prec.high(ViewPlugin.fromClass(TreeHighlighter,{decorations:o=>o.decorations})),defaultHighlightStyle=HighlightStyle.define([{tag:tags.meta,color:"#7a757a"},{tag:tags.link,textDecoration:"underline"},{tag:tags.heading,textDecoration:"underline",fontWeight:"bold"},{tag:tags.emphasis,fontStyle:"italic"},{tag:tags.strong,fontWeight:"bold"},{tag:tags.strikethrough,textDecoration:"line-through"},{tag:tags.keyword,color:"#708"},{tag:[tags.atom,tags.bool,tags.url,tags.contentSeparator,tags.labelName],color:"#219"},{tag:[tags.literal,tags.inserted],color:"#164"},{tag:[tags.string,tags.deleted],color:"#a11"},{tag:[tags.regexp,tags.escape,tags.special(tags.string)],color:"#e40"},{tag:tags.definition(tags.variableName),color:"#00f"},{tag:tags.local(tags.variableName),color:"#30a"},{tag:[tags.typeName,tags.namespace],color:"#085"},{tag:tags.className,color:"#167"},{tag:[tags.special(tags.variableName),tags.macroName],color:"#256"},{tag:tags.definition(tags.propertyName),color:"#00c"},{tag:tags.comment,color:"#940"},{tag:tags.invalid,color:"#f00"}]),baseTheme$3=EditorView.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),DefaultScanDist=1e4,DefaultBrackets="()[]{}",bracketMatchingConfig=Facet.define({combine(o){return combineConfig(o,{afterCursor:!0,brackets:DefaultBrackets,maxScanDistance:DefaultScanDist,renderMatch:defaultRenderMatch})}}),matchingMark=Decoration.mark({class:"cm-matchingBracket"}),nonmatchingMark=Decoration.mark({class:"cm-nonmatchingBracket"});function defaultRenderMatch(o){let e=[],s=o.matched?matchingMark:nonmatchingMark;return e.push(s.range(o.start.from,o.start.to)),o.end&&e.push(s.range(o.end.from,o.end.to)),e}const bracketMatchingState=StateField.define({create(){return Decoration.none},update(o,e){if(!e.docChanged&&!e.selection)return o;let s=[],a=e.state.facet(bracketMatchingConfig);for(let c of e.state.selection.ranges){if(!c.empty)continue;let h=matchBrackets(e.state,c.head,-1,a)||c.head>0&&matchBrackets(e.state,c.head-1,1,a)||a.afterCursor&&(matchBrackets(e.state,c.head,1,a)||c.headEditorView.decorations.from(o)}),bracketMatchingUnique=[bracketMatchingState,baseTheme$3];function bracketMatching(o={}){return[bracketMatchingConfig.of(o),bracketMatchingUnique]}function matchingNodes(o,e,s){let a=o.prop(e<0?NodeProp.openedBy:NodeProp.closedBy);if(a)return a;if(o.name.length==1){let c=s.indexOf(o.name);if(c>-1&&c%2==(e<0?1:0))return[s[c+e]]}return null}function matchBrackets(o,e,s,a={}){let c=a.maxScanDistance||DefaultScanDist,h=a.brackets||DefaultBrackets,d=syntaxTree(o),g=d.resolveInner(e,s);for(let _=g;_;_=_.parent){let b=matchingNodes(_.type,s,h);if(b&&_.from<_.to)return matchMarkedBrackets(o,e,s,_,b,h)}return matchPlainBrackets(o,e,s,d,g.type,c,h)}function matchMarkedBrackets(o,e,s,a,c,h){let d=a.parent,g={from:a.from,to:a.to},_=0,b=d==null?void 0:d.cursor();if(b&&(s<0?b.childBefore(a.from):b.childAfter(a.to)))do if(s<0?b.to<=a.from:b.from>=a.to){if(_==0&&c.indexOf(b.type.name)>-1&&b.from0)return null;let b={from:s<0?e-1:e,to:s>0?e+1:e},$=o.doc.iterRange(e,s>0?o.doc.length:0),j=0;for(let _e=0;!$.next().done&&_e<=h;){let et=$.value;s<0&&(_e+=et.length);let tt=e+_e*s;for(let nt=s>0?0:et.length-1,st=s>0?et.length:-1;nt!=st;nt+=s){let rt=d.indexOf(et[nt]);if(!(rt<0||a.resolveInner(tt+nt,1).type!=c))if(rt%2==0==s>0)j++;else{if(j==1)return{start:b,end:{from:tt+nt,to:tt+nt+1},matched:rt>>1==_>>1};j--}}s>0&&(_e+=et.length)}return $.done?{start:b,matched:!1}:null}const noTokens=Object.create(null),typeArray=[NodeType.none],warned=[],defaultTable=Object.create(null);for(let[o,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"]])defaultTable[o]=createTokenType(noTokens,e);function warnForPart(o,e){warned.indexOf(o)>-1||(warned.push(o),console.warn(e))}function createTokenType(o,e){let s=null;for(let h of e.split(".")){let d=o[h]||tags[h];d?typeof d=="function"?s?s=d(s):warnForPart(h,`Modifier ${h} used at start of tag`):s?warnForPart(h,`Tag ${h} used as modifier`):s=d:warnForPart(h,`Unknown highlighting tag ${h}`)}if(!s)return 0;let a=e.replace(/ /g,"_"),c=NodeType.define({id:typeArray.length,name:a,props:[styleTags({[a]:s})]});return typeArray.push(c),c.id}const toggleComment=o=>{let e=getConfig(o.state);return e.line?toggleLineComment(o):e.block?toggleBlockCommentByLine(o):!1};function command(o,e){return({state:s,dispatch:a})=>{if(s.readOnly)return!1;let c=o(e,s);return c?(a(s.update(c)),!0):!1}}const toggleLineComment=command(changeLineComment,0),toggleBlockComment=command(changeBlockComment,0),toggleBlockCommentByLine=command((o,e)=>changeBlockComment(o,e,selectedLineRanges(e)),0);function getConfig(o,e=o.selection.main.head){let s=o.languageDataAt("commentTokens",e);return s.length?s[0]:{}}const SearchMargin=50;function findBlockComment(o,{open:e,close:s},a,c){let h=o.sliceDoc(a-SearchMargin,a),d=o.sliceDoc(c,c+SearchMargin),g=/\s*$/.exec(h)[0].length,_=/^\s*/.exec(d)[0].length,b=h.length-g;if(h.slice(b-e.length,b)==e&&d.slice(_,_+s.length)==s)return{open:{pos:a-g,margin:g&&1},close:{pos:c+_,margin:_&&1}};let $,j;c-a<=2*SearchMargin?$=j=o.sliceDoc(a,c):($=o.sliceDoc(a,a+SearchMargin),j=o.sliceDoc(c-SearchMargin,c));let _e=/^\s*/.exec($)[0].length,et=/\s*$/.exec(j)[0].length,tt=j.length-et-s.length;return $.slice(_e,_e+e.length)==e&&j.slice(tt,tt+s.length)==s?{open:{pos:a+_e+e.length,margin:/\s/.test($.charAt(_e+e.length))?1:0},close:{pos:c-et-s.length,margin:/\s/.test(j.charAt(tt-1))?1:0}}:null}function selectedLineRanges(o){let e=[];for(let s of o.selection.ranges){let a=o.doc.lineAt(s.from),c=s.to<=a.to?a:o.doc.lineAt(s.to),h=e.length-1;h>=0&&e[h].to>a.from?e[h].to=c.to:e.push({from:a.from,to:c.to})}return e}function changeBlockComment(o,e,s=e.selection.ranges){let a=s.map(h=>getConfig(e,h.from).block);if(!a.every(h=>h))return null;let c=s.map((h,d)=>findBlockComment(e,a[d],h.from,h.to));if(o!=2&&!c.every(h=>h))return{changes:e.changes(s.map((h,d)=>c[d]?[]:[{from:h.from,insert:a[d].open+" "},{from:h.to,insert:" "+a[d].close}]))};if(o!=1&&c.some(h=>h)){let h=[];for(let d=0,g;dc&&(h==d||d>$.from)){c=$.from;let j=getConfig(e,b).line;if(!j)continue;let _e=/^\s*/.exec($.text)[0].length,et=_e==$.length,tt=$.text.slice(_e,_e+j.length)==j?_e:-1;_e<$.text.length&&_e<_&&(_=_e),a.push({line:$,comment:tt,token:j,indent:_e,empty:et,single:!1})}b=$.to+1}if(_<1e9)for(let b=g;bh.comment<0&&(!h.empty||h.single))){let h=[];for(let{line:g,token:_,indent:b,empty:$,single:j}of a)(j||!$)&&h.push({from:g.from+b,insert:_+" "});let d=e.changes(h);return{changes:d,selection:e.selection.map(d,1)}}else if(o!=1&&a.some(h=>h.comment>=0)){let h=[];for(let{line:d,comment:g,token:_}of a)if(g>=0){let b=d.from+g,$=b+_.length;d.text[$-d.from]==" "&&$++,h.push({from:b,to:$})}return{changes:h}}return null}const fromHistory=Annotation.define(),isolateHistory=Annotation.define(),invertedEffects=Facet.define(),historyConfig=Facet.define({combine(o){return combineConfig(o,{minDepth:100,newGroupDelay:500},{minDepth:Math.max,newGroupDelay:Math.min})}});function changeEnd(o){let e=0;return o.iterChangedRanges((s,a)=>e=a),e}const historyField_=StateField.define({create(){return HistoryState.empty},update(o,e){let s=e.state.facet(historyConfig),a=e.annotation(fromHistory);if(a){let _=e.docChanged?EditorSelection.single(changeEnd(e.changes)):void 0,b=HistEvent.fromTransaction(e,_),$=a.side,j=$==0?o.undone:o.done;return b?j=updateBranch(j,j.length,s.minDepth,b):j=addSelection(j,e.startState.selection),new HistoryState($==0?a.rest:j,$==0?j:a.rest)}let c=e.annotation(isolateHistory);if((c=="full"||c=="before")&&(o=o.isolate()),e.annotation(Transaction.addToHistory)===!1)return e.changes.empty?o:o.addMapping(e.changes.desc);let h=HistEvent.fromTransaction(e),d=e.annotation(Transaction.time),g=e.annotation(Transaction.userEvent);return h?o=o.addChanges(h,d,g,s.newGroupDelay,s.minDepth):e.selection&&(o=o.addSelection(e.startState.selection,d,g,s.newGroupDelay)),(c=="full"||c=="after")&&(o=o.isolate()),o},toJSON(o){return{done:o.done.map(e=>e.toJSON()),undone:o.undone.map(e=>e.toJSON())}},fromJSON(o){return new HistoryState(o.done.map(HistEvent.fromJSON),o.undone.map(HistEvent.fromJSON))}});function history(o={}){return[historyField_,historyConfig.of(o),EditorView.domEventHandlers({beforeinput(e,s){let a=e.inputType=="historyUndo"?undo:e.inputType=="historyRedo"?redo:null;return a?(e.preventDefault(),a(s)):!1}})]}function cmd(o,e){return function({state:s,dispatch:a}){if(!e&&s.readOnly)return!1;let c=s.field(historyField_,!1);if(!c)return!1;let h=c.pop(o,s,e);return h?(a(h),!0):!1}}const undo=cmd(0,!1),redo=cmd(1,!1),undoSelection=cmd(0,!0),redoSelection=cmd(1,!0);class HistEvent{constructor(e,s,a,c,h){this.changes=e,this.effects=s,this.mapped=a,this.startSelection=c,this.selectionsAfter=h}setSelAfter(e){return new HistEvent(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,s,a;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(s=this.mapped)===null||s===void 0?void 0:s.toJSON(),startSelection:(a=this.startSelection)===null||a===void 0?void 0:a.toJSON(),selectionsAfter:this.selectionsAfter.map(c=>c.toJSON())}}static fromJSON(e){return new HistEvent(e.changes&&ChangeSet.fromJSON(e.changes),[],e.mapped&&ChangeDesc.fromJSON(e.mapped),e.startSelection&&EditorSelection.fromJSON(e.startSelection),e.selectionsAfter.map(EditorSelection.fromJSON))}static fromTransaction(e,s){let a=none$1;for(let c of e.startState.facet(invertedEffects)){let h=c(e);h.length&&(a=a.concat(h))}return!a.length&&e.changes.empty?null:new HistEvent(e.changes.invert(e.startState.doc),a,void 0,s||e.startState.selection,none$1)}static selection(e){return new HistEvent(void 0,none$1,void 0,void 0,e)}}function updateBranch(o,e,s,a){let c=e+1>s+20?e-s-1:0,h=o.slice(c,e);return h.push(a),h}function isAdjacent(o,e){let s=[],a=!1;return o.iterChangedRanges((c,h)=>s.push(c,h)),e.iterChangedRanges((c,h,d,g)=>{for(let _=0;_=b&&d<=$&&(a=!0)}}),a}function eqSelectionShape(o,e){return o.ranges.length==e.ranges.length&&o.ranges.filter((s,a)=>s.empty!=e.ranges[a].empty).length===0}function conc(o,e){return o.length?e.length?o.concat(e):o:e}const none$1=[],MaxSelectionsPerEvent=200;function addSelection(o,e){if(o.length){let s=o[o.length-1],a=s.selectionsAfter.slice(Math.max(0,s.selectionsAfter.length-MaxSelectionsPerEvent));return a.length&&a[a.length-1].eq(e)?o:(a.push(e),updateBranch(o,o.length-1,1e9,s.setSelAfter(a)))}else return[HistEvent.selection([e])]}function popSelection(o){let e=o[o.length-1],s=o.slice();return s[o.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),s}function addMappingToBranch(o,e){if(!o.length)return o;let s=o.length,a=none$1;for(;s;){let c=mapEvent(o[s-1],e,a);if(c.changes&&!c.changes.empty||c.effects.length){let h=o.slice(0,s);return h[s-1]=c,h}else e=c.mapped,s--,a=c.selectionsAfter}return a.length?[HistEvent.selection(a)]:none$1}function mapEvent(o,e,s){let a=conc(o.selectionsAfter.length?o.selectionsAfter.map(g=>g.map(e)):none$1,s);if(!o.changes)return HistEvent.selection(a);let c=o.changes.map(e),h=e.mapDesc(o.changes,!0),d=o.mapped?o.mapped.composeDesc(h):h;return new HistEvent(c,StateEffect.mapEffects(o.effects,e),d,o.startSelection.map(h),a)}const joinableUserEvent=/^(input\.type|delete)($|\.)/;class HistoryState{constructor(e,s,a=0,c=void 0){this.done=e,this.undone=s,this.prevTime=a,this.prevUserEvent=c}isolate(){return this.prevTime?new HistoryState(this.done,this.undone):this}addChanges(e,s,a,c,h){let d=this.done,g=d[d.length-1];return g&&g.changes&&!g.changes.empty&&e.changes&&(!a||joinableUserEvent.test(a))&&(!g.selectionsAfter.length&&s-this.prevTime0&&s-this.prevTimes.empty?o.moveByChar(s,e):rangeEnd(s,e))}function ltrAtCursor(o){return o.textDirectionAt(o.state.selection.main.head)==Direction.LTR}const cursorCharLeft=o=>cursorByChar(o,!ltrAtCursor(o)),cursorCharRight=o=>cursorByChar(o,ltrAtCursor(o));function cursorByGroup(o,e){return moveSel(o,s=>s.empty?o.moveByGroup(s,e):rangeEnd(s,e))}const cursorGroupLeft=o=>cursorByGroup(o,!ltrAtCursor(o)),cursorGroupRight=o=>cursorByGroup(o,ltrAtCursor(o));function interestingNode(o,e,s){if(e.type.prop(s))return!0;let a=e.to-e.from;return a&&(a>2||/[^\s,.;:]/.test(o.sliceDoc(e.from,e.to)))||e.firstChild}function moveBySyntax(o,e,s){let a=syntaxTree(o).resolveInner(e.head),c=s?NodeProp.closedBy:NodeProp.openedBy;for(let _=e.head;;){let b=s?a.childAfter(_):a.childBefore(_);if(!b)break;interestingNode(o,b,c)?a=b:_=s?b.to:b.from}let h=a.type.prop(c),d,g;return h&&(d=s?matchBrackets(o,a.from,1):matchBrackets(o,a.to,-1))&&d.matched?g=s?d.end.to:d.end.from:g=s?a.to:a.from,EditorSelection.cursor(g,s?-1:1)}const cursorSyntaxLeft=o=>moveSel(o,e=>moveBySyntax(o.state,e,!ltrAtCursor(o))),cursorSyntaxRight=o=>moveSel(o,e=>moveBySyntax(o.state,e,ltrAtCursor(o)));function cursorByLine(o,e){return moveSel(o,s=>{if(!s.empty)return rangeEnd(s,e);let a=o.moveVertically(s,e);return a.head!=s.head?a:o.moveToLineBoundary(s,e)})}const cursorLineUp=o=>cursorByLine(o,!1),cursorLineDown=o=>cursorByLine(o,!0);function pageHeight(o){return Math.max(o.defaultLineHeight,Math.min(o.dom.clientHeight,innerHeight)-5)}function cursorByPage(o,e){let{state:s}=o,a=updateSel(s.selection,g=>g.empty?o.moveVertically(g,e,pageHeight(o)):rangeEnd(g,e));if(a.eq(s.selection))return!1;let c=o.coordsAtPos(s.selection.main.head),h=o.scrollDOM.getBoundingClientRect(),d;return c&&c.top>h.top&&c.bottomcursorByPage(o,!1),cursorPageDown=o=>cursorByPage(o,!0);function moveByLineBoundary(o,e,s){let a=o.lineBlockAt(e.head),c=o.moveToLineBoundary(e,s);if(c.head==e.head&&c.head!=(s?a.to:a.from)&&(c=o.moveToLineBoundary(e,s,!1)),!s&&c.head==a.from&&a.length){let h=/^\s*/.exec(o.state.sliceDoc(a.from,Math.min(a.from+100,a.to)))[0].length;h&&e.head!=a.from+h&&(c=EditorSelection.cursor(a.from+h))}return c}const cursorLineBoundaryForward=o=>moveSel(o,e=>moveByLineBoundary(o,e,!0)),cursorLineBoundaryBackward=o=>moveSel(o,e=>moveByLineBoundary(o,e,!1)),cursorLineStart=o=>moveSel(o,e=>EditorSelection.cursor(o.lineBlockAt(e.head).from,1)),cursorLineEnd=o=>moveSel(o,e=>EditorSelection.cursor(o.lineBlockAt(e.head).to,-1));function toMatchingBracket(o,e,s){let a=!1,c=updateSel(o.selection,h=>{let d=matchBrackets(o,h.head,-1)||matchBrackets(o,h.head,1)||h.head>0&&matchBrackets(o,h.head-1,1)||h.headtoMatchingBracket(o,e,!1);function extendSel(o,e){let s=updateSel(o.state.selection,a=>{let c=e(a);return EditorSelection.range(a.anchor,c.head,c.goalColumn)});return s.eq(o.state.selection)?!1:(o.dispatch(setSel(o.state,s)),!0)}function selectByChar(o,e){return extendSel(o,s=>o.moveByChar(s,e))}const selectCharLeft=o=>selectByChar(o,!ltrAtCursor(o)),selectCharRight=o=>selectByChar(o,ltrAtCursor(o));function selectByGroup(o,e){return extendSel(o,s=>o.moveByGroup(s,e))}const selectGroupLeft=o=>selectByGroup(o,!ltrAtCursor(o)),selectGroupRight=o=>selectByGroup(o,ltrAtCursor(o)),selectSyntaxLeft=o=>extendSel(o,e=>moveBySyntax(o.state,e,!ltrAtCursor(o))),selectSyntaxRight=o=>extendSel(o,e=>moveBySyntax(o.state,e,ltrAtCursor(o)));function selectByLine(o,e){return extendSel(o,s=>o.moveVertically(s,e))}const selectLineUp=o=>selectByLine(o,!1),selectLineDown=o=>selectByLine(o,!0);function selectByPage(o,e){return extendSel(o,s=>o.moveVertically(s,e,pageHeight(o)))}const selectPageUp=o=>selectByPage(o,!1),selectPageDown=o=>selectByPage(o,!0),selectLineBoundaryForward=o=>extendSel(o,e=>moveByLineBoundary(o,e,!0)),selectLineBoundaryBackward=o=>extendSel(o,e=>moveByLineBoundary(o,e,!1)),selectLineStart=o=>extendSel(o,e=>EditorSelection.cursor(o.lineBlockAt(e.head).from)),selectLineEnd=o=>extendSel(o,e=>EditorSelection.cursor(o.lineBlockAt(e.head).to)),cursorDocStart=({state:o,dispatch:e})=>(e(setSel(o,{anchor:0})),!0),cursorDocEnd=({state:o,dispatch:e})=>(e(setSel(o,{anchor:o.doc.length})),!0),selectDocStart=({state:o,dispatch:e})=>(e(setSel(o,{anchor:o.selection.main.anchor,head:0})),!0),selectDocEnd=({state:o,dispatch:e})=>(e(setSel(o,{anchor:o.selection.main.anchor,head:o.doc.length})),!0),selectAll=({state:o,dispatch:e})=>(e(o.update({selection:{anchor:0,head:o.doc.length},userEvent:"select"})),!0),selectLine=({state:o,dispatch:e})=>{let s=selectedLineBlocks(o).map(({from:a,to:c})=>EditorSelection.range(a,Math.min(c+1,o.doc.length)));return e(o.update({selection:EditorSelection.create(s),userEvent:"select"})),!0},selectParentSyntax=({state:o,dispatch:e})=>{let s=updateSel(o.selection,a=>{var c;let h=syntaxTree(o).resolveInner(a.head,1);for(;!(h.from=a.to||h.to>a.to&&h.from<=a.from||!(!((c=h.parent)===null||c===void 0)&&c.parent));)h=h.parent;return EditorSelection.range(h.to,h.from)});return e(setSel(o,s)),!0},simplifySelection=({state:o,dispatch:e})=>{let s=o.selection,a=null;return s.ranges.length>1?a=EditorSelection.create([s.main]):s.main.empty||(a=EditorSelection.create([EditorSelection.cursor(s.main.head)])),a?(e(setSel(o,a)),!0):!1};function deleteBy({state:o,dispatch:e},s){if(o.readOnly)return!1;let a="delete.selection",c=o.changeByRange(h=>{let{from:d,to:g}=h;if(d==g){let _=s(d);_d&&(a="delete.forward"),d=Math.min(d,_),g=Math.max(g,_)}return d==g?{range:h}:{changes:{from:d,to:g},range:EditorSelection.cursor(d)}});return c.changes.empty?!1:(e(o.update(c,{scrollIntoView:!0,userEvent:a,effects:a=="delete.selection"?EditorView.announce.of(o.phrase("Selection deleted")):void 0})),!0)}function skipAtomic(o,e,s){if(o instanceof EditorView)for(let a of o.state.facet(EditorView.atomicRanges).map(c=>c(o)))a.between(e,e,(c,h)=>{ce&&(e=s?h:c)});return e}const deleteByChar=(o,e)=>deleteBy(o,s=>{let{state:a}=o,c=a.doc.lineAt(s),h,d;if(!e&&s>c.from&&sdeleteByChar(o,!1),deleteCharForward=o=>deleteByChar(o,!0),deleteByGroup=(o,e)=>deleteBy(o,s=>{let a=s,{state:c}=o,h=c.doc.lineAt(a),d=c.charCategorizer(a);for(let g=null;;){if(a==(e?h.to:h.from)){a==s&&h.number!=(e?c.doc.lines:1)&&(a+=e?1:-1);break}let _=findClusterBreak(h.text,a-h.from,e)+h.from,b=h.text.slice(Math.min(a,_)-h.from,Math.max(a,_)-h.from),$=d(b);if(g!=null&&$!=g)break;(b!=" "||a!=s)&&(g=$),a=_}return skipAtomic(o,a,e)}),deleteGroupBackward=o=>deleteByGroup(o,!1),deleteGroupForward=o=>deleteByGroup(o,!0),deleteToLineEnd=o=>deleteBy(o,e=>{let s=o.lineBlockAt(e).to;return skipAtomic(o,edeleteBy(o,e=>{let s=o.lineBlockAt(e).from;return skipAtomic(o,e>s?s:Math.max(0,e-1),!1)}),splitLine=({state:o,dispatch:e})=>{if(o.readOnly)return!1;let s=o.changeByRange(a=>({changes:{from:a.from,to:a.to,insert:Text.of(["",""])},range:EditorSelection.cursor(a.from)}));return e(o.update(s,{scrollIntoView:!0,userEvent:"input"})),!0},transposeChars=({state:o,dispatch:e})=>{if(o.readOnly)return!1;let s=o.changeByRange(a=>{if(!a.empty||a.from==0||a.from==o.doc.length)return{range:a};let c=a.from,h=o.doc.lineAt(c),d=c==h.from?c-1:findClusterBreak(h.text,c-h.from,!1)+h.from,g=c==h.to?c+1:findClusterBreak(h.text,c-h.from,!0)+h.from;return{changes:{from:d,to:g,insert:o.doc.slice(c,g).append(o.doc.slice(d,c))},range:EditorSelection.cursor(g)}});return s.changes.empty?!1:(e(o.update(s,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function selectedLineBlocks(o){let e=[],s=-1;for(let a of o.selection.ranges){let c=o.doc.lineAt(a.from),h=o.doc.lineAt(a.to);if(!a.empty&&a.to==h.from&&(h=o.doc.lineAt(a.to-1)),s>=c.number){let d=e[e.length-1];d.to=h.to,d.ranges.push(a)}else e.push({from:c.from,to:h.to,ranges:[a]});s=h.number+1}return e}function moveLine(o,e,s){if(o.readOnly)return!1;let a=[],c=[];for(let h of selectedLineBlocks(o)){if(s?h.to==o.doc.length:h.from==0)continue;let d=o.doc.lineAt(s?h.to+1:h.from-1),g=d.length+1;if(s){a.push({from:h.to,to:d.to},{from:h.from,insert:d.text+o.lineBreak});for(let _ of h.ranges)c.push(EditorSelection.range(Math.min(o.doc.length,_.anchor+g),Math.min(o.doc.length,_.head+g)))}else{a.push({from:d.from,to:h.from},{from:h.to,insert:o.lineBreak+d.text});for(let _ of h.ranges)c.push(EditorSelection.range(_.anchor-g,_.head-g))}}return a.length?(e(o.update({changes:a,scrollIntoView:!0,selection:EditorSelection.create(c,o.selection.mainIndex),userEvent:"move.line"})),!0):!1}const moveLineUp=({state:o,dispatch:e})=>moveLine(o,e,!1),moveLineDown=({state:o,dispatch:e})=>moveLine(o,e,!0);function copyLine(o,e,s){if(o.readOnly)return!1;let a=[];for(let c of selectedLineBlocks(o))s?a.push({from:c.from,insert:o.doc.slice(c.from,c.to)+o.lineBreak}):a.push({from:c.to,insert:o.lineBreak+o.doc.slice(c.from,c.to)});return e(o.update({changes:a,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const copyLineUp=({state:o,dispatch:e})=>copyLine(o,e,!1),copyLineDown=({state:o,dispatch:e})=>copyLine(o,e,!0),deleteLine=o=>{if(o.state.readOnly)return!1;let{state:e}=o,s=e.changes(selectedLineBlocks(e).map(({from:c,to:h})=>(c>0?c--:ho.moveVertically(c,!0)).map(s);return o.dispatch({changes:s,selection:a,scrollIntoView:!0,userEvent:"delete.line"}),!0};function isBetweenBrackets(o,e){if(/\(\)|\[\]|\{\}/.test(o.sliceDoc(e-1,e+1)))return{from:e,to:e};let s=syntaxTree(o).resolveInner(e),a=s.childBefore(e),c=s.childAfter(e),h;return a&&c&&a.to<=e&&c.from>=e&&(h=a.type.prop(NodeProp.closedBy))&&h.indexOf(c.name)>-1&&o.doc.lineAt(a.to).from==o.doc.lineAt(c.from).from?{from:a.to,to:c.from}:null}const insertNewlineAndIndent=newlineAndIndent(!1),insertBlankLine=newlineAndIndent(!0);function newlineAndIndent(o){return({state:e,dispatch:s})=>{if(e.readOnly)return!1;let a=e.changeByRange(c=>{let{from:h,to:d}=c,g=e.doc.lineAt(h),_=!o&&h==d&&isBetweenBrackets(e,h);o&&(h=d=(d<=g.to?g:e.doc.lineAt(d)).to);let b=new IndentContext(e,{simulateBreak:h,simulateDoubleBreak:!!_}),$=getIndentation(b,h);for($==null&&($=/^\s*/.exec(e.doc.lineAt(h).text)[0].length);dg.from&&h{let c=[];for(let d=a.from;d<=a.to;){let g=o.doc.lineAt(d);g.number>s&&(a.empty||a.to>g.from)&&(e(g,c,a),s=g.number),d=g.to+1}let h=o.changes(c);return{changes:c,range:EditorSelection.range(h.mapPos(a.anchor,1),h.mapPos(a.head,1))}})}const indentSelection=({state:o,dispatch:e})=>{if(o.readOnly)return!1;let s=Object.create(null),a=new IndentContext(o,{overrideIndentation:h=>{let d=s[h];return d==null?-1:d}}),c=changeBySelectedLine(o,(h,d,g)=>{let _=getIndentation(a,h.from);if(_==null)return;/\S/.test(h.text)||(_=0);let b=/^\s*/.exec(h.text)[0],$=indentString(o,_);(b!=$||g.fromo.readOnly?!1:(e(o.update(changeBySelectedLine(o,(s,a)=>{a.push({from:s.from,insert:o.facet(indentUnit)})}),{userEvent:"input.indent"})),!0),indentLess=({state:o,dispatch:e})=>o.readOnly?!1:(e(o.update(changeBySelectedLine(o,(s,a)=>{let c=/^\s*/.exec(s.text)[0];if(!c)return;let h=countColumn(c,o.tabSize),d=0,g=indentString(o,Math.max(0,h-getIndentUnit(o)));for(;d({mac:o.key,run:o.run,shift:o.shift}))),defaultKeymap=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:cursorSyntaxLeft,shift:selectSyntaxLeft},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:cursorSyntaxRight,shift:selectSyntaxRight},{key:"Alt-ArrowUp",run:moveLineUp},{key:"Shift-Alt-ArrowUp",run:copyLineUp},{key:"Alt-ArrowDown",run:moveLineDown},{key:"Shift-Alt-ArrowDown",run:copyLineDown},{key:"Escape",run:simplifySelection},{key:"Mod-Enter",run:insertBlankLine},{key:"Alt-l",mac:"Ctrl-l",run:selectLine},{key:"Mod-i",run:selectParentSyntax,preventDefault:!0},{key:"Mod-[",run:indentLess},{key:"Mod-]",run:indentMore},{key:"Mod-Alt-\\",run:indentSelection},{key:"Shift-Mod-k",run:deleteLine},{key:"Shift-Mod-\\",run:cursorMatchingBracket},{key:"Mod-/",run:toggleComment},{key:"Alt-A",run:toggleBlockComment}].concat(standardKeymap),indentWithTab={key:"Tab",run:indentMore,shift:indentLess};function crelt(){var o=arguments[0];typeof o=="string"&&(o=document.createElement(o));var e=1,s=arguments[1];if(s&&typeof s=="object"&&s.nodeType==null&&!Array.isArray(s)){for(var a in s)if(Object.prototype.hasOwnProperty.call(s,a)){var c=s[a];typeof c=="string"?o.setAttribute(a,c):c!=null&&(o[a]=c)}e++}for(;eo.normalize("NFKD"):o=>o;class SearchCursor{constructor(e,s,a=0,c=e.length,h){this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(a,c),this.bufferStart=a,this.normalize=h?d=>h(basicNormalize(d)):basicNormalize,this.query=this.normalize(s)}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 codePointAt(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 s=fromCodePoint(e),a=this.bufferStart+this.bufferPos;this.bufferPos+=codePointSize(e);let c=this.normalize(s);for(let h=0,d=a;;h++){let g=c.charCodeAt(h),_=this.match(g,d);if(_)return this.value=_,this;if(h==c.length-1)break;d==a&&hthis.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 s=this.matchPos<=this.to&&this.re.exec(this.curLine);if(s){let a=this.curLineStart+s.index,c=a+s[0].length;if(this.matchPos=c+(a==c?1:0),a==this.curLine.length&&this.nextLine(),athis.value.to)return this.value={from:a,to:c,match:s},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=a||c.to<=s){let g=new FlattenedDoc(s,e.sliceString(s,a));return flattened.set(e,g),g}if(c.from==s&&c.to==a)return c;let{text:h,from:d}=c;return d>s&&(h=e.sliceString(s,d)+h,d=s),c.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,s=this.re.exec(this.flat.text);if(s&&!s[0]&&s.index==e&&(this.re.lastIndex=e+1,s=this.re.exec(this.flat.text)),s&&this.flat.tothis.flat.text.length-10&&(s=null),s){let a=this.flat.from+s.index,c=a+s[0].length;return this.value={from:a,to:c,match:s},this.matchPos=c+(a==c?1:0),this}else{if(this.flat.to==this.to)return this.done=!0,this;this.flat=FlattenedDoc.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}}typeof Symbol<"u"&&(RegExpCursor.prototype[Symbol.iterator]=MultilineRegExpCursor.prototype[Symbol.iterator]=function(){return this});function validRegExp(o){try{return new RegExp(o,baseFlags),!0}catch{return!1}}function createLineDialog(o){let e=crelt("input",{class:"cm-textfield",name:"line"}),s=crelt("form",{class:"cm-gotoLine",onkeydown:c=>{c.keyCode==27?(c.preventDefault(),o.dispatch({effects:dialogEffect.of(!1)}),o.focus()):c.keyCode==13&&(c.preventDefault(),a())},onsubmit:c=>{c.preventDefault(),a()}},crelt("label",o.state.phrase("Go to line"),": ",e)," ",crelt("button",{class:"cm-button",type:"submit"},o.state.phrase("go")));function a(){let c=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(e.value);if(!c)return;let{state:h}=o,d=h.doc.lineAt(h.selection.main.head),[,g,_,b,$]=c,j=b?+b.slice(1):0,_e=_?+_:d.number;if(_&&$){let tt=_e/100;g&&(tt=tt*(g=="-"?-1:1)+d.number/h.doc.lines),_e=Math.round(h.doc.lines*tt)}else _&&g&&(_e=_e*(g=="-"?-1:1)+d.number);let et=h.doc.line(Math.max(1,Math.min(h.doc.lines,_e)));o.dispatch({effects:dialogEffect.of(!1),selection:EditorSelection.cursor(et.from+Math.max(0,Math.min(j,et.length))),scrollIntoView:!0}),o.focus()}return{dom:s}}const dialogEffect=StateEffect.define(),dialogField=StateField.define({create(){return!0},update(o,e){for(let s of e.effects)s.is(dialogEffect)&&(o=s.value);return o},provide:o=>showPanel.from(o,e=>e?createLineDialog:null)}),gotoLine=o=>{let e=getPanel(o,createLineDialog);if(!e){let s=[dialogEffect.of(!0)];o.state.field(dialogField,!1)==null&&s.push(StateEffect.appendConfig.of([dialogField,baseTheme$1$1])),o.dispatch({effects:s}),e=getPanel(o,createLineDialog)}return e&&e.dom.querySelector("input").focus(),!0},baseTheme$1$1=EditorView.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),defaultHighlightOptions={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},highlightConfig=Facet.define({combine(o){return combineConfig(o,defaultHighlightOptions,{highlightWordAroundCursor:(e,s)=>e||s,minSelectionLength:Math.min,maxMatches:Math.min})}});function highlightSelectionMatches(o){let e=[defaultTheme,matchHighlighter];return o&&e.push(highlightConfig.of(o)),e}const matchDeco=Decoration.mark({class:"cm-selectionMatch"}),mainMatchDeco=Decoration.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function insideWordBoundaries(o,e,s,a){return(s==0||o(e.sliceDoc(s-1,s))!=CharCategory.Word)&&(a==e.doc.length||o(e.sliceDoc(a,a+1))!=CharCategory.Word)}function insideWord(o,e,s,a){return o(e.sliceDoc(s,s+1))==CharCategory.Word&&o(e.sliceDoc(a-1,a))==CharCategory.Word}const matchHighlighter=ViewPlugin.fromClass(class{constructor(o){this.decorations=this.getDeco(o)}update(o){(o.selectionSet||o.docChanged||o.viewportChanged)&&(this.decorations=this.getDeco(o.view))}getDeco(o){let e=o.state.facet(highlightConfig),{state:s}=o,a=s.selection;if(a.ranges.length>1)return Decoration.none;let c=a.main,h,d=null;if(c.empty){if(!e.highlightWordAroundCursor)return Decoration.none;let _=s.wordAt(c.head);if(!_)return Decoration.none;d=s.charCategorizer(c.head),h=s.sliceDoc(_.from,_.to)}else{let _=c.to-c.from;if(_200)return Decoration.none;if(e.wholeWords){if(h=s.sliceDoc(c.from,c.to),d=s.charCategorizer(c.head),!(insideWordBoundaries(d,s,c.from,c.to)&&insideWord(d,s,c.from,c.to)))return Decoration.none}else if(h=s.sliceDoc(c.from,c.to).trim(),!h)return Decoration.none}let g=[];for(let _ of o.visibleRanges){let b=new SearchCursor(s.doc,h,_.from,_.to);for(;!b.next().done;){let{from:$,to:j}=b.value;if((!d||insideWordBoundaries(d,s,$,j))&&(c.empty&&$<=c.from&&j>=c.to?g.push(mainMatchDeco.range($,j)):($>=c.to||j<=c.from)&&g.push(matchDeco.range($,j)),g.length>e.maxMatches))return Decoration.none}}return Decoration.set(g)}},{decorations:o=>o.decorations}),defaultTheme=EditorView.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),selectWord=({state:o,dispatch:e})=>{let{selection:s}=o,a=EditorSelection.create(s.ranges.map(c=>o.wordAt(c.head)||EditorSelection.cursor(c.head)),s.mainIndex);return a.eq(s)?!1:(e(o.update({selection:a})),!0)};function findNextOccurrence(o,e){let{main:s,ranges:a}=o.selection,c=o.wordAt(s.head),h=c&&c.from==s.from&&c.to==s.to;for(let d=!1,g=new SearchCursor(o.doc,e,a[a.length-1].to);;)if(g.next(),g.done){if(d)return null;g=new SearchCursor(o.doc,e,0,Math.max(0,a[a.length-1].from-1)),d=!0}else{if(d&&a.some(_=>_.from==g.value.from))continue;if(h){let _=o.wordAt(g.value.from);if(!_||_.from!=g.value.from||_.to!=g.value.to)continue}return g.value}}const selectNextOccurrence=({state:o,dispatch:e})=>{let{ranges:s}=o.selection;if(s.some(h=>h.from===h.to))return selectWord({state:o,dispatch:e});let a=o.sliceDoc(s[0].from,s[0].to);if(o.selection.ranges.some(h=>o.sliceDoc(h.from,h.to)!=a))return!1;let c=findNextOccurrence(o,a);return c?(e(o.update({selection:o.selection.addRange(EditorSelection.range(c.from,c.to),!1),effects:EditorView.scrollIntoView(c.to)})),!0):!1},searchConfigFacet=Facet.define({combine(o){var e;return{top:o.reduce((s,a)=>s!=null?s:a.top,void 0)||!1,caseSensitive:o.reduce((s,a)=>s!=null?s:a.caseSensitive,void 0)||!1,createPanel:((e=o.find(s=>s.createPanel))===null||e===void 0?void 0:e.createPanel)||(s=>new SearchPanel(s))}}});class SearchQuery{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||validRegExp(this.search)),this.unquoted=e.literal?this.search:this.search.replace(/\\([nrt\\])/g,(s,a)=>a=="n"?` `:a=="r"?"\r":a=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp}create(){return this.regexp?new RegExpQuery(this):new StringQuery(this)}getCursor(e,s=0,a=e.length){return this.regexp?regexpCursor(this,e,s,a):stringCursor(this,e,s,a)}}class QueryType{constructor(e){this.spec=e}}function stringCursor(o,e,s,a){return new SearchCursor(e,o.unquoted,s,a,o.caseSensitive?void 0:c=>c.toLowerCase())}class StringQuery extends QueryType{constructor(e){super(e)}nextMatch(e,s,a){let c=stringCursor(this.spec,e,a,e.length).nextOverlapping();return c.done&&(c=stringCursor(this.spec,e,0,s).nextOverlapping()),c.done?null:c.value}prevMatchInRange(e,s,a){for(let c=a;;){let h=Math.max(s,c-1e4-this.spec.unquoted.length),d=stringCursor(this.spec,e,h,c),g=null;for(;!d.nextOverlapping().done;)g=d.value;if(g)return g;if(h==s)return null;c-=1e4}}prevMatch(e,s,a){return this.prevMatchInRange(e,0,s)||this.prevMatchInRange(e,a,e.length)}getReplacement(e){return this.spec.replace}matchAll(e,s){let a=stringCursor(this.spec,e,0,e.length),c=[];for(;!a.next().done;){if(c.length>=s)return null;c.push(a.value)}return c}highlight(e,s,a,c){let h=stringCursor(this.spec,e,Math.max(0,s-this.spec.unquoted.length),Math.min(a+this.spec.unquoted.length,e.length));for(;!h.next().done;)c(h.value.from,h.value.to)}}function regexpCursor(o,e,s,a){return new RegExpCursor(e,o.search,o.caseSensitive?void 0:{ignoreCase:!0},s,a)}class RegExpQuery extends QueryType{nextMatch(e,s,a){let c=regexpCursor(this.spec,e,a,e.length).next();return c.done&&(c=regexpCursor(this.spec,e,0,s).next()),c.done?null:c.value}prevMatchInRange(e,s,a){for(let c=1;;c++){let h=Math.max(s,a-c*1e4),d=regexpCursor(this.spec,e,h,a),g=null;for(;!d.next().done;)g=d.value;if(g&&(h==s||g.from>h+10))return g;if(h==s)return null}}prevMatch(e,s,a){return this.prevMatchInRange(e,0,s)||this.prevMatchInRange(e,a,e.length)}getReplacement(e){return this.spec.replace.replace(/\$([$&\d+])/g,(s,a)=>a=="$"?"$":a=="&"?e.match[0]:a!="0"&&+a=s)return null;c.push(a.value)}return c}highlight(e,s,a,c){let h=regexpCursor(this.spec,e,Math.max(0,s-250),Math.min(a+250,e.length));for(;!h.next().done;)c(h.value.from,h.value.to)}}const setSearchQuery=StateEffect.define(),togglePanel$1=StateEffect.define(),searchState=StateField.define({create(o){return new SearchState(defaultQuery(o).create(),null)},update(o,e){for(let s of e.effects)s.is(setSearchQuery)?o=new SearchState(s.value.create(),o.panel):s.is(togglePanel$1)&&(o=new SearchState(o.query,s.value?createSearchPanel:null));return o},provide:o=>showPanel.from(o,e=>e.panel)});class SearchState{constructor(e,s){this.query=e,this.panel=s}}const matchMark=Decoration.mark({class:"cm-searchMatch"}),selectedMatchMark=Decoration.mark({class:"cm-searchMatch cm-searchMatch-selected"}),searchHighlighter=ViewPlugin.fromClass(class{constructor(o){this.view=o,this.decorations=this.highlight(o.state.field(searchState))}update(o){let e=o.state.field(searchState);(e!=o.startState.field(searchState)||o.docChanged||o.selectionSet||o.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:o,panel:e}){if(!e||!o.spec.valid)return Decoration.none;let{view:s}=this,a=new RangeSetBuilder;for(let c=0,h=s.visibleRanges,d=h.length;ch[c+1].from-2*250;)_=h[++c].to;o.highlight(s.state.doc,g,_,(b,$)=>{let j=s.state.selection.ranges.some(_e=>_e.from==b&&_e.to==$);a.add(b,$,j?selectedMatchMark:matchMark)})}return a.finish()}},{decorations:o=>o.decorations});function searchCommand(o){return e=>{let s=e.state.field(searchState,!1);return s&&s.query.spec.valid?o(e,s):openSearchPanel(e)}}const findNext=searchCommand((o,{query:e})=>{let{to:s}=o.state.selection.main,a=e.nextMatch(o.state.doc,s,s);return a?(o.dispatch({selection:{anchor:a.from,head:a.to},scrollIntoView:!0,effects:announceMatch(o,a),userEvent:"select.search"}),!0):!1}),findPrevious=searchCommand((o,{query:e})=>{let{state:s}=o,{from:a}=s.selection.main,c=e.prevMatch(s.doc,a,a);return c?(o.dispatch({selection:{anchor:c.from,head:c.to},scrollIntoView:!0,effects:announceMatch(o,c),userEvent:"select.search"}),!0):!1}),selectMatches=searchCommand((o,{query:e})=>{let s=e.matchAll(o.state.doc,1e3);return!s||!s.length?!1:(o.dispatch({selection:EditorSelection.create(s.map(a=>EditorSelection.range(a.from,a.to))),userEvent:"select.search.matches"}),!0)}),selectSelectionMatches=({state:o,dispatch:e})=>{let s=o.selection;if(s.ranges.length>1||s.main.empty)return!1;let{from:a,to:c}=s.main,h=[],d=0;for(let g=new SearchCursor(o.doc,o.sliceDoc(a,c));!g.next().done;){if(h.length>1e3)return!1;g.value.from==a&&(d=h.length),h.push(EditorSelection.range(g.value.from,g.value.to))}return e(o.update({selection:EditorSelection.create(h,d),userEvent:"select.search.matches"})),!0},replaceNext=searchCommand((o,{query:e})=>{let{state:s}=o,{from:a,to:c}=s.selection.main;if(s.readOnly)return!1;let h=e.nextMatch(s.doc,a,a);if(!h)return!1;let d=[],g,_,b=[];if(h.from==a&&h.to==c&&(_=s.toText(e.getReplacement(h)),d.push({from:h.from,to:h.to,insert:_}),h=e.nextMatch(s.doc,h.from,h.to),b.push(EditorView.announce.of(s.phrase("replaced match on line $",s.doc.lineAt(a).number)+"."))),h){let $=d.length==0||d[0].from>=h.to?0:h.to-h.from-_.length;g={anchor:h.from-$,head:h.to-$},b.push(announceMatch(o,h))}return o.dispatch({changes:d,selection:g,scrollIntoView:!!g,effects:b,userEvent:"input.replace"}),!0}),replaceAll=searchCommand((o,{query:e})=>{if(o.state.readOnly)return!1;let s=e.matchAll(o.state.doc,1e9).map(c=>{let{from:h,to:d}=c;return{from:h,to:d,insert:e.getReplacement(c)}});if(!s.length)return!1;let a=o.state.phrase("replaced $ matches",s.length)+".";return o.dispatch({changes:s,effects:EditorView.announce.of(a),userEvent:"input.replace.all"}),!0});function createSearchPanel(o){return o.state.facet(searchConfigFacet).createPanel(o)}function defaultQuery(o,e){var s;let a=o.selection.main,c=a.empty||a.to>a.from+100?"":o.sliceDoc(a.from,a.to),h=(s=e==null?void 0:e.caseSensitive)!==null&&s!==void 0?s:o.facet(searchConfigFacet).caseSensitive;return e&&!c?e:new SearchQuery({search:c.replace(/\n/g,"\\n"),caseSensitive:h})}const openSearchPanel=o=>{let e=o.state.field(searchState,!1);if(e&&e.panel){let s=getPanel(o,createSearchPanel);if(!s)return!1;let a=s.dom.querySelector("[main-field]");if(a&&a!=o.root.activeElement){let c=defaultQuery(o.state,e.query.spec);c.valid&&o.dispatch({effects:setSearchQuery.of(c)}),a.focus(),a.select()}}else o.dispatch({effects:[togglePanel$1.of(!0),e?setSearchQuery.of(defaultQuery(o.state,e.query.spec)):StateEffect.appendConfig.of(searchExtensions)]});return!0},closeSearchPanel=o=>{let e=o.state.field(searchState,!1);if(!e||!e.panel)return!1;let s=getPanel(o,createSearchPanel);return s&&s.dom.contains(o.root.activeElement)&&o.focus(),o.dispatch({effects:togglePanel$1.of(!1)}),!0},searchKeymap=[{key:"Mod-f",run:openSearchPanel,scope:"editor search-panel"},{key:"F3",run:findNext,shift:findPrevious,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:findNext,shift:findPrevious,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:closeSearchPanel,scope:"editor search-panel"},{key:"Mod-Shift-l",run:selectSelectionMatches},{key:"Alt-g",run:gotoLine},{key:"Mod-d",run:selectNextOccurrence,preventDefault:!0}];class SearchPanel{constructor(e){this.view=e;let s=this.query=e.state.field(searchState).query.spec;this.commit=this.commit.bind(this),this.searchField=crelt("input",{value:s.search,placeholder:phrase(e,"Find"),"aria-label":phrase(e,"Find"),class:"cm-textfield",name:"search","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=crelt("input",{value:s.replace,placeholder:phrase(e,"Replace"),"aria-label":phrase(e,"Replace"),class:"cm-textfield",name:"replace",onchange:this.commit,onkeyup:this.commit}),this.caseField=crelt("input",{type:"checkbox",name:"case",checked:s.caseSensitive,onchange:this.commit}),this.reField=crelt("input",{type:"checkbox",name:"re",checked:s.regexp,onchange:this.commit});function a(c,h,d){return crelt("button",{class:"cm-button",name:c,onclick:h,type:"button"},d)}this.dom=crelt("div",{onkeydown:c=>this.keydown(c),class:"cm-search"},[this.searchField,a("next",()=>findNext(e),[phrase(e,"next")]),a("prev",()=>findPrevious(e),[phrase(e,"previous")]),a("select",()=>selectMatches(e),[phrase(e,"all")]),crelt("label",null,[this.caseField,phrase(e,"match case")]),crelt("label",null,[this.reField,phrase(e,"regexp")]),...e.state.readOnly?[]:[crelt("br"),this.replaceField,a("replace",()=>replaceNext(e),[phrase(e,"replace")]),a("replaceAll",()=>replaceAll(e),[phrase(e,"replace all")]),crelt("button",{name:"close",onclick:()=>closeSearchPanel(e),"aria-label":phrase(e,"close"),type:"button"},["\xD7"])]])}commit(){let e=new SearchQuery({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:setSearchQuery.of(e)}))}keydown(e){runScopeHandlers(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?findPrevious:findNext)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),replaceNext(this.view))}update(e){for(let s of e.transactions)for(let a of s.effects)a.is(setSearchQuery)&&!a.value.eq(this.query)&&this.setQuery(a.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}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(searchConfigFacet).top}}function phrase(o,e){return o.state.phrase(e)}const AnnounceMargin=30,Break=/[\s\.,:;?!]/;function announceMatch(o,{from:e,to:s}){let a=o.state.doc.lineAt(e),c=o.state.doc.lineAt(s).to,h=Math.max(a.from,e-AnnounceMargin),d=Math.min(c,s+AnnounceMargin),g=o.state.sliceDoc(h,d);if(h!=a.from){for(let _=0;_g.length-AnnounceMargin;_--)if(!Break.test(g[_-1])&&Break.test(g[_])){g=g.slice(0,_);break}}return EditorView.announce.of(`${o.state.phrase("current match")}. ${g} ${o.state.phrase("on line")} ${a.number}.`)}const baseTheme$2=EditorView.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"}}),searchExtensions=[searchState,Prec.lowest(searchHighlighter),baseTheme$2];class CompletionContext{constructor(e,s,a){this.state=e,this.pos=s,this.explicit=a,this.abortListeners=[]}tokenBefore(e){let s=syntaxTree(this.state).resolveInner(this.pos,-1);for(;s&&e.indexOf(s.name)<0;)s=s.parent;return s?{from:s.from,to:this.pos,text:this.state.sliceDoc(s.from,this.pos),type:s.type}:null}matchBefore(e){let s=this.state.doc.lineAt(this.pos),a=Math.max(s.from,this.pos-250),c=s.text.slice(a-s.from,this.pos-s.from),h=c.search(ensureAnchor(e,!1));return h<0?null:{from:a+h,to:this.pos,text:c.slice(h)}}get aborted(){return this.abortListeners==null}addEventListener(e,s){e=="abort"&&this.abortListeners&&this.abortListeners.push(s)}}function toSet(o){let e=Object.keys(o).join(""),s=/\w/.test(e);return s&&(e=e.replace(/\w/g,"")),`[${s?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function prefixMatch(o){let e=Object.create(null),s=Object.create(null);for(let{label:c}of o){e[c[0]]=!0;for(let h=1;htypeof c=="string"?{label:c}:c),[s,a]=e.every(c=>/^\w+$/.test(c.label))?[/\w*$/,/\w+$/]:prefixMatch(e);return c=>{let h=c.matchBefore(a);return h||c.explicit?{from:h?h.from:c.pos,options:e,validFor:s}:null}}function ifNotIn(o,e){return s=>{for(let a=syntaxTree(s.state).resolveInner(s.pos,-1);a;a=a.parent)if(o.indexOf(a.name)>-1)return null;return e(s)}}class Option{constructor(e,s,a){this.completion=e,this.source=s,this.match=a}}function cur(o){return o.selection.main.head}function ensureAnchor(o,e){var s;let{source:a}=o,c=e&&a[0]!="^",h=a[a.length-1]!="$";return!c&&!h?o:new RegExp(`${c?"^":""}(?:${a})${h?"$":""}`,(s=o.flags)!==null&&s!==void 0?s:o.ignoreCase?"i":"")}function insertCompletionText(o,e,s,a){return Object.assign(Object.assign({},o.changeByRange(c=>{if(c==o.selection.main)return{changes:{from:s,to:a,insert:e},range:EditorSelection.cursor(s+e.length)};let h=a-s;return!c.empty||h&&o.sliceDoc(c.from-h,c.from)!=o.sliceDoc(s,a)?{range:c}:{changes:{from:c.from-h,to:c.from,insert:e},range:EditorSelection.cursor(c.from-h+e.length)}})),{userEvent:"input.complete"})}function applyCompletion(o,e){const s=e.completion.apply||e.completion.label;let a=e.source;typeof s=="string"?o.dispatch(insertCompletionText(o.state,s,a.from,a.to)):s(o,e.completion,a.from,a.to)}const SourceCache=new WeakMap;function asSource(o){if(!Array.isArray(o))return o;let e=SourceCache.get(o);return e||SourceCache.set(o,e=completeFromList(o)),e}class FuzzyMatcher{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[];for(let s=0;s=48&&ut<=57||ut>=97&&ut<=122?2:ut>=65&&ut<=90?1:0:(ct=fromCodePoint(ut))!=ct.toLowerCase()?1:ct!=ct.toUpperCase()?2:0;(!it||ht==1&&st||ot==0&&ht!=0)&&(s[j]==ut||a[j]==ut&&(_e=!0)?d[j++]=it:d.length&&(rt=!1)),ot=ht,it+=codePointSize(ut)}return j==_&&d[0]==0&&rt?this.result(-100+(_e?-200:0),d,e):et==_&&tt==0?[-200-e.length,0,nt]:g>-1?[-700-e.length,g,g+this.pattern.length]:et==_?[-200+-700-e.length,tt,nt]:j==_?this.result(-100+(_e?-200:0)+-700+(rt?0:-1100),d,e):s.length==2?null:this.result((c[0]?-700:0)+-200+-1100,c,e)}result(e,s,a){let c=[e-a.length],h=1;for(let d of s){let g=d+(this.astral?codePointSize(codePointAt(a,d)):1);h>1&&c[h-1]==d?c[h-1]=g:(c[h++]=d,c[h++]=g)}return c}}const completionConfig=Facet.define({combine(o){return combineConfig(o,{activateOnTyping:!0,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],compareCompletions:(e,s)=>e.label.localeCompare(s.label)},{defaultKeymap:(e,s)=>e&&s,closeOnBlur:(e,s)=>e&&s,icons:(e,s)=>e&&s,optionClass:(e,s)=>a=>joinClass(e(a),s(a)),addToOptions:(e,s)=>e.concat(s)})}});function joinClass(o,e){return o?e?o+" "+e:o:e}function optionContent(o){let e=o.addToOptions.slice();return o.icons&&e.push({render(s){let a=document.createElement("div");return a.classList.add("cm-completionIcon"),s.type&&a.classList.add(...s.type.split(/\s+/g).map(c=>"cm-completionIcon-"+c)),a.setAttribute("aria-hidden","true"),a},position:20}),e.push({render(s,a,c){let h=document.createElement("span");h.className="cm-completionLabel";let{label:d}=s,g=0;for(let _=1;_g&&h.appendChild(document.createTextNode(d.slice(g,b)));let j=h.appendChild(document.createElement("span"));j.appendChild(document.createTextNode(d.slice(b,$))),j.className="cm-completionMatchedText",g=$}return gs.position-a.position).map(s=>s.render)}function rangeAroundSelected(o,e,s){if(o<=s)return{from:0,to:o};if(e<0&&(e=0),e<=o>>1){let c=Math.floor(e/s);return{from:c*s,to:(c+1)*s}}let a=Math.floor((o-e)/s);return{from:o-(a+1)*s,to:o-a*s}}class CompletionTooltip{constructor(e,s){this.view=e,this.stateField=s,this.info=null,this.placeInfo={read:()=>this.measureInfo(),write:g=>this.positionInfo(g),key:this};let a=e.state.field(s),{options:c,selected:h}=a.open,d=e.state.facet(completionConfig);this.optionContent=optionContent(d),this.optionClass=d.optionClass,this.range=rangeAroundSelected(c.length,h,d.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.dom.addEventListener("mousedown",g=>{for(let _=g.target,b;_&&_!=this.dom;_=_.parentNode)if(_.nodeName=="LI"&&(b=/-(\d+)$/.exec(_.id))&&+b[1]{this.info&&this.view.requestMeasure(this.placeInfo)})}mount(){this.updateSel()}update(e){e.state.field(this.stateField)!=e.startState.field(this.stateField)&&this.updateSel()}positioned(){this.info&&this.view.requestMeasure(this.placeInfo)}updateSel(){let e=this.view.state.field(this.stateField),s=e.open;if((s.selected=this.range.to)&&(this.range=rangeAroundSelected(s.options.length,s.selected,this.view.state.facet(completionConfig).maxRenderedOptions),this.list.remove(),this.list=this.dom.appendChild(this.createListBox(s.options,e.id,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfo)})),this.updateSelectedOption(s.selected)){this.info&&(this.info.remove(),this.info=null);let{completion:a}=s.options[s.selected],{info:c}=a;if(!c)return;let h=typeof c=="string"?document.createTextNode(c):c(a);if(!h)return;"then"in h?h.then(d=>{d&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(d)}).catch(d=>logException(this.view.state,d,"completion info")):this.addInfoPane(h)}}addInfoPane(e){let s=this.info=document.createElement("div");s.className="cm-tooltip cm-completionInfo",s.appendChild(e),this.dom.appendChild(s),this.view.requestMeasure(this.placeInfo)}updateSelectedOption(e){let s=null;for(let a=this.list.firstChild,c=this.range.from;a;a=a.nextSibling,c++)c==e?a.hasAttribute("aria-selected")||(a.setAttribute("aria-selected","true"),s=a):a.hasAttribute("aria-selected")&&a.removeAttribute("aria-selected");return s&&scrollIntoView(this.list,s),s}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let s=this.dom.getBoundingClientRect(),a=this.info.getBoundingClientRect(),c=e.getBoundingClientRect();if(c.top>Math.min(innerHeight,s.bottom)-10||c.bottomnew CompletionTooltip(e,o)}function scrollIntoView(o,e){let s=o.getBoundingClientRect(),a=e.getBoundingClientRect();a.tops.bottom&&(o.scrollTop+=a.bottom-s.bottom)}function score(o){return(o.boost||0)*100+(o.apply?10:0)+(o.info?5:0)+(o.type?1:0)}function sortOptions(o,e){let s=[],a=0;for(let g of o)if(g.hasResult())if(g.result.filter===!1){let _=g.result.getMatch;for(let b of g.result.options){let $=[1e9-a++];if(_)for(let j of _(b))$.push(j);s.push(new Option(b,g,$))}}else{let _=new FuzzyMatcher(e.sliceDoc(g.from,g.to)),b;for(let $ of g.result.options)(b=_.match($.label))&&($.boost!=null&&(b[0]+=$.boost),s.push(new Option($,g,b)))}let c=[],h=null,d=e.facet(completionConfig).compareCompletions;for(let g of s.sort((_,b)=>b.match[0]-_.match[0]||d(_.completion,b.completion)))!h||h.label!=g.completion.label||h.detail!=g.completion.detail||h.type!=null&&g.completion.type!=null&&h.type!=g.completion.type||h.apply!=g.completion.apply?c.push(g):score(g.completion)>score(h)&&(c[c.length-1]=g),h=g.completion;return c}class CompletionDialog{constructor(e,s,a,c,h){this.options=e,this.attrs=s,this.tooltip=a,this.timestamp=c,this.selected=h}setSelected(e,s){return e==this.selected||e>=this.options.length?this:new CompletionDialog(this.options,makeAttrs(s,e),this.tooltip,this.timestamp,e)}static build(e,s,a,c,h){let d=sortOptions(e,s);if(!d.length)return null;let g=s.facet(completionConfig).selectOnOpen?0:-1;if(c&&c.selected!=g&&c.selected!=-1){let _=c.options[c.selected].completion;for(let b=0;bb.hasResult()?Math.min(_,b.from):_,1e8),create:completionTooltip(completionState),above:h.aboveCursor},c?c.timestamp:Date.now(),g)}map(e){return new CompletionDialog(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected)}}class CompletionState{constructor(e,s,a){this.active=e,this.id=s,this.open=a}static start(){return new CompletionState(none,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:s}=e,a=s.facet(completionConfig),h=(a.override||s.languageDataAt("autocomplete",cur(s)).map(asSource)).map(g=>(this.active.find(b=>b.source==g)||new ActiveSource(g,this.active.some(b=>b.state!=0)?1:0)).update(e,a));h.length==this.active.length&&h.every((g,_)=>g==this.active[_])&&(h=this.active);let d=e.selection||h.some(g=>g.hasResult()&&e.changes.touchesRange(g.from,g.to))||!sameResults(h,this.active)?CompletionDialog.build(h,s,this.id,this.open,a):this.open&&e.docChanged?this.open.map(e.changes):this.open;!d&&h.every(g=>g.state!=1)&&h.some(g=>g.hasResult())&&(h=h.map(g=>g.hasResult()?new ActiveSource(g.source,0):g));for(let g of e.effects)g.is(setSelectedEffect)&&(d=d&&d.setSelected(g.value,this.id));return h==this.active&&d==this.open?this:new CompletionState(h,this.id,d)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:baseAttrs}}function sameResults(o,e){if(o==e)return!0;for(let s=0,a=0;;){for(;s-1&&(s["aria-activedescendant"]=o+"-"+e),s}const none=[];function getUserEvent(o){return o.isUserEvent("input.type")?"input":o.isUserEvent("delete.backward")?"delete":null}class ActiveSource{constructor(e,s,a=-1){this.source=e,this.state=s,this.explicitPos=a}hasResult(){return!1}update(e,s){let a=getUserEvent(e),c=this;a?c=c.handleUserEvent(e,a,s):e.docChanged?c=c.handleChange(e):e.selection&&c.state!=0&&(c=new ActiveSource(c.source,0));for(let h of e.effects)if(h.is(startCompletionEffect))c=new ActiveSource(c.source,1,h.value?cur(e.state):-1);else if(h.is(closeCompletionEffect))c=new ActiveSource(c.source,0);else if(h.is(setActiveEffect))for(let d of h.value)d.source==c.source&&(c=d);return c}handleUserEvent(e,s,a){return s=="delete"||!a.activateOnTyping?this.map(e.changes):new ActiveSource(this.source,1)}handleChange(e){return e.changes.touchesRange(cur(e.startState))?new ActiveSource(this.source,0):this.map(e.changes)}map(e){return e.empty||this.explicitPos<0?this:new ActiveSource(this.source,this.state,e.mapPos(this.explicitPos))}}class ActiveResult extends ActiveSource{constructor(e,s,a,c,h){super(e,2,s),this.result=a,this.from=c,this.to=h}hasResult(){return!0}handleUserEvent(e,s,a){var c;let h=e.changes.mapPos(this.from),d=e.changes.mapPos(this.to,1),g=cur(e.state);if((this.explicitPos<0?g<=h:gd||s=="delete"&&cur(e.startState)==this.from)return new ActiveSource(this.source,s=="input"&&a.activateOnTyping?1:0);let _=this.explicitPos<0?-1:e.changes.mapPos(this.explicitPos),b;return checkValid(this.result.validFor,e.state,h,d)?new ActiveResult(this.source,_,this.result,h,d):this.result.update&&(b=this.result.update(this.result,h,d,new CompletionContext(e.state,g,_>=0)))?new ActiveResult(this.source,_,b,b.from,(c=b.to)!==null&&c!==void 0?c:cur(e.state)):new ActiveSource(this.source,1,_)}handleChange(e){return e.changes.touchesRange(this.from,this.to)?new ActiveSource(this.source,0):this.map(e.changes)}map(e){return e.empty?this:new ActiveResult(this.source,this.explicitPos<0?-1:e.mapPos(this.explicitPos),this.result,e.mapPos(this.from),e.mapPos(this.to,1))}}function checkValid(o,e,s,a){if(!o)return!1;let c=e.sliceDoc(s,a);return typeof o=="function"?o(c,s,a,e):ensureAnchor(o,!0).test(c)}const startCompletionEffect=StateEffect.define(),closeCompletionEffect=StateEffect.define(),setActiveEffect=StateEffect.define({map(o,e){return o.map(s=>s.map(e))}}),setSelectedEffect=StateEffect.define(),completionState=StateField.define({create(){return CompletionState.start()},update(o,e){return o.update(e)},provide:o=>[showTooltip.from(o,e=>e.tooltip),EditorView.contentAttributes.from(o,e=>e.attrs)]}),CompletionInteractMargin=75;function moveCompletionSelection(o,e="option"){return s=>{let a=s.state.field(completionState,!1);if(!a||!a.open||Date.now()-a.open.timestamp-1?a.open.selected+c*(o?1:-1):o?0:d-1;return g<0?g=e=="page"?0:d-1:g>=d&&(g=e=="page"?d-1:0),s.dispatch({effects:setSelectedEffect.of(g)}),!0}}const acceptCompletion=o=>{let e=o.state.field(completionState,!1);return o.state.readOnly||!e||!e.open||Date.now()-e.open.timestampo.state.field(completionState,!1)?(o.dispatch({effects:startCompletionEffect.of(!0)}),!0):!1,closeCompletion=o=>{let e=o.state.field(completionState,!1);return!e||!e.active.some(s=>s.state!=0)?!1:(o.dispatch({effects:closeCompletionEffect.of(null)}),!0)};class RunningQuery{constructor(e,s){this.active=e,this.context=s,this.time=Date.now(),this.updates=[],this.done=void 0}}const DebounceTime=50,MaxUpdateCount=50,MinAbortTime=1e3,completionPlugin=ViewPlugin.fromClass(class{constructor(o){this.view=o,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.composing=0;for(let e of o.state.field(completionState).active)e.state==1&&this.startQuery(e)}update(o){let e=o.state.field(completionState);if(!o.selectionSet&&!o.docChanged&&o.startState.field(completionState)==e)return;let s=o.transactions.some(a=>(a.selection||a.docChanged)&&!getUserEvent(a));for(let a=0;aMaxUpdateCount&&Date.now()-c.time>MinAbortTime){for(let h of c.context.abortListeners)try{h()}catch(d){logException(this.view.state,d)}c.context.abortListeners=null,this.running.splice(a--,1)}else c.updates.push(...o.transactions)}if(this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),this.debounceUpdate=e.active.some(a=>a.state==1&&!this.running.some(c=>c.active.source==a.source))?setTimeout(()=>this.startUpdate(),DebounceTime):-1,this.composing!=0)for(let a of o.transactions)getUserEvent(a)=="input"?this.composing=2:this.composing==2&&a.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1;let{state:o}=this.view,e=o.field(completionState);for(let s of e.active)s.state==1&&!this.running.some(a=>a.active.source==s.source)&&this.startQuery(s)}startQuery(o){let{state:e}=this.view,s=cur(e),a=new CompletionContext(e,s,o.explicitPos==s),c=new RunningQuery(o,a);this.running.push(c),Promise.resolve(o.source(a)).then(h=>{c.context.aborted||(c.done=h||null,this.scheduleAccept())},h=>{this.view.dispatch({effects:closeCompletionEffect.of(null)}),logException(this.view.state,h)})}scheduleAccept(){this.running.every(o=>o.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),DebounceTime))}accept(){var o;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],s=this.view.state.facet(completionConfig);for(let a=0;ad.source==c.active.source);if(h&&h.state==1)if(c.done==null){let d=new ActiveSource(c.active.source,0);for(let g of c.updates)d=d.update(g,s);d.state!=1&&e.push(d)}else this.startQuery(h)}e.length&&this.view.dispatch({effects:setActiveEffect.of(e)})}},{eventHandlers:{blur(){let o=this.view.state.field(completionState,!1);o&&o.tooltip&&this.view.state.facet(completionConfig).closeOnBlur&&this.view.dispatch({effects:closeCompletionEffect.of(null)})},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:startCompletionEffect.of(!1)}),20),this.composing=0}}}),baseTheme$1=EditorView.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",listStyle:"none",margin:0,padding:0,"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer",padding:"1px 3px",lineHeight:1.2}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"\xB7\xB7\xB7"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"300px"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",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"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'\u0192'"}},".cm-completionIcon-class":{"&:after":{content:"'\u25CB'"}},".cm-completionIcon-interface":{"&:after":{content:"'\u25CC'"}},".cm-completionIcon-variable":{"&:after":{content:"'\u{1D465}'"}},".cm-completionIcon-constant":{"&:after":{content:"'\u{1D436}'"}},".cm-completionIcon-type":{"&:after":{content:"'\u{1D461}'"}},".cm-completionIcon-enum":{"&:after":{content:"'\u222A'"}},".cm-completionIcon-property":{"&:after":{content:"'\u25A1'"}},".cm-completionIcon-keyword":{"&:after":{content:"'\u{1F511}\uFE0E'"}},".cm-completionIcon-namespace":{"&:after":{content:"'\u25A2'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class FieldPos{constructor(e,s,a,c){this.field=e,this.line=s,this.from=a,this.to=c}}class FieldRange{constructor(e,s,a){this.field=e,this.from=s,this.to=a}map(e){let s=e.mapPos(this.from,-1,MapMode.TrackDel),a=e.mapPos(this.to,1,MapMode.TrackDel);return s==null||a==null?null:new FieldRange(this.field,s,a)}}class Snippet{constructor(e,s){this.lines=e,this.fieldPositions=s}instantiate(e,s){let a=[],c=[s],h=e.doc.lineAt(s),d=/^\s*/.exec(h.text)[0];for(let _ of this.lines){if(a.length){let b=d,$=/^\t*/.exec(_)[0].length;for(let j=0;j<$;j++)b+=e.facet(indentUnit);c.push(s+b.length-$),_=b+_.slice($)}a.push(_),s+=_.length+1}let g=this.fieldPositions.map(_=>new FieldRange(_.field,c[_.line]+_.from,c[_.line]+_.to));return{text:a,ranges:g}}static parse(e){let s=[],a=[],c=[],h;for(let d of e.split(/\r\n?|\n/)){for(;h=/[#$]\{(?:(\d+)(?::([^}]*))?|([^}]*))\}/.exec(d);){let g=h[1]?+h[1]:null,_=h[2]||h[3]||"",b=-1;for(let $=0;$=b&&j.field++}c.push(new FieldPos(b,a.length,h.index,h.index+_.length)),d=d.slice(0,h.index)+_+d.slice(h.index+h[0].length)}for(let g;g=/([$#])\\{/.exec(d);){d=d.slice(0,g.index)+g[1]+"{"+d.slice(g.index+g[0].length);for(let _ of c)_.line==a.length&&_.from>g.index&&(_.from--,_.to--)}a.push(d)}return new Snippet(a,c)}}let fieldMarker=Decoration.widget({widget:new class extends WidgetType{toDOM(){let o=document.createElement("span");return o.className="cm-snippetFieldPosition",o}ignoreEvent(){return!1}}}),fieldRange=Decoration.mark({class:"cm-snippetField"});class ActiveSnippet{constructor(e,s){this.ranges=e,this.active=s,this.deco=Decoration.set(e.map(a=>(a.from==a.to?fieldMarker:fieldRange).range(a.from,a.to)))}map(e){let s=[];for(let a of this.ranges){let c=a.map(e);if(!c)return null;s.push(c)}return new ActiveSnippet(s,this.active)}selectionInsideField(e){return e.ranges.every(s=>this.ranges.some(a=>a.field==this.active&&a.from<=s.from&&a.to>=s.to))}}const setActive=StateEffect.define({map(o,e){return o&&o.map(e)}}),moveToField=StateEffect.define(),snippetState=StateField.define({create(){return null},update(o,e){for(let s of e.effects){if(s.is(setActive))return s.value;if(s.is(moveToField)&&o)return new ActiveSnippet(o.ranges,s.value)}return o&&e.docChanged&&(o=o.map(e.changes)),o&&e.selection&&!o.selectionInsideField(e.selection)&&(o=null),o},provide:o=>EditorView.decorations.from(o,e=>e?e.deco:Decoration.none)});function fieldSelection(o,e){return EditorSelection.create(o.filter(s=>s.field==e).map(s=>EditorSelection.range(s.from,s.to)))}function snippet(o){let e=Snippet.parse(o);return(s,a,c,h)=>{let{text:d,ranges:g}=e.instantiate(s.state,c),_={changes:{from:c,to:h,insert:Text.of(d)},scrollIntoView:!0};if(g.length&&(_.selection=fieldSelection(g,0)),g.length>1){let b=new ActiveSnippet(g,0),$=_.effects=[setActive.of(b)];s.state.field(snippetState,!1)===void 0&&$.push(StateEffect.appendConfig.of([snippetState,addSnippetKeymap,snippetPointerHandler,baseTheme$1]))}s.dispatch(s.state.update(_))}}function moveField(o){return({state:e,dispatch:s})=>{let a=e.field(snippetState,!1);if(!a||o<0&&a.active==0)return!1;let c=a.active+o,h=o>0&&!a.ranges.some(d=>d.field==c+o);return s(e.update({selection:fieldSelection(a.ranges,c),effects:setActive.of(h?null:new ActiveSnippet(a.ranges,c))})),!0}}const clearSnippet=({state:o,dispatch:e})=>o.field(snippetState,!1)?(e(o.update({effects:setActive.of(null)})),!0):!1,nextSnippetField=moveField(1),prevSnippetField=moveField(-1),defaultSnippetKeymap=[{key:"Tab",run:nextSnippetField,shift:prevSnippetField},{key:"Escape",run:clearSnippet}],snippetKeymap=Facet.define({combine(o){return o.length?o[0]:defaultSnippetKeymap}}),addSnippetKeymap=Prec.highest(keymap.compute([snippetKeymap],o=>o.facet(snippetKeymap)));function snippetCompletion(o,e){return Object.assign(Object.assign({},e),{apply:snippet(o)})}const snippetPointerHandler=EditorView.domEventHandlers({mousedown(o,e){let s=e.state.field(snippetState,!1),a;if(!s||(a=e.posAtCoords({x:o.clientX,y:o.clientY}))==null)return!1;let c=s.ranges.find(h=>h.from<=a&&h.to>=a);return!c||c.field==s.active?!1:(e.dispatch({selection:fieldSelection(s.ranges,c.field),effects:setActive.of(s.ranges.some(h=>h.field>c.field)?new ActiveSnippet(s.ranges,c.field):null)}),!0)}}),defaults={brackets:["(","[","{","'",'"'],before:")]}:;>"},closeBracketEffect=StateEffect.define({map(o,e){let s=e.mapPos(o,-1,MapMode.TrackAfter);return s==null?void 0:s}}),skipBracketEffect=StateEffect.define({map(o,e){return e.mapPos(o)}}),closedBracket=new class extends RangeValue{};closedBracket.startSide=1;closedBracket.endSide=-1;const bracketState=StateField.define({create(){return RangeSet.empty},update(o,e){if(e.selection){let s=e.state.doc.lineAt(e.selection.main.head).from,a=e.startState.doc.lineAt(e.startState.selection.main.head).from;s!=e.changes.mapPos(a,-1)&&(o=RangeSet.empty)}o=o.map(e.changes);for(let s of e.effects)s.is(closeBracketEffect)?o=o.update({add:[closedBracket.range(s.value,s.value+1)]}):s.is(skipBracketEffect)&&(o=o.update({filter:a=>a!=s.value}));return o}});function closeBrackets(){return[inputHandler,bracketState]}const definedClosing="()[]{}<>";function closing(o){for(let e=0;e{if((android$1?o.composing:o.compositionStarted)||o.state.readOnly)return!1;let c=o.state.selection.main;if(a.length>2||a.length==2&&codePointSize(codePointAt(a,0))==1||e!=c.from||s!=c.to)return!1;let h=insertBracket(o.state,a);return h?(o.dispatch(h),!0):!1}),deleteBracketPair=({state:o,dispatch:e})=>{if(o.readOnly)return!1;let a=config(o,o.selection.main.head).brackets||defaults.brackets,c=null,h=o.changeByRange(d=>{if(d.empty){let g=prevChar(o.doc,d.head);for(let _ of a)if(_==g&&nextChar(o.doc,d.head)==closing(codePointAt(_,0)))return{changes:{from:d.head-_.length,to:d.head+_.length},range:EditorSelection.cursor(d.head-_.length),userEvent:"delete.backward"}}return{range:c=d}});return c||e(o.update(h,{scrollIntoView:!0})),!c},closeBracketsKeymap=[{key:"Backspace",run:deleteBracketPair}];function insertBracket(o,e){let s=config(o,o.selection.main.head),a=s.brackets||defaults.brackets;for(let c of a){let h=closing(codePointAt(c,0));if(e==c)return h==c?handleSame(o,c,a.indexOf(c+c+c)>-1):handleOpen(o,c,h,s.before||defaults.before);if(e==h&&closedBracketAt(o,o.selection.main.from))return handleClose(o,c,h)}return null}function closedBracketAt(o,e){let s=!1;return o.field(bracketState).between(0,o.doc.length,a=>{a==e&&(s=!0)}),s}function nextChar(o,e){let s=o.sliceString(e,e+2);return s.slice(0,codePointSize(codePointAt(s,0)))}function prevChar(o,e){let s=o.sliceString(e-2,e);return codePointSize(codePointAt(s,0))==s.length?s:s.slice(1)}function handleOpen(o,e,s,a){let c=null,h=o.changeByRange(d=>{if(!d.empty)return{changes:[{insert:e,from:d.from},{insert:s,from:d.to}],effects:closeBracketEffect.of(d.to+e.length),range:EditorSelection.range(d.anchor+e.length,d.head+e.length)};let g=nextChar(o.doc,d.head);return!g||/\s/.test(g)||a.indexOf(g)>-1?{changes:{insert:e+s,from:d.head},effects:closeBracketEffect.of(d.head+e.length),range:EditorSelection.cursor(d.head+e.length)}:{range:c=d}});return c?null:o.update(h,{scrollIntoView:!0,userEvent:"input.type"})}function handleClose(o,e,s){let a=null,c=o.selection.ranges.map(h=>h.empty&&nextChar(o.doc,h.head)==s?EditorSelection.cursor(h.head+s.length):a=h);return a?null:o.update({selection:EditorSelection.create(c,o.selection.mainIndex),scrollIntoView:!0,effects:o.selection.ranges.map(({from:h})=>skipBracketEffect.of(h))})}function handleSame(o,e,s){let a=null,c=o.changeByRange(h=>{if(!h.empty)return{changes:[{insert:e,from:h.from},{insert:e,from:h.to}],effects:closeBracketEffect.of(h.to+e.length),range:EditorSelection.range(h.anchor+e.length,h.head+e.length)};let d=h.head,g=nextChar(o.doc,d);if(g==e){if(nodeStart(o,d))return{changes:{insert:e+e,from:d},effects:closeBracketEffect.of(d+e.length),range:EditorSelection.cursor(d+e.length)};if(closedBracketAt(o,d)){let _=s&&o.sliceDoc(d,d+e.length*3)==e+e+e;return{range:EditorSelection.cursor(d+e.length*(_?3:1)),effects:skipBracketEffect.of(d)}}}else{if(s&&o.sliceDoc(d-2*e.length,d)==e+e&&nodeStart(o,d-2*e.length))return{changes:{insert:e+e+e+e,from:d},effects:closeBracketEffect.of(d+e.length),range:EditorSelection.cursor(d+e.length)};if(o.charCategorizer(d)(g)!=CharCategory.Word){let _=o.sliceDoc(d-1,d);if(_!=e&&o.charCategorizer(d)(_)!=CharCategory.Word&&!probablyInString(o,d,e))return{changes:{insert:e+e,from:d},effects:closeBracketEffect.of(d+e.length),range:EditorSelection.cursor(d+e.length)}}}return{range:a=h}});return a?null:o.update(c,{scrollIntoView:!0,userEvent:"input.type"})}function nodeStart(o,e){let s=syntaxTree(o).resolveInner(e+1);return s.parent&&s.from==e}function probablyInString(o,e,s){let a=syntaxTree(o).resolveInner(e,-1);for(let c=0;c<5;c++){if(o.sliceDoc(a.from,a.from+s.length)==s){let d=a.firstChild;for(;d&&d.from==a.from&&d.to-d.from>s.length;){if(o.sliceDoc(d.to-s.length,d.to)==s)return!1;d=d.firstChild}return!0}let h=a.to==e&&a.parent;if(!h)break;a=h}return!1}function autocompletion(o={}){return[completionState,completionConfig.of(o),completionPlugin,completionKeymapExt,baseTheme$1]}const completionKeymap=[{key:"Ctrl-Space",run:startCompletion},{key:"Escape",run:closeCompletion},{key:"ArrowDown",run:moveCompletionSelection(!0)},{key:"ArrowUp",run:moveCompletionSelection(!1)},{key:"PageDown",run:moveCompletionSelection(!0,"page")},{key:"PageUp",run:moveCompletionSelection(!1,"page")},{key:"Enter",run:acceptCompletion}],completionKeymapExt=Prec.highest(keymap.computeN([completionConfig],o=>o.facet(completionConfig).defaultKeymap?[completionKeymap]:[]));class SelectedDiagnostic{constructor(e,s,a){this.from=e,this.to=s,this.diagnostic=a}}class LintState{constructor(e,s,a){this.diagnostics=e,this.panel=s,this.selected=a}static init(e,s,a){let c=e,h=a.facet(lintConfig).markerFilter;h&&(c=h(c));let d=Decoration.set(c.map(g=>g.from==g.to||g.from==g.to-1&&a.doc.lineAt(g.from).to==g.from?Decoration.widget({widget:new DiagnosticWidget(g),diagnostic:g}).range(g.from):Decoration.mark({attributes:{class:"cm-lintRange cm-lintRange-"+g.severity},diagnostic:g}).range(g.from,g.to)),!0);return new LintState(d,s,findDiagnostic(d))}}function findDiagnostic(o,e=null,s=0){let a=null;return o.between(s,1e9,(c,h,{spec:d})=>{if(!(e&&d.diagnostic!=e))return a=new SelectedDiagnostic(c,h,d.diagnostic),!1}),a}function hideTooltip(o,e){return!!(o.effects.some(s=>s.is(setDiagnosticsEffect))||o.changes.touchesRange(e.pos))}function maybeEnableLint(o,e){return o.field(lintState,!1)?e:e.concat(StateEffect.appendConfig.of([lintState,EditorView.decorations.compute([lintState],s=>{let{selected:a,panel:c}=s.field(lintState);return!a||!c||a.from==a.to?Decoration.none:Decoration.set([activeMark.range(a.from,a.to)])}),hoverTooltip(lintTooltip,{hideOn:hideTooltip}),baseTheme]))}function setDiagnostics(o,e){return{effects:maybeEnableLint(o,[setDiagnosticsEffect.of(e)])}}const setDiagnosticsEffect=StateEffect.define(),togglePanel=StateEffect.define(),movePanelSelection=StateEffect.define(),lintState=StateField.define({create(){return new LintState(Decoration.none,null,null)},update(o,e){if(e.docChanged){let s=o.diagnostics.map(e.changes),a=null;if(o.selected){let c=e.changes.mapPos(o.selected.from,1);a=findDiagnostic(s,o.selected.diagnostic,c)||findDiagnostic(s,null,c)}o=new LintState(s,o.panel,a)}for(let s of e.effects)s.is(setDiagnosticsEffect)?o=LintState.init(s.value,o.panel,e.state):s.is(togglePanel)?o=new LintState(o.diagnostics,s.value?LintPanel.open:null,o.selected):s.is(movePanelSelection)&&(o=new LintState(o.diagnostics,o.panel,s.value));return o},provide:o=>[showPanel.from(o,e=>e.panel),EditorView.decorations.from(o,e=>e.diagnostics)]}),activeMark=Decoration.mark({class:"cm-lintRange cm-lintRange-active"});function lintTooltip(o,e,s){let{diagnostics:a}=o.state.field(lintState),c=[],h=2e8,d=0;a.between(e-(s<0?1:0),e+(s>0?1:0),(_,b,{spec:$})=>{e>=_&&e<=b&&(_==b||(e>_||s>0)&&(erenderDiagnostic(o,s,!1)))}const openLintPanel=o=>{let e=o.state.field(lintState,!1);(!e||!e.panel)&&o.dispatch({effects:maybeEnableLint(o.state,[togglePanel.of(!0)])});let s=getPanel(o,LintPanel.open);return s&&s.dom.querySelector(".cm-panel-lint ul").focus(),!0},closeLintPanel=o=>{let e=o.state.field(lintState,!1);return!e||!e.panel?!1:(o.dispatch({effects:togglePanel.of(!1)}),!0)},nextDiagnostic=o=>{let e=o.state.field(lintState,!1);if(!e)return!1;let s=o.state.selection.main,a=e.diagnostics.iter(s.to+1);return!a.value&&(a=e.diagnostics.iter(0),!a.value||a.from==s.from&&a.to==s.to)?!1:(o.dispatch({selection:{anchor:a.from,head:a.to},scrollIntoView:!0}),!0)},lintKeymap=[{key:"Mod-Shift-m",run:openLintPanel},{key:"F8",run:nextDiagnostic}],lintPlugin=ViewPlugin.fromClass(class{constructor(o){this.view=o,this.timeout=-1,this.set=!0;let{delay:e}=o.state.facet(lintConfig);this.lintTime=Date.now()+e,this.run=this.run.bind(this),this.timeout=setTimeout(this.run,e)}run(){let o=Date.now();if(oPromise.resolve(a(this.view)))).then(a=>{let c=a.reduce((h,d)=>h.concat(d));this.view.state.doc==e.doc&&this.view.dispatch(setDiagnostics(this.view.state,c))},a=>{logException(this.view.state,a)})}}update(o){let e=o.state.facet(lintConfig);(o.docChanged||e!=o.startState.facet(lintConfig))&&(this.lintTime=Date.now()+e.delay,this.set||(this.set=!0,this.timeout=setTimeout(this.run,e.delay)))}force(){this.set&&(this.lintTime=Date.now(),this.run())}destroy(){clearTimeout(this.timeout)}}),lintConfig=Facet.define({combine(o){return Object.assign({sources:o.map(e=>e.source)},combineConfig(o.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null}))},enables:lintPlugin});function assignKeys(o){let e=[];if(o)e:for(let{name:s}of o){for(let a=0;ah.toLowerCase()==c.toLowerCase())){e.push(c);continue e}}e.push("")}return e}function renderDiagnostic(o,e,s){var a;let c=s?assignKeys(e.actions):[];return crelt("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},crelt("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage():e.message),(a=e.actions)===null||a===void 0?void 0:a.map((h,d)=>{let g=j=>{j.preventDefault();let _e=findDiagnostic(o.state.field(lintState).diagnostics,e);_e&&h.apply(o,_e.from,_e.to)},{name:_}=h,b=c[d]?_.indexOf(c[d]):-1,$=b<0?_:[_.slice(0,b),crelt("u",_.slice(b,b+1)),_.slice(b+1)];return crelt("button",{type:"button",class:"cm-diagnosticAction",onclick:g,onmousedown:g,"aria-label":` Action: ${_}${b<0?"":` (access key "${c[d]})"`}.`},$)}),e.source&&crelt("div",{class:"cm-diagnosticSource"},e.source))}class DiagnosticWidget extends WidgetType{constructor(e){super(),this.diagnostic=e}eq(e){return e.diagnostic==this.diagnostic}toDOM(){return crelt("span",{class:"cm-lintPoint cm-lintPoint-"+this.diagnostic.severity})}}class PanelItem{constructor(e,s){this.diagnostic=s,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=renderDiagnostic(e,s,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class LintPanel{constructor(e){this.view=e,this.items=[];let s=c=>{if(c.keyCode==27)closeLintPanel(this.view),this.view.focus();else if(c.keyCode==38||c.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(c.keyCode==40||c.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(c.keyCode==36)this.moveSelection(0);else if(c.keyCode==35)this.moveSelection(this.items.length-1);else if(c.keyCode==13)this.view.focus();else if(c.keyCode>=65&&c.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:h}=this.items[this.selectedIndex],d=assignKeys(h.actions);for(let g=0;g{for(let h=0;hcloseLintPanel(this.view)},"\xD7")),this.update()}get selectedIndex(){let e=this.view.state.field(lintState).selected;if(!e)return-1;for(let s=0;s{let b=-1,$;for(let j=a;ja&&(this.items.splice(a,b-a),c=!0)),s&&$.diagnostic==s.diagnostic?$.dom.hasAttribute("aria-selected")||($.dom.setAttribute("aria-selected","true"),h=$):$.dom.hasAttribute("aria-selected")&&$.dom.removeAttribute("aria-selected"),a++});a({sel:h.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:d,panel:g})=>{d.topg.bottom&&(this.list.scrollTop+=d.bottom-g.bottom)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),c&&this.sync()}sync(){let e=this.list.firstChild;function s(){let a=e;e=a.nextSibling,a.remove()}for(let a of this.items)if(a.dom.parentNode==this.list){for(;e!=a.dom;)s();e=a.dom.nextSibling}else this.list.insertBefore(a.dom,e);for(;e;)s()}moveSelection(e){if(this.selectedIndex<0)return;let s=this.view.state.field(lintState),a=findDiagnostic(s.diagnostics,this.items[e].diagnostic);!a||this.view.dispatch({selection:{anchor:a.from,head:a.to},scrollIntoView:!0,effects:movePanelSelection.of(a)})}static open(e){return new LintPanel(e)}}function svg(o,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(o)}')`}function underline(o){return svg(``,'width="6" height="3"')}const baseTheme=EditorView.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-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:underline("#d11")},".cm-lintRange-warning":{backgroundImage:underline("orange")},".cm-lintRange-info":{backgroundImage:underline("#999")},".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-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}}});var basicSetup=function o(e){e===void 0&&(e={});var s=[];e.closeBracketsKeymap!==!1&&(s=s.concat(closeBracketsKeymap)),e.defaultKeymap!==!1&&(s=s.concat(defaultKeymap)),e.searchKeymap!==!1&&(s=s.concat(searchKeymap)),e.historyKeymap!==!1&&(s=s.concat(historyKeymap)),e.foldKeymap!==!1&&(s=s.concat(foldKeymap)),e.completionKeymap!==!1&&(s=s.concat(completionKeymap)),e.lintKeymap!==!1&&(s=s.concat(lintKeymap));var a=[];return e.lineNumbers!==!1&&a.push(lineNumbers()),e.highlightActiveLineGutter!==!1&&a.push(highlightActiveLineGutter()),e.highlightSpecialChars!==!1&&a.push(highlightSpecialChars()),e.history!==!1&&a.push(history()),e.foldGutter!==!1&&a.push(foldGutter()),e.drawSelection!==!1&&a.push(drawSelection()),e.dropCursor!==!1&&a.push(dropCursor()),e.allowMultipleSelections!==!1&&a.push(EditorState.allowMultipleSelections.of(!0)),e.indentOnInput!==!1&&a.push(indentOnInput()),e.syntaxHighlighting!==!1&&a.push(syntaxHighlighting(defaultHighlightStyle,{fallback:!0})),e.bracketMatching!==!1&&a.push(bracketMatching()),e.closeBrackets!==!1&&a.push(closeBrackets()),e.autocompletion!==!1&&a.push(autocompletion()),e.rectangularSelection!==!1&&a.push(rectangularSelection()),e.crosshairCursor!==!1&&a.push(crosshairCursor()),e.highlightActiveLine!==!1&&a.push(highlightActiveLine()),e.highlightSelectionMatches!==!1&&a.push(highlightSelectionMatches()),a.concat([keymap.of(s.flat())]).filter(Boolean)};const chalky="#e5c07b",coral="#e06c75",cyan="#56b6c2",invalid="#ffffff",ivory="#abb2bf",stone="#7d8799",malibu="#61afef",sage="#98c379",whiskey="#d19a66",violet="#c678dd",darkBackground="#21252b",highlightBackground="#2c313a",background="#282c34",tooltipBackground="#353a42",selection="#3E4451",cursor="#528bff",oneDarkTheme=EditorView.theme({"&":{color:ivory,backgroundColor:background},".cm-content":{caretColor:cursor},".cm-cursor, .cm-dropCursor":{borderLeftColor:cursor},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:selection},".cm-panels":{backgroundColor:darkBackground,color:ivory},".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:highlightBackground},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847",outline:"1px solid #515a6b"},".cm-gutters":{backgroundColor:background,color:stone,border:"none"},".cm-activeLineGutter":{backgroundColor:highlightBackground},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:tooltipBackground},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:tooltipBackground,borderBottomColor:tooltipBackground},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:highlightBackground,color:ivory}}},{dark:!0}),oneDarkHighlightStyle=HighlightStyle.define([{tag:tags.keyword,color:violet},{tag:[tags.name,tags.deleted,tags.character,tags.propertyName,tags.macroName],color:coral},{tag:[tags.function(tags.variableName),tags.labelName],color:malibu},{tag:[tags.color,tags.constant(tags.name),tags.standard(tags.name)],color:whiskey},{tag:[tags.definition(tags.name),tags.separator],color:ivory},{tag:[tags.typeName,tags.className,tags.number,tags.changed,tags.annotation,tags.modifier,tags.self,tags.namespace],color:chalky},{tag:[tags.operator,tags.operatorKeyword,tags.url,tags.escape,tags.regexp,tags.link,tags.special(tags.string)],color:cyan},{tag:[tags.meta,tags.comment],color:stone},{tag:tags.strong,fontWeight:"bold"},{tag:tags.emphasis,fontStyle:"italic"},{tag:tags.strikethrough,textDecoration:"line-through"},{tag:tags.link,color:stone,textDecoration:"underline"},{tag:tags.heading,fontWeight:"bold",color:coral},{tag:[tags.atom,tags.bool,tags.special(tags.variableName)],color:whiskey},{tag:[tags.processingInstruction,tags.string,tags.inserted],color:sage},{tag:tags.invalid,color:invalid}]),oneDark=[oneDarkTheme,syntaxHighlighting(oneDarkHighlightStyle)];var getStatistics=o=>({line:o.state.doc.lineAt(o.state.selection.main.from),lineCount:o.state.doc.lines,lineBreak:o.state.lineBreak,length:o.state.doc.length,readOnly:o.state.readOnly,tabSize:o.state.tabSize,selection:o.state.selection,selectionAsSingle:o.state.selection.asSingle().main,ranges:o.state.selection.ranges,selectionCode:o.state.sliceDoc(o.state.selection.main.from,o.state.selection.main.to),selections:o.state.selection.ranges.map(e=>o.state.sliceDoc(e.from,e.to)),selectedText:o.state.selection.ranges.some(e=>!e.empty)});function useCodeMirror(o){var{value:e,selection:s,onChange:a,onStatistics:c,onCreateEditor:h,onUpdate:d,extensions:g=[],autoFocus:_,theme:b="light",height:$="",minHeight:j="",maxHeight:_e="",placeholder:et="",width:tt="",minWidth:nt="",maxWidth:st="",editable:rt=!0,readOnly:it=!1,indentWithTab:at=!0,basicSetup:ot=!0,root:ut}=o,[ct,ht]=react.exports.useState(),[lt,pt]=react.exports.useState(),[ft,gt]=react.exports.useState(),yt=EditorView.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),mt=EditorView.theme({"&":{height:$,minHeight:j,maxHeight:_e,width:tt,minWidth:nt,maxWidth:st}}),Et=EditorView.updateListener.of(St=>{if(St.docChanged&&typeof a=="function"){var At=St.state.doc,dt=At.toString();a(dt,St)}c&&c(getStatistics(St))}),Ot=[Et,mt];switch(at&&Ot.unshift(keymap.of([indentWithTab])),ot&&(typeof ot=="boolean"?Ot.unshift(basicSetup()):Ot.unshift(basicSetup(ot))),et&&Ot.unshift(placeholder(et)),b){case"light":Ot.push(yt);break;case"dark":Ot.push(oneDark);break;default:Ot.push(b);break}return rt===!1&&Ot.push(EditorView.editable.of(!1)),it&&Ot.push(EditorState.readOnly.of(!0)),d&&typeof d=="function"&&Ot.push(EditorView.updateListener.of(d)),Ot=Ot.concat(g),react.exports.useEffect(()=>{if(ct&&!ft){var St=EditorState.create({doc:e,selection:s,extensions:Ot});if(gt(St),!lt){var At=new EditorView({state:St,parent:ct,root:ut});pt(At),h&&h(At,St)}}return()=>{lt&&(gt(void 0),pt(void 0))}},[ct,ft]),react.exports.useEffect(()=>ht(o.container),[o.container]),react.exports.useEffect(()=>()=>{lt&&(lt.destroy(),pt(void 0))},[lt]),react.exports.useEffect(()=>{_&<&<.focus()},[_,lt]),react.exports.useEffect(()=>{lt&<.dispatch({effects:StateEffect.reconfigure.of(Ot)})},[b,g,$,j,_e,tt,nt,st,et,rt,it,at,ot,a,d]),react.exports.useEffect(()=>{var St=lt?lt.state.doc.toString():"";lt&&e!==St&<.dispatch({changes:{from:0,to:St.length,insert:e||""}})},[e,lt]),{state:ft,setState:gt,view:lt,setView:pt,container:ct,setContainer:ht}}var jsxRuntime={exports:{}},reactJsxRuntime_production_min={};/** * @license React * react-jsx-runtime.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var f=react.exports,k=Symbol.for("react.element"),l=Symbol.for("react.fragment"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};function q(o,e,s){var a,c={},h=null,d=null;s!==void 0&&(h=""+s),e.key!==void 0&&(h=""+e.key),e.ref!==void 0&&(d=e.ref);for(a in e)m.call(e,a)&&!p.hasOwnProperty(a)&&(c[a]=e[a]);if(o&&o.defaultProps)for(a in e=o.defaultProps,e)c[a]===void 0&&(c[a]=e[a]);return{$$typeof:k,type:o,key:h,ref:d,props:c,_owner:n.current}}reactJsxRuntime_production_min.Fragment=l;reactJsxRuntime_production_min.jsx=q;reactJsxRuntime_production_min.jsxs=q;(function(o){o.exports=reactJsxRuntime_production_min})(jsxRuntime);const Fragment=jsxRuntime.exports.Fragment,jsx=jsxRuntime.exports.jsx,jsxs=jsxRuntime.exports.jsxs;var _excluded=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root"],ReactCodeMirror=react.exports.forwardRef((o,e)=>{var{className:s,value:a="",selection:c,extensions:h=[],onChange:d,onStatistics:g,onCreateEditor:_,onUpdate:b,autoFocus:$,theme:j="light",height:_e,minHeight:et,maxHeight:tt,width:nt,minWidth:st,maxWidth:rt,basicSetup:it,placeholder:at,indentWithTab:ot,editable:ut,readOnly:ct,root:ht}=o,lt=_objectWithoutPropertiesLoose(o,_excluded),pt=react.exports.useRef(null),{state:ft,view:gt,container:yt,setContainer:mt}=useCodeMirror({container:pt.current,root:ht,value:a,autoFocus:$,theme:j,height:_e,minHeight:et,maxHeight:tt,width:nt,minWidth:st,maxWidth:rt,basicSetup:it,placeholder:at,indentWithTab:ot,editable:ut,readOnly:ct,selection:c,onChange:d,onStatistics:g,onCreateEditor:_,onUpdate:b,extensions:h});if(react.exports.useImperativeHandle(e,()=>({editor:pt.current,state:ft,view:gt}),[pt,yt,ft,gt]),typeof a!="string")throw new Error("value must be typeof string but got "+typeof a);var Et=typeof j=="string"?"cm-theme-"+j:"cm-theme";return jsx("div",_extends({ref:pt,className:""+Et+(s?" "+s:"")},lt))});ReactCodeMirror.displayName="CodeMirror";class Stack{constructor(e,s,a,c,h,d,g,_,b,$=0,j){this.p=e,this.stack=s,this.state=a,this.reducePos=c,this.pos=h,this.score=d,this.buffer=g,this.bufferBase=_,this.curContext=b,this.lookAhead=$,this.parent=j}toString(){return`[${this.stack.filter((e,s)=>s%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,s,a=0){let c=e.parser.context;return new Stack(e,[],s,a,a,0,[],0,c?new StackContext(c,c.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,s){this.stack.push(this.state,s,this.bufferBase+this.buffer.length),this.state=e}reduce(e){let s=e>>19,a=e&65535,{parser:c}=this.p,h=c.dynamicPrecedence(a);if(h&&(this.score+=h),s==0){this.pushState(c.getGoto(this.state,a,!0),this.reducePos),ad;)this.stack.pop();this.reduceContext(a,g)}storeNode(e,s,a,c=4,h=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&d.buffer[g-4]==0&&d.buffer[g-1]>-1){if(s==a)return;if(d.buffer[g-2]>=s){d.buffer[g-2]=a;return}}}if(!h||this.pos==a)this.buffer.push(e,s,a,c);else{let d=this.buffer.length;if(d>0&&this.buffer[d-4]!=0)for(;d>0&&this.buffer[d-2]>a;)this.buffer[d]=this.buffer[d-4],this.buffer[d+1]=this.buffer[d-3],this.buffer[d+2]=this.buffer[d-2],this.buffer[d+3]=this.buffer[d-1],d-=4,c>4&&(c-=4);this.buffer[d]=e,this.buffer[d+1]=s,this.buffer[d+2]=a,this.buffer[d+3]=c}}shift(e,s,a){let c=this.pos;if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let h=e,{parser:d}=this.p;(a>this.pos||s<=d.maxNode)&&(this.pos=a,d.stateFlag(h,1)||(this.reducePos=a)),this.pushState(h,c),this.shiftContext(s,c),s<=d.maxNode&&this.buffer.push(s,c,a,4)}else this.pos=a,this.shiftContext(s,c),s<=this.p.parser.maxNode&&this.buffer.push(s,c,a,4)}apply(e,s,a){e&65536?this.reduce(e):this.shift(e,s,a)}useNode(e,s){let a=this.p.reused.length-1;(a<0||this.p.reused[a]!=e)&&(this.p.reused.push(e),a++);let c=this.pos;this.reducePos=this.pos=c+e.length,this.pushState(s,c),this.buffer.push(a,c,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,s=e.buffer.length;for(;s>0&&e.buffer[s-2]>e.reducePos;)s-=4;let a=e.buffer.slice(s),c=e.bufferBase+s;for(;e&&c==e.bufferBase;)e=e.parent;return new Stack(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,a,c,this.curContext,this.lookAhead,e)}recoverByDelete(e,s){let a=e<=this.p.parser.maxNode;a&&this.storeNode(e,this.pos,s,4),this.storeNode(0,this.pos,s,a?8:4),this.pos=this.reducePos=s,this.score-=190}canShift(e){for(let s=new SimulatedStack(this);;){let a=this.p.parser.stateSlot(s.state,4)||this.p.parser.hasAction(s.state,e);if((a&65536)==0)return!0;if(a==0)return!1;s.reduce(a)}}recoverByInsert(e){if(this.stack.length>=300)return[];let s=this.p.parser.nextStates(this.state);if(s.length>4<<1||this.stack.length>=120){let c=[];for(let h=0,d;h_&1&&g==d)||c.push(s[h],d)}s=c}let a=[];for(let c=0;c>19,c=e&65535,h=this.stack.length-a*3;if(h<0||s.getGoto(this.stack[h],c,!1)<0)return!1;this.storeNode(0,this.reducePos,this.reducePos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(e),!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.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 s=0;sthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class StackContext{constructor(e,s){this.tracker=e,this.context=s,this.hash=e.strict?e.hash(s):0}}var Recover;(function(o){o[o.Insert=200]="Insert",o[o.Delete=190]="Delete",o[o.Reduce=100]="Reduce",o[o.MaxNext=4]="MaxNext",o[o.MaxInsertStackDepth=300]="MaxInsertStackDepth",o[o.DampenInsertStackDepth=120]="DampenInsertStackDepth"})(Recover||(Recover={}));class SimulatedStack{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let s=e&65535,a=e>>19;a==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(a-1)*3;let c=this.start.p.parser.getGoto(this.stack[this.base-3],s,!0);this.state=c}}class StackBufferCursor{constructor(e,s,a){this.stack=e,this.pos=s,this.index=a,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,s=e.bufferBase+e.buffer.length){return new StackBufferCursor(e,s,s-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 StackBufferCursor(this.stack,this.pos,this.index)}}class CachedToken{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const nullToken=new CachedToken;class InputStream{constructor(e,s){this.input=e,this.ranges=s,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=nullToken,this.rangeIndex=0,this.pos=this.chunkPos=s[0].from,this.range=s[0],this.end=s[s.length-1].to,this.readNext()}resolveOffset(e,s){let a=this.range,c=this.rangeIndex,h=this.pos+e;for(;ha.to:h>=a.to;){if(c==this.ranges.length-1)return null;let d=this.ranges[++c];h+=d.from-a.to,a=d}return h}peek(e){let s=this.chunkOff+e,a,c;if(s>=0&&s=this.chunk2Pos&&ag.to&&(this.chunk2=this.chunk2.slice(0,g.to-a)),c=this.chunk2.charCodeAt(0)}}return a>=this.token.lookAhead&&(this.token.lookAhead=a+1),c}acceptToken(e,s=0){let a=s?this.resolveOffset(s,-1):this.pos;if(a==null||a=this.chunk2Pos&&this.posthis.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,s){if(s?(this.token=s,s.start=e,s.lookAhead=e+1,s.value=s.extended=-1):this.token=nullToken,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&s<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,s-this.chunkPos);if(e>=this.chunk2Pos&&s<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,s-this.chunk2Pos);if(e>=this.range.from&&s<=this.range.to)return this.input.read(e,s);let a="";for(let c of this.ranges){if(c.from>=s)break;c.to>e&&(a+=this.input.read(Math.max(c.from,e),Math.min(c.to,s)))}return a}}class TokenGroup{constructor(e,s){this.data=e,this.id=s}token(e,s){readToken(this.data,e,s,this.id)}}TokenGroup.prototype.contextual=TokenGroup.prototype.fallback=TokenGroup.prototype.extend=!1;class ExternalTokenizer{constructor(e,s={}){this.token=e,this.contextual=!!s.contextual,this.fallback=!!s.fallback,this.extend=!!s.extend}}function readToken(o,e,s,a){let c=0,h=1<0){let et=o[_e];if(g.allows(et)&&(e.token.value==-1||e.token.value==et||d.overrides(et,e.token.value))){e.acceptToken(et);break}}let b=e.next,$=0,j=o[c+2];if(e.next<0&&j>$&&o[_+j*3-3]==65535){c=o[_+j*3-1];continue e}for(;$>1,et=_+_e+(_e<<1),tt=o[et],nt=o[et+1];if(b=nt)$=_e+1;else{c=o[et+2],e.advance();continue e}}break}}function decodeArray(o,e=Uint16Array){if(typeof o!="string")return o;let s=null;for(let a=0,c=0;a=92&&d--,d>=34&&d--;let _=d-32;if(_>=46&&(_-=46,g=!0),h+=_,g)break;h*=46}s?s[c++]=h:s=new e(h)}return s}const verbose=typeof process<"u"&&process.env&&/\bparse\b/.test(process.env.LOG);let stackIDs=null;var Safety;(function(o){o[o.Margin=25]="Margin"})(Safety||(Safety={}));function cutAt(o,e,s){let a=o.cursor(IterMode.IncludeAnonymous);for(a.moveTo(e);;)if(!(s<0?a.childBefore(e):a.childAfter(e)))for(;;){if((s<0?a.toe)&&!a.type.isError)return s<0?Math.max(0,Math.min(a.to-1,e-25)):Math.min(o.length,Math.max(a.from+1,e+25));if(s<0?a.prevSibling():a.nextSibling())break;if(!a.parent())return s<0?0:o.length}}class FragmentCursor{constructor(e,s){this.fragments=e,this.nodeSet=s,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?cutAt(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?cutAt(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(ee)return this.nextStart=d,null;if(h instanceof Tree){if(d==e){if(d=Math.max(this.safeFrom,e)&&(this.trees.push(h),this.start.push(d),this.index.push(0))}else this.index[s]++,this.nextStart=d+h.length}}}class TokenCache{constructor(e,s){this.stream=s,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(a=>new CachedToken)}getActions(e){let s=0,a=null,{parser:c}=e.p,{tokenizers:h}=c,d=c.stateSlot(e.state,3),g=e.curContext?e.curContext.hash:0,_=0;for(let b=0;bj.end+25&&(_=Math.max(j.lookAhead,_)),j.value!=0)){let _e=s;if(j.extended>-1&&(s=this.addActions(e,j.extended,j.end,s)),s=this.addActions(e,j.value,j.end,s),!$.extend&&(a=j,s>_e))break}}for(;this.actions.length>s;)this.actions.pop();return _&&e.setLookAhead(_),!a&&e.pos==this.stream.end&&(a=new CachedToken,a.value=e.p.parser.eofTerm,a.start=a.end=e.pos,s=this.addActions(e,a.value,a.end,s)),this.mainToken=a,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let s=new CachedToken,{pos:a,p:c}=e;return s.start=a,s.end=Math.min(a+1,c.stream.end),s.value=a==c.stream.end?c.parser.eofTerm:0,s}updateCachedToken(e,s,a){if(s.token(this.stream.reset(a.pos,e),a),e.value>-1){let{parser:c}=a.p;for(let h=0;h=0&&a.p.parser.dialect.allows(d>>1)){(d&1)==0?e.value=d>>1:e.extended=d>>1;break}}}else e.value=0,e.end=Math.min(a.p.stream.end,a.pos+1)}putAction(e,s,a,c){for(let h=0;he.bufferLength*4?new FragmentCursor(a,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,s=this.minStackPos,a=this.stacks=[],c,h;for(let d=0;ds)a.push(g);else{if(this.advanceStack(g,a,e))continue;{c||(c=[],h=[]),c.push(g);let _=this.tokens.getMainToken(g);h.push(_.value,_.end)}}break}}if(!a.length){let d=c&&findFinished(c);if(d)return this.stackToTree(d);if(this.parser.strict)throw verbose&&c&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+s);this.recovering||(this.recovering=5)}if(this.recovering&&c){let d=this.stoppedAt!=null&&c[0].pos>this.stoppedAt?c[0]:this.runRecovery(c,h,a);if(d)return this.stackToTree(d.forceAll())}if(this.recovering){let d=this.recovering==1?1:this.recovering*3;if(a.length>d)for(a.sort((g,_)=>_.score-g.score);a.length>d;)a.pop();a.some(g=>g.reducePos>s)&&this.recovering--}else if(a.length>1){e:for(let d=0;d500&&b.buffer.length>500)if((g.score-b.score||g.buffer.length-b.buffer.length)>0)a.splice(_--,1);else{a.splice(d--,1);continue e}}}}this.minStackPos=a[0].pos;for(let d=1;d ":"";if(this.stoppedAt!=null&&c>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let b=e.curContext&&e.curContext.tracker.strict,$=b?e.curContext.hash:0;for(let j=this.fragments.nodeAt(c);j;){let _e=this.parser.nodeSet.types[j.type.id]==j.type?h.getGoto(e.state,j.type.id):-1;if(_e>-1&&j.length&&(!b||(j.prop(NodeProp.contextHash)||0)==$))return e.useNode(j,_e),verbose&&console.log(d+this.stackID(e)+` (via reuse of ${h.getName(j.type.id)})`),!0;if(!(j instanceof Tree)||j.children.length==0||j.positions[0]>0)break;let et=j.children[0];if(et instanceof Tree&&j.positions[0]==0)j=et;else break}}let g=h.stateSlot(e.state,4);if(g>0)return e.reduce(g),verbose&&console.log(d+this.stackID(e)+` (via always-reduce ${h.getName(g&65535)})`),!0;if(e.stack.length>=15e3)for(;e.stack.length>9e3&&e.forceReduce(););let _=this.tokens.getActions(e);for(let b=0;b<_.length;){let $=_[b++],j=_[b++],_e=_[b++],et=b==_.length||!a,tt=et?e:e.split();if(tt.apply($,j,_e),verbose&&console.log(d+this.stackID(tt)+` (via ${($&65536)==0?"shift":`reduce of ${h.getName($&65535)}`} for ${h.getName(j)} @ ${c}${tt==e?"":", split"})`),et)return!0;tt.pos>c?s.push(tt):a.push(tt)}return!1}advanceFully(e,s){let a=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>a)return pushStackDedup(e,s),!0}}runRecovery(e,s,a){let c=null,h=!1;for(let d=0;d ":"";if(g.deadEnd&&(h||(h=!0,g.restart(),verbose&&console.log($+this.stackID(g)+" (restarted)"),this.advanceFully(g,a))))continue;let j=g.split(),_e=$;for(let et=0;j.forceReduce()&&et<10&&(verbose&&console.log(_e+this.stackID(j)+" (via force-reduce)"),!this.advanceFully(j,a));et++)verbose&&(_e=this.stackID(j)+" -> ");for(let et of g.recoverByInsert(_))verbose&&console.log($+this.stackID(et)+" (via recover-insert)"),this.advanceFully(et,a);this.stream.end>g.pos?(b==g.pos&&(b++,_=0),g.recoverByDelete(_,b),verbose&&console.log($+this.stackID(g)+` (via recover-delete ${this.parser.getName(_)})`),pushStackDedup(g,a)):(!c||c.scoreo;class ContextTracker{constructor(e){this.start=e.start,this.shift=e.shift||id,this.reduce=e.reduce||id,this.reuse=e.reuse||id,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class LRParser extends Parser{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (${14})`);let s=e.nodeNames.split(" ");this.minRepeatTerm=s.length;for(let g=0;ge.topRules[g][1]),c=[];for(let g=0;g=0)h($,_,g[b++]);else{let j=g[b+-$];for(let _e=-$;_e>0;_e--)h(g[b++],_,j);b++}}}this.nodeSet=new NodeSet(s.map((g,_)=>NodeType.define({name:_>=this.minRepeatTerm?void 0:g,id:_,props:c[_],top:a.indexOf(_)>-1,error:_==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(_)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=DefaultBufferLength;let d=decodeArray(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let g=0;gtypeof g=="number"?new TokenGroup(d,g):g),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,s,a){let c=new Parse(this,e,s,a);for(let h of this.wrappers)c=h(c,e,s,a);return c}getGoto(e,s,a=!1){let c=this.goto;if(s>=c[0])return-1;for(let h=c[s+1];;){let d=c[h++],g=d&1,_=c[h++];if(g&&a)return _;for(let b=h+(d>>1);h0}validAction(e,s){if(s==this.stateSlot(e,4))return!0;for(let a=this.stateSlot(e,1);;a+=3){if(this.data[a]==65535)if(this.data[a+1]==1)a=pair(this.data,a+2);else return!1;if(s==pair(this.data,a+1))return!0}}nextStates(e){let s=[];for(let a=this.stateSlot(e,1);;a+=3){if(this.data[a]==65535)if(this.data[a+1]==1)a=pair(this.data,a+2);else break;if((this.data[a+2]&1)==0){let c=this.data[a+1];s.some((h,d)=>d&1&&h==c)||s.push(this.data[a],c)}}return s}overrides(e,s){let a=findOffset(this.data,this.tokenPrecTable,s);return a<0||findOffset(this.data,this.tokenPrecTable,e){let c=e.tokenizers.find(h=>h.from==a);return c?c.to:a})),e.specializers&&(s.specializers=this.specializers.slice(),s.specializerSpecs=this.specializerSpecs.map((a,c)=>{let h=e.specializers.find(g=>g.from==a.external);if(!h)return a;let d=Object.assign(Object.assign({},a),{external:h.to});return s.specializers[c]=getSpecializer(d),d})),e.contextTracker&&(s.context=e.contextTracker),e.dialect&&(s.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(s.strict=e.strict),e.wrap&&(s.wrappers=s.wrappers.concat(e.wrap)),e.bufferLength!=null&&(s.bufferLength=e.bufferLength),s}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 s=this.dynamicPrecedences;return s==null?0:s[e]||0}parseDialect(e){let s=Object.keys(this.dialects),a=s.map(()=>!1);if(e)for(let h of e.split(" ")){let d=s.indexOf(h);d>=0&&(a[d]=!0)}let c=null;for(let h=0;ha)&&s.p.parser.stateFlag(s.state,2)&&(!e||e.scoreo.external(s,a)<<1|e}return o.get}const TSExtends=1,noSemi=281,incdec=2,incdecPrefix=3,templateContent=282,InterpolationStart=4,templateEnd=283,insertSemi=284,spaces=286,newline=287,LineComment=5,BlockComment=6,Dialect_ts=1,space=[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],braceR=125,braceL=123,semicolon=59,slash=47,star=42,plus=43,minus=45,dollar=36,backtick=96,backslash=92,trackNewline=new ContextTracker({start:!1,shift(o,e){return e==LineComment||e==BlockComment||e==spaces?o:e==newline},strict:!1}),insertSemicolon=new ExternalTokenizer((o,e)=>{let{next:s}=o;(s==braceR||s==-1||e.context)&&e.canShift(insertSemi)&&o.acceptToken(insertSemi)},{contextual:!0,fallback:!0}),noSemicolon=new ExternalTokenizer((o,e)=>{let{next:s}=o,a;space.indexOf(s)>-1||s==slash&&((a=o.peek(1))==slash||a==star)||s!=braceR&&s!=semicolon&&s!=-1&&!e.context&&e.canShift(noSemi)&&o.acceptToken(noSemi)},{contextual:!0}),incdecToken=new ExternalTokenizer((o,e)=>{let{next:s}=o;if((s==plus||s==minus)&&(o.advance(),s==o.next)){o.advance();let a=!e.context&&e.canShift(incdec);o.acceptToken(a?incdec:incdecPrefix)}},{contextual:!0}),template=new ExternalTokenizer(o=>{for(let e=!1,s=0;;s++){let{next:a}=o;if(a<0){s&&o.acceptToken(templateContent);break}else if(a==backtick){s?o.acceptToken(templateContent):o.acceptToken(templateEnd,1);break}else if(a==braceL&&e){s==1?o.acceptToken(InterpolationStart,1):o.acceptToken(templateContent,-1);break}else if(a==10&&s){o.advance(),o.acceptToken(templateContent);break}else a==backslash&&o.advance();e=a==dollar,o.advance()}}),tsExtends=new ExternalTokenizer((o,e)=>{if(!(o.next!=101||!e.dialectEnabled(Dialect_ts))){o.advance();for(let s=0;s<6;s++){if(o.next!="xtends".charCodeAt(s))return;o.advance()}o.next>=57&&o.next<=65||o.next>=48&&o.next<=90||o.next==95||o.next>=97&&o.next<=122||o.next>160||o.acceptToken(TSExtends)}}),jsHighlight=styleTags({"get set async static":tags.modifier,"for while do if else switch try catch finally return throw break continue default case":tags.controlKeyword,"in of await yield void typeof delete instanceof":tags.operatorKeyword,"let var const function class extends":tags.definitionKeyword,"import export from":tags.moduleKeyword,"with debugger as new":tags.keyword,TemplateString:tags.special(tags.string),super:tags.atom,BooleanLiteral:tags.bool,this:tags.self,null:tags.null,Star:tags.modifier,VariableName:tags.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":tags.function(tags.variableName),VariableDefinition:tags.definition(tags.variableName),Label:tags.labelName,PropertyName:tags.propertyName,PrivatePropertyName:tags.special(tags.propertyName),"CallExpression/MemberExpression/PropertyName":tags.function(tags.propertyName),"FunctionDeclaration/VariableDefinition":tags.function(tags.definition(tags.variableName)),"ClassDeclaration/VariableDefinition":tags.definition(tags.className),PropertyDefinition:tags.definition(tags.propertyName),PrivatePropertyDefinition:tags.definition(tags.special(tags.propertyName)),UpdateOp:tags.updateOperator,LineComment:tags.lineComment,BlockComment:tags.blockComment,Number:tags.number,String:tags.string,ArithOp:tags.arithmeticOperator,LogicOp:tags.logicOperator,BitOp:tags.bitwiseOperator,CompareOp:tags.compareOperator,RegExp:tags.regexp,Equals:tags.definitionOperator,Arrow:tags.function(tags.punctuation),": Spread":tags.punctuation,"( )":tags.paren,"[ ]":tags.squareBracket,"{ }":tags.brace,"InterpolationStart InterpolationEnd":tags.special(tags.brace),".":tags.derefOperator,", ;":tags.separator,TypeName:tags.typeName,TypeDefinition:tags.definition(tags.typeName),"type enum interface implements namespace module declare":tags.definitionKeyword,"abstract global Privacy readonly override":tags.modifier,"is keyof unique infer":tags.operatorKeyword,JSXAttributeValue:tags.attributeValue,JSXText:tags.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":tags.angleBracket,"JSXIdentifier JSXNameSpacedName":tags.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":tags.attributeName}),spec_identifier={__proto__:null,export:18,as:23,from:29,default:32,async:37,function:38,this:48,true:56,false:56,void:66,typeof:70,null:86,super:88,new:122,await:139,yield:141,delete:142,class:152,extends:154,public:197,private:197,protected:197,readonly:199,instanceof:220,in:222,const:224,import:256,keyof:307,unique:311,infer:317,is:351,abstract:371,implements:373,type:375,let:378,var:380,interface:387,enum:391,namespace:397,module:399,declare:403,global:407,for:428,of:437,while:440,with:444,do:448,if:452,else:454,switch:458,case:464,try:470,catch:474,finally:478,return:482,throw:486,break:490,continue:494,debugger:498},spec_word={__proto__:null,async:109,get:111,set:113,public:161,private:161,protected:161,static:163,abstract:165,override:167,readonly:173,new:355},spec_LessThan={__proto__:null,"<":129},parser=LRParser.deserialize({version:14,states:"$8SO`QdOOO'QQ(C|O'#ChO'XOWO'#DVO)dQdO'#D]O)tQdO'#DhO){QdO'#DrO-xQdO'#DxOOQO'#E]'#E]O.]Q`O'#E[O.bQ`O'#E[OOQ(C['#Ef'#EfO0aQ(C|O'#ItO2wQ(C|O'#IuO3eQ`O'#EzO3jQ!bO'#FaOOQ(C['#FS'#FSO3rO#tO'#FSO4QQ&jO'#FhO5bQ`O'#FgOOQ(C['#Iu'#IuOOQ(CW'#It'#ItOOQS'#J^'#J^O5gQ`O'#HpO5lQ(ChO'#HqOOQS'#Ih'#IhOOQS'#Hr'#HrQ`QdOOO){QdO'#DjO5tQ`O'#G[O5yQ&jO'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9_!WR:|;aR!aRR&Y!bS&U!b+`S+]&V&^R0Q+fR'P!yR'S!zT!tU$ZS!sU$ZU$xrs*mS&s!r!uQ,T&tQ,W&wQ.l)zS0k,S,UR4X0l`!dR!]!`$u%x&`)x+hh!qUrs!r!u$Z&t&w)z,S,U0lQ/d*mQ/w+YQ3p/oT:s&W)yT!gR$uS!fR$uS%y!]&`S&O!`)xS+S%x+hT+_&W)yT&]!b$vQ#i^R'{#nT'q#i'rR1Z,lT(a#v(cR(i#yQ-})]Q2U.RQ2|.{Q4{2TQ5l3QQ6t4}Q7U5kQ7y6zQ8S7WR8i8TlhOSj}!n$]%c%f%g%i*o*t/g/jQ%]yR*d%YV$yrs*mR.u*TR*c%WQ$qpR)u$rR)k$lT%az%dT%bz%dT/i*t/j",nodeNames:"\u26A0 extends ArithOp ArithOp InterpolationStart LineComment BlockComment Script ExportDeclaration export Star as VariableName String from ; default FunctionDeclaration async function VariableDefinition TypeParamList TypeDefinition ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation VoidType void TypeofType typeof MemberExpression . ?. PropertyName [ TemplateString Interpolation null super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewExpression new TypeArgList CompareOp < ) ( ArgList UnaryExpression await yield delete LogicOp BitOp ParenthesizedExpression ClassExpression class extends ClassBody MethodDeclaration Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression PrivatePropertyName BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof in const CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXStartTag JSXSelfClosingTag JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast ArrowFunction TypeParamList SequenceExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature CallSignature TypePredicate is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody MethodDeclaration 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",maxTerm:332,context:trackNewline,nodeProps:[["closedBy",4,"InterpolationEnd",40,"]",51,"}",66,")",132,"JSXSelfCloseEndTag JSXEndTag",146,"JSXEndTag"],["group",-26,8,15,17,58,184,188,191,192,194,197,200,211,213,219,221,223,225,228,234,240,242,244,246,248,250,251,"Statement",-30,12,13,24,27,28,41,43,44,45,47,52,60,68,74,75,91,92,101,103,119,122,124,125,126,127,129,130,148,149,151,"Expression",-22,23,25,29,32,34,152,154,156,157,159,160,161,163,164,165,167,168,169,178,180,182,183,"Type",-3,79,85,90,"ClassItem"],["openedBy",30,"InterpolationStart",46,"[",50,"{",65,"(",131,"JSXStartTag",141,"JSXStartTag JSXStartCloseTag"]],propSources:[jsHighlight],skippedNodes:[0,5,6],repeatNodeCount:28,tokenData:"!C}~R!`OX%TXY%cYZ'RZ[%c[]%T]^'R^p%Tpq%cqr'crs(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kP$UWO!^%T!_#o%T#p~%T7Z!@gr$UW'Y7R#zS']$y'g3SOX%TXY%cYZ%TZ[%c[p%Tpq%cqt%Ttu2`u}%T}!O3j!O!Q%T!Q![2`![!^%T!_!c%T!c!}2`!}#R%T#R#S2`#S#T%T#T#o2`#p$f%T$f$g%c$g#BY2`#BY#BZ!@Y#BZ$IS2`$IS$I_!@Y$I_$JT2`$JT$JU!@Y$JU$KV2`$KV$KW!@Y$KW&FU2`&FU&FV!@Y&FV?HT2`?HT?HU!@Y?HU~2`7Z!CO_$UW'Z7R#zS']$y'g3SOt%Ttu2`u}%T}!O3j!O!Q%T!Q![2`![!^%T!_!c%T!c!}2`!}#R%T#R#S2`#S#T%T#T#o2`#p$g%T$g~2`",tokenizers:[tsExtends,noSemicolon,incdecToken,template,0,1,2,3,4,5,6,7,8,9,insertSemicolon],topRules:{Script:[0,7]},dialects:{jsx:12107,ts:12109},dynamicPrecedences:{149:1,176:1},specialized:[{term:289,get:o=>spec_identifier[o]||-1},{term:299,get:o=>spec_word[o]||-1},{term:63,get:o=>spec_LessThan[o]||-1}],tokenPrec:12130}),snippets=[snippetCompletion("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),snippetCompletion("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),snippetCompletion("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),snippetCompletion("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),snippetCompletion("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),snippetCompletion(`try { \${} } catch (\${error}) { \${} }`,{label:"try",detail:"/ catch block",type:"keyword"}),snippetCompletion("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),snippetCompletion(`if (\${}) { \${} } else { \${} }`,{label:"if",detail:"/ else block",type:"keyword"}),snippetCompletion(`class \${name} { constructor(\${params}) { \${} } }`,{label:"class",detail:"definition",type:"keyword"}),snippetCompletion('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),snippetCompletion('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],cache=new NodeWeakMap,ScopeNodes=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function defID(o){return(e,s)=>{let a=e.node.getChild("VariableDefinition");return a&&s(a,o),!0}}const functionContext=["FunctionDeclaration"],gatherCompletions={FunctionDeclaration:defID("function"),ClassDeclaration:defID("class"),ClassExpression:()=>!0,EnumDeclaration:defID("constant"),TypeAliasDeclaration:defID("type"),NamespaceDeclaration:defID("namespace"),VariableDefinition(o,e){o.matchContext(functionContext)||e(o,"variable")},TypeDefinition(o,e){e(o,"type")},__proto__:null};function getScope(o,e){let s=cache.get(e);if(s)return s;let a=[],c=!0;function h(d,g){let _=o.sliceString(d.from,d.to);a.push({label:_,type:g})}return e.cursor(IterMode.IncludeAnonymous).iterate(d=>{if(c)c=!1;else if(d.name){let g=gatherCompletions[d.name];if(g&&g(d,h)||ScopeNodes.has(d.name))return!1}else if(d.to-d.from>8192){for(let g of getScope(o,d.node))a.push(g);return!1}}),cache.set(e,a),a}const Identifier=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,dontComplete=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName"];function localCompletionSource(o){let e=syntaxTree(o.state).resolveInner(o.pos,-1);if(dontComplete.indexOf(e.name)>-1)return null;let s=e.to-e.from<20&&Identifier.test(o.state.sliceDoc(e.from,e.to));if(!s&&!o.explicit)return null;let a=[];for(let c=e;c;c=c.parent)ScopeNodes.has(c.name)&&(a=a.concat(getScope(o.state.doc,c)));return{options:a,from:s?e.from:o.pos,validFor:Identifier}}const javascriptLanguage=LRLanguage.define({parser:parser.configure({props:[indentNodeProp.add({IfStatement:continuedIndent({except:/^\s*({|else\b)/}),TryStatement:continuedIndent({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:flatIndent,SwitchBody:o=>{let e=o.textAfter,s=/^\s*\}/.test(e),a=/^\s*(case|default)\b/.test(e);return o.baseIndent+(s?0:a?1:2)*o.unit},Block:delimitedIndent({closing:"}"}),ArrowFunction:o=>o.baseIndent+o.unit,"TemplateString BlockComment":()=>null,"Statement Property":continuedIndent({except:/^{/}),JSXElement(o){let e=/^\s*<\//.test(o.textAfter);return o.lineIndent(o.node.from)+(e?0:o.unit)},JSXEscape(o){let e=/\s*\}/.test(o.textAfter);return o.lineIndent(o.node.from)+(e?0:o.unit)},"JSXOpenTag JSXSelfClosingTag"(o){return o.column(o.node.from)+o.unit}}),foldNodeProp.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression":foldInside,BlockComment(o){return{from:o.from+2,to:o.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),typescriptLanguage=javascriptLanguage.configure({dialect:"ts"}),jsxLanguage=javascriptLanguage.configure({dialect:"jsx"}),tsxLanguage=javascriptLanguage.configure({dialect:"jsx ts"}),keywords="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(o=>({label:o,type:"keyword"}));function javascript(o={}){let e=o.jsx?o.typescript?tsxLanguage:jsxLanguage:o.typescript?typescriptLanguage:javascriptLanguage;return new LanguageSupport(e,[javascriptLanguage.data.of({autocomplete:ifNotIn(dontComplete,completeFromList(snippets.concat(keywords)))}),javascriptLanguage.data.of({autocomplete:localCompletionSource}),o.jsx?autoCloseTags:[]])}function elementName(o,e,s=o.length){if(!e)return"";let a=e.getChild("JSXIdentifier");return a?o.sliceString(a.from,Math.min(a.to,s)):""}const android=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),autoCloseTags=EditorView.inputHandler.of((o,e,s,a)=>{if((android?o.composing:o.compositionStarted)||o.state.readOnly||e!=s||a!=">"&&a!="/"||!javascriptLanguage.isActiveAt(o.state,e,-1))return!1;let{state:c}=o,h=c.changeByRange(d=>{var g,_,b;let{head:$}=d,j=syntaxTree(c).resolveInner($,-1),_e;if(j.name=="JSXStartTag"&&(j=j.parent),a==">"&&j.name=="JSXFragmentTag")return{range:EditorSelection.cursor($+1),changes:{from:$,insert:"><>"}};if(a==">"&&j.name=="JSXIdentifier"){if(((_=(g=j.parent)===null||g===void 0?void 0:g.lastChild)===null||_===void 0?void 0:_.name)!="JSXEndTag"&&(_e=elementName(c.doc,j.parent,$)))return{range:EditorSelection.cursor($+1),changes:{from:$,insert:`>`}}}else if(a=="/"&&j.name=="JSXFragmentTag"){let et=j.parent,tt=et==null?void 0:et.parent;if(et.from==$-1&&((b=tt.lastChild)===null||b===void 0?void 0:b.name)!="JSXEndTag"&&(_e=elementName(c.doc,tt==null?void 0:tt.firstChild,$))){let nt=`/${_e}>`;return{range:EditorSelection.cursor($+nt.length),changes:{from:$,insert:nt}}}}return{range:d}});return h.changes.empty?!1:(o.dispatch(h,{userEvent:"input.type",scrollIntoView:!0}),!0)});var createTheme=o=>{var{theme:e,settings:s,styles:a}=o,c={"&":{backgroundColor:s.background,color:s.foreground},".cm-gutters":{}};s.gutterBackground&&(c[".cm-gutters"].backgroundColor=s.gutterBackground),s.gutterForeground&&(c[".cm-gutters"].color=s.gutterForeground),s.gutterBorder&&(c[".cm-gutters"].borderRightColor=s.gutterBorder),s.caret&&(c[".cm-content"]={caretColor:s.caret},c[".cm-cursor, .cm-dropCursor"]={borderLeftColor:s.caret}),s.lineHighlight&&(c[".cm-activeLine"]={backgroundColor:s.lineHighlight},c[".cm-activeLineGutter"]={backgroundColor:s.lineHighlight}),s.selection&&(c["&.cm-focused .cm-selectionBackground .cm-selectionBackground, & .cm-selectionLayer .cm-selectionBackground, ::selection"]={backgroundColor:s.selection}),s.selectionMatch&&(c["& .cm-selectionMatch"]={backgroundColor:s.selectionMatch});var h=EditorView.theme(c,{dark:e==="dark"}),d=HighlightStyle.define(a),g=[h,syntaxHighlighting(d)];return g};const strudelTheme=createTheme({theme:"dark",settings:{background:"#222",foreground:"#75baff",caret:"#ffcc00",selection:"rgba(128, 203, 196, 0.5)",selectionMatch:"#036dd626",lineHighlight:"#8a91991a",gutterBackground:"transparent",gutterForeground:"#676e95"},styles:[{tag:tags.keyword,color:"#c792ea"},{tag:tags.operator,color:"#89ddff"},{tag:tags.special(tags.variableName),color:"#eeffff"},{tag:tags.typeName,color:"#f07178"},{tag:tags.atom,color:"#f78c6c"},{tag:tags.number,color:"#ff5370"},{tag:tags.definition(tags.variableName),color:"#82aaff"},{tag:tags.string,color:"#c3e88d"},{tag:tags.special(tags.string),color:"#f07178"},{tag:tags.comment,color:"#7d8799"},{tag:tags.variableName,color:"#f07178"},{tag:tags.tagName,color:"#ff5370"},{tag:tags.bracket,color:"#a2a1a4"},{tag:tags.meta,color:"#ffcb6b"},{tag:tags.attributeName,color:"#c792ea"},{tag:tags.propertyName,color:"#c792ea"},{tag:tags.className,color:"#decb6b"},{tag:tags.invalid,color:"#ffffff"}]}),style$1="",setFlash=StateEffect.define(),flashField=StateField.define({create(){return Decoration.none},update(o,e){try{for(let s of e.effects)if(s.is(setFlash))if(s.value){const a=Decoration.mark({attributes:{style:"background-color: #FFCA2880"}});o=Decoration.set([a.range(0,e.newDoc.length)])}else o=Decoration.set([]);return o}catch(s){return console.warn("flash error",s),o}},provide:o=>EditorView.decorations.from(o)}),flash=o=>{o.dispatch({effects:setFlash.of(!0)}),setTimeout(()=>{o.dispatch({effects:setFlash.of(!1)})},200)},setHighlights=StateEffect.define(),highlightField=StateField.define({create(){return Decoration.none},update(o,e){try{for(let s of e.effects)if(s.is(setHighlights)){const a=s.value.map(c=>(c.context.locations||[]).map(({start:h,end:d})=>{const g=c.context.color||"#FFCA28";let _=e.newDoc.line(h.line).from+h.column,b=e.newDoc.line(d.line).from+d.column;const $=e.newDoc.length;return _>$||b>$?void 0:Decoration.mark({attributes:{style:`outline: 1.5px solid ${g};`}}).range(_,b)})).flat().filter(Boolean)||[];o=Decoration.set(a,!0)}return o}catch{return Decoration.set([])}},provide:o=>EditorView.decorations.from(o)}),extensions=[javascript(),strudelTheme,highlightField,flashField];function CodeMirror({value:o,onChange:e,onViewChanged:s,onSelectionChange:a,options:c,editorDidMount:h}){const d=react.exports.useCallback(b=>{e==null||e(b)},[e]),g=react.exports.useCallback(b=>{s==null||s(b)},[s]),_=react.exports.useCallback(b=>{b.selectionSet&&a&&(a==null||a(b.state.selection))},[a]);return jsx(Fragment,{children:jsx(ReactCodeMirror,{value:o,onChange:d,onCreateEditor:g,onUpdate:_,extensions})})}const useKeydown=o=>react.exports.useLayoutEffect(()=>(window.addEventListener("keydown",o,!0),()=>window.removeEventListener("keydown",o,!0)),[o]);function useStrudel({defaultOutput:o,interval:e,getTime:s,code:a,evalOnMount:c=!1}){const[h,d]=react.exports.useState(),[g,_]=react.exports.useState(),[b,$]=react.exports.useState(a),[j,_e]=react.exports.useState(),et=a!==b,tt=react.exports.useMemo(()=>new Scheduler({interval:e,onTrigger:o,onError:d,getTime:s}),[o,e]),nt=react.exports.useCallback(async()=>{if(!a){console.log("no code..");return}try{const{pattern:rt}=await evaluate(a);$(a),tt==null||tt.setPattern(rt),_e(rt),_()}catch(rt){_(rt),console.warn("eval error",rt)}},[a,tt]),st=react.exports.useRef();return react.exports.useEffect(()=>{!st.current&&c&&(st.current=!0,nt())},[nt,c]),{schedulerError:h,scheduler:tt,evalError:g,evaluate:nt,activeCode:b,isDirty:et,pattern:j}}function useHighlighting({view:o,pattern:e,active:s,getTime:a}){const c=react.exports.useRef([]),h=react.exports.useRef();react.exports.useEffect(()=>{if(o)if(e&&s){let g=function(){try{const _=a(),$=[Math.max(h.current||_,_-1/10),_+1/60];h.current=_+1/60,c.current=c.current.filter(_e=>_e.whole.end>_);const j=e.queryArc(...$).filter(_e=>_e.hasOnset());c.current=c.current.concat(j),o.dispatch({effects:setHighlights.of(c.current)})}catch{o.dispatch({effects:setHighlights.of([])})}d=requestAnimationFrame(g)},d=requestAnimationFrame(g);return()=>{cancelAnimationFrame(d)}}else c.current=[],o.dispatch({effects:setHighlights.of([])})},[e,s,o])}const style="";evalScope(controls,__vitePreload(()=>Promise.resolve().then(()=>strudel),void 0),__vitePreload(()=>import("./index.fbde1114.js"),[]),__vitePreload(()=>import("./index.bb9bb2c4.js"),[]),__vitePreload(()=>import("./index.5b4bbb94.js"),[]),__vitePreload(()=>import("./index.e7ac54e9.js"),[]),__vitePreload(()=>import("./osc.c09823d8.js"),[]),__vitePreload(()=>import("./index.0dabc914.js"),[]),__vitePreload(()=>import("./serial.b42b098c.js"),[]),__vitePreload(()=>import("./index.cc0b04cf.js"),[]));const defaultTune=`samples({ bd: ['bd/BT0AADA.wav','bd/BT0AAD0.wav','bd/BT0A0DA.wav','bd/BT0A0D3.wav','bd/BT0A0D0.wav','bd/BT0A0A7.wav'], sd: ['sd/rytm-01-classic.wav','sd/rytm-00-hard.wav'], hh: ['hh27/000_hh27closedhh.wav','hh/000_hh3closedhh.wav'], }, 'github:tidalcycles/Dirt-Samples/master/'); stack( s("bd,[~ ],hh(3,4)") // drums .speed(perlin.range(.7,.9)) // random sample speed variation //.hush() ,"" // bassline .off(1/8,x=>x.add(12).degradeBy(.5)) // random octave jumps .add(perlin.range(0,.5)) // random pitch variation .superimpose(add(.05)) // add second, slightly detuned voice .n() // wrap in "n" .decay(.15).sustain(0) // make each note of equal length .s('sawtooth') // waveform .gain(.4) // turn down .cutoff(sine.slow(7).range(300,5000)) // automate cutoff //.hush() ,">".voicings() // chords .superimpose(x=>x.add(.04)) // add second, slightly detuned voice .add(perlin.range(0,.5)) // random pitch variation .n() // wrap in "n" .s('square') // waveform .gain(.16) // turn down .cutoff(500) // fixed cutoff .attack(1) // slowly fade in //.hush() ,"a4 c5 ".struct("x(5,8)") .superimpose(x=>x.add(.04)) // add second, slightly detuned voice .add(perlin.range(0,.5)) // random pitch variation .n() // wrap in "n" .decay(.1).sustain(0) // make notes short .s('triangle') // waveform .degradeBy(perlin.range(0,.5)) // randomly controlled random removal :) .echoWith(4,.125,(x,n)=>x.gain(.15*1/(n+1))) // echo notes //.hush() ) .fast(2/3)`,ctx=getAudioContext(),getTime=()=>ctx.currentTime;function App(){const[o,e]=react.exports.useState(defaultTune),[s,a]=react.exports.useState(),{scheduler:c,evaluate:h,schedulerError:d,evalError:g,isDirty:_,activeCode:b,pattern:$}=useStrudel({code:o,defaultOutput:webaudioOutput,getTime});useHighlighting({view:s,pattern:$,active:!(b!=null&&b.includes("strudel disable-highlighting")),getTime:()=>c.phase});const j=g||d;return useKeydown(react.exports.useCallback(async _e=>{(_e.ctrlKey||_e.altKey)&&(_e.code==="Enter"?(_e.preventDefault(),flash(s),await h(),_e.shiftKey&&(panic(),c.stop(),c.start()),c.started||c.start()):_e.code==="Period"&&(c.pause(),panic(),_e.preventDefault()))},[c,h,s])),jsxs("div",{children:[jsxs("nav",{className:"z-[12] w-full flex justify-center absolute bottom-0",children:[jsxs("div",{className:"bg-slate-500 space-x-2 px-2 rounded-t-md",children:[jsx("button",{onClick:async()=>{await h(),await getAudioContext().resume(),c.start()},children:"start"}),jsx("button",{onClick:()=>c.stop(),children:"stop"}),_&&jsx("button",{onClick:()=>h(),children:"eval"})]}),j&&jsxs("p",{children:["error ",j.message]})]}),jsx(CodeMirror,{value:o,onChange:e,onViewChanged:a})]})}client.createRoot(document.getElementById("root")).render(jsx(React.StrictMode,{children:jsx(App,{})}));export{Hap as H,Pattern$3 as P,getDefaultExportFromCjs as a,chooseInWith as b,commonjsGlobal as c,rand as d,strudel as e,getAudioContext as f,getAugmentedNamespace as g,getDestination as h,getCachedBuffer as i,getLoadedBuffer as j,loadGithubSamples as k,loadBuffer as l,mod as m,samples as n,resetLoadedSamples as o,panic as p,getLoadedSamples$1 as q,reify$1 as r,stack as s,webaudioOutput as w};