UNPKG

code-server

Version:

Run VS Code on a remote server.

160 lines • 598 kB
import{n as No}from"./chunk-YNKYB66X.js";import{a as Hp,b as Wp,c as Up}from"./chunk-OOJM4CTU.js";var pl=Hp((t9,xa)=>{(function(){var t;typeof xa<"u"?t=xa.exports=i:t=(function(){return this||(0,eval)("this")})(),t.format=i,t.vsprintf=n,typeof console<"u"&&typeof console.log=="function"&&(t.printf=e);function e(){console.log(i.apply(null,arguments))}function n(r,s){return i.apply(null,[r].concat(s))}function i(r){for(var s=1,o=[].slice.call(arguments),a=0,u=r.length,c="",d,h=!1,l,f,m=!1,p,g=function(){return o[s++]},b=function(){for(var w="";/\d/.test(r[a]);)w+=r[a++],d=r[a];return w.length>0?parseInt(w):null};a<u;++a)if(d=r[a],h)switch(h=!1,d=="."?(m=!1,d=r[++a]):d=="0"&&r[a+1]=="."?(m=!0,a+=2,d=r[a]):m=!0,p=b(),d){case"b":c+=parseInt(g(),10).toString(2);break;case"c":l=g(),typeof l=="string"||l instanceof String?c+=l:c+=String.fromCharCode(parseInt(l,10));break;case"d":c+=parseInt(g(),10);break;case"f":f=String(parseFloat(g()).toFixed(p||6)),c+=m?f:f.replace(/^0/,"");break;case"j":c+=JSON.stringify(g());break;case"o":c+="0"+parseInt(g(),10).toString(8);break;case"s":c+=g();break;case"x":c+="0x"+parseInt(g(),10).toString(16);break;case"X":c+="0x"+parseInt(g(),10).toString(16).toUpperCase();break;default:c+=d;break}else d==="%"?h=!0:c+=d;return c}})()});var K=["macos"],$e=["windows","linux"],he=(t,e=!1)=>({kind:"cursor",command:t,extend:e}),ot=t=>({kind:"edit",command:t}),bd=t=>({kind:"history",command:t}),vd=t=>({kind:"tab",command:t}),Ao=t=>({kind:"enter",command:t}),R=(t,e,n)=>({key:t,modifiers:e,platforms:n}),q=(t,e,n,i,r="host")=>({id:t,title:e,action:n,keybindings:i,routing:r}),Pn=[q("markdown.editor.cursorLeft","Move Cursor Left",he("left"),[R("b",{ctrl:!0},K),R("ArrowLeft")]),q("markdown.editor.cursorRight","Move Cursor Right",he("right"),[R("f",{ctrl:!0},K),R("ArrowRight")]),q("markdown.editor.cursorUp","Move Cursor Up",he("up"),[R("p",{ctrl:!0},K),R("ArrowUp")]),q("markdown.editor.cursorDown","Move Cursor Down",he("down"),[R("n",{ctrl:!0},K),R("ArrowDown")]),q("markdown.editor.cursorLeftSelect","Select Left",he("left",!0),[R("ArrowLeft",{shift:!0})]),q("markdown.editor.cursorRightSelect","Select Right",he("right",!0),[R("ArrowRight",{shift:!0})]),q("markdown.editor.cursorUpSelect","Select Up",he("up",!0),[R("ArrowUp",{shift:!0})]),q("markdown.editor.cursorDownSelect","Select Down",he("down",!0),[R("ArrowDown",{shift:!0})]),q("markdown.editor.cursorWordLeft","Move Cursor Word Left",he("wordLeft"),[R("ArrowLeft",{alt:!0},K),R("ArrowLeft",{ctrl:!0},$e)]),q("markdown.editor.cursorWordRight","Move Cursor Word Right",he("wordRight"),[R("ArrowRight",{alt:!0},K),R("ArrowRight",{ctrl:!0},$e)]),q("markdown.editor.cursorWordLeftSelect","Select Word Left",he("wordLeft",!0),[R("ArrowLeft",{alt:!0,shift:!0},K),R("ArrowLeft",{ctrl:!0,shift:!0},$e)]),q("markdown.editor.cursorWordRightSelect","Select Word Right",he("wordRight",!0),[R("ArrowRight",{alt:!0,shift:!0},K),R("ArrowRight",{ctrl:!0,shift:!0},$e)]),q("markdown.editor.cursorVisualLineStart","Move Cursor to Visual Line Start",he("visualLineStart"),[R("ArrowLeft",{meta:!0},K),R("Home")]),q("markdown.editor.cursorVisualLineEnd","Move Cursor to Visual Line End",he("visualLineEnd"),[R("ArrowRight",{meta:!0},K),R("End")]),q("markdown.editor.cursorVisualLineStartSelect","Select to Visual Line Start",he("visualLineStart",!0),[R("ArrowLeft",{meta:!0,shift:!0},K),R("Home",{shift:!0})]),q("markdown.editor.cursorVisualLineEndSelect","Select to Visual Line End",he("visualLineEnd",!0),[R("ArrowRight",{meta:!0,shift:!0},K),R("End",{shift:!0})]),q("markdown.editor.cursorLogicalLineStart","Move Cursor to Logical Line Start",he("logicalLineStart"),[R("a",{ctrl:!0},K)]),q("markdown.editor.cursorLogicalLineEnd","Move Cursor to Logical Line End",he("logicalLineEnd"),[R("e",{ctrl:!0},K)]),q("markdown.editor.cursorLogicalLineStartSelect","Select to Logical Line Start",he("logicalLineStart",!0),[R("a",{ctrl:!0,shift:!0},K)]),q("markdown.editor.cursorLogicalLineEndSelect","Select to Logical Line End",he("logicalLineEnd",!0),[R("e",{ctrl:!0,shift:!0},K)]),q("markdown.editor.cursorDocumentStart","Move Cursor to Document Start",he("documentStart"),[R("ArrowUp",{meta:!0},K),R("Home",{ctrl:!0},$e)]),q("markdown.editor.cursorDocumentEnd","Move Cursor to Document End",he("documentEnd"),[R("ArrowDown",{meta:!0},K),R("End",{ctrl:!0},$e)]),q("markdown.editor.cursorDocumentStartSelect","Select to Document Start",he("documentStart",!0),[R("ArrowUp",{meta:!0,shift:!0},K),R("Home",{ctrl:!0,shift:!0},$e)]),q("markdown.editor.cursorDocumentEndSelect","Select to Document End",he("documentEnd",!0),[R("ArrowDown",{meta:!0,shift:!0},K),R("End",{ctrl:!0,shift:!0},$e)]),q("markdown.editor.selectAll","Select All",{kind:"selectAll"},[R("a",{meta:!0},K),R("a",{ctrl:!0},$e)]),q("markdown.editor.deleteLeft","Delete Left",ot("deleteLeft"),[R("h",{ctrl:!0},K),R("Backspace",{ctrl:!0},K),R("Backspace"),R("Backspace",{shift:!0})]),q("markdown.editor.deleteRight","Delete Right",ot("deleteRight"),[R("d",{ctrl:!0},K),R("Delete",{ctrl:!0},K),R("Delete")]),q("markdown.editor.deleteWordLeft","Delete Word Left",ot("deleteWordLeft"),[R("Backspace",{alt:!0},K),R("Backspace",{ctrl:!0},$e)]),q("markdown.editor.deleteWordRight","Delete Word Right",ot("deleteWordRight"),[R("Delete",{alt:!0},K),R("Delete",{ctrl:!0},$e)]),q("markdown.editor.deleteLineLeft","Delete All Left",ot("deleteLineLeft"),[R("Backspace",{meta:!0},K)]),q("markdown.editor.deleteLineRight","Delete All Right",ot("deleteLineRight"),[R("Delete",{meta:!0},K),R("k",{ctrl:!0},K)]),q("markdown.editor.copyLinesUp","Copy Line Up",ot("copyLinesUp"),[R("ArrowUp",{alt:!0,shift:!0},K),R("ArrowUp",{alt:!0,shift:!0},["windows"]),R("ArrowUp",{ctrl:!0,alt:!0,shift:!0},["linux"])]),q("markdown.editor.copyLinesDown","Copy Line Down",ot("copyLinesDown"),[R("ArrowDown",{alt:!0,shift:!0},K),R("ArrowDown",{alt:!0,shift:!0},["windows"]),R("ArrowDown",{ctrl:!0,alt:!0,shift:!0},["linux"])]),q("markdown.editor.moveLinesUp","Move Line Up",ot("moveLinesUp"),[R("ArrowUp",{alt:!0})]),q("markdown.editor.moveLinesDown","Move Line Down",ot("moveLinesDown"),[R("ArrowDown",{alt:!0})]),q("markdown.editor.deleteLines","Delete Line",ot("deleteLines"),[R("k",{meta:!0,shift:!0},K),R("k",{ctrl:!0,shift:!0},$e)]),q("markdown.editor.joinLines","Join Lines",ot("joinLines"),[R("j",{ctrl:!0},K)]),q("markdown.editor.toggleLocked","Toggle Editing/Locked Mode",{kind:"toggleReadonly"},[R("e",{meta:!0},K)]),q("markdown.editor.undo","Undo",bd("undo"),[R("z",{meta:!0},K),R("z",{ctrl:!0},$e)]),q("markdown.editor.redo","Redo",bd("redo"),[R("z",{meta:!0,shift:!0},K),R("z",{ctrl:!0,shift:!0},$e),R("y",{ctrl:!0},$e)]),q("markdown.editor.insertTab","Insert Tab",vd("insert"),[R("Tab")],"local"),q("markdown.editor.outdent","Outdent",vd("outdent"),[R("Tab",{shift:!0})],"local"),q("markdown.editor.toggleTabFocus","Toggle Tab Key Moves Focus",{kind:"toggleTabFocus"},[R("m",{ctrl:!0})],"local"),q("markdown.editor.smartEnter","Insert Paragraph",Ao("smartEnter"),[R("Enter")]),q("markdown.editor.insertHardLineBreak","Insert Hard Line Break",Ao("insertHardLineBreak"),[R("Enter",{shift:!0})]),q("markdown.editor.insertParagraph","Insert Paragraph Without Continuing Markup",Ao("insertParagraph"),[R("Enter",{meta:!0},K),R("Enter",{ctrl:!0})])];var T=class t{constructor(e,n){if(this.start=e,this.endExclusive=n,e>n)throw new Error(`Invalid range: [${e}, ${n})`)}static fromTo(e,n){return new t(e,n)}static ofLength(e){return new t(0,e)}static ofStartAndLength(e,n){return new t(e,e+n)}static emptyAt(e){return new t(e,e)}get isEmpty(){return this.start===this.endExclusive}get length(){return this.endExclusive-this.start}delta(e){return new t(this.start+e,this.endExclusive+e)}deltaStart(e){return new t(this.start+e,this.endExclusive)}deltaEnd(e){return new t(this.start,this.endExclusive+e)}contains(e){return this.start<=e&&e<this.endExclusive}containsRange(e){return this.start<=e.start&&e.endExclusive<=this.endExclusive}intersects(e){return Math.max(this.start,e.start)<Math.min(this.endExclusive,e.endExclusive)}intersectsOrTouches(e){return Math.max(this.start,e.start)<=Math.min(this.endExclusive,e.endExclusive)}intersect(e){let n=Math.max(this.start,e.start),i=Math.min(this.endExclusive,e.endExclusive);if(n<=i)return new t(n,i)}join(e){return new t(Math.min(this.start,e.start),Math.max(this.endExclusive,e.endExclusive))}isBefore(e){return this.endExclusive<=e.start}isAfter(e){return this.start>=e.endExclusive}substring(e){return e.substring(this.start,this.endExclusive)}slice(e){return e.slice(this.start,this.endExclusive)}equals(e){return this.start===e.start&&this.endExclusive===e.endExclusive}toString(){return`[${this.start}, ${this.endExclusive})`}},Ce=class t{constructor(e,n){this.replaceRange=e,this.newText=n}static insert(e,n){return new t(T.emptyAt(e),n)}static replace(e,n){return new t(e,n)}static delete(e){return new t(e,"")}get isEmpty(){return this.replaceRange.isEmpty&&this.newText.length===0}equals(e){return this.replaceRange.equals(e.replaceRange)&&this.newText===e.newText}removeCommonSuffixPrefix(e){let n=this.replaceRange.substring(e),i=Kp(n,this.newText),r=Math.min(n.length-i,this.newText.length-i,Zp(n,this.newText));return new t(new T(this.replaceRange.start+i,this.replaceRange.endExclusive-r),this.newText.substring(i,this.newText.length-r))}toString(){return`${this.replaceRange} -> ${JSON.stringify(this.newText)}`}};function Kp(t,e){let n=Math.min(t.length,e.length),i=0;for(;i<n&&t.charCodeAt(i)===e.charCodeAt(i);)i++;return i}function Zp(t,e){let n=Math.min(t.length,e.length),i=0;for(;i<n&&t.charCodeAt(t.length-i-1)===e.charCodeAt(e.length-i-1);)i++;return i}var j=class t{static empty=new t([]);static single(e){return new t([e])}static replace(e,n){return new t([Ce.replace(e,n)])}static insert(e,n){return new t([Ce.insert(e,n)])}static delete(e){return new t([Ce.delete(e)])}replacements;constructor(e){let n=-1;for(let i of e){if(i.replaceRange.start<n)throw new Error(`Edits must be disjoint and sorted. Found ${i} after ${n}`);n=i.replaceRange.endExclusive}this.replacements=e}get isEmpty(){return this.replacements.length===0}apply(e){let n=[],i=0;for(let r of this.replacements)n.push(e.substring(i,r.replaceRange.start)),n.push(r.newText),i=r.replaceRange.endExclusive;return n.push(e.substring(i)),n.join("")}inverse(e){let n=[],i=0;for(let r of this.replacements){let s=e.substring(r.replaceRange.start,r.replaceRange.endExclusive);n.push(Ce.replace(T.ofStartAndLength(r.replaceRange.start+i,r.newText.length),s)),i+=r.newText.length-r.replaceRange.length}return new t(n)}equals(e){if(this.replacements.length!==e.replacements.length)return!1;for(let n=0;n<this.replacements.length;n++)if(!this.replacements[n].equals(e.replacements[n]))return!1;return!0}mapOffset(e){let n=0;for(let i of this.replacements){if(i.replaceRange.start>e)break;if(i.replaceRange.endExclusive<=e)n+=i.newText.length-i.replaceRange.length;else return i.replaceRange.start+n+i.newText.length}return e+n}toString(){return`[${this.replacements.map(e=>e.toString()).join(", ")}]`}};function _d(t,e){return t===e?j.empty:j.single(Ce.replace(new T(0,t.length),e).removeCommonSuffixPrefix(t))}var fn;function xd(t){fn?fn instanceof mr?fn.loggers.push(t):fn=new mr([fn,t]):fn=t}function se(){return fn}var Po;function wd(t){Po=t}function yd(t){Po&&Po(t)}var mr=class{constructor(e){this.loggers=e}handleObservableCreated(e,n){for(let i of this.loggers)i.handleObservableCreated(e,n)}handleOnListenerCountChanged(e,n){for(let i of this.loggers)i.handleOnListenerCountChanged(e,n)}handleObservableUpdated(e,n){for(let i of this.loggers)i.handleObservableUpdated(e,n)}handleAutorunCreated(e,n){for(let i of this.loggers)i.handleAutorunCreated(e,n)}handleAutorunDisposed(e){for(let n of this.loggers)n.handleAutorunDisposed(e)}handleAutorunDependencyChanged(e,n,i){for(let r of this.loggers)r.handleAutorunDependencyChanged(e,n,i)}handleAutorunStarted(e){for(let n of this.loggers)n.handleAutorunStarted(e)}handleAutorunFinished(e){for(let n of this.loggers)n.handleAutorunFinished(e)}handleDerivedDependencyChanged(e,n,i){for(let r of this.loggers)r.handleDerivedDependencyChanged(e,n,i)}handleDerivedCleared(e){for(let n of this.loggers)n.handleDerivedCleared(e)}handleBeginTransaction(e){for(let n of this.loggers)n.handleBeginTransaction(e)}handleEndTransaction(e){for(let n of this.loggers)n.handleEndTransaction(e)}};var ye;(function(t){let e=!1;function n(){e=!0}t.enable=n;function i(){return r(1)}t.ofCaller=i;function r(s){if(!e)return;let o=Error,a=o.stackTraceLimit;o.stackTraceLimit=3;let u=new Error().stack;return o.stackTraceLimit=a,Fo.fromStack(u,s+1)}t.ofNthCaller=r})(ye||(ye={}));var Fo=class t{static fromStack(e,n){let i=e.split(`
`),r=Xp(i[n+1]);if(r)return new t(r.fileName,r.line,r.column,r.id)}constructor(e,n,i,r){this.fileName=e,this.line=n,this.column=i,this.id=r}};function Xp(t){if(!t)return;let e=t.match(/\((.*):(\d+):(\d+)\)/);if(e)return{fileName:e[1],line:parseInt(e[2]),column:parseInt(e[3]),id:t};let n=t.match(/at ([^\(\)]*):(\d+):(\d+)/);if(n)return{fileName:n[1],line:parseInt(n[2]),column:parseInt(n[3]),id:t}}var Te=class{constructor(e,n,i){this.owner=e,this.debugNameSource=n,this.referenceFn=i}getDebugName(e){return zd(e,this)}},kd=new Map,$o=new WeakMap;function zd(t,e){let n=$o.get(t);if(n)return n;let i=Gp(t,e);if(i){let r=kd.get(i)??0;r++,kd.set(i,r);let s=r===1?i:`${i}#${r}`;return $o.set(t,s),s}}function Gp(t,e){let n=$o.get(t);if(n)return n;let i=e.owner?Qp(e.owner)+".":"",r,s=e.debugNameSource;if(s!==void 0)if(typeof s=="function"){if(r=s(),r!==void 0)return i+r}else return i+s;let o=e.referenceFn;if(o!==void 0&&(r=bi(o),r!==void 0))return i+r;if(e.owner!==void 0){let a=Jp(e.owner,t);if(a!==void 0)return i+a}}function Jp(t,e){for(let n in t)if(t[n]===e)return n}var Ed=new Map,Sd=new WeakMap;function Qp(t){let e=Sd.get(t);if(e)return e;let n=Bo(t)??"Object",i=Ed.get(n)??0;i++,Ed.set(n,i);let r=i===1?n:`${n}#${i}`;return Sd.set(t,r),r}function Bo(t){let e=t.constructor;if(e)return e.name==="Object"?void 0:e.name}function bi(t){let e=t.toString(),i=/\/\*\*\s*@description\s*([^*]*)\*\//.exec(e);return(i?i[1]:void 0)?.trim()}var Do;function Cd(t){Do=t}var Td;function Od(t){Td=t}var Rd;function Ld(t){Rd=t}var Id;function Md(t){Id=t}var vi=class{get TChange(){return null}reportChanges(){this.get()}read(e){return e?e.readObservable(this):this.get()}map(e,n,i=ye.ofCaller()){let r=n===void 0?void 0:e,s=n===void 0?e:n;return Do({owner:r,debugName:()=>{let o=bi(s);if(o!==void 0)return o;let u=/^\s*\(?\s*([a-zA-Z_$][a-zA-Z_$0-9]*)\s*\)?\s*=>\s*\1(?:\??)\.([a-zA-Z_$][a-zA-Z_$0-9]*)\s*$/.exec(s.toString());if(u)return`${this.debugName}.${u[2]}`;if(!r)return`${this.debugName} (mapped)`},debugReferenceFn:s},o=>s(this.read(o),o),i)}flatten(){return Do({owner:void 0,debugName:()=>`${this.debugName} (flattened)`},e=>this.read(e).read(e))}recomputeInitiallyAndOnChange(e,n){return e.add(Td(this,n)),this}keepObserved(e){return e.add(Rd(this)),this}get debugValue(){return this.get()}debugGetDependencyGraph(){return Id(this)}},vt=class extends vi{constructor(e){super(),this._observers=new Set,se()?.handleObservableCreated(this,e)}addObserver(e){let n=this._observers.size;this._observers.add(e),n===0&&this.onFirstObserverAdded(),n!==this._observers.size&&se()?.handleOnListenerCountChanged(this,this._observers.size)}removeObserver(e){let n=this._observers.delete(e);n&&this._observers.size===0&&this.onLastObserverRemoved(),n&&se()?.handleOnListenerCountChanged(this,this._observers.size)}onFirstObserverAdded(){}onLastObserverRemoved(){}log(){let e=!!se();return yd(this),e||se()?.handleObservableCreated(this,ye.ofCaller()),this}debugGetObservers(){return this._observers}};function _i(t){return{dispose:t}}var at=class t extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,t.prototype)}};function Fn(t){throw t}function Nd(t){console.error("Unexpected error:",t)}var Ct=(t,e)=>t===e;var Ae=class{constructor(){this.disposables=[],this._isDisposed=!1}get isDisposed(){return this._isDisposed}dispose(){this.clear(),this._isDisposed=!0}add(e){return e&&this.disposables.push(e),e}remove(e){if(!e)return e;let n=this.disposables.indexOf(e);return n!==-1&&this.disposables.splice(n,1),e}clear(){for(let e of this.disposables)e.dispose();this.disposables=[]}leakItems(){this.disposables=[]}},be=class{constructor(){this._store=new Ae}dispose(){this._store.dispose()}_register(e){return this._store.add(e),e}_registerOrDispose(e){return e&&(this._store.isDisposed?e.dispose():this._store.add(e)),e}};function Yp(t){switch(t){case 0:return"initial";case 1:return"dependenciesMightHaveChanged";case 2:return"stale";case 3:return"upToDate";default:return"<unknown>"}}var ut=class extends vt{get debugName(){return this._debugNameData.getDebugName(this)??"(anonymous)"}constructor(e,n,i,r=void 0,s,o){super(o),this._debugNameData=e,this._computeFn=n,this._changeTracker=i,this._handleLastObserverRemoved=r,this._equalityComparator=s,this._state=0,this._value=void 0,this._updateCount=0,this._dependencies=new Set,this._dependenciesToBeRemoved=new Set,this._changeSummary=void 0,this._isUpdating=!1,this._isComputing=!1,this._didReportChange=!1,this._isInBeforeUpdate=!1,this._isReaderValid=!1,this._store=void 0,this._delayedStore=void 0,this._removedObserverToCallEndUpdateOn=null,this._changeSummary=this._changeTracker?.createChangeSummary(void 0)}onLastObserverRemoved(){this._state=0,this._value=void 0,se()?.handleDerivedCleared(this);for(let e of this._dependencies)e.removeObserver(this);this._dependencies.clear(),this._store!==void 0&&(this._store.dispose(),this._store=void 0),this._delayedStore!==void 0&&(this._delayedStore.dispose(),this._delayedStore=void 0),this._handleLastObserverRemoved?.()}get(){if(this._isComputing,this._observers.size===0){let n;try{this._isReaderValid=!0;let i;this._changeTracker&&(i=this._changeTracker.createChangeSummary(void 0),this._changeTracker.beforeUpdate?.(this,i)),n=this._computeFn(this,i)}finally{this._isReaderValid=!1}return this.onLastObserverRemoved(),n}else{do{if(this._state===1){for(let n of this._dependencies)if(n.reportChanges(),this._state===2)break}this._state===1&&(this._state=3),this._state!==3&&this._recompute()}while(this._state!==3);return this._value}}_recompute(){let e=!1;this._isComputing=!0,this._didReportChange=!1;let n=this._dependenciesToBeRemoved;this._dependenciesToBeRemoved=this._dependencies,this._dependencies=n;try{let i=this._changeSummary;this._isReaderValid=!0,this._changeTracker&&(this._isInBeforeUpdate=!0,this._changeTracker.beforeUpdate?.(this,i),this._isInBeforeUpdate=!1,this._changeSummary=this._changeTracker?.createChangeSummary(i));let r=this._state!==0,s=this._value;this._state=3;let o=this._delayedStore;o!==void 0&&(this._delayedStore=void 0);try{this._store!==void 0&&(this._store.dispose(),this._store=void 0),this._value=this._computeFn(this,i)}finally{this._isReaderValid=!1;for(let a of this._dependenciesToBeRemoved)a.removeObserver(this);this._dependenciesToBeRemoved.clear(),o!==void 0&&o.dispose()}e=this._didReportChange||r&&!this._equalityComparator(s,this._value),se()?.handleObservableUpdated(this,{oldValue:s,newValue:this._value,change:void 0,didChange:e,hadValue:r})}catch(i){Fn(i)}if(this._isComputing=!1,!this._didReportChange&&e)for(let i of this._observers)i.handleChange(this,void 0);else this._didReportChange=!1}toString(){return`LazyDerived<${this.debugName}>`}beginUpdate(e){if(this._isUpdating)throw new at("Cyclic deriveds are not supported yet!");this._updateCount++,this._isUpdating=!0;try{let n=this._updateCount===1;if(this._state===3&&(this._state=1,!n))for(let i of this._observers)i.handlePossibleChange(this);if(n)for(let i of this._observers)i.beginUpdate(this)}finally{this._isUpdating=!1}}endUpdate(e){if(this._updateCount--,this._updateCount===0){let n=[...this._observers];for(let i of n)i.endUpdate(this);if(this._removedObserverToCallEndUpdateOn){let i=[...this._removedObserverToCallEndUpdateOn];this._removedObserverToCallEndUpdateOn=null;for(let r of i)r.endUpdate(this)}}}handlePossibleChange(e){if(this._state===3&&this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e)){this._state=1;for(let n of this._observers)n.handlePossibleChange(this)}}handleChange(e,n){if(this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e)||this._isInBeforeUpdate){se()?.handleDerivedDependencyChanged(this,e,n);let i=!1;try{i=this._changeTracker?this._changeTracker.handleChange({changedObservable:e,change:n,didChange:s=>s===e},this._changeSummary):!0}catch(s){Fn(s)}let r=this._state===3;if(i&&(this._state===1||r)&&(this._state=2,r))for(let s of this._observers)s.handlePossibleChange(this)}}_ensureReaderValid(){if(!this._isReaderValid)throw new at("The reader object cannot be used outside its compute function!")}readObservable(e){this._ensureReaderValid(),e.addObserver(this);let n=e.get();return this._dependencies.add(e),this._dependenciesToBeRemoved.delete(e),n}reportChange(e){this._ensureReaderValid(),this._didReportChange=!0;for(let n of this._observers)n.handleChange(this,e)}get store(){return this._ensureReaderValid(),this._store===void 0&&(this._store=new Ae),this._store}get delayedStore(){return this._ensureReaderValid(),this._delayedStore===void 0&&(this._delayedStore=new Ae),this._delayedStore}addObserver(e){let n=!this._observers.has(e)&&this._updateCount>0;super.addObserver(e),n&&(this._removedObserverToCallEndUpdateOn&&this._removedObserverToCallEndUpdateOn.has(e)?this._removedObserverToCallEndUpdateOn.delete(e):e.beginUpdate(this))}removeObserver(e){this._observers.has(e)&&this._updateCount>0&&(this._removedObserverToCallEndUpdateOn||(this._removedObserverToCallEndUpdateOn=new Set),this._removedObserverToCallEndUpdateOn.add(e)),super.removeObserver(e)}debugGetState(){return{state:this._state,stateStr:Yp(this._state),updateCount:this._updateCount,isComputing:this._isComputing,dependencies:this._dependencies,value:this._value}}debugSetValue(e){this._value=e}debugRecompute(){this._isComputing?this._state=2:this._recompute()}setValue(e,n,i){this._value=e;let r=this._observers;n.updateObserver(this,this);for(let s of r)s.handleChange(this,i)}};function oe(t,e,n=ye.ofCaller()){return e!==void 0?new ut(new Te(t,void 0,e),e,void 0,void 0,Ct,n):new ut(new Te(void 0,void 0,t),t,void 0,void 0,Ct,n)}function pr(t,e,n=ye.ofCaller()){return new ut(new Te(t.owner,t.debugName,t.debugReferenceFn),e,void 0,t.onLastObserverRemoved,t.equalsFn??Ct,n)}Cd(pr);function e0(t){switch(t){case 1:return"dependenciesMightHaveChanged";case 2:return"stale";case 3:return"upToDate";default:return"<unknown>"}}var mn=class{get debugName(){return this._debugNameData.getDebugName(this)??"(anonymous)"}constructor(e,n,i,r){this._debugNameData=e,this._runFn=n,this._changeTracker=i,this._state=2,this._updateCount=0,this._disposed=!1,this._dependencies=new Set,this._dependenciesToBeRemoved=new Set,this._isRunning=!1,this._store=void 0,this._delayedStore=void 0,this._changeSummary=this._changeTracker?.createChangeSummary(void 0),se()?.handleAutorunCreated(this,r),this._run()}dispose(){if(!this._disposed){this._disposed=!0;for(let e of this._dependencies)e.removeObserver(this);this._dependencies.clear(),this._store!==void 0&&this._store.dispose(),this._delayedStore!==void 0&&this._delayedStore.dispose(),se()?.handleAutorunDisposed(this)}}_run(){let e=this._dependenciesToBeRemoved;this._dependenciesToBeRemoved=this._dependencies,this._dependencies=e,this._state=3;try{if(!this._disposed){se()?.handleAutorunStarted(this);let n=this._changeSummary,i=this._delayedStore;i!==void 0&&(this._delayedStore=void 0);try{this._isRunning=!0,this._changeTracker&&(this._changeTracker.beforeUpdate?.(this,n),this._changeSummary=this._changeTracker.createChangeSummary(n)),this._store!==void 0&&(this._store.dispose(),this._store=void 0),this._runFn(this,n)}catch(r){Fn(r)}finally{this._isRunning=!1,i!==void 0&&i.dispose()}}}finally{this._disposed||se()?.handleAutorunFinished(this);for(let n of this._dependenciesToBeRemoved)n.removeObserver(this);this._dependenciesToBeRemoved.clear()}}toString(){return`Autorun<${this.debugName}>`}beginUpdate(e){this._state===3&&(this._state=1),this._updateCount++}endUpdate(e){try{if(this._updateCount===1)do{if(this._state===1){this._state=3;for(let n of this._dependencies)if(n.reportChanges(),this._state===2)break}this._state!==3&&this._run()}while(this._state!==3)}finally{this._updateCount--}}handlePossibleChange(e){this._state===3&&this._isDependency(e)&&(this._state=1)}handleChange(e,n){if(this._isDependency(e)){se()?.handleAutorunDependencyChanged(this,e,n);try{(!this._changeTracker||this._changeTracker.handleChange({changedObservable:e,change:n,didChange:r=>r===e},this._changeSummary))&&(this._state=2)}catch(i){Fn(i)}}}_isDependency(e){return this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e)}_ensureNoRunning(){if(!this._isRunning)throw new at("The reader object cannot be used outside its compute function!")}readObservable(e){if(this._ensureNoRunning(),this._disposed)return e.get();e.addObserver(this);let n=e.get();return this._dependencies.add(e),this._dependenciesToBeRemoved.delete(e),n}get store(){if(this._ensureNoRunning(),this._disposed)throw new at("Cannot access store after dispose");return this._store===void 0&&(this._store=new Ae),this._store}get delayedStore(){if(this._ensureNoRunning(),this._disposed)throw new at("Cannot access store after dispose");return this._delayedStore===void 0&&(this._delayedStore=new Ae),this._delayedStore}debugGetState(){return{isRunning:this._isRunning,updateCount:this._updateCount,dependencies:this._dependencies,state:this._state,stateStr:e0(this._state)}}debugRerun(){this._isRunning?this._state=2:this._run()}};function xi(t,e=ye.ofCaller()){return new mn(new Te(void 0,void 0,t),t,void 0,e)}var te=xi;function Ad(t,e,n=ye.ofCaller()){return new mn(new Te(t.owner,t.debugName,t.debugReferenceFn??e),e,t.changeTracker,n)}function qo(t,e){let n=new Ae,i=Ad({owner:t.owner,debugName:t.debugName,debugReferenceFn:t.debugReferenceFn??e,changeTracker:t.changeTracker},(r,s)=>{n.clear(),e(r,s,n)});return _i(()=>{i.dispose(),n.dispose()})}function Vo(t){let e=new Error("BugIndicatingErrorRecovery: "+t);Nd(e),console.error("recovered from an error that indicates a bug",e)}function ke(t,e){let n=new pn(t,e);try{t(n)}finally{n.finish()}}function jo(t,e,n){t?e(t):ke(e,n)}var pn=class{constructor(e,n){this._fn=e,this._getDebugName=n,this._updatingObservers=[],se()?.handleBeginTransaction(this)}getDebugName(){return this._getDebugName?this._getDebugName():bi(this._fn)}updateObserver(e,n){if(!this._updatingObservers){Vo("Transaction already finished!"),ke(i=>{i.updateObserver(e,n)});return}this._updatingObservers.push({observer:e,observable:n}),e.beginUpdate(n)}finish(){let e=this._updatingObservers;if(!e){Vo("transaction.finish() has already been called!");return}for(let n=0;n<e.length;n++){let{observer:i,observable:r}=e[n];i.endUpdate(r)}this._updatingObservers=null,se()?.handleEndTransaction(this)}debugGetUpdatingObservers(){return this._updatingObservers}};function H(t,e,n=ye.ofCaller()){let i;return typeof t=="string"?i=new Te(void 0,t,void 0):i=new Te(t,void 0,void 0),new $n(i,e,Ct,n)}var $n=class extends vt{get debugName(){return this._debugNameData.getDebugName(this)??"ObservableValue"}constructor(e,n,i,r){super(r),this._debugNameData=e,this._equalityComparator=i,this._value=n,se()?.handleObservableUpdated(this,{hadValue:!1,newValue:n,change:void 0,didChange:!0,oldValue:void 0})}get(){return this._value}set(e,n,i){if(i===void 0&&this._equalityComparator(this._value,e))return;let r;n||(n=r=new pn(()=>{},()=>`Setting ${this.debugName}`));try{let s=this._value;this._setValue(e),se()?.handleObservableUpdated(this,{oldValue:s,newValue:e,change:i,didChange:!0,hadValue:!0});for(let o of this._observers)n.updateObserver(o,this),o.handleChange(this,i)}finally{r&&r.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}debugGetState(){return{value:this._value}}debugSetValue(e){this._value=e}};function gn(...t){let e,n,i,r;return t.length===2?[n,i]=t:[e,n,i,r]=t,new Tt(new Te(e,void 0,i),n,i,()=>Tt.globalTransaction,Ct,r??ye.ofCaller())}var Tt=class extends vt{constructor(e,n,i,r,s,o){super(o),this._debugNameData=e,this.event=n,this._getValue=i,this._getTransaction=r,this._equalityComparator=s,this._hasValue=!1,this.handleEvent=a=>{let u=this._getValue(a),c=this._value,d=!this._hasValue||!this._equalityComparator(c,u),h=!1;d&&(this._value=u,this._hasValue&&(h=!0,jo(this._getTransaction(),l=>{se()?.handleObservableUpdated(this,{oldValue:c,newValue:u,change:void 0,didChange:d,hadValue:this._hasValue});for(let f of this._observers)l.updateObserver(f,this),f.handleChange(this,void 0)},()=>{let l=this.getDebugName();return"Event fired"+(l?`: ${l}`:"")})),this._hasValue=!0),h||se()?.handleObservableUpdated(this,{oldValue:c,newValue:u,change:void 0,didChange:d,hadValue:this._hasValue})}}getDebugName(){return this._debugNameData.getDebugName(this)}get debugName(){let e=this.getDebugName();return"From Event"+(e?`: ${e}`:"")}onFirstObserverAdded(){this._subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this._subscription.dispose(),this._subscription=void 0,this._hasValue=!1,this._value=void 0}get(){return this._subscription?(this._hasValue||this.handleEvent(void 0),this._value):this._getValue(void 0)}debugSetValue(e){this._value=e}debugGetState(){return{value:this._value,hasValue:this._hasValue}}};(function(t){t.Observer=Tt;function e(n,i){let r=!1;Tt.globalTransaction===void 0&&(Tt.globalTransaction=n,r=!0);try{i()}finally{r&&(Tt.globalTransaction=void 0)}}t.batchEventsGlobally=e})(gn||(gn={}));function br(t){let e=new gr(!1,void 0);return t.addObserver(e),_i(()=>{t.removeObserver(e)})}Ld(br);function Ho(t,e){let n=new gr(!0,e);t.addObserver(n);try{n.beginUpdate(t)}finally{n.endUpdate(t)}return _i(()=>{t.removeObserver(n)})}Od(Ho);var gr=class{constructor(e,n){this._forceRecompute=e,this._handleValue=n,this._counter=0}beginUpdate(e){this._counter++}endUpdate(e){this._counter===1&&this._forceRecompute&&(this._handleValue?this._handleValue(e.get()):e.reportChanges()),this._counter--}handlePossibleChange(e){}handleChange(e,n){}};var vr;function Pd(t){vr||(vr=new Wo,xd(vr)),vr.addFilteredObj(t)}var Wo=class{constructor(){this.indentation=0,this.changedObservablesSets=new WeakMap}addFilteredObj(e){this._filteredObjects||(this._filteredObjects=new Set),this._filteredObjects.add(e)}_isIncluded(e){return this._filteredObjects?.has(e)??!0}textToConsoleArgs(e){return n0([Bn(o0("|  ",this.indentation)),e])}formatInfo(e){return e.hadValue?e.didChange?[Bn(" "),ct(bn(e.oldValue,70),{color:"red",strikeThrough:!0}),Bn(" "),ct(bn(e.newValue,60),{color:"green"})]:[Bn(" (unchanged)")]:[Bn(" "),ct(bn(e.newValue,60),{color:"green"}),Bn(" (initial)")]}handleObservableCreated(e){if(e instanceof ut){let n=e;this.changedObservablesSets.set(n,new Set)}}handleOnListenerCountChanged(e,n){}handleObservableUpdated(e,n){if(this._isIncluded(e)){if(e instanceof ut){this._handleDerivedRecomputed(e,n);return}console.log(...this.textToConsoleArgs([Dn("observable value changed"),ct(e.debugName,{color:"BlueViolet"}),...this.formatInfo(n)]))}}formatChanges(e){if(e.size!==0)return ct(" (changed deps: "+[...e].map(n=>n.debugName).join(", ")+")",{color:"gray"})}handleDerivedDependencyChanged(e,n,i){this._isIncluded(e)&&this.changedObservablesSets.get(e)?.add(n)}_handleDerivedRecomputed(e,n){if(!this._isIncluded(e))return;let i=this.changedObservablesSets.get(e);i&&(console.log(...this.textToConsoleArgs([Dn("derived recomputed"),ct(e.debugName,{color:"BlueViolet"}),...this.formatInfo(n),this.formatChanges(i),{data:[{fn:e._debugNameData.referenceFn??e._computeFn}]}])),i.clear())}handleDerivedCleared(e){this._isIncluded(e)&&console.log(...this.textToConsoleArgs([Dn("derived cleared"),ct(e.debugName,{color:"BlueViolet"})]))}handleFromEventObservableTriggered(e,n){this._isIncluded(e)&&console.log(...this.textToConsoleArgs([Dn("observable from event triggered"),ct(e.debugName,{color:"BlueViolet"}),...this.formatInfo(n),{data:[{fn:e._getValue}]}]))}handleAutorunCreated(e){this._isIncluded(e)&&this.changedObservablesSets.set(e,new Set)}handleAutorunDisposed(e){}handleAutorunDependencyChanged(e,n,i){this._isIncluded(e)&&this.changedObservablesSets.get(e).add(n)}handleAutorunStarted(e){let n=this.changedObservablesSets.get(e);n&&(this._isIncluded(e)&&console.log(...this.textToConsoleArgs([Dn("autorun"),ct(e.debugName,{color:"BlueViolet"}),this.formatChanges(n),{data:[{fn:e._debugNameData.referenceFn??e._runFn}]}])),n.clear(),this.indentation++)}handleAutorunFinished(e){this.indentation--}handleBeginTransaction(e){let n=e.getDebugName();n===void 0&&(n=""),this._isIncluded(e)&&console.log(...this.textToConsoleArgs([Dn("transaction"),ct(n,{color:"BlueViolet"}),{data:[{fn:e._fn}]}])),this.indentation++}handleEndTransaction(){this.indentation--}};function n0(t){let e=new Array,n=[],i="";function r(o){if("length"in o)for(let a of o)a&&r(a);else"text"in o?(i+=`%c${o.text}`,e.push(o.style),o.data&&n.push(...o.data)):"data"in o&&n.push(...o.data)}r(t);let s=[i,...e];return s.push(...n),s}function Bn(t){return ct(t,{color:"black"})}function Dn(t){return ct(a0(`${t}: `,10),{color:"black",bold:!0})}function ct(t,e={color:"black"}){function n(r){return Object.entries(r).reduce((s,[o,a])=>`${s}${o}:${a};`,"")}let i={color:e.color};return e.strikeThrough&&(i["text-decoration"]="line-through"),e.bold&&(i["font-weight"]="bold"),{text:t,style:n(i)}}function bn(t,e){try{return i0(t,e)}catch{return"[[???]]"}}function i0(t,e){switch(typeof t){case"number":return""+t;case"string":return t.length+2<=e?`"${t}"`:`"${t.substr(0,e-7)}"+...`;case"boolean":return t?"true":"false";case"undefined":return"undefined";case"object":return t===null?"null":Array.isArray(t)?r0(t,e):s0(t,e);case"symbol":return t.toString();case"function":return`[[Function${t.name?" "+t.name:""}]]`;default:return""+t}}function r0(t,e){let n="[ ",i=!0;for(let r of t){if(i||(n+=", "),n.length-5>e){n+="...";break}i=!1,n+=`${bn(r,e-n.length)}`}return n+=" ]",n}function s0(t,e){try{if(typeof t.toString=="function"&&t.toString!==Object.prototype.toString){let o=t.toString();return o.length<=e?o:o.substring(0,e-3)+"..."}}catch{return"[[Object]]"}let n=Bo(t),i=n?n+"(":"{ ",r=!0,s;try{s=Object.entries(t)}catch{return n?`${n}(...)`:"[[Object]]"}for(let[o,a]of s){if(r||(i+=", "),i.length-5>e){i+="...";break}r=!1,i+=`${o}: ${bn(a,e-i.length)}`}return i+=n?")":" }",i}function o0(t,e){let n="";for(let i=1;i<=e;i++)n+=t;return n}function a0(t,e){for(;t.length<e;)t+=" ";return t}function Fd(t,e){let n=e?.debugNamePostProcessor??(s=>s),i=Uo.from(t,n);return i?$d(i,0,new Set).trim():""}function $d(t,e,n){let i="		".repeat(e),r=[];if(n.has(t.sourceObj))return r.push(`${i}* ${t.type} ${t.name} (already listed)`),r.join(`
`);if(n.add(t.sourceObj),r.push(`${i}* ${t.type} ${t.name}:`),r.push(`${i}  value: ${bn(t.value,50)}`),r.push(`${i}  state: ${t.state}`),t.dependencies.length>0){r.push(`${i}  dependencies:`);for(let o of t.dependencies)r.push($d(o,e+1,n))}return r.join(`
`)}var Uo=class t{static from(e,n){if(e instanceof mn){let i=e.debugGetState();return new t(e,n(e.debugName),"autorun",void 0,i.stateStr,Array.from(i.dependencies).map(r=>t.from(r,n)||t.unknown(r)))}else if(e instanceof ut){let i=e.debugGetState();return new t(e,n(e.debugName),"derived",i.value,i.stateStr,Array.from(i.dependencies).map(r=>t.from(r,n)||t.unknown(r)))}else if(e instanceof $n){let i=e.debugGetState();return new t(e,n(e.debugName),"observableValue",i.value,"upToDate",[])}else if(e instanceof Tt){let i=e.debugGetState();return new t(e,n(e.debugName),"fromEvent",i.value,i.hasValue?"upToDate":"initial",[])}}static unknown(e){return new t(e,"(unknown)","unknown",void 0,"unknown",[])}constructor(e,n,i,r,s,o){this.sourceObj=e,this.name=n,this.type=i,this.value=r,this.state=s,this.dependencies=o}};Md(Fd);wd(Pd);function Zo(t){return new Ko(t)}var Ko=class extends vi{constructor(e){super(),this.value=e}get debugName(){return this.toString()}get(){return this.value}addObserver(e){}removeObserver(e){}log(){return this}toString(){return`Const: ${this.value}`}};function wi(t,e){let n,i=!0;return qo({changeTracker:{createChangeSummary:()=>({deltas:[],didChange:!1}),handleChange:(r,s)=>{if(r.didChange(t)){let o=r.change;o!==void 0&&s.deltas.push(o),s.didChange=!0}return!0}}},(r,s)=>{let o=t.read(r),a=n;s.didChange&&(n=o,e(o,a,s.deltas)),i&&(i=!1,n=o)})}var y0="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?",vn={wordSeparators:y0,wordSegmenterLocales:[]};function yi(t,e){return t!==void 0&&!/\s/u.test(t)&&!e.includes(t)}var Xo=class{_separators;_segmenter;_cachedLine;_cachedWords=[];constructor(e){this._separators=new Set(e.wordSeparators),this._segmenter=k0(e.wordSegmenterLocales)}classify(e){return e===void 0||e===" "||e==="	"?1:this._separators.has(e)?2:0}previousIntlWord(e,n){let i;for(let r of this._intlWords(e)){if(r.index>n)break;i=r}return i}nextIntlWord(e,n){return this._intlWords(e).find(i=>i.index>=n)}_intlWords(e){if(!this._segmenter)return[];if(this._cachedLine===e)return this._cachedWords;let n=[];for(let i of this._segmenter.segment(e))i.isWordLike&&n.push({index:i.index,segment:i.segment});return this._cachedLine=e,this._cachedWords=n,n}};function k0(t){if(t.length===0)return;let e=[];for(let n of t){if(typeof n!="string"||n.length===0){console.warn("Ignoring invalid editor.wordSegmenterLocales entry",n);continue}try{e.push(...Intl.Segmenter.supportedLocalesOf(n))}catch(i){console.warn(`Ignoring invalid editor.wordSegmenterLocales entry: ${n}`,i)}}if(e.length!==0)try{return new Intl.Segmenter(e,{granularity:"word"})}catch(n){console.warn(`Unable to initialize editor.wordSegmenterLocales: ${e.join(", ")}`,n);return}}var qd=new Map;function ki(t){let e=`${t.wordSeparators}/${t.wordSegmenterLocales.join(",")}`,n=qd.get(e);return n||(n=new Xo(t),qd.set(e,n)),n}function Vd(t,e,n=vn){if(e=Ei(e,0,t.length),e===0)return 0;let i=t.lastIndexOf(`
`,e-1)+1,r=t.indexOf(`
`,e);r===-1&&(r=t.length);let s=e-i;if(s===0){let c=i-1;i=c<=0?0:t.lastIndexOf(`
`,c-1)+1,r=c,s=Math.max(0,c-i)}let o=t.slice(i,r),a=ki(n),u=Go(o,a,s);return u?.type===1&&u.end-u.start===1&&u.nextClass===0&&(u=Go(o,a,u.start)),i+(u?.start??0)}function jd(t,e,n=vn){if(e=Ei(e,0,t.length),e===t.length)return t.length;let i=t.lastIndexOf(`
`,e-1)+1,r=t.indexOf(`
`,e);r===-1&&(r=t.length);let s=e-i;e===r&&r<t.length&&(i=r+1,r=t.indexOf(`
`,i),r===-1&&(r=t.length),s=0);let o=t.slice(i,r),a=ki(n),u=wr(o,a,s);return u?.type===1&&u.end-u.start===1&&u.nextClass===0&&(u=wr(o,a,u.end)),i+(u?.end??o.length)}function Hd(t,e,n=vn){if(e=Ei(e,0,t.length),e===0)return 0;let i=e===0?0:t.lastIndexOf(`
`,e-1)+1,r=e-i;if(r===0)return e-1;let s=r-1;for(;s>=0&&(t[i+s]===" "||t[i+s]==="	");)s--;if(s+1<r-1)return i+s+1;let o=t.indexOf(`
`,e);o===-1&&(o=t.length);let a=t.slice(i,o),u=Go(a,ki(n),r);return i+(u?.start??0)}function Wd(t,e,n=vn){if(e=Ei(e,0,t.length),e===t.length)return t.length;let i=t.lastIndexOf(`
`,e-1)+1,r=t.indexOf(`
`,e);r===-1&&(r=t.length);let s=e-i,o=t.slice(i,r),a=s;for(;a<o.length&&(o[a]===" "||o[a]==="	");)a++;if(s<a)return i+a;let u=ki(n),c=wr(o,u,s);if(c)return i+c.end;if(e<r||r===t.length)return r;let d=r+1,h=t.indexOf(`
`,d);h===-1&&(h=t.length);let l=t.slice(d,h),f=wr(l,u,0);return d+(f?.start??l.length)}function Jo(t,e,n=vn){if(e=Ei(e,0,t.length),e===t.length)return{start:e,end:e};let i=t[e];if(/\s/u.test(i)){let f=e,m=e+1;for(;f>0&&/\s/u.test(t[f-1]);)f--;for(;m<t.length&&/\s/u.test(t[m]);)m++;return{start:f,end:m}}let r=t.lastIndexOf(`
`,e-1)+1,s=t.indexOf(`
`,e);s===-1&&(s=t.length);let o=t.slice(r,s),a=e-r,u=ki(n),c=u.previousIntlWord(o,a);if(c&&a<c.index+c.segment.length)return{start:r+c.index,end:r+c.index+c.segment.length};let d=u.classify(i),h=a,l=a+1;for(;h>0&&u.classify(o[h-1])===d;)h--;for(;l<o.length&&u.classify(o[l])===d;)l++;return{start:r+h,end:r+l}}function Go(t,e,n){let i,r=e.previousIntlWord(t,n-1);for(let s=n-1;s>=0;s--){let o=e.classify(t[s]);if(r&&s===r.index)return{start:r.index,end:r.index+r.segment.length,type:0,nextClass:o};if(o===0){if(i===1){let a=s+1;return{start:a,end:_r(t,e,i,a),type:i,nextClass:o}}i=0}else if(o===2){if(i===0){let a=s+1;return{start:a,end:_r(t,e,i,a),type:i,nextClass:o}}i=1}else if(i!==void 0){let a=s+1;return{start:a,end:_r(t,e,i,a),type:i,nextClass:o}}}return i===void 0?void 0:{start:0,end:_r(t,e,i,0),type:i,nextClass:1}}function wr(t,e,n){let i,r=e.nextIntlWord(t,n);for(let s=n;s<t.length;s++){let o=e.classify(t[s]);if(r&&s===r.index)return{start:r.index,end:r.index+r.segment.length,type:0,nextClass:o};if(o===0){if(i===1){let a=s;return{start:xr(t,e,i,a-1),end:a,type:i,nextClass:o}}i=0}else if(o===2){if(i===0){let a=s;return{start:xr(t,e,i,a-1),end:a,type:i,nextClass:o}}i=1}else if(i!==void 0){let a=s;return{start:xr(t,e,i,a-1),end:a,type:i,nextClass:o}}}return i===void 0?void 0:{start:xr(t,e,i,t.length-1),end:t.length,type:i,nextClass:1}}function _r(t,e,n,i){let r=e.nextIntlWord(t,i);for(let s=i;s<t.length;s++){if(r&&s===r.index+r.segment.length)return s;let o=e.classify(t[s]);if(o===1||n===0&&o===2||n===1&&o===0)return s}return t.length}function xr(t,e,n,i){let r=e.previousIntlWord(t,i);for(let s=i;s>=0;s--){if(r&&s===r.index)return s;let o=e.classify(t[s]);if(o===1||n===0&&o===2||n===1&&o===0)return s+1}return 0}function Ei(t,e,n){return Math.min(Math.max(t,e),n)}var Qo=new Uint16Array('\u1D41<\xD5\u0131\u028A\u049D\u057B\u05D0\u0675\u06DE\u07A2\u07D6\u080F\u0A4A\u0A91\u0DA1\u0E6D\u0F09\u0F26\u10CA\u1228\u12E1\u1415\u149D\u14C3\u14DF\u1525\0\0\0\0\0\0\u156B\u16CD\u198D\u1C12\u1DDD\u1F7E\u2060\u21B0\u228D\u23C0\u23FB\u2442\u2824\u2912\u2D08\u2E48\u2FCE\u3016\u32BA\u3639\u37AC\u38FE\u3A28\u3A71\u3AE0\u3B2E\u0800EMabcfglmnoprstu\\bfms\x7F\x84\x8B\x90\x95\x98\xA6\xB3\xB9\xC8\xCFlig\u803B\xC6\u40C6P\u803B&\u4026cute\u803B\xC1\u40C1reve;\u4102\u0100iyx}rc\u803B\xC2\u40C2;\u4410r;\uC000\u{1D504}rave\u803B\xC0\u40C0pha;\u4391acr;\u4100d;\u6A53\u0100gp\x9D\xA1on;\u4104f;\uC000\u{1D538}plyFunction;\u6061ing\u803B\xC5\u40C5\u0100cs\xBE\xC3r;\uC000\u{1D49C}ign;\u6254ilde\u803B\xC3\u40C3ml\u803B\xC4\u40C4\u0400aceforsu\xE5\xFB\xFE\u0117\u011C\u0122\u0127\u012A\u0100cr\xEA\xF2kslash;\u6216\u0176\xF6\xF8;\u6AE7ed;\u6306y;\u4411\u0180crt\u0105\u010B\u0114ause;\u6235noullis;\u612Ca;\u4392r;\uC000\u{1D505}pf;\uC000\u{1D539}eve;\u42D8c\xF2\u0113mpeq;\u624E\u0700HOacdefhilorsu\u014D\u0151\u0156\u0180\u019E\u01A2\u01B5\u01B7\u01BA\u01DC\u0215\u0273\u0278\u027Ecy;\u4427PY\u803B\xA9\u40A9\u0180cpy\u015D\u0162\u017Aute;\u4106\u0100;i\u0167\u0168\u62D2talDifferentialD;\u6145leys;\u612D\u0200aeio\u0189\u018E\u0194\u0198ron;\u410Cdil\u803B\xC7\u40C7rc;\u4108nint;\u6230ot;\u410A\u0100dn\u01A7\u01ADilla;\u40B8terDot;\u40B7\xF2\u017Fi;\u43A7rcle\u0200DMPT\u01C7\u01CB\u01D1\u01D6ot;\u6299inus;\u6296lus;\u6295imes;\u6297o\u0100cs\u01E2\u01F8kwiseContourIntegral;\u6232eCurly\u0100DQ\u0203\u020FoubleQuote;\u601Duote;\u6019\u0200lnpu\u021E\u0228\u0247\u0255on\u0100;e\u0225\u0226\u6237;\u6A74\u0180git\u022F\u0236\u023Aruent;\u6261nt;\u622FourIntegral;\u622E\u0100fr\u024C\u024E;\u6102oduct;\u6210nterClockwiseContourIntegral;\u6233oss;\u6A2Fcr;\uC000\u{1D49E}p\u0100;C\u0284\u0285\u62D3ap;\u624D\u0580DJSZacefios\u02A0\u02AC\u02B0\u02B4\u02B8\u02CB\u02D7\u02E1\u02E6\u0333\u048D\u0100;o\u0179\u02A5trahd;\u6911cy;\u4402cy;\u4405cy;\u440F\u0180grs\u02BF\u02C4\u02C7ger;\u6021r;\u61A1hv;\u6AE4\u0100ay\u02D0\u02D5ron;\u410E;\u4414l\u0100;t\u02DD\u02DE\u6207a;\u4394r;\uC000\u{1D507}\u0100af\u02EB\u0327\u0100cm\u02F0\u0322ritical\u0200ADGT\u0300\u0306\u0316\u031Ccute;\u40B4o\u0174\u030B\u030D;\u42D9bleAcute;\u42DDrave;\u4060ilde;\u42DCond;\u62C4ferentialD;\u6146\u0470\u033D\0\0\0\u0342\u0354\0\u0405f;\uC000\u{1D53B}\u0180;DE\u0348\u0349\u034D\u40A8ot;\u60DCqual;\u6250ble\u0300CDLRUV\u0363\u0372\u0382\u03CF\u03E2\u03F8ontourIntegra\xEC\u0239o\u0274\u0379\0\0\u037B\xBB\u0349nArrow;\u61D3\u0100eo\u0387\u03A4ft\u0180ART\u0390\u0396\u03A1rrow;\u61D0ightArrow;\u61D4e\xE5\u02CAng\u0100LR\u03AB\u03C4eft\u0100AR\u03B3\u03B9rrow;\u67F8ightArrow;\u67FAightArrow;\u67F9ight\u0100AT\u03D8\u03DErrow;\u61D2ee;\u62A8p\u0241\u03E9\0\0\u03EFrrow;\u61D1ownArrow;\u61D5erticalBar;\u6225n\u0300ABLRTa\u0412\u042A\u0430\u045E\u047F\u037Crrow\u0180;BU\u041D\u041E\u0422\u6193ar;\u6913pArrow;\u61F5reve;\u4311eft\u02D2\u043A\0\u0446\0\u0450ightVector;\u6950eeVector;\u695Eector\u0100;B\u0459\u045A\u61BDar;\u6956ight\u01D4\u0467\0\u0471eeVector;\u695Fector\u0100;B\u047A\u047B\u61C1ar;\u6957ee\u0100;A\u0486\u0487\u62A4rrow;\u61A7\u0100ct\u0492\u0497r;\uC000\u{1D49F}rok;\u4110\u0800NTacdfglmopqstux\u04BD\u04C0\u04C4\u04CB\u04DE\u04E2\u04E7\u04EE\u04F5\u0521\u052F\u0536\u0552\u055D\u0560\u0565G;\u414AH\u803B\xD0\u40D0cute\u803B\xC9\u40C9\u0180aiy\u04D2\u04D7\u04DCron;\u411Arc\u803B\xCA\u40CA;\u442Dot;\u4116r;\uC000\u{1D508}rave\u803B\xC8\u40C8ement;\u6208\u0100ap\u04FA\u04FEcr;\u4112ty\u0253\u0506\0\0\u0512mallSquare;\u65FBerySmallSquare;\u65AB\u0100gp\u0526\u052Aon;\u4118f;\uC000\u{1D53C}silon;\u4395u\u0100ai\u053C\u0549l\u0100;T\u0542\u0543\u6A75ilde;\u6242librium;\u61CC\u0100ci\u0557\u055Ar;\u6130m;\u6A73a;\u4397ml\u803B\xCB\u40CB\u0100ip\u056A\u056Fsts;\u6203onentialE;\u6147\u0280cfios\u0585\u0588\u058D\u05B2\u05CCy;\u4424r;\uC000\u{1D509}lled\u0253\u0597\0\0\u05A3mallSquare;\u65FCerySmallSquare;\u65AA\u0370\u05BA\0\u05BF\0\0\u05C4f;\uC000\u{1D53D}All;\u6200riertrf;\u6131c\xF2\u05CB\u0600JTabcdfgorst\u05E8\u05EC\u05EF\u05FA\u0600\u0612\u0616\u061B\u061D\u0623\u066C\u0672cy;\u4403\u803B>\u403Emma\u0100;d\u05F7\u05F8\u4393;\u43DCreve;\u411E\u0180eiy\u0607\u060C\u0610dil;\u4122rc;\u411C;\u4413ot;\u4120r;\uC000\u{1D50A};\u62D9pf;\uC000\u{1D53E}eater\u0300EFGLST\u0635\u0644\u064E\u0656\u065B\u0666qual\u0100;L\u063E\u063F\u6265ess;\u62DBullEqual;\u6267reater;\u6AA2ess;\u6277lantEqual;\u6A7Eilde;\u6273cr;\uC000\u{1D4A2};\u626B\u0400Aacfiosu\u0685\u068B\u0696\u069B\u069E\u06AA\u06BE\u06CARDcy;\u442A\u0100ct\u0690\u0694ek;\u42C7;\u405Eirc;\u4124r;\u610ClbertSpace;\u610B\u01F0\u06AF\0\u06B2f;\u610DizontalLine;\u6500\u0100ct\u06C3\u06C5\xF2\u06A9rok;\u4126mp\u0144\u06D0\u06D8ownHum\xF0\u012Fqual;\u624F\u0700EJOacdfgmnostu\u06FA\u06FE\u0703\u0707\u070E\u071A\u071E\u0721\u0728\u0744\u0778\u078B\u078F\u0795cy;\u4415lig;\u4132cy;\u4401cute\u803B\xCD\u40CD\u0100iy\u0713\u0718rc\u803B\xCE\u40CE;\u4418ot;\u4130r;\u6111rave\u803B\xCC\u40CC\u0180;ap\u0720\u072F\u073F\u0100cg\u0734\u0737r;\u412AinaryI;\u6148lie\xF3\u03DD\u01F4\u0749\0\u0762\u0100;e\u074D\u074E\u622C\u0100gr\u0753\u0758ral;\u622Bsection;\u62C2isible\u0100CT\u076C\u0772omma;\u6063imes;\u6062\u0180gpt\u077F\u0783\u0788on;\u412Ef;\uC000\u{1D540}a;\u4399cr;\u6110ilde;\u4128\u01EB\u079A\0\u079Ecy;\u4406l\u803B\xCF\u40CF\u0280cfosu\u07AC\u07B7\u07BC\u07C2\u07D0\u0100iy\u07B1\u07B5rc;\u4134;\u4419r;\uC000\u{1D50D}pf;\uC000\u{1D541}\u01E3\u07C7\0\u07CCr;\uC000\u{1D4A5}rcy;\u4408kcy;\u4404\u0380HJacfos\u07E4\u07E8\u07EC\u07F1\u07FD\u0802\u0808cy;\u4425cy;\u440Cppa;\u439A\u0100ey\u07F6\u07FBdil;\u4136;\u441Ar;\uC000\u{1D50E}pf;\uC000\u{1D542}cr;\uC000\u{1D4A6}\u0580JTaceflmost\u0825\u0829\u082C\u0850\u0863\u09B3\u09B8\u09C7\u09CD\u0A37\u0A47cy;\u4409\u803B<\u403C\u0280cmnpr\u0837\u083C\u0841\u0844\u084Dute;\u4139bda;\u439Bg;\u67EAlacetrf;\u6112r;\u619E\u0180aey\u0857\u085C\u0861ron;\u413Ddil;\u413B;\u441B\u0100fs\u0868\u0970t\u0500ACDFRTUVar\u087E\u08A9\u08B1\u08E0\u08E6\u08FC\u092F\u095B\u0390\u096A\u0100nr\u0883\u088FgleBracket;\u67E8row\u0180;BR\u0899\u089A\u089E\u6190ar;\u61E4ightArrow;\u61C6eiling;\u6308o\u01F5\u08B7\0\u08C3bleBracket;\u67E6n\u01D4\u08C8\0\u08D2eeVector;\u6961ector\u0100;B\u08DB\u08DC\u61C3ar;\u6959loor;\u630Aight\u0100AV\u08EF\u08F5rrow;\u6194ector;\u694E\u0100er\u0901\u0917e\u0180;AV\u0909\u090A\u0910\u62A3rrow;\u61A4ector;\u695Aiangle\u0180;BE\u0924\u0925\u0929\u62B2ar;\u69CFqual;\u62B4p\u0180DTV\u0937\u0942\u094CownVector;\u6951eeVector;\u6960ector\u0100;B\u0956\u0957\u61BFar;\u6958ector\u0100;B\u0965\u0966\u61BCar;\u6952ight\xE1\u039Cs\u0300EFGLST\u097E\u098B\u0995\u099D\u09A2\u09ADqualGreater;\u62DAullEqual;\u6266reater;\u6276ess;\u6AA1lantEqual;\u6A7Dilde;\u6272r;\uC000\u{1D50F}\u0100;e\u09BD\u09BE\u62D8ftarrow;\u61DAidot;\u413F\u0180npw\u09D4\u0A16\u0A1Bg\u0200LRlr\u09DE\u09F7\u0A02\u0A10eft\u0100AR\u09E6\u09ECrrow;\u67F5ightArrow;\u67F7ightArrow;\u67F6eft\u0100ar\u03B3\u0A0Aight\xE1\u03BFight\xE1\u03CAf;\uC000\u{1D543}er\u0100LR\u0A22\u0A2CeftArrow;\u6199ightArrow;\u6198\u0180cht\u0A3E\u0A40\u0A42\xF2\u084C;\u61B0rok;\u4141;\u626A\u0400acefiosu\u0A5A\u0A5D\u0A60\u0A77\u0A7C\u0A85\u0A8B\u0A8Ep;\u6905y;\u441C\u0100dl\u0A65\u0A6FiumSpace;\u605Flintrf;\u6133r;\uC000\u{1D510}nusPlus;\u6213pf;\uC000\u{1D544}c\xF2\u0A76;\u439C\u0480Jacefostu\u0AA3\u0AA7\u0AAD\u0AC0\u0B14\u0B19\u0D91\u0D97\u0D9Ecy;\u440Acute;\u4143\u0180aey\u0AB4\u0AB9\u0ABEron;\u4147dil;\u4145;\u441D\u0180gsw\u0AC7\u0AF0\u0B0Eative\u0180MTV\u0AD3\u0ADF\u0AE8ediumSpace;\u600Bhi\u0100cn\u0AE6\u0AD8\xEB\u0AD9eryThi\xEE\u0AD9ted\u0100GL\u0AF8\u0B06reaterGreate\xF2\u0673essLes\xF3\u0A48Line;\u400Ar;\uC000\u{1D511}\u0200Bnpt\u0B22\u0B28\u0B37\u0B3Areak;\u6060BreakingSpace;\u40A0f;\u6115\u0680;CDEGHLNPRSTV\u0B55\u0B56\u0B6A\u0B7C\u0BA1\u0BEB\u0C04\u0C5E\u0C84\u0CA6\u0CD8\u0D61\u0D85\u6AEC\u0100ou\u0B5B\u0B64ngruent;\u6262pCap;\u626DoubleVerticalBar;\u6226\u0180lqx\u0B83\u0B8A\u0B9Bement;\u6209ual\u0100;T\u0B92\u0B93\u6260ilde;\uC000\u2242\u0338ists;\u6204reater\u0380;EFGLST\u0BB6\u0BB7\u0BBD\u0BC9\u0BD3\u0BD8\u0BE5\u626Fqual;\u6271ullEqual;\uC000\u2267\u0338reater;\uC000\u226B\u0338ess;\u6279lantEqual;\uC000\u2A7E\u0338ilde;\u6275ump\u0144\u0BF2\u0BFDownHump;\uC000\u224E\u0338qual;\uC000\u224F\u0338e\u0100fs\u0C0A\u0C27tTriangle\u0180;BE\u0C1A\u0C1B\u0C21\u62EAar;\uC000\u29CF\u0338qual;\u62ECs\u0300;EGLST\u0C35\u0C36\u0C3C\u0C44\u0C4B\u0C58\u626Equal;\u6270reater;\u6278ess;\uC000\u226A\u0338lantEqual;\uC000\u2A7D\u0338ilde;\u6274ested\u0100GL\u0C68\u0C79reaterGreater;\uC000\u2AA2\u0338essLess;\uC000\u2AA1\u0338recedes\u0180;ES\u0C92\u0C93\u0C9B\u6280qual;\uC000\u2AAF\u0338lantEqual;\u62E0\u0100ei\u0CAB\u0CB9verseElement;\u620CghtTriangle\u0180;BE\u0CCB\u0CCC\u0CD2\u62EBar;\uC000\u29D0\u0338qual;\u62ED\u0100qu\u0CDD\u0D0CuareSu\u0100bp\u0CE8\u0CF9set\u0100;E\u0CF0\u0CF3\uC000\u228F\u0338qual;\u62E2erset\u0100;E\u0D03\u0D06\uC000\u2290\u0338qual;\u62E3\u0180bcp\u0D13\u0D24\u0D4Eset\u0100;E\u0D1B\u0D1E\uC000\u2282\u20D2qual;\u6288ceeds\u0200;EST\u0D32\u0D33\u0D3B\u0D46\u6281qual;\uC000\u2AB0\u0338lantEqual;\u62E1ilde;\uC000\u227F\u0338erset\u0100;E\u0D58\u0D5B\uC000\u2283\u20D2qual;\u6289ilde\u0200;EFT\u0D6E\u0D6F\u0D75\u0D7F\u6241qual;\u6244ullEqual;\u6247ilde;\u6249erticalBar;\u6224cr;\uC000\u{1D4A9}ilde\u803B\xD1\u40D1;\u439D\u0700Eacdfgmoprstuv\u0DBD\u0DC2\u0DC9\u0DD5\u0DDB\u0DE0\u0DE7\u0DFC\u0E02\u0E20\u0E22\u0E32\u0E3F\u0E44lig;\u4152cute\u803B\xD3\u40D3\u0100iy\u0DCE\u0DD3rc\u803B\xD4\u40D4;\u441Eblac;\u4150r;\uC000\u{1D512}rave\u803B\xD2\u40D2\u0180aei\u0DEE\u0DF2\u0DF6cr;\u414Cga;\u43A9cron;\u439Fpf;\uC000\u{1D546}enCurly\u0100DQ\u0E0E\u0E1AoubleQuote;\u601Cuote;\u6018;\u6A54\u0100cl\u0E27\u0E2Cr;\uC000\u{1D4AA}ash\u803B\xD8\u40D8i\u016C\u0E37\u0E3Cde\u803B\xD5\u40D5es;\u6A37ml\u803B\xD6\u40D6er\u0100BP\u0E4B\u0E60\u0100ar\u0E50\u0E53r;\u603Eac\u0100ek\u0E5A\u0E5C;\u63DEet;\u63B4arenthesis;\u63DC\u0480acfhilors\u0E7F\u0E87\u0E8A\u0E8F\u0E92\u0E94\u0E9D\u0EB0\u0EFCrtialD;\u6202y;\u441Fr;\uC000\u{1D513}i;\u43A6;\u43A0usMinus;\u40B1\u0100ip\u0EA2\u0EADncareplan\xE5\u069Df;\u6119\u0200;eio\u0EB9\u0EBA\u0EE0\u0EE4\u6ABBcedes\u0200;EST\u0EC8\u0EC9\u0ECF\u0EDA\u627Aqual;\u6AAFlantEqual;\u627Cilde;\u627Eme;\u6033\u0100dp\u0EE9\u0EEEuct;\u620Fortion\u0100;a\u0225\u0EF9l;\u621D\u0100ci\u0F01\u0F06r;\uC000\u{1D4AB};\u43A8\u0200Ufos\u0F11\u0F16\u0F1B\u0F1FOT\u803B"\u4022r;\uC000\u{1D514}pf;\u611Acr;\uC000\u{1D4AC}\u0600BEacefhiorsu\u0F3E\u0F43\u0F47\u0F60\u0F73\u0FA7\u0FAA\u0FAD\u1096\u10A9\u10B4\u10BEarr;\u6910G\u803B\xAE\u40AE\u0180cnr\u0F4E\u0F53\u0F56ute;\u4154g;\u67EBr\u0100;t\u0F5C\u0F5D\u61A0l;\u6916\u0180aey\u0F67\u0F6C\u0F71ron;\u4158dil;\u4156;\u4420\u0100;v\u0F78\u0F79\u611Cerse\u0100EU\u0F82\u0F99\u0100lq\u0F87\u0F8Eement;\u620Builibrium;\u61CBpEquilibrium;\u696Fr\xBB\u0F79o;\u43A1ght\u0400ACDFTUVa\u0FC1\u0FEB\u0FF3\u1022\u1028\u105B\u1087\u03D8\u0100nr\u0FC6\u0FD2gleBracket;\u67E9row\u0180;BL\u0FDC\u0FDD\u0FE1\u6192ar;\u61E5eftArrow;\u61C4eiling;\u6309o\u01F5\u0FF9\0\u1005bleBracket;\u67E7n\u01D4\u100A\0\u1014eeVector;\u695Dector\u0100;B\u101D\u101E\u61C2ar;\u6955loor;\u630B\u0100er\u102D\u1043e\u0180;AV\u1035\u1036\u103C\u62A2rrow;\u61A6ector;\u695Biangle\u0180;BE\u1050\u1051\u1055\u62B3ar;\u69D0qual;\u62B5p\u0180DTV\u1063\u106E\u1078ownVector;\u694FeeVector;\u695Cector\u0100;B\u1082\u1083\u61BEar;\u6954ector\u0100;B\u1091\u1092\u61C0ar;\u6953\u0100pu\u109B\u109Ef;\u611DndImplies;\u6970ightarrow;\u61DB\u0100ch\u10B9\u10BCr;\u611B;\u61B1leDelayed;\u69F4\u0680HOacfhimoqstu\u10E4\u10F1\u10F7\u10FD\u1119\u111E\u1151\u1156\u1161\u1167\u11B5\u11BB\u11BF\u0100Cc\u10E9\u10EEHcy;\u4429y;\u4428FTcy;\u442Ccute;\u415A\u0280;aeiy\u1108\u1109\u110E\u1113\u1117\u6ABCron;\u4160dil;\u415Erc;\u415C;\u4421r;\uC000\u{1D516}ort\u0200DLRU\u112A\u1134\u113E\u1149ownArrow\xBB\u041EeftArrow\xBB\u089AightArrow\xBB\u0FDDpArrow;\u6191gma;\u43A3allCircle;\u6218pf;\uC000\u{1D54A}\u0272\u116D\0\0\u1170t;\u621Aare\u0200;ISU\u117B\u117C\u1189\u11AF\u65A1ntersection;\u6293u\u0100bp\u118F\u119Eset\u0100;E\u1197\u1198\u628Fqual;\u6291erset\u0100;E\u11A8\u11A9\u6290qual;\u6292nion;\u6294cr;\uC000\u{1D4AE}ar;\u62C6\u0200bcmp\u11C8\u11DB\u1209\u120B\u0100;s\u11CD\u11CE\u62D0et\u0100;E\u11CD\u11D5qual;\u6286\u0100ch\u11E0\u1205eeds\u0200;EST\u11ED\u11EE\u11F4\u11FF\u627Bqual;\u6AB0lantEqual;\u627Dilde;\u627FTh\xE1\u0F8C;\u6211\u0180;es\u1212\u1213\u1223\u62D1rset\u0100;E\u121C\u121D\u6283qual;\u6287et\xBB\u1213\u0580HRSacfhiors\u123E\u1244\u1249\u1255\u125E\u1271\u1276\u129F\u12C2\u12C8\u12D1ORN\u803B\xDE\u40DEADE;\u6122\u0100Hc\u124E\u1252cy;\u440By;\u4426\u0100bu\u125A\u125C;\u4009;\u43A4\u0180aey\u1265\u126A\u126Fron;\u4164dil;\u4162;\u4422r;\uC000\u{1D517}\u0100ei\u127B\u1289\u01F2\u1280\0\u1287efore;\u6234a;\u4398\u0100cn\u128E\u1298kSpace;\uC000\u205F\u200ASpace;\u6009lde\u0200;EFT\u12AB\u12AC\u12B2\u12BC\u623Cqual;\u6243ullEqual;\u6245ilde;\u6248pf;\uC000\u{1D54B}ipleDot;\u60DB\u0100ct\u12D6\u12DBr;\uC000\u{1D4AF}rok;\u4166\u0AE1\u12F7\u130E\u131A\u1326\0\u132C\u1331\0\0\0\0\0\u1338\u133D\u1377\u1385\0\u13FF\u1404\u140A\u1410\u0100cr\u12FB\u1301ute\u803B\xDA\u40DAr\u0100;o\u1307\u1308\u619Fcir;\u6949r\u01E3\u1313\0\u1316y;\u440Eve;\u416C\u0100iy\u131E\u1323rc\u803B\xDB\u40DB;\u4423blac;\u4170r;\uC000\u{1D518}rave\u803B\xD9\u40D9acr;\u416A\u0100di\u1341\u1369er\u0100BP\u1348\u135D\u0100ar\u134D\u1350r;\u405Fac\u0100ek\u1357\u1359;\u63DFet;\u63B5arenthesis;\u63DDon\u0100;P\u1370\u1371\u62C3lus;\u628E\u0100gp\u137B\u137Fon;\u4172f;\uC000\u{1D54C}\u0400ADETadps\u1395\u13AE\u13B8\u13C4\u03E8\u13D2\u13D7\u13F3rrow\u0180;BD\u1150\u13A0\u13A4ar;\u6912ownArrow;\u61C5ownArrow;\u6195quilibrium;\u696Eee\u0100;A\u13CB\u13CC\u62A5rrow;\u61A5own\xE1\u03F3er\u0100LR\u13DE\u13E8eftArrow;\u6196ightArrow;\u6197i\u0100;l\u13F9\u13FA\u43D2on;\u43A5ing;\u416Ecr;\uC000\u{1D4B0}ilde;\u4168ml\u803B\xDC\u40DC\u0480Dbcdefosv\u1427\u142C\u1430\u1433\u143E\u1485\u148A\u1490\u1496ash;\u62ABar;\u6AEBy;\u4412ash\u0100;l\u143B\u143C\u62A9;\u6AE6\u0100er\u1443\u1445;\u62C1\u0180bty\u144C\u1450\u147Aar;\u6016\u0100;i\u144F\u1455cal\u0200BLST\u1461\u1465\u146A\u1474ar;\u6223ine;\u407Ceparator;\u6758ilde;\u6240ThinSpace;\u600Ar;\uC000\u{1D519}pf;\uC000\u{1D54D}cr;\uC000\u{1D4B1}dash;\u62AA\u0280cefos\u14A7\u14AC\u14B1\u14B6\u14BCirc;\u4174dge;\u62C0r;\uC000\u{1D51A}pf;\uC000\u{1D54E}cr;\uC000\u{1D4B2}\u0200fios\u14CB\u14D0\u14D2\u14D8r;\uC000\u{1D51B};\u439Epf;\uC000\u{1D54F}cr;\uC000\u{1D4B3}\u0480AIUacfosu\u14F1\u14F5\u14F9\u14FD\u1504\u150F\u1514\u151A\u1520cy;\u442Fcy;\u4407cy;\u442Ecute\u803B\xDD\u40DD\u0100iy\u1509\u150Drc;\u4176;\u442Br;\uC000\u{1D51C}pf;\uC000\u{1D550}cr;\uC000\u{1D4B4}ml;\u4178\u0400Hacdefos\u1535\u1539\u153F\u154B\u154F\u155D\u1560\u1564cy;\u4416cute;\u4179\u0100ay\u1544\u1549ron;\u417D;\u4417ot;\u417B\u01F2\u1554\0\u155BoWidt\xE8\u0AD9a;\u4396r;\u6128pf;\u6124cr;\uC000\u{1D4B5}\u0BE1\u1583\u158A\u1590\0\u15B0\u15B6\u15BF\0\0\0\0\u15C6\u15DB\u15EB\u165F\u166D\0\u1695\u169B\u16B2\u16B9\0\u16BEcute\u803B\xE1\u40E1reve;\u4103\u0300;Ediuy\u159C\u159D\u15A1\u15A3\u15A8\u15AD\u623E;\uC000\u223E\u0333;\u623Frc\u803B\xE2\u40E2te\u80BB\xB4\u0306;\u4430lig\u803B\xE6\u40E6\u0100;r\xB2\u15BA;\uC000\u{1D51E}rave\u803B\xE0\u40E0\u0100ep\u15CA\u15D6\u0100fp\u15CF\u15D4sym;\u6135\xE8\u15D3ha;\u43B1\u0100ap\u15DFc\u0100cl\u15E4\u15E7r;\u4101g;\u6A3F\u0264\u15F0\0\0\u160A\u0280;adsv\u15FA\u15FB\u15FF\u1601\u1607\u6227nd;\u6A55;\u6A5Clope;\u6A58;\u6A5A\u0380;elmrsz\u1618\u1619\u161B\u161E\u163F\u164F\u1659\u6220;\u69A4e\xBB\u1619sd\u0100;a\u1625\u1626\u6221\u0461\u1630\u1632\u1634\u1636\u1638\u163A\u163C\u163E;\u69A8;\u69A9;\u69AA;\u69AB;\u69AC;\u69AD;\u69AE;\u69AFt\u0100;v\u1645\u1646\u621Fb\u0100;d\u164C\u164D\u62BE;\u699D\u0100pt\u1654\u1657h;\u6222\xBB\xB9arr;\u637C\u0100gp\u1663\u1667on;\u4105f;\uC000\u{1D552}\u0380;Eaeiop\u12C1\u167B\u167D\u1682\u1684\u1687\u168A;\u6A70cir;\u6A6F;\u624Ad;\u624Bs;\u4027rox\u0100;e\u12C1\u1692\xF1\u1683ing\u803B\xE5\u40E5\u0180cty\u16A1\u16A6\u16A8r;\uC000\u{1D4B6};\u402Amp\u0100;e\u12C1\u16AF\xF1\u0288ilde\u803B\xE3\u40E3ml\u803B\xE4\u40E4\u0100ci\u16C2\u16C8onin\xF4\u0272nt;\u6A11\u0800Nabcdefiklnoprsu\u16ED\u16F1\u1730\u173C\u1743\u1748\u1778\u177D\u17E0\u17E6\u1839\u1850\u170D\u193D\u1948\u1970ot;\u6AED\u0100cr\u16F6\u171Ek\u0200ceps\u1700\u1705\u170D\u1713ong;\u624Cpsilon;\u43F6rime;\u6035im\u0100;e\u171A\u171B\u623Dq;\u62CD\u0176\u1722\u1726ee;\u62BDed\u0100;g\u172C\u172D\u6305e\xBB\u172Drk\u0100;t\u135C\u1737brk;\u63B6\u0100oy\u1701\u1741;\u4431quo;\u601E\u0280cmprt\u1753\u175B\u1761\u1764\u1768aus\u0100;e\u010A\u0109ptyv;\u69B0s\xE9\u170Cno\xF5\u0113\u0180ahw\u176F\u1771\u1773;\u43B2;\u6136een;\u626Cr;\uC000\u{1D51F}g\u0380costuvw\u178D\u179D\u17B3\u17C1\u17D5\u17DB\u17DE\u0180aiu\u1794\u1796\u179A\xF0\u0760rc;\u65EFp\xBB\u1371\u0180dpt\u17A4\u17A8\u17ADot;\u6A00lus;\u6A01imes;\u6A02\u0271\u17B9\0\0\u17BEcup;\u6A06ar;\u6605riangle\u0100du\u17CD\u17D2own;\u65BDp;\u65B3plus;\u6A04e\xE5\u1444\xE5\u14ADarow;\u690D\u0180ako\u17ED\u1826\u1835\u0100cn\u17F2\u1823k\u0180lst\u17FA\u05AB\u1802ozenge;\u69EBriangle\u0200;dlr\u1812\u1813\u1818\u181D\u65B4own;\u65BEeft;\u65C2ight;\u65B8k;\u6423\u01B1\u182B\0\u1833\u01B2\u182F\0\u1831;\u6592;\u65914;\u6593ck;\u6588\u0100eo\u183E\u184D\u0100;q\u1843\u1846\uC000=\u20E5uiv;\uC000\u2261\u20E5t;\u6310\u0200ptwx\u1859\u185E\u1867\u186Cf;\uC000\u{1D553}\u0100;t\u13CB\u1863om\xBB\u13CCtie;\u62C8\u0600DHUVbdhmptuv\u1885\u1896\u18AA\u18BB\u18D7\u18DB\u18EC\u18FF\u1905\u190A\u1910\u1921\u0200LRlr\u188E\u1890\u1892\u1894;\u6557;\u6554;\u6556;\u6553\u0280;DUdu\u18A1\u18A2\u18A4\u18A6\u18A8\u6550;\u6566;\u6569;\u6564;\u6567\u0200LRlr\u18B3\u18B5\u18B7\u18B9;\u655D;\u655A;\u655C;\u6559\u0380;HLRhlr\u18CA\u18CB\u18CD\u18CF\u18D1\u18D3\u18D5\u6551;\u656C;\u6563;\u6560;\u656B;\u6562;\u655Fox;\u69C9\u0200LRlr\u18E4\u18E6\u18E8\u18EA;\u6555;\u6552;\u6510;\u650C\u0280;DUdu\u06BD\u18F7\u18F9\u18FB\u18FD;\u6565;\u6568;\u652C;\u6534inus;\u629Flus;\u629Eimes;\u62A0\u0200LRlr\u1919\u191B\u191D\u191F;\u655B;\u6558;\u6518;\u6514\u0380;HLRhlr\u1930\u1931\u1933\u1935\u1937\u1939\u193B\u6502;\u656A;\u6561;\u655E;\u653C;\u6524;\u651C\u0100ev\u0123\u1942bar\u803B\xA6\u40A6\u0200ceio\u1951\u1956\u195A\u1960r;\uC000\u{1D4B7}mi;\u604Fm\u0100;e\u171A\u171Cl\u0180;bh\u1968\u1969\u196B\u405C;\u69C5sub;\u67C8\u016C\u1974\u197El\u0100;e\u1979\u197A\u6022t\xBB\u197Ap\u0180;Ee\u012F\u1985\u1987;\u6AAE\u0100;q\u06DC\u06DB\u0CE1\u19A7\0\u19E8\u1A11\u1A15\u1A32\0\u1A37\u1A50\0\0\u1AB4\0\0\u1AC1\0\0\u1B21\u1B2E\u1B4D\u1B52\0\u1BFD\0\u1C0C\u0180cpr\u19AD\u19B2\u19DDute;\u4107\u0300;abcds\u19BF\u19C0\u19C4\u19CA\u19D5\u19D9\u6229nd;\u6A44rcup;\u6A49\u0100au\u19CF\u19D2p;\u6A4Bp;\u6A47ot;\u6A40;\uC000\u2229\uFE00\u0100eo\u19E2\u19E5t;\u6041\xEE\u0693\u0200aeiu\u19F0\u19FB\u1A01\u1A05\u01F0\u19F5\0\u19F8s;\u6A4Don;\u410Ddil\u803B\xE7\u40E7rc;\u4109ps\u0100;s\u1A0C\u1A0D\u6A4Cm;\u6A50ot;\u410B\u0180dmn\u1A1B\u1A20\u1A26il\u80BB\xB8\u01ADptyv;\u69B2t\u8100\xA2;e\u1A2D\u1A2E\u40A2r\xE4\u01B2r;\uC000\u{1D520}\u0180cei\u1A3D\u1A40\u1A4Dy;\u4447ck\u0100;m\u1A47\u1A48\u6713ark\xBB\u1A48;\u43C7r\u0380;Ecefms\u1A5F\u1A60\u1A62\u1A6B\u1AA4\u1AAA\u1AAE\u65CB;\u69C3\u0180;el\u1A69\u1A6A\u1A6D\u42C6q;\u6257e\u0261\u1A74\0\0\u1A88rrow\u0100lr\u1A7C\u1A81eft;\u61BAight;\u61BB\u0280RSacd\u1A92\u1A94\u1A96\u1A9A\u1A9F\xBB\u0F47;\u64C8st;\u629Birc;\u629Aash;\u629Dnint;\u6A10id;\u6AEFcir;\u69C2ubs\u0100;u\u1ABB\u1ABC\u6663it\xBB\u1ABC\u02EC\u1AC7\u1AD4\u1AFA\0\u1B0Aon\u0100;e\u1ACD\u1ACE\u403A\u0100;q\xC7\xC6\u026D\u1AD9\0\0\u1AE2a\u0100;t\u1ADE\u1ADF\u402C;\u4040\u0180;fl\u1AE8\u1AE9\u1AEB\u6201\xEE\u1160e\u0100mx\u1AF1\u1AF6ent\xBB\u1AE9e\xF3\u024D\u01E7\u1AFE\0\u1B07\u0100;d\u12BB\u1B02ot;\u6A6Dn\xF4\u0246\u0180fry\u1B10\u1B14\u1B17;\uC000\u{1D554}o\xE4\u0254\u8100\xA9;s\u0155\u1B1Dr;\u6117\u0100ao\u1B25\u1B29rr;\u61B5ss;\u6717\u0100cu\u1B32\u1B37r;\uC000\u{1D4B8}\u0100bp\u1B3C\u1B44\u0100;e\u1B41\u1B42\u6ACF;\u6AD1\u0100;e\u1B49\u1B4A\u6AD0;\u6AD2dot;\u62EF\u0380delprvw\u1B60\u1B6C\u1B77\u1B82\u1BAC\u1BD4\u1BF9arr\u0100lr\u1B68\u1B6A;\u6938;\u6935\u0270\u1B72\0\0\u1B75r;\u62DEc;\u62DFarr\u0100;p\u1B7F\u1B80\u61B6;\u693D\u0300;bcdos\u1B8F\u1B90\u1B96\u1BA1\u1BA5\u1BA8\u622Arcap;\u6A48\u0100au\u1B9B\u1B9Ep;\u6A46p;\u6A4Aot;\u628Dr;\u6A45;\uC000\u222A\uFE00\u0200alrv\u1BB5\u1BBF\u1BDE\u1BE3rr\u0100;m\u1BBC\u1BBD\u61B7;\u693Cy\u0180evw\u1BC7\u1BD4\u1BD8q\u0270\u1BCE\0\0\u1BD2re\xE3\u1B73u\xE3\u1B75ee;\u62CEedge;\u62CFen\u803B\xA4\u40A4earrow\u0100lr\u1BEE\u1BF3eft\xBB\u1B80ight\xBB\u1BBDe\xE4\u1BDD\u0100ci\u1C01\u1C07onin\xF4\u01F7nt;\u6231lcty;\u632D\u0980AHabcdefhijlorstuwz\u1C38\u1C3B\u1C3F\u1C5D\u1C69\u1C75\u1C8A\u1C9E\u1CAC\u1CB7\u1CFB\u1CFF\u1D0D\u1D7B\u1D91\u1DAB\u1DBB\u1DC6\u1DCDr\xF2\u0381ar;\u6965\u0200glrs\u1C48\u1C4D\u1C52\u1C54ger;\u6020eth;\u6138\xF2\u1133h\u0100;v\u1C5A\u1C5B\u6010\xBB\u090A\u016B\u1C61\u1C67arow;\u690Fa\xE3\u0315\u0100ay\u1C6E\u1C73ron;\u410F;\u4434\u0180;ao\u0332\u1C7C\u1C84\u0100gr\u02BF\u1C81r;\u61CAtseq;\u6A77\u0180glm\u1C91\u1C94\u1C98\u803B\xB0\u40B0ta;\u43B4ptyv;\u69B1\u0100ir\u1CA3\u1CA8sht;\u697F;\uC000\u{1D521}ar\u0100lr\u1CB3\u1CB5\xBB\u08DC\xBB\u101E\u0280aegsv\u1CC2\u0378\u1CD6\u1CDC\u1CE0m\u0180;os\u0326\u1CCA\u1CD4nd\u0100;s\u0326\u1CD1uit;\u6666amma;\u43DDin;\u62F2\u0180;io\u1CE7\u1CE8\u1CF8\u40F7de\u8100\xF7;o\u1CE7\u1CF0ntimes;\u62C7n\xF8\u1CF7cy;\u4452c\u026F\u1D06\0\0\u1D0Arn;\u631Eop;\u630D\u0280lptuw\u1D18\u1D1D\u1D22\u1D49\u1D55lar;\u4024f;\uC000\u{1D555}\u0280;emps\u030B\u1D2D\u1D37\u1D3D\u1D42q\u0100;d\u0352\u1D33ot;\u6251inus;\u6238lus;\u6214quare;\u62A1blebarwedg\xE5\xFAn\u0180adh\u112E\u1D5D\u1D67ownarrow\xF3\u1C83arpoon\u0100lr\u1D72\u1D76ef\xF4\u1CB4igh\xF4\u1CB6\u0162\u1D7F\u1D85karo\xF7\u0F42\u026F\u1D8A\0\0\u1D8Ern;\u631Fop;\u630C\u0180cot\u1D98\u1DA3\u1DA6\u0100ry\u1D9D\u1DA1;\uC000\u{1D4B9};\u4455l;\u69F6rok;\u4111\u0100dr\u1DB0\u1DB4ot;\u62F1i\u0100;f\u1DBA\u1816\u65BF\u0100ah\u1DC0\u1DC3r\xF2\u0429a\xF2\u0FA6angle;\u69A6\u0100ci\u1DD2\u1DD5y;\u445Fgrarr;\u67FF\u0900Dacdefglmnopqrstux\u1E01\u1E09\u1E19\u1E38\u0578\u1E3C\u1E49\u1E61\u1E7E\u1EA5\u1EAF\u1EBD\u1EE1\u1F2A\u1F37\u1F44\u1F4E\u1F5A\u0100Do\u1E06\u1D34o\xF4\u1C89\u0100cs\u1E0E\u1E14ute\u803B\xE9\u40E9ter;\u6A6E\u0200aioy\u1E22\u1E27\u1E31\u1E36ron;\u411Br\u0100;c\u1E2D\u1E2E\u6256\u803B\xEA\u40EAlon;\u6255;\u444Dot;\u4117\u0100Dr\u1E41\u1E45ot;\u6252;\uC000\u{1D522}\u0180;rs\u1E50\u1E51\u1E57\u6A9Aave\u803B\xE8\u40E8\u0100;d\u1E5C\u1E5D\u6A96ot;\u6A98\u0200;ils\u1E6A\u1E6B\u1E72\u1E74\u6A99nters;\u63E7;\u6113\u0100;d\u1E79\u1E7A\u6A95ot;\u6A97\u0180aps\u1E85\u1E89\u1E97cr;\u4113ty\u0180;sv\u1E92\u1E93\u1E95\u6205et\xBB\u1E93p\u01001;\u1E9D\u1EA4\u0133\u1EA1\u1EA3;\u6004;\u6005\u6003\u0100gs\u1EAA\u1EAC;\u414Bp;\u6002\u0100gp\u1EB4\u1EB8on;\u4119f;\uC000\u{1D556}\u0180als\u1EC4\u1ECE\u1ED2r\u0100;s\u1ECA\u1ECB\u62D5l;\u69E3us;\u6A71i\u0180;lv\u1EDA\u1EDB\u1EDF\u43B5on\xBB\u1EDB;\u43F5\u0200csuv\u1EEA\u1EF3\u1F0B\u1F23\u0100io\u1EEF\u1E31rc\xBB\u1E2E\u0269\u1EF9\0\0\u1EFB\xED\u0548ant\u0100gl\u1F02\u1F06tr\xBB\u1E5Dess\xBB\u1E7A\u0180aei\u1F12\u1F16\u1F1Als;\u403Dst;\u625Fv\u0100;D\u0235\u1F20D;\u6A78parsl;\u69E5\u0100Da\u1F2F\u1F33ot;\u6253rr;\u6971\u0180cdi\u1F3E\u1F41\u1EF8r;\u612Fo\xF4\u0352\u0100ah\u1F49\u1F4B;\u43B7\u803B\xF0\u40F0\u0100mr\u1F53\u1F57l\u803B\xEB\u40EBo;\u60AC\u0180cip\u1F61\u1F64\u1F67l;\u4021s\xF4\u056E\u0100eo\u1F6C\u1F74ctatio\xEE\u0559nential\xE5\u0579\u09E1\u1F92\0\u1F9E\0\u1FA1\u1FA7\0\0\u1FC6\u1FCC\0\u1FD3\0\u1FE6\u1FEA\u2000\0\u2008\u205Allingdotse\xF1\u1E44y;\u4444male;\u6640\u0180ilr\u1FAD\u1FB3\u1FC1lig;\u8000\uFB03\u0269\u1FB9\0\0\u1FBDg;\u8000\uFB00ig;\u8000\uFB04;\uC000\u{1D523}lig;\u8000\uFB01lig;\uC000fj\u0180alt\u1FD9\u1FDC\u1FE1t;\u666Dig;\u8000\uFB02ns;\u65B1of;\u4192\u01F0\u1FEE\0\u1FF3f;\uC000\u{1D557}\u0100ak\u05BF\u1FF7\u0100;v\u1FFC\u1FFD\u62D4;\u6AD9artint;\u6A0D\u0100ao\u200C\u2055\u0100cs\u2011\u2052\u03B1\u201A\u2030\u2038\u2045\u2048\0\u2050\u03B2\u2022\u2025\u2027\u202A\u202C\0\u202E\u803B\xBD\u40BD;\u6153\u803B\xBC\u40BC;\u6155;\u6159;\u615B\u01B3\u2034\0\u2036;\u6154;\u6156\u02B4\u203E\u2041\0\0\u2043\u803B\xBE\u40BE;\u6157;\u615C5;\u6158\u01B6\u204C\0\u204E;\u615A;\u615D8;\u615El;\u6044wn;\u6322cr;\uC000\u{1D4BB}\u0880Eabcdefgijlnorstv\u2082\u2089\u209F\u20A5\u20B0\u20B4\u20F0\u20F5\u20FA\u20FF\u2103\u2112\u2138\u0317\u213E\u2152\u219E\u0100;l\u064D\u2087;\u6A8C\u0180cmp\u2090\u2095\u209Dute;\u41F5ma\u0100;d\u209C\u1CDA\u43B3;\u6A86reve;\u411F\u0100iy\u20AA\u20AErc;\u411D;\u4433ot;\u4121\u0200;lqs\u063E\u0642\u20BD\u20C9\u0180;qs\u063E\u064C\u20C4lan\xF4\u0665\u0200;cdl\u0665\u20D2\u20D5\u20E5c;\u6AA9ot\u0100;o\u20DC\u20DD\u6A80\u0100;l\u20E2\u20E3\u6A82;\u6A84\u0100;e\u20EA\u20ED\uC000\u22DB\uFE00s;\u6A94r;\uC000\u{1D524}\u0100;g\u0673\u061Bmel;\u6137cy;\u4453\u0200;Eaj\u065A\u210C\u210E\u2110;\u6A92;\u6AA5;\u6AA4\u0200Eaes\u211B\u211D\u2129\u2134;\u6269p\u0100;p\u2123\u2124\u6A8Arox\xBB\u2124\u0100;q\u212E\u212F\u6A88\u0100;q\u212E\u211Bim;\u62E7pf;\uC000\u{1D558}\u0100ci\u2143\u2146r;\u610Am\u0180;el\u066B\u214E\u2150;\u6A8E;\u6A90\u8300>;cdlqr\u05EE\u2160\u216A\u216E\u2173\u2179\u0100ci\u2165\u2167;\u6AA7r;\u6A7Aot;\u62D7Par;\u6995uest;\u6A7C\u0280adels\u2184\u216A\u2190\u0656\u219B\u01F0\u2189\0\u218Epro\xF8\u209Er;\u6978q\u0100lq\u063F\u2196les\xF3\u2088i\xED\u066B\u0100en\u21A3\u21ADrtneqq;\uC000\u2269\uFE00\xC5\u21AA\u0500Aabcefkosy\u21C4\u21C7\u21F1\u21F5\u21FA\u2218\u221D\u222F\u2268\u227Dr\xF2\u03A0\u0200ilmr\u21D0\u21D4\u21D7\u21DBrs\xF0\u1484f\xBB\u2024il\xF4\u06A9\u0100dr\u21E0\u21E4cy;\u444A\u0180;cw\u08F4\u21EB\u21EFir;\u6948;\u61ADar;\u610Firc;\u4125\u0180alr\u2201\u220E\u2213rts\u0100;u\u2209\u220A\u6665it\xBB\u220Alip;\u6026con;\u62B9r;\uC000\u{1D525}s\u0100ew\u2223\u2229arow;\u6925arow;\u6926\u0280amopr\u223A\u223E\u2243\u225E\u2263rr;\u61FFtht;\u623Bk\u0100lr\u2249\u2253eftarrow;\u61A9ightarrow;\u61AAf;\uC000\u{1D559}bar;\u6015\u0180clt\u226F\u2274\u2278r;\uC000\u{1D4BD}as\xE8\u21F4rok;\u4127\u0100bp\u2282\u2287ull;\u6043hen\xBB\u1C5B\u0AE1\u22A3\0\u22AA\0\u22B8\u22C5\u22CE\0\u22D5\u22F3\0\0\u22F8\u2322\u2367\u2362\u237F\0\u2386\u23AA\u23B4cute\u803B\xED\u40ED\u0180;iy\u0771\u22B0\u22B5rc\u803B\xEE\u40EE;\u4438\u0100cx\u22BC\u22BFy;\u4435cl\u803B\xA1\u40A1\u0100fr\u039F\u22C9;\uC000\u{1D526}rave\u803B\xEC\u40EC\u0200;ino\u073E\u22DD\u22E9\u22EE\u0100in\u22E2\u22E6nt;\u6A0Ct;\u622Dfin;\u69DCta;\u6129lig;\u4133\u0180aop\u22FE\u231A\u231D\u0180cgt\u2305\u2308\u2317r;\u412B\u0180elp\u071F\u230F\u2313in\xE5\u078Ear\xF4\u0720h;\u4131f;\u62B7ed;\u41B5\u0280;cfot\u04F4\u232C\u2331\u233D\u2341are;\u6105in\u0100;t\u2338\u2339\u621Eie;\u69DDdo\xF4\u2319\u0280;celp\u0757\u234C\u2350\u235B\u2361al;\u62BA\u0100gr\u2355\u2359er\xF3\u1563\xE3\u234Darhk;\u6A17rod;\u6A3C\u0200cgpt\u236F\u2372\u2376\u237By;\u4451on;\u412Ff;\uC000\u{1D55A}a;\u43B9uest\u803B\xBF\u40BF\u0100ci\u238A\u238Fr;\uC000\u{1D4BE}n\u0280;Edsv\u04F4\u239B\u239D\u23A1\u04F3;\u62F9ot;\u62F5\u0100;v\u23A6\u23A7\u62F4;\u62F3\u0100;i\u0777\u23AElde;\u4129\u01EB\u23B8\0\u23BCcy;\u4456l\u803B\xEF\u40EF\u0300cfmosu\u23CC\u23D7\u23DC\u23E1\u23E7\u23F5\u0100iy\u23D1\u23D5rc;\u4135;\u4439r;\uC000\u{1D527}ath;\u4237pf;\uC000\u{1D55B}\u01E3\u23EC\0\u23F1r;\uC000\u{1D4BF}rcy;\u4458kcy;\u4454\u0400acfghjos\u240B\u2416\u2422\u2427\u242D\u2431\u2435\u243Bppa\u0100;v\u2413\u2414\u43BA;\u43F0\u0100ey\u241B\u2420dil;\u4137;\u443Ar;\uC000\u{1D528}reen;\u4138cy;\u4445cy;\u445Cpf;\uC000\u{1D55C}cr;\uC000\u{1D4C0}\u0B80ABEHabcdefghjlmnoprstuv\u2470\u2481\u2486\u248D\u2491\u250E\u253D\u255A\u2580\u264E\u265E\u2665\u2679\u267D\u269A\u26B2\u26D8\u275D\u2768\u278B\u27C0\u2801\u2812\u0180art\u2477\u247A\u247Cr\xF2\u09C6\xF2\u0395ail;\u691Barr;\u690E\u0100;g\u0994\u248B;\u6A8Bar;\u6962\u0963\u24A5\0\u24AA\0\u24B1\0\0\0\0\0\u24B5\u24BA\0\u24C6\u24C8\u24CD\0\u24F9ute;\u413Amptyv;\u69B4ra\xEE\u084Cbda;\u43BBg\u0180;dl\u088E\u24C1\u24C3;\u6991\xE5\u088E;\u6A85uo\u803B\xAB\u40ABr\u0400;bfhlpst\u0899\u24DE\u24E6\u24E9\u24EB\u24EE\u24F1\u24F5\u0100;f\u089D\u24E3s;\u691Fs;\u691D\xEB\u2252p;\u61ABl;\u6939im;\u6973l;\u61A2\u0180;ae\u24FF\u2500\u2504\u6AABil;\u6919\u0100;s\u2509\u250A\u6AAD;\uC000\u2AAD\uFE00\u0180abr\u2515\u2519\u251Drr;\u690Crk;\u6772\u0100ak\u2522\u252Cc\u0100ek\u2528\u252A;\u407B;\u405B\u0100es\u2531\u2533;\u698Bl\u0100du\u2539\u253B;\u698F;\u698D\u0200aeuy\u2546\u254B\u2556\u2558ron;\u413E\u0100di\u2550\u2554il;\u413C\xEC\u08B0\xE2\u2529;\u443B\u0200cqrs\u2563\u2566\u256D\u257Da;\u6936uo\u0100;r\u0E19\u1746\u0100du\u2572\u2577har;\u6967shar;\u694Bh;\u61B2\u0280;fgqs\u258B\u258C\u0989\u25F3\u25FF\u6264t\u0280ahlrt\u2598\u25A4\u25B7\u25C2\u25E8rrow\u0100;t\u0899\u25A1a\xE9\u24F6arpoon\u0100du\u25AF\u25B4own\xBB\u045Ap\xBB\u0966eftarrows;\u61C7ight\u0180ahs\u25CD\u25D6\u25DErrow\u0100;s\u08F4\u08A7arpoon\xF3\u0F98quigarro\xF7\u21F0hreetimes;\u62CB\u0180;qs\u258B\u0993\u25FAlan\xF4\u09AC\u0280;cdgs\u09AC\u260A\u260D\u261D\u2628c;\u6AA8ot\u0100;o\u2614\u2615\u6A7F\u0100;r\u261A\u261B\u6A81;\u6A83\u0100;e\u2622\u2625\uC000\u22DA\uFE00s;\u6A93\u0280adegs\u2633\u2639\u263D\u2649\u264Bppro\xF8\u24C6ot;\u62D6q\u0100gq\u2643\u2645\xF4\u0989gt\xF2\u248C\xF4\u099Bi\xED\u09B2\u0180ilr\u2655\u08E1\u265Asht;\u697C;\uC000\u{1D529}\u0100;E\u099C\u2663;\u6A91\u0161\u2669\u2676r\u0100du\u25B2\u266E\u0100;l\u0965\u2673;\u696Alk;\u6584cy;\u4459\u0280;acht\u0A48\u2688\u268B\u2691\u2696r\xF2\u25C1orne\xF2\u1D08ard;\u696Bri;\u65FA\u0100io\u269F\u26A4dot;\u4140ust\u0100;a\u26AC\u26AD\u63B0che\xBB\u26AD\u0200Eaes\u26BB\u26BD\u26C9\u26D4;\u6268p\u0100;p\u26C3\u26C4\u6A89rox\xBB\u26C4\u0100;q\u26CE\u26CF\u6A87\u0100;q\u26CE\u26BBim;\u62E6\u0400abnoptwz\u26E9\u26F4\u26F7\u271A\u272F\u2741\u2747\u2750\u0100nr\u26EE\u26F1g;\u67ECr;\u61FDr\xEB\u08C1g\u0180lmr\u26FF\u270D\u2714eft\u0100ar\u09E6\u2707ight\xE1\u09F2apsto;\u67FCight\xE1\u09FDparrow\u0100lr\u2725\u2729ef\xF4\u24EDight;\u61AC\u0180afl\u2736\u2739\u273Dr;\u6985;\uC000\u{1D55D}us;\u6A2Dimes;\u6A34\u0161\u274B\u274Fst;\u6217\xE1\u134E\u0180;ef\u2757\u2758\u1800\u65CAnge\xBB\u2758ar\u0100;l\u2764\u2765\u4028t;\u6993\u0280achmt\u2773\u2776\u277C\u2785\u2787r\xF2\u08A8orne\xF2\u1D8Car\u0100;d\u0F98\u2783;\u696D;\u600Eri;\u62BF\u0300achiqt\u2798\u279D\u0A40\u27A2\u27AE\u27BBquo;\u6039r;\uC000\u{1D4C1}m\u0180;eg\u09B2\u27AA\u27AC;\u6A8D;\u6A8F\u0100bu\u252A\u27B3o\u0100;r\u0E1F\u27B9;\u601Arok;\u4142\u8400<;cdhilqr\u082B\u27D2\u2639\u27DC\u27E0\u27E5\u27EA\u27F0\u0100ci\u27D7\u27D9;\u6AA6r;\u6A79re\xE5\u25F2mes;\u62C9arr;\u6976uest;\u6A7B\u0100Pi\u27F5\u27F9ar;\u6996\u0180;ef\u2800\u092D\u181B\u65C3r\u0100du\u2807\u280Dshar;\u694Ahar;\u6966\u0100en\u2817\u2821rtneqq;\uC000\u2268\uFE00\xC5\u281E\u0700Dacdefhilnopsu\u2840\u2845\u2882\u288E\u2893\u28A0\u28A5\u28A8\u28DA\u28E2\u28E4\u0A83\u28F3\u2902Dot;\u623A\u0200clpr\u284E\u2852\u2863\u287Dr\u803B\xAF\u40AF\u0100et\u2857\u2859;\u6642\u0100;e\u285E\u285F\u6720se\xBB\u285F\u0100;s\u103B\u2868to\u0200;dlu\u103B\u2873\u2877\u287Bow\xEE\u048Cef\xF4\u090F\xF0\u13D1ker;\u65AE\u0100oy\u2887\u288Cmma;\u6A29;\u443Cash;\u6014asuredangle\xBB\u1626r;\uC000\u{1D52A}o;\u6127\u0180cdn\u28AF\u28B4\u28C9ro\u803B\xB5\u40B5\u0200;acd\u1464\u28BD\u28C0\u28C4s\xF4\u16A7ir;\u6AF0ot\u80BB\xB7\u01B5us\u0180;bd\u28D2\u1903\u28D3\u6212\u0100;u\u1D3C\u28D8;\u6A2A\u0163\u28DE\u28E1p;\u6ADB\xF2\u2212\xF0\u0A81\u0100dp\u28E9\u28EEels;\u62A7f;\uC000\u{1D55E}\u0100ct\u28F8\u28FDr;\uC000\u{1D4C2}pos\xBB\u159D\u0180;lm\u2909\u290A\u290D\u43BCtimap;\u62B8\u0C00GLRVabcdefghijlmoprstuvw\u2942\u2953\u297E\u2989\u2998\u29DA\u29E9\u2A15\u2A1A\u2A58\u2A5D\u2A83\u2A95\u2AA4\u2AA8\u2B04\u2B07\u2B44\u2B7F\u2BAE\u2C34\u2C67\u2C7C\u2CE9\u0100gt\u2947\u294B;\uC000\u22D9\u0338\u0100;v\u2950\u0BCF\uC000\u226B\u20D2\u0180elt\u295A\u2972\u2976ft\u0100ar\u2961\u2967rrow;\u61CDightarrow;\u61CE;\uC000\u22D8\u0338\u0100;v\u297B\u0C47\uC000\u226A\u20D2ightarrow;\u61CF\u0100Dd\u298E\u2993ash;\u62AFash;\u62AE\u0280bcnpt\u29A3\u29A7\u29AC\u29B1\u29CCla\xBB\u02DEute;\u4144g;\uC000\u2220\u20D2\u0280;Eiop\u0D84\u29BC\u29C0\u29C5\u29C8;\uC000\u2A70\u0338d;\uC000\u224B\u0338s;\u4149ro\xF8\u0D84ur\u0100;a\u29D3\u29D4\u666El\u0100;s\u29D3\u0B38\u01F3\u29DF\0\u29E3p\u80BB\xA0\u0B37mp\u0100;e\u0BF9\u0C00\u0280aeouy\u29F4\u29FE\u2A03\u2A10\u2A13\u01F0\u29F9\0\u29FB;\u6A43on;\u4148dil;\u4146ng\u0100;d\u0D7E\u2A0Aot;\uC000\u2A6D\u0338p;\u6A42;\u443Dash;\u6013\u0380;Aadqsx\u0B92\u2A29\u2A2D\u2A3B\u2A41\u2A45\u2A50rr;\u61D7r\u0100hr\u2A33\u2A36k;\u6924\u0100;o\u13F2\u13F0ot;\uC000\u2250\u0338ui\xF6\u0B63\u0100ei\u2A4A\u2A4Ear;\u6928\xED\u0B98ist\u0100;s\u0BA0\u0B9Fr;\uC000\u{1D52B}\u0200Eest\u0BC5\u2A66\u2A79\u2A7C\u0180;qs\u0BBC\u2A6D\u0BE1\u0180;qs\u0BBC\u0BC5\u2A74lan\xF4\u0BE2i\xED\u0BEA\u0100;r\u0BB6\u2A81\xBB\u0BB7\u0180Aap\u2A8A\u2A8D\u2A91r\xF2\u2971rr;\u61AEar;\u6AF2\u0180;sv\u0F8D\u2A9C\u0F8C\u0100;d\u2AA1\u2AA2\u62FC;\u62FAcy;\u445A\u0380AEadest\u2AB7\u2ABA\u2ABE\u2AC2\u2AC5\u2AF6\u2AF9r\xF2\u2966;\uC000\u2266\u0338rr;\u619Ar;\u6025\u0200;fqs\u0C3B\u2ACE\u2AE3\u2AEFt\u0100ar\u2AD4\u2AD9rro\xF7\u2AC1ightarro\xF7\u2A90\u0180;qs\u0C3B\u2ABA\u2AEAlan\xF4\u0C55\u0100;s\u0C55\u2AF4\xBB\u0C36i\xED\u0C5D\u0100;r\u0C35\u2AFEi\u0100;e\u0C1A\u0C25i\xE4\u0D90\u0100pt\u2B0C\u2B11f;\uC000\u{1D55F}\u8180\xAC;in\u2B19\u2B1A\u2B36\u40ACn\u0200;Edv\u0B89\u2B24\u2B28\u2B2E;\uC000\u22F9\u0338ot;\uC000\u22F5\u0338\u01E1\u0B89\u2B33\u2B35;\u62F7;\u62F6i\u0100;v\u0CB8\u2B3C\u01E1\u0CB8\u2B41\u2B43;\u62FE;\u62FD\u0180aor\u2B4B\u2B63\u2B69r\u0200;ast\u0B7B\u2B55\u2B5A\u2B5Flle\xEC\u0B7Bl;\uC000\u2AFD\u20E5;\uC000\u2202\u0338lint;\u6A14\u0180;ce\u0C92\u2B70\u2B73u\xE5\u0CA5\u0100;c\u0C98\u2B78\u0100;e\u0C92\u2B7D\xF1\u0C98\u0200Aait\u2B88\u2B8B\u2B9D\u2BA7r\xF2\u2988rr\u0180;cw\u2B94\u2B95\u2B99\u619B;\uC000\u2933\u0338;\uC000\u219D\u0338ghtarrow\xBB\u2B95ri\u0100;e\u0CCB\u0CD6\u0380chimpqu\u2BBD\u2BCD\u2BD9\u2B04\u0B78\u2BE4\u2BEF\u0200;cer\u0D32\u2BC6\u0D37\u2BC9u\xE5\u0D45;\uC000\u{1D4C3}ort\u026D\u2B05\0\0\u2BD6ar\xE1\u2B56m\u0100;e\u0D6E\u2BDF\u0100;q\u0D74\u0D73su\u0100bp\u2BEB\u2BED\xE5\u0CF8\xE5\u0D0B\u0180bcp\u2BF6\u2C11\u2C19\u0200;Ees\u2BFF\u2C00\u0D22\u2C04\u6284;\uC000\u2AC5\u0338et\u0100;e\u0D1B\u2C0Bq\u0100;q\u0D23\u2C00c\u0100;e\u0D32\u2C17\xF1\u0D38\u0200;Ees\u2C22\u2C23\u0D5F\u2C27\u6285;\uC000\u2AC6\u0338et\u0100;e\u0D58\u2C2Eq\u0100;q\u0D60\u2C23\u0200gilr\u2C3D\u2C3F\u2C45\u2C47\xEC\u0BD7lde\u803B\xF1\u40F1\xE7\u0C43iangle\u0100lr\u2C52\u2C5Ceft\u0100;e\u0C1A\u2C5A\xF1\u0C26ight\u0100;e\u0CCB\u2C65\xF1\u0CD7\u0100;m\u2C6C\u2C6D\u43BD\u0180;es\u2C74\u2C75\u2C79\u4023ro;\u6116p;\u6007\u0480DHadgilrs\u2C8F\u2C94\u2C99\u2C9E\u2CA3\u2CB0\u2CB6\u2CD3\u2CE3ash;\u62ADarr;\u6904p;\uC000\u224D\u20D2ash;\u62AC\u0100et\u2CA8\u2CAC;\uC000\u2265\u20D2;\uC000>\u20D2nfin;\u69DE\u0180Aet\u2CBD\u2CC1\u2CC5rr;\u6902;\uC000\u2264\u20D2\u0100;r\u2CCA\u2CCD\uC000<\u20D2ie;\uC000\u22B4\u20D2\u0100At\u2CD8\u2CDCrr;\u6903rie;\uC000\u22B5\u20D2im;\uC000\u223C\u20D2\u0180Aan\u2CF0\u2CF4\u2D02rr;\u61D6r\u0100hr\u2CFA\u2CFDk;\u6923\u0100;o\u13E7\u13E5ear;\u6927\u1253\u1A95\0\0\0\0\0\0\0\0\0\0\0\0\0\u2D2D\0\u2D38\u2D48\u2D60\u2D65\u2D72\u2D84\u1B07\0\0\u2D8D\u2DAB\0\u2DC8\u2DCE\0\u2DDC\u2E19\u2E2B\u2E3E\u2E43\u0100cs\u2D31\u1A97ute\u803B\xF3\u40F3\u0100iy\u2D3C\u2D45r\u0100;c\u1A9E\u2D42\u803B\xF4\u40F4;\u443E\u0280abios\u1AA0\u2D52\u2D57\u01C8\u2D5Alac;\u4151v;\u6A38old;\u69BClig;\u4153\u0100cr\u2D69\u2D6Dir;\u69BF;\uC000\u{1D52C}\u036F\u2D79\0\0\u2D7C\0\u2D82n;\u42DBave\u803B\xF2\u40F2;\u69C1\u0100bm\u2D88\u0DF4ar;\u69B5\u0200acit\u2D95\u2D98\u2DA5\u2DA8r\xF2\u1A80\u0100ir\u2D9D\u2DA0r;\u69BEoss;\u69BBn\xE5\u0E52;\u69C0\u0180aei\u2DB1\u2DB5\u2DB9cr;\u414Dga;\u43C9\u0180cdn\u2DC0\u2DC5\u01CDron;\u43BF;\u69B6pf;\uC000\u{1D560}\u0180ael\u2DD4\u2DD7\u01D2r;\u69B7rp;\u69B9\u0380;adiosv\u2DEA\u2DEB\u2DEE\u2E08\u2E0D\u2E10\u2E16\u6228r\xF2\u1A86\u0200;efm\u2DF7\u2DF8\u2E02\u2E05\u6A5Dr\u0100;o\u2DFE\u2DFF\u6134f\xBB\u2DFF\u803B\xAA\u40AA\u803B\xBA\u40BAgof;\u62B6r;\u6A56lope;\u6A57;\u6A5B\u0180clo\u2E1F\u2E21\u2E27\xF2\u2E01ash\u803B\xF8\u40F8l;\u6298i\u016C\u2E2F\u2E34de\u803B\xF5\u40F5es\u0100;a\u01DB\u2E3As;\u6A36ml\u803B\xF6\u40F6bar;\u633D\u0AE1\u2E5E\0\u2E7D\0\u2E80\u2E9D\0\u2EA2\u2EB9\0\0\u2ECB\u0E9C\0\u2F13\0\0\u2F2B\u2FBC\0\u2FC8r\u0200;ast\u0403\u2E67\u2E72\u0E85\u8100\xB6;l\u2E6D\u2E6E\u40B6le\xEC\u0403\u0269\u2E78\0\0\u2E7Bm;\u6AF3;\u6AFDy;\u443Fr\u0280cimpt\u2E8B\u2E8F\u2E93\u1865\u2E97nt;\u4025od;\u402Eil;\u6030enk;\u6031r;\uC000\u{1D52D}\u0180imo\u2EA8\u2EB0\u2EB4\u0100;v\u2EAD\u2EAE\u43C6;\u43D5ma\xF4\u0A76ne;\u660E\u0180;tv\u2EBF\u2EC0\u2EC8\u43C0chfork\xBB\u1FFD;\u43D6\u0100au\u2ECF\u2EDFn\u0100ck\u2ED5\u2EDDk\u0100;h\u21F4\u2EDB;\u610E\xF6\u21F4s\u0480;abcdemst\u2EF3\u2EF4\u1908\u2EF9\u2EFD\u2F04\u2F06\u2F0A\u2F0E\u402Bcir;\u6A23ir;\u6A22\u0100ou\u1D40\u2F02;\u6A25;\u6A72n\u80BB\xB1\u0E9Dim;\u6A26wo;\u6A27\u0180ipu\u2F19\u2F20\u2F25ntint;\u6A15f;\uC000\u{1D561}nd\u803B\xA3\u40A3\u0500;Eaceinosu\u0EC8\u2F3F\u2F41\u2F44\u2F47\u2F81\u2F89\u2F92\u2F7E\u2FB6;\u6AB3p;\u6AB7u\xE5\u0ED9\u0100;c\u0ECE\u2F4C\u0300;acens\u0EC8\u2F59\u2F5F\u2F66\u2F68\u2F7Eppro\xF8\u2F43urlye\xF1\u0ED9\xF1\u0ECE\u0180aes\u2F6F\u2F76\u2F7Approx;\u6AB9qq;\u6AB5im;\u62E8i\xED\u0EDFme\u0100;s\u2F88\u0EAE\u6032\u0180Eas\u2F78\u2F90\u2F7A\xF0\u2F75\u0180dfp\u0EEC\u2F99\u2FAF\u0180als\u2FA0\u2FA5\u2FAAlar;\u632Eine;\u6312urf;\u6313\u0100;t\u0EFB\u2FB4\xEF\u0EFBrel;\u62B0\u0100ci\u2FC0\u2FC5r;\uC000\u{1D4C5};\u43C8ncsp;\u6008\u0300fiopsu\u2FDA\u22E2\u2FDF\u2FE5\u2FEB\u2FF1r;\uC000\u{1D52E}pf;\uC000\u{1D562}rime;\u6057cr;\uC000\u{1D4C6}\u0180aeo\u2FF8\u3009\u3013t\u0100ei\u2FFE\u3005rnion\xF3\u06B0nt;\u6A16st\u0100;e\u3010\u3011\u403F\xF1\u1F19\xF4\u0F14\u0A80ABHabcdefhilmnoprstux\u3040\u3051\u3055\u3059\u30E0\u310E\u312B\u3147\u3162\u3172\u318E\u3206\u3215\u3224\u3229\u3258\u326E\u3272\u3290\u32B0\u32B7\u0180art\u3047\u304A\u304Cr\xF2\u10B3\xF2\u03DDail;\u691Car\xF2\u1C65ar;\u6964\u0380cdenqrt\u3068\u3075\u3078\u307F\u308F\u3094\u30CC\u0100eu\u306D\u3071;\uC000\u223D\u0331te;\u4155i\xE3\u116Emptyv;\u69B3g\u0200;del\u0FD1\u3089\u308B\u308D;\u6992;\u69A5\xE5\u0FD1uo\u803B\xBB\u40BBr\u0580;abcfhlpstw\u0FDC\u30AC\u30AF\u30B7\u30B9\u30BC\u30BE\u30C0\u30C3\u30C7\u30CAp;\u6975\u0100;f\u0FE0\u30B4s;\u6920;\u6933s;\u691E\xEB\u225D\xF0\u272El;\u6945im;\u6974l;\u61A3;\u619D\u0100ai\u30D1\u30D5il;\u691Ao\u0100;n\u30DB\u30DC\u6236al\xF3\u0F1E\u0180abr\u30E7\u30EA\u30EEr\xF2\u17E5rk;\u6773\u0100ak\u30F3\u30FDc\u0100ek\u30F9\u30FB;\u407D;\u405D\u0100es\u3102\u3104;\u698Cl\u0100du\u310A\u310C;\u698E;\u6990\u0200aeuy\u3117\u311C\u3127\u3129ron;\u4159\u0100di\u3121\u3125il;\u4157\xEC\u0FF2\xE2\u30FA;\u4440\u0200clqs\u3134\u3137\u313D\u3144a;\u6937dhar;\u6969uo\u0100;r\u020E\u020Dh;\u61B3\u0180acg\u314E\u315F\u0F44l\u0200;ips\u0F78\u3158\u315B\u109Cn\xE5\u10BBar\xF4\u0FA9t;\u65AD\u0180ilr\u3169\u1023\u316Esht;\u697D;\uC000\u{1D52F}\u0100ao\u3177\u3186r\u0100du\u317D\u317F\xBB\u047B\u0100;l\u1091\u3184;\u696C\u0100;v\u318B\u318C\u43C1;\u43F1\u0180gns\u3195\u31F9\u31FCht\u0300ahlrst\u31A4\u31B0\u31C2\u31D8\u31E4\u31EErrow\u0100;t\u0FDC\u31ADa\xE9\u30C8arpoon\u0100du\u31BB\u31BFow\xEE\u317Ep\xBB\u1092eft\u0100ah\u31CA\u31D0rrow\xF3\u0FEAarpoon\xF3\u0551ightarrows;\u61C9quigarro\xF7\u30CBhreetimes;\u62CCg;\u42DAingdotse\xF1\u1F32\u0180ahm\u320D\u3210\u3213r\xF2\u0FEAa\xF2\u0551;\u600Foust\u0100;a\u321E\u321F\u63B1che\xBB\u321Fmid;\u6AEE\u0200abpt\u3232\u323D\u3240\u3252\u0100nr\u3237\u323Ag;\u67EDr;\u61FEr\xEB\u1003\u0180afl\u3247\u324A\u324Er;\u6986;\uC000\u{1D563}us;\u6A2Eimes;\u6A35\u0100ap\u325D\u3267r\u0100;g\u3263\u3264\u4029t;\u6994olint;\u6A12ar\xF2\u31E3\u0200achq\u327B\u3280\u10BC\u3285quo;\u603Ar;\uC000\u{1D4C7}\u0100bu\u30FB\u328Ao\u0100;r\u0214\u0213\u0180hir\u3297\u329B\u32A0re\xE5\u31F8mes;\u62CAi\u0200;efl\u32AA\u1059\u1821\u32AB\u65B9tri;\u69CEluhar;\u6968;\u611E\u0D61\u32D5\u32DB\u32DF\u332C\u3338\u3371\0\u337A\u33A4\0\0\u33EC\u33F0\0\u3428\u3448\u345A\u34AD\u34B1\u34CA\u34F1\0\u3616\0\0\u3633cute;\u415Bqu\xEF\u27BA\u0500;Eaceinpsy\u11ED\u32F3\u32F5\u32FF\u3302\u330B\u330F\u331F\u3326\u3329;\u6AB4\u01F0\u32FA\0\u32FC;\u6AB8on;\u4161u\xE5\u11FE\u0100;d\u11F3\u3307il;\u415Frc;\u415D\u0180Eas\u3316\u3318\u331B;\u6AB6p;\u6ABAim;\u62E9olint;\u6A13i\xED\u1204;\u4441ot\u0180;be\u3334\u1D47\u3335\u62C5;\u6A66\u0380Aacmstx\u3346\u334A\u3357\u335B\u335E\u3363\u336Drr;\u61D8r\u0100hr\u3350\u3352\xEB\u2228\u0100;o\u0A36\u0A34t\u803B\xA7\u40A7i;\u403Bwar;\u6929m\u0100in\u3369\xF0nu\xF3\xF1t;\u6736r\u0100;o\u3376\u2055\uC000\u{1D530}\u0200acoy\u3382\u3386\u3391\u33A0rp;\u666F\u0100hy\u338B\u338Fcy;\u4449;\u4448rt\u026D\u3399\0\0\u339Ci\xE4\u1464ara\xEC\u2E6F\u803B\xAD\u40AD\u0100gm\u33A8\u33B4ma\u0180;fv\u33B1\u33B2\u33B2\u43C3;\u43C2\u0400;deglnpr\u12AB\u33C5\u33C9\u33CE\u33D6\u33DE\u33E1\u33E6ot;\u6A6A\u0100;q\u12B1\u12B0\u0100;E\u33D3\u33D4\u6A9E;\u6AA0\u0100;E\u33DB\u33DC\u6A9D;\u6A9Fe;\u6246lus;\u6A24arr;\u6972ar\xF2\u113D\u0200aeit\u33F8\u3408\u340F\u3417\u0100ls\u33FD\u3404lsetm\xE9\u336Ahp;\u6A33parsl;\u69E4\u0100dl\u1463\u3414e;\u6323\u0100;e\u341C\u341D\u6AAA\u0100;s\u3422\u3423\u6AAC;\uC000\u2AAC\uFE00\u0180flp\u342E\u3433\u3442tcy;\u444C\u0100;b\u3438\u3439\u402F\u0100;a\u343E\u343F\u69C4r;\u633Ff;\uC000\u{1D564}a\u0100dr\u344D\u0402es\u0100;u\u3454\u3455\u6660it\xBB\u3455\u0180csu\u3460\u3479\u349F\u0100au\u3465\u346Fp\u0100;s\u1188\u346B;\uC000\u2293\uFE00p\u0100;s\u11B4\u3475;\uC000\u2294\uFE00u\u0100bp\u347F\u348F\u0180;es\u1197\u119C\u3486et\u0100;e\u1197\u348D\xF1\u119D\u0180;es\u11A8\u11AD\u3496et\u0100;e\u11A8\u349D\xF1\u11AE\u0180;af\u117B\u34A6\u05B0r\u0165\u34AB\u05B1\xBB\u117Car\xF2\u1148\u0200cemt\u34B9\u34BE\u34C2\u34C5r;\uC000\u{1D4C8}tm\xEE\xF1i\xEC\u3415ar\xE6\u11BE\u0100ar\u34CE\u34D5r\u0100;f\u34D4\u17BF\u6606\u0100an\u34DA\u34EDight\u0100ep\u34E3\u34EApsilo\xEE\u1EE0h\xE9\u2EAFs\xBB\u2852\u0280bcmnp\u34FB\u355E\u1209\u358B\u358E\u0480;Edemnprs\u350E\u350F\u3511\u3515\u351E\u3523\u352C\u3531\u3536\u6282;\u6AC5ot;\u6ABD\u0100;d\u11DA\u351Aot;\u6AC3ult;\u6AC1\u0100Ee\u3528\u352A;\u6ACB;\u628Alus;\u6ABFarr;\u6979\u0180eiu\u353D\u3552\u3555t\u0180;en\u350E\u3545\u354Bq\u0100;q\u11DA\u350Feq\u0100;q\u352B\u3528m;\u6AC7\u0100bp\u355A\u355C;\u6AD5;\u6AD3c\u0300;acens\u11ED\u356C\u3572\u3579\u357B\u3326ppro\xF8\u32FAurlye\xF1\u11FE\xF1\u11F3\u0180aes\u3582\u3588\u331Bppro\xF8\u331Aq\xF1\u3317g;\u666A\u0680123;Edehlmnps\u35A9\u35AC\u35AF\u121C\u35B2\u35B4\u35C0\u35C9\u35D5\u35DA\u35DF\u35E8\u35ED\u803B\xB9\u40B9\u803B\xB2\u40B2\u803B\xB3\u40B3;\u6AC6\u0100os\u35B9\u35BCt;\u6ABEub;\u6AD8\u0100;d\u1222\u35C5ot;\u6AC4s\u0100ou\u35CF\u35D2l;\u67C9b;\u6AD7arr;\u697Bult;\u6AC2\u0100Ee\u35E4\u35E6;\u6ACC;\u628Blus;\u6AC0\u0180eiu\u35F4\u3609\u360Ct\u0180;en\u121C\u35FC\u3602q\u0100;q\u1222\u35B2eq\u0100;q\u35E7\u35E4m;\u6AC8\u0100bp\u3611\u3613;\u6AD4;\u6AD6\u0180Aan\u361C\u3620\u362Drr;\u61D9r\u0100hr\u3626\u3628\xEB\u222E\u0100;o\u0A2B\u0A29war;\u692Alig\u803B\xDF\u40DF\u0BE1\u3651\u365D\u3660\u12CE\u3673\u3679\0\u367E\u36C2\0\0\0\0\0\u36DB\u3703\0\u3709\u376C\0\0\0\u3787\u0272\u3656\0\0\u365Bget;\u6316;\u43C4r\xEB\u0E5F\u0180aey\u3666\u366B\u3670ron;\u4165dil;\u4163;\u4442lrec;\u6315r;\uC000\u{1D531}\u0200eiko\u3686\u369D\u36B5\u36BC\u01F2\u368B\0\u3691e\u01004f\u1284\u1281a\u0180;sv\u3698\u3699\u369B\u43B8ym;\u43D1\u0100cn\u36A2\u36B2k\u0100as\u36A8\u36AEppro\xF8\u12C1im\xBB\u12ACs\xF0\u129E\u0100as\u36BA\u36AE\xF0\u12C1rn\u803B\xFE\u40FE\u01EC\u031F\u36C6\u22E7es\u8180\xD7;bd\u36CF\u36D0\u36D8\u40D7\u0100;a\u190F\u36D5r;\u6A31;\u6A30\u0180eps\u36E1\u36E3\u3700\xE1\u2A4D\u0200;bcf\u0486\u36EC\u36F0\u36F4ot;\u6336ir;\u6AF1\u0100;o\u36F9\u36FC\uC000\u{1D565}rk;\u6ADA\xE1\u3362rime;\u6034\u0180aip\u370F\u3712\u3764d\xE5\u1248\u0380adempst\u3721\u374D\u3740\u3751\u3757\u375C\u375Fngle\u0280;dlqr\u3730\u3731\u3736\u3740\u3742\u65B5own\xBB\u1DBBeft\u0100;e\u2800\u373E\xF1\u092E;\u625Cight\u0100;e\u32AA\u374B\xF1\u105Aot;\u65ECinus;\u6A3Alus;\u6A39b;\u69CDime;\u6A3Bezium;\u63E2\u0180cht\u3772\u377D\u3781\u0100ry\u3777\u377B;\uC000\u{1D4C9};\u4446cy;\u445Brok;\u4167\u0100io\u378B\u378Ex\xF4\u1777head\u0100lr\u3797\u37A0eftarro\xF7\u084Fightarrow\xBB\u0F5D\u0900AHabcdfghlmoprstuw\u37D0\u37D3\u37D7\u37E4\u37F0\u37FC\u380E\u381C\u3823\u3834\u3851\u385D\u386B\u38A9\u38CC\u38D2\u38EA\u38F6r\xF2\u03EDar;\u6963\u0100cr\u37DC\u37E2ute\u803B\xFA\u40FA\xF2\u1150r\u01E3\u37EA\0\u37EDy;\u445Eve;\u416D\u0100iy\u37F5\u37FArc\u803B\xFB\u40FB;\u4443\u0180abh\u3803\u3806\u380Br\xF2\u13ADlac;\u4171a\xF2\u13C3\u0100ir\u3813\u3818sht;\u697E;\uC000\u{1D532}rave\u803B\xF9\u40F9\u0161\u3827\u3831r\u0100lr\u382C\u382E\xBB\u0957\xBB\u1083lk;\u6580\u0100ct\u3839\u384D\u026F\u383F\0\0\u384Arn\u0100;e\u3845\u3846\u631Cr\xBB\u3846op;\u630Fri;\u65F8\u0100al\u3856\u385Acr;\u416B\u80BB\xA8\u0349\u0100gp\u3862\u3866on;\u4173f;\uC000\u{1D566}\u0300adhlsu\u114B\u3878\u387D\u1372\u3891\u38A0own\xE1\u13B3arpoon\u0100lr\u3888\u388Cef\xF4\u382Digh\xF4\u382Fi\u0180;hl\u3899\u389A\u389C\u43C5\xBB\u13FAon\xBB\u389Aparrows;\u61C8\u0180cit\u38B0\u38C4\u38C8\u026F\u38B6\0\0\u38C1rn\u0100;e\u38BC\u38BD\u631Dr\xBB\u38BDop;\u630Eng;\u416Fri;\u65F9cr;\uC000\u{1D4CA}\u0180dir\u38D9\u38DD\u38E2ot;\u62F0lde;\u4169i\u0100;f\u3730\u38E8\xBB\u1813\u0100am\u38EF\u38F2r\xF2\u38A8l\u803B\xFC\u40FCangle;\u69A7\u0780ABDacdeflnoprsz\u391C\u391F\u3929\u392D\u39B5\u39B8\u39BD\u39DF\u39E4\u39E8\u39F3\u39F9\u39FD\u3A01\u3A20r\xF2\u03F7ar\u0100;v\u3926\u3927\u6AE8;\u6AE9as\xE8\u03E1\u0100nr\u3932\u3937grt;\u699C\u0380eknprst\u34E3\u3946\u394B\u3952\u395D\u3964\u3996app\xE1\u2415othin\xE7\u1E96\u0180hir\u34EB\u2EC8\u3959op\xF4\u2FB5\u0100;h\u13B7\u3962\xEF\u318D\u0100iu\u3969\u396Dgm\xE1\u33B3\u0100bp\u3972\u3984setneq\u0100;q\u397D\u3980\uC000\u228A\uFE00;\uC000\u2ACB\uFE00setneq\u0100;q\u398F\u3992\uC000\u228B\uFE00;\uC000\u2ACC\uFE00\u0100hr\u399B\u399Fet\xE1\u369Ciangle\u0100lr\u39AA\u39AFeft\xBB\u0925ight\xBB\u1051y;\u4432ash\xBB\u1036\u0180elr\u39C4\u39D2\u39D7\u0180;be\u2DEA\u39CB\u39CFar;\u62BBq;\u625Alip;\u62EE\u0100bt\u39DC\u1468a\xF2\u1469r;\uC000\u{1D533}tr\xE9\u39AEsu\u0100bp\u39EF\u39F1\xBB\u0D1C\xBB\u0D59pf;\uC000\u{1D567}ro\xF0\u0EFBtr\xE9\u39B4\u0100cu\u3A06\u3A0Br;\uC000\u{1D4CB}\u0100bp\u3A10\u3A18n\u0100Ee\u3980\u3A16\xBB\u397En\u0100Ee\u3992\u3A1E\xBB\u3990igzag;\u699A\u0380cefoprs\u3A36\u3A3B\u3A56\u3A5B\u3A54\u3A61\u3A6Airc;\u4175\u0100di\u3A40\u3A51\u0100bg\u3A45\u3A49ar;\u6A5Fe\u0100;q\u15FA\u3A4F;\u6259erp;\u6118r;\uC000\u{1D534}pf;\uC000\u{1D568}\u0100;e\u1479\u3A66at\xE8\u1479cr;\uC000\u{1D4CC}\u0AE3\u178E\u3A87\0\u3A8B\0\u3A90\u3A9B\0\0\u3A9D\u3AA8\u3AAB\u3AAF\0\0\u3AC3\u3ACE\0\u3AD8\u17DC\u17DFtr\xE9\u17D1r;\uC000\u{1D535}\u0100Aa\u3A94\u3A97r\xF2\u03C3r\xF2\u09F6;\u43BE\u0100Aa\u3AA1\u3AA4r\xF2\u03B8r\xF2\u09EBa\xF0\u2713is;\u62FB\u0180dpt\u17A4\u3AB5\u3ABE\u0100fl\u3ABA\u17A9;\uC000\u{1D569}im\xE5\u17B2\u0100Aa\u3AC7\u3ACAr\xF2\u03CEr\xF2\u0A01\u0100cq\u3AD2\u17B8r;\uC000\u{1D4CD}\u0100pt\u17D6\u3ADCr\xE9\u17D4\u0400acefiosu\u3AF0\u3AFD\u3B08\u3B0C\u3B11\u3B15\u3B1B\u3B21c\u0100uy\u3AF6\u3AFBte\u803B\xFD\u40FD;\u444F\u0100iy\u3B02\u3B06rc;\u4177;\u444Bn\u803B\xA5\u40A5r;\uC000\u{1D536}cy;\u4457pf;\uC000\u{1D56A}cr;\uC000\u{1D4CE}\u0100cm\u3B26\u3B29y;\u444El\u803B\xFF\u40FF\u0500acdefhiosw\u3B42\u3B48\u3B54\u3B58\u3B64\u3B69\u3B6D\u3B74\u3B7A\u3B80cute;\u417A\u0100ay\u3B4D\u3B52ron;\u417E;\u4437ot;\u417C\u0100et\u3B5D\u3B61tr\xE6\u155Fa;\u43B6r;\uC000\u{1D537}cy;\u4436grarr;\u61DDpf;\uC000\u{1D56B}cr;\uC000\u{1D4CF}\u0100jn\u3B85\u3B87;\u600Dj;\u600C'.split("").map(t=>t.charCodeAt(0)));var Yo,E0=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),ea=(Yo=String.fromCodePoint)!==null&&Yo!==void 0?Yo:function(t){let e="";return t>65535&&(t-=65536,e+=String.fromCharCode(t>>>10&1023|55296),t=56320|t&1023),e+=String.fromCharCode(t),e};function ta(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=E0.get(t))!==null&&e!==void 0?e:t}var Re;(function(t){t[t.NUM=35]="NUM",t[t.SEMI=59]="SEMI",t[t.EQUALS=61]="EQUALS",t[t.ZERO=48]="ZERO",t[t.NINE=57]="NINE",t[t.LOWER_A=97]="LOWER_A",t[t.LOWER_F=102]="LOWER_F",t[t.LOWER_X=120]="LOWER_X",t[t.LOWER_Z=122]="LOWER_Z",t[t.UPPER_A=65]="UPPER_A",t[t.UPPER_F=70]="UPPER_F",t[t.UPPER_Z=90]="UPPER_Z"})(Re||(Re={}));var z0=32,Xt;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(Xt||(Xt={}));function na(t){return t>=Re.ZERO&&t<=Re.NINE}function C0(t){return t>=Re.UPPER_A&&t<=Re.UPPER_F||t>=Re.LOWER_A&&t<=Re.LOWER_F}function T0(t){return t>=Re.UPPER_A&&t<=Re.UPPER_Z||t>=Re.LOWER_A&&t<=Re.LOWER_Z||na(t)}function O0(t){return t===Re.EQUALS||T0(t)}var Oe;(function(t){t[t.EntityStart=0]="EntityStart",t[t.NumericStart=1]="NumericStart",t[t.NumericDecimal=2]="NumericDecimal",t[t.NumericHex=3]="NumericHex",t[t.NamedEntity=4]="NamedEntity"})(Oe||(Oe={}));var Zt;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(Zt||(Zt={}));var ia=class{constructor(e,n,i){this.decodeTree=e,this.emitCodePoint=n,this.errors=i,this.state=Oe.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Zt.Strict}startEntity(e){this.decodeMode=e,this.state=Oe.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,n){switch(this.state){case Oe.EntityStart:return e.charCodeAt(n)===Re.NUM?(this.state=Oe.NumericStart,this.consumed+=1,this.stateNumericStart(e,n+1)):(this.state=Oe.NamedEntity,this.stateNamedEntity(e,n));case Oe.NumericStart:return this.stateNumericStart(e,n);case Oe.NumericDecimal:return this.stateNumericDecimal(e,n);case Oe.NumericHex:return this.stateNumericHex(e,n);case Oe.NamedEntity:return this.stateNamedEntity(e,n)}}stateNumericStart(e,n){return n>=e.length?-1:(e.charCodeAt(n)|z0)===Re.LOWER_X?(this.state=Oe.NumericHex,this.consumed+=1,this.stateNumericHex(e,n+1)):(this.state=Oe.NumericDecimal,this.stateNumericDecimal(e,n))}addToNumericResult(e,n,i,r){if(n!==i){let s=i-n;this.result=this.result*Math.pow(r,s)+Number.parseInt(e.substr(n,s),r),this.consumed+=s}}stateNumericHex(e,n){let i=n;for(;n<e.length;){let r=e.charCodeAt(n);if(na(r)||C0(r))n+=1;else return this.addToNumericResult(e,i,n,16),this.emitNumericEntity(r,3)}return this.addToNumericResult(e,i,n,16),-1}stateNumericDecimal(e,n){let i=n;for(;n<e.length;){let r=e.charCodeAt(n);if(na(r))n+=1;else return this.addToNumericResult(e,i,n,10),this.emitNumericEntity(r,2)}return this.addToNumericResult(e,i,n,10),-1}emitNumericEntity(e,n){var i;if(this.consumed<=n)return(i=this.errors)===null||i===void 0||i.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===Re.SEMI)this.consumed+=1;else if(this.decodeMode===Zt.Strict)return 0;return this.emitCodePoint(ta(this.result),this.consumed),this.errors&&(e!==Re.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,n){let{decodeTree:i}=this,r=i[this.treeIndex],s=(r&Xt.VALUE_LENGTH)>>14;for(;n<e.length;n++,this.excess++){let o=e.charCodeAt(n);if(this.treeIndex=L0(i,r,this.treeIndex+Math.max(1,s),o),this.treeIndex<0)return this.result===0||this.decodeMode===Zt.Attribute&&(s===0||O0(o))?0:this.emitNotTerminatedNamedEntity();if(r=i[this.treeIndex],s=(r&Xt.VALUE_LENGTH)>>14,s!==0){if(o===Re.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==Zt.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;let{result:n,decodeTree:i}=this,r=(i[n]&Xt.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,r,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,n,i){let{decodeTree:r}=this;return this.emitCodePoint(n===1?r[e]&~Xt.VALUE_LENGTH:r[e+1],i),n===3&&this.emitCodePoint(r[e+2],i),i}end(){var e;switch(this.state){case Oe.NamedEntity:return this.result!==0&&(this.decodeMode!==Zt.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Oe.NumericDecimal:return this.emitNumericEntity(0,2);case Oe.NumericHex:return this.emitNumericEntity(0,3);case Oe.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Oe.EntityStart:return 0}}};function R0(t){let e="",n=new ia(t,i=>e+=ea(i));return function(r,s){let o=0,a=0;for(;(a=r.indexOf("&",a))>=0;){e+=r.slice(o,a),n.startEntity(s);let c=n.write(r,a+1);if(c<0){o=a+n.end();break}o=a+c,a=c===0?o+1:o}let u=e+r.slice(o);return e="",u}}function L0(t,e,n,i){let r=(e&Xt.BRANCH_LENGTH)>>7,s=e&Xt.JUMP_TABLE;if(r===0)return s!==0&&i===s?n:-1;if(s){let u=i-s;return u<0||u>=r?-1:t[n+u]-1}let o=n,a=o+r-1;for(;o<=a;){let u=o+a>>>1,c=t[u];if(c<i)o=u+1;else if(c>i)a=u-1;else return t[u+r]}return-1}var I0=R0(Qo);function ra(t){return I0(t,Zt.Attribute)}var Ud=document.createElement("i");function Kd(t){let e="&"+t+";";Ud.innerHTML=e;let n=Ud.textContent;return n.charCodeAt(n.length-1)===59&&t!=="semi"||n===e?!1:n}function Ee(t,e,n,i){let r=t.length,s=0,o;if(e<0?e=-e>r?0:r+e:e=e>r?r:e,n=n>0?n:0,i.length<1e4)o=Array.from(i),o.unshift(e,n),t.splice(...o);else for(n&&t.splice(e,n);s<i.length;)o=i.slice(s,s+1e4),o.unshift(e,0),t.splice(...o),s+=1e4,e+=1e4}function Be(t,e){return t.length>0?(Ee(t,t.length,0,e),t):e}var Zd={}.hasOwnProperty;function Xd(t){let e={},n=-1;for(;++n<t.length;)M0(e,t[n]);return e}function M0(t,e){let n;for(n in e){let r=(Zd.call(t,n)?t[n]:void 0)||(t[n]={}),s=e[n],o;if(s)for(o in s){Zd.call(r,o)||(r[o]=[]);let a=s[o];N0(r[o],Array.isArray(a)?a:a?[a]:[])}}}function N0(t,e){let n=-1,i=[];for(;++n<e.length;)(e[n].add==="after"?t:i).push(e[n]);Ee(t,0,0,i)}function Si(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var tt=Gt(/[A-Za-z]/),De=Gt(/[\dA-Za-z]/),Gd=Gt(/[#-'*+\--9=?A-Z^-~]/);function zi(t){return t!==null&&(t<32||t===127)}var Ci=Gt(/\d/),Jd=Gt(/[\dA-Fa-f]/),Qd=Gt(/[!-/:-@[-`{-~]/);function O(t){return t!==null&&t<-2}function ae(t){return t!==null&&(t<0||t===32)}function M(t){return t===-2||t===-1||t===32}var Yd=Gt(/\p{P}|\p{S}/u),el=Gt(/\s/);function Gt(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function P(t,e,n,i){let r=i?i-1:Number.POSITIVE_INFINITY,s=0;return o;function o(u){return M(u)?(t.enter(n),a(u)):e(u)}function a(u){return M(u)&&s++<r?(t.consume(u),a):(t.exit(n),e(u))}}var tl={tokenize:A0};function A0(t){let e=t.attempt(this.parser.constructs.contentInitial,i,r),n;return e;function i(a){if(a===null){t.consume(a);return}return t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),P(t,e,"linePrefix")}function r(a){return t.enter("paragraph"),s(a)}function s(a){let u=t.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=u),n=u,o(a)}function o(a){if(a===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(a);return}return O(a)?(t.consume(a),t.exit("chunkText"),s):(t.consume(a),o)}}var il={tokenize:P0},nl={tokenize:F0};function P0(t){let e=this,n=[],i=0,r,s,o;return a;function a(x){if(i<n.length){let y=n[i];return e.containerState=y[1],t.attempt(y[0].continuation,u,c)(x)}return c(x)}function u(x){if(i++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,r&&w();let y=e.events.length,z=y,k;for(;z--;)if(e.events[z][0]==="exit"&&e.events[z][1].type==="chunkFlow"){k=e.events[z][1].end;break}b(i);let C=y;for(;C<e.events.length;)e.events[C][1].end={...k},C++;return Ee(e.events,z+1,0,e.events.slice(y)),e.events.length=C,c(x)}return a(x)}function c(x){if(i===n.length){if(!r)return l(x);if(r.currentConstruct&&r.currentConstruct.concrete)return m(x);e.interrupt=!!(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(nl,d,h)(x)}function d(x){return r&&w(),b(i),l(x)}function h(x){return e.parser.lazy[e.now().line]=i!==n.length,o=e.now().offset,m(x)}function l(x){return e.containerState={},t.attempt(nl,f,m)(x)}function f(x){return i++,n.push([e.currentConstruct,e.containerState]),l(x)}function m(x){if(x===null){r&&w(),b(0),t.consume(x);return}return r=r||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:r,contentType:"flow",previous:s}),p(x)}function p(x){if(x===null){g(t.exit("chunkFlow"),!0),b(0),t.consume(x);return}return O(x)?(t.consume(x),g(t.exit("chunkFlow")),i=0,e.interrupt=void 0,a):(t.consume(x),p)}function g(x,y){let z=e.sliceStream(x);if(y&&z.push(null),x.previous=s,s&&(s.next=x),s=x,r.defineSkip(x.start),r.write(z),e.parser.lazy[x.start.line]){let k=r.events.length;for(;k--;)if(r.events[k][1].start.offset<o&&(!r.events[k][1].end||r.events[k][1].end.offset>o))return;let C=e.events.length,L=C,B,E;for(;L--;)if(e.events[L][0]==="exit"&&e.events[L][1].type==="chunkFlow"){if(B){E=e.events[L][1].end;break}B=!0}for(b(i),k=C;k<e.events.length;)e.events[k][1].end={...E},k++;Ee(e.events,L+1,0,e.events.slice(C)),e.events.length=k}}function b(x){let y=n.length;for(;y-- >x;){let z=n[y];e.containerState=z[1],z[0].exit.call(e,t)}n.length=x}function w(){r.write([null]),s=void 0,r=void 0,e.containerState._closeFlow=void 0}}function F0(t,e,n){return P(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function qn(t){if(t===null||ae(t)||el(t))return 1;if(Yd(t))return 2}function Jt(t,e,n){let i=[],r=-1;for(;++r<t.length;){let s=t[r].resolveAll;s&&!i.includes(s)&&(e=s(e,n),i.push(s))}return e}var Ti={name:"attention",resolveAll:$0,tokenize:B0};function $0(t,e){let n=-1,i,r,s,o,a,u,c,d;for(;++n<t.length;)if(t[n][0]==="enter"&&t[n][1].type==="attentionSequence"&&t[n][1]._close){for(i=n;i--;)if(t[i][0]==="exit"&&t[i][1].type==="attentionSequence"&&t[i][1]._open&&e.sliceSerialize(t[i][1]).charCodeAt(0)===e.sliceSerialize(t[n][1]).charCodeAt(0)){if((t[i][1]._close||t[n][1]._open)&&(t[n][1].end.offset-t[n][1].start.offset)%3&&!((t[i][1].end.offset-t[i][1].start.offset+t[n][1].end.offset-t[n][1].start.offset)%3))continue;u=t[i][1].end.offset-t[i][1].start.offset>1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1;let h={...t[i][1].end},l={...t[n][1].start};rl(h,-u),rl(l,u),o={type:u>1?"strongSequence":"emphasisSequence",start:h,end:{...t[i][1].end}},a={type:u>1?"strongSequence":"emphasisSequence",start:{...t[n][1].start},end:l},s={type:u>1?"strongText":"emphasisText",start:{...t[i][1].end},end:{...t[n][1].start}},r={type:u>1?"strong":"emphasis",start:{...o.start},end:{...a.end}},t[i][1].end={...o.start},t[n][1].start={...a.end},c=[],t[i][1].end.offset-t[i][1].start.offset&&(c=Be(c,[["enter",t[i][1],e],["exit",t[i][1],e]])),c=Be(c,[["enter",r,e],["enter",o,e],["exit",o,e],["enter",s,e]]),c=Be(c,Jt(e.parser.constructs.insideSpan.null,t.slice(i+1,n),e)),c=Be(c,[["exit",s,e],["enter",a,e],["exit",a,e],["exit",r,e]]),t[n][1].end.offset-t[n][1].start.offset?(d=2,c=Be(c,[["enter",t[n][1],e],["exit",t[n][1],e]])):d=0,Ee(t,i-1,n-i+3,c),n=i+c.length-d-2;break}}for(n=-1;++n<t.length;)t[n][1].type==="attentionSequence"&&(t[n][1].type="data");return t}function B0(t,e){let n=this.parser.constructs.attentionMarkers.null,i=this.previous,r=qn(i),s;return o;function o(u){return s=u,t.enter("attentionSequence"),a(u)}function a(u){if(u===s)return t.consume(u),a;let c=t.exit("attentionSequence"),d=qn(u),h=!d||d===2&&r||n.includes(u),l=!r||r===2&&d||n.includes(i);return c._open=!!(s===42?h:h&&(r||!l)),c._close=!!(s===42?l:l&&(d||!h)),e(u)}}function rl(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}var sa={name:"autolink",tokenize:D0};function D0(t,e,n){let i=0;return r;function r(f){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(f),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),s}function s(f){return tt(f)?(t.consume(f),o):f===64?n(f):c(f)}function o(f){return f===43||f===45||f===46||De(f)?(i=1,a(f)):c(f)}function a(f){return f===58?(t.consume(f),i=0,u):(f===43||f===45||f===46||De(f))&&i++<32?(t.consume(f),a):(i=0,c(f))}function u(f){return f===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(f),t.exit("autolinkMarker"),t.exit("autolink"),e):f===null||f===32||f===60||zi(f)?n(f):(t.consume(f),u)}function c(f){return f===64?(t.consume(f),d):Gd(f)?(t.consume(f),c):n(f)}function d(f){return De(f)?h(f):n(f)}function h(f){return f===46?(t.consume(f),i=0,d):f===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(f),t.exit("autolinkMarker"),t.exit("autolink"),e):l(f)}function l(f){if((f===45||De(f))&&i++<63){let m=f===45?l:h;return t.consume(f),m}return n(f)}}var Qt={partial:!0,tokenize:q0};function q0(t,e,n){return i;function i(s){return M(s)?P(t,r,"linePrefix")(s):r(s)}function r(s){return s===null||O(s)?e(s):n(s)}}var yr={continuation:{tokenize:j0},exit:H0,name:"blockQuote",tokenize:V0};function V0(t,e,n){let i=this;return r;function r(o){if(o===62){let a=i.containerState;return a.open||(t.enter("blockQuote",{_container:!0}),a.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(o),t.exit("blockQuoteMarker"),s}return n(o)}function s(o){return M(o)?(t.enter("blockQuotePrefixWhitespace"),t.consume(o),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(o))}}function j0(t,e,n){let i=this;return r;function r(o){return M(o)?P(t,s,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):s(o)}function s(o){return t.attempt(yr,e,n)(o)}}function H0(t){t.exit("blockQuote")}var kr={name:"characterEscape",tokenize:W0};function W0(t,e,n){return i;function i(s){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(s),t.exit("escapeMarker"),r}function r(s){return Qd(s)?(t.enter("characterEscapeValue"),t.consume(s),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):n(s)}}var Er={name:"characterReference",tokenize:U0};function U0(t,e,n){let i=this,r=0,s,o;return a;function a(h){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(h),t.exit("characterReferenceMarker"),u}function u(h){return h===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(h),t.exit("characterReferenceMarkerNumeric"),c):(t.enter("characterReferenceValue"),s=31,o=De,d(h))}function c(h){return h===88||h===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(h),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),s=6,o=Jd,d):(t.enter("characterReferenceValue"),s=7,o=Ci,d(h))}function d(h){if(h===59&&r){let l=t.exit("characterReferenceValue");return o===De&&!Kd(i.sliceSerialize(l))?n(h):(t.enter("characterReferenceMarker"),t.consume(h),t.exit("characterReferenceMarker"),t.exit("characterReference"),e)}return o(h)&&r++<s?(t.consume(h),d):n(h)}}var sl={partial:!0,tokenize:Z0},Sr={concrete:!0,name:"codeFenced",tokenize:K0};function K0(t,e,n){let i=this,r={partial:!0,tokenize:z},s=0,o=0,a;return u;function u(k){return c(k)}function c(k){let C=i.events[i.events.length-1];return s=C&&C[1].type==="linePrefix"?C[2].sliceSerialize(C[1],!0).length:0,a=k,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),d(k)}function d(k){return k===a?(o++,t.consume(k),d):o<3?n(k):(t.exit("codeFencedFenceSequence"),M(k)?P(t,h,"whitespace")(k):h(k))}function h(k){return k===null||O(k)?(t.exit("codeFencedFence"),i.interrupt?e(k):t.check(sl,p,y)(k)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),l(k))}function l(k){return k===null||O(k)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),h(k)):M(k)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),P(t,f,"whitespace")(k)):k===96&&k===a?n(k):(t.consume(k),l)}function f(k){return k===null||O(k)?h(k):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),m(k))}function m(k){return k===null||O(k)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),h(k)):k===96&&k===a?n(k):(t.consume(k),m)}function p(k){return t.attempt(r,y,g)(k)}function g(k){return t.enter("lineEnding"),t.consume(k),t.exit("lineEnding"),b}function b(k){return s>0&&M(k)?P(t,w,"linePrefix",s+1)(k):w(k)}function w(k){return k===null||O(k)?t.check(sl,p,y)(k):(t.enter("codeFlowValue"),x(k))}function x(k){return k===null||O(k)?(t.exit("codeFlowValue"),w(k)):(t.consume(k),x)}function y(k){return t.exit("codeFenced"),e(k)}function z(k,C,L){let B=0;return E;function E(U){return k.enter("lineEnding"),k.consume(U),k.exit("lineEnding"),re}function re(U){return k.enter("codeFencedFence"),M(U)?P(k,X,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(U):X(U)}function X(U){return U===a?(k.enter("codeFencedFenceSequence"),A(U)):L(U)}function A(U){return U===a?(B++,k.consume(U),A):B>=o?(k.exit("codeFencedFenceSequence"),M(U)?P(k,W,"whitespace")(U):W(U)):L(U)}function W(U){return U===null||O(U)?(k.exit("codeFencedFence"),C(U)):L(U)}}}function Z0(t,e,n){let i=this;return r;function r(o){return o===null?n(o):(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),s)}function s(o){return i.parser.lazy[i.now().line]?n(o):e(o)}}var Oi={name:"codeIndented",tokenize:G0},X0={partial:!0,tokenize:J0};function G0(t,e,n){let i=this;return r;function r(c){return t.enter("codeIndented"),P(t,s,"linePrefix",5)(c)}function s(c){let d=i.events[i.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?o(c):n(c)}function o(c){return c===null?u(c):O(c)?t.attempt(X0,o,u)(c):(t.enter("codeFlowValue"),a(c))}function a(c){return c===null||O(c)?(t.exit("codeFlowValue"),o(c)):(t.consume(c),a)}function u(c){return t.exit("codeIndented"),e(c)}}function J0(t,e,n){let i=this;return r;function r(o){return i.parser.lazy[i.now().line]?n(o):O(o)?(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),r):P(t,s,"linePrefix",5)(o)}function s(o){let a=i.events[i.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?e(o):O(o)?r(o):n(o)}}var oa={name:"codeText",previous:Y0,resolve:Q0,tokenize:eg};function Q0(t){let e=t.length-4,n=3,i,r;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(i=n;++i<e;)if(t[i][1].type==="codeTextData"){t[n][1].type="codeTextPadding",t[e][1].type="codeTextPadding",n+=2,e-=2;break}}for(i=n-1,e++;++i<=e;)r===void 0?i!==e&&t[i][1].type!=="lineEnding"&&(r=i):(i===e||t[i][1].type==="lineEnding")&&(t[r][1].type="codeTextData",i!==r+2&&(t[r][1].end=t[i-1][1].end,t.splice(r+2,i-r-2),e-=i-r-2,i=r+2),r=void 0);return t}function Y0(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function eg(t,e,n){let i=this,r=0,s,o;return a;function a(l){return t.enter("codeText"),t.enter("codeTextSequence"),u(l)}function u(l){return l===96?(t.consume(l),r++,u):(t.exit("codeTextSequence"),c(l))}function c(l){return l===null?n(l):l===32?(t.enter("space"),t.consume(l),t.exit("space"),c):l===96?(o=t.enter("codeTextSequence"),s=0,h(l)):O(l)?(t.enter("lineEnding"),t.consume(l),t.exit("lineEnding"),c):(t.enter("codeTextData"),d(l))}function d(l){return l===null||l===32||l===96||O(l)?(t.exit("codeTextData"),c(l)):(t.consume(l),d)}function h(l){return l===96?(t.consume(l),s++,h):s===r?(t.exit("codeTextSequence"),t.exit("codeText"),e(l)):(o.type="codeTextData",d(l))}}var zr=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,n){let i=n??Number.POSITIVE_INFINITY;return i<this.left.length?this.left.slice(e,i):e>this.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(e,n,i){let r=n||0;this.setCursor(Math.trunc(e));let s=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return i&&Ri(this.left,i),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),Ri(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Ri(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){let n=this.left.splice(e,Number.POSITIVE_INFINITY);Ri(this.right,n.reverse())}else{let n=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);Ri(this.left,n.reverse())}}};function Ri(t,e){let n=0;if(e.length<1e4)t.push(...e);else for(;n<e.length;)t.push(...e.slice(n,n+1e4)),n+=1e4}function Cr(t){let e={},n=-1,i,r,s,o,a,u,c,d=new zr(t);for(;++n<d.length;){for(;n in e;)n=e[n];if(i=d.get(n),n&&i[1].type==="chunkFlow"&&d.get(n-1)[1].type==="listItemPrefix"&&(u=i[1]._tokenizer.events,s=0,s<u.length&&u[s][1].type==="lineEndingBlank"&&(s+=2),s<u.length&&u[s][1].type==="content"))for(;++s<u.length&&u[s][1].type!=="content";)u[s][1].type==="chunkText"&&(u[s][1]._isInFirstContentOfListItem=!0,s++);if(i[0]==="enter")i[1].contentType&&(Object.assign(e,tg(d,n)),n=e[n],c=!0);else if(i[1]._container){for(s=n,r=void 0;s--;)if(o=d.get(s),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(r&&(d.get(r)[1].type="lineEndingBlank"),o[1].type="lineEnding",r=s);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;r&&(i[1].end={...d.get(r)[1].start},a=d.slice(r,n),a.unshift(i),d.splice(r,n-r+1,a))}}return Ee(t,0,Number.POSITIVE_INFINITY,d.slice(0)),!c}function tg(t,e){let n=t.get(e)[1],i=t.get(e)[2],r=e-1,s=[],o=n._tokenizer;o||(o=i.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let a=o.events,u=[],c={},d,h,l=-1,f=n,m=0,p=0,g=[p];for(;f;){for(;t.get(++r)[1]!==f;);s.push(r),f._tokenizer||(d=i.sliceStream(f),f.next||d.push(null),h&&o.defineSkip(f.start),f._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(d),f._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),h=f,f=f.next}for(f=n;++l<a.length;)a[l][0]==="exit"&&a[l-1][0]==="enter"&&a[l][1].type===a[l-1][1].type&&a[l][1].start.line!==a[l][1].end.line&&(p=l+1,g.push(p),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(o.events=[],f?(f._tokenizer=void 0,f.previous=void 0):g.pop(),l=g.length;l--;){let b=a.slice(g[l],g[l+1]),w=s.pop();u.push([w,w+b.length-1]),t.splice(w,2,b)}for(u.reverse(),l=-1;++l<u.length;)c[m+u[l][0]]=m+u[l][1],m+=u[l][1]-u[l][0]-1;return c}var aa={resolve:ig,tokenize:rg},ng={partial:!0,tokenize:sg};function ig(t){return Cr(t),t}function rg(t,e){let n;return i;function i(a){return t.enter("content"),n=t.enter("chunkContent",{contentType:"content"}),r(a)}function r(a){return a===null?s(a):O(a)?t.check(ng,o,s)(a):(t.consume(a),r)}function s(a){return t.exit("chunkContent"),t.exit("content"),e(a)}function o(a){return t.consume(a),t.exit("chunkContent"),n.next=t.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}function sg(t,e,n){let i=this;return r;function r(o){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),P(t,s,"linePrefix")}function s(o){if(o===null||O(o))return n(o);let a=i.events[i.events.length-1];return!i.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?e(o):t.interrupt(i.parser.constructs.flow,n,e)(o)}}function Tr(t,e,n,i,r,s,o,a,u){let c=u||Number.POSITIVE_INFINITY,d=0;return h;function h(b){return b===60?(t.enter(i),t.enter(r),t.enter(s),t.consume(b),t.exit(s),l):b===null||b===32||b===41||zi(b)?n(b):(t.enter(i),t.enter(o),t.enter(a),t.enter("chunkString",{contentType:"string"}),p(b))}function l(b){return b===62?(t.enter(s),t.consume(b),t.exit(s),t.exit(r),t.exit(i),e):(t.enter(a),t.enter("chunkString",{contentType:"string"}),f(b))}function f(b){return b===62?(t.exit("chunkString"),t.exit(a),l(b)):b===null||b===60||O(b)?n(b):(t.consume(b),b===92?m:f)}function m(b){return b===60||b===62||b===92?(t.consume(b),f):f(b)}function p(b){return!d&&(b===null||b===41||ae(b))?(t.exit("chunkString"),t.exit(a),t.exit(o),t.exit(i),e(b)):d<c&&b===40?(t.consume(b),d++,p):b===41?(t.consume(b),d--,p):b===null||b===32||b===40||zi(b)?n(b):(t.consume(b),b===92?g:p)}function g(b){return b===40||b===41||b===92?(t.consume(b),p):p(b)}}function Or(t,e,n,i,r,s){let o=this,a=0,u;return c;function c(f){return t.enter(i),t.enter(r),t.consume(f),t.exit(r),t.enter(s),d}function d(f){return a>999||f===null||f===91||f===93&&!u||f===94&&!a&&"_hiddenFootnoteSupport"in o.parser.constructs?n(f):f===93?(t.exit(s),t.enter(r),t.consume(f),t.exit(r),t.exit(i),e):O(f)?(t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),d):(t.enter("chunkString",{contentType:"string"}),h(f))}function h(f){return f===null||f===91||f===93||O(f)||a++>999?(t.exit("chunkString"),d(f)):(t.consume(f),u||(u=!M(f)),f===92?l:h)}function l(f){return f===91||f===92||f===93?(t.consume(f),a++,h):h(f)}}function Rr(t,e,n,i,r,s){let o;return a;function a(l){return l===34||l===39||l===40?(t.enter(i),t.enter(r),t.consume(l),t.exit(r),o=l===40?41:l,u):n(l)}function u(l){return l===o?(t.enter(r),t.consume(l),t.exit(r),t.exit(i),e):(t.enter(s),c(l))}function c(l){return l===o?(t.exit(s),u(o)):l===null?n(l):O(l)?(t.enter("lineEnding"),t.consume(l),t.exit("lineEnding"),P(t,c,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),d(l))}function d(l){return l===o||l===null||O(l)?(t.exit("chunkString"),c(l)):(t.consume(l),l===92?h:d)}function h(l){return l===o||l===92?(t.consume(l),d):d(l)}}function _n(t,e){let n;return i;function i(r){return O(r)?(t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),n=!0,i):M(r)?P(t,i,n?"linePrefix":"lineSuffix")(r):e(r)}}var ua={name:"definition",tokenize:ag},og={partial:!0,tokenize:ug};function ag(t,e,n){let i=this,r;return s;function s(f){return t.enter("definition"),o(f)}function o(f){return Or.call(i,t,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function a(f){return r=Si(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),f===58?(t.enter("definitionMarker"),t.consume(f),t.exit("definitionMarker"),u):n(f)}function u(f){return ae(f)?_n(t,c)(f):c(f)}function c(f){return Tr(t,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function d(f){return t.attempt(og,h,h)(f)}function h(f){return M(f)?P(t,l,"whitespace")(f):l(f)}function l(f){return f===null||O(f)?(t.exit("definition"),i.parser.defined.push(r),e(f)):n(f)}}function ug(t,e,n){return i;function i(a){return ae(a)?_n(t,r)(a):n(a)}function r(a){return Rr(t,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function s(a){return M(a)?P(t,o,"whitespace")(a):o(a)}function o(a){return a===null||O(a)?e(a):n(a)}}var ca={name:"hardBreakEscape",tokenize:cg};function cg(t,e,n){return i;function i(s){return t.enter("hardBreakEscape"),t.consume(s),r}function r(s){return O(s)?(t.exit("hardBreakEscape"),e(s)):n(s)}}var da={name:"headingAtx",resolve:dg,tokenize:lg};function dg(t,e){let n=t.length-2,i=3,r,s;return t[i][1].type==="whitespace"&&(i+=2),n-2>i&&t[n][1].type==="whitespace"&&(n-=2),t[n][1].type==="atxHeadingSequence"&&(i===n-1||n-4>i&&t[n-2][1].type==="whitespace")&&(n-=i+1===n?2:4),n>i&&(r={type:"atxHeadingText",start:t[i][1].start,end:t[n][1].end},s={type:"chunkText",start:t[i][1].start,end:t[n][1].end,contentType:"text"},Ee(t,i,n-i+1,[["enter",r,e],["enter",s,e],["exit",s,e],["exit",r,e]])),t}function lg(t,e,n){let i=0;return r;function r(d){return t.enter("atxHeading"),s(d)}function s(d){return t.enter("atxHeadingSequence"),o(d)}function o(d){return d===35&&i++<6?(t.consume(d),o):d===null||ae(d)?(t.exit("atxHeadingSequence"),a(d)):n(d)}function a(d){return d===35?(t.enter("atxHeadingSequence"),u(d)):d===null||O(d)?(t.exit("atxHeading"),e(d)):M(d)?P(t,a,"whitespace")(d):(t.enter("atxHeadingText"),c(d))}function u(d){return d===35?(t.consume(d),u):(t.exit("atxHeadingSequence"),a(d))}function c(d){return d===null||d===35||ae(d)?(t.exit("atxHeadingText"),a(d)):(t.consume(d),c)}}var ol=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],la=["pre","script","style","textarea"];var ha={concrete:!0,name:"htmlFlow",resolveTo:mg,tokenize:pg},hg={partial:!0,tokenize:bg},fg={partial:!0,tokenize:gg};function mg(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function pg(t,e,n){let i=this,r,s,o,a,u;return c;function c(_){return d(_)}function d(_){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(_),h}function h(_){return _===33?(t.consume(_),l):_===47?(t.consume(_),s=!0,p):_===63?(t.consume(_),r=3,i.interrupt?e:v):tt(_)?(t.consume(_),o=String.fromCharCode(_),g):n(_)}function l(_){return _===45?(t.consume(_),r=2,f):_===91?(t.consume(_),r=5,a=0,m):tt(_)?(t.consume(_),r=4,i.interrupt?e:v):n(_)}function f(_){return _===45?(t.consume(_),i.interrupt?e:v):n(_)}function m(_){let bt="CDATA[";return _===bt.charCodeAt(a++)?(t.consume(_),a===bt.length?i.interrupt?e:X:m):n(_)}function p(_){return tt(_)?(t.consume(_),o=String.fromCharCode(_),g):n(_)}function g(_){if(_===null||_===47||_===62||ae(_)){let bt=_===47,lr=o.toLowerCase();return!bt&&!s&&la.includes(lr)?(r=1,i.interrupt?e(_):X(_)):ol.includes(o.toLowerCase())?(r=6,bt?(t.consume(_),b):i.interrupt?e(_):X(_)):(r=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(_):s?w(_):x(_))}return _===45||De(_)?(t.consume(_),o+=String.fromCharCode(_),g):n(_)}function b(_){return _===62?(t.consume(_),i.interrupt?e:X):n(_)}function w(_){return M(_)?(t.consume(_),w):E(_)}function x(_){return _===47?(t.consume(_),E):_===58||_===95||tt(_)?(t.consume(_),y):M(_)?(t.consume(_),x):E(_)}function y(_){return _===45||_===46||_===58||_===95||De(_)?(t.consume(_),y):z(_)}function z(_){return _===61?(t.consume(_),k):M(_)?(t.consume(_),z):x(_)}function k(_){return _===null||_===60||_===61||_===62||_===96?n(_):_===34||_===39?(t.consume(_),u=_,C):M(_)?(t.consume(_),k):L(_)}function C(_){return _===u?(t.consume(_),u=null,B):_===null||O(_)?n(_):(t.consume(_),C)}function L(_){return _===null||_===34||_===39||_===47||_===60||_===61||_===62||_===96||ae(_)?z(_):(t.consume(_),L)}function B(_){return _===47||_===62||M(_)?x(_):n(_)}function E(_){return _===62?(t.consume(_),re):n(_)}function re(_){return _===null||O(_)?X(_):M(_)?(t.consume(_),re):n(_)}function X(_){return _===45&&r===2?(t.consume(_),le):_===60&&r===1?(t.consume(_),we):_===62&&r===4?(t.consume(_),zt):_===63&&r===3?(t.consume(_),v):_===93&&r===5?(t.consume(_),st):O(_)&&(r===6||r===7)?(t.exit("htmlFlowData"),t.check(hg,ln,A)(_)):_===null||O(_)?(t.exit("htmlFlowData"),A(_)):(t.consume(_),X)}function A(_){return t.check(fg,W,ln)(_)}function W(_){return t.enter("lineEnding"),t.consume(_),t.exit("lineEnding"),U}function U(_){return _===null||O(_)?A(_):(t.enter("htmlFlowData"),X(_))}function le(_){return _===45?(t.consume(_),v):X(_)}function we(_){return _===47?(t.consume(_),o="",gt):X(_)}function gt(_){if(_===62){let bt=o.toLowerCase();return la.includes(bt)?(t.consume(_),zt):X(_)}return tt(_)&&o.length<8?(t.consume(_),o+=String.fromCharCode(_),gt):X(_)}function st(_){return _===93?(t.consume(_),v):X(_)}function v(_){return _===62?(t.consume(_),zt):_===45&&r===2?(t.consume(_),v):X(_)}function zt(_){return _===null||O(_)?(t.exit("htmlFlowData"),ln(_)):(t.consume(_),zt)}function ln(_){return t.exit("htmlFlow"),e(_)}}function gg(t,e,n){let i=this;return r;function r(o){return O(o)?(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),s):n(o)}function s(o){return i.parser.lazy[i.now().line]?n(o):e(o)}}function bg(t,e,n){return i;function i(r){return t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),t.attempt(Qt,e,n)}}var fa={name:"htmlText",tokenize:vg};function vg(t,e,n){let i=this,r,s,o;return a;function a(v){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(v),u}function u(v){return v===33?(t.consume(v),c):v===47?(t.consume(v),z):v===63?(t.consume(v),x):tt(v)?(t.consume(v),L):n(v)}function c(v){return v===45?(t.consume(v),d):v===91?(t.consume(v),s=0,m):tt(v)?(t.consume(v),w):n(v)}function d(v){return v===45?(t.consume(v),f):n(v)}function h(v){return v===null?n(v):v===45?(t.consume(v),l):O(v)?(o=h,we(v)):(t.consume(v),h)}function l(v){return v===45?(t.consume(v),f):h(v)}function f(v){return v===62?le(v):v===45?l(v):h(v)}function m(v){let zt="CDATA[";return v===zt.charCodeAt(s++)?(t.consume(v),s===zt.length?p:m):n(v)}function p(v){return v===null?n(v):v===93?(t.consume(v),g):O(v)?(o=p,we(v)):(t.consume(v),p)}function g(v){return v===93?(t.consume(v),b):p(v)}function b(v){return v===62?le(v):v===93?(t.consume(v),b):p(v)}function w(v){return v===null||v===62?le(v):O(v)?(o=w,we(v)):(t.consume(v),w)}function x(v){return v===null?n(v):v===63?(t.consume(v),y):O(v)?(o=x,we(v)):(t.consume(v),x)}function y(v){return v===62?le(v):x(v)}function z(v){return tt(v)?(t.consume(v),k):n(v)}function k(v){return v===45||De(v)?(t.consume(v),k):C(v)}function C(v){return O(v)?(o=C,we(v)):M(v)?(t.consume(v),C):le(v)}function L(v){return v===45||De(v)?(t.consume(v),L):v===47||v===62||ae(v)?B(v):n(v)}function B(v){return v===47?(t.consume(v),le):v===58||v===95||tt(v)?(t.consume(v),E):O(v)?(o=B,we(v)):M(v)?(t.consume(v),B):le(v)}function E(v){return v===45||v===46||v===58||v===95||De(v)?(t.consume(v),E):re(v)}function re(v){return v===61?(t.consume(v),X):O(v)?(o=re,we(v)):M(v)?(t.consume(v),re):B(v)}function X(v){return v===null||v===60||v===61||v===62||v===96?n(v):v===34||v===39?(t.consume(v),r=v,A):O(v)?(o=X,we(v)):M(v)?(t.consume(v),X):(t.consume(v),W)}function A(v){return v===r?(t.consume(v),r=void 0,U):v===null?n(v):O(v)?(o=A,we(v)):(t.consume(v),A)}function W(v){return v===null||v===34||v===39||v===60||v===61||v===96?n(v):v===47||v===62||ae(v)?B(v):(t.consume(v),W)}function U(v){return v===47||v===62||ae(v)?B(v):n(v)}function le(v){return v===62?(t.consume(v),t.exit("htmlTextData"),t.exit("htmlText"),e):n(v)}function we(v){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(v),t.exit("lineEnding"),gt}function gt(v){return M(v)?P(t,st,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(v):st(v)}function st(v){return t.enter("htmlTextData"),o(v)}}var xn={name:"labelEnd",resolveAll:yg,resolveTo:kg,tokenize:Eg},_g={tokenize:Sg},xg={tokenize:zg},wg={tokenize:Cg};function yg(t){let e=-1,n=[];for(;++e<t.length;){let i=t[e][1];if(n.push(t[e]),i.type==="labelImage"||i.type==="labelLink"||i.type==="labelEnd"){let r=i.type==="labelImage"?4:2;i.type="data",e+=r}}return t.length!==n.length&&Ee(t,0,t.length,n),t}function kg(t,e){let n=t.length,i=0,r,s,o,a;for(;n--;)if(r=t[n][1],s){if(r.type==="link"||r.type==="labelLink"&&r._inactive)break;t[n][0]==="enter"&&r.type==="labelLink"&&(r._inactive=!0)}else if(o){if(t[n][0]==="enter"&&(r.type==="labelImage"||r.type==="labelLink")&&!r._balanced&&(s=n,r.type!=="labelLink")){i=2;break}}else r.type==="labelEnd"&&(o=n);let u={type:t[s][1].type==="labelLink"?"link":"image",start:{...t[s][1].start},end:{...t[t.length-1][1].end}},c={type:"label",start:{...t[s][1].start},end:{...t[o][1].end}},d={type:"labelText",start:{...t[s+i+2][1].end},end:{...t[o-2][1].start}};return a=[["enter",u,e],["enter",c,e]],a=Be(a,t.slice(s+1,s+i+3)),a=Be(a,[["enter",d,e]]),a=Be(a,Jt(e.parser.constructs.insideSpan.null,t.slice(s+i+4,o-3),e)),a=Be(a,[["exit",d,e],t[o-2],t[o-1],["exit",c,e]]),a=Be(a,t.slice(o+1)),a=Be(a,[["exit",u,e]]),Ee(t,s,t.length,a),t}function Eg(t,e,n){let i=this,r=i.events.length,s,o;for(;r--;)if((i.events[r][1].type==="labelImage"||i.events[r][1].type==="labelLink")&&!i.events[r][1]._balanced){s=i.events[r][1];break}return a;function a(l){return s?s._inactive?h(l):(o=i.parser.defined.includes(Si(i.sliceSerialize({start:s.end,end:i.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(l),t.exit("labelMarker"),t.exit("labelEnd"),u):n(l)}function u(l){return l===40?t.attempt(_g,d,o?d:h)(l):l===91?t.attempt(xg,d,o?c:h)(l):o?d(l):h(l)}function c(l){return t.attempt(wg,d,h)(l)}function d(l){return e(l)}function h(l){return s._balanced=!0,n(l)}}function Sg(t,e,n){return i;function i(h){return t.enter("resource"),t.enter("resourceMarker"),t.consume(h),t.exit("resourceMarker"),r}function r(h){return ae(h)?_n(t,s)(h):s(h)}function s(h){return h===41?d(h):Tr(t,o,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function o(h){return ae(h)?_n(t,u)(h):d(h)}function a(h){return n(h)}function u(h){return h===34||h===39||h===40?Rr(t,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):d(h)}function c(h){return ae(h)?_n(t,d)(h):d(h)}function d(h){return h===41?(t.enter("resourceMarker"),t.consume(h),t.exit("resourceMarker"),t.exit("resource"),e):n(h)}}function zg(t,e,n){let i=this;return r;function r(a){return Or.call(i,t,s,o,"reference","referenceMarker","referenceString")(a)}function s(a){return i.parser.defined.includes(Si(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?e(a):n(a)}function o(a){return n(a)}}function Cg(t,e,n){return i;function i(s){return t.enter("reference"),t.enter("referenceMarker"),t.consume(s),t.exit("referenceMarker"),r}function r(s){return s===93?(t.enter("referenceMarker"),t.consume(s),t.exit("referenceMarker"),t.exit("reference"),e):n(s)}}var ma={name:"labelStartImage",resolveAll:xn.resolveAll,tokenize:Tg};function Tg(t,e,n){let i=this;return r;function r(a){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(a),t.exit("labelImageMarker"),s}function s(a){return a===91?(t.enter("labelMarker"),t.consume(a),t.exit("labelMarker"),t.exit("labelImage"),o):n(a)}function o(a){return a===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(a):e(a)}}var pa={name:"labelStartLink",resolveAll:xn.resolveAll,tokenize:Og};function Og(t,e,n){let i=this;return r;function r(o){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(o),t.exit("labelMarker"),t.exit("labelLink"),s}function s(o){return o===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(o):e(o)}}var Li={name:"lineEnding",tokenize:Rg};function Rg(t,e){return n;function n(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),P(t,e,"linePrefix")}}var wn={name:"thematicBreak",tokenize:Lg};function Lg(t,e,n){let i=0,r;return s;function s(c){return t.enter("thematicBreak"),o(c)}function o(c){return r=c,a(c)}function a(c){return c===r?(t.enter("thematicBreakSequence"),u(c)):i>=3&&(c===null||O(c))?(t.exit("thematicBreak"),e(c)):n(c)}function u(c){return c===r?(t.consume(c),i++,u):(t.exit("thematicBreakSequence"),M(c)?P(t,a,"whitespace")(c):a(c))}}var Pe={continuation:{tokenize:Ag},exit:Fg,name:"list",tokenize:Ng},Ig={partial:!0,tokenize:$g},Mg={partial:!0,tokenize:Pg};function Ng(t,e,n){let i=this,r=i.events[i.events.length-1],s=r&&r[1].type==="linePrefix"?r[2].sliceSerialize(r[1],!0).length:0,o=0;return a;function a(f){let m=i.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!i.containerState.marker||f===i.containerState.marker:Ci(f)){if(i.containerState.type||(i.containerState.type=m,t.enter(m,{_container:!0})),m==="listUnordered")return t.enter("listItemPrefix"),f===42||f===45?t.check(wn,n,c)(f):c(f);if(!i.interrupt||f===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),u(f)}return n(f)}function u(f){return Ci(f)&&++o<10?(t.consume(f),u):(!i.interrupt||o<2)&&(i.containerState.marker?f===i.containerState.marker:f===41||f===46)?(t.exit("listItemValue"),c(f)):n(f)}function c(f){return t.enter("listItemMarker"),t.consume(f),t.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||f,t.check(Qt,i.interrupt?n:d,t.attempt(Ig,l,h))}function d(f){return i.containerState.initialBlankLine=!0,s++,l(f)}function h(f){return M(f)?(t.enter("listItemPrefixWhitespace"),t.consume(f),t.exit("listItemPrefixWhitespace"),l):n(f)}function l(f){return i.containerState.size=s+i.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(f)}}function Ag(t,e,n){let i=this;return i.containerState._closeFlow=void 0,t.check(Qt,r,s);function r(a){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,P(t,e,"listItemIndent",i.containerState.size+1)(a)}function s(a){return i.containerState.furtherBlankLines||!M(a)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,o(a)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,t.attempt(Mg,e,o)(a))}function o(a){return i.containerState._closeFlow=!0,i.interrupt=void 0,P(t,t.attempt(Pe,e,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function Pg(t,e,n){let i=this;return P(t,r,"listItemIndent",i.containerState.size+1);function r(s){let o=i.events[i.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===i.containerState.size?e(s):n(s)}}function Fg(t){t.exit(this.containerState.type)}function $g(t,e,n){let i=this;return P(t,r,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function r(s){let o=i.events[i.events.length-1];return!M(s)&&o&&o[1].type==="listItemPrefixWhitespace"?e(s):n(s)}}var Lr={name:"setextUnderline",resolveTo:Bg,tokenize:Dg};function Bg(t,e){let n=t.length,i,r,s;for(;n--;)if(t[n][0]==="enter"){if(t[n][1].type==="content"){i=n;break}t[n][1].type==="paragraph"&&(r=n)}else t[n][1].type==="content"&&t.splice(n,1),!s&&t[n][1].type==="definition"&&(s=n);let o={type:"setextHeading",start:{...t[i][1].start},end:{...t[t.length-1][1].end}};return t[r][1].type="setextHeadingText",s?(t.splice(r,0,["enter",o,e]),t.splice(s+1,0,["exit",t[i][1],e]),t[i][1].end={...t[s][1].end}):t[i][1]=o,t.push(["exit",o,e]),t}function Dg(t,e,n){let i=this,r;return s;function s(c){let d=i.events.length,h;for(;d--;)if(i.events[d][1].type!=="lineEnding"&&i.events[d][1].type!=="linePrefix"&&i.events[d][1].type!=="content"){h=i.events[d][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||h)?(t.enter("setextHeadingLine"),r=c,o(c)):n(c)}function o(c){return t.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===r?(t.consume(c),a):(t.exit("setextHeadingLineSequence"),M(c)?P(t,u,"lineSuffix")(c):u(c))}function u(c){return c===null||O(c)?(t.exit("setextHeadingLine"),e(c)):n(c)}}var al={tokenize:qg};function qg(t){let e=this,n=t.attempt(Qt,i,t.attempt(this.parser.constructs.flowInitial,r,P(t,t.attempt(this.parser.constructs.flow,r,t.attempt(aa,r)),"linePrefix")));return n;function i(s){if(s===null){t.consume(s);return}return t.enter("lineEndingBlank"),t.consume(s),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function r(s){if(s===null){t.consume(s);return}return t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),e.currentConstruct=void 0,n}}var ul={resolveAll:hl()},cl=ll("string"),dl=ll("text");function ll(t){return{resolveAll:hl(t==="text"?Vg:void 0),tokenize:e};function e(n){let i=this,r=this.parser.constructs[t],s=n.attempt(r,o,a);return o;function o(d){return c(d)?s(d):a(d)}function a(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),u}function u(d){return c(d)?(n.exit("data"),s(d)):(n.consume(d),u)}function c(d){if(d===null)return!0;let h=r[d],l=-1;if(h)for(;++l<h.length;){let f=h[l];if(!f.previous||f.previous.call(i,i.previous))return!0}return!1}}}function hl(t){return e;function e(n,i){let r=-1,s;for(;++r<=n.length;)s===void 0?n[r]&&n[r][1].type==="data"&&(s=r,r++):(!n[r]||n[r][1].type!=="data")&&(r!==s+2&&(n[s][1].end=n[r-1][1].end,n.splice(s+2,r-s-2),r=s+2),s=void 0);return t?t(n,i):n}}function Vg(t,e){let n=0;for(;++n<=t.length;)if((n===t.length||t[n][1].type==="lineEnding")&&t[n-1][1].type==="data"){let i=t[n-1][1],r=e.sliceStream(i),s=r.length,o=-1,a=0,u;for(;s--;){let c=r[s];if(typeof c=="string"){for(o=c.length;c.charCodeAt(o-1)===32;)a++,o--;if(o)break;o=-1}else if(c===-2)u=!0,a++;else if(c!==-1){s++;break}}if(e._contentTypeTextTrailing&&n===t.length&&(a=0),a){let c={type:n===t.length||u||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?o:i.start._bufferIndex+o,_index:i.start._index+s,line:i.end.line,column:i.end.column-a,offset:i.end.offset-a},end:{...i.end}};i.end={...c.start},i.start.offset===i.end.offset?Object.assign(i,c):(t.splice(n,0,["enter",c,e],["exit",c,e]),n+=2)}n++}return t}var ga={};Wp(ga,{attentionMarkers:()=>Gg,contentInitial:()=>Hg,disable:()=>Jg,document:()=>jg,flow:()=>Ug,flowInitial:()=>Wg,insideSpan:()=>Xg,string:()=>Kg,text:()=>Zg});var jg={42:Pe,43:Pe,45:Pe,48:Pe,49:Pe,50:Pe,51:Pe,52:Pe,53:Pe,54:Pe,55:Pe,56:Pe,57:Pe,62:yr},Hg={91:ua},Wg={[-2]:Oi,[-1]:Oi,32:Oi},Ug={35:da,42:wn,45:[Lr,wn],60:ha,61:Lr,95:wn,96:Sr,126:Sr},Kg={38:Er,92:kr},Zg={[-5]:Li,[-4]:Li,[-3]:Li,33:ma,38:Er,42:Ti,60:[sa,fa],91:pa,92:[ca,kr],93:xn,95:Ti,96:oa},Xg={null:[Ti,ul]},Gg={null:[42,95]},Jg={null:[]};function fl(t,e,n){let i={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},r={},s=[],o=[],a=[],u=!0,c={attempt:B(C),check:B(L),consume:y,enter:z,exit:k,interrupt:B(L,{interrupt:!0})},d={code:null,containerState:{},defineSkip:b,events:[],now:g,parser:t,previous:null,sliceSerialize:m,sliceStream:p,write:f},h=e.tokenize.call(d,c),l;return e.resolveAll&&s.push(e),d;function f(A){return o=Be(o,A),w(),o[o.length-1]!==null?[]:(E(e,0),d.events=Jt(s,d.events,d),d.events)}function m(A,W){return Yg(p(A),W)}function p(A){return Qg(o,A)}function g(){let{_bufferIndex:A,_index:W,line:U,column:le,offset:we}=i;return{_bufferIndex:A,_index:W,line:U,column:le,offset:we}}function b(A){r[A.line]=A.column,X()}function w(){let A;for(;i._index<o.length;){let W=o[i._index];if(typeof W=="string")for(A=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===A&&i._bufferIndex<W.length;)x(W.charCodeAt(i._bufferIndex));else x(W)}}function x(A){u=void 0,l=A,h=h(A)}function y(A){O(A)?(i.line++,i.column=1,i.offset+=A===-3?2:1,X()):A!==-1&&(i.column++,i.offset++),i._bufferIndex<0?i._index++:(i._bufferIndex++,i._bufferIndex===o[i._index].length&&(i._bufferIndex=-1,i._index++)),d.previous=A,u=!0}function z(A,W){let U=W||{};return U.type=A,U.start=g(),d.events.push(["enter",U,d]),a.push(U),U}function k(A){let W=a.pop();return W.end=g(),d.events.push(["exit",W,d]),W}function C(A,W){E(A,W.from)}function L(A,W){W.restore()}function B(A,W){return U;function U(le,we,gt){let st,v,zt,ln;return Array.isArray(le)?bt(le):"tokenize"in le?bt([le]):_(le);function _(Fe){return Mo;function Mo(hn){let hr=hn!==null&&Fe[hn],fr=hn!==null&&Fe.null,jp=[...Array.isArray(hr)?hr:hr?[hr]:[],...Array.isArray(fr)?fr:fr?[fr]:[]];return bt(jp)(hn)}}function bt(Fe){return st=Fe,v=0,Fe.length===0?gt:lr(Fe[v])}function lr(Fe){return Mo;function Mo(hn){return ln=re(),zt=Fe,Fe.partial||(d.currentConstruct=Fe),Fe.name&&d.parser.constructs.disable.null.includes(Fe.name)?gd(hn):Fe.tokenize.call(W?Object.assign(Object.create(d),W):d,c,Vp,gd)(hn)}}function Vp(Fe){return u=!0,A(zt,ln),we}function gd(Fe){return u=!0,ln.restore(),++v<st.length?lr(st[v]):gt}}}function E(A,W){A.resolveAll&&!s.includes(A)&&s.push(A),A.resolve&&Ee(d.events,W,d.events.length-W,A.resolve(d.events.slice(W),d)),A.resolveTo&&(d.events=A.resolveTo(d.events,d))}function re(){let A=g(),W=d.previous,U=d.currentConstruct,le=d.events.length,we=Array.from(a);return{from:le,restore:gt};function gt(){i=A,d.previous=W,d.currentConstruct=U,d.events.length=le,a=we,X()}}function X(){i.line in r&&i.column<2&&(i.column=r[i.line],i.offset+=r[i.line]-1)}}function Qg(t,e){let n=e.start._index,i=e.start._bufferIndex,r=e.end._index,s=e.end._bufferIndex,o;if(n===r)o=[t[n].slice(i,s)];else{if(o=t.slice(n,r),i>-1){let a=o[0];typeof a=="string"?o[0]=a.slice(i):o.shift()}s>0&&o.push(t[r].slice(0,s))}return o}function Yg(t,e){let n=-1,i=[],r;for(;++n<t.length;){let s=t[n],o;if(typeof s=="string")o=s;else switch(s){case-5:{o="\r";break}case-4:{o=`
`;break}case-3:{o=`\r
`;break}case-2:{o=e?" ":"	";break}case-1:{if(!e&&r)continue;o=" ";break}default:o=String.fromCharCode(s)}r=s===-2,i.push(o)}return i.join("")}function ba(t){let i={constructs:Xd([ga,...(t||{}).extensions||[]]),content:r(tl),defined:[],document:r(il),flow:r(al),lazy:{},string:r(cl),text:r(dl)};return i;function r(s){return o;function o(a){return fl(i,s,a)}}}function va(t){for(;!Cr(t););return t}var ml=/[\0\t\n\r]/g;function _a(){let t=1,e="",n=!0,i;return r;function r(s,o,a){let u=[],c,d,h,l,f;for(s=e+(typeof s=="string"?s.toString():new TextDecoder(o||void 0).decode(s)),h=0,e="",n&&(s.charCodeAt(0)===65279&&h++,n=void 0);h<s.length;){if(ml.lastIndex=h,c=ml.exec(s),l=c&&c.index!==void 0?c.index:s.length,f=s.charCodeAt(l),!c){e=s.slice(h);break}if(f===10&&h===l&&i)u.push(-3),i=void 0;else switch(i&&(u.push(-5),i=void 0),h<l&&(u.push(s.slice(h,l)),t+=l-h),f){case 0:{u.push(65533),t++;break}case 9:{for(d=Math.ceil(t/4)*4,u.push(-2);t++<d;)u.push(-1);break}case 10:{u.push(-4),t=1;break}default:i=!0,t=1}h=l+1}return a&&(i&&u.push(-5),e&&u.push(e),u.push(null)),u}}var gl=Up(pl(),1),Ii=Object.assign(yn(Error),{eval:yn(EvalError),range:yn(RangeError),reference:yn(ReferenceError),syntax:yn(SyntaxError),type:yn(TypeError),uri:yn(URIError)});function yn(t){return e.displayName=t.displayName||t.name,e;function e(n,...i){let r=n&&(0,gl.default)(n,...i);return new t(r)}}var Ir={}.hasOwnProperty,bl={yaml:"-",toml:"+"};function vl(t){let e=[],n=-1,i=Array.isArray(t)?t:t?[t]:["yaml"];for(;++n<i.length;)e[n]=eb(i[n]);return e}function eb(t){let e=t;if(typeof e=="string"){if(!Ir.call(bl,e))throw Ii("Missing matter definition for `%s`",e);e={type:e,marker:bl[e]}}else if(typeof e!="object")throw Ii("Expected matter to be an object, not `%j`",e);if(!Ir.call(e,"type"))throw Ii("Missing `type` in matter `%j`",e);if(!Ir.call(e,"fence")&&!Ir.call(e,"marker"))throw Ii("Missing `marker` or `fence` in matter `%j`",e);return e}function ya(t){let e=vl(t),n={},i=-1;for(;++i<e.length;){let r=e[i],s=wa(r,"open").charCodeAt(0),o=tb(r),a=n[s];Array.isArray(a)?a.push(o):n[s]=[o]}return{flow:n}}function tb(t){let e=t.anywhere,n=t.type,i=n+"Fence",r=i+"Sequence",s=n+"Value",o={tokenize:d,partial:!0},a,u=0;return{tokenize:c,concrete:!0};function c(h,l,f){let m=this;return p;function p(C){let L=m.now();return L.column===1&&(L.line===1||e)&&(a=wa(t,"open"),u=0,C===a.charCodeAt(u))?(h.enter(n),h.enter(i),h.enter(r),g(C)):f(C)}function g(C){return u===a.length?(h.exit(r),M(C)?(h.enter("whitespace"),b(C)):w(C)):C===a.charCodeAt(u++)?(h.consume(C),g):f(C)}function b(C){return M(C)?(h.consume(C),b):(h.exit("whitespace"),w(C))}function w(C){return O(C)?(h.exit(i),h.enter("lineEnding"),h.consume(C),h.exit("lineEnding"),a=wa(t,"close"),u=0,h.attempt(o,k,x)):f(C)}function x(C){return C===null||O(C)?z(C):(h.enter(s),y(C))}function y(C){return C===null||O(C)?(h.exit(s),z(C)):(h.consume(C),y)}function z(C){return C===null?f(C):(h.enter("lineEnding"),h.consume(C),h.exit("lineEnding"),h.attempt(o,k,x))}function k(C){return h.exit(n),l(C)}}function d(h,l,f){let m=0;return p;function p(x){return x===a.charCodeAt(m)?(h.enter(i),h.enter(r),g(x)):f(x)}function g(x){return m===a.length?(h.exit(r),M(x)?(h.enter("whitespace"),b(x)):w(x)):x===a.charCodeAt(m++)?(h.consume(x),g):f(x)}function b(x){return M(x)?(h.consume(x),b):(h.exit("whitespace"),w(x))}function w(x){return x===null||O(x)?(h.exit(i),l(x)):f(x)}}}function wa(t,e){return t.marker?_l(t.marker,e).repeat(3):_l(t.fence,e)}function _l(t,e){return typeof t=="string"?t:t[e]}var wl={tokenize:nb,concrete:!0,name:"mathFlow"},xl={tokenize:ib,partial:!0};function nb(t,e,n){let i=this,r=i.events[i.events.length-1],s=r&&r[1].type==="linePrefix"?r[2].sliceSerialize(r[1],!0).length:0,o=0;return a;function a(w){return t.enter("mathFlow"),t.enter("mathFlowFence"),t.enter("mathFlowFenceSequence"),u(w)}function u(w){return w===36?(t.consume(w),o++,u):o<2?n(w):(t.exit("mathFlowFenceSequence"),P(t,c,"whitespace")(w))}function c(w){return w===null||O(w)?h(w):(t.enter("mathFlowFenceMeta"),t.enter("chunkString",{contentType:"string"}),d(w))}function d(w){return w===null||O(w)?(t.exit("chunkString"),t.exit("mathFlowFenceMeta"),h(w)):w===36?n(w):(t.consume(w),d)}function h(w){return t.exit("mathFlowFence"),i.interrupt?e(w):t.attempt(xl,l,g)(w)}function l(w){return t.attempt({tokenize:b,partial:!0},g,f)(w)}function f(w){return(s?P(t,m,"linePrefix",s+1):m)(w)}function m(w){return w===null?g(w):O(w)?t.attempt(xl,l,g)(w):(t.enter("mathFlowValue"),p(w))}function p(w){return w===null||O(w)?(t.exit("mathFlowValue"),m(w)):(t.consume(w),p)}function g(w){return t.exit("mathFlow"),e(w)}function b(w,x,y){let z=0;return P(w,k,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function k(B){return w.enter("mathFlowFence"),w.enter("mathFlowFenceSequence"),C(B)}function C(B){return B===36?(z++,w.consume(B),C):z<o?y(B):(w.exit("mathFlowFenceSequence"),P(w,L,"whitespace")(B))}function L(B){return B===null||O(B)?(w.exit("mathFlowFence"),x(B)):y(B)}}}function ib(t,e,n){let i=this;return r;function r(o){return o===null?e(o):(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),s)}function s(o){return i.parser.lazy[i.now().line]?n(o):e(o)}}function yl(t){let n=(t||{}).singleDollarTextMath;return n==null&&(n=!0),{tokenize:i,resolve:rb,previous:sb,name:"mathText"};function i(r,s,o){let a=this,u=0,c,d;return h;function h(g){return r.enter("mathText"),r.enter("mathTextSequence"),l(g)}function l(g){return g===36?(r.consume(g),u++,l):u<2&&!n?o(g):(r.exit("mathTextSequence"),f(g))}function f(g){return g===null?o(g):g===36?(d=r.enter("mathTextSequence"),c=0,p(g)):g===32?(r.enter("space"),r.consume(g),r.exit("space"),f):O(g)?(r.enter("lineEnding"),r.consume(g),r.exit("lineEnding"),f):(r.enter("mathTextData"),m(g))}function m(g){return g===null||g===32||g===36||O(g)?(r.exit("mathTextData"),f(g)):(r.consume(g),m)}function p(g){return g===36?(r.consume(g),c++,p):c===u?(r.exit("mathTextSequence"),r.exit("mathText"),s(g)):(d.type="mathTextData",m(g))}}}function rb(t){let e=t.length-4,n=3,i,r;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(i=n;++i<e;)if(t[i][1].type==="mathTextData"){t[e][1].type="mathTextPadding",t[n][1].type="mathTextPadding",n+=2,e-=2;break}}for(i=n-1,e++;++i<=e;)r===void 0?i!==e&&t[i][1].type!=="lineEnding"&&(r=i):(i===e||t[i][1].type==="lineEnding")&&(t[r][1].type="mathTextData",i!==r+2&&(t[r][1].end=t[i-1][1].end,t.splice(r+2,i-r-2),e-=i-r-2,i=r+2),r=void 0);return t}function sb(t){return t!==36||this.events[this.events.length-1][1].type==="characterEscape"}function ka(t){return{flow:{36:wl},text:{36:yl(t)}}}var Mr=class{constructor(){this.map=[]}add(e,n,i){ob(this,e,n,i)}consume(e){if(this.map.sort(function(s,o){return s[0]-o[0]}),this.map.length===0)return;let n=this.map.length,i=[];for(;n>0;)n-=1,i.push(e.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),e.length=this.map[n][0];i.push(e.slice()),e.length=0;let r=i.pop();for(;r;){for(let s of r)e.push(s);r=i.pop()}this.map.length=0}};function ob(t,e,n,i){let r=0;if(!(n===0&&i.length===0)){for(;r<t.map.length;){if(t.map[r][0]===e){t.map[r][1]+=n,t.map[r][2].push(...i);return}r+=1}t.map.push([e,n,i])}}function kl(t,e){let n=!1,i=[];for(;e<t.length;){let r=t[e];if(n){if(r[0]==="enter")r[1].type==="tableContent"&&i.push(t[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(r[1].type==="tableContent"){if(t[e-1][1].type==="tableDelimiterMarker"){let s=i.length-1;i[s]=i[s]==="left"?"center":"right"}}else if(r[1].type==="tableDelimiterRow")break}else r[0]==="enter"&&r[1].type==="tableDelimiterRow"&&(n=!0);e+=1}return i}function Ea(){return{flow:{null:{name:"table",tokenize:ab,resolveAll:ub}}}}function ab(t,e,n){let i=this,r=0,s=0,o;return a;function a(E){let re=i.events.length-1;for(;re>-1;){let W=i.events[re][1].type;if(W==="lineEnding"||W==="linePrefix")re--;else break}let X=re>-1?i.events[re][1].type:null,A=X==="tableHead"||X==="tableRow"?k:u;return A===k&&i.parser.lazy[i.now().line]?n(E):A(E)}function u(E){return t.enter("tableHead"),t.enter("tableRow"),c(E)}function c(E){return E===124||(o=!0,s+=1),d(E)}function d(E){return E===null?n(E):O(E)?s>1?(s=0,i.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(E),t.exit("lineEnding"),f):n(E):M(E)?P(t,d,"whitespace")(E):(s+=1,o&&(o=!1,r+=1),E===124?(t.enter("tableCellDivider"),t.consume(E),t.exit("tableCellDivider"),o=!0,d):(t.enter("data"),h(E)))}function h(E){return E===null||E===124||ae(E)?(t.exit("data"),d(E)):(t.consume(E),E===92?l:h)}function l(E){return E===92||E===124?(t.consume(E),h):h(E)}function f(E){return i.interrupt=!1,i.parser.lazy[i.now().line]?n(E):(t.enter("tableDelimiterRow"),o=!1,M(E)?P(t,m,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(E):m(E))}function m(E){return E===45||E===58?g(E):E===124?(o=!0,t.enter("tableCellDivider"),t.consume(E),t.exit("tableCellDivider"),p):z(E)}function p(E){return M(E)?P(t,g,"whitespace")(E):g(E)}function g(E){return E===58?(s+=1,o=!0,t.enter("tableDelimiterMarker"),t.consume(E),t.exit("tableDelimiterMarker"),b):E===45?(s+=1,b(E)):E===null||O(E)?y(E):z(E)}function b(E){return E===45?(t.enter("tableDelimiterFiller"),w(E)):z(E)}function w(E){return E===45?(t.consume(E),w):E===58?(o=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(E),t.exit("tableDelimiterMarker"),x):(t.exit("tableDelimiterFiller"),x(E))}function x(E){return M(E)?P(t,y,"whitespace")(E):y(E)}function y(E){return E===124?m(E):E===null||O(E)?!o||r!==s?z(E):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(E)):z(E)}function z(E){return n(E)}function k(E){return t.enter("tableRow"),C(E)}function C(E){return E===124?(t.enter("tableCellDivider"),t.consume(E),t.exit("tableCellDivider"),C):E===null||O(E)?(t.exit("tableRow"),e(E)):M(E)?P(t,C,"whitespace")(E):(t.enter("data"),L(E))}function L(E){return E===null||E===124||ae(E)?(t.exit("data"),C(E)):(t.consume(E),E===92?B:L)}function B(E){return E===92||E===124?(t.consume(E),L):L(E)}}function ub(t,e){let n=-1,i=!0,r=0,s=[0,0,0,0],o=[0,0,0,0],a=!1,u=0,c,d,h,l=new Mr;for(;++n<t.length;){let f=t[n],m=f[1];f[0]==="enter"?m.type==="tableHead"?(a=!1,u!==0&&(El(l,e,u,c,d),d=void 0,u=0),c={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},l.add(n,0,[["enter",c,e]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(i=!0,h=void 0,s=[0,0,0,0],o=[0,n+1,0,0],a&&(a=!1,d={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},l.add(n,0,[["enter",d,e]])),r=m.type==="tableDelimiterRow"?2:d?3:1):r&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")?(i=!1,o[2]===0&&(s[1]!==0&&(o[0]=o[1],h=Nr(l,e,s,r,void 0,h),s=[0,0,0,0]),o[2]=n)):m.type==="tableCellDivider"&&(i?i=!1:(s[1]!==0&&(o[0]=o[1],h=Nr(l,e,s,r,void 0,h)),s=o,o=[s[1],n,0,0])):m.type==="tableHead"?(a=!0,u=n):m.type==="tableRow"||m.type==="tableDelimiterRow"?(u=n,s[1]!==0?(o[0]=o[1],h=Nr(l,e,s,r,n,h)):o[1]!==0&&(h=Nr(l,e,o,r,n,h)),r=0):r&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(o[3]=n)}for(u!==0&&El(l,e,u,c,d),l.consume(e.events),n=-1;++n<e.events.length;){let f=e.events[n];f[0]==="enter"&&f[1].type==="table"&&(f[1]._align=kl(e.events,n))}return t}function Nr(t,e,n,i,r,s){let o=i===1?"tableHeader":i===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(s.end=Object.assign({},Vn(e.events,n[0])),t.add(n[0],0,[["exit",s,e]]));let u=Vn(e.events,n[1]);if(s={type:o,start:Object.assign({},u),end:Object.assign({},u)},t.add(n[1],0,[["enter",s,e]]),n[2]!==0){let c=Vn(e.events,n[2]),d=Vn(e.events,n[3]),h={type:a,start:Object.assign({},c),end:Object.assign({},d)};if(t.add(n[2],0,[["enter",h,e]]),i!==2){let l=e.events[n[2]],f=e.events[n[3]];if(l[1].end=Object.assign({},f[1].end),l[1].type="chunkText",l[1].contentType="text",n[3]>n[2]+1){let m=n[2]+1,p=n[3]-n[2]-1;t.add(m,p,[])}}t.add(n[3]+1,0,[["exit",h,e]])}return r!==void 0&&(s.end=Object.assign({},Vn(e.events,r)),t.add(r,0,[["exit",s,e]]),s=void 0),s}function El(t,e,n,i,r){let s=[],o=Vn(e.events,n);r&&(r.end=Object.assign({},o),s.push(["exit",r,e])),i.end=Object.assign({},o),s.push(["exit",i,e]),t.add(n+1,0,s)}function Vn(t,e){let n=t[e],i=n[0]==="enter"?"start":"end";return n[1][i]}var cb={name:"tasklistCheck",tokenize:db};function Sa(){return{text:{91:cb}}}function db(t,e,n){let i=this;return r;function r(u){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?n(u):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(u),t.exit("taskListCheckMarker"),s)}function s(u){return ae(u)?(t.enter("taskListCheckValueUnchecked"),t.consume(u),t.exit("taskListCheckValueUnchecked"),o):u===88||u===120?(t.enter("taskListCheckValueChecked"),t.consume(u),t.exit("taskListCheckValueChecked"),o):n(u)}function o(u){return u===93?(t.enter("taskListCheckMarker"),t.consume(u),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),a):n(u)}function a(u){return O(u)?e(u):M(u)?t.check({tokenize:lb},e,n)(u):n(u)}}function lb(t,e,n){return P(t,i,"whitespace");function i(r){return r===null?n(r):e(r)}}function za(t){let n=(t||{}).singleTilde,i={name:"strikethrough",tokenize:s,resolveAll:r};return n==null&&(n=!0),{text:{126:i},insideSpan:{null:[i]},attentionMarkers:{null:[126]}};function r(o,a){let u=-1;for(;++u<o.length;)if(o[u][0]==="enter"&&o[u][1].type==="strikethroughSequenceTemporary"&&o[u][1]._close){let c=u;for(;c--;)if(o[c][0]==="exit"&&o[c][1].type==="strikethroughSequenceTemporary"&&o[c][1]._open&&o[u][1].end.offset-o[u][1].start.offset===o[c][1].end.offset-o[c][1].start.offset){o[u][1].type="strikethroughSequence",o[c][1].type="strikethroughSequence";let d={type:"strikethrough",start:Object.assign({},o[c][1].start),end:Object.assign({},o[u][1].end)},h={type:"strikethroughText",start:Object.assign({},o[c][1].end),end:Object.assign({},o[u][1].start)},l=[["enter",d,a],["enter",o[c][1],a],["exit",o[c][1],a],["enter",h,a]],f=a.parser.constructs.insideSpan.null;f&&Ee(l,l.length,0,Jt(f,o.slice(c+1,u),a)),Ee(l,l.length,0,[["exit",h,a],["enter",o[u][1],a],["exit",o[u][1],a],["exit",d,a]]),Ee(o,c-1,u-c+3,l),u=c+l.length-2;break}}for(u=-1;++u<o.length;)o[u][1].type==="strikethroughSequenceTemporary"&&(o[u][1].type="data");return o}function s(o,a,u){let c=this.previous,d=this.events,h=0;return l;function l(m){return c===126&&d[d.length-1][1].type!=="characterEscape"?u(m):(o.enter("strikethroughSequenceTemporary"),f(m))}function f(m){let p=qn(c);if(m===126)return h>1?u(m):(o.consume(m),h++,f);if(h<2&&!n)return u(m);let g=o.exit("strikethroughSequenceTemporary"),b=qn(m);return g._open=!b||b===2&&!!p,g._close=!p||p===2&&!!b,a(m)}}}var Z=class t{start;endExclusive;static ofLength(e){return new t(0,e)}static ofStartAndLength(e,n){return new t(e,e+n)}constructor(e,n){if(this.start=e,this.endExclusive=n,e>n)throw new Error(`Invalid range: [${e}, ${n})`)}get isEmpty(){return this.start===this.endExclusive}get length(){return this.endExclusive-this.start}delta(e){return new t(this.start+e,this.endExclusive+e)}deltaStart(e){return new t(this.start+e,this.endExclusive)}deltaEnd(e){return new t(this.start,this.endExclusive+e)}equals(e){return this.start===e.start&&this.endExclusive===e.endExclusive}containsRange(e){return this.start<=e.start&&e.endExclusive<=this.endExclusive}contains(e){return this.start<=e&&e<this.endExclusive}join(e){return new t(Math.min(this.start,e.start),Math.max(this.endExclusive,e.endExclusive))}intersect(e){let n=Math.max(this.start,e.start),i=Math.min(this.endExclusive,e.endExclusive);if(n<=i)return new t(n,i)}intersects(e){let n=Math.max(this.start,e.start),i=Math.min(this.endExclusive,e.endExclusive);return n<i}intersectsOrTouches(e){let n=Math.max(this.start,e.start),i=Math.min(this.endExclusive,e.endExclusive);return n<=i}slice(e){return e.slice(this.start,this.endExclusive)}toString(){return`[${this.start}, ${this.endExclusive})`}},Oa=class{original;modified;constructor(e,n){this.original=e,this.modified=n}toString(){return`${this.original} <-> ${this.modified}`}},Sn=class{range;newText;constructor(e,n){this.range=e,this.newText=n}get isEmpty(){return this.range.isEmpty&&this.newText.length===0}toString(){return`${this.range}->${JSON.stringify(this.newText)}`}},$r=class t{replacements;static empty=new t([]);static single(e){return new t([e])}static of(e){for(let n=1;n<e.length;n++){let i=e[n-1],r=e[n];if(i.range.endExclusive>r.range.start)throw new Error(`StringEdit.of: replacements must be sorted and non-overlapping (${i.range} vs ${r.range})`)}return new t(e)}constructor(e){this.replacements=e}get isEmpty(){return this.replacements.length===0}apply(e){if(this.replacements.length===0)return e;let n=[],i=0;for(let r of this.replacements)n.push(e.substring(i,r.range.start)),n.push(r.newText),i=r.range.endExclusive;return n.push(e.substring(i)),n.join("")}inverse(e){let n=[],i=0;for(let r of this.replacements){let s=r.range.start+i,o=s+r.newText.length,a=e.substring(r.range.start,r.range.endExclusive);n.push(new Sn(new Z(s,o),a)),i+=r.newText.length-r.range.length}return new t(n)}normalize(){let e=[];for(let n of this.replacements){if(n.isEmpty)continue;let i=e[e.length-1];i&&i.range.endExclusive===n.range.start?e[e.length-1]=new Sn(new Z(i.range.start,n.range.endExclusive),i.newText+n.newText):e.push(n)}return new t(e)}toString(){return`StringEdit[${this.replacements.map(e=>e.toString()).join(", ")}]`}},En=class{range;newText;data;constructor(e,n,i){this.range=e,this.newText=n,this.data=i}get isEmpty(){return this.range.isEmpty&&this.newText.length===0}toString(){return`${this.range}->${JSON.stringify(this.newText)}#${this.data}`}},Ra=class t{replacements;static empty(){return new t([])}static single(e){return new t([e])}static of(e){for(let n=1;n<e.length;n++){let i=e[n-1],r=e[n];if(i.range.endExclusive>r.range.start)throw new Error(`AnnotatedStringEdit.of: replacements must be sorted and non-overlapping (${i.range} vs ${r.range})`)}return new t(e)}constructor(e){this.replacements=e}get isEmpty(){return this.replacements.length===0}apply(e){if(this.replacements.length===0)return e;let n=[],i=0;for(let r of this.replacements)n.push(e.substring(i,r.range.start)),n.push(r.newText),i=r.range.endExclusive;return n.push(e.substring(i)),n.join("")}inverse(e,n){let i=[],r=0;for(let s of this.replacements){let o=s.range.start+r,a=o+s.newText.length,u=e.substring(s.range.start,s.range.endExclusive);i.push(new En(new Z(o,a),u,n(s.data))),r+=s.newText.length-s.range.length}return new t(i)}normalize(){let e=[];for(let n of this.replacements){if(n.isEmpty)continue;let i=e[e.length-1];if(i&&i.range.endExclusive===n.range.start){let r=i.data.join(n.data);if(r!==void 0){e[e.length-1]=new En(new Z(i.range.start,n.range.endExclusive),i.newText+n.newText,r);continue}}e.push(n)}return new t(e)}mapData(e){return new t(this.replacements.map(n=>new En(n.range,n.newText,e(n.data))))}stripData(){return $r.of(this.replacements.map(e=>new Sn(e.range,e.newText)))}toString(){return`AnnotatedStringEdit[${this.replacements.map(e=>e.toString()).join(", ")}]`}},Br=class t{isFormattingChange;static change=new t(!1);static formatting=new t(!0);constructor(e){this.isFormattingChange=e}join(e){if(this.isFormattingChange===e.isFormattingChange)return this}toString(){return this.isFormattingChange?"formatting":"change"}},La=class{range;innerEdit;constructor(e,n){this.range=e,this.innerEdit=n}toString(){return`Move ${this.range}`+(this.innerEdit.isEmpty?"":` (${this.innerEdit})`)}},Ia=class{edits;moves;hitTimeout;constructor(e,n,i){this.edits=e,this.moves=n,this.hitTimeout=i}},Fi=class t{static instance=new t;isValid(){return!0}},Ma=class{timeout;startTime=Date.now();valid=!0;constructor(e){if(this.timeout=e,e<=0)throw new Error("timeout must be positive")}isValid(){return!(Date.now()-this.startTime<this.timeout)&&this.valid&&(this.valid=!1),this.valid}},Dt=class t{offset1;offset2;static zero=new t(0,0);static max=new t(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER);constructor(e,n){this.offset1=e,this.offset2=n}toString(){return`${this.offset1} <-> ${this.offset2}`}delta(e){return e===0?this:new t(this.offset1+e,this.offset2+e)}equals(e){return this.offset1===e.offset1&&this.offset2===e.offset2}},Ze=class t{seq1Range;seq2Range;static invert(e,n){let i=[];return hb(e,(r,s)=>{i.push(t.fromOffsetPairs(r?r.getEndExclusives():Dt.zero,s?s.getStarts():new Dt(n,(r?r.seq2Range.endExclusive-r.seq1Range.endExclusive:0)+n)))}),i}static fromOffsetPairs(e,n){return new t(new Z(e.offset1,n.offset1),new Z(e.offset2,n.offset2))}static assertSorted(e){let n;for(let i of e){if(n&&!(n.seq1Range.endExclusive<=i.seq1Range.start&&n.seq2Range.endExclusive<=i.seq2Range.start))throw new Error("Sequence diffs must be sorted");n=i}}constructor(e,n){this.seq1Range=e,this.seq2Range=n}swap(){return new t(this.seq2Range,this.seq1Range)}toString(){return`${this.seq1Range} <-> ${this.seq2Range}`}join(e){return new t(this.seq1Range.join(e.seq1Range),this.seq2Range.join(e.seq2Range))}delta(e){return e===0?this:new t(this.seq1Range.delta(e),this.seq2Range.delta(e))}deltaStart(e){return e===0?this:new t(this.seq1Range.deltaStart(e),this.seq2Range.deltaStart(e))}deltaEnd(e){return e===0?this:new t(this.seq1Range.deltaEnd(e),this.seq2Range.deltaEnd(e))}intersectsOrTouches(e){return this.seq1Range.intersectsOrTouches(e.seq1Range)||this.seq2Range.intersectsOrTouches(e.seq2Range)}intersect(e){let n=this.seq1Range.intersect(e.seq1Range),i=this.seq2Range.intersect(e.seq2Range);if(!(!n||!i))return new t(n,i)}getStarts(){return new Dt(this.seq1Range.start,this.seq2Range.start)}getEndExclusives(){return new Dt(this.seq1Range.endExclusive,this.seq2Range.endExclusive)}},en=class t{diffs;hitTimeout;static trivial(e,n){return new t([new Ze(Z.ofLength(e.length),Z.ofLength(n.length))],!1)}static trivialTimedOut(e,n){return new t([new Ze(Z.ofLength(e.length),Z.ofLength(n.length))],!0)}constructor(e,n){this.diffs=e,this.hitTimeout=n}};function hb(t,e){let n;for(let i of t)e(n,i),n=i;e(n,void 0)}var Ni=class{width;height;array=[];constructor(e,n){this.width=e,this.height=n,this.array=new Array(e*n)}get(e,n){return this.array[e+n*this.width]}set(e,n,i){this.array[e+n*this.width]=i}},Na=class{compute(e,n,i=Fi.instance,r){if(e.length===0||n.length===0)return en.trivial(e,n);let s=new Ni(e.length,n.length),o=new Ni(e.length,n.length),a=new Ni(e.length,n.length);for(let m=0;m<e.length;m++)for(let p=0;p<n.length;p++){if(!i.isValid())return en.trivialTimedOut(e,n);let g=m===0?0:s.get(m-1,p),b=p===0?0:s.get(m,p-1),w;e.getElement(m)===n.getElement(p)?(m===0||p===0?w=0:w=s.get(m-1,p-1),m>0&&p>0&&o.get(m-1,p-1)===3&&(w+=a.get(m-1,p-1)),w+=r?r(m,p):1):w=-1;let x=Math.max(g,b,w);if(x===w){let y=m>0&&p>0?a.get(m-1,p-1):0;a.set(m,p,y+1),o.set(m,p,3)}else x===g?(a.set(m,p,0),o.set(m,p,1)):x===b&&(a.set(m,p,0),o.set(m,p,2));s.set(m,p,x)}let u=[],c=e.length,d=n.length;function h(m,p){(m+1!==c||p+1!==d)&&u.push(new Ze(new Z(m+1,c),new Z(p+1,d))),c=m,d=p}let l=e.length-1,f=n.length-1;for(;l>=0&&f>=0;)o.get(l,f)===3?(h(l,f),l--,f--):o.get(l,f)===1?l--:f--;return h(-1,-1),u.reverse(),new en(u,!1)}},Aa=class{compute(e,n,i=Fi.instance){if(e.length===0||n.length===0)return en.trivial(e,n);let r=e,s=n;function o(p,g){for(;p<r.length&&g<s.length&&r.getElement(p)===s.getElement(g);)p++,g++;return p}let a=0,u=new Pa;u.set(0,o(0,0));let c=new Fa;c.set(0,u.get(0)===0?null:new Dr(null,0,0,u.get(0)));let d=0;e:for(;;){if(a++,!i.isValid())return en.trivialTimedOut(r,s);let p=-Math.min(a,s.length+a%2),g=Math.min(a,r.length+a%2);for(d=p;d<=g;d+=2){let b=d===g?-1:u.get(d+1),w=d===p?-1:u.get(d-1)+1,x=Math.min(Math.max(b,w),r.length),y=x-d;if(x>r.length||y>s.length)continue;let z=o(x,y);u.set(d,z);let k=x===b?c.get(d+1):c.get(d-1);if(c.set(d,z!==x?new Dr(k,x,y,z-x):k),u.get(d)===r.length&&u.get(d)-d===s.length)break e}}let h=c.get(d),l=[],f=r.length,m=s.length;for(;;){let p=h?h.x+h.length:0,g=h?h.y+h.length:0;if((p!==f||g!==m)&&l.push(new Ze(new Z(p,f),new Z(g,m))),!h)break;f=h.x,m=h.y,h=h.prev}return l.reverse(),new en(l,!1)}},Dr=class{prev;x;y;length;constructor(e,n,i,r){this.prev=e,this.x=n,this.y=i,this.length=r}},Pa=class{positiveArr=new Int32Array(10);negativeArr=new Int32Array(10);get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,n){if(e<0){if(e=-e-1,e>=this.negativeArr.length){let i=this.negativeArr;this.negativeArr=new Int32Array(i.length*2),this.negativeArr.set(i)}this.negativeArr[e]=n}else{if(e>=this.positiveArr.length){let i=this.positiveArr;this.positiveArr=new Int32Array(i.length*2),this.positiveArr.set(i)}this.positiveArr[e]=n}}},Fa=class{positiveArr=[];negativeArr=[];get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,n){e<0?(e=-e-1,this.negativeArr[e]=n):this.positiveArr[e]=n}};function Sl(t,e,n){let i=n;return i=zl(t,e,i),i=zl(t,e,i),i=fb(t,e,i),i}function zl(t,e,n){if(n.length===0)return n;let i=[];i.push(n[0]);for(let s=1;s<n.length;s++){let o=i[i.length-1],a=n[s];if(a.seq1Range.isEmpty||a.seq2Range.isEmpty){let u=a.seq1Range.start-o.seq1Range.endExclusive,c;for(c=1;c<=u&&!(t.getElement(a.seq1Range.start-c)!==t.getElement(a.seq1Range.endExclusive-c)||e.getElement(a.seq2Range.start-c)!==e.getElement(a.seq2Range.endExclusive-c));c++);if(c--,c===u){i[i.length-1]=new Ze(new Z(o.seq1Range.start,a.seq1Range.endExclusive-u),new Z(o.seq2Range.start,a.seq2Range.endExclusive-u));continue}a=a.delta(-c)}i.push(a)}let r=[];for(let s=0;s<i.length-1;s++){let o=i[s+1],a=i[s];if(a.seq1Range.isEmpty||a.seq2Range.isEmpty){let u=o.seq1Range.start-a.seq1Range.endExclusive,c;for(c=0;c<u&&!(!t.isStronglyEqual(a.seq1Range.start+c,a.seq1Range.endExclusive+c)||!e.isStronglyEqual(a.seq2Range.start+c,a.seq2Range.endExclusive+c));c++);if(c===u){i[s+1]=new Ze(new Z(a.seq1Range.start+u,o.seq1Range.endExclusive),new Z(a.seq2Range.start+u,o.seq2Range.endExclusive));continue}c>0&&(a=a.delta(c))}r.push(a)}return i.length>0&&r.push(i[i.length-1]),r}function fb(t,e,n){if(!t.getBoundaryScore||!e.getBoundaryScore)return n;for(let i=0;i<n.length;i++){let r=i>0?n[i-1]:void 0,s=n[i],o=i+1<n.length?n[i+1]:void 0,a=new Z(r?r.seq1Range.endExclusive+1:0,o?o.seq1Range.start-1:t.length),u=new Z(r?r.seq2Range.endExclusive+1:0,o?o.seq2Range.start-1:e.length);s.seq1Range.isEmpty?n[i]=Cl(s,t,e,a,u):s.seq2Range.isEmpty&&(n[i]=Cl(s.swap(),e,t,u,a).swap())}return n}function Cl(t,e,n,i,r){let o=1;for(;t.seq1Range.start-o>=i.start&&t.seq2Range.start-o>=r.start&&n.isStronglyEqual(t.seq2Range.start-o,t.seq2Range.endExclusive-o)&&o<100;)o++;o--;let a=0;for(;t.seq1Range.start+a<i.endExclusive&&t.seq2Range.endExclusive+a<r.endExclusive&&n.isStronglyEqual(t.seq2Range.start+a,t.seq2Range.endExclusive+a)&&a<100;)a++;if(o===0&&a===0)return t;let u=0,c=-1;for(let d=-o;d<=a;d++){let h=t.seq2Range.start+d,l=t.seq2Range.endExclusive+d,f=t.seq1Range.start+d,m=e.getBoundaryScore(f)+n.getBoundaryScore(h)+n.getBoundaryScore(l);m>c&&(c=m,u=d)}return t.delta(u)}function mb(t,e,n){let i=[];for(let r of n){let s=i[i.length-1];if(!s){i.push(r);continue}r.seq1Range.start-s.seq1Range.endExclusive<=2||r.seq2Range.start-s.seq2Range.endExclusive<=2?i[i.length-1]=new Ze(s.seq1Range.join(r.seq1Range),s.seq2Range.join(r.seq2Range)):i.push(r)}return i}function Tl(t,e,n,i,r=!1){let s=Ze.invert(n,t.length),o=[],a=new Dt(0,0);function u(d,h){if(d.offset1<a.offset1||d.offset2<a.offset2)return;let l=i(t,d.offset1),f=i(e,d.offset2);if(!l||!f)return;let m=new Ze(l,f),p=m.intersect(h),g=p.seq1Range.length,b=p.seq2Range.length;for(;s.length>0;){let w=s[0];if(!(w.seq1Range.intersects(m.seq1Range)||w.seq2Range.intersects(m.seq2Range)))break;let y=i(t,w.seq1Range.start),z=i(e,w.seq2Range.start),k=new Ze(y,z),C=k.intersect(w);if(g+=C.seq1Range.length,b+=C.seq2Range.length,m=m.join(k),m.seq1Range.endExclusive>=w.seq1Range.endExclusive)s.shift();else break}(r&&g+b<m.seq1Range.length+m.seq2Range.length||g+b<(m.seq1Range.length+m.seq2Range.length)*2/3)&&o.push(m),a=m.getEndExclusives()}for(;s.length>0;){let d=s.shift();d.seq1Range.isEmpty||(u(d.getStarts(),d),u(d.getEndExclusives().delta(-1),d))}return pb(n,o)}function pb(t,e){let n=[];for(;t.length>0||e.length>0;){let i=t[0],r=e[0],s;i&&(!r||i.seq1Range.start<r.seq1Range.start)?s=t.shift():s=e.shift(),n.length>0&&n[n.length-1].seq1Range.endExclusive>=s.seq1Range.start?n[n.length-1]=n[n.length-1].join(s):n.push(s)}return n}function gb(t,e,n){let i=n;if(i.length===0)return i;let r=0,s;do{s=!1;let o=[i[0]];for(let a=1;a<i.length;a++){let d=function(l,f){let m=new Z(c.seq1Range.endExclusive,u.seq1Range.start);return t.getText(m).replace(/\s/g,"").length<=4&&(l.seq1Range.length+l.seq2Range.length>5||f.seq1Range.length+f.seq2Range.length>5)},u=i[a],c=o[o.length-1];d(c,u)?(s=!0,o[o.length-1]=o[o.length-1].join(u)):o.push(u)}i=o}while(r++<10&&s);return i}function bb(t,e,n){`${JSON.stringify(n.map(a=>a.toString()))}`;let i=n;if(i.length===0)return i;let r=0,s;do{s=!1;let a=[i[0]];for(let u=1;u<i.length;u++){let h=function(f,m){let p=new Z(d.seq1Range.endExclusive,c.seq1Range.start);if(t.countLinesIn(p)>5||p.length>500)return!1;let b=t.getText(p).trim();if(b.length>20||b.split(/\r\n|\r|\n/).length>1)return!1;let w=t.countLinesIn(f.seq1Range),x=f.seq1Range.length,y=e.countLinesIn(f.seq2Range),z=f.seq2Range.length,k=t.countLinesIn(m.seq1Range),C=m.seq1Range.length,L=e.countLinesIn(m.seq2Range),B=m.seq2Range.length,E=130;function re(X){return Math.min(X,E)}return Math.pow(Math.pow(re(w*40+x),1.5)+Math.pow(re(y*40+z),1.5),1.5)+Math.pow(Math.pow(re(k*40+C),1.5)+Math.pow(re(L*40+B),1.5),1.5)>(E**1.5)**1.5*1.3},c=i[u],d=a[a.length-1];h(d,c)?(s=!0,a[a.length-1]=a[a.length-1].join(c)):a.push(c)}i=a}while(r++<10&&s);`${JSON.stringify(i.map(a=>a.toString()))}`;let o=[];return vb(i,(a,u,c)=>{`${u.toString()}${a?.toString()}${c?.toString()}`;let d=u;function h(b){return b.length>0&&b.trim().length<=3&&u.seq1Range.length+u.seq2Range.length>100}let l=t.extendToFullLines(u.seq1Range);`${l.toString()}${u.seq1Range.toString()}`;let f=t.getText(new Z(l.start,u.seq1Range.start));`${f}${f.length}`,f.length>0&&f.trim().length<=3&&u.seq1Range.length+u.seq2Range.length>100,h(f)&&(`${d.toString()}`,-f.length,d=d.deltaStart(-f.length),`${d.toString()}`,void 0);let m=t.getText(new Z(u.seq1Range.endExclusive,l.endExclusive));`${m}${m.length}`,m.length>0&&m.trim().length<=3&&u.seq1Range.length+u.seq2Range.length>100,h(m)&&(`${d.toString()}${m.length}`,d=d.deltaEnd(m.length),`${d.toString()}`,void 0);let p=Ze.fromOffsetPairs(a?a.getEndExclusives():Dt.zero,c?c.getStarts():Dt.max);`${p.toString()}${d.toString()}`;let g=d.intersect(p);`${g?.toString()}`,o.length>0&&g.getStarts().equals(o[o.length-1].getEndExclusives())?o[o.length-1]=o[o.length-1].join(g):o.push(g)}),o}function vb(t,e){for(let n=0;n<t.length;n++)e(t[n-1],t[n],t[n+1])}var Ol={Space:32,Tab:9},qr=class{trimmedHash;lines;constructor(e,n){this.trimmedHash=e,this.lines=n}getElement(e){return this.trimmedHash[e]}get length(){return this.trimmedHash.length}getBoundaryScore(e){let n=e===0?0:Rl(this.lines[e-1]),i=e===this.lines.length?0:Rl(this.lines[e]);return 1e3-(n+i)}getText(e){return this.lines.slice(e.start,e.endExclusive).join(`
`)}isStronglyEqual(e,n){return this.lines[e]===this.lines[n]}};function Rl(t){let e=0;for(;e<t.length&&(t.charCodeAt(e)===Ol.Space||t.charCodeAt(e)===Ol.Tab);)e++;return e}var ze={LineFeed:10,CarriageReturn:13,Space:32,Tab:9,a:97,z:122,A:65,Z:90,Digit0:48,Digit9:57,Comma:44,Semicolon:59};function _b(t){return t===ze.Space||t===ze.Tab}var Ke=class t{startLineNumber;startColumn;endLineNumber;endColumn;constructor(e,n,i,r){this.startLineNumber=e,this.startColumn=n,this.endLineNumber=i,this.endColumn=r}static fromPositions(e,n){return new t(e.lineNumber,e.column,n.lineNumber,n.column)}},Bt=class{lineNumber;column;constructor(e,n){this.lineNumber=e,this.column=n}isBefore(e){return this.lineNumber<e.lineNumber?!0:e.lineNumber<this.lineNumber?!1:this.column<e.column}},Vr=class{lines;considerWhitespaceChanges;elements=[];firstElementOffsetByLineIdx=[];lineStartOffsets=[];trimmedWsLengthsByLineIdx=[];_range;constructor(e,n,i){this.lines=e,this.considerWhitespaceChanges=i,this._range=n,this.firstElementOffsetByLineIdx.push(0);for(let r=this._range.startLineNumber;r<=this._range.endLineNumber;r++){let s=e[r-1],o=0;r===this._range.startLineNumber&&this._range.startColumn>1&&(o=this._range.startColumn-1,s=s.substring(o)),this.lineStartOffsets.push(o);let a=0;if(!i){let c=s.trimStart();a=s.length-c.length,s=c.trimEnd()}this.trimmedWsLengthsByLineIdx.push(a);let u=r===this._range.endLineNumber?Math.min(this._range.endColumn-1-o-a,s.length):s.length;for(let c=0;c<u;c++)this.elements.push(s.charCodeAt(c));r<this._range.endLineNumber&&(this.elements.push(10),this.firstElementOffsetByLineIdx.push(this.elements.length))}}toString(){return`Slice: "${this.text}"`}get text(){return this.getText(new Z(0,this.length))}getText(e){return this.elements.slice(e.start,e.endExclusive).map(n=>String.fromCharCode(n)).join("")}getElement(e){return this.elements[e]}get length(){return this.elements.length}getBoundaryScore(e){let n=Ml(e>0?this.elements[e-1]:-1),i=Ml(e<this.elements.length?this.elements[e]:-1);if(n===7&&i===8)return 0;if(n===8)return 150;let r=0;return n!==i&&(r+=10,n===0&&i===1&&(r+=1)),r+=Il(n),r+=Il(i),r}translateOffset(e,n="right"){let i=Pl(this.firstElementOffsetByLineIdx,s=>s<=e),r=e-this.firstElementOffsetByLineIdx[i];return new Bt(this._range.startLineNumber+i,1+this.lineStartOffsets[i]+r+(r===0&&n==="left"?0:this.trimmedWsLengthsByLineIdx[i]))}translateRange(e){let n=this.translateOffset(e.start,"right"),i=this.translateOffset(e.endExclusive,"left");return i.isBefore(n)?Ke.fromPositions(i,i):Ke.fromPositions(n,i)}findWordContaining(e){if(e<0||e>=this.elements.length||!jn(this.elements[e]))return;let n=e;for(;n>0&&jn(this.elements[n-1]);)n--;let i=e;for(;i<this.elements.length&&jn(this.elements[i]);)i++;return new Z(n,i)}findSubWordContaining(e){if(e<0||e>=this.elements.length||!jn(this.elements[e]))return;let n=e;for(;n>0&&jn(this.elements[n-1])&&!Ll(this.elements[n]);)n--;let i=e;for(;i<this.elements.length&&jn(this.elements[i])&&!Ll(this.elements[i]);)i++;return new Z(n,i)}countLinesIn(e){return this.translateOffset(e.endExclusive).lineNumber-this.translateOffset(e.start).lineNumber}isStronglyEqual(e,n){return this.elements[e]===this.elements[n]}extendToFullLines(e){let n=wb(this.firstElementOffsetByLineIdx,r=>r<=e.start)??0,i=yb(this.firstElementOffsetByLineIdx,r=>e.endExclusive<=r)??this.elements.length;return new Z(n,i)}};function jn(t){return t>=ze.a&&t<=ze.z||t>=ze.A&&t<=ze.Z||t>=ze.Digit0&&t<=ze.Digit9}function Ll(t){return t>=ze.A&&t<=ze.Z}var xb={0:0,1:0,2:0,3:10,4:2,5:30,6:3,7:10,8:10};function Il(t){return xb[t]}function Ml(t){return t===ze.LineFeed?8:t===ze.CarriageReturn?7:_b(t)?6:t>=ze.a&&t<=ze.z?0:t>=ze.A&&t<=ze.Z?1:t>=ze.Digit0&&t<=ze.Digit9?2:t===-1?3:t===ze.Comma||t===ze.Semicolon?5:4}function Pl(t,e){let n=0,i=t.length-1;for(;n<=i;){let r=Math.floor((n+i)/2);e(t[r])?n=r+1:i=r-1}return i}function wb(t,e){let n=Pl(t,e);return n>=0?t[n]:void 0}function yb(t,e){let n=0,i=t.length-1;for(;n<=i;){let r=Math.floor((n+i)/2);e(t[r])?i=r-1:n=r+1}return n<t.length?t[n]:void 0}var Ot=class t{startLineNumber;endLineNumberExclusive;constructor(e,n){if(this.startLineNumber=e,this.endLineNumberExclusive=n,e>n)throw new Error(`Invalid range: ${e} > ${n}`)}get isEmpty(){return this.startLineNumber===this.endLineNumberExclusive}get length(){return this.endLineNumberExclusive-this.startLineNumber}join(e){return new t(Math.min(this.startLineNumber,e.startLineNumber),Math.max(this.endLineNumberExclusive,e.endLineNumberExclusive))}intersectsOrTouches(e){return this.startLineNumber<=e.endLineNumberExclusive&&e.startLineNumber<=this.endLineNumberExclusive}toOffsetRange(){return new Z(this.startLineNumber-1,this.endLineNumberExclusive-1)}toString(){return`[${this.startLineNumber}, ${this.endLineNumberExclusive})`}},tn=class{originalRange;modifiedRange;constructor(e,n){this.originalRange=e,this.modifiedRange=n}toString(){return`${Nl(this.originalRange)} <-> ${Nl(this.modifiedRange)}`}static assertSorted(e){for(let n=1;n<e.length;n++){let i=e[n-1],r=e[n];if(!(i.originalRange.endLineNumber<=r.originalRange.startLineNumber||i.originalRange.endLineNumber===r.originalRange.startLineNumber&&i.originalRange.endColumn<=r.originalRange.startColumn))throw new Error("RangeMappings must be sorted")}}};function Nl(t){return`(${t.startLineNumber}:${t.startColumn})-(${t.endLineNumber}:${t.endColumn})`}var jr=class{original;modified;constructor(e,n){this.original=e,this.modified=n}toString(){return`${this.original} <-> ${this.modified}`}toRangeMapping2(e,n){let i=(s,o)=>s>=1&&s<=o.length,r=(s,o,a)=>{if(s<1)return new Bt(1,1);if(s>a.length)return new Bt(a.length,a[a.length-1].length+1);let u=a[s-1];return o>u.length+1?new Bt(s,u.length+1):new Bt(s,o)};if(i(this.original.endLineNumberExclusive,e)&&i(this.modified.endLineNumberExclusive,n))return new tn(new Ke(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new Ke(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1));if(!this.original.isEmpty&&!this.modified.isEmpty)return new tn(Ke.fromPositions(new Bt(this.original.startLineNumber,1),r(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER,e)),Ke.fromPositions(new Bt(this.modified.startLineNumber,1),r(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER,n)));if(this.original.startLineNumber>1&&this.modified.startLineNumber>1)return new tn(Ke.fromPositions(r(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER,e),r(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER,e)),Ke.fromPositions(r(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER,n),r(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER,n)));throw new Error("Invalid diff: cannot convert to range mapping")}},Xn=class extends jr{innerChanges;constructor(e,n,i){super(e,n),this.innerChanges=i}},Zn=class{changes;moves;hitTimeout;constructor(e,n,i){this.changes=e,this.moves=n,this.hitTimeout=i}};function kb(t,e,n,i=!1){let r=[];for(let s of Sb(t.map(o=>Eb(o,e,n)),(o,a)=>o.original.intersectsOrTouches(a.original)||o.modified.intersectsOrTouches(a.modified))){let o=s[0],a=s[s.length-1];r.push(new Xn(o.original.join(a.original),o.modified.join(a.modified),s.map(u=>u.innerChanges[0])))}if(!i)for(let s=1;s<r.length;s++){let o=r[s-1],a=r[s];if(o.original.endLineNumberExclusive>a.original.startLineNumber||o.modified.endLineNumberExclusive>a.modified.startLineNumber)break}return r}function Eb(t,e,n){let i=0,r=0;t.modifiedRange.endColumn===1&&t.originalRange.endColumn===1&&t.originalRange.startLineNumber+i<=t.originalRange.endLineNumber&&t.modifiedRange.startLineNumber+i<=t.modifiedRange.endLineNumber&&(r=-1),t.modifiedRange.startColumn-1>=(n[t.modifiedRange.startLineNumber-1]?.length??0)&&t.originalRange.startColumn-1>=(e[t.originalRange.startLineNumber-1]?.length??0)&&t.originalRange.startLineNumber<=t.originalRange.endLineNumber+r&&t.modifiedRange.startLineNumber<=t.modifiedRange.endLineNumber+r&&(i=1);let s=new Ot(t.originalRange.startLineNumber+i,t.originalRange.endLineNumber+1+r),o=new Ot(t.modifiedRange.startLineNumber+i,t.modifiedRange.endLineNumber+1+r);return new Xn(s,o,[t])}function*Sb(t,e){let n,i;for(let r of t)i!==void 0&&e(i,r)?n.push(r):(n&&(yield n),n=[r]),i=r;n&&(yield n)}var Hr=class{lines;constructor(e){this.lines=e}get lineCount(){return this.lines.length}getLineContent(e){return this.lines[e-1]}},$a=class{_dynamicProgrammingDiffing=new Na;_myersDiffingAlgorithm=new Aa;computeDiff(e,n,i){if(e.length<=1&&Cb(e,n))return new Zn([],[],!1);if(e.length===1&&e[0].length===0||n.length===1&&n[0].length===0)return new Zn([new Xn(new Ot(1,e.length+1),new Ot(1,n.length+1),[new tn(new Ke(1,1,e.length,e[e.length-1].length+1),new Ke(1,1,n.length,n[n.length-1].length+1))])],[],!1);let r=i.maxComputationTimeMs===0?Fi.instance:new Ma(i.maxComputationTimeMs),s=!i.ignoreTrimWhitespace,o=new Map;function a(C){let L=o.get(C);return L===void 0&&(L=o.size,o.set(C,L)),L}let u=e.map(C=>a(C.trim())),c=n.map(C=>a(C.trim())),d=new qr(u,e),h=new qr(c,n),l=d.length+h.length<1700?this._dynamicProgrammingDiffing.compute(d,h,r,(C,L)=>e[C]===n[L]?n[L].length===0?.1:1+Math.log(1+n[L].length):.99):this._myersDiffingAlgorithm.compute(d,h,r),f=l.diffs,m=l.hitTimeout;f=Sl(d,h,f),f=gb(d,h,f);let p=[],g=C=>{if(s)for(let L=0;L<C;L++){let B=b+L,E=w+L;if(e[B]!==n[E]){let re=this._refineDiff(e,n,new Ze(new Z(B,B+1),new Z(E,E+1)),r,s,i);for(let X of re.mappings)p.push(X);re.hitTimeout&&(m=!0)}}},b=0,w=0;for(let C of f){let L=C.seq1Range.start-b;g(L),b=C.seq1Range.endExclusive,w=C.seq2Range.endExclusive;let B=this._refineDiff(e,n,C,r,s,i);B.hitTimeout&&(m=!0);for(let E of B.mappings)p.push(E)}g(e.length-b);let x=new Hr(e),y=new Hr(n),z=kb(p,x.lines,y.lines),k=[];return new Zn(z,k,m)}_refineDiff(e,n,i,r,s,o){let u=zb(i).toRangeMapping2(e,n),c=new Vr(e,u.originalRange,s),d=new Vr(n,u.modifiedRange,s),h=c.length+d.length<500?this._dynamicProgrammingDiffing.compute(c,d,r):this._myersDiffingAlgorithm.compute(c,d,r),l=h.diffs;return l=Sl(c,d,l),l=Tl(c,d,l,(m,p)=>m.findWordContaining(p)),o.extendToSubwords&&(l=Tl(c,d,l,(m,p)=>m.findSubWordContaining(p),!0)),l=mb(c,d,l),l=bb(c,d,l),{mappings:l.map(m=>new tn(c.translateRange(m.seq1Range),d.translateRange(m.seq2Range))),hitTimeout:h.hitTimeout}}};function zb(t){return new jr(new Ot(t.seq1Range.start+1,t.seq1Range.endExclusive+1),new Ot(t.seq2Range.start+1,t.seq2Range.endExclusive+1))}function Cb(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function Tb(t,e,n){let i=Wn(t,Q.__wbindgen_malloc,Q.__wbindgen_realloc),r=Yt,s=Wn(e,Q.__wbindgen_malloc,Q.__wbindgen_realloc),o=Yt,a=Q.computeDiff(i,r,s,o,n);if(a[2])throw Wr(a[1]);return Wr(a[0])}function Ob(t,e,n){let i=Q.computeDiffLines(t,e,n);if(i[2])throw Wr(i[1]);return Wr(i[0])}function Fl(){Q.init()}function $l(){return{__proto__:null,"./diff_wasm_bg.js":{__proto__:null,__wbg_Error_bce6d499ff0a4aff:function(e,n){return Error(Ar(e,n))},__wbg_Number_b7972a139bfbfdf0:function(e){return Number(e)},__wbg_String_8564e559799eccda:function(e,n){let i=String(n),r=Wn(i,Q.__wbindgen_malloc,Q.__wbindgen_realloc),s=Yt;dt().setInt32(e+4,s,!0),dt().setInt32(e+0,r,!0)},__wbg___wbindgen_bigint_get_as_i64_410e28c7b761ad83:function(e,n){let i=n,r=typeof i=="bigint"?i:void 0;dt().setBigInt64(e+8,Hn(r)?BigInt(0):r,!0),dt().setInt32(e+0,!Hn(r),!0)},__wbg___wbindgen_boolean_get_2304fb8c853028c8:function(e){let n=e,i=typeof n=="boolean"?n:void 0;return Hn(i)?16777215:i?1:0},__wbg___wbindgen_debug_string_edece8177ad01481:function(e,n){let i=Ba(n),r=Wn(i,Q.__wbindgen_malloc,Q.__wbindgen_realloc),s=Yt;dt().setInt32(e+4,s,!0),dt().setInt32(e+0,r,!0)},__wbg___wbindgen_in_07056af4f902c445:function(e,n){return e in n},__wbg___wbindgen_is_bigint_aeae3893f30ed54e:function(e){return typeof e=="bigint"},__wbg___wbindgen_is_function_5cd60d5cf78b4eef:function(e){return typeof e=="function"},__wbg___wbindgen_is_null_2042690d351e14f0:function(e){return e===null},__wbg___wbindgen_is_object_b4593df85baada48:function(e){let n=e;return typeof n=="object"&&n!==null},__wbg___wbindgen_is_undefined_35bb9f4c7fd651d5:function(e){return e===void 0},__wbg___wbindgen_jsval_eq_c0ed08b3e0f393b9:function(e,n){return e===n},__wbg___wbindgen_jsval_loose_eq_0ad77b7717db155c:function(e,n){return e==n},__wbg___wbindgen_number_get_f73a1244370fcc2c:function(e,n){let i=n,r=typeof i=="number"?i:void 0;dt().setFloat64(e+8,Hn(r)?0:r,!0),dt().setInt32(e+0,!Hn(r),!0)},__wbg___wbindgen_string_get_d109740c0d18f4d7:function(e,n){let i=n,r=typeof i=="string"?i:void 0;var s=Hn(r)?0:Wn(r,Q.__wbindgen_malloc,Q.__wbindgen_realloc),o=Yt;dt().setInt32(e+4,o,!0),dt().setInt32(e+0,s,!0)},__wbg___wbindgen_throw_9c31b086c2b26051:function(e,n){throw new Error(Ar(e,n))},__wbg_call_13665d9f14390edc:function(){return Ca(function(e,n){return e.call(n)},arguments)},__wbg_done_54b8da57023b7ed2:function(e){return e.done},__wbg_error_a6fa202b58aa1cd3:function(e,n){let i,r;try{i=e,r=n,console.error(Ar(e,n))}finally{Q.__wbindgen_free(i,r,1)}},__wbg_get_3e9a707ab7d352eb:function(){return Ca(function(e,n){return Reflect.get(e,n)},arguments)},__wbg_get_unchecked_1dfe6d05ad91d9b7:function(e,n){return e[n>>>0]},__wbg_get_with_ref_key_6412cf3094599694:function(e,n){return e[n]},__wbg_instanceof_ArrayBuffer_53db37b06f6b9afe:function(e){let n;try{n=e instanceof ArrayBuffer}catch{n=!1}return n},__wbg_instanceof_Uint8Array_abd07d4bd221d50b:function(e){let n;try{n=e instanceof Uint8Array}catch{n=!1}return n},__wbg_isArray_94898ed3aad6947b:function(e){return Array.isArray(e)},__wbg_isSafeInteger_01e964d144ad3a55:function(e){return Number.isSafeInteger(e)},__wbg_iterator_1441b47f341dc34f:function(){return Symbol.iterator},__wbg_length_2591a0f4f659a55c:function(e){return e.length},__wbg_length_56fcd3e2b7e0299d:function(e){return e.length},__wbg_new_02d162bc6cf02f60:function(){return new Object},__wbg_new_227d7c05414eb861:function(){return new Error},__wbg_new_310879b66b6e95e1:function(){return new Array},__wbg_new_7ddec6de44ff8f5d:function(e){return new Uint8Array(e)},__wbg_next_2a4e19f4f5083b0f:function(e){return e.next},__wbg_next_6429a146bf756f93:function(){return Ca(function(e){return e.next()},arguments)},__wbg_prototypesetcall_5f9bdc8d75e07276:function(e,n,i){Uint8Array.prototype.set.call(Lb(e,n),i)},__wbg_set_6be42768c690e380:function(e,n,i){e[n]=i},__wbg_set_78ea6a19f4818587:function(e,n,i){e[n>>>0]=i},__wbg_stack_3b0d974bbf31e44f:function(e,n){let i=n.stack,r=Wn(i,Q.__wbindgen_malloc,Q.__wbindgen_realloc),s=Yt;dt().setInt32(e+4,s,!0),dt().setInt32(e+0,r,!0)},__wbg_value_9cc0518af87a489c:function(e){return e.value},__wbindgen_cast_0000000000000001:function(e){return e},__wbindgen_cast_0000000000000002:function(e,n){return Ar(e,n)},__wbindgen_cast_0000000000000003:function(e){return BigInt.asUintN(64,e)},__wbindgen_init_externref_table:function(){let e=Q.__wbindgen_externrefs,n=e.grow(4);e.set(0,void 0),e.set(n+0,void 0),e.set(n+1,null),e.set(n+2,!0),e.set(n+3,!1)}}}}function Rb(t){let e=Q.__externref_table_alloc();return Q.__wbindgen_externrefs.set(e,t),e}function Ba(t){let e=typeof t;if(e=="number"||e=="boolean"||t==null)return`${t}`;if(e=="string")return`"${t}"`;if(e=="symbol"){let r=t.description;return r==null?"Symbol":`Symbol(${r})`}if(e=="function"){let r=t.name;return typeof r=="string"&&r.length>0?`Function(${r})`:"Function"}if(Array.isArray(t)){let r=t.length,s="[";r>0&&(s+=Ba(t[0]));for(let o=1;o<r;o++)s+=", "+Ba(t[o]);return s+="]",s}let n=/\[object ([^\]]+)\]/.exec(toString.call(t)),i;if(n&&n.length>1)i=n[1];else return toString.call(t);if(i=="Object")try{return"Object("+JSON.stringify(t)+")"}catch{return"Object"}return t instanceof Error?`${t.name}: ${t.message}
${t.stack}`:i}function Lb(t,e){return t=t>>>0,Ai().subarray(t/1,t/1+e)}var kn=null;function dt(){return(kn===null||kn.buffer.detached===!0||kn.buffer.detached===void 0&&kn.buffer!==Q.memory.buffer)&&(kn=new DataView(Q.memory.buffer)),kn}function Ar(t,e){return Mb(t>>>0,e)}var Mi=null;function Ai(){return(Mi===null||Mi.byteLength===0)&&(Mi=new Uint8Array(Q.memory.buffer)),Mi}function Ca(t,e){try{return t.apply(this,e)}catch(n){let i=Rb(n);Q.__wbindgen_exn_store(i)}}function Hn(t){return t==null}function Wn(t,e,n){if(n===void 0){let a=Pi.encode(t),u=e(a.length,1)>>>0;return Ai().subarray(u,u+a.length).set(a),Yt=a.length,u}let i=t.length,r=e(i,1)>>>0,s=Ai(),o=0;for(;o<i;o++){let a=t.charCodeAt(o);if(a>127)break;s[r+o]=a}if(o!==i){o!==0&&(t=t.slice(o)),r=n(r,i,i=o+t.length*3,1)>>>0;let a=Ai().subarray(r+o,r+i),u=Pi.encodeInto(t,a);o+=u.written,r=n(r,i,o,1)>>>0}return Yt=o,r}function Wr(t){let e=Q.__wbindgen_externrefs.get(t);return Q.__externref_table_dealloc(t),e}var Fr=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});Fr.decode();var Ib=2146435072,Ta=0;function Mb(t,e){return Ta+=e,Ta>=Ib&&(Fr=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),Fr.decode(),Ta=e),Fr.decode(Ai().subarray(t,t+e))}var Pi=new TextEncoder;"encodeInto"in Pi||(Pi.encodeInto=function(t,e){let n=Pi.encode(t);return e.set(n),{read:t.length,written:n.length}});var Yt=0,Q;function Bl(t,e){return Q=t.exports,kn=null,Mi=null,Q.__wbindgen_start(),Q}async function Nb(t,e){if(typeof Response=="function"&&t instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(t,e)}catch(r){if(t.ok&&n(t.type)&&t.headers.get("Content-Type")!=="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",r);else throw r}let i=await t.arrayBuffer();return await WebAssembly.instantiate(i,e)}else{let i=await WebAssembly.instantiate(t,e);return i instanceof WebAssembly.Instance?{instance:i,module:t}:i}function n(i){switch(i){case"basic":case"cors":case"default":return!0}return!1}}function Ab(t){if(Q!==void 0)return Q;t!==void 0&&(Object.getPrototypeOf(t)===Object.prototype?{module:t}=t:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));let e=$l();t instanceof WebAssembly.Module||(t=new WebAssembly.Module(t));let n=new WebAssembly.Instance(t,e);return Bl(n)}async function Dl(t){if(Q!==void 0)return Q;t!==void 0&&(Object.getPrototypeOf(t)===Object.prototype?{module_or_path:t}=t:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),t===void 0&&(t=new URL(new URL("diff_wasm_bg-BNcsPO7p.wasm",import.meta.url).href));let e=$l();(typeof t=="string"||typeof Request=="function"&&t instanceof Request||typeof URL=="function"&&t instanceof URL)&&(t=fetch(t));let{instance:n,module:i}=await Nb(await t,e);return Bl(n)}var Pb=Object.freeze({__proto__:null,computeDiff:Tb,computeDiffLines:Ob,default:Dl,init:Fl,initSync:Ab}),Un=null,Pr=null;async function Fb(){return Un||Pr||(Pr=(async()=>{let t=new URL(new URL("diff_wasm_bg-BNcsPO7p.wasm",import.meta.url).href),e=t;if(typeof process<"u"&&process.versions?.node){let{readFile:n}=await import("node:fs/promises");e=await n(t)}return await Dl({module_or_path:e}),Fl(),Un=Pb,Un})(),Pr)}function $b(){if(!Un)throw new Error("WASM not initialized. Call initWasm() first and await it.");return Un}async function ql(t={}){return t.useWasm?(await Fb(),new qa(t.algorithm)):new Da(t.algorithm)}var Da=class{_algorithm;_impl=new $a;constructor(e){this._algorithm=e}computeDiff(e,n,i){let r=e.split(`
`),s=n.split(`
`),o={maxComputationTimeMs:i?.maxComputationTimeMs??0,ignoreTrimWhitespace:i?.ignoreTrimWhitespace??!1,computeMoves:i?.computeMoves??!1,extendToSubwords:i?.extendToSubwords??!1},a=this._impl.computeDiff(r,s,o);return this._algorithm,Vl(a,e,n,r,s)}},qa=class{_algorithm;constructor(e){this._algorithm=e}computeDiff(e,n,i){let r=e.split(`
`),s=n.split(`
`),o={};i?.maxComputationTimeMs!==void 0&&(o.maxComputationTimeMs=i.maxComputationTimeMs),i?.ignoreTrimWhitespace!==void 0&&(o.ignoreTrimWhitespace=i.ignoreTrimWhitespace),i?.computeMoves!==void 0&&(o.computeMoves=i.computeMoves),i?.extendToSubwords!==void 0&&(o.extendToSubwords=i.extendToSubwords);let u=$b().computeDiffLines(r,s,o);this._algorithm;let c=Bb(u);return Vl(c,e,n,r,s)}};function Bb(t){let e=t.changes.map(n=>{let i=n.innerChanges?.map(r=>new tn(new Ke(r.originalStartLine,r.originalStartColumn,r.originalEndLine,r.originalEndColumn),new Ke(r.modifiedStartLine,r.modifiedStartColumn,r.modifiedEndLine,r.modifiedEndColumn)));return new Xn(new Ot(n.original.startLineNumber,n.original.endLineNumberExclusive),new Ot(n.modified.startLineNumber,n.modified.endLineNumberExclusive),i)});return new Zn(e,[],t.hitTimeout)}function Vl(t,e,n,i,r){let s=Al(i),o=Al(r),a=[];for(let d of t.changes)Db(d,e,n,i,r,s,o,a);let u=Ra.of(a),c=t.moves.map(d=>qb(d,e,n,i,r,s,o));return new Ia(u,c,t.hitTimeout)}function Db(t,e,n,i,r,s,o,a){if(t.innerChanges&&t.innerChanges.length>0){for(let h of t.innerChanges){let l=Ur(h.originalRange,e,i,s),f=Ur(h.modifiedRange,n,r,o),m=n.substring(f.start,f.endExclusive);a.push(new En(l,m,Br.change))}return}let u=Kn(t.original.startLineNumber,t.original.endLineNumberExclusive,e,s),c=Kn(t.modified.startLineNumber,t.modified.endLineNumberExclusive,n,o),d=n.substring(c.start,c.endExclusive);a.push(new En(u,d,Br.change))}function qb(t,e,n,i,r,s,o){let a=Kn(t.lineRangeMapping.original.startLineNumber,t.lineRangeMapping.original.endLineNumberExclusive,e,s),u=Kn(t.lineRangeMapping.modified.startLineNumber,t.lineRangeMapping.modified.endLineNumberExclusive,n,o),c=[];for(let d of t.changes)if(d.innerChanges&&d.innerChanges.length>0)for(let h of d.innerChanges){let l=Ur(h.originalRange,e,i,s),f=Ur(h.modifiedRange,n,r,o);c.push(new Sn(new Z(l.start-a.start,l.endExclusive-a.start),n.substring(f.start,f.endExclusive)))}else{let h=Kn(d.original.startLineNumber,d.original.endLineNumberExclusive,e,s),l=Kn(d.modified.startLineNumber,d.modified.endLineNumberExclusive,n,o);c.push(new Sn(new Z(h.start-a.start,h.endExclusive-a.start),n.substring(l.start,l.endExclusive)))}return new La(new Oa(a,u),$r.of(c))}function Al(t){let e=new Array(t.length+1);e[0]=0;for(let n=0;n<t.length;n++)e[n+1]=e[n]+t[n].length+1;return e}function Kn(t,e,n,i){let r=Kr(t,1,n,i),s=Kr(e,1,n,i);return new Z(r,s)}function Ur(t,e,n,i){let r=Kr(t.startLineNumber,t.startColumn,e,i),s=Kr(t.endLineNumber,t.endColumn,e,i);return new Z(r,s)}function Kr(t,e,n,i){if(t<=0)return 0;if(t>i.length)return n.length;let s=i[t-1]+(e-1);return Math.min(Math.max(s,0),n.length)}var nu=class t{constructor(e,n){if(this.replaceRange=e,this.newLength=n,n<0)throw new Error(`newLength must be non-negative, got ${n}`)}static replace(e,n){return new t(e,n)}get lengthDelta(){return this.newLength-this.replaceRange.length}equals(e){return this.replaceRange.equals(e.replaceRange)&&this.newLength===e.newLength}toString(){return`${this.replaceRange} -> +${this.newLength}`}},Di=class t{static empty=new t([]);static single(e){return new t([e])}static replace(e,n){return new t([nu.replace(e,n)])}replacements;constructor(e){let n=-1;for(let i of e){if(i.replaceRange.start<n)throw new Error(`Edits must be disjoint and sorted. Found ${i} after end ${n}`);n=i.replaceRange.endExclusive}this.replacements=e}get isEmpty(){return this.replacements.length===0}equals(e){if(this.replacements.length!==e.replacements.length)return!1;for(let n=0;n<this.replacements.length;n++)if(!this.replacements[n].equals(e.replacements[n]))return!1;return!0}toString(){return this.isEmpty?"LengthEdit.empty":this.replacements.join(", ")}},Tn=class{constructor(e){this.value=e}get length(){return this.value.length}substring(e){return e.substring(this.value)}toString(){return this.value}},N=class t{constructor(e,n){this.anchor=e,this.active=n}static collapsed(e){return new t(e,e)}get isCollapsed(){return this.anchor===this.active}get isForward(){return this.active>=this.anchor}get range(){return this.isForward?new T(this.anchor,this.active):new T(this.active,this.anchor)}collapseToActive(){return t.collapsed(this.active)}withActive(e){return new t(this.anchor,e)}},iu=class{constructor(e,n){this.sourceOffsetBefore=e,this.sourceOffsetAfter=n}},ce;(t=>{function e(i){return{kind:"source",offset:i}}t.source=e;function n(i){return{kind:"virtual",line:i}}t.virtual=n})(ce||(ce={}));var xt=class t{constructor(e,n){this.x=e,this.y=n}static ZERO=new t(0,0);translate(e,n){return new t(this.x+e,this.y+n)}},Y=class t{constructor(e,n,i,r){this.x=e,this.y=n,this.width=i,this.height=r}static EMPTY=new t(0,0,0,0);static fromPointPoint(e,n,i,r){return new t(e,n,i-e,r-n)}static fromPointSize(e,n,i,r){return new t(e,n,i,r)}get left(){return this.x}get top(){return this.y}get right(){return this.x+this.width}get bottom(){return this.y+this.height}get topLeft(){return new xt(this.x,this.y)}containsX(e){return e>=this.left&&e<this.right}containsY(e){return e>=this.top&&e<this.bottom}containsPoint(e){return this.containsX(e.x)&&this.containsY(e.y)}withZeroWidthAt(e){return new t(e,this.y,0,this.height)}translate(e,n){return new t(this.x+e,this.y+n,this.width,this.height)}},Vb=1,qe=class{id=Vb++;_length=-1;get length(){if(this._length<0){let e=0;for(let n of this.children)e+=n.length;this._length=e}return this._length}equalsShallow(e){if(this===e)return!0;if(this.kind!==e.kind||this.length!==e.length||!this._localEquals(e))return!1;let n=this.children,i=e.children;if(n.length!==i.length)return!1;for(let r=0;r<n.length;r++)if(n[r]!==i[r])return!1;return!0}_localEquals(e){return!0}cloneWithId(e){let n=Object.create(Object.getPrototypeOf(this));return Object.assign(n,this),n.id=e,n}},jb=[];function ve(t,e){let n;for(let i=0;i<e.length;i++){let r=t.get(e[i]);r&&r!==e[i]&&((n??=e.slice())[i]=r)}return n??e}function Mt(t,e){let n=t.get(e);return n&&n!==e?n:e}function St(t,e){return e?Mt(t,e):void 0}var Yn=class extends qe{get children(){return jb}get length(){return this.content.length}mapChildren(){return this}},rs=class extends Yn{constructor(e){super(),this.content=e}kind="text";_localEquals(e){return this.content===e.content}},V=class extends Yn{constructor(e,n){super(),this.markerKind=e,this.content=n}kind="marker";_localEquals(e){return this.markerKind===e.markerKind&&this.content===e.content}},Ie=class extends Yn{constructor(e,n){super(),this.content=e,this.glueKind=n}kind="glue";_localEquals(e){return this.content===e.content&&this.glueKind===e.glueKind}},Ge=class extends qe{_withLeading(e){return this.leadingTrivia?[this.leadingTrivia,...e]:e}},qi=class t extends Ge{constructor(e,n){super(),this.content=e,this.leadingTrivia=n}kind="thematicBreak";get children(){return this._withLeading(this.content)}get marker(){return It(this.content,"content")}mapChildren(e){return new t(ve(e,this.content),St(e,this.leadingTrivia))}withLeadingTrivia(e){return new t(this.content,e)}};function It(t,e){return t.find(n=>n instanceof V&&n.markerKind===e)}var ru=class t extends qe{constructor(e,n,i){super(),this.openMarker=e,this.content=n,this.closeMarker=i}kind="strong";get children(){return[this.openMarker,...this.content,this.closeMarker]}mapChildren(e){return new t(Mt(e,this.openMarker),ve(e,this.content),Mt(e,this.closeMarker))}},su=class t extends qe{constructor(e,n,i){super(),this.openMarker=e,this.content=n,this.closeMarker=i}kind="emphasis";get children(){return[this.openMarker,...this.content,this.closeMarker]}mapChildren(e){return new t(Mt(e,this.openMarker),ve(e,this.content),Mt(e,this.closeMarker))}},ou=class t extends qe{constructor(e,n,i){super(),this.openMarker=e,this.content=n,this.closeMarker=i}kind="strikethrough";get children(){return[this.openMarker,...this.content,this.closeMarker]}mapChildren(e){return new t(Mt(e,this.openMarker),ve(e,this.content),Mt(e,this.closeMarker))}},au=class t extends qe{constructor(e){super(),this.content=e}kind="inlineCode";get children(){return this.content}mapChildren(e){return new t(ve(e,this.content))}},uu=class t extends qe{constructor(e){super(),this.content=e}kind="inlineMath";get children(){return this.content}mapChildren(e){return new t(ve(e,this.content))}},cu=class t extends qe{constructor(e,n){super(),this.url=e,this.content=n}kind="link";get children(){return this.content}mapChildren(e){return new t(this.url,ve(e,this.content))}_localEquals(e){return this.url===e.url}},du=class t extends qe{constructor(e,n,i){super(),this.alt=e,this.url=n,this.content=i}kind="image";get children(){return this.content}mapChildren(e){return new t(this.alt,this.url,ve(e,this.content))}_localEquals(e){return this.alt===e.alt&&this.url===e.url}},Et=class t extends Ge{constructor(e,n,i){super(),this.attributes=e,this.content=n,this.leadingTrivia=i}kind="video";get children(){return this._withLeading(this.content)}get source(){return It(this.content,"content")}mapChildren(e){return new t(this.attributes,ve(e,this.content),St(e,this.leadingTrivia))}withLeadingTrivia(e){return new t(this.attributes,this.content,e)}_localEquals(e){return this.attributes.src===e.attributes.src&&this.attributes.title===e.attributes.title&&this.attributes.autoplay===e.attributes.autoplay&&this.attributes.controls===e.attributes.controls&&this.attributes.loop===e.attributes.loop&&this.attributes.muted===e.attributes.muted}},Cn=class t extends Ge{constructor(e,n,i){super(),this.tokenType=e,this.content=n,this.leadingTrivia=i}kind="unhandledBlock";get children(){return this._withLeading(this.content)}get code(){return It(this.content,"content")}get htmlComment(){let e=this.code?.content;if(this.tokenType!=="htmlFlow"||e===void 0)return;let n="<!--",i="-->",r=e.indexOf(n);if(r<0)return;let s=e.slice(0,r);if(s.trim().length>0)return;let o=r+n.length,a=e.indexOf(i,o);if(a<0)return{kind:"open",leadingWhitespace:s,opening:n,body:e.slice(o)};let u=e.slice(a+i.length);if(!(u.trim().length>0))return{kind:"complete",leadingWhitespace:s,opening:n,body:e.slice(o,a),closing:i,trailingWhitespace:u}}mapChildren(e){return new t(this.tokenType,ve(e,this.content),St(e,this.leadingTrivia))}withLeadingTrivia(e){return new t(this.tokenType,this.content,e)}_localEquals(e){return this.tokenType===e.tokenType}},Vi=class t extends Ge{constructor(e,n,i,r){super(),this.level=e,this.marker=n,this.content=i,this.leadingTrivia=r}kind="heading";get children(){return this._withLeading([this.marker,...this.content])}mapChildren(e){return new t(this.level,Mt(e,this.marker),ve(e,this.content),St(e,this.leadingTrivia))}withLeadingTrivia(e){return new t(this.level,this.marker,this.content,e)}_localEquals(e){return this.level===e.level}},Ht=class t extends Ge{constructor(e,n){super(),this.content=e,this.leadingTrivia=n}kind="paragraph";get children(){return this._withLeading(this.content)}mapChildren(e){return new t(ve(e,this.content),St(e,this.leadingTrivia))}withLeadingTrivia(e){return new t(this.content,e)}},ji=class t extends Ge{constructor(e,n){super(),this.content=e,this.leadingTrivia=n}kind="frontMatter";get children(){return this._withLeading(this.content)}get openFence(){return It(this.content,"openFence")}get closeFence(){return It(this.content,"closeFence")}get value(){return It(this.content,"content")}mapChildren(e){return new t(ve(e,this.content),St(e,this.leadingTrivia))}withLeadingTrivia(e){return new t(this.content,e)}},rn=class t extends Ge{constructor(e,n,i,r){super(),this.language=e,this.infoString=n,this.content=i,this.leadingTrivia=r}kind="codeBlock";_previous;_contentEdit;get children(){return this._withLeading(this.content)}get openFence(){return It(this.content,"openFence")}get closeFence(){return It(this.content,"closeFence")}get code(){return It(this.content,"content")}get codeOffset(){let e=this.leadingTrivia?.length??0;for(let n of this.content){if(n.kind==="marker"&&n.markerKind==="content")return e;e+=n.length}return e}mapChildren(e){return new t(this.language,this.infoString,ve(e,this.content),St(e,this.leadingTrivia))}withLeadingTrivia(e){return new t(this.language,this.infoString,this.content,e)}_localEquals(e){return this.language===e.language&&this.infoString===e.infoString}withCodeDiff(e,n){let i=this.cloneWithId(this.id);return i._previous=new WeakRef(e),i._contentEdit=n,i}getDiff(e){if(this._contentEdit&&this._previous?.deref()===e)return{stringEdit:this._contentEdit}}},Hi=class t extends Ge{constructor(e,n){super(),this.content=e,this.leadingTrivia=n}kind="mathBlock";get children(){return this._withLeading(this.content)}get code(){return It(this.content,"content")}mapChildren(e){return new t(ve(e,this.content),St(e,this.leadingTrivia))}withLeadingTrivia(e){return new t(this.content,e)}},ei=class t extends Ge{constructor(e,n){super(),this.content=e,this.leadingTrivia=n}kind="blockQuote";get children(){return this._withLeading(this.content)}get blocks(){return this.content.filter(bc)}mapChildren(e){return new t(ve(e,this.content),St(e,this.leadingTrivia))}withLeadingTrivia(e){return new t(this.content,e)}},wt=class t extends Ge{constructor(e,n,i){super(),this.ordered=e,this.content=n,this.leadingTrivia=i}kind="list";get children(){return this._withLeading(this.content)}get items(){return this.content.filter(e=>e instanceof yt)}mapChildren(e){return new t(this.ordered,ve(e,this.content),St(e,this.leadingTrivia))}withLeadingTrivia(e){return new t(this.ordered,this.content,e)}_localEquals(e){return this.ordered===e.ordered}},yt=class t extends qe{constructor(e,n,i,r){super(),this.marker=e,this.content=n,this.checked=i,this.leadingTrivia=r}kind="listItem";get children(){return this.leadingTrivia?[this.leadingTrivia,this.marker,...this.content]:[this.marker,...this.content]}get blocks(){return this.content.filter(bc)}mapChildren(e){return new t(Mt(e,this.marker),ve(e,this.content),this.checked,this.leadingTrivia?Mt(e,this.leadingTrivia):void 0)}withLeadingTrivia(e){return new t(this.marker,this.content,this.checked,e)}_localEquals(e){return this.checked===e.checked}},Wi=class t extends Ge{constructor(e,n){super(),this.content=e,this.leadingTrivia=n}kind="table";get children(){return this._withLeading(this.content)}get _rows(){return this.content.filter(e=>e instanceof Ui)}get headerRow(){return this._rows[0]}get delimiterRow(){return this._rows[1]}get bodyRows(){return this._rows.slice(2)}mapChildren(e){return new t(ve(e,this.content),St(e,this.leadingTrivia))}withLeadingTrivia(e){return new t(this.content,e)}},Ui=class t extends qe{constructor(e){super(),this.content=e}kind="tableRow";get children(){return this.content}get cells(){return this.content.filter(e=>e instanceof Ki)}mapChildren(e){return new t(ve(e,this.content))}},Ki=class t extends qe{constructor(e){super(),this.content=e}kind="tableCell";get children(){return this.content}mapChildren(e){return new t(ve(e,this.content))}},lu=class t extends qe{constructor(e){super(),this.content=e}kind="document";get children(){return this.content}get blocks(){return this.content.filter(bc)}mapChildren(e){return new t(ve(e,this.content))}};function bc(t){return t instanceof Vi||t instanceof Ht||t instanceof ji||t instanceof rn||t instanceof Hi||t instanceof qi||t instanceof Et||t instanceof ei||t instanceof wt||t instanceof Wi||t instanceof Cn}function Ve(t,e){if(t.id===e.id)return 0;let n=0;for(let i of t.children){let r=Ve(i,e);if(r!==void 0)return n+r;n+=i.length}}var Hb=/\[[ xX]\]/;function Wb(t){if(t.checked===void 0)return;let e=Hb.exec(Nh(t));if(e)return T.ofStartAndLength(e.index,e[0].length)}function Nh(t){if(t instanceof Yn)return t.content;let e="";for(let n of t.children)e+=Nh(n);return e}function Ub(t){let e=ba({extensions:[ya(),ka(),Ea(),Sa(),za()]}),n=_a()(t,void 0,!0);return va(e.document().write(n)).map(([i,r])=>({type:i,tokenType:r.type,startOffset:r.start.offset,endOffset:r.end.offset}))}function Kb(t){return new fu(Ub(t),t).build()}var Zb=new Set(["setextHeading","definition"]),Xb={kind:"notVideo"},_t={kind:"unsupported"};function jl(t){let e=qt(t,0);if(!Fh(t,e))return Xb;e+=6;let n=t[e];if(n!==void 0&&n!==">"&&n!=="/"&&!hu(n))return _t;let i=[],r=!1;for(;e<t.length;){let l=e;if(e=qt(t,e),t[e]===">"){r=!0,e++;break}if(e===l||!Jb(t[e]))return _t;let f=e;for(e++;Ah(t[e]);)e++;let m=t.slice(f,e).toLowerCase(),p=e,g=qt(t,e),b;if(t[g]==="="){e=qt(t,g+1);let w=t[e];if(w==='"'||w==="'"){let x=++e;for(;e<t.length&&t[e]!==w;)e++;if(t[e]!==w)return _t;b=t.slice(x,e),e++}else{let x=e;for(;e<t.length&&!hu(t[e])&&t[e]!==">";){let y=t[e];if(y==='"'||y==="'"||y==="`"||y==="<"||y==="=")return _t;e++}if(e===x)return _t;b=t.slice(x,e)}}else e=p;i.push({name:m,value:b})}if(!r||(e=qt(t,e),!Ph(t,e,"</video"))||(e+=7,e=qt(t,e),t[e]!==">")||(e=qt(t,e+1),e!==t.length))return _t;let s,o,a=!1,u=!1,c=!1,d=!1,h=new Set;for(let{name:l,value:f}of i){if(h.has(l))return _t;switch(h.add(l),l){case"src":if(f===void 0||(s=ra(f),Gb(s)))return _t;break;case"title":if(f===void 0)return _t;o=ra(f);break;case"autoplay":a=!0;break;case"controls":u=!0;break;case"loop":c=!0;break;case"muted":d=!0;break;default:return _t}}return s===void 0?_t:{kind:"supported",attributes:{src:s,title:o,autoplay:a,controls:u,loop:c,muted:d}}}function qt(t,e){for(;hu(t[e]);)e++;return e}function Gb(t){return qt(t,0)===t.length}function hu(t){return t===" "||t==="	"||t===`
`||t==="\r"||t==="\f"}function Jb(t){return t!==void 0&&/[A-Za-z]/.test(t)}function Ah(t){return t!==void 0&&/[A-Za-z0-9:_-]/.test(t)}function Ph(t,e,n){return t.slice(e,e+n.length).toLowerCase()===n}function Fh(t,e){return Ph(t,e,"<video")?!Ah(t[e+6]):!1}function Zr(t){let e=[];for(let n=0;n<t.length;n++){let i=t[n],r=t[n+1];if(i instanceof Ie&&i.glueKind==="indent"){let s=r!==void 0?Qb(r,i):void 0;if(s){e.push(s),n++;continue}let o=e[e.length-1];if(o instanceof Ie&&o.glueKind===void 0){e[e.length-1]=new Ie(o.content+i.content);continue}e.push(i);continue}e.push(i)}return e}function Qb(t,e){if(t instanceof wt){let n=t.content.findIndex(r=>r instanceof yt);if(n<0)return;let i=t.content.map((r,s)=>s===n?r.withLeadingTrivia(e):r);return new wt(t.ordered,i,t.leadingTrivia)}if(t instanceof yt||t instanceof Ge)return t.withLeadingTrivia(e)}function Xr(t){let e=[];for(let n=0;n<t.length;n++){let i=t[n];if(i instanceof Ie&&(i.glueKind===void 0||i.glueKind==="blockQuoteSourceGap")){let r=e[e.length-1],s=t[n+1],o=r instanceof Ht&&s instanceof Ht,a=new Ie(i.content,i.glueKind==="blockQuoteSourceGap"?"blockQuoteSourceGap":o?"blockBreak":"blockGap"),u=r!==void 0?$h(r,a):void 0;u?e[e.length-1]=u:e.push(a);continue}e.push(i)}return e}function $h(t,e){switch(t.kind){case"paragraph":{let n=t;return new Ht([...n.content,e],n.leadingTrivia)}case"heading":{let n=t;return new Vi(n.level,n.marker,[...n.content,e],n.leadingTrivia)}case"codeBlock":{let n=t;return new rn(n.language,n.infoString,[...n.content,e],n.leadingTrivia)}case"frontMatter":{let n=t;return new ji([...n.content,e],n.leadingTrivia)}case"mathBlock":{let n=t;return new Hi([...n.content,e],n.leadingTrivia)}case"thematicBreak":{let n=t;return new qi([...n.content,e],n.leadingTrivia)}case"video":{let n=t;return new Et(n.attributes,[...n.content,e],n.leadingTrivia)}case"unhandledBlock":{let n=t;return new Cn(n.tokenType,[...n.content,e],n.leadingTrivia)}case"table":{let n=t;return new Wi([...n.content,e],n.leadingTrivia)}case"blockQuote":{let n=t;return new ei(Va(n.content,e),n.leadingTrivia)}case"list":{let n=t;return new wt(n.ordered,Va(n.content,e),n.leadingTrivia)}case"listItem":{let n=t;return new yt(n.marker,Va(n.content,e),n.checked,n.leadingTrivia)}default:return}}function Va(t,e){let n=t[t.length-1],i=n!==void 0?$h(n,e):void 0;if(i){let r=t.slice();return r[r.length-1]=i,r}return[...t,e]}function Yb(t){return t.some(e=>!(e instanceof Ie))?t:[new Ht(t)]}var pe=class{constructor(e,n){this._parentStart=e,this._source=n}_entries=[];add(e,n){this._entries.push({node:e,start:n})}build(e,n){this._entries.sort((a,u)=>a.start-u.start);let i=[],r=this._parentStart,s=this._parentStart+e,o=(a,u)=>{let c=this._source.substring(a,u),d=n??(/(?:^|[\r\n])[ \t]*>[ \t]?/.test(c)?"blockQuoteSourceGap":void 0),h=d?null:/\n[^\S\n]+$/.exec(c);if(!h){i.push(new Ie(c,d));return}let l=c.slice(h.index+1);i.push(new Ie(c.slice(0,c.length-l.length))),i.push(new Ie(l,"indent"))};for(let{node:a,start:u}of this._entries)a.length!==0&&(u>r&&o(r,u),i.push(a),r=u+a.length);return r<s&&o(r,s),i}},fu=class{constructor(e,n){this._events=e,this._source=n}_idx=0;_checkChecked;build(){let e=new pe(0,this._source),n=0;for(;this._idx<this._events.length;){let i=this._events[this._idx];if(i.type==="enter"){let r=i.startOffset,s=this._tryParseBlock();if(s)e.add(s,r),n=Math.max(n,r+s.length);else{let o=this._tryParseUnhandled(n);o&&(e.add(o.node,o.start),n=Math.max(n,o.start+o.node.length))}}else this._idx++}return new lu(Yb(Xr(Zr(e.build(this._source.length)))))}_tryParseBlock(){switch(this._events[this._idx].tokenType){case"yaml":return this._parseFrontMatter();case"atxHeading":return this._parseHeading();case"paragraph":return this._parseParagraphOrVideo();case"codeFenced":return this._parseCodeFenced();case"codeIndented":return this._parseCodeIndented();case"mathFlow":return this._parseMathFlow();case"thematicBreak":return this._parseThematicBreak();case"blockQuote":return this._parseBlockQuote();case"listUnordered":case"listOrdered":return this._parseList();case"table":return this._parseTable();default:return}}_parseHtmlFlow(){let e=this._idx,{raw:n,startOffset:i,endOffset:r}=this._consumeVerbatimBlock(),s=[new V("content",n)],o=this._logicalHtmlSource(e,this._idx,i,r),a=jl(o);return a.kind==="supported"?new Et(a.attributes,s):new Cn("htmlFlow",s)}_parseUnhandledBlock(){let{tokenType:e,raw:n}=this._consumeVerbatimBlock();return new Cn(e,[new V("content",n)])}_consumeVerbatimBlock(){let e=this._events[this._idx],n=e.tokenType;this._idx++;let i=1,r=e;for(;this._idx<this._events.length&&i>0;){let o=this._events[this._idx];o.tokenType===n&&(i+=o.type==="enter"?1:-1),i===0&&(r=o),this._idx++}let s=this._source.substring(e.startOffset,r.endOffset);return{tokenType:n,raw:s,startOffset:e.startOffset,endOffset:r.endOffset}}_parseParagraphOrVideo(){let e=this._events[this._idx].startOffset,n=qt(this._source,e);if(!Fh(this._source,n))return this._parseParagraph();let i=this._idx,{raw:r,startOffset:s,endOffset:o}=this._consumeVerbatimBlock(),a=this._logicalHtmlSource(i,this._idx,s,o),u=jl(a);if(u.kind==="notVideo")return this._idx=i,this._parseParagraph();let c=[new V("content",r)];return u.kind==="supported"?new Et(u.attributes,c):new Cn("htmlFlow",c)}_logicalHtmlSource(e,n,i,r){let s=[];for(let u=e;u<n;u++){let c=this._events[u];c.type==="enter"&&(c.tokenType==="blockQuotePrefix"||c.tokenType==="listItemIndent")&&c.startOffset>=i&&c.endOffset<=r&&s.push(new T(c.startOffset,c.endOffset))}let o="",a=i;for(let u of s.sort((c,d)=>c.start-d.start))u.start>a&&(o+=this._source.substring(a,u.start)),a=Math.max(a,u.endExclusive);return o+=this._source.substring(a,r),o}_tryParseUnhandled(e){let n=this._events[this._idx],i=n.startOffset;if(i>=e){if(n.tokenType==="htmlFlow")return{node:this._parseHtmlFlow(),start:i};if(Zb.has(n.tokenType))return{node:this._parseUnhandledBlock(),start:i}}this._idx++}_parseHeading(){let e=this._consume("enter","atxHeading"),n=1,i=e.startOffset,r=e.startOffset,s=[];for(;this._notExit("atxHeading");){let d=this._events[this._idx];if(d.type==="enter"&&d.tokenType==="atxHeadingSequence"){let h=this._consume("enter","atxHeadingSequence"),l=this._consume("exit","atxHeadingSequence");r===e.startOffset&&(n=Math.min(6,Math.max(1,l.endOffset-h.startOffset)),i=h.startOffset,r=l.endOffset)}else d.type==="enter"&&d.tokenType==="atxHeadingText"?(this._consume("enter","atxHeadingText"),this._parseInlines(s,"atxHeadingText"),this._consume("exit","atxHeadingText")):this._idx++}let o=this._consume("exit","atxHeading");r>i&&s.length>0&&(r=s[0].start);let a=new V("headingMarker",this._source.substring(e.startOffset,r)),u=new pe(r,this._source);for(let d of s)u.add(d.node,d.start);let c=u.build(o.endOffset-r);return new Vi(n,a,c)}_parseParagraph(){let e=this._consume("enter","paragraph"),n=[];for(;this._notExit("paragraph");)this._parseInlineEvent(n);let i=this._consume("exit","paragraph"),r=new pe(e.startOffset,this._source);for(let s of n)r.add(s.node,s.start);return new Ht(r.build(i.endOffset-e.startOffset))}_parseFrontMatter(){let e=this._consume("enter","yaml"),n=new pe(e.startOffset,this._source),i=!1,r,s;for(;this._notExit("yaml");){let a=this._events[this._idx];if(a.type==="enter"&&a.tokenType==="yamlFence"){let u=this._consume("enter","yamlFence");for(;this._notExit("yamlFence");)this._idx++;let c=this._consume("exit","yamlFence");n.add(new V(i?"closeFence":"openFence",this._source.substring(u.startOffset,c.endOffset)),u.startOffset),i=!0}else a.tokenType==="yamlValue"||a.tokenType==="lineEnding"?(r===void 0&&(r=a.startOffset),s=a.endOffset,this._idx++):this._idx++}let o=this._consume("exit","yaml");return r!==void 0&&n.add(new V("content",this._source.substring(r,s)),r),new ji(n.build(o.endOffset-e.startOffset))}_parseCodeFenced(){let e=this._consume("enter","codeFenced"),n="",i,r,s=new pe(e.startOffset,this._source),o=!1,a,u;for(;this._notExit("codeFenced");){let h=this._events[this._idx];if(h.type==="enter"&&h.tokenType==="codeFencedFence"){let l=this._consume("enter","codeFencedFence");for(;this._notExit("codeFencedFence");){let m=this._events[this._idx];if(m.type==="enter"&&(m.tokenType==="codeFencedFenceInfo"||m.tokenType==="codeFencedFenceMeta")){let p=m.tokenType,g=this._consume("enter",p);for(i??=g.startOffset;this._notExit(p);){let b=this._events[this._idx];p==="codeFencedFenceInfo"&&b.type==="enter"&&b.tokenType==="data"&&(n+=this._source.substring(b.startOffset,b.endOffset)),this._idx++}r=this._consume("exit",p).endOffset}else this._idx++}let f=this._consume("exit","codeFencedFence");s.add(new V(o?"closeFence":"openFence",this._source.substring(l.startOffset,f.endOffset)),l.startOffset),o=!0}else h.tokenType==="codeFlowValue"||h.tokenType==="lineEnding"?(a===void 0&&(a=h.startOffset),u=h.endOffset,this._idx++):this._idx++}let c=this._consume("exit","codeFenced");a!==void 0&&s.add(new V("content",this._source.substring(a,u)),a);let d=i===void 0?"":this._source.substring(i,r);return new rn(n,d,s.build(c.endOffset-e.startOffset))}_parseCodeIndented(){let e=this._consume("enter","codeIndented"),n=new pe(e.startOffset,this._source),i,r,s=()=>{i!==void 0&&(n.add(new V("content",this._source.substring(i,r)),i),i=void 0)};for(;this._notExit("codeIndented");){let a=this._events[this._idx];if(a.type==="enter"&&a.tokenType==="linePrefix"){s();let u=this._consume("enter","linePrefix"),c=this._consume("exit","linePrefix");n.add(new V("codeIndent",this._source.substring(u.startOffset,c.endOffset)),u.startOffset)}else a.tokenType==="codeFlowValue"||a.tokenType==="lineEnding"?(i===void 0&&(i=a.startOffset),r=a.endOffset,this._idx++):this._idx++}s();let o=this._consume("exit","codeIndented");return new rn("","",n.build(o.endOffset-e.startOffset))}_parseMathFlow(){let e=this._consume("enter","mathFlow"),n=new pe(e.startOffset,this._source),i=!1,r,s;for(;this._notExit("mathFlow");){let a=this._events[this._idx];if(a.type==="enter"&&a.tokenType==="mathFlowFence"){let u=this._consume("enter","mathFlowFence");for(;this._notExit("mathFlowFence");)this._idx++;let c=this._consume("exit","mathFlowFence");n.add(new V(i?"closeFence":"openFence",this._source.substring(u.startOffset,c.endOffset)),u.startOffset),i=!0}else a.tokenType==="mathFlowValue"||a.tokenType==="lineEnding"?(r===void 0&&(r=a.startOffset),s=a.endOffset,this._idx++):this._idx++}let o=this._consume("exit","mathFlow");return r!==void 0&&n.add(new V("content",this._source.substring(r,s)),r),new Hi(n.build(o.endOffset-e.startOffset))}_parseThematicBreak(){let e=this._consume("enter","thematicBreak");for(;this._notExit("thematicBreak");)this._idx++;let n=this._consume("exit","thematicBreak"),i=new V("content",this._source.substring(e.startOffset,n.endOffset));return new qi([i])}_parseBlockQuote(){let e=this._consume("enter","blockQuote"),n=new pe(e.startOffset,this._source),i=!1,r=[],s=e.startOffset;for(;this._notExit("blockQuote");){let u=this._events[this._idx];if(u.type==="enter"&&u.tokenType==="blockQuotePrefix"){let c=this._consume("enter","blockQuotePrefix");for(;this._notExit("blockQuotePrefix");)this._idx++;let d=this._consume("exit","blockQuotePrefix");if(!i)n.add(new V("blockQuoteMarker",this._source.substring(c.startOffset,d.endOffset)),c.startOffset);else{let h=r[r.length-1];h&&!/^[\r\n]*$/.test(this._source.substring(h.endOffset,c.startOffset))&&(r=[]),r.push({startOffset:c.startOffset,endOffset:d.endOffset})}s=Math.max(s,d.endOffset)}else if(u.type==="enter"){let c=u.startOffset,d=this._tryParseBlock();if(d)n.add(d,c),i=!0,r=[],s=Math.max(s,c+d.length);else{let h=this._tryParseUnhandled(s);h&&(n.add(h.node,h.start),i=!0,r=[],s=Math.max(s,h.start+h.node.length))}}else this._idx++}let o=this._consume("exit","blockQuote"),a=r[r.length-1];if(a&&/^[\r\n]*$/.test(this._source.substring(a.endOffset,o.endOffset)))for(let u of r)n.add(new V("blockQuoteMarker",this._source.substring(u.startOffset,u.endOffset)),u.startOffset);return new ei(Xr(Zr(n.build(o.endOffset-e.startOffset))))}_parseList(){let e=this._events[this._idx].tokenType,n=e==="listOrdered",i=this._consume("enter",e),r=new pe(i.startOffset,this._source),s,o,a,u,c,d,h=()=>{if(s===void 0||o===void 0||u===void 0)return;let f=new V("listItemMarker",this._source.substring(o,a)),m=d??a,p=u.build(m-a);r.add(new yt(f,Xr(Zr(p)),c),s)};for(;this._notExit(e);){let f=this._events[this._idx];if(f.type==="enter"&&f.tokenType==="listItemPrefix"){for(h(),this._consume("enter","listItemPrefix"),s=f.startOffset,o=f.startOffset,c=void 0,d=void 0,this._checkChecked=void 0;this._notExit("listItemPrefix");)this._idx++;a=this._events[this._idx].endOffset,this._consume("exit","listItemPrefix"),u=new pe(a,this._source)}else if(f.type==="enter"){let m=f.startOffset,p=this._tryParseBlock();if(p&&u)u.add(p,m),d=m+p.length,c===void 0&&this._checkChecked!==void 0&&(c=this._checkChecked);else if(!p){let g=this._tryParseUnhandled(d??a??m);g&&u&&(u.add(g.node,g.start),d=g.start+g.node.length)}}else this._idx++}h();let l=this._consume("exit",e);return new wt(n,Xr(Zr(r.build(l.endOffset-i.startOffset))))}_parseTable(){let e=this._consume("enter","table"),n=new pe(e.startOffset,this._source),i=0;for(;this._notExit("table");){let s=this._events[this._idx];if(s.type==="enter"&&s.tokenType==="tableHead"){for(this._consume("enter","tableHead");this._notExit("tableHead");){let o=this._events[this._idx];if(o.type==="enter"&&o.tokenType==="tableRow"){let a=this._parseTableRow("tableHeader");i=a.cells.length,n.add(a,o.startOffset)}else if(o.type==="enter"&&o.tokenType==="tableDelimiterRow"){let a=o.startOffset;for(;this._notExit("tableDelimiterRow");)this._idx++;let u=this._events[this._idx].endOffset;this._idx++,n.add(this._buildDelimiterRow(a,u,i),a)}else this._idx++}this._consume("exit","tableHead")}else if(s.type==="enter"&&s.tokenType==="tableBody"){for(this._consume("enter","tableBody");this._notExit("tableBody");){let o=this._events[this._idx];o.type==="enter"&&o.tokenType==="tableRow"?n.add(this._parseTableRow("tableData"),o.startOffset):this._idx++}this._consume("exit","tableBody")}else this._idx++}let r=this._consume("exit","table");return new Wi(n.build(r.endOffset-e.startOffset))}_buildDelimiterRow(e,n,i){let r=this._source.substring(e,n),s=[];for(let c=0;c<r.length;c++)r[c]==="|"&&s.push(c);let o=[],a=Math.max(1,i);if(r[0]==="|")for(let c=0;c<a&&c<s.length;c++)o.push(s[c]);else{o.push(0);for(let c=0;c<a-1&&c<s.length;c++)o.push(s[c])}let u=new pe(e,this._source);for(let c=0;c<o.length;c++){let d=o[c],h=c+1<o.length?o[c+1]:r.length,l=new pe(e+d,this._source),f=r.substring(d,h);c===o.length-1&&f.length>1&&f.endsWith("|")?(l.add(new V("tableDelimiter",f.slice(0,-1)),e+d),l.add(new V("tableDelimiterClose","|"),e+d+f.length-1)):l.add(new V("tableDelimiter",f),e+d),u.add(new Ki(l.build(h-d)),e+d)}return new Ui(u.build(n-e))}_parseTableRow(e){let n=this._consume("enter","tableRow"),i=new pe(n.startOffset,this._source);for(;this._notExit("tableRow");){let s=this._events[this._idx];if(s.type==="enter"&&s.tokenType===e){let o=this._consume("enter",e),a=[];for(;this._notExit(e);){let d=this._events[this._idx];if(d.type==="enter"&&d.tokenType==="tableContent"){for(this._consume("enter","tableContent");this._notExit("tableContent");)this._parseInlineEvent(a);this._consume("exit","tableContent")}else this._idx++}let u=this._consume("exit",e),c=new pe(o.startOffset,this._source);for(let d of a)c.add(d.node,d.start);i.add(new Ki(c.build(u.endOffset-o.startOffset,"tableCellGlue")),o.startOffset)}else this._idx++}let r=this._consume("exit","tableRow");return new Ui(i.build(r.endOffset-n.startOffset))}_parseInlines(e,n){for(;this._idx<this._events.length;){let i=this._events[this._idx];if(i.type==="exit"&&i.tokenType===n)return;this._parseInlineEvent(e)}}_parseInlineEvent(e){let n=this._events[this._idx];if(n.type==="enter")switch(n.tokenType){case"strongSequence":case"emphasisSequence":this._parseEmphasisOrStrong(e);return;case"codeText":e.push(this._parseInlineCode());return;case"mathText":e.push(this._parseInlineMath());return;case"link":e.push(this._parseLink());return;case"image":e.push(this._parseImage());return;case"strikethrough":e.push(this._parseStrikethrough());return;case"hardBreakTrailing":case"hardBreakEscape":e.push(this._parseHardBreak());return;case"blockQuotePrefix":{let{marker:i,lineEnding:r}=this._parseBlockQuoteContinuationMarker(),s=e[e.length-1];r&&(!s||s.start+s.node.length<=r.startOffset)&&e.push({node:new Ie(this._source.substring(r.startOffset,r.endOffset),"blockQuoteLineBreak"),start:r.startOffset}),e.push(i);return}}n.type==="exit"&&(n.tokenType==="data"||n.tokenType==="codeTextData")&&e.push({node:new rs(this._source.substring(n.startOffset,n.endOffset)),start:n.startOffset}),n.type==="exit"&&n.tokenType==="taskListCheckValueChecked"?this._checkChecked=!0:n.type==="exit"&&n.tokenType==="taskListCheckValueUnchecked"&&(this._checkChecked=!1),this._idx++}_parseBlockQuoteContinuationMarker(){let e=this._events[this._idx].startOffset,n=this._idx-1;for(;n>=0;){let u=this._events[n];if(u.type!=="exit"||u.tokenType!=="linePrefix"&&u.tokenType!=="listItemIndent"||u.endOffset!==e)break;e=u.startOffset,n--;let c=this._events[n];c?.type==="enter"&&c.tokenType===u.tokenType&&c.startOffset===u.startOffset&&c.endOffset===u.endOffset&&n--}let i=this._events[n],r=this._events[n-1],s=Math.min(i?.endOffset??e,e),o=i?.type==="exit"&&i.tokenType==="lineEnding"&&r?.type==="enter"&&r.tokenType==="lineEnding"&&r.startOffset===i.startOffset&&r.endOffset===i.endOffset&&r.startOffset<s?{startOffset:r.startOffset,endOffset:s}:void 0;for(this._consume("enter","blockQuotePrefix");this._notExit("blockQuotePrefix");)this._idx++;let a=this._consume("exit","blockQuotePrefix");return{marker:{node:new V("blockQuoteContinuationMarker",this._source.substring(e,a.endOffset)),start:e},lineEnding:o}}_parseHardBreak(){let e=this._events[this._idx],n=e.tokenType;for(this._consume("enter",n);this._notExit(n);)this._idx++;let i=this._consume("exit",n).endOffset,r=this._events[this._idx];return r&&r.type==="enter"&&r.tokenType==="lineEnding"&&(this._consume("enter","lineEnding"),i=this._consume("exit","lineEnding").endOffset),{node:new V("hardBreak",this._source.substring(e.startOffset,i)),start:e.startOffset}}_parseEmphasisOrStrong(e){let n=this._events[this._idx].tokenType,i=n==="strongSequence",r=this._consume("enter",n),s=this._consume("exit",n),o=[];for(;this._idx<this._events.length;){let a=this._events[this._idx];if(a.type==="enter"&&a.tokenType===n){let u=this._consume("enter",n),c=this._consume("exit",n),d=new V("openMarker",this._source.substring(r.startOffset,s.endOffset)),h=new V("closeMarker",this._source.substring(u.startOffset,c.endOffset)),l=new pe(s.endOffset,this._source);for(let p of o)l.add(p.node,p.start);let f=l.build(u.startOffset-s.endOffset),m=i?new ru(d,f,h):new su(d,f,h);e.push({node:m,start:r.startOffset});return}this._parseInlineEvent(o)}e.push({node:new rs(this._source.substring(r.startOffset,s.endOffset)),start:r.startOffset})}_parseInlineCode(){let e=this._consume("enter","codeText"),n=new pe(e.startOffset,this._source),i=!1,r,s;for(;this._notExit("codeText");){let a=this._events[this._idx];a.type==="enter"&&a.tokenType==="codeTextSequence"?(n.add(new V(i?"closeMarker":"openMarker",this._source.substring(a.startOffset,a.endOffset)),a.startOffset),i=!0):a.type==="enter"&&a.tokenType==="codeTextData"&&(r===void 0&&(r=a.startOffset),s=a.endOffset),this._idx++}let o=this._consume("exit","codeText");return r!==void 0&&n.add(new V("content",this._source.substring(r,s)),r),{node:new au(n.build(o.endOffset-e.startOffset)),start:e.startOffset}}_parseInlineMath(){let e=this._consume("enter","mathText"),n=new pe(e.startOffset,this._source),i=!1,r,s;for(;this._notExit("mathText");){let a=this._events[this._idx];a.type==="enter"&&a.tokenType==="mathTextSequence"?(n.add(new V(i?"closeMarker":"openMarker",this._source.substring(a.startOffset,a.endOffset)),a.startOffset),i=!0):a.type==="enter"&&a.tokenType==="mathTextData"&&(r===void 0&&(r=a.startOffset),s=a.endOffset),this._idx++}let o=this._consume("exit","mathText");return r!==void 0&&n.add(new V("content",this._source.substring(r,s)),r),{node:new uu(n.build(o.endOffset-e.startOffset)),start:e.startOffset}}_parseStrikethrough(){let e=this._consume("enter","strikethrough"),n,i,r=e.startOffset,s=e.startOffset,o=[];for(;this._notExit("strikethrough");){let c=this._events[this._idx];if(c.type==="enter"&&c.tokenType==="strikethroughSequence"){let d=this._source.substring(c.startOffset,c.endOffset);n?(i=new V("closeMarker",d),s=c.startOffset):(n=new V("openMarker",d),r=c.endOffset),this._idx++}else c.type==="enter"&&c.tokenType==="strikethroughText"?(this._consume("enter","strikethroughText"),this._parseInlines(o,"strikethroughText"),this._consume("exit","strikethroughText")):this._idx++}this._consume("exit","strikethrough");let a=new pe(r,this._source);for(let c of o)a.add(c.node,c.start);let u=a.build(s-r);return{node:new ou(n,u,i),start:e.startOffset}}_parseLink(){let e=this._consume("enter","link"),n=new pe(e.startOffset,this._source),i=[],r="",s=!1;for(;this._notExit("link");){let a=this._events[this._idx];if(a.type==="enter"&&a.tokenType==="label"){for(this._consume("enter","label");this._notExit("label");){let u=this._events[this._idx];if(u.type==="enter"&&u.tokenType==="labelMarker")n.add(new V(s?"closeBracket":"openBracket",this._source.substring(u.startOffset,u.endOffset)),u.startOffset),s=!0;else if(u.type==="enter"&&u.tokenType==="labelText"){this._consume("enter","labelText"),this._parseInlines(i,"labelText"),this._consume("exit","labelText");continue}this._idx++}this._consume("exit","label")}else if(a.type==="enter"&&a.tokenType==="resource"){this._consume("enter","resource");let u=!1;for(;this._notExit("resource");){let c=this._events[this._idx];c.type==="enter"&&c.tokenType==="resourceMarker"?(n.add(new V(u?"closeParen":"openParen",this._source.substring(c.startOffset,c.endOffset)),c.startOffset),u=!0):c.type==="enter"&&c.tokenType==="resourceDestinationString"&&(r=this._source.substring(c.startOffset,c.endOffset),n.add(new V("url",r),c.startOffset)),this._idx++}this._consume("exit","resource")}else if(a.type==="enter"&&a.tokenType==="reference"){this._consume("enter","reference");let u=!1;for(;this._notExit("reference");){let c=this._events[this._idx];c.type==="enter"&&c.tokenType==="referenceMarker"?(n.add(new V(u?"referenceCloseBracket":"referenceOpenBracket",this._source.substring(c.startOffset,c.endOffset)),c.startOffset),u=!0):c.type==="enter"&&c.tokenType==="referenceString"&&n.add(new V("reference",this._source.substring(c.startOffset,c.endOffset)),c.startOffset),this._idx++}this._consume("exit","reference")}else this._idx++}let o=this._consume("exit","link");for(let a of i)n.add(a.node,a.start);return{node:new cu(r,n.build(o.endOffset-e.startOffset)),start:e.startOffset}}_parseImage(){let e=this._consume("enter","image"),n=new pe(e.startOffset,this._source),i="",r="",s=!1;for(;this._notExit("image");){let a=this._events[this._idx];if(a.type==="enter"&&a.tokenType==="label"){for(this._consume("enter","label");this._notExit("label");){let u=this._events[this._idx];u.type==="enter"&&u.tokenType==="labelImageMarker"?n.add(new V("bangBracket",this._source.substring(u.startOffset,u.endOffset)),u.startOffset):u.type==="enter"&&u.tokenType==="labelMarker"?(n.add(new V(s?"closeBracket":"openBracket",this._source.substring(u.startOffset,u.endOffset)),u.startOffset),s=!0):u.type==="enter"&&u.tokenType==="labelText"&&(i=this._source.substring(u.startOffset,u.endOffset)),this._idx++}this._consume("exit","label")}else if(a.type==="enter"&&a.tokenType==="resource"){this._consume("enter","resource");let u=!1;for(;this._notExit("resource");){let c=this._events[this._idx];c.type==="enter"&&c.tokenType==="resourceMarker"?(n.add(new V(u?"closeParen":"openParen",this._source.substring(c.startOffset,c.endOffset)),c.startOffset),u=!0):c.type==="enter"&&c.tokenType==="resourceDestinationString"&&(r=this._source.substring(c.startOffset,c.endOffset)),this._idx++}this._consume("exit","resource")}else this._idx++}let o=this._consume("exit","image");return{node:new du(i,r,n.build(o.endOffset-e.startOffset)),start:e.startOffset}}_notExit(e){if(this._idx>=this._events.length)return!1;let n=this._events[this._idx];return!(n.type==="exit"&&n.tokenType===e)}_consume(e,n){let i=this._events[this._idx];if(!i||i.type!==e||i.tokenType!==n)throw new Error(`Expected ${e}:${n} at ${this._idx}, got ${i?.type}:${i?.tokenType}`);return this._idx++,i}},ss=class{constructor(e){this._edit=e}getOriginalRange(e){let n=0;for(let i of this._edit.replacements){let r=i.replaceRange.start+n;if(r>=e.endExclusive)break;let s=r+i.newText.length;if(Math.max(r,e.start)<Math.min(s,e.endExclusive))return;n+=i.newText.length-i.replaceRange.length}return e.delta(-n)}getOriginalOffset(e){let n=0;for(let i of this._edit.replacements){let r=i.replaceRange.start+n;if(e<r)break;if(e<r+i.newText.length)return;n+=i.newText.length-i.replaceRange.length}return e-n}},mu=class{_byRange=new Map;_byId=new Map;constructor(e){this._walk(e,0)}_walk(e,n){let i=`${n}:${n+e.length}`,r=this._byRange.get(i);r||(r=[],this._byRange.set(i,r)),r.push(e),this._byId.set(`${n}:${e.kind}`,e);let s=n;for(let o of e.children)this._walk(o,s),s+=o.length}lookupExact(e,n){return this._byRange.get(`${e.start}:${e.endExclusive}`)?.find(i=>i.kind===n)}lookupId(e,n){return this._byId.get(`${e}:${n}`)}};function Bh(t,e,n,i,r){let s,o=e;for(let h of t.children){let l=Bh(h,o,n,i,r);l!==h&&(s??=new Map).set(h,l),o+=h.length}let a=s?t.mapChildren(s):t,u=n.getOriginalRange(T.ofStartAndLength(e,t.length));if(u){let h=i.lookupExact(u,a.kind);if(h&&a.equalsShallow(h))return h}let c=n.getOriginalOffset(e),d=c!==void 0?i.lookupId(c,a.kind):void 0;if(d&&d.id!==a.id&&(a=a.cloneWithId(d.id)),a instanceof rn&&d instanceof rn&&c!==void 0){let h=e1(a,d,c,r);if(h)return h}return a}function e1(t,e,n,i){let r=e.code,s=t.code;if(!r||!s||t.infoString!==e.infoString||t.openFence?.content!==e.openFence?.content||t.closeFence?.content!==e.closeFence?.content)return;let o=n+e.codeOffset,a=o+r.length;if(!t1(i,o,a))return;let u=n1(i,-o);if(u.apply(r.content)===s.content)return t.withCodeDiff(e,u)}function t1(t,e,n){for(let i of t.replacements)if(i.replaceRange.start<e||i.replaceRange.endExclusive>n)return!1;return!0}function n1(t,e){return new j(t.replacements.map(n=>Ce.replace(n.replaceRange.delta(e),n.newText)))}function i1(t,e,n){return Bh(t,0,new ss(n),new mu(e),n)}function r1(t,e,n){let i=Kb(t);return!e||!n?i:i1(i,e,n)}var pu=class{parse(e,n,i){return r1(e.value,n,i)}};function s1(t){let e=0,n=[];for(let i of t.replacements){let r=i.replaceRange.start+e;n.push({original:i.replaceRange,modified:T.ofStartAndLength(r,i.newText.length)}),e+=i.newText.length-i.replaceRange.length}return n}var o1={},Dh=H(o1,!1),a1=Dh,gu,ja;function u1(){return ja||(ja=ql({useWasm:!1}).then(t=>{gu=t,Dh.set(!0,void 0)}).catch(()=>{})),ja}u1();function c1(t,e){if(!gu)throw new Error("Diff computer not loaded yet \u2014 await ensureDiffComputer() / observe diffComputerReady first.");let n=gu.computeDiff(t,e,{extendToSubwords:!0});return d1(n.edits.stripData())}function d1(t){return new j(t.replacements.map(e=>Ce.replace(new T(e.range.start,e.range.endExclusive),e.newText)))}var l1=new Set(["document","list","blockQuote","table","tableRow"]),h1=new Set(["glue","marker"]);function f1(t,e,n){let i=new ss(n),r=s1(n);return qh(t,0,e,0,i,r)}function qh(t,e,n,i,r,s){let o=Hl(t,e),a=Hl(n,i),u=[],c=0;for(let d of a){let h=T.ofStartAndLength(d.start,d.node.length),l=r.getOriginalOffset(d.start);for(;c<o.length&&l!==void 0&&o[c].start+o[c].node.length<=l;)u.push(Wl(o[c],s)),c++;let f=c<o.length?o[c]:void 0,m=f?T.ofStartAndLength(f.start,f.node.length):void 0,p=r.getOriginalRange(h);p&&m&&p.equals(m)?(u.push({kind:"unchanged",node:d.node,modifiedStart:d.start}),c++):f&&m&&f.node.kind===d.node.kind&&l!==void 0&&m.contains(l)?(c++,l1.has(d.node.kind)?u.push({kind:"nested",original:f.node,originalStart:f.start,modified:d.node,modifiedStart:d.start,children:qh(f.node,f.start,d.node,d.start,r,s)}):u.push({kind:"replaced",original:f.node,originalStart:f.start,modified:d.node,modifiedStart:d.start,insertedLocal:os(h,d.start,s,"modified","inserted"),deletedLocal:os(m,f.start,s,"original","deleted")})):u.push(m1(d,s))}for(;c<o.length;)u.push(Wl(o[c],s)),c++;return u}function Hl(t,e){let n=[],i=e;for(let r of t.children)h1.has(r.kind)||n.push({node:r,start:i}),i+=r.length;return n}function m1(t,e){let n=T.ofStartAndLength(t.start,t.node.length),i=os(n,t.start,e,"modified","inserted");return i.length===0&&(i=[{range:T.ofLength(t.node.length),kind:"inserted"}]),{kind:"added",node:t.node,modifiedStart:t.start,insertedLocal:i}}function Wl(t,e){let n=T.ofStartAndLength(t.start,t.node.length),i=os(n,t.start,e,"original","deleted");return i.length===0&&(i=[{range:T.ofLength(t.node.length),kind:"deleted"}]),{kind:"removed",node:t.node,originalStart:t.start,deletedLocal:i}}function os(t,e,n,i,r){let s=[];for(let o of n){let a=(i==="original"?o.original:o.modified).intersect(t);a&&!a.isEmpty&&s.push({range:a.delta(-e),kind:r})}return s}var p1=Symbol("NO_ACTIVE_BLOCKS"),as=class{_parser=new pu;_sourceEditListeners=new Set;_sourceTextIds=new WeakMap;_lastSourceTextId=0;_pendingEdit;sourceText=H(this,new Tn(""));wordNavigationConfig=H(this,vn);readonlyMode=H(this,!1);selection=H(this,void 0);selectionSource=H(this,"user");ctrlOrMetaDown=H(this,!1);isSelecting=H(this,!1);gutterMarkers=H(this,[]);activeBlocksOverride=H(this,void 0);pendingParagraph=H(this,void 0);toggleReadonlyMode(){ke(e=>{this.pendingParagraph.set(void 0,e),this.readonlyMode.set(!this.readonlyMode.get(),e)})}cursorOffset=oe(this,e=>e.readObservable(this.selection)?.active);cursorPosition=oe(this,e=>{let n=e.readObservable(this.pendingParagraph);if(n)return ce.virtual(n.cursorLine);let i=e.readObservable(this.selection)?.active;return i===void 0?void 0:ce.source(i)});document=(()=>{let e,n;return oe(this,i=>{let r=i.readObservable(this.sourceText);if(e&&n===r.value)return e;let s=this._pendingEdit,o=s&&s.baseText===n&&s.newText===r.value?s.edit:void 0,a=this._parser.parse(r,e,o);return e=a,n=r.value,a})})();activeBlock=oe(this,e=>{let n=e.readObservable(this.document),i=e.readObservable(this.cursorOffset);if(i!==void 0)return vc(n,i)});activeBlocks=oe(this,e=>{if(this.readonlyMode.read(e))return new Set;if(e.readObservable(this.pendingParagraph)!==void 0)return new Set;let n=e.readObservable(this.activeBlocksOverride);if(n===p1)return new Set;if(n!==void 0)return new Set(n);let i=e.readObservable(this.document),r=e.readObservable(this.selection);return r===void 0?new Set:new Set(bu(i,r.range.start,r.range.endExclusive))});baseline=H(this,void 0);_baselineDocument=oe(this,e=>{let n=e.readObservable(this.baseline);return n?this._parser.parse(n):void 0});diff=oe(this,e=>{let n=e.readObservable(this._baselineDocument),i=e.readObservable(this.baseline);if(!n||!i||!e.readObservable(a1))return;let r=e.readObservable(this.document),s=e.readObservable(this.sourceText),o=c1(i.value,s.value),a=f1(n,r,o),u=[],c=(f,m)=>{for(let p of f)if(p.kind==="replaced")for(let g of p.insertedLocal)u.push(g.range.delta(p.modifiedStart));else if(p.kind==="added"&&!m)for(let g of p.insertedLocal)u.push(g.range.delta(p.modifiedStart));else p.kind==="nested"&&c(p.children,!1)};c(a,!0);let d=new Set,h=f=>{if(f instanceof Et){d.add(f);return}for(let m of f.children)h(m)};for(let f of a)f.kind==="replaced"&&d.add(f.modified);let l=f=>{for(let m of f)m.kind==="replaced"?h(m.modified):m.kind==="nested"&&l(m.children)};return l(a),{items:a,insertedRanges:u,changedBlocks:d}});markerVisibleBlocks=oe(this,e=>{let n=e.readObservable(this.activeBlocks),i=e.readObservable(this.diff),r=this.readonlyMode.read(e)?[]:e.readObservable(this.document).blocks.filter(s=>s.kind==="codeBlock"&&s.openFence!==void 0&&s.closeFence===void 0);return!i&&r.length===0?n:new Set([...n,...i?.changedBlocks??[],...r])});onWillApplySourceEdit(e){return this._sourceEditListeners.add(e),{dispose:()=>this._sourceEditListeners.delete(e)}}getSourceTextId(e){let n=this._sourceTextIds.get(e);return n===void 0&&(n=++this._lastSourceTextId,this._sourceTextIds.set(e,n)),n}armPendingParagraph(e){ke(n=>{this.pendingParagraph.set({...e,text:"",cursorLine:new iu(e.replaceRange.start,e.replaceRange.endExclusive),syntheticAst:new Ht([])},n),this.selectionSource.set("user",n),this.selection.set(N.collapsed(e.replaceRange.start),n)})}cancelPendingParagraph(){this.pendingParagraph.get()!==void 0&&this.pendingParagraph.set(void 0,void 0)}replaceSourceText(e){let n=this.sourceText.get(),i=_d(n.value,e.value),r=this.selection.get(),s=r?new N(Gr(i.mapOffset(Gr(r.anchor,n.value.length)),e.value.length),Gr(i.mapOffset(Gr(r.active,n.value.length)),e.value.length)):void 0;i.isEmpty||(this._pendingEdit={baseText:n.value,newText:e.value,edit:i}),ke(o=>{this.pendingParagraph.set(void 0,o),i.isEmpty||this.sourceText.set(e,o),s!==r&&this.selection.set(s,o)})}setPendingParagraphText(e){if(this.readonlyMode.get())return;if(!/^[ \t]*$/.test(e))throw new TypeError("Pending paragraph text must contain only spaces and tabs");let n=this.pendingParagraph.get();!n||n.text===e||this.pendingParagraph.set({...n,text:e},void 0)}materializePendingParagraph(e){if(this.readonlyMode.get())return;let n=this.pendingParagraph.get();if(!n)return;let i=n.text+e,r=n.separateFromPreviousBlock?`

`:"",s=r+i+(n.atEof?"":`

`),o=n.replaceRange.start+r.length+i.length,a=j.replace(n.replaceRange,s);this._applySourceEdit(a,N.collapsed(o))}setTaskCheckboxChecked(e,n){if(e.checked===n)return;let i=Ve(this.document.get(),e),r=Wb(e);if(i===void 0||r===void 0)return;let s=j.replace(r.delta(i),n?"[x]":"[ ]");this._applySourceEdit(s,this.selection.get()??N.collapsed(0))}applyEdit(e,n){if(this.readonlyMode.get())return;let i=this.selection.get()??N.collapsed(0),r=e.mapOffset(i.active);this._applySourceEdit(e,n??N.collapsed(r))}applyEditForSelection(e){if(this.readonlyMode.get())return;let n=this.selection.get()??N.collapsed(0),i=e.mapOffset(n.range.endExclusive);this._applySourceEdit(e,N.collapsed(i))}_applySourceEdit(e,n){let i=this.sourceText.get(),r=new Tn(e.apply(i.value));this._pendingEdit={baseText:i.value,newText:r.value,edit:e};let s=this._identifySourceEdit(i,r);ke(o=>{this._emitWillApplySourceEdit({...s,edit:e,transaction:o}),this.pendingParagraph.set(void 0,o),this.sourceText.set(r,o),this.selectionSource.set("user",o),this.selection.set(n,o)})}_identifySourceEdit(e,n){return{baseSourceTextId:this.getSourceTextId(e),resultSourceTextId:this.getSourceTextId(n)}}_emitWillApplySourceEdit(e){for(let n of this._sourceEditListeners)n(e)}};function Gr(t,e){return Math.max(0,Math.min(t,e))}function vc(t,e){let n=new Set(t.blocks),i=0,r;for(let s of t.children){let o=i+s.length;if(n.has(s)){if(i<=e&&e<o)return s;o===e&&(r=s)}i=o}return r}function bu(t,e,n){if(e===n){let o=vc(t,e);return o?[o]:[]}let i=[],r=new Set(t.blocks),s=0;for(let o of t.children){let a=s+o.length;r.has(o)&&s<n&&a>e&&i.push(o),s=a}return i}var Zi=class t{constructor(e){this.lines=e,this.sourceLines=e.filter(n=>!n.virtualCursorLine)}static EMPTY=new t([]);static measure(e,n,i=n.capture()){return v1(e,n,i)}sourceLines;get lineCount(){return this.lines.length}get isEmpty(){return this.lines.length===0}lineRect(e){return this.lines[e].rect}lineIndexOfOffset(e){let n=-1;for(let s=0;s<this.lines.length;s++){if(this.lines[s].virtualCursorLine)continue;let o=this.lines[s].offsetMembership(e);if(o==="covers")return s;o==="end"&&n<0&&(n=s)}if(n>=0)return n;let i=0,r=1/0;for(let s=0;s<this.lines.length;s++){if(this.lines[s].virtualCursorLine)continue;let o=this.lines[s].sourceDistanceTo(e);o<r&&(r=o,i=s)}return i}xAtOffset(e){return this.lines.length===0?0:this.lines[this.lineIndexOfOffset(e)].xAtOffset(e)}lineIndexOfPosition(e){if(e.kind==="source")return this.lineIndexOfOffset(e.offset);let n=this.lines.findIndex(i=>i.virtualCursorLine===e.line);return n<0?void 0:n}xAtPosition(e){if(e.kind==="source")return this.xAtOffset(e.offset);let n=this.lineIndexOfPosition(e);return n===void 0?0:this.lines[n].rect.left}lineIndexAtY(e){if(this.lines.length===0)return 0;for(let n=0;n<this.lines.length;n++)if(!this.lines[n].virtualCursorLine&&e<this.lines[n].rect.bottom)return n;for(let n=this.lines.length-1;n>=0;n--)if(!this.lines[n].virtualCursorLine)return n;return 0}offsetAtPoint(e){return this.offsetInLineAtX(this.lineIndexAtY(e.y),e.x)}offsetInLineAtX(e,n){if(e<0||e>=this.lines.length)return 0;let i=this.lines[e].virtualCursorLine;return i?i.sourceOffsetBefore:this.lines[e].offsetAtX(n)}positionInLineAtX(e,n){if(e<0||e>=this.lines.length)return ce.source(0);let i=this.lines[e].virtualCursorLine;return i?ce.virtual(i):ce.source(this.lines[e].offsetAtX(n))}lineStartOffset(e){if(e<0||e>=this.lines.length)return;let n=this.lines[e];if(!n.virtualCursorLine)return n.offsetAtX(n.rect.left)}lineEndOffset(e){if(e<0||e>=this.lines.length)return;let n=this.lines[e];if(!n.virtualCursorLine)return n.offsetAtX(n.rect.right)}},us=class t{constructor(e,n,i){this.rect=e,this.runs=n,this.virtualCursorLine=i}static virtual(e,n){return new t(n,[nn.visualLineAnchor(e.sourceOffsetBefore,n.withZeroWidthAt(n.left))],e)}containsOffset(e){for(let n of this.runs)if(n.containsOffset(e))return!0;return!1}offsetMembership(e){let n=!1;for(let i of this.runs){if(i.isVisualLineAnchor&&e===i.sourceStart||e>=i.sourceStart&&e<i.sourceEndExclusive)return"covers";e===i.sourceEndExclusive&&(n=!0)}return n?"end":"none"}sourceDistanceTo(e){let n=1/0;for(let i of this.runs){let r=i.sourceDistanceTo(e);r<n&&(n=r)}return n}xAtOffset(e){for(let o of this.runs)if(o.isVisualLineAnchor&&o.sourceStart===e)return o.rect.left;for(let o of this.runs)if(o.sourceStart===e)return o.xAtOffset(e);for(let o of this.runs)if(o.containsOffset(e))return o.xAtOffset(e);let n,i=-1/0,r,s=1/0;for(let o of this.runs)o.sourceEndExclusive<=e&&o.sourceEndExclusive>i&&(i=o.sourceEndExclusive,n=o.rect.right),o.sourceStart>=e&&o.sourceStart<s&&(s=o.sourceStart,r=o.rect.left);return n!==void 0?n:r!==void 0?r:this.runs[0].rect.left}offsetAtX(e){if(this.runs.length===0)return 0;let n=this.runs[0],i=1/0;for(let s of this.runs){if(s.rect.containsX(e)||e===s.rect.right)return s.offsetAtX(e);let o=Math.min(Math.abs(e-s.rect.left),Math.abs(e-s.rect.right));o<i&&(i=o,n=s)}let r=Math.min(Math.max(e,n.rect.left),n.rect.right);return n.offsetAtX(r)}},nn=class t{constructor(e,n,i,r=!1){this.sourceRange=e,this.rect=n,this.source=i,this.isVisualLineAnchor=r}static visualLineAnchor(e,n){return new t(T.emptyAt(e),n,void 0,!0)}get sourceStart(){return this.sourceRange.start}get sourceEndExclusive(){return this.sourceRange.endExclusive}get sourceLength(){return this.sourceRange.length}containsOffset(e){return e>=this.sourceStart&&e<=this.sourceEndExclusive}sourceDistanceTo(e){return e<this.sourceStart?this.sourceStart-e:e>this.sourceEndExclusive?e-this.sourceEndExclusive:0}xAtOffset(e){return this.sourceLength===0||e<=this.sourceStart?this.rect.left:this.source?g1(this.source.textNode,this.source.textNodeStart+(e-this.sourceStart),this.rect.left,this.source.coordinateSpace):(e-this.sourceStart)/this.sourceLength<=.5?this.rect.left:this.rect.right}offsetAtX(e){if(this.rect.width<=0)return this.sourceStart;if(this.source){let i=b1(this.source.textNode,this.source.textNodeStart,this.source.textNodeStart+this.sourceLength,e,this.source.coordinateSpace);return this.sourceStart+(i-this.source.textNodeStart)}let n=(this.rect.left+this.rect.right)/2;return e<n?this.sourceStart:this.sourceEndExclusive}};function g1(t,e,n,i){if(e<=0)return n;let r=document.createRange();r.setStart(t,e-1),r.setEnd(t,e);let s=r.getBoundingClientRect();return s.width===0&&s.height===0?n:i.capture().toLocalRect(s).right}function b1(t,e,n,i,r){let s=document.createRange(),o=r.capture(),a=e,u=1/0;for(let c=e;c<n;c++){s.setStart(t,c),s.setEnd(t,c+1);let d=s.getBoundingClientRect();if(d.width===0&&d.height===0)continue;let h=o.toLocalRect(d),l=(h.left+h.right)/2,f=Math.abs(i-h.left),m=Math.abs(i-h.right);if(f<u&&(u=f,a=c),m<u&&(u=m,a=c+1),i>=h.left&&i<=h.right)return i<l?c:c+1}return a}function v1(t,e,n){let i=[];for(let h of t){let l=i.length;h.viewNode.forEachTextLeaf(h.absoluteStart,(f,m)=>{let p=f.dom;if(p.length===0)return;let g=document.createRange();g.selectNodeContents(p);let b=g.getClientRects();if(b.length===0)return;let w=_1(Array.from(b,y=>n.toLocalRect(y))),x=w1(p.parentElement);if(f.sourceLength===0){i.push(nn.visualLineAnchor(m,Ha(w[0],x)));return}if(w.length===1)i.push(new nn(T.fromTo(m,m+p.length),Ha(w[0],x),{textNode:p,textNodeStart:0,coordinateSpace:e}));else{let y=x1(p,w,n);for(let z=0;z<w.length;z++){let k=z===0?0:y[z-1],C=z<y.length?y[z]:p.length;i.push(new nn(T.fromTo(m+k,m+C),Ha(w[z],x),{textNode:p,textNodeStart:k,coordinateSpace:e}))}}}),Vh(i,h.viewNode,h.absoluteStart,n),i.length===l&&y1(i,h.viewNode,h.absoluteStart,n)}i.sort((h,l)=>h.rect.y-l.rect.y||h.rect.x-l.rect.x);let r=[],s=[],o=-1/0,a=0,u=1/0,c=-1/0,d=()=>{s.length!==0&&r.push(new us(Y.fromPointPoint(u,o,c,o+a),s))};for(let h of i){let l=h.rect;s.length>0&&jh(Y.fromPointSize(u,o,c-u,a),l)?(s.push(h),a=Math.max(a,l.y+l.height-o),u=Math.min(u,l.left),c=Math.max(c,l.right)):(d(),s=[h],o=l.y,a=l.height,u=l.left,c=l.right)}return d(),new Zi(r)}function Vh(t,e,n,i){if(e.ast instanceof Et&&e.children.length===0&&e.dom instanceof Element){let s=e.ast.source;if(!s)return;let o=e.dom.getBoundingClientRect();if(o.width===0&&o.height===0)return;let a=i.toLocalRect(o),u=n+(e.ast.leadingTrivia?.length??0);t.push(new nn(T.ofStartAndLength(u,s.length),Y.fromPointSize(a.x,a.y,a.width,a.height)));return}let r=n;for(let s of e.children)Vh(t,s,r,i),r+=s.sourceLength}function _1(t){let e=[];for(let n of t){let i=e[e.length-1];if(!i||!jh(i,n)){e.push(n);continue}e[e.length-1]=Y.fromPointPoint(Math.min(i.left,n.left),Math.min(i.top,n.top),Math.max(i.right,n.right),Math.max(i.bottom,n.bottom))}return e}function jh(t,e){return Math.min(t.bottom,e.bottom)-Math.max(t.top,e.top)>Math.min(t.height,e.height)/2}function x1(t,e,n){let i=[],r=document.createRange();for(let s=0;s<e.length-1;s++){let o=e[s+1].y,a=s===0?0:i[s-1],u=t.length;for(;a<u;){let c=a+u>>>1;r.setStart(t,c),r.setEnd(t,Math.min(c+1,t.length)),n.toLocalRect(r.getBoundingClientRect()).y<o-1?a=c+1:u=c}i.push(a)}return i}function w1(t){if(!t)return 0;let e=getComputedStyle(t),n=parseFloat(e.lineHeight);return isFinite(n)||(n=parseFloat(e.fontSize)*1.2),n}function Ha(t,e){if(e<=t.height)return Y.fromPointSize(t.x,t.y,t.width,t.height);let n=(e-t.height)/2;return Y.fromPointSize(t.x,t.y-n,t.width,e)}function y1(t,e,n,i){let r=e.dom;if(r.nodeType!==1)return;let s=r.getBoundingClientRect();if(s.width===0&&s.height===0)return;let o=i.toLocalRect(s);t.push(new nn(T.fromTo(n,n+e.sourceLength),Y.fromPointSize(o.x,o.y,o.width,o.height)))}var vu=class{_measurements=H(this,[]);measurements=this._measurements;_virtualLines=H(this,[]);visualLineMap=oe(this,e=>{let n=e.readObservable(this._measurements),i=e.readObservable(this._virtualLines),r=new Map;for(let o of i){let a=r.get(o.afterBlock);a?a.push(o.line):r.set(o.afterBlock,[o.line])}let s=n.flatMap(o=>[...o.visualLineMap?.lines??[],...r.get(o.block)??[]]);return new Zi(s)});setMeasurements(e,n){ke(i=>{this._measurements.set(e,i),this._virtualLines.set(n,i)})}},Ul=new WeakMap,Kl=new WeakMap,k1=64;function ii(t,e,n,i,r=T.emptyAt(n)){let s=i==="right"?n+1:n-1;return Nt(t,e,n,s,i,!0,r)}function Nt(t,e,n,i,r,s=!0,o=T.emptyAt(n)){i=Math.min(Math.max(i,0),t.length);let a=Hh(t,e,o);if(r==="right")for(let u=z1(a,i);u<a.length;u++){let c=a[u];if(c.start>i)break;(c.contains(i)||s&&c.start===i)&&(i=c.endExclusive)}else for(let u=C1(a,i);u>=0;u--){let c=a[u];if(c.endExclusive<i)break;(c.contains(i)||s&&c.endExclusive===i)&&(i=c.start)}return i}function Hh(t,e,n){let i=E1(t),r=S1(i,e,n),s=i.rangesByVisibilityKey.get(r);if(s)return i.rangesByVisibilityKey.delete(r),i.rangesByVisibilityKey.set(r,s),s;let o=[],a=new Set;for(let u of e){let c=i.entryByBlock.get(u);c&&c.block!==u&&a.add(c)}for(let u of i.entries)if(!e.has(u.block))o.push(...a.has(u)?Zh(u.block,e).map(c=>c.delta(u.start)):u.hiddenRanges);else if(u.containsList)for(let c of T1(u.block,n.delta(-u.start),e))o.push(c.delta(u.start));return i.rangesByVisibilityKey.set(r,o),i.rangesByVisibilityKey.size>k1&&i.rangesByVisibilityKey.delete(i.rangesByVisibilityKey.keys().next().value),o}function E1(t){let e=Ul.get(t);if(e)return e;let n=new Set(t.blocks),i=[],r=new Map,s=0;for(let o of t.children){if(n.has(o)){let a=o,u={block:a,index:i.length,start:s,hiddenRanges:Zh(a).map(c=>c.delta(s)),containsList:to(a)};i.push(u),r.set(a,u),Wh(a,u,r)}s+=o.length}return e={entries:i,entryByBlock:r,rangesByVisibilityKey:new Map},Ul.set(t,e),e}function Wh(t,e,n){for(let i of t.children)i instanceof Et?n.set(i,e):(i instanceof ei||i instanceof wt||i instanceof yt)&&Wh(i,e,n)}function S1(t,e,n){let i=[];for(let r of e){let s=t.entryByBlock.get(r);if(!s){i.push(`nested:${r.id}`);continue}if(s.block!==r){i.push(`${s.index}:nested:${r.id}`);continue}let o=s.containsList?O1(r,n.delta(-s.start)):"";i.push(`${s.index}:${o}`)}return i.sort(),i.join(",")}function z1(t,e){let n=0,i=t.length;for(;n<i;){let r=n+i>>>1;t[r].endExclusive<e?n=r+1:i=r}return n}function C1(t,e){let n=0,i=t.length;for(;n<i;){let r=n+i>>>1;t[r].start<=e?n=r+1:i=r}return n-1}function Uh(t,e){let n=eo(t),i=0,r=n.length;for(;i<r;){let o=i+r>>>1;n[o].start<=e?i=o+1:r=o}let s=n[i-1];return s&&e<=s.endExclusive?s.index:void 0}function T1(t,e,n){let i=[];return _u(t,0,e,i,n),i.sort((r,s)=>r.start-s.start),i}function _u(t,e,n,i,r){if(!to(t))return;if(t.kind!=="list"){let a=e;for(let u of t.children)_u(u,a,n,i,r),a+=u.length;return}let s=t,o=Kh(s,n.delta(-e));for(let a of eo(s))o.has(a.index)?_u(a.item,e+a.start,n,i,r):_c(a.item,e+a.start,i,r)}function O1(t,e){let n=[],i=(r,s)=>{if(!to(r))return;if(r.kind==="list"){let a=r,u=Kh(a,e.delta(-s));n.push(`${r.id}:${[...u].join(".")}`);for(let c of u){let d=eo(a)[c];d&&i(d.item,s+d.start)}return}let o=s;for(let a of r.children)i(a,o),o+=a.length};return i(t,0),n.join(",")}function Kh(t,e){if(e.isEmpty){let i=Uh(t,e.start);return i===void 0?R1:new Set([i])}let n=new Set;for(let i of eo(t))i.start<e.endExclusive&&i.endExclusive>e.start&&n.add(i.index);return n}var R1=new Set;function eo(t){let e=Kl.get(t);if(e)return e;let n=t.items,i=[],r=0,s=0;for(let o of t.children){let a=n[r];o===a&&(i.push({item:a,index:r,start:s,endExclusive:s+a.length}),r++),s+=o.length}return Kl.set(t,i),i}var Zl=new WeakMap;function to(t){let e=Zl.get(t);if(e!==void 0)return e;let n=t.kind==="list"||t.children.some(to);return Zl.set(t,n),n}function Zh(t,e){let n=[];return _c(t,0,n,e),n.sort((i,r)=>i.start-r.start),n}function _c(t,e,n,i){if(t instanceof Et&&i?.has(t))return;if(t.children.length===0){(t instanceof V||s(t))&&n.push(T.ofStartAndLength(e,t.length));return}switch(t.kind){case"frontMatter":case"codeBlock":case"mathBlock":{let a=e;for(let u of t.children)u instanceof V&&(u.markerKind==="openFence"||u.markerKind==="closeFence")?n.push(T.ofStartAndLength(a,u.length)):s(u)&&n.push(T.ofStartAndLength(a,u.length)),a+=u.length;return}case"inlineCode":case"inlineMath":{let a=e;for(let u of t.children)u instanceof V&&(u.markerKind==="openMarker"||u.markerKind==="closeMarker")?n.push(T.ofStartAndLength(a,u.length)):s(u)&&n.push(T.ofStartAndLength(a,u.length)),a+=u.length;return}case"thematicBreak":r(t,e,n);return;case"video":n.push(T.ofStartAndLength(e,t.length));return;case"unhandledBlock":r(t,e,n);return;case"image":{n.push(T.ofStartAndLength(e,t.length));return}}function r(a,u,c){let d=u;for(let h of a.children)s(h)&&c.push(T.ofStartAndLength(d,h.length)),d+=h.length}function s(a){return a instanceof Ie&&(a.glueKind==="blockQuoteLineBreak"||a.glueKind==="blockQuoteSourceGap")}let o=e;for(let a of t.children)_c(a,o,n,i),o+=a.length}var L1=t=>t.cursorPosition.kind==="virtual"?no(t,t.cursorPosition.line,"after","right"):t.selection.isCollapsed?ce.source(ii(t.document,t.markerVisibleBlocks,t.selection.active,"right",t.selection.range)):ce.source(t.selection.range.endExclusive),I1=t=>t.cursorPosition.kind==="virtual"?no(t,t.cursorPosition.line,"before","left"):t.selection.isCollapsed?ce.source(ii(t.document,t.markerVisibleBlocks,t.selection.active,"left",t.selection.range)):ce.source(t.selection.range.start),M1=t=>t.cursorPosition.kind==="virtual"?no(t,t.cursorPosition.line,"after","right"):ce.source(ii(t.document,t.markerVisibleBlocks,t.selection.active,"right",t.selection.range)),N1=t=>t.cursorPosition.kind==="virtual"?no(t,t.cursorPosition.line,"before","left"):ce.source(ii(t.document,t.markerVisibleBlocks,t.selection.active,"left",t.selection.range)),A1=t=>{let e=t.cursorPosition.kind==="virtual"?t.cursorPosition.line.sourceOffsetAfter:t.selection.active;return ce.source(Nt(t.document,t.markerVisibleBlocks,t.selection.active,jd(t.text,e,t.wordNavigationConfig),"right",!1,t.selection.range))},P1=t=>{let e=t.cursorPosition.kind==="virtual"?t.cursorPosition.line.sourceOffsetBefore:t.selection.active;return ce.source(Nt(t.document,t.markerVisibleBlocks,t.selection.active,Vd(t.text,e,t.wordNavigationConfig),"left",!1,t.selection.range))},xu=t=>t.cursorPosition.kind==="virtual"?t.cursorPosition:ce.source(Nt(t.document,t.markerVisibleBlocks,t.selection.active,t.selection.active===0?0:t.text.lastIndexOf(`
`,t.selection.active-1)+1,"right",!0,t.selection.range)),wu=t=>{if(t.cursorPosition.kind==="virtual")return t.cursorPosition;let e=t.text.indexOf(`
`,t.selection.active);return ce.source(Nt(t.document,t.markerVisibleBlocks,t.selection.active,e===-1?t.text.length:e,"left",!0,t.selection.range))},F1=t=>ce.source(Nt(t.document,t.markerVisibleBlocks,t.selection.active,0,"right",!0,t.selection.range)),$1=t=>ce.source(Nt(t.document,t.markerVisibleBlocks,t.selection.active,t.text.length,"left",!0,t.selection.range)),B1=t=>{if(t.cursorPosition.kind==="virtual")return{position:t.cursorPosition,desiredColumn:void 0};let e=t.lineMap.lineIndexOfPosition(t.cursorPosition);if(e===void 0)return{position:xu(t),desiredColumn:void 0};let n=t.lineMap.lineStartOffset(e),i=t.lineMap.lineEndOffset(e);if(n===void 0||i===void 0)return{position:xu(t),desiredColumn:void 0};let r=n===0?0:t.text.lastIndexOf(`
`,n-1)+1,s=n;if(n===r){for(;s<i&&(t.text[s]===" "||t.text[s]==="	");)s++;s===i&&(s=n)}let o=s!==n&&t.selection.active!==s?s:n;return{position:ce.source(Nt(t.document,t.markerVisibleBlocks,t.selection.active,o,"right",!0,t.selection.range)),desiredColumn:void 0}},D1=t=>{if(t.cursorPosition.kind==="virtual")return{position:t.cursorPosition,desiredColumn:void 0};let e=t.lineMap.lineIndexOfPosition(t.cursorPosition);if(e===void 0)return{position:wu(t),desiredColumn:void 0};let n=t.lineMap.lineEndOffset(e);return n===void 0?{position:wu(t),desiredColumn:void 0}:{position:ce.source(Nt(t.document,t.markerVisibleBlocks,t.selection.active,n,"left",!0,t.selection.range)),desiredColumn:void 0}},q1=t=>{let e=t.lineMap.lineIndexOfPosition(t.cursorPosition);if(e===void 0)return j1(t);let n=t.desiredColumn??t.lineMap.xAtPosition(t.cursorPosition);return e>=t.lineMap.lineCount-1?{position:t.cursorPosition,desiredColumn:n}:{position:t.lineMap.positionInLineAtX(e+1,n),desiredColumn:n}},Xl=t=>{let e=t.lineMap.lineIndexOfPosition(t.cursorPosition);if(e===void 0)return V1(t);if(t.cursorPosition.kind==="virtual"&&e>0)return Xh(t,e-1);let n=t.desiredColumn??t.lineMap.xAtPosition(t.cursorPosition);return e<=0?{position:t.cursorPosition,desiredColumn:n}:{position:t.lineMap.positionInLineAtX(e-1,n),desiredColumn:n}};function no(t,e,n,i){let r=n==="before"?e.sourceOffsetBefore:e.sourceOffsetAfter;return ce.source(Nt(t.document,t.markerVisibleBlocks,t.selection.active,r,i,!0,t.selection.range))}function V1(t){if(t.cursorPosition.kind!=="virtual"||t.lineMap.isEmpty)return{position:t.cursorPosition,desiredColumn:t.desiredColumn};let e=t.lineMap.lineIndexOfOffset(t.cursorPosition.line.sourceOffsetBefore);return Xh(t,e)}function j1(t){if(t.cursorPosition.kind!=="virtual"||t.lineMap.isEmpty)return{position:t.cursorPosition,desiredColumn:t.desiredColumn};let e=t.lineMap.lineIndexOfOffset(t.cursorPosition.line.sourceOffsetBefore),n=t.desiredColumn??t.lineMap.lineRect(e).left;return e>=t.lineMap.lineCount-1?{position:t.cursorPosition,desiredColumn:n}:{position:t.lineMap.positionInLineAtX(e+1,n),desiredColumn:n}}function Xh(t,e){let n=t.lineMap.lineRect(e).right;return{position:t.lineMap.positionInLineAtX(e,n),desiredColumn:n}}var Qi={tabSize:4,insertSpaces:!0},Bi="  ",H1=/^([ \t]*)(`{3,}|~{3,})([ \t]*)$/,W1=/^([ \t]*)(`{3,}|~{3,})/,Gl=t=>{let e=t.selection;if(!e.isCollapsed)return{edit:j.delete(e.range),selection:N.collapsed(e.range.start)};if(e.active===0)return;let n=new T(ii(t.document,t.markerVisibleBlocks,e.active,"left",e.range),e.active);return{edit:j.delete(n),selection:N.collapsed(n.start)}},U1=t=>{let e=t.selection;if(!e.isCollapsed)return{edit:j.delete(e.range),selection:N.collapsed(e.range.start)};if(e.active>=t.text.length)return;let n=new T(e.active,ii(t.document,t.markerVisibleBlocks,e.active,"right",e.range));return{edit:j.delete(n),selection:N.collapsed(n.start)}},K1=t=>{let e=t.selection;if(!e.isCollapsed)return{edit:j.delete(e.range),selection:N.collapsed(e.range.start)};if(e.active===0)return;let n=Hd(t.text,e.active,t.wordNavigationConfig),i=new T(n,e.active),r=io(t,i);if(!r.isEmpty)return{edit:r,selection:N.collapsed(r.mapOffset(n))}},Z1=t=>{let e=t.selection;if(!e.isCollapsed)return{edit:j.delete(e.range),selection:N.collapsed(e.range.start)};if(e.active>=t.text.length)return;let n=Wd(t.text,e.active,t.wordNavigationConfig),i=new T(e.active,n),r=io(t,i);if(!r.isEmpty)return{edit:r,selection:N.collapsed(r.mapOffset(e.active))}},X1=t=>{let e=t.selection;if(!e.isCollapsed)return{edit:j.delete(e.range),selection:N.collapsed(e.range.start)};if(e.active===0)return;let n=t.text.lastIndexOf(`
`,e.active-1)+1;if(n===e.active&&n>0&&n--,n===e.active)return;let i=io(t,new T(n,e.active));if(!i.isEmpty)return{edit:i,selection:N.collapsed(i.mapOffset(n))}},G1=t=>{let e=t.selection;if(!e.isCollapsed)return{edit:j.delete(e.range),selection:N.collapsed(e.range.start)};let n=t.text.indexOf(`
`,e.active),i=n===-1?t.text.length:n===e.active?n+1:n;if(i===e.active)return;let r=io(t,new T(e.active,i));if(!r.isEmpty)return{edit:r,selection:N.collapsed(r.mapOffset(e.active))}};function io(t,e){let n=[],i=e.start;for(let r of Hh(t.document,t.markerVisibleBlocks,t.selection.range))if(!(r.endExclusive<=i)){if(r.start>=e.endExclusive)break;i<r.start&&n.push(Ce.delete(new T(i,Math.min(r.start,e.endExclusive)))),i=Math.max(i,r.endExclusive)}return i<e.endExclusive&&n.push(Ce.delete(new T(i,e.endExclusive))),n.length===0?j.empty:new j(n)}function J1(t,e){return n=>{let i=Q1(n,t,e);if(i)return i;let r=j.replace(n.selection.range,t),s=n.selection.range.start+t.length;return{edit:r,selection:N.collapsed(s)}}}function Q1(t,e,n){let i=t.activeBlock;if(i?.kind!=="codeBlock"||i.language!=="mermaid"||i.closeFence||!i.openFence||!n)return;let r=t.selection.range,s=t.text.lastIndexOf(`
`,r.start-1)+1,o=t.text.indexOf(`
`,r.endExclusive),a=o<0?t.text.length:o,u=t.text.slice(s,r.start)+e+t.text.slice(r.endExclusive,a),c=H1.exec(u);if(!c)return;let d=c[1];if(n.start!==s||n.endExclusive>r.start||n.length!==d.length||n.substring(t.text)!==d)return;let h=Ve(t.document,i);if(h===void 0)return;let l=t.text.lastIndexOf(`
`,h-1)+1;if(l===s)return;let f=t.text.indexOf(`
`,l),m=t.text.slice(l,f<0?t.text.length:f),p=W1.exec(m);if(!p||c[2][0]!==p[2][0]||c[2].length<p[2].length||!d.includes("	")&&d.length<=3)return;let g=p[1];if(!d.startsWith(g)||d.length<=g.length)return;let b=g+c[2]+c[3],w=t.text.slice(s,r.start).length+e.length,x=g.length+Math.max(0,w-d.length);return{edit:j.replace(new T(s,a),b),selection:N.collapsed(s+x)}}function Y1(t=Qi){return ro(t),e=>{let n=e.selection,i=n.range,r=Xe(e.text,i.start),s=Jl(e.text,i.start),o=i.endExclusive<=s&&(i.start!==r||i.endExclusive!==s),a=n.isCollapsed?wc(e.document,e.text,n.active):void 0,u=a?Ve(e.document,a.item):void 0,c=a?Ve(e.document,a.item.marker):void 0;if(a&&u!==void 0&&c!==void 0&&Xe(e.text,c)===r){let f=rf(e.text,u,u+a.item.length,sf(e.text,Xe(e.text,c),c)),m=f[0];if(a.index===0&&c-m>=Bi.length)return;let p=f.filter(b=>b<Jl(e.text,b)).map(b=>Ce.insert(b,Bi)),g=new j(p);return{edit:g,selection:N.collapsed(g.mapOffset(n.active))}}if(n.isCollapsed||o){let f=ef(e.text.slice(Xe(e.text,i.start),i.start),t);return{edit:j.replace(i,f),selection:N.collapsed(i.start+f.length)}}let d=Yh(e.text,i),h=d.map(f=>Ce.insert(f,fv(t))),l=new j(h);return{edit:l,selection:vv(l,n,new Set(d))}}}function Gh(t=Qi){return ro(t),e=>{if(e.selection.isCollapsed){let r=wc(e.document,e.text,e.selection.active),s=r?Ve(e.document,r.item):void 0,o=r?Ve(e.document,r.item.marker):void 0;if(r&&s!==void 0&&o!==void 0&&Xe(e.text,o)===Xe(e.text,e.selection.active)){let a=rf(e.text,s,s+r.item.length,sf(e.text,Xe(e.text,o),o)).flatMap(c=>e.text.slice(c,c+Bi.length)===Bi?[Ce.delete(new T(c,c+Bi.length))]:[]);if(a.length===0)return;let u=new j(a);return{edit:u,selection:N.collapsed(u.mapOffset(e.selection.active))}}}let n=[];for(let r of Yh(e.text,e.selection.range)){let s=pv(e.text,r),o=e.text.slice(r,s),a=tf(o,t);a!==o&&n.push(Ce.replace(new T(r,s),a))}if(n.length===0)return;let i=new j(n);return{edit:i,selection:bv(i,e.selection)}}}var ev=t=>{let e=j.replace(t.selection.range,`

`),n=t.selection.range.start+2;return{edit:e,selection:N.collapsed(n)}},tv=t=>{let e=j.replace(t.selection.range,`
`),n=t.selection.range.start+1;return{edit:e,selection:N.collapsed(n)}},nv=t=>{let e=t.selection.range.start,n=0;for(;n<2&&t.text[e-1-n]===" ";)n++;let i=" ".repeat(2-n)+`
`,r=j.replace(t.selection.range,i),s=e+i.length;return{edit:r,selection:N.collapsed(s)}};function ri(t){let e=t.activeBlock;if(!t.selection.isCollapsed||!e)return;let n=yc(t.document,e);if(n!==void 0)switch(e.kind){case"paragraph":case"heading":case"thematicBreak":case"video":return t.selection.active>=cs(e,n)?Wa(t,e,n):void 0;case"frontMatter":case"codeBlock":return e.closeFence&&t.selection.active>=cs(e,n)?Wa(t,e,n):void 0;case"blockQuote":return uv(t);case"unhandledBlock":{let i=e.htmlComment;if(i?.kind!=="complete")return;let r=n+i.leadingWhitespace.length+i.opening.length+i.body.length+i.closing.length;return t.selection.active>=r?Wa(t,e,n):void 0}default:return}}var iv=t=>{let e=t.selection,n=t.activeBlock;if(!e.isCollapsed||!n)return jt(t);switch(n.kind){case"paragraph":case"heading":case"thematicBreak":return rv(t,n);case"video":return ri(t)??jt(t);case"frontMatter":case"codeBlock":return sv(t,n);case"blockQuote":return av(t);case"list":return cv(t);case"unhandledBlock":return ov(t,n);default:return jt(t)}};function rv(t,e){let n=t.selection,i=yc(t.document,e);if(i===void 0)return jt(t);let r=cs(e,i);return n.active<r?{kind:"edit",edit:j.replace(n.range,`

`),selection:N.collapsed(n.range.start+2)}:ri(t)??jt(t)}function sv(t,e){let n=t.selection,i=ri(t);if(i)return i;let r=t.text.lastIndexOf(`
`,n.active-1)+1,s=r;for(;s<n.active&&(t.text[s]===" "||t.text[s]==="	");)s++;let o=t.text.slice(r,s),a=`
`+o,u=xc(n,a);return u.kind!=="edit"||e.kind!=="codeBlock"||o.length===0?u:{...u,generatedIndentation:T.ofStartAndLength(n.active+1,o.length)}}function Wa(t,e,n){let i=cs(e,n),r=n+e.length;return{kind:"pending",anchorBlock:e,replaceRange:new T(i,r),separateFromPreviousBlock:!0,atEof:r>=t.text.length}}function ov(t,e){return e.htmlComment?.kind!=="complete"?jt(t):ri(t)??jt(t)}function cs(t,e){return e+t.length-_v(t)}function av(t){let e=t.selection,n=Jh(t.text,e.active),i=n.prefix??"> ";if(n.content.slice(i.length).trim()==="")return ri(t)??Qh(t,n.start,n.endExclusive);let r=`
`+i.replace(/\s*$/," ");return xc(e,r)}function uv(t){let e=t.activeBlock;if(!t.selection.isCollapsed||e?.kind!=="blockQuote")return;let n=Jh(t.text,t.selection.active);if(!n.prefix||n.content.slice(n.prefix.length).trim()!==""||t.selection.active<n.start+n.prefix.length)return;let i=yc(t.document,e);if(i===void 0)return;let r=i+e.length;if(!/^[\r\n]*$/.test(t.text.slice(n.endExclusive,r)))return;let s=n.start>i?t.text.lastIndexOf(`
`,n.start-1):-1,o=s>=i;return{kind:"pending",anchorBlock:e,replaceRange:new T(o?s:i,r),separateFromPreviousBlock:o,atEof:r>=t.text.length}}function Jh(t,e){let n=t.lastIndexOf(`
`,e-1)+1,i=hv(t,e),r=t.slice(n,i);return{start:n,endExclusive:i,content:r,prefix:/^(\s*(?:>\s*)+)/.exec(r)?.[1]}}function cv(t){let e=t.selection,n=wc(t.document,t.text,e.active);if(!n)return jt(t);let{item:i,list:r}=n,s=Ve(t.document,i);if(s===void 0)return jt(t);if(lv(t,i,s)){let a=Gh()(t);return a?{kind:"edit",edit:a.edit,selection:a.selection}:Qh(t,s,s+i.length)}let o=`
`+dv(t,r,i);return xc(e,o)}function Qh(t,e,n){let i=e>0?t.text.lastIndexOf(`
`,e-1):-1;return i>=0?{kind:"edit",edit:j.replace(new T(i,n),`

`),selection:N.collapsed(i+2)}:{kind:"edit",edit:j.replace(new T(e,n),""),selection:N.collapsed(e)}}function dv(t,e,n){let i=Ve(t.document,n.marker),r=i===void 0?"":t.text.slice(Xe(t.text,i),i),s=n.marker.content.trim(),o=`${s.charAt(0)||"-"} `;if(e.ordered){let a=/^(\d+)([.)])/.exec(s);a&&(o=`${Number(a[1])+1}${a[2]} `)}return`${r}${o}${n.checked!==void 0?"[ ] ":""}`}function lv(t,e,n){let i=Ve(t.document,e.marker);if(i===void 0)return!1;let r=t.text.slice(i+e.marker.length,n+e.length);return r.trim().length===0||/^\[[ xX]\](?=[ \t\r\n])[ \t\r\n]*$/.test(r)}function xc(t,e){return{kind:"edit",edit:j.replace(t.range,e),selection:N.collapsed(t.range.start+e.length)}}function hv(t,e){let n=t.indexOf(`
`,e);return n===-1?t.length:n}function Xe(t,e){return t.lastIndexOf(`
`,Math.max(0,e-1))+1}function Jl(t,e){let n=t.indexOf(`
`,e);return n===-1?t.length:n}function Yh(t,e){let n=[Xe(t,e.start)],i=e.endExclusive>e.start&&t[e.endExclusive-1]===`
`?e.endExclusive-1:e.endExclusive,r=t.indexOf(`
`,n[0])+1;for(;r>0&&r<=i;)n.push(r),r=t.indexOf(`
`,r)+1;return n}function ef(t,e=Qi){if(ro(e),!e.insertSpaces)return"	";let n=nf(t,e.tabSize);return" ".repeat(e.tabSize-n%e.tabSize)}function fv(t){return t.insertSpaces?" ".repeat(t.tabSize):"	"}function tf(t,e=Qi){ro(e);let n=nf(t,e.tabSize);if(n===0)return t;let i=n-(n%e.tabSize||e.tabSize);return mv(i,e)}function mv(t,e){return e.insertSpaces?" ".repeat(t):"	".repeat(Math.floor(t/e.tabSize))+" ".repeat(t%e.tabSize)}function nf(t,e){let n=0;for(let i of t)n=i==="	"?n+e-n%e:n+1;return n}function pv(t,e){let n=e;for(;t[n]===" "||t[n]==="	";)n++;return n}function wc(t,e,n){let i=(a,u,c,d)=>{let h=a instanceof yt&&c!==void 0&&d!==void 0?{list:c,item:a,index:d}:void 0,l=u,f;for(let m of a.children){let p=l+m.length,g=a instanceof wt&&m instanceof yt?a:c,b=a instanceof wt&&m instanceof yt?a.items.indexOf(m):d;if(l<=n&&n<p)return i(m,l,g,b)??h;p===n&&(f=i(m,l,g,b)??h),l=p}return f??h},r=i(t,0,void 0,void 0);if(r){let a=Ve(t,r.item.marker);if(a!==void 0&&Xe(e,a)===Xe(e,n))return r}let s,o=a=>{if(a instanceof wt)for(let u=0;u<a.items.length;u++){let c=a.items[u],d=Ve(t,c.marker);d!==void 0&&Xe(e,d)===Xe(e,n)&&(s={list:a,item:c,index:u})}for(let u of a.children)o(u)};return o(t),s??r}function rf(t,e,n,i){let r=[],s=Xe(t,e);for(;s<n;){r.push(gv(t,s,i));let o=t.indexOf(`
`,s);if(o===-1)break;s=o+1}return r}function sf(t,e,n){let i=e,r=0;for(;i<n;){let s=i;for(let o=0;o<3&&s<n&&(t[s]===" "||t[s]==="	");o++)s++;if(s>=n||t[s]!==">")break;r++,i=s+1,(t[i]===" "||t[i]==="	")&&i++}return r}function gv(t,e,n){let i=e;for(let r=0;r<n;r++){let s=i;for(let o=0;o<3&&(t[s]===" "||t[s]==="	");o++)s++;if(t[s]!==">")return e;i=s+1,(t[i]===" "||t[i]==="	")&&i++}return i}function bv(t,e){return new N(t.mapOffset(e.anchor),t.mapOffset(e.active))}function vv(t,e,n){let i=r=>{if(!n.has(r))return t.mapOffset(r);let s=0;for(let o of t.replacements){if(o.replaceRange.start>=r)break;s+=o.newText.length-o.replaceRange.length}return r+s};return new N(i(e.anchor),i(e.active))}function ro(t){if(!Number.isInteger(t.tabSize)||t.tabSize<=0)throw new RangeError(`tabSize must be a positive integer, got ${t.tabSize}`)}function jt(t){let e=tv(t);return{kind:"edit",edit:e.edit,selection:e.selection}}function yc(t,e){let n=0;for(let i of t.children){if(i===e)return n;n+=i.length}}function _v(t){let e=t.children,n=0;for(let i=e.length-1;i>=0&&e[i]instanceof Ie;i--)n+=e[i].length;return n}var xv=t=>of(t,!1),wv=t=>of(t,!0),yv=t=>af(t,!1),kv=t=>af(t,!0),Ev=t=>{if(t.text.length===0)return;let e=so(t),n=t.selection.active-ti(t.text,t.selection.active),i,r;e.endExclusive<t.text.length?(i=new T(e.start,e.endExclusive+1),r=e.start):e.start>0?(r=ti(t.text,e.start-1),i=new T(e.start-1,e.endExclusive)):(i=new T(0,t.text.length),r=0);let s=j.delete(i),o=s.apply(t.text),a=ni(o,r);return{edit:s,selection:N.collapsed(Math.min(r+n,a))}},Sv=t=>{let e=ti(t.text,t.selection.range.start),n=ni(t.text,e);if(n===t.text.length)return;let i=so(t),r=i.endExclusive===n?ni(t.text,n+1):i.endExclusive,{text:s,lines:o}=zv(t.text,e,r),a=j.replace(new T(e,r),s),u=t.selection.isCollapsed?N.collapsed(o[0].outputEndExclusive):new N(Ql(o,t.selection.anchor),Ql(o,t.selection.active));return{edit:a,selection:u}};function of(t,e){let n=so(t),i=e&&n.endExclusive===t.text.length?`
${n.text}`:`${n.text}
`,r=e?Math.min(n.endExclusive+1,t.text.length):n.start,s=e?n.start+n.text.length+1:n.start,o=!e||n.endExclusive<t.text.length;return{edit:j.insert(r,i),selection:yu(t.selection,n.start,s,n.text.length+(o?1:0))}}function af(t,e){let n=so(t);if(e){if(n.endExclusive===t.text.length)return;let s=n.endExclusive+1,o=ni(t.text,s),a=t.text.slice(s,o),u=n.start+a.length+1;return{edit:j.replace(new T(n.start,o),`${a}
${n.text}`),selection:yu(t.selection,n.start,u,n.text.length+(o<t.text.length?1:0))}}if(n.start===0)return;let i=ti(t.text,n.start-1),r=t.text.slice(i,n.start-1);return{edit:j.replace(new T(i,n.endExclusive),`${n.text}
${r}`),selection:yu(t.selection,n.start,i,n.text.length+1)}}function so(t){let e=t.selection.range,n=ti(t.text,e.start),i=!t.selection.isCollapsed&&e.endExclusive>n&&ti(t.text,e.endExclusive)===e.endExclusive?e.endExclusive-1:e.endExclusive,r=ni(t.text,i);return{start:n,endExclusive:r,text:t.text.slice(n,r)}}function yu(t,e,n,i){let r=s=>n+Math.min(s-e,i);return new N(r(t.anchor),r(t.active))}function zv(t,e,n){let i=[],r=e;for(;r<=n;){let a=Math.min(ni(t,r),n);if(i.push({start:r,endExclusive:a}),a===n)break;r=a+1}let s="",o=[];for(let a=0;a<i.length;a++){let u=i[a],c=a===0,d=a===i.length-1,h=t.slice(u.start,u.endExclusive),l=c?0:h.length-h.trimStart().length,f=d?0:h.length-h.trimEnd().length,m=u.start+l,p=Math.max(m,u.endExclusive-f),g=t.slice(m,p),b=s.length>0&&g.length>0?" ":"";s+=b;let w=e+s.length;s+=g,o.push({originalStart:u.start,contentStart:m,contentEndExclusive:p,outputStart:w,outputEndExclusive:e+s.length})}return{text:s,lines:o}}function Ql(t,e){let n=t[0];for(let i=t.length-1;i>=0;i--)if(t[i].originalStart<=e){n=t[i];break}return e<=n.contentStart?n.outputStart:e>=n.contentEndExclusive?n.outputEndExclusive:n.outputStart+e-n.contentStart}function ti(t,e){return t.lastIndexOf(`
`,Math.max(0,e-1))+1}function ni(t,e){let n=t.indexOf(`
`,e);return n===-1?t.length:n}var Cv=t=>new N(0,t.text.length),Tv=(t,e)=>{let n=Jo(t.text,e,t.wordNavigationConfig);return new N(n.start,n.end)};function Ov(t,e){return new N(e.start,e.endExclusive)}var Yl=new WeakMap,Ua=new WeakMap,kt=class t extends be{constructor(e,n,i=Rv){super(),this.ast=e,this.dom=n,this._children=i,Yl.set(n,this);for(let r of i)Ua.set(r,this)}_children;get children(){return this._children}_replaceChildren(e){for(let n of this._children)n.dispose();this._children=e;for(let n of e)Ua.set(n,this)}dispose(){for(let e of this._children)e.dispose()}get sourceLength(){return this.ast.length}get mountNode(){return this.dom}get parent(){return Ua.get(this)}static forDom(e){for(let n=e;n;n=n.parentNode){let i=Yl.get(n);if(i)return i}}localOffsetInParent(){let e=this.parent;return e?e._localOffsetOfChild(this):0}_localOffsetOfChild(e){let n=0;for(let i of this.children){if(i===e)return n;n+=i.sourceLength}return n}getLocalSourceRange(e){return this.dom===e.node&&this.dom.nodeType===3?T.emptyAt(Math.max(0,Math.min(e.offset,this.sourceLength))):T.emptyAt(e.offset>=1?this.sourceLength:0)}resolveSource(e){let n=t.forDom(e.node);if(!n)return;let i=n.getLocalSourceRange(e);for(;n!==this;){let r=n.parent;if(!r)return;i=i.delta(n.localOffsetInParent()),n=r}return i.start}sourceToDom(e,n=0){if(e<n||e>n+this.sourceLength)return;if(this.children.length===0)return this.dom.nodeType===3?{node:this.dom,offset:e-n}:void 0;let i=n;for(let r of this.children){let s=i+r.sourceLength;if(e>=i&&e<=s){let o=r.sourceToDom(e,i);if(o)return o}i=s}}forEachTextLeaf(e,n){if(this.children.length===0){this.dom.nodeType===3&&n(this,e);return}let i=e;for(let r of this.children)r.forEachTextLeaf(i,n),i+=r.sourceLength}},Rv=[];function Lv(t){let e=document;if(e.caretPositionFromPoint){let i=e.caretPositionFromPoint(t.x,t.y);return i?{node:i.offsetNode,offset:i.offset}:void 0}let n=e.caretRangeFromPoint?.(t.x,t.y);if(n)return{node:n.startContainer,offset:n.startOffset}}function ku(t,e){let n=t.ownerDocument?.activeElement,i=n instanceof HTMLElement&&e.some(o=>o===n||o instanceof Element&&o.contains(n)),r=t.firstChild,s=0;for(;s<e.length&&r===e[s];s++)r=r.nextSibling;if(!(s===e.length&&r===null)){for(;s<e.length;s++){let o=e[s];r===o?r=o.nextSibling:t.insertBefore(o,r)}for(;r;){let o=r;r=r.nextSibling,t.removeChild(o)}i&&n.isConnected&&n.ownerDocument.activeElement!==n&&n.focus({preventScroll:!0})}}function Iv(t){let e=Mv(t),n=Nv(t),i=Math.max(e,t.length-n);return{text:t.slice(e,i),sourceOffset:e}}function Mv(t){return t.startsWith(`\r
`)?2:t.startsWith("\r")||t.startsWith(`
`)?1:0}function Nv(t){return t.endsWith(`\r
`)?2:t.endsWith("\r")||t.endsWith(`
`)?1:0}var ds=class t{static create(e){let n=document.createElement("span");n.dataset.mdUrl=e.href,n.setAttribute("role","link"),n.tabIndex=0;let i=document.createElement("span");i.textContent=e.authoredLabel;let r=new t(n,i);return r.update(e.presentation),r}static mount(e,n){return new t(e,n)}static clear(e){e.classList.remove("md-rich-link","md-rich-link-unavailable"),delete e.dataset.mdRichLinkKind,delete e.dataset.mdRichLinkStatus,delete e.dataset.mdRichLinkSecondaryStatus,e.removeAttribute("aria-label"),e.removeAttribute("title")}element;authoredLabel;_icon;_title;_detail;_reference;_changes;_status;_secondaryStatus;constructor(e,n){this.element=e,this.authoredLabel=n,this._icon=document.createElement("span"),this._icon.className="md-rich-link-icon codicon",this._icon.setAttribute("aria-hidden","true"),this._title=document.createElement("span"),this._title.className="md-rich-link-title",this._detail=document.createElement("span"),this._detail.className="md-rich-link-detail",this._reference=document.createElement("span"),this._reference.className="md-rich-link-reference",this._changes=Pv(),this._status=eh("md-rich-link-primary-status"),this._secondaryStatus=eh("md-rich-link-secondary-status"),this.authoredLabel.className="md-rich-link-label",this.element.classList.add("md-rich-link"),this._setDefaultOrder()}update(e){if(!e){this._renderUnavailable();return}this.element.classList.remove("md-rich-link-unavailable"),this.element.dataset.mdRichLinkKind=e.kind,this._icon.className=`md-rich-link-icon codicon codicon-${Av[e.kind]}`,this.authoredLabel.hidden=!!e.title,this._title.textContent=e.title??"",this._title.hidden=!e.title,this._detail.textContent=e.detail??"",this._detail.hidden=!e.detail,this._reference.textContent=e.reference??"",this._reference.hidden=!e.reference,Fv(this._changes,e.changes),th(this.element,e.kind,this._status,e.status,"mdRichLinkStatus"),th(this.element,e.kind,this._secondaryStatus,e.secondaryStatus,"mdRichLinkSecondaryStatus"),ku(this.element,Dv(e)?[this._status.root,this.authoredLabel,this._title,this._detail,this._reference,this._changes.root,this._secondaryStatus.root]:[this._icon,this.authoredLabel,this._title,this._detail,this._reference,this._changes.root,this._status.root,this._secondaryStatus.root]),e.ariaLabel?this.element.setAttribute("aria-label",e.ariaLabel):this.element.removeAttribute("aria-label"),e.tooltip?this.element.title=e.tooltip:this.element.removeAttribute("title")}_renderUnavailable(){this.element.classList.add("md-rich-link-unavailable"),delete this.element.dataset.mdRichLinkKind,delete this.element.dataset.mdRichLinkStatus,delete this.element.dataset.mdRichLinkSecondaryStatus,this._setDefaultOrder(),this._icon.className="md-rich-link-icon codicon codicon-link",this.authoredLabel.hidden=!1,this._title.hidden=!0,this._detail.hidden=!0,this._reference.hidden=!0,uf(this._changes),Eu(this._status),Eu(this._secondaryStatus),this.element.removeAttribute("aria-label"),this.element.removeAttribute("title")}_setDefaultOrder(){ku(this.element,[this._icon,this.authoredLabel,this._title,this._detail,this._reference,this._changes.root,this._status.root,this._secondaryStatus.root])}},Av={resource:"link",issue:"issues",pullRequest:"git-pull-request",commit:"git-commit",file:"file",folder:"folder",session:"comment-discussion",repository:"repo",branch:"git-branch"};function eh(t){let e=document.createElement("span");e.className=`md-rich-link-status ${t}`;let n=document.createElement("span");n.className="md-rich-link-status-icon codicon",n.setAttribute("aria-hidden","true");let i=document.createElement("span");return i.className="md-rich-link-status-label",e.append(n,i),{root:e,icon:n,label:i}}function Pv(){let t=document.createElement("span");t.className="md-rich-link-changes";let e=document.createElement("span");e.className="md-rich-link-insertions";let n=document.createElement("span");return n.className="md-rich-link-deletions",t.append(e,n),{root:t,insertions:e,deletions:n}}function Fv(t,e){if(!e){uf(t);return}t.insertions.textContent=`+${e.insertions}`,t.deletions.textContent=`-${e.deletions}`,t.root.hidden=!1}function uf(t){t.insertions.textContent="",t.deletions.textContent="",t.root.hidden=!0}function th(t,e,n,i,r){if(!i){delete t.dataset[r],Eu(n);return}t.dataset[r]=i.kind;let s=Bv(e,i.kind);n.icon.className=`md-rich-link-status-icon codicon codicon-${qv(e,i.kind)}`,n.icon.hidden=s!==void 0,s?(n.pixelSpinner??=$v(n.label),n.pixelSpinner.classList.toggle("monaco-pixel-spinner-ring",s==="ring")):(n.pixelSpinner?.remove(),n.pixelSpinner=void 0),n.label.textContent=i.label,n.root.hidden=!1}function Eu(t){t.icon.hidden=!1,t.pixelSpinner?.remove(),t.pixelSpinner=void 0,t.label.textContent="",t.root.hidden=!0}function $v(t){let e=document.createElement("span");e.className="md-rich-link-status-icon monaco-pixel-spinner",e.setAttribute("aria-hidden","true");for(let n=0;n<6;n++){let i=document.createElement("span");i.className="monaco-pixel-spinner-dot",e.appendChild(i)}return t.before(e),e}function Bv(t,e){if(t==="session")switch(e){case"pending":return"grid";case"warning":return"ring";default:return}}function Dv(t){let e=t.status?.kind;switch(t.kind){case"issue":return e==="open"||e==="closed"||e==="notPlanned";case"pullRequest":return e==="open"||e==="closed"||e==="merged"||e==="draft";case"session":return e!==void 0;default:return!1}}function qv(t,e){if(t==="session")switch(e){case"pending":case"warning":case"success":case"neutral":return"comment-discussion";case"error":return"error"}switch(e){case"open":return t==="pullRequest"?"git-pull-request":"issue-opened";case"closed":return t==="pullRequest"?"git-pull-request-closed":"issue-closed";case"merged":return"git-merge";case"draft":return"git-pull-request-draft";case"notPlanned":return"circle-slash";case"pending":return"circle-filled";case"success":return"pass-filled";case"warning":return"warning";case"error":return"error";case"neutral":return"circle-outline"}}var ee=class extends kt{constructor(e,n,i){super(e.ast,n,i),this.data=e}get block(){return this.data.ast}get element(){return this.dom}get scrollElement(){return this.element}canReuse(e,n){return this.data===e}recordMeasuredHeight(e){}};function ht(t,e,n){if(n instanceof ee){if(n.canReuse(t,e))return n}else if(n?.ast===t.ast)return n;switch(t.kind){case"text":return Hv(t,fe(n,Ji));case"marker":return t.ast.markerKind==="hardBreak"?new ps(t,fe(n,ps)):new hs(t,fe(n,hs));case"glue":return t.ast.glueKind==="blockQuoteLineBreak"?new ms(t,fe(n,ms)):new fs(t,fe(n,fs));case"heading":return new bs(t,e,fe(n,bs));case"paragraph":return new Vt(t,"p","md-block md-paragraph",e,Gn(n));case"frontMatter":return new Es(t,e,fe(n,Es));case"codeBlock":return new zu(t,e,n);case"mathBlock":return new zs(t,e,fe(n,zs));case"thematicBreak":return new vs(t,e,fe(n,vs));case"video":return new _s(t,e,fe(n,_s));case"unhandledBlock":{let i=t.ast.htmlComment;return i?new ws(t,i,e,fe(n,ws)):new xs(t,e,fe(n,xs))}case"blockQuote":return new gs(t,e,fe(n,gs));case"list":return new Cs(t,e,fe(n,Cs));case"listItem":return new Ts(t,e,fe(n,Ts));case"table":return new Os(t,e,fe(n,Os));case"tableRow":return new Rs(t,e,fe(n,Rs));case"tableCell":return new Vt(t,"td","",e,Gn(n));case"strong":return new Vt(t,"strong","",e,Gn(n));case"emphasis":return new Vt(t,"em","",e,Gn(n));case"strikethrough":return new Vt(t,"del","",e,Gn(n));case"inlineCode":return new Ls(t,e,fe(n,Ls));case"inlineMath":return new Is(t,e,fe(n,Is));case"link":return new Ms(t,e,fe(n,Ms));case"image":return new Ns(t,e,fe(n,Ns));case"document":return new Vt(t,"div","",e,Gn(n));case"diffHunk":return new Xi(t,e,fe(n,Xi));case"diffDecoration":return new Gi(t,e,fe(n,Gi))}}function fe(t,e){return t instanceof e?t:void 0}function Gn(t){return t instanceof Vt?t:void 0}function Je(t,e,n,i){let{paired:r,unused:s}=Ec(e,n??Se),o=e.map(a=>i(a,r.get(a)));for(let a of s)a.dispose();return Vv(t,o),o}function Vv(t,e){lt(t,e.map(n=>n.mountNode))}var lt=ku;function At(t){return(e,n)=>ht(e,t,n)}function cf(t){return(e,n)=>e.kind==="marker"&&e.ast.markerKind==="content"?new Ji(e,document.createTextNode(e.ast.content)):ht(e,t,n)}var Se=[],Xi=class extends ee{_originalNode;_modifiedNode;constructor(e,n,i){let r=i?.dom??document.createElement("div");r.className="md-block md-diff-hunk";let s=[],o=[],a=e.original?nh(e.original,"md-diff-original",n,i?._originalNode):void 0,u=e.modified?nh(e.modified,"md-diff-modified",n,i?._modifiedNode):void 0;a&&(s.push(a),o.push(a.mountNode)),u&&(s.push(u),o.push(u.mountNode)),lt(r,o),super(e,r,s),this._originalNode=a,this._modifiedNode=u}get sides(){let e=[];return this._originalNode&&this.data.original&&e.push({node:this._originalNode,ranges:this.data.original.ranges}),this._modifiedNode&&this.data.modified&&e.push({node:this._modifiedNode,ranges:this.data.modified.ranges}),e}};function nh(t,e,n,i){let r=ht(t.view,n,i),s=r.element;return s.classList.add(e),s.classList.toggle("md-block-active",t.active),s.classList.toggle("md-markers-hidden",!t.active),r}var Gi=class extends ee{sideNode;constructor(e,n,i){let r=i?.dom??document.createElement("div");r.className="md-block md-diff-decoration",r.style.pointerEvents="none";let s=ht(e.side,n,i?.sideNode),o=s.element,a=!e.whole||e.side.kind==="video";o.classList.add(e.whole?"md-diff-removed":"md-diff-original"),o.classList.toggle("md-block-active",a),o.classList.toggle("md-markers-hidden",!a),lt(r,[s.mountNode]),super(e,r,[s]),this.sideNode=s}get sourceLength(){return 0}get whole(){return this.data.whole}get originalStart(){return this.data.originalStart}get deletedRanges(){return this.data.deletedRanges}};function df(t){return"content"in t?t.content:jv}var jv=[];function Hv(t,e){let n=t.ast.content;if(t.hiddenPrefixLength>0)return Wv(t,n,t.hiddenPrefixLength);let i={leftBoundary:t.leftWordBoundary,rightBoundary:t.rightWordBoundary,decorateNewline:!0};if(t.showWhitespace&&kc(n,i)){let o=document.createElement("span");o.className="md-text";let a=si(o,n,i,t.ast);return new ee(t,o,a)}let r=e?.dom,s=r instanceof globalThis.Text&&r.data===n?r:document.createTextNode(n);return new Ji(t,s)}function Wv(t,e,n){let i=document.createElement("span");i.className="md-text";let r=document.createElement("span");r.className="md-runner-marker",r.setAttribute("aria-hidden","true");let s=document.createTextNode(e.slice(0,n));r.appendChild(s),i.appendChild(r);let o=document.createTextNode(e.slice(n));return i.appendChild(o),new ee(t,i,[new Me(t.ast,s,Se,n),new Me(t.ast,o,Se,e.length-n)])}function ih(t){return t===" "||t==="	"||t===`
`||t==="\r"}var Uv={leftBoundary:!1,rightBoundary:!1,decorateNewline:!1},Su={leftBoundary:!1,rightBoundary:!1,decorateNewline:!0},Kv={leftBoundary:!1,rightBoundary:!1,decorateNewline:!1};function Zv(t,e,n){let i=e>0?!ih(t[e-1]):n.leftBoundary,r=e<t.length-1?!ih(t[e+1]):n.rightBoundary;return i&&r}function lf(t,e,n){let i=t[e];if(i==="	")return"md-ws-tab";if(i===`
`||i==="\r")return n.decorateNewline?"md-ws-newline":void 0;if(i===" "&&!Zv(t,e,n))return"md-ws-space"}function kc(t,e){for(let n=0;n<t.length;n++){let i=t[n];if(e.newlineGlyph&&(i===`
`||i==="\r")||lf(t,n,e)!==void 0)return!0}return!1}function Xv(t,e){let n=[],i=-1,r=a=>{i>=0&&(n.push({text:t.slice(i,a),cls:void 0}),i=-1)},s=e.breakGlyphClass?t.indexOf(`
`):-1,o=e.newlineGlyph?t.lastIndexOf(`
`):-1;for(let a=0;a<t.length;a++){let u=t[a];if(e.newlineGlyph&&(u===`
`||u==="\r")){let d=a===s;if(a!==o||d){r(a),n.push({text:u,cls:d?e.breakGlyphClass:"md-ws-newline-glyph",display:"\u21B5"});continue}}let c=e.newlineGlyph&&(u===`
`||u==="\r")?void 0:lf(t,a,e);if(c===void 0){i<0&&(i=a);continue}r(a),n.push({text:u,cls:c})}return r(t.length),n}function si(t,e,n,i){let r=[];for(let s of Xv(e,n)){let o=document.createTextNode(s.display??s.text);if(s.cls){let a=document.createElement("span");a.className=s.cls,a.appendChild(o),t.appendChild(a)}else t.appendChild(o);r.push(new Me(i,o,Se,s.text.length))}return r}var Ji=class extends ee{constructor(e,n){super(e,n,Se)}},Me=class extends kt{_sourceLength;constructor(e,n,i=Se,r=e.length){super(e,n,i),this._sourceLength=r}get sourceLength(){return this._sourceLength}},ls=class extends Me{_span;constructor(e,n){let i=document.createElement("span");n&&(i.className=n),i.setAttribute("aria-hidden","true"),i.style.userSelect="none";let r=document.createTextNode("\u200B");i.appendChild(r),super(e,r,Se,0),this._span=i}get mountNode(){return this._span}},hs=class extends ee{_span;constructor(e,n){let i=e.ast,r=`md-marker md-marker-${i.markerKind}`;if(e.visible&&(i.markerKind==="reference"||i.markerKind==="blockQuoteContinuationMarker")&&kc(i.content,Su)){let u=document.createElement("span");u.className=r;let c=si(u,i.content,Su,i);super(e,u,c),this._span=u;return}let s=n&&n.dom instanceof globalThis.Text&&n.dom.data===i.content,o=s?n._span:document.createElement("span");o.className=e.visible?r:`${r} md-marker-hidden`;let a=s?n.dom:document.createTextNode(i.content);s||o.appendChild(a),super(e,a,Se),this._span=o}get mountNode(){return this._span}},fs=class t extends ee{_span;constructor(e,n){let i=t._build(e,n);super(e,i.dom,i.children),this._span=i.span}get mountNode(){return this._span}static _build(e,n){let i=e.ast,r=i.glueKind?`md-glue md-glue-${i.glueKind}`:"md-glue",s=i.glueKind==="blockBreak",o=i.glueKind==="blockGap"||i.glueKind==="blockQuoteSourceGap",a={leftBoundary:!1,rightBoundary:!1,decorateNewline:e.decorateNewline,newlineGlyph:o||s,breakGlyphClass:s?"md-ws-blockbreak-glyph":void 0};if(e.visible&&kc(i.content,a)){let h=document.createElement("span");h.className=r;let l=si(h,i.content,a,i);return{span:h,dom:h,children:l}}let u=n&&n.dom instanceof globalThis.Text&&n.dom.data===i.content&&n.children.length===0,c=u?n._span:document.createElement("span");c.className=e.visible?r:`${r} md-glue-hidden`;let d=u?n.dom:document.createTextNode(i.content);return u||c.appendChild(d),{span:c,dom:d,children:Se}}},ms=class extends ee{_span;_holder;_break;constructor(e,n){let i=n?._span??document.createElement("span");i.className="md-glue md-glue-blockQuoteLineBreak md-blockquote-linebreak";let r=n?.data.ast===e.ast&&n.data.visible===e.visible,s=r?n._holder:document.createElement("span"),o=r?n.children:e.visible?si(s,e.ast.content,Su,e.ast):hf(s,e.ast.content,e.ast);s.className=e.visible?"md-blockquote-linebreak-source":"md-blockquote-linebreak-source md-blockquote-linebreak-source-hidden";let a=n?._break??document.createElement("br");lt(i,[s,a]),super(e,i,o),this._span=i,this._holder=s,this._break=a}get mountNode(){return this._span}},ps=class extends ee{_span;constructor(e,n){let i=e.ast.content,r=document.createElement("span");r.className="md-hardbreak";let s=document.createElement("span");s.className=e.visible?"md-hardbreak-src":"md-hardbreak-src md-hardbreak-src-hidden";let o=e.visible?si(s,i,Uv,e.ast):hf(s,i,e.ast);r.appendChild(s),r.appendChild(document.createElement("br")),super(e,r,o),this._span=r}get mountNode(){return this._span}};function hf(t,e,n){let i=document.createTextNode(e);return t.appendChild(i),[new Me(n,i)]}var Vt=class extends ee{constructor(e,n,i,r,s){let o=s?.element??document.createElement(n);!s&&i&&(o.className=i);let a=Je(o,df(e),s?.children,At(r));super(e,o,a)}},gs=class extends ee{_sourceChildren;_anchors;constructor(e,n,i){let r=i?.element??document.createElement("blockquote");i||(r.className="md-block md-blockquote");let s=Je(r,e.content,i?._sourceChildren,At(n)),o=Gv(e.ast),a=e.showFinalMarkerOnlyLine?o:o.slice(0,-1);r.classList.toggle("md-blockquote-marker-only-line",a.length>0);let u=new Map(i?._anchors.map(l=>[l.ast.id,l])),c=a.map(({marker:l})=>{let f=u.get(l.id)??new ls(l,"md-blockquote-line-anchor");return u.delete(l.id),f});for(let l of u.values())l.dispose();let d=new Map(a.map(({index:l},f)=>[l,c[f]])),h=[];for(let l=0;l<s.length;l++){h.push(s[l]);let f=d.get(l);f&&h.push(f)}lt(r,h.map(l=>l.mountNode)),super(e,r,h),this._sourceChildren=s,this._anchors=c}};function Gv(t){let e=[];for(let n=t.children.length-1;n>=0;n--){let i=t.children[n];if(!(i instanceof Ie)){if(i instanceof V&&i.markerKind==="blockQuoteMarker"){e.push({index:n,marker:i});continue}break}}return e.reverse()}var bs=class extends ee{constructor(e,n,i){let r=i&&i.element.tagName===`H${e.ast.level}`,s=r?i.element:document.createElement(`h${e.ast.level}`);r||(s.className="md-block md-heading");let o=Je(s,e.content,i?.children,At(n));super(e,s,o)}},vs=class extends ee{_contentEl;constructor(e,n,i){if(e.showMarkup){let o=i?.data.showMarkup?i:void 0,a=o?.dom??document.createElement("div");o||(a.className="md-block md-thematic-break-source");let u=Je(a,e.content,o?.children,At(n));super(e,a,u),this._contentEl=a;return}let r=document.createElement("div");r.className="md-block md-thematic-break-wrapper";let s=document.createElement("hr");s.className="md-block md-thematic-break",r.appendChild(s),super(e,r,Se),this._contentEl=s}get element(){return this._contentEl}},_s=class extends ee{_video;_editContextSuspension;_editContextSuspensionFactory;constructor(e,n,i){let r=n?.suspendEditContextWhileFocused;if(e.showMarkup){i?._disposeEditContextSuspension();let f=i?.data.showMarkup===!0&&i.dom instanceof HTMLDivElement?i:void 0,m=f?.element??document.createElement("div");f===void 0&&(m.className="md-block md-video-source"),rh(m,e);let p=Je(m,e.content,f?.children,At(n));super(e,m,p),this._video=void 0,this._editContextSuspensionFactory=r;return}let s=i?.data.showMarkup===!1?i._video:void 0,o=i?.data.showMarkup===!1&&i.dom instanceof HTMLDivElement?i.dom:void 0,a=o??document.createElement("div");o||(a.className="md-block md-video-wrapper"),rh(a,e);let u=s??document.createElement("video");s===void 0&&(u.className="md-video",u.addEventListener("pointerdown",f=>{u.controls&&f.stopPropagation()}),a.appendChild(u));let c;s&&i?._editContextSuspension&&i._editContextSuspensionFactory===r&&(c=i._editContextSuspension,i._editContextSuspension=void 0),i?._disposeEditContextSuspension();let d=e.ast.attributes,h=As(d.src)?d.src:void 0;h===void 0?u.hasAttribute("src")&&(u.removeAttribute("src"),u.load()):u.getAttribute("src")!==h&&(u.setAttribute("src",h),u.load()),d.title===void 0?(u.removeAttribute("title"),u.removeAttribute("aria-label")):(u.title=d.title,u.setAttribute("aria-label",d.title)),u.autoplay=d.autoplay,u.controls=d.controls,u.loop=d.loop;let l=u.defaultMuted!==d.muted;u.defaultMuted=d.muted,(s===void 0||l)&&(u.muted=d.muted),super(e,a,Se),this._video=u,this._editContextSuspensionFactory=r,this._editContextSuspension=c??r?.(u)}_disposeEditContextSuspension(){this._editContextSuspension?.dispose(),this._editContextSuspension=void 0}dispose(){this._disposeEditContextSuspension(),super.dispose()}};function rh(t,e){t.classList.toggle("md-diff-added",e.diffKind==="added"),t.classList.toggle("md-diff-modified",e.diffKind==="modified")}var xs=class extends ee{_scroller;constructor(e,n,i){let r=i&&i.dom instanceof HTMLDivElement?i:void 0,s=r?.dom??document.createElement("div");r||(s.className="md-block md-unhandled-block");let o=r?._scroller??document.createElement("pre");r||(o.className="md-code-block md-unhandled-scroll",s.appendChild(o));let a=(r?o.querySelector("code"):null)??document.createElement("code");r||o.appendChild(a);let u=Je(a,e.content,r?.children,(c,d)=>{let h=c.ast;if(c.kind==="marker"&&h.markerKind==="content"){let l=(d instanceof Me&&d.dom.nodeType===globalThis.Node.TEXT_NODE&&d.dom.data===h.content?d.dom:void 0)??document.createTextNode(h.content);return new Me(h,l)}return ht(c,n,d)});super(e,s,u),this._scroller=o}get element(){return this._scroller}},ws=class extends ee{constructor(e,n,i,r){let s=r?.dom instanceof HTMLDivElement?r.dom:document.createElement("div");s.className=`md-block md-html-comment md-html-comment-${n.kind}${e.showMarkup?" md-html-comment-source":""}`;let o=Je(s,e.content,r?.children,(a,u)=>{let c=a.ast;return a.kind==="marker"&&c.markerKind==="content"?new ys(c,n,fe(u,ys)):ht(a,i,u)});super(e,s,o)}},ys=class extends kt{constructor(e,n,i){let r=i?.dom instanceof HTMLSpanElement?i.dom:document.createElement("span");r.className="md-html-comment-content";let s=[{className:"md-html-comment-syntax",content:n.leadingWhitespace},{className:"md-html-comment-syntax",content:n.opening},{className:"md-html-comment-body",content:n.body}];n.kind==="complete"&&s.push({className:"md-html-comment-syntax",content:n.closing},{className:"md-html-comment-syntax",content:n.trailingWhitespace});let o=s.filter(a=>a.content.length>0).map((a,u)=>{let c=i?.children[u]instanceof ks?i.children[u]:void 0,d=c?.mountNode instanceof HTMLSpanElement?c.mountNode:document.createElement("span");d.className=a.className;let h=c?.dom instanceof Text?c.dom:void 0,l=h?.data===a.content?h:document.createTextNode(a.content);return lt(d,[l]),new ks(e,l,d,a.content.length)});lt(r,o.map(a=>a.mountNode)),super(e,r,o)}},ks=class extends Me{constructor(e,n,i,r){super(e,n,Se,r),this._span=i}get mountNode(){return this._span}},Es=class extends ee{_session;_snapshotSub;constructor(e,n,i){let r=e.ast,s=r.value,o=s?.content??"",a=n?.syntaxHighlighter,u;s&&a&&(i?._session&&r===i.ast?(u=i._session,i._session=void 0):u=a.create("yaml",o)),i?._session?.dispose(),i&&(i._session=void 0),i?._snapshotSub?.dispose(),i&&(i._snapshotSub=void 0);let c=u?u.snapshot.get().getTokens(T.ofLength(o.length)).tokens:void 0,d=ff(e.content,s,o,n,"md-block md-code-block md-front-matter","yaml",c);if(super(e,d.dom,d.children),this._session=u,u&&d.contentNode){let h=d.contentNode;this._snapshotSub=wi(u.snapshot,()=>{let l=u.snapshot.get();h.refresh(o,l.getTokens(T.ofLength(o.length)).tokens)})}}dispose(){this._snapshotSub?.dispose(),this._snapshotSub=void 0,this._session?.dispose(),this._session=void 0,super.dispose()}},zu=class t extends ee{_session;_snapshotSub;_embeddedEditor;_embeddedEditorFactoryVersion;_embeddedEditorReadOnly;canReuse(e,n){return super.canReuse(e,n)&&Object.is(n?.embeddedCodeEditorFactoryVersion,this._embeddedEditorFactoryVersion)&&(!this._embeddedEditor||(n?.embeddedCodeEditorReadOnly??!1)===this._embeddedEditorReadOnly)}constructor(e,n,i){let r=e.ast,s=r.code?.content??"",o=i instanceof t?i:void 0,a=n?.embeddedCodeEditorReadOnly??!1,u=Iv(s),c;!e.showMarkup&&r.language&&r.code&&r.closeFence&&u.sourceOffset>0&&n?.embeddedCodeEditorFactory&&(o?._embeddedEditor&&Object.is(n.embeddedCodeEditorFactoryVersion,o._embeddedEditorFactoryVersion)&&(r===o.ast||r.getDiff(o.ast))?(c=o._embeddedEditor,o._embeddedEditor=void 0):c=n.embeddedCodeEditorFactory.create(r.language,r.infoString,u.text)??void 0),o?._embeddedEditor&&(o._embeddedEditor.dispose(),o._embeddedEditor=void 0);let d=!c&&!e.showMarkup&&r.language&&r.closeFence&&n?.renderCustomCodeBlock?Jv(n.renderCustomCodeBlock,r.language,s):void 0,h=n?.syntaxHighlighter,l;if(!c&&!d&&h&&r.language){if(o?._session&&r===o.ast)l=o._session,o._session=void 0;else if(o?._session){let b=r.getDiff(o.ast);b&&(l=o._session,o._session=void 0,ke(w=>l.update(b.stringEdit,w)))}l||(l=h.create(r.language,s))}o?._session&&(o._session.dispose(),o._session=void 0),o?._snapshotSub?.dispose(),o&&(o._snapshotSub=void 0);let f=l?l.snapshot.get().getTokens(T.ofLength(s.length)).tokens:void 0,m,p,g;if(c){c.element.classList.add("md-block","md-code-block");let b=c.estimateHeight?.(u.text);b!==void 0&&(c.element.style.boxSizing="border-box",c.element.style.minHeight=`${b}px`),c.onEdit=w=>{let x=u.sourceOffset===0?w:new j(w.replacements.map(y=>Ce.replace(y.replaceRange.delta(u.sourceOffset),y.newText)));n?.onEmbeddedCodeEditorEdit?.(r,x)},c.setReadOnly?.(n?.embeddedCodeEditorReadOnly??!1),c.setContent(u.text),m=c.element,p=Se}else if(d)d.classList.add("md-block","md-code-block"),m=d,p=Se;else if(r.openFence){let b=ff(e.content,r.code,s,n,"md-block md-code-block",r.language||void 0,f),w=b.dom,x=b.children;if(g=b.contentNode,!r.closeFence&&r.code&&s.endsWith(`
`)){let y=new ls(r.code);w.appendChild(y.mountNode),x.push(y)}m=w,p=x}else{let b=document.createElement("pre");b.className="md-block md-code-block";let w=document.createElement("code");b.appendChild(w);let x=[];for(let y of e.content){let z=y.ast;if(y.kind==="marker"&&z.markerKind==="content"){let k=document.createTextNode(z.content);w.appendChild(k),x.push(new Me(z,k))}else if(y.kind==="marker"&&z.markerKind==="codeIndent"){let k=z;if(y.visible){let C=document.createElement("span");C.className="md-marker md-marker-codeIndent";let L=si(C,k.content,Kv,k);w.appendChild(C),x.push(new Me(k,C,L))}else{let C=ht(y,n,void 0);w.appendChild(C.mountNode),x.push(C)}}else{let k=ht(y,n,void 0);b.appendChild(k.mountNode),x.push(k)}}m=b,p=x}super(e,m,p),this._session=l,this._embeddedEditor=c,this._embeddedEditorFactoryVersion=n?.embeddedCodeEditorFactoryVersion,this._embeddedEditorReadOnly=a,l&&g&&(this._snapshotSub=wi(l.snapshot,()=>{let b=l.snapshot.get();g.refresh(s,b.getTokens(T.ofLength(s.length)).tokens)}))}dispose(){this._snapshotSub?.dispose(),this._snapshotSub=void 0,this._session?.dispose(),this._session=void 0,this._embeddedEditor?.dispose(),this._embeddedEditor=void 0,super.dispose()}};function Jv(t,e,n){try{return t(e,n)}catch(i){console.error(`Custom code block renderer failed for ${e}.`,i);return}}function ff(t,e,n,i,r,s,o){let a=document.createElement("pre");a.className=r;let u=[],c;for(let d of t)if(e&&d.ast===e){let h=document.createElement("code");s&&(h.className=`language-${CSS.escape(s)}`);let l=Qv(e,n,h,o);l instanceof Ss&&(c=l),u.push(l),a.appendChild(h)}else{let h=ht(d,i,void 0);a.appendChild(h.mountNode),u.push(h)}return{dom:a,children:u,contentNode:c}}function Qv(t,e,n,i){if(!i){let r=document.createTextNode(e);return n.appendChild(r),new Me(t,r)}return new Ss(t,n,e,i)}var Ss=class extends kt{constructor(e,n,i,r){super(e,n,sh(e,n,i,r))}refresh(e,n){let i=this.dom;i.replaceChildren(),this._replaceChildren(sh(this.ast,i,e,n))}};function sh(t,e,n,i){let r=[],s=0;for(let o of i){let a=n.slice(s,s+o.length);s+=o.length;let u=document.createTextNode(a);if(o.className){let c=document.createElement("span");for(let d of o.className.split("."))d&&c.classList.add(`tok-${d}`);c.appendChild(u),e.appendChild(c)}else e.appendChild(u);r.push(new Me(t,u,Se,a.length))}return r}function mf(t){let e=0;for(let n of t){if(n.kind==="marker"&&n.markerKind==="content")return e;e+=n.length}return e}function pf(t,e,n){let i=e.filter(a=>a.length>0&&a.start>=0&&a.start+a.length<=n).slice().sort((a,u)=>a.start-u.start),r=[],s=0,o=a=>{a>0&&r.push(new Me(t,document.createTextNode(""),Se,a))};for(let a of i)a.start<s||(o(a.start-s),r.push(new Me(t,a.dom,Se,a.length)),s=a.start+a.length);return o(n-s),r}var zs=class extends ee{_renderedHeight;constructor(e,n,i){let r=e.ast,s=i?._renderedHeight;if(e.showMarkup){let c=document.createElement("pre");c.className="md-block md-math-block",s!==void 0&&(c.style.boxSizing="border-box",c.style.minHeight=`${s}px`);let d=[];for(let h of e.content)if(h.ast===r.code){let l=document.createElement("code"),f=document.createTextNode(r.code.content);l.appendChild(f),c.appendChild(l),d.push(new Me(r.code,f))}else{let l=ht(h,n,void 0);c.appendChild(l.mountNode),d.push(l)}super(e,c,d),this._renderedHeight=s;return}let o=r.code?.content??"",a=n?.renderMath?.({latex:o,displayMode:!0,className:"md-block md-math-block",nodeLength:r.length,contentStart:mf(r.content)});if(a){super(e,a.dom,pf(r,a.segments,r.length)),this._renderedHeight=s;return}let u=document.createElement("div");u.className="md-block md-math-block";try{No.render(o,u,{displayMode:!0,throwOnError:!1})}catch{u.textContent=o}super(e,u,Se),this._renderedHeight=s}recordMeasuredHeight(e){this.data.showMarkup||(this._renderedHeight=e)}},Cs=class extends ee{constructor(e,n,i){let r=e.ast.ordered?"ol":"ul",s=i&&i.element.tagName===r.toUpperCase(),o=s?i.element:document.createElement(r);s||(o.className="md-block md-list");let a=Je(o,e.content,i?.children,At(n));super(e,o,a)}},Ts=class extends ee{constructor(e,n,i){let r=e.ast,s=i?.element??document.createElement("li");s.classList.toggle("md-list-item-active",e.isActive),s.classList.toggle("md-task-list-item",r.checked!==void 0),s.classList.toggle("md-markers-hidden",!e.isActive),s.classList.toggle("md-task-list-item-running",e.isRunning),s.style.setProperty("--md-list-level",String(e.level));let o=Yv(s,e.content,i,n);if(!e.isActive&&r.checked!==void 0){let a=document.createElement("input");a.type="checkbox",a.checked=r.checked,a.className="md-checkbox",e.isRunning&&(a.classList.add("md-checkbox-running"),a.indeterminate=!0,a.setAttribute("aria-busy","true"),a.setAttribute("aria-label","In progress"));let u=n?.onToggleCheckbox;if(u){let c=r.checked;a.addEventListener("pointerdown",d=>{d.stopPropagation()}),a.addEventListener("click",d=>{d.stopPropagation(),d.preventDefault(),u(r,!c)})}else a.disabled=!0;s.insertBefore(a,s.firstChild)}super(e,s,o)}};function Yv(t,e,n,i){let{paired:r,unused:s}=Ec(e,n?.children??Se),o=e.map(c=>ht(c,i,r.get(c)));for(let c of s)c.dispose();if(!(e.length>=2&&e[0].kind==="glue"&&e[0].ast.glueKind==="indent"&&e[1].kind==="marker"&&e[1].ast.markerKind==="listItemMarker"))return lt(t,o.map(c=>c.mountNode)),o;let a=t.firstElementChild,u=a&&a.classList.contains("md-list-gutter")?a:document.createElement("span");return u.className="md-list-gutter",lt(u,[o[0].mountNode,o[1].mountNode]),lt(t,[u,...o.slice(2).map(c=>c.mountNode)]),o}var Os=class extends ee{_table;constructor(e,n,i){let r=i?.dom??document.createElement("div"),s=i?._table??document.createElement("table");i||(r.className="md-block md-table-wrapper",s.className="md-block md-table",r.appendChild(s));let o=Je(s,df(e),i?.children,At(n));super(e,r,o),this._table=s}get element(){return this._table}get scrollElement(){return this.dom}},Rs=class extends ee{constructor(e,n,i){let r=i?.element??document.createElement("tr");e.isDelimiter&&r.classList.add("md-table-delimiter-row");let s=Je(r,e.content,i?.children,At(n));e.isDelimiter||e.content.forEach((o,a)=>{o.kind==="tableCell"&&s[a].element.classList.toggle("md-table-cell-active",o.isActive)}),super(e,r,s)}},Ls=class extends ee{constructor(e,n,i){let r=i?.element??document.createElement("code"),s=Je(r,e.content,i?.children,cf(n));super(e,r,s)}},Is=class extends ee{constructor(e,n,i){if(e.showMarkup){let a=document.createElement("span");a.className="md-inline-math";let u=Je(a,e.content,i?.children,cf(n));super(e,a,u);return}let r=e.content.find(a=>a.kind==="marker"&&a.ast.markerKind==="content")?.ast.content??"",s=n?.renderMath?.({latex:r,displayMode:!1,className:"md-inline-math",nodeLength:e.ast.length,contentStart:mf(e.ast.content)});if(s){super(e,s.dom,pf(e.ast,s.segments,e.ast.length));return}let o=document.createElement("span");o.className="md-inline-math";try{No.render(r,o,{throwOnError:!1})}catch{o.textContent=r}super(e,o,Se)}},Ms=class extends ee{_presentation;_presentationSubscription;constructor(e,n,i){i?._presentationSubscription?.dispose(),i&&(i._presentationSubscription=void 0),i?._presentation?.dispose(),i&&(i._presentation=void 0);let r=!e.showMarkup&&As(e.ast.url)?n?.linkPresentationProvider?.createLinkPresentation(e.ast.url):void 0,s=r?"SPAN":"A",o=i?.element.tagName===s?i.element:document.createElement(s.toLowerCase());if(As(e.ast.url)?(o.dataset.mdUrl=e.ast.url,o instanceof HTMLAnchorElement&&(o.href=e.ast.url)):(o.removeAttribute("href"),delete o.dataset.mdUrl),r?(o.setAttribute("role","link"),o.tabIndex=0):(o.removeAttribute("role"),o.removeAttribute("tabindex")),o!==i?.element){let d=m=>!o.dataset.mdUrl||m.button!==0&&m.button!==1?!1:m.button===1?!0:o.closest(".md-block-active")===null||m.ctrlKey||m.metaKey,h=m=>{let p=o.dataset.mdUrl;if(!p)return!0;let g=n?.onOpenLink;return g?g(p,m)!==!1:(window.open(p,"_blank","noopener"),!0)},l=!1;o.addEventListener("pointerdown",m=>{l=!1,d(m)&&(m.stopPropagation(),l=!0)});let f=m=>{let p=l||d(m);l=!1,p&&h(m)&&(m.preventDefault(),m.stopPropagation())};o.addEventListener("click",f),o.addEventListener("auxclick",f),o.addEventListener("keydown",m=>{o.getAttribute("role")!=="link"||m.key!=="Enter"&&m.key!==" "||(m.preventDefault(),o.click())})}let a,u=r?o.querySelector(":scope > .md-rich-link-label")??document.createElement("span"):o,c=Je(u,e.content,i?.children,At(n));if(r?a=ds.mount(o,u):(ds.clear(o),lt(o,c.map(d=>d.mountNode))),super(e,o,c),r&&a){this._presentation=r;let d=()=>a.update(r.presentation.get());d(),this._presentationSubscription=wi(r.presentation,d)}}dispose(){this._presentationSubscription?.dispose(),this._presentationSubscription=void 0,this._presentation?.dispose(),this._presentation=void 0,super.dispose()}},Ns=class extends ee{constructor(e,n,i){let r=e.ast;if(e.showMarkup){let o=document.createElement("span");o.className="md-image-source";let a=Je(o,e.content,i?.children,At(n));super(e,o,a);return}let s=document.createElement("img");As(r.url)&&(s.src=r.url),s.alt=r.alt,super(e,s,Se)}};function Ec(t,e){let n=new Map;for(let r of e)n.set(r.ast.id,r);let i=new Map;for(let r of t){let s=n.get(r.ast.id);s&&(i.set(r,s),n.delete(r.ast.id))}return{paired:i,unused:[...n.values()]}}function As(t){return!t.trim().toLowerCase().startsWith("javascript:")}var Cu=class t extends kt{constructor(e,n,i,r,s){super(e,n,r),this.blocks=i,this.pendingParagraph=s}static create(e,n,i){let r=i?.contentDomNode??document.createElement("div");r.classList.add("md-document");let s=new Map(e.children.filter(f=>f.kind==="block").map(f=>[f.view,f.isActive])),o=i?.children,a=e.children.map(f=>f.view),{paired:u,unused:c}=Ec(a,o??e_),d,h=a.map((f,m)=>{let p=u.get(f);if(e.children[m].kind==="pendingParagraph"){let b=f,w=p instanceof Ps?p:new Ps(b);return w.update(b.text),d=w,w}let g=ht(f,n,p);if(e.children[m].kind==="block"){let b=s.get(f);b!==void 0&&(g.element.classList.toggle("md-block-active",b),g.element.classList.toggle("md-markers-hidden",!b));let w=e.children[m].diffKind;g.element.classList.toggle("md-diff-added",w==="added"),g.element.classList.toggle("md-diff-modified",w==="modified")}return g});for(let f of c)f.dispose();lt(r,h.map(f=>f.mountNode));let l=[];return e.children.forEach((f,m)=>{f.kind==="block"&&l.push({node:h[m],absoluteStart:f.absoluteStart})}),new t(e.ast,r,l,h,d)}get contentDomNode(){return this.dom}},Ps=class extends kt{element;anchorBlock;cursorLine;_text="";constructor(e){let n=document.createElement("p");n.className="md-block md-paragraph md-pending-paragraph",super(e.ast,n),this.element=n,this.anchorBlock=e.anchorBlock,this.cursorLine=e.cursorLine,this.update(e.text)}update(e){if(!(e===this._text&&this.element.childNodes.length>0)){if(this._text=e,e.length===0){this.element.replaceChildren(document.createElement("br"));return}this.element.replaceChildren(...[...e].map(n=>{let i=document.createElement("span");return i.className=n===" "?"md-ws-space":"md-ws-tab",i.textContent=n,i}))}}getCaretClientRect(){let e=this.element.getBoundingClientRect();if(this._text.length===0)return new DOMRect(e.left,e.top,0,e.height);let n=this.element.ownerDocument.createRange();n.selectNodeContents(this.element),n.collapse(!1);let i=n.getBoundingClientRect();if(i.height>0)return i;let r=this.element.lastElementChild?.getBoundingClientRect();return new DOMRect(r?.right??e.left,e.top,0,e.height)}},e_=[],Jr=1e-7,Fs=class t{constructor(e){this._getLocalToClientMatrix=e}static forSvgOverlay(e){return new t(()=>{if(!e.isConnected)return new DOMMatrix;let n=e.getScreenCTM();if(!n)throw new Error("Cannot resolve editor coordinates before the overlay is mounted");return n})}capture(){let e=this._getLocalToClientMatrix();if(e.is2D===!1||Math.abs(e.b)>Jr||Math.abs(e.c)>Jr||e.a<=Jr||e.d<=Jr)throw new Error("Markdown editor geometry supports positive axis-aligned scale and translation only");return new Tu(e)}},Tu=class{constructor(e){this._localToClient=e,this._clientToLocal=e.inverse()}_clientToLocal;toLocalPoint(e){let n=new DOMPoint(e.x,e.y).matrixTransform(this._clientToLocal);return new xt(n.x,n.y)}toClientPoint(e){let n=new DOMPoint(e.x,e.y).matrixTransform(this._localToClient);return new xt(n.x,n.y)}toLocalRect(e){return this._convertRect(e,this._clientToLocal)}toClientRect(e){return this._convertRect(e,this._localToClient)}_convertRect(e,n){let i=new DOMPoint(e.left,e.top).matrixTransform(n),r=new DOMPoint(e.left+e.width,e.top+e.height).matrixTransform(n);return Y.fromPointPoint(i.x,i.y,r.x,r.y)}},$s=class{constructor(e,n,i){this.ast=e,this.blocks=n,this.children=i}kind="document"},Ou=class{constructor(e,n){this.ast=e,this.content=n}kind="heading"},Ru=class{constructor(e,n){this.ast=e,this.content=n}kind="paragraph"},Lu=class{constructor(e,n,i,r){this.ast=e,this.anchorBlock=n,this.cursorLine=i,this.text=r}kind="pendingParagraph"},Iu=class{constructor(e,n,i){this.ast=e,this.showMarkup=n,this.content=i}kind="frontMatter"},Mu=class{constructor(e,n,i){this.ast=e,this.showMarkup=n,this.content=i}kind="codeBlock"},Nu=class{constructor(e,n,i){this.ast=e,this.showMarkup=n,this.content=i}kind="mathBlock"},Au=class{constructor(e,n,i){this.ast=e,this.content=n,this.showFinalMarkerOnlyLine=i}kind="blockQuote"},Pu=class{constructor(e,n){this.ast=e,this.content=n}kind="list"},Fu=class{constructor(e,n){this.ast=e,this.content=n}kind="table"},$u=class{constructor(e,n){this.ast=e,this.content=n}kind="strong"},Bu=class{constructor(e,n){this.ast=e,this.content=n}kind="emphasis"},Du=class{constructor(e,n){this.ast=e,this.content=n}kind="strikethrough"},qu=class{constructor(e,n){this.ast=e,this.content=n}kind="inlineCode"},Vu=class{constructor(e,n,i){this.ast=e,this.showMarkup=n,this.content=i}kind="inlineMath"},ju=class{constructor(e,n,i){this.ast=e,this.showMarkup=n,this.content=i}kind="link"},Hu=class{constructor(e,n,i){this.ast=e,this.showMarkup=n,this.content=i}kind="image"},Wu=class{constructor(e,n,i,r,s=!1){this.ast=e,this.isActive=n,this.content=i,this.level=r,this.isRunning=s}kind="listItem"},Uu=class{constructor(e,n,i){this.ast=e,this.isDelimiter=n,this.content=i}kind="tableRow"},Ku=class{constructor(e,n,i,r){this.ast=e,this.isActive=n,this.showTableGlue=i,this.content=r}kind="tableCell"},Zu=class{constructor(e,n,i=!1,r=!1,s=0){this.ast=e,this.showWhitespace=n,this.leftWordBoundary=i,this.rightWordBoundary=r,this.hiddenPrefixLength=s}kind="text"},Xu=class{constructor(e,n,i){this.ast=e,this.showMarkup=n,this.content=i}kind="thematicBreak"},Bs=class{constructor(e,n,i,r){this.ast=e,this.showMarkup=n,this.content=i,this.diffKind=r}kind="video"},Gu=class{constructor(e,n,i){this.ast=e,this.showMarkup=n,this.content=i}kind="unhandledBlock"},Ju=class{constructor(e,n){this.ast=e,this.visible=n}kind="marker"},Ds=class{constructor(e,n,i){this.ast=e,this.visible=n,this.decorateNewline=i}kind="glue"},Qu=class{constructor(e,n,i,r,s){this.ast=e,this.side=n,this.deletedRanges=i,this.whole=r,this.originalStart=s}kind="diffDecoration"},Yu={showMarkup:!1,showTableGlue:!1,selectionInNode:void 0};function Lt(t){return t.inlineFlow?t:{...t,inlineFlow:!0}}function gf(t,e,n,i,r){let s=new Map;if(i)for(let h of i.children)s.set(h.view.ast,h);let o=t.content,a=new Set(t.blocks),u=[],c=[],d=0;for(let h=0;h<o.length;h++){let l=o[h];if(a.has(l)){let f=l,m=e.has(f),p=s.get(f),g=r?.anchorBlock===f?r.replaceRange.delta(-d):void 0,b;if(!m)b=p&&!p.isActive&&!g?p.view:ec(f,{...Yu,pendingAnchorBlock:g?f:void 0,pendingReplacementInBlock:g},p?.view);else{let w=n&&n.endExclusive>=d&&n.start<=d+f.length?new T(Math.max(0,n.start-d),Math.min(f.length,n.endExclusive-d)):void 0;b=ec(f,{showMarkup:!0,showTableGlue:!1,selectionInNode:w,pendingAnchorBlock:g?f:void 0,pendingReplacementInBlock:g},p?.view)}u.push({ast:f,absoluteStart:d,isActive:m,view:b}),c.push({absoluteStart:d,isActive:m,view:b,kind:"block"}),r&&r.anchorBlock===f&&c.push({absoluteStart:d+f.length,isActive:!0,view:new Lu(r.ast,r.anchorBlock,r.cursorLine,r.text),kind:"pendingParagraph"})}else if(l instanceof Ie){let f=s.get(l),m=ie(f?.view,new Ds(l,!1,!1));c.push({absoluteStart:d,isActive:!1,view:m,kind:"glue"})}d+=l.length}return new $s(t,u,c)}function ec(t,e,n){return oi(t,e,n)}function t_(t,e,n,i=!1){return bf(t,e,i,n)}function bf(t,e,n,i){let r=e?{showMarkup:!0,showTableGlue:!1,selectionInNode:void 0,forceVideoSource:n}:n?{...Yu,forceVideoSource:!0}:Yu;return ec(t,r,i)}function n_(t,e,n=!1){let i=new Map,r=new Map,s=[];for(let c of e){if(c.kind==="removed"){s.push(c);continue}let d=xf(c);d&&(s.length&&(r.set(d,s),s=[]),i.set(d,c))}let o=s,a=[],u=[];for(let c of t.children){if(c.kind!=="block"){a.push(c);continue}let d=c.view;for(let p of r.get(d.ast)??[])a.push(Ka(p.node,p.deletedLocal,c.absoluteStart,!0,p.originalStart,n));let h=i.get(d.ast);h&&h.kind==="replaced"&&h.deletedLocal.length>0&&a.push(Ka(h.original,h.deletedLocal,c.absoluteStart,!1,h.originalStart,n));let l=h&&h.kind==="nested"?vf(d,h,n):d;h?.kind==="added"&&(l=qs(l,"added",!1));let f=h?.kind==="added"?"added":h?.kind==="replaced"?"modified":void 0,m=f?{...c,view:l,diffKind:f}:l!==d?{...c,view:l}:c;a.push(m),u.push({ast:d.ast,absoluteStart:c.absoluteStart,isActive:c.isActive,view:l})}for(let c of o)a.push(Ka(c.node,c.deletedLocal,t.ast.length,!0,c.originalStart,n));return new $s(t.ast,u,a)}function Ka(t,e,n,i,r,s){return{absoluteStart:n,isActive:!1,view:ts(t,e,i,r,s),kind:"diffDecoration"}}function ts(t,e,n,i,r){let s=r||!n||t.kind==="video";return new Qu(t,bf(t,s,!0),e,n,i)}function vf(t,e,n){let i=new Map,r=new Map,s=[];for(let u of e.children){if(u.kind==="removed"){s.push(u);continue}let c=xf(u);c&&(s.length&&(r.set(c,s),s=[]),i.set(c,u))}let o=t.content??[],a=[];for(let u of o){for(let d of r.get(u.ast)??[])a.push(ts(d.node,d.deletedLocal,!0,d.originalStart,n));let c=i.get(u.ast);c?.kind==="replaced"?(c.deletedLocal.length>0&&a.push(ts(c.original,c.deletedLocal,!1,c.originalStart,n)),a.push(qs(u,"modified",!0))):c?.kind==="added"?a.push(qs(u,"added",!1)):c&&c.kind==="nested"?a.push(vf(u,c,n)):a.push(u)}for(let u of s)a.push(ts(u.node,u.deletedLocal,!0,u.originalStart,n));return _f(t,a)}function _f(t,e){return Object.assign(Object.create(Object.getPrototypeOf(t)),t,{content:e})}var Za=new WeakMap;function qs(t,e,n){if(t.kind!=="video"&&t.kind!=="blockQuote"&&t.kind!=="list"&&t.kind!=="listItem")return t;let i=`${e}:${n}`,r=Za.get(t)?.get(i);if(r)return r;let s;if(t.kind==="video"){let a=n?t_(t.ast,!0):t;if(a.kind!=="video")throw new Error("Video AST must build video view data");s=new Bs(a.ast,a.showMarkup,a.content,e)}else if("content"in t){let a=t.content.map(u=>qs(u,e,n));s=a.every((u,c)=>u===t.content[c])?t:_f(t,a)}else s=t;let o=Za.get(t);return o||(o=new Map,Za.set(t,o)),o.set(i,s),s}function xf(t){switch(t.kind){case"unchanged":return t.node;case"added":return t.node;case"replaced":return t.modified;case"nested":return t.modified;case"removed":return}}function oi(t,e,n,i){let r=t;switch(r.kind){case"text":return ie(n,new Zu(r,e.showMarkup,i?.left??!1,i?.right??!1,r===e.hideRunnerMarkerNode?e.hideRunnerMarkerLength??0:0));case"thematicBreak":return ie(n,new Xu(r,e.showMarkup,Le(r.children,e,n)));case"video":{let s=e.forceVideoSource&&!e.showMarkup?{...e,showMarkup:!0}:e;return ie(n,new Bs(r,s.showMarkup,Le(r.children,s,n)))}case"unhandledBlock":return ie(n,new Gu(r,e.showMarkup,Le(r.children,e,n)));case"marker":return ie(n,new Ju(r,o_(r.markerKind,e)));case"glue":return ie(n,new Ds(r,a_(r.glueKind,e),e.inlineFlow??!1));case"heading":return ie(n,new Ou(r,Le(r.children,Lt(e),n)));case"paragraph":return ie(n,new Ru(r,Le(r.children,Lt(e),n)));case"frontMatter":return ie(n,new Iu(r,e.showMarkup,Le(r.children,e,n)));case"codeBlock":return ie(n,new Mu(r,e.showMarkup,Le(r.children,e,n)));case"mathBlock":return ie(n,new Nu(r,e.showMarkup,Le(r.children,e,n)));case"blockQuote":{let s=s_(r),o=e.pendingAnchorBlock?Ve(e.pendingAnchorBlock,r):void 0,a=s&&o!==void 0?s.delta(o):void 0,u=!a||!e.pendingReplacementInBlock?.containsRange(a);return ie(n,new Au(r,Le(r.children,e,n,!0),u))}case"list":return ie(n,c_(r,e,n));case"listItem":return ie(n,wf(r,e,n));case"table":return ie(n,d_(r,e,n));case"tableRow":return ie(n,yf(r,e,!1,n));case"tableCell":return ie(n,kf(r,e.showMarkup,e.showTableGlue,e.selectionInNode,n));case"strong":return ie(n,new $u(r,Le(r.children,Lt(e),n)));case"emphasis":return ie(n,new Bu(r,Le(r.children,Lt(e),n)));case"strikethrough":return ie(n,new Du(r,Le(r.children,Lt(e),n)));case"inlineCode":return ie(n,new qu(r,Le(r.children,Lt(e),n)));case"inlineMath":return ie(n,new Vu(r,e.showMarkup,Le(r.children,Lt(e),n)));case"link":return ie(n,new ju(r,e.showMarkup,Le(r.children,Lt(e),n)));case"image":return ie(n,new Hu(r,e.showMarkup,Le(r.children,Lt(e),n)));case"document":return gf(r,new Set,T.ofLength(0),void 0)}}function tc(t){return t.kind==="document"?t.blocks.map(e=>e.view):"content"in t?t.content:i_}var i_=[];function Yi(t){if(!t)return;let e=new Map;for(let n of tc(t))e.set(n.ast,n);return e}function ie(t,e){if(t&&t.kind===e.kind&&t.ast===e.ast&&r_(t,e)){let n=tc(t),i=tc(e);if(n.length===i.length&&n.every((r,s)=>r===i[s]))return t}return e}function r_(t,e){switch(t.kind){case"text":return t.showWhitespace===e.showWhitespace&&t.leftWordBoundary===e.leftWordBoundary&&t.rightWordBoundary===e.rightWordBoundary&&t.hiddenPrefixLength===e.hiddenPrefixLength;case"marker":return t.visible===e.visible;case"glue":return t.visible===e.visible&&t.decorateNewline===e.decorateNewline;case"thematicBreak":return t.showMarkup===e.showMarkup;case"video":return t.showMarkup===e.showMarkup&&t.diffKind===e.diffKind;case"frontMatter":return t.showMarkup===e.showMarkup;case"codeBlock":return t.showMarkup===e.showMarkup;case"mathBlock":return t.showMarkup===e.showMarkup;case"inlineMath":return t.showMarkup===e.showMarkup;case"image":return t.showMarkup===e.showMarkup;case"unhandledBlock":return t.showMarkup===e.showMarkup;case"listItem":return t.isActive===e.isActive&&t.isRunning===e.isRunning;case"tableCell":{let n=e;return t.isActive===n.isActive&&t.showTableGlue===n.showTableGlue}case"tableRow":return t.isDelimiter===e.isDelimiter;case"blockQuote":return t.showFinalMarkerOnlyLine===e.showFinalMarkerOnlyLine;default:return!0}}function s_(t){let e=0,n;for(let i of t.children)i instanceof Ie||(n=i instanceof V&&i.markerKind==="blockQuoteMarker"?T.ofStartAndLength(e,i.length):void 0),e+=i.length;return n}function Le(t,e,n,i=!1){let r=Yi(n),s=0;return t.map((o,a)=>{let u=o.kind==="text"?{left:a>0&&oh(t[a-1],"end"),right:a<t.length-1&&oh(t[a+1],"start")}:void 0,c=i&&e.selectionInNode?{...e,selectionInNode:e.selectionInNode.delta(-s)}:e,d=oi(o,c,r?.get(o),u);return s+=o.length,d})}function oh(t,e){switch(t.kind){case"text":{let n=t.content,i=e==="end"?n[n.length-1]:n[0];return i!==void 0&&i!==" "&&i!=="	"&&i!==`
`&&i!=="\r"}case"inlineCode":case"inlineMath":case"link":case"image":case"strong":case"emphasis":case"strikethrough":return!0;default:return!1}}function o_(t,e){return e.showMarkup||t==="tableCellGlue"&&e.showTableGlue}function a_(t,e){return e.showMarkup||t==="tableCellGlue"&&e.showTableGlue}var ah=":running:";function u_(t){if(t.checked===void 0)return;let e=t.blocks[0];if(!e||e.kind!=="paragraph")return;let n=e.content[1];if(!n||n.kind!=="text")return;let i=n.content,r=0;for(;r<i.length&&(i[r]===" "||i[r]==="	");)r++;if(i.startsWith(ah,r))return{text:n,hiddenLength:r+ah.length}}function c_(t,e,n){let i=Yi(n),r=l_(t,e),s=new Set(t.items),o=(e.listLevel??0)+1,a=[],u=0;for(let c of t.children){if(s.has(c)){let d=c,h=r.has(t.items.indexOf(d)),l={showMarkup:h,showTableGlue:!1,selectionInNode:h&&e.selectionInNode?e.selectionInNode.delta(-u):void 0,listLevel:o,forceVideoSource:e.forceVideoSource};a.push(ie(i?.get(d),wf(d,l,i?.get(d))))}else a.push(oi(c,e,i?.get(c)));u+=c.length}return new Pu(t,a)}function wf(t,e,n){let i=Yi(n),r=e.showMarkup?void 0:u_(t),s=r!==void 0,o=s?{...e,hideRunnerMarkerNode:r.text,hideRunnerMarkerLength:r.hiddenLength}:e,a=[],u=0;for(let c of t.children){let d=o.selectionInNode?{...o,selectionInNode:o.selectionInNode.delta(-u)}:o;a.push(oi(c,d,i?.get(c))),u+=c.length}return new Wu(t,e.showMarkup,a,e.listLevel??1,s)}function d_(t,e,n){let i=Yi(n),r=e.showMarkup,s=t.delimiterRow,o=new Set([t.headerRow,t.delimiterRow,...t.bodyRows].filter(c=>c!==void 0)),a=[],u=0;for(let c of t.children){if(o.has(c)){let d=c,h=d===s,l={showMarkup:r,showTableGlue:r,selectionInNode:!h&&r&&e.selectionInNode?e.selectionInNode.delta(-u):void 0};a.push(ie(i?.get(d),yf(d,l,h,i?.get(d))))}else a.push(oi(c,e,i?.get(c)));u+=c.length}return new Fu(t,a)}function yf(t,e,n,i){let r=Yi(i),s=e.showMarkup,o=n?void 0:h_(t,e),a=new Set(t.cells),u=[],c=0;for(let d of t.children){if(a.has(d)){let h=d,l=n?s:o.has(t.cells.indexOf(h)),f=l&&e.selectionInNode?e.selectionInNode.delta(-c):void 0;u.push(kf(h,l,s,f,r?.get(h)))}else u.push(oi(d,e,r?.get(d)));c+=d.length}return new Uu(t,n,u)}function kf(t,e,n,i,r){let s={showMarkup:e,showTableGlue:n,selectionInNode:i};return new Ku(t,e,n,Le(t.children,Lt(s),r))}var Vs=new Set;function l_(t,e){if(!e.showMarkup||!e.selectionInNode)return Vs;let n=e.selectionInNode;if(n.isEmpty){let s=Uh(t,n.start);return s===void 0?Vs:new Set([s])}let i=new Set,r=0;for(let s of t.children){let o=t.items.indexOf(s);o>=0&&r<n.endExclusive&&r+s.length>n.start&&i.add(o),r+=s.length}return i}function h_(t,e){if(!e.showMarkup||!e.selectionInNode)return Vs;let n=e.selectionInNode;if(n.isEmpty){let s=f_(t,n.start);return s===void 0?Vs:new Set([s])}let i=new Set,r=0;for(let s of t.children){let o=t.cells.indexOf(s);o>=0&&r<n.endExclusive&&r+s.length>n.start&&i.add(o),r+=s.length}return i}function f_(t,e){let n=0;for(let i of t.children){let r=n+i.length,s=t.cells.indexOf(i);if(s>=0&&(n<=e&&e<r||r===e))return s;n=r}}function m_(t){let e=[],n=(i,r)=>{let s=i.children;if(s.length===0){if(i.dom.nodeType===3){let a=i.dom,u=Math.min(a.data.length,i.sourceLength);u>0&&e.push({text:a,start:r,len:u})}return}let o=r;for(let a of s)a.sourceLength!==0&&(n(a,o),o+=a.sourceLength)};return n(t,0),e}function uh(t,e){let n=document.createRange();return n.setStart(t.text,e.start-t.start),n.setEnd(t.text,e.endExclusive-t.start),n}function oo(t,e,n=Number.POSITIVE_INFINITY){if(n<=0)return[];let i=m_(t),r=e.slice().sort((a,u)=>a.start-u.start||a.endExclusive-u.endExclusive),s=[],o=0;for(let a of r){if(a.isEmpty){let u=p_(i,a.start);if(u&&(s.push({range:uh(u,a),sourceRange:a}),s.length>=n))return s;continue}for(;o<i.length&&i[o].start+i[o].len<=a.start;)o++;for(let u=o;u<i.length;u++){let c=i[u];if(c.start>=a.endExclusive)break;let d=a.intersect(T.ofStartAndLength(c.start,c.len));if(!(!d||d.isEmpty)&&(s.push({range:uh(c,d),sourceRange:d}),s.length>=n))return s}}return s}function Xa(t,e){return oo(t,e).map(n=>n.range)}function p_(t,e){return t.find(n=>n.start<=e&&e<=n.start+n.len)}var nc=class extends be{constructor(e,n){super(),this._parent=e,this.element=document.createElement("div"),this.element.className="md-diff-highlight-layer",n?(this._coordinateSpace=n,this._coordinateProbe=void 0):(this._coordinateProbe=document.createElementNS("http://www.w3.org/2000/svg","svg"),this._coordinateProbe.setAttribute("aria-hidden","true"),this._coordinateProbe.style.position="absolute",this._coordinateProbe.style.inset="0",this._coordinateProbe.style.width="100%",this._coordinateProbe.style.height="100%",this._coordinateProbe.style.visibility="hidden",this._coordinateProbe.style.pointerEvents="none",this.element.appendChild(this._coordinateProbe),this._coordinateSpace=Fs.forSvgOverlay(this._coordinateProbe)),this._resizeObserver=new ResizeObserver(()=>{this._last&&this._repaint(this._last)}),this._resizeObserver.observe(this._parent),this._register({dispose:()=>{this._resizeObserver.disconnect(),this.element.remove()}})}element;_last;_resizeObserver;_coordinateSpace;_coordinateProbe;clear(){this._last=void 0,this._replaceHighlights()}render(e,n){this._last={node:e,inserted:n},this._repaint(this._last)}_repaint(e){let n=[],i=[];e.inserted&&n.push(...Xa(e.node,e.inserted));let r=s=>{if(s instanceof Gi)s.whole||i.push(...Xa(s.sideNode,s.deletedRanges.map(o=>o.range)));else if(s instanceof Xi)for(let o of s.sides)for(let a of o.ranges){let u=Xa(o.node,[a.range]);(a.kind==="inserted"?n:i).push(...u)}for(let o of s.children)r(o)};r(e.node),this._paint(n,i)}_paint(e,n){let i=this._coordinateSpace.capture(),r=document.createDocumentFragment(),s=(o,a)=>{for(let u of o)for(let c of u.getClientRects()){if(c.width===0||c.height===0)continue;let d=i.toLocalRect(c),h=document.createElement("div");h.className=a,h.style.left=`${d.left}px`,h.style.top=`${d.top}px`,h.style.width=`${d.width}px`,h.style.height=`${d.height}px`,r.appendChild(h)}};s(e,"md-diff-ins-rect"),s(n,"md-diff-del-rect"),this._replaceHighlights(r)}_replaceHighlights(...e){let n=this._coordinateProbe?[this._coordinateProbe,...e]:e;this.element.replaceChildren(...n)}},ic=class extends be{element;rendering;_path;constructor(e){super(),this.element=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.element.setAttribute("class","md-selection-layer"),this._path=document.createElementNS("http://www.w3.org/2000/svg","path"),this._path.setAttribute("class","md-selection-path"),this.element.appendChild(this._path),this.rendering=oe(this,n=>{let i=n.readObservable(e.selection),r=n.readObservable(e.visualLineMap),s=n.readObservable(e.blocks);return g_(this._path,i,r,s)}),this._register(te(n=>{n.readObservable(this.rendering)}))}},js=class{constructor(e){this.rects=e}};function g_(t,e,n,i){if(!e||e.isCollapsed)return t.setAttribute("d",""),new js([]);let r=Ef(e.range,n,i);return t.setAttribute("d",x_(r,4)),new js(r)}var b_=.4;function Ef(t,e,n){if(t.isEmpty)return[];let i=t,r=(l,f,m,p)=>Y.fromPointPoint(l,f,Math.max(l,m),Math.max(f,p)),s=e.sourceLines,o=[];for(let l=0;l<s.length;l++){let f=s[l],m=Hs(f);if(!m)continue;let p=l+1<s.length?Hs(s[l+1]):void 0,g=!p||p.start>m.endExclusive,b=i.intersects(m),w=g&&i.start<=m.endExclusive&&i.endExclusive>m.endExclusive;if(!b&&!w)continue;let x=n.find(y=>T.ofStartAndLength(y.absoluteStart,y.block.length).containsRange(m));o.push({line:f,lineRange:m,block:x,hardBreak:g})}let a=[],u=[];for(let{line:l,lineRange:f,hardBreak:m,block:p}of o){let g=f.start,b=f.endExclusive,w=i.start<=g?l.rect.left:l.xAtOffset(i.start),x;if(i.endExclusive<b)x=l.xAtOffset(i.endExclusive);else{let z=i.endExclusive>b;x=l.rect.right+(z&&m?l.rect.height*b_:0)}let y=Sf(p);y&&(w=Math.max(w,y.left),x=Math.min(x,y.right)),a.push(r(w,l.rect.top,x,l.rect.bottom)),u.push({left:w,right:x,top:l.rect.top,bottom:l.rect.top+l.rect.height})}for(let l=0;l<u.length-1;l++){let f=u[l],m=u[l+1];if(m.top<=f.bottom)continue;let p=Math.max(f.left,m.left),g=Math.min(f.right,m.right);g<=p||a.push(r(p,f.bottom,g,m.top))}let c=new Map,d=new Map;for(let l=0;l<o.length;l++){let f=o[l].block;f&&(c.has(f)||c.set(f,l),d.set(f,l))}let h=n.map(l=>i.intersects(T.ofStartAndLength(l.absoluteStart,l.block.length)));for(let l=0;l<n.length-1;l++){let f=n[l],m=n[l+1],p=f.absoluteStart+f.block.length,g=m.absoluteStart;if(p<g&&!i.containsRange(T.fromTo(p,g))||p>=g&&!(h[l]&&h[l+1]))continue;let b=f.rect,w=m.rect,x=__(e,m,w.top),y=b.bottom;if(x<=y)continue;let z=d.get(f),k=c.get(m);if(z===void 0&&Ga(e,f)||k===void 0&&Ga(e,m))continue;let C=z!==void 0?u[z]:{left:b.left,right:b.right},L=k!==void 0?u[k]:{left:w.left,right:w.right},B=Math.max(C.left,L.left),E=Math.min(C.right,L.right);E<=B||a.push(r(B,y,E,x))}for(let l of n){let f=T.ofStartAndLength(l.absoluteStart,l.block.length);i.intersects(f)&&(Ga(e,l)||a.push(l.rect))}return a}function Hs(t){if(t.runs.length===0)return;let e=1/0,n=-1/0;for(let i of t.runs)i.sourceStart<e&&(e=i.sourceStart),i.sourceEndExclusive>n&&(n=i.sourceEndExclusive);return T.fromTo(e,n)}function Ga(t,e){let n=T.ofStartAndLength(e.absoluteStart,e.block.length);for(let i of t.sourceLines){let r=Hs(i);if(r&&n.containsRange(r))return!0}return!1}function Sf(t){return t?.viewportClip}function v_(t,e){return t.find(n=>e>=n.absoluteStart&&e<=n.absoluteStart+n.block.length)}function __(t,e,n){let i=T.ofStartAndLength(e.absoluteStart,e.block.length);for(let r of t.sourceLines){let s=Hs(r);if(s&&i.containsRange(s))return r.rect.top}return n}function x_(t,e){if(t.length===0)return"";let n=t.slice().sort((s,o)=>s.y-o.y||s.x-o.x),i=[],r=[];for(let s of n){let o=r[r.length-1],a=o!==void 0&&s.y<=o.y+o.height+.5,u=o!==void 0&&Math.max(o.x,s.x)<Math.min(o.x+o.width,s.x+s.width);a&&u?r.push(s):(r.length>0&&i.push(r),r=[s])}return r.length>0&&i.push(r),i.map(s=>w_(s,e)).filter(Boolean).join(" ")}function w_(t,e){let n=[];n.push({x:t[0].x+t[0].width,y:t[0].y,convex:!0});for(let r=0;r<t.length-1;r++){let s=t[r],o=t[r+1],a=s.x+s.width,u=o.x+o.width;if(Math.abs(a-u)>.5){let c=s.y+s.height,d=a>u;n.push({x:a,y:c,convex:d}),n.push({x:u,y:c,convex:!d})}}let i=t[t.length-1];n.push({x:i.x+i.width,y:i.y+i.height,convex:!0}),n.push({x:i.x,y:i.y+i.height,convex:!0});for(let r=t.length-1;r>0;r--){let s=t[r],o=t[r-1];if(Math.abs(s.x-o.x)>.5){let a=s.y,u=s.x<o.x;n.push({x:s.x,y:a,convex:u}),n.push({x:o.x,y:a,convex:!u})}}return n.push({x:t[0].x,y:t[0].y,convex:!0}),y_(n,e)}function y_(t,e){let n=t.length;if(n<3)return"";let i=new Array(n);for(let o=0;o<n;o++){let a=t[(o+n-1)%n],u=t[(o+1)%n],c=Qr(t[o],a),d=Qr(t[o],u);i[o]=Math.min(e,c/2,d/2)}let r=Ja(t[n-1],t[0],Qr(t[n-1],t[0])-i[0]),s=[`M${Rt(r.x)},${Rt(r.y)}`];for(let o=0;o<n;o++){let a=t[o],u=t[(o+1)%n],c=i[o],d=Ja(a,u,c);c>0?s.push(`A${Rt(c)},${Rt(c)} 0 0 ${a.convex?1:0} ${Rt(d.x)},${Rt(d.y)}`):s.push(`L${Rt(d.x)},${Rt(d.y)}`);let h=i[(o+1)%n],l=Ja(a,u,Qr(a,u)-h);s.push(`L${Rt(l.x)},${Rt(l.y)}`)}return s.push("Z"),s.join(" ")}function Qr(t,e){return Math.hypot(t.x-e.x,t.y-e.y)}function Ja(t,e,n){let i=e.x-t.x,r=e.y-t.y,s=Math.hypot(i,r);if(s===0)return{x:t.x,y:t.y};let o=n/s;return{x:t.x+i*o,y:t.y+r*o}}function Rt(t){return t.toFixed(2)}var rc=class extends be{element;rendering;constructor(e){super(),this.element=document.createElement("div"),this.element.className="md-cursor",this.rendering=oe(this,n=>{let i=n.readObservable(e.position),r=n.readObservable(e.visualLineMap);if(i===void 0||r.isEmpty)return this.element.style.display="none",new Qn(i??ce.source(0),!1,Y.EMPTY);let s=r.lineIndexOfPosition(i);if(s===void 0)return this.element.style.display="none",new Qn(i,!1,Y.EMPTY);let o=r.lineRect(s).withZeroWidthAt(r.xAtPosition(i)),a=e.blocks?n.readObservable(e.blocks):void 0,u=a&&i.kind==="source"?Sf(v_(a,i.offset)):void 0;return u&&(o.x<u.left-.5||o.x>u.right+.5)?(this.element.style.display="none",new Qn(i,!1,Y.EMPTY)):(this.element.style.left=`${o.x}px`,this.element.style.top=`${o.y}px`,this.element.style.height=`${o.height}px`,this.element.style.display="",new Qn(i,!0,o))}),this._register(te(n=>{n.readObservable(this.rendering)})),this._register(te(n=>{n.readObservable(e.position),this.element.style.animation="none",this.element.offsetWidth,this.element.style.animation=""}))}},Qn=class{constructor(e,n,i){this.position=e,this.visible=n,this.rect=i}},sc=class extends be{element;rendering;constructor(e){super(),this.element=document.createElement("div"),this.element.className="md-gutter-layer",this.rendering=oe(this,n=>{let i=n.readObservable(e.markers),r=n.readObservable(e.visualLineMap);return this._render(i,r)}),this._register(te(n=>{n.readObservable(this.rendering)}))}_render(e,n){if(this.element.replaceChildren(),n.isEmpty)return new Ws([]);let i=[];for(let r of e){let s=r.type==="deleted"||r.range.isEmpty?E_(r,n):k_(r,n);if(!s)continue;let o=document.createElement("div");o.className=`md-gutter-marker md-gutter-marker-${s.type}`,o.style.top=`${s.y}px`,s.height>0&&(o.style.height=`${s.height}px`),this.element.appendChild(o),i.push(s)}return new Ws(i)}},Ws=class{constructor(e){this.rects=e}};function k_(t,e){let n=1/0,i=-1/0;for(let r of e.sourceLines){let s=S_(r);!s||!t.range.intersects(s)||(n=Math.min(n,r.rect.top),i=Math.max(i,r.rect.top+r.rect.height))}if(!(i<=n))return{type:t.type,y:n,height:i-n}}function E_(t,e){let n=e.lineIndexOfOffset(t.range.start);return{type:"deleted",y:e.lineRect(n).top,height:0}}function S_(t){if(t.runs.length===0)return;let e=1/0,n=-1/0;for(let i of t.runs)i.sourceStart<e&&(e=i.sourceStart),i.sourceEndExclusive>n&&(n=i.sourceEndExclusive);return T.fromTo(e,n)}function ch(t){return t.windowHasFocus&&t.focusIsUnclaimed}function z_(t){return!t.windowHasFocus}var dh=1;function C_(t,e,n){if(Lf(t))return;let i=t.ownerDocument;if(t===i.scrollingElement)return zf(i.defaultView??window,e,n);let r=Cf(t,e,n,t.clientWidth,t.clientHeight);return{eventTarget:t,isReached:()=>Tf(t.scrollLeft,t.scrollTop,r)}}function zf(t,e,n){let i=t.document,r=Cf(i.scrollingElement??i.documentElement,e,n,i.documentElement.clientWidth||t.innerWidth,i.documentElement.clientHeight||t.innerHeight);return{eventTarget:i,isReached:()=>Tf(t.scrollX,t.scrollY,r)}}function Cf(t,e,n,i,r){let s=Math.max(0,t.scrollWidth-i),o=Math.max(0,t.scrollHeight-r),a=(t.ownerDocument.defaultView??window).getComputedStyle(t).direction==="rtl";return new xt(a?Math.max(-s,Math.min(0,e)):Math.max(0,Math.min(s,e)),Math.max(0,Math.min(o,n)))}function Tf(t,e,n){return Math.abs(t-n.x)<=dh&&Math.abs(e-n.y)<=dh}function Of(t){let e=t.ownerDocument,n=e.defaultView??window,i=Y.fromPointSize(0,0,e.documentElement.clientWidth||n.innerWidth,e.documentElement.clientHeight||n.innerHeight);for(let r=t.parentElement;r;r=r.parentElement){let s=n.getComputedStyle(r),o=hh(s.overflowX),a=hh(s.overflowY);if(!o&&!a)continue;let u=Rf(r),c=o?Math.max(i.left,u.left):i.left,d=o?Math.min(i.right,u.right):i.right,h=a?Math.max(i.top,u.top):i.top,l=a?Math.min(i.bottom,u.bottom):i.bottom;if(d<=c||l<=h)return Y.fromPointSize(c,h,0,0);i=Y.fromPointPoint(c,h,d,l)}return i}function Rf(t){let e=t.getBoundingClientRect(),n=t.offsetWidth>0?e.width/t.offsetWidth:1,i=t.offsetHeight>0?e.height/t.offsetHeight:1;return Y.fromPointSize(e.left+t.clientLeft*n,e.top+t.clientTop*i,t.clientWidth*n,t.clientHeight*i)}function T_(t,e,n){let i=t.getBoundingClientRect(),r=t.offsetWidth>0?i.width/t.offsetWidth:1,s=t.offsetHeight>0?i.height/t.offsetHeight:1;return{x:e/r,y:n/s}}function O_(t){let e=Math.max(t.horizontalScrollbarHeight,0);return t.scrollHeight-t.clientHeight>e}function Lf(t){let e=t.ownerDocument;if(t!==e.body)return!1;let n=e.defaultView?.getComputedStyle(e.documentElement);return n!==void 0&&n.overflowX==="visible"&&n.overflowY==="visible"}function R_(t){if(Lf(t))return!1;let e=t.ownerDocument.defaultView?.getComputedStyle(t),n=e?parseFloat(e.borderTopWidth)+parseFloat(e.borderBottomWidth):0;return O_({scrollHeight:t.scrollHeight,clientHeight:t.clientHeight,horizontalScrollbarHeight:t.offsetHeight-t.clientHeight-(Number.isFinite(n)?n:0)})}function L_(t){let e=t.ownerDocument.defaultView??window,n=[];for(let i=t.parentElement;i;i=i.parentElement){let r=e.getComputedStyle(i),s=fh(r.overflowX)&&i.scrollWidth>i.clientWidth,o=fh(r.overflowY)&&i.scrollHeight>i.clientHeight;(s||o)&&n.push(i)}return n}function lh(t,e){return t.left<=e.left&&e.right<=t.right&&t.top<=e.top&&e.bottom<=t.bottom}function hh(t){return t==="auto"||t==="scroll"||t==="hidden"||t==="clip"}function fh(t){return t==="auto"||t==="scroll"||t==="hidden"}var I_=900,$i=2,If=5,zn=16,Us=class extends be{constructor(e,n){super(),this._model=e,this._options=n,this._register({dispose:()=>this._pendingTopReveal?.dispose()}),this.element=document.createElement("div"),this.element.className="md-editor",this._options?.classNames&&this.element.classList.add(...this._options.classNames),this.element.tabIndex=0,this._contentContainer=document.createElement("div"),this._contentContainer.className="md-editor-content",this.element.appendChild(this._contentContainer);let i=this._options?.limitedWidth??Zo(I_);this._register(te(c=>{let d=i.read(c);this._contentContainer.style.maxWidth=d===void 0?"":`${d}px`})),this.measuredLayout=new vu;let r=-1,s=-1,o=-1;this._resizeObserver=new ResizeObserver(()=>{this.element.classList.toggle("md-editor-narrow",this.element.clientWidth<=320);let c=getComputedStyle(this._contentContainer),d=this._contentContainer.clientWidth-parseFloat(c.paddingLeft)-parseFloat(c.paddingRight);this.element.classList.toggle("md-find-compact",d<=400);let h=this._document.get();if(!h)return;let l=this._contentContainer.clientWidth,f=this._contentContainer.clientHeight,m=h.contentDomNode.getBoundingClientRect().height;Math.abs(l-r)<.5&&Math.abs(f-s)<.5&&Math.abs(m-o)<.5||(r=l,s=f,o=m,this._publishMeasurements(h),this._revealCaretAfterActiveBlockResize())}),this._resizeObserver.observe(this.element),this._resizeObserver.observe(this._contentContainer),this._register({dispose:()=>this._resizeObserver.disconnect()});let a=0,u=()=>{a||(a=requestAnimationFrame(()=>{a=0;let c=this._document.get();c&&this._publishMeasurements(c)}))};this._contentContainer.addEventListener("scroll",u,{capture:!0,passive:!0}),this._register({dispose:()=>{this._contentContainer.removeEventListener("scroll",u,{capture:!0}),a&&cancelAnimationFrame(a)}}),this._selectionView=this._register(new ic({selection:this._model.selection,visualLineMap:this.measuredLayout.visualLineMap,blocks:this._selectionBlocksObs})),this._contentContainer.appendChild(this._selectionView.element),this.coordinateSpace=Fs.forSvgOverlay(this._selectionView.element),this._cursorView=this._register(new rc({position:this._model.cursorPosition,visualLineMap:this.measuredLayout.visualLineMap,blocks:this._selectionBlocksObs})),this._contentContainer.appendChild(this._cursorView.element),this._gutterMarkersView=this._register(new sc({markers:this._model.gutterMarkers,visualLineMap:this.measuredLayout.visualLineMap})),this._contentContainer.appendChild(this._gutterMarkersView.element),this._diffHighlightsView=this._register(new nc(this._contentContainer,this.coordinateSpace)),this._contentContainer.appendChild(this._diffHighlightsView.element),this._register(te(c=>{let d=this._model.readonlyMode.read(c);this.element.classList.toggle("md-readonly",d),d||this.element.classList.remove("md-readonly-editing-attempt")})),this._options?.showReadonlyToggle!==!1&&this._setupReadonlyToggle(),this.editContext=new EditContext({text:this._model.sourceText.get().value,selectionStart:0,selectionEnd:0}),this.element.editContext=this.editContext,this._register(te(this._renderAutorun)),this._setupModifierTracking(),this._setupFocusTracking(),this._setupCaretScrollPadding(),this._register(te(c=>{let d=c.readObservable(this._model.selection)?.range;this.editContext.updateSelection(d?.start??0,d?.endExclusive??0)})),this._register({dispose:()=>{this._stopFollowingCaret(),this._document.get()?.dispose(),this._clearDiff()}})}element;editContext;measuredLayout;coordinateSpace;forcedMarkerVisibleBlocks=H(this,new Set);_contentContainer;_resizeObserver;_cursorView;_selectionView;_gutterMarkersView;_diffHighlightsView;_readonlyToggleButton;_editContextSuspensions=new Set;_revealOcclusions=new Set;_pendingTopReveal;_caretRevealRaf;_followedCaretBlock;_followCaretAfterEdit=!1;_document=H(this,void 0);_embeddedCodeEditorFactoryVersion=H(this,0);_suspendEditContextForBlockControl=e=>this.suspendEditContextWhileFocused(e);get documentViewNode(){return this._document}refreshEmbeddedCodeEditors(){this._embeddedCodeEditorFactoryVersion.set(this._embeddedCodeEditorFactoryVersion.get()+1,void 0)}_previousViewData;_viewData=H(this,void 0);get viewData(){return this._viewData}_focused=H(this,!1);get focused(){return this._focused}_selectionBlocksObs=oe(this,e=>this.measuredLayout.measurements.read(e).flatMap(n=>!n.rect||!n.viewNode?[]:[{block:n.block,absoluteStart:n.absoluteStart,rect:n.rect,viewportClip:n.viewportClip}]));_caretRect=oe(this,e=>{let n=this._cursorView.rendering.read(e);return n.visible?n.rect:void 0});get caretRect(){return this._caretRect}get overlayContainer(){return this._contentContainer}rangeRects(e){return oe(this,n=>{let i=this.measuredLayout.visualLineMap.read(n),r=this._selectionBlocksObs.read(n);return Ef(e,i,r)})}_setupModifierTracking(){this._register(te(e=>{this.element.classList.toggle("md-mod-down",this._model.ctrlOrMetaDown.read(e))}))}_setupFocusTracking(){let e=this.element,n=e.ownerDocument.defaultView??window,i=()=>{let c=e.ownerDocument.activeElement;return c!==null&&e.contains(c)},r=c=>this._focused.set(c,void 0),s=()=>r(!0),o=c=>{let d=c.relatedTarget;r(d instanceof Node&&e.contains(d))},a=()=>r(!1),u=()=>r(i());e.addEventListener("focusin",s),e.addEventListener("focusout",o),n.addEventListener("blur",a),n.addEventListener("focus",u),this._register({dispose:()=>{e.removeEventListener("focusin",s),e.removeEventListener("focusout",o),n.removeEventListener("blur",a),n.removeEventListener("focus",u)}}),this._register(te(c=>{this.element.classList.toggle("md-focused",this._focused.read(c))}))}_setupCaretScrollPadding(){this._register(te(e=>{let n=this._model.cursorPosition.read(e),i=this._model.sourceText.read(e).value.length,r=this._model.pendingParagraph.read(e),s=n?.kind==="source"?n.offset===i:r?.atEof===!0;this._contentContainer.style.paddingBlockEnd=this._focused.read(e)&&s?`${If}lh`:""}))}_setupReadonlyToggle(){let e=document.createElement("div");e.className="md-readonly-toggle-host",this._contentContainer.classList.add("md-editor-content-with-readonly-toggle");let n=document.createElement("button");n.type="button",n.className="md-readonly-toggle",this._readonlyToggleButton=n;let i=document.createElement("span");i.className="md-readonly-toggle-indicator",i.setAttribute("aria-hidden","true");let r=document.createElementNS("http://www.w3.org/2000/svg","svg");r.classList.add("md-readonly-toggle-icon","md-readonly-toggle-icon-locked"),r.setAttribute("viewBox","0 0 16 16"),r.setAttribute("fill","currentColor"),r.setAttribute("aria-hidden","true");let s=document.createElementNS("http://www.w3.org/2000/svg","path");s.setAttribute("d","M8 9C8.55228 9 9 9.44771 9 10C9 10.5523 8.55228 11 8 11C7.44772 11 7 10.5523 7 10C7 9.44771 7.44772 9 8 9Z");let o=document.createElementNS("http://www.w3.org/2000/svg","path");o.setAttribute("fill-rule","evenodd"),o.setAttribute("clip-rule","evenodd"),o.setAttribute("d","M8 1C9.654 1 11 2.346 11 4V6H12C13.103 6 14 6.897 14 8V13C14 14.103 13.103 15 12 15H4C2.897 15 2 14.103 2 13V8C2 6.897 2.897 6 4 6H5V4C5 2.346 6.346 1 8 1ZM4 7C3.449 7 3 7.449 3 8V13C3 13.551 3.449 14 4 14H12C12.551 14 13 13.551 13 13V8C13 7.449 12.551 7 12 7H4ZM8 2C6.897 2 6 2.897 6 4V6H10V4C10 2.897 9.103 2 8 2Z"),r.append(s,o);let a=document.createElementNS("http://www.w3.org/2000/svg","svg");a.classList.add("md-readonly-toggle-icon","md-readonly-toggle-icon-editing"),a.setAttribute("viewBox","0 0 16 16"),a.setAttribute("fill","currentColor"),a.setAttribute("aria-hidden","true");let u=document.createElementNS("http://www.w3.org/2000/svg","path");u.setAttribute("d","M14.236 1.76386C13.2123 0.740172 11.5525 0.740171 10.5289 1.76386L2.65722 9.63549C2.28304 10.0097 2.01623 10.4775 1.88467 10.99L1.01571 14.3755C0.971767 14.5467 1.02148 14.7284 1.14646 14.8534C1.27144 14.9783 1.45312 15.028 1.62432 14.9841L5.00978 14.1151C5.52234 13.9836 5.99015 13.7168 6.36433 13.3426L14.236 5.47097C15.2596 4.44728 15.2596 2.78755 14.236 1.76386ZM11.236 2.47097C11.8691 1.8378 12.8957 1.8378 13.5288 2.47097C14.162 3.10413 14.162 4.1307 13.5288 4.76386L12.75 5.54269L10.4571 3.24979L11.236 2.47097ZM9.75002 3.9569L12.0429 6.24979L5.65722 12.6355C5.40969 12.883 5.10023 13.0595 4.76117 13.1465L2.19447 13.8053L2.85327 11.2386C2.9403 10.8996 3.1168 10.5901 3.36433 10.3426L9.75002 3.9569Z"),a.appendChild(u),n.append(i,r,a),e.appendChild(n);let c=()=>{this._model.toggleReadonlyMode()},d=f=>{f.button===0&&(f.preventDefault(),f.stopPropagation(),this.focus())},h=f=>{f.stopPropagation()},l=f=>{f.animationName==="md-readonly-toggle-shine"&&n.classList.remove("md-readonly-toggle-shine")};n.addEventListener("pointerdown",d),n.addEventListener("keydown",h),n.addEventListener("animationend",l),n.addEventListener("click",c),this._register(this.suspendEditContextWhileFocused(n)),this._register({dispose:()=>{n.removeEventListener("pointerdown",d),n.removeEventListener("keydown",h),n.removeEventListener("animationend",l),n.removeEventListener("click",c),this._readonlyToggleButton===n&&(this._readonlyToggleButton=void 0)}}),this._register(te(f=>{let m=this._model.readonlyMode.read(f);n.classList.toggle("md-readonly-toggle-locked",m),n.setAttribute("aria-pressed",String(m)),n.setAttribute("aria-label",m?"Locked; switch to editing":"Editing; switch to locked mode"),n.title=m?"Read-only: markers hidden, editing disabled. Click to edit.":"Editing: click to lock (hide markers, disable editing).",m||n.classList.remove("md-readonly-toggle-shine")})),this._contentContainer.insertBefore(e,this._contentContainer.firstChild)}showReadonlyEditingAttempt(){let e=this._readonlyToggleButton;if(e){e.classList.contains("md-readonly-toggle-shine")||e.classList.add("md-readonly-toggle-shine");return}this.element.classList.remove("md-readonly-editing-attempt"),requestAnimationFrame(()=>{this._model.readonlyMode.get()&&this.element.classList.add("md-readonly-editing-attempt")})}focus(){this.element.focus({preventScroll:!0})}mountOverlay(e,n){return n==="top-chrome"?this._contentContainer.insertBefore(e,this._contentContainer.firstChild):n==="below-selection"?this._contentContainer.insertBefore(e,this._selectionView.element):this._contentContainer.appendChild(e),{dispose:()=>e.remove()}}registerRevealOcclusion(e){return this._revealOcclusions.add(e),{dispose:()=>this._revealOcclusions.delete(e)}}suspendEditContextWhileFocused(e){let n=()=>{this._editContextSuspensions.add(e),this._syncEditContextAttachment()},i=r=>{let s=r.relatedTarget;s instanceof Node&&e.contains(s)||(this._editContextSuspensions.delete(e),this._syncEditContextAttachment())};return e.addEventListener("focusin",n),e.addEventListener("focusout",i),{dispose:()=>{e.removeEventListener("focusin",n),e.removeEventListener("focusout",i),this._editContextSuspensions.delete(e),this._syncEditContextAttachment()}}}revealRangeInCenterIfOutsideViewport(e,n="smooth"){return this._scheduleRangeReveal(e,n,"center")}revealRangeAtTop(e,n="smooth"){return this._stopFollowingCaret(),this._scheduleRangeReveal(e,n,"top")}_scheduleRangeReveal(e,n,i){if(this._pendingTopReveal?.dispose(),i==="top")return this._scheduleTopRangeReveal(e,n);let r=!1,s=requestAnimationFrame(()=>{r||this._revealRange(e,n,i)}),o={dispose:()=>{r||(r=!0,cancelAnimationFrame(s))}};return this._register(o)}_scheduleTopRangeReveal(e,n){let i=this.element.ownerDocument,r=i.defaultView??window,s=this._model.sourceText.get(),o=this._model.selection.get(),a=["wheel","pointerdown","touchstart","keydown"],u=!1,c,d,h=()=>this._model.sourceText.get()===s&&this._model.selection.get()===o,l=()=>{if(!u){u=!0,c!==void 0&&r.cancelAnimationFrame(c),i.removeEventListener("scrollend",m,!0);for(let g of a)i.removeEventListener(g,l,!0);d?.clear(),this._pendingTopReveal===p&&(this._pendingTopReveal=void 0)}},f=()=>{if(c=void 0,u)return;let g=h();l(),g&&this._revealRange(e,"instant","top")},m=g=>{if(!g.target||!d)return;let b=d.get(g.target);if(b){if(!b.isReached()){l();return}d.delete(g.target),d.size===0&&(i.removeEventListener("scrollend",m,!0),c=r.requestAnimationFrame(f))}},p={dispose:l};this._pendingTopReveal=p;for(let g of a)i.addEventListener(g,l,{capture:!0,passive:!0});return c=r.requestAnimationFrame(()=>{if(c=void 0,!u){if(!h()){l();return}if(d=this._revealRange(e,n,"top"),!d){l();return}for(let[g,b]of d)b.isReached()&&d.delete(g);d.size===0?c=r.requestAnimationFrame(f):i.addEventListener("scrollend",m,!0)}}),p}revealCaretAfterEdit(){this._model.selection.get()&&(this._followCaretAfterEdit=!0,this._scheduleCaretReveal())}revealCaretAfterKeyboardNavigation(){this._scheduleCaretReveal()}stopFollowingCaret(){this._stopFollowingCaret()}_sampleAutoFocusEnvironment(){let e=this.element.ownerDocument,n=e.activeElement;return{windowHasFocus:e.hasFocus(),focusIsUnclaimed:n===null||n===e.body}}tryAutoFocus(){return ch(this._sampleAutoFocusEnvironment())?(this.focus(),!0):!1}autoFocusOnOpen(){let e=this._sampleAutoFocusEnvironment();if(ch(e)){this.focus();return}if(!z_(e))return;let n=this.element.ownerDocument.defaultView??window,i=()=>{n.removeEventListener("focus",i),this.tryAutoFocus()};n.addEventListener("focus",i),this._register({dispose:()=>n.removeEventListener("focus",i)})}geometricHitTest=H(this,!0);resolveOffsetFromPoint(e){let n=document.elementFromPoint(e.x,e.y),i=this._resolveControlFreeVideoOffset(n);if(i!==void 0)return i;let r=this._resolveTableCellOffset(e,n);if(r!==void 0)return r;if(this.geometricHitTest.get()){let o=this.measuredLayout.visualLineMap.get();return o.isEmpty?void 0:o.offsetAtPoint(this.coordinateSpace.capture().toLocalPoint(e))}let s=Lv(e);if(s)return this._document.get()?.resolveSource(s)}_resolveControlFreeVideoOffset(e){let n=e?.closest("video.md-video");if(!(n instanceof HTMLVideoElement)||n.controls||!this._contentContainer.contains(n))return;let i=this._document.get();if(!i)return;let r=kt.forDom(n);if(!(r?.ast instanceof Et)||!(r.dom instanceof HTMLElement)||!r.dom.contains(n))return;let s=i.resolveSource({node:n,offset:0});if(s!==void 0)return s+(r.ast.leadingTrivia?.length??0)}_resolveTableCellOffset(e,n){let i=n?.closest("td");if(!(i instanceof HTMLTableCellElement)||!this._contentContainer.contains(i))return;let r=this._document.get();if(!r)return;let s=kt.forDom(i);if(s?.ast.kind!=="tableCell"||s.dom!==i)return;let o=r.resolveSource({node:i,offset:0}),a=r.resolveSource({node:i,offset:1});if(o===void 0||a===void 0)return;let u=h=>{let l=h.getBoundingClientRect();return(getComputedStyle(h).direction==="rtl"?e.x>=l.left+l.width/2:e.x<l.left+l.width/2)?0:1},c=(h,l)=>this.measuredLayout.visualLineMap.get().lines.some(f=>f.runs.some(m=>m.source!==void 0&&m.sourceStart<l&&m.sourceEndExclusive>h)),d=n?kt.forDom(n):void 0;if(d&&d!==s&&d.dom instanceof Element){let h=r.resolveSource({node:d.dom,offset:0}),l=r.resolveSource({node:d.dom,offset:1});if(h!==void 0&&l!==void 0&&!c(h,l))return l-h<=1?l:u(d.dom)===0?h+1:l-1}if(!c(o,a))return a-o<=1?a:u(i)===0?o+1:a-1}isPointInContent(e){let n=this._document.get()?.contentDomNode;if(!n)return!1;let i=document.elementFromPoint(e.x,e.y);return i!==null&&n.contains(i)}intersectsRenderedContent(e){let n=this._document.get()?.contentDomNode;return!!n&&e.intersectsNode(n)}_renderAutorun=e=>{let n=e.readObservable(this._model.document),i=e.readObservable(this._model.sourceText).value,r=e.readObservable(this._model.markerVisibleBlocks),s=e.readObservable(this.forcedMarkerVisibleBlocks),o=s.size===0?r:new Set([...r,...s]),a=e.readObservable(this._model.selection),u=e.readObservable(this._model.pendingParagraph),c=e.readObservable(this._model.diff),d=e.readObservable(this._model.readonlyMode),h=e.readObservable(this._embeddedCodeEditorFactoryVersion);this.editContext.text!==i&&this.editContext.updateText(0,this.editContext.text.length,i);let l=a?.range;this.editContext.updateSelection(l?.start??0,l?.endExclusive??0);let f=this._document.get(),m=gf(n,o,a?.range,this._previousViewData,u?{anchorBlock:u.anchorBlock,ast:u.syntheticAst,replaceRange:u.replaceRange,cursorLine:u.cursorLine,text:u.text}:void 0);this._previousViewData=m;let p=c?n_(m,c.items,this._options?.diffDecorationsActive):m;this._viewData.set(p,void 0);let g={...this._options,suspendEditContextWhileFocused:this._suspendEditContextForBlockControl,...this._options?.embeddedCodeEditorFactory?{embeddedCodeEditorReadOnly:d,embeddedCodeEditorFactoryVersion:h}:{}},b=Cu.create(p,g,f);if(f){if(b.contentDomNode!==f.contentDomNode)throw new Error("DocumentViewNode.contentDomNode must be stable across rebuilds")}else this._contentContainer.insertBefore(b.contentDomNode,this._selectionView.element),this._resizeObserver.observe(b.contentDomNode);this._document.set(b,void 0),this._publishMeasurements(b),c?this._paintDiff(b,c.insertedRanges):this._clearDiff()};get _blocks(){return this._document.get()?.blocks??[]}_publishMeasurements(e){let n=this.coordinateSpace.capture(),i=[];for(let o of e.blocks){let a=n.toLocalRect(o.node.element.getBoundingClientRect());o.node.recordMeasuredHeight(a.height);let u=o.node.scrollElement,c,d=getComputedStyle(u).overflowX;if((d==="auto"||d==="scroll"||d==="hidden"||d==="clip")&&u.scrollWidth>u.clientWidth+1){let l=n.toLocalRect(u.getBoundingClientRect()).left+u.clientLeft;c={left:l,right:l+u.clientWidth}}let h=Zi.measure([{absoluteStart:o.absoluteStart,viewNode:o.node}],this.coordinateSpace,n);i.push({block:o.node.block,absoluteStart:o.absoluteStart,height:a.height,rect:a,viewportClip:c,isMeasured:!0,visualLineMap:h,viewNode:o.node})}let r=e.pendingParagraph,s=[];if(r){let o=n.toLocalRect(r.element.getBoundingClientRect()),a=n.toLocalRect(r.getCaretClientRect());s.push({afterBlock:r.anchorBlock,line:us.virtual(r.cursorLine,Y.fromPointSize(a.left,o.top,0,o.height))})}this.measuredLayout.setMeasurements(i,s)}_paintDiff(e,n){this._diffHighlightsView.render(e,n)}_clearDiff(){this._diffHighlightsView.clear()}_syncEditContextAttachment(){this.element.editContext=this._editContextSuspensions.size>0?null:this.editContext}_revealRange(e,n,i="center",r){let s=this._document.get();if(!s)return;let o=oo(s,[e]);if(o.length===0&&!e.isEmpty)return;let a=this.measuredLayout.measurements.get().find(h=>h.absoluteStart<=e.start&&e.start<=h.absoluteStart+h.block.length),u=o[0]?.range.startContainer??a?.viewNode?.dom,c=u instanceof Element?u:u?.parentElement;if(!c)return;let d=()=>{let h=M_(o.flatMap(f=>Array.from(f.range.getClientRects())));if(h||!e.isEmpty)return h;let l=this.measuredLayout.visualLineMap.get();if(!l.isEmpty){let f=l.lineIndexOfOffset(e.start),m=l.lineRect(f),p=Y.fromPointSize(l.xAtOffset(e.start),m.top,2,m.height);return this.coordinateSpace.capture().toClientRect(p)}if(a?.rect)return this.coordinateSpace.capture().toClientRect(Y.fromPointSize(a.rect.left,a.rect.top,2,a.rect.height))};return this._revealTarget(c,d,n,i,r)}_revealTarget(e,n,i,r,s){let o=n();if(!o)return;let a=Of(e),u=this._isRevealOccluded(o);if(r!=="top"&&lh(a,Qa(o,a,s))&&!u)return;let c=L_(e),d=r==="top"?new Map:void 0,h=r==="top"?c.find(x=>R_(x)):void 0;for(let x=0;x<c.length;x++){let y=c[x];o=n()??o,u=this._isRevealOccluded(o);let z=Rf(y),k=Qa(o,z,s),C=y.scrollWidth>y.clientWidth,L=y.scrollHeight>y.clientHeight,B=y===h,E=r==="top"&&!B?"nearest":r,re=B?this._topRevealInset(z,o):zn,X=r==="top"&&!B?this._unoccludedViewport(z,o):z,A=ph(X,z),W=gh(k,X,E,re),U=T_(y,W.x,W.y),le=C&&(o.left<z.left||o.right>z.right)?y.scrollLeft+U.x:y.scrollLeft,we=L&&(B||k.top<A.top||k.bottom>A.bottom||u)?y.scrollTop+U.y:y.scrollTop,gt=we!==y.scrollTop;if(le!==y.scrollLeft||gt){let st=d?C_(y,le,we):void 0;y.scrollTo({left:le,top:we,behavior:r==="top"&&i==="instant"?"instant":"auto"}),st&&d?.set(st.eventTarget,st)}}o=n()??o,u=this._isRevealOccluded(o);let l=this.element.ownerDocument,f=l.defaultView??window,m=Y.fromPointSize(0,0,l.documentElement.clientWidth||f.innerWidth,l.documentElement.clientHeight||f.innerHeight),p=Qa(o,m,s),g=r==="top"&&h!==void 0?"nearest":r,b=g==="top",w=r==="top"&&!b?this._unoccludedViewport(m,o):m;if(b||!lh(ph(w,m),p)||u){let x=b?this._topRevealInset(m,o):zn,y=gh(p,w,g,x),z=o.left<m.left||o.right>m.right?y.x:0;d&&d.set(l,zf(f,f.scrollX+z,f.scrollY+y.y)),f.scrollBy({left:z,top:y.y,behavior:i})}return d}_scheduleCaretReveal(){this._caretRevealRaf!==void 0&&cancelAnimationFrame(this._caretRevealRaf),this._caretRevealRaf=requestAnimationFrame(()=>{this._caretRevealRaf=requestAnimationFrame(()=>{this._caretRevealRaf=void 0;let e=this._model.selection.get();!e||!this._focused.get()||(this._revealCaretNearest(),this._followedCaretBlock=this._caretBlockAt(e.active))})})}_revealCaretNearest(){let e=this._model.cursorPosition.get();if(!e)return;let n=this.measuredLayout.visualLineMap.get(),i=n.lineIndexOfPosition(e),r=i===void 0?void 0:n.lineRect(i).height;if(e.kind==="source"){this._revealRange(T.emptyAt(e.offset),"auto","nearest",r);return}let s=this._cursorView.rendering.get(),o=this._model.selection.get(),a=(o?this._measurementAt(o.active):void 0)?.viewNode?.dom,u=a instanceof Element?a:a?.parentElement;!s.visible||!u||this._revealTarget(u,()=>{let c=this._cursorView.rendering.get();return c.visible?this.coordinateSpace.capture().toClientRect(c.rect):void 0},"auto","nearest",r)}_revealCaretAfterActiveBlockResize(){if(!this._followCaretAfterEdit)return;let e=this._model.selection.get();if(!e)return;let n=this._caretBlockAt(e.active),i=this._followedCaretBlock;if(!n){this._followedCaretBlock=void 0;return}i&&(i.element!==n.element||Math.abs(i.height-n.height)>=.5)&&this._scheduleCaretReveal(),this._followedCaretBlock=n}_caretBlockAt(e){let n=this._measurementAt(e);return n?.viewNode?{element:n.viewNode.element,height:n.height}:void 0}_measurementAt(e){return this.measuredLayout.measurements.get().find(n=>n.absoluteStart<=e&&e<=n.absoluteStart+n.block.length&&n.viewNode!==void 0)}_stopFollowingCaret(){this._followCaretAfterEdit=!1,this._followedCaretBlock=void 0,this._caretRevealRaf!==void 0&&(cancelAnimationFrame(this._caretRevealRaf),this._caretRevealRaf=void 0)}_isRevealOccluded(e){for(let n of this._activeRevealOcclusions())if(mh(e,n))return!0;return!1}*_activeRevealOcclusions(){for(let e of this._revealOcclusions){let n=e.ownerDocument.defaultView?.getComputedStyle(e).visibility;e.isConnected&&e.getClientRects().length>0&&n!=="hidden"&&n!=="collapse"&&(yield N_(e.getBoundingClientRect()))}}_occludedTopHeight(e,n){let i=0;for(let r=0;r<=this._revealOcclusions.size;r++){let s=Y.fromPointPoint(n.left,e.top,n.right,e.top+i+zn+n.height),o=i;for(let a of this._activeRevealOcclusions())mh(s,a)&&(o=Math.max(o,a.bottom-e.top));if(o===i)break;i=o}return i}_topRevealInset(e,n){let i=this._occludedTopHeight(e,n),r=Math.max(zn,i,e.height-n.height);return Math.min(i+zn,r)}_unoccludedViewport(e,n){let i=this._occludedTopHeight(e,n);if(i<=0)return e;let r=e.top+i+zn;return r>=e.bottom?e:Y.fromPointPoint(e.left,r,e.right,e.bottom)}};function mh(t,e){let n=t.width===0?e.containsX(t.left):Math.max(t.left,e.left)<Math.min(t.right,e.right),i=t.height===0?e.containsY(t.top):Math.max(t.top,e.top)<Math.min(t.bottom,e.bottom);return n&&i}function M_(t){if(t.length===0)return;let e=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY;for(let s of t)e=Math.min(e,s.left),n=Math.min(n,s.top),i=Math.max(i,s.right),r=Math.max(r,s.bottom);return Y.fromPointPoint(e,n,i,r)}function N_(t){return Y.fromPointPoint(t.left,t.top,t.right,t.bottom)}function ph(t,e){return t===e?e:Y.fromPointPoint(t.left,t.top-$i,t.right,t.bottom)}function gh(t,e,n,i=zn){if(n==="center")return new xt(t.left+t.width/2-(e.left+e.width/2),t.top+t.height/2-(e.top+e.height/2));let r=t.left<e.left?t.left-e.left-$i:t.right>e.right?t.right-e.right+$i:0;if(n==="top")return new xt(r,t.top-e.top-i);let s=t.height>e.height?t.top-e.top:t.top<e.top?t.top-e.top-$i:t.bottom>e.bottom?t.bottom-e.bottom+$i:0;return new xt(r,s)}function Qa(t,e,n){if(n===void 0||n<=0)return t;let i=e.height/n,r=Math.min(i/2,If)*n;return Y.fromPointPoint(t.left,t.top-r,t.right,t.bottom+r)}var A_=1e3,P_="md-editor-find-match",F_="md-editor-find-current",bh=new WeakMap,oc=class{constructor(e){this._registry=e}_entries=new Set;add(){let e={matches:[],current:[]};return this._entries.add(e),this._refresh(),{update:(n,i)=>{e.matches=n,e.current=i,this._refresh()},dispose:()=>{this._entries.delete(e),this._refresh()}}}_refresh(){let e=[...this._entries].flatMap(i=>i.matches),n=[...this._entries].flatMap(i=>i.current);this._set(P_,e),this._set(F_,n)}_set(e,n){n.length===0?this._registry.delete(e):this._registry.set(e,new Highlight(...n))}};function $_(t){let e=t.defaultView?.CSS.highlights;if(!e)return{update:()=>{},dispose:()=>{}};let n=bh.get(t);return n||(n=new oc(e),bh.set(t,n)),n.add()}var ac=class extends be{constructor(e,n){super(),this._view=e,this._matchesLayer=_h("md-find-matches-layer"),this._currentLayer=_h("md-find-current-layer"),this._highlightRegistration=this._register($_(this._view.element.ownerDocument)),this._register(this._view.mountOverlay(this._matchesLayer,"below-selection")),this._register(this._view.mountOverlay(this._currentLayer,"above-decorations")),this._register(te(o=>{let a=n.isRevealed.read(o);if(!a){this._snapshot=void 0,this._schedulePaint();return}this._snapshot={isRevealed:a,result:n.searchResult.read(o),currentMatch:n.currentMatch.read(o),document:this._view.documentViewNode.read(o),measurements:this._view.measuredLayout.measurements.read(o)},this._schedulePaint()}));let i=()=>this._schedulePaint(),r=this._view.element.ownerDocument,s=r.defaultView??window;r.addEventListener("scroll",i,!0),s.addEventListener("scroll",i),this._register({dispose:()=>{r.removeEventListener("scroll",i,!0),s.removeEventListener("scroll",i)}}),this._resizeObserver=new ResizeObserver(()=>this._schedulePaint()),this._observeResizeAncestors(),s.addEventListener("resize",i),this._register({dispose:()=>{s.removeEventListener("resize",i),this._resizeObserver.disconnect()}}),this._register({dispose:()=>{this._paintRaf&&cancelAnimationFrame(this._paintRaf)}})}_matchesLayer;_currentLayer;_highlightRegistration;_resizeObserver;_resizeObservedElements=new Set;_snapshot;_paintRaf=0;_schedulePaint(){this._paintRaf||(this._paintRaf=requestAnimationFrame(()=>{this._paintRaf=0,this._paint()}))}_paint(){this._observeResizeAncestors();let e=this._snapshot;if(!e||!e.isRevealed||e.result.kind==="invalid"||!e.document){this._matchesLayer.replaceChildren(),this._currentLayer.replaceChildren(),this._highlightRegistration.update([],[]);return}let n=this._view.coordinateSpace.capture(),i=Of(this._view.overlayContainer),r=n.toLocalRect(i),s=B_(this._view.measuredLayout.visualLineMap.get().sourceLines.flatMap(h=>Math.max(h.rect.top,r.top)>=Math.min(h.rect.bottom,r.bottom)?[]:h.runs.flatMap(l=>{let f=D_(l,h.rect,r);return f?[f]:[]}))),o=xh(e.result.matches.filter(h=>!e.currentMatch?.equals(h)),s),a=e.currentMatch?[e.currentMatch]:[],u=xh(a,s),c=this._paintRanges(this._matchesLayer,e.document,o,e.measurements,r,"md-find-match-rect",A_),d=this._paintRanges(this._currentLayer,e.document,u,e.measurements,r,"md-find-current-rect",Number.POSITIVE_INFINITY);this._highlightRegistration.update(c,d)}_observeResizeAncestors(){for(let e=this._view.element;e;e=e.parentElement)this._resizeObservedElements.has(e)||(this._resizeObservedElements.add(e),this._resizeObserver.observe(e))}_paintRanges(e,n,i,r,s,o,a){let u=this._view.coordinateSpace.capture(),c=document.createDocumentFragment(),d=[],h=0;for(let f of i.filter(m=>m.isEmpty)){let m=this._view.measuredLayout.visualLineMap.get();if(m.isEmpty)continue;let p=m.lineIndexOfOffset(f.start),g=m.lineRect(p),b=kh(Y.fromPointSize(m.xAtOffset(f.start),g.top,2,g.height),s,wh(r,f.start)?.viewportClip);if(b&&(c.appendChild(vh(`${o} md-find-zero-width-rect`,b)),h++,h>=a))return e.replaceChildren(c),d}let l=Number.isFinite(a)?Math.max(0,a-h):Number.POSITIVE_INFINITY;for(let f of oo(n,i.filter(m=>!m.isEmpty),l)){let m=wh(r,f.sourceRange.start),p=!1;for(let g of f.range.getClientRects()){let b=kh(u.toLocalRect(g),s,m?.viewportClip);if(!(!b||b.width===0||b.height===0)&&(p=!0,c.appendChild(vh(o,b)),h++,h>=a))return p&&d.push(f.range),e.replaceChildren(c),d}p&&d.push(f.range)}return e.replaceChildren(c),d}};function vh(t,e){let n=document.createElement("div");return n.className=t,n.style.left=`${e.left}px`,n.style.top=`${e.top}px`,n.style.width=`${e.width}px`,n.style.height=`${e.height}px`,n}function _h(t){let e=document.createElement("div");return e.className=`md-find-highlight-layer ${t}`,e.setAttribute("aria-hidden","true"),e}function xh(t,e){if(e.length===0)return[];let n=[],i=0;for(let r of t){if(r.isEmpty){for(;i<e.length&&e[i].endExclusive<r.start;)i++;let s=e[i];s&&s.start<=r.start&&r.start<=s.endExclusive&&n.push(r);continue}for(;i<e.length&&e[i].endExclusive<=r.start;)i++;for(let s=i;s<e.length;s++){let o=e[s];if(o.start>=r.endExclusive)break;let a=o.intersect(r);a&&!a.isEmpty&&n.push(a)}}return n}function wh(t,e){let n=0,i=t.length;for(;n<i;){let r=n+i>>>1,s=t[r];if(e<s.absoluteStart)i=r;else if(e>=s.absoluteStart+s.block.length)n=r+1;else return s}}function B_(t){let e=t.slice().sort((i,r)=>i.start-r.start||i.endExclusive-r.endExclusive),n=[];for(let i of e){let r=n[n.length-1];r?.intersectsOrTouches(i)?n[n.length-1]=r.join(i):n.push(i)}return n}function D_(t,e,n){if(t.sourceRange.isEmpty)return n.left<=t.rect.left&&t.rect.left<=n.right?t.sourceRange:void 0;let i=t.sourceStart,r=t.sourceEndExclusive;if(i>=r)return;let s=t.xAtOffset(r),o=t.xAtOffset(i+1),a=s>=o,u=t.rect.width>0?t.rect:e,c=a?u.left:u.right,d=g=>g===i?c:t.xAtOffset(g),h=g=>a?g:-g,l=h(a?n.left:n.right),f=h(a?n.right:n.left);if(h(s)<l||h(c)>f)return;let m=yh(i,r,g=>h(d(g))>=l);if(m>r)return;let p=Math.min(r,yh(m,r,g=>h(d(g))>f));if(!(m>=p))return new T(m,p)}function yh(t,e,n){let i=t,r=e+1;for(;i<r;){let s=i+r>>>1;s<=e&&n(s)?r=s:i=s+1}return i}function kh(t,e,n){let i=Math.max(t.left,e.left,n?.left??Number.NEGATIVE_INFINITY),r=Math.min(t.right,e.right,n?.right??Number.POSITIVE_INFINITY),s=Math.max(t.top,e.top),o=Math.min(t.bottom,e.bottom);return i<r&&s<o?Y.fromPointPoint(i,s,r,o):void 0}var q_=19999,uc=class t{constructor(e,n,i,r,s){this._source=e,this._flags=n,this._wholeWord=i,this._wordSeparators=r,this.isEmpty=s}static create(e){if(e.searchString.length===0)return{kind:"valid",pattern:new t("","gmu",e.wholeWord,e.wordSeparators,!0)};let n=e.isRegex?e.searchString:V_(e.searchString),i=`gmu${e.matchCase?"":"i"}`;try{new RegExp(n,i)}catch(r){return{kind:"invalid",error:r instanceof Error?r:new Error(String(r))}}return{kind:"valid",pattern:new t(n,i,e.wholeWord,e.wordSeparators,!1)}}findMatches(e,n,i=q_){if(this.isEmpty||i<=0)return{matches:[],isCapped:!1};let r=[],s=!1;return this._forEachMatch(e,n,o=>r.length===i?(s=!0,!1):(r.push(o),!0)),{matches:r,isCapped:s}}findNextMatch(e,n,i,r=!0,s){if(this.isEmpty)return;let o=Ks(n,0,e.length),a,u,c=!1;return this._forEachMatch(e,i,d=>s?.equals(d)?(c=!0,!0):(a??=d,d.start>=o?(u=d,!1):!0)),u??(r?a:void 0)??(c?s:void 0)}findPreviousMatch(e,n,i,r=!0,s){if(this.isEmpty)return;let o=Ks(n,0,e.length),a,u,c=!1;return this._forEachMatch(e,i,d=>s?.equals(d)?(c=!0,!0):(u=d,d.endExclusive<=o&&(a=d),!0)),a??(r?u:void 0)??(c?s:void 0)}_forEachMatch(e,n,i){let r=j_(n,e.length);if(r?.isEmpty)return;let s=new RegExp(this._source,this._flags);for(;;){let o=s.exec(e);if(!o)return;let a=T.ofStartAndLength(o.index,o[0].length);if((!r||r.containsRange(a))&&(!this._wholeWord||H_(e,a,this._wordSeparators))&&!i(a))return;o[0].length===0&&(s.lastIndex=W_(e,s.lastIndex))}}};function Mf(t){return t.replace(/[\\{}()[\]^$+*?.|]/g,"\\$&")}function V_(t){return t.split(/\r\n|\r|\n/).map(Mf).join("(?:\\r\\n|[\\r\\n])")}function j_(t,e){if(!t)return;let n=Ks(t.start,0,e),i=Ks(t.endExclusive,0,e);return n<=i?new T(n,i):T.emptyAt(n)}function H_(t,e,n){let i=t[e.start-1],r=t[e.start],s=t[e.endExclusive-1],o=t[e.endExclusive],a=e.start===0||!yi(i,n)||e.length>0&&!yi(r,n),u=e.endExclusive===t.length||!yi(o,n)||e.length>0&&!yi(s,n);return a&&u}function W_(t,e){if(e>=t.length)return t.length+1;let n=t.charCodeAt(e);if(n<55296||n>56319||e+1>=t.length)return e+1;let i=t.charCodeAt(e+1);return i>=56320&&i<=57343?e+2:e+1}function Ks(t,e,n){return Math.min(Math.max(t,e),n)}var Zs=class{constructor(e){this._editorModel=e,this._observedSourceTextId=this._editorModel.getSourceTextId(this._editorModel.sourceText.get())}_observedSourceTextId;_pending;record(e){let n=this._pending;this._pending=n?{baseSourceTextId:n.baseSourceTextId,resultSourceTextId:e.resultSourceTextId,isContinuous:n.isContinuous&&n.resultSourceTextId===e.baseSourceTextId}:{baseSourceTextId:e.baseSourceTextId,resultSourceTextId:e.resultSourceTextId,isContinuous:!0}}consume(e){let n=this._editorModel.getSourceTextId(e),i=this._pending;this._pending=void 0;let r=n!==this._observedSourceTextId,s=i!==void 0&&i.isContinuous&&i.baseSourceTextId===this._observedSourceTextId&&i.resultSourceTextId===n;return this._observedSourceTextId=n,{sourceIdentityChanged:r,isExpected:s}}},cc=class extends be{constructor(e){super(),this._editorModel=e,this._sourceEditTracker=new Zs(this._editorModel);let n=this._inputSnapshot();this._register(this._editorModel.onWillApplySourceEdit(i=>{this._mapStateThroughEdit(i),this._sourceEditTracker.record(i)})),this._register(te(i=>{let r=this._editorModel.sourceText.read(i),s=r.value,o=this._readInputSnapshot(i),a=this._sourceEditTracker.consume(r),u=a.sourceIdentityChanged,c=u&&a.isExpected;if(u&&!c){this._searchOrigin=Ya(this._searchOrigin,0,s.length),n={...o,scope:void 0},ke(f=>{this.searchScope.set(void 0,f),this.currentMatch.set(void 0,f)});return}let d=o.isRevealed&&!n.isRevealed,h=!K_(o,n),l=!Z_(o.scope,n.scope)&&!u;if(!o.isRevealed)n.isRevealed&&this.currentMatch.set(void 0,void 0);else{let f=this.searchResult.read(i);if(f.kind==="invalid"||f.pattern.isEmpty||f.matches.length===0)this.currentMatch.set(void 0,void 0);else if(d||h||l)this._selectFromOrigin(f,this._pendingInitialDirection??"next");else if(u){let m=this.currentMatch.get();m&&!U_(f,s,o.scope,m)&&this.currentMatch.set(void 0,void 0)}}this._pendingInitialDirection=void 0,this._pendingInitialDirection=void 0,n=o}))}isRevealed=H(this,!1);searchString=H(this,"");isRegex=H(this,!1);matchCase=H(this,!1);wholeWord=H(this,!1);searchScope=H(this,void 0);currentMatch=H(this,void 0);loop=H(this,!0);searchResult=oe(this,e=>{let n=this._editorModel.sourceText.read(e).value,i=uc.create({searchString:this.searchString.read(e),isRegex:this.isRegex.read(e),matchCase:this.matchCase.read(e),wholeWord:this.wholeWord.read(e),wordSeparators:this._editorModel.wordNavigationConfig.read(e).wordSeparators});if(i.kind==="invalid")return{kind:"invalid",error:i.error};let r=i.pattern.findMatches(n,this.searchScope.read(e));return{kind:"valid",pattern:i.pattern,matches:r.matches,isCapped:r.isCapped}});matchesCount=oe(this,e=>{let n=this.searchResult.read(e);return n.kind==="valid"?n.matches.length:0});isCapped=oe(this,e=>{let n=this.searchResult.read(e);return n.kind==="valid"&&n.isCapped});currentMatchPosition=oe(this,e=>{let n=this.currentMatch.read(e);if(!n)return 0;let i=this.searchResult.read(e);if(i.kind==="invalid")return 0;let r=i.matches.findIndex(s=>s.equals(n));return r<0?0:r+1});_searchOrigin=0;_sourceEditTracker;_pendingInitialDirection;reveal(e){this._searchOrigin=Ya(e.origin,0,this._editorModel.sourceText.get().value.length),this._pendingInitialDirection=e.direction??"next",ke(n=>{e.searchString!==void 0&&this.searchString.set(e.searchString,n),this.isRevealed.set(!0,n)})}hide(){ke(e=>{this.isRevealed.set(!1,e),this.searchScope.set(void 0,e),this.currentMatch.set(void 0,e)})}setSearchOrigin(e){this._searchOrigin=Ya(e,0,this._editorModel.sourceText.get().value.length)}setSearchScope(e){this.searchScope.set(e,void 0)}moveToNextMatch(){return this._move("next")}moveToPreviousMatch(){return this._move("previous")}_move(e){let n=this.searchResult.get();if(n.kind==="invalid"||n.pattern.isEmpty){this.currentMatch.set(void 0,void 0);return}let i=this._editorModel.sourceText.get().value,r=this.currentMatch.get(),s=this.searchScope.get(),o=e==="next"?n.pattern.findNextMatch(i,r?.endExclusive??this._searchOrigin,s,this.loop.get(),r):n.pattern.findPreviousMatch(i,r?.start??this._searchOrigin,s,this.loop.get(),r);return this.currentMatch.set(o,void 0),o}_selectFromOrigin(e,n){let i=this._editorModel.sourceText.get().value,r=this.searchScope.get(),s=n==="next"?e.pattern.findNextMatch(i,this._searchOrigin,r,this.loop.get()):e.pattern.findPreviousMatch(i,this._searchOrigin,r,this.loop.get());this.currentMatch.set(s,void 0)}_mapStateThroughEdit(e){this._searchOrigin=dc(e.edit,this._searchOrigin,"after");let n=this.searchScope.get();n&&this.searchScope.set(Eh(e.edit,n),e.transaction);let i=this.currentMatch.get();i&&this.currentMatch.set(X_(e.edit,i)?void 0:Eh(e.edit,i),e.transaction)}_inputSnapshot(){return{isRevealed:this.isRevealed.get(),searchString:this.searchString.get(),isRegex:this.isRegex.get(),matchCase:this.matchCase.get(),wholeWord:this.wholeWord.get(),scope:this.searchScope.get()}}_readInputSnapshot(e){return{isRevealed:this.isRevealed.read(e),searchString:this.searchString.read(e),isRegex:this.isRegex.read(e),matchCase:this.matchCase.read(e),wholeWord:this.wholeWord.read(e),scope:this.searchScope.read(e)}}};function U_(t,e,n,i){return t.pattern.findNextMatch(e,i.start,n,!1)?.equals(i)??!1}function K_(t,e){return t.searchString===e.searchString&&t.isRegex===e.isRegex&&t.matchCase===e.matchCase&&t.wholeWord===e.wholeWord}function Z_(t,e){return t===e||!!t&&!!e&&t.equals(e)}function Eh(t,e){let n=dc(t,e.start,"after"),i=dc(t,e.endExclusive,"before");return new T(Math.min(n,i),Math.max(n,i))}function dc(t,e,n){let i=0;for(let r of t.replacements){let s=r.replaceRange;if(e<s.start)break;if(e>s.endExclusive){i+=r.newText.length-s.length;continue}return s.isEmpty?s.start+i+(n==="after"?r.newText.length:0):e===s.start&&n==="before"?s.start+i:s.start+i+r.newText.length}return e+i}function X_(t,e){return t.replacements.some(n=>{let i=n.replaceRange;return i.isEmpty?e.start<i.start&&i.start<e.endExclusive:e.isEmpty?i.contains(e.start):i.intersects(e)})}function Ya(t,e,n){return Math.min(Math.max(t,e),n)}var lc=class extends be{constructor(e,n){super(),this._view=e,this._options=n,this.element=document.createElement("div"),this.element.className="md-find-widget-host",this.element.hidden=!0,this.panelElement=document.createElement("div"),this.panelElement.className="md-find-widget",this.panelElement.setAttribute("role","dialog"),this.panelElement.setAttribute("aria-label","Find"),this.element.appendChild(this.panelElement);let i=document.createElement("div");i.className="md-find-row",this.panelElement.appendChild(i),this._inputShell=document.createElement("div"),this._inputShell.className="md-find-input-shell",i.appendChild(this._inputShell),this._input=document.createElement("textarea"),this._input.className="md-find-input",this._input.rows=1,this._input.spellcheck=!1,this._input.setAttribute("aria-label","Find"),this._input.placeholder="Find",this._inputShell.appendChild(this._input);let r=document.createElement("div");r.className="md-find-options",this._inputShell.appendChild(r),this._caseButton=eu("Aa","Match Case"),this._wholeWordButton=eu("ab","Match Whole Word","md-find-option-whole-word"),this._regexButton=eu(".*","Use Regular Expression"),r.append(this._caseButton,this._wholeWordButton,this._regexButton),this._matchesCount=document.createElement("div"),this._matchesCount.className="md-find-count",this._matchesCount.setAttribute("role","status"),this._matchesCount.setAttribute("aria-live","polite"),i.appendChild(this._matchesCount),this._previousButton=Yr("arrow-up","Previous Match"),this._nextButton=Yr("arrow-down","Next Match"),this._selectionButton=Yr("selection","Find in Selection");let s=Yr("close","Close");i.append(this._previousButton,this._nextButton,this._selectionButton,s),this._error=document.createElement("div"),this._error.className="md-find-error",this._error.setAttribute("role","alert"),this.panelElement.appendChild(this._error);let o=()=>this._options.findModel.searchString.set(this._input.value,void 0),a=l=>{l.isComposing||l.key==="Enter"&&!l.ctrlKey&&!l.metaKey&&!l.altKey&&(l.preventDefault(),l.stopPropagation(),l.shiftKey?this._options.onPrevious():this._options.onNext())},u=l=>{l.key==="Escape"&&!l.isComposing&&(l.preventDefault(),l.stopPropagation(),this._options.onClose())},c=l=>l.stopPropagation(),d=()=>this.focused.set(!0,void 0),h=l=>{let f=l.relatedTarget;f instanceof Node&&this.panelElement.contains(f)||this.focused.set(!1,void 0)};this._input.addEventListener("input",o),this._input.addEventListener("keydown",a),this.panelElement.addEventListener("keydown",u),this.panelElement.addEventListener("pointerdown",c),this.panelElement.addEventListener("focusin",d),this.panelElement.addEventListener("focusout",h),this._register({dispose:()=>{this._input.removeEventListener("input",o),this._input.removeEventListener("keydown",a),this.panelElement.removeEventListener("keydown",u),this.panelElement.removeEventListener("pointerdown",c),this.panelElement.removeEventListener("focusin",d),this.panelElement.removeEventListener("focusout",h)}}),this._registerButton(this._caseButton,()=>this._options.findModel.matchCase.set(!this._options.findModel.matchCase.get(),void 0)),this._registerButton(this._wholeWordButton,()=>this._options.findModel.wholeWord.set(!this._options.findModel.wholeWord.get(),void 0)),this._registerButton(this._regexButton,()=>this._options.findModel.isRegex.set(!this._options.findModel.isRegex.get(),void 0)),this._registerButton(this._previousButton,this._options.onPrevious),this._registerButton(this._nextButton,this._options.onNext),this._registerButton(this._selectionButton,this._options.onToggleFindInSelection),this._registerButton(s,this._options.onClose),this._register(this._view.mountOverlay(this.element,"top-chrome")),this._register(this._view.registerRevealOcclusion(this.panelElement)),this._register(this._view.suspendEditContextWhileFocused(this.panelElement)),this._register(te(l=>this._render(l)))}element;panelElement;focused=H(this,!1);_inputShell;_input;_matchesCount;_previousButton;_nextButton;_selectionButton;_caseButton;_wholeWordButton;_regexButton;_error;focusAndSelect(){this._input.focus({preventScroll:!0}),this._input.select()}_registerButton(e,n){e.addEventListener("click",n),this._register({dispose:()=>e.removeEventListener("click",n)})}_render(e){let n=this._options.findModel,i=n.isRevealed.read(e);if(!i&&this.panelElement.contains(this.panelElement.ownerDocument.activeElement)&&this._view.focus(),this.element.hidden=!i,this._view.element.classList.toggle("md-find-visible",i),!i)return;let r=n.searchString.read(e),s=n.matchCase.read(e),o=n.wholeWord.read(e),a=n.isRegex.read(e),u=n.searchScope.read(e),c=n.searchResult.read(e),d=n.currentMatchPosition.read(e),h=this._options.canFindInSelection.read(e)||u!==void 0;this._input.value!==r&&(this._input.value=r),es(this._caseButton,s),es(this._wholeWordButton,o),es(this._regexButton,a),es(this._selectionButton,u!==void 0),this._selectionButton.disabled=!i||!h;let l=c.kind==="valid"?c.matches.length:0,f=l>0,m=r.length>0;if(this._previousButton.disabled=!i||!f,this._nextButton.disabled=!i||!f,this.panelElement.classList.toggle("md-find-no-results",m&&!f&&c.kind==="valid"),!f)this._matchesCount.textContent="No results";else{let g=c.kind==="valid"&&c.isCapped?`${l}+`:String(l);this._matchesCount.textContent=`${d||"?"} of ${g}`}let p=c.kind==="invalid"?c.error.message:"";this._input.setAttribute("aria-invalid",String(p.length>0)),this._inputShell.classList.toggle("md-find-input-invalid",p.length>0),this._input.title=p,this._error.textContent=p,this._error.hidden=p.length===0}};function eu(t,e,n){let i=document.createElement("button");return i.type="button",i.className="md-find-button md-find-option",n&&i.classList.add(n),i.textContent=t,i.setAttribute("aria-label",e),i.title=e,i.setAttribute("aria-pressed","false"),i}function Yr(t,e){let n=document.createElement("button");n.type="button",n.className="md-find-button",n.setAttribute("aria-label",e),n.title=e;let i=document.createElement("span");return i.className=`codicon codicon-${t}`,i.setAttribute("aria-hidden","true"),n.appendChild(i),n}function es(t,e){t.setAttribute("aria-pressed",String(e)),t.classList.toggle("md-find-option-active",e)}var hc=class extends be{constructor(e,n,i){super(),this._editorModel=e,this._view=n,this._options=i,this._observedSourceTextId=this._editorModel.getSourceTextId(this._editorModel.sourceText.get()),this._sourceEditTracker=new Zs(this._editorModel),this.model=this._register(new cc(this._editorModel)),this._register(this._editorModel.onWillApplySourceEdit(a=>{this._sourceEditTracker.record(a)}));let r=oe(this,a=>{let u=this._selectionForScope.read(a);return!!u&&!u.isCollapsed});this.widget=this._register(new lc(this._view,{findModel:this.model,canFindInSelection:r,onNext:()=>{this.model.moveToNextMatch()},onPrevious:()=>{this.model.moveToPreviousMatch()},onToggleFindInSelection:()=>this._toggleFindInSelection(),onClose:()=>this.close()})),this._register(new ac(this._view,this.model));let s=a=>this._handleKeyDown(a);this._view.element.addEventListener("keydown",s,!0),this._register({dispose:()=>this._view.element.removeEventListener("keydown",s,!0)}),this._register(te(a=>{let u=this.widget.focused.read(a);this._view.element.classList.toggle("md-find-widget-focused",u)}));let o=this._editorModel.selection.get();this._register(te(a=>{let u=this._editorModel.sourceText.read(a),c=this._editorModel.selection.read(a),d=this._sourceEditTracker.consume(u),h=c!==o;if(o=c,!h)return;let l=this.model.currentMatch.get();!c||l&&c.range.equals(l)||(this._selectionForScope.set(c,void 0),this.model.setSearchOrigin(c.active),d.isExpected||this.model.currentMatch.set(void 0,void 0))})),this._register(te(a=>{let u=this._editorModel.sourceText.read(a),c=this._editorModel.getSourceTextId(u),d=c!==this._observedSourceTextId,h=this.model.isRevealed.read(a),l=this.model.currentMatch.read(a);this._view.element.classList.toggle("md-find-has-current-match",h&&l!==void 0);let f=this._editorModel.document.read(a),m=this._view.documentViewNode.read(a);if(!h||!l){this._forcedMatch=void 0,this._selectedMatch=void 0,this._observedSourceTextId=c,this._cancelRevealRequest(),this._setForcedMarkerVisibleBlocks(new Set);return}let p=!this._selectedMatch?.equals(l),g=new Set;this._forcedMatch?.equals(l)?g=new Set(bu(f,l.start,l.endExclusive)):m&&J_(m,l)?this._forcedMatch=void 0:(g=new Set(bu(f,l.start,l.endExclusive)),this._forcedMatch=l),ke(b=>{Sh(this._view.forcedMarkerVisibleBlocks.get(),g)||this._view.forcedMarkerVisibleBlocks.set(g,b);let w=this._editorModel.selection.get();p&&!d&&(!w||!w.range.equals(l))&&(this._editorModel.pendingParagraph.set(void 0,b),this._editorModel.selectionSource.set("find",b),this._editorModel.selection.set(new N(l.start,l.endExclusive),b))}),this._selectedMatch=l,this._observedSourceTextId=c,p&&!d&&(this._cancelRevealRequest(),this._revealRequest=this._view.revealRangeInCenterIfOutsideViewport(l,"auto"))})),this._register({dispose:()=>{this._cancelRevealRequest(),this._view.element.classList.remove("md-find-visible","md-find-widget-focused","md-find-has-current-match"),this._view.forcedMarkerVisibleBlocks.set(new Set,void 0)}})}model;widget;_selectionForScope=H(this,void 0);_forcedMatch;_selectedMatch;_observedSourceTextId;_sourceEditTracker;_revealRequest;_setForcedMarkerVisibleBlocks(e){Sh(this._view.forcedMarkerVisibleBlocks.get(),e)||this._view.forcedMarkerVisibleBlocks.set(e,void 0)}openAndFocus(){if(this.model.isRevealed.get()){this.widget.focusAndSelect();return}let e=this._editorModel.selection.get()??N.collapsed(0);this._selectionForScope.set(e,void 0);let{searchString:n,origin:i}=this._querySeed(e,this.model.searchString.get());this.model.reveal({origin:i,searchString:n,direction:"next"}),this.widget.focusAndSelect()}close(){this.model.isRevealed.get()&&(this._cancelRevealRequest(),this.model.hide(),this._view.focus())}_handleKeyDown(e){if(e.isComposing||e.getModifierState("AltGraph"))return;let n=e.target,i=n instanceof Node&&this.widget.panelElement.contains(n);if(!(n!==this._view.element&&!i)){if(G_(e,this._options.keyboardPlatform)){tu(e),this.openAndFocus();return}if(e.key==="F3"&&!e.altKey&&!e.ctrlKey&&!e.metaKey){tu(e),this._findByKeyboard(e.shiftKey?"previous":"next");return}e.key==="Escape"&&this.model.isRevealed.get()&&(tu(e),this.close())}}_cancelRevealRequest(){this._revealRequest?.dispose(),this._revealRequest=void 0}_findByKeyboard(e){if(this.model.isRevealed.get()){e==="next"?this.model.moveToNextMatch():this.model.moveToPreviousMatch();return}let n=this._editorModel.selection.get()??N.collapsed(0);this._selectionForScope.set(n,void 0);let i=this.model.searchString.get()||this._querySeed(n).searchString,r=e==="next"?n.range.endExclusive:n.range.start;this.model.reveal({origin:r,searchString:i,direction:e})}_querySeed(e,n){let i=this._selectedSingleLineText(e);if(i)return{searchString:this._prepareSeed(i),origin:e.range.start};if(n)return{searchString:n,origin:e.active};let r=this._editorModel.sourceText.get().value,s=Jo(r,e.active,this._editorModel.wordNavigationConfig.get()),o=r.slice(s.start,s.end);return{searchString:/\S/u.test(o)?this._prepareSeed(o):"",origin:s.start}}_prepareSeed(e){return this.model.isRegex.get()?Mf(e):e}_selectedSingleLineText(e){if(e.isCollapsed)return;let n=e.range.substring(this._editorModel.sourceText.get().value);return n.includes(`
`)||n.length===0?void 0:n}_toggleFindInSelection(){if(this.model.searchScope.get()){this.model.setSearchScope(void 0);return}let e=this._selectionForScope.get();!e||e.isCollapsed||(this.model.setSearchOrigin(e.range.start),this.model.setSearchScope(e.range))}};function G_(t,e){return t.key.toLowerCase()==="f"&&!t.shiftKey&&!t.altKey&&(e==="macos"?t.metaKey&&!t.ctrlKey:t.ctrlKey&&!t.metaKey)}function tu(t){t.preventDefault(),t.stopPropagation()}function Sh(t,e){return t.size===e.size&&Array.from(t).every(n=>e.has(n))}function J_(t,e){let n=oo(t,[e]);return e.isEmpty?n.some(i=>zh(i.range)):n.reduce((i,r)=>{let s=Array.from(r.range.getClientRects()).some(o=>o.width>0&&o.height>0)&&zh(r.range);return i+(s?r.sourceRange.length:0)},0)===e.length}function zh(t){let e=t.startContainer.ownerDocument;if(!e)return!1;let n=e.defaultView??window;for(let i=t.startContainer instanceof Element?t.startContainer:t.startContainer.parentElement;i;i=i.parentElement){let r=n.getComputedStyle(i);if(r.display==="none"||r.visibility==="hidden"||r.visibility==="collapse")return!1}return!0}var fc=class{connect(e){let n=o=>{if(ns(o.target,e.element)||is(o.target,e.element))return;let a=e.getSelectedText();a!==void 0&&(o.preventDefault(),o.clipboardData?.setData("text/plain",a))},i=o=>{if(ns(o.target,e.element)||is(o.target,e.element))return;let a=e.getSelectedText();a!==void 0&&(o.preventDefault(),o.clipboardData?.setData("text/plain",a),e.deleteSelection())},r=o=>{if(ns(o.target,e.element)||is(o.target,e.element))return;o.preventDefault();let a=o.clipboardData?.getData("text/plain");a&&e.insertText(a)},s=e.element;return s.addEventListener("copy",n),s.addEventListener("cut",i),s.addEventListener("paste",r),{dispose:()=>{s.removeEventListener("copy",n),s.removeEventListener("cut",i),s.removeEventListener("paste",r)}}}},Xs=class{constructor(e=navigator.clipboard){this._clipboard=e}connect(e){let n=r=>{if(!(r.ctrlKey||r.metaKey)||r.altKey)return;let s=ns(r.target,e.element);if(s){Q_(r,s,this._clipboard);return}if(!is(r.target,e.element))switch(r.key.toLowerCase()){case"c":{let o=e.getSelectedText();if(o===void 0)return;r.preventDefault(),r.stopPropagation(),this._clipboard.writeText(o);break}case"x":{let o=e.getSelectedText();if(o===void 0)return;r.preventDefault(),r.stopPropagation(),this._clipboard.writeText(o),e.deleteSelection();break}case"v":{r.preventDefault(),r.stopPropagation(),this._clipboard.readText().then(o=>{o&&e.insertText(o)});break}}},i=e.element;return i.addEventListener("keydown",n),{dispose:()=>i.removeEventListener("keydown",n)}}};function ns(t,e){if(!(t instanceof Node)||t===e)return;let n=(t instanceof Element?t:t.parentElement)?.closest('input, textarea, [contenteditable]:not([contenteditable="false"]), [role="textbox"]');return n instanceof HTMLElement&&e.contains(n)?n:void 0}function is(t,e){if(!(t instanceof Node)||t===e)return!1;let n=(t instanceof Element?t:t.parentElement)?.closest("video, audio");return n instanceof HTMLMediaElement&&e.contains(n)}function Q_(t,e,n){switch(t.key.toLowerCase()){case"c":{let i=Ch(e);if(i===void 0)return;t.preventDefault(),t.stopPropagation(),n.writeText(i);return}case"x":{let i=Ch(e);if(i===void 0)return;t.preventDefault(),t.stopPropagation(),n.writeText(i),Th(e,"");return}case"v":t.preventDefault(),t.stopPropagation(),n.readText().then(i=>{i.length>0&&Th(e,i)})}}function Ch(t){if(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement){let n=t.selectionStart,i=t.selectionEnd;return n===null||i===null||n===i?void 0:t.value.slice(n,i)}let e=t.ownerDocument.getSelection();if(!(!e||e.isCollapsed||e.rangeCount===0||!t.contains(e.getRangeAt(0).commonAncestorContainer)))return e.toString()}function Th(t,e){if(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement){let s=t.selectionStart??t.value.length,o=t.selectionEnd??s;t.setRangeText(e,s,o,"end"),t.dispatchEvent(new InputEvent("input",{bubbles:!0,inputType:e.length===0?"deleteByCut":"insertFromPaste",data:e}));return}let n=t.ownerDocument.getSelection();if(!n||n.rangeCount===0||!t.contains(n.getRangeAt(0).commonAncestorContainer))return;let i=n.getRangeAt(0);i.deleteContents();let r=t.ownerDocument.createTextNode(e);i.insertNode(r),i.setStartAfter(r),i.collapse(!0),n.removeAllRanges(),n.addRange(i),t.dispatchEvent(new InputEvent("input",{bubbles:!0,inputType:e.length===0?"deleteByCut":"insertFromPaste",data:e}))}var mc={bindings:Pn.flatMap(t=>t.keybindings.map(e=>({...e,action:t.action})))},Nf={bindings:Pn.filter(t=>t.routing==="local").flatMap(t=>t.keybindings.map(e=>({...e,action:t.action})))},Af={bindings:Pn.filter(t=>t.routing!=="local").flatMap(t=>t.keybindings.map(e=>({...e,action:t.action})))},Y_=new Set(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"]);function ex(t){return Y_.has(t)}function tx(t){return t.includes("Macintosh")||t.includes("Mac OS X")?"macos":t.includes("Windows")?"windows":"linux"}function Oh(t){return{key:t.key,code:t.code,shiftKey:t.shiftKey,altKey:t.altKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,altGraphKey:t.getModifierState("AltGraph")}}function Rh(t,e,n=mc){if(t.altGraphKey)return;let i=t.key.length===1?t.key.toLowerCase():t.key,r=/^[a-z]$/.test(i)?void 0:nx(t.code);for(let s of n.bindings)if((s.key===i||s.key===r)&&(!s.platforms||s.platforms.includes(e))&&ix(t,s.modifiers))return s.action}function nx(t){return/^Key([A-Z])$/.exec(t)?.[1].toLowerCase()}function ix(t,e={}){return t.shiftKey===!!e.shift&&t.altKey===!!e.alt&&t.ctrlKey===!!e.ctrl&&t.metaKey===!!e.meta}var rx=500,Lh=5,Gs=class extends be{constructor(e,n,i){super(),this._model=e,this._view=n;let r=this._view.element,s=r.ownerDocument.defaultView??window;this._keyboardPlatform=i?.keyboardPlatform??tx(s.navigator.userAgent),this._keyboardProfile=i?.keyboardProfile??mc,this._forwardedKeyboardProfile=i?.forwardedKeyboardProfile,this._historyStrategy=i?.historyStrategy,this._indentation=i?.indentation??Qi,this._tabFocusStatus=this._keyboardProfile===mc?this._registerTabFocusAccessibility(r):void 0,r.addEventListener("pointerdown",this._handlePointerDown),r.addEventListener("keydown",this._handleKeyDown),this._register({dispose:()=>{r.removeEventListener("pointerdown",this._handlePointerDown),r.removeEventListener("keydown",this._handleKeyDown)}}),s.addEventListener("keydown",this._updateModifierState),s.addEventListener("keyup",this._updateModifierState),s.addEventListener("blur",this._clearModifierState),r.ownerDocument.addEventListener("selectionchange",this._discardNativeSelection),this._register({dispose:()=>{s.removeEventListener("keydown",this._updateModifierState),s.removeEventListener("keyup",this._updateModifierState),s.removeEventListener("blur",this._clearModifierState),r.ownerDocument.removeEventListener("selectionchange",this._discardNativeSelection)}});let o=i?.clipboardStrategy??new fc;this._register(o.connect({element:r,getSelectedText:()=>this._selectedText(),deleteSelection:()=>{this._generatedIndentation=void 0,this._executeEditCommand(Gl)},insertText:u=>{this._handlePendingInput(u)||this._insertText(u)}}));let a=this._view.editContext;a.addEventListener("textupdate",this._handleTextUpdate),this._register({dispose:()=>a.removeEventListener("textupdate",this._handleTextUpdate)}),this.findController=i?.find===!1?void 0:this._register(new hc(this._model,this._view,{keyboardPlatform:this._keyboardPlatform}))}findController;_desiredColumn;_keyboardPlatform;_keyboardProfile;_forwardedKeyboardProfile;_historyStrategy;_indentation;_tabFocusStatus;_tabMovesFocus=!1;_generatedIndentation;_clickCount=0;_lastPointerDown;_handleTextUpdate=e=>{if(this._model.readonlyMode.get()){e.text.length>0&&this._view.showReadonlyEditingAttempt();return}if(this._model.pendingParagraph.get()!==void 0){this._generatedIndentation=void 0,e.text.length>0?this._handlePendingInput(e.text):this._model.cancelPendingParagraph();return}this._insertText(e.text,new N(e.updateRangeStart,e.updateRangeEnd))};_insertText(e,n){let i=this._generatedIndentation;this._executeEditCommand(J1(e,i),n),this._generatedIndentation=this._remainingGeneratedIndentation(i,e)}_remainingGeneratedIndentation(e,n){if(!e||n.length===0)return;let i=this._model.sourceText.get().value,r=this._model.selection.get();if(!r?.isCollapsed||e.endExclusive>r.active)return;let s=i.lastIndexOf(`
`,r.active-1)+1;if(e.start!==s||!/^[ \t]+$/.test(e.substring(i)))return;let o=i.slice(e.endExclusive,r.active);return/^`{1,2}$|^~{1,2}$/.test(o)?e:void 0}_handlePendingInput(e){let n=this._model.pendingParagraph.get();return n?(e.length===0||(/^[ \t]+$/.test(e)?this._model.setPendingParagraphText(n.text+e):this._runUndoableEdit(()=>this._model.materializePendingParagraph(e))),!0):!1}_deletePendingText(e){let n=this._model.pendingParagraph.get();if(n){if(n.text.length===0){this._model.cancelPendingParagraph();return}this._model.setPendingParagraphText(e==="deleteLeft"?n.text.slice(0,-1):"")}}_handlePointerDown=e=>{if(this._generatedIndentation=void 0,e.button!==0)return;e.preventDefault(),this._view.stopFollowingCaret(),this._model.cancelPendingParagraph(),this._view.focus(),this._desiredColumn=void 0;let n=new xt(e.clientX,e.clientY),i=this._lastPointerDown,r=i!==void 0&&e.timeStamp-i.time<rx&&Math.abs(n.x-i.point.x)<Lh&&Math.abs(n.y-i.point.y)<Lh;if(this._clickCount=r?this._clickCount+1:1,this._lastPointerDown={time:e.timeStamp,point:n},!this._view.isPointInContent(n)){this._setUserSelection(void 0);return}let s=this._view.resolveOffsetFromPoint(n)??this._model.sourceText.get().value.length;if(this._clickCount===2){let h=this._makeCursorContext();this._setUserSelection(Tv(h,s));return}if(this._clickCount===3){let h=ox(this._model.document.get(),s);h&&this._setUserSelection(Ov(this._makeCursorContext(),h));return}let o=this._clickCount===1&&!e.shiftKey&&this._model.readonlyMode.get();if(e.shiftKey){let h=this._model.selection.get()??N.collapsed(s);this._setUserSelection(h.withActive(s))}else this._setUserSelection(N.collapsed(s));let a=this._view.element,u=e.pointerId;a.setPointerCapture(u),this._model.isSelecting.set(!0,void 0);let c=h=>{let l=this._model.selection.get()??N.collapsed(s),f=this._view.resolveOffsetFromPoint(new xt(h.clientX,h.clientY))??l.active;this._setUserSelection(new N(l.anchor,f))},d=()=>{this._model.isSelecting.set(!1,void 0),o&&(this._model.selection.get()?.isCollapsed??!0)&&this._view.showReadonlyEditingAttempt(),a.removeEventListener("pointermove",c),a.removeEventListener("pointerup",d),a.removeEventListener("pointercancel",d),a.removeEventListener("lostpointercapture",d)};a.addEventListener("pointermove",c),a.addEventListener("pointerup",d),a.addEventListener("pointercancel",d),a.addEventListener("lostpointercapture",d)};_makeCursorContext(e){let n=this._model.document.get(),i=e??this._model.selection.get()??N.collapsed(0),r=e?vc(n,i.active):this._model.activeBlock.get();return{text:this._model.sourceText.get().value,selection:i,document:n,activeBlock:r,markerVisibleBlocks:this._model.markerVisibleBlocks.get(),wordNavigationConfig:this._model.wordNavigationConfig.get(),cursorPosition:e?ce.source(i.active):this._model.cursorPosition.get()??ce.source(i.active)}}_makeVisualCursorContext(){return{...this._makeCursorContext(),desiredColumn:this._desiredColumn,lineMap:this._view.measuredLayout.visualLineMap.get()}}_executeCursorCommand(e,n){let i=this._makeCursorContext();this._applyCursorPosition(i.selection,e(i),n),this._desiredColumn=void 0}_executeEditCommand(e,n){if(this._model.readonlyMode.get()){this._view.showReadonlyEditingAttempt();return}let i=this._makeCursorContext(n),r=e(i);r&&(this._runUndoableEdit(()=>this._model.applyEdit(r.edit,r.selection),r.edit),this._desiredColumn=void 0)}_runUndoableEdit(e,n){let i=this._historyStrategy;i?.record?i.record(e,n):e(),this._view.revealCaretAfterEdit()}_executeVisualCursorCommand(e,n){let i=this._makeVisualCursorContext(),r=e(i);this._applyCursorPosition(i.selection,r.position,n),this._desiredColumn=r.desiredColumn}_cursorDown(e){let n=this._makeVisualCursorContext(),i=q1(n);if(!e&&!this._model.readonlyMode.get()&&!n.lineMap.isEmpty&&n.cursorPosition.kind==="source"&&i.position.kind==="source"&&i.position.offset===n.selection.active){let r=ri(n);if(r){this._model.armPendingParagraph(r),this._view.revealCaretAfterKeyboardNavigation(),this._desiredColumn=void 0;return}}this._applyCursorPosition(n.selection,i.position,e),this._desiredColumn=i.desiredColumn}_setUserSelection(e){ke(n=>{this._model.pendingParagraph.set(void 0,n),this._model.selectionSource.set("user",n),this._model.selection.set(e,n)})}_applyCursorPosition(e,n,i){if(n.kind==="virtual"){if(this._model.pendingParagraph.get()?.cursorLine!==n.line){let r=n.line.sourceOffsetBefore;this._setUserSelection(i?e.withActive(r):N.collapsed(r)),this._view.revealCaretAfterKeyboardNavigation()}return}this._setUserSelection(i?e.withActive(n.offset):N.collapsed(n.offset)),this._view.revealCaretAfterKeyboardNavigation()}cursorDown(e=!1){this._cursorDown(e)}cursorUp(e=!1){this._executeVisualCursorCommand(Xl,e)}_selectedText(){let e=this._model.selection.get();if(!(!e||e.isCollapsed))return this._model.sourceText.get().value.slice(e.range.start,e.range.endExclusive)}_updateModifierState=e=>{this._model.ctrlOrMetaDown.set(e.ctrlKey||e.metaKey,void 0)};_clearModifierState=()=>{this._model.ctrlOrMetaDown.set(!1,void 0)};_discardNativeSelection=()=>{let e=this._view.element.ownerDocument;if(!this._view.element.contains(e.activeElement))return;let n=e.getSelection();if(!(!n||n.rangeCount===0||n.isCollapsed)){for(let i=0;i<n.rangeCount;i++)if(this._view.intersectsRenderedContent(n.getRangeAt(i))){n.removeAllRanges();return}}};_handleKeyDown=e=>{if(e.isComposing||sx(e,this._view.element)||(this._updateModifierState(e),e.key==="Tab"&&(this._model.readonlyMode.get()||this._tabMovesFocus)))return;if(this._model.pendingParagraph.get()!==void 0&&e.key==="Escape"){Ih(e),this._model.cancelPendingParagraph();return}let n=Rh(Oh(e),this._keyboardPlatform,this._keyboardProfile);if(!n){if(this._forwardedKeyboardProfile&&Rh(Oh(e),this._keyboardPlatform,this._forwardedKeyboardProfile)){e.preventDefault();return}ex(e.key)&&e.preventDefault();return}let i=this._model.pendingParagraph.get()!==void 0;n.kind==="history"&&!i&&!this._historyStrategy||(Ih(e),this._executeKeyboardAction(n))};executeCommand(e){this._executeKeyboardAction(e.action)}_executeKeyboardAction(e){switch(this._generatedIndentation=void 0,e.kind){case"cursor":{let n=e.command;switch(n){case"left":this._executeCursorCommand(e.extend?N1:I1,e.extend);return;case"right":this._executeCursorCommand(e.extend?M1:L1,e.extend);return;case"up":this._executeVisualCursorCommand(Xl,e.extend);return;case"down":this._cursorDown(e.extend);return;case"wordLeft":this._executeCursorCommand(P1,e.extend);return;case"wordRight":this._executeCursorCommand(A1,e.extend);return;case"visualLineStart":this._executeVisualCursorCommand(B1,e.extend);return;case"visualLineEnd":this._executeVisualCursorCommand(D1,e.extend);return;case"logicalLineStart":this._executeCursorCommand(xu,e.extend);return;case"logicalLineEnd":this._executeCursorCommand(wu,e.extend);return;case"documentStart":this._executeCursorCommand(F1,e.extend);return;case"documentEnd":this._executeCursorCommand($1,e.extend);return;default:return Jn(n)}}case"edit":{let n=e.command;if(this._model.pendingParagraph.get()!==void 0){if(n==="deleteLeft"||n==="deleteWordLeft"||n==="deleteLineLeft"){this._deletePendingText(n);return}this._model.cancelPendingParagraph();return}switch(n){case"deleteLeft":this._executeEditCommand(Gl);return;case"deleteRight":this._executeEditCommand(U1);return;case"deleteWordLeft":this._executeEditCommand(K1);return;case"deleteWordRight":this._executeEditCommand(Z1);return;case"deleteLineLeft":this._executeEditCommand(X1);return;case"deleteLineRight":this._executeEditCommand(G1);return;case"copyLinesUp":this._executeEditCommand(xv);return;case"copyLinesDown":this._executeEditCommand(wv);return;case"moveLinesUp":this._executeEditCommand(yv);return;case"moveLinesDown":this._executeEditCommand(kv);return;case"deleteLines":this._executeEditCommand(Ev);return;case"joinLines":this._executeEditCommand(Sv);return;default:return Jn(n)}}case"selectAll":{let n=this._makeCursorContext();this._setUserSelection(Cv(n));return}case"history":{if(this._model.pendingParagraph.get()!==void 0){e.command==="undo"&&this._model.cancelPendingParagraph();return}if(this._model.readonlyMode.get())return;let n=this._historyStrategy;if(!n)return;let i=e.command;switch(i){case"undo":n.undo();return;case"redo":n.redo();return;default:return Jn(i)}}case"tab":{let n=this._model.pendingParagraph.get();if(n!==void 0){e.command==="insert"?this._model.setPendingParagraphText(n.text+ef(n.text,this._indentation)):this._model.setPendingParagraphText(tf(n.text,this._indentation));return}let i=e.command;switch(i){case"insert":this._executeEditCommand(Y1(this._indentation));return;case"outdent":this._executeEditCommand(Gh(this._indentation));return;default:return Jn(i)}}case"toggleTabFocus":{if(this._model.cancelPendingParagraph(),this._model.readonlyMode.get()){this._tabFocusStatus&&(this._tabFocusStatus.textContent="Tab always moves focus while the document is locked.");return}this._tabMovesFocus=!this._tabMovesFocus,this._tabFocusStatus&&(this._tabFocusStatus.textContent=this._tabMovesFocus?"Tab now moves focus. Press Control+M to make Tab insert indentation.":"Tab now inserts indentation. Press Control+M to make Tab move focus.");return}case"toggleReadonly":{this._model.toggleReadonlyMode();return}case"enter":{if(this._model.pendingParagraph.get()!==void 0){this._model.readonlyMode.get()&&this._view.showReadonlyEditingAttempt(),this._desiredColumn=void 0;return}let n=e.command;switch(n){case"smartEnter":this._smartEnter();return;case"insertParagraph":this._executeEditCommand(ev);return;case"insertHardLineBreak":this._executeEditCommand(nv);return;default:return Jn(n)}}default:return Jn(e)}}_smartEnter(){if(this._model.readonlyMode.get()){this._view.showReadonlyEditingAttempt();return}let e=this._makeCursorContext(),n=iv(e);n.kind==="edit"?(this._runUndoableEdit(()=>this._model.applyEdit(n.edit,n.selection),n.edit),this._generatedIndentation=n.generatedIndentation):(this._model.armPendingParagraph({anchorBlock:n.anchorBlock,replaceRange:n.replaceRange,separateFromPreviousBlock:n.separateFromPreviousBlock,atEof:n.atEof}),this._view.revealCaretAfterEdit()),this._desiredColumn=void 0}_registerTabFocusAccessibility(e){let n=e.getAttribute("aria-description"),i=e.getAttribute("aria-keyshortcuts");e.setAttribute("aria-description","Press Control+M to toggle whether Tab inserts indentation or moves focus. While locked, Tab always moves focus."),e.setAttribute("aria-keyshortcuts","Control+M");let r=e.ownerDocument.createElement("span");return r.className="md-editor-a11y-status",r.setAttribute("aria-live","polite"),e.ownerDocument.body.appendChild(r),this._register({dispose:()=>{r.remove(),Mh(e,"aria-description",n),Mh(e,"aria-keyshortcuts",i)}}),r}};function Jn(t){throw new Error(`Unhandled keyboard action: ${JSON.stringify(t)}`)}function Ih(t){t.preventDefault(),t.stopPropagation()}function sx(t,e){return t.target!==e}function ox(t,e){let n=new Set(t.blocks),i=0;for(let r of t.children){if(n.has(r)){let s=T.ofStartAndLength(i,r.length);if(s.contains(e)||s.endExclusive===e)return s}i+=r.length}}function Mh(t,e,n){n===null?t.removeAttribute(e):t.setAttribute(e,n)}function Pf(t){let e=document.createElement("span");return e.className=`codicon codicon-${t}`,e.setAttribute("aria-hidden","true"),e}var ax=165,ux=400,cx=33,pc=class extends be{constructor(e){super(),this._options=e,this.element=document.createElement("div"),this.element.className="md-comment-input",this._textarea=document.createElement("textarea"),this._textarea.className="md-comment-input-textarea",this._textarea.rows=1,this._textarea.placeholder=e?.placeholder??"Add comment",this._textarea.setAttribute("aria-label",this._textarea.placeholder),this.element.appendChild(this._textarea),this._measure=document.createElement("span"),this._measure.className="md-comment-input-measure",this._measure.setAttribute("aria-hidden","true"),this.element.appendChild(this._measure),this._submitButton=document.createElement("button"),this._submitButton.type="button",this._submitButton.className="md-comment-input-submit",this._submitButton.title="Add comment",this._submitButton.setAttribute("aria-label","Add comment"),this._submitButton.appendChild(Pf("add")),this.element.appendChild(this._submitButton);let n=o=>{o.stopPropagation(),!(o.target===this._textarea||this._submitButton.contains(o.target))&&(o.preventDefault(),this._textarea.focus())};this.element.addEventListener("pointerdown",n),this._register({dispose:()=>this.element.removeEventListener("pointerdown",n)});let i=()=>{this._value.set(this._textarea.value,void 0),this._autoSize()};this._textarea.addEventListener("input",i),this._register({dispose:()=>this._textarea.removeEventListener("input",i)});let r=o=>{if(o.stopPropagation(),o.key==="Escape"){o.preventDefault(),this._options?.onCancel?.();return}o.key==="Enter"&&!o.shiftKey&&(o.preventDefault(),this._submit())};this._textarea.addEventListener("keydown",r),this._register({dispose:()=>this._textarea.removeEventListener("keydown",r)});let s=()=>this._submit();this._submitButton.addEventListener("click",s),this._register({dispose:()=>this._submitButton.removeEventListener("click",s)}),this._register(te(o=>{let a=this._value.read(o).trim().length>0;this._submitButton.disabled=!a,this.element.classList.toggle("md-comment-input-empty",!a)})),this._autoSize()}element;_textarea;_measure;_submitButton;_value=H(this,"");get value(){return this._value}get inputElement(){return this._textarea}focus(){this._textarea.focus();let e=this._textarea.value.length;this._textarea.setSelectionRange(e,e)}setText(e){this._textarea.value=e,this._value.set(e,void 0),this._autoSize()}clear(){this.setText("")}_submit(){let e=this._textarea.value.trim();e&&this._options?.onSubmit?.(e)}_autoSize(){this._measure.textContent=this._textarea.value||this._textarea.placeholder;let e=this._measure.scrollWidth+cx;this.element.style.width=`${Math.min(Math.max(ax,e),ux)}px`,this._textarea.style.height="auto";let n=this._textarea.scrollHeight;n>0&&(this._textarea.style.height=`${Math.min(n,160)}px`,this._textarea.style.overflowY=n>160?"auto":"hidden"),this._options?.onDidChangeSize?.()}},Js=class t extends be{constructor(e,n,i){super(),this._model=e,this._view=n,this._options=i,this._gap=i?.gap??8,this._widget=this._register(new pc({onDidChangeSize:()=>{this._visible&&this._layoutHorizontally()},onSubmit:d=>this._submit(d),onCancel:()=>this._hideAndRefocus()}));let r=this._widget.element;r.style.position="absolute",r.style.zIndex="20",r.style.display="none",this._view.overlayContainer.appendChild(r),this._register({dispose:()=>r.remove()}),this._register({dispose:()=>this._view.element.classList.remove("md-comment-active")});let s=new ResizeObserver(()=>{this._visible&&this._layoutHorizontally()});s.observe(r),s.observe(this._view.overlayContainer),this._register({dispose:()=>s.disconnect()}),this._register(te(d=>this._update(d)));let o=this._view.element.ownerDocument,a=()=>{this._view.element.classList.add("md-comment-active")};this._widget.inputElement.addEventListener("focus",a),this._register({dispose:()=>this._widget.inputElement.removeEventListener("focus",a)});let u=()=>{this._view.element.classList.remove("md-comment-active"),o.defaultView?.setTimeout(()=>this._autoHide(),0)};this._widget.inputElement.addEventListener("blur",u),this._register({dispose:()=>this._widget.inputElement.removeEventListener("blur",u)});let c=d=>{d.key!=="Tab"||d.shiftKey||d.ctrlKey||d.metaKey||d.altKey||!this._visible||this._widgetHasFocus()||(d.preventDefault(),this._widget.focus())};this._view.element.addEventListener("keydown",c),this._register({dispose:()=>this._view.element.removeEventListener("keydown",c)})}static _isCommentableSelectionSource(e){switch(e){case"user":return!0;case"find":return!1;default:return dx(e)}}_widget;_gap;_visible=!1;_anchorX=0;_pinnedRange;_submittedRange;_update(e){let n=this._model.readonlyMode.read(e),i=this._model.selection.read(e),r=this._model.selectionSource.read(e),s=this._view.caretRect.read(e),o=this._model.isSelecting.read(e),a=this._widget.value.read(e).trim().length>0;if(!n){this._hide();return}if(!t._isCommentableSelectionSource(r)){this._autoHide();return}if(!(this._visible&&(a||this._widgetHasFocus()))){if(o){this._autoHide();return}if(!i||i.isCollapsed||!s){this._autoHide();return}if(this._submittedRange?.equals(i.range)){this._autoHide();return}this._submittedRange=void 0,this._pinnedRange=i.range,this._show(s,!i.isForward)}}_show(e,n){let i=this._widget.element;i.style.display="",this._visible=!0;let r=i.offsetHeight,s=this._getViewportRect(),o=this._view.coordinateSpace.capture(),a=o.toClientRect(e),u=o.toClientRect(Y.fromPointSize(0,0,0,r)).height,c=o.toClientRect(Y.fromPointSize(0,0,0,this._gap)).height,d=a.top,h=a.bottom+c+u<=s.bottom,l=d-c-u>=s.top,f=(n?l||!h:!h&&l)?e.y-this._gap-r:e.y+e.height+this._gap;this._anchorX=e.x,this._layoutHorizontally(),i.style.top=`${f}px`}_layoutHorizontally(){let e=this._widget.element,n=this._view.overlayContainer.clientWidth;e.style.maxWidth=`${Math.max(0,n-this._gap)}px`;let i=Math.max(0,n-e.offsetWidth-this._gap);e.style.left=`${Math.min(Math.max(0,this._anchorX),i)}px`}_hide(){this._visible&&(this._visible=!1,this._pinnedRange=void 0,this._widget.clear(),this._widget.element.style.display="none",this._view.element.classList.remove("md-comment-active"))}_autoHide(){this._widgetHasFocus()||this._widget.value.get().trim().length>0||this._hide()}_widgetHasFocus(){let e=this._view.element.ownerDocument.activeElement;return e!==null&&this._widget.element.contains(e)}_getViewportRect(){let e=this._view.element.ownerDocument.defaultView,n=this._view.element;for(;n;){let i=e?.getComputedStyle(n).overflowY;if((i==="auto"||i==="scroll")&&n.scrollHeight>n.clientHeight){let r=n.getBoundingClientRect();return{top:r.top,bottom:r.bottom}}n=n.parentElement}return{top:0,bottom:e?.innerHeight??0}}_hideAndRefocus(){this._hide(),this._view.focus()}_submit(e){let n=this._pinnedRange;this._submittedRange=n,this._hideAndRefocus(),n&&this._options?.onSubmit?.({text:e,range:n})}};function dx(t){throw new Error(`Unhandled selection source: ${JSON.stringify(t)}`)}var gc=class{_domNode;_disposables=[];get element(){return this._domNode}constructor(e){this._domNode=document.createElement("div"),this._domNode.className="md-comment-widget";let n=document.createElement("span");if(n.className="md-comment-widget-text",n.textContent=e.body,this._domNode.appendChild(n),e.onDelete){let i=document.createElement("button");i.type="button",i.className="md-comment-widget-delete",i.title="Delete comment",i.setAttribute("aria-label","Delete comment"),i.appendChild(Pf("trash"));let r=s=>{s.preventDefault(),s.stopPropagation(),e.onDelete?.()};i.addEventListener("click",r),this._disposables.push(()=>i.removeEventListener("click",r)),this._domNode.appendChild(i)}}dispose(){for(let e of this._disposables)e();this._domNode.remove()}},Qs=class{_comments=H(this,[]);_sequence=0;get comments(){return this._comments}set(e){this._comments.set(e,void 0)}create(e){let n={id:`comment-${++this._sequence}`,range:e.range,body:e.body,author:e.author,createdAt:Date.now()};return this.add(n),n}add(e){this._comments.set([...this._comments.get(),e],void 0)}remove(e){this._comments.set(this._comments.get().filter(n=>n.id!==e),void 0)}},lx=12,hx=8;function fx(t,e){let n=t.element,i=t.overlayContainer,r=n.clientWidth-hx-i.offsetLeft,s=[];for(let a of e){if(a.element.style.setProperty("--md-comment-available-width",`${Math.max(0,r)}px`),a.rects.length===0){a.element.style.visibility="hidden";continue}a.element.style.visibility="",s.push({element:a.element,y:Math.min(...a.rects.map(u=>u.y))})}s.sort((a,u)=>a.y-u.y);let o=-1/0;for(let a of s){let u=Math.max(a.y,o+lx),c=r-a.element.offsetWidth;a.element.style.left=`${c}px`,a.element.style.top=`${u}px`,o=u+a.element.offsetHeight}}var Ys=class extends be{constructor(e,n){super(),this._model=e,this._view=n,this._layer=document.createElement("div"),this._layer.className="md-comments-layer",this._layer.style.position="absolute",this._layer.style.inset="0",this._layer.style.pointerEvents="none",this._layer.style.overflow="visible",this._layer.style.background="transparent",this._view.overlayContainer.appendChild(this._layer),this._register({dispose:()=>{for(let r of this._entries.values())r.widget.dispose();this._entries.clear(),this._layer.remove()}}),this._register(te(r=>{let s=this._model.comments.read(r);this._reconcile(s);for(let o of s)this._entries.get(o.id).rects.read(r);this._relayout()}));let i=new ResizeObserver(()=>this._relayout());i.observe(this._view.element),this._register({dispose:()=>i.disconnect()})}_layer;_entries=new Map;_order=[];_pendingRevealCommentId;revealComment(e){this._pendingRevealCommentId=e,this._revealPendingComment()}_reconcile(e){this._order=e.map(i=>i.id);let n=new Set(this._order);for(let i of e){if(this._entries.has(i.id))continue;let r=new gc({body:i.body,onDelete:()=>this._model.remove(i.id)});r.element.style.position="absolute",r.element.style.pointerEvents="auto",this._layer.appendChild(r.element),this._entries.set(i.id,{widget:r,rects:this._view.rangeRects(i.range)})}for(let[i,r]of this._entries)n.has(i)||(r.widget.dispose(),this._entries.delete(i))}_relayout(){let e=this._order.map(n=>this._entries.get(n)).filter(n=>n!==void 0).map(n=>({element:n.widget.element,rects:n.rects.get()}));fx(this._view,e),this._revealPendingComment()}_revealPendingComment(){let e=this._pendingRevealCommentId;if(!e)return;let n=this._entries.get(e)?.widget.element;!n||n.style.visibility==="hidden"||(this._pendingRevealCommentId=void 0,n.scrollIntoView({block:"center",inline:"nearest"}))}};var Ff;function J(t,e,n){function i(a,u){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:u,constr:o,traits:new Set},enumerable:!1}),a._zod.traits.has(t))return;a._zod.traits.add(t),e(a,u);let c=o.prototype,d=Object.keys(c);for(let h=0;h<d.length;h++){let l=d[h];l in a||(a[l]=c[l].bind(a))}}let r=n?.Parent??Object;class s extends r{}Object.defineProperty(s,"name",{value:t});function o(a){var u;let c=n?.Parent?new s:this;i(c,a),(u=c._zod).deferred??(u.deferred=[]);for(let d of c._zod.deferred)d();return c}return Object.defineProperty(o,"init",{value:i}),Object.defineProperty(o,Symbol.hasInstance,{value:a=>n?.Parent&&a instanceof n.Parent?!0:a?._zod?.traits?.has(t)}),Object.defineProperty(o,"name",{value:t}),o}var rr=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}};(Ff=globalThis).__zod_globalConfig??(Ff.__zod_globalConfig={});var mx=globalThis.__zod_globalConfig;function Ln(t){return mx}function Nm(t){let e=Object.values(t).filter(n=>typeof n=="number");return Object.entries(t).filter(([n,i])=>e.indexOf(+n)===-1).map(([n,i])=>i)}function px(t,e){return typeof e=="bigint"?e.toString():e}function gx(t){return{get value(){{let e=t();return Object.defineProperty(this,"value",{value:e}),e}}}}function Am(t){let e=t.startsWith("^")?1:0,n=t.endsWith("$")?t.length-1:t.length;return t.slice(e,n)}var $f=Symbol("evaluating");function Ut(t,e,n){let i;Object.defineProperty(t,e,{get(){if(i!==$f)return i===void 0&&(i=$f,i=n()),i},set(r){Object.defineProperty(t,e,{value:r})},configurable:!0})}var Pm="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function Ac(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function bx(t){if(Ac(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let n=e.prototype;return!(Ac(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}var vx=new Set(["string","number","symbol"]);function Pc(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function _x(t,e,n){let i=new t._zod.constr(e??t._zod.def);return(!e||n?.parent)&&(i._zod.parent=t),i}function Ye(t){let e=t;if(!e)return{};if(typeof e=="string")return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function xx(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}var wx={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function tr(t,e=0){if(t.aborted===!0)return!0;for(let n=e;n<t.issues.length;n++)if(t.issues[n]?.continue!==!0)return!0;return!1}function yx(t,e=0){if(t.aborted===!0)return!0;for(let n=e;n<t.issues.length;n++)if(t.issues[n]?.continue===!1)return!0;return!1}function ui(t,e){return e.map(n=>{var i;return(i=n).path??(i.path=[]),n.path.unshift(t),n})}function ao(t){return typeof t=="string"?t:t?.message}function In(t,e,n){let i=t.message?t.message:ao(t.inst?._zod.def?.error?.(t))??ao(e?.error?.(t))??ao(n.customError?.(t))??ao(n.localeError?.(t))??"Invalid input",{inst:r,continue:s,input:o,...a}=t;return a.path??(a.path=[]),a.message=i,e?.reportInput&&(a.input=o),a}var Fm=(t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),t.message=JSON.stringify(e,px,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},kx=J("$ZodError",Fm),Eo=J("$ZodError",Fm,{Parent:Error}),Ex=t=>(e,n,i,r)=>{let s=i?{...i,async:!1}:{async:!1},o=e._zod.run({value:n,issues:[]},s);if(o instanceof Promise)throw new rr;if(o.issues.length){let a=new(r?.Err??t)(o.issues.map(u=>In(u,s,Ln())));throw Pm(a,r?.callee),a}return o.value},Sx=Ex(Eo),zx=t=>async(e,n,i,r)=>{let s=i?{...i,async:!0}:{async:!0},o=e._zod.run({value:n,issues:[]},s);if(o instanceof Promise&&(o=await o),o.issues.length){let a=new(r?.Err??t)(o.issues.map(u=>In(u,s,Ln())));throw Pm(a,r?.callee),a}return o.value},Cx=zx(Eo),Tx=t=>(e,n,i)=>{let r=i?{...i,async:!1}:{async:!1},s=e._zod.run({value:n,issues:[]},r);if(s instanceof Promise)throw new rr;return s.issues.length?{success:!1,error:new(t??kx)(s.issues.map(o=>In(o,r,Ln())))}:{success:!0,data:s.value}},Ft=Tx(Eo),Ox=t=>async(e,n,i)=>{let r=i?{...i,async:!0}:{async:!0},s=e._zod.run({value:n,issues:[]},r);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new t(s.issues.map(o=>In(o,r,Ln())))}:{success:!0,data:s.value}},$m=Ox(Eo),Rx=t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},Lx=/^-?\d+$/,Bm=/^-?\d+(?:\.\d+)?$/,Ix=/^(?:true|false)$/i,Dm=J("$ZodCheck",(t,e)=>{var n;t._zod??(t._zod={}),t._zod.def=e,(n=t._zod).onattach??(n.onattach=[])}),Mx={number:"number",bigint:"bigint",object:"date"},qm=J("$ZodCheckGreaterThan",(t,e)=>{Dm.init(t,e);let n=Mx[typeof e.value];t._zod.onattach.push(i=>{let r=i._zod.bag,s=(e.inclusive?r.minimum:r.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>s&&(e.inclusive?r.minimum=e.value:r.exclusiveMinimum=e.value)}),t._zod.check=i=>{(e.inclusive?i.value>=e.value:i.value>e.value)||i.issues.push({origin:n,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:i.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),Nx=J("$ZodCheckNumberFormat",(t,e)=>{Dm.init(t,e),e.format=e.format||"float64";let n=e.format?.includes("int"),i=n?"int":"number",[r,s]=wx[e.format];t._zod.onattach.push(o=>{let a=o._zod.bag;a.format=e.format,a.minimum=r,a.maximum=s,n&&(a.pattern=Lx)}),t._zod.check=o=>{let a=o.value;if(n){if(!Number.isInteger(a)){o.issues.push({expected:i,format:e.format,code:"invalid_type",continue:!1,input:a,inst:t});return}if(!Number.isSafeInteger(a)){a>0?o.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:i,inclusive:!0,continue:!e.abort}):o.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:i,inclusive:!0,continue:!e.abort});return}}a<r&&o.issues.push({origin:"number",input:a,code:"too_small",minimum:r,inclusive:!0,inst:t,continue:!e.abort}),a>s&&o.issues.push({origin:"number",input:a,code:"too_big",maximum:s,inclusive:!0,inst:t,continue:!e.abort})}}),Ax={major:4,minor:4,patch:3},rt=J("$ZodType",(t,e)=>{var n;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=Ax;let i=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&i.unshift(t);for(let r of i)for(let s of r._zod.onattach)s(t);if(i.length===0)(n=t._zod).deferred??(n.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let r=(o,a,u)=>{let c=tr(o),d;for(let h of a){if(h._zod.def.when){if(yx(o)||!h._zod.def.when(o))continue}else if(c)continue;let l=o.issues.length,f=h._zod.check(o);if(f instanceof Promise&&u?.async===!1)throw new rr;if(d||f instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await f,o.issues.length!==l&&(c||(c=tr(o,l)))});else{if(o.issues.length===l)continue;c||(c=tr(o,l))}}return d?d.then(()=>o):o},s=(o,a,u)=>{if(tr(o))return o.aborted=!0,o;let c=r(a,i,u);if(c instanceof Promise){if(u.async===!1)throw new rr;return c.then(d=>t._zod.parse(d,u))}return t._zod.parse(c,u)};t._zod.run=(o,a)=>{if(a.skipChecks)return t._zod.parse(o,a);if(a.direction==="backward"){let c=t._zod.parse({value:o.value,issues:[]},{...a,skipChecks:!0});return c instanceof Promise?c.then(d=>s(d,o,a)):s(c,o,a)}let u=t._zod.parse(o,a);if(u instanceof Promise){if(a.async===!1)throw new rr;return u.then(c=>r(c,i,a))}return r(u,i,a)}}Ut(t,"~standard",()=>({validate:r=>{try{let s=Ft(t,r);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return $m(t,r).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}))}),Px=J("$ZodString",(t,e)=>{rt.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??Rx(t._zod.bag),t._zod.parse=(n,i)=>{if(e.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:t}),n}}),Vm=J("$ZodNumber",(t,e)=>{rt.init(t,e),t._zod.pattern=t._zod.bag.pattern??Bm,t._zod.parse=(n,i)=>{if(e.coerce)try{n.value=Number(n.value)}catch{}let r=n.value;if(typeof r=="number"&&!Number.isNaN(r)&&Number.isFinite(r))return n;let s=typeof r=="number"?Number.isNaN(r)?"NaN":Number.isFinite(r)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:r,inst:t,...s?{received:s}:{}}),n}}),Fx=J("$ZodNumberFormat",(t,e)=>{Nx.init(t,e),Vm.init(t,e)}),$x=J("$ZodBoolean",(t,e)=>{rt.init(t,e),t._zod.pattern=Ix,t._zod.parse=(n,i)=>{if(e.coerce)try{n.value=!!n.value}catch{}let r=n.value;return typeof r=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:r,inst:t}),n}}),Bx=J("$ZodUnknown",(t,e)=>{rt.init(t,e),t._zod.parse=n=>n}),Dx=J("$ZodVoid",(t,e)=>{rt.init(t,e),t._zod.parse=(n,i)=>{let r=n.value;return typeof r>"u"||n.issues.push({expected:"void",code:"invalid_type",input:r,inst:t}),n}});function Bf(t,e,n){t.issues.length&&e.issues.push(...ui(n,t.issues)),e.value[n]=t.value}var qx=J("$ZodArray",(t,e)=>{rt.init(t,e),t._zod.parse=(n,i)=>{let r=n.value;if(!Array.isArray(r))return n.issues.push({expected:"array",code:"invalid_type",input:r,inst:t}),n;n.value=Array(r.length);let s=[];for(let o=0;o<r.length;o++){let a=r[o],u=e.element._zod.run({value:a,issues:[]},i);u instanceof Promise?s.push(u.then(c=>Bf(c,n,o))):Bf(u,n,o)}return s.length?Promise.all(s).then(()=>n):n}});function go(t,e,n,i,r,s){let o=n in i;if(t.issues.length){if(r&&s&&!o)return;e.issues.push(...ui(n,t.issues))}if(!o&&!r){t.issues.length||e.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}t.value===void 0?o&&(e.value[n]=void 0):e.value[n]=t.value}function Vx(t){let e=Object.keys(t.shape);for(let i of e)if(!t.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);let n=xx(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(n)}}function jx(t,e,n,i,r,s){let o=[],a=r.keySet,u=r.catchall._zod,c=u.def.type,d=u.optin==="optional",h=u.optout==="optional";for(let l in e){if(l==="__proto__"||a.has(l))continue;if(c==="never"){o.push(l);continue}let f=u.run({value:e[l],issues:[]},i);f instanceof Promise?t.push(f.then(m=>go(m,n,l,e,d,h))):go(f,n,l,e,d,h)}return o.length&&n.issues.push({code:"unrecognized_keys",keys:o,input:e,inst:s}),t.length?Promise.all(t).then(()=>n):n}var Hx=J("$ZodObject",(t,e)=>{if(rt.init(t,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let o=e.shape;Object.defineProperty(e,"shape",{get:()=>{let a={...o};return Object.defineProperty(e,"shape",{value:a}),a}})}let n=gx(()=>Vx(e));Ut(t._zod,"propValues",()=>{let o=e.shape,a={};for(let u in o){let c=o[u]._zod;if(c.values){a[u]??(a[u]=new Set);for(let d of c.values)a[u].add(d)}}return a});let i=Ac,r=e.catchall,s;t._zod.parse=(o,a)=>{s??(s=n.value);let u=o.value;if(!i(u))return o.issues.push({expected:"object",code:"invalid_type",input:u,inst:t}),o;o.value={};let c=[],d=s.shape;for(let h of s.keys){let l=d[h],f=l._zod.optin==="optional",m=l._zod.optout==="optional",p=l._zod.run({value:u[h],issues:[]},a);p instanceof Promise?c.push(p.then(g=>go(g,o,h,u,f,m))):go(p,o,h,u,f,m)}return r?jx(c,u,o,a,n.value,t):c.length?Promise.all(c).then(()=>o):o}});function Df(t,e,n,i){for(let s of t)if(s.issues.length===0)return e.value=s.value,e;let r=t.filter(s=>!tr(s));return r.length===1?(e.value=r[0].value,r[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:n,errors:t.map(s=>s.issues.map(o=>In(o,i,Ln())))}),e)}var Wx=J("$ZodUnion",(t,e)=>{rt.init(t,e),Ut(t._zod,"optin",()=>e.options.some(i=>i._zod.optin==="optional")?"optional":void 0),Ut(t._zod,"optout",()=>e.options.some(i=>i._zod.optout==="optional")?"optional":void 0),Ut(t._zod,"values",()=>{if(e.options.every(i=>i._zod.values))return new Set(e.options.flatMap(i=>Array.from(i._zod.values)))}),Ut(t._zod,"pattern",()=>{if(e.options.every(i=>i._zod.pattern)){let i=e.options.map(r=>r._zod.pattern);return new RegExp(`^(${i.map(r=>Am(r.source)).join("|")})$`)}});let n=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(i,r)=>{if(n)return n(i,r);let s=!1,o=[];for(let a of e.options){let u=a._zod.run({value:i.value,issues:[]},r);if(u instanceof Promise)o.push(u),s=!0;else{if(u.issues.length===0)return u;o.push(u)}}return s?Promise.all(o).then(a=>Df(a,i,t,r)):Df(o,i,t,r)}}),Ux=J("$ZodRecord",(t,e)=>{rt.init(t,e),t._zod.parse=(n,i)=>{let r=n.value;if(!bx(r))return n.issues.push({expected:"record",code:"invalid_type",input:r,inst:t}),n;let s=[],o=e.keyType._zod.values;if(o){n.value={};let a=new Set;for(let c of o)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){a.add(typeof c=="number"?c.toString():c);let d=e.keyType._zod.run({value:c,issues:[]},i);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(d.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(f=>In(f,i,Ln())),input:c,path:[c],inst:t});continue}let h=d.value,l=e.valueType._zod.run({value:r[c],issues:[]},i);l instanceof Promise?s.push(l.then(f=>{f.issues.length&&n.issues.push(...ui(c,f.issues)),n.value[h]=f.value})):(l.issues.length&&n.issues.push(...ui(c,l.issues)),n.value[h]=l.value)}let u;for(let c in r)a.has(c)||(u=u??[],u.push(c));u&&u.length>0&&n.issues.push({code:"unrecognized_keys",input:r,inst:t,keys:u})}else{n.value={};for(let a of Reflect.ownKeys(r)){if(a==="__proto__"||!Object.prototype.propertyIsEnumerable.call(r,a))continue;let u=e.keyType._zod.run({value:a,issues:[]},i);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&Bm.test(a)&&u.issues.length){let d=e.keyType._zod.run({value:Number(a),issues:[]},i);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");d.issues.length===0&&(u=d)}if(u.issues.length){e.mode==="loose"?n.value[a]=r[a]:n.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(d=>In(d,i,Ln())),input:a,path:[a],inst:t});continue}let c=e.valueType._zod.run({value:r[a],issues:[]},i);c instanceof Promise?s.push(c.then(d=>{d.issues.length&&n.issues.push(...ui(a,d.issues)),n.value[u.value]=d.value})):(c.issues.length&&n.issues.push(...ui(a,c.issues)),n.value[u.value]=c.value)}}return s.length?Promise.all(s).then(()=>n):n}}),Kx=J("$ZodEnum",(t,e)=>{rt.init(t,e);let n=Nm(e.entries),i=new Set(n);t._zod.values=i,t._zod.pattern=new RegExp(`^(${n.filter(r=>vx.has(typeof r)).map(r=>typeof r=="string"?Pc(r):r.toString()).join("|")})$`),t._zod.parse=(r,s)=>{let o=r.value;return i.has(o)||r.issues.push({code:"invalid_value",values:n,input:o,inst:t}),r}}),Zx=J("$ZodLiteral",(t,e)=>{if(rt.init(t,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");let n=new Set(e.values);t._zod.values=n,t._zod.pattern=new RegExp(`^(${e.values.map(i=>typeof i=="string"?Pc(i):i?Pc(i.toString()):String(i)).join("|")})$`),t._zod.parse=(i,r)=>{let s=i.value;return n.has(s)||i.issues.push({code:"invalid_value",values:e.values,input:s,inst:t}),i}});function qf(t,e){return e===void 0&&(t.issues.length||t.fallback)?{issues:[],value:void 0}:t}var Xx=J("$ZodOptional",(t,e)=>{rt.init(t,e),t._zod.optin="optional",t._zod.optout="optional",Ut(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),Ut(t._zod,"pattern",()=>{let n=e.innerType._zod.pattern;return n?new RegExp(`^(${Am(n.source)})?$`):void 0}),t._zod.parse=(n,i)=>{if(e.innerType._zod.optin==="optional"){let r=n.value,s=e.innerType._zod.run(n,i);return s instanceof Promise?s.then(o=>qf(o,r)):qf(s,r)}return n.value===void 0?n:e.innerType._zod.run(n,i)}}),Vf,Gx=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...e){let n=e[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let e=this._map.get(t);return e&&typeof e=="object"&&"id"in e&&this._idmap.delete(e.id),this._map.delete(t),this}get(t){let e=t._zod.parent;if(e){let n={...this.get(e)??{}};delete n.id;let i={...n,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function Jx(){return new Gx}(Vf=globalThis).__zod_globalRegistry??(Vf.__zod_globalRegistry=Jx());var Qx=globalThis.__zod_globalRegistry;function Yx(t,e){return new t({type:"string",...Ye(e)})}function ew(t,e){return new t({type:"number",checks:[],...Ye(e)})}function tw(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...Ye(e)})}function nw(t,e){return new t({type:"boolean",...Ye(e)})}function iw(t){return new t({type:"unknown"})}function rw(t,e){return new t({type:"void",...Ye(e)})}function sw(t,e){return new qm({check:"greater_than",...Ye(e),value:t,inclusive:!1})}function ow(t,e){return new qm({check:"greater_than",...Ye(e),value:t,inclusive:!0})}function aw(t){return sw(0,t)}function sr(t){return ow(0,t)}function Fc(t){let e=t?.target??"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:t.processors??{},metadataRegistry:t?.metadata??Qx,target:e,unrepresentable:t?.unrepresentable??"throw",override:t?.override??(()=>{}),io:t?.io??"output",counter:0,seen:new Map,cycles:t?.cycles??"ref",reused:t?.reused??"inline",external:t?.external??void 0}}function de(t,e,n={path:[],schemaPath:[]}){var i;let r=t._zod.def,s=e.seen.get(t);if(s)return s.count++,n.schemaPath.includes(t)&&(s.cycle=n.path),s.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};e.seen.set(t,o);let a=t._zod.toJSONSchema?.();if(a)o.schema=a;else{let c={...n,schemaPath:[...n.schemaPath,t],path:n.path};if(t._zod.processJSONSchema)t._zod.processJSONSchema(e,o.schema,c);else{let h=o.schema,l=e.processors[r.type];if(!l)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${r.type}`);l(t,e,h,c)}let d=t._zod.parent;d&&(o.ref||(o.ref=d),de(d,e,c),e.seen.get(d).isParent=!0)}let u=e.metadataRegistry.get(t);return u&&Object.assign(o.schema,u),e.io==="input"&&je(t)&&(delete o.schema.examples,delete o.schema.default),e.io==="input"&&"_prefault"in o.schema&&((i=o.schema).default??(i.default=o.schema._prefault)),delete o.schema._prefault,e.seen.get(t).schema}function $c(t,e){let n=t.seen.get(e);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=new Map;for(let o of t.seen.entries()){let a=t.metadataRegistry.get(o[0])?.id;if(a){let u=i.get(a);if(u&&u!==o[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(a,o[0])}}let r=o=>{let a=t.target==="draft-2020-12"?"$defs":"definitions";if(t.external){let d=t.external.registry.get(o[0])?.id,h=t.external.uri??(f=>f);if(d)return{ref:h(d)};let l=o[1].defId??o[1].schema.id??`schema${t.counter++}`;return o[1].defId=l,{defId:l,ref:`${h("__shared")}#/${a}/${l}`}}if(o[1]===n)return{ref:"#"};let u=`#/${a}/`,c=o[1].schema.id??`__schema${t.counter++}`;return{defId:c,ref:u+c}},s=o=>{if(o[1].schema.$ref)return;let a=o[1],{ref:u,defId:c}=r(o);a.def={...a.schema},c&&(a.defId=c);let d=a.schema;for(let h in d)delete d[h];d.$ref=u};if(t.cycles==="throw")for(let o of t.seen.entries()){let a=o[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>

Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let o of t.seen.entries()){let a=o[1];if(e===o[0]){s(o);continue}if(t.external){let u=t.external.registry.get(o[0])?.id;if(e!==o[0]&&u){s(o);continue}}if(t.metadataRegistry.get(o[0])?.id){s(o);continue}if(a.cycle){s(o);continue}if(a.count>1&&t.reused==="ref"){s(o);continue}}}function Bc(t,e){let n=t.seen.get(e);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=a=>{let u=t.seen.get(a);if(u.ref===null)return;let c=u.def??u.schema,d={...c},h=u.ref;if(u.ref=null,h){i(h);let f=t.seen.get(h),m=f.schema;if(m.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(m)):Object.assign(c,m),Object.assign(c,d),a._zod.parent===h)for(let p in c)p==="$ref"||p==="allOf"||p in d||delete c[p];if(m.$ref&&f.def)for(let p in c)p==="$ref"||p==="allOf"||p in f.def&&JSON.stringify(c[p])===JSON.stringify(f.def[p])&&delete c[p]}let l=a._zod.parent;if(l&&l!==h){i(l);let f=t.seen.get(l);if(f?.schema.$ref&&(c.$ref=f.schema.$ref,f.def))for(let m in c)m==="$ref"||m==="allOf"||m in f.def&&JSON.stringify(c[m])===JSON.stringify(f.def[m])&&delete c[m]}t.override({zodSchema:a,jsonSchema:c,path:u.path??[]})};for(let a of[...t.seen.entries()].reverse())i(a[0]);let r={};if(t.target==="draft-2020-12"?r.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?r.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?r.$schema="http://json-schema.org/draft-04/schema#":t.target,t.external?.uri){let a=t.external.registry.get(e)?.id;if(!a)throw new Error("Schema is missing an `id` property");r.$id=t.external.uri(a)}Object.assign(r,n.def??n.schema);let s=t.metadataRegistry.get(e)?.id;s!==void 0&&r.id===s&&delete r.id;let o=t.external?.defs??{};for(let a of t.seen.entries()){let u=a[1];u.def&&u.defId&&(u.def.id===u.defId&&delete u.def.id,o[u.defId]=u.def)}t.external||Object.keys(o).length>0&&(t.target==="draft-2020-12"?r.$defs=o:r.definitions=o);try{let a=JSON.parse(JSON.stringify(r));return Object.defineProperty(a,"~standard",{value:{...e["~standard"],jsonSchema:{input:jf(e,"input",t.processors),output:jf(e,"output",t.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function je(t,e){let n=e??{seen:new Set};if(n.seen.has(t))return!1;n.seen.add(t);let i=t._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return je(i.element,n);if(i.type==="set")return je(i.valueType,n);if(i.type==="lazy")return je(i.getter(),n);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault")return je(i.innerType,n);if(i.type==="intersection")return je(i.left,n)||je(i.right,n);if(i.type==="record"||i.type==="map")return je(i.keyType,n)||je(i.valueType,n);if(i.type==="pipe")return t._zod.traits.has("$ZodCodec")?!0:je(i.in,n)||je(i.out,n);if(i.type==="object"){for(let r in i.shape)if(je(i.shape[r],n))return!0;return!1}if(i.type==="union"){for(let r of i.options)if(je(r,n))return!0;return!1}if(i.type==="tuple"){for(let r of i.items)if(je(r,n))return!0;return!!(i.rest&&je(i.rest,n))}return!1}var jf=(t,e,n={})=>i=>{let{libraryOptions:r,target:s}=i??{},o=Fc({...r??{},target:s,io:e,processors:n});return de(t,o),$c(o,t),Bc(o,t)},uw={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},cw=(t,e,n,i)=>{let r=n;r.type="string";let{minimum:s,maximum:o,format:a,patterns:u,contentEncoding:c}=t._zod.bag;if(typeof s=="number"&&(r.minLength=s),typeof o=="number"&&(r.maxLength=o),a&&(r.format=uw[a]??a,r.format===""&&delete r.format,a==="time"&&delete r.format),c&&(r.contentEncoding=c),u&&u.size>0){let d=[...u];d.length===1?r.pattern=d[0].source:d.length>1&&(r.allOf=[...d.map(h=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:h.source}))])}},dw=(t,e,n,i)=>{let r=n,{minimum:s,maximum:o,format:a,multipleOf:u,exclusiveMaximum:c,exclusiveMinimum:d}=t._zod.bag;typeof a=="string"&&a.includes("int")?r.type="integer":r.type="number";let h=typeof d=="number"&&d>=(s??Number.NEGATIVE_INFINITY),l=typeof c=="number"&&c<=(o??Number.POSITIVE_INFINITY),f=e.target==="draft-04"||e.target==="openapi-3.0";h?f?(r.minimum=d,r.exclusiveMinimum=!0):r.exclusiveMinimum=d:typeof s=="number"&&(r.minimum=s),l?f?(r.maximum=c,r.exclusiveMaximum=!0):r.exclusiveMaximum=c:typeof o=="number"&&(r.maximum=o),typeof u=="number"&&(r.multipleOf=u)},lw=(t,e,n,i)=>{n.type="boolean"},hw=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},fw=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},mw=(t,e,n,i)=>{e.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},pw=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},gw=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},bw=(t,e,n,i)=>{n.not={}},vw=(t,e,n,i)=>{},_w=(t,e,n,i)=>{},xw=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},ww=(t,e,n,i)=>{let r=t._zod.def,s=Nm(r.entries);s.every(o=>typeof o=="number")&&(n.type="number"),s.every(o=>typeof o=="string")&&(n.type="string"),n.enum=s},yw=(t,e,n,i)=>{let r=t._zod.def,s=[];for(let o of r.values)if(o===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof o=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(o))}else s.push(o);if(s.length!==0)if(s.length===1){let o=s[0];n.type=o===null?"null":typeof o,e.target==="draft-04"||e.target==="openapi-3.0"?n.enum=[o]:n.const=o}else s.every(o=>typeof o=="number")&&(n.type="number"),s.every(o=>typeof o=="string")&&(n.type="string"),s.every(o=>typeof o=="boolean")&&(n.type="boolean"),s.every(o=>o===null)&&(n.type="null"),n.enum=s},kw=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},Ew=(t,e,n,i)=>{let r=n,s=t._zod.pattern;if(!s)throw new Error("Pattern not found in template literal");r.type="string",r.pattern=s.source},Sw=(t,e,n,i)=>{let r=n,s={type:"string",format:"binary",contentEncoding:"binary"},{minimum:o,maximum:a,mime:u}=t._zod.bag;o!==void 0&&(s.minLength=o),a!==void 0&&(s.maxLength=a),u?u.length===1?(s.contentMediaType=u[0],Object.assign(r,s)):(Object.assign(r,s),r.anyOf=u.map(c=>({contentMediaType:c}))):Object.assign(r,s)},zw=(t,e,n,i)=>{n.type="boolean"},Cw=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Tw=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},Ow=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Rw=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},Lw=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},Iw=(t,e,n,i)=>{let r=n,s=t._zod.def,{minimum:o,maximum:a}=t._zod.bag;typeof o=="number"&&(r.minItems=o),typeof a=="number"&&(r.maxItems=a),r.type="array",r.items=de(s.element,e,{...i,path:[...i.path,"items"]})},Mw=(t,e,n,i)=>{let r=n,s=t._zod.def;r.type="object",r.properties={};let o=s.shape;for(let c in o)r.properties[c]=de(o[c],e,{...i,path:[...i.path,"properties",c]});let a=new Set(Object.keys(o)),u=new Set([...a].filter(c=>{let d=s.shape[c]._zod;return e.io==="input"?d.optin===void 0:d.optout===void 0}));u.size>0&&(r.required=Array.from(u)),s.catchall?._zod.def.type==="never"?r.additionalProperties=!1:s.catchall?s.catchall&&(r.additionalProperties=de(s.catchall,e,{...i,path:[...i.path,"additionalProperties"]})):e.io==="output"&&(r.additionalProperties=!1)},Nw=(t,e,n,i)=>{let r=t._zod.def,s=r.inclusive===!1,o=r.options.map((a,u)=>de(a,e,{...i,path:[...i.path,s?"oneOf":"anyOf",u]}));s?n.oneOf=o:n.anyOf=o},Aw=(t,e,n,i)=>{let r=t._zod.def,s=de(r.left,e,{...i,path:[...i.path,"allOf",0]}),o=de(r.right,e,{...i,path:[...i.path,"allOf",1]}),a=c=>"allOf"in c&&Object.keys(c).length===1,u=[...a(s)?s.allOf:[s],...a(o)?o.allOf:[o]];n.allOf=u},Pw=(t,e,n,i)=>{let r=n,s=t._zod.def;r.type="array";let o=e.target==="draft-2020-12"?"prefixItems":"items",a=e.target==="draft-2020-12"||e.target==="openapi-3.0"?"items":"additionalItems",u=s.items.map((l,f)=>de(l,e,{...i,path:[...i.path,o,f]})),c=s.rest?de(s.rest,e,{...i,path:[...i.path,a,...e.target==="openapi-3.0"?[s.items.length]:[]]}):null;e.target==="draft-2020-12"?(r.prefixItems=u,c&&(r.items=c)):e.target==="openapi-3.0"?(r.items={anyOf:u},c&&r.items.anyOf.push(c),r.minItems=u.length,c||(r.maxItems=u.length)):(r.items=u,c&&(r.additionalItems=c));let{minimum:d,maximum:h}=t._zod.bag;typeof d=="number"&&(r.minItems=d),typeof h=="number"&&(r.maxItems=h)},Fw=(t,e,n,i)=>{let r=n,s=t._zod.def;r.type="object";let o=s.keyType,a=o._zod.bag?.patterns;if(s.mode==="loose"&&a&&a.size>0){let c=de(s.valueType,e,{...i,path:[...i.path,"patternProperties","*"]});r.patternProperties={};for(let d of a)r.patternProperties[d.source]=c}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(r.propertyNames=de(s.keyType,e,{...i,path:[...i.path,"propertyNames"]})),r.additionalProperties=de(s.valueType,e,{...i,path:[...i.path,"additionalProperties"]});let u=o._zod.values;if(u){let c=[...u].filter(d=>typeof d=="string"||typeof d=="number");c.length>0&&(r.required=c)}},$w=(t,e,n,i)=>{let r=t._zod.def,s=de(r.innerType,e,i),o=e.seen.get(t);e.target==="openapi-3.0"?(o.ref=r.innerType,n.nullable=!0):n.anyOf=[s,{type:"null"}]},Bw=(t,e,n,i)=>{let r=t._zod.def;de(r.innerType,e,i);let s=e.seen.get(t);s.ref=r.innerType},Dw=(t,e,n,i)=>{let r=t._zod.def;de(r.innerType,e,i);let s=e.seen.get(t);s.ref=r.innerType,n.default=JSON.parse(JSON.stringify(r.defaultValue))},qw=(t,e,n,i)=>{let r=t._zod.def;de(r.innerType,e,i);let s=e.seen.get(t);s.ref=r.innerType,e.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(r.defaultValue)))},Vw=(t,e,n,i)=>{let r=t._zod.def;de(r.innerType,e,i);let s=e.seen.get(t);s.ref=r.innerType;let o;try{o=r.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=o},jw=(t,e,n,i)=>{let r=t._zod.def,s=r.in._zod.traits.has("$ZodTransform"),o=e.io==="input"?s?r.out:r.in:r.out;de(o,e,i);let a=e.seen.get(t);a.ref=o},Hw=(t,e,n,i)=>{let r=t._zod.def;de(r.innerType,e,i);let s=e.seen.get(t);s.ref=r.innerType,n.readOnly=!0},Ww=(t,e,n,i)=>{let r=t._zod.def;de(r.innerType,e,i);let s=e.seen.get(t);s.ref=r.innerType},Uw=(t,e,n,i)=>{let r=t._zod.def;de(r.innerType,e,i);let s=e.seen.get(t);s.ref=r.innerType},Kw=(t,e,n,i)=>{let r=t._zod.innerType;de(r,e,i);let s=e.seen.get(t);s.ref=r},Hf={string:cw,number:dw,boolean:lw,bigint:hw,symbol:fw,null:mw,undefined:pw,void:gw,never:bw,any:vw,unknown:_w,date:xw,enum:ww,literal:yw,nan:kw,template_literal:Ew,file:Sw,success:zw,custom:Cw,function:Tw,transform:Ow,map:Rw,set:Lw,array:Iw,object:Mw,union:Nw,intersection:Aw,tuple:Pw,record:Fw,nullable:$w,nonoptional:Bw,default:Dw,prefault:qw,catch:Vw,pipe:jw,readonly:Hw,promise:Ww,optional:Uw,lazy:Kw};function Zw(t,e){if("_idmap"in t){let i=t,r=Fc({...e,processors:Hf}),s={};for(let u of i._idmap.entries()){let[c,d]=u;de(d,r)}let o={},a={registry:i,uri:e?.uri,defs:s};r.external=a;for(let u of i._idmap.entries()){let[c,d]=u;$c(r,d),o[c]=Bc(r,d)}if(Object.keys(s).length>0){let u=r.target==="draft-2020-12"?"$defs":"definitions";o.__shared={[u]:s}}return{schemas:o}}let n=Fc({...e,processors:Hf});return de(t,n),$c(n,t),Bc(n,t)}var mt=J("ZodMiniType",(t,e)=>{if(!t._zod)throw new Error("Uninitialized schema in ZodMiniType.");rt.init(t,e),t.def=e,t.type=e.type,t.parse=(n,i)=>Sx(t,n,i,{callee:t.parse}),t.safeParse=(n,i)=>Ft(t,n,i),t.parseAsync=async(n,i)=>Cx(t,n,i,{callee:t.parseAsync}),t.safeParseAsync=async(n,i)=>$m(t,n,i),t.check=(...n)=>t.clone({...e,checks:[...e.checks??[],...n.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]},{parent:!0}),t.with=t.check,t.clone=(n,i)=>_x(t,n,i),t.brand=()=>t,t.register=((n,i)=>(n.add(t,i),t)),t.apply=n=>n(t)}),Xw=J("ZodMiniString",(t,e)=>{Px.init(t,e),mt.init(t,e)});function I(t){return Yx(Xw,t)}var jm=J("ZodMiniNumber",(t,e)=>{Vm.init(t,e),mt.init(t,e)});function ft(t){return ew(jm,t)}var Gw=J("ZodMiniNumberFormat",(t,e)=>{Fx.init(t,e),jm.init(t,e)});function fi(t){return tw(Gw,t)}var Jw=J("ZodMiniBoolean",(t,e)=>{$x.init(t,e),mt.init(t,e)});function So(t){return nw(Jw,t)}var Qw=J("ZodMiniUnknown",(t,e)=>{Bx.init(t,e),mt.init(t,e)});function Rn(){return iw(Qw)}var Yw=J("ZodMiniVoid",(t,e)=>{Dx.init(t,e),mt.init(t,e)});function Wf(t){return rw(Yw,t)}var ey=J("ZodMiniArray",(t,e)=>{qx.init(t,e),mt.init(t,e)});function it(t,e){return new ey({type:"array",element:t,...Ye(e)})}var ty=J("ZodMiniObject",(t,e)=>{Hx.init(t,e),mt.init(t,e),Ut(t,"shape",()=>e.shape)});function $(t,e){let n={type:"object",shape:t??{},...Ye(e)};return new ty(n)}var ny=J("ZodMiniUnion",(t,e)=>{Wx.init(t,e),mt.init(t,e)});function cr(t,e){return new ny({type:"union",options:t,...Ye(e)})}var Uf=J("ZodMiniRecord",(t,e)=>{Ux.init(t,e),mt.init(t,e)});function iy(t,e,n){return!e||!e._zod?new Uf({type:"record",keyType:I(),valueType:t,...Ye(e)}):new Uf({type:"record",keyType:t,valueType:e,...Ye(n)})}var ry=J("ZodMiniEnum",(t,e)=>{Kx.init(t,e),mt.init(t,e),t.options=Object.values(e.entries)});function un(t,e){let n=Array.isArray(t)?Object.fromEntries(t.map(i=>[i,i])):t;return new ry({type:"enum",entries:n,...Ye(e)})}var sy=J("ZodMiniLiteral",(t,e)=>{Zx.init(t,e),mt.init(t,e)});function Hm(t,e){return new sy({type:"literal",values:Array.isArray(t)?t:[t],...Ye(e)})}var oy=J("ZodMiniOptional",(t,e)=>{Xx.init(t,e),mt.init(t,e)});function D(t){return new oy({type:"optional",innerType:t})}var ay=new Set(["type","format","properties","required","additionalProperties","items","prefixItems","const","enum","anyOf","oneOf","discriminator","$ref","title","description"]);function on(t){if(t===!0||t===!1)return t;if(t===null||typeof t!="object")throw new Error(`normalizeJsonSchema: expected object, got ${typeof t}`);if(Array.isArray(t))throw new Error("normalizeJsonSchema: expected object, got array");let e=t;if("not"in e&&cy(e.not))return!1;let n={};for(let[i,r]of Object.entries(e)){if(!ay.has(i))continue;let s=uy(i,r);s!==void 0&&(n[i]=s)}if(n.type==="object"&&!("additionalProperties"in n)&&(n.additionalProperties=!1),Array.isArray(n.oneOf)&&!("discriminator"in n)){let i=dy(n.oneOf);i!==void 0&&(n.discriminator=i)}return"discriminator"in n&&!Array.isArray(n.oneOf)&&delete n.discriminator,Object.keys(n).length===0?!0:n}function uy(t,e){switch(t){case"properties":{if(!Dc(e))return{};let n={};for(let[i,r]of Object.entries(e))n[i]=on(r);return n}case"items":case"additionalProperties":return e===!1?!1:on(e);case"prefixItems":case"anyOf":case"oneOf":return Array.isArray(e)?e.map(n=>on(n)):[];case"discriminator":{if(!Dc(e))return;let n=e.propertyName;return typeof n!="string"||n.length===0?void 0:{propertyName:n}}case"enum":return Array.isArray(e)?e.slice():[];case"required":return Array.isArray(e)?e.slice().sort():[];default:return e}}function cy(t){return Dc(t)&&Object.keys(t).length===0}function Dc(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function dy(t){if(t.length<2)return;let e=[];for(let i of t){if(i===!0||i===!1||i.type!=="object")return;let r=i.properties;if(!r)return;e.push(r)}let n=Kf(e[0]);for(let i=1;i<e.length;i++)if(n=n.filter(r=>Kf(e[i]).includes(r)),n.length===0)return;for(let i of n){let r=new Set,s=!0;for(let o of e){let a=o[i],u=JSON.stringify(a.const);if(r.has(u)){s=!1;break}r.add(u)}if(s)return{propertyName:i}}}function Kf(t){let e=[];for(let[n,i]of Object.entries(t))i===!0||i===!1||"const"in i&&e.push(n);return e}var Wm=class Um{paramsSchema;resultSchema;errorSchema;docs;clientStreamSchema;serverStreamSchema;kind="request";constructor(e,n,i,r={},s,o){this.paramsSchema=e,this.resultSchema=n,this.errorSchema=i,this.docs=r,this.clientStreamSchema=s,this.serverStreamSchema=o}withStream(e){return new Um(this.paramsSchema,this.resultSchema,this.errorSchema,this.docs,e.client,e.server)}},Km=class{paramsSchema;docs;kind="notification";constructor(t,e={}){this.paramsSchema=t,this.docs=e}};function ue(t,e,n,i){let r={};return new Wm(t,e??Wf(),Wf(),r)}function $t(t,e={}){return new Km(t,e)}function ly(t,e){let n=t._zod?.def?.type;return n==="void"||n==="undefined"?!0:hy(Zw(t),e)}function hy(t,e){if(!bo(t))return on(t);let n=bo(t.$defs)?t.$defs:{},i=qc(t);if(Object.keys(n).length===0&&i.size===0)return on(t);if(e===void 0)throw new Error("zodToSvcJsonSchema: local references require a component destination");let r=`method=${Sc(e.methodName)}&schema=${Sc(e.schemaPosition)}`,s=new Map;for(let c of Object.keys(n))s.set(c,`${r}&def=${Sc(c)}`);let o=i.has("#")?`${r}&root`:void 0,a=c=>Vc(c,s,o);for(let[c,d]of Object.entries(n)){let h=s.get(c);if(h===void 0)throw new Error(`zodToSvcJsonSchema: missing component for "${c}"`);Zf(e.components,h,on(a(d)))}let u=a(t);return o!==void 0?(Zf(e.components,o,on(u)),{$ref:jc(o)}):on(u)}function qc(t,e=new Set){if(Array.isArray(t)){for(let n of t)qc(n,e);return e}if(!bo(t))return e;typeof t.$ref=="string"&&t.$ref.startsWith("#")&&e.add(t.$ref);for(let n of Object.values(t))qc(n,e);return e}function Vc(t,e,n){if(Array.isArray(t))return t.map(r=>Vc(r,e,n));if(!bo(t))return t;let i={};for(let[r,s]of Object.entries(t))r!=="$defs"&&(r==="$ref"&&typeof s=="string"?i[r]=fy(s,e,n):i[r]=Vc(s,e,n));return i}function fy(t,e,n){if(t==="#"){if(n===void 0)throw new Error("zodToSvcJsonSchema: root reference has no component destination");return jc(n)}if(t.startsWith("#/$defs/")){let i=t.slice(8),r=[...e.keys()].find(o=>Zm(o)===i),s=r===void 0?void 0:e.get(r);if(s===void 0)throw new Error(`zodToSvcJsonSchema: dangling local reference "${t}"`);return jc(s)}if(t.startsWith("#")&&!t.startsWith("#/components/schemas/"))throw new Error(`zodToSvcJsonSchema: unsupported local reference "${t}"`);return t}function Zf(t,e,n){if(Object.hasOwn(t,e))throw new Error(`zodToSvcJsonSchema: duplicate component name "${e}"`);t[e]=n}function jc(t){return`#/components/schemas/${Zm(t)}`}function Zm(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}function Sc(t){return encodeURIComponent(t).replace(/~/g,"%7E")}function bo(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function my(t){let e=mo(t);if(e===void 0)throw new Error("jcsCanonicalize: value is not JSON-representable");return e}new TextEncoder;function mo(t,e=new Set){if(typeof t=="number"&&Number.isNaN(t))throw new Error("NaN is not allowed");if(typeof t=="number"&&!Number.isFinite(t))throw new Error("Infinity is not allowed");if(t===null||typeof t!="object")return JSON.stringify(t);let n=t;if(typeof n.toJSON=="function"){if(e.has(n))throw new Error("Circular reference detected");e.add(n);let r=mo(n.toJSON(),e);return e.delete(n),r}if(e.has(n))throw new Error("Circular reference detected");e.add(n);let i;if(Array.isArray(n))i=`[${n.map(r=>mo(r===void 0||typeof r=="symbol"?null:r,e)).join(",")}]`;else{let r=[];for(let s of Object.keys(n).sort()){let o=n[s];o===void 0||typeof o=="symbol"||r.push(`${JSON.stringify(s)}:${mo(o,e)}`)}i=`{${r.join(",")}}`}return e.delete(n),i}var py=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function Pt(t,e){return t>>>e|t<<32-e}function gy(t){let e=t.length,n=e*8,i=e+9+63&-64,r=new Uint8Array(i);r.set(t),r[e]=128;let s=new DataView(r.buffer);s.setUint32(i-8,Math.floor(n/4294967296),!1),s.setUint32(i-4,n>>>0,!1);let o=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),a=new Uint32Array(64);for(let d=0;d<i;d+=64){for(let x=0;x<16;x++)a[x]=s.getUint32(d+x*4,!1);for(let x=16;x<64;x++){let y=a[x-15],z=a[x-2],k=Pt(y,7)^Pt(y,18)^y>>>3,C=Pt(z,17)^Pt(z,19)^z>>>10;a[x]=a[x-16]+k+a[x-7]+C>>>0}let h=o[0],l=o[1],f=o[2],m=o[3],p=o[4],g=o[5],b=o[6],w=o[7];for(let x=0;x<64;x++){let y=Pt(p,6)^Pt(p,11)^Pt(p,25),z=p&g^~p&b,k=w+y+z+py[x]+a[x]>>>0,C=(Pt(h,2)^Pt(h,13)^Pt(h,22))+(h&l^h&f^l&f)>>>0;w=b,b=g,g=p,p=m+k>>>0,m=f,f=l,l=h,h=k+C>>>0}o[0]=o[0]+h>>>0,o[1]=o[1]+l>>>0,o[2]=o[2]+f>>>0,o[3]=o[3]+m>>>0,o[4]=o[4]+p>>>0,o[5]=o[5]+g>>>0,o[6]=o[6]+b>>>0,o[7]=o[7]+w>>>0}let u=new Uint8Array(32),c=new DataView(u.buffer);for(let d=0;d<8;d++)c.setUint32(d*4,o[d],!1);return u}function by(t){let e=my(Hc(t,!0)),n=gy(new TextEncoder().encode(e));return Array.from(n.subarray(0,8),i=>i.toString(16).padStart(2,"0")).join("")}function Hc(t,e=!1){if(t===null||typeof t!="object")return t;if(Array.isArray(t))return t.map(i=>Hc(i));let n={};for(let i of Object.keys(t)){if(i==="comment"||e&&i==="hash")continue;let r=t[i];r!==void 0&&(n[i]=Hc(r))}return n}var zc=new WeakMap,vy=class{info;members;constructor(t,e,n={}){if(this.info=t,this.members=e,zc.set(this,{frozenSchema:n.frozenSchema,schemaCache:void 0,hashCache:void 0}),t.hash!==void 0&&this.schemaHash!==t.hash)throw new Error(`Interface hash mismatch for "${t.id}": expected "${t.hash}", got "${this.schemaHash}". The interface's wire contract changed \u2014 update the pinned hash to "${this.schemaHash}" after reviewing the change.`)}get schemaHash(){let t=zc.get(this);return t.hashCache===void 0&&(t.hashCache=by(t.frozenSchema??Xf(this.info,this.members,""))),t.hashCache}toSchema(){let t=zc.get(this);return t.schemaCache===void 0&&(t.schemaCache=t.frozenSchema!==void 0?{...t.frozenSchema,hash:this.schemaHash}:Xf(this.info,this.members,this.schemaHash)),t.schemaCache}};function Xf(t,e,n){let i={},r={};for(let[o,a]of Object.entries(e))i[o]=_y(o,a,r);let s={id:t.id,hash:n,methods:i};return Object.keys(r).length>0&&(s.components={schemas:r}),t.description!==void 0&&(s.description=t.description),t.comment!==void 0&&(s.comment=t.comment),s}function _y(t,e,n){let i=e.docs;if(e.kind==="request"){let s={params:er(t,"params",e.paramsSchema,n),result:er(t,"result",e.resultSchema,n)};return e.clientStreamSchema!==void 0&&(s.clientStream=er(t,"clientStream",e.clientStreamSchema,n)),e.serverStreamSchema!==void 0&&(s.serverStream=er(t,"serverStream",e.serverStreamSchema,n)),i.description!==void 0&&(s.description=i.description),i.comment!==void 0&&(s.comment=i.comment),i.annotations!==void 0&&(s.annotations=i.annotations),s}let r={params:er(t,"params",e.paramsSchema,n)};return i.description!==void 0&&(r.description=i.description),i.comment!==void 0&&(r.comment=i.comment),i.annotations!==void 0&&(r.annotations=i.annotations),r}function er(t,e,n,i){return ly(n,{methodName:t,schemaPosition:e,components:i})}function Ue(t,e){return new vy(t,e)}var Gf=Ue({id:"hubrpc.defaults",description:"Reflection: preset default service / interface on this connection."},{get:ue($({}),$({serviceId:D(I()),interfaceId:D(I()),interfaceHash:D(I())}))}),xy=it($({principal:I(),transitive:D(So())})),Wc=cr([$({exact:I()}),$({prefix:I()})]),wy=$({serviceId:I(),interfaceId:I(),interfaceHash:I(),serviceDescription:D(I()),rootPrincipalSets:D(it(xy)),reachableServiceIds:D(it(Wc))}),Jf=Ue({id:"hubrpc.directory",description:"Reflection: list services exposed by this endpoint. Can also list other directory services that can be explored."},{list:ue($({interfaceId:D(I()),interfaceIdPrefix:D(I()),serviceId:D(I()),serviceIdScopes:D(it(Wc)),cursor:D(I()),limit:D(ft().check(fi(),aw())),timeoutMs:D(ft().check(fi(),sr()))}),$({items:it(wy),nextCursor:D(I()),truncated:D(So())})),watch:ue($({interfaceId:D(I()),interfaceIdPrefix:D(I()),serviceId:D(I()),serviceIdScopes:D(it(Wc))}),$({})).withStream({server:$({})})}),Qf=Ue({id:"hubrpc.schemas",description:"Reflection: fetch interface schemas by id (+ optional hash). Must serve the interfaces advertised in this endpoint's directory."},{get:ue($({interfaceId:I(),hash:D(I())}),$({schema:Rn()}))}),yy=$({portId:I(),label:D(I())}),ky=$({type:D(I()),label:D(I()),processId:D(ft()),processType:D(I()),nodeStatusServiceId:D(I()),metadata:D(iy(I(),cr([I(),ft(),So()])))}),Xm=$({source:un(["self","attacher"]),descriptor:ky}),Ey=$({nodeId:I(),kind:D(un(["endpoint","hub"])),label:D(I()),descriptors:D(it(Xm)),ports:it(yy)}),Yf=$({nodeId:I(),portId:I()}),Sy=$({from:Yf,to:Yf,label:D(I()),peerState:D(un(["identified","pending","unsupported","error"]))}),zy=$({serviceId:I(),nodeId:I(),portId:I(),match:un(["exact","prefix"])}),Cy=$({observerServiceId:I(),entryNodeId:I(),nodes:it(Ey),links:it(Sy),routes:it(zy)}),Gm=Ue({id:"hubrpc.topology",description:"Inspect the transport graph visible from a service. A watch emits invalidation ticks; consumers re-fetch getGraph after each tick."},{getGraph:ue($({}),Cy),watchGraph:ue($({}),$({})).withStream({server:$({})})}),em=$({edgeId:I(),portId:I(),requestId:D(cr([ft(),I()]))}),Ty=$({type:Hm("transit"),ts:ft(),nodeId:I(),in:D(em),out:D(em),disposition:un(["forwarded","consumed","dropped","unroutable"]),kind:un(["request","notification","response","stream"]),method:D(I()),params:D(Rn()),result:D(Rn()),error:D($({code:ft(),message:I(),data:D(Rn())}))}),Oy=$({type:Hm("overflow"),dropped:ft().check(fi(),sr())}),tm=cr([Ty,Oy]),nm=$({delivered:ft().check(fi(),sr()),dropped:ft().check(fi(),sr())}),Ry=$({methodPrefix:D(I())}),Ly=$({methodPrefix:D(I()),maxPayloadBytes:ft().check(fi(),sr())}),Jm=Ue({id:"hubrpc.traffic",description:"Stream raw message transits for the entire node hosting the addressed service. Payload-free and explicitly payload-bearing variants keep disclosure opt-in."},{watch:ue(Ry,nm).withStream({server:tm}),watchWithPayloads:ue(Ly,nm).withStream({server:tm})}),Iy=$({nodeId:I(),portId:I(),descriptors:D(it(Xm))}),Uc=Ue({id:"hubrpc.node",description:"Topology bootstrap: identify the node and port at this end of the direct connection."},{getNodeId:ue($({}),Iy)}),ai={toCaller:"toCaller",toCallee:"toCallee"},sn={cancel:"cancel",ping:"ping",pong:"pong"},My=Ue({id:"$stream",description:"Reserved sub-protocol for in-flight stream messages correlated to a request by `requestId`."},{send:$t($({requestId:cr([ft(),I()]),dir:un(["toCaller","toCallee"]),control:D($({type:un(["cancel","ping","pong"]),reason:D(I()),nonce:D(I())})),payload:D(Rn())}),{description:"Emit a stream message tied to the request `requestId`."})}),ci=`${My.info.id}::send`,nt={parseError:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internalError:-32603,permissionRequired:-32401,peerDisconnected:-32402,requestTimeout:-32403,cancelled:-32800};function nr(t){return typeof t.method=="string"&&t.id!==void 0}function Qm(t){return typeof t.method=="string"&&t.id===void 0}function po(t){return typeof t.method!="string"}var Wt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";function Ny(t){let e="",n=0;for(;n+3<=t.length;n+=3){let r=t[n]<<16|t[n+1]<<8|t[n+2];e+=Wt[r>>18&63]+Wt[r>>12&63]+Wt[r>>6&63]+Wt[r&63]}let i=t.length-n;if(i===1){let r=t[n]<<16;e+=Wt[r>>18&63]+Wt[r>>12&63]}else if(i===2){let r=t[n]<<16|t[n+1]<<8;e+=Wt[r>>18&63]+Wt[r>>12&63]+Wt[r>>6&63]}return e}function Ay(t){let e=t.split("::");if(e.length===3&&e[0].length===0&&e[1].length>0&&e[2].length>0)return{kind:"interface",interfaceId:e[1],member:e[2]};if(!e.some(n=>n.length===0)){if(e.length===1)return{kind:"bare",member:e[0]};if(e.length===2)return{kind:"interface",interfaceId:e[0],member:e[1]};if(e.length===3)return{kind:"full",serviceId:e[0],interfaceId:e[1],member:e[2]}}}var Ym=Symbol.for("@vscode/hubrpc.localMessageContext");function Py(t,e){return Object.defineProperties(t,{context:{configurable:!0,enumerable:!1,value:e},[Ym]:{configurable:!0,enumerable:!1,value:!0}}),t}function Fy(t){let e=t;return t[Ym]===!0?e.context:void 0}var $y=class ep{sender;_setHandler;_setWireObserver;constructor(e,n,i){this.sender=e,this._setHandler=n,this._setWireObserver=i}setRequestHandler(e){this._setHandler(e)}setWireMessageObserver(e,n){this._setWireObserver?.(e,n)}withSender(e){return new ep(e(this.sender),this._setHandler,this._setWireObserver)}},tp=Symbol("hubrpc.inspectionCall");function Cc(t){return Object.defineProperty(t,tp,{value:!0}),t}function Tc(t){return t?.[tp]===!0}var an=class extends Error{code;data;constructor(t,e,n){super(t),this.code=e,this.data=n,this.name="RpcError"}};function By(t,e){return"exact"in e?t===e.exact:e.prefix===""||t===e.prefix||t.startsWith(`${e.prefix}/`)}function np(t,e){return e===void 0||e.some(n=>By(t,n))}var Dy=10*6e4,ip=class rp{_transport;static create(e){return this.createWithClose(e).channel}static createWithClose(e){let n=new rp(e);return{channel:new $y(n,i=>n.setRequestHandler(i),(i,r)=>n.setWireMessageObserver(i,r)),close:()=>n.close()}}_nextId=1;_pending=new Map;_streamListeners=new Map;_streamControl=new Map;_incomingAborts=new Map;_handler;_wireObserver;_isInspectionMethod;_outboundInspectionRequests=new Set;_inboundInspectionRequests=new Set;_closeError;setRequestHandler(e){this._handler=e}setWireMessageObserver(e,n){this._wireObserver=e,this._isInspectionMethod=e===void 0?void 0:n,e===void 0&&(this._outboundInspectionRequests.clear(),this._inboundInspectionRequests.clear())}constructor(e){this._transport=e,this._transport.setListener(n=>this._onMessage(n))}async sendRequest(e,n,i){this._throwIfClosed();let r=this._nextId++,s={jsonrpc:"2.0",id:r,method:e};n!==void 0&&(s.params=n);let o=new Promise((a,u)=>{this._pending.set(String(r),{resolve:a,reject:u})});this._observeOutbound(s,i);try{await this._transport.send(s)}catch(a){throw this._pending.delete(String(r)),this._observeSendFailure(r,a),a}return o}async sendNotification(e,n,i){this._throwIfClosed();let r={jsonrpc:"2.0",method:e};n!==void 0&&(r.params=n),this._observeOutbound(r,i),await this._transport.send(r)}sendRequestWithStream(e,n,i){this._throwIfClosed();let r=this._nextId++,s=String(r),o,a,u=new Promise((l,f)=>{o=l,a=f});this._pending.set(s,{resolve:o,reject:a}),i?.onStreamMessage&&this._streamListeners.set(s,i.onStreamMessage);let c=this._makePinger(r,ai.toCallee);this._streamControl.set(s,c.onControl);let d=setInterval(()=>{this._sendStream(r,ai.toCallee,{control:{type:sn.ping}})},Dy);d.unref?.();let h=()=>{clearInterval(d),c.dispose(),this._streamControl.delete(s)};return u.then(h,h),(async()=>{let l={jsonrpc:"2.0",id:r,method:e};n!==void 0&&(l.params=n),this._observeOutbound(l,i),await this._transport.send(l)})().catch(l=>{this._pending.delete(s),this._streamListeners.delete(s),this._observeSendFailure(r,l),h(),a(l instanceof Error?l:new Error(String(l)))}),{result:u,send:l=>this._sendStream(r,ai.toCallee,{payload:l}),cancel:l=>this._sendStream(r,ai.toCallee,{control:l!==void 0?{type:sn.cancel,reason:l}:{type:sn.cancel}}),ping:c.ping}}_makePinger(e,n){let i=new Map,r=1;return{ping:()=>{let s=`${e}:${r++}`,o=new Promise((a,u)=>i.set(s,{resolve:a,reject:u}));return this._sendStream(e,n,{control:{type:sn.ping,nonce:s}}),o},onControl:s=>{if(s.type===sn.ping)this._sendStream(e,n,{control:{type:sn.pong,nonce:s.nonce}});else if(s.type===sn.pong&&s.nonce!==void 0){let o=i.get(s.nonce);o&&(i.delete(s.nonce),o.resolve())}},dispose:()=>{let s=new an("Request settled before pong",nt.cancelled);for(let o of i.values())o.reject(s);i.clear()}}}async _sendStream(e,n,i){this._throwIfClosed();let r={jsonrpc:"2.0",method:ci,params:{requestId:e,dir:n,...i}};this._observeOutbound(r),await this._transport.send(r)}close(){if(this._closeError)return;let e=new an("Connection closed",nt.peerDisconnected);this._closeError=e;for(let n of this._incomingAborts.values())n.abort(e);this._incomingAborts.clear(),this._transport.dispose();for(let n of this._pending.values())n.reject(e);this._pending.clear(),this._streamListeners.clear(),this._streamControl.clear()}_throwIfClosed(){if(this._closeError)throw this._closeError}_onMessage(e){let n=e.context;if(this._observeInbound(e),po(e)){if(e.id===null)return;let i=String(e.id),r=this._pending.get(i);if(!r)return;if(this._pending.delete(i),this._streamListeners.delete(i),"error"in e){let s=e.error,o=new an(s.message,s.code,s.data);r.reject(o)}else r.resolve(e.result);return}if(nr(e)){this._handleRequest(e,n).catch(()=>{});return}if(Qm(e)){if(e.method===ci){this._handleStreamNotification(e);return}this._handleNotification(e,n);return}}_handleStreamNotification(e){let n=e.params;if(!n)return;let i=n.requestId;if(i===void 0)return;let r=String(i);if(n.control){this._streamControl.get(r)?.(n.control);return}let s=this._streamListeners.get(r);s&&s(n.payload)}async _handleRequest(e,n){let i=String(e.id),r=this._makePinger(e.id,ai.toCaller),s={send:u=>this._sendStream(e.id,ai.toCaller,{payload:u}),onMessage:u=>{u?this._streamListeners.set(i,u):this._streamListeners.delete(i)},ping:r.ping,markInspectionLifecycle:()=>{this._wireObserver!==void 0&&this._inboundInspectionRequests.add(i)}},o=new AbortController;this._incomingAborts.set(i,o),this._streamControl.set(i,u=>{u.type===sn.cancel?o.abort(new an(u.reason??"cancelled",nt.cancelled)):r.onControl(u)});let a;try{if(!this._handler)a={error:{code:nt.methodNotFound,message:`No handler registered on this endpoint (method: ${e.method}).`}};else try{a=await this._handler.handleRequest({method:e.method,params:e.params,context:n,stream:s,signal:o.signal})}catch(u){a={error:{code:nt.internalError,message:u instanceof Error?u.message:String(u)}}}}finally{this._streamListeners.delete(i),this._streamControl.delete(i),this._incomingAborts.delete(i),r.dispose()}if("result"in a){let u={jsonrpc:"2.0",id:e.id,result:a.result};this._observeOutbound(u),await this._transport.send(u)}else{let u={jsonrpc:"2.0",id:e.id,error:a.error};this._observeOutbound(u),await this._transport.send(u)}}_handleNotification(e,n){if(this._handler)try{this._handler.handleNotification({method:e.method,params:e.params,context:n,stream:qy,signal:Vy})}catch{}}_observeInbound(e){let n=this._wireObserver;if(n===void 0)return;let i=!1;if(nr(e))i=this._isInspectionMethod?.(e.method)===!0,i&&this._inboundInspectionRequests.add(String(e.id));else if(po(e)){if(e.id!==null){let r=String(e.id);i=this._outboundInspectionRequests.delete(r)}}else e.method===ci?i=this._isInspectionStream(e):i=this._isInspectionMethod?.(e.method)===!0;i||n("inbound",e)}_observeOutbound(e,n){nr(e)&&Tc(n)&&Py(e,{...Fy(e),inspection:!0});let i=this._wireObserver;if(i===void 0)return;let r=!1;if(nr(e))r=Tc(n),r&&this._outboundInspectionRequests.add(String(e.id));else if(po(e)){if(e.id!==null){let s=String(e.id);r=this._inboundInspectionRequests.delete(s)}}else e.method===ci?r=this._isInspectionStream(e):r=Tc(n);r||i("outbound",e)}_observeSendFailure(e,n){if(this._wireObserver===void 0){this._outboundInspectionRequests.delete(String(e));return}this._observeInbound({jsonrpc:"2.0",id:e,error:{code:nt.peerDisconnected,message:n instanceof Error?n.message:String(n)}})}_isInspectionStream(e){let n=e.params;if(n?.requestId===void 0)return!1;let i=String(n.requestId);return this._outboundInspectionRequests.has(i)||this._inboundInspectionRequests.has(i)}},qy={send:()=>Promise.resolve(),onMessage:()=>{},ping:()=>Promise.resolve(),markInspectionLifecycle:()=>{}},Vy=new AbortController().signal,jy=256,Hy=class{_options;_send;_onDispose;_queueLimit;_queue=[];_active=!0;_pumping=!1;_overflowPending=0;_delivered=0;_dropped=0;_resolveClosed;closed;constructor(t,e,n,i=jy){this._options=t,this._send=e,this._onDispose=n,this._queueLimit=i;let r;this.closed=new Promise(s=>r=s),this._resolveClosed=r}enqueue(t){if(!this._active||this._options.methodPrefix!==void 0&&!t.method?.startsWith(this._options.methodPrefix))return;let e=this._options.maxPayloadBytes===void 0?Wy(t):Uy(t,this._options.maxPayloadBytes);this._queue.length>=this._queueLimit&&(this._queue.shift(),this._dropped++,this._overflowPending++),this._queue.push(e),this._pumping||(this._pumping=!0,queueMicrotask(()=>{this._pump()}))}dispose(){this._active&&(this._active=!1,this._dropped+=this._queue.length,this._queue.length=0,this._overflowPending=0,this._onDispose(),this._pumping||this._complete())}async _pump(){try{for(;this._active;){if(this._overflowPending>0){let e=this._overflowPending;this._overflowPending=0,await this._send({type:"overflow",dropped:e});continue}let t=this._queue.shift();if(t===void 0)break;await this._send(t),this._delivered++}}catch{this.dispose()}finally{this._pumping=!1,this._active?(this._queue.length>0||this._overflowPending>0)&&(this._pumping=!0,queueMicrotask(()=>{this._pump()})):this._complete()}}_complete(){this._resolveClosed({delivered:this._delivered,dropped:this._dropped})}};function Wy(t){let{params:e,result:n,error:i,...r}=t;return i===void 0?r:{...r,error:{code:i.code,message:i.message}}}function Uy(t,e){return{...t,params:Oc(t.params,e),result:Oc(t.result,e),error:t.error===void 0?void 0:{...t.error,data:Oc(t.error.data,e)}}}function Oc(t,e){if(t===void 0)return;if(e===Number.POSITIVE_INFINITY)return t;let n=JSON.stringify(t);if(n===void 0)return;let i=new TextEncoder().encode(n);if(i.byteLength<=e)return t;let r=new TextEncoder,s=new TextDecoder().decode(i.slice(0,e));for(;r.encode(s).byteLength>e;)s=s.slice(0,-1);return s}var Ky=class{_nodeId;_portId;_setActive;_subscribers=new Set;_observers=new Set;_outboundRequests=new Map;_inboundRequests=new Map;observe=(t,e)=>{this._onMessage(t,e)};constructor(t,e,n){this._nodeId=t,this._portId=e,this._setActive=n}get observerCount(){return this._subscribers.size+this._observers.size}subscribe(t,e){let n=new Hy(t,e,()=>{this._subscribers.delete(n),this._deactivateIfUnused()});return this._activateIfUnused(),this._subscribers.add(n),n}observeTransits(t){this._activateIfUnused(),this._observers.add(t);let e=!1;return{dispose:()=>{e||(e=!0,this._observers.delete(t),this._deactivateIfUnused())}}}dispose(){for(let t of[...this._subscribers])t.dispose();this._subscribers.clear(),this._observers.clear(),this._outboundRequests.clear(),this._inboundRequests.clear(),this._setActive(!1)}_onMessage(t,e){if(this._subscribers.size===0&&this._observers.size===0)return;let n=Date.now(),i,r=this._endpoint("id"in e?e.id??void 0:void 0),s={type:"transit",ts:n,nodeId:this._nodeId,...t==="inbound"?{in:r}:{out:r},disposition:t==="inbound"?"consumed":"forwarded"};if(nr(e)){let o={method:e.method};this._requestMap(t).set(String(e.id),o),i={...s,kind:"request",method:e.method,params:e.params}}else if(po(e)){let o=t==="inbound"?this._outboundRequests:this._inboundRequests,a=String(e.id),u=o.get(a);o.delete(a),i={...s,kind:"response",method:u?.method,result:"result"in e?e.result:void 0,error:"error"in e?e.error:void 0}}else if(Qm(e)&&e.method===ci){let o=e.params,a=this._endpoint(o?.requestId);i={...s,...t==="inbound"?{in:a}:{out:a},kind:"stream",method:ci,params:e.params}}else i={...s,kind:"notification",method:e.method,params:e.params};for(let o of[...this._observers])try{o(i)}catch{}for(let o of this._subscribers)o.enqueue(i)}_requestMap(t){return t==="outbound"?this._outboundRequests:this._inboundRequests}_endpoint(t){return{edgeId:this._portId,portId:this._portId,...t!==void 0?{requestId:t}:{}}}_activateIfUnused(){this._subscribers.size===0&&this._observers.size===0&&this._setActive(!0)}_deactivateIfUnused(){this._subscribers.size!==0||this._observers.size!==0||(this._outboundRequests.clear(),this._inboundRequests.clear(),this._setActive(!1))}},Zy=class sp{static fromTransport(e){return new sp(ip.create(e))}channel;_registry=new Map;_serviceDescriptions=new Map;_serviceRootPrincipalSets=new Map;_directoryWatchers=new Set;_directoryListeners=new Set;_inspection;_trafficInspector;_serviceInspectionRegistrations=new Map;_wireChannel;_preset;constructor(e){"sender"in e?(this._wireChannel=e,this.channel=e.sender,e.setRequestHandler({handleRequest:n=>this._handleRequest(n),handleNotification:n=>this._handleNotification(n)})):(this._wireChannel=void 0,this.channel=e)}get(e,n={}){return this._buildClient(e,n)}service(e){return new Gy(this,e)}register(e,n,i={}){return this._register(e,n,i,!1)}_register(e,n,i,r){let s=i.serviceId,o=`${s??""}::${e.info.id}`;if(this._registry.has(o))throw new Error(`Interface "${e.info.id}" already registered${s?` under service "${s}"`:""}.`);let a=!1;if(i.serviceDescription!==void 0){if(s===void 0)throw new Error("register: `serviceDescription` requires `serviceId`.");let d=this._serviceDescriptions.get(s);if(d!==void 0&&d!==i.serviceDescription)throw new Error(`register: conflicting descriptions for service "${s}".`);this._serviceDescriptions.set(s,i.serviceDescription),a=d===void 0}if(i.rootPrincipalSets!==void 0){if(s===void 0)throw new Error("register: `rootPrincipalSets` requires `serviceId`.");let d=this._serviceRootPrincipalSets.get(s);if(d!==void 0&&!Xy(d,i.rootPrincipalSets))throw new Error(`register: conflicting rootPrincipalSets for service "${s}".`);this._serviceRootPrincipalSets.set(s,i.rootPrincipalSets),a||=d===void 0}let u={iface:e,handlers:n,serviceId:s,internalInspection:r};if(this._registry.set(o,u),this._notifyDirectoryWatchers(u,a),!r&&s!==void 0&&this._inspection!==void 0&&!this._serviceInspectionRegistrations.has(s))try{this._installServiceInspection(s)}catch(d){throw this._registry.delete(o),this._notifyDirectoryWatchers(u),d}let c=!1;return{dispose:()=>{c||(c=!0,this._registry.get(o)===u&&(this._registry.delete(o),this._notifyDirectoryWatchers(u),s===void 0&&this._preset?.interfaceId===e.info.id&&(this._preset=void 0),s!==void 0&&!this._hasBusinessServiceRegistration(s)&&(this._removeServiceInspection(s),this._serviceDescriptions.delete(s),this._serviceRootPrincipalSets.delete(s))))}}}setPreset(e){let n=`::${e.info.id}`;if(!this._registry.has(n))throw new Error(`setPreset: interface "${e.info.id}" is not registered under the root service.`);this._preset={serviceId:void 0,interfaceId:e.info.id,hash:e.schemaHash}}listRegisteredInterfaces(){return Array.from(this._registry.values()).map(e=>{let n=e.serviceId??"",i={serviceId:n,interfaceId:e.iface.info.id,interfaceHash:e.iface.schemaHash},r=n===""?void 0:this._serviceDescriptions.get(n);r!==void 0&&(i.serviceDescription=r);let s=n===""?void 0:this._serviceRootPrincipalSets.get(n);return s!==void 0&&(i.rootPrincipalSets=s),i})}onDidChangeDirectory(e){return this._directoryListeners.add(e),()=>this._directoryListeners.delete(e)}findRegisteredInterface(e,n){for(let i of this._registry.values())if(i.iface.info.id===e&&!(n!==void 0&&i.iface.schemaHash!==n))return i.iface}enableReflection(e={}){let n=`${e.serviceId??""}::${Gf.info.id}`;if(this._registry.has(n))return{dispose(){}};let i=`${e.serviceId??""}::`;for(let a of[Jf,Qf])if(this._registry.has(`${i}${a.info.id}`))throw new Error(`enableReflection: partial reflection registration for service "${e.serviceId??""}".`);let r=e.serviceId!==void 0?{serviceId:e.serviceId}:{},s=[];if(s.push(this.register(Gf,{get:()=>this._preset?{serviceId:this._preset.serviceId,interfaceId:this._preset.interfaceId,interfaceHash:this._preset.hash}:{}},r)),s.push(this.register(Jf,{list:({interfaceId:a,interfaceIdPrefix:u,serviceId:c,serviceIdScopes:d,cursor:h,limit:l})=>{let f=this.listRegisteredInterfaces().filter(b=>e.serviceId===void 0||b.serviceId===e.serviceId).filter(b=>a===void 0||b.interfaceId===a).filter(b=>u===void 0||b.interfaceId.startsWith(u)).filter(b=>c===void 0||b.serviceId===c).filter(b=>np(b.serviceId,d)),m=h===void 0?0:Number.parseInt(h,10)||0,p=l===void 0?f.length:Math.min(f.length,m+l),g=f.slice(m,p).map(b=>({serviceId:b.serviceId,interfaceId:b.interfaceId,interfaceHash:b.interfaceHash,serviceDescription:b.serviceDescription,rootPrincipalSets:b.rootPrincipalSets?.map(w=>w.map(x=>({...x})))}));return p<f.length?{items:g,nextCursor:String(p)}:{items:g}},watch:(a,u,c)=>new Promise(d=>{let h={interfaceId:a.interfaceId,interfaceIdPrefix:a.interfaceIdPrefix,serviceId:a.serviceId,serviceIdScopes:a.serviceIdScopes,send:()=>c.send({})};this._directoryWatchers.add(h);let l=()=>{this._directoryWatchers.delete(h),d({})};if(c.signal.aborted){l();return}c.signal.addEventListener("abort",l,{once:!0})})},r)),s.push(this.register(Qf,{get:({interfaceId:a,hash:u})=>{let c=this.findRegisteredInterface(a,u);if(!c)throw new an("Interface not found",nt.methodNotFound,{reason:"unknown-interface",interfaceId:a,hash:u});return{schema:c.toSchema()}}},r)),e.serviceId!==void 0)try{this.enableReflection()}catch(a){for(let u of s.reverse())u.dispose();throw a}let o=!1;return{dispose:()=>{if(!o){o=!0;for(let a of s.reverse())a.dispose()}}}}_notifyDirectoryWatchers(e,n=!1){for(let i of this._directoryListeners)try{i()}catch{}for(let i of this._directoryWatchers){if(i.pending)continue;let r=rm(i,e),s=n&&e.serviceId!==void 0&&[...this._registry.values()].some(o=>o.serviceId===e.serviceId&&rm(i,o));!r&&!s||(i.pending=!0,queueMicrotask(()=>{i.pending=!1,this._directoryWatchers.has(i)&&i.send()}))}}enableInspection(e){if(this._inspection!==void 0)return this._inspection;let n={nodeId:im("node"),portId:im("port"),...e!==void 0?{descriptors:[...e]}:{}},i=this._register(Uc,{getNodeId:()=>n},{},!0),r=new Ky(n.nodeId,n.portId,a=>this._wireChannel?.setWireMessageObserver(a?r.observe:void 0,a?u=>this._isInspectionMethod(u):void 0));this._trafficInspector=r;let s=!1,o={...n,observeTraffic:a=>r.observeTransits(a),dispose:()=>{if(!s){s=!0;for(let a of[...this._serviceInspectionRegistrations.keys()])this._removeServiceInspection(a);r.dispose(),this._trafficInspector===r&&(this._trafficInspector=void 0),i.dispose(),this._inspection===o&&(this._inspection=void 0)}}};this._inspection=o;try{let a=new Set(Array.from(this._registry.values()).filter(u=>u.serviceId!==void 0&&!u.internalInspection).map(u=>u.serviceId));for(let u of a)this._installServiceInspection(u)}catch(a){throw o.dispose(),a}return o}get trafficObserverCount(){return this._trafficInspector?.observerCount??0}close(){this.channel.close()}_buildClient(e,n){let{serviceId:i,...r}=n,s=r,o=e.schemaHash,a=Rc(e),u={};for(let[c,d]of Object.entries(e.members)){let h=i?`${i}::${e.info.id}::${c}`:`${e.info.id}::${c}`;if(d.kind==="request")if(d.clientStreamSchema!==void 0||d.serverStreamSchema!==void 0){let l=d.serverStreamSchema;u[c]=(f,m)=>{let p=m?.onMessage,g=p!==void 0?y=>{if(l!==void 0){let z=Ft(l,y);if(!z.success)return;p(z.data);return}p(y)}:void 0,b=g!==void 0?{ctx:s,interfaceHash:o,onStreamMessage:g}:{ctx:s,interfaceHash:o};a&&Cc(b);let w=this.channel.sendRequestWithStream(h,f,b),x=w.result.then(y=>{let z=Ft(d.resultSchema,y===null?void 0:y);if(!z.success)throw new an(nt.internalError,`Invalid result for ${h}`,{issues:z.error.issues});return y});return Object.assign(x,{send:y=>w.send(y),cancel:y=>w.cancel(y),ping:()=>w.ping()})}}else{let l=d.resultSchema;u[c]=async f=>{let m={ctx:s,interfaceHash:o};a&&Cc(m);let p=await this.channel.sendRequest(h,f,m),g=Ft(l,p===null?void 0:p);if(!g.success)throw new an(nt.internalError,`Invalid result for ${h}`,{issues:g.error.issues});return p}}else u[c]=async l=>{let f={ctx:s,interfaceHash:o};a&&Cc(f),this.channel.sendNotification(h,l,f)}}return u}async _handleRequest(e){let n=this._parseRouted(e.method);if(!n.ok)return uo(n.reason,e.method);let{entry:i,memberName:r}=n,s=i.iface.members[r];if(!s)return uo("unknown-method",e.method);let o=i.handlers[r];if(!o)return uo("unknown-method",e.method);let a=Ft(s.paramsSchema,e.params);if(!a.success)return{error:{code:nt.invalidParams,message:"Invalid params",data:{issues:a.error.issues}}};if(!(s instanceof Wm))return uo("unknown-method",e.method);let u=this._buildStreamApi(e.stream,e.signal,s);try{let c=o(a.data,e.context,u);Rc(i.iface)&&e.stream.markInspectionLifecycle();let d=await c,h=Ft(s.resultSchema,d);return h.success?{result:d===void 0?null:d}:{error:{code:nt.internalError,message:`Invalid result for ${e.method}`,data:{issues:h.error.issues}}}}catch(c){return c instanceof an?{error:{code:c.code,message:c.message,data:c.data}}:{error:{code:nt.internalError,message:c instanceof Error?c.message:String(c)}}}}_buildStreamApi(e,n,i){return{send:r=>{if(i.serverStreamSchema){let s=Ft(i.serverStreamSchema,r);if(!s.success)throw new Error(`Server stream payload failed schema validation: ${s.error.message}`)}return e.send(r)},onMessage:r=>{e.onMessage(s=>{if(i.clientStreamSchema){let o=Ft(i.clientStreamSchema,s);if(!o.success)return;r(o.data);return}})},ping:()=>e.ping(),signal:n}}_handleNotification(e){let n=this._parseRouted(e.method);if(!n.ok)return;let{entry:i,memberName:r}=n,s=i.iface.members[r];if(!(s instanceof Km))return;let o=i.handlers[r];if(!o)return;let a=Ft(s.paramsSchema,e.params);a.success&&o(a.data,e.context)}_parseRouted(e){let n=Ay(e);if(!n)return{ok:!1,reason:"bad-method-grammar"};if(n.kind==="bare"){if(!this._preset)return{ok:!1,reason:"no-preset"};let o=this._registry.get(`::${this._preset.interfaceId}`);return o?{ok:!0,entry:o,memberName:n.member}:{ok:!1,reason:"no-preset"}}let i=n.kind==="full"?n.serviceId:void 0,r=`${i??""}::${n.interfaceId}`,s=this._registry.get(r);return s?{ok:!0,entry:s,memberName:n.member}:{ok:!1,reason:i?"unknown-service":"unknown-interface"}}_installServiceInspection(e){if(this._serviceInspectionRegistrations.has(e))return;let n=this._inspection,i=this._trafficInspector;if(n===void 0||i===void 0)return;let r=[],s={serviceId:e};try{r.push(this._register(Uc,{getNodeId:()=>({nodeId:n.nodeId,portId:n.portId})},s,!0)),r.push(this._register(Gm,{getGraph:()=>this._endpointGraph(e,n),watchGraph:async(o,a,u)=>(await Jy(u.signal),{})},s,!0)),r.push(this._register(Jm,{watch:({methodPrefix:o},a,u)=>this._watchTraffic(i,{methodPrefix:o},u),watchWithPayloads:({methodPrefix:o,maxPayloadBytes:a},u,c)=>this._watchTraffic(i,{methodPrefix:o,maxPayloadBytes:a},c)},s,!0))}catch(o){for(let a of r.reverse())a.dispose();throw o}this._serviceInspectionRegistrations.set(e,r)}_removeServiceInspection(e){let n=this._serviceInspectionRegistrations.get(e);if(n!==void 0){this._serviceInspectionRegistrations.delete(e);for(let i of n.reverse())i.dispose()}}_hasBusinessServiceRegistration(e){return Array.from(this._registry.values()).some(n=>n.serviceId===e&&!n.internalInspection)}_isInspectionMethod(e){let n=this._parseRouted(e);return n.ok&&Rc(n.entry.iface)}_endpointGraph(e,n){return{observerServiceId:e,entryNodeId:n.nodeId,nodes:[{nodeId:n.nodeId,kind:"endpoint",...n.descriptors!==void 0?{descriptors:n.descriptors}:{},ports:[{portId:n.portId}]}],links:[],routes:[{serviceId:e,nodeId:n.nodeId,portId:n.portId,match:"exact"}]}}async _watchTraffic(e,n,i){let r=e.subscribe(n,o=>i.send(o)),s=()=>r.dispose();i.signal.aborted?s():i.signal.addEventListener("abort",s,{once:!0});try{return await r.closed}finally{i.signal.removeEventListener("abort",s),r.dispose()}}};function im(t){let e=new Uint8Array(16);return globalThis.crypto.getRandomValues(e),`${t}:${Ny(e)}`}function Xy(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++){let i=t[n],r=e[n];if(i.length!==r.length)return!1;for(let s=0;s<i.length;s++)if(i[s].principal!==r[s].principal||i[s].transitive===!0!=(r[s].transitive===!0))return!1}return!0}function rm(t,e){let n=e.serviceId??"";return(t.interfaceId===void 0||t.interfaceId===e.iface.info.id)&&(t.interfaceIdPrefix===void 0||e.iface.info.id.startsWith(t.interfaceIdPrefix))&&(t.serviceId===void 0||t.serviceId===n)&&np(n,t.serviceIdScopes)}var Gy=class{_connection;_serviceId;constructor(t,e){this._connection=t,this._serviceId=e}get(t,e={}){return this._connection.get(t,{...e,serviceId:this._serviceId})}register(t,e,n={}){return this._connection.register(t,e,{...n,serviceId:this._serviceId})}};function uo(t,e){return{error:{code:nt.methodNotFound,message:`Method not found: ${e}`,data:{reason:t,method:e}}}}function Rc(t){return t===Uc||t===Gm||t===Jm}function Jy(t){return t.aborted?Promise.resolve():new Promise(e=>{t.addEventListener("abort",()=>e(),{once:!0})})}Qy(globalThis,{});function Qy(t,e){return new Proxy(t,{get(n,i,r){return i in e?e[i]:t[i]},set(n,i,r){return i in e&&delete e[i],t[i]=r,!0},deleteProperty(n,i){let r=!1;return i in e&&(delete e[i],r=!0),i in t&&(delete t[i],r=!0),r},ownKeys(n){let i=Reflect.ownKeys(t),r=Reflect.ownKeys(e),s=new Set(r);return[...i.filter(o=>!s.has(o)),...r]},defineProperty(n,i,r){return i in e&&delete e[i],Reflect.defineProperty(t,i,r),!0},getOwnPropertyDescriptor(n,i){return i in e?Reflect.getOwnPropertyDescriptor(e,i):Reflect.getOwnPropertyDescriptor(t,i)},has(n,i){return i in e||i in t}})}var On=I();Ue({id:"identity",description:"Per-participant key oracle: exposes signing and HPKE-based wrap/unwrap for the identity the executor has attached to this participant's root overlay. Private keys never leave the executor."},{getPrincipal:ue($({}),$({principal:I()})),getWrapPublicKey:ue($({}),$({wrapPublicKey:On})),sign:ue($({bytes:On}),$({signature:On})),wrap:ue($({domain:I(),bytes:On}),$({blob:On})),unwrap:ue($({domain:I(),blob:On}),$({bytes:On}))});Ue({id:"identity.storage",description:"Per-identity persistent key/value store. Scope is the executor's managed-identity slot; lifecycle is tied to the identity itself. Backed by an at-rest-encrypted file in the executor."},{get:ue($({key:I()}),$({value:D(Rn())})),set:ue($({key:I(),value:Rn()}),$({})),delete:ue($({key:I()}),$({existed:So()})),list:ue($({prefix:D(I())}),$({keys:it(I())}))});var Yy=class{_our;_their;_filterSource;_listener;_buffer=[];_closed=!1;_handler=t=>{if(this._filterSource&&t.source!==this._their)return;let e=t.data;ek(e)&&(this._listener?this._listener(e):this._buffer.push(e))};constructor(t,e,n=!0){if(this._our=t,this._their=e,this._filterSource=n,t===e)throw new Error("WindowMessageTransport: cannot connect to self");t.addEventListener("message",this._handler)}send(t){this._closed||this._their.postMessage(t,"*")}setListener(t){if(this._listener=t,t)for(;this._buffer.length>0&&this._listener;)t(this._buffer.shift())}dispose(){this._closed||(this._closed=!0,this._our.removeEventListener("message",this._handler))}};function ek(t){return typeof t=="object"&&t!==null&&t.jsonrpc==="2.0"}var sm;function S(t,e,n){function i(a,u){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:u,constr:o,traits:new Set},enumerable:!1}),a._zod.traits.has(t))return;a._zod.traits.add(t),e(a,u);let c=o.prototype,d=Object.keys(c);for(let h=0;h<d.length;h++){let l=d[h];l in a||(a[l]=c[l].bind(a))}}let r=n?.Parent??Object;class s extends r{}Object.defineProperty(s,"name",{value:t});function o(a){var u;let c=n?.Parent?new s:this;i(c,a),(u=c._zod).deferred??(u.deferred=[]);for(let d of c._zod.deferred)d();return c}return Object.defineProperty(o,"init",{value:i}),Object.defineProperty(o,Symbol.hasInstance,{value:a=>n?.Parent&&a instanceof n.Parent?!0:a?._zod?.traits?.has(t)}),Object.defineProperty(o,"name",{value:t}),o}var li=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},op=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(sm=globalThis).__zod_globalConfig??(sm.__zod_globalConfig={});var ed=globalThis.__zod_globalConfig;function Mn(t){return ed}function ap(t){let e=Object.values(t).filter(n=>typeof n=="number");return Object.entries(t).filter(([n,i])=>e.indexOf(+n)===-1).map(([n,i])=>i)}function Kc(t,e){return typeof e=="bigint"?e.toString():e}function zo(t){return{get value(){{let e=t();return Object.defineProperty(this,"value",{value:e}),e}}}}function td(t){return t==null}function nd(t){let e=t.startsWith("^")?1:0,n=t.endsWith("$")?t.length-1:t.length;return t.slice(e,n)}function tk(t,e){let n=t/e,i=Math.round(n),r=Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-i)<r?0:n-i}var om=Symbol("evaluating");function ne(t,e,n){let i;Object.defineProperty(t,e,{get(){if(i!==om)return i===void 0&&(i=om,i=n()),i},set(r){Object.defineProperty(t,e,{value:r})},configurable:!0})}function An(t,e,n){Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0})}function cn(...t){let e={};for(let n of t){let i=Object.getOwnPropertyDescriptors(n);Object.assign(e,i)}return Object.defineProperties({},e)}function am(t){return JSON.stringify(t)}function nk(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var up="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function or(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}var ik=zo(()=>{if(ed.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch{return!1}});function ar(t){if(or(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let n=e.prototype;return!(or(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function cp(t){return ar(t)?{...t}:Array.isArray(t)?[...t]:t instanceof Map?new Map(t):t instanceof Set?new Set(t):t}var rk=new Set(["string","number","symbol"]);function mi(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function dn(t,e,n){let i=new t._zod.constr(e??t._zod.def);return(!e||n?.parent)&&(i._zod.parent=t),i}function F(t){let e=t;if(!e)return{};if(typeof e=="string")return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function sk(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}var ok={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function ak(t,e){let n=t._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");return dn(t,cn(t._zod.def,{get shape(){let r={};for(let s in e){if(!(s in n.shape))throw new Error(`Unrecognized key: "${s}"`);e[s]&&(r[s]=n.shape[s])}return An(this,"shape",r),r},checks:[]}))}function uk(t,e){let n=t._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");return dn(t,cn(t._zod.def,{get shape(){let r={...t._zod.def.shape};for(let s in e){if(!(s in n.shape))throw new Error(`Unrecognized key: "${s}"`);e[s]&&delete r[s]}return An(this,"shape",r),r},checks:[]}))}function ck(t,e){if(!ar(e))throw new Error("Invalid input to extend: expected a plain object");let n=t._zod.def.checks;if(n&&n.length>0){let i=t._zod.def.shape;for(let r in e)if(Object.getOwnPropertyDescriptor(i,r)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return dn(t,cn(t._zod.def,{get shape(){let i={...t._zod.def.shape,...e};return An(this,"shape",i),i}}))}function dk(t,e){if(!ar(e))throw new Error("Invalid input to safeExtend: expected a plain object");return dn(t,cn(t._zod.def,{get shape(){let n={...t._zod.def.shape,...e};return An(this,"shape",n),n}}))}function lk(t,e){if(t._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");return dn(t,cn(t._zod.def,{get shape(){let n={...t._zod.def.shape,...e._zod.def.shape};return An(this,"shape",n),n},get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]}))}function hk(t,e,n){let i=e._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");return dn(e,cn(e._zod.def,{get shape(){let r=e._zod.def.shape,s={...r};if(n)for(let o in n){if(!(o in r))throw new Error(`Unrecognized key: "${o}"`);n[o]&&(s[o]=t?new t({type:"optional",innerType:r[o]}):r[o])}else for(let o in r)s[o]=t?new t({type:"optional",innerType:r[o]}):r[o];return An(this,"shape",s),s},checks:[]}))}function fk(t,e,n){return dn(e,cn(e._zod.def,{get shape(){let i=e._zod.def.shape,r={...i};if(n)for(let s in n){if(!(s in r))throw new Error(`Unrecognized key: "${s}"`);n[s]&&(r[s]=new t({type:"nonoptional",innerType:i[s]}))}else for(let s in i)r[s]=new t({type:"nonoptional",innerType:i[s]});return An(this,"shape",r),r}}))}function di(t,e=0){if(t.aborted===!0)return!0;for(let n=e;n<t.issues.length;n++)if(t.issues[n]?.continue!==!0)return!0;return!1}function mk(t,e=0){if(t.aborted===!0)return!0;for(let n=e;n<t.issues.length;n++)if(t.issues[n]?.continue===!1)return!0;return!1}function dp(t,e){return e.map(n=>{var i;return(i=n).path??(i.path=[]),n.path.unshift(t),n})}function co(t){return typeof t=="string"?t:t?.message}function Nn(t,e,n){let i=t.message?t.message:co(t.inst?._zod.def?.error?.(t))??co(e?.error?.(t))??co(n.customError?.(t))??co(n.localeError?.(t))??"Invalid input",{inst:r,continue:s,input:o,...a}=t;return a.path??(a.path=[]),a.message=i,e?.reportInput&&(a.input=o),a}function id(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function ur(...t){let[e,n,i]=t;return typeof e=="string"?{message:e,code:"custom",input:n,inst:i}:{...e}}var lp=(t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),t.message=JSON.stringify(e,Kc,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},hp=S("$ZodError",lp),fp=S("$ZodError",lp,{Parent:Error});function pk(t,e=n=>n.message){let n={},i=[];for(let r of t.issues)r.path.length>0?(n[r.path[0]]=n[r.path[0]]||[],n[r.path[0]].push(e(r))):i.push(e(r));return{formErrors:i,fieldErrors:n}}function gk(t,e=n=>n.message){let n={_errors:[]},i=(r,s=[])=>{for(let o of r.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(a=>i({issues:a},[...s,...o.path]));else if(o.code==="invalid_key")i({issues:o.issues},[...s,...o.path]);else if(o.code==="invalid_element")i({issues:o.issues},[...s,...o.path]);else{let a=[...s,...o.path];if(a.length===0)n._errors.push(e(o));else{let u=n,c=0;for(;c<a.length;){let d=a[c];c!==a.length-1?u[d]=u[d]||{_errors:[]}:(u[d]=u[d]||{_errors:[]},u[d]._errors.push(e(o))),u=u[d],c++}}}};return i(t),n}var rd=t=>(e,n,i,r)=>{let s=i?{...i,async:!1}:{async:!1},o=e._zod.run({value:n,issues:[]},s);if(o instanceof Promise)throw new li;if(o.issues.length){let a=new(r?.Err??t)(o.issues.map(u=>Nn(u,s,Mn())));throw up(a,r?.callee),a}return o.value},sd=t=>async(e,n,i,r)=>{let s=i?{...i,async:!0}:{async:!0},o=e._zod.run({value:n,issues:[]},s);if(o instanceof Promise&&(o=await o),o.issues.length){let a=new(r?.Err??t)(o.issues.map(u=>Nn(u,s,Mn())));throw up(a,r?.callee),a}return o.value},Co=t=>(e,n,i)=>{let r=i?{...i,async:!1}:{async:!1},s=e._zod.run({value:n,issues:[]},r);if(s instanceof Promise)throw new li;return s.issues.length?{success:!1,error:new(t??hp)(s.issues.map(o=>Nn(o,r,Mn())))}:{success:!0,data:s.value}},bk=Co(fp),To=t=>async(e,n,i)=>{let r=i?{...i,async:!0}:{async:!0},s=e._zod.run({value:n,issues:[]},r);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new t(s.issues.map(o=>Nn(o,r,Mn())))}:{success:!0,data:s.value}},vk=To(fp),_k=t=>(e,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return rd(t)(e,n,r)},xk=t=>(e,n,i)=>rd(t)(e,n,i),wk=t=>async(e,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return sd(t)(e,n,r)},yk=t=>async(e,n,i)=>sd(t)(e,n,i),kk=t=>(e,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return Co(t)(e,n,r)},Ek=t=>(e,n,i)=>Co(t)(e,n,i),Sk=t=>async(e,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return To(t)(e,n,r)},zk=t=>async(e,n,i)=>To(t)(e,n,i),Ck=/^[cC][0-9a-z]{6,}$/,Tk=/^[0-9a-z]+$/,Ok=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Rk=/^[0-9a-vA-V]{20}$/,Lk=/^[A-Za-z0-9]{27}$/,Ik=/^[a-zA-Z0-9_-]{21}$/,Mk=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Nk=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,um=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Ak=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Pk="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Fk(){return new RegExp(Pk,"u")}var $k=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Bk=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Dk=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,qk=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Vk=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,mp=/^[A-Za-z0-9_-]*$/,jk=/^https?$/,Hk=/^\+[1-9]\d{6,14}$/,pp="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Wk=new RegExp(`^${pp}$`);function gp(t){let e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Uk(t){return new RegExp(`^${gp(t)}$`)}function Kk(t){let e=gp({precision:t.precision}),n=["Z"];t.local&&n.push(""),t.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let i=`${e}(?:${n.join("|")})`;return new RegExp(`^${pp}T(?:${i})$`)}var Zk=t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},Xk=/^-?\d+$/,Gk=/^-?\d+(?:\.\d+)?$/,Jk=/^(?:true|false)$/i,Qk=/^[^A-Z]*$/,Yk=/^[^a-z]*$/,et=S("$ZodCheck",(t,e)=>{var n;t._zod??(t._zod={}),t._zod.def=e,(n=t._zod).onattach??(n.onattach=[])}),bp={number:"number",bigint:"bigint",object:"date"},vp=S("$ZodCheckLessThan",(t,e)=>{et.init(t,e);let n=bp[typeof e.value];t._zod.onattach.push(i=>{let r=i._zod.bag,s=(e.inclusive?r.maximum:r.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<s&&(e.inclusive?r.maximum=e.value:r.exclusiveMaximum=e.value)}),t._zod.check=i=>{(e.inclusive?i.value<=e.value:i.value<e.value)||i.issues.push({origin:n,code:"too_big",maximum:typeof e.value=="object"?e.value.getTime():e.value,input:i.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),_p=S("$ZodCheckGreaterThan",(t,e)=>{et.init(t,e);let n=bp[typeof e.value];t._zod.onattach.push(i=>{let r=i._zod.bag,s=(e.inclusive?r.minimum:r.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>s&&(e.inclusive?r.minimum=e.value:r.exclusiveMinimum=e.value)}),t._zod.check=i=>{(e.inclusive?i.value>=e.value:i.value>e.value)||i.issues.push({origin:n,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:i.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),e2=S("$ZodCheckMultipleOf",(t,e)=>{et.init(t,e),t._zod.onattach.push(n=>{var i;(i=n._zod.bag).multipleOf??(i.multipleOf=e.value)}),t._zod.check=n=>{if(typeof n.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%e.value===BigInt(0):tk(n.value,e.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:e.value,input:n.value,inst:t,continue:!e.abort})}}),t2=S("$ZodCheckNumberFormat",(t,e)=>{et.init(t,e),e.format=e.format||"float64";let n=e.format?.includes("int"),i=n?"int":"number",[r,s]=ok[e.format];t._zod.onattach.push(o=>{let a=o._zod.bag;a.format=e.format,a.minimum=r,a.maximum=s,n&&(a.pattern=Xk)}),t._zod.check=o=>{let a=o.value;if(n){if(!Number.isInteger(a)){o.issues.push({expected:i,format:e.format,code:"invalid_type",continue:!1,input:a,inst:t});return}if(!Number.isSafeInteger(a)){a>0?o.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:i,inclusive:!0,continue:!e.abort}):o.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:i,inclusive:!0,continue:!e.abort});return}}a<r&&o.issues.push({origin:"number",input:a,code:"too_small",minimum:r,inclusive:!0,inst:t,continue:!e.abort}),a>s&&o.issues.push({origin:"number",input:a,code:"too_big",maximum:s,inclusive:!0,inst:t,continue:!e.abort})}}),n2=S("$ZodCheckMaxLength",(t,e)=>{var n;et.init(t,e),(n=t._zod.def).when??(n.when=i=>{let r=i.value;return!td(r)&&r.length!==void 0}),t._zod.onattach.push(i=>{let r=i._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<r&&(i._zod.bag.maximum=e.maximum)}),t._zod.check=i=>{let r=i.value;if(r.length<=e.maximum)return;let s=id(r);i.issues.push({origin:s,code:"too_big",maximum:e.maximum,inclusive:!0,input:r,inst:t,continue:!e.abort})}}),i2=S("$ZodCheckMinLength",(t,e)=>{var n;et.init(t,e),(n=t._zod.def).when??(n.when=i=>{let r=i.value;return!td(r)&&r.length!==void 0}),t._zod.onattach.push(i=>{let r=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>r&&(i._zod.bag.minimum=e.minimum)}),t._zod.check=i=>{let r=i.value;if(r.length>=e.minimum)return;let s=id(r);i.issues.push({origin:s,code:"too_small",minimum:e.minimum,inclusive:!0,input:r,inst:t,continue:!e.abort})}}),r2=S("$ZodCheckLengthEquals",(t,e)=>{var n;et.init(t,e),(n=t._zod.def).when??(n.when=i=>{let r=i.value;return!td(r)&&r.length!==void 0}),t._zod.onattach.push(i=>{let r=i._zod.bag;r.minimum=e.length,r.maximum=e.length,r.length=e.length}),t._zod.check=i=>{let r=i.value,s=r.length;if(s===e.length)return;let o=id(r),a=s>e.length;i.issues.push({origin:o,...a?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:i.value,inst:t,continue:!e.abort})}}),Oo=S("$ZodCheckStringFormat",(t,e)=>{var n,i;et.init(t,e),t._zod.onattach.push(r=>{let s=r._zod.bag;s.format=e.format,e.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(e.pattern))}),e.pattern?(n=t._zod).check??(n.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:e.format,input:r.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(i=t._zod).check??(i.check=()=>{})}),s2=S("$ZodCheckRegex",(t,e)=>{Oo.init(t,e),t._zod.check=n=>{e.pattern.lastIndex=0,!e.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),o2=S("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=Qk),Oo.init(t,e)}),a2=S("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=Yk),Oo.init(t,e)}),u2=S("$ZodCheckIncludes",(t,e)=>{et.init(t,e);let n=mi(e.includes),i=new RegExp(typeof e.position=="number"?`^.{${e.position}}${n}`:n);e.pattern=i,t._zod.onattach.push(r=>{let s=r._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(i)}),t._zod.check=r=>{r.value.includes(e.includes,e.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:r.value,inst:t,continue:!e.abort})}}),c2=S("$ZodCheckStartsWith",(t,e)=>{et.init(t,e);let n=new RegExp(`^${mi(e.prefix)}.*`);e.pattern??(e.pattern=n),t._zod.onattach.push(i=>{let r=i._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),t._zod.check=i=>{i.value.startsWith(e.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:i.value,inst:t,continue:!e.abort})}}),d2=S("$ZodCheckEndsWith",(t,e)=>{et.init(t,e);let n=new RegExp(`.*${mi(e.suffix)}$`);e.pattern??(e.pattern=n),t._zod.onattach.push(i=>{let r=i._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),t._zod.check=i=>{i.value.endsWith(e.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:i.value,inst:t,continue:!e.abort})}}),l2=S("$ZodCheckOverwrite",(t,e)=>{et.init(t,e),t._zod.check=n=>{n.value=e.tx(n.value)}}),h2=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let e=t.split(`
`).filter(r=>r),n=Math.min(...e.map(r=>r.length-r.trimStart().length)),i=e.map(r=>r.slice(n)).map(r=>" ".repeat(this.indent*2)+r);for(let r of i)this.content.push(r)}compile(){let t=Function,e=this?.args,n=[...(this?.content??[""]).map(i=>`  ${i}`)];return new t(...e,n.join(`
`))}},f2={major:4,minor:4,patch:3},_e=S("$ZodType",(t,e)=>{var n;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=f2;let i=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&i.unshift(t);for(let r of i)for(let s of r._zod.onattach)s(t);if(i.length===0)(n=t._zod).deferred??(n.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let r=(o,a,u)=>{let c=di(o),d;for(let h of a){if(h._zod.def.when){if(mk(o)||!h._zod.def.when(o))continue}else if(c)continue;let l=o.issues.length,f=h._zod.check(o);if(f instanceof Promise&&u?.async===!1)throw new li;if(d||f instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await f,o.issues.length!==l&&(c||(c=di(o,l)))});else{if(o.issues.length===l)continue;c||(c=di(o,l))}}return d?d.then(()=>o):o},s=(o,a,u)=>{if(di(o))return o.aborted=!0,o;let c=r(a,i,u);if(c instanceof Promise){if(u.async===!1)throw new li;return c.then(d=>t._zod.parse(d,u))}return t._zod.parse(c,u)};t._zod.run=(o,a)=>{if(a.skipChecks)return t._zod.parse(o,a);if(a.direction==="backward"){let c=t._zod.parse({value:o.value,issues:[]},{...a,skipChecks:!0});return c instanceof Promise?c.then(d=>s(d,o,a)):s(c,o,a)}let u=t._zod.parse(o,a);if(u instanceof Promise){if(a.async===!1)throw new li;return u.then(c=>r(c,i,a))}return r(u,i,a)}}ne(t,"~standard",()=>({validate:r=>{try{let s=bk(t,r);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return vk(t,r).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}))}),od=S("$ZodString",(t,e)=>{_e.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??Zk(t._zod.bag),t._zod.parse=(n,i)=>{if(e.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:t}),n}}),me=S("$ZodStringFormat",(t,e)=>{Oo.init(t,e),od.init(t,e)}),m2=S("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=Nk),me.init(t,e)}),p2=S("$ZodUUID",(t,e)=>{if(e.version){let n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(n===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=um(n))}else e.pattern??(e.pattern=um());me.init(t,e)}),g2=S("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=Ak),me.init(t,e)}),b2=S("$ZodURL",(t,e)=>{me.init(t,e),t._zod.check=n=>{try{let i=n.value.trim();if(!e.normalize&&e.protocol?.source===jk.source&&!/^https?:\/\//i.test(i)){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:t,continue:!e.abort});return}let r=new URL(i);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(r.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:n.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(r.protocol.endsWith(":")?r.protocol.slice(0,-1):r.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:n.value,inst:t,continue:!e.abort})),e.normalize?n.value=r.href:n.value=i;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:t,continue:!e.abort})}}}),v2=S("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=Fk()),me.init(t,e)}),_2=S("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=Ik),me.init(t,e)}),x2=S("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=Ck),me.init(t,e)}),w2=S("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=Tk),me.init(t,e)}),y2=S("$ZodULID",(t,e)=>{e.pattern??(e.pattern=Ok),me.init(t,e)}),k2=S("$ZodXID",(t,e)=>{e.pattern??(e.pattern=Rk),me.init(t,e)}),E2=S("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=Lk),me.init(t,e)}),S2=S("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=Kk(e)),me.init(t,e)}),z2=S("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=Wk),me.init(t,e)}),C2=S("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=Uk(e)),me.init(t,e)}),T2=S("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=Mk),me.init(t,e)}),O2=S("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=$k),me.init(t,e),t._zod.bag.format="ipv4"}),R2=S("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=Bk),me.init(t,e),t._zod.bag.format="ipv6",t._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:t,continue:!e.abort})}}}),L2=S("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=Dk),me.init(t,e)}),I2=S("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=qk),me.init(t,e),t._zod.check=n=>{let i=n.value.split("/");try{if(i.length!==2)throw new Error;let[r,s]=i;if(!s)throw new Error;let o=Number(s);if(`${o}`!==s)throw new Error;if(o<0||o>128)throw new Error;new URL(`http://[${r}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:t,continue:!e.abort})}}});function xp(t){if(t==="")return!0;if(/\s/.test(t)||t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}var M2=S("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=Vk),me.init(t,e),t._zod.bag.contentEncoding="base64",t._zod.check=n=>{xp(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:t,continue:!e.abort})}});function N2(t){if(!mp.test(t))return!1;let e=t.replace(/[-_]/g,n=>n==="-"?"+":"/");return xp(e.padEnd(Math.ceil(e.length/4)*4,"="))}var A2=S("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=mp),me.init(t,e),t._zod.bag.contentEncoding="base64url",t._zod.check=n=>{N2(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:t,continue:!e.abort})}}),P2=S("$ZodE164",(t,e)=>{e.pattern??(e.pattern=Hk),me.init(t,e)});function F2(t,e=null){try{let n=t.split(".");if(n.length!==3)return!1;let[i]=n;if(!i)return!1;let r=JSON.parse(atob(i));return!("typ"in r&&r?.typ!=="JWT"||!r.alg||e&&(!("alg"in r)||r.alg!==e))}catch{return!1}}var $2=S("$ZodJWT",(t,e)=>{me.init(t,e),t._zod.check=n=>{F2(n.value,e.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:t,continue:!e.abort})}}),wp=S("$ZodNumber",(t,e)=>{_e.init(t,e),t._zod.pattern=t._zod.bag.pattern??Gk,t._zod.parse=(n,i)=>{if(e.coerce)try{n.value=Number(n.value)}catch{}let r=n.value;if(typeof r=="number"&&!Number.isNaN(r)&&Number.isFinite(r))return n;let s=typeof r=="number"?Number.isNaN(r)?"NaN":Number.isFinite(r)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:r,inst:t,...s?{received:s}:{}}),n}}),B2=S("$ZodNumberFormat",(t,e)=>{t2.init(t,e),wp.init(t,e)}),D2=S("$ZodBoolean",(t,e)=>{_e.init(t,e),t._zod.pattern=Jk,t._zod.parse=(n,i)=>{if(e.coerce)try{n.value=!!n.value}catch{}let r=n.value;return typeof r=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:r,inst:t}),n}}),q2=S("$ZodUnknown",(t,e)=>{_e.init(t,e),t._zod.parse=n=>n}),V2=S("$ZodNever",(t,e)=>{_e.init(t,e),t._zod.parse=(n,i)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:t}),n)});function cm(t,e,n){t.issues.length&&e.issues.push(...dp(n,t.issues)),e.value[n]=t.value}var j2=S("$ZodArray",(t,e)=>{_e.init(t,e),t._zod.parse=(n,i)=>{let r=n.value;if(!Array.isArray(r))return n.issues.push({expected:"array",code:"invalid_type",input:r,inst:t}),n;n.value=Array(r.length);let s=[];for(let o=0;o<r.length;o++){let a=r[o],u=e.element._zod.run({value:a,issues:[]},i);u instanceof Promise?s.push(u.then(c=>cm(c,n,o))):cm(u,n,o)}return s.length?Promise.all(s).then(()=>n):n}});function vo(t,e,n,i,r,s){let o=n in i;if(t.issues.length){if(r&&s&&!o)return;e.issues.push(...dp(n,t.issues))}if(!o&&!r){t.issues.length||e.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}t.value===void 0?o&&(e.value[n]=void 0):e.value[n]=t.value}function yp(t){let e=Object.keys(t.shape);for(let i of e)if(!t.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);let n=sk(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(n)}}function kp(t,e,n,i,r,s){let o=[],a=r.keySet,u=r.catchall._zod,c=u.def.type,d=u.optin==="optional",h=u.optout==="optional";for(let l in e){if(l==="__proto__"||a.has(l))continue;if(c==="never"){o.push(l);continue}let f=u.run({value:e[l],issues:[]},i);f instanceof Promise?t.push(f.then(m=>vo(m,n,l,e,d,h))):vo(f,n,l,e,d,h)}return o.length&&n.issues.push({code:"unrecognized_keys",keys:o,input:e,inst:s}),t.length?Promise.all(t).then(()=>n):n}var H2=S("$ZodObject",(t,e)=>{if(_e.init(t,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let o=e.shape;Object.defineProperty(e,"shape",{get:()=>{let a={...o};return Object.defineProperty(e,"shape",{value:a}),a}})}let n=zo(()=>yp(e));ne(t._zod,"propValues",()=>{let o=e.shape,a={};for(let u in o){let c=o[u]._zod;if(c.values){a[u]??(a[u]=new Set);for(let d of c.values)a[u].add(d)}}return a});let i=or,r=e.catchall,s;t._zod.parse=(o,a)=>{s??(s=n.value);let u=o.value;if(!i(u))return o.issues.push({expected:"object",code:"invalid_type",input:u,inst:t}),o;o.value={};let c=[],d=s.shape;for(let h of s.keys){let l=d[h],f=l._zod.optin==="optional",m=l._zod.optout==="optional",p=l._zod.run({value:u[h],issues:[]},a);p instanceof Promise?c.push(p.then(g=>vo(g,o,h,u,f,m))):vo(p,o,h,u,f,m)}return r?kp(c,u,o,a,n.value,t):c.length?Promise.all(c).then(()=>o):o}}),W2=S("$ZodObjectJIT",(t,e)=>{H2.init(t,e);let n=t._zod.parse,i=zo(()=>yp(e)),r=h=>{let l=new h2(["shape","payload","ctx"]),f=i.value,m=w=>{let x=am(w);return`shape[${x}]._zod.run({ value: input[${x}], issues: [] }, ctx)`};l.write("const input = payload.value;");let p=Object.create(null),g=0;for(let w of f.keys)p[w]=`key_${g++}`;l.write("const newResult = {};");for(let w of f.keys){let x=p[w],y=am(w),z=h[w],k=z?._zod?.optin==="optional",C=z?._zod?.optout==="optional";l.write(`const ${x} = ${m(w)};`),k&&C?l.write(`
        if (${x}.issues.length) {
          if (${y} in input) {
            payload.issues = payload.issues.concat(${x}.issues.map(iss => ({
              ...iss,
              path: iss.path ? [${y}, ...iss.path] : [${y}]
            })));
          }
        }
        
        if (${x}.value === undefined) {
          if (${y} in input) {
            newResult[${y}] = undefined;
          }
        } else {
          newResult[${y}] = ${x}.value;
        }
        
      `):k?l.write(`
        if (${x}.issues.length) {
          payload.issues = payload.issues.concat(${x}.issues.map(iss => ({
            ...iss,
            path: iss.path ? [${y}, ...iss.path] : [${y}]
          })));
        }
        
        if (${x}.value === undefined) {
          if (${y} in input) {
            newResult[${y}] = undefined;
          }
        } else {
          newResult[${y}] = ${x}.value;
        }
        
      `):l.write(`
        const ${x}_present = ${y} in input;
        if (${x}.issues.length) {
          payload.issues = payload.issues.concat(${x}.issues.map(iss => ({
            ...iss,
            path: iss.path ? [${y}, ...iss.path] : [${y}]
          })));
        }
        if (!${x}_present && !${x}.issues.length) {
          payload.issues.push({
            code: "invalid_type",
            expected: "nonoptional",
            input: undefined,
            path: [${y}]
          });
        }

        if (${x}_present) {
          if (${x}.value === undefined) {
            newResult[${y}] = undefined;
          } else {
            newResult[${y}] = ${x}.value;
          }
        }

      `)}l.write("payload.value = newResult;"),l.write("return payload;");let b=l.compile();return(w,x)=>b(h,w,x)},s,o=or,a=!ed.jitless,u=a&&ik.value,c=e.catchall,d;t._zod.parse=(h,l)=>{d??(d=i.value);let f=h.value;return o(f)?a&&u&&l?.async===!1&&l.jitless!==!0?(s||(s=r(e.shape)),h=s(h,l),c?kp([],f,h,l,d,t):h):n(h,l):(h.issues.push({expected:"object",code:"invalid_type",input:f,inst:t}),h)}});function dm(t,e,n,i){for(let s of t)if(s.issues.length===0)return e.value=s.value,e;let r=t.filter(s=>!di(s));return r.length===1?(e.value=r[0].value,r[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:n,errors:t.map(s=>s.issues.map(o=>Nn(o,i,Mn())))}),e)}var Ep=S("$ZodUnion",(t,e)=>{_e.init(t,e),ne(t._zod,"optin",()=>e.options.some(i=>i._zod.optin==="optional")?"optional":void 0),ne(t._zod,"optout",()=>e.options.some(i=>i._zod.optout==="optional")?"optional":void 0),ne(t._zod,"values",()=>{if(e.options.every(i=>i._zod.values))return new Set(e.options.flatMap(i=>Array.from(i._zod.values)))}),ne(t._zod,"pattern",()=>{if(e.options.every(i=>i._zod.pattern)){let i=e.options.map(r=>r._zod.pattern);return new RegExp(`^(${i.map(r=>nd(r.source)).join("|")})$`)}});let n=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(i,r)=>{if(n)return n(i,r);let s=!1,o=[];for(let a of e.options){let u=a._zod.run({value:i.value,issues:[]},r);if(u instanceof Promise)o.push(u),s=!0;else{if(u.issues.length===0)return u;o.push(u)}}return s?Promise.all(o).then(a=>dm(a,i,t,r)):dm(o,i,t,r)}}),U2=S("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,Ep.init(t,e);let n=t._zod.parse;ne(t._zod,"propValues",()=>{let r={};for(let s of e.options){let o=s._zod.propValues;if(!o||Object.keys(o).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(let[a,u]of Object.entries(o)){r[a]||(r[a]=new Set);for(let c of u)r[a].add(c)}}return r});let i=zo(()=>{let r=e.options,s=new Map;for(let o of r){let a=o._zod.propValues?.[e.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(o)}"`);for(let u of a){if(s.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);s.set(u,o)}}return s});t._zod.parse=(r,s)=>{let o=r.value;if(!or(o))return r.issues.push({code:"invalid_type",expected:"object",input:o,inst:t}),r;let a=i.value.get(o?.[e.discriminator]);return a?a._zod.run(r,s):e.unionFallback||s.direction==="backward"?n(r,s):(r.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,options:Array.from(i.value.keys()),input:o,path:[e.discriminator],inst:t}),r)}}),K2=S("$ZodIntersection",(t,e)=>{_e.init(t,e),t._zod.parse=(n,i)=>{let r=n.value,s=e.left._zod.run({value:r,issues:[]},i),o=e.right._zod.run({value:r,issues:[]},i);return s instanceof Promise||o instanceof Promise?Promise.all([s,o]).then(([a,u])=>lm(n,a,u)):lm(n,s,o)}});function Zc(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(ar(t)&&ar(e)){let n=Object.keys(e),i=Object.keys(t).filter(s=>n.indexOf(s)!==-1),r={...t,...e};for(let s of i){let o=Zc(t[s],e[s]);if(!o.valid)return{valid:!1,mergeErrorPath:[s,...o.mergeErrorPath]};r[s]=o.data}return{valid:!0,data:r}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let i=0;i<t.length;i++){let r=t[i],s=e[i],o=Zc(r,s);if(!o.valid)return{valid:!1,mergeErrorPath:[i,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function lm(t,e,n){let i=new Map,r;for(let a of e.issues)if(a.code==="unrecognized_keys"){r??(r=a);for(let u of a.keys)i.has(u)||i.set(u,{}),i.get(u).l=!0}else t.issues.push(a);for(let a of n.issues)if(a.code==="unrecognized_keys")for(let u of a.keys)i.has(u)||i.set(u,{}),i.get(u).r=!0;else t.issues.push(a);let s=[...i].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(s.length&&r&&t.issues.push({...r,keys:s}),di(t))return t;let o=Zc(e.value,n.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return t.value=o.data,t}var Z2=S("$ZodEnum",(t,e)=>{_e.init(t,e);let n=ap(e.entries),i=new Set(n);t._zod.values=i,t._zod.pattern=new RegExp(`^(${n.filter(r=>rk.has(typeof r)).map(r=>typeof r=="string"?mi(r):r.toString()).join("|")})$`),t._zod.parse=(r,s)=>{let o=r.value;return i.has(o)||r.issues.push({code:"invalid_value",values:n,input:o,inst:t}),r}}),X2=S("$ZodLiteral",(t,e)=>{if(_e.init(t,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");let n=new Set(e.values);t._zod.values=n,t._zod.pattern=new RegExp(`^(${e.values.map(i=>typeof i=="string"?mi(i):i?mi(i.toString()):String(i)).join("|")})$`),t._zod.parse=(i,r)=>{let s=i.value;return n.has(s)||i.issues.push({code:"invalid_value",values:e.values,input:s,inst:t}),i}}),G2=S("$ZodTransform",(t,e)=>{_e.init(t,e),t._zod.optin="optional",t._zod.parse=(n,i)=>{if(i.direction==="backward")throw new op(t.constructor.name);let r=e.transform(n.value,n);if(i.async)return(r instanceof Promise?r:Promise.resolve(r)).then(s=>(n.value=s,n.fallback=!0,n));if(r instanceof Promise)throw new li;return n.value=r,n.fallback=!0,n}});function hm(t,e){return e===void 0&&(t.issues.length||t.fallback)?{issues:[],value:void 0}:t}var Sp=S("$ZodOptional",(t,e)=>{_e.init(t,e),t._zod.optin="optional",t._zod.optout="optional",ne(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),ne(t._zod,"pattern",()=>{let n=e.innerType._zod.pattern;return n?new RegExp(`^(${nd(n.source)})?$`):void 0}),t._zod.parse=(n,i)=>{if(e.innerType._zod.optin==="optional"){let r=n.value,s=e.innerType._zod.run(n,i);return s instanceof Promise?s.then(o=>hm(o,r)):hm(s,r)}return n.value===void 0?n:e.innerType._zod.run(n,i)}}),J2=S("$ZodExactOptional",(t,e)=>{Sp.init(t,e),ne(t._zod,"values",()=>e.innerType._zod.values),ne(t._zod,"pattern",()=>e.innerType._zod.pattern),t._zod.parse=(n,i)=>e.innerType._zod.run(n,i)}),Q2=S("$ZodNullable",(t,e)=>{_e.init(t,e),ne(t._zod,"optin",()=>e.innerType._zod.optin),ne(t._zod,"optout",()=>e.innerType._zod.optout),ne(t._zod,"pattern",()=>{let n=e.innerType._zod.pattern;return n?new RegExp(`^(${nd(n.source)}|null)$`):void 0}),ne(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(n,i)=>n.value===null?n:e.innerType._zod.run(n,i)}),Y2=S("$ZodDefault",(t,e)=>{_e.init(t,e),t._zod.optin="optional",ne(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(n,i)=>{if(i.direction==="backward")return e.innerType._zod.run(n,i);if(n.value===void 0)return n.value=e.defaultValue,n;let r=e.innerType._zod.run(n,i);return r instanceof Promise?r.then(s=>fm(s,e)):fm(r,e)}});function fm(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}var e3=S("$ZodPrefault",(t,e)=>{_e.init(t,e),t._zod.optin="optional",ne(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(n,i)=>(i.direction==="backward"||n.value===void 0&&(n.value=e.defaultValue),e.innerType._zod.run(n,i))}),t3=S("$ZodNonOptional",(t,e)=>{_e.init(t,e),ne(t._zod,"values",()=>{let n=e.innerType._zod.values;return n?new Set([...n].filter(i=>i!==void 0)):void 0}),t._zod.parse=(n,i)=>{let r=e.innerType._zod.run(n,i);return r instanceof Promise?r.then(s=>mm(s,t)):mm(r,t)}});function mm(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}var n3=S("$ZodCatch",(t,e)=>{_e.init(t,e),t._zod.optin="optional",ne(t._zod,"optout",()=>e.innerType._zod.optout),ne(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(n,i)=>{if(i.direction==="backward")return e.innerType._zod.run(n,i);let r=e.innerType._zod.run(n,i);return r instanceof Promise?r.then(s=>(n.value=s.value,s.issues.length&&(n.value=e.catchValue({...n,error:{issues:s.issues.map(o=>Nn(o,i,Mn()))},input:n.value}),n.issues=[],n.fallback=!0),n)):(n.value=r.value,r.issues.length&&(n.value=e.catchValue({...n,error:{issues:r.issues.map(s=>Nn(s,i,Mn()))},input:n.value}),n.issues=[],n.fallback=!0),n)}}),i3=S("$ZodPipe",(t,e)=>{_e.init(t,e),ne(t._zod,"values",()=>e.in._zod.values),ne(t._zod,"optin",()=>e.in._zod.optin),ne(t._zod,"optout",()=>e.out._zod.optout),ne(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(n,i)=>{if(i.direction==="backward"){let s=e.out._zod.run(n,i);return s instanceof Promise?s.then(o=>lo(o,e.in,i)):lo(s,e.in,i)}let r=e.in._zod.run(n,i);return r instanceof Promise?r.then(s=>lo(s,e.out,i)):lo(r,e.out,i)}});function lo(t,e,n){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues,fallback:t.fallback},n)}var r3=S("$ZodReadonly",(t,e)=>{_e.init(t,e),ne(t._zod,"propValues",()=>e.innerType._zod.propValues),ne(t._zod,"values",()=>e.innerType._zod.values),ne(t._zod,"optin",()=>e.innerType?._zod?.optin),ne(t._zod,"optout",()=>e.innerType?._zod?.optout),t._zod.parse=(n,i)=>{if(i.direction==="backward")return e.innerType._zod.run(n,i);let r=e.innerType._zod.run(n,i);return r instanceof Promise?r.then(pm):pm(r)}});function pm(t){return t.value=Object.freeze(t.value),t}var s3=S("$ZodCustom",(t,e)=>{et.init(t,e),_e.init(t,e),t._zod.parse=(n,i)=>n,t._zod.check=n=>{let i=n.value,r=e.fn(i);if(r instanceof Promise)return r.then(s=>gm(s,n,i,t));gm(r,n,i,t)}});function gm(t,e,n,i){if(!t){let r={code:"custom",input:n,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(r.params=i._zod.def.params),e.issues.push(ur(r))}}var bm,o3=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...e){let n=e[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let e=this._map.get(t);return e&&typeof e=="object"&&"id"in e&&this._idmap.delete(e.id),this._map.delete(t),this}get(t){let e=t._zod.parent;if(e){let n={...this.get(e)??{}};delete n.id;let i={...n,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function a3(){return new o3}(bm=globalThis).__zod_globalRegistry??(bm.__zod_globalRegistry=a3());var ir=globalThis.__zod_globalRegistry;function u3(t,e){return new t({type:"string",...F(e)})}function c3(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...F(e)})}function vm(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...F(e)})}function d3(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...F(e)})}function l3(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...F(e)})}function h3(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...F(e)})}function f3(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...F(e)})}function m3(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...F(e)})}function p3(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...F(e)})}function g3(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...F(e)})}function b3(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...F(e)})}function v3(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...F(e)})}function _3(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...F(e)})}function x3(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...F(e)})}function w3(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...F(e)})}function y3(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...F(e)})}function k3(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...F(e)})}function E3(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...F(e)})}function S3(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...F(e)})}function z3(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...F(e)})}function C3(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...F(e)})}function T3(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...F(e)})}function O3(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...F(e)})}function R3(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...F(e)})}function L3(t,e){return new t({type:"string",format:"date",check:"string_format",...F(e)})}function I3(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...F(e)})}function M3(t,e){return new t({type:"string",format:"duration",check:"string_format",...F(e)})}function N3(t,e){return new t({type:"number",checks:[],...F(e)})}function A3(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...F(e)})}function P3(t,e){return new t({type:"boolean",...F(e)})}function F3(t){return new t({type:"unknown"})}function $3(t,e){return new t({type:"never",...F(e)})}function _m(t,e){return new vp({check:"less_than",...F(e),value:t,inclusive:!1})}function Lc(t,e){return new vp({check:"less_than",...F(e),value:t,inclusive:!0})}function xm(t,e){return new _p({check:"greater_than",...F(e),value:t,inclusive:!1})}function Ic(t,e){return new _p({check:"greater_than",...F(e),value:t,inclusive:!0})}function wm(t,e){return new e2({check:"multiple_of",...F(e),value:t})}function zp(t,e){return new n2({check:"max_length",...F(e),maximum:t})}function _o(t,e){return new i2({check:"min_length",...F(e),minimum:t})}function Cp(t,e){return new r2({check:"length_equals",...F(e),length:t})}function B3(t,e){return new s2({check:"string_format",format:"regex",...F(e),pattern:t})}function D3(t){return new o2({check:"string_format",format:"lowercase",...F(t)})}function q3(t){return new a2({check:"string_format",format:"uppercase",...F(t)})}function V3(t,e){return new u2({check:"string_format",format:"includes",...F(e),includes:t})}function j3(t,e){return new c2({check:"string_format",format:"starts_with",...F(e),prefix:t})}function H3(t,e){return new d2({check:"string_format",format:"ends_with",...F(e),suffix:t})}function gi(t){return new l2({check:"overwrite",tx:t})}function W3(t){return gi(e=>e.normalize(t))}function U3(){return gi(t=>t.trim())}function K3(){return gi(t=>t.toLowerCase())}function Z3(){return gi(t=>t.toUpperCase())}function X3(){return gi(t=>nk(t))}function G3(t,e,n){return new t({type:"array",element:e,...F(n)})}function J3(t,e,n){return new t({type:"custom",check:"custom",fn:e,...F(n)})}function Q3(t,e){let n=Y3(i=>(i.addIssue=r=>{if(typeof r=="string")i.issues.push(ur(r,i.value,n._zod.def));else{let s=r;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=i.value),s.inst??(s.inst=n),s.continue??(s.continue=!n._zod.def.abort),i.issues.push(ur(s))}},t(i.value,i)),e);return n}function Y3(t,e){let n=new et({check:"custom",...F(e)});return n._zod.check=t,n}function Tp(t){let e=t?.target??"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:t.processors??{},metadataRegistry:t?.metadata??ir,target:e,unrepresentable:t?.unrepresentable??"throw",override:t?.override??(()=>{}),io:t?.io??"output",counter:0,seen:new Map,cycles:t?.cycles??"ref",reused:t?.reused??"inline",external:t?.external??void 0}}function Ne(t,e,n={path:[],schemaPath:[]}){var i;let r=t._zod.def,s=e.seen.get(t);if(s)return s.count++,n.schemaPath.includes(t)&&(s.cycle=n.path),s.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};e.seen.set(t,o);let a=t._zod.toJSONSchema?.();if(a)o.schema=a;else{let c={...n,schemaPath:[...n.schemaPath,t],path:n.path};if(t._zod.processJSONSchema)t._zod.processJSONSchema(e,o.schema,c);else{let h=o.schema,l=e.processors[r.type];if(!l)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${r.type}`);l(t,e,h,c)}let d=t._zod.parent;d&&(o.ref||(o.ref=d),Ne(d,e,c),e.seen.get(d).isParent=!0)}let u=e.metadataRegistry.get(t);return u&&Object.assign(o.schema,u),e.io==="input"&&He(t)&&(delete o.schema.examples,delete o.schema.default),e.io==="input"&&"_prefault"in o.schema&&((i=o.schema).default??(i.default=o.schema._prefault)),delete o.schema._prefault,e.seen.get(t).schema}function Op(t,e){let n=t.seen.get(e);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=new Map;for(let o of t.seen.entries()){let a=t.metadataRegistry.get(o[0])?.id;if(a){let u=i.get(a);if(u&&u!==o[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(a,o[0])}}let r=o=>{let a=t.target==="draft-2020-12"?"$defs":"definitions";if(t.external){let d=t.external.registry.get(o[0])?.id,h=t.external.uri??(f=>f);if(d)return{ref:h(d)};let l=o[1].defId??o[1].schema.id??`schema${t.counter++}`;return o[1].defId=l,{defId:l,ref:`${h("__shared")}#/${a}/${l}`}}if(o[1]===n)return{ref:"#"};let u=`#/${a}/`,c=o[1].schema.id??`__schema${t.counter++}`;return{defId:c,ref:u+c}},s=o=>{if(o[1].schema.$ref)return;let a=o[1],{ref:u,defId:c}=r(o);a.def={...a.schema},c&&(a.defId=c);let d=a.schema;for(let h in d)delete d[h];d.$ref=u};if(t.cycles==="throw")for(let o of t.seen.entries()){let a=o[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>

Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let o of t.seen.entries()){let a=o[1];if(e===o[0]){s(o);continue}if(t.external){let u=t.external.registry.get(o[0])?.id;if(e!==o[0]&&u){s(o);continue}}if(t.metadataRegistry.get(o[0])?.id){s(o);continue}if(a.cycle){s(o);continue}if(a.count>1&&t.reused==="ref"){s(o);continue}}}function Rp(t,e){let n=t.seen.get(e);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=a=>{let u=t.seen.get(a);if(u.ref===null)return;let c=u.def??u.schema,d={...c},h=u.ref;if(u.ref=null,h){i(h);let f=t.seen.get(h),m=f.schema;if(m.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(m)):Object.assign(c,m),Object.assign(c,d),a._zod.parent===h)for(let p in c)p==="$ref"||p==="allOf"||p in d||delete c[p];if(m.$ref&&f.def)for(let p in c)p==="$ref"||p==="allOf"||p in f.def&&JSON.stringify(c[p])===JSON.stringify(f.def[p])&&delete c[p]}let l=a._zod.parent;if(l&&l!==h){i(l);let f=t.seen.get(l);if(f?.schema.$ref&&(c.$ref=f.schema.$ref,f.def))for(let m in c)m==="$ref"||m==="allOf"||m in f.def&&JSON.stringify(c[m])===JSON.stringify(f.def[m])&&delete c[m]}t.override({zodSchema:a,jsonSchema:c,path:u.path??[]})};for(let a of[...t.seen.entries()].reverse())i(a[0]);let r={};if(t.target==="draft-2020-12"?r.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?r.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?r.$schema="http://json-schema.org/draft-04/schema#":t.target,t.external?.uri){let a=t.external.registry.get(e)?.id;if(!a)throw new Error("Schema is missing an `id` property");r.$id=t.external.uri(a)}Object.assign(r,n.def??n.schema);let s=t.metadataRegistry.get(e)?.id;s!==void 0&&r.id===s&&delete r.id;let o=t.external?.defs??{};for(let a of t.seen.entries()){let u=a[1];u.def&&u.defId&&(u.def.id===u.defId&&delete u.def.id,o[u.defId]=u.def)}t.external||Object.keys(o).length>0&&(t.target==="draft-2020-12"?r.$defs=o:r.definitions=o);try{let a=JSON.parse(JSON.stringify(r));return Object.defineProperty(a,"~standard",{value:{...e["~standard"],jsonSchema:{input:xo(e,"input",t.processors),output:xo(e,"output",t.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function He(t,e){let n=e??{seen:new Set};if(n.seen.has(t))return!1;n.seen.add(t);let i=t._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return He(i.element,n);if(i.type==="set")return He(i.valueType,n);if(i.type==="lazy")return He(i.getter(),n);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault")return He(i.innerType,n);if(i.type==="intersection")return He(i.left,n)||He(i.right,n);if(i.type==="record"||i.type==="map")return He(i.keyType,n)||He(i.valueType,n);if(i.type==="pipe")return t._zod.traits.has("$ZodCodec")?!0:He(i.in,n)||He(i.out,n);if(i.type==="object"){for(let r in i.shape)if(He(i.shape[r],n))return!0;return!1}if(i.type==="union"){for(let r of i.options)if(He(r,n))return!0;return!1}if(i.type==="tuple"){for(let r of i.items)if(He(r,n))return!0;return!!(i.rest&&He(i.rest,n))}return!1}var e6=(t,e={})=>n=>{let i=Tp({...n,processors:e});return Ne(t,i),Op(i,t),Rp(i,t)},xo=(t,e,n={})=>i=>{let{libraryOptions:r,target:s}=i??{},o=Tp({...r??{},target:s,io:e,processors:n});return Ne(t,o),Op(o,t),Rp(o,t)},t6={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},n6=(t,e,n,i)=>{let r=n;r.type="string";let{minimum:s,maximum:o,format:a,patterns:u,contentEncoding:c}=t._zod.bag;if(typeof s=="number"&&(r.minLength=s),typeof o=="number"&&(r.maxLength=o),a&&(r.format=t6[a]??a,r.format===""&&delete r.format,a==="time"&&delete r.format),c&&(r.contentEncoding=c),u&&u.size>0){let d=[...u];d.length===1?r.pattern=d[0].source:d.length>1&&(r.allOf=[...d.map(h=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:h.source}))])}},i6=(t,e,n,i)=>{let r=n,{minimum:s,maximum:o,format:a,multipleOf:u,exclusiveMaximum:c,exclusiveMinimum:d}=t._zod.bag;typeof a=="string"&&a.includes("int")?r.type="integer":r.type="number";let h=typeof d=="number"&&d>=(s??Number.NEGATIVE_INFINITY),l=typeof c=="number"&&c<=(o??Number.POSITIVE_INFINITY),f=e.target==="draft-04"||e.target==="openapi-3.0";h?f?(r.minimum=d,r.exclusiveMinimum=!0):r.exclusiveMinimum=d:typeof s=="number"&&(r.minimum=s),l?f?(r.maximum=c,r.exclusiveMaximum=!0):r.exclusiveMaximum=c:typeof o=="number"&&(r.maximum=o),typeof u=="number"&&(r.multipleOf=u)},r6=(t,e,n,i)=>{n.type="boolean"},s6=(t,e,n,i)=>{n.not={}},o6=(t,e,n,i)=>{let r=t._zod.def,s=ap(r.entries);s.every(o=>typeof o=="number")&&(n.type="number"),s.every(o=>typeof o=="string")&&(n.type="string"),n.enum=s},a6=(t,e,n,i)=>{let r=t._zod.def,s=[];for(let o of r.values)if(o===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof o=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(o))}else s.push(o);if(s.length!==0)if(s.length===1){let o=s[0];n.type=o===null?"null":typeof o,e.target==="draft-04"||e.target==="openapi-3.0"?n.enum=[o]:n.const=o}else s.every(o=>typeof o=="number")&&(n.type="number"),s.every(o=>typeof o=="string")&&(n.type="string"),s.every(o=>typeof o=="boolean")&&(n.type="boolean"),s.every(o=>o===null)&&(n.type="null"),n.enum=s},u6=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},c6=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},d6=(t,e,n,i)=>{let r=n,s=t._zod.def,{minimum:o,maximum:a}=t._zod.bag;typeof o=="number"&&(r.minItems=o),typeof a=="number"&&(r.maxItems=a),r.type="array",r.items=Ne(s.element,e,{...i,path:[...i.path,"items"]})},l6=(t,e,n,i)=>{let r=n,s=t._zod.def;r.type="object",r.properties={};let o=s.shape;for(let c in o)r.properties[c]=Ne(o[c],e,{...i,path:[...i.path,"properties",c]});let a=new Set(Object.keys(o)),u=new Set([...a].filter(c=>{let d=s.shape[c]._zod;return e.io==="input"?d.optin===void 0:d.optout===void 0}));u.size>0&&(r.required=Array.from(u)),s.catchall?._zod.def.type==="never"?r.additionalProperties=!1:s.catchall?s.catchall&&(r.additionalProperties=Ne(s.catchall,e,{...i,path:[...i.path,"additionalProperties"]})):e.io==="output"&&(r.additionalProperties=!1)},h6=(t,e,n,i)=>{let r=t._zod.def,s=r.inclusive===!1,o=r.options.map((a,u)=>Ne(a,e,{...i,path:[...i.path,s?"oneOf":"anyOf",u]}));s?n.oneOf=o:n.anyOf=o},f6=(t,e,n,i)=>{let r=t._zod.def,s=Ne(r.left,e,{...i,path:[...i.path,"allOf",0]}),o=Ne(r.right,e,{...i,path:[...i.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1;n.allOf=[...a(s)?s.allOf:[s],...a(o)?o.allOf:[o]]},m6=(t,e,n,i)=>{let r=t._zod.def,s=Ne(r.innerType,e,i),o=e.seen.get(t);e.target==="openapi-3.0"?(o.ref=r.innerType,n.nullable=!0):n.anyOf=[s,{type:"null"}]},p6=(t,e,n,i)=>{let r=t._zod.def;Ne(r.innerType,e,i);let s=e.seen.get(t);s.ref=r.innerType},g6=(t,e,n,i)=>{let r=t._zod.def;Ne(r.innerType,e,i);let s=e.seen.get(t);s.ref=r.innerType,n.default=JSON.parse(JSON.stringify(r.defaultValue))},b6=(t,e,n,i)=>{let r=t._zod.def;Ne(r.innerType,e,i);let s=e.seen.get(t);s.ref=r.innerType,e.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(r.defaultValue)))},v6=(t,e,n,i)=>{let r=t._zod.def;Ne(r.innerType,e,i);let s=e.seen.get(t);s.ref=r.innerType;let o;try{o=r.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=o},_6=(t,e,n,i)=>{let r=t._zod.def,s=r.in._zod.traits.has("$ZodTransform"),o=e.io==="input"?s?r.out:r.in:r.out;Ne(o,e,i);let a=e.seen.get(t);a.ref=o},x6=(t,e,n,i)=>{let r=t._zod.def;Ne(r.innerType,e,i);let s=e.seen.get(t);s.ref=r.innerType,n.readOnly=!0},Lp=(t,e,n,i)=>{let r=t._zod.def;Ne(r.innerType,e,i);let s=e.seen.get(t);s.ref=r.innerType},w6=S("ZodISODateTime",(t,e)=>{S2.init(t,e),ge.init(t,e)});function y6(t){return R3(w6,t)}var k6=S("ZodISODate",(t,e)=>{z2.init(t,e),ge.init(t,e)});function E6(t){return L3(k6,t)}var S6=S("ZodISOTime",(t,e)=>{C2.init(t,e),ge.init(t,e)});function z6(t){return I3(S6,t)}var C6=S("ZodISODuration",(t,e)=>{T2.init(t,e),ge.init(t,e)});function T6(t){return M3(C6,t)}var O6=(t,e)=>{hp.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:n=>gk(t,n)},flatten:{value:n=>pk(t,n)},addIssue:{value:n=>{t.issues.push(n),t.message=JSON.stringify(t.issues,Kc,2)}},addIssues:{value:n=>{t.issues.push(...n),t.message=JSON.stringify(t.issues,Kc,2)}},isEmpty:{get(){return t.issues.length===0}}})},pt=S("ZodError",O6,{Parent:Error}),R6=rd(pt),L6=sd(pt),I6=Co(pt),M6=To(pt),N6=_k(pt),A6=xk(pt),P6=wk(pt),F6=yk(pt),$6=kk(pt),B6=Ek(pt),D6=Sk(pt),q6=zk(pt),ym=new WeakMap;function dr(t,e,n){let i=Object.getPrototypeOf(t),r=ym.get(i);if(r||(r=new Set,ym.set(i,r)),!r.has(e)){r.add(e);for(let s in n){let o=n[s];Object.defineProperty(i,s,{configurable:!0,enumerable:!1,get(){let a=o.bind(this);return Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:a}),a},set(a){Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:a})}})}}}var xe=S("ZodType",(t,e)=>(_e.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:xo(t,"input"),output:xo(t,"output")}}),t.toJSONSchema=e6(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.parse=(n,i)=>R6(t,n,i,{callee:t.parse}),t.safeParse=(n,i)=>I6(t,n,i),t.parseAsync=async(n,i)=>L6(t,n,i,{callee:t.parseAsync}),t.safeParseAsync=async(n,i)=>M6(t,n,i),t.spa=t.safeParseAsync,t.encode=(n,i)=>N6(t,n,i),t.decode=(n,i)=>A6(t,n,i),t.encodeAsync=async(n,i)=>P6(t,n,i),t.decodeAsync=async(n,i)=>F6(t,n,i),t.safeEncode=(n,i)=>$6(t,n,i),t.safeDecode=(n,i)=>B6(t,n,i),t.safeEncodeAsync=async(n,i)=>D6(t,n,i),t.safeDecodeAsync=async(n,i)=>q6(t,n,i),dr(t,"ZodType",{check(...n){let i=this.def;return this.clone(cn(i,{checks:[...i.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0})},with(...n){return this.check(...n)},clone(n,i){return dn(this,n,i)},brand(){return this},register(n,i){return n.add(this,i),this},refine(n,i){return this.check(A4(n,i))},superRefine(n,i){return this.check(P4(n,i))},overwrite(n){return this.check(gi(n))},optional(){return Sm(this)},exactOptional(){return y4(this)},nullable(){return zm(this)},nullish(){return Sm(zm(this))},nonoptional(n){return T4(this,n)},array(){return hi(this)},or(n){return f4([this,n])},and(n){return b4(this,n)},transform(n){return Cm(this,x4(n))},default(n){return S4(this,n)},prefault(n){return C4(this,n)},catch(n){return R4(this,n)},pipe(n){return Cm(this,n)},readonly(){return M4(this)},describe(n){let i=this.clone();return ir.add(i,{description:n}),i},meta(...n){if(n.length===0)return ir.get(this);let i=this.clone();return ir.add(i,n[0]),i},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(n){return n(this)}}),Object.defineProperty(t,"description",{get(){return ir.get(t)?.description},configurable:!0}),t)),Ip=S("_ZodString",(t,e)=>{od.init(t,e),xe.init(t,e),t._zod.processJSONSchema=(i,r,s)=>n6(t,i,r);let n=t._zod.bag;t.format=n.format??null,t.minLength=n.minimum??null,t.maxLength=n.maximum??null,dr(t,"_ZodString",{regex(...i){return this.check(B3(...i))},includes(...i){return this.check(V3(...i))},startsWith(...i){return this.check(j3(...i))},endsWith(...i){return this.check(H3(...i))},min(...i){return this.check(_o(...i))},max(...i){return this.check(zp(...i))},length(...i){return this.check(Cp(...i))},nonempty(...i){return this.check(_o(1,...i))},lowercase(i){return this.check(D3(i))},uppercase(i){return this.check(q3(i))},trim(){return this.check(U3())},normalize(...i){return this.check(W3(...i))},toLowerCase(){return this.check(K3())},toUpperCase(){return this.check(Z3())},slugify(){return this.check(X3())}})}),V6=S("ZodString",(t,e)=>{od.init(t,e),Ip.init(t,e),t.email=n=>t.check(c3(j6,n)),t.url=n=>t.check(m3(H6,n)),t.jwt=n=>t.check(O3(s4,n)),t.emoji=n=>t.check(p3(W6,n)),t.guid=n=>t.check(vm(km,n)),t.uuid=n=>t.check(d3(ho,n)),t.uuidv4=n=>t.check(l3(ho,n)),t.uuidv6=n=>t.check(h3(ho,n)),t.uuidv7=n=>t.check(f3(ho,n)),t.nanoid=n=>t.check(g3(U6,n)),t.guid=n=>t.check(vm(km,n)),t.cuid=n=>t.check(b3(K6,n)),t.cuid2=n=>t.check(v3(Z6,n)),t.ulid=n=>t.check(_3(X6,n)),t.base64=n=>t.check(z3(n4,n)),t.base64url=n=>t.check(C3(i4,n)),t.xid=n=>t.check(x3(G6,n)),t.ksuid=n=>t.check(w3(J6,n)),t.ipv4=n=>t.check(y3(Q6,n)),t.ipv6=n=>t.check(k3(Y6,n)),t.cidrv4=n=>t.check(E3(e4,n)),t.cidrv6=n=>t.check(S3(t4,n)),t.e164=n=>t.check(T3(r4,n)),t.datetime=n=>t.check(y6(n)),t.date=n=>t.check(E6(n)),t.time=n=>t.check(z6(n)),t.duration=n=>t.check(T6(n))});function Qe(t){return u3(V6,t)}var ge=S("ZodStringFormat",(t,e)=>{me.init(t,e),Ip.init(t,e)}),j6=S("ZodEmail",(t,e)=>{g2.init(t,e),ge.init(t,e)}),km=S("ZodGUID",(t,e)=>{m2.init(t,e),ge.init(t,e)}),ho=S("ZodUUID",(t,e)=>{p2.init(t,e),ge.init(t,e)}),H6=S("ZodURL",(t,e)=>{b2.init(t,e),ge.init(t,e)}),W6=S("ZodEmoji",(t,e)=>{v2.init(t,e),ge.init(t,e)}),U6=S("ZodNanoID",(t,e)=>{_2.init(t,e),ge.init(t,e)}),K6=S("ZodCUID",(t,e)=>{x2.init(t,e),ge.init(t,e)}),Z6=S("ZodCUID2",(t,e)=>{w2.init(t,e),ge.init(t,e)}),X6=S("ZodULID",(t,e)=>{y2.init(t,e),ge.init(t,e)}),G6=S("ZodXID",(t,e)=>{k2.init(t,e),ge.init(t,e)}),J6=S("ZodKSUID",(t,e)=>{E2.init(t,e),ge.init(t,e)}),Q6=S("ZodIPv4",(t,e)=>{O2.init(t,e),ge.init(t,e)}),Y6=S("ZodIPv6",(t,e)=>{R2.init(t,e),ge.init(t,e)}),e4=S("ZodCIDRv4",(t,e)=>{L2.init(t,e),ge.init(t,e)}),t4=S("ZodCIDRv6",(t,e)=>{I2.init(t,e),ge.init(t,e)}),n4=S("ZodBase64",(t,e)=>{M2.init(t,e),ge.init(t,e)}),i4=S("ZodBase64URL",(t,e)=>{A2.init(t,e),ge.init(t,e)}),r4=S("ZodE164",(t,e)=>{P2.init(t,e),ge.init(t,e)}),s4=S("ZodJWT",(t,e)=>{$2.init(t,e),ge.init(t,e)}),Mp=S("ZodNumber",(t,e)=>{wp.init(t,e),xe.init(t,e),t._zod.processJSONSchema=(i,r,s)=>i6(t,i,r),dr(t,"ZodNumber",{gt(i,r){return this.check(xm(i,r))},gte(i,r){return this.check(Ic(i,r))},min(i,r){return this.check(Ic(i,r))},lt(i,r){return this.check(_m(i,r))},lte(i,r){return this.check(Lc(i,r))},max(i,r){return this.check(Lc(i,r))},int(i){return this.check(Em(i))},safe(i){return this.check(Em(i))},positive(i){return this.check(xm(0,i))},nonnegative(i){return this.check(Ic(0,i))},negative(i){return this.check(_m(0,i))},nonpositive(i){return this.check(Lc(0,i))},multipleOf(i,r){return this.check(wm(i,r))},step(i,r){return this.check(wm(i,r))},finite(){return this}});let n=t._zod.bag;t.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),t.isFinite=!0,t.format=n.format??null});function Kt(t){return N3(Mp,t)}var o4=S("ZodNumberFormat",(t,e)=>{B2.init(t,e),Mp.init(t,e)});function Em(t){return A3(o4,t)}var a4=S("ZodBoolean",(t,e)=>{D2.init(t,e),xe.init(t,e),t._zod.processJSONSchema=(n,i,r)=>r6(t,n,i)});function We(t){return P3(a4,t)}var u4=S("ZodUnknown",(t,e)=>{q2.init(t,e),xe.init(t,e),t._zod.processJSONSchema=(n,i,r)=>{}});function Xc(){return F3(u4)}var c4=S("ZodNever",(t,e)=>{V2.init(t,e),xe.init(t,e),t._zod.processJSONSchema=(n,i,r)=>s6(t,n,i)});function d4(t){return $3(c4,t)}var l4=S("ZodArray",(t,e)=>{j2.init(t,e),xe.init(t,e),t._zod.processJSONSchema=(n,i,r)=>d6(t,n,i,r),t.element=e.element,dr(t,"ZodArray",{min(n,i){return this.check(_o(n,i))},nonempty(n){return this.check(_o(1,n))},max(n,i){return this.check(zp(n,i))},length(n,i){return this.check(Cp(n,i))},unwrap(){return this.element}})});function hi(t,e){return G3(l4,t,e)}var h4=S("ZodObject",(t,e)=>{W2.init(t,e),xe.init(t,e),t._zod.processJSONSchema=(n,i,r)=>l6(t,n,i,r),ne(t,"shape",()=>e.shape),dr(t,"ZodObject",{keyof(){return ad(Object.keys(this._zod.def.shape))},catchall(n){return this.clone({...this._zod.def,catchall:n})},passthrough(){return this.clone({...this._zod.def,catchall:Xc()})},loose(){return this.clone({...this._zod.def,catchall:Xc()})},strict(){return this.clone({...this._zod.def,catchall:d4()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(n){return ck(this,n)},safeExtend(n){return dk(this,n)},merge(n){return lk(this,n)},pick(n){return ak(this,n)},omit(n){return uk(this,n)},partial(...n){return hk(Ap,this,n[0])},required(...n){return fk(Pp,this,n[0])}})});function G(t,e){let n={type:"object",shape:t??{},...F(e)};return new h4(n)}var Np=S("ZodUnion",(t,e)=>{Ep.init(t,e),xe.init(t,e),t._zod.processJSONSchema=(n,i,r)=>h6(t,n,i,r),t.options=e.options});function f4(t,e){return new Np({type:"union",options:t,...F(e)})}var m4=S("ZodDiscriminatedUnion",(t,e)=>{Np.init(t,e),U2.init(t,e)});function p4(t,e,n){return new m4({type:"union",options:e,discriminator:t,...F(n)})}var g4=S("ZodIntersection",(t,e)=>{K2.init(t,e),xe.init(t,e),t._zod.processJSONSchema=(n,i,r)=>f6(t,n,i,r)});function b4(t,e){return new g4({type:"intersection",left:t,right:e})}var Gc=S("ZodEnum",(t,e)=>{Z2.init(t,e),xe.init(t,e),t._zod.processJSONSchema=(i,r,s)=>o6(t,i,r),t.enum=e.entries,t.options=Object.values(e.entries);let n=new Set(Object.keys(e.entries));t.extract=(i,r)=>{let s={};for(let o of i)if(n.has(o))s[o]=e.entries[o];else throw new Error(`Key ${o} not found in enum`);return new Gc({...e,checks:[],...F(r),entries:s})},t.exclude=(i,r)=>{let s={...e.entries};for(let o of i)if(n.has(o))delete s[o];else throw new Error(`Key ${o} not found in enum`);return new Gc({...e,checks:[],...F(r),entries:s})}});function ad(t,e){let n=Array.isArray(t)?Object.fromEntries(t.map(i=>[i,i])):t;return new Gc({type:"enum",entries:n,...F(e)})}var v4=S("ZodLiteral",(t,e)=>{X2.init(t,e),xe.init(t,e),t._zod.processJSONSchema=(n,i,r)=>a6(t,n,i),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function wo(t,e){return new v4({type:"literal",values:Array.isArray(t)?t:[t],...F(e)})}var _4=S("ZodTransform",(t,e)=>{G2.init(t,e),xe.init(t,e),t._zod.processJSONSchema=(n,i,r)=>c6(t,n),t._zod.parse=(n,i)=>{if(i.direction==="backward")throw new op(t.constructor.name);n.addIssue=s=>{if(typeof s=="string")n.issues.push(ur(s,n.value,e));else{let o=s;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=t),n.issues.push(ur(o))}};let r=e.transform(n.value,n);return r instanceof Promise?r.then(s=>(n.value=s,n.fallback=!0,n)):(n.value=r,n.fallback=!0,n)}});function x4(t){return new _4({type:"transform",transform:t})}var Ap=S("ZodOptional",(t,e)=>{Sp.init(t,e),xe.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Lp(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});function Sm(t){return new Ap({type:"optional",innerType:t})}var w4=S("ZodExactOptional",(t,e)=>{J2.init(t,e),xe.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Lp(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});function y4(t){return new w4({type:"optional",innerType:t})}var k4=S("ZodNullable",(t,e)=>{Q2.init(t,e),xe.init(t,e),t._zod.processJSONSchema=(n,i,r)=>m6(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});function zm(t){return new k4({type:"nullable",innerType:t})}var E4=S("ZodDefault",(t,e)=>{Y2.init(t,e),xe.init(t,e),t._zod.processJSONSchema=(n,i,r)=>g6(t,n,i,r),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function S4(t,e){return new E4({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():cp(e)}})}var z4=S("ZodPrefault",(t,e)=>{e3.init(t,e),xe.init(t,e),t._zod.processJSONSchema=(n,i,r)=>b6(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});function C4(t,e){return new z4({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():cp(e)}})}var Pp=S("ZodNonOptional",(t,e)=>{t3.init(t,e),xe.init(t,e),t._zod.processJSONSchema=(n,i,r)=>p6(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});function T4(t,e){return new Pp({type:"nonoptional",innerType:t,...F(e)})}var O4=S("ZodCatch",(t,e)=>{n3.init(t,e),xe.init(t,e),t._zod.processJSONSchema=(n,i,r)=>v6(t,n,i,r),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function R4(t,e){return new O4({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}var L4=S("ZodPipe",(t,e)=>{i3.init(t,e),xe.init(t,e),t._zod.processJSONSchema=(n,i,r)=>_6(t,n,i,r),t.in=e.in,t.out=e.out});function Cm(t,e){return new L4({type:"pipe",in:t,out:e})}var I4=S("ZodReadonly",(t,e)=>{r3.init(t,e),xe.init(t,e),t._zod.processJSONSchema=(n,i,r)=>x6(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});function M4(t){return new I4({type:"readonly",innerType:t})}var N4=S("ZodCustom",(t,e)=>{s3.init(t,e),xe.init(t,e),t._zod.processJSONSchema=(n,i,r)=>u6(t,n)});function A4(t,e={}){return J3(N4,t,e)}function P4(t,e){return Q3(t,e)}var pi=Xc(),F4=G({supportsContentEdits:We().optional(),supportsOptions:We().optional()}),$4=G({supportsContentEdits:We().optional(),supportsOptions:We().optional(),supportsForceUpdate:We().optional(),supportsHostTransport:We().optional()}),B4=G({offset:Kt().int().nonnegative(),length:Kt().int().nonnegative(),newText:Qe()}),Fp=p4("kind",[G({kind:wo("replace"),path:hi(Qe()),newValue:pi}),G({kind:wo("stringEdits"),path:hi(Qe()),stringEdits:hi(B4)})]),D4=G({content:pi.optional(),options:pi.optional(),readOnly:We().optional(),serverRevision:Kt().int().nonnegative().optional(),acknowledgedClientRevision:Kt().int().nonnegative().optional(),force:We().optional()}),q4=Ue({id:"web-editor-host",description:"Methods the host exposes to the editor (web-editor/0.12)."},{initialized:ue(G({protocolVersion:wo("web-editor/0.12"),contentType:ad(["text","json"]),capabilities:F4.optional()}),G({protocolVersion:wo("web-editor-host/0.12"),capabilities:$4.optional()})),applyContentEdit:$t(G({edits:hi(Fp),clientRevision:Kt().int().nonnegative(),basedOnServerRevision:Kt().int().nonnegative()})),reportSize:$t(G({height:Kt().nonnegative()}))}),V4=Ue({id:"web-editor",description:"Methods the editor exposes to the host (web-editor/0.12)."},{update:$t(D4),applyContentEdits:$t(G({edits:hi(Fp),serverRevision:Kt().int().nonnegative(),acknowledgedClientRevision:Kt().int().nonnegative()})),getContentSchema:ue(G({}),G({schema:pi}))}),j4=Ue({id:"web-editor-host-transport",description:"Optional messages the web editor sends to its host."},{message:$t(G({message:pi}))}),H4=Ue({id:"web-editor-client-transport",description:"Optional messages the web editor host sends to the editor."},{message:$t(G({message:pi}))}),fo=G({registered:We(),isDefault:We()}),ud=G({handleId:Qe(),appId:Qe(),serviceId:Qe(),serviceIdPrefix:Qe()}),W4=ud.extend({parentAppId:Qe()});Ue({id:"vscode-app-host",description:"Methods an app `.vscode-app.html` exposes to the host (vscode-app-host/0.1)."},{getContext:ue(G({}),G({dataDocument:G({contentType:ad(["text","json"])}).nullable(),embedding:W4.nullable()})),loadApp:ue(G({path:Qe()}),ud).withStream({server:G({})}),unloadApp:ue(G({handleId:Qe()}),G({})),embeddedReady:$t(G({})),setModalVisibility:ue(G({visible:We(),presentation:G({title:Qe().optional()}).optional()}),G({})),getEditorRegistration:ue(G({extension:Qe()}),G({global:fo,workspace:fo,hasWorkspace:We()})),configureEditorAssociation:ue(G({extension:Qe(),dismissable:We().optional()}),G({global:fo,workspace:fo,hasWorkspace:We(),changed:We()}))});Ue({id:"vscode-app-embedding-events",description:"Lifecycle notifications for child apps loaded by a VS Code app."},{changed:$t(ud),removed:$t(G({handleId:Qe()}))});function Tm(t,e){let n=t;for(let i of e)if(i.kind==="replace")n=Om(n,i.path,i.newValue);else{let r=K4(n,i.path);if(typeof r!="string")throw new Error(`applyContentEdits: stringEdits at path [${i.path.join(", ")}] requires a string, got ${typeof r}`);n=Om(n,i.path,U4(r,i.stringEdits))}return n}function U4(t,e){let n=t;for(let i of e)n=n.slice(0,i.offset)+i.newText+n.slice(i.offset+i.length);return n}function K4(t,e){let n=t;for(let i of e){if(n==null)return;n=n[i]}return n}function Om(t,e,n){if(e.length===0)return n;let i=t===null||typeof t!="object"?{}:t,r=i;for(let s=0;s<e.length-1;s++){let o=e[s],a=r[o];(a===null||typeof a!="object")&&(r[o]={}),r=r[o]}return r[e[e.length-1]]=n,i}function Mc(t,e){return e==="text"?t:t===""?null:JSON.parse(t)}function Rm(t,e,n={}){if(e==="text"){if(typeof t!="string")throw new Error(`decodeFromEditor: expected string for text content, got ${typeof t}`);return t}let i=n.indentation;if(t!==null&&typeof t=="object"&&!Array.isArray(t)){let r=t["$web-editor.format-json"];typeof r=="number"||r==="	"?i=r:r!==void 0&&(i=4)}return JSON.stringify(t,void 0,i)}var Nc=class{_listeners=new Set;event=t=>(this._listeners.add(t),{dispose:()=>this._listeners.delete(t)});fire(t){for(let e of this._listeners)try{e(t)}catch(n){console.error("Emitter listener threw:",n)}}dispose(){this._listeners.clear()}},Z4=class{_connection;_editor;_clientTransport;_contentType;_jsonFormat;_onError;_capabilities;_hostTransportSubscription;_text;_readOnly;_serverRevision=0;_acknowledgedClientRevision=0;_editorInitialized=!1;_editorCapabilities;_pendingHostTransportMessages=[];_onDidChangeText=new Nc;onDidChangeText=this._onDidChangeText.event;_onDidInitialize=new Nc;onDidInitialize=this._onDidInitialize.event;_onDidReportSize=new Nc;onDidReportSize=this._onDidReportSize.event;constructor(t){this._connection=t.connection,this._contentType=t.contentType??"text",this._text=t.initialText??"",this._readOnly=t.readOnly??!1,this._jsonFormat=t.jsonFormat??{},this._onError=t.onError??((e,n)=>console.error("WebEditorHost:",e,n)),this._capabilities={...t.capabilities??{supportsForceUpdate:!0},supportsHostTransport:t.hostTransport?!0:void 0},this._editor=this._connection.get(V4),this._clientTransport=this._connection.get(H4),this._connection.register(q4,{initialized:e=>{e.contentType!==this._contentType&&this._onError(`Editor contentType "${e.contentType}" does not match host "${this._contentType}"`),this._editorCapabilities=e.capabilities,this._editorInitialized=!0,this._serverRevision=0,this._acknowledgedClientRevision=0,this._pushFullUpdate();for(let n of this._pendingHostTransportMessages.splice(0))this._clientTransport.message({message:n});return this._onDidInitialize.fire({capabilities:e.capabilities}),{protocolVersion:"web-editor-host/0.12",capabilities:this._capabilities}},applyContentEdit:e=>{if(this._readOnly){this._onError("Editor sent applyContentEdit while readOnly"),this._acknowledgeAndRestore(e.clientRevision);return}if(e.basedOnServerRevision!==this._serverRevision){this._onError(`Editor edit is based on stale server revision ${e.basedOnServerRevision}; current revision is ${this._serverRevision}`),this._acknowledgeAndRestore(e.clientRevision);return}let n;try{n=Tm(Mc(this._text,this._contentType),e.edits)}catch(r){this._onError("Failed to apply content edits from editor",r),this._acknowledgeAndRestore(e.clientRevision);return}let i;try{i=Rm(n,this._contentType,this._jsonFormat)}catch(r){this._onError("Failed to decode editor content",r),this._acknowledgeAndRestore(e.clientRevision);return}this._acknowledgedClientRevision=Math.max(this._acknowledgedClientRevision,e.clientRevision),i!==this._text&&(this._text=i,this._onDidChangeText.fire({text:i})),this._pushAcknowledgement()},reportSize:e=>{this._onDidReportSize.fire({height:e.height})}}),t.hostTransport&&(this._connection.register(j4,{message:({message:e})=>t.hostTransport.sendMessage(e)}),this._hostTransportSubscription=t.hostTransport.onMessage(e=>{this._editorInitialized?this._clientTransport.message({message:e}):this._pendingHostTransportMessages.push(e)}))}getText(){return this._text}setText(t,e={}){t===this._text&&!e.force||(this._text=t,this._pushFullUpdate(e.force))}reuse(t,e){this._readOnly=e,this._text=t,this._pushFullUpdate(!0)}getReadOnly(){return this._readOnly}setReadOnly(t){this._readOnly!==t&&(this._readOnly=t,this._editorInitialized&&this._editor.update({readOnly:t,acknowledgedClientRevision:this._acknowledgedClientRevision}))}applyEdits(t){if(t.length===0||!this._editorInitialized)return;let e;try{e=Tm(Mc(this._text,this._contentType),t),this._text=Rm(e,this._contentType,this._jsonFormat)}catch(n){this._onError("Failed to apply outgoing edits to local text",n);return}this._serverRevision++,this._editor.applyContentEdits({edits:t,serverRevision:this._serverRevision,acknowledgedClientRevision:this._acknowledgedClientRevision})}dispose(){this._hostTransportSubscription?.dispose(),this._onDidChangeText.dispose(),this._onDidInitialize.dispose(),this._onDidReportSize.dispose(),this._pendingHostTransportMessages.length=0,this._connection.close()}_pushFullUpdate(t){if(!this._editorInitialized)return;this._serverRevision++;let e;try{e=Mc(this._text,this._contentType)}catch(n){this._onError("Failed to encode text for editor",n);return}this._editor.update({content:e,readOnly:this._readOnly,serverRevision:this._serverRevision,acknowledgedClientRevision:this._acknowledgedClientRevision,force:t})}_pushAcknowledgement(){this._editorInitialized&&this._editor.update({serverRevision:this._serverRevision,acknowledgedClientRevision:this._acknowledgedClientRevision})}_acknowledgeAndRestore(t){this._acknowledgedClientRevision=Math.max(this._acknowledgedClientRevision,t),this._pushFullUpdate(!0)}};function X4(t,e){let n=t.filter(s=>"language"in s.selector&&s.selector.language===e);if(n.length>0)return n.length===1?{kind:"match",provider:n[0]}:{kind:"ambiguous",providers:n};let i=-1,r=[];for(let s of t){if(!("languagePrefix"in s.selector)||!e.startsWith(s.selector.languagePrefix))continue;let o=s.selector.languagePrefix.length;o>i?(i=o,r=[s]):o===i&&r.push(s)}if(r.length!==0)return r.length===1?{kind:"match",provider:r[0]}:{kind:"ambiguous",providers:r}}var G4=`
	:root { color-scheme: light dark; }
	html, body { margin: 0; padding: 0; background: transparent; }
	body {
		font-family: var(--vscode-font-family, system-ui, sans-serif);
		font-size: var(--vscode-font-size, 13px);
		color: var(--vscode-foreground, #1e1e1e);
		box-sizing: border-box;
	}
`,yo="vscode-markdown-editor::control",J4=1e4;function Q4(t,e,n,i){let r=G4.replace(/<\/style/gi,"<\\/style"),s=(n??"").replace(/<\/style/gi,"<\\/style"),o=i?` nonce="${Lm(i)}"`:"",a=(e?`<base href="${Lm(e)}">`:"")+`<style data-vscode-markdown-editor-base>${r}</style><style data-vscode-markdown-editor-theme>${s}</style><script${o}>(function(){var t=document.currentScript.previousElementSibling;var sendSize=function(){parent.postMessage({type:${JSON.stringify(yo)},height:Math.max(document.documentElement.scrollHeight,document.body?document.body.scrollHeight:0)},"*");};addEventListener("message",function(e){if(e.source!==parent)return;var d=e.data;if(d&&d.type===${JSON.stringify(yo)}&&typeof d.themeCss==="string")t.textContent=d.themeCss;});addEventListener("load",sendSize);new ResizeObserver(sendSize).observe(document.documentElement);})();<\/script>`,u=i?t.replace(/<script\b(?![^>]*\bnonce\s*=)/gi,`<script${o}`):t,c=u.match(/<head[^>]*>/i);if(c?.index!==void 0){let h=c.index+c[0].length;return u.slice(0,h)+a+u.slice(h)}let d=u.match(/<html[^>]*>/i);if(d?.index!==void 0){let h=d.index+d[0].length;return u.slice(0,h)+`<head>${a}</head>`+u.slice(h)}return`<!doctype html><html><head>${a}</head><body>${u}</body></html>`}function Lm(t){return t.replaceAll("&","&amp;").replaceAll('"',"&quot;")}var ko=class{constructor(e){this._options=e,this._providers=e.providers,this._frameLayer=document.createElement("div"),this._frameLayer.style.position="absolute",this._frameLayer.style.inset="0",this._frameLayer.style.height="0",this._frameLayer.style.pointerEvents="none",this._frameLayer.style.zIndex="1",e.frameRoot&&this._setFrameRoot(e.frameRoot),this._observer=typeof IntersectionObserver>"u"?void 0:new IntersectionObserver(n=>{for(let i of n)Array.from(this._logicalEditors).find(r=>r.element===i.target)?.setVisible(i.isIntersecting)},{root:e.root??null})}_frameLayer;_frameRoot;_restoreFrameRootPosition;_layoutObserver;_layoutFrame=0;_observer;_logicalEditors=new Set;_pools=new Map;_descriptorCache=new Map;_rejectedProviders=new Set;_providers;_generation=0;_descriptorCacheHits=0;_disposed=!1;updateProviders(e){this._providers=e,this._generation++,this._descriptorCache.clear(),this._rejectedProviders.clear(),this._descriptorCacheHits=0,this._disposePools();for(let n of this._logicalEditors)n.invalidate();this._options.onDidChange?.()}get diagnostics(){let e=0,n=0;for(let i of this._pools.values())e+=i.leasedFrames,n+=i.idleFrames;return{logicalEditors:this._logicalEditors.size,leasedFrames:e,idleFrames:n,descriptorCacheEntries:this._descriptorCache.size,descriptorCacheHits:this._descriptorCacheHits}}create(e,n,i){let r=X4(this._providers,e);if(!r)return;if(r.kind==="ambiguous"){this._options.onAmbiguous?.(e,r.providers);return}let s=Mm(r.provider.id,n);if(this._rejectedProviders.has(s))return;let o=new Jc(this,r.provider,n,i,this._options.defaultHeight??120,this._generation);return this._logicalEditors.add(o),this._observer?.observe(o.element),this._layoutObserver&&o.observeLayout(this._layoutObserver),this._observer||o.setVisible(!0),o}dispose(){if(!this._disposed){this._disposed=!0,this._observer?.disconnect(),this._layoutObserver?.disconnect(),cancelAnimationFrame(this._layoutFrame),window.removeEventListener("resize",this._scheduleLayout);for(let e of Array.from(this._logicalEditors))e.dispose();this._disposePools(),this._frameLayer.remove(),this._frameRoot&&this._restoreFrameRootPosition!==void 0&&(this._frameRoot.style.position=this._restoreFrameRootPosition)}}remove(e){this._observer?.unobserve(e.element),this._layoutObserver?.unobserve(e.element),this._logicalEditors.delete(e),e.frame?.unbind()}async resolve(e,n){let i=Mm(e.provider.id,e.infoString),r=this._descriptorCache.get(i),s;try{r?this._descriptorCacheHits++:(r=e.provider.resolve(e.infoString),this._descriptorCache.set(i,r)),s=await r}catch{r&&this._descriptorCache.get(i)===r&&this._descriptorCache.delete(i),this._rejectEditor(e,n,i);return}if(this._disposed||e.disposed||n!==this._generation||!s){this._rejectEditor(e,n,i);return}let o=Y4(e.provider.id,s),a=this._pools.get(o);if(!a){let u=this._ensureFrameRoot(e);a=new Qc(e.provider,s,this._frameLayer,u,this._options.scriptNonce,this._options.themeCss,this._options.iframeBootstrapUrl),this._pools.set(o,a)}e.resolve(a)}_rejectEditor(e,n,i){e.resolve(void 0),!this._disposed&&!e.disposed&&n===this._generation&&(this._rejectedProviders.add(i),this._options.onDidChange?.())}_ensureFrameRoot(e){return this._frameRoot??this._setFrameRoot(e.element.closest(".md-editor")??(this._options.root instanceof HTMLElement?this._options.root:document.body))}_setFrameRoot(e){if(this._frameRoot=e,e!==document.body&&getComputedStyle(e).position==="static"&&(this._restoreFrameRootPosition=e.style.position,e.style.position="relative"),e.appendChild(this._frameLayer),typeof ResizeObserver<"u"){this._layoutObserver=new ResizeObserver(()=>this._scheduleLayout()),this._layoutObserver.observe(e);for(let n of this._logicalEditors)n.observeLayout(this._layoutObserver)}return window.addEventListener("resize",this._scheduleLayout),e}_scheduleLayout=()=>{this._layoutFrame||(this._layoutFrame=requestAnimationFrame(()=>{this._layoutFrame=0;for(let e of this._pools.values())e.layout()}))};_disposePools(){for(let e of this._pools.values())e.dispose();this._pools.clear()}},Jc=class{constructor(e,n,i,r,s,o){this._factory=e,this.provider=n,this.infoString=i,this._content=r,this.element=document.createElement("div"),this.element.style.width="100%",this.element.style.minHeight=`${s}px`,this._frameHost=document.createElement("div"),this._frameHost.style.width="100%",this.element.appendChild(this._frameHost),this.estimateHeight=()=>parseFloat(this.element.style.minHeight)||s,this._factory.resolve(this,o)}element;onEdit;estimateHeight;frame;disposed=!1;visible=!1;infoString;_frameHost;_content;_readOnly=!1;_pool;_resolved=!1;setContent(e){e!==this._content&&(this._content=e,this.frame?.bind(this))}setReadOnly(e){this._readOnly!==e&&(this._readOnly=e,this.frame?.bind(this))}setVisible(e){this.visible=e,this._resolved&&(e?this._pool?.acquire(this):this.hasFocus()||this._pool?.release(this))}resolve(e){this.disposed||(this._resolved=!0,this._pool=e,e?e.descriptor.initialHeight!==void 0&&(this.element.style.minHeight=`${e.descriptor.initialHeight}px`):this._renderFallback(),this.visible&&e?.acquire(this))}invalidate(){this.frame?.unbind(),this._pool=void 0,this._resolved=!1,this._renderFallback()}bindFrame(e){this.frame=e,e.layout(this)}unbindFrame(e){this.frame&&(this.element.style.minHeight=`${e}px`,this.frame=void 0)}applyGuestText(e){if(e===this._content)return;let n=j.replace(T.ofLength(this._content.length),e);this._content=e,this.onEdit?.(n)}applyHeight(e){let n=cd(e);this.element.style.minHeight=`${n}px`,this.frame&&(this.frame.iframe.style.height=`${n}px`,this.frame.layout(this))}observeLayout(e){e.observe(this.element)}hasFocus(){return this.frame!==void 0&&document.activeElement===this.frame.iframe}get content(){return this._content}get readOnly(){return this._readOnly}get frameHost(){return this._frameHost}dispose(){this.disposed||(this.disposed=!0,this._factory.remove(this),this.element.remove())}_renderFallback(){let e=document.createElement("pre"),n=document.createElement("code");n.textContent=this._content,e.appendChild(n),this._frameHost.replaceChildren(e)}},Qc=class{constructor(e,n,i,r,s,o,a){this._provider=e,this._frameLayer=i,this._frameRoot=r,this._scriptNonce=s,this._themeCss=o,this._iframeBootstrapUrl=a,this.descriptor=n}descriptor;_frames=new Set;get leasedFrames(){return Array.from(this._frames).filter(e=>e.editor!==void 0).length}get idleFrames(){return this._frames.size-this.leasedFrames}acquire(e){if(e.frame){e.frame.bind(e);return}(Array.from(this._frames).find(n=>n.editor===void 0)??this._createFrame()).bind(e)}release(e){let n=e.frame;!n||n.editor!==e||e.hasFocus()||n.unbind()}park(e){e.style.top="-100000px",e.style.left="0"}dispose(){for(let e of this._frames)e.dispose();this._frames.clear()}layout(){for(let e of this._frames)e.editor&&e.layout(e.editor)}_createFrame(){let e=this.descriptor.hostTransport?this._provider.createHostTransport?.(this.descriptor.runtimeKey):void 0,n=new Yc(this,this.descriptor,e,this._frameLayer,this._frameRoot,this._scriptNonce,this._themeCss,this._iframeBootstrapUrl);return this._frames.add(n),n}},Yc=class{constructor(e,n,i,r,s,o,a,u){this._descriptor=n,this._hostTransport=i,this._frameRoot=s,this._scriptNonce=o,this._themeCss=a,this._iframeBootstrapUrl=u,this.pool=e;let c=document.createElement("iframe");c.setAttribute("sandbox",$p(n.sandbox)),c.setAttribute("allow",n.sandbox?.clipboardWrite?"clipboard-write":""),c.style.width="100%",c.style.border="none",c.style.display="block",c.style.position="absolute",c.style.pointerEvents="auto",c.style.background="transparent",c.style.height=`${n.initialHeight??120}px`,e.park(c),c.addEventListener("blur",()=>{let d=this.editor;d&&!d.visible&&this.pool.release(d)}),this.iframe=c,this._onWindowMessage=d=>{if(d.source!==c.contentWindow)return;let h=d.data;h?.type!==yo||typeof h.height!="number"||!Number.isFinite(h.height)||this._applyReportedHeight(h.height)},window.addEventListener("message",this._onWindowMessage),r.appendChild(c),queueMicrotask(()=>this._setup())}iframe;editor;pool;_host;_transport;_pendingEditor;_reportedHeight;_disposed=!1;_onWindowMessage;bind(e){if(this.editor===e){this._host?.setText(e.content),this._host?.setReadOnly(e.readOnly),e.applyHeight(Im(this._reportedHeight,e.estimateHeight()));return}this.editor&&this.editor!==e&&this.unbind(),this._pendingEditor=e,this._host&&this._host.reuse(e.content,e.readOnly),this.editor=e,this._pendingEditor=void 0,e.bindFrame(this),e.applyHeight(Im(this._reportedHeight,e.estimateHeight()))}unbind(){let e=this.editor;if(!e)return;let n=parseFloat(this.iframe.style.height)||this._descriptor.initialHeight||120;this.editor=void 0,e.unbindFrame(n),this.pool.park(this.iframe)}layout(e){if(this.editor!==e)return;let n=e.element.getBoundingClientRect(),i=this._frameRoot.getBoundingClientRect(),r=this._frameRoot===document.body,s=r?n.top+window.scrollY:n.top-i.top+this._frameRoot.scrollTop,o=r?n.left+window.scrollX:n.left-i.left+this._frameRoot.scrollLeft;this.iframe.style.top=`${s}px`,this.iframe.style.left=`${o}px`,this.iframe.style.width=`${n.width}px`}dispose(){this._disposed||(this._disposed=!0,this.unbind(),window.removeEventListener("message",this._onWindowMessage),this._host?.dispose(),this._transport?.dispose(),this._hostTransport?.dispose(),this.iframe.remove())}_setup(){if(this._disposed)return;let e=this.iframe.contentWindow;if(!e){requestAnimationFrame(()=>this._setup());return}this._transport=new Yy(window,e);let n=new Zy(ip.create(this._transport)),i=this._pendingEditor??this.editor;this._host=new Z4({connection:n,contentType:this._descriptor.contentType??"text",initialText:i?.content??"",readOnly:i?.readOnly??!1,hostTransport:this._hostTransport}),this._host.onDidChangeText(({text:s})=>this.editor?.applyGuestText(s)),this._host.onDidReportSize(({height:s})=>this._applyReportedHeight(s)),this.iframe.addEventListener("load",()=>this._postTheme(),{once:!0});let r=Q4(this._descriptor.html,this._descriptor.resourceBaseUrl,this._getThemeCss(),this._scriptNonce);this._iframeBootstrapUrl?(this.iframe.addEventListener("load",()=>{let s=this.iframe.contentDocument;s&&(s.open(),s.write(r),s.close())},{once:!0}),this.iframe.src=this._iframeBootstrapUrl):this.iframe.srcdoc=r}_getThemeCss(){return typeof this._themeCss=="function"?this._themeCss():this._themeCss}_postTheme(){let e=this._getThemeCss();e!==void 0&&this.iframe.contentWindow?.postMessage({type:yo,themeCss:e},"*")}_applyReportedHeight(e){this._reportedHeight=cd(e),this.editor?.applyHeight(this._reportedHeight)}};function $p(t){let e=["allow-scripts","allow-same-origin"];return t?.forms&&e.push("allow-forms"),t?.downloads&&e.push("allow-downloads"),t?.pointerLock&&e.push("allow-pointer-lock"),e.join(" ")}function cd(t){return Math.max(1,Math.min(J4,Math.ceil(t)))}function Im(t,e){return cd(t??e)}function Mm(t,e){return`${t}\0${e}`}function Y4(t,e){return[t,e.runtimeKey,e.html,e.resourceBaseUrl??"",e.hostTransport===!0?"host-transport":"",e.contentType??"text",$p(e.sandbox),e.sandbox?.clipboardWrite===!0?"clipboard-write":""].join("\0")}function Bp(){let t=[];for(let e=1;e<=15;e++){let n=[];e&1&&n.push("font-style: italic;"),e&2&&n.push("font-weight: bold;");let i=[];e&4&&i.push("underline"),e&8&&i.push("line-through"),i.length&&n.push(`text-decoration: ${i.join(" ")};`),t.push(`.tok-mdhl-fs-${e} { ${n.join(" ")} }`)}return t.join(`
`)}function eE(t){return t.map((e,n)=>`.tok-mdhl-fg-${n} { color: ${e}; }`).join(`
`)}function tE(t,e){let n=[];return t>0&&n.push(`mdhl-fg-${t}`),e>0&&n.push(`mdhl-fs-${e}`),n.length?n.join("."):void 0}function dd(t){let e=0;for(let i of t)e+=i.length;let n=T.ofLength(e);return{getTokens:()=>({range:n,tokens:t})}}function ld(t){return t>0?[{length:t,className:void 0}]:[]}function nE(t,e,n){let i=n-e;if(i===0)return t;if(t.length===0)return ld(n);let r=t[t.length-1],s=r.length+i;return s<=0?ld(n):[...t.slice(0,-1),{length:s,className:r.className}]}var hd=class{#e;#t;snapshot;#i;#r;constructor(e,n,i){this.#i=e,this.#r=n,this.#e=i,this.#t=ld(i.length),this.snapshot=H("mdSyntaxHighlight",dd(this.#t)),this.#o(i)}update(e,n){let i=e.apply(this.#e),r=this.#e.length;this.#t=nE(this.#t,r,i.length),this.#e=i,this.snapshot.set(dd(this.#t),n,Di.replace(T.ofLength(r),i.length)),this.#o(i)}refresh(){this.#o(this.#e)}dispose(){this.#i._remove(this)}async#o(e){let n=await this.#i.request(e,this.#r);e===this.#e&&(this.#t=n.tokens.map(i=>({length:i.length,className:tE(i.foreground,i.fontStyle)})),this.snapshot.set(dd(this.#t),void 0,Di.replace(T.ofLength(e.length),e.length)))}},Ro=class{#e=0;#t=new Map;#i=new Set;#r;#o;constructor(e){this.#o=e,this.#r=document.createElement("style"),this.#r.textContent=Bp(),document.head.appendChild(this.#r)}create(e,n){let i=new hd(this,e,n);return this.#i.add(i),i}request(e,n){let i=this.#e++;return new Promise(r=>{this.#t.set(i,r),this.#o({type:"highlight",requestId:i,source:e,languageId:n})})}handleMessage(e){switch(e.type){case"highlightResult":{let n=this.#t.get(e.requestId);return n&&(this.#t.delete(e.requestId),this.#s(e.colorMap),n({tokens:e.tokens,colorMap:e.colorMap})),!0}case"highlightThemeChanged":{for(let n of this.#i)n.refresh();return!0}default:return!1}}_remove(e){this.#i.delete(e)}#s(e){this.#r.textContent=`${Bp()}
${eE(e)}`}};var Lo=class extends be{#e=new Map;#t;#i;#r=!1;constructor(e,n){super(),this.#t=e.map(i=>({id:i.id,uriPattern:new RegExp(i.source,i.flags),kind:i.kind})),this.#i=n}createLinkPresentation(e){let n=this.#t.find(s=>iE(s.uriPattern,e));if(!n)return;let i=this.#e.get(e);i||(i={presentation:H(`linkPresentation:${e}`,{kind:n.kind,isLoading:!0}),references:0},this.#e.set(e,i)),i.references++,this.#s();let r=!1;return{presentation:i.presentation,dispose:()=>{r||(r=!0,this.#o(e,i))}}}handleMessage(e){if(!Io(e)||e.type!=="richLinkPresentations"||!Array.isArray(e.presentations))return!1;for(let n of e.presentations){if(!Io(n)||typeof n.href!="string")continue;let i=this.#e.get(n.href);i&&i.presentation.set(rE(n.presentation),void 0)}return!0}dispose(){this.#e.clear(),super.dispose()}#o(e,n){n.references--,n.references===0&&this.#e.get(e)===n&&(this.#e.delete(e),this.#s())}#s(){this.#r||(this.#r=!0,queueMicrotask(()=>{this.#r=!1,this.#i({type:"richLinkTargets",hrefs:[...this.#e.keys()]})}))}};function iE(t,e){return t.lastIndex=0,t.test(e)}function rE(t){if(!Io(t)||!sE(t.kind))return;let e=typeof t.title=="string"?t.title:void 0,n=typeof t.detail=="string"?t.detail:void 0,i=typeof t.reference=="string"?t.reference:void 0,r=typeof t.tooltip=="string"?t.tooltip:void 0,s=typeof t.ariaLabel=="string"?t.ariaLabel:void 0,o=Dp(t.status),a=Dp(t.secondaryStatus),u=t.isLoading===!0;return{kind:t.kind,...e?{title:e}:{},...n?{detail:n}:{},...i?{reference:i}:{},...o?{status:o}:{},...a?{secondaryStatus:a}:{},...r?{tooltip:r}:{},...s?{ariaLabel:s}:{},...u?{isLoading:!0}:{}}}function Dp(t){return Io(t)&&oE(t.kind)&&typeof t.label=="string"?{kind:t.kind,label:t.label}:void 0}function sE(t){return t==="resource"||t==="issue"||t==="pullRequest"||t==="commit"||t==="file"||t==="folder"||t==="session"||t==="repository"||t==="branch"}function oE(t){return t==="neutral"||t==="pending"||t==="success"||t==="warning"||t==="error"||t==="open"||t==="closed"||t==="merged"||t==="draft"||t==="notPlanned"}function Io(t){return typeof t=="object"&&t!==null}var md=class{constructor(e,n,i){this.runtimeId=e;this.#i=n,this.#r=i}runtimeId;#e=new Set;#t=[];#i;#r;#o=!1;#s=!1;onMessage=e=>{if(this.#s)throw new Error("Code block editor host transport is disposed");if(this.#e.add(e),!this.#o){this.#o=!0;for(let n of this.#t.splice(0))e(n)}return{dispose:()=>this.#e.delete(e)}};sendMessage(e){if(this.#s)throw new Error("Code block editor host transport is disposed");this.#i(e)}acceptMessage(e){if(!this.#s){if(!this.#o){this.#t.push(e);return}for(let n of this.#e)n(e)}}dispose(){this.#s||(this.#s=!0,this.#t.length=0,this.#e.clear(),this.#r())}},pd=class extends be{model=new as;isUpdatingFromExtension=!1;#e=!1;#t=0;#i=[];#r=1;#o=1;#s=new Map;#a=new Map;#f;#u;#m;#c;#d=new Qs;#p;#g=H("acceptsComments",!1);#b;#n=acquireVsCodeApi();#v=new Ro(e=>this.#n.postMessage(e));#l;constructor(e,n){super();let i=document.querySelector('meta[name="vscode-markdown-editor-message-secret"]')?.content;if(!i)throw new Error("Missing Markdown editor message secret");this.#b=i,this.#c=n.editEpoch,this.#l=n.richLinksEnabled?this._register(new Lo(n.linkPresentationRules,r=>this.#n.postMessage(r))):void 0,this.model.sourceText.set(new Tn(n.content),void 0),this.model.readonlyMode.set(n.readonly,void 0),window.addEventListener("message",r=>{let s=r.data;if(!(!s||typeof s!="object"||s.messageSecret!==this.#b)&&!this.#v.handleMessage(s)&&!this.#l?.handleMessage(s))switch(s.type){case"update":{if(typeof s.editEpoch!="number"||!Number.isInteger(s.editEpoch)||s.editEpoch<0)break;this.#c=s.editEpoch,this.isUpdatingFromExtension=!0,this.model.replaceSourceText(new Tn(s.content)),this.isUpdatingFromExtension=!1;break}case"codeBlockEditorProviders":{let o=dE(s.codeBlockEditorProviders);this.#i=o,this.#m?.updateProviders(this.#_(o));break}case"resolvedCodeBlockEditor":{if(typeof s.requestId!="number")break;let o=this.#s.get(s.requestId);o&&(this.#s.delete(s.requestId),o(qp(s.descriptor)));break}case"codeBlockEditorHostTransportMessage":{typeof s.runtimeId=="string"&&this.#a.get(s.runtimeId)?.acceptMessage(s.message);break}case"gutterMarkers":{let o=s.markers.map(a=>({range:T.fromTo(a.start,a.endExclusive),type:a.type}));this.model.gutterMarkers.set(o,void 0);break}case"comments":{this.#e=!0,this.#d.set(s.comments.map(o=>({id:o.id,range:T.fromTo(o.start,o.endExclusive),body:o.body,author:o.author}))),this.#e=!1,this.#g.set(!!s.acceptsComments,void 0);break}case"revealComment":{this.#p?.revealComment(s.id);break}case"revealLinkTarget":{let o=this.model.sourceText.get().value.length;typeof s.start=="number"&&Number.isInteger(s.start)&&s.start>=0&&typeof s.endExclusive=="number"&&Number.isInteger(s.endExclusive)&&s.endExclusive>=s.start&&s.endExclusive<=o&&typeof s.selectionStart=="number"&&Number.isInteger(s.selectionStart)&&s.selectionStart>=0&&s.selectionStart<=o&&(ke(a=>{this.model.pendingParagraph.set(void 0,a),this.model.selectionSource.set("user",a),this.model.selection.set(N.collapsed(s.selectionStart),a)}),this.#u?.focus(),this.#u?.revealRangeAtTop(T.fromTo(s.start,s.endExclusive)));break}case"command":{let o=Pn.find(a=>a.id===s.command);o&&this.#f?.executeCommand(o);break}}}),this.#w(e,n.content),this.#n.postMessage({type:"ready",documentVersion:n.documentVersion,editEpoch:this.#c}),this._register({dispose:()=>{for(let r of this.#s.values())r(void 0);this.#s.clear();for(let r of Array.from(this.#a.values()))r.dispose()}})}#w(e,n){let i=this.model,r=document.querySelector('meta[name="vscode-markdown-editor-script-nonce"]')?.content,s=new URL(location.href);s.pathname="/fake.html";let o=this._register(new ko({providers:this.#_(this.#i),scriptNonce:r,themeCss:()=>`:root { ${document.documentElement.getAttribute("style")??""} }`,iframeBootstrapUrl:s.href,onAmbiguous:(y,z)=>this.#n.postMessage({type:"codeBlockEditorDiagnostic",message:`Ambiguous providers for ${y}: ${z.map(k=>k.id).join(", ")}`}),onDidChange:()=>this.#u?.refreshEmbeddedCodeEditors()}));this.#m=o;let a=this.#x(),u=this._register(new Us(i,{classNames:["md-theme-vscode-default"],syntaxHighlighter:this.#v,linkPresentationProvider:this.#l,embeddedCodeEditorFactory:o,onEmbeddedCodeEditorEdit:(y,z)=>{let k=i.document.get(),C=Ve(k,y);if(C===void 0)return;let L=C+y.codeOffset;i.applyEdit(new j(z.replacements.map(B=>Ce.replace(B.replaceRange.delta(L),B.newText))))},onOpenLink:y=>{this.#n.postMessage({type:"openLink",href:y})},onToggleCheckbox:(y,z)=>{i.setTaskCheckboxChecked(y,z)},renderCustomCodeBlock:(y,z)=>{if(y!=="mermaid")return;let k=document.createElement("div");k.className="md-mermaid",k.textContent=z,k.setAttribute("aria-busy","true");let C=`mermaid-${this.#t++}`;return aE().then(L=>L.render(C,z)).then(({svg:L})=>{k.innerHTML=L,k.setAttribute("aria-busy","false")}).catch(L=>{k.textContent=z,k.setAttribute("aria-busy","false"),this.#n.postMessage({type:"codeBlockEditorDiagnostic",message:`Failed to render Mermaid diagram: ${L instanceof Error?L.message:String(L)}`})}),k}}));this.#u=u,this.#f=this._register(new Gs(i,u,{clipboardStrategy:new Xs,keyboardProfile:Nf,forwardedKeyboardProfile:Af,historyStrategy:{undo:()=>this.#n.postMessage({type:"history",command:"undo"}),redo:()=>this.#n.postMessage({type:"history",command:"redo"})}}));let c,d=()=>{let y=document.hasFocus()&&document.activeElement===u.element;y!==c&&(c=y,this.#n.postMessage({type:"editorFocusChanged",focused:y}))},h=()=>queueMicrotask(d);document.addEventListener("focusin",d),document.addEventListener("focusout",h),window.addEventListener("focus",d),window.addEventListener("blur",d),this._register({dispose:()=>{document.removeEventListener("focusin",d),document.removeEventListener("focusout",h),window.removeEventListener("focus",d),window.removeEventListener("blur",d)}}),e.appendChild(u.element),d(),this.#p=this._register(new Ys(this.#d,u));let l;this._register(te(y=>{let z=y.readObservable(this.#g);z&&!l?l=new Js(i,u,{onSubmit:({text:k,range:C})=>{this.#n.postMessage({type:"addComment",start:C.start,endExclusive:C.endExclusive,text:k})}}):!z&&l&&(l.dispose(),l=void 0)})),this._register({dispose:()=>l?.dispose()});let f=new Set(this.#d.comments.get().map(y=>y.id));if(this._register(te(y=>{let z=new Set(y.readObservable(this.#d.comments).map(k=>k.id));if(!this.#e)for(let k of f)z.has(k)||this.#n.postMessage({type:"deleteComment",id:k});f=z})),a.selection){let y=n.length,z=Math.min(a.selection.anchor,y),k=Math.min(a.selection.active,y);i.selection.set(new N(z,k),void 0)}let m=!1,p=()=>{m=!1,this.#h({scrollTop:e.scrollTop})},g=()=>{m||(m=!0,requestAnimationFrame(p))};e.addEventListener("scroll",g,{passive:!0}),this._register({dispose:()=>e.removeEventListener("scroll",g)});let b=()=>{document.visibilityState==="hidden"&&this.#h({scrollTop:e.scrollTop})};document.addEventListener("visibilitychange",b),window.addEventListener("pagehide",p),this._register({dispose:()=>{document.removeEventListener("visibilitychange",b),window.removeEventListener("pagehide",p)}}),this._register(te(y=>{let z=y.readObservable(this.model.selection);this.#h({selection:z?{anchor:z.anchor,active:z.active}:void 0})}));let w=!0;this._register(te(y=>{let z=y.readObservable(this.model.readonlyMode);w||this.#n.postMessage({type:"setReadonly",readonly:z}),w=!1}));let x=this.model.sourceText.get().value;this._register(te(y=>{let z=y.readObservable(this.model.sourceText).value;!this.isUpdatingFromExtension&&z!==x&&this.#n.postMessage({type:"edit",...pE(x,z),editEpoch:this.#c}),x=z})),this.#E(e,a.scrollTop)}#_(e){return e.map(n=>({id:n.id,selector:n.selector,createHostTransport:i=>this.#y(n.id,i),resolve:n.source.kind==="static"?async()=>n.source.kind==="static"?n.source.descriptor:void 0:i=>this.#k(n.id,i)}))}#y(e,n){let i=`${e}:${this.#o++}`,r=new md(i,s=>this.#n.postMessage({type:"codeBlockEditorHostTransportMessage",runtimeId:i,message:s}),()=>{this.#a.delete(i),this.#n.postMessage({type:"disposeCodeBlockEditorHostTransport",runtimeId:i})});return this.#a.set(i,r),this.#n.postMessage({type:"createCodeBlockEditorHostTransport",runtimeId:i,providerId:e,runtimeKey:n}),r}#k(e,n){let i=this.#r++;return new Promise(r=>{this.#s.set(i,r),this.#n.postMessage({type:"resolveCodeBlockEditor",requestId:i,providerId:e,language:n})})}#x(){return this.#n.getState()??{}}#h(e){this.#n.setState({...this.#x(),...e})}#E(e,n){if(typeof n!="number"||n<=0)return;let i=0,r=()=>{e.scrollTop=n,++i<6&&Math.abs(e.scrollTop-n)>1&&requestAnimationFrame(r)};requestAnimationFrame(r)}},fd;function aE(){return fd||(fd=import("./mermaid.core-OF7Z62KM.js").then(t=>(t.default.initialize({startOnLoad:!1,theme:"default"}),t.default))),fd}function uE(){let t=document.getElementById("vscode-markdown-editor-initial-state");if(!(t instanceof HTMLMetaElement))throw new Error("Markdown editor initial state was not found.");t.remove();let e=JSON.parse(decodeURIComponent(t.content));if(!cE(e))throw new Error("Markdown editor initial state is invalid.");return e}function cE(t){if(!t||typeof t!="object")return!1;let e=t;return typeof e.content=="string"&&typeof e.documentVersion=="number"&&typeof e.editEpoch=="number"&&Number.isInteger(e.editEpoch)&&e.editEpoch>=0&&typeof e.readonly=="boolean"&&typeof e.richLinksEnabled=="boolean"&&Array.isArray(e.linkPresentationRules)}function dE(t){return Array.isArray(t)?t.filter(lE):[]}function lE(t){if(typeof t!="object"||t===null)return!1;let e=t;return typeof e.id=="string"&&hE(e.selector)&&fE(e.source)}function hE(t){if(!t||typeof t!="object")return!1;let e=t;return typeof e.language=="string"&&e.languagePrefix===void 0||e.language===void 0&&typeof e.languagePrefix=="string"}function fE(t){if(!t||typeof t!="object")return!1;let e=t;return e.kind==="exportApi"||e.kind==="static"&&qp(e.descriptor)!==void 0}function qp(t){if(!t||typeof t!="object")return;let e=t;if(!(typeof e.html!="string"||typeof e.runtimeKey!="string"||e.runtimeKey.length===0||e.resourceBaseUrl!==void 0&&typeof e.resourceBaseUrl!="string"||e.hostTransport!==void 0&&typeof e.hostTransport!="boolean"||e.contentType!=="text"&&e.contentType!=="json"||e.cacheKey!==void 0&&typeof e.cacheKey!="string"||e.initialHeight!==void 0&&(typeof e.initialHeight!="number"||!Number.isFinite(e.initialHeight)||e.initialHeight<=0)||!mE(e.sandbox)))return e}function mE(t){if(t===void 0)return!0;if(!t||typeof t!="object")return!1;let e=t;return["forms","downloads","pointerLock","clipboardWrite"].every(n=>e[n]===void 0||typeof e[n]=="boolean")}function pE(t,e){let n=0;for(;n<t.length&&n<e.length&&t.charCodeAt(n)===e.charCodeAt(n);)n++;let i=t.length,r=e.length;for(;i>n&&r>n&&t.charCodeAt(i-1)===e.charCodeAt(r-1);)i--,r--;return{start:n,endExclusive:i,text:e.slice(n,r)}}new pd(document.getElementById("editor"),uE());